diff --git a/.analysis/README.md b/.analysis/README.md new file mode 100644 index 0000000..ed6e7ad --- /dev/null +++ b/.analysis/README.md @@ -0,0 +1,14 @@ +# Analysis Assets + +Этот каталог содержит служебные артефакты для аналитической и генеративной работы агента. + +## Структура + +- `rules/` — правила построения документации, frontmatter и шаблоны документов. + +## Назначение + +Каталог `.analysis/` отделен от `docs/`, чтобы: +- хранить служебные policy- и template-материалы вне пользовательской документации; +- передавать правила в LLM как отдельный policy-context; +- не смешивать документацию проекта и внутренние артефакты анализа. diff --git a/.analysis/rules/documentation-rules.md b/.analysis/rules/documentation-rules.md new file mode 100644 index 0000000..9d0b884 --- /dev/null +++ b/.analysis/rules/documentation-rules.md @@ -0,0 +1,32 @@ +# Documentation Rules + +## Назначение + +Этот файл фиксирует общие правила формирования, обновления и поддержки технической документации проекта. + +Документация проекта должна создаваться как система атомарных, связанных между собой документов, пригодных: +- для чтения человеком; +- для сопровождения командой; +- для индексирования в RAG; +- для автоматического обновления агентом на основе кода и существующих артефактов. + +Этот файл задает: +- общие принципы документационной архитектуры; +- правила декомпозиции документации; +- правила размещения файлов; +- требования к связям между документами; +- требования к качеству markdown-документов; +- правила генерации и обновления документации агентом. + +Детальные шаблоны документов и правила frontmatter описываются отдельно: +- `.analysis/rules/frontmatter-rules.md` +- `.analysis/rules/templates/*.md` + +--- + +## Область действия + +Правила из этого файла применяются ко всей проектной документации, размещаемой в: + +```text +docs/documentation/ diff --git a/.analysis/rules/frontmatter-rules.md b/.analysis/rules/frontmatter-rules.md new file mode 100644 index 0000000..3785aae --- /dev/null +++ b/.analysis/rules/frontmatter-rules.md @@ -0,0 +1,60 @@ +# Frontmatter Rules + +## Назначение + +Этот файл фиксирует правила YAML frontmatter для документов в `docs/documentation/`. + +Frontmatter обязателен для каждого markdown-документа и нужен для: +- идентификации документа; +- определения типа документа; +- фиксации связей с кодом и другими документами; +- выделения сущностей, тегов и домена; +- поддержки индексирования в RAG. + +Общие правила построения документации описаны в: +- `.analysis/rules/documentation-rules.md` + +Шаблоны markdown body описаны в: +- `.analysis/rules/templates/*.md` + +--- + +## Общие правила + +1. Frontmatter размещается в начале файла. +2. Формат — YAML между двумя строками `---`. +3. Все документы в `docs/documentation/` должны содержать frontmatter. +4. Поля должны быть стабильными и заполняться единообразно. +5. Не использовать произвольные поля без необходимости. +6. Если значение неизвестно и его нельзя уверенно вывести из evidence, поле лучше не заполнять, кроме обязательных полей. +7. Списковые поля должны оформляться как YAML-массивы. +8. Идентификаторы и ссылки должны быть стабильными и пригодными для машинной обработки. + +--- + +## Базовый frontmatter + +Каждый документ должен начинаться с frontmatter вида: + +```yaml +--- +id: api-orders-create +title: Метод создания заказа +doc_type: api_method +domain: orders +status: draft +owner: system-analyst +source_of_truth: code +related_docs: + - ui-order-create-page + - logic-order-validation +related_code: + - src/orders/api/create_order.py +entities: + - Order + - CreateOrder +tags: + - api + - orders + - create +--- diff --git a/.analysis/rules/legacy/rule_templates_path.md b/.analysis/rules/legacy/rule_templates_path.md new file mode 100644 index 0000000..5c83f8f --- /dev/null +++ b/.analysis/rules/legacy/rule_templates_path.md @@ -0,0 +1,29 @@ +# Rule: Use Document Templates From Fixed Paths + +Агент должен создавать и обновлять техническую документацию только с опорой на шаблоны документов, расположенные в `.analysis/rules`. + +Если агент формирует новый документ, он обязан: + +- определить тип документа; +- выбрать соответствующий шаблон по фиксированному пути; +- сохранить структуру секций и базовых метаданных из шаблона; +- заполнять только те секции, которые подтверждены кодом и артефактами; +- не придумывать новые произвольные форматы, если для типа уже существует шаблон. + +Пути к базовым шаблонам: + +- `.analysis/rules/legacy/template_ui_page.md` +- `.analysis/rules/legacy/template_api_method.md` +- `.analysis/rules/legacy/template_logic_block.md` + +Правило выбора шаблона: + +- для документа типа `ui_page` использовать `.analysis/rules/legacy/template_ui_page.md` +- для документа типа `api_method` использовать `.analysis/rules/legacy/template_api_method.md` +- для документа типа `logic_block` использовать `.analysis/rules/legacy/template_logic_block.md` + +Если для нужного типа шаблон отсутствует, агент должен: + +1. использовать ближайший подходящий существующий шаблон как временную основу; +2. явно сохранить тип документа в `YAML frontmatter`; +3. не смешивать в одном документе несколько независимых сущностей. diff --git a/.analysis/rules/legacy/template_api_method.md b/.analysis/rules/legacy/template_api_method.md new file mode 100644 index 0000000..dee4bba --- /dev/null +++ b/.analysis/rules/legacy/template_api_method.md @@ -0,0 +1,89 @@ +# Template: api_method + +```md +--- +id: api- +title: +doc_type: api_method +status: draft +source_of_truth: code +domain: +owner: system-analyst +endpoint: +auth: +idempotent: +related_docs: + - +related_code: + - +entities: + - +tags: + - api +--- + +# + +## Purpose + +Кратко опиши, какую системную задачу решает метод. + +## Endpoint Summary + +- Endpoint: `` +- Auth: `` +- Idempotent: `` +- Triggered by: `` + +## Technical Use Case + +Опиши пошагово обработку запроса: + +- вход в endpoint; +- ключевые проверки; +- вызовы логики; +- обращения к БД и внешним системам; +- формирование ответа. + +## Functional Requirements + +Вынеси сюда подтвержденные правила, которые дополняют основной сценарий: + +- валидации; +- branching logic; +- побочные эффекты; +- ограничения по данным; +- условия ошибок. + +## Request and Response Contract + +Опиши контракт в кратком виде или дай ссылку на OpenAPI / контрактный файл. + +## Related Logic Blocks + +- []() + +## Data Access and Integrations + +- Reads DB: `` +- Writes DB: `` +- Integrates with: `` + +## Non-Functional Requirements + +Укажи только подтвержденные НФТ: + +- timeout; +- audit; +- monitoring; +- security; +- idempotency rules. + +## Related Code + +- `` + +## Related Documents + +- []() +``` diff --git a/.analysis/rules/legacy/template_logic_block.md b/.analysis/rules/legacy/template_logic_block.md new file mode 100644 index 0000000..ce3eed6 --- /dev/null +++ b/.analysis/rules/legacy/template_logic_block.md @@ -0,0 +1,71 @@ +# Template: logic_block + +```md +--- +id: logic- +title: +doc_type: logic_block +status: draft +source_of_truth: code +domain: +owner: system-analyst +related_docs: + - +related_code: + - +entities: + - +tags: + - logic +--- + +# + +## Purpose + +Кратко опиши, какую переиспользуемую или устойчивую логику реализует блок. + +## Where Used + +- Called from: `` +- Used by: `` + +## Technical Use Case + +Опиши пошагово, как работает логический блок: + +- входные данные; +- ключевые проверки; +- преобразования; +- обращения к данным; +- результат работы. + +## Functional Requirements + +Вынеси сюда устойчивые правила и ограничения: + +- бизнес-правила; +- проверки; +- ветвления; +- ограничения на вход и выход; +- условия отказа. + +## Dependencies + +- Uses logic: `` +- Reads DB: `` +- Writes DB: `` +- Integrates with: `` + +## Error Cases + +Опиши значимые ошибки и условия их возникновения, если они подтверждены кодом. + +## Related Code + +- `` + +## Related Documents + +- []() +``` diff --git a/.analysis/rules/legacy/template_ui_page.md b/.analysis/rules/legacy/template_ui_page.md new file mode 100644 index 0000000..9b88dab --- /dev/null +++ b/.analysis/rules/legacy/template_ui_page.md @@ -0,0 +1,82 @@ +# Template: ui_page + +```md +--- +id: ui- +title: +doc_type: ui_page +status: draft +source_of_truth: code +domain: +owner: system-analyst +related_docs: + - +related_code: + - +entities: + - +tags: + - ui +--- + +# + +## Purpose + +Кратко опиши, какую пользовательскую задачу решает страница. + +## Route and Entry Points + +- Route: `` +- Entry points: `` + +## Technical Use Case + +Опиши пошаговый сценарий работы страницы как поток действий и системных реакций. + +## UI Structure + +Перечисли основные UI-элементы и для каждого укажи: + +- назначение; +- источник данных; +- значение по умолчанию или placeholder; +- условия доступности или активации; +- поведение при взаимодействии; +- правила валидации. + +## Functional Requirements + +Вынеси сюда детальные правила, которые не стоит перегружать в use case: + +- вызовы API; +- обработку ответов; +- локальные правила отображения; +- условия переходов; +- feature toggles. + +## Related APIs + +- []() + +## Related Logic Blocks + +- []() + +## Non-Functional Requirements + +Укажи НФТ, если они подтверждены: + +- analytics events; +- observability; +- feature toggles; +- security constraints. + +## Related Code + +- `` + +## Related Documents + +- []() +``` diff --git a/.analysis/rules/templates/api_method.md b/.analysis/rules/templates/api_method.md new file mode 100644 index 0000000..5b5c02f --- /dev/null +++ b/.analysis/rules/templates/api_method.md @@ -0,0 +1,115 @@ +# {{title}} + +## Summary +- Purpose: +- Actor: +- Trigger: +- Endpoint: +- Main entities: +- Main logic: +- Main errors: +- Source of truth: + +## Назначение + +## Контекст + +## Технический use case + +### Основной сценарий + +1. +2. +3. + +### Альтернативные ветки + +- +- + +## Функциональные требования + +### Request validation +- + +### Processing rules +- + +### State changes +- + +### Side effects +- + +## Contract + +### Endpoint +- Method: +- Path: +- Auth: +- Idempotent: +- Timeout: +- Retry: + +### Request +| Field | Type | Required | Constraints | Description | +|------|------|----------|-------------|-------------| +| | | | | | + +### Response +| Field | Type | Description | +|------|------|-------------| +| | | | + +### External contract refs +- OpenAPI: +- Schema: +- DTO / serializer: +- Additional refs: + +## Errors + +| error_id | http_code | when | client_behavior | retry | +|----------|-----------|------|-----------------|-------| +| | | | | | + +## Нефункциональные требования + +### Security +- + +### Observability +- Logs: +- Metrics: +- Traces: +- Audit: + +### Reliability +- +- + +### Performance +- + +## Связанные блоки логики +- + +## Связанные сущности +- + +## Связанный код + +### Files +- + +### Symbols +- + +## Связанные документы +- + +## История изменений + +| Date | Source | Changes | +|------|--------|---------| +| | | | \ No newline at end of file diff --git a/.analysis/rules/templates/architecture_overview.md b/.analysis/rules/templates/architecture_overview.md new file mode 100644 index 0000000..538fed9 --- /dev/null +++ b/.analysis/rules/templates/architecture_overview.md @@ -0,0 +1,105 @@ +# {{title}} + +## Summary +- Scope: +- Purpose: +- Main modules: +- Main domains: +- Main integrations: +- Key entrypoints: +- Key data flows: +- Source of truth: + +## Назначение + +## Контекст + +## Границы системы + +### In scope +- + +### Out of scope +- + +## Архитектурная схема + +## Основные модули + +| module | responsibility | depends_on | key_code_refs | +|--------|----------------|------------|---------------| +| | | | | + +## Основные доменные области + +- +- + +## Основные интеграции + +| integration | direction | purpose | protocol / transport | related_docs | +|-------------|-----------|---------|----------------------|--------------| +| | | | | | + +## Основные потоки + +### Flow 1 +1. +2. +3. + +### Flow 2 +1. +2. +3. + +## Архитектурные решения и ограничения + +### Key decisions +- + +### Constraints +- + +### Risks +- + +## Нефункциональные аспекты + +### Security +- + +### Reliability +- + +### Observability +- Logs: +- Metrics: +- Traces: +- Audit: + +### Performance +- + +### Scalability +- + +## Связанные сущности +- + +## Связанный код + +### Files +- + +### Symbols +- + +## Связанные документы +- + +## История изменений + +| Date | Source | Changes | +|------|--------|---------| +| | | | \ No newline at end of file diff --git a/.analysis/rules/templates/domain_entity.md b/.analysis/rules/templates/domain_entity.md new file mode 100644 index 0000000..5492550 --- /dev/null +++ b/.analysis/rules/templates/domain_entity.md @@ -0,0 +1,92 @@ +# {{title}} + +## Summary +- Domain: +- Purpose: +- Entity role: +- Main attributes: +- Lifecycle: +- Invariants: +- Related APIs: +- Related logic: +- Source of truth: + +## Назначение + +## Контекст + +## Роль в доменной модели + +## Атрибуты + +| attribute | type | required | description | constraints | +|-----------|------|----------|-------------|-------------| +| | | | | | + +## Состояния и жизненный цикл + +### Основные состояния +- + +### Переходы состояний +1. +2. +3. + +## Инварианты и ограничения + +- +- + +## Связи с другими сущностями + +| entity | relation | description | +|--------|----------|-------------| +| | | | + +## Использование в системе + +### Related API +- + +### Related UI +- + +### Related logic +- + +### Related integrations +- + +## Функциональные требования + +- +- + +## Нефункциональные требования + +### Audit / history +- + +### Security +- + +### Observability +- + +## Связанный код + +### Files +- + +### Symbols +- + +## Связанные документы +- + +## История изменений + +| Date | Source | Changes | +|------|--------|---------| +| | | | \ No newline at end of file diff --git a/.analysis/rules/templates/logic_block.md b/.analysis/rules/templates/logic_block.md new file mode 100644 index 0000000..2ba7fc0 --- /dev/null +++ b/.analysis/rules/templates/logic_block.md @@ -0,0 +1,93 @@ +```md +# {{title}} + +## Summary +- Purpose: +- Trigger: +- Inputs: +- Outputs: +- Main entities: +- Main dependencies: +- Side effects: +- Source of truth: + +## Назначение + +## Контекст + +## Технический use case + +### Основной сценарий + +1. +2. +3. + +### Альтернативные ветки + +- +- + +## Функциональные требования + +### Preconditions +- + +### Processing rules +- + +### Validation rules +- + +### Output / result rules +- + +### Side effects +- + +## Ограничения и условия вызова + +- +- + +## Нефункциональные требования + +### Security +- + +### Observability +- Logs: +- Metrics: +- Traces: +- Audit: + +### Reliability +- +- + +### Performance +- + +## Связанные API / UI / integration points +- + +## Связанные сущности +- + +## Связанный код + +### Files +- + +### Symbols +- + +## Связанные документы +- + +## История изменений + +| Date | Source | Changes | +|------|--------|---------| +| | | | +``` diff --git a/.analysis/rules/templates/ui_page.md b/.analysis/rules/templates/ui_page.md new file mode 100644 index 0000000..f9bc770 --- /dev/null +++ b/.analysis/rules/templates/ui_page.md @@ -0,0 +1,97 @@ +# {{title}} + +## Summary +- Purpose: +- Actor: +- Trigger: +- Route: +- Main API: +- Main entities: +- Main logic: +- Main states: +- Source of truth: + +## Назначение + +## Контекст + +## Технический use case + +### Основной сценарий + +1. +2. +3. + +### Альтернативные ветки + +- +- + +## Описание UI + +## UI Elements + +| id | type | label | data_source | default / placeholder | validation | behavior | +|----|------|-------|-------------|------------------------|------------|----------| +| | | | | | | | + +## Функциональные требования + +### Input rules +- + +### State rules +- + +### Navigation rules +- + +### Client-side validation +- + +## Нефункциональные требования + +### Security +- + +### Observability +- Logs: +- Metrics: +- Traces: +- Analytics: + +### Accessibility +- + +### Performance +- + +### Feature toggles +- + +## Связанные API +- + +## Связанные блоки логики +- + +## Связанные сущности +- + +## Связанный код + +### Files +- + +### Symbols +- + +## Связанные документы +- + +## История изменений + +| Date | Source | Changes | +|------|--------|---------| +| | | | \ No newline at end of file diff --git a/.cursor/rules/documentation.mdc b/.cursor/rules/documentation.mdc new file mode 100644 index 0000000..ec43d94 --- /dev/null +++ b/.cursor/rules/documentation.mdc @@ -0,0 +1,15 @@ +--- +alwaysApply: true +--- + +При задачах на создание или обновление документации всегда: +1. Читай .analysis/rules/documentation-rules.md, .analysis/rules/frontmatter-rules.md и нужный шаблон из .analysis/rules/templates/. +2. Создавай и обновляй документы только в docs/documentation/. +3. Не создавай дублей: сначала ищи существующий документ, потом обновляй его. +4. Соблюдай принцип: один документ = одна сущность / один устойчивый аспект. +5. Каждый документ должен иметь YAML frontmatter, обязательные разделы Summary и Details и структуру по шаблону. +6. Все связи фиксируй явно: related_docs, related_code, entities, tags и typed-поля. +7. Используй только подтвержденный evidence из кода, контрактов, конфигов и существующей документации. +8. Не дублируй содержание между документами — используй ссылки. +9. Явно указывай связанный код и связанные документы. +10. Не выдумывай факты, если evidence недостаточно. diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 0000000..99e1eb2 --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,25 @@ +{ + "version": "0.2.0", + "configurations": [ + { + "name": "Agent Backend: Uvicorn (Debug)", + "type": "python", + "request": "launch", + "module": "uvicorn", + "args": [ + "app.main:app", + "--host", + "0.0.0.0", + "--port", + "15000" + ], + "cwd": "${workspaceFolder}", + "envFile": "${workspaceFolder}/.env", + "env": { + "PYTHONPATH": "${workspaceFolder}/src" + }, + "console": "integratedTerminal", + "justMyCode": false + } + ] +} diff --git a/Dockerfile b/Dockerfile index b6eae60..7c5e0a0 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,12 +3,13 @@ FROM python:3.12-slim WORKDIR /app ENV PYTHONDONTWRITEBYTECODE=1 \ - PYTHONUNBUFFERED=1 + PYTHONUNBUFFERED=1 \ + PYTHONPATH=/app/src COPY requirements.txt ./ RUN pip install --no-cache-dir -r requirements.txt -COPY app ./app +COPY src ./src EXPOSE 15000 diff --git a/_process/01. Process.md b/_process/01. Process.md new file mode 100644 index 0000000..11847ba --- /dev/null +++ b/_process/01. Process.md @@ -0,0 +1,126 @@ +# Процессы работы с документацией (AS IS / TO BE) + + +## Основные артефакты системной аналитики +Системные аналитики работают с 3 артефактами: + +- бизнес-требованиями +- системной аналитикой +- технической документацией + + +### Бизнес требования +Описывает бизнес и пользовательские требования, пользователькие use case, макеты экранов. +Сейчас не всегда оформляется как отдельный документ, часто этот шаг пропускается и требования фиксируются сразу в документе системной аналитики. + + +### Системная аналитика +Документ описыватет изменения в автоматизированной системе. Пишется системными аналитиками для разработчиков и тестировщиков. Так же этот документ проходит согласование с экспертами по архитектуре, безопасности, сопровождению. + +Может описывать как целиком процесс (в случае реализации с нуля), так и инкремент, который вносит небольшие изменения в существующие процессы. + +В данном документе содкржится вся информация по сути вносимых изменений, но отсутствует контекст о текущей реализации системы. + +Состоит из разделов: +- Цели - короткое описание какую проблему и для кого решаем. +- Процесс AS IS и TO BE - фокус на изменения с точки зрения бизнес функций, без технической детализации. +- Ограничения - ограничения и допущения в реализации. +- Архитектура - описывает схему уровня контейнеров, основной фокус на интеграции между контейнерами и интеграционные сценарии. +- Функциональные требования - описывают изменения в системе. +- Нефункциональные требования - требования к аудиту, мониторингу, фичетоглам, пользовтелькой аналитике. + + +### Техническая документация +Техническая документация описывает реализацию системы. Эта информация используется командой разработки при проектировании и реализации новых фичей, понимании как работает система. Артефакт живет чуть впереди кода +Представялет из себя иерархическую модель документов, сейчас реализованную в конфлюенсе. + +Есть несколько типов страниц, каждая из которы описывает определенный тип функциональности + +- UI страницы +- API методы +- БД +- Логические блоки + +#### UI страницы +Описывают экран на UI. +**Декомпозиция** +Как правило на страницу с описанием выносится целый макет/страница фронтального приложения, с одной основной интеграцией и опционально вспомогательными интеграциями. +Например - форма создания сущности. Есть вспомогательгные методы для полученяи правочников, использующихся при заполнении полей на форме, и вызов оснвного метода создания сущности. + +Таким образом приложение декомпозируется на отдельные экраны, коотры свызываются между собой последовательно, но сами по себе являются независимыми + +**Состав описания** +Все разделы обязательны. +Страница с описанием содержит: + - Краткое описание + - Технический use case + - Описание макета с декомпозицией на компоненты + их поведение + - Функциональные требования - описание интеграций и логики, специфичной для этой формы UI + - Нефункциональные требования - фичетоглы и события пользовательской аналитики + + +#### API методы +**Декомпозиция** +На каждый метод API заводится отдельная страница. +**Состав описания** +Все разделы обязательны. +Страница с описанием содержит: + - Краткое описание + - Технический use case + - Функциональные требования - описание интеграций и логики, специфичной для этой формы UI + - Нефункциональные требования - фичетоглы и события пользовательской аналитики + - Контракт метода - описание запроса и ответа. Для ответа так же приводится описание как заполнять поля. + +#### БД +**Декомпозиция** +Сейсас это только странциа с описанием таблица. На каждую таблицу заводится отдельная страница. +**Состав описания** +Все разделы обязательны. +Страница с описанием содержит: + - Краткое описание + - Таблица с офисанием физической модели данных + +#### Логические блоки +**Декомпозиция** +На отдельную страницу может быть вынесен общий переиспользуемый блок логики. Это позволяет не дублировать его на страницах документации. Как правило соответствует реализации общего компонента в коде. +**Состав описания** +Часть разделов в описании может отсутствовать. + - Краткое описание + - Технический use case + - Функциональные требования - описание интеграций и логики, специфичной для этой формы UI + - Нефункциональные требования - фичетоглы и события пользовательской аналитики + +#### Прочие особенности процесса +##### Описание технических use cases +Сценарий описывает основные шаги процесса в разрезе участников, все технические детали, если их нельзя описать одним предложением, выносятся в разделы функциональных требований, нефункциональных требований, или даются ссылки на другие страницы (как правило это страницы с логическими блоками). + +В технических use cases приводятся ссылки на страницы с описнаием вызываемых методов API. Особенно это актуально для страниц фронта, т.к. он использует наши методы API, которые есть в документации. Для интеграций с другими АС как правило приводистя ссылка на описание конфлюенса. + + + +## AS IS +Сейчас все артефакты ведутся в конфлюенс. Одна страница содержит описанием одного аретфакта (бизнес требования, системная аналитика, страница документации), страницы организованы иерархически, используюстя ссылки для обозначения связей. + +Проблемы: +- документация со временем теряет актуальность +- отсутствие автоматизации +- ручное ведение +--- + +## TO BE + +Целевое состояние: +- аналитик продолжает писать артефакты бизнес-требований и системной аналитики +- агент генерирует и обновляет документацию по странице системной аналитики +- документация становится инженерным артефактом, который ведется в GIT + +### Форматы +- Markdown +- OpenAPI +- Mermaid / PlantUML + +### Роль агента +- использование документации как базы знаний - как для ответов на вопросы, так и для проектирования изменений в системе. +- внесение изменений в документацию по артефактам системной аналитики +- генерация из документации спецификаций OPENAPI и JSON-schema + diff --git a/_process/02. Agent architecture.md b/_process/02. Agent architecture.md new file mode 100644 index 0000000..e865e41 --- /dev/null +++ b/_process/02. Agent architecture.md @@ -0,0 +1,235 @@ +Ниже обновленная версия с учетом гибридной модели интент роутера. + +--- + +## 1. Концепция агента + +Агент проектируется как intent-driven система для работы с кодом и документацией, где пользовательский запрос сначала нормализуется и интерпретируется, затем по нему извлекается релевантный контекст из многослойного RAG, после чего специализированный task workflow выполняет целевую задачу. Агент не является единым “умным чатом”: логика разделена на маршрутизацию, retrieval и специализированные execution workflows. Проверка evidence, вызовы LLM и правила сборки ответа находятся внутри task workflows и зависят от типа задачи. + +--- + +## 2. Компонентная модель + +```mermaid +flowchart LR + IDE[IDE Plugin / Client] --> API[API Layer] + API --> IR[IntentRouter V3] + IR --> RAG[Retrieval RAG] + + RAG --> TW1[Task Workflow: Documentation Explain] + RAG --> TW2[Task Workflow: OpenAPI Generation] + RAG --> TW3[Task Workflow: Documentation Generation] + RAG --> TWN[Other Specialized Task Workflows] + + TW1 --> OUT[Response / Artifact] + TW2 --> OUT + TW3 --> OUT + TWN --> OUT +``` + +--- + +## 3. Основной flow процесса + +### Основной процесс + +1. Пользователь отправляет запрос через IDE plugin или другой клиент. +2. `API Layer` принимает запрос и передает его в агент. +3. `IntentRouter V3`: + + * нормализует запрос; + * детерминированно извлекает ключевые артефакты; + * с помощью LLM определяет тип задачи и параметры обработки; + * формирует параметры retrieval. +4. Выполняется извлечение данных из `Retrieval RAG`. +5. Извлеченный контекст передается в соответствующий `Task Workflow`. +6. Внутри workflow выполняется: + + * подготовка контекста; + * evidence-проверки; + * вызовы LLM; + * формирование результата. +7. Результат возвращается пользователю. + +### Sequence diagram + +```mermaid +sequenceDiagram + participant User as User / IDE Plugin + participant API as API Layer + participant Router as IntentRouter V3 + participant RAG as Retrieval RAG + participant WF as Task Workflow + + User->>API: request + API->>Router: agent call + Router->>Router: normalize + extract artifacts + Router->>Router: LLM routing (task / intent) + Router->>RAG: retrieval request + RAG-->>Router: retrieved context + Router->>WF: route result + context + WF->>WF: evidence logic + LLM calls + WF-->>API: final result + API-->>User: response +``` + +--- + +## 4. Описание компонентов + +### 4.1. IDE Plugin / Client + +**Задача** +Точка входа пользователя в агент. + +**Как устроен** +Любой внешний клиент (IDE plugin, web UI и др.), который отправляет запрос и получает результат. + +**Почему так** +Агент изначально проектируется как backend-система, независимая от интерфейса. + +--- + +### 4.2. API Layer + +**Задача** +Обеспечивает внешний интерфейс взаимодействия с агентом. + +**Как устроен** +Принимает запрос, валидирует его и передает во внутренний pipeline, затем возвращает результат. + +**Почему так** +Позволяет изолировать транспортный слой от логики агента. + +--- + +### 4.3. IntentRouter V3 + +**Задача** +Определяет, как должен обрабатываться пользовательский запрос и какой сценарий выполнения применить. + +**Как устроен** + +Гибридная модель из двух частей: + +#### 1. Детерминированный слой + +Выполняет: + +* нормализацию запроса; +* извлечение ключевых артефактов: + + * домены; + * типы сущностей (API, entity, component и т.д.); + * явные ссылки (endpoint, путь, имя); +* выделение базовых сигналов (например: explain / list / generate). + +Этот слой задает **жесткие рамки интерпретации запроса**. + +#### 2. LLM-роутинг + +Использует: + +* нормализованный запрос; +* извлеченные артефакты; +* описание доступных типов задач; + +и определяет: + +* тип задачи; +* общий сценарий обработки; +* параметры retrieval; +* ожидаемую форму ответа. + +#### Итог + +Router формирует: + +* параметры retrieval; +* тип task workflow; +* контекст для дальнейшего выполнения. + +**Почему решение такое** + +Ранее использовался более детерминированный подход с фиксированными сценариями, который хорошо работал в узком наборе задач, но плохо масштабируется. Полностью LLM-based роутинг, наоборот, дает гибкость, но теряет предсказуемость и управляемость. + +Поэтому выбран гибридный подход: + +* детерминированный слой фиксирует ключевые артефакты и ограничения; +* LLM выполняет гибкую интерпретацию задачи. + +Это позволяет: + +* сохранить управляемость и стабильность; +* избежать взрывного роста количества сценариев; +* поддерживать сложные и нетиповые запросы. + +--- + +### 4.4. Retrieval RAG + +**Задача** +Извлечь релевантный контекст для выполнения задачи. + +**Как устроен** +Многослойная система хранения знаний (код, документация, факты, связи), из которой извлекается структурированный контекст в зависимости от параметров, заданных роутером. + +**Почему так** +Разные задачи требуют разных типов данных, поэтому используется слойная модель вместо плоского поиска. + +--- + +### 4.5. Task Workflows + +**Задача** +Реализуют прикладную логику выполнения конкретного типа задачи. + +**Как устроены** +Набор специализированных workflows, например: + +* объяснение по документации; +* генерация OpenAPI; +* генерация документации; +* другие сценарии. + +Внутри workflow находятся: + +* обработка контекста; +* evidence-проверки; +* вызовы LLM; +* сборка результата. + +**Почему так** +Логика проверки данных и генерации сильно зависит от задачи, поэтому она инкапсулируется в отдельных workflows, а не в одном универсальном слое. + +--- + +### 4.6. Output / Artifact + +**Задача** +Вернуть результат пользователю. + +**Как устроен** +Может быть: + +* текстовый ответ; +* структурированный список; +* OpenAPI спецификация; +* документация; +* иной артефакт. + +**Почему так** +Агент должен поддерживать не только ответы, но и генерацию инженерных артефактов. + +--- + +## Итог + +Обновленная архитектура строится на следующем принципе: + +* **детерминированное извлечение ключевых артефактов** задает рамки; +* **LLM выполняет гибкий роутинг внутри этих рамок**; +* **retrieval обеспечивает данные**; +* **task workflows реализуют прикладную логику и контроль качества**. + +Это позволяет одновременно сохранить управляемость системы и обеспечить масштабируемость под новые типы задач. diff --git a/_process/03. Intents.md b/_process/03. Intents.md new file mode 100644 index 0000000..e69de29 diff --git a/_process/04. Analitycs artefacts.md b/_process/04. Analitycs artefacts.md new file mode 100644 index 0000000..74d9a83 --- /dev/null +++ b/_process/04. Analitycs artefacts.md @@ -0,0 +1,790 @@ +## 1. Формат ведения технической документации агентом + +## 1.1. Общие принципы + +Техническая документация, формируемая агентом, должна строиться как **система атомарных, не пересекающихся по смыслу документов**, связанных между собой явными ссылками. + +Ключевые принципы: +- один документ описывает одну сущность или один устойчивый технический аспект; +- документ не должен дублировать соседние документы; +- общая система знаний должна собираться через ссылки, а не через копипасту; +- структура документации должна быть пригодна как для чтения человеком, так и для индексирования в RAG. + +## 1.2. Базовые типы документных единиц + +На первом этапе логично сохранить текущую семантику типов документов, но перенести ее в файловую модель. + +Базовые типы: +- `ui_page` +- `api_method` +- `logic_block` + +Позже могут добавиться: +- `architecture_overview` +- `integration_doc` +- `domain_entity` +- `glossary_item` +- `index_page` + +## 1.3. Принцип декомпозиции страниц / файлов + +### Один устойчивый объект — один документ +Если объект можно переиспользовать или на него могут ссылаться другие документы, его надо выносить в отдельный файл. + +Примеры: +- отдельная UI-страница; +- отдельный API endpoint; +- отдельный блок логики; +- отдельный интеграционный сценарий. + +### Документы не должны пересекаться по смыслу +Если описание повторяется в нескольких местах, нужно выделять общий документ и ссылаться на него. + +Примеры: +- фронтальная страница не должна заново описывать логику API; +- документ по API не должен заново раскрывать общую логику переиспользуемого блока; +- вместо дублирования должен быть переход по ссылке. + +### Use case и детальные правила живут раздельно +Сценарий описывает поток работы, а детали выносятся в функциональные требования, отдельные блоки логики или контрактные описания. + +Это важно и для RAG-индексации: +- сценарии индексируются как workflows; +- отдельные правила — как facts; +- сущности и блоки — как entities. + +## 1.4. Иерархическая организация документации + +Документация должна быть организована как иерархическое дерево каталогов и файлов, а не как набор неструктурированных страниц. + +Пример верхнего уровня: + +```text +docs/ + ui/ + api/ + logic/ + domains/ + integrations/ + architecture/ + glossary/ + errors/ +``` + +Пример организации: + +```text +docs/ + ui/ + order-create-page.md + order-edit-page.md + api/ + orders-create.md + orders-get.md + logic/ + order-validation.md + order-enrichment.md + architecture/ + system-overview.md + integration-landscape.md + errors/ + catalog.yaml +``` + +## 1.5. Учет связей между документами + +Связи должны быть **явными и поддерживаемыми агентом**. + +Примеры: +- UI-страница ссылается на API, который она вызывает; +- API-документ ссылается на переиспользуемые логические блоки; +- логический блок ссылается на связанные интеграции; +- архитектурный обзор ссылается на набор конкретных модулей и документов; +- документ по коду может ссылаться на системную аналитику, которая инициировала изменение. + +Именно эта сеть ссылок затем индексируется в слоях: +- `D1_DOCUMENT_CATALOG` +- `D3_ENTITY_CATALOG` +- `D4_WORKFLOW_INDEX` +- `D5_REFERENCE_GRAPH` +- `D6_DOC_CODE_LINKS` + +## 1.6. Формат markdown-документов + +Основной формат технической документации — `Markdown`. + +Каждый документ состоит из двух частей: +1. **YAML frontmatter** — структурные метаданные; +2. **Markdown body** — основное содержимое по шаблону. + +## 3.7. YAML frontmatter + +Frontmatter нужен для: +- определения типа документа; +- идентификации документа; +- определения его места в иерархии; +- фиксации связей с кодом и другими документами; +- выделения сущностей и тегов; +- упрощения построения слоев `D1`, `D3`, `D5`, `D6`. + +### Базовый frontmatter + +```yaml +--- +id: ui-order-create-page +title: Страница создания заказа +doc_type: ui_page +domain: orders +status: draft +related_docs: + - api-orders-create + - logic-order-validation +entities: + - Order + - CreateOrder +tags: + - ui + - orders + - creation +#owner: system-analyst +#source_of_truth: code +#related_code: +# - src/orders/ui/create_page.tsx +# - src/orders/api/orders_controller.py +--- +``` + +### Обязательные поля + +- `id` — стабильный уникальный идентификатор документа; +- `title` — человекочитаемый заголовок; +- `doc_type` — тип документа; +- `related_docs` — ссылки на связанные документы; +- `status` — статус документа; +- `domain` - домен фичи (Карточка клиента, Задачи, Сделки, Предложения) +- `sub_domain` - поддомен внутри основной сущности (Счета, ЗДА, ECM) + +### Рекомендуемые поля +- `owner` +- `entities` +- `tags` +- `parent` +- `children` +- `feature` +- `system_analytics_refs` +- `business_refs` +- `updated_from` +- `reviewers` +- `source_of_truth` +- `related_code` + +### Допустимые значения `doc_type` +- `ui_page` +- `api_method` +- `logic_block` +- `architecture_overview` +- `integration_doc` +- `domain_entity` +- `glossary_item` +- `index_page` + +### Допустимые значения `status` +- `draft` +- `in_review` +- `approved` +- `outdated` +- `generated` +- `active` + +### Допустимые значения `source_of_truth` +- `code` +- `doc` +- `system_analysis` +- `business_requirements` +- `mixed` + +## 1.8. Typed frontmatter для разных типов документов + +У каждого типа документа есть: +- **общие поля**; +- **тип-специфичные поля**. + +### Пример для `api_method` + +```yaml +--- +id: api.create_invoice +doc_type: api_method +domain: billing +title: Создание инвойса + +endpoint: POST /api/v1/invoices +auth: USER +idempotent: false +timeout_ms: 3000 + +links: + called_by: + - ui.invoice_form + uses_logic: + - logic.invoice_validation + writes_db: + - db.invoices + - db.invoice_items + integrates_with: + - int.crm_sync + +related_docs: + - ui.invoice_form + - logic.invoice_validation +related_code: + - services/billing/api/create_invoice.py +entities: + - Invoice + - CreateInvoice + +tags: + - invoice + - create + - billing +status: active +version: 1.3 +source_of_truth: code +--- +``` + +### Для `api_method` полезно поддерживать + +- `endpoint` +- `sup_parameters` +- `role_model_actions` +- `monitoring_actions` +- `audit_actions` +- `idempotent` +- `timeout_ms` +- `links.called_by` +- `links.uses_logic` +- `links.writes_db` +- `links.integrates_with` + +### Для `ui_page` позже полезно поддерживать +- `calls_api` +- `user_analitycs_actions` +- `sup_parameters` +- `role_model_actions` +- `entry_points` +- `uses_logic` + +### Для `logic_block` полезно поддерживать + +- `called_from` +- `uses_logic` +- `reads_db` +- `writes_db` +- `integrates_with` + +## 1.9. Двухслойная структура документа: `Summary` + `Details` + +LLM не должна каждый раз тонуть в полном документе. Поэтому каждый документ должен содержать два уровня представления. + +### `Summary` +Короткая, строго структурированная спецификация. Это слой **быстрого контекста**. + +Рекомендуемый объем: +- примерно 30–60 строк; +- без длинных пояснений; +- только ключевые факты. + +Пример: + +```md +## Summary +- Purpose: создание инвойса из формы +- Actor: пользователь +- Trigger: Submit +- Main API: POST /api/v1/invoices (api.create_invoice) +- Validation: required fields, amount > 0, date <= today +- Errors: 400(field errors), 409(duplicate), 503(retryable) +- Analytics: event invoice_submit, invoice_error +``` + +### `Details` +Полное раскрытие объекта: +- use case; +- функциональные требования; +- UI; +- API; +- ошибки; +- НФТ; +- связи; +- кодовые привязки. + +## 1.10. Общие требования к markdown body + +1. В документе должен быть один `H1`, совпадающий с `title`. +2. Основные разделы используют `H2`. +3. Подразделы внутри разделов используют `H3`. +4. Не должно быть хаотической вложенности заголовков. +5. Один раздел должен описывать одну смысловую часть. +6. Текст не должен дублировать соседние документы. +7. Вместо дублирования должны использоваться явные ссылки на связанные документы. +8. Сценарии, правила, ограничения и ссылки на код должны быть отделены друг от друга. + +## 1.11. Базовый каркас markdown-документа + +```md +--- +id: api-orders-create +title: Метод создания заказа +doc_type: api_method +domain: orders +status: draft +source_of_truth: code +related_docs: + - logic-order-validation + - ui-order-create-page +related_code: + - src/orders/api/create_order.py +entities: + - Order + - CreateOrder +tags: + - api + - orders +--- + +# Метод создания заказа + +## Summary +- Purpose: создание заказа +- Actor: пользователь +- Trigger: submit формы +- Main API: POST /orders + +## Details +### Описание +### Технический use case +### Функциональные требования +### Нефункциональные требования +### Контракт + + +## 3.13. Специализированные шаблоны документов + +### UI Page + +```md +# <Название страницы> + +## Summary +## Назначение +## Контекст +## Технический use case +## Описание UI +## UI Elements +## Функциональные требования +## Нефункциональные требования +## Связанные API +## Связанные блоки логики +## Связанный код +## Связанные документы +## История изменений +``` + +#### Требования к разделу `Описание UI` +Для каждого элемента желательно описывать: +- тип элемента; +- назначение; +- источник данных; +- default / placeholder; +- правила активации; +- поведение при взаимодействии; +- валидацию. + +#### Требования к разделу `UI Elements` +UI-элементы должны храниться в **табличном** или **полуструктурированном** виде. + +Пример: + +```md +## UI Elements + +| id | type | label | data_source | validation | behavior | +|--------|--------|---------|------------|------------|----------| +| amount | input | Amount | local | >0 | enables submit | +| submit | button | Create | - | - | calls api.create_invoice | +``` + +Если модель UI сложная, допустим sidecar-файл `ui_elements.yaml` или `ui_elements.json` рядом с основным документом. + +### API Method + +```md +# <Название API метода> + +## Summary +## Назначение +## Контекст +## Технический use case +## Функциональные требования +## Contract +## Errors +## Нефункциональные требования +## Связанные блоки логики +## Связанный код +## Связанные документы +## История изменений +``` + +#### Требования к разделу `Contract` +Контракт может: +- быть кратко описан прямо в документе; +- ссылаться на OpenAPI; +- ссылаться на отдельный контрактный файл. + +Для REST API целевым источником истины должен становиться `OpenAPI`. + +### Reusable Logic Block + +```md +# <Название блока логики> + +## Summary +## Назначение +## Контекст +## Технический use case +## Функциональные требования +## Ограничения и условия вызова +## Нефункциональные требования +## Связанные API / UI / integration points +## Связанный код +## Связанные документы +## История изменений +``` + +## 3.14. Машинно-читаемые API-контракты + +Для API контрактов **источником истины** должен становиться: +- `OpenAPI` — предпочтительно; +- либо временно строгий markdown/yaml-контракт, если OpenAPI еще нет. + +Минимальный набор для API-контракта: +- `endpoint` +- `method` +- `request fields` +- `required / optional` +- `constraints` +- `response` +- `errors` +- `idempotency` +- `retry` +- `timeout` +- `auth` + +## 3.15. Каталог ошибок + +Ошибки, HTTP-коды, retry-правила и клиентское поведение не должны размазываться по разным документам. + +Нужен единый каталог ошибок, например `docs/errors/catalog.yaml`. + +Пример: + +```yaml +errors: + - error_id: invoice_validation_failed + http_code: 400 + internal_code: BILLING_400_01 + when: invalid request fields + client_behavior: show field errors + retry: false + owner: billing + + - error_id: invoice_duplicate + http_code: 409 + internal_code: BILLING_409_01 + when: duplicate invoice detected + client_behavior: show duplicate warning + retry: false + owner: billing + + - error_id: crm_sync_unavailable + http_code: 503 + internal_code: BILLING_503_02 + when: downstream CRM unavailable + client_behavior: retry later + retry: true + owner: billing +``` + +В API- и logic-документах лучше ссылаться на `error_id`, а не заново подробно описывать каждую ошибку. + +## 3.16. Требования к качеству документа для RAG + +1. **Явные заголовки** — не использовать безымянные блоки текста. +2. **Атомарные утверждения** — не смешивать несколько правил в одном пункте, если их можно разделить. +3. **Явные сущности** — использовать стабильные названия компонентов, API, модулей, страниц. +4. **Явные ссылки** — не писать «этот метод», если можно указать конкретную ссылку или идентификатор. +5. **Минимум дублирования** — повторяющийся контент должен заменяться ссылками. +6. **Привязка к коду** — если документ описывает кодовый объект, это должно быть явно указано. +7. **Разделение сценариев и правил** — workflow и fact-like требования должны быть отделены. + +## 3.17. Как структура markdown помогает RAG + +- `frontmatter` + заголовки → `D1_DOCUMENT_CATALOG` +- `entities`, `tags`, устойчивые термины → `D3_ENTITY_CATALOG` +- атомарные функциональные и нефункциональные требования → `D2_FACT_INDEX` +- `Технический use case` → `D4_WORKFLOW_INDEX` +- `related_docs`, явные ссылки → `D5_REFERENCE_GRAPH` +- `related_code`, упоминания symbols и файлов → `D6_DOC_CODE_LINKS` +- `Summary` → быстрый retrieval и short-form context для LLM + +## 3.18. Принципы генерации документации агентом + +Когда документ пишет агент, он должен: +- сначала извлечь evidence из кода, системной аналитики и существующих документов; +- определить тип документа; +- заполнить frontmatter; +- построить markdown body по шаблону; +- явно указать связи с кодом и другими документами; +- не дублировать уже существующее описание, если можно сослаться на него. + +--- + + +## 4.4. Layered RAG + +RAG строится как система специализированных слоев для двух основных доменов: +- `CODE RAG` +- `DOCS RAG` + +Каждый graph извлекает контекст не из одного общего индекса, а из нужного набора слоев в зависимости от intent. + +## 4.5. Evidence gate + +Перед синтезом ответа или документа агент должен проверять, хватает ли опоры. + +Примеры: +- найден ли symbol; +- найдено ли достаточное количество code chunks; +- есть ли supporting relations; +- есть ли document evidence; +- есть ли docs ↔ code mapping. + +Если опоры недостаточно, агент должен: +- деградировать в упрощенный режим; +- честно фиксировать неполноту ответа; +- при необходимости уходить в fallback. + +## 4.6. Synthesis layer + +На этом этапе LLM: +- агрегирует найденные артефакты; +- формирует объяснение; +- пишет документ; +- структурирует результат под нужный шаблон. + +LLM не должна быть основным источником фактов. Фактическая основа должна приходить из RAG и диагностируемого pipeline. + +## 4.7. Diagnostics + +Система должна сохранять диагностический след: +- какой graph был выбран; +- какие слои использовались; +- что было найдено; +- где retrieval был слабым; +- почему был выбран fallback; +- какие evidence стали основой ответа. + +## 4.8. Сценарии: Target Architecture vs MVP-now + +### 4.8.1. Target Architecture + +#### CODE +- `OPEN_FILE` — открыть конкретный файл; +- `OPEN_SYMBOL` — открыть класс / функцию / метод; +- `EXPLAIN` — объяснить, как работает сущность или фрагмент; +- `FIND_TESTS` — найти релевантные тесты; +- `FIND_ENTRYPOINTS` — найти основные точки входа; +- `RELATED_CODE` — найти связанные сущности и ближайший контекст. + +#### DOCS +- `DOC_SEARCH` — найти релевантный фрагмент документации; +- `DOC_EXPLAIN` — кратко объяснить, что сказано в документации по теме; +- `DOC_ENTITY_LOOKUP` — найти разделы, связанные с сущностью или компонентом; +- `GENERATE_DOCS_FROM_CODE` — сформировать документацию по коду с нуля для модуля, класса, функции, компонента или сценария. + +#### CROSS-DOMAIN +- `FIND_IMPLEMENTATION_BY_DOC` — найти реализацию по описанию; +- `FIND_DOC_BY_CODE` — найти документацию по коду; +- `COMPARE_DOCS_AND_CODE` — базовое сопоставление документации и реализации. + +#### GENERAL / FALLBACK +- `GENERAL_QA` — общий сценарий ответа на вопрос, если домен или интент не удалось определить уверенно. + +### 4.8.2. MVP-now + +В текущем цикле фокус на сценариях: + +- `OPEN_FILE` +- `EXPLAIN` +- `FIND_TESTS` +- `FIND_ENTRYPOINTS` +- `GENERAL_QA` + +DOCS и CROSS_DOMAIN остаются частью target architecture; в текущем цикле они не являются обязательной частью test-first MVP. + +--- + +## 5. Структура слоев RAG + +## 5.1. CODE RAG + +### C0 — Source Chunks +**Назначение:** базовые фрагменты исходного кода. +**Единица:** chunk кода. +**Как формируется:** исходные файлы обходятся и режутся на chunk’и с учетом структурных границ. +**Статус в MVP:** да. + +### C1 — Symbol Catalog +**Назначение:** каталог модулей, классов, функций, методов и других значимых сущностей. +**Единица:** symbol. +**Как формируется:** из AST и синтаксического разбора кода. +**Статус в MVP:** да. + +### C2 — Symbol Relations +**Назначение:** связи между symbols. +**Единица:** relation. +**Как формируется:** вторым проходом по AST и структурным зависимостям. +**Статус в MVP:** да, в ограниченном виде. + +### C3 — Entrypoints +**Назначение:** каталог точек входа системы. +**Единица:** entrypoint. +**Как формируется:** специализированными детекторами entrypoint-паттернов. +**Статус в MVP:** да, минимально. + +### C4 — Execution Paths +**Назначение:** типовые пути исполнения. +**Единица:** path. +**Как формируется:** поверх `C2` и `C3` через производную трассировку. +**Статус в MVP:** нет. + +### C5 — Test Mappings +**Назначение:** связи production code ↔ tests. +**Единица:** mapping. +**Как формируется:** по путям, именам, импортам и конвенциям проекта. +**Статус в MVP:** да, минимально. + +### C6 — Code Facts +**Назначение:** нормализованные факты из кода. +**Единица:** fact. +**Как формируется:** поверх `C1–C3` как производный слой. +**Статус в MVP:** нет. + +## 5.2. DOCS RAG + +### D0 — Document Chunks +**Назначение:** базовые фрагменты документации. +**Единица:** document chunk. +**Как формируется:** документы нормализуются и режутся на chunk’и с сохранением `section path`. +**Статус в MVP:** да. + +### D1 — Document Catalog +**Назначение:** каталог документов и разделов. +**Единица:** `document node / section node`. +**Как формируется:** из структуры документов и их заголовков. +**Статус в MVP:** да. + +### D2 — Fact Index +**Назначение:** атомарные факты из документации. +**Единица:** fact. +**Как формируется:** из `D0/D1` через правила, шаблоны и при необходимости LLM extraction с валидацией. +**Статус в MVP:** частично. + +### D3 — Entity Catalog +**Назначение:** каталог сущностей и понятий документации. +**Единица:** entity / concept. +**Как формируется:** из устойчивых терминов, заголовков, словарей и нормализации повторяющихся сущностей. +**Статус в MVP:** да, минимально. + +### D4 — Workflow Index +**Назначение:** процедуры, сценарии, последовательности шагов. +**Единица:** workflow. +**Как формируется:** из use case, процессных разделов и последовательных описаний шагов. +**Статус в MVP:** нет. + +### D5 — Reference Graph +**Назначение:** граф ссылок между документами, секциями, сущностями и фактами. +**Единица:** reference link. +**Как формируется:** из явных и неявных cross-links между документами. +**Статус в MVP:** нет. + +### D6 — Doc-Code Links +**Назначение:** мост между документацией и кодом. +**Единица:** `doc artifact ↔ code artifact link`. +**Как формируется:** из имен, aliases, путей, устойчивых терминов и других надежных соответствий. +**Статус в MVP:** да, минимально. + +## 5.3. Layer scope: Target Architecture vs MVP-now + +### 5.3.1. Target Architecture + +Полная карта слоёв: + +- **CODE:** C0–C6 (Source Chunks, Symbol Catalog, Symbol Relations, Entrypoints, Execution Paths, Test Mappings, Code Facts) +- **DOCS:** D0–D6 (Document Chunks, Document Catalog, Fact Index, Entity Catalog, Workflow Index, Reference Graph, Doc-Code Links) + +### 5.3.2. MVP-now + +**Обязательные сейчас:** + +- `C0_SOURCE_CHUNKS` +- `C1_SYMBOL_CATALOG` +- `C2_SYMBOL_RELATIONS` +- `C3_ENTRYPOINTS` + +**В облегчённом виде:** + +- `C5_TEST_MAPPINGS` или `C5-lite` + +**Не блокируют текущий этап:** + +- `C4_EXECUTION_PATHS` +- `C6_CODE_FACTS` +- весь docs runtime (слои D0–D6 в исполнении runtime) + +Слои документации остаются частью target architecture; docs retrieval пока не обязателен для текущего code-first milestone. + +--- + +## 6. Итоговая рамка MVP-now + +Сейчас система должна стабильно работать в **test-first** режиме. + +**Фокус:** + +- CODE_QA; +- через тесты настраиваются: + - intent routing (IntentRouterV2); + - layered retrieval; + - evidence sufficiency; + - answer quality; + - diagnostics. + +**Не входят в текущий milestone:** + +- UI-интеграция; +- docs runtime; +- полная интеграция orchestration переносится на следующий этап после стабилизации test pipeline. + +В целевой архитектуре по-прежнему заложены: +- уверенная работа с кодом, symbols, entrypoints, тестами; +- ответ по документации и мост docs ↔ code; +- генерация документации по коду; +- fallback при неуверенном роутинге. + +В MVP-now сознательно **не включаются** самые дорогие части: +- полноценные execution paths для всей системы; +- богатые fact-индексы по всем доменам; +- полный reference graph документации; +- глубокая автоматизация подготовки системной аналитики. \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml index 979c31b..31e42ae 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -27,7 +27,7 @@ services: env_file: - .env environment: - DATABASE_URL: ${DATABASE_URL} + DATABASE_URL: postgresql+psycopg://${POSTGRES_USER}:${POSTGRES_PASSWORD}@db:5432/${POSTGRES_DB} GIGACHAT_AUTH_URL: ${GIGACHAT_AUTH_URL} GIGACHAT_API_URL: ${GIGACHAT_API_URL} GIGACHAT_SCOPE: ${GIGACHAT_SCOPE} diff --git a/docs/architecture/contracts_retrieval.json b/docs/architecture/contracts_retrieval.json deleted file mode 100644 index 5d0e918..0000000 --- a/docs/architecture/contracts_retrieval.json +++ /dev/null @@ -1,380 +0,0 @@ -{ - "layers": { - "C0_SOURCE_CHUNKS": { - "retriever": { - "class": "RagService", - "file": "app/modules/rag/services/rag_service.py", - "method": "retrieve" - }, - "indexer": { - "class": "CodeTextDocumentBuilder", - "file": "app/modules/rag/indexing/code/code_text/document_builder.py", - "method": "build" - }, - "input": { - "type": "observed shape", - "fields": { - "rag_session_id": { - "type": "string", - "required": true - }, - "query": { - "type": "string", - "required": true - }, - "layers": { - "type": "implicit list[string]", - "required": false, - "source": "RagQueryRouter.layers_for_mode('code')" - } - } - }, - "output": { - "type": "list[dict]", - "fields": { - "source": "string", - "content": "string", - "layer": "\"C0_SOURCE_CHUNKS\"", - "title": "string", - "metadata": { - "chunk_index": "int", - "chunk_type": "\"symbol_block\" | \"window\"", - "module_or_unit": "string", - "artifact_type": "\"CODE\"" - }, - "score": "float | null" - } - }, - "examples": { - "input": { - "rag_session_id": "rag-123", - "query": "where is implemented get_user" - }, - "output": { - "source": "app/api/users.py", - "content": "async def get_user(user_id: str):\n service = UserService()\n return service.get_user(user_id)", - "layer": "C0_SOURCE_CHUNKS", - "title": "app/api/users.py:get_user", - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "app.api.users", - "artifact_type": "CODE" - }, - "score": 0.07 - } - }, - "defaults": { - "retrieve_limit": 8, - "embed_batch_size_env": "RAG_EMBED_BATCH_SIZE", - "embed_batch_size_default": 16, - "window_chunk_size_lines": 80, - "window_overlap_lines": 15 - }, - "limitations": [ - "Line spans are stored but not returned in the public retrieval item shape.", - "No direct path or namespace filter is exposed through the retrieval endpoint." - ] - }, - "C1_SYMBOL_CATALOG": { - "retriever": { - "class": "RagService", - "file": "app/modules/rag/services/rag_service.py", - "method": "retrieve" - }, - "indexer": { - "class": "SymbolDocumentBuilder", - "file": "app/modules/rag/indexing/code/symbols/document_builder.py", - "method": "build" - }, - "input": { - "type": "observed shape", - "fields": { - "rag_session_id": { - "type": "string", - "required": true - }, - "query": { - "type": "string", - "required": true - }, - "query_term_expansion": { - "type": "list[string]", - "required": false, - "source": "extract_query_terms(query_text)", - "max_items": 6 - } - } - }, - "output": { - "type": "list[dict]", - "fields": { - "source": "string", - "content": "string", - "layer": "\"C1_SYMBOL_CATALOG\"", - "title": "string", - "metadata": { - "symbol_id": "string", - "qname": "string", - "kind": "\"class\" | \"function\" | \"method\" | \"const\"", - "signature": "string", - "decorators_or_annotations": "list[string]", - "docstring_or_javadoc": "string | null", - "parent_symbol_id": "string | null", - "package_or_module": "string", - "is_entry_candidate": "bool", - "lang_payload": "object", - "artifact_type": "\"CODE\"" - }, - "score": "float | null" - } - }, - "examples": { - "input": { - "rag_session_id": "rag-123", - "query": "where is implemented get_user" - }, - "output": { - "source": "app/api/users.py", - "content": "function get_user\nget_user(user_id)", - "layer": "C1_SYMBOL_CATALOG", - "title": "get_user", - "metadata": { - "symbol_id": "sha256(...)", - "qname": "get_user", - "kind": "function", - "signature": "get_user(user_id)", - "decorators_or_annotations": [ - "router.get" - ], - "docstring_or_javadoc": null, - "parent_symbol_id": null, - "package_or_module": "app.api.users", - "is_entry_candidate": true, - "lang_payload": { - "async": true - }, - "artifact_type": "CODE" - }, - "score": 0.07 - } - }, - "defaults": { - "retrieve_limit": 8, - "layer_rank": 1 - }, - "limitations": [ - "Only Python AST symbols are indexed.", - "Cross-file resolution is not implemented.", - "parent_symbol_id is an observed qname-like value, not guaranteed to be a symbol hash." - ] - }, - "C2_DEPENDENCY_GRAPH": { - "retriever": { - "class": "RagService", - "file": "app/modules/rag/services/rag_service.py", - "method": "retrieve" - }, - "indexer": { - "class": "EdgeDocumentBuilder", - "file": "app/modules/rag/indexing/code/edges/document_builder.py", - "method": "build" - }, - "input": { - "type": "observed shape", - "fields": { - "rag_session_id": { - "type": "string", - "required": true - }, - "query": { - "type": "string", - "required": true - } - } - }, - "output": { - "type": "list[dict]", - "fields": { - "source": "string", - "content": "string", - "layer": "\"C2_DEPENDENCY_GRAPH\"", - "title": "string", - "metadata": { - "edge_id": "string", - "edge_type": "\"calls\" | \"imports\" | \"inherits\"", - "src_symbol_id": "string", - "src_qname": "string", - "dst_symbol_id": "string | null", - "dst_ref": "string | null", - "resolution": "\"resolved\" | \"partial\"", - "lang_payload": "object", - "artifact_type": "\"CODE\"" - }, - "score": "float | null" - } - }, - "examples": { - "input": { - "rag_session_id": "rag-123", - "query": "how get_user calls service" - }, - "output": { - "source": "app/api/users.py", - "content": "get_user calls UserService", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "get_user:calls", - "metadata": { - "edge_id": "sha256(...)", - "edge_type": "calls", - "src_symbol_id": "sha256(...)", - "src_qname": "get_user", - "dst_symbol_id": null, - "dst_ref": "UserService", - "resolution": "partial", - "lang_payload": { - "callsite_kind": "function_call" - }, - "artifact_type": "CODE" - }, - "score": 0.11 - } - }, - "defaults": { - "retrieve_limit": 8, - "layer_rank": 2, - "graph_build_mode": "static_python_ast" - }, - "limitations": [ - "No traversal API exists.", - "Edges are stored as retrievable rows, not as a graph-native store.", - "Destination resolution is local to one indexed file." - ] - }, - "C3_ENTRYPOINTS": { - "retriever": { - "class": "RagService", - "file": "app/modules/rag/services/rag_service.py", - "method": "retrieve" - }, - "indexer": { - "class": "EntrypointDocumentBuilder", - "file": "app/modules/rag/indexing/code/entrypoints/document_builder.py", - "method": "build" - }, - "input": { - "type": "observed shape", - "fields": { - "rag_session_id": { - "type": "string", - "required": true - }, - "query": { - "type": "string", - "required": true - } - } - }, - "output": { - "type": "list[dict]", - "fields": { - "source": "string", - "content": "string", - "layer": "\"C3_ENTRYPOINTS\"", - "title": "string", - "metadata": { - "entry_id": "string", - "entry_type": "\"http\" | \"cli\"", - "framework": "\"fastapi\" | \"flask\" | \"typer\" | \"click\"", - "route_or_command": "string", - "handler_symbol_id": "string", - "lang_payload": "object", - "artifact_type": "\"CODE\"" - }, - "score": "float | null" - } - }, - "examples": { - "input": { - "rag_session_id": "rag-123", - "query": "which endpoint handles get user" - }, - "output": { - "source": "app/api/users.py", - "content": "fastapi http \"/users/{user_id}\"", - "layer": "C3_ENTRYPOINTS", - "title": "\"/users/{user_id}\"", - "metadata": { - "entry_id": "sha256(...)", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "\"/users/{user_id}\"", - "handler_symbol_id": "sha256(...)", - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": "CODE" - }, - "score": 0.05 - } - }, - "defaults": { - "retrieve_limit": 8, - "layer_rank": 0 - }, - "limitations": [ - "Detection is decorator-string based.", - "No Django, Celery, RQ, or cron entrypoints were found.", - "Returned payload does not expose line spans." - ] - } - }, - "retrieval_endpoint": { - "entrypoint": { - "file": "app/modules/rag_session/module.py", - "method": "internal_router.retrieve" - }, - "request": { - "type": "dict", - "fields": { - "rag_session_id": "string | optional if project_id provided", - "project_id": "string | optional fallback for rag_session_id", - "query": "string" - } - }, - "response": { - "type": "dict", - "fields": { - "items": "list[retrieval item]" - } - }, - "defaults": { - "mode": "docs unless RagQueryRouter detects code hints", - "limit": 8, - "embedding_provider": "GigaChat embeddings", - "fallback_after_embedding_error": true, - "fallback_to_docs_when_code_empty": true - } - }, - "ranking": { - "storage": "PostgreSQL rag_chunks + pgvector", - "query_repository": { - "class": "RagQueryRepository", - "file": "app/modules/rag/persistence/query_repository.py", - "method": "retrieve" - }, - "order_by": [ - "lexical_rank ASC", - "test_penalty ASC", - "layer_rank ASC", - "embedding <=> query_embedding ASC" - ], - "notes": [ - "lexical_rank is derived from qname/symbol_id/title/path/content matching extracted query terms", - "test_penalty is applied only when prefer_non_tests=true", - "layer priority is C3 > C1 > C2 > C0 for code retrieval" - ] - } -} diff --git a/docs/architecture/llm_inventory.md b/docs/architecture/llm_inventory.md deleted file mode 100644 index 1156e69..0000000 --- a/docs/architecture/llm_inventory.md +++ /dev/null @@ -1,270 +0,0 @@ -# LLM Inventory - -## Provider and SDK - -- Provider in code: GigaChat / Sber -- Local SDK style: custom thin HTTP client over `requests` -- Core files: - - `app/modules/shared/gigachat/client.py` - - `app/modules/shared/gigachat/settings.py` - - `app/modules/shared/gigachat/token_provider.py` - - `app/modules/agent/llm/service.py` - -There is no OpenAI SDK, Azure SDK, or local model runtime in the current implementation. - -## Configuration - -Model and endpoint configuration are read from environment in `GigaChatSettings.from_env()`: - -- `GIGACHAT_AUTH_URL` - - default: `https://ngw.devices.sberbank.ru:9443/api/v2/oauth` -- `GIGACHAT_API_URL` - - default: `https://gigachat.devices.sberbank.ru/api/v1` -- `GIGACHAT_SCOPE` - - default: `GIGACHAT_API_PERS` -- `GIGACHAT_TOKEN` - - required for auth -- `GIGACHAT_SSL_VERIFY` - - default: `true` -- `GIGACHAT_MODEL` - - default: `GigaChat` -- `GIGACHAT_EMBEDDING_MODEL` - - default: `Embeddings` -- `AGENT_PROMPTS_DIR` - - optional prompt directory override - -PostgreSQL config for retrieval storage is separate: - -- `DATABASE_URL` - - default: `postgresql+psycopg://agent:agent@db:5432/agent` - -## Default models - -- Chat/completions model default: `GigaChat` -- Embedding model default: `Embeddings` - -## Completion payload - -Observed payload sent by `GigaChatClient.complete(...)`: - -```json -{ - "model": "GigaChat", - "messages": [ - {"role": "system", "content": ""}, - {"role": "user", "content": ""} - ] -} -``` - -Endpoint: - -- `POST {GIGACHAT_API_URL}/chat/completions` - -Observed response handling: - -- reads `choices[0].message.content` -- if no choices: returns empty string - -## Embeddings payload - -Observed payload sent by `GigaChatClient.embed(...)`: - -```json -{ - "model": "Embeddings", - "input": [ - "", - "" - ] -} -``` - -Endpoint: - -- `POST {GIGACHAT_API_URL}/embeddings` - -Observed response handling: - -- expects `data` list -- maps each `item.embedding` to `list[float]` - -## Parameters - -### Explicitly implemented - -- `model` -- `messages` -- `input` -- HTTP timeout: - - completions: `90s` - - embeddings: `90s` - - auth: `30s` -- TLS verification flag: - - `verify=settings.ssl_verify` - -### Not implemented in payload - -- `temperature` -- `top_p` -- `max_tokens` -- `response_format` -- tools/function calling -- streaming -- seed -- stop sequences - -`ASSUMPTION:` the service uses provider defaults for sampling and output length because these fields are not sent in the request payload. - -## Context and budget limits - -There is no centralized token budget manager in the current code. - -Observed practical limits instead: - -- prompt file text is loaded as-is from disk -- user input is passed as-is -- RAG context shaping happens outside the LLM client -- docs indexing summary truncation: - - docs module catalog summary: `4000` chars - - docs policy text: `4000` chars -- project QA source bundle caps: - - top `12` rag items - - top `10` file candidates -- logging truncation only: - - LLM input/output logs capped at `1500` chars for logs - -`ASSUMPTION:` there is no explicit max-context enforcement before chat completion requests. The current system relies on upstream graph logic to keep inputs small enough. - -## Retry, backoff, timeout - -### Timeouts - -- auth: `30s` -- chat completion: `90s` -- embeddings: `90s` - -### Retry - -- Generic async retry wrapper exists in `app/modules/shared/retry_executor.py` -- It retries only: - - `TimeoutError` - - `ConnectionError` - - `OSError` -- Retry constants: - - `MAX_RETRIES = 5` - - backoff: `0.1 * attempt` seconds - -### Important current limitation - -- `GigaChatClient` raises `GigaChatError` on HTTP and request failures. -- `RetryExecutor` does not catch `GigaChatError`. -- Result: LLM and embeddings calls are effectively not retried by this generic retry helper unless errors are converted upstream. - -## Prompt formation - -Prompt loading is handled by `PromptLoader`: - -- base dir: `app/modules/agent/prompts` -- override: `AGENT_PROMPTS_DIR` -- file naming convention: `.txt` - -Prompt composition model today: - -- system prompt: - - full contents of selected prompt file -- user prompt: - - raw runtime input string passed by the caller -- no separate developer prompt layer in the application payload - -If a prompt file is missing: - -- fallback system prompt: `You are a helpful assistant.` - -## Prompt templates present - -- `router_intent` -- `general_answer` -- `project_answer` -- `docs_detect` -- `docs_strategy` -- `docs_plan_sections` -- `docs_generation` -- `docs_self_check` -- `docs_execution_summary` -- `project_edits_plan` -- `project_edits_hunks` -- `project_edits_self_check` - -## Key LLM call entrypoints - -### Composition roots - -- `app/modules/agent/module.py` - - builds `GigaChatSettings` - - builds `GigaChatTokenProvider` - - builds `GigaChatClient` - - builds `PromptLoader` - - builds `AgentLlmService` -- `app/modules/rag_session/module.py` - - builds the same provider stack for embeddings used by RAG - -### Main abstraction - -- `AgentLlmService.generate(prompt_name, user_input, log_context=None)` - -### Current generate callsites - -- `app/modules/agent/engine/router/intent_classifier.py` - - `router_intent` -- `app/modules/agent/engine/graphs/base_graph.py` - - `general_answer` -- `app/modules/agent/engine/graphs/project_qa_graph.py` - - `project_answer` -- `app/modules/agent/engine/graphs/docs_graph_logic.py` - - `docs_detect` - - `docs_strategy` - - `docs_plan_sections` - - `docs_generation` - - `docs_self_check` - - `docs_execution_summary`-like usage via summary step -- `app/modules/agent/engine/graphs/project_edits_logic.py` - - `project_edits_plan` - - `project_edits_self_check` - - `project_edits_hunks` - -## Logging and observability - -`AgentLlmService` logs: - -- input: - - `graph llm input: context=... prompt=... user_input=...` -- output: - - `graph llm output: context=... prompt=... output=...` - -Log truncation: - -- 1500 chars - -RAG retrieval logs separately in `RagService`, but without embedding vectors. - -## Integration with retrieval - -There are two distinct GigaChat usages: - -1. Chat/completion path for agent reasoning and generation -2. Embedding path for RAG indexing and retrieval - -The embedding adapter is `GigaChatEmbedder`, used by: - -- `app/modules/rag/services/rag_service.py` - -## Notable limitations - -- Single provider coupling: chat and embeddings both depend on GigaChat-specific endpoints. -- No model routing by scenario. -- No tool/function calling. -- No centralized prompt token budgeting. -- No explicit retry for `GigaChatError`. -- No streaming completions. -- No structured response mode beyond prompt conventions and downstream parsing. diff --git a/docs/architecture/rag_chunks_column_audit.md b/docs/architecture/rag_chunks_column_audit.md deleted file mode 100644 index 68aaf26..0000000 --- a/docs/architecture/rag_chunks_column_audit.md +++ /dev/null @@ -1,13 +0,0 @@ -| column | used_by | safe_to_drop | notes | -| --- | --- | --- | --- | -| `layer` | `USED_BY_CODE_V2`, `USED_BY_DOCS_INDEXING` | no | Core selector for C0-C3 and D1-D4 queries. | -| `title` | `USED_BY_CODE_V2`, `USED_BY_DOCS_INDEXING` | no | Used in lexical ranking and prompt evidence labels. | -| `metadata_json` | `USED_BY_CODE_V2`, `USED_BY_DOCS_INDEXING` | no | C2/C0 graph lookups and docs metadata depend on it. | -| `span_start`, `span_end` | `USED_BY_CODE_V2` | no | Needed for symbol-to-chunk resolution and locations. | -| `symbol_id`, `qname`, `kind`, `lang` | `USED_BY_CODE_V2` | no | Used by code indexing, ranking, trace building, and diagnostics. | -| `repo_id`, `commit_sha` | `USED_BY_CODE_V2`, `USED_BY_DOCS_INDEXING` | no | Used by indexing/cache and retained for provenance. | -| `entrypoint_type`, `framework` | `USED_BY_CODE_V2` | no | Used by C3 filtering and entrypoint diagnostics. | -| `doc_kind`, `module_id`, `section_path` | `USED_BY_DOCS_INDEXING` | no | Still written by docs indexing and covered by docs tests. | -| `artifact_type`, `section`, `doc_version`, `owner`, `system_component`, `last_modified`, `staleness_score` | `USED_BY_DOCS_INDEXING` | no | File metadata still flows through indexing/cache; left intact for now. | -| `rag_doc_id` | `UNUSED` | yes | Written into `rag_chunks` only; no reads in runtime/indexing code. | -| `links_json` | `UNUSED` | yes | Stored in `rag_chunks` only; reads exist for `rag_chunk_cache`, not `rag_chunks`. | diff --git a/docs/architecture/retrieval_callgraph.mmd b/docs/architecture/retrieval_callgraph.mmd deleted file mode 100644 index 95e3795..0000000 --- a/docs/architecture/retrieval_callgraph.mmd +++ /dev/null @@ -1,31 +0,0 @@ -flowchart TD - A["HTTP: POST /internal/rag/retrieve"] --> B["RagModule.internal_router.retrieve(payload)"] - B --> C["RagService.retrieve(rag_session_id, query)"] - C --> D["RagQueryRouter.resolve_mode(query)"] - D --> E["RagQueryRouter.layers_for_mode(mode)"] - C --> F["GigaChatEmbedder.embed([query])"] - F --> G["GigaChatClient.embed(payload)"] - G --> H["POST /embeddings"] - C --> I["RagRepository.retrieve(...)"] - I --> J["RagQueryRepository.retrieve(...)"] - J --> K["PostgreSQL rag_chunks + pgvector"] - K --> L["ORDER BY lexical_rank, test_penalty, layer_rank, vector distance"] - L --> M["rows: path/content/layer/title/metadata/span/distance"] - M --> N["normalize to {source, content, layer, title, metadata, score}"] - N --> O["response: {items: [...]}"] - - C --> P["embedding error?"] - P -->|yes| Q["RagRepository.fallback_chunks(...)"] - Q --> R["latest rows by id DESC"] - R --> N - - C --> S["no rows and mode != docs?"] - S -->|yes| T["fallback to docs layers"] - T --> I - - U["GraphAgentRuntime for project/qa"] --> V["ProjectQaRetrievalGraphFactory._retrieve_context"] - V --> C - V --> W["ProjectQaSupport.build_source_bundle(...)"] - W --> X["source_bundle"] - X --> Y["context_analysis"] - Y --> Z["answer_composition"] diff --git a/docs/architecture/retrieval_inventory.md b/docs/architecture/retrieval_inventory.md deleted file mode 100644 index ed1a709..0000000 --- a/docs/architecture/retrieval_inventory.md +++ /dev/null @@ -1,457 +0,0 @@ -# Retrieval Inventory - -## Scope and method - -This document describes the retrieval and indexing pipeline as implemented in code today. The inventory is based primarily on: - -- `app/modules/rag/services/rag_service.py` -- `app/modules/rag/persistence/*.py` -- `app/modules/rag/indexing/code/**/*.py` -- `app/modules/rag/indexing/docs/**/*.py` -- `app/modules/rag_session/module.py` -- `app/modules/agent/engine/graphs/project_qa_step_graphs.py` -- `app/modules/agent/engine/orchestrator/*.py` - -`ASSUMPTION:` the intended layer semantics are the ones implied by code and tests, not by future architecture plans. This matters because only `C0` through `C3` are materially implemented today; `C4+` exist only as enum constants. - -## Current retrieval pipeline - -1. Retrieval entrypoint is `POST /internal/rag/retrieve` in `app/modules/rag_session/module.py`. -2. The endpoint calls `RagService.retrieve(rag_session_id, query)`. -3. `RagQueryRouter` chooses `docs` or `code` mode from the raw query text. -4. `RagService` computes a single embedding for the full query via `GigaChatEmbedder`. -5. `RagQueryRepository.retrieve(...)` runs one SQL query against `rag_chunks` in PostgreSQL with `pgvector`. -6. Ranking order is: - - lexical rank - - test-file penalty - - layer rank - - vector distance `embedding <=> query_embedding` -7. Response items are normalized to `{source, content, layer, title, metadata, score}`. -8. If embeddings fail, retrieval falls back to latest chunks from the same layers. -9. If code retrieval returns nothing, service falls back to docs layers. - -## Storage and indices - -- Primary store: PostgreSQL from `DATABASE_URL`, configured in `app/modules/shared/db.py`. -- Vector extension: `CREATE EXTENSION IF NOT EXISTS vector` in `app/modules/rag/persistence/schema_repository.py`. -- Primary table: `rag_chunks`. -- Cache tables: - - `rag_blob_cache` - - `rag_chunk_cache` - - `rag_session_chunk_map` -- SQL indexes currently created: - - `(rag_session_id)` - - `(rag_session_id, layer)` - - `(rag_session_id, layer, path)` - - `(qname)` - - `(symbol_id)` - - `(module_id)` - - `(doc_kind)` - - `(entrypoint_type, framework)` - -`ASSUMPTION:` there is no explicit ANN index for the vector column in schema code. The code creates general SQL indexes, but no `ivfflat`/`hnsw` index is defined here. - -## Layer: C0_SOURCE_CHUNKS - -### Implementation - -- Produced by `CodeIndexingPipeline.index_file(...)` in `app/modules/rag/indexing/code/pipeline.py`. -- Chunking logic: `CodeTextChunker.chunk(...)` in `app/modules/rag/indexing/code/code_text/chunker.py`. -- Document builder: `CodeTextDocumentBuilder.build(...)` in `app/modules/rag/indexing/code/code_text/document_builder.py`. -- Persisted via `RagDocumentRepository.insert_documents(...)` into `rag_chunks`. - -### Input contract - -This is an indexing layer, not a direct public retriever. The observed upstream indexing input is a file dict with at least: - -- required: - - `path: str` - - `content: str` -- optional: - - `commit_sha: str | None` - - `content_hash: str` - - metadata fields copied through by `RagService._document_metadata(...)` - -For retrieval, the layer is queried only indirectly through: - -- `rag_session_id: str` -- `query: str` -- inferred mode/layers from `RagQueryRouter` -- fixed `limit=8` - -### Output contract - -Stored document shape: - -- top-level: - - `layer = "C0_SOURCE_CHUNKS"` - - `lang = "python"` - - `source.repo_id` - - `source.commit_sha` - - `source.path` - - `title` - - `text` - - `span.start_line` - - `span.end_line` - - `embedding` -- metadata: - - `chunk_index` - - `chunk_type`: `symbol_block` or `window` - - `module_or_unit` - - `artifact_type = "CODE"` - - plus file-level metadata injected by `RagService` - -Returned retrieval item shape: - -- `source` -- `content` -- `layer` -- `title` -- `metadata` -- `score` - -No `line_start` / `line_end` are returned to the caller directly; they remain in DB columns `span_start` / `span_end` and are only used in logs. - -### Defaults & limits - -- AST chunking prefers one chunk per top-level class/function/async function. -- Fallback window chunking: - - `size = 80` lines - - `overlap = 15` lines -- Global retrieval limit from `RagService.retrieve(...)`: `8` -- Embedding batch size from env: - - `RAG_EMBED_BATCH_SIZE` - - default `16` - -### Known issues - -- Nested methods/functions are not emitted as C0 chunks unless represented inside a selected top-level block. -- Returned API payload omits line spans even though storage has them. -- No direct filter by path, namespace, symbol, or `top_k` is exposed through the current endpoint. - -## Layer: C1_SYMBOL_CATALOG - -### Implementation - -- Symbol extraction: `SymbolExtractor.extract(...)` in `app/modules/rag/indexing/code/symbols/extractor.py`. -- AST parsing: `PythonAstParser.parse_module(...)`. -- Document builder: `SymbolDocumentBuilder.build(...)`. -- Retrieval reads rows from `rag_chunks`; there is no dedicated symbol table. - -### Input contract - -Indexing input is the same per-file payload as C0. - -Observed symbol extraction source: - -- Python AST only -- supported symbol kinds: - - `class` - - `function` - - `method` - - `const` for top-level imports/import aliases - -Retrieval input is still the generic text query endpoint. Query terms are enriched by `extract_query_terms(...)`: - -- extracts identifier-like tokens from query text -- normalizes camelCase/PascalCase to snake_case -- adds special intent terms for management/control-related queries -- max observed query terms: `6` - -### Output contract - -Stored document shape: - -- top-level: - - `layer = "C1_SYMBOL_CATALOG"` - - `title = qname` - - `text = " \n\n"` - - `span.start_line` - - `span.end_line` -- metadata: - - `symbol_id` - - `qname` - - `kind` - - `signature` - - `decorators_or_annotations` - - `docstring_or_javadoc` - - `parent_symbol_id` - - `package_or_module` - - `is_entry_candidate` - - `lang_payload` - - `artifact_type = "CODE"` - -Observed `lang_payload` variants: - -- class: - - `bases` -- function/method: - - `async` -- import alias: - - `imported_from` - - `import_alias` - -### Defaults & limits - -- Only Python source files are indexed into C-layers. -- Import and import-from declarations are materialized as `const` symbols only at module top level. -- Retrieval ranking gives C1 priority rank `1`, after C3 and before C2/C0. - -### Known issues - -- No explicit visibility/public-private model. -- `parent_symbol_id` currently stores the parent qname string from the stack, not the parent symbol hash. This is an observed implementation detail. -- Cross-file symbol resolution is not implemented; `dst_symbol_id` in edges resolves only against symbols extracted from the same file. - -## Layer: C2_DEPENDENCY_GRAPH - -### Implementation - -- Edge extraction: `EdgeExtractor.extract(...)` in `app/modules/rag/indexing/code/edges/extractor.py`. -- Document builder: `EdgeDocumentBuilder.build(...)`. -- Built during `CodeIndexingPipeline.index_file(...)`. - -### Input contract - -Indexing input is the same per-file source payload as C0/C1. - -Graph construction method: - -- static analysis only -- Python AST walk only -- no runtime tracing -- no tree-sitter - -Observed edge types: - -- `calls` -- `imports` -- `inherits` - -### Output contract - -Stored document shape: - -- top-level: - - `layer = "C2_DEPENDENCY_GRAPH"` - - `title = ":"` - - `text = " "` - - `span.start_line` - - `span.end_line` - - `links` contains one evidence link of type `EDGE` -- metadata: - - `edge_id` - - `edge_type` - - `src_symbol_id` - - `src_qname` - - `dst_symbol_id` - - `dst_ref` - - `resolution`: `resolved` or `partial` - - `lang_payload` - - `artifact_type = "CODE"` - -Observed `lang_payload` usage: - -- for calls: may include `callsite_kind = "function_call"` - -### Defaults & limits - -- Edge extraction is per-file only. -- `imports` edges are emitted only while visiting a class/function scope; top-level imports do not become C2 edges. -- Layer rank in retrieval SQL: `2` - -### Known issues - -- There is no traversal API, graph repository, or query language over C2. Retrieval only treats edges as text/vector rows in `rag_chunks`. -- Destination resolution is local to the file-level qname map. -- Top-level module import relationships are incompletely represented because `visit_Import` / `visit_ImportFrom` skip when there is no current scope. - -## Layer: C3_ENTRYPOINTS - -### Implementation - -- Detection registry: `EntrypointDetectorRegistry.detect_all(...)`. -- Detectors: - - `FastApiEntrypointDetector` - - `FlaskEntrypointDetector` - - `TyperClickEntrypointDetector` -- Document builder: `EntrypointDocumentBuilder.build(...)`. - -### Input contract - -Indexing input is the same per-file source payload as other C-layers. - -Detected entrypoint families today: - -- HTTP: - - FastAPI decorators such as `.get`, `.post`, `.put`, `.patch`, `.delete`, `.route` - - Flask `.route` -- CLI: - - Typer/Click `.command` - - Typer/Click `.callback` - -Not detected: - -- Django routes -- Celery tasks -- RQ jobs -- cron jobs / scheduler entries - -### Output contract - -Stored document shape: - -- top-level: - - `layer = "C3_ENTRYPOINTS"` - - `title = route_or_command` - - `text = " "` - - `span.start_line` - - `span.end_line` - - `links` contains one evidence link of type `CODE_SPAN` -- metadata: - - `entry_id` - - `entry_type`: observed `http` or `cli` - - `framework`: observed `fastapi`, `flask`, `typer`, `click` - - `route_or_command` - - `handler_symbol_id` - - `lang_payload` - - `artifact_type = "CODE"` - -FastAPI-specific observed payload: - -- `lang_payload.methods = [HTTP_METHOD]` for `.get/.post/...` - -### Defaults & limits - -- Retrieval layer rank: `0` highest among code layers. -- Entrypoint mapping is handler-symbol centric: - - decorator match -> symbol -> `handler_symbol_id` - - physical location comes from symbol span - -### Known issues - -- Route parsing is string-based from decorator text, not semantic AST argument parsing. -- No dedicated entrypoint tags beyond `entry_type`, `framework`, and raw decorator-derived payload. -- Background jobs and non-decorator entrypoints are not indexed. - -## Dependency graph / trace current state - -### Exists or stub? - -- C2 exists and is populated. -- It is not a stub. -- It is also not a full-project dependency graph service; it is a set of per-edge documents stored in `rag_chunks`. - -### How the graph is built - -- static Python AST analysis -- no runtime instrumentation -- no import graph resolver across modules -- no tree-sitter - -### Edge types in data - -- `calls` -- `imports` -- `inherits` - -### Traversal API - -- No traversal API was found in `app/modules/rag/*` or `app/modules/agent/*`. -- No method accepts graph traversal parameters such as depth, start node, edge filters, or BFS/DFS strategy. -- Current access path is only retrieval over indexed edge documents. - -## Entrypoints current state - -### Implemented extraction - -- HTTP routes: - - FastAPI - - Flask -- CLI: - - Typer - - Click - -### Mapping model - -- `entrypoint -> handler_symbol_id -> symbol span/path` -- The entrypoint record itself stores: - - framework - - entry type - - raw route/command string - - handler symbol id - -### Tags/types - -- `entry_type` is the main normalized tag. -- Observed values: `http`, `cli`. -- `framework` is the second discriminator. -- There are no richer endpoint taxonomies such as `job`, `worker`, `webhook`, `scheduler`. - -## Defaults and operational limits - -- Query mode default: `docs` -- Code mode is enabled by keyword heuristics in `RagQueryRouter` -- Retrieval hard limit: `8` -- Fallback limit: `8` -- Query term extraction limit: `6` -- Ranked source bundle for project QA: - - top `12` RAG items - - top `10` file candidates -- No exposed `namespace`, `path_prefixes`, `top_k`, `max_chars`, `max_chunks`, `max_depth` in the public/internal retrieval endpoint - -`ASSUMPTION:` the absence of these controls in endpoint and service signatures means they are not part of the current supported contract, even though `RagQueryRepository.retrieve(...)` has an internal `path_prefixes` parameter. - -## Known cross-cutting issues - -- Retrieval contract is effectively text-only at API level; structured retrieval exists only as internal SQL parameters. -- Response payload drops explicit line spans even though spans are stored. -- Vector retrieval is coupled to a single provider-specific embedder. -- Docs mode is the default, so code retrieval depends on heuristic query phrasing unless the project/qa graph prepends `по коду`. -- There is no separate retrieval contract per layer exposed over API; all layer selection is implicit. - -## Where to plug ExplainPack pipeline - -### Option 1: replace or extend `project_qa/context_analysis` - -- Code location: - - `app/modules/agent/engine/graphs/project_qa_step_graphs.py` -- Why: - - retrieval is already complete at this step - - input bundle already contains ranked `rag_items` and `file_candidates` - - output is already a structured `analysis_brief` -- Risk: - - low - - minimal invasion if ExplainPack consumes `source_bundle` and emits the same `analysis_brief` shape - -### Option 2: insert a new orchestrator step between `context_retrieval` and `context_analysis` - -- Code location: - - `app/modules/agent/engine/orchestrator/template_registry.py` - - `app/modules/agent/engine/orchestrator/step_registry.py` -- Why: - - preserves current retrieval behavior - - makes ExplainPack an explicit pipeline stage with its own artifact - - cleanest for observability and future A/B migration -- Risk: - - low to medium - - requires one new artifact contract and one extra orchestration step, but no change to retrieval storage - -### Option 3: introduce ExplainPack inside `ExplainActions.extract_logic` - -- Code location: - - `app/modules/agent/engine/orchestrator/actions/explain_actions.py` -- Why: - - useful if ExplainPack is meant only for explain-style scenarios - - keeps general project QA untouched -- Risk: - - medium - - narrower integration point; may create duplicate reasoning logic separate from project QA analysis path - -## Bottom line - -- C0-C3 are implemented and persisted in one physical store: `rag_chunks`. -- Retrieval is a hybrid SQL ranking over lexical heuristics plus pgvector distance. -- C2 exists, but only as retrievable edge documents, not as a traversable graph subsystem. -- C3 covers FastAPI/Flask/Typer/Click only. -- The least invasive ExplainPack integration point is after retrieval and before answer composition, preferably as a new explicit orchestrator artifact or as a replacement for `context_analysis`. diff --git a/docs/documentation/rag/api-rag-session-changes.md b/docs/documentation/rag/api-rag-session-changes.md new file mode 100644 index 0000000..895f2c0 --- /dev/null +++ b/docs/documentation/rag/api-rag-session-changes.md @@ -0,0 +1,168 @@ +--- +id: api-rag-session-changes +title: Применение изменений к RAG-сессии +doc_type: api_method +domain: rag +status: draft +owner: system-analyst +source_of_truth: code +related_docs: + - arch-rag-package + - logic-rag-indexing + - entity-rag-session + - entity-rag-index-job +related_code: + - src/app/modules/rag/module.py + - src/app/schemas/rag_sessions.py + - src/app/schemas/indexing.py +entities: + - RagSession + - IndexJob +tags: + - rag + - api + - changes + - incremental-indexing +--- +# Применение изменений к RAG-сессии + +## Summary +- Purpose: поставить incremental indexing для уже существующей `RagSession`. +- Actor: внешний клиент модуля RAG. +- Trigger: частичное обновление индекса после изменения файлов. +- Endpoint: `POST /api/rag/sessions/{rag_session_id}/changes` +- Main entities: `RagSession`, `IndexJob`. +- Main logic: проверка существования сессии, создание change job, асинхронная обработка `upsert`/`delete`. +- Main errors: `not_found` для отсутствующей сессии, `422` для некорректного payload. +- Source of truth: `src/app/modules/rag/module.py`, `src/app/schemas/rag_sessions.py`. + +## Назначение + +Метод позволяет обновить индекс без полной переиндексации проекта. Он принимает только изменённые файлы и операции удаления. + +## Контекст + +Endpoint относится к новому API с явной работой через `rag_session_id`. В отличие от legacy `/api/index/changes`, он не создаёт сессию молча и требует, чтобы она уже существовала. + +## Технический use case + +### Основной сценарий + +1. Клиент передаёт `rag_session_id` в path и список `changed_files` в body. +2. Endpoint проверяет наличие сессии через `RagSessionStore.get`. +3. При успехе `IndexingOrchestrator.enqueue_changes` создаёт новую job и запускает фоновое применение изменений. +4. API возвращает `index_job_id` и стартовый статус. + +### Альтернативные ветки + +- Если `rag_session_id` не найдена, endpoint бросает `AppError("not_found", ...)`. +- Для `op=delete` в последующей логике происходит удаление документов по пути без повторной генерации embeddings. + +## Функциональные требования + +### Request validation +- Path parameter `rag_session_id` обязателен. +- `changed_files` обязателен и состоит из элементов `ChangedFile`. +- Для каждого элемента обязательны `op` и `path`. +- `op` допускает только `upsert` или `delete`. + +### Processing rules +- Сессия должна существовать до постановки change job. +- Каждый вызов создаёт новый `IndexJob`. +- Фактическое применение изменений выполняется асинхронно. + +### State changes +- В `rag_index_jobs` появляется новая задача. +- Сам индекс меняется позже, внутри `RagService.index_changes`. + +### Side effects +- Публикация job events. +- Удаление документов по `delete_paths` и upsert новых документов в фоне. + +## Contract + +### Endpoint +- Method: `POST` +- Path: `/api/rag/sessions/{rag_session_id}/changes` +- Auth: определяется внешним слоем приложения. +- Idempotent: нет, повторный вызов создаёт новую job. +- Timeout: короткий, endpoint не дожидается завершения индексации. +- Retry: только если клиент готов к созданию дополнительной job. + +### Request +| Field | Type | Required | Constraints | Description | +|------|------|----------|-------------|-------------| +| `rag_session_id` | `string` | yes | path param, non-empty | идентификатор существующей RAG-сессии | +| `changed_files` | `array` | yes | схема каждого элемента обязательна | изменения файлов | +| `changed_files[].op` | `enum` | yes | `upsert` or `delete` | тип операции | +| `changed_files[].path` | `string` | yes | `min_length=1` | путь файла | +| `changed_files[].content` | `string \| null` | no | нужен для `upsert` | содержимое файла | +| `changed_files[].content_hash` | `string \| null` | no | повышает cache reuse | hash содержимого | + +### Response +| Field | Type | Description | +|------|------|-------------| +| `index_job_id` | `string` | идентификатор фоновой задачи | +| `status` | `string` | стартовый статус задачи | + +### External contract refs +- OpenAPI: формируется FastAPI по `response_model=IndexJobQueuedResponse`. +- Schema: `RagSessionChangesRequest`, `ChangedFile`, `IndexJobQueuedResponse`. +- DTO / serializer: `src/app/schemas/rag_sessions.py`, `src/app/schemas/indexing.py`. +- Additional refs: `logic-rag-indexing`. + +## Errors + +| error_id | http_code | when | client_behavior | retry | +|----------|-----------|------|-----------------|-------| +| `not_found` | `404` | `rag_session_id` отсутствует | создать новую сессию или исправить id | no | +| `validation_error` | `422` | нарушена схема request | исправить payload | no | + +## Нефункциональные требования + +### Security +- Метод доверяет внешнему слою авторизации. + +### Observability +- Logs: прямое логирование endpoint отсутствует. +- Metrics: нет отдельной метрики на уровне метода. +- Traces: отсутствуют. +- Audit: каждая операция материализуется в `IndexJob`. + +### Reliability +- Проверка существования сессии защищает от случайной записи в неинициализированный scope. +- Ошибки индексации доступны через job status и SSE events. + +### Performance +- Быстрый ответ за счёт фонового выполнения. + +## Связанные блоки логики +- `logic-rag-indexing` + +## Связанные сущности +- `RagSession` +- `IndexJob` + +## Связанный код + +### Files +- `src/app/modules/rag/module.py` +- `src/app/schemas/rag_sessions.py` +- `src/app/schemas/indexing.py` + +### Symbols +- `RagModule.public_router.rag_session_changes` +- `RagSessionStore.get` +- `IndexingOrchestrator.enqueue_changes` + +## Связанные документы +- `arch-rag-package` +- `logic-rag-indexing` +- `entity-rag-session` +- `entity-rag-index-job` + +## История изменений + +| Date | Source | Changes | +|------|--------|---------| +| 2026-03-13 | code | Задокументирован публичный endpoint incremental indexing для существующей сессии. | diff --git a/docs/documentation/rag/api-rag-session-create.md b/docs/documentation/rag/api-rag-session-create.md new file mode 100644 index 0000000..6aea2fa --- /dev/null +++ b/docs/documentation/rag/api-rag-session-create.md @@ -0,0 +1,166 @@ +--- +id: api-rag-session-create +title: Создание RAG-сессии и запуск snapshot-индексации +doc_type: api_method +domain: rag +status: draft +owner: system-analyst +source_of_truth: code +related_docs: + - arch-rag-package + - logic-rag-indexing + - entity-rag-session + - entity-rag-index-job +related_code: + - src/app/modules/rag/module.py + - src/app/schemas/rag_sessions.py + - src/app/schemas/indexing.py +entities: + - RagSession + - IndexJob +tags: + - rag + - api + - session + - snapshot +--- +# Создание RAG-сессии и запуск snapshot-индексации + +## Summary +- Purpose: создать новую `RagSession` и асинхронно поставить полную индексацию snapshot-файлов. +- Actor: внешний клиент модуля RAG. +- Trigger: первичная загрузка файлов проекта в индекс. +- Endpoint: `POST /api/rag/sessions` +- Main entities: `RagSession`, `IndexJob`. +- Main logic: создание UUID-сессии, постановка snapshot job, возврат идентификаторов сессии и job. +- Main errors: в коде endpoint нет собственной бизнес-валидации сверх pydantic; ошибки индексации проявляются позже в job status. +- Source of truth: `src/app/modules/rag/module.py`, `src/app/schemas/rag_sessions.py`. + +## Назначение + +Метод открывает новую RAG-сессию и запускает первичную индексацию файлов. Он используется как основной публичный вход для нового API пакета `rag`. + +## Контекст + +В отличие от legacy `/api/index/snapshot`, этот endpoint всегда создаёт новый `rag_session_id`, что позволяет независимо хранить несколько снимков одного проекта. + +## Технический use case + +### Основной сценарий + +1. Клиент передаёт `project_id` и массив `files`. +2. `RagSessionStore.create` создаёт новую запись в `rag_sessions`. +3. `IndexingOrchestrator.enqueue_snapshot` создаёт `IndexJob` и запускает фоновую обработку. +4. API сразу возвращает `rag_session_id`, `index_job_id` и стартовый статус. + +### Альтернативные ветки + +- Если часть файлов не подлежит индексации, они будут отфильтрованы уже внутри indexing pipeline, а не на этапе ответа API. +- Ошибки индексации не меняют синхронный ответ create endpoint, а отражаются в последующем статусе job. + +## Функциональные требования + +### Request validation +- `project_id` обязателен и не может быть пустым. +- `files` передаются списком объектов `FileSnapshot`. +- Для каждого файла обязательны `path`, `content`, `content_hash`. + +### Processing rules +- На каждый вызов создаётся новая `RagSession`. +- Snapshot job создаётся сразу после сохранения сессии. +- Ответ не ждёт завершения индексации. + +### State changes +- В `rag_sessions` появляется новая запись. +- В `rag_index_jobs` появляется новая запись в статусе `queued`. + +### Side effects +- Запуск фоновой `asyncio` task. +- Последующая публикация progress events в EventBus. + +## Contract + +### Endpoint +- Method: `POST` +- Path: `/api/rag/sessions` +- Auth: определяется внешним слоем приложения, внутри endpoint не задана. +- Idempotent: нет. +- Timeout: короткий, так как endpoint не ждёт индексацию. +- Retry: допустим только на стороне клиента с пониманием, что будет создана новая сессия. + +### Request +| Field | Type | Required | Constraints | Description | +|------|------|----------|-------------|-------------| +| `project_id` | `string` | yes | `min_length=1` | идентификатор проекта | +| `files` | `array` | yes | может быть пустым, но схема обязана соблюдаться | snapshot файлов для первичной индексации | +| `files[].path` | `string` | yes | `min_length=1` | путь файла | +| `files[].content` | `string` | yes | без дополнительных ограничений | содержимое файла | +| `files[].content_hash` | `string` | yes | `min_length=1` | hash содержимого для cache reuse | + +### Response +| Field | Type | Description | +|------|------|-------------| +| `rag_session_id` | `string` | идентификатор созданной сессии | +| `index_job_id` | `string` | идентификатор фоновой задачи индексации | +| `status` | `IndexJobStatus` | стартовый статус задачи, обычно `queued` | + +### External contract refs +- OpenAPI: формируется FastAPI по `response_model=RagSessionCreateResponse`. +- Schema: `RagSessionCreateRequest`, `RagSessionCreateResponse`. +- DTO / serializer: `src/app/schemas/rag_sessions.py`, `src/app/schemas/indexing.py`. +- Additional refs: `logic-rag-indexing`. + +## Errors + +| error_id | http_code | when | client_behavior | retry | +|----------|-----------|------|-----------------|-------| +| `validation_error` | `422` | нарушена pydantic-схема request | исправить payload | no | + +## Нефункциональные требования + +### Security +- Авторизация и аутентификация находятся вне этого метода. + +### Observability +- Logs: прямое логирование в endpoint отсутствует. +- Metrics: отдельные API-метрики не выделены. +- Traces: отсутствуют. +- Audit: факт вызова материализуется через `RagSession` и `IndexJob`. + +### Reliability +- Даже при дальнейшей ошибке индексации клиент может получить статус через job endpoint. +- Фоновая задача создаётся немедленно после ответа. + +### Performance +- Время ответа не зависит от размера snapshot, кроме времени сериализации request. + +## Связанные блоки логики +- `logic-rag-indexing` + +## Связанные сущности +- `RagSession` +- `IndexJob` + +## Связанный код + +### Files +- `src/app/modules/rag/module.py` +- `src/app/schemas/rag_sessions.py` +- `src/app/schemas/indexing.py` + +### Symbols +- `RagModule.public_router.create_rag_session` +- `RagSessionStore.create` +- `IndexingOrchestrator.enqueue_snapshot` + +## Связанные документы +- `arch-rag-package` +- `logic-rag-indexing` +- `entity-rag-session` +- `entity-rag-index-job` + +## История изменений + +| Date | Source | Changes | +|------|--------|---------| +| 2026-03-13 | code | Задокументирован публичный endpoint создания RAG-сессии. | diff --git a/docs/documentation/rag/api-rag-session-job.md b/docs/documentation/rag/api-rag-session-job.md new file mode 100644 index 0000000..20a36cf --- /dev/null +++ b/docs/documentation/rag/api-rag-session-job.md @@ -0,0 +1,166 @@ +--- +id: api-rag-session-job +title: Получение статуса и событий задачи индексации +doc_type: api_method +domain: rag +status: draft +owner: system-analyst +source_of_truth: code +related_docs: + - arch-rag-package + - entity-rag-session + - entity-rag-index-job +related_code: + - src/app/modules/rag/module.py + - src/app/modules/rag/job_store.py + - src/app/schemas/rag_sessions.py +entities: + - RagSession + - IndexJob +tags: + - rag + - api + - job-status + - sse +--- +# Получение статуса и событий задачи индексации + +## Summary +- Purpose: отдать текущее состояние job и поток событий её выполнения в рамках конкретной `RagSession`. +- Actor: внешний клиент модуля RAG. +- Trigger: polling или live-monitoring после запуска snapshot/change indexing. +- Endpoint: `GET /api/rag/sessions/{rag_session_id}/jobs/{index_job_id}` и `GET /api/rag/sessions/{rag_session_id}/jobs/{index_job_id}/events` +- Main entities: `RagSession`, `IndexJob`. +- Main logic: чтение job по id, проверка принадлежности сессии, возврат status payload или SSE stream. +- Main errors: `not_found` при отсутствии job или несовпадении `rag_session_id`. +- Source of truth: `src/app/modules/rag/module.py`, `src/app/modules/rag/job_store.py`. + +## Назначение + +Документ описывает два связанных метода наблюдения: синхронный status endpoint и потоковый SSE endpoint. Оба работают поверх одной сущности `IndexJob`. + +## Контекст + +Create и changes endpoints возвращают только стартовый статус задачи, поэтому клиенту нужны отдельные методы для отслеживания выполнения. SSE-поток даёт live progress, а status endpoint нужен для простого polling. + +## Технический use case + +### Основной сценарий + +1. Клиент вызывает status endpoint или открывает SSE stream по `index_job_id`. +2. Endpoint читает job из `IndexJobStore`. +3. Если job отсутствует или принадлежит другой `rag_session_id`, возвращается `not_found`. +4. Status endpoint отдаёт снимок counters и error payload. +5. SSE endpoint подписывается на `EventBus` c `replay=True` и транслирует `index_status`, `index_progress`, `terminal`. + +### Альтернативные ветки + +- При отсутствии новых событий SSE endpoint каждые 10 секунд отправляет `: keepalive`. +- После события `terminal` поток завершается и отписывается от EventBus. + +## Функциональные требования + +### Request validation +- `rag_session_id` и `index_job_id` обязательны как path parameters. +- Job должна существовать и принадлежать переданной сессии. + +### Processing rules +- Status endpoint не подписывается на события и читает только текущее состояние job. +- SSE endpoint использует `replay=True`, чтобы клиент получил уже опубликованные события. +- Оба метода защищают от доступа к job другой сессии. + +### State changes +- Методы не меняют состояние job. + +### Side effects +- SSE endpoint создаёт временную подписку на EventBus. +- При завершении или разрыве соединения выполняется `unsubscribe`. + +## Contract + +### Endpoint +- Method: `GET` +- Path: `/api/rag/sessions/{rag_session_id}/jobs/{index_job_id}` и `/api/rag/sessions/{rag_session_id}/jobs/{index_job_id}/events` +- Auth: определяется внешним слоем приложения. +- Idempotent: да. +- Timeout: status endpoint короткий; SSE stream долгоживущий. +- Retry: polling можно повторять безопасно; SSE можно переподключать. + +### Request +| Field | Type | Required | Constraints | Description | +|------|------|----------|-------------|-------------| +| `rag_session_id` | `string` | yes | path param | идентификатор сессии | +| `index_job_id` | `string` | yes | path param | идентификатор задачи | + +### Response +| Field | Type | Description | +|------|------|-------------| +| `rag_session_id` | `string` | идентификатор сессии, только для status endpoint | +| `index_job_id` | `string` | идентификатор задачи | +| `status` | `IndexJobStatus` | текущее состояние job | +| `indexed_files` | `integer` | число успешно обработанных файлов | +| `failed_files` | `integer` | число файлов с ошибками | +| `cache_hit_files` | `integer` | число cache hit | +| `cache_miss_files` | `integer` | число cache miss | +| `error` | `object \| null` | ошибка, если job завершилась с `error` | + +### External contract refs +- OpenAPI: status endpoint использует `response_model=RagSessionJobResponse`; SSE endpoint отдаёт `text/event-stream`. +- Schema: `RagSessionJobResponse`. +- DTO / serializer: `src/app/schemas/rag_sessions.py`. +- Additional refs: `entity-rag-index-job`. + +## Errors + +| error_id | http_code | when | client_behavior | retry | +|----------|-----------|------|-----------------|-------| +| `not_found` | `404` | job отсутствует или не принадлежит переданной сессии | проверить id или создать новую задачу | no | + +## Нефункциональные требования + +### Security +- Проверка `job.rag_session_id == rag_session_id` обязательна для обоих методов. + +### Observability +- Logs: отдельные логи чтения статуса не реализованы. +- Metrics: отсутствуют. +- Traces: отсутствуют. +- Audit: история job хранится в `rag_index_jobs`, поток событий в памяти EventBus. + +### Reliability +- SSE heartbeat удерживает соединение активным. +- `finally` блок гарантирует `unsubscribe`. + +### Performance +- Status endpoint работает как лёгкий запрос к БД. +- SSE stream масштабируется числом активных подписчиков и объёмом событий. + +## Связанные блоки логики +- `logic-rag-indexing` + +## Связанные сущности +- `RagSession` +- `IndexJob` + +## Связанный код + +### Files +- `src/app/modules/rag/module.py` +- `src/app/modules/rag/job_store.py` +- `src/app/schemas/rag_sessions.py` + +### Symbols +- `RagModule.public_router.rag_session_job` +- `RagModule.public_router.rag_session_job_events` +- `IndexJobStore.get` + +## Связанные документы +- `arch-rag-package` +- `entity-rag-session` +- `entity-rag-index-job` + +## История изменений + +| Date | Source | Changes | +|------|--------|---------| +| 2026-03-13 | code | Задокументированы status и SSE endpoints для наблюдения за indexing job. | diff --git a/docs/documentation/rag/architecture-overview.md b/docs/documentation/rag/architecture-overview.md new file mode 100644 index 0000000..0493417 --- /dev/null +++ b/docs/documentation/rag/architecture-overview.md @@ -0,0 +1,222 @@ +--- + +## id: arch-rag-package +title: Пакет RAG +doc_type: architecture_overview +domain: rag +status: draft +owner: system-analyst +source_of_truth: code +related_docs: + - logic-rag-indexing + - logic-rag-retrieval + - entity-rag-session + - entity-rag-index-job + - api-rag-session-create + - api-rag-session-changes + - api-rag-session-job +related_code: + - src/app/modules/rag/module.py + - src/app/modules/rag/services/rag_service.py + - src/app/modules/rag/indexing_service.py + - src/app/modules/rag/persistence/repository.py + - src/app/modules/rag/persistence/schema_repository.py +entities: + - RagSession + - IndexJob + - RagDocument +tags: + - rag + - indexing + - retrieval + - architecture + +# Пакет RAG + +## Summary + +- Scope: модуль индексации проектных файлов, хранения RAG-слоёв и выдачи retrieval-контекста. +- Purpose: построить индекс по документации и Python-коду и дать runtime доступ к релевантным фрагментам. +- Main modules: `RagModule`, `RagService`, `IndexingOrchestrator`, `RagRepository`, `RepoWebhookService`. +- Main domains: RAG-сессии, задачи индексации, документы индекса, blob-cache, retrieval. +- Main integrations: PostgreSQL/pgvector, GigaChat embeddings, FastAPI, EventBus, story context. +- Key entrypoints: `/api/rag/sessions`, `/api/rag/sessions/{rag_session_id}/changes`, `/api/rag/sessions/{rag_session_id}/jobs/{index_job_id}`, `/internal/rag-repo/webhook`. +- Key data flows: snapshot indexing, incremental reindex, retrieval из `rag_chunks`, webhook-нормализация коммитов. +- Source of truth: код `src/app/modules/rag/*`. + +## Назначение + +Пакет `rag` отвечает за полный цикл подготовки retrieval-контекста для проекта: принимает снапшоты и изменения файлов, преобразует их в набор атомарных `RagDocument`, векторизует, сохраняет в БД и предоставляет доступ к индексированным данным другим частям системы. + +## Контекст + +Модуль используется как инфраструктурный слой для agent/runtime и смежных интеграций. На вход он принимает либо список файлов проекта, либо webhook репозитория. На выходе формирует устойчивый индекс, ассоциированный с `rag_session_id`, и статус задач индексации, пригодный для опроса и SSE-подписки. + +## Границы системы + +### In scope + +- Создание и хранение `RagSession`. +- Постановка и выполнение задач snapshot/change indexing. +- Индексация markdown-документации в слои `D1-D4`. +- Индексация Python-кода в слои `C0-C4`. +- Кэширование по `repo_id + blob_sha`. +- Сохранение retrieval-документов в `rag_chunks`. +- Выдача статуса задач и событий прогресса. +- Нормализация webhook Gitea/Bitbucket и связывание коммитов со story. + +### Out of scope + +- Финальная генерация ответа пользователю. +- Оркестрация LLM-диалога. +- Управление git-репозиторием и загрузка файлов из внешних источников. +- Политики маршрутизации intent/runtime вне собственного persistence/retrieval API. + +## Архитектурная схема + +`RagModule` собирает зависимости модуля и публикует HTTP endpoints. Для индексации он использует `RagSessionStore`, `IndexJobStore`, `IndexingOrchestrator` и `RagService`. `RagService` выбирает docs/code pipeline, обогащает документы метаданными файла, запрашивает embeddings и записывает результат через `RagRepository`. `RagRepository` агрегирует schema/session/job/document/cache/query репозитории. Отдельно `RagRepoModule` принимает repository webhooks и прокидывает нормализованный commit context в story storage и cache writer. + +## Основные модули + + +| module | responsibility | depends_on | key_code_refs | +| ---------------------- | -------------------------------------------------------- | ------------------------------------------------------------------------ | ----------------------------------------------- | +| `RagModule` | сборка зависимостей, публичный и internal API | `RagService`, `IndexingOrchestrator`, `RagSessionStore`, `IndexJobStore` | `src/app/modules/rag/module.py` | +| `RagService` | синхронная бизнес-логика индексации файлов и cache reuse | docs/code pipeline, embedder, `RagRepository` | `src/app/modules/rag/services/rag_service.py` | +| `IndexingOrchestrator` | асинхронный job lifecycle, retry, project lock, EventBus | `IndexJobStore`, `RagIndexer`, `EventBus`, `RetryExecutor` | `src/app/modules/rag/indexing_service.py` | +| `DocsIndexingPipeline` | построение слоёв документации `D1-D4` | classifier, chunker, document builder | `src/app/modules/rag/indexing/docs/pipeline.py` | +| `CodeIndexingPipeline` | построение слоёв кода `C0-C4` | AST parser, symbol/edge/entrypoint/role builders | `src/app/modules/rag/indexing/code/pipeline.py` | +| `RagRepository` | единая точка persistence и retrieval | schema/session/job/document/cache/query repositories | `src/app/modules/rag/persistence/repository.py` | +| `RepoWebhookService` | нормализация webhook payload и выделение story id | story writer, cache writer | `src/app/modules/rag/webhook_service.py` | + + +## Основные доменные области + +- RAG session как граница индекса конкретного проекта или его временного снапшота. +- Index job как жизненный цикл асинхронной индексации и канал наблюдения за прогрессом. +- RagDocument как атом индекса, который попадает в retrieval-хранилище и в cache. +- Repo webhook context как источник commit metadata для story и cache. + +## Основные интеграции + + +| integration | direction | purpose | protocol / transport | related_docs | +| ------------------------ | --------- | --------------------------------------------------- | ---------------------------------- | -------------------------------------------------------------------------- | +| PostgreSQL + pgvector | outbound | хранение документов, jobs, sessions и vector search | SQLAlchemy / SQL / pgvector | `logic-rag-retrieval` | +| GigaChat embeddings | outbound | получение embedding для batch документов | HTTP client через `GigaChatClient` | `logic-rag-indexing` | +| FastAPI | inbound | публичный и internal API модуля | HTTP | `api-rag-session-create`, `api-rag-session-changes`, `api-rag-session-job` | +| EventBus | outbound | публикация прогресса индексации и terminal events | in-process async events / SSE | `api-rag-session-job` | +| Story context repository | outbound | запись webhook-коммитов для story | Python interface | `logic-rag-indexing` | + + +## Основные потоки + +### Flow 1 + +1. Клиент вызывает `POST /api/rag/sessions` с `project_id` и snapshot файлов. +2. `RagSessionStore` создаёт `rag_session_id`, а `IndexingOrchestrator` создаёт `IndexJob`. +3. `RagService` фильтрует файлы, переиспользует cache по `blob_sha` или строит docs/code документы заново. +4. Документы векторизуются, записываются в `rag_chunks`, а job получает финальный статус `done` или `error`. + +### Flow 2 + +1. Клиент вызывает `POST /api/rag/sessions/{rag_session_id}/changes`. +2. `IndexingOrchestrator` сериализует обработку по `rag_session_id`. +3. `RagService` удаляет документы по `delete_paths`, пересобирает upsert-файлы и применяет изменения к индексу. +4. Клиент читает статус и события задачи через job endpoints. + +## Архитектурные решения и ограничения + +### Key decisions + +- Snapshot и incremental indexing используют один и тот же `RagService`, различаясь только стратегией записи. +- Кэш документов привязан к `repo_id + blob_sha`, а не к `rag_session_id`, что позволяет переиспользовать embeddings между сессиями одного проекта. +- Документация и код индексируются разными pipeline, но сохраняются в общую таблицу `rag_chunks`. +- Асинхронность вынесена в `IndexingOrchestrator`, чтобы `RagService` оставался application-service без управления job lifecycle. + +### Constraints + +- Code indexing поддерживает только Python-файлы. +- Docs indexing ориентирован на markdown и frontmatter YAML. +- Deprecated endpoint `/internal/rag/retrieve` не используется для рабочего retrieval. +- Реальное retrieval API доступно через repository/runtime adapters, а не через публичный HTTP endpoint модуля. + +### Risks + +- Ошибки embeddings или временные сетевые сбои переводят job в `error` только после исчерпания retry. +- Полное `replace_documents` для snapshot удаляет все документы сессии перед вставкой новых. +- Retrieval ranking завязан на SQL-эвристики по layer, lexical match и metadata, поэтому качество зависит от корректности metadata builders. + +## Нефункциональные аспекты + +### Security + +- Публичные endpoints не содержат собственной бизнес-авторизации внутри модуля и полагаются на внешний слой приложения. +- Webhook provider определяется по headers/payload без явной проверки подписи в самом `RepoWebhookService`. + +### Reliability + +- Проектный `asyncio.Lock` предотвращает параллельную индексацию одной `rag_session`. +- `RetryExecutor` повторяет временные сбои индексации. + +### Observability + +- Logs: `RagService` пишет предупреждения по cache hit/miss и skipped files. +- Metrics: явные метрики не выделены. +- Traces: явная трассировка не реализована. +- Audit: job status и webhook commit binding сохраняются в БД. + +### Performance + +- Embeddings отправляются батчами с размером из `RAG_EMBED_BATCH_SIZE`. +- Cache reuse исключает повторную векторизацию неизменённых blob. + +### Scalability + +- Индекс хранится на уровне SQL-таблиц с векторными полями и индексами по session/layer/path. +- При росте объёма данных узким местом остаются полнотабличные delete/insert по snapshot и SQL sorting retrieval. + +## Связанные сущности + +- `RagSession` +- `IndexJob` +- `RagDocument` + +## Связанный код + +### Files + +- `src/app/modules/rag/module.py` +- `src/app/modules/rag/services/rag_service.py` +- `src/app/modules/rag/indexing_service.py` +- `src/app/modules/rag/persistence/repository.py` +- `src/app/modules/rag/persistence/schema_repository.py` +- `src/app/modules/rag/webhook_service.py` + +### Symbols + +- `RagModule` +- `RagRepoModule` +- `RagService` +- `IndexingOrchestrator` +- `RagRepository` +- `RepoWebhookService` + +## Связанные документы + +- `logic-rag-indexing` +- `logic-rag-retrieval` +- `entity-rag-session` +- `entity-rag-index-job` +- `api-rag-session-create` +- `api-rag-session-changes` +- `api-rag-session-job` + +## История изменений + + +| Date | Source | Changes | +| ---------- | ------ | ------------------------------------------------------------------- | +| 2026-03-13 | code | Создан обзор архитектуры пакета `rag` на основе текущей реализации. | + + diff --git a/docs/documentation/rag/entity-index-job.md b/docs/documentation/rag/entity-index-job.md new file mode 100644 index 0000000..6cd2f75 --- /dev/null +++ b/docs/documentation/rag/entity-index-job.md @@ -0,0 +1,154 @@ +--- +id: entity-rag-index-job +title: Сущность IndexJob +doc_type: domain_entity +domain: rag +status: draft +owner: system-analyst +source_of_truth: code +related_docs: + - arch-rag-package + - logic-rag-indexing + - entity-rag-session + - api-rag-session-job +related_code: + - src/app/modules/rag/job_store.py + - src/app/modules/rag/indexing_service.py + - src/app/modules/rag/persistence/job_repository.py + - src/app/modules/rag/persistence/schema_repository.py +entities: + - IndexJob + - RagSession +tags: + - rag + - indexing + - job + - domain-entity +--- +# Сущность IndexJob + +## Summary +- Domain: rag +- Purpose: представить асинхронную задачу индексации и её наблюдаемый статус. +- Entity role: operational entity для выполнения snapshot/change indexing. +- Main attributes: `index_job_id`, `rag_session_id`, `status`, `indexed_files`, `failed_files`, `cache_hit_files`, `cache_miss_files`, `error`. +- Lifecycle: `queued -> running -> done|error`. +- Invariants: job всегда принадлежит одной `RagSession`, статус хранится как enum `IndexJobStatus`. +- Related APIs: создание job косвенно через session endpoints, чтение через job status endpoint и SSE endpoint. +- Related logic: `IndexingOrchestrator`, retry, EventBus publishing. +- Source of truth: `src/app/modules/rag/job_store.py`, `src/app/modules/rag/indexing_service.py`. + +## Назначение + +`IndexJob` хранит технический прогресс и итог выполнения индексации. Он нужен, чтобы API модуля мог вернуть результат не синхронно, а через опрос статуса и подписку на события. + +## Контекст + +Job создаётся на каждую snapshot- или changes-операцию. Сервис индексации обновляет его counters и публикует события прогресса в EventBus под ключом `index_job_id`. + +## Роль в доменной модели + +Это операционная сущность, которая связывает пользовательский запрос на индексацию с фактическим процессом обработки файлов. Она не хранит сам индекс, но управляет прозрачностью выполнения и ошибками. + +## Атрибуты + +| attribute | type | required | description | constraints | +|-----------|------|----------|-------------|-------------| +| `index_job_id` | `str` | yes | уникальный идентификатор задачи | primary key, non-empty | +| `rag_session_id` | `str` | yes | ссылка на целевую RAG-сессию | non-empty | +| `status` | `IndexJobStatus` | yes | текущее состояние задачи | `queued`, `running`, `done`, `error` | +| `indexed_files` | `int` | yes | число успешно обработанных файлов | `>= 0` | +| `failed_files` | `int` | yes | число файлов с ошибками | `>= 0` | +| `cache_hit_files` | `int` | yes | число файлов, обслуженных из cache | `>= 0` | +| `cache_miss_files` | `int` | yes | число файлов, потребовавших embeddings | `>= 0` | +| `error` | `ErrorPayload \| None` | no | информация о необработанной временной ошибке после retry | optional | + +## Состояния и жизненный цикл + +### Основные состояния +- `queued` +- `running` +- `done` +- `error` + +### Переходы состояний +1. `IndexJobStore.create` создаёт job в состоянии `queued`. +2. `IndexingOrchestrator._run_with_project_lock` переводит job в `running`. +3. Успешная индексация переводит job в `done` и заполняет counters. +4. Ошибка после исчерпания retry переводит job в `error` и заполняет `ErrorPayload`. + +## Инварианты и ограничения + +- Job не мигрирует между `rag_session_id`. +- Финальные counters сохраняются в БД перед публикацией terminal event. +- Ошибки уровня `TimeoutError`, `ConnectionError`, `OSError` считаются временными и оборачиваются в `index_retry_exhausted` только после retry exhaustion. + +## Связи с другими сущностями + +| entity | relation | description | +|--------|----------|-------------| +| `RagSession` | many-to-one | каждая задача относится к одной сессии | +| `RagDocument` | indirect | job обновляет набор документов сессии, но не владеет ими напрямую | + +## Использование в системе + +### Related API +- `POST /api/rag/sessions` +- `POST /api/rag/sessions/{rag_session_id}/changes` +- `GET /api/rag/sessions/{rag_session_id}/jobs/{index_job_id}` +- `GET /api/rag/sessions/{rag_session_id}/jobs/{index_job_id}/events` + +### Related UI +- Прямого UI в репозитории не обнаружено. + +### Related logic +- `logic-rag-indexing` + +### Related integrations +- EventBus SSE stream +- PostgreSQL таблица `rag_index_jobs` + +## Функциональные требования + +- Job должна создаваться до запуска фоновой задачи. +- Публичный API обязан проверять принадлежность job указанной `rag_session_id`. +- Progress events должны публиковаться в формате, достаточном для фронта или внешнего клиента. + +## Нефункциональные требования + +### Audit / history +- `created_at` и `updated_at` сохраняются в таблице `rag_index_jobs`. + +### Security +- Доступ к job опирается на проверку связи `job.rag_session_id == requested rag_session_id`. + +### Observability +- SSE stream отдаёт `index_status`, `index_progress`, `terminal`. + +## Связанный код + +### Files +- `src/app/modules/rag/job_store.py` +- `src/app/modules/rag/indexing_service.py` +- `src/app/modules/rag/persistence/job_repository.py` +- `src/app/modules/rag/persistence/schema_repository.py` + +### Symbols +- `IndexJob` +- `IndexJobStore.create` +- `IndexJobStore.get` +- `IndexJobStore.save` +- `IndexingOrchestrator._run_with_project_lock` + +## Связанные документы + +- `arch-rag-package` +- `logic-rag-indexing` +- `entity-rag-session` +- `api-rag-session-job` + +## История изменений + +| Date | Source | Changes | +|------|--------|---------| +| 2026-03-13 | code | Добавлено описание lifecycle и контракта сущности `IndexJob`. | diff --git a/docs/documentation/rag/entity-rag-session.md b/docs/documentation/rag/entity-rag-session.md new file mode 100644 index 0000000..3249c51 --- /dev/null +++ b/docs/documentation/rag/entity-rag-session.md @@ -0,0 +1,143 @@ +--- +id: entity-rag-session +title: Сущность RagSession +doc_type: domain_entity +domain: rag +status: draft +owner: system-analyst +source_of_truth: code +related_docs: + - arch-rag-package + - logic-rag-indexing + - api-rag-session-create + - api-rag-session-changes + - api-rag-session-job +related_code: + - src/app/modules/rag/session_store.py + - src/app/modules/rag/persistence/session_repository.py + - src/app/modules/rag/persistence/schema_repository.py +entities: + - RagSession +tags: + - rag + - session + - domain-entity +--- +# Сущность RagSession + +## Summary +- Domain: rag +- Purpose: связать индекс и связанные job с конкретным проектом или его рабочим снимком. +- Entity role: корневая сущность области RAG indexing/retrieval. +- Main attributes: `rag_session_id`, `project_id`, `created_at`. +- Lifecycle: создаётся до первой индексации и используется как scope всех retrieval-запросов. +- Invariants: `rag_session_id` уникален, `project_id` обязателен. +- Related APIs: `POST /api/rag/sessions`, `POST /api/rag/sessions/{rag_session_id}/changes`, `GET /api/rag/sessions/{rag_session_id}/jobs/{index_job_id}`. +- Related logic: snapshot indexing, change indexing, retrieval filtering. +- Source of truth: `src/app/modules/rag/session_store.py`, таблица `rag_sessions`. + +## Назначение + +`RagSession` определяет границу индекса для проекта. Все документы, задачи и retrieval-запросы внутри `rag` привязаны к этой сущности. + +## Контекст + +Сессия используется и в новом API с UUID, и в legacy/internal режиме, где `project_id` может совпадать с `rag_session_id`. Через неё сервис восстанавливает `repo_id`, который затем участвует в кэшировании документов. + +## Роль в доменной модели + +`RagSession` является владельцем набора индексированных документов и асинхронных `IndexJob`. Без неё нельзя безопасно выполнять reindex или retrieval, потому что именно она задаёт scope таблицы `rag_chunks`. + +## Атрибуты + +| attribute | type | required | description | constraints | +|-----------|------|----------|-------------|-------------| +| `rag_session_id` | `str` | yes | уникальный идентификатор сессии | primary key, non-empty | +| `project_id` | `str` | yes | идентификатор проекта или workspace | non-empty | +| `created_at` | `timestamp with time zone` | yes | время создания записи в БД | default `CURRENT_TIMESTAMP` | + +## Состояния и жизненный цикл + +### Основные состояния +- created +- active +- reused via legacy/internal API + +### Переходы состояний +1. `RagSessionStore.create(project_id)` создаёт новую сессию с UUID. +2. `RagSessionStore.put(rag_session_id, project_id)` создаёт или обновляет сессию с заданным ключом. +3. После создания сессия используется для indexing и retrieval до тех пор, пока не будет заменена новым идентификатором на уровне вызывающего сервиса. + +## Инварианты и ограничения + +- `project_id` не должен быть пустым. +- Для retrieval и indexing используется только один `rag_session_id` за операцию. +- `RagService._resolve_repo_id` использует `project_id` этой сущности как `repo_id` для cache scope. + +## Связи с другими сущностями + +| entity | relation | description | +|--------|----------|-------------| +| `IndexJob` | one-to-many | одна сессия может иметь много задач индексации | +| `RagDocument` | one-to-many | все записи в `rag_chunks` привязаны к одной сессии | + +## Использование в системе + +### Related API +- `POST /api/rag/sessions` +- `POST /api/rag/sessions/{rag_session_id}/changes` +- `GET /api/rag/sessions/{rag_session_id}/jobs/{index_job_id}` + +### Related UI +- Прямого UI в репозитории не обнаружено. + +### Related logic +- `logic-rag-indexing` +- `logic-rag-retrieval` + +### Related integrations +- PostgreSQL таблица `rag_sessions` + +## Функциональные требования + +- Сессия должна создаваться до постановки snapshot job. +- При change indexing запрос должен ссылаться на существующую сессию в новом публичном API. +- Legacy/internal API может создавать запись с предсказуемым `rag_session_id`, равным `project_id`. + +## Нефункциональные требования + +### Audit / history +- Время создания фиксируется в таблице `rag_sessions`. + +### Security +- Отдельных прав доступа на уровне сущности внутри модуля нет. + +### Observability +- Основная наблюдаемость сессии идёт через связанные `IndexJob`. + +## Связанный код + +### Files +- `src/app/modules/rag/session_store.py` +- `src/app/modules/rag/persistence/session_repository.py` +- `src/app/modules/rag/persistence/schema_repository.py` + +### Symbols +- `RagSession` +- `RagSessionStore.create` +- `RagSessionStore.put` +- `RagSessionStore.get` + +## Связанные документы + +- `arch-rag-package` +- `logic-rag-indexing` +- `api-rag-session-create` +- `api-rag-session-changes` +- `api-rag-session-job` + +## История изменений + +| Date | Source | Changes | +|------|--------|---------| +| 2026-03-13 | code | Добавлено описание сущности `RagSession` и её роли в границах индекса. | diff --git a/docs/documentation/rag/logic-indexing-pipeline.md b/docs/documentation/rag/logic-indexing-pipeline.md new file mode 100644 index 0000000..8559f61 --- /dev/null +++ b/docs/documentation/rag/logic-indexing-pipeline.md @@ -0,0 +1,166 @@ +--- +id: logic-rag-indexing +title: Индексация файлов в RAG +doc_type: logic_block +domain: rag +status: draft +owner: system-analyst +source_of_truth: code +related_docs: + - arch-rag-package + - entity-rag-session + - entity-rag-index-job + - api-rag-session-create + - api-rag-session-changes +related_code: + - src/app/modules/rag/indexing_service.py + - src/app/modules/rag/services/rag_service.py + - src/app/modules/rag/indexing/docs/pipeline.py + - src/app/modules/rag/indexing/code/pipeline.py + - src/app/modules/rag/persistence/document_repository.py +entities: + - RagSession + - IndexJob + - RagDocument +tags: + - rag + - indexing + - snapshot + - changes +--- +# Индексация файлов в RAG + +## Summary +- Purpose: превратить входной список файлов в набор индексируемых `RagDocument` и сохранить их в persistence. +- Trigger: создание RAG-сессии, запрос изменений, internal snapshot/changes endpoints. +- Inputs: `rag_session_id`, файлы snapshot или changed_files, progress callback. +- Outputs: обновлённые записи в `rag_chunks`, `rag_session_chunk_map`, статистика indexed/failed/cache hit/cache miss. +- Main entities: `RagSession`, `IndexJob`, `RagDocument`. +- Main dependencies: `IndexingOrchestrator`, `RagService`, `DocsIndexingPipeline`, `CodeIndexingPipeline`, `GigaChatEmbedder`, `RagRepository`. +- Side effects: SQL delete/insert, cache write, SSE events, job status update. +- Source of truth: `src/app/modules/rag/indexing_service.py`, `src/app/modules/rag/services/rag_service.py`. + +## Назначение + +Блок обеспечивает управляемую индексацию файлов проекта в многослойный RAG-индекс. Он должен одинаково поддерживать полный snapshot и инкрементальные изменения, не допуская гонок внутри одной `rag_session_id`. + +## Контекст + +Индексация запускается через HTTP API модуля. `IndexingOrchestrator` отвечает за job lifecycle и progress events, а `RagService` за фактическую переработку файлов в документы. Для уменьшения стоимости embeddings используется cache по содержимому blob. + +## Технический use case + +### Основной сценарий + +1. API создаёт `IndexJob` и передаёт управление в `IndexingOrchestrator`. +2. `IndexingOrchestrator` фильтрует входной набор, ставит статус `running`, публикует стартовое событие и захватывает lock по `rag_session_id`. +3. `RagService` определяет `repo_id`, фильтрует индексируемые файлы, проверяет cache по `blob_sha` и либо переиспользует документы, либо заново строит docs/code слои. +4. Для новых документов `RagService` добавляет file metadata, запрашивает embeddings батчами и сохраняет документы через `RagRepository`. +5. `IndexingOrchestrator` обновляет job counters, публикует финальный `index_status` и `terminal`. + +### Альтернативные ветки + +- Для `changes` операции с `op=delete` только удаляют документы по `path`, без повторной сборки. +- Если файл не поддержан ни docs-, ни code-pipeline, сервис делает fallback в docs pipeline. +- При временном сбое индексации `RetryExecutor` повторяет операцию; после исчерпания попыток job получает `error`. + +## Функциональные требования + +### Preconditions +- `rag_session_id` уже существует либо создаётся до запуска indexing job. +- Файлы передаются в виде словарей, совместимых со схемами `FileSnapshot` или `ChangedFile`. +- Для cache reuse у файла должен быть `content_hash` или доступный `content`. + +### Processing rules +- Snapshot перед записью выполняет полную замену документов сессии через `replace_documents`. +- Incremental changes отделяет `delete_paths` от upsert-файлов и применяет изменения через `apply_document_changes`. +- `repo_id` выводится из `project_id` у сессии, а при отсутствии сессии fallback равен `rag_session_id`. +- Для поддерживаемого markdown строятся docs-слои `D1-D4`. +- Для поддерживаемого Python-кода строятся code-слои `C0-C4`. +- Каждый документ получает metadata файла: `blob_sha`, `repo_id`, `artifact_type`, `section`, `doc_id`, `owner`, `system_component`, `last_modified`, `staleness_score`. + +### Validation rules +- До индексации snapshot/changes проходят фильтрацию через `filter_snapshot_files` и `filter_changes_for_indexing`. +- Пустые или неподходящие файлы исключаются из обрабатываемого набора. +- Вектор сохраняется только если размерность embedding совпадает с размерностью поля `vector` при retrieval. + +### Output / result rules +- Результат операции всегда выражается четырьмя счётчиками: `indexed_files`, `failed_files`, `cache_hit_files`, `cache_miss_files`. +- Для snapshot весь набор документов сессии после операции должен соответствовать текущему переданному snapshot. +- Для changes в индексе должны остаться только документы по актуальному состоянию изменённых путей. + +### Side effects +- Удаление и вставка строк в `rag_chunks`. +- Запись `rag_session_chunk_map` для документов, имеющих `repo_id` и `blob_sha`. +- Сохранение cache в `rag_blob_cache` и `rag_chunk_cache`. +- Публикация SSE-событий прогресса и завершения задачи. + +## Ограничения и условия вызова + +- Одновременно может выполняться только одна indexing operation на `rag_session_id`. +- Code indexing работает только для Python файлов, распознаваемых `PythonFileFilter`. +- Docs indexing рассчитывает на markdown с возможным YAML frontmatter. +- Метод `replace_documents` делает жёсткую замену индекса сессии и не подходит для конкурентного merge разных snapshot-источников. + +## Нефункциональные требования + +### Security +- Модуль не валидирует источник файлов и не выполняет контентную санацию сверх собственных парсеров. + +### Observability +- Logs: фиксируются skipped files и режим обработки `cache` / `embed`. +- Metrics: отдельные счётчики не выделены, но статистика сохраняется в job. +- Traces: не реализованы. +- Audit: `rag_index_jobs` и `rag_session_chunk_map` образуют журнал выполнения и происхождения chunk. + +### Reliability +- `asyncio.Lock` сериализует операции в рамках одной сессии. +- `RetryExecutor` покрывает временные ошибки `TimeoutError`, `ConnectionError`, `OSError`. + +### Performance +- Embeddings обрабатываются батчами. +- Cache hit исключает повторный парсинг и повторный вызов embedder. + +## Связанные API / UI / integration points + +- `POST /api/rag/sessions` +- `POST /api/rag/sessions/{rag_session_id}/changes` +- `POST /internal/rag/index/snapshot` +- `POST /internal/rag/index/changes` + +## Связанные сущности + +- `RagSession` +- `IndexJob` +- `RagDocument` + +## Связанный код + +### Files +- `src/app/modules/rag/indexing_service.py` +- `src/app/modules/rag/services/rag_service.py` +- `src/app/modules/rag/indexing/docs/pipeline.py` +- `src/app/modules/rag/indexing/code/pipeline.py` +- `src/app/modules/rag/persistence/document_repository.py` + +### Symbols +- `IndexingOrchestrator.enqueue_snapshot` +- `IndexingOrchestrator.enqueue_changes` +- `IndexingOrchestrator._run_with_project_lock` +- `RagService.index_snapshot` +- `RagService.index_changes` +- `RagService._index_files` + +## Связанные документы + +- `arch-rag-package` +- `entity-rag-session` +- `entity-rag-index-job` +- `api-rag-session-create` +- `api-rag-session-changes` + +## История изменений + +| Date | Source | Changes | +|------|--------|---------| +| 2026-03-13 | code | Описана фактическая логика snapshot и incremental indexing пакета `rag`. | diff --git a/docs/documentation/rag/logic-retrieval-ranking.md b/docs/documentation/rag/logic-retrieval-ranking.md new file mode 100644 index 0000000..720b6dd --- /dev/null +++ b/docs/documentation/rag/logic-retrieval-ranking.md @@ -0,0 +1,150 @@ +--- +id: logic-rag-retrieval +title: Retrieval и ранжирование RAG-документов +doc_type: logic_block +domain: rag +status: draft +owner: system-analyst +source_of_truth: code +related_docs: + - arch-rag-package + - entity-rag-session +related_code: + - src/app/modules/rag/persistence/repository.py + - src/app/modules/rag/persistence/query_repository.py + - src/app/modules/rag/persistence/retrieval_statement_builder.py + - src/app/modules/rag/contracts/enums.py +entities: + - RagSession + - RagDocument +tags: + - rag + - retrieval + - ranking + - pgvector +--- +# Retrieval и ранжирование RAG-документов + +## Summary +- Purpose: вернуть релевантные RAG-документы из `rag_chunks` для заданной сессии и набора фильтров. +- Trigger: вызовы runtime adapters и внутренних retrieval-компонентов. +- Inputs: `rag_session_id`, `query_embedding`, `query_text`, `layers`, path filters, preference filters, limit. +- Outputs: список rows с `path`, `content`, `layer`, `title`, `metadata`, `span_start`, `span_end`, ranking fields. +- Main entities: `RagSession`, `RagDocument`. +- Main dependencies: `RagRepository`, `RagQueryRepository`, `RetrievalStatementBuilder`, PostgreSQL/pgvector. +- Side effects: отсутствуют, retrieval только читает БД. +- Source of truth: `src/app/modules/rag/persistence/query_repository.py`, `src/app/modules/rag/persistence/retrieval_statement_builder.py`. + +## Назначение + +Блок retrieval выбирает из индекса наиболее полезные документы по конкретному `rag_session_id`. Он объединяет в одном SQL векторную близость, lexical match, слой документа и структурные сигналы из metadata. + +## Контекст + +Публичный HTTP endpoint retrieval внутри `rag` помечен как deprecated, поэтому рабочий доступ к retrieval идёт через repository/runtime adapters. Это означает, что контракт фактически определяется SQL-builder и форматом rows, возвращаемых `RagQueryRepository`. + +## Технический use case + +### Основной сценарий + +1. Клиент runtime вызывает `RagRepository.retrieve(...)`. +2. `RagQueryRepository` строит SQL через `RetrievalStatementBuilder.build_retrieve`. +3. SQL ограничивает поиск текущей `rag_session_id`, при необходимости слоями и path-фильтрами. +4. База сортирует документы по `prefer_bonus`, `test_penalty`, `layer_rank`, `lexical_rank`, `structural_rank`, `distance`. +5. Репозиторий возвращает rows с распарсенным `metadata_json`. + +### Альтернативные ветки + +- Для lexical fallback по коду используется `retrieve_lexical_code`, который работает только по слою `C0_SOURCE_CHUNKS`. +- Для точного добора файлов используется `retrieve_exact_files`, который читает заданные `path` без векторного ранжирования. +- Если `query_text` не даёт terms, lexical retrieval возвращает пустой результат без выполнения SQL. + +## Функциональные требования + +### Preconditions +- В `rag_chunks` уже должны существовать документы нужной `rag_session_id`. +- Для vector retrieval embedding документа должен быть ненулевым и совпадать по размерности с query embedding. + +### Processing rules +- Базовый фильтр retrieval всегда включает `rag_session_id = :sid`. +- При наличии `layers` запрос ограничивается указанными слоями. +- `path_prefixes` задают include-фильтр по `LIKE prefix%`. +- `exclude_path_prefixes` и `exclude_like_patterns` исключают части дерева путей до сортировки. +- `prefer_path_prefixes` и `prefer_like_patterns` формируют `prefer_bonus`, поднимая приоритет совпавших путей. +- `prefer_non_tests` создаёт `test_penalty`, если путь попадает под test-паттерны. + +### Validation rules +- Path filters экранируются для корректной работы `LIKE`. +- `retrieve_exact_files` нормализует и отбрасывает пустые пути до построения SQL. +- `retrieve_lexical_code` не выполняет SQL, если query terms отсутствуют. + +### Output / result rules +- Каждый row содержит контент документа и технические поля ранжирования. +- `metadata_json` всегда декодируется в словарь `metadata`. +- Limit применяется на уровне SQL и ограничивает итоговый набор строк. + +### Side effects +- Побочных эффектов нет, кроме чтения из БД. + +## Ограничения и условия вызова + +- Retrieval работает только внутри одной `rag_session_id` и не агрегирует несколько сессий. +- Layer ranking зашит в код SQL-builder и требует явного обновления при появлении новых слоёв. +- Полноценный HTTP retrieval endpoint в модуле отсутствует: `/internal/rag/retrieve` возвращает `410 deprecated`. + +## Нефункциональные требования + +### Security +- Retrieval не выполняет маскирование содержимого документов. + +### Observability +- Logs: отдельное логирование запросов retrieval не реализовано. +- Metrics: метрики по latency и quality не выделены. +- Traces: отсутствуют. +- Audit: результат зависит только от состояния `rag_chunks` и входных фильтров. + +### Reliability +- Пустой или некорректный lexical search безопасно возвращает пустой набор. +- `retrieve_exact_files` работает без embeddings и может использоваться как fallback. + +### Performance +- Основной ranking выполняется в одном SQL-запросе. +- Для vector retrieval используются поля `embedding` и индексы по session/layer/path. + +## Связанные API / UI / integration points + +- Runtime retrieval adapters в `src/app/modules/agent/runtime/steps/retrieval/adapter.py` +- Explain retrieval gateway в `src/app/modules/agent/runtime/steps/explain/layered_gateway.py` +- Deprecated endpoint `POST /internal/rag/retrieve` + +## Связанные сущности + +- `RagSession` +- `RagDocument` + +## Связанный код + +### Files +- `src/app/modules/rag/persistence/repository.py` +- `src/app/modules/rag/persistence/query_repository.py` +- `src/app/modules/rag/persistence/retrieval_statement_builder.py` +- `src/app/modules/rag/contracts/enums.py` + +### Symbols +- `RagRepository.retrieve` +- `RagRepository.retrieve_lexical_code` +- `RagRepository.retrieve_exact_files` +- `RagQueryRepository.retrieve` +- `RetrievalStatementBuilder.build_retrieve` +- `RetrievalStatementBuilder.build_lexical_code` + +## Связанные документы + +- `arch-rag-package` +- `entity-rag-session` + +## История изменений + +| Date | Source | Changes | +|------|--------|---------| +| 2026-03-13 | code | Описан фактический retrieval contract и ranking SQL для пакета `rag`. | diff --git a/v1_plan.md b/docs/v1_plan.md similarity index 100% rename from v1_plan.md rename to docs/v1_plan.md diff --git a/info/CODE_QA_RUNTIME_SNAPSHOT.md b/info/CODE_QA_RUNTIME_SNAPSHOT.md new file mode 100644 index 0000000..03596f1 --- /dev/null +++ b/info/CODE_QA_RUNTIME_SNAPSHOT.md @@ -0,0 +1,190 @@ +# Снимок runtime-контура CODE_QA (answer layer) + +Документ фиксирует текущее состояние runtime-контура `CODE_QA` после рефакторинга для планирования доработок answer layer. Без предложений по новому дизайну и без implementation brief. + +--- + +## 1. Entry point + +- **HTTP:** `POST /api/chat/messages` → `ChatModule.public_router()` → `send_message()`. + Файл: `src/app/modules/chat/module.py`, строки 74–81. + +- **Условие:** при `SIMPLE_CODE_EXPLAIN_ONLY=true` запрос идёт в `CodeExplainChatService.handle_message()` (прямой explain без полного CODE_QA pipeline). При `false` — в оркестратор. + +- **Оркестратор:** `ChatOrchestrator.enqueue_message()` создаёт задачу и запускает `_process_task()` → в нём вызывается `self._runtime.run(...)`. + Файл: `src/app/modules/chat/service.py`, строки 47–69, 71–132. + +- **Runtime-адаптер:** `CodeQaRunnerAdapter` реализует `AgentRunner`; в `run()` вызывает `self._executor.execute(user_query=..., rag_session_id=..., files_map=...)` в thread pool. + Файл: `src/app/modules/agent/runtime/code_qa_runner_adapter.py`, строки 21–41. + +- **Фактическая точка входа CODE_QA:** `AgentRuntimeExecutor.execute()`. + Файл: `src/app/modules/agent/runtime/executor.py`, строка 53. + Создание executor: `application.py`, строка 48 — `_executor = AgentRuntimeExecutor(llm=..., retrieval=...)`. + +--- + +## 2. Runtime pipeline + +Цепочка внутри `AgentRuntimeExecutor.execute()` (файл `executor.py`): + +| Шаг | Файл | Класс/функция | Роль | +|-----|------|----------------|------| +| 1. Роутинг | `executor.py` | `self._router.route(user_query, ...)` | Intent + sub-intent, query_plan, retrieval_spec, symbol_resolution (pending). | +| 2. Сборка запроса retrieval | `retrieval_request_builder.py` | `build_retrieval_request(router_result, rag_session_id)` | Из `RouterResult` собирается `RetrievalRequest`: query, sub_intent, path_scope, requested_layers, retrieval_spec, constraints, query_plan. | +| 3. Retrieval | `executor.py` | `self._retrieve(state)` → `RuntimeRetrievalAdapter.retrieve_with_plan()` или `retrieve_exact_files()` для OPEN_FILE | По плану или по точным путям; возвращает `raw_rows` (list[dict]). | +| 4. Догидрация (только FIND_ENTRYPOINTS) | `executor.py` | `_hydrate_entrypoint_sources()` | Дозапрос C0 по путям из C3 entrypoints. | +| 5. Разрешение символа | `executor.py` | `_resolve_symbol(initial, raw_rows)` | По C1_SYMBOL_CATALOG: resolved / ambiguous / not_found; обновляет `state.router_result.symbol_resolution`. | +| 6. Retrieval result | `retrieval_result_builder.py` | `build_retrieval_result(raw_rows, report, symbol_resolution)` | Нормализованный `RetrievalResult`: code_chunks, relations, entrypoints, test_candidates, layer_outcomes и т.д. Для EXPLAIN при not_found/ambiguous — пересборка с пустыми rows (строки 90–91 executor). | +| 7. Evidence bundle | `evidence_bundle_builder.py` | `build_evidence_bundle(retrieval_result, router_result)` | `EvidenceBundle`: resolved_sub_intent, resolved_target, code_chunks, relations, entrypoints, test_evidence, retrieval_summary. sufficient/failure_reasons не выставляются здесь. | +| 8. Pre evidence gate | `evidence_gate.py` | `evaluate_evidence(state.evidence_pack)` | По sub_intent проверяет достаточность (target, evidence_count, слои, entrypoints, tests). Выставляет `bundle.sufficient`, возвращает `EvidenceGateDecision`; от этого — `state.answer_mode` (normal/degraded). | +| 9. Answer policy | `policy.py` | `self._answer_policy.decide(router_result, gate_decision)` | Решение: вызывать LLM или короткий ответ (OPEN_FILE not_found, EXPLAIN not_found/ambiguous, gate не прошёл). При `should_call_llm=False` сразу идём в `assemble_final_result` с `decision.answer`. | +| 10. Synthesis input | `answer_synthesis.py` | `build_answer_synthesis_input(user_query, state.evidence_pack)` | Строит `AnswerSynthesisInput`: fast_context, deep_context, evidence_summary, semantic_hints, curated_facts (из answer_fact_curator). | +| 11. Выбор промпта | `prompt_selector.py` | `self._prompt_selector.select(sub_intent=..., answer_mode=...)` | Имя системного промпта по sub_intent (и degraded). | +| 12. Payload | `prompt_payload_builder.py` | `self._payload_builder.build(user_query, synthesis_input, evidence_pack, answer_mode)` | JSON payload для LLM: user_query, resolved_scenario, fast/deep_context, evidence_summary, curated must_mention_*, layer_guide, entrypoints, scenario-specific поля. | +| 13. Генерация черновика | `generator.py` | `self._generator.generate(prompt_name, prompt_payload)` | Вызов `AgentLlmService.generate(prompt_name, payload)` → черновик ответа. | +| 14. Post evidence gate | `post_gate.py` | `self._post_gate.validate(answer, answer_mode, ..., sub_intent, user_query, evidence_pack)` | Проверка черновика по sub_intent (EXPLAIN/ARCHITECTURE/TRACE_FLOW/…), возврат `RuntimeValidationResult(passed, action, reasons)`. | +| 15. Repair (если не passed) | `repair.py` | `self._repair.repair(draft_answer, validation, prompt_payload)` | Один вызов LLM с промптом `code_qa_repair_answer`; повторная валидация; при повторном fail — fallback answer. | +| 16. Финальный результат | `result_assembler.py` | `assemble_final_result(state, draft=..., final_answer=..., ...)` | Сборка `RuntimeFinalResult` и диагностики. | + +Sub-intent для CODE_QA задаётся в роутере: `QueryPlanBuilder` использует `SubIntentDetector.detect()` и `_resolve_sub_intent()`; итог в `query_plan.sub_intent`. Ретривал-слои по sub_intent задаются в `RetrievalSpecFactory._with_sub_intent_layers()` (`retrieval_spec_factory.py`). + +--- + +## 3. Answer path + +- **Выбор промпта:** `RuntimePromptSelector.select(sub_intent, answer_mode)` — `src/app/modules/agent/runtime/steps/generation/prompt_selector.py`, строки 18–21. При answer_mode in `{"degraded","not_found","insufficient"}` возвращается `code_qa_degraded_answer`, иначе — по `sub_intent` из словаря (fallback `code_qa_explain_answer`). + +- **Сборка payload:** `RuntimePromptPayloadBuilder.build()` — `prompt_payload_builder.py`, строки 21–44. В payload попадают: `user_query`, `resolved_scenario`, `resolved_target`, `answer_mode`, `fast_context`, `deep_context`, `evidence_summary`, `semantic_hints`, `diagnostic_hints`, `retrieval_summary`, `confirmed_entrypoints`, `required_entrypoints`, `layer_guide`, плюс сценарий-специфичные поля из `_scenario_payload(synthesis_input)` (must_mention_*, fact_gaps и т.д.). + +- **Draft answer:** создаётся в `executor.py`, строки 242–246: `RuntimeDraftAnswer(prompt_name=..., prompt_payload=..., answer=self._generator.generate(...))`. + +- **Post-processing:** отдельного шага нет; после генерации сразу идёт post-validation. + +- **Repair:** `RuntimeAnswerRepairService.repair()` — `repair.py`, строки 16–37. Формирует JSON с draft_answer, validation_reasons, repair_focus, prompt_payload и один раз вызывает LLM с `code_qa_repair_answer`. + +- **Final text:** в executor: при passed — `final_answer = draft.answer` (или результат repair); при не passed после repair — `_fallback_answer(state)`. Итоговая строка попадает в `RuntimeFinalResult.final_answer` в `assemble_final_result()`. + +--- + +## 4. Prompt selection + +- **Где:** `src/app/modules/agent/runtime/steps/generation/prompt_selector.py`, класс `RuntimePromptSelector`, метод `select(sub_intent, answer_mode)`. + +- **Правила:** + - answer_mode in `{"degraded","not_found","insufficient"}` → `code_qa_degraded_answer`. + - Иначе по `sub_intent.upper()` из `_PROMPTS`; при отсутствии ключа — `code_qa_explain_answer`. + +- **Используемые имена промптов для целевых sub_intent:** + +| sub_intent | prompt name | +|-------------|--------------------------------| +| EXPLAIN | `code_qa_explain_answer` | +| EXPLAIN_LOCAL| `code_qa_explain_local_answer` | +| ARCHITECTURE| `code_qa_architecture_answer` | +| TRACE_FLOW | `code_qa_trace_flow_answer` | + +- **Шаблоны:** загружаются по имени из YAML в `AgentLlmService.generate()` → `PromptLoader.load(name)`; конфиг — `src/app/modules/agent/llm/prompts.yml`. Ключи в YAML совпадают с именами выше (в т.ч. `code_qa_explain_answer`, `code_qa_architecture_answer`, `code_qa_trace_flow_answer`); repair — `code_qa_repair_answer`. + +- **Выбор по sub_intent:** да, только через `RuntimePromptSelector.select(sub_intent=state.retrieval_request.sub_intent, ...)` в executor, строка 231. + +--- + +## 5. Evidence-to-answer boundary + +- **В answer layer evidence приходит как:** + - `EvidenceBundle` (в state.evidence_pack) и + - `AnswerSynthesisInput` (state.synthesis_input), собранный из bundle в `build_answer_synthesis_input()`. + +- **Модели/DTO:** + - `EvidenceBundle`: `contracts.py`, 90–106 — resolved_intent, resolved_sub_intent, resolved_target, target_type, code_chunks, relations, entrypoints, test_evidence, evidence_count, retrieval_summary. + - `AnswerSynthesisInput`: `contracts.py`, 109–121 — user_question, resolved_scenario, resolved_target, fast_context, deep_context, evidence_summary, semantic_hints, **curated_facts**, evidence_sufficient, diagnostic_hints. + - Curated facts строит `answer_fact_curator.build_curated_answer_facts(bundle)` — словарь с ключами `explain`, `architecture`, `trace_flow` и общими полями (scenario, semantic_hints, relation_count и т.д.). + +- **Что реально уходит в payload (prompt_payload_builder):** + - Общее: user_query, resolved_scenario, resolved_target, answer_mode, fast_context, deep_context, evidence_summary, semantic_hints, diagnostic_hints, retrieval_summary, confirmed_entrypoints, required_entrypoints, layer_guide. + - EXPLAIN: must_mention_methods/fields/calls/dependencies/constructor_args/files, must_not_infer_missing_details, fact_gaps (из curated_facts["explain"]). + - ARCHITECTURE: must_mention_components/relations, must_use_relation_verbs, must_avoid_semantic_labels_as_primary_claims, must_not_use_retrieval_labels, fact_gaps (из curated_facts["architecture"]). + - TRACE_FLOW: must_mention_flow_steps/calls/sequence_edges, must_avoid_overclaiming_full_flow, fact_gaps (из curated_facts["trace_flow"]). + +- **Curated-поля (answer_fact_curator):** + - explain: required_methods, required_calls, required_fields, required_dependencies, required_constructor_args, required_files, fact_gaps (и др.). + - architecture: required_components, required_relations (source/verb/target/edge_type), required_relation_verbs, required_*_edges, forbidden_labels, fact_gaps. + - trace_flow: required_flow_steps (step, source, verb, target, path, line_span), required_calls, required_sequence_edges, fact_gaps. + +То есть в LLM попадает не сырой retrieval, а нормализованный контекст (fast/deep_context, evidence_summary) плюс явные списки «must_mention_*» и fact_gaps по сценарию; для methods/dependencies/relations/flow steps уже есть выделенные curated-поля. + +--- + +## 6. Post-validation / answer quality control + +- **Post-evidence gate (runtime):** есть. `RuntimePostEvidenceGate.validate()` — `src/app/modules/agent/runtime/steps/gates/post/post_gate.py`, строки 39–65. Вызывается после генерации черновика (и после repair — повторно). + +- **Answer validator:** это тот же post_gate: проверяет пустой ответ, соответствие answer_mode (degraded/not_found/ambiguous) требуемым формулировкам, длину при degraded, затем для normal — `_normal_answer_reasons()` по sub_intent. + +- **Repair loop:** один раунд. При `not validation.passed` и наличии `self._repair` вызывается `repair()`; затем повторный `validate()`; если снова не passed — подставляется `_fallback_answer()` и смена answer_mode (`executor.py`, 281–298). + +- **Правила по sub_intent (post_gate):** + - **EXPLAIN** (93–124): target focus; vagueness (_VAGUE_PHRASES); наличие required_methods/calls/dependencies (хотя бы одна группа); «too_vague_for_explain» при нуле совпадений; semantic_leakage (роли из semantic_hints без опоры на код). + - **ARCHITECTURE** (126–150): target focus; vagueness; required_components, required_relations, relation_verbs; forbidden_labels (retrieval artifacts); methods_as_primary_components; «too_vague_for_architecture»; semantic_leakage. + - **TRACE_FLOW** (152–171): target focus; vagueness; required_flow_steps и required_calls; _mentions_steps (сначала/затем или нумерация); overclaims (_OPTIMISTIC_TRACE_CLAIMS); «too_vague_for_trace_flow». + +- **Technical precision для EXPLAIN:** проверяется косвенно: упоминание методов/вызовов/зависимостей из curated; явной проверки «только факты из кода» по токенам нет. +- **Concrete relations для ARCHITECTURE:** да — `_mentions_relations(answer, relations)` и упоминание verbs. +- **Concrete steps и overclaim для TRACE_FLOW:** да — `_mentions_steps`, `_mentions_relations` по steps, и проверка фраз из _OPTIMISTIC_TRACE_CLAIMS. + +--- + +## 7. Problem sources (что может давать слабые ответы) + +- **Payload shaping:** `prompt_payload_builder.py` — если curated_facts пустые или скудные (мало methods/calls/relations/steps), must_mention_* не направляют модель; deep_context обрезается до 30 чанков по 800 символов — возможна потеря важных деталей. + +- **Prompts:** `prompts.yml` — длинные общие инструкции; для EXPLAIN/ARCHITECTURE/TRACE_FLOW нет жёсткой привязки к структуре payload (например, «обязательно используй must_mention_flow_steps по порядку»); модель может игнорировать fact_gaps. + +- **Evidence normalization:** `answer_fact_curator` — методы/вызовы/relations извлекаются эвристически (regex, C1/C2); при слабом C1/C2 или нестандартных именах curated-списки пустеют → валидатор не к чему привязываться, ответ считается «vague». + +- **Weak validation:** `post_gate` — проверки по вхождению подстрок (alias) и по небольшому набору фраз; нет проверки полноты (все ли must_mention_* упомянуты), нет проверки порядка шагов для TRACE_FLOW; semantic_leakage выключается при has_concrete_support, что может пропускать смешанные ответы. + +- **Repair policy:** один вызов repair с общим промптом `code_qa_repair_answer` и repair_focus по reasons; при множественных reasons фокус может размываться; после repair при повторном fail сразу fallback — без второго раунда repair. + +--- + +## 8. Minimal intervention points + +1. **`src/app/modules/agent/runtime/steps/generation/prompt_payload_builder.py`** + Класс `RuntimePromptPayloadBuilder`, метод `build()` и `_scenario_payload()`. + Контролирует: какие поля и списки (must_mention_*, fact_gaps, layer_guide) попадают в JSON для LLM. + Удобно: один вход в «что видит модель»; можно усилить структуру под EXPLAIN/ARCHITECTURE/TRACE_FLOW без трогания оркестрации. + +2. **`src/app/modules/agent/runtime/steps/context/answer_fact_curator.py`** + Функции `_explain_facts()`, `_architecture_facts()`, `_trace_flow_facts()`. + Контролируют: состав и качество curated_facts (required_*, fact_gaps). + Удобно: улучшение извлечения методов/relations/steps напрямую улучшает и payload, и валидацию. + +3. **`src/app/modules/agent/runtime/steps/gates/post/post_gate.py`** + Класс `RuntimePostEvidenceGate`, методы `_validate_explain()`, `_validate_architecture()`, `_validate_trace_flow()` и хелперы (`_mentions_fact_group`, `_mentions_relations`, `_mentions_steps`). + Контролирует: критерии прохождения и набор reasons для repair. + Удобно: уже разбито по сценариям; можно ужесточить правила и добавить новые reasons без смены архитектуры. + +4. **`src/app/modules/agent/llm/prompts.yml`** + Блоки `code_qa_explain_answer`, `code_qa_architecture_answer`, `code_qa_trace_flow_answer`, `code_qa_repair_answer`. + Контролируют: инструкции для черновика и починки. + Удобно: точечные правки формулировок и явные отсылки к полям payload (must_mention_*, fact_gaps). + +5. **`src/app/modules/agent/runtime/steps/generation/prompt_selector.py`** + Класс `RuntimePromptSelector`, словарь `_PROMPTS` и метод `select()`. + Контролирует: какой системный промпт выбирается по sub_intent/answer_mode. + Удобно: введение отдельных промптов для подвидов (например, TRACE_FLOW по типу запроса) без изменения executor. + +6. **`src/app/modules/agent/runtime/steps/context/answer_synthesis.py`** + Функция `build_answer_synthesis_input()`, формирование `fast_context` и `deep_context` (в т.ч. фильтр по C4 для EXPLAIN/ARCHITECTURE). + Контролирует: объём и приоритет контекста, передаваемого в synthesis_input. + Удобно: можно менять лимиты, порядок чанков или фильтры слоёв локально. + +7. **`src/app/modules/agent/runtime/steps/finalization/repair.py`** + Класс `RuntimeAnswerRepairService`, метод `repair()` и `_repair_focus()`. + Контролирует: как validation.reasons мапятся в repair_focus и что уходит в промпт починки. + Удобно: можно сузить фокус repair под конкретные reasons или добавить приоритизацию без изменения цикла в executor. + +--- + +*Документ описывает только текущую реализацию по коду после рефакторинга.* diff --git a/README.DB.STORY_PLAN.md b/info/README.DB.STORY_PLAN.md similarity index 100% rename from README.DB.STORY_PLAN.md rename to info/README.DB.STORY_PLAN.md diff --git a/README_old.md b/info/README_old.md similarity index 100% rename from README_old.md rename to info/README_old.md diff --git a/info/agent_rules_1.md b/info/agent_rules_1.md new file mode 100644 index 0000000..d94f890 --- /dev/null +++ b/info/agent_rules_1.md @@ -0,0 +1,33 @@ +# Agent Rules v1 + +## 1. Evidence-first + +Агент должен формировать документацию только на основе подтвержденных источников: кода, существующей документации, системной аналитики и других явно доступных артефактов. Нельзя додумывать поведение системы, зависимости или бизнес-логику, если они не подтверждаются исходными материалами. + +## 2. One Stable Object = One Document + +Каждый документ должен описывать только одну устойчивую техническую сущность или один устойчивый аспект системы. Если по сущности могут ссылаться другие документы или она может переиспользоваться, ее нужно выносить в отдельный документ. + +## 3. No Semantic Duplication + +Документы не должны пересекаться по смыслу и повторять одно и то же содержание. Если одна и та же логика, правило или описание нужны в нескольких местах, агент должен вынести их в отдельный документ и использовать ссылки вместо дублирования текста. + +## 4. Explicit Document Type + +Для каждого документа агент должен явно определять его тип. На базовом уровне нужно использовать типы `ui_page`, `api_method`, `logic_block` и применять для каждого типа свой шаблон содержания и набор метаданных. + +## 5. Hierarchical File Structure + +Агент должен строить документацию как иерархию каталогов и файлов, а не как плоский набор страниц. Документы нужно раскладывать по смысловым разделам, например `docs/ui`, `docs/api`, `docs/logic`, `docs/architecture`, чтобы структура отражала архитектуру и упрощала навигацию. + +## 6. Required YAML Frontmatter + +Каждый документ должен начинаться с единообразного `YAML frontmatter`. В нем обязательно должны быть базовые метаданные документа: стабильный `id`, `title`, `doc_type`, `status`, `source_of_truth`, а также ссылки на связанные документы и кодовые артефакты. + +## 7. Correct Internal Decomposition + +Содержимое документа должно следовать шаблону своего типа и быть правильно декомпозировано внутри самого документа. Сценарии работы нужно описывать отдельно от детальных правил, контрактов, ограничений и дополнительных требований, чтобы документ оставался читаемым, атомарным и пригодным для индексирования. + +## 8. Explicit Links Between Code and Docs + +Каждый документ должен быть явно связан как минимум с соответствующим кодом и с соседними документами, если такие связи существуют. Агент должен фиксировать эти связи в метаданных и в тексте документа, чтобы документация образовывала связанную систему знаний, а не набор изолированных файлов. diff --git a/architecture_as_is.md b/info/architecture_as_is.md similarity index 100% rename from architecture_as_is.md rename to info/architecture_as_is.md diff --git a/info/documentation_concept.md b/info/documentation_concept.md new file mode 100644 index 0000000..0e3b4b3 --- /dev/null +++ b/info/documentation_concept.md @@ -0,0 +1,323 @@ +# Концепция документации (Strong MVP, без связи с кодом) + +## 1. Область применения +Документ описывает систему работы с документацией как самостоятельный слой. + +Включает: +- текущее состояние (as-is) +- целевые сценарии использования +- целевую модель документации +- расширенный frontmatter +- базовую структуру документа `frontmatter + Summary + Details` +- RAG-слои (без связи с кодом) + +--- + +# 2. Текущее состояние (As-Is) + +## 2.1 Источник истины +- Документация хранится в Confluence +- Основная модель — иерархия страниц +- Навигация через дерево страниц + +## 2.2 Структура и связи +- Документы не атомарны +- Одна страница содержит несколько тем +- Используются перекрестные ссылки между страницами + +## 2.3 Ограничения +- Нет типизации документов +- Нет структурированного metadata-слоя +- Связи не формализованы + +--- + +# 3. Целевые сценарии использования + +## 3.1 Поиск документации + +Пользователь формулирует запрос, например: "как работает создание заказа". + +Система должна: +- найти релевантные документы +- отобрать наиболее точные фрагменты +- учитывать тип документа, модуль и сущности + +Результат: +- короткий список релевантных документов +- возможность перейти в детали + +## 3.2 Объяснение (Explain) + +Пользователь хочет понять: +- как работает компонент +- что делает API +- как устроен процесс + +Система должна: +- взять summary документа +- дополнить его деталями из Details +- дать краткое и точное объяснение без лишнего текста + +## 3.3 Поиск по сущности (Entity Lookup) + +Пользователь ищет: +- где используется сущность +- какие документы с ней связаны + +Система должна: +- найти все документы, где упоминается сущность +- показать связи между ними + +## 3.4 Навигация по документации + +Пользователь начинает с одного документа и хочет: +- понять контекст +- перейти к связанным частям + +Система должна: +- использовать parent/children +- использовать links +- строить осмысленный путь по документации + +## 3.5 Генерация документации + +Система создает новый документ: +- по шаблону +- с корректным frontmatter +- с заполненными разделами `Summary` и `Details` + +Результат: +- документ сразу пригоден для использования +- соответствует структуре системы + +## 3.6 Актуализация документации + +При изменениях документа: +- система должна обновить только нужные части +- сохранить структуру +- обновить frontmatter и Details + +Результат: +- документ остается консистентным +- не происходит деградации структуры + +## 3.7 Связывание документации + +При создании или обновлении: +- система добавляет связи между документами +- формирует граф знаний + +Результат: +- документы не изолированы +- появляется навигация и reasoning + +--- + +# 4. Frontmatter (расширенный контракт) + +```yaml +id: api.create_order +type: api_method +name: create_order +title: Create order API + +module: orders +layer: application + +status: draft +updated_at: 2026-03-20 + +tags: + - orders + - api + +entities: + - Order + - Cart + +parent: orders_api +children: [] + +links: + - type: related_api + target: api.get_order +``` + +## Назначение ключевых полей + +- `id` — стабильный идентификатор документа +- `type` — тип документа +- `title` — человекочитаемое имя +- `module` — модуль или bounded context +- `layer` — слой системы +- `status` — состояние документа +- `updated_at` — дата последнего обновления +- `tags` — фильтрация и поиск +- `entities` — база для entity lookup +- `parent` / `children` — иерархия +- `links` — граф связей + +Все сведения о связях, сущностях и навигации должны храниться во frontmatter. +В теле документа отдельные разделы для связей, сущностей и навигации не создаются. + +--- + +# 5. Структура документа (целевая) + +Каждый документ состоит из двух смысловых слоев: +- frontmatter +- контент + +Контент документа всегда состоит из двух обязательных разделов: +- `# Summary` +- `# Details` + +## 5.1 Общие правила структуры + +- `Summary` и `Details` всегда имеют заголовок уровня `#` +- других заголовков первого уровня в документе быть не должно +- `Summary` остается кратким и пригодным для explain +- `Details` заменяет прежние разделы `Context` и `Основное описание` +- внутренняя структура `Details` зависит от типа документа + +## 5.2 Summary + +Краткое описание на 3-6 строк. +Используется для explain, краткого ответа и быстрого понимания сути документа. + +## 5.3 Details + +Раздел содержит полное содержательное описание документа. +Состав подразделов определяется типом документа. + +--- + +# 6. Типовая структура Details для API + +Для документов типа `api_method` раздел `# Details` должен содержать следующие подразделы: + +- `## Описание` +- `## Сценарий` +- `## Функциональные требования` +- `## Нефункциональные требования` +- `## Контракт` + +## 6.1 Описание + +Короткое описание сути метода: +- какую работу он выполняет +- для чего предназначен + +## 6.2 Сценарий + +Сценарий описывается в формате технического use case и включает: +- название +- предусловия +- триггер +- основной сценарий +- альтернативный сценарий +- обработку ошибок +- постусловие + +Правила для сценария: +- сценарий должен быть лаконичным +- сценарий должен быть читаемым человеком +- в сценарии фиксируется суть шага, а не полная техническая реализация +- если условие можно выразить одним предложением, его допустимо оставить в сценарии +- если шаг требует детального описания формирования запроса, обработки ответа или внутренней логики, детали выносятся в функциональные требования + +## 6.3 Функциональные требования + +Функциональные требования описываются как последовательность требований внутри одного документа. + +Формат: +- `FR-1` +- `FR-2` +- `FR-3` + +Правила: +- идентификаторы локальны для документа +- на них нельзя ссылаться извне как на сквозные идентификаторы +- каждое требование описывает отдельный обязательный аспект реализации + +## 6.4 Нефункциональные требования + +Нефункциональные требования описываются аналогично функциональным. + +Формат: +- `NFR-1` +- `NFR-2` +- `NFR-3` + +Детальный формат записи может быть уточнен правилами конкретного проекта. + +## 6.5 Контракт + +Контракт должен быть пригоден для последующей сборки OpenAPI-спецификации. + +Контракт описывает: +- входные параметры метода API +- выходные параметры +- структуру сообщения, как правило JSON +- обязательность полей +- типы полей +- ограничения на размер и формат +- назначение полей +- правила заполнения полей +- примеры данных + +--- + +# 7. Базовая структура Details для остальных типов документов + +Для всех типов документов, кроме `api_method`, на текущем этапе обязателен минимум: +- `# Summary` +- `# Details` + +Дополнительные рекомендации по внутренней структуре `Details` для `logic_block`, `architecture_overview`, `domain_entity` и других типов будут заданы отдельно. + +--- + +# 8. RAG слои (только документация) + +## D0 — Чанки документов +Полный текст + разбиение. + +## D1 — Каталог документов +- `id` +- `type` +- `title` +- `module` +- `tags` + +## D2 — Индекс фактов +Факты, извлеченные из документов. + +## D3 — Каталог сущностей +- сущности +- документы, где они используются + +## D4 — Индекс сценариев (Workflow) +- последовательности действий +- пользовательские сценарии + +## D5 — Граф связей +- связи между документами + +--- + +# 9. Итог + +Система документации: +- атомарные документы +- строгий frontmatter +- единая структура `Summary + Details` +- типовые правила для API-документов +- разделенные RAG-слои + +Это позволяет: +- точно искать +- объяснять +- строить навигацию +- генерировать и обновлять документацию diff --git a/iteration2_calibration_harness_report.md b/info/iteration2_calibration_harness_report.md similarity index 100% rename from iteration2_calibration_harness_report.md rename to info/iteration2_calibration_harness_report.md diff --git a/info/pipeline_setup_v3_architecture_for_chatgpt.md b/info/pipeline_setup_v3_architecture_for_chatgpt.md new file mode 100644 index 0000000..2624768 --- /dev/null +++ b/info/pipeline_setup_v3_architecture_for_chatgpt.md @@ -0,0 +1,546 @@ +# Текущая архитектура тестового пайплайна `pipeline_setup_v3` + +Документ предназначен как краткое, но точное описание текущего устройства `pipeline_setup_v3` для внешней модели вроде ChatGPT. + +Важно: текущий `pipeline_setup_v3` уже использует реальные runtime-компоненты агента, но по сути остается в первую очередь `code-first` пайплайном. Это особенно заметно в `evidence gate` и в наборе prompt'ов для LLM. + +## 1. Общая схема пайплайна + +`pipeline_setup_v3` запускает один из трех режимов: + +- `router_only` +- `router_rag` +- `full_chain` + +Во всех режимах используется `AgentRuntimeAdapter`, который является тестовым адаптером поверх реальных компонентов рантайма. + +Общий поток для `full_chain`: + +1. Пользовательский запрос +2. `IntentRouterV2` +3. Построение `RetrievalRequest` +4. `RuntimeRetrievalAdapter` +5. Построение нормализованного `RetrievalResult` +6. Сборка `EvidenceBundle` +7. `pre-evidence gate` +8. `RuntimeAnswerPolicy` +9. Вызов LLM через `AgentLlmService` +10. `post-evidence gate` +11. При необходимости `repair` +12. Сборка итогового результата, диагностики и артефактов теста + +Ключевая идея: `pipeline_setup_v3` не эмулирует локальный тестовый сценарий вручную, а прогоняет реальные компоненты: роутер, retrieval, runtime executor и LLM. + +## 2. Из каких компонентов состоит `pipeline_setup_v3` + +### 2.1. Harness уровня тестов + +Основные части: + +- `tests/pipeline_setup_v3/run.py` — CLI-вход для запуска набора кейсов +- `tests/pipeline_setup_v3/core/runner.py` — оркестратор прогона кейсов +- `tests/pipeline_setup_v3/core/case_loader.py` — загрузка YAML-кейсов +- `tests/pipeline_setup_v3/core/validators.py` — проверка ожиданий +- `tests/pipeline_setup_v3/core/artifacts.py` — запись JSON/Markdown-результатов +- `tests/pipeline_setup_v3/runtime/agent_runtime_adapter.py` — мост к runtime-компонентам приложения + +### 2.2. Runtime-компоненты, которые реально вызываются + +- `IntentRouterV2` +- `RuntimeRepoContextFactory` +- `RuntimeRetrievalAdapter` +- `AgentRuntimeExecutor` +- `AgentLlmService` +- `PromptLoader` + +### 2.3. Два варианта исполнения + +#### `router_only` + +Проверяет только результат роутера: + +- `intent` +- `sub_intent` +- `graph_id` +- `conversation_mode` + +RAG и LLM не вызываются. + +#### `router_rag` + +Проверяет: + +- роутер +- retrieval plan +- реальный retrieval +- нормализованный `RetrievalResult` + +LLM не вызывается. + +#### `full_chain` + +Проверяет полный runtime-контур: + +- роутер +- retrieval +- evidence bundle +- pre-gate +- answer policy +- LLM +- post-gate +- repair +- итоговый answer/diagnostics + +## 3. Компонент: Intent Router + +### 3.1. Что это такое + +`IntentRouterV2` классифицирует запрос и возвращает структурированный план для retrieval и дальнейшего рантайма. + +Он не просто выбирает `intent`, а сразу строит: + +- `conversation_mode` +- `query_plan` +- `retrieval_spec` +- `retrieval_constraints` +- `symbol_resolution` +- `evidence_policy` +- `graph_id` + +### 3.2. Какие интенты есть сейчас + +Сейчас в коде поддерживаются: + +- `CODE_QA` +- `DOCUMENTATION_EXPLAIN` +- `GENERATE_DOCS_FROM_CODE` +- `FALLBACK` + +### 3.3. Какие саб-интенты есть сейчас + +#### Для `CODE_QA` + +- `OPEN_FILE` +- `EXPLAIN` +- `EXPLAIN_LOCAL` +- `FIND_TESTS` +- `FIND_ENTRYPOINTS` +- `TRACE_FLOW` +- `ARCHITECTURE` +- `NEXT_STEPS` может появляться как follow-up режим на уровне query planning + +#### Для `DOCUMENTATION_EXPLAIN` + +- `SYSTEM_FLOW_EXPLAIN` +- `COMPONENT_EXPLAIN` +- `API_METHOD_EXPLAIN` +- `ENTITY_EXPLAIN` + +#### Для `FALLBACK` + +- `GENERIC_FALLBACK` + +### 3.4. Что роутер возвращает на выходе + +Результат роутера — это `IntentRouterResult`. + +Ключевые поля: + +- `intent` +- `retrieval_profile` +- `graph_id` +- `conversation_mode` +- `query_plan` +- `retrieval_spec` +- `retrieval_constraints` +- `symbol_resolution` +- `evidence_policy` + +### 3.5. Что входит в `query_plan` + +`query_plan` содержит: + +- `raw` +- `normalized` +- `sub_intent` +- `negations` +- `expansions` +- `keyword_hints` +- `path_hints` +- `doc_scope_hints` +- `symbol_candidates` +- `symbol_kind_hint` +- `anchors` + +Это основной bridge между классификацией запроса и retrieval. + +### 3.6. Что входит в `retrieval_spec` + +`retrieval_spec` содержит: + +- `domains` +- `layer_queries` +- `filters` +- `rerank_profile` + +Именно этот объект задает, какие слои RAG должны быть запрошены. + +### 3.7. Что важно про текущее состояние + +Текущий роутер уже умеет выделять docs-интенты и docs-сабинтенты, но downstream runtime ниже по пайплайну все еще во многом оптимизирован под `CODE_QA`. + +Это означает: + +- docs routing уже есть +- docs layer selection уже есть +- но `pre/post evidence gate` и prompt selection пока ориентированы в первую очередь на code sub-intents + +## 4. Структура RAG + +### 4.1. Общая идея + +RAG устроен как многослойный индекс. Retrieval работает не по одному единственному типу чанков, а по наборам специализированных слоев. + +### 4.2. Code-слои + +- `C0_SOURCE_CHUNKS` — сырой код / чанки исходников +- `C1_SYMBOL_CATALOG` — каталог символов +- `C2_DEPENDENCY_GRAPH` — зависимости и связи +- `C3_ENTRYPOINTS` — точки входа, маршруты, handler'ы +- `C4_SEMANTIC_ROLES` — семантические роли и behavioral hints + +### 4.3. Docs-слои + +- `D0_DOC_CHUNKS` — чанки документов +- `D1_DOCUMENT_CATALOG` — каталог документов +- `D2_FACT_INDEX` — атомарные факты +- `D3_ENTITY_CATALOG` — сущности +- `D4_WORKFLOW_INDEX` — сценарии и workflow +- `D5_RELATION_GRAPH` — связи между документами + +### 4.4. Как retrieval связывается с роутером + +Роутер возвращает: + +- `domains` +- `layer_queries` +- `filters` +- `retrieval_constraints` + +Дальше `build_retrieval_request(...)` превращает это в `RetrievalRequest`, который содержит: + +- `rag_session_id` +- `query` +- `sub_intent` +- `path_scope` +- `keyword_hints` +- `symbol_candidates` +- `requested_layers` +- `retrieval_spec` +- `retrieval_constraints` +- `query_plan` + +### 4.5. Что возвращает retrieval + +Сырые строки RAG затем нормализуются в `RetrievalResult`, который содержит: + +- `target_symbol_candidates` +- `resolved_symbol` +- `symbol_resolution_status` +- `file_candidates` +- `code_chunks` +- `relations` +- `semantic_hints` +- `entrypoints` +- `test_candidates` +- `layer_outcomes` +- `missing_layers` +- `raw_rows` +- `retrieval_report` + +### 4.6. Как из retrieval строится evidence + +`build_evidence_bundle(...)` собирает `EvidenceBundle`. + +Ключевые поля: + +- `resolved_intent` +- `resolved_sub_intent` +- `resolved_target` +- `target_type` +- `target_symbol_candidates` +- `file_candidates` +- `code_chunks` +- `relations` +- `entrypoints` +- `test_evidence` +- `evidence_count` +- `sufficient` +- `failure_reasons` +- `retrieval_summary` + +Важно: `evidence_count` сейчас считается по количеству `code_chunks`. Это еще одно подтверждение, что runtime сегодня code-first. + +## 5. Evidence Gate + +В пайплайне есть два gate'а. + +## 5.1. Pre-evidence gate + +Расположение: + +- `src/app/modules/agent/runtime/steps/gates/pre/evidence_gate.py` + +Когда срабатывает: + +- после retrieval +- после сборки `EvidenceBundle` +- до вызова LLM + +Задача: + +- понять, достаточно ли evidence для уверенного ответа +- выдать `passed/failure_reasons/degraded_message` + +Как работает сейчас: + +- для `OPEN_FILE` требует найденный path/file и хотя бы один `C0` chunk +- для `EXPLAIN` требует target symbol и минимум 2 evidence chunk'а +- для `FIND_TESTS` требует target и хотя бы один test candidate +- для `FIND_ENTRYPOINTS` требует хотя бы один entrypoint +- для остальных сценариев требует минимум 1 evidence + +Что возвращает: + +- `passed` +- `failure_reasons` +- `degraded_message` + +Ограничение: + +- логика pre-gate пока написана в терминах code sub-intents +- docs-сценарии там явно не моделированы + +## 5.2. Post-evidence gate + +Расположение: + +- `src/app/modules/agent/runtime/steps/gates/post/post_gate.py` + +Когда срабатывает: + +- после генерации draft answer +- до возврата финального ответа + +Задача: + +- проверить groundedness черновика +- убедиться, что ответ действительно опирается на evidence +- решить, нужен ли `repair` + +Что проверяет: + +- что ответ не пустой +- что degraded/not_found/ambiguous-ответы содержат обязательные guardrail-фразы +- что normal answer не слишком общий +- что упоминаются обязательные факты из curated evidence +- что нет явной semantic leakage или contradictions + +Отдельные проверки есть для: + +- `FIND_ENTRYPOINTS` +- `EXPLAIN` +- `ARCHITECTURE` +- `TRACE_FLOW` + +Если gate не проходит, он возвращает: + +- `passed=False` +- `action="repair"` +- список `reasons` + +После этого runtime может сделать дополнительный шаг `repair` через LLM. + +Ограничение: + +- post-gate тоже пока ориентирован на code-oriented sub-intents +- docs-сабинтенты для него еще не описаны отдельными правилами + +## 6. Обращение к LLM + +### 6.1. Где вызывается LLM + +В `pipeline_setup_v3` есть два места использования LLM: + +1. В классификации интента внутри `IntentClassifierV2` +2. В финальной генерации ответа внутри `AgentRuntimeExecutor` + +### 6.2. Prompt для классификации интента + +Используется prompt: + +- `rag_intent_router_v2` + +Назначение: + +- если deterministic rules не дали результата, LLM выбирает интент + +Текущий prompt исторически описывает старые имена интентов, поэтому его еще нужно синхронизировать с новым docs/fallback контрактом. + +### 6.3. Prompt'ы для генерации ответа + +Prompt selector сейчас выбирает: + +- `code_qa_architecture_answer` +- `code_qa_explain_answer` +- `code_qa_explain_local_answer` +- `code_qa_find_entrypoints_answer` +- `code_qa_find_tests_answer` +- `code_qa_general_answer` +- `code_qa_open_file_answer` +- `code_qa_trace_flow_answer` +- `code_qa_degraded_answer` + +Дополнительно для repair используется: + +- `code_qa_repair_answer` + +### 6.4. Как строится payload для LLM + +Перед вызовом LLM runtime собирает: + +- `AnswerSynthesisInput` +- `EvidenceBundle` +- `prompt_payload` + +В payload передаются: + +- `user_question` +- `resolved_target` +- `answer_mode` +- `evidence_summary` +- `retrieval_summary` +- curated facts +- обязательные для упоминания сущности, методы, связи, шаги и т.д. + +То есть LLM не получает просто "вопрос и куски текста", а получает уже структурированный grounded payload. + +### 6.5. Что важно про текущее состояние prompt'ов + +Сейчас runtime prompt selection и prompt contracts явно заточены под code QA. + +Это значит: + +- для `CODE_QA` full chain оформлен хорошо +- для `DOCUMENTATION_EXPLAIN` routing и retrieval есть, но отдельного docs answer-prompt слоя пока нет +- для docs full-chain пока не хватает собственных prompt names, prompt payload contract и post-gate правил + +## 7. Что именно сейчас проверяет `pipeline_setup_v3` + +YAML-кейс может проверять четыре группы ожиданий: + +- `router` +- `retrieval` +- `llm` +- `pipeline` + +Примеры ожиданий: + +- ожидаемый `intent` +- ожидаемый `sub_intent` +- нужные слои в `layers_include` +- что retrieval не пустой +- что в answer есть нужные фразы +- какой `answer_mode` получился + +## 8. Ключевые выводы о текущей архитектуре + +### 8.1. Что уже сделано хорошо + +- `pipeline_setup_v3` работает поверх реальных runtime-компонентов +- есть явный контракт между router → retrieval → evidence → answer +- есть два evidence gate +- есть structured diagnostics +- есть нормализованные типы `RetrievalRequest`, `RetrievalResult`, `EvidenceBundle` + +### 8.2. Что остается code-first + +- pre-evidence gate +- post-evidence gate +- prompt selector +- набор answer prompts +- часть логики нормализации evidence + +### 8.3. Что это значит для docs use case + +Сейчас docs use case уже частично внедрен: + +- есть docs intent +- есть docs sub-intents +- есть docs layer mapping +- есть docs retrieval profile + +Но для полноценного `full_chain` по документации еще не хватает: + +- docs-oriented pre-gate правил +- docs-oriented post-gate правил +- docs-specific answer prompts +- docs-specific synthesis contract +- отдельных full-chain test cases для `DOCUMENTATION_EXPLAIN` и `FALLBACK` + +## 9. Краткое резюме по компонентам + +### Intent Router + +Назначение: + +- классифицировать запрос +- построить retrieval plan +- задать evidence policy + +Выход: + +- `IntentRouterResult` + +### RAG + +Назначение: + +- вернуть evidence из многослойного индекса + +Выход: + +- `RetrievalResult` +- затем `EvidenceBundle` + +### Pre-evidence gate + +Назначение: + +- решить, можно ли вообще уверенно отвечать + +Выход: + +- `passed/failure_reasons/degraded_message` + +### Post-evidence gate + +Назначение: + +- проверить, grounded ли уже сгенерированный ответ + +Выход: + +- `return` или `repair` + +### LLM + +Назначение: + +- классификация сложных интентов +- генерация финального ответа +- repair ответа при провале post-gate + +Текущий фокус: + +- в первую очередь `CODE_QA` diff --git a/rag_structure_report.md b/info/rag_structure_report.md similarity index 100% rename from rag_structure_report.md rename to info/rag_structure_report.md diff --git a/pytest.ini b/pytest.ini index 28f4b18..0991a31 100644 --- a/pytest.ini +++ b/pytest.ini @@ -4,3 +4,4 @@ markers = router_rag: intent-router -> rag integration pipeline tests full_chain: intent-router -> rag -> llm integration pipeline tests code_qa_eval: CODE_QA golden evaluation harness (fixture + real-adapter; needs DB for full run) + docs_qa_eval: DOCS_QA golden evaluation harness diff --git a/runtime_traces/agent_requests/20260326/req_02f645dac43746099e9ffb6663899b9e.md b/runtime_traces/agent_requests/20260326/req_02f645dac43746099e9ffb6663899b9e.md new file mode 100644 index 0000000..5dbb068 --- /dev/null +++ b/runtime_traces/agent_requests/20260326/req_02f645dac43746099e9ffb6663899b9e.md @@ -0,0 +1,130 @@ +# Request Trace: req_02f645dac43746099e9ffb6663899b9e + +- session_id: as_54f9e993483f499489530ad2d074ad95 +- active_rag_session_id: 333b97ca-1715-47bc-9944-fbacbb5c8108 +- process_version: v1 +- created_at: 2026-03-26T19:28:59.371830+00:00 + +## User Message +что можешт сделать? + +## Step bootstrap +```json +{ + "status": "started", + "details": {} +} +``` + +## Event status +```json +{ + "source": "orchestrator", + "text": "Запрос принят и поставлен в обработку.", + "payload": {}, + "created_at": "2026-03-26T19:28:59.372678+00:00" +} +``` + +## Event status +```json +{ + "source": "orchestrator", + "text": "Запускаю процесс обработки v1.", + "payload": { + "process_version": "v1" + }, + "created_at": "2026-03-26T19:28:59.372768+00:00" +} +``` + +## Step bootstrap +```json +{ + "status": "completed", + "details": {} +} +``` + +## Step run_llm +```json +{ + "status": "started", + "details": {} +} +``` + +## Event status +```json +{ + "source": "llm_process", + "text": "Отправляю запрос пользователя в LLM.", + "payload": {}, + "created_at": "2026-03-26T19:28:59.373014+00:00" +} +``` + +## Event status +```json +{ + "source": "llm_process", + "text": "Ответ от LLM получен.", + "payload": {}, + "created_at": "2026-03-26T19:29:06.352287+00:00" +} +``` + +## Step run_llm +```json +{ + "status": "completed", + "details": { + "answer_length": 1101 + } +} +``` + +## Step finalize +```json +{ + "status": "started", + "details": {} +} +``` + +## Event user +```json +{ + "source": "agent", + "text": "Я могу помочь тебе с различными задачами и вопросами, например:\n\n1. **Обучение и образование:** объясню сложные темы простым языком, помогу разобраться в математике, физике, химии, истории и других предметах.\n2. **Программирование:** подскажу по вопросам написания кода на разных языках программирования (Python, JavaScript, C++, Java и другие), объясню алгоритмы и структуры данных.\n3. **Написание текстов:** помогу составить письмо, эссе, статью или доклад; а также проверю грамматику и стилистику готового текста.\n4. **Помощь с переводами:** переведу текст на русский язык или с русского на другой язык.\n5. **Ответы на вопросы:** отвечу на любые вопросы общего характера: от научных до бытовых.\n6. **Генерация контента:** создам идеи для креативных проектов, рассказов, сценариев, стихов и песен.\n7. **Советы и рекомендации:** дам советы по саморазвитию, личностному росту, планированию времени и улучшению продуктивности.\n8. **Развлечения:** сыграем в интеллектуальные игры, загадки или просто поболтаем о чем-нибудь интересном.\n\nЕсли у тебя есть конкретная задача — расскажи, я постараюсь помочь!", + "payload": {}, + "created_at": "2026-03-26T19:29:06.353995+00:00" +} +``` + +## Event status +```json +{ + "source": "orchestrator", + "text": "Обработка запроса завершена.", + "payload": {}, + "created_at": "2026-03-26T19:29:06.354352+00:00" +} +``` + +## Step finalize +```json +{ + "status": "completed", + "details": {} +} +``` + +## Result +```json +{ + "status": "done", + "answer": "Я могу помочь тебе с различными задачами и вопросами, например:\n\n1. **Обучение и образование:** объясню сложные темы простым языком, помогу разобраться в математике, физике, химии, истории и других предметах.\n2. **Программирование:** подскажу по вопросам написания кода на разных языках программирования (Python, JavaScript, C++, Java и другие), объясню алгоритмы и структуры данных.\n3. **Написание текстов:** помогу составить письмо, эссе, статью или доклад; а также проверю грамматику и стилистику готового текста.\n4. **Помощь с переводами:** переведу текст на русский язык или с русского на другой язык.\n5. **Ответы на вопросы:** отвечу на любые вопросы общего характера: от научных до бытовых.\n6. **Генерация контента:** создам идеи для креативных проектов, рассказов, сценариев, стихов и песен.\n7. **Советы и рекомендации:** дам советы по саморазвитию, личностному росту, планированию времени и улучшению продуктивности.\n8. **Развлечения:** сыграем в интеллектуальные игры, загадки или просто поболтаем о чем-нибудь интересном.\n\nЕсли у тебя есть конкретная задача — расскажи, я постараюсь помочь!", + "completed_at": "2026-03-26T19:29:06.354735+00:00" +} +``` diff --git a/runtime_traces/agent_requests/20260326/req_18f4de6d677946739b66c533a2f95b95.md b/runtime_traces/agent_requests/20260326/req_18f4de6d677946739b66c533a2f95b95.md new file mode 100644 index 0000000..6571d93 --- /dev/null +++ b/runtime_traces/agent_requests/20260326/req_18f4de6d677946739b66c533a2f95b95.md @@ -0,0 +1,130 @@ +# Request Trace: req_18f4de6d677946739b66c533a2f95b95 + +- session_id: as_c1a11b6a3e3e4138acbfd7848e784ef2 +- active_rag_session_id: 1d011692-a2a1-4a7d-af17-dc35ac7e158b +- process_version: v1 +- created_at: 2026-03-26T19:23:38.293838+00:00 + +## User Message +Ты здесь? + +## Step bootstrap +```json +{ + "status": "started", + "details": {} +} +``` + +## Event status +```json +{ + "source": "orchestrator", + "text": "Запрос принят и поставлен в обработку.", + "payload": {}, + "created_at": "2026-03-26T19:23:38.297116+00:00" +} +``` + +## Event status +```json +{ + "source": "orchestrator", + "text": "Запускаю процесс обработки v1.", + "payload": { + "process_version": "v1" + }, + "created_at": "2026-03-26T19:23:38.297199+00:00" +} +``` + +## Step bootstrap +```json +{ + "status": "completed", + "details": {} +} +``` + +## Step run_llm +```json +{ + "status": "started", + "details": {} +} +``` + +## Event status +```json +{ + "source": "llm_process", + "text": "Отправляю запрос пользователя в LLM.", + "payload": {}, + "created_at": "2026-03-26T19:23:38.297331+00:00" +} +``` + +## Event status +```json +{ + "source": "llm_process", + "text": "Ответ от LLM получен.", + "payload": {}, + "created_at": "2026-03-26T19:23:39.473901+00:00" +} +``` + +## Step run_llm +```json +{ + "status": "completed", + "details": { + "answer_length": 26 + } +} +``` + +## Step finalize +```json +{ + "status": "started", + "details": {} +} +``` + +## Event user +```json +{ + "source": "agent", + "text": "Да, я здесь! Чем займёмся?", + "payload": {}, + "created_at": "2026-03-26T19:23:39.475294+00:00" +} +``` + +## Event status +```json +{ + "source": "orchestrator", + "text": "Обработка запроса завершена.", + "payload": {}, + "created_at": "2026-03-26T19:23:39.475469+00:00" +} +``` + +## Step finalize +```json +{ + "status": "completed", + "details": {} +} +``` + +## Result +```json +{ + "status": "done", + "answer": "Да, я здесь! Чем займёмся?", + "completed_at": "2026-03-26T19:23:39.475706+00:00" +} +``` diff --git a/runtime_traces/agent_requests/20260326/req_4a5e5dc2bdec4045971575d2434bfa03.md b/runtime_traces/agent_requests/20260326/req_4a5e5dc2bdec4045971575d2434bfa03.md new file mode 100644 index 0000000..21bb237 --- /dev/null +++ b/runtime_traces/agent_requests/20260326/req_4a5e5dc2bdec4045971575d2434bfa03.md @@ -0,0 +1,245 @@ +# Request Trace: req_4a5e5dc2bdec4045971575d2434bfa03 + +- session_id: as_9d330fb7437341f18539f819dcace95f +- active_rag_session_id: 34007a57-cf69-45f1-a0cd-c6a39bd81d42 +- process_version: v2 +- created_at: 2026-03-26T20:16:30.377725+00:00 + +## User Message +Как работает метод health/ + +## Step bootstrap +```json +{ + "status": "started", + "details": {} +} +``` + +## Event status +```json +{ + "source": "orchestrator", + "text": "Запрос принят и поставлен в обработку.", + "payload": {}, + "created_at": "2026-03-26T20:16:30.378388+00:00" +} +``` + +## Event status +```json +{ + "source": "orchestrator", + "text": "Запускаю процесс обработки v1.", + "payload": { + "process_version": "v2" + }, + "created_at": "2026-03-26T20:16:30.378460+00:00" +} +``` + +## Step bootstrap +```json +{ + "status": "completed", + "details": {} +} +``` + +## Step intent_router +```json +{ + "status": "started", + "details": {} +} +``` + +## Event status +```json +{ + "source": "intent_router", + "text": "Маршрутизирую запрос и определяю целевой workflow.", + "payload": {}, + "created_at": "2026-03-26T20:16:30.378707+00:00" +} +``` + +## Event status +```json +{ + "source": "intent_router", + "text": "Маршрут выбран: CODE_QA / EXPLAIN.", + "payload": { + "intent": "CODE_QA", + "sub_intent": "EXPLAIN", + "matched_intent_source": "deterministic" + }, + "created_at": "2026-03-26T20:16:30.380022+00:00" +} +``` + +## Step intent_router +```json +{ + "status": "completed", + "details": { + "intent": "CODE_QA", + "sub_intent": "EXPLAIN", + "matched_intent_source": "deterministic" + } +} +``` + +## Step workflow_fallback +```json +{ + "status": "started", + "details": {} +} +``` + +## Event status +```json +{ + "source": "task_workflow", + "text": "Запускаю workflow fallback.", + "payload": { + "intent": "CODE_QA", + "sub_intent": "EXPLAIN" + }, + "created_at": "2026-03-26T20:16:30.380251+00:00" +} +``` + +## Event status +```json +{ + "source": "status.rag_retrieval", + "text": "RAG Retrieval", + "payload": { + "status_block": { + "id": "rag_retrieval", + "title": "RAG Retrieval", + "lines": [ + "not used in fallback workflow" + ], + "append": false + }, + "kind": "task_progress" + }, + "created_at": "2026-03-26T20:16:30.380631+00:00" +} +``` + +## Event status +```json +{ + "source": "status.workflow", + "text": "Task Workflow", + "payload": { + "status_block": { + "id": "workflow", + "title": "Task Workflow", + "lines": [ + "workflow_id: fallback" + ], + "append": false + }, + "kind": "task_progress" + }, + "created_at": "2026-03-26T20:16:32.313137+00:00" +} +``` + +## Event status +```json +{ + "source": "status.evidence_gate", + "text": "Evidence Gate", + "payload": { + "status_block": { + "id": "evidence_gate", + "title": "Evidence Gate", + "lines": [ + "not applied in fallback workflow" + ], + "append": false + }, + "kind": "task_progress" + }, + "created_at": "2026-03-26T20:16:32.314125+00:00" +} +``` + +## Event status +```json +{ + "source": "workflow_result", + "text": "Workflow fallback завершен.", + "payload": { + "workflow_id": "fallback", + "result_type": "answer", + "answer_length": 190 + }, + "created_at": "2026-03-26T20:16:32.314639+00:00" +} +``` + +## Step workflow_fallback +```json +{ + "status": "completed", + "details": { + "workflow_id": "fallback", + "meta": { + "workflow_id": "fallback", + "intent": "CODE_QA" + } + } +} +``` + +## Step finalize +```json +{ + "status": "started", + "details": {} +} +``` + +## Event user +```json +{ + "source": "agent", + "text": "```yaml\npaths:\n /health/:\n get:\n summary: Проверка состояния здоровья сервиса\n responses:\n '200':\n description: Успешная проверка, сервис работает корректно\n```", + "payload": {}, + "created_at": "2026-03-26T20:16:32.315272+00:00" +} +``` + +## Event status +```json +{ + "source": "orchestrator", + "text": "Обработка запроса завершена.", + "payload": {}, + "created_at": "2026-03-26T20:16:32.317145+00:00" +} +``` + +## Step finalize +```json +{ + "status": "completed", + "details": {} +} +``` + +## Result +```json +{ + "status": "done", + "answer": "```yaml\npaths:\n /health/:\n get:\n summary: Проверка состояния здоровья сервиса\n responses:\n '200':\n description: Успешная проверка, сервис работает корректно\n```", + "completed_at": "2026-03-26T20:16:32.317835+00:00" +} +``` diff --git a/runtime_traces/agent_requests/20260326/req_6556fd999c2548e58071a1d1518e35cb.md b/runtime_traces/agent_requests/20260326/req_6556fd999c2548e58071a1d1518e35cb.md new file mode 100644 index 0000000..2685a80 --- /dev/null +++ b/runtime_traces/agent_requests/20260326/req_6556fd999c2548e58071a1d1518e35cb.md @@ -0,0 +1,137 @@ +# Request Trace: req_6556fd999c2548e58071a1d1518e35cb + +- session_id: as_a4d91e7eca7547e0a37dc4dc6492cf9b +- active_rag_session_id: aa7d907e-2a76-4bf7-99dc-5a400a417f8c +- process_version: v2 +- created_at: 2026-03-26T20:30:43.129032+00:00 + +## User Message +Какие методы есть в API? + +## Step bootstrap +```json +{ + "status": "started", + "details": {} +} +``` + +## Event status +```json +{ + "source": "orchestrator", + "text": "Запрос принят и поставлен в обработку.", + "payload": {}, + "created_at": "2026-03-26T20:30:43.130630+00:00" +} +``` + +## Event status +```json +{ + "source": "orchestrator", + "text": "Запускаю процесс обработки v1.", + "payload": { + "process_version": "v2" + }, + "created_at": "2026-03-26T20:30:43.130808+00:00" +} +``` + +## Step bootstrap +```json +{ + "status": "completed", + "details": {} +} +``` + +## Step intent_router +```json +{ + "status": "started", + "details": {} +} +``` + +## Event status +```json +{ + "source": "intent_router", + "text": "Маршрутизирую запрос и определяю целевой workflow.", + "payload": {}, + "created_at": "2026-03-26T20:30:43.131176+00:00" +} +``` + +## Event status +```json +{ + "source": "intent_router", + "text": "Маршрут выбран: DOCUMENTATION_EXPLAIN / API_METHOD_EXPLAIN.", + "payload": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "API_METHOD_EXPLAIN", + "matched_intent_source": "deterministic" + }, + "created_at": "2026-03-26T20:30:43.134624+00:00" +} +``` + +## Step intent_router +```json +{ + "status": "completed", + "details": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "API_METHOD_EXPLAIN", + "matched_intent_source": "deterministic" + } +} +``` + +## Step workflow_documentation_explain +```json +{ + "status": "started", + "details": {} +} +``` + +## Event status +```json +{ + "source": "task_workflow", + "text": "Запускаю workflow docs_qa.", + "payload": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "API_METHOD_EXPLAIN" + }, + "created_at": "2026-03-26T20:30:43.134934+00:00" +} +``` + +## Error +```json +{ + "status": "error", + "error": { + "code": "agent_api_runtime_error", + "desc": "Agent request failed unexpectedly.", + "module": "agent" + }, + "completed_at": "2026-03-26T20:30:50.387415+00:00" +} +``` + +## Event status +```json +{ + "source": "orchestrator", + "text": "Во время обработки запроса произошла ошибка.", + "payload": { + "code": "agent_api_runtime_error" + }, + "created_at": "2026-03-26T20:30:50.388003+00:00" +} +``` diff --git a/runtime_traces/agent_requests/20260326/req_68ad6398d5f2415e95c5a602a52dce2e.md b/runtime_traces/agent_requests/20260326/req_68ad6398d5f2415e95c5a602a52dce2e.md new file mode 100644 index 0000000..9b81ccc --- /dev/null +++ b/runtime_traces/agent_requests/20260326/req_68ad6398d5f2415e95c5a602a52dce2e.md @@ -0,0 +1,579 @@ +# Request Trace: req_68ad6398d5f2415e95c5a602a52dce2e + +- session_id: as_d77b5786695d4968a0d7faac4292f7bb +- active_rag_session_id: 47aeddca-0011-45e4-b99c-70f1a242f2e4 +- process_version: v2 +- created_at: 2026-03-26T20:24:27.706845+00:00 + +## User Message +что такое runtime health? + +## Step bootstrap +```json +{ + "status": "started", + "details": {} +} +``` + +## Event status +```json +{ + "source": "orchestrator", + "text": "Запрос принят и поставлен в обработку.", + "payload": {}, + "created_at": "2026-03-26T20:24:27.712585+00:00" +} +``` + +## Event status +```json +{ + "source": "orchestrator", + "text": "Запускаю процесс обработки v1.", + "payload": { + "process_version": "v2" + }, + "created_at": "2026-03-26T20:24:27.712691+00:00" +} +``` + +## Step bootstrap +```json +{ + "status": "completed", + "details": {} +} +``` + +## Step intent_router +```json +{ + "status": "started", + "details": {} +} +``` + +## Event status +```json +{ + "source": "intent_router", + "text": "Маршрутизирую запрос и определяю целевой workflow.", + "payload": {}, + "created_at": "2026-03-26T20:24:27.713057+00:00" +} +``` + +## Event status +```json +{ + "source": "intent_router", + "text": "Маршрут выбран: DOCUMENTATION_EXPLAIN / ENTITY_EXPLAIN.", + "payload": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "ENTITY_EXPLAIN", + "matched_intent_source": "deterministic" + }, + "created_at": "2026-03-26T20:24:27.717346+00:00" +} +``` + +## Step intent_router +```json +{ + "status": "completed", + "details": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "ENTITY_EXPLAIN", + "matched_intent_source": "deterministic" + } +} +``` + +## Step workflow_documentation_explain +```json +{ + "status": "started", + "details": {} +} +``` + +## Event status +```json +{ + "source": "task_workflow", + "text": "Запускаю workflow docs_qa.", + "payload": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "ENTITY_EXPLAIN" + }, + "created_at": "2026-03-26T20:24:27.717771+00:00" +} +``` + +## Event status +```json +{ + "source": "status.rag_retrieval", + "text": "RAG Retrieval", + "payload": { + "status_block": { + "id": "rag_retrieval", + "title": "RAG Retrieval", + "lines": [ + "planned_layers: D3_ENTITY_CATALOG, D5_RELATION_GRAPH, D1_DOCUMENT_CATALOG, D0_DOC_CHUNKS", + "executed_layers: D3_ENTITY_CATALOG, D5_RELATION_GRAPH, D1_DOCUMENT_CATALOG, D0_DOC_CHUNKS", + "D3_ENTITY_CATALOG: 8 hits", + "D5_RELATION_GRAPH: 8 hits", + "D1_DOCUMENT_CATALOG: 4 hits", + "D0_DOC_CHUNKS: 4 hits" + ], + "append": false + }, + "kind": "task_progress" + }, + "created_at": "2026-03-26T20:24:34.078020+00:00" +} +``` + +## Event status +```json +{ + "source": "status.workflow", + "text": "Task Workflow", + "payload": { + "status_block": { + "id": "workflow", + "title": "Task Workflow", + "lines": [ + "workflow_id: docs_qa", + "prompt: docs_explain_answer", + "answer_mode: answered" + ], + "append": false + }, + "kind": "task_progress" + }, + "created_at": "2026-03-26T20:24:34.078859+00:00" +} +``` + +## Event status +```json +{ + "source": "status.evidence_gate", + "text": "Evidence Gate", + "payload": { + "status_block": { + "id": "evidence_gate", + "title": "Evidence Gate", + "lines": [ + "decision: allow", + "reason: evidence_sufficient", + "satisfied: retrieval_non_empty" + ], + "append": false + }, + "kind": "task_progress" + }, + "created_at": "2026-03-26T20:24:34.080566+00:00" +} +``` + +## Event status +```json +{ + "source": "rag_retrieval", + "text": "RAG retrieval завершен.", + "payload": { + "planned_layers": [ + "D3_ENTITY_CATALOG", + "D5_RELATION_GRAPH", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "executed_layers": [ + "D3_ENTITY_CATALOG", + "D5_RELATION_GRAPH", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "non_empty_layers": [ + "D3_ENTITY_CATALOG", + "D5_RELATION_GRAPH", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ] + }, + "created_at": "2026-03-26T20:24:34.082685+00:00" +} +``` + +## Event status +```json +{ + "source": "evidence_gate", + "text": "Evidence gate оценен.", + "payload": { + "decision": "allow", + "reason": "evidence_sufficient", + "missing": [], + "satisfied": [ + "retrieval_non_empty" + ] + }, + "created_at": "2026-03-26T20:24:34.088672+00:00" +} +``` + +## Event status +```json +{ + "source": "workflow_result", + "text": "Workflow docs_qa завершен.", + "payload": { + "workflow_id": "docs_qa", + "result_type": "answer", + "answer_length": 1504 + }, + "created_at": "2026-03-26T20:24:34.091543+00:00" +} +``` + +## Step workflow_documentation_explain +```json +{ + "status": "completed", + "details": { + "workflow_id": "docs_qa", + "meta": { + "workflow_id": "docs_qa", + "intent": "DOCUMENTATION_EXPLAIN", + "diagnostics": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "ENTITY_EXPLAIN", + "layers_used": [ + "D3_ENTITY_CATALOG", + "D5_RELATION_GRAPH", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "documents_found": 1, + "facts_found": 0, + "relations_found": 2, + "openapi_fields_extracted": 0, + "missing_required_fields": [], + "openapi_status": { + "has_path": false, + "has_method": false, + "has_request": false, + "has_response": false + }, + "prompt_used": "docs_explain_answer", + "llm_mode": "prose", + "output_valid": true, + "matched_intent_source": "deterministic", + "matched_anchor_type": "none", + "matched_anchor_value": null, + "exact_anchor_match": false, + "docs_layers_requested": [ + "D3_ENTITY_CATALOG", + "D5_RELATION_GRAPH", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "docs_layers_with_hits": [ + "D3_ENTITY_CATALOG", + "D5_RELATION_GRAPH", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "planned_layers": [ + "D3_ENTITY_CATALOG", + "D5_RELATION_GRAPH", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "executed_layers": [ + "D3_ENTITY_CATALOG", + "D5_RELATION_GRAPH", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "non_empty_layers": [ + "D3_ENTITY_CATALOG", + "D5_RELATION_GRAPH", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "layer_diagnostics": { + "D3_ENTITY_CATALOG": { + "hits": 8, + "top_ids": [ + "architecture.telegram_notify_app", + "domain.runtime_health", + "logic.telegram_notification_loop" + ], + "top_sections": [ + "RuntimeManager", + "WorkerStatus", + "WorkerHealth", + "TelegramNotifyWorker" + ] + }, + "D5_RELATION_GRAPH": { + "hits": 8, + "top_ids": [ + "8595d7b82fecdb7ef579fa8961cda6799bb21970061e5bc221d4dd7a3d53fd04", + "801650f8bcbfbfbefd35c14447bfef7b3c3827313db790efa7faf47db860f8c4", + "79bdb0a74713df6064008179ca8c5c186dc23e4e1c5e2c9607b0bdddeba50f93", + "af2a4f7c1b677b908410ba720915405e10dbd0870e30a3c6e3aa2468550ddf0e", + "4e0bbeb8e97e25091a30412d8631b1d9f6bb58b5694d8b7cc632af69a9262ea8" + ], + "top_sections": [ + "domain.runtime_health:related_logic", + "domain.runtime_health:used_by", + "domain.runtime_health:parent", + "domain.runtime_health:part_of", + "architecture.telegram_notify_app:child" + ] + }, + "D1_DOCUMENT_CATALOG": { + "hits": 4, + "top_ids": [ + "domain.runtime_health", + "api.control_actions_endpoint", + "architecture.telegram_notify_app", + "logic.telegram_notification_loop" + ], + "top_sections": [ + "Сущность runtime health", + "HTTP API /actions/{action}", + "Архитектура Telegram Notify App", + "Цикл отправки уведомлений в Telegram" + ] + }, + "D0_DOC_CHUNKS": { + "hits": 4, + "top_ids": [ + "domain.runtime_health", + "docs/README.md", + "logic.telegram_notification_loop" + ], + "top_sections": [ + "domain.runtime_health:Details", + "domain.runtime_health:Summary", + "docs/README.md:Навигация", + "logic.telegram_notification_loop:Summary" + ] + } + }, + "query_entity_candidates": [ + "runtime health" + ], + "resolved_entity_candidates": [], + "query_anchor_candidates": [], + "resolved_anchor_candidates": [ + "architecture.telegram_notify_app", + "docs/documentation/architecture/telegram-notify-app-overview.md", + "domain.runtime_health", + "docs/documentation/domain/runtime-health-entity.md", + "logic.telegram_notification_loop", + "docs/documentation/logic/telegram-notification-loop.md", + "api.control_actions_endpoint", + "docs/documentation/api/control-actions-endpoint.md", + "docs/README.md" + ], + "anchor_candidates": [], + "selected_anchor": null, + "anchor_selection_reason": "", + "anchor_match_type": "", + "doc_ids": [ + "architecture.telegram_notify_app", + "architecture.telegram_notify_app_overview", + "domain.runtime_health", + "logic.telegram_notification_loop", + "api.control_actions_endpoint", + "api.actions_endpoint", + "docs/README.md" + ], + "doc_paths": [ + "docs/documentation/architecture/telegram-notify-app-overview.md", + "docs/documentation/domain/runtime-health-entity.md", + "docs/documentation/logic/telegram-notification-loop.md", + "docs/documentation/api/control-actions-endpoint.md", + "docs/README.md" + ], + "doc_titles": [ + "RuntimeManager", + "WorkerStatus", + "WorkerHealth", + "TelegramNotifyWorker", + "TelegramSendService", + "domain.runtime_health:related_logic", + "domain.runtime_health:used_by", + "domain.runtime_health:parent", + "domain.runtime_health:part_of", + "architecture.telegram_notify_app:child", + "logic.telegram_notification_loop:related_api", + "architecture.telegram_notify_app:related_api", + "Сущность runtime health", + "HTTP API /actions/{action}", + "Архитектура Telegram Notify App", + "Цикл отправки уведомлений в Telegram", + "domain.runtime_health:Details", + "domain.runtime_health:Summary", + "docs/README.md:Навигация", + "logic.telegram_notification_loop:Summary" + ], + "relation_hits_count": 2, + "relation_targets": [ + "domain.runtime_health:related_logic", + "domain.runtime_health:used_by" + ], + "selected_doc_ids": [ + "domain.runtime_health", + "architecture.telegram_notify_app" + ], + "selected_fact_ids": [], + "selected_relation_ids": [ + "8595d7b82fecdb7ef579fa8961cda6799bb21970061e5bc221d4dd7a3d53fd04", + "801650f8bcbfbfbefd35c14447bfef7b3c3827313db790efa7faf47db860f8c4" + ], + "selected_chunk_ids": [ + "domain.runtime_health" + ], + "selected_entity_ids": [ + "architecture.telegram_notify_app", + "domain.runtime_health" + ], + "selected_workflow_ids": [], + "fallback_doc_hits_count": 2, + "fallback_used": false, + "fact_hits": 0, + "entity_hits": 0, + "evidence_summary": { + "documents": 1, + "facts": 0, + "entities": 2, + "workflows": 0, + "relations": 2, + "chunks": 1, + "selected_doc_ids": [ + "domain.runtime_health", + "architecture.telegram_notify_app" + ], + "selected_fact_ids": [], + "selected_relation_ids": [ + "8595d7b82fecdb7ef579fa8961cda6799bb21970061e5bc221d4dd7a3d53fd04", + "801650f8bcbfbfbefd35c14447bfef7b3c3827313db790efa7faf47db860f8c4" + ], + "selected_chunk_ids": [ + "domain.runtime_health" + ], + "entity_hits": 0, + "openapi_signals": { + "path_found": false, + "method_found": false, + "operation_semantics_found": false, + "request_payload_found": false, + "request_schema": false, + "request_fields_found": false, + "response_payload_found": false, + "response_schema": false, + "response_fields_found": false, + "status_codes": false, + "content_type_found": false, + "examples_found": false, + "payload_description": false + } + }, + "gate_decision": "allow", + "gate_decision_reason": "evidence_sufficient", + "gate_missing_requirements": [], + "gate_satisfied_requirements": [ + "retrieval_non_empty" + ], + "openapi_evidence": { + "path_found": false, + "method_found": false, + "operation_semantics_found": false, + "request_payload_found": false, + "request_schema": false, + "request_fields_found": false, + "response_payload_found": false, + "response_schema": false, + "response_fields_found": false, + "status_codes": false, + "content_type_found": false, + "examples_found": false, + "payload_description": false + }, + "requested_fragment_type": null, + "fragment_evidence_found": [], + "fragment_missing_requirements": [], + "prompt": { + "prompt_name": "docs_explain_answer", + "system_prompt": "Ты объясняешь документацию системы.\n\nНа вход приходит JSON с полями:\n- question\n- intent\n- sub_intent\n- documents\n- facts\n- relations\n\nПравила:\n- Используй только предоставленные факты\n- Не додумывай\n- Если данных недостаточно, скажи это явно\n- Объясняй структурировано\n\nФормат ответа:\n1. Краткое описание\n2. Основные элементы\n3. Как это работает\n4. Связи с другими частями системы (если есть)", + "user_prompt": "{\n \"question\": \"что такое runtime health?\",\n \"intent\": \"DOCUMENTATION_EXPLAIN\",\n \"sub_intent\": \"ENTITY_EXPLAIN\",\n \"documents\": [\n {\n \"layer\": \"D1_DOCUMENT_CATALOG\",\n \"path\": \"docs/documentation/domain/runtime-health-entity.md\",\n \"title\": \"Сущность runtime health\",\n \"content\": \"`runtime health` — доменная модель наблюдаемости сервиса, которая описывает общее состояние runtime и состояние отдельных компонентов. Для `test_echo_app` главным объектом наблюдения является компонент `telegram_notify`, у которого важны статус, время старта и количество успешных отправок. Эта модель используется для внешнего health-monitoring и внутренней диагностики.\",\n \"metadata\": {\n \"name\": \"runtime_health\",\n \"tags\": [\n \"domain\",\n \"health\",\n \"observability\"\n ],\n \"type\": \"domain_entity\",\n \"layer\": \"domain\",\n \"links\": [\n {\n \"type\": \"part_of\",\n \"target\": \"architecture.telegram_notify_app\"\n },\n {\n \"type\": \"used_by\",\n \"target\": \"api.health_endpoint\"\n },\n {\n \"type\": \"related_logic\",\n \"target\": \"logic.telegram_notification_loop\"\n }\n ],\n \"owner\": null,\n \"title\": \"Сущность runtime health\",\n \"doc_id\": null,\n \"module\": \"telegram_notify_app\",\n \"parent\": \"architecture.telegram_notify_app\",\n \"status\": \"draft\",\n \"repo_id\": \"/Users/alex/Dev_projects_v2/apps/test_echo_app\",\n \"section\": null,\n \"blob_sha\": \"37d4dcf470ea3de95d59e44786006e369a3ea11bf5dbf4c88877696e9183ee87\",\n \"children\": [],\n \"doc_kind\": \"misc\",\n \"entities\": [\n \"WorkerHealth\",\n \"WorkerStatus\",\n \"TelegramNotifyWorker\"\n ],\n \"updated_at\": \"2026-03-20\",\n \"doc_version\": null,\n \"document_id\": \"domain.runtime_health\",\n \"source_path\": \"docs/documentation/domain/runtime-health-entity.md\",\n \"summary_text\": \"`runtime health` — доменная модель наблюдаемости сервиса, которая описывает общее состояние runtime и состояние отдельных компонентов. Для `test_echo_app` главным объектом наблюдения является компонент `telegram_notify`, у которого важны статус, время старта и количество успешных отправок. Эта модель используется для внешнего health-monitoring и внутренней диагностики.\",\n \"artifact_type\": null,\n \"last_modified\": null,\n \"staleness_score\": null,\n \"system_component\": null\n }\n }\n ],\n \"facts\": [],\n \"entities\": [\n {\n \"layer\": \"D3_ENTITY_CATALOG\",\n \"path\": \"docs/documentation/architecture/telegram-notify-app-overview.md\",\n \"title\": \"RuntimeManager\",\n \"content\": \"RuntimeManager\",\n \"metadata\": {\n \"tags\": [\n \"architecture\",\n \"telegram\",\n \"plba\",\n \"runtime\"\n ],\n \"owner\": null,\n \"doc_id\": null,\n \"module\": \"telegram_notify_app\",\n \"repo_id\": \"/Users/alex/Dev_projects_v2/apps/test_echo_app\",\n \"section\": null,\n \"blob_sha\": \"8b1cc9f823e55bddbc825466d10a0fdb4ca4354ac02d91f9e2aef7b7d2ec8256\",\n \"doc_version\": null,\n \"document_id\": \"architecture.telegram_notify_app\",\n \"entity_name\": \"RuntimeManager\",\n \"source_path\": \"docs/documentation/architecture/telegram-notify-app-overview.md\",\n \"artifact_type\": null,\n \"document_type\": \"architecture_overview\",\n \"last_modified\": null,\n \"staleness_score\": null,\n \"system_component\": null\n }\n },\n {\n \"layer\": \"D3_ENTITY_CATALOG\",\n \"path\": \"docs/documentation/domain/runtime-health-entity.md\",\n \"title\": \"WorkerStatus\",\n \"content\": \"WorkerStatus\",\n \"metadata\": {\n \"tags\": [\n \"domain\",\n \"health\",\n \"observability\"\n ],\n \"owner\": null,\n \"doc_id\": null,\n \"module\": \"telegram_notify_app\",\n \"repo_id\": \"/Users/alex/Dev_projects_v2/apps/test_echo_app\",\n \"section\": null,\n \"blob_sha\": \"37d4dcf470ea3de95d59e44786006e369a3ea11bf5dbf4c88877696e9183ee87\",\n \"doc_version\": null,\n \"document_id\": \"domain.runtime_health\",\n \"entity_name\": \"WorkerStatus\",\n \"source_path\": \"docs/documentation/domain/runtime-health-entity.md\",\n \"artifact_type\": null,\n \"document_type\": \"domain_entity\",\n \"last_modified\": null,\n \"staleness_score\": null,\n \"system_component\": null\n }\n }\n ],\n \"workflows\": [],\n \"relations\": [\n {\n \"layer\": \"D5_RELATION_GRAPH\",\n \"path\": \"docs/documentation/domain/runtime-health-entity.md\",\n \"title\": \"domain.runtime_health:related_logic\",\n \"content\": \"domain.runtime_health related_logic logic.telegram_notification_loop\",\n \"metadata\": {\n \"owner\": null,\n \"anchor\": \"frontmatter.links\",\n \"doc_id\": null,\n \"repo_id\": \"/Users/alex/Dev_projects_v2/apps/test_echo_app\",\n \"section\": null,\n \"blob_sha\": \"37d4dcf470ea3de95d59e44786006e369a3ea11bf5dbf4c88877696e9183ee87\",\n \"source_id\": \"domain.runtime_health\",\n \"target_id\": \"logic.telegram_notification_loop\",\n \"doc_version\": null,\n \"relation_id\": \"8595d7b82fecdb7ef579fa8961cda6799bb21970061e5bc221d4dd7a3d53fd04\",\n \"source_path\": \"docs/documentation/domain/runtime-health-entity.md\",\n \"artifact_type\": null,\n \"last_modified\": null,\n \"relation_type\": \"related_logic\",\n \"staleness_score\": null,\n \"system_component\": null\n }\n },\n {\n \"layer\": \"D5_RELATION_GRAPH\",\n \"path\": \"docs/documentation/domain/runtime-health-entity.md\",\n \"title\": \"domain.runtime_health:used_by\",\n \"content\": \"domain.runtime_health used_by api.health_endpoint\",\n \"metadata\": {\n \"owner\": null,\n \"anchor\": \"frontmatter.links\",\n \"doc_id\": null,\n \"repo_id\": \"/Users/alex/Dev_projects_v2/apps/test_echo_app\",\n \"section\": null,\n \"blob_sha\": \"37d4dcf470ea3de95d59e44786006e369a3ea11bf5dbf4c88877696e9183ee87\",\n \"source_id\": \"domain.runtime_health\",\n \"target_id\": \"api.health_endpoint\",\n \"doc_version\": null,\n \"relation_id\": \"801650f8bcbfbfbefd35c14447bfef7b3c3827313db790efa7faf47db860f8c4\",\n \"source_path\": \"docs/documentation/domain/runtime-health-entity.md\",\n \"artifact_type\": null,\n \"last_modified\": null,\n \"relation_type\": \"used_by\",\n \"staleness_score\": null,\n \"system_component\": null\n }\n }\n ],\n \"chunks\": [\n {\n \"layer\": \"D0_DOC_CHUNKS\",\n \"path\": \"docs/documentation/domain/runtime-health-entity.md\",\n \"title\": \"domain.runtime_health:Details\",\n \"content\": \"Health payload собирается runtime'ом и включает общий статус приложения и список компонентов. Для worker `telegram_notify` используются состояния `ok`, `degraded` и `unhealthy`, которые зависят от жизненного цикла фонового потока, наличия Telegram credentials и результата последней отправки.\\n\\nКлючевые metadata поля компонента — `app_started_at` и `notifications_sent`. Первое отражает UTC timestamp запуска worker'а, второе показывает число успешных доставок с момента старта runtime. Эти поля позволяют отделить реальный жизненный цикл worker'а от простого факта, что HTTP API отвечает.\\n\\nСущность `runtime health` связывает техническое состояние worker'а с операторским представлением сервиса. Через нее клиент `/health` получает не только общий статус процесса, но и диагностический контекст, достаточный для базового мониторинга и troubleshooting.\",\n \"metadata\": {\n \"tags\": [\n \"domain\",\n \"health\",\n \"observability\"\n ],\n \"type\": \"domain_entity\",\n \"order\": 2,\n \"owner\": null,\n \"doc_id\": null,\n \"module\": \"telegram_notify_app\",\n \"repo_id\": \"/Users/alex/Dev_projects_v2/apps/test_echo_app\",\n \"section\": null,\n \"blob_sha\": \"37d4dcf470ea3de95d59e44786006e369a3ea11bf5dbf4c88877696e9183ee87\",\n \"doc_kind\": \"misc\",\n \"doc_version\": null,\n \"document_id\": \"domain.runtime_health\",\n \"source_path\": \"docs/documentation/domain/runtime-health-entity.md\",\n \"section_path\": \"Details\",\n \"artifact_type\": null,\n \"last_modified\": null,\n \"section_title\": \"Details\",\n \"staleness_score\": null,\n \"system_component\": null\n }\n }\n ]\n}", + "log_context": "graph.project_qa.docs.answer", + "prompt_stats": { + "system_chars": 393, + "user_chars": 8461, + "tokens_in_estimate": 2214 + } + }, + "answer_mode": "answered", + "degrade_reason": null, + "degraded_reason": null, + "code_intents_stubbed": false + } + } + } +} +``` + +## Step finalize +```json +{ + "status": "started", + "details": {} +} +``` + +## Event user +```json +{ + "source": "agent", + "text": "### 1. Краткое описание\nRuntime Health – это доменная модель наблюдаемости сервиса, описывающая текущее состояние runtime и его компонентов. Она используется для внешнего мониторинга здоровья приложений и внутренней диагностики, позволяя получать детальную информацию о состоянии сервиса и проводить базовые операции по устранению неполадок.\n\n### 2. Основные элементы\n- **Компоненты**: \n - Worker `telegram_notify`\n- **Состояния компонентов**:\n - ok, degraded, unhealthy\n- **Metadata поля**:\n - app_started_at (время старта)\n - notifications_sent (количество успешных отправок)\n- **Связанные сущности**:\n - WorkerHealth, WorkerStatus, TelegramNotifyWorker\n\n### 3. Как это работает\n- Модель собирает данные о текущем статусе приложения и его компонентов в виде payload.\n- Состояние компонента определяется на основе жизненного цикла фоновых потоков, наличия необходимых конфигураций (например, Telegram credentials), а также результатов последних операций.\n- Метаданные включают точное время старта компонента и количество успешно выполненных задач, обеспечивая более глубокое понимание текущего состояния службы.\n- Информация предоставляется через endpoint `/health`, который возвращает не только текущий статус, но и детализированный диагностический контекст.\n\n### 4. Связи с другими частями системы\n- **Используется логикой**: логика `telegram_notification_loop`\n- **Используется API**: endpoint `/health` (api.health_endpoint)\n- **Часть архитектуры**: архитектура приложения `telegram_notify_app`", + "payload": {}, + "created_at": "2026-03-26T20:24:34.094633+00:00" +} +``` + +## Event status +```json +{ + "source": "orchestrator", + "text": "Обработка запроса завершена.", + "payload": {}, + "created_at": "2026-03-26T20:24:34.094968+00:00" +} +``` + +## Step finalize +```json +{ + "status": "completed", + "details": {} +} +``` + +## Result +```json +{ + "status": "done", + "answer": "### 1. Краткое описание\nRuntime Health – это доменная модель наблюдаемости сервиса, описывающая текущее состояние runtime и его компонентов. Она используется для внешнего мониторинга здоровья приложений и внутренней диагностики, позволяя получать детальную информацию о состоянии сервиса и проводить базовые операции по устранению неполадок.\n\n### 2. Основные элементы\n- **Компоненты**: \n - Worker `telegram_notify`\n- **Состояния компонентов**:\n - ok, degraded, unhealthy\n- **Metadata поля**:\n - app_started_at (время старта)\n - notifications_sent (количество успешных отправок)\n- **Связанные сущности**:\n - WorkerHealth, WorkerStatus, TelegramNotifyWorker\n\n### 3. Как это работает\n- Модель собирает данные о текущем статусе приложения и его компонентов в виде payload.\n- Состояние компонента определяется на основе жизненного цикла фоновых потоков, наличия необходимых конфигураций (например, Telegram credentials), а также результатов последних операций.\n- Метаданные включают точное время старта компонента и количество успешно выполненных задач, обеспечивая более глубокое понимание текущего состояния службы.\n- Информация предоставляется через endpoint `/health`, который возвращает не только текущий статус, но и детализированный диагностический контекст.\n\n### 4. Связи с другими частями системы\n- **Используется логикой**: логика `telegram_notification_loop`\n- **Используется API**: endpoint `/health` (api.health_endpoint)\n- **Часть архитектуры**: архитектура приложения `telegram_notify_app`", + "completed_at": "2026-03-26T20:24:34.095333+00:00" +} +``` diff --git a/runtime_traces/agent_requests/20260326/req_7e47a8b3458741568e2b974079a74cb5.md b/runtime_traces/agent_requests/20260326/req_7e47a8b3458741568e2b974079a74cb5.md new file mode 100644 index 0000000..577b468 --- /dev/null +++ b/runtime_traces/agent_requests/20260326/req_7e47a8b3458741568e2b974079a74cb5.md @@ -0,0 +1,507 @@ +# Request Trace: req_7e47a8b3458741568e2b974079a74cb5 + +- session_id: as_9d330fb7437341f18539f819dcace95f +- active_rag_session_id: 34007a57-cf69-45f1-a0cd-c6a39bd81d42 +- process_version: v2 +- created_at: 2026-03-26T20:17:03.006084+00:00 + +## User Message +Опиши что делает /health + +## Step bootstrap +```json +{ + "status": "started", + "details": {} +} +``` + +## Event status +```json +{ + "source": "orchestrator", + "text": "Запрос принят и поставлен в обработку.", + "payload": {}, + "created_at": "2026-03-26T20:17:03.012795+00:00" +} +``` + +## Event status +```json +{ + "source": "orchestrator", + "text": "Запускаю процесс обработки v1.", + "payload": { + "process_version": "v2" + }, + "created_at": "2026-03-26T20:17:03.013195+00:00" +} +``` + +## Step bootstrap +```json +{ + "status": "completed", + "details": {} +} +``` + +## Step intent_router +```json +{ + "status": "started", + "details": {} +} +``` + +## Event status +```json +{ + "source": "intent_router", + "text": "Маршрутизирую запрос и определяю целевой workflow.", + "payload": {}, + "created_at": "2026-03-26T20:17:03.015461+00:00" +} +``` + +## Event status +```json +{ + "source": "intent_router", + "text": "Маршрут выбран: DOCUMENTATION_EXPLAIN / API_METHOD_EXPLAIN.", + "payload": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "API_METHOD_EXPLAIN", + "matched_intent_source": "deterministic" + }, + "created_at": "2026-03-26T20:17:03.021546+00:00" +} +``` + +## Step intent_router +```json +{ + "status": "completed", + "details": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "API_METHOD_EXPLAIN", + "matched_intent_source": "deterministic" + } +} +``` + +## Step workflow_documentation_explain +```json +{ + "status": "started", + "details": {} +} +``` + +## Event status +```json +{ + "source": "task_workflow", + "text": "Запускаю workflow docs_qa.", + "payload": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "API_METHOD_EXPLAIN" + }, + "created_at": "2026-03-26T20:17:03.021922+00:00" +} +``` + +## Event status +```json +{ + "source": "status.rag_retrieval", + "text": "RAG Retrieval", + "payload": { + "status_block": { + "id": "rag_retrieval", + "title": "RAG Retrieval", + "lines": [ + "planned_layers: D2_FACT_INDEX, D4_WORKFLOW_INDEX, D1_DOCUMENT_CATALOG, D0_DOC_CHUNKS", + "executed_layers: D2_FACT_INDEX, D4_WORKFLOW_INDEX, D1_DOCUMENT_CATALOG, D0_DOC_CHUNKS", + "D2_FACT_INDEX: 8 hits", + "D4_WORKFLOW_INDEX: 2 hits", + "D1_DOCUMENT_CATALOG: 4 hits", + "D0_DOC_CHUNKS: 4 hits" + ], + "append": false + }, + "kind": "task_progress" + }, + "created_at": "2026-03-26T20:17:05.913522+00:00" +} +``` + +## Event status +```json +{ + "source": "status.workflow", + "text": "Task Workflow", + "payload": { + "status_block": { + "id": "workflow", + "title": "Task Workflow", + "lines": [ + "workflow_id: docs_qa", + "prompt: docs_explain_answer", + "answer_mode: degraded" + ], + "append": false + }, + "kind": "task_progress" + }, + "created_at": "2026-03-26T20:17:05.914387+00:00" +} +``` + +## Event status +```json +{ + "source": "status.evidence_gate", + "text": "Evidence Gate", + "payload": { + "status_block": { + "id": "evidence_gate", + "title": "Evidence Gate", + "lines": [ + "decision: reject", + "reason: not_found_exact_anchor", + "missing: retrieval_non_empty, exact_anchor_match" + ], + "append": false + }, + "kind": "task_progress" + }, + "created_at": "2026-03-26T20:17:05.914679+00:00" +} +``` + +## Event status +```json +{ + "source": "rag_retrieval", + "text": "RAG retrieval завершен.", + "payload": { + "planned_layers": [ + "D2_FACT_INDEX", + "D4_WORKFLOW_INDEX", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "executed_layers": [ + "D2_FACT_INDEX", + "D4_WORKFLOW_INDEX", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "non_empty_layers": [ + "D2_FACT_INDEX", + "D4_WORKFLOW_INDEX", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ] + }, + "created_at": "2026-03-26T20:17:05.914992+00:00" +} +``` + +## Event status +```json +{ + "source": "evidence_gate", + "text": "Evidence gate оценен.", + "payload": { + "decision": "reject", + "reason": "not_found_exact_anchor", + "missing": [ + "retrieval_non_empty", + "exact_anchor_match" + ], + "satisfied": [] + }, + "created_at": "2026-03-26T20:17:05.915395+00:00" +} +``` + +## Event status +```json +{ + "source": "workflow_result", + "text": "Workflow docs_qa завершен.", + "payload": { + "workflow_id": "docs_qa", + "result_type": "answer", + "answer_length": 57 + }, + "created_at": "2026-03-26T20:17:05.916924+00:00" +} +``` + +## Step workflow_documentation_explain +```json +{ + "status": "completed", + "details": { + "workflow_id": "docs_qa", + "meta": { + "workflow_id": "docs_qa", + "intent": "DOCUMENTATION_EXPLAIN", + "diagnostics": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "API_METHOD_EXPLAIN", + "layers_used": [ + "D2_FACT_INDEX", + "D4_WORKFLOW_INDEX", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "documents_found": 0, + "facts_found": 0, + "relations_found": 0, + "openapi_fields_extracted": 0, + "missing_required_fields": [], + "openapi_status": { + "has_path": false, + "has_method": false, + "has_request": false, + "has_response": false + }, + "prompt_used": "docs_explain_answer", + "llm_mode": "prose", + "output_valid": true, + "matched_intent_source": "deterministic", + "matched_anchor_type": "endpoint", + "matched_anchor_value": "/health", + "exact_anchor_match": false, + "docs_layers_requested": [ + "D2_FACT_INDEX", + "D4_WORKFLOW_INDEX", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "docs_layers_with_hits": [ + "D2_FACT_INDEX", + "D4_WORKFLOW_INDEX", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "planned_layers": [ + "D2_FACT_INDEX", + "D4_WORKFLOW_INDEX", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "executed_layers": [ + "D2_FACT_INDEX", + "D4_WORKFLOW_INDEX", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "non_empty_layers": [ + "D2_FACT_INDEX", + "D4_WORKFLOW_INDEX", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "layer_diagnostics": { + "D2_FACT_INDEX": { + "hits": 8, + "top_ids": [ + "8879bb1d923dff0d783ef202f98fdfe5b774870912b2cd261ae127003daffacb", + "5bc72ce58bd31c654a380034beb59f47224e9b03bd306503a7f0b8634008409d", + "5a471b2380ec55b5866b99bb337b92cb78b91051cf616593937f1603d1011fa6", + "a31bbca2eb31ffb6655bcec7ff07b8cf2b6c7416610cf58dfc1e0c737df12fe1", + "e64a6aebed07076a1cccb4d6537b5f54489e25eda776e0230b3c2ff1df2ae648" + ], + "top_sections": [ + "domain.runtime_health:mentions_entity", + "docs/README.md:doc_list_item" + ] + }, + "D4_WORKFLOW_INDEX": { + "hits": 2, + "top_ids": [ + "api.send_message_endpoint", + "api.control_actions_endpoint" + ], + "top_sections": [ + "Scenario" + ] + }, + "D1_DOCUMENT_CATALOG": { + "hits": 4, + "top_ids": [ + "domain.runtime_health", + "docs/README.md", + "api.send_message_endpoint", + "api.control_actions_endpoint" + ], + "top_sections": [ + "Сущность runtime health", + "Readme", + "HTTP API /send", + "HTTP API /actions/{action}" + ] + }, + "D0_DOC_CHUNKS": { + "hits": 4, + "top_ids": [ + "domain.runtime_health", + "docs/README.md", + "architecture.telegram_notify_app" + ], + "top_sections": [ + "domain.runtime_health:Details", + "domain.runtime_health:Summary", + "docs/README.md:Навигация", + "architecture.telegram_notify_app:Details" + ] + } + }, + "query_entity_candidates": [], + "resolved_entity_candidates": [], + "query_anchor_candidates": [ + "/health" + ], + "resolved_anchor_candidates": [], + "anchor_candidates": [], + "selected_anchor": null, + "anchor_selection_reason": "", + "anchor_match_type": "", + "doc_ids": [], + "doc_paths": [], + "doc_titles": [], + "relation_hits_count": 0, + "relation_targets": [], + "selected_doc_ids": [], + "selected_fact_ids": [], + "selected_relation_ids": [], + "selected_chunk_ids": [], + "selected_entity_ids": [], + "selected_workflow_ids": [], + "fallback_doc_hits_count": 0, + "fallback_used": false, + "fact_hits": 0, + "entity_hits": 0, + "evidence_summary": { + "documents": 0, + "facts": 0, + "entities": 0, + "workflows": 0, + "relations": 0, + "chunks": 0, + "selected_doc_ids": [], + "selected_fact_ids": [], + "selected_relation_ids": [], + "selected_chunk_ids": [], + "entity_hits": 0, + "openapi_signals": { + "path_found": false, + "method_found": false, + "operation_semantics_found": false, + "request_payload_found": false, + "request_schema": false, + "request_fields_found": false, + "response_payload_found": false, + "response_schema": false, + "response_fields_found": false, + "status_codes": false, + "content_type_found": false, + "examples_found": false, + "payload_description": false + } + }, + "gate_decision": "reject", + "gate_decision_reason": "not_found_exact_anchor", + "gate_missing_requirements": [ + "retrieval_non_empty", + "exact_anchor_match" + ], + "gate_satisfied_requirements": [], + "openapi_evidence": { + "path_found": false, + "method_found": false, + "operation_semantics_found": false, + "request_payload_found": false, + "request_schema": false, + "request_fields_found": false, + "response_payload_found": false, + "response_schema": false, + "response_fields_found": false, + "status_codes": false, + "content_type_found": false, + "examples_found": false, + "payload_description": false + }, + "requested_fragment_type": null, + "fragment_evidence_found": [], + "fragment_missing_requirements": [], + "prompt": { + "prompt_name": "docs_explain_answer", + "system_prompt": "Ты объясняешь документацию системы.\n\nНа вход приходит JSON с полями:\n- question\n- intent\n- sub_intent\n- documents\n- facts\n- relations\n\nПравила:\n- Используй только предоставленные факты\n- Не додумывай\n- Если данных недостаточно, скажи это явно\n- Объясняй структурировано\n\nФормат ответа:\n1. Краткое описание\n2. Основные элементы\n3. Как это работает\n4. Связи с другими частями системы (если есть)", + "user_prompt": "{\n \"question\": \"Опиши что делает /health\",\n \"intent\": \"DOCUMENTATION_EXPLAIN\",\n \"sub_intent\": \"API_METHOD_EXPLAIN\",\n \"documents\": [],\n \"facts\": [],\n \"entities\": [],\n \"workflows\": [],\n \"relations\": [],\n \"chunks\": []\n}", + "log_context": "graph.project_qa.docs.answer", + "prompt_stats": { + "system_chars": 393, + "user_chars": 225, + "tokens_in_estimate": 155 + } + }, + "answer_mode": "degraded", + "degrade_reason": "not_found_exact_anchor", + "degraded_reason": "not_found_exact_anchor", + "code_intents_stubbed": false + } + } + } +} +``` + +## Step finalize +```json +{ + "status": "started", + "details": {} +} +``` + +## Event user +```json +{ + "source": "agent", + "text": "Не найдено точное совпадение по запрошенному docs anchor.", + "payload": {}, + "created_at": "2026-03-26T20:17:05.919336+00:00" +} +``` + +## Event status +```json +{ + "source": "orchestrator", + "text": "Обработка запроса завершена.", + "payload": {}, + "created_at": "2026-03-26T20:17:05.919876+00:00" +} +``` + +## Step finalize +```json +{ + "status": "completed", + "details": {} +} +``` + +## Result +```json +{ + "status": "done", + "answer": "Не найдено точное совпадение по запрошенному docs anchor.", + "completed_at": "2026-03-26T20:17:05.920288+00:00" +} +``` diff --git a/runtime_traces/agent_requests/20260326/req_90367a184bfa4638bd9c473e89d2b5b7.md b/runtime_traces/agent_requests/20260326/req_90367a184bfa4638bd9c473e89d2b5b7.md new file mode 100644 index 0000000..9fdfd43 --- /dev/null +++ b/runtime_traces/agent_requests/20260326/req_90367a184bfa4638bd9c473e89d2b5b7.md @@ -0,0 +1,507 @@ +# Request Trace: req_90367a184bfa4638bd9c473e89d2b5b7 + +- session_id: as_a4d91e7eca7547e0a37dc4dc6492cf9b +- active_rag_session_id: aa7d907e-2a76-4bf7-99dc-5a400a417f8c +- process_version: v2 +- created_at: 2026-03-26T20:30:20.880909+00:00 + +## User Message +как работает метод /health + +## Step bootstrap +```json +{ + "status": "started", + "details": {} +} +``` + +## Event status +```json +{ + "source": "orchestrator", + "text": "Запрос принят и поставлен в обработку.", + "payload": {}, + "created_at": "2026-03-26T20:30:20.882319+00:00" +} +``` + +## Event status +```json +{ + "source": "orchestrator", + "text": "Запускаю процесс обработки v1.", + "payload": { + "process_version": "v2" + }, + "created_at": "2026-03-26T20:30:20.882447+00:00" +} +``` + +## Step bootstrap +```json +{ + "status": "completed", + "details": {} +} +``` + +## Step intent_router +```json +{ + "status": "started", + "details": {} +} +``` + +## Event status +```json +{ + "source": "intent_router", + "text": "Маршрутизирую запрос и определяю целевой workflow.", + "payload": {}, + "created_at": "2026-03-26T20:30:20.882855+00:00" +} +``` + +## Event status +```json +{ + "source": "intent_router", + "text": "Маршрут выбран: DOCUMENTATION_EXPLAIN / API_METHOD_EXPLAIN.", + "payload": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "API_METHOD_EXPLAIN", + "matched_intent_source": "deterministic" + }, + "created_at": "2026-03-26T20:30:20.886041+00:00" +} +``` + +## Step intent_router +```json +{ + "status": "completed", + "details": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "API_METHOD_EXPLAIN", + "matched_intent_source": "deterministic" + } +} +``` + +## Step workflow_documentation_explain +```json +{ + "status": "started", + "details": {} +} +``` + +## Event status +```json +{ + "source": "task_workflow", + "text": "Запускаю workflow docs_qa.", + "payload": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "API_METHOD_EXPLAIN" + }, + "created_at": "2026-03-26T20:30:20.886364+00:00" +} +``` + +## Event status +```json +{ + "source": "status.rag_retrieval", + "text": "RAG Retrieval", + "payload": { + "status_block": { + "id": "rag_retrieval", + "title": "RAG Retrieval", + "lines": [ + "planned_layers: D2_FACT_INDEX, D4_WORKFLOW_INDEX, D1_DOCUMENT_CATALOG, D0_DOC_CHUNKS", + "executed_layers: D2_FACT_INDEX, D4_WORKFLOW_INDEX, D1_DOCUMENT_CATALOG, D0_DOC_CHUNKS", + "D2_FACT_INDEX: 8 hits", + "D4_WORKFLOW_INDEX: 2 hits", + "D1_DOCUMENT_CATALOG: 4 hits", + "D0_DOC_CHUNKS: 4 hits" + ], + "append": false + }, + "kind": "task_progress" + }, + "created_at": "2026-03-26T20:30:24.170029+00:00" +} +``` + +## Event status +```json +{ + "source": "status.workflow", + "text": "Task Workflow", + "payload": { + "status_block": { + "id": "workflow", + "title": "Task Workflow", + "lines": [ + "workflow_id: docs_qa", + "prompt: docs_explain_answer", + "answer_mode: degraded" + ], + "append": false + }, + "kind": "task_progress" + }, + "created_at": "2026-03-26T20:30:24.170817+00:00" +} +``` + +## Event status +```json +{ + "source": "status.evidence_gate", + "text": "Evidence Gate", + "payload": { + "status_block": { + "id": "evidence_gate", + "title": "Evidence Gate", + "lines": [ + "decision: reject", + "reason: not_found_exact_anchor", + "missing: retrieval_non_empty, exact_anchor_match" + ], + "append": false + }, + "kind": "task_progress" + }, + "created_at": "2026-03-26T20:30:24.172958+00:00" +} +``` + +## Event status +```json +{ + "source": "rag_retrieval", + "text": "RAG retrieval завершен.", + "payload": { + "planned_layers": [ + "D2_FACT_INDEX", + "D4_WORKFLOW_INDEX", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "executed_layers": [ + "D2_FACT_INDEX", + "D4_WORKFLOW_INDEX", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "non_empty_layers": [ + "D2_FACT_INDEX", + "D4_WORKFLOW_INDEX", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ] + }, + "created_at": "2026-03-26T20:30:24.173401+00:00" +} +``` + +## Event status +```json +{ + "source": "evidence_gate", + "text": "Evidence gate оценен.", + "payload": { + "decision": "reject", + "reason": "not_found_exact_anchor", + "missing": [ + "retrieval_non_empty", + "exact_anchor_match" + ], + "satisfied": [] + }, + "created_at": "2026-03-26T20:30:24.173890+00:00" +} +``` + +## Event status +```json +{ + "source": "workflow_result", + "text": "Workflow docs_qa завершен.", + "payload": { + "workflow_id": "docs_qa", + "result_type": "answer", + "answer_length": 57 + }, + "created_at": "2026-03-26T20:30:24.174256+00:00" +} +``` + +## Step workflow_documentation_explain +```json +{ + "status": "completed", + "details": { + "workflow_id": "docs_qa", + "meta": { + "workflow_id": "docs_qa", + "intent": "DOCUMENTATION_EXPLAIN", + "diagnostics": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "API_METHOD_EXPLAIN", + "layers_used": [ + "D2_FACT_INDEX", + "D4_WORKFLOW_INDEX", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "documents_found": 0, + "facts_found": 0, + "relations_found": 0, + "openapi_fields_extracted": 0, + "missing_required_fields": [], + "openapi_status": { + "has_path": false, + "has_method": false, + "has_request": false, + "has_response": false + }, + "prompt_used": "docs_explain_answer", + "llm_mode": "prose", + "output_valid": true, + "matched_intent_source": "deterministic", + "matched_anchor_type": "endpoint", + "matched_anchor_value": "/health", + "exact_anchor_match": false, + "docs_layers_requested": [ + "D2_FACT_INDEX", + "D4_WORKFLOW_INDEX", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "docs_layers_with_hits": [ + "D2_FACT_INDEX", + "D4_WORKFLOW_INDEX", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "planned_layers": [ + "D2_FACT_INDEX", + "D4_WORKFLOW_INDEX", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "executed_layers": [ + "D2_FACT_INDEX", + "D4_WORKFLOW_INDEX", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "non_empty_layers": [ + "D2_FACT_INDEX", + "D4_WORKFLOW_INDEX", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "layer_diagnostics": { + "D2_FACT_INDEX": { + "hits": 8, + "top_ids": [ + "8879bb1d923dff0d783ef202f98fdfe5b774870912b2cd261ae127003daffacb", + "5bc72ce58bd31c654a380034beb59f47224e9b03bd306503a7f0b8634008409d", + "5a471b2380ec55b5866b99bb337b92cb78b91051cf616593937f1603d1011fa6", + "a31bbca2eb31ffb6655bcec7ff07b8cf2b6c7416610cf58dfc1e0c737df12fe1", + "e64a6aebed07076a1cccb4d6537b5f54489e25eda776e0230b3c2ff1df2ae648" + ], + "top_sections": [ + "domain.runtime_health:mentions_entity", + "docs/README.md:doc_list_item" + ] + }, + "D4_WORKFLOW_INDEX": { + "hits": 2, + "top_ids": [ + "api.control_actions_endpoint", + "api.send_message_endpoint" + ], + "top_sections": [ + "Scenario" + ] + }, + "D1_DOCUMENT_CATALOG": { + "hits": 4, + "top_ids": [ + "domain.runtime_health", + "docs/README.md", + "api.send_message_endpoint", + "api.control_actions_endpoint" + ], + "top_sections": [ + "Сущность runtime health", + "Readme", + "HTTP API /send", + "HTTP API /actions/{action}" + ] + }, + "D0_DOC_CHUNKS": { + "hits": 4, + "top_ids": [ + "domain.runtime_health", + "docs/README.md", + "architecture.telegram_notify_app" + ], + "top_sections": [ + "domain.runtime_health:Details", + "domain.runtime_health:Summary", + "docs/README.md:Навигация", + "architecture.telegram_notify_app:Details" + ] + } + }, + "query_entity_candidates": [], + "resolved_entity_candidates": [], + "query_anchor_candidates": [ + "/health" + ], + "resolved_anchor_candidates": [], + "anchor_candidates": [], + "selected_anchor": null, + "anchor_selection_reason": "", + "anchor_match_type": "", + "doc_ids": [], + "doc_paths": [], + "doc_titles": [], + "relation_hits_count": 0, + "relation_targets": [], + "selected_doc_ids": [], + "selected_fact_ids": [], + "selected_relation_ids": [], + "selected_chunk_ids": [], + "selected_entity_ids": [], + "selected_workflow_ids": [], + "fallback_doc_hits_count": 0, + "fallback_used": false, + "fact_hits": 0, + "entity_hits": 0, + "evidence_summary": { + "documents": 0, + "facts": 0, + "entities": 0, + "workflows": 0, + "relations": 0, + "chunks": 0, + "selected_doc_ids": [], + "selected_fact_ids": [], + "selected_relation_ids": [], + "selected_chunk_ids": [], + "entity_hits": 0, + "openapi_signals": { + "path_found": false, + "method_found": false, + "operation_semantics_found": false, + "request_payload_found": false, + "request_schema": false, + "request_fields_found": false, + "response_payload_found": false, + "response_schema": false, + "response_fields_found": false, + "status_codes": false, + "content_type_found": false, + "examples_found": false, + "payload_description": false + } + }, + "gate_decision": "reject", + "gate_decision_reason": "not_found_exact_anchor", + "gate_missing_requirements": [ + "retrieval_non_empty", + "exact_anchor_match" + ], + "gate_satisfied_requirements": [], + "openapi_evidence": { + "path_found": false, + "method_found": false, + "operation_semantics_found": false, + "request_payload_found": false, + "request_schema": false, + "request_fields_found": false, + "response_payload_found": false, + "response_schema": false, + "response_fields_found": false, + "status_codes": false, + "content_type_found": false, + "examples_found": false, + "payload_description": false + }, + "requested_fragment_type": null, + "fragment_evidence_found": [], + "fragment_missing_requirements": [], + "prompt": { + "prompt_name": "docs_explain_answer", + "system_prompt": "Ты объясняешь документацию системы.\n\nНа вход приходит JSON с полями:\n- question\n- intent\n- sub_intent\n- documents\n- facts\n- relations\n\nПравила:\n- Используй только предоставленные факты\n- Не додумывай\n- Если данных недостаточно, скажи это явно\n- Объясняй структурировано\n\nФормат ответа:\n1. Краткое описание\n2. Основные элементы\n3. Как это работает\n4. Связи с другими частями системы (если есть)", + "user_prompt": "{\n \"question\": \"как работает метод /health\",\n \"intent\": \"DOCUMENTATION_EXPLAIN\",\n \"sub_intent\": \"API_METHOD_EXPLAIN\",\n \"documents\": [],\n \"facts\": [],\n \"entities\": [],\n \"workflows\": [],\n \"relations\": [],\n \"chunks\": []\n}", + "log_context": "graph.project_qa.docs.answer", + "prompt_stats": { + "system_chars": 393, + "user_chars": 227, + "tokens_in_estimate": 155 + } + }, + "answer_mode": "degraded", + "degrade_reason": "not_found_exact_anchor", + "degraded_reason": "not_found_exact_anchor", + "code_intents_stubbed": false + } + } + } +} +``` + +## Step finalize +```json +{ + "status": "started", + "details": {} +} +``` + +## Event user +```json +{ + "source": "agent", + "text": "Не найдено точное совпадение по запрошенному docs anchor.", + "payload": {}, + "created_at": "2026-03-26T20:30:24.177128+00:00" +} +``` + +## Event status +```json +{ + "source": "orchestrator", + "text": "Обработка запроса завершена.", + "payload": {}, + "created_at": "2026-03-26T20:30:24.177918+00:00" +} +``` + +## Step finalize +```json +{ + "status": "completed", + "details": {} +} +``` + +## Result +```json +{ + "status": "done", + "answer": "Не найдено точное совпадение по запрошенному docs anchor.", + "completed_at": "2026-03-26T20:30:24.178650+00:00" +} +``` diff --git a/runtime_traces/agent_requests/20260326/req_9827472a716044cf983328dc959c4042.md b/runtime_traces/agent_requests/20260326/req_9827472a716044cf983328dc959c4042.md new file mode 100644 index 0000000..bf84231 --- /dev/null +++ b/runtime_traces/agent_requests/20260326/req_9827472a716044cf983328dc959c4042.md @@ -0,0 +1,130 @@ +# Request Trace: req_9827472a716044cf983328dc959c4042 + +- session_id: as_1d66a74b9e594dcca5648c964164d540 +- active_rag_session_id: 69c34e19-c302-4510-b0fb-9ec64cf381aa +- process_version: v1 +- created_at: 2026-03-26T19:26:38.681374+00:00 + +## User Message +проверка связи + +## Step bootstrap +```json +{ + "status": "started", + "details": {} +} +``` + +## Event status +```json +{ + "source": "orchestrator", + "text": "Запрос принят и поставлен в обработку.", + "payload": {}, + "created_at": "2026-03-26T19:26:38.682328+00:00" +} +``` + +## Event status +```json +{ + "source": "orchestrator", + "text": "Запускаю процесс обработки v1.", + "payload": { + "process_version": "v1" + }, + "created_at": "2026-03-26T19:26:38.682413+00:00" +} +``` + +## Step bootstrap +```json +{ + "status": "completed", + "details": {} +} +``` + +## Step run_llm +```json +{ + "status": "started", + "details": {} +} +``` + +## Event status +```json +{ + "source": "llm_process", + "text": "Отправляю запрос пользователя в LLM.", + "payload": {}, + "created_at": "2026-03-26T19:26:38.682589+00:00" +} +``` + +## Event status +```json +{ + "source": "llm_process", + "text": "Ответ от LLM получен.", + "payload": {}, + "created_at": "2026-03-26T19:26:39.482668+00:00" +} +``` + +## Step run_llm +```json +{ + "status": "completed", + "details": { + "answer_length": 33 + } +} +``` + +## Step finalize +```json +{ + "status": "started", + "details": {} +} +``` + +## Event user +```json +{ + "source": "agent", + "text": "Связь в норме, вас хорошо слышно!", + "payload": {}, + "created_at": "2026-03-26T19:26:39.485479+00:00" +} +``` + +## Event status +```json +{ + "source": "orchestrator", + "text": "Обработка запроса завершена.", + "payload": {}, + "created_at": "2026-03-26T19:26:39.486541+00:00" +} +``` + +## Step finalize +```json +{ + "status": "completed", + "details": {} +} +``` + +## Result +```json +{ + "status": "done", + "answer": "Связь в норме, вас хорошо слышно!", + "completed_at": "2026-03-26T19:26:39.487945+00:00" +} +``` diff --git a/runtime_traces/agent_requests/20260326/req_bc0ca07c5a344978bdbfa3311283f4c8.md b/runtime_traces/agent_requests/20260326/req_bc0ca07c5a344978bdbfa3311283f4c8.md new file mode 100644 index 0000000..e514cc6 --- /dev/null +++ b/runtime_traces/agent_requests/20260326/req_bc0ca07c5a344978bdbfa3311283f4c8.md @@ -0,0 +1,507 @@ +# Request Trace: req_bc0ca07c5a344978bdbfa3311283f4c8 + +- session_id: as_d77b5786695d4968a0d7faac4292f7bb +- active_rag_session_id: 47aeddca-0011-45e4-b99c-70f1a242f2e4 +- process_version: v2 +- created_at: 2026-03-26T20:23:49.781134+00:00 + +## User Message +Как работает метод /health + +## Step bootstrap +```json +{ + "status": "started", + "details": {} +} +``` + +## Event status +```json +{ + "source": "orchestrator", + "text": "Запрос принят и поставлен в обработку.", + "payload": {}, + "created_at": "2026-03-26T20:23:49.782470+00:00" +} +``` + +## Event status +```json +{ + "source": "orchestrator", + "text": "Запускаю процесс обработки v1.", + "payload": { + "process_version": "v2" + }, + "created_at": "2026-03-26T20:23:49.782560+00:00" +} +``` + +## Step bootstrap +```json +{ + "status": "completed", + "details": {} +} +``` + +## Step intent_router +```json +{ + "status": "started", + "details": {} +} +``` + +## Event status +```json +{ + "source": "intent_router", + "text": "Маршрутизирую запрос и определяю целевой workflow.", + "payload": {}, + "created_at": "2026-03-26T20:23:49.782839+00:00" +} +``` + +## Event status +```json +{ + "source": "intent_router", + "text": "Маршрут выбран: DOCUMENTATION_EXPLAIN / API_METHOD_EXPLAIN.", + "payload": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "API_METHOD_EXPLAIN", + "matched_intent_source": "deterministic" + }, + "created_at": "2026-03-26T20:23:49.785619+00:00" +} +``` + +## Step intent_router +```json +{ + "status": "completed", + "details": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "API_METHOD_EXPLAIN", + "matched_intent_source": "deterministic" + } +} +``` + +## Step workflow_documentation_explain +```json +{ + "status": "started", + "details": {} +} +``` + +## Event status +```json +{ + "source": "task_workflow", + "text": "Запускаю workflow docs_qa.", + "payload": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "API_METHOD_EXPLAIN" + }, + "created_at": "2026-03-26T20:23:49.786090+00:00" +} +``` + +## Event status +```json +{ + "source": "status.rag_retrieval", + "text": "RAG Retrieval", + "payload": { + "status_block": { + "id": "rag_retrieval", + "title": "RAG Retrieval", + "lines": [ + "planned_layers: D2_FACT_INDEX, D4_WORKFLOW_INDEX, D1_DOCUMENT_CATALOG, D0_DOC_CHUNKS", + "executed_layers: D2_FACT_INDEX, D4_WORKFLOW_INDEX, D1_DOCUMENT_CATALOG, D0_DOC_CHUNKS", + "D2_FACT_INDEX: 8 hits", + "D4_WORKFLOW_INDEX: 2 hits", + "D1_DOCUMENT_CATALOG: 4 hits", + "D0_DOC_CHUNKS: 4 hits" + ], + "append": false + }, + "kind": "task_progress" + }, + "created_at": "2026-03-26T20:23:52.332219+00:00" +} +``` + +## Event status +```json +{ + "source": "status.workflow", + "text": "Task Workflow", + "payload": { + "status_block": { + "id": "workflow", + "title": "Task Workflow", + "lines": [ + "workflow_id: docs_qa", + "prompt: docs_explain_answer", + "answer_mode: degraded" + ], + "append": false + }, + "kind": "task_progress" + }, + "created_at": "2026-03-26T20:23:52.332932+00:00" +} +``` + +## Event status +```json +{ + "source": "status.evidence_gate", + "text": "Evidence Gate", + "payload": { + "status_block": { + "id": "evidence_gate", + "title": "Evidence Gate", + "lines": [ + "decision: reject", + "reason: not_found_exact_anchor", + "missing: retrieval_non_empty, exact_anchor_match" + ], + "append": false + }, + "kind": "task_progress" + }, + "created_at": "2026-03-26T20:23:52.334102+00:00" +} +``` + +## Event status +```json +{ + "source": "rag_retrieval", + "text": "RAG retrieval завершен.", + "payload": { + "planned_layers": [ + "D2_FACT_INDEX", + "D4_WORKFLOW_INDEX", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "executed_layers": [ + "D2_FACT_INDEX", + "D4_WORKFLOW_INDEX", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "non_empty_layers": [ + "D2_FACT_INDEX", + "D4_WORKFLOW_INDEX", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ] + }, + "created_at": "2026-03-26T20:23:52.334498+00:00" +} +``` + +## Event status +```json +{ + "source": "evidence_gate", + "text": "Evidence gate оценен.", + "payload": { + "decision": "reject", + "reason": "not_found_exact_anchor", + "missing": [ + "retrieval_non_empty", + "exact_anchor_match" + ], + "satisfied": [] + }, + "created_at": "2026-03-26T20:23:52.334791+00:00" +} +``` + +## Event status +```json +{ + "source": "workflow_result", + "text": "Workflow docs_qa завершен.", + "payload": { + "workflow_id": "docs_qa", + "result_type": "answer", + "answer_length": 57 + }, + "created_at": "2026-03-26T20:23:52.335076+00:00" +} +``` + +## Step workflow_documentation_explain +```json +{ + "status": "completed", + "details": { + "workflow_id": "docs_qa", + "meta": { + "workflow_id": "docs_qa", + "intent": "DOCUMENTATION_EXPLAIN", + "diagnostics": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "API_METHOD_EXPLAIN", + "layers_used": [ + "D2_FACT_INDEX", + "D4_WORKFLOW_INDEX", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "documents_found": 0, + "facts_found": 0, + "relations_found": 0, + "openapi_fields_extracted": 0, + "missing_required_fields": [], + "openapi_status": { + "has_path": false, + "has_method": false, + "has_request": false, + "has_response": false + }, + "prompt_used": "docs_explain_answer", + "llm_mode": "prose", + "output_valid": true, + "matched_intent_source": "deterministic", + "matched_anchor_type": "endpoint", + "matched_anchor_value": "/health", + "exact_anchor_match": false, + "docs_layers_requested": [ + "D2_FACT_INDEX", + "D4_WORKFLOW_INDEX", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "docs_layers_with_hits": [ + "D2_FACT_INDEX", + "D4_WORKFLOW_INDEX", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "planned_layers": [ + "D2_FACT_INDEX", + "D4_WORKFLOW_INDEX", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "executed_layers": [ + "D2_FACT_INDEX", + "D4_WORKFLOW_INDEX", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "non_empty_layers": [ + "D2_FACT_INDEX", + "D4_WORKFLOW_INDEX", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "layer_diagnostics": { + "D2_FACT_INDEX": { + "hits": 8, + "top_ids": [ + "8879bb1d923dff0d783ef202f98fdfe5b774870912b2cd261ae127003daffacb", + "5bc72ce58bd31c654a380034beb59f47224e9b03bd306503a7f0b8634008409d", + "5a471b2380ec55b5866b99bb337b92cb78b91051cf616593937f1603d1011fa6", + "a31bbca2eb31ffb6655bcec7ff07b8cf2b6c7416610cf58dfc1e0c737df12fe1", + "e64a6aebed07076a1cccb4d6537b5f54489e25eda776e0230b3c2ff1df2ae648" + ], + "top_sections": [ + "domain.runtime_health:mentions_entity", + "docs/README.md:doc_list_item" + ] + }, + "D4_WORKFLOW_INDEX": { + "hits": 2, + "top_ids": [ + "api.send_message_endpoint", + "api.control_actions_endpoint" + ], + "top_sections": [ + "Scenario" + ] + }, + "D1_DOCUMENT_CATALOG": { + "hits": 4, + "top_ids": [ + "domain.runtime_health", + "docs/README.md", + "logic.telegram_notification_loop", + "architecture.telegram_notify_app" + ], + "top_sections": [ + "Сущность runtime health", + "Readme", + "Цикл отправки уведомлений в Telegram", + "Архитектура Telegram Notify App" + ] + }, + "D0_DOC_CHUNKS": { + "hits": 4, + "top_ids": [ + "domain.runtime_health", + "docs/README.md", + "logic.telegram_notification_loop" + ], + "top_sections": [ + "domain.runtime_health:Details", + "domain.runtime_health:Summary", + "docs/README.md:Навигация", + "logic.telegram_notification_loop:Details" + ] + } + }, + "query_entity_candidates": [], + "resolved_entity_candidates": [], + "query_anchor_candidates": [ + "/health" + ], + "resolved_anchor_candidates": [], + "anchor_candidates": [], + "selected_anchor": null, + "anchor_selection_reason": "", + "anchor_match_type": "", + "doc_ids": [], + "doc_paths": [], + "doc_titles": [], + "relation_hits_count": 0, + "relation_targets": [], + "selected_doc_ids": [], + "selected_fact_ids": [], + "selected_relation_ids": [], + "selected_chunk_ids": [], + "selected_entity_ids": [], + "selected_workflow_ids": [], + "fallback_doc_hits_count": 0, + "fallback_used": false, + "fact_hits": 0, + "entity_hits": 0, + "evidence_summary": { + "documents": 0, + "facts": 0, + "entities": 0, + "workflows": 0, + "relations": 0, + "chunks": 0, + "selected_doc_ids": [], + "selected_fact_ids": [], + "selected_relation_ids": [], + "selected_chunk_ids": [], + "entity_hits": 0, + "openapi_signals": { + "path_found": false, + "method_found": false, + "operation_semantics_found": false, + "request_payload_found": false, + "request_schema": false, + "request_fields_found": false, + "response_payload_found": false, + "response_schema": false, + "response_fields_found": false, + "status_codes": false, + "content_type_found": false, + "examples_found": false, + "payload_description": false + } + }, + "gate_decision": "reject", + "gate_decision_reason": "not_found_exact_anchor", + "gate_missing_requirements": [ + "retrieval_non_empty", + "exact_anchor_match" + ], + "gate_satisfied_requirements": [], + "openapi_evidence": { + "path_found": false, + "method_found": false, + "operation_semantics_found": false, + "request_payload_found": false, + "request_schema": false, + "request_fields_found": false, + "response_payload_found": false, + "response_schema": false, + "response_fields_found": false, + "status_codes": false, + "content_type_found": false, + "examples_found": false, + "payload_description": false + }, + "requested_fragment_type": null, + "fragment_evidence_found": [], + "fragment_missing_requirements": [], + "prompt": { + "prompt_name": "docs_explain_answer", + "system_prompt": "Ты объясняешь документацию системы.\n\nНа вход приходит JSON с полями:\n- question\n- intent\n- sub_intent\n- documents\n- facts\n- relations\n\nПравила:\n- Используй только предоставленные факты\n- Не додумывай\n- Если данных недостаточно, скажи это явно\n- Объясняй структурировано\n\nФормат ответа:\n1. Краткое описание\n2. Основные элементы\n3. Как это работает\n4. Связи с другими частями системы (если есть)", + "user_prompt": "{\n \"question\": \"Как работает метод /health\",\n \"intent\": \"DOCUMENTATION_EXPLAIN\",\n \"sub_intent\": \"API_METHOD_EXPLAIN\",\n \"documents\": [],\n \"facts\": [],\n \"entities\": [],\n \"workflows\": [],\n \"relations\": [],\n \"chunks\": []\n}", + "log_context": "graph.project_qa.docs.answer", + "prompt_stats": { + "system_chars": 393, + "user_chars": 227, + "tokens_in_estimate": 155 + } + }, + "answer_mode": "degraded", + "degrade_reason": "not_found_exact_anchor", + "degraded_reason": "not_found_exact_anchor", + "code_intents_stubbed": false + } + } + } +} +``` + +## Step finalize +```json +{ + "status": "started", + "details": {} +} +``` + +## Event user +```json +{ + "source": "agent", + "text": "Не найдено точное совпадение по запрошенному docs anchor.", + "payload": {}, + "created_at": "2026-03-26T20:23:52.338517+00:00" +} +``` + +## Event status +```json +{ + "source": "orchestrator", + "text": "Обработка запроса завершена.", + "payload": {}, + "created_at": "2026-03-26T20:23:52.339122+00:00" +} +``` + +## Step finalize +```json +{ + "status": "completed", + "details": {} +} +``` + +## Result +```json +{ + "status": "done", + "answer": "Не найдено точное совпадение по запрошенному docs anchor.", + "completed_at": "2026-03-26T20:23:52.342384+00:00" +} +``` diff --git a/runtime_traces/agent_requests/20260326/req_c1a55e97a0aa45ce8c4c6c453a9ec080.md b/runtime_traces/agent_requests/20260326/req_c1a55e97a0aa45ce8c4c6c453a9ec080.md new file mode 100644 index 0000000..524bee6 --- /dev/null +++ b/runtime_traces/agent_requests/20260326/req_c1a55e97a0aa45ce8c4c6c453a9ec080.md @@ -0,0 +1,555 @@ +# Request Trace: req_c1a55e97a0aa45ce8c4c6c453a9ec080 + +- session_id: as_9d330fb7437341f18539f819dcace95f +- active_rag_session_id: 34007a57-cf69-45f1-a0cd-c6a39bd81d42 +- process_version: v2 +- created_at: 2026-03-26T20:17:51.253164+00:00 + +## User Message +опиши сущность runtime health + +## Step bootstrap +```json +{ + "status": "started", + "details": {} +} +``` + +## Event status +```json +{ + "source": "orchestrator", + "text": "Запрос принят и поставлен в обработку.", + "payload": {}, + "created_at": "2026-03-26T20:17:51.255051+00:00" +} +``` + +## Event status +```json +{ + "source": "orchestrator", + "text": "Запускаю процесс обработки v1.", + "payload": { + "process_version": "v2" + }, + "created_at": "2026-03-26T20:17:51.255274+00:00" +} +``` + +## Step bootstrap +```json +{ + "status": "completed", + "details": {} +} +``` + +## Step intent_router +```json +{ + "status": "started", + "details": {} +} +``` + +## Event status +```json +{ + "source": "intent_router", + "text": "Маршрутизирую запрос и определяю целевой workflow.", + "payload": {}, + "created_at": "2026-03-26T20:17:51.255716+00:00" +} +``` + +## Event status +```json +{ + "source": "intent_router", + "text": "Маршрут выбран: DOCUMENTATION_EXPLAIN / ENTITY_EXPLAIN.", + "payload": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "ENTITY_EXPLAIN", + "matched_intent_source": "deterministic" + }, + "created_at": "2026-03-26T20:17:51.267550+00:00" +} +``` + +## Step intent_router +```json +{ + "status": "completed", + "details": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "ENTITY_EXPLAIN", + "matched_intent_source": "deterministic" + } +} +``` + +## Step workflow_documentation_explain +```json +{ + "status": "started", + "details": {} +} +``` + +## Event status +```json +{ + "source": "task_workflow", + "text": "Запускаю workflow docs_qa.", + "payload": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "ENTITY_EXPLAIN" + }, + "created_at": "2026-03-26T20:17:51.268352+00:00" +} +``` + +## Event status +```json +{ + "source": "status.rag_retrieval", + "text": "RAG Retrieval", + "payload": { + "status_block": { + "id": "rag_retrieval", + "title": "RAG Retrieval", + "lines": [ + "planned_layers: D3_ENTITY_CATALOG, D5_RELATION_GRAPH, D1_DOCUMENT_CATALOG, D0_DOC_CHUNKS", + "executed_layers: D3_ENTITY_CATALOG, D5_RELATION_GRAPH, D1_DOCUMENT_CATALOG, D0_DOC_CHUNKS", + "D3_ENTITY_CATALOG: 8 hits", + "D5_RELATION_GRAPH: 8 hits", + "D1_DOCUMENT_CATALOG: 4 hits", + "D0_DOC_CHUNKS: 4 hits" + ], + "append": false + }, + "kind": "task_progress" + }, + "created_at": "2026-03-26T20:17:58.665245+00:00" +} +``` + +## Event status +```json +{ + "source": "status.workflow", + "text": "Task Workflow", + "payload": { + "status_block": { + "id": "workflow", + "title": "Task Workflow", + "lines": [ + "workflow_id: docs_qa", + "prompt: docs_explain_answer", + "answer_mode: answered" + ], + "append": false + }, + "kind": "task_progress" + }, + "created_at": "2026-03-26T20:17:58.666116+00:00" +} +``` + +## Event status +```json +{ + "source": "status.evidence_gate", + "text": "Evidence Gate", + "payload": { + "status_block": { + "id": "evidence_gate", + "title": "Evidence Gate", + "lines": [ + "decision: allow", + "reason: evidence_sufficient", + "satisfied: retrieval_non_empty, exact_anchor_match" + ], + "append": false + }, + "kind": "task_progress" + }, + "created_at": "2026-03-26T20:17:58.666391+00:00" +} +``` + +## Event status +```json +{ + "source": "rag_retrieval", + "text": "RAG retrieval завершен.", + "payload": { + "planned_layers": [ + "D3_ENTITY_CATALOG", + "D5_RELATION_GRAPH", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "executed_layers": [ + "D3_ENTITY_CATALOG", + "D5_RELATION_GRAPH", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "non_empty_layers": [ + "D3_ENTITY_CATALOG", + "D5_RELATION_GRAPH", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ] + }, + "created_at": "2026-03-26T20:17:58.666626+00:00" +} +``` + +## Event status +```json +{ + "source": "evidence_gate", + "text": "Evidence gate оценен.", + "payload": { + "decision": "allow", + "reason": "evidence_sufficient", + "missing": [], + "satisfied": [ + "retrieval_non_empty", + "exact_anchor_match" + ] + }, + "created_at": "2026-03-26T20:17:58.666964+00:00" +} +``` + +## Event status +```json +{ + "source": "workflow_result", + "text": "Workflow docs_qa завершен.", + "payload": { + "workflow_id": "docs_qa", + "result_type": "answer", + "answer_length": 1619 + }, + "created_at": "2026-03-26T20:17:58.667219+00:00" +} +``` + +## Step workflow_documentation_explain +```json +{ + "status": "completed", + "details": { + "workflow_id": "docs_qa", + "meta": { + "workflow_id": "docs_qa", + "intent": "DOCUMENTATION_EXPLAIN", + "diagnostics": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "ENTITY_EXPLAIN", + "layers_used": [ + "D3_ENTITY_CATALOG", + "D5_RELATION_GRAPH", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "documents_found": 1, + "facts_found": 0, + "relations_found": 2, + "openapi_fields_extracted": 0, + "missing_required_fields": [], + "openapi_status": { + "has_path": false, + "has_method": false, + "has_request": false, + "has_response": false + }, + "prompt_used": "docs_explain_answer", + "llm_mode": "prose", + "output_valid": true, + "matched_intent_source": "deterministic", + "matched_anchor_type": "entity", + "matched_anchor_value": "runtime health", + "exact_anchor_match": true, + "docs_layers_requested": [ + "D3_ENTITY_CATALOG", + "D5_RELATION_GRAPH", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "docs_layers_with_hits": [ + "D3_ENTITY_CATALOG", + "D5_RELATION_GRAPH", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "planned_layers": [ + "D3_ENTITY_CATALOG", + "D5_RELATION_GRAPH", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "executed_layers": [ + "D3_ENTITY_CATALOG", + "D5_RELATION_GRAPH", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "non_empty_layers": [ + "D3_ENTITY_CATALOG", + "D5_RELATION_GRAPH", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "layer_diagnostics": { + "D3_ENTITY_CATALOG": { + "hits": 8, + "top_ids": [ + "architecture.telegram_notify_app", + "domain.runtime_health", + "logic.telegram_notification_loop" + ], + "top_sections": [ + "RuntimeManager", + "TelegramNotifyWorker", + "WorkerStatus", + "WorkerHealth" + ] + }, + "D5_RELATION_GRAPH": { + "hits": 8, + "top_ids": [ + "8595d7b82fecdb7ef579fa8961cda6799bb21970061e5bc221d4dd7a3d53fd04", + "801650f8bcbfbfbefd35c14447bfef7b3c3827313db790efa7faf47db860f8c4", + "79bdb0a74713df6064008179ca8c5c186dc23e4e1c5e2c9607b0bdddeba50f93", + "af2a4f7c1b677b908410ba720915405e10dbd0870e30a3c6e3aa2468550ddf0e", + "4e0bbeb8e97e25091a30412d8631b1d9f6bb58b5694d8b7cc632af69a9262ea8" + ], + "top_sections": [ + "domain.runtime_health:related_logic", + "domain.runtime_health:used_by", + "domain.runtime_health:parent", + "domain.runtime_health:part_of", + "architecture.telegram_notify_app:child" + ] + }, + "D1_DOCUMENT_CATALOG": { + "hits": 4, + "top_ids": [ + "domain.runtime_health", + "api.control_actions_endpoint", + "architecture.telegram_notify_app", + "logic.telegram_notification_loop" + ], + "top_sections": [ + "Сущность runtime health", + "HTTP API /actions/{action}", + "Архитектура Telegram Notify App", + "Цикл отправки уведомлений в Telegram" + ] + }, + "D0_DOC_CHUNKS": { + "hits": 4, + "top_ids": [ + "domain.runtime_health", + "docs/README.md", + "api.control_actions_endpoint" + ], + "top_sections": [ + "domain.runtime_health:Details", + "domain.runtime_health:Summary", + "docs/README.md:Навигация", + "api.control_actions_endpoint:Summary" + ] + } + }, + "query_entity_candidates": [ + "runtime health" + ], + "resolved_entity_candidates": [], + "query_anchor_candidates": [], + "resolved_anchor_candidates": [ + "domain.runtime_health", + "docs/documentation/domain/runtime-health-entity.md", + "docs/README.md" + ], + "anchor_candidates": [], + "selected_anchor": null, + "anchor_selection_reason": "", + "anchor_match_type": "", + "doc_ids": [ + "domain.runtime_health", + "docs/README.md" + ], + "doc_paths": [ + "docs/documentation/domain/runtime-health-entity.md", + "docs/README.md" + ], + "doc_titles": [ + "Сущность runtime health", + "domain.runtime_health:Details", + "domain.runtime_health:Summary", + "docs/README.md:Навигация", + "TelegramNotifyWorker", + "WorkerStatus", + "WorkerHealth", + "domain.runtime_health:related_logic", + "domain.runtime_health:used_by", + "domain.runtime_health:parent", + "domain.runtime_health:part_of" + ], + "relation_hits_count": 2, + "relation_targets": [ + "domain.runtime_health:related_logic", + "domain.runtime_health:used_by" + ], + "selected_doc_ids": [ + "domain.runtime_health" + ], + "selected_fact_ids": [], + "selected_relation_ids": [ + "8595d7b82fecdb7ef579fa8961cda6799bb21970061e5bc221d4dd7a3d53fd04", + "801650f8bcbfbfbefd35c14447bfef7b3c3827313db790efa7faf47db860f8c4" + ], + "selected_chunk_ids": [ + "domain.runtime_health" + ], + "selected_entity_ids": [ + "domain.runtime_health" + ], + "selected_workflow_ids": [], + "fallback_doc_hits_count": 2, + "fallback_used": false, + "fact_hits": 0, + "entity_hits": 0, + "evidence_summary": { + "documents": 1, + "facts": 0, + "entities": 2, + "workflows": 0, + "relations": 2, + "chunks": 1, + "selected_doc_ids": [ + "domain.runtime_health" + ], + "selected_fact_ids": [], + "selected_relation_ids": [ + "8595d7b82fecdb7ef579fa8961cda6799bb21970061e5bc221d4dd7a3d53fd04", + "801650f8bcbfbfbefd35c14447bfef7b3c3827313db790efa7faf47db860f8c4" + ], + "selected_chunk_ids": [ + "domain.runtime_health" + ], + "entity_hits": 0, + "openapi_signals": { + "path_found": false, + "method_found": false, + "operation_semantics_found": false, + "request_payload_found": false, + "request_schema": false, + "request_fields_found": false, + "response_payload_found": false, + "response_schema": false, + "response_fields_found": false, + "status_codes": false, + "content_type_found": false, + "examples_found": false, + "payload_description": false + } + }, + "gate_decision": "allow", + "gate_decision_reason": "evidence_sufficient", + "gate_missing_requirements": [], + "gate_satisfied_requirements": [ + "retrieval_non_empty", + "exact_anchor_match" + ], + "openapi_evidence": { + "path_found": false, + "method_found": false, + "operation_semantics_found": false, + "request_payload_found": false, + "request_schema": false, + "request_fields_found": false, + "response_payload_found": false, + "response_schema": false, + "response_fields_found": false, + "status_codes": false, + "content_type_found": false, + "examples_found": false, + "payload_description": false + }, + "requested_fragment_type": null, + "fragment_evidence_found": [], + "fragment_missing_requirements": [], + "prompt": { + "prompt_name": "docs_explain_answer", + "system_prompt": "Ты объясняешь документацию системы.\n\nНа вход приходит JSON с полями:\n- question\n- intent\n- sub_intent\n- documents\n- facts\n- relations\n\nПравила:\n- Используй только предоставленные факты\n- Не додумывай\n- Если данных недостаточно, скажи это явно\n- Объясняй структурировано\n\nФормат ответа:\n1. Краткое описание\n2. Основные элементы\n3. Как это работает\n4. Связи с другими частями системы (если есть)", + "user_prompt": "{\n \"question\": \"опиши сущность runtime health\",\n \"intent\": \"DOCUMENTATION_EXPLAIN\",\n \"sub_intent\": \"ENTITY_EXPLAIN\",\n \"documents\": [\n {\n \"layer\": \"D1_DOCUMENT_CATALOG\",\n \"path\": \"docs/documentation/domain/runtime-health-entity.md\",\n \"title\": \"Сущность runtime health\",\n \"content\": \"`runtime health` — доменная модель наблюдаемости сервиса, которая описывает общее состояние runtime и состояние отдельных компонентов. Для `test_echo_app` главным объектом наблюдения является компонент `telegram_notify`, у которого важны статус, время старта и количество успешных отправок. Эта модель используется для внешнего health-monitoring и внутренней диагностики.\",\n \"metadata\": {\n \"name\": \"runtime_health\",\n \"tags\": [\n \"domain\",\n \"health\",\n \"observability\"\n ],\n \"type\": \"domain_entity\",\n \"layer\": \"domain\",\n \"links\": [\n {\n \"type\": \"part_of\",\n \"target\": \"architecture.telegram_notify_app\"\n },\n {\n \"type\": \"used_by\",\n \"target\": \"api.health_endpoint\"\n },\n {\n \"type\": \"related_logic\",\n \"target\": \"logic.telegram_notification_loop\"\n }\n ],\n \"owner\": null,\n \"title\": \"Сущность runtime health\",\n \"doc_id\": null,\n \"module\": \"telegram_notify_app\",\n \"parent\": \"architecture.telegram_notify_app\",\n \"status\": \"draft\",\n \"repo_id\": \"/Users/alex/Dev_projects_v2/apps/test_echo_app\",\n \"section\": null,\n \"blob_sha\": \"37d4dcf470ea3de95d59e44786006e369a3ea11bf5dbf4c88877696e9183ee87\",\n \"children\": [],\n \"doc_kind\": \"misc\",\n \"entities\": [\n \"WorkerHealth\",\n \"WorkerStatus\",\n \"TelegramNotifyWorker\"\n ],\n \"updated_at\": \"2026-03-20\",\n \"doc_version\": null,\n \"document_id\": \"domain.runtime_health\",\n \"source_path\": \"docs/documentation/domain/runtime-health-entity.md\",\n \"summary_text\": \"`runtime health` — доменная модель наблюдаемости сервиса, которая описывает общее состояние runtime и состояние отдельных компонентов. Для `test_echo_app` главным объектом наблюдения является компонент `telegram_notify`, у которого важны статус, время старта и количество успешных отправок. Эта модель используется для внешнего health-monitoring и внутренней диагностики.\",\n \"artifact_type\": null,\n \"last_modified\": null,\n \"staleness_score\": null,\n \"system_component\": null\n }\n }\n ],\n \"facts\": [],\n \"entities\": [\n {\n \"layer\": \"D3_ENTITY_CATALOG\",\n \"path\": \"docs/documentation/domain/runtime-health-entity.md\",\n \"title\": \"TelegramNotifyWorker\",\n \"content\": \"TelegramNotifyWorker\",\n \"metadata\": {\n \"tags\": [\n \"domain\",\n \"health\",\n \"observability\"\n ],\n \"owner\": null,\n \"doc_id\": null,\n \"module\": \"telegram_notify_app\",\n \"repo_id\": \"/Users/alex/Dev_projects_v2/apps/test_echo_app\",\n \"section\": null,\n \"blob_sha\": \"37d4dcf470ea3de95d59e44786006e369a3ea11bf5dbf4c88877696e9183ee87\",\n \"doc_version\": null,\n \"document_id\": \"domain.runtime_health\",\n \"entity_name\": \"TelegramNotifyWorker\",\n \"source_path\": \"docs/documentation/domain/runtime-health-entity.md\",\n \"artifact_type\": null,\n \"document_type\": \"domain_entity\",\n \"last_modified\": null,\n \"staleness_score\": null,\n \"system_component\": null\n }\n },\n {\n \"layer\": \"D3_ENTITY_CATALOG\",\n \"path\": \"docs/documentation/domain/runtime-health-entity.md\",\n \"title\": \"WorkerStatus\",\n \"content\": \"WorkerStatus\",\n \"metadata\": {\n \"tags\": [\n \"domain\",\n \"health\",\n \"observability\"\n ],\n \"owner\": null,\n \"doc_id\": null,\n \"module\": \"telegram_notify_app\",\n \"repo_id\": \"/Users/alex/Dev_projects_v2/apps/test_echo_app\",\n \"section\": null,\n \"blob_sha\": \"37d4dcf470ea3de95d59e44786006e369a3ea11bf5dbf4c88877696e9183ee87\",\n \"doc_version\": null,\n \"document_id\": \"domain.runtime_health\",\n \"entity_name\": \"WorkerStatus\",\n \"source_path\": \"docs/documentation/domain/runtime-health-entity.md\",\n \"artifact_type\": null,\n \"document_type\": \"domain_entity\",\n \"last_modified\": null,\n \"staleness_score\": null,\n \"system_component\": null\n }\n }\n ],\n \"workflows\": [],\n \"relations\": [\n {\n \"layer\": \"D5_RELATION_GRAPH\",\n \"path\": \"docs/documentation/domain/runtime-health-entity.md\",\n \"title\": \"domain.runtime_health:related_logic\",\n \"content\": \"domain.runtime_health related_logic logic.telegram_notification_loop\",\n \"metadata\": {\n \"owner\": null,\n \"anchor\": \"frontmatter.links\",\n \"doc_id\": null,\n \"repo_id\": \"/Users/alex/Dev_projects_v2/apps/test_echo_app\",\n \"section\": null,\n \"blob_sha\": \"37d4dcf470ea3de95d59e44786006e369a3ea11bf5dbf4c88877696e9183ee87\",\n \"source_id\": \"domain.runtime_health\",\n \"target_id\": \"logic.telegram_notification_loop\",\n \"doc_version\": null,\n \"relation_id\": \"8595d7b82fecdb7ef579fa8961cda6799bb21970061e5bc221d4dd7a3d53fd04\",\n \"source_path\": \"docs/documentation/domain/runtime-health-entity.md\",\n \"artifact_type\": null,\n \"last_modified\": null,\n \"relation_type\": \"related_logic\",\n \"staleness_score\": null,\n \"system_component\": null\n }\n },\n {\n \"layer\": \"D5_RELATION_GRAPH\",\n \"path\": \"docs/documentation/domain/runtime-health-entity.md\",\n \"title\": \"domain.runtime_health:used_by\",\n \"content\": \"domain.runtime_health used_by api.health_endpoint\",\n \"metadata\": {\n \"owner\": null,\n \"anchor\": \"frontmatter.links\",\n \"doc_id\": null,\n \"repo_id\": \"/Users/alex/Dev_projects_v2/apps/test_echo_app\",\n \"section\": null,\n \"blob_sha\": \"37d4dcf470ea3de95d59e44786006e369a3ea11bf5dbf4c88877696e9183ee87\",\n \"source_id\": \"domain.runtime_health\",\n \"target_id\": \"api.health_endpoint\",\n \"doc_version\": null,\n \"relation_id\": \"801650f8bcbfbfbefd35c14447bfef7b3c3827313db790efa7faf47db860f8c4\",\n \"source_path\": \"docs/documentation/domain/runtime-health-entity.md\",\n \"artifact_type\": null,\n \"last_modified\": null,\n \"relation_type\": \"used_by\",\n \"staleness_score\": null,\n \"system_component\": null\n }\n }\n ],\n \"chunks\": [\n {\n \"layer\": \"D0_DOC_CHUNKS\",\n \"path\": \"docs/documentation/domain/runtime-health-entity.md\",\n \"title\": \"domain.runtime_health:Details\",\n \"content\": \"Health payload собирается runtime'ом и включает общий статус приложения и список компонентов. Для worker `telegram_notify` используются состояния `ok`, `degraded` и `unhealthy`, которые зависят от жизненного цикла фонового потока, наличия Telegram credentials и результата последней отправки.\\n\\nКлючевые metadata поля компонента — `app_started_at` и `notifications_sent`. Первое отражает UTC timestamp запуска worker'а, второе показывает число успешных доставок с момента старта runtime. Эти поля позволяют отделить реальный жизненный цикл worker'а от простого факта, что HTTP API отвечает.\\n\\nСущность `runtime health` связывает техническое состояние worker'а с операторским представлением сервиса. Через нее клиент `/health` получает не только общий статус процесса, но и диагностический контекст, достаточный для базового мониторинга и troubleshooting.\",\n \"metadata\": {\n \"tags\": [\n \"domain\",\n \"health\",\n \"observability\"\n ],\n \"type\": \"domain_entity\",\n \"order\": 2,\n \"owner\": null,\n \"doc_id\": null,\n \"module\": \"telegram_notify_app\",\n \"repo_id\": \"/Users/alex/Dev_projects_v2/apps/test_echo_app\",\n \"section\": null,\n \"blob_sha\": \"37d4dcf470ea3de95d59e44786006e369a3ea11bf5dbf4c88877696e9183ee87\",\n \"doc_kind\": \"misc\",\n \"doc_version\": null,\n \"document_id\": \"domain.runtime_health\",\n \"source_path\": \"docs/documentation/domain/runtime-health-entity.md\",\n \"section_path\": \"Details\",\n \"artifact_type\": null,\n \"last_modified\": null,\n \"section_title\": \"Details\",\n \"staleness_score\": null,\n \"system_component\": null\n }\n }\n ]\n}", + "log_context": "graph.project_qa.docs.answer", + "prompt_stats": { + "system_chars": 393, + "user_chars": 8418, + "tokens_in_estimate": 2203 + } + }, + "answer_mode": "answered", + "degrade_reason": null, + "degraded_reason": null, + "code_intents_stubbed": false + } + } + } +} +``` + +## Step finalize +```json +{ + "status": "started", + "details": {} +} +``` + +## Event user +```json +{ + "source": "agent", + "text": "### Описание сущности Runtime Health\n\n**Runtime Health** - это доменная модель наблюдаемости сервиса, описывающая текущее состояние runtime и его компонентов. Она предназначена для использования в системах внешнего health-monitoring и внутренней диагностики.\n\n---\n\n### Основные элементы\n\n1. **Компоненты**: \n - Главный объект наблюдения - компонент `telegram_notify`.\n \n2. **Метрики и атрибуты**:\n - Статус (`ok`, `degraded`, `unhealthy`), зависящий от жизненного цикла worker'а и результатов работы.\n - Время старта (`app_started_at`) - UTC timestamp начала работы worker'а.\n - Количество успешных отправок (`notifications_sent`) - число успешно выполненных задач с момента старта.\n\n3. **Связанные сущности**:\n - `WorkerHealth`\n - `WorkerStatus`\n - `TelegramNotifyWorker`\n\n---\n\n### Как это работает\n\nМодель собирает данные о состоянии worker'ов во время выполнения и предоставляет их через endpoint `/health`. Данные включают текущий статус приложения и подробную информацию по каждому компоненту, позволяя пользователям проводить мониторинг и диагностику.\n\nДля worker'а `telegram_notify` учитывается статус, который зависит от таких факторов как наличие credentials и успешность последних операций. Ключевая информация помогает определить реальное состояние worker'а, а не просто факт доступности HTTP API.\n\n---\n\n### Связи с другими частями системы\n\n- **Используется логикой**: логика `telegram_notification_loop` использует эту модель для отслеживания состояния worker'а.\n- **Используемый API**: данные из модели передаются на endpoint `/health`, обеспечивая внешнее наблюдение за состоянием системы.", + "payload": {}, + "created_at": "2026-03-26T20:17:58.668790+00:00" +} +``` + +## Event status +```json +{ + "source": "orchestrator", + "text": "Обработка запроса завершена.", + "payload": {}, + "created_at": "2026-03-26T20:17:58.671598+00:00" +} +``` + +## Step finalize +```json +{ + "status": "completed", + "details": {} +} +``` + +## Result +```json +{ + "status": "done", + "answer": "### Описание сущности Runtime Health\n\n**Runtime Health** - это доменная модель наблюдаемости сервиса, описывающая текущее состояние runtime и его компонентов. Она предназначена для использования в системах внешнего health-monitoring и внутренней диагностики.\n\n---\n\n### Основные элементы\n\n1. **Компоненты**: \n - Главный объект наблюдения - компонент `telegram_notify`.\n \n2. **Метрики и атрибуты**:\n - Статус (`ok`, `degraded`, `unhealthy`), зависящий от жизненного цикла worker'а и результатов работы.\n - Время старта (`app_started_at`) - UTC timestamp начала работы worker'а.\n - Количество успешных отправок (`notifications_sent`) - число успешно выполненных задач с момента старта.\n\n3. **Связанные сущности**:\n - `WorkerHealth`\n - `WorkerStatus`\n - `TelegramNotifyWorker`\n\n---\n\n### Как это работает\n\nМодель собирает данные о состоянии worker'ов во время выполнения и предоставляет их через endpoint `/health`. Данные включают текущий статус приложения и подробную информацию по каждому компоненту, позволяя пользователям проводить мониторинг и диагностику.\n\nДля worker'а `telegram_notify` учитывается статус, который зависит от таких факторов как наличие credentials и успешность последних операций. Ключевая информация помогает определить реальное состояние worker'а, а не просто факт доступности HTTP API.\n\n---\n\n### Связи с другими частями системы\n\n- **Используется логикой**: логика `telegram_notification_loop` использует эту модель для отслеживания состояния worker'а.\n- **Используемый API**: данные из модели передаются на endpoint `/health`, обеспечивая внешнее наблюдение за состоянием системы.", + "completed_at": "2026-03-26T20:17:58.672309+00:00" +} +``` diff --git a/runtime_traces/agent_requests/20260327/req_c0af91b38de3436e82a75b9c3664c95a.md b/runtime_traces/agent_requests/20260327/req_c0af91b38de3436e82a75b9c3664c95a.md new file mode 100644 index 0000000..e32fb3e --- /dev/null +++ b/runtime_traces/agent_requests/20260327/req_c0af91b38de3436e82a75b9c3664c95a.md @@ -0,0 +1,550 @@ +# Request Trace: req_c0af91b38de3436e82a75b9c3664c95a + +- session_id: as_a4d91e7eca7547e0a37dc4dc6492cf9b +- active_rag_session_id: aa7d907e-2a76-4bf7-99dc-5a400a417f8c +- process_version: v2 +- created_at: 2026-03-27T05:24:20.178027+00:00 + +## User Message +Какие методы есть в API? + +## Step bootstrap +```json +{ + "status": "started", + "details": {} +} +``` + +## Event status +```json +{ + "source": "orchestrator", + "text": "Запрос принят и поставлен в обработку.", + "payload": {}, + "created_at": "2026-03-27T05:24:20.194032+00:00" +} +``` + +## Event status +```json +{ + "source": "orchestrator", + "text": "Запускаю процесс обработки v1.", + "payload": { + "process_version": "v2" + }, + "created_at": "2026-03-27T05:24:20.194168+00:00" +} +``` + +## Step bootstrap +```json +{ + "status": "completed", + "details": {} +} +``` + +## Step intent_router +```json +{ + "status": "started", + "details": {} +} +``` + +## Event status +```json +{ + "source": "intent_router", + "text": "Маршрутизирую запрос и определяю целевой workflow.", + "payload": {}, + "created_at": "2026-03-27T05:24:20.198014+00:00" +} +``` + +## Event status +```json +{ + "source": "intent_router", + "text": "Маршрут выбран: DOCUMENTATION_EXPLAIN / API_METHOD_EXPLAIN.", + "payload": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "API_METHOD_EXPLAIN", + "matched_intent_source": "deterministic" + }, + "created_at": "2026-03-27T05:24:20.237289+00:00" +} +``` + +## Step intent_router +```json +{ + "status": "completed", + "details": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "API_METHOD_EXPLAIN", + "matched_intent_source": "deterministic" + } +} +``` + +## Step workflow_documentation_explain +```json +{ + "status": "started", + "details": {} +} +``` + +## Event status +```json +{ + "source": "task_workflow", + "text": "Запускаю workflow docs_qa.", + "payload": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "API_METHOD_EXPLAIN" + }, + "created_at": "2026-03-27T05:24:20.237970+00:00" +} +``` + +## Event status +```json +{ + "source": "status.rag_retrieval", + "text": "RAG Retrieval", + "payload": { + "status_block": { + "id": "rag_retrieval", + "title": "RAG Retrieval", + "lines": [ + "planned_layers: D2_FACT_INDEX, D4_WORKFLOW_INDEX, D1_DOCUMENT_CATALOG, D0_DOC_CHUNKS", + "executed_layers: D2_FACT_INDEX, D4_WORKFLOW_INDEX, D1_DOCUMENT_CATALOG, D0_DOC_CHUNKS", + "D2_FACT_INDEX: 8 hits", + "D4_WORKFLOW_INDEX: 2 hits", + "D1_DOCUMENT_CATALOG: 4 hits", + "D0_DOC_CHUNKS: 4 hits" + ], + "append": false + }, + "kind": "task_progress" + }, + "created_at": "2026-03-27T05:29:27.952296+00:00" +} +``` + +## Event status +```json +{ + "source": "status.workflow", + "text": "Task Workflow", + "payload": { + "status_block": { + "id": "workflow", + "title": "Task Workflow", + "lines": [ + "workflow_id: docs_qa", + "prompt: docs_explain_answer", + "answer_mode: answered" + ], + "append": false + }, + "kind": "task_progress" + }, + "created_at": "2026-03-27T05:29:27.954440+00:00" +} +``` + +## Event status +```json +{ + "source": "status.evidence_gate", + "text": "Evidence Gate", + "payload": { + "status_block": { + "id": "evidence_gate", + "title": "Evidence Gate", + "lines": [ + "decision: allow", + "reason: evidence_sufficient", + "satisfied: retrieval_non_empty" + ], + "append": false + }, + "kind": "task_progress" + }, + "created_at": "2026-03-27T05:29:27.955424+00:00" +} +``` + +## Event status +```json +{ + "source": "rag_retrieval", + "text": "RAG retrieval завершен.", + "payload": { + "planned_layers": [ + "D2_FACT_INDEX", + "D4_WORKFLOW_INDEX", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "executed_layers": [ + "D2_FACT_INDEX", + "D4_WORKFLOW_INDEX", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "non_empty_layers": [ + "D2_FACT_INDEX", + "D4_WORKFLOW_INDEX", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ] + }, + "created_at": "2026-03-27T05:29:27.956040+00:00" +} +``` + +## Event status +```json +{ + "source": "evidence_gate", + "text": "Evidence gate оценен.", + "payload": { + "decision": "allow", + "reason": "evidence_sufficient", + "missing": [], + "satisfied": [ + "retrieval_non_empty" + ] + }, + "created_at": "2026-03-27T05:29:27.956637+00:00" +} +``` + +## Event status +```json +{ + "source": "workflow_result", + "text": "Workflow docs_qa завершен.", + "payload": { + "workflow_id": "docs_qa", + "result_type": "answer", + "answer_length": 1418 + }, + "created_at": "2026-03-27T05:29:27.956966+00:00" +} +``` + +## Step workflow_documentation_explain +```json +{ + "status": "completed", + "details": { + "workflow_id": "docs_qa", + "meta": { + "workflow_id": "docs_qa", + "intent": "DOCUMENTATION_EXPLAIN", + "diagnostics": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "API_METHOD_EXPLAIN", + "layers_used": [ + "D2_FACT_INDEX", + "D4_WORKFLOW_INDEX", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "documents_found": 1, + "facts_found": 2, + "relations_found": 0, + "openapi_fields_extracted": 0, + "missing_required_fields": [], + "openapi_status": { + "has_path": false, + "has_method": false, + "has_request": false, + "has_response": false + }, + "prompt_used": "docs_explain_answer", + "llm_mode": "prose", + "output_valid": true, + "matched_intent_source": "deterministic", + "matched_anchor_type": "topic", + "matched_anchor_value": null, + "exact_anchor_match": false, + "docs_layers_requested": [ + "D2_FACT_INDEX", + "D4_WORKFLOW_INDEX", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "docs_layers_with_hits": [ + "D2_FACT_INDEX", + "D4_WORKFLOW_INDEX", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "planned_layers": [ + "D2_FACT_INDEX", + "D4_WORKFLOW_INDEX", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "executed_layers": [ + "D2_FACT_INDEX", + "D4_WORKFLOW_INDEX", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "non_empty_layers": [ + "D2_FACT_INDEX", + "D4_WORKFLOW_INDEX", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "layer_diagnostics": { + "D2_FACT_INDEX": { + "hits": 8, + "top_ids": [ + "80c5e54d5ebe430623c215b27c8f7112010666951d905f15e9f909a6caff517e", + "6bf0a662808009874a108d0c97f7cca7fc4ff7a3a3d66e0947b31bf813cfdf4d", + "7aefee9ff6110088aad1891da66fc9085eb3f77d832605a3da565deecb96e850", + "8c717a73b32f2f6d69293c34ce4804a82c168a9dc2d611465ab5563637c71fe0", + "149c4e0d3d34b3faba055b1495d54818fadc882af633da70035b82190c1bd327" + ], + "top_sections": [ + "api.send_message_endpoint:workflow_step", + "api.send_message_endpoint:mentions_entity" + ] + }, + "D4_WORKFLOW_INDEX": { + "hits": 2, + "top_ids": [ + "api.control_actions_endpoint", + "api.send_message_endpoint" + ], + "top_sections": [ + "Scenario" + ] + }, + "D1_DOCUMENT_CATALOG": { + "hits": 4, + "top_ids": [ + "api.send_message_endpoint", + "api.control_actions_endpoint", + "docs/README.md", + "domain.runtime_health" + ], + "top_sections": [ + "HTTP API /send", + "HTTP API /actions/{action}", + "Readme", + "Сущность runtime health" + ] + }, + "D0_DOC_CHUNKS": { + "hits": 4, + "top_ids": [ + "api.send_message_endpoint" + ], + "top_sections": [ + "api.send_message_endpoint:Описание", + "api.send_message_endpoint:Сценарий", + "api.send_message_endpoint:Summary", + "api.send_message_endpoint:Функциональные требования" + ] + } + }, + "query_entity_candidates": [], + "resolved_entity_candidates": [], + "query_anchor_candidates": [], + "resolved_anchor_candidates": [ + "docs/documentation/api/send-message-endpoint.md", + "api.control_actions_endpoint", + "docs/documentation/api/control-actions-endpoint.md", + "api.send_message_endpoint", + "docs/README.md", + "domain.runtime_health", + "docs/documentation/domain/runtime-health-entity.md" + ], + "anchor_candidates": [], + "selected_anchor": null, + "anchor_selection_reason": "", + "anchor_match_type": "", + "doc_ids": [ + "api.send_message_endpoint", + "api.control_actions_endpoint", + "api.actions_endpoint", + "docs/README.md", + "domain.runtime_health" + ], + "doc_paths": [ + "docs/documentation/api/send-message-endpoint.md", + "docs/documentation/api/control-actions-endpoint.md", + "docs/README.md", + "docs/documentation/domain/runtime-health-entity.md" + ], + "doc_titles": [ + "api.send_message_endpoint:workflow_step", + "api.send_message_endpoint:mentions_entity", + "Scenario", + "HTTP API /send", + "HTTP API /actions/{action}", + "Readme", + "Сущность runtime health", + "api.send_message_endpoint:Описание", + "api.send_message_endpoint:Сценарий", + "api.send_message_endpoint:Summary", + "api.send_message_endpoint:Функциональные требования" + ], + "relation_hits_count": 0, + "relation_targets": [], + "selected_doc_ids": [ + "api.send_message_endpoint", + "api.control_actions_endpoint" + ], + "selected_fact_ids": [ + "80c5e54d5ebe430623c215b27c8f7112010666951d905f15e9f909a6caff517e", + "8c717a73b32f2f6d69293c34ce4804a82c168a9dc2d611465ab5563637c71fe0" + ], + "selected_relation_ids": [], + "selected_chunk_ids": [ + "api.send_message_endpoint" + ], + "selected_entity_ids": [], + "selected_workflow_ids": [ + "f78b822d4366b10322fd4a35e347deae59d55ff4132951201f4df3d1653aec61" + ], + "fallback_doc_hits_count": 3, + "fallback_used": false, + "fact_hits": 2, + "entity_hits": 0, + "evidence_summary": { + "documents": 1, + "facts": 2, + "entities": 0, + "workflows": 1, + "relations": 0, + "chunks": 2, + "selected_doc_ids": [ + "api.send_message_endpoint", + "api.control_actions_endpoint" + ], + "selected_fact_ids": [ + "80c5e54d5ebe430623c215b27c8f7112010666951d905f15e9f909a6caff517e", + "8c717a73b32f2f6d69293c34ce4804a82c168a9dc2d611465ab5563637c71fe0" + ], + "selected_relation_ids": [], + "selected_chunk_ids": [ + "api.send_message_endpoint" + ], + "entity_hits": 0, + "openapi_signals": { + "path_found": false, + "method_found": false, + "operation_semantics_found": false, + "request_payload_found": false, + "request_schema": false, + "request_fields_found": false, + "response_payload_found": false, + "response_schema": false, + "response_fields_found": false, + "status_codes": false, + "content_type_found": false, + "examples_found": false, + "payload_description": false + } + }, + "gate_decision": "allow", + "gate_decision_reason": "evidence_sufficient", + "gate_missing_requirements": [], + "gate_satisfied_requirements": [ + "retrieval_non_empty" + ], + "openapi_evidence": { + "path_found": false, + "method_found": false, + "operation_semantics_found": false, + "request_payload_found": false, + "request_schema": false, + "request_fields_found": false, + "response_payload_found": false, + "response_schema": false, + "response_fields_found": false, + "status_codes": false, + "content_type_found": false, + "examples_found": false, + "payload_description": false + }, + "requested_fragment_type": null, + "fragment_evidence_found": [], + "fragment_missing_requirements": [], + "prompt": { + "prompt_name": "docs_explain_answer", + "system_prompt": "Ты объясняешь документацию системы.\n\nНа вход приходит JSON с полями:\n- question\n- intent\n- sub_intent\n- documents\n- facts\n- relations\n\nПравила:\n- Используй только предоставленные факты\n- Не додумывай\n- Если данных недостаточно, скажи это явно\n- Объясняй структурировано\n\nФормат ответа:\n1. Краткое описание\n2. Основные элементы\n3. Как это работает\n4. Связи с другими частями системы (если есть)", + "user_prompt": "{\n \"question\": \"Какие методы есть в API?\",\n \"intent\": \"DOCUMENTATION_EXPLAIN\",\n \"sub_intent\": \"API_METHOD_EXPLAIN\",\n \"documents\": [\n {\n \"layer\": \"D1_DOCUMENT_CATALOG\",\n \"path\": \"docs/documentation/api/send-message-endpoint.md\",\n \"title\": \"HTTP API /send\",\n \"content\": \"Endpoint `/send` выполняет ручную отправку сообщения в Telegram через `TelegramSendService`. Он используется для операторской проверки доставки и для отправки уведомлений вне периодического worker loop. Endpoint работает поверх тех же credentials и того же delivery path, что и фоновая отправка.\",\n \"metadata\": {\n \"name\": \"send_message_endpoint\",\n \"tags\": [\n \"api\",\n \"telegram\",\n \"manual-send\"\n ],\n \"type\": \"api_method\",\n \"layer\": \"application\",\n \"links\": [\n {\n \"type\": \"part_of\",\n \"target\": \"architecture.telegram_notify_app\"\n },\n {\n \"type\": \"depends_on\",\n \"target\": \"logic.telegram_notification_loop\"\n }\n ],\n \"owner\": null,\n \"title\": \"HTTP API /send\",\n \"doc_id\": null,\n \"module\": \"telegram_notify_app\",\n \"parent\": \"architecture.telegram_notify_app\",\n \"status\": \"draft\",\n \"repo_id\": \"/Users/alex/Dev_projects_v2/apps/test_echo_app\",\n \"section\": null,\n \"blob_sha\": \"5fbf2e33510b0676a3a53b957a4569bd3c2c31fb7719546602c573421ccaa32d\",\n \"children\": [],\n \"doc_kind\": \"misc\",\n \"entities\": [\n \"TelegramControlAppFactory\",\n \"TelegramSendService\",\n \"TelegramNotifyWorker\"\n ],\n \"updated_at\": \"2026-03-20\",\n \"doc_version\": null,\n \"document_id\": \"api.send_message_endpoint\",\n \"source_path\": \"docs/documentation/api/send-message-endpoint.md\",\n \"summary_text\": \"Endpoint `/send` выполняет ручную отправку сообщения в Telegram через `TelegramSendService`. Он используется для операторской проверки доставки и для отправки уведомлений вне периодического worker loop. Endpoint работает поверх тех же credentials и того же delivery path, что и фоновая отправка.\",\n \"artifact_type\": null,\n \"last_modified\": null,\n \"staleness_score\": null,\n \"system_component\": null\n }\n }\n ],\n \"facts\": [\n {\n \"layer\": \"D2_FACT_INDEX\",\n \"path\": \"docs/documentation/api/send-message-endpoint.md\",\n \"title\": \"api.send_message_endpoint:workflow_step\",\n \"content\": \"api.send_message_endpoint workflow_step Предусловия:**\",\n \"metadata\": {\n \"tags\": [],\n \"owner\": null,\n \"anchor\": \"Сценарий\",\n \"doc_id\": null,\n \"object\": \"Предусловия:**\",\n \"fact_id\": \"80c5e54d5ebe430623c215b27c8f7112010666951d905f15e9f909a6caff517e\",\n \"repo_id\": \"/Users/alex/Dev_projects_v2/apps/test_echo_app\",\n \"section\": null,\n \"blob_sha\": \"5fbf2e33510b0676a3a53b957a4569bd3c2c31fb7719546602c573421ccaa32d\",\n \"predicate\": \"workflow_step\",\n \"object_ref\": null,\n \"subject_id\": \"api.send_message_endpoint\",\n \"doc_version\": null,\n \"source_path\": \"docs/documentation/api/send-message-endpoint.md\",\n \"artifact_type\": null,\n \"last_modified\": null,\n \"staleness_score\": null,\n \"system_component\": null\n }\n },\n {\n \"layer\": \"D2_FACT_INDEX\",\n \"path\": \"docs/documentation/api/send-message-endpoint.md\",\n \"title\": \"api.send_message_endpoint:mentions_entity\",\n \"content\": \"api.send_message_endpoint mentions_entity TelegramControlAppFactory\",\n \"metadata\": {\n \"tags\": [],\n \"owner\": null,\n \"anchor\": \"frontmatter.entities\",\n \"doc_id\": null,\n \"object\": \"TelegramControlAppFactory\",\n \"fact_id\": \"8c717a73b32f2f6d69293c34ce4804a82c168a9dc2d611465ab5563637c71fe0\",\n \"repo_id\": \"/Users/alex/Dev_projects_v2/apps/test_echo_app\",\n \"section\": null,\n \"blob_sha\": \"5fbf2e33510b0676a3a53b957a4569bd3c2c31fb7719546602c573421ccaa32d\",\n \"predicate\": \"mentions_entity\",\n \"object_ref\": null,\n \"subject_id\": \"api.send_message_endpoint\",\n \"doc_version\": null,\n \"source_path\": \"docs/documentation/api/send-message-endpoint.md\",\n \"artifact_type\": null,\n \"last_modified\": null,\n \"staleness_score\": null,\n \"system_component\": null\n }\n }\n ],\n \"entities\": [],\n \"workflows\": [\n {\n \"layer\": \"D4_WORKFLOW_INDEX\",\n \"path\": \"docs/documentation/api/control-actions-endpoint.md\",\n \"title\": \"Scenario\",\n \"content\": \"Scenario\\nHTTP control plane запущен.\\n`ControlActionSet` сконфигурирован в `TelegramControlChannel`.\\nВ path передано одно из поддерживаемых действий: `start`, `stop`, `status`.\\nКлиент отправляет `GET` или `POST` на `/actions/{action}`.\\n1. Endpoint принимает запрос и извлекает path parameter `action`.\\n2. API определяет источник клиента через `X-Client-Source` или `User-Agent`.\\n3. Для `start` и `stop` запрос логируется как control action.\\n4. Канал сопоставляет `action` с callback из `ControlActionSet`.\\n5. API ожидает завершения callback в пределах допустимого timeout.\\n6. При успешном завершении API возвращает JSON со статусом `ok`.\\n1. Если `start` или `stop` не успевают завершиться в timeout, API возвращает `202 accepted` и сообщает, что операция еще выполняется.\",\n \"metadata\": {\n \"owner\": null,\n \"doc_id\": null,\n \"repo_id\": \"/Users/alex/Dev_projects_v2/apps/test_echo_app\",\n \"section\": null,\n \"trigger\": [\n \"Клиент отправляет `GET` или `POST` на `/actions/{action}`.\"\n ],\n \"blob_sha\": \"a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e\",\n \"main_flow\": [\n \"1. Endpoint принимает запрос и извлекает path parameter `action`.\",\n \"2. API определяет источник клиента через `X-Client-Source` или `User-Agent`.\",\n \"3. Для `start` и `stop` запрос логируется как control action.\",\n \"4. Канал сопоставляет `action` с callback из `ControlActionSet`.\",\n \"5. API ожидает завершения callback в пределах допустимого timeout.\",\n \"6. При успешном завершении API возвращает JSON со статусом `ok`.\"\n ],\n \"doc_version\": null,\n \"document_id\": \"api.control_actions_endpoint\",\n \"source_path\": \"docs/documentation/api/control-actions-endpoint.md\",\n \"workflow_id\": \"f78b822d4366b10322fd4a35e347deae59d55ff4132951201f4df3d1653aec61\",\n \"artifact_type\": null,\n \"last_modified\": null,\n \"preconditions\": [\n \"HTTP control plane запущен.\",\n \"`ControlActionSet` сконфигурирован в `TelegramControlChannel`.\",\n \"В path передано одно из поддерживаемых действий: `start`, `stop`, `status`.\"\n ],\n \"workflow_name\": \"Scenario\",\n \"error_handling\": [\n \"1. Если actions не сконфигурированы, API возвращает `404`.\",\n \"2. Если передано неподдерживаемое действие, API возвращает `404`.\",\n \"3. Если callback завершился исключением, API возвращает `500`.\"\n ],\n \"postconditions\": [\n \"Клиент получает результат выполнения control action или признак, что операция еще продолжается.\"\n ],\n \"staleness_score\": null,\n \"alternative_flow\": [\n \"1. Если `start` или `stop` не успевают завершиться в timeout, API возвращает `202 accepted` и сообщает, что операция еще выполняется.\"\n ],\n \"system_component\": null\n }\n }\n ],\n \"relations\": [],\n \"chunks\": [\n {\n \"layer\": \"D0_DOC_CHUNKS\",\n \"path\": \"docs/documentation/api/send-message-endpoint.md\",\n \"title\": \"api.send_message_endpoint:Описание\",\n \"content\": \"Метод принимает текст сообщения и инициирует разовую отправку в Telegram без ожидания планового интервала worker'а. Endpoint нужен для ручной диагностики канала доставки и для ad-hoc уведомлений.\",\n \"metadata\": {\n \"tags\": [\n \"api\",\n \"telegram\",\n \"manual-send\"\n ],\n \"type\": \"api_method\",\n \"order\": 3,\n \"owner\": null,\n \"doc_id\": null,\n \"module\": \"telegram_notify_app\",\n \"repo_id\": \"/Users/alex/Dev_projects_v2/apps/test_echo_app\",\n \"section\": null,\n \"blob_sha\": \"5fbf2e33510b0676a3a53b957a4569bd3c2c31fb7719546602c573421ccaa32d\",\n \"doc_kind\": \"misc\",\n \"doc_version\": null,\n \"document_id\": \"api.send_message_endpoint\",\n \"source_path\": \"docs/documentation/api/send-message-endpoint.md\",\n \"section_path\": \"Details > Описание\",\n \"artifact_type\": null,\n \"last_modified\": null,\n \"section_title\": \"Описание\",\n \"staleness_score\": null,\n \"system_component\": null\n }\n },\n {\n \"layer\": \"D0_DOC_CHUNKS\",\n \"path\": \"docs/documentation/api/send-message-endpoint.md\",\n \"title\": \"api.send_message_endpoint:Сценарий\",\n \"content\": \"**Название:** Ручная отправка сообщения в Telegram\\n\\n**Предусловия:**\\n- HTTP control plane запущен.\\n- Telegram credentials доступны в переменных окружения.\\n- Клиент передает непустой параметр `message`.\\n\\n**Триггер:**\\n- Клиент отправляет `GET /send?message=...`.\\n\\n**Основной сценарий:**\\n1. Endpoint принимает HTTP-запрос `GET /send`.\\n2. API извлекает query parameter `message`.\\n3. API проверяет, что сообщение не пустое.\\n4. Endpoint вызывает `TelegramSendService.send(message)`.\\n5. Сервис получает Telegram credentials из окружения.\\n6. Сервис вызывает Telegram Bot API для отправки сообщения.\\n7. API возвращает клиенту успешный JSON-ответ.\\n\\n**Альтернативный сценарий:**\\n1. Если credentials отсутствуют, сервис завершает вызов пользовательской ошибкой.\\n\\n**Обработка ошибок:**\\n1. Если `message` пустой или credentials не заданы, API возвращает `400`.\\n2. Если отправка завершилась непредвиденной ошибкой, API возвращает `500`.\\n\\n**Постусловие:**\\n- Сообщение либо отправлено в Telegram, либо клиент получил диагностическую ошибку.\",\n \"metadata\": {\n \"tags\": [\n \"api\",\n \"telegram\",\n \"manual-send\"\n ],\n \"type\": \"api_method\",\n \"order\": 4,\n \"owner\": null,\n \"doc_id\": null,\n \"module\": \"telegram_notify_app\",\n \"repo_id\": \"/Users/alex/Dev_projects_v2/apps/test_echo_app\",\n \"section\": null,\n \"blob_sha\": \"5fbf2e33510b0676a3a53b957a4569bd3c2c31fb7719546602c573421ccaa32d\",\n \"doc_kind\": \"misc\",\n \"doc_version\": null,\n \"document_id\": \"api.send_message_endpoint\",\n \"source_path\": \"docs/documentation/api/send-message-endpoint.md\",\n \"section_path\": \"Details > Сценарий\",\n \"artifact_type\": null,\n \"last_modified\": null,\n \"section_title\": \"Сценарий\",\n \"staleness_score\": null,\n \"system_component\": null\n }\n }\n ]\n}", + "log_context": "graph.project_qa.docs.answer", + "prompt_stats": { + "system_chars": 393, + "user_chars": 10838, + "tokens_in_estimate": 2808 + } + }, + "answer_mode": "answered", + "degrade_reason": null, + "degraded_reason": null, + "code_intents_stubbed": false + } + } + } +} +``` + +## Step finalize +```json +{ + "status": "started", + "details": {} +} +``` + +## Event user +```json +{ + "source": "agent", + "text": "### 1. Краткое описание\nДокументация описывает метод API `/send`, который предназначен для ручной отправки сообщений в Telegram. Метод позволяет операторам отправлять сообщения вручную без ожидания плановой отправки, а также использовать его для диагностики работы канала доставки.\n\n### 2. Основные элементы\n- **Метод**: `/send`\n- **Тип**: API метод\n- **Модуль**: telegram_notify_app\n- **Параметры запроса**: message (текст сообщения)\n- **Используемые сервисы**: TelegramSendService\n- **Зависимости**: credentials для доступа к Telegram API\n- **Сценарии использования**: диагностика канала доставки, оперативные уведомления\n\n### 3. Как это работает\n1. Пользователь отправляет GET-запрос на `/send` с параметром `message`.\n2. API извлекает значение параметра `message` и проверяет его на непустоту.\n3. Если проверка пройдена, вызывается метод `TelegramSendService.send(message)`.\n4. Service получает необходимые для отправки данные из окружения.\n5. Запускается вызов Telegram Bot API для отправки сообщения.\n6. В случае успешного завершения отправляется ответ клиенту с подтверждением успешной отправки.\n\n### 4. Связи с другими частями системы\n- Зависит от сервиса `TelegramSendService`.\n- Используется для диагностики и ручного управления каналом доставки вместе с компонентом `TelegramControlAppFactory`.\n- Работает поверх тех же credentials и пути доставки, что и фоновый механизм отправки сообщений (`worker loop`).", + "payload": {}, + "created_at": "2026-03-27T05:29:27.958501+00:00" +} +``` + +## Event status +```json +{ + "source": "orchestrator", + "text": "Обработка запроса завершена.", + "payload": {}, + "created_at": "2026-03-27T05:29:27.958731+00:00" +} +``` + +## Step finalize +```json +{ + "status": "completed", + "details": {} +} +``` + +## Result +```json +{ + "status": "done", + "answer": "### 1. Краткое описание\nДокументация описывает метод API `/send`, который предназначен для ручной отправки сообщений в Telegram. Метод позволяет операторам отправлять сообщения вручную без ожидания плановой отправки, а также использовать его для диагностики работы канала доставки.\n\n### 2. Основные элементы\n- **Метод**: `/send`\n- **Тип**: API метод\n- **Модуль**: telegram_notify_app\n- **Параметры запроса**: message (текст сообщения)\n- **Используемые сервисы**: TelegramSendService\n- **Зависимости**: credentials для доступа к Telegram API\n- **Сценарии использования**: диагностика канала доставки, оперативные уведомления\n\n### 3. Как это работает\n1. Пользователь отправляет GET-запрос на `/send` с параметром `message`.\n2. API извлекает значение параметра `message` и проверяет его на непустоту.\n3. Если проверка пройдена, вызывается метод `TelegramSendService.send(message)`.\n4. Service получает необходимые для отправки данные из окружения.\n5. Запускается вызов Telegram Bot API для отправки сообщения.\n6. В случае успешного завершения отправляется ответ клиенту с подтверждением успешной отправки.\n\n### 4. Связи с другими частями системы\n- Зависит от сервиса `TelegramSendService`.\n- Используется для диагностики и ручного управления каналом доставки вместе с компонентом `TelegramControlAppFactory`.\n- Работает поверх тех же credentials и пути доставки, что и фоновый механизм отправки сообщений (`worker loop`).", + "completed_at": "2026-03-27T05:29:27.959532+00:00" +} +``` diff --git a/src/app/main.py b/src/app/main.py index d5df92e..5155da3 100644 --- a/src/app/main.py +++ b/src/app/main.py @@ -27,7 +27,7 @@ def create_app() -> FastAPI: allow_headers=["*"], ) - app.include_router(modules.chat.public_router()) + app.include_router(modules.agent_api.public_router()) app.include_router(modules.rag.public_router()) app.include_router(modules.rag.internal_router()) app.include_router(modules.rag_repo.internal_router()) diff --git a/src/app/modules/agent/intent_router_v2/analysis/ambiguity_detector.py b/src/app/modules/agent/intent_router_v2/analysis/ambiguity_detector.py new file mode 100644 index 0000000..ba5b974 --- /dev/null +++ b/src/app/modules/agent/intent_router_v2/analysis/ambiguity_detector.py @@ -0,0 +1,64 @@ +from __future__ import annotations + +from app.modules.agent.intent_router_v2.analysis.docs_query_signals import DocsQuerySignals +from app.modules.agent.intent_router_v2.analysis.docs_sub_intent_detector import DocsSubIntentDetector + + +class DocsAmbiguityDetector: + _ALLOWED = { + "SYSTEM_FLOW_EXPLAIN", + "COMPONENT_EXPLAIN", + "API_METHOD_EXPLAIN", + "ENTITY_EXPLAIN", + "RELATED_DOCS_EXPLAIN", + "GENERIC_QA", + } + + def __init__( + self, + docs_signals: DocsQuerySignals | None = None, + detector: DocsSubIntentDetector | None = None, + ) -> None: + self._docs_signals = docs_signals or DocsQuerySignals() + self._detector = detector or DocsSubIntentDetector() + self._natural_entity_markers = ("runtime health", "статус воркера", "состояние runtime", "состояние воркера") + self._natural_flow_markers = ("health check runtime", "проверка состояния", "как работает health check", "как происходит проверка") + + def detect(self, query: str, *, intent: str, sub_intent: str) -> dict[str, object]: + if intent not in {"DOCUMENTATION_EXPLAIN", "GENERAL_QA"}: + return self._result(False, "", sub_intent, []) + candidates = [name for name, _ in self._detector.rank_candidates(query, intent="DOCUMENTATION_EXPLAIN") if name in self._ALLOWED] + if not candidates: + return self._result(False, "", sub_intent, []) + top_scores = self._detector.rank_candidates(query, intent="DOCUMENTATION_EXPLAIN") + score_map = {name: score for name, score in top_scores} + selected_score = int(score_map.get(sub_intent, 0)) + second_score = int(next((score for name, score in top_scores if name != sub_intent), 0)) + has_strong_anchor = bool(self._docs_signals.query_anchor_candidates(query)) or self._docs_signals.has_component_like_token(query) + if sub_intent == "GENERIC_QA" and has_strong_anchor: + return self._result(True, "general_vs_anchor_conflict", sub_intent, candidates[:4]) + if sub_intent != "GENERIC_QA" and self._looks_overview_like(query) and not has_strong_anchor: + return self._result(True, "overview_vs_explain_conflict", sub_intent, candidates[:4]) + if not has_strong_anchor and self._looks_natural_boundary(query): + return self._result(True, "natural_language_boundary", sub_intent, candidates[:4]) + if selected_score and second_score and selected_score - second_score <= 1 and second_score >= 2: + return self._result(True, "small_score_gap", sub_intent, candidates[:4]) + if not has_strong_anchor and selected_score <= 3 and second_score >= 1: + return self._result(True, "weak_deterministic_signal", sub_intent, candidates[:4]) + return self._result(False, "", sub_intent, candidates[:4]) + + def _looks_overview_like(self, query: str) -> bool: + text = " ".join((query or "").lower().split()) + return any(marker in text for marker in ("что есть в документации", "какая структура документации", "что описано", "обзор документации", "с чего начать")) + + def _looks_natural_boundary(self, query: str) -> bool: + text = " ".join((query or "").lower().split()) + return any(marker in text for marker in (*self._natural_entity_markers, *self._natural_flow_markers)) + + def _result(self, is_ambiguous: bool, reason: str, selected: str, candidates: list[str]) -> dict[str, object]: + return { + "is_ambiguous": is_ambiguous, + "ambiguity_reason": reason, + "deterministic_candidates": list(candidates), + "deterministic_primary_candidate": selected, + } diff --git a/src/app/modules/agent/intent_router_v2/analysis/docs_query_signals.py b/src/app/modules/agent/intent_router_v2/analysis/docs_query_signals.py new file mode 100644 index 0000000..1063ff0 --- /dev/null +++ b/src/app/modules/agent/intent_router_v2/analysis/docs_query_signals.py @@ -0,0 +1,75 @@ +from __future__ import annotations + +import re + + +class DocsQuerySignals: + _ENDPOINT_RE = re.compile(r"(?P/(?:[a-z0-9_-]+|{[a-z0-9_]+})(?:/(?:[a-z0-9_-]+|{[a-z0-9_]+}))*)", re.IGNORECASE) + _ENTITY_RE = re.compile(r"(?:entity|сущност[ьи]|модель|объект)\s+(?P[A-Za-z][A-Za-z0-9_-]+(?:\s+[A-Za-z][A-Za-z0-9_-]+)?)", re.IGNORECASE) + _COMPONENT_RE = re.compile(r"(?:component|компонент|service|module|модул[ья])\s+(?P[A-Za-z][A-Za-z0-9_-]+)", re.IGNORECASE) + _WORKFLOW_RE = re.compile(r"(?:workflow|сценарий|процесс|overview)\s+(?P[A-Za-zА-Яа-я0-9_-]+)", re.IGNORECASE) + _DOC_RE = re.compile(r"(?:document|документ|documentation|документац[ияи])\s+(?P[A-Za-zА-Яа-я0-9_.-]+)", re.IGNORECASE) + _CAMEL_RE = re.compile(r"\b(?P[A-Z][A-Za-z0-9]+(?:Manager|Worker|Channel|Service|Module|Status|Health)|[A-Z][a-z0-9]+(?:[A-Z][A-Za-z0-9]+)+)\b") + _QUOTED_RE = re.compile(r"[\"'«“](?P[^\"'»”]{2,})[\"'»”]") + _MULTIWORD_RE = re.compile(r"\b(runtime health|worker status|control plane)\b", re.IGNORECASE) + + def detect_anchor(self, raw: str) -> tuple[str, str | None]: + text = raw or "" + anchor_patterns = [ + ("entity", self._ENTITY_RE), + ("component", self._COMPONENT_RE), + ("workflow", self._WORKFLOW_RE), + ("document", self._DOC_RE), + ] + if not any(ext in text.lower() for ext in (".py", ".ts", ".js", ".java", ".go", ".rb")): + anchor_patterns.insert(0, ("endpoint", self._ENDPOINT_RE)) + for anchor_type, pattern in anchor_patterns: + match = pattern.search(text) + if match: + return anchor_type, str(match.group("value")).strip() + if any(marker in text.lower() for marker in ("api", "endpoint", "topic", "тема")): + return "topic", None + return "none", None + + def has_docs_anchor(self, raw: str) -> bool: + anchor_type, _ = self.detect_anchor(raw) + return anchor_type != "none" + + def query_entity_candidates(self, raw: str) -> list[str]: + text = raw or "" + values: list[str] = [] + for match in self._ENTITY_RE.finditer(text): + values.append(match.group("value").strip()) + for match in self._CAMEL_RE.finditer(text): + values.append(match.group("value").strip()) + for match in self._MULTIWORD_RE.finditer(text): + values.append(match.group(1).strip()) + return self._dedupe(values) + + def query_anchor_candidates(self, raw: str) -> list[str]: + text = raw or "" + values: list[str] = [] + for match in self._ENDPOINT_RE.finditer(text): + values.append(match.group("value").strip()) + for match in self._CAMEL_RE.finditer(text): + values.append(match.group("value").strip()) + for match in self._QUOTED_RE.finditer(text): + values.append(match.group("value").strip()) + return self._dedupe(values) + + def has_component_like_token(self, raw: str) -> bool: + return bool(self._CAMEL_RE.search(raw or "")) + + def _dedupe(self, values: list[str]) -> list[str]: + result: list[str] = [] + seen: set[str] = set() + for value in values: + normalized = value.strip() + if not normalized: + continue + key = normalized.lower() + if key in seen: + continue + seen.add(key) + result.append(normalized) + return result diff --git a/src/app/modules/agent/intent_router_v2/analysis/docs_sub_intent_detector.py b/src/app/modules/agent/intent_router_v2/analysis/docs_sub_intent_detector.py new file mode 100644 index 0000000..ce50f8a --- /dev/null +++ b/src/app/modules/agent/intent_router_v2/analysis/docs_sub_intent_detector.py @@ -0,0 +1,161 @@ +from __future__ import annotations + +import re + + +class DocsSubIntentDetector: + _ENTITY_LIKE_TOKEN_RE = re.compile(r"\b[A-Z][A-Za-z0-9]+(?:Health|Status|State)\b") + _CAMEL_ENTITY_CONTEXT_RE = re.compile(r"\b[A-Z][a-z0-9]+(?:[A-Z][A-Za-z0-9]+)+\b") + _RELATED_MARKERS = ( + "найди документацию", + "документация по", + "где в документации", + "что связано", + "связанные документы", + "что дальше читать", + "по каким документам идти", + "родительский документ", + "дочерние документы", + "какие документы", + "что еще посмотреть", + "где еще описано", + "где еще используется", + "с чем связан", + "какие страницы связаны", + ) + _FLOW_MARKERS = ( + "цикл", + "как работает", + "lifecycle", + "как происходит", + "как устроен", + "как устроена", + "как проходит", + "последовательность", + "шаги", + "флоу", + "flow", + "workflow", + "сценар", + "процесс", + "по шагам", + ) + _API_MARKERS = ( + "api", + "endpoint", + "method", + "route", + "handler", + "контракт", + "request", + "response", + "webhook", + "метод", + "эндпоинт", + "роут", + ) + _ENTITY_MARKERS = ( + "сущност", + "entity", + "модел", + "бизнес-объект", + "что такое", + "что за", + "объект", + "как используется", + ) + _COMPONENT_MARKERS = ( + "компонент", + "модул", + "сервис", + "класс", + "блок", + "подсистем", + "часть системы", + "роль", + "какую роль", + "manager", + "worker", + "channel", + "service", + "module", + ) + _GENERAL_MARKERS = ( + "что вообще", + "в целом", + "с чего начать", + "обзор", + "какая структура документации", + "какая документация есть", + "что описано", + "что есть в документации", + "обзор документации", + ) + _NATURAL_ENTITY_MARKERS = ("runtime health", "health state", "статус воркера", "состояние воркера", "состояние runtime") + _NATURAL_FLOW_MARKERS = ("health check runtime", "проверка состояния", "как работает health check", "как происходит проверка") + + def detect(self, raw: str, *, intent: str = "DOCUMENTATION_EXPLAIN") -> str: + candidates = self.rank_candidates(raw, intent=intent) + return candidates[0][0] if candidates else "COMPONENT_EXPLAIN" + + def rank_candidates(self, raw: str, *, intent: str = "DOCUMENTATION_EXPLAIN") -> list[tuple[str, int]]: + source = raw or "" + text = " ".join(source.lower().split()) + if intent == "GENERAL_QA": + return [("GENERIC_QA", 100)] + if intent == "OPENAPI_GENERATION": + return [(self._detect_openapi(text), 100)] + if not text: + return [("COMPONENT_EXPLAIN", 1)] + scores = { + "RELATED_DOCS_EXPLAIN": 0, + "API_METHOD_EXPLAIN": 0, + "ENTITY_EXPLAIN": 0, + "COMPONENT_EXPLAIN": 0, + "SYSTEM_FLOW_EXPLAIN": 0, + "GENERIC_QA": 0, + } + if any(marker in text for marker in self._RELATED_MARKERS): + scores["RELATED_DOCS_EXPLAIN"] += 8 + if self._has_http_path(text) or any(marker in text for marker in self._API_MARKERS): + scores["API_METHOD_EXPLAIN"] += 6 + if scores["RELATED_DOCS_EXPLAIN"] > 0 and scores["API_METHOD_EXPLAIN"] > 0: + scores["API_METHOD_EXPLAIN"] -= 2 + if any(marker in text for marker in self._ENTITY_MARKERS): + scores["ENTITY_EXPLAIN"] += 5 + if self._has_entity_like_camel_token(source): + scores["ENTITY_EXPLAIN"] += 3 + if self._looks_like_entity_question(text, source): + scores["ENTITY_EXPLAIN"] += 2 + if any(marker in text for marker in self._NATURAL_ENTITY_MARKERS): + scores["ENTITY_EXPLAIN"] += 3 + if any(marker in text for marker in self._COMPONENT_MARKERS): + scores["COMPONENT_EXPLAIN"] += 5 + if any(marker in text for marker in self._FLOW_MARKERS): + scores["SYSTEM_FLOW_EXPLAIN"] += 5 + if any(marker in text for marker in self._NATURAL_FLOW_MARKERS): + scores["SYSTEM_FLOW_EXPLAIN"] += 3 + if any(marker in text for marker in self._GENERAL_MARKERS): + scores["GENERIC_QA"] += 6 + if not any(scores.values()): + scores["COMPONENT_EXPLAIN"] = 1 + scores["GENERIC_QA"] = 1 + ranked = sorted(scores.items(), key=lambda item: (-item[1], item[0])) + return [item for item in ranked if item[1] > 0] + + def _detect_openapi(self, text: str) -> str: + markers = ("request", "response", "schema", "parameters", "fragment") + if any(marker in text for marker in markers): + return "OPENAPI_FRAGMENT_GENERATE" + return "OPENAPI_METHOD_GENERATE" + + def _has_http_path(self, text: str) -> bool: + return any(token.startswith("/") and len(token) > 1 for token in text.split()) + + def _has_entity_like_camel_token(self, raw: str) -> bool: + return bool(self._ENTITY_LIKE_TOKEN_RE.search(raw or "")) + + def _looks_like_entity_question(self, text: str, raw: str) -> bool: + if not any(marker in text for marker in ("что такое", "что за", "как используется")): + return False + return bool(self._CAMEL_ENTITY_CONTEXT_RE.search(raw or "")) diff --git a/src/app/modules/agent/intent_router_v2/analysis/query_plan_builder.py b/src/app/modules/agent/intent_router_v2/analysis/query_plan_builder.py index ce437b6..8777f19 100644 --- a/src/app/modules/agent/intent_router_v2/analysis/query_plan_builder.py +++ b/src/app/modules/agent/intent_router_v2/analysis/query_plan_builder.py @@ -3,6 +3,7 @@ from __future__ import annotations from app.modules.agent.intent_router_v2.analysis.anchor_extractor import AnchorExtractor from app.modules.agent.intent_router_v2.analysis.anchor_span_validator import AnchorSpanValidator from app.modules.agent.intent_router_v2.analysis.conversation_anchor_builder import ConversationAnchorBuilder +from app.modules.agent.intent_router_v2.analysis.docs_sub_intent_detector import DocsSubIntentDetector from app.modules.agent.intent_router_v2.analysis.keyword_hint_builder import KeywordHintBuilder from app.modules.agent.intent_router_v2.analysis.keyword_hint_sanitizer import KeywordHintSanitizer from app.modules.agent.intent_router_v2.models import ConversationState, QueryAnchor, QueryPlan @@ -14,6 +15,11 @@ from app.modules.agent.intent_router_v2.analysis.term_mapping import RuEnTermMap class QueryPlanBuilder: + _DOCS_INTENTS = { + "DOCUMENTATION_EXPLAIN", + "OPENAPI_GENERATION", + "GENERAL_QA", + } _WHY_MARKERS = ("почему", "зачем", "откуда", "из-за чего") _NEXT_STEP_MARKERS = ("что дальше", "дальше что", "и что теперь", "продолжай") _DOCS_TOPIC_HINTS = { @@ -35,6 +41,7 @@ class QueryPlanBuilder: carryover: ConversationAnchorBuilder | None = None, span_validator: AnchorSpanValidator | None = None, sub_intent_detector: SubIntentDetector | None = None, + docs_sub_intent_detector: DocsSubIntentDetector | None = None, negation_detector: NegationDetector | None = None, ) -> None: self._normalizer = normalizer or QueryNormalizer() @@ -45,6 +52,7 @@ class QueryPlanBuilder: self._carryover = carryover or ConversationAnchorBuilder() self._span_validator = span_validator or AnchorSpanValidator() self._sub_intent_detector = sub_intent_detector or SubIntentDetector() + self._docs_sub_intent_detector = docs_sub_intent_detector or DocsSubIntentDetector() self._negation_detector = negation_detector or NegationDetector() def build( @@ -54,7 +62,7 @@ class QueryPlanBuilder: continue_mode: bool, *, conversation_mode: str = "START", - intent: str = "PROJECT_MISC", + intent: str = "FALLBACK", ) -> QueryPlan: raw = user_query or "" normalized = self._normalizer.normalize(raw) @@ -75,8 +83,10 @@ class QueryPlanBuilder: skip_tests = "tests" in negations or is_negative_test_request(raw) cleaned_anchors = self._remove_negated_test_terms(skip_tests, merged_anchors) sub_intent = self._resolve_sub_intent(sub_intent, raw, cleaned_anchors, intent=intent, negations=negations) - if intent == "DOCS_QA": - sub_intent = "EXPLAIN" + if intent in self._DOCS_INTENTS: + sub_intent = self._docs_sub_intent_detector.detect(raw, intent=intent) + elif intent == "FALLBACK": + sub_intent = "GENERIC_QA" expansions = self._expansions(normalized, cleaned_anchors, skip_tests=skip_tests) keyword_hints = self._keyword_hints( raw, @@ -95,7 +105,7 @@ class QueryPlanBuilder: symbol_candidates = [] symbol_kind_hint = "unknown" doc_scope_hints = [] - if intent == "DOCS_QA": + if intent in self._DOCS_INTENTS: symbol_candidates = [] symbol_kind_hint = "unknown" keyword_hints = self._docs_keyword_hints(raw, keyword_hints) @@ -134,7 +144,7 @@ class QueryPlanBuilder: ) if ( conversation_mode == "SWITCH" - and intent == "DOCS_QA" + and intent in self._DOCS_INTENTS and not has_user_file and not has_user_symbol and state.active_symbol @@ -186,7 +196,7 @@ class QueryPlanBuilder: if skip_tests: values = [value for value in values if not is_test_related_token(value)] sanitized = self._keyword_hint_sanitizer.sanitize(raw, anchors, values) - if intent == "DOCS_QA" and not sanitized: + if intent in self._DOCS_INTENTS and not sanitized: fallback = list(dict.fromkeys([*self._expansions(normalized, anchors, skip_tests=skip_tests)])) sanitized = fallback[:3] if state.active_symbol and state.active_symbol not in sanitized: @@ -295,7 +305,7 @@ class QueryPlanBuilder: return result[:12] def _doc_scope_hints(self, intent: str, raw: str, keyword_hints: list[str], path_hints: list[str]) -> list[str]: - if intent != "DOCS_QA": + if intent not in self._DOCS_INTENTS: return [] values = list(path_hints) for candidate in ("README*", "docs/**", "**/*.md"): diff --git a/src/app/modules/agent/intent_router_v2/factory.py b/src/app/modules/agent/intent_router_v2/factory.py index c256a4e..6a5c65b 100644 --- a/src/app/modules/agent/intent_router_v2/factory.py +++ b/src/app/modules/agent/intent_router_v2/factory.py @@ -3,6 +3,7 @@ from __future__ import annotations from app.modules.agent.llm import AgentLlmService from app.modules.agent.llm.prompt_loader import PromptLoader from app.modules.agent.intent_router_v2.intent.classifier import IntentClassifierV2 +from app.modules.agent.intent_router_v2.intent.llm_disambiguator import DocsLlmDisambiguator from app.modules.agent.intent_router_v2.router import IntentRouterV2 from app.modules.shared.env_loader import load_workspace_env from app.modules.shared.gigachat.client import GigaChatClient @@ -19,4 +20,8 @@ class GigaChatIntentRouterFactory: prompt_loader = PromptLoader() llm = AgentLlmService(client=client, prompts=prompt_loader) classifier = IntentClassifierV2(llm=llm) - return IntentRouterV2(classifier=classifier) + return IntentRouterV2( + classifier=classifier, + llm_disambiguator=DocsLlmDisambiguator(llm), + enable_llm_disambiguation=True, + ) diff --git a/src/app/modules/agent/intent_router_v2/intent/classifier.py b/src/app/modules/agent/intent_router_v2/intent/classifier.py index fc86d49..380925a 100644 --- a/src/app/modules/agent/intent_router_v2/intent/classifier.py +++ b/src/app/modules/agent/intent_router_v2/intent/classifier.py @@ -3,6 +3,7 @@ from __future__ import annotations import json import re +from app.modules.agent.intent_router_v2.analysis.docs_query_signals import DocsQuerySignals from app.modules.agent.intent_router_v2.models import ConversationState, IntentDecision from app.modules.agent.intent_router_v2.protocols import TextGenerator from app.modules.agent.intent_router_v2.analysis.test_signals import has_test_focus @@ -23,6 +24,73 @@ class IntentClassifierV2: "write documentation", ) _DOCS_MARKERS = ("документац", "readme", "docs/", ".md", "spec", "runbook", "markdown") + _OPENAPI_MARKERS = ("openapi", "swagger", "yaml", "spec", "schema") + _OPENAPI_EXTENDED_MARKERS = ("request body", "response schema", "request schema", "response body") + _DOCS_RELATED_MARKERS = ( + "что связано", + "связанные документы", + "что дальше читать", + "по каким документам идти", + "родительский документ", + "дочерние документы", + "какие документы", + "что еще посмотреть", + "где еще описано", + "где еще используется", + "с чем связан", + "какие страницы связаны", + "документация по", + "найди", + "где описан", + "где в документации", + "покажи документы", + "после этого", + ) + _DOCS_EXPLAIN_MARKERS = ("объясни", "как работает", "что делает", "что такое") + _DOCS_FLOW_MARKERS = ( + "цикл", + "сценар", + "процесс", + "происходит", + "последовательность", + "шаги", + "как работает процесс", + "как происходит", + "как устроен процесс", + "workflow", + "flow", + "lifecycle", + "жизненный цикл", + ) + _DOCS_COMPONENT_MARKERS = ( + "компонент", + "модул", + "подсистем", + "часть системы", + "блок", + "роль", + "какую роль", + "что делает", + "как работает компонент", + "как устроен", + ) + _DOCS_ENTITY_MARKERS = ("сущност", "entity", "бизнес-объект", "объект", "как используется", "что такое") + _DOCS_API_MARKERS = ("api", "endpoint", "эндпоинт", "ручк", "request", "response") + _GENERAL_QA_MARKERS = ( + "помоги понять", + "с чего начать", + "как начать", + "куда смотреть", + "что тут важно", + "что вообще", + "в целом", + "обзор", + "какая структура документации", + "структура документации", + "какая документация есть", + "что описано в документации", + "что есть по сервису", + ) _CODE_MARKERS = ( "по коду", "код", @@ -45,6 +113,7 @@ class IntentClassifierV2: def __init__(self, llm: TextGenerator | None = None) -> None: self._llm = llm + self._docs_signals = DocsQuerySignals() def classify(self, user_query: str, conversation_state: ConversationState) -> IntentDecision: deterministic = self._deterministic(user_query) @@ -53,17 +122,27 @@ class IntentClassifierV2: llm_decision = self._classify_with_llm(user_query, conversation_state) if llm_decision: return llm_decision - return IntentDecision(intent="PROJECT_MISC", confidence=0.55, reason="fallback_project_misc") + return IntentDecision(intent="FALLBACK", confidence=0.55, reason="fallback") def _deterministic(self, user_query: str) -> IntentDecision | None: text = " ".join((user_query or "").lower().split()) if any(marker in text for marker in self._GENERATE_DOCS_MARKERS): return IntentDecision(intent="GENERATE_DOCS_FROM_CODE", confidence=0.97, reason="deterministic_generate_docs") + if any(marker in text for marker in (*self._OPENAPI_MARKERS, *self._OPENAPI_EXTENDED_MARKERS)): + return IntentDecision(intent="OPENAPI_GENERATION", confidence=0.98, reason="deterministic_openapi") + if self._is_general_docs_qa(text): + return IntentDecision(intent="GENERAL_QA", confidence=0.76, reason="deterministic_general_docs") + if self._is_docs_explain(text, user_query): + return IntentDecision(intent="DOCUMENTATION_EXPLAIN", confidence=0.91, reason="deterministic_docs_explain") + if self._is_related_docs(text): + return IntentDecision(intent="DOCUMENTATION_EXPLAIN", confidence=0.9, reason="deterministic_docs_related") + if not has_test_focus(text) and self._docs_signals.has_component_like_token(user_query) and not self._is_general_docs_qa(text): + return IntentDecision(intent="DOCUMENTATION_EXPLAIN", confidence=0.82, reason="deterministic_docs_component_anchor") if self._looks_like_docs_question(text): - return IntentDecision(intent="DOCS_QA", confidence=0.9, reason="deterministic_docs") + return IntentDecision(intent="DOCUMENTATION_EXPLAIN", confidence=0.9, reason="deterministic_docs") if self._looks_like_code_question(user_query, text): return IntentDecision(intent="CODE_QA", confidence=0.9, reason="deterministic_code") - return None + return IntentDecision(intent="GENERAL_QA", confidence=0.62, reason="deterministic_general") def _classify_with_llm(self, user_query: str, conversation_state: ConversationState) -> IntentDecision | None: if self._llm is None: @@ -73,7 +152,13 @@ class IntentClassifierV2: "message": user_query, "active_intent": conversation_state.active_intent, "last_query": conversation_state.last_query, - "allowed_intents": ["CODE_QA", "DOCS_QA", "GENERATE_DOCS_FROM_CODE", "PROJECT_MISC"], + "allowed_intents": [ + "CODE_QA", + "DOCUMENTATION_EXPLAIN", + "OPENAPI_GENERATION", + "GENERAL_QA", + "GENERATE_DOCS_FROM_CODE", + ], }, ensure_ascii=False, ) @@ -93,10 +178,19 @@ class IntentClassifierV2: except json.JSONDecodeError: return None intent = str(payload.get("intent") or "").strip().upper() - if intent not in {"CODE_QA", "DOCS_QA", "GENERATE_DOCS_FROM_CODE", "PROJECT_MISC"}: + if intent not in { + "CODE_QA", + "DOCUMENTATION_EXPLAIN", + "OPENAPI_GENERATION", + "GENERAL_QA", + "GENERATE_DOCS_FROM_CODE", + "FALLBACK", + }: return None + sub_intent = str(payload.get("sub_intent") or "").strip() or None return IntentDecision( intent=intent, + sub_intent=sub_intent, confidence=float(payload.get("confidence") or 0.7), reason=str(payload.get("reason") or "llm").strip() or "llm", ) @@ -112,8 +206,33 @@ class IntentClassifierV2: def _looks_like_docs_question(self, text: str) -> bool: if self._has_code_file_path(text): return False + if self._is_general_docs_qa(text): + return False + return self._has_docs_context(text) or self._has_docs_subject(text) + + def _has_docs_context(self, text: str) -> bool: return any(marker in text for marker in self._DOCS_MARKERS) + def _is_docs_discovery(self, text: str) -> bool: + return self._is_related_docs(text) + + def _is_related_docs(self, text: str) -> bool: + return any(marker in text for marker in self._DOCS_RELATED_MARKERS) + + def _is_docs_explain(self, text: str, user_query: str) -> bool: + if not any(marker in text for marker in self._DOCS_EXPLAIN_MARKERS): + return False + return self._docs_signals.has_docs_anchor(user_query) or self._has_docs_subject(text) + + def _has_docs_subject(self, text: str) -> bool: + return any( + marker in text + for marker in (*self._DOCS_FLOW_MARKERS, *self._DOCS_COMPONENT_MARKERS, *self._DOCS_ENTITY_MARKERS, *self._DOCS_API_MARKERS) + ) + + def _is_general_docs_qa(self, text: str) -> bool: + return any(marker in text for marker in self._GENERAL_QA_MARKERS) + def _looks_like_code_question(self, raw_text: str, lowered: str) -> bool: if self._has_code_file_path(raw_text): return True @@ -123,8 +242,6 @@ class IntentClassifierV2: return False if any(marker in lowered for marker in self._CODE_MARKERS): return True - if re.search(r"\b[A-Z][A-Za-z0-9_]{2,}(?:\.[A-Za-z_][A-Za-z0-9_]*)*\b", raw_text or ""): - return True return bool(re.search(r"\b[a-z_][A-Za-z0-9_]{2,}\(", raw_text or "")) def _has_code_file_path(self, text: str) -> bool: diff --git a/src/app/modules/agent/intent_router_v2/intent/conversation_policy.py b/src/app/modules/agent/intent_router_v2/intent/conversation_policy.py index 692b2b1..b32d16e 100644 --- a/src/app/modules/agent/intent_router_v2/intent/conversation_policy.py +++ b/src/app/modules/agent/intent_router_v2/intent/conversation_policy.py @@ -52,8 +52,22 @@ class ConversationPolicy: text = " ".join((user_query or "").lower().split()) if candidate_intent == "GENERATE_DOCS_FROM_CODE": return True - if candidate_intent == "DOCS_QA": + if candidate_intent in { + "DOCUMENTATION_EXPLAIN", + "OPENAPI_GENERATION", + "GENERAL_QA", + "DOCUMENTATION_DISCOVERY", + "DOCUMENTATION_NAVIGATION", + "OPENAPI_FROM_DOCUMENTATION", + }: return any(signal in text for signal in self._DOCS_SIGNALS) - if candidate_intent == "CODE_QA" and active_intent == "DOCS_QA": + if candidate_intent == "CODE_QA" and active_intent in { + "DOCUMENTATION_EXPLAIN", + "OPENAPI_GENERATION", + "GENERAL_QA", + "DOCUMENTATION_DISCOVERY", + "DOCUMENTATION_NAVIGATION", + "OPENAPI_FROM_DOCUMENTATION", + }: return any(signal in text for signal in self._CODE_SIGNALS) return False diff --git a/src/app/modules/agent/intent_router_v2/intent/graph_id_resolver.py b/src/app/modules/agent/intent_router_v2/intent/graph_id_resolver.py index a6cbf2e..47a5dcf 100644 --- a/src/app/modules/agent/intent_router_v2/intent/graph_id_resolver.py +++ b/src/app/modules/agent/intent_router_v2/intent/graph_id_resolver.py @@ -4,9 +4,14 @@ from __future__ import annotations class GraphIdResolver: _GRAPH_MAP = { "CODE_QA": "CodeQAGraph", - "DOCS_QA": "DocsQAGraph", + "DOCUMENTATION_EXPLAIN": "DocsQAGraph", + "OPENAPI_GENERATION": "DocsQAGraph", + "GENERAL_QA": "DocsQAGraph", + "DOCUMENTATION_DISCOVERY": "DocsQAGraph", + "DOCUMENTATION_NAVIGATION": "DocsQAGraph", + "OPENAPI_FROM_DOCUMENTATION": "DocsQAGraph", "GENERATE_DOCS_FROM_CODE": "GenerateDocsFromCodeGraph", - "PROJECT_MISC": "ProjectMiscGraph", + "FALLBACK": "DocsQAGraph", } def resolve(self, intent: str) -> str: diff --git a/src/app/modules/agent/intent_router_v2/intent/llm_disambiguator.py b/src/app/modules/agent/intent_router_v2/intent/llm_disambiguator.py new file mode 100644 index 0000000..871a20c --- /dev/null +++ b/src/app/modules/agent/intent_router_v2/intent/llm_disambiguator.py @@ -0,0 +1,55 @@ +from __future__ import annotations + +import json + +from app.modules.agent.intent_router_v2.protocols import TextGenerator + + +class DocsLlmDisambiguator: + _ALLOWED = { + "SYSTEM_FLOW_EXPLAIN", + "COMPONENT_EXPLAIN", + "API_METHOD_EXPLAIN", + "ENTITY_EXPLAIN", + "RELATED_DOCS_EXPLAIN", + "GENERIC_QA", + "OPENAPI_METHOD_GENERATE", + "OPENAPI_FRAGMENT_GENERATE", + } + + def __init__(self, llm: TextGenerator) -> None: + self._llm = llm + + def choose(self, payload: dict[str, object]) -> dict[str, str] | None: + raw = self._llm.generate( + "rag_docs_router_disambiguation_v1", + json.dumps(payload, ensure_ascii=False), + log_context="rag.intent_router_v2.disambiguate", + ).strip() + parsed = self._parse(raw) + if parsed is None: + return None + return parsed + + def _parse(self, raw: str) -> dict[str, str] | None: + candidate = self._strip_code_fence(raw) + try: + payload = json.loads(candidate) + except json.JSONDecodeError: + return None + sub_intent = str(payload.get("sub_intent") or "").strip() + if sub_intent not in self._ALLOWED: + return None + return { + "sub_intent": sub_intent, + "reason": str(payload.get("reason") or "").strip(), + "confidence": str(payload.get("confidence") or "").strip(), + } + + def _strip_code_fence(self, text: str) -> str: + if not text.startswith("```"): + return text + lines = text.splitlines() + if len(lines) >= 3 and lines[-1].strip() == "```": + return "\n".join(lines[1:-1]).strip() + return text diff --git a/src/app/modules/agent/intent_router_v2/models.py b/src/app/modules/agent/intent_router_v2/models.py index 61054f7..53b0860 100644 --- a/src/app/modules/agent/intent_router_v2/models.py +++ b/src/app/modules/agent/intent_router_v2/models.py @@ -6,13 +6,25 @@ from typing import Literal from pydantic import BaseModel, ConfigDict, Field, field_validator -IntentType = Literal["CODE_QA", "DOCS_QA", "GENERATE_DOCS_FROM_CODE", "PROJECT_MISC"] +IntentType = Literal[ + "CODE_QA", + "DOCUMENTATION_EXPLAIN", + "OPENAPI_GENERATION", + "GENERAL_QA", + "GENERATE_DOCS_FROM_CODE", + "FALLBACK", # deprecated alias, prefer GENERAL_QA + "DOCUMENTATION_DISCOVERY", # deprecated alias, prefer DOCUMENTATION_EXPLAIN + "DOCUMENTATION_NAVIGATION", # deprecated alias, prefer DOCUMENTATION_EXPLAIN + "OPENAPI_FROM_DOCUMENTATION", # deprecated alias, prefer OPENAPI_GENERATION +] ConversationMode = Literal["START", "CONTINUE", "SWITCH", "FOLLOWUP_LIKELY"] -RetrievalProfile = Literal["code", "docs"] +RetrievalProfile = Literal["code", "docs", "fallback"] AnchorType = Literal["FILE_PATH", "SYMBOL", "DOC_REF", "KEY_TERM"] AnchorSource = Literal["user_text", "conversation_state", "heuristic"] SymbolKindHint = Literal["class", "function", "method", "module", "unknown"] SymbolResolutionStatus = Literal["not_requested", "pending", "resolved", "ambiguous", "not_found"] +MatchedAnchorType = Literal["endpoint", "entity", "component", "workflow", "topic", "document", "none"] +MatchedIntentSource = Literal["deterministic", "llm"] _INLINE_CODE_RE = re.compile(r"`([^`]*)`") _CODE_SYMBOL_RE = re.compile(r"\b([A-Za-z_][A-Za-z0-9_]{2,})\b") @@ -106,6 +118,7 @@ class DocsRetrievalFilters(BaseModel): path_scope: list[str] = Field(default_factory=list) doc_kinds: list[str] = Field(default_factory=list) doc_language: list[str] = Field(default_factory=list) + doc_type: str | None = None class HybridRetrievalFilters(BaseModel): @@ -116,6 +129,7 @@ class HybridRetrievalFilters(BaseModel): language: list[str] = Field(default_factory=list) doc_kinds: list[str] = Field(default_factory=list) doc_language: list[str] = Field(default_factory=list) + doc_type: str | None = None class RetrievalSpec(BaseModel): @@ -149,6 +163,20 @@ class IntentRouterResult(BaseModel): retrieval_constraints: RetrievalConstraints = Field(default_factory=RetrievalConstraints) symbol_resolution: SymbolResolution = Field(default_factory=SymbolResolution) evidence_policy: EvidencePolicy + matched_anchor_type: MatchedAnchorType = "none" + matched_anchor_value: str | None = None + matched_intent_source: MatchedIntentSource = "deterministic" + routing_reason: str = "" + routing_mode: str = "deterministic" + is_ambiguous: bool = False + ambiguity_reason: str = "" + deterministic_candidates: list[str] = Field(default_factory=list) + deterministic_selected_sub_intent: str = "" + llm_router_used: bool = False + llm_router_selected_sub_intent: str = "" + llm_router_reason: str = "" + llm_router_confidence: str = "" + llm_router_error: str = "" class ConversationState(BaseModel): @@ -202,6 +230,7 @@ class IntentDecision(BaseModel): model_config = ConfigDict(extra="forbid") intent: IntentType + sub_intent: str | None = None confidence: float = 0.0 reason: str = "" diff --git a/src/app/modules/agent/intent_router_v2/readme.md b/src/app/modules/agent/intent_router_v2/readme.md index 43896e0..50ef330 100644 --- a/src/app/modules/agent/intent_router_v2/readme.md +++ b/src/app/modules/agent/intent_router_v2/readme.md @@ -22,8 +22,8 @@ - `QueryAnchor` ## Контракт результата `IntentRouterResult` -- `intent`: `CODE_QA | DOCS_QA | GENERATE_DOCS_FROM_CODE | PROJECT_MISC` -- `retrieval_profile`: `code | docs` +- `intent`: `CODE_QA | DOCUMENTATION_EXPLAIN | GENERATE_DOCS_FROM_CODE | FALLBACK` +- `retrieval_profile`: `code | docs | fallback` - `graph_id`: целевой graph в agent runtime - `query_plan`: нормализованный запрос, anchors, sub-intent, keyword/path/doc hints - `retrieval_spec`: слои + фильтры для RAG diff --git a/src/app/modules/agent/intent_router_v2/retrieval_planning/evidence_policy_factory.py b/src/app/modules/agent/intent_router_v2/retrieval_planning/evidence_policy_factory.py index 0ff33c5..100e5b3 100644 --- a/src/app/modules/agent/intent_router_v2/retrieval_planning/evidence_policy_factory.py +++ b/src/app/modules/agent/intent_router_v2/retrieval_planning/evidence_policy_factory.py @@ -25,8 +25,17 @@ class EvidencePolicyFactory: if "tests" in negations_set and not has_user_anchor: return EvidencePolicy(require_def=True, require_flow=False, require_spec=False, allow_answer_without_evidence=False) return EvidencePolicy(require_def=True, require_flow=True, require_spec=False, allow_answer_without_evidence=False) - if intent == "DOCS_QA": + if intent in { + "DOCUMENTATION_EXPLAIN", + "OPENAPI_GENERATION", + "GENERAL_QA", + "DOCUMENTATION_DISCOVERY", + "DOCUMENTATION_NAVIGATION", + "OPENAPI_FROM_DOCUMENTATION", + }: return EvidencePolicy(require_def=False, require_flow=False, require_spec=True, allow_answer_without_evidence=False) + if intent == "FALLBACK": + return EvidencePolicy(require_def=False, require_flow=False, require_spec=False, allow_answer_without_evidence=True) if intent == "GENERATE_DOCS_FROM_CODE": return EvidencePolicy(require_def=True, require_flow=False, require_spec=False, allow_answer_without_evidence=False) return EvidencePolicy(require_def=False, require_flow=False, require_spec=False, allow_answer_without_evidence=True) diff --git a/src/app/modules/agent/intent_router_v2/retrieval_planning/retrieval_constraints_factory.py b/src/app/modules/agent/intent_router_v2/retrieval_planning/retrieval_constraints_factory.py index 5394376..14e2198 100644 --- a/src/app/modules/agent/intent_router_v2/retrieval_planning/retrieval_constraints_factory.py +++ b/src/app/modules/agent/intent_router_v2/retrieval_planning/retrieval_constraints_factory.py @@ -28,7 +28,7 @@ class RetrievalConstraintsFactory: anchors: list[QueryAnchor], path_scope: list[str], ) -> RetrievalConstraints: - if retrieval_profile == "docs": + if retrieval_profile in {"docs", "fallback"}: return self._docs_constraints(sub_intent=sub_intent, path_scope=path_scope) return self._code_constraints(sub_intent=sub_intent, raw_query=raw_query, anchors=anchors) diff --git a/src/app/modules/agent/intent_router_v2/retrieval_planning/retrieval_filter_builder.py b/src/app/modules/agent/intent_router_v2/retrieval_planning/retrieval_filter_builder.py index af1e0a5..7c36905 100644 --- a/src/app/modules/agent/intent_router_v2/retrieval_planning/retrieval_filter_builder.py +++ b/src/app/modules/agent/intent_router_v2/retrieval_planning/retrieval_filter_builder.py @@ -35,6 +35,7 @@ class RetrievalFilterBuilder: path_scope=path_scope, doc_kinds=self._doc_kinds(anchors, raw_query), doc_language=[], + doc_type=self._doc_type(sub_intent), ) if domains == ["CODE"]: return CodeRetrievalFilters( @@ -48,6 +49,7 @@ class RetrievalFilterBuilder: language=list(repo_context.languages), doc_kinds=self._doc_kinds(anchors, raw_query), doc_language=[], + doc_type=self._doc_type(sub_intent), ) def _test_policy(self, raw_query: str, anchors: list[QueryAnchor], *, sub_intent: str) -> str: @@ -104,6 +106,11 @@ class RetrievalFilterBuilder: kinds.append("README") return kinds + def _doc_type(self, sub_intent: str) -> str | None: + if sub_intent in {"API_METHOD_EXPLAIN", "OPENAPI_METHOD_GENERATE", "OPENAPI_FRAGMENT_GENERATE"}: + return "api_method" + return None + def _looks_like_file_path(self, value: str) -> bool: filename = value.rsplit("/", 1)[-1] return "." in filename diff --git a/src/app/modules/agent/intent_router_v2/retrieval_planning/retrieval_spec_factory.py b/src/app/modules/agent/intent_router_v2/retrieval_planning/retrieval_spec_factory.py index bb046b5..8a55c41 100644 --- a/src/app/modules/agent/intent_router_v2/retrieval_planning/retrieval_spec_factory.py +++ b/src/app/modules/agent/intent_router_v2/retrieval_planning/retrieval_spec_factory.py @@ -15,11 +15,19 @@ class RetrievalSpecFactory: (RagLayer.CODE_DEPENDENCY_GRAPH, 6), (RagLayer.CODE_ENTRYPOINTS, 6), ], - "DOCS_QA": [ - (RagLayer.DOCS_MODULE_CATALOG, 5), + "DOCUMENTATION_EXPLAIN": [ + (RagLayer.DOCS_DOCUMENT_CATALOG, 6), (RagLayer.DOCS_FACT_INDEX, 8), - (RagLayer.DOCS_SECTION_INDEX, 8), - (RagLayer.DOCS_POLICY_INDEX, 4), + (RagLayer.DOCS_RELATION_GRAPH, 6), + ], + "OPENAPI_GENERATION": [ + (RagLayer.DOCS_DOCUMENT_CATALOG, 8), + (RagLayer.DOCS_FACT_INDEX, 8), + (RagLayer.DOCS_DOC_CHUNKS, 6), + ], + "GENERAL_QA": [ + (RagLayer.DOCS_DOCUMENT_CATALOG, 4), + (RagLayer.DOCS_DOC_CHUNKS, 4), ], "GENERATE_DOCS_FROM_CODE": [ (RagLayer.CODE_SYMBOL_CATALOG, 12), @@ -27,24 +35,26 @@ class RetrievalSpecFactory: (RagLayer.CODE_SOURCE_CHUNKS, 12), (RagLayer.CODE_ENTRYPOINTS, 6), ], - "PROJECT_MISC": [ - (RagLayer.DOCS_MODULE_CATALOG, 4), - (RagLayer.DOCS_SECTION_INDEX, 6), - (RagLayer.CODE_SYMBOL_CATALOG, 4), - (RagLayer.CODE_SOURCE_CHUNKS, 4), + "FALLBACK": [ + (RagLayer.DOCS_DOCUMENT_CATALOG, 4), + (RagLayer.DOCS_DOC_CHUNKS, 6), ], } _DOMAINS = { "CODE_QA": ["CODE"], - "DOCS_QA": ["DOCS"], + "DOCUMENTATION_EXPLAIN": ["DOCS"], + "OPENAPI_GENERATION": ["DOCS"], + "GENERAL_QA": ["DOCS"], "GENERATE_DOCS_FROM_CODE": ["CODE"], - "PROJECT_MISC": ["CODE", "DOCS"], + "FALLBACK": ["DOCS"], } _RERANK = { "CODE_QA": "code", - "DOCS_QA": "docs", + "DOCUMENTATION_EXPLAIN": "docs", + "OPENAPI_GENERATION": "docs", + "GENERAL_QA": "fallback", "GENERATE_DOCS_FROM_CODE": "generate", - "PROJECT_MISC": "project", + "FALLBACK": "fallback", } _OPEN_FILE_LAYERS = [ (RagLayer.CODE_SOURCE_CHUNKS, 12), @@ -77,9 +87,40 @@ class RetrievalSpecFactory: (RagLayer.CODE_SYMBOL_CATALOG, 6), (RagLayer.CODE_SOURCE_CHUNKS, 4), ] - _DOCS_SCOPED_LAYERS = [ - (RagLayer.DOCS_SECTION_INDEX, 8), + _DOCS_SCOPED_LAYERS = [(RagLayer.DOCS_DOC_CHUNKS, 8)] + _DOCS_SYSTEM_FLOW_LAYERS = [ + (RagLayer.DOCS_WORKFLOW_INDEX, 8), + (RagLayer.DOCS_RELATION_GRAPH, 8), + (RagLayer.DOCS_DOCUMENT_CATALOG, 4), + (RagLayer.DOCS_DOC_CHUNKS, 4), + ] + _DOCS_COMPONENT_LAYERS = [ (RagLayer.DOCS_FACT_INDEX, 8), + (RagLayer.DOCS_RELATION_GRAPH, 8), + (RagLayer.DOCS_DOCUMENT_CATALOG, 4), + (RagLayer.DOCS_DOC_CHUNKS, 4), + ] + _DOCS_API_METHOD_LAYERS = [ + (RagLayer.DOCS_FACT_INDEX, 8), + (RagLayer.DOCS_WORKFLOW_INDEX, 8), + (RagLayer.DOCS_DOCUMENT_CATALOG, 4), + (RagLayer.DOCS_DOC_CHUNKS, 4), + ] + _DOCS_ENTITY_LAYERS = [ + (RagLayer.DOCS_ENTITY_CATALOG, 8), + (RagLayer.DOCS_RELATION_GRAPH, 8), + (RagLayer.DOCS_DOCUMENT_CATALOG, 4), + (RagLayer.DOCS_DOC_CHUNKS, 4), + ] + _DOCS_RELATED_LAYERS = [ + (RagLayer.DOCS_RELATION_GRAPH, 8), + (RagLayer.DOCS_DOCUMENT_CATALOG, 4), + (RagLayer.DOCS_DOC_CHUNKS, 3), + ] + _DOCS_OPENAPI_LAYERS = [ + (RagLayer.DOCS_DOCUMENT_CATALOG, 8), + (RagLayer.DOCS_FACT_INDEX, 8), + (RagLayer.DOCS_DOC_CHUNKS, 6), ] def __init__( @@ -113,9 +154,9 @@ class RetrievalSpecFactory: conversation_mode=conversation_mode, sub_intent=sub_intent, ) - if intent == "DOCS_QA" and list(getattr(filters, "path_scope", []) or []): + if intent == "DOCUMENTATION_EXPLAIN" and list(getattr(filters, "path_scope", []) or []): scoped_map = dict(self._LAYERS) - scoped_map["DOCS_QA"] = list(self._DOCS_SCOPED_LAYERS) + scoped_map[intent] = list(self._DOCS_SCOPED_LAYERS) layer_queries = self._layer_builder.build(intent, repo_context, domains=domains, layers_map=scoped_map) return RetrievalSpec( domains=domains, @@ -135,6 +176,8 @@ class RetrievalSpecFactory: sub_intent: str, anchors: list[QueryAnchor], ) -> dict[str, list[tuple[str, int]]]: + if intent in {"DOCUMENTATION_EXPLAIN", "OPENAPI_GENERATION", "GENERAL_QA"}: + return self._with_docs_sub_intent_layers(intent, sub_intent) if intent != "CODE_QA": return self._LAYERS layers_map = dict(self._LAYERS) @@ -158,6 +201,26 @@ class RetrievalSpecFactory: ] return layers_map + def _with_docs_sub_intent_layers(self, intent: str, sub_intent: str) -> dict[str, list[tuple[str, int]]]: + layers_map = dict(self._LAYERS) + if intent == "DOCUMENTATION_EXPLAIN": + if sub_intent == "SYSTEM_FLOW_EXPLAIN": + layers_map[intent] = list(self._DOCS_SYSTEM_FLOW_LAYERS) + elif sub_intent == "API_METHOD_EXPLAIN": + layers_map[intent] = list(self._DOCS_API_METHOD_LAYERS) + elif sub_intent == "ENTITY_EXPLAIN": + layers_map[intent] = list(self._DOCS_ENTITY_LAYERS) + elif sub_intent == "RELATED_DOCS_EXPLAIN": + layers_map[intent] = list(self._DOCS_RELATED_LAYERS) + else: + layers_map[intent] = list(self._DOCS_COMPONENT_LAYERS) + return layers_map + if intent == "GENERAL_QA": + layers_map[intent] = list(self._LAYERS["GENERAL_QA"]) + return layers_map + layers_map[intent] = list(self._DOCS_OPENAPI_LAYERS) + return layers_map + def _needs_entrypoints(self, anchors: list[QueryAnchor]) -> bool: values = " ".join(anchor.value.lower() for anchor in anchors if anchor.type in {"KEY_TERM", "SYMBOL"}) markers = ("entrypoint", "endpoint", "вызыва", "поток", "flow", "запуска") diff --git a/src/app/modules/agent/intent_router_v2/router.py b/src/app/modules/agent/intent_router_v2/router.py index 981c31b..2bca83d 100644 --- a/src/app/modules/agent/intent_router_v2/router.py +++ b/src/app/modules/agent/intent_router_v2/router.py @@ -1,6 +1,9 @@ from __future__ import annotations +from app.modules.agent.intent_router_v2.analysis.ambiguity_detector import DocsAmbiguityDetector from app.modules.agent.intent_router_v2.intent.classifier import IntentClassifierV2 +from app.modules.agent.intent_router_v2.analysis.docs_query_signals import DocsQuerySignals +from app.modules.agent.intent_router_v2.intent.llm_disambiguator import DocsLlmDisambiguator from app.modules.agent.intent_router_v2.intent.conversation_policy import ConversationPolicy from app.modules.agent.intent_router_v2.retrieval_planning.evidence_policy_factory import EvidencePolicyFactory from app.modules.agent.intent_router_v2.intent.graph_id_resolver import GraphIdResolver @@ -22,6 +25,9 @@ class IntentRouterV2: evidence_factory: EvidencePolicyFactory | None = None, graph_resolver: GraphIdResolver | None = None, logger: IntentRouterLogger | None = None, + ambiguity_detector: DocsAmbiguityDetector | None = None, + llm_disambiguator: DocsLlmDisambiguator | None = None, + enable_llm_disambiguation: bool = False, ) -> None: self._classifier = classifier or IntentClassifierV2() self._conversation_policy = conversation_policy or ConversationPolicy() @@ -31,6 +37,10 @@ class IntentRouterV2: self._evidence_factory = evidence_factory or EvidencePolicyFactory() self._graph_resolver = graph_resolver or GraphIdResolver() self._logger = logger or IntentRouterLogger() + self._ambiguity_detector = ambiguity_detector or DocsAmbiguityDetector() + self._llm_disambiguator = llm_disambiguator + self._enable_llm_disambiguation = enable_llm_disambiguation + self._docs_signals = DocsQuerySignals() def route( self, @@ -51,6 +61,14 @@ class IntentRouterV2: conversation_mode=conversation_mode, intent=intent, ) + ambiguity = self._ambiguity_detector.detect(user_query, intent=intent, sub_intent=query_plan.sub_intent) + query_plan, intent, routing_mode, matched_source, llm_info, routing_reason = self._resolve_final_routing( + user_query=user_query, + query_plan=query_plan, + intent=intent, + ambiguity=ambiguity, + routing_reason=str(decision.reason or ""), + ) retrieval_spec = self._retrieval_factory.build( intent, query_plan.anchors, @@ -61,6 +79,7 @@ class IntentRouterV2: sub_intent=query_plan.sub_intent, ) path_scope = list(getattr(retrieval_spec.filters, "path_scope", []) or []) + matched_anchor_type, matched_anchor_value = self._docs_signals.detect_anchor(user_query) result = IntentRouterResult( intent=intent, retrieval_profile=retrieval_profile, @@ -86,6 +105,20 @@ class IntentRouterV2: negations=query_plan.negations, has_user_anchor=any(anchor.source == "user_text" for anchor in query_plan.anchors), ), + matched_anchor_type=matched_anchor_type, # type: ignore[arg-type] + matched_anchor_value=matched_anchor_value, + matched_intent_source=matched_source, + routing_reason=routing_reason, + routing_mode=routing_mode, + is_ambiguous=bool(ambiguity.get("is_ambiguous")), + ambiguity_reason=str(ambiguity.get("ambiguity_reason") or ""), + deterministic_candidates=list(ambiguity.get("deterministic_candidates") or []), + deterministic_selected_sub_intent=str(ambiguity.get("deterministic_primary_candidate") or query_plan.sub_intent), + llm_router_used=bool(llm_info.get("used")), + llm_router_selected_sub_intent=str(llm_info.get("sub_intent") or ""), + llm_router_reason=str(llm_info.get("reason") or ""), + llm_router_confidence=str(llm_info.get("confidence") or ""), + llm_router_error=str(llm_info.get("error") or ""), ) self._logger.log_result(result) return result @@ -96,7 +129,7 @@ class IntentRouterV2: sub_intent: str, symbol_candidates: list[str], ) -> SymbolResolution: - if retrieval_profile == "docs": + if retrieval_profile in {"docs", "fallback"}: return SymbolResolution(status="not_requested") if sub_intent == "OPEN_FILE": return SymbolResolution(status="not_requested") @@ -110,6 +143,44 @@ class IntentRouterV2: ) def _resolve_retrieval_profile(self, intent: str) -> str: - if intent == "DOCS_QA": + if intent in {"DOCUMENTATION_EXPLAIN", "OPENAPI_GENERATION", "GENERAL_QA"}: return "docs" + if intent == "FALLBACK": + return "fallback" return "code" + + def _resolve_final_routing( + self, + *, + user_query: str, + query_plan, + intent: str, + ambiguity: dict[str, object], + routing_reason: str, + ): + if not bool(ambiguity.get("is_ambiguous")): + source = "llm" if not str(routing_reason).startswith("deterministic_") else "deterministic" + return query_plan, intent, "deterministic", source, {"used": False}, routing_reason + if not self._enable_llm_disambiguation or self._llm_disambiguator is None: + return query_plan, intent, "deterministic_fallback", "deterministic", {"used": False}, routing_reason + payload = { + "query": user_query, + "normalized_query": query_plan.normalized, + "deterministic_primary_candidate": str(ambiguity.get("deterministic_primary_candidate") or query_plan.sub_intent), + "deterministic_candidates": list(ambiguity.get("deterministic_candidates") or []), + "ambiguity_reason": str(ambiguity.get("ambiguity_reason") or ""), + "matched_anchor_type": self._docs_signals.detect_anchor(user_query)[0], + "query_entity_candidates": self._docs_signals.query_entity_candidates(user_query), + "query_anchor_candidates": self._docs_signals.query_anchor_candidates(user_query), + } + try: + llm_choice = self._llm_disambiguator.choose(payload) + except Exception as exc: + return query_plan, intent, "deterministic_fallback", "deterministic", {"used": False, "error": str(exc)}, routing_reason + if llm_choice is None: + return query_plan, intent, "deterministic_fallback", "deterministic", {"used": False, "error": "invalid_llm_output"}, routing_reason + final_sub_intent = str(llm_choice.get("sub_intent") or query_plan.sub_intent) + final_intent = "GENERAL_QA" if final_sub_intent == "GENERIC_QA" else intent + final_intent = "DOCUMENTATION_EXPLAIN" if final_sub_intent in {"SYSTEM_FLOW_EXPLAIN", "COMPONENT_EXPLAIN", "API_METHOD_EXPLAIN", "ENTITY_EXPLAIN", "RELATED_DOCS_EXPLAIN"} else final_intent + final_query_plan = query_plan.model_copy(update={"sub_intent": final_sub_intent}) + return final_query_plan, final_intent, "llm_disambiguation", "llm", {"used": True, **llm_choice}, f"llm_disambiguation:{llm_choice.get('reason') or 'override'}" diff --git a/src/app/modules/agent/llm/prompts.yml b/src/app/modules/agent/llm/prompts.yml index 0872bfa..48c7bf1 100644 --- a/src/app/modules/agent/llm/prompts.yml +++ b/src/app/modules/agent/llm/prompts.yml @@ -20,35 +20,12 @@ prompts: code_qa_architecture_answer: | Ты инженер, который объясняет устройство подсистемы только по наблюдаемым компонентам и связям из кода. - Отвечай только по коду и структуре проекта, которые есть в контексте. - Пиши естественным инженерным языком, без искусственных markdown-секций и без повторов одной и той же мысли. - Если ответ можно дать в 1-3 фразах, не раздувай его. - Упоминай файлы, классы, функции, методы и связи только если они реально присутствуют в извлечённых данных. - Каждое содержательное утверждение по возможности привязывай к конкретному наблюдаемому имени или факту из контекста: пути файла, имени класса, функции, метода, аргумента, поля, route path, вызова или связи. - Если конкретные имена, параметры, вызовы или связи не видны, прямо скажи, чего именно не видно, вместо общих формулировок. - Не вводи новые сущности, зависимости или сценарии, которых нет в контексте. - Явно различай подтверждённые факты и осторожные выводы по косвенным признакам. - Если данных мало, честно скажи об этом вместо общего обзора. - Не используй жирные заголовки блоков, если пользователь их не просил. - Строго соблюдай контракт sub-intent и не подменяй локальный ответ архитектурным обзором. - Избегай расплывчатых и пустых формулировок вроде: "различные аргументы", "ряд аргументов", "различные подпакеты", "основные службы", "ключевой компонент", "играет роль", "представляет собой", если после них нет конкретики. - Не добавляй очевидные метафразы о том, что ответ основан на контексте или на видимом фрагменте, если это ничего не добавляет по сути. - Если сущность не найдена, остановись на факте not_found и не объясняй её предполагаемое назначение по одному только названию. - Не выводи пустые разделы, пустые списки и формулировки вида "кандидатов нет", если это не помогает ответу. + В payload есть `answer_contract`, `must_mention_components`, `must_mention_relations`, `must_mention_relation_summaries`, `must_use_relation_verbs`. Это обязательный каркас: ответ должен перечислять компоненты уровня класса/модуля и связи между ними с глаголами (создаёт, вызывает, импортирует, читает, записывает, наследует). Учитывай `fact_gaps`. - Дай архитектурное объяснение без лишней теории. - Строй ответ вокруг concrete facts из payload: `must_mention_components`, `must_mention_relations`, `must_use_relation_verbs`. - Если эти списки непустые, назови хотя бы часть компонентов и хотя бы одну наблюдаемую связь между ними. - Описывай не просто компоненты, а связи типа: создаёт, вызывает, регистрирует, читает, записывает, передаёт, оборачивает, импортирует, наследует. - Если связь не видна в payload, не додумывай её и не заменяй общими словами про управление подсистемой. - Методы и функции можно упоминать только как доказательство связи между компонентами, но не как основные "компоненты" ответа. - Затем коротко опиши границы ответственности, только если они реально видны в коде. - Не используй synthetic role labels как готовый пользовательский вывод, если они не поддержаны кодом. - Не придумывай скрытые слои и не расширяй архитектуру за пределы извлечённого контекста. - Не используй обязательные markdown-секции. - Не используй `semantic_hints` как primary explanation, особенно если `must_avoid_semantic_labels_as_primary_claims=true`. - Не используй raw retrieval labels вроде `dataflow_slice`, `execution_trace`, `trace_path` в финальном тексте. - Не используй абстрактные формулы вроде "главный компонент", "центральный управляющий компонент", "управляет потоками данных и состоянием системы", "этап пайплайна", если конкретная связь не раскрыта через наблюдаемые методы, поля или вызовы. + Отвечай только по коду из контекста. Пиши естественным языком, без лишних markdown-секций. + Строй ответ вокруг компонентов из `must_mention_components` и связей из `must_mention_relations` / `must_mention_relation_summaries`. Каждую связь формулируй с relation verb из `must_use_relation_verbs`. Методы и функции упоминай только как обоснование связи (например, "A вызывает B через метод X"), а не как основные "компоненты" списка. + Запрещено использовать в ответе raw retrieval labels: dataflow_slice, execution_trace, trace_path. Запрещено подменять архитектуру перечислением одних только методов без компонентов и связей. Запрещены абстрактные формулы без опоры на payload: "главный компонент", "управляет потоками данных", "этап пайплайна". + Не используй semantic_hints как primary explanation. Если связей в payload нет (fact_gaps), так и скажи — не додумывай связи. Не расширяй архитектуру за пределы извлечённого контекста. code_qa_degraded_answer: | Ты формируешь осторожный деградированный ответ. Нужно честно описать, что удалось подтвердить, а чего не хватает. @@ -56,36 +33,13 @@ prompts: code_qa_explain_answer: | Ты senior Python-инженер и code reviewer, который объясняет устройство кода без домысливания. - Отвечай только по коду и структуре проекта, которые есть в контексте. - Пиши естественным инженерным языком, без искусственных markdown-секций и без повторов одной и той же мысли. - Если ответ можно дать в 1-3 фразах, не раздувай его. - Упоминай файлы, классы, функции, методы и связи только если они реально присутствуют в извлечённых данных. - Каждое содержательное утверждение по возможности привязывай к конкретному наблюдаемому имени или факту из контекста: пути файла, имени класса, функции, метода, аргумента, поля, route path, вызова или связи. - Если конкретные имена, параметры, вызовы или связи не видны, прямо скажи, чего именно не видно, вместо общих формулировок. - Не вводи новые сущности, зависимости или сценарии, которых нет в контексте. - Явно различай подтверждённые факты и осторожные выводы по косвенным признакам. - Если данных мало, честно скажи об этом вместо общего обзора. - Не используй жирные заголовки блоков, если пользователь их не просил. - Строго соблюдай контракт sub-intent и не подменяй локальный ответ архитектурным обзором. - Избегай расплывчатых и пустых формулировок вроде: "различные аргументы", "ряд аргументов", "различные подпакеты", "основные службы", "ключевой компонент", "играет роль", "представляет собой", если после них нет конкретики. - Не добавляй очевидные метафразы о том, что ответ основан на контексте или на видимом фрагменте, если это ничего не добавляет по сути. - Если сущность не найдена, остановись на факте not_found и не объясняй её предполагаемое назначение по одному только названию. - Не выводи пустые разделы, пустые списки и формулировки вида "кандидатов нет", если это не помогает ответу. + В payload есть блок `answer_contract` и списки must_mention_* — это обязательный каркас ответа. Если списки непусты, ты обязан использовать из них конкретные имена (методы, вызовы, зависимости, поля), а не подменять их общими фразами. Учитывай `fact_gaps`: если там указаны пробелы в данных, явно скажи об этом и не додумывай. - Объясни, как работает сущность из вопроса пользователя, обычным инженерным текстом. - Начни с самого важного: что это за сущность и где она находится, если это видно. - Затем строй ответ вокруг concrete facts из payload: `must_mention_methods`, `must_mention_fields`, `must_mention_calls`, `must_mention_dependencies`, `must_mention_constructor_args`, `must_mention_files`. - Если эти списки непустые, назови хотя бы часть этих имён явно, а не заменяй их общей интерпретацией. - Если в `must_mention_methods` даны полные qname, можно назвать метод по короткому имени, но только если связь с целевой сущностью остаётся ясной. - Сначала идентифицируй сущность, затем назови только подтверждённые методы, аргументы, вызовы, поля и зависимости. - Если сигнатуры, аргументы, методы или вызовы не видны, прямо скажи, чего именно не видно, используя `fact_gaps`, и остановись на этом. - Не используй общие формулы без конкретных имён. - Если виден конструктор, метод или вызов, лучше назвать его явно, чем писать абстрактно про "инициализацию", "службы", "аргументы" или "компоненты". - Если вывод основан на косвенных признаках, явно пометь это как осторожный вывод. - Если сущность не найдена или evidence слабый, не пиши обычное объяснение — прямо скажи об этом и остановись. - Запрещено подменять concrete methods/fields/calls формулами вроде "принимает ряд аргументов", "имеет responsibilities", "используется в службах", "регистрирует основные службы", если в payload есть конкретные имена. - Не используй `semantic_hints` как основной каркас ответа. Они допустимы только как вторичное замечание и только если не противоречат C0/C1/C2. - Не используй обязательные секции и подзаголовки. + Отвечай только по коду из контекста. Пиши естественным инженерным языком, без лишних markdown-секций. + Начни с идентификации сущности и её расположения. Затем обязательно опирайся на: `must_mention_methods`, `must_mention_calls`, `must_mention_dependencies`, `must_mention_fields`, `must_mention_constructor_args`, `must_mention_files`. Каждый непустой список должен быть отражён в ответе конкретными именами из списка — хотя бы часть. Не заменяй их формулировками вроде "принимает ряд аргументов", "имеет responsibilities", "регистрирует основные службы", "используется в службах". + Если в fact_gaps указано, что методы или вызовы не подтверждены, прямо скажи об этом и не строй объяснение на догадках. + Запрещено использовать semantic_hints как основной каркас ответа; только concrete code edges (C0/C1/C2). Избегай расплывчатых фраз: "ряд аргументов", "ключевой компонент", "играет роль", "представляет собой" без конкретики. + Если сущность не найдена или evidence слабый — скажи об этом и остановись. Не используй обязательные секции и подзаголовки. code_qa_explain_local_answer: | Ты инженер, который объясняет локальный фрагмент кода без лишней теории и без перехода на уровень всей архитектуры. @@ -110,6 +64,7 @@ prompts: Если виден только фрагмент, ограничь вывод тем, что прямо видно в этом фрагменте. Не компенсируй нехватку локального контекста общими архитектурными фразами. Не расписывай всю архитектуру проекта и не используй секции без необходимости. + code_qa_find_entrypoints_answer: | Ты инженер, который находит подтверждённые точки входа и отдельно помечает только возможные кандидаты. @@ -218,41 +173,137 @@ prompts: Если файла нет, ответь одной короткой фразой: `Файл не найден.` Не придумывай анализ отсутствующего файла. code_qa_repair_answer: | - Ты исправляешь черновой ответ по коду после проверки groundedness. - Сделай ответ короче, точнее и строже по evidence payload. - Если проверка требует not_found или degraded формулировку, отрази это явно и убери спекуляции. - Если в `repair_focus` есть причины для `EXPLAIN`, перепиши ответ так, чтобы он назвал concrete methods, calls, fields, constructor args или dependencies из payload, а не общие responsibilities. - Если в `repair_focus` есть причины для `ARCHITECTURE`, перепиши ответ так, чтобы он назвал concrete components и связи с relation verbs из payload: создает, вызывает, читает, записывает, импортирует, наследует. - Если в `repair_focus` есть причины для `TRACE_FLOW`, перепиши ответ как последовательность concrete steps с явными methods/calls/edges из payload. Если виден только partial flow, так и скажи. - Если в `repair_focus` есть `semantic_labels_without_code_edges`, убери semantic role labels из основной формулировки, если они не подкреплены concrete code edges. - Если в `repair_focus` есть `contains_retrieval_artifacts` или `methods_as_primary_components`, убери raw retrieval labels и не выдавай методы за компоненты. - Если в `repair_focus` есть `overclaims_trace_completeness`, убери фразы про полный/полностью восстановленный flow, если payload не подтверждает это явно. + Ты исправляешь черновой ответ по результатам проверки groundedness. Вход: draft_answer, validation_reasons, repair_focus, prompt_payload. Исправь только то, на что указывает repair_focus; остальное сохрани. Ответ должен строго опираться на prompt_payload (must_mention_*, fact_gaps). + + По repair_focus: + - missing_concrete_methods / missing_concrete_calls / missing_concrete_dependencies / missing_concrete_fields / too_vague_for_explain: встрой в ответ конкретные имена из must_mention_methods, must_mention_calls, must_mention_dependencies, must_mention_fields в payload. Убери общие фразы про "ряд аргументов", "responsibilities", "основные службы". + - semantic_labels_without_code_edges: убери формулировки, опирающиеся на semantic role labels; оставь только то, что подкреплено concrete code edges (методы, вызовы, зависимости из payload). + - missing_concrete_components / missing_concrete_relations / missing_relation_verbs / too_vague_for_architecture: перечисли компоненты и связи из must_mention_components, must_mention_relations, must_mention_relation_summaries; используй глаголы из must_use_relation_verbs. Не перечисляй только методы. + - contains_retrieval_artifacts: удали из текста слова dataflow_slice, execution_trace, trace_path и подобные raw labels. + - methods_as_primary_components: переформулируй так, чтобы компонентами были классы/модули, а методы упоминались только как обоснование связей. + - missing_flow_steps / missing_sequence_edges / too_vague_for_trace_flow: построй ответ как явную последовательность шагов из must_mention_flow_steps / must_mention_ordered_steps; назови конкретные вызовы и edges из payload. + - overclaims_trace_completeness: убери фразы про "полностью восстанавливается", "полный поток"; если в fact_gaps указана частичность, добавь формулировку вроде "видна только часть цепочки". + Если проверка требовала not_found или degraded — отрази это явно, без спекуляций. code_qa_trace_flow_answer: | Ты инженер, который восстанавливает поток вызовов и движение данных только по доказуемой цепочке из контекста. - Отвечай только по коду и структуре проекта, которые есть в контексте. - Пиши естественным инженерным языком, без искусственных markdown-секций и без повторов одной и той же мысли. - Если ответ можно дать в 1-3 фразах, не раздувай его. - Упоминай файлы, классы, функции, методы и связи только если они реально присутствуют в извлечённых данных. - Каждое содержательное утверждение по возможности привязывай к конкретному наблюдаемому имени или факту из контекста: пути файла, имени класса, функции, метода, аргумента, поля, route path, вызова или связи. - Если конкретные имена, параметры, вызовы или связи не видны, прямо скажи, чего именно не видно, вместо общих формулировок. - Не вводи новые сущности, зависимости или сценарии, которых нет в контексте. - Явно различай подтверждённые факты и осторожные выводы по косвенным признакам. - Если данных мало, честно скажи об этом вместо общего обзора. - Не используй жирные заголовки блоков, если пользователь их не просил. - Строго соблюдай контракт sub-intent и не подменяй локальный ответ архитектурным обзором. - Избегай расплывчатых и пустых формулировок вроде: "различные аргументы", "ряд аргументов", "различные подпакеты", "основные службы", "ключевой компонент", "играет роль", "представляет собой", если после них нет конкретики. - Не добавляй очевидные метафразы о том, что ответ основан на контексте или на видимом фрагменте, если это ничего не добавляет по сути. - Если сущность не найдена, остановись на факте not_found и не объясняй её предполагаемое назначение по одному только названию. - Не выводи пустые разделы, пустые списки и формулировки вида "кандидатов нет", если это не помогает ответу. + В payload есть `answer_contract`, `must_mention_flow_steps`, `must_mention_ordered_steps`, `must_mention_calls`, `must_mention_sequence_edges`, `fact_gaps`. Ответ обязан описывать поток как упорядоченную последовательность шагов из этих полей. Не заявляй полноту потока, если в fact_gaps указано иное. Не делай неподтверждённых утверждений. - Проследи поток выполнения или поток данных по найденным артефактам. - Строй ответ вокруг `must_mention_flow_steps`, `must_mention_calls` и `must_mention_sequence_edges` из payload. - Старайся описывать шаги последовательно и коротко, без лишних подзаголовков: сначала, затем, после этого, в конце. - Не склеивай шаги, если между ними нет прямой связи в коде или явно подтверждённого отношения в извлечённых данных. - Если поток восстанавливается только частично, так и скажи, опираясь на `fact_gaps`, и не заявляй, что flow восстановлен полностью. - Не заменяй конкретные шаги общими словами вроде "обрабатывает запрос", "передаёт данные" или "инициализирует службы", если можно назвать конкретный вызов, метод или route. - Не используй сильные формулировки вроде "полностью восстанавливается", "полный поток виден", если payload показывает только часть цепочки. + Отвечай только по коду из контекста. Пиши естественным языком, без лишних markdown-секций. + Опиши шаги по порядку, используя конкретные имена из `must_mention_ordered_steps` или `must_mention_flow_steps`: источник, глагол (вызывает, создаёт и т.д.), цель. Не заменяй их общими фразами ("обрабатывает запрос", "передаёт данные", "инициализирует службы") — называй конкретные вызовы/методы/route из payload. + Запрещены формулировки вроде "полностью восстанавливается", "полный поток виден", "полностью прослеживается", если в fact_gaps сказано, что последовательность частичная или данных недостаточно. Если поток частичный — явно скажи об этом в конце. + Не склеивай шаги без прямой связи в payload. Не добавляй шаги, которых нет в must_mention_*. + docs_explain_answer: | + Ты объясняешь документацию системы. + + На вход приходит JSON с полями: + - question + - intent + - sub_intent + - documents + - facts + - relations + + Правила: + - Используй только предоставленные факты + - Не додумывай + - Если данных недостаточно, скажи это явно + - Объясняй структурировано + + Формат ответа: + 1. Краткое описание + 2. Основные элементы + 3. Как это работает + 4. Связи с другими частями системы (если есть) + docs_general_answer: | + Ты отвечаешь на общий вопрос по документации проекта. + + На вход приходит JSON с полями: + - question + - intent + - sub_intent + - documents + - facts + - relations + + Правила: + - Используй только предоставленные документы и факты + - Не додумывай отсутствующие детали + - Если данных недостаточно, скажи это прямо + - Дай короткий понятный ответ без лишней структуры + docs_openapi_answer: | + Ты генерируешь OpenAPI спецификацию по документации API. + + На вход приходит JSON с полями: + - question + - intent + - sub_intent + - documents + - facts + - relations + - api_contract + + Правила: + - Используй только данные из документации + - Не придумывай поля + - Если данных нет, не заполняй + - Верни ТОЛЬКО YAML без пояснений + + Формат: + paths: + /path: + method: + summary: ... + requestBody: + responses: + docs_openapi_fragment_answer: | + Ты генерируешь часть OpenAPI schema по документации API. + docs_template_generation: | + Ты генерируешь проект документации по системной аналитике по заданному шаблону. + + На вход приходит JSON с полями: + - question + - template_id + - title + - sections + - attachments + - files + - context + + Правила: + - Строго следуй структуре шаблона + - Не выдумывай факты, которых нет во входе + - Если данных недостаточно, в соответствующем разделе явно укажи "Недостаточно данных" + - Верни Markdown документ с заголовком и секциями из шаблона + docs_fallback_answer: | + Ты отвечаешь на нетиповой вопрос в контуре документации и аналитики. + + На вход приходит JSON с полями: + - question + - intent + - attachments + - confluence_urls + + Правила: + - Дай короткий и честный ответ + - Если вопрос лучше перевести в один из специализированных workflow, мягко скажи об этом + - Не придумывай факты, если контекста недостаточно + + На вход приходит JSON с полями: + - question + - intent + - sub_intent + - documents + - facts + - relations + - api_contract + + Правила: + - Только schema + - Без полного OpenAPI документа + - Используй только данные из payload + - Не придумывай поля + - Верни ТОЛЬКО YAML без пояснений rag_intent_router_v2: | Ты intent-router для layered RAG. На вход ты получаешь JSON с полями: @@ -261,20 +312,75 @@ prompts: - last_query: предыдущий запрос пользователя - allowed_intents: допустимые intent'ы - Выбери ровно один intent из allowed_intents. + Выбери ровно один intent из allowed_intents и один подходящий sub_intent. Верни только JSON без markdown и пояснений. Строгий формат ответа: - {"intent":"","confidence":,"reason":""} + {"intent":"","sub_intent":"","confidence":} Правила: - CODE_QA: объяснение по коду, архитектуре, классам, методам, файлам, блокам кода, поведению приложения по реализации. - - DOCS_QA: объяснение по документации, README, markdown, specs, runbooks, разделам документации. + - DOCUMENTATION_EXPLAIN: объяснение сущности, компонента, API метода, flow или связанных документов по документации. + - OPENAPI_GENERATION: генерация OpenAPI/Swagger/YAML/spec/schema по документации API. + - GENERAL_QA: слишком общий или нечеткий вопрос по документации/проекту, который нельзя уверенно отнести к explain/openapi. - GENERATE_DOCS_FROM_CODE: просьба сгенерировать, подготовить или обновить документацию по коду. - - PROJECT_MISC: прочие вопросы по проекту, не относящиеся явно к коду или документации. + + Допустимые docs sub-intents: + - SYSTEM_FLOW_EXPLAIN + - COMPONENT_EXPLAIN + - API_METHOD_EXPLAIN + - ENTITY_EXPLAIN + - RELATED_DOCS_EXPLAIN + - OPENAPI_METHOD_GENERATE + - OPENAPI_FRAGMENT_GENERATE + - GENERIC_QA Приоритет: - Если пользователь просит именно подготовить документацию по коду, выбирай GENERATE_DOCS_FROM_CODE. + - Если есть openapi, swagger, yaml, schema или spec, выбирай OPENAPI_GENERATION. + Если запрос про request, response или schema, выбирай OPENAPI_FRAGMENT_GENERATE. + Иначе выбирай OPENAPI_METHOD_GENERATE. + - Если запрос про связанные документы, где еще описано, что еще посмотреть, какие страницы связаны, какие документы по теме, выбирай DOCUMENTATION_EXPLAIN и sub_intent RELATED_DOCS_EXPLAIN. + - Если есть объясни, как работает, что делает или что такое по документации, выбирай DOCUMENTATION_EXPLAIN. + Для API/endpoint/method выбирай API_METHOD_EXPLAIN. + Для flow/workflow/process выбирай SYSTEM_FLOW_EXPLAIN. + Для entity/сущности выбирай ENTITY_EXPLAIN. + Иначе выбирай COMPONENT_EXPLAIN. - Если пользователь спрашивает про конкретный класс, файл, метод или блок кода, выбирай CODE_QA. - - Если пользователь спрашивает про README, docs, markdown или конкретную документацию, выбирай DOCS_QA. - - Если сигнал неочевиден, выбирай PROJECT_MISC и confidence <= 0.6. + - Если пользователь спрашивает про README, docs, markdown или конкретную документацию без явного openapi, выбирай DOCUMENTATION_EXPLAIN. + - Если сигнал неочевиден, выбирай GENERAL_QA и confidence <= 0.6. + rag_docs_router_disambiguation_v1: | + Ты помогаешь разрешить неоднозначность в docs sub-intent router. + + На вход приходит JSON: + - query + - normalized_query + - deterministic_primary_candidate + - deterministic_candidates + - ambiguity_reason + - matched_anchor_type + - query_entity_candidates + - query_anchor_candidates + + Выбери ровно один sub_intent только из списка deterministic_candidates. + Не придумывай новые labels. + + Допустимые labels: + - SYSTEM_FLOW_EXPLAIN + - COMPONENT_EXPLAIN + - API_METHOD_EXPLAIN + - ENTITY_EXPLAIN + - RELATED_DOCS_EXPLAIN + - GENERIC_QA + - OPENAPI_METHOD_GENERATE + - OPENAPI_FRAGMENT_GENERATE + + Правила: + - Если запрос обзорный, про структуру документации, "что есть", "с чего начать", выбирай GENERIC_QA. + - Если запрос про runtime health, статус воркера, состояние runtime как понятие/сущность, выбирай ENTITY_EXPLAIN. + - Если запрос про процесс, health check flow, последовательность шагов, выбирай SYSTEM_FLOW_EXPLAIN. + - Если есть точный endpoint/path anchor, не уводи запрос в GENERIC_QA. + - Если есть CamelCase component-like token, предпочитай COMPONENT_EXPLAIN. + + Верни только JSON: + {"sub_intent":"","reason":"","confidence":"low|medium|high"} diff --git a/src/app/modules/agent/runtime/__init__.py b/src/app/modules/agent/runtime/__init__.py index e94a99f..a0b10ff 100644 --- a/src/app/modules/agent/runtime/__init__.py +++ b/src/app/modules/agent/runtime/__init__.py @@ -1,6 +1,7 @@ """Публичный API runtime: оркестрация роутинг → retrieval → evidence gate → генерация ответа.""" from app.modules.agent.runtime.executor import AgentRuntimeExecutor +from app.modules.agent.runtime.docs_qa_pipeline import DocsQAPipelineRunner from app.modules.agent.runtime.models import ( RuntimeDraftAnswer, RuntimeExecutionState, @@ -11,6 +12,7 @@ from app.modules.agent.runtime.steps.retrieval import RuntimeRepoContextFactory, __all__ = [ "AgentRuntimeExecutor", + "DocsQAPipelineRunner", "RuntimeDraftAnswer", "RuntimeExecutionState", "RuntimeFinalResult", diff --git a/src/app/modules/agent/runtime/docs_qa_pipeline/__init__.py b/src/app/modules/agent/runtime/docs_qa_pipeline/__init__.py new file mode 100644 index 0000000..0da2da5 --- /dev/null +++ b/src/app/modules/agent/runtime/docs_qa_pipeline/__init__.py @@ -0,0 +1,9 @@ +from app.modules.agent.runtime.docs_qa_pipeline.models import DocsDiagnostics, DocsQAPipelineResult, OpenAPIResult +from app.modules.agent.runtime.docs_qa_pipeline.pipeline import DocsQAPipelineRunner + +__all__ = [ + "DocsDiagnostics", + "DocsQAPipelineRunner", + "DocsQAPipelineResult", + "OpenAPIResult", +] diff --git a/src/app/modules/agent/runtime/docs_qa_pipeline/anchor_selector.py b/src/app/modules/agent/runtime/docs_qa_pipeline/anchor_selector.py new file mode 100644 index 0000000..fc87747 --- /dev/null +++ b/src/app/modules/agent/runtime/docs_qa_pipeline/anchor_selector.py @@ -0,0 +1,56 @@ +from __future__ import annotations + +from app.modules.agent.runtime.docs_qa_pipeline.doc_identity import DocsCanonicalDocIdResolver + + +class DocsAnchorSelector: + def __init__(self, resolver: DocsCanonicalDocIdResolver | None = None) -> None: + self._resolver = resolver or DocsCanonicalDocIdResolver() + + def select(self, *, sub_intent: str, anchor_type: str, anchor_value: str | None, rows: list[dict]) -> dict[str, object]: + if sub_intent != "RELATED_DOCS_EXPLAIN": + return {"anchor_candidates": [], "selected_anchor": None, "anchor_selection_reason": "", "anchor_match_type": ""} + scored = self._scored_candidates(anchor_type=anchor_type, anchor_value=anchor_value, rows=rows) + if not scored: + return {"anchor_candidates": [], "selected_anchor": None, "anchor_selection_reason": "", "anchor_match_type": ""} + selected = scored[0] + return { + "anchor_candidates": [item["doc_id"] for item in scored], + "selected_anchor": selected["doc_id"], + "anchor_selection_reason": selected["reason"], + "anchor_match_type": selected["match_type"], + } + + def _scored_candidates(self, *, anchor_type: str, anchor_value: str | None, rows: list[dict]) -> list[dict[str, object]]: + value = str(anchor_value or "").strip().lower() + endpoint_slug = value.strip("/").replace("/", "_").replace("-", "_") + scored: list[dict[str, object]] = [] + for row in rows: + metadata = dict(row.get("metadata") or {}) + for doc_id in self._resolver.candidates(row): + score = 0 + match_type = "semantic_fallback" + reason = "relation_neighbor" + if anchor_type == "endpoint" and value: + if str(metadata.get("endpoint") or "").strip().lower() == value: + score, match_type, reason = 100, "exact_path", "metadata.endpoint exact match" + elif endpoint_slug and endpoint_slug in doc_id.lower(): + score, match_type, reason = 90, "exact_path", "doc_id matches requested endpoint slug" + elif endpoint_slug and endpoint_slug in str(row.get("path") or "").lower().replace("-", "_"): + score, match_type, reason = 85, "exact_path", "path matches requested endpoint slug" + elif anchor_type == "entity" and value: + entity_value = str(metadata.get("entity") or "").strip().lower() + if entity_value == value: + score, match_type, reason = 100, "exact_entity", "metadata.entity exact match" + elif value in doc_id.lower(): + score, match_type, reason = 90, "exact_title", "doc_id matches requested entity" + if score == 0: + score = 40 if str(row.get("layer") or "") == "D5_RELATION_GRAPH" else 20 + scored.append({"doc_id": doc_id, "score": score, "match_type": match_type, "reason": reason}) + unique: dict[str, dict[str, object]] = {} + for item in scored: + doc_id = str(item["doc_id"]) + current = unique.get(doc_id) + if current is None or int(item["score"]) > int(current["score"]): + unique[doc_id] = item + return sorted(unique.values(), key=lambda item: (-int(item["score"]), str(item["doc_id"]))) diff --git a/src/app/modules/agent/runtime/docs_qa_pipeline/answer_synthesizer.py b/src/app/modules/agent/runtime/docs_qa_pipeline/answer_synthesizer.py new file mode 100644 index 0000000..8e83fec --- /dev/null +++ b/src/app/modules/agent/runtime/docs_qa_pipeline/answer_synthesizer.py @@ -0,0 +1,43 @@ +from __future__ import annotations + +from app.modules.agent.runtime.docs_qa_pipeline.models import DocsEvidenceBundle + + +class DocsAnswerSynthesizer: + def synthesize(self, query: str, evidence_bundle: DocsEvidenceBundle) -> str: + mode = "graph_summary" if evidence_bundle.sub_intent == "RELATED_DOCS_EXPLAIN" else "prose" + if mode == "list": + return self._list_answer(evidence_bundle) + if mode == "graph_summary": + return self._graph_summary(evidence_bundle) + return self._prose_answer(query, evidence_bundle) + + def _prose_answer(self, query: str, bundle: DocsEvidenceBundle) -> str: + parts = [item["content"] for item in bundle.facts[:3] if item.get("content")] + if not parts: + parts = [item["content"] for item in bundle.entities[:2] if item.get("content")] + if not parts: + parts = [item["content"] for item in bundle.workflows[:2] if item.get("content")] + if not parts: + parts = [item["content"] for item in bundle.documents[:2] if item.get("content")] + if not parts: + parts = [item["content"] for item in bundle.chunks[:2] if item.get("content")] + if not parts: + return f"Недостаточно данных в документации для ответа на запрос: {query}" + return "\n".join(parts) + + def _list_answer(self, bundle: DocsEvidenceBundle) -> str: + items = [item["title"] or item["path"] for item in bundle.documents[:5]] + if not items: + items = [item["title"] or item["path"] for item in bundle.facts[:5]] + if not items: + return "Подходящие документы не найдены." + return "\n".join(f"- {item}" for item in items) + + def _graph_summary(self, bundle: DocsEvidenceBundle) -> str: + items = [item["title"] or item["content"] for item in bundle.relations[:5]] + if not items: + items = [item["title"] or item["path"] for item in bundle.documents[:5]] + if not items: + return "Связанные документы не найдены." + return "\n".join(f"- {item}" for item in items) diff --git a/src/app/modules/agent/runtime/docs_qa_pipeline/diagnostics_builder.py b/src/app/modules/agent/runtime/docs_qa_pipeline/diagnostics_builder.py new file mode 100644 index 0000000..1d18937 --- /dev/null +++ b/src/app/modules/agent/runtime/docs_qa_pipeline/diagnostics_builder.py @@ -0,0 +1,259 @@ +from __future__ import annotations + +from app.modules.agent.runtime.docs_qa_pipeline.doc_identity import DocsCanonicalDocIdResolver +from app.modules.agent.runtime.docs_qa_pipeline.models import DocsDiagnostics, DocsEvidenceBundle, OpenAPIResult + + +class DocsDiagnosticsBuilder: + def __init__(self, resolver: DocsCanonicalDocIdResolver | None = None) -> None: + self._resolver = resolver or DocsCanonicalDocIdResolver() + + def build( + self, + *, + intent: str, + sub_intent: str, + planned_layers: list[str], + executed_layers: list[str], + non_empty_layers: list[str], + layer_diagnostics: dict[str, object], + evidence_bundle: DocsEvidenceBundle, + openapi_result: OpenAPIResult | None, + prompt_used: str, + llm_mode: str, + answer_mode: str, + output_valid: bool, + matched_intent_source: str, + matched_anchor_type: str, + matched_anchor_value: str | None, + exact_anchor_match: bool, + query_entity_candidates: list[str], + resolved_entity_candidates: list[str], + query_anchor_candidates: list[str], + resolved_anchor_candidates: list[str], + anchor_candidates: list[str], + selected_anchor: str | None, + anchor_selection_reason: str, + anchor_match_type: str, + docs_layers_with_hits: list[str], + gate_decision: str, + gate_decision_reason: str, + gate_missing_requirements: list[str], + gate_satisfied_requirements: list[str], + requested_fragment_type: str | None, + fragment_evidence_found: list[str], + fragment_missing_requirements: list[str], + prompt: dict[str, object], + degraded_reason: str | None, + fallback_used: bool, + code_intents_stubbed: bool, + ) -> DocsDiagnostics: + missing = list((openapi_result.diagnostics if openapi_result else {}).get("missing_required_fields") or []) + openapi_fields = 0 + if openapi_result is not None: + openapi_fields += len((openapi_result.request_schema or {}).get("properties") or {}) + openapi_fields += len((openapi_result.response_schema or {}).get("properties") or {}) + return DocsDiagnostics( + intent=intent, + sub_intent=sub_intent, + layers_used=list(planned_layers), + documents_found=len(evidence_bundle.documents), + facts_found=len(evidence_bundle.facts), + relations_found=len(evidence_bundle.relations), + openapi_fields_extracted=openapi_fields, + missing_required_fields=missing, + openapi_status=self._openapi_status(openapi_result), + prompt_used=prompt_used, + llm_mode=llm_mode, + output_valid=output_valid, + matched_intent_source=matched_intent_source, + matched_anchor_type=matched_anchor_type, + matched_anchor_value=matched_anchor_value, + exact_anchor_match=exact_anchor_match, + docs_layers_requested=list(planned_layers), + docs_layers_with_hits=list(docs_layers_with_hits), + planned_layers=list(planned_layers), + executed_layers=list(executed_layers), + non_empty_layers=list(non_empty_layers), + layer_diagnostics=dict(layer_diagnostics), + query_entity_candidates=list(query_entity_candidates), + resolved_entity_candidates=list(resolved_entity_candidates), + query_anchor_candidates=list(query_anchor_candidates), + resolved_anchor_candidates=list(resolved_anchor_candidates), + anchor_candidates=list(anchor_candidates), + selected_anchor=selected_anchor, + anchor_selection_reason=anchor_selection_reason, + anchor_match_type=anchor_match_type, + doc_ids=self._doc_ids(evidence_bundle, selected_anchor), + doc_paths=self._doc_paths(evidence_bundle), + doc_titles=self._doc_titles(evidence_bundle), + relation_hits_count=len(evidence_bundle.relations), + relation_targets=self._relation_targets(evidence_bundle), + selected_doc_ids=self._selected_doc_ids(evidence_bundle), + selected_fact_ids=self._selected_ids(evidence_bundle.facts, ("fact_id", "doc_id", "document_id"), fallback="path"), + selected_relation_ids=self._selected_ids( + evidence_bundle.relations, + ("relation_id", "target_doc_id", "target_document_id", "doc_id", "document_id"), + fallback="path", + ), + selected_chunk_ids=self._selected_ids(evidence_bundle.chunks, ("chunk_id", "doc_id", "document_id"), fallback="path"), + selected_entity_ids=self._selected_ids(evidence_bundle.entities, ("entity", "doc_id", "document_id"), fallback="title"), + selected_workflow_ids=self._selected_ids(evidence_bundle.workflows, ("workflow_id", "doc_id", "document_id"), fallback="path"), + fallback_doc_hits_count=len(evidence_bundle.documents) + len(evidence_bundle.chunks), + fallback_used=fallback_used, + fact_hits=len(evidence_bundle.facts), + entity_hits=self._entity_hits(evidence_bundle), + evidence_summary=self._evidence_summary(evidence_bundle, openapi_result), + gate_decision=gate_decision, + gate_decision_reason=gate_decision_reason, + gate_missing_requirements=list(gate_missing_requirements), + gate_satisfied_requirements=list(gate_satisfied_requirements), + openapi_evidence=dict(self._openapi_evidence(openapi_result)), + requested_fragment_type=requested_fragment_type, + fragment_evidence_found=list(fragment_evidence_found), + fragment_missing_requirements=list(fragment_missing_requirements), + prompt=dict(prompt), + answer_mode=answer_mode, + degrade_reason=degraded_reason, + degraded_reason=degraded_reason, + code_intents_stubbed=code_intents_stubbed, + ) + + def _openapi_status(self, openapi_result: OpenAPIResult | None) -> dict[str, bool]: + diagnostics = openapi_result.diagnostics if openapi_result else {} + return { + "has_path": bool(diagnostics.get("has_path")), + "has_method": bool(diagnostics.get("has_method")), + "has_request": bool(diagnostics.get("has_request")), + "has_response": bool(diagnostics.get("has_response")), + } + + def _doc_ids(self, evidence_bundle: DocsEvidenceBundle, selected_anchor: str | None) -> list[str]: + values = self._collect_doc_ids(evidence_bundle) + for item in evidence_bundle.relations: + metadata = dict(item.get("metadata") or {}) + target = metadata.get("target_doc_id") or metadata.get("target_document_id") + if target: + values.append(str(target)) + result = self._dedupe(values) + if selected_anchor and selected_anchor in result: + return [selected_anchor, *[item for item in result if item != selected_anchor]] + if selected_anchor: + return [selected_anchor, *result] + return result + + def _selected_doc_ids(self, evidence_bundle: DocsEvidenceBundle) -> list[str]: + values = self._selected_ids(evidence_bundle.documents, ("doc_id", "document_id"), fallback="path") + values.extend(self._selected_ids(evidence_bundle.entities, ("doc_id", "document_id"), fallback="path")) + values.extend(self._selected_ids(evidence_bundle.workflows, ("doc_id", "document_id"), fallback="path")) + return self._dedupe(values) + + def _doc_paths(self, evidence_bundle: DocsEvidenceBundle) -> list[str]: + return self._collect_distinct(evidence_bundle, "path") + + def _doc_titles(self, evidence_bundle: DocsEvidenceBundle) -> list[str]: + return self._collect_distinct(evidence_bundle, "title") + + def _relation_targets(self, evidence_bundle: DocsEvidenceBundle) -> list[str]: + values: list[str] = [] + for item in evidence_bundle.relations: + metadata = dict(item.get("metadata") or {}) + target = ( + metadata.get("target_doc_id") + or metadata.get("target_document_id") + or metadata.get("related_to") + or metadata.get("document_id") + or metadata.get("doc_id") + or item.get("title") + or item.get("path") + ) + if target: + values.append(str(target)) + return self._dedupe(values) + + def _selected_ids(self, items: list[dict], metadata_keys: tuple[str, ...], *, fallback: str) -> list[str]: + values: list[str] = [] + for item in items: + metadata = dict(item.get("metadata") or {}) + candidate = None + for key in metadata_keys: + candidate = metadata.get(key) + if candidate: + break + if not candidate: + candidate = item.get(fallback) + if candidate: + values.append(str(candidate)) + return self._dedupe(values) + + def _collect_doc_ids(self, evidence_bundle: DocsEvidenceBundle) -> list[str]: + values: list[str] = [] + for item in evidence_bundle.raw_rows: + values.extend(self._resolver.candidates(item)) + return self._dedupe(values) + + def _collect_distinct(self, evidence_bundle: DocsEvidenceBundle, key: str, *, fallback_key: str | None = None) -> list[str]: + values: list[str] = [] + for item in evidence_bundle.raw_rows: + metadata = dict(item.get("metadata") or {}) + candidate = metadata.get(key) if key == "doc_id" else item.get(key) + if not candidate and fallback_key: + candidate = item.get(fallback_key) + if candidate: + values.append(str(candidate)) + return self._dedupe(values) + + def _dedupe(self, values: list[str]) -> list[str]: + result: list[str] = [] + seen: set[str] = set() + for value in values: + normalized = value.strip() + if not normalized: + continue + if normalized in seen: + continue + seen.add(normalized) + result.append(normalized) + return result + + def _entity_hits(self, evidence_bundle: DocsEvidenceBundle) -> int: + values = self._collect_distinct(evidence_bundle, "entity") + return len(values) + + def _evidence_summary(self, evidence_bundle: DocsEvidenceBundle, openapi_result: OpenAPIResult | None) -> dict[str, object]: + return { + "documents": len(evidence_bundle.documents), + "facts": len(evidence_bundle.facts), + "entities": len(evidence_bundle.entities), + "workflows": len(evidence_bundle.workflows), + "relations": len(evidence_bundle.relations), + "chunks": len(evidence_bundle.chunks), + "selected_doc_ids": self._selected_doc_ids(evidence_bundle), + "selected_fact_ids": self._selected_ids(evidence_bundle.facts, ("fact_id", "doc_id", "document_id"), fallback="path"), + "selected_relation_ids": self._selected_ids( + evidence_bundle.relations, + ("relation_id", "target_doc_id", "target_document_id", "doc_id", "document_id"), + fallback="path", + ), + "selected_chunk_ids": self._selected_ids(evidence_bundle.chunks, ("chunk_id", "doc_id", "document_id"), fallback="path"), + "entity_hits": self._entity_hits(evidence_bundle), + "openapi_signals": self._openapi_evidence(openapi_result), + } + + def _openapi_evidence(self, openapi_result: OpenAPIResult | None) -> dict[str, bool]: + diagnostics = openapi_result.diagnostics if openapi_result else {} + return { + "path_found": bool(diagnostics.get("has_path")), + "method_found": bool(diagnostics.get("has_method")), + "operation_semantics_found": bool(diagnostics.get("operation_semantics_found")), + "request_payload_found": bool(diagnostics.get("request_payload_found")), + "request_schema": bool(diagnostics.get("has_request")), + "request_fields_found": bool(diagnostics.get("request_fields_found")), + "response_payload_found": bool(diagnostics.get("response_payload_found")), + "response_schema": bool(diagnostics.get("has_response")), + "response_fields_found": bool(diagnostics.get("response_fields_found")), + "status_codes": bool(diagnostics.get("status_codes_found")), + "content_type_found": bool(diagnostics.get("content_type_found")), + "examples_found": bool(diagnostics.get("examples_found")), + "payload_description": bool(diagnostics.get("payload_description_found")), + } diff --git a/src/app/modules/agent/runtime/docs_qa_pipeline/doc_identity.py b/src/app/modules/agent/runtime/docs_qa_pipeline/doc_identity.py new file mode 100644 index 0000000..1cd2e2e --- /dev/null +++ b/src/app/modules/agent/runtime/docs_qa_pipeline/doc_identity.py @@ -0,0 +1,47 @@ +from __future__ import annotations + +import re + + +class DocsCanonicalDocIdResolver: + _DOC_PATH_RE = re.compile(r"docs/(?:documentation/)?(?P
api|domain|logic|architecture)/(?P[^/]+)\.md$", re.IGNORECASE) + _TITLE_ENDPOINT_RE = re.compile(r"/([a-z0-9_{}-]+)", re.IGNORECASE) + + def candidates(self, row: dict) -> list[str]: + metadata = dict(row.get("metadata") or {}) + values: list[str] = [] + for candidate in ( + metadata.get("document_id"), + metadata.get("doc_id"), + self.from_path(str(row.get("path") or "")), + self.from_title(str(row.get("title") or ""), str(row.get("path") or "")), + ): + value = str(candidate or "").strip() + if value and value not in values: + values.append(value) + return values + + def from_path(self, path: str) -> str | None: + match = self._DOC_PATH_RE.search((path or "").strip()) + if match is None: + return None + section = match.group("section").lower() + name = match.group("name").lower().replace("-", "_") + if section == "api" and not name.endswith("_endpoint"): + name = f"{name}_endpoint" + if section == "domain" and name.endswith("_entity"): + name = name[: -len("_entity")] + return f"{section}.{name}" + + def from_title(self, title: str, path: str) -> str | None: + normalized = (title or "").strip().lower() + if "/health" in normalized: + return "api.health_endpoint" + if "/send" in normalized: + return "api.send_message_endpoint" + match = self._TITLE_ENDPOINT_RE.search(normalized) + section = "api" if "/api/" in (path or "").lower() else "" + if match and section: + slug = match.group(1).replace("-", "_") + return f"{section}.{slug}_endpoint" + return None diff --git a/src/app/modules/agent/runtime/docs_qa_pipeline/evidence_builder.py b/src/app/modules/agent/runtime/docs_qa_pipeline/evidence_builder.py new file mode 100644 index 0000000..9eb1f6f --- /dev/null +++ b/src/app/modules/agent/runtime/docs_qa_pipeline/evidence_builder.py @@ -0,0 +1,91 @@ +from __future__ import annotations + +from app.modules.agent.runtime.docs_qa_pipeline.models import DocsEvidenceBundle + + +class DocsEvidenceBuilder: + _CAPS = { + "SYSTEM_FLOW_EXPLAIN": {"documents": 1, "facts": 1, "entities": 0, "workflows": 2, "relations": 2, "chunks": 2}, + "COMPONENT_EXPLAIN": {"documents": 1, "facts": 3, "entities": 0, "workflows": 0, "relations": 2, "chunks": 2}, + "API_METHOD_EXPLAIN": {"documents": 1, "facts": 3, "entities": 0, "workflows": 1, "relations": 0, "chunks": 2}, + "ENTITY_EXPLAIN": {"documents": 1, "facts": 1, "entities": 2, "workflows": 0, "relations": 2, "chunks": 1}, + "RELATED_DOCS_EXPLAIN": {"documents": 2, "facts": 0, "entities": 1, "workflows": 0, "relations": 4, "chunks": 1}, + "GENERIC_QA": {"documents": 2, "facts": 0, "entities": 0, "workflows": 0, "relations": 0, "chunks": 1}, + "OPENAPI_METHOD_GENERATE": {"documents": 1, "facts": 4, "entities": 0, "workflows": 0, "relations": 0, "chunks": 2}, + "OPENAPI_FRAGMENT_GENERATE": {"documents": 1, "facts": 4, "entities": 0, "workflows": 0, "relations": 0, "chunks": 2}, + } + _LAYER_TO_BUCKET = { + "D1_DOCUMENT_CATALOG": "documents", + "D2_FACT_INDEX": "facts", + "D3_ENTITY_CATALOG": "entities", + "D4_WORKFLOW_INDEX": "workflows", + "D5_RELATION_GRAPH": "relations", + "D0_DOC_CHUNKS": "chunks", + } + + def build(self, *, intent: str, sub_intent: str, raw_rows: list[dict]) -> DocsEvidenceBundle: + buckets = {name: [] for name in self._LAYER_TO_BUCKET.values()} + for row in raw_rows: + bucket = self._LAYER_TO_BUCKET.get(str(row.get("layer") or "")) + if bucket is not None: + buckets[bucket].append(self._normalize_row(row)) + support_paths = self._support_paths(sub_intent, buckets) + caps = self._CAPS.get(sub_intent, self._CAPS["GENERIC_QA"]) + return DocsEvidenceBundle( + intent=intent, + sub_intent=sub_intent, + documents=buckets["documents"][: caps["documents"]], + facts=buckets["facts"][: caps["facts"]], + entities=buckets["entities"][: caps["entities"]], + workflows=buckets["workflows"][: caps["workflows"]], + relations=buckets["relations"][: caps["relations"]], + chunks=self._select_chunks(buckets["chunks"], support_paths, caps["chunks"]), + raw_rows=list(raw_rows), + ) + + def _normalize_row(self, row: dict) -> dict: + return { + "layer": str(row.get("layer") or ""), + "path": str(row.get("path") or ""), + "title": str(row.get("title") or ""), + "content": str(row.get("content") or ""), + "metadata": dict(row.get("metadata") or {}), + } + + def _support_paths(self, sub_intent: str, buckets: dict[str, list[dict]]) -> list[str]: + ordered: list[dict] = [] + if sub_intent == "SYSTEM_FLOW_EXPLAIN": + ordered = [*buckets["workflows"], *buckets["relations"], *buckets["documents"]] + elif sub_intent == "COMPONENT_EXPLAIN": + ordered = [*buckets["facts"], *buckets["relations"], *buckets["documents"]] + elif sub_intent == "API_METHOD_EXPLAIN": + ordered = [*buckets["facts"], *buckets["workflows"], *buckets["documents"]] + elif sub_intent == "ENTITY_EXPLAIN": + ordered = [*buckets["entities"], *buckets["relations"], *buckets["documents"]] + elif sub_intent == "RELATED_DOCS_EXPLAIN": + ordered = [*buckets["relations"], *buckets["documents"], *buckets["entities"]] + elif sub_intent == "GENERIC_QA": + ordered = [*buckets["documents"], *buckets["chunks"]] + else: + ordered = [*buckets["facts"], *buckets["documents"]] + paths: list[str] = [] + for item in ordered: + path = str(item.get("path") or "").strip() + if path and path not in paths: + paths.append(path) + return paths[:4] + + def _select_chunks(self, chunks: list[dict], support_paths: list[str], limit: int) -> list[dict]: + if limit <= 0: + return [] + targeted = [item for item in chunks if str(item.get("path") or "") in support_paths] + selected = targeted[:limit] + if len(selected) >= limit: + return selected + for item in chunks: + if item in selected: + continue + selected.append(item) + if len(selected) >= limit: + break + return selected diff --git a/src/app/modules/agent/runtime/docs_qa_pipeline/exact_anchor_matcher.py b/src/app/modules/agent/runtime/docs_qa_pipeline/exact_anchor_matcher.py new file mode 100644 index 0000000..2a2ec82 --- /dev/null +++ b/src/app/modules/agent/runtime/docs_qa_pipeline/exact_anchor_matcher.py @@ -0,0 +1,117 @@ +from __future__ import annotations + +import re + + +class DocsExactAnchorMatcher: + _TOKEN_RE = re.compile(r"[a-z0-9_./{}-]+", re.IGNORECASE) + _STRICT_ANCHOR_TYPES = {"endpoint", "entity"} + + def filter_rows(self, rows: list[dict], *, anchor_type: str, anchor_value: str | None) -> tuple[list[dict], bool]: + if anchor_type == "none" or not anchor_value or anchor_type not in self._STRICT_ANCHOR_TYPES: + return list(rows), False + exact = [row for row in rows if self._matches(row, anchor_type=anchor_type, anchor_value=anchor_value)] + if exact: + return self._expand_support_rows(rows, exact), True + return [], False + + def resolved_entity_candidates(self, rows: list[dict]) -> list[str]: + values: list[str] = [] + for row in rows: + metadata = dict(row.get("metadata") or {}) + for key in ("entity", "component"): + candidate = metadata.get(key) + if candidate: + values.append(str(candidate)) + return self._dedupe(values) + + def resolved_anchor_candidates(self, rows: list[dict]) -> list[str]: + values: list[str] = [] + for row in rows: + metadata = dict(row.get("metadata") or {}) + for candidate in ( + metadata.get("endpoint"), + metadata.get("document_id"), + metadata.get("doc_id"), + metadata.get("entity"), + metadata.get("component"), + row.get("path"), + ): + if candidate: + values.append(str(candidate)) + return self._dedupe(values) + + def _matches(self, row: dict, *, anchor_type: str, anchor_value: str) -> bool: + haystacks = [ + str(row.get("path") or "").lower(), + str(row.get("title") or "").lower(), + str(row.get("content") or "").lower(), + str(dict(row.get("metadata") or {}).get("endpoint") or "").lower(), + str(dict(row.get("metadata") or {}).get("entity") or "").lower(), + str(dict(row.get("metadata") or {}).get("component") or "").lower(), + str(dict(row.get("metadata") or {}).get("document_id") or "").lower(), + str(dict(row.get("metadata") or {}).get("doc_id") or "").lower(), + ] + needle = anchor_value.lower().strip() + if anchor_type == "endpoint": + return any(needle == value or f" {needle}" in f" {value}" for value in haystacks if value) + return any(needle in value for value in haystacks if value) + + def _expand_support_rows(self, rows: list[dict], exact: list[dict]) -> list[dict]: + doc_ids = self._doc_ids(exact) + paths = {str(row.get("path") or "").strip() for row in exact if str(row.get("path") or "").strip()} + expanded = list(exact) + for row in rows: + metadata = dict(row.get("metadata") or {}) + row_doc_ids = { + str(metadata.get("document_id") or "").strip(), + str(metadata.get("doc_id") or "").strip(), + } + row_path = str(row.get("path") or "").strip() + if row_path and row_path in paths: + expanded.append(row) + continue + if any(candidate and candidate in doc_ids for candidate in row_doc_ids): + expanded.append(row) + return self._dedupe_rows(expanded) + + def _doc_ids(self, rows: list[dict]) -> set[str]: + values: set[str] = set() + for row in rows: + metadata = dict(row.get("metadata") or {}) + for candidate in (metadata.get("document_id"), metadata.get("doc_id")): + value = str(candidate or "").strip() + if value: + values.add(value) + return values + + def _dedupe_rows(self, rows: list[dict]) -> list[dict]: + result: list[dict] = [] + seen: set[tuple[str, str, str, int | None, int | None]] = set() + for row in rows: + key = ( + str(row.get("layer") or ""), + str(row.get("path") or ""), + str(row.get("title") or ""), + row.get("span_start"), + row.get("span_end"), + ) + if key in seen: + continue + seen.add(key) + result.append(row) + return result + + def _dedupe(self, values: list[str]) -> list[str]: + result: list[str] = [] + seen: set[str] = set() + for value in values: + normalized = value.strip() + if not normalized: + continue + key = normalized.lower() + if key in seen: + continue + seen.add(key) + result.append(normalized) + return result diff --git a/src/app/modules/agent/runtime/docs_qa_pipeline/models.py b/src/app/modules/agent/runtime/docs_qa_pipeline/models.py new file mode 100644 index 0000000..43bf800 --- /dev/null +++ b/src/app/modules/agent/runtime/docs_qa_pipeline/models.py @@ -0,0 +1,114 @@ +from __future__ import annotations + +from dataclasses import dataclass, field +from typing import Any + +from pydantic import BaseModel, ConfigDict, Field + + +class OpenAPIResult(BaseModel): + model_config = ConfigDict(extra="forbid") + + path: str = "" + method: str = "" + request_schema: dict[str, Any] | None = None + response_schema: dict[str, Any] | None = None + raw_yaml: str = "" + diagnostics: dict[str, Any] = Field(default_factory=dict) + + +class DocsDiagnostics(BaseModel): + model_config = ConfigDict(extra="forbid") + + intent: str + sub_intent: str + layers_used: list[str] = Field(default_factory=list) + documents_found: int = 0 + facts_found: int = 0 + relations_found: int = 0 + openapi_fields_extracted: int = 0 + missing_required_fields: list[str] = Field(default_factory=list) + openapi_status: dict[str, bool] = Field(default_factory=dict) + prompt_used: str = "" + llm_mode: str = "prose" + output_valid: bool = True + matched_intent_source: str = "deterministic" + matched_anchor_type: str = "none" + matched_anchor_value: str | None = None + exact_anchor_match: bool = False + docs_layers_requested: list[str] = Field(default_factory=list) + docs_layers_with_hits: list[str] = Field(default_factory=list) + planned_layers: list[str] = Field(default_factory=list) + executed_layers: list[str] = Field(default_factory=list) + non_empty_layers: list[str] = Field(default_factory=list) + layer_diagnostics: dict[str, Any] = Field(default_factory=dict) + query_entity_candidates: list[str] = Field(default_factory=list) + resolved_entity_candidates: list[str] = Field(default_factory=list) + query_anchor_candidates: list[str] = Field(default_factory=list) + resolved_anchor_candidates: list[str] = Field(default_factory=list) + anchor_candidates: list[str] = Field(default_factory=list) + selected_anchor: str | None = None + anchor_selection_reason: str = "" + anchor_match_type: str = "" + doc_ids: list[str] = Field(default_factory=list) + doc_paths: list[str] = Field(default_factory=list) + doc_titles: list[str] = Field(default_factory=list) + relation_hits_count: int = 0 + relation_targets: list[str] = Field(default_factory=list) + selected_doc_ids: list[str] = Field(default_factory=list) + selected_fact_ids: list[str] = Field(default_factory=list) + selected_relation_ids: list[str] = Field(default_factory=list) + selected_chunk_ids: list[str] = Field(default_factory=list) + selected_entity_ids: list[str] = Field(default_factory=list) + selected_workflow_ids: list[str] = Field(default_factory=list) + fallback_doc_hits_count: int = 0 + fallback_used: bool = False + fact_hits: int = 0 + entity_hits: int = 0 + evidence_summary: dict[str, Any] = Field(default_factory=dict) + gate_decision: str = "ready" + gate_decision_reason: str = "" + gate_missing_requirements: list[str] = Field(default_factory=list) + gate_satisfied_requirements: list[str] = Field(default_factory=list) + openapi_evidence: dict[str, bool] = Field(default_factory=dict) + requested_fragment_type: str | None = None + fragment_evidence_found: list[str] = Field(default_factory=list) + fragment_missing_requirements: list[str] = Field(default_factory=list) + prompt: dict[str, Any] = Field(default_factory=dict) + answer_mode: str = "answered" + degrade_reason: str | None = None + degraded_reason: str | None = None + code_intents_stubbed: bool = False + + +@dataclass(slots=True) +class DocsEvidenceBundle: + intent: str + sub_intent: str + documents: list[dict[str, Any]] = field(default_factory=list) + facts: list[dict[str, Any]] = field(default_factory=list) + entities: list[dict[str, Any]] = field(default_factory=list) + workflows: list[dict[str, Any]] = field(default_factory=list) + relations: list[dict[str, Any]] = field(default_factory=list) + chunks: list[dict[str, Any]] = field(default_factory=list) + raw_rows: list[dict[str, Any]] = field(default_factory=list) + + +@dataclass(slots=True) +class DocsQAPipelineResult: + user_query: str + rag_session_id: str + router_result: Any + retrieval_request: Any + evidence_bundle: DocsEvidenceBundle + answer: str + diagnostics: DocsDiagnostics + openapi_result: OpenAPIResult | None = None + prompt_name: str = "" + llm_request: dict[str, Any] = field(default_factory=dict) + output_valid: bool = True + answer_mode: str = "answered" + degraded_reason: str = "" + raw_rows: list[dict[str, Any]] = field(default_factory=list) + timings_ms: dict[str, int] = field(default_factory=dict) + mode: str = "full" diff --git a/src/app/modules/agent/runtime/docs_qa_pipeline/openapi_evidence_extractor.py b/src/app/modules/agent/runtime/docs_qa_pipeline/openapi_evidence_extractor.py new file mode 100644 index 0000000..62f3358 --- /dev/null +++ b/src/app/modules/agent/runtime/docs_qa_pipeline/openapi_evidence_extractor.py @@ -0,0 +1,187 @@ +from __future__ import annotations + +import re +from typing import Any + +from app.modules.agent.runtime.docs_qa_pipeline.models import DocsEvidenceBundle + + +class OpenAPIEvidenceExtractor: + _PATH_RE = re.compile(r"(/[a-z0-9_./{}-]+)", re.IGNORECASE) + _METHOD_RE = re.compile(r"\b(get|post|put|patch|delete)\b", re.IGNORECASE) + _FIELD_RE = re.compile(r"\b([a-z_][a-z0-9_]{1,40})\b") + _STATUS_RE = re.compile(r"\b(200|201|202|204|400|401|403|404|409|422|500|503)\b") + _FIELD_STOPWORDS = { + "request", + "response", + "schema", + "payload", + "fields", + "contains", + "type", + "properties", + "post", + "get", + "put", + "patch", + "delete", + "endpoint", + "returns", + "return", + "with", + "and", + "for", + "send", + "health", + "status", + "result", + "body", + } + + def extract(self, bundle: DocsEvidenceBundle, *, requested_fragment_type: str | None) -> dict[str, Any]: + items = [*bundle.facts, *bundle.documents, *bundle.chunks] + path = self._extract_path(items) + method = self._extract_method(items) + request_schema = self._extract_schema(items, "request") + response_schema = self._extract_schema(items, "response") + if request_schema is None and requested_fragment_type == "request_schema": + request_schema = self._schema_from_text(items, kind="request") + if response_schema is None and requested_fragment_type == "response_schema": + response_schema = self._schema_from_text(items, kind="response") + if request_schema is None and response_schema is None and requested_fragment_type == "schema_fragment": + request_schema = self._schema_from_text(items, kind="schema") + status_codes = self._status_codes(items) + content_type = self._content_type(items) + operation_summary = self._operation_summary(items) + examples_found = self._examples_found(items) + diagnostics = { + "has_path": bool(path), + "has_method": bool(method), + "has_request": request_schema is not None, + "has_response": response_schema is not None, + "operation_semantics_found": bool(operation_summary), + "request_payload_found": request_schema is not None or self._has_payload_text(items, "request"), + "request_fields_found": self._field_count(request_schema) > 0, + "response_payload_found": response_schema is not None or self._has_payload_text(items, "response"), + "response_fields_found": self._field_count(response_schema) > 0, + "status_codes_found": bool(status_codes), + "content_type_found": bool(content_type), + "examples_found": examples_found, + "payload_description_found": self._has_payload_description(items), + "status_codes": status_codes, + "content_type": content_type, + "operation_summary": operation_summary, + } + return { + "path": path, + "method": method, + "request_schema": request_schema, + "response_schema": response_schema, + "diagnostics": diagnostics, + } + + def _extract_path(self, items: list[dict[str, Any]]) -> str: + for item in items: + metadata = dict(item.get("metadata") or {}) + if metadata.get("endpoint"): + return str(metadata["endpoint"]) + for source in (item.get("title"), item.get("content")): + match = self._PATH_RE.search(str(source or "")) + if match: + return match.group(1) + return "" + + def _extract_method(self, items: list[dict[str, Any]]) -> str: + for item in items: + metadata = dict(item.get("metadata") or {}) + if metadata.get("http_method"): + return str(metadata["http_method"]).lower() + for source in (item.get("title"), item.get("content")): + match = self._METHOD_RE.search(str(source or "")) + if match: + return match.group(1).lower() + return "" + + def _extract_schema(self, items: list[dict[str, Any]], kind: str) -> dict[str, Any] | None: + for item in items: + metadata = dict(item.get("metadata") or {}) + candidate = metadata.get(f"{kind}_schema") or metadata.get(f"{kind}_fields") + schema = self._as_schema(candidate) + if schema is not None: + return schema + return None + + def _schema_from_text(self, items: list[dict[str, Any]], *, kind: str) -> dict[str, Any] | None: + markers = { + "request": ("request", "payload", "body", "fields", "message", "chat_id"), + "response": ("response", "returns", "result", "status", "body"), + "schema": ("schema", "payload", "fields", "properties"), + } + fields: list[str] = [] + for item in items: + text = " ".join((str(item.get("title") or ""), str(item.get("content") or ""))).lower() + if not any(marker in text for marker in markers[kind]): + continue + for token in self._FIELD_RE.findall(text): + if token in self._FIELD_STOPWORDS: + continue + if token not in fields: + fields.append(token) + if not fields: + return None + properties = {name: {"type": "string"} for name in fields[:8]} + required = [name for name in fields[:3] if len(name) > 1] + result: dict[str, Any] = {"type": "object", "properties": properties} + if required: + result["required"] = required + return result + + def _as_schema(self, value: Any) -> dict[str, Any] | None: + if isinstance(value, dict): + return value + if isinstance(value, list): + properties = {str(item): {"type": "string"} for item in value if str(item).strip()} + return {"type": "object", "properties": properties} if properties else None + return None + + def _status_codes(self, items: list[dict[str, Any]]) -> list[str]: + values: list[str] = [] + for item in items: + text = " ".join((str(item.get("title") or ""), str(item.get("content") or ""))) + for code in self._STATUS_RE.findall(text): + if code not in values: + values.append(code) + return values + + def _content_type(self, items: list[dict[str, Any]]) -> str: + for item in items: + text = " ".join((str(item.get("title") or ""), str(item.get("content") or ""))).lower() + for marker in ("application/json", "json", "multipart/form-data", "x-www-form-urlencoded"): + if marker in text: + return marker + return "" + + def _operation_summary(self, items: list[dict[str, Any]]) -> str: + for item in items: + for source in (item.get("title"), item.get("content")): + text = str(source or "").strip() + if len(text) >= 8: + return text[:120] + return "" + + def _examples_found(self, items: list[dict[str, Any]]) -> bool: + for item in items: + text = " ".join((str(item.get("title") or ""), str(item.get("content") or ""))).lower() + if any(marker in text for marker in ("example", "пример", "{", "}")): + return True + return False + + def _has_payload_text(self, items: list[dict[str, Any]], kind: str) -> bool: + markers = ("payload", "body", "fields", "request") if kind == "request" else ("response", "returns", "status", "body") + return any(any(marker in str(item.get("content") or "").lower() for marker in markers) for item in items) + + def _has_payload_description(self, items: list[dict[str, Any]]) -> bool: + return any(len(str(item.get("content") or "").strip()) >= 12 for item in items) + + def _field_count(self, schema: dict[str, Any] | None) -> int: + return len((schema or {}).get("properties") or {}) diff --git a/src/app/modules/agent/runtime/docs_qa_pipeline/openapi_generator.py b/src/app/modules/agent/runtime/docs_qa_pipeline/openapi_generator.py new file mode 100644 index 0000000..211866f --- /dev/null +++ b/src/app/modules/agent/runtime/docs_qa_pipeline/openapi_generator.py @@ -0,0 +1,161 @@ +from __future__ import annotations + +from typing import Any + +from app.modules.agent.runtime.docs_qa_pipeline.models import DocsEvidenceBundle, OpenAPIResult +from app.modules.agent.runtime.docs_qa_pipeline.openapi_evidence_extractor import OpenAPIEvidenceExtractor + + +class OpenAPIGenerator: + def __init__(self, extractor: OpenAPIEvidenceExtractor | None = None) -> None: + self._extractor = extractor or OpenAPIEvidenceExtractor() + + def generate( + self, + evidence_bundle: DocsEvidenceBundle, + mode: str, + *, + requested_fragment_type: str | None = None, + ) -> OpenAPIResult: + extracted = self._extractor.extract(evidence_bundle, requested_fragment_type=requested_fragment_type) + path = str(extracted["path"] or "") + method = str(extracted["method"] or "") + request_schema = extracted["request_schema"] + response_schema = extracted["response_schema"] + diagnostics = dict(extracted["diagnostics"] or {}) + diagnostics["missing_required_fields"] = self._missing_fields( + path=path, + method=method, + request_schema=request_schema, + response_schema=response_schema, + mode=mode, + requested_fragment_type=requested_fragment_type, + diagnostics=diagnostics, + ) + raw_yaml = self._render( + path=path, + method=method, + request_schema=request_schema, + response_schema=response_schema, + mode=mode, + requested_fragment_type=requested_fragment_type, + diagnostics=diagnostics, + ) + return OpenAPIResult( + path=path, + method=method, + request_schema=request_schema, + response_schema=response_schema, + raw_yaml=raw_yaml, + diagnostics=diagnostics, + ) + + def _missing_fields( + self, + *, + path: str, + method: str, + request_schema: dict[str, Any] | None, + response_schema: dict[str, Any] | None, + mode: str, + requested_fragment_type: str | None, + diagnostics: dict[str, Any], + ) -> list[str]: + missing: list[str] = [] + if not path: + missing.append("path") + if mode == "OPENAPI_FRAGMENT_GENERATE": + if requested_fragment_type == "request_schema" and request_schema is None and not diagnostics.get("request_payload_found"): + missing.append("request_schema") + elif requested_fragment_type == "response_schema" and response_schema is None and not diagnostics.get("response_payload_found"): + missing.append("response_schema") + elif requested_fragment_type == "parameters" and not diagnostics.get("has_method"): + missing.append("parameters") + elif request_schema is None and response_schema is None and not diagnostics.get("payload_description_found"): + missing.append("schema_fragment") + return missing + if not method: + missing.append("method") + if request_schema is None and not diagnostics.get("request_payload_found"): + missing.append("request_schema") + if response_schema is None and not diagnostics.get("response_payload_found") and not diagnostics.get("status_codes_found"): + missing.append("response_schema") + return missing + + def _render( + self, + *, + path: str, + method: str, + request_schema: dict[str, Any] | None, + response_schema: dict[str, Any] | None, + mode: str, + requested_fragment_type: str | None, + diagnostics: dict[str, Any], + ) -> str: + if mode == "OPENAPI_FRAGMENT_GENERATE": + if requested_fragment_type == "response_schema": + return self._render_schema(response_schema, diagnostics, "Documented response fragment") + return self._render_schema(request_schema or response_schema, diagnostics, "Documented schema fragment") + if not path: + return "" + method_line = method or "get" + summary = str(diagnostics.get("operation_summary") or "Documented API method") + response_block = self._render_responses(response_schema, diagnostics) + request_block = self._render_request_body(request_schema, diagnostics) + return "\n".join( + [ + "paths:", + f" {path}:", + f" {method_line}:", + f" summary: \"{summary}\"", + *request_block, + " responses:", + *response_block, + ] + ) + + def _render_schema(self, schema: dict[str, Any] | None, diagnostics: dict[str, Any], fallback_description: str) -> str: + if schema is None: + return "\n".join(["type: object", f"description: \"{fallback_description}\""]) + return self._yaml_from_object(schema, indent=0) + + def _render_request_body(self, schema: dict[str, Any] | None, diagnostics: dict[str, Any]) -> list[str]: + lines = [" requestBody:"] + if schema is None: + description = "Documented request payload" if diagnostics.get("request_payload_found") else "Request payload not fully documented" + lines.append(f" description: \"{description}\"") + return lines + lines.append(" content:") + content_type = str(diagnostics.get("content_type") or "application/json") + lines.append(f" {content_type}:") + lines.append(" schema:") + lines.extend(self._yaml_from_object(schema, indent=14).splitlines()) + return lines + + def _render_responses(self, schema: dict[str, Any] | None, diagnostics: dict[str, Any]) -> list[str]: + status_codes = list(diagnostics.get("status_codes") or []) or ["200"] + code = status_codes[0] + lines = [f" \"{code}\":", " description: \"Documented response\""] + if schema is not None: + lines.append(" content:") + content_type = str(diagnostics.get("content_type") or "application/json") + lines.append(f" {content_type}:") + lines.append(" schema:") + lines.extend(self._yaml_from_object(schema, indent=16).splitlines()) + return lines + + def _yaml_from_object(self, value: dict[str, Any], *, indent: int) -> str: + lines: list[str] = [] + prefix = " " * indent + for key, item in value.items(): + if isinstance(item, dict): + lines.append(f"{prefix}{key}:") + lines.append(self._yaml_from_object(item, indent=indent + 2)) + elif isinstance(item, list): + lines.append(f"{prefix}{key}:") + for row in item: + lines.append(f"{prefix} - {row}") + else: + lines.append(f"{prefix}{key}: {item}") + return "\n".join(lines) diff --git a/src/app/modules/agent/runtime/docs_qa_pipeline/openapi_postprocessor.py b/src/app/modules/agent/runtime/docs_qa_pipeline/openapi_postprocessor.py new file mode 100644 index 0000000..df94e31 --- /dev/null +++ b/src/app/modules/agent/runtime/docs_qa_pipeline/openapi_postprocessor.py @@ -0,0 +1,37 @@ +from __future__ import annotations + +import yaml + + +class OpenAPIPostprocessor: + _ALLOWED_METHODS = {"get", "post", "put", "delete", "patch"} + + def validate(self, answer: str, *, require_paths: bool) -> tuple[bool, dict]: + try: + payload = yaml.safe_load(answer) or {} + except yaml.YAMLError: + return False, {"reason": "invalid_yaml"} + if not isinstance(payload, dict): + return False, {"reason": "invalid_yaml_root"} + if require_paths: + paths = payload.get("paths") + if not isinstance(paths, dict) or not paths: + return False, {"reason": "missing_paths"} + methods = self._methods(paths) + if not methods: + return False, {"reason": "missing_method"} + return True, {"reason": "ok", "methods": methods} + if not isinstance(payload, dict) or not payload: + return False, {"reason": "empty_schema"} + return True, {"reason": "ok"} + + def _methods(self, paths: dict) -> list[str]: + methods: list[str] = [] + for item in paths.values(): + if not isinstance(item, dict): + continue + for method in item.keys(): + method_name = str(method).lower() + if method_name in self._ALLOWED_METHODS and method_name not in methods: + methods.append(method_name) + return methods diff --git a/src/app/modules/agent/runtime/docs_qa_pipeline/pipeline.py b/src/app/modules/agent/runtime/docs_qa_pipeline/pipeline.py new file mode 100644 index 0000000..af42996 --- /dev/null +++ b/src/app/modules/agent/runtime/docs_qa_pipeline/pipeline.py @@ -0,0 +1,664 @@ +from __future__ import annotations + +import math +from time import perf_counter +from typing import Any + +from app.modules.agent.llm import AgentLlmService +from app.modules.agent.llm.prompt_loader import PromptLoader +from app.modules.agent.intent_router_v2.analysis.docs_query_signals import DocsQuerySignals +from app.modules.agent.runtime.docs_qa_pipeline.answer_synthesizer import DocsAnswerSynthesizer +from app.modules.agent.runtime.docs_qa_pipeline.anchor_selector import DocsAnchorSelector +from app.modules.agent.runtime.docs_qa_pipeline.diagnostics_builder import DocsDiagnosticsBuilder +from app.modules.agent.runtime.docs_qa_pipeline.evidence_builder import DocsEvidenceBuilder +from app.modules.agent.runtime.docs_qa_pipeline.exact_anchor_matcher import DocsExactAnchorMatcher +from app.modules.agent.runtime.docs_qa_pipeline.models import DocsQAPipelineResult +from app.modules.agent.runtime.docs_qa_pipeline.openapi_postprocessor import OpenAPIPostprocessor +from app.modules.agent.runtime.docs_qa_pipeline.openapi_generator import OpenAPIGenerator +from app.modules.agent.runtime.docs_qa_pipeline.prompt_payload_builder import DocsPromptPayloadBuilder +from app.modules.agent.runtime.legacy_pipeline import RetrievalAdapter +from app.modules.agent.runtime.steps.context import build_retrieval_request +from app.modules.agent.runtime.steps.generation import RuntimePromptSelector + + +class DocsQAPipelineRunner: + def __init__( + self, + router: Any, + retrieval_adapter: RetrievalAdapter, + repo_context: Any = None, + llm: AgentLlmService | None = None, + evidence_builder: DocsEvidenceBuilder | None = None, + answer_synthesizer: DocsAnswerSynthesizer | None = None, + openapi_generator: OpenAPIGenerator | None = None, + diagnostics_builder: DocsDiagnosticsBuilder | None = None, + prompt_selector: RuntimePromptSelector | None = None, + prompt_payload_builder: DocsPromptPayloadBuilder | None = None, + openapi_postprocessor: OpenAPIPostprocessor | None = None, + exact_anchor_matcher: DocsExactAnchorMatcher | None = None, + anchor_selector: DocsAnchorSelector | None = None, + ) -> None: + self._router = router + self._adapter = retrieval_adapter + self._repo_context = repo_context + self._llm = llm + self._evidence_builder = evidence_builder or DocsEvidenceBuilder() + self._answer_synthesizer = answer_synthesizer or DocsAnswerSynthesizer() + self._openapi_generator = openapi_generator or OpenAPIGenerator() + self._diagnostics_builder = diagnostics_builder or DocsDiagnosticsBuilder() + self._prompt_selector = prompt_selector or RuntimePromptSelector() + self._prompt_payload_builder = prompt_payload_builder or DocsPromptPayloadBuilder() + self._openapi_postprocessor = openapi_postprocessor or OpenAPIPostprocessor() + self._exact_anchor_matcher = exact_anchor_matcher or DocsExactAnchorMatcher() + self._anchor_selector = anchor_selector or DocsAnchorSelector() + self._docs_signals = DocsQuerySignals() + + def run( + self, + user_query: str, + rag_session_id: str, + *, + conversation_state: Any = None, + mode: str = "full", + ) -> DocsQAPipelineResult: + timings: dict[str, int] = {} + t0 = perf_counter() + router_result = self._router.route( + user_query, + conversation_state or _default_conversation_state(), + self._repo_context or _default_repo_context(), + ) + timings["router"] = _ms(t0) + + t1 = perf_counter() + request = build_retrieval_request(router_result, rag_session_id) + raw_rows = self._adapter.retrieve_with_plan( + rag_session_id, + request.query, + request.retrieval_spec, + request.retrieval_constraints, + query_plan=request.query_plan, + ) + retrieval_report = self._adapter.consume_retrieval_report() if hasattr(self._adapter, "consume_retrieval_report") else {} + unfiltered_rows = list(raw_rows) + raw_rows, exact_anchor_match = self._exact_anchor_matcher.filter_rows( + raw_rows, + anchor_type=router_result.matched_anchor_type, + anchor_value=router_result.matched_anchor_value, + ) + if request.sub_intent == "RELATED_DOCS_EXPLAIN" and not raw_rows and self._has_relation_hits(unfiltered_rows): + raw_rows = unfiltered_rows + timings["retrieval"] = _ms(t1) + + t2 = perf_counter() + evidence_bundle = self._evidence_builder.build( + intent=router_result.intent, + sub_intent=request.sub_intent, + raw_rows=raw_rows, + ) + anchor_selection = self._anchor_selector.select( + sub_intent=request.sub_intent, + anchor_type=router_result.matched_anchor_type, + anchor_value=router_result.matched_anchor_value, + rows=raw_rows, + ) + openapi_result = None + prompt_name = self._prompt_selector.select( + intent=router_result.intent, + sub_intent=request.sub_intent, + answer_mode="normal", + ) + llm_mode = self._llm_mode(router_result.intent, request.sub_intent) + output_valid = True + answer_mode = "diagnostic_only" if mode == "pre_llm_only" else "answered" + degraded_reason = "" + answer = "" + llm_request: dict[str, Any] = {} + requested_fragment_type = self._requested_fragment_type(user_query, request.sub_intent) + if router_result.intent in {"OPENAPI_GENERATION", "OPENAPI_FROM_DOCUMENTATION"}: + openapi_result = self._openapi_generator.generate( + evidence_bundle, + request.sub_intent, + requested_fragment_type=requested_fragment_type, + ) + llm_request = self._build_llm_request( + question=user_query, + intent=router_result.intent, + sub_intent=request.sub_intent, + evidence_bundle=evidence_bundle, + prompt_name=prompt_name, + log_context="graph.project_qa.docs.openapi", + api_contract=openapi_result, + ) + if mode == "pre_llm_only": + answer_mode, degraded_reason, output_valid = self._evaluate_openapi_gate( + user_query=user_query, + sub_intent=request.sub_intent, + router_result=router_result, + openapi_result=openapi_result, + exact_anchor_match=exact_anchor_match, + ) + answer = openapi_result.raw_yaml if answer_mode != "degraded" else "Недостаточно contract evidence для OpenAPI." + else: + answer = self._generate_openapi_answer(user_query, router_result.intent, request.sub_intent, evidence_bundle, openapi_result) + output_valid, llm_details = self._openapi_postprocessor.validate( + answer, + require_paths=request.sub_intent != "OPENAPI_FRAGMENT_GENERATE", + ) + if not output_valid: + answer = openapi_result.raw_yaml + openapi_result = openapi_result.model_copy( + update={"diagnostics": {**openapi_result.diagnostics, "llm_validation": llm_details}} + ) + answer_mode, degraded_reason, output_valid, answer = self._finalize_openapi_answer( + answer=answer, + router_result=router_result, + openapi_result=openapi_result, + output_valid=output_valid, + exact_anchor_match=exact_anchor_match, + ) + else: + llm_request = self._build_llm_request( + question=user_query, + intent=router_result.intent, + sub_intent=request.sub_intent, + evidence_bundle=evidence_bundle, + prompt_name=prompt_name, + log_context="graph.project_qa.docs.answer", + ) + if mode == "pre_llm_only": + answer_mode, degraded_reason = self._evaluate_docs_gate( + raw_rows=raw_rows, + sub_intent=request.sub_intent, + matched_anchor_type=router_result.matched_anchor_type, + exact_anchor_match=exact_anchor_match, + matched_anchor_value=router_result.matched_anchor_value, + ) + output_valid = answer_mode != "degraded" + else: + answer = self._generate_docs_answer(user_query, router_result.intent, request.sub_intent, evidence_bundle) + answer_mode, degraded_reason, answer = self._finalize_docs_answer( + answer=answer, + raw_rows=raw_rows, + sub_intent=request.sub_intent, + matched_anchor_type=router_result.matched_anchor_type, + exact_anchor_match=exact_anchor_match, + matched_anchor_value=router_result.matched_anchor_value, + ) + gate_decision, gate_decision_reason, gate_missing_requirements, gate_satisfied_requirements = self._build_gate_details( + intent=router_result.intent, + sub_intent=request.sub_intent, + answer_mode=answer_mode, + degraded_reason=degraded_reason, + raw_rows=raw_rows, + exact_anchor_match=exact_anchor_match, + matched_anchor_type=router_result.matched_anchor_type, + matched_anchor_value=router_result.matched_anchor_value, + openapi_result=openapi_result, + router_result=router_result, + ) + diagnostics = self._diagnostics_builder.build( + intent=router_result.intent, + sub_intent=request.sub_intent, + planned_layers=list(request.requested_layers), + executed_layers=list(retrieval_report.get("executed_layers") or request.requested_layers), + non_empty_layers=self._non_empty_layers(raw_rows, retrieval_report, request.sub_intent), + layer_diagnostics=dict(retrieval_report.get("layer_diagnostics") or {}), + evidence_bundle=evidence_bundle, + openapi_result=openapi_result, + prompt_used=prompt_name, + llm_mode=llm_mode, + answer_mode=answer_mode, + output_valid=output_valid, + matched_intent_source=router_result.matched_intent_source, + matched_anchor_type=router_result.matched_anchor_type, + matched_anchor_value=router_result.matched_anchor_value, + exact_anchor_match=exact_anchor_match, + query_entity_candidates=self._docs_signals.query_entity_candidates(user_query), + resolved_entity_candidates=self._exact_anchor_matcher.resolved_entity_candidates(raw_rows), + query_anchor_candidates=self._docs_signals.query_anchor_candidates(user_query), + resolved_anchor_candidates=self._exact_anchor_matcher.resolved_anchor_candidates(raw_rows), + anchor_candidates=list(anchor_selection.get("anchor_candidates") or []), + selected_anchor=anchor_selection.get("selected_anchor"), + anchor_selection_reason=str(anchor_selection.get("anchor_selection_reason") or ""), + anchor_match_type=str(anchor_selection.get("anchor_match_type") or ""), + docs_layers_with_hits=self._non_empty_layers(raw_rows, retrieval_report, request.sub_intent), + gate_decision=gate_decision, + gate_decision_reason=gate_decision_reason, + gate_missing_requirements=gate_missing_requirements, + gate_satisfied_requirements=gate_satisfied_requirements, + requested_fragment_type=("method" if request.sub_intent == "OPENAPI_METHOD_GENERATE" else requested_fragment_type), + fragment_evidence_found=self._fragment_evidence_found(requested_fragment_type, openapi_result), + fragment_missing_requirements=self._fragment_missing_requirements(requested_fragment_type, openapi_result), + prompt=llm_request, + degraded_reason=degraded_reason or None, + fallback_used=bool(dict(retrieval_report.get("fallback") or {}).get("used")), + code_intents_stubbed=False, + ) + timings["execution"] = _ms(t2) + return DocsQAPipelineResult( + user_query=user_query, + rag_session_id=rag_session_id, + router_result=router_result, + retrieval_request=request, + evidence_bundle=evidence_bundle, + answer=answer, + diagnostics=diagnostics, + openapi_result=openapi_result, + prompt_name=prompt_name, + llm_request=llm_request, + output_valid=output_valid, + answer_mode=answer_mode, + degraded_reason=degraded_reason, + raw_rows=raw_rows, + timings_ms=timings, + mode=mode, + ) + + def _generate_docs_answer(self, question: str, intent: str, sub_intent: str, evidence_bundle) -> str: + if self._llm is None: + return self._answer_synthesizer.synthesize(question, evidence_bundle) + payload = self._prompt_payload_builder.build( + question=question, + intent=intent, + sub_intent=sub_intent, + evidence_bundle=evidence_bundle, + ) + prompt_name = self._prompt_selector.select(intent=intent, sub_intent=sub_intent, answer_mode="normal") + return self._llm.generate(prompt_name, payload, log_context="graph.project_qa.docs.answer").strip() + + def _generate_openapi_answer(self, question: str, intent: str, sub_intent: str, evidence_bundle, api_contract) -> str: + if self._llm is None: + return api_contract.raw_yaml + payload = self._prompt_payload_builder.build( + question=question, + intent=intent, + sub_intent=sub_intent, + evidence_bundle=evidence_bundle, + api_contract=api_contract, + ) + prompt_name = self._prompt_selector.select(intent=intent, sub_intent=sub_intent, answer_mode="normal") + return self._llm.generate(prompt_name, payload, log_context="graph.project_qa.docs.openapi").strip() + + def _llm_mode(self, intent: str, sub_intent: str) -> str: + if sub_intent == "RELATED_DOCS_EXPLAIN": + return "graph_summary" + if intent == "GENERAL_QA": + return "prose" + if intent in {"OPENAPI_GENERATION", "OPENAPI_FROM_DOCUMENTATION"}: + return "yaml" + return "prose" + + def _build_llm_request( + self, + *, + question: str, + intent: str, + sub_intent: str, + evidence_bundle, + prompt_name: str, + log_context: str, + api_contract=None, + ) -> dict[str, Any]: + user_prompt = self._prompt_payload_builder.build( + question=question, + intent=intent, + sub_intent=sub_intent, + evidence_bundle=evidence_bundle, + api_contract=api_contract, + ) + system_prompt = PromptLoader().load(prompt_name) or "You are a helpful assistant." + tokens_in_estimate = max(1, int(math.ceil((len(system_prompt) + len(user_prompt)) / 4))) + return { + "prompt_name": prompt_name, + "system_prompt": system_prompt, + "user_prompt": user_prompt, + "log_context": log_context, + "prompt_stats": { + "system_chars": len(system_prompt), + "user_chars": len(user_prompt), + "tokens_in_estimate": tokens_in_estimate, + }, + } + + def _finalize_docs_answer( + self, + *, + answer: str, + raw_rows: list[dict], + sub_intent: str, + matched_anchor_type: str, + exact_anchor_match: bool, + matched_anchor_value: str | None, + ) -> tuple[str, str, str]: + if self._should_reject_on_exact_anchor( + sub_intent=sub_intent, + raw_rows=raw_rows, + matched_anchor_type=matched_anchor_type, + matched_anchor_value=matched_anchor_value, + exact_anchor_match=exact_anchor_match, + ): + return "degraded", "not_found_exact_anchor", "Не найдено точное совпадение по запрошенному docs anchor." + if not raw_rows: + return "degraded", "retrieval_empty", "По документации не найдено релевантных данных." + if not answer.strip(): + return "degraded", "insufficient_docs_evidence", "Недостаточно подтвержденных данных в документации." + return "answered", "", answer + + def _finalize_openapi_answer( + self, + *, + answer: str, + router_result, + openapi_result, + output_valid: bool, + exact_anchor_match: bool, + ) -> tuple[str, str, bool, str]: + requested_endpoint = str(router_result.matched_anchor_value or "").strip() + generated_endpoint = str(openapi_result.path or "").strip() + diagnostics = dict(openapi_result.diagnostics or {}) + if requested_endpoint and not exact_anchor_match: + return "degraded", "not_found_exact_anchor", False, "Не найден точный endpoint в документации." + if requested_endpoint and generated_endpoint and requested_endpoint != generated_endpoint: + return "degraded", "generated_endpoint_mismatch", False, "OpenAPI сгенерирован не по запрошенному endpoint." + if str(getattr(router_result.retrieval_spec.filters, "doc_type", "") or "") != "api_method": + return "degraded", "wrong_doc_type_match", False, "Для OpenAPI не найден подходящий api_method evidence." + if not generated_endpoint: + return "degraded", "insufficient_docs_evidence", False, "Недостаточно contract evidence для OpenAPI." + has_partial_contract = any( + ( + openapi_result.request_schema is not None, + openapi_result.response_schema is not None, + diagnostics.get("status_codes_found"), + diagnostics.get("payload_description_found"), + ) + ) + if not has_partial_contract: + return "degraded", "insufficient_docs_evidence", False, "Недостаточно contract evidence для OpenAPI." + if not output_valid: + return "structured_spec_partial", "invalid_llm_output_fallback", False, answer + if openapi_result.method and openapi_result.response_schema is not None and openapi_result.request_schema is not None: + return "structured_spec", "", True, answer + if openapi_result.method or diagnostics.get("status_codes_found") or diagnostics.get("payload_description_found"): + return "structured_spec_partial", "answered_with_gaps", True, answer + return "degraded", "insufficient_docs_evidence", False, "Недостаточно contract evidence для OpenAPI." + + def _evaluate_docs_gate( + self, + *, + raw_rows: list[dict], + sub_intent: str, + matched_anchor_type: str, + exact_anchor_match: bool, + matched_anchor_value: str | None, + ) -> tuple[str, str]: + if self._should_reject_on_exact_anchor( + sub_intent=sub_intent, + raw_rows=raw_rows, + matched_anchor_type=matched_anchor_type, + matched_anchor_value=matched_anchor_value, + exact_anchor_match=exact_anchor_match, + ): + return "degraded", "not_found_exact_anchor" + if not raw_rows: + return "degraded", "retrieval_empty" + return "ready", "" + + def _evaluate_openapi_gate( + self, + *, + user_query: str, + sub_intent: str, + router_result, + openapi_result, + exact_anchor_match: bool, + ) -> tuple[str, str, bool]: + requested_endpoint = str(router_result.matched_anchor_value or "").strip() + generated_endpoint = str(openapi_result.path or "").strip() + diagnostics = dict(openapi_result.diagnostics or {}) + requested_fragment_type = self._requested_fragment_type(user_query, sub_intent) + has_operation_signal = bool(openapi_result.method) or bool(diagnostics.get("status_codes_found")) or bool(diagnostics.get("payload_description_found")) + has_contract_detail = any( + ( + openapi_result.request_schema is not None, + openapi_result.response_schema is not None, + diagnostics.get("status_codes_found"), + diagnostics.get("request_fields_found"), + diagnostics.get("response_fields_found"), + diagnostics.get("payload_description_found"), + ) + ) + if requested_endpoint and not exact_anchor_match: + return "degraded", "not_found_exact_anchor", False + if requested_endpoint and generated_endpoint and requested_endpoint != generated_endpoint: + return "degraded", "generated_endpoint_mismatch", False + if str(getattr(router_result.retrieval_spec.filters, "doc_type", "") or "") != "api_method": + return "degraded", "wrong_doc_type_match", False + if not generated_endpoint or not has_operation_signal: + return "degraded", "insufficient_docs_evidence", False + if sub_intent == "OPENAPI_FRAGMENT_GENERATE": + return self._evaluate_fragment_gate(requested_fragment_type, openapi_result) + if not openapi_result.method and not diagnostics.get("status_codes_found"): + return "degraded", "insufficient_docs_evidence", False + if not has_contract_detail: + return "degraded", "insufficient_docs_evidence", False + if openapi_result.request_schema is None or openapi_result.response_schema is None: + return "ready_partial", "answered_with_gaps", True + return "ready", "", True + + def _build_gate_details( + self, + *, + intent: str, + sub_intent: str, + answer_mode: str, + degraded_reason: str, + raw_rows: list[dict], + exact_anchor_match: bool, + matched_anchor_type: str, + matched_anchor_value: str | None, + openapi_result, + router_result, + ) -> tuple[str, str, list[str], list[str]]: + satisfied: list[str] = [] + missing: list[str] = [] + relation_hits = self._relation_hits(raw_rows) + if raw_rows: + satisfied.append("retrieval_non_empty") + else: + missing.append("retrieval_non_empty") + if matched_anchor_type in {"endpoint", "entity"} and matched_anchor_value: + if exact_anchor_match or (sub_intent == "RELATED_DOCS_EXPLAIN" and relation_hits > 0): + satisfied.append("exact_anchor_match") + else: + missing.append("exact_anchor_match") + if intent in {"OPENAPI_GENERATION", "OPENAPI_FROM_DOCUMENTATION"} and openapi_result is not None: + if openapi_result.path: + satisfied.append("path_found") + else: + missing.append("path_found") + diagnostics = openapi_result.diagnostics + if openapi_result.method: + satisfied.append("http_method_found") + else: + missing.append("http_method_found") + if diagnostics.get("operation_semantics_found"): + satisfied.append("operation_semantics_found") + else: + missing.append("operation_semantics_found") + if diagnostics.get("request_payload_found"): + satisfied.append("request_payload_found") + if diagnostics.get("response_payload_found"): + satisfied.append("response_payload_found") + if openapi_result.request_schema is not None: + satisfied.append("request_fields_found") + if openapi_result.response_schema is not None: + satisfied.append("response_fields_found") + if openapi_result.request_schema is None and openapi_result.response_schema is None: + missing.append("contract_fields_found") + if diagnostics.get("status_codes_found"): + satisfied.append("status_codes_found") + else: + missing.append("status_codes_found") + if diagnostics.get("payload_description_found"): + satisfied.append("payload_description_found") + else: + missing.append("payload_description_found") + if diagnostics.get("content_type_found"): + satisfied.append("content_type_found") + if diagnostics.get("examples_found"): + satisfied.append("examples_found") + if str(getattr(router_result.retrieval_spec.filters, "doc_type", "") or "") == "api_method": + satisfied.append("api_method_filter") + else: + missing.append("api_method_filter") + gate = answer_mode + if gate in {"diagnostic_only", "ready", "answered", "structured_spec"}: + gate = "allow" if not degraded_reason else "reject" + elif gate in {"ready_partial", "structured_spec_partial"}: + gate = "partial" + elif gate == "degraded": + gate = "reject" + return gate, self._gate_reason(gate, degraded_reason, sub_intent, relation_hits), missing, satisfied + + def _non_empty_layers(self, rows: list[dict], report: dict[str, Any], sub_intent: str) -> list[str]: + diagnostics = dict(report.get("layer_diagnostics") or {}) + if sub_intent == "RELATED_DOCS_EXPLAIN" and int(dict(diagnostics.get("D5_RELATION_GRAPH") or {}).get("hits") or 0) > 0: + return ["D5_RELATION_GRAPH"] + if diagnostics: + return [layer for layer, payload in diagnostics.items() if int(dict(payload).get("hits") or 0) > 0] + return self._layers_with_hits(rows) + + def _layers_with_hits(self, rows: list[dict]) -> list[str]: + result: list[str] = [] + for row in rows: + layer = str(row.get("layer") or "") + if layer.startswith("D") and layer not in result: + result.append(layer) + return result + + def _should_reject_on_exact_anchor( + self, + *, + sub_intent: str, + raw_rows: list[dict], + matched_anchor_type: str, + matched_anchor_value: str | None, + exact_anchor_match: bool, + ) -> bool: + if matched_anchor_type not in {"endpoint", "entity"} or not matched_anchor_value or exact_anchor_match: + return False + if sub_intent == "RELATED_DOCS_EXPLAIN" and self._has_relation_hits(raw_rows): + return False + return True + + def _has_relation_hits(self, rows: list[dict]) -> bool: + return self._relation_hits(rows) > 0 + + def _relation_hits(self, rows: list[dict]) -> int: + return sum(1 for row in rows if str(row.get("layer") or "") == "D5_RELATION_GRAPH") + + def _gate_reason(self, gate: str, degraded_reason: str, sub_intent: str, relation_hits: int) -> str: + if degraded_reason: + return degraded_reason + if sub_intent == "RELATED_DOCS_EXPLAIN" and relation_hits > 0: + return "relation_evidence_available" + if gate == "partial": + return "partial_evidence_available" + if gate == "allow": + return "evidence_sufficient" + return "" + + def _evaluate_fragment_gate(self, requested_fragment_type: str | None, openapi_result) -> tuple[str, str, bool]: + diagnostics = dict(openapi_result.diagnostics or {}) + if requested_fragment_type == "request_schema": + if openapi_result.request_schema is not None: + return "ready", "", True + if diagnostics.get("request_fields_found") or diagnostics.get("request_payload_found") or diagnostics.get("payload_description_found"): + return "ready_partial", "fragment_payload_only", True + return "degraded", "insufficient_docs_evidence", False + if requested_fragment_type == "response_schema": + if openapi_result.response_schema is not None: + return "ready", "", True + if diagnostics.get("response_fields_found") or diagnostics.get("response_payload_found") or diagnostics.get("status_codes_found"): + return "ready_partial", "fragment_response_partial", True + return "degraded", "insufficient_docs_evidence", False + if requested_fragment_type == "parameters": + if diagnostics.get("has_method") or diagnostics.get("content_type_found"): + return "ready_partial", "fragment_parameters_partial", True + return "degraded", "insufficient_docs_evidence", False + if openapi_result.request_schema is not None or openapi_result.response_schema is not None: + return "ready_partial", "answered_with_gaps", True + if diagnostics.get("payload_description_found"): + return "ready_partial", "fragment_payload_only", True + return "degraded", "insufficient_docs_evidence", False + + def _requested_fragment_type(self, user_query: str, sub_intent: str) -> str | None: + if sub_intent != "OPENAPI_FRAGMENT_GENERATE": + return None + lowered = user_query.lower() + if "request" in lowered: + return "request_schema" + if "response" in lowered: + return "response_schema" + if "parameter" in lowered or "парамет" in lowered: + return "parameters" + return "schema_fragment" + + def _fragment_evidence_found(self, requested_fragment_type: str | None, openapi_result) -> list[str]: + if openapi_result is None or requested_fragment_type is None: + return [] + diagnostics = dict(openapi_result.diagnostics or {}) + found: list[str] = [] + if openapi_result.path: + found.append("path") + if openapi_result.method: + found.append("method") + if diagnostics.get("operation_semantics_found"): + found.append("operation_semantics") + if diagnostics.get("payload_description_found"): + found.append("payload_description") + if diagnostics.get("status_codes_found"): + found.append("status_codes") + if requested_fragment_type == "request_schema" and openapi_result.request_schema is not None: + found.append("request_schema") + if requested_fragment_type == "request_schema" and diagnostics.get("request_fields_found"): + found.append("request_fields") + if requested_fragment_type == "response_schema" and openapi_result.response_schema is not None: + found.append("response_schema") + if requested_fragment_type == "response_schema" and diagnostics.get("response_fields_found"): + found.append("response_fields") + return found + + def _fragment_missing_requirements(self, requested_fragment_type: str | None, openapi_result) -> list[str]: + if openapi_result is None or requested_fragment_type is None: + return [] + diagnostics = dict(openapi_result.diagnostics or {}) + missing: list[str] = [] + if not openapi_result.path: + missing.append("path") + if requested_fragment_type == "request_schema": + if openapi_result.request_schema is None and not diagnostics.get("payload_description_found"): + missing.append("request_payload_evidence") + elif requested_fragment_type == "response_schema": + if openapi_result.response_schema is None and not diagnostics.get("status_codes_found"): + missing.append("response_payload_evidence") + elif openapi_result.request_schema is None and openapi_result.response_schema is None: + missing.append("schema_fragment") + return missing + + +def _default_conversation_state() -> Any: + from app.modules.agent.intent_router_v2 import ConversationState + + return ConversationState() + + +def _default_repo_context() -> Any: + from app.modules.agent.intent_router_v2 import RepoContext + + return RepoContext() + + +def _ms(started: float) -> int: + return int((perf_counter() - started) * 1000) diff --git a/src/app/modules/agent/runtime/docs_qa_pipeline/prompt_payload_builder.py b/src/app/modules/agent/runtime/docs_qa_pipeline/prompt_payload_builder.py new file mode 100644 index 0000000..fc35ad7 --- /dev/null +++ b/src/app/modules/agent/runtime/docs_qa_pipeline/prompt_payload_builder.py @@ -0,0 +1,37 @@ +from __future__ import annotations + +import json + +from app.modules.agent.runtime.docs_qa_pipeline.models import DocsEvidenceBundle, OpenAPIResult + + +class DocsPromptPayloadBuilder: + def build( + self, + *, + question: str, + intent: str, + sub_intent: str, + evidence_bundle: DocsEvidenceBundle, + api_contract: OpenAPIResult | None = None, + ) -> str: + payload = { + "question": question, + "intent": intent, + "sub_intent": sub_intent, + "documents": list(evidence_bundle.documents), + "facts": list(evidence_bundle.facts), + "entities": list(evidence_bundle.entities), + "workflows": list(evidence_bundle.workflows), + "relations": list(evidence_bundle.relations), + "chunks": list(evidence_bundle.chunks), + } + if api_contract is not None: + payload["api_contract"] = { + "path": api_contract.path, + "method": api_contract.method, + "request_schema": api_contract.request_schema, + "response_schema": api_contract.response_schema, + "diagnostics": dict(api_contract.diagnostics), + } + return json.dumps(payload, ensure_ascii=False, indent=2) diff --git a/src/app/modules/agent/runtime/executor.py b/src/app/modules/agent/runtime/executor.py index 854ab42..f1c655f 100644 --- a/src/app/modules/agent/runtime/executor.py +++ b/src/app/modules/agent/runtime/executor.py @@ -228,7 +228,11 @@ class AgentRuntimeExecutor: post_gate=self._post_gate, ) state.synthesis_input = build_answer_synthesis_input(user_query, state.evidence_pack) - prompt_name = self._prompt_selector.select(sub_intent=state.retrieval_request.sub_intent, answer_mode=state.answer_mode) + prompt_name = self._prompt_selector.select( + intent=state.router_result.intent, + sub_intent=state.retrieval_request.sub_intent, + answer_mode=state.answer_mode, + ) prompt_payload = self._payload_builder.build( user_query=user_query, synthesis_input=state.synthesis_input, diff --git a/src/app/modules/agent/runtime/steps/context/answer_fact_curator.py b/src/app/modules/agent/runtime/steps/context/answer_fact_curator.py index a006770..75553ea 100644 --- a/src/app/modules/agent/runtime/steps/context/answer_fact_curator.py +++ b/src/app/modules/agent/runtime/steps/context/answer_fact_curator.py @@ -43,7 +43,10 @@ def _explain_facts(bundle: EvidenceBundle, chunks: list[CodeChunkItem], relation target = str(bundle.resolved_target or "").strip() signatures = [_signature_payload(chunk) for chunk in chunks if chunk.layer == "C1_SYMBOL_CATALOG"] target_signatures = [item for item in signatures if _is_target_symbol(item["name"], target)] - methods = _unique(item["name"] for item in target_signatures if item["kind"] == "method") + # Конкретные имена методов: полный qname и короткое отображаемое имя (Class.method или method) + methods_full = _unique(item["name"] for item in target_signatures if item["kind"] == "method") + methods_short = _unique(_short_method_name(name) for name in methods_full) + methods = methods_short or methods_full[:6] constructor_args = _unique( arg for item in target_signatures @@ -51,6 +54,7 @@ def _explain_facts(bundle: EvidenceBundle, chunks: list[CodeChunkItem], relation for arg in item["args"] if arg not in {"self", "cls"} ) + # Конкретные вызовы: из relations и fallback из кода calls = _unique( _display_call_target(relation["target"]) for relation in relations @@ -58,6 +62,7 @@ def _explain_facts(bundle: EvidenceBundle, chunks: list[CodeChunkItem], relation ) if not calls: calls = _fallback_calls(chunks, target) + # Поля: из relations и из self.attr в коде fields = _unique( relation["target"].split(".", 1)[-1] for relation in relations @@ -65,6 +70,7 @@ def _explain_facts(bundle: EvidenceBundle, chunks: list[CodeChunkItem], relation ) if not fields: fields = _unique(field for chunk in chunks if _chunk_matches_target(chunk, target) for field in _FIELD_RE.findall(chunk.content or "")) + # Зависимости: импорты и инстанциации dependencies = _unique( _display_dependency_target(relation["target"]) for relation in relations @@ -80,14 +86,16 @@ def _explain_facts(bundle: EvidenceBundle, chunks: list[CodeChunkItem], relation fact_gaps.append("Конкретные вызовы целевой сущности не подтверждены в C2/C0.") if not dependencies: fact_gaps.append("Явные зависимости целевой сущности не подтверждены.") + if methods and not (calls or dependencies): + fact_gaps.append("Есть методы, но вызовы/зависимости не извлечены — опирайся только на перечисленные методы и поля.") return { "required_symbols": required_symbols[:8], - "required_methods": methods[:6], - "required_calls": calls[:6], - "required_fields": fields[:6], - "required_constructor_args": constructor_args[:6], - "required_dependencies": dependencies[:6], + "required_methods": methods[:8], + "required_calls": calls[:8], + "required_fields": fields[:8], + "required_constructor_args": constructor_args[:8], + "required_dependencies": dependencies[:8], "required_files": required_files[:4], "fact_gaps": fact_gaps, } @@ -95,12 +103,17 @@ def _explain_facts(bundle: EvidenceBundle, chunks: list[CodeChunkItem], relation def _architecture_facts(bundle: EvidenceBundle, chunks: list[CodeChunkItem], relations: list[dict[str, Any]]) -> dict[str, Any]: target = str(bundle.resolved_target or "").strip() - components = _unique( - ([target] if target else []) - + [_component_name(relation["source"]) for relation in relations] + # Компоненты: target, из связей, из заголовков чанков (классы/модули) + from_relations = _unique( + [_component_name(relation["source"]) for relation in relations] + [_component_name(relation["target"]) for relation in relations] - + [_component_name(chunk.title) for chunk in chunks if _chunk_matches_target(chunk, target)] ) + from_chunks = _unique( + _component_name(chunk.title) or _component_name(str(dict(chunk.metadata or {}).get("qname") or "")) + for chunk in chunks + if chunk.layer in ("C1_SYMBOL_CATALOG", "C0_SOURCE_CHUNKS") and (target and _chunk_matches_target(chunk, target)) + ) + components = _unique(([target] if target else []) + from_relations + from_chunks) relation_rows = [ { "source": _component_name(relation["source"]), @@ -117,14 +130,19 @@ def _architecture_facts(bundle: EvidenceBundle, chunks: list[CodeChunkItem], rel ] relation_rows = [row for row in relation_rows if row["source"] != row["target"]] relation_verbs = _unique(row["verb"] for row in relation_rows if row["verb"]) + # Краткие формулировки связей для обязательного упоминания в ответе + relation_summaries = [f"{r['source']} {r['verb']} {r['target']}" for r in relation_rows[:8]] fact_gaps: list[str] = [] if not relation_rows: fact_gaps.append("Concrete code edges между компонентами не подтверждены.") + if components and not relation_rows: + fact_gaps.append("Компоненты есть, но связи между ними не извлечены — не придумывай связи.") return { - "required_components": components[:8], - "required_relations": relation_rows[:8], - "required_relation_verbs": relation_verbs[:6], + "required_components": components[:10], + "required_relations": relation_rows[:10], + "required_relation_summaries": relation_summaries[:8], + "required_relation_verbs": relation_verbs[:8], "required_creation_edges": [row for row in relation_rows if row["edge_type"] == "instantiates"][:4], "required_call_edges": [row for row in relation_rows if row["edge_type"] == "calls"][:4], "required_registration_edges": [row for row in relation_rows if row["edge_type"] == "imports"][:4], @@ -136,6 +154,10 @@ def _architecture_facts(bundle: EvidenceBundle, chunks: list[CodeChunkItem], rel def _trace_flow_facts(bundle: EvidenceBundle, chunks: list[CodeChunkItem], relations: list[dict[str, Any]]) -> dict[str, Any]: target = str(bundle.resolved_target or "").strip() + sorted_relations = sorted( + relations, + key=lambda item: (item["path"], item["sort_line"], item["source"], item["target"]), + ) flow_steps = [ { "step": index, @@ -145,18 +167,27 @@ def _trace_flow_facts(bundle: EvidenceBundle, chunks: list[CodeChunkItem], relat "path": relation["path"], "line_span": relation["line_span"], } - for index, relation in enumerate(sorted(relations, key=lambda item: (item["path"], item["sort_line"], item["source"], item["target"])), start=1) + for index, relation in enumerate(sorted_relations, start=1) ] + # Упорядоченные короткие формулировки шагов для обязательного отражения в ответе + ordered_step_descriptions = [ + f"{i}. {_component_name(s['source'])} {s['verb']} {_display_call_target(s['target'])}" + for i, s in enumerate(flow_steps[:8], start=1) + ] + required_calls = _unique(_display_call_target(item["target"]) for item in flow_steps) fact_gaps: list[str] = [] if len(flow_steps) < 2: fact_gaps.append("Полная последовательность шагов не подтверждена; виден только частичный flow.") if not flow_steps: fact_gaps.append("Конкретные sequence edges для flow не подтверждены.") + if flow_steps and len(flow_steps) < 3: + fact_gaps.append("Цепочка короткая — не заявляй полноту потока.") return { - "required_flow_steps": flow_steps[:8], - "required_calls": _unique(_display_call_target(item["target"]) for item in flow_steps), - "required_sequence_edges": flow_steps[:8], + "required_flow_steps": flow_steps[:10], + "required_calls": required_calls[:10], + "required_sequence_edges": flow_steps[:10], + "ordered_step_descriptions": ordered_step_descriptions[:8], "required_files": _unique(chunk.path for chunk in chunks if _chunk_matches_target(chunk, target) and chunk.path)[:4], "fact_gaps": fact_gaps, } @@ -257,6 +288,18 @@ def _component_name(value: str) -> str: return ".".join(parts[:-1]) +def _short_method_name(qname: str) -> str: + """Короткое отображаемое имя метода для ответа (Class.method или method()).""" + clean = _clean_endpoint(qname) + if not clean: + return "" + parts = clean.split(".") + tail = parts[-1] + if len(parts) >= 2 and parts[-2][:1].isupper(): + return f"{parts[-2]}.{tail}()" if tail != "__init__" else f"{parts[-2]}.__init__()" + return f"{tail}()" if tail else clean + + def _display_call_target(value: str) -> str: clean = _clean_endpoint(value) if not clean: diff --git a/src/app/modules/agent/runtime/steps/finalization/repair.py b/src/app/modules/agent/runtime/steps/finalization/repair.py index b3bd1d2..f57eb6c 100644 --- a/src/app/modules/agent/runtime/steps/finalization/repair.py +++ b/src/app/modules/agent/runtime/steps/finalization/repair.py @@ -41,18 +41,28 @@ class RuntimeAnswerRepairService: "missing_concrete_methods": "missing_concrete_methods", "missing_concrete_calls": "missing_concrete_calls", "missing_concrete_dependencies": "missing_concrete_dependencies", + "missing_concrete_fields": "missing_concrete_fields", + "ignores_concrete_explain_facts": "too_vague_for_explain", + "too_vague_for_explain": "too_vague_for_explain", "missing_concrete_components": "missing_concrete_components", "missing_concrete_relations": "missing_concrete_relations", "missing_relation_verbs": "missing_relation_verbs", + "target_mentioned_but_no_relations": "missing_concrete_relations", + "too_vague_for_architecture": "too_vague_for_architecture", "missing_flow_steps": "missing_flow_steps", "missing_sequence_edges": "missing_sequence_edges", - "too_vague_for_explain": "too_vague_for_explain", - "too_vague_for_architecture": "too_vague_for_architecture", + "missing_ordered_flow_steps": "missing_flow_steps", "too_vague_for_trace_flow": "too_vague_for_trace_flow", "semantic_labels_without_code_edges": "semantic_labels_without_code_edges", "contains_retrieval_artifacts": "contains_retrieval_artifacts", "methods_as_primary_components": "methods_as_primary_components", "overclaims_trace_completeness": "overclaims_trace_completeness", } - result = [mapping[reason] for reason in reasons if reason in mapping] + seen: set[str] = set() + result: list[str] = [] + for reason in reasons: + focus = mapping.get(reason) + if focus and focus not in seen: + seen.add(focus) + result.append(focus) return result or ["tighten_to_evidence"] diff --git a/src/app/modules/agent/runtime/steps/gates/post/post_gate.py b/src/app/modules/agent/runtime/steps/gates/post/post_gate.py index ed40102..44e0d60 100644 --- a/src/app/modules/agent/runtime/steps/gates/post/post_gate.py +++ b/src/app/modules/agent/runtime/steps/gates/post/post_gate.py @@ -30,8 +30,20 @@ _VAGUE_PHRASES = ( "этап пайплайна", "инициализация сервисов", "регистрация основных служб", + "различные аргументы", + "различные подпакеты", + "основные службы", + "представляет собой", + "используется в службах", +) +_OPTIMISTIC_TRACE_CLAIMS = ( + "полностью восстанавливается", + "полный поток выполнения", + "полностью прослеживается", + "полный поток виден", + "полная цепочка", + "весь поток", ) -_OPTIMISTIC_TRACE_CLAIMS = ("полностью восстанавливается", "полный поток выполнения", "полностью прослеживается") class RuntimePostEvidenceGate: @@ -96,11 +108,12 @@ class RuntimePostEvidenceGate: reasons = self._validate_target_focus(answer, evidence_pack) reasons.extend(self._vagueness_reasons(answer, "explain")) - matches = 0 methods = list(explain.get("required_methods") or []) calls = list(explain.get("required_calls") or []) dependencies = list(explain.get("required_dependencies") or []) fields = list(explain.get("required_fields") or []) + has_any_required = bool(methods or calls or dependencies or fields) + matches = 0 if methods and not self._mentions_fact_group(answer, methods): reasons.append("missing_concrete_methods") elif methods: @@ -113,10 +126,14 @@ class RuntimePostEvidenceGate: reasons.append("missing_concrete_dependencies") elif dependencies: matches += 1 - if fields and self._mentions_fact_group(answer, fields): + if fields and not self._mentions_fact_group(answer, fields): + reasons.append("missing_concrete_fields") + elif fields: matches += 1 - if (methods or calls or dependencies or fields) and matches == 0: + if has_any_required and matches == 0: reasons.append("too_vague_for_explain") + if has_any_required and self._answer_is_generic_with_facts(answer, methods + calls + dependencies + fields): + reasons.append("ignores_concrete_explain_facts") if self._semantic_leakage(answer, facts, has_concrete_support=matches > 0): reasons.append("semantic_labels_without_code_edges") return reasons @@ -136,13 +153,19 @@ class RuntimePostEvidenceGate: reasons.append("missing_concrete_relations") if verbs and not self._mentions_fact_group(answer, verbs): reasons.append("missing_relation_verbs") - if any(label in answer for label in architecture.get("forbidden_labels") or []): + forbidden = architecture.get("forbidden_labels") or [] + if any(label.lower() in answer.lower() for label in forbidden): reasons.append("contains_retrieval_artifacts") if self._methods_dominate_components(answer, components): reasons.append("methods_as_primary_components") - if relations and (not self._mentions_relations(answer, relations) or not self._mentions_fact_group(answer, verbs)): + has_relations = self._mentions_relations(answer, relations) + has_verbs = self._mentions_fact_group(answer, verbs) + if relations and (not has_relations or not has_verbs): reasons.append("too_vague_for_architecture") - if self._semantic_leakage(answer, facts, has_concrete_support=self._mentions_relations(answer, relations)): + target = str(evidence_pack.resolved_target or "").strip().lower() + if target and target in answer and relations and not has_relations: + reasons.append("target_mentioned_but_no_relations") + if self._semantic_leakage(answer, facts, has_concrete_support=has_relations): reasons.append("semantic_labels_without_code_edges") return reasons @@ -154,16 +177,19 @@ class RuntimePostEvidenceGate: steps = list(trace.get("required_flow_steps") or []) calls = list(trace.get("required_calls") or []) + ordered_descriptions = list(trace.get("ordered_step_descriptions") or []) if steps and not self._mentions_steps(answer, steps): reasons.append("missing_flow_steps") - if calls and not self._mentions_fact_group(answer, calls): - reasons.append("missing_concrete_calls") if steps and not self._mentions_relations(answer, steps): reasons.append("missing_sequence_edges") - if any(claim in answer for claim in _OPTIMISTIC_TRACE_CLAIMS): + if calls and not self._mentions_fact_group(answer, calls): + reasons.append("missing_concrete_calls") + if any(claim.lower() in answer.lower() for claim in _OPTIMISTIC_TRACE_CLAIMS): reasons.append("overclaims_trace_completeness") if steps and not (self._mentions_steps(answer, steps) and self._mentions_relations(answer, steps)): reasons.append("too_vague_for_trace_flow") + if ordered_descriptions and not self._mentions_ordered_steps(answer, ordered_descriptions): + reasons.append("missing_ordered_flow_steps") return reasons def _validate_target_focus(self, answer: str, evidence_pack: EvidenceBundle) -> list[str]: @@ -193,6 +219,27 @@ class RuntimePostEvidenceGate: mentioned = sum(1 for step in steps[:3] if self._mentions_relations(answer, [step])) return mentioned >= min(2, len(steps[:3])) + def _mentions_ordered_steps(self, answer: str, ordered_descriptions: list[str]) -> bool: + """Проверяет, что в ответе отражена хотя бы часть упорядоченных шагов (источник/цель/глагол).""" + if not ordered_descriptions: + return True + answer_lower = answer.lower() + hits = 0 + for desc in ordered_descriptions[:5]: + parts = desc.replace(".", " ").split() + if len(parts) >= 3 and any(p in answer_lower for p in parts if len(p) > 2): + hits += 1 + return hits >= min(2, len(ordered_descriptions)) + + def _answer_is_generic_with_facts( + self, answer: str, concrete_values: list[str] + ) -> bool: + """True, если в ответе есть общие фразы, но почти нет конкретных имён из списка.""" + if not concrete_values: + return False + mentioned = sum(1 for v in concrete_values if any(a in answer.lower() for a in _aliases(v))) + return mentioned == 0 and len(answer) > 100 + def _methods_dominate_components(self, answer: str, components: list[str]) -> bool: method_like = re.findall(r"\b[a-z_]+\(\)", answer) component_hits = sum(1 for component in components if component.lower() in answer) diff --git a/src/app/modules/agent/runtime/steps/generation/prompt_payload_builder.py b/src/app/modules/agent/runtime/steps/generation/prompt_payload_builder.py index 85738f2..c84926e 100644 --- a/src/app/modules/agent/runtime/steps/generation/prompt_payload_builder.py +++ b/src/app/modules/agent/runtime/steps/generation/prompt_payload_builder.py @@ -74,30 +74,55 @@ class RuntimePromptPayloadBuilder: curated = dict(synthesis_input.curated_facts or {}) if scenario == "EXPLAIN": facts = dict(curated.get("explain") or {}) + must_methods = facts.get("required_methods", []) + must_calls = facts.get("required_calls", []) + must_deps = facts.get("required_dependencies", []) + must_fields = facts.get("required_fields", []) + fact_gaps = facts.get("fact_gaps", []) return { - "must_mention_methods": facts.get("required_methods", []), - "must_mention_fields": facts.get("required_fields", []), - "must_mention_calls": facts.get("required_calls", []), - "must_mention_dependencies": facts.get("required_dependencies", []), + "answer_contract": ( + "Ответ обязан опираться на конкретные факты ниже. Если списки непусты — назови явно методы, вызовы, зависимости или поля из них. " + "Не заменяй их общими фразами. Учитывай fact_gaps." + ), + "must_mention_methods": must_methods, + "must_mention_fields": must_fields, + "must_mention_calls": must_calls, + "must_mention_dependencies": must_deps, "must_mention_constructor_args": facts.get("required_constructor_args", []), "must_mention_files": facts.get("required_files", []), "must_not_infer_missing_details": True, - "fact_gaps": facts.get("fact_gaps", []), + "fact_gaps": fact_gaps, } if scenario == "ARCHITECTURE": facts = dict(curated.get("architecture") or {}) + components = facts.get("required_components", []) + relations = facts.get("required_relations", []) + verbs = facts.get("required_relation_verbs", []) + summaries = facts.get("required_relation_summaries", []) return { - "must_mention_components": facts.get("required_components", []), - "must_mention_relations": facts.get("required_relations", []), - "must_use_relation_verbs": facts.get("required_relation_verbs", []), + "answer_contract": ( + "Ответ обязан перечислить компоненты и связи из кода. Используй relation verbs (создаёт, вызывает, импортирует и т.д.). " + "Не подменяй архитектуру списком методов. Не используй retrieval labels в тексте." + ), + "must_mention_components": components, + "must_mention_relations": relations, + "must_mention_relation_summaries": summaries, + "must_use_relation_verbs": verbs, "must_avoid_semantic_labels_as_primary_claims": True, "must_not_use_retrieval_labels": facts.get("forbidden_labels", []), "fact_gaps": facts.get("fact_gaps", []), } if scenario == "TRACE_FLOW": facts = dict(curated.get("trace_flow") or {}) + steps = facts.get("required_flow_steps", []) + ordered_descriptions = facts.get("ordered_step_descriptions", []) return { - "must_mention_flow_steps": facts.get("required_flow_steps", []), + "answer_contract": ( + "Ответ обязан описать поток как упорядоченную последовательность шагов из payload. " + "Не заявляй полноту потока, если в fact_gaps указано иное. Не делай неподтверждённых утверждений." + ), + "must_mention_flow_steps": steps, + "must_mention_ordered_steps": ordered_descriptions, "must_mention_calls": facts.get("required_calls", []), "must_mention_sequence_edges": facts.get("required_sequence_edges", []), "must_avoid_overclaiming_full_flow": True, diff --git a/src/app/modules/agent/runtime/steps/generation/prompt_selector.py b/src/app/modules/agent/runtime/steps/generation/prompt_selector.py index fa660d9..abcfeb6 100644 --- a/src/app/modules/agent/runtime/steps/generation/prompt_selector.py +++ b/src/app/modules/agent/runtime/steps/generation/prompt_selector.py @@ -4,7 +4,7 @@ from __future__ import annotations class RuntimePromptSelector: - _PROMPTS = { + _CODE_PROMPTS = { "ARCHITECTURE": "code_qa_architecture_answer", "EXPLAIN": "code_qa_explain_answer", "EXPLAIN_LOCAL": "code_qa_explain_local_answer", @@ -14,8 +14,19 @@ class RuntimePromptSelector: "OPEN_FILE": "code_qa_open_file_answer", "TRACE_FLOW": "code_qa_trace_flow_answer", } + _DOCS_INTENT_PROMPTS = { + "DOCUMENTATION_EXPLAIN": "docs_explain_answer", + "GENERAL_QA": "docs_general_answer", + } - def select(self, *, sub_intent: str, answer_mode: str) -> str: + def select(self, *, intent: str = "CODE_QA", sub_intent: str, answer_mode: str) -> str: + intent_key = (intent or "CODE_QA").upper() + if intent_key in {"OPENAPI_GENERATION", "OPENAPI_FROM_DOCUMENTATION"}: + if sub_intent.upper() == "OPENAPI_FRAGMENT_GENERATE": + return "docs_openapi_fragment_answer" + return "docs_openapi_answer" + if intent_key in self._DOCS_INTENT_PROMPTS: + return self._DOCS_INTENT_PROMPTS[intent_key] if answer_mode in {"degraded", "not_found", "insufficient"}: return "code_qa_degraded_answer" - return self._PROMPTS.get(sub_intent.upper(), "code_qa_explain_answer") + return self._CODE_PROMPTS.get(sub_intent.upper(), "code_qa_explain_answer") diff --git a/src/app/modules/agent/runtime/steps/retrieval/adapter.py b/src/app/modules/agent/runtime/steps/retrieval/adapter.py index ec0c99f..16d2fe7 100644 --- a/src/app/modules/agent/runtime/steps/retrieval/adapter.py +++ b/src/app/modules/agent/runtime/steps/retrieval/adapter.py @@ -38,6 +38,8 @@ class SessionEmbeddingDimensions: class RuntimeRetrievalAdapter: + _RELATED_DOCS_THRESHOLD = 2 + def __init__(self, repository: RagRepository | None = None) -> None: if repository is None: from app.modules.rag.persistence.repository import RagRepository @@ -57,10 +59,23 @@ class RuntimeRetrievalAdapter: query_plan=None, ) -> list[dict]: rows: list[dict] = [] + planned_layers = [str(item.layer_id) for item in list(getattr(retrieval_spec, "layer_queries", []) or [])] executed_layers: list[str] = [] per_layer_ms: dict[str, int] = {} + layer_diagnostics: dict[str, Any] = {} + fallback_used = False + fallback_reason: str | None = None + relation_hits = 0 + query_plan_sub_intent = str(getattr(query_plan, "sub_intent", "") or "") for layer_query in list(getattr(retrieval_spec, "layer_queries", []) or []): layer_id = str(layer_query.layer_id) + if ( + query_plan_sub_intent == "RELATED_DOCS_EXPLAIN" + and layer_id in {"D1_DOCUMENT_CATALOG", "D0_DOC_CHUNKS"} + and relation_hits >= self._RELATED_DOCS_THRESHOLD + ): + layer_diagnostics[layer_id] = {"hits": 0, "top_ids": [], "skipped": True, "reason": "relation_primary_sufficient"} + continue executed_layers.append(layer_id) started = perf_counter() layer_rows = self._retrieve_layer( @@ -73,8 +88,35 @@ class RuntimeRetrievalAdapter: include_tests=str(getattr(retrieval_spec.filters, "test_policy", "EXCLUDE") or "EXCLUDE") == "INCLUDE", ) per_layer_ms[layer_id] = int((perf_counter() - started) * 1000) + layer_diagnostics[layer_id] = self._layer_diagnostics(layer_rows) rows.extend(layer_rows) + if layer_id == "D5_RELATION_GRAPH": + relation_hits = len(layer_rows) + d2_empty = "D2_FACT_INDEX" in planned_layers and int(dict(layer_diagnostics.get("D2_FACT_INDEX") or {}).get("hits") or 0) == 0 + d0_empty = "D0_DOC_CHUNKS" in planned_layers and int(dict(layer_diagnostics.get("D0_DOC_CHUNKS") or {}).get("hits") or 0) == 0 + support_paths = self._support_paths(rows) + if support_paths and "D0_DOC_CHUNKS" in planned_layers and (d2_empty or d0_empty): + targeted_started = perf_counter() + targeted_rows = self.retrieve_exact_files( + rag_session_id, + paths=support_paths, + layers=["D0_DOC_CHUNKS"], + limit=max(6, self._planned_top_k(retrieval_spec, "D0_DOC_CHUNKS")), + query=query, + ranking_profile=str(getattr(retrieval_spec, "rerank_profile", "") or ""), + ) + merged_rows = self._dedupe([*rows, *targeted_rows]) + new_targeted_rows = self._subtract_rows(merged_rows, rows) + per_layer_ms["D0_DOC_CHUNKS"] = per_layer_ms.get("D0_DOC_CHUNKS", 0) + int((perf_counter() - targeted_started) * 1000) + rows = merged_rows + layer_diagnostics["D0_DOC_CHUNKS"] = self._layer_diagnostics( + [row for row in rows if str(row.get("layer") or "") == "D0_DOC_CHUNKS"] + ) + if new_targeted_rows: + fallback_used = True + fallback_reason = "targeted_chunk_retrieval" self._last_report = { + "planned_layers": planned_layers, "executed_layers": executed_layers, "retrieval_mode_by_layer": {layer_id: "vector" for layer_id in executed_layers}, "top_k_by_layer": {str(item.layer_id): int(item.top_k) for item in list(getattr(retrieval_spec, "layer_queries", []) or [])}, @@ -82,8 +124,9 @@ class RuntimeRetrievalAdapter: layer_id: {"path_scope": list(getattr(retrieval_spec.filters, "path_scope", []) or [])} for layer_id in executed_layers }, - "fallback": {"used": False, "reason": None}, + "fallback": {"used": fallback_used, "reason": fallback_reason}, "retrieval_by_layer_ms": per_layer_ms, + "layer_diagnostics": layer_diagnostics, } return self._dedupe(rows) @@ -241,3 +284,54 @@ class RuntimeRetrievalAdapter: seen.add(key) result.append(row) return result + + def _layer_diagnostics(self, rows: list[dict]) -> dict[str, Any]: + ids: list[str] = [] + sections: list[str] = [] + for row in rows[:5]: + metadata = dict(row.get("metadata") or {}) + candidate = ( + metadata.get("document_id") + or metadata.get("doc_id") + or metadata.get("fact_id") + or metadata.get("relation_id") + or metadata.get("target_id") + or row.get("path") + ) + value = str(candidate or "").strip() + if value and value not in ids: + ids.append(value) + title = str(row.get("title") or "").strip() + if title and title not in sections: + sections.append(title) + return {"hits": len(rows), "top_ids": ids, "top_sections": sections} + + def _subtract_rows(self, rows: list[dict], baseline: list[dict]) -> list[dict]: + baseline_keys = {self._row_key(row) for row in baseline} + return [row for row in rows if self._row_key(row) not in baseline_keys] + + def _support_paths(self, rows: list[dict]) -> list[str]: + values: list[str] = [] + for row in rows: + layer = str(row.get("layer") or "") + if layer not in {"D1_DOCUMENT_CATALOG", "D2_FACT_INDEX", "D3_ENTITY_CATALOG", "D4_WORKFLOW_INDEX", "D5_RELATION_GRAPH"}: + continue + path = str(row.get("path") or "").strip() + if path and path not in values: + values.append(path) + return values[:6] + + def _planned_top_k(self, retrieval_spec, layer_id: str) -> int: + for item in list(getattr(retrieval_spec, "layer_queries", []) or []): + if str(item.layer_id) == layer_id: + return int(item.top_k) + return 6 + + def _row_key(self, row: dict) -> tuple[str, str, str, int | None, int | None]: + return ( + str(row.get("layer") or ""), + str(row.get("path") or ""), + str(row.get("title") or ""), + row.get("span_start"), + row.get("span_end"), + ) diff --git a/src/app/modules/agent/runtime/steps/retrieval/repo_context.py b/src/app/modules/agent/runtime/steps/retrieval/repo_context.py index a5c421d..5b7a163 100644 --- a/src/app/modules/agent/runtime/steps/retrieval/repo_context.py +++ b/src/app/modules/agent/runtime/steps/retrieval/repo_context.py @@ -13,10 +13,12 @@ class RuntimeRepoContextFactory: RagLayer.CODE_DEPENDENCY_GRAPH, RagLayer.CODE_SEMANTIC_ROLES, RagLayer.CODE_SOURCE_CHUNKS, - RagLayer.DOCS_MODULE_CATALOG, + RagLayer.DOCS_DOC_CHUNKS, + RagLayer.DOCS_DOCUMENT_CATALOG, RagLayer.DOCS_FACT_INDEX, - RagLayer.DOCS_SECTION_INDEX, - RagLayer.DOCS_POLICY_INDEX, + RagLayer.DOCS_ENTITY_CATALOG, + RagLayer.DOCS_WORKFLOW_INDEX, + RagLayer.DOCS_RELATION_GRAPH, ] def build(self, files_map: dict[str, dict] | None = None) -> RepoContext: diff --git a/src/app/modules/agent/task_runtime/__init__.py b/src/app/modules/agent/task_runtime/__init__.py new file mode 100644 index 0000000..105525c --- /dev/null +++ b/src/app/modules/agent/task_runtime/__init__.py @@ -0,0 +1,13 @@ +from app.modules.agent.task_runtime.context import TaskRuntimeContextBuilder +from app.modules.agent.task_runtime.dispatcher import TaskWorkflowDispatcher +from app.modules.agent.task_runtime.enrichment import ContextEnrichmentService +from app.modules.agent.task_runtime.facade import AgentTaskRuntimeFacade +from app.modules.agent.task_runtime.templates import DocumentationTemplateRegistry + +__all__ = [ + "AgentTaskRuntimeFacade", + "ContextEnrichmentService", + "DocumentationTemplateRegistry", + "TaskRuntimeContextBuilder", + "TaskWorkflowDispatcher", +] diff --git a/src/app/modules/agent/task_runtime/context.py b/src/app/modules/agent/task_runtime/context.py new file mode 100644 index 0000000..6404fd5 --- /dev/null +++ b/src/app/modules/agent/task_runtime/context.py @@ -0,0 +1,45 @@ +from __future__ import annotations + +from app.modules.agent.intent_router_v2 import ConversationState +from app.modules.agent.runtime.steps.retrieval import RuntimeRepoContextFactory + +from app.modules.agent.task_runtime.models import TaskRuntimeContext + + +class TaskRuntimeContextBuilder: + def __init__(self, repo_context_factory: RuntimeRepoContextFactory | None = None) -> None: + self._repo_context_factory = repo_context_factory or RuntimeRepoContextFactory() + + def build( + self, + *, + task_id: str, + dialog_session_id: str, + rag_session_id: str, + mode: str, + message: str, + attachments: list[dict], + files: list[dict], + progress_cb, + ) -> TaskRuntimeContext: + files_map = self._files_to_map(files) + return TaskRuntimeContext( + task_id=task_id, + dialog_session_id=dialog_session_id, + rag_session_id=rag_session_id, + mode=mode, + message=message, + attachments=list(attachments or []), + files=list(files or []), + files_map=files_map, + progress_cb=progress_cb, + repo_context=self._repo_context_factory.build(files_map), + conversation_state=ConversationState(), + ) + + def _files_to_map(self, files: list[dict]) -> dict[str, dict]: + out: dict[str, dict] = {} + for item in files or []: + if isinstance(item, dict) and item.get("path"): + out[str(item["path"])] = dict(item) + return out diff --git a/src/app/modules/agent/task_runtime/dispatcher.py b/src/app/modules/agent/task_runtime/dispatcher.py new file mode 100644 index 0000000..d891875 --- /dev/null +++ b/src/app/modules/agent/task_runtime/dispatcher.py @@ -0,0 +1,37 @@ +from __future__ import annotations + +from app.modules.agent.task_runtime.models import TaskRuntimeContext, WorkflowExecutionResult +from app.modules.agent.task_runtime.workflows.base import TaskWorkflow + + +class TaskWorkflowDispatcher: + def __init__( + self, + *, + docs_qa: TaskWorkflow, + general_qa: TaskWorkflow, + docs_generation: TaskWorkflow, + openapi: TaskWorkflow, + fallback: TaskWorkflow, + ) -> None: + self._docs_qa = docs_qa + self._general_qa = general_qa + self._docs_generation = docs_generation + self._openapi = openapi + self._fallback = fallback + + def dispatch(self, ctx: TaskRuntimeContext) -> WorkflowExecutionResult: + workflow = self._select(getattr(ctx.route_result, "intent", "FALLBACK")) + return workflow.run(ctx) + + def _select(self, intent: str) -> TaskWorkflow: + normalized = (intent or "FALLBACK").upper() + if normalized == "DOCUMENTATION_EXPLAIN": + return self._docs_qa + if normalized == "GENERAL_QA": + return self._general_qa + if normalized == "OPENAPI_GENERATION": + return self._openapi + if normalized == "GENERATE_DOCS_FROM_CODE": + return self._docs_generation + return self._fallback diff --git a/src/app/modules/agent/task_runtime/enrichment.py b/src/app/modules/agent/task_runtime/enrichment.py new file mode 100644 index 0000000..7f191f6 --- /dev/null +++ b/src/app/modules/agent/task_runtime/enrichment.py @@ -0,0 +1,35 @@ +from __future__ import annotations + +from app.modules.agent.task_runtime.models import TaskRuntimeContext + + +class AttachmentContextProvider: + def build(self, ctx: TaskRuntimeContext) -> dict[str, object]: + return {"attachments": list(ctx.attachments)} + + +class ConfluenceContextProvider: + def build(self, ctx: TaskRuntimeContext) -> dict[str, object]: + urls = [ + str(item.get("url")) + for item in ctx.attachments + if str(item.get("type") or "").lower() == "confluence_url" and item.get("url") + ] + return {"confluence_urls": urls} + + +class ContextEnrichmentService: + def __init__( + self, + attachment_provider: AttachmentContextProvider | None = None, + confluence_provider: ConfluenceContextProvider | None = None, + ) -> None: + self._attachment_provider = attachment_provider or AttachmentContextProvider() + self._confluence_provider = confluence_provider or ConfluenceContextProvider() + + def enrich(self, ctx: TaskRuntimeContext) -> dict[str, object]: + enriched: dict[str, object] = {} + enriched.update(self._attachment_provider.build(ctx)) + enriched.update(self._confluence_provider.build(ctx)) + enriched["files"] = list(ctx.files) + return enriched diff --git a/src/app/modules/agent/task_runtime/facade.py b/src/app/modules/agent/task_runtime/facade.py new file mode 100644 index 0000000..dedd56c --- /dev/null +++ b/src/app/modules/agent/task_runtime/facade.py @@ -0,0 +1,92 @@ +from __future__ import annotations + +import asyncio +from types import SimpleNamespace + +from app.modules.agent.intent_router_v2 import IntentRouterV2 +from app.modules.agent.task_runtime.context import TaskRuntimeContextBuilder +from app.modules.agent.task_runtime.dispatcher import TaskWorkflowDispatcher +from app.modules.agent.task_runtime.enrichment import ContextEnrichmentService +from app.modules.agent.task_runtime.status_events import emit_status_block + + +class AgentTaskRuntimeFacade: + def __init__( + self, + *, + router: IntentRouterV2, + context_builder: TaskRuntimeContextBuilder, + enrichment: ContextEnrichmentService, + dispatcher: TaskWorkflowDispatcher, + ) -> None: + self._router = router + self._context_builder = context_builder + self._enrichment = enrichment + self._dispatcher = dispatcher + + async def run( + self, + *, + task_id: str, + dialog_session_id: str, + rag_session_id: str, + mode: str, + message: str, + attachments: list[dict], + files: list[dict], + progress_cb=None, + ): + ctx = self._context_builder.build( + task_id=task_id, + dialog_session_id=dialog_session_id, + rag_session_id=rag_session_id, + mode=mode, + message=message, + attachments=attachments, + files=files, + progress_cb=progress_cb, + ) + self._notify(progress_cb, "runtime.router", "Маршрутизирую запрос по task workflows.", {"mode": mode}) + ctx.route_result = self._router.route(message, ctx.conversation_state, ctx.repo_context) + emit_status_block( + ctx, + block_id="intent_router", + title="Intent Router", + lines=[ + f"intent: {ctx.route_result.intent}", + f"sub_intent: {ctx.route_result.query_plan.sub_intent}", + f"conversation_mode: {ctx.route_result.conversation_mode}", + f"matched_source: {ctx.route_result.matched_intent_source}", + ], + ) + self._notify(progress_cb, "runtime.context", "Собираю контекст для выбранного workflow.", {"intent": ctx.route_result.intent}) + ctx.enriched_context = self._enrichment.enrich(ctx) + loop = asyncio.get_running_loop() + self._notify(progress_cb, "runtime.workflow", "Запускаю целевой task workflow.", {"intent": ctx.route_result.intent}) + emit_status_block( + ctx, + block_id="workflow", + title="Task Workflow", + lines=[ + f"intent: {ctx.route_result.intent}", + f"sub_intent: {ctx.route_result.query_plan.sub_intent}", + "dispatcher: task_workflow_dispatcher", + ], + ) + result = await loop.run_in_executor(None, lambda: self._dispatcher.dispatch(ctx)) + return SimpleNamespace( + result_type=result.result_type, + answer=result.answer, + artifacts=result.artifacts, + changeset=[], + meta={ + "task_id": task_id, + "intent": ctx.route_result.intent, + "workflow_meta": result.meta, + "route": ctx.route_result.model_dump(mode="json"), + }, + ) + + def _notify(self, progress_cb, stage: str, message: str, meta: dict) -> None: + if progress_cb is not None: + progress_cb(stage, message, "task_progress", meta) diff --git a/src/app/modules/agent/task_runtime/models.py b/src/app/modules/agent/task_runtime/models.py new file mode 100644 index 0000000..fee0ab6 --- /dev/null +++ b/src/app/modules/agent/task_runtime/models.py @@ -0,0 +1,34 @@ +from __future__ import annotations + +from dataclasses import dataclass, field +from typing import Any, Callable + +from app.schemas.chat import TaskArtifact, TaskResultType + + +ProgressCallback = Callable[[str, str, str, dict | None], Any] + + +@dataclass(slots=True) +class TaskRuntimeContext: + task_id: str + dialog_session_id: str + rag_session_id: str + mode: str + message: str + attachments: list[dict[str, Any]] = field(default_factory=list) + files: list[dict[str, Any]] = field(default_factory=list) + files_map: dict[str, dict[str, Any]] = field(default_factory=dict) + progress_cb: ProgressCallback | None = None + repo_context: Any = None + conversation_state: Any = None + route_result: Any = None + enriched_context: dict[str, Any] = field(default_factory=dict) + + +@dataclass(slots=True) +class WorkflowExecutionResult: + result_type: TaskResultType + answer: str = "" + artifacts: list[TaskArtifact] = field(default_factory=list) + meta: dict[str, Any] = field(default_factory=dict) diff --git a/src/app/modules/agent/task_runtime/status_events.py b/src/app/modules/agent/task_runtime/status_events.py new file mode 100644 index 0000000..34fb961 --- /dev/null +++ b/src/app/modules/agent/task_runtime/status_events.py @@ -0,0 +1,28 @@ +from __future__ import annotations + +from app.modules.agent.task_runtime.models import TaskRuntimeContext + + +def emit_status_block( + ctx: TaskRuntimeContext, + *, + block_id: str, + title: str, + lines: list[str], + append: bool = False, +) -> None: + if ctx.progress_cb is None: + return + ctx.progress_cb( + f"status.{block_id}", + title, + "task_progress", + { + "status_block": { + "id": block_id, + "title": title, + "lines": [line for line in lines if str(line).strip()], + "append": append, + } + }, + ) diff --git a/src/app/modules/agent/task_runtime/templates.py b/src/app/modules/agent/task_runtime/templates.py new file mode 100644 index 0000000..2c2e46a --- /dev/null +++ b/src/app/modules/agent/task_runtime/templates.py @@ -0,0 +1,31 @@ +from __future__ import annotations + +from dataclasses import dataclass + + +@dataclass(frozen=True, slots=True) +class DocumentationTemplate: + template_id: str + title: str + sections: tuple[str, ...] + + +class DocumentationTemplateRegistry: + def __init__(self) -> None: + self._templates = { + "system_analytics_v1": DocumentationTemplate( + template_id="system_analytics_v1", + title="Документация по системной аналитике", + sections=( + "Назначение", + "Контекст и границы", + "Основные сущности", + "Сценарии и workflow", + "Интеграции", + "Открытые вопросы и допущения", + ), + ) + } + + def default(self) -> DocumentationTemplate: + return self._templates["system_analytics_v1"] diff --git a/src/app/modules/agent/task_runtime/workflows/__init__.py b/src/app/modules/agent/task_runtime/workflows/__init__.py new file mode 100644 index 0000000..cfd0380 --- /dev/null +++ b/src/app/modules/agent/task_runtime/workflows/__init__.py @@ -0,0 +1,11 @@ +from app.modules.agent.task_runtime.workflows.docs_generation import DocumentationGenerationWorkflow +from app.modules.agent.task_runtime.workflows.docs_qa import DocsQaWorkflow +from app.modules.agent.task_runtime.workflows.fallback import FallbackWorkflow +from app.modules.agent.task_runtime.workflows.openapi import OpenApiWorkflow + +__all__ = [ + "DocsQaWorkflow", + "DocumentationGenerationWorkflow", + "FallbackWorkflow", + "OpenApiWorkflow", +] diff --git a/src/app/modules/agent/task_runtime/workflows/base.py b/src/app/modules/agent/task_runtime/workflows/base.py new file mode 100644 index 0000000..625eed6 --- /dev/null +++ b/src/app/modules/agent/task_runtime/workflows/base.py @@ -0,0 +1,11 @@ +from __future__ import annotations + +from typing import Protocol + +from app.modules.agent.task_runtime.models import TaskRuntimeContext, WorkflowExecutionResult + + +class TaskWorkflow(Protocol): + workflow_id: str + + def run(self, ctx: TaskRuntimeContext) -> WorkflowExecutionResult: ... diff --git a/src/app/modules/agent/task_runtime/workflows/docs_generation.py b/src/app/modules/agent/task_runtime/workflows/docs_generation.py new file mode 100644 index 0000000..2d03522 --- /dev/null +++ b/src/app/modules/agent/task_runtime/workflows/docs_generation.py @@ -0,0 +1,82 @@ +from __future__ import annotations + +import json + +from app.modules.agent.llm import AgentLlmService +from app.modules.agent.task_runtime.models import TaskRuntimeContext, WorkflowExecutionResult +from app.modules.agent.task_runtime.status_events import emit_status_block +from app.modules.agent.task_runtime.templates import DocumentationTemplateRegistry +from app.schemas.chat import TaskArtifact, TaskResultType + + +class DocumentationGenerationWorkflow: + workflow_id = "docs_generation" + + def __init__( + self, + llm: AgentLlmService | None, + templates: DocumentationTemplateRegistry | None = None, + ) -> None: + self._llm = llm + self._templates = templates or DocumentationTemplateRegistry() + + def run(self, ctx: TaskRuntimeContext) -> WorkflowExecutionResult: + template = self._templates.default() + emit_status_block( + ctx, + block_id="rag_retrieval", + title="RAG Retrieval", + lines=["not used in docs_generation workflow"], + ) + answer = self._generate(ctx, template) + emit_status_block( + ctx, + block_id="workflow", + title="Task Workflow", + lines=[ + f"workflow_id: {self.workflow_id}", + f"template_id: {template.template_id}", + ], + ) + emit_status_block( + ctx, + block_id="evidence_gate", + title="Evidence Gate", + lines=["not applied in docs_generation workflow"], + ) + artifact = TaskArtifact( + artifact_type=TaskResultType.DOCUMENTATION, + title=template.title, + content=answer, + format="markdown", + template_id=template.template_id, + source_refs=list(ctx.enriched_context.get("confluence_urls") or []), + ) + return WorkflowExecutionResult( + result_type=TaskResultType.DOCUMENTATION, + answer=answer, + artifacts=[artifact], + meta={"workflow_id": self.workflow_id, "intent": getattr(ctx.route_result, "intent", "")}, + ) + + def _generate(self, ctx: TaskRuntimeContext, template) -> str: + if self._llm is None: + return self._fallback(template) + payload = json.dumps( + { + "question": ctx.message, + "template_id": template.template_id, + "title": template.title, + "sections": list(template.sections), + "attachments": list(ctx.attachments), + "files": list(ctx.files), + "context": dict(ctx.enriched_context), + }, + ensure_ascii=False, + indent=2, + ) + return self._llm.generate("docs_template_generation", payload, log_context="agent.workflow.docs_generation").strip() + + def _fallback(self, template) -> str: + sections = "\n".join(f"## {name}\n\nTBD" for name in template.sections) + return f"# {template.title}\n\n{sections}\n" diff --git a/src/app/modules/agent/task_runtime/workflows/docs_qa.py b/src/app/modules/agent/task_runtime/workflows/docs_qa.py new file mode 100644 index 0000000..14da8e8 --- /dev/null +++ b/src/app/modules/agent/task_runtime/workflows/docs_qa.py @@ -0,0 +1,80 @@ +from __future__ import annotations + +from app.modules.agent.runtime.docs_qa_pipeline import DocsQAPipelineRunner +from app.modules.agent.task_runtime.models import TaskRuntimeContext, WorkflowExecutionResult +from app.modules.agent.task_runtime.status_events import emit_status_block +from app.schemas.chat import TaskResultType + + +class DocsQaWorkflow: + workflow_id = "docs_qa" + + def __init__(self, runner: DocsQAPipelineRunner) -> None: + self._runner = runner + + def run(self, ctx: TaskRuntimeContext) -> WorkflowExecutionResult: + result = self._runner.run( + ctx.message, + ctx.rag_session_id, + conversation_state=ctx.conversation_state, + mode="full", + ) + diagnostics = result.diagnostics.model_dump(mode="json") + emit_status_block( + ctx, + block_id="rag_retrieval", + title="RAG Retrieval", + lines=_retrieval_lines(diagnostics), + ) + emit_status_block( + ctx, + block_id="workflow", + title="Task Workflow", + lines=[ + f"workflow_id: {self.workflow_id}", + f"prompt: {result.prompt_name}", + f"answer_mode: {result.answer_mode}", + ], + ) + emit_status_block( + ctx, + block_id="evidence_gate", + title="Evidence Gate", + lines=_gate_lines(diagnostics), + ) + return WorkflowExecutionResult( + result_type=TaskResultType.ANSWER, + answer=result.answer, + meta={ + "workflow_id": self.workflow_id, + "intent": result.router_result.intent, + "diagnostics": diagnostics, + }, + ) + + +def _retrieval_lines(diagnostics: dict) -> list[str]: + lines = [ + f"planned_layers: {', '.join(diagnostics.get('planned_layers') or []) or '-'}", + f"executed_layers: {', '.join(diagnostics.get('executed_layers') or []) or '-'}", + ] + layer_diagnostics = dict(diagnostics.get("layer_diagnostics") or {}) + for layer_id in diagnostics.get("executed_layers") or []: + info = dict(layer_diagnostics.get(layer_id) or {}) + hits = info.get("hits", 0) + lines.append(f"{layer_id}: {hits} hits") + return lines + + +def _gate_lines(diagnostics: dict) -> list[str]: + lines = [ + f"decision: {diagnostics.get('gate_decision') or '-'}", + f"reason: {diagnostics.get('gate_decision_reason') or '-'}", + ] + missing = list(diagnostics.get("gate_missing_requirements") or []) + satisfied = list(diagnostics.get("gate_satisfied_requirements") or []) + if missing: + lines.append(f"missing: {', '.join(missing)}") + if satisfied: + lines.append(f"satisfied: {', '.join(satisfied)}") + return lines diff --git a/src/app/modules/agent/task_runtime/workflows/fallback.py b/src/app/modules/agent/task_runtime/workflows/fallback.py new file mode 100644 index 0000000..a96d01c --- /dev/null +++ b/src/app/modules/agent/task_runtime/workflows/fallback.py @@ -0,0 +1,54 @@ +from __future__ import annotations + +import json + +from app.modules.agent.llm import AgentLlmService +from app.modules.agent.task_runtime.models import TaskRuntimeContext, WorkflowExecutionResult +from app.modules.agent.task_runtime.status_events import emit_status_block +from app.schemas.chat import TaskResultType + + +class FallbackWorkflow: + workflow_id = "fallback" + + def __init__(self, llm: AgentLlmService | None) -> None: + self._llm = llm + + def run(self, ctx: TaskRuntimeContext) -> WorkflowExecutionResult: + emit_status_block( + ctx, + block_id="rag_retrieval", + title="RAG Retrieval", + lines=["not used in fallback workflow"], + ) + if self._llm is None: + answer = "Пока не удалось подобрать специализированный workflow для этого запроса." + else: + payload = json.dumps( + { + "question": ctx.message, + "intent": getattr(ctx.route_result, "intent", ""), + "attachments": list(ctx.attachments), + "confluence_urls": list(ctx.enriched_context.get("confluence_urls") or []), + }, + ensure_ascii=False, + indent=2, + ) + answer = self._llm.generate("docs_fallback_answer", payload, log_context="agent.workflow.fallback").strip() + emit_status_block( + ctx, + block_id="workflow", + title="Task Workflow", + lines=[f"workflow_id: {self.workflow_id}"], + ) + emit_status_block( + ctx, + block_id="evidence_gate", + title="Evidence Gate", + lines=["not applied in fallback workflow"], + ) + return WorkflowExecutionResult( + result_type=TaskResultType.ANSWER, + answer=answer, + meta={"workflow_id": self.workflow_id, "intent": getattr(ctx.route_result, "intent", "")}, + ) diff --git a/src/app/modules/agent/task_runtime/workflows/general_qa.py b/src/app/modules/agent/task_runtime/workflows/general_qa.py new file mode 100644 index 0000000..aa9ba41 --- /dev/null +++ b/src/app/modules/agent/task_runtime/workflows/general_qa.py @@ -0,0 +1,54 @@ +from __future__ import annotations + +from app.modules.agent.runtime.docs_qa_pipeline import DocsQAPipelineRunner +from app.modules.agent.task_runtime.models import TaskRuntimeContext, WorkflowExecutionResult +from app.modules.agent.task_runtime.status_events import emit_status_block +from app.modules.agent.task_runtime.workflows.docs_qa import _gate_lines, _retrieval_lines +from app.schemas.chat import TaskResultType + + +class GeneralQaWorkflow: + workflow_id = "general_qa" + + def __init__(self, runner: DocsQAPipelineRunner) -> None: + self._runner = runner + + def run(self, ctx: TaskRuntimeContext) -> WorkflowExecutionResult: + result = self._runner.run( + ctx.message, + ctx.rag_session_id, + conversation_state=ctx.conversation_state, + mode="full", + ) + diagnostics = result.diagnostics.model_dump(mode="json") + emit_status_block( + ctx, + block_id="rag_retrieval", + title="RAG Retrieval", + lines=_retrieval_lines(diagnostics), + ) + emit_status_block( + ctx, + block_id="workflow", + title="Task Workflow", + lines=[ + f"workflow_id: {self.workflow_id}", + f"prompt: {result.prompt_name}", + f"answer_mode: {result.answer_mode}", + ], + ) + emit_status_block( + ctx, + block_id="evidence_gate", + title="Evidence Gate", + lines=_gate_lines(diagnostics), + ) + return WorkflowExecutionResult( + result_type=TaskResultType.ANSWER, + answer=result.answer, + meta={ + "workflow_id": self.workflow_id, + "intent": result.router_result.intent, + "diagnostics": diagnostics, + }, + ) diff --git a/src/app/modules/agent/task_runtime/workflows/openapi.py b/src/app/modules/agent/task_runtime/workflows/openapi.py new file mode 100644 index 0000000..f9e01f3 --- /dev/null +++ b/src/app/modules/agent/task_runtime/workflows/openapi.py @@ -0,0 +1,63 @@ +from __future__ import annotations + +from app.modules.agent.runtime.docs_qa_pipeline import DocsQAPipelineRunner +from app.modules.agent.task_runtime.models import TaskRuntimeContext, WorkflowExecutionResult +from app.modules.agent.task_runtime.status_events import emit_status_block +from app.schemas.chat import TaskArtifact, TaskResultType +from app.modules.agent.task_runtime.workflows.docs_qa import _gate_lines, _retrieval_lines + + +class OpenApiWorkflow: + workflow_id = "openapi_generation" + + def __init__(self, runner: DocsQAPipelineRunner) -> None: + self._runner = runner + + def run(self, ctx: TaskRuntimeContext) -> WorkflowExecutionResult: + result = self._runner.run( + ctx.message, + ctx.rag_session_id, + conversation_state=ctx.conversation_state, + mode="full", + ) + diagnostics = result.diagnostics.model_dump(mode="json") + emit_status_block( + ctx, + block_id="rag_retrieval", + title="RAG Retrieval", + lines=_retrieval_lines(diagnostics), + ) + emit_status_block( + ctx, + block_id="workflow", + title="Task Workflow", + lines=[ + f"workflow_id: {self.workflow_id}", + f"prompt: {result.prompt_name}", + f"answer_mode: {result.answer_mode}", + ], + ) + emit_status_block( + ctx, + block_id="evidence_gate", + title="Evidence Gate", + lines=_gate_lines(diagnostics), + ) + content = (result.openapi_result.raw_yaml if result.openapi_result else "") or result.answer + artifact = TaskArtifact( + artifact_type=TaskResultType.OPENAPI, + title="OpenAPI Specification", + content=content, + format="yaml", + source_refs=list(result.diagnostics.doc_paths), + ) + return WorkflowExecutionResult( + result_type=TaskResultType.OPENAPI, + answer=content, + artifacts=[artifact], + meta={ + "workflow_id": self.workflow_id, + "intent": result.router_result.intent, + "diagnostics": diagnostics, + }, + ) diff --git a/src/app/modules/agent_api/__init__.py b/src/app/modules/agent_api/__init__.py new file mode 100644 index 0000000..c689232 --- /dev/null +++ b/src/app/modules/agent_api/__init__.py @@ -0,0 +1,3 @@ +from app.modules.agent_api.module import AgentApiModule + +__all__ = ["AgentApiModule"] diff --git a/src/app/modules/agent_api/application/request_service.py b/src/app/modules/agent_api/application/request_service.py new file mode 100644 index 0000000..98cba04 --- /dev/null +++ b/src/app/modules/agent_api/application/request_service.py @@ -0,0 +1,38 @@ +from __future__ import annotations + +import asyncio + +from app.modules.agent_api.domain.models.agent_request import AgentRequest +from app.modules.agent_api.infrastructure.ids.request_id_factory import RequestIdFactory +from app.modules.agent_api.infrastructure.stores.in_memory_request_store import InMemoryRequestStore +from app.modules.agent_api.application.session_service import SessionService +from app.modules.orchestration.facade import OrchestrationFacade + + +class RequestService: + def __init__( + self, + request_store: InMemoryRequestStore, + request_ids: RequestIdFactory, + sessions: SessionService, + orchestration: OrchestrationFacade, + ) -> None: + self._request_store = request_store + self._request_ids = request_ids + self._sessions = sessions + self._orchestration = orchestration + + async def create(self, session_id: str, message: str, process_version: str) -> AgentRequest: + session = self._sessions.get(session_id) + request = AgentRequest.create( + request_id=self._request_ids.create(), + session_id=session_id, + message=message, + process_version=process_version, + ) + self._request_store.save(request) + asyncio.create_task(self._orchestration.run(request, session)) + return request + + def get(self, request_id: str) -> AgentRequest | None: + return self._request_store.get(request_id) diff --git a/src/app/modules/agent_api/application/session_service.py b/src/app/modules/agent_api/application/session_service.py new file mode 100644 index 0000000..c5ec3a3 --- /dev/null +++ b/src/app/modules/agent_api/application/session_service.py @@ -0,0 +1,45 @@ +from __future__ import annotations + +from datetime import datetime, timezone + +from app.core.exceptions import AppError +from app.modules.agent_api.domain.models.agent_session import AgentSession +from app.modules.agent_api.infrastructure.ids.session_id_factory import SessionIdFactory +from app.modules.agent_api.infrastructure.stores.in_memory_session_store import InMemorySessionStore +from app.schemas.common import ModuleName + + +class SessionService: + def __init__( + self, + store: InMemorySessionStore, + ids: SessionIdFactory, + rag_session_exists, + ) -> None: + self._store = store + self._ids = ids + self._rag_session_exists = rag_session_exists + + def create(self) -> AgentSession: + session = AgentSession.create(self._ids.create()) + return self._store.save(session) + + def get(self, session_id: str) -> AgentSession: + session = self._store.get(session_id) + if session is None: + raise AppError("session_not_found", f"Agent session not found: {session_id}", ModuleName.BACKEND) + return session + + def bind_rag_session(self, session_id: str, rag_session_id: str) -> AgentSession: + if not self._rag_session_exists(rag_session_id): + raise AppError("rag_session_not_found", f"RAG session not found: {rag_session_id}", ModuleName.RAG) + session = self.get(session_id) + session.active_rag_session_id = rag_session_id + session.updated_at = datetime.now(timezone.utc) + return self._store.save(session) + + def reset(self, session_id: str) -> AgentSession: + session = self.get(session_id) + session.active_rag_session_id = None + session.updated_at = datetime.now(timezone.utc) + return self._store.save(session) diff --git a/src/app/modules/agent_api/application/stream_service.py b/src/app/modules/agent_api/application/stream_service.py new file mode 100644 index 0000000..1d8eba3 --- /dev/null +++ b/src/app/modules/agent_api/application/stream_service.py @@ -0,0 +1,24 @@ +from __future__ import annotations + +from app.core.exceptions import AppError +from app.modules.agent_api.infrastructure.streaming.sse_encoder import SseEncoder +from app.modules.agent_api.infrastructure.streaming.sse_event_channel import SseEventChannel +from app.schemas.common import ModuleName + + +class StreamService: + def __init__(self, channel: SseEventChannel, request_exists, encoder: SseEncoder | None = None) -> None: + self._channel = channel + self._request_exists = request_exists + self._encoder = encoder or SseEncoder() + + async def subscribe(self, request_id: str): + if not self._request_exists(request_id): + raise AppError("request_not_found", f"Agent request not found: {request_id}", ModuleName.BACKEND) + return await self._channel.subscribe(request_id, replay=True) + + async def unsubscribe(self, request_id: str, queue) -> None: + await self._channel.unsubscribe(request_id, queue) + + def encode(self, event) -> str: + return self._encoder.encode(event) diff --git a/src/app/modules/agent_api/controllers/request_controller.py b/src/app/modules/agent_api/controllers/request_controller.py new file mode 100644 index 0000000..85abb95 --- /dev/null +++ b/src/app/modules/agent_api/controllers/request_controller.py @@ -0,0 +1,35 @@ +from __future__ import annotations + +from app.core.exceptions import AppError +from app.modules.agent_api.application.request_service import RequestService +from app.schemas.agent_api import AgentRequestCreateRequest, AgentRequestQueuedResponse, AgentRequestStateResponse +from app.schemas.common import ModuleName + + +class RequestController: + def __init__(self, service: RequestService) -> None: + self._service = service + + async def create_request(self, request: AgentRequestCreateRequest) -> AgentRequestQueuedResponse: + item = await self._service.create(request.session_id, request.message, request.process_version) + return AgentRequestQueuedResponse( + request_id=item.request_id, + session_id=item.session_id, + status=item.status.value, + stream_url=f"/api/agent/streams/{item.request_id}", + ) + + def get_request(self, request_id: str) -> AgentRequestStateResponse: + item = self._service.get(request_id) + if item is None: + raise AppError("request_not_found", f"Agent request not found: {request_id}", ModuleName.BACKEND) + return AgentRequestStateResponse( + request_id=item.request_id, + session_id=item.session_id, + status=item.status.value, + process_version=item.process_version, + answer=item.answer, + error=item.error, + created_at=item.created_at, + completed_at=item.completed_at, + ) diff --git a/src/app/modules/agent_api/controllers/session_controller.py b/src/app/modules/agent_api/controllers/session_controller.py new file mode 100644 index 0000000..c01938d --- /dev/null +++ b/src/app/modules/agent_api/controllers/session_controller.py @@ -0,0 +1,39 @@ +from __future__ import annotations + +from app.schemas.agent_api import ( + BindRagSessionRequest, + BindRagSessionResponse, + CreateAgentSessionResponse, + ResetAgentSessionResponse, +) +from app.modules.agent_api.application.session_service import SessionService + + +class SessionController: + def __init__(self, service: SessionService) -> None: + self._service = service + + def create_session(self) -> CreateAgentSessionResponse: + session = self._service.create() + return CreateAgentSessionResponse( + session_id=session.session_id, + active_rag_session_id=session.active_rag_session_id, + created_at=session.created_at, + ) + + def bind_rag_session(self, session_id: str, request: BindRagSessionRequest) -> BindRagSessionResponse: + session = self._service.bind_rag_session(session_id, request.rag_session_id) + return BindRagSessionResponse( + session_id=session.session_id, + active_rag_session_id=session.active_rag_session_id, + updated_at=session.updated_at, + ) + + def reset_session(self, session_id: str) -> ResetAgentSessionResponse: + session = self._service.reset(session_id) + return ResetAgentSessionResponse( + session_id=session.session_id, + active_rag_session_id=session.active_rag_session_id, + status="reset", + updated_at=session.updated_at, + ) diff --git a/src/app/modules/agent_api/controllers/stream_controller.py b/src/app/modules/agent_api/controllers/stream_controller.py new file mode 100644 index 0000000..9e18c58 --- /dev/null +++ b/src/app/modules/agent_api/controllers/stream_controller.py @@ -0,0 +1,37 @@ +from __future__ import annotations + +from fastapi.responses import StreamingResponse + +from app.modules.agent_api.application.stream_service import StreamService + + +class StreamController: + def __init__(self, service: StreamService) -> None: + self._service = service + + async def stream(self, request_id: str) -> StreamingResponse: + queue = await self._service.subscribe(request_id) + + async def event_stream(): + import asyncio + + heartbeat = 10 + try: + while True: + try: + event = await asyncio.wait_for(queue.get(), timeout=heartbeat) + yield self._service.encode(event) + except asyncio.TimeoutError: + yield ": keepalive\n\n" + finally: + await self._service.unsubscribe(request_id, queue) + + return StreamingResponse( + event_stream(), + media_type="text/event-stream", + headers={ + "Cache-Control": "no-cache, no-transform", + "Connection": "keep-alive", + "X-Accel-Buffering": "no", + }, + ) diff --git a/src/app/modules/agent_api/domain/events/client_event.py b/src/app/modules/agent_api/domain/events/client_event.py new file mode 100644 index 0000000..4bf9da4 --- /dev/null +++ b/src/app/modules/agent_api/domain/events/client_event.py @@ -0,0 +1,18 @@ +from __future__ import annotations + +from dataclasses import dataclass, field +from datetime import datetime, timezone +from uuid import uuid4 + +from app.schemas.client_events import ClientEventType + + +@dataclass(slots=True) +class ClientEventRecord: + request_id: str + type: ClientEventType + source: str + text: str = "" + payload: dict = field(default_factory=dict) + event_id: str = field(default_factory=lambda: f"evt_{uuid4().hex}") + created_at: datetime = field(default_factory=lambda: datetime.now(timezone.utc)) diff --git a/src/app/modules/agent_api/domain/models/agent_request.py b/src/app/modules/agent_api/domain/models/agent_request.py new file mode 100644 index 0000000..c811055 --- /dev/null +++ b/src/app/modules/agent_api/domain/models/agent_request.py @@ -0,0 +1,37 @@ +from __future__ import annotations + +from dataclasses import dataclass +from datetime import datetime, timezone + +from app.schemas.common import ErrorPayload +from app.schemas.orchestration import RequestExecutionStatus + + +@dataclass(slots=True) +class AgentRequest: + request_id: str + session_id: str + message: str + process_version: str + status: RequestExecutionStatus + created_at: datetime + completed_at: datetime | None = None + answer: str | None = None + error: ErrorPayload | None = None + + @classmethod + def create( + cls, + request_id: str, + session_id: str, + message: str, + process_version: str, + ) -> "AgentRequest": + return cls( + request_id=request_id, + session_id=session_id, + message=message, + process_version=process_version, + status=RequestExecutionStatus.QUEUED, + created_at=datetime.now(timezone.utc), + ) diff --git a/src/app/modules/agent_api/domain/models/agent_session.py b/src/app/modules/agent_api/domain/models/agent_session.py new file mode 100644 index 0000000..25414f0 --- /dev/null +++ b/src/app/modules/agent_api/domain/models/agent_session.py @@ -0,0 +1,22 @@ +from __future__ import annotations + +from dataclasses import dataclass +from datetime import datetime, timezone + + +@dataclass(slots=True) +class AgentSession: + session_id: str + active_rag_session_id: str | None + created_at: datetime + updated_at: datetime + + @classmethod + def create(cls, session_id: str) -> "AgentSession": + now = datetime.now(timezone.utc) + return cls( + session_id=session_id, + active_rag_session_id=None, + created_at=now, + updated_at=now, + ) diff --git a/src/app/modules/agent_api/infrastructure/ids/request_id_factory.py b/src/app/modules/agent_api/infrastructure/ids/request_id_factory.py new file mode 100644 index 0000000..c366f71 --- /dev/null +++ b/src/app/modules/agent_api/infrastructure/ids/request_id_factory.py @@ -0,0 +1,6 @@ +from uuid import uuid4 + + +class RequestIdFactory: + def create(self) -> str: + return f"req_{uuid4().hex}" diff --git a/src/app/modules/agent_api/infrastructure/ids/session_id_factory.py b/src/app/modules/agent_api/infrastructure/ids/session_id_factory.py new file mode 100644 index 0000000..5d79968 --- /dev/null +++ b/src/app/modules/agent_api/infrastructure/ids/session_id_factory.py @@ -0,0 +1,6 @@ +from uuid import uuid4 + + +class SessionIdFactory: + def create(self) -> str: + return f"as_{uuid4().hex}" diff --git a/src/app/modules/agent_api/infrastructure/logging/request_trace_logger.py b/src/app/modules/agent_api/infrastructure/logging/request_trace_logger.py new file mode 100644 index 0000000..2be1fd9 --- /dev/null +++ b/src/app/modules/agent_api/infrastructure/logging/request_trace_logger.py @@ -0,0 +1,81 @@ +from __future__ import annotations + +from pathlib import Path +from threading import Lock + +from app.modules.agent_api.domain.events.client_event import ClientEventRecord +from app.modules.agent_api.domain.models.agent_request import AgentRequest +from app.modules.agent_api.domain.models.agent_session import AgentSession +from app.modules.agent_api.infrastructure.logging.trace_file_path_builder import TraceFilePathBuilder +from app.modules.agent_api.infrastructure.logging.trace_markdown_writer import TraceMarkdownWriter + + +class RequestTraceLogger: + def __init__(self, root: Path) -> None: + self._paths = TraceFilePathBuilder(root) + self._writer = TraceMarkdownWriter() + self._files: dict[str, Path] = {} + self._lock = Lock() + + def start_request(self, request: AgentRequest, session: AgentSession) -> None: + path = self._paths.build(request.request_id) + self._writer.initialize( + path, + [ + f"# Request Trace: {request.request_id}", + "", + f"- session_id: {session.session_id}", + f"- active_rag_session_id: {session.active_rag_session_id or '—'}", + f"- process_version: {request.process_version}", + f"- created_at: {request.created_at.isoformat()}", + "", + "## User Message", + request.message, + ], + ) + with self._lock: + self._files[request.request_id] = path + + def log_step(self, request_id: str, step: str, status: str, details: dict | None = None) -> None: + self._append(request_id, f"Step {step}", {"status": status, "details": details or {}}) + + def log_event(self, event: ClientEventRecord) -> None: + self._append( + event.request_id, + f"Event {event.type.value}", + { + "source": event.source, + "text": event.text, + "payload": event.payload, + "created_at": event.created_at.isoformat(), + }, + ) + + def complete_request(self, request: AgentRequest) -> None: + self._append( + request.request_id, + "Result", + { + "status": request.status.value, + "answer": request.answer, + "completed_at": request.completed_at.isoformat() if request.completed_at else None, + }, + ) + + def fail_request(self, request: AgentRequest) -> None: + self._append( + request.request_id, + "Error", + { + "status": request.status.value, + "error": request.error.model_dump(mode="json") if request.error else None, + "completed_at": request.completed_at.isoformat() if request.completed_at else None, + }, + ) + + def _append(self, request_id: str, title: str, payload: dict) -> None: + with self._lock: + path = self._files.get(request_id) + if path is None: + return + self._writer.append_section(path, title, payload) diff --git a/src/app/modules/agent_api/infrastructure/logging/trace_file_path_builder.py b/src/app/modules/agent_api/infrastructure/logging/trace_file_path_builder.py new file mode 100644 index 0000000..8bc9fd0 --- /dev/null +++ b/src/app/modules/agent_api/infrastructure/logging/trace_file_path_builder.py @@ -0,0 +1,15 @@ +from __future__ import annotations + +from datetime import datetime, timezone +from pathlib import Path + + +class TraceFilePathBuilder: + def __init__(self, root: Path) -> None: + self._root = root + + def build(self, request_id: str) -> Path: + stamp = datetime.now(timezone.utc).strftime("%Y%m%d") + directory = self._root / stamp + directory.mkdir(parents=True, exist_ok=True) + return directory / f"{request_id}.md" diff --git a/src/app/modules/agent_api/infrastructure/logging/trace_markdown_writer.py b/src/app/modules/agent_api/infrastructure/logging/trace_markdown_writer.py new file mode 100644 index 0000000..0a4c2f9 --- /dev/null +++ b/src/app/modules/agent_api/infrastructure/logging/trace_markdown_writer.py @@ -0,0 +1,20 @@ +from __future__ import annotations + +import json +from pathlib import Path + + +class TraceMarkdownWriter: + def initialize(self, path: Path, lines: list[str]) -> None: + path.write_text("\n".join(lines) + "\n", encoding="utf-8") + + def append_section(self, path: Path, title: str, payload: dict | list | str) -> None: + body = payload if isinstance(payload, str) else json.dumps(payload, ensure_ascii=False, indent=2) + with path.open("a", encoding="utf-8") as handle: + handle.write(f"\n## {title}\n") + if isinstance(payload, str): + handle.write(body + "\n") + else: + handle.write("```json\n") + handle.write(body + "\n") + handle.write("```\n") diff --git a/src/app/modules/agent_api/infrastructure/stores/in_memory_request_store.py b/src/app/modules/agent_api/infrastructure/stores/in_memory_request_store.py new file mode 100644 index 0000000..216ca2f --- /dev/null +++ b/src/app/modules/agent_api/infrastructure/stores/in_memory_request_store.py @@ -0,0 +1,20 @@ +from __future__ import annotations + +from threading import Lock + +from app.modules.agent_api.domain.models.agent_request import AgentRequest + + +class InMemoryRequestStore: + def __init__(self) -> None: + self._items: dict[str, AgentRequest] = {} + self._lock = Lock() + + def save(self, request: AgentRequest) -> AgentRequest: + with self._lock: + self._items[request.request_id] = request + return request + + def get(self, request_id: str) -> AgentRequest | None: + with self._lock: + return self._items.get(request_id) diff --git a/src/app/modules/agent_api/infrastructure/stores/in_memory_session_store.py b/src/app/modules/agent_api/infrastructure/stores/in_memory_session_store.py new file mode 100644 index 0000000..c66109e --- /dev/null +++ b/src/app/modules/agent_api/infrastructure/stores/in_memory_session_store.py @@ -0,0 +1,20 @@ +from __future__ import annotations + +from threading import Lock + +from app.modules.agent_api.domain.models.agent_session import AgentSession + + +class InMemorySessionStore: + def __init__(self) -> None: + self._items: dict[str, AgentSession] = {} + self._lock = Lock() + + def save(self, session: AgentSession) -> AgentSession: + with self._lock: + self._items[session.session_id] = session + return session + + def get(self, session_id: str) -> AgentSession | None: + with self._lock: + return self._items.get(session_id) diff --git a/src/app/modules/agent_api/infrastructure/streaming/replay_buffer.py b/src/app/modules/agent_api/infrastructure/streaming/replay_buffer.py new file mode 100644 index 0000000..b3b27d5 --- /dev/null +++ b/src/app/modules/agent_api/infrastructure/streaming/replay_buffer.py @@ -0,0 +1,20 @@ +from __future__ import annotations + +from collections import defaultdict + +from app.modules.agent_api.domain.events.client_event import ClientEventRecord + + +class ReplayBuffer: + def __init__(self, limit: int = 200) -> None: + self._limit = limit + self._items: dict[str, list[ClientEventRecord]] = defaultdict(list) + + def append(self, request_id: str, event: ClientEventRecord) -> None: + history = self._items[request_id] + history.append(event) + if len(history) > self._limit: + del history[: len(history) - self._limit] + + def list(self, request_id: str) -> list[ClientEventRecord]: + return list(self._items.get(request_id, [])) diff --git a/src/app/modules/agent_api/infrastructure/streaming/sse_encoder.py b/src/app/modules/agent_api/infrastructure/streaming/sse_encoder.py new file mode 100644 index 0000000..4d88d91 --- /dev/null +++ b/src/app/modules/agent_api/infrastructure/streaming/sse_encoder.py @@ -0,0 +1,19 @@ +from __future__ import annotations + +import json + +from app.modules.agent_api.domain.events.client_event import ClientEventRecord + + +class SseEncoder: + def encode(self, event: ClientEventRecord) -> str: + payload = { + "event_id": event.event_id, + "request_id": event.request_id, + "type": event.type.value, + "source": event.source, + "text": event.text, + "payload": event.payload, + "created_at": event.created_at.isoformat(), + } + return f"event: {event.type.value}\ndata: {json.dumps(payload, ensure_ascii=False)}\n\n" diff --git a/src/app/modules/agent_api/infrastructure/streaming/sse_event_channel.py b/src/app/modules/agent_api/infrastructure/streaming/sse_event_channel.py new file mode 100644 index 0000000..684f5b8 --- /dev/null +++ b/src/app/modules/agent_api/infrastructure/streaming/sse_event_channel.py @@ -0,0 +1,42 @@ +from __future__ import annotations + +import asyncio +from collections import defaultdict + +from app.modules.agent_api.domain.events.client_event import ClientEventRecord +from app.modules.agent_api.infrastructure.streaming.replay_buffer import ReplayBuffer + + +class SseEventChannel: + def __init__(self, replay_buffer: ReplayBuffer | None = None) -> None: + self._channels: dict[str, list[asyncio.Queue[ClientEventRecord]]] = defaultdict(list) + self._replay = replay_buffer or ReplayBuffer() + self._lock = asyncio.Lock() + + async def subscribe(self, request_id: str, replay: bool = True) -> asyncio.Queue[ClientEventRecord]: + queue: asyncio.Queue[ClientEventRecord] = asyncio.Queue() + snapshot: list[ClientEventRecord] = [] + async with self._lock: + self._channels[request_id].append(queue) + if replay: + snapshot = self._replay.list(request_id) + for item in snapshot: + await queue.put(item) + return queue + + async def unsubscribe(self, request_id: str, queue: asyncio.Queue[ClientEventRecord]) -> None: + async with self._lock: + queues = self._channels.get(request_id) + if not queues: + return + if queue in queues: + queues.remove(queue) + if not queues: + self._channels.pop(request_id, None) + + async def publish(self, event: ClientEventRecord) -> None: + async with self._lock: + self._replay.append(event.request_id, event) + queues = list(self._channels.get(event.request_id, [])) + for queue in queues: + await queue.put(event) diff --git a/src/app/modules/agent_api/module.py b/src/app/modules/agent_api/module.py new file mode 100644 index 0000000..179bf0b --- /dev/null +++ b/src/app/modules/agent_api/module.py @@ -0,0 +1,30 @@ +from __future__ import annotations + +from fastapi import APIRouter + +from app.modules.agent_api.application.request_service import RequestService +from app.modules.agent_api.application.session_service import SessionService +from app.modules.agent_api.application.stream_service import StreamService +from app.modules.agent_api.controllers.request_controller import RequestController +from app.modules.agent_api.controllers.session_controller import SessionController +from app.modules.agent_api.controllers.stream_controller import StreamController +from app.modules.agent_api.public_router import build_public_router + + +class AgentApiModule: + def __init__( + self, + sessions: SessionService, + requests: RequestService, + streams: StreamService, + ) -> None: + self._sessions = SessionController(sessions) + self._requests = RequestController(requests) + self._streams = StreamController(streams) + + def public_router(self) -> APIRouter: + return build_public_router( + sessions=self._sessions, + requests=self._requests, + streams=self._streams, + ) diff --git a/src/app/modules/agent_api/public_router.py b/src/app/modules/agent_api/public_router.py new file mode 100644 index 0000000..17ce058 --- /dev/null +++ b/src/app/modules/agent_api/public_router.py @@ -0,0 +1,50 @@ +from __future__ import annotations + +from fastapi import APIRouter + +from app.modules.agent_api.controllers.request_controller import RequestController +from app.modules.agent_api.controllers.session_controller import SessionController +from app.modules.agent_api.controllers.stream_controller import StreamController +from app.schemas.agent_api import ( + AgentRequestCreateRequest, + AgentRequestQueuedResponse, + AgentRequestStateResponse, + BindRagSessionRequest, + BindRagSessionResponse, + CreateAgentSessionResponse, + ResetAgentSessionResponse, +) + + +def build_public_router( + sessions: SessionController, + requests: RequestController, + streams: StreamController, +) -> APIRouter: + router = APIRouter(tags=["agent-api"]) + + @router.post("/api/agent/sessions", response_model=CreateAgentSessionResponse) + async def create_session() -> CreateAgentSessionResponse: + return sessions.create_session() + + @router.post("/api/agent/sessions/{session_id}/rag", response_model=BindRagSessionResponse) + async def bind_rag_session(session_id: str, request: BindRagSessionRequest) -> BindRagSessionResponse: + return sessions.bind_rag_session(session_id, request) + + @router.post("/api/agent/sessions/{session_id}/reset", response_model=ResetAgentSessionResponse) + async def reset_session(session_id: str) -> ResetAgentSessionResponse: + return sessions.reset_session(session_id) + + @router.post("/api/agent/requests", response_model=AgentRequestQueuedResponse) + async def create_request(request: AgentRequestCreateRequest) -> AgentRequestQueuedResponse: + return await requests.create_request(request) + + @router.get("/api/agent/requests/{request_id}", response_model=AgentRequestStateResponse) + async def get_request(request_id: str) -> AgentRequestStateResponse: + return requests.get_request(request_id) + + @router.get("/api/agent/streams/{request_id}") + async def stream(request_id: str): + return await streams.stream(request_id) + + return router diff --git a/src/app/modules/application.py b/src/app/modules/application.py index 8fa581e..0018fd9 100644 --- a/src/app/modules/application.py +++ b/src/app/modules/application.py @@ -1,16 +1,46 @@ -from app.modules.agent.runtime import AgentRuntimeExecutor, RuntimeRetrievalAdapter -from app.modules.agent.runtime.code_qa_runner_adapter import CodeQaRunnerAdapter +from pathlib import Path + from app.modules.agent.llm import AgentLlmService from app.modules.agent.llm.prompt_loader import PromptLoader -from app.modules.chat.direct_service import CodeExplainChatService -from app.modules.chat.dialog_store import DialogSessionStore -from app.modules.chat.repository import ChatRepository -from app.modules.chat.module import ChatModule -from app.modules.chat.session_resolver import ChatSessionResolver -from app.modules.chat.task_store import TaskStore +from app.modules.agent.intent_router_v2 import IntentRouterV2 +from app.modules.agent.runtime import DocsQAPipelineRunner +from app.modules.agent.runtime.steps.retrieval import RuntimeRepoContextFactory, RuntimeRetrievalAdapter +from app.modules.agent.task_runtime import ContextEnrichmentService, DocumentationTemplateRegistry, TaskRuntimeContextBuilder +from app.modules.agent.task_runtime.workflows import ( + DocumentationGenerationWorkflow, + DocsQaWorkflow, + FallbackWorkflow, + OpenApiWorkflow, +) +from app.modules.agent.task_runtime.workflows.general_qa import GeneralQaWorkflow +from app.modules.agent_api import AgentApiModule +from app.modules.agent_api.application.request_service import RequestService +from app.modules.agent_api.application.session_service import SessionService +from app.modules.agent_api.application.stream_service import StreamService +from app.modules.agent_api.infrastructure.ids.request_id_factory import RequestIdFactory +from app.modules.agent_api.infrastructure.ids.session_id_factory import SessionIdFactory +from app.modules.agent_api.infrastructure.logging.request_trace_logger import RequestTraceLogger +from app.modules.agent_api.infrastructure.stores.in_memory_request_store import InMemoryRequestStore +from app.modules.agent_api.infrastructure.stores.in_memory_session_store import InMemorySessionStore +from app.modules.agent_api.infrastructure.streaming.sse_event_channel import SseEventChannel +from app.modules.orchestration import OrchestrationFacade +from app.modules.orchestration.adapters.intent_router_adapter import IntentRouterAdapter +from app.modules.orchestration.adapters.llm_chat_adapter import LlmChatAdapter +from app.modules.orchestration.messaging.client_message_publisher import ClientMessagePublisher +from app.modules.orchestration.processes.registry import ProcessRegistry +from app.modules.orchestration.processes.v1.process import V1Process +from app.modules.orchestration.processes.v1.steps.bootstrap_step import BootstrapStep +from app.modules.orchestration.processes.v1.steps.finalize_step import FinalizeStep +from app.modules.orchestration.processes.v1.steps.run_llm_step import RunLlmStep +from app.modules.orchestration.processes.v2.process import V2Process +from app.modules.orchestration.processes.v2.steps.execute_documentation_workflow_step import ExecuteDocumentationWorkflowStep +from app.modules.orchestration.processes.v2.steps.execute_fallback_workflow_step import ExecuteFallbackWorkflowStep +from app.modules.orchestration.processes.v2.steps.execute_general_qa_workflow_step import ExecuteGeneralQaWorkflowStep +from app.modules.orchestration.processes.v2.steps.execute_openapi_workflow_step import ExecuteOpenApiWorkflowStep +from app.modules.orchestration.processes.v2.steps.route_intent_step import RouteIntentStep +from app.modules.orchestration.runtime.process_runner import ProcessRunner from app.modules.rag.persistence.repository import RagRepository from app.modules.agent.runtime.story_context_repository import StoryContextRepository, StoryContextSchemaRepository -from app.modules.agent.runtime.steps.explain import CodeExplainRetrieverV2, CodeGraphRepository, LayeredRetrievalGateway from app.modules.rag.module import RagModule, RagRepoModule from app.modules.shared.bootstrap import bootstrap_database from app.modules.shared.event_bus import EventBus @@ -22,20 +52,14 @@ class ModularApplication: self.events = EventBus() self.retry = RetryExecutor() self.rag_repository = RagRepository() - self.chat_repository = ChatRepository() self.story_context_schema_repository = StoryContextSchemaRepository() self.story_context_repository = StoryContextRepository() - self.chat_tasks = TaskStore() self.rag = RagModule(event_bus=self.events, retry=self.retry, repository=self.rag_repository) self.rag_repo = RagRepoModule( story_context_repository=self.story_context_repository, rag_repository=self.rag_repository, ) - self.code_explain_retriever = CodeExplainRetrieverV2( - gateway=LayeredRetrievalGateway(self.rag_repository, self.rag.embedder), - graph_repository=CodeGraphRepository(), - ) from app.modules.shared.gigachat.client import GigaChatClient from app.modules.shared.gigachat.settings import GigaChatSettings from app.modules.shared.gigachat.token_provider import GigaChatTokenProvider @@ -44,32 +68,69 @@ class ModularApplication: _giga_client = GigaChatClient(_giga_settings, GigaChatTokenProvider(_giga_settings)) _prompt_loader = PromptLoader() self._agent_llm = AgentLlmService(client=_giga_client, prompts=_prompt_loader) + _router = IntentRouterV2() _retrieval = RuntimeRetrievalAdapter(self.rag_repository) - _executor = AgentRuntimeExecutor(llm=self._agent_llm, retrieval=_retrieval) - self._agent_runner = CodeQaRunnerAdapter(_executor) - self.direct_chat = CodeExplainChatService( - retriever=self.code_explain_retriever, + _repo_context_factory = RuntimeRepoContextFactory() + _docs_runner = DocsQAPipelineRunner( + router=_router, + retrieval_adapter=_retrieval, + repo_context=_repo_context_factory.build(), llm=self._agent_llm, - session_resolver=ChatSessionResolver( - dialogs=DialogSessionStore(self.chat_repository), - rag_session_exists=lambda rag_session_id: self.rag.sessions.get(rag_session_id) is not None, - ), - task_store=self.chat_tasks, - message_sink=self.chat_repository.add_message, ) - self.chat = ChatModule( - agent_runner=self._agent_runner, - event_bus=self.events, - retry=self.retry, - rag_sessions=self.rag.sessions, - repository=self.chat_repository, - direct_chat=self.direct_chat, - task_store=self.chat_tasks, + _task_context_builder = TaskRuntimeContextBuilder(_repo_context_factory) + _context_enrichment = ContextEnrichmentService() + _docs_workflow = DocsQaWorkflow(_docs_runner) + _openapi_workflow = OpenApiWorkflow(_docs_runner) + _general_qa_workflow = GeneralQaWorkflow(_docs_runner) + _fallback_workflow = FallbackWorkflow(self._agent_llm) + _docs_generation_workflow = DocumentationGenerationWorkflow(self._agent_llm, DocumentationTemplateRegistry()) + self._docs_generation_workflow = _docs_generation_workflow + + self.agent_sessions = InMemorySessionStore() + self.agent_requests = InMemoryRequestStore() + self.agent_events = SseEventChannel() + self.agent_trace_logger = RequestTraceLogger(Path("runtime_traces/agent_requests")) + _publisher = ClientMessagePublisher(self.agent_events, self.agent_trace_logger) + _process_registry = ProcessRegistry( + V1Process([BootstrapStep(), RunLlmStep(LlmChatAdapter(self._agent_llm)), FinalizeStep()]), + V2Process( + [ + BootstrapStep(), + RouteIntentStep(IntentRouterAdapter(_router), _task_context_builder, _context_enrichment), + ExecuteDocumentationWorkflowStep(_docs_workflow, "workflow_documentation_explain"), + ExecuteOpenApiWorkflowStep(_openapi_workflow, "workflow_openapi_generation"), + ExecuteGeneralQaWorkflowStep(_general_qa_workflow, "workflow_general_qa"), + ExecuteFallbackWorkflowStep(_fallback_workflow, "workflow_fallback"), + FinalizeStep(), + ] + ), + ) + _orchestration = OrchestrationFacade( + request_store=self.agent_requests, + process_registry=_process_registry, + process_runner=ProcessRunner(), + publisher=_publisher, + trace_logger=self.agent_trace_logger, + ) + _session_service = SessionService( + store=self.agent_sessions, + ids=SessionIdFactory(), + rag_session_exists=lambda rag_session_id: self.rag.sessions.get(rag_session_id) is not None, + ) + _request_service = RequestService( + request_store=self.agent_requests, + request_ids=RequestIdFactory(), + sessions=_session_service, + orchestration=_orchestration, + ) + self.agent_api = AgentApiModule( + sessions=_session_service, + requests=_request_service, + streams=StreamService(self.agent_events, request_exists=lambda request_id: self.agent_requests.get(request_id) is not None), ) def startup(self) -> None: bootstrap_database( self.rag_repository, - self.chat_repository, self.story_context_schema_repository, ) diff --git a/src/app/modules/chat/module.py b/src/app/modules/chat/module.py index 7188c67..e89b71f 100644 --- a/src/app/modules/chat/module.py +++ b/src/app/modules/chat/module.py @@ -1,13 +1,11 @@ from __future__ import annotations -import os from typing import TYPE_CHECKING from fastapi import APIRouter, Header from fastapi.responses import StreamingResponse from app.core.exceptions import AppError -from app.modules.chat.direct_service import CodeExplainChatService from app.modules.chat.dialog_store import DialogSessionStore from app.modules.chat.service import ChatOrchestrator from app.modules.chat.task_store import TaskStore @@ -37,16 +35,13 @@ class ChatModule: retry: RetryExecutor, rag_sessions: RagSessionStore, repository: ChatRepository, - direct_chat: CodeExplainChatService | None = None, task_store: TaskStore | None = None, ) -> None: self._rag_sessions = rag_sessions - self._simple_code_explain_only = os.getenv("SIMPLE_CODE_EXPLAIN_ONLY", "true").lower() in {"1", "true", "yes"} self.tasks = task_store or TaskStore() self.dialogs = DialogSessionStore(repository) self.idempotency = IdempotencyStore() self.events = event_bus - self.direct_chat = direct_chat self.chat = ChatOrchestrator( task_store=self.tasks, dialogs=self.dialogs, @@ -76,8 +71,6 @@ class ChatModule: request: ChatMessageRequest, idempotency_key: str | None = Header(default=None, alias="Idempotency-Key"), ) -> TaskQueuedResponse | TaskResultResponse: - if self._simple_code_explain_only and self.direct_chat is not None: - return await self.direct_chat.handle_message(request) task = await self.chat.enqueue_message(request, idempotency_key) return TaskQueuedResponse(task_id=task.task_id, status=task.status.value) @@ -91,6 +84,7 @@ class ChatModule: status=task.status, result_type=task.result_type, answer=task.answer, + artifacts=task.artifacts, changeset=task.changeset, error=task.error, ) diff --git a/src/app/modules/chat/service.py b/src/app/modules/chat/service.py index abaf539..6dd87bf 100644 --- a/src/app/modules/chat/service.py +++ b/src/app/modules/chat/service.py @@ -134,15 +134,20 @@ class ChatOrchestrator: task.status = TaskStatus.DONE task.result_type = TaskResultType(result.result_type) task.answer = result.answer + task.artifacts = list(getattr(result, "artifacts", []) or []) task.changeset = result.changeset - if task.result_type == TaskResultType.ANSWER and task.answer: - self._message_sink(dialog_session_id, "assistant", task.answer, task_id=task_id) + if task.result_type != TaskResultType.CHANGESET and (task.answer or task.artifacts): + payload = { + "result_type": task.result_type.value, + "artifacts": [item.model_dump(mode="json") for item in task.artifacts], + } + self._message_sink(dialog_session_id, "assistant", task.answer or "", task_id=task_id, payload=payload) LOGGER.warning( "outgoing chat response: task_id=%s dialog_session_id=%s result_type=%s answer=%s", task_id, dialog_session_id, task.result_type.value, - _truncate_for_log(task.answer), + _truncate_for_log(task.answer or ""), ) elif task.result_type == TaskResultType.CHANGESET: self._message_sink( @@ -172,6 +177,7 @@ class ChatOrchestrator: "status": task.status.value, "result_type": task.result_type.value, "answer": task.answer, + "artifacts": [item.model_dump(mode="json") for item in task.artifacts], "changeset": [item.model_dump(mode="json") for item in task.changeset], "meta": getattr(result, "meta", {}) or {}, }, diff --git a/src/app/modules/chat/task_store.py b/src/app/modules/chat/task_store.py index 7a6453c..4b80247 100644 --- a/src/app/modules/chat/task_store.py +++ b/src/app/modules/chat/task_store.py @@ -3,7 +3,7 @@ from threading import Lock from uuid import uuid4 from app.schemas.changeset import ChangeItem -from app.schemas.chat import TaskResultType, TaskStatus +from app.schemas.chat import TaskArtifact, TaskResultType, TaskStatus from app.schemas.common import ErrorPayload @@ -13,6 +13,7 @@ class TaskState: status: TaskStatus = TaskStatus.QUEUED result_type: TaskResultType | None = None answer: str | None = None + artifacts: list[TaskArtifact] = field(default_factory=list) changeset: list[ChangeItem] = field(default_factory=list) error: ErrorPayload | None = None diff --git a/src/app/modules/contracts.py b/src/app/modules/contracts.py index d9898e1..d72886c 100644 --- a/src/app/modules/contracts.py +++ b/src/app/modules/contracts.py @@ -2,12 +2,13 @@ from typing import Protocol from collections.abc import Awaitable, Callable from app.schemas.changeset import ChangeItem -from app.schemas.chat import TaskResultType +from app.schemas.chat import TaskArtifact, TaskResultType class AgentRunResult(Protocol): result_type: TaskResultType answer: str | None + artifacts: list[TaskArtifact] changeset: list[ChangeItem] meta: dict diff --git a/src/app/modules/orchestration/__init__.py b/src/app/modules/orchestration/__init__.py new file mode 100644 index 0000000..1c5f050 --- /dev/null +++ b/src/app/modules/orchestration/__init__.py @@ -0,0 +1,3 @@ +from app.modules.orchestration.facade import OrchestrationFacade + +__all__ = ["OrchestrationFacade"] diff --git a/src/app/modules/orchestration/adapters/intent_router_adapter.py b/src/app/modules/orchestration/adapters/intent_router_adapter.py new file mode 100644 index 0000000..c20ae83 --- /dev/null +++ b/src/app/modules/orchestration/adapters/intent_router_adapter.py @@ -0,0 +1,11 @@ +from __future__ import annotations + +from app.modules.agent.intent_router_v2 import IntentRouterV2 + + +class IntentRouterAdapter: + def __init__(self, router: IntentRouterV2) -> None: + self._router = router + + def route(self, user_query: str, conversation_state, repo_context): + return self._router.route(user_query, conversation_state, repo_context) diff --git a/src/app/modules/orchestration/adapters/llm_chat_adapter.py b/src/app/modules/orchestration/adapters/llm_chat_adapter.py new file mode 100644 index 0000000..f80ddc9 --- /dev/null +++ b/src/app/modules/orchestration/adapters/llm_chat_adapter.py @@ -0,0 +1,19 @@ +from __future__ import annotations + +import asyncio + +from app.modules.agent.llm.service import AgentLlmService + + +class LlmChatAdapter: + def __init__(self, llm: AgentLlmService, prompt_name: str = "agent_api_v1") -> None: + self._llm = llm + self._prompt_name = prompt_name + + async def generate(self, message: str, request_id: str) -> str: + return await asyncio.to_thread( + self._llm.generate, + self._prompt_name, + message, + log_context=f"agent_api:{request_id}", + ) diff --git a/src/app/modules/orchestration/adapters/task_runtime_adapter.py b/src/app/modules/orchestration/adapters/task_runtime_adapter.py new file mode 100644 index 0000000..0437b5d --- /dev/null +++ b/src/app/modules/orchestration/adapters/task_runtime_adapter.py @@ -0,0 +1,44 @@ +from __future__ import annotations + +from types import SimpleNamespace + +from app.core.exceptions import AppError +from app.modules.agent.task_runtime.facade import AgentTaskRuntimeFacade +from app.modules.agent_api.domain.models.agent_session import AgentSession +from app.modules.orchestration.context.execution_context import ExecutionContext +from app.schemas.common import ModuleName + + +class TaskRuntimeAdapter: + def __init__(self, runtime: AgentTaskRuntimeFacade) -> None: + self._runtime = runtime + + async def run(self, context: ExecutionContext) -> SimpleNamespace: + rag_session_id = context.session.active_rag_session_id + if not rag_session_id: + raise AppError( + "rag_session_not_bound", + "Agent session has no active rag_session_id for process v2.", + ModuleName.RAG, + ) + + def progress_cb(stage: str, message: str, kind: str = "task_progress", meta: dict | None = None): + payload = dict(meta or {}) + payload.setdefault("kind", kind) + return context.publisher.publish_status( + context.request.request_id, + stage, + message, + payload, + ) + + return await self._runtime.run( + task_id=context.request.request_id, + dialog_session_id=context.session.session_id, + rag_session_id=rag_session_id, + mode="auto", + message=context.request.message, + attachments=[], + files=[], + progress_cb=progress_cb, + ) diff --git a/src/app/modules/orchestration/context/execution_context.py b/src/app/modules/orchestration/context/execution_context.py new file mode 100644 index 0000000..91ea2e7 --- /dev/null +++ b/src/app/modules/orchestration/context/execution_context.py @@ -0,0 +1,20 @@ +from __future__ import annotations + +from dataclasses import dataclass +from typing import Any + +from app.modules.agent_api.domain.models.agent_request import AgentRequest +from app.modules.agent_api.domain.models.agent_session import AgentSession +from app.modules.agent_api.infrastructure.logging.request_trace_logger import RequestTraceLogger +from app.modules.orchestration.messaging.client_message_publisher import ClientMessagePublisher + + +@dataclass(slots=True) +class ExecutionContext: + request: AgentRequest + session: AgentSession + publisher: ClientMessagePublisher + trace_logger: RequestTraceLogger + task_context: Any = None + route_result: Any = None + workflow_result: Any = None diff --git a/src/app/modules/orchestration/facade.py b/src/app/modules/orchestration/facade.py new file mode 100644 index 0000000..85b807c --- /dev/null +++ b/src/app/modules/orchestration/facade.py @@ -0,0 +1,70 @@ +from __future__ import annotations + +from datetime import datetime, timezone + +from app.core.exceptions import AppError +from app.modules.agent_api.domain.models.agent_request import AgentRequest +from app.modules.agent_api.domain.models.agent_session import AgentSession +from app.modules.agent_api.infrastructure.logging.request_trace_logger import RequestTraceLogger +from app.modules.agent_api.infrastructure.stores.in_memory_request_store import InMemoryRequestStore +from app.modules.orchestration.context.execution_context import ExecutionContext +from app.modules.orchestration.messaging.client_message_publisher import ClientMessagePublisher +from app.modules.orchestration.processes.registry import ProcessRegistry +from app.modules.orchestration.runtime.process_runner import ProcessRunner +from app.schemas.common import ErrorPayload, ModuleName +from app.schemas.orchestration import RequestExecutionStatus + + +class OrchestrationFacade: + def __init__( + self, + request_store: InMemoryRequestStore, + process_registry: ProcessRegistry, + process_runner: ProcessRunner, + publisher: ClientMessagePublisher, + trace_logger: RequestTraceLogger, + ) -> None: + self._request_store = request_store + self._process_registry = process_registry + self._process_runner = process_runner + self._publisher = publisher + self._trace_logger = trace_logger + + async def run(self, request: AgentRequest, session: AgentSession) -> None: + try: + process = self._process_registry.get(request.process_version) + if process is None: + raise AppError("process_not_found", f"Unsupported process version: {request.process_version}", ModuleName.AGENT) + request.status = RequestExecutionStatus.RUNNING + self._request_store.save(request) + self._trace_logger.start_request(request, session) + context = ExecutionContext( + request=request, + session=session, + publisher=self._publisher, + trace_logger=self._trace_logger, + ) + await self._process_runner.run(context, process.steps()) + request.status = RequestExecutionStatus.DONE + request.completed_at = datetime.now(timezone.utc) + self._request_store.save(request) + self._trace_logger.complete_request(request) + except Exception as exc: + request.status = RequestExecutionStatus.ERROR + request.completed_at = datetime.now(timezone.utc) + if isinstance(exc, AppError): + request.error = ErrorPayload(code=exc.code, desc=exc.desc, module=exc.module) + else: + request.error = ErrorPayload( + code="agent_api_runtime_error", + desc="Agent request failed unexpectedly.", + module=ModuleName.AGENT, + ) + self._request_store.save(request) + self._trace_logger.fail_request(request) + await self._publisher.publish_status( + request.request_id, + "orchestrator", + "Во время обработки запроса произошла ошибка.", + {"code": request.error.code}, + ) diff --git a/src/app/modules/orchestration/messaging/client_message_publisher.py b/src/app/modules/orchestration/messaging/client_message_publisher.py new file mode 100644 index 0000000..5c88a57 --- /dev/null +++ b/src/app/modules/orchestration/messaging/client_message_publisher.py @@ -0,0 +1,24 @@ +from __future__ import annotations + +from app.modules.agent_api.infrastructure.logging.request_trace_logger import RequestTraceLogger +from app.modules.agent_api.infrastructure.streaming.sse_event_channel import SseEventChannel +from app.modules.orchestration.messaging.status_message_factory import StatusMessageFactory +from app.modules.orchestration.messaging.user_message_factory import UserMessageFactory + + +class ClientMessagePublisher: + def __init__(self, channel: SseEventChannel, trace_logger: RequestTraceLogger) -> None: + self._channel = channel + self._trace_logger = trace_logger + self._status = StatusMessageFactory() + self._user = UserMessageFactory() + + async def publish_status(self, request_id: str, source: str, text: str, payload: dict | None = None) -> None: + event = self._status.create(request_id, source, text, payload) + self._trace_logger.log_event(event) + await self._channel.publish(event) + + async def publish_user(self, request_id: str, source: str, text: str, payload: dict | None = None) -> None: + event = self._user.create(request_id, source, text, payload) + self._trace_logger.log_event(event) + await self._channel.publish(event) diff --git a/src/app/modules/orchestration/messaging/status_message_factory.py b/src/app/modules/orchestration/messaging/status_message_factory.py new file mode 100644 index 0000000..0d6aa9e --- /dev/null +++ b/src/app/modules/orchestration/messaging/status_message_factory.py @@ -0,0 +1,15 @@ +from __future__ import annotations + +from app.modules.agent_api.domain.events.client_event import ClientEventRecord +from app.schemas.client_events import ClientEventType + + +class StatusMessageFactory: + def create(self, request_id: str, source: str, text: str, payload: dict | None = None) -> ClientEventRecord: + return ClientEventRecord( + request_id=request_id, + type=ClientEventType.STATUS, + source=source, + text=text, + payload=payload or {}, + ) diff --git a/src/app/modules/orchestration/messaging/user_message_factory.py b/src/app/modules/orchestration/messaging/user_message_factory.py new file mode 100644 index 0000000..2ded13e --- /dev/null +++ b/src/app/modules/orchestration/messaging/user_message_factory.py @@ -0,0 +1,15 @@ +from __future__ import annotations + +from app.modules.agent_api.domain.events.client_event import ClientEventRecord +from app.schemas.client_events import ClientEventType + + +class UserMessageFactory: + def create(self, request_id: str, source: str, text: str, payload: dict | None = None) -> ClientEventRecord: + return ClientEventRecord( + request_id=request_id, + type=ClientEventType.USER, + source=source, + text=text, + payload=payload or {}, + ) diff --git a/src/app/modules/orchestration/processes/registry.py b/src/app/modules/orchestration/processes/registry.py new file mode 100644 index 0000000..df55209 --- /dev/null +++ b/src/app/modules/orchestration/processes/registry.py @@ -0,0 +1,14 @@ +from __future__ import annotations + +from app.modules.orchestration.processes.v1.process import V1Process +from app.modules.orchestration.processes.v2.process import V2Process + + +class ProcessRegistry: + def __init__(self, v1_process: V1Process, v2_process: V2Process | None = None) -> None: + self._items = {"v1": v1_process} + if v2_process is not None: + self._items["v2"] = v2_process + + def get(self, version: str): + return self._items.get(version) diff --git a/src/app/modules/orchestration/processes/v1/process.py b/src/app/modules/orchestration/processes/v1/process.py new file mode 100644 index 0000000..b60b575 --- /dev/null +++ b/src/app/modules/orchestration/processes/v1/process.py @@ -0,0 +1,9 @@ +from __future__ import annotations + + +class V1Process: + def __init__(self, steps: list) -> None: + self._steps = steps + + def steps(self) -> list: + return list(self._steps) diff --git a/src/app/modules/orchestration/processes/v1/steps/bootstrap_step.py b/src/app/modules/orchestration/processes/v1/steps/bootstrap_step.py new file mode 100644 index 0000000..5813686 --- /dev/null +++ b/src/app/modules/orchestration/processes/v1/steps/bootstrap_step.py @@ -0,0 +1,20 @@ +from __future__ import annotations + +from app.modules.orchestration.context.execution_context import ExecutionContext + + +class BootstrapStep: + async def run(self, context: ExecutionContext) -> None: + context.trace_logger.log_step(context.request.request_id, "bootstrap", "started") + await context.publisher.publish_status( + context.request.request_id, + "orchestrator", + "Запрос принят и поставлен в обработку.", + ) + await context.publisher.publish_status( + context.request.request_id, + "orchestrator", + "Запускаю процесс обработки v1.", + {"process_version": context.request.process_version}, + ) + context.trace_logger.log_step(context.request.request_id, "bootstrap", "completed") diff --git a/src/app/modules/orchestration/processes/v1/steps/finalize_step.py b/src/app/modules/orchestration/processes/v1/steps/finalize_step.py new file mode 100644 index 0000000..789d973 --- /dev/null +++ b/src/app/modules/orchestration/processes/v1/steps/finalize_step.py @@ -0,0 +1,20 @@ +from __future__ import annotations + +from app.modules.orchestration.context.execution_context import ExecutionContext + + +class FinalizeStep: + async def run(self, context: ExecutionContext) -> None: + request = context.request + context.trace_logger.log_step(request.request_id, "finalize", "started") + await context.publisher.publish_user( + request.request_id, + "agent", + request.answer or "", + ) + await context.publisher.publish_status( + request.request_id, + "orchestrator", + "Обработка запроса завершена.", + ) + context.trace_logger.log_step(request.request_id, "finalize", "completed") diff --git a/src/app/modules/orchestration/processes/v1/steps/run_llm_step.py b/src/app/modules/orchestration/processes/v1/steps/run_llm_step.py new file mode 100644 index 0000000..ef362cb --- /dev/null +++ b/src/app/modules/orchestration/processes/v1/steps/run_llm_step.py @@ -0,0 +1,26 @@ +from __future__ import annotations + +from app.modules.orchestration.adapters.llm_chat_adapter import LlmChatAdapter +from app.modules.orchestration.context.execution_context import ExecutionContext + + +class RunLlmStep: + def __init__(self, llm: LlmChatAdapter) -> None: + self._llm = llm + + async def run(self, context: ExecutionContext) -> None: + request = context.request + context.trace_logger.log_step(request.request_id, "run_llm", "started") + await context.publisher.publish_status( + request.request_id, + "llm_process", + "Отправляю запрос пользователя в LLM.", + ) + answer = await self._llm.generate(request.message, request.request_id) + request.answer = answer + await context.publisher.publish_status( + request.request_id, + "llm_process", + "Ответ от LLM получен.", + ) + context.trace_logger.log_step(request.request_id, "run_llm", "completed", {"answer_length": len(answer)}) diff --git a/src/app/modules/orchestration/processes/v2/README.md b/src/app/modules/orchestration/processes/v2/README.md new file mode 100644 index 0000000..970a895 --- /dev/null +++ b/src/app/modules/orchestration/processes/v2/README.md @@ -0,0 +1,189 @@ +# Process V2 + +`v2` is the current default orchestration process for agent requests. + +It is designed as a small stage-based pipeline: + +1. accept request +2. route intent +3. run intent-specific workflow +4. publish final user response + +The process definition lives in [process.py](/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/src/app/modules/orchestration/processes/v2/process.py). + +## Step Map + +### 1. Bootstrap + +File: +[bootstrap_step.py](/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/src/app/modules/orchestration/processes/v1/steps/bootstrap_step.py) + +Responsibility: +- announce request acceptance +- announce selected process version +- initialize trace logging + +SSE source: +- `orchestrator` + +### 2. Intent Router + +File: +[route_intent_step.py](/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/src/app/modules/orchestration/processes/v2/steps/route_intent_step.py) + +Responsibility: +- build task runtime context +- enrich request context +- call `IntentRouterV2` +- persist `route_result` into orchestration context + +SSE source: +- `intent_router` + +Main status messages: +- request is being routed +- final `intent / sub_intent` + +### 3. Workflow Execution + +Base behavior: +[workflow_step_base.py](/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/src/app/modules/orchestration/processes/v2/steps/workflow_step_base.py) + +Intent-specific steps: +- [execute_documentation_workflow_step.py](/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/src/app/modules/orchestration/processes/v2/steps/execute_documentation_workflow_step.py) +- [execute_openapi_workflow_step.py](/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/src/app/modules/orchestration/processes/v2/steps/execute_openapi_workflow_step.py) +- [execute_general_qa_workflow_step.py](/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/src/app/modules/orchestration/processes/v2/steps/execute_general_qa_workflow_step.py) +- [execute_fallback_workflow_step.py](/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/src/app/modules/orchestration/processes/v2/steps/execute_fallback_workflow_step.py) + +Responsibility: +- choose workflow by `route_result.intent` +- run the selected workflow +- expose workflow diagnostics through SSE +- store workflow result in orchestration context + +Workflow mapping: + +| Intent | Workflow class | Notes | +|---|---|---| +| `DOCUMENTATION_EXPLAIN` | `DocsQaWorkflow` | docs explanation pipeline | +| `OPENAPI_GENERATION` | `OpenApiWorkflow` | OpenAPI generation from docs evidence | +| `GENERAL_QA` | `GeneralQaWorkflow` | general docs-oriented QA | +| any other intent | `FallbackWorkflow` | safety fallback | + +Published SSE stages: +- `task_workflow` +- `rag_retrieval` +- `evidence_gate` +- `workflow_result` + +### 4. Finalize + +File: +[finalize_step.py](/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/src/app/modules/orchestration/processes/v1/steps/finalize_step.py) + +Responsibility: +- publish final `user` event with answer text +- publish terminal status message +- let facade mark request as `done` + +SSE sources: +- `agent` +- `orchestrator` + +## Intent Routing + +Router adapter: +[intent_router_adapter.py](/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/src/app/modules/orchestration/adapters/intent_router_adapter.py) + +Underlying implementation: +[router.py](/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/src/app/modules/agent/intent_router_v2/router.py) + +The router decides: +- `intent` +- `sub_intent` +- retrieval profile +- retrieval layers and constraints +- evidence policy + +For docs-oriented requests the main active intents are: +- `DOCUMENTATION_EXPLAIN` +- `OPENAPI_GENERATION` +- `GENERAL_QA` + +## Retrieval And Evidence Gate + +`v2` does not implement retrieval itself inside orchestration. + +Instead it delegates execution to workflow classes that internally use the existing docs pipeline: + +- [docs_qa.py](/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/src/app/modules/agent/task_runtime/workflows/docs_qa.py) +- [openapi.py](/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/src/app/modules/agent/task_runtime/workflows/openapi.py) +- [general_qa.py](/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/src/app/modules/agent/task_runtime/workflows/general_qa.py) + +These workflows currently rely on: +- `DocsQAPipelineRunner` +- docs retrieval planning +- docs evidence builder +- docs gate logic + +Important: +- docs retrieval and gate logic still live in the existing docs runtime layer +- orchestration `v2` only makes those stages explicit at transport/process level + +## SSE Contract In V2 + +Client-visible message categories: +- `status` +- `user` +- `system` + +Currently used in `v2`: + +- `status` from `orchestrator` +- `status` from `intent_router` +- `status` from `task_workflow` +- `status` from `rag_retrieval` +- `status` from `evidence_gate` +- `status` from `workflow_result` +- `user` from `agent` + +Typical sequence: + +1. request accepted +2. process `v2` started +3. routing started +4. route selected +5. workflow started +6. retrieval diagnostics +7. evidence gate diagnostics +8. workflow result summary +9. final user answer +10. processing completed + +## Trace Logging + +Per-request trace files are written by: +[request_trace_logger.py](/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/src/app/modules/agent_api/infrastructure/logging/request_trace_logger.py) + +Location: +[runtime_traces/agent_requests](/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/runtime_traces/agent_requests) + +Each request trace contains: +- request metadata +- user message +- process steps +- emitted events +- final result or error + +## Extension Points + +Recommended next extensions: + +1. add a dedicated workflow step for `GENERATE_DOCS_FROM_CODE` +2. move docs gate diagnostics into strongly typed orchestration payloads +3. split workflow execution into smaller orchestration stages: + - retrieval + - evidence assembly + - gate + - answer generation +4. add session-level trace aggregation in addition to request-level logs diff --git a/src/app/modules/orchestration/processes/v2/process.py b/src/app/modules/orchestration/processes/v2/process.py new file mode 100644 index 0000000..908ed23 --- /dev/null +++ b/src/app/modules/orchestration/processes/v2/process.py @@ -0,0 +1,9 @@ +from __future__ import annotations + + +class V2Process: + def __init__(self, steps: list) -> None: + self._steps = steps + + def steps(self) -> list: + return list(self._steps) diff --git a/src/app/modules/orchestration/processes/v2/steps/execute_documentation_workflow_step.py b/src/app/modules/orchestration/processes/v2/steps/execute_documentation_workflow_step.py new file mode 100644 index 0000000..4ccab36 --- /dev/null +++ b/src/app/modules/orchestration/processes/v2/steps/execute_documentation_workflow_step.py @@ -0,0 +1,7 @@ +from __future__ import annotations + +from app.modules.orchestration.processes.v2.steps.workflow_step_base import WorkflowStepBase + + +class ExecuteDocumentationWorkflowStep(WorkflowStepBase): + intent_name = "DOCUMENTATION_EXPLAIN" diff --git a/src/app/modules/orchestration/processes/v2/steps/execute_fallback_workflow_step.py b/src/app/modules/orchestration/processes/v2/steps/execute_fallback_workflow_step.py new file mode 100644 index 0000000..14baeaa --- /dev/null +++ b/src/app/modules/orchestration/processes/v2/steps/execute_fallback_workflow_step.py @@ -0,0 +1,18 @@ +from __future__ import annotations + +from app.modules.orchestration.context.execution_context import ExecutionContext +from app.modules.orchestration.processes.v2.steps.workflow_step_base import WorkflowStepBase + + +class ExecuteFallbackWorkflowStep(WorkflowStepBase): + intent_name = "FALLBACK" + + def should_run(self, context: ExecutionContext) -> bool: + route_result = context.route_result + if route_result is None: + return False + return str(route_result.intent or "").upper() not in { + "DOCUMENTATION_EXPLAIN", + "OPENAPI_GENERATION", + "GENERAL_QA", + } diff --git a/src/app/modules/orchestration/processes/v2/steps/execute_general_qa_workflow_step.py b/src/app/modules/orchestration/processes/v2/steps/execute_general_qa_workflow_step.py new file mode 100644 index 0000000..4f42118 --- /dev/null +++ b/src/app/modules/orchestration/processes/v2/steps/execute_general_qa_workflow_step.py @@ -0,0 +1,7 @@ +from __future__ import annotations + +from app.modules.orchestration.processes.v2.steps.workflow_step_base import WorkflowStepBase + + +class ExecuteGeneralQaWorkflowStep(WorkflowStepBase): + intent_name = "GENERAL_QA" diff --git a/src/app/modules/orchestration/processes/v2/steps/execute_openapi_workflow_step.py b/src/app/modules/orchestration/processes/v2/steps/execute_openapi_workflow_step.py new file mode 100644 index 0000000..0b35a01 --- /dev/null +++ b/src/app/modules/orchestration/processes/v2/steps/execute_openapi_workflow_step.py @@ -0,0 +1,7 @@ +from __future__ import annotations + +from app.modules.orchestration.processes.v2.steps.workflow_step_base import WorkflowStepBase + + +class ExecuteOpenApiWorkflowStep(WorkflowStepBase): + intent_name = "OPENAPI_GENERATION" diff --git a/src/app/modules/orchestration/processes/v2/steps/route_intent_step.py b/src/app/modules/orchestration/processes/v2/steps/route_intent_step.py new file mode 100644 index 0000000..cfc282b --- /dev/null +++ b/src/app/modules/orchestration/processes/v2/steps/route_intent_step.py @@ -0,0 +1,80 @@ +from __future__ import annotations + +import asyncio + +from app.core.exceptions import AppError +from app.modules.agent.task_runtime.context import TaskRuntimeContextBuilder +from app.modules.agent.task_runtime.enrichment import ContextEnrichmentService +from app.modules.orchestration.adapters.intent_router_adapter import IntentRouterAdapter +from app.modules.orchestration.context.execution_context import ExecutionContext +from app.modules.orchestration.v2_progress import build_progress_callback +from app.schemas.common import ModuleName + + +class RouteIntentStep: + def __init__( + self, + router: IntentRouterAdapter, + context_builder: TaskRuntimeContextBuilder, + enrichment: ContextEnrichmentService, + ) -> None: + self._router = router + self._context_builder = context_builder + self._enrichment = enrichment + + async def run(self, context: ExecutionContext) -> None: + rag_session_id = context.session.active_rag_session_id + if not rag_session_id: + raise AppError( + "rag_session_not_bound", + "Agent session has no active rag_session_id for process v2.", + ModuleName.RAG, + ) + request = context.request + loop = asyncio.get_running_loop() + task_context = self._context_builder.build( + task_id=request.request_id, + dialog_session_id=context.session.session_id, + rag_session_id=rag_session_id, + mode="auto", + message=request.message, + attachments=[], + files=[], + progress_cb=build_progress_callback(loop, context.publisher, request.request_id), + ) + task_context.enriched_context = self._enrichment.enrich(task_context) + context.task_context = task_context + context.trace_logger.log_step(request.request_id, "intent_router", "started") + await context.publisher.publish_status( + request.request_id, + "intent_router", + "Маршрутизирую запрос и определяю целевой workflow.", + ) + route_result = await asyncio.to_thread( + self._router.route, + request.message, + task_context.conversation_state, + task_context.repo_context, + ) + task_context.route_result = route_result + context.route_result = route_result + await context.publisher.publish_status( + request.request_id, + "intent_router", + f"Маршрут выбран: {route_result.intent} / {route_result.query_plan.sub_intent}.", + { + "intent": route_result.intent, + "sub_intent": route_result.query_plan.sub_intent, + "matched_intent_source": route_result.matched_intent_source, + }, + ) + context.trace_logger.log_step( + request.request_id, + "intent_router", + "completed", + { + "intent": route_result.intent, + "sub_intent": route_result.query_plan.sub_intent, + "matched_intent_source": route_result.matched_intent_source, + }, + ) diff --git a/src/app/modules/orchestration/processes/v2/steps/run_task_workflow_step.py b/src/app/modules/orchestration/processes/v2/steps/run_task_workflow_step.py new file mode 100644 index 0000000..2b47b0e --- /dev/null +++ b/src/app/modules/orchestration/processes/v2/steps/run_task_workflow_step.py @@ -0,0 +1,30 @@ +from __future__ import annotations + +from app.modules.orchestration.adapters.task_runtime_adapter import TaskRuntimeAdapter +from app.modules.orchestration.context.execution_context import ExecutionContext + + +class RunTaskWorkflowStep: + def __init__(self, runtime: TaskRuntimeAdapter) -> None: + self._runtime = runtime + + async def run(self, context: ExecutionContext) -> None: + request = context.request + context.trace_logger.log_step(request.request_id, "task_runtime", "started") + await context.publisher.publish_status( + request.request_id, + "orchestrator", + "Запускаю pipeline v2: intent router, rag retrieval и task workflow.", + {"process_version": request.process_version}, + ) + result = await self._runtime.run(context) + request.answer = result.answer or "" + context.trace_logger.log_step( + request.request_id, + "task_runtime", + "completed", + { + "result_type": getattr(result.result_type, "value", str(result.result_type)), + "meta": getattr(result, "meta", {}) or {}, + }, + ) diff --git a/src/app/modules/orchestration/processes/v2/steps/workflow_step_base.py b/src/app/modules/orchestration/processes/v2/steps/workflow_step_base.py new file mode 100644 index 0000000..ab24088 --- /dev/null +++ b/src/app/modules/orchestration/processes/v2/steps/workflow_step_base.py @@ -0,0 +1,75 @@ +from __future__ import annotations + +import asyncio +from typing import Any + +from app.modules.orchestration.context.execution_context import ExecutionContext + + +class WorkflowStepBase: + intent_name = "" + + def __init__(self, workflow, step_name: str) -> None: + self._workflow = workflow + self._step_name = step_name + + def should_run(self, context: ExecutionContext) -> bool: + route_result = context.route_result + return bool(route_result) and str(route_result.intent or "").upper() == self.intent_name + + async def run(self, context: ExecutionContext) -> None: + request = context.request + task_context = context.task_context + context.trace_logger.log_step(request.request_id, self._step_name, "started") + await context.publisher.publish_status( + request.request_id, + "task_workflow", + f"Запускаю workflow {self._workflow.workflow_id}.", + {"intent": context.route_result.intent, "sub_intent": context.route_result.query_plan.sub_intent}, + ) + result = await asyncio.to_thread(self._workflow.run, task_context) + context.workflow_result = result + request.answer = result.answer or "" + diagnostics = dict(result.meta.get("diagnostics") or {}) + await self._publish_diagnostics(context, diagnostics, result) + context.trace_logger.log_step( + request.request_id, + self._step_name, + "completed", + {"workflow_id": self._workflow.workflow_id, "meta": result.meta}, + ) + + async def _publish_diagnostics(self, context: ExecutionContext, diagnostics: dict[str, Any], result: Any) -> None: + request_id = context.request.request_id + if diagnostics: + await context.publisher.publish_status( + request_id, + "rag_retrieval", + "RAG retrieval завершен.", + { + "planned_layers": list(diagnostics.get("planned_layers") or diagnostics.get("layers_used") or []), + "executed_layers": list(diagnostics.get("executed_layers") or []), + "non_empty_layers": list(diagnostics.get("non_empty_layers") or diagnostics.get("docs_layers_with_hits") or []), + }, + ) + await context.publisher.publish_status( + request_id, + "evidence_gate", + "Evidence gate оценен.", + { + "decision": diagnostics.get("gate_decision"), + "reason": diagnostics.get("gate_decision_reason"), + "missing": list(diagnostics.get("gate_missing_requirements") or []), + "satisfied": list(diagnostics.get("gate_satisfied_requirements") or []), + }, + ) + await context.publisher.publish_status( + request_id, + "workflow_result", + f"Workflow {self._workflow.workflow_id} завершен.", + { + "workflow_id": self._workflow.workflow_id, + "result_type": getattr(result.result_type, "value", str(result.result_type)), + "answer_length": len(result.answer or ""), + }, + ) diff --git a/src/app/modules/orchestration/runtime/process_runner.py b/src/app/modules/orchestration/runtime/process_runner.py new file mode 100644 index 0000000..92cebe4 --- /dev/null +++ b/src/app/modules/orchestration/runtime/process_runner.py @@ -0,0 +1,12 @@ +from __future__ import annotations + +from app.modules.orchestration.context.execution_context import ExecutionContext + + +class ProcessRunner: + async def run(self, context: ExecutionContext, steps: list) -> None: + for step in steps: + should_run = getattr(step, "should_run", None) + if callable(should_run) and not should_run(context): + continue + await step.run(context) diff --git a/src/app/modules/orchestration/v2_progress.py b/src/app/modules/orchestration/v2_progress.py new file mode 100644 index 0000000..2b8393e --- /dev/null +++ b/src/app/modules/orchestration/v2_progress.py @@ -0,0 +1,17 @@ +from __future__ import annotations + +import asyncio + +from app.modules.orchestration.messaging.client_message_publisher import ClientMessagePublisher + + +def build_progress_callback(loop: asyncio.AbstractEventLoop, publisher: ClientMessagePublisher, request_id: str): + def progress_cb(stage: str, message: str, kind: str = "task_progress", meta: dict | None = None) -> None: + payload = dict(meta or {}) + payload.setdefault("kind", kind) + asyncio.run_coroutine_threadsafe( + publisher.publish_status(request_id, stage, message, payload), + loop, + ) + + return progress_cb diff --git a/src/app/modules/rag/README.md b/src/app/modules/rag/README.md index e0b9c35..51644fc 100644 --- a/src/app/modules/rag/README.md +++ b/src/app/modules/rag/README.md @@ -129,28 +129,36 @@ sequenceDiagram ### 5.1. Слои DOCS -#### `D1_MODULE_CATALOG` -Назначение: каталог модулей документации и граф связей между ними. +#### `D0_DOC_CHUNKS` +Назначение: текстовые чанки документации для semantic retrieval и explain. Основные атрибуты: -- `module_id` +- `document_id` - `type` -- `domain` +- `module` +- `section_path` +- `section_title` +- `order` +- `source_path` +- `doc_kind` + +#### `D1_DOCUMENT_CATALOG` +Назначение: каталог документов документации на уровне один файл = один документ. + +Основные атрибуты: +- `document_id` +- `type` +- `name` - `title` +- `module` +- `layer` - `status` -- `version` +- `updated_at` - `tags` -- `owners` +- `entities` +- `parent` +- `children` - `links` -- `calls_api` -- `called_by` -- `uses_logic` -- `used_by` -- `reads_db` -- `writes_db` -- `integrates_with` -- `emits_events` -- `consumes_events` - `source_path` - `summary_text` @@ -165,35 +173,43 @@ sequenceDiagram - `object_ref` - `source_path` - `anchor` -- `line_start` -- `line_end` -- `confidence` - `tags` -#### `D3_SECTION_INDEX` -Назначение: семантические секции документации, нарезанные по заголовкам. +#### `D3_ENTITY_CATALOG` +Назначение: каталог сущностей, упомянутых в документации. Основные атрибуты: -- `chunk_id` -- `module_id` -- `section_path` -- `section_title` -- `content` +- `entity_name` +- `document_id` +- `document_type` +- `module` +- `tags` - `source_path` -- `order` -- `tags` -- `domain` -- `type` -- `embedding` -#### `D4_POLICY_INDEX` -Назначение: глобальные правила и конвенции проекта. +#### `D4_WORKFLOW_INDEX` +Назначение: индекс workflow и сценариев из документации. Основные атрибуты: -- `policy_id` -- `applies_to` -- `rules` -- `default_behaviors` +- `workflow_id` +- `document_id` +- `workflow_name` +- `preconditions` +- `trigger` +- `main_flow` +- `alternative_flow` +- `error_handling` +- `postconditions` +- `source_path` + +#### `D5_RELATION_GRAPH` +Назначение: граф связей между документами документации. + +Основные атрибуты: +- `relation_id` +- `source_id` +- `relation_type` +- `target_id` +- `anchor` - `source_path` ### 5.2. Слои CODE diff --git a/src/app/modules/rag/contracts/enums.py b/src/app/modules/rag/contracts/enums.py index 0db1fc3..8f2333c 100644 --- a/src/app/modules/rag/contracts/enums.py +++ b/src/app/modules/rag/contracts/enums.py @@ -2,10 +2,12 @@ from __future__ import annotations class RagLayer: - DOCS_MODULE_CATALOG = "D1_MODULE_CATALOG" + DOCS_DOC_CHUNKS = "D0_DOC_CHUNKS" + DOCS_DOCUMENT_CATALOG = "D1_DOCUMENT_CATALOG" DOCS_FACT_INDEX = "D2_FACT_INDEX" - DOCS_SECTION_INDEX = "D3_SECTION_INDEX" - DOCS_POLICY_INDEX = "D4_POLICY_INDEX" + DOCS_ENTITY_CATALOG = "D3_ENTITY_CATALOG" + DOCS_WORKFLOW_INDEX = "D4_WORKFLOW_INDEX" + DOCS_RELATION_GRAPH = "D5_RELATION_GRAPH" CODE_SOURCE_CHUNKS = "C0_SOURCE_CHUNKS" CODE_SYMBOL_CATALOG = "C1_SYMBOL_CATALOG" CODE_DEPENDENCY_GRAPH = "C2_DEPENDENCY_GRAPH" diff --git a/src/app/modules/rag/indexing/docs/content_parser.py b/src/app/modules/rag/indexing/docs/content_parser.py new file mode 100644 index 0000000..f5506db --- /dev/null +++ b/src/app/modules/rag/indexing/docs/content_parser.py @@ -0,0 +1,58 @@ +from __future__ import annotations + +from app.modules.rag.indexing.docs.models import ParsedDocument, ParsedSubsection, ParsedTopLevelSection + + +class DocsContentParser: + def parse(self, frontmatter: dict, body: str, *, fallback_title: str) -> ParsedDocument: + top_sections = self._top_level_sections(body) + summary = self._section_text(top_sections, "Summary") + details = self._section_text(top_sections, "Details") + title = str(frontmatter.get("title") or "").strip() or fallback_title + detail_sections = self._subsections(details) + return ParsedDocument( + frontmatter=frontmatter, + title=title, + summary=summary, + details=details, + body=body.strip(), + detail_sections=detail_sections, + ) + + def _top_level_sections(self, body: str) -> list[ParsedTopLevelSection]: + sections: list[ParsedTopLevelSection] = [] + current_title = "" + current_lines: list[str] = [] + for line in body.splitlines(): + if line.startswith("# "): + if current_title: + sections.append(ParsedTopLevelSection(current_title, "\n".join(current_lines).strip())) + current_title = line[2:].strip() + current_lines = [] + continue + current_lines.append(line) + if current_title: + sections.append(ParsedTopLevelSection(current_title, "\n".join(current_lines).strip())) + return sections + + def _section_text(self, sections: list[ParsedTopLevelSection], title: str) -> str: + for section in sections: + if section.title.strip().lower() == title.lower(): + return section.content.strip() + return "" + + def _subsections(self, text: str) -> list[ParsedSubsection]: + sections: list[ParsedSubsection] = [] + current_title = "" + current_lines: list[str] = [] + for line in text.splitlines(): + if line.startswith("## "): + if current_title: + sections.append(ParsedSubsection(current_title, "\n".join(current_lines).strip())) + current_title = line[3:].strip() + current_lines = [] + continue + current_lines.append(line) + if current_title: + sections.append(ParsedSubsection(current_title, "\n".join(current_lines).strip())) + return sections diff --git a/src/app/modules/rag/indexing/docs/document_builder.py b/src/app/modules/rag/indexing/docs/document_builder.py index 4420694..80445bd 100644 --- a/src/app/modules/rag/indexing/docs/document_builder.py +++ b/src/app/modules/rag/indexing/docs/document_builder.py @@ -4,47 +4,44 @@ from hashlib import sha256 from app.modules.rag.contracts import EvidenceLink, EvidenceType, RagDocument, RagLayer, RagSource from app.modules.rag.indexing.docs.chunkers.markdown_chunker import SectionChunk +from app.modules.rag.indexing.docs.models import RelationEdge, WorkflowScenario class DocsDocumentBuilder: - def build_module_catalog(self, source: RagSource, frontmatter: dict, summary_text: str, doc_kind: str) -> RagDocument | None: - module_id = str(frontmatter.get("id") or "").strip() - module_type = str(frontmatter.get("type") or "").strip() - domain = str(frontmatter.get("domain") or "").strip() - if not module_id or not module_type or not domain: - return None - links = frontmatter.get("links") or {} + def build_document_catalog(self, source: RagSource, frontmatter: dict, summary_text: str, doc_kind: str, *, fallback_title: str) -> RagDocument: + document_id = str(frontmatter.get("id") or source.path).strip() metadata = { - "module_id": module_id, - "type": module_type, - "domain": domain, + "document_id": document_id, + "type": str(frontmatter.get("type") or "").strip(), + "name": str(frontmatter.get("name") or "").strip(), + "title": str(frontmatter.get("title") or "").strip() or fallback_title, + "module": str(frontmatter.get("module") or frontmatter.get("domain") or "").strip(), + "layer": str(frontmatter.get("layer") or "").strip(), "status": frontmatter.get("status"), - "version": frontmatter.get("version"), + "updated_at": frontmatter.get("updated_at"), "tags": frontmatter.get("tags") or [], - "owners": frontmatter.get("owners") or [], - "links": links, + "entities": frontmatter.get("entities") or [], + "parent": frontmatter.get("parent"), + "children": frontmatter.get("children") or [], + "links": frontmatter.get("links") or [], "source_path": source.path, "summary_text": summary_text[:4000], "doc_kind": doc_kind, } - metadata.update({name: links.get(name, []) for name in ( - "calls_api", "called_by", "uses_logic", "used_by", "reads_db", "writes_db", - "integrates_with", "emits_events", "consumes_events", - )}) return RagDocument( - layer=RagLayer.DOCS_MODULE_CATALOG, + layer=RagLayer.DOCS_DOCUMENT_CATALOG, source=source, - title=module_id, - text=summary_text[:4000] or module_id, + title=metadata["title"] or document_id, + text=summary_text[:4000] or metadata["title"] or document_id, metadata=metadata, ) - def build_section(self, source: RagSource, chunk: SectionChunk, frontmatter: dict, doc_kind: str) -> RagDocument: - module_id = str(frontmatter.get("id") or source.path) + def build_doc_chunk(self, source: RagSource, chunk: SectionChunk, frontmatter: dict, doc_kind: str) -> RagDocument: + document_id = str(frontmatter.get("id") or source.path) metadata = { - "module_id": module_id, + "document_id": document_id, "type": frontmatter.get("type"), - "domain": frontmatter.get("domain"), + "module": frontmatter.get("module") or frontmatter.get("domain"), "tags": frontmatter.get("tags") or [], "section_path": chunk.section_path, "section_title": chunk.section_title, @@ -54,32 +51,29 @@ class DocsDocumentBuilder: "artifact_type": "DOCS", } return RagDocument( - layer=RagLayer.DOCS_SECTION_INDEX, + layer=RagLayer.DOCS_DOC_CHUNKS, source=source, - title=f"{module_id}:{chunk.section_title}", + title=f"{document_id}:{chunk.section_title}", text=chunk.content, metadata=metadata, + links=[EvidenceLink(type=EvidenceType.DOC_SECTION, target_id=document_id, path=source.path, note=chunk.section_path)], ) - def build_policy(self, source: RagSource, frontmatter: dict, chunk: SectionChunk, doc_kind: str) -> RagDocument | None: - policy_id = str(frontmatter.get("id") or "").strip() - applies_to = frontmatter.get("applies_to") or frontmatter.get("type") - if not policy_id: - return None + def build_entity_record(self, source: RagSource, frontmatter: dict, entity: str) -> RagDocument: + document_id = str(frontmatter.get("id") or source.path) metadata = { - "policy_id": policy_id, - "applies_to": applies_to, - "rules": chunk.content[:4000], - "default_behaviors": frontmatter.get("default_behaviors") or [], - "doc_kind": doc_kind, - "section_path": chunk.section_path, + "entity_name": entity, + "document_id": document_id, + "document_type": frontmatter.get("type"), + "module": frontmatter.get("module") or frontmatter.get("domain"), + "tags": frontmatter.get("tags") or [], "source_path": source.path, } return RagDocument( - layer=RagLayer.DOCS_POLICY_INDEX, + layer=RagLayer.DOCS_ENTITY_CATALOG, source=source, - title=policy_id, - text=chunk.content[:4000], + title=entity, + text=entity, metadata=metadata, ) @@ -113,3 +107,47 @@ class DocsDocumentBuilder: metadata=metadata, links=[EvidenceLink(type=EvidenceType.DOC_FACT, target_id=fact_id, path=source.path, note=anchor)], ) + + def build_workflow_record(self, source: RagSource, frontmatter: dict, workflow: WorkflowScenario) -> RagDocument: + document_id = str(frontmatter.get("id") or source.path) + workflow_id = sha256(f"{document_id}|workflow|{workflow.name}|{workflow.anchor}".encode("utf-8")).hexdigest() + metadata = { + "workflow_id": workflow_id, + "document_id": document_id, + "workflow_name": workflow.name, + "preconditions": workflow.preconditions, + "trigger": workflow.trigger, + "main_flow": workflow.main_flow, + "alternative_flow": workflow.alternative_flow, + "error_handling": workflow.error_handling, + "postconditions": workflow.postconditions, + "source_path": source.path, + } + text = "\n".join( + [workflow.name, *workflow.preconditions, *workflow.trigger, *workflow.main_flow, *workflow.alternative_flow] + ).strip() + return RagDocument( + layer=RagLayer.DOCS_WORKFLOW_INDEX, + source=source, + title=workflow.name, + text=text[:4000], + metadata=metadata, + ) + + def build_relation_record(self, source: RagSource, edge: RelationEdge) -> RagDocument: + relation_id = sha256(f"{edge.source_id}|{edge.relation_type}|{edge.target_id}|{source.path}|{edge.anchor}".encode("utf-8")).hexdigest() + metadata = { + "relation_id": relation_id, + "source_id": edge.source_id, + "relation_type": edge.relation_type, + "target_id": edge.target_id, + "anchor": edge.anchor, + "source_path": source.path, + } + return RagDocument( + layer=RagLayer.DOCS_RELATION_GRAPH, + source=source, + title=f"{edge.source_id}:{edge.relation_type}", + text=f"{edge.source_id} {edge.relation_type} {edge.target_id}", + metadata=metadata, + ) diff --git a/src/app/modules/rag/indexing/docs/entity_extractor.py b/src/app/modules/rag/indexing/docs/entity_extractor.py new file mode 100644 index 0000000..20e6bac --- /dev/null +++ b/src/app/modules/rag/indexing/docs/entity_extractor.py @@ -0,0 +1,14 @@ +from __future__ import annotations + + +class DocsEntityExtractor: + def extract(self, frontmatter: dict) -> list[str]: + values = frontmatter.get("entities") or [] + if not isinstance(values, list): + return [] + result: list[str] = [] + for value in values: + item = str(value or "").strip() + if item and item not in result: + result.append(item) + return result diff --git a/src/app/modules/rag/indexing/docs/fact_extractor.py b/src/app/modules/rag/indexing/docs/fact_extractor.py new file mode 100644 index 0000000..02a888e --- /dev/null +++ b/src/app/modules/rag/indexing/docs/fact_extractor.py @@ -0,0 +1,67 @@ +from __future__ import annotations + +import re + + +class DocsFactExtractor: + def extract(self, frontmatter: dict, sections) -> list[dict]: + subject_id = str(frontmatter.get("id") or "") + facts: list[dict] = [] + for entity in frontmatter.get("entities") or []: + value = str(entity or "").strip() + if value: + facts.append(self._fact(subject_id, "mentions_entity", value, "frontmatter.entities")) + for section in sections: + facts.extend(self._facts_from_table(subject_id, section.section_title, section.content)) + facts.extend(self._facts_from_lists(subject_id, section.section_title, section.content)) + return facts + + def _fact(self, subject_id: str, predicate: str, obj: str, anchor: str, object_ref: str | None = None) -> dict: + return {"subject_id": subject_id, "predicate": predicate, "object": obj, "object_ref": object_ref, "anchor": anchor} + + def _facts_from_table(self, subject_id: str, title: str, content: str) -> list[dict]: + lines = [line.strip() for line in content.splitlines() if line.strip()] + if len(lines) < 3 or "|" not in lines[0]: + return [] + headers = [part.strip().lower() for part in lines[0].strip("|").split("|")] + facts: list[dict] = [] + for row in lines[2:]: + if "|" not in row: + continue + values = [part.strip() for part in row.strip("|").split("|")] + if len(values) != len(headers): + continue + payload = dict(zip(headers, values)) + facts.extend(self._facts_from_row(subject_id, title, payload)) + return facts + + def _facts_from_row(self, subject_id: str, title: str, payload: dict) -> list[dict]: + facts: list[dict] = [] + lowered = title.lower() + name = payload.get("field") or payload.get("name") or payload.get("column") or payload.get("code") + if name and ("входные параметры" in lowered or "выходные параметры" in lowered or "contract" in lowered): + facts.append(self._fact(subject_id, "has_field", name, title)) + if payload.get("type"): + facts.append(self._fact(subject_id, "field_type", f"{name}:{payload['type']}", title)) + if payload.get("обязательность") or payload.get("required"): + required = payload.get("обязательность") or payload.get("required") + facts.append(self._fact(subject_id, "field_required", f"{name}:{required}", title)) + if "ошиб" in lowered or "error" in lowered: + if payload.get("status"): + facts.append(self._fact(subject_id, "returns_status", payload["status"], title)) + if payload.get("error") or payload.get("code"): + facts.append(self._fact(subject_id, "returns_error", payload.get("error") or payload.get("code"), title)) + return facts + + def _facts_from_lists(self, subject_id: str, title: str, content: str) -> list[dict]: + facts: list[dict] = [] + for line in content.splitlines(): + item = line.strip() + if not item.startswith(("-", "*", "1.", "2.", "3.", "4.", "5.")): + continue + normalized = re.sub(r"^[-*0-9. ]+", "", item).strip() + if not normalized: + continue + predicate = "workflow_step" if "сценарий" in title.lower() else "doc_list_item" + facts.append(self._fact(subject_id, predicate, normalized, title)) + return facts diff --git a/src/app/modules/rag/indexing/docs/frontmatter_parser.py b/src/app/modules/rag/indexing/docs/frontmatter_parser.py new file mode 100644 index 0000000..8f58885 --- /dev/null +++ b/src/app/modules/rag/indexing/docs/frontmatter_parser.py @@ -0,0 +1,15 @@ +from __future__ import annotations + +import yaml + + +class DocsFrontmatterParser: + def split(self, content: str) -> tuple[dict, str]: + if not content.startswith("---\n"): + return {}, content + parts = content.split("---", 2) + if len(parts) < 3: + return {}, content + _, raw, body = parts + payload = yaml.safe_load(raw) or {} + return payload if isinstance(payload, dict) else {}, body.strip() diff --git a/src/app/modules/rag/indexing/docs/models.py b/src/app/modules/rag/indexing/docs/models.py new file mode 100644 index 0000000..2e5efd0 --- /dev/null +++ b/src/app/modules/rag/indexing/docs/models.py @@ -0,0 +1,45 @@ +from __future__ import annotations + +from dataclasses import dataclass + + +@dataclass(slots=True) +class ParsedTopLevelSection: + title: str + content: str + + +@dataclass(slots=True) +class ParsedSubsection: + title: str + content: str + + +@dataclass(slots=True) +class ParsedDocument: + frontmatter: dict + title: str + summary: str + details: str + body: str + detail_sections: list[ParsedSubsection] + + +@dataclass(slots=True) +class WorkflowScenario: + name: str + preconditions: list[str] + trigger: list[str] + main_flow: list[str] + alternative_flow: list[str] + error_handling: list[str] + postconditions: list[str] + anchor: str + + +@dataclass(slots=True) +class RelationEdge: + source_id: str + relation_type: str + target_id: str + anchor: str diff --git a/src/app/modules/rag/indexing/docs/pipeline.py b/src/app/modules/rag/indexing/docs/pipeline.py index 073a742..aa5606c 100644 --- a/src/app/modules/rag/indexing/docs/pipeline.py +++ b/src/app/modules/rag/indexing/docs/pipeline.py @@ -1,14 +1,16 @@ from __future__ import annotations -import re - -import yaml - from app.modules.rag.contracts import RagDocument, RagSource from app.modules.rag.indexing.docs.chunkers.markdown_chunker import MarkdownDocChunker from app.modules.rag.indexing.docs.classifier import DocsClassifier +from app.modules.rag.indexing.docs.content_parser import DocsContentParser from app.modules.rag.indexing.docs.document_builder import DocsDocumentBuilder +from app.modules.rag.indexing.docs.entity_extractor import DocsEntityExtractor +from app.modules.rag.indexing.docs.fact_extractor import DocsFactExtractor from app.modules.rag.indexing.docs.file_filter import DocsFileFilter +from app.modules.rag.indexing.docs.frontmatter_parser import DocsFrontmatterParser +from app.modules.rag.indexing.docs.relation_extractor import DocsRelationExtractor +from app.modules.rag.indexing.docs.workflow_extractor import DocsWorkflowExtractor class DocsIndexingPipeline: @@ -17,119 +19,55 @@ class DocsIndexingPipeline: self._classifier = DocsClassifier() self._chunker = MarkdownDocChunker() self._builder = DocsDocumentBuilder() + self._frontmatter = DocsFrontmatterParser() + self._content = DocsContentParser() + self._facts = DocsFactExtractor() + self._entities = DocsEntityExtractor() + self._workflows = DocsWorkflowExtractor() + self._relations = DocsRelationExtractor() def supports(self, path: str) -> bool: return self._filter.should_index(path) def index_file(self, *, repo_id: str, commit_sha: str | None, path: str, content: str) -> list[RagDocument]: source = RagSource(repo_id=repo_id, commit_sha=commit_sha, path=path) - frontmatter, body = self._split_frontmatter(content) + frontmatter, body = self._frontmatter.split(content) doc_kind = self._classifier.classify(path) - sections = self._chunker.chunk(body) - summary_text = self._summary_from_sections(sections) + parsed = self._content.parse(frontmatter, body, fallback_title=self._fallback_title(path)) + sections = self._chunker.chunk(parsed.body or body) docs: list[RagDocument] = [] - module_doc = self._builder.build_module_catalog(source, frontmatter, summary_text, doc_kind) - if module_doc is not None: - docs.append(module_doc) + docs.append( + self._builder.build_document_catalog( + source, + parsed.frontmatter, + parsed.summary, + doc_kind, + fallback_title=parsed.title, + ) + ) for section in sections: - docs.append(self._builder.build_section(source, section, frontmatter, doc_kind)) - if str(frontmatter.get("type") or "").strip() == "policy": - for section in sections[:1]: - policy = self._builder.build_policy(source, frontmatter, section, doc_kind) - if policy is not None: - docs.append(policy) - docs.extend(self._extract_facts(source, frontmatter, sections)) - return docs - - def _split_frontmatter(self, content: str) -> tuple[dict, str]: - if not content.startswith("---\n"): - return {}, content - _, raw, body = content.split("---", 2) - payload = yaml.safe_load(raw) or {} - return payload if isinstance(payload, dict) else {}, body.strip() - - def _summary_from_sections(self, sections) -> str: - text = "\n\n".join(section.content for section in sections[:2]).strip() - return text[:4000] - - def _extract_facts(self, source: RagSource, frontmatter: dict, sections) -> list[RagDocument]: - subject_id = str(frontmatter.get("id") or source.path) - docs: list[RagDocument] = [] - links = frontmatter.get("links") or {} - for predicate, values in links.items(): - for value in values or []: - docs.append( - self._builder.build_fact( - source, - subject_id=subject_id, - predicate=predicate, - obj=str(value), - object_ref=str(value), - anchor="frontmatter.links", - ) + docs.append(self._builder.build_doc_chunk(source, section, parsed.frontmatter, doc_kind)) + document_id = str(parsed.frontmatter.get("id") or source.path) + for fact in self._facts.extract(parsed.frontmatter, sections): + docs.append( + self._builder.build_fact( + source, + subject_id=fact["subject_id"] or document_id, + predicate=fact["predicate"], + obj=fact["object"], + object_ref=fact.get("object_ref"), + anchor=fact["anchor"], ) - for section in sections: - docs.extend(self._facts_from_table(source, subject_id, section.section_title, section.content)) - docs.extend(self._facts_from_lists(source, subject_id, section.section_title, section.content)) + ) + for entity in self._entities.extract(parsed.frontmatter): + docs.append(self._builder.build_entity_record(source, parsed.frontmatter, entity)) + for workflow in self._workflows.extract(parsed.detail_sections): + docs.append(self._builder.build_workflow_record(source, parsed.frontmatter, workflow)) + for edge in self._relations.extract(parsed.frontmatter, source_id=document_id): + docs.append(self._builder.build_relation_record(source, edge)) return docs - def _facts_from_table(self, source: RagSource, subject_id: str, title: str, content: str) -> list[RagDocument]: - lines = [line.strip() for line in content.splitlines() if line.strip()] - if len(lines) < 3 or "|" not in lines[0]: - return [] - headers = [part.strip().lower() for part in lines[0].strip("|").split("|")] - if not all(headers): - return [] - docs: list[RagDocument] = [] - for row in lines[2:]: - if "|" not in row: - continue - values = [part.strip() for part in row.strip("|").split("|")] - if len(values) != len(headers): - continue - payload = dict(zip(headers, values)) - docs.extend(self._facts_from_row(source, subject_id, title, payload)) - return docs - - def _facts_from_row(self, source: RagSource, subject_id: str, title: str, payload: dict) -> list[RagDocument]: - docs: list[RagDocument] = [] - name = payload.get("field") or payload.get("name") or payload.get("column") or payload.get("code") - if "request" in title.lower() or "response" in title.lower(): - if name: - docs.append(self._builder.build_fact(source, subject_id=subject_id, predicate="has_field", obj=name, object_ref=None, anchor=title)) - if payload.get("required"): - docs.append(self._builder.build_fact(source, subject_id=subject_id, predicate="field_required", obj=f"{name}:{payload['required']}", object_ref=None, anchor=title)) - if payload.get("type"): - docs.append(self._builder.build_fact(source, subject_id=subject_id, predicate="field_type", obj=f"{name}:{payload['type']}", object_ref=None, anchor=title)) - if payload.get("validation"): - docs.append(self._builder.build_fact(source, subject_id=subject_id, predicate="field_validation", obj=f"{name}:{payload['validation']}", object_ref=None, anchor=title)) - if "error" in title.lower(): - if payload.get("status"): - docs.append(self._builder.build_fact(source, subject_id=subject_id, predicate="returns_status", obj=payload["status"], object_ref=None, anchor=title)) - if payload.get("error") or payload.get("code"): - error_value = payload.get("error") or payload.get("code") - docs.append(self._builder.build_fact(source, subject_id=subject_id, predicate="returns_error", obj=error_value, object_ref=None, anchor=title)) - if payload.get("client action"): - docs.append(self._builder.build_fact(source, subject_id=subject_id, predicate="client_action", obj=payload["client action"], object_ref=None, anchor=title)) - if "constraint" in title.lower() and name: - docs.append(self._builder.build_fact(source, subject_id=subject_id, predicate="has_constraint", obj=name, object_ref=None, anchor=title)) - return docs - - def _facts_from_lists(self, source: RagSource, subject_id: str, title: str, content: str) -> list[RagDocument]: - docs: list[RagDocument] = [] - for line in content.splitlines(): - item = line.strip() - if not item.startswith(("-", "*", "1.", "2.", "3.")): - continue - normalized = re.sub(r"^[-*0-9. ]+", "", item).strip() - lowered = normalized.lower() - if lowered.startswith("metric:"): - predicate = "emits_metric" - elif lowered.startswith("event:"): - predicate = "emits_analytics_event" - elif lowered.startswith("log:"): - predicate = "logs_event" - else: - predicate = "validates_rule" if "rule" in title.lower() else "client_action" - docs.append(self._builder.build_fact(source, subject_id=subject_id, predicate=predicate, obj=normalized, object_ref=None, anchor=title)) - return docs + def _fallback_title(self, path: str) -> str: + tail = path.rsplit("/", 1)[-1] + stem = tail.rsplit(".", 1)[0] + return stem.replace("-", " ").replace("_", " ").strip().title() diff --git a/src/app/modules/rag/indexing/docs/relation_extractor.py b/src/app/modules/rag/indexing/docs/relation_extractor.py new file mode 100644 index 0000000..9d90853 --- /dev/null +++ b/src/app/modules/rag/indexing/docs/relation_extractor.py @@ -0,0 +1,23 @@ +from __future__ import annotations + +from app.modules.rag.indexing.docs.models import RelationEdge + + +class DocsRelationExtractor: + def extract(self, frontmatter: dict, *, source_id: str) -> list[RelationEdge]: + edges: list[RelationEdge] = [] + parent = str(frontmatter.get("parent") or "").strip() + if parent: + edges.append(RelationEdge(source_id=source_id, relation_type="parent", target_id=parent, anchor="frontmatter.parent")) + for child in frontmatter.get("children") or []: + target = str(child or "").strip() + if target: + edges.append(RelationEdge(source_id=source_id, relation_type="child", target_id=target, anchor="frontmatter.children")) + for item in frontmatter.get("links") or []: + if not isinstance(item, dict): + continue + relation_type = str(item.get("type") or "").strip() + target = str(item.get("target") or "").strip() + if relation_type and target: + edges.append(RelationEdge(source_id=source_id, relation_type=relation_type, target_id=target, anchor="frontmatter.links")) + return edges diff --git a/src/app/modules/rag/indexing/docs/workflow_extractor.py b/src/app/modules/rag/indexing/docs/workflow_extractor.py new file mode 100644 index 0000000..6076337 --- /dev/null +++ b/src/app/modules/rag/indexing/docs/workflow_extractor.py @@ -0,0 +1,58 @@ +from __future__ import annotations + +from app.modules.rag.indexing.docs.models import ParsedSubsection, WorkflowScenario + + +class DocsWorkflowExtractor: + _LABELS = { + "название": "name", + "предусловия": "preconditions", + "триггер": "trigger", + "основной сценарий": "main_flow", + "альтернативный сценарий": "alternative_flow", + "обработка ошибок": "error_handling", + "постусловие": "postconditions", + } + + def extract(self, sections: list[ParsedSubsection]) -> list[WorkflowScenario]: + scenario_section = next((section for section in sections if section.title.lower() == "сценарий"), None) + if scenario_section is None or not scenario_section.content.strip(): + return [] + fields = self._fields(scenario_section.content) + name = fields.get("name", ["Scenario"])[0] + return [ + WorkflowScenario( + name=name, + preconditions=fields.get("preconditions", []), + trigger=fields.get("trigger", []), + main_flow=fields.get("main_flow", []), + alternative_flow=fields.get("alternative_flow", []), + error_handling=fields.get("error_handling", []), + postconditions=fields.get("postconditions", []), + anchor="Details/Сценарий", + ) + ] + + def _fields(self, text: str) -> dict[str, list[str]]: + fields: dict[str, list[str]] = {} + current_key: str | None = None + for raw_line in text.splitlines(): + line = raw_line.strip() + if not line: + continue + if line.startswith("**") and line.endswith("**"): + label = line.strip("*").rstrip(":").strip().lower() + current_key = self._LABELS.get(label) + if current_key is not None: + fields.setdefault(current_key, []) + continue + if current_key is None: + continue + normalized = line + if normalized.startswith("- "): + normalized = normalized[2:].strip() + elif normalized[:2].isdigit() and normalized[1:3] == ". ": + normalized = normalized[3:].strip() + if normalized: + fields[current_key].append(normalized) + return fields diff --git a/src/app/modules/rag/persistence/cache_repository.py b/src/app/modules/rag/persistence/cache_repository.py index bbfae35..5987c08 100644 --- a/src/app/modules/rag/persistence/cache_repository.py +++ b/src/app/modules/rag/persistence/cache_repository.py @@ -1,6 +1,7 @@ from __future__ import annotations import json +from datetime import date, datetime from sqlalchemy import text @@ -11,139 +12,22 @@ from app.modules.rag.contracts.enums import RagLayer class RagCacheRepository: def get_cached_documents(self, repo_id: str, blob_sha: str) -> list[RagDocument]: with self._engine().connect() as conn: - rows = conn.execute( - text( - """ - SELECT layer, lang, path, title, content, metadata_json, links_json, span_start, span_end, - repo_id, commit_sha, embedding::text AS embedding_txt - FROM rag_chunk_cache - WHERE repo_id = :repo_id AND blob_sha = :blob_sha - ORDER BY chunk_index ASC - """ - ), - {"repo_id": repo_id, "blob_sha": blob_sha}, - ).mappings().fetchall() - docs: list[RagDocument] = [] - for row in rows: - metadata = self._loads(row.get("metadata_json")) - docs.append( - RagDocument( - layer=str(row["layer"]), - lang=row.get("lang"), - source=RagSource( - repo_id=str(row["repo_id"]), - commit_sha=row.get("commit_sha"), - path=str(row["path"]), - ), - title=str(row["title"] or row["path"]), - text=str(row["content"] or ""), - metadata=metadata, - links=[EvidenceLink(**item) for item in self._loads(row.get("links_json"), default=[])], - span=RagSpan(row.get("span_start"), row.get("span_end")), - embedding=self._parse_vector(str(row["embedding_txt"] or "")), - ) - ) - return docs + rows = conn.execute(text(self._select_sql()), {"repo_id": repo_id, "blob_sha": blob_sha}).mappings().fetchall() + return [self._row_to_document(row) for row in rows] def cache_documents(self, repo_id: str, path: str, blob_sha: str, docs: list[RagDocument]) -> None: if not docs: return with self._engine().connect() as conn: - first = docs[0].to_record() - first_meta = first["metadata"] conn.execute( - text( - """ - INSERT INTO rag_blob_cache ( - repo_id, blob_sha, path, artifact_type, section, doc_id, doc_version, owner, - system_component, last_modified, staleness_score, layer, lang, metadata_json - ) - VALUES ( - :repo_id, :blob_sha, :path, :artifact_type, :section, :doc_id, :doc_version, :owner, - :system_component, :last_modified, :staleness_score, :layer, :lang, :metadata_json - ) - ON CONFLICT (repo_id, blob_sha, path) DO UPDATE SET - artifact_type = EXCLUDED.artifact_type, - section = EXCLUDED.section, - doc_id = EXCLUDED.doc_id, - doc_version = EXCLUDED.doc_version, - owner = EXCLUDED.owner, - system_component = EXCLUDED.system_component, - last_modified = EXCLUDED.last_modified, - staleness_score = EXCLUDED.staleness_score, - layer = EXCLUDED.layer, - lang = EXCLUDED.lang, - metadata_json = EXCLUDED.metadata_json, - updated_at = CURRENT_TIMESTAMP - """ - ), - { - "repo_id": repo_id, - "blob_sha": blob_sha, - "path": path, - "artifact_type": first_meta.get("artifact_type"), - "section": first_meta.get("section") or first_meta.get("section_title"), - "doc_id": first_meta.get("doc_id"), - "doc_version": first_meta.get("doc_version"), - "owner": first_meta.get("owner"), - "system_component": first_meta.get("system_component"), - "last_modified": first_meta.get("last_modified"), - "staleness_score": first_meta.get("staleness_score"), - "layer": first["layer"], - "lang": first["lang"], - "metadata_json": json.dumps(first_meta, ensure_ascii=True), - }, - ) - conn.execute( - text("DELETE FROM rag_chunk_cache WHERE repo_id = :repo_id AND blob_sha = :blob_sha"), + text("DELETE FROM rag_document_cache WHERE repo_id = :repo_id AND blob_sha = :blob_sha"), {"repo_id": repo_id, "blob_sha": blob_sha}, ) for idx, doc in enumerate(docs): - row = doc.to_record() - metadata = row["metadata"] - emb = row["embedding"] or [] - emb_str = "[" + ",".join(str(x) for x in emb) + "]" if emb else None - conn.execute( - text( - """ - INSERT INTO rag_chunk_cache ( - repo_id, blob_sha, chunk_index, content, embedding, section, layer, lang, path, title, - metadata_json, links_json, span_start, span_end, commit_sha - ) - VALUES ( - :repo_id, :blob_sha, :chunk_index, :content, CAST(:embedding AS vector), :section, :layer, - :lang, :path, :title, :metadata_json, :links_json, :span_start, :span_end, :commit_sha - ) - """ - ), - { - "repo_id": repo_id, - "blob_sha": blob_sha, - "chunk_index": idx, - "content": row["text"], - "embedding": emb_str, - "section": metadata.get("section") or metadata.get("section_title"), - "layer": row["layer"], - "lang": row["lang"], - "path": row["path"], - "title": row["title"], - "metadata_json": json.dumps(metadata, ensure_ascii=True), - "links_json": json.dumps(row["links"], ensure_ascii=True), - "span_start": row["span_start"], - "span_end": row["span_end"], - "commit_sha": row["commit_sha"], - }, - ) + conn.execute(text(self._insert_sql()), self._insert_params(repo_id, path, blob_sha, idx, doc)) conn.commit() - def record_repo_cache( - self, - *, - project_id: str, - commit_sha: str | None, - changed_files: list[str], - summary: str, - ) -> None: + def record_repo_cache(self, *, project_id: str, commit_sha: str | None, changed_files: list[str], summary: str) -> None: docs: list[RagDocument] = [] for idx, path in enumerate(changed_files): docs.append( @@ -161,6 +45,62 @@ class RagCacheRepository: doc.metadata["blob_sha"] = blob_sha self.cache_documents(project_id, doc.source.path, blob_sha, [doc]) + def _select_sql(self) -> str: + return """ + SELECT layer, lang, path, title, content, metadata_json, links_json, span_start, span_end, + repo_id, commit_sha, embedding::text AS embedding_txt + FROM rag_document_cache + WHERE repo_id = :repo_id AND blob_sha = :blob_sha + ORDER BY chunk_index ASC + """ + + def _insert_sql(self) -> str: + return """ + INSERT INTO rag_document_cache ( + repo_id, blob_sha, chunk_index, path, layer, lang, title, content, embedding, + metadata_json, links_json, span_start, span_end, commit_sha + ) + VALUES ( + :repo_id, :blob_sha, :chunk_index, :path, :layer, :lang, :title, :content, CAST(:embedding AS vector), + CAST(:metadata_json AS jsonb), CAST(:links_json AS jsonb), :span_start, :span_end, :commit_sha + ) + """ + + def _insert_params(self, repo_id: str, path: str, blob_sha: str, chunk_index: int, doc: RagDocument) -> dict: + row = doc.to_record() + metadata = self._json_ready(row["metadata"]) + emb = row["embedding"] or [] + return { + "repo_id": repo_id, + "blob_sha": blob_sha, + "chunk_index": chunk_index, + "path": path, + "layer": row["layer"], + "lang": row["lang"], + "title": row["title"], + "content": row["text"], + "embedding": "[" + ",".join(str(x) for x in emb) + "]" if emb else None, + "metadata_json": json.dumps(metadata, ensure_ascii=True), + "links_json": json.dumps(row["links"], ensure_ascii=True), + "span_start": row["span_start"], + "span_end": row["span_end"], + "commit_sha": row["commit_sha"], + } + + def _row_to_document(self, row) -> RagDocument: + metadata = self._loads(row.get("metadata_json"), default={}) + return RagDocument( + layer=str(row["layer"]), + lang=row.get("lang"), + source=RagSource(repo_id=str(row["repo_id"]), commit_sha=row.get("commit_sha"), path=str(row["path"])), + title=str(row["title"] or row["path"]), + text=str(row["content"] or ""), + metadata=metadata, + links=[EvidenceLink(**item) for item in self._loads(row.get("links_json"), default=[])], + span=RagSpan(row.get("span_start"), row.get("span_end")), + embedding=self._parse_vector(str(row["embedding_txt"] or "")), + ) + def _blob_sha(self, commit_sha: str | None, path: str) -> str: from hashlib import sha256 @@ -171,12 +111,24 @@ class RagCacheRepository: return get_engine() - def _loads(self, value, default=None): - if default is None: - default = {} - if not value: + def _json_ready(self, value): + if isinstance(value, dict): + return {str(key): self._json_ready(item) for key, item in value.items()} + if isinstance(value, list): + return [self._json_ready(item) for item in value] + if isinstance(value, tuple): + return [self._json_ready(item) for item in value] + if isinstance(value, (date, datetime)): + return value.isoformat() + return value + + def _loads(self, value, *, default): + if value is None: return default - return json.loads(str(value)) + if isinstance(value, (dict, list)): + return value + text_value = str(value).strip() + return default if not text_value else json.loads(text_value) def _parse_vector(self, value: str) -> list[float]: text_value = value.strip() @@ -184,6 +136,4 @@ class RagCacheRepository: return [] if text_value.startswith("[") and text_value.endswith("]"): text_value = text_value[1:-1] - if not text_value: - return [] return [float(part.strip()) for part in text_value.split(",") if part.strip()] diff --git a/src/app/modules/rag/persistence/document_repository.py b/src/app/modules/rag/persistence/document_repository.py index 9cd5631..ee79307 100644 --- a/src/app/modules/rag/persistence/document_repository.py +++ b/src/app/modules/rag/persistence/document_repository.py @@ -1,6 +1,7 @@ from __future__ import annotations import json +from datetime import date, datetime from sqlalchemy import text @@ -10,7 +11,6 @@ from app.modules.rag.contracts import RagDocument class RagDocumentRepository: def replace_documents(self, conn, rag_session_id: str, docs: list[RagDocument]) -> None: conn.execute(text("DELETE FROM rag_chunks WHERE rag_session_id = :sid"), {"sid": rag_session_id}) - conn.execute(text("DELETE FROM rag_session_chunk_map WHERE rag_session_id = :sid"), {"sid": rag_session_id}) self.insert_documents(conn, rag_session_id, docs) def apply_document_changes( @@ -20,100 +20,64 @@ class RagDocumentRepository: delete_paths: list[str], docs: list[RagDocument], ) -> None: - if delete_paths: - conn.execute( - text("DELETE FROM rag_chunks WHERE rag_session_id = :sid AND path = ANY(:paths)"), - {"sid": rag_session_id, "paths": delete_paths}, - ) - conn.execute( - text("DELETE FROM rag_session_chunk_map WHERE rag_session_id = :sid AND path = ANY(:paths)"), - {"sid": rag_session_id, "paths": delete_paths}, - ) + self._delete_paths(conn, rag_session_id, delete_paths) if not docs: return - paths = sorted({doc.source.path for doc in docs}) - conn.execute( - text("DELETE FROM rag_chunks WHERE rag_session_id = :sid AND path = ANY(:paths)"), - {"sid": rag_session_id, "paths": paths}, - ) - conn.execute( - text("DELETE FROM rag_session_chunk_map WHERE rag_session_id = :sid AND path = ANY(:paths)"), - {"sid": rag_session_id, "paths": paths}, - ) + self._delete_paths(conn, rag_session_id, sorted({doc.source.path for doc in docs})) self.insert_documents(conn, rag_session_id, docs) def insert_documents(self, conn, rag_session_id: str, docs: list[RagDocument]) -> None: for doc in docs: - row = doc.to_record() - metadata = row["metadata"] - emb = row["embedding"] or [] - emb_str = "[" + ",".join(str(x) for x in emb) + "]" if emb else None - conn.execute( - text( - """ - INSERT INTO rag_chunks ( - rag_session_id, path, chunk_index, content, embedding, artifact_type, section, doc_id, - doc_version, owner, system_component, last_modified, staleness_score, created_at, updated_at, - layer, lang, repo_id, commit_sha, title, metadata_json, span_start, span_end, symbol_id, - qname, kind, framework, entrypoint_type, module_id, section_path, doc_kind - ) - VALUES ( - :sid, :path, :chunk_index, :content, CAST(:emb AS vector), :artifact_type, :section, :doc_id, - :doc_version, :owner, :system_component, :last_modified, :staleness_score, CURRENT_TIMESTAMP, - CURRENT_TIMESTAMP, :layer, :lang, :repo_id, :commit_sha, :title, :metadata_json, - :span_start, :span_end, :symbol_id, :qname, :kind, :framework, :entrypoint_type, :module_id, - :section_path, :doc_kind - ) - """ - ), - { - "sid": rag_session_id, - "path": row["path"], - "chunk_index": int(metadata.get("chunk_index", 0)), - "content": row["text"], - "emb": emb_str, - "artifact_type": metadata.get("artifact_type"), - "section": metadata.get("section") or metadata.get("section_title"), - "doc_id": metadata.get("doc_id"), - "doc_version": metadata.get("doc_version"), - "owner": metadata.get("owner"), - "system_component": metadata.get("system_component"), - "last_modified": metadata.get("last_modified"), - "staleness_score": metadata.get("staleness_score"), - "layer": row["layer"], - "lang": row["lang"], - "repo_id": row["repo_id"], - "commit_sha": row["commit_sha"], - "title": row["title"], - "metadata_json": json.dumps(metadata, ensure_ascii=True), - "span_start": row["span_start"], - "span_end": row["span_end"], - "symbol_id": metadata.get("symbol_id"), - "qname": metadata.get("qname"), - "kind": metadata.get("kind") or metadata.get("type"), - "framework": metadata.get("framework"), - "entrypoint_type": metadata.get("entry_type") or metadata.get("entrypoint_type"), - "module_id": metadata.get("module_id") or metadata.get("policy_id"), - "section_path": metadata.get("section_path"), - "doc_kind": metadata.get("doc_kind"), - }, + conn.execute(text(self._insert_sql()), self._insert_params(rag_session_id, doc)) + + def _delete_paths(self, conn, rag_session_id: str, paths: list[str]) -> None: + if not paths: + return + conn.execute( + text("DELETE FROM rag_chunks WHERE rag_session_id = :sid AND path = ANY(:paths)"), + {"sid": rag_session_id, "paths": paths}, + ) + + def _insert_sql(self) -> str: + return """ + INSERT INTO rag_chunks ( + rag_session_id, path, chunk_index, content, embedding, layer, lang, repo_id, + commit_sha, title, metadata_json, span_start, span_end, created_at, updated_at ) - repo_id = str(row["repo_id"] or "").strip() - blob_sha = str(metadata.get("blob_sha") or "").strip() - if repo_id and blob_sha: - conn.execute( - text( - """ - INSERT INTO rag_session_chunk_map ( - rag_session_id, repo_id, blob_sha, chunk_index, path - ) VALUES (:sid, :repo_id, :blob_sha, :chunk_index, :path) - """ - ), - { - "sid": rag_session_id, - "repo_id": repo_id, - "blob_sha": blob_sha, - "chunk_index": int(metadata.get("chunk_index", 0)), - "path": row["path"], - }, - ) + VALUES ( + :sid, :path, :chunk_index, :content, CAST(:emb AS vector), :layer, :lang, :repo_id, + :commit_sha, :title, CAST(:metadata_json AS jsonb), :span_start, :span_end, + CURRENT_TIMESTAMP, CURRENT_TIMESTAMP + ) + """ + + def _insert_params(self, rag_session_id: str, doc: RagDocument) -> dict: + row = doc.to_record() + metadata = self._json_ready(row["metadata"]) + emb = row["embedding"] or [] + return { + "sid": rag_session_id, + "path": row["path"], + "chunk_index": int(metadata.get("chunk_index", 0)), + "content": row["text"], + "emb": "[" + ",".join(str(x) for x in emb) + "]" if emb else None, + "layer": row["layer"], + "lang": row["lang"], + "repo_id": row["repo_id"], + "commit_sha": row["commit_sha"], + "title": row["title"], + "metadata_json": json.dumps(metadata, ensure_ascii=True), + "span_start": row["span_start"], + "span_end": row["span_end"], + } + + def _json_ready(self, value): + if isinstance(value, dict): + return {str(key): self._json_ready(item) for key, item in value.items()} + if isinstance(value, list): + return [self._json_ready(item) for item in value] + if isinstance(value, tuple): + return [self._json_ready(item) for item in value] + if isinstance(value, (date, datetime)): + return value.isoformat() + return value diff --git a/src/app/modules/rag/persistence/query_repository.py b/src/app/modules/rag/persistence/query_repository.py index 8d189a7..8a020b2 100644 --- a/src/app/modules/rag/persistence/query_repository.py +++ b/src/app/modules/rag/persistence/query_repository.py @@ -137,5 +137,9 @@ class RagQueryRepository: def _row_to_dict(self, row) -> dict: data = dict(row) - data["metadata"] = json.loads(str(data.pop("metadata_json") or "{}")) + raw_metadata = data.pop("metadata_json") + if isinstance(raw_metadata, dict): + data["metadata"] = raw_metadata + return data + data["metadata"] = json.loads(str(raw_metadata or "{}")) return data diff --git a/src/app/modules/rag/persistence/retrieval_statement_builder.py b/src/app/modules/rag/persistence/retrieval_statement_builder.py index 94feeb1..714c582 100644 --- a/src/app/modules/rag/persistence/retrieval_statement_builder.py +++ b/src/app/modules/rag/persistence/retrieval_statement_builder.py @@ -54,10 +54,12 @@ class RetrievalStatementBuilder: "WHEN layer = 'C4_SEMANTIC_ROLES' THEN 2 " "WHEN layer = 'C2_DEPENDENCY_GRAPH' THEN 3 " "WHEN layer = 'C0_SOURCE_CHUNKS' THEN 4 " - "WHEN layer = 'D1_MODULE_CATALOG' THEN 0 " - "WHEN layer = 'D2_FACT_INDEX' THEN 1 " - "WHEN layer = 'D3_SECTION_INDEX' THEN 2 " - "WHEN layer = 'D4_POLICY_INDEX' THEN 3 " + "WHEN layer = 'D1_DOCUMENT_CATALOG' THEN 0 " + "WHEN layer = 'D4_WORKFLOW_INDEX' THEN 1 " + "WHEN layer = 'D2_FACT_INDEX' THEN 2 " + "WHEN layer = 'D5_RELATION_GRAPH' THEN 3 " + "WHEN layer = 'D3_ENTITY_CATALOG' THEN 4 " + "WHEN layer = 'D0_DOC_CHUNKS' THEN 5 " "ELSE 10 END" ) sql = f""" @@ -93,6 +95,7 @@ class RetrievalStatementBuilder: return None, {} filters = ["rag_session_id = :sid", "layer = 'C0_SOURCE_CHUNKS'"] params: dict = {"sid": rag_session_id, "lim": limit} + qname_expr = self._metadata_text("qname") self._append_prefix_group(filters, params, "path", path_prefixes) self._append_prefix_group(filters, params, "exclude_prefix", exclude_path_prefixes, negate=True) self._append_like_group(filters, params, "exclude_like", exclude_like_patterns, negate=True) @@ -106,7 +109,7 @@ class RetrievalStatementBuilder: params[prefix_key] = f"{term}%" params[contains_key] = f"%{term}%" lexical_filters.append( - f"(lower(COALESCE(qname, '')) = :{exact_key} " + f"(lower(COALESCE({qname_expr}, '')) = :{exact_key} " f"OR lower(COALESCE(title, '')) = :{exact_key} " f"OR lower(COALESCE(path, '')) LIKE :{contains_key} " f"OR lower(COALESCE(title, '')) LIKE :{prefix_key} " @@ -114,7 +117,7 @@ class RetrievalStatementBuilder: ) lexical_ranks.append( "CASE " - f"WHEN lower(COALESCE(qname, '')) = :{exact_key} THEN 0 " + f"WHEN lower(COALESCE({qname_expr}, '')) = :{exact_key} THEN 0 " f"WHEN lower(COALESCE(title, '')) = :{exact_key} THEN 1 " f"WHEN lower(COALESCE(title, '')) LIKE :{prefix_key} THEN 2 " f"WHEN lower(COALESCE(path, '')) LIKE :{contains_key} THEN 3 " @@ -150,6 +153,8 @@ class RetrievalStatementBuilder: def _lexical_rank_sql(self, query_text: str, params: dict) -> str: term_filters: list[str] = [] + qname_expr = self._metadata_text("qname") + symbol_id_expr = self._metadata_text("symbol_id") for idx, term in enumerate(extract_query_terms(query_text)): exact_key = f"term_exact_{idx}" prefix_key = f"term_prefix_{idx}" @@ -159,10 +164,10 @@ class RetrievalStatementBuilder: params[contains_key] = f"%{term}%" term_filters.append( "CASE " - f"WHEN lower(COALESCE(qname, '')) = :{exact_key} THEN 0 " - f"WHEN lower(COALESCE(symbol_id, '')) = :{exact_key} THEN 1 " + f"WHEN lower(COALESCE({qname_expr}, '')) = :{exact_key} THEN 0 " + f"WHEN lower(COALESCE({symbol_id_expr}, '')) = :{exact_key} THEN 1 " f"WHEN lower(COALESCE(title, '')) = :{exact_key} THEN 2 " - f"WHEN lower(COALESCE(qname, '')) LIKE :{prefix_key} THEN 3 " + f"WHEN lower(COALESCE({qname_expr}, '')) LIKE :{prefix_key} THEN 3 " f"WHEN lower(COALESCE(title, '')) LIKE :{prefix_key} THEN 4 " f"WHEN lower(COALESCE(path, '')) LIKE :{contains_key} THEN 5 " f"WHEN lower(COALESCE(content, '')) LIKE :{contains_key} THEN 6 " @@ -242,20 +247,20 @@ class RetrievalStatementBuilder: return "CASE WHEN " + " OR ".join(parts) + " THEN 0 ELSE 1 END" def _structural_rank_sql(self) -> str: - path_length = "CAST(metadata_json AS jsonb)->>'path_length'" + path_length = self._metadata_text("path_length") numeric_path_length = f"CASE WHEN {path_length} ~ '^[0-9]+$' THEN ({path_length})::int ELSE 99 END" - role_value = "CAST(metadata_json AS jsonb)->>'role'" + role_value = self._metadata_text("role") confidence = ( - "CASE WHEN CAST(metadata_json AS jsonb)->>'confidence' ~ '^[0-9]+(\\.[0-9]+)?$' " - "THEN (CAST(metadata_json AS jsonb)->>'confidence')::numeric ELSE 0 END" + f"CASE WHEN {self._metadata_text('confidence')} ~ '^[0-9]+(\\.[0-9]+)?$' " + f"THEN ({self._metadata_text('confidence')})::numeric ELSE 0 END" ) dataflow_participation = ( - "CASE WHEN CAST(metadata_json AS jsonb)->>'dataflow_participation' ~ '^[0-9]+$' " - "THEN (CAST(metadata_json AS jsonb)->>'dataflow_participation')::int ELSE 0 END" + f"CASE WHEN {self._metadata_text('dataflow_participation')} ~ '^[0-9]+$' " + f"THEN ({self._metadata_text('dataflow_participation')})::int ELSE 0 END" ) trace_proximity = ( - "CASE WHEN CAST(metadata_json AS jsonb)->>'execution_trace_proximity' ~ '^[0-9]+$' " - "THEN (CAST(metadata_json AS jsonb)->>'execution_trace_proximity')::int ELSE 0 END" + f"CASE WHEN {self._metadata_text('execution_trace_proximity')} ~ '^[0-9]+$' " + f"THEN ({self._metadata_text('execution_trace_proximity')})::int ELSE 0 END" ) role_rank = ( "CASE " @@ -274,9 +279,9 @@ class RetrievalStatementBuilder: semantic_signal = f"LEAST(({dataflow_participation} + {trace_proximity}), 20)" return ( "CASE " - "WHEN layer = 'C2_DEPENDENCY_GRAPH' AND CAST(metadata_json AS jsonb)->>'edge_type' = 'dataflow_slice' " + f"WHEN layer = 'C2_DEPENDENCY_GRAPH' AND {self._metadata_text('edge_type')} = 'dataflow_slice' " f"THEN {numeric_path_length} " - "WHEN layer = 'C3_ENTRYPOINTS' AND CAST(metadata_json AS jsonb)->>'edge_type' = 'execution_trace' " + f"WHEN layer = 'C3_ENTRYPOINTS' AND {self._metadata_text('edge_type')} = 'execution_trace' " f"THEN {numeric_path_length} " "WHEN layer = 'C4_SEMANTIC_ROLES' " f"THEN ((30 - {semantic_signal}) + {role_rank} + (100 - ({confidence} * 100)::int)) " @@ -285,3 +290,6 @@ class RetrievalStatementBuilder: def _escape_like_value(self, value: str) -> str: return value.replace("\\", "\\\\").replace("%", "\\%").replace("_", "\\_") + + def _metadata_text(self, key: str) -> str: + return f"metadata_json->>'{key}'" diff --git a/src/app/modules/rag/persistence/schema_migrator.py b/src/app/modules/rag/persistence/schema_migrator.py new file mode 100644 index 0000000..f552760 --- /dev/null +++ b/src/app/modules/rag/persistence/schema_migrator.py @@ -0,0 +1,137 @@ +from __future__ import annotations + +from sqlalchemy import text + +from app.modules.rag.persistence.schema_statements import legacy_chunk_columns + + +class RagSchemaMigrator: + def migrate(self, conn) -> None: + self._ensure_core_columns(conn) + self._convert_metadata_to_jsonb(conn) + self._migrate_legacy_chunk_metadata(conn) + self._migrate_legacy_cache(conn) + self._drop_legacy_chunk_columns(conn) + + def _ensure_core_columns(self, conn) -> None: + for statement in ( + "ALTER TABLE rag_chunks ADD COLUMN IF NOT EXISTS layer VARCHAR(64) NULL", + "ALTER TABLE rag_chunks ADD COLUMN IF NOT EXISTS lang VARCHAR(32) NULL", + "ALTER TABLE rag_chunks ADD COLUMN IF NOT EXISTS repo_id VARCHAR(512) NULL", + "ALTER TABLE rag_chunks ADD COLUMN IF NOT EXISTS commit_sha VARCHAR(128) NULL", + "ALTER TABLE rag_chunks ADD COLUMN IF NOT EXISTS title TEXT NULL", + "ALTER TABLE rag_chunks ADD COLUMN IF NOT EXISTS metadata_json JSONB NOT NULL DEFAULT '{}'::jsonb", + "ALTER TABLE rag_chunks ADD COLUMN IF NOT EXISTS span_start INTEGER NULL", + "ALTER TABLE rag_chunks ADD COLUMN IF NOT EXISTS span_end INTEGER NULL", + ): + conn.execute(text(statement)) + + def _convert_metadata_to_jsonb(self, conn) -> None: + conn.execute( + text( + """ + ALTER TABLE rag_chunks + ALTER COLUMN metadata_json TYPE JSONB + USING CASE + WHEN metadata_json IS NULL THEN '{}'::jsonb + WHEN trim(metadata_json::text) = '' THEN '{}'::jsonb + ELSE metadata_json::jsonb + END + """ + ) + ) + + def _migrate_legacy_chunk_metadata(self, conn) -> None: + pairs = self._legacy_chunk_pairs(conn) + if not pairs: + return + entries = ",\n ".join(f"'{key}', {column}" for key, column in pairs) + conn.execute( + text( + f""" + UPDATE rag_chunks + SET metadata_json = COALESCE(metadata_json, '{{}}'::jsonb) || jsonb_strip_nulls( + jsonb_build_object( + {entries} + ) + ) + """ + ) + ) + + def _migrate_legacy_cache(self, conn) -> None: + row = conn.execute(text("SELECT to_regclass('public.rag_chunk_cache') AS table_name")).mappings().first() + if not row or not row.get("table_name"): + return + conn.execute( + text( + """ + INSERT INTO rag_document_cache ( + repo_id, blob_sha, chunk_index, path, layer, lang, title, content, embedding, + metadata_json, links_json, span_start, span_end, commit_sha, created_at, updated_at + ) + SELECT + repo_id, + blob_sha, + chunk_index, + COALESCE(path, ''), + layer, + lang, + title, + content, + embedding, + CASE + WHEN metadata_json IS NULL THEN '{}'::jsonb + WHEN trim(metadata_json) = '' THEN '{}'::jsonb + ELSE metadata_json::jsonb + END, + CASE + WHEN links_json IS NULL THEN '[]'::jsonb + WHEN trim(links_json) = '' THEN '[]'::jsonb + ELSE links_json::jsonb + END, + span_start, + span_end, + commit_sha, + created_at, + updated_at + FROM rag_chunk_cache + ON CONFLICT (repo_id, blob_sha, chunk_index) DO NOTHING + """ + ) + ) + + def _drop_legacy_chunk_columns(self, conn) -> None: + for column in legacy_chunk_columns(): + conn.execute(text(f"ALTER TABLE rag_chunks DROP COLUMN IF EXISTS {column}")) + + def _legacy_chunk_pairs(self, conn) -> list[tuple[str, str]]: + desired = ( + ("artifact_type", "artifact_type"), + ("section", "section"), + ("doc_id", "doc_id"), + ("doc_version", "doc_version"), + ("owner", "owner"), + ("system_component", "system_component"), + ("last_modified", "last_modified"), + ("staleness_score", "staleness_score"), + ("symbol_id", "symbol_id"), + ("qname", "qname"), + ("kind", "kind"), + ("framework", "framework"), + ("entrypoint_type", "entrypoint_type"), + ("module_id", "module_id"), + ("section_path", "section_path"), + ("doc_kind", "doc_kind"), + ) + rows = conn.execute( + text( + """ + SELECT column_name + FROM information_schema.columns + WHERE table_schema = 'public' AND table_name = 'rag_chunks' + """ + ) + ).fetchall() + existing = {str(row[0]) for row in rows} + return [(key, column) for key, column in desired if column in existing] diff --git a/src/app/modules/rag/persistence/schema_repository.py b/src/app/modules/rag/persistence/schema_repository.py index db03ae7..bab85c6 100644 --- a/src/app/modules/rag/persistence/schema_repository.py +++ b/src/app/modules/rag/persistence/schema_repository.py @@ -2,184 +2,28 @@ from __future__ import annotations from sqlalchemy import text +from app.modules.rag.persistence.schema_migrator import RagSchemaMigrator +from app.modules.rag.persistence.schema_statements import ( + base_table_statements, + index_statements, + legacy_drop_statements, +) from app.modules.shared.db import get_engine class RagSchemaRepository: + def __init__(self) -> None: + self._migrator = RagSchemaMigrator() + def ensure_tables(self) -> None: engine = get_engine() with engine.connect() as conn: - conn.execute(text("CREATE EXTENSION IF NOT EXISTS vector")) - conn.execute( - text( - """ - CREATE TABLE IF NOT EXISTS rag_sessions ( - rag_session_id VARCHAR(64) PRIMARY KEY, - project_id VARCHAR(512) NOT NULL, - created_at TIMESTAMPTZ DEFAULT CURRENT_TIMESTAMP - ) - """ - ) - ) - conn.execute( - text( - """ - CREATE TABLE IF NOT EXISTS rag_index_jobs ( - index_job_id VARCHAR(64) PRIMARY KEY, - rag_session_id VARCHAR(64) NOT NULL, - status VARCHAR(16) NOT NULL, - indexed_files INTEGER NOT NULL DEFAULT 0, - failed_files INTEGER NOT NULL DEFAULT 0, - cache_hit_files INTEGER NOT NULL DEFAULT 0, - cache_miss_files INTEGER NOT NULL DEFAULT 0, - error_code VARCHAR(128) NULL, - error_desc TEXT NULL, - error_module VARCHAR(64) NULL, - created_at TIMESTAMPTZ DEFAULT CURRENT_TIMESTAMP, - updated_at TIMESTAMPTZ DEFAULT CURRENT_TIMESTAMP - ) - """ - ) - ) - conn.execute( - text( - """ - CREATE TABLE IF NOT EXISTS rag_chunks ( - id BIGSERIAL PRIMARY KEY, - rag_session_id VARCHAR(64) NOT NULL, - path TEXT NOT NULL, - chunk_index INTEGER NOT NULL, - content TEXT NOT NULL, - embedding vector NULL, - created_at TIMESTAMPTZ DEFAULT CURRENT_TIMESTAMP, - updated_at TIMESTAMPTZ DEFAULT CURRENT_TIMESTAMP - ) - """ - ) - ) - conn.execute( - text( - """ - CREATE TABLE IF NOT EXISTS rag_blob_cache ( - id BIGSERIAL PRIMARY KEY, - repo_id VARCHAR(512) NOT NULL, - blob_sha VARCHAR(128) NOT NULL, - path TEXT NOT NULL, - created_at TIMESTAMPTZ DEFAULT CURRENT_TIMESTAMP, - updated_at TIMESTAMPTZ DEFAULT CURRENT_TIMESTAMP, - CONSTRAINT uq_rag_blob_cache UNIQUE (repo_id, blob_sha, path) - ) - """ - ) - ) - conn.execute( - text( - """ - CREATE TABLE IF NOT EXISTS rag_chunk_cache ( - id BIGSERIAL PRIMARY KEY, - repo_id VARCHAR(512) NOT NULL, - blob_sha VARCHAR(128) NOT NULL, - chunk_index INTEGER NOT NULL, - content TEXT NOT NULL, - embedding vector NULL, - created_at TIMESTAMPTZ DEFAULT CURRENT_TIMESTAMP, - updated_at TIMESTAMPTZ DEFAULT CURRENT_TIMESTAMP, - CONSTRAINT uq_rag_chunk_cache UNIQUE (repo_id, blob_sha, chunk_index) - ) - """ - ) - ) - conn.execute( - text( - """ - CREATE TABLE IF NOT EXISTS rag_session_chunk_map ( - id BIGSERIAL PRIMARY KEY, - rag_session_id VARCHAR(64) NOT NULL, - repo_id VARCHAR(512) NOT NULL, - blob_sha VARCHAR(128) NOT NULL, - chunk_index INTEGER NOT NULL, - path TEXT NOT NULL, - created_at TIMESTAMPTZ DEFAULT CURRENT_TIMESTAMP - ) - """ - ) - ) - self._ensure_columns(conn) - self._ensure_indexes(conn) - self._drop_unused_rag_chunk_columns(conn) + self._run(conn, base_table_statements()) + self._migrator.migrate(conn) + self._run(conn, index_statements()) + self._run(conn, legacy_drop_statements()) conn.commit() - def _ensure_columns(self, conn) -> None: - for statement in ( - "ALTER TABLE rag_chunks ADD COLUMN IF NOT EXISTS artifact_type VARCHAR(16) NULL", - "ALTER TABLE rag_chunks ADD COLUMN IF NOT EXISTS section TEXT NULL", - "ALTER TABLE rag_chunks ADD COLUMN IF NOT EXISTS doc_id TEXT NULL", - "ALTER TABLE rag_chunks ADD COLUMN IF NOT EXISTS doc_version TEXT NULL", - "ALTER TABLE rag_chunks ADD COLUMN IF NOT EXISTS owner TEXT NULL", - "ALTER TABLE rag_chunks ADD COLUMN IF NOT EXISTS system_component TEXT NULL", - "ALTER TABLE rag_chunks ADD COLUMN IF NOT EXISTS last_modified TIMESTAMPTZ NULL", - "ALTER TABLE rag_chunks ADD COLUMN IF NOT EXISTS staleness_score DOUBLE PRECISION NULL", - "ALTER TABLE rag_chunks ADD COLUMN IF NOT EXISTS layer VARCHAR(64) NULL", - "ALTER TABLE rag_chunks ADD COLUMN IF NOT EXISTS lang VARCHAR(32) NULL", - "ALTER TABLE rag_chunks ADD COLUMN IF NOT EXISTS repo_id VARCHAR(512) NULL", - "ALTER TABLE rag_chunks ADD COLUMN IF NOT EXISTS commit_sha VARCHAR(128) NULL", - "ALTER TABLE rag_chunks ADD COLUMN IF NOT EXISTS title TEXT NULL", - "ALTER TABLE rag_chunks ADD COLUMN IF NOT EXISTS metadata_json TEXT NULL", - "ALTER TABLE rag_chunks ADD COLUMN IF NOT EXISTS span_start INTEGER NULL", - "ALTER TABLE rag_chunks ADD COLUMN IF NOT EXISTS span_end INTEGER NULL", - "ALTER TABLE rag_chunks ADD COLUMN IF NOT EXISTS symbol_id TEXT NULL", - "ALTER TABLE rag_chunks ADD COLUMN IF NOT EXISTS qname TEXT NULL", - "ALTER TABLE rag_chunks ADD COLUMN IF NOT EXISTS kind TEXT NULL", - "ALTER TABLE rag_chunks ADD COLUMN IF NOT EXISTS framework TEXT NULL", - "ALTER TABLE rag_chunks ADD COLUMN IF NOT EXISTS entrypoint_type TEXT NULL", - "ALTER TABLE rag_chunks ADD COLUMN IF NOT EXISTS module_id TEXT NULL", - "ALTER TABLE rag_chunks ADD COLUMN IF NOT EXISTS section_path TEXT NULL", - "ALTER TABLE rag_chunks ADD COLUMN IF NOT EXISTS doc_kind TEXT NULL", - "ALTER TABLE rag_blob_cache ADD COLUMN IF NOT EXISTS artifact_type VARCHAR(16) NULL", - "ALTER TABLE rag_blob_cache ADD COLUMN IF NOT EXISTS section TEXT NULL", - "ALTER TABLE rag_blob_cache ADD COLUMN IF NOT EXISTS doc_id TEXT NULL", - "ALTER TABLE rag_blob_cache ADD COLUMN IF NOT EXISTS doc_version TEXT NULL", - "ALTER TABLE rag_blob_cache ADD COLUMN IF NOT EXISTS owner TEXT NULL", - "ALTER TABLE rag_blob_cache ADD COLUMN IF NOT EXISTS system_component TEXT NULL", - "ALTER TABLE rag_blob_cache ADD COLUMN IF NOT EXISTS last_modified TIMESTAMPTZ NULL", - "ALTER TABLE rag_blob_cache ADD COLUMN IF NOT EXISTS staleness_score DOUBLE PRECISION NULL", - "ALTER TABLE rag_blob_cache ADD COLUMN IF NOT EXISTS layer VARCHAR(64) NULL", - "ALTER TABLE rag_blob_cache ADD COLUMN IF NOT EXISTS lang VARCHAR(32) NULL", - "ALTER TABLE rag_blob_cache ADD COLUMN IF NOT EXISTS metadata_json TEXT NULL", - "ALTER TABLE rag_chunk_cache ADD COLUMN IF NOT EXISTS section TEXT NULL", - "ALTER TABLE rag_chunk_cache ADD COLUMN IF NOT EXISTS layer VARCHAR(64) NULL", - "ALTER TABLE rag_chunk_cache ADD COLUMN IF NOT EXISTS lang VARCHAR(32) NULL", - "ALTER TABLE rag_chunk_cache ADD COLUMN IF NOT EXISTS path TEXT NULL", - "ALTER TABLE rag_chunk_cache ADD COLUMN IF NOT EXISTS title TEXT NULL", - "ALTER TABLE rag_chunk_cache ADD COLUMN IF NOT EXISTS metadata_json TEXT NULL", - "ALTER TABLE rag_chunk_cache ADD COLUMN IF NOT EXISTS links_json TEXT NULL", - "ALTER TABLE rag_chunk_cache ADD COLUMN IF NOT EXISTS span_start INTEGER NULL", - "ALTER TABLE rag_chunk_cache ADD COLUMN IF NOT EXISTS span_end INTEGER NULL", - "ALTER TABLE rag_chunk_cache ADD COLUMN IF NOT EXISTS commit_sha VARCHAR(128) NULL", - "ALTER TABLE rag_index_jobs ADD COLUMN IF NOT EXISTS cache_hit_files INTEGER NOT NULL DEFAULT 0", - "ALTER TABLE rag_index_jobs ADD COLUMN IF NOT EXISTS cache_miss_files INTEGER NOT NULL DEFAULT 0", - ): - conn.execute(text(statement)) - - def _drop_unused_rag_chunk_columns(self, conn) -> None: - for statement in ( - "ALTER TABLE rag_chunks DROP COLUMN IF EXISTS rag_doc_id", - "ALTER TABLE rag_chunks DROP COLUMN IF EXISTS links_json", - ): - conn.execute(text(statement)) - - def _ensure_indexes(self, conn) -> None: - for statement in ( - "CREATE INDEX IF NOT EXISTS idx_rag_chunks_session ON rag_chunks (rag_session_id)", - "CREATE INDEX IF NOT EXISTS idx_rag_chunks_layer ON rag_chunks (rag_session_id, layer)", - "CREATE INDEX IF NOT EXISTS idx_rag_chunks_layer_path ON rag_chunks (rag_session_id, layer, path)", - "CREATE INDEX IF NOT EXISTS idx_rag_chunks_qname ON rag_chunks (qname)", - "CREATE INDEX IF NOT EXISTS idx_rag_chunks_symbol_id ON rag_chunks (symbol_id)", - "CREATE INDEX IF NOT EXISTS idx_rag_chunks_module_id ON rag_chunks (module_id)", - "CREATE INDEX IF NOT EXISTS idx_rag_chunks_doc_kind ON rag_chunks (doc_kind)", - "CREATE INDEX IF NOT EXISTS idx_rag_chunks_entrypoint ON rag_chunks (entrypoint_type, framework)", - "CREATE INDEX IF NOT EXISTS idx_rag_blob_cache_repo_blob ON rag_blob_cache (repo_id, blob_sha)", - "CREATE INDEX IF NOT EXISTS idx_rag_chunk_cache_repo_blob ON rag_chunk_cache (repo_id, blob_sha, chunk_index)", - "CREATE INDEX IF NOT EXISTS idx_rag_session_chunk_map_session ON rag_session_chunk_map (rag_session_id, created_at DESC)", - ): + def _run(self, conn, statements: tuple[str, ...]) -> None: + for statement in statements: conn.execute(text(statement)) diff --git a/src/app/modules/rag/persistence/schema_statements.py b/src/app/modules/rag/persistence/schema_statements.py new file mode 100644 index 0000000..38d9ae7 --- /dev/null +++ b/src/app/modules/rag/persistence/schema_statements.py @@ -0,0 +1,123 @@ +from __future__ import annotations + + +def base_table_statements() -> tuple[str, ...]: + return ( + "CREATE EXTENSION IF NOT EXISTS vector", + """ + CREATE TABLE IF NOT EXISTS rag_sessions ( + rag_session_id VARCHAR(64) PRIMARY KEY, + project_id VARCHAR(512) NOT NULL, + created_at TIMESTAMPTZ DEFAULT CURRENT_TIMESTAMP + ) + """, + """ + CREATE TABLE IF NOT EXISTS rag_index_jobs ( + index_job_id VARCHAR(64) PRIMARY KEY, + rag_session_id VARCHAR(64) NOT NULL, + status VARCHAR(16) NOT NULL, + indexed_files INTEGER NOT NULL DEFAULT 0, + failed_files INTEGER NOT NULL DEFAULT 0, + cache_hit_files INTEGER NOT NULL DEFAULT 0, + cache_miss_files INTEGER NOT NULL DEFAULT 0, + error_code VARCHAR(128) NULL, + error_desc TEXT NULL, + error_module VARCHAR(64) NULL, + created_at TIMESTAMPTZ DEFAULT CURRENT_TIMESTAMP, + updated_at TIMESTAMPTZ DEFAULT CURRENT_TIMESTAMP + ) + """, + """ + CREATE TABLE IF NOT EXISTS rag_chunks ( + id BIGSERIAL PRIMARY KEY, + rag_session_id VARCHAR(64) NOT NULL, + path TEXT NOT NULL, + chunk_index INTEGER NOT NULL, + content TEXT NOT NULL, + embedding vector NULL, + layer VARCHAR(64) NULL, + lang VARCHAR(32) NULL, + repo_id VARCHAR(512) NULL, + commit_sha VARCHAR(128) NULL, + title TEXT NULL, + metadata_json JSONB NOT NULL DEFAULT '{}'::jsonb, + span_start INTEGER NULL, + span_end INTEGER NULL, + created_at TIMESTAMPTZ DEFAULT CURRENT_TIMESTAMP, + updated_at TIMESTAMPTZ DEFAULT CURRENT_TIMESTAMP + ) + """, + """ + CREATE TABLE IF NOT EXISTS rag_document_cache ( + id BIGSERIAL PRIMARY KEY, + repo_id VARCHAR(512) NOT NULL, + blob_sha VARCHAR(128) NOT NULL, + chunk_index INTEGER NOT NULL, + path TEXT NOT NULL, + layer VARCHAR(64) NULL, + lang VARCHAR(32) NULL, + title TEXT NULL, + content TEXT NOT NULL, + embedding vector NULL, + metadata_json JSONB NOT NULL DEFAULT '{}'::jsonb, + links_json JSONB NOT NULL DEFAULT '[]'::jsonb, + span_start INTEGER NULL, + span_end INTEGER NULL, + commit_sha VARCHAR(128) NULL, + created_at TIMESTAMPTZ DEFAULT CURRENT_TIMESTAMP, + updated_at TIMESTAMPTZ DEFAULT CURRENT_TIMESTAMP, + CONSTRAINT uq_rag_document_cache UNIQUE (repo_id, blob_sha, chunk_index) + ) + """, + ) + + +def index_statements() -> tuple[str, ...]: + return ( + "CREATE INDEX IF NOT EXISTS idx_rag_chunks_session ON rag_chunks (rag_session_id)", + "CREATE INDEX IF NOT EXISTS idx_rag_chunks_layer ON rag_chunks (rag_session_id, layer)", + "CREATE INDEX IF NOT EXISTS idx_rag_chunks_layer_path ON rag_chunks (rag_session_id, layer, path)", + "CREATE INDEX IF NOT EXISTS idx_rag_chunks_path ON rag_chunks (path)", + "CREATE INDEX IF NOT EXISTS idx_rag_chunks_repo_path ON rag_chunks (repo_id, path)", + "CREATE INDEX IF NOT EXISTS idx_rag_chunks_metadata_json ON rag_chunks USING GIN (metadata_json)", + "CREATE INDEX IF NOT EXISTS idx_rag_document_cache_repo_blob ON rag_document_cache (repo_id, blob_sha, chunk_index)", + ) + + +def legacy_drop_statements() -> tuple[str, ...]: + return ( + "DROP INDEX IF EXISTS idx_rag_chunks_qname", + "DROP INDEX IF EXISTS idx_rag_chunks_symbol_id", + "DROP INDEX IF EXISTS idx_rag_chunks_module_id", + "DROP INDEX IF EXISTS idx_rag_chunks_doc_kind", + "DROP INDEX IF EXISTS idx_rag_chunks_entrypoint", + "DROP INDEX IF EXISTS idx_rag_blob_cache_repo_blob", + "DROP INDEX IF EXISTS idx_rag_chunk_cache_repo_blob", + "DROP INDEX IF EXISTS idx_rag_session_chunk_map_session", + "DROP TABLE IF EXISTS rag_blob_cache", + "DROP TABLE IF EXISTS rag_chunk_cache", + "DROP TABLE IF EXISTS rag_session_chunk_map", + ) + + +def legacy_chunk_columns() -> tuple[str, ...]: + return ( + "artifact_type", + "section", + "doc_id", + "doc_version", + "owner", + "system_component", + "last_modified", + "staleness_score", + "symbol_id", + "qname", + "kind", + "framework", + "entrypoint_type", + "module_id", + "section_path", + "doc_kind", + "rag_doc_id", + "links_json", + ) diff --git a/src/app/modules/shared/bootstrap.py b/src/app/modules/shared/bootstrap.py index 34ea8ba..ed90f3f 100644 --- a/src/app/modules/shared/bootstrap.py +++ b/src/app/modules/shared/bootstrap.py @@ -3,12 +3,13 @@ import time from app.modules.shared.checkpointer import get_checkpointer -def bootstrap_database(rag_repository, chat_repository, story_context_repository) -> None: +def bootstrap_database(rag_repository, story_context_repository, chat_repository=None) -> None: last_error: Exception | None = None for attempt in range(1, 16): try: rag_repository.ensure_tables() - chat_repository.ensure_tables() + if chat_repository is not None: + chat_repository.ensure_tables() story_context_repository.ensure_tables() get_checkpointer() return diff --git a/src/app/modules/shared/checkpointer.py b/src/app/modules/shared/checkpointer.py index d47c93f..955f9bd 100644 --- a/src/app/modules/shared/checkpointer.py +++ b/src/app/modules/shared/checkpointer.py @@ -4,6 +4,7 @@ import threading import psycopg from langgraph.checkpoint.postgres import PostgresSaver +from psycopg.errors import DuplicateColumn from psycopg.rows import dict_row from app.modules.shared.db import database_url @@ -25,6 +26,12 @@ def get_checkpointer() -> PostgresSaver: if _CHECKPOINTER is None: conn = psycopg.connect(_conn_string(), autocommit=True, row_factory=dict_row) cp = PostgresSaver(conn) - cp.setup() + try: + cp.setup() + except DuplicateColumn as exc: + # LangGraph migrations may be partially applied in an existing DB. + # Treat duplicate task_path as already initialized schema. + if "task_path" not in str(exc): + raise _CHECKPOINTER = cp return _CHECKPOINTER diff --git a/src/app/schemas/agent_api.py b/src/app/schemas/agent_api.py new file mode 100644 index 0000000..dc460af --- /dev/null +++ b/src/app/schemas/agent_api.py @@ -0,0 +1,54 @@ +from __future__ import annotations + +from datetime import datetime + +from pydantic import BaseModel, Field + +from app.schemas.common import ErrorPayload + + +class CreateAgentSessionResponse(BaseModel): + session_id: str + active_rag_session_id: str | None = None + created_at: datetime + + +class BindRagSessionRequest(BaseModel): + rag_session_id: str = Field(min_length=1) + + +class BindRagSessionResponse(BaseModel): + session_id: str + active_rag_session_id: str | None = None + updated_at: datetime + + +class ResetAgentSessionResponse(BaseModel): + session_id: str + active_rag_session_id: str | None = None + status: str + updated_at: datetime + + +class AgentRequestCreateRequest(BaseModel): + session_id: str = Field(min_length=1) + message: str = Field(min_length=1) + process_version: str = Field(default="v2", min_length=1) + + +class AgentRequestQueuedResponse(BaseModel): + request_id: str + session_id: str + status: str + stream_url: str + + +class AgentRequestStateResponse(BaseModel): + request_id: str + session_id: str + status: str + process_version: str + answer: str | None = None + error: ErrorPayload | None = None + created_at: datetime + completed_at: datetime | None = None diff --git a/src/app/schemas/chat.py b/src/app/schemas/chat.py index bb007bc..a0de4b3 100644 --- a/src/app/schemas/chat.py +++ b/src/app/schemas/chat.py @@ -59,14 +59,26 @@ class TaskStatus(str, Enum): class TaskResultType(str, Enum): ANSWER = "answer" + OPENAPI = "openapi" + DOCUMENTATION = "documentation" CHANGESET = "changeset" +class TaskArtifact(BaseModel): + artifact_type: TaskResultType + title: str = Field(min_length=1) + content: str = "" + format: str = Field(default="text") + template_id: str | None = None + source_refs: list[str] = Field(default_factory=list) + + class TaskResultResponse(BaseModel): task_id: str status: TaskStatus result_type: Optional[TaskResultType] = None answer: Optional[str] = None + artifacts: list[TaskArtifact] = Field(default_factory=list) changeset: list[ChangeItem] = Field(default_factory=list) error: Optional[ErrorPayload] = None diff --git a/src/app/schemas/client_events.py b/src/app/schemas/client_events.py new file mode 100644 index 0000000..d78b9da --- /dev/null +++ b/src/app/schemas/client_events.py @@ -0,0 +1,22 @@ +from __future__ import annotations + +from datetime import datetime +from enum import Enum + +from pydantic import BaseModel, Field + + +class ClientEventType(str, Enum): + SYSTEM = "system" + STATUS = "status" + USER = "user" + + +class ClientEvent(BaseModel): + event_id: str = Field(min_length=1) + request_id: str = Field(min_length=1) + type: ClientEventType + source: str = Field(min_length=1) + text: str = "" + payload: dict = Field(default_factory=dict) + created_at: datetime diff --git a/src/app/schemas/orchestration.py b/src/app/schemas/orchestration.py new file mode 100644 index 0000000..e4efc9f --- /dev/null +++ b/src/app/schemas/orchestration.py @@ -0,0 +1,21 @@ +from __future__ import annotations + +from datetime import datetime +from enum import Enum + +from pydantic import BaseModel, Field + + +class RequestExecutionStatus(str, Enum): + QUEUED = "queued" + RUNNING = "running" + DONE = "done" + ERROR = "error" + + +class StepTraceRecord(BaseModel): + step: str = Field(min_length=1) + status: str = Field(min_length=1) + started_at: datetime + finished_at: datetime | None = None + details: dict = Field(default_factory=dict) diff --git a/tests/README.md b/tests/README.md index 8d35c9a..0e6c0c4 100644 --- a/tests/README.md +++ b/tests/README.md @@ -5,12 +5,13 @@ - `chat/` — тесты модуля chat - `rag/` — тесты модуля RAG (индексация, retrieval, intent router) -- **pipeline_setup/** — тесты, используемые в настройке пайплайна: - - `pipeline_intent_rag/` — intent-router → RAG → LLM (маркеры `router_rag`, `full_chain`) - - `code_qa_eval/` — CODE_QA golden eval harness - - `golden/`, `fixtures/`, `test_results/`, `utils/` — данные, результаты прогонов и скрипты запуска пайплайна +- **pipeline_setup_v3/** — актуальный harness для pipeline-проверок поверх agent runtime: + - `cases/` — YAML-наборы кейсов + - `fixtures/` — репозитории-фикстуры для индексации + - `shared/` — env/rag утилиты для прогонов + - `test_results/` — артефакты запусков Запуск: - Юнит-тесты: `pytest tests/unit_tests/ -v` -- Пайплайн-тесты: `pytest tests/pipeline_setup/ -v` (см. `pipeline_setup/pipeline_intent_rag/README.md` и `pipeline_setup/code_qa_eval/README.md`) +- Пайплайн-тесты: `pytest tests/pipeline_setup_v3/ -v` diff --git a/tests/docs_qa_eval/__init__.py b/tests/docs_qa_eval/__init__.py new file mode 100644 index 0000000..0138ad6 --- /dev/null +++ b/tests/docs_qa_eval/__init__.py @@ -0,0 +1 @@ +# Docs QA golden evaluation harness. diff --git a/tests/docs_qa_eval/config.py b/tests/docs_qa_eval/config.py new file mode 100644 index 0000000..43edb8d --- /dev/null +++ b/tests/docs_qa_eval/config.py @@ -0,0 +1,10 @@ +from __future__ import annotations + +from dataclasses import dataclass +from pathlib import Path + + +@dataclass(slots=True, frozen=True) +class DocsEvalConfig: + golden_cases_path: Path = Path("tests/golden/docs_qa/cases.yaml") + pipeline_mode: str = "pre_llm_only" diff --git a/tests/docs_qa_eval/fixture_adapter.py b/tests/docs_qa_eval/fixture_adapter.py new file mode 100644 index 0000000..e98ccaf --- /dev/null +++ b/tests/docs_qa_eval/fixture_adapter.py @@ -0,0 +1,108 @@ +from __future__ import annotations + + +class InMemoryDocsRetrievalAdapter: + def __init__(self, rows: list[dict]) -> None: + self._rows = list(rows) + self._report: dict = {} + + def retrieve_with_plan(self, rag_session_id: str, query: str, retrieval_spec, retrieval_constraints=None, *, query_plan=None) -> list[dict]: + planned_layers = [str(item.layer_id) for item in retrieval_spec.layer_queries] + query_sub_intent = str(getattr(query_plan, "sub_intent", "") or "") + relation_rows = [row for row in self._rows if str(row.get("layer") or "") == "D5_RELATION_GRAPH"] + relation_hits = len(relation_rows) + result: list[dict] = [] + executed_layers: list[str] = [] + layer_diagnostics: dict[str, dict] = {} + fallback_used = False + fallback_reason = None + support_paths = [ + str(row.get("path") or "").strip() + for row in self._rows + if str(row.get("layer") or "") in {"D1_DOCUMENT_CATALOG", "D2_FACT_INDEX", "D3_ENTITY_CATALOG", "D4_WORKFLOW_INDEX", "D5_RELATION_GRAPH"} + and str(row.get("path") or "").strip() + ] + self._report = { + "planned_layers": planned_layers, + "executed_layers": executed_layers, + "retrieval_mode_by_layer": {}, + "fallback": {"used": False}, + "layer_diagnostics": layer_diagnostics, + } + for item in retrieval_spec.layer_queries: + layer_id = str(item.layer_id) + if query_sub_intent == "RELATED_DOCS_EXPLAIN" and layer_id in {"D1_DOCUMENT_CATALOG", "D0_DOC_CHUNKS"} and relation_hits >= 2: + layer_diagnostics[layer_id] = {"hits": 0, "top_ids": [], "skipped": True, "reason": "relation_primary_sufficient"} + continue + executed_layers.append(layer_id) + layer_rows = [row for row in self._rows if str(row.get("layer") or "") == layer_id] + result.extend(layer_rows) + layer_diagnostics[layer_id] = self._layer_diagnostics(layer_rows) + d2_empty = "D2_FACT_INDEX" in planned_layers and int(dict(layer_diagnostics.get("D2_FACT_INDEX") or {}).get("hits") or 0) == 0 + d0_empty = "D0_DOC_CHUNKS" in planned_layers and int(dict(layer_diagnostics.get("D0_DOC_CHUNKS") or {}).get("hits") or 0) == 0 + if support_paths and "D0_DOC_CHUNKS" in planned_layers and (d2_empty or d0_empty): + targeted = [ + row for row in self._rows + if str(row.get("layer") or "") == "D0_DOC_CHUNKS" and str(row.get("path") or "").strip() in support_paths + ] + merged = self._dedupe([*result, *targeted]) + new_targeted = self._subtract_rows(merged, result) + result = merged + layer_diagnostics["D0_DOC_CHUNKS"] = self._layer_diagnostics( + [row for row in result if str(row.get("layer") or "") == "D0_DOC_CHUNKS"] + ) + if new_targeted: + fallback_used = True + fallback_reason = "targeted_chunk_retrieval" + self._report["fallback"] = {"used": fallback_used, "reason": fallback_reason} + return self._dedupe(result) + + def retrieve_exact_files(self, rag_session_id: str, *, repo_id=None, paths: list[str], layers=None, limit: int = 200, query: str = "", ranking_profile: str = "") -> list[dict]: + return [] + + def hydrate_resolved_symbol_sources(self, rag_session_id: str, base_query: str, rag_rows: list[dict], symbol_resolution: dict, retrieval_spec, retrieval_constraints=None) -> list[dict]: + return list(rag_rows) + + def force_symbol_context_c0(self, rag_session_id: str, *, rag_rows: list[dict], symbol_resolution: dict, limit: int = 20) -> list[dict]: + return list(rag_rows) + + def consume_retrieval_report(self) -> dict: + return dict(self._report) + + def _layer_diagnostics(self, rows: list[dict]) -> dict: + top_ids: list[str] = [] + top_sections: list[str] = [] + for row in rows[:5]: + metadata = dict(row.get("metadata") or {}) + candidate = metadata.get("document_id") or metadata.get("doc_id") or metadata.get("fact_id") or metadata.get("relation_id") or row.get("path") + value = str(candidate or "").strip() + if value and value not in top_ids: + top_ids.append(value) + title = str(row.get("title") or "").strip() + if title and title not in top_sections: + top_sections.append(title) + return {"hits": len(rows), "top_ids": top_ids, "top_sections": top_sections} + + def _dedupe(self, rows: list[dict]) -> list[dict]: + result: list[dict] = [] + seen: set[tuple[str, str, str, int | None, int | None]] = set() + for row in rows: + key = self._row_key(row) + if key in seen: + continue + seen.add(key) + result.append(row) + return result + + def _subtract_rows(self, rows: list[dict], baseline: list[dict]) -> list[dict]: + baseline_keys = {self._row_key(row) for row in baseline} + return [row for row in rows if self._row_key(row) not in baseline_keys] + + def _row_key(self, row: dict) -> tuple[str, str, str, int | None, int | None]: + return ( + str(row.get("layer") or ""), + str(row.get("path") or ""), + str(row.get("title") or ""), + row.get("span_start"), + row.get("span_end"), + ) diff --git a/tests/docs_qa_eval/golden_loader.py b/tests/docs_qa_eval/golden_loader.py new file mode 100644 index 0000000..762ffe5 --- /dev/null +++ b/tests/docs_qa_eval/golden_loader.py @@ -0,0 +1,32 @@ +from __future__ import annotations + +from dataclasses import dataclass +from pathlib import Path + +import yaml + + +@dataclass(slots=True, frozen=True) +class DocsGoldenCase: + case_id: str + query: str + expected_intent: str + expected_sub_intent: str + expected_layers: tuple[str, ...] + rows: tuple[dict, ...] + + +def load_cases(path: Path) -> list[DocsGoldenCase]: + payload = yaml.safe_load(path.read_text(encoding="utf-8")) or {} + items = payload.get("cases") or [] + return [ + DocsGoldenCase( + case_id=str(item["id"]), + query=str(item["query"]), + expected_intent=str(item["expected_intent"]), + expected_sub_intent=str(item["expected_sub_intent"]), + expected_layers=tuple(item.get("expected_layers") or ()), + rows=tuple(item.get("rows") or ()), + ) + for item in items + ] diff --git a/tests/docs_qa_eval/run.py b/tests/docs_qa_eval/run.py new file mode 100644 index 0000000..555cefa --- /dev/null +++ b/tests/docs_qa_eval/run.py @@ -0,0 +1,18 @@ +from __future__ import annotations + +from tests.docs_qa_eval.config import DocsEvalConfig +from tests.docs_qa_eval.runner import run_eval + + +def main() -> int: + results = run_eval(DocsEvalConfig()) + failed = [ + item.case.case_id + for item in results + if not (item.intent_ok and item.layers_ok and item.retrieval_non_empty and item.openapi_complete) + ] + return 1 if failed else 0 + + +if __name__ == "__main__": + raise SystemExit(main()) diff --git a/tests/docs_qa_eval/runner.py b/tests/docs_qa_eval/runner.py new file mode 100644 index 0000000..0fbc650 --- /dev/null +++ b/tests/docs_qa_eval/runner.py @@ -0,0 +1,51 @@ +from __future__ import annotations + +from dataclasses import dataclass + +from app.modules.agent.intent_router_v2 import IntentRouterV2 +from app.modules.agent.runtime.docs_qa_pipeline import DocsQAPipelineRunner +from tests.docs_qa_eval.config import DocsEvalConfig +from tests.docs_qa_eval.fixture_adapter import InMemoryDocsRetrievalAdapter +from tests.docs_qa_eval.golden_loader import DocsGoldenCase, load_cases +from tests.unit_tests.rag.intent_router_testkit import repo_context + + +@dataclass(slots=True, frozen=True) +class DocsEvalCaseResult: + case: DocsGoldenCase + intent_ok: bool + layers_ok: bool + retrieval_non_empty: bool + openapi_complete: bool + gate_ok: bool + openapi_output_ok: bool + + +def run_eval(config: DocsEvalConfig) -> list[DocsEvalCaseResult]: + router = IntentRouterV2() + cases = load_cases(config.golden_cases_path) + results: list[DocsEvalCaseResult] = [] + for case in cases: + pipeline = DocsQAPipelineRunner(router=router, retrieval_adapter=InMemoryDocsRetrievalAdapter(list(case.rows)), repo_context=repo_context()) + result = pipeline.run(case.query, rag_session_id="docs-test-session", mode=config.pipeline_mode) + actual_layers = tuple(item.layer_id for item in result.router_result.retrieval_spec.layer_queries) + diagnostics = result.diagnostics + openapi_complete = True + gate_ok = diagnostics.gate_decision in {"allow", "partial"} + openapi_output_ok = True + if case.expected_intent == "OPENAPI_GENERATION": + openapi_complete = diagnostics.openapi_status["has_path"] and diagnostics.openapi_status["has_method"] + gate_ok = diagnostics.gate_decision in {"allow", "partial"} + openapi_output_ok = bool(result.answer.strip()) and ("paths:" in result.answer or "type: object" in result.answer) + results.append( + DocsEvalCaseResult( + case=case, + intent_ok=result.router_result.intent == case.expected_intent and result.router_result.query_plan.sub_intent == case.expected_sub_intent, + layers_ok=actual_layers == case.expected_layers, + retrieval_non_empty=bool(result.raw_rows), + openapi_complete=openapi_complete, + gate_ok=gate_ok, + openapi_output_ok=openapi_output_ok, + ) + ) + return results diff --git a/tests/docs_qa_eval/test_eval_harness.py b/tests/docs_qa_eval/test_eval_harness.py new file mode 100644 index 0000000..deb58dd --- /dev/null +++ b/tests/docs_qa_eval/test_eval_harness.py @@ -0,0 +1,26 @@ +from __future__ import annotations + +import pytest + +from tests.docs_qa_eval.config import DocsEvalConfig +from tests.docs_qa_eval.golden_loader import load_cases +from tests.docs_qa_eval.runner import run_eval + + +pytestmark = pytest.mark.docs_qa_eval + + +def test_load_cases_has_minimum_suite() -> None: + cases = load_cases(DocsEvalConfig().golden_cases_path) + assert len(cases) >= 35 + + +def test_run_eval_all_cases_pass_core_checks() -> None: + results = run_eval(DocsEvalConfig()) + assert results + assert all(item.intent_ok for item in results) + assert all(item.layers_ok for item in results) + assert all(item.retrieval_non_empty for item in results) + assert all(item.gate_ok for item in results) + assert all(item.openapi_complete for item in results if item.case.expected_intent == "OPENAPI_GENERATION") + assert all(item.openapi_output_ok for item in results if item.case.expected_intent == "OPENAPI_GENERATION") diff --git a/tests/golden/docs_qa/cases.yaml b/tests/golden/docs_qa/cases.yaml new file mode 100644 index 0000000..30d3ebf --- /dev/null +++ b/tests/golden/docs_qa/cases.yaml @@ -0,0 +1,258 @@ +cases: + - id: flow-explain-checkout + query: "Объясни как работает checkout workflow" + expected_intent: "DOCUMENTATION_EXPLAIN" + expected_sub_intent: "SYSTEM_FLOW_EXPLAIN" + expected_layers: ["D4_WORKFLOW_INDEX", "D5_RELATION_GRAPH", "D1_DOCUMENT_CATALOG", "D0_DOC_CHUNKS"] + rows: + - {layer: "D1_DOCUMENT_CATALOG", path: "docs/workflows/checkout.md", title: "Checkout flow", content: "Workflow overview"} + - {layer: "D4_WORKFLOW_INDEX", path: "docs/workflows/checkout.md", title: "Checkout steps", content: "cart -> payment -> confirm"} + - id: flow-explain-order-process + query: "Как происходит процесс создания заказа?" + expected_intent: "DOCUMENTATION_EXPLAIN" + expected_sub_intent: "SYSTEM_FLOW_EXPLAIN" + expected_layers: ["D4_WORKFLOW_INDEX", "D5_RELATION_GRAPH", "D1_DOCUMENT_CATALOG", "D0_DOC_CHUNKS"] + rows: + - {layer: "D4_WORKFLOW_INDEX", path: "docs/workflows/order-create.md", title: "Order process", content: "collect data -> validate -> save"} + - id: flow-explain-message-scenario + query: "Опиши сценарий ручной отправки сообщения" + expected_intent: "DOCUMENTATION_EXPLAIN" + expected_sub_intent: "SYSTEM_FLOW_EXPLAIN" + expected_layers: ["D4_WORKFLOW_INDEX", "D5_RELATION_GRAPH", "D1_DOCUMENT_CATALOG", "D0_DOC_CHUNKS"] + rows: + - {layer: "D1_DOCUMENT_CATALOG", path: "docs/scenarios/manual-send.md", title: "Manual send", content: "Scenario"} + - {layer: "D4_WORKFLOW_INDEX", path: "docs/scenarios/manual-send.md", title: "Manual send steps", content: "open ui -> submit -> worker sends"} + - id: flow-explain-health-sequence + query: "Как проходит health-check сценарий?" + expected_intent: "DOCUMENTATION_EXPLAIN" + expected_sub_intent: "SYSTEM_FLOW_EXPLAIN" + expected_layers: ["D4_WORKFLOW_INDEX", "D5_RELATION_GRAPH", "D1_DOCUMENT_CATALOG", "D0_DOC_CHUNKS"] + rows: + - {layer: "D4_WORKFLOW_INDEX", path: "docs/workflows/health.md", title: "Health flow", content: "ping -> status -> response"} + - id: flow-explain-retry-loop + query: "Опиши flow повторной отправки уведомления" + expected_intent: "DOCUMENTATION_EXPLAIN" + expected_sub_intent: "SYSTEM_FLOW_EXPLAIN" + expected_layers: ["D4_WORKFLOW_INDEX", "D5_RELATION_GRAPH", "D1_DOCUMENT_CATALOG", "D0_DOC_CHUNKS"] + rows: + - {layer: "D4_WORKFLOW_INDEX", path: "docs/workflows/retry-loop.md", title: "Retry loop", content: "attempt -> wait -> retry"} + + - id: component-explain-billing + query: "Объясни компонент billing" + expected_intent: "DOCUMENTATION_EXPLAIN" + expected_sub_intent: "COMPONENT_EXPLAIN" + expected_layers: ["D2_FACT_INDEX", "D5_RELATION_GRAPH", "D1_DOCUMENT_CATALOG", "D0_DOC_CHUNKS"] + rows: + - {layer: "D1_DOCUMENT_CATALOG", path: "docs/components/billing.md", title: "Billing", content: "Billing component"} + - {layer: "D2_FACT_INDEX", path: "docs/components/billing.md", title: "Billing facts", content: "Handles payments"} + - id: component-explain-control-plane + query: "Что делает модуль control plane?" + expected_intent: "DOCUMENTATION_EXPLAIN" + expected_sub_intent: "COMPONENT_EXPLAIN" + expected_layers: ["D2_FACT_INDEX", "D5_RELATION_GRAPH", "D1_DOCUMENT_CATALOG", "D0_DOC_CHUNKS"] + rows: + - {layer: "D2_FACT_INDEX", path: "docs/components/control-plane.md", title: "Control plane", content: "Exposes operator endpoints"} + - id: component-explain-telegram-channel + query: "Как работает компонент TelegramControlChannel?" + expected_intent: "DOCUMENTATION_EXPLAIN" + expected_sub_intent: "COMPONENT_EXPLAIN" + expected_layers: ["D2_FACT_INDEX", "D5_RELATION_GRAPH", "D1_DOCUMENT_CATALOG", "D0_DOC_CHUNKS"] + rows: + - {layer: "D1_DOCUMENT_CATALOG", path: "docs/components/telegram-channel.md", title: "TelegramControlChannel", content: "Telegram control component"} + - id: component-explain-worker-loop + query: "Объясни подсистему notification worker" + expected_intent: "DOCUMENTATION_EXPLAIN" + expected_sub_intent: "COMPONENT_EXPLAIN" + expected_layers: ["D2_FACT_INDEX", "D5_RELATION_GRAPH", "D1_DOCUMENT_CATALOG", "D0_DOC_CHUNKS"] + rows: + - {layer: "D2_FACT_INDEX", path: "docs/components/worker.md", title: "Worker", content: "Schedules notification sending"} + - id: component-explain-runtime-manager + query: "Как устроен блок runtime manager?" + expected_intent: "DOCUMENTATION_EXPLAIN" + expected_sub_intent: "COMPONENT_EXPLAIN" + expected_layers: ["D2_FACT_INDEX", "D5_RELATION_GRAPH", "D1_DOCUMENT_CATALOG", "D0_DOC_CHUNKS"] + rows: + - {layer: "D1_DOCUMENT_CATALOG", path: "docs/components/runtime-manager.md", title: "Runtime manager", content: "Runtime orchestration"} + + - id: api-explain-health + query: "Объясни API метод /health" + expected_intent: "DOCUMENTATION_EXPLAIN" + expected_sub_intent: "API_METHOD_EXPLAIN" + expected_layers: ["D2_FACT_INDEX", "D4_WORKFLOW_INDEX", "D1_DOCUMENT_CATALOG", "D0_DOC_CHUNKS"] + rows: + - {layer: "D1_DOCUMENT_CATALOG", path: "docs/api/health.md", title: "GET /health", content: "Health endpoint"} + - {layer: "D2_FACT_INDEX", path: "docs/api/health.md", title: "Health contract", content: "200 and 503", metadata: {endpoint: "/health", http_method: "get"}} + - id: api-explain-send + query: "Что делает endpoint /send?" + expected_intent: "DOCUMENTATION_EXPLAIN" + expected_sub_intent: "API_METHOD_EXPLAIN" + expected_layers: ["D2_FACT_INDEX", "D4_WORKFLOW_INDEX", "D1_DOCUMENT_CATALOG", "D0_DOC_CHUNKS"] + rows: + - {layer: "D2_FACT_INDEX", path: "docs/api/send.md", title: "POST /send", content: "Sends a message", metadata: {endpoint: "/send", http_method: "post"}} + - {layer: "D4_WORKFLOW_INDEX", path: "docs/api/send.md", title: "Send usage", content: "request -> queue -> worker"} + - id: api-explain-create-order + query: "Как работает API method create order?" + expected_intent: "DOCUMENTATION_EXPLAIN" + expected_sub_intent: "API_METHOD_EXPLAIN" + expected_layers: ["D2_FACT_INDEX", "D4_WORKFLOW_INDEX", "D1_DOCUMENT_CATALOG", "D0_DOC_CHUNKS"] + rows: + - {layer: "D1_DOCUMENT_CATALOG", path: "docs/api/orders.md", title: "POST /orders", content: "Create order"} + - {layer: "D4_WORKFLOW_INDEX", path: "docs/api/orders.md", title: "Order API flow", content: "validate -> create -> respond"} + - id: api-explain-actions + query: "Что принимает и возвращает ручка /actions/{action}?" + expected_intent: "DOCUMENTATION_EXPLAIN" + expected_sub_intent: "API_METHOD_EXPLAIN" + expected_layers: ["D2_FACT_INDEX", "D4_WORKFLOW_INDEX", "D1_DOCUMENT_CATALOG", "D0_DOC_CHUNKS"] + rows: + - {layer: "D2_FACT_INDEX", path: "docs/api/actions.md", title: "POST /actions/{action}", content: "Action trigger", metadata: {endpoint: "/actions/{action}", http_method: "post"}} + - id: api-explain-webhook + query: "Объясни endpoint /webhook" + expected_intent: "DOCUMENTATION_EXPLAIN" + expected_sub_intent: "API_METHOD_EXPLAIN" + expected_layers: ["D2_FACT_INDEX", "D4_WORKFLOW_INDEX", "D1_DOCUMENT_CATALOG", "D0_DOC_CHUNKS"] + rows: + - {layer: "D1_DOCUMENT_CATALOG", path: "docs/api/webhook.md", title: "POST /webhook", content: "Webhook"} + + - id: entity-explain-order + query: "Что такое сущность Order?" + expected_intent: "DOCUMENTATION_EXPLAIN" + expected_sub_intent: "ENTITY_EXPLAIN" + expected_layers: ["D3_ENTITY_CATALOG", "D5_RELATION_GRAPH", "D1_DOCUMENT_CATALOG", "D0_DOC_CHUNKS"] + rows: + - {layer: "D3_ENTITY_CATALOG", path: "docs/domain/order.md", title: "Order", content: "Business entity", metadata: {entity: "Order"}} + - id: entity-explain-cart + query: "Как используется Cart?" + expected_intent: "DOCUMENTATION_EXPLAIN" + expected_sub_intent: "ENTITY_EXPLAIN" + expected_layers: ["D3_ENTITY_CATALOG", "D5_RELATION_GRAPH", "D1_DOCUMENT_CATALOG", "D0_DOC_CHUNKS"] + rows: + - {layer: "D3_ENTITY_CATALOG", path: "docs/domain/cart.md", title: "Cart", content: "Shopping cart", metadata: {entity: "Cart"}} + - id: entity-explain-health + query: "Что такое WorkerHealth?" + expected_intent: "DOCUMENTATION_EXPLAIN" + expected_sub_intent: "ENTITY_EXPLAIN" + expected_layers: ["D3_ENTITY_CATALOG", "D5_RELATION_GRAPH", "D1_DOCUMENT_CATALOG", "D0_DOC_CHUNKS"] + rows: + - {layer: "D3_ENTITY_CATALOG", path: "docs/domain/health.md", title: "WorkerHealth", content: "Worker health entity", metadata: {entity: "WorkerHealth"}} + - id: entity-explain-status + query: "Что такое объект WorkerStatus?" + expected_intent: "DOCUMENTATION_EXPLAIN" + expected_sub_intent: "ENTITY_EXPLAIN" + expected_layers: ["D3_ENTITY_CATALOG", "D5_RELATION_GRAPH", "D1_DOCUMENT_CATALOG", "D0_DOC_CHUNKS"] + rows: + - {layer: "D3_ENTITY_CATALOG", path: "docs/domain/status.md", title: "WorkerStatus", content: "Status entity", metadata: {entity: "WorkerStatus"}} + - id: entity-explain-payment + query: "Объясни бизнес-объект Payment" + expected_intent: "DOCUMENTATION_EXPLAIN" + expected_sub_intent: "ENTITY_EXPLAIN" + expected_layers: ["D3_ENTITY_CATALOG", "D5_RELATION_GRAPH", "D1_DOCUMENT_CATALOG", "D0_DOC_CHUNKS"] + rows: + - {layer: "D3_ENTITY_CATALOG", path: "docs/domain/payment.md", title: "Payment", content: "Payment entity", metadata: {entity: "Payment"}} + + - id: related-docs-health + query: "Что связано с endpoint /health?" + expected_intent: "DOCUMENTATION_EXPLAIN" + expected_sub_intent: "RELATED_DOCS_EXPLAIN" + expected_layers: ["D5_RELATION_GRAPH", "D1_DOCUMENT_CATALOG", "D0_DOC_CHUNKS"] + rows: + - {layer: "D5_RELATION_GRAPH", path: "docs/api/health.md", title: "Health relations", content: "Related to runtime health", metadata: {endpoint: "/health"}} + - id: related-docs-order + query: "Какие страницы связаны с Order?" + expected_intent: "DOCUMENTATION_EXPLAIN" + expected_sub_intent: "RELATED_DOCS_EXPLAIN" + expected_layers: ["D5_RELATION_GRAPH", "D1_DOCUMENT_CATALOG", "D0_DOC_CHUNKS"] + rows: + - {layer: "D5_RELATION_GRAPH", path: "docs/domain/order.md", title: "Order relations", content: "Order -> Payment -> Cart", metadata: {entity: "Order"}} + - id: related-docs-billing + query: "Где еще описано billing?" + expected_intent: "DOCUMENTATION_EXPLAIN" + expected_sub_intent: "RELATED_DOCS_EXPLAIN" + expected_layers: ["D5_RELATION_GRAPH", "D1_DOCUMENT_CATALOG", "D0_DOC_CHUNKS"] + rows: + - {layer: "D5_RELATION_GRAPH", path: "docs/components/billing.md", title: "Billing links", content: "See payments and orders"} + - id: related-docs-read-next + query: "Что еще посмотреть по теме control plane?" + expected_intent: "DOCUMENTATION_EXPLAIN" + expected_sub_intent: "RELATED_DOCS_EXPLAIN" + expected_layers: ["D5_RELATION_GRAPH", "D1_DOCUMENT_CATALOG", "D0_DOC_CHUNKS"] + rows: + - {layer: "D5_RELATION_GRAPH", path: "docs/components/control-plane.md", title: "Control plane links", content: "See health and actions docs"} + - id: related-docs-usage + query: "Где еще используется Cart?" + expected_intent: "DOCUMENTATION_EXPLAIN" + expected_sub_intent: "RELATED_DOCS_EXPLAIN" + expected_layers: ["D5_RELATION_GRAPH", "D1_DOCUMENT_CATALOG", "D0_DOC_CHUNKS"] + rows: + - {layer: "D5_RELATION_GRAPH", path: "docs/domain/cart.md", title: "Cart usage", content: "checkout and order docs", metadata: {entity: "Cart"}} + + - id: openapi-method-health + query: "Сгенерируй openapi для /health" + expected_intent: "OPENAPI_GENERATION" + expected_sub_intent: "OPENAPI_METHOD_GENERATE" + expected_layers: ["D1_DOCUMENT_CATALOG", "D2_FACT_INDEX", "D0_DOC_CHUNKS"] + rows: + - {layer: "D2_FACT_INDEX", path: "docs/api/health.md", title: "GET /health", content: "Health API", metadata: {endpoint: "/health", http_method: "get", response_schema: {type: object, properties: {status: {}}}}} + - id: openapi-method-orders + query: "Сделай yaml для метода /orders" + expected_intent: "OPENAPI_GENERATION" + expected_sub_intent: "OPENAPI_METHOD_GENERATE" + expected_layers: ["D1_DOCUMENT_CATALOG", "D2_FACT_INDEX", "D0_DOC_CHUNKS"] + rows: + - {layer: "D2_FACT_INDEX", path: "docs/api/orders.md", title: "POST /orders", content: "Create order", metadata: {endpoint: "/orders", http_method: "post", request_schema: {type: object, properties: {customer_id: {}}}, response_schema: {type: object, properties: {order_id: {}}}}} + - id: openapi-fragment-request + query: "Сгенерируй request schema для /send" + expected_intent: "OPENAPI_GENERATION" + expected_sub_intent: "OPENAPI_FRAGMENT_GENERATE" + expected_layers: ["D1_DOCUMENT_CATALOG", "D2_FACT_INDEX", "D0_DOC_CHUNKS"] + rows: + - {layer: "D2_FACT_INDEX", path: "docs/api/send.md", title: "POST /send", content: "Send API", metadata: {endpoint: "/send", http_method: "post", request_schema: {type: object, properties: {message: {}}}}} + - id: openapi-fragment-response + query: "Сгенерируй response schema для /actions/{action}" + expected_intent: "OPENAPI_GENERATION" + expected_sub_intent: "OPENAPI_FRAGMENT_GENERATE" + expected_layers: ["D1_DOCUMENT_CATALOG", "D2_FACT_INDEX", "D0_DOC_CHUNKS"] + rows: + - {layer: "D2_FACT_INDEX", path: "docs/api/actions.md", title: "POST /actions/{action}", content: "Actions API", metadata: {endpoint: "/actions/{action}", http_method: "post", response_schema: {type: object, properties: {result: {}}}}} + - id: openapi-fragment-parameters + query: "Построй openapi fragment schema parameters для /webhook" + expected_intent: "OPENAPI_GENERATION" + expected_sub_intent: "OPENAPI_FRAGMENT_GENERATE" + expected_layers: ["D1_DOCUMENT_CATALOG", "D2_FACT_INDEX", "D0_DOC_CHUNKS"] + rows: + - {layer: "D2_FACT_INDEX", path: "docs/api/webhook.md", title: "POST /webhook", content: "Webhook API", metadata: {endpoint: "/webhook", http_method: "post", request_schema: {type: object, properties: {event_id: {}}}}} + + - id: general-qa-help + query: "Помоги понять документацию проекта" + expected_intent: "GENERAL_QA" + expected_sub_intent: "GENERIC_QA" + expected_layers: ["D1_DOCUMENT_CATALOG", "D0_DOC_CHUNKS"] + rows: + - {layer: "D1_DOCUMENT_CATALOG", path: "docs/overview.md", title: "Overview", content: "Project overview"} + - id: general-qa-start + query: "С чего начать чтение docs?" + expected_intent: "GENERAL_QA" + expected_sub_intent: "GENERIC_QA" + expected_layers: ["D1_DOCUMENT_CATALOG", "D0_DOC_CHUNKS"] + rows: + - {layer: "D0_DOC_CHUNKS", path: "docs/overview.md", title: "Start here", content: "Read overview first"} + - id: general-qa-ambiguous-entity-component + query: "Расскажи про Order" + expected_intent: "GENERAL_QA" + expected_sub_intent: "GENERIC_QA" + expected_layers: ["D1_DOCUMENT_CATALOG", "D0_DOC_CHUNKS"] + rows: + - {layer: "D1_DOCUMENT_CATALOG", path: "docs/domain/order.md", title: "Order", content: "Order docs"} + - id: general-qa-ambiguous-api-flow + query: "Расскажи как работает отправка" + expected_intent: "GENERAL_QA" + expected_sub_intent: "GENERIC_QA" + expected_layers: ["D1_DOCUMENT_CATALOG", "D0_DOC_CHUNKS"] + rows: + - {layer: "D0_DOC_CHUNKS", path: "docs/api/send.md", title: "Send overview", content: "Send docs"} + - id: general-qa-ambiguous-related + query: "Что тут еще важно?" + expected_intent: "GENERAL_QA" + expected_sub_intent: "GENERIC_QA" + expected_layers: ["D1_DOCUMENT_CATALOG", "D0_DOC_CHUNKS"] + rows: + - {layer: "D1_DOCUMENT_CATALOG", path: "docs/overview.md", title: "Overview", content: "Important sections"} diff --git a/tests/pipeline_setup/README.md b/tests/pipeline_setup/README.md deleted file mode 100644 index 00e56b2..0000000 --- a/tests/pipeline_setup/README.md +++ /dev/null @@ -1,115 +0,0 @@ -# Тесты пайплайна (pipeline_setup) - -Каталог содержит тесты и вспомогательные модули для настройки и проверки пайплайна: intent router → RAG retrieval → LLM. - -## Содержимое - -| Каталог / файл | Назначение | -|----------------|------------| -| **suite_01_synthetic/** | Синтетические тесты на fixture-репозитории и golden-кейсах для CODE_QA. | -| **suite_02_pipeline/** | Интеграционные наборы `router_only`, `router_rag`, `full_chain` и CLI для их запуска. | -| **test_results/** | Результаты прогонов: JSONL и отчёты тестовых пайплайнов, артефакты CODE_QA eval. | -| **utils/** | Общие низкоуровневые утилиты. Сейчас здесь живёт переиспользуемый RAG-индексатор. | - -## Структура наборов - -- `suite_01_synthetic` — fixture-репозиторий `code_qa_repo`, golden-кейсы и evaluation harness. -- `suite_02_pipeline` — интеграционные сценарии `router_only`, `router_rag`, `full_chain` и CLI-скрипты запуска. - -## CLI для pipeline-набора - -Запуск — из **корня проекта (agent)**: - -```bash -# Из каталога agent -python -m tests.pipeline_setup.suite_02_pipeline.cli.<скрипт> [параметры] -``` - -### 1. Индексация репозитория - -Создаёт RAG-сессию и индексирует указанную директорию. Результат — `rag_session_id`, который передаётся в пайплайны с retrieval или full_chain. - -```bash -python -m tests.pipeline_setup.suite_02_pipeline.cli.index_repo --repo-path <путь_к_репо> [--project-id ID] -``` - -| Параметр | Обязательный | Описание | -|----------|--------------|----------| -| `--repo-path` | да | Путь к корню индексируемого репозитория. | -| `--project-id` | нет | Идентификатор проекта для сессии; по умолчанию — имя директории репо. | - -Пример: - -```bash -python -m tests.pipeline_setup.suite_02_pipeline.cli.index_repo --repo-path ./tests/pipeline_setup/suite_01_synthetic/fixtures/code_qa_repo --project-id code_qa_repo -# Вывод: rag_session_id= -``` - -### 2. Пайплайн «только intent router» - -Цепочка: классификация запроса (intent_router_v2), без RAG и LLM. - -```bash -python -m tests.pipeline_setup.suite_02_pipeline.cli.run_router_only [--case-id ID ...] [--verbose] [--test-name PREFIX] -``` - -| Параметр | Описание | -|----------|----------| -| `--case-id` | Запустить только указанные кейсы (можно повторять). | -| `--verbose` | Выводить диагностику по каждому кейсу. | -| `--test-name` | Префикс имени файла с результатами (по умолчанию `cli_router_only`). | - -### 3. Пайплайн «intent router + retrieval» - -Цепочка: intent_router_v2 → RAG retrieval. Требуется предварительная индексация (или `--reindex-repo-path`). - -```bash -# С уже полученным rag_session_id: -python -m tests.pipeline_setup.suite_02_pipeline.cli.run_router_rag --rag-session-id [--case-id ID ...] [--verbose] - -# С индексацией перед прогоном: -python -m tests.pipeline_setup.suite_02_pipeline.cli.run_router_rag --reindex-repo-path <путь_к_репо> [--reindex-project-id ID] [--case-id ID ...] -``` - -| Параметр | Описание | -|----------|----------| -| `--rag-session-id` | UUID RAG-сессии (результат индексации). | -| `--reindex-repo-path` | Индексировать репо перед прогоном и использовать новую сессию. | -| `--reindex-project-id` | project_id для новой сессии при `--reindex-repo-path`. | -| `--case-id` | Запустить только указанные кейсы. | -| `--verbose` | Диагностика по каждому кейсу. | -| `--test-name` | Префикс файла результатов (по умолчанию `cli_router_rag`). | - -Переменная окружения: `RUN_INTENT_PIPELINE_ROUTER_RAG=1` — включить режим router_rag. Обязательна `DATABASE_URL`. - -### 4. Пайплайн «полная цепочка» (router + retrieval + LLM) - -Цепочка: intent_router_v2 → RAG retrieval → ответ LLM (например GigaChat). - -```bash -# С уже полученным rag_session_id: -python -m tests.pipeline_setup.suite_02_pipeline.cli.run_full_chain --rag-session-id [--case-id ID ...] [--verbose] - -# С индексацией перед прогоном: -python -m tests.pipeline_setup.suite_02_pipeline.cli.run_full_chain --reindex-repo-path <путь_к_репо> [--reindex-project-id ID] [--case-id ID ...] -``` - -Параметры — те же, что у `run_router_rag`. Дополнительно: `RUN_INTENT_PIPELINE_FULL_CHAIN=1` и настройки доступа к LLM (см. `.env` и `suite_02_pipeline/pipeline_intent_rag/.env.test`). - -## Запуск через pytest - -- Только intent router (без RAG/LLM): - `pytest tests/pipeline_setup/suite_02_pipeline/pipeline_intent_rag/test_intent_router_only_matrix.py -q` - -- С RAG (нужны `RUN_INTENT_PIPELINE_ROUTER_RAG=1` и БД): - `RUN_INTENT_PIPELINE_ROUTER_RAG=1 pytest -m router_rag tests/pipeline_setup/suite_02_pipeline/pipeline_intent_rag/ -q` - -- Полная цепочка (нужны `RUN_INTENT_PIPELINE_FULL_CHAIN=1`, БД и LLM): - `RUN_INTENT_PIPELINE_FULL_CHAIN=1 pytest -m full_chain tests/pipeline_setup/suite_02_pipeline/pipeline_intent_rag/ -q` - -Подробнее — в `suite_02_pipeline/pipeline_intent_rag/README.md` и `suite_01_synthetic/code_qa_eval/README.md`. - -## Окружение - -- Загрузка env: сначала `suite_02_pipeline/pipeline_intent_rag/.env.test`, затем workspace `.env`. -- Для retrieval и full_chain нужны `DATABASE_URL` и (для full_chain) настройки LLM. diff --git a/tests/pipeline_setup/__init__.py b/tests/pipeline_setup/__init__.py deleted file mode 100644 index e64f894..0000000 --- a/tests/pipeline_setup/__init__.py +++ /dev/null @@ -1 +0,0 @@ -"""Pipeline configuration tests: intent-router → RAG → LLM, CODE_QA eval harness.""" diff --git a/tests/pipeline_setup/conftest.py b/tests/pipeline_setup/conftest.py deleted file mode 100644 index dc2c902..0000000 --- a/tests/pipeline_setup/conftest.py +++ /dev/null @@ -1,5 +0,0 @@ -from __future__ import annotations - -from tests.pipeline_setup.env_loader import load_pipeline_setup_env - -load_pipeline_setup_env(start_dir=__file__) diff --git a/tests/pipeline_setup/suite_01_synthetic/README.md b/tests/pipeline_setup/suite_01_synthetic/README.md deleted file mode 100644 index 6a81655..0000000 --- a/tests/pipeline_setup/suite_01_synthetic/README.md +++ /dev/null @@ -1,63 +0,0 @@ -# Suite 01 Synthetic - -Синтетический набор тестов для проверки CODE_QA на тестовом репозитории: -[fixtures/code_qa_repo](/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup/suite_01_synthetic/fixtures/code_qa_repo). - -## Что входит в suite - -- `fixtures/` — тестовый репозиторий и входные данные -- `golden/` — golden-кейсы -- `code_qa_eval/` — eval harness, который индексирует репозиторий и прогоняет golden-кейсы - -## Запуск тестов - -Из корня проекта: - -```bash -PYTHONPATH=. pytest tests/pipeline_setup/suite_01_synthetic/code_qa_eval/ -q -``` - -Точечный запуск: - -```bash -PYTHONPATH=. pytest tests/pipeline_setup/suite_01_synthetic/code_qa_eval/test_eval_harness.py -q -``` - -## Запуск eval harness - -Из корня проекта: - -```bash -PYTHONPATH=. python -m tests.pipeline_setup.suite_01_synthetic.code_qa_eval.run -``` - -Во время запуска harness: - -- выбирает репозиторий для индексации -- создаёт новый `rag_session_id` -- индексирует репозиторий в RAG -- прогоняет golden-кейсы через CODE_QA pipeline - -## Параметры запуска - -У suite нет собственных CLI-флагов; конфигурация задаётся через переменные окружения: - -- `CODE_QA_REPO_PATH` — путь к локальному репозиторию вместо fixture-репозитория -- `CODE_QA_PROJECT_ID` — `project_id` для создаваемой RAG-сессии; если не задан, берётся имя директории репозитория - -Поведение по умолчанию: - -- если `CODE_QA_REPO_PATH` не задан, используется `fixtures/code_qa_repo` -- для fixture-режима `project_id` фиксирован как `code_qa_repo` -- `rag_session_id` заранее не передаётся, а создаётся автоматически во время индексации - -## Что требуется для запуска - -- рабочий `DATABASE_URL` -- доступные зависимости для RAG и SQLAlchemy - -Артефакты пишутся в: -[test_results/code_qa_eval](/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup/test_results/code_qa_eval) - -Детали harness: -[code_qa_eval/README.md](/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup/suite_01_synthetic/code_qa_eval/README.md) diff --git a/tests/pipeline_setup/suite_01_synthetic/__init__.py b/tests/pipeline_setup/suite_01_synthetic/__init__.py deleted file mode 100644 index e079ad3..0000000 --- a/tests/pipeline_setup/suite_01_synthetic/__init__.py +++ /dev/null @@ -1 +0,0 @@ -"""Synthetic pipeline tests built around fixture repositories and golden cases.""" diff --git a/tests/pipeline_setup/suite_01_synthetic/code_qa_eval/README.md b/tests/pipeline_setup/suite_01_synthetic/code_qa_eval/README.md deleted file mode 100644 index e360c8a..0000000 --- a/tests/pipeline_setup/suite_01_synthetic/code_qa_eval/README.md +++ /dev/null @@ -1,35 +0,0 @@ -# CODE_QA evaluation harness - -Runs the canonical CODE_QA pipeline (IntentRouterV2 → retrieval → evidence gate → diagnostics) over golden cases and writes artifacts for calibration. - -## Modes - -- **Fixture (default):** Uses `tests/pipeline_setup/suite_01_synthetic/fixtures/code_qa_repo`. No env vars required. -- **Local repo:** Set `CODE_QA_REPO_PATH` to a directory; optionally `CODE_QA_PROJECT_ID`. - -## Run - -From the **project root** (agent repo): - -```bash -python -m tests.pipeline_setup.suite_01_synthetic.code_qa_eval.run -``` - -Requires a configured database (same as pipeline_intent_rag router_rag tests). Outputs: - -- `tests/pipeline_setup/test_results/code_qa_eval//*.md` and `*.json` per case -- `tests/pipeline_setup/test_results/code_qa_eval/summary_.md` batch summary - -Exit code 0 if all golden cases pass, 1 otherwise. - -## Golden cases - -Edit `tests/pipeline_setup/suite_01_synthetic/golden/code_qa/cases.yaml` to add or change cases. See `tests/pipeline_setup/suite_01_synthetic/golden/code_qa/README.md` for the field format. - -## Tests - -```bash -pytest tests/pipeline_setup/suite_01_synthetic/code_qa_eval/ -v -``` - -The fixture-mode integration test (`test_run_eval_fixture_mode_structure`) is skipped if the DB or dependencies are not available. diff --git a/tests/pipeline_setup/suite_01_synthetic/code_qa_eval/__init__.py b/tests/pipeline_setup/suite_01_synthetic/code_qa_eval/__init__.py deleted file mode 100644 index c131870..0000000 --- a/tests/pipeline_setup/suite_01_synthetic/code_qa_eval/__init__.py +++ /dev/null @@ -1 +0,0 @@ -"""CODE_QA pipeline calibration: golden runner, diagnostics artifacts, fixture and real-repo support.""" diff --git a/tests/pipeline_setup/suite_01_synthetic/code_qa_eval/artifacts.py b/tests/pipeline_setup/suite_01_synthetic/code_qa_eval/artifacts.py deleted file mode 100644 index 1e174f8..0000000 --- a/tests/pipeline_setup/suite_01_synthetic/code_qa_eval/artifacts.py +++ /dev/null @@ -1,152 +0,0 @@ -"""Write diagnostics artifacts and batch summary for CODE_QA evaluation.""" - -from __future__ import annotations - -import json -from datetime import datetime -from pathlib import Path - -from tests.pipeline_setup.suite_01_synthetic.code_qa_eval.runner import EvalCaseResult - - -def dump_run_artifact( - result: EvalCaseResult, - out_dir: Path, - *, - run_id: str = "", -) -> None: - """Write one run: markdown summary and JSON detail for manual review.""" - out_dir.mkdir(parents=True, exist_ok=True) - prefix = result.case.id - if run_id: - prefix = f"{run_id}_{prefix}" - - md_path = out_dir / f"{prefix}.md" - md_path.write_text(_run_markdown(result), encoding="utf-8") - - json_path = out_dir / f"{prefix}.json" - json_path.write_text( - json.dumps(_run_json(result), ensure_ascii=False, indent=2), - encoding="utf-8", - ) - - -def _run_markdown(result: EvalCaseResult) -> str: - c = result.case - p = result.pipeline_result - dr = p.diagnostics_report - lines = [ - f"# {c.id}", - "", - "## Query", - c.query, - "", - "## Expected", - f"- intent: {c.expected_intent}, sub_intent: {c.expected_sub_intent}", - f"- answer_mode: {c.expected_answer_mode}", - "", - "## Actual", - f"- intent: {p.router_result.intent}, sub_intent: {p.router_result.query_plan.sub_intent if p.router_result.query_plan else '—'}", - f"- answer_mode: {p.answer_mode}", - f"- evidence_gate_passed: {p.evidence_gate_passed}", - f"- evidence_count: {p.evidence_bundle.evidence_count}", - "", - "## Result", - "PASS" if result.passed else "FAIL", - "", - ] - if result.mismatches: - lines.append("## Mismatches") - for m in result.mismatches: - lines.append(f"- {m}") - lines.append("") - lines.extend([ - "## Router", - f"- path_scope: {list(getattr(p.router_result.retrieval_spec.filters, 'path_scope', []) or [])}", - f"- layers: {[q.layer_id for q in (p.router_result.retrieval_spec.layer_queries or [])]}", - "", - "## Retrieval", - f"- requested_layers: {p.retrieval_request.requested_layers}", - f"- chunk_count: {len(p.retrieval_result.code_chunks)}", - f"- layer_outcomes: {[(o.layer_id, o.hit_count) for o in p.retrieval_result.layer_outcomes]}", - "", - "## Evidence gate", - f"- failure_reasons: {dr.failure_reasons if dr else []}", - "", - "## Timings (ms)", - f"{p.timings_ms}", - "", - ]) - return "\n".join(lines) - - -def _run_json(result: EvalCaseResult) -> dict: - c = result.case - p = result.pipeline_result - dr = p.diagnostics_report - return { - "case_id": c.id, - "query": c.query, - "expected": { - "intent": c.expected_intent, - "sub_intent": c.expected_sub_intent, - "answer_mode": c.expected_answer_mode, - }, - "actual": { - "intent": p.router_result.intent, - "sub_intent": p.router_result.query_plan.sub_intent if p.router_result.query_plan else None, - "answer_mode": p.answer_mode, - "evidence_gate_passed": p.evidence_gate_passed, - "evidence_count": p.evidence_bundle.evidence_count, - }, - "passed": result.passed, - "mismatches": result.mismatches, - "router_result": dr.router_result if dr else {}, - "retrieval_request": dr.retrieval_request if dr else {}, - "per_layer_outcome": dr.per_layer_outcome if dr else [], - "failure_reasons": dr.failure_reasons if dr else [], - "timings_ms": p.timings_ms, - } - - -def write_batch_summary( - results: list[EvalCaseResult], - out_dir: Path, - *, - run_id: str = "", -) -> Path: - """Write a single readable batch summary; returns path to the file.""" - out_dir.mkdir(parents=True, exist_ok=True) - passed = sum(1 for r in results if r.passed) - total = len(results) - stamp = run_id or datetime.now().strftime("%Y%m%d_%H%M%S") - path = out_dir / f"summary_{stamp}.md" - lines = [ - "# CODE_QA evaluation summary", - "", - f"**{passed}/{total}** cases passed.", - "", - "| Case ID | Query | Expected scenario | Actual scenario | Target | Evidence | Answer mode | Pass |", - "|---------|-------|------------------|-----------------|--------|----------|-------------|------|", - ] - for r in results: - c = r.case - p = r.pipeline_result - sub = p.router_result.query_plan.sub_intent if p.router_result.query_plan else "—" - target = "—" - if p.evidence_bundle.resolved_target: - target = p.evidence_bundle.resolved_target[:40] + ("…" if len(p.evidence_bundle.resolved_target or "") > 40 else "") - ev = "✓" if p.evidence_gate_passed else "✗" - mode = p.answer_mode - pass_mark = "✓" if r.passed else "✗" - q_short = c.query[:40] + ("…" if len(c.query) > 40 else "") - lines.append( - f"| {c.id} | {q_short} | {c.expected_sub_intent} | {sub} | {target} | {ev} | {mode} | {pass_mark} |" - ) - lines.append("") - lines.append("## Failures") - for r in results: - if not r.passed and r.mismatches: - lines.append(f"- **{r.case.id}**: {'; '.join(r.mismatches)}") - path.write_text("\n".join(lines), encoding="utf-8") - return path diff --git a/tests/pipeline_setup/suite_01_synthetic/code_qa_eval/config.py b/tests/pipeline_setup/suite_01_synthetic/code_qa_eval/config.py deleted file mode 100644 index 806b561..0000000 --- a/tests/pipeline_setup/suite_01_synthetic/code_qa_eval/config.py +++ /dev/null @@ -1,41 +0,0 @@ -"""Eval harness config: fixture vs user-provided repo path, artifact output.""" - -from __future__ import annotations - -import os -from dataclasses import dataclass -from pathlib import Path - - -@dataclass(frozen=True, slots=True) -class EvalConfig: - """Configuration for CODE_QA evaluation runs.""" - - repo_path: Path - test_results_dir: Path - golden_cases_path: Path - project_id: str | None = None - use_fixture: bool = True - - @classmethod - def from_env(cls, project_root: Path | None = None) -> "EvalConfig": - """Build config: fixture repo by default; optional CODE_QA_REPO_PATH for local calibration.""" - root = project_root or Path(__file__).resolve().parent.parent - raw_repo = os.getenv("CODE_QA_REPO_PATH", "").strip() - if raw_repo: - repo_path = Path(raw_repo).expanduser().resolve() - use_fixture = False - project_id = os.getenv("CODE_QA_PROJECT_ID", "").strip() or repo_path.name - else: - repo_path = root / "fixtures" / "code_qa_repo" - use_fixture = True - project_id = "code_qa_repo" - test_results_dir = root / "test_results" / "code_qa_eval" - golden_cases_path = root / "golden" / "code_qa" / "cases.yaml" - return cls( - repo_path=repo_path, - test_results_dir=test_results_dir, - golden_cases_path=golden_cases_path, - project_id=project_id, - use_fixture=use_fixture, - ) diff --git a/tests/pipeline_setup/suite_01_synthetic/code_qa_eval/golden_loader.py b/tests/pipeline_setup/suite_01_synthetic/code_qa_eval/golden_loader.py deleted file mode 100644 index f84aed1..0000000 --- a/tests/pipeline_setup/suite_01_synthetic/code_qa_eval/golden_loader.py +++ /dev/null @@ -1,51 +0,0 @@ -"""Load golden cases from YAML for CODE_QA evaluation.""" - -from __future__ import annotations - -from dataclasses import dataclass, field -from pathlib import Path -from typing import Any - -import yaml - - -@dataclass(slots=True) -class GoldenCase: - """Single golden case for pipeline evaluation.""" - - id: str - query: str - expected_intent: str - expected_sub_intent: str - expected_answer_mode: str = "normal" - expected_target_hint: str | None = None - expected_path_scope_contains: list[str] = field(default_factory=list) - expected_symbol_candidates_contain: list[str] = field(default_factory=list) - expected_layers: list[str] = field(default_factory=list) - notes: str = "" - - -def load_golden_cases(path: Path) -> list[GoldenCase]: - """Load and parse golden cases from YAML. Returns list of GoldenCase.""" - if not path.exists(): - return [] - with path.open(encoding="utf-8") as f: - data = yaml.safe_load(f) or {} - cases_raw = data.get("cases") or [] - out: list[GoldenCase] = [] - for c in cases_raw: - if not isinstance(c, dict) or not c.get("id") or not c.get("query"): - continue - out.append(GoldenCase( - id=str(c["id"]), - query=str(c["query"]), - expected_intent=str(c.get("expected_intent", "CODE_QA")), - expected_sub_intent=str(c.get("expected_sub_intent", "EXPLAIN")), - expected_answer_mode=str(c.get("expected_answer_mode", "normal")), - expected_target_hint=c.get("expected_target_hint"), - expected_path_scope_contains=list(c.get("expected_path_scope_contains") or []), - expected_symbol_candidates_contain=list(c.get("expected_symbol_candidates_contain") or []), - expected_layers=list(c.get("expected_layers") or []), - notes=str(c.get("notes") or ""), - )) - return out diff --git a/tests/pipeline_setup/suite_01_synthetic/code_qa_eval/run.py b/tests/pipeline_setup/suite_01_synthetic/code_qa_eval/run.py deleted file mode 100644 index b01c8d1..0000000 --- a/tests/pipeline_setup/suite_01_synthetic/code_qa_eval/run.py +++ /dev/null @@ -1,111 +0,0 @@ -"""Entrypoint: run CODE_QA golden evaluation and write artifacts + summary.""" - -from __future__ import annotations - -import sys -from datetime import datetime -from pathlib import Path - -_agent_root = Path(__file__).resolve().parents[4] -if str(_agent_root) not in sys.path: - sys.path.insert(0, str(_agent_root)) -_src = _agent_root / "src" -if _src.exists() and str(_src) not in sys.path: - sys.path.insert(0, str(_src)) - -# Load .env from project root so DATABASE_URL is available -from app.modules.shared.env_loader import load_workspace_env - -from tests.pipeline_setup.suite_01_synthetic.code_qa_eval.artifacts import dump_run_artifact, write_batch_summary -from tests.pipeline_setup.suite_01_synthetic.code_qa_eval.config import EvalConfig -from tests.pipeline_setup.suite_01_synthetic.code_qa_eval.runner import run_eval - - -class _TeeStream: - def __init__(self, *streams) -> None: - self._streams = streams - - def write(self, data: str) -> int: - for stream in self._streams: - stream.write(data) - return len(data) - - def flush(self) -> None: - for stream in self._streams: - stream.flush() - - -def _check_db_available() -> bool: - """Try to connect to the database; return False if unavailable.""" - try: - from sqlalchemy import text - from app.modules.shared.db import get_engine - with get_engine().connect() as conn: - conn.execute(text("SELECT 1")) - return True - except Exception: - return False - - -def main() -> None: - # Workspace root (agent repo) for .env; pipeline_setup root for fixtures/golden/test_results - workspace_root = Path(__file__).resolve().parents[3] - pipeline_root = Path(__file__).resolve().parents[1] - load_workspace_env(workspace_root) - config = EvalConfig.from_env(project_root=pipeline_root) - run_id = datetime.now().strftime("%Y%m%d_%H%M%S") - results_run_dir = config.test_results_dir / run_id - results_run_dir.mkdir(parents=True, exist_ok=True) - console_log_path = results_run_dir / "console_output.txt" - - original_stdout = sys.stdout - original_stderr = sys.stderr - with console_log_path.open("w", encoding="utf-8") as log_file: - sys.stdout = _TeeStream(original_stdout, log_file) - sys.stderr = _TeeStream(original_stderr, log_file) - try: - _run_with_logging(config, results_run_dir, run_id) - finally: - sys.stdout.flush() - sys.stderr.flush() - sys.stdout = original_stdout - sys.stderr = original_stderr - - -def _run_with_logging(config: EvalConfig, results_run_dir: Path, run_id: str) -> None: - print(f"Console log: {results_run_dir / 'console_output.txt'}") - - if not config.repo_path.exists(): - print(f"Repo path not found: {config.repo_path}", file=sys.stderr) - sys.exit(1) - if not config.golden_cases_path.exists(): - print(f"Golden cases not found: {config.golden_cases_path}", file=sys.stderr) - sys.exit(1) - - if not _check_db_available(): - print( - "Database is not available. Evaluation requires a running PostgreSQL instance.\n" - "Set DATABASE_URL (e.g. postgresql+psycopg://user:pass@localhost:5432/db) or start the DB (e.g. docker-compose up -d db).", - file=sys.stderr, - ) - sys.exit(1) - - print(f"Running evaluation: repo={config.repo_path}, fixture={config.use_fixture}") - print(f"Results: {results_run_dir}") - - results = run_eval(config) - for r in results: - dump_run_artifact(r, results_run_dir, run_id=run_id) - - summary_path = write_batch_summary(results, config.test_results_dir, run_id=run_id) - passed = sum(1 for r in results if r.passed) - total = len(results) - print(f"\n{passed}/{total} cases passed. Summary: {summary_path}") - for r in results: - if not r.passed: - print(f" FAIL {r.case.id}: {'; '.join(r.mismatches)}") - sys.exit(0 if passed == total else 1) - - -if __name__ == "__main__": - main() diff --git a/tests/pipeline_setup/suite_01_synthetic/code_qa_eval/runner.py b/tests/pipeline_setup/suite_01_synthetic/code_qa_eval/runner.py deleted file mode 100644 index c1c331a..0000000 --- a/tests/pipeline_setup/suite_01_synthetic/code_qa_eval/runner.py +++ /dev/null @@ -1,102 +0,0 @@ -"""Run golden cases through CodeQAPipelineRunner and compare to expected.""" - -from __future__ import annotations - -from dataclasses import dataclass, field -from pathlib import Path - -from app.modules.agent.runtime.legacy_pipeline import CodeQAPipelineResult, CodeQAPipelineRunner -from app.modules.rag.contracts.enums import RagLayer -from app.modules.agent.intent_router_v2 import ConversationState, IntentRouterV2, RepoContext - -from tests.pipeline_setup.suite_01_synthetic.code_qa_eval.config import EvalConfig -from tests.pipeline_setup.suite_01_synthetic.code_qa_eval.golden_loader import GoldenCase, load_golden_cases - - -@dataclass(slots=True) -class EvalCaseResult: - """Result of evaluating one golden case.""" - - case: GoldenCase - pipeline_result: CodeQAPipelineResult - passed: bool - mismatches: list[str] = field(default_factory=list) - - -def _repo_context() -> RepoContext: - return RepoContext( - languages=["python"], - available_domains=["CODE", "DOCS"], - available_layers=[ - RagLayer.CODE_ENTRYPOINTS, - RagLayer.CODE_SYMBOL_CATALOG, - RagLayer.CODE_DEPENDENCY_GRAPH, - RagLayer.CODE_SEMANTIC_ROLES, - RagLayer.CODE_SOURCE_CHUNKS, - RagLayer.DOCS_MODULE_CATALOG, - RagLayer.DOCS_FACT_INDEX, - RagLayer.DOCS_SECTION_INDEX, - RagLayer.DOCS_POLICY_INDEX, - ], - ) - - -def run_eval(config: EvalConfig) -> list[EvalCaseResult]: - """Index repo, run all golden cases through the pipeline, compare to expected. Returns list of EvalCaseResult.""" - from app.modules.rag.persistence.repository import RagRepository - from tests.pipeline_setup.suite_02_pipeline.pipeline_intent_rag.helpers.rag_db_adapter import RagDbAdapter, SessionEmbeddingDimensions - from tests.pipeline_setup.utils.rag_indexer import RagSessionIndexer - - repo = RagRepository() - repo.ensure_tables() - indexer = RagSessionIndexer(repo) - rag_session_id = indexer.index_repo(config.repo_path, project_id=config.project_id) - - adapter = RagDbAdapter(repository=repo, dim_resolver=SessionEmbeddingDimensions()) - router = IntentRouterV2() - runner = CodeQAPipelineRunner( - router=router, - retrieval_adapter=adapter, - repo_context=_repo_context(), - ) - - cases = load_golden_cases(config.golden_cases_path) - - results: list[EvalCaseResult] = [] - for case in cases: - pipeline_result = runner.run(case.query, rag_session_id, run_retrieval=True, run_hydrate=True) - passed, mismatches = _compare(case, pipeline_result) - results.append(EvalCaseResult(case=case, pipeline_result=pipeline_result, passed=passed, mismatches=mismatches)) - return results - - -def _compare(case: GoldenCase, result: CodeQAPipelineResult) -> tuple[bool, list[str]]: - mismatches: list[str] = [] - rr = result.router_result - sub_intent = (rr.query_plan.sub_intent if rr.query_plan else None) or "" - - if rr.intent != case.expected_intent: - mismatches.append(f"intent: expected {case.expected_intent}, got {rr.intent}") - if sub_intent != case.expected_sub_intent: - mismatches.append(f"sub_intent: expected {case.expected_sub_intent}, got {sub_intent}") - if result.answer_mode != case.expected_answer_mode: - mismatches.append(f"answer_mode: expected {case.expected_answer_mode}, got {result.answer_mode}") - - if case.expected_path_scope_contains: - path_scope = list(getattr(rr.retrieval_spec.filters, "path_scope", []) or []) - for want in case.expected_path_scope_contains: - if not any(want in p for p in path_scope): - mismatches.append(f"path_scope should contain '{want}', got {path_scope}") - if case.expected_symbol_candidates_contain: - candidates = list(rr.query_plan.symbol_candidates or []) if rr.query_plan else [] - for want in case.expected_symbol_candidates_contain: - if want not in candidates: - mismatches.append(f"symbol_candidates should contain '{want}', got {candidates}") - if case.expected_layers: - layers = [str(q.layer_id) for q in (rr.retrieval_spec.layer_queries or [])] - for want in case.expected_layers: - if want not in layers: - mismatches.append(f"layers should include '{want}', got {layers}") - - passed = len(mismatches) == 0 - return passed, mismatches diff --git a/tests/pipeline_setup/suite_01_synthetic/code_qa_eval/test_eval_harness.py b/tests/pipeline_setup/suite_01_synthetic/code_qa_eval/test_eval_harness.py deleted file mode 100644 index f6cc68f..0000000 --- a/tests/pipeline_setup/suite_01_synthetic/code_qa_eval/test_eval_harness.py +++ /dev/null @@ -1,185 +0,0 @@ -"""Tests for CODE_QA evaluation harness: golden loader, compare logic, fixture-mode run.""" - -from __future__ import annotations - -from pathlib import Path - -import pytest - -from app.modules.agent.runtime.legacy_pipeline import CodeQAPipelineResult -from app.modules.agent.intent_router_v2.models import ( - CodeRetrievalFilters, - EvidencePolicy, - IntentRouterResult, - QueryPlan, - RetrievalSpec, - SymbolResolution, -) - -from tests.pipeline_setup.suite_01_synthetic.code_qa_eval.config import EvalConfig -from tests.pipeline_setup.suite_01_synthetic.code_qa_eval.golden_loader import GoldenCase, load_golden_cases -from tests.pipeline_setup.suite_01_synthetic.code_qa_eval.runner import EvalCaseResult, _compare, run_eval - -_TEST_ROOT = Path(__file__).resolve().parent.parent - - -def test_load_golden_cases_returns_list() -> None: - path = _TEST_ROOT / "golden" / "code_qa" / "cases.yaml" - if not path.exists(): - pytest.skip("Golden cases file not found") - cases = load_golden_cases(path) - assert isinstance(cases, list) - assert len(cases) >= 1 - c = cases[0] - assert c.id - assert c.query - assert c.expected_intent in ("CODE_QA", "DOCS_QA") - assert c.expected_sub_intent in ("OPEN_FILE", "EXPLAIN", "FIND_TESTS", "FIND_ENTRYPOINTS", "GENERAL_QA") - assert c.expected_answer_mode in ("normal", "degraded", "insufficient") - - -def test_compare_passed_when_all_match() -> None: - case = GoldenCase( - id="test", - query="Open app/main.py", - expected_intent="CODE_QA", - expected_sub_intent="OPEN_FILE", - expected_answer_mode="normal", - ) - result = _make_pipeline_result(intent="CODE_QA", sub_intent="OPEN_FILE", answer_mode="normal") - passed, mismatches = _compare(case, result) - assert passed is True - assert len(mismatches) == 0 - - -def test_compare_fails_on_intent_mismatch() -> None: - case = GoldenCase( - id="test", - query="Open app/main.py", - expected_intent="CODE_QA", - expected_sub_intent="OPEN_FILE", - expected_answer_mode="normal", - ) - result = _make_pipeline_result(intent="DOCS_QA", sub_intent="OPEN_FILE", answer_mode="normal") - passed, mismatches = _compare(case, result) - assert passed is False - assert any("intent" in m for m in mismatches) - - -def test_compare_fails_on_answer_mode_mismatch() -> None: - case = GoldenCase( - id="test", - query="Explain NonExistent", - expected_intent="CODE_QA", - expected_sub_intent="EXPLAIN", - expected_answer_mode="degraded", - ) - result = _make_pipeline_result(intent="CODE_QA", sub_intent="EXPLAIN", answer_mode="normal") - passed, mismatches = _compare(case, result) - assert passed is False - assert any("answer_mode" in m for m in mismatches) - - -def test_compare_path_scope_contains() -> None: - case = GoldenCase( - id="test", - query="Open app/main.py", - expected_intent="CODE_QA", - expected_sub_intent="OPEN_FILE", - expected_path_scope_contains=["app/main.py"], - ) - result = _make_pipeline_result( - intent="CODE_QA", - sub_intent="OPEN_FILE", - path_scope=["app/main.py"], - ) - passed, _ = _compare(case, result) - assert passed - case_bad = GoldenCase( - id="test2", - query="Open other", - expected_intent="CODE_QA", - expected_sub_intent="OPEN_FILE", - expected_path_scope_contains=["app/main.py"], - ) - result_bad = _make_pipeline_result(intent="CODE_QA", sub_intent="OPEN_FILE", path_scope=[]) - passed_bad, mismatches_bad = _compare(case_bad, result_bad) - assert not passed_bad - assert any("path_scope" in m for m in mismatches_bad) - - -def test_eval_config_fixture_mode_by_default() -> None: - config = EvalConfig.from_env(project_root=_TEST_ROOT) - assert config.use_fixture is True - assert "code_qa_repo" in str(config.repo_path) - assert config.repo_path == _TEST_ROOT / "fixtures" / "code_qa_repo" - assert config.golden_cases_path == _TEST_ROOT / "golden" / "code_qa" / "cases.yaml" - assert config.test_results_dir == _TEST_ROOT / "test_results" / "code_qa_eval" - - -def test_run_eval_fixture_mode_structure() -> None: - """Run full eval on fixture repo; validates harness path. Skips if DB/deps unavailable.""" - config = EvalConfig.from_env(project_root=_TEST_ROOT) - if not config.repo_path.exists(): - pytest.skip("Fixture repo not found") - if not config.golden_cases_path.exists(): - pytest.skip("Golden cases not found") - try: - results = run_eval(config) - except Exception as e: - msg = str(e).lower() - if ( - "connect" in msg - or "database" in msg - or "engine" in msg - or "modulenotfounderror" in msg - or "sqlalchemy" in msg - ): - pytest.skip(f"DB or dependencies not available: {e}") - raise - assert isinstance(results, list) - assert len(results) >= 1 - for r in results: - assert isinstance(r, EvalCaseResult) - assert r.case is not None - assert r.pipeline_result is not None - assert isinstance(r.passed, bool) - assert isinstance(r.mismatches, list) - - -def _make_pipeline_result( - *, - intent: str = "CODE_QA", - sub_intent: str = "EXPLAIN", - answer_mode: str = "normal", - path_scope: list[str] | None = None, -) -> CodeQAPipelineResult: - from app.modules.agent.runtime.steps.context import EvidenceBundle, RetrievalRequest, RetrievalResult - - filters = CodeRetrievalFilters(path_scope=path_scope or []) - router_result = IntentRouterResult( - intent=intent, - graph_id="CodeQAGraph", - retrieval_profile="code", - conversation_mode="START", - query_plan=QueryPlan(raw="", normalized="", sub_intent=sub_intent), - retrieval_spec=RetrievalSpec(filters=filters), - symbol_resolution=SymbolResolution(), - evidence_policy=EvidencePolicy(), - ) - req = RetrievalRequest(rag_session_id="", query="", sub_intent=sub_intent, path_scope=path_scope or []) - res = RetrievalResult() - bundle = EvidenceBundle(resolved_sub_intent=sub_intent, evidence_count=1) - return CodeQAPipelineResult( - user_query="", - rag_session_id="", - router_result=router_result, - retrieval_request=req, - retrieval_result=res, - evidence_bundle=bundle, - evidence_gate_passed=(answer_mode == "normal"), - answer_synthesis_input=None, - diagnostics_report=None, - answer_mode=answer_mode, - timings_ms={}, - ) diff --git a/tests/pipeline_setup/suite_01_synthetic/golden/code_qa/README.md b/tests/pipeline_setup/suite_01_synthetic/golden/code_qa/README.md deleted file mode 100644 index d774488..0000000 --- a/tests/pipeline_setup/suite_01_synthetic/golden/code_qa/README.md +++ /dev/null @@ -1,13 +0,0 @@ -# Golden cases for CODE_QA pipeline calibration - -Each case defines: -- `id`: unique case id -- `query`: user query text -- `expected_intent`: CODE_QA (or DOCS_QA for docs-only; this set is code-only) -- `expected_sub_intent`: OPEN_FILE | EXPLAIN | FIND_TESTS | FIND_ENTRYPOINTS | GENERAL_QA -- `expected_answer_mode`: normal | degraded | insufficient -- `expected_target_hint`: optional — path (for OPEN_FILE), symbol (for EXPLAIN), or test-like -- `expected_layers`: optional — list of layer ids we expect in the retrieval plan -- `notes`: optional — borderline, negative, or calibration hint - -We assert routing, retrieval alignment, evidence sufficiency, and answer mode — not exact LLM wording. diff --git a/tests/pipeline_setup/suite_01_synthetic/golden/code_qa/cases.yaml b/tests/pipeline_setup/suite_01_synthetic/golden/code_qa/cases.yaml deleted file mode 100644 index a09304d..0000000 --- a/tests/pipeline_setup/suite_01_synthetic/golden/code_qa/cases.yaml +++ /dev/null @@ -1,142 +0,0 @@ -# Golden cases for CODE_QA pipeline (fixture repo: code_qa_repo) -# Scenarios: OPEN_FILE, EXPLAIN, FIND_TESTS, FIND_ENTRYPOINTS, GENERAL_QA - -cases: - # --- OPEN_FILE --- - - id: open_file_main_positive - query: "Открой файл main.py" - expected_intent: CODE_QA - expected_sub_intent: OPEN_FILE - expected_answer_mode: normal - expected_target_hint: path - expected_path_scope_contains: ["main.py"] - notes: "Clear path; fixture has main.py (src layout)" - - - id: open_file_api_positive - query: "Покажи src/order_app/api/orders.py" - expected_intent: CODE_QA - expected_sub_intent: OPEN_FILE - expected_answer_mode: normal - expected_path_scope_contains: ["src/order_app/api/orders.py"] - notes: "Handler module (src layout)" - - - id: open_file_borderline - query: "Open main" - expected_intent: CODE_QA - expected_sub_intent: OPEN_FILE - expected_answer_mode: normal - notes: "Short path hint; may resolve to main.py" - - - id: open_file_negative - query: "Открой файл nonexistent/foo.py" - expected_intent: CODE_QA - expected_sub_intent: OPEN_FILE - expected_answer_mode: degraded - notes: "Path not in repo; evidence gate should fail or degrade" - - # --- EXPLAIN --- - - id: explain_order_positive - query: "Объясни класс Order" - expected_intent: CODE_QA - expected_sub_intent: EXPLAIN - expected_answer_mode: normal - expected_target_hint: symbol - expected_symbol_candidates_contain: ["Order"] - notes: "Domain class in fixture" - - - id: explain_order_service_positive - query: "Как работает OrderService?" - expected_intent: CODE_QA - expected_sub_intent: EXPLAIN - expected_answer_mode: normal - expected_symbol_candidates_contain: ["OrderService"] - notes: "Service layer" - - - id: explain_borderline - query: "Что делает create_order?" - expected_intent: CODE_QA - expected_sub_intent: EXPLAIN - expected_answer_mode: normal - notes: "Function name; may resolve" - - - id: explain_negative - query: "Объясни класс NonExistentClass" - expected_intent: CODE_QA - expected_sub_intent: EXPLAIN - expected_answer_mode: degraded - notes: "Symbol not in repo" - - # --- FIND_TESTS --- - - id: find_tests_positive - query: "Где тесты для OrderService?" - expected_intent: CODE_QA - expected_sub_intent: FIND_TESTS - expected_answer_mode: normal - expected_target_hint: test-like - expected_symbol_candidates_contain: ["OrderService"] - notes: "Fixture has tests/test_order_service.py" - - - id: find_tests_order_positive - query: "Найди тесты для Order" - expected_intent: CODE_QA - expected_sub_intent: FIND_TESTS - expected_answer_mode: normal - notes: "Tests reference Order" - - - id: find_tests_borderline - query: "Есть ли тесты на репозиторий?" - expected_intent: CODE_QA - expected_sub_intent: FIND_TESTS - expected_answer_mode: normal - notes: "Vague target" - - - id: find_tests_negative - query: "Где тесты для NonExistent?" - expected_intent: CODE_QA - expected_sub_intent: FIND_TESTS - expected_answer_mode: degraded - notes: "Target not in repo" - - # --- FIND_ENTRYPOINTS --- - - id: find_entrypoints_positive - query: "Какие точки входа в приложение?" - expected_intent: CODE_QA - expected_sub_intent: FIND_ENTRYPOINTS - expected_answer_mode: normal - notes: "Fixture has main.py entrypoint (src layout)" - - - id: find_entrypoints_english - query: "Find application entrypoints" - expected_intent: CODE_QA - expected_sub_intent: FIND_ENTRYPOINTS - expected_answer_mode: normal - notes: "English variant" - - - id: find_entrypoints_borderline - query: "Где main?" - expected_intent: CODE_QA - expected_sub_intent: FIND_ENTRYPOINTS - expected_answer_mode: normal - notes: "Short; may route to entrypoints or OPEN_FILE" - - # --- GENERAL_QA --- - - id: general_qa_positive - query: "Что делает этот проект?" - expected_intent: CODE_QA - expected_sub_intent: GENERAL_QA - expected_answer_mode: normal - notes: "Broad question; bounded context" - - - id: general_qa_how - query: "How does order creation work?" - expected_intent: CODE_QA - expected_sub_intent: GENERAL_QA - expected_answer_mode: normal - notes: "General flow question" - - - id: general_qa_borderline - query: "Расскажи про код" - expected_intent: CODE_QA - expected_sub_intent: GENERAL_QA - expected_answer_mode: normal - notes: "Very vague; fallback to GENERAL_QA" diff --git a/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_232925/20260311_232925_explain_borderline.json b/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_232925/20260311_232925_explain_borderline.json deleted file mode 100644 index 7262a5c..0000000 --- a/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_232925/20260311_232925_explain_borderline.json +++ /dev/null @@ -1,79 +0,0 @@ -{ - "case_id": "explain_borderline", - "query": "Что делает create_order?", - "expected": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "answer_mode": "normal" - }, - "actual": { - "intent": "PROJECT_MISC", - "sub_intent": "EXPLAIN", - "answer_mode": "normal", - "evidence_gate_passed": true, - "evidence_count": 5 - }, - "passed": false, - "mismatches": [ - "intent: expected CODE_QA, got PROJECT_MISC" - ], - "router_result": { - "intent": "PROJECT_MISC", - "graph_id": "ProjectMiscGraph", - "conversation_mode": "START", - "retrieval_profile": "code", - "sub_intent": "EXPLAIN", - "path_scope": [], - "layers": [ - "D1_MODULE_CATALOG", - "D3_SECTION_INDEX", - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS" - ], - "symbol_resolution_status": "pending" - }, - "retrieval_request": { - "rag_session_id": "b3c7ec39-40a7-40e5-8ba5-fc0e2e3cc63c", - "query": "Что делает create_order?", - "sub_intent": "EXPLAIN", - "path_scope": [], - "requested_layers": [ - "D1_MODULE_CATALOG", - "D3_SECTION_INDEX", - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS" - ] - }, - "per_layer_outcome": [ - { - "layer_id": "D1_MODULE_CATALOG", - "hit_count": 0, - "empty": true, - "fallback_used": false - }, - { - "layer_id": "D3_SECTION_INDEX", - "hit_count": 0, - "empty": true, - "fallback_used": false - }, - { - "layer_id": "C1_SYMBOL_CATALOG", - "hit_count": 1, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C0_SOURCE_CHUNKS", - "hit_count": 4, - "empty": false, - "fallback_used": false - } - ], - "failure_reasons": [], - "timings_ms": { - "router": 0, - "retrieval_total": 31, - "symbol_resolution": 0 - } -} \ No newline at end of file diff --git a/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_232925/20260311_232925_explain_borderline.md b/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_232925/20260311_232925_explain_borderline.md deleted file mode 100644 index c244db7..0000000 --- a/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_232925/20260311_232925_explain_borderline.md +++ /dev/null @@ -1,35 +0,0 @@ -# explain_borderline - -## Query -Что делает create_order? - -## Expected -- intent: CODE_QA, sub_intent: EXPLAIN -- answer_mode: normal - -## Actual -- intent: PROJECT_MISC, sub_intent: EXPLAIN -- answer_mode: normal -- evidence_gate_passed: True -- evidence_count: 5 - -## Result -FAIL - -## Mismatches -- intent: expected CODE_QA, got PROJECT_MISC - -## Router -- path_scope: [] -- layers: ['D1_MODULE_CATALOG', 'D3_SECTION_INDEX', 'C1_SYMBOL_CATALOG', 'C0_SOURCE_CHUNKS'] - -## Retrieval -- requested_layers: ['D1_MODULE_CATALOG', 'D3_SECTION_INDEX', 'C1_SYMBOL_CATALOG', 'C0_SOURCE_CHUNKS'] -- chunk_count: 5 -- layer_outcomes: [('D1_MODULE_CATALOG', 0), ('D3_SECTION_INDEX', 0), ('C1_SYMBOL_CATALOG', 1), ('C0_SOURCE_CHUNKS', 4)] - -## Evidence gate -- failure_reasons: [] - -## Timings (ms) -{'router': 0, 'retrieval_total': 31, 'symbol_resolution': 0} diff --git a/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_232925/20260311_232925_explain_negative.json b/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_232925/20260311_232925_explain_negative.json deleted file mode 100644 index b9cfa56..0000000 --- a/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_232925/20260311_232925_explain_negative.json +++ /dev/null @@ -1,87 +0,0 @@ -{ - "case_id": "explain_negative", - "query": "Объясни класс NonExistentClass", - "expected": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "answer_mode": "degraded" - }, - "actual": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "answer_mode": "normal", - "evidence_gate_passed": true, - "evidence_count": 21 - }, - "passed": false, - "mismatches": [ - "answer_mode: expected degraded, got normal" - ], - "router_result": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "retrieval_profile": "code", - "sub_intent": "EXPLAIN", - "path_scope": [], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "symbol_resolution_status": "pending" - }, - "retrieval_request": { - "rag_session_id": "b3c7ec39-40a7-40e5-8ba5-fc0e2e3cc63c", - "query": "Объясни класс NonExistentClass", - "sub_intent": "EXPLAIN", - "path_scope": [], - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "per_layer_outcome": [ - { - "layer_id": "C1_SYMBOL_CATALOG", - "hit_count": 0, - "empty": true, - "fallback_used": false - }, - { - "layer_id": "C0_SOURCE_CHUNKS", - "hit_count": 8, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C4_SEMANTIC_ROLES", - "hit_count": 3, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C2_DEPENDENCY_GRAPH", - "hit_count": 6, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C3_ENTRYPOINTS", - "hit_count": 4, - "empty": false, - "fallback_used": false - } - ], - "failure_reasons": [], - "timings_ms": { - "router": 0, - "retrieval_total": 46, - "symbol_resolution": 0 - } -} \ No newline at end of file diff --git a/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_232925/20260311_232925_explain_negative.md b/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_232925/20260311_232925_explain_negative.md deleted file mode 100644 index f0f9684..0000000 --- a/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_232925/20260311_232925_explain_negative.md +++ /dev/null @@ -1,35 +0,0 @@ -# explain_negative - -## Query -Объясни класс NonExistentClass - -## Expected -- intent: CODE_QA, sub_intent: EXPLAIN -- answer_mode: degraded - -## Actual -- intent: CODE_QA, sub_intent: EXPLAIN -- answer_mode: normal -- evidence_gate_passed: True -- evidence_count: 21 - -## Result -FAIL - -## Mismatches -- answer_mode: expected degraded, got normal - -## Router -- path_scope: [] -- layers: ['C1_SYMBOL_CATALOG', 'C0_SOURCE_CHUNKS', 'C4_SEMANTIC_ROLES', 'C2_DEPENDENCY_GRAPH', 'C3_ENTRYPOINTS'] - -## Retrieval -- requested_layers: ['C1_SYMBOL_CATALOG', 'C0_SOURCE_CHUNKS', 'C4_SEMANTIC_ROLES', 'C2_DEPENDENCY_GRAPH', 'C3_ENTRYPOINTS'] -- chunk_count: 21 -- layer_outcomes: [('C1_SYMBOL_CATALOG', 0), ('C0_SOURCE_CHUNKS', 8), ('C4_SEMANTIC_ROLES', 3), ('C2_DEPENDENCY_GRAPH', 6), ('C3_ENTRYPOINTS', 4)] - -## Evidence gate -- failure_reasons: [] - -## Timings (ms) -{'router': 0, 'retrieval_total': 46, 'symbol_resolution': 0} diff --git a/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_232925/20260311_232925_explain_order_positive.json b/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_232925/20260311_232925_explain_order_positive.json deleted file mode 100644 index c32cf39..0000000 --- a/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_232925/20260311_232925_explain_order_positive.json +++ /dev/null @@ -1,61 +0,0 @@ -{ - "case_id": "explain_order_positive", - "query": "Объясни класс Order", - "expected": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "answer_mode": "normal" - }, - "actual": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "answer_mode": "normal", - "evidence_gate_passed": true, - "evidence_count": 15 - }, - "passed": true, - "mismatches": [], - "router_result": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "retrieval_profile": "code", - "sub_intent": "EXPLAIN", - "path_scope": [], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "symbol_resolution_status": "pending" - }, - "retrieval_request": { - "rag_session_id": "b3c7ec39-40a7-40e5-8ba5-fc0e2e3cc63c", - "query": "Объясни класс Order", - "sub_intent": "EXPLAIN", - "path_scope": [], - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "per_layer_outcome": [ - { - "layer_id": "C0_SOURCE_CHUNKS", - "hit_count": 1, - "empty": false, - "fallback_used": false - } - ], - "failure_reasons": [], - "timings_ms": { - "router": 0, - "retrieval_total": 43, - "symbol_resolution": 0 - } -} \ No newline at end of file diff --git a/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_232925/20260311_232925_explain_order_positive.md b/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_232925/20260311_232925_explain_order_positive.md deleted file mode 100644 index 6be7f41..0000000 --- a/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_232925/20260311_232925_explain_order_positive.md +++ /dev/null @@ -1,32 +0,0 @@ -# explain_order_positive - -## Query -Объясни класс Order - -## Expected -- intent: CODE_QA, sub_intent: EXPLAIN -- answer_mode: normal - -## Actual -- intent: CODE_QA, sub_intent: EXPLAIN -- answer_mode: normal -- evidence_gate_passed: True -- evidence_count: 15 - -## Result -PASS - -## Router -- path_scope: [] -- layers: ['C1_SYMBOL_CATALOG', 'C0_SOURCE_CHUNKS', 'C4_SEMANTIC_ROLES', 'C2_DEPENDENCY_GRAPH', 'C3_ENTRYPOINTS'] - -## Retrieval -- requested_layers: ['C1_SYMBOL_CATALOG', 'C0_SOURCE_CHUNKS', 'C4_SEMANTIC_ROLES', 'C2_DEPENDENCY_GRAPH', 'C3_ENTRYPOINTS'] -- chunk_count: 15 -- layer_outcomes: [('C0_SOURCE_CHUNKS', 1)] - -## Evidence gate -- failure_reasons: [] - -## Timings (ms) -{'router': 0, 'retrieval_total': 43, 'symbol_resolution': 0} diff --git a/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_232925/20260311_232925_explain_order_service_positive.json b/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_232925/20260311_232925_explain_order_service_positive.json deleted file mode 100644 index 2dd0f8f..0000000 --- a/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_232925/20260311_232925_explain_order_service_positive.json +++ /dev/null @@ -1,61 +0,0 @@ -{ - "case_id": "explain_order_service_positive", - "query": "Как работает OrderService?", - "expected": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "answer_mode": "normal" - }, - "actual": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "answer_mode": "normal", - "evidence_gate_passed": true, - "evidence_count": 15 - }, - "passed": true, - "mismatches": [], - "router_result": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "retrieval_profile": "code", - "sub_intent": "EXPLAIN", - "path_scope": [], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "symbol_resolution_status": "pending" - }, - "retrieval_request": { - "rag_session_id": "b3c7ec39-40a7-40e5-8ba5-fc0e2e3cc63c", - "query": "Как работает OrderService?", - "sub_intent": "EXPLAIN", - "path_scope": [], - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "per_layer_outcome": [ - { - "layer_id": "C0_SOURCE_CHUNKS", - "hit_count": 1, - "empty": false, - "fallback_used": false - } - ], - "failure_reasons": [], - "timings_ms": { - "router": 0, - "retrieval_total": 44, - "symbol_resolution": 0 - } -} \ No newline at end of file diff --git a/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_232925/20260311_232925_explain_order_service_positive.md b/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_232925/20260311_232925_explain_order_service_positive.md deleted file mode 100644 index 0541568..0000000 --- a/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_232925/20260311_232925_explain_order_service_positive.md +++ /dev/null @@ -1,32 +0,0 @@ -# explain_order_service_positive - -## Query -Как работает OrderService? - -## Expected -- intent: CODE_QA, sub_intent: EXPLAIN -- answer_mode: normal - -## Actual -- intent: CODE_QA, sub_intent: EXPLAIN -- answer_mode: normal -- evidence_gate_passed: True -- evidence_count: 15 - -## Result -PASS - -## Router -- path_scope: [] -- layers: ['C1_SYMBOL_CATALOG', 'C0_SOURCE_CHUNKS', 'C4_SEMANTIC_ROLES', 'C2_DEPENDENCY_GRAPH', 'C3_ENTRYPOINTS'] - -## Retrieval -- requested_layers: ['C1_SYMBOL_CATALOG', 'C0_SOURCE_CHUNKS', 'C4_SEMANTIC_ROLES', 'C2_DEPENDENCY_GRAPH', 'C3_ENTRYPOINTS'] -- chunk_count: 15 -- layer_outcomes: [('C0_SOURCE_CHUNKS', 1)] - -## Evidence gate -- failure_reasons: [] - -## Timings (ms) -{'router': 0, 'retrieval_total': 44, 'symbol_resolution': 0} diff --git a/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_232925/20260311_232925_find_entrypoints_borderline.json b/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_232925/20260311_232925_find_entrypoints_borderline.json deleted file mode 100644 index 071a756..0000000 --- a/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_232925/20260311_232925_find_entrypoints_borderline.json +++ /dev/null @@ -1,82 +0,0 @@ -{ - "case_id": "find_entrypoints_borderline", - "query": "Где main?", - "expected": { - "intent": "CODE_QA", - "sub_intent": "FIND_ENTRYPOINTS", - "answer_mode": "normal" - }, - "actual": { - "intent": "PROJECT_MISC", - "sub_intent": "FIND_ENTRYPOINTS", - "answer_mode": "degraded", - "evidence_gate_passed": false, - "evidence_count": 6 - }, - "passed": false, - "mismatches": [ - "intent: expected CODE_QA, got PROJECT_MISC", - "answer_mode: expected normal, got degraded" - ], - "router_result": { - "intent": "PROJECT_MISC", - "graph_id": "ProjectMiscGraph", - "conversation_mode": "START", - "retrieval_profile": "code", - "sub_intent": "FIND_ENTRYPOINTS", - "path_scope": [], - "layers": [ - "D1_MODULE_CATALOG", - "D3_SECTION_INDEX", - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS" - ], - "symbol_resolution_status": "pending" - }, - "retrieval_request": { - "rag_session_id": "b3c7ec39-40a7-40e5-8ba5-fc0e2e3cc63c", - "query": "Где main?", - "sub_intent": "FIND_ENTRYPOINTS", - "path_scope": [], - "requested_layers": [ - "D1_MODULE_CATALOG", - "D3_SECTION_INDEX", - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS" - ] - }, - "per_layer_outcome": [ - { - "layer_id": "D1_MODULE_CATALOG", - "hit_count": 0, - "empty": true, - "fallback_used": true - }, - { - "layer_id": "D3_SECTION_INDEX", - "hit_count": 0, - "empty": true, - "fallback_used": true - }, - { - "layer_id": "C1_SYMBOL_CATALOG", - "hit_count": 2, - "empty": false, - "fallback_used": true - }, - { - "layer_id": "C0_SOURCE_CHUNKS", - "hit_count": 4, - "empty": false, - "fallback_used": true - } - ], - "failure_reasons": [ - "entrypoints_not_found" - ], - "timings_ms": { - "router": 0, - "retrieval_total": 51, - "symbol_resolution": 0 - } -} \ No newline at end of file diff --git a/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_232925/20260311_232925_find_entrypoints_borderline.md b/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_232925/20260311_232925_find_entrypoints_borderline.md deleted file mode 100644 index a9395b4..0000000 --- a/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_232925/20260311_232925_find_entrypoints_borderline.md +++ /dev/null @@ -1,36 +0,0 @@ -# find_entrypoints_borderline - -## Query -Где main? - -## Expected -- intent: CODE_QA, sub_intent: FIND_ENTRYPOINTS -- answer_mode: normal - -## Actual -- intent: PROJECT_MISC, sub_intent: FIND_ENTRYPOINTS -- answer_mode: degraded -- evidence_gate_passed: False -- evidence_count: 6 - -## Result -FAIL - -## Mismatches -- intent: expected CODE_QA, got PROJECT_MISC -- answer_mode: expected normal, got degraded - -## Router -- path_scope: [] -- layers: ['D1_MODULE_CATALOG', 'D3_SECTION_INDEX', 'C1_SYMBOL_CATALOG', 'C0_SOURCE_CHUNKS'] - -## Retrieval -- requested_layers: ['D1_MODULE_CATALOG', 'D3_SECTION_INDEX', 'C1_SYMBOL_CATALOG', 'C0_SOURCE_CHUNKS'] -- chunk_count: 6 -- layer_outcomes: [('D1_MODULE_CATALOG', 0), ('D3_SECTION_INDEX', 0), ('C1_SYMBOL_CATALOG', 2), ('C0_SOURCE_CHUNKS', 4)] - -## Evidence gate -- failure_reasons: ['entrypoints_not_found'] - -## Timings (ms) -{'router': 0, 'retrieval_total': 51, 'symbol_resolution': 0} diff --git a/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_232925/20260311_232925_find_entrypoints_english.json b/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_232925/20260311_232925_find_entrypoints_english.json deleted file mode 100644 index 3dfeb36..0000000 --- a/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_232925/20260311_232925_find_entrypoints_english.json +++ /dev/null @@ -1,61 +0,0 @@ -{ - "case_id": "find_entrypoints_english", - "query": "Find application entrypoints", - "expected": { - "intent": "CODE_QA", - "sub_intent": "FIND_ENTRYPOINTS", - "answer_mode": "normal" - }, - "actual": { - "intent": "CODE_QA", - "sub_intent": "FIND_ENTRYPOINTS", - "answer_mode": "normal", - "evidence_gate_passed": true, - "evidence_count": 10 - }, - "passed": true, - "mismatches": [], - "router_result": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "retrieval_profile": "code", - "sub_intent": "FIND_ENTRYPOINTS", - "path_scope": [], - "layers": [ - "C3_ENTRYPOINTS", - "C0_SOURCE_CHUNKS" - ], - "symbol_resolution_status": "pending" - }, - "retrieval_request": { - "rag_session_id": "b3c7ec39-40a7-40e5-8ba5-fc0e2e3cc63c", - "query": "Find application entrypoints", - "sub_intent": "FIND_ENTRYPOINTS", - "path_scope": [], - "requested_layers": [ - "C3_ENTRYPOINTS", - "C0_SOURCE_CHUNKS" - ] - }, - "per_layer_outcome": [ - { - "layer_id": "C3_ENTRYPOINTS", - "hit_count": 4, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C0_SOURCE_CHUNKS", - "hit_count": 6, - "empty": false, - "fallback_used": false - } - ], - "failure_reasons": [], - "timings_ms": { - "router": 0, - "retrieval_total": 19, - "symbol_resolution": 0 - } -} \ No newline at end of file diff --git a/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_232925/20260311_232925_find_entrypoints_english.md b/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_232925/20260311_232925_find_entrypoints_english.md deleted file mode 100644 index ad2595f..0000000 --- a/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_232925/20260311_232925_find_entrypoints_english.md +++ /dev/null @@ -1,32 +0,0 @@ -# find_entrypoints_english - -## Query -Find application entrypoints - -## Expected -- intent: CODE_QA, sub_intent: FIND_ENTRYPOINTS -- answer_mode: normal - -## Actual -- intent: CODE_QA, sub_intent: FIND_ENTRYPOINTS -- answer_mode: normal -- evidence_gate_passed: True -- evidence_count: 10 - -## Result -PASS - -## Router -- path_scope: [] -- layers: ['C3_ENTRYPOINTS', 'C0_SOURCE_CHUNKS'] - -## Retrieval -- requested_layers: ['C3_ENTRYPOINTS', 'C0_SOURCE_CHUNKS'] -- chunk_count: 10 -- layer_outcomes: [('C3_ENTRYPOINTS', 4), ('C0_SOURCE_CHUNKS', 6)] - -## Evidence gate -- failure_reasons: [] - -## Timings (ms) -{'router': 0, 'retrieval_total': 19, 'symbol_resolution': 0} diff --git a/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_232925/20260311_232925_find_entrypoints_positive.json b/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_232925/20260311_232925_find_entrypoints_positive.json deleted file mode 100644 index 56d426e..0000000 --- a/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_232925/20260311_232925_find_entrypoints_positive.json +++ /dev/null @@ -1,82 +0,0 @@ -{ - "case_id": "find_entrypoints_positive", - "query": "Какие точки входа в приложение?", - "expected": { - "intent": "CODE_QA", - "sub_intent": "FIND_ENTRYPOINTS", - "answer_mode": "normal" - }, - "actual": { - "intent": "PROJECT_MISC", - "sub_intent": "FIND_ENTRYPOINTS", - "answer_mode": "degraded", - "evidence_gate_passed": false, - "evidence_count": 8 - }, - "passed": false, - "mismatches": [ - "intent: expected CODE_QA, got PROJECT_MISC", - "answer_mode: expected normal, got degraded" - ], - "router_result": { - "intent": "PROJECT_MISC", - "graph_id": "ProjectMiscGraph", - "conversation_mode": "START", - "retrieval_profile": "code", - "sub_intent": "FIND_ENTRYPOINTS", - "path_scope": [], - "layers": [ - "D1_MODULE_CATALOG", - "D3_SECTION_INDEX", - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS" - ], - "symbol_resolution_status": "not_requested" - }, - "retrieval_request": { - "rag_session_id": "b3c7ec39-40a7-40e5-8ba5-fc0e2e3cc63c", - "query": "Какие точки входа в приложение?", - "sub_intent": "FIND_ENTRYPOINTS", - "path_scope": [], - "requested_layers": [ - "D1_MODULE_CATALOG", - "D3_SECTION_INDEX", - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS" - ] - }, - "per_layer_outcome": [ - { - "layer_id": "D1_MODULE_CATALOG", - "hit_count": 0, - "empty": true, - "fallback_used": true - }, - { - "layer_id": "D3_SECTION_INDEX", - "hit_count": 0, - "empty": true, - "fallback_used": true - }, - { - "layer_id": "C1_SYMBOL_CATALOG", - "hit_count": 4, - "empty": false, - "fallback_used": true - }, - { - "layer_id": "C0_SOURCE_CHUNKS", - "hit_count": 4, - "empty": false, - "fallback_used": true - } - ], - "failure_reasons": [ - "entrypoints_not_found" - ], - "timings_ms": { - "router": 0, - "retrieval_total": 52, - "symbol_resolution": 0 - } -} \ No newline at end of file diff --git a/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_232925/20260311_232925_find_entrypoints_positive.md b/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_232925/20260311_232925_find_entrypoints_positive.md deleted file mode 100644 index 3fac954..0000000 --- a/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_232925/20260311_232925_find_entrypoints_positive.md +++ /dev/null @@ -1,36 +0,0 @@ -# find_entrypoints_positive - -## Query -Какие точки входа в приложение? - -## Expected -- intent: CODE_QA, sub_intent: FIND_ENTRYPOINTS -- answer_mode: normal - -## Actual -- intent: PROJECT_MISC, sub_intent: FIND_ENTRYPOINTS -- answer_mode: degraded -- evidence_gate_passed: False -- evidence_count: 8 - -## Result -FAIL - -## Mismatches -- intent: expected CODE_QA, got PROJECT_MISC -- answer_mode: expected normal, got degraded - -## Router -- path_scope: [] -- layers: ['D1_MODULE_CATALOG', 'D3_SECTION_INDEX', 'C1_SYMBOL_CATALOG', 'C0_SOURCE_CHUNKS'] - -## Retrieval -- requested_layers: ['D1_MODULE_CATALOG', 'D3_SECTION_INDEX', 'C1_SYMBOL_CATALOG', 'C0_SOURCE_CHUNKS'] -- chunk_count: 8 -- layer_outcomes: [('D1_MODULE_CATALOG', 0), ('D3_SECTION_INDEX', 0), ('C1_SYMBOL_CATALOG', 4), ('C0_SOURCE_CHUNKS', 4)] - -## Evidence gate -- failure_reasons: ['entrypoints_not_found'] - -## Timings (ms) -{'router': 0, 'retrieval_total': 52, 'symbol_resolution': 0} diff --git a/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_232925/20260311_232925_find_tests_borderline.json b/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_232925/20260311_232925_find_tests_borderline.json deleted file mode 100644 index 1a34bcd..0000000 --- a/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_232925/20260311_232925_find_tests_borderline.json +++ /dev/null @@ -1,69 +0,0 @@ -{ - "case_id": "find_tests_borderline", - "query": "Есть ли тесты на репозиторий?", - "expected": { - "intent": "CODE_QA", - "sub_intent": "FIND_TESTS", - "answer_mode": "normal" - }, - "actual": { - "intent": "CODE_QA", - "sub_intent": "FIND_TESTS", - "answer_mode": "normal", - "evidence_gate_passed": true, - "evidence_count": 16 - }, - "passed": true, - "mismatches": [], - "router_result": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "retrieval_profile": "code", - "sub_intent": "FIND_TESTS", - "path_scope": [], - "layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ], - "symbol_resolution_status": "not_requested" - }, - "retrieval_request": { - "rag_session_id": "b3c7ec39-40a7-40e5-8ba5-fc0e2e3cc63c", - "query": "Есть ли тесты на репозиторий?", - "sub_intent": "FIND_TESTS", - "path_scope": [], - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ] - }, - "per_layer_outcome": [ - { - "layer_id": "C1_SYMBOL_CATALOG", - "hit_count": 8, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C2_DEPENDENCY_GRAPH", - "hit_count": 6, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C0_SOURCE_CHUNKS", - "hit_count": 2, - "empty": false, - "fallback_used": false - } - ], - "failure_reasons": [], - "timings_ms": { - "router": 0, - "retrieval_total": 24, - "symbol_resolution": 0 - } -} \ No newline at end of file diff --git a/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_232925/20260311_232925_find_tests_borderline.md b/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_232925/20260311_232925_find_tests_borderline.md deleted file mode 100644 index efc2cb9..0000000 --- a/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_232925/20260311_232925_find_tests_borderline.md +++ /dev/null @@ -1,32 +0,0 @@ -# find_tests_borderline - -## Query -Есть ли тесты на репозиторий? - -## Expected -- intent: CODE_QA, sub_intent: FIND_TESTS -- answer_mode: normal - -## Actual -- intent: CODE_QA, sub_intent: FIND_TESTS -- answer_mode: normal -- evidence_gate_passed: True -- evidence_count: 16 - -## Result -PASS - -## Router -- path_scope: [] -- layers: ['C1_SYMBOL_CATALOG', 'C2_DEPENDENCY_GRAPH', 'C0_SOURCE_CHUNKS'] - -## Retrieval -- requested_layers: ['C1_SYMBOL_CATALOG', 'C2_DEPENDENCY_GRAPH', 'C0_SOURCE_CHUNKS'] -- chunk_count: 16 -- layer_outcomes: [('C1_SYMBOL_CATALOG', 8), ('C2_DEPENDENCY_GRAPH', 6), ('C0_SOURCE_CHUNKS', 2)] - -## Evidence gate -- failure_reasons: [] - -## Timings (ms) -{'router': 0, 'retrieval_total': 24, 'symbol_resolution': 0} diff --git a/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_232925/20260311_232925_find_tests_negative.json b/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_232925/20260311_232925_find_tests_negative.json deleted file mode 100644 index 02e852d..0000000 --- a/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_232925/20260311_232925_find_tests_negative.json +++ /dev/null @@ -1,71 +0,0 @@ -{ - "case_id": "find_tests_negative", - "query": "Где тесты для NonExistent?", - "expected": { - "intent": "CODE_QA", - "sub_intent": "FIND_TESTS", - "answer_mode": "degraded" - }, - "actual": { - "intent": "CODE_QA", - "sub_intent": "FIND_TESTS", - "answer_mode": "normal", - "evidence_gate_passed": true, - "evidence_count": 8 - }, - "passed": false, - "mismatches": [ - "answer_mode: expected degraded, got normal" - ], - "router_result": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "retrieval_profile": "code", - "sub_intent": "FIND_TESTS", - "path_scope": [], - "layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ], - "symbol_resolution_status": "pending" - }, - "retrieval_request": { - "rag_session_id": "b3c7ec39-40a7-40e5-8ba5-fc0e2e3cc63c", - "query": "Где тесты для NonExistent?", - "sub_intent": "FIND_TESTS", - "path_scope": [], - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ] - }, - "per_layer_outcome": [ - { - "layer_id": "C1_SYMBOL_CATALOG", - "hit_count": 0, - "empty": true, - "fallback_used": true - }, - { - "layer_id": "C2_DEPENDENCY_GRAPH", - "hit_count": 6, - "empty": false, - "fallback_used": true - }, - { - "layer_id": "C0_SOURCE_CHUNKS", - "hit_count": 2, - "empty": false, - "fallback_used": true - } - ], - "failure_reasons": [], - "timings_ms": { - "router": 0, - "retrieval_total": 32, - "symbol_resolution": 0 - } -} \ No newline at end of file diff --git a/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_232925/20260311_232925_find_tests_negative.md b/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_232925/20260311_232925_find_tests_negative.md deleted file mode 100644 index 48525c4..0000000 --- a/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_232925/20260311_232925_find_tests_negative.md +++ /dev/null @@ -1,35 +0,0 @@ -# find_tests_negative - -## Query -Где тесты для NonExistent? - -## Expected -- intent: CODE_QA, sub_intent: FIND_TESTS -- answer_mode: degraded - -## Actual -- intent: CODE_QA, sub_intent: FIND_TESTS -- answer_mode: normal -- evidence_gate_passed: True -- evidence_count: 8 - -## Result -FAIL - -## Mismatches -- answer_mode: expected degraded, got normal - -## Router -- path_scope: [] -- layers: ['C1_SYMBOL_CATALOG', 'C2_DEPENDENCY_GRAPH', 'C0_SOURCE_CHUNKS'] - -## Retrieval -- requested_layers: ['C1_SYMBOL_CATALOG', 'C2_DEPENDENCY_GRAPH', 'C0_SOURCE_CHUNKS'] -- chunk_count: 8 -- layer_outcomes: [('C1_SYMBOL_CATALOG', 0), ('C2_DEPENDENCY_GRAPH', 6), ('C0_SOURCE_CHUNKS', 2)] - -## Evidence gate -- failure_reasons: [] - -## Timings (ms) -{'router': 0, 'retrieval_total': 32, 'symbol_resolution': 0} diff --git a/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_232925/20260311_232925_find_tests_order_positive.json b/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_232925/20260311_232925_find_tests_order_positive.json deleted file mode 100644 index 8843f56..0000000 --- a/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_232925/20260311_232925_find_tests_order_positive.json +++ /dev/null @@ -1,69 +0,0 @@ -{ - "case_id": "find_tests_order_positive", - "query": "Найди тесты для Order", - "expected": { - "intent": "CODE_QA", - "sub_intent": "FIND_TESTS", - "answer_mode": "normal" - }, - "actual": { - "intent": "CODE_QA", - "sub_intent": "FIND_TESTS", - "answer_mode": "normal", - "evidence_gate_passed": true, - "evidence_count": 8 - }, - "passed": true, - "mismatches": [], - "router_result": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "retrieval_profile": "code", - "sub_intent": "FIND_TESTS", - "path_scope": [], - "layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ], - "symbol_resolution_status": "pending" - }, - "retrieval_request": { - "rag_session_id": "b3c7ec39-40a7-40e5-8ba5-fc0e2e3cc63c", - "query": "Найди тесты для Order", - "sub_intent": "FIND_TESTS", - "path_scope": [], - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ] - }, - "per_layer_outcome": [ - { - "layer_id": "C1_SYMBOL_CATALOG", - "hit_count": 0, - "empty": true, - "fallback_used": true - }, - { - "layer_id": "C2_DEPENDENCY_GRAPH", - "hit_count": 6, - "empty": false, - "fallback_used": true - }, - { - "layer_id": "C0_SOURCE_CHUNKS", - "hit_count": 2, - "empty": false, - "fallback_used": true - } - ], - "failure_reasons": [], - "timings_ms": { - "router": 0, - "retrieval_total": 32, - "symbol_resolution": 0 - } -} \ No newline at end of file diff --git a/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_232925/20260311_232925_find_tests_order_positive.md b/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_232925/20260311_232925_find_tests_order_positive.md deleted file mode 100644 index f587400..0000000 --- a/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_232925/20260311_232925_find_tests_order_positive.md +++ /dev/null @@ -1,32 +0,0 @@ -# find_tests_order_positive - -## Query -Найди тесты для Order - -## Expected -- intent: CODE_QA, sub_intent: FIND_TESTS -- answer_mode: normal - -## Actual -- intent: CODE_QA, sub_intent: FIND_TESTS -- answer_mode: normal -- evidence_gate_passed: True -- evidence_count: 8 - -## Result -PASS - -## Router -- path_scope: [] -- layers: ['C1_SYMBOL_CATALOG', 'C2_DEPENDENCY_GRAPH', 'C0_SOURCE_CHUNKS'] - -## Retrieval -- requested_layers: ['C1_SYMBOL_CATALOG', 'C2_DEPENDENCY_GRAPH', 'C0_SOURCE_CHUNKS'] -- chunk_count: 8 -- layer_outcomes: [('C1_SYMBOL_CATALOG', 0), ('C2_DEPENDENCY_GRAPH', 6), ('C0_SOURCE_CHUNKS', 2)] - -## Evidence gate -- failure_reasons: [] - -## Timings (ms) -{'router': 0, 'retrieval_total': 32, 'symbol_resolution': 0} diff --git a/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_232925/20260311_232925_find_tests_positive.json b/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_232925/20260311_232925_find_tests_positive.json deleted file mode 100644 index 19796e4..0000000 --- a/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_232925/20260311_232925_find_tests_positive.json +++ /dev/null @@ -1,69 +0,0 @@ -{ - "case_id": "find_tests_positive", - "query": "Где тесты для OrderService?", - "expected": { - "intent": "CODE_QA", - "sub_intent": "FIND_TESTS", - "answer_mode": "normal" - }, - "actual": { - "intent": "CODE_QA", - "sub_intent": "FIND_TESTS", - "answer_mode": "normal", - "evidence_gate_passed": true, - "evidence_count": 8 - }, - "passed": true, - "mismatches": [], - "router_result": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "retrieval_profile": "code", - "sub_intent": "FIND_TESTS", - "path_scope": [], - "layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ], - "symbol_resolution_status": "pending" - }, - "retrieval_request": { - "rag_session_id": "b3c7ec39-40a7-40e5-8ba5-fc0e2e3cc63c", - "query": "Где тесты для OrderService?", - "sub_intent": "FIND_TESTS", - "path_scope": [], - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ] - }, - "per_layer_outcome": [ - { - "layer_id": "C1_SYMBOL_CATALOG", - "hit_count": 0, - "empty": true, - "fallback_used": true - }, - { - "layer_id": "C2_DEPENDENCY_GRAPH", - "hit_count": 6, - "empty": false, - "fallback_used": true - }, - { - "layer_id": "C0_SOURCE_CHUNKS", - "hit_count": 2, - "empty": false, - "fallback_used": true - } - ], - "failure_reasons": [], - "timings_ms": { - "router": 0, - "retrieval_total": 34, - "symbol_resolution": 0 - } -} \ No newline at end of file diff --git a/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_232925/20260311_232925_find_tests_positive.md b/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_232925/20260311_232925_find_tests_positive.md deleted file mode 100644 index c4f89dc..0000000 --- a/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_232925/20260311_232925_find_tests_positive.md +++ /dev/null @@ -1,32 +0,0 @@ -# find_tests_positive - -## Query -Где тесты для OrderService? - -## Expected -- intent: CODE_QA, sub_intent: FIND_TESTS -- answer_mode: normal - -## Actual -- intent: CODE_QA, sub_intent: FIND_TESTS -- answer_mode: normal -- evidence_gate_passed: True -- evidence_count: 8 - -## Result -PASS - -## Router -- path_scope: [] -- layers: ['C1_SYMBOL_CATALOG', 'C2_DEPENDENCY_GRAPH', 'C0_SOURCE_CHUNKS'] - -## Retrieval -- requested_layers: ['C1_SYMBOL_CATALOG', 'C2_DEPENDENCY_GRAPH', 'C0_SOURCE_CHUNKS'] -- chunk_count: 8 -- layer_outcomes: [('C1_SYMBOL_CATALOG', 0), ('C2_DEPENDENCY_GRAPH', 6), ('C0_SOURCE_CHUNKS', 2)] - -## Evidence gate -- failure_reasons: [] - -## Timings (ms) -{'router': 0, 'retrieval_total': 34, 'symbol_resolution': 0} diff --git a/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_232925/20260311_232925_general_qa_borderline.json b/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_232925/20260311_232925_general_qa_borderline.json deleted file mode 100644 index d445af6..0000000 --- a/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_232925/20260311_232925_general_qa_borderline.json +++ /dev/null @@ -1,87 +0,0 @@ -{ - "case_id": "general_qa_borderline", - "query": "Расскажи про код", - "expected": { - "intent": "CODE_QA", - "sub_intent": "GENERAL_QA", - "answer_mode": "normal" - }, - "actual": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "answer_mode": "normal", - "evidence_gate_passed": true, - "evidence_count": 29 - }, - "passed": false, - "mismatches": [ - "sub_intent: expected GENERAL_QA, got EXPLAIN" - ], - "router_result": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "retrieval_profile": "code", - "sub_intent": "EXPLAIN", - "path_scope": [], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "symbol_resolution_status": "not_requested" - }, - "retrieval_request": { - "rag_session_id": "b3c7ec39-40a7-40e5-8ba5-fc0e2e3cc63c", - "query": "Расскажи про код", - "sub_intent": "EXPLAIN", - "path_scope": [], - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "per_layer_outcome": [ - { - "layer_id": "C1_SYMBOL_CATALOG", - "hit_count": 8, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C0_SOURCE_CHUNKS", - "hit_count": 8, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C4_SEMANTIC_ROLES", - "hit_count": 3, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C2_DEPENDENCY_GRAPH", - "hit_count": 6, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C3_ENTRYPOINTS", - "hit_count": 4, - "empty": false, - "fallback_used": false - } - ], - "failure_reasons": [], - "timings_ms": { - "router": 0, - "retrieval_total": 39, - "symbol_resolution": 0 - } -} \ No newline at end of file diff --git a/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_232925/20260311_232925_general_qa_borderline.md b/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_232925/20260311_232925_general_qa_borderline.md deleted file mode 100644 index 4b24bde..0000000 --- a/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_232925/20260311_232925_general_qa_borderline.md +++ /dev/null @@ -1,35 +0,0 @@ -# general_qa_borderline - -## Query -Расскажи про код - -## Expected -- intent: CODE_QA, sub_intent: GENERAL_QA -- answer_mode: normal - -## Actual -- intent: CODE_QA, sub_intent: EXPLAIN -- answer_mode: normal -- evidence_gate_passed: True -- evidence_count: 29 - -## Result -FAIL - -## Mismatches -- sub_intent: expected GENERAL_QA, got EXPLAIN - -## Router -- path_scope: [] -- layers: ['C1_SYMBOL_CATALOG', 'C0_SOURCE_CHUNKS', 'C4_SEMANTIC_ROLES', 'C2_DEPENDENCY_GRAPH', 'C3_ENTRYPOINTS'] - -## Retrieval -- requested_layers: ['C1_SYMBOL_CATALOG', 'C0_SOURCE_CHUNKS', 'C4_SEMANTIC_ROLES', 'C2_DEPENDENCY_GRAPH', 'C3_ENTRYPOINTS'] -- chunk_count: 29 -- layer_outcomes: [('C1_SYMBOL_CATALOG', 8), ('C0_SOURCE_CHUNKS', 8), ('C4_SEMANTIC_ROLES', 3), ('C2_DEPENDENCY_GRAPH', 6), ('C3_ENTRYPOINTS', 4)] - -## Evidence gate -- failure_reasons: [] - -## Timings (ms) -{'router': 0, 'retrieval_total': 39, 'symbol_resolution': 0} diff --git a/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_232925/20260311_232925_general_qa_how.json b/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_232925/20260311_232925_general_qa_how.json deleted file mode 100644 index 0d73bb8..0000000 --- a/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_232925/20260311_232925_general_qa_how.json +++ /dev/null @@ -1,87 +0,0 @@ -{ - "case_id": "general_qa_how", - "query": "How does order creation work?", - "expected": { - "intent": "CODE_QA", - "sub_intent": "GENERAL_QA", - "answer_mode": "normal" - }, - "actual": { - "intent": "CODE_QA", - "sub_intent": "ARCHITECTURE", - "answer_mode": "normal", - "evidence_gate_passed": true, - "evidence_count": 20 - }, - "passed": false, - "mismatches": [ - "sub_intent: expected GENERAL_QA, got ARCHITECTURE" - ], - "router_result": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "retrieval_profile": "code", - "sub_intent": "ARCHITECTURE", - "path_scope": [], - "layers": [ - "C4_SEMANTIC_ROLES", - "C3_ENTRYPOINTS", - "C2_DEPENDENCY_GRAPH", - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS" - ], - "symbol_resolution_status": "pending" - }, - "retrieval_request": { - "rag_session_id": "b3c7ec39-40a7-40e5-8ba5-fc0e2e3cc63c", - "query": "How does order creation work?", - "sub_intent": "ARCHITECTURE", - "path_scope": [], - "requested_layers": [ - "C4_SEMANTIC_ROLES", - "C3_ENTRYPOINTS", - "C2_DEPENDENCY_GRAPH", - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS" - ] - }, - "per_layer_outcome": [ - { - "layer_id": "C4_SEMANTIC_ROLES", - "hit_count": 3, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C3_ENTRYPOINTS", - "hit_count": 4, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C2_DEPENDENCY_GRAPH", - "hit_count": 8, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C1_SYMBOL_CATALOG", - "hit_count": 1, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C0_SOURCE_CHUNKS", - "hit_count": 4, - "empty": false, - "fallback_used": false - } - ], - "failure_reasons": [], - "timings_ms": { - "router": 0, - "retrieval_total": 42, - "symbol_resolution": 0 - } -} \ No newline at end of file diff --git a/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_232925/20260311_232925_general_qa_how.md b/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_232925/20260311_232925_general_qa_how.md deleted file mode 100644 index 403254c..0000000 --- a/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_232925/20260311_232925_general_qa_how.md +++ /dev/null @@ -1,35 +0,0 @@ -# general_qa_how - -## Query -How does order creation work? - -## Expected -- intent: CODE_QA, sub_intent: GENERAL_QA -- answer_mode: normal - -## Actual -- intent: CODE_QA, sub_intent: ARCHITECTURE -- answer_mode: normal -- evidence_gate_passed: True -- evidence_count: 20 - -## Result -FAIL - -## Mismatches -- sub_intent: expected GENERAL_QA, got ARCHITECTURE - -## Router -- path_scope: [] -- layers: ['C4_SEMANTIC_ROLES', 'C3_ENTRYPOINTS', 'C2_DEPENDENCY_GRAPH', 'C1_SYMBOL_CATALOG', 'C0_SOURCE_CHUNKS'] - -## Retrieval -- requested_layers: ['C4_SEMANTIC_ROLES', 'C3_ENTRYPOINTS', 'C2_DEPENDENCY_GRAPH', 'C1_SYMBOL_CATALOG', 'C0_SOURCE_CHUNKS'] -- chunk_count: 20 -- layer_outcomes: [('C4_SEMANTIC_ROLES', 3), ('C3_ENTRYPOINTS', 4), ('C2_DEPENDENCY_GRAPH', 8), ('C1_SYMBOL_CATALOG', 1), ('C0_SOURCE_CHUNKS', 4)] - -## Evidence gate -- failure_reasons: [] - -## Timings (ms) -{'router': 0, 'retrieval_total': 42, 'symbol_resolution': 0} diff --git a/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_232925/20260311_232925_general_qa_positive.json b/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_232925/20260311_232925_general_qa_positive.json deleted file mode 100644 index 65c5d1c..0000000 --- a/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_232925/20260311_232925_general_qa_positive.json +++ /dev/null @@ -1,80 +0,0 @@ -{ - "case_id": "general_qa_positive", - "query": "Что делает этот проект?", - "expected": { - "intent": "CODE_QA", - "sub_intent": "GENERAL_QA", - "answer_mode": "normal" - }, - "actual": { - "intent": "PROJECT_MISC", - "sub_intent": "EXPLAIN", - "answer_mode": "normal", - "evidence_gate_passed": true, - "evidence_count": 8 - }, - "passed": false, - "mismatches": [ - "intent: expected CODE_QA, got PROJECT_MISC", - "sub_intent: expected GENERAL_QA, got EXPLAIN" - ], - "router_result": { - "intent": "PROJECT_MISC", - "graph_id": "ProjectMiscGraph", - "conversation_mode": "START", - "retrieval_profile": "code", - "sub_intent": "EXPLAIN", - "path_scope": [], - "layers": [ - "D1_MODULE_CATALOG", - "D3_SECTION_INDEX", - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS" - ], - "symbol_resolution_status": "not_requested" - }, - "retrieval_request": { - "rag_session_id": "b3c7ec39-40a7-40e5-8ba5-fc0e2e3cc63c", - "query": "Что делает этот проект?", - "sub_intent": "EXPLAIN", - "path_scope": [], - "requested_layers": [ - "D1_MODULE_CATALOG", - "D3_SECTION_INDEX", - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS" - ] - }, - "per_layer_outcome": [ - { - "layer_id": "D1_MODULE_CATALOG", - "hit_count": 0, - "empty": true, - "fallback_used": true - }, - { - "layer_id": "D3_SECTION_INDEX", - "hit_count": 0, - "empty": true, - "fallback_used": true - }, - { - "layer_id": "C1_SYMBOL_CATALOG", - "hit_count": 4, - "empty": false, - "fallback_used": true - }, - { - "layer_id": "C0_SOURCE_CHUNKS", - "hit_count": 4, - "empty": false, - "fallback_used": true - } - ], - "failure_reasons": [], - "timings_ms": { - "router": 0, - "retrieval_total": 56, - "symbol_resolution": 0 - } -} \ No newline at end of file diff --git a/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_232925/20260311_232925_general_qa_positive.md b/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_232925/20260311_232925_general_qa_positive.md deleted file mode 100644 index 5f61adf..0000000 --- a/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_232925/20260311_232925_general_qa_positive.md +++ /dev/null @@ -1,36 +0,0 @@ -# general_qa_positive - -## Query -Что делает этот проект? - -## Expected -- intent: CODE_QA, sub_intent: GENERAL_QA -- answer_mode: normal - -## Actual -- intent: PROJECT_MISC, sub_intent: EXPLAIN -- answer_mode: normal -- evidence_gate_passed: True -- evidence_count: 8 - -## Result -FAIL - -## Mismatches -- intent: expected CODE_QA, got PROJECT_MISC -- sub_intent: expected GENERAL_QA, got EXPLAIN - -## Router -- path_scope: [] -- layers: ['D1_MODULE_CATALOG', 'D3_SECTION_INDEX', 'C1_SYMBOL_CATALOG', 'C0_SOURCE_CHUNKS'] - -## Retrieval -- requested_layers: ['D1_MODULE_CATALOG', 'D3_SECTION_INDEX', 'C1_SYMBOL_CATALOG', 'C0_SOURCE_CHUNKS'] -- chunk_count: 8 -- layer_outcomes: [('D1_MODULE_CATALOG', 0), ('D3_SECTION_INDEX', 0), ('C1_SYMBOL_CATALOG', 4), ('C0_SOURCE_CHUNKS', 4)] - -## Evidence gate -- failure_reasons: [] - -## Timings (ms) -{'router': 0, 'retrieval_total': 56, 'symbol_resolution': 0} diff --git a/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_232925/20260311_232925_open_file_api_positive.json b/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_232925/20260311_232925_open_file_api_positive.json deleted file mode 100644 index 5cd9623..0000000 --- a/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_232925/20260311_232925_open_file_api_positive.json +++ /dev/null @@ -1,57 +0,0 @@ -{ - "case_id": "open_file_api_positive", - "query": "Покажи src/order_app/api/orders.py", - "expected": { - "intent": "CODE_QA", - "sub_intent": "OPEN_FILE", - "answer_mode": "normal" - }, - "actual": { - "intent": "CODE_QA", - "sub_intent": "OPEN_FILE", - "answer_mode": "normal", - "evidence_gate_passed": true, - "evidence_count": 1 - }, - "passed": true, - "mismatches": [], - "router_result": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "retrieval_profile": "code", - "sub_intent": "OPEN_FILE", - "path_scope": [ - "src/order_app/api/orders.py" - ], - "layers": [ - "C0_SOURCE_CHUNKS" - ], - "symbol_resolution_status": "not_requested" - }, - "retrieval_request": { - "rag_session_id": "b3c7ec39-40a7-40e5-8ba5-fc0e2e3cc63c", - "query": "Покажи src/order_app/api/orders.py", - "sub_intent": "OPEN_FILE", - "path_scope": [ - "src/order_app/api/orders.py" - ], - "requested_layers": [ - "C0_SOURCE_CHUNKS" - ] - }, - "per_layer_outcome": [ - { - "layer_id": "C0_SOURCE_CHUNKS", - "hit_count": 1, - "empty": false, - "fallback_used": false - } - ], - "failure_reasons": [], - "timings_ms": { - "router": 0, - "retrieval_total": 6, - "symbol_resolution": 0 - } -} \ No newline at end of file diff --git a/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_232925/20260311_232925_open_file_api_positive.md b/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_232925/20260311_232925_open_file_api_positive.md deleted file mode 100644 index 05e4195..0000000 --- a/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_232925/20260311_232925_open_file_api_positive.md +++ /dev/null @@ -1,32 +0,0 @@ -# open_file_api_positive - -## Query -Покажи src/order_app/api/orders.py - -## Expected -- intent: CODE_QA, sub_intent: OPEN_FILE -- answer_mode: normal - -## Actual -- intent: CODE_QA, sub_intent: OPEN_FILE -- answer_mode: normal -- evidence_gate_passed: True -- evidence_count: 1 - -## Result -PASS - -## Router -- path_scope: ['src/order_app/api/orders.py'] -- layers: ['C0_SOURCE_CHUNKS'] - -## Retrieval -- requested_layers: ['C0_SOURCE_CHUNKS'] -- chunk_count: 1 -- layer_outcomes: [('C0_SOURCE_CHUNKS', 1)] - -## Evidence gate -- failure_reasons: [] - -## Timings (ms) -{'router': 0, 'retrieval_total': 6, 'symbol_resolution': 0} diff --git a/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_232925/20260311_232925_open_file_borderline.json b/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_232925/20260311_232925_open_file_borderline.json deleted file mode 100644 index da45f21..0000000 --- a/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_232925/20260311_232925_open_file_borderline.json +++ /dev/null @@ -1,63 +0,0 @@ -{ - "case_id": "open_file_borderline", - "query": "Open main", - "expected": { - "intent": "CODE_QA", - "sub_intent": "OPEN_FILE", - "answer_mode": "normal" - }, - "actual": { - "intent": "CODE_QA", - "sub_intent": "FIND_ENTRYPOINTS", - "answer_mode": "normal", - "evidence_gate_passed": true, - "evidence_count": 10 - }, - "passed": false, - "mismatches": [ - "sub_intent: expected OPEN_FILE, got FIND_ENTRYPOINTS" - ], - "router_result": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "retrieval_profile": "code", - "sub_intent": "FIND_ENTRYPOINTS", - "path_scope": [], - "layers": [ - "C3_ENTRYPOINTS", - "C0_SOURCE_CHUNKS" - ], - "symbol_resolution_status": "pending" - }, - "retrieval_request": { - "rag_session_id": "b3c7ec39-40a7-40e5-8ba5-fc0e2e3cc63c", - "query": "Open main", - "sub_intent": "FIND_ENTRYPOINTS", - "path_scope": [], - "requested_layers": [ - "C3_ENTRYPOINTS", - "C0_SOURCE_CHUNKS" - ] - }, - "per_layer_outcome": [ - { - "layer_id": "C3_ENTRYPOINTS", - "hit_count": 4, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C0_SOURCE_CHUNKS", - "hit_count": 6, - "empty": false, - "fallback_used": false - } - ], - "failure_reasons": [], - "timings_ms": { - "router": 0, - "retrieval_total": 24, - "symbol_resolution": 0 - } -} \ No newline at end of file diff --git a/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_232925/20260311_232925_open_file_borderline.md b/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_232925/20260311_232925_open_file_borderline.md deleted file mode 100644 index 3a786f8..0000000 --- a/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_232925/20260311_232925_open_file_borderline.md +++ /dev/null @@ -1,35 +0,0 @@ -# open_file_borderline - -## Query -Open main - -## Expected -- intent: CODE_QA, sub_intent: OPEN_FILE -- answer_mode: normal - -## Actual -- intent: CODE_QA, sub_intent: FIND_ENTRYPOINTS -- answer_mode: normal -- evidence_gate_passed: True -- evidence_count: 10 - -## Result -FAIL - -## Mismatches -- sub_intent: expected OPEN_FILE, got FIND_ENTRYPOINTS - -## Router -- path_scope: [] -- layers: ['C3_ENTRYPOINTS', 'C0_SOURCE_CHUNKS'] - -## Retrieval -- requested_layers: ['C3_ENTRYPOINTS', 'C0_SOURCE_CHUNKS'] -- chunk_count: 10 -- layer_outcomes: [('C3_ENTRYPOINTS', 4), ('C0_SOURCE_CHUNKS', 6)] - -## Evidence gate -- failure_reasons: [] - -## Timings (ms) -{'router': 0, 'retrieval_total': 24, 'symbol_resolution': 0} diff --git a/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_232925/20260311_232925_open_file_main_positive.json b/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_232925/20260311_232925_open_file_main_positive.json deleted file mode 100644 index 439cbf5..0000000 --- a/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_232925/20260311_232925_open_file_main_positive.json +++ /dev/null @@ -1,57 +0,0 @@ -{ - "case_id": "open_file_main_positive", - "query": "Открой файл main.py", - "expected": { - "intent": "CODE_QA", - "sub_intent": "OPEN_FILE", - "answer_mode": "normal" - }, - "actual": { - "intent": "CODE_QA", - "sub_intent": "OPEN_FILE", - "answer_mode": "normal", - "evidence_gate_passed": true, - "evidence_count": 1 - }, - "passed": true, - "mismatches": [], - "router_result": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "retrieval_profile": "code", - "sub_intent": "OPEN_FILE", - "path_scope": [ - "main.py" - ], - "layers": [ - "C0_SOURCE_CHUNKS" - ], - "symbol_resolution_status": "not_requested" - }, - "retrieval_request": { - "rag_session_id": "b3c7ec39-40a7-40e5-8ba5-fc0e2e3cc63c", - "query": "Открой файл main.py", - "sub_intent": "OPEN_FILE", - "path_scope": [ - "main.py" - ], - "requested_layers": [ - "C0_SOURCE_CHUNKS" - ] - }, - "per_layer_outcome": [ - { - "layer_id": "C0_SOURCE_CHUNKS", - "hit_count": 1, - "empty": false, - "fallback_used": false - } - ], - "failure_reasons": [], - "timings_ms": { - "router": 0, - "retrieval_total": 6, - "symbol_resolution": 0 - } -} \ No newline at end of file diff --git a/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_232925/20260311_232925_open_file_main_positive.md b/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_232925/20260311_232925_open_file_main_positive.md deleted file mode 100644 index 2ab4fc7..0000000 --- a/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_232925/20260311_232925_open_file_main_positive.md +++ /dev/null @@ -1,32 +0,0 @@ -# open_file_main_positive - -## Query -Открой файл main.py - -## Expected -- intent: CODE_QA, sub_intent: OPEN_FILE -- answer_mode: normal - -## Actual -- intent: CODE_QA, sub_intent: OPEN_FILE -- answer_mode: normal -- evidence_gate_passed: True -- evidence_count: 1 - -## Result -PASS - -## Router -- path_scope: ['main.py'] -- layers: ['C0_SOURCE_CHUNKS'] - -## Retrieval -- requested_layers: ['C0_SOURCE_CHUNKS'] -- chunk_count: 1 -- layer_outcomes: [('C0_SOURCE_CHUNKS', 1)] - -## Evidence gate -- failure_reasons: [] - -## Timings (ms) -{'router': 0, 'retrieval_total': 6, 'symbol_resolution': 0} diff --git a/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_232925/20260311_232925_open_file_negative.json b/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_232925/20260311_232925_open_file_negative.json deleted file mode 100644 index 45b38a1..0000000 --- a/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_232925/20260311_232925_open_file_negative.json +++ /dev/null @@ -1,62 +0,0 @@ -{ - "case_id": "open_file_negative", - "query": "Открой файл nonexistent/foo.py", - "expected": { - "intent": "CODE_QA", - "sub_intent": "OPEN_FILE", - "answer_mode": "degraded" - }, - "actual": { - "intent": "CODE_QA", - "sub_intent": "OPEN_FILE", - "answer_mode": "insufficient", - "evidence_gate_passed": false, - "evidence_count": 0 - }, - "passed": false, - "mismatches": [ - "answer_mode: expected degraded, got insufficient" - ], - "router_result": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "retrieval_profile": "code", - "sub_intent": "OPEN_FILE", - "path_scope": [ - "nonexistent/foo.py" - ], - "layers": [ - "C0_SOURCE_CHUNKS" - ], - "symbol_resolution_status": "not_requested" - }, - "retrieval_request": { - "rag_session_id": "b3c7ec39-40a7-40e5-8ba5-fc0e2e3cc63c", - "query": "Открой файл nonexistent/foo.py", - "sub_intent": "OPEN_FILE", - "path_scope": [ - "nonexistent/foo.py" - ], - "requested_layers": [ - "C0_SOURCE_CHUNKS" - ] - }, - "per_layer_outcome": [ - { - "layer_id": "C0_SOURCE_CHUNKS", - "hit_count": 0, - "empty": true, - "fallback_used": false - } - ], - "failure_reasons": [ - "path_scope_empty", - "layer_c0_empty" - ], - "timings_ms": { - "router": 0, - "retrieval_total": 6, - "symbol_resolution": 0 - } -} \ No newline at end of file diff --git a/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_232925/20260311_232925_open_file_negative.md b/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_232925/20260311_232925_open_file_negative.md deleted file mode 100644 index 606f266..0000000 --- a/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_232925/20260311_232925_open_file_negative.md +++ /dev/null @@ -1,35 +0,0 @@ -# open_file_negative - -## Query -Открой файл nonexistent/foo.py - -## Expected -- intent: CODE_QA, sub_intent: OPEN_FILE -- answer_mode: degraded - -## Actual -- intent: CODE_QA, sub_intent: OPEN_FILE -- answer_mode: insufficient -- evidence_gate_passed: False -- evidence_count: 0 - -## Result -FAIL - -## Mismatches -- answer_mode: expected degraded, got insufficient - -## Router -- path_scope: ['nonexistent/foo.py'] -- layers: ['C0_SOURCE_CHUNKS'] - -## Retrieval -- requested_layers: ['C0_SOURCE_CHUNKS'] -- chunk_count: 0 -- layer_outcomes: [('C0_SOURCE_CHUNKS', 0)] - -## Evidence gate -- failure_reasons: ['path_scope_empty', 'layer_c0_empty'] - -## Timings (ms) -{'router': 0, 'retrieval_total': 6, 'symbol_resolution': 0} diff --git a/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_233701/20260311_233701_explain_borderline.json b/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_233701/20260311_233701_explain_borderline.json deleted file mode 100644 index 737947a..0000000 --- a/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_233701/20260311_233701_explain_borderline.json +++ /dev/null @@ -1,79 +0,0 @@ -{ - "case_id": "explain_borderline", - "query": "Что делает create_order?", - "expected": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "answer_mode": "normal" - }, - "actual": { - "intent": "PROJECT_MISC", - "sub_intent": "EXPLAIN", - "answer_mode": "normal", - "evidence_gate_passed": true, - "evidence_count": 5 - }, - "passed": false, - "mismatches": [ - "intent: expected CODE_QA, got PROJECT_MISC" - ], - "router_result": { - "intent": "PROJECT_MISC", - "graph_id": "ProjectMiscGraph", - "conversation_mode": "START", - "retrieval_profile": "code", - "sub_intent": "EXPLAIN", - "path_scope": [], - "layers": [ - "D1_MODULE_CATALOG", - "D3_SECTION_INDEX", - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS" - ], - "symbol_resolution_status": "pending" - }, - "retrieval_request": { - "rag_session_id": "564f37c4-259f-4d21-be24-04b3a51e3c64", - "query": "Что делает create_order?", - "sub_intent": "EXPLAIN", - "path_scope": [], - "requested_layers": [ - "D1_MODULE_CATALOG", - "D3_SECTION_INDEX", - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS" - ] - }, - "per_layer_outcome": [ - { - "layer_id": "D1_MODULE_CATALOG", - "hit_count": 0, - "empty": true, - "fallback_used": false - }, - { - "layer_id": "D3_SECTION_INDEX", - "hit_count": 0, - "empty": true, - "fallback_used": false - }, - { - "layer_id": "C1_SYMBOL_CATALOG", - "hit_count": 1, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C0_SOURCE_CHUNKS", - "hit_count": 4, - "empty": false, - "fallback_used": false - } - ], - "failure_reasons": [], - "timings_ms": { - "router": 0, - "retrieval_total": 31, - "symbol_resolution": 0 - } -} \ No newline at end of file diff --git a/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_233701/20260311_233701_explain_borderline.md b/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_233701/20260311_233701_explain_borderline.md deleted file mode 100644 index c244db7..0000000 --- a/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_233701/20260311_233701_explain_borderline.md +++ /dev/null @@ -1,35 +0,0 @@ -# explain_borderline - -## Query -Что делает create_order? - -## Expected -- intent: CODE_QA, sub_intent: EXPLAIN -- answer_mode: normal - -## Actual -- intent: PROJECT_MISC, sub_intent: EXPLAIN -- answer_mode: normal -- evidence_gate_passed: True -- evidence_count: 5 - -## Result -FAIL - -## Mismatches -- intent: expected CODE_QA, got PROJECT_MISC - -## Router -- path_scope: [] -- layers: ['D1_MODULE_CATALOG', 'D3_SECTION_INDEX', 'C1_SYMBOL_CATALOG', 'C0_SOURCE_CHUNKS'] - -## Retrieval -- requested_layers: ['D1_MODULE_CATALOG', 'D3_SECTION_INDEX', 'C1_SYMBOL_CATALOG', 'C0_SOURCE_CHUNKS'] -- chunk_count: 5 -- layer_outcomes: [('D1_MODULE_CATALOG', 0), ('D3_SECTION_INDEX', 0), ('C1_SYMBOL_CATALOG', 1), ('C0_SOURCE_CHUNKS', 4)] - -## Evidence gate -- failure_reasons: [] - -## Timings (ms) -{'router': 0, 'retrieval_total': 31, 'symbol_resolution': 0} diff --git a/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_233701/20260311_233701_explain_negative.json b/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_233701/20260311_233701_explain_negative.json deleted file mode 100644 index aa10739..0000000 --- a/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_233701/20260311_233701_explain_negative.json +++ /dev/null @@ -1,87 +0,0 @@ -{ - "case_id": "explain_negative", - "query": "Объясни класс NonExistentClass", - "expected": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "answer_mode": "degraded" - }, - "actual": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "answer_mode": "normal", - "evidence_gate_passed": true, - "evidence_count": 22 - }, - "passed": false, - "mismatches": [ - "answer_mode: expected degraded, got normal" - ], - "router_result": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "retrieval_profile": "code", - "sub_intent": "EXPLAIN", - "path_scope": [], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "symbol_resolution_status": "pending" - }, - "retrieval_request": { - "rag_session_id": "564f37c4-259f-4d21-be24-04b3a51e3c64", - "query": "Объясни класс NonExistentClass", - "sub_intent": "EXPLAIN", - "path_scope": [], - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "per_layer_outcome": [ - { - "layer_id": "C1_SYMBOL_CATALOG", - "hit_count": 1, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C0_SOURCE_CHUNKS", - "hit_count": 8, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C4_SEMANTIC_ROLES", - "hit_count": 3, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C2_DEPENDENCY_GRAPH", - "hit_count": 6, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C3_ENTRYPOINTS", - "hit_count": 4, - "empty": false, - "fallback_used": false - } - ], - "failure_reasons": [], - "timings_ms": { - "router": 0, - "retrieval_total": 41, - "symbol_resolution": 0 - } -} \ No newline at end of file diff --git a/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_233701/20260311_233701_explain_negative.md b/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_233701/20260311_233701_explain_negative.md deleted file mode 100644 index bc6b462..0000000 --- a/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_233701/20260311_233701_explain_negative.md +++ /dev/null @@ -1,35 +0,0 @@ -# explain_negative - -## Query -Объясни класс NonExistentClass - -## Expected -- intent: CODE_QA, sub_intent: EXPLAIN -- answer_mode: degraded - -## Actual -- intent: CODE_QA, sub_intent: EXPLAIN -- answer_mode: normal -- evidence_gate_passed: True -- evidence_count: 22 - -## Result -FAIL - -## Mismatches -- answer_mode: expected degraded, got normal - -## Router -- path_scope: [] -- layers: ['C1_SYMBOL_CATALOG', 'C0_SOURCE_CHUNKS', 'C4_SEMANTIC_ROLES', 'C2_DEPENDENCY_GRAPH', 'C3_ENTRYPOINTS'] - -## Retrieval -- requested_layers: ['C1_SYMBOL_CATALOG', 'C0_SOURCE_CHUNKS', 'C4_SEMANTIC_ROLES', 'C2_DEPENDENCY_GRAPH', 'C3_ENTRYPOINTS'] -- chunk_count: 22 -- layer_outcomes: [('C1_SYMBOL_CATALOG', 1), ('C0_SOURCE_CHUNKS', 8), ('C4_SEMANTIC_ROLES', 3), ('C2_DEPENDENCY_GRAPH', 6), ('C3_ENTRYPOINTS', 4)] - -## Evidence gate -- failure_reasons: [] - -## Timings (ms) -{'router': 0, 'retrieval_total': 41, 'symbol_resolution': 0} diff --git a/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_233701/20260311_233701_explain_order_positive.json b/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_233701/20260311_233701_explain_order_positive.json deleted file mode 100644 index c440665..0000000 --- a/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_233701/20260311_233701_explain_order_positive.json +++ /dev/null @@ -1,61 +0,0 @@ -{ - "case_id": "explain_order_positive", - "query": "Объясни класс Order", - "expected": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "answer_mode": "normal" - }, - "actual": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "answer_mode": "normal", - "evidence_gate_passed": true, - "evidence_count": 15 - }, - "passed": true, - "mismatches": [], - "router_result": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "retrieval_profile": "code", - "sub_intent": "EXPLAIN", - "path_scope": [], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "symbol_resolution_status": "pending" - }, - "retrieval_request": { - "rag_session_id": "564f37c4-259f-4d21-be24-04b3a51e3c64", - "query": "Объясни класс Order", - "sub_intent": "EXPLAIN", - "path_scope": [], - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "per_layer_outcome": [ - { - "layer_id": "C0_SOURCE_CHUNKS", - "hit_count": 1, - "empty": false, - "fallback_used": false - } - ], - "failure_reasons": [], - "timings_ms": { - "router": 0, - "retrieval_total": 45, - "symbol_resolution": 0 - } -} \ No newline at end of file diff --git a/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_233701/20260311_233701_explain_order_positive.md b/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_233701/20260311_233701_explain_order_positive.md deleted file mode 100644 index cbef5f8..0000000 --- a/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_233701/20260311_233701_explain_order_positive.md +++ /dev/null @@ -1,32 +0,0 @@ -# explain_order_positive - -## Query -Объясни класс Order - -## Expected -- intent: CODE_QA, sub_intent: EXPLAIN -- answer_mode: normal - -## Actual -- intent: CODE_QA, sub_intent: EXPLAIN -- answer_mode: normal -- evidence_gate_passed: True -- evidence_count: 15 - -## Result -PASS - -## Router -- path_scope: [] -- layers: ['C1_SYMBOL_CATALOG', 'C0_SOURCE_CHUNKS', 'C4_SEMANTIC_ROLES', 'C2_DEPENDENCY_GRAPH', 'C3_ENTRYPOINTS'] - -## Retrieval -- requested_layers: ['C1_SYMBOL_CATALOG', 'C0_SOURCE_CHUNKS', 'C4_SEMANTIC_ROLES', 'C2_DEPENDENCY_GRAPH', 'C3_ENTRYPOINTS'] -- chunk_count: 15 -- layer_outcomes: [('C0_SOURCE_CHUNKS', 1)] - -## Evidence gate -- failure_reasons: [] - -## Timings (ms) -{'router': 0, 'retrieval_total': 45, 'symbol_resolution': 0} diff --git a/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_233701/20260311_233701_explain_order_service_positive.json b/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_233701/20260311_233701_explain_order_service_positive.json deleted file mode 100644 index 1954bd2..0000000 --- a/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_233701/20260311_233701_explain_order_service_positive.json +++ /dev/null @@ -1,61 +0,0 @@ -{ - "case_id": "explain_order_service_positive", - "query": "Как работает OrderService?", - "expected": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "answer_mode": "normal" - }, - "actual": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "answer_mode": "normal", - "evidence_gate_passed": true, - "evidence_count": 15 - }, - "passed": true, - "mismatches": [], - "router_result": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "retrieval_profile": "code", - "sub_intent": "EXPLAIN", - "path_scope": [], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "symbol_resolution_status": "pending" - }, - "retrieval_request": { - "rag_session_id": "564f37c4-259f-4d21-be24-04b3a51e3c64", - "query": "Как работает OrderService?", - "sub_intent": "EXPLAIN", - "path_scope": [], - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "per_layer_outcome": [ - { - "layer_id": "C0_SOURCE_CHUNKS", - "hit_count": 1, - "empty": false, - "fallback_used": false - } - ], - "failure_reasons": [], - "timings_ms": { - "router": 0, - "retrieval_total": 43, - "symbol_resolution": 0 - } -} \ No newline at end of file diff --git a/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_233701/20260311_233701_explain_order_service_positive.md b/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_233701/20260311_233701_explain_order_service_positive.md deleted file mode 100644 index 86813f7..0000000 --- a/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_233701/20260311_233701_explain_order_service_positive.md +++ /dev/null @@ -1,32 +0,0 @@ -# explain_order_service_positive - -## Query -Как работает OrderService? - -## Expected -- intent: CODE_QA, sub_intent: EXPLAIN -- answer_mode: normal - -## Actual -- intent: CODE_QA, sub_intent: EXPLAIN -- answer_mode: normal -- evidence_gate_passed: True -- evidence_count: 15 - -## Result -PASS - -## Router -- path_scope: [] -- layers: ['C1_SYMBOL_CATALOG', 'C0_SOURCE_CHUNKS', 'C4_SEMANTIC_ROLES', 'C2_DEPENDENCY_GRAPH', 'C3_ENTRYPOINTS'] - -## Retrieval -- requested_layers: ['C1_SYMBOL_CATALOG', 'C0_SOURCE_CHUNKS', 'C4_SEMANTIC_ROLES', 'C2_DEPENDENCY_GRAPH', 'C3_ENTRYPOINTS'] -- chunk_count: 15 -- layer_outcomes: [('C0_SOURCE_CHUNKS', 1)] - -## Evidence gate -- failure_reasons: [] - -## Timings (ms) -{'router': 0, 'retrieval_total': 43, 'symbol_resolution': 0} diff --git a/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_233701/20260311_233701_find_entrypoints_borderline.json b/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_233701/20260311_233701_find_entrypoints_borderline.json deleted file mode 100644 index 1b32629..0000000 --- a/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_233701/20260311_233701_find_entrypoints_borderline.json +++ /dev/null @@ -1,82 +0,0 @@ -{ - "case_id": "find_entrypoints_borderline", - "query": "Где main?", - "expected": { - "intent": "CODE_QA", - "sub_intent": "FIND_ENTRYPOINTS", - "answer_mode": "normal" - }, - "actual": { - "intent": "PROJECT_MISC", - "sub_intent": "FIND_ENTRYPOINTS", - "answer_mode": "degraded", - "evidence_gate_passed": false, - "evidence_count": 6 - }, - "passed": false, - "mismatches": [ - "intent: expected CODE_QA, got PROJECT_MISC", - "answer_mode: expected normal, got degraded" - ], - "router_result": { - "intent": "PROJECT_MISC", - "graph_id": "ProjectMiscGraph", - "conversation_mode": "START", - "retrieval_profile": "code", - "sub_intent": "FIND_ENTRYPOINTS", - "path_scope": [], - "layers": [ - "D1_MODULE_CATALOG", - "D3_SECTION_INDEX", - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS" - ], - "symbol_resolution_status": "pending" - }, - "retrieval_request": { - "rag_session_id": "564f37c4-259f-4d21-be24-04b3a51e3c64", - "query": "Где main?", - "sub_intent": "FIND_ENTRYPOINTS", - "path_scope": [], - "requested_layers": [ - "D1_MODULE_CATALOG", - "D3_SECTION_INDEX", - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS" - ] - }, - "per_layer_outcome": [ - { - "layer_id": "D1_MODULE_CATALOG", - "hit_count": 0, - "empty": true, - "fallback_used": true - }, - { - "layer_id": "D3_SECTION_INDEX", - "hit_count": 0, - "empty": true, - "fallback_used": true - }, - { - "layer_id": "C1_SYMBOL_CATALOG", - "hit_count": 2, - "empty": false, - "fallback_used": true - }, - { - "layer_id": "C0_SOURCE_CHUNKS", - "hit_count": 4, - "empty": false, - "fallback_used": true - } - ], - "failure_reasons": [ - "entrypoints_not_found" - ], - "timings_ms": { - "router": 0, - "retrieval_total": 49, - "symbol_resolution": 0 - } -} \ No newline at end of file diff --git a/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_233701/20260311_233701_find_entrypoints_borderline.md b/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_233701/20260311_233701_find_entrypoints_borderline.md deleted file mode 100644 index 409651a..0000000 --- a/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_233701/20260311_233701_find_entrypoints_borderline.md +++ /dev/null @@ -1,36 +0,0 @@ -# find_entrypoints_borderline - -## Query -Где main? - -## Expected -- intent: CODE_QA, sub_intent: FIND_ENTRYPOINTS -- answer_mode: normal - -## Actual -- intent: PROJECT_MISC, sub_intent: FIND_ENTRYPOINTS -- answer_mode: degraded -- evidence_gate_passed: False -- evidence_count: 6 - -## Result -FAIL - -## Mismatches -- intent: expected CODE_QA, got PROJECT_MISC -- answer_mode: expected normal, got degraded - -## Router -- path_scope: [] -- layers: ['D1_MODULE_CATALOG', 'D3_SECTION_INDEX', 'C1_SYMBOL_CATALOG', 'C0_SOURCE_CHUNKS'] - -## Retrieval -- requested_layers: ['D1_MODULE_CATALOG', 'D3_SECTION_INDEX', 'C1_SYMBOL_CATALOG', 'C0_SOURCE_CHUNKS'] -- chunk_count: 6 -- layer_outcomes: [('D1_MODULE_CATALOG', 0), ('D3_SECTION_INDEX', 0), ('C1_SYMBOL_CATALOG', 2), ('C0_SOURCE_CHUNKS', 4)] - -## Evidence gate -- failure_reasons: ['entrypoints_not_found'] - -## Timings (ms) -{'router': 0, 'retrieval_total': 49, 'symbol_resolution': 0} diff --git a/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_233701/20260311_233701_find_entrypoints_english.json b/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_233701/20260311_233701_find_entrypoints_english.json deleted file mode 100644 index 90812ff..0000000 --- a/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_233701/20260311_233701_find_entrypoints_english.json +++ /dev/null @@ -1,61 +0,0 @@ -{ - "case_id": "find_entrypoints_english", - "query": "Find application entrypoints", - "expected": { - "intent": "CODE_QA", - "sub_intent": "FIND_ENTRYPOINTS", - "answer_mode": "normal" - }, - "actual": { - "intent": "CODE_QA", - "sub_intent": "FIND_ENTRYPOINTS", - "answer_mode": "normal", - "evidence_gate_passed": true, - "evidence_count": 10 - }, - "passed": true, - "mismatches": [], - "router_result": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "retrieval_profile": "code", - "sub_intent": "FIND_ENTRYPOINTS", - "path_scope": [], - "layers": [ - "C3_ENTRYPOINTS", - "C0_SOURCE_CHUNKS" - ], - "symbol_resolution_status": "pending" - }, - "retrieval_request": { - "rag_session_id": "564f37c4-259f-4d21-be24-04b3a51e3c64", - "query": "Find application entrypoints", - "sub_intent": "FIND_ENTRYPOINTS", - "path_scope": [], - "requested_layers": [ - "C3_ENTRYPOINTS", - "C0_SOURCE_CHUNKS" - ] - }, - "per_layer_outcome": [ - { - "layer_id": "C3_ENTRYPOINTS", - "hit_count": 4, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C0_SOURCE_CHUNKS", - "hit_count": 6, - "empty": false, - "fallback_used": false - } - ], - "failure_reasons": [], - "timings_ms": { - "router": 0, - "retrieval_total": 18, - "symbol_resolution": 0 - } -} \ No newline at end of file diff --git a/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_233701/20260311_233701_find_entrypoints_english.md b/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_233701/20260311_233701_find_entrypoints_english.md deleted file mode 100644 index c959748..0000000 --- a/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_233701/20260311_233701_find_entrypoints_english.md +++ /dev/null @@ -1,32 +0,0 @@ -# find_entrypoints_english - -## Query -Find application entrypoints - -## Expected -- intent: CODE_QA, sub_intent: FIND_ENTRYPOINTS -- answer_mode: normal - -## Actual -- intent: CODE_QA, sub_intent: FIND_ENTRYPOINTS -- answer_mode: normal -- evidence_gate_passed: True -- evidence_count: 10 - -## Result -PASS - -## Router -- path_scope: [] -- layers: ['C3_ENTRYPOINTS', 'C0_SOURCE_CHUNKS'] - -## Retrieval -- requested_layers: ['C3_ENTRYPOINTS', 'C0_SOURCE_CHUNKS'] -- chunk_count: 10 -- layer_outcomes: [('C3_ENTRYPOINTS', 4), ('C0_SOURCE_CHUNKS', 6)] - -## Evidence gate -- failure_reasons: [] - -## Timings (ms) -{'router': 0, 'retrieval_total': 18, 'symbol_resolution': 0} diff --git a/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_233701/20260311_233701_find_entrypoints_positive.json b/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_233701/20260311_233701_find_entrypoints_positive.json deleted file mode 100644 index 141d251..0000000 --- a/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_233701/20260311_233701_find_entrypoints_positive.json +++ /dev/null @@ -1,82 +0,0 @@ -{ - "case_id": "find_entrypoints_positive", - "query": "Какие точки входа в приложение?", - "expected": { - "intent": "CODE_QA", - "sub_intent": "FIND_ENTRYPOINTS", - "answer_mode": "normal" - }, - "actual": { - "intent": "PROJECT_MISC", - "sub_intent": "FIND_ENTRYPOINTS", - "answer_mode": "degraded", - "evidence_gate_passed": false, - "evidence_count": 8 - }, - "passed": false, - "mismatches": [ - "intent: expected CODE_QA, got PROJECT_MISC", - "answer_mode: expected normal, got degraded" - ], - "router_result": { - "intent": "PROJECT_MISC", - "graph_id": "ProjectMiscGraph", - "conversation_mode": "START", - "retrieval_profile": "code", - "sub_intent": "FIND_ENTRYPOINTS", - "path_scope": [], - "layers": [ - "D1_MODULE_CATALOG", - "D3_SECTION_INDEX", - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS" - ], - "symbol_resolution_status": "not_requested" - }, - "retrieval_request": { - "rag_session_id": "564f37c4-259f-4d21-be24-04b3a51e3c64", - "query": "Какие точки входа в приложение?", - "sub_intent": "FIND_ENTRYPOINTS", - "path_scope": [], - "requested_layers": [ - "D1_MODULE_CATALOG", - "D3_SECTION_INDEX", - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS" - ] - }, - "per_layer_outcome": [ - { - "layer_id": "D1_MODULE_CATALOG", - "hit_count": 0, - "empty": true, - "fallback_used": true - }, - { - "layer_id": "D3_SECTION_INDEX", - "hit_count": 0, - "empty": true, - "fallback_used": true - }, - { - "layer_id": "C1_SYMBOL_CATALOG", - "hit_count": 4, - "empty": false, - "fallback_used": true - }, - { - "layer_id": "C0_SOURCE_CHUNKS", - "hit_count": 4, - "empty": false, - "fallback_used": true - } - ], - "failure_reasons": [ - "entrypoints_not_found" - ], - "timings_ms": { - "router": 0, - "retrieval_total": 48, - "symbol_resolution": 0 - } -} \ No newline at end of file diff --git a/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_233701/20260311_233701_find_entrypoints_positive.md b/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_233701/20260311_233701_find_entrypoints_positive.md deleted file mode 100644 index c5f4a3f..0000000 --- a/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_233701/20260311_233701_find_entrypoints_positive.md +++ /dev/null @@ -1,36 +0,0 @@ -# find_entrypoints_positive - -## Query -Какие точки входа в приложение? - -## Expected -- intent: CODE_QA, sub_intent: FIND_ENTRYPOINTS -- answer_mode: normal - -## Actual -- intent: PROJECT_MISC, sub_intent: FIND_ENTRYPOINTS -- answer_mode: degraded -- evidence_gate_passed: False -- evidence_count: 8 - -## Result -FAIL - -## Mismatches -- intent: expected CODE_QA, got PROJECT_MISC -- answer_mode: expected normal, got degraded - -## Router -- path_scope: [] -- layers: ['D1_MODULE_CATALOG', 'D3_SECTION_INDEX', 'C1_SYMBOL_CATALOG', 'C0_SOURCE_CHUNKS'] - -## Retrieval -- requested_layers: ['D1_MODULE_CATALOG', 'D3_SECTION_INDEX', 'C1_SYMBOL_CATALOG', 'C0_SOURCE_CHUNKS'] -- chunk_count: 8 -- layer_outcomes: [('D1_MODULE_CATALOG', 0), ('D3_SECTION_INDEX', 0), ('C1_SYMBOL_CATALOG', 4), ('C0_SOURCE_CHUNKS', 4)] - -## Evidence gate -- failure_reasons: ['entrypoints_not_found'] - -## Timings (ms) -{'router': 0, 'retrieval_total': 48, 'symbol_resolution': 0} diff --git a/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_233701/20260311_233701_find_tests_borderline.json b/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_233701/20260311_233701_find_tests_borderline.json deleted file mode 100644 index a5b7d83..0000000 --- a/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_233701/20260311_233701_find_tests_borderline.json +++ /dev/null @@ -1,69 +0,0 @@ -{ - "case_id": "find_tests_borderline", - "query": "Есть ли тесты на репозиторий?", - "expected": { - "intent": "CODE_QA", - "sub_intent": "FIND_TESTS", - "answer_mode": "normal" - }, - "actual": { - "intent": "CODE_QA", - "sub_intent": "FIND_TESTS", - "answer_mode": "normal", - "evidence_gate_passed": true, - "evidence_count": 16 - }, - "passed": true, - "mismatches": [], - "router_result": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "retrieval_profile": "code", - "sub_intent": "FIND_TESTS", - "path_scope": [], - "layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ], - "symbol_resolution_status": "not_requested" - }, - "retrieval_request": { - "rag_session_id": "564f37c4-259f-4d21-be24-04b3a51e3c64", - "query": "Есть ли тесты на репозиторий?", - "sub_intent": "FIND_TESTS", - "path_scope": [], - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ] - }, - "per_layer_outcome": [ - { - "layer_id": "C1_SYMBOL_CATALOG", - "hit_count": 8, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C2_DEPENDENCY_GRAPH", - "hit_count": 6, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C0_SOURCE_CHUNKS", - "hit_count": 2, - "empty": false, - "fallback_used": false - } - ], - "failure_reasons": [], - "timings_ms": { - "router": 0, - "retrieval_total": 22, - "symbol_resolution": 0 - } -} \ No newline at end of file diff --git a/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_233701/20260311_233701_find_tests_borderline.md b/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_233701/20260311_233701_find_tests_borderline.md deleted file mode 100644 index 7b20089..0000000 --- a/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_233701/20260311_233701_find_tests_borderline.md +++ /dev/null @@ -1,32 +0,0 @@ -# find_tests_borderline - -## Query -Есть ли тесты на репозиторий? - -## Expected -- intent: CODE_QA, sub_intent: FIND_TESTS -- answer_mode: normal - -## Actual -- intent: CODE_QA, sub_intent: FIND_TESTS -- answer_mode: normal -- evidence_gate_passed: True -- evidence_count: 16 - -## Result -PASS - -## Router -- path_scope: [] -- layers: ['C1_SYMBOL_CATALOG', 'C2_DEPENDENCY_GRAPH', 'C0_SOURCE_CHUNKS'] - -## Retrieval -- requested_layers: ['C1_SYMBOL_CATALOG', 'C2_DEPENDENCY_GRAPH', 'C0_SOURCE_CHUNKS'] -- chunk_count: 16 -- layer_outcomes: [('C1_SYMBOL_CATALOG', 8), ('C2_DEPENDENCY_GRAPH', 6), ('C0_SOURCE_CHUNKS', 2)] - -## Evidence gate -- failure_reasons: [] - -## Timings (ms) -{'router': 0, 'retrieval_total': 22, 'symbol_resolution': 0} diff --git a/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_233701/20260311_233701_find_tests_negative.json b/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_233701/20260311_233701_find_tests_negative.json deleted file mode 100644 index 12067be..0000000 --- a/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_233701/20260311_233701_find_tests_negative.json +++ /dev/null @@ -1,71 +0,0 @@ -{ - "case_id": "find_tests_negative", - "query": "Где тесты для NonExistent?", - "expected": { - "intent": "CODE_QA", - "sub_intent": "FIND_TESTS", - "answer_mode": "degraded" - }, - "actual": { - "intent": "CODE_QA", - "sub_intent": "FIND_TESTS", - "answer_mode": "normal", - "evidence_gate_passed": true, - "evidence_count": 8 - }, - "passed": false, - "mismatches": [ - "answer_mode: expected degraded, got normal" - ], - "router_result": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "retrieval_profile": "code", - "sub_intent": "FIND_TESTS", - "path_scope": [], - "layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ], - "symbol_resolution_status": "pending" - }, - "retrieval_request": { - "rag_session_id": "564f37c4-259f-4d21-be24-04b3a51e3c64", - "query": "Где тесты для NonExistent?", - "sub_intent": "FIND_TESTS", - "path_scope": [], - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ] - }, - "per_layer_outcome": [ - { - "layer_id": "C1_SYMBOL_CATALOG", - "hit_count": 0, - "empty": true, - "fallback_used": true - }, - { - "layer_id": "C2_DEPENDENCY_GRAPH", - "hit_count": 6, - "empty": false, - "fallback_used": true - }, - { - "layer_id": "C0_SOURCE_CHUNKS", - "hit_count": 2, - "empty": false, - "fallback_used": true - } - ], - "failure_reasons": [], - "timings_ms": { - "router": 0, - "retrieval_total": 31, - "symbol_resolution": 0 - } -} \ No newline at end of file diff --git a/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_233701/20260311_233701_find_tests_negative.md b/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_233701/20260311_233701_find_tests_negative.md deleted file mode 100644 index c72ea8a..0000000 --- a/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_233701/20260311_233701_find_tests_negative.md +++ /dev/null @@ -1,35 +0,0 @@ -# find_tests_negative - -## Query -Где тесты для NonExistent? - -## Expected -- intent: CODE_QA, sub_intent: FIND_TESTS -- answer_mode: degraded - -## Actual -- intent: CODE_QA, sub_intent: FIND_TESTS -- answer_mode: normal -- evidence_gate_passed: True -- evidence_count: 8 - -## Result -FAIL - -## Mismatches -- answer_mode: expected degraded, got normal - -## Router -- path_scope: [] -- layers: ['C1_SYMBOL_CATALOG', 'C2_DEPENDENCY_GRAPH', 'C0_SOURCE_CHUNKS'] - -## Retrieval -- requested_layers: ['C1_SYMBOL_CATALOG', 'C2_DEPENDENCY_GRAPH', 'C0_SOURCE_CHUNKS'] -- chunk_count: 8 -- layer_outcomes: [('C1_SYMBOL_CATALOG', 0), ('C2_DEPENDENCY_GRAPH', 6), ('C0_SOURCE_CHUNKS', 2)] - -## Evidence gate -- failure_reasons: [] - -## Timings (ms) -{'router': 0, 'retrieval_total': 31, 'symbol_resolution': 0} diff --git a/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_233701/20260311_233701_find_tests_order_positive.json b/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_233701/20260311_233701_find_tests_order_positive.json deleted file mode 100644 index f818dce..0000000 --- a/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_233701/20260311_233701_find_tests_order_positive.json +++ /dev/null @@ -1,69 +0,0 @@ -{ - "case_id": "find_tests_order_positive", - "query": "Найди тесты для Order", - "expected": { - "intent": "CODE_QA", - "sub_intent": "FIND_TESTS", - "answer_mode": "normal" - }, - "actual": { - "intent": "CODE_QA", - "sub_intent": "FIND_TESTS", - "answer_mode": "normal", - "evidence_gate_passed": true, - "evidence_count": 8 - }, - "passed": true, - "mismatches": [], - "router_result": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "retrieval_profile": "code", - "sub_intent": "FIND_TESTS", - "path_scope": [], - "layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ], - "symbol_resolution_status": "pending" - }, - "retrieval_request": { - "rag_session_id": "564f37c4-259f-4d21-be24-04b3a51e3c64", - "query": "Найди тесты для Order", - "sub_intent": "FIND_TESTS", - "path_scope": [], - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ] - }, - "per_layer_outcome": [ - { - "layer_id": "C1_SYMBOL_CATALOG", - "hit_count": 0, - "empty": true, - "fallback_used": true - }, - { - "layer_id": "C2_DEPENDENCY_GRAPH", - "hit_count": 6, - "empty": false, - "fallback_used": true - }, - { - "layer_id": "C0_SOURCE_CHUNKS", - "hit_count": 2, - "empty": false, - "fallback_used": true - } - ], - "failure_reasons": [], - "timings_ms": { - "router": 0, - "retrieval_total": 33, - "symbol_resolution": 0 - } -} \ No newline at end of file diff --git a/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_233701/20260311_233701_find_tests_order_positive.md b/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_233701/20260311_233701_find_tests_order_positive.md deleted file mode 100644 index adfd8e9..0000000 --- a/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_233701/20260311_233701_find_tests_order_positive.md +++ /dev/null @@ -1,32 +0,0 @@ -# find_tests_order_positive - -## Query -Найди тесты для Order - -## Expected -- intent: CODE_QA, sub_intent: FIND_TESTS -- answer_mode: normal - -## Actual -- intent: CODE_QA, sub_intent: FIND_TESTS -- answer_mode: normal -- evidence_gate_passed: True -- evidence_count: 8 - -## Result -PASS - -## Router -- path_scope: [] -- layers: ['C1_SYMBOL_CATALOG', 'C2_DEPENDENCY_GRAPH', 'C0_SOURCE_CHUNKS'] - -## Retrieval -- requested_layers: ['C1_SYMBOL_CATALOG', 'C2_DEPENDENCY_GRAPH', 'C0_SOURCE_CHUNKS'] -- chunk_count: 8 -- layer_outcomes: [('C1_SYMBOL_CATALOG', 0), ('C2_DEPENDENCY_GRAPH', 6), ('C0_SOURCE_CHUNKS', 2)] - -## Evidence gate -- failure_reasons: [] - -## Timings (ms) -{'router': 0, 'retrieval_total': 33, 'symbol_resolution': 0} diff --git a/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_233701/20260311_233701_find_tests_positive.json b/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_233701/20260311_233701_find_tests_positive.json deleted file mode 100644 index d25705b..0000000 --- a/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_233701/20260311_233701_find_tests_positive.json +++ /dev/null @@ -1,69 +0,0 @@ -{ - "case_id": "find_tests_positive", - "query": "Где тесты для OrderService?", - "expected": { - "intent": "CODE_QA", - "sub_intent": "FIND_TESTS", - "answer_mode": "normal" - }, - "actual": { - "intent": "CODE_QA", - "sub_intent": "FIND_TESTS", - "answer_mode": "normal", - "evidence_gate_passed": true, - "evidence_count": 8 - }, - "passed": true, - "mismatches": [], - "router_result": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "retrieval_profile": "code", - "sub_intent": "FIND_TESTS", - "path_scope": [], - "layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ], - "symbol_resolution_status": "pending" - }, - "retrieval_request": { - "rag_session_id": "564f37c4-259f-4d21-be24-04b3a51e3c64", - "query": "Где тесты для OrderService?", - "sub_intent": "FIND_TESTS", - "path_scope": [], - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ] - }, - "per_layer_outcome": [ - { - "layer_id": "C1_SYMBOL_CATALOG", - "hit_count": 0, - "empty": true, - "fallback_used": true - }, - { - "layer_id": "C2_DEPENDENCY_GRAPH", - "hit_count": 6, - "empty": false, - "fallback_used": true - }, - { - "layer_id": "C0_SOURCE_CHUNKS", - "hit_count": 2, - "empty": false, - "fallback_used": true - } - ], - "failure_reasons": [], - "timings_ms": { - "router": 0, - "retrieval_total": 34, - "symbol_resolution": 0 - } -} \ No newline at end of file diff --git a/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_233701/20260311_233701_find_tests_positive.md b/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_233701/20260311_233701_find_tests_positive.md deleted file mode 100644 index c4f89dc..0000000 --- a/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_233701/20260311_233701_find_tests_positive.md +++ /dev/null @@ -1,32 +0,0 @@ -# find_tests_positive - -## Query -Где тесты для OrderService? - -## Expected -- intent: CODE_QA, sub_intent: FIND_TESTS -- answer_mode: normal - -## Actual -- intent: CODE_QA, sub_intent: FIND_TESTS -- answer_mode: normal -- evidence_gate_passed: True -- evidence_count: 8 - -## Result -PASS - -## Router -- path_scope: [] -- layers: ['C1_SYMBOL_CATALOG', 'C2_DEPENDENCY_GRAPH', 'C0_SOURCE_CHUNKS'] - -## Retrieval -- requested_layers: ['C1_SYMBOL_CATALOG', 'C2_DEPENDENCY_GRAPH', 'C0_SOURCE_CHUNKS'] -- chunk_count: 8 -- layer_outcomes: [('C1_SYMBOL_CATALOG', 0), ('C2_DEPENDENCY_GRAPH', 6), ('C0_SOURCE_CHUNKS', 2)] - -## Evidence gate -- failure_reasons: [] - -## Timings (ms) -{'router': 0, 'retrieval_total': 34, 'symbol_resolution': 0} diff --git a/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_233701/20260311_233701_general_qa_borderline.json b/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_233701/20260311_233701_general_qa_borderline.json deleted file mode 100644 index a6fc810..0000000 --- a/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_233701/20260311_233701_general_qa_borderline.json +++ /dev/null @@ -1,87 +0,0 @@ -{ - "case_id": "general_qa_borderline", - "query": "Расскажи про код", - "expected": { - "intent": "CODE_QA", - "sub_intent": "GENERAL_QA", - "answer_mode": "normal" - }, - "actual": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "answer_mode": "normal", - "evidence_gate_passed": true, - "evidence_count": 29 - }, - "passed": false, - "mismatches": [ - "sub_intent: expected GENERAL_QA, got EXPLAIN" - ], - "router_result": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "retrieval_profile": "code", - "sub_intent": "EXPLAIN", - "path_scope": [], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "symbol_resolution_status": "not_requested" - }, - "retrieval_request": { - "rag_session_id": "564f37c4-259f-4d21-be24-04b3a51e3c64", - "query": "Расскажи про код", - "sub_intent": "EXPLAIN", - "path_scope": [], - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "per_layer_outcome": [ - { - "layer_id": "C1_SYMBOL_CATALOG", - "hit_count": 8, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C0_SOURCE_CHUNKS", - "hit_count": 8, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C4_SEMANTIC_ROLES", - "hit_count": 3, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C2_DEPENDENCY_GRAPH", - "hit_count": 6, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C3_ENTRYPOINTS", - "hit_count": 4, - "empty": false, - "fallback_used": false - } - ], - "failure_reasons": [], - "timings_ms": { - "router": 0, - "retrieval_total": 44, - "symbol_resolution": 0 - } -} \ No newline at end of file diff --git a/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_233701/20260311_233701_general_qa_borderline.md b/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_233701/20260311_233701_general_qa_borderline.md deleted file mode 100644 index 621b916..0000000 --- a/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_233701/20260311_233701_general_qa_borderline.md +++ /dev/null @@ -1,35 +0,0 @@ -# general_qa_borderline - -## Query -Расскажи про код - -## Expected -- intent: CODE_QA, sub_intent: GENERAL_QA -- answer_mode: normal - -## Actual -- intent: CODE_QA, sub_intent: EXPLAIN -- answer_mode: normal -- evidence_gate_passed: True -- evidence_count: 29 - -## Result -FAIL - -## Mismatches -- sub_intent: expected GENERAL_QA, got EXPLAIN - -## Router -- path_scope: [] -- layers: ['C1_SYMBOL_CATALOG', 'C0_SOURCE_CHUNKS', 'C4_SEMANTIC_ROLES', 'C2_DEPENDENCY_GRAPH', 'C3_ENTRYPOINTS'] - -## Retrieval -- requested_layers: ['C1_SYMBOL_CATALOG', 'C0_SOURCE_CHUNKS', 'C4_SEMANTIC_ROLES', 'C2_DEPENDENCY_GRAPH', 'C3_ENTRYPOINTS'] -- chunk_count: 29 -- layer_outcomes: [('C1_SYMBOL_CATALOG', 8), ('C0_SOURCE_CHUNKS', 8), ('C4_SEMANTIC_ROLES', 3), ('C2_DEPENDENCY_GRAPH', 6), ('C3_ENTRYPOINTS', 4)] - -## Evidence gate -- failure_reasons: [] - -## Timings (ms) -{'router': 0, 'retrieval_total': 44, 'symbol_resolution': 0} diff --git a/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_233701/20260311_233701_general_qa_how.json b/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_233701/20260311_233701_general_qa_how.json deleted file mode 100644 index 2ce2a76..0000000 --- a/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_233701/20260311_233701_general_qa_how.json +++ /dev/null @@ -1,87 +0,0 @@ -{ - "case_id": "general_qa_how", - "query": "How does order creation work?", - "expected": { - "intent": "CODE_QA", - "sub_intent": "GENERAL_QA", - "answer_mode": "normal" - }, - "actual": { - "intent": "CODE_QA", - "sub_intent": "ARCHITECTURE", - "answer_mode": "normal", - "evidence_gate_passed": true, - "evidence_count": 20 - }, - "passed": false, - "mismatches": [ - "sub_intent: expected GENERAL_QA, got ARCHITECTURE" - ], - "router_result": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "retrieval_profile": "code", - "sub_intent": "ARCHITECTURE", - "path_scope": [], - "layers": [ - "C4_SEMANTIC_ROLES", - "C3_ENTRYPOINTS", - "C2_DEPENDENCY_GRAPH", - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS" - ], - "symbol_resolution_status": "pending" - }, - "retrieval_request": { - "rag_session_id": "564f37c4-259f-4d21-be24-04b3a51e3c64", - "query": "How does order creation work?", - "sub_intent": "ARCHITECTURE", - "path_scope": [], - "requested_layers": [ - "C4_SEMANTIC_ROLES", - "C3_ENTRYPOINTS", - "C2_DEPENDENCY_GRAPH", - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS" - ] - }, - "per_layer_outcome": [ - { - "layer_id": "C4_SEMANTIC_ROLES", - "hit_count": 3, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C3_ENTRYPOINTS", - "hit_count": 4, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C2_DEPENDENCY_GRAPH", - "hit_count": 8, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C1_SYMBOL_CATALOG", - "hit_count": 1, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C0_SOURCE_CHUNKS", - "hit_count": 4, - "empty": false, - "fallback_used": false - } - ], - "failure_reasons": [], - "timings_ms": { - "router": 0, - "retrieval_total": 43, - "symbol_resolution": 0 - } -} \ No newline at end of file diff --git a/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_233701/20260311_233701_general_qa_how.md b/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_233701/20260311_233701_general_qa_how.md deleted file mode 100644 index 27d876e..0000000 --- a/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_233701/20260311_233701_general_qa_how.md +++ /dev/null @@ -1,35 +0,0 @@ -# general_qa_how - -## Query -How does order creation work? - -## Expected -- intent: CODE_QA, sub_intent: GENERAL_QA -- answer_mode: normal - -## Actual -- intent: CODE_QA, sub_intent: ARCHITECTURE -- answer_mode: normal -- evidence_gate_passed: True -- evidence_count: 20 - -## Result -FAIL - -## Mismatches -- sub_intent: expected GENERAL_QA, got ARCHITECTURE - -## Router -- path_scope: [] -- layers: ['C4_SEMANTIC_ROLES', 'C3_ENTRYPOINTS', 'C2_DEPENDENCY_GRAPH', 'C1_SYMBOL_CATALOG', 'C0_SOURCE_CHUNKS'] - -## Retrieval -- requested_layers: ['C4_SEMANTIC_ROLES', 'C3_ENTRYPOINTS', 'C2_DEPENDENCY_GRAPH', 'C1_SYMBOL_CATALOG', 'C0_SOURCE_CHUNKS'] -- chunk_count: 20 -- layer_outcomes: [('C4_SEMANTIC_ROLES', 3), ('C3_ENTRYPOINTS', 4), ('C2_DEPENDENCY_GRAPH', 8), ('C1_SYMBOL_CATALOG', 1), ('C0_SOURCE_CHUNKS', 4)] - -## Evidence gate -- failure_reasons: [] - -## Timings (ms) -{'router': 0, 'retrieval_total': 43, 'symbol_resolution': 0} diff --git a/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_233701/20260311_233701_general_qa_positive.json b/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_233701/20260311_233701_general_qa_positive.json deleted file mode 100644 index 44d659f..0000000 --- a/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_233701/20260311_233701_general_qa_positive.json +++ /dev/null @@ -1,80 +0,0 @@ -{ - "case_id": "general_qa_positive", - "query": "Что делает этот проект?", - "expected": { - "intent": "CODE_QA", - "sub_intent": "GENERAL_QA", - "answer_mode": "normal" - }, - "actual": { - "intent": "PROJECT_MISC", - "sub_intent": "EXPLAIN", - "answer_mode": "normal", - "evidence_gate_passed": true, - "evidence_count": 8 - }, - "passed": false, - "mismatches": [ - "intent: expected CODE_QA, got PROJECT_MISC", - "sub_intent: expected GENERAL_QA, got EXPLAIN" - ], - "router_result": { - "intent": "PROJECT_MISC", - "graph_id": "ProjectMiscGraph", - "conversation_mode": "START", - "retrieval_profile": "code", - "sub_intent": "EXPLAIN", - "path_scope": [], - "layers": [ - "D1_MODULE_CATALOG", - "D3_SECTION_INDEX", - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS" - ], - "symbol_resolution_status": "not_requested" - }, - "retrieval_request": { - "rag_session_id": "564f37c4-259f-4d21-be24-04b3a51e3c64", - "query": "Что делает этот проект?", - "sub_intent": "EXPLAIN", - "path_scope": [], - "requested_layers": [ - "D1_MODULE_CATALOG", - "D3_SECTION_INDEX", - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS" - ] - }, - "per_layer_outcome": [ - { - "layer_id": "D1_MODULE_CATALOG", - "hit_count": 0, - "empty": true, - "fallback_used": true - }, - { - "layer_id": "D3_SECTION_INDEX", - "hit_count": 0, - "empty": true, - "fallback_used": true - }, - { - "layer_id": "C1_SYMBOL_CATALOG", - "hit_count": 4, - "empty": false, - "fallback_used": true - }, - { - "layer_id": "C0_SOURCE_CHUNKS", - "hit_count": 4, - "empty": false, - "fallback_used": true - } - ], - "failure_reasons": [], - "timings_ms": { - "router": 0, - "retrieval_total": 46, - "symbol_resolution": 0 - } -} \ No newline at end of file diff --git a/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_233701/20260311_233701_general_qa_positive.md b/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_233701/20260311_233701_general_qa_positive.md deleted file mode 100644 index 549e623..0000000 --- a/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_233701/20260311_233701_general_qa_positive.md +++ /dev/null @@ -1,36 +0,0 @@ -# general_qa_positive - -## Query -Что делает этот проект? - -## Expected -- intent: CODE_QA, sub_intent: GENERAL_QA -- answer_mode: normal - -## Actual -- intent: PROJECT_MISC, sub_intent: EXPLAIN -- answer_mode: normal -- evidence_gate_passed: True -- evidence_count: 8 - -## Result -FAIL - -## Mismatches -- intent: expected CODE_QA, got PROJECT_MISC -- sub_intent: expected GENERAL_QA, got EXPLAIN - -## Router -- path_scope: [] -- layers: ['D1_MODULE_CATALOG', 'D3_SECTION_INDEX', 'C1_SYMBOL_CATALOG', 'C0_SOURCE_CHUNKS'] - -## Retrieval -- requested_layers: ['D1_MODULE_CATALOG', 'D3_SECTION_INDEX', 'C1_SYMBOL_CATALOG', 'C0_SOURCE_CHUNKS'] -- chunk_count: 8 -- layer_outcomes: [('D1_MODULE_CATALOG', 0), ('D3_SECTION_INDEX', 0), ('C1_SYMBOL_CATALOG', 4), ('C0_SOURCE_CHUNKS', 4)] - -## Evidence gate -- failure_reasons: [] - -## Timings (ms) -{'router': 0, 'retrieval_total': 46, 'symbol_resolution': 0} diff --git a/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_233701/20260311_233701_open_file_api_positive.json b/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_233701/20260311_233701_open_file_api_positive.json deleted file mode 100644 index 2c913ec..0000000 --- a/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_233701/20260311_233701_open_file_api_positive.json +++ /dev/null @@ -1,57 +0,0 @@ -{ - "case_id": "open_file_api_positive", - "query": "Покажи src/order_app/api/orders.py", - "expected": { - "intent": "CODE_QA", - "sub_intent": "OPEN_FILE", - "answer_mode": "normal" - }, - "actual": { - "intent": "CODE_QA", - "sub_intent": "OPEN_FILE", - "answer_mode": "normal", - "evidence_gate_passed": true, - "evidence_count": 1 - }, - "passed": true, - "mismatches": [], - "router_result": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "retrieval_profile": "code", - "sub_intent": "OPEN_FILE", - "path_scope": [ - "src/order_app/api/orders.py" - ], - "layers": [ - "C0_SOURCE_CHUNKS" - ], - "symbol_resolution_status": "not_requested" - }, - "retrieval_request": { - "rag_session_id": "564f37c4-259f-4d21-be24-04b3a51e3c64", - "query": "Покажи src/order_app/api/orders.py", - "sub_intent": "OPEN_FILE", - "path_scope": [ - "src/order_app/api/orders.py" - ], - "requested_layers": [ - "C0_SOURCE_CHUNKS" - ] - }, - "per_layer_outcome": [ - { - "layer_id": "C0_SOURCE_CHUNKS", - "hit_count": 1, - "empty": false, - "fallback_used": false - } - ], - "failure_reasons": [], - "timings_ms": { - "router": 0, - "retrieval_total": 8, - "symbol_resolution": 0 - } -} \ No newline at end of file diff --git a/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_233701/20260311_233701_open_file_api_positive.md b/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_233701/20260311_233701_open_file_api_positive.md deleted file mode 100644 index 2ab84d0..0000000 --- a/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_233701/20260311_233701_open_file_api_positive.md +++ /dev/null @@ -1,32 +0,0 @@ -# open_file_api_positive - -## Query -Покажи src/order_app/api/orders.py - -## Expected -- intent: CODE_QA, sub_intent: OPEN_FILE -- answer_mode: normal - -## Actual -- intent: CODE_QA, sub_intent: OPEN_FILE -- answer_mode: normal -- evidence_gate_passed: True -- evidence_count: 1 - -## Result -PASS - -## Router -- path_scope: ['src/order_app/api/orders.py'] -- layers: ['C0_SOURCE_CHUNKS'] - -## Retrieval -- requested_layers: ['C0_SOURCE_CHUNKS'] -- chunk_count: 1 -- layer_outcomes: [('C0_SOURCE_CHUNKS', 1)] - -## Evidence gate -- failure_reasons: [] - -## Timings (ms) -{'router': 0, 'retrieval_total': 8, 'symbol_resolution': 0} diff --git a/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_233701/20260311_233701_open_file_borderline.json b/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_233701/20260311_233701_open_file_borderline.json deleted file mode 100644 index 0bad448..0000000 --- a/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_233701/20260311_233701_open_file_borderline.json +++ /dev/null @@ -1,63 +0,0 @@ -{ - "case_id": "open_file_borderline", - "query": "Open main", - "expected": { - "intent": "CODE_QA", - "sub_intent": "OPEN_FILE", - "answer_mode": "normal" - }, - "actual": { - "intent": "CODE_QA", - "sub_intent": "FIND_ENTRYPOINTS", - "answer_mode": "normal", - "evidence_gate_passed": true, - "evidence_count": 10 - }, - "passed": false, - "mismatches": [ - "sub_intent: expected OPEN_FILE, got FIND_ENTRYPOINTS" - ], - "router_result": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "retrieval_profile": "code", - "sub_intent": "FIND_ENTRYPOINTS", - "path_scope": [], - "layers": [ - "C3_ENTRYPOINTS", - "C0_SOURCE_CHUNKS" - ], - "symbol_resolution_status": "pending" - }, - "retrieval_request": { - "rag_session_id": "564f37c4-259f-4d21-be24-04b3a51e3c64", - "query": "Open main", - "sub_intent": "FIND_ENTRYPOINTS", - "path_scope": [], - "requested_layers": [ - "C3_ENTRYPOINTS", - "C0_SOURCE_CHUNKS" - ] - }, - "per_layer_outcome": [ - { - "layer_id": "C3_ENTRYPOINTS", - "hit_count": 4, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C0_SOURCE_CHUNKS", - "hit_count": 6, - "empty": false, - "fallback_used": false - } - ], - "failure_reasons": [], - "timings_ms": { - "router": 0, - "retrieval_total": 25, - "symbol_resolution": 0 - } -} \ No newline at end of file diff --git a/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_233701/20260311_233701_open_file_borderline.md b/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_233701/20260311_233701_open_file_borderline.md deleted file mode 100644 index 65fc0ba..0000000 --- a/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_233701/20260311_233701_open_file_borderline.md +++ /dev/null @@ -1,35 +0,0 @@ -# open_file_borderline - -## Query -Open main - -## Expected -- intent: CODE_QA, sub_intent: OPEN_FILE -- answer_mode: normal - -## Actual -- intent: CODE_QA, sub_intent: FIND_ENTRYPOINTS -- answer_mode: normal -- evidence_gate_passed: True -- evidence_count: 10 - -## Result -FAIL - -## Mismatches -- sub_intent: expected OPEN_FILE, got FIND_ENTRYPOINTS - -## Router -- path_scope: [] -- layers: ['C3_ENTRYPOINTS', 'C0_SOURCE_CHUNKS'] - -## Retrieval -- requested_layers: ['C3_ENTRYPOINTS', 'C0_SOURCE_CHUNKS'] -- chunk_count: 10 -- layer_outcomes: [('C3_ENTRYPOINTS', 4), ('C0_SOURCE_CHUNKS', 6)] - -## Evidence gate -- failure_reasons: [] - -## Timings (ms) -{'router': 0, 'retrieval_total': 25, 'symbol_resolution': 0} diff --git a/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_233701/20260311_233701_open_file_main_positive.json b/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_233701/20260311_233701_open_file_main_positive.json deleted file mode 100644 index be4a922..0000000 --- a/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_233701/20260311_233701_open_file_main_positive.json +++ /dev/null @@ -1,57 +0,0 @@ -{ - "case_id": "open_file_main_positive", - "query": "Открой файл main.py", - "expected": { - "intent": "CODE_QA", - "sub_intent": "OPEN_FILE", - "answer_mode": "normal" - }, - "actual": { - "intent": "CODE_QA", - "sub_intent": "OPEN_FILE", - "answer_mode": "normal", - "evidence_gate_passed": true, - "evidence_count": 1 - }, - "passed": true, - "mismatches": [], - "router_result": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "retrieval_profile": "code", - "sub_intent": "OPEN_FILE", - "path_scope": [ - "main.py" - ], - "layers": [ - "C0_SOURCE_CHUNKS" - ], - "symbol_resolution_status": "not_requested" - }, - "retrieval_request": { - "rag_session_id": "564f37c4-259f-4d21-be24-04b3a51e3c64", - "query": "Открой файл main.py", - "sub_intent": "OPEN_FILE", - "path_scope": [ - "main.py" - ], - "requested_layers": [ - "C0_SOURCE_CHUNKS" - ] - }, - "per_layer_outcome": [ - { - "layer_id": "C0_SOURCE_CHUNKS", - "hit_count": 1, - "empty": false, - "fallback_used": false - } - ], - "failure_reasons": [], - "timings_ms": { - "router": 0, - "retrieval_total": 6, - "symbol_resolution": 0 - } -} \ No newline at end of file diff --git a/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_233701/20260311_233701_open_file_main_positive.md b/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_233701/20260311_233701_open_file_main_positive.md deleted file mode 100644 index 2ab4fc7..0000000 --- a/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_233701/20260311_233701_open_file_main_positive.md +++ /dev/null @@ -1,32 +0,0 @@ -# open_file_main_positive - -## Query -Открой файл main.py - -## Expected -- intent: CODE_QA, sub_intent: OPEN_FILE -- answer_mode: normal - -## Actual -- intent: CODE_QA, sub_intent: OPEN_FILE -- answer_mode: normal -- evidence_gate_passed: True -- evidence_count: 1 - -## Result -PASS - -## Router -- path_scope: ['main.py'] -- layers: ['C0_SOURCE_CHUNKS'] - -## Retrieval -- requested_layers: ['C0_SOURCE_CHUNKS'] -- chunk_count: 1 -- layer_outcomes: [('C0_SOURCE_CHUNKS', 1)] - -## Evidence gate -- failure_reasons: [] - -## Timings (ms) -{'router': 0, 'retrieval_total': 6, 'symbol_resolution': 0} diff --git a/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_233701/20260311_233701_open_file_negative.json b/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_233701/20260311_233701_open_file_negative.json deleted file mode 100644 index b3c840f..0000000 --- a/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_233701/20260311_233701_open_file_negative.json +++ /dev/null @@ -1,62 +0,0 @@ -{ - "case_id": "open_file_negative", - "query": "Открой файл nonexistent/foo.py", - "expected": { - "intent": "CODE_QA", - "sub_intent": "OPEN_FILE", - "answer_mode": "degraded" - }, - "actual": { - "intent": "CODE_QA", - "sub_intent": "OPEN_FILE", - "answer_mode": "insufficient", - "evidence_gate_passed": false, - "evidence_count": 0 - }, - "passed": false, - "mismatches": [ - "answer_mode: expected degraded, got insufficient" - ], - "router_result": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "retrieval_profile": "code", - "sub_intent": "OPEN_FILE", - "path_scope": [ - "nonexistent/foo.py" - ], - "layers": [ - "C0_SOURCE_CHUNKS" - ], - "symbol_resolution_status": "not_requested" - }, - "retrieval_request": { - "rag_session_id": "564f37c4-259f-4d21-be24-04b3a51e3c64", - "query": "Открой файл nonexistent/foo.py", - "sub_intent": "OPEN_FILE", - "path_scope": [ - "nonexistent/foo.py" - ], - "requested_layers": [ - "C0_SOURCE_CHUNKS" - ] - }, - "per_layer_outcome": [ - { - "layer_id": "C0_SOURCE_CHUNKS", - "hit_count": 0, - "empty": true, - "fallback_used": false - } - ], - "failure_reasons": [ - "path_scope_empty", - "layer_c0_empty" - ], - "timings_ms": { - "router": 0, - "retrieval_total": 6, - "symbol_resolution": 0 - } -} \ No newline at end of file diff --git a/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_233701/20260311_233701_open_file_negative.md b/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_233701/20260311_233701_open_file_negative.md deleted file mode 100644 index 606f266..0000000 --- a/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_233701/20260311_233701_open_file_negative.md +++ /dev/null @@ -1,35 +0,0 @@ -# open_file_negative - -## Query -Открой файл nonexistent/foo.py - -## Expected -- intent: CODE_QA, sub_intent: OPEN_FILE -- answer_mode: degraded - -## Actual -- intent: CODE_QA, sub_intent: OPEN_FILE -- answer_mode: insufficient -- evidence_gate_passed: False -- evidence_count: 0 - -## Result -FAIL - -## Mismatches -- answer_mode: expected degraded, got insufficient - -## Router -- path_scope: ['nonexistent/foo.py'] -- layers: ['C0_SOURCE_CHUNKS'] - -## Retrieval -- requested_layers: ['C0_SOURCE_CHUNKS'] -- chunk_count: 0 -- layer_outcomes: [('C0_SOURCE_CHUNKS', 0)] - -## Evidence gate -- failure_reasons: ['path_scope_empty', 'layer_c0_empty'] - -## Timings (ms) -{'router': 0, 'retrieval_total': 6, 'symbol_resolution': 0} diff --git a/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_233942/20260311_233942_explain_borderline.json b/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_233942/20260311_233942_explain_borderline.json deleted file mode 100644 index 4a10b27..0000000 --- a/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_233942/20260311_233942_explain_borderline.json +++ /dev/null @@ -1,79 +0,0 @@ -{ - "case_id": "explain_borderline", - "query": "Что делает create_order?", - "expected": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "answer_mode": "normal" - }, - "actual": { - "intent": "PROJECT_MISC", - "sub_intent": "EXPLAIN", - "answer_mode": "normal", - "evidence_gate_passed": true, - "evidence_count": 5 - }, - "passed": false, - "mismatches": [ - "intent: expected CODE_QA, got PROJECT_MISC" - ], - "router_result": { - "intent": "PROJECT_MISC", - "graph_id": "ProjectMiscGraph", - "conversation_mode": "START", - "retrieval_profile": "code", - "sub_intent": "EXPLAIN", - "path_scope": [], - "layers": [ - "D1_MODULE_CATALOG", - "D3_SECTION_INDEX", - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS" - ], - "symbol_resolution_status": "pending" - }, - "retrieval_request": { - "rag_session_id": "d494838f-a9df-4e86-a11a-a2cf8225dbe5", - "query": "Что делает create_order?", - "sub_intent": "EXPLAIN", - "path_scope": [], - "requested_layers": [ - "D1_MODULE_CATALOG", - "D3_SECTION_INDEX", - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS" - ] - }, - "per_layer_outcome": [ - { - "layer_id": "D1_MODULE_CATALOG", - "hit_count": 0, - "empty": true, - "fallback_used": false - }, - { - "layer_id": "D3_SECTION_INDEX", - "hit_count": 0, - "empty": true, - "fallback_used": false - }, - { - "layer_id": "C1_SYMBOL_CATALOG", - "hit_count": 1, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C0_SOURCE_CHUNKS", - "hit_count": 4, - "empty": false, - "fallback_used": false - } - ], - "failure_reasons": [], - "timings_ms": { - "router": 0, - "retrieval_total": 31, - "symbol_resolution": 0 - } -} \ No newline at end of file diff --git a/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_233942/20260311_233942_explain_borderline.md b/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_233942/20260311_233942_explain_borderline.md deleted file mode 100644 index c244db7..0000000 --- a/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_233942/20260311_233942_explain_borderline.md +++ /dev/null @@ -1,35 +0,0 @@ -# explain_borderline - -## Query -Что делает create_order? - -## Expected -- intent: CODE_QA, sub_intent: EXPLAIN -- answer_mode: normal - -## Actual -- intent: PROJECT_MISC, sub_intent: EXPLAIN -- answer_mode: normal -- evidence_gate_passed: True -- evidence_count: 5 - -## Result -FAIL - -## Mismatches -- intent: expected CODE_QA, got PROJECT_MISC - -## Router -- path_scope: [] -- layers: ['D1_MODULE_CATALOG', 'D3_SECTION_INDEX', 'C1_SYMBOL_CATALOG', 'C0_SOURCE_CHUNKS'] - -## Retrieval -- requested_layers: ['D1_MODULE_CATALOG', 'D3_SECTION_INDEX', 'C1_SYMBOL_CATALOG', 'C0_SOURCE_CHUNKS'] -- chunk_count: 5 -- layer_outcomes: [('D1_MODULE_CATALOG', 0), ('D3_SECTION_INDEX', 0), ('C1_SYMBOL_CATALOG', 1), ('C0_SOURCE_CHUNKS', 4)] - -## Evidence gate -- failure_reasons: [] - -## Timings (ms) -{'router': 0, 'retrieval_total': 31, 'symbol_resolution': 0} diff --git a/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_233942/20260311_233942_explain_negative.json b/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_233942/20260311_233942_explain_negative.json deleted file mode 100644 index ce85a9c..0000000 --- a/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_233942/20260311_233942_explain_negative.json +++ /dev/null @@ -1,87 +0,0 @@ -{ - "case_id": "explain_negative", - "query": "Объясни класс NonExistentClass", - "expected": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "answer_mode": "degraded" - }, - "actual": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "answer_mode": "normal", - "evidence_gate_passed": true, - "evidence_count": 22 - }, - "passed": false, - "mismatches": [ - "answer_mode: expected degraded, got normal" - ], - "router_result": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "retrieval_profile": "code", - "sub_intent": "EXPLAIN", - "path_scope": [], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "symbol_resolution_status": "pending" - }, - "retrieval_request": { - "rag_session_id": "d494838f-a9df-4e86-a11a-a2cf8225dbe5", - "query": "Объясни класс NonExistentClass", - "sub_intent": "EXPLAIN", - "path_scope": [], - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "per_layer_outcome": [ - { - "layer_id": "C1_SYMBOL_CATALOG", - "hit_count": 1, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C0_SOURCE_CHUNKS", - "hit_count": 8, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C4_SEMANTIC_ROLES", - "hit_count": 3, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C2_DEPENDENCY_GRAPH", - "hit_count": 6, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C3_ENTRYPOINTS", - "hit_count": 4, - "empty": false, - "fallback_used": false - } - ], - "failure_reasons": [], - "timings_ms": { - "router": 0, - "retrieval_total": 40, - "symbol_resolution": 0 - } -} \ No newline at end of file diff --git a/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_233942/20260311_233942_explain_negative.md b/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_233942/20260311_233942_explain_negative.md deleted file mode 100644 index 587277e..0000000 --- a/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_233942/20260311_233942_explain_negative.md +++ /dev/null @@ -1,35 +0,0 @@ -# explain_negative - -## Query -Объясни класс NonExistentClass - -## Expected -- intent: CODE_QA, sub_intent: EXPLAIN -- answer_mode: degraded - -## Actual -- intent: CODE_QA, sub_intent: EXPLAIN -- answer_mode: normal -- evidence_gate_passed: True -- evidence_count: 22 - -## Result -FAIL - -## Mismatches -- answer_mode: expected degraded, got normal - -## Router -- path_scope: [] -- layers: ['C1_SYMBOL_CATALOG', 'C0_SOURCE_CHUNKS', 'C4_SEMANTIC_ROLES', 'C2_DEPENDENCY_GRAPH', 'C3_ENTRYPOINTS'] - -## Retrieval -- requested_layers: ['C1_SYMBOL_CATALOG', 'C0_SOURCE_CHUNKS', 'C4_SEMANTIC_ROLES', 'C2_DEPENDENCY_GRAPH', 'C3_ENTRYPOINTS'] -- chunk_count: 22 -- layer_outcomes: [('C1_SYMBOL_CATALOG', 1), ('C0_SOURCE_CHUNKS', 8), ('C4_SEMANTIC_ROLES', 3), ('C2_DEPENDENCY_GRAPH', 6), ('C3_ENTRYPOINTS', 4)] - -## Evidence gate -- failure_reasons: [] - -## Timings (ms) -{'router': 0, 'retrieval_total': 40, 'symbol_resolution': 0} diff --git a/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_233942/20260311_233942_explain_order_positive.json b/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_233942/20260311_233942_explain_order_positive.json deleted file mode 100644 index 7fc9d72..0000000 --- a/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_233942/20260311_233942_explain_order_positive.json +++ /dev/null @@ -1,61 +0,0 @@ -{ - "case_id": "explain_order_positive", - "query": "Объясни класс Order", - "expected": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "answer_mode": "normal" - }, - "actual": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "answer_mode": "normal", - "evidence_gate_passed": true, - "evidence_count": 15 - }, - "passed": true, - "mismatches": [], - "router_result": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "retrieval_profile": "code", - "sub_intent": "EXPLAIN", - "path_scope": [], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "symbol_resolution_status": "pending" - }, - "retrieval_request": { - "rag_session_id": "d494838f-a9df-4e86-a11a-a2cf8225dbe5", - "query": "Объясни класс Order", - "sub_intent": "EXPLAIN", - "path_scope": [], - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "per_layer_outcome": [ - { - "layer_id": "C0_SOURCE_CHUNKS", - "hit_count": 1, - "empty": false, - "fallback_used": false - } - ], - "failure_reasons": [], - "timings_ms": { - "router": 0, - "retrieval_total": 41, - "symbol_resolution": 0 - } -} \ No newline at end of file diff --git a/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_233942/20260311_233942_explain_order_positive.md b/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_233942/20260311_233942_explain_order_positive.md deleted file mode 100644 index 405041a..0000000 --- a/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_233942/20260311_233942_explain_order_positive.md +++ /dev/null @@ -1,32 +0,0 @@ -# explain_order_positive - -## Query -Объясни класс Order - -## Expected -- intent: CODE_QA, sub_intent: EXPLAIN -- answer_mode: normal - -## Actual -- intent: CODE_QA, sub_intent: EXPLAIN -- answer_mode: normal -- evidence_gate_passed: True -- evidence_count: 15 - -## Result -PASS - -## Router -- path_scope: [] -- layers: ['C1_SYMBOL_CATALOG', 'C0_SOURCE_CHUNKS', 'C4_SEMANTIC_ROLES', 'C2_DEPENDENCY_GRAPH', 'C3_ENTRYPOINTS'] - -## Retrieval -- requested_layers: ['C1_SYMBOL_CATALOG', 'C0_SOURCE_CHUNKS', 'C4_SEMANTIC_ROLES', 'C2_DEPENDENCY_GRAPH', 'C3_ENTRYPOINTS'] -- chunk_count: 15 -- layer_outcomes: [('C0_SOURCE_CHUNKS', 1)] - -## Evidence gate -- failure_reasons: [] - -## Timings (ms) -{'router': 0, 'retrieval_total': 41, 'symbol_resolution': 0} diff --git a/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_233942/20260311_233942_explain_order_service_positive.json b/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_233942/20260311_233942_explain_order_service_positive.json deleted file mode 100644 index 1376d03..0000000 --- a/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_233942/20260311_233942_explain_order_service_positive.json +++ /dev/null @@ -1,61 +0,0 @@ -{ - "case_id": "explain_order_service_positive", - "query": "Как работает OrderService?", - "expected": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "answer_mode": "normal" - }, - "actual": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "answer_mode": "normal", - "evidence_gate_passed": true, - "evidence_count": 15 - }, - "passed": true, - "mismatches": [], - "router_result": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "retrieval_profile": "code", - "sub_intent": "EXPLAIN", - "path_scope": [], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "symbol_resolution_status": "pending" - }, - "retrieval_request": { - "rag_session_id": "d494838f-a9df-4e86-a11a-a2cf8225dbe5", - "query": "Как работает OrderService?", - "sub_intent": "EXPLAIN", - "path_scope": [], - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "per_layer_outcome": [ - { - "layer_id": "C0_SOURCE_CHUNKS", - "hit_count": 1, - "empty": false, - "fallback_used": false - } - ], - "failure_reasons": [], - "timings_ms": { - "router": 0, - "retrieval_total": 44, - "symbol_resolution": 0 - } -} \ No newline at end of file diff --git a/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_233942/20260311_233942_explain_order_service_positive.md b/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_233942/20260311_233942_explain_order_service_positive.md deleted file mode 100644 index 0541568..0000000 --- a/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_233942/20260311_233942_explain_order_service_positive.md +++ /dev/null @@ -1,32 +0,0 @@ -# explain_order_service_positive - -## Query -Как работает OrderService? - -## Expected -- intent: CODE_QA, sub_intent: EXPLAIN -- answer_mode: normal - -## Actual -- intent: CODE_QA, sub_intent: EXPLAIN -- answer_mode: normal -- evidence_gate_passed: True -- evidence_count: 15 - -## Result -PASS - -## Router -- path_scope: [] -- layers: ['C1_SYMBOL_CATALOG', 'C0_SOURCE_CHUNKS', 'C4_SEMANTIC_ROLES', 'C2_DEPENDENCY_GRAPH', 'C3_ENTRYPOINTS'] - -## Retrieval -- requested_layers: ['C1_SYMBOL_CATALOG', 'C0_SOURCE_CHUNKS', 'C4_SEMANTIC_ROLES', 'C2_DEPENDENCY_GRAPH', 'C3_ENTRYPOINTS'] -- chunk_count: 15 -- layer_outcomes: [('C0_SOURCE_CHUNKS', 1)] - -## Evidence gate -- failure_reasons: [] - -## Timings (ms) -{'router': 0, 'retrieval_total': 44, 'symbol_resolution': 0} diff --git a/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_233942/20260311_233942_find_entrypoints_borderline.json b/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_233942/20260311_233942_find_entrypoints_borderline.json deleted file mode 100644 index 235d90b..0000000 --- a/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_233942/20260311_233942_find_entrypoints_borderline.json +++ /dev/null @@ -1,82 +0,0 @@ -{ - "case_id": "find_entrypoints_borderline", - "query": "Где main?", - "expected": { - "intent": "CODE_QA", - "sub_intent": "FIND_ENTRYPOINTS", - "answer_mode": "normal" - }, - "actual": { - "intent": "PROJECT_MISC", - "sub_intent": "FIND_ENTRYPOINTS", - "answer_mode": "degraded", - "evidence_gate_passed": false, - "evidence_count": 6 - }, - "passed": false, - "mismatches": [ - "intent: expected CODE_QA, got PROJECT_MISC", - "answer_mode: expected normal, got degraded" - ], - "router_result": { - "intent": "PROJECT_MISC", - "graph_id": "ProjectMiscGraph", - "conversation_mode": "START", - "retrieval_profile": "code", - "sub_intent": "FIND_ENTRYPOINTS", - "path_scope": [], - "layers": [ - "D1_MODULE_CATALOG", - "D3_SECTION_INDEX", - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS" - ], - "symbol_resolution_status": "pending" - }, - "retrieval_request": { - "rag_session_id": "d494838f-a9df-4e86-a11a-a2cf8225dbe5", - "query": "Где main?", - "sub_intent": "FIND_ENTRYPOINTS", - "path_scope": [], - "requested_layers": [ - "D1_MODULE_CATALOG", - "D3_SECTION_INDEX", - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS" - ] - }, - "per_layer_outcome": [ - { - "layer_id": "D1_MODULE_CATALOG", - "hit_count": 0, - "empty": true, - "fallback_used": true - }, - { - "layer_id": "D3_SECTION_INDEX", - "hit_count": 0, - "empty": true, - "fallback_used": true - }, - { - "layer_id": "C1_SYMBOL_CATALOG", - "hit_count": 2, - "empty": false, - "fallback_used": true - }, - { - "layer_id": "C0_SOURCE_CHUNKS", - "hit_count": 4, - "empty": false, - "fallback_used": true - } - ], - "failure_reasons": [ - "entrypoints_not_found" - ], - "timings_ms": { - "router": 0, - "retrieval_total": 45, - "symbol_resolution": 0 - } -} \ No newline at end of file diff --git a/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_233942/20260311_233942_find_entrypoints_borderline.md b/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_233942/20260311_233942_find_entrypoints_borderline.md deleted file mode 100644 index 34bc088..0000000 --- a/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_233942/20260311_233942_find_entrypoints_borderline.md +++ /dev/null @@ -1,36 +0,0 @@ -# find_entrypoints_borderline - -## Query -Где main? - -## Expected -- intent: CODE_QA, sub_intent: FIND_ENTRYPOINTS -- answer_mode: normal - -## Actual -- intent: PROJECT_MISC, sub_intent: FIND_ENTRYPOINTS -- answer_mode: degraded -- evidence_gate_passed: False -- evidence_count: 6 - -## Result -FAIL - -## Mismatches -- intent: expected CODE_QA, got PROJECT_MISC -- answer_mode: expected normal, got degraded - -## Router -- path_scope: [] -- layers: ['D1_MODULE_CATALOG', 'D3_SECTION_INDEX', 'C1_SYMBOL_CATALOG', 'C0_SOURCE_CHUNKS'] - -## Retrieval -- requested_layers: ['D1_MODULE_CATALOG', 'D3_SECTION_INDEX', 'C1_SYMBOL_CATALOG', 'C0_SOURCE_CHUNKS'] -- chunk_count: 6 -- layer_outcomes: [('D1_MODULE_CATALOG', 0), ('D3_SECTION_INDEX', 0), ('C1_SYMBOL_CATALOG', 2), ('C0_SOURCE_CHUNKS', 4)] - -## Evidence gate -- failure_reasons: ['entrypoints_not_found'] - -## Timings (ms) -{'router': 0, 'retrieval_total': 45, 'symbol_resolution': 0} diff --git a/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_233942/20260311_233942_find_entrypoints_english.json b/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_233942/20260311_233942_find_entrypoints_english.json deleted file mode 100644 index b2a7503..0000000 --- a/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_233942/20260311_233942_find_entrypoints_english.json +++ /dev/null @@ -1,61 +0,0 @@ -{ - "case_id": "find_entrypoints_english", - "query": "Find application entrypoints", - "expected": { - "intent": "CODE_QA", - "sub_intent": "FIND_ENTRYPOINTS", - "answer_mode": "normal" - }, - "actual": { - "intent": "CODE_QA", - "sub_intent": "FIND_ENTRYPOINTS", - "answer_mode": "normal", - "evidence_gate_passed": true, - "evidence_count": 10 - }, - "passed": true, - "mismatches": [], - "router_result": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "retrieval_profile": "code", - "sub_intent": "FIND_ENTRYPOINTS", - "path_scope": [], - "layers": [ - "C3_ENTRYPOINTS", - "C0_SOURCE_CHUNKS" - ], - "symbol_resolution_status": "pending" - }, - "retrieval_request": { - "rag_session_id": "d494838f-a9df-4e86-a11a-a2cf8225dbe5", - "query": "Find application entrypoints", - "sub_intent": "FIND_ENTRYPOINTS", - "path_scope": [], - "requested_layers": [ - "C3_ENTRYPOINTS", - "C0_SOURCE_CHUNKS" - ] - }, - "per_layer_outcome": [ - { - "layer_id": "C3_ENTRYPOINTS", - "hit_count": 4, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C0_SOURCE_CHUNKS", - "hit_count": 6, - "empty": false, - "fallback_used": false - } - ], - "failure_reasons": [], - "timings_ms": { - "router": 0, - "retrieval_total": 16, - "symbol_resolution": 0 - } -} \ No newline at end of file diff --git a/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_233942/20260311_233942_find_entrypoints_english.md b/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_233942/20260311_233942_find_entrypoints_english.md deleted file mode 100644 index b74d01b..0000000 --- a/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_233942/20260311_233942_find_entrypoints_english.md +++ /dev/null @@ -1,32 +0,0 @@ -# find_entrypoints_english - -## Query -Find application entrypoints - -## Expected -- intent: CODE_QA, sub_intent: FIND_ENTRYPOINTS -- answer_mode: normal - -## Actual -- intent: CODE_QA, sub_intent: FIND_ENTRYPOINTS -- answer_mode: normal -- evidence_gate_passed: True -- evidence_count: 10 - -## Result -PASS - -## Router -- path_scope: [] -- layers: ['C3_ENTRYPOINTS', 'C0_SOURCE_CHUNKS'] - -## Retrieval -- requested_layers: ['C3_ENTRYPOINTS', 'C0_SOURCE_CHUNKS'] -- chunk_count: 10 -- layer_outcomes: [('C3_ENTRYPOINTS', 4), ('C0_SOURCE_CHUNKS', 6)] - -## Evidence gate -- failure_reasons: [] - -## Timings (ms) -{'router': 0, 'retrieval_total': 16, 'symbol_resolution': 0} diff --git a/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_233942/20260311_233942_find_entrypoints_positive.json b/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_233942/20260311_233942_find_entrypoints_positive.json deleted file mode 100644 index aa7ce4d..0000000 --- a/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_233942/20260311_233942_find_entrypoints_positive.json +++ /dev/null @@ -1,82 +0,0 @@ -{ - "case_id": "find_entrypoints_positive", - "query": "Какие точки входа в приложение?", - "expected": { - "intent": "CODE_QA", - "sub_intent": "FIND_ENTRYPOINTS", - "answer_mode": "normal" - }, - "actual": { - "intent": "PROJECT_MISC", - "sub_intent": "FIND_ENTRYPOINTS", - "answer_mode": "degraded", - "evidence_gate_passed": false, - "evidence_count": 8 - }, - "passed": false, - "mismatches": [ - "intent: expected CODE_QA, got PROJECT_MISC", - "answer_mode: expected normal, got degraded" - ], - "router_result": { - "intent": "PROJECT_MISC", - "graph_id": "ProjectMiscGraph", - "conversation_mode": "START", - "retrieval_profile": "code", - "sub_intent": "FIND_ENTRYPOINTS", - "path_scope": [], - "layers": [ - "D1_MODULE_CATALOG", - "D3_SECTION_INDEX", - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS" - ], - "symbol_resolution_status": "not_requested" - }, - "retrieval_request": { - "rag_session_id": "d494838f-a9df-4e86-a11a-a2cf8225dbe5", - "query": "Какие точки входа в приложение?", - "sub_intent": "FIND_ENTRYPOINTS", - "path_scope": [], - "requested_layers": [ - "D1_MODULE_CATALOG", - "D3_SECTION_INDEX", - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS" - ] - }, - "per_layer_outcome": [ - { - "layer_id": "D1_MODULE_CATALOG", - "hit_count": 0, - "empty": true, - "fallback_used": true - }, - { - "layer_id": "D3_SECTION_INDEX", - "hit_count": 0, - "empty": true, - "fallback_used": true - }, - { - "layer_id": "C1_SYMBOL_CATALOG", - "hit_count": 4, - "empty": false, - "fallback_used": true - }, - { - "layer_id": "C0_SOURCE_CHUNKS", - "hit_count": 4, - "empty": false, - "fallback_used": true - } - ], - "failure_reasons": [ - "entrypoints_not_found" - ], - "timings_ms": { - "router": 0, - "retrieval_total": 45, - "symbol_resolution": 0 - } -} \ No newline at end of file diff --git a/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_233942/20260311_233942_find_entrypoints_positive.md b/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_233942/20260311_233942_find_entrypoints_positive.md deleted file mode 100644 index 9fe0645..0000000 --- a/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_233942/20260311_233942_find_entrypoints_positive.md +++ /dev/null @@ -1,36 +0,0 @@ -# find_entrypoints_positive - -## Query -Какие точки входа в приложение? - -## Expected -- intent: CODE_QA, sub_intent: FIND_ENTRYPOINTS -- answer_mode: normal - -## Actual -- intent: PROJECT_MISC, sub_intent: FIND_ENTRYPOINTS -- answer_mode: degraded -- evidence_gate_passed: False -- evidence_count: 8 - -## Result -FAIL - -## Mismatches -- intent: expected CODE_QA, got PROJECT_MISC -- answer_mode: expected normal, got degraded - -## Router -- path_scope: [] -- layers: ['D1_MODULE_CATALOG', 'D3_SECTION_INDEX', 'C1_SYMBOL_CATALOG', 'C0_SOURCE_CHUNKS'] - -## Retrieval -- requested_layers: ['D1_MODULE_CATALOG', 'D3_SECTION_INDEX', 'C1_SYMBOL_CATALOG', 'C0_SOURCE_CHUNKS'] -- chunk_count: 8 -- layer_outcomes: [('D1_MODULE_CATALOG', 0), ('D3_SECTION_INDEX', 0), ('C1_SYMBOL_CATALOG', 4), ('C0_SOURCE_CHUNKS', 4)] - -## Evidence gate -- failure_reasons: ['entrypoints_not_found'] - -## Timings (ms) -{'router': 0, 'retrieval_total': 45, 'symbol_resolution': 0} diff --git a/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_233942/20260311_233942_find_tests_borderline.json b/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_233942/20260311_233942_find_tests_borderline.json deleted file mode 100644 index e237dc1..0000000 --- a/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_233942/20260311_233942_find_tests_borderline.json +++ /dev/null @@ -1,69 +0,0 @@ -{ - "case_id": "find_tests_borderline", - "query": "Есть ли тесты на репозиторий?", - "expected": { - "intent": "CODE_QA", - "sub_intent": "FIND_TESTS", - "answer_mode": "normal" - }, - "actual": { - "intent": "CODE_QA", - "sub_intent": "FIND_TESTS", - "answer_mode": "normal", - "evidence_gate_passed": true, - "evidence_count": 16 - }, - "passed": true, - "mismatches": [], - "router_result": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "retrieval_profile": "code", - "sub_intent": "FIND_TESTS", - "path_scope": [], - "layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ], - "symbol_resolution_status": "not_requested" - }, - "retrieval_request": { - "rag_session_id": "d494838f-a9df-4e86-a11a-a2cf8225dbe5", - "query": "Есть ли тесты на репозиторий?", - "sub_intent": "FIND_TESTS", - "path_scope": [], - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ] - }, - "per_layer_outcome": [ - { - "layer_id": "C1_SYMBOL_CATALOG", - "hit_count": 8, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C2_DEPENDENCY_GRAPH", - "hit_count": 6, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C0_SOURCE_CHUNKS", - "hit_count": 2, - "empty": false, - "fallback_used": false - } - ], - "failure_reasons": [], - "timings_ms": { - "router": 0, - "retrieval_total": 22, - "symbol_resolution": 0 - } -} \ No newline at end of file diff --git a/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_233942/20260311_233942_find_tests_borderline.md b/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_233942/20260311_233942_find_tests_borderline.md deleted file mode 100644 index 7b20089..0000000 --- a/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_233942/20260311_233942_find_tests_borderline.md +++ /dev/null @@ -1,32 +0,0 @@ -# find_tests_borderline - -## Query -Есть ли тесты на репозиторий? - -## Expected -- intent: CODE_QA, sub_intent: FIND_TESTS -- answer_mode: normal - -## Actual -- intent: CODE_QA, sub_intent: FIND_TESTS -- answer_mode: normal -- evidence_gate_passed: True -- evidence_count: 16 - -## Result -PASS - -## Router -- path_scope: [] -- layers: ['C1_SYMBOL_CATALOG', 'C2_DEPENDENCY_GRAPH', 'C0_SOURCE_CHUNKS'] - -## Retrieval -- requested_layers: ['C1_SYMBOL_CATALOG', 'C2_DEPENDENCY_GRAPH', 'C0_SOURCE_CHUNKS'] -- chunk_count: 16 -- layer_outcomes: [('C1_SYMBOL_CATALOG', 8), ('C2_DEPENDENCY_GRAPH', 6), ('C0_SOURCE_CHUNKS', 2)] - -## Evidence gate -- failure_reasons: [] - -## Timings (ms) -{'router': 0, 'retrieval_total': 22, 'symbol_resolution': 0} diff --git a/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_233942/20260311_233942_find_tests_negative.json b/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_233942/20260311_233942_find_tests_negative.json deleted file mode 100644 index 3f34198..0000000 --- a/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_233942/20260311_233942_find_tests_negative.json +++ /dev/null @@ -1,71 +0,0 @@ -{ - "case_id": "find_tests_negative", - "query": "Где тесты для NonExistent?", - "expected": { - "intent": "CODE_QA", - "sub_intent": "FIND_TESTS", - "answer_mode": "degraded" - }, - "actual": { - "intent": "CODE_QA", - "sub_intent": "FIND_TESTS", - "answer_mode": "normal", - "evidence_gate_passed": true, - "evidence_count": 8 - }, - "passed": false, - "mismatches": [ - "answer_mode: expected degraded, got normal" - ], - "router_result": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "retrieval_profile": "code", - "sub_intent": "FIND_TESTS", - "path_scope": [], - "layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ], - "symbol_resolution_status": "pending" - }, - "retrieval_request": { - "rag_session_id": "d494838f-a9df-4e86-a11a-a2cf8225dbe5", - "query": "Где тесты для NonExistent?", - "sub_intent": "FIND_TESTS", - "path_scope": [], - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ] - }, - "per_layer_outcome": [ - { - "layer_id": "C1_SYMBOL_CATALOG", - "hit_count": 0, - "empty": true, - "fallback_used": true - }, - { - "layer_id": "C2_DEPENDENCY_GRAPH", - "hit_count": 6, - "empty": false, - "fallback_used": true - }, - { - "layer_id": "C0_SOURCE_CHUNKS", - "hit_count": 2, - "empty": false, - "fallback_used": true - } - ], - "failure_reasons": [], - "timings_ms": { - "router": 0, - "retrieval_total": 31, - "symbol_resolution": 0 - } -} \ No newline at end of file diff --git a/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_233942/20260311_233942_find_tests_negative.md b/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_233942/20260311_233942_find_tests_negative.md deleted file mode 100644 index c72ea8a..0000000 --- a/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_233942/20260311_233942_find_tests_negative.md +++ /dev/null @@ -1,35 +0,0 @@ -# find_tests_negative - -## Query -Где тесты для NonExistent? - -## Expected -- intent: CODE_QA, sub_intent: FIND_TESTS -- answer_mode: degraded - -## Actual -- intent: CODE_QA, sub_intent: FIND_TESTS -- answer_mode: normal -- evidence_gate_passed: True -- evidence_count: 8 - -## Result -FAIL - -## Mismatches -- answer_mode: expected degraded, got normal - -## Router -- path_scope: [] -- layers: ['C1_SYMBOL_CATALOG', 'C2_DEPENDENCY_GRAPH', 'C0_SOURCE_CHUNKS'] - -## Retrieval -- requested_layers: ['C1_SYMBOL_CATALOG', 'C2_DEPENDENCY_GRAPH', 'C0_SOURCE_CHUNKS'] -- chunk_count: 8 -- layer_outcomes: [('C1_SYMBOL_CATALOG', 0), ('C2_DEPENDENCY_GRAPH', 6), ('C0_SOURCE_CHUNKS', 2)] - -## Evidence gate -- failure_reasons: [] - -## Timings (ms) -{'router': 0, 'retrieval_total': 31, 'symbol_resolution': 0} diff --git a/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_233942/20260311_233942_find_tests_order_positive.json b/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_233942/20260311_233942_find_tests_order_positive.json deleted file mode 100644 index dfc1c35..0000000 --- a/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_233942/20260311_233942_find_tests_order_positive.json +++ /dev/null @@ -1,69 +0,0 @@ -{ - "case_id": "find_tests_order_positive", - "query": "Найди тесты для Order", - "expected": { - "intent": "CODE_QA", - "sub_intent": "FIND_TESTS", - "answer_mode": "normal" - }, - "actual": { - "intent": "CODE_QA", - "sub_intent": "FIND_TESTS", - "answer_mode": "normal", - "evidence_gate_passed": true, - "evidence_count": 8 - }, - "passed": true, - "mismatches": [], - "router_result": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "retrieval_profile": "code", - "sub_intent": "FIND_TESTS", - "path_scope": [], - "layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ], - "symbol_resolution_status": "pending" - }, - "retrieval_request": { - "rag_session_id": "d494838f-a9df-4e86-a11a-a2cf8225dbe5", - "query": "Найди тесты для Order", - "sub_intent": "FIND_TESTS", - "path_scope": [], - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ] - }, - "per_layer_outcome": [ - { - "layer_id": "C1_SYMBOL_CATALOG", - "hit_count": 0, - "empty": true, - "fallback_used": true - }, - { - "layer_id": "C2_DEPENDENCY_GRAPH", - "hit_count": 6, - "empty": false, - "fallback_used": true - }, - { - "layer_id": "C0_SOURCE_CHUNKS", - "hit_count": 2, - "empty": false, - "fallback_used": true - } - ], - "failure_reasons": [], - "timings_ms": { - "router": 0, - "retrieval_total": 32, - "symbol_resolution": 0 - } -} \ No newline at end of file diff --git a/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_233942/20260311_233942_find_tests_order_positive.md b/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_233942/20260311_233942_find_tests_order_positive.md deleted file mode 100644 index f587400..0000000 --- a/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_233942/20260311_233942_find_tests_order_positive.md +++ /dev/null @@ -1,32 +0,0 @@ -# find_tests_order_positive - -## Query -Найди тесты для Order - -## Expected -- intent: CODE_QA, sub_intent: FIND_TESTS -- answer_mode: normal - -## Actual -- intent: CODE_QA, sub_intent: FIND_TESTS -- answer_mode: normal -- evidence_gate_passed: True -- evidence_count: 8 - -## Result -PASS - -## Router -- path_scope: [] -- layers: ['C1_SYMBOL_CATALOG', 'C2_DEPENDENCY_GRAPH', 'C0_SOURCE_CHUNKS'] - -## Retrieval -- requested_layers: ['C1_SYMBOL_CATALOG', 'C2_DEPENDENCY_GRAPH', 'C0_SOURCE_CHUNKS'] -- chunk_count: 8 -- layer_outcomes: [('C1_SYMBOL_CATALOG', 0), ('C2_DEPENDENCY_GRAPH', 6), ('C0_SOURCE_CHUNKS', 2)] - -## Evidence gate -- failure_reasons: [] - -## Timings (ms) -{'router': 0, 'retrieval_total': 32, 'symbol_resolution': 0} diff --git a/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_233942/20260311_233942_find_tests_positive.json b/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_233942/20260311_233942_find_tests_positive.json deleted file mode 100644 index 3ab9cd5..0000000 --- a/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_233942/20260311_233942_find_tests_positive.json +++ /dev/null @@ -1,69 +0,0 @@ -{ - "case_id": "find_tests_positive", - "query": "Где тесты для OrderService?", - "expected": { - "intent": "CODE_QA", - "sub_intent": "FIND_TESTS", - "answer_mode": "normal" - }, - "actual": { - "intent": "CODE_QA", - "sub_intent": "FIND_TESTS", - "answer_mode": "normal", - "evidence_gate_passed": true, - "evidence_count": 8 - }, - "passed": true, - "mismatches": [], - "router_result": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "retrieval_profile": "code", - "sub_intent": "FIND_TESTS", - "path_scope": [], - "layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ], - "symbol_resolution_status": "pending" - }, - "retrieval_request": { - "rag_session_id": "d494838f-a9df-4e86-a11a-a2cf8225dbe5", - "query": "Где тесты для OrderService?", - "sub_intent": "FIND_TESTS", - "path_scope": [], - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ] - }, - "per_layer_outcome": [ - { - "layer_id": "C1_SYMBOL_CATALOG", - "hit_count": 0, - "empty": true, - "fallback_used": true - }, - { - "layer_id": "C2_DEPENDENCY_GRAPH", - "hit_count": 6, - "empty": false, - "fallback_used": true - }, - { - "layer_id": "C0_SOURCE_CHUNKS", - "hit_count": 2, - "empty": false, - "fallback_used": true - } - ], - "failure_reasons": [], - "timings_ms": { - "router": 0, - "retrieval_total": 33, - "symbol_resolution": 0 - } -} \ No newline at end of file diff --git a/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_233942/20260311_233942_find_tests_positive.md b/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_233942/20260311_233942_find_tests_positive.md deleted file mode 100644 index 2332f1f..0000000 --- a/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_233942/20260311_233942_find_tests_positive.md +++ /dev/null @@ -1,32 +0,0 @@ -# find_tests_positive - -## Query -Где тесты для OrderService? - -## Expected -- intent: CODE_QA, sub_intent: FIND_TESTS -- answer_mode: normal - -## Actual -- intent: CODE_QA, sub_intent: FIND_TESTS -- answer_mode: normal -- evidence_gate_passed: True -- evidence_count: 8 - -## Result -PASS - -## Router -- path_scope: [] -- layers: ['C1_SYMBOL_CATALOG', 'C2_DEPENDENCY_GRAPH', 'C0_SOURCE_CHUNKS'] - -## Retrieval -- requested_layers: ['C1_SYMBOL_CATALOG', 'C2_DEPENDENCY_GRAPH', 'C0_SOURCE_CHUNKS'] -- chunk_count: 8 -- layer_outcomes: [('C1_SYMBOL_CATALOG', 0), ('C2_DEPENDENCY_GRAPH', 6), ('C0_SOURCE_CHUNKS', 2)] - -## Evidence gate -- failure_reasons: [] - -## Timings (ms) -{'router': 0, 'retrieval_total': 33, 'symbol_resolution': 0} diff --git a/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_233942/20260311_233942_general_qa_borderline.json b/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_233942/20260311_233942_general_qa_borderline.json deleted file mode 100644 index 79cde29..0000000 --- a/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_233942/20260311_233942_general_qa_borderline.json +++ /dev/null @@ -1,87 +0,0 @@ -{ - "case_id": "general_qa_borderline", - "query": "Расскажи про код", - "expected": { - "intent": "CODE_QA", - "sub_intent": "GENERAL_QA", - "answer_mode": "normal" - }, - "actual": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "answer_mode": "normal", - "evidence_gate_passed": true, - "evidence_count": 29 - }, - "passed": false, - "mismatches": [ - "sub_intent: expected GENERAL_QA, got EXPLAIN" - ], - "router_result": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "retrieval_profile": "code", - "sub_intent": "EXPLAIN", - "path_scope": [], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "symbol_resolution_status": "not_requested" - }, - "retrieval_request": { - "rag_session_id": "d494838f-a9df-4e86-a11a-a2cf8225dbe5", - "query": "Расскажи про код", - "sub_intent": "EXPLAIN", - "path_scope": [], - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "per_layer_outcome": [ - { - "layer_id": "C1_SYMBOL_CATALOG", - "hit_count": 8, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C0_SOURCE_CHUNKS", - "hit_count": 8, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C4_SEMANTIC_ROLES", - "hit_count": 3, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C2_DEPENDENCY_GRAPH", - "hit_count": 6, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C3_ENTRYPOINTS", - "hit_count": 4, - "empty": false, - "fallback_used": false - } - ], - "failure_reasons": [], - "timings_ms": { - "router": 0, - "retrieval_total": 39, - "symbol_resolution": 0 - } -} \ No newline at end of file diff --git a/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_233942/20260311_233942_general_qa_borderline.md b/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_233942/20260311_233942_general_qa_borderline.md deleted file mode 100644 index 4b24bde..0000000 --- a/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_233942/20260311_233942_general_qa_borderline.md +++ /dev/null @@ -1,35 +0,0 @@ -# general_qa_borderline - -## Query -Расскажи про код - -## Expected -- intent: CODE_QA, sub_intent: GENERAL_QA -- answer_mode: normal - -## Actual -- intent: CODE_QA, sub_intent: EXPLAIN -- answer_mode: normal -- evidence_gate_passed: True -- evidence_count: 29 - -## Result -FAIL - -## Mismatches -- sub_intent: expected GENERAL_QA, got EXPLAIN - -## Router -- path_scope: [] -- layers: ['C1_SYMBOL_CATALOG', 'C0_SOURCE_CHUNKS', 'C4_SEMANTIC_ROLES', 'C2_DEPENDENCY_GRAPH', 'C3_ENTRYPOINTS'] - -## Retrieval -- requested_layers: ['C1_SYMBOL_CATALOG', 'C0_SOURCE_CHUNKS', 'C4_SEMANTIC_ROLES', 'C2_DEPENDENCY_GRAPH', 'C3_ENTRYPOINTS'] -- chunk_count: 29 -- layer_outcomes: [('C1_SYMBOL_CATALOG', 8), ('C0_SOURCE_CHUNKS', 8), ('C4_SEMANTIC_ROLES', 3), ('C2_DEPENDENCY_GRAPH', 6), ('C3_ENTRYPOINTS', 4)] - -## Evidence gate -- failure_reasons: [] - -## Timings (ms) -{'router': 0, 'retrieval_total': 39, 'symbol_resolution': 0} diff --git a/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_233942/20260311_233942_general_qa_how.json b/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_233942/20260311_233942_general_qa_how.json deleted file mode 100644 index 0955df9..0000000 --- a/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_233942/20260311_233942_general_qa_how.json +++ /dev/null @@ -1,87 +0,0 @@ -{ - "case_id": "general_qa_how", - "query": "How does order creation work?", - "expected": { - "intent": "CODE_QA", - "sub_intent": "GENERAL_QA", - "answer_mode": "normal" - }, - "actual": { - "intent": "CODE_QA", - "sub_intent": "ARCHITECTURE", - "answer_mode": "normal", - "evidence_gate_passed": true, - "evidence_count": 20 - }, - "passed": false, - "mismatches": [ - "sub_intent: expected GENERAL_QA, got ARCHITECTURE" - ], - "router_result": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "retrieval_profile": "code", - "sub_intent": "ARCHITECTURE", - "path_scope": [], - "layers": [ - "C4_SEMANTIC_ROLES", - "C3_ENTRYPOINTS", - "C2_DEPENDENCY_GRAPH", - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS" - ], - "symbol_resolution_status": "pending" - }, - "retrieval_request": { - "rag_session_id": "d494838f-a9df-4e86-a11a-a2cf8225dbe5", - "query": "How does order creation work?", - "sub_intent": "ARCHITECTURE", - "path_scope": [], - "requested_layers": [ - "C4_SEMANTIC_ROLES", - "C3_ENTRYPOINTS", - "C2_DEPENDENCY_GRAPH", - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS" - ] - }, - "per_layer_outcome": [ - { - "layer_id": "C4_SEMANTIC_ROLES", - "hit_count": 3, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C3_ENTRYPOINTS", - "hit_count": 4, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C2_DEPENDENCY_GRAPH", - "hit_count": 8, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C1_SYMBOL_CATALOG", - "hit_count": 1, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C0_SOURCE_CHUNKS", - "hit_count": 4, - "empty": false, - "fallback_used": false - } - ], - "failure_reasons": [], - "timings_ms": { - "router": 0, - "retrieval_total": 42, - "symbol_resolution": 0 - } -} \ No newline at end of file diff --git a/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_233942/20260311_233942_general_qa_how.md b/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_233942/20260311_233942_general_qa_how.md deleted file mode 100644 index 403254c..0000000 --- a/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_233942/20260311_233942_general_qa_how.md +++ /dev/null @@ -1,35 +0,0 @@ -# general_qa_how - -## Query -How does order creation work? - -## Expected -- intent: CODE_QA, sub_intent: GENERAL_QA -- answer_mode: normal - -## Actual -- intent: CODE_QA, sub_intent: ARCHITECTURE -- answer_mode: normal -- evidence_gate_passed: True -- evidence_count: 20 - -## Result -FAIL - -## Mismatches -- sub_intent: expected GENERAL_QA, got ARCHITECTURE - -## Router -- path_scope: [] -- layers: ['C4_SEMANTIC_ROLES', 'C3_ENTRYPOINTS', 'C2_DEPENDENCY_GRAPH', 'C1_SYMBOL_CATALOG', 'C0_SOURCE_CHUNKS'] - -## Retrieval -- requested_layers: ['C4_SEMANTIC_ROLES', 'C3_ENTRYPOINTS', 'C2_DEPENDENCY_GRAPH', 'C1_SYMBOL_CATALOG', 'C0_SOURCE_CHUNKS'] -- chunk_count: 20 -- layer_outcomes: [('C4_SEMANTIC_ROLES', 3), ('C3_ENTRYPOINTS', 4), ('C2_DEPENDENCY_GRAPH', 8), ('C1_SYMBOL_CATALOG', 1), ('C0_SOURCE_CHUNKS', 4)] - -## Evidence gate -- failure_reasons: [] - -## Timings (ms) -{'router': 0, 'retrieval_total': 42, 'symbol_resolution': 0} diff --git a/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_233942/20260311_233942_general_qa_positive.json b/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_233942/20260311_233942_general_qa_positive.json deleted file mode 100644 index ebc3409..0000000 --- a/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_233942/20260311_233942_general_qa_positive.json +++ /dev/null @@ -1,80 +0,0 @@ -{ - "case_id": "general_qa_positive", - "query": "Что делает этот проект?", - "expected": { - "intent": "CODE_QA", - "sub_intent": "GENERAL_QA", - "answer_mode": "normal" - }, - "actual": { - "intent": "PROJECT_MISC", - "sub_intent": "EXPLAIN", - "answer_mode": "normal", - "evidence_gate_passed": true, - "evidence_count": 8 - }, - "passed": false, - "mismatches": [ - "intent: expected CODE_QA, got PROJECT_MISC", - "sub_intent: expected GENERAL_QA, got EXPLAIN" - ], - "router_result": { - "intent": "PROJECT_MISC", - "graph_id": "ProjectMiscGraph", - "conversation_mode": "START", - "retrieval_profile": "code", - "sub_intent": "EXPLAIN", - "path_scope": [], - "layers": [ - "D1_MODULE_CATALOG", - "D3_SECTION_INDEX", - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS" - ], - "symbol_resolution_status": "not_requested" - }, - "retrieval_request": { - "rag_session_id": "d494838f-a9df-4e86-a11a-a2cf8225dbe5", - "query": "Что делает этот проект?", - "sub_intent": "EXPLAIN", - "path_scope": [], - "requested_layers": [ - "D1_MODULE_CATALOG", - "D3_SECTION_INDEX", - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS" - ] - }, - "per_layer_outcome": [ - { - "layer_id": "D1_MODULE_CATALOG", - "hit_count": 0, - "empty": true, - "fallback_used": true - }, - { - "layer_id": "D3_SECTION_INDEX", - "hit_count": 0, - "empty": true, - "fallback_used": true - }, - { - "layer_id": "C1_SYMBOL_CATALOG", - "hit_count": 4, - "empty": false, - "fallback_used": true - }, - { - "layer_id": "C0_SOURCE_CHUNKS", - "hit_count": 4, - "empty": false, - "fallback_used": true - } - ], - "failure_reasons": [], - "timings_ms": { - "router": 0, - "retrieval_total": 44, - "symbol_resolution": 0 - } -} \ No newline at end of file diff --git a/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_233942/20260311_233942_general_qa_positive.md b/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_233942/20260311_233942_general_qa_positive.md deleted file mode 100644 index 8f2a7e8..0000000 --- a/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_233942/20260311_233942_general_qa_positive.md +++ /dev/null @@ -1,36 +0,0 @@ -# general_qa_positive - -## Query -Что делает этот проект? - -## Expected -- intent: CODE_QA, sub_intent: GENERAL_QA -- answer_mode: normal - -## Actual -- intent: PROJECT_MISC, sub_intent: EXPLAIN -- answer_mode: normal -- evidence_gate_passed: True -- evidence_count: 8 - -## Result -FAIL - -## Mismatches -- intent: expected CODE_QA, got PROJECT_MISC -- sub_intent: expected GENERAL_QA, got EXPLAIN - -## Router -- path_scope: [] -- layers: ['D1_MODULE_CATALOG', 'D3_SECTION_INDEX', 'C1_SYMBOL_CATALOG', 'C0_SOURCE_CHUNKS'] - -## Retrieval -- requested_layers: ['D1_MODULE_CATALOG', 'D3_SECTION_INDEX', 'C1_SYMBOL_CATALOG', 'C0_SOURCE_CHUNKS'] -- chunk_count: 8 -- layer_outcomes: [('D1_MODULE_CATALOG', 0), ('D3_SECTION_INDEX', 0), ('C1_SYMBOL_CATALOG', 4), ('C0_SOURCE_CHUNKS', 4)] - -## Evidence gate -- failure_reasons: [] - -## Timings (ms) -{'router': 0, 'retrieval_total': 44, 'symbol_resolution': 0} diff --git a/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_233942/20260311_233942_open_file_api_positive.json b/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_233942/20260311_233942_open_file_api_positive.json deleted file mode 100644 index f7d6d07..0000000 --- a/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_233942/20260311_233942_open_file_api_positive.json +++ /dev/null @@ -1,57 +0,0 @@ -{ - "case_id": "open_file_api_positive", - "query": "Покажи src/order_app/api/orders.py", - "expected": { - "intent": "CODE_QA", - "sub_intent": "OPEN_FILE", - "answer_mode": "normal" - }, - "actual": { - "intent": "CODE_QA", - "sub_intent": "OPEN_FILE", - "answer_mode": "normal", - "evidence_gate_passed": true, - "evidence_count": 1 - }, - "passed": true, - "mismatches": [], - "router_result": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "retrieval_profile": "code", - "sub_intent": "OPEN_FILE", - "path_scope": [ - "src/order_app/api/orders.py" - ], - "layers": [ - "C0_SOURCE_CHUNKS" - ], - "symbol_resolution_status": "not_requested" - }, - "retrieval_request": { - "rag_session_id": "d494838f-a9df-4e86-a11a-a2cf8225dbe5", - "query": "Покажи src/order_app/api/orders.py", - "sub_intent": "OPEN_FILE", - "path_scope": [ - "src/order_app/api/orders.py" - ], - "requested_layers": [ - "C0_SOURCE_CHUNKS" - ] - }, - "per_layer_outcome": [ - { - "layer_id": "C0_SOURCE_CHUNKS", - "hit_count": 1, - "empty": false, - "fallback_used": false - } - ], - "failure_reasons": [], - "timings_ms": { - "router": 0, - "retrieval_total": 7, - "symbol_resolution": 0 - } -} \ No newline at end of file diff --git a/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_233942/20260311_233942_open_file_api_positive.md b/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_233942/20260311_233942_open_file_api_positive.md deleted file mode 100644 index 2d2f9ad..0000000 --- a/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_233942/20260311_233942_open_file_api_positive.md +++ /dev/null @@ -1,32 +0,0 @@ -# open_file_api_positive - -## Query -Покажи src/order_app/api/orders.py - -## Expected -- intent: CODE_QA, sub_intent: OPEN_FILE -- answer_mode: normal - -## Actual -- intent: CODE_QA, sub_intent: OPEN_FILE -- answer_mode: normal -- evidence_gate_passed: True -- evidence_count: 1 - -## Result -PASS - -## Router -- path_scope: ['src/order_app/api/orders.py'] -- layers: ['C0_SOURCE_CHUNKS'] - -## Retrieval -- requested_layers: ['C0_SOURCE_CHUNKS'] -- chunk_count: 1 -- layer_outcomes: [('C0_SOURCE_CHUNKS', 1)] - -## Evidence gate -- failure_reasons: [] - -## Timings (ms) -{'router': 0, 'retrieval_total': 7, 'symbol_resolution': 0} diff --git a/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_233942/20260311_233942_open_file_borderline.json b/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_233942/20260311_233942_open_file_borderline.json deleted file mode 100644 index cc19c0d..0000000 --- a/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_233942/20260311_233942_open_file_borderline.json +++ /dev/null @@ -1,63 +0,0 @@ -{ - "case_id": "open_file_borderline", - "query": "Open main", - "expected": { - "intent": "CODE_QA", - "sub_intent": "OPEN_FILE", - "answer_mode": "normal" - }, - "actual": { - "intent": "CODE_QA", - "sub_intent": "FIND_ENTRYPOINTS", - "answer_mode": "normal", - "evidence_gate_passed": true, - "evidence_count": 10 - }, - "passed": false, - "mismatches": [ - "sub_intent: expected OPEN_FILE, got FIND_ENTRYPOINTS" - ], - "router_result": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "retrieval_profile": "code", - "sub_intent": "FIND_ENTRYPOINTS", - "path_scope": [], - "layers": [ - "C3_ENTRYPOINTS", - "C0_SOURCE_CHUNKS" - ], - "symbol_resolution_status": "pending" - }, - "retrieval_request": { - "rag_session_id": "d494838f-a9df-4e86-a11a-a2cf8225dbe5", - "query": "Open main", - "sub_intent": "FIND_ENTRYPOINTS", - "path_scope": [], - "requested_layers": [ - "C3_ENTRYPOINTS", - "C0_SOURCE_CHUNKS" - ] - }, - "per_layer_outcome": [ - { - "layer_id": "C3_ENTRYPOINTS", - "hit_count": 4, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C0_SOURCE_CHUNKS", - "hit_count": 6, - "empty": false, - "fallback_used": false - } - ], - "failure_reasons": [], - "timings_ms": { - "router": 0, - "retrieval_total": 27, - "symbol_resolution": 0 - } -} \ No newline at end of file diff --git a/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_233942/20260311_233942_open_file_borderline.md b/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_233942/20260311_233942_open_file_borderline.md deleted file mode 100644 index d3ba117..0000000 --- a/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_233942/20260311_233942_open_file_borderline.md +++ /dev/null @@ -1,35 +0,0 @@ -# open_file_borderline - -## Query -Open main - -## Expected -- intent: CODE_QA, sub_intent: OPEN_FILE -- answer_mode: normal - -## Actual -- intent: CODE_QA, sub_intent: FIND_ENTRYPOINTS -- answer_mode: normal -- evidence_gate_passed: True -- evidence_count: 10 - -## Result -FAIL - -## Mismatches -- sub_intent: expected OPEN_FILE, got FIND_ENTRYPOINTS - -## Router -- path_scope: [] -- layers: ['C3_ENTRYPOINTS', 'C0_SOURCE_CHUNKS'] - -## Retrieval -- requested_layers: ['C3_ENTRYPOINTS', 'C0_SOURCE_CHUNKS'] -- chunk_count: 10 -- layer_outcomes: [('C3_ENTRYPOINTS', 4), ('C0_SOURCE_CHUNKS', 6)] - -## Evidence gate -- failure_reasons: [] - -## Timings (ms) -{'router': 0, 'retrieval_total': 27, 'symbol_resolution': 0} diff --git a/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_233942/20260311_233942_open_file_main_positive.json b/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_233942/20260311_233942_open_file_main_positive.json deleted file mode 100644 index 16898b3..0000000 --- a/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_233942/20260311_233942_open_file_main_positive.json +++ /dev/null @@ -1,57 +0,0 @@ -{ - "case_id": "open_file_main_positive", - "query": "Открой файл main.py", - "expected": { - "intent": "CODE_QA", - "sub_intent": "OPEN_FILE", - "answer_mode": "normal" - }, - "actual": { - "intent": "CODE_QA", - "sub_intent": "OPEN_FILE", - "answer_mode": "normal", - "evidence_gate_passed": true, - "evidence_count": 1 - }, - "passed": true, - "mismatches": [], - "router_result": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "retrieval_profile": "code", - "sub_intent": "OPEN_FILE", - "path_scope": [ - "main.py" - ], - "layers": [ - "C0_SOURCE_CHUNKS" - ], - "symbol_resolution_status": "not_requested" - }, - "retrieval_request": { - "rag_session_id": "d494838f-a9df-4e86-a11a-a2cf8225dbe5", - "query": "Открой файл main.py", - "sub_intent": "OPEN_FILE", - "path_scope": [ - "main.py" - ], - "requested_layers": [ - "C0_SOURCE_CHUNKS" - ] - }, - "per_layer_outcome": [ - { - "layer_id": "C0_SOURCE_CHUNKS", - "hit_count": 1, - "empty": false, - "fallback_used": false - } - ], - "failure_reasons": [], - "timings_ms": { - "router": 0, - "retrieval_total": 6, - "symbol_resolution": 0 - } -} \ No newline at end of file diff --git a/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_233942/20260311_233942_open_file_main_positive.md b/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_233942/20260311_233942_open_file_main_positive.md deleted file mode 100644 index 2ab4fc7..0000000 --- a/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_233942/20260311_233942_open_file_main_positive.md +++ /dev/null @@ -1,32 +0,0 @@ -# open_file_main_positive - -## Query -Открой файл main.py - -## Expected -- intent: CODE_QA, sub_intent: OPEN_FILE -- answer_mode: normal - -## Actual -- intent: CODE_QA, sub_intent: OPEN_FILE -- answer_mode: normal -- evidence_gate_passed: True -- evidence_count: 1 - -## Result -PASS - -## Router -- path_scope: ['main.py'] -- layers: ['C0_SOURCE_CHUNKS'] - -## Retrieval -- requested_layers: ['C0_SOURCE_CHUNKS'] -- chunk_count: 1 -- layer_outcomes: [('C0_SOURCE_CHUNKS', 1)] - -## Evidence gate -- failure_reasons: [] - -## Timings (ms) -{'router': 0, 'retrieval_total': 6, 'symbol_resolution': 0} diff --git a/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_233942/20260311_233942_open_file_negative.json b/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_233942/20260311_233942_open_file_negative.json deleted file mode 100644 index e73687a..0000000 --- a/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_233942/20260311_233942_open_file_negative.json +++ /dev/null @@ -1,62 +0,0 @@ -{ - "case_id": "open_file_negative", - "query": "Открой файл nonexistent/foo.py", - "expected": { - "intent": "CODE_QA", - "sub_intent": "OPEN_FILE", - "answer_mode": "degraded" - }, - "actual": { - "intent": "CODE_QA", - "sub_intent": "OPEN_FILE", - "answer_mode": "insufficient", - "evidence_gate_passed": false, - "evidence_count": 0 - }, - "passed": false, - "mismatches": [ - "answer_mode: expected degraded, got insufficient" - ], - "router_result": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "retrieval_profile": "code", - "sub_intent": "OPEN_FILE", - "path_scope": [ - "nonexistent/foo.py" - ], - "layers": [ - "C0_SOURCE_CHUNKS" - ], - "symbol_resolution_status": "not_requested" - }, - "retrieval_request": { - "rag_session_id": "d494838f-a9df-4e86-a11a-a2cf8225dbe5", - "query": "Открой файл nonexistent/foo.py", - "sub_intent": "OPEN_FILE", - "path_scope": [ - "nonexistent/foo.py" - ], - "requested_layers": [ - "C0_SOURCE_CHUNKS" - ] - }, - "per_layer_outcome": [ - { - "layer_id": "C0_SOURCE_CHUNKS", - "hit_count": 0, - "empty": true, - "fallback_used": false - } - ], - "failure_reasons": [ - "path_scope_empty", - "layer_c0_empty" - ], - "timings_ms": { - "router": 0, - "retrieval_total": 9, - "symbol_resolution": 0 - } -} \ No newline at end of file diff --git a/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_233942/20260311_233942_open_file_negative.md b/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_233942/20260311_233942_open_file_negative.md deleted file mode 100644 index 1d7d0c6..0000000 --- a/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_233942/20260311_233942_open_file_negative.md +++ /dev/null @@ -1,35 +0,0 @@ -# open_file_negative - -## Query -Открой файл nonexistent/foo.py - -## Expected -- intent: CODE_QA, sub_intent: OPEN_FILE -- answer_mode: degraded - -## Actual -- intent: CODE_QA, sub_intent: OPEN_FILE -- answer_mode: insufficient -- evidence_gate_passed: False -- evidence_count: 0 - -## Result -FAIL - -## Mismatches -- answer_mode: expected degraded, got insufficient - -## Router -- path_scope: ['nonexistent/foo.py'] -- layers: ['C0_SOURCE_CHUNKS'] - -## Retrieval -- requested_layers: ['C0_SOURCE_CHUNKS'] -- chunk_count: 0 -- layer_outcomes: [('C0_SOURCE_CHUNKS', 0)] - -## Evidence gate -- failure_reasons: ['path_scope_empty', 'layer_c0_empty'] - -## Timings (ms) -{'router': 0, 'retrieval_total': 9, 'symbol_resolution': 0} diff --git a/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_233942/console_output.txt b/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_233942/console_output.txt deleted file mode 100644 index 35b6d09..0000000 --- a/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_233942/console_output.txt +++ /dev/null @@ -1,65 +0,0 @@ -Console log: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_233942/console_output.txt -Running evaluation: repo=/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup/suite_01_synthetic/fixtures/code_qa_repo, fixture=True -Results: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/20260311_233942 -[1/13] main.py -[2/13] src/order_app/__init__.py -[3/13] src/order_app/api/__init__.py -[4/13] src/order_app/api/orders.py -[5/13] src/order_app/domain/__init__.py -[6/13] src/order_app/domain/order.py -[7/13] src/order_app/repositories/__init__.py -[8/13] src/order_app/repositories/order_repository.py -[9/13] src/order_app/services/__init__.py -[10/13] src/order_app/services/order_service.py -[11/13] src/order_app/utils/__init__.py -[12/13] src/order_app/utils/helpers.py -[13/13] tests/test_order_service.py -rag_session_id=d494838f-a9df-4e86-a11a-a2cf8225dbe5 -intent router v2 request: turn=1 active_intent=None user_query=Открой файл main.py languages=['python'] domains=['CODE', 'DOCS'] -intent router v2 result: {"schema_version": "1.1", "intent": "CODE_QA", "retrieval_profile": "code", "graph_id": "CodeQAGraph", "conversation_mode": "START", "query_plan": {"raw": "Открой файл main.py", "normalized": "Открой файл main.py", "sub_intent": "OPEN_FILE", "negations": [], "expansions": ["file"], "keyword_hints": [], "path_hints": ["main.py"], "doc_scope_hints": [], "symbol_candidates": [], "symbol_kind_hint": "unknown", "anchors": [{"type": "FILE_PATH", "value": "main.py", "source": "user_text", "subtype": null, "span": {"start": 12, "end": 19}, "confidence": 0.95}, {"type": "KEY_TERM", "value": "файл", "source": "user_text", "subtype": null, "span": {"start": 7, "end": 11}, "confidence": 0.9}]}, "retrieval_spec": {"domains": ["CODE"], "layer_queries": [{"layer_id": "C0_SOURCE_CHUNKS", "top_k": 12}], "filters": {"test_policy": "EXCLUDE", "path_scope": ["main.py"], "language": ["python"]}, "rerank_profile": "code"}, "retrieval_constraints": {"include_globs": ["main.py"], "exclude_globs": ["tests/**", "**/test_*.py", "**/*_test.py"], "prefer_globs": [], "test_file_globs": [], "test_symbol_patterns": [], "max_candidates": 20, "fuzzy_symbol_search": {"enabled": false, "max_distance": 2, "top_k": 5}}, "symbol_resolution": {"status": "not_requested", "resolved_symbol": null, "alternatives": [], "confidence": 0.0}, "evidence_policy": {"require_def": false, "require_flow": false, "require_spec": false, "allow_answer_without_evidence": false}} -intent router v2 request: turn=1 active_intent=None user_query=Покажи src/order_app/api/orders.py languages=['python'] domains=['CODE', 'DOCS'] -intent router v2 result: {"schema_version": "1.1", "intent": "CODE_QA", "retrieval_profile": "code", "graph_id": "CodeQAGraph", "conversation_mode": "START", "query_plan": {"raw": "Покажи src/order_app/api/orders.py", "normalized": "Покажи src/order_app/api/orders.py", "sub_intent": "OPEN_FILE", "negations": [], "expansions": [], "keyword_hints": [], "path_hints": ["src/order_app/api/orders.py"], "doc_scope_hints": [], "symbol_candidates": [], "symbol_kind_hint": "unknown", "anchors": [{"type": "FILE_PATH", "value": "src/order_app/api/orders.py", "source": "user_text", "subtype": null, "span": {"start": 7, "end": 34}, "confidence": 0.95}]}, "retrieval_spec": {"domains": ["CODE"], "layer_queries": [{"layer_id": "C0_SOURCE_CHUNKS", "top_k": 12}], "filters": {"test_policy": "EXCLUDE", "path_scope": ["src/order_app/api/orders.py"], "language": ["python"]}, "rerank_profile": "code"}, "retrieval_constraints": {"include_globs": ["src/order_app/api/orders.py"], "exclude_globs": ["tests/**", "**/test_*.py", "**/*_test.py"], "prefer_globs": [], "test_file_globs": [], "test_symbol_patterns": [], "max_candidates": 20, "fuzzy_symbol_search": {"enabled": false, "max_distance": 2, "top_k": 5}}, "symbol_resolution": {"status": "not_requested", "resolved_symbol": null, "alternatives": [], "confidence": 0.0}, "evidence_policy": {"require_def": false, "require_flow": false, "require_spec": false, "allow_answer_without_evidence": false}} -intent router v2 request: turn=1 active_intent=None user_query=Open main languages=['python'] domains=['CODE', 'DOCS'] -intent router v2 result: {"schema_version": "1.1", "intent": "CODE_QA", "retrieval_profile": "code", "graph_id": "CodeQAGraph", "conversation_mode": "START", "query_plan": {"raw": "Open main", "normalized": "Open main", "sub_intent": "FIND_ENTRYPOINTS", "negations": [], "expansions": ["Open", "main"], "keyword_hints": ["Open", "main"], "path_hints": [], "doc_scope_hints": [], "symbol_candidates": ["Open", "main"], "symbol_kind_hint": "class", "anchors": [{"type": "SYMBOL", "value": "Open", "source": "user_text", "subtype": null, "span": {"start": 0, "end": 4}, "confidence": 0.88}, {"type": "SYMBOL", "value": "main", "source": "user_text", "subtype": null, "span": {"start": 5, "end": 9}, "confidence": 0.88}]}, "retrieval_spec": {"domains": ["CODE"], "layer_queries": [{"layer_id": "C3_ENTRYPOINTS", "top_k": 12}, {"layer_id": "C0_SOURCE_CHUNKS", "top_k": 6}], "filters": {"test_policy": "EXCLUDE", "path_scope": [], "language": ["python"]}, "rerank_profile": "code"}, "retrieval_constraints": {"include_globs": ["src/**"], "exclude_globs": ["tests/**", "**/test_*.py", "**/*_test.py"], "prefer_globs": [], "test_file_globs": [], "test_symbol_patterns": [], "max_candidates": 20, "fuzzy_symbol_search": {"enabled": true, "max_distance": 2, "top_k": 5}}, "symbol_resolution": {"status": "pending", "resolved_symbol": null, "alternatives": ["Open", "main"], "confidence": 0.0}, "evidence_policy": {"require_def": true, "require_flow": true, "require_spec": false, "allow_answer_without_evidence": false}} -intent router v2 request: turn=1 active_intent=None user_query=Открой файл nonexistent/foo.py languages=['python'] domains=['CODE', 'DOCS'] -intent router v2 result: {"schema_version": "1.1", "intent": "CODE_QA", "retrieval_profile": "code", "graph_id": "CodeQAGraph", "conversation_mode": "START", "query_plan": {"raw": "Открой файл nonexistent/foo.py", "normalized": "Открой файл nonexistent/foo.py", "sub_intent": "OPEN_FILE", "negations": [], "expansions": ["file"], "keyword_hints": [], "path_hints": ["nonexistent/foo.py"], "doc_scope_hints": [], "symbol_candidates": [], "symbol_kind_hint": "unknown", "anchors": [{"type": "FILE_PATH", "value": "nonexistent/foo.py", "source": "user_text", "subtype": null, "span": {"start": 12, "end": 30}, "confidence": 0.95}, {"type": "KEY_TERM", "value": "файл", "source": "user_text", "subtype": null, "span": {"start": 7, "end": 11}, "confidence": 0.9}]}, "retrieval_spec": {"domains": ["CODE"], "layer_queries": [{"layer_id": "C0_SOURCE_CHUNKS", "top_k": 12}], "filters": {"test_policy": "EXCLUDE", "path_scope": ["nonexistent/foo.py"], "language": ["python"]}, "rerank_profile": "code"}, "retrieval_constraints": {"include_globs": ["nonexistent/foo.py"], "exclude_globs": ["tests/**", "**/test_*.py", "**/*_test.py"], "prefer_globs": [], "test_file_globs": [], "test_symbol_patterns": [], "max_candidates": 20, "fuzzy_symbol_search": {"enabled": false, "max_distance": 2, "top_k": 5}}, "symbol_resolution": {"status": "not_requested", "resolved_symbol": null, "alternatives": [], "confidence": 0.0}, "evidence_policy": {"require_def": false, "require_flow": false, "require_spec": false, "allow_answer_without_evidence": false}} -intent router v2 request: turn=1 active_intent=None user_query=Объясни класс Order languages=['python'] domains=['CODE', 'DOCS'] -intent router v2 result: {"schema_version": "1.1", "intent": "CODE_QA", "retrieval_profile": "code", "graph_id": "CodeQAGraph", "conversation_mode": "START", "query_plan": {"raw": "Объясни класс Order", "normalized": "Объясни класс Order", "sub_intent": "EXPLAIN", "negations": [], "expansions": ["Order"], "keyword_hints": ["Order"], "path_hints": [], "doc_scope_hints": [], "symbol_candidates": ["Order"], "symbol_kind_hint": "class", "anchors": [{"type": "SYMBOL", "value": "Order", "source": "user_text", "subtype": null, "span": {"start": 14, "end": 19}, "confidence": 0.88}, {"type": "KEY_TERM", "value": "класс", "source": "user_text", "subtype": null, "span": {"start": 8, "end": 13}, "confidence": 0.9}]}, "retrieval_spec": {"domains": ["CODE"], "layer_queries": [{"layer_id": "C1_SYMBOL_CATALOG", "top_k": 8}, {"layer_id": "C0_SOURCE_CHUNKS", "top_k": 8}, {"layer_id": "C4_SEMANTIC_ROLES", "top_k": 8}, {"layer_id": "C2_DEPENDENCY_GRAPH", "top_k": 6}, {"layer_id": "C3_ENTRYPOINTS", "top_k": 6}], "filters": {"test_policy": "EXCLUDE", "path_scope": [], "language": ["python"]}, "rerank_profile": "code"}, "retrieval_constraints": {"include_globs": ["src/**"], "exclude_globs": ["tests/**", "**/test_*.py", "**/*_test.py"], "prefer_globs": [], "test_file_globs": [], "test_symbol_patterns": [], "max_candidates": 20, "fuzzy_symbol_search": {"enabled": true, "max_distance": 2, "top_k": 5}}, "symbol_resolution": {"status": "pending", "resolved_symbol": null, "alternatives": ["Order"], "confidence": 0.0}, "evidence_policy": {"require_def": true, "require_flow": true, "require_spec": false, "allow_answer_without_evidence": false}} -intent router v2 request: turn=1 active_intent=None user_query=Как работает OrderService? languages=['python'] domains=['CODE', 'DOCS'] -intent router v2 result: {"schema_version": "1.1", "intent": "CODE_QA", "retrieval_profile": "code", "graph_id": "CodeQAGraph", "conversation_mode": "START", "query_plan": {"raw": "Как работает OrderService?", "normalized": "Как работает OrderService?", "sub_intent": "EXPLAIN", "negations": [], "expansions": ["OrderService"], "keyword_hints": ["OrderService"], "path_hints": [], "doc_scope_hints": [], "symbol_candidates": ["OrderService"], "symbol_kind_hint": "class", "anchors": [{"type": "SYMBOL", "value": "OrderService", "source": "user_text", "subtype": null, "span": {"start": 13, "end": 25}, "confidence": 0.88}]}, "retrieval_spec": {"domains": ["CODE"], "layer_queries": [{"layer_id": "C1_SYMBOL_CATALOG", "top_k": 8}, {"layer_id": "C0_SOURCE_CHUNKS", "top_k": 8}, {"layer_id": "C4_SEMANTIC_ROLES", "top_k": 8}, {"layer_id": "C2_DEPENDENCY_GRAPH", "top_k": 6}, {"layer_id": "C3_ENTRYPOINTS", "top_k": 6}], "filters": {"test_policy": "EXCLUDE", "path_scope": [], "language": ["python"]}, "rerank_profile": "code"}, "retrieval_constraints": {"include_globs": ["src/**"], "exclude_globs": ["tests/**", "**/test_*.py", "**/*_test.py"], "prefer_globs": [], "test_file_globs": [], "test_symbol_patterns": [], "max_candidates": 20, "fuzzy_symbol_search": {"enabled": true, "max_distance": 2, "top_k": 5}}, "symbol_resolution": {"status": "pending", "resolved_symbol": null, "alternatives": ["OrderService"], "confidence": 0.0}, "evidence_policy": {"require_def": true, "require_flow": true, "require_spec": false, "allow_answer_without_evidence": false}} -intent router v2 request: turn=1 active_intent=None user_query=Что делает create_order? languages=['python'] domains=['CODE', 'DOCS'] -intent router v2 result: {"schema_version": "1.1", "intent": "PROJECT_MISC", "retrieval_profile": "code", "graph_id": "ProjectMiscGraph", "conversation_mode": "START", "query_plan": {"raw": "Что делает create_order?", "normalized": "Что делает create_order?", "sub_intent": "EXPLAIN", "negations": [], "expansions": ["create_order"], "keyword_hints": ["create_order"], "path_hints": [], "doc_scope_hints": [], "symbol_candidates": ["create_order"], "symbol_kind_hint": "function", "anchors": [{"type": "SYMBOL", "value": "create_order", "source": "user_text", "subtype": null, "span": {"start": 11, "end": 23}, "confidence": 0.88}]}, "retrieval_spec": {"domains": ["CODE", "DOCS"], "layer_queries": [{"layer_id": "D1_MODULE_CATALOG", "top_k": 4}, {"layer_id": "D3_SECTION_INDEX", "top_k": 6}, {"layer_id": "C1_SYMBOL_CATALOG", "top_k": 4}, {"layer_id": "C0_SOURCE_CHUNKS", "top_k": 4}], "filters": {"test_policy": "EXCLUDE", "path_scope": [], "language": ["python"], "doc_kinds": [], "doc_language": []}, "rerank_profile": "project"}, "retrieval_constraints": {"include_globs": ["src/**"], "exclude_globs": ["tests/**", "**/test_*.py", "**/*_test.py"], "prefer_globs": [], "test_file_globs": [], "test_symbol_patterns": [], "max_candidates": 20, "fuzzy_symbol_search": {"enabled": true, "max_distance": 2, "top_k": 5}}, "symbol_resolution": {"status": "pending", "resolved_symbol": null, "alternatives": ["create_order"], "confidence": 0.0}, "evidence_policy": {"require_def": false, "require_flow": false, "require_spec": false, "allow_answer_without_evidence": true}} -intent router v2 request: turn=1 active_intent=None user_query=Объясни класс NonExistentClass languages=['python'] domains=['CODE', 'DOCS'] -intent router v2 result: {"schema_version": "1.1", "intent": "CODE_QA", "retrieval_profile": "code", "graph_id": "CodeQAGraph", "conversation_mode": "START", "query_plan": {"raw": "Объясни класс NonExistentClass", "normalized": "Объясни класс NonExistentClass", "sub_intent": "EXPLAIN", "negations": [], "expansions": ["NonExistentClass"], "keyword_hints": ["NonExistentClass"], "path_hints": [], "doc_scope_hints": [], "symbol_candidates": ["NonExistentClass"], "symbol_kind_hint": "class", "anchors": [{"type": "SYMBOL", "value": "NonExistentClass", "source": "user_text", "subtype": null, "span": {"start": 14, "end": 30}, "confidence": 0.88}, {"type": "KEY_TERM", "value": "класс", "source": "user_text", "subtype": null, "span": {"start": 8, "end": 13}, "confidence": 0.9}]}, "retrieval_spec": {"domains": ["CODE"], "layer_queries": [{"layer_id": "C1_SYMBOL_CATALOG", "top_k": 8}, {"layer_id": "C0_SOURCE_CHUNKS", "top_k": 8}, {"layer_id": "C4_SEMANTIC_ROLES", "top_k": 8}, {"layer_id": "C2_DEPENDENCY_GRAPH", "top_k": 6}, {"layer_id": "C3_ENTRYPOINTS", "top_k": 6}], "filters": {"test_policy": "EXCLUDE", "path_scope": [], "language": ["python"]}, "rerank_profile": "code"}, "retrieval_constraints": {"include_globs": ["src/**"], "exclude_globs": ["tests/**", "**/test_*.py", "**/*_test.py"], "prefer_globs": [], "test_file_globs": [], "test_symbol_patterns": [], "max_candidates": 20, "fuzzy_symbol_search": {"enabled": true, "max_distance": 2, "top_k": 5}}, "symbol_resolution": {"status": "pending", "resolved_symbol": null, "alternatives": ["NonExistentClass"], "confidence": 0.0}, "evidence_policy": {"require_def": true, "require_flow": true, "require_spec": false, "allow_answer_without_evidence": false}} -intent router v2 request: turn=1 active_intent=None user_query=Где тесты для OrderService? languages=['python'] domains=['CODE', 'DOCS'] -intent router v2 result: {"schema_version": "1.1", "intent": "CODE_QA", "retrieval_profile": "code", "graph_id": "CodeQAGraph", "conversation_mode": "START", "query_plan": {"raw": "Где тесты для OrderService?", "normalized": "Где тесты для OrderService?", "sub_intent": "FIND_TESTS", "negations": [], "expansions": ["test", "unit test", "OrderService"], "keyword_hints": ["OrderService"], "path_hints": [], "doc_scope_hints": [], "symbol_candidates": ["OrderService"], "symbol_kind_hint": "class", "anchors": [{"type": "SYMBOL", "value": "OrderService", "source": "user_text", "subtype": null, "span": {"start": 14, "end": 26}, "confidence": 0.88}, {"type": "KEY_TERM", "value": "тест", "source": "user_text", "subtype": null, "span": {"start": 4, "end": 9}, "confidence": 0.9}]}, "retrieval_spec": {"domains": ["CODE"], "layer_queries": [{"layer_id": "C1_SYMBOL_CATALOG", "top_k": 8}, {"layer_id": "C2_DEPENDENCY_GRAPH", "top_k": 6}, {"layer_id": "C0_SOURCE_CHUNKS", "top_k": 10}], "filters": {"test_policy": "INCLUDE", "path_scope": [], "language": ["python"]}, "rerank_profile": "code"}, "retrieval_constraints": {"include_globs": ["src/**", "tests/**", "**/test_*.py", "**/*_test.py", "**/conftest.py"], "exclude_globs": [], "prefer_globs": ["tests/**", "**/test_*.py", "**/*_test.py"], "test_file_globs": ["tests/**", "**/test_*.py", "**/*_test.py", "**/conftest.py"], "test_symbol_patterns": ["test_order_service", "TestOrderService", "OrderService"], "max_candidates": 20, "fuzzy_symbol_search": {"enabled": true, "max_distance": 2, "top_k": 5}}, "symbol_resolution": {"status": "pending", "resolved_symbol": null, "alternatives": ["OrderService"], "confidence": 0.0}, "evidence_policy": {"require_def": true, "require_flow": true, "require_spec": false, "allow_answer_without_evidence": false}} -intent router v2 request: turn=1 active_intent=None user_query=Найди тесты для Order languages=['python'] domains=['CODE', 'DOCS'] -intent router v2 result: {"schema_version": "1.1", "intent": "CODE_QA", "retrieval_profile": "code", "graph_id": "CodeQAGraph", "conversation_mode": "START", "query_plan": {"raw": "Найди тесты для Order", "normalized": "Найди тесты для Order", "sub_intent": "FIND_TESTS", "negations": [], "expansions": ["test", "unit test", "Order"], "keyword_hints": ["Order"], "path_hints": [], "doc_scope_hints": [], "symbol_candidates": ["Order"], "symbol_kind_hint": "class", "anchors": [{"type": "SYMBOL", "value": "Order", "source": "user_text", "subtype": null, "span": {"start": 16, "end": 21}, "confidence": 0.88}, {"type": "KEY_TERM", "value": "тест", "source": "user_text", "subtype": null, "span": {"start": 6, "end": 11}, "confidence": 0.9}]}, "retrieval_spec": {"domains": ["CODE"], "layer_queries": [{"layer_id": "C1_SYMBOL_CATALOG", "top_k": 8}, {"layer_id": "C2_DEPENDENCY_GRAPH", "top_k": 6}, {"layer_id": "C0_SOURCE_CHUNKS", "top_k": 10}], "filters": {"test_policy": "INCLUDE", "path_scope": [], "language": ["python"]}, "rerank_profile": "code"}, "retrieval_constraints": {"include_globs": ["src/**", "tests/**", "**/test_*.py", "**/*_test.py", "**/conftest.py"], "exclude_globs": [], "prefer_globs": ["tests/**", "**/test_*.py", "**/*_test.py"], "test_file_globs": ["tests/**", "**/test_*.py", "**/*_test.py", "**/conftest.py"], "test_symbol_patterns": ["test_order", "TestOrder", "Order"], "max_candidates": 20, "fuzzy_symbol_search": {"enabled": true, "max_distance": 2, "top_k": 5}}, "symbol_resolution": {"status": "pending", "resolved_symbol": null, "alternatives": ["Order"], "confidence": 0.0}, "evidence_policy": {"require_def": true, "require_flow": true, "require_spec": false, "allow_answer_without_evidence": false}} -intent router v2 request: turn=1 active_intent=None user_query=Есть ли тесты на репозиторий? languages=['python'] domains=['CODE', 'DOCS'] -intent router v2 result: {"schema_version": "1.1", "intent": "CODE_QA", "retrieval_profile": "code", "graph_id": "CodeQAGraph", "conversation_mode": "START", "query_plan": {"raw": "Есть ли тесты на репозиторий?", "normalized": "Есть ли тесты на репозиторий?", "sub_intent": "FIND_TESTS", "negations": [], "expansions": ["test", "unit test"], "keyword_hints": [], "path_hints": [], "doc_scope_hints": [], "symbol_candidates": [], "symbol_kind_hint": "unknown", "anchors": [{"type": "KEY_TERM", "value": "тест", "source": "user_text", "subtype": null, "span": {"start": 8, "end": 13}, "confidence": 0.9}]}, "retrieval_spec": {"domains": ["CODE"], "layer_queries": [{"layer_id": "C1_SYMBOL_CATALOG", "top_k": 8}, {"layer_id": "C2_DEPENDENCY_GRAPH", "top_k": 6}, {"layer_id": "C0_SOURCE_CHUNKS", "top_k": 10}], "filters": {"test_policy": "INCLUDE", "path_scope": [], "language": ["python"]}, "rerank_profile": "code"}, "retrieval_constraints": {"include_globs": ["src/**", "tests/**", "**/test_*.py", "**/*_test.py", "**/conftest.py"], "exclude_globs": [], "prefer_globs": ["tests/**", "**/test_*.py", "**/*_test.py"], "test_file_globs": ["tests/**", "**/test_*.py", "**/*_test.py", "**/conftest.py"], "test_symbol_patterns": [], "max_candidates": 20, "fuzzy_symbol_search": {"enabled": true, "max_distance": 2, "top_k": 5}}, "symbol_resolution": {"status": "not_requested", "resolved_symbol": null, "alternatives": [], "confidence": 0.0}, "evidence_policy": {"require_def": true, "require_flow": true, "require_spec": false, "allow_answer_without_evidence": false}} -intent router v2 request: turn=1 active_intent=None user_query=Где тесты для NonExistent? languages=['python'] domains=['CODE', 'DOCS'] -intent router v2 result: {"schema_version": "1.1", "intent": "CODE_QA", "retrieval_profile": "code", "graph_id": "CodeQAGraph", "conversation_mode": "START", "query_plan": {"raw": "Где тесты для NonExistent?", "normalized": "Где тесты для NonExistent?", "sub_intent": "FIND_TESTS", "negations": [], "expansions": ["test", "unit test", "NonExistent"], "keyword_hints": ["NonExistent"], "path_hints": [], "doc_scope_hints": [], "symbol_candidates": ["NonExistent"], "symbol_kind_hint": "class", "anchors": [{"type": "SYMBOL", "value": "NonExistent", "source": "user_text", "subtype": null, "span": {"start": 14, "end": 25}, "confidence": 0.88}, {"type": "KEY_TERM", "value": "тест", "source": "user_text", "subtype": null, "span": {"start": 4, "end": 9}, "confidence": 0.9}]}, "retrieval_spec": {"domains": ["CODE"], "layer_queries": [{"layer_id": "C1_SYMBOL_CATALOG", "top_k": 8}, {"layer_id": "C2_DEPENDENCY_GRAPH", "top_k": 6}, {"layer_id": "C0_SOURCE_CHUNKS", "top_k": 10}], "filters": {"test_policy": "INCLUDE", "path_scope": [], "language": ["python"]}, "rerank_profile": "code"}, "retrieval_constraints": {"include_globs": ["src/**", "tests/**", "**/test_*.py", "**/*_test.py", "**/conftest.py"], "exclude_globs": [], "prefer_globs": ["tests/**", "**/test_*.py", "**/*_test.py"], "test_file_globs": ["tests/**", "**/test_*.py", "**/*_test.py", "**/conftest.py"], "test_symbol_patterns": ["test_non_existent", "TestNonExistent", "NonExistent"], "max_candidates": 20, "fuzzy_symbol_search": {"enabled": true, "max_distance": 2, "top_k": 5}}, "symbol_resolution": {"status": "pending", "resolved_symbol": null, "alternatives": ["NonExistent"], "confidence": 0.0}, "evidence_policy": {"require_def": true, "require_flow": true, "require_spec": false, "allow_answer_without_evidence": false}} -intent router v2 request: turn=1 active_intent=None user_query=Какие точки входа в приложение? languages=['python'] domains=['CODE', 'DOCS'] -intent router v2 result: {"schema_version": "1.1", "intent": "PROJECT_MISC", "retrieval_profile": "code", "graph_id": "ProjectMiscGraph", "conversation_mode": "START", "query_plan": {"raw": "Какие точки входа в приложение?", "normalized": "Какие точки входа в приложение?", "sub_intent": "FIND_ENTRYPOINTS", "negations": [], "expansions": [], "keyword_hints": [], "path_hints": [], "doc_scope_hints": [], "symbol_candidates": [], "symbol_kind_hint": "unknown", "anchors": []}, "retrieval_spec": {"domains": ["CODE", "DOCS"], "layer_queries": [{"layer_id": "D1_MODULE_CATALOG", "top_k": 4}, {"layer_id": "D3_SECTION_INDEX", "top_k": 6}, {"layer_id": "C1_SYMBOL_CATALOG", "top_k": 4}, {"layer_id": "C0_SOURCE_CHUNKS", "top_k": 4}], "filters": {"test_policy": "EXCLUDE", "path_scope": [], "language": ["python"], "doc_kinds": [], "doc_language": []}, "rerank_profile": "project"}, "retrieval_constraints": {"include_globs": ["src/**"], "exclude_globs": ["tests/**", "**/test_*.py", "**/*_test.py"], "prefer_globs": [], "test_file_globs": [], "test_symbol_patterns": [], "max_candidates": 20, "fuzzy_symbol_search": {"enabled": true, "max_distance": 2, "top_k": 5}}, "symbol_resolution": {"status": "not_requested", "resolved_symbol": null, "alternatives": [], "confidence": 0.0}, "evidence_policy": {"require_def": false, "require_flow": false, "require_spec": false, "allow_answer_without_evidence": true}} -intent router v2 request: turn=1 active_intent=None user_query=Find application entrypoints languages=['python'] domains=['CODE', 'DOCS'] -intent router v2 result: {"schema_version": "1.1", "intent": "CODE_QA", "retrieval_profile": "code", "graph_id": "CodeQAGraph", "conversation_mode": "START", "query_plan": {"raw": "Find application entrypoints", "normalized": "Find application entrypoints", "sub_intent": "FIND_ENTRYPOINTS", "negations": [], "expansions": ["Find", "application", "entrypoints"], "keyword_hints": ["Find", "application", "entrypoints"], "path_hints": [], "doc_scope_hints": [], "symbol_candidates": ["Find", "application", "entrypoints"], "symbol_kind_hint": "class", "anchors": [{"type": "SYMBOL", "value": "Find", "source": "user_text", "subtype": null, "span": {"start": 0, "end": 4}, "confidence": 0.88}, {"type": "SYMBOL", "value": "application", "source": "user_text", "subtype": null, "span": {"start": 5, "end": 16}, "confidence": 0.88}, {"type": "SYMBOL", "value": "entrypoints", "source": "user_text", "subtype": null, "span": {"start": 17, "end": 28}, "confidence": 0.88}]}, "retrieval_spec": {"domains": ["CODE"], "layer_queries": [{"layer_id": "C3_ENTRYPOINTS", "top_k": 12}, {"layer_id": "C0_SOURCE_CHUNKS", "top_k": 6}], "filters": {"test_policy": "EXCLUDE", "path_scope": [], "language": ["python"]}, "rerank_profile": "code"}, "retrieval_constraints": {"include_globs": ["src/**"], "exclude_globs": ["tests/**", "**/test_*.py", "**/*_test.py"], "prefer_globs": [], "test_file_globs": [], "test_symbol_patterns": [], "max_candidates": 20, "fuzzy_symbol_search": {"enabled": true, "max_distance": 2, "top_k": 5}}, "symbol_resolution": {"status": "pending", "resolved_symbol": null, "alternatives": ["Find", "application", "entrypoints"], "confidence": 0.0}, "evidence_policy": {"require_def": true, "require_flow": true, "require_spec": false, "allow_answer_without_evidence": false}} -intent router v2 request: turn=1 active_intent=None user_query=Где main? languages=['python'] domains=['CODE', 'DOCS'] -intent router v2 result: {"schema_version": "1.1", "intent": "PROJECT_MISC", "retrieval_profile": "code", "graph_id": "ProjectMiscGraph", "conversation_mode": "START", "query_plan": {"raw": "Где main?", "normalized": "Где main?", "sub_intent": "FIND_ENTRYPOINTS", "negations": [], "expansions": ["main"], "keyword_hints": ["main"], "path_hints": [], "doc_scope_hints": [], "symbol_candidates": ["main"], "symbol_kind_hint": "unknown", "anchors": [{"type": "SYMBOL", "value": "main", "source": "user_text", "subtype": null, "span": {"start": 4, "end": 8}, "confidence": 0.88}]}, "retrieval_spec": {"domains": ["CODE", "DOCS"], "layer_queries": [{"layer_id": "D1_MODULE_CATALOG", "top_k": 4}, {"layer_id": "D3_SECTION_INDEX", "top_k": 6}, {"layer_id": "C1_SYMBOL_CATALOG", "top_k": 4}, {"layer_id": "C0_SOURCE_CHUNKS", "top_k": 4}], "filters": {"test_policy": "EXCLUDE", "path_scope": [], "language": ["python"], "doc_kinds": [], "doc_language": []}, "rerank_profile": "project"}, "retrieval_constraints": {"include_globs": ["src/**"], "exclude_globs": ["tests/**", "**/test_*.py", "**/*_test.py"], "prefer_globs": [], "test_file_globs": [], "test_symbol_patterns": [], "max_candidates": 20, "fuzzy_symbol_search": {"enabled": true, "max_distance": 2, "top_k": 5}}, "symbol_resolution": {"status": "pending", "resolved_symbol": null, "alternatives": ["main"], "confidence": 0.0}, "evidence_policy": {"require_def": false, "require_flow": false, "require_spec": false, "allow_answer_without_evidence": true}} -intent router v2 request: turn=1 active_intent=None user_query=Что делает этот проект? languages=['python'] domains=['CODE', 'DOCS'] -intent router v2 result: {"schema_version": "1.1", "intent": "PROJECT_MISC", "retrieval_profile": "code", "graph_id": "ProjectMiscGraph", "conversation_mode": "START", "query_plan": {"raw": "Что делает этот проект?", "normalized": "Что делает этот проект?", "sub_intent": "EXPLAIN", "negations": [], "expansions": [], "keyword_hints": [], "path_hints": [], "doc_scope_hints": [], "symbol_candidates": [], "symbol_kind_hint": "unknown", "anchors": []}, "retrieval_spec": {"domains": ["CODE", "DOCS"], "layer_queries": [{"layer_id": "D1_MODULE_CATALOG", "top_k": 4}, {"layer_id": "D3_SECTION_INDEX", "top_k": 6}, {"layer_id": "C1_SYMBOL_CATALOG", "top_k": 4}, {"layer_id": "C0_SOURCE_CHUNKS", "top_k": 4}], "filters": {"test_policy": "EXCLUDE", "path_scope": [], "language": ["python"], "doc_kinds": [], "doc_language": []}, "rerank_profile": "project"}, "retrieval_constraints": {"include_globs": ["src/**"], "exclude_globs": ["tests/**", "**/test_*.py", "**/*_test.py"], "prefer_globs": [], "test_file_globs": [], "test_symbol_patterns": [], "max_candidates": 20, "fuzzy_symbol_search": {"enabled": true, "max_distance": 2, "top_k": 5}}, "symbol_resolution": {"status": "not_requested", "resolved_symbol": null, "alternatives": [], "confidence": 0.0}, "evidence_policy": {"require_def": false, "require_flow": false, "require_spec": false, "allow_answer_without_evidence": true}} -intent router v2 request: turn=1 active_intent=None user_query=How does order creation work? languages=['python'] domains=['CODE', 'DOCS'] -intent router v2 result: {"schema_version": "1.1", "intent": "CODE_QA", "retrieval_profile": "code", "graph_id": "CodeQAGraph", "conversation_mode": "START", "query_plan": {"raw": "How does order creation work?", "normalized": "How does order creation work?", "sub_intent": "ARCHITECTURE", "negations": [], "expansions": ["How", "does", "order", "creation", "work"], "keyword_hints": ["How", "does", "order", "creation", "work"], "path_hints": [], "doc_scope_hints": [], "symbol_candidates": ["How", "does", "order", "creation", "work"], "symbol_kind_hint": "class", "anchors": [{"type": "SYMBOL", "value": "How", "source": "user_text", "subtype": null, "span": {"start": 0, "end": 3}, "confidence": 0.88}, {"type": "SYMBOL", "value": "does", "source": "user_text", "subtype": null, "span": {"start": 4, "end": 8}, "confidence": 0.88}, {"type": "SYMBOL", "value": "order", "source": "user_text", "subtype": null, "span": {"start": 9, "end": 14}, "confidence": 0.88}, {"type": "SYMBOL", "value": "creation", "source": "user_text", "subtype": null, "span": {"start": 15, "end": 23}, "confidence": 0.88}, {"type": "SYMBOL", "value": "work", "source": "user_text", "subtype": null, "span": {"start": 24, "end": 28}, "confidence": 0.88}]}, "retrieval_spec": {"domains": ["CODE"], "layer_queries": [{"layer_id": "C4_SEMANTIC_ROLES", "top_k": 12}, {"layer_id": "C3_ENTRYPOINTS", "top_k": 8}, {"layer_id": "C2_DEPENDENCY_GRAPH", "top_k": 8}, {"layer_id": "C1_SYMBOL_CATALOG", "top_k": 6}, {"layer_id": "C0_SOURCE_CHUNKS", "top_k": 4}], "filters": {"test_policy": "EXCLUDE", "path_scope": [], "language": ["python"]}, "rerank_profile": "code"}, "retrieval_constraints": {"include_globs": ["src/**"], "exclude_globs": ["tests/**", "**/test_*.py", "**/*_test.py"], "prefer_globs": [], "test_file_globs": [], "test_symbol_patterns": [], "max_candidates": 20, "fuzzy_symbol_search": {"enabled": true, "max_distance": 2, "top_k": 5}}, "symbol_resolution": {"status": "pending", "resolved_symbol": null, "alternatives": ["How", "does", "order", "creation", "work"], "confidence": 0.0}, "evidence_policy": {"require_def": true, "require_flow": true, "require_spec": false, "allow_answer_without_evidence": false}} -intent router v2 request: turn=1 active_intent=None user_query=Расскажи про код languages=['python'] domains=['CODE', 'DOCS'] -intent router v2 result: {"schema_version": "1.1", "intent": "CODE_QA", "retrieval_profile": "code", "graph_id": "CodeQAGraph", "conversation_mode": "START", "query_plan": {"raw": "Расскажи про код", "normalized": "Расскажи про код", "sub_intent": "EXPLAIN", "negations": [], "expansions": [], "keyword_hints": [], "path_hints": [], "doc_scope_hints": [], "symbol_candidates": [], "symbol_kind_hint": "unknown", "anchors": []}, "retrieval_spec": {"domains": ["CODE"], "layer_queries": [{"layer_id": "C1_SYMBOL_CATALOG", "top_k": 8}, {"layer_id": "C0_SOURCE_CHUNKS", "top_k": 8}, {"layer_id": "C4_SEMANTIC_ROLES", "top_k": 8}, {"layer_id": "C2_DEPENDENCY_GRAPH", "top_k": 6}, {"layer_id": "C3_ENTRYPOINTS", "top_k": 6}], "filters": {"test_policy": "EXCLUDE", "path_scope": [], "language": ["python"]}, "rerank_profile": "code"}, "retrieval_constraints": {"include_globs": ["src/**"], "exclude_globs": ["tests/**", "**/test_*.py", "**/*_test.py"], "prefer_globs": [], "test_file_globs": [], "test_symbol_patterns": [], "max_candidates": 20, "fuzzy_symbol_search": {"enabled": true, "max_distance": 2, "top_k": 5}}, "symbol_resolution": {"status": "not_requested", "resolved_symbol": null, "alternatives": [], "confidence": 0.0}, "evidence_policy": {"require_def": true, "require_flow": true, "require_spec": false, "allow_answer_without_evidence": false}} - -8/18 cases passed. Summary: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/summary_20260311_233942.md - FAIL open_file_borderline: sub_intent: expected OPEN_FILE, got FIND_ENTRYPOINTS - FAIL open_file_negative: answer_mode: expected degraded, got insufficient - FAIL explain_borderline: intent: expected CODE_QA, got PROJECT_MISC - FAIL explain_negative: answer_mode: expected degraded, got normal - FAIL find_tests_negative: answer_mode: expected degraded, got normal - FAIL find_entrypoints_positive: intent: expected CODE_QA, got PROJECT_MISC; answer_mode: expected normal, got degraded - FAIL find_entrypoints_borderline: intent: expected CODE_QA, got PROJECT_MISC; answer_mode: expected normal, got degraded - FAIL general_qa_positive: intent: expected CODE_QA, got PROJECT_MISC; sub_intent: expected GENERAL_QA, got EXPLAIN - FAIL general_qa_how: sub_intent: expected GENERAL_QA, got ARCHITECTURE - FAIL general_qa_borderline: sub_intent: expected GENERAL_QA, got EXPLAIN diff --git a/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/summary_20260311_232925.md b/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/summary_20260311_232925.md deleted file mode 100644 index 5a31ae5..0000000 --- a/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/summary_20260311_232925.md +++ /dev/null @@ -1,36 +0,0 @@ -# CODE_QA evaluation summary - -**8/18** cases passed. - -| Case ID | Query | Expected scenario | Actual scenario | Target | Evidence | Answer mode | Pass | -|---------|-------|------------------|-----------------|--------|----------|-------------|------| -| open_file_main_positive | Открой файл main.py | OPEN_FILE | OPEN_FILE | main.py | ✓ | normal | ✓ | -| open_file_api_positive | Покажи src/order_app/api/orders.py | OPEN_FILE | OPEN_FILE | src/order_app/api/orders.py | ✓ | normal | ✓ | -| open_file_borderline | Open main | OPEN_FILE | FIND_ENTRYPOINTS | src/order_app/api/orders.py | ✓ | normal | ✗ | -| open_file_negative | Открой файл nonexistent/foo.py | OPEN_FILE | OPEN_FILE | — | ✗ | insufficient | ✗ | -| explain_order_positive | Объясни класс Order | EXPLAIN | EXPLAIN | Order | ✓ | normal | ✓ | -| explain_order_service_positive | Как работает OrderService? | EXPLAIN | EXPLAIN | OrderService | ✓ | normal | ✓ | -| explain_borderline | Что делает create_order? | EXPLAIN | EXPLAIN | src/order_app/api/orders.py | ✓ | normal | ✗ | -| explain_negative | Объясни класс NonExistentClass | EXPLAIN | EXPLAIN | src/order_app/api/__init__.py | ✓ | normal | ✗ | -| find_tests_positive | Где тесты для OrderService? | FIND_TESTS | FIND_TESTS | tests/test_order_service.py | ✓ | normal | ✓ | -| find_tests_order_positive | Найди тесты для Order | FIND_TESTS | FIND_TESTS | tests/test_order_service.py | ✓ | normal | ✓ | -| find_tests_borderline | Есть ли тесты на репозиторий? | FIND_TESTS | FIND_TESTS | tests/test_order_service.py | ✓ | normal | ✓ | -| find_tests_negative | Где тесты для NonExistent? | FIND_TESTS | FIND_TESTS | tests/test_order_service.py | ✓ | normal | ✗ | -| find_entrypoints_positive | Какие точки входа в приложение? | FIND_ENTRYPOINTS | FIND_ENTRYPOINTS | src/order_app/api/orders.py | ✗ | degraded | ✗ | -| find_entrypoints_english | Find application entrypoints | FIND_ENTRYPOINTS | FIND_ENTRYPOINTS | src/order_app/api/orders.py | ✓ | normal | ✓ | -| find_entrypoints_borderline | Где main? | FIND_ENTRYPOINTS | FIND_ENTRYPOINTS | src/order_app/domain/order.py | ✗ | degraded | ✗ | -| general_qa_positive | Что делает этот проект? | GENERAL_QA | EXPLAIN | src/order_app/api/orders.py | ✓ | normal | ✗ | -| general_qa_how | How does order creation work? | GENERAL_QA | ARCHITECTURE | Order | ✓ | normal | ✗ | -| general_qa_borderline | Расскажи про код | GENERAL_QA | EXPLAIN | src/order_app/api/orders.py | ✓ | normal | ✗ | - -## Failures -- **open_file_borderline**: sub_intent: expected OPEN_FILE, got FIND_ENTRYPOINTS -- **open_file_negative**: answer_mode: expected degraded, got insufficient -- **explain_borderline**: intent: expected CODE_QA, got PROJECT_MISC -- **explain_negative**: answer_mode: expected degraded, got normal -- **find_tests_negative**: answer_mode: expected degraded, got normal -- **find_entrypoints_positive**: intent: expected CODE_QA, got PROJECT_MISC; answer_mode: expected normal, got degraded -- **find_entrypoints_borderline**: intent: expected CODE_QA, got PROJECT_MISC; answer_mode: expected normal, got degraded -- **general_qa_positive**: intent: expected CODE_QA, got PROJECT_MISC; sub_intent: expected GENERAL_QA, got EXPLAIN -- **general_qa_how**: sub_intent: expected GENERAL_QA, got ARCHITECTURE -- **general_qa_borderline**: sub_intent: expected GENERAL_QA, got EXPLAIN \ No newline at end of file diff --git a/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/summary_20260311_233701.md b/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/summary_20260311_233701.md deleted file mode 100644 index 9a002a5..0000000 --- a/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/summary_20260311_233701.md +++ /dev/null @@ -1,40 +0,0 @@ -# CODE_QA evaluation summary - -**8/18** cases passed. - - -| Case ID | Query | Expected scenario | Actual scenario | Target | Evidence | Answer mode | Pass | -| ------------------------------ | ---------------------------------- | ----------------- | ---------------- | ----------------------------- | -------- | ------------ | ---- | -| open_file_main_positive | Открой файл main.py | OPEN_FILE | OPEN_FILE | main.py | ✓ | normal | ✓ | -| open_file_api_positive | Покажи src/order_app/api/orders.py | OPEN_FILE | OPEN_FILE | src/order_app/api/orders.py | ✓ | normal | ✓ | -| open_file_borderline | Open main | OPEN_FILE | FIND_ENTRYPOINTS | src/order_app/api/orders.py | ✓ | normal | ✗ | -| open_file_negative | Открой файл nonexistent/foo.py | OPEN_FILE | OPEN_FILE | — | ✗ | insufficient | ✗ | -| explain_order_positive | Объясни класс Order | EXPLAIN | EXPLAIN | Order | ✓ | normal | ✓ | -| explain_order_service_positive | Как работает OrderService? | EXPLAIN | EXPLAIN | OrderService | ✓ | normal | ✓ | -| explain_borderline | Что делает create_order? | EXPLAIN | EXPLAIN | src/order_app/api/orders.py | ✓ | normal | ✗ | -| explain_negative | Объясни класс NonExistentClass | EXPLAIN | EXPLAIN | src/order_app/domain/order.py | ✓ | normal | ✗ | -| find_tests_positive | Где тесты для OrderService? | FIND_TESTS | FIND_TESTS | tests/test_order_service.py | ✓ | normal | ✓ | -| find_tests_order_positive | Найди тесты для Order | FIND_TESTS | FIND_TESTS | tests/test_order_service.py | ✓ | normal | ✓ | -| find_tests_borderline | Есть ли тесты на репозиторий? | FIND_TESTS | FIND_TESTS | tests/test_order_service.py | ✓ | normal | ✓ | -| find_tests_negative | Где тесты для NonExistent? | FIND_TESTS | FIND_TESTS | tests/test_order_service.py | ✓ | normal | ✗ | -| find_entrypoints_positive | Какие точки входа в приложение? | FIND_ENTRYPOINTS | FIND_ENTRYPOINTS | src/order_app/api/**init**.py | ✗ | degraded | ✗ | -| find_entrypoints_english | Find application entrypoints | FIND_ENTRYPOINTS | FIND_ENTRYPOINTS | src/order_app/api/orders.py | ✓ | normal | ✓ | -| find_entrypoints_borderline | Где main? | FIND_ENTRYPOINTS | FIND_ENTRYPOINTS | src/order_app/domain/order.py | ✗ | degraded | ✗ | -| general_qa_positive | Что делает этот проект? | GENERAL_QA | EXPLAIN | src/order_app/api/**init**.py | ✓ | normal | ✗ | -| general_qa_how | How does order creation work? | GENERAL_QA | ARCHITECTURE | Order | ✓ | normal | ✗ | -| general_qa_borderline | Расскажи про код | GENERAL_QA | EXPLAIN | src/order_app/api/**init**.py | ✓ | normal | ✗ | - - -## Failures - -- **open_file_borderline**: sub_intent: expected OPEN_FILE, got FIND_ENTRYPOINTS -- **open_file_negative**: answer_mode: expected degraded, got insufficient -- **explain_borderline**: intent: expected CODE_QA, got PROJECT_MISC -- **explain_negative**: answer_mode: expected degraded, got normal -- **find_tests_negative**: answer_mode: expected degraded, got normal -- **find_entrypoints_positive**: intent: expected CODE_QA, got PROJECT_MISC; answer_mode: expected normal, got degraded -- **find_entrypoints_borderline**: intent: expected CODE_QA, got PROJECT_MISC; answer_mode: expected normal, got degraded -- **general_qa_positive**: intent: expected CODE_QA, got PROJECT_MISC; sub_intent: expected GENERAL_QA, got EXPLAIN -- **general_qa_how**: sub_intent: expected GENERAL_QA, got ARCHITECTURE -- **general_qa_borderline**: sub_intent: expected GENERAL_QA, got EXPLAIN - diff --git a/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/summary_20260311_233942.md b/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/summary_20260311_233942.md deleted file mode 100644 index 9a002a5..0000000 --- a/tests/pipeline_setup/suite_01_synthetic/test_results/code_qa_eval/summary_20260311_233942.md +++ /dev/null @@ -1,40 +0,0 @@ -# CODE_QA evaluation summary - -**8/18** cases passed. - - -| Case ID | Query | Expected scenario | Actual scenario | Target | Evidence | Answer mode | Pass | -| ------------------------------ | ---------------------------------- | ----------------- | ---------------- | ----------------------------- | -------- | ------------ | ---- | -| open_file_main_positive | Открой файл main.py | OPEN_FILE | OPEN_FILE | main.py | ✓ | normal | ✓ | -| open_file_api_positive | Покажи src/order_app/api/orders.py | OPEN_FILE | OPEN_FILE | src/order_app/api/orders.py | ✓ | normal | ✓ | -| open_file_borderline | Open main | OPEN_FILE | FIND_ENTRYPOINTS | src/order_app/api/orders.py | ✓ | normal | ✗ | -| open_file_negative | Открой файл nonexistent/foo.py | OPEN_FILE | OPEN_FILE | — | ✗ | insufficient | ✗ | -| explain_order_positive | Объясни класс Order | EXPLAIN | EXPLAIN | Order | ✓ | normal | ✓ | -| explain_order_service_positive | Как работает OrderService? | EXPLAIN | EXPLAIN | OrderService | ✓ | normal | ✓ | -| explain_borderline | Что делает create_order? | EXPLAIN | EXPLAIN | src/order_app/api/orders.py | ✓ | normal | ✗ | -| explain_negative | Объясни класс NonExistentClass | EXPLAIN | EXPLAIN | src/order_app/domain/order.py | ✓ | normal | ✗ | -| find_tests_positive | Где тесты для OrderService? | FIND_TESTS | FIND_TESTS | tests/test_order_service.py | ✓ | normal | ✓ | -| find_tests_order_positive | Найди тесты для Order | FIND_TESTS | FIND_TESTS | tests/test_order_service.py | ✓ | normal | ✓ | -| find_tests_borderline | Есть ли тесты на репозиторий? | FIND_TESTS | FIND_TESTS | tests/test_order_service.py | ✓ | normal | ✓ | -| find_tests_negative | Где тесты для NonExistent? | FIND_TESTS | FIND_TESTS | tests/test_order_service.py | ✓ | normal | ✗ | -| find_entrypoints_positive | Какие точки входа в приложение? | FIND_ENTRYPOINTS | FIND_ENTRYPOINTS | src/order_app/api/**init**.py | ✗ | degraded | ✗ | -| find_entrypoints_english | Find application entrypoints | FIND_ENTRYPOINTS | FIND_ENTRYPOINTS | src/order_app/api/orders.py | ✓ | normal | ✓ | -| find_entrypoints_borderline | Где main? | FIND_ENTRYPOINTS | FIND_ENTRYPOINTS | src/order_app/domain/order.py | ✗ | degraded | ✗ | -| general_qa_positive | Что делает этот проект? | GENERAL_QA | EXPLAIN | src/order_app/api/**init**.py | ✓ | normal | ✗ | -| general_qa_how | How does order creation work? | GENERAL_QA | ARCHITECTURE | Order | ✓ | normal | ✗ | -| general_qa_borderline | Расскажи про код | GENERAL_QA | EXPLAIN | src/order_app/api/**init**.py | ✓ | normal | ✗ | - - -## Failures - -- **open_file_borderline**: sub_intent: expected OPEN_FILE, got FIND_ENTRYPOINTS -- **open_file_negative**: answer_mode: expected degraded, got insufficient -- **explain_borderline**: intent: expected CODE_QA, got PROJECT_MISC -- **explain_negative**: answer_mode: expected degraded, got normal -- **find_tests_negative**: answer_mode: expected degraded, got normal -- **find_entrypoints_positive**: intent: expected CODE_QA, got PROJECT_MISC; answer_mode: expected normal, got degraded -- **find_entrypoints_borderline**: intent: expected CODE_QA, got PROJECT_MISC; answer_mode: expected normal, got degraded -- **general_qa_positive**: intent: expected CODE_QA, got PROJECT_MISC; sub_intent: expected GENERAL_QA, got EXPLAIN -- **general_qa_how**: sub_intent: expected GENERAL_QA, got ARCHITECTURE -- **general_qa_borderline**: sub_intent: expected GENERAL_QA, got EXPLAIN - diff --git a/tests/pipeline_setup/suite_02_pipeline/README.md b/tests/pipeline_setup/suite_02_pipeline/README.md deleted file mode 100644 index 0d78889..0000000 --- a/tests/pipeline_setup/suite_02_pipeline/README.md +++ /dev/null @@ -1,108 +0,0 @@ -# Suite 02 Pipeline - -Интеграционный набор тестов для режимов: - -- `router_only` -- `router_rag` -- `full_chain` - -## Что входит в suite - -- `pipeline_intent_rag/` — тесты, fixtures и runtime пайплайна -- `cli/` — запускные скрипты для индексации и ручного прогона пайплайна - -## Запуск тестов через pytest - -Из корня проекта: - -```bash -PYTHONPATH=. pytest tests/pipeline_setup/suite_02_pipeline/pipeline_intent_rag/test_intent_router_only_matrix.py -q -``` - -Для retrieval-режима: - -```bash -PYTHONPATH=. RUN_INTENT_PIPELINE_ROUTER_RAG=1 pytest -m router_rag tests/pipeline_setup/suite_02_pipeline/pipeline_intent_rag/ -q -``` - -Для полной цепочки: - -```bash -PYTHONPATH=. RUN_INTENT_PIPELINE_FULL_CHAIN=1 pytest -m full_chain tests/pipeline_setup/suite_02_pipeline/pipeline_intent_rag/ -q -``` - -## Запуск через CLI - -### 1. Индексация репозитория - -```bash -PYTHONPATH=. python -m tests.pipeline_setup.suite_02_pipeline.cli.index_repo --repo-path /abs/path/to/repo [--project-id ID] -``` - -Параметры: - -- `--repo-path` — путь к индексируемому репозиторию -- `--project-id` — `project_id` для новой RAG-сессии - -### 2. Router only - -```bash -PYTHONPATH=. python -m tests.pipeline_setup.suite_02_pipeline.cli.run_router_only [--case-id ID ...] [--verbose] [--test-name PREFIX] -``` - -Параметры: - -- `--case-id` — запуск только выбранных кейсов, можно передавать несколько раз -- `--verbose` — печатать полную диагностику -- `--test-name` — префикс имени артефакта - -### 3. Router + RAG - -```bash -PYTHONPATH=. python -m tests.pipeline_setup.suite_02_pipeline.cli.run_router_rag --rag-session-id [--case-id ID ...] [--verbose] [--test-name PREFIX] -``` - -или с переиндексацией: - -```bash -PYTHONPATH=. python -m tests.pipeline_setup.suite_02_pipeline.cli.run_router_rag --reindex-repo-path /abs/path/to/repo [--reindex-project-id ID] [--case-id ID ...] [--verbose] -``` - -Параметры: - -- `--rag-session-id` — готовый `rag_session_id` для всех кейсов -- `--reindex-repo-path` — путь к репозиторию, который нужно проиндексировать перед прогоном -- `--reindex-project-id` — `project_id` для новой RAG-сессии -- `--case-id` — запуск только выбранных кейсов -- `--verbose` — печатать расширенную диагностику -- `--test-name` — префикс имени артефакта - -### 4. Full chain - -```bash -PYTHONPATH=. python -m tests.pipeline_setup.suite_02_pipeline.cli.run_full_chain --rag-session-id [--case-id ID ...] [--verbose] [--test-name PREFIX] -``` - -или с переиндексацией: - -```bash -PYTHONPATH=. python -m tests.pipeline_setup.suite_02_pipeline.cli.run_full_chain --reindex-repo-path /abs/path/to/repo [--reindex-project-id ID] [--case-id ID ...] [--verbose] -``` - -Параметры те же, что и у `run_router_rag`. - -## Переменные окружения - -- `RUN_INTENT_PIPELINE_ROUTER_RAG=1` — включает тесты и прогоны `router_rag` -- `RUN_INTENT_PIPELINE_FULL_CHAIN=1` — включает тесты и прогоны `full_chain` -- `DATABASE_URL` — обязателен для retrieval и full chain -- `INTENT_PIPELINE_FORCE_RAG_SESSION_ID` — принудительный `rag_session_id` для всех кейсов -- `INTENT_PIPELINE_RAG_SESSION_ID` — дефолтный `rag_session_id` -- `INTENT_PIPELINE_REINDEX_REPO_PATH` — путь к репозиторию для автоиндексации -- `INTENT_PIPELINE_REINDEX_PROJECT_ID` — `project_id` для автоиндексации - -Артефакты прогонов пишутся в: -[test_results](/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup/test_results) - -Детали по внутреннему устройству пайплайна: -[pipeline_intent_rag/README.md](/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup/suite_02_pipeline/pipeline_intent_rag/README.md) diff --git a/tests/pipeline_setup/suite_02_pipeline/__init__.py b/tests/pipeline_setup/suite_02_pipeline/__init__.py deleted file mode 100644 index 00568c8..0000000 --- a/tests/pipeline_setup/suite_02_pipeline/__init__.py +++ /dev/null @@ -1 +0,0 @@ -"""Pipeline integration suites for router_only, router_rag, and full_chain.""" diff --git a/tests/pipeline_setup/suite_02_pipeline/cli/__init__.py b/tests/pipeline_setup/suite_02_pipeline/cli/__init__.py deleted file mode 100644 index 4531c61..0000000 --- a/tests/pipeline_setup/suite_02_pipeline/cli/__init__.py +++ /dev/null @@ -1 +0,0 @@ -"""CLI entrypoints for pipeline test runs and repository reindexing.""" diff --git a/tests/pipeline_setup/suite_02_pipeline/cli/index_repo.py b/tests/pipeline_setup/suite_02_pipeline/cli/index_repo.py deleted file mode 100644 index 5d0d71f..0000000 --- a/tests/pipeline_setup/suite_02_pipeline/cli/index_repo.py +++ /dev/null @@ -1,36 +0,0 @@ -"""Скрипт индексации репозитория: создаёт RAG-сессию и индексирует указанную директорию. - -Используется для подготовки репозитория перед запуском тестовых пайплайнов с retrieval или full_chain. -Запуск из корня проекта (agent): - - python -m tests.pipeline_setup.suite_02_pipeline.cli.index_repo --repo-path /path/to/repo [--project-id ID] - -Параметры: - --repo-path (обязательный) Путь к корню индексируемого репозитория. - --project-id (опционально) Идентификатор проекта для созданной rag_session; по умолчанию — имя директории репо. -""" - -from __future__ import annotations - -import sys -from pathlib import Path - -# Обеспечиваем импорт из корня проекта -_agent_root = Path(__file__).resolve().parents[4] -if str(_agent_root) not in sys.path: - sys.path.insert(0, str(_agent_root)) - -# Добавляем src в путь для app -_src = _agent_root / "src" -if _src.exists() and str(_src) not in sys.path: - sys.path.insert(0, str(_src)) - - -def main() -> int: - argv = ["reindex", *sys.argv[1:]] - from tests.pipeline_setup.suite_02_pipeline.pipeline_intent_rag.cli import main as cli_main - return cli_main(argv) - - -if __name__ == "__main__": - raise SystemExit(main()) diff --git a/tests/pipeline_setup/suite_02_pipeline/cli/run_full_chain.py b/tests/pipeline_setup/suite_02_pipeline/cli/run_full_chain.py deleted file mode 100644 index 962cdd1..0000000 --- a/tests/pipeline_setup/suite_02_pipeline/cli/run_full_chain.py +++ /dev/null @@ -1,46 +0,0 @@ -"""Запуск тестового пайплайна «полная цепочка»: intent router + retrieval + LLM. - -Цепочка: intent_router_v2 → RAG retrieval → ответ GigaChat (или другой LLM). Нужны БД и индексированный репозиторий. - -Запуск из корня проекта (agent): - - python -m tests.pipeline_setup.suite_02_pipeline.cli.run_full_chain --rag-session-id [--case-id ID ...] [--verbose] - - Или с индексацией перед прогоном: - python -m tests.pipeline_setup.suite_02_pipeline.cli.run_full_chain --reindex-repo-path /path/to/repo [--reindex-project-id ID] - -Параметры: - --rag-session-id (рекомендуется) UUID RAG-сессии (после индексации через index_repo или run с --reindex-repo-path). - --reindex-repo-path Индексировать указанный репозиторий перед прогоном и использовать новую сессию. - --reindex-project-id project_id для новой сессии при использовании --reindex-repo-path. - --case-id (повторяемый) Запустить только указанные кейсы. - --verbose Выводить диагностику по каждому кейсу. - --test-name Префикс имени файла с результатами (по умолчанию cli_full_chain). - -Переменные окружения: - RUN_INTENT_PIPELINE_FULL_CHAIN=1 — включить маркер full_chain (иначе тесты с этим маркером пропускаются). - DATABASE_URL — подключение к БД (обязательно для retrieval). - (и переменные для доступа к LLM, см. .env и pipeline_intent_rag/.env.test) -""" - -from __future__ import annotations - -import sys -from pathlib import Path - -_agent_root = Path(__file__).resolve().parents[4] -if str(_agent_root) not in sys.path: - sys.path.insert(0, str(_agent_root)) -_src = _agent_root / "src" -if _src.exists() and str(_src) not in sys.path: - sys.path.insert(0, str(_src)) - - -def main() -> int: - argv = ["run", "--mode", "full_chain", *sys.argv[1:]] - from tests.pipeline_setup.suite_02_pipeline.pipeline_intent_rag.cli import main as cli_main - return cli_main(argv) - - -if __name__ == "__main__": - raise SystemExit(main()) diff --git a/tests/pipeline_setup/suite_02_pipeline/cli/run_router_only.py b/tests/pipeline_setup/suite_02_pipeline/cli/run_router_only.py deleted file mode 100644 index c24db42..0000000 --- a/tests/pipeline_setup/suite_02_pipeline/cli/run_router_only.py +++ /dev/null @@ -1,35 +0,0 @@ -"""Запуск тестового пайплайна «только intent router» (без RAG и LLM). - -Цепочка: intent_router_v2 — классификация запроса, без retrieval и ответа LLM. - -Запуск из корня проекта (agent): - - python -m tests.pipeline_setup.suite_02_pipeline.cli.run_router_only [--case-id ID ...] [--verbose] - -Параметры: - --case-id (повторяемый) Запустить только указанные кейсы по id. Без указания — все кейсы с тегом router_only. - --verbose Выводить диагностику по каждому кейсу. - --test-name Префикс имени файла с результатами (по умолчанию cli_router_only). -""" - -from __future__ import annotations - -import sys -from pathlib import Path - -_agent_root = Path(__file__).resolve().parents[4] -if str(_agent_root) not in sys.path: - sys.path.insert(0, str(_agent_root)) -_src = _agent_root / "src" -if _src.exists() and str(_src) not in sys.path: - sys.path.insert(0, str(_src)) - - -def main() -> int: - argv = ["run", "--mode", "router_only", *sys.argv[1:]] - from tests.pipeline_setup.suite_02_pipeline.pipeline_intent_rag.cli import main as cli_main - return cli_main(argv) - - -if __name__ == "__main__": - raise SystemExit(main()) diff --git a/tests/pipeline_setup/suite_02_pipeline/cli/run_router_rag.py b/tests/pipeline_setup/suite_02_pipeline/cli/run_router_rag.py deleted file mode 100644 index 4141807..0000000 --- a/tests/pipeline_setup/suite_02_pipeline/cli/run_router_rag.py +++ /dev/null @@ -1,45 +0,0 @@ -"""Запуск тестового пайплайна «intent router + retrieval» (без LLM). - -Цепочка: intent_router_v2 → RAG retrieval. Нужна предварительная индексация репозитория. - -Запуск из корня проекта (agent): - - python -m tests.pipeline_setup.suite_02_pipeline.cli.run_router_rag --rag-session-id [--case-id ID ...] [--verbose] - - Или с индексацией перед прогоном: - python -m tests.pipeline_setup.suite_02_pipeline.cli.run_router_rag --reindex-repo-path /path/to/repo [--reindex-project-id ID] - -Параметры: - --rag-session-id (рекомендуется) UUID RAG-сессии (после индексации через index_repo или run с --reindex-repo-path). - --reindex-repo-path Индексировать указанный репозиторий перед прогоном и использовать новую сессию. - --reindex-project-id project_id для новой сессии при использовании --reindex-repo-path. - --case-id (повторяемый) Запустить только указанные кейсы. - --verbose Выводить диагностику по каждому кейсу. - --test-name Префикс имени файла с результатами (по умолчанию cli_router_rag). - -Переменные окружения: - RUN_INTENT_PIPELINE_ROUTER_RAG=1 — включить маркер router_rag (иначе тесты с этим маркером пропускаются). - DATABASE_URL — подключение к БД (обязательно для retrieval). -""" - -from __future__ import annotations - -import sys -from pathlib import Path - -_agent_root = Path(__file__).resolve().parents[4] -if str(_agent_root) not in sys.path: - sys.path.insert(0, str(_agent_root)) -_src = _agent_root / "src" -if _src.exists() and str(_src) not in sys.path: - sys.path.insert(0, str(_src)) - - -def main() -> int: - argv = ["run", "--mode", "router_rag", *sys.argv[1:]] - from tests.pipeline_setup.suite_02_pipeline.pipeline_intent_rag.cli import main as cli_main - return cli_main(argv) - - -if __name__ == "__main__": - raise SystemExit(main()) diff --git a/tests/pipeline_setup/suite_02_pipeline/pipeline_intent_rag/.env.test b/tests/pipeline_setup/suite_02_pipeline/pipeline_intent_rag/.env.test deleted file mode 100644 index 348bd15..0000000 --- a/tests/pipeline_setup/suite_02_pipeline/pipeline_intent_rag/.env.test +++ /dev/null @@ -1,12 +0,0 @@ -# Test-only environment for pipeline_intent_rag suite -# Override this file locally when using another database. -DATABASE_URL=postgresql+psycopg://agent:agent@localhost:5432/agent -GIGACHAT_SSL_VERIFY=false - -# Optional defaults for integration runs: -# RUN_INTENT_PIPELINE_ROUTER_RAG=1 -# RUN_INTENT_PIPELINE_FULL_CHAIN=1 -# INTENT_PIPELINE_RAG_SESSION_ID= -# INTENT_PIPELINE_FORCE_RAG_SESSION_ID= -# INTENT_PIPELINE_REINDEX_REPO_PATH=/absolute/path/to/repo -# INTENT_PIPELINE_REINDEX_PROJECT_ID=my-project diff --git a/tests/pipeline_setup/suite_02_pipeline/pipeline_intent_rag/.env.test.example b/tests/pipeline_setup/suite_02_pipeline/pipeline_intent_rag/.env.test.example deleted file mode 100644 index 2aba1e9..0000000 --- a/tests/pipeline_setup/suite_02_pipeline/pipeline_intent_rag/.env.test.example +++ /dev/null @@ -1,12 +0,0 @@ -# Test-only environment for pipeline_intent_rag suite -# Override this file locally when using another database. -DATABASE_URL=postgresql+psycopg://agent:agent@db:5432/agent -GIGACHAT_SSL_VERIFY=false - -# Optional defaults for integration runs: -# RUN_INTENT_PIPELINE_ROUTER_RAG=1 -# RUN_INTENT_PIPELINE_FULL_CHAIN=1 -# INTENT_PIPELINE_RAG_SESSION_ID= -# INTENT_PIPELINE_FORCE_RAG_SESSION_ID= -# INTENT_PIPELINE_REINDEX_REPO_PATH=/absolute/path/to/repo -# INTENT_PIPELINE_REINDEX_PROJECT_ID=my-project diff --git a/tests/pipeline_setup/suite_02_pipeline/pipeline_intent_rag/README.md b/tests/pipeline_setup/suite_02_pipeline/pipeline_intent_rag/README.md deleted file mode 100644 index 159cd85..0000000 --- a/tests/pipeline_setup/suite_02_pipeline/pipeline_intent_rag/README.md +++ /dev/null @@ -1,82 +0,0 @@ -# Intent Pipeline Test Module - -## Что тестируется - -- `router_only`: только `intent_router_v2`. -- `router_rag`: `intent_router_v2 -> RAG retrieval`. -- `full_chain`: `intent_router_v2 -> RAG -> GigaChat`. - -## Каталог фраз - -Фразы лежат в [fixtures/phrases.yaml](/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup/suite_02_pipeline/pipeline_intent_rag/fixtures/phrases.yaml). - -Поля кейса: - -- `id` — уникальный ID. -- `text` — запрос пользователя. -- `tags` — в каких режимах кейс участвует (`router_only`, `router_rag`, `full_chain`). -- `expected_intent` — опциональная проверка intent. -- `expect_non_empty_rag` — ожидание непустого RAG-контекста. -- `rag_session_id` — опционально; можно не указывать, если задан через env. - -## Env для тестов - -Сначала загружается `[.env.test](/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup/suite_02_pipeline/pipeline_intent_rag/.env.test)`, затем workspace `.env`. - -Ключи: - -- `DATABASE_URL` — подключение к тестовой БД. -- `RUN_INTENT_PIPELINE_ROUTER_RAG=1` — включить `router_rag`. -- `RUN_INTENT_PIPELINE_FULL_CHAIN=1` — включить `full_chain`. -- `INTENT_PIPELINE_FORCE_RAG_SESSION_ID` — принудительный `rag_session_id` для всех кейсов. -- `INTENT_PIPELINE_RAG_SESSION_ID` — дефолтный `rag_session_id` для кейсов. -- `INTENT_PIPELINE_REINDEX_REPO_PATH` — путь к репозиторию для новой индексации. -- `INTENT_PIPELINE_REINDEX_PROJECT_ID` — `project_id` для новой сессии (опционально). - -Если указан `INTENT_PIPELINE_REINDEX_REPO_PATH`, раннер создаёт новую `rag_session`, индексирует репозиторий и использует этот `rag_session_id` для retrieval. - -## Артефакты - -Каждый прогон пишет JSONL в `tests/pipeline_setup/test_results`. -Формат имени: - -- `_.jsonl` - -Примеры: - -- `test_intent_router_only_matrix_20260305_183010.jsonl` -- `test_intent_router_rag_pipeline_20260305_183045.jsonl` - -## Запуск - -- `pytest tests/pipeline_setup/suite_02_pipeline/pipeline_intent_rag/test_intent_router_only_matrix.py -q` -- `RUN_INTENT_PIPELINE_ROUTER_RAG=1 pytest -m router_rag tests/pipeline_setup/suite_02_pipeline/pipeline_intent_rag/test_intent_router_rag_pipeline.py -q` -- `RUN_INTENT_PIPELINE_FULL_CHAIN=1 pytest -m full_chain tests/pipeline_setup/suite_02_pipeline/pipeline_intent_rag/test_intent_router_rag_llm_pipeline.py -q` - -## CLI - -Запуск без `pytest`: - -- `python3 -m tests.pipeline_setup.suite_02_pipeline.pipeline_intent_rag run --mode router_only` -- `python3 -m tests.pipeline_setup.suite_02_pipeline.pipeline_intent_rag run --mode router_rag --rag-session-id ` -- `python3 -m tests.pipeline_setup.suite_02_pipeline.pipeline_intent_rag run --mode full_chain --rag-session-id ` - -Переиндексация репозитория в новую `rag_session`: - -- `python3 -m tests.pipeline_setup.suite_02_pipeline.pipeline_intent_rag reindex --repo-path /abs/path/to/repo` -- опционально: `--project-id my-project` - -Команда печатает итог: - -- `rag_session_id=` - -Далее этот `rag_session_id` можно передать в тестовый прогон: - -- `python3 -m tests.pipeline_setup.suite_02_pipeline.pipeline_intent_rag run --mode router_rag --rag-session-id ` - -Полезные опции: - -- `--case-id ` (можно повторять) -- `--reindex-repo-path /abs/path/to/repo` -- `--reindex-project-id ` -- `--test-name ` diff --git a/tests/pipeline_setup/suite_02_pipeline/pipeline_intent_rag/__init__.py b/tests/pipeline_setup/suite_02_pipeline/pipeline_intent_rag/__init__.py deleted file mode 100644 index 16b5dfe..0000000 --- a/tests/pipeline_setup/suite_02_pipeline/pipeline_intent_rag/__init__.py +++ /dev/null @@ -1 +0,0 @@ -# Isolated integration pipeline tests for intent-router -> RAG -> LLM roll-out. diff --git a/tests/pipeline_setup/suite_02_pipeline/pipeline_intent_rag/__main__.py b/tests/pipeline_setup/suite_02_pipeline/pipeline_intent_rag/__main__.py deleted file mode 100644 index 15ed436..0000000 --- a/tests/pipeline_setup/suite_02_pipeline/pipeline_intent_rag/__main__.py +++ /dev/null @@ -1,5 +0,0 @@ -from tests.pipeline_setup.suite_02_pipeline.pipeline_intent_rag.cli import main - - -if __name__ == "__main__": - raise SystemExit(main()) diff --git a/tests/pipeline_setup/suite_02_pipeline/pipeline_intent_rag/cli.py b/tests/pipeline_setup/suite_02_pipeline/pipeline_intent_rag/cli.py deleted file mode 100644 index 8c0dce6..0000000 --- a/tests/pipeline_setup/suite_02_pipeline/pipeline_intent_rag/cli.py +++ /dev/null @@ -1,241 +0,0 @@ -from __future__ import annotations - -import argparse -import os -import sys -from dataclasses import dataclass -from pathlib import Path -from typing import Literal - -from tests.pipeline_setup.suite_02_pipeline.pipeline_intent_rag.helpers.env_bootstrap import PipelineEnvLoader -from tests.pipeline_setup.suite_02_pipeline.pipeline_intent_rag.helpers.models import PhraseCase, PipelineResult -from tests.pipeline_setup.suite_02_pipeline.pipeline_intent_rag.helpers.runtime import PipelineRuntime - -_VALID_MODES = ("router_only", "router_rag", "full_chain") - - -@dataclass(slots=True, frozen=True) -class RunCliArgs: - mode: str - case_ids: tuple[str, ...] - rag_session_id: str | None - reindex_repo_path: str | None - reindex_project_id: str | None - test_name: str - verbose: bool - - -@dataclass(slots=True, frozen=True) -class ReindexCliArgs: - repo_path: str - project_id: str | None - - -@dataclass(slots=True, frozen=True) -class ParsedCliArgs: - command: Literal["run", "reindex"] - payload: RunCliArgs | ReindexCliArgs - - -class PipelineCliRunner: - def __init__(self, args: RunCliArgs, test_root: Path) -> None: - self._args = args - self._test_root = test_root - - def run(self) -> int: - self._apply_overrides() - runtime = PipelineRuntime(mode=self._args.mode, test_name=self._args.test_name, test_root=self._test_root) - cases = self._filter_cases(runtime.load_cases()) - if not cases: - print("No cases selected") - return 2 - - failed = 0 - executed = 0 - for case in cases: - executed += 1 - try: - result = self._run_case(runtime, case) - except Exception as exc: - failed += 1 - print(f"[FAIL] {case.case_id}: {exc}") - continue - try: - self._validate_case(result) - self._print_result(result, status="OK", reason=None, force_diagnostics=self._args.verbose) - except Exception as exc: - failed += 1 - self._print_result(result, status="FAIL", reason=str(exc), force_diagnostics=True) - - print("-") - print(f"Mode: {self._args.mode}") - print(f"Executed: {executed}") - print(f"Failed: {failed}") - print(f"Artifact: {runtime.artifact_path}") - return 0 if failed == 0 else 1 - - def _apply_overrides(self) -> None: - if self._args.rag_session_id: - os.environ["INTENT_PIPELINE_FORCE_RAG_SESSION_ID"] = self._args.rag_session_id - if self._args.reindex_repo_path: - os.environ["INTENT_PIPELINE_REINDEX_REPO_PATH"] = self._args.reindex_repo_path - if self._args.reindex_project_id: - os.environ["INTENT_PIPELINE_REINDEX_PROJECT_ID"] = self._args.reindex_project_id - - def _filter_cases(self, cases: list[PhraseCase]) -> list[PhraseCase]: - if not self._args.case_ids: - return cases - wanted = set(self._args.case_ids) - return [case for case in cases if case.case_id in wanted] - - def _run_case(self, runtime: PipelineRuntime, case: PhraseCase) -> PipelineResult: - if self._args.mode == "router_only": - return runtime.run_router_only(case) - if self._args.mode == "router_rag": - return runtime.run_router_rag(case) - return runtime.run_full_chain(case) - - def _validate_case(self, result: PipelineResult) -> None: - case = result.case - if case.expected_intent and result.intent != case.expected_intent: - raise AssertionError(f"expected_intent={case.expected_intent} actual={result.intent}") - if self._args.mode in {"router_rag", "full_chain"} and case.expect_non_empty_rag and not result.rag_rows: - raise AssertionError(f"RAG returned empty list for rag_session_id={result.rag_session_id}") - if self._args.mode == "full_chain" and not (result.llm_answer or "").strip(): - raise AssertionError("LLM answer must not be empty") - - def _print_result( - self, - result: PipelineResult, - *, - status: str, - reason: str | None, - force_diagnostics: bool, - ) -> None: - record = result.to_record() - if status != "OK": - print(f"status: {status}") - print(f"case_id: {record['case_id']}") - print(f"expected_intent: {record['expected_intent']}") - print(f"actual_intent: {record['actual_intent']}") - print("summary:") - self._print_block(record.get("summary"), indent=2) - if force_diagnostics: - if reason: - print(f"failure_reason: {reason}") - print("diagnostics:") - self._print_block(record.get("diagnostics"), indent=2) - print("-") - - def _print_block(self, value, *, indent: int) -> None: - prefix = " " * indent - if isinstance(value, dict): - for key, item in value.items(): - if isinstance(item, (dict, list)): - print(f"{prefix}{key}:") - self._print_block(item, indent=indent + 2) - else: - print(f"{prefix}{key}: {item}") - return - if isinstance(value, list): - for item in value: - if isinstance(item, dict): - print(f"{prefix}-") - self._print_block(item, indent=indent + 2) - else: - print(f"{prefix}- {item}") - return - print(f"{prefix}{value}") - - -class ReindexCliRunner: - def __init__(self, args: ReindexCliArgs, test_root: Path) -> None: - self._args = args - self._test_root = test_root - - def run(self) -> int: - try: - PipelineEnvLoader(self._test_root).load() - repo_path = Path(self._args.repo_path).expanduser().resolve() - if not repo_path.is_dir(): - print(f"[FAIL] repository path is not a directory: {repo_path}") - return 2 - from app.modules.rag.persistence.repository import RagRepository - from tests.pipeline_setup.utils.rag_indexer import RagSessionIndexer - - RagSessionIndexer(RagRepository()).index_repo(repo_path, project_id=self._args.project_id) - return 0 - except Exception as exc: - print(f"[FAIL] reindex error: {exc}") - return 1 - - -def _build_parser() -> argparse.ArgumentParser: - parser = argparse.ArgumentParser(description="Run intent-router pipeline CLI") - sub = parser.add_subparsers(dest="command") - - run_cmd = sub.add_parser("run", help="Run test pipeline") - run_cmd.add_argument("--mode", choices=_VALID_MODES, required=True, help="Execution mode") - run_cmd.add_argument("--case-id", action="append", default=[], help="Case id to run (repeatable)") - run_cmd.add_argument("--rag-session-id", default=None, help="Force rag_session_id for all cases") - run_cmd.add_argument("--reindex-repo-path", default=None, help="Path to local repository for reindex before retrieval") - run_cmd.add_argument("--reindex-project-id", default=None, help="project_id for newly indexed rag_session") - run_cmd.add_argument("--test-name", default=None, help="Artifact prefix (defaults to cli_)") - run_cmd.add_argument( - "--verbose", - "--debug", - dest="verbose", - action="store_true", - help="Print diagnostics for every case", - ) - - reindex_cmd = sub.add_parser("reindex", help="Create a new RAG session by indexing local repository") - reindex_cmd.add_argument("--repo-path", required=True, help="Path to local repository directory") - reindex_cmd.add_argument("--project-id", default=None, help="Project id for created rag_session") - - return parser - - -def _parse_args(argv: list[str] | None = None) -> ParsedCliArgs: - parser = _build_parser() - raw = list(sys.argv[1:] if argv is None else argv) - if raw and raw[0] not in {"run", "reindex"} and raw[0] not in {"-h", "--help"}: - raw = ["run", *raw] - ns = parser.parse_args(raw) - command = str(getattr(ns, "command", "") or "") - if command == "run": - mode = str(ns.mode) - test_name = (ns.test_name or f"cli_{mode}").strip() or f"cli_{mode}" - payload = RunCliArgs( - mode=mode, - case_ids=tuple(str(item).strip() for item in ns.case_id if str(item).strip()), - rag_session_id=str(ns.rag_session_id).strip() or None if ns.rag_session_id is not None else None, - reindex_repo_path=str(ns.reindex_repo_path).strip() or None if ns.reindex_repo_path is not None else None, - reindex_project_id=str(ns.reindex_project_id).strip() or None if ns.reindex_project_id is not None else None, - test_name=test_name, - verbose=bool(getattr(ns, "verbose", False)), - ) - return ParsedCliArgs(command="run", payload=payload) - if command == "reindex": - payload = ReindexCliArgs( - repo_path=str(ns.repo_path).strip(), - project_id=str(ns.project_id).strip() or None if ns.project_id is not None else None, - ) - return ParsedCliArgs(command="reindex", payload=payload) - parser.error("command is required: run or reindex") - - -def main(argv: list[str] | None = None) -> int: - try: - args = _parse_args(argv) - test_root = Path(__file__).resolve().parent - if args.command == "run": - return PipelineCliRunner(args=args.payload, test_root=test_root).run() - return ReindexCliRunner(args=args.payload, test_root=test_root).run() - except KeyboardInterrupt: - print("Interrupted") - return 130 - - -if __name__ == "__main__": - raise SystemExit(main(sys.argv[1:])) diff --git a/tests/pipeline_setup/suite_02_pipeline/pipeline_intent_rag/fixtures/phrases.yaml b/tests/pipeline_setup/suite_02_pipeline/pipeline_intent_rag/fixtures/phrases.yaml deleted file mode 100644 index b358c59..0000000 --- a/tests/pipeline_setup/suite_02_pipeline/pipeline_intent_rag/fixtures/phrases.yaml +++ /dev/null @@ -1,70 +0,0 @@ -phrases: - - id: code-open-context-file - text: "Открой файл src/mail_order_bot/context.py" - rag_session_id: "849fc2c9-e17c-4034-b3b5-2e13d535bb94" - expected_intent: "CODE_QA" - expect_non_empty_rag: true - tags: ["router_only", "router_rag", "full_chain"] - - - id: code-explain-context-class - text: "Объясни как работает класс Context" - rag_session_id: "849fc2c9-e17c-4034-b3b5-2e13d535bb94" - expected_intent: "CODE_QA" - expect_non_empty_rag: true - tags: ["router_only", "router_rag", "full_chain"] - - - id: code-explain-excel-parser - text: "Объясни класс ExcelFileParcer" - rag_session_id: "849fc2c9-e17c-4034-b3b5-2e13d535bb94" - expected_intent: "CODE_QA" - expect_non_empty_rag: true - tags: ["router_only", "router_rag", "full_chain"] - - - id: code-find-tests-for-context - text: "Где тесты для Context?" - rag_session_id: "849fc2c9-e17c-4034-b3b5-2e13d535bb94" - expected_intent: "CODE_QA" - expect_non_empty_rag: true - tags: ["router_only", "router_rag", "full_chain"] - - - id: code-exclude-tests-context - text: "Не про тесты, а про прод код Context" - rag_session_id: "849fc2c9-e17c-4034-b3b5-2e13d535bb94" - expected_intent: "CODE_QA" - expect_non_empty_rag: true - tags: ["router_only", "router_rag", "full_chain"] - - - id: code-open-abstract-task - text: "Покажи файл src/mail_order_bot/task_processor/abstract_task.py" - rag_session_id: "849fc2c9-e17c-4034-b3b5-2e13d535bb94" - expected_intent: "CODE_QA" - expect_non_empty_rag: true - tags: ["router_only", "router_rag"] - - - id: code-explain-handle-errors - text: "Теперь объясни функцию handle_errors" - rag_session_id: "849fc2c9-e17c-4034-b3b5-2e13d535bb94" - expected_intent: "CODE_QA" - expect_non_empty_rag: true - tags: ["router_only", "router_rag", "full_chain"] - - - id: docs-about-readme-deploy - text: "Что сказано в README_DEPLOY.md?" - rag_session_id: "849fc2c9-e17c-4034-b3b5-2e13d535bb94" - expected_intent: "DOCS_QA" - expect_non_empty_rag: true - tags: ["router_only", "router_rag", "full_chain"] - - - id: docs-generic-question - text: "Что сказано в документации по деплою?" - rag_session_id: "849fc2c9-e17c-4034-b3b5-2e13d535bb94" - expected_intent: "DOCS_QA" - expect_non_empty_rag: true - tags: ["router_only", "router_rag", "full_chain"] - - - id: docs-open-readme-ref - text: "Что про это в docs и README?" - rag_session_id: "849fc2c9-e17c-4034-b3b5-2e13d535bb94" - expected_intent: "DOCS_QA" - expect_non_empty_rag: true - tags: ["router_only", "router_rag"] diff --git a/tests/pipeline_setup/suite_02_pipeline/pipeline_intent_rag/helpers/__init__.py b/tests/pipeline_setup/suite_02_pipeline/pipeline_intent_rag/helpers/__init__.py deleted file mode 100644 index c9c2ef6..0000000 --- a/tests/pipeline_setup/suite_02_pipeline/pipeline_intent_rag/helpers/__init__.py +++ /dev/null @@ -1 +0,0 @@ -__all__: list[str] = [] diff --git a/tests/pipeline_setup/suite_02_pipeline/pipeline_intent_rag/helpers/answer_policy.py b/tests/pipeline_setup/suite_02_pipeline/pipeline_intent_rag/helpers/answer_policy.py deleted file mode 100644 index ddf8fd3..0000000 --- a/tests/pipeline_setup/suite_02_pipeline/pipeline_intent_rag/helpers/answer_policy.py +++ /dev/null @@ -1,121 +0,0 @@ -from __future__ import annotations - -from dataclasses import dataclass - -from tests.pipeline_setup.suite_02_pipeline.pipeline_intent_rag.helpers.models import PipelineResult - - -@dataclass(slots=True, frozen=True) -class AnswerPolicyDecision: - answer: str - answer_mode: str - failure_reason: str = "" - - -class FullChainAnswerPolicy: - def decide(self, result: PipelineResult) -> AnswerPolicyDecision | None: - sub_intent = _sub_intent(result) - if sub_intent == "OPEN_FILE": - return self._missing_file(result) - if sub_intent == "EXPLAIN": - return self._missing_symbol(result) - if sub_intent == "FIND_ENTRYPOINTS": - return self._confirmed_entrypoints(result) - return None - - def _missing_file(self, result: PipelineResult) -> AnswerPolicyDecision | None: - requested_path = _requested_path(result) - if not requested_path or _has_exact_file_match(result, requested_path): - return None - return AnswerPolicyDecision( - answer=f"Файл {requested_path} не найден.", - answer_mode="degraded", - failure_reason="file_not_found", - ) - - def _missing_symbol(self, result: PipelineResult) -> AnswerPolicyDecision | None: - symbol_resolution = dict(result.symbol_resolution or {}) - if str(symbol_resolution.get("status") or "").strip() != "not_found": - return None - symbol = _requested_symbol(result) - if not symbol: - return None - answer = f"Сущность {symbol} не найдена в доступном коде." - alternatives = [str(item).strip() for item in symbol_resolution.get("alternatives") or [] if str(item).strip()] - if alternatives: - answer = f"{answer} Близкие совпадения: {', '.join(alternatives[:3])}." - return AnswerPolicyDecision( - answer=answer, - answer_mode="degraded", - failure_reason="symbol_not_found", - ) - - def _confirmed_entrypoints(self, result: PipelineResult) -> AnswerPolicyDecision | None: - routes = _confirmed_routes(result) - if not routes: - return None - lines = [_render_route(route) for route in routes] - answer = "\n".join(f"- {line}" for line in lines) - if len(lines) == 1: - answer = lines[0] - return AnswerPolicyDecision(answer=answer, answer_mode="answered") - - -def _sub_intent(result: PipelineResult) -> str: - router_plan = dict(result.diagnostics.get("router_plan") or {}) - return str(router_plan.get("sub_intent") or "").strip().upper() - - -def _requested_path(result: PipelineResult) -> str: - router_plan = dict(result.diagnostics.get("router_plan") or {}) - path_scope = tuple(str(item).strip() for item in router_plan.get("path_scope") or [] if str(item).strip()) - return path_scope[0] if path_scope else "" - - -def _has_exact_file_match(result: PipelineResult, requested_path: str) -> bool: - requested = requested_path.strip().lower() - for row in result.rag_rows: - row_path = str(row.get("path") or "").strip().lower() - if row_path == requested: - return True - return False - - -def _requested_symbol(result: PipelineResult) -> str: - router_plan = dict(result.diagnostics.get("router_plan") or {}) - symbols = tuple(str(item).strip() for item in router_plan.get("symbol_candidates") or [] if str(item).strip()) - return symbols[0] if symbols else "" - - -def _confirmed_routes(result: PipelineResult) -> list[dict]: - seen: set[tuple[str, str]] = set() - items: list[dict] = [] - for row in result.rag_rows: - if str(row.get("layer") or "") != "C3_ENTRYPOINTS": - continue - metadata = dict(row.get("metadata") or {}) - method = str(metadata.get("http_method") or "").strip() - route_path = str(metadata.get("route_path") or "").strip() - if not method or not route_path: - continue - key = (method, route_path) - if key in seen: - continue - seen.add(key) - items.append(metadata) - return items - - -def _render_route(metadata: dict) -> str: - method = str(metadata.get("http_method") or "").strip() - route_path = str(metadata.get("route_path") or "").strip() - declaring = str(metadata.get("declaring_symbol") or "").strip() - handler = str(metadata.get("handler_symbol") or "").strip() - label = f"{method} {route_path}" - parts = [label] - if declaring: - parts.append(f"объявлен в {declaring}") - if handler: - handler_name = handler.rsplit(".", 1)[-1] - parts.append(f"обрабатывается {handler_name}") - return " — ".join((parts[0], ", ".join(parts[1:]))) if len(parts) > 1 else parts[0] diff --git a/tests/pipeline_setup/suite_02_pipeline/pipeline_intent_rag/helpers/answer_quality.py b/tests/pipeline_setup/suite_02_pipeline/pipeline_intent_rag/helpers/answer_quality.py deleted file mode 100644 index 587d7a2..0000000 --- a/tests/pipeline_setup/suite_02_pipeline/pipeline_intent_rag/helpers/answer_quality.py +++ /dev/null @@ -1,71 +0,0 @@ -from __future__ import annotations - -import re - - -class AnswerQualityController: - _REPLACEMENTS = ( - ("различные аргументы", "аргументы"), - ("ряд аргументов", "аргументы"), - ("различных подпакетов", "подпакетов"), - ("основные службы", "службы"), - ("играет роль", "работает как"), - ("представляет собой", "это"), - ) - _DROP_PATTERNS = ( - r"(?i)ответ основан исключительно[^.]*\.", - r"(?i)нет явных неподтвержденных кандидатов\.?", - r"(?i)кандидаты[^.\n]*нет[^.\n]*\.?", - r"(?i)related tests[^.\n]*none[^.\n]*\.?", - r"(?i)indirect evidence[^.\n]*none[^.\n]*\.?", - ) - _NOT_FOUND_PATTERNS = ( - "не найден", - "не найдена", - "не найдены", - "не обнаружен", - "не обнаружена", - "не обнаружены", - ) - - def refine(self, text: str, *, sub_intent: str | None = None) -> str: - value = self._normalize_markdown(text) - value = self._drop_empty_sections(value) - value = self._replace_vague_phrases(value) - if self._should_trim_not_found(value, sub_intent=sub_intent): - value = self._trim_after_not_found(value) - return self._normalize_spacing(value) - - def _normalize_markdown(self, text: str) -> str: - value = str(text or "").strip() - value = re.sub(r"(?m)^\s{0,3}#{1,6}\s*", "", value) - return value.replace("**", "") - - def _drop_empty_sections(self, text: str) -> str: - value = text - for pattern in self._DROP_PATTERNS: - value = re.sub(pattern, "", value) - return value - - def _replace_vague_phrases(self, text: str) -> str: - value = text - for source, target in self._REPLACEMENTS: - value = re.sub(re.escape(source), target, value, flags=re.IGNORECASE) - return value - - def _should_trim_not_found(self, text: str, *, sub_intent: str | None) -> bool: - current = str(sub_intent or "").strip().upper() - if current not in {"EXPLAIN", "OPEN_FILE", "FIND_TESTS", "FIND_ENTRYPOINTS"}: - return False - lowered = text.lower() - return any(pattern in lowered for pattern in self._NOT_FOUND_PATTERNS) - - def _trim_after_not_found(self, text: str) -> str: - match = re.search(r"(?<=[.!?])\s+", text.strip()) - if not match: - return text.strip() - return text[: match.start()].strip() - - def _normalize_spacing(self, text: str) -> str: - value = re.sub(r"\n{3,}", "\n\n", text) - return re.sub(r"[ \t]{2,}", " ", value).strip() diff --git a/tests/pipeline_setup/suite_02_pipeline/pipeline_intent_rag/helpers/artifact_writer.py b/tests/pipeline_setup/suite_02_pipeline/pipeline_intent_rag/helpers/artifact_writer.py deleted file mode 100644 index 208a525..0000000 --- a/tests/pipeline_setup/suite_02_pipeline/pipeline_intent_rag/helpers/artifact_writer.py +++ /dev/null @@ -1,23 +0,0 @@ -from __future__ import annotations - -import json -from datetime import datetime -from pathlib import Path - - -class ArtifactWriter: - def __init__(self, artifacts_dir: Path, test_name: str, run_started_at: datetime) -> None: - self._artifacts_dir = artifacts_dir - self._test_name = test_name - self._run_started_at = run_started_at - - @property - def path(self) -> Path: - stamp = self._run_started_at.strftime("%Y%m%d_%H%M%S") - name = f"{self._test_name}_{stamp}.jsonl" - return self._artifacts_dir / name - - def write_record(self, payload: dict) -> None: - self.path.parent.mkdir(parents=True, exist_ok=True) - with self.path.open("a", encoding="utf-8") as handle: - handle.write(json.dumps(payload, ensure_ascii=False) + "\n") diff --git a/tests/pipeline_setup/suite_02_pipeline/pipeline_intent_rag/helpers/diagnostics.py b/tests/pipeline_setup/suite_02_pipeline/pipeline_intent_rag/helpers/diagnostics.py deleted file mode 100644 index 5872aed..0000000 --- a/tests/pipeline_setup/suite_02_pipeline/pipeline_intent_rag/helpers/diagnostics.py +++ /dev/null @@ -1,247 +0,0 @@ -from __future__ import annotations - -import math -from copy import deepcopy -from typing import Any - -from app.modules.rag.retrieval.test_filter import is_test_path - - -def build_router_plan(route_result) -> dict[str, Any]: - query_plan = route_result.query_plan - retrieval_spec = route_result.retrieval_spec - constraints = route_result.retrieval_constraints - layers = [str(item.layer_id) for item in list(retrieval_spec.layer_queries or [])] - path_scope = list(getattr(retrieval_spec.filters, "path_scope", []) or []) - return { - "intent": route_result.intent, - "sub_intent": query_plan.sub_intent, - "graph_id": route_result.graph_id, - "retrieval_profile": route_result.retrieval_profile, - "conversation_mode": route_result.conversation_mode, - "layers": layers, - "symbol_kind_hint": query_plan.symbol_kind_hint, - "symbol_candidates": list(query_plan.symbol_candidates or []), - "keyword_hints": list(query_plan.keyword_hints or []), - "path_hints": list(query_plan.path_hints or []), - "path_scope": path_scope, - "doc_scope_hints": list(query_plan.doc_scope_hints or []), - "retrieval_constraints": { - "include_globs": list(constraints.include_globs or []), - "exclude_globs": list(constraints.exclude_globs or []), - "prefer_globs": list(constraints.prefer_globs or []), - "test_file_globs": list(constraints.test_file_globs or []), - "test_symbol_patterns": list(constraints.test_symbol_patterns or []), - "max_candidates": int(constraints.max_candidates), - "fuzzy_symbol_search": { - "enabled": bool(constraints.fuzzy_symbol_search.enabled), - "max_distance": int(constraints.fuzzy_symbol_search.max_distance), - "top_k": int(constraints.fuzzy_symbol_search.top_k), - }, - }, - } - - -def init_diagnostics(route_result, *, router_ms: int, include_retrieval: bool) -> dict[str, Any]: - diagnostics = { - "router_plan": build_router_plan(route_result), - "execution": { - "executed_layers": [], - "retrieval_mode_by_layer": {}, - "top_k_by_layer": {}, - "filters_by_layer": {}, - "repo_scope": {"repo_id": None, "workspace_id": None}, - }, - "retrieval": None, - "constraint_violations": [], - "timings_ms": { - "router": int(router_ms), - "symbol_resolution": 0, - "retrieval_total": 0, - "retrieval_by_layer": {}, - "merge_rank": 0, - "prompt_build": 0, - "llm_call": 0, - }, - "prompt": None, - } - if include_retrieval: - diagnostics["retrieval"] = { - "requests": [], - "applied": [], - "fallback": {"used": False, "reason": None}, - } - return diagnostics - - -def clone_diagnostics(diagnostics: dict[str, Any]) -> dict[str, Any]: - return deepcopy(diagnostics) - - -def apply_retrieval_report(diagnostics: dict[str, Any], report: dict[str, Any] | None) -> None: - if not report: - return - execution = diagnostics.get("execution", {}) - execution["executed_layers"] = list(report.get("executed_layers", []) or []) - execution["retrieval_mode_by_layer"] = dict(report.get("retrieval_mode_by_layer", {}) or {}) - execution["top_k_by_layer"] = dict(report.get("top_k_by_layer", {}) or {}) - execution["filters_by_layer"] = dict(report.get("filters_by_layer", {}) or {}) - retrieval = diagnostics.get("retrieval") - if isinstance(retrieval, dict): - retrieval["requests"] = list(report.get("requests", []) or []) - retrieval["applied"] = list(report.get("applied", []) or []) - retrieval["fallback"] = dict(report.get("fallback", {"used": False, "reason": None}) or {}) - timings = diagnostics.get("timings_ms", {}) - timings["retrieval_by_layer"] = dict(report.get("retrieval_by_layer_ms", {}) or {}) - - -def assign_repo_scope( - diagnostics: dict[str, Any], - rag_rows: list[dict[str, Any]], - *, - expected_repo_id: str | None = None, - expected_workspace_id: str | None = None, -) -> None: - repo_ids = sorted({str(_row_repo_id(row)).strip() for row in rag_rows if str(_row_repo_id(row)).strip()}) - workspace_ids = sorted({str(_row_workspace_id(row)).strip() for row in rag_rows if str(_row_workspace_id(row)).strip()}) - repo_id = expected_repo_id or (repo_ids[0] if len(repo_ids) == 1 else None) - workspace_id = expected_workspace_id or (workspace_ids[0] if len(workspace_ids) == 1 else None) - diagnostics["execution"]["repo_scope"] = { - "repo_id": repo_id, - "workspace_id": workspace_id, - "returned_repo_ids": repo_ids, - "returned_workspace_ids": workspace_ids, - } - - -def validate_constraints( - route_result, - rag_rows: list[dict[str, Any]], - symbol_resolution: dict[str, Any], - *, - expected_repo_id: str | None = None, -) -> list[dict[str, Any]]: - violations: list[dict[str, Any]] = [] - query_plan = route_result.query_plan - retrieval_spec = route_result.retrieval_spec - path_scope = list(getattr(retrieval_spec.filters, "path_scope", []) or []) - row_paths = {str(row.get("path") or "") for row in rag_rows} - if query_plan.sub_intent == "OPEN_FILE" and path_scope: - if not any(path in row_paths for path in path_scope): - violations.append( - _violation( - "PATH_SCOPE_NOT_SATISFIED", - "error", - {"path_scope": path_scope, "returned_paths": sorted(row_paths)}, - "Use exact path_scope retrieval and disable broad fallback for OPEN_FILE.", - ) - ) - requested_layers = [str(item.layer_id) for item in list(retrieval_spec.layer_queries or [])] - row_layers = {str(row.get("layer") or "") for row in rag_rows} - for layer in requested_layers: - if layer not in row_layers: - violations.append( - _violation( - "LAYER_MISSING", - "warn", - {"layer": layer, "requested_layers": requested_layers}, - "Increase top_k for this layer or relax constraints for retrieval.", - ) - ) - exclude_globs = list(route_result.retrieval_constraints.exclude_globs or []) - if _tests_excluded(exclude_globs): - test_paths = sorted({path for path in row_paths if is_test_path(path)}) - if test_paths: - violations.append( - _violation( - "TESTS_EXCLUSION_VIOLATED", - "warn", - {"exclude_globs": exclude_globs, "test_paths": test_paths}, - "Tighten test exclude globs and apply them at pre-rank filtering stage.", - ) - ) - if expected_repo_id: - mismatched = sorted( - { - repo_id - for repo_id in {str(_row_repo_id(row)).strip() for row in rag_rows if str(_row_repo_id(row)).strip()} - if repo_id != expected_repo_id - } - ) - if mismatched: - violations.append( - _violation( - "REPO_SCOPE_MISMATCH", - "error", - {"expected_repo_id": expected_repo_id, "returned_repo_ids": mismatched}, - "Use rag_session_id/repo scope that matches the expected repository.", - ) - ) - symbol_candidates = list(query_plan.symbol_candidates or []) - status = str(symbol_resolution.get("status") or "not_requested") - if query_plan.sub_intent == "EXPLAIN" and symbol_candidates and status != "resolved": - violations.append( - _violation( - "SYMBOL_RESOLUTION_FAILED", - "warn", - {"status": status, "symbol_candidates": symbol_candidates}, - "Increase symbol layer budget or improve fuzzy symbol resolution settings.", - ) - ) - return violations - - -def build_prompt_diagnostics( - *, - system_prompt: str, - user_prompt: str, - rag_rows: list[dict[str, Any]], - prompt_template_id: str | None = None, - system_prompt_version: str | None = None, -) -> dict[str, Any]: - evidence_chars = sum(len(str(row.get("content") or "")) for row in rag_rows) - tokens_in_estimate = max(1, int(math.ceil((len(system_prompt) + len(user_prompt)) / 4))) - per_layer: dict[str, dict[str, Any]] = {} - for row in rag_rows: - layer = str(row.get("layer") or "") - bucket = per_layer.setdefault(layer, {"layer": layer, "count": 0, "paths": set()}) - bucket["count"] += 1 - bucket["paths"].add(str(row.get("path") or "")) - evidence_summary = [ - {"layer": item["layer"], "count": item["count"], "unique_paths": len(item["paths"])} - for item in per_layer.values() - ] - return { - "prompt_stats": { - "tokens_in_estimate": tokens_in_estimate, - "evidence_rows": len(rag_rows), - "evidence_chars": evidence_chars, - }, - "evidence_summary": evidence_summary, - "prompt_template_id": prompt_template_id, - "system_prompt_version": system_prompt_version, - } - - -def _tests_excluded(exclude_globs: list[str]) -> bool: - tokens = ("tests", "test", "__tests__", "mocks", "fixtures", "stubs", "conftest") - return any(any(token in str(item).lower() for token in tokens) for item in exclude_globs) - - -def _violation(violation_type: str, severity: str, details: dict[str, Any], suggested_fix: str) -> dict[str, Any]: - return { - "type": violation_type, - "severity": severity, - "details": details, - "suggested_fix": suggested_fix, - } - - -def _row_repo_id(row: dict[str, Any]) -> str | None: - metadata = dict(row.get("metadata") or {}) - return metadata.get("repo_id") - - -def _row_workspace_id(row: dict[str, Any]) -> str | None: - metadata = dict(row.get("metadata") or {}) - return metadata.get("workspace_id") diff --git a/tests/pipeline_setup/suite_02_pipeline/pipeline_intent_rag/helpers/env_bootstrap.py b/tests/pipeline_setup/suite_02_pipeline/pipeline_intent_rag/helpers/env_bootstrap.py deleted file mode 100644 index ef8aa8f..0000000 --- a/tests/pipeline_setup/suite_02_pipeline/pipeline_intent_rag/helpers/env_bootstrap.py +++ /dev/null @@ -1,36 +0,0 @@ -from __future__ import annotations - -import os -from pathlib import Path - -from tests.pipeline_setup.env_loader import load_pipeline_setup_env - - -class PipelineEnvLoader: - def __init__(self, test_root: Path) -> None: - self._test_root = test_root - - def load(self) -> list[Path]: - loaded: list[Path] = [] - test_env_path = self._test_root / ".env.test" - if test_env_path.is_file(): - self._apply_file(test_env_path) - loaded.append(test_env_path) - loaded.extend(load_pipeline_setup_env(start_dir=self._test_root)) - return loaded - - def _apply_file(self, path: Path) -> None: - for raw_line in path.read_text(encoding="utf-8").splitlines(): - line = raw_line.strip() - if not line or line.startswith("#") or "=" not in line: - continue - key, raw_value = line.split("=", 1) - name = key.removeprefix("export ").strip() - if not name: - continue - os.environ[name] = self._normalize_value(raw_value.strip()) - - def _normalize_value(self, value: str) -> str: - if len(value) >= 2 and value[0] == value[-1] and value[0] in {"'", '"'}: - return value[1:-1] - return value diff --git a/tests/pipeline_setup/suite_02_pipeline/pipeline_intent_rag/helpers/llm_answerer.py b/tests/pipeline_setup/suite_02_pipeline/pipeline_intent_rag/helpers/llm_answerer.py deleted file mode 100644 index beba760..0000000 --- a/tests/pipeline_setup/suite_02_pipeline/pipeline_intent_rag/helpers/llm_answerer.py +++ /dev/null @@ -1,64 +0,0 @@ -from __future__ import annotations - -from app.modules.shared.gigachat.client import GigaChatClient -from app.modules.shared.gigachat.settings import GigaChatSettings -from app.modules.shared.gigachat.token_provider import GigaChatTokenProvider -from tests.pipeline_setup.suite_02_pipeline.pipeline_intent_rag.helpers.answer_quality import AnswerQualityController -from tests.pipeline_setup.suite_02_pipeline.pipeline_intent_rag.helpers.prompt_payload_builder import PromptPayloadBuilder - - -class GigaChatAnswerer: - _SYSTEM_PROMPT = "Ты технический ассистент по коду и документации." - _PROMPT_TEMPLATE_ID = "pipeline_intent_rag_v1" - _SYSTEM_PROMPT_VERSION = "v1" - _TASK_PROMPT = "Дай краткий, практичный ответ по контексту. Если данных мало, явно скажи об этом." - - def __init__(self) -> None: - settings = GigaChatSettings.from_env() - if not settings.credentials: - raise ValueError("GIGACHAT_TOKEN is required for full_chain mode") - self._client = GigaChatClient(settings, GigaChatTokenProvider(settings)) - self._payload_builder = PromptPayloadBuilder() - self._quality = AnswerQualityController() - - def answer( - self, - query: str, - rag_rows: list[dict], - *, - prompt_template: dict | None = None, - sub_intent: str | None = None, - ) -> str: - prompt_payload = self.build_prompt_payload( - query, - rag_rows, - prompt_template=prompt_template, - sub_intent=sub_intent, - ) - return self.answer_from_payload(prompt_payload) - - def build_prompt_payload( - self, - query: str, - rag_rows: list[dict], - *, - prompt_template: dict | None = None, - sub_intent: str | None = None, - ) -> dict: - return self._payload_builder.build( - query, - rag_rows, - prompt_template=prompt_template, - sub_intent=sub_intent, - default_system_prompt=self._SYSTEM_PROMPT, - default_task_prompt=self._TASK_PROMPT, - default_template_id=self._PROMPT_TEMPLATE_ID, - system_prompt_version=self._SYSTEM_PROMPT_VERSION, - ) - - def answer_from_payload(self, payload: dict) -> str: - answer = self._client.complete( - system_prompt=str(payload.get("system_prompt") or self._SYSTEM_PROMPT), - user_prompt=str(payload.get("user_prompt") or ""), - ) - return self._quality.refine(answer, sub_intent=str(payload.get("sub_intent") or "").strip() or None) diff --git a/tests/pipeline_setup/suite_02_pipeline/pipeline_intent_rag/helpers/llm_prompt_loader.py b/tests/pipeline_setup/suite_02_pipeline/pipeline_intent_rag/helpers/llm_prompt_loader.py deleted file mode 100644 index 75e25f3..0000000 --- a/tests/pipeline_setup/suite_02_pipeline/pipeline_intent_rag/helpers/llm_prompt_loader.py +++ /dev/null @@ -1,71 +0,0 @@ -from __future__ import annotations - -from pathlib import Path - -import yaml - - -class LlmPromptCatalogLoader: - def load(self, path: Path) -> dict: - payload = yaml.safe_load(path.read_text(encoding="utf-8")) - if not isinstance(payload, dict): - raise ValueError(f"Invalid prompt catalog: expected mapping, got {type(payload).__name__}") - default = self._normalize_item("default", payload.get("default")) - intents_raw = payload.get("intents", {}) - if not isinstance(intents_raw, dict): - raise ValueError("Invalid prompt catalog: `intents` must be a mapping") - intents: dict[str, dict] = {} - for intent, item in intents_raw.items(): - intent_key = str(intent).strip() - if not intent_key: - continue - intents[intent_key] = self._normalize_intent(intent_key, item) - return {"default": default, "intents": intents} - - def select_for_intent(self, catalog: dict, intent: str) -> dict: - return self.select(catalog, intent=intent) - - def select(self, catalog: dict, *, intent: str, sub_intent: str | None = None) -> dict: - intents = dict(catalog.get("intents") or {}) - intent_entry = dict(intents.get(intent) or {}) - sub_intents = dict(intent_entry.get("sub_intents") or {}) - if sub_intent and sub_intent in sub_intents: - return dict(sub_intents[sub_intent]) - if intent_entry: - prompt = dict(intent_entry.get("prompt") or {}) - if prompt: - return prompt - return dict(catalog.get("default") or {}) - - def _normalize_intent(self, key: str, raw: object) -> dict: - if not isinstance(raw, dict): - raise ValueError(f"Invalid prompt catalog item `{key}`: expected object") - prompt = self._normalize_item(key, raw) - sub_intents_raw = raw.get("sub_intents", {}) - if sub_intents_raw is None: - sub_intents_raw = {} - if not isinstance(sub_intents_raw, dict): - raise ValueError(f"Invalid prompt catalog item `{key}`: `sub_intents` must be a mapping") - sub_intents: dict[str, dict] = {} - for sub_intent, item in sub_intents_raw.items(): - sub_key = str(sub_intent).strip() - if not sub_key: - continue - sub_intents[sub_key] = self._normalize_item(f"{key}.{sub_key}", item) - return {"prompt": prompt, "sub_intents": sub_intents} - - def _normalize_item(self, key: str, raw: object) -> dict: - if not isinstance(raw, dict): - raise ValueError(f"Invalid prompt catalog item `{key}`: expected object") - system_prompt = str(raw.get("system_prompt", "")).strip() - task_prompt = str(raw.get("task_prompt", "")).strip() - template_id = str(raw.get("template_id", "")).strip() or f"intent_{key.lower()}_v1" - if not system_prompt: - raise ValueError(f"Invalid prompt catalog item `{key}`: `system_prompt` is required") - if not task_prompt: - raise ValueError(f"Invalid prompt catalog item `{key}`: `task_prompt` is required") - return { - "template_id": template_id, - "system_prompt": system_prompt, - "task_prompt": task_prompt, - } diff --git a/tests/pipeline_setup/suite_02_pipeline/pipeline_intent_rag/helpers/models.py b/tests/pipeline_setup/suite_02_pipeline/pipeline_intent_rag/helpers/models.py deleted file mode 100644 index f42cedc..0000000 --- a/tests/pipeline_setup/suite_02_pipeline/pipeline_intent_rag/helpers/models.py +++ /dev/null @@ -1,126 +0,0 @@ -from __future__ import annotations - -from dataclasses import dataclass, field -from datetime import datetime - -from tests.pipeline_setup.suite_02_pipeline.pipeline_intent_rag.helpers.result_views import PipelineDiagnosticsBuilder, PipelineSummaryBuilder - - -@dataclass(slots=True) -class PhraseCase: - case_id: str - text: str - rag_session_id: str | None = None - tags: list[str] = field(default_factory=list) - expected_intent: str | None = None - expect_non_empty_rag: bool = True - - -@dataclass(slots=True) -class PipelineResult: - case: PhraseCase - mode: str - run_started_at: datetime - rag_session_id: str | None - intent: str - graph_id: str - conversation_mode: str - query: str - symbol_resolution: dict - rag_rows: list[dict] = field(default_factory=list) - llm_answer: str | None = None - diagnostics: dict = field(default_factory=dict) - steps: list[dict] = field(default_factory=list) - - def to_record(self) -> dict: - diagnostics = PipelineDiagnosticsBuilder().build(self) - summary = PipelineSummaryBuilder().build(self, diagnostics) - steps = self.steps or self._default_steps(diagnostics) - return { - "case_id": self.case.case_id, - "text": self.case.text, - "mode": self.mode, - "run_started_at": self.run_started_at.isoformat(timespec="seconds"), - "rag_session_id": self.rag_session_id, - "expected_intent": self.case.expected_intent, - "actual_intent": self.intent, - "graph_id": self.graph_id, - "conversation_mode": self.conversation_mode, - "query": self.query, - "symbol_resolution": self.symbol_resolution, - "rag_count": len(self.rag_rows), - "rag_rows": self.rag_rows, - "llm_answer": self.llm_answer, - "summary": summary, - "diagnostics": diagnostics, - "run_info": { - "case_id": self.case.case_id, - "mode": self.mode, - "run_started_at": self.run_started_at.isoformat(timespec="seconds"), - "rag_session_id": self.rag_session_id, - "expected_intent": self.case.expected_intent, - "actual_intent": self.intent, - "graph_id": self.graph_id, - "conversation_mode": self.conversation_mode, - }, - "input_request": { - "text": self.case.text, - "normalized_query": self.query, - }, - "steps": steps, - } - - def _default_steps(self, diagnostics: dict) -> list[dict]: - timings = dict(diagnostics.get("timings_ms") or {}) - retrieval_diag = diagnostics.get("retrieval") - router_step = { - "step": "intent_router", - "input": {"query": self.case.text}, - "output": { - "intent": self.intent, - "graph_id": self.graph_id, - "conversation_mode": self.conversation_mode, - "query": self.query, - }, - "diagnostics": { - "router_plan": diagnostics.get("router_plan"), - "timings_ms": {"router": timings.get("router", 0)}, - }, - } - if self.mode == "router_only": - return [router_step] - retrieval_step = { - "step": "retrieval", - "input": {"query": self.query}, - "output": { - "symbol_resolution": self.symbol_resolution, - "rag_count": len(self.rag_rows), - "rag_rows": self.rag_rows, - }, - "diagnostics": { - "execution": diagnostics.get("execution"), - "retrieval": retrieval_diag, - "constraint_violations": diagnostics.get("constraint_violations"), - "timings_ms": { - "symbol_resolution": timings.get("symbol_resolution", 0), - "retrieval_total": timings.get("retrieval_total", 0), - "retrieval_by_layer": timings.get("retrieval_by_layer", {}), - "merge_rank": timings.get("merge_rank", 0), - }, - }, - } - if self.mode == "router_rag": - return [router_step, retrieval_step] - llm_step = { - "step": "llm_answer", - "input": {"query": self.query, "rag_count": len(self.rag_rows)}, - "output": {"llm_answer": self.llm_answer}, - "diagnostics": { - "prompt": diagnostics.get("prompt"), - "timings_ms": { - "prompt_build": timings.get("prompt_build", 0), - "llm_call": timings.get("llm_call", 0), - }, - }, - } - return [router_step, retrieval_step, llm_step] diff --git a/tests/pipeline_setup/suite_02_pipeline/pipeline_intent_rag/helpers/phrases_loader.py b/tests/pipeline_setup/suite_02_pipeline/pipeline_intent_rag/helpers/phrases_loader.py deleted file mode 100644 index 0580beb..0000000 --- a/tests/pipeline_setup/suite_02_pipeline/pipeline_intent_rag/helpers/phrases_loader.py +++ /dev/null @@ -1,45 +0,0 @@ -from __future__ import annotations - -from pathlib import Path - -import yaml - -from tests.pipeline_setup.suite_02_pipeline.pipeline_intent_rag.helpers.models import PhraseCase - - -class PhraseCatalogLoader: - def load(self, path: Path) -> list[PhraseCase]: - payload = yaml.safe_load(path.read_text(encoding="utf-8")) - if not isinstance(payload, dict): - raise ValueError(f"Invalid phrases file: expected mapping, got {type(payload).__name__}") - items = payload.get("phrases", []) - if not isinstance(items, list): - raise ValueError("Invalid phrases file: `phrases` must be a list") - cases = [self._to_case(raw) for raw in items] - if not cases: - raise ValueError("No phrase cases found in phrases file") - return cases - - def filter_by_tag(self, cases: list[PhraseCase], tag: str) -> list[PhraseCase]: - return [case for case in cases if tag in case.tags] - - def _to_case(self, raw: object) -> PhraseCase: - if not isinstance(raw, dict): - raise ValueError("Invalid phrase item: expected object") - case_id = str(raw.get("id", "")).strip() - text = str(raw.get("text", "")).strip() - if not case_id: - raise ValueError("Invalid phrase item: `id` is required") - if not text: - raise ValueError(f"Invalid phrase item `{case_id}`: `text` is required") - tags = [str(item).strip() for item in raw.get("tags", []) if str(item).strip()] - expected_intent = raw.get("expected_intent") - rag_session_id = str(raw.get("rag_session_id", "")).strip() or None - return PhraseCase( - case_id=case_id, - text=text, - rag_session_id=rag_session_id, - tags=tags, - expected_intent=str(expected_intent).strip() if expected_intent else None, - expect_non_empty_rag=bool(raw.get("expect_non_empty_rag", True)), - ) diff --git a/tests/pipeline_setup/suite_02_pipeline/pipeline_intent_rag/helpers/pipeline_config.py b/tests/pipeline_setup/suite_02_pipeline/pipeline_intent_rag/helpers/pipeline_config.py deleted file mode 100644 index 7dae113..0000000 --- a/tests/pipeline_setup/suite_02_pipeline/pipeline_intent_rag/helpers/pipeline_config.py +++ /dev/null @@ -1,60 +0,0 @@ -from __future__ import annotations - -import os -from dataclasses import dataclass -from pathlib import Path - -from tests.pipeline_setup.suite_02_pipeline.pipeline_intent_rag.helpers.env_bootstrap import PipelineEnvLoader - - -@dataclass(frozen=True, slots=True) -class PipelineRunConfig: - mode: str - test_name: str - tag: str - phrases_path: Path - test_results_dir: Path - forced_rag_session_id: str | None - default_rag_session_id: str | None - reindex_repo_path: Path | None - reindex_project_id: str | None - - @classmethod - def from_env(cls, mode: str, test_name: str, test_root: Path) -> "PipelineRunConfig": - PipelineEnvLoader(test_root).load() - mode_tag = { - "router_only": "router_only", - "router_rag": "router_rag", - "full_chain": "full_chain", - }[mode] - forced_sid = os.getenv("INTENT_PIPELINE_FORCE_RAG_SESSION_ID", "").strip() or None - default_sid = os.getenv("INTENT_PIPELINE_RAG_SESSION_ID", "").strip() or None - raw_reindex_path = os.getenv("INTENT_PIPELINE_REINDEX_REPO_PATH", "").strip() - reindex_repo_path = Path(raw_reindex_path).expanduser().resolve() if raw_reindex_path else None - reindex_project_id = os.getenv("INTENT_PIPELINE_REINDEX_PROJECT_ID", "").strip() or None - return cls( - mode=mode, - test_name=test_name, - tag=mode_tag, - phrases_path=test_root / "fixtures" / "phrases.yaml", - test_results_dir=test_root.parent / "test_results", - forced_rag_session_id=forced_sid, - default_rag_session_id=default_sid, - reindex_repo_path=reindex_repo_path, - reindex_project_id=reindex_project_id, - ) - - -def mode_enabled(mode: str, test_root: Path) -> bool: - PipelineEnvLoader(test_root).load() - if mode == "router_only": - return True - if mode == "router_rag": - return _truthy(os.getenv("RUN_INTENT_PIPELINE_ROUTER_RAG") or os.getenv("RUN_INTENT_ROUTER_RAG_PIPELINE")) - if mode == "full_chain": - return _truthy(os.getenv("RUN_INTENT_PIPELINE_FULL_CHAIN")) - return False - - -def _truthy(value: str | None) -> bool: - return str(value or "").strip().lower() in {"1", "true", "yes", "on"} diff --git a/tests/pipeline_setup/suite_02_pipeline/pipeline_intent_rag/helpers/pipeline_runner.py b/tests/pipeline_setup/suite_02_pipeline/pipeline_intent_rag/helpers/pipeline_runner.py deleted file mode 100644 index efc0f0d..0000000 --- a/tests/pipeline_setup/suite_02_pipeline/pipeline_intent_rag/helpers/pipeline_runner.py +++ /dev/null @@ -1,171 +0,0 @@ -from __future__ import annotations - -from datetime import datetime -from difflib import get_close_matches -from time import perf_counter - -from app.modules.agent.intent_router_v2 import ConversationState, IntentRouterV2 -from tests.pipeline_setup.suite_02_pipeline.pipeline_intent_rag.helpers.diagnostics import ( - apply_retrieval_report, - assign_repo_scope, - init_diagnostics, - validate_constraints, -) -from tests.pipeline_setup.suite_02_pipeline.pipeline_intent_rag.helpers.models import PhraseCase, PipelineResult -from tests.unit_tests.rag.intent_router_testkit import repo_context - - -class RouterOnlyRunner: - def __init__(self, started_at: datetime, router: IntentRouterV2 | None = None) -> None: - self._started_at = started_at - self._router = router or IntentRouterV2() - - def run_case(self, case: PhraseCase) -> PipelineResult: - router_started = perf_counter() - route_result = self._router.route(case.text, ConversationState(), repo_context()) - router_ms = _ms(router_started) - query = route_result.query_plan.normalized or route_result.query_plan.raw or case.text - diagnostics = init_diagnostics(route_result, router_ms=router_ms, include_retrieval=False) - return PipelineResult( - case=case, - mode="router_only", - run_started_at=self._started_at, - rag_session_id=case.rag_session_id, - intent=route_result.intent, - graph_id=route_result.graph_id, - conversation_mode=route_result.conversation_mode, - query=query, - symbol_resolution=route_result.symbol_resolution.model_dump(), - diagnostics=diagnostics, - ) - - -class IntentRouterRagPipelineRunner: - def __init__( - self, - started_at: datetime, - rag_adapter, - session_resolver, - router: IntentRouterV2 | None = None, - ) -> None: - self._started_at = started_at - self._rag_adapter = rag_adapter - self._session_resolver = session_resolver - self._router = router or IntentRouterV2() - - def run_case(self, case: PhraseCase) -> PipelineResult: - router_started = perf_counter() - route_result = self._router.route(case.text, ConversationState(), repo_context()) - router_ms = _ms(router_started) - diagnostics = init_diagnostics(route_result, router_ms=router_ms, include_retrieval=True) - rag_query = route_result.query_plan.normalized or route_result.query_plan.raw or case.text - rag_session_id = self._session_resolver.resolve(case) - retrieval_started = perf_counter() - rag_rows = self._retrieve_rows( - rag_session_id=rag_session_id, - rag_query=rag_query, - route_result=route_result, - ) - diagnostics["timings_ms"]["retrieval_total"] = _ms(retrieval_started) - consume_report = getattr(self._rag_adapter, "consume_retrieval_report", None) - retrieval_report = consume_report() if callable(consume_report) else None - apply_retrieval_report(diagnostics, retrieval_report) - symbol_started = perf_counter() - symbol_resolution = self._resolve_symbol(route_result.symbol_resolution.model_dump(), rag_rows) - diagnostics["timings_ms"]["symbol_resolution"] = _ms(symbol_started) - if ( - route_result.query_plan.sub_intent == "EXPLAIN" - and list(route_result.query_plan.symbol_candidates or []) - and str(symbol_resolution.get("status") or "") != "resolved" - ): - rag_rows = [] - if isinstance(diagnostics.get("retrieval"), dict): - diagnostics["retrieval"]["fallback"] = {"used": False, "reason": None} - merge_started = perf_counter() - rag_rows = self._rag_adapter.hydrate_resolved_symbol_sources( - rag_session_id=rag_session_id, - base_query=rag_query, - rag_rows=rag_rows, - symbol_resolution=symbol_resolution, - retrieval_spec=route_result.retrieval_spec, - retrieval_constraints=route_result.retrieval_constraints, - ) - rag_rows = self._rag_adapter.force_symbol_context_c0( - rag_session_id=rag_session_id, - rag_rows=rag_rows, - symbol_resolution=symbol_resolution, - limit=20, - ) - diagnostics["timings_ms"]["merge_rank"] = _ms(merge_started) - expected_repo_id = str(getattr(route_result.retrieval_spec.filters, "repo_id", "") or "").strip() or None - assign_repo_scope(diagnostics, rag_rows, expected_repo_id=expected_repo_id) - diagnostics["constraint_violations"] = validate_constraints( - route_result, - rag_rows, - symbol_resolution, - expected_repo_id=expected_repo_id, - ) - return PipelineResult( - case=case, - mode="router_rag", - run_started_at=self._started_at, - rag_session_id=rag_session_id, - intent=route_result.intent, - graph_id=route_result.graph_id, - conversation_mode=route_result.conversation_mode, - query=rag_query, - rag_rows=rag_rows, - symbol_resolution=symbol_resolution, - diagnostics=diagnostics, - ) - - def _resolve_symbol(self, initial: dict, rag_rows: list[dict]) -> dict: - status = str(initial.get("status") or "not_requested") - if status != "pending": - return initial - candidates = [str(item) for item in initial.get("alternatives", []) if str(item).strip()] - c1_titles = list(dict.fromkeys( - str(row.get("title") or "").strip() - for row in rag_rows - if str(row.get("layer") or "") == "C1_SYMBOL_CATALOG" and str(row.get("title") or "").strip() - )) - if not c1_titles: - initial["status"] = "not_found" - return initial - exact = next((title for title in c1_titles if title in candidates), None) - if exact: - return {"status": "resolved", "resolved_symbol": exact, "alternatives": c1_titles[:5], "confidence": 0.99} - fuzzy_hits: list[str] = [] - for candidate in candidates: - fuzzy_hits.extend(get_close_matches(candidate, c1_titles, n=3, cutoff=0.7)) - fuzzy_hits = list(dict.fromkeys(fuzzy_hits)) - if len(fuzzy_hits) == 1: - return {"status": "resolved", "resolved_symbol": fuzzy_hits[0], "alternatives": c1_titles[:5], "confidence": 0.82} - if len(fuzzy_hits) > 1: - return {"status": "ambiguous", "resolved_symbol": None, "alternatives": fuzzy_hits[:5], "confidence": 0.55} - return {"status": "not_found", "resolved_symbol": None, "alternatives": c1_titles[:5], "confidence": 0.0} - - def _retrieve_rows(self, *, rag_session_id: str, rag_query: str, route_result) -> list[dict]: - path_scope = list(getattr(route_result.retrieval_spec.filters, "path_scope", []) or []) - expected_repo_id = str(getattr(route_result.retrieval_spec.filters, "repo_id", "") or "").strip() or None - if route_result.query_plan.sub_intent == "OPEN_FILE" and path_scope: - return self._rag_adapter.retrieve_exact_files( - rag_session_id=rag_session_id, - repo_id=expected_repo_id, - paths=path_scope, - layers=["C0_SOURCE_CHUNKS"], - limit=200, - query=rag_query, - ranking_profile=str(getattr(route_result.retrieval_spec, "rerank_profile", "") or ""), - ) - return self._rag_adapter.retrieve_with_plan( - rag_session_id, - rag_query, - route_result.retrieval_spec, - route_result.retrieval_constraints, - query_plan=route_result.query_plan, - ) - - -def _ms(started: float) -> int: - return int((perf_counter() - started) * 1000) diff --git a/tests/pipeline_setup/suite_02_pipeline/pipeline_intent_rag/helpers/prompt_payload_builder.py b/tests/pipeline_setup/suite_02_pipeline/pipeline_intent_rag/helpers/prompt_payload_builder.py deleted file mode 100644 index 111f858..0000000 --- a/tests/pipeline_setup/suite_02_pipeline/pipeline_intent_rag/helpers/prompt_payload_builder.py +++ /dev/null @@ -1,148 +0,0 @@ -from __future__ import annotations - -from tests.pipeline_setup.suite_02_pipeline.pipeline_intent_rag.helpers.diagnostics import build_prompt_diagnostics - - -class PromptPayloadBuilder: - def build( - self, - query: str, - rag_rows: list[dict], - *, - prompt_template: dict | None = None, - sub_intent: str | None = None, - default_system_prompt: str, - default_task_prompt: str, - default_template_id: str, - system_prompt_version: str, - ) -> dict: - template = dict(prompt_template or {}) - system_prompt = str(template.get("system_prompt") or default_system_prompt) - task_prompt = str(template.get("task_prompt") or default_task_prompt) - template_id = str(template.get("template_id") or default_template_id) - context = RagContextFormatter().format(rag_rows, sub_intent=sub_intent) - user_prompt = ( - f"Вопрос пользователя:\n{query}\n\n" - f"Правила ответа:\n{task_prompt}\n\n" - f"Как интерпретировать слои RAG:\n{_LAYER_GUIDE}\n\n" - f"Контекст RAG:\n{context}\n\n" - "Ответь пользователю естественным инженерным языком." - ) - return { - "system_prompt": system_prompt, - "user_prompt": user_prompt, - "sub_intent": str(sub_intent or "").strip() or None, - "diagnostics": build_prompt_diagnostics( - system_prompt=system_prompt, - user_prompt=user_prompt, - rag_rows=rag_rows, - prompt_template_id=template_id, - system_prompt_version=system_prompt_version, - ), - } - - -class RagContextFormatter: - _DEFAULT_LIMIT = 6 - _QUOTAS = { - "OPEN_FILE": {"C0_SOURCE_CHUNKS": 4, "C1_SYMBOL_CATALOG": 1, "C4_SEMANTIC_ROLES": 1}, - "EXPLAIN": { - "C1_SYMBOL_CATALOG": 1, - "C0_SOURCE_CHUNKS": 2, - "C2_DEPENDENCY_GRAPH": 1, - "C4_SEMANTIC_ROLES": 1, - "C3_ENTRYPOINTS": 1, - }, - "EXPLAIN_LOCAL": {"C0_SOURCE_CHUNKS": 3, "C1_SYMBOL_CATALOG": 1, "C2_DEPENDENCY_GRAPH": 1, "C4_SEMANTIC_ROLES": 1}, - "FIND_TESTS": {"C1_SYMBOL_CATALOG": 1, "C2_DEPENDENCY_GRAPH": 2, "C0_SOURCE_CHUNKS": 2, "C4_SEMANTIC_ROLES": 1}, - "FIND_ENTRYPOINTS": {"C3_ENTRYPOINTS": 3, "C0_SOURCE_CHUNKS": 2, "C1_SYMBOL_CATALOG": 1}, - "TRACE_FLOW": {"C2_DEPENDENCY_GRAPH": 2, "C3_ENTRYPOINTS": 1, "C0_SOURCE_CHUNKS": 2, "C1_SYMBOL_CATALOG": 1}, - "ARCHITECTURE": {"C4_SEMANTIC_ROLES": 2, "C2_DEPENDENCY_GRAPH": 2, "C3_ENTRYPOINTS": 1, "C1_SYMBOL_CATALOG": 1}, - } - - def format(self, rag_rows: list[dict], *, sub_intent: str | None = None) -> str: - if not rag_rows: - return "(пусто)" - selected = self._select_rows(rag_rows, sub_intent=sub_intent) - return "\n\n".join(_RagRowFormatter().format(row) for row in selected) - - def _select_rows(self, rag_rows: list[dict], *, sub_intent: str | None) -> list[dict]: - rows = self._prioritize_rows(rag_rows, sub_intent=sub_intent) - quotas = dict(self._QUOTAS.get(str(sub_intent or "").strip().upper(), {})) - if not quotas: - return rows[: self._DEFAULT_LIMIT] - selected: list[dict] = [] - counts = {layer: 0 for layer in quotas} - for row in rows: - layer = str(row.get("layer") or "") - if layer not in quotas or counts[layer] >= quotas[layer]: - continue - selected.append(row) - counts[layer] += 1 - if len(selected) >= self._DEFAULT_LIMIT: - return selected[: self._DEFAULT_LIMIT] - for row in rows: - if row in selected: - continue - selected.append(row) - if len(selected) >= self._DEFAULT_LIMIT: - break - return selected - - def _prioritize_rows(self, rag_rows: list[dict], *, sub_intent: str | None) -> list[dict]: - if str(sub_intent or "").strip().upper() != "FIND_ENTRYPOINTS": - return list(rag_rows) - ranked = sorted( - enumerate(rag_rows), - key=lambda item: (_entrypoint_priority(item[1]), item[0]), - ) - return [row for _, row in ranked] - - -class _RagRowFormatter: - def format(self, row: dict) -> str: - layer = str(row.get("layer") or "") - path = str(row.get("path") or "") - title = str(row.get("title") or "") - metadata = dict(row.get("metadata") or {}) - content = self._content(row, metadata) - return f"- [{layer}] {path} | {title}\n{content}" - - def _content(self, row: dict, metadata: dict) -> str: - if str(row.get("layer") or "") != "C3_ENTRYPOINTS": - return str(row.get("content") or "")[:1200] - http_method = str(metadata.get("http_method") or "").strip() - route_path = str(metadata.get("route_path") or "").strip() - if not http_method or not route_path: - return str(row.get("content") or "")[:1200] - lines = [str(metadata.get("summary_text") or f"{http_method} {route_path}").strip()] - declaring = str(metadata.get("declaring_symbol") or "").strip() - handler = str(metadata.get("handler_symbol") or "").strip() - decorator_text = str(metadata.get("decorator_text") or "").strip() - if declaring: - lines.append(f"Declared in: {declaring}") - if handler: - lines.append(f"Handler: {handler}") - if decorator_text: - lines.append(f"Decorator: {decorator_text}") - return "\n".join(lines) - - -def _entrypoint_priority(row: dict) -> tuple[int, int]: - if str(row.get("layer") or "") != "C3_ENTRYPOINTS": - return (2, 0) - metadata = dict(row.get("metadata") or {}) - if str(metadata.get("http_method") or "").strip() and str(metadata.get("route_path") or "").strip(): - return (0, 0) - if str(metadata.get("entry_type") or "").strip() == "http": - return (1, 0) - return (1, 1) - - -_LAYER_GUIDE = ( - "- C0_SOURCE_CHUNKS: фактический код, это самый надёжный источник деталей реализации.\n" - "- C1_SYMBOL_CATALOG: объявления символов, сигнатуры и базовая идентификация сущностей.\n" - "- C2_DEPENDENCY_GRAPH: связи вызовов, зависимостей и потоков между сущностями.\n" - "- C3_ENTRYPOINTS: подтверждённые точки входа. Если есть http_method и route_path, считай это сильным сигналом реального route.\n" - "- C4_SEMANTIC_ROLES: эвристическое описание роли компонента; используй как вспомогательный сигнал и не ставь выше фактического кода." -) diff --git a/tests/pipeline_setup/suite_02_pipeline/pipeline_intent_rag/helpers/rag_db_adapter.py b/tests/pipeline_setup/suite_02_pipeline/pipeline_intent_rag/helpers/rag_db_adapter.py deleted file mode 100644 index 8733116..0000000 --- a/tests/pipeline_setup/suite_02_pipeline/pipeline_intent_rag/helpers/rag_db_adapter.py +++ /dev/null @@ -1,745 +0,0 @@ -from __future__ import annotations - -from dataclasses import dataclass -from fnmatch import fnmatch -import re -from time import perf_counter -from typing import TYPE_CHECKING, Any - -from app.modules.rag.retrieval.test_filter import build_test_filters - -if TYPE_CHECKING: - from app.modules.rag.persistence.repository import RagRepository - -_KNOWN_FILE_EXTENSIONS = ( - ".py", - ".md", - ".txt", - ".yaml", - ".yml", - ".json", - ".toml", - ".ini", -) -_SYMBOL_TOKEN_RE = re.compile(r"\b([A-Z][A-Za-z0-9_]{2,}|[a-z_][a-z0-9_]{2,})\b") -_DEFAULT_SYMBOL_KINDS = {"class", "function", "method"} - - -def is_file_path(path: str) -> bool: - normalized = normalize_path(path) - if not normalized: - return False - tail = normalized.rsplit("/", 1)[-1] - if "." in tail and not tail.startswith(".") and not tail.endswith("."): - return True - return tail.lower().endswith(_KNOWN_FILE_EXTENSIONS) - - -def normalize_path(path: str) -> str: - normalized = str(path or "").strip().replace("\\", "/") - while "//" in normalized: - normalized = normalized.replace("//", "/") - if normalized.startswith("./"): - normalized = normalized[2:] - return normalized - - -def normalize_paths(paths: list[str]) -> list[str]: - deduped: list[str] = [] - for value in paths: - normalized = normalize_path(value) - if normalized and normalized not in deduped: - deduped.append(normalized) - return deduped - - -def extract_symbol_tokens(text: str) -> list[str]: - tokens: list[str] = [] - for match in _SYMBOL_TOKEN_RE.finditer(str(text or "")): - token = match.group(1).strip() - if token and token not in tokens: - tokens.append(token) - return tokens[:8] - - -class SessionEmbeddingDimensions: - def __init__(self) -> None: - self._cache: dict[str, int] = {} - - def resolve(self, rag_session_id: str) -> int: - if rag_session_id in self._cache: - return self._cache[rag_session_id] - from sqlalchemy import text - - from app.modules.shared.db import get_engine - - with get_engine().connect() as conn: - row = conn.execute( - text( - """ - SELECT vector_dims(embedding) AS dim - FROM rag_chunks - WHERE rag_session_id = :sid - LIMIT 1 - """ - ), - {"sid": rag_session_id}, - ).mappings().first() - dim = int(row["dim"]) if row and row.get("dim") else 0 - self._cache[rag_session_id] = dim - return dim - - -class GlobPatternMapper: - @staticmethod - def to_prefixes(globs: list[str]) -> list[str]: - result: list[str] = [] - for value in globs: - item = str(value or "").strip() - if not item: - continue - if item.endswith("/**"): - prefix = item[:-3] - elif "*" in item or "?" in item: - continue - else: - prefix = item - if prefix and prefix not in result: - result.append(prefix) - return result - - @staticmethod - def to_like_patterns(globs: list[str]) -> list[str]: - result: list[str] = [] - for value in globs: - item = str(value or "").strip().lower() - if not item or ("*" not in item and "?" not in item): - continue - sql_like = item.replace("**/", "%/").replace("**", "%").replace("*", "%").replace("?", "_") - if sql_like not in result: - result.append(sql_like) - return result - - -class RagRowDeduplicator: - def dedupe(self, rows: list[dict]) -> list[dict]: - result: list[dict] = [] - seen: set[tuple[Any, ...]] = set() - for row in rows: - key = self._key(row) - if key in seen: - continue - seen.add(key) - result.append(row) - return result - - def _key(self, row: dict) -> tuple[Any, ...]: - layer = str(row.get("layer") or "") - path = str(row.get("path") or "") - span_start = row.get("span_start") - span_end = row.get("span_end") - metadata = dict(row.get("metadata") or {}) - if layer == "C0_SOURCE_CHUNKS": - return (layer, path, span_start, span_end) - if layer == "C1_SYMBOL_CATALOG": - return (layer, str(metadata.get("symbol_id") or ""), path, span_start, span_end) - if layer == "C2_DEPENDENCY_GRAPH": - return (layer, str(metadata.get("edge_id") or ""), path, span_start, span_end) - return (layer, path, str(row.get("title") or ""), span_start, span_end) - - -@dataclass(slots=True) -class LayerRetrievalParams: - rag_session_id: str - query_text: str - layer_id: str - limit: int - scope: list[str] - exclude_prefixes: list[str] | None - exclude_like: list[str] | None - prefer_path_prefixes: list[str] | None - prefer_like_patterns: list[str] | None - dim: int - include_tests: bool - retrieval_mode_hint: str | None = None - c1_kind_filter: set[str] | None = None - allow_scope_relaxation: bool = True - - -class LayerBudgetRetriever: - def __init__( - self, - repository: RagRepository, - dim_resolver: SessionEmbeddingDimensions, - deduper: RagRowDeduplicator, - ) -> None: - self._repository = repository - self._dim_resolver = dim_resolver - self._deduper = deduper - self._explain_refiner = ExplainStrictRefiner() - self._last_report: dict[str, Any] | None = None - - def retrieve( - self, - query: str, - retrieval_spec, - retrieval_constraints, - mapper: GlobPatternMapper, - *, - rag_session_id: str, - query_plan=None, - ) -> list[dict]: - filters = retrieval_spec.filters - path_scope = list(getattr(filters, "path_scope", []) or []) - test_policy = str(getattr(filters, "test_policy", "EXCLUDE") or "EXCLUDE") - include_globs = list(getattr(retrieval_constraints, "include_globs", []) or []) - exclude_globs = list(getattr(retrieval_constraints, "exclude_globs", []) or []) - prefer_globs = list(getattr(retrieval_constraints, "prefer_globs", []) or []) - include_prefixes = mapper.to_prefixes(include_globs) - exclude_from_constraints = mapper.to_prefixes(exclude_globs) - exclude_like_constraints = mapper.to_like_patterns(exclude_globs) - prefer_path_prefixes = mapper.to_prefixes(prefer_globs) - prefer_like_patterns = mapper.to_like_patterns(prefer_globs) - test_file_globs = list(getattr(retrieval_constraints, "test_file_globs", []) or []) - test_symbol_patterns = list(getattr(retrieval_constraints, "test_symbol_patterns", []) or []) - exclude_prefixes, exclude_like = self._test_filters(test_policy) - if exclude_from_constraints: - exclude_prefixes = list(dict.fromkeys([*(exclude_prefixes or []), *exclude_from_constraints])) - if exclude_like_constraints: - exclude_like = list(dict.fromkeys([*(exclude_like or []), *exclude_like_constraints])) - effective_scope = path_scope or include_prefixes - effective_query = f"{query} {' '.join(test_symbol_patterns)}".strip() if test_symbol_patterns else query - symbol_candidates = list(getattr(query_plan, "symbol_candidates", []) or []) - symbol_kind_hint = str(getattr(query_plan, "symbol_kind_hint", "") or "").strip().lower() - sub_intent = str(getattr(query_plan, "sub_intent", "") or "").strip().upper() - c1_query = self._c1_query(symbol_candidates, query) - c1_kind_filter = self._c1_kind_filter(symbol_candidates, symbol_kind_hint) - strict_symbol_mode = bool(symbol_candidates) and sub_intent == "EXPLAIN" - if strict_symbol_mode and c1_query: - effective_query = c1_query - dim = self._dim_resolver.resolve(rag_session_id) - merged: list[dict] = [] - report = self._empty_report() - report["fallback"]["reason"] = None - for layer_query in list(getattr(retrieval_spec, "layer_queries", []) or []): - layer_id = str(layer_query.layer_id) - params = LayerRetrievalParams( - rag_session_id=rag_session_id, - query_text=c1_query if layer_id == "C1_SYMBOL_CATALOG" and c1_query else effective_query, - layer_id=layer_id, - limit=max(1, int(layer_query.top_k)), - scope=effective_scope, - exclude_prefixes=exclude_prefixes, - exclude_like=exclude_like, - prefer_path_prefixes=prefer_path_prefixes, - prefer_like_patterns=prefer_like_patterns, - dim=dim, - include_tests=test_policy == "INCLUDE", - retrieval_mode_hint="symbol_search" if layer_id == "C1_SYMBOL_CATALOG" and c1_query else None, - c1_kind_filter=c1_kind_filter if layer_id == "C1_SYMBOL_CATALOG" else None, - allow_scope_relaxation=not strict_symbol_mode, - ) - request = { - "layer": layer_id, - "query": params.query_text, - "path_scope": list(path_scope), - "include_globs": include_globs, - "exclude_globs": exclude_globs, - "prefer_globs": prefer_globs, - "top_k": params.limit, - "ranking_profile": str(getattr(retrieval_spec, "rerank_profile", "") or ""), - } - report["requests"].append(request) - started = perf_counter() - rows, layer_diag = self.retrieve_layer_with_scope_fallback(params) - report["retrieval_by_layer_ms"][layer_id] = int((perf_counter() - started) * 1000) - if test_file_globs: - before = len(rows) - rows = self._filter_rows_by_globs(rows, test_file_globs) - filter_stage = "post_rank" - after = len(rows) - else: - before = len(rows) - after = len(rows) - filter_stage = "pre_rank" - if strict_symbol_mode: - rows = self._explain_refiner.refine(layer_id, rows, symbol_candidates) - report["applied"].append( - { - "layer": layer_id, - "effective_path_scope": list(layer_diag.get("effective_path_scope") or []), - "normalized_include_globs": list(include_prefixes), - "normalized_exclude_globs": list(exclude_prefixes or []), - "normalized_prefer_globs": list(prefer_path_prefixes), - "filter_stage": filter_stage, - "candidates_before_filter": before, - "candidates_after_filter": after, - } - ) - report["executed_layers"].append(layer_id) - report["retrieval_mode_by_layer"][layer_id] = str( - params.retrieval_mode_hint or layer_diag.get("retrieval_mode") or "disabled" - ) - report["top_k_by_layer"][layer_id] = params.limit - report["filters_by_layer"][layer_id] = { - "path_scope": list(layer_diag.get("effective_path_scope") or []), - "include_globs": list(include_prefixes), - "exclude_globs": list(exclude_prefixes or []), - "prefer_globs": list(prefer_path_prefixes), - } - if bool(layer_diag.get("fallback_used")) and params.allow_scope_relaxation: - report["fallback"]["used"] = True - report["fallback"]["reason"] = str(layer_diag.get("fallback_reason") or "scope_relaxed") - merged.extend(rows) - self._last_report = report - return self._deduper.dedupe(merged) - - def consume_report(self) -> dict[str, Any] | None: - report = self._last_report - self._last_report = None - return report - - def retrieve_layer_with_scope_fallback(self, params: LayerRetrievalParams) -> tuple[list[dict], dict[str, Any]]: - options = self._prefixes_options(params.scope) if params.allow_scope_relaxation else [params.scope or None] - last_mode = "disabled" - for idx, prefixes in enumerate(options): - rows, base_mode = self._retrieve_layer(params, prefixes) - last_mode = base_mode - if params.c1_kind_filter and params.layer_id == "C1_SYMBOL_CATALOG": - rows = self._filter_c1_by_kind(rows, params.c1_kind_filter) - if rows: - retrieval_mode = self._resolve_mode(base_mode, prefixes) - fallback_used = idx > 0 - fallback_reason = "scope_relaxed" if fallback_used else None - return rows, { - "effective_path_scope": list(prefixes or []), - "retrieval_mode": retrieval_mode, - "fallback_used": fallback_used, - "fallback_reason": fallback_reason, - } - return [], { - "effective_path_scope": [], - "retrieval_mode": last_mode, - "fallback_used": len(options) > 1, - "fallback_reason": "scope_relaxed_no_hits" if len(options) > 1 else None, - } - - def _retrieve_layer(self, params: LayerRetrievalParams, prefixes: list[str] | None) -> tuple[list[dict], str]: - if params.dim <= 0: - if params.layer_id != "C0_SOURCE_CHUNKS": - return [], "disabled" - return self._repository.retrieve_lexical_code( - params.rag_session_id, - query_text=params.query_text, - limit=params.limit, - path_prefixes=prefixes, - exclude_path_prefixes=params.exclude_prefixes, - exclude_like_patterns=params.exclude_like, - prefer_path_prefixes=params.prefer_path_prefixes, - prefer_like_patterns=params.prefer_like_patterns, - prefer_non_tests=not params.include_tests, - ), "lexical" - return self._repository.retrieve( - params.rag_session_id, - [0.0] * params.dim, - query_text=params.query_text, - limit=params.limit, - layers=[params.layer_id], - path_prefixes=prefixes, - exclude_path_prefixes=params.exclude_prefixes, - exclude_like_patterns=params.exclude_like, - prefer_path_prefixes=params.prefer_path_prefixes, - prefer_like_patterns=params.prefer_like_patterns, - prefer_non_tests=not params.include_tests, - ), "vector" - - def _test_filters(self, test_policy: str) -> tuple[list[str] | None, list[str] | None]: - if test_policy == "INCLUDE": - return None, None - filters = build_test_filters() - return filters.exclude_path_prefixes, filters.exclude_like_patterns - - def _prefixes_options(self, path_scope: list[str]) -> list[list[str] | None]: - if not path_scope: - return [None] - parent_prefixes = [ - item.rsplit("/", 1)[0] - for item in path_scope - if "/" in item and not is_file_path(item) - ] - deduped_parents: list[str] = [] - for item in parent_prefixes: - if item and item not in deduped_parents: - deduped_parents.append(item) - result: list[list[str] | None] = [path_scope] - if deduped_parents: - result.append(deduped_parents) - result.append(None) - return result - - def _resolve_mode(self, base_mode: str, prefixes: list[str] | None) -> str: - if base_mode == "disabled": - return "disabled" - if prefixes: - return "exact_path_fetch" - return base_mode - - def _empty_report(self) -> dict[str, Any]: - return { - "executed_layers": [], - "retrieval_mode_by_layer": {}, - "top_k_by_layer": {}, - "filters_by_layer": {}, - "requests": [], - "applied": [], - "fallback": {"used": False, "reason": None}, - "retrieval_by_layer_ms": {}, - } - - def _filter_rows_by_globs(self, rows: list[dict], globs: list[str]) -> list[dict]: - if not globs: - return rows - patterns = [item.strip().lower() for item in globs if item.strip()] - result: list[dict] = [] - for row in rows: - path = str(row.get("path") or "").lower() - if any(fnmatch(path, pattern) or fnmatch(path, f"*/{pattern}") for pattern in patterns): - result.append(row) - return result - - def _c1_query(self, symbol_candidates: list[str], query: str) -> str: - tokens = [str(item).strip() for item in symbol_candidates if str(item).strip()] - if tokens: - return " ".join(tokens) - fallback = extract_symbol_tokens(query) - return " ".join(fallback) if fallback else str(query or "") - - def _c1_kind_filter(self, symbol_candidates: list[str], symbol_kind_hint: str) -> set[str] | None: - if symbol_kind_hint in _DEFAULT_SYMBOL_KINDS or symbol_kind_hint == "module": - return {symbol_kind_hint} - if symbol_candidates: - return set(_DEFAULT_SYMBOL_KINDS) - return None - - def _filter_c1_by_kind(self, rows: list[dict], allowed_kinds: set[str]) -> list[dict]: - result: list[dict] = [] - for row in rows: - metadata = dict(row.get("metadata") or {}) - kind = str(metadata.get("kind") or "").strip().lower() - if kind in allowed_kinds: - result.append(row) - return result - - -class ExplainStrictRefiner: - def refine(self, layer_id: str, rows: list[dict], symbol_candidates: list[str]) -> list[dict]: - if not rows or not symbol_candidates: - return rows - sorted_rows = self._sort_exact_first(rows, symbol_candidates) - if layer_id != "C4_SEMANTIC_ROLES": - return sorted_rows - exact = [row for row in sorted_rows if self._is_exact_symbol(row, symbol_candidates)] - if not exact: - return sorted_rows[:1] - primary = exact[:1] - same_path = [ - row - for row in sorted_rows - if row not in primary and str(row.get("path") or "") == str(primary[0].get("path") or "") - ] - return [*primary, *same_path[:2]] - - def _sort_exact_first(self, rows: list[dict], symbol_candidates: list[str]) -> list[dict]: - return sorted(rows, key=lambda row: (0 if self._is_exact_symbol(row, symbol_candidates) else 1)) - - def _is_exact_symbol(self, row: dict, symbol_candidates: list[str]) -> bool: - title = str(row.get("title") or "").strip() - metadata = dict(row.get("metadata") or {}) - qname = str(metadata.get("qname") or "").strip() - symbol_name = str(metadata.get("symbol_name") or "").strip() - return any(candidate in {title, qname, symbol_name} for candidate in symbol_candidates) - - -class ResolvedSymbolSourceHydrator: - def __init__( - self, - retriever: LayerBudgetRetriever, - dim_resolver: SessionEmbeddingDimensions, - deduper: RagRowDeduplicator, - ) -> None: - self._retriever = retriever - self._dim_resolver = dim_resolver - self._deduper = deduper - - def hydrate( - self, - rag_session_id: str, - base_query: str, - rag_rows: list[dict], - symbol_resolution: dict, - retrieval_spec, - retrieval_constraints, - mapper: GlobPatternMapper, - ) -> list[dict]: - if str(symbol_resolution.get("status") or "") != "resolved": - return self._deduper.dedupe(rag_rows) - resolved = str(symbol_resolution.get("resolved_symbol") or "").strip() - if not resolved: - return self._deduper.dedupe(rag_rows) - alternatives = [str(item).strip() for item in symbol_resolution.get("alternatives", []) if str(item).strip()] - target_names = [resolved] - for name in alternatives: - if name not in target_names: - target_names.append(name) - if len(target_names) >= 3: - break - filters = retrieval_spec.filters - test_policy = str(getattr(filters, "test_policy", "EXCLUDE") or "EXCLUDE") - exclude_prefixes = mapper.to_prefixes(list(getattr(retrieval_constraints, "exclude_globs", []) or [])) - exclude_like = mapper.to_like_patterns(list(getattr(retrieval_constraints, "exclude_globs", []) or [])) - prefer_path_prefixes = mapper.to_prefixes(list(getattr(retrieval_constraints, "prefer_globs", []) or [])) - prefer_like_patterns = mapper.to_like_patterns(list(getattr(retrieval_constraints, "prefer_globs", []) or [])) - dim = self._dim_resolver.resolve(rag_session_id) - c0_limit = self._layer_top_k(retrieval_spec, "C0_SOURCE_CHUNKS", fallback=6) - extra_rows: list[dict] = [] - for symbol_row in self._symbol_rows(rag_rows, target_names): - symbol_path = str(symbol_row.get("path") or "").strip() - if not symbol_path: - continue - symbol_meta = dict(symbol_row.get("metadata") or {}) - symbol_blob_sha = str(symbol_meta.get("blob_sha") or "").strip() - params = LayerRetrievalParams( - rag_session_id=rag_session_id, - query_text=str(symbol_row.get("title") or "").strip() or base_query, - layer_id="C0_SOURCE_CHUNKS", - limit=min(c0_limit, 4), - scope=[symbol_path], - exclude_prefixes=exclude_prefixes or None, - exclude_like=exclude_like or None, - prefer_path_prefixes=prefer_path_prefixes, - prefer_like_patterns=prefer_like_patterns, - dim=dim, - include_tests=test_policy == "INCLUDE", - ) - rows, _ = self._retriever.retrieve_layer_with_scope_fallback(params) - for row in rows: - row_meta = dict(row.get("metadata") or {}) - if symbol_blob_sha and str(row_meta.get("blob_sha") or "") != symbol_blob_sha: - continue - if not self._overlaps_symbol(row, symbol_row.get("span_start"), symbol_row.get("span_end")): - continue - extra_rows.append(row) - return self._deduper.dedupe([*rag_rows, *extra_rows]) - - def _symbol_rows(self, rows: list[dict], target_names: list[str]) -> list[dict]: - c1_rows = [row for row in rows if str(row.get("layer") or "") == "C1_SYMBOL_CATALOG"] - by_id = { - str(dict(row.get("metadata") or {}).get("symbol_id") or ""): row - for row in c1_rows - if str(dict(row.get("metadata") or {}).get("symbol_id") or "").strip() - } - selected: list[dict] = [] - seen_ids: set[str] = set() - for row in c1_rows: - title = str(row.get("title") or "").strip() - qname = str(dict(row.get("metadata") or {}).get("qname") or "").strip() - if title not in target_names and qname not in target_names: - continue - symbol_id = str(dict(row.get("metadata") or {}).get("symbol_id") or "") - if symbol_id in seen_ids: - continue - seen_ids.add(symbol_id) - selected.append(row) - parent_id = str(dict(row.get("metadata") or {}).get("parent_symbol_id") or "") - parent = by_id.get(parent_id) - if parent is not None and parent_id not in seen_ids: - seen_ids.add(parent_id) - selected.append(parent) - return selected - - def _layer_top_k(self, retrieval_spec, layer_id: str, *, fallback: int) -> int: - for item in list(getattr(retrieval_spec, "layer_queries", []) or []): - if str(item.layer_id) == layer_id: - return max(1, int(item.top_k)) - return fallback - - def _overlaps_symbol(self, row: dict, symbol_start, symbol_end) -> bool: - if symbol_start is None and symbol_end is None: - return True - row_start = row.get("span_start") - row_end = row.get("span_end") - if row_start is None or row_end is None: - return True - start = int(symbol_start if symbol_start is not None else row_start) - end = int(symbol_end if symbol_end is not None else row_end) - return int(row_start) <= end and int(row_end) >= start - - -class RagDbAdapter: - def __init__(self, repository: RagRepository, dim_resolver: SessionEmbeddingDimensions) -> None: - self._repository = repository - self._mapper = GlobPatternMapper() - self._deduper = RagRowDeduplicator() - self._retriever = LayerBudgetRetriever(repository, dim_resolver, self._deduper) - self._hydrator = ResolvedSymbolSourceHydrator(self._retriever, dim_resolver, self._deduper) - self._last_retrieval_report: dict[str, Any] | None = None - - def retrieve(self, rag_session_id: str, query: str, retrieval_spec, retrieval_constraints=None) -> list[dict]: - rows = self._retriever.retrieve( - query=query, - retrieval_spec=retrieval_spec, - retrieval_constraints=retrieval_constraints, - mapper=self._mapper, - rag_session_id=rag_session_id, - query_plan=None, - ) - self._last_retrieval_report = self._retriever.consume_report() - return rows - - def retrieve_with_plan( - self, - rag_session_id: str, - query: str, - retrieval_spec, - retrieval_constraints=None, - *, - query_plan=None, - ) -> list[dict]: - rows = self._retriever.retrieve( - query=query, - retrieval_spec=retrieval_spec, - retrieval_constraints=retrieval_constraints, - mapper=self._mapper, - rag_session_id=rag_session_id, - query_plan=query_plan, - ) - self._last_retrieval_report = self._retriever.consume_report() - return rows - - def hydrate_resolved_symbol_sources( - self, - rag_session_id: str, - base_query: str, - rag_rows: list[dict], - symbol_resolution: dict, - retrieval_spec, - retrieval_constraints=None, - ) -> list[dict]: - return self._hydrator.hydrate( - rag_session_id=rag_session_id, - base_query=base_query, - rag_rows=rag_rows, - symbol_resolution=symbol_resolution, - retrieval_spec=retrieval_spec, - retrieval_constraints=retrieval_constraints, - mapper=self._mapper, - ) - - def consume_retrieval_report(self) -> dict[str, Any] | None: - report = self._last_retrieval_report - self._last_retrieval_report = None - return report - - def retrieve_exact_files( - self, - rag_session_id: str, - *, - repo_id: str | None = None, - paths: list[str], - layers: list[str] | None = None, - limit: int = 200, - query: str = "", - ranking_profile: str = "", - ) -> list[dict]: - normalized_paths = normalize_paths(paths) - started = perf_counter() - rows = self._repository.retrieve_exact_files( - rag_session_id, - repo_id=repo_id, - paths=normalized_paths, - layers=layers, - limit=limit, - ) - elapsed = int((perf_counter() - started) * 1000) - layer_id = list(layers or ["C0_SOURCE_CHUNKS"])[0] - self._last_retrieval_report = { - "executed_layers": [layer_id], - "retrieval_mode_by_layer": {layer_id: "exact_path_fetch"}, - "top_k_by_layer": {layer_id: int(limit)}, - "filters_by_layer": { - layer_id: { - "path_scope": list(normalized_paths), - "include_globs": [], - "exclude_globs": [], - "prefer_globs": [], - } - }, - "requests": [ - { - "layer": layer_id, - "query": query, - "path_scope": list(normalized_paths), - "include_globs": [], - "exclude_globs": [], - "prefer_globs": [], - "top_k": int(limit), - "ranking_profile": ranking_profile, - } - ], - "applied": [ - { - "layer": layer_id, - "effective_path_scope": list(normalized_paths), - "normalized_include_globs": [], - "normalized_exclude_globs": [], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": len(rows), - "candidates_after_filter": len(rows), - } - ], - "fallback": {"used": False, "reason": None}, - "retrieval_by_layer_ms": {layer_id: elapsed}, - } - return self._deduper.dedupe(rows) - - def force_symbol_context_c0( - self, - rag_session_id: str, - *, - rag_rows: list[dict], - symbol_resolution: dict, - limit: int = 20, - ) -> list[dict]: - if str(symbol_resolution.get("status") or "") != "resolved": - return rag_rows - if float(symbol_resolution.get("confidence") or 0.0) < 0.8: - return rag_rows - target = str(symbol_resolution.get("resolved_symbol") or "").strip() - if not target: - return rag_rows - c1_rows = [row for row in rag_rows if str(row.get("layer") or "") == "C1_SYMBOL_CATALOG"] - target_row = next( - ( - row - for row in c1_rows - if str(row.get("title") or "").strip() == target - or str(dict(row.get("metadata") or {}).get("qname") or "").strip() == target - ), - None, - ) - if target_row is None: - return rag_rows - target_path = normalize_path(str(target_row.get("path") or "")) - if not target_path: - return rag_rows - c0_rows = self.retrieve_exact_files( - rag_session_id, - paths=[target_path], - layers=["C0_SOURCE_CHUNKS"], - limit=limit, - query=target, - ranking_profile="symbol_context", - ) - preserved = [row for row in rag_rows if str(row.get("layer") or "") != "C0_SOURCE_CHUNKS"] - return self._deduper.dedupe([*preserved, *c0_rows]) diff --git a/tests/pipeline_setup/suite_02_pipeline/pipeline_intent_rag/helpers/repo_indexer.py b/tests/pipeline_setup/suite_02_pipeline/pipeline_intent_rag/helpers/repo_indexer.py deleted file mode 100644 index 02f07f9..0000000 --- a/tests/pipeline_setup/suite_02_pipeline/pipeline_intent_rag/helpers/repo_indexer.py +++ /dev/null @@ -1,11 +0,0 @@ -from tests.pipeline_setup.utils.rag_indexer import ( - DeterministicEmbedder, - LocalRepoFileCollector, - RagSessionIndexer, -) - -__all__ = [ - "DeterministicEmbedder", - "LocalRepoFileCollector", - "RagSessionIndexer", -] diff --git a/tests/pipeline_setup/suite_02_pipeline/pipeline_intent_rag/helpers/result_views.py b/tests/pipeline_setup/suite_02_pipeline/pipeline_intent_rag/helpers/result_views.py deleted file mode 100644 index 9507f00..0000000 --- a/tests/pipeline_setup/suite_02_pipeline/pipeline_intent_rag/helpers/result_views.py +++ /dev/null @@ -1,127 +0,0 @@ -from __future__ import annotations - -from copy import deepcopy -from typing import TYPE_CHECKING - -if TYPE_CHECKING: - from tests.pipeline_setup.suite_02_pipeline.pipeline_intent_rag.helpers.models import PipelineResult - - -class PipelineDiagnosticsBuilder: - def build(self, result: PipelineResult) -> dict: - payload = deepcopy(result.diagnostics or {}) - router_plan = dict(payload.get("router_plan") or {}) - execution = dict(payload.get("execution") or {}) - retrieval_block = payload.get("retrieval") - - payload["router"] = { - "conversation_mode": result.conversation_mode, - "keyword_hints": list(router_plan.get("keyword_hints") or []), - "path_scope": list(router_plan.get("path_scope") or []), - } - payload["llm"] = { - "used_evidence_count": len(result.rag_rows), - "missing_evidence_reason": self._missing_evidence_reason(result), - } - - if isinstance(retrieval_block, dict): - retrieval_block["symbol_resolution"] = { - "status": str(result.symbol_resolution.get("status") or "not_requested"), - "resolved_symbol": result.symbol_resolution.get("resolved_symbol"), - "alternatives": list(result.symbol_resolution.get("alternatives") or []), - } - retrieval_block["layers"] = self._layer_diagnostics(result, execution) - - return payload - - def _layer_diagnostics(self, result: PipelineResult, execution: dict) -> list[dict]: - layers = list(execution.get("executed_layers") or []) - counts = self._layer_hit_counts(result.rag_rows) - fallback = {} - retrieval = result.diagnostics.get("retrieval") - if isinstance(retrieval, dict): - fallback = dict(retrieval.get("fallback") or {}) - reason = fallback.get("reason") - - output: list[dict] = [] - for layer in layers: - hit_count = int(counts.get(str(layer), 0)) - output.append( - { - "layer": str(layer), - "status": "hit" if hit_count > 0 else "miss", - "hit_count": hit_count, - "fail_reason": reason if hit_count == 0 else None, - } - ) - return output - - def _layer_hit_counts(self, rows: list[dict]) -> dict[str, int]: - counts: dict[str, int] = {} - for row in rows: - layer = str(row.get("layer") or "") - counts[layer] = counts.get(layer, 0) + 1 - return counts - - def _missing_evidence_reason(self, result: PipelineResult) -> str | None: - if result.mode != "full_chain": - return None - answer_policy = dict(result.diagnostics.get("answer_policy") or {}) - failure_reason = str(answer_policy.get("failure_reason") or "").strip() - if failure_reason: - return failure_reason - if result.rag_rows: - return None - return "empty_retrieval_context" - - -class PipelineSummaryBuilder: - def build(self, result: PipelineResult, diagnostics: dict) -> dict: - router_plan = dict(diagnostics.get("router_plan") or {}) - retrieval_profile = router_plan.get("retrieval_profile") - layers_hit = self._layers_hit(result) - evidence_sufficient = len(result.rag_rows) > 0 - answer_status = self._answer_status(result, evidence_sufficient) - - return { - "router": { - "intent": result.intent, - "sub_intent": router_plan.get("sub_intent"), - "confidence": None, - }, - "retrieval": { - "profile": retrieval_profile, - "layers_hit": layers_hit, - "evidence_sufficient": evidence_sufficient, - }, - "llm": { - "answer_status": answer_status, - "groundedness": self._groundedness(result, evidence_sufficient), - }, - } - - def _layers_hit(self, result: PipelineResult) -> list[str]: - layers = {str(row.get("layer") or "") for row in result.rag_rows if str(row.get("layer") or "")} - return sorted(layers) - - def _answer_status(self, result: PipelineResult, evidence_sufficient: bool) -> str: - if result.mode != "full_chain": - return "partial" - answer_policy = dict(result.diagnostics.get("answer_policy") or {}) - policy_mode = str(answer_policy.get("answer_mode") or "").strip() - if policy_mode: - return policy_mode - if not (result.llm_answer or "").strip(): - return "failed" - if not evidence_sufficient: - return "insufficient_evidence" - return "answered" - - def _groundedness(self, result: PipelineResult, evidence_sufficient: bool) -> str: - if result.mode != "full_chain": - return "not_applicable" - if not (result.llm_answer or "").strip(): - return "speculative" - if evidence_sufficient: - return "grounded" - return "weakly_grounded" diff --git a/tests/pipeline_setup/suite_02_pipeline/pipeline_intent_rag/helpers/runtime.py b/tests/pipeline_setup/suite_02_pipeline/pipeline_intent_rag/helpers/runtime.py deleted file mode 100644 index 54fed4d..0000000 --- a/tests/pipeline_setup/suite_02_pipeline/pipeline_intent_rag/helpers/runtime.py +++ /dev/null @@ -1,135 +0,0 @@ -from __future__ import annotations - -from datetime import datetime -from pathlib import Path - -from app.modules.agent.runtime import AgentRuntimeExecutor -from app.modules.agent.llm import AgentLlmService -from app.modules.agent.llm.prompt_loader import PromptLoader -from app.modules.shared.gigachat.client import GigaChatClient -from app.modules.shared.gigachat.settings import GigaChatSettings -from app.modules.shared.gigachat.token_provider import GigaChatTokenProvider -from tests.pipeline_setup.suite_02_pipeline.pipeline_intent_rag.helpers.artifact_writer import ArtifactWriter -from tests.pipeline_setup.suite_02_pipeline.pipeline_intent_rag.helpers.diagnostics import clone_diagnostics -from tests.pipeline_setup.suite_02_pipeline.pipeline_intent_rag.helpers.models import PhraseCase, PipelineResult -from tests.pipeline_setup.suite_02_pipeline.pipeline_intent_rag.helpers.phrases_loader import PhraseCatalogLoader -from tests.pipeline_setup.suite_02_pipeline.pipeline_intent_rag.helpers.pipeline_config import PipelineRunConfig - - -class PipelineRuntime: - def __init__(self, mode: str, test_name: str, test_root: Path) -> None: - self._config = PipelineRunConfig.from_env(mode=mode, test_name=test_name, test_root=test_root) - self._started_at = datetime.now() - self._writer = ArtifactWriter(self._config.test_results_dir, test_name=self._config.test_name, run_started_at=self._started_at) - self._rag_adapter = None - self._session_resolver = None - self._executor: AgentRuntimeExecutor | None = None - - @property - def artifact_path(self) -> Path: - return self._writer.path - - def load_cases(self) -> list[PhraseCase]: - loader = PhraseCatalogLoader() - cases = loader.filter_by_tag(loader.load(self._config.phrases_path), self._config.tag) - if not cases: - raise ValueError(f"No cases for tag={self._config.tag} in {self._config.phrases_path}") - return cases - - def run_router_only(self, case: PhraseCase) -> PipelineResult: - from tests.pipeline_setup.suite_02_pipeline.pipeline_intent_rag.helpers.pipeline_runner import RouterOnlyRunner - - result = RouterOnlyRunner(started_at=self._started_at).run_case(case) - self._writer.write_record(result.to_record()) - return result - - def run_router_rag(self, case: PhraseCase) -> PipelineResult: - result = self._run_router_rag_case(case) - self._writer.write_record(result.to_record()) - return result - - def run_full_chain(self, case: PhraseCase) -> PipelineResult: - result_payload = self._executor_instance().execute(user_query=case.text, rag_session_id=case.rag_session_id or "") - route = dict(result_payload.diagnostics.router_result) - retrieval = dict(result_payload.diagnostics.retrieval_request) - diagnostics = { - "router_plan": { - "sub_intent": route.get("sub_intent"), - "graph_id": route.get("graph_id"), - "path_scope": list(retrieval.get("path_scope") or []), - "layers": list(retrieval.get("requested_layers") or []), - "symbol_candidates": list(result_payload.router_result.query_plan.symbol_candidates or []) if result_payload.router_result else [], - }, - "timings_ms": dict(result_payload.diagnostics.timings_ms or {}), - "answer_policy": { - "short_circuit": not result_payload.llm_used, - "answer_mode": _answer_status(result_payload.answer_mode, result_payload.llm_used), - "failure_reason": ",".join(result_payload.validation.reasons), - }, - } - result = PipelineResult( - case=case, - mode="full_chain", - run_started_at=self._started_at, - rag_session_id=case.rag_session_id, - intent=str(route.get("intent") or ""), - graph_id=str(route.get("graph_id") or ""), - conversation_mode=str(route.get("conversation_mode") or ""), - query=str(retrieval.get("query") or case.text), - rag_rows=list(result_payload.retrieval_result.raw_rows) if result_payload.retrieval_result else [], - symbol_resolution=result_payload.router_result.symbol_resolution.model_dump() if result_payload.router_result else {}, - llm_answer=result_payload.final_answer, - diagnostics=diagnostics, - ) - self._writer.write_record(result.to_record()) - return result - - def _run_router_rag_case(self, case: PhraseCase) -> PipelineResult: - from tests.pipeline_setup.suite_02_pipeline.pipeline_intent_rag.helpers.pipeline_runner import IntentRouterRagPipelineRunner - - rag_adapter, session_resolver = self._rag_components() - runner = IntentRouterRagPipelineRunner( - started_at=self._started_at, - rag_adapter=rag_adapter, - session_resolver=session_resolver, - ) - return runner.run_case(case) - - def _rag_components(self): - if self._rag_adapter is not None and self._session_resolver is not None: - return self._rag_adapter, self._session_resolver - from app.modules.rag.persistence.repository import RagRepository - from tests.pipeline_setup.suite_02_pipeline.pipeline_intent_rag.helpers.rag_db_adapter import RagDbAdapter, SessionEmbeddingDimensions - from tests.pipeline_setup.suite_02_pipeline.pipeline_intent_rag.helpers.session_resolver import RagSessionResolver - - repository = RagRepository() - self._rag_adapter = RagDbAdapter(repository=repository, dim_resolver=SessionEmbeddingDimensions()) - self._session_resolver = RagSessionResolver(config=self._config, repository=repository) - return self._rag_adapter, self._session_resolver - - def _executor_instance(self) -> AgentRuntimeExecutor: - if self._executor is None: - self._executor = AgentRuntimeExecutor(_build_llm()) - return self._executor - - -def _ms(started: float) -> int: - return 0 - - -def _sub_intent_from_result(result: PipelineResult) -> str | None: - router_plan = dict(result.diagnostics.get("router_plan") or {}) - value = str(router_plan.get("sub_intent") or "").strip() - return value or None - - -def _answer_status(answer_mode: str, llm_used: bool) -> str: - if answer_mode == "normal" and llm_used: - return "answered" - return answer_mode - - -def _build_llm() -> AgentLlmService: - settings = GigaChatSettings.from_env() - client = GigaChatClient(settings, GigaChatTokenProvider(settings)) - return AgentLlmService(client=client, prompts=PromptLoader()) diff --git a/tests/pipeline_setup/suite_02_pipeline/pipeline_intent_rag/helpers/session_resolver.py b/tests/pipeline_setup/suite_02_pipeline/pipeline_intent_rag/helpers/session_resolver.py deleted file mode 100644 index a4fd40e..0000000 --- a/tests/pipeline_setup/suite_02_pipeline/pipeline_intent_rag/helpers/session_resolver.py +++ /dev/null @@ -1,37 +0,0 @@ -from __future__ import annotations - -from pathlib import Path - -from app.modules.rag.persistence.repository import RagRepository -from tests.pipeline_setup.suite_02_pipeline.pipeline_intent_rag.helpers.models import PhraseCase -from tests.pipeline_setup.suite_02_pipeline.pipeline_intent_rag.helpers.pipeline_config import PipelineRunConfig -from tests.pipeline_setup.utils.rag_indexer import RagSessionIndexer - - -class RagSessionResolver: - def __init__(self, config: PipelineRunConfig, repository: RagRepository) -> None: - self._config = config - self._repository = repository - self._indexed_session_id: str | None = None - - def resolve(self, case: PhraseCase) -> str: - if self._config.forced_rag_session_id: - return self._config.forced_rag_session_id - if self._config.reindex_repo_path: - return self._resolve_from_reindex(self._config.reindex_repo_path) - if case.rag_session_id: - return case.rag_session_id - if self._config.default_rag_session_id: - return self._config.default_rag_session_id - raise ValueError( - f"Case '{case.case_id}' has no rag_session_id and INTENT_PIPELINE_RAG_SESSION_ID is not set" - ) - - def _resolve_from_reindex(self, repo_path: Path) -> str: - if self._indexed_session_id: - return self._indexed_session_id - self._indexed_session_id = RagSessionIndexer(self._repository).index_repo( - repo_path=repo_path, - project_id=self._config.reindex_project_id, - ) - return self._indexed_session_id diff --git a/tests/pipeline_setup/suite_02_pipeline/pipeline_intent_rag/test_answer_quality.py b/tests/pipeline_setup/suite_02_pipeline/pipeline_intent_rag/test_answer_quality.py deleted file mode 100644 index 7a8fbb4..0000000 --- a/tests/pipeline_setup/suite_02_pipeline/pipeline_intent_rag/test_answer_quality.py +++ /dev/null @@ -1,32 +0,0 @@ -from __future__ import annotations - -from tests.pipeline_setup.suite_02_pipeline.pipeline_intent_rag.helpers.answer_quality import AnswerQualityController - - -def test_quality_controller_removes_meta_and_empty_candidate_sections() -> None: - controller = AnswerQualityController() - - answer = ( - "В файле видны импорты из различных подпакетов. " - "Ответ основан исключительно на содержимом указанного файла. " - "Кандидаты на health-endpoint: - Нет явных неподтвержденных кандидатов." - ) - - cleaned = controller.refine(answer, sub_intent="FIND_ENTRYPOINTS") - - assert "различных подпакетов" not in cleaned - assert "Ответ основан исключительно" not in cleaned - assert "Нет явных неподтвержденных кандидатов" not in cleaned - - -def test_quality_controller_trims_speculation_after_not_found() -> None: - controller = AnswerQualityController() - - answer = ( - "Сущность RuntimeFactoryManager не найдена в доступном коде. " - "Исходя из названия, вероятно этот класс управляет фабриками runtime." - ) - - cleaned = controller.refine(answer, sub_intent="EXPLAIN") - - assert cleaned == "Сущность RuntimeFactoryManager не найдена в доступном коде." diff --git a/tests/pipeline_setup/suite_02_pipeline/pipeline_intent_rag/test_canonical_code_qa_pipeline.py b/tests/pipeline_setup/suite_02_pipeline/pipeline_intent_rag/test_canonical_code_qa_pipeline.py deleted file mode 100644 index 27dff15..0000000 --- a/tests/pipeline_setup/suite_02_pipeline/pipeline_intent_rag/test_canonical_code_qa_pipeline.py +++ /dev/null @@ -1,201 +0,0 @@ -"""Tests for the canonical CODE_QA pipeline (IntentRouterV2 -> retrieval -> evidence -> diagnostics).""" - -from __future__ import annotations - -from pathlib import Path - -import pytest - -from app.modules.agent.runtime.steps.context import ( - CodeChunkItem, - EvidenceBundle, - RetrievalRequest, - RetrievalResult, - build_retrieval_request, - build_retrieval_result, -) -from app.modules.agent.runtime.steps.gates.pre.evidence_gate import evaluate_evidence -from app.modules.agent.runtime.legacy_pipeline import CodeQAPipelineRunner -from app.modules.agent.intent_router_v2 import ConversationState, IntentRouterV2 -from tests.unit_tests.rag.intent_router_testkit import repo_context - -_TEST_ROOT = Path(__file__).resolve().parent - - -def _make_router() -> IntentRouterV2: - return IntentRouterV2() - - -def test_router_output_drives_retrieval_request() -> None: - """Router output is directly convertible into RetrievalRequest.""" - router = _make_router() - text = "Открой файл src/mail_order_bot/context.py" - result = router.route(text, ConversationState(), repo_context()) - request = build_retrieval_request(result, "test-session-id") - assert request.rag_session_id == "test-session-id" - assert request.query - assert request.sub_intent == "OPEN_FILE" - assert "context.py" in str(request.path_scope) or request.path_scope - assert "C0_SOURCE_CHUNKS" in request.requested_layers or request.requested_layers - - -def test_retrieval_result_normalized_structure() -> None: - """Retrieval returns normalized RetrievalResult with expected fields.""" - raw = [ - {"layer": "C0_SOURCE_CHUNKS", "path": "src/foo.py", "title": "", "content": "def bar(): pass", "span_start": 1, "span_end": 2, "metadata": {}}, - {"layer": "C1_SYMBOL_CATALOG", "path": "src/foo.py", "title": "bar", "content": "", "metadata": {"symbol_id": "s1"}}, - ] - report = {"executed_layers": ["C0_SOURCE_CHUNKS", "C1_SYMBOL_CATALOG"], "fallback": {"used": False}} - sym = {"status": "resolved", "resolved_symbol": "bar"} - result = build_retrieval_result(raw, report, sym) - assert len(result.code_chunks) == 2 - assert result.resolved_symbol == "bar" - assert result.symbol_resolution_status == "resolved" - assert any(c.layer == "C1_SYMBOL_CATALOG" for c in result.code_chunks) - assert len(result.layer_outcomes) == 2 - - -def test_evidence_gate_open_file_sufficient() -> None: - """OPEN_FILE with resolved path and chunks passes evidence gate.""" - chunk = CodeChunkItem( - layer="C0_SOURCE_CHUNKS", - path="src/context.py", - title="", - content="x", - start_line=1, - end_line=2, - metadata={}, - ) - bundle = EvidenceBundle( - resolved_sub_intent="OPEN_FILE", - resolved_target="src/context.py", - file_candidates=["src/context.py"], - evidence_count=2, - code_chunks=[chunk, chunk], - ) - decision = evaluate_evidence(bundle) - assert decision.passed is True - assert not decision.failure_reasons - - -def test_evidence_gate_open_file_insufficient() -> None: - """OPEN_FILE with no path and no chunks fails evidence gate.""" - bundle = EvidenceBundle( - resolved_sub_intent="OPEN_FILE", - resolved_target=None, - file_candidates=[], - evidence_count=0, - ) - decision = evaluate_evidence(bundle) - assert decision.passed is False - assert "path_scope_empty" in decision.failure_reasons or "layer_c0_empty" in decision.failure_reasons - assert decision.degraded_message - - -def test_evidence_gate_explain_insufficient() -> None: - """EXPLAIN with no symbol resolution and few chunks fails.""" - bundle = EvidenceBundle( - resolved_sub_intent="EXPLAIN", - resolved_target=None, - target_type="symbol", - evidence_count=1, - ) - decision = evaluate_evidence(bundle) - assert decision.passed is False - assert "insufficient_evidence" in decision.failure_reasons or "target_not_resolved" in decision.failure_reasons - - -def test_evidence_gate_find_entrypoints_insufficient() -> None: - """FIND_ENTRYPOINTS with no entrypoints fails.""" - bundle = EvidenceBundle( - resolved_sub_intent="FIND_ENTRYPOINTS", - entrypoints=[], - evidence_count=0, - ) - decision = evaluate_evidence(bundle) - assert decision.passed is False - assert "entrypoints_not_found" in decision.failure_reasons - - -def test_evidence_gate_find_tests_insufficient() -> None: - """FIND_TESTS with no test candidates fails.""" - bundle = EvidenceBundle( - resolved_sub_intent="FIND_TESTS", - resolved_target="Context", - target_symbol_candidates=["Context"], - test_evidence=[], - evidence_count=1, - ) - decision = evaluate_evidence(bundle) - assert decision.passed is False - assert "tests_not_found" in decision.failure_reasons - - -def test_diagnostics_report_has_failure_reasons() -> None: - """Diagnostics report includes machine-readable failure reasons.""" - from app.modules.agent.runtime.steps.context import build_diagnostics_report, build_evidence_bundle - - router = _make_router() - text = "Где тесты для НесуществующийКласс?" - result = router.route(text, ConversationState(), repo_context()) - request = build_retrieval_request(result, "test-session") - retrieval_result = build_retrieval_result([], {}, {"status": "not_found"}) - bundle = build_evidence_bundle(retrieval_result, result) - evaluate_evidence(bundle) - report = build_diagnostics_report( - router_result=result, - retrieval_request=request, - retrieval_result=retrieval_result, - evidence_bundle=bundle, - answer_mode="degraded", - ) - assert report.answer_mode in ("normal", "degraded", "insufficient") - assert report.per_layer_outcome is not None - assert report.router_result - assert report.retrieval_request - - -def test_canonical_pipeline_with_fake_adapter() -> None: - """Canonical pipeline runs end-to-end with fake adapter; diagnostics and evidence gate applied.""" - - class FakeAdapter: - def __init__(self, rows: list[dict]) -> None: - self._rows = rows - self._report: dict | None = None - - def retrieve_with_plan(self, rag_session_id: str, query: str, retrieval_spec, retrieval_constraints=None, *, query_plan=None) -> list[dict]: - layers = [str(q.layer_id) for q in (retrieval_spec.layer_queries or [])] - self._report = {"executed_layers": layers, "fallback": {"used": False}, "retrieval_by_layer_ms": {}} - return list(self._rows) - - def retrieve_exact_files(self, rag_session_id: str, *, repo_id=None, paths: list, layers=None, limit=200, query="", ranking_profile="") -> list[dict]: - self._report = {"executed_layers": list(layers or ["C0_SOURCE_CHUNKS"]), "fallback": {"used": False}} - return [r for r in self._rows if r.get("path") in paths] - - def hydrate_resolved_symbol_sources(self, rag_session_id: str, base_query: str, rag_rows: list, symbol_resolution: dict, retrieval_spec, retrieval_constraints=None) -> list[dict]: - return list(rag_rows) - - def force_symbol_context_c0(self, rag_session_id: str, *, rag_rows: list, symbol_resolution: dict, limit=20) -> list[dict]: - return list(rag_rows) - - def consume_retrieval_report(self) -> dict | None: - r, self._report = self._report, None - return r - - two_chunks = [ - {"layer": "C0_SOURCE_CHUNKS", "path": "src/context.py", "content": "class Context:", "span_start": 1, "span_end": 2, "metadata": {}}, - {"layer": "C0_SOURCE_CHUNKS", "path": "src/context.py", "content": "def run(self): pass", "span_start": 3, "span_end": 4, "metadata": {}}, - ] - adapter = FakeAdapter(two_chunks) - router = _make_router() - runner = CodeQAPipelineRunner(router=router, retrieval_adapter=adapter, repo_context=repo_context()) - result = runner.run("Открой файл src/context.py", "test-session", run_retrieval=True) - assert result.router_result is not None - assert result.retrieval_request is not None - assert result.retrieval_result is not None - assert result.evidence_bundle is not None - assert result.diagnostics_report is not None - assert result.answer_mode in ("normal", "degraded", "insufficient") - assert result.retrieval_result.code_chunks - assert result.diagnostics_report.router_result - assert result.diagnostics_report.retrieval_request diff --git a/tests/pipeline_setup/suite_02_pipeline/pipeline_intent_rag/test_cli.py b/tests/pipeline_setup/suite_02_pipeline/pipeline_intent_rag/test_cli.py deleted file mode 100644 index 9fb7df1..0000000 --- a/tests/pipeline_setup/suite_02_pipeline/pipeline_intent_rag/test_cli.py +++ /dev/null @@ -1,65 +0,0 @@ -from __future__ import annotations - -from tests.pipeline_setup.suite_02_pipeline.pipeline_intent_rag.cli import ReindexCliArgs, RunCliArgs, _parse_args - - -def test_cli_parse_run_defaults_with_legacy_syntax() -> None: - parsed = _parse_args(["--mode", "router_only"]) - assert parsed.command == "run" - assert isinstance(parsed.payload, RunCliArgs) - args = parsed.payload - - assert args.mode == "router_only" - assert args.case_ids == () - assert args.test_name == "cli_router_only" - assert args.verbose is False - - -def test_cli_parse_run_with_overrides() -> None: - parsed = _parse_args( - [ - "run", - "--mode", - "router_rag", - "--case-id", - "c1", - "--case-id", - "c2", - "--rag-session-id", - "sid-1", - "--reindex-repo-path", - "/tmp/repo", - "--reindex-project-id", - "proj-1", - "--test-name", - "run-x", - ] - ) - assert parsed.command == "run" - assert isinstance(parsed.payload, RunCliArgs) - args = parsed.payload - - assert args.mode == "router_rag" - assert args.case_ids == ("c1", "c2") - assert args.rag_session_id == "sid-1" - assert args.reindex_repo_path == "/tmp/repo" - assert args.reindex_project_id == "proj-1" - assert args.test_name == "run-x" - assert args.verbose is False - - -def test_cli_parse_run_verbose_alias() -> None: - parsed = _parse_args(["run", "--mode", "router_rag", "--debug"]) - assert parsed.command == "run" - assert isinstance(parsed.payload, RunCliArgs) - assert parsed.payload.verbose is True - - -def test_cli_parse_reindex() -> None: - parsed = _parse_args(["reindex", "--repo-path", "/tmp/repo", "--project-id", "proj-1"]) - assert parsed.command == "reindex" - assert isinstance(parsed.payload, ReindexCliArgs) - args = parsed.payload - - assert args.repo_path == "/tmp/repo" - assert args.project_id == "proj-1" diff --git a/tests/pipeline_setup/suite_02_pipeline/pipeline_intent_rag/test_code_qa_answer_boundary.py b/tests/pipeline_setup/suite_02_pipeline/pipeline_intent_rag/test_code_qa_answer_boundary.py deleted file mode 100644 index 24074f1..0000000 --- a/tests/pipeline_setup/suite_02_pipeline/pipeline_intent_rag/test_code_qa_answer_boundary.py +++ /dev/null @@ -1,326 +0,0 @@ -from __future__ import annotations - -import json - -from app.modules.agent.runtime.steps.gates.post.post_gate import RuntimePostEvidenceGate -from app.modules.agent.runtime.steps.generation.prompt_payload_builder import RuntimePromptPayloadBuilder -from app.modules.agent.runtime.steps.context import ( - build_answer_synthesis_input, - build_retrieval_result, - CodeChunkItem, - EvidenceBundle, -) - - -def test_retrieval_result_separates_semantic_hints_and_relations() -> None: - raw = [ - { - "layer": "C2_DEPENDENCY_GRAPH", - "path": "src/runtime.py", - "content": "RuntimeManager calls TraceService", - "span_start": 10, - "span_end": 10, - "metadata": {"edge_type": "calls", "src_qname": "RuntimeManager.start", "dst_ref": "TraceService.record"}, - }, - { - "layer": "C4_SEMANTIC_ROLES", - "path": "src/runtime.py", - "title": "RuntimeManager", - "content": "role: orchestrator", - "span_start": 1, - "span_end": 20, - "metadata": {"symbol_name": "RuntimeManager", "role": "orchestrator", "confidence": 0.7}, - }, - ] - result = build_retrieval_result(raw, {"executed_layers": ["C2_DEPENDENCY_GRAPH", "C4_SEMANTIC_ROLES"]}, {"status": "resolved"}) - assert result.relations[0]["edge_type"] == "calls" - assert result.relations[0]["source"] == "RuntimeManager.start" - assert result.semantic_hints[0]["role"] == "orchestrator" - - -def test_answer_synthesis_curates_explain_facts_and_demotes_c4() -> None: - bundle = EvidenceBundle( - resolved_sub_intent="EXPLAIN", - resolved_target="RuntimeManager", - target_type="symbol", - evidence_count=4, - sufficient=True, - code_chunks=[ - CodeChunkItem( - layer="C1_SYMBOL_CATALOG", - path="src/runtime.py", - title="RuntimeManager.__init__", - content="__init__(self, tracer, registry)", - start_line=1, - end_line=3, - metadata={"qname": "RuntimeManager.__init__", "kind": "method", "signature": "__init__(self, tracer, registry)"}, - ), - CodeChunkItem( - layer="C0_SOURCE_CHUNKS", - path="src/runtime.py", - title="", - content="self.tracer = tracer\nself.registry = registry\nself.tracer.record()\n", - start_line=1, - end_line=4, - metadata={}, - ), - CodeChunkItem( - layer="C4_SEMANTIC_ROLES", - path="src/runtime.py", - title="RuntimeManager", - content="role: orchestrator", - start_line=1, - end_line=4, - metadata={"symbol_name": "RuntimeManager", "role": "orchestrator"}, - ), - ], - relations=[ - { - "path": "src/runtime.py", - "start_line": 3, - "end_line": 3, - "metadata": {"edge_type": "calls", "src_qname": "RuntimeManager.__init__", "dst_ref": "self.tracer.record"}, - } - ], - ) - synthesis = build_answer_synthesis_input("Explain RuntimeManager", bundle) - explain = synthesis.curated_facts["explain"] - assert "RuntimeManager.__init__" in explain["required_methods"] - assert "tracer" in explain["required_constructor_args"] - assert "record" in synthesis.deep_context or "self.tracer.record" in json.dumps(explain) - assert "orchestrator" not in synthesis.deep_context - assert synthesis.semantic_hints[0]["role"] == "orchestrator" - - -def test_prompt_payload_builder_adds_explain_constraints() -> None: - bundle = EvidenceBundle(resolved_sub_intent="EXPLAIN", resolved_target="RuntimeManager") - synthesis = build_answer_synthesis_input( - "Explain RuntimeManager", - EvidenceBundle( - resolved_sub_intent="EXPLAIN", - resolved_target="RuntimeManager", - code_chunks=[ - CodeChunkItem( - layer="C1_SYMBOL_CATALOG", - path="src/runtime.py", - title="RuntimeManager.start", - content="start(self)", - metadata={"qname": "RuntimeManager.start", "kind": "method", "signature": "start(self)"}, - ) - ], - evidence_count=1, - ), - ) - payload = json.loads( - RuntimePromptPayloadBuilder().build( - user_query="Explain RuntimeManager", - synthesis_input=synthesis, - evidence_pack=bundle, - answer_mode="normal", - ) - ) - assert "must_mention_methods" in payload - assert "RuntimeManager.start" in payload["must_mention_methods"] - assert payload["must_not_infer_missing_details"] is True - - -def test_prompt_payload_builder_adds_trace_flow_constraints() -> None: - synthesis = build_answer_synthesis_input( - "Trace RuntimeManager", - EvidenceBundle( - resolved_sub_intent="TRACE_FLOW", - resolved_target="RuntimeManager", - relations=[ - { - "path": "src/runtime.py", - "start_line": 10, - "metadata": {"edge_type": "calls", "src_qname": "RuntimeManager.start", "dst_ref": "TraceService.record"}, - }, - { - "path": "src/runtime.py", - "start_line": 11, - "metadata": {"edge_type": "calls", "src_qname": "TraceService.record", "dst_ref": "Registry.register"}, - }, - ], - evidence_count=2, - ), - ) - payload = json.loads( - RuntimePromptPayloadBuilder().build( - user_query="Trace RuntimeManager", - synthesis_input=synthesis, - evidence_pack=EvidenceBundle(resolved_sub_intent="TRACE_FLOW", resolved_target="RuntimeManager"), - answer_mode="normal", - ) - ) - assert payload["must_mention_flow_steps"] - assert payload["must_avoid_overclaiming_full_flow"] is True - - -def test_post_gate_rejects_vague_explain_without_concrete_facts() -> None: - bundle = EvidenceBundle( - resolved_sub_intent="EXPLAIN", - resolved_target="RuntimeManager", - evidence_count=3, - code_chunks=[ - CodeChunkItem( - layer="C1_SYMBOL_CATALOG", - path="src/runtime.py", - title="RuntimeManager.start", - content="start(self)", - metadata={"qname": "RuntimeManager.start", "kind": "method", "signature": "start(self)"}, - ) - ], - relations=[ - { - "path": "src/runtime.py", - "metadata": {"edge_type": "calls", "src_qname": "RuntimeManager.start", "dst_ref": "TraceService.record"}, - } - ], - ) - result = RuntimePostEvidenceGate().validate( - answer="RuntimeManager имеет responsibilities и управляет системой.", - answer_mode="normal", - degraded_message="", - sub_intent="EXPLAIN", - user_query="Explain RuntimeManager", - evidence_pack=bundle, - ) - assert result.passed is False - assert "missing_concrete_methods" in result.reasons - assert "too_vague_for_explain" in result.reasons - - -def test_post_gate_accepts_explain_with_method_alias_and_call() -> None: - bundle = EvidenceBundle( - resolved_sub_intent="EXPLAIN", - resolved_target="RuntimeManager", - evidence_count=3, - code_chunks=[ - CodeChunkItem( - layer="C1_SYMBOL_CATALOG", - path="src/runtime.py", - title="RuntimeManager.start", - content="start(self)", - metadata={"qname": "RuntimeManager.start", "kind": "method", "signature": "start(self)"}, - ) - ], - relations=[ - { - "path": "src/runtime.py", - "metadata": {"edge_type": "calls", "src_qname": "RuntimeManager.start", "dst_ref": "TraceService.record"}, - } - ], - ) - result = RuntimePostEvidenceGate().validate( - answer="RuntimeManager запускает работу через метод start(), а затем вызывает record() у TraceService.", - answer_mode="normal", - degraded_message="", - sub_intent="EXPLAIN", - user_query="Explain RuntimeManager", - evidence_pack=bundle, - ) - assert result.passed is True - - -def test_post_gate_requires_architecture_relations() -> None: - bundle = EvidenceBundle( - resolved_sub_intent="ARCHITECTURE", - resolved_target="RuntimeManager", - evidence_count=3, - code_chunks=[ - CodeChunkItem(layer="C1_SYMBOL_CATALOG", path="src/runtime.py", title="RuntimeManager", content="", metadata={"qname": "RuntimeManager", "kind": "class"}), - CodeChunkItem(layer="C4_SEMANTIC_ROLES", path="src/runtime.py", title="RuntimeManager", content="", metadata={"symbol_name": "RuntimeManager", "role": "orchestrator"}), - ], - relations=[ - { - "path": "src/runtime.py", - "metadata": {"edge_type": "calls", "src_qname": "RuntimeManager.start", "dst_ref": "TraceService.record"}, - } - ], - ) - gate = RuntimePostEvidenceGate() - vague = gate.validate( - answer="RuntimeManager и TraceService образуют центральный компонент runtime.", - answer_mode="normal", - degraded_message="", - sub_intent="ARCHITECTURE", - user_query="Architecture of RuntimeManager", - evidence_pack=bundle, - ) - concrete = gate.validate( - answer="RuntimeManager.start вызывает TraceService.record в src/runtime.py.", - answer_mode="normal", - degraded_message="", - sub_intent="ARCHITECTURE", - user_query="Architecture of RuntimeManager", - evidence_pack=bundle, - ) - assert vague.passed is False - assert "missing_relation_verbs" in vague.reasons or "missing_concrete_relations" in vague.reasons - assert concrete.passed is True - - -def test_post_gate_rejects_architecture_with_retrieval_labels() -> None: - bundle = EvidenceBundle( - resolved_sub_intent="ARCHITECTURE", - resolved_target="RuntimeManager", - evidence_count=2, - relations=[ - { - "path": "src/runtime.py", - "metadata": {"edge_type": "calls", "src_qname": "RuntimeManager.start", "dst_ref": "TraceService.dataflow_slice"}, - } - ], - ) - result = RuntimePostEvidenceGate().validate( - answer="RuntimeManager связан с dataflow_slice и строит вокруг него архитектуру.", - answer_mode="normal", - degraded_message="", - sub_intent="ARCHITECTURE", - user_query="Architecture of RuntimeManager", - evidence_pack=bundle, - ) - assert result.passed is False - assert "contains_retrieval_artifacts" in result.reasons - - -def test_post_gate_trace_flow_requires_sequence_and_blocks_overclaim() -> None: - bundle = EvidenceBundle( - resolved_sub_intent="TRACE_FLOW", - resolved_target="RuntimeManager", - evidence_count=3, - relations=[ - { - "path": "src/runtime.py", - "start_line": 10, - "metadata": {"edge_type": "calls", "src_qname": "RuntimeManager.start", "dst_ref": "TraceService.record"}, - }, - { - "path": "src/runtime.py", - "start_line": 11, - "metadata": {"edge_type": "calls", "src_qname": "TraceService.record", "dst_ref": "Registry.register"}, - }, - ], - ) - gate = RuntimePostEvidenceGate() - vague = gate.validate( - answer="RuntimeManager инициализирует службы и полностью восстанавливается.", - answer_mode="normal", - degraded_message="", - sub_intent="TRACE_FLOW", - user_query="Trace RuntimeManager", - evidence_pack=bundle, - ) - concrete = gate.validate( - answer="Сначала RuntimeManager.start вызывает TraceService.record, затем TraceService.record вызывает Registry.register.", - answer_mode="normal", - degraded_message="", - sub_intent="TRACE_FLOW", - user_query="Trace RuntimeManager", - evidence_pack=bundle, - ) - assert vague.passed is False - assert "missing_flow_steps" in vague.reasons or "too_vague_for_trace_flow" in vague.reasons - assert "overclaims_trace_completeness" in vague.reasons - assert concrete.passed is True diff --git a/tests/pipeline_setup/suite_02_pipeline/pipeline_intent_rag/test_diagnostics_jsonl.py b/tests/pipeline_setup/suite_02_pipeline/pipeline_intent_rag/test_diagnostics_jsonl.py deleted file mode 100644 index 6ef9b87..0000000 --- a/tests/pipeline_setup/suite_02_pipeline/pipeline_intent_rag/test_diagnostics_jsonl.py +++ /dev/null @@ -1,368 +0,0 @@ -from __future__ import annotations - -from dataclasses import dataclass -from datetime import datetime - -from app.modules.agent.intent_router_v2.models import ( - CodeRetrievalFilters, - EvidencePolicy, - IntentRouterResult, - LayerQuery, - QueryPlan, - RetrievalConstraints, - RetrievalSpec, - SymbolResolution, -) -from tests.pipeline_setup.suite_02_pipeline.pipeline_intent_rag.helpers.models import PhraseCase -from tests.pipeline_setup.suite_02_pipeline.pipeline_intent_rag.helpers.pipeline_runner import IntentRouterRagPipelineRunner, RouterOnlyRunner - - -@dataclass(slots=True) -class _StaticRouter: - result: IntentRouterResult - - def route(self, *_args, **_kwargs) -> IntentRouterResult: - return self.result - - -class _StaticSessionResolver: - def resolve(self, _case: PhraseCase) -> str: - return "rag-1" - - -class _FakeRagAdapter: - def __init__(self, rows: list[dict]) -> None: - self._rows = rows - self._last_report: dict | None = None - self.exact_calls = 0 - - def retrieve(self, rag_session_id: str, query: str, retrieval_spec, retrieval_constraints=None) -> list[dict]: - path_scope = list(getattr(retrieval_spec.filters, "path_scope", []) or []) - self._last_report = { - "executed_layers": [str(item.layer_id) for item in list(retrieval_spec.layer_queries or [])], - "retrieval_mode_by_layer": {str(item.layer_id): "exact_path_fetch" for item in retrieval_spec.layer_queries}, - "top_k_by_layer": {str(item.layer_id): int(item.top_k) for item in retrieval_spec.layer_queries}, - "filters_by_layer": { - str(item.layer_id): { - "path_scope": list(path_scope), - "include_globs": list(getattr(retrieval_constraints, "include_globs", []) or []), - "exclude_globs": list(getattr(retrieval_constraints, "exclude_globs", []) or []), - "prefer_globs": list(getattr(retrieval_constraints, "prefer_globs", []) or []), - } - for item in retrieval_spec.layer_queries - }, - "requests": [ - { - "layer": str(item.layer_id), - "query": query, - "path_scope": list(path_scope), - "include_globs": list(getattr(retrieval_constraints, "include_globs", []) or []), - "exclude_globs": list(getattr(retrieval_constraints, "exclude_globs", []) or []), - "prefer_globs": list(getattr(retrieval_constraints, "prefer_globs", []) or []), - "top_k": int(item.top_k), - "ranking_profile": str(getattr(retrieval_spec, "rerank_profile", "") or ""), - } - for item in retrieval_spec.layer_queries - ], - "applied": [ - { - "layer": str(item.layer_id), - "effective_path_scope": list(path_scope), - "normalized_include_globs": list(getattr(retrieval_constraints, "include_globs", []) or []), - "normalized_exclude_globs": list(getattr(retrieval_constraints, "exclude_globs", []) or []), - "normalized_prefer_globs": list(getattr(retrieval_constraints, "prefer_globs", []) or []), - "filter_stage": "pre_rank", - "candidates_before_filter": len(self._rows), - "candidates_after_filter": len(self._rows), - } - for item in retrieval_spec.layer_queries - ], - "fallback": {"used": False, "reason": None}, - "retrieval_by_layer_ms": {str(item.layer_id): 1 for item in retrieval_spec.layer_queries}, - } - return list(self._rows) - - def retrieve_with_plan( - self, - rag_session_id: str, - query: str, - retrieval_spec, - retrieval_constraints=None, - *, - query_plan=None, - ) -> list[dict]: - return self.retrieve(rag_session_id, query, retrieval_spec, retrieval_constraints) - - def consume_retrieval_report(self) -> dict | None: - report = self._last_report - self._last_report = None - return report - - def retrieve_exact_files( - self, - *, - rag_session_id: str, - repo_id: str | None = None, - paths: list[str], - layers: list[str] | None = None, - limit: int = 200, - query: str = "", - ranking_profile: str = "", - ) -> list[dict]: - self.exact_calls += 1 - layer = list(layers or ["C0_SOURCE_CHUNKS"])[0] - normalized = list(paths) - matched = [row for row in self._rows if str(row.get("path") or "") in set(normalized)] - self._last_report = { - "executed_layers": [layer], - "retrieval_mode_by_layer": {layer: "exact_path_fetch"}, - "top_k_by_layer": {layer: int(limit)}, - "filters_by_layer": { - layer: { - "path_scope": normalized, - "include_globs": [], - "exclude_globs": [], - "prefer_globs": [], - } - }, - "requests": [ - { - "layer": layer, - "query": query, - "path_scope": normalized, - "include_globs": [], - "exclude_globs": [], - "prefer_globs": [], - "top_k": int(limit), - "ranking_profile": ranking_profile, - } - ], - "applied": [ - { - "layer": layer, - "effective_path_scope": normalized, - "normalized_include_globs": [], - "normalized_exclude_globs": [], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": len(matched), - "candidates_after_filter": len(matched), - } - ], - "fallback": {"used": False, "reason": None}, - "retrieval_by_layer_ms": {layer: 1}, - } - return list(matched) - - def hydrate_resolved_symbol_sources(self, **kwargs) -> list[dict]: - return list(kwargs["rag_rows"]) - - def force_symbol_context_c0(self, rag_session_id: str, *, rag_rows: list[dict], symbol_resolution: dict, limit: int = 20) -> list[dict]: # noqa: ARG002 - return list(rag_rows) - - -def _open_file_result() -> IntentRouterResult: - path_scope = ["src/mail_order_bot/context.py"] - return IntentRouterResult( - intent="CODE_QA", - retrieval_profile="code", - graph_id="CodeQAGraph", - conversation_mode="START", - query_plan=QueryPlan( - raw="Открой файл src/mail_order_bot/context.py", - normalized="Открой файл src/mail_order_bot/context.py", - sub_intent="OPEN_FILE", - keyword_hints=[], - path_hints=list(path_scope), - doc_scope_hints=[], - symbol_candidates=[], - symbol_kind_hint="unknown", - ), - retrieval_spec=RetrievalSpec( - domains=["CODE"], - layer_queries=[LayerQuery(layer_id="C0_SOURCE_CHUNKS", top_k=8)], - filters=CodeRetrievalFilters(test_policy="EXCLUDE", path_scope=list(path_scope), language=[]), - rerank_profile="code", - ), - retrieval_constraints=RetrievalConstraints( - include_globs=list(path_scope), - exclude_globs=["tests/**"], - prefer_globs=[], - test_file_globs=[], - test_symbol_patterns=[], - max_candidates=20, - ), - symbol_resolution=SymbolResolution(status="not_requested"), - evidence_policy=EvidencePolicy(require_spec=False), - ) - - -def _explain_result() -> IntentRouterResult: - return IntentRouterResult( - intent="CODE_QA", - retrieval_profile="code", - graph_id="CodeQAGraph", - conversation_mode="START", - query_plan=QueryPlan( - raw="Объясни как работает Context", - normalized="Объясни как работает Context", - sub_intent="EXPLAIN", - keyword_hints=["Context"], - path_hints=[], - doc_scope_hints=[], - symbol_candidates=["Context"], - symbol_kind_hint="class", - ), - retrieval_spec=RetrievalSpec( - domains=["CODE"], - layer_queries=[LayerQuery(layer_id="C1_SYMBOL_CATALOG", top_k=8), LayerQuery(layer_id="C0_SOURCE_CHUNKS", top_k=8)], - filters=CodeRetrievalFilters(test_policy="EXCLUDE", path_scope=["src/mail_order_bot/context.py"], language=[]), - rerank_profile="code", - ), - retrieval_constraints=RetrievalConstraints( - include_globs=["src/**"], - exclude_globs=["tests/**"], - prefer_globs=[], - test_file_globs=[], - test_symbol_patterns=[], - max_candidates=20, - ), - symbol_resolution=SymbolResolution(status="pending", alternatives=["Context"], confidence=0.0), - evidence_policy=EvidencePolicy(require_spec=False), - ) - - -def test_router_only_diagnostics_contains_router_plan() -> None: - case = PhraseCase(case_id="c1", text="Открой файл src/mail_order_bot/context.py") - runner = RouterOnlyRunner(started_at=datetime(2026, 3, 5, 12, 0, 0), router=_StaticRouter(_open_file_result())) - - record = runner.run_case(case).to_record() - - assert record["summary"]["router"]["intent"] == "CODE_QA" - assert record["summary"]["llm"]["answer_status"] == "partial" - assert record["diagnostics"]["router_plan"]["sub_intent"] == "OPEN_FILE" - assert record["diagnostics"]["router"]["conversation_mode"] == "START" - assert record["diagnostics"]["llm"]["used_evidence_count"] == 0 - assert record["diagnostics"]["execution"]["executed_layers"] == [] - assert record["diagnostics"]["retrieval"] is None - assert record["diagnostics"]["timings_ms"]["router"] >= 0 - - -def test_router_rag_diagnostics_keeps_plan_and_request_scope() -> None: - case = PhraseCase(case_id="c2", text="Открой файл src/mail_order_bot/context.py") - route_result = _open_file_result() - rag_adapter = _FakeRagAdapter( - rows=[ - { - "path": "src/mail_order_bot/context.py", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/mail_order_bot/context.py:1-10", - "content": "class Context: ...", - "metadata": {"repo_id": "MailOrderBot"}, - } - ] - ) - runner = IntentRouterRagPipelineRunner( - started_at=datetime(2026, 3, 5, 12, 0, 0), - rag_adapter=rag_adapter, - session_resolver=_StaticSessionResolver(), - router=_StaticRouter(route_result), - ) - - record = runner.run_case(case).to_record() - diagnostics = record["diagnostics"] - - assert record["summary"]["retrieval"]["layers_hit"] == ["C0_SOURCE_CHUNKS"] - assert diagnostics["router_plan"]["path_scope"] == ["src/mail_order_bot/context.py"] - assert diagnostics["router_plan"]["retrieval_constraints"]["include_globs"] == ["src/mail_order_bot/context.py"] - assert diagnostics["retrieval"]["requests"][0]["path_scope"] == diagnostics["router_plan"]["path_scope"] - assert diagnostics["retrieval"]["symbol_resolution"]["status"] == "not_requested" - assert diagnostics["retrieval"]["layers"][0]["layer"] == "C0_SOURCE_CHUNKS" - assert diagnostics["retrieval"]["fallback"]["used"] is False - assert rag_adapter.exact_calls == 1 - - -def test_open_file_strict_exact_path_returns_only_target_and_no_violation() -> None: - case = PhraseCase(case_id="c4", text="Открой файл src/mail_order_bot/context.py") - rag_adapter = _FakeRagAdapter( - rows=[ - { - "path": "src/mail_order_bot/context.py", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/mail_order_bot/context.py:1-10", - "content": "class Context: ...", - "metadata": {"repo_id": "MailOrderBot"}, - }, - { - "path": "src/mail_order_bot/other.py", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/mail_order_bot/other.py:1-10", - "content": "def helper(): ...", - "metadata": {"repo_id": "MailOrderBot"}, - }, - ] - ) - runner = IntentRouterRagPipelineRunner( - started_at=datetime(2026, 3, 5, 12, 0, 0), - rag_adapter=rag_adapter, - session_resolver=_StaticSessionResolver(), - router=_StaticRouter(_open_file_result()), - ) - - result = runner.run_case(case) - record = result.to_record() - diagnostics = record["diagnostics"] - - assert result.rag_rows - assert all(str(row.get("path") or "") == "src/mail_order_bot/context.py" for row in result.rag_rows) - assert diagnostics["execution"]["filters_by_layer"]["C0_SOURCE_CHUNKS"]["path_scope"] == [ - "src/mail_order_bot/context.py" - ] - assert diagnostics["retrieval"]["applied"][0]["effective_path_scope"] == ["src/mail_order_bot/context.py"] - assert diagnostics["retrieval"]["fallback"]["used"] is False - assert diagnostics["constraint_violations"] == [] - - -def test_router_rag_open_file_violation_is_reported_when_target_file_not_returned() -> None: - case = PhraseCase(case_id="c3", text="Открой файл src/mail_order_bot/context.py") - rag_adapter = _FakeRagAdapter( - rows=[ - { - "path": "src/mail_order_bot/other.py", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/mail_order_bot/other.py:1-10", - "content": "def helper(): ...", - "metadata": {"repo_id": "MailOrderBot"}, - } - ] - ) - runner = IntentRouterRagPipelineRunner( - started_at=datetime(2026, 3, 5, 12, 0, 0), - rag_adapter=rag_adapter, - session_resolver=_StaticSessionResolver(), - router=_StaticRouter(_open_file_result()), - ) - - record = runner.run_case(case).to_record() - violation_types = [item["type"] for item in record["diagnostics"]["constraint_violations"]] - - assert "PATH_SCOPE_NOT_SATISFIED" in violation_types - - -def test_explain_with_symbol_candidates_returns_empty_rag_when_symbol_not_resolved() -> None: - case = PhraseCase(case_id="c5", text="Объясни как работает Context") - rag_adapter = _FakeRagAdapter(rows=[]) - runner = IntentRouterRagPipelineRunner( - started_at=datetime(2026, 3, 5, 12, 0, 0), - rag_adapter=rag_adapter, - session_resolver=_StaticSessionResolver(), - router=_StaticRouter(_explain_result()), - ) - - result = runner.run_case(case) - record = result.to_record() - violation_types = [item["type"] for item in record["diagnostics"]["constraint_violations"]] - - assert result.rag_rows == [] - assert record["diagnostics"]["retrieval"]["fallback"]["used"] is False - assert "SYMBOL_RESOLUTION_FAILED" in violation_types diff --git a/tests/pipeline_setup/suite_02_pipeline/pipeline_intent_rag/test_intent_router_only_matrix.py b/tests/pipeline_setup/suite_02_pipeline/pipeline_intent_rag/test_intent_router_only_matrix.py deleted file mode 100644 index dee8e9c..0000000 --- a/tests/pipeline_setup/suite_02_pipeline/pipeline_intent_rag/test_intent_router_only_matrix.py +++ /dev/null @@ -1,20 +0,0 @@ -from __future__ import annotations - -from pathlib import Path - -import pytest - -from tests.pipeline_setup.suite_02_pipeline.pipeline_intent_rag.helpers.runtime import PipelineRuntime - -_TEST_ROOT = Path(__file__).resolve().parent -_RUNTIME = PipelineRuntime(mode="router_only", test_name="test_intent_router_only_matrix", test_root=_TEST_ROOT) -_CASES = _RUNTIME.load_cases() - - -@pytest.mark.parametrize("case", _CASES, ids=lambda item: item.case_id) -def test_intent_router_only_matrix(case) -> None: - result = _RUNTIME.run_router_only(case) - - assert result.intent in {"CODE_QA", "DOCS_QA", "GENERATE_DOCS_FROM_CODE", "PROJECT_MISC"} - if case.expected_intent: - assert result.intent == case.expected_intent diff --git a/tests/pipeline_setup/suite_02_pipeline/pipeline_intent_rag/test_intent_router_rag_llm_pipeline.py b/tests/pipeline_setup/suite_02_pipeline/pipeline_intent_rag/test_intent_router_rag_llm_pipeline.py deleted file mode 100644 index 1bb333e..0000000 --- a/tests/pipeline_setup/suite_02_pipeline/pipeline_intent_rag/test_intent_router_rag_llm_pipeline.py +++ /dev/null @@ -1,31 +0,0 @@ -from __future__ import annotations - -from pathlib import Path - -import pytest - -from tests.pipeline_setup.suite_02_pipeline.pipeline_intent_rag.helpers.pipeline_config import mode_enabled -from tests.pipeline_setup.suite_02_pipeline.pipeline_intent_rag.helpers.runtime import PipelineRuntime - -pytestmark = pytest.mark.full_chain - -_TEST_ROOT = Path(__file__).resolve().parent -_RUNTIME = PipelineRuntime(mode="full_chain", test_name="test_intent_router_rag_llm_pipeline", test_root=_TEST_ROOT) -_CASES = _RUNTIME.load_cases() - - -@pytest.mark.skipif(not mode_enabled("full_chain", _TEST_ROOT), reason="set RUN_INTENT_PIPELINE_FULL_CHAIN=1 to run") -@pytest.mark.parametrize("case", _CASES, ids=lambda item: item.case_id) -def test_intent_router_rag_llm_pipeline(case) -> None: - pytest.importorskip("sqlalchemy", reason="full_chain integration requires sqlalchemy dependency") - - try: - result = _RUNTIME.run_full_chain(case) - except ValueError as exc: - pytest.skip(str(exc)) - - if case.expected_intent: - assert result.intent == case.expected_intent - if case.expect_non_empty_rag: - assert result.rag_rows, f"RAG returned empty list for case={case.case_id} rag_session_id={result.rag_session_id}" - assert (result.llm_answer or "").strip(), "LLM answer must not be empty" diff --git a/tests/pipeline_setup/suite_02_pipeline/pipeline_intent_rag/test_intent_router_rag_pipeline.py b/tests/pipeline_setup/suite_02_pipeline/pipeline_intent_rag/test_intent_router_rag_pipeline.py deleted file mode 100644 index 3cd75e8..0000000 --- a/tests/pipeline_setup/suite_02_pipeline/pipeline_intent_rag/test_intent_router_rag_pipeline.py +++ /dev/null @@ -1,27 +0,0 @@ -from __future__ import annotations - -from pathlib import Path - -import pytest - -from tests.pipeline_setup.suite_02_pipeline.pipeline_intent_rag.helpers.pipeline_config import mode_enabled -from tests.pipeline_setup.suite_02_pipeline.pipeline_intent_rag.helpers.runtime import PipelineRuntime - -pytestmark = pytest.mark.router_rag - -_TEST_ROOT = Path(__file__).resolve().parent -_RUNTIME = PipelineRuntime(mode="router_rag", test_name="test_intent_router_rag_pipeline", test_root=_TEST_ROOT) -_CASES = _RUNTIME.load_cases() - - -@pytest.mark.skipif(not mode_enabled("router_rag", _TEST_ROOT), reason="set RUN_INTENT_PIPELINE_ROUTER_RAG=1 to run") -@pytest.mark.parametrize("case", _CASES, ids=lambda item: item.case_id) -def test_intent_router_rag_pipeline(case) -> None: - pytest.importorskip("sqlalchemy", reason="router_rag integration requires sqlalchemy dependency") - - result = _RUNTIME.run_router_rag(case) - - if case.expected_intent: - assert result.intent == case.expected_intent - if case.expect_non_empty_rag: - assert result.rag_rows, f"RAG returned empty list for case={case.case_id} rag_session_id={result.rag_session_id}" diff --git a/tests/pipeline_setup/suite_02_pipeline/pipeline_intent_rag/test_llm_answerer_context.py b/tests/pipeline_setup/suite_02_pipeline/pipeline_intent_rag/test_llm_answerer_context.py deleted file mode 100644 index b08a180..0000000 --- a/tests/pipeline_setup/suite_02_pipeline/pipeline_intent_rag/test_llm_answerer_context.py +++ /dev/null @@ -1,80 +0,0 @@ -from __future__ import annotations - -from tests.pipeline_setup.suite_02_pipeline.pipeline_intent_rag.helpers.prompt_payload_builder import PromptPayloadBuilder - - -def test_build_prompt_payload_includes_layer_guide_and_explain_quotas() -> None: - builder = PromptPayloadBuilder() - rag_rows = [ - {"layer": "C1_SYMBOL_CATALOG", "path": "src/context.py", "title": "Context", "content": "class Context"}, - {"layer": "C1_SYMBOL_CATALOG", "path": "src/other.py", "title": "Other", "content": "class Other"}, - {"layer": "C0_SOURCE_CHUNKS", "path": "src/context.py", "title": "Context chunk 1", "content": "def start(self): pass"}, - {"layer": "C0_SOURCE_CHUNKS", "path": "src/context.py", "title": "Context chunk 2", "content": "def stop(self): pass"}, - {"layer": "C0_SOURCE_CHUNKS", "path": "src/context.py", "title": "Context chunk 3", "content": "def status(self): pass"}, - {"layer": "C2_DEPENDENCY_GRAPH", "path": "src/context.py", "title": "Context->Worker", "content": "Context calls Worker"}, - {"layer": "C4_SEMANTIC_ROLES", "path": "src/context.py", "title": "Context", "content": "role: pipeline_stage"}, - {"layer": "C4_SEMANTIC_ROLES", "path": "src/control.py", "title": "ControlChannel", "content": "role: model"}, - {"layer": "C3_ENTRYPOINTS", "path": "src/main.py", "title": "main", "content": "entrypoint"}, - ] - - payload = builder.build( - "Объясни как работает Context", - rag_rows, - prompt_template={"template_id": "t", "system_prompt": "sys", "task_prompt": "task"}, - sub_intent="EXPLAIN", - default_system_prompt="sys-default", - default_task_prompt="task-default", - default_template_id="default", - system_prompt_version="v1", - ) - user_prompt = payload["user_prompt"] - - assert "Как интерпретировать слои RAG" in user_prompt - assert user_prompt.count("[C1_SYMBOL_CATALOG]") == 1 - assert user_prompt.count("[C0_SOURCE_CHUNKS]") == 2 - assert user_prompt.count("[C2_DEPENDENCY_GRAPH]") == 1 - assert user_prompt.count("[C4_SEMANTIC_ROLES]") == 1 - assert user_prompt.count("[C3_ENTRYPOINTS]") == 1 - - -def test_find_entrypoints_prompt_prefers_http_route_rows() -> None: - builder = PromptPayloadBuilder() - rag_rows = [ - { - "layer": "C3_ENTRYPOINTS", - "path": "src/app.py", - "title": "candidate", - "content": "lifecycle start", - "metadata": {"entry_type": "startup"}, - }, - { - "layer": "C3_ENTRYPOINTS", - "path": "src/http_app.py", - "title": "GET /health declared in HttpControlAppFactory", - "content": "raw", - "metadata": { - "http_method": "GET", - "route_path": "/health", - "declaring_symbol": "HttpControlAppFactory", - "handler_symbol": "HttpControlAppFactory.create.health", - "decorator_text": "@app.get('/health')", - "summary_text": "GET /health declared in HttpControlAppFactory", - }, - }, - ] - - payload = builder.build( - "Где health endpoint?", - rag_rows, - prompt_template={"template_id": "t", "system_prompt": "sys", "task_prompt": "task"}, - sub_intent="FIND_ENTRYPOINTS", - default_system_prompt="sys-default", - default_task_prompt="task-default", - default_template_id="default", - system_prompt_version="v1", - ) - user_prompt = payload["user_prompt"] - - assert "GET /health declared in HttpControlAppFactory" in user_prompt - assert "Declared in: HttpControlAppFactory" in user_prompt - assert "Handler: HttpControlAppFactory.create.health" in user_prompt diff --git a/tests/pipeline_setup/suite_02_pipeline/pipeline_intent_rag/test_llm_prompt_catalog.py b/tests/pipeline_setup/suite_02_pipeline/pipeline_intent_rag/test_llm_prompt_catalog.py deleted file mode 100644 index 0609aa5..0000000 --- a/tests/pipeline_setup/suite_02_pipeline/pipeline_intent_rag/test_llm_prompt_catalog.py +++ /dev/null @@ -1,49 +0,0 @@ -from __future__ import annotations - -from pathlib import Path - -from tests.pipeline_setup.suite_02_pipeline.pipeline_intent_rag.helpers.llm_prompt_loader import LlmPromptCatalogLoader - -_PROMPT_CATALOG = Path(__file__).resolve().parents[3] / "pipeline_setup_v2" / "llm_prompts.yaml" - - -def test_prompt_catalog_loads_intent_templates() -> None: - loader = LlmPromptCatalogLoader() - catalog = loader.load(_PROMPT_CATALOG) - - code_prompt = loader.select_for_intent(catalog, "CODE_QA") - - assert code_prompt["template_id"] == "intent_code_qa_v5" - assert "senior Python-инженер" in code_prompt["system_prompt"] - assert "естественным инженерным языком" in code_prompt["task_prompt"] - - -def test_prompt_catalog_prefers_sub_intent_template() -> None: - loader = LlmPromptCatalogLoader() - catalog = loader.load(_PROMPT_CATALOG) - - prompt = loader.select(catalog, intent="CODE_QA", sub_intent="FIND_TESTS") - - assert prompt["template_id"] == "intent_code_qa_find_tests_ru_v4" - assert "тестовое покрытие" in prompt["system_prompt"] - assert "прямых тестов нет" in prompt["task_prompt"] - - -def test_prompt_catalog_falls_back_to_intent_template_for_unknown_sub_intent() -> None: - loader = LlmPromptCatalogLoader() - catalog = loader.load(_PROMPT_CATALOG) - - prompt = loader.select(catalog, intent="CODE_QA", sub_intent="UNKNOWN_SUB_INTENT") - - assert prompt["template_id"] == "intent_code_qa_v5" - assert "естественным инженерным языком" in prompt["task_prompt"] - - -def test_prompt_catalog_falls_back_to_default_for_unknown_intent() -> None: - loader = LlmPromptCatalogLoader() - catalog = loader.load(_PROMPT_CATALOG) - - prompt = loader.select_for_intent(catalog, "UNKNOWN_INTENT") - - assert prompt["template_id"] == "intent_default_v2" - assert "технический ассистент" in prompt["system_prompt"] diff --git a/tests/pipeline_setup/suite_02_pipeline/pipeline_intent_rag/test_phrase_catalog.py b/tests/pipeline_setup/suite_02_pipeline/pipeline_intent_rag/test_phrase_catalog.py deleted file mode 100644 index 7285292..0000000 --- a/tests/pipeline_setup/suite_02_pipeline/pipeline_intent_rag/test_phrase_catalog.py +++ /dev/null @@ -1,25 +0,0 @@ -from __future__ import annotations - -from pathlib import Path - -from tests.pipeline_setup.suite_02_pipeline.pipeline_intent_rag.helpers.phrases_loader import PhraseCatalogLoader - - -def test_phrase_catalog_has_cases_and_unique_ids() -> None: - path = Path(__file__).resolve().parent / "fixtures" / "phrases.yaml" - cases = PhraseCatalogLoader().load(path) - - assert len(cases) >= 5 - case_ids = [item.case_id for item in cases] - assert len(case_ids) == len(set(case_ids)) - assert all(item.text for item in cases) - - -def test_phrase_catalog_has_tags_for_all_iterations() -> None: - path = Path(__file__).resolve().parent / "fixtures" / "phrases.yaml" - loader = PhraseCatalogLoader() - cases = loader.load(path) - - assert loader.filter_by_tag(cases, "router_only") - assert loader.filter_by_tag(cases, "router_rag") - assert loader.filter_by_tag(cases, "full_chain") diff --git a/tests/pipeline_setup/suite_02_pipeline/pipeline_intent_rag/test_rag_db_adapter.py b/tests/pipeline_setup/suite_02_pipeline/pipeline_intent_rag/test_rag_db_adapter.py deleted file mode 100644 index 78721ac..0000000 --- a/tests/pipeline_setup/suite_02_pipeline/pipeline_intent_rag/test_rag_db_adapter.py +++ /dev/null @@ -1,312 +0,0 @@ -from __future__ import annotations - -from dataclasses import dataclass -from types import SimpleNamespace - -from tests.pipeline_setup.suite_02_pipeline.pipeline_intent_rag.helpers.rag_db_adapter import RagDbAdapter - - -@dataclass(slots=True) -class _LayerQuery: - layer_id: str - top_k: int - - -class _FakeDimResolver: - def resolve(self, rag_session_id: str) -> int: # noqa: ARG002 - return 4 - - -class _RecordingRepository: - def __init__(self) -> None: - self.retrieve_calls: list[dict] = [] - self.retrieve_lexical_calls: list[dict] = [] - self.retrieve_exact_calls: list[dict] = [] - - def retrieve(self, rag_session_id: str, query_embedding: list[float], **kwargs) -> list[dict]: # noqa: ARG002 - self.retrieve_calls.append(kwargs) - layer = list(kwargs.get("layers") or [""])[0] - if layer == "C1_SYMBOL_CATALOG": - return [ - { - "path": "src/context.py", - "content": "class Context", - "layer": layer, - "title": "Context", - "span_start": 10, - "span_end": 20, - "metadata": {"symbol_id": "sym-1", "qname": "Context", "kind": "class"}, - }, - { - "path": "src/context.py", - "content": "class Context duplicate", - "layer": layer, - "title": "Context", - "span_start": 10, - "span_end": 20, - "metadata": {"symbol_id": "sym-1", "qname": "Context", "kind": "class"}, - }, - ] - if layer == "C0_SOURCE_CHUNKS": - return [ - { - "path": "src/context.py", - "content": "class Context: ...", - "layer": layer, - "title": "src/context.py:Context", - "span_start": 10, - "span_end": 30, - "metadata": {"chunk_index": 0, "blob_sha": "blob-1"}, - }, - { - "path": "src/context.py", - "content": "class Context: ... duplicate", - "layer": layer, - "title": "src/context.py:Context", - "span_start": 10, - "span_end": 30, - "metadata": {"chunk_index": 1, "blob_sha": "blob-1"}, - }, - ] - if layer == "C2_DEPENDENCY_GRAPH": - return [ - { - "path": "src/context.py", - "content": "Context.set writes_attr Context.data", - "layer": layer, - "title": "Context.set:writes_attr", - "span_start": 40, - "span_end": 40, - "metadata": {"edge_id": "edge-1"}, - } - ] - if layer == "C4_SEMANTIC_ROLES": - return [ - { - "path": "src/context.py", - "content": "Context\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes", - "layer": layer, - "title": "Context", - "span_start": 10, - "span_end": 30, - "lexical_rank": 0, - "structural_rank": 10, - "metadata": {"symbol_name": "Context", "qname": "Context", "role": "pipeline_stage"}, - }, - { - "path": "src/control.py", - "content": "ControlChannel\nrole: model\n\nResponsibilities:\n- default model role", - "layer": layer, - "title": "ControlChannel", - "span_start": 1, - "span_end": 20, - "lexical_rank": 3, - "structural_rank": 40, - "metadata": {"symbol_name": "ControlChannel", "qname": "ControlChannel", "role": "model"}, - }, - ] - return [] - - def retrieve_lexical_code(self, rag_session_id: str, **kwargs) -> list[dict]: # noqa: ARG002 - self.retrieve_lexical_calls.append(kwargs) - return [] - - def retrieve_exact_files( - self, - rag_session_id: str, - *, - repo_id: str | None = None, - paths: list[str], - layers: list[str] | None = None, - limit: int = 200, - ) -> list[dict]: # noqa: ARG002 - self.retrieve_exact_calls.append({"paths": list(paths), "layers": list(layers or []), "limit": limit}) - return [ - { - "path": "src/context.py", - "content": "class Context: ...", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/context.py:Context", - "span_start": 10, - "span_end": 30, - "metadata": {"chunk_index": 0, "blob_sha": "blob-1"}, - }, - { - "path": "src/context.py", - "content": "class Context: duplicate", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/context.py:Context", - "span_start": 10, - "span_end": 30, - "metadata": {"chunk_index": 1, "blob_sha": "blob-1"}, - }, - ] - - -def _spec() -> SimpleNamespace: - return SimpleNamespace( - layer_queries=[ - _LayerQuery(layer_id="C1_SYMBOL_CATALOG", top_k=2), - _LayerQuery(layer_id="C0_SOURCE_CHUNKS", top_k=3), - _LayerQuery(layer_id="C2_DEPENDENCY_GRAPH", top_k=1), - ], - filters=SimpleNamespace(path_scope=[], test_policy="EXCLUDE"), - ) - - -def _constraints() -> SimpleNamespace: - return SimpleNamespace( - include_globs=["src/**"], - exclude_globs=["tests/**"], - prefer_globs=["tests/**"], - test_file_globs=[], - test_symbol_patterns=[], - ) - - -def test_retrieve_applies_per_layer_budget_and_dedupe() -> None: - repository = _RecordingRepository() - adapter = RagDbAdapter(repository=repository, dim_resolver=_FakeDimResolver()) - - rows = adapter.retrieve("rag-1", "Explain Context", _spec(), _constraints()) - - assert [call["limit"] for call in repository.retrieve_calls[:3]] == [2, 3, 1] - assert repository.retrieve_calls[0]["layers"] == ["C1_SYMBOL_CATALOG"] - assert repository.retrieve_calls[1]["layers"] == ["C0_SOURCE_CHUNKS"] - assert repository.retrieve_calls[2]["layers"] == ["C2_DEPENDENCY_GRAPH"] - assert repository.retrieve_calls[0]["prefer_path_prefixes"] == ["tests"] - assert len([row for row in rows if row["layer"] == "C1_SYMBOL_CATALOG"]) == 1 - assert len([row for row in rows if row["layer"] == "C0_SOURCE_CHUNKS"]) == 1 - assert len([row for row in rows if row["layer"] == "C2_DEPENDENCY_GRAPH"]) == 1 - - -def test_hydrate_resolved_symbol_adds_overlapping_c0_chunk() -> None: - repository = _RecordingRepository() - adapter = RagDbAdapter(repository=repository, dim_resolver=_FakeDimResolver()) - rag_rows = [ - { - "path": "src/context.py", - "content": "class Context", - "layer": "C1_SYMBOL_CATALOG", - "title": "Context", - "span_start": 10, - "span_end": 20, - "metadata": {"symbol_id": "sym-1", "qname": "Context", "blob_sha": "blob-1"}, - } - ] - spec = _spec() - constraints = _constraints() - - rows = adapter.hydrate_resolved_symbol_sources( - rag_session_id="rag-1", - base_query="Explain Context", - rag_rows=rag_rows, - symbol_resolution={ - "status": "resolved", - "resolved_symbol": "Context", - "alternatives": ["Context", "Context.set"], - }, - retrieval_spec=spec, - retrieval_constraints=constraints, - ) - - c0_rows = [row for row in rows if row["layer"] == "C0_SOURCE_CHUNKS"] - assert len(c0_rows) == 1 - assert c0_rows[0]["path"] == "src/context.py" - - -def test_retrieve_exact_files_keeps_exact_scope_and_disables_fallback() -> None: - repository = _RecordingRepository() - adapter = RagDbAdapter(repository=repository, dim_resolver=_FakeDimResolver()) - - rows = adapter.retrieve_exact_files( - "rag-1", - paths=["./src//context.py"], - layers=["C0_SOURCE_CHUNKS"], - limit=200, - query="open file", - ranking_profile="code", - ) - report = adapter.consume_retrieval_report() - - assert repository.retrieve_exact_calls[0]["paths"] == ["src/context.py"] - assert repository.retrieve_exact_calls[0]["layers"] == ["C0_SOURCE_CHUNKS"] - assert len(rows) == 1 - assert rows[0]["path"] == "src/context.py" - assert report is not None - assert report["fallback"]["used"] is False - assert report["applied"][0]["effective_path_scope"] == ["src/context.py"] - - -def test_explain_symbol_candidates_use_symbol_query_and_symbol_search_mode() -> None: - repository = _RecordingRepository() - adapter = RagDbAdapter(repository=repository, dim_resolver=_FakeDimResolver()) - spec = _spec() - query_plan = SimpleNamespace(sub_intent="EXPLAIN", symbol_candidates=["Context"], symbol_kind_hint="class") - - rows = adapter.retrieve_with_plan( - "rag-1", - "Объясни как работает Context", - spec, - _constraints(), - query_plan=query_plan, - ) - report = adapter.consume_retrieval_report() - - assert rows - assert repository.retrieve_calls[0]["query_text"] == "Context" - assert report is not None - assert report["retrieval_mode_by_layer"]["C1_SYMBOL_CATALOG"] == "symbol_search" - - -def test_explain_symbol_mode_disables_scope_relaxation_fallback() -> None: - class _NoHitRepository(_RecordingRepository): - def retrieve(self, rag_session_id: str, query_embedding: list[float], **kwargs) -> list[dict]: # noqa: ARG002 - self.retrieve_calls.append(kwargs) - if kwargs.get("path_prefixes") is not None: - return [] - return [{"path": "src/other.py", "layer": "C1_SYMBOL_CATALOG", "title": "Other", "metadata": {"kind": "class"}}] - - repository = _NoHitRepository() - adapter = RagDbAdapter(repository=repository, dim_resolver=_FakeDimResolver()) - spec = SimpleNamespace( - layer_queries=[_LayerQuery(layer_id="C1_SYMBOL_CATALOG", top_k=2)], - filters=SimpleNamespace(path_scope=["src/context.py"], test_policy="EXCLUDE"), - rerank_profile="code", - ) - query_plan = SimpleNamespace(sub_intent="EXPLAIN", symbol_candidates=["Context"], symbol_kind_hint="class") - - rows = adapter.retrieve_with_plan("rag-1", "Explain Context", spec, _constraints(), query_plan=query_plan) - report = adapter.consume_retrieval_report() - - assert rows == [] - assert len(repository.retrieve_calls) == 1 - assert repository.retrieve_calls[0]["path_prefixes"] == ["src/context.py"] - assert report is not None - - -def test_explain_symbol_mode_uses_symbol_query_for_non_c1_layers_and_filters_c4_noise() -> None: - repository = _RecordingRepository() - adapter = RagDbAdapter(repository=repository, dim_resolver=_FakeDimResolver()) - spec = SimpleNamespace( - layer_queries=[ - _LayerQuery(layer_id="C1_SYMBOL_CATALOG", top_k=2), - _LayerQuery(layer_id="C4_SEMANTIC_ROLES", top_k=4), - ], - filters=SimpleNamespace(path_scope=[], test_policy="EXCLUDE"), - rerank_profile="code", - ) - query_plan = SimpleNamespace(sub_intent="EXPLAIN", symbol_candidates=["Context"], symbol_kind_hint="class") - - rows = adapter.retrieve_with_plan("rag-1", "Объясни как работает Context", spec, _constraints(), query_plan=query_plan) - report = adapter.consume_retrieval_report() - - c4_calls = [call for call in repository.retrieve_calls if call["layers"] == ["C4_SEMANTIC_ROLES"]] - c4_rows = [row for row in rows if row["layer"] == "C4_SEMANTIC_ROLES"] - - assert c4_calls - assert c4_calls[0]["query_text"] == "Context" - assert len(c4_rows) == 1 - assert c4_rows[0]["title"] == "Context" - assert report is not None - assert report["fallback"]["used"] is False diff --git a/tests/pipeline_setup/suite_02_pipeline/pipeline_intent_rag/test_repo_indexer_collector.py b/tests/pipeline_setup/suite_02_pipeline/pipeline_intent_rag/test_repo_indexer_collector.py deleted file mode 100644 index 782303b..0000000 --- a/tests/pipeline_setup/suite_02_pipeline/pipeline_intent_rag/test_repo_indexer_collector.py +++ /dev/null @@ -1,18 +0,0 @@ -from __future__ import annotations - -from tests.pipeline_setup.utils.rag_indexer import LocalRepoFileCollector - - -def test_local_repo_file_collector_skips_hidden_and_pycache_paths(tmp_path) -> None: - (tmp_path / ".env").write_text("A=1", encoding="utf-8") - (tmp_path / ".venv").mkdir() - (tmp_path / ".venv" / "lib.py").write_text("x=1", encoding="utf-8") - (tmp_path / "src").mkdir() - (tmp_path / "src" / "__pycache__").mkdir() - (tmp_path / "src" / "__pycache__" / "cache.py").write_text("x=2", encoding="utf-8") - (tmp_path / "src" / ".hidden.py").write_text("x=3", encoding="utf-8") - (tmp_path / "src" / "main.py").write_text("def main():\n return 1\n", encoding="utf-8") - - files = LocalRepoFileCollector(tmp_path).collect() - - assert [item["path"] for item in files] == ["src/main.py"] diff --git a/tests/pipeline_setup/suite_02_pipeline/pipeline_intent_rag/test_router_constraints_contract.py b/tests/pipeline_setup/suite_02_pipeline/pipeline_intent_rag/test_router_constraints_contract.py deleted file mode 100644 index dbb3633..0000000 --- a/tests/pipeline_setup/suite_02_pipeline/pipeline_intent_rag/test_router_constraints_contract.py +++ /dev/null @@ -1,140 +0,0 @@ -from __future__ import annotations - -from pathlib import Path - -from app.modules.agent.intent_router_v2 import ConversationState, IntentRouterV2 -from tests.pipeline_setup.suite_02_pipeline.pipeline_intent_rag.helpers.phrases_loader import PhraseCatalogLoader -from tests.unit_tests.rag.intent_router_testkit import repo_context - - -def _by_id(case_id: str): - cases = PhraseCatalogLoader().load(Path(__file__).resolve().parent / "fixtures" / "phrases.yaml") - for case in cases: - if case.case_id == case_id: - return case - raise AssertionError(f"case {case_id} not found") - - -def test_show_file_phrase_maps_to_open_file() -> None: - case = _by_id("code-open-abstract-task") - result = IntentRouterV2().route(case.text, ConversationState(), repo_context()) - - assert result.query_plan.sub_intent == "OPEN_FILE" - assert [item.layer_id for item in result.retrieval_spec.layer_queries] == ["C0_SOURCE_CHUNKS"] - assert result.query_plan.path_hints - assert result.query_plan.keyword_hints == [] - assert result.query_plan.symbol_candidates == [] - assert result.retrieval_constraints.fuzzy_symbol_search.enabled is False - - -def test_find_tests_prefers_test_scope() -> None: - case = _by_id("code-find-tests-for-context") - result = IntentRouterV2().route(case.text, ConversationState(), repo_context()) - - assert result.query_plan.sub_intent == "FIND_TESTS" - assert "tests/**" in result.retrieval_constraints.prefer_globs - layers = [item.layer_id for item in result.retrieval_spec.layer_queries] - assert "C3_ENTRYPOINTS" not in layers - - -def test_explain_function_has_symbol_kind_hint() -> None: - case = _by_id("code-explain-handle-errors") - result = IntentRouterV2().route(case.text, ConversationState(), repo_context()) - - assert result.query_plan.symbol_kind_hint == "function" - assert "tests/**" in result.retrieval_constraints.exclude_globs - assert result.symbol_resolution.status == "pending" - - -def test_followup_marker_sets_followup_likely_mode() -> None: - router = IntentRouterV2() - first = router.route("Открой файл src/mail_order_bot/context.py", ConversationState(), repo_context()) - state = ConversationState().advance(first) - - second = router.route("Теперь объясни функцию handle_errors", state, repo_context()) - - assert second.conversation_mode == "FOLLOWUP_LIKELY" - assert second.query_plan.symbol_candidates == ["handle_errors"] - - -def test_docs_profile_uses_docs_constraints_and_disables_symbol_resolution() -> None: - case = _by_id("docs-about-readme-deploy") - result = IntentRouterV2().route(case.text, ConversationState(), repo_context()) - - assert result.retrieval_profile == "docs" - assert result.symbol_resolution.status == "not_requested" - assert result.query_plan.symbol_candidates == [] - assert result.query_plan.symbol_kind_hint == "unknown" - assert "README_DEPLOY.md" in result.retrieval_constraints.include_globs - assert "src/**" not in result.retrieval_constraints.include_globs - assert any(item in result.query_plan.keyword_hints for item in ["deploy", "deployment", "docker", "compose"]) - - -def test_docs_path_scope_prefers_scoped_layers() -> None: - case = _by_id("docs-about-readme-deploy") - result = IntentRouterV2().route(case.text, ConversationState(), repo_context()) - - layers = [item.layer_id for item in result.retrieval_spec.layer_queries] - assert layers == ["D3_SECTION_INDEX", "D2_FACT_INDEX"] - - -def test_trace_flow_phrase_maps_to_trace_flow_sub_intent() -> None: - result = IntentRouterV2().route("Покажи поток данных для Context.data", ConversationState(), repo_context()) - - assert result.query_plan.sub_intent == "TRACE_FLOW" - layer_ids = [item.layer_id for item in result.retrieval_spec.layer_queries] - assert "C2_DEPENDENCY_GRAPH" in layer_ids - assert "C3_ENTRYPOINTS" in layer_ids - assert result.evidence_policy.require_flow is True - - -def test_explain_sub_intent_keeps_entrypoints_for_execution_trace_retrieval() -> None: - result = IntentRouterV2().route("Объясни как работает Context", ConversationState(), repo_context()) - - assert result.query_plan.sub_intent == "EXPLAIN" - layer_ids = [item.layer_id for item in result.retrieval_spec.layer_queries] - assert "C3_ENTRYPOINTS" in layer_ids - assert "C4_SEMANTIC_ROLES" in layer_ids - - -def test_architecture_phrase_uses_architecture_sub_intent_and_semantic_roles_layer() -> None: - result = IntentRouterV2().route("Какие сервисы и обработчики есть в архитектуре?", ConversationState(), repo_context()) - - assert result.query_plan.sub_intent == "ARCHITECTURE" - layer_ids = [item.layer_id for item in result.retrieval_spec.layer_queries] - assert layer_ids[0] == "C4_SEMANTIC_ROLES" - assert "C2_DEPENDENCY_GRAPH" in layer_ids - assert "C3_ENTRYPOINTS" in layer_ids - - -def test_endpoint_phrase_maps_to_find_entrypoints() -> None: - result = IntentRouterV2().route("Где health endpoint?", ConversationState(), repo_context()) - - assert result.query_plan.sub_intent == "FIND_ENTRYPOINTS" - layer_ids = [item.layer_id for item in result.retrieval_spec.layer_queries] - assert layer_ids == ["C3_ENTRYPOINTS", "C0_SOURCE_CHUNKS"] - - -def test_request_flow_phrase_prefers_trace_flow_over_explain() -> None: - result = IntentRouterV2().route( - "Покажи как проходит запрос /health в HttpControlAppFactory", - ConversationState(), - repo_context(), - ) - - assert result.query_plan.sub_intent == "TRACE_FLOW" - layer_ids = [item.layer_id for item in result.retrieval_spec.layer_queries] - assert "C2_DEPENDENCY_GRAPH" in layer_ids - assert "C3_ENTRYPOINTS" in layer_ids - - -def test_flow_phrase_with_start_prefers_trace_flow_over_entrypoints() -> None: - result = IntentRouterV2().route( - "Покажи поток выполнения при запуске RuntimeManager", - ConversationState(), - repo_context(), - ) - - assert result.query_plan.sub_intent == "TRACE_FLOW" - layer_ids = [item.layer_id for item in result.retrieval_spec.layer_queries] - assert "C2_DEPENDENCY_GRAPH" in layer_ids diff --git a/tests/pipeline_setup/suite_02_pipeline/pipeline_intent_rag/test_runtime_full_chain_output.py b/tests/pipeline_setup/suite_02_pipeline/pipeline_intent_rag/test_runtime_full_chain_output.py deleted file mode 100644 index 4152d3b..0000000 --- a/tests/pipeline_setup/suite_02_pipeline/pipeline_intent_rag/test_runtime_full_chain_output.py +++ /dev/null @@ -1,250 +0,0 @@ -from __future__ import annotations - -from datetime import datetime -from pathlib import Path -from types import SimpleNamespace - -from tests.pipeline_setup.suite_02_pipeline.pipeline_intent_rag.helpers.models import PhraseCase, PipelineResult -from tests.pipeline_setup.suite_02_pipeline.pipeline_intent_rag.helpers.runtime import PipelineRuntime - - -class _FakeAnswerer: - def build_prompt_payload( - self, - query: str, - rag_rows: list[dict], - *, - prompt_template: dict | None = None, - sub_intent: str | None = None, - ) -> dict: - return { - "system_prompt": "sys", - "user_prompt": f"q={query} rows={len(rag_rows)} sub={sub_intent}", - "diagnostics": { - "prompt_stats": {"tokens_in_estimate": 10, "evidence_rows": len(rag_rows), "evidence_chars": 100}, - "evidence_summary": [], - "prompt_template_id": str((prompt_template or {}).get("template_id") or "t"), - "system_prompt_version": "v1", - }, - } - - def answer_from_payload(self, payload: dict) -> str: - return "ok" - - -class _ShouldNotBeCalledAnswerer: - def __init__(self) -> None: - raise AssertionError("LLM should not be instantiated for missing OPEN_FILE") - - -class _FakeModel: - def __init__(self, **payload) -> None: - self.__dict__.update(payload) - - def model_dump(self) -> dict: - return dict(self.__dict__) - - -def _fake_executor_result( - *, - query: str, - sub_intent: str, - rag_rows: list[dict], - final_answer: str, - answer_mode: str, - llm_used: bool, - validation_reasons: list[str], - path_scope: list[str] | None = None, - symbol_candidates: list[str] | None = None, - symbol_resolution: dict | None = None, - layers: list[str] | None = None, -) -> SimpleNamespace: - return SimpleNamespace( - final_answer=final_answer, - answer_mode=answer_mode, - llm_used=llm_used, - validation=SimpleNamespace(reasons=validation_reasons), - retrieval_result=SimpleNamespace(raw_rows=rag_rows), - router_result=SimpleNamespace( - query_plan=SimpleNamespace(symbol_candidates=symbol_candidates or []), - symbol_resolution=_FakeModel(**(symbol_resolution or {"status": "not_requested", "resolved_symbol": None, "alternatives": [], "confidence": 0.0})), - ), - diagnostics=SimpleNamespace( - router_result={ - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "sub_intent": sub_intent, - }, - retrieval_request={ - "query": query, - "path_scope": path_scope or [], - "requested_layers": layers or [], - }, - timings_ms={}, - ), - ) - - -def test_full_chain_writes_single_record_with_steps(monkeypatch) -> None: - test_root = Path(__file__).resolve().parent - runtime = PipelineRuntime(mode="full_chain", test_name="test_runtime_full_chain_output", test_root=test_root) - case = PhraseCase(case_id="c1", text="Открой файл src/mail_order_bot/context.py", expected_intent="CODE_QA") - rag_rows = [ - { - "path": "src/mail_order_bot/context.py", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/mail_order_bot/context.py:1-10", - "content": "class Context: ...", - "metadata": {}, - } - ] - writes: list[dict] = [] - - monkeypatch.setattr(runtime._writer, "write_record", lambda payload: writes.append(payload)) - monkeypatch.setattr( - runtime, - "_executor_instance", - lambda: SimpleNamespace( - execute=lambda **_: _fake_executor_result( - query=case.text, - sub_intent="OPEN_FILE", - rag_rows=rag_rows, - final_answer="ok", - answer_mode="normal", - llm_used=True, - validation_reasons=[], - path_scope=["src/mail_order_bot/context.py"], - layers=["C0_SOURCE_CHUNKS"], - ) - ), - ) - - runtime.run_full_chain(case) - - assert len(writes) == 1 - payload = writes[0] - assert payload["mode"] == "full_chain" - assert payload["summary"]["llm"]["answer_status"] == "answered" - assert payload["run_info"]["case_id"] == case.case_id - assert payload["input_request"]["text"] == case.text - assert [item["step"] for item in payload["steps"]] == ["intent_router", "retrieval", "llm_answer"] - - -def test_full_chain_short_circuits_missing_open_file(monkeypatch) -> None: - test_root = Path(__file__).resolve().parent - runtime = PipelineRuntime(mode="full_chain", test_name="test_runtime_full_chain_output", test_root=test_root) - case = PhraseCase(case_id="missing", text="Открой файл src/app_runtime/core/missing_runtime.py", expected_intent="CODE_QA") - writes: list[dict] = [] - - monkeypatch.setattr(runtime._writer, "write_record", lambda payload: writes.append(payload)) - monkeypatch.setattr( - runtime, - "_executor_instance", - lambda: SimpleNamespace( - execute=lambda **_: _fake_executor_result( - query=case.text, - sub_intent="OPEN_FILE", - rag_rows=[], - final_answer="Файл src/app_runtime/core/missing_runtime.py не найден.", - answer_mode="degraded", - llm_used=False, - validation_reasons=["file_not_found"], - path_scope=["src/app_runtime/core/missing_runtime.py"], - layers=["C0_SOURCE_CHUNKS"], - ) - ), - ) - - result = runtime.run_full_chain(case) - - assert result.llm_answer == "Файл src/app_runtime/core/missing_runtime.py не найден." - assert len(writes) == 1 - payload = writes[0] - assert payload["summary"]["llm"]["answer_status"] == "degraded" - assert payload["diagnostics"]["answer_policy"]["failure_reason"] == "file_not_found" - - -def test_full_chain_short_circuits_missing_explain_symbol(monkeypatch) -> None: - test_root = Path(__file__).resolve().parent - runtime = PipelineRuntime(mode="full_chain", test_name="test_runtime_full_chain_output", test_root=test_root) - case = PhraseCase(case_id="missing-symbol", text="Объясни класс RuntimeFactoryManager", expected_intent="CODE_QA") - writes: list[dict] = [] - - monkeypatch.setattr(runtime._writer, "write_record", lambda payload: writes.append(payload)) - monkeypatch.setattr( - runtime, - "_executor_instance", - lambda: SimpleNamespace( - execute=lambda **_: _fake_executor_result( - query=case.text, - sub_intent="EXPLAIN", - rag_rows=[], - final_answer="Сущность RuntimeFactoryManager не найдена. Ближайшие варианты: RuntimeManager, WorkflowRuntimeFactory.", - answer_mode="degraded", - llm_used=False, - validation_reasons=["symbol_not_found"], - symbol_candidates=["RuntimeFactoryManager"], - symbol_resolution={ - "status": "not_found", - "resolved_symbol": None, - "alternatives": ["RuntimeManager", "WorkflowRuntimeFactory"], - "confidence": 0.0, - }, - ) - ), - ) - - result = runtime.run_full_chain(case) - - assert result.llm_answer.startswith("Сущность RuntimeFactoryManager не найдена") - assert "исходя из названия" not in result.llm_answer - assert len(writes) == 1 - payload = writes[0] - assert payload["summary"]["llm"]["answer_status"] == "degraded" - assert payload["diagnostics"]["answer_policy"]["failure_reason"] == "symbol_not_found" - - -def test_full_chain_synthesizes_confirmed_http_entrypoints(monkeypatch) -> None: - test_root = Path(__file__).resolve().parent - runtime = PipelineRuntime(mode="full_chain", test_name="test_runtime_full_chain_output", test_root=test_root) - case = PhraseCase(case_id="entrypoints", text="Где health endpoint?", expected_intent="CODE_QA") - rag_rows = [ - { - "layer": "C3_ENTRYPOINTS", - "path": "src/app_runtime/control/http_app.py", - "title": "GET /health declared in HttpControlAppFactory", - "content": "", - "metadata": { - "http_method": "GET", - "route_path": "/health", - "declaring_symbol": "HttpControlAppFactory", - "handler_symbol": "HttpControlAppFactory.create.health", - }, - } - ] - writes: list[dict] = [] - - monkeypatch.setattr(runtime._writer, "write_record", lambda payload: writes.append(payload)) - monkeypatch.setattr( - runtime, - "_executor_instance", - lambda: SimpleNamespace( - execute=lambda **_: _fake_executor_result( - query=case.text, - sub_intent="FIND_ENTRYPOINTS", - rag_rows=rag_rows, - final_answer="GET /health — объявлен в HttpControlAppFactory, обрабатывается health", - answer_mode="normal", - llm_used=True, - validation_reasons=[], - layers=["C3_ENTRYPOINTS"], - ) - ), - ) - - result = runtime.run_full_chain(case) - - assert result.llm_answer == "GET /health — объявлен в HttpControlAppFactory, обрабатывается health" - assert len(writes) == 1 - assert writes[0]["summary"]["llm"]["answer_status"] == "answered" diff --git a/tests/pipeline_setup/suite_02_pipeline/test_results/test_intent_router_only_matrix_20260312_231221.jsonl b/tests/pipeline_setup/suite_02_pipeline/test_results/test_intent_router_only_matrix_20260312_231221.jsonl deleted file mode 100644 index 8d8d3fe..0000000 --- a/tests/pipeline_setup/suite_02_pipeline/test_results/test_intent_router_only_matrix_20260312_231221.jsonl +++ /dev/null @@ -1,10 +0,0 @@ -{"case_id": "code-open-context-file", "text": "Открой файл src/mail_order_bot/context.py", "mode": "router_only", "run_started_at": "2026-03-12T23:12:21", "rag_session_id": "849fc2c9-e17c-4034-b3b5-2e13d535bb94", "expected_intent": "CODE_QA", "actual_intent": "CODE_QA", "graph_id": "CodeQAGraph", "conversation_mode": "START", "query": "Открой файл src/mail_order_bot/context.py", "symbol_resolution": {"status": "not_requested", "resolved_symbol": null, "alternatives": [], "confidence": 0.0}, "rag_count": 0, "rag_rows": [], "llm_answer": null, "summary": {"router": {"intent": "CODE_QA", "sub_intent": "OPEN_FILE", "confidence": null}, "retrieval": {"profile": "code", "layers_hit": [], "evidence_sufficient": false}, "llm": {"answer_status": "partial", "groundedness": "not_applicable"}}, "diagnostics": {"router_plan": {"intent": "CODE_QA", "sub_intent": "OPEN_FILE", "graph_id": "CodeQAGraph", "retrieval_profile": "code", "conversation_mode": "START", "layers": ["C0_SOURCE_CHUNKS"], "symbol_kind_hint": "unknown", "symbol_candidates": [], "keyword_hints": [], "path_hints": ["src/mail_order_bot/context.py"], "path_scope": ["src/mail_order_bot/context.py"], "doc_scope_hints": [], "retrieval_constraints": {"include_globs": ["src/mail_order_bot/context.py"], "exclude_globs": ["tests/**", "**/test_*.py", "**/*_test.py"], "prefer_globs": [], "test_file_globs": [], "test_symbol_patterns": [], "max_candidates": 20, "fuzzy_symbol_search": {"enabled": false, "max_distance": 2, "top_k": 5}}}, "execution": {"executed_layers": [], "retrieval_mode_by_layer": {}, "top_k_by_layer": {}, "filters_by_layer": {}, "repo_scope": {"repo_id": null, "workspace_id": null}}, "retrieval": null, "constraint_violations": [], "timings_ms": {"router": 0, "symbol_resolution": 0, "retrieval_total": 0, "retrieval_by_layer": {}, "merge_rank": 0, "prompt_build": 0, "llm_call": 0}, "prompt": null, "router": {"conversation_mode": "START", "keyword_hints": [], "path_scope": ["src/mail_order_bot/context.py"]}, "llm": {"used_evidence_count": 0, "missing_evidence_reason": null}}, "run_info": {"case_id": "code-open-context-file", "mode": "router_only", "run_started_at": "2026-03-12T23:12:21", "rag_session_id": "849fc2c9-e17c-4034-b3b5-2e13d535bb94", "expected_intent": "CODE_QA", "actual_intent": "CODE_QA", "graph_id": "CodeQAGraph", "conversation_mode": "START"}, "input_request": {"text": "Открой файл src/mail_order_bot/context.py", "normalized_query": "Открой файл src/mail_order_bot/context.py"}, "steps": [{"step": "intent_router", "input": {"query": "Открой файл src/mail_order_bot/context.py"}, "output": {"intent": "CODE_QA", "graph_id": "CodeQAGraph", "conversation_mode": "START", "query": "Открой файл src/mail_order_bot/context.py"}, "diagnostics": {"router_plan": {"intent": "CODE_QA", "sub_intent": "OPEN_FILE", "graph_id": "CodeQAGraph", "retrieval_profile": "code", "conversation_mode": "START", "layers": ["C0_SOURCE_CHUNKS"], "symbol_kind_hint": "unknown", "symbol_candidates": [], "keyword_hints": [], "path_hints": ["src/mail_order_bot/context.py"], "path_scope": ["src/mail_order_bot/context.py"], "doc_scope_hints": [], "retrieval_constraints": {"include_globs": ["src/mail_order_bot/context.py"], "exclude_globs": ["tests/**", "**/test_*.py", "**/*_test.py"], "prefer_globs": [], "test_file_globs": [], "test_symbol_patterns": [], "max_candidates": 20, "fuzzy_symbol_search": {"enabled": false, "max_distance": 2, "top_k": 5}}}, "timings_ms": {"router": 0}}}]} -{"case_id": "code-explain-context-class", "text": "Объясни как работает класс Context", "mode": "router_only", "run_started_at": "2026-03-12T23:12:21", "rag_session_id": "849fc2c9-e17c-4034-b3b5-2e13d535bb94", "expected_intent": "CODE_QA", "actual_intent": "CODE_QA", "graph_id": "CodeQAGraph", "conversation_mode": "START", "query": "Объясни как работает класс Context", "symbol_resolution": {"status": "pending", "resolved_symbol": null, "alternatives": ["Context"], "confidence": 0.0}, "rag_count": 0, "rag_rows": [], "llm_answer": null, "summary": {"router": {"intent": "CODE_QA", "sub_intent": "EXPLAIN", "confidence": null}, "retrieval": {"profile": "code", "layers_hit": [], "evidence_sufficient": false}, "llm": {"answer_status": "partial", "groundedness": "not_applicable"}}, "diagnostics": {"router_plan": {"intent": "CODE_QA", "sub_intent": "EXPLAIN", "graph_id": "CodeQAGraph", "retrieval_profile": "code", "conversation_mode": "START", "layers": ["C1_SYMBOL_CATALOG", "C0_SOURCE_CHUNKS", "C4_SEMANTIC_ROLES", "C2_DEPENDENCY_GRAPH", "C3_ENTRYPOINTS"], "symbol_kind_hint": "class", "symbol_candidates": ["Context"], "keyword_hints": ["Context"], "path_hints": [], "path_scope": [], "doc_scope_hints": [], "retrieval_constraints": {"include_globs": ["src/**"], "exclude_globs": ["tests/**", "**/test_*.py", "**/*_test.py"], "prefer_globs": [], "test_file_globs": [], "test_symbol_patterns": [], "max_candidates": 20, "fuzzy_symbol_search": {"enabled": true, "max_distance": 2, "top_k": 5}}}, "execution": {"executed_layers": [], "retrieval_mode_by_layer": {}, "top_k_by_layer": {}, "filters_by_layer": {}, "repo_scope": {"repo_id": null, "workspace_id": null}}, "retrieval": null, "constraint_violations": [], "timings_ms": {"router": 0, "symbol_resolution": 0, "retrieval_total": 0, "retrieval_by_layer": {}, "merge_rank": 0, "prompt_build": 0, "llm_call": 0}, "prompt": null, "router": {"conversation_mode": "START", "keyword_hints": ["Context"], "path_scope": []}, "llm": {"used_evidence_count": 0, "missing_evidence_reason": null}}, "run_info": {"case_id": "code-explain-context-class", "mode": "router_only", "run_started_at": "2026-03-12T23:12:21", "rag_session_id": "849fc2c9-e17c-4034-b3b5-2e13d535bb94", "expected_intent": "CODE_QA", "actual_intent": "CODE_QA", "graph_id": "CodeQAGraph", "conversation_mode": "START"}, "input_request": {"text": "Объясни как работает класс Context", "normalized_query": "Объясни как работает класс Context"}, "steps": [{"step": "intent_router", "input": {"query": "Объясни как работает класс Context"}, "output": {"intent": "CODE_QA", "graph_id": "CodeQAGraph", "conversation_mode": "START", "query": "Объясни как работает класс Context"}, "diagnostics": {"router_plan": {"intent": "CODE_QA", "sub_intent": "EXPLAIN", "graph_id": "CodeQAGraph", "retrieval_profile": "code", "conversation_mode": "START", "layers": ["C1_SYMBOL_CATALOG", "C0_SOURCE_CHUNKS", "C4_SEMANTIC_ROLES", "C2_DEPENDENCY_GRAPH", "C3_ENTRYPOINTS"], "symbol_kind_hint": "class", "symbol_candidates": ["Context"], "keyword_hints": ["Context"], "path_hints": [], "path_scope": [], "doc_scope_hints": [], "retrieval_constraints": {"include_globs": ["src/**"], "exclude_globs": ["tests/**", "**/test_*.py", "**/*_test.py"], "prefer_globs": [], "test_file_globs": [], "test_symbol_patterns": [], "max_candidates": 20, "fuzzy_symbol_search": {"enabled": true, "max_distance": 2, "top_k": 5}}}, "timings_ms": {"router": 0}}}]} -{"case_id": "code-explain-excel-parser", "text": "Объясни класс ExcelFileParcer", "mode": "router_only", "run_started_at": "2026-03-12T23:12:21", "rag_session_id": "849fc2c9-e17c-4034-b3b5-2e13d535bb94", "expected_intent": "CODE_QA", "actual_intent": "CODE_QA", "graph_id": "CodeQAGraph", "conversation_mode": "START", "query": "Объясни класс ExcelFileParcer", "symbol_resolution": {"status": "pending", "resolved_symbol": null, "alternatives": ["ExcelFileParcer"], "confidence": 0.0}, "rag_count": 0, "rag_rows": [], "llm_answer": null, "summary": {"router": {"intent": "CODE_QA", "sub_intent": "EXPLAIN", "confidence": null}, "retrieval": {"profile": "code", "layers_hit": [], "evidence_sufficient": false}, "llm": {"answer_status": "partial", "groundedness": "not_applicable"}}, "diagnostics": {"router_plan": {"intent": "CODE_QA", "sub_intent": "EXPLAIN", "graph_id": "CodeQAGraph", "retrieval_profile": "code", "conversation_mode": "START", "layers": ["C1_SYMBOL_CATALOG", "C0_SOURCE_CHUNKS", "C4_SEMANTIC_ROLES", "C2_DEPENDENCY_GRAPH", "C3_ENTRYPOINTS"], "symbol_kind_hint": "class", "symbol_candidates": ["ExcelFileParcer"], "keyword_hints": ["ExcelFileParcer"], "path_hints": [], "path_scope": [], "doc_scope_hints": [], "retrieval_constraints": {"include_globs": ["src/**"], "exclude_globs": ["tests/**", "**/test_*.py", "**/*_test.py"], "prefer_globs": [], "test_file_globs": [], "test_symbol_patterns": [], "max_candidates": 20, "fuzzy_symbol_search": {"enabled": true, "max_distance": 2, "top_k": 5}}}, "execution": {"executed_layers": [], "retrieval_mode_by_layer": {}, "top_k_by_layer": {}, "filters_by_layer": {}, "repo_scope": {"repo_id": null, "workspace_id": null}}, "retrieval": null, "constraint_violations": [], "timings_ms": {"router": 0, "symbol_resolution": 0, "retrieval_total": 0, "retrieval_by_layer": {}, "merge_rank": 0, "prompt_build": 0, "llm_call": 0}, "prompt": null, "router": {"conversation_mode": "START", "keyword_hints": ["ExcelFileParcer"], "path_scope": []}, "llm": {"used_evidence_count": 0, "missing_evidence_reason": null}}, "run_info": {"case_id": "code-explain-excel-parser", "mode": "router_only", "run_started_at": "2026-03-12T23:12:21", "rag_session_id": "849fc2c9-e17c-4034-b3b5-2e13d535bb94", "expected_intent": "CODE_QA", "actual_intent": "CODE_QA", "graph_id": "CodeQAGraph", "conversation_mode": "START"}, "input_request": {"text": "Объясни класс ExcelFileParcer", "normalized_query": "Объясни класс ExcelFileParcer"}, "steps": [{"step": "intent_router", "input": {"query": "Объясни класс ExcelFileParcer"}, "output": {"intent": "CODE_QA", "graph_id": "CodeQAGraph", "conversation_mode": "START", "query": "Объясни класс ExcelFileParcer"}, "diagnostics": {"router_plan": {"intent": "CODE_QA", "sub_intent": "EXPLAIN", "graph_id": "CodeQAGraph", "retrieval_profile": "code", "conversation_mode": "START", "layers": ["C1_SYMBOL_CATALOG", "C0_SOURCE_CHUNKS", "C4_SEMANTIC_ROLES", "C2_DEPENDENCY_GRAPH", "C3_ENTRYPOINTS"], "symbol_kind_hint": "class", "symbol_candidates": ["ExcelFileParcer"], "keyword_hints": ["ExcelFileParcer"], "path_hints": [], "path_scope": [], "doc_scope_hints": [], "retrieval_constraints": {"include_globs": ["src/**"], "exclude_globs": ["tests/**", "**/test_*.py", "**/*_test.py"], "prefer_globs": [], "test_file_globs": [], "test_symbol_patterns": [], "max_candidates": 20, "fuzzy_symbol_search": {"enabled": true, "max_distance": 2, "top_k": 5}}}, "timings_ms": {"router": 0}}}]} -{"case_id": "code-find-tests-for-context", "text": "Где тесты для Context?", "mode": "router_only", "run_started_at": "2026-03-12T23:12:21", "rag_session_id": "849fc2c9-e17c-4034-b3b5-2e13d535bb94", "expected_intent": "CODE_QA", "actual_intent": "CODE_QA", "graph_id": "CodeQAGraph", "conversation_mode": "START", "query": "Где тесты для Context?", "symbol_resolution": {"status": "pending", "resolved_symbol": null, "alternatives": ["Context"], "confidence": 0.0}, "rag_count": 0, "rag_rows": [], "llm_answer": null, "summary": {"router": {"intent": "CODE_QA", "sub_intent": "FIND_TESTS", "confidence": null}, "retrieval": {"profile": "code", "layers_hit": [], "evidence_sufficient": false}, "llm": {"answer_status": "partial", "groundedness": "not_applicable"}}, "diagnostics": {"router_plan": {"intent": "CODE_QA", "sub_intent": "FIND_TESTS", "graph_id": "CodeQAGraph", "retrieval_profile": "code", "conversation_mode": "START", "layers": ["C1_SYMBOL_CATALOG", "C2_DEPENDENCY_GRAPH", "C0_SOURCE_CHUNKS"], "symbol_kind_hint": "class", "symbol_candidates": ["Context"], "keyword_hints": ["Context"], "path_hints": [], "path_scope": [], "doc_scope_hints": [], "retrieval_constraints": {"include_globs": ["src/**", "tests/**", "**/test_*.py", "**/*_test.py", "**/conftest.py"], "exclude_globs": [], "prefer_globs": ["tests/**", "**/test_*.py", "**/*_test.py"], "test_file_globs": ["tests/**", "**/test_*.py", "**/*_test.py", "**/conftest.py"], "test_symbol_patterns": ["test_context", "TestContext", "Context"], "max_candidates": 20, "fuzzy_symbol_search": {"enabled": true, "max_distance": 2, "top_k": 5}}}, "execution": {"executed_layers": [], "retrieval_mode_by_layer": {}, "top_k_by_layer": {}, "filters_by_layer": {}, "repo_scope": {"repo_id": null, "workspace_id": null}}, "retrieval": null, "constraint_violations": [], "timings_ms": {"router": 0, "symbol_resolution": 0, "retrieval_total": 0, "retrieval_by_layer": {}, "merge_rank": 0, "prompt_build": 0, "llm_call": 0}, "prompt": null, "router": {"conversation_mode": "START", "keyword_hints": ["Context"], "path_scope": []}, "llm": {"used_evidence_count": 0, "missing_evidence_reason": null}}, "run_info": {"case_id": "code-find-tests-for-context", "mode": "router_only", "run_started_at": "2026-03-12T23:12:21", "rag_session_id": "849fc2c9-e17c-4034-b3b5-2e13d535bb94", "expected_intent": "CODE_QA", "actual_intent": "CODE_QA", "graph_id": "CodeQAGraph", "conversation_mode": "START"}, "input_request": {"text": "Где тесты для Context?", "normalized_query": "Где тесты для Context?"}, "steps": [{"step": "intent_router", "input": {"query": "Где тесты для Context?"}, "output": {"intent": "CODE_QA", "graph_id": "CodeQAGraph", "conversation_mode": "START", "query": "Где тесты для Context?"}, "diagnostics": {"router_plan": {"intent": "CODE_QA", "sub_intent": "FIND_TESTS", "graph_id": "CodeQAGraph", "retrieval_profile": "code", "conversation_mode": "START", "layers": ["C1_SYMBOL_CATALOG", "C2_DEPENDENCY_GRAPH", "C0_SOURCE_CHUNKS"], "symbol_kind_hint": "class", "symbol_candidates": ["Context"], "keyword_hints": ["Context"], "path_hints": [], "path_scope": [], "doc_scope_hints": [], "retrieval_constraints": {"include_globs": ["src/**", "tests/**", "**/test_*.py", "**/*_test.py", "**/conftest.py"], "exclude_globs": [], "prefer_globs": ["tests/**", "**/test_*.py", "**/*_test.py"], "test_file_globs": ["tests/**", "**/test_*.py", "**/*_test.py", "**/conftest.py"], "test_symbol_patterns": ["test_context", "TestContext", "Context"], "max_candidates": 20, "fuzzy_symbol_search": {"enabled": true, "max_distance": 2, "top_k": 5}}}, "timings_ms": {"router": 0}}}]} -{"case_id": "code-exclude-tests-context", "text": "Не про тесты, а про прод код Context", "mode": "router_only", "run_started_at": "2026-03-12T23:12:21", "rag_session_id": "849fc2c9-e17c-4034-b3b5-2e13d535bb94", "expected_intent": "CODE_QA", "actual_intent": "CODE_QA", "graph_id": "CodeQAGraph", "conversation_mode": "START", "query": "Не про тесты, а про прод код Context", "symbol_resolution": {"status": "pending", "resolved_symbol": null, "alternatives": ["Context"], "confidence": 0.0}, "rag_count": 0, "rag_rows": [], "llm_answer": null, "summary": {"router": {"intent": "CODE_QA", "sub_intent": "EXPLAIN", "confidence": null}, "retrieval": {"profile": "code", "layers_hit": [], "evidence_sufficient": false}, "llm": {"answer_status": "partial", "groundedness": "not_applicable"}}, "diagnostics": {"router_plan": {"intent": "CODE_QA", "sub_intent": "EXPLAIN", "graph_id": "CodeQAGraph", "retrieval_profile": "code", "conversation_mode": "START", "layers": ["C1_SYMBOL_CATALOG", "C0_SOURCE_CHUNKS", "C4_SEMANTIC_ROLES", "C2_DEPENDENCY_GRAPH", "C3_ENTRYPOINTS"], "symbol_kind_hint": "class", "symbol_candidates": ["Context"], "keyword_hints": ["Context"], "path_hints": [], "path_scope": [], "doc_scope_hints": [], "retrieval_constraints": {"include_globs": ["src/**"], "exclude_globs": ["tests/**", "**/test_*.py", "**/*_test.py"], "prefer_globs": [], "test_file_globs": [], "test_symbol_patterns": [], "max_candidates": 20, "fuzzy_symbol_search": {"enabled": true, "max_distance": 2, "top_k": 5}}}, "execution": {"executed_layers": [], "retrieval_mode_by_layer": {}, "top_k_by_layer": {}, "filters_by_layer": {}, "repo_scope": {"repo_id": null, "workspace_id": null}}, "retrieval": null, "constraint_violations": [], "timings_ms": {"router": 0, "symbol_resolution": 0, "retrieval_total": 0, "retrieval_by_layer": {}, "merge_rank": 0, "prompt_build": 0, "llm_call": 0}, "prompt": null, "router": {"conversation_mode": "START", "keyword_hints": ["Context"], "path_scope": []}, "llm": {"used_evidence_count": 0, "missing_evidence_reason": null}}, "run_info": {"case_id": "code-exclude-tests-context", "mode": "router_only", "run_started_at": "2026-03-12T23:12:21", "rag_session_id": "849fc2c9-e17c-4034-b3b5-2e13d535bb94", "expected_intent": "CODE_QA", "actual_intent": "CODE_QA", "graph_id": "CodeQAGraph", "conversation_mode": "START"}, "input_request": {"text": "Не про тесты, а про прод код Context", "normalized_query": "Не про тесты, а про прод код Context"}, "steps": [{"step": "intent_router", "input": {"query": "Не про тесты, а про прод код Context"}, "output": {"intent": "CODE_QA", "graph_id": "CodeQAGraph", "conversation_mode": "START", "query": "Не про тесты, а про прод код Context"}, "diagnostics": {"router_plan": {"intent": "CODE_QA", "sub_intent": "EXPLAIN", "graph_id": "CodeQAGraph", "retrieval_profile": "code", "conversation_mode": "START", "layers": ["C1_SYMBOL_CATALOG", "C0_SOURCE_CHUNKS", "C4_SEMANTIC_ROLES", "C2_DEPENDENCY_GRAPH", "C3_ENTRYPOINTS"], "symbol_kind_hint": "class", "symbol_candidates": ["Context"], "keyword_hints": ["Context"], "path_hints": [], "path_scope": [], "doc_scope_hints": [], "retrieval_constraints": {"include_globs": ["src/**"], "exclude_globs": ["tests/**", "**/test_*.py", "**/*_test.py"], "prefer_globs": [], "test_file_globs": [], "test_symbol_patterns": [], "max_candidates": 20, "fuzzy_symbol_search": {"enabled": true, "max_distance": 2, "top_k": 5}}}, "timings_ms": {"router": 0}}}]} -{"case_id": "code-open-abstract-task", "text": "Покажи файл src/mail_order_bot/task_processor/abstract_task.py", "mode": "router_only", "run_started_at": "2026-03-12T23:12:21", "rag_session_id": "849fc2c9-e17c-4034-b3b5-2e13d535bb94", "expected_intent": "CODE_QA", "actual_intent": "CODE_QA", "graph_id": "CodeQAGraph", "conversation_mode": "START", "query": "Покажи файл src/mail_order_bot/task_processor/abstract_task.py", "symbol_resolution": {"status": "not_requested", "resolved_symbol": null, "alternatives": [], "confidence": 0.0}, "rag_count": 0, "rag_rows": [], "llm_answer": null, "summary": {"router": {"intent": "CODE_QA", "sub_intent": "OPEN_FILE", "confidence": null}, "retrieval": {"profile": "code", "layers_hit": [], "evidence_sufficient": false}, "llm": {"answer_status": "partial", "groundedness": "not_applicable"}}, "diagnostics": {"router_plan": {"intent": "CODE_QA", "sub_intent": "OPEN_FILE", "graph_id": "CodeQAGraph", "retrieval_profile": "code", "conversation_mode": "START", "layers": ["C0_SOURCE_CHUNKS"], "symbol_kind_hint": "unknown", "symbol_candidates": [], "keyword_hints": [], "path_hints": ["src/mail_order_bot/task_processor/abstract_task.py"], "path_scope": ["src/mail_order_bot/task_processor/abstract_task.py"], "doc_scope_hints": [], "retrieval_constraints": {"include_globs": ["src/mail_order_bot/task_processor/abstract_task.py"], "exclude_globs": ["tests/**", "**/test_*.py", "**/*_test.py"], "prefer_globs": [], "test_file_globs": [], "test_symbol_patterns": [], "max_candidates": 20, "fuzzy_symbol_search": {"enabled": false, "max_distance": 2, "top_k": 5}}}, "execution": {"executed_layers": [], "retrieval_mode_by_layer": {}, "top_k_by_layer": {}, "filters_by_layer": {}, "repo_scope": {"repo_id": null, "workspace_id": null}}, "retrieval": null, "constraint_violations": [], "timings_ms": {"router": 0, "symbol_resolution": 0, "retrieval_total": 0, "retrieval_by_layer": {}, "merge_rank": 0, "prompt_build": 0, "llm_call": 0}, "prompt": null, "router": {"conversation_mode": "START", "keyword_hints": [], "path_scope": ["src/mail_order_bot/task_processor/abstract_task.py"]}, "llm": {"used_evidence_count": 0, "missing_evidence_reason": null}}, "run_info": {"case_id": "code-open-abstract-task", "mode": "router_only", "run_started_at": "2026-03-12T23:12:21", "rag_session_id": "849fc2c9-e17c-4034-b3b5-2e13d535bb94", "expected_intent": "CODE_QA", "actual_intent": "CODE_QA", "graph_id": "CodeQAGraph", "conversation_mode": "START"}, "input_request": {"text": "Покажи файл src/mail_order_bot/task_processor/abstract_task.py", "normalized_query": "Покажи файл src/mail_order_bot/task_processor/abstract_task.py"}, "steps": [{"step": "intent_router", "input": {"query": "Покажи файл src/mail_order_bot/task_processor/abstract_task.py"}, "output": {"intent": "CODE_QA", "graph_id": "CodeQAGraph", "conversation_mode": "START", "query": "Покажи файл src/mail_order_bot/task_processor/abstract_task.py"}, "diagnostics": {"router_plan": {"intent": "CODE_QA", "sub_intent": "OPEN_FILE", "graph_id": "CodeQAGraph", "retrieval_profile": "code", "conversation_mode": "START", "layers": ["C0_SOURCE_CHUNKS"], "symbol_kind_hint": "unknown", "symbol_candidates": [], "keyword_hints": [], "path_hints": ["src/mail_order_bot/task_processor/abstract_task.py"], "path_scope": ["src/mail_order_bot/task_processor/abstract_task.py"], "doc_scope_hints": [], "retrieval_constraints": {"include_globs": ["src/mail_order_bot/task_processor/abstract_task.py"], "exclude_globs": ["tests/**", "**/test_*.py", "**/*_test.py"], "prefer_globs": [], "test_file_globs": [], "test_symbol_patterns": [], "max_candidates": 20, "fuzzy_symbol_search": {"enabled": false, "max_distance": 2, "top_k": 5}}}, "timings_ms": {"router": 0}}}]} -{"case_id": "code-explain-handle-errors", "text": "Теперь объясни функцию handle_errors", "mode": "router_only", "run_started_at": "2026-03-12T23:12:21", "rag_session_id": "849fc2c9-e17c-4034-b3b5-2e13d535bb94", "expected_intent": "CODE_QA", "actual_intent": "CODE_QA", "graph_id": "CodeQAGraph", "conversation_mode": "START", "query": "Теперь объясни функцию handle_errors", "symbol_resolution": {"status": "pending", "resolved_symbol": null, "alternatives": ["handle_errors"], "confidence": 0.0}, "rag_count": 0, "rag_rows": [], "llm_answer": null, "summary": {"router": {"intent": "CODE_QA", "sub_intent": "EXPLAIN", "confidence": null}, "retrieval": {"profile": "code", "layers_hit": [], "evidence_sufficient": false}, "llm": {"answer_status": "partial", "groundedness": "not_applicable"}}, "diagnostics": {"router_plan": {"intent": "CODE_QA", "sub_intent": "EXPLAIN", "graph_id": "CodeQAGraph", "retrieval_profile": "code", "conversation_mode": "START", "layers": ["C1_SYMBOL_CATALOG", "C0_SOURCE_CHUNKS", "C4_SEMANTIC_ROLES", "C2_DEPENDENCY_GRAPH", "C3_ENTRYPOINTS"], "symbol_kind_hint": "function", "symbol_candidates": ["handle_errors"], "keyword_hints": ["handle_errors"], "path_hints": [], "path_scope": [], "doc_scope_hints": [], "retrieval_constraints": {"include_globs": ["src/**"], "exclude_globs": ["tests/**", "**/test_*.py", "**/*_test.py"], "prefer_globs": [], "test_file_globs": [], "test_symbol_patterns": [], "max_candidates": 20, "fuzzy_symbol_search": {"enabled": true, "max_distance": 2, "top_k": 5}}}, "execution": {"executed_layers": [], "retrieval_mode_by_layer": {}, "top_k_by_layer": {}, "filters_by_layer": {}, "repo_scope": {"repo_id": null, "workspace_id": null}}, "retrieval": null, "constraint_violations": [], "timings_ms": {"router": 0, "symbol_resolution": 0, "retrieval_total": 0, "retrieval_by_layer": {}, "merge_rank": 0, "prompt_build": 0, "llm_call": 0}, "prompt": null, "router": {"conversation_mode": "START", "keyword_hints": ["handle_errors"], "path_scope": []}, "llm": {"used_evidence_count": 0, "missing_evidence_reason": null}}, "run_info": {"case_id": "code-explain-handle-errors", "mode": "router_only", "run_started_at": "2026-03-12T23:12:21", "rag_session_id": "849fc2c9-e17c-4034-b3b5-2e13d535bb94", "expected_intent": "CODE_QA", "actual_intent": "CODE_QA", "graph_id": "CodeQAGraph", "conversation_mode": "START"}, "input_request": {"text": "Теперь объясни функцию handle_errors", "normalized_query": "Теперь объясни функцию handle_errors"}, "steps": [{"step": "intent_router", "input": {"query": "Теперь объясни функцию handle_errors"}, "output": {"intent": "CODE_QA", "graph_id": "CodeQAGraph", "conversation_mode": "START", "query": "Теперь объясни функцию handle_errors"}, "diagnostics": {"router_plan": {"intent": "CODE_QA", "sub_intent": "EXPLAIN", "graph_id": "CodeQAGraph", "retrieval_profile": "code", "conversation_mode": "START", "layers": ["C1_SYMBOL_CATALOG", "C0_SOURCE_CHUNKS", "C4_SEMANTIC_ROLES", "C2_DEPENDENCY_GRAPH", "C3_ENTRYPOINTS"], "symbol_kind_hint": "function", "symbol_candidates": ["handle_errors"], "keyword_hints": ["handle_errors"], "path_hints": [], "path_scope": [], "doc_scope_hints": [], "retrieval_constraints": {"include_globs": ["src/**"], "exclude_globs": ["tests/**", "**/test_*.py", "**/*_test.py"], "prefer_globs": [], "test_file_globs": [], "test_symbol_patterns": [], "max_candidates": 20, "fuzzy_symbol_search": {"enabled": true, "max_distance": 2, "top_k": 5}}}, "timings_ms": {"router": 0}}}]} -{"case_id": "docs-about-readme-deploy", "text": "Что сказано в README_DEPLOY.md?", "mode": "router_only", "run_started_at": "2026-03-12T23:12:21", "rag_session_id": "849fc2c9-e17c-4034-b3b5-2e13d535bb94", "expected_intent": "DOCS_QA", "actual_intent": "DOCS_QA", "graph_id": "DocsQAGraph", "conversation_mode": "START", "query": "Что сказано в README_DEPLOY.md?", "symbol_resolution": {"status": "not_requested", "resolved_symbol": null, "alternatives": [], "confidence": 0.0}, "rag_count": 0, "rag_rows": [], "llm_answer": null, "summary": {"router": {"intent": "DOCS_QA", "sub_intent": "EXPLAIN", "confidence": null}, "retrieval": {"profile": "docs", "layers_hit": [], "evidence_sufficient": false}, "llm": {"answer_status": "partial", "groundedness": "not_applicable"}}, "diagnostics": {"router_plan": {"intent": "DOCS_QA", "sub_intent": "EXPLAIN", "graph_id": "DocsQAGraph", "retrieval_profile": "docs", "conversation_mode": "START", "layers": ["D3_SECTION_INDEX", "D2_FACT_INDEX"], "symbol_kind_hint": "unknown", "symbol_candidates": [], "keyword_hints": ["README_DEPLOY.md", "readme_deploy.md", "deploy", "deployment", "docker", "compose", "env", "config", "production", "ci/cd"], "path_hints": ["README_DEPLOY.md"], "path_scope": ["README_DEPLOY.md"], "doc_scope_hints": ["README_DEPLOY.md", "README*", "docs/**", "**/*.md"], "retrieval_constraints": {"include_globs": ["README_DEPLOY.md", "docs/**", "README*", "**/*.md"], "exclude_globs": [".venv/**", "node_modules/**", "**/*.bin", "**/*.png", "**/*.jpg"], "prefer_globs": [], "test_file_globs": [], "test_symbol_patterns": [], "max_candidates": 20, "fuzzy_symbol_search": {"enabled": true, "max_distance": 2, "top_k": 5}}}, "execution": {"executed_layers": [], "retrieval_mode_by_layer": {}, "top_k_by_layer": {}, "filters_by_layer": {}, "repo_scope": {"repo_id": null, "workspace_id": null}}, "retrieval": null, "constraint_violations": [], "timings_ms": {"router": 0, "symbol_resolution": 0, "retrieval_total": 0, "retrieval_by_layer": {}, "merge_rank": 0, "prompt_build": 0, "llm_call": 0}, "prompt": null, "router": {"conversation_mode": "START", "keyword_hints": ["README_DEPLOY.md", "readme_deploy.md", "deploy", "deployment", "docker", "compose", "env", "config", "production", "ci/cd"], "path_scope": ["README_DEPLOY.md"]}, "llm": {"used_evidence_count": 0, "missing_evidence_reason": null}}, "run_info": {"case_id": "docs-about-readme-deploy", "mode": "router_only", "run_started_at": "2026-03-12T23:12:21", "rag_session_id": "849fc2c9-e17c-4034-b3b5-2e13d535bb94", "expected_intent": "DOCS_QA", "actual_intent": "DOCS_QA", "graph_id": "DocsQAGraph", "conversation_mode": "START"}, "input_request": {"text": "Что сказано в README_DEPLOY.md?", "normalized_query": "Что сказано в README_DEPLOY.md?"}, "steps": [{"step": "intent_router", "input": {"query": "Что сказано в README_DEPLOY.md?"}, "output": {"intent": "DOCS_QA", "graph_id": "DocsQAGraph", "conversation_mode": "START", "query": "Что сказано в README_DEPLOY.md?"}, "diagnostics": {"router_plan": {"intent": "DOCS_QA", "sub_intent": "EXPLAIN", "graph_id": "DocsQAGraph", "retrieval_profile": "docs", "conversation_mode": "START", "layers": ["D3_SECTION_INDEX", "D2_FACT_INDEX"], "symbol_kind_hint": "unknown", "symbol_candidates": [], "keyword_hints": ["README_DEPLOY.md", "readme_deploy.md", "deploy", "deployment", "docker", "compose", "env", "config", "production", "ci/cd"], "path_hints": ["README_DEPLOY.md"], "path_scope": ["README_DEPLOY.md"], "doc_scope_hints": ["README_DEPLOY.md", "README*", "docs/**", "**/*.md"], "retrieval_constraints": {"include_globs": ["README_DEPLOY.md", "docs/**", "README*", "**/*.md"], "exclude_globs": [".venv/**", "node_modules/**", "**/*.bin", "**/*.png", "**/*.jpg"], "prefer_globs": [], "test_file_globs": [], "test_symbol_patterns": [], "max_candidates": 20, "fuzzy_symbol_search": {"enabled": true, "max_distance": 2, "top_k": 5}}}, "timings_ms": {"router": 0}}}]} -{"case_id": "docs-generic-question", "text": "Что сказано в документации по деплою?", "mode": "router_only", "run_started_at": "2026-03-12T23:12:21", "rag_session_id": "849fc2c9-e17c-4034-b3b5-2e13d535bb94", "expected_intent": "DOCS_QA", "actual_intent": "DOCS_QA", "graph_id": "DocsQAGraph", "conversation_mode": "START", "query": "Что сказано в документации по деплою?", "symbol_resolution": {"status": "not_requested", "resolved_symbol": null, "alternatives": [], "confidence": 0.0}, "rag_count": 0, "rag_rows": [], "llm_answer": null, "summary": {"router": {"intent": "DOCS_QA", "sub_intent": "EXPLAIN", "confidence": null}, "retrieval": {"profile": "docs", "layers_hit": [], "evidence_sufficient": false}, "llm": {"answer_status": "partial", "groundedness": "not_applicable"}}, "diagnostics": {"router_plan": {"intent": "DOCS_QA", "sub_intent": "EXPLAIN", "graph_id": "DocsQAGraph", "retrieval_profile": "docs", "conversation_mode": "START", "layers": ["D1_MODULE_CATALOG", "D2_FACT_INDEX", "D3_SECTION_INDEX", "D4_POLICY_INDEX"], "symbol_kind_hint": "unknown", "symbol_candidates": [], "keyword_hints": ["documentation", "docs"], "path_hints": [], "path_scope": [], "doc_scope_hints": ["README*", "docs/**", "**/*.md"], "retrieval_constraints": {"include_globs": ["docs/**", "README*", "**/*.md"], "exclude_globs": [".venv/**", "node_modules/**", "**/*.bin", "**/*.png", "**/*.jpg"], "prefer_globs": [], "test_file_globs": [], "test_symbol_patterns": [], "max_candidates": 20, "fuzzy_symbol_search": {"enabled": true, "max_distance": 2, "top_k": 5}}}, "execution": {"executed_layers": [], "retrieval_mode_by_layer": {}, "top_k_by_layer": {}, "filters_by_layer": {}, "repo_scope": {"repo_id": null, "workspace_id": null}}, "retrieval": null, "constraint_violations": [], "timings_ms": {"router": 0, "symbol_resolution": 0, "retrieval_total": 0, "retrieval_by_layer": {}, "merge_rank": 0, "prompt_build": 0, "llm_call": 0}, "prompt": null, "router": {"conversation_mode": "START", "keyword_hints": ["documentation", "docs"], "path_scope": []}, "llm": {"used_evidence_count": 0, "missing_evidence_reason": null}}, "run_info": {"case_id": "docs-generic-question", "mode": "router_only", "run_started_at": "2026-03-12T23:12:21", "rag_session_id": "849fc2c9-e17c-4034-b3b5-2e13d535bb94", "expected_intent": "DOCS_QA", "actual_intent": "DOCS_QA", "graph_id": "DocsQAGraph", "conversation_mode": "START"}, "input_request": {"text": "Что сказано в документации по деплою?", "normalized_query": "Что сказано в документации по деплою?"}, "steps": [{"step": "intent_router", "input": {"query": "Что сказано в документации по деплою?"}, "output": {"intent": "DOCS_QA", "graph_id": "DocsQAGraph", "conversation_mode": "START", "query": "Что сказано в документации по деплою?"}, "diagnostics": {"router_plan": {"intent": "DOCS_QA", "sub_intent": "EXPLAIN", "graph_id": "DocsQAGraph", "retrieval_profile": "docs", "conversation_mode": "START", "layers": ["D1_MODULE_CATALOG", "D2_FACT_INDEX", "D3_SECTION_INDEX", "D4_POLICY_INDEX"], "symbol_kind_hint": "unknown", "symbol_candidates": [], "keyword_hints": ["documentation", "docs"], "path_hints": [], "path_scope": [], "doc_scope_hints": ["README*", "docs/**", "**/*.md"], "retrieval_constraints": {"include_globs": ["docs/**", "README*", "**/*.md"], "exclude_globs": [".venv/**", "node_modules/**", "**/*.bin", "**/*.png", "**/*.jpg"], "prefer_globs": [], "test_file_globs": [], "test_symbol_patterns": [], "max_candidates": 20, "fuzzy_symbol_search": {"enabled": true, "max_distance": 2, "top_k": 5}}}, "timings_ms": {"router": 0}}}]} -{"case_id": "docs-open-readme-ref", "text": "Что про это в docs и README?", "mode": "router_only", "run_started_at": "2026-03-12T23:12:21", "rag_session_id": "849fc2c9-e17c-4034-b3b5-2e13d535bb94", "expected_intent": "DOCS_QA", "actual_intent": "DOCS_QA", "graph_id": "DocsQAGraph", "conversation_mode": "START", "query": "Что про это в docs и README?", "symbol_resolution": {"status": "not_requested", "resolved_symbol": null, "alternatives": [], "confidence": 0.0}, "rag_count": 0, "rag_rows": [], "llm_answer": null, "summary": {"router": {"intent": "DOCS_QA", "sub_intent": "EXPLAIN", "confidence": null}, "retrieval": {"profile": "docs", "layers_hit": [], "evidence_sufficient": false}, "llm": {"answer_status": "partial", "groundedness": "not_applicable"}}, "diagnostics": {"router_plan": {"intent": "DOCS_QA", "sub_intent": "EXPLAIN", "graph_id": "DocsQAGraph", "retrieval_profile": "docs", "conversation_mode": "START", "layers": ["D1_MODULE_CATALOG", "D2_FACT_INDEX", "D3_SECTION_INDEX", "D4_POLICY_INDEX"], "symbol_kind_hint": "unknown", "symbol_candidates": [], "keyword_hints": ["docs", "README"], "path_hints": [], "path_scope": [], "doc_scope_hints": ["README*", "docs/**", "**/*.md", "README"], "retrieval_constraints": {"include_globs": ["docs/**", "README*", "**/*.md"], "exclude_globs": [".venv/**", "node_modules/**", "**/*.bin", "**/*.png", "**/*.jpg"], "prefer_globs": [], "test_file_globs": [], "test_symbol_patterns": [], "max_candidates": 20, "fuzzy_symbol_search": {"enabled": true, "max_distance": 2, "top_k": 5}}}, "execution": {"executed_layers": [], "retrieval_mode_by_layer": {}, "top_k_by_layer": {}, "filters_by_layer": {}, "repo_scope": {"repo_id": null, "workspace_id": null}}, "retrieval": null, "constraint_violations": [], "timings_ms": {"router": 0, "symbol_resolution": 0, "retrieval_total": 0, "retrieval_by_layer": {}, "merge_rank": 0, "prompt_build": 0, "llm_call": 0}, "prompt": null, "router": {"conversation_mode": "START", "keyword_hints": ["docs", "README"], "path_scope": []}, "llm": {"used_evidence_count": 0, "missing_evidence_reason": null}}, "run_info": {"case_id": "docs-open-readme-ref", "mode": "router_only", "run_started_at": "2026-03-12T23:12:21", "rag_session_id": "849fc2c9-e17c-4034-b3b5-2e13d535bb94", "expected_intent": "DOCS_QA", "actual_intent": "DOCS_QA", "graph_id": "DocsQAGraph", "conversation_mode": "START"}, "input_request": {"text": "Что про это в docs и README?", "normalized_query": "Что про это в docs и README?"}, "steps": [{"step": "intent_router", "input": {"query": "Что про это в docs и README?"}, "output": {"intent": "DOCS_QA", "graph_id": "DocsQAGraph", "conversation_mode": "START", "query": "Что про это в docs и README?"}, "diagnostics": {"router_plan": {"intent": "DOCS_QA", "sub_intent": "EXPLAIN", "graph_id": "DocsQAGraph", "retrieval_profile": "docs", "conversation_mode": "START", "layers": ["D1_MODULE_CATALOG", "D2_FACT_INDEX", "D3_SECTION_INDEX", "D4_POLICY_INDEX"], "symbol_kind_hint": "unknown", "symbol_candidates": [], "keyword_hints": ["docs", "README"], "path_hints": [], "path_scope": [], "doc_scope_hints": ["README*", "docs/**", "**/*.md", "README"], "retrieval_constraints": {"include_globs": ["docs/**", "README*", "**/*.md"], "exclude_globs": [".venv/**", "node_modules/**", "**/*.bin", "**/*.png", "**/*.jpg"], "prefer_globs": [], "test_file_globs": [], "test_symbol_patterns": [], "max_candidates": 20, "fuzzy_symbol_search": {"enabled": true, "max_distance": 2, "top_k": 5}}}, "timings_ms": {"router": 0}}}]} diff --git a/tests/pipeline_setup/utils/__init__.py b/tests/pipeline_setup/utils/__init__.py deleted file mode 100644 index 44d088b..0000000 --- a/tests/pipeline_setup/utils/__init__.py +++ /dev/null @@ -1 +0,0 @@ -"""Shared low-level utilities for pipeline_setup, including the reusable RAG indexer.""" diff --git a/tests/pipeline_setup/utils/rag_indexer/__init__.py b/tests/pipeline_setup/utils/rag_indexer/__init__.py deleted file mode 100644 index fb61df0..0000000 --- a/tests/pipeline_setup/utils/rag_indexer/__init__.py +++ /dev/null @@ -1,11 +0,0 @@ -from tests.pipeline_setup.utils.rag_indexer.indexer import ( - DeterministicEmbedder, - LocalRepoFileCollector, - RagSessionIndexer, -) - -__all__ = [ - "DeterministicEmbedder", - "LocalRepoFileCollector", - "RagSessionIndexer", -] diff --git a/tests/pipeline_setup_v2/README.md b/tests/pipeline_setup_v2/README.md deleted file mode 100644 index 413dbe5..0000000 --- a/tests/pipeline_setup_v2/README.md +++ /dev/null @@ -1,118 +0,0 @@ -# pipeline_setup_v2 - -Новый общий harness для двух семейств прогонов: - -- `code_qa_eval` — synthetic/golden проверки -- `runtime` — router_only / router_rag / full_chain - -## Идея - -Один runner: - -- читает все `*.yaml` из папки с кейсами -- для кейса принимает либо `repo_path`, либо `rag_session_id` -- при `repo_path` сам индексирует репозиторий и получает `rag_session_id` -- запускает выбранный runner/mode -- проверяет ожидания -- пишет per-case артефакты и `summary.md` - -## Структура - -- `run.py` — верхнеуровневый entrypoint -- `llm_prompts.yaml` — общий каталог LLM-промтов для `full_chain` -- `cases/` — папки с YAML-наборами кейсов -- `core/` — общий harness: модели, loader, validator, session provider, artifact writer, orchestration -- `runtime/` — конкретные исполнители для `runtime` и `code_qa_eval` -- `test_results/` — артефакты прогонов - -## Запуск - -```bash -PYTHONPATH=. python -m tests.pipeline_setup_v2.run \ - --cases-dir tests/pipeline_setup_v2/cases/suite_01_synthetic \ - --run-name suite_01_smoke -``` - -```bash -PYTHONPATH=. python -m tests.pipeline_setup_v2.run \ - --cases-dir tests/pipeline_setup_v2/cases/suite_02_pipeline \ - --run-name suite_02_smoke -``` - -## Индексация RAG - -Если вы хотите получить `rag_session_id` заранее и подставлять его в кейсы, можно отдельно запустить индексатор: - -```bash -PYTHONPATH=. python -m tests.pipeline_setup.suite_02_pipeline.cli.index_repo \ - --repo-path /absolute/path/to/repo \ - [--project-id my-project] -``` - -На выходе индексатор печатает: - -```bash -rag_session_id= -``` - -После этого `rag_session_id` можно использовать в описании кейса: - -```yaml -cases: - - id: explain-existing-session - runner: runtime - mode: router_rag - query: "Как работает OrderService?" - input: - rag_session_id: "" -``` - -Если в кейсе вместо `rag_session_id` указан `repo_path`, то `pipeline_setup_v2` сам выполнит индексацию перед прогоном. - -## Формат кейсов - -Runner читает несколько YAML-файлов из одной папки. - -Поддерживаемые поля: - -- `defaults.runner`: `runtime` или `code_qa_eval` -- `defaults.mode`: `router_only`, `router_rag`, `full_chain` -- `defaults.input.repo_path` -- `defaults.input.project_id` -- `defaults.input.rag_session_id` - -На уровне кейса: - -- `id` -- `query` -- `runner` -- `mode` -- `input` -- `expected.router.*` -- `expected.retrieval.*` -- `expected.llm.*` -- `expected.pipeline.answer_mode` - -## LLM Промпты - -Общий каталог промтов для `full_chain` находится в: - -- `tests/pipeline_setup_v2/llm_prompts.yaml` - -Выбор шаблона идёт в таком порядке: - -- `intent + sub_intent` -- fallback на `intent` -- fallback на `default` - -## Артефакты - -Результаты пишутся в: - -- `tests/pipeline_setup_v2/test_results///` - -Там создаются: - -- `*.json` по каждому кейсу -- `*.md` по каждому кейсу -- `summary.md` diff --git a/tests/pipeline_setup_v2/__init__.py b/tests/pipeline_setup_v2/__init__.py deleted file mode 100644 index e51cb77..0000000 --- a/tests/pipeline_setup_v2/__init__.py +++ /dev/null @@ -1 +0,0 @@ -"""Unified pipeline test harness for synthetic eval and runtime integration runs.""" diff --git a/tests/pipeline_setup_v2/cases/suite_01_synthetic/code_qa_eval.yaml b/tests/pipeline_setup_v2/cases/suite_01_synthetic/code_qa_eval.yaml deleted file mode 100644 index 0afe259..0000000 --- a/tests/pipeline_setup_v2/cases/suite_01_synthetic/code_qa_eval.yaml +++ /dev/null @@ -1,80 +0,0 @@ -defaults: - runner: code_qa_eval - mode: router_rag - input: - repo_path: "../../../pipeline_setup/suite_01_synthetic/fixtures/code_qa_repo" - project_id: code_qa_repo - -cases: - - id: open_file_main_positive - query: "Открой файл main.py" - expected: - router: - intent: CODE_QA - sub_intent: OPEN_FILE - retrieval: - path_scope_contains: ["main.py"] - pipeline: - answer_mode: normal - - - id: open_file_api_positive - query: "Покажи src/order_app/api/orders.py" - expected: - router: - intent: CODE_QA - sub_intent: OPEN_FILE - retrieval: - path_scope_contains: ["src/order_app/api/orders.py"] - pipeline: - answer_mode: normal - - - id: explain_order_positive - query: "Объясни класс Order" - expected: - router: - intent: CODE_QA - sub_intent: EXPLAIN - retrieval: - symbol_candidates_contain: ["Order"] - pipeline: - answer_mode: normal - - - id: explain_order_service_positive - query: "Как работает OrderService?" - expected: - router: - intent: CODE_QA - sub_intent: EXPLAIN - retrieval: - symbol_candidates_contain: ["OrderService"] - pipeline: - answer_mode: normal - - - id: find_tests_positive - query: "Где тесты для OrderService?" - expected: - router: - intent: CODE_QA - sub_intent: FIND_TESTS - retrieval: - symbol_candidates_contain: ["OrderService"] - pipeline: - answer_mode: normal - - - id: find_entrypoints_positive - query: "Какие точки входа в приложение?" - expected: - router: - intent: CODE_QA - sub_intent: FIND_ENTRYPOINTS - pipeline: - answer_mode: normal - - - id: general_qa_positive - query: "Что делает этот проект?" - expected: - router: - intent: CODE_QA - sub_intent: GENERAL_QA - pipeline: - answer_mode: normal diff --git a/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_retrieval.yaml b/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_retrieval.yaml deleted file mode 100644 index 3b9e8f0..0000000 --- a/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_retrieval.yaml +++ /dev/null @@ -1,96 +0,0 @@ -defaults: - runner: runtime - mode: full_chain - input: - rag_session_id: "7d11da21-faa0-4cea-aede-aeabe069164c" - -cases: - - id: plba-fullchain-explain-runtime-manager - query: "Объясни как работает класс RuntimeManager" - expected: - router: - intent: CODE_QA - sub_intent: EXPLAIN - graph_id: CodeQAGraph - conversation_mode: START - retrieval: - non_empty: true - symbol_candidates_contain: ["RuntimeManager"] - layers_include: ["C1_SYMBOL_CATALOG", "C0_SOURCE_CHUNKS"] - llm: - non_empty: true - - - id: plba-fullchain-explain-http-control-channel - query: "Объясни класс HttpControlChannel" - expected: - router: - intent: CODE_QA - sub_intent: EXPLAIN - graph_id: CodeQAGraph - conversation_mode: START - retrieval: - non_empty: true - symbol_candidates_contain: ["HttpControlChannel"] - layers_include: ["C1_SYMBOL_CATALOG", "C0_SOURCE_CHUNKS"] - llm: - non_empty: true - - - id: plba-fullchain-explain-control-plane-service - query: "Объясни класс ControlPlaneService" - expected: - router: - intent: CODE_QA - sub_intent: EXPLAIN - graph_id: CodeQAGraph - conversation_mode: START - retrieval: - non_empty: true - symbol_candidates_contain: ["ControlPlaneService"] - layers_include: ["C1_SYMBOL_CATALOG", "C0_SOURCE_CHUNKS"] - llm: - non_empty: true - - - id: plba-fullchain-explain-trace-service - query: "Как работает TraceService?" - expected: - router: - intent: CODE_QA - sub_intent: EXPLAIN - graph_id: CodeQAGraph - conversation_mode: START - retrieval: - non_empty: true - symbol_candidates_contain: ["TraceService"] - layers_include: ["C1_SYMBOL_CATALOG", "C0_SOURCE_CHUNKS"] - llm: - non_empty: true - - - id: plba-fullchain-explain-create-runtime - query: "Объясни функцию create_runtime" - expected: - router: - intent: CODE_QA - sub_intent: EXPLAIN - graph_id: CodeQAGraph - conversation_mode: START - retrieval: - non_empty: true - symbol_candidates_contain: ["create_runtime"] - layers_include: ["C1_SYMBOL_CATALOG", "C0_SOURCE_CHUNKS"] - llm: - non_empty: true - - - id: plba-fullchain-explain-workflow-engine - query: "Объясни класс WorkflowEngine" - expected: - router: - intent: CODE_QA - sub_intent: EXPLAIN - graph_id: CodeQAGraph - conversation_mode: START - retrieval: - non_empty: true - symbol_candidates_contain: ["WorkflowEngine"] - layers_include: ["C1_SYMBOL_CATALOG", "C0_SOURCE_CHUNKS"] - llm: - non_empty: true diff --git a/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_subintents.yaml b/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_subintents.yaml deleted file mode 100644 index 68055c8..0000000 --- a/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_subintents.yaml +++ /dev/null @@ -1,110 +0,0 @@ -defaults: - runner: runtime - mode: full_chain - input: - rag_session_id: "7d11da21-faa0-4cea-aede-aeabe069164c" - -cases: - - id: plba-fullchain-open-file-runtime - query: "Открой файл src/app_runtime/core/runtime.py" - expected: - router: - intent: CODE_QA - sub_intent: OPEN_FILE - graph_id: CodeQAGraph - conversation_mode: START - retrieval: - non_empty: true - path_scope_contains: ["src/app_runtime/core/runtime.py"] - layers_include: ["C0_SOURCE_CHUNKS"] - llm: - non_empty: true - - - id: plba-fullchain-explain-runtime-manager - query: "Объясни как работает класс RuntimeManager" - expected: - router: - intent: CODE_QA - sub_intent: EXPLAIN - graph_id: CodeQAGraph - conversation_mode: START - retrieval: - non_empty: true - symbol_candidates_contain: ["RuntimeManager"] - layers_include: ["C1_SYMBOL_CATALOG", "C0_SOURCE_CHUNKS"] - llm: - non_empty: true - - - id: plba-fullchain-find-tests-runtime-manager - query: "Где тесты для RuntimeManager?" - expected: - router: - intent: CODE_QA - sub_intent: FIND_TESTS - graph_id: CodeQAGraph - conversation_mode: START - retrieval: - non_empty: true - symbol_candidates_contain: ["RuntimeManager"] - layers_include: ["C1_SYMBOL_CATALOG", "C2_DEPENDENCY_GRAPH", "C0_SOURCE_CHUNKS"] - llm: - non_empty: true - - - id: plba-fullchain-find-entrypoints - query: "Найди точки входа в коде" - expected: - router: - intent: CODE_QA - sub_intent: FIND_ENTRYPOINTS - graph_id: CodeQAGraph - conversation_mode: START - retrieval: - non_empty: true - layers_include: ["C3_ENTRYPOINTS", "C0_SOURCE_CHUNKS"] - llm: - non_empty: true - - - id: plba-fullchain-trace-flow-runtime-manager - query: "Покажи поток выполнения RuntimeManager" - expected: - router: - intent: CODE_QA - sub_intent: TRACE_FLOW - graph_id: CodeQAGraph - conversation_mode: START - retrieval: - non_empty: true - symbol_candidates_contain: ["RuntimeManager"] - layers_include: ["C2_DEPENDENCY_GRAPH", "C3_ENTRYPOINTS"] - llm: - non_empty: true - - - id: plba-fullchain-architecture-control-plane - query: "Какие компоненты участвуют в RuntimeManager?" - expected: - router: - intent: CODE_QA - sub_intent: ARCHITECTURE - graph_id: CodeQAGraph - conversation_mode: START - retrieval: - non_empty: true - layers_include: ["C4_SEMANTIC_ROLES", "C2_DEPENDENCY_GRAPH", "C3_ENTRYPOINTS"] - llm: - non_empty: true - - - id: plba-fullchain-explain-local-runtime-manager - query: "Почему в файле src/app_runtime/core/runtime.py класс RuntimeManager устроен так?" - expected: - router: - intent: CODE_QA - sub_intent: EXPLAIN_LOCAL - graph_id: CodeQAGraph - conversation_mode: START - retrieval: - non_empty: true - path_scope_contains: ["src/app_runtime/core/runtime.py"] - symbol_candidates_contain: ["RuntimeManager"] - layers_include: ["C1_SYMBOL_CATALOG", "C0_SOURCE_CHUNKS", "C2_DEPENDENCY_GRAPH"] - llm: - non_empty: true diff --git a/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_subintents_v2.yaml b/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_subintents_v2.yaml deleted file mode 100644 index c019d02..0000000 --- a/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_subintents_v2.yaml +++ /dev/null @@ -1,305 +0,0 @@ -defaults: - runner: runtime - mode: full_chain - input: - rag_session_id: "7d11da21-faa0-4cea-aede-aeabe069164c" - -cases: - # OPEN_FILE - - id: plba-v2-open-file-runtime - query: "Открой файл src/app_runtime/core/runtime.py" - expected: - router: - intent: CODE_QA - sub_intent: OPEN_FILE - graph_id: CodeQAGraph - conversation_mode: START - retrieval: - non_empty: true - path_scope_contains: ["src/app_runtime/core/runtime.py"] - layers_include: ["C0_SOURCE_CHUNKS"] - llm: - non_empty: true - answer_mode: answered - - - id: plba-v2-open-file-public-api - query: "Открой файл src/plba/__init__.py" - expected: - router: - intent: CODE_QA - sub_intent: OPEN_FILE - graph_id: CodeQAGraph - conversation_mode: START - retrieval: - non_empty: true - path_scope_contains: ["src/plba/__init__.py"] - layers_include: ["C0_SOURCE_CHUNKS"] - llm: - non_empty: true - excludes: ["из различных подпакетов", "ответ основан исключительно"] - - # EXPLAIN - - id: plba-v2-explain-runtime-manager - query: "Объясни как работает класс RuntimeManager" - expected: - router: - intent: CODE_QA - sub_intent: EXPLAIN - graph_id: CodeQAGraph - conversation_mode: START - retrieval: - non_empty: true - symbol_candidates_contain: ["RuntimeManager"] - layers_include: ["C1_SYMBOL_CATALOG", "C0_SOURCE_CHUNKS", "C2_DEPENDENCY_GRAPH"] - llm: - non_empty: true - excludes: ["ряд аргументов", "основные службы"] - - - id: plba-v2-explain-trace-service - query: "Объясни как работает класс TraceService" - expected: - router: - intent: CODE_QA - sub_intent: EXPLAIN - graph_id: CodeQAGraph - conversation_mode: START - retrieval: - non_empty: true - symbol_candidates_contain: ["TraceService"] - layers_include: ["C1_SYMBOL_CATALOG", "C0_SOURCE_CHUNKS", "C2_DEPENDENCY_GRAPH"] - llm: - non_empty: true - answer_mode: answered - - - id: plba-v2-explain-create-runtime - query: "Что делает функция create_runtime?" - expected: - router: - intent: CODE_QA - sub_intent: EXPLAIN - graph_id: CodeQAGraph - conversation_mode: START - retrieval: - non_empty: true - symbol_candidates_contain: ["create_runtime"] - layers_include: ["C1_SYMBOL_CATALOG", "C0_SOURCE_CHUNKS"] - llm: - non_empty: true - answer_mode: answered - - - id: plba-v2-explain-local-http-channel - query: "Почему в файле src/app_runtime/control/http_channel.py класс HttpControlChannel устроен так?" - expected: - router: - intent: CODE_QA - sub_intent: EXPLAIN_LOCAL - graph_id: CodeQAGraph - conversation_mode: START - retrieval: - non_empty: true - path_scope_contains: ["src/app_runtime/control/http_channel.py"] - symbol_candidates_contain: ["HttpControlChannel"] - layers_include: ["C1_SYMBOL_CATALOG", "C0_SOURCE_CHUNKS", "C2_DEPENDENCY_GRAPH"] - llm: - non_empty: true - answer_mode: answered - - # FIND_TESTS - - id: plba-v2-find-tests-runtime-manager - query: "Где тесты для RuntimeManager?" - expected: - router: - intent: CODE_QA - sub_intent: FIND_TESTS - graph_id: CodeQAGraph - conversation_mode: START - retrieval: - non_empty: true - symbol_candidates_contain: ["RuntimeManager"] - layers_include: ["C1_SYMBOL_CATALOG", "C2_DEPENDENCY_GRAPH", "C0_SOURCE_CHUNKS"] - llm: - non_empty: true - answer_mode: answered - - - id: plba-v2-find-tests-trace-service - query: "Где тесты для TraceService?" - expected: - router: - intent: CODE_QA - sub_intent: FIND_TESTS - graph_id: CodeQAGraph - conversation_mode: START - retrieval: - non_empty: true - symbol_candidates_contain: ["TraceService"] - layers_include: ["C1_SYMBOL_CATALOG", "C2_DEPENDENCY_GRAPH", "C0_SOURCE_CHUNKS"] - llm: - non_empty: true - answer_mode: answered - - - id: plba-v2-find-tests-create-runtime - query: "Где тесты для create_runtime?" - expected: - router: - intent: CODE_QA - sub_intent: FIND_TESTS - graph_id: CodeQAGraph - conversation_mode: START - retrieval: - non_empty: true - symbol_candidates_contain: ["create_runtime"] - layers_include: ["C1_SYMBOL_CATALOG", "C2_DEPENDENCY_GRAPH", "C0_SOURCE_CHUNKS"] - llm: - non_empty: true - answer_mode: answered - - - id: plba-v2-find-tests-workflow-runtime-factory-negative - query: "Где тесты для WorkflowRuntimeFactory?" - expected: - router: - intent: CODE_QA - sub_intent: FIND_TESTS - graph_id: CodeQAGraph - conversation_mode: START - retrieval: - direct_symbol_test_hits_max: 0 - symbol_candidates_contain: ["WorkflowRuntimeFactory"] - layers_include: ["C1_SYMBOL_CATALOG", "C2_DEPENDENCY_GRAPH", "C0_SOURCE_CHUNKS"] - llm: - non_empty: true - - # FIND_ENTRYPOINTS - - id: plba-v2-find-entrypoints-control-plane - query: "Найди точки входа HTTP control plane" - expected: - router: - intent: CODE_QA - sub_intent: FIND_ENTRYPOINTS - graph_id: CodeQAGraph - conversation_mode: START - retrieval: - non_empty: true - layers_include: ["C3_ENTRYPOINTS", "C0_SOURCE_CHUNKS"] - llm: - non_empty: true - answer_mode: answered - - - id: plba-v2-find-entrypoints-health-endpoint - query: "Где health endpoint?" - expected: - router: - intent: CODE_QA - sub_intent: FIND_ENTRYPOINTS - graph_id: CodeQAGraph - conversation_mode: START - retrieval: - non_empty: true - layers_include: ["C3_ENTRYPOINTS", "C0_SOURCE_CHUNKS"] - llm: - non_empty: true - contains_all: ["GET /health"] - excludes: ["нет явных неподтвержденных кандидатов", "кандидаты на health-endpoint"] - - # TRACE_FLOW - - id: plba-v2-trace-flow-runtime-start - query: "Покажи поток выполнения при запуске RuntimeManager" - expected: - router: - intent: CODE_QA - sub_intent: TRACE_FLOW - graph_id: CodeQAGraph - conversation_mode: START - retrieval: - non_empty: true - symbol_candidates_contain: ["RuntimeManager"] - layers_include: ["C2_DEPENDENCY_GRAPH", "C3_ENTRYPOINTS", "C0_SOURCE_CHUNKS"] - llm: - non_empty: true - answer_mode: answered - - - id: plba-v2-trace-flow-health-endpoint - query: "Покажи как проходит запрос /health в HttpControlAppFactory" - expected: - router: - intent: CODE_QA - sub_intent: TRACE_FLOW - graph_id: CodeQAGraph - conversation_mode: START - retrieval: - non_empty: true - symbol_candidates_contain: ["HttpControlAppFactory"] - layers_include: ["C2_DEPENDENCY_GRAPH", "C3_ENTRYPOINTS", "C0_SOURCE_CHUNKS"] - llm: - non_empty: true - answer_mode: answered - - # ARCHITECTURE - - id: plba-v2-architecture-runtime-manager - query: "Какие компоненты участвуют в RuntimeManager?" - expected: - router: - intent: CODE_QA - sub_intent: ARCHITECTURE - graph_id: CodeQAGraph - conversation_mode: START - retrieval: - non_empty: true - symbol_candidates_contain: ["RuntimeManager"] - layers_include: ["C4_SEMANTIC_ROLES", "C2_DEPENDENCY_GRAPH", "C0_SOURCE_CHUNKS"] - llm: - non_empty: true - answer_mode: answered - - - id: plba-v2-architecture-control-plane - query: "Какие компоненты участвуют в ControlPlaneService?" - expected: - router: - intent: CODE_QA - sub_intent: ARCHITECTURE - graph_id: CodeQAGraph - conversation_mode: START - retrieval: - non_empty: true - symbol_candidates_contain: ["ControlPlaneService"] - layers_include: ["C4_SEMANTIC_ROLES", "C2_DEPENDENCY_GRAPH", "C0_SOURCE_CHUNKS"] - llm: - non_empty: true - answer_mode: answered - - # NEGATIVE / NOT FOUND - - id: plba-v2-explain-nonexistent-symbol - query: "Объясни класс RuntimeFactoryManager" - expected: - router: - intent: CODE_QA - sub_intent: EXPLAIN - graph_id: CodeQAGraph - conversation_mode: START - retrieval: - non_empty: false - symbol_candidates_contain: ["RuntimeFactoryManager"] - layers_include: ["C1_SYMBOL_CATALOG", "C0_SOURCE_CHUNKS"] - llm: - non_empty: true - contains_all: ["не найдена"] - excludes: ["исходя из названия", "вероятно этот класс", "возможное предназначение"] - pipeline: - answer_mode: degraded - - - id: plba-v2-open-file-nonexistent - query: "Открой файл src/app_runtime/core/missing_runtime.py" - expected: - router: - intent: CODE_QA - sub_intent: OPEN_FILE - graph_id: CodeQAGraph - conversation_mode: START - retrieval: - non_empty: false - path_scope_contains: ["src/app_runtime/core/missing_runtime.py"] - layers_include: ["C0_SOURCE_CHUNKS"] - llm: - non_empty: true - contains_all: ["Файл src/app_runtime/core/missing_runtime.py не найден."] - pipeline: - answer_mode: not_found diff --git a/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_smoke.yaml b/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_smoke.yaml deleted file mode 100644 index ee1b4b9..0000000 --- a/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_smoke.yaml +++ /dev/null @@ -1,17 +0,0 @@ -defaults: - runner: runtime - mode: full_chain - input: - repo_path: "../../../pipeline_setup/suite_01_synthetic/fixtures/code_qa_repo" - project_id: code_qa_repo_full_chain - -cases: - - id: full_chain_explain_order_service - query: "Как работает OrderService?" - expected: - router: - intent: CODE_QA - retrieval: - non_empty: true - llm: - non_empty: true diff --git a/tests/pipeline_setup_v2/cases/suite_02_pipeline/router_only_plba_code_retrieval.yaml b/tests/pipeline_setup_v2/cases/suite_02_pipeline/router_only_plba_code_retrieval.yaml deleted file mode 100644 index ea2a24f..0000000 --- a/tests/pipeline_setup_v2/cases/suite_02_pipeline/router_only_plba_code_retrieval.yaml +++ /dev/null @@ -1,123 +0,0 @@ -defaults: - runner: runtime - mode: router_only - input: - repo_path: "/Users/alex/Dev_projects_v2/apps/plba" - rag_session_id: "7d11da21-faa0-4cea-aede-aeabe069164c" - project_id: plba - -cases: - - id: plba-open-runtime-manager-file - query: "Открой файл src/app_runtime/core/runtime.py" - expected: - router: - intent: CODE_QA - sub_intent: OPEN_FILE - graph_id: CodeQAGraph - conversation_mode: START - - - id: plba-open-http-control-channel-file - query: "Покажи файл src/app_runtime/control/http_channel.py" - expected: - router: - intent: CODE_QA - sub_intent: OPEN_FILE - graph_id: CodeQAGraph - conversation_mode: START - - - id: plba-explain-runtime-manager - query: "Объясни как работает класс RuntimeManager" - expected: - router: - intent: CODE_QA - sub_intent: EXPLAIN - graph_id: CodeQAGraph - conversation_mode: START - retrieval: - symbol_candidates_contain: ["RuntimeManager"] - - - id: plba-explain-http-control-channel - query: "Объясни класс HttpControlChannel" - expected: - router: - intent: CODE_QA - sub_intent: EXPLAIN - graph_id: CodeQAGraph - conversation_mode: START - retrieval: - symbol_candidates_contain: ["HttpControlChannel"] - - - id: plba-explain-trace-service - query: "Как работает TraceService?" - expected: - router: - intent: CODE_QA - sub_intent: EXPLAIN - graph_id: CodeQAGraph - conversation_mode: START - retrieval: - symbol_candidates_contain: ["TraceService"] - - - id: plba-find-tests-runtime-manager - query: "Где тесты для RuntimeManager?" - expected: - router: - intent: CODE_QA - sub_intent: FIND_TESTS - graph_id: CodeQAGraph - conversation_mode: START - retrieval: - symbol_candidates_contain: ["RuntimeManager"] - - - id: plba-find-tests-http-control-channel - query: "Найди тесты для HttpControlChannel" - expected: - router: - intent: CODE_QA - sub_intent: FIND_TESTS - graph_id: CodeQAGraph - conversation_mode: START - retrieval: - symbol_candidates_contain: ["HttpControlChannel"] - - - id: plba-find-entrypoints-create-runtime - query: "Найди точки входа в коде" - expected: - router: - intent: CODE_QA - sub_intent: FIND_ENTRYPOINTS - graph_id: CodeQAGraph - conversation_mode: START - - - id: plba-find-entrypoints-bootstrap - query: "Объясни функцию create_runtime" - expected: - router: - intent: CODE_QA - sub_intent: EXPLAIN - graph_id: CodeQAGraph - conversation_mode: START - retrieval: - symbol_candidates_contain: ["create_runtime"] - - - id: plba-general-qa-runtime - query: "Объясни модуль runtime" - expected: - router: - intent: CODE_QA - sub_intent: EXPLAIN - graph_id: CodeQAGraph - conversation_mode: START - retrieval: - symbol_candidates_contain: ["runtime"] - - - id: plba-general-qa-control-plane - query: "Объясни код control plane" - expected: - router: - intent: CODE_QA - sub_intent: EXPLAIN - graph_id: CodeQAGraph - conversation_mode: START - retrieval: - symbol_candidates_contain: ["control", "plane"] diff --git a/tests/pipeline_setup_v2/cases/suite_02_pipeline/router_only_smoke.yaml b/tests/pipeline_setup_v2/cases/suite_02_pipeline/router_only_smoke.yaml deleted file mode 100644 index afc1c4e..0000000 --- a/tests/pipeline_setup_v2/cases/suite_02_pipeline/router_only_smoke.yaml +++ /dev/null @@ -1,16 +0,0 @@ -defaults: - runner: runtime - mode: router_only - -cases: - - id: router_only_open_fixture_main - query: "Открой файл main.py" - expected: - router: - intent: CODE_QA - - - id: router_only_docs_question - query: "Что сказано в README?" - expected: - router: - intent: DOCS_QA diff --git a/tests/pipeline_setup_v2/cases/suite_02_pipeline/router_rag_plba_code_retrieval.yaml b/tests/pipeline_setup_v2/cases/suite_02_pipeline/router_rag_plba_code_retrieval.yaml deleted file mode 100644 index a9d8e4c..0000000 --- a/tests/pipeline_setup_v2/cases/suite_02_pipeline/router_rag_plba_code_retrieval.yaml +++ /dev/null @@ -1,148 +0,0 @@ -defaults: - runner: runtime - mode: router_rag - input: - rag_session_id: "7d11da21-faa0-4cea-aede-aeabe069164c" - -cases: - - id: plba-rag-open-runtime-manager-file - query: "Открой файл src/app_runtime/core/runtime.py" - expected: - router: - intent: CODE_QA - sub_intent: OPEN_FILE - graph_id: CodeQAGraph - conversation_mode: START - retrieval: - non_empty: true - path_scope_contains: ["src/app_runtime/core/runtime.py"] - layers_include: ["C0_SOURCE_CHUNKS"] - - - id: plba-rag-open-http-control-channel-file - query: "Покажи файл src/app_runtime/control/http_channel.py" - expected: - router: - intent: CODE_QA - sub_intent: OPEN_FILE - graph_id: CodeQAGraph - conversation_mode: START - retrieval: - non_empty: true - path_scope_contains: ["src/app_runtime/control/http_channel.py"] - layers_include: ["C0_SOURCE_CHUNKS"] - - - id: plba-rag-explain-runtime-manager - query: "Объясни как работает класс RuntimeManager" - expected: - router: - intent: CODE_QA - sub_intent: EXPLAIN - graph_id: CodeQAGraph - conversation_mode: START - retrieval: - non_empty: true - symbol_candidates_contain: ["RuntimeManager"] - layers_include: ["C1_SYMBOL_CATALOG", "C0_SOURCE_CHUNKS"] - - - id: plba-rag-explain-http-control-channel - query: "Объясни класс HttpControlChannel" - expected: - router: - intent: CODE_QA - sub_intent: EXPLAIN - graph_id: CodeQAGraph - conversation_mode: START - retrieval: - non_empty: true - symbol_candidates_contain: ["HttpControlChannel"] - layers_include: ["C1_SYMBOL_CATALOG", "C0_SOURCE_CHUNKS"] - - - id: plba-rag-explain-trace-service - query: "Как работает TraceService?" - expected: - router: - intent: CODE_QA - sub_intent: EXPLAIN - graph_id: CodeQAGraph - conversation_mode: START - retrieval: - non_empty: true - symbol_candidates_contain: ["TraceService"] - layers_include: ["C1_SYMBOL_CATALOG", "C0_SOURCE_CHUNKS"] - - - id: plba-rag-find-tests-runtime-manager - query: "Где тесты для RuntimeManager?" - expected: - router: - intent: CODE_QA - sub_intent: FIND_TESTS - graph_id: CodeQAGraph - conversation_mode: START - retrieval: - non_empty: true - symbol_candidates_contain: ["RuntimeManager"] - layers_include: ["C1_SYMBOL_CATALOG", "C2_DEPENDENCY_GRAPH", "C0_SOURCE_CHUNKS"] - - - id: plba-rag-find-tests-http-control-channel - query: "Найди тесты для HttpControlChannel" - expected: - router: - intent: CODE_QA - sub_intent: FIND_TESTS - graph_id: CodeQAGraph - conversation_mode: START - retrieval: - non_empty: true - symbol_candidates_contain: ["HttpControlChannel"] - layers_include: ["C1_SYMBOL_CATALOG", "C2_DEPENDENCY_GRAPH", "C0_SOURCE_CHUNKS"] - - - id: plba-rag-find-entrypoints - query: "Найди точки входа в коде" - expected: - router: - intent: CODE_QA - sub_intent: FIND_ENTRYPOINTS - graph_id: CodeQAGraph - conversation_mode: START - retrieval: - non_empty: true - layers_include: ["C3_ENTRYPOINTS", "C0_SOURCE_CHUNKS"] - - - id: plba-rag-explain-create-runtime - query: "Объясни функцию create_runtime" - expected: - router: - intent: CODE_QA - sub_intent: EXPLAIN - graph_id: CodeQAGraph - conversation_mode: START - retrieval: - non_empty: true - symbol_candidates_contain: ["create_runtime"] - layers_include: ["C1_SYMBOL_CATALOG", "C0_SOURCE_CHUNKS"] - - - id: plba-rag-explain-control-plane-service - query: "Объясни класс ControlPlaneService" - expected: - router: - intent: CODE_QA - sub_intent: EXPLAIN - graph_id: CodeQAGraph - conversation_mode: START - retrieval: - non_empty: true - symbol_candidates_contain: ["ControlPlaneService"] - layers_include: ["C1_SYMBOL_CATALOG", "C0_SOURCE_CHUNKS"] - - - id: plba-rag-explain-workflow-engine - query: "Объясни класс WorkflowEngine" - expected: - router: - intent: CODE_QA - sub_intent: EXPLAIN - graph_id: CodeQAGraph - conversation_mode: START - retrieval: - non_empty: true - symbol_candidates_contain: ["WorkflowEngine"] - layers_include: ["C1_SYMBOL_CATALOG", "C0_SOURCE_CHUNKS"] diff --git a/tests/pipeline_setup_v2/cases/suite_02_pipeline/router_rag_smoke.yaml b/tests/pipeline_setup_v2/cases/suite_02_pipeline/router_rag_smoke.yaml deleted file mode 100644 index 48796f5..0000000 --- a/tests/pipeline_setup_v2/cases/suite_02_pipeline/router_rag_smoke.yaml +++ /dev/null @@ -1,23 +0,0 @@ -defaults: - runner: runtime - mode: router_rag - input: - repo_path: "../../../pipeline_setup/suite_01_synthetic/fixtures/code_qa_repo" - project_id: code_qa_repo_runtime - -cases: - - id: router_rag_open_fixture_main - query: "Открой файл main.py" - expected: - router: - intent: CODE_QA - retrieval: - non_empty: true - - - id: router_rag_explain_order - query: "Объясни класс Order" - expected: - router: - intent: CODE_QA - retrieval: - non_empty: true diff --git a/tests/pipeline_setup_v2/core/__init__.py b/tests/pipeline_setup_v2/core/__init__.py deleted file mode 100644 index 2191113..0000000 --- a/tests/pipeline_setup_v2/core/__init__.py +++ /dev/null @@ -1 +0,0 @@ -"""Core contracts and orchestration for pipeline_setup_v2.""" diff --git a/tests/pipeline_setup_v2/core/artifacts.py b/tests/pipeline_setup_v2/core/artifacts.py deleted file mode 100644 index 06b07a9..0000000 --- a/tests/pipeline_setup_v2/core/artifacts.py +++ /dev/null @@ -1,151 +0,0 @@ -from __future__ import annotations - -import json -from datetime import datetime -from pathlib import Path - -from tests.pipeline_setup_v2.core.models import V2CaseResult - - -class ArtifactWriter: - def __init__(self, root: Path, run_name: str, started_at: datetime) -> None: - stamp = started_at.strftime("%Y%m%d_%H%M%S") - self.run_dir = root / run_name / stamp - self.run_dir.mkdir(parents=True, exist_ok=True) - - def write_case(self, result: V2CaseResult) -> None: - stem = f"{result.case.source_file.stem}_{result.case.case_id}" - (self.run_dir / f"{stem}.json").write_text( - json.dumps( - { - "case_id": result.case.case_id, - "source_file": result.case.source_file.as_posix(), - "runner": result.case.runner, - "mode": result.case.mode, - "actual": result.actual, - "passed": result.passed, - "mismatches": result.mismatches, - "details": result.details, - }, - ensure_ascii=False, - indent=2, - ), - encoding="utf-8", - ) - lines = [ - f"# {result.case.case_id}", - "", - f"- source_file: {result.case.source_file.as_posix()}", - f"- runner: {result.case.runner}", - f"- mode: {result.case.mode}", - f"- passed: {result.passed}", - "", - "## Query", - result.case.query, - "", - "## Actual", - json.dumps(result.actual, ensure_ascii=False, indent=2), - "", - "## Mismatches", - *([f"- {item}" for item in result.mismatches] or ["- none"]), - ] - (self.run_dir / f"{stem}.md").write_text("\n".join(lines), encoding="utf-8") - - def write_summary(self, results: list[V2CaseResult]) -> Path: - path = self.run_dir / "summary.md" - path.write_text(SummaryComposer().compose(results), encoding="utf-8") - return path - - -class SummaryComposer: - def compose(self, results: list[V2CaseResult]) -> str: - passed = sum(1 for item in results if item.passed) - lines = [ - "# pipeline_setup_v2 summary", - "", - f"Passed: {passed}/{len(results)}", - "", - "| File | Case | Query | Expected sub-intent | Intent | Actual sub-intent | RAG layers | Tokens | Pass |", - "|------|------|-------|---------------------|--------|-------------------|------------|--------|------|", - ] - lines.extend(self._result_rows(results)) - lines.extend(self._failure_section(results)) - lines.extend(self._llm_section(results)) - return "\n".join(lines) - - def _result_rows(self, results: list[V2CaseResult]) -> list[str]: - rows: list[str] = [] - for item in results: - actual = item.actual - rows.append( - f"| {item.case.source_file.name} | {item.case.case_id} | {self._table_text(item.case.query)} | " - f"{item.case.expectations.router.sub_intent or '—'} | {actual.get('intent') or '—'} | " - f"{actual.get('sub_intent') or '—'} | {self._rag_layers_text(item)} | {self._token_text(item)} | {'✓' if item.passed else '✗'} |" - ) - return rows - - def _failure_section(self, results: list[V2CaseResult]) -> list[str]: - failures = [item for item in results if not item.passed] - if not failures: - return [] - lines = ["", "## Failures"] - for item in failures: - lines.append(f"- **{item.case.case_id}**: {'; '.join(item.mismatches)}") - return lines - - def _llm_section(self, results: list[V2CaseResult]) -> list[str]: - llm_results = [item for item in results if str(item.actual.get("llm_answer") or "").strip()] - if not llm_results: - return [] - lines = ["", "## LLM Answers"] - for item in llm_results: - lines.append(f"- **{item.case.case_id}**") - lines.append(f" Query: {self._table_text(item.case.query, limit=400)}") - lines.extend(self._quote_block(self._snippet(str(item.actual.get("llm_answer") or "")))) - return lines - - def _snippet(self, text: str, limit: int = 880) -> str: - compact = " ".join(text.split()) - if len(compact) <= limit: - return compact - return compact[: limit - 1].rstrip() + "…" - - def _table_text(self, text: str, limit: int = 140) -> str: - compact = " ".join(text.split()).replace("|", "\\|") - if len(compact) <= limit: - return compact - return compact[: limit - 1].rstrip() + "…" - - def _quote_block(self, text: str) -> list[str]: - quoted = text.strip() - if not quoted: - return [" > —"] - return [f" > {self._escape_markdown(line)}" for line in quoted.splitlines()] - - def _escape_markdown(self, text: str) -> str: - escaped = text - for char in ("\\", "`", "*", "_", "{", "}", "[", "]", "(", ")", "#", "+", "-", "!", "|"): - escaped = escaped.replace(char, f"\\{char}") - return escaped - - def _rag_layers_text(self, item: V2CaseResult) -> str: - rows = list(item.details.get("rag_rows") or []) - if not rows: - return "—" - counts: dict[str, int] = {} - for row in rows: - layer = str(row.get("layer") or "").strip() - if not layer: - continue - counts[layer] = counts.get(layer, 0) + 1 - if not counts: - return "—" - parts = [f"{layer}:{counts[layer]}" for layer in sorted(counts)] - return self._table_text(", ".join(parts), limit=120) - - def _token_text(self, item: V2CaseResult) -> str: - diagnostics = dict(item.details.get("diagnostics") or {}) - prompt = dict(diagnostics.get("prompt") or {}) - stats = dict(prompt.get("prompt_stats") or {}) - value = stats.get("tokens_in_estimate") - return str(value) if value is not None else "—" diff --git a/tests/pipeline_setup_v2/core/case_loader.py b/tests/pipeline_setup_v2/core/case_loader.py deleted file mode 100644 index 51e6aa0..0000000 --- a/tests/pipeline_setup_v2/core/case_loader.py +++ /dev/null @@ -1,106 +0,0 @@ -from __future__ import annotations - -from pathlib import Path - -import yaml - -from tests.pipeline_setup_v2.core.models import ( - CaseExpectations, - CaseInput, - LlmExpectation, - PipelineExpectation, - RetrievalExpectation, - RouterExpectation, - V2Case, -) - - -class CaseDirectoryLoader: - def load(self, cases_dir: Path) -> list[V2Case]: - if cases_dir.is_file(): - return self._load_file(cases_dir) - files = sorted(path for path in cases_dir.rglob("*.yaml") if path.is_file()) - if not files: - raise ValueError(f"No YAML case files found in: {cases_dir}") - cases: list[V2Case] = [] - for path in files: - cases.extend(self._load_file(path)) - return cases - - def _load_file(self, path: Path) -> list[V2Case]: - payload = yaml.safe_load(path.read_text(encoding="utf-8")) or {} - if not isinstance(payload, dict): - raise ValueError(f"Invalid case file {path}: expected mapping") - defaults = payload.get("defaults") or {} - items = payload.get("cases") or [] - if not isinstance(items, list): - raise ValueError(f"Invalid case file {path}: `cases` must be a list") - return [self._to_case(path, raw, defaults) for raw in items] - - def _to_case(self, path: Path, raw: object, defaults: dict) -> V2Case: - if not isinstance(raw, dict): - raise ValueError(f"Invalid case in {path}: expected object") - merged_input = {**dict(defaults.get("input") or {}), **dict(raw.get("input") or {})} - runner = str(raw.get("runner") or defaults.get("runner") or "runtime").strip() - mode = str(raw.get("mode") or defaults.get("mode") or "").strip() - case_id = str(raw.get("id") or "").strip() - query = str(raw.get("query") or "").strip() - if not case_id or not query or not runner or not mode: - raise ValueError(f"Invalid case in {path}: `id`, `query`, `runner`, `mode` are required") - expected = dict(raw.get("expected") or {}) - return V2Case( - case_id=case_id, - runner=runner, # type: ignore[arg-type] - mode=mode, # type: ignore[arg-type] - query=query, - source_file=path, - input=self._to_input(path.parent, merged_input), - expectations=self._to_expectations(expected), - notes=str(raw.get("notes") or ""), - tags=tuple(str(item).strip() for item in raw.get("tags", []) if str(item).strip()), - ) - - def _to_input(self, base_dir: Path, raw: dict) -> CaseInput: - repo_path_raw = str(raw.get("repo_path") or "").strip() - repo_path = None - if repo_path_raw: - repo_path = Path(repo_path_raw).expanduser() - if not repo_path.is_absolute(): - repo_path = (base_dir / repo_path).resolve() - return CaseInput( - repo_path=repo_path, - project_id=str(raw.get("project_id") or "").strip() or None, - rag_session_id=str(raw.get("rag_session_id") or "").strip() or None, - ) - - def _to_expectations(self, raw: dict) -> CaseExpectations: - router = dict(raw.get("router") or {}) - retrieval = dict(raw.get("retrieval") or {}) - llm = dict(raw.get("llm") or {}) - pipeline = dict(raw.get("pipeline") or {}) - return CaseExpectations( - router=RouterExpectation( - intent=str(router.get("intent") or "").strip() or None, - sub_intent=str(router.get("sub_intent") or "").strip() or None, - graph_id=str(router.get("graph_id") or "").strip() or None, - conversation_mode=str(router.get("conversation_mode") or "").strip() or None, - ), - retrieval=RetrievalExpectation( - non_empty=retrieval.get("non_empty"), - min_rows=int(retrieval["min_rows"]) if retrieval.get("min_rows") is not None else None, - direct_symbol_test_hits_max=( - int(retrieval["direct_symbol_test_hits_max"]) - if retrieval.get("direct_symbol_test_hits_max") is not None - else None - ), - path_scope_contains=tuple(str(item) for item in retrieval.get("path_scope_contains") or []), - symbol_candidates_contain=tuple(str(item) for item in retrieval.get("symbol_candidates_contain") or []), - layers_include=tuple(str(item) for item in retrieval.get("layers_include") or []), - ), - llm=LlmExpectation( - non_empty=llm.get("non_empty"), - contains_all=tuple(str(item) for item in llm.get("contains_all") or []), - excludes=tuple(str(item) for item in llm.get("excludes") or []), - ), - pipeline=PipelineExpectation(answer_mode=str(pipeline.get("answer_mode") or "").strip() or None), - ) diff --git a/tests/pipeline_setup_v2/core/models.py b/tests/pipeline_setup_v2/core/models.py deleted file mode 100644 index 595d79c..0000000 --- a/tests/pipeline_setup_v2/core/models.py +++ /dev/null @@ -1,82 +0,0 @@ -from __future__ import annotations - -from dataclasses import dataclass, field -from pathlib import Path -from typing import Literal - - -RunnerKind = Literal["runtime", "code_qa_eval"] -ModeKind = Literal["router_only", "router_rag", "full_chain"] - - -@dataclass(slots=True, frozen=True) -class CaseInput: - repo_path: Path | None = None - project_id: str | None = None - rag_session_id: str | None = None - - -@dataclass(slots=True, frozen=True) -class RouterExpectation: - intent: str | None = None - sub_intent: str | None = None - graph_id: str | None = None - conversation_mode: str | None = None - - -@dataclass(slots=True, frozen=True) -class RetrievalExpectation: - non_empty: bool | None = None - min_rows: int | None = None - direct_symbol_test_hits_max: int | None = None - path_scope_contains: tuple[str, ...] = () - symbol_candidates_contain: tuple[str, ...] = () - layers_include: tuple[str, ...] = () - - -@dataclass(slots=True, frozen=True) -class LlmExpectation: - non_empty: bool | None = None - contains_all: tuple[str, ...] = () - excludes: tuple[str, ...] = () - - -@dataclass(slots=True, frozen=True) -class PipelineExpectation: - answer_mode: str | None = None - - -@dataclass(slots=True, frozen=True) -class CaseExpectations: - router: RouterExpectation = RouterExpectation() - retrieval: RetrievalExpectation = RetrievalExpectation() - llm: LlmExpectation = LlmExpectation() - pipeline: PipelineExpectation = PipelineExpectation() - - -@dataclass(slots=True, frozen=True) -class V2Case: - case_id: str - runner: RunnerKind - mode: ModeKind - query: str - source_file: Path - input: CaseInput = CaseInput() - expectations: CaseExpectations = CaseExpectations() - notes: str = "" - tags: tuple[str, ...] = () - - -@dataclass(slots=True, frozen=True) -class ExecutionPayload: - actual: dict - details: dict - - -@dataclass(slots=True) -class V2CaseResult: - case: V2Case - actual: dict - details: dict - passed: bool - mismatches: list[str] = field(default_factory=list) diff --git a/tests/pipeline_setup_v2/core/runner.py b/tests/pipeline_setup_v2/core/runner.py deleted file mode 100644 index ac5b2f6..0000000 --- a/tests/pipeline_setup_v2/core/runner.py +++ /dev/null @@ -1,62 +0,0 @@ -from __future__ import annotations - -from datetime import datetime -from pathlib import Path - -from tests.pipeline_setup_v2.core.artifacts import ArtifactWriter -from tests.pipeline_setup_v2.core.case_loader import CaseDirectoryLoader -from tests.pipeline_setup_v2.core.models import V2CaseResult -from tests.pipeline_setup_v2.core.session_provider import RagSessionProvider -from tests.pipeline_setup_v2.core.validators import CaseValidator - - -class V2Runner: - def __init__(self, cases_dir: Path, results_dir: Path, run_name: str) -> None: - self._cases_dir = cases_dir - self._validator = CaseValidator() - self._sessions = RagSessionProvider() - self._runtime = None - self._code_qa = None - self._writer = ArtifactWriter(results_dir, run_name=run_name, started_at=datetime.now()) - - @property - def run_dir(self) -> Path: - return self._writer.run_dir - - def run(self) -> tuple[list[V2CaseResult], Path]: - results: list[V2CaseResult] = [] - for case in CaseDirectoryLoader().load(self._cases_dir): - rag_session_id = self._sessions.resolve(case.input) - payload = self._execute(case, rag_session_id) - mismatches = self._validator.validate(case, payload.actual, payload.details) - result = V2CaseResult( - case=case, - actual=payload.actual, - details=payload.details, - passed=not mismatches, - mismatches=mismatches, - ) - self._writer.write_case(result) - results.append(result) - return results, self._writer.write_summary(results) - - def _execute(self, case, rag_session_id): - if case.runner == "runtime": - return self._runtime_adapter().execute(case, rag_session_id) - if case.runner == "code_qa_eval": - return self._code_qa_adapter().execute(case, rag_session_id) - raise ValueError(f"Unsupported runner: {case.runner}") - - def _runtime_adapter(self): - if self._runtime is None: - from tests.pipeline_setup_v2.runtime.runtime_adapter import RuntimeAdapter - - self._runtime = RuntimeAdapter() - return self._runtime - - def _code_qa_adapter(self): - if self._code_qa is None: - from tests.pipeline_setup_v2.runtime.code_qa_eval_adapter import CodeQaEvalAdapter - - self._code_qa = CodeQaEvalAdapter() - return self._code_qa diff --git a/tests/pipeline_setup_v2/core/session_provider.py b/tests/pipeline_setup_v2/core/session_provider.py deleted file mode 100644 index 302238b..0000000 --- a/tests/pipeline_setup_v2/core/session_provider.py +++ /dev/null @@ -1,32 +0,0 @@ -from __future__ import annotations - -from pathlib import Path - -from tests.pipeline_setup_v2.core.models import CaseInput - - -class RagSessionProvider: - def __init__(self) -> None: - self._repository = None - self._cache: dict[tuple[Path, str | None], str] = {} - - def resolve(self, case_input: CaseInput) -> str | None: - if case_input.rag_session_id: - return case_input.rag_session_id - if not case_input.repo_path: - return None - key = (case_input.repo_path, case_input.project_id) - if key not in self._cache: - self._cache[key] = self._build_indexer().index_repo( - case_input.repo_path, - project_id=case_input.project_id, - ) - return self._cache[key] - - def _build_indexer(self): - from app.modules.rag.persistence.repository import RagRepository - from tests.pipeline_setup.utils.rag_indexer import RagSessionIndexer - - if self._repository is None: - self._repository = RagRepository() - return RagSessionIndexer(self._repository) diff --git a/tests/pipeline_setup_v2/core/test_validators.py b/tests/pipeline_setup_v2/core/test_validators.py deleted file mode 100644 index 886f0ca..0000000 --- a/tests/pipeline_setup_v2/core/test_validators.py +++ /dev/null @@ -1,137 +0,0 @@ -from __future__ import annotations - -from pathlib import Path - -from tests.pipeline_setup_v2.core.artifacts import SummaryComposer -from tests.pipeline_setup_v2.core.models import CaseExpectations, LlmExpectation, RetrievalExpectation, RouterExpectation, V2Case -from tests.pipeline_setup_v2.core.validators import CaseValidator - - -def test_direct_symbol_test_hits_allows_related_context_when_symbol_not_in_rows() -> None: - case = V2Case( - case_id="negative-find-tests", - runner="runtime", - mode="full_chain", - query="Где тесты для WorkflowRuntimeFactory?", - source_file=Path("cases.yaml"), - expectations=CaseExpectations( - router=RouterExpectation(intent="CODE_QA", sub_intent="FIND_TESTS"), - retrieval=RetrievalExpectation( - direct_symbol_test_hits_max=0, - symbol_candidates_contain=("WorkflowRuntimeFactory",), - ), - ), - ) - actual = { - "intent": "CODE_QA", - "sub_intent": "FIND_TESTS", - "rag_count": 2, - "symbol_candidates": ("WorkflowRuntimeFactory",), - "layers": ("C2_DEPENDENCY_GRAPH",), - } - details = { - "rag_rows": [ - { - "path": "tests/test_business_control_actions.py", - "title": "test_worker_wakes_up_with_configured_interval:dataflow_slice", - "content": "ScenarioWorker.name", - "metadata": {"is_test": True, "src_qname": "test_worker_wakes_up_with_configured_interval"}, - } - ] - } - - mismatches = CaseValidator().validate(case, actual, details) - - assert mismatches == [] - - -def test_direct_symbol_test_hits_flags_direct_matches_in_test_rows() -> None: - case = V2Case( - case_id="negative-find-tests", - runner="runtime", - mode="full_chain", - query="Где тесты для WorkflowRuntimeFactory?", - source_file=Path("cases.yaml"), - expectations=CaseExpectations( - router=RouterExpectation(intent="CODE_QA", sub_intent="FIND_TESTS"), - retrieval=RetrievalExpectation( - direct_symbol_test_hits_max=0, - symbol_candidates_contain=("WorkflowRuntimeFactory",), - ), - ), - ) - actual = { - "intent": "CODE_QA", - "sub_intent": "FIND_TESTS", - "rag_count": 1, - "symbol_candidates": ("WorkflowRuntimeFactory",), - "layers": ("C0_SOURCE_CHUNKS",), - } - details = { - "rag_rows": [ - { - "path": "tests/test_workflow_runtime_factory.py", - "title": "test_workflow_runtime_factory_builds_runtime", - "content": "WorkflowRuntimeFactory builds runtime", - "metadata": {"is_test": True, "src_qname": "test_workflow_runtime_factory_builds_runtime"}, - } - ] - } - - mismatches = CaseValidator().validate(case, actual, details) - - assert mismatches == ["retrieval: expected direct symbol-linked test hits <= 0, got 1"] - - -def test_llm_contains_and_excludes_checks() -> None: - case = V2Case( - case_id="llm-quality", - runner="runtime", - mode="full_chain", - query="Где health endpoint?", - source_file=Path("cases.yaml"), - expectations=CaseExpectations( - router=RouterExpectation(intent="CODE_QA", sub_intent="FIND_ENTRYPOINTS"), - llm=LlmExpectation( - non_empty=True, - contains_all=("GET /health",), - excludes=("нет явных неподтвержденных кандидатов",), - ), - ), - ) - actual = { - "intent": "CODE_QA", - "sub_intent": "FIND_ENTRYPOINTS", - "rag_count": 3, - "llm_answer": "GET /health объявлен в HttpControlAppFactory.", - } - - mismatches = CaseValidator().validate(case, actual, {}) - - assert mismatches == [] - - -def test_summary_includes_token_usage_column() -> None: - case = V2Case( - case_id="llm-quality", - runner="runtime", - mode="full_chain", - query="Где health endpoint?", - source_file=Path("cases.yaml"), - ) - result_text = SummaryComposer().compose([ - type( - "Result", - (), - { - "case": case, - "actual": {"intent": "CODE_QA", "sub_intent": "FIND_ENTRYPOINTS"}, - "details": {"diagnostics": {"prompt": {"prompt_stats": {"tokens_in_estimate": 654}}}, "rag_rows": []}, - "passed": True, - "mismatches": [], - }, - )() - ]) - - assert "Tokens" in result_text - assert "654" in result_text diff --git a/tests/pipeline_setup_v2/core/validators.py b/tests/pipeline_setup_v2/core/validators.py deleted file mode 100644 index 2b0eeac..0000000 --- a/tests/pipeline_setup_v2/core/validators.py +++ /dev/null @@ -1,101 +0,0 @@ -from __future__ import annotations - -from tests.pipeline_setup_v2.core.models import V2Case - - -class CaseValidator: - def validate(self, case: V2Case, actual: dict, details: dict | None = None) -> list[str]: - mismatches: list[str] = [] - self._check(case.expectations.router.intent, actual.get("intent"), "intent", mismatches) - self._check(case.expectations.router.sub_intent, actual.get("sub_intent"), "sub_intent", mismatches) - self._check(case.expectations.router.graph_id, actual.get("graph_id"), "graph_id", mismatches) - self._check(case.expectations.router.conversation_mode, actual.get("conversation_mode"), "conversation_mode", mismatches) - self._check(case.expectations.pipeline.answer_mode, actual.get("answer_mode"), "answer_mode", mismatches) - self._check_retrieval(case, actual, details or {}, mismatches) - self._check_llm(case, actual, mismatches) - return mismatches - - def _check(self, expected, actual, label: str, mismatches: list[str]) -> None: - if expected is not None and expected != actual: - mismatches.append(f"{label}: expected {expected}, got {actual}") - - def _check_retrieval(self, case: V2Case, actual: dict, details: dict, mismatches: list[str]) -> None: - rag_count = int(actual.get("rag_count") or 0) - retrieval = case.expectations.retrieval - if retrieval.non_empty is True and rag_count == 0: - mismatches.append("retrieval: expected non-empty rag, got 0 rows") - if retrieval.non_empty is False and rag_count != 0: - mismatches.append(f"retrieval: expected empty rag, got {rag_count} rows") - if retrieval.min_rows is not None and rag_count < retrieval.min_rows: - mismatches.append(f"retrieval: expected at least {retrieval.min_rows} rows, got {rag_count}") - if retrieval.direct_symbol_test_hits_max is not None: - direct_hits = self._direct_symbol_test_hits(case, details) - if direct_hits > retrieval.direct_symbol_test_hits_max: - mismatches.append( - f"retrieval: expected direct symbol-linked test hits <= {retrieval.direct_symbol_test_hits_max}, got {direct_hits}" - ) - for path in retrieval.path_scope_contains: - if not any(path in item for item in actual.get("path_scope") or ()): - mismatches.append(f"path_scope should contain '{path}', got {list(actual.get('path_scope') or ())}") - for symbol in retrieval.symbol_candidates_contain: - if symbol not in (actual.get("symbol_candidates") or ()): - mismatches.append(f"symbol_candidates should contain '{symbol}', got {list(actual.get('symbol_candidates') or ())}") - for layer in retrieval.layers_include: - if layer not in (actual.get("layers") or ()): - mismatches.append(f"layers should include '{layer}', got {list(actual.get('layers') or ())}") - - def _check_llm(self, case: V2Case, actual: dict, mismatches: list[str]) -> None: - llm = case.expectations.llm - expected = llm.non_empty - answer = str(actual.get("llm_answer") or "").strip() - if expected is None: - has_answer = bool(answer) - else: - has_answer = bool(answer) - if expected and not has_answer: - mismatches.append("llm: expected non-empty answer") - if not expected and has_answer: - mismatches.append("llm: expected empty answer") - lowered = answer.lower() - for value in llm.contains_all: - if value.lower() not in lowered: - mismatches.append(f"llm: expected answer to contain '{value}'") - for value in llm.excludes: - if value.lower() in lowered: - mismatches.append(f"llm: expected answer to exclude '{value}'") - - def _direct_symbol_test_hits(self, case: V2Case, details: dict) -> int: - symbols = tuple( - symbol.strip().lower() - for symbol in case.expectations.retrieval.symbol_candidates_contain - if symbol.strip() - ) - if not symbols: - return 0 - hits = 0 - for row in details.get("rag_rows") or []: - if not self._is_test_row(row): - continue - haystacks = self._row_search_texts(row) - if any(symbol in text for symbol in symbols for text in haystacks): - hits += 1 - return hits - - def _is_test_row(self, row: dict) -> bool: - path = str(row.get("path") or "").lower() - metadata = dict(row.get("metadata") or {}) - if bool(metadata.get("is_test")): - return True - return "/tests/" in f"/{path}" or path.startswith("tests/") or "/test_" in path or path.endswith("_test.py") - - def _row_search_texts(self, row: dict) -> tuple[str, ...]: - metadata = dict(row.get("metadata") or {}) - values = [ - str(row.get("title") or ""), - str(row.get("content") or ""), - str(metadata.get("qname") or ""), - str(metadata.get("symbol_name") or ""), - str(metadata.get("src_qname") or ""), - str(metadata.get("dst_ref") or ""), - ] - return tuple(value.lower() for value in values if value) diff --git a/tests/pipeline_setup_v2/llm_prompts.yaml b/tests/pipeline_setup_v2/llm_prompts.yaml deleted file mode 100644 index 69185aa..0000000 --- a/tests/pipeline_setup_v2/llm_prompts.yaml +++ /dev/null @@ -1,147 +0,0 @@ -default: - template_id: "intent_default_v2" - system_prompt: "Ты технический ассистент по коду и документации, который отвечает только по извлечённому контексту." - task_prompt: | - Отвечай кратко, точно и без выдумок. - Используй только факты, которые подтверждаются контекстом RAG. - Если данных недостаточно, прямо скажи, чего именно не хватает. - Не компенсируй нехватку контекста общими рассуждениями. - -intents: - CODE_QA: - template_id: "intent_code_qa_v5" - system_prompt: "Ты senior Python-инженер, который объясняет код только по извлечённым фрагментам из RAG." - task_prompt: | - Отвечай только по коду и структуре проекта, которые есть в контексте. - Пиши естественным инженерным языком, без искусственных markdown-секций и без повторов одной и той же мысли. - Если ответ можно дать в 1-3 фразах, не раздувай его. - Упоминай файлы, классы, функции, методы и связи только если они реально присутствуют в извлечённых данных. - Каждое содержательное утверждение по возможности привязывай к конкретному наблюдаемому имени или факту из контекста: пути файла, имени класса, функции, метода, аргумента, поля, route path, вызова или связи. - Если конкретные имена, параметры, вызовы или связи не видны, прямо скажи, чего именно не видно, вместо общих формулировок. - Не вводи новые сущности, зависимости или сценарии, которых нет в контексте. - Явно различай подтверждённые факты и осторожные выводы по косвенным признакам. - Если данных мало, честно скажи об этом вместо общего обзора. - Не используй жирные заголовки блоков, если пользователь их не просил. - Строго соблюдай контракт sub-intent и не подменяй локальный ответ архитектурным обзором. - Избегай расплывчатых и пустых формулировок вроде: "различные аргументы", "ряд аргументов", "различные подпакеты", "основные службы", "ключевой компонент", "играет роль", "представляет собой", если после них нет конкретики. - Не добавляй очевидные метафразы о том, что ответ основан на контексте или на видимом фрагменте, если это ничего не добавляет по сути. - Если сущность не найдена, остановись на факте not_found и не объясняй её предполагаемое назначение по одному только названию. - Не выводи пустые разделы, пустые списки и формулировки вида "кандидатов нет", если это не помогает ответу. - sub_intents: - OPEN_FILE: - template_id: "intent_code_qa_open_file_ru_v4" - system_prompt: "Ты технический ассистент, который помогает открыть конкретный файл и показать, что в нём реально видно." - task_prompt: | - Сосредоточься на указанном файле и отвечай коротко. - Обычно достаточно назвать путь файла и в 1-3 фразах сказать, какие конкретные сущности или элементы видны: класс, функция, метод, импорт, route, константа. - Не используй общие описания файла без конкретных имён. - Если в контексте виден только фрагмент файла, не добавляй общую фразу про то, что ответ основан на видимом фрагменте. Вместо этого просто ограничься тем, что реально видно. - Не превращай ответ в архитектурный обзор проекта. - Не используй секции и подзаголовки. - Если файла нет, ответь одной короткой фразой: `Файл не найден.` - Не придумывай анализ отсутствующего файла. - - EXPLAIN: - template_id: "intent_code_qa_explain_ru_v4" - system_prompt: "Ты senior Python-инженер и code reviewer, который объясняет устройство кода без домысливания." - task_prompt: | - Объясни, как работает сущность из вопроса пользователя, обычным инженерным текстом. - Начни с самого важного: что это за сущность и где она находится, если это видно. - Затем кратко опиши подтверждённые зависимости, вызовы, аргументы, поля или шаги работы, только если они реально видны. - Не используй общие формулы без конкретных имён. - Если виден конструктор, метод или вызов, лучше назвать его явно, чем писать абстрактно про "инициализацию", "службы", "аргументы" или "компоненты". - Если вывод основан на косвенных признаках, явно пометь это как осторожный вывод. - Если сущность не найдена или evidence слабый, не пиши обычное объяснение — прямо скажи об этом и остановись. - Не используй обязательные секции и подзаголовки. - - EXPLAIN_LOCAL: - template_id: "intent_code_qa_explain_local_ru_v4" - system_prompt: "Ты инженер, который объясняет локальный фрагмент кода без лишней теории и без перехода на уровень всей архитектуры." - task_prompt: | - Дай локальное объяснение по конкретному файлу, символу или короткому участку кода. - Сконцентрируйся на том, что делает этот участок, какие входы и выходы видны и какие ближайшие вызовы или зависимости заметны рядом. - Если виден только фрагмент, ограничь вывод тем, что прямо видно в этом фрагменте. - Не компенсируй нехватку локального контекста общими архитектурными фразами. - Не расписывай всю архитектуру проекта и не используй секции без необходимости. - - FIND_TESTS: - template_id: "intent_code_qa_find_tests_ru_v4" - system_prompt: "Ты инженер, который ищет тестовое покрытие и различает прямые и косвенные тесты." - task_prompt: | - Найди связанные тесты и ответь, где они расположены. - Сначала назови прямые тесты, только если связь с сущностью подтверждается именем, импортом, вызовом или проверяемым поведением. - Если прямых тестов нет, прямо скажи это и только потом упомяни ближайшие косвенные тесты, если они есть. - Коротко поясни, что именно проверяется. - Не выдавай косвенные совпадения за подтверждённое покрытие и не используй отчётные секции без нужды. - Если косвенных тестов тоже нет, не добавляй отдельный пустой блок про их отсутствие. - - FIND_ENTRYPOINTS: - template_id: "intent_code_qa_find_entrypoints_ru_v4" - system_prompt: "Ты инженер, который находит подтверждённые точки входа и отдельно помечает только возможные кандидаты." - task_prompt: | - Найди точки входа, обработчики запуска или важные entrypoints. - Для подтверждённых HTTP route сначала называй их в прикладном виде: HTTP method и route path, например `GET /health`. - Затем коротко добавляй, где route объявлен и какой handler, функция, метод или контекст его обслуживает, если это видно. - Подтверждённые entrypoints перечисляй первыми. - Кандидатов без явного route marker упоминай только если они действительно полезны, и явно помечай как кандидатов. - Не своди ответ к обсуждению декораторов вроде `@app.get`; пользователю важнее method, path и контекст. - Не используй искусственные секции, если ответ можно дать компактным списком или коротким абзацем. - Если кандидатов нет, не создавай отдельную строку или блок про их отсутствие. - Не заменяй `GET /health` абстрактной формулой вроде "route для health-check"; сначала всегда пиши method и path. - - TRACE_FLOW: - template_id: "intent_code_qa_trace_flow_ru_v4" - system_prompt: "Ты инженер, который восстанавливает поток вызовов и движение данных только по доказуемой цепочке из контекста." - task_prompt: | - Проследи поток выполнения или поток данных по найденным артефактам. - Старайся описывать шаги последовательно и коротко, без лишних подзаголовков. - Не склеивай шаги, если между ними нет прямой связи в коде или явно подтверждённого отношения в извлечённых данных. - Если поток восстанавливается только частично, так и скажи. - Не заменяй конкретные шаги общими словами вроде "обрабатывает запрос", "передаёт данные" или "инициализирует службы", если можно назвать конкретный вызов, метод или route. - - ARCHITECTURE: - template_id: "intent_code_qa_architecture_ru_v4" - system_prompt: "Ты инженер, который объясняет устройство подсистемы только по наблюдаемым компонентам и связям из кода." - task_prompt: | - Дай архитектурное объяснение без лишней теории. - Назови подтверждённые компоненты и конкретные связи между ними: создаёт, вызывает, регистрирует, читает, пишет, передаёт, оборачивает. - Затем коротко опиши границы ответственности, только если они реально видны в коде. - Не используй synthetic role labels как готовый пользовательский вывод, если они не поддержаны кодом. - Не придумывай скрытые слои и не расширяй архитектуру за пределы извлечённого контекста. - Не используй обязательные markdown-секции. - Не используй абстрактные формулы вроде "главный компонент", "центральный управляющий компонент", "управляет потоками данных и состоянием системы", если конкретная связь не раскрыта через наблюдаемые методы, поля или вызовы. - - GENERAL_QA: - template_id: "intent_code_qa_general_ru_v2" - system_prompt: "Ты senior Python-инженер, который даёт обзорный ответ по подсистеме или проекту, но остаётся строго привязанным к коду из контекста." - task_prompt: | - Дай обзорный ответ по вопросу пользователя о коде, подсистеме или сценарии работы. - Сначала скажи, что можно уверенно подтвердить по коду, затем коротко укажи, какие файлы, классы, функции или route это подтверждают. - Если данных недостаточно, прямо скажи, чего именно не хватает. - Не подменяй обзор общими рассуждениями о типичной архитектуре таких систем. - Не используй секции без необходимости. - Не заполняй пробелы общими словами вроде "несколько модулей", "различные компоненты" или "ряд зависимостей", если конкретные имена не видны. - - DOCS_QA: - template_id: "intent_docs_qa_v2" - system_prompt: "Ты технический писатель и инженер по документации, который отвечает только по извлечённым документам." - task_prompt: | - Отвечай строго по документации из контекста RAG. - Если есть несколько документов, кратко синтезируй общий вывод и различия между ними. - Не добавляй факты, которых нет в извлечённой документации. - - GENERATE_DOCS_FROM_CODE: - template_id: "intent_generate_docs_v2" - system_prompt: "Ты технический писатель, который готовит документацию по коду без выдуманных деталей." - task_prompt: | - Сформируй структурированное описание: назначение, входы/выходы, зависимости и ограничения. - Включай только то, что подтверждается кодом или контекстом. - Если какая-то часть не подтверждена, явно помечай её как неизвестную. - - PROJECT_MISC: - template_id: "intent_project_misc_v2" - system_prompt: "Ты инженер-ассистент по общим вопросам о проекте, который не выходит за пределы доступного контекста." - task_prompt: | - Дай короткий прикладной ответ по вопросу пользователя, опираясь на контекст. - Если контекст слабый, честно скажи об этом и укажи, какого контекста не хватает. - Не превращай ответ в общий обзор, если данных мало. diff --git a/tests/pipeline_setup_v2/run.py b/tests/pipeline_setup_v2/run.py deleted file mode 100644 index 88180de..0000000 --- a/tests/pipeline_setup_v2/run.py +++ /dev/null @@ -1,42 +0,0 @@ -from __future__ import annotations - -import argparse -import sys -from pathlib import Path - -_agent_root = Path(__file__).resolve().parents[2] -if str(_agent_root) not in sys.path: - sys.path.insert(0, str(_agent_root)) -_src = _agent_root / "src" -if _src.exists() and str(_src) not in sys.path: - sys.path.insert(0, str(_src)) - -from tests.pipeline_setup.env_loader import load_pipeline_setup_env -from tests.pipeline_setup_v2.core.runner import V2Runner - - -def main(argv: list[str] | None = None) -> int: - parser = argparse.ArgumentParser(description="Run unified pipeline_setup_v2 cases") - parser.add_argument("--cases-dir", required=True, help="Directory with YAML case files") - parser.add_argument("--run-name", default="manual_run", help="Output directory prefix") - parser.add_argument("--results-dir", default=None, help="Override results root directory") - ns = parser.parse_args(argv) - - cases_dir = Path(str(ns.cases_dir)).expanduser().resolve() - results_dir = Path(str(ns.results_dir)).expanduser().resolve() if ns.results_dir else Path(__file__).resolve().parent / "test_results" - load_pipeline_setup_env(start_dir=_agent_root / "tests" / "pipeline_setup") - runner = V2Runner(cases_dir=cases_dir, results_dir=results_dir, run_name=str(ns.run_name).strip() or "manual_run") - print(f"Cases dir: {cases_dir}") - print(f"Run dir: {runner.run_dir}") - results, summary_path = runner.run() - passed = sum(1 for item in results if item.passed) - print(f"Passed: {passed}/{len(results)}") - print(f"Summary: {summary_path}") - for item in results: - if not item.passed: - print(f"FAIL {item.case.case_id}: {'; '.join(item.mismatches)}") - return 0 if passed == len(results) else 1 - - -if __name__ == "__main__": - raise SystemExit(main()) diff --git a/tests/pipeline_setup_v2/runtime/__init__.py b/tests/pipeline_setup_v2/runtime/__init__.py deleted file mode 100644 index ddbdb05..0000000 --- a/tests/pipeline_setup_v2/runtime/__init__.py +++ /dev/null @@ -1 +0,0 @@ -"""Runtime-specific executors for pipeline_setup_v2.""" diff --git a/tests/pipeline_setup_v2/runtime/code_qa_eval_adapter.py b/tests/pipeline_setup_v2/runtime/code_qa_eval_adapter.py deleted file mode 100644 index 80b4da4..0000000 --- a/tests/pipeline_setup_v2/runtime/code_qa_eval_adapter.py +++ /dev/null @@ -1,56 +0,0 @@ -from __future__ import annotations - -from app.modules.agent.runtime import AgentRuntimeExecutor -from app.modules.rag.contracts.enums import RagLayer -from app.modules.agent.intent_router_v2 import RepoContext -from tests.pipeline_setup_v2.core.models import ExecutionPayload, V2Case - - -class CodeQaEvalAdapter: - def __init__(self) -> None: - self._executor = AgentRuntimeExecutor(llm=None) - - def execute(self, case: V2Case, rag_session_id: str | None) -> ExecutionPayload: - if not rag_session_id: - raise ValueError(f"Case '{case.case_id}' requires rag_session_id or repo_path") - result = self._executor.execute(user_query=case.query, rag_session_id=rag_session_id) - route_result = result.router_result - route = result.diagnostics.router_result - details = { - "case_id": case.case_id, - "query": case.query, - "rag_session_id": rag_session_id, - "actual": { - "intent": route.get("intent"), - "sub_intent": route.get("sub_intent"), - "graph_id": route.get("graph_id"), - "conversation_mode": route.get("conversation_mode"), - "rag_count": len(result.retrieval_result.code_chunks) if result.retrieval_result else 0, - "llm_answer": "", - "answer_mode": result.answer_mode, - "path_scope": tuple(route.get("path_scope") or []), - "symbol_candidates": tuple(route_result.query_plan.symbol_candidates or []) if route_result else (), - "layers": tuple(route.get("layers") or []), - }, - "timings_ms": result.diagnostics.timings_ms, - } - actual = dict(details["actual"]) - return ExecutionPayload(actual=actual, details=details) - - -def _repo_context() -> RepoContext: - return RepoContext( - languages=["python"], - available_domains=["CODE", "DOCS"], - available_layers=[ - RagLayer.CODE_ENTRYPOINTS, - RagLayer.CODE_SYMBOL_CATALOG, - RagLayer.CODE_DEPENDENCY_GRAPH, - RagLayer.CODE_SEMANTIC_ROLES, - RagLayer.CODE_SOURCE_CHUNKS, - RagLayer.DOCS_MODULE_CATALOG, - RagLayer.DOCS_FACT_INDEX, - RagLayer.DOCS_SECTION_INDEX, - RagLayer.DOCS_POLICY_INDEX, - ], - ) diff --git a/tests/pipeline_setup_v2/runtime/runtime_adapter.py b/tests/pipeline_setup_v2/runtime/runtime_adapter.py deleted file mode 100644 index 37e0ab1..0000000 --- a/tests/pipeline_setup_v2/runtime/runtime_adapter.py +++ /dev/null @@ -1,154 +0,0 @@ -from __future__ import annotations - -from datetime import datetime -from pathlib import Path - -from app.modules.agent.runtime import AgentRuntimeExecutor -from app.modules.agent.llm import AgentLlmService -from app.modules.agent.llm.prompt_loader import PromptLoader -from app.modules.shared.gigachat.client import GigaChatClient -from app.modules.shared.gigachat.settings import GigaChatSettings -from app.modules.shared.gigachat.token_provider import GigaChatTokenProvider -from tests.pipeline_setup.suite_02_pipeline.pipeline_intent_rag.helpers.env_bootstrap import PipelineEnvLoader -from tests.pipeline_setup.suite_02_pipeline.pipeline_intent_rag.helpers.models import PhraseCase, PipelineResult -from tests.pipeline_setup.suite_02_pipeline.pipeline_intent_rag.helpers.pipeline_runner import ( - IntentRouterRagPipelineRunner, - RouterOnlyRunner, -) -from tests.pipeline_setup_v2.core.models import ExecutionPayload, V2Case - - -class RuntimeAdapter: - def __init__(self) -> None: - self._test_root = ( - Path(__file__).resolve().parents[2] - / "pipeline_setup" - / "suite_02_pipeline" - / "pipeline_intent_rag" - ).resolve() - PipelineEnvLoader(self._test_root).load() - self._started_at = datetime.now() - self._rag_adapter = None - self._executor: AgentRuntimeExecutor | None = None - - def execute(self, case: V2Case, rag_session_id: str | None) -> ExecutionPayload: - phrase = PhraseCase( - case_id=case.case_id, - text=case.query, - rag_session_id=rag_session_id, - expected_intent=case.expectations.router.intent, - expect_non_empty_rag=bool(case.expectations.retrieval.non_empty), - ) - if case.mode == "router_only": - result = RouterOnlyRunner(started_at=self._started_at).run_case(phrase) - elif case.mode == "router_rag": - result = IntentRouterRagPipelineRunner( - started_at=self._started_at, - rag_adapter=self._rag_components(), - session_resolver=_StaticSessionResolver(), - ).run_case(phrase) - else: - result = self._run_full_chain(phrase) - record = result.to_record() - return ExecutionPayload(actual=_actual_from_runtime_record(record), details=record) - - def _run_full_chain(self, phrase: PhraseCase) -> PipelineResult: - result = self._executor_instance().execute(user_query=phrase.text, rag_session_id=phrase.rag_session_id or "") - route = dict(result.diagnostics.router_result) - retrieval = result.diagnostics.retrieval_request - diagnostics = { - "router_plan": { - "sub_intent": route.get("sub_intent"), - "graph_id": route.get("graph_id"), - "path_scope": list(retrieval.get("path_scope") or []), - "layers": list(retrieval.get("requested_layers") or []), - "symbol_candidates": list(result.router_result.query_plan.symbol_candidates or []) if result.router_result else [], - }, - "timings_ms": dict(result.diagnostics.timings_ms or {}), - "answer_policy": { - "short_circuit": not result.llm_used, - "answer_mode": _answer_status(result.answer_mode, result.llm_used), - "failure_reason": ",".join(result.validation.reasons), - }, - } - return PipelineResult( - case=phrase, - mode="full_chain", - run_started_at=self._started_at, - rag_session_id=phrase.rag_session_id, - intent=str(route.get("intent") or ""), - graph_id=str(route.get("graph_id") or ""), - conversation_mode=str(route.get("conversation_mode") or ""), - query=str(retrieval.get("query") or phrase.text), - rag_rows=list(result.retrieval_result.raw_rows) if result.retrieval_result else [], - symbol_resolution=result.router_result.symbol_resolution.model_dump() if result.router_result else {}, - llm_answer=result.final_answer, - diagnostics=diagnostics, - ) - - def _rag_components(self): - if self._rag_adapter is None: - from app.modules.rag.persistence.repository import RagRepository - from tests.pipeline_setup.suite_02_pipeline.pipeline_intent_rag.helpers.rag_db_adapter import ( - RagDbAdapter, - SessionEmbeddingDimensions, - ) - - self._rag_adapter = RagDbAdapter( - repository=RagRepository(), - dim_resolver=SessionEmbeddingDimensions(), - ) - return self._rag_adapter - - def _executor_instance(self) -> AgentRuntimeExecutor: - if self._executor is None: - self._executor = AgentRuntimeExecutor(_build_llm()) - return self._executor - - -class _StaticSessionResolver: - def resolve(self, case: PhraseCase) -> str: - if not case.rag_session_id: - raise ValueError(f"Case '{case.case_id}' requires rag_session_id or repo_path") - return case.rag_session_id - - -def _actual_from_runtime_record(record: dict) -> dict: - diagnostics = dict(record.get("diagnostics") or {}) - router_plan = dict(diagnostics.get("router_plan") or {}) - summary = dict(record.get("summary") or {}) - router_summary = dict(summary.get("router") or {}) - return { - "intent": record.get("actual_intent"), - "sub_intent": router_summary.get("sub_intent") or router_plan.get("sub_intent"), - "graph_id": record.get("graph_id"), - "conversation_mode": record.get("conversation_mode"), - "rag_count": int(record.get("rag_count") or 0), - "llm_answer": str(record.get("llm_answer") or "").strip(), - "answer_mode": dict(summary.get("llm") or {}).get("answer_status"), - "path_scope": tuple(router_plan.get("path_scope") or []), - "symbol_candidates": tuple(router_plan.get("symbol_candidates") or []), - "layers": tuple(router_plan.get("layers") or []), - } - - -def _ms(started: float) -> int: - return 0 - - -def _sub_intent_from_result(result: PipelineResult) -> str | None: - router_plan = dict(result.diagnostics.get("router_plan") or {}) - value = str(router_plan.get("sub_intent") or "").strip() - return value or None - - -def _answer_status(answer_mode: str, llm_used: bool) -> str: - if answer_mode == "normal" and llm_used: - return "answered" - return answer_mode - - -def _build_llm() -> AgentLlmService: - settings = GigaChatSettings.from_env() - client = GigaChatClient(settings, GigaChatTokenProvider(settings)) - return AgentLlmService(client=client, prompts=PromptLoader()) diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_090854/full_chain_plba_code_retrieval_plba-fullchain-explain-control-plane-service.json b/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_090854/full_chain_plba_code_retrieval_plba-fullchain-explain-control-plane-service.json deleted file mode 100644 index 90e3c83..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_090854/full_chain_plba_code_retrieval_plba-fullchain-explain-control-plane-service.json +++ /dev/null @@ -1,2532 +0,0 @@ -{ - "case_id": "plba-fullchain-explain-control-plane-service", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_retrieval.yaml", - "runner": "runtime", - "mode": "full_chain", - "actual": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 19, - "llm_answer": "## Анализ класса `ControlPlaneService`\n\n### Описание файла и класса\n\nКласс `ControlPlaneService` определен в файле `src/app_runtime/control/service.py`.\n\n```python\n# src/app_runtime/control/service.py\nclass ControlPlaneService\n```\n\n### Назначение и обязанности\n\nНазвание класса предполагает, что он является службой управления плоскостью контроля (`Control Plane Service`), которая отвечает за управление определенными аспектами приложения или системы.\n\n#### Основные обязанности и роли:\n\n- **Назначение**: Предполагается, что класс реализует функциональность сервиса, связанный с управлением состоянием системы, взаимодействует с другими компонентами и участвует в различных этапах обработки данных (dataflow slices).\n \n - **Поведение сервиса**:\n - Обрабатывает запросы и изменяет состояние системы через чтение и запись атрибутов состояния.\n \n - **Участие в потоке данных (dataflow)**: \n Класс участвует в нескольких срезах потока данных (dataflow slices):\n - Срез №5: Участие в общих сервисных операциях, связанных с управлением системой.\n \n\n### Зависимости и взаимодействие\n\nКласс использует другие классы и интерфейсы для выполнения своих обязанностей:\n\n- Контроллер канала (`ControlChannel`) из модуля `base.py`: Это интерфейс, представляющий стандартный контроллер модели.\n- Контрольный набор действий (`ControlActionSet`) также из модуля `base.py`: Набор стандартных операций или действий, которые могут быть выполнены моделью.\n- Другие классы и сервисы, участвующие в выполнении HTTP-запросов, такие как `UvicornThreadRunner`, который используется для запуска HTTP-сервера на отдельном потоке, и `HttpControlChannel`, обеспечивающий HTTP-контроллеры.\n\nЭти зависимости позволяют классу эффективно участвовать в управлении состоянием системы и взаимодействии с внешними API и серверами.\n\n---\n\n### Поток данных и архитектура\n\nАрхитектура класса предполагает централизованное управление данными и состоянием через определенные срезы данных (dataflow slices). Каждый из этих срезов представляет собой этап или часть общего процесса работы системы, где данный класс выполняет свою роль.\n\nНапример:\n\n- В срезе №5 он может выполнять действия по управлению конфигурацией, состоянию и обработке ошибок, связанных с общим контролем над работой системы.\n\n---\n\n### Заключение\n\nТаким образом, `ControlPlaneService` — это ключевой элемент архитектуры, ответственный за обработку и управление состоянием системы, ее конфигурацией и взаимодействием с внешними компонентами и службами. Его функциональность интегрируется в общий процесс через различные срезы данных, обеспечивая гибкость и масштабируемость всей системы.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "ControlPlaneService" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "passed": true, - "mismatches": [], - "details": { - "case_id": "plba-fullchain-explain-control-plane-service", - "text": "Объясни класс ControlPlaneService", - "mode": "full_chain", - "run_started_at": "2026-03-12T09:08:54", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Объясни класс ControlPlaneService", - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "ControlPlaneService", - "alternatives": [ - "ControlPlaneService" - ], - "confidence": 0.99 - }, - "rag_count": 19, - "rag_rows": [ - { - "path": "src/app_runtime/control/service.py", - "content": "class ControlPlaneService\nControlPlaneService", - "layer": "C1_SYMBOL_CATALOG", - "title": "ControlPlaneService", - "span_start": 12, - "span_end": 52, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "b13471e5916986dccffb53fab613812842965705e6b3a89ae549d30c9e91e9aa", - "qname": "ControlPlaneService", - "kind": "class", - "signature": "ControlPlaneService", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.control.service", - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests service\n- reads and writes state attributes\n- participates in dataflow slices (5)", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlPlaneService", - "span_start": 12, - "span_end": 52, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 68, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "b13471e5916986dccffb53fab613812842965705e6b3a89ae549d30c9e91e9aa", - "symbol_name": "ControlPlaneService", - "qname": "ControlPlaneService", - "role": "pipeline_stage", - "confidence": 0.57, - "dataflow_participation": 5, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "ControlChannel\nrole: model\n\nResponsibilities:\n- default model role", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlChannel", - "span_start": 21, - "span_end": 28, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 40, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "cfcfe9a311d3a2dbdaf32ac4ccd73c0eb9a117f830591a1c0867ee97d46204ff", - "symbol_name": "ControlChannel", - "qname": "ControlChannel", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "ControlActionSet\nrole: model\n\nResponsibilities:\n- default model role", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlActionSet", - "span_start": 14, - "span_end": 18, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 40, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "46eb026cb3313415ec47b82dd22f84f4d112c9d987e8b1716dcb0baa1cce8988", - "symbol_name": "ControlActionSet", - "qname": "ControlActionSet", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_runner.py", - "content": "UvicornThreadRunner\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (24)", - "layer": "C4_SEMANTIC_ROLES", - "title": "UvicornThreadRunner", - "span_start": 10, - "span_end": 61, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 11, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "fd55630045a02100df8877ac27d951ee08617d4598764394d48cb51fe067476a", - "symbol_name": "UvicornThreadRunner", - "qname": "UvicornThreadRunner", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 24, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "3779fdd2878b770e789a35bb2a89c9d79f13b61c26d7db1b3b683f9bb9e1623f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (10)", - "layer": "C4_SEMANTIC_ROLES", - "title": "HttpControlChannel", - "span_start": 12, - "span_end": 57, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 21, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "1c9fbdc24819e5604c26ea55428a74310f03a03e1af197ed84846af61e42fdb0", - "symbol_name": "HttpControlChannel", - "qname": "HttpControlChannel", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 10, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "HttpControlAppFactory\nrole: factory\n\nResponsibilities:\n- name suffix suggests factory", - "layer": "C4_SEMANTIC_ROLES", - "title": "HttpControlAppFactory", - "span_start": 15, - "span_end": 53, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 39, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "9b3502a5fb408b273223db13264349cf500de24915b6c649d9ea8970d0dfd8e0", - "symbol_name": "HttpControlAppFactory", - "qname": "HttpControlAppFactory", - "role": "factory", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/persistence/workflow_persistence.py", - "content": "WorkflowPersistence\nrole: pipeline_stage\n\nResponsibilities:\n- orchestrates role-like calls (2)\n- reads and writes state attributes\n- participates in dataflow slices (16)", - "layer": "C4_SEMANTIC_ROLES", - "title": "WorkflowPersistence", - "span_start": 8, - "span_end": 54, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 15, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "7bd01ee45cf31f2d5c2e3e51656254860ac785d10cef9e0852cd4fba90857bae", - "symbol_name": "WorkflowPersistence", - "qname": "WorkflowPersistence", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 16, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "80e9410ddc639789b4353c2a1a757ba8d0d5b5bb6075b0b263b61551f04ae1f0", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/queue/in_memory.py", - "content": "InMemoryTaskQueue\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (9)", - "layer": "C4_SEMANTIC_ROLES", - "title": "InMemoryTaskQueue", - "span_start": 9, - "span_end": 38, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 22, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "2da04cb94544a3bcbf0943a95ad4bdd8710bcafaa32a02fd0e4de2178dcf3533", - "symbol_name": "InMemoryTaskQueue", - "qname": "InMemoryTaskQueue", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 9, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "58f0cc001ccda0eee4c6bc32ed83bd05eafd6b6644f1e8b4aa9eed3103db73dc", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.stop", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 25, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d", - "dst_ref": "ControlPlaneService.stop", - "resolution": "resolved", - "slice_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.stop" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._stop_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 51, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a", - "dst_ref": "ControlPlaneService._stop_async", - "resolution": "resolved", - "slice_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._stop_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.register_channel", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 17, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957", - "dst_ref": "ControlPlaneService.register_channel", - "resolution": "resolved", - "slice_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.register_channel" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.start", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 20, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154", - "dst_ref": "ControlPlaneService.start", - "resolution": "resolved", - "slice_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.start" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._start_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 47, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517", - "dst_ref": "ControlPlaneService._start_async", - "resolution": "resolved", - "slice_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._start_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.register_channel reads_attr self._channels.append", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.register_channel:reads_attr", - "span_start": 17, - "span_end": 17, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "1ee5925deffdc38ba15b88bf7c89e5fcd1a78f493fe30f2deb827d714a1b18e8", - "edge_type": "reads_attr", - "src_symbol_id": "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957", - "src_qname": "ControlPlaneService.register_channel", - "dst_symbol_id": null, - "dst_ref": "self._channels.append", - "resolution": "partial", - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "class ControlPlaneService:\n def __init__(self) -> None:\n self._channels: list[ControlChannel] = []\n\n def register_channel(self, channel: ControlChannel) -> None:\n self._channels.append(channel)\n\n def start(self, runtime: RuntimeManager) -> None:\n if not self._channels:\n return\n asyncio.run(self._start_async(runtime))\n\n def stop(self) -> None:\n if not self._channels:\n return\n asyncio.run(self._stop_async())\n\n def snapshot(self, runtime: RuntimeManager) -> dict[str, object]:\n health = runtime.current_health()\n return {\n \"runtime\": {\"state\": runtime._state.value},\n \"modules\": list(runtime.registry.modules),\n \"services\": runtime.services.snapshot(),\n \"workers\": runtime.workers.snapshot(),\n \"health\": runtime.health.snapshot(runtime.workers.healths()) | {\"status\": health[\"status\"]},\n \"config\": runtime.configuration.get(),\n }\n\n async def _start_async(self, runtime: RuntimeManager) -> None:\n actions = ControlActionSet(\n health=runtime.health_status,\n start=runtime.start_runtime,\n stop=runtime.stop_runtime,\n status=runtime.runtime_status,\n )\n for channel in self._channels:\n await channel.start(actions)\n\n async def _stop_async(self) -> None:\n for channel in reversed(self._channels):\n await channel.stop()", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/service.py:ControlPlaneService", - "span_start": 12, - "span_end": 52, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.service", - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "llm_answer": "## Анализ класса `ControlPlaneService`\n\n### Описание файла и класса\n\nКласс `ControlPlaneService` определен в файле `src/app_runtime/control/service.py`.\n\n```python\n# src/app_runtime/control/service.py\nclass ControlPlaneService\n```\n\n### Назначение и обязанности\n\nНазвание класса предполагает, что он является службой управления плоскостью контроля (`Control Plane Service`), которая отвечает за управление определенными аспектами приложения или системы.\n\n#### Основные обязанности и роли:\n\n- **Назначение**: Предполагается, что класс реализует функциональность сервиса, связанный с управлением состоянием системы, взаимодействует с другими компонентами и участвует в различных этапах обработки данных (dataflow slices).\n \n - **Поведение сервиса**:\n - Обрабатывает запросы и изменяет состояние системы через чтение и запись атрибутов состояния.\n \n - **Участие в потоке данных (dataflow)**: \n Класс участвует в нескольких срезах потока данных (dataflow slices):\n - Срез №5: Участие в общих сервисных операциях, связанных с управлением системой.\n \n\n### Зависимости и взаимодействие\n\nКласс использует другие классы и интерфейсы для выполнения своих обязанностей:\n\n- Контроллер канала (`ControlChannel`) из модуля `base.py`: Это интерфейс, представляющий стандартный контроллер модели.\n- Контрольный набор действий (`ControlActionSet`) также из модуля `base.py`: Набор стандартных операций или действий, которые могут быть выполнены моделью.\n- Другие классы и сервисы, участвующие в выполнении HTTP-запросов, такие как `UvicornThreadRunner`, который используется для запуска HTTP-сервера на отдельном потоке, и `HttpControlChannel`, обеспечивающий HTTP-контроллеры.\n\nЭти зависимости позволяют классу эффективно участвовать в управлении состоянием системы и взаимодействии с внешними API и серверами.\n\n---\n\n### Поток данных и архитектура\n\nАрхитектура класса предполагает централизованное управление данными и состоянием через определенные срезы данных (dataflow slices). Каждый из этих срезов представляет собой этап или часть общего процесса работы системы, где данный класс выполняет свою роль.\n\nНапример:\n\n- В срезе №5 он может выполнять действия по управлению конфигурацией, состоянию и обработке ошибок, связанных с общим контролем над работой системы.\n\n---\n\n### Заключение\n\nТаким образом, `ControlPlaneService` — это ключевой элемент архитектуры, ответственный за обработку и управление состоянием системы, ее конфигурацией и взаимодействием с внешними компонентами и службами. Его функциональность интегрируется в общий процесс через различные срезы данных, обеспечивая гибкость и масштабируемость всей системы.", - "summary": { - "router": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "confidence": null - }, - "retrieval": { - "profile": "code", - "layers_hit": [ - "C0_SOURCE_CHUNKS", - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS", - "C4_SEMANTIC_ROLES" - ], - "evidence_sufficient": true - }, - "llm": { - "answer_status": "answered", - "groundedness": "grounded" - } - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "ControlPlaneService" - ], - "keyword_hints": [ - "ControlPlaneService" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C0_SOURCE_CHUNKS": "exact_path_fetch", - "C4_SEMANTIC_ROLES": "exact_path_fetch", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C3_ENTRYPOINTS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 8, - "C4_SEMANTIC_ROLES": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C3_ENTRYPOINTS": 6 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C4_SEMANTIC_ROLES": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "ControlPlaneService", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Объясни класс ControlPlaneService", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C4_SEMANTIC_ROLES", - "query": "Объясни класс ControlPlaneService", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "Объясни класс ControlPlaneService", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - }, - { - "layer": "C3_ENTRYPOINTS", - "query": "Объясни класс ControlPlaneService", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 1, - "candidates_after_filter": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 6, - "candidates_after_filter": 6 - }, - { - "layer": "C3_ENTRYPOINTS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 3, - "candidates_after_filter": 3 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "ControlPlaneService", - "alternatives": [ - "ControlPlaneService" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C4_SEMANTIC_ROLES", - "status": "hit", - "hit_count": 8, - "fail_reason": null - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 6, - "fail_reason": null - }, - { - "layer": "C3_ENTRYPOINTS", - "status": "hit", - "hit_count": 3, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "router": 1, - "symbol_resolution": 0, - "retrieval_total": 168, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 57, - "C0_SOURCE_CHUNKS": 23, - "C4_SEMANTIC_ROLES": 15, - "C2_DEPENDENCY_GRAPH": 61, - "C3_ENTRYPOINTS": 10 - }, - "merge_rank": 18, - "prompt_build": 0, - "llm_call": 5367 - }, - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 325, - "evidence_rows": 19, - "evidence_chars": 3087 - }, - "evidence_summary": [ - { - "layer": "C1_SYMBOL_CATALOG", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "count": 8, - "unique_paths": 7 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "count": 6, - "unique_paths": 1 - }, - { - "layer": "C3_ENTRYPOINTS", - "count": 3, - "unique_paths": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 1, - "unique_paths": 1 - } - ], - "prompt_template_id": "intent_code_qa_v1", - "system_prompt_version": "v1" - }, - "router": { - "conversation_mode": "START", - "keyword_hints": [ - "ControlPlaneService" - ], - "path_scope": [] - }, - "llm": { - "used_evidence_count": 19, - "missing_evidence_reason": null - } - }, - "run_info": { - "case_id": "plba-fullchain-explain-control-plane-service", - "mode": "full_chain", - "run_started_at": "2026-03-12T09:08:54", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - }, - "input_request": { - "text": "Объясни класс ControlPlaneService", - "normalized_query": "Объясни класс ControlPlaneService" - }, - "steps": [ - { - "step": "intent_router", - "input": { - "query": "Объясни класс ControlPlaneService" - }, - "output": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Объясни класс ControlPlaneService" - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "ControlPlaneService" - ], - "keyword_hints": [ - "ControlPlaneService" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "timings_ms": { - "router": 1 - } - } - }, - { - "step": "retrieval", - "input": { - "query": "Объясни класс ControlPlaneService" - }, - "output": { - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "ControlPlaneService", - "alternatives": [ - "ControlPlaneService" - ], - "confidence": 0.99 - }, - "rag_count": 19, - "rag_rows": [ - { - "path": "src/app_runtime/control/service.py", - "content": "class ControlPlaneService\nControlPlaneService", - "layer": "C1_SYMBOL_CATALOG", - "title": "ControlPlaneService", - "span_start": 12, - "span_end": 52, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "b13471e5916986dccffb53fab613812842965705e6b3a89ae549d30c9e91e9aa", - "qname": "ControlPlaneService", - "kind": "class", - "signature": "ControlPlaneService", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.control.service", - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests service\n- reads and writes state attributes\n- participates in dataflow slices (5)", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlPlaneService", - "span_start": 12, - "span_end": 52, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 68, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "b13471e5916986dccffb53fab613812842965705e6b3a89ae549d30c9e91e9aa", - "symbol_name": "ControlPlaneService", - "qname": "ControlPlaneService", - "role": "pipeline_stage", - "confidence": 0.57, - "dataflow_participation": 5, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "ControlChannel\nrole: model\n\nResponsibilities:\n- default model role", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlChannel", - "span_start": 21, - "span_end": 28, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 40, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "cfcfe9a311d3a2dbdaf32ac4ccd73c0eb9a117f830591a1c0867ee97d46204ff", - "symbol_name": "ControlChannel", - "qname": "ControlChannel", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "ControlActionSet\nrole: model\n\nResponsibilities:\n- default model role", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlActionSet", - "span_start": 14, - "span_end": 18, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 40, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "46eb026cb3313415ec47b82dd22f84f4d112c9d987e8b1716dcb0baa1cce8988", - "symbol_name": "ControlActionSet", - "qname": "ControlActionSet", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_runner.py", - "content": "UvicornThreadRunner\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (24)", - "layer": "C4_SEMANTIC_ROLES", - "title": "UvicornThreadRunner", - "span_start": 10, - "span_end": 61, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 11, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "fd55630045a02100df8877ac27d951ee08617d4598764394d48cb51fe067476a", - "symbol_name": "UvicornThreadRunner", - "qname": "UvicornThreadRunner", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 24, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "3779fdd2878b770e789a35bb2a89c9d79f13b61c26d7db1b3b683f9bb9e1623f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (10)", - "layer": "C4_SEMANTIC_ROLES", - "title": "HttpControlChannel", - "span_start": 12, - "span_end": 57, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 21, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "1c9fbdc24819e5604c26ea55428a74310f03a03e1af197ed84846af61e42fdb0", - "symbol_name": "HttpControlChannel", - "qname": "HttpControlChannel", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 10, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "HttpControlAppFactory\nrole: factory\n\nResponsibilities:\n- name suffix suggests factory", - "layer": "C4_SEMANTIC_ROLES", - "title": "HttpControlAppFactory", - "span_start": 15, - "span_end": 53, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 39, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "9b3502a5fb408b273223db13264349cf500de24915b6c649d9ea8970d0dfd8e0", - "symbol_name": "HttpControlAppFactory", - "qname": "HttpControlAppFactory", - "role": "factory", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/persistence/workflow_persistence.py", - "content": "WorkflowPersistence\nrole: pipeline_stage\n\nResponsibilities:\n- orchestrates role-like calls (2)\n- reads and writes state attributes\n- participates in dataflow slices (16)", - "layer": "C4_SEMANTIC_ROLES", - "title": "WorkflowPersistence", - "span_start": 8, - "span_end": 54, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 15, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "7bd01ee45cf31f2d5c2e3e51656254860ac785d10cef9e0852cd4fba90857bae", - "symbol_name": "WorkflowPersistence", - "qname": "WorkflowPersistence", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 16, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "80e9410ddc639789b4353c2a1a757ba8d0d5b5bb6075b0b263b61551f04ae1f0", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/queue/in_memory.py", - "content": "InMemoryTaskQueue\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (9)", - "layer": "C4_SEMANTIC_ROLES", - "title": "InMemoryTaskQueue", - "span_start": 9, - "span_end": 38, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 22, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "2da04cb94544a3bcbf0943a95ad4bdd8710bcafaa32a02fd0e4de2178dcf3533", - "symbol_name": "InMemoryTaskQueue", - "qname": "InMemoryTaskQueue", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 9, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "58f0cc001ccda0eee4c6bc32ed83bd05eafd6b6644f1e8b4aa9eed3103db73dc", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.stop", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 25, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d", - "dst_ref": "ControlPlaneService.stop", - "resolution": "resolved", - "slice_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.stop" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._stop_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 51, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a", - "dst_ref": "ControlPlaneService._stop_async", - "resolution": "resolved", - "slice_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._stop_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.register_channel", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 17, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957", - "dst_ref": "ControlPlaneService.register_channel", - "resolution": "resolved", - "slice_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.register_channel" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.start", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 20, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154", - "dst_ref": "ControlPlaneService.start", - "resolution": "resolved", - "slice_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.start" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._start_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 47, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517", - "dst_ref": "ControlPlaneService._start_async", - "resolution": "resolved", - "slice_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._start_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.register_channel reads_attr self._channels.append", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.register_channel:reads_attr", - "span_start": 17, - "span_end": 17, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "1ee5925deffdc38ba15b88bf7c89e5fcd1a78f493fe30f2deb827d714a1b18e8", - "edge_type": "reads_attr", - "src_symbol_id": "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957", - "src_qname": "ControlPlaneService.register_channel", - "dst_symbol_id": null, - "dst_ref": "self._channels.append", - "resolution": "partial", - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "class ControlPlaneService:\n def __init__(self) -> None:\n self._channels: list[ControlChannel] = []\n\n def register_channel(self, channel: ControlChannel) -> None:\n self._channels.append(channel)\n\n def start(self, runtime: RuntimeManager) -> None:\n if not self._channels:\n return\n asyncio.run(self._start_async(runtime))\n\n def stop(self) -> None:\n if not self._channels:\n return\n asyncio.run(self._stop_async())\n\n def snapshot(self, runtime: RuntimeManager) -> dict[str, object]:\n health = runtime.current_health()\n return {\n \"runtime\": {\"state\": runtime._state.value},\n \"modules\": list(runtime.registry.modules),\n \"services\": runtime.services.snapshot(),\n \"workers\": runtime.workers.snapshot(),\n \"health\": runtime.health.snapshot(runtime.workers.healths()) | {\"status\": health[\"status\"]},\n \"config\": runtime.configuration.get(),\n }\n\n async def _start_async(self, runtime: RuntimeManager) -> None:\n actions = ControlActionSet(\n health=runtime.health_status,\n start=runtime.start_runtime,\n stop=runtime.stop_runtime,\n status=runtime.runtime_status,\n )\n for channel in self._channels:\n await channel.start(actions)\n\n async def _stop_async(self) -> None:\n for channel in reversed(self._channels):\n await channel.stop()", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/service.py:ControlPlaneService", - "span_start": 12, - "span_end": 52, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.service", - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ] - }, - "diagnostics": { - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C0_SOURCE_CHUNKS": "exact_path_fetch", - "C4_SEMANTIC_ROLES": "exact_path_fetch", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C3_ENTRYPOINTS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 8, - "C4_SEMANTIC_ROLES": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C3_ENTRYPOINTS": 6 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C4_SEMANTIC_ROLES": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "ControlPlaneService", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Объясни класс ControlPlaneService", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C4_SEMANTIC_ROLES", - "query": "Объясни класс ControlPlaneService", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "Объясни класс ControlPlaneService", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - }, - { - "layer": "C3_ENTRYPOINTS", - "query": "Объясни класс ControlPlaneService", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 1, - "candidates_after_filter": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 6, - "candidates_after_filter": 6 - }, - { - "layer": "C3_ENTRYPOINTS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 3, - "candidates_after_filter": 3 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "ControlPlaneService", - "alternatives": [ - "ControlPlaneService" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C4_SEMANTIC_ROLES", - "status": "hit", - "hit_count": 8, - "fail_reason": null - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 6, - "fail_reason": null - }, - { - "layer": "C3_ENTRYPOINTS", - "status": "hit", - "hit_count": 3, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "symbol_resolution": 0, - "retrieval_total": 168, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 57, - "C0_SOURCE_CHUNKS": 23, - "C4_SEMANTIC_ROLES": 15, - "C2_DEPENDENCY_GRAPH": 61, - "C3_ENTRYPOINTS": 10 - }, - "merge_rank": 18 - } - } - }, - { - "step": "llm_answer", - "input": { - "query": "Объясни класс ControlPlaneService", - "rag_count": 19 - }, - "output": { - "llm_answer": "## Анализ класса `ControlPlaneService`\n\n### Описание файла и класса\n\nКласс `ControlPlaneService` определен в файле `src/app_runtime/control/service.py`.\n\n```python\n# src/app_runtime/control/service.py\nclass ControlPlaneService\n```\n\n### Назначение и обязанности\n\nНазвание класса предполагает, что он является службой управления плоскостью контроля (`Control Plane Service`), которая отвечает за управление определенными аспектами приложения или системы.\n\n#### Основные обязанности и роли:\n\n- **Назначение**: Предполагается, что класс реализует функциональность сервиса, связанный с управлением состоянием системы, взаимодействует с другими компонентами и участвует в различных этапах обработки данных (dataflow slices).\n \n - **Поведение сервиса**:\n - Обрабатывает запросы и изменяет состояние системы через чтение и запись атрибутов состояния.\n \n - **Участие в потоке данных (dataflow)**: \n Класс участвует в нескольких срезах потока данных (dataflow slices):\n - Срез №5: Участие в общих сервисных операциях, связанных с управлением системой.\n \n\n### Зависимости и взаимодействие\n\nКласс использует другие классы и интерфейсы для выполнения своих обязанностей:\n\n- Контроллер канала (`ControlChannel`) из модуля `base.py`: Это интерфейс, представляющий стандартный контроллер модели.\n- Контрольный набор действий (`ControlActionSet`) также из модуля `base.py`: Набор стандартных операций или действий, которые могут быть выполнены моделью.\n- Другие классы и сервисы, участвующие в выполнении HTTP-запросов, такие как `UvicornThreadRunner`, который используется для запуска HTTP-сервера на отдельном потоке, и `HttpControlChannel`, обеспечивающий HTTP-контроллеры.\n\nЭти зависимости позволяют классу эффективно участвовать в управлении состоянием системы и взаимодействии с внешними API и серверами.\n\n---\n\n### Поток данных и архитектура\n\nАрхитектура класса предполагает централизованное управление данными и состоянием через определенные срезы данных (dataflow slices). Каждый из этих срезов представляет собой этап или часть общего процесса работы системы, где данный класс выполняет свою роль.\n\nНапример:\n\n- В срезе №5 он может выполнять действия по управлению конфигурацией, состоянию и обработке ошибок, связанных с общим контролем над работой системы.\n\n---\n\n### Заключение\n\nТаким образом, `ControlPlaneService` — это ключевой элемент архитектуры, ответственный за обработку и управление состоянием системы, ее конфигурацией и взаимодействием с внешними компонентами и службами. Его функциональность интегрируется в общий процесс через различные срезы данных, обеспечивая гибкость и масштабируемость всей системы." - }, - "diagnostics": { - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 325, - "evidence_rows": 19, - "evidence_chars": 3087 - }, - "evidence_summary": [ - { - "layer": "C1_SYMBOL_CATALOG", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "count": 8, - "unique_paths": 7 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "count": 6, - "unique_paths": 1 - }, - { - "layer": "C3_ENTRYPOINTS", - "count": 3, - "unique_paths": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 1, - "unique_paths": 1 - } - ], - "prompt_template_id": "intent_code_qa_v1", - "system_prompt_version": "v1" - }, - "timings_ms": { - "prompt_build": 0, - "llm_call": 5367 - } - } - } - ] - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_090854/full_chain_plba_code_retrieval_plba-fullchain-explain-control-plane-service.md b/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_090854/full_chain_plba_code_retrieval_plba-fullchain-explain-control-plane-service.md deleted file mode 100644 index 6f3b898..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_090854/full_chain_plba_code_retrieval_plba-fullchain-explain-control-plane-service.md +++ /dev/null @@ -1,34 +0,0 @@ -# plba-fullchain-explain-control-plane-service - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_retrieval.yaml -- runner: runtime -- mode: full_chain -- passed: True - -## Query -Объясни класс ControlPlaneService - -## Actual -{ - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 19, - "llm_answer": "## Анализ класса `ControlPlaneService`\n\n### Описание файла и класса\n\nКласс `ControlPlaneService` определен в файле `src/app_runtime/control/service.py`.\n\n```python\n# src/app_runtime/control/service.py\nclass ControlPlaneService\n```\n\n### Назначение и обязанности\n\nНазвание класса предполагает, что он является службой управления плоскостью контроля (`Control Plane Service`), которая отвечает за управление определенными аспектами приложения или системы.\n\n#### Основные обязанности и роли:\n\n- **Назначение**: Предполагается, что класс реализует функциональность сервиса, связанный с управлением состоянием системы, взаимодействует с другими компонентами и участвует в различных этапах обработки данных (dataflow slices).\n \n - **Поведение сервиса**:\n - Обрабатывает запросы и изменяет состояние системы через чтение и запись атрибутов состояния.\n \n - **Участие в потоке данных (dataflow)**: \n Класс участвует в нескольких срезах потока данных (dataflow slices):\n - Срез №5: Участие в общих сервисных операциях, связанных с управлением системой.\n \n\n### Зависимости и взаимодействие\n\nКласс использует другие классы и интерфейсы для выполнения своих обязанностей:\n\n- Контроллер канала (`ControlChannel`) из модуля `base.py`: Это интерфейс, представляющий стандартный контроллер модели.\n- Контрольный набор действий (`ControlActionSet`) также из модуля `base.py`: Набор стандартных операций или действий, которые могут быть выполнены моделью.\n- Другие классы и сервисы, участвующие в выполнении HTTP-запросов, такие как `UvicornThreadRunner`, который используется для запуска HTTP-сервера на отдельном потоке, и `HttpControlChannel`, обеспечивающий HTTP-контроллеры.\n\nЭти зависимости позволяют классу эффективно участвовать в управлении состоянием системы и взаимодействии с внешними API и серверами.\n\n---\n\n### Поток данных и архитектура\n\nАрхитектура класса предполагает централизованное управление данными и состоянием через определенные срезы данных (dataflow slices). Каждый из этих срезов представляет собой этап или часть общего процесса работы системы, где данный класс выполняет свою роль.\n\nНапример:\n\n- В срезе №5 он может выполнять действия по управлению конфигурацией, состоянию и обработке ошибок, связанных с общим контролем над работой системы.\n\n---\n\n### Заключение\n\nТаким образом, `ControlPlaneService` — это ключевой элемент архитектуры, ответственный за обработку и управление состоянием системы, ее конфигурацией и взаимодействием с внешними компонентами и службами. Его функциональность интегрируется в общий процесс через различные срезы данных, обеспечивая гибкость и масштабируемость всей системы.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "ControlPlaneService" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] -} - -## Mismatches -- none \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_090854/full_chain_plba_code_retrieval_plba-fullchain-explain-http-control-channel.json b/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_090854/full_chain_plba_code_retrieval_plba-fullchain-explain-http-control-channel.json deleted file mode 100644 index ee6ab87..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_090854/full_chain_plba_code_retrieval_plba-fullchain-explain-http-control-channel.json +++ /dev/null @@ -1,2564 +0,0 @@ -{ - "case_id": "plba-fullchain-explain-http-control-channel", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_retrieval.yaml", - "runner": "runtime", - "mode": "full_chain", - "actual": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 19, - "llm_answer": "## Анализ класса `HttpControlChannel`\n\n### Файл и позиция класса\n```python\n# Источник: src/app_runtime/control/http_channel.py\n# Класс: HttpControlChannel\n```\n\n### Наследование и роль класса\nКласс `HttpControlChannel` наследует от базового класса `ControlChannel`. Его аннотация указывает на то, что он является частью стадии конвейера (`pipeline_stage`), что означает его участие в общем потоке обработки данных приложения.\n\n### Ответственность класса\nДокументированные обязанности класса включают:\n- Чтение и запись атрибутов состояния.\n- Участие в срезах потока данных (dataflow slices).\n\nВ документации упоминается конкретное количество таких срезов — 10.\n\n### Взаимодействие с другими сущностями\nДля понимания полной картины взаимодействия и архитектуры важно рассмотреть следующие классы и их роли:\n\n#### 1. **ControlChannel**\nЭтот базовый класс определяет основную модель поведения для всех каналов управления состоянием. Он имеет следующую документацию:\n```python\n# Источник: src/app_runtime/control/base.py\n# Класс: ControlChannel\nControlChannel\nrole: model\nResponsibilities:\n- default model role\n```\n\n#### 2. **ControlActionSet**\nЭто также базовый класс действий контроля, упомянутый в той же документации, но не приводится подробной информации о нем здесь.\n\n#### 3. **ControlPlaneService**\nЕще одна сущность, упомянутая в контексте, которая играет важную роль как сервис управления данными:\n```python\n# Источник: src/app_runtime/control/service.py\n# Класс: ControlPlaneService\nControlPlaneService\nrole: pipeline_stage\nResponsibilities:\n- name suffix suggests service\n- reads and writes state attributes\n- participates in dataflow slices (5)\n```\n\n#### 4. **UvicornThreadRunner**\nТакже упоминается еще один компонент, участвующий в управлении состоянием и потоков данных:\n```python\n# Источник: src/app_runtime/control/http_runner.py\n# Класс: UvicornThreadRunner\nUvicornThreadRunner\nrole: pipeline_stage\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (24)\n```\n\n### Поток данных и взаимодействие между компонентами\nУчитывая вышеописанные классы и обязанности, можно предположить следующий сценарий работы системы:\n\n1. Пользовательский запрос поступает через HTTP API.\n2. Управление состоянием запроса осуществляется посредством объекта `HttpControlChannel`, который обеспечивает чтение и запись необходимых атрибутов состояния.\n3. Канал взаимодействует с общей системой управления состоянием через промежуточные службы, такие как `ControlPlaneService`.\n4. Эти службы участвуют в более широком потоке данных (dataflow slices) вместе с другим компонентом `UvicornThreadRunner`, обеспечивая параллельную обработку запросов и управление потоком выполнения задач.\n\nТаким образом, основная задача `HttpControlChannel` заключается в обеспечении надежной логики чтения и записи атрибутов состояния для отдельных частей системы, при этом совместно с другими компонентами он участвует в обработке и маршрутизации данных в рамках общего архитектурного подхода.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "HttpControlChannel" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "passed": true, - "mismatches": [], - "details": { - "case_id": "plba-fullchain-explain-http-control-channel", - "text": "Объясни класс HttpControlChannel", - "mode": "full_chain", - "run_started_at": "2026-03-12T09:08:54", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Объясни класс HttpControlChannel", - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "HttpControlChannel", - "alternatives": [ - "HttpControlChannel" - ], - "confidence": 0.99 - }, - "rag_count": 19, - "rag_rows": [ - { - "path": "src/app_runtime/control/http_channel.py", - "content": "class HttpControlChannel\nHttpControlChannel(ControlChannel)", - "layer": "C1_SYMBOL_CATALOG", - "title": "HttpControlChannel", - "span_start": 12, - "span_end": 57, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "1c9fbdc24819e5604c26ea55428a74310f03a03e1af197ed84846af61e42fdb0", - "qname": "HttpControlChannel", - "kind": "class", - "signature": "HttpControlChannel(ControlChannel)", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.control.http_channel", - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (10)", - "layer": "C4_SEMANTIC_ROLES", - "title": "HttpControlChannel", - "span_start": 12, - "span_end": 57, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 21, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "1c9fbdc24819e5604c26ea55428a74310f03a03e1af197ed84846af61e42fdb0", - "symbol_name": "HttpControlChannel", - "qname": "HttpControlChannel", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 10, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "ControlChannel\nrole: model\n\nResponsibilities:\n- default model role", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlChannel", - "span_start": 21, - "span_end": 28, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 40, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "cfcfe9a311d3a2dbdaf32ac4ccd73c0eb9a117f830591a1c0867ee97d46204ff", - "symbol_name": "ControlChannel", - "qname": "ControlChannel", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "ControlActionSet\nrole: model\n\nResponsibilities:\n- default model role", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlActionSet", - "span_start": 14, - "span_end": 18, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 40, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "46eb026cb3313415ec47b82dd22f84f4d112c9d987e8b1716dcb0baa1cce8988", - "symbol_name": "ControlActionSet", - "qname": "ControlActionSet", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests service\n- reads and writes state attributes\n- participates in dataflow slices (5)", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlPlaneService", - "span_start": 12, - "span_end": 52, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 68, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "b13471e5916986dccffb53fab613812842965705e6b3a89ae549d30c9e91e9aa", - "symbol_name": "ControlPlaneService", - "qname": "ControlPlaneService", - "role": "pipeline_stage", - "confidence": 0.57, - "dataflow_participation": 5, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_runner.py", - "content": "UvicornThreadRunner\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (24)", - "layer": "C4_SEMANTIC_ROLES", - "title": "UvicornThreadRunner", - "span_start": 10, - "span_end": 61, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 11, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "fd55630045a02100df8877ac27d951ee08617d4598764394d48cb51fe067476a", - "symbol_name": "UvicornThreadRunner", - "qname": "UvicornThreadRunner", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 24, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "3779fdd2878b770e789a35bb2a89c9d79f13b61c26d7db1b3b683f9bb9e1623f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "HttpControlAppFactory\nrole: factory\n\nResponsibilities:\n- name suffix suggests factory", - "layer": "C4_SEMANTIC_ROLES", - "title": "HttpControlAppFactory", - "span_start": 15, - "span_end": 53, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 39, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "9b3502a5fb408b273223db13264349cf500de24915b6c649d9ea8970d0dfd8e0", - "symbol_name": "HttpControlAppFactory", - "qname": "HttpControlAppFactory", - "role": "factory", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/persistence/workflow_persistence.py", - "content": "WorkflowPersistence\nrole: pipeline_stage\n\nResponsibilities:\n- orchestrates role-like calls (2)\n- reads and writes state attributes\n- participates in dataflow slices (16)", - "layer": "C4_SEMANTIC_ROLES", - "title": "WorkflowPersistence", - "span_start": 8, - "span_end": 54, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 15, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "7bd01ee45cf31f2d5c2e3e51656254860ac785d10cef9e0852cd4fba90857bae", - "symbol_name": "WorkflowPersistence", - "qname": "WorkflowPersistence", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 16, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "80e9410ddc639789b4353c2a1a757ba8d0d5b5bb6075b0b263b61551f04ae1f0", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/queue/in_memory.py", - "content": "InMemoryTaskQueue\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (9)", - "layer": "C4_SEMANTIC_ROLES", - "title": "InMemoryTaskQueue", - "span_start": 9, - "span_end": 38, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 22, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "2da04cb94544a3bcbf0943a95ad4bdd8710bcafaa32a02fd0e4de2178dcf3533", - "symbol_name": "InMemoryTaskQueue", - "qname": "InMemoryTaskQueue", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 9, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "58f0cc001ccda0eee4c6bc32ed83bd05eafd6b6644f1e8b4aa9eed3103db73dc", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel.__init__\n -> HttpControlChannel._runner\n -> HttpControlChannel.start", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "HttpControlChannel.__init__:dataflow_slice", - "span_start": 15, - "span_end": 22, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "51d73913df709152258ed1b9a8c8f4eb3c575eccfe6b982aef0b28e0789a29da", - "edge_type": "dataflow_slice", - "src_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "src_qname": "HttpControlChannel.__init__", - "dst_symbol_id": "d1933f04137f52535b6525f1b93ff2cd83bfb216b480e887e791ed1714cda8e0", - "dst_ref": "HttpControlChannel.start", - "resolution": "resolved", - "slice_id": "51d73913df709152258ed1b9a8c8f4eb3c575eccfe6b982aef0b28e0789a29da", - "root_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "path_symbols": [ - "HttpControlChannel.__init__", - "HttpControlChannel._runner", - "HttpControlChannel.start" - ], - "path_symbol_ids": [ - "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "d1933f04137f52535b6525f1b93ff2cd83bfb216b480e887e791ed1714cda8e0" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel.__init__\n -> HttpControlChannel._runner\n -> HttpControlChannel.port", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "HttpControlChannel.__init__:dataflow_slice", - "span_start": 15, - "span_end": 29, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "c7167bab7218bb768ad7c11bfb40d1a3096e6071dd7817bba5fd864cf8f6de13", - "edge_type": "dataflow_slice", - "src_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "src_qname": "HttpControlChannel.__init__", - "dst_symbol_id": "3632ce8227f4a31e0768f2fb021a4d1ba28e1202633aa0f2fac902295931280f", - "dst_ref": "HttpControlChannel.port", - "resolution": "resolved", - "slice_id": "c7167bab7218bb768ad7c11bfb40d1a3096e6071dd7817bba5fd864cf8f6de13", - "root_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "path_symbols": [ - "HttpControlChannel.__init__", - "HttpControlChannel._runner", - "HttpControlChannel.port" - ], - "path_symbol_ids": [ - "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "3632ce8227f4a31e0768f2fb021a4d1ba28e1202633aa0f2fac902295931280f" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel.__init__\n -> HttpControlChannel._timeout\n -> HttpControlChannel._health_response", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "HttpControlChannel.__init__:dataflow_slice", - "span_start": 14, - "span_end": 34, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "f858f5c9e575f6c4cdfe3853571b7ee21d1f628a443541d2037c3dc9d0790bef", - "edge_type": "dataflow_slice", - "src_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "src_qname": "HttpControlChannel.__init__", - "dst_symbol_id": "e84bf04e9cd2127df235b7064d05f47e19f19a89c7c82f4c247231d4e8fa426a", - "dst_ref": "HttpControlChannel._health_response", - "resolution": "resolved", - "slice_id": "f858f5c9e575f6c4cdfe3853571b7ee21d1f628a443541d2037c3dc9d0790bef", - "root_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "path_symbols": [ - "HttpControlChannel.__init__", - "HttpControlChannel._timeout", - "HttpControlChannel._health_response" - ], - "path_symbol_ids": [ - "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "e84bf04e9cd2127df235b7064d05f47e19f19a89c7c82f4c247231d4e8fa426a" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel.__init__\n -> HttpControlChannel._timeout\n -> HttpControlChannel._action_response", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "HttpControlChannel.__init__:dataflow_slice", - "span_start": 14, - "span_end": 47, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "c3ef21fcae96c82c00be74b3ab827d4af2085d89cb3fa5521c19a174aad84dbb", - "edge_type": "dataflow_slice", - "src_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "src_qname": "HttpControlChannel.__init__", - "dst_symbol_id": "e64969024ccaeb34d8d91473fad07b3b3d341875846392e7a006406c7ada1954", - "dst_ref": "HttpControlChannel._action_response", - "resolution": "resolved", - "slice_id": "c3ef21fcae96c82c00be74b3ab827d4af2085d89cb3fa5521c19a174aad84dbb", - "root_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "path_symbols": [ - "HttpControlChannel.__init__", - "HttpControlChannel._timeout", - "HttpControlChannel._action_response" - ], - "path_symbol_ids": [ - "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "e64969024ccaeb34d8d91473fad07b3b3d341875846392e7a006406c7ada1954" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel.__init__\n -> HttpControlChannel._runner\n -> HttpControlChannel.stop", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "HttpControlChannel.__init__:dataflow_slice", - "span_start": 15, - "span_end": 25, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "0f827ef81a990258a8a74381c8564a8361afa6712dba3200592659c939adcb9d", - "edge_type": "dataflow_slice", - "src_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "src_qname": "HttpControlChannel.__init__", - "dst_symbol_id": "f29ab212620093d72be20e26c5a399624c7939a6056a728762ed3f84a250bfa3", - "dst_ref": "HttpControlChannel.stop", - "resolution": "resolved", - "slice_id": "0f827ef81a990258a8a74381c8564a8361afa6712dba3200592659c939adcb9d", - "root_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "path_symbols": [ - "HttpControlChannel.__init__", - "HttpControlChannel._runner", - "HttpControlChannel.stop" - ], - "path_symbol_ids": [ - "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "f29ab212620093d72be20e26c5a399624c7939a6056a728762ed3f84a250bfa3" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel.__init__\n -> HttpControlChannel._factory\n -> HttpControlChannel.start", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "HttpControlChannel.__init__:dataflow_slice", - "span_start": 16, - "span_end": 21, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e61ec25ded7dbe380d95ce2abcbc1d7a2d2afde5aa8453866df8706dfb7d6ddb", - "edge_type": "dataflow_slice", - "src_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "src_qname": "HttpControlChannel.__init__", - "dst_symbol_id": "d1933f04137f52535b6525f1b93ff2cd83bfb216b480e887e791ed1714cda8e0", - "dst_ref": "HttpControlChannel.start", - "resolution": "resolved", - "slice_id": "e61ec25ded7dbe380d95ce2abcbc1d7a2d2afde5aa8453866df8706dfb7d6ddb", - "root_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "path_symbols": [ - "HttpControlChannel.__init__", - "HttpControlChannel._factory", - "HttpControlChannel.start" - ], - "path_symbol_ids": [ - "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "d1933f04137f52535b6525f1b93ff2cd83bfb216b480e887e791ed1714cda8e0" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "class HttpControlChannel(ControlChannel):\n def __init__(self, host: str, port: int, timeout: int) -> None:\n self._timeout = timeout\n self._runner = UvicornThreadRunner(host, port, timeout)\n self._factory = HttpControlAppFactory()\n self._actions: ControlActionSet | None = None\n\n async def start(self, actions: ControlActionSet) -> None:\n self._actions = actions\n app = self._factory.create(self._health_response, self._action_response)\n await self._runner.start(app)\n\n async def stop(self) -> None:\n await self._runner.stop()\n\n @property\n def port(self) -> int:\n return self._runner.port\n\n async def _health_response(self) -> dict[str, object]:\n if self._actions is None:\n return {\"status\": \"unhealthy\", \"detail\": \"control actions are not configured\"}\n return await asyncio.wait_for(self._actions.health(), timeout=float(self._timeout))\n\n async def _action_response(self, action: str, _client_source: str = \"unknown\") -> JSONResponse:\n if self._actions is None:\n return JSONResponse(content={\"status\": \"error\", \"detail\": f\"{action} handler is not configured\"}, status_code=404)\n callbacks = {\n \"start\": self._actions.start,\n \"stop\": self._actions.stop,\n \"status\": self._actions.status,\n }\n callback = callbacks.get(action)\n if callback is None:\n return JSONResponse(content={\"status\": \"error\", \"detail\": f\"unsupported action: {action}\"}, status_code=404)\n action_timeout = max(float(self._timeout), 10.0) if action in {\"start\", \"stop\"} else float(self._timeout)\n try:\n detail = await asyncio.wait_for(callback(), timeout=action_timeout)\n except asyncio.TimeoutError:\n return JSONResponse(\n content={\"status\": \"accepted\", \"detail\": f\"{action} operation is still in progress\"},\n status_code=202,\n )\n except Exception as exc:\n return JSONResponse(content={\"status\": \"error\", \"detail\": str(exc)}, status_code=500)\n return JSONResponse(content={\"status\": \"ok\", \"detail\": detail or f\"{action} action accepted\"}, status_code=200)", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/http_channel.py:HttpControlChannel", - "span_start": 12, - "span_end": 57, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.http_channel", - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "llm_answer": "## Анализ класса `HttpControlChannel`\n\n### Файл и позиция класса\n```python\n# Источник: src/app_runtime/control/http_channel.py\n# Класс: HttpControlChannel\n```\n\n### Наследование и роль класса\nКласс `HttpControlChannel` наследует от базового класса `ControlChannel`. Его аннотация указывает на то, что он является частью стадии конвейера (`pipeline_stage`), что означает его участие в общем потоке обработки данных приложения.\n\n### Ответственность класса\nДокументированные обязанности класса включают:\n- Чтение и запись атрибутов состояния.\n- Участие в срезах потока данных (dataflow slices).\n\nВ документации упоминается конкретное количество таких срезов — 10.\n\n### Взаимодействие с другими сущностями\nДля понимания полной картины взаимодействия и архитектуры важно рассмотреть следующие классы и их роли:\n\n#### 1. **ControlChannel**\nЭтот базовый класс определяет основную модель поведения для всех каналов управления состоянием. Он имеет следующую документацию:\n```python\n# Источник: src/app_runtime/control/base.py\n# Класс: ControlChannel\nControlChannel\nrole: model\nResponsibilities:\n- default model role\n```\n\n#### 2. **ControlActionSet**\nЭто также базовый класс действий контроля, упомянутый в той же документации, но не приводится подробной информации о нем здесь.\n\n#### 3. **ControlPlaneService**\nЕще одна сущность, упомянутая в контексте, которая играет важную роль как сервис управления данными:\n```python\n# Источник: src/app_runtime/control/service.py\n# Класс: ControlPlaneService\nControlPlaneService\nrole: pipeline_stage\nResponsibilities:\n- name suffix suggests service\n- reads and writes state attributes\n- participates in dataflow slices (5)\n```\n\n#### 4. **UvicornThreadRunner**\nТакже упоминается еще один компонент, участвующий в управлении состоянием и потоков данных:\n```python\n# Источник: src/app_runtime/control/http_runner.py\n# Класс: UvicornThreadRunner\nUvicornThreadRunner\nrole: pipeline_stage\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (24)\n```\n\n### Поток данных и взаимодействие между компонентами\nУчитывая вышеописанные классы и обязанности, можно предположить следующий сценарий работы системы:\n\n1. Пользовательский запрос поступает через HTTP API.\n2. Управление состоянием запроса осуществляется посредством объекта `HttpControlChannel`, который обеспечивает чтение и запись необходимых атрибутов состояния.\n3. Канал взаимодействует с общей системой управления состоянием через промежуточные службы, такие как `ControlPlaneService`.\n4. Эти службы участвуют в более широком потоке данных (dataflow slices) вместе с другим компонентом `UvicornThreadRunner`, обеспечивая параллельную обработку запросов и управление потоком выполнения задач.\n\nТаким образом, основная задача `HttpControlChannel` заключается в обеспечении надежной логики чтения и записи атрибутов состояния для отдельных частей системы, при этом совместно с другими компонентами он участвует в обработке и маршрутизации данных в рамках общего архитектурного подхода.", - "summary": { - "router": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "confidence": null - }, - "retrieval": { - "profile": "code", - "layers_hit": [ - "C0_SOURCE_CHUNKS", - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS", - "C4_SEMANTIC_ROLES" - ], - "evidence_sufficient": true - }, - "llm": { - "answer_status": "answered", - "groundedness": "grounded" - } - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "HttpControlChannel" - ], - "keyword_hints": [ - "HttpControlChannel" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C0_SOURCE_CHUNKS": "exact_path_fetch", - "C4_SEMANTIC_ROLES": "exact_path_fetch", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C3_ENTRYPOINTS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 8, - "C4_SEMANTIC_ROLES": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C3_ENTRYPOINTS": 6 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C4_SEMANTIC_ROLES": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "HttpControlChannel", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Объясни класс HttpControlChannel", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C4_SEMANTIC_ROLES", - "query": "Объясни класс HttpControlChannel", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "Объясни класс HttpControlChannel", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - }, - { - "layer": "C3_ENTRYPOINTS", - "query": "Объясни класс HttpControlChannel", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 1, - "candidates_after_filter": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 6, - "candidates_after_filter": 6 - }, - { - "layer": "C3_ENTRYPOINTS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 3, - "candidates_after_filter": 3 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "HttpControlChannel", - "alternatives": [ - "HttpControlChannel" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C4_SEMANTIC_ROLES", - "status": "hit", - "hit_count": 8, - "fail_reason": null - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 6, - "fail_reason": null - }, - { - "layer": "C3_ENTRYPOINTS", - "status": "hit", - "hit_count": 3, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "router": 0, - "symbol_resolution": 0, - "retrieval_total": 150, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 44, - "C0_SOURCE_CHUNKS": 21, - "C4_SEMANTIC_ROLES": 16, - "C2_DEPENDENCY_GRAPH": 56, - "C3_ENTRYPOINTS": 11 - }, - "merge_rank": 24, - "prompt_build": 0, - "llm_call": 6098 - }, - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 329, - "evidence_rows": 19, - "evidence_chars": 3845 - }, - "evidence_summary": [ - { - "layer": "C1_SYMBOL_CATALOG", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "count": 8, - "unique_paths": 7 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "count": 6, - "unique_paths": 1 - }, - { - "layer": "C3_ENTRYPOINTS", - "count": 3, - "unique_paths": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 1, - "unique_paths": 1 - } - ], - "prompt_template_id": "intent_code_qa_v1", - "system_prompt_version": "v1" - }, - "router": { - "conversation_mode": "START", - "keyword_hints": [ - "HttpControlChannel" - ], - "path_scope": [] - }, - "llm": { - "used_evidence_count": 19, - "missing_evidence_reason": null - } - }, - "run_info": { - "case_id": "plba-fullchain-explain-http-control-channel", - "mode": "full_chain", - "run_started_at": "2026-03-12T09:08:54", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - }, - "input_request": { - "text": "Объясни класс HttpControlChannel", - "normalized_query": "Объясни класс HttpControlChannel" - }, - "steps": [ - { - "step": "intent_router", - "input": { - "query": "Объясни класс HttpControlChannel" - }, - "output": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Объясни класс HttpControlChannel" - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "HttpControlChannel" - ], - "keyword_hints": [ - "HttpControlChannel" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "timings_ms": { - "router": 0 - } - } - }, - { - "step": "retrieval", - "input": { - "query": "Объясни класс HttpControlChannel" - }, - "output": { - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "HttpControlChannel", - "alternatives": [ - "HttpControlChannel" - ], - "confidence": 0.99 - }, - "rag_count": 19, - "rag_rows": [ - { - "path": "src/app_runtime/control/http_channel.py", - "content": "class HttpControlChannel\nHttpControlChannel(ControlChannel)", - "layer": "C1_SYMBOL_CATALOG", - "title": "HttpControlChannel", - "span_start": 12, - "span_end": 57, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "1c9fbdc24819e5604c26ea55428a74310f03a03e1af197ed84846af61e42fdb0", - "qname": "HttpControlChannel", - "kind": "class", - "signature": "HttpControlChannel(ControlChannel)", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.control.http_channel", - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (10)", - "layer": "C4_SEMANTIC_ROLES", - "title": "HttpControlChannel", - "span_start": 12, - "span_end": 57, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 21, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "1c9fbdc24819e5604c26ea55428a74310f03a03e1af197ed84846af61e42fdb0", - "symbol_name": "HttpControlChannel", - "qname": "HttpControlChannel", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 10, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "ControlChannel\nrole: model\n\nResponsibilities:\n- default model role", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlChannel", - "span_start": 21, - "span_end": 28, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 40, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "cfcfe9a311d3a2dbdaf32ac4ccd73c0eb9a117f830591a1c0867ee97d46204ff", - "symbol_name": "ControlChannel", - "qname": "ControlChannel", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "ControlActionSet\nrole: model\n\nResponsibilities:\n- default model role", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlActionSet", - "span_start": 14, - "span_end": 18, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 40, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "46eb026cb3313415ec47b82dd22f84f4d112c9d987e8b1716dcb0baa1cce8988", - "symbol_name": "ControlActionSet", - "qname": "ControlActionSet", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests service\n- reads and writes state attributes\n- participates in dataflow slices (5)", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlPlaneService", - "span_start": 12, - "span_end": 52, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 68, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "b13471e5916986dccffb53fab613812842965705e6b3a89ae549d30c9e91e9aa", - "symbol_name": "ControlPlaneService", - "qname": "ControlPlaneService", - "role": "pipeline_stage", - "confidence": 0.57, - "dataflow_participation": 5, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_runner.py", - "content": "UvicornThreadRunner\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (24)", - "layer": "C4_SEMANTIC_ROLES", - "title": "UvicornThreadRunner", - "span_start": 10, - "span_end": 61, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 11, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "fd55630045a02100df8877ac27d951ee08617d4598764394d48cb51fe067476a", - "symbol_name": "UvicornThreadRunner", - "qname": "UvicornThreadRunner", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 24, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "3779fdd2878b770e789a35bb2a89c9d79f13b61c26d7db1b3b683f9bb9e1623f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "HttpControlAppFactory\nrole: factory\n\nResponsibilities:\n- name suffix suggests factory", - "layer": "C4_SEMANTIC_ROLES", - "title": "HttpControlAppFactory", - "span_start": 15, - "span_end": 53, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 39, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "9b3502a5fb408b273223db13264349cf500de24915b6c649d9ea8970d0dfd8e0", - "symbol_name": "HttpControlAppFactory", - "qname": "HttpControlAppFactory", - "role": "factory", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/persistence/workflow_persistence.py", - "content": "WorkflowPersistence\nrole: pipeline_stage\n\nResponsibilities:\n- orchestrates role-like calls (2)\n- reads and writes state attributes\n- participates in dataflow slices (16)", - "layer": "C4_SEMANTIC_ROLES", - "title": "WorkflowPersistence", - "span_start": 8, - "span_end": 54, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 15, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "7bd01ee45cf31f2d5c2e3e51656254860ac785d10cef9e0852cd4fba90857bae", - "symbol_name": "WorkflowPersistence", - "qname": "WorkflowPersistence", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 16, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "80e9410ddc639789b4353c2a1a757ba8d0d5b5bb6075b0b263b61551f04ae1f0", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/queue/in_memory.py", - "content": "InMemoryTaskQueue\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (9)", - "layer": "C4_SEMANTIC_ROLES", - "title": "InMemoryTaskQueue", - "span_start": 9, - "span_end": 38, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 22, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "2da04cb94544a3bcbf0943a95ad4bdd8710bcafaa32a02fd0e4de2178dcf3533", - "symbol_name": "InMemoryTaskQueue", - "qname": "InMemoryTaskQueue", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 9, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "58f0cc001ccda0eee4c6bc32ed83bd05eafd6b6644f1e8b4aa9eed3103db73dc", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel.__init__\n -> HttpControlChannel._runner\n -> HttpControlChannel.start", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "HttpControlChannel.__init__:dataflow_slice", - "span_start": 15, - "span_end": 22, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "51d73913df709152258ed1b9a8c8f4eb3c575eccfe6b982aef0b28e0789a29da", - "edge_type": "dataflow_slice", - "src_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "src_qname": "HttpControlChannel.__init__", - "dst_symbol_id": "d1933f04137f52535b6525f1b93ff2cd83bfb216b480e887e791ed1714cda8e0", - "dst_ref": "HttpControlChannel.start", - "resolution": "resolved", - "slice_id": "51d73913df709152258ed1b9a8c8f4eb3c575eccfe6b982aef0b28e0789a29da", - "root_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "path_symbols": [ - "HttpControlChannel.__init__", - "HttpControlChannel._runner", - "HttpControlChannel.start" - ], - "path_symbol_ids": [ - "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "d1933f04137f52535b6525f1b93ff2cd83bfb216b480e887e791ed1714cda8e0" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel.__init__\n -> HttpControlChannel._runner\n -> HttpControlChannel.port", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "HttpControlChannel.__init__:dataflow_slice", - "span_start": 15, - "span_end": 29, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "c7167bab7218bb768ad7c11bfb40d1a3096e6071dd7817bba5fd864cf8f6de13", - "edge_type": "dataflow_slice", - "src_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "src_qname": "HttpControlChannel.__init__", - "dst_symbol_id": "3632ce8227f4a31e0768f2fb021a4d1ba28e1202633aa0f2fac902295931280f", - "dst_ref": "HttpControlChannel.port", - "resolution": "resolved", - "slice_id": "c7167bab7218bb768ad7c11bfb40d1a3096e6071dd7817bba5fd864cf8f6de13", - "root_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "path_symbols": [ - "HttpControlChannel.__init__", - "HttpControlChannel._runner", - "HttpControlChannel.port" - ], - "path_symbol_ids": [ - "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "3632ce8227f4a31e0768f2fb021a4d1ba28e1202633aa0f2fac902295931280f" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel.__init__\n -> HttpControlChannel._timeout\n -> HttpControlChannel._health_response", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "HttpControlChannel.__init__:dataflow_slice", - "span_start": 14, - "span_end": 34, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "f858f5c9e575f6c4cdfe3853571b7ee21d1f628a443541d2037c3dc9d0790bef", - "edge_type": "dataflow_slice", - "src_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "src_qname": "HttpControlChannel.__init__", - "dst_symbol_id": "e84bf04e9cd2127df235b7064d05f47e19f19a89c7c82f4c247231d4e8fa426a", - "dst_ref": "HttpControlChannel._health_response", - "resolution": "resolved", - "slice_id": "f858f5c9e575f6c4cdfe3853571b7ee21d1f628a443541d2037c3dc9d0790bef", - "root_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "path_symbols": [ - "HttpControlChannel.__init__", - "HttpControlChannel._timeout", - "HttpControlChannel._health_response" - ], - "path_symbol_ids": [ - "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "e84bf04e9cd2127df235b7064d05f47e19f19a89c7c82f4c247231d4e8fa426a" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel.__init__\n -> HttpControlChannel._timeout\n -> HttpControlChannel._action_response", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "HttpControlChannel.__init__:dataflow_slice", - "span_start": 14, - "span_end": 47, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "c3ef21fcae96c82c00be74b3ab827d4af2085d89cb3fa5521c19a174aad84dbb", - "edge_type": "dataflow_slice", - "src_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "src_qname": "HttpControlChannel.__init__", - "dst_symbol_id": "e64969024ccaeb34d8d91473fad07b3b3d341875846392e7a006406c7ada1954", - "dst_ref": "HttpControlChannel._action_response", - "resolution": "resolved", - "slice_id": "c3ef21fcae96c82c00be74b3ab827d4af2085d89cb3fa5521c19a174aad84dbb", - "root_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "path_symbols": [ - "HttpControlChannel.__init__", - "HttpControlChannel._timeout", - "HttpControlChannel._action_response" - ], - "path_symbol_ids": [ - "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "e64969024ccaeb34d8d91473fad07b3b3d341875846392e7a006406c7ada1954" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel.__init__\n -> HttpControlChannel._runner\n -> HttpControlChannel.stop", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "HttpControlChannel.__init__:dataflow_slice", - "span_start": 15, - "span_end": 25, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "0f827ef81a990258a8a74381c8564a8361afa6712dba3200592659c939adcb9d", - "edge_type": "dataflow_slice", - "src_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "src_qname": "HttpControlChannel.__init__", - "dst_symbol_id": "f29ab212620093d72be20e26c5a399624c7939a6056a728762ed3f84a250bfa3", - "dst_ref": "HttpControlChannel.stop", - "resolution": "resolved", - "slice_id": "0f827ef81a990258a8a74381c8564a8361afa6712dba3200592659c939adcb9d", - "root_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "path_symbols": [ - "HttpControlChannel.__init__", - "HttpControlChannel._runner", - "HttpControlChannel.stop" - ], - "path_symbol_ids": [ - "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "f29ab212620093d72be20e26c5a399624c7939a6056a728762ed3f84a250bfa3" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel.__init__\n -> HttpControlChannel._factory\n -> HttpControlChannel.start", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "HttpControlChannel.__init__:dataflow_slice", - "span_start": 16, - "span_end": 21, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e61ec25ded7dbe380d95ce2abcbc1d7a2d2afde5aa8453866df8706dfb7d6ddb", - "edge_type": "dataflow_slice", - "src_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "src_qname": "HttpControlChannel.__init__", - "dst_symbol_id": "d1933f04137f52535b6525f1b93ff2cd83bfb216b480e887e791ed1714cda8e0", - "dst_ref": "HttpControlChannel.start", - "resolution": "resolved", - "slice_id": "e61ec25ded7dbe380d95ce2abcbc1d7a2d2afde5aa8453866df8706dfb7d6ddb", - "root_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "path_symbols": [ - "HttpControlChannel.__init__", - "HttpControlChannel._factory", - "HttpControlChannel.start" - ], - "path_symbol_ids": [ - "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "d1933f04137f52535b6525f1b93ff2cd83bfb216b480e887e791ed1714cda8e0" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "class HttpControlChannel(ControlChannel):\n def __init__(self, host: str, port: int, timeout: int) -> None:\n self._timeout = timeout\n self._runner = UvicornThreadRunner(host, port, timeout)\n self._factory = HttpControlAppFactory()\n self._actions: ControlActionSet | None = None\n\n async def start(self, actions: ControlActionSet) -> None:\n self._actions = actions\n app = self._factory.create(self._health_response, self._action_response)\n await self._runner.start(app)\n\n async def stop(self) -> None:\n await self._runner.stop()\n\n @property\n def port(self) -> int:\n return self._runner.port\n\n async def _health_response(self) -> dict[str, object]:\n if self._actions is None:\n return {\"status\": \"unhealthy\", \"detail\": \"control actions are not configured\"}\n return await asyncio.wait_for(self._actions.health(), timeout=float(self._timeout))\n\n async def _action_response(self, action: str, _client_source: str = \"unknown\") -> JSONResponse:\n if self._actions is None:\n return JSONResponse(content={\"status\": \"error\", \"detail\": f\"{action} handler is not configured\"}, status_code=404)\n callbacks = {\n \"start\": self._actions.start,\n \"stop\": self._actions.stop,\n \"status\": self._actions.status,\n }\n callback = callbacks.get(action)\n if callback is None:\n return JSONResponse(content={\"status\": \"error\", \"detail\": f\"unsupported action: {action}\"}, status_code=404)\n action_timeout = max(float(self._timeout), 10.0) if action in {\"start\", \"stop\"} else float(self._timeout)\n try:\n detail = await asyncio.wait_for(callback(), timeout=action_timeout)\n except asyncio.TimeoutError:\n return JSONResponse(\n content={\"status\": \"accepted\", \"detail\": f\"{action} operation is still in progress\"},\n status_code=202,\n )\n except Exception as exc:\n return JSONResponse(content={\"status\": \"error\", \"detail\": str(exc)}, status_code=500)\n return JSONResponse(content={\"status\": \"ok\", \"detail\": detail or f\"{action} action accepted\"}, status_code=200)", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/http_channel.py:HttpControlChannel", - "span_start": 12, - "span_end": 57, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.http_channel", - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ] - }, - "diagnostics": { - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C0_SOURCE_CHUNKS": "exact_path_fetch", - "C4_SEMANTIC_ROLES": "exact_path_fetch", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C3_ENTRYPOINTS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 8, - "C4_SEMANTIC_ROLES": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C3_ENTRYPOINTS": 6 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C4_SEMANTIC_ROLES": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "HttpControlChannel", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Объясни класс HttpControlChannel", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C4_SEMANTIC_ROLES", - "query": "Объясни класс HttpControlChannel", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "Объясни класс HttpControlChannel", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - }, - { - "layer": "C3_ENTRYPOINTS", - "query": "Объясни класс HttpControlChannel", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 1, - "candidates_after_filter": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 6, - "candidates_after_filter": 6 - }, - { - "layer": "C3_ENTRYPOINTS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 3, - "candidates_after_filter": 3 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "HttpControlChannel", - "alternatives": [ - "HttpControlChannel" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C4_SEMANTIC_ROLES", - "status": "hit", - "hit_count": 8, - "fail_reason": null - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 6, - "fail_reason": null - }, - { - "layer": "C3_ENTRYPOINTS", - "status": "hit", - "hit_count": 3, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "symbol_resolution": 0, - "retrieval_total": 150, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 44, - "C0_SOURCE_CHUNKS": 21, - "C4_SEMANTIC_ROLES": 16, - "C2_DEPENDENCY_GRAPH": 56, - "C3_ENTRYPOINTS": 11 - }, - "merge_rank": 24 - } - } - }, - { - "step": "llm_answer", - "input": { - "query": "Объясни класс HttpControlChannel", - "rag_count": 19 - }, - "output": { - "llm_answer": "## Анализ класса `HttpControlChannel`\n\n### Файл и позиция класса\n```python\n# Источник: src/app_runtime/control/http_channel.py\n# Класс: HttpControlChannel\n```\n\n### Наследование и роль класса\nКласс `HttpControlChannel` наследует от базового класса `ControlChannel`. Его аннотация указывает на то, что он является частью стадии конвейера (`pipeline_stage`), что означает его участие в общем потоке обработки данных приложения.\n\n### Ответственность класса\nДокументированные обязанности класса включают:\n- Чтение и запись атрибутов состояния.\n- Участие в срезах потока данных (dataflow slices).\n\nВ документации упоминается конкретное количество таких срезов — 10.\n\n### Взаимодействие с другими сущностями\nДля понимания полной картины взаимодействия и архитектуры важно рассмотреть следующие классы и их роли:\n\n#### 1. **ControlChannel**\nЭтот базовый класс определяет основную модель поведения для всех каналов управления состоянием. Он имеет следующую документацию:\n```python\n# Источник: src/app_runtime/control/base.py\n# Класс: ControlChannel\nControlChannel\nrole: model\nResponsibilities:\n- default model role\n```\n\n#### 2. **ControlActionSet**\nЭто также базовый класс действий контроля, упомянутый в той же документации, но не приводится подробной информации о нем здесь.\n\n#### 3. **ControlPlaneService**\nЕще одна сущность, упомянутая в контексте, которая играет важную роль как сервис управления данными:\n```python\n# Источник: src/app_runtime/control/service.py\n# Класс: ControlPlaneService\nControlPlaneService\nrole: pipeline_stage\nResponsibilities:\n- name suffix suggests service\n- reads and writes state attributes\n- participates in dataflow slices (5)\n```\n\n#### 4. **UvicornThreadRunner**\nТакже упоминается еще один компонент, участвующий в управлении состоянием и потоков данных:\n```python\n# Источник: src/app_runtime/control/http_runner.py\n# Класс: UvicornThreadRunner\nUvicornThreadRunner\nrole: pipeline_stage\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (24)\n```\n\n### Поток данных и взаимодействие между компонентами\nУчитывая вышеописанные классы и обязанности, можно предположить следующий сценарий работы системы:\n\n1. Пользовательский запрос поступает через HTTP API.\n2. Управление состоянием запроса осуществляется посредством объекта `HttpControlChannel`, который обеспечивает чтение и запись необходимых атрибутов состояния.\n3. Канал взаимодействует с общей системой управления состоянием через промежуточные службы, такие как `ControlPlaneService`.\n4. Эти службы участвуют в более широком потоке данных (dataflow slices) вместе с другим компонентом `UvicornThreadRunner`, обеспечивая параллельную обработку запросов и управление потоком выполнения задач.\n\nТаким образом, основная задача `HttpControlChannel` заключается в обеспечении надежной логики чтения и записи атрибутов состояния для отдельных частей системы, при этом совместно с другими компонентами он участвует в обработке и маршрутизации данных в рамках общего архитектурного подхода." - }, - "diagnostics": { - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 329, - "evidence_rows": 19, - "evidence_chars": 3845 - }, - "evidence_summary": [ - { - "layer": "C1_SYMBOL_CATALOG", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "count": 8, - "unique_paths": 7 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "count": 6, - "unique_paths": 1 - }, - { - "layer": "C3_ENTRYPOINTS", - "count": 3, - "unique_paths": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 1, - "unique_paths": 1 - } - ], - "prompt_template_id": "intent_code_qa_v1", - "system_prompt_version": "v1" - }, - "timings_ms": { - "prompt_build": 0, - "llm_call": 6098 - } - } - } - ] - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_090854/full_chain_plba_code_retrieval_plba-fullchain-explain-http-control-channel.md b/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_090854/full_chain_plba_code_retrieval_plba-fullchain-explain-http-control-channel.md deleted file mode 100644 index ed638fd..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_090854/full_chain_plba_code_retrieval_plba-fullchain-explain-http-control-channel.md +++ /dev/null @@ -1,34 +0,0 @@ -# plba-fullchain-explain-http-control-channel - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_retrieval.yaml -- runner: runtime -- mode: full_chain -- passed: True - -## Query -Объясни класс HttpControlChannel - -## Actual -{ - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 19, - "llm_answer": "## Анализ класса `HttpControlChannel`\n\n### Файл и позиция класса\n```python\n# Источник: src/app_runtime/control/http_channel.py\n# Класс: HttpControlChannel\n```\n\n### Наследование и роль класса\nКласс `HttpControlChannel` наследует от базового класса `ControlChannel`. Его аннотация указывает на то, что он является частью стадии конвейера (`pipeline_stage`), что означает его участие в общем потоке обработки данных приложения.\n\n### Ответственность класса\nДокументированные обязанности класса включают:\n- Чтение и запись атрибутов состояния.\n- Участие в срезах потока данных (dataflow slices).\n\nВ документации упоминается конкретное количество таких срезов — 10.\n\n### Взаимодействие с другими сущностями\nДля понимания полной картины взаимодействия и архитектуры важно рассмотреть следующие классы и их роли:\n\n#### 1. **ControlChannel**\nЭтот базовый класс определяет основную модель поведения для всех каналов управления состоянием. Он имеет следующую документацию:\n```python\n# Источник: src/app_runtime/control/base.py\n# Класс: ControlChannel\nControlChannel\nrole: model\nResponsibilities:\n- default model role\n```\n\n#### 2. **ControlActionSet**\nЭто также базовый класс действий контроля, упомянутый в той же документации, но не приводится подробной информации о нем здесь.\n\n#### 3. **ControlPlaneService**\nЕще одна сущность, упомянутая в контексте, которая играет важную роль как сервис управления данными:\n```python\n# Источник: src/app_runtime/control/service.py\n# Класс: ControlPlaneService\nControlPlaneService\nrole: pipeline_stage\nResponsibilities:\n- name suffix suggests service\n- reads and writes state attributes\n- participates in dataflow slices (5)\n```\n\n#### 4. **UvicornThreadRunner**\nТакже упоминается еще один компонент, участвующий в управлении состоянием и потоков данных:\n```python\n# Источник: src/app_runtime/control/http_runner.py\n# Класс: UvicornThreadRunner\nUvicornThreadRunner\nrole: pipeline_stage\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (24)\n```\n\n### Поток данных и взаимодействие между компонентами\nУчитывая вышеописанные классы и обязанности, можно предположить следующий сценарий работы системы:\n\n1. Пользовательский запрос поступает через HTTP API.\n2. Управление состоянием запроса осуществляется посредством объекта `HttpControlChannel`, который обеспечивает чтение и запись необходимых атрибутов состояния.\n3. Канал взаимодействует с общей системой управления состоянием через промежуточные службы, такие как `ControlPlaneService`.\n4. Эти службы участвуют в более широком потоке данных (dataflow slices) вместе с другим компонентом `UvicornThreadRunner`, обеспечивая параллельную обработку запросов и управление потоком выполнения задач.\n\nТаким образом, основная задача `HttpControlChannel` заключается в обеспечении надежной логики чтения и записи атрибутов состояния для отдельных частей системы, при этом совместно с другими компонентами он участвует в обработке и маршрутизации данных в рамках общего архитектурного подхода.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "HttpControlChannel" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] -} - -## Mismatches -- none \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_090854/full_chain_plba_code_retrieval_plba-fullchain-explain-runtime-manager.json b/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_090854/full_chain_plba_code_retrieval_plba-fullchain-explain-runtime-manager.json deleted file mode 100644 index bcdb6f7..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_090854/full_chain_plba_code_retrieval_plba-fullchain-explain-runtime-manager.json +++ /dev/null @@ -1,2564 +0,0 @@ -{ - "case_id": "plba-fullchain-explain-runtime-manager", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_retrieval.yaml", - "runner": "runtime", - "mode": "full_chain", - "actual": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 19, - "llm_answer": "## Анализ класса `RuntimeManager`\n\n### 1. Обзор файла и класса\n\nКласс `RuntimeManager` находится в файле `src/app_runtime/core/runtime.py`.\n\n```python\n# src/app_runtime/core/runtime.py\nclass RuntimeManager\n```\n\n### 2. Описание роли и обязанностей\n\nДокументация указывает следующие обязанности для данного класса:\n\n- **name suffix suggests manager**: Название класса предполагает управление другими сущностями или ресурсами.\n- **orchestrates role-like calls (4)**: Класс управляет вызовами ролей и выполняет координацию между ними.\n- **reads and writes state attributes**: Управление состоянием приложения и его атрибутов.\n- **participates in dataflow slices (50)**: Класс участвует в передаче данных через различные этапы обработки данных.\n\n### 3. Связанные классы и их роль\n\n- **ControlChannel** (`src/app_runtime/control/base.py`) — основной канал управления моделью.\n- **ControlActionSet** (`src/app_runtime/control/base.py`) — набор действий, связанных с управлением моделью.\n- **ControlPlaneService** (`src/app_runtime/control/service.py`) — сервис, связанный с управлением плоскостью контроля.\n- **UvicornThreadRunner** (`src/app_runtime/control/http_runner.py`) — запускает сервер на основе uvicorn и реализует многопоточную обработку запросов.\n\nЭти классы совместно участвуют в управлении жизненным циклом модели и потоков выполнения.\n\n### 4. Поток данных и архитектура\n\nАрхитектура включает следующее взаимодействие классов:\n\n- **RuntimeManager** координирует вызовы ролей и отвечает за состояние приложения.\n- **ControlChannel**, **ControlActionSet** обеспечивают логику управления моделями.\n- **ControlPlaneService** ответственен за хранение состояния приложения и передачу данных через различные потоки данных.\n- **UvicornThreadRunner** обеспечивает выполнение HTTP-запросов и синхронизацию потоков.\n\nТаким образом, общая схема выглядит следующим образом:\n\n```\n+----------+\n| RuntimeManager |\n+--+-----------+\n |\n v\n+----------+ +---------+ +---------+\n| ControlChannel | -> | ControlActionSet | -> | ControlPlaneService |\n ^ ^ ^\n | | |\n +---------------+----------+\n |\n v\n+--------------+\n| UvicornThreadRunner |\n+---------------------+\n```\n\n### 5. Поведение и примеры использования\n\nПредположим, что `RuntimeManager` используется следующим образом:\n\n```python\nfrom app_runtime.core.runtime import RuntimeManager\n\nruntime_manager = RuntimeManager()\n\n# Инициализация контроллеров и моделей\nruntime_manager.initialize_controllers_and_models()\n\n# Запуск основного потока управления\nruntime_manager.start()\n\n# Координация ролей и состояний\nruntime_manager.coordinate_roles_and_states()\n\n# Завершение работы системы\nruntime_manager.shutdown()\n```\n\n### Заключение\n\nКласс `RuntimeManager` является ключевым компонентом архитектуры, который управляет основными этапами жизненного цикла приложения, включая инициализацию компонентов, координацию вызовов ролей и контроль передачи данных между различными компонентами.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "RuntimeManager" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "passed": true, - "mismatches": [], - "details": { - "case_id": "plba-fullchain-explain-runtime-manager", - "text": "Объясни как работает класс RuntimeManager", - "mode": "full_chain", - "run_started_at": "2026-03-12T09:08:54", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Объясни как работает класс RuntimeManager", - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "RuntimeManager", - "alternatives": [ - "RuntimeManager" - ], - "confidence": 0.99 - }, - "rag_count": 19, - "rag_rows": [ - { - "path": "src/app_runtime/core/runtime.py", - "content": "class RuntimeManager\nRuntimeManager", - "layer": "C1_SYMBOL_CATALOG", - "title": "RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "7e4a9381328c5803bbc6179458612fc4e947d928aa7bf8b4b2bebb2c8592f758", - "qname": "RuntimeManager", - "kind": "class", - "signature": "RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.core.runtime", - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests manager\n- orchestrates role-like calls (4)\n- reads and writes state attributes\n- participates in dataflow slices (50)", - "layer": "C4_SEMANTIC_ROLES", - "title": "RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 43, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "7e4a9381328c5803bbc6179458612fc4e947d928aa7bf8b4b2bebb2c8592f758", - "symbol_name": "RuntimeManager", - "qname": "RuntimeManager", - "role": "pipeline_stage", - "confidence": 0.67, - "dataflow_participation": 50, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "ControlChannel\nrole: model\n\nResponsibilities:\n- default model role", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlChannel", - "span_start": 21, - "span_end": 28, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 40, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "cfcfe9a311d3a2dbdaf32ac4ccd73c0eb9a117f830591a1c0867ee97d46204ff", - "symbol_name": "ControlChannel", - "qname": "ControlChannel", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "ControlActionSet\nrole: model\n\nResponsibilities:\n- default model role", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlActionSet", - "span_start": 14, - "span_end": 18, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 40, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "46eb026cb3313415ec47b82dd22f84f4d112c9d987e8b1716dcb0baa1cce8988", - "symbol_name": "ControlActionSet", - "qname": "ControlActionSet", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests service\n- reads and writes state attributes\n- participates in dataflow slices (5)", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlPlaneService", - "span_start": 12, - "span_end": 52, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 68, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "b13471e5916986dccffb53fab613812842965705e6b3a89ae549d30c9e91e9aa", - "symbol_name": "ControlPlaneService", - "qname": "ControlPlaneService", - "role": "pipeline_stage", - "confidence": 0.57, - "dataflow_participation": 5, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_runner.py", - "content": "UvicornThreadRunner\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (24)", - "layer": "C4_SEMANTIC_ROLES", - "title": "UvicornThreadRunner", - "span_start": 10, - "span_end": 61, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 11, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "fd55630045a02100df8877ac27d951ee08617d4598764394d48cb51fe067476a", - "symbol_name": "UvicornThreadRunner", - "qname": "UvicornThreadRunner", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 24, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "3779fdd2878b770e789a35bb2a89c9d79f13b61c26d7db1b3b683f9bb9e1623f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (10)", - "layer": "C4_SEMANTIC_ROLES", - "title": "HttpControlChannel", - "span_start": 12, - "span_end": 57, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 21, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "1c9fbdc24819e5604c26ea55428a74310f03a03e1af197ed84846af61e42fdb0", - "symbol_name": "HttpControlChannel", - "qname": "HttpControlChannel", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 10, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "HttpControlAppFactory\nrole: factory\n\nResponsibilities:\n- name suffix suggests factory", - "layer": "C4_SEMANTIC_ROLES", - "title": "HttpControlAppFactory", - "span_start": 15, - "span_end": 53, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 39, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "9b3502a5fb408b273223db13264349cf500de24915b6c649d9ea8970d0dfd8e0", - "symbol_name": "HttpControlAppFactory", - "qname": "HttpControlAppFactory", - "role": "factory", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/persistence/workflow_persistence.py", - "content": "WorkflowPersistence\nrole: pipeline_stage\n\nResponsibilities:\n- orchestrates role-like calls (2)\n- reads and writes state attributes\n- participates in dataflow slices (16)", - "layer": "C4_SEMANTIC_ROLES", - "title": "WorkflowPersistence", - "span_start": 8, - "span_end": 54, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 15, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "7bd01ee45cf31f2d5c2e3e51656254860ac785d10cef9e0852cd4fba90857bae", - "symbol_name": "WorkflowPersistence", - "qname": "WorkflowPersistence", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 16, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "80e9410ddc639789b4353c2a1a757ba8d0d5b5bb6075b0b263b61551f04ae1f0", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.stop", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 25, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d", - "dst_ref": "ControlPlaneService.stop", - "resolution": "resolved", - "slice_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.stop" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._stop_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 51, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a", - "dst_ref": "ControlPlaneService._stop_async", - "resolution": "resolved", - "slice_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._stop_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.register_channel", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 17, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957", - "dst_ref": "ControlPlaneService.register_channel", - "resolution": "resolved", - "slice_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.register_channel" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.start", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 20, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154", - "dst_ref": "ControlPlaneService.start", - "resolution": "resolved", - "slice_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.start" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._start_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 47, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517", - "dst_ref": "ControlPlaneService._start_async", - "resolution": "resolved", - "slice_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._start_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager.add_config_file", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 32, - "span_end": 52, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "a23b8a11ebdb12708b60c96ea12a69f7f042082f1adfddd572444e246d81d167", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "57ffbd4f0d9fdf3507c2b8624312ce211f3d02fdf86a57a8ec90778d8a7b498d", - "dst_ref": "RuntimeManager.add_config_file", - "resolution": "resolved", - "slice_id": "a23b8a11ebdb12708b60c96ea12a69f7f042082f1adfddd572444e246d81d167", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager.add_config_file" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "57ffbd4f0d9fdf3507c2b8624312ce211f3d02fdf86a57a8ec90778d8a7b498d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "class RuntimeManager:\n ACTION_TIMEOUT_SECONDS = 10.0\n ACTION_POLL_INTERVAL_SECONDS = 0.05\n\n def __init__(\n self,\n configuration: ConfigurationManager | None = None,\n services: ServiceContainer | None = None,\n traces: TraceService | None = None,\n health: HealthRegistry | None = None,\n logs: LogManager | None = None,\n workers: WorkerSupervisor | None = None,\n control_plane: ControlPlaneService | None = None,\n ) -> None:\n self.configuration = configuration or ConfigurationManager()\n self.services = services or ServiceContainer()\n self.traces = traces or TraceService()\n self.health = health or HealthRegistry()\n self.logs = logs or LogManager()\n self.workers = workers or WorkerSupervisor()\n self.control_plane = control_plane or ControlPlaneService()\n self.registry = ModuleRegistry(self.services)\n self._started = False\n self._state = LifecycleState.IDLE\n self._core_registered = False\n self._workers_registered = False\n self._register_core_services()\n\n def register_module(self, module: ApplicationModule) -> None:\n self.registry.register_module(module.name)\n module.register(self.registry)\n\n def add_config_file(self, path: str) -> FileConfigProvider:\n provider = FileConfigProvider(path)\n self.configuration.add_provider(provider)\n return provider\n\n def start(self, *, start_control_plane: bool = True) -> None:\n if self._started:\n return\n self._state = LifecycleState.STARTING\n config = self.configuration.load()\n self.logs.apply_config(config)\n self._register_health_contributors()\n self._register_workers()\n self.workers.start()\n if start_control_plane:\n self.control_plane.start(self)\n self._started = True\n self._refresh_state()\n\n def stop(self, timeout: float = 30.0, force: bool = False, stop_control_plane: bool = True) -> None:\n if not self._started:\n return\n self._state = LifecycleState.STOPPING\n self.workers.stop(timeout=timeout, force=force)\n if stop_control_plane:\n self.control_plane.stop()\n self._started = False\n self._state = LifecycleState.STOPPED\n\n def status(self) -> dict[str, object]:\n self._refresh_state()\n return self.control_plane.snapshot(self)\n\n def current_health(self) -> HealthPayload:\n self._refresh_state()\n return self.health.payload(self._state, self.workers.healths())\n\n async def health_status(self) -> HealthPayload:\n return self.current_health()\n\n async def start_runtime(self) -> dict[str, object] | str:\n self._refresh_state()\n if self._started:\n return \"runtime already running\"\n if self._state == LifecycleState.STOPPING:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n\n self.start(start_control_plane=False)\n started = self._wait_for_state({LifecycleState.IDLE, LifecycleState.BUSY}, timeout=self.ACTION_TIMEOUT_SECONDS)\n if started:\n return self._action_detail(\"runtime started\", timed_out=False)\n return self._action_detail(\"runtime start is still in progress\", timed_out=True)\n\n async def stop_runtime(self) -> dict[str, object] | str:\n self._refresh_state()\n if not self._started:\n if self._state == LifecycleState.STOPPING:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n return \"runtime already stopped\"\n\n self._state = LifecycleState.STOPPING\n try:\n self.workers.stop(timeout=self.ACTION_TIMEOUT_SECONDS, force=False)\n except TimeoutError:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n\n self._started = False\n self._state = LifecycleState.STOPPED\n return self._action_detail(\"runtime stopped\", timed_out=False)\n\n async def runtime_status(self) -> str:\n self._refresh_state()\n return self._state.value\n\n def _register_core_services(self) -> None:\n if self._core_registered:\n return\n self.services.register(\"configuration\", self.configuration)\n self.services.register(\"traces\", self.traces)\n self.services.register(\"health\", self.health)\n self.services.register(\"logs\", self.logs)\n self.services.register(\"workers\", self.workers)\n self.services.register(\"control_plane\", self.control_plane)\n self._core_registered = True\n\n def _register_health_contributors(self) -> None:\n for contributor in self.registry.health_contributors:\n self.health.register(contributor)\n\n def _register_workers(self) -> None:\n if self._workers_registered:\n return\n for worker in self.registry.workers:\n self.workers.register(worker)\n self._workers_registered = True\n\n def _refresh_state(self) -> None:\n lifecycle = self.workers.lifecycle_state()\n\n if self._state == LifecycleState.STOPPING:\n if lifecycle == LifecycleState.STOPPED:\n self._started = False\n self._state = LifecycleState.STOPPED\n return\n\n if not self._started:\n if lifecycle == LifecycleState.STOPPED:\n self._state = LifecycleState.STOPPED\n return\n\n self._state = lifecycle\n\n def _wait_for_state(self, target_states: set[LifecycleState], *, timeout: float) -> bool:\n deadline = monotonic() + timeout\n while monotonic() < deadline:\n self._refresh_state()\n if self._state in target_states:\n return True\n sleep(self.ACTION_POLL_INTERVAL_SECONDS)\n self._refresh_state()\n return self._state in target_states\n\n def _action_detail(self, message: str, *, timed_out: bool) -> dict[str, object]:\n self._refresh_state()\n return {\n \"message\": message,\n \"state\": self._state.value,\n \"timed_out\": timed_out,\n \"workers\": self.workers.snapshot(),\n }", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/core/runtime.py:RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.core.runtime", - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "llm_answer": "## Анализ класса `RuntimeManager`\n\n### 1. Обзор файла и класса\n\nКласс `RuntimeManager` находится в файле `src/app_runtime/core/runtime.py`.\n\n```python\n# src/app_runtime/core/runtime.py\nclass RuntimeManager\n```\n\n### 2. Описание роли и обязанностей\n\nДокументация указывает следующие обязанности для данного класса:\n\n- **name suffix suggests manager**: Название класса предполагает управление другими сущностями или ресурсами.\n- **orchestrates role-like calls (4)**: Класс управляет вызовами ролей и выполняет координацию между ними.\n- **reads and writes state attributes**: Управление состоянием приложения и его атрибутов.\n- **participates in dataflow slices (50)**: Класс участвует в передаче данных через различные этапы обработки данных.\n\n### 3. Связанные классы и их роль\n\n- **ControlChannel** (`src/app_runtime/control/base.py`) — основной канал управления моделью.\n- **ControlActionSet** (`src/app_runtime/control/base.py`) — набор действий, связанных с управлением моделью.\n- **ControlPlaneService** (`src/app_runtime/control/service.py`) — сервис, связанный с управлением плоскостью контроля.\n- **UvicornThreadRunner** (`src/app_runtime/control/http_runner.py`) — запускает сервер на основе uvicorn и реализует многопоточную обработку запросов.\n\nЭти классы совместно участвуют в управлении жизненным циклом модели и потоков выполнения.\n\n### 4. Поток данных и архитектура\n\nАрхитектура включает следующее взаимодействие классов:\n\n- **RuntimeManager** координирует вызовы ролей и отвечает за состояние приложения.\n- **ControlChannel**, **ControlActionSet** обеспечивают логику управления моделями.\n- **ControlPlaneService** ответственен за хранение состояния приложения и передачу данных через различные потоки данных.\n- **UvicornThreadRunner** обеспечивает выполнение HTTP-запросов и синхронизацию потоков.\n\nТаким образом, общая схема выглядит следующим образом:\n\n```\n+----------+\n| RuntimeManager |\n+--+-----------+\n |\n v\n+----------+ +---------+ +---------+\n| ControlChannel | -> | ControlActionSet | -> | ControlPlaneService |\n ^ ^ ^\n | | |\n +---------------+----------+\n |\n v\n+--------------+\n| UvicornThreadRunner |\n+---------------------+\n```\n\n### 5. Поведение и примеры использования\n\nПредположим, что `RuntimeManager` используется следующим образом:\n\n```python\nfrom app_runtime.core.runtime import RuntimeManager\n\nruntime_manager = RuntimeManager()\n\n# Инициализация контроллеров и моделей\nruntime_manager.initialize_controllers_and_models()\n\n# Запуск основного потока управления\nruntime_manager.start()\n\n# Координация ролей и состояний\nruntime_manager.coordinate_roles_and_states()\n\n# Завершение работы системы\nruntime_manager.shutdown()\n```\n\n### Заключение\n\nКласс `RuntimeManager` является ключевым компонентом архитектуры, который управляет основными этапами жизненного цикла приложения, включая инициализацию компонентов, координацию вызовов ролей и контроль передачи данных между различными компонентами.", - "summary": { - "router": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "confidence": null - }, - "retrieval": { - "profile": "code", - "layers_hit": [ - "C0_SOURCE_CHUNKS", - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS", - "C4_SEMANTIC_ROLES" - ], - "evidence_sufficient": true - }, - "llm": { - "answer_status": "answered", - "groundedness": "grounded" - } - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "RuntimeManager" - ], - "keyword_hints": [ - "RuntimeManager" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C0_SOURCE_CHUNKS": "exact_path_fetch", - "C4_SEMANTIC_ROLES": "exact_path_fetch", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C3_ENTRYPOINTS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 8, - "C4_SEMANTIC_ROLES": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C3_ENTRYPOINTS": 6 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C4_SEMANTIC_ROLES": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Объясни как работает класс RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C4_SEMANTIC_ROLES", - "query": "Объясни как работает класс RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "Объясни как работает класс RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - }, - { - "layer": "C3_ENTRYPOINTS", - "query": "Объясни как работает класс RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 1, - "candidates_after_filter": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 6, - "candidates_after_filter": 6 - }, - { - "layer": "C3_ENTRYPOINTS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 3, - "candidates_after_filter": 3 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "RuntimeManager", - "alternatives": [ - "RuntimeManager" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C4_SEMANTIC_ROLES", - "status": "hit", - "hit_count": 8, - "fail_reason": null - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 6, - "fail_reason": null - }, - { - "layer": "C3_ENTRYPOINTS", - "status": "hit", - "hit_count": 3, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "router": 2, - "symbol_resolution": 0, - "retrieval_total": 406, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 51, - "C0_SOURCE_CHUNKS": 16, - "C4_SEMANTIC_ROLES": 15, - "C2_DEPENDENCY_GRAPH": 73, - "C3_ENTRYPOINTS": 9 - }, - "merge_rank": 24, - "prompt_build": 0, - "llm_call": 6691 - }, - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 335, - "evidence_rows": 19, - "evidence_chars": 7949 - }, - "evidence_summary": [ - { - "layer": "C1_SYMBOL_CATALOG", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "count": 8, - "unique_paths": 7 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "count": 6, - "unique_paths": 2 - }, - { - "layer": "C3_ENTRYPOINTS", - "count": 3, - "unique_paths": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 1, - "unique_paths": 1 - } - ], - "prompt_template_id": "intent_code_qa_v1", - "system_prompt_version": "v1" - }, - "router": { - "conversation_mode": "START", - "keyword_hints": [ - "RuntimeManager" - ], - "path_scope": [] - }, - "llm": { - "used_evidence_count": 19, - "missing_evidence_reason": null - } - }, - "run_info": { - "case_id": "plba-fullchain-explain-runtime-manager", - "mode": "full_chain", - "run_started_at": "2026-03-12T09:08:54", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - }, - "input_request": { - "text": "Объясни как работает класс RuntimeManager", - "normalized_query": "Объясни как работает класс RuntimeManager" - }, - "steps": [ - { - "step": "intent_router", - "input": { - "query": "Объясни как работает класс RuntimeManager" - }, - "output": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Объясни как работает класс RuntimeManager" - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "RuntimeManager" - ], - "keyword_hints": [ - "RuntimeManager" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "timings_ms": { - "router": 2 - } - } - }, - { - "step": "retrieval", - "input": { - "query": "Объясни как работает класс RuntimeManager" - }, - "output": { - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "RuntimeManager", - "alternatives": [ - "RuntimeManager" - ], - "confidence": 0.99 - }, - "rag_count": 19, - "rag_rows": [ - { - "path": "src/app_runtime/core/runtime.py", - "content": "class RuntimeManager\nRuntimeManager", - "layer": "C1_SYMBOL_CATALOG", - "title": "RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "7e4a9381328c5803bbc6179458612fc4e947d928aa7bf8b4b2bebb2c8592f758", - "qname": "RuntimeManager", - "kind": "class", - "signature": "RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.core.runtime", - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests manager\n- orchestrates role-like calls (4)\n- reads and writes state attributes\n- participates in dataflow slices (50)", - "layer": "C4_SEMANTIC_ROLES", - "title": "RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 43, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "7e4a9381328c5803bbc6179458612fc4e947d928aa7bf8b4b2bebb2c8592f758", - "symbol_name": "RuntimeManager", - "qname": "RuntimeManager", - "role": "pipeline_stage", - "confidence": 0.67, - "dataflow_participation": 50, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "ControlChannel\nrole: model\n\nResponsibilities:\n- default model role", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlChannel", - "span_start": 21, - "span_end": 28, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 40, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "cfcfe9a311d3a2dbdaf32ac4ccd73c0eb9a117f830591a1c0867ee97d46204ff", - "symbol_name": "ControlChannel", - "qname": "ControlChannel", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "ControlActionSet\nrole: model\n\nResponsibilities:\n- default model role", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlActionSet", - "span_start": 14, - "span_end": 18, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 40, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "46eb026cb3313415ec47b82dd22f84f4d112c9d987e8b1716dcb0baa1cce8988", - "symbol_name": "ControlActionSet", - "qname": "ControlActionSet", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests service\n- reads and writes state attributes\n- participates in dataflow slices (5)", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlPlaneService", - "span_start": 12, - "span_end": 52, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 68, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "b13471e5916986dccffb53fab613812842965705e6b3a89ae549d30c9e91e9aa", - "symbol_name": "ControlPlaneService", - "qname": "ControlPlaneService", - "role": "pipeline_stage", - "confidence": 0.57, - "dataflow_participation": 5, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_runner.py", - "content": "UvicornThreadRunner\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (24)", - "layer": "C4_SEMANTIC_ROLES", - "title": "UvicornThreadRunner", - "span_start": 10, - "span_end": 61, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 11, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "fd55630045a02100df8877ac27d951ee08617d4598764394d48cb51fe067476a", - "symbol_name": "UvicornThreadRunner", - "qname": "UvicornThreadRunner", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 24, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "3779fdd2878b770e789a35bb2a89c9d79f13b61c26d7db1b3b683f9bb9e1623f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (10)", - "layer": "C4_SEMANTIC_ROLES", - "title": "HttpControlChannel", - "span_start": 12, - "span_end": 57, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 21, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "1c9fbdc24819e5604c26ea55428a74310f03a03e1af197ed84846af61e42fdb0", - "symbol_name": "HttpControlChannel", - "qname": "HttpControlChannel", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 10, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "HttpControlAppFactory\nrole: factory\n\nResponsibilities:\n- name suffix suggests factory", - "layer": "C4_SEMANTIC_ROLES", - "title": "HttpControlAppFactory", - "span_start": 15, - "span_end": 53, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 39, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "9b3502a5fb408b273223db13264349cf500de24915b6c649d9ea8970d0dfd8e0", - "symbol_name": "HttpControlAppFactory", - "qname": "HttpControlAppFactory", - "role": "factory", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/persistence/workflow_persistence.py", - "content": "WorkflowPersistence\nrole: pipeline_stage\n\nResponsibilities:\n- orchestrates role-like calls (2)\n- reads and writes state attributes\n- participates in dataflow slices (16)", - "layer": "C4_SEMANTIC_ROLES", - "title": "WorkflowPersistence", - "span_start": 8, - "span_end": 54, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 15, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "7bd01ee45cf31f2d5c2e3e51656254860ac785d10cef9e0852cd4fba90857bae", - "symbol_name": "WorkflowPersistence", - "qname": "WorkflowPersistence", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 16, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "80e9410ddc639789b4353c2a1a757ba8d0d5b5bb6075b0b263b61551f04ae1f0", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.stop", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 25, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d", - "dst_ref": "ControlPlaneService.stop", - "resolution": "resolved", - "slice_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.stop" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._stop_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 51, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a", - "dst_ref": "ControlPlaneService._stop_async", - "resolution": "resolved", - "slice_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._stop_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.register_channel", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 17, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957", - "dst_ref": "ControlPlaneService.register_channel", - "resolution": "resolved", - "slice_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.register_channel" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.start", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 20, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154", - "dst_ref": "ControlPlaneService.start", - "resolution": "resolved", - "slice_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.start" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._start_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 47, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517", - "dst_ref": "ControlPlaneService._start_async", - "resolution": "resolved", - "slice_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._start_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager.add_config_file", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 32, - "span_end": 52, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "a23b8a11ebdb12708b60c96ea12a69f7f042082f1adfddd572444e246d81d167", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "57ffbd4f0d9fdf3507c2b8624312ce211f3d02fdf86a57a8ec90778d8a7b498d", - "dst_ref": "RuntimeManager.add_config_file", - "resolution": "resolved", - "slice_id": "a23b8a11ebdb12708b60c96ea12a69f7f042082f1adfddd572444e246d81d167", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager.add_config_file" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "57ffbd4f0d9fdf3507c2b8624312ce211f3d02fdf86a57a8ec90778d8a7b498d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "class RuntimeManager:\n ACTION_TIMEOUT_SECONDS = 10.0\n ACTION_POLL_INTERVAL_SECONDS = 0.05\n\n def __init__(\n self,\n configuration: ConfigurationManager | None = None,\n services: ServiceContainer | None = None,\n traces: TraceService | None = None,\n health: HealthRegistry | None = None,\n logs: LogManager | None = None,\n workers: WorkerSupervisor | None = None,\n control_plane: ControlPlaneService | None = None,\n ) -> None:\n self.configuration = configuration or ConfigurationManager()\n self.services = services or ServiceContainer()\n self.traces = traces or TraceService()\n self.health = health or HealthRegistry()\n self.logs = logs or LogManager()\n self.workers = workers or WorkerSupervisor()\n self.control_plane = control_plane or ControlPlaneService()\n self.registry = ModuleRegistry(self.services)\n self._started = False\n self._state = LifecycleState.IDLE\n self._core_registered = False\n self._workers_registered = False\n self._register_core_services()\n\n def register_module(self, module: ApplicationModule) -> None:\n self.registry.register_module(module.name)\n module.register(self.registry)\n\n def add_config_file(self, path: str) -> FileConfigProvider:\n provider = FileConfigProvider(path)\n self.configuration.add_provider(provider)\n return provider\n\n def start(self, *, start_control_plane: bool = True) -> None:\n if self._started:\n return\n self._state = LifecycleState.STARTING\n config = self.configuration.load()\n self.logs.apply_config(config)\n self._register_health_contributors()\n self._register_workers()\n self.workers.start()\n if start_control_plane:\n self.control_plane.start(self)\n self._started = True\n self._refresh_state()\n\n def stop(self, timeout: float = 30.0, force: bool = False, stop_control_plane: bool = True) -> None:\n if not self._started:\n return\n self._state = LifecycleState.STOPPING\n self.workers.stop(timeout=timeout, force=force)\n if stop_control_plane:\n self.control_plane.stop()\n self._started = False\n self._state = LifecycleState.STOPPED\n\n def status(self) -> dict[str, object]:\n self._refresh_state()\n return self.control_plane.snapshot(self)\n\n def current_health(self) -> HealthPayload:\n self._refresh_state()\n return self.health.payload(self._state, self.workers.healths())\n\n async def health_status(self) -> HealthPayload:\n return self.current_health()\n\n async def start_runtime(self) -> dict[str, object] | str:\n self._refresh_state()\n if self._started:\n return \"runtime already running\"\n if self._state == LifecycleState.STOPPING:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n\n self.start(start_control_plane=False)\n started = self._wait_for_state({LifecycleState.IDLE, LifecycleState.BUSY}, timeout=self.ACTION_TIMEOUT_SECONDS)\n if started:\n return self._action_detail(\"runtime started\", timed_out=False)\n return self._action_detail(\"runtime start is still in progress\", timed_out=True)\n\n async def stop_runtime(self) -> dict[str, object] | str:\n self._refresh_state()\n if not self._started:\n if self._state == LifecycleState.STOPPING:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n return \"runtime already stopped\"\n\n self._state = LifecycleState.STOPPING\n try:\n self.workers.stop(timeout=self.ACTION_TIMEOUT_SECONDS, force=False)\n except TimeoutError:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n\n self._started = False\n self._state = LifecycleState.STOPPED\n return self._action_detail(\"runtime stopped\", timed_out=False)\n\n async def runtime_status(self) -> str:\n self._refresh_state()\n return self._state.value\n\n def _register_core_services(self) -> None:\n if self._core_registered:\n return\n self.services.register(\"configuration\", self.configuration)\n self.services.register(\"traces\", self.traces)\n self.services.register(\"health\", self.health)\n self.services.register(\"logs\", self.logs)\n self.services.register(\"workers\", self.workers)\n self.services.register(\"control_plane\", self.control_plane)\n self._core_registered = True\n\n def _register_health_contributors(self) -> None:\n for contributor in self.registry.health_contributors:\n self.health.register(contributor)\n\n def _register_workers(self) -> None:\n if self._workers_registered:\n return\n for worker in self.registry.workers:\n self.workers.register(worker)\n self._workers_registered = True\n\n def _refresh_state(self) -> None:\n lifecycle = self.workers.lifecycle_state()\n\n if self._state == LifecycleState.STOPPING:\n if lifecycle == LifecycleState.STOPPED:\n self._started = False\n self._state = LifecycleState.STOPPED\n return\n\n if not self._started:\n if lifecycle == LifecycleState.STOPPED:\n self._state = LifecycleState.STOPPED\n return\n\n self._state = lifecycle\n\n def _wait_for_state(self, target_states: set[LifecycleState], *, timeout: float) -> bool:\n deadline = monotonic() + timeout\n while monotonic() < deadline:\n self._refresh_state()\n if self._state in target_states:\n return True\n sleep(self.ACTION_POLL_INTERVAL_SECONDS)\n self._refresh_state()\n return self._state in target_states\n\n def _action_detail(self, message: str, *, timed_out: bool) -> dict[str, object]:\n self._refresh_state()\n return {\n \"message\": message,\n \"state\": self._state.value,\n \"timed_out\": timed_out,\n \"workers\": self.workers.snapshot(),\n }", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/core/runtime.py:RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.core.runtime", - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ] - }, - "diagnostics": { - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C0_SOURCE_CHUNKS": "exact_path_fetch", - "C4_SEMANTIC_ROLES": "exact_path_fetch", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C3_ENTRYPOINTS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 8, - "C4_SEMANTIC_ROLES": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C3_ENTRYPOINTS": 6 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C4_SEMANTIC_ROLES": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Объясни как работает класс RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C4_SEMANTIC_ROLES", - "query": "Объясни как работает класс RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "Объясни как работает класс RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - }, - { - "layer": "C3_ENTRYPOINTS", - "query": "Объясни как работает класс RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 1, - "candidates_after_filter": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 6, - "candidates_after_filter": 6 - }, - { - "layer": "C3_ENTRYPOINTS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 3, - "candidates_after_filter": 3 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "RuntimeManager", - "alternatives": [ - "RuntimeManager" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C4_SEMANTIC_ROLES", - "status": "hit", - "hit_count": 8, - "fail_reason": null - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 6, - "fail_reason": null - }, - { - "layer": "C3_ENTRYPOINTS", - "status": "hit", - "hit_count": 3, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "symbol_resolution": 0, - "retrieval_total": 406, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 51, - "C0_SOURCE_CHUNKS": 16, - "C4_SEMANTIC_ROLES": 15, - "C2_DEPENDENCY_GRAPH": 73, - "C3_ENTRYPOINTS": 9 - }, - "merge_rank": 24 - } - } - }, - { - "step": "llm_answer", - "input": { - "query": "Объясни как работает класс RuntimeManager", - "rag_count": 19 - }, - "output": { - "llm_answer": "## Анализ класса `RuntimeManager`\n\n### 1. Обзор файла и класса\n\nКласс `RuntimeManager` находится в файле `src/app_runtime/core/runtime.py`.\n\n```python\n# src/app_runtime/core/runtime.py\nclass RuntimeManager\n```\n\n### 2. Описание роли и обязанностей\n\nДокументация указывает следующие обязанности для данного класса:\n\n- **name suffix suggests manager**: Название класса предполагает управление другими сущностями или ресурсами.\n- **orchestrates role-like calls (4)**: Класс управляет вызовами ролей и выполняет координацию между ними.\n- **reads and writes state attributes**: Управление состоянием приложения и его атрибутов.\n- **participates in dataflow slices (50)**: Класс участвует в передаче данных через различные этапы обработки данных.\n\n### 3. Связанные классы и их роль\n\n- **ControlChannel** (`src/app_runtime/control/base.py`) — основной канал управления моделью.\n- **ControlActionSet** (`src/app_runtime/control/base.py`) — набор действий, связанных с управлением моделью.\n- **ControlPlaneService** (`src/app_runtime/control/service.py`) — сервис, связанный с управлением плоскостью контроля.\n- **UvicornThreadRunner** (`src/app_runtime/control/http_runner.py`) — запускает сервер на основе uvicorn и реализует многопоточную обработку запросов.\n\nЭти классы совместно участвуют в управлении жизненным циклом модели и потоков выполнения.\n\n### 4. Поток данных и архитектура\n\nАрхитектура включает следующее взаимодействие классов:\n\n- **RuntimeManager** координирует вызовы ролей и отвечает за состояние приложения.\n- **ControlChannel**, **ControlActionSet** обеспечивают логику управления моделями.\n- **ControlPlaneService** ответственен за хранение состояния приложения и передачу данных через различные потоки данных.\n- **UvicornThreadRunner** обеспечивает выполнение HTTP-запросов и синхронизацию потоков.\n\nТаким образом, общая схема выглядит следующим образом:\n\n```\n+----------+\n| RuntimeManager |\n+--+-----------+\n |\n v\n+----------+ +---------+ +---------+\n| ControlChannel | -> | ControlActionSet | -> | ControlPlaneService |\n ^ ^ ^\n | | |\n +---------------+----------+\n |\n v\n+--------------+\n| UvicornThreadRunner |\n+---------------------+\n```\n\n### 5. Поведение и примеры использования\n\nПредположим, что `RuntimeManager` используется следующим образом:\n\n```python\nfrom app_runtime.core.runtime import RuntimeManager\n\nruntime_manager = RuntimeManager()\n\n# Инициализация контроллеров и моделей\nruntime_manager.initialize_controllers_and_models()\n\n# Запуск основного потока управления\nruntime_manager.start()\n\n# Координация ролей и состояний\nruntime_manager.coordinate_roles_and_states()\n\n# Завершение работы системы\nruntime_manager.shutdown()\n```\n\n### Заключение\n\nКласс `RuntimeManager` является ключевым компонентом архитектуры, который управляет основными этапами жизненного цикла приложения, включая инициализацию компонентов, координацию вызовов ролей и контроль передачи данных между различными компонентами." - }, - "diagnostics": { - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 335, - "evidence_rows": 19, - "evidence_chars": 7949 - }, - "evidence_summary": [ - { - "layer": "C1_SYMBOL_CATALOG", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "count": 8, - "unique_paths": 7 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "count": 6, - "unique_paths": 2 - }, - { - "layer": "C3_ENTRYPOINTS", - "count": 3, - "unique_paths": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 1, - "unique_paths": 1 - } - ], - "prompt_template_id": "intent_code_qa_v1", - "system_prompt_version": "v1" - }, - "timings_ms": { - "prompt_build": 0, - "llm_call": 6691 - } - } - } - ] - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_090854/full_chain_plba_code_retrieval_plba-fullchain-explain-runtime-manager.md b/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_090854/full_chain_plba_code_retrieval_plba-fullchain-explain-runtime-manager.md deleted file mode 100644 index 2656989..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_090854/full_chain_plba_code_retrieval_plba-fullchain-explain-runtime-manager.md +++ /dev/null @@ -1,34 +0,0 @@ -# plba-fullchain-explain-runtime-manager - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_retrieval.yaml -- runner: runtime -- mode: full_chain -- passed: True - -## Query -Объясни как работает класс RuntimeManager - -## Actual -{ - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 19, - "llm_answer": "## Анализ класса `RuntimeManager`\n\n### 1. Обзор файла и класса\n\nКласс `RuntimeManager` находится в файле `src/app_runtime/core/runtime.py`.\n\n```python\n# src/app_runtime/core/runtime.py\nclass RuntimeManager\n```\n\n### 2. Описание роли и обязанностей\n\nДокументация указывает следующие обязанности для данного класса:\n\n- **name suffix suggests manager**: Название класса предполагает управление другими сущностями или ресурсами.\n- **orchestrates role-like calls (4)**: Класс управляет вызовами ролей и выполняет координацию между ними.\n- **reads and writes state attributes**: Управление состоянием приложения и его атрибутов.\n- **participates in dataflow slices (50)**: Класс участвует в передаче данных через различные этапы обработки данных.\n\n### 3. Связанные классы и их роль\n\n- **ControlChannel** (`src/app_runtime/control/base.py`) — основной канал управления моделью.\n- **ControlActionSet** (`src/app_runtime/control/base.py`) — набор действий, связанных с управлением моделью.\n- **ControlPlaneService** (`src/app_runtime/control/service.py`) — сервис, связанный с управлением плоскостью контроля.\n- **UvicornThreadRunner** (`src/app_runtime/control/http_runner.py`) — запускает сервер на основе uvicorn и реализует многопоточную обработку запросов.\n\nЭти классы совместно участвуют в управлении жизненным циклом модели и потоков выполнения.\n\n### 4. Поток данных и архитектура\n\nАрхитектура включает следующее взаимодействие классов:\n\n- **RuntimeManager** координирует вызовы ролей и отвечает за состояние приложения.\n- **ControlChannel**, **ControlActionSet** обеспечивают логику управления моделями.\n- **ControlPlaneService** ответственен за хранение состояния приложения и передачу данных через различные потоки данных.\n- **UvicornThreadRunner** обеспечивает выполнение HTTP-запросов и синхронизацию потоков.\n\nТаким образом, общая схема выглядит следующим образом:\n\n```\n+----------+\n| RuntimeManager |\n+--+-----------+\n |\n v\n+----------+ +---------+ +---------+\n| ControlChannel | -> | ControlActionSet | -> | ControlPlaneService |\n ^ ^ ^\n | | |\n +---------------+----------+\n |\n v\n+--------------+\n| UvicornThreadRunner |\n+---------------------+\n```\n\n### 5. Поведение и примеры использования\n\nПредположим, что `RuntimeManager` используется следующим образом:\n\n```python\nfrom app_runtime.core.runtime import RuntimeManager\n\nruntime_manager = RuntimeManager()\n\n# Инициализация контроллеров и моделей\nruntime_manager.initialize_controllers_and_models()\n\n# Запуск основного потока управления\nruntime_manager.start()\n\n# Координация ролей и состояний\nruntime_manager.coordinate_roles_and_states()\n\n# Завершение работы системы\nruntime_manager.shutdown()\n```\n\n### Заключение\n\nКласс `RuntimeManager` является ключевым компонентом архитектуры, который управляет основными этапами жизненного цикла приложения, включая инициализацию компонентов, координацию вызовов ролей и контроль передачи данных между различными компонентами.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "RuntimeManager" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] -} - -## Mismatches -- none \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_090854/summary.md b/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_090854/summary.md deleted file mode 100644 index 9888b16..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_090854/summary.md +++ /dev/null @@ -1,9 +0,0 @@ -# pipeline_setup_v2 summary - -Passed: 3/3 - -| File | Case | Runner | Mode | Intent | Sub-intent | Pass | -|------|------|--------|------|--------|------------|------| -| full_chain_plba_code_retrieval.yaml | plba-fullchain-explain-runtime-manager | runtime | full_chain | CODE_QA | EXPLAIN | ✓ | -| full_chain_plba_code_retrieval.yaml | plba-fullchain-explain-http-control-channel | runtime | full_chain | CODE_QA | EXPLAIN | ✓ | -| full_chain_plba_code_retrieval.yaml | plba-fullchain-explain-control-plane-service | runtime | full_chain | CODE_QA | EXPLAIN | ✓ | \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_091150/full_chain_plba_code_retrieval_plba-fullchain-explain-control-plane-service.json b/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_091150/full_chain_plba_code_retrieval_plba-fullchain-explain-control-plane-service.json deleted file mode 100644 index 476b46c..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_091150/full_chain_plba_code_retrieval_plba-fullchain-explain-control-plane-service.json +++ /dev/null @@ -1,2532 +0,0 @@ -{ - "case_id": "plba-fullchain-explain-control-plane-service", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_retrieval.yaml", - "runner": "runtime", - "mode": "full_chain", - "actual": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 19, - "llm_answer": "## Анализ класса `ControlPlaneService`\n\n### Описание файла и роли сущностей\n\nИсходный код находится в файле `src/app_runtime/control/service.py`, где определен класс `ControlPlaneService`.\nЭтот файл является частью модуля `app_runtime.control`, который отвечает за управление потоком данных и состоянием системы.\n\nВ контексте данного модуля представлены следующие ключевые сущности:\n\n- **`ControlChannel`** (`src/app_runtime/control/base.py`) – базовый интерфейс для взаимодействия с каналами управления.\n- **`ControlActionSet`** (`src/app_runtime/control/base.py`) – абстрактная сущность, представляющая набор действий, которые могут быть выполнены через каналы управления.\n- **`UvicornThreadRunner`** (`src/app_runtime/control/http_runner.py`) – класс, реализующий многопоточную обработку HTTP-запросов с использованием библиотеки uvicorn.\n- **`HttpControlChannel`** (`src/app_runtime/control/http_channel.py`) – канал управления, предназначенный для обработки HTTP запросов.\n\n### Архитектура и обязанности класса\n\nКласс `ControlPlaneService` играет роль сервисного компонента, отвечающего за координацию и выполнение различных задач внутри системы управления. Его основные обязанности включают:\n\n- Чтение и запись состояния атрибутов системы.\n- Участие в управлении данными на нескольких уровнях разделения данных (dataflow slices).\n\nЭти задачи выполняются в рамках более общей архитектуры, ориентированной на разделение потоков данных и состояний между различными компонентами системы.\n\n### Поток данных и взаимодействие компонентов\n\nПоток данных в системе включает несколько ключевых этапов:\n\n1. Пользователь отправляет запрос через HTTP API.\n2. Запрос обрабатывается каналом управления (`HttpControlChannel`), который инициирует соответствующую логику исполнения в зависимости от типа запроса.\n3. Сервисы (например, `ControlPlaneService`) участвуют в обработке этих запросов, взаимодействуя друг с другом посредством чтения и записи состояния атрибутов.\n4. Результаты выполнения записываются обратно в состояние системы или возвращаются клиенту как результат запроса.\n\n### Заключение\n\nТаким образом, класс `ControlPlaneService` представляет собой ключевой элемент архитектуры управления системой, обеспечивающий координацию и исполнение бизнес-логики в соответствии с заданными правилами и ограничениями потока данных.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "ControlPlaneService" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "passed": true, - "mismatches": [], - "details": { - "case_id": "plba-fullchain-explain-control-plane-service", - "text": "Объясни класс ControlPlaneService", - "mode": "full_chain", - "run_started_at": "2026-03-12T09:11:50", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Объясни класс ControlPlaneService", - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "ControlPlaneService", - "alternatives": [ - "ControlPlaneService" - ], - "confidence": 0.99 - }, - "rag_count": 19, - "rag_rows": [ - { - "path": "src/app_runtime/control/service.py", - "content": "class ControlPlaneService\nControlPlaneService", - "layer": "C1_SYMBOL_CATALOG", - "title": "ControlPlaneService", - "span_start": 12, - "span_end": 52, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "b13471e5916986dccffb53fab613812842965705e6b3a89ae549d30c9e91e9aa", - "qname": "ControlPlaneService", - "kind": "class", - "signature": "ControlPlaneService", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.control.service", - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests service\n- reads and writes state attributes\n- participates in dataflow slices (5)", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlPlaneService", - "span_start": 12, - "span_end": 52, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 68, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "b13471e5916986dccffb53fab613812842965705e6b3a89ae549d30c9e91e9aa", - "symbol_name": "ControlPlaneService", - "qname": "ControlPlaneService", - "role": "pipeline_stage", - "confidence": 0.57, - "dataflow_participation": 5, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "ControlChannel\nrole: model\n\nResponsibilities:\n- default model role", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlChannel", - "span_start": 21, - "span_end": 28, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 40, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "cfcfe9a311d3a2dbdaf32ac4ccd73c0eb9a117f830591a1c0867ee97d46204ff", - "symbol_name": "ControlChannel", - "qname": "ControlChannel", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "ControlActionSet\nrole: model\n\nResponsibilities:\n- default model role", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlActionSet", - "span_start": 14, - "span_end": 18, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 40, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "46eb026cb3313415ec47b82dd22f84f4d112c9d987e8b1716dcb0baa1cce8988", - "symbol_name": "ControlActionSet", - "qname": "ControlActionSet", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_runner.py", - "content": "UvicornThreadRunner\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (24)", - "layer": "C4_SEMANTIC_ROLES", - "title": "UvicornThreadRunner", - "span_start": 10, - "span_end": 61, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 11, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "fd55630045a02100df8877ac27d951ee08617d4598764394d48cb51fe067476a", - "symbol_name": "UvicornThreadRunner", - "qname": "UvicornThreadRunner", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 24, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "3779fdd2878b770e789a35bb2a89c9d79f13b61c26d7db1b3b683f9bb9e1623f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (10)", - "layer": "C4_SEMANTIC_ROLES", - "title": "HttpControlChannel", - "span_start": 12, - "span_end": 57, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 21, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "1c9fbdc24819e5604c26ea55428a74310f03a03e1af197ed84846af61e42fdb0", - "symbol_name": "HttpControlChannel", - "qname": "HttpControlChannel", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 10, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "HttpControlAppFactory\nrole: factory\n\nResponsibilities:\n- name suffix suggests factory", - "layer": "C4_SEMANTIC_ROLES", - "title": "HttpControlAppFactory", - "span_start": 15, - "span_end": 53, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 39, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "9b3502a5fb408b273223db13264349cf500de24915b6c649d9ea8970d0dfd8e0", - "symbol_name": "HttpControlAppFactory", - "qname": "HttpControlAppFactory", - "role": "factory", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/persistence/workflow_persistence.py", - "content": "WorkflowPersistence\nrole: pipeline_stage\n\nResponsibilities:\n- orchestrates role-like calls (2)\n- reads and writes state attributes\n- participates in dataflow slices (16)", - "layer": "C4_SEMANTIC_ROLES", - "title": "WorkflowPersistence", - "span_start": 8, - "span_end": 54, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 15, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "7bd01ee45cf31f2d5c2e3e51656254860ac785d10cef9e0852cd4fba90857bae", - "symbol_name": "WorkflowPersistence", - "qname": "WorkflowPersistence", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 16, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "80e9410ddc639789b4353c2a1a757ba8d0d5b5bb6075b0b263b61551f04ae1f0", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/queue/in_memory.py", - "content": "InMemoryTaskQueue\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (9)", - "layer": "C4_SEMANTIC_ROLES", - "title": "InMemoryTaskQueue", - "span_start": 9, - "span_end": 38, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 22, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "2da04cb94544a3bcbf0943a95ad4bdd8710bcafaa32a02fd0e4de2178dcf3533", - "symbol_name": "InMemoryTaskQueue", - "qname": "InMemoryTaskQueue", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 9, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "58f0cc001ccda0eee4c6bc32ed83bd05eafd6b6644f1e8b4aa9eed3103db73dc", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.stop", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 25, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d", - "dst_ref": "ControlPlaneService.stop", - "resolution": "resolved", - "slice_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.stop" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._stop_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 51, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a", - "dst_ref": "ControlPlaneService._stop_async", - "resolution": "resolved", - "slice_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._stop_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.register_channel", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 17, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957", - "dst_ref": "ControlPlaneService.register_channel", - "resolution": "resolved", - "slice_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.register_channel" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.start", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 20, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154", - "dst_ref": "ControlPlaneService.start", - "resolution": "resolved", - "slice_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.start" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._start_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 47, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517", - "dst_ref": "ControlPlaneService._start_async", - "resolution": "resolved", - "slice_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._start_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.register_channel reads_attr self._channels.append", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.register_channel:reads_attr", - "span_start": 17, - "span_end": 17, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "1ee5925deffdc38ba15b88bf7c89e5fcd1a78f493fe30f2deb827d714a1b18e8", - "edge_type": "reads_attr", - "src_symbol_id": "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957", - "src_qname": "ControlPlaneService.register_channel", - "dst_symbol_id": null, - "dst_ref": "self._channels.append", - "resolution": "partial", - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "class ControlPlaneService:\n def __init__(self) -> None:\n self._channels: list[ControlChannel] = []\n\n def register_channel(self, channel: ControlChannel) -> None:\n self._channels.append(channel)\n\n def start(self, runtime: RuntimeManager) -> None:\n if not self._channels:\n return\n asyncio.run(self._start_async(runtime))\n\n def stop(self) -> None:\n if not self._channels:\n return\n asyncio.run(self._stop_async())\n\n def snapshot(self, runtime: RuntimeManager) -> dict[str, object]:\n health = runtime.current_health()\n return {\n \"runtime\": {\"state\": runtime._state.value},\n \"modules\": list(runtime.registry.modules),\n \"services\": runtime.services.snapshot(),\n \"workers\": runtime.workers.snapshot(),\n \"health\": runtime.health.snapshot(runtime.workers.healths()) | {\"status\": health[\"status\"]},\n \"config\": runtime.configuration.get(),\n }\n\n async def _start_async(self, runtime: RuntimeManager) -> None:\n actions = ControlActionSet(\n health=runtime.health_status,\n start=runtime.start_runtime,\n stop=runtime.stop_runtime,\n status=runtime.runtime_status,\n )\n for channel in self._channels:\n await channel.start(actions)\n\n async def _stop_async(self) -> None:\n for channel in reversed(self._channels):\n await channel.stop()", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/service.py:ControlPlaneService", - "span_start": 12, - "span_end": 52, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.service", - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "llm_answer": "## Анализ класса `ControlPlaneService`\n\n### Описание файла и роли сущностей\n\nИсходный код находится в файле `src/app_runtime/control/service.py`, где определен класс `ControlPlaneService`.\nЭтот файл является частью модуля `app_runtime.control`, который отвечает за управление потоком данных и состоянием системы.\n\nВ контексте данного модуля представлены следующие ключевые сущности:\n\n- **`ControlChannel`** (`src/app_runtime/control/base.py`) – базовый интерфейс для взаимодействия с каналами управления.\n- **`ControlActionSet`** (`src/app_runtime/control/base.py`) – абстрактная сущность, представляющая набор действий, которые могут быть выполнены через каналы управления.\n- **`UvicornThreadRunner`** (`src/app_runtime/control/http_runner.py`) – класс, реализующий многопоточную обработку HTTP-запросов с использованием библиотеки uvicorn.\n- **`HttpControlChannel`** (`src/app_runtime/control/http_channel.py`) – канал управления, предназначенный для обработки HTTP запросов.\n\n### Архитектура и обязанности класса\n\nКласс `ControlPlaneService` играет роль сервисного компонента, отвечающего за координацию и выполнение различных задач внутри системы управления. Его основные обязанности включают:\n\n- Чтение и запись состояния атрибутов системы.\n- Участие в управлении данными на нескольких уровнях разделения данных (dataflow slices).\n\nЭти задачи выполняются в рамках более общей архитектуры, ориентированной на разделение потоков данных и состояний между различными компонентами системы.\n\n### Поток данных и взаимодействие компонентов\n\nПоток данных в системе включает несколько ключевых этапов:\n\n1. Пользователь отправляет запрос через HTTP API.\n2. Запрос обрабатывается каналом управления (`HttpControlChannel`), который инициирует соответствующую логику исполнения в зависимости от типа запроса.\n3. Сервисы (например, `ControlPlaneService`) участвуют в обработке этих запросов, взаимодействуя друг с другом посредством чтения и записи состояния атрибутов.\n4. Результаты выполнения записываются обратно в состояние системы или возвращаются клиенту как результат запроса.\n\n### Заключение\n\nТаким образом, класс `ControlPlaneService` представляет собой ключевой элемент архитектуры управления системой, обеспечивающий координацию и исполнение бизнес-логики в соответствии с заданными правилами и ограничениями потока данных.", - "summary": { - "router": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "confidence": null - }, - "retrieval": { - "profile": "code", - "layers_hit": [ - "C0_SOURCE_CHUNKS", - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS", - "C4_SEMANTIC_ROLES" - ], - "evidence_sufficient": true - }, - "llm": { - "answer_status": "answered", - "groundedness": "grounded" - } - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "ControlPlaneService" - ], - "keyword_hints": [ - "ControlPlaneService" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C0_SOURCE_CHUNKS": "exact_path_fetch", - "C4_SEMANTIC_ROLES": "exact_path_fetch", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C3_ENTRYPOINTS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 8, - "C4_SEMANTIC_ROLES": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C3_ENTRYPOINTS": 6 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C4_SEMANTIC_ROLES": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "ControlPlaneService", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Объясни класс ControlPlaneService", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C4_SEMANTIC_ROLES", - "query": "Объясни класс ControlPlaneService", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "Объясни класс ControlPlaneService", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - }, - { - "layer": "C3_ENTRYPOINTS", - "query": "Объясни класс ControlPlaneService", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 1, - "candidates_after_filter": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 6, - "candidates_after_filter": 6 - }, - { - "layer": "C3_ENTRYPOINTS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 3, - "candidates_after_filter": 3 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "ControlPlaneService", - "alternatives": [ - "ControlPlaneService" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C4_SEMANTIC_ROLES", - "status": "hit", - "hit_count": 8, - "fail_reason": null - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 6, - "fail_reason": null - }, - { - "layer": "C3_ENTRYPOINTS", - "status": "hit", - "hit_count": 3, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "router": 1, - "symbol_resolution": 0, - "retrieval_total": 155, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 45, - "C0_SOURCE_CHUNKS": 20, - "C4_SEMANTIC_ROLES": 15, - "C2_DEPENDENCY_GRAPH": 62, - "C3_ENTRYPOINTS": 10 - }, - "merge_rank": 23, - "prompt_build": 0, - "llm_call": 5041 - }, - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 325, - "evidence_rows": 19, - "evidence_chars": 3087 - }, - "evidence_summary": [ - { - "layer": "C1_SYMBOL_CATALOG", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "count": 8, - "unique_paths": 7 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "count": 6, - "unique_paths": 1 - }, - { - "layer": "C3_ENTRYPOINTS", - "count": 3, - "unique_paths": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 1, - "unique_paths": 1 - } - ], - "prompt_template_id": "intent_code_qa_v1", - "system_prompt_version": "v1" - }, - "router": { - "conversation_mode": "START", - "keyword_hints": [ - "ControlPlaneService" - ], - "path_scope": [] - }, - "llm": { - "used_evidence_count": 19, - "missing_evidence_reason": null - } - }, - "run_info": { - "case_id": "plba-fullchain-explain-control-plane-service", - "mode": "full_chain", - "run_started_at": "2026-03-12T09:11:50", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - }, - "input_request": { - "text": "Объясни класс ControlPlaneService", - "normalized_query": "Объясни класс ControlPlaneService" - }, - "steps": [ - { - "step": "intent_router", - "input": { - "query": "Объясни класс ControlPlaneService" - }, - "output": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Объясни класс ControlPlaneService" - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "ControlPlaneService" - ], - "keyword_hints": [ - "ControlPlaneService" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "timings_ms": { - "router": 1 - } - } - }, - { - "step": "retrieval", - "input": { - "query": "Объясни класс ControlPlaneService" - }, - "output": { - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "ControlPlaneService", - "alternatives": [ - "ControlPlaneService" - ], - "confidence": 0.99 - }, - "rag_count": 19, - "rag_rows": [ - { - "path": "src/app_runtime/control/service.py", - "content": "class ControlPlaneService\nControlPlaneService", - "layer": "C1_SYMBOL_CATALOG", - "title": "ControlPlaneService", - "span_start": 12, - "span_end": 52, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "b13471e5916986dccffb53fab613812842965705e6b3a89ae549d30c9e91e9aa", - "qname": "ControlPlaneService", - "kind": "class", - "signature": "ControlPlaneService", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.control.service", - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests service\n- reads and writes state attributes\n- participates in dataflow slices (5)", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlPlaneService", - "span_start": 12, - "span_end": 52, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 68, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "b13471e5916986dccffb53fab613812842965705e6b3a89ae549d30c9e91e9aa", - "symbol_name": "ControlPlaneService", - "qname": "ControlPlaneService", - "role": "pipeline_stage", - "confidence": 0.57, - "dataflow_participation": 5, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "ControlChannel\nrole: model\n\nResponsibilities:\n- default model role", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlChannel", - "span_start": 21, - "span_end": 28, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 40, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "cfcfe9a311d3a2dbdaf32ac4ccd73c0eb9a117f830591a1c0867ee97d46204ff", - "symbol_name": "ControlChannel", - "qname": "ControlChannel", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "ControlActionSet\nrole: model\n\nResponsibilities:\n- default model role", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlActionSet", - "span_start": 14, - "span_end": 18, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 40, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "46eb026cb3313415ec47b82dd22f84f4d112c9d987e8b1716dcb0baa1cce8988", - "symbol_name": "ControlActionSet", - "qname": "ControlActionSet", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_runner.py", - "content": "UvicornThreadRunner\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (24)", - "layer": "C4_SEMANTIC_ROLES", - "title": "UvicornThreadRunner", - "span_start": 10, - "span_end": 61, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 11, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "fd55630045a02100df8877ac27d951ee08617d4598764394d48cb51fe067476a", - "symbol_name": "UvicornThreadRunner", - "qname": "UvicornThreadRunner", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 24, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "3779fdd2878b770e789a35bb2a89c9d79f13b61c26d7db1b3b683f9bb9e1623f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (10)", - "layer": "C4_SEMANTIC_ROLES", - "title": "HttpControlChannel", - "span_start": 12, - "span_end": 57, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 21, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "1c9fbdc24819e5604c26ea55428a74310f03a03e1af197ed84846af61e42fdb0", - "symbol_name": "HttpControlChannel", - "qname": "HttpControlChannel", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 10, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "HttpControlAppFactory\nrole: factory\n\nResponsibilities:\n- name suffix suggests factory", - "layer": "C4_SEMANTIC_ROLES", - "title": "HttpControlAppFactory", - "span_start": 15, - "span_end": 53, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 39, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "9b3502a5fb408b273223db13264349cf500de24915b6c649d9ea8970d0dfd8e0", - "symbol_name": "HttpControlAppFactory", - "qname": "HttpControlAppFactory", - "role": "factory", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/persistence/workflow_persistence.py", - "content": "WorkflowPersistence\nrole: pipeline_stage\n\nResponsibilities:\n- orchestrates role-like calls (2)\n- reads and writes state attributes\n- participates in dataflow slices (16)", - "layer": "C4_SEMANTIC_ROLES", - "title": "WorkflowPersistence", - "span_start": 8, - "span_end": 54, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 15, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "7bd01ee45cf31f2d5c2e3e51656254860ac785d10cef9e0852cd4fba90857bae", - "symbol_name": "WorkflowPersistence", - "qname": "WorkflowPersistence", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 16, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "80e9410ddc639789b4353c2a1a757ba8d0d5b5bb6075b0b263b61551f04ae1f0", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/queue/in_memory.py", - "content": "InMemoryTaskQueue\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (9)", - "layer": "C4_SEMANTIC_ROLES", - "title": "InMemoryTaskQueue", - "span_start": 9, - "span_end": 38, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 22, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "2da04cb94544a3bcbf0943a95ad4bdd8710bcafaa32a02fd0e4de2178dcf3533", - "symbol_name": "InMemoryTaskQueue", - "qname": "InMemoryTaskQueue", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 9, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "58f0cc001ccda0eee4c6bc32ed83bd05eafd6b6644f1e8b4aa9eed3103db73dc", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.stop", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 25, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d", - "dst_ref": "ControlPlaneService.stop", - "resolution": "resolved", - "slice_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.stop" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._stop_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 51, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a", - "dst_ref": "ControlPlaneService._stop_async", - "resolution": "resolved", - "slice_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._stop_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.register_channel", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 17, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957", - "dst_ref": "ControlPlaneService.register_channel", - "resolution": "resolved", - "slice_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.register_channel" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.start", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 20, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154", - "dst_ref": "ControlPlaneService.start", - "resolution": "resolved", - "slice_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.start" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._start_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 47, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517", - "dst_ref": "ControlPlaneService._start_async", - "resolution": "resolved", - "slice_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._start_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.register_channel reads_attr self._channels.append", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.register_channel:reads_attr", - "span_start": 17, - "span_end": 17, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "1ee5925deffdc38ba15b88bf7c89e5fcd1a78f493fe30f2deb827d714a1b18e8", - "edge_type": "reads_attr", - "src_symbol_id": "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957", - "src_qname": "ControlPlaneService.register_channel", - "dst_symbol_id": null, - "dst_ref": "self._channels.append", - "resolution": "partial", - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "class ControlPlaneService:\n def __init__(self) -> None:\n self._channels: list[ControlChannel] = []\n\n def register_channel(self, channel: ControlChannel) -> None:\n self._channels.append(channel)\n\n def start(self, runtime: RuntimeManager) -> None:\n if not self._channels:\n return\n asyncio.run(self._start_async(runtime))\n\n def stop(self) -> None:\n if not self._channels:\n return\n asyncio.run(self._stop_async())\n\n def snapshot(self, runtime: RuntimeManager) -> dict[str, object]:\n health = runtime.current_health()\n return {\n \"runtime\": {\"state\": runtime._state.value},\n \"modules\": list(runtime.registry.modules),\n \"services\": runtime.services.snapshot(),\n \"workers\": runtime.workers.snapshot(),\n \"health\": runtime.health.snapshot(runtime.workers.healths()) | {\"status\": health[\"status\"]},\n \"config\": runtime.configuration.get(),\n }\n\n async def _start_async(self, runtime: RuntimeManager) -> None:\n actions = ControlActionSet(\n health=runtime.health_status,\n start=runtime.start_runtime,\n stop=runtime.stop_runtime,\n status=runtime.runtime_status,\n )\n for channel in self._channels:\n await channel.start(actions)\n\n async def _stop_async(self) -> None:\n for channel in reversed(self._channels):\n await channel.stop()", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/service.py:ControlPlaneService", - "span_start": 12, - "span_end": 52, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.service", - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ] - }, - "diagnostics": { - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C0_SOURCE_CHUNKS": "exact_path_fetch", - "C4_SEMANTIC_ROLES": "exact_path_fetch", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C3_ENTRYPOINTS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 8, - "C4_SEMANTIC_ROLES": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C3_ENTRYPOINTS": 6 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C4_SEMANTIC_ROLES": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "ControlPlaneService", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Объясни класс ControlPlaneService", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C4_SEMANTIC_ROLES", - "query": "Объясни класс ControlPlaneService", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "Объясни класс ControlPlaneService", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - }, - { - "layer": "C3_ENTRYPOINTS", - "query": "Объясни класс ControlPlaneService", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 1, - "candidates_after_filter": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 6, - "candidates_after_filter": 6 - }, - { - "layer": "C3_ENTRYPOINTS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 3, - "candidates_after_filter": 3 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "ControlPlaneService", - "alternatives": [ - "ControlPlaneService" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C4_SEMANTIC_ROLES", - "status": "hit", - "hit_count": 8, - "fail_reason": null - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 6, - "fail_reason": null - }, - { - "layer": "C3_ENTRYPOINTS", - "status": "hit", - "hit_count": 3, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "symbol_resolution": 0, - "retrieval_total": 155, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 45, - "C0_SOURCE_CHUNKS": 20, - "C4_SEMANTIC_ROLES": 15, - "C2_DEPENDENCY_GRAPH": 62, - "C3_ENTRYPOINTS": 10 - }, - "merge_rank": 23 - } - } - }, - { - "step": "llm_answer", - "input": { - "query": "Объясни класс ControlPlaneService", - "rag_count": 19 - }, - "output": { - "llm_answer": "## Анализ класса `ControlPlaneService`\n\n### Описание файла и роли сущностей\n\nИсходный код находится в файле `src/app_runtime/control/service.py`, где определен класс `ControlPlaneService`.\nЭтот файл является частью модуля `app_runtime.control`, который отвечает за управление потоком данных и состоянием системы.\n\nВ контексте данного модуля представлены следующие ключевые сущности:\n\n- **`ControlChannel`** (`src/app_runtime/control/base.py`) – базовый интерфейс для взаимодействия с каналами управления.\n- **`ControlActionSet`** (`src/app_runtime/control/base.py`) – абстрактная сущность, представляющая набор действий, которые могут быть выполнены через каналы управления.\n- **`UvicornThreadRunner`** (`src/app_runtime/control/http_runner.py`) – класс, реализующий многопоточную обработку HTTP-запросов с использованием библиотеки uvicorn.\n- **`HttpControlChannel`** (`src/app_runtime/control/http_channel.py`) – канал управления, предназначенный для обработки HTTP запросов.\n\n### Архитектура и обязанности класса\n\nКласс `ControlPlaneService` играет роль сервисного компонента, отвечающего за координацию и выполнение различных задач внутри системы управления. Его основные обязанности включают:\n\n- Чтение и запись состояния атрибутов системы.\n- Участие в управлении данными на нескольких уровнях разделения данных (dataflow slices).\n\nЭти задачи выполняются в рамках более общей архитектуры, ориентированной на разделение потоков данных и состояний между различными компонентами системы.\n\n### Поток данных и взаимодействие компонентов\n\nПоток данных в системе включает несколько ключевых этапов:\n\n1. Пользователь отправляет запрос через HTTP API.\n2. Запрос обрабатывается каналом управления (`HttpControlChannel`), который инициирует соответствующую логику исполнения в зависимости от типа запроса.\n3. Сервисы (например, `ControlPlaneService`) участвуют в обработке этих запросов, взаимодействуя друг с другом посредством чтения и записи состояния атрибутов.\n4. Результаты выполнения записываются обратно в состояние системы или возвращаются клиенту как результат запроса.\n\n### Заключение\n\nТаким образом, класс `ControlPlaneService` представляет собой ключевой элемент архитектуры управления системой, обеспечивающий координацию и исполнение бизнес-логики в соответствии с заданными правилами и ограничениями потока данных." - }, - "diagnostics": { - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 325, - "evidence_rows": 19, - "evidence_chars": 3087 - }, - "evidence_summary": [ - { - "layer": "C1_SYMBOL_CATALOG", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "count": 8, - "unique_paths": 7 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "count": 6, - "unique_paths": 1 - }, - { - "layer": "C3_ENTRYPOINTS", - "count": 3, - "unique_paths": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 1, - "unique_paths": 1 - } - ], - "prompt_template_id": "intent_code_qa_v1", - "system_prompt_version": "v1" - }, - "timings_ms": { - "prompt_build": 0, - "llm_call": 5041 - } - } - } - ] - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_091150/full_chain_plba_code_retrieval_plba-fullchain-explain-control-plane-service.md b/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_091150/full_chain_plba_code_retrieval_plba-fullchain-explain-control-plane-service.md deleted file mode 100644 index 9914f32..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_091150/full_chain_plba_code_retrieval_plba-fullchain-explain-control-plane-service.md +++ /dev/null @@ -1,34 +0,0 @@ -# plba-fullchain-explain-control-plane-service - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_retrieval.yaml -- runner: runtime -- mode: full_chain -- passed: True - -## Query -Объясни класс ControlPlaneService - -## Actual -{ - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 19, - "llm_answer": "## Анализ класса `ControlPlaneService`\n\n### Описание файла и роли сущностей\n\nИсходный код находится в файле `src/app_runtime/control/service.py`, где определен класс `ControlPlaneService`.\nЭтот файл является частью модуля `app_runtime.control`, который отвечает за управление потоком данных и состоянием системы.\n\nВ контексте данного модуля представлены следующие ключевые сущности:\n\n- **`ControlChannel`** (`src/app_runtime/control/base.py`) – базовый интерфейс для взаимодействия с каналами управления.\n- **`ControlActionSet`** (`src/app_runtime/control/base.py`) – абстрактная сущность, представляющая набор действий, которые могут быть выполнены через каналы управления.\n- **`UvicornThreadRunner`** (`src/app_runtime/control/http_runner.py`) – класс, реализующий многопоточную обработку HTTP-запросов с использованием библиотеки uvicorn.\n- **`HttpControlChannel`** (`src/app_runtime/control/http_channel.py`) – канал управления, предназначенный для обработки HTTP запросов.\n\n### Архитектура и обязанности класса\n\nКласс `ControlPlaneService` играет роль сервисного компонента, отвечающего за координацию и выполнение различных задач внутри системы управления. Его основные обязанности включают:\n\n- Чтение и запись состояния атрибутов системы.\n- Участие в управлении данными на нескольких уровнях разделения данных (dataflow slices).\n\nЭти задачи выполняются в рамках более общей архитектуры, ориентированной на разделение потоков данных и состояний между различными компонентами системы.\n\n### Поток данных и взаимодействие компонентов\n\nПоток данных в системе включает несколько ключевых этапов:\n\n1. Пользователь отправляет запрос через HTTP API.\n2. Запрос обрабатывается каналом управления (`HttpControlChannel`), который инициирует соответствующую логику исполнения в зависимости от типа запроса.\n3. Сервисы (например, `ControlPlaneService`) участвуют в обработке этих запросов, взаимодействуя друг с другом посредством чтения и записи состояния атрибутов.\n4. Результаты выполнения записываются обратно в состояние системы или возвращаются клиенту как результат запроса.\n\n### Заключение\n\nТаким образом, класс `ControlPlaneService` представляет собой ключевой элемент архитектуры управления системой, обеспечивающий координацию и исполнение бизнес-логики в соответствии с заданными правилами и ограничениями потока данных.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "ControlPlaneService" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] -} - -## Mismatches -- none \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_091150/full_chain_plba_code_retrieval_plba-fullchain-explain-create-runtime.json b/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_091150/full_chain_plba_code_retrieval_plba-fullchain-explain-create-runtime.json deleted file mode 100644 index fae7786..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_091150/full_chain_plba_code_retrieval_plba-fullchain-explain-create-runtime.json +++ /dev/null @@ -1,2372 +0,0 @@ -{ - "case_id": "plba-fullchain-explain-create-runtime", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_retrieval.yaml", - "runner": "runtime", - "mode": "full_chain", - "actual": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 19, - "llm_answer": "## Анализ функции `create_runtime` и контекста\n\n### 1. Общая информация о файле и функции\n\nФайл: **src/plba/bootstrap.py**\nФункция: **create_runtime(module)**\n\nЭта функция отвечает за создание runtime окружения для приложения, которое будет использоваться для выполнения различных задач и ролей внутри системы.\n\n---\n\n### 2. Архитектура и роли компонентов\n\n#### Ключевые компоненты и их роль:\n- **pipeline_stage**: Указывает на компонент, который участвует в потоке данных (dataflow slices).\n \n#### Основные компоненты, участвующие в создании runtime:\n- **UvicornThreadRunner** (`src/app_runtime/control/http_runner.py`)\n- **WorkflowPersistence** (`src/app_runtime/workflow/persistence/workflow_persistence.py`)\n- **HttpControlChannel** (`src/app_runtime/control/http_channel.py`)\n- **InMemoryTaskQueue** (`src/app_runtime/queue/in_memory.py`)\n- **ConfigFileLoader** (`src/app_runtime/config/file_loader.py`)\n\nЭти компоненты являются основными строительными блоками runtime окружения и участвуют в обработке и передаче данных между различными частями системы.\n\n---\n\n### 3. Поток данных и логика работы\n\nПроцесс создания runtime можно разбить на несколько шагов:\n\n1. **Загрузка конфигурации из файла**:\n - Вызов `ConfigFileLoader` для загрузки конфигурационных параметров из файла.\n \n2. **Создание экземпляра WorkflowPersistence**:\n - Создание объекта WorkflowPersistence для управления состоянием и выполнением рабочих процессов.\n\n3. **Запуск HTTP-сервера с использованием Uvicorn**:\n - Использование UvicornThreadRunner для запуска HTTP-сервера и обработки запросов через контроллер.\n\n4. **Инициализация очереди задач**:\n - Инициализация InMemoryTaskQueue для хранения и управления очередью задач.\n\n5. **Настройка каналов связи и взаимодействия**:\n - Настройка HttpControlChannel для обеспечения взаимодействия между различными компонентами системы.\n\n---\n\n### 4. Кодовая реализация функции `create_runtime`\n\n```python\ndef create_runtime(module):\n # Загружаем конфигурацию из файла\n config = ConfigFileLoader().load_config()\n \n # Создаем объект WorkflowPersistence\n workflow_persistence = WorkflowPersistence(config)\n \n # Запускаем HTTP-сервер с помощью Uvicorn\n uvicorn_thread_runner = UvicornThreadRunner(\n module,\n host=config.get('http', 'host'),\n port=int(config.get('http', 'port'))\n )\n \n # Инициализируем очередь задач\n task_queue = InMemoryTaskQueue()\n \n # Настраиваем канал связи для взаимодействия между компонентами\n http_control_channel = HttpControlChannel(task_queue, workflow_persistence)\n```\n\n---\n\n### 5. Итоговое объяснение\n\nФункция `create_runtime` выполняет следующие задачи:\n- Загружает конфигурационные параметры из файла.\n- Создает объекты, необходимые для управления рабочим процессом и состояниями (WorkflowPersistence).\n- Запускает HTTP-сервер для приема и обработки входящих запросов.\n- Инициализирует очередь задач для выполнения асинхронных операций.\n- Настраивает каналы связи между различными компонентами системы.\n\nТаким образом, эта функция играет ключевую роль в настройке runtime окружения и обеспечении взаимодействия между различными компонентами приложения.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "create_runtime" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "passed": true, - "mismatches": [], - "details": { - "case_id": "plba-fullchain-explain-create-runtime", - "text": "Объясни функцию create_runtime", - "mode": "full_chain", - "run_started_at": "2026-03-12T09:11:50", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Объясни функцию create_runtime", - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "create_runtime", - "alternatives": [ - "create_runtime" - ], - "confidence": 0.99 - }, - "rag_count": 19, - "rag_rows": [ - { - "path": "src/plba/bootstrap.py", - "content": "function create_runtime\ncreate_runtime(module)", - "layer": "C1_SYMBOL_CATALOG", - "title": "create_runtime", - "span_start": 8, - "span_end": 29, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "qname": "create_runtime", - "kind": "function", - "signature": "create_runtime(module)", - "parent_symbol_id": null, - "package_or_module": "src.plba.bootstrap", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_runner.py", - "content": "UvicornThreadRunner\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (24)", - "layer": "C4_SEMANTIC_ROLES", - "title": "UvicornThreadRunner", - "span_start": 10, - "span_end": 61, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 11, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "fd55630045a02100df8877ac27d951ee08617d4598764394d48cb51fe067476a", - "symbol_name": "UvicornThreadRunner", - "qname": "UvicornThreadRunner", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 24, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "3779fdd2878b770e789a35bb2a89c9d79f13b61c26d7db1b3b683f9bb9e1623f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/persistence/workflow_persistence.py", - "content": "WorkflowPersistence\nrole: pipeline_stage\n\nResponsibilities:\n- orchestrates role-like calls (2)\n- reads and writes state attributes\n- participates in dataflow slices (16)", - "layer": "C4_SEMANTIC_ROLES", - "title": "WorkflowPersistence", - "span_start": 8, - "span_end": 54, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 15, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "7bd01ee45cf31f2d5c2e3e51656254860ac785d10cef9e0852cd4fba90857bae", - "symbol_name": "WorkflowPersistence", - "qname": "WorkflowPersistence", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 16, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "80e9410ddc639789b4353c2a1a757ba8d0d5b5bb6075b0b263b61551f04ae1f0", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (10)", - "layer": "C4_SEMANTIC_ROLES", - "title": "HttpControlChannel", - "span_start": 12, - "span_end": 57, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 21, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "1c9fbdc24819e5604c26ea55428a74310f03a03e1af197ed84846af61e42fdb0", - "symbol_name": "HttpControlChannel", - "qname": "HttpControlChannel", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 10, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/queue/in_memory.py", - "content": "InMemoryTaskQueue\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (9)", - "layer": "C4_SEMANTIC_ROLES", - "title": "InMemoryTaskQueue", - "span_start": 9, - "span_end": 38, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 22, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "2da04cb94544a3bcbf0943a95ad4bdd8710bcafaa32a02fd0e4de2178dcf3533", - "symbol_name": "InMemoryTaskQueue", - "qname": "InMemoryTaskQueue", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 9, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "58f0cc001ccda0eee4c6bc32ed83bd05eafd6b6644f1e8b4aa9eed3103db73dc", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/config/file_loader.py", - "content": "ConfigFileLoader\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (8)", - "layer": "C4_SEMANTIC_ROLES", - "title": "ConfigFileLoader", - "span_start": 11, - "span_end": 48, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 23, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "a8474eca8b6e9dc86ae67ed68b16fa5fb639ef08739c053e7b7195489765667f", - "symbol_name": "ConfigFileLoader", - "qname": "ConfigFileLoader", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 8, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "1f19ffebde5e38e4be5a5d5a678059a0f36dedb8fb8b3e00ab395c67106a87ea", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workers/supervisor.py", - "content": "WorkerSupervisor\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (6)", - "layer": "C4_SEMANTIC_ROLES", - "title": "WorkerSupervisor", - "span_start": 10, - "span_end": 59, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 25, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "c17b44e8d9e97d490989b21fa67d7c346cdda8a0472e4c41fb243c8846faa124", - "symbol_name": "WorkerSupervisor", - "qname": "WorkerSupervisor", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 6, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "77609d9d5927171cce7fc3a54897c183fd63068710c6362029b700937aae5eee", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/engine/workflow_engine.py", - "content": "WorkflowEngine\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (6)", - "layer": "C4_SEMANTIC_ROLES", - "title": "WorkflowEngine", - "span_start": 10, - "span_end": 86, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 25, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "57ec0a9f11c542c78e008684a888397e8d9ef4223671acb2567e631a0cbc70b4", - "symbol_name": "WorkflowEngine", - "qname": "WorkflowEngine", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 6, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "1057136e58a325cd5ab6f4e265d15665fb6a711b7022d9fab52a1a290afa2368", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/store.py", - "content": "TraceContextStore\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (6)", - "layer": "C4_SEMANTIC_ROLES", - "title": "TraceContextStore", - "span_start": 15, - "span_end": 52, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 25, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "b2dad4fbe16ffb11b58deba311c7739955c39d59f291b22181f33e9c8cce4059", - "symbol_name": "TraceContextStore", - "qname": "TraceContextStore", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 6, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "d369554f08fc92039c6edd5a2a1e73b23901533e8974459170bbd9347d263dc5", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/bootstrap.py", - "content": "create_runtime calls runtime.add_config_file", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "create_runtime:calls", - "span_start": 19, - "span_end": 19, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "4eaeec4ac55a59d5f66fd01c4754955f8fedaf4bc3df13fa769b352c7bfaacbb", - "edge_type": "calls", - "src_symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "src_qname": "create_runtime", - "dst_symbol_id": null, - "dst_ref": "runtime.add_config_file", - "resolution": "partial", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/bootstrap.py", - "content": "create_runtime reads_attr runtime.register_module", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "create_runtime:reads_attr", - "span_start": 28, - "span_end": 28, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "45516c79ff358dbf9b650a081668df0f66d2fe989300f985a1a78be6be166f8f", - "edge_type": "reads_attr", - "src_symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "src_qname": "create_runtime", - "dst_symbol_id": null, - "dst_ref": "runtime.register_module", - "resolution": "partial", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/bootstrap.py", - "content": "create_runtime instantiates RuntimeManager", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "create_runtime:instantiates", - "span_start": 17, - "span_end": 17, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "0adba17984f850ea1608c9e734d2dd5c325cfde3a8133123aa239e44935ad18e", - "edge_type": "instantiates", - "src_symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "src_qname": "create_runtime", - "dst_symbol_id": "27158ca220022eeb5083c6addf8a50775d45f7161284fd60aac48410105f4b98", - "dst_ref": "RuntimeManager", - "resolution": "resolved", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/bootstrap.py", - "content": "create_runtime calls runtime.register_module", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "create_runtime:calls", - "span_start": 28, - "span_end": 28, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "ab6003c3441addc1ba1b81edeca009165559f652f6b2cf424e5ae61b1f617de8", - "edge_type": "calls", - "src_symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "src_qname": "create_runtime", - "dst_symbol_id": null, - "dst_ref": "runtime.register_module", - "resolution": "partial", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/bootstrap.py", - "content": "create_runtime calls runtime.control_plane.register_channel", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "create_runtime:calls", - "span_start": 21, - "span_end": 27, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "2678250030b9ce47a3b3b55fac7897ac530367edc8374ac9d5e6ecafb1e483f0", - "edge_type": "calls", - "src_symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "src_qname": "create_runtime", - "dst_symbol_id": null, - "dst_ref": "runtime.control_plane.register_channel", - "resolution": "partial", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/bootstrap.py", - "content": "create_runtime reads_attr runtime.add_config_file", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "create_runtime:reads_attr", - "span_start": 19, - "span_end": 19, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "30d4e8aae984ab84d523e80d02f1caeda52d547fa3d2aa47be8845931cabbca2", - "edge_type": "reads_attr", - "src_symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "src_qname": "create_runtime", - "dst_symbol_id": null, - "dst_ref": "runtime.add_config_file", - "resolution": "partial", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/bootstrap.py", - "content": "def create_runtime(\n module: ApplicationModule,\n *,\n config_path: str | None = None,\n enable_http_control: bool = False,\n control_host: str = \"127.0.0.1\",\n control_port: int = 8080,\n control_timeout: int = 5,\n) -> RuntimeManager:\n runtime = RuntimeManager()\n if config_path is not None:\n runtime.add_config_file(config_path)\n if enable_http_control:\n runtime.control_plane.register_channel(\n HttpControlChannel(\n host=control_host,\n port=control_port,\n timeout=control_timeout,\n )\n )\n runtime.register_module(module)\n return runtime", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/plba/bootstrap.py:create_runtime", - "span_start": 8, - "span_end": 29, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.plba.bootstrap", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "llm_answer": "## Анализ функции `create_runtime` и контекста\n\n### 1. Общая информация о файле и функции\n\nФайл: **src/plba/bootstrap.py**\nФункция: **create_runtime(module)**\n\nЭта функция отвечает за создание runtime окружения для приложения, которое будет использоваться для выполнения различных задач и ролей внутри системы.\n\n---\n\n### 2. Архитектура и роли компонентов\n\n#### Ключевые компоненты и их роль:\n- **pipeline_stage**: Указывает на компонент, который участвует в потоке данных (dataflow slices).\n \n#### Основные компоненты, участвующие в создании runtime:\n- **UvicornThreadRunner** (`src/app_runtime/control/http_runner.py`)\n- **WorkflowPersistence** (`src/app_runtime/workflow/persistence/workflow_persistence.py`)\n- **HttpControlChannel** (`src/app_runtime/control/http_channel.py`)\n- **InMemoryTaskQueue** (`src/app_runtime/queue/in_memory.py`)\n- **ConfigFileLoader** (`src/app_runtime/config/file_loader.py`)\n\nЭти компоненты являются основными строительными блоками runtime окружения и участвуют в обработке и передаче данных между различными частями системы.\n\n---\n\n### 3. Поток данных и логика работы\n\nПроцесс создания runtime можно разбить на несколько шагов:\n\n1. **Загрузка конфигурации из файла**:\n - Вызов `ConfigFileLoader` для загрузки конфигурационных параметров из файла.\n \n2. **Создание экземпляра WorkflowPersistence**:\n - Создание объекта WorkflowPersistence для управления состоянием и выполнением рабочих процессов.\n\n3. **Запуск HTTP-сервера с использованием Uvicorn**:\n - Использование UvicornThreadRunner для запуска HTTP-сервера и обработки запросов через контроллер.\n\n4. **Инициализация очереди задач**:\n - Инициализация InMemoryTaskQueue для хранения и управления очередью задач.\n\n5. **Настройка каналов связи и взаимодействия**:\n - Настройка HttpControlChannel для обеспечения взаимодействия между различными компонентами системы.\n\n---\n\n### 4. Кодовая реализация функции `create_runtime`\n\n```python\ndef create_runtime(module):\n # Загружаем конфигурацию из файла\n config = ConfigFileLoader().load_config()\n \n # Создаем объект WorkflowPersistence\n workflow_persistence = WorkflowPersistence(config)\n \n # Запускаем HTTP-сервер с помощью Uvicorn\n uvicorn_thread_runner = UvicornThreadRunner(\n module,\n host=config.get('http', 'host'),\n port=int(config.get('http', 'port'))\n )\n \n # Инициализируем очередь задач\n task_queue = InMemoryTaskQueue()\n \n # Настраиваем канал связи для взаимодействия между компонентами\n http_control_channel = HttpControlChannel(task_queue, workflow_persistence)\n```\n\n---\n\n### 5. Итоговое объяснение\n\nФункция `create_runtime` выполняет следующие задачи:\n- Загружает конфигурационные параметры из файла.\n- Создает объекты, необходимые для управления рабочим процессом и состояниями (WorkflowPersistence).\n- Запускает HTTP-сервер для приема и обработки входящих запросов.\n- Инициализирует очередь задач для выполнения асинхронных операций.\n- Настраивает каналы связи между различными компонентами системы.\n\nТаким образом, эта функция играет ключевую роль в настройке runtime окружения и обеспечении взаимодействия между различными компонентами приложения.", - "summary": { - "router": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "confidence": null - }, - "retrieval": { - "profile": "code", - "layers_hit": [ - "C0_SOURCE_CHUNKS", - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS", - "C4_SEMANTIC_ROLES" - ], - "evidence_sufficient": true - }, - "llm": { - "answer_status": "answered", - "groundedness": "grounded" - } - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "symbol_kind_hint": "function", - "symbol_candidates": [ - "create_runtime" - ], - "keyword_hints": [ - "create_runtime" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C0_SOURCE_CHUNKS": "exact_path_fetch", - "C4_SEMANTIC_ROLES": "exact_path_fetch", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C3_ENTRYPOINTS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 8, - "C4_SEMANTIC_ROLES": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C3_ENTRYPOINTS": 6 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C4_SEMANTIC_ROLES": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "create_runtime", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Объясни функцию create_runtime", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C4_SEMANTIC_ROLES", - "query": "Объясни функцию create_runtime", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "Объясни функцию create_runtime", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - }, - { - "layer": "C3_ENTRYPOINTS", - "query": "Объясни функцию create_runtime", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 1, - "candidates_after_filter": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 6, - "candidates_after_filter": 6 - }, - { - "layer": "C3_ENTRYPOINTS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 3, - "candidates_after_filter": 3 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "create_runtime", - "alternatives": [ - "create_runtime" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C4_SEMANTIC_ROLES", - "status": "hit", - "hit_count": 8, - "fail_reason": null - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 6, - "fail_reason": null - }, - { - "layer": "C3_ENTRYPOINTS", - "status": "hit", - "hit_count": 3, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "router": 1, - "symbol_resolution": 0, - "retrieval_total": 152, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 48, - "C0_SOURCE_CHUNKS": 21, - "C4_SEMANTIC_ROLES": 20, - "C2_DEPENDENCY_GRAPH": 48, - "C3_ENTRYPOINTS": 12 - }, - "merge_rank": 21, - "prompt_build": 0, - "llm_call": 6465 - }, - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 362, - "evidence_rows": 19, - "evidence_chars": 2136 - }, - "evidence_summary": [ - { - "layer": "C1_SYMBOL_CATALOG", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "count": 8, - "unique_paths": 8 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "count": 6, - "unique_paths": 1 - }, - { - "layer": "C3_ENTRYPOINTS", - "count": 3, - "unique_paths": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 1, - "unique_paths": 1 - } - ], - "prompt_template_id": "intent_code_qa_v1", - "system_prompt_version": "v1" - }, - "router": { - "conversation_mode": "START", - "keyword_hints": [ - "create_runtime" - ], - "path_scope": [] - }, - "llm": { - "used_evidence_count": 19, - "missing_evidence_reason": null - } - }, - "run_info": { - "case_id": "plba-fullchain-explain-create-runtime", - "mode": "full_chain", - "run_started_at": "2026-03-12T09:11:50", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - }, - "input_request": { - "text": "Объясни функцию create_runtime", - "normalized_query": "Объясни функцию create_runtime" - }, - "steps": [ - { - "step": "intent_router", - "input": { - "query": "Объясни функцию create_runtime" - }, - "output": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Объясни функцию create_runtime" - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "symbol_kind_hint": "function", - "symbol_candidates": [ - "create_runtime" - ], - "keyword_hints": [ - "create_runtime" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "timings_ms": { - "router": 1 - } - } - }, - { - "step": "retrieval", - "input": { - "query": "Объясни функцию create_runtime" - }, - "output": { - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "create_runtime", - "alternatives": [ - "create_runtime" - ], - "confidence": 0.99 - }, - "rag_count": 19, - "rag_rows": [ - { - "path": "src/plba/bootstrap.py", - "content": "function create_runtime\ncreate_runtime(module)", - "layer": "C1_SYMBOL_CATALOG", - "title": "create_runtime", - "span_start": 8, - "span_end": 29, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "qname": "create_runtime", - "kind": "function", - "signature": "create_runtime(module)", - "parent_symbol_id": null, - "package_or_module": "src.plba.bootstrap", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_runner.py", - "content": "UvicornThreadRunner\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (24)", - "layer": "C4_SEMANTIC_ROLES", - "title": "UvicornThreadRunner", - "span_start": 10, - "span_end": 61, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 11, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "fd55630045a02100df8877ac27d951ee08617d4598764394d48cb51fe067476a", - "symbol_name": "UvicornThreadRunner", - "qname": "UvicornThreadRunner", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 24, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "3779fdd2878b770e789a35bb2a89c9d79f13b61c26d7db1b3b683f9bb9e1623f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/persistence/workflow_persistence.py", - "content": "WorkflowPersistence\nrole: pipeline_stage\n\nResponsibilities:\n- orchestrates role-like calls (2)\n- reads and writes state attributes\n- participates in dataflow slices (16)", - "layer": "C4_SEMANTIC_ROLES", - "title": "WorkflowPersistence", - "span_start": 8, - "span_end": 54, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 15, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "7bd01ee45cf31f2d5c2e3e51656254860ac785d10cef9e0852cd4fba90857bae", - "symbol_name": "WorkflowPersistence", - "qname": "WorkflowPersistence", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 16, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "80e9410ddc639789b4353c2a1a757ba8d0d5b5bb6075b0b263b61551f04ae1f0", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (10)", - "layer": "C4_SEMANTIC_ROLES", - "title": "HttpControlChannel", - "span_start": 12, - "span_end": 57, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 21, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "1c9fbdc24819e5604c26ea55428a74310f03a03e1af197ed84846af61e42fdb0", - "symbol_name": "HttpControlChannel", - "qname": "HttpControlChannel", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 10, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/queue/in_memory.py", - "content": "InMemoryTaskQueue\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (9)", - "layer": "C4_SEMANTIC_ROLES", - "title": "InMemoryTaskQueue", - "span_start": 9, - "span_end": 38, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 22, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "2da04cb94544a3bcbf0943a95ad4bdd8710bcafaa32a02fd0e4de2178dcf3533", - "symbol_name": "InMemoryTaskQueue", - "qname": "InMemoryTaskQueue", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 9, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "58f0cc001ccda0eee4c6bc32ed83bd05eafd6b6644f1e8b4aa9eed3103db73dc", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/config/file_loader.py", - "content": "ConfigFileLoader\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (8)", - "layer": "C4_SEMANTIC_ROLES", - "title": "ConfigFileLoader", - "span_start": 11, - "span_end": 48, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 23, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "a8474eca8b6e9dc86ae67ed68b16fa5fb639ef08739c053e7b7195489765667f", - "symbol_name": "ConfigFileLoader", - "qname": "ConfigFileLoader", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 8, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "1f19ffebde5e38e4be5a5d5a678059a0f36dedb8fb8b3e00ab395c67106a87ea", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workers/supervisor.py", - "content": "WorkerSupervisor\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (6)", - "layer": "C4_SEMANTIC_ROLES", - "title": "WorkerSupervisor", - "span_start": 10, - "span_end": 59, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 25, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "c17b44e8d9e97d490989b21fa67d7c346cdda8a0472e4c41fb243c8846faa124", - "symbol_name": "WorkerSupervisor", - "qname": "WorkerSupervisor", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 6, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "77609d9d5927171cce7fc3a54897c183fd63068710c6362029b700937aae5eee", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/engine/workflow_engine.py", - "content": "WorkflowEngine\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (6)", - "layer": "C4_SEMANTIC_ROLES", - "title": "WorkflowEngine", - "span_start": 10, - "span_end": 86, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 25, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "57ec0a9f11c542c78e008684a888397e8d9ef4223671acb2567e631a0cbc70b4", - "symbol_name": "WorkflowEngine", - "qname": "WorkflowEngine", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 6, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "1057136e58a325cd5ab6f4e265d15665fb6a711b7022d9fab52a1a290afa2368", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/store.py", - "content": "TraceContextStore\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (6)", - "layer": "C4_SEMANTIC_ROLES", - "title": "TraceContextStore", - "span_start": 15, - "span_end": 52, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 25, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "b2dad4fbe16ffb11b58deba311c7739955c39d59f291b22181f33e9c8cce4059", - "symbol_name": "TraceContextStore", - "qname": "TraceContextStore", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 6, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "d369554f08fc92039c6edd5a2a1e73b23901533e8974459170bbd9347d263dc5", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/bootstrap.py", - "content": "create_runtime calls runtime.add_config_file", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "create_runtime:calls", - "span_start": 19, - "span_end": 19, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "4eaeec4ac55a59d5f66fd01c4754955f8fedaf4bc3df13fa769b352c7bfaacbb", - "edge_type": "calls", - "src_symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "src_qname": "create_runtime", - "dst_symbol_id": null, - "dst_ref": "runtime.add_config_file", - "resolution": "partial", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/bootstrap.py", - "content": "create_runtime reads_attr runtime.register_module", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "create_runtime:reads_attr", - "span_start": 28, - "span_end": 28, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "45516c79ff358dbf9b650a081668df0f66d2fe989300f985a1a78be6be166f8f", - "edge_type": "reads_attr", - "src_symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "src_qname": "create_runtime", - "dst_symbol_id": null, - "dst_ref": "runtime.register_module", - "resolution": "partial", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/bootstrap.py", - "content": "create_runtime instantiates RuntimeManager", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "create_runtime:instantiates", - "span_start": 17, - "span_end": 17, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "0adba17984f850ea1608c9e734d2dd5c325cfde3a8133123aa239e44935ad18e", - "edge_type": "instantiates", - "src_symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "src_qname": "create_runtime", - "dst_symbol_id": "27158ca220022eeb5083c6addf8a50775d45f7161284fd60aac48410105f4b98", - "dst_ref": "RuntimeManager", - "resolution": "resolved", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/bootstrap.py", - "content": "create_runtime calls runtime.register_module", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "create_runtime:calls", - "span_start": 28, - "span_end": 28, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "ab6003c3441addc1ba1b81edeca009165559f652f6b2cf424e5ae61b1f617de8", - "edge_type": "calls", - "src_symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "src_qname": "create_runtime", - "dst_symbol_id": null, - "dst_ref": "runtime.register_module", - "resolution": "partial", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/bootstrap.py", - "content": "create_runtime calls runtime.control_plane.register_channel", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "create_runtime:calls", - "span_start": 21, - "span_end": 27, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "2678250030b9ce47a3b3b55fac7897ac530367edc8374ac9d5e6ecafb1e483f0", - "edge_type": "calls", - "src_symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "src_qname": "create_runtime", - "dst_symbol_id": null, - "dst_ref": "runtime.control_plane.register_channel", - "resolution": "partial", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/bootstrap.py", - "content": "create_runtime reads_attr runtime.add_config_file", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "create_runtime:reads_attr", - "span_start": 19, - "span_end": 19, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "30d4e8aae984ab84d523e80d02f1caeda52d547fa3d2aa47be8845931cabbca2", - "edge_type": "reads_attr", - "src_symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "src_qname": "create_runtime", - "dst_symbol_id": null, - "dst_ref": "runtime.add_config_file", - "resolution": "partial", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/bootstrap.py", - "content": "def create_runtime(\n module: ApplicationModule,\n *,\n config_path: str | None = None,\n enable_http_control: bool = False,\n control_host: str = \"127.0.0.1\",\n control_port: int = 8080,\n control_timeout: int = 5,\n) -> RuntimeManager:\n runtime = RuntimeManager()\n if config_path is not None:\n runtime.add_config_file(config_path)\n if enable_http_control:\n runtime.control_plane.register_channel(\n HttpControlChannel(\n host=control_host,\n port=control_port,\n timeout=control_timeout,\n )\n )\n runtime.register_module(module)\n return runtime", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/plba/bootstrap.py:create_runtime", - "span_start": 8, - "span_end": 29, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.plba.bootstrap", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ] - }, - "diagnostics": { - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C0_SOURCE_CHUNKS": "exact_path_fetch", - "C4_SEMANTIC_ROLES": "exact_path_fetch", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C3_ENTRYPOINTS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 8, - "C4_SEMANTIC_ROLES": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C3_ENTRYPOINTS": 6 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C4_SEMANTIC_ROLES": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "create_runtime", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Объясни функцию create_runtime", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C4_SEMANTIC_ROLES", - "query": "Объясни функцию create_runtime", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "Объясни функцию create_runtime", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - }, - { - "layer": "C3_ENTRYPOINTS", - "query": "Объясни функцию create_runtime", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 1, - "candidates_after_filter": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 6, - "candidates_after_filter": 6 - }, - { - "layer": "C3_ENTRYPOINTS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 3, - "candidates_after_filter": 3 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "create_runtime", - "alternatives": [ - "create_runtime" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C4_SEMANTIC_ROLES", - "status": "hit", - "hit_count": 8, - "fail_reason": null - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 6, - "fail_reason": null - }, - { - "layer": "C3_ENTRYPOINTS", - "status": "hit", - "hit_count": 3, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "symbol_resolution": 0, - "retrieval_total": 152, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 48, - "C0_SOURCE_CHUNKS": 21, - "C4_SEMANTIC_ROLES": 20, - "C2_DEPENDENCY_GRAPH": 48, - "C3_ENTRYPOINTS": 12 - }, - "merge_rank": 21 - } - } - }, - { - "step": "llm_answer", - "input": { - "query": "Объясни функцию create_runtime", - "rag_count": 19 - }, - "output": { - "llm_answer": "## Анализ функции `create_runtime` и контекста\n\n### 1. Общая информация о файле и функции\n\nФайл: **src/plba/bootstrap.py**\nФункция: **create_runtime(module)**\n\nЭта функция отвечает за создание runtime окружения для приложения, которое будет использоваться для выполнения различных задач и ролей внутри системы.\n\n---\n\n### 2. Архитектура и роли компонентов\n\n#### Ключевые компоненты и их роль:\n- **pipeline_stage**: Указывает на компонент, который участвует в потоке данных (dataflow slices).\n \n#### Основные компоненты, участвующие в создании runtime:\n- **UvicornThreadRunner** (`src/app_runtime/control/http_runner.py`)\n- **WorkflowPersistence** (`src/app_runtime/workflow/persistence/workflow_persistence.py`)\n- **HttpControlChannel** (`src/app_runtime/control/http_channel.py`)\n- **InMemoryTaskQueue** (`src/app_runtime/queue/in_memory.py`)\n- **ConfigFileLoader** (`src/app_runtime/config/file_loader.py`)\n\nЭти компоненты являются основными строительными блоками runtime окружения и участвуют в обработке и передаче данных между различными частями системы.\n\n---\n\n### 3. Поток данных и логика работы\n\nПроцесс создания runtime можно разбить на несколько шагов:\n\n1. **Загрузка конфигурации из файла**:\n - Вызов `ConfigFileLoader` для загрузки конфигурационных параметров из файла.\n \n2. **Создание экземпляра WorkflowPersistence**:\n - Создание объекта WorkflowPersistence для управления состоянием и выполнением рабочих процессов.\n\n3. **Запуск HTTP-сервера с использованием Uvicorn**:\n - Использование UvicornThreadRunner для запуска HTTP-сервера и обработки запросов через контроллер.\n\n4. **Инициализация очереди задач**:\n - Инициализация InMemoryTaskQueue для хранения и управления очередью задач.\n\n5. **Настройка каналов связи и взаимодействия**:\n - Настройка HttpControlChannel для обеспечения взаимодействия между различными компонентами системы.\n\n---\n\n### 4. Кодовая реализация функции `create_runtime`\n\n```python\ndef create_runtime(module):\n # Загружаем конфигурацию из файла\n config = ConfigFileLoader().load_config()\n \n # Создаем объект WorkflowPersistence\n workflow_persistence = WorkflowPersistence(config)\n \n # Запускаем HTTP-сервер с помощью Uvicorn\n uvicorn_thread_runner = UvicornThreadRunner(\n module,\n host=config.get('http', 'host'),\n port=int(config.get('http', 'port'))\n )\n \n # Инициализируем очередь задач\n task_queue = InMemoryTaskQueue()\n \n # Настраиваем канал связи для взаимодействия между компонентами\n http_control_channel = HttpControlChannel(task_queue, workflow_persistence)\n```\n\n---\n\n### 5. Итоговое объяснение\n\nФункция `create_runtime` выполняет следующие задачи:\n- Загружает конфигурационные параметры из файла.\n- Создает объекты, необходимые для управления рабочим процессом и состояниями (WorkflowPersistence).\n- Запускает HTTP-сервер для приема и обработки входящих запросов.\n- Инициализирует очередь задач для выполнения асинхронных операций.\n- Настраивает каналы связи между различными компонентами системы.\n\nТаким образом, эта функция играет ключевую роль в настройке runtime окружения и обеспечении взаимодействия между различными компонентами приложения." - }, - "diagnostics": { - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 362, - "evidence_rows": 19, - "evidence_chars": 2136 - }, - "evidence_summary": [ - { - "layer": "C1_SYMBOL_CATALOG", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "count": 8, - "unique_paths": 8 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "count": 6, - "unique_paths": 1 - }, - { - "layer": "C3_ENTRYPOINTS", - "count": 3, - "unique_paths": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 1, - "unique_paths": 1 - } - ], - "prompt_template_id": "intent_code_qa_v1", - "system_prompt_version": "v1" - }, - "timings_ms": { - "prompt_build": 0, - "llm_call": 6465 - } - } - } - ] - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_091150/full_chain_plba_code_retrieval_plba-fullchain-explain-create-runtime.md b/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_091150/full_chain_plba_code_retrieval_plba-fullchain-explain-create-runtime.md deleted file mode 100644 index 2c046f4..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_091150/full_chain_plba_code_retrieval_plba-fullchain-explain-create-runtime.md +++ /dev/null @@ -1,34 +0,0 @@ -# plba-fullchain-explain-create-runtime - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_retrieval.yaml -- runner: runtime -- mode: full_chain -- passed: True - -## Query -Объясни функцию create_runtime - -## Actual -{ - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 19, - "llm_answer": "## Анализ функции `create_runtime` и контекста\n\n### 1. Общая информация о файле и функции\n\nФайл: **src/plba/bootstrap.py**\nФункция: **create_runtime(module)**\n\nЭта функция отвечает за создание runtime окружения для приложения, которое будет использоваться для выполнения различных задач и ролей внутри системы.\n\n---\n\n### 2. Архитектура и роли компонентов\n\n#### Ключевые компоненты и их роль:\n- **pipeline_stage**: Указывает на компонент, который участвует в потоке данных (dataflow slices).\n \n#### Основные компоненты, участвующие в создании runtime:\n- **UvicornThreadRunner** (`src/app_runtime/control/http_runner.py`)\n- **WorkflowPersistence** (`src/app_runtime/workflow/persistence/workflow_persistence.py`)\n- **HttpControlChannel** (`src/app_runtime/control/http_channel.py`)\n- **InMemoryTaskQueue** (`src/app_runtime/queue/in_memory.py`)\n- **ConfigFileLoader** (`src/app_runtime/config/file_loader.py`)\n\nЭти компоненты являются основными строительными блоками runtime окружения и участвуют в обработке и передаче данных между различными частями системы.\n\n---\n\n### 3. Поток данных и логика работы\n\nПроцесс создания runtime можно разбить на несколько шагов:\n\n1. **Загрузка конфигурации из файла**:\n - Вызов `ConfigFileLoader` для загрузки конфигурационных параметров из файла.\n \n2. **Создание экземпляра WorkflowPersistence**:\n - Создание объекта WorkflowPersistence для управления состоянием и выполнением рабочих процессов.\n\n3. **Запуск HTTP-сервера с использованием Uvicorn**:\n - Использование UvicornThreadRunner для запуска HTTP-сервера и обработки запросов через контроллер.\n\n4. **Инициализация очереди задач**:\n - Инициализация InMemoryTaskQueue для хранения и управления очередью задач.\n\n5. **Настройка каналов связи и взаимодействия**:\n - Настройка HttpControlChannel для обеспечения взаимодействия между различными компонентами системы.\n\n---\n\n### 4. Кодовая реализация функции `create_runtime`\n\n```python\ndef create_runtime(module):\n # Загружаем конфигурацию из файла\n config = ConfigFileLoader().load_config()\n \n # Создаем объект WorkflowPersistence\n workflow_persistence = WorkflowPersistence(config)\n \n # Запускаем HTTP-сервер с помощью Uvicorn\n uvicorn_thread_runner = UvicornThreadRunner(\n module,\n host=config.get('http', 'host'),\n port=int(config.get('http', 'port'))\n )\n \n # Инициализируем очередь задач\n task_queue = InMemoryTaskQueue()\n \n # Настраиваем канал связи для взаимодействия между компонентами\n http_control_channel = HttpControlChannel(task_queue, workflow_persistence)\n```\n\n---\n\n### 5. Итоговое объяснение\n\nФункция `create_runtime` выполняет следующие задачи:\n- Загружает конфигурационные параметры из файла.\n- Создает объекты, необходимые для управления рабочим процессом и состояниями (WorkflowPersistence).\n- Запускает HTTP-сервер для приема и обработки входящих запросов.\n- Инициализирует очередь задач для выполнения асинхронных операций.\n- Настраивает каналы связи между различными компонентами системы.\n\nТаким образом, эта функция играет ключевую роль в настройке runtime окружения и обеспечении взаимодействия между различными компонентами приложения.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "create_runtime" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] -} - -## Mismatches -- none \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_091150/full_chain_plba_code_retrieval_plba-fullchain-explain-http-control-channel.json b/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_091150/full_chain_plba_code_retrieval_plba-fullchain-explain-http-control-channel.json deleted file mode 100644 index 24e2a04..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_091150/full_chain_plba_code_retrieval_plba-fullchain-explain-http-control-channel.json +++ /dev/null @@ -1,2564 +0,0 @@ -{ - "case_id": "plba-fullchain-explain-http-control-channel", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_retrieval.yaml", - "runner": "runtime", - "mode": "full_chain", - "actual": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 19, - "llm_answer": "## Анализ класса `HttpControlChannel`\n\n### 1. Общая информация о классе\n\n**Файл:** \n`src/app_runtime/control/http_channel.py`\n\n**Класс:** \n`HttpControlChannel`\n\n**Наследование:** \n`HttpControlChannel(ControlChannel)`\n\n**Роль:** \n`pipeline_stage`\n\n**Описание роли:** \nПроводит чтение и запись атрибутов состояния; участвует в данных срезах потока данных (`dataflow slices`).\n\n---\n\n### 2. Архитектура и структура класса\n\n- **Основное назначение:** \nКласс реализует канал управления для HTTP-коммуникаций. Он обеспечивает взаимодействие с внешним миром через HTTP-запросы и ответы.\n\n- **Связь с другими сущностями:** \n- Наследуется от базового класса `ControlChannel`, который является моделью общего назначения для каналов управления.\n- Участвует в инфраструктуре управления данными потоков (`ControlPlaneService`), обеспечивая работу и интеграцию на уровне всей системы управления (контроля) данными.\n\n---\n\n### 3. Поток данных и обязанности класса\n\n#### Основные обязанности:\n- Чтение и запись атрибутов состояния канала.\n- Участие в обработке данных на этапе \"срезов\" данных (dataflow slices). Это подразумевает участие в разделении и передаче данных между различными этапами обработки информации.\n\n#### Процесс взаимодействия:\n1. Принимает запросы от внешнего мира через HTTP API.\n2. Обрабатывает входные данные и формирует соответствующие ответы.\n3. Передает результаты своей работы в систему контроля и управления (Control Plane Service).\n\n---\n\n### 4. Связи и зависимости\n\n- **Зависимости от других классов и компонентов:**\n - `ControlChannel`: Базовый класс для всех каналов управления.\n - `ControlPlaneService`: Основная служба управления процессом обработки данных.\n - Другие классы и компоненты из модуля `http_channel`.\n\n- **Внешние интерфейсы и взаимодействия:**\n - HTTP-серверы или клиентские библиотеки (например, `uvicorn`), обеспечивающие коммуникацию через HTTP-протокол.\n\n---\n\n### Заключение\n\nКласс `HttpControlChannel` играет важную роль в системе управления данными, обеспечивая взаимодействие с внешними запросами и их обработку через HTTP-протокол. Он наследует основные возможности чтения и записи состояний от базовой модели канала управления и интегрируется в общую структуру контроля данных, обеспечивая свою специфическую функциональность через HTTP-интерфейсы.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "HttpControlChannel" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "passed": true, - "mismatches": [], - "details": { - "case_id": "plba-fullchain-explain-http-control-channel", - "text": "Объясни класс HttpControlChannel", - "mode": "full_chain", - "run_started_at": "2026-03-12T09:11:50", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Объясни класс HttpControlChannel", - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "HttpControlChannel", - "alternatives": [ - "HttpControlChannel" - ], - "confidence": 0.99 - }, - "rag_count": 19, - "rag_rows": [ - { - "path": "src/app_runtime/control/http_channel.py", - "content": "class HttpControlChannel\nHttpControlChannel(ControlChannel)", - "layer": "C1_SYMBOL_CATALOG", - "title": "HttpControlChannel", - "span_start": 12, - "span_end": 57, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "1c9fbdc24819e5604c26ea55428a74310f03a03e1af197ed84846af61e42fdb0", - "qname": "HttpControlChannel", - "kind": "class", - "signature": "HttpControlChannel(ControlChannel)", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.control.http_channel", - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (10)", - "layer": "C4_SEMANTIC_ROLES", - "title": "HttpControlChannel", - "span_start": 12, - "span_end": 57, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 21, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "1c9fbdc24819e5604c26ea55428a74310f03a03e1af197ed84846af61e42fdb0", - "symbol_name": "HttpControlChannel", - "qname": "HttpControlChannel", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 10, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "ControlChannel\nrole: model\n\nResponsibilities:\n- default model role", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlChannel", - "span_start": 21, - "span_end": 28, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 40, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "cfcfe9a311d3a2dbdaf32ac4ccd73c0eb9a117f830591a1c0867ee97d46204ff", - "symbol_name": "ControlChannel", - "qname": "ControlChannel", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "ControlActionSet\nrole: model\n\nResponsibilities:\n- default model role", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlActionSet", - "span_start": 14, - "span_end": 18, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 40, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "46eb026cb3313415ec47b82dd22f84f4d112c9d987e8b1716dcb0baa1cce8988", - "symbol_name": "ControlActionSet", - "qname": "ControlActionSet", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests service\n- reads and writes state attributes\n- participates in dataflow slices (5)", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlPlaneService", - "span_start": 12, - "span_end": 52, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 68, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "b13471e5916986dccffb53fab613812842965705e6b3a89ae549d30c9e91e9aa", - "symbol_name": "ControlPlaneService", - "qname": "ControlPlaneService", - "role": "pipeline_stage", - "confidence": 0.57, - "dataflow_participation": 5, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_runner.py", - "content": "UvicornThreadRunner\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (24)", - "layer": "C4_SEMANTIC_ROLES", - "title": "UvicornThreadRunner", - "span_start": 10, - "span_end": 61, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 11, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "fd55630045a02100df8877ac27d951ee08617d4598764394d48cb51fe067476a", - "symbol_name": "UvicornThreadRunner", - "qname": "UvicornThreadRunner", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 24, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "3779fdd2878b770e789a35bb2a89c9d79f13b61c26d7db1b3b683f9bb9e1623f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "HttpControlAppFactory\nrole: factory\n\nResponsibilities:\n- name suffix suggests factory", - "layer": "C4_SEMANTIC_ROLES", - "title": "HttpControlAppFactory", - "span_start": 15, - "span_end": 53, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 39, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "9b3502a5fb408b273223db13264349cf500de24915b6c649d9ea8970d0dfd8e0", - "symbol_name": "HttpControlAppFactory", - "qname": "HttpControlAppFactory", - "role": "factory", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/persistence/workflow_persistence.py", - "content": "WorkflowPersistence\nrole: pipeline_stage\n\nResponsibilities:\n- orchestrates role-like calls (2)\n- reads and writes state attributes\n- participates in dataflow slices (16)", - "layer": "C4_SEMANTIC_ROLES", - "title": "WorkflowPersistence", - "span_start": 8, - "span_end": 54, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 15, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "7bd01ee45cf31f2d5c2e3e51656254860ac785d10cef9e0852cd4fba90857bae", - "symbol_name": "WorkflowPersistence", - "qname": "WorkflowPersistence", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 16, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "80e9410ddc639789b4353c2a1a757ba8d0d5b5bb6075b0b263b61551f04ae1f0", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/queue/in_memory.py", - "content": "InMemoryTaskQueue\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (9)", - "layer": "C4_SEMANTIC_ROLES", - "title": "InMemoryTaskQueue", - "span_start": 9, - "span_end": 38, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 22, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "2da04cb94544a3bcbf0943a95ad4bdd8710bcafaa32a02fd0e4de2178dcf3533", - "symbol_name": "InMemoryTaskQueue", - "qname": "InMemoryTaskQueue", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 9, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "58f0cc001ccda0eee4c6bc32ed83bd05eafd6b6644f1e8b4aa9eed3103db73dc", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel.__init__\n -> HttpControlChannel._runner\n -> HttpControlChannel.start", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "HttpControlChannel.__init__:dataflow_slice", - "span_start": 15, - "span_end": 22, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "51d73913df709152258ed1b9a8c8f4eb3c575eccfe6b982aef0b28e0789a29da", - "edge_type": "dataflow_slice", - "src_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "src_qname": "HttpControlChannel.__init__", - "dst_symbol_id": "d1933f04137f52535b6525f1b93ff2cd83bfb216b480e887e791ed1714cda8e0", - "dst_ref": "HttpControlChannel.start", - "resolution": "resolved", - "slice_id": "51d73913df709152258ed1b9a8c8f4eb3c575eccfe6b982aef0b28e0789a29da", - "root_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "path_symbols": [ - "HttpControlChannel.__init__", - "HttpControlChannel._runner", - "HttpControlChannel.start" - ], - "path_symbol_ids": [ - "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "d1933f04137f52535b6525f1b93ff2cd83bfb216b480e887e791ed1714cda8e0" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel.__init__\n -> HttpControlChannel._runner\n -> HttpControlChannel.port", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "HttpControlChannel.__init__:dataflow_slice", - "span_start": 15, - "span_end": 29, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "c7167bab7218bb768ad7c11bfb40d1a3096e6071dd7817bba5fd864cf8f6de13", - "edge_type": "dataflow_slice", - "src_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "src_qname": "HttpControlChannel.__init__", - "dst_symbol_id": "3632ce8227f4a31e0768f2fb021a4d1ba28e1202633aa0f2fac902295931280f", - "dst_ref": "HttpControlChannel.port", - "resolution": "resolved", - "slice_id": "c7167bab7218bb768ad7c11bfb40d1a3096e6071dd7817bba5fd864cf8f6de13", - "root_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "path_symbols": [ - "HttpControlChannel.__init__", - "HttpControlChannel._runner", - "HttpControlChannel.port" - ], - "path_symbol_ids": [ - "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "3632ce8227f4a31e0768f2fb021a4d1ba28e1202633aa0f2fac902295931280f" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel.__init__\n -> HttpControlChannel._timeout\n -> HttpControlChannel._health_response", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "HttpControlChannel.__init__:dataflow_slice", - "span_start": 14, - "span_end": 34, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "f858f5c9e575f6c4cdfe3853571b7ee21d1f628a443541d2037c3dc9d0790bef", - "edge_type": "dataflow_slice", - "src_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "src_qname": "HttpControlChannel.__init__", - "dst_symbol_id": "e84bf04e9cd2127df235b7064d05f47e19f19a89c7c82f4c247231d4e8fa426a", - "dst_ref": "HttpControlChannel._health_response", - "resolution": "resolved", - "slice_id": "f858f5c9e575f6c4cdfe3853571b7ee21d1f628a443541d2037c3dc9d0790bef", - "root_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "path_symbols": [ - "HttpControlChannel.__init__", - "HttpControlChannel._timeout", - "HttpControlChannel._health_response" - ], - "path_symbol_ids": [ - "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "e84bf04e9cd2127df235b7064d05f47e19f19a89c7c82f4c247231d4e8fa426a" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel.__init__\n -> HttpControlChannel._timeout\n -> HttpControlChannel._action_response", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "HttpControlChannel.__init__:dataflow_slice", - "span_start": 14, - "span_end": 47, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "c3ef21fcae96c82c00be74b3ab827d4af2085d89cb3fa5521c19a174aad84dbb", - "edge_type": "dataflow_slice", - "src_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "src_qname": "HttpControlChannel.__init__", - "dst_symbol_id": "e64969024ccaeb34d8d91473fad07b3b3d341875846392e7a006406c7ada1954", - "dst_ref": "HttpControlChannel._action_response", - "resolution": "resolved", - "slice_id": "c3ef21fcae96c82c00be74b3ab827d4af2085d89cb3fa5521c19a174aad84dbb", - "root_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "path_symbols": [ - "HttpControlChannel.__init__", - "HttpControlChannel._timeout", - "HttpControlChannel._action_response" - ], - "path_symbol_ids": [ - "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "e64969024ccaeb34d8d91473fad07b3b3d341875846392e7a006406c7ada1954" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel.__init__\n -> HttpControlChannel._runner\n -> HttpControlChannel.stop", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "HttpControlChannel.__init__:dataflow_slice", - "span_start": 15, - "span_end": 25, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "0f827ef81a990258a8a74381c8564a8361afa6712dba3200592659c939adcb9d", - "edge_type": "dataflow_slice", - "src_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "src_qname": "HttpControlChannel.__init__", - "dst_symbol_id": "f29ab212620093d72be20e26c5a399624c7939a6056a728762ed3f84a250bfa3", - "dst_ref": "HttpControlChannel.stop", - "resolution": "resolved", - "slice_id": "0f827ef81a990258a8a74381c8564a8361afa6712dba3200592659c939adcb9d", - "root_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "path_symbols": [ - "HttpControlChannel.__init__", - "HttpControlChannel._runner", - "HttpControlChannel.stop" - ], - "path_symbol_ids": [ - "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "f29ab212620093d72be20e26c5a399624c7939a6056a728762ed3f84a250bfa3" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel.__init__\n -> HttpControlChannel._factory\n -> HttpControlChannel.start", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "HttpControlChannel.__init__:dataflow_slice", - "span_start": 16, - "span_end": 21, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e61ec25ded7dbe380d95ce2abcbc1d7a2d2afde5aa8453866df8706dfb7d6ddb", - "edge_type": "dataflow_slice", - "src_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "src_qname": "HttpControlChannel.__init__", - "dst_symbol_id": "d1933f04137f52535b6525f1b93ff2cd83bfb216b480e887e791ed1714cda8e0", - "dst_ref": "HttpControlChannel.start", - "resolution": "resolved", - "slice_id": "e61ec25ded7dbe380d95ce2abcbc1d7a2d2afde5aa8453866df8706dfb7d6ddb", - "root_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "path_symbols": [ - "HttpControlChannel.__init__", - "HttpControlChannel._factory", - "HttpControlChannel.start" - ], - "path_symbol_ids": [ - "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "d1933f04137f52535b6525f1b93ff2cd83bfb216b480e887e791ed1714cda8e0" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "class HttpControlChannel(ControlChannel):\n def __init__(self, host: str, port: int, timeout: int) -> None:\n self._timeout = timeout\n self._runner = UvicornThreadRunner(host, port, timeout)\n self._factory = HttpControlAppFactory()\n self._actions: ControlActionSet | None = None\n\n async def start(self, actions: ControlActionSet) -> None:\n self._actions = actions\n app = self._factory.create(self._health_response, self._action_response)\n await self._runner.start(app)\n\n async def stop(self) -> None:\n await self._runner.stop()\n\n @property\n def port(self) -> int:\n return self._runner.port\n\n async def _health_response(self) -> dict[str, object]:\n if self._actions is None:\n return {\"status\": \"unhealthy\", \"detail\": \"control actions are not configured\"}\n return await asyncio.wait_for(self._actions.health(), timeout=float(self._timeout))\n\n async def _action_response(self, action: str, _client_source: str = \"unknown\") -> JSONResponse:\n if self._actions is None:\n return JSONResponse(content={\"status\": \"error\", \"detail\": f\"{action} handler is not configured\"}, status_code=404)\n callbacks = {\n \"start\": self._actions.start,\n \"stop\": self._actions.stop,\n \"status\": self._actions.status,\n }\n callback = callbacks.get(action)\n if callback is None:\n return JSONResponse(content={\"status\": \"error\", \"detail\": f\"unsupported action: {action}\"}, status_code=404)\n action_timeout = max(float(self._timeout), 10.0) if action in {\"start\", \"stop\"} else float(self._timeout)\n try:\n detail = await asyncio.wait_for(callback(), timeout=action_timeout)\n except asyncio.TimeoutError:\n return JSONResponse(\n content={\"status\": \"accepted\", \"detail\": f\"{action} operation is still in progress\"},\n status_code=202,\n )\n except Exception as exc:\n return JSONResponse(content={\"status\": \"error\", \"detail\": str(exc)}, status_code=500)\n return JSONResponse(content={\"status\": \"ok\", \"detail\": detail or f\"{action} action accepted\"}, status_code=200)", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/http_channel.py:HttpControlChannel", - "span_start": 12, - "span_end": 57, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.http_channel", - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "llm_answer": "## Анализ класса `HttpControlChannel`\n\n### 1. Общая информация о классе\n\n**Файл:** \n`src/app_runtime/control/http_channel.py`\n\n**Класс:** \n`HttpControlChannel`\n\n**Наследование:** \n`HttpControlChannel(ControlChannel)`\n\n**Роль:** \n`pipeline_stage`\n\n**Описание роли:** \nПроводит чтение и запись атрибутов состояния; участвует в данных срезах потока данных (`dataflow slices`).\n\n---\n\n### 2. Архитектура и структура класса\n\n- **Основное назначение:** \nКласс реализует канал управления для HTTP-коммуникаций. Он обеспечивает взаимодействие с внешним миром через HTTP-запросы и ответы.\n\n- **Связь с другими сущностями:** \n- Наследуется от базового класса `ControlChannel`, который является моделью общего назначения для каналов управления.\n- Участвует в инфраструктуре управления данными потоков (`ControlPlaneService`), обеспечивая работу и интеграцию на уровне всей системы управления (контроля) данными.\n\n---\n\n### 3. Поток данных и обязанности класса\n\n#### Основные обязанности:\n- Чтение и запись атрибутов состояния канала.\n- Участие в обработке данных на этапе \"срезов\" данных (dataflow slices). Это подразумевает участие в разделении и передаче данных между различными этапами обработки информации.\n\n#### Процесс взаимодействия:\n1. Принимает запросы от внешнего мира через HTTP API.\n2. Обрабатывает входные данные и формирует соответствующие ответы.\n3. Передает результаты своей работы в систему контроля и управления (Control Plane Service).\n\n---\n\n### 4. Связи и зависимости\n\n- **Зависимости от других классов и компонентов:**\n - `ControlChannel`: Базовый класс для всех каналов управления.\n - `ControlPlaneService`: Основная служба управления процессом обработки данных.\n - Другие классы и компоненты из модуля `http_channel`.\n\n- **Внешние интерфейсы и взаимодействия:**\n - HTTP-серверы или клиентские библиотеки (например, `uvicorn`), обеспечивающие коммуникацию через HTTP-протокол.\n\n---\n\n### Заключение\n\nКласс `HttpControlChannel` играет важную роль в системе управления данными, обеспечивая взаимодействие с внешними запросами и их обработку через HTTP-протокол. Он наследует основные возможности чтения и записи состояний от базовой модели канала управления и интегрируется в общую структуру контроля данных, обеспечивая свою специфическую функциональность через HTTP-интерфейсы.", - "summary": { - "router": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "confidence": null - }, - "retrieval": { - "profile": "code", - "layers_hit": [ - "C0_SOURCE_CHUNKS", - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS", - "C4_SEMANTIC_ROLES" - ], - "evidence_sufficient": true - }, - "llm": { - "answer_status": "answered", - "groundedness": "grounded" - } - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "HttpControlChannel" - ], - "keyword_hints": [ - "HttpControlChannel" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C0_SOURCE_CHUNKS": "exact_path_fetch", - "C4_SEMANTIC_ROLES": "exact_path_fetch", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C3_ENTRYPOINTS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 8, - "C4_SEMANTIC_ROLES": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C3_ENTRYPOINTS": 6 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C4_SEMANTIC_ROLES": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "HttpControlChannel", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Объясни класс HttpControlChannel", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C4_SEMANTIC_ROLES", - "query": "Объясни класс HttpControlChannel", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "Объясни класс HttpControlChannel", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - }, - { - "layer": "C3_ENTRYPOINTS", - "query": "Объясни класс HttpControlChannel", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 1, - "candidates_after_filter": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 6, - "candidates_after_filter": 6 - }, - { - "layer": "C3_ENTRYPOINTS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 3, - "candidates_after_filter": 3 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "HttpControlChannel", - "alternatives": [ - "HttpControlChannel" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C4_SEMANTIC_ROLES", - "status": "hit", - "hit_count": 8, - "fail_reason": null - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 6, - "fail_reason": null - }, - { - "layer": "C3_ENTRYPOINTS", - "status": "hit", - "hit_count": 3, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "router": 1, - "symbol_resolution": 0, - "retrieval_total": 173, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 53, - "C0_SOURCE_CHUNKS": 23, - "C4_SEMANTIC_ROLES": 21, - "C2_DEPENDENCY_GRAPH": 63, - "C3_ENTRYPOINTS": 12 - }, - "merge_rank": 29, - "prompt_build": 0, - "llm_call": 5309 - }, - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 329, - "evidence_rows": 19, - "evidence_chars": 3845 - }, - "evidence_summary": [ - { - "layer": "C1_SYMBOL_CATALOG", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "count": 8, - "unique_paths": 7 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "count": 6, - "unique_paths": 1 - }, - { - "layer": "C3_ENTRYPOINTS", - "count": 3, - "unique_paths": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 1, - "unique_paths": 1 - } - ], - "prompt_template_id": "intent_code_qa_v1", - "system_prompt_version": "v1" - }, - "router": { - "conversation_mode": "START", - "keyword_hints": [ - "HttpControlChannel" - ], - "path_scope": [] - }, - "llm": { - "used_evidence_count": 19, - "missing_evidence_reason": null - } - }, - "run_info": { - "case_id": "plba-fullchain-explain-http-control-channel", - "mode": "full_chain", - "run_started_at": "2026-03-12T09:11:50", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - }, - "input_request": { - "text": "Объясни класс HttpControlChannel", - "normalized_query": "Объясни класс HttpControlChannel" - }, - "steps": [ - { - "step": "intent_router", - "input": { - "query": "Объясни класс HttpControlChannel" - }, - "output": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Объясни класс HttpControlChannel" - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "HttpControlChannel" - ], - "keyword_hints": [ - "HttpControlChannel" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "timings_ms": { - "router": 1 - } - } - }, - { - "step": "retrieval", - "input": { - "query": "Объясни класс HttpControlChannel" - }, - "output": { - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "HttpControlChannel", - "alternatives": [ - "HttpControlChannel" - ], - "confidence": 0.99 - }, - "rag_count": 19, - "rag_rows": [ - { - "path": "src/app_runtime/control/http_channel.py", - "content": "class HttpControlChannel\nHttpControlChannel(ControlChannel)", - "layer": "C1_SYMBOL_CATALOG", - "title": "HttpControlChannel", - "span_start": 12, - "span_end": 57, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "1c9fbdc24819e5604c26ea55428a74310f03a03e1af197ed84846af61e42fdb0", - "qname": "HttpControlChannel", - "kind": "class", - "signature": "HttpControlChannel(ControlChannel)", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.control.http_channel", - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (10)", - "layer": "C4_SEMANTIC_ROLES", - "title": "HttpControlChannel", - "span_start": 12, - "span_end": 57, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 21, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "1c9fbdc24819e5604c26ea55428a74310f03a03e1af197ed84846af61e42fdb0", - "symbol_name": "HttpControlChannel", - "qname": "HttpControlChannel", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 10, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "ControlChannel\nrole: model\n\nResponsibilities:\n- default model role", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlChannel", - "span_start": 21, - "span_end": 28, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 40, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "cfcfe9a311d3a2dbdaf32ac4ccd73c0eb9a117f830591a1c0867ee97d46204ff", - "symbol_name": "ControlChannel", - "qname": "ControlChannel", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "ControlActionSet\nrole: model\n\nResponsibilities:\n- default model role", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlActionSet", - "span_start": 14, - "span_end": 18, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 40, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "46eb026cb3313415ec47b82dd22f84f4d112c9d987e8b1716dcb0baa1cce8988", - "symbol_name": "ControlActionSet", - "qname": "ControlActionSet", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests service\n- reads and writes state attributes\n- participates in dataflow slices (5)", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlPlaneService", - "span_start": 12, - "span_end": 52, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 68, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "b13471e5916986dccffb53fab613812842965705e6b3a89ae549d30c9e91e9aa", - "symbol_name": "ControlPlaneService", - "qname": "ControlPlaneService", - "role": "pipeline_stage", - "confidence": 0.57, - "dataflow_participation": 5, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_runner.py", - "content": "UvicornThreadRunner\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (24)", - "layer": "C4_SEMANTIC_ROLES", - "title": "UvicornThreadRunner", - "span_start": 10, - "span_end": 61, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 11, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "fd55630045a02100df8877ac27d951ee08617d4598764394d48cb51fe067476a", - "symbol_name": "UvicornThreadRunner", - "qname": "UvicornThreadRunner", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 24, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "3779fdd2878b770e789a35bb2a89c9d79f13b61c26d7db1b3b683f9bb9e1623f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "HttpControlAppFactory\nrole: factory\n\nResponsibilities:\n- name suffix suggests factory", - "layer": "C4_SEMANTIC_ROLES", - "title": "HttpControlAppFactory", - "span_start": 15, - "span_end": 53, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 39, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "9b3502a5fb408b273223db13264349cf500de24915b6c649d9ea8970d0dfd8e0", - "symbol_name": "HttpControlAppFactory", - "qname": "HttpControlAppFactory", - "role": "factory", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/persistence/workflow_persistence.py", - "content": "WorkflowPersistence\nrole: pipeline_stage\n\nResponsibilities:\n- orchestrates role-like calls (2)\n- reads and writes state attributes\n- participates in dataflow slices (16)", - "layer": "C4_SEMANTIC_ROLES", - "title": "WorkflowPersistence", - "span_start": 8, - "span_end": 54, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 15, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "7bd01ee45cf31f2d5c2e3e51656254860ac785d10cef9e0852cd4fba90857bae", - "symbol_name": "WorkflowPersistence", - "qname": "WorkflowPersistence", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 16, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "80e9410ddc639789b4353c2a1a757ba8d0d5b5bb6075b0b263b61551f04ae1f0", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/queue/in_memory.py", - "content": "InMemoryTaskQueue\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (9)", - "layer": "C4_SEMANTIC_ROLES", - "title": "InMemoryTaskQueue", - "span_start": 9, - "span_end": 38, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 22, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "2da04cb94544a3bcbf0943a95ad4bdd8710bcafaa32a02fd0e4de2178dcf3533", - "symbol_name": "InMemoryTaskQueue", - "qname": "InMemoryTaskQueue", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 9, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "58f0cc001ccda0eee4c6bc32ed83bd05eafd6b6644f1e8b4aa9eed3103db73dc", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel.__init__\n -> HttpControlChannel._runner\n -> HttpControlChannel.start", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "HttpControlChannel.__init__:dataflow_slice", - "span_start": 15, - "span_end": 22, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "51d73913df709152258ed1b9a8c8f4eb3c575eccfe6b982aef0b28e0789a29da", - "edge_type": "dataflow_slice", - "src_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "src_qname": "HttpControlChannel.__init__", - "dst_symbol_id": "d1933f04137f52535b6525f1b93ff2cd83bfb216b480e887e791ed1714cda8e0", - "dst_ref": "HttpControlChannel.start", - "resolution": "resolved", - "slice_id": "51d73913df709152258ed1b9a8c8f4eb3c575eccfe6b982aef0b28e0789a29da", - "root_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "path_symbols": [ - "HttpControlChannel.__init__", - "HttpControlChannel._runner", - "HttpControlChannel.start" - ], - "path_symbol_ids": [ - "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "d1933f04137f52535b6525f1b93ff2cd83bfb216b480e887e791ed1714cda8e0" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel.__init__\n -> HttpControlChannel._runner\n -> HttpControlChannel.port", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "HttpControlChannel.__init__:dataflow_slice", - "span_start": 15, - "span_end": 29, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "c7167bab7218bb768ad7c11bfb40d1a3096e6071dd7817bba5fd864cf8f6de13", - "edge_type": "dataflow_slice", - "src_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "src_qname": "HttpControlChannel.__init__", - "dst_symbol_id": "3632ce8227f4a31e0768f2fb021a4d1ba28e1202633aa0f2fac902295931280f", - "dst_ref": "HttpControlChannel.port", - "resolution": "resolved", - "slice_id": "c7167bab7218bb768ad7c11bfb40d1a3096e6071dd7817bba5fd864cf8f6de13", - "root_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "path_symbols": [ - "HttpControlChannel.__init__", - "HttpControlChannel._runner", - "HttpControlChannel.port" - ], - "path_symbol_ids": [ - "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "3632ce8227f4a31e0768f2fb021a4d1ba28e1202633aa0f2fac902295931280f" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel.__init__\n -> HttpControlChannel._timeout\n -> HttpControlChannel._health_response", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "HttpControlChannel.__init__:dataflow_slice", - "span_start": 14, - "span_end": 34, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "f858f5c9e575f6c4cdfe3853571b7ee21d1f628a443541d2037c3dc9d0790bef", - "edge_type": "dataflow_slice", - "src_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "src_qname": "HttpControlChannel.__init__", - "dst_symbol_id": "e84bf04e9cd2127df235b7064d05f47e19f19a89c7c82f4c247231d4e8fa426a", - "dst_ref": "HttpControlChannel._health_response", - "resolution": "resolved", - "slice_id": "f858f5c9e575f6c4cdfe3853571b7ee21d1f628a443541d2037c3dc9d0790bef", - "root_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "path_symbols": [ - "HttpControlChannel.__init__", - "HttpControlChannel._timeout", - "HttpControlChannel._health_response" - ], - "path_symbol_ids": [ - "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "e84bf04e9cd2127df235b7064d05f47e19f19a89c7c82f4c247231d4e8fa426a" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel.__init__\n -> HttpControlChannel._timeout\n -> HttpControlChannel._action_response", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "HttpControlChannel.__init__:dataflow_slice", - "span_start": 14, - "span_end": 47, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "c3ef21fcae96c82c00be74b3ab827d4af2085d89cb3fa5521c19a174aad84dbb", - "edge_type": "dataflow_slice", - "src_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "src_qname": "HttpControlChannel.__init__", - "dst_symbol_id": "e64969024ccaeb34d8d91473fad07b3b3d341875846392e7a006406c7ada1954", - "dst_ref": "HttpControlChannel._action_response", - "resolution": "resolved", - "slice_id": "c3ef21fcae96c82c00be74b3ab827d4af2085d89cb3fa5521c19a174aad84dbb", - "root_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "path_symbols": [ - "HttpControlChannel.__init__", - "HttpControlChannel._timeout", - "HttpControlChannel._action_response" - ], - "path_symbol_ids": [ - "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "e64969024ccaeb34d8d91473fad07b3b3d341875846392e7a006406c7ada1954" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel.__init__\n -> HttpControlChannel._runner\n -> HttpControlChannel.stop", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "HttpControlChannel.__init__:dataflow_slice", - "span_start": 15, - "span_end": 25, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "0f827ef81a990258a8a74381c8564a8361afa6712dba3200592659c939adcb9d", - "edge_type": "dataflow_slice", - "src_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "src_qname": "HttpControlChannel.__init__", - "dst_symbol_id": "f29ab212620093d72be20e26c5a399624c7939a6056a728762ed3f84a250bfa3", - "dst_ref": "HttpControlChannel.stop", - "resolution": "resolved", - "slice_id": "0f827ef81a990258a8a74381c8564a8361afa6712dba3200592659c939adcb9d", - "root_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "path_symbols": [ - "HttpControlChannel.__init__", - "HttpControlChannel._runner", - "HttpControlChannel.stop" - ], - "path_symbol_ids": [ - "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "f29ab212620093d72be20e26c5a399624c7939a6056a728762ed3f84a250bfa3" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel.__init__\n -> HttpControlChannel._factory\n -> HttpControlChannel.start", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "HttpControlChannel.__init__:dataflow_slice", - "span_start": 16, - "span_end": 21, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e61ec25ded7dbe380d95ce2abcbc1d7a2d2afde5aa8453866df8706dfb7d6ddb", - "edge_type": "dataflow_slice", - "src_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "src_qname": "HttpControlChannel.__init__", - "dst_symbol_id": "d1933f04137f52535b6525f1b93ff2cd83bfb216b480e887e791ed1714cda8e0", - "dst_ref": "HttpControlChannel.start", - "resolution": "resolved", - "slice_id": "e61ec25ded7dbe380d95ce2abcbc1d7a2d2afde5aa8453866df8706dfb7d6ddb", - "root_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "path_symbols": [ - "HttpControlChannel.__init__", - "HttpControlChannel._factory", - "HttpControlChannel.start" - ], - "path_symbol_ids": [ - "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "d1933f04137f52535b6525f1b93ff2cd83bfb216b480e887e791ed1714cda8e0" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "class HttpControlChannel(ControlChannel):\n def __init__(self, host: str, port: int, timeout: int) -> None:\n self._timeout = timeout\n self._runner = UvicornThreadRunner(host, port, timeout)\n self._factory = HttpControlAppFactory()\n self._actions: ControlActionSet | None = None\n\n async def start(self, actions: ControlActionSet) -> None:\n self._actions = actions\n app = self._factory.create(self._health_response, self._action_response)\n await self._runner.start(app)\n\n async def stop(self) -> None:\n await self._runner.stop()\n\n @property\n def port(self) -> int:\n return self._runner.port\n\n async def _health_response(self) -> dict[str, object]:\n if self._actions is None:\n return {\"status\": \"unhealthy\", \"detail\": \"control actions are not configured\"}\n return await asyncio.wait_for(self._actions.health(), timeout=float(self._timeout))\n\n async def _action_response(self, action: str, _client_source: str = \"unknown\") -> JSONResponse:\n if self._actions is None:\n return JSONResponse(content={\"status\": \"error\", \"detail\": f\"{action} handler is not configured\"}, status_code=404)\n callbacks = {\n \"start\": self._actions.start,\n \"stop\": self._actions.stop,\n \"status\": self._actions.status,\n }\n callback = callbacks.get(action)\n if callback is None:\n return JSONResponse(content={\"status\": \"error\", \"detail\": f\"unsupported action: {action}\"}, status_code=404)\n action_timeout = max(float(self._timeout), 10.0) if action in {\"start\", \"stop\"} else float(self._timeout)\n try:\n detail = await asyncio.wait_for(callback(), timeout=action_timeout)\n except asyncio.TimeoutError:\n return JSONResponse(\n content={\"status\": \"accepted\", \"detail\": f\"{action} operation is still in progress\"},\n status_code=202,\n )\n except Exception as exc:\n return JSONResponse(content={\"status\": \"error\", \"detail\": str(exc)}, status_code=500)\n return JSONResponse(content={\"status\": \"ok\", \"detail\": detail or f\"{action} action accepted\"}, status_code=200)", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/http_channel.py:HttpControlChannel", - "span_start": 12, - "span_end": 57, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.http_channel", - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ] - }, - "diagnostics": { - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C0_SOURCE_CHUNKS": "exact_path_fetch", - "C4_SEMANTIC_ROLES": "exact_path_fetch", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C3_ENTRYPOINTS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 8, - "C4_SEMANTIC_ROLES": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C3_ENTRYPOINTS": 6 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C4_SEMANTIC_ROLES": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "HttpControlChannel", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Объясни класс HttpControlChannel", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C4_SEMANTIC_ROLES", - "query": "Объясни класс HttpControlChannel", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "Объясни класс HttpControlChannel", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - }, - { - "layer": "C3_ENTRYPOINTS", - "query": "Объясни класс HttpControlChannel", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 1, - "candidates_after_filter": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 6, - "candidates_after_filter": 6 - }, - { - "layer": "C3_ENTRYPOINTS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 3, - "candidates_after_filter": 3 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "HttpControlChannel", - "alternatives": [ - "HttpControlChannel" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C4_SEMANTIC_ROLES", - "status": "hit", - "hit_count": 8, - "fail_reason": null - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 6, - "fail_reason": null - }, - { - "layer": "C3_ENTRYPOINTS", - "status": "hit", - "hit_count": 3, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "symbol_resolution": 0, - "retrieval_total": 173, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 53, - "C0_SOURCE_CHUNKS": 23, - "C4_SEMANTIC_ROLES": 21, - "C2_DEPENDENCY_GRAPH": 63, - "C3_ENTRYPOINTS": 12 - }, - "merge_rank": 29 - } - } - }, - { - "step": "llm_answer", - "input": { - "query": "Объясни класс HttpControlChannel", - "rag_count": 19 - }, - "output": { - "llm_answer": "## Анализ класса `HttpControlChannel`\n\n### 1. Общая информация о классе\n\n**Файл:** \n`src/app_runtime/control/http_channel.py`\n\n**Класс:** \n`HttpControlChannel`\n\n**Наследование:** \n`HttpControlChannel(ControlChannel)`\n\n**Роль:** \n`pipeline_stage`\n\n**Описание роли:** \nПроводит чтение и запись атрибутов состояния; участвует в данных срезах потока данных (`dataflow slices`).\n\n---\n\n### 2. Архитектура и структура класса\n\n- **Основное назначение:** \nКласс реализует канал управления для HTTP-коммуникаций. Он обеспечивает взаимодействие с внешним миром через HTTP-запросы и ответы.\n\n- **Связь с другими сущностями:** \n- Наследуется от базового класса `ControlChannel`, который является моделью общего назначения для каналов управления.\n- Участвует в инфраструктуре управления данными потоков (`ControlPlaneService`), обеспечивая работу и интеграцию на уровне всей системы управления (контроля) данными.\n\n---\n\n### 3. Поток данных и обязанности класса\n\n#### Основные обязанности:\n- Чтение и запись атрибутов состояния канала.\n- Участие в обработке данных на этапе \"срезов\" данных (dataflow slices). Это подразумевает участие в разделении и передаче данных между различными этапами обработки информации.\n\n#### Процесс взаимодействия:\n1. Принимает запросы от внешнего мира через HTTP API.\n2. Обрабатывает входные данные и формирует соответствующие ответы.\n3. Передает результаты своей работы в систему контроля и управления (Control Plane Service).\n\n---\n\n### 4. Связи и зависимости\n\n- **Зависимости от других классов и компонентов:**\n - `ControlChannel`: Базовый класс для всех каналов управления.\n - `ControlPlaneService`: Основная служба управления процессом обработки данных.\n - Другие классы и компоненты из модуля `http_channel`.\n\n- **Внешние интерфейсы и взаимодействия:**\n - HTTP-серверы или клиентские библиотеки (например, `uvicorn`), обеспечивающие коммуникацию через HTTP-протокол.\n\n---\n\n### Заключение\n\nКласс `HttpControlChannel` играет важную роль в системе управления данными, обеспечивая взаимодействие с внешними запросами и их обработку через HTTP-протокол. Он наследует основные возможности чтения и записи состояний от базовой модели канала управления и интегрируется в общую структуру контроля данных, обеспечивая свою специфическую функциональность через HTTP-интерфейсы." - }, - "diagnostics": { - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 329, - "evidence_rows": 19, - "evidence_chars": 3845 - }, - "evidence_summary": [ - { - "layer": "C1_SYMBOL_CATALOG", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "count": 8, - "unique_paths": 7 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "count": 6, - "unique_paths": 1 - }, - { - "layer": "C3_ENTRYPOINTS", - "count": 3, - "unique_paths": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 1, - "unique_paths": 1 - } - ], - "prompt_template_id": "intent_code_qa_v1", - "system_prompt_version": "v1" - }, - "timings_ms": { - "prompt_build": 0, - "llm_call": 5309 - } - } - } - ] - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_091150/full_chain_plba_code_retrieval_plba-fullchain-explain-http-control-channel.md b/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_091150/full_chain_plba_code_retrieval_plba-fullchain-explain-http-control-channel.md deleted file mode 100644 index afb60ad..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_091150/full_chain_plba_code_retrieval_plba-fullchain-explain-http-control-channel.md +++ /dev/null @@ -1,34 +0,0 @@ -# plba-fullchain-explain-http-control-channel - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_retrieval.yaml -- runner: runtime -- mode: full_chain -- passed: True - -## Query -Объясни класс HttpControlChannel - -## Actual -{ - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 19, - "llm_answer": "## Анализ класса `HttpControlChannel`\n\n### 1. Общая информация о классе\n\n**Файл:** \n`src/app_runtime/control/http_channel.py`\n\n**Класс:** \n`HttpControlChannel`\n\n**Наследование:** \n`HttpControlChannel(ControlChannel)`\n\n**Роль:** \n`pipeline_stage`\n\n**Описание роли:** \nПроводит чтение и запись атрибутов состояния; участвует в данных срезах потока данных (`dataflow slices`).\n\n---\n\n### 2. Архитектура и структура класса\n\n- **Основное назначение:** \nКласс реализует канал управления для HTTP-коммуникаций. Он обеспечивает взаимодействие с внешним миром через HTTP-запросы и ответы.\n\n- **Связь с другими сущностями:** \n- Наследуется от базового класса `ControlChannel`, который является моделью общего назначения для каналов управления.\n- Участвует в инфраструктуре управления данными потоков (`ControlPlaneService`), обеспечивая работу и интеграцию на уровне всей системы управления (контроля) данными.\n\n---\n\n### 3. Поток данных и обязанности класса\n\n#### Основные обязанности:\n- Чтение и запись атрибутов состояния канала.\n- Участие в обработке данных на этапе \"срезов\" данных (dataflow slices). Это подразумевает участие в разделении и передаче данных между различными этапами обработки информации.\n\n#### Процесс взаимодействия:\n1. Принимает запросы от внешнего мира через HTTP API.\n2. Обрабатывает входные данные и формирует соответствующие ответы.\n3. Передает результаты своей работы в систему контроля и управления (Control Plane Service).\n\n---\n\n### 4. Связи и зависимости\n\n- **Зависимости от других классов и компонентов:**\n - `ControlChannel`: Базовый класс для всех каналов управления.\n - `ControlPlaneService`: Основная служба управления процессом обработки данных.\n - Другие классы и компоненты из модуля `http_channel`.\n\n- **Внешние интерфейсы и взаимодействия:**\n - HTTP-серверы или клиентские библиотеки (например, `uvicorn`), обеспечивающие коммуникацию через HTTP-протокол.\n\n---\n\n### Заключение\n\nКласс `HttpControlChannel` играет важную роль в системе управления данными, обеспечивая взаимодействие с внешними запросами и их обработку через HTTP-протокол. Он наследует основные возможности чтения и записи состояний от базовой модели канала управления и интегрируется в общую структуру контроля данных, обеспечивая свою специфическую функциональность через HTTP-интерфейсы.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "HttpControlChannel" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] -} - -## Mismatches -- none \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_091150/full_chain_plba_code_retrieval_plba-fullchain-explain-runtime-manager.json b/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_091150/full_chain_plba_code_retrieval_plba-fullchain-explain-runtime-manager.json deleted file mode 100644 index 76d4500..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_091150/full_chain_plba_code_retrieval_plba-fullchain-explain-runtime-manager.json +++ /dev/null @@ -1,2564 +0,0 @@ -{ - "case_id": "plba-fullchain-explain-runtime-manager", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_retrieval.yaml", - "runner": "runtime", - "mode": "full_chain", - "actual": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 19, - "llm_answer": "## Анализ класса `RuntimeManager`\n\n### Файл и путь:\n`src/app_runtime/core/runtime.py`\n\n### Описание класса:\n**Класс:** `RuntimeManager`\n\n**Роль:** \n- Менеджер роли (pipeline_stage)\n- Оркестратор вызовов ролей (4)\n- Читает и записывает состояние атрибутов\n- Участвует в срезах потока данных (50)\n\n### Основные обязанности и ответственность:\n1. **Менеджер состояния**: Класс управляет состоянием системы и отвечает за его изменение при выполнении различных операций.\n \n2. **Оркестровка ролей**: Он координирует выполнение этапов обработки данных (roles) внутри конвейера (pipeline). Каждый этап выполняет определенную роль, например, чтение или запись состояний, обработку данных и т.д.\n\n3. **Чтение и запись состояний**: Класс поддерживает и обновляет внутренние состояния приложения через атрибуты объекта.\n\n4. **Участие в потоке данных**: Управление потоком данных происходит на уровне «срезов» (slices), что означает, что класс участвует в разделении и передаче данных между различными компонентами системы.\n\n---\n\n### Поток данных и архитектура:\n\n#### Входные данные\n- Данные поступают из внешнего источника или из предыдущего этапа конвейера.\n\n#### Логика работы:\n1. При инициализации экземпляра класса создаются начальные атрибуты состояния (`state_attributes`), которые представляют текущую информацию о системе.\n2. Для выполнения операций используется метод, принимающий внешние действия (`perform_action`) и аргументы для этих действий.\n - Пример метода: `perform_action(self, action_name, *args)`\n - В аргументах передаются имя действия и параметры, необходимые для этого действия.\n3. Внутри `perform_action` проверяется корректность входных параметров и вызывается соответствующая логика для выполнения нужного действия.\n4. После выполнения действия изменяется внутреннее состояние системы путем записи нового значения атрибута состояния.\n5. Информация передается следующему этапу конвейера.\n\n#### Выходные данные\n- Результат обработки передается дальше по конвейеру или возвращается клиенту, если это конечный результат.\n\n---\n\n### Ключевые компоненты и зависимости:\n- Внутренние атрибуты состояния (`state_attributes`): хранят текущее состояние системы, доступное для чтения и изменения.\n- Методы для выполнения конкретных действий (метод `perform_action`):\n - Вызывают соответствующие методы других компонентов или классов.\n \n### Пример использования:\n```python\n# Инициализация менеджера\nruntime_manager = RuntimeManager()\n\n# Выполнение действия с аргументами\nresult = runtime_manager.perform_action('action_name', arg1, arg2)\n```\n\n---\n\n### Заключение:\nКласс `RuntimeManager` играет ключевую роль в управлении состоянием и координацией выполнения этапов обработки данных в приложении. Его использование позволяет централизованно управлять потоком данных и обеспечивать согласованность состояния приложения на каждом этапе обработки.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "RuntimeManager" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "passed": true, - "mismatches": [], - "details": { - "case_id": "plba-fullchain-explain-runtime-manager", - "text": "Объясни как работает класс RuntimeManager", - "mode": "full_chain", - "run_started_at": "2026-03-12T09:11:50", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Объясни как работает класс RuntimeManager", - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "RuntimeManager", - "alternatives": [ - "RuntimeManager" - ], - "confidence": 0.99 - }, - "rag_count": 19, - "rag_rows": [ - { - "path": "src/app_runtime/core/runtime.py", - "content": "class RuntimeManager\nRuntimeManager", - "layer": "C1_SYMBOL_CATALOG", - "title": "RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "7e4a9381328c5803bbc6179458612fc4e947d928aa7bf8b4b2bebb2c8592f758", - "qname": "RuntimeManager", - "kind": "class", - "signature": "RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.core.runtime", - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests manager\n- orchestrates role-like calls (4)\n- reads and writes state attributes\n- participates in dataflow slices (50)", - "layer": "C4_SEMANTIC_ROLES", - "title": "RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 43, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "7e4a9381328c5803bbc6179458612fc4e947d928aa7bf8b4b2bebb2c8592f758", - "symbol_name": "RuntimeManager", - "qname": "RuntimeManager", - "role": "pipeline_stage", - "confidence": 0.67, - "dataflow_participation": 50, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "ControlChannel\nrole: model\n\nResponsibilities:\n- default model role", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlChannel", - "span_start": 21, - "span_end": 28, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 40, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "cfcfe9a311d3a2dbdaf32ac4ccd73c0eb9a117f830591a1c0867ee97d46204ff", - "symbol_name": "ControlChannel", - "qname": "ControlChannel", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "ControlActionSet\nrole: model\n\nResponsibilities:\n- default model role", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlActionSet", - "span_start": 14, - "span_end": 18, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 40, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "46eb026cb3313415ec47b82dd22f84f4d112c9d987e8b1716dcb0baa1cce8988", - "symbol_name": "ControlActionSet", - "qname": "ControlActionSet", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests service\n- reads and writes state attributes\n- participates in dataflow slices (5)", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlPlaneService", - "span_start": 12, - "span_end": 52, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 68, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "b13471e5916986dccffb53fab613812842965705e6b3a89ae549d30c9e91e9aa", - "symbol_name": "ControlPlaneService", - "qname": "ControlPlaneService", - "role": "pipeline_stage", - "confidence": 0.57, - "dataflow_participation": 5, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_runner.py", - "content": "UvicornThreadRunner\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (24)", - "layer": "C4_SEMANTIC_ROLES", - "title": "UvicornThreadRunner", - "span_start": 10, - "span_end": 61, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 11, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "fd55630045a02100df8877ac27d951ee08617d4598764394d48cb51fe067476a", - "symbol_name": "UvicornThreadRunner", - "qname": "UvicornThreadRunner", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 24, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "3779fdd2878b770e789a35bb2a89c9d79f13b61c26d7db1b3b683f9bb9e1623f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (10)", - "layer": "C4_SEMANTIC_ROLES", - "title": "HttpControlChannel", - "span_start": 12, - "span_end": 57, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 21, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "1c9fbdc24819e5604c26ea55428a74310f03a03e1af197ed84846af61e42fdb0", - "symbol_name": "HttpControlChannel", - "qname": "HttpControlChannel", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 10, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "HttpControlAppFactory\nrole: factory\n\nResponsibilities:\n- name suffix suggests factory", - "layer": "C4_SEMANTIC_ROLES", - "title": "HttpControlAppFactory", - "span_start": 15, - "span_end": 53, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 39, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "9b3502a5fb408b273223db13264349cf500de24915b6c649d9ea8970d0dfd8e0", - "symbol_name": "HttpControlAppFactory", - "qname": "HttpControlAppFactory", - "role": "factory", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/persistence/workflow_persistence.py", - "content": "WorkflowPersistence\nrole: pipeline_stage\n\nResponsibilities:\n- orchestrates role-like calls (2)\n- reads and writes state attributes\n- participates in dataflow slices (16)", - "layer": "C4_SEMANTIC_ROLES", - "title": "WorkflowPersistence", - "span_start": 8, - "span_end": 54, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 15, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "7bd01ee45cf31f2d5c2e3e51656254860ac785d10cef9e0852cd4fba90857bae", - "symbol_name": "WorkflowPersistence", - "qname": "WorkflowPersistence", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 16, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "80e9410ddc639789b4353c2a1a757ba8d0d5b5bb6075b0b263b61551f04ae1f0", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.stop", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 25, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d", - "dst_ref": "ControlPlaneService.stop", - "resolution": "resolved", - "slice_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.stop" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._stop_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 51, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a", - "dst_ref": "ControlPlaneService._stop_async", - "resolution": "resolved", - "slice_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._stop_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.register_channel", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 17, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957", - "dst_ref": "ControlPlaneService.register_channel", - "resolution": "resolved", - "slice_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.register_channel" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.start", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 20, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154", - "dst_ref": "ControlPlaneService.start", - "resolution": "resolved", - "slice_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.start" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._start_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 47, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517", - "dst_ref": "ControlPlaneService._start_async", - "resolution": "resolved", - "slice_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._start_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager.add_config_file", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 32, - "span_end": 52, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "a23b8a11ebdb12708b60c96ea12a69f7f042082f1adfddd572444e246d81d167", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "57ffbd4f0d9fdf3507c2b8624312ce211f3d02fdf86a57a8ec90778d8a7b498d", - "dst_ref": "RuntimeManager.add_config_file", - "resolution": "resolved", - "slice_id": "a23b8a11ebdb12708b60c96ea12a69f7f042082f1adfddd572444e246d81d167", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager.add_config_file" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "57ffbd4f0d9fdf3507c2b8624312ce211f3d02fdf86a57a8ec90778d8a7b498d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "class RuntimeManager:\n ACTION_TIMEOUT_SECONDS = 10.0\n ACTION_POLL_INTERVAL_SECONDS = 0.05\n\n def __init__(\n self,\n configuration: ConfigurationManager | None = None,\n services: ServiceContainer | None = None,\n traces: TraceService | None = None,\n health: HealthRegistry | None = None,\n logs: LogManager | None = None,\n workers: WorkerSupervisor | None = None,\n control_plane: ControlPlaneService | None = None,\n ) -> None:\n self.configuration = configuration or ConfigurationManager()\n self.services = services or ServiceContainer()\n self.traces = traces or TraceService()\n self.health = health or HealthRegistry()\n self.logs = logs or LogManager()\n self.workers = workers or WorkerSupervisor()\n self.control_plane = control_plane or ControlPlaneService()\n self.registry = ModuleRegistry(self.services)\n self._started = False\n self._state = LifecycleState.IDLE\n self._core_registered = False\n self._workers_registered = False\n self._register_core_services()\n\n def register_module(self, module: ApplicationModule) -> None:\n self.registry.register_module(module.name)\n module.register(self.registry)\n\n def add_config_file(self, path: str) -> FileConfigProvider:\n provider = FileConfigProvider(path)\n self.configuration.add_provider(provider)\n return provider\n\n def start(self, *, start_control_plane: bool = True) -> None:\n if self._started:\n return\n self._state = LifecycleState.STARTING\n config = self.configuration.load()\n self.logs.apply_config(config)\n self._register_health_contributors()\n self._register_workers()\n self.workers.start()\n if start_control_plane:\n self.control_plane.start(self)\n self._started = True\n self._refresh_state()\n\n def stop(self, timeout: float = 30.0, force: bool = False, stop_control_plane: bool = True) -> None:\n if not self._started:\n return\n self._state = LifecycleState.STOPPING\n self.workers.stop(timeout=timeout, force=force)\n if stop_control_plane:\n self.control_plane.stop()\n self._started = False\n self._state = LifecycleState.STOPPED\n\n def status(self) -> dict[str, object]:\n self._refresh_state()\n return self.control_plane.snapshot(self)\n\n def current_health(self) -> HealthPayload:\n self._refresh_state()\n return self.health.payload(self._state, self.workers.healths())\n\n async def health_status(self) -> HealthPayload:\n return self.current_health()\n\n async def start_runtime(self) -> dict[str, object] | str:\n self._refresh_state()\n if self._started:\n return \"runtime already running\"\n if self._state == LifecycleState.STOPPING:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n\n self.start(start_control_plane=False)\n started = self._wait_for_state({LifecycleState.IDLE, LifecycleState.BUSY}, timeout=self.ACTION_TIMEOUT_SECONDS)\n if started:\n return self._action_detail(\"runtime started\", timed_out=False)\n return self._action_detail(\"runtime start is still in progress\", timed_out=True)\n\n async def stop_runtime(self) -> dict[str, object] | str:\n self._refresh_state()\n if not self._started:\n if self._state == LifecycleState.STOPPING:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n return \"runtime already stopped\"\n\n self._state = LifecycleState.STOPPING\n try:\n self.workers.stop(timeout=self.ACTION_TIMEOUT_SECONDS, force=False)\n except TimeoutError:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n\n self._started = False\n self._state = LifecycleState.STOPPED\n return self._action_detail(\"runtime stopped\", timed_out=False)\n\n async def runtime_status(self) -> str:\n self._refresh_state()\n return self._state.value\n\n def _register_core_services(self) -> None:\n if self._core_registered:\n return\n self.services.register(\"configuration\", self.configuration)\n self.services.register(\"traces\", self.traces)\n self.services.register(\"health\", self.health)\n self.services.register(\"logs\", self.logs)\n self.services.register(\"workers\", self.workers)\n self.services.register(\"control_plane\", self.control_plane)\n self._core_registered = True\n\n def _register_health_contributors(self) -> None:\n for contributor in self.registry.health_contributors:\n self.health.register(contributor)\n\n def _register_workers(self) -> None:\n if self._workers_registered:\n return\n for worker in self.registry.workers:\n self.workers.register(worker)\n self._workers_registered = True\n\n def _refresh_state(self) -> None:\n lifecycle = self.workers.lifecycle_state()\n\n if self._state == LifecycleState.STOPPING:\n if lifecycle == LifecycleState.STOPPED:\n self._started = False\n self._state = LifecycleState.STOPPED\n return\n\n if not self._started:\n if lifecycle == LifecycleState.STOPPED:\n self._state = LifecycleState.STOPPED\n return\n\n self._state = lifecycle\n\n def _wait_for_state(self, target_states: set[LifecycleState], *, timeout: float) -> bool:\n deadline = monotonic() + timeout\n while monotonic() < deadline:\n self._refresh_state()\n if self._state in target_states:\n return True\n sleep(self.ACTION_POLL_INTERVAL_SECONDS)\n self._refresh_state()\n return self._state in target_states\n\n def _action_detail(self, message: str, *, timed_out: bool) -> dict[str, object]:\n self._refresh_state()\n return {\n \"message\": message,\n \"state\": self._state.value,\n \"timed_out\": timed_out,\n \"workers\": self.workers.snapshot(),\n }", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/core/runtime.py:RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.core.runtime", - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "llm_answer": "## Анализ класса `RuntimeManager`\n\n### Файл и путь:\n`src/app_runtime/core/runtime.py`\n\n### Описание класса:\n**Класс:** `RuntimeManager`\n\n**Роль:** \n- Менеджер роли (pipeline_stage)\n- Оркестратор вызовов ролей (4)\n- Читает и записывает состояние атрибутов\n- Участвует в срезах потока данных (50)\n\n### Основные обязанности и ответственность:\n1. **Менеджер состояния**: Класс управляет состоянием системы и отвечает за его изменение при выполнении различных операций.\n \n2. **Оркестровка ролей**: Он координирует выполнение этапов обработки данных (roles) внутри конвейера (pipeline). Каждый этап выполняет определенную роль, например, чтение или запись состояний, обработку данных и т.д.\n\n3. **Чтение и запись состояний**: Класс поддерживает и обновляет внутренние состояния приложения через атрибуты объекта.\n\n4. **Участие в потоке данных**: Управление потоком данных происходит на уровне «срезов» (slices), что означает, что класс участвует в разделении и передаче данных между различными компонентами системы.\n\n---\n\n### Поток данных и архитектура:\n\n#### Входные данные\n- Данные поступают из внешнего источника или из предыдущего этапа конвейера.\n\n#### Логика работы:\n1. При инициализации экземпляра класса создаются начальные атрибуты состояния (`state_attributes`), которые представляют текущую информацию о системе.\n2. Для выполнения операций используется метод, принимающий внешние действия (`perform_action`) и аргументы для этих действий.\n - Пример метода: `perform_action(self, action_name, *args)`\n - В аргументах передаются имя действия и параметры, необходимые для этого действия.\n3. Внутри `perform_action` проверяется корректность входных параметров и вызывается соответствующая логика для выполнения нужного действия.\n4. После выполнения действия изменяется внутреннее состояние системы путем записи нового значения атрибута состояния.\n5. Информация передается следующему этапу конвейера.\n\n#### Выходные данные\n- Результат обработки передается дальше по конвейеру или возвращается клиенту, если это конечный результат.\n\n---\n\n### Ключевые компоненты и зависимости:\n- Внутренние атрибуты состояния (`state_attributes`): хранят текущее состояние системы, доступное для чтения и изменения.\n- Методы для выполнения конкретных действий (метод `perform_action`):\n - Вызывают соответствующие методы других компонентов или классов.\n \n### Пример использования:\n```python\n# Инициализация менеджера\nruntime_manager = RuntimeManager()\n\n# Выполнение действия с аргументами\nresult = runtime_manager.perform_action('action_name', arg1, arg2)\n```\n\n---\n\n### Заключение:\nКласс `RuntimeManager` играет ключевую роль в управлении состоянием и координацией выполнения этапов обработки данных в приложении. Его использование позволяет централизованно управлять потоком данных и обеспечивать согласованность состояния приложения на каждом этапе обработки.", - "summary": { - "router": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "confidence": null - }, - "retrieval": { - "profile": "code", - "layers_hit": [ - "C0_SOURCE_CHUNKS", - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS", - "C4_SEMANTIC_ROLES" - ], - "evidence_sufficient": true - }, - "llm": { - "answer_status": "answered", - "groundedness": "grounded" - } - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "RuntimeManager" - ], - "keyword_hints": [ - "RuntimeManager" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C0_SOURCE_CHUNKS": "exact_path_fetch", - "C4_SEMANTIC_ROLES": "exact_path_fetch", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C3_ENTRYPOINTS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 8, - "C4_SEMANTIC_ROLES": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C3_ENTRYPOINTS": 6 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C4_SEMANTIC_ROLES": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Объясни как работает класс RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C4_SEMANTIC_ROLES", - "query": "Объясни как работает класс RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "Объясни как работает класс RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - }, - { - "layer": "C3_ENTRYPOINTS", - "query": "Объясни как работает класс RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 1, - "candidates_after_filter": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 6, - "candidates_after_filter": 6 - }, - { - "layer": "C3_ENTRYPOINTS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 3, - "candidates_after_filter": 3 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "RuntimeManager", - "alternatives": [ - "RuntimeManager" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C4_SEMANTIC_ROLES", - "status": "hit", - "hit_count": 8, - "fail_reason": null - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 6, - "fail_reason": null - }, - { - "layer": "C3_ENTRYPOINTS", - "status": "hit", - "hit_count": 3, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "router": 1, - "symbol_resolution": 0, - "retrieval_total": 263, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 28, - "C0_SOURCE_CHUNKS": 19, - "C4_SEMANTIC_ROLES": 15, - "C2_DEPENDENCY_GRAPH": 58, - "C3_ENTRYPOINTS": 11 - }, - "merge_rank": 17, - "prompt_build": 0, - "llm_call": 6241 - }, - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 335, - "evidence_rows": 19, - "evidence_chars": 7949 - }, - "evidence_summary": [ - { - "layer": "C1_SYMBOL_CATALOG", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "count": 8, - "unique_paths": 7 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "count": 6, - "unique_paths": 2 - }, - { - "layer": "C3_ENTRYPOINTS", - "count": 3, - "unique_paths": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 1, - "unique_paths": 1 - } - ], - "prompt_template_id": "intent_code_qa_v1", - "system_prompt_version": "v1" - }, - "router": { - "conversation_mode": "START", - "keyword_hints": [ - "RuntimeManager" - ], - "path_scope": [] - }, - "llm": { - "used_evidence_count": 19, - "missing_evidence_reason": null - } - }, - "run_info": { - "case_id": "plba-fullchain-explain-runtime-manager", - "mode": "full_chain", - "run_started_at": "2026-03-12T09:11:50", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - }, - "input_request": { - "text": "Объясни как работает класс RuntimeManager", - "normalized_query": "Объясни как работает класс RuntimeManager" - }, - "steps": [ - { - "step": "intent_router", - "input": { - "query": "Объясни как работает класс RuntimeManager" - }, - "output": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Объясни как работает класс RuntimeManager" - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "RuntimeManager" - ], - "keyword_hints": [ - "RuntimeManager" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "timings_ms": { - "router": 1 - } - } - }, - { - "step": "retrieval", - "input": { - "query": "Объясни как работает класс RuntimeManager" - }, - "output": { - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "RuntimeManager", - "alternatives": [ - "RuntimeManager" - ], - "confidence": 0.99 - }, - "rag_count": 19, - "rag_rows": [ - { - "path": "src/app_runtime/core/runtime.py", - "content": "class RuntimeManager\nRuntimeManager", - "layer": "C1_SYMBOL_CATALOG", - "title": "RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "7e4a9381328c5803bbc6179458612fc4e947d928aa7bf8b4b2bebb2c8592f758", - "qname": "RuntimeManager", - "kind": "class", - "signature": "RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.core.runtime", - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests manager\n- orchestrates role-like calls (4)\n- reads and writes state attributes\n- participates in dataflow slices (50)", - "layer": "C4_SEMANTIC_ROLES", - "title": "RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 43, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "7e4a9381328c5803bbc6179458612fc4e947d928aa7bf8b4b2bebb2c8592f758", - "symbol_name": "RuntimeManager", - "qname": "RuntimeManager", - "role": "pipeline_stage", - "confidence": 0.67, - "dataflow_participation": 50, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "ControlChannel\nrole: model\n\nResponsibilities:\n- default model role", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlChannel", - "span_start": 21, - "span_end": 28, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 40, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "cfcfe9a311d3a2dbdaf32ac4ccd73c0eb9a117f830591a1c0867ee97d46204ff", - "symbol_name": "ControlChannel", - "qname": "ControlChannel", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "ControlActionSet\nrole: model\n\nResponsibilities:\n- default model role", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlActionSet", - "span_start": 14, - "span_end": 18, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 40, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "46eb026cb3313415ec47b82dd22f84f4d112c9d987e8b1716dcb0baa1cce8988", - "symbol_name": "ControlActionSet", - "qname": "ControlActionSet", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests service\n- reads and writes state attributes\n- participates in dataflow slices (5)", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlPlaneService", - "span_start": 12, - "span_end": 52, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 68, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "b13471e5916986dccffb53fab613812842965705e6b3a89ae549d30c9e91e9aa", - "symbol_name": "ControlPlaneService", - "qname": "ControlPlaneService", - "role": "pipeline_stage", - "confidence": 0.57, - "dataflow_participation": 5, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_runner.py", - "content": "UvicornThreadRunner\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (24)", - "layer": "C4_SEMANTIC_ROLES", - "title": "UvicornThreadRunner", - "span_start": 10, - "span_end": 61, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 11, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "fd55630045a02100df8877ac27d951ee08617d4598764394d48cb51fe067476a", - "symbol_name": "UvicornThreadRunner", - "qname": "UvicornThreadRunner", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 24, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "3779fdd2878b770e789a35bb2a89c9d79f13b61c26d7db1b3b683f9bb9e1623f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (10)", - "layer": "C4_SEMANTIC_ROLES", - "title": "HttpControlChannel", - "span_start": 12, - "span_end": 57, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 21, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "1c9fbdc24819e5604c26ea55428a74310f03a03e1af197ed84846af61e42fdb0", - "symbol_name": "HttpControlChannel", - "qname": "HttpControlChannel", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 10, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "HttpControlAppFactory\nrole: factory\n\nResponsibilities:\n- name suffix suggests factory", - "layer": "C4_SEMANTIC_ROLES", - "title": "HttpControlAppFactory", - "span_start": 15, - "span_end": 53, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 39, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "9b3502a5fb408b273223db13264349cf500de24915b6c649d9ea8970d0dfd8e0", - "symbol_name": "HttpControlAppFactory", - "qname": "HttpControlAppFactory", - "role": "factory", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/persistence/workflow_persistence.py", - "content": "WorkflowPersistence\nrole: pipeline_stage\n\nResponsibilities:\n- orchestrates role-like calls (2)\n- reads and writes state attributes\n- participates in dataflow slices (16)", - "layer": "C4_SEMANTIC_ROLES", - "title": "WorkflowPersistence", - "span_start": 8, - "span_end": 54, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 15, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "7bd01ee45cf31f2d5c2e3e51656254860ac785d10cef9e0852cd4fba90857bae", - "symbol_name": "WorkflowPersistence", - "qname": "WorkflowPersistence", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 16, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "80e9410ddc639789b4353c2a1a757ba8d0d5b5bb6075b0b263b61551f04ae1f0", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.stop", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 25, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d", - "dst_ref": "ControlPlaneService.stop", - "resolution": "resolved", - "slice_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.stop" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._stop_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 51, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a", - "dst_ref": "ControlPlaneService._stop_async", - "resolution": "resolved", - "slice_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._stop_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.register_channel", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 17, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957", - "dst_ref": "ControlPlaneService.register_channel", - "resolution": "resolved", - "slice_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.register_channel" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.start", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 20, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154", - "dst_ref": "ControlPlaneService.start", - "resolution": "resolved", - "slice_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.start" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._start_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 47, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517", - "dst_ref": "ControlPlaneService._start_async", - "resolution": "resolved", - "slice_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._start_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager.add_config_file", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 32, - "span_end": 52, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "a23b8a11ebdb12708b60c96ea12a69f7f042082f1adfddd572444e246d81d167", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "57ffbd4f0d9fdf3507c2b8624312ce211f3d02fdf86a57a8ec90778d8a7b498d", - "dst_ref": "RuntimeManager.add_config_file", - "resolution": "resolved", - "slice_id": "a23b8a11ebdb12708b60c96ea12a69f7f042082f1adfddd572444e246d81d167", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager.add_config_file" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "57ffbd4f0d9fdf3507c2b8624312ce211f3d02fdf86a57a8ec90778d8a7b498d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "class RuntimeManager:\n ACTION_TIMEOUT_SECONDS = 10.0\n ACTION_POLL_INTERVAL_SECONDS = 0.05\n\n def __init__(\n self,\n configuration: ConfigurationManager | None = None,\n services: ServiceContainer | None = None,\n traces: TraceService | None = None,\n health: HealthRegistry | None = None,\n logs: LogManager | None = None,\n workers: WorkerSupervisor | None = None,\n control_plane: ControlPlaneService | None = None,\n ) -> None:\n self.configuration = configuration or ConfigurationManager()\n self.services = services or ServiceContainer()\n self.traces = traces or TraceService()\n self.health = health or HealthRegistry()\n self.logs = logs or LogManager()\n self.workers = workers or WorkerSupervisor()\n self.control_plane = control_plane or ControlPlaneService()\n self.registry = ModuleRegistry(self.services)\n self._started = False\n self._state = LifecycleState.IDLE\n self._core_registered = False\n self._workers_registered = False\n self._register_core_services()\n\n def register_module(self, module: ApplicationModule) -> None:\n self.registry.register_module(module.name)\n module.register(self.registry)\n\n def add_config_file(self, path: str) -> FileConfigProvider:\n provider = FileConfigProvider(path)\n self.configuration.add_provider(provider)\n return provider\n\n def start(self, *, start_control_plane: bool = True) -> None:\n if self._started:\n return\n self._state = LifecycleState.STARTING\n config = self.configuration.load()\n self.logs.apply_config(config)\n self._register_health_contributors()\n self._register_workers()\n self.workers.start()\n if start_control_plane:\n self.control_plane.start(self)\n self._started = True\n self._refresh_state()\n\n def stop(self, timeout: float = 30.0, force: bool = False, stop_control_plane: bool = True) -> None:\n if not self._started:\n return\n self._state = LifecycleState.STOPPING\n self.workers.stop(timeout=timeout, force=force)\n if stop_control_plane:\n self.control_plane.stop()\n self._started = False\n self._state = LifecycleState.STOPPED\n\n def status(self) -> dict[str, object]:\n self._refresh_state()\n return self.control_plane.snapshot(self)\n\n def current_health(self) -> HealthPayload:\n self._refresh_state()\n return self.health.payload(self._state, self.workers.healths())\n\n async def health_status(self) -> HealthPayload:\n return self.current_health()\n\n async def start_runtime(self) -> dict[str, object] | str:\n self._refresh_state()\n if self._started:\n return \"runtime already running\"\n if self._state == LifecycleState.STOPPING:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n\n self.start(start_control_plane=False)\n started = self._wait_for_state({LifecycleState.IDLE, LifecycleState.BUSY}, timeout=self.ACTION_TIMEOUT_SECONDS)\n if started:\n return self._action_detail(\"runtime started\", timed_out=False)\n return self._action_detail(\"runtime start is still in progress\", timed_out=True)\n\n async def stop_runtime(self) -> dict[str, object] | str:\n self._refresh_state()\n if not self._started:\n if self._state == LifecycleState.STOPPING:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n return \"runtime already stopped\"\n\n self._state = LifecycleState.STOPPING\n try:\n self.workers.stop(timeout=self.ACTION_TIMEOUT_SECONDS, force=False)\n except TimeoutError:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n\n self._started = False\n self._state = LifecycleState.STOPPED\n return self._action_detail(\"runtime stopped\", timed_out=False)\n\n async def runtime_status(self) -> str:\n self._refresh_state()\n return self._state.value\n\n def _register_core_services(self) -> None:\n if self._core_registered:\n return\n self.services.register(\"configuration\", self.configuration)\n self.services.register(\"traces\", self.traces)\n self.services.register(\"health\", self.health)\n self.services.register(\"logs\", self.logs)\n self.services.register(\"workers\", self.workers)\n self.services.register(\"control_plane\", self.control_plane)\n self._core_registered = True\n\n def _register_health_contributors(self) -> None:\n for contributor in self.registry.health_contributors:\n self.health.register(contributor)\n\n def _register_workers(self) -> None:\n if self._workers_registered:\n return\n for worker in self.registry.workers:\n self.workers.register(worker)\n self._workers_registered = True\n\n def _refresh_state(self) -> None:\n lifecycle = self.workers.lifecycle_state()\n\n if self._state == LifecycleState.STOPPING:\n if lifecycle == LifecycleState.STOPPED:\n self._started = False\n self._state = LifecycleState.STOPPED\n return\n\n if not self._started:\n if lifecycle == LifecycleState.STOPPED:\n self._state = LifecycleState.STOPPED\n return\n\n self._state = lifecycle\n\n def _wait_for_state(self, target_states: set[LifecycleState], *, timeout: float) -> bool:\n deadline = monotonic() + timeout\n while monotonic() < deadline:\n self._refresh_state()\n if self._state in target_states:\n return True\n sleep(self.ACTION_POLL_INTERVAL_SECONDS)\n self._refresh_state()\n return self._state in target_states\n\n def _action_detail(self, message: str, *, timed_out: bool) -> dict[str, object]:\n self._refresh_state()\n return {\n \"message\": message,\n \"state\": self._state.value,\n \"timed_out\": timed_out,\n \"workers\": self.workers.snapshot(),\n }", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/core/runtime.py:RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.core.runtime", - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ] - }, - "diagnostics": { - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C0_SOURCE_CHUNKS": "exact_path_fetch", - "C4_SEMANTIC_ROLES": "exact_path_fetch", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C3_ENTRYPOINTS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 8, - "C4_SEMANTIC_ROLES": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C3_ENTRYPOINTS": 6 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C4_SEMANTIC_ROLES": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Объясни как работает класс RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C4_SEMANTIC_ROLES", - "query": "Объясни как работает класс RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "Объясни как работает класс RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - }, - { - "layer": "C3_ENTRYPOINTS", - "query": "Объясни как работает класс RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 1, - "candidates_after_filter": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 6, - "candidates_after_filter": 6 - }, - { - "layer": "C3_ENTRYPOINTS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 3, - "candidates_after_filter": 3 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "RuntimeManager", - "alternatives": [ - "RuntimeManager" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C4_SEMANTIC_ROLES", - "status": "hit", - "hit_count": 8, - "fail_reason": null - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 6, - "fail_reason": null - }, - { - "layer": "C3_ENTRYPOINTS", - "status": "hit", - "hit_count": 3, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "symbol_resolution": 0, - "retrieval_total": 263, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 28, - "C0_SOURCE_CHUNKS": 19, - "C4_SEMANTIC_ROLES": 15, - "C2_DEPENDENCY_GRAPH": 58, - "C3_ENTRYPOINTS": 11 - }, - "merge_rank": 17 - } - } - }, - { - "step": "llm_answer", - "input": { - "query": "Объясни как работает класс RuntimeManager", - "rag_count": 19 - }, - "output": { - "llm_answer": "## Анализ класса `RuntimeManager`\n\n### Файл и путь:\n`src/app_runtime/core/runtime.py`\n\n### Описание класса:\n**Класс:** `RuntimeManager`\n\n**Роль:** \n- Менеджер роли (pipeline_stage)\n- Оркестратор вызовов ролей (4)\n- Читает и записывает состояние атрибутов\n- Участвует в срезах потока данных (50)\n\n### Основные обязанности и ответственность:\n1. **Менеджер состояния**: Класс управляет состоянием системы и отвечает за его изменение при выполнении различных операций.\n \n2. **Оркестровка ролей**: Он координирует выполнение этапов обработки данных (roles) внутри конвейера (pipeline). Каждый этап выполняет определенную роль, например, чтение или запись состояний, обработку данных и т.д.\n\n3. **Чтение и запись состояний**: Класс поддерживает и обновляет внутренние состояния приложения через атрибуты объекта.\n\n4. **Участие в потоке данных**: Управление потоком данных происходит на уровне «срезов» (slices), что означает, что класс участвует в разделении и передаче данных между различными компонентами системы.\n\n---\n\n### Поток данных и архитектура:\n\n#### Входные данные\n- Данные поступают из внешнего источника или из предыдущего этапа конвейера.\n\n#### Логика работы:\n1. При инициализации экземпляра класса создаются начальные атрибуты состояния (`state_attributes`), которые представляют текущую информацию о системе.\n2. Для выполнения операций используется метод, принимающий внешние действия (`perform_action`) и аргументы для этих действий.\n - Пример метода: `perform_action(self, action_name, *args)`\n - В аргументах передаются имя действия и параметры, необходимые для этого действия.\n3. Внутри `perform_action` проверяется корректность входных параметров и вызывается соответствующая логика для выполнения нужного действия.\n4. После выполнения действия изменяется внутреннее состояние системы путем записи нового значения атрибута состояния.\n5. Информация передается следующему этапу конвейера.\n\n#### Выходные данные\n- Результат обработки передается дальше по конвейеру или возвращается клиенту, если это конечный результат.\n\n---\n\n### Ключевые компоненты и зависимости:\n- Внутренние атрибуты состояния (`state_attributes`): хранят текущее состояние системы, доступное для чтения и изменения.\n- Методы для выполнения конкретных действий (метод `perform_action`):\n - Вызывают соответствующие методы других компонентов или классов.\n \n### Пример использования:\n```python\n# Инициализация менеджера\nruntime_manager = RuntimeManager()\n\n# Выполнение действия с аргументами\nresult = runtime_manager.perform_action('action_name', arg1, arg2)\n```\n\n---\n\n### Заключение:\nКласс `RuntimeManager` играет ключевую роль в управлении состоянием и координацией выполнения этапов обработки данных в приложении. Его использование позволяет централизованно управлять потоком данных и обеспечивать согласованность состояния приложения на каждом этапе обработки." - }, - "diagnostics": { - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 335, - "evidence_rows": 19, - "evidence_chars": 7949 - }, - "evidence_summary": [ - { - "layer": "C1_SYMBOL_CATALOG", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "count": 8, - "unique_paths": 7 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "count": 6, - "unique_paths": 2 - }, - { - "layer": "C3_ENTRYPOINTS", - "count": 3, - "unique_paths": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 1, - "unique_paths": 1 - } - ], - "prompt_template_id": "intent_code_qa_v1", - "system_prompt_version": "v1" - }, - "timings_ms": { - "prompt_build": 0, - "llm_call": 6241 - } - } - } - ] - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_091150/full_chain_plba_code_retrieval_plba-fullchain-explain-runtime-manager.md b/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_091150/full_chain_plba_code_retrieval_plba-fullchain-explain-runtime-manager.md deleted file mode 100644 index fdb6206..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_091150/full_chain_plba_code_retrieval_plba-fullchain-explain-runtime-manager.md +++ /dev/null @@ -1,34 +0,0 @@ -# plba-fullchain-explain-runtime-manager - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_retrieval.yaml -- runner: runtime -- mode: full_chain -- passed: True - -## Query -Объясни как работает класс RuntimeManager - -## Actual -{ - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 19, - "llm_answer": "## Анализ класса `RuntimeManager`\n\n### Файл и путь:\n`src/app_runtime/core/runtime.py`\n\n### Описание класса:\n**Класс:** `RuntimeManager`\n\n**Роль:** \n- Менеджер роли (pipeline_stage)\n- Оркестратор вызовов ролей (4)\n- Читает и записывает состояние атрибутов\n- Участвует в срезах потока данных (50)\n\n### Основные обязанности и ответственность:\n1. **Менеджер состояния**: Класс управляет состоянием системы и отвечает за его изменение при выполнении различных операций.\n \n2. **Оркестровка ролей**: Он координирует выполнение этапов обработки данных (roles) внутри конвейера (pipeline). Каждый этап выполняет определенную роль, например, чтение или запись состояний, обработку данных и т.д.\n\n3. **Чтение и запись состояний**: Класс поддерживает и обновляет внутренние состояния приложения через атрибуты объекта.\n\n4. **Участие в потоке данных**: Управление потоком данных происходит на уровне «срезов» (slices), что означает, что класс участвует в разделении и передаче данных между различными компонентами системы.\n\n---\n\n### Поток данных и архитектура:\n\n#### Входные данные\n- Данные поступают из внешнего источника или из предыдущего этапа конвейера.\n\n#### Логика работы:\n1. При инициализации экземпляра класса создаются начальные атрибуты состояния (`state_attributes`), которые представляют текущую информацию о системе.\n2. Для выполнения операций используется метод, принимающий внешние действия (`perform_action`) и аргументы для этих действий.\n - Пример метода: `perform_action(self, action_name, *args)`\n - В аргументах передаются имя действия и параметры, необходимые для этого действия.\n3. Внутри `perform_action` проверяется корректность входных параметров и вызывается соответствующая логика для выполнения нужного действия.\n4. После выполнения действия изменяется внутреннее состояние системы путем записи нового значения атрибута состояния.\n5. Информация передается следующему этапу конвейера.\n\n#### Выходные данные\n- Результат обработки передается дальше по конвейеру или возвращается клиенту, если это конечный результат.\n\n---\n\n### Ключевые компоненты и зависимости:\n- Внутренние атрибуты состояния (`state_attributes`): хранят текущее состояние системы, доступное для чтения и изменения.\n- Методы для выполнения конкретных действий (метод `perform_action`):\n - Вызывают соответствующие методы других компонентов или классов.\n \n### Пример использования:\n```python\n# Инициализация менеджера\nruntime_manager = RuntimeManager()\n\n# Выполнение действия с аргументами\nresult = runtime_manager.perform_action('action_name', arg1, arg2)\n```\n\n---\n\n### Заключение:\nКласс `RuntimeManager` играет ключевую роль в управлении состоянием и координацией выполнения этапов обработки данных в приложении. Его использование позволяет централизованно управлять потоком данных и обеспечивать согласованность состояния приложения на каждом этапе обработки.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "RuntimeManager" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] -} - -## Mismatches -- none \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_091150/full_chain_plba_code_retrieval_plba-fullchain-explain-trace-service.json b/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_091150/full_chain_plba_code_retrieval_plba-fullchain-explain-trace-service.json deleted file mode 100644 index c71dc59..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_091150/full_chain_plba_code_retrieval_plba-fullchain-explain-trace-service.json +++ /dev/null @@ -1,2684 +0,0 @@ -{ - "case_id": "plba-fullchain-explain-trace-service", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_retrieval.yaml", - "runner": "runtime", - "mode": "full_chain", - "actual": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 21, - "llm_answer": "## Анализ архитектуры и поведения системы с участием `TraceService`\n\n### Описание роли и ответственности компонента\n\nВ системе предоставлены несколько компонентов, выполняющих роль pipeline stage и участвующих в управлении состоянием приложения и его данными. Рассмотрим подробнее один из них — **`TraceService`**.\n\n---\n\n### Поведение и архитектура `TraceService`\n\n#### 1. Место в общей архитектуре\n- `TraceService` является классом, производным от класса `TraceContextFactory`.\n- Класс предназначен для работы с контекстом трассировки (`trace context`), что позволяет отслеживать выполнение задач и событий в приложении.\n \n#### 2. Основные обязанности и ответственность\n- Название класса и суффикс «service» указывают на то, что он играет сервисную роль в системе.\n- Он участвует в обработке данных и их перемещении между различными компонентами (dataflow slices).\n- Имеет доступ к атрибутам состояния и может изменять их значение.\n\n#### 3. Участие в процессе выполнения запросов и управления данными\n- Класс взаимодействует с другими pipeline stages, такими как `UvicornThreadRunner`, `WorkflowPersistence`, `HttpControlChannel` и `InMemoryTaskQueue`. Эти компоненты совместно обеспечивают функционирование workflow и взаимодействие с внешним миром.\n\n---\n\n### Поток данных и логика обработки\n\n- Входные данные поступают через HTTP-запросы или другие каналы взаимодействия (например, запросы через очередь сообщений).\n- В рамках обработки запроса происходит создание контекста трассировки, который передается всем задействованным компонентам.\n- Контекст содержит информацию о запросе, включая идентификаторы, метаданные и другие параметры, необходимые для корректного отслеживания и логирования операций.\n- Все pipeline stages участвуют в передаче этих данных и обмениваются ими между собой, обеспечивая согласованность и целостность процесса.\n\n---\n\n### Примеры использования и вызовы методов\n\nДля лучшего понимания рассмотрим примерный сценарий взаимодействия компонентов:\n\n```python\n# Пример вызова сервиса trace service\nfrom app_runtime.tracing.service import TraceService\n\n# Создание экземпляра сервиса\ntrace_service = TraceService()\n\n# Обработка входных данных и получение контекста трассировки\ncontext = trace_service.get_trace_context(request_data)\n\n# Передача контекста другим pipeline stages\nuvicorn_thread_runner = UvicornThreadRunner()\nuvicorn_thread_runner.process_request(context)\n```\n\n---\n\n### Заключение\n\nТаким образом, **`TraceService`** представляет собой важный элемент системы, обеспечивающий централизованное управление контекстом трассировки и участие в потоках данных и состоянии приложения. Он активно взаимодействует с другими компонентами, обеспечивая корректное выполнение задач и передачу информации между ними.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "TraceService" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "passed": true, - "mismatches": [], - "details": { - "case_id": "plba-fullchain-explain-trace-service", - "text": "Как работает TraceService?", - "mode": "full_chain", - "run_started_at": "2026-03-12T09:11:50", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Как работает TraceService?", - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "TraceService", - "alternatives": [ - "TraceService" - ], - "confidence": 0.99 - }, - "rag_count": 21, - "rag_rows": [ - { - "path": "src/app_runtime/tracing/service.py", - "content": "class TraceService\nTraceService(TraceContextFactory)", - "layer": "C1_SYMBOL_CATALOG", - "title": "TraceService", - "span_start": 39, - "span_end": 166, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "c2b2b976d99f2c600000b753731b26e0a69adcb4359398b93073590c5d5d04f4", - "qname": "TraceService", - "kind": "class", - "signature": "TraceService(TraceContextFactory)", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.tracing.service", - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "TraceService\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests service\n- reads and writes state attributes\n- participates in dataflow slices (13)", - "layer": "C4_SEMANTIC_ROLES", - "title": "TraceService", - "span_start": 39, - "span_end": 166, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 60, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "c2b2b976d99f2c600000b753731b26e0a69adcb4359398b93073590c5d5d04f4", - "symbol_name": "TraceService", - "qname": "TraceService", - "role": "pipeline_stage", - "confidence": 0.57, - "dataflow_participation": 13, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_runner.py", - "content": "UvicornThreadRunner\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (24)", - "layer": "C4_SEMANTIC_ROLES", - "title": "UvicornThreadRunner", - "span_start": 10, - "span_end": 61, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 11, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "fd55630045a02100df8877ac27d951ee08617d4598764394d48cb51fe067476a", - "symbol_name": "UvicornThreadRunner", - "qname": "UvicornThreadRunner", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 24, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "3779fdd2878b770e789a35bb2a89c9d79f13b61c26d7db1b3b683f9bb9e1623f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/persistence/workflow_persistence.py", - "content": "WorkflowPersistence\nrole: pipeline_stage\n\nResponsibilities:\n- orchestrates role-like calls (2)\n- reads and writes state attributes\n- participates in dataflow slices (16)", - "layer": "C4_SEMANTIC_ROLES", - "title": "WorkflowPersistence", - "span_start": 8, - "span_end": 54, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 15, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "7bd01ee45cf31f2d5c2e3e51656254860ac785d10cef9e0852cd4fba90857bae", - "symbol_name": "WorkflowPersistence", - "qname": "WorkflowPersistence", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 16, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "80e9410ddc639789b4353c2a1a757ba8d0d5b5bb6075b0b263b61551f04ae1f0", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (10)", - "layer": "C4_SEMANTIC_ROLES", - "title": "HttpControlChannel", - "span_start": 12, - "span_end": 57, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 21, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "1c9fbdc24819e5604c26ea55428a74310f03a03e1af197ed84846af61e42fdb0", - "symbol_name": "HttpControlChannel", - "qname": "HttpControlChannel", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 10, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/queue/in_memory.py", - "content": "InMemoryTaskQueue\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (9)", - "layer": "C4_SEMANTIC_ROLES", - "title": "InMemoryTaskQueue", - "span_start": 9, - "span_end": 38, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 22, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "2da04cb94544a3bcbf0943a95ad4bdd8710bcafaa32a02fd0e4de2178dcf3533", - "symbol_name": "InMemoryTaskQueue", - "qname": "InMemoryTaskQueue", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 9, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "58f0cc001ccda0eee4c6bc32ed83bd05eafd6b6644f1e8b4aa9eed3103db73dc", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/config/file_loader.py", - "content": "ConfigFileLoader\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (8)", - "layer": "C4_SEMANTIC_ROLES", - "title": "ConfigFileLoader", - "span_start": 11, - "span_end": 48, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 23, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "a8474eca8b6e9dc86ae67ed68b16fa5fb639ef08739c053e7b7195489765667f", - "symbol_name": "ConfigFileLoader", - "qname": "ConfigFileLoader", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 8, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "1f19ffebde5e38e4be5a5d5a678059a0f36dedb8fb8b3e00ab395c67106a87ea", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/store.py", - "content": "TraceContextStore\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (6)", - "layer": "C4_SEMANTIC_ROLES", - "title": "TraceContextStore", - "span_start": 15, - "span_end": 52, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 25, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "b2dad4fbe16ffb11b58deba311c7739955c39d59f291b22181f33e9c8cce4059", - "symbol_name": "TraceContextStore", - "qname": "TraceContextStore", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 6, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "d369554f08fc92039c6edd5a2a1e73b23901533e8974459170bbd9347d263dc5", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workers/supervisor.py", - "content": "WorkerSupervisor\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (6)", - "layer": "C4_SEMANTIC_ROLES", - "title": "WorkerSupervisor", - "span_start": 10, - "span_end": 59, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 25, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "c17b44e8d9e97d490989b21fa67d7c346cdda8a0472e4c41fb243c8846faa124", - "symbol_name": "WorkerSupervisor", - "qname": "WorkerSupervisor", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 6, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "77609d9d5927171cce7fc3a54897c183fd63068710c6362029b700937aae5eee", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "TraceService.__init__\n -> TraceService.store\n -> TraceService.create_context", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "TraceService.__init__:dataflow_slice", - "span_start": 42, - "span_end": 61, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "3b052062067a78aef3302ee1d996897e02a67d1b340397bea4f59fe147c0492a", - "edge_type": "dataflow_slice", - "src_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "src_qname": "TraceService.__init__", - "dst_symbol_id": "ff44881104b65ef50ee6fe16d367d4a81b6e7eb5c44c0963cf4543faec785d4a", - "dst_ref": "TraceService.create_context", - "resolution": "resolved", - "slice_id": "3b052062067a78aef3302ee1d996897e02a67d1b340397bea4f59fe147c0492a", - "root_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "path_symbols": [ - "TraceService.__init__", - "TraceService.store", - "TraceService.create_context" - ], - "path_symbol_ids": [ - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "ff44881104b65ef50ee6fe16d367d4a81b6e7eb5c44c0963cf4543faec785d4a" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "TraceService.__init__\n -> TraceService.store\n -> TraceService.close_context", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "TraceService.__init__:dataflow_slice", - "span_start": 42, - "span_end": 84, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "7a9353ef57c9ae5d19b3a0c6ac50fad05e6d21d31bbe1cd1cd07af6332ba6505", - "edge_type": "dataflow_slice", - "src_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "src_qname": "TraceService.__init__", - "dst_symbol_id": "01e14158dcced7e52d0c8ac84ac7b9a75225c261b6aca6a1d7da802d0994721c", - "dst_ref": "TraceService.close_context", - "resolution": "resolved", - "slice_id": "7a9353ef57c9ae5d19b3a0c6ac50fad05e6d21d31bbe1cd1cd07af6332ba6505", - "root_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "path_symbols": [ - "TraceService.__init__", - "TraceService.store", - "TraceService.close_context" - ], - "path_symbol_ids": [ - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "01e14158dcced7e52d0c8ac84ac7b9a75225c261b6aca6a1d7da802d0994721c" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "TraceService.__init__\n -> TraceService.store\n -> TraceService.open_context", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "TraceService.__init__:dataflow_slice", - "span_start": 42, - "span_end": 78, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "a6e13b9ebc4fed84586afd53ed92a4d14757e440873f572b2337d5622ee96031", - "edge_type": "dataflow_slice", - "src_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "src_qname": "TraceService.__init__", - "dst_symbol_id": "2da3d5b20a947bf63e14c103be4689b72fd837e0a82abd6c497846375d4c7426", - "dst_ref": "TraceService.open_context", - "resolution": "resolved", - "slice_id": "a6e13b9ebc4fed84586afd53ed92a4d14757e440873f572b2337d5622ee96031", - "root_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "path_symbols": [ - "TraceService.__init__", - "TraceService.store", - "TraceService.open_context" - ], - "path_symbol_ids": [ - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "2da3d5b20a947bf63e14c103be4689b72fd837e0a82abd6c497846375d4c7426" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "TraceService.__init__\n -> TraceService.transport\n -> TraceService.__init__", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "TraceService.__init__:dataflow_slice", - "span_start": 41, - "span_end": 43, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "1e923a93faa05c3c43ca9b19bd047007a8589ccce57d3cc1798ae7f9f200af98", - "edge_type": "dataflow_slice", - "src_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "src_qname": "TraceService.__init__", - "dst_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "dst_ref": "TraceService.__init__", - "resolution": "resolved", - "slice_id": "1e923a93faa05c3c43ca9b19bd047007a8589ccce57d3cc1798ae7f9f200af98", - "root_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "path_symbols": [ - "TraceService.__init__", - "TraceService.transport", - "TraceService.__init__" - ], - "path_symbol_ids": [ - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "TraceService.__init__\n -> TraceService.store\n -> TraceService.current_trace_id", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "TraceService.__init__:dataflow_slice", - "span_start": 42, - "span_end": 81, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "3ea17138634b1190bded77ddb84aa1595124f6519b246f24fc4b02bd62b5cac1", - "edge_type": "dataflow_slice", - "src_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "src_qname": "TraceService.__init__", - "dst_symbol_id": "41135180f7b3b9ab20e097e0747474e219c37dd2366ef08a7b43c1f3edb10b4c", - "dst_ref": "TraceService.current_trace_id", - "resolution": "resolved", - "slice_id": "3ea17138634b1190bded77ddb84aa1595124f6519b246f24fc4b02bd62b5cac1", - "root_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "path_symbols": [ - "TraceService.__init__", - "TraceService.store", - "TraceService.current_trace_id" - ], - "path_symbol_ids": [ - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "41135180f7b3b9ab20e097e0747474e219c37dd2366ef08a7b43c1f3edb10b4c" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "TraceService.__init__\n -> TraceService.store\n -> TraceService.step", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "TraceService.__init__:dataflow_slice", - "span_start": 42, - "span_end": 88, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "9f34c5da9b09fba99df6f6b1bde183a9aeb45111b8218a747c71590c2c9f60f2", - "edge_type": "dataflow_slice", - "src_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "src_qname": "TraceService.__init__", - "dst_symbol_id": "c44bfbc66cf747283f30088da3e011a10395031d41e77b74e523c24997f641ca", - "dst_ref": "TraceService.step", - "resolution": "resolved", - "slice_id": "9f34c5da9b09fba99df6f6b1bde183a9aeb45111b8218a747c71590c2c9f60f2", - "root_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "path_symbols": [ - "TraceService.__init__", - "TraceService.store", - "TraceService.step" - ], - "path_symbol_ids": [ - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "c44bfbc66cf747283f30088da3e011a10395031d41e77b74e523c24997f641ca" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "class TraceRecordWriter:\n def __init__(self, transport: TraceTransport) -> None:\n self._logger = logging.getLogger(__name__)\n self._transport = transport\n\n def write_context(self, record: TraceContextRecord) -> None:\n try:\n self._transport.write_context(record)\n except Exception:\n self._logger.exception(\"Trace transport failed to write context %s\", record.trace_id)\n\n def write_message(self, record: TraceLogMessage) -> None:\n try:\n self._transport.write_message(record)\n except Exception:\n self._logger.exception(\"Trace transport failed to write message for %s\", record.trace_id)", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/tracing/service.py:TraceRecordWriter", - "span_start": 21, - "span_end": 36, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.tracing.service", - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "class TraceService(TraceContextFactory):\n def __init__(self, transport: TraceTransport | None = None, store: TraceContextStore | None = None) -> None:\n self.transport = transport or NoOpTraceTransport()\n self.store = store or TraceContextStore()\n self._writer = TraceRecordWriter(self.transport)\n\n def create_context(\n self,\n *,\n alias: str,\n parent_id: str | None = None,\n kind: str | None = None,\n attrs: dict[str, Any] | None = None,\n ) -> str:\n record = TraceContextRecord(\n trace_id=uuid4().hex,\n alias=str(alias or \"\"),\n parent_id=parent_id,\n type=kind,\n event_time=utc_now(),\n attrs=dict(attrs or {}),\n )\n self.store.push(record)\n self._writer.write_context(record)\n return record.trace_id\n\n @contextmanager\n def open_context(\n self,\n *,\n alias: str,\n parent_id: str | None = None,\n kind: str | None = None,\n attrs: dict[str, Any] | None = None,\n ) -> Iterator[str]:\n trace_id = self.create_context(alias=alias, parent_id=parent_id, kind=kind, attrs=attrs)\n try:\n yield trace_id\n finally:\n self.store.pop()\n\n def current_trace_id(self) -> str | None:\n return self.store.current_trace_id()\n\n def close_context(self) -> str | None:\n previous = self.store.pop()\n return previous.record.trace_id if previous else None\n\n def step(self, name: str) -> None:\n self.store.set_step(str(name or \"\"))\n\n def info(self, message: str, *, status: str | None = None, attrs: dict[str, Any] | None = None) -> None:\n self._write_message(\"INFO\", message, status, attrs)\n\n def debug(self, message: str, *, status: str | None = None, attrs: dict[str, Any] | None = None) -> None:\n self._write_message(\"DEBUG\", message, status, attrs)\n\n def warning(self, message: str, *, status: str | None = None, attrs: dict[str, Any] | None = None) -> None:\n self._write_message(\"WARNING\", message, status, attrs)\n\n def error(self, message: str, *, status: str | None = None, attrs: dict[str, Any] | None = None) -> None:\n self._write_message(\"ERROR\", message, status, attrs)\n\n def exception(self, message: str, *, status: str = \"failed\", attrs: dict[str, Any] | None = None) -> None:\n self._write_message(\"ERROR\", message, status, attrs)\n\n def new_root(self, operation: str) -> TraceContext:\n trace_id = self.create_context(alias=operation, kind=\"operation\", attrs={\"operation\": operation})\n return TraceContext(trace_id=trace_id, span_id=trace_id, attributes={\"operation\": operation})\n\n def child_of(self, parent: TraceContext, operation: str) -> TraceContext:\n trace_id = self.create_context(\n alias=operation,\n parent_id=parent.trace_id,\n kind=\"worker\",\n attrs={\"operation\": operation},\n )\n return TraceContext(\n trace_id=trace_id,\n span_id=trace_id,\n parent_span_id=parent.span_id,\n attributes={\"operation\": operation},\n )\n\n def attach(self, metadata: dict[str, object], context: TraceContext) -> dict[str, object]:\n updated = dict(metadata)\n updated[\"trace_id\"] = context.trace_id\n updated[\"span_id\"] = context.span_id\n updated[\"parent_span_id\"] = context.parent_span_id\n return updated\n\n def resume(self, metadata: dict[str, object], operation: str) -> TraceContext:\n trace_id = str(metadata.get(\"trace_id\") or uuid4().hex)\n span_id = str(metadata.get(\"span_id\") or trace_id)\n parent_id = metadata.get(\"parent_span_id\")\n self.create_context(\n alias=operation,\n parent_id=str(parent_id) if parent_id else None,\n kind=\"worker\",\n attrs=dict(metadata),\n )\n return TraceContext(\n trace_id=trace_id,\n span_id=span_id,\n parent_span_id=str(parent_id) if parent_id else None,\n attributes={\"operation\": operation},\n )\n\n def _write_message(\n self,\n level: TraceLevel,\n message: str,\n status: str | None,\n attrs: dict[str, Any] | None,\n ) -> None:\n active = self.store.current()\n if active is None:\n raise RuntimeError(\"Trace context is not bound. Call create_context() first.\")\n record = TraceLogMessage(\n trace_id=active.record.trace_id,\n step=active.step,\n status=str(status or \"\"),\n message=str(message or \"\"),\n level=level,\n event_time=utc_now(),\n attrs=dict(attrs or {}),\n )\n self._writer.write_message(record)", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/tracing/service.py:TraceService", - "span_start": 39, - "span_end": 166, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 1, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.tracing.service", - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "class TraceManager(TraceService):\n \"\"\"Compatibility alias during the transition from ConfigManager-shaped naming.\"\"\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/tracing/service.py:TraceManager", - "span_start": 169, - "span_end": 170, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 2, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.tracing.service", - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "llm_answer": "## Анализ архитектуры и поведения системы с участием `TraceService`\n\n### Описание роли и ответственности компонента\n\nВ системе предоставлены несколько компонентов, выполняющих роль pipeline stage и участвующих в управлении состоянием приложения и его данными. Рассмотрим подробнее один из них — **`TraceService`**.\n\n---\n\n### Поведение и архитектура `TraceService`\n\n#### 1. Место в общей архитектуре\n- `TraceService` является классом, производным от класса `TraceContextFactory`.\n- Класс предназначен для работы с контекстом трассировки (`trace context`), что позволяет отслеживать выполнение задач и событий в приложении.\n \n#### 2. Основные обязанности и ответственность\n- Название класса и суффикс «service» указывают на то, что он играет сервисную роль в системе.\n- Он участвует в обработке данных и их перемещении между различными компонентами (dataflow slices).\n- Имеет доступ к атрибутам состояния и может изменять их значение.\n\n#### 3. Участие в процессе выполнения запросов и управления данными\n- Класс взаимодействует с другими pipeline stages, такими как `UvicornThreadRunner`, `WorkflowPersistence`, `HttpControlChannel` и `InMemoryTaskQueue`. Эти компоненты совместно обеспечивают функционирование workflow и взаимодействие с внешним миром.\n\n---\n\n### Поток данных и логика обработки\n\n- Входные данные поступают через HTTP-запросы или другие каналы взаимодействия (например, запросы через очередь сообщений).\n- В рамках обработки запроса происходит создание контекста трассировки, который передается всем задействованным компонентам.\n- Контекст содержит информацию о запросе, включая идентификаторы, метаданные и другие параметры, необходимые для корректного отслеживания и логирования операций.\n- Все pipeline stages участвуют в передаче этих данных и обмениваются ими между собой, обеспечивая согласованность и целостность процесса.\n\n---\n\n### Примеры использования и вызовы методов\n\nДля лучшего понимания рассмотрим примерный сценарий взаимодействия компонентов:\n\n```python\n# Пример вызова сервиса trace service\nfrom app_runtime.tracing.service import TraceService\n\n# Создание экземпляра сервиса\ntrace_service = TraceService()\n\n# Обработка входных данных и получение контекста трассировки\ncontext = trace_service.get_trace_context(request_data)\n\n# Передача контекста другим pipeline stages\nuvicorn_thread_runner = UvicornThreadRunner()\nuvicorn_thread_runner.process_request(context)\n```\n\n---\n\n### Заключение\n\nТаким образом, **`TraceService`** представляет собой важный элемент системы, обеспечивающий централизованное управление контекстом трассировки и участие в потоках данных и состоянии приложения. Он активно взаимодействует с другими компонентами, обеспечивая корректное выполнение задач и передачу информации между ними.", - "summary": { - "router": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "confidence": null - }, - "retrieval": { - "profile": "code", - "layers_hit": [ - "C0_SOURCE_CHUNKS", - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS", - "C4_SEMANTIC_ROLES" - ], - "evidence_sufficient": true - }, - "llm": { - "answer_status": "answered", - "groundedness": "grounded" - } - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "TraceService" - ], - "keyword_hints": [ - "TraceService" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C0_SOURCE_CHUNKS": "exact_path_fetch", - "C4_SEMANTIC_ROLES": "exact_path_fetch", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C3_ENTRYPOINTS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 8, - "C4_SEMANTIC_ROLES": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C3_ENTRYPOINTS": 6 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C4_SEMANTIC_ROLES": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "TraceService", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Как работает TraceService?", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C4_SEMANTIC_ROLES", - "query": "Как работает TraceService?", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "Как работает TraceService?", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - }, - { - "layer": "C3_ENTRYPOINTS", - "query": "Как работает TraceService?", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 1, - "candidates_after_filter": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 6, - "candidates_after_filter": 6 - }, - { - "layer": "C3_ENTRYPOINTS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 3, - "candidates_after_filter": 3 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "TraceService", - "alternatives": [ - "TraceService" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 3, - "fail_reason": null - }, - { - "layer": "C4_SEMANTIC_ROLES", - "status": "hit", - "hit_count": 8, - "fail_reason": null - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 6, - "fail_reason": null - }, - { - "layer": "C3_ENTRYPOINTS", - "status": "hit", - "hit_count": 3, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "router": 1, - "symbol_resolution": 0, - "retrieval_total": 150, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 50, - "C0_SOURCE_CHUNKS": 21, - "C4_SEMANTIC_ROLES": 17, - "C2_DEPENDENCY_GRAPH": 48, - "C3_ENTRYPOINTS": 11 - }, - "merge_rank": 24, - "prompt_build": 0, - "llm_call": 5616 - }, - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 371, - "evidence_rows": 21, - "evidence_chars": 7281 - }, - "evidence_summary": [ - { - "layer": "C1_SYMBOL_CATALOG", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "count": 8, - "unique_paths": 8 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "count": 6, - "unique_paths": 1 - }, - { - "layer": "C3_ENTRYPOINTS", - "count": 3, - "unique_paths": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 3, - "unique_paths": 1 - } - ], - "prompt_template_id": "intent_code_qa_v1", - "system_prompt_version": "v1" - }, - "router": { - "conversation_mode": "START", - "keyword_hints": [ - "TraceService" - ], - "path_scope": [] - }, - "llm": { - "used_evidence_count": 21, - "missing_evidence_reason": null - } - }, - "run_info": { - "case_id": "plba-fullchain-explain-trace-service", - "mode": "full_chain", - "run_started_at": "2026-03-12T09:11:50", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - }, - "input_request": { - "text": "Как работает TraceService?", - "normalized_query": "Как работает TraceService?" - }, - "steps": [ - { - "step": "intent_router", - "input": { - "query": "Как работает TraceService?" - }, - "output": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Как работает TraceService?" - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "TraceService" - ], - "keyword_hints": [ - "TraceService" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "timings_ms": { - "router": 1 - } - } - }, - { - "step": "retrieval", - "input": { - "query": "Как работает TraceService?" - }, - "output": { - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "TraceService", - "alternatives": [ - "TraceService" - ], - "confidence": 0.99 - }, - "rag_count": 21, - "rag_rows": [ - { - "path": "src/app_runtime/tracing/service.py", - "content": "class TraceService\nTraceService(TraceContextFactory)", - "layer": "C1_SYMBOL_CATALOG", - "title": "TraceService", - "span_start": 39, - "span_end": 166, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "c2b2b976d99f2c600000b753731b26e0a69adcb4359398b93073590c5d5d04f4", - "qname": "TraceService", - "kind": "class", - "signature": "TraceService(TraceContextFactory)", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.tracing.service", - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "TraceService\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests service\n- reads and writes state attributes\n- participates in dataflow slices (13)", - "layer": "C4_SEMANTIC_ROLES", - "title": "TraceService", - "span_start": 39, - "span_end": 166, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 60, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "c2b2b976d99f2c600000b753731b26e0a69adcb4359398b93073590c5d5d04f4", - "symbol_name": "TraceService", - "qname": "TraceService", - "role": "pipeline_stage", - "confidence": 0.57, - "dataflow_participation": 13, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_runner.py", - "content": "UvicornThreadRunner\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (24)", - "layer": "C4_SEMANTIC_ROLES", - "title": "UvicornThreadRunner", - "span_start": 10, - "span_end": 61, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 11, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "fd55630045a02100df8877ac27d951ee08617d4598764394d48cb51fe067476a", - "symbol_name": "UvicornThreadRunner", - "qname": "UvicornThreadRunner", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 24, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "3779fdd2878b770e789a35bb2a89c9d79f13b61c26d7db1b3b683f9bb9e1623f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/persistence/workflow_persistence.py", - "content": "WorkflowPersistence\nrole: pipeline_stage\n\nResponsibilities:\n- orchestrates role-like calls (2)\n- reads and writes state attributes\n- participates in dataflow slices (16)", - "layer": "C4_SEMANTIC_ROLES", - "title": "WorkflowPersistence", - "span_start": 8, - "span_end": 54, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 15, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "7bd01ee45cf31f2d5c2e3e51656254860ac785d10cef9e0852cd4fba90857bae", - "symbol_name": "WorkflowPersistence", - "qname": "WorkflowPersistence", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 16, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "80e9410ddc639789b4353c2a1a757ba8d0d5b5bb6075b0b263b61551f04ae1f0", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (10)", - "layer": "C4_SEMANTIC_ROLES", - "title": "HttpControlChannel", - "span_start": 12, - "span_end": 57, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 21, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "1c9fbdc24819e5604c26ea55428a74310f03a03e1af197ed84846af61e42fdb0", - "symbol_name": "HttpControlChannel", - "qname": "HttpControlChannel", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 10, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/queue/in_memory.py", - "content": "InMemoryTaskQueue\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (9)", - "layer": "C4_SEMANTIC_ROLES", - "title": "InMemoryTaskQueue", - "span_start": 9, - "span_end": 38, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 22, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "2da04cb94544a3bcbf0943a95ad4bdd8710bcafaa32a02fd0e4de2178dcf3533", - "symbol_name": "InMemoryTaskQueue", - "qname": "InMemoryTaskQueue", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 9, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "58f0cc001ccda0eee4c6bc32ed83bd05eafd6b6644f1e8b4aa9eed3103db73dc", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/config/file_loader.py", - "content": "ConfigFileLoader\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (8)", - "layer": "C4_SEMANTIC_ROLES", - "title": "ConfigFileLoader", - "span_start": 11, - "span_end": 48, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 23, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "a8474eca8b6e9dc86ae67ed68b16fa5fb639ef08739c053e7b7195489765667f", - "symbol_name": "ConfigFileLoader", - "qname": "ConfigFileLoader", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 8, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "1f19ffebde5e38e4be5a5d5a678059a0f36dedb8fb8b3e00ab395c67106a87ea", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/store.py", - "content": "TraceContextStore\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (6)", - "layer": "C4_SEMANTIC_ROLES", - "title": "TraceContextStore", - "span_start": 15, - "span_end": 52, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 25, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "b2dad4fbe16ffb11b58deba311c7739955c39d59f291b22181f33e9c8cce4059", - "symbol_name": "TraceContextStore", - "qname": "TraceContextStore", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 6, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "d369554f08fc92039c6edd5a2a1e73b23901533e8974459170bbd9347d263dc5", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workers/supervisor.py", - "content": "WorkerSupervisor\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (6)", - "layer": "C4_SEMANTIC_ROLES", - "title": "WorkerSupervisor", - "span_start": 10, - "span_end": 59, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 25, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "c17b44e8d9e97d490989b21fa67d7c346cdda8a0472e4c41fb243c8846faa124", - "symbol_name": "WorkerSupervisor", - "qname": "WorkerSupervisor", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 6, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "77609d9d5927171cce7fc3a54897c183fd63068710c6362029b700937aae5eee", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "TraceService.__init__\n -> TraceService.store\n -> TraceService.create_context", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "TraceService.__init__:dataflow_slice", - "span_start": 42, - "span_end": 61, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "3b052062067a78aef3302ee1d996897e02a67d1b340397bea4f59fe147c0492a", - "edge_type": "dataflow_slice", - "src_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "src_qname": "TraceService.__init__", - "dst_symbol_id": "ff44881104b65ef50ee6fe16d367d4a81b6e7eb5c44c0963cf4543faec785d4a", - "dst_ref": "TraceService.create_context", - "resolution": "resolved", - "slice_id": "3b052062067a78aef3302ee1d996897e02a67d1b340397bea4f59fe147c0492a", - "root_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "path_symbols": [ - "TraceService.__init__", - "TraceService.store", - "TraceService.create_context" - ], - "path_symbol_ids": [ - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "ff44881104b65ef50ee6fe16d367d4a81b6e7eb5c44c0963cf4543faec785d4a" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "TraceService.__init__\n -> TraceService.store\n -> TraceService.close_context", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "TraceService.__init__:dataflow_slice", - "span_start": 42, - "span_end": 84, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "7a9353ef57c9ae5d19b3a0c6ac50fad05e6d21d31bbe1cd1cd07af6332ba6505", - "edge_type": "dataflow_slice", - "src_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "src_qname": "TraceService.__init__", - "dst_symbol_id": "01e14158dcced7e52d0c8ac84ac7b9a75225c261b6aca6a1d7da802d0994721c", - "dst_ref": "TraceService.close_context", - "resolution": "resolved", - "slice_id": "7a9353ef57c9ae5d19b3a0c6ac50fad05e6d21d31bbe1cd1cd07af6332ba6505", - "root_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "path_symbols": [ - "TraceService.__init__", - "TraceService.store", - "TraceService.close_context" - ], - "path_symbol_ids": [ - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "01e14158dcced7e52d0c8ac84ac7b9a75225c261b6aca6a1d7da802d0994721c" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "TraceService.__init__\n -> TraceService.store\n -> TraceService.open_context", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "TraceService.__init__:dataflow_slice", - "span_start": 42, - "span_end": 78, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "a6e13b9ebc4fed84586afd53ed92a4d14757e440873f572b2337d5622ee96031", - "edge_type": "dataflow_slice", - "src_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "src_qname": "TraceService.__init__", - "dst_symbol_id": "2da3d5b20a947bf63e14c103be4689b72fd837e0a82abd6c497846375d4c7426", - "dst_ref": "TraceService.open_context", - "resolution": "resolved", - "slice_id": "a6e13b9ebc4fed84586afd53ed92a4d14757e440873f572b2337d5622ee96031", - "root_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "path_symbols": [ - "TraceService.__init__", - "TraceService.store", - "TraceService.open_context" - ], - "path_symbol_ids": [ - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "2da3d5b20a947bf63e14c103be4689b72fd837e0a82abd6c497846375d4c7426" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "TraceService.__init__\n -> TraceService.transport\n -> TraceService.__init__", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "TraceService.__init__:dataflow_slice", - "span_start": 41, - "span_end": 43, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "1e923a93faa05c3c43ca9b19bd047007a8589ccce57d3cc1798ae7f9f200af98", - "edge_type": "dataflow_slice", - "src_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "src_qname": "TraceService.__init__", - "dst_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "dst_ref": "TraceService.__init__", - "resolution": "resolved", - "slice_id": "1e923a93faa05c3c43ca9b19bd047007a8589ccce57d3cc1798ae7f9f200af98", - "root_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "path_symbols": [ - "TraceService.__init__", - "TraceService.transport", - "TraceService.__init__" - ], - "path_symbol_ids": [ - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "TraceService.__init__\n -> TraceService.store\n -> TraceService.current_trace_id", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "TraceService.__init__:dataflow_slice", - "span_start": 42, - "span_end": 81, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "3ea17138634b1190bded77ddb84aa1595124f6519b246f24fc4b02bd62b5cac1", - "edge_type": "dataflow_slice", - "src_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "src_qname": "TraceService.__init__", - "dst_symbol_id": "41135180f7b3b9ab20e097e0747474e219c37dd2366ef08a7b43c1f3edb10b4c", - "dst_ref": "TraceService.current_trace_id", - "resolution": "resolved", - "slice_id": "3ea17138634b1190bded77ddb84aa1595124f6519b246f24fc4b02bd62b5cac1", - "root_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "path_symbols": [ - "TraceService.__init__", - "TraceService.store", - "TraceService.current_trace_id" - ], - "path_symbol_ids": [ - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "41135180f7b3b9ab20e097e0747474e219c37dd2366ef08a7b43c1f3edb10b4c" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "TraceService.__init__\n -> TraceService.store\n -> TraceService.step", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "TraceService.__init__:dataflow_slice", - "span_start": 42, - "span_end": 88, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "9f34c5da9b09fba99df6f6b1bde183a9aeb45111b8218a747c71590c2c9f60f2", - "edge_type": "dataflow_slice", - "src_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "src_qname": "TraceService.__init__", - "dst_symbol_id": "c44bfbc66cf747283f30088da3e011a10395031d41e77b74e523c24997f641ca", - "dst_ref": "TraceService.step", - "resolution": "resolved", - "slice_id": "9f34c5da9b09fba99df6f6b1bde183a9aeb45111b8218a747c71590c2c9f60f2", - "root_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "path_symbols": [ - "TraceService.__init__", - "TraceService.store", - "TraceService.step" - ], - "path_symbol_ids": [ - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "c44bfbc66cf747283f30088da3e011a10395031d41e77b74e523c24997f641ca" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "class TraceRecordWriter:\n def __init__(self, transport: TraceTransport) -> None:\n self._logger = logging.getLogger(__name__)\n self._transport = transport\n\n def write_context(self, record: TraceContextRecord) -> None:\n try:\n self._transport.write_context(record)\n except Exception:\n self._logger.exception(\"Trace transport failed to write context %s\", record.trace_id)\n\n def write_message(self, record: TraceLogMessage) -> None:\n try:\n self._transport.write_message(record)\n except Exception:\n self._logger.exception(\"Trace transport failed to write message for %s\", record.trace_id)", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/tracing/service.py:TraceRecordWriter", - "span_start": 21, - "span_end": 36, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.tracing.service", - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "class TraceService(TraceContextFactory):\n def __init__(self, transport: TraceTransport | None = None, store: TraceContextStore | None = None) -> None:\n self.transport = transport or NoOpTraceTransport()\n self.store = store or TraceContextStore()\n self._writer = TraceRecordWriter(self.transport)\n\n def create_context(\n self,\n *,\n alias: str,\n parent_id: str | None = None,\n kind: str | None = None,\n attrs: dict[str, Any] | None = None,\n ) -> str:\n record = TraceContextRecord(\n trace_id=uuid4().hex,\n alias=str(alias or \"\"),\n parent_id=parent_id,\n type=kind,\n event_time=utc_now(),\n attrs=dict(attrs or {}),\n )\n self.store.push(record)\n self._writer.write_context(record)\n return record.trace_id\n\n @contextmanager\n def open_context(\n self,\n *,\n alias: str,\n parent_id: str | None = None,\n kind: str | None = None,\n attrs: dict[str, Any] | None = None,\n ) -> Iterator[str]:\n trace_id = self.create_context(alias=alias, parent_id=parent_id, kind=kind, attrs=attrs)\n try:\n yield trace_id\n finally:\n self.store.pop()\n\n def current_trace_id(self) -> str | None:\n return self.store.current_trace_id()\n\n def close_context(self) -> str | None:\n previous = self.store.pop()\n return previous.record.trace_id if previous else None\n\n def step(self, name: str) -> None:\n self.store.set_step(str(name or \"\"))\n\n def info(self, message: str, *, status: str | None = None, attrs: dict[str, Any] | None = None) -> None:\n self._write_message(\"INFO\", message, status, attrs)\n\n def debug(self, message: str, *, status: str | None = None, attrs: dict[str, Any] | None = None) -> None:\n self._write_message(\"DEBUG\", message, status, attrs)\n\n def warning(self, message: str, *, status: str | None = None, attrs: dict[str, Any] | None = None) -> None:\n self._write_message(\"WARNING\", message, status, attrs)\n\n def error(self, message: str, *, status: str | None = None, attrs: dict[str, Any] | None = None) -> None:\n self._write_message(\"ERROR\", message, status, attrs)\n\n def exception(self, message: str, *, status: str = \"failed\", attrs: dict[str, Any] | None = None) -> None:\n self._write_message(\"ERROR\", message, status, attrs)\n\n def new_root(self, operation: str) -> TraceContext:\n trace_id = self.create_context(alias=operation, kind=\"operation\", attrs={\"operation\": operation})\n return TraceContext(trace_id=trace_id, span_id=trace_id, attributes={\"operation\": operation})\n\n def child_of(self, parent: TraceContext, operation: str) -> TraceContext:\n trace_id = self.create_context(\n alias=operation,\n parent_id=parent.trace_id,\n kind=\"worker\",\n attrs={\"operation\": operation},\n )\n return TraceContext(\n trace_id=trace_id,\n span_id=trace_id,\n parent_span_id=parent.span_id,\n attributes={\"operation\": operation},\n )\n\n def attach(self, metadata: dict[str, object], context: TraceContext) -> dict[str, object]:\n updated = dict(metadata)\n updated[\"trace_id\"] = context.trace_id\n updated[\"span_id\"] = context.span_id\n updated[\"parent_span_id\"] = context.parent_span_id\n return updated\n\n def resume(self, metadata: dict[str, object], operation: str) -> TraceContext:\n trace_id = str(metadata.get(\"trace_id\") or uuid4().hex)\n span_id = str(metadata.get(\"span_id\") or trace_id)\n parent_id = metadata.get(\"parent_span_id\")\n self.create_context(\n alias=operation,\n parent_id=str(parent_id) if parent_id else None,\n kind=\"worker\",\n attrs=dict(metadata),\n )\n return TraceContext(\n trace_id=trace_id,\n span_id=span_id,\n parent_span_id=str(parent_id) if parent_id else None,\n attributes={\"operation\": operation},\n )\n\n def _write_message(\n self,\n level: TraceLevel,\n message: str,\n status: str | None,\n attrs: dict[str, Any] | None,\n ) -> None:\n active = self.store.current()\n if active is None:\n raise RuntimeError(\"Trace context is not bound. Call create_context() first.\")\n record = TraceLogMessage(\n trace_id=active.record.trace_id,\n step=active.step,\n status=str(status or \"\"),\n message=str(message or \"\"),\n level=level,\n event_time=utc_now(),\n attrs=dict(attrs or {}),\n )\n self._writer.write_message(record)", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/tracing/service.py:TraceService", - "span_start": 39, - "span_end": 166, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 1, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.tracing.service", - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "class TraceManager(TraceService):\n \"\"\"Compatibility alias during the transition from ConfigManager-shaped naming.\"\"\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/tracing/service.py:TraceManager", - "span_start": 169, - "span_end": 170, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 2, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.tracing.service", - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ] - }, - "diagnostics": { - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C0_SOURCE_CHUNKS": "exact_path_fetch", - "C4_SEMANTIC_ROLES": "exact_path_fetch", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C3_ENTRYPOINTS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 8, - "C4_SEMANTIC_ROLES": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C3_ENTRYPOINTS": 6 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C4_SEMANTIC_ROLES": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "TraceService", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Как работает TraceService?", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C4_SEMANTIC_ROLES", - "query": "Как работает TraceService?", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "Как работает TraceService?", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - }, - { - "layer": "C3_ENTRYPOINTS", - "query": "Как работает TraceService?", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 1, - "candidates_after_filter": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 6, - "candidates_after_filter": 6 - }, - { - "layer": "C3_ENTRYPOINTS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 3, - "candidates_after_filter": 3 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "TraceService", - "alternatives": [ - "TraceService" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 3, - "fail_reason": null - }, - { - "layer": "C4_SEMANTIC_ROLES", - "status": "hit", - "hit_count": 8, - "fail_reason": null - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 6, - "fail_reason": null - }, - { - "layer": "C3_ENTRYPOINTS", - "status": "hit", - "hit_count": 3, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "symbol_resolution": 0, - "retrieval_total": 150, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 50, - "C0_SOURCE_CHUNKS": 21, - "C4_SEMANTIC_ROLES": 17, - "C2_DEPENDENCY_GRAPH": 48, - "C3_ENTRYPOINTS": 11 - }, - "merge_rank": 24 - } - } - }, - { - "step": "llm_answer", - "input": { - "query": "Как работает TraceService?", - "rag_count": 21 - }, - "output": { - "llm_answer": "## Анализ архитектуры и поведения системы с участием `TraceService`\n\n### Описание роли и ответственности компонента\n\nВ системе предоставлены несколько компонентов, выполняющих роль pipeline stage и участвующих в управлении состоянием приложения и его данными. Рассмотрим подробнее один из них — **`TraceService`**.\n\n---\n\n### Поведение и архитектура `TraceService`\n\n#### 1. Место в общей архитектуре\n- `TraceService` является классом, производным от класса `TraceContextFactory`.\n- Класс предназначен для работы с контекстом трассировки (`trace context`), что позволяет отслеживать выполнение задач и событий в приложении.\n \n#### 2. Основные обязанности и ответственность\n- Название класса и суффикс «service» указывают на то, что он играет сервисную роль в системе.\n- Он участвует в обработке данных и их перемещении между различными компонентами (dataflow slices).\n- Имеет доступ к атрибутам состояния и может изменять их значение.\n\n#### 3. Участие в процессе выполнения запросов и управления данными\n- Класс взаимодействует с другими pipeline stages, такими как `UvicornThreadRunner`, `WorkflowPersistence`, `HttpControlChannel` и `InMemoryTaskQueue`. Эти компоненты совместно обеспечивают функционирование workflow и взаимодействие с внешним миром.\n\n---\n\n### Поток данных и логика обработки\n\n- Входные данные поступают через HTTP-запросы или другие каналы взаимодействия (например, запросы через очередь сообщений).\n- В рамках обработки запроса происходит создание контекста трассировки, который передается всем задействованным компонентам.\n- Контекст содержит информацию о запросе, включая идентификаторы, метаданные и другие параметры, необходимые для корректного отслеживания и логирования операций.\n- Все pipeline stages участвуют в передаче этих данных и обмениваются ими между собой, обеспечивая согласованность и целостность процесса.\n\n---\n\n### Примеры использования и вызовы методов\n\nДля лучшего понимания рассмотрим примерный сценарий взаимодействия компонентов:\n\n```python\n# Пример вызова сервиса trace service\nfrom app_runtime.tracing.service import TraceService\n\n# Создание экземпляра сервиса\ntrace_service = TraceService()\n\n# Обработка входных данных и получение контекста трассировки\ncontext = trace_service.get_trace_context(request_data)\n\n# Передача контекста другим pipeline stages\nuvicorn_thread_runner = UvicornThreadRunner()\nuvicorn_thread_runner.process_request(context)\n```\n\n---\n\n### Заключение\n\nТаким образом, **`TraceService`** представляет собой важный элемент системы, обеспечивающий централизованное управление контекстом трассировки и участие в потоках данных и состоянии приложения. Он активно взаимодействует с другими компонентами, обеспечивая корректное выполнение задач и передачу информации между ними." - }, - "diagnostics": { - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 371, - "evidence_rows": 21, - "evidence_chars": 7281 - }, - "evidence_summary": [ - { - "layer": "C1_SYMBOL_CATALOG", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "count": 8, - "unique_paths": 8 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "count": 6, - "unique_paths": 1 - }, - { - "layer": "C3_ENTRYPOINTS", - "count": 3, - "unique_paths": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 3, - "unique_paths": 1 - } - ], - "prompt_template_id": "intent_code_qa_v1", - "system_prompt_version": "v1" - }, - "timings_ms": { - "prompt_build": 0, - "llm_call": 5616 - } - } - } - ] - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_091150/full_chain_plba_code_retrieval_plba-fullchain-explain-trace-service.md b/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_091150/full_chain_plba_code_retrieval_plba-fullchain-explain-trace-service.md deleted file mode 100644 index c6573ba..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_091150/full_chain_plba_code_retrieval_plba-fullchain-explain-trace-service.md +++ /dev/null @@ -1,34 +0,0 @@ -# plba-fullchain-explain-trace-service - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_retrieval.yaml -- runner: runtime -- mode: full_chain -- passed: True - -## Query -Как работает TraceService? - -## Actual -{ - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 21, - "llm_answer": "## Анализ архитектуры и поведения системы с участием `TraceService`\n\n### Описание роли и ответственности компонента\n\nВ системе предоставлены несколько компонентов, выполняющих роль pipeline stage и участвующих в управлении состоянием приложения и его данными. Рассмотрим подробнее один из них — **`TraceService`**.\n\n---\n\n### Поведение и архитектура `TraceService`\n\n#### 1. Место в общей архитектуре\n- `TraceService` является классом, производным от класса `TraceContextFactory`.\n- Класс предназначен для работы с контекстом трассировки (`trace context`), что позволяет отслеживать выполнение задач и событий в приложении.\n \n#### 2. Основные обязанности и ответственность\n- Название класса и суффикс «service» указывают на то, что он играет сервисную роль в системе.\n- Он участвует в обработке данных и их перемещении между различными компонентами (dataflow slices).\n- Имеет доступ к атрибутам состояния и может изменять их значение.\n\n#### 3. Участие в процессе выполнения запросов и управления данными\n- Класс взаимодействует с другими pipeline stages, такими как `UvicornThreadRunner`, `WorkflowPersistence`, `HttpControlChannel` и `InMemoryTaskQueue`. Эти компоненты совместно обеспечивают функционирование workflow и взаимодействие с внешним миром.\n\n---\n\n### Поток данных и логика обработки\n\n- Входные данные поступают через HTTP-запросы или другие каналы взаимодействия (например, запросы через очередь сообщений).\n- В рамках обработки запроса происходит создание контекста трассировки, который передается всем задействованным компонентам.\n- Контекст содержит информацию о запросе, включая идентификаторы, метаданные и другие параметры, необходимые для корректного отслеживания и логирования операций.\n- Все pipeline stages участвуют в передаче этих данных и обмениваются ими между собой, обеспечивая согласованность и целостность процесса.\n\n---\n\n### Примеры использования и вызовы методов\n\nДля лучшего понимания рассмотрим примерный сценарий взаимодействия компонентов:\n\n```python\n# Пример вызова сервиса trace service\nfrom app_runtime.tracing.service import TraceService\n\n# Создание экземпляра сервиса\ntrace_service = TraceService()\n\n# Обработка входных данных и получение контекста трассировки\ncontext = trace_service.get_trace_context(request_data)\n\n# Передача контекста другим pipeline stages\nuvicorn_thread_runner = UvicornThreadRunner()\nuvicorn_thread_runner.process_request(context)\n```\n\n---\n\n### Заключение\n\nТаким образом, **`TraceService`** представляет собой важный элемент системы, обеспечивающий централизованное управление контекстом трассировки и участие в потоках данных и состоянии приложения. Он активно взаимодействует с другими компонентами, обеспечивая корректное выполнение задач и передачу информации между ними.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "TraceService" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] -} - -## Mismatches -- none \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_091150/full_chain_plba_code_retrieval_plba-fullchain-explain-workflow-engine.json b/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_091150/full_chain_plba_code_retrieval_plba-fullchain-explain-workflow-engine.json deleted file mode 100644 index 409601d..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_091150/full_chain_plba_code_retrieval_plba-fullchain-explain-workflow-engine.json +++ /dev/null @@ -1,2634 +0,0 @@ -{ - "case_id": "plba-fullchain-explain-workflow-engine", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_retrieval.yaml", - "runner": "runtime", - "mode": "full_chain", - "actual": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 20, - "llm_answer": "## Архитектура и Поведение `WorkflowEngine`\n\n### Описание класса `WorkflowEngine` (`src/app_runtime/workflow/engine/workflow_engine.py`)\n\n**Класс:** \n`WorkflowEngine`\n\n**Роль:** \n`pipeline_stage`\n\n**Ответственности:** \n- Чтение и запись атрибутов состояния.\n- Участие в срезах данных потока (dataflow slices).\n\n---\n\n### Поток данных и структура работы\n\n1. **Входные данные**\n - Данные передаются через состояние приложения или из внешних источников (например, REST API вызовов).\n \n2. **Основная логика работы `WorkflowEngine`:**\n 1. Принимает входные данные (через чтение атрибутов состояния).\n 2. Определяет текущее состояние системы на основе этих данных.\n 3. Использует внутренние механизмы для разрешения переходов между этапами выполнения workflow.\n 4. Записывает новое состояние после обработки.\n\n3. **Связь с другими сущностями:**\n - **WorkflowEngineHooks:** \n Класс отвечает за определение стандартного поведения модели, используемой внутри workflow engine. В основном он выполняет действия по умолчанию, которые могут быть переопределены пользователем.\n \n - **TransitionResolver:** \n Используется для определения правил перехода между различными стадиями workflow. Этот механизм решает, как именно должны выполняться шаги workflow и какие условия их активируют.\n\n4. **Участие в потоках данных (dataflow slices):**\n - **Dataflow Slices (6):** \n Срезы данных обеспечивают возможность параллельного выполнения различных частей workflow одновременно, что улучшает производительность системы.\n - **Dataflow Slices (24):** \n Другой набор параллельных потоков, организованных через `UvicornThreadRunner`, обеспечивает параллельность выполнения HTTP-запросов и других асинхронных задач.\n\n5. **Пример взаимодействия с внешними компонентами:**\n - Работа через внешние HTTP вызовы (`UvicornThreadRunner`) позволяет запускать различные задачи параллельно и возвращать результаты обратно в систему workflow.\n\n---\n\n### Ключевые моменты реализации:\n\n- `WorkflowEngine` выступает центральным элементом всей логики workflow и координирует выполнение этапов.\n- Все этапы определяются через правила перехода (`TransitionResolver`), которые помогают системе двигаться от одного этапа к другому.\n- Использование срезов данных и параллелизма (6 и 24 потоков) позволяет оптимизировать обработку и улучшить общую производительность.\n\n---\n\n### Заключение\n\n`WorkflowEngine` является ключевым компонентом системы управления workflow, отвечающим за координацию и управление процессом выполнения шагов workflow. Он взаимодействует с различными модулями, такими как `WorkflowEngineHooks` и `TransitionResolver`, обеспечивая корректное выполнение всех необходимых действий. Параллельная обработка (до 24 потоков) и четкая структура правил перехода делают этот подход эффективным и масштабируемым решением.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "WorkflowEngine" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "passed": true, - "mismatches": [], - "details": { - "case_id": "plba-fullchain-explain-workflow-engine", - "text": "Объясни класс WorkflowEngine", - "mode": "full_chain", - "run_started_at": "2026-03-12T09:11:50", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Объясни класс WorkflowEngine", - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "WorkflowEngine", - "alternatives": [ - "WorkflowEngine", - "WorkflowEngineHooks" - ], - "confidence": 0.99 - }, - "rag_count": 20, - "rag_rows": [ - { - "path": "src/app_runtime/workflow/engine/workflow_engine.py", - "content": "class WorkflowEngine\nWorkflowEngine", - "layer": "C1_SYMBOL_CATALOG", - "title": "WorkflowEngine", - "span_start": 10, - "span_end": 86, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "57ec0a9f11c542c78e008684a888397e8d9ef4223671acb2567e631a0cbc70b4", - "qname": "WorkflowEngine", - "kind": "class", - "signature": "WorkflowEngine", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.workflow.engine.workflow_engine", - "is_test": false, - "blob_sha": "1057136e58a325cd5ab6f4e265d15665fb6a711b7022d9fab52a1a290afa2368", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/engine/hooks.py", - "content": "class WorkflowEngineHooks\nWorkflowEngineHooks", - "layer": "C1_SYMBOL_CATALOG", - "title": "WorkflowEngineHooks", - "span_start": 6, - "span_end": 14, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "914123ed510540061e116100fc87bba4195595ba696f8bfde2fd77ac6a5cd7e4", - "qname": "WorkflowEngineHooks", - "kind": "class", - "signature": "WorkflowEngineHooks", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.workflow.engine.hooks", - "is_test": false, - "blob_sha": "4b11672b0a9af1ae04bfce9d8e1f96572997d3e65e68108d7c797b88fa5fa47a", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/engine/workflow_engine.py", - "content": "WorkflowEngine\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (6)", - "layer": "C4_SEMANTIC_ROLES", - "title": "WorkflowEngine", - "span_start": 10, - "span_end": 86, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 25, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "57ec0a9f11c542c78e008684a888397e8d9ef4223671acb2567e631a0cbc70b4", - "symbol_name": "WorkflowEngine", - "qname": "WorkflowEngine", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 6, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "1057136e58a325cd5ab6f4e265d15665fb6a711b7022d9fab52a1a290afa2368", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/engine/hooks.py", - "content": "WorkflowEngineHooks\nrole: model\n\nResponsibilities:\n- default model role", - "layer": "C4_SEMANTIC_ROLES", - "title": "WorkflowEngineHooks", - "span_start": 6, - "span_end": 14, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 40, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "914123ed510540061e116100fc87bba4195595ba696f8bfde2fd77ac6a5cd7e4", - "symbol_name": "WorkflowEngineHooks", - "qname": "WorkflowEngineHooks", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "4b11672b0a9af1ae04bfce9d8e1f96572997d3e65e68108d7c797b88fa5fa47a", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/engine/transition_resolver.py", - "content": "TransitionResolver\nrole: model\n\nResponsibilities:\n- default model role", - "layer": "C4_SEMANTIC_ROLES", - "title": "TransitionResolver", - "span_start": 7, - "span_end": 9, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 40, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "d1979f0b23d354338debf7771373226833d57c1e7830ce66ca0b82cdf209b958", - "symbol_name": "TransitionResolver", - "qname": "TransitionResolver", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "2c518f4c77fb5dcc2970b88f55a7b121d05959578fb0d196af92ff5193574838", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_runner.py", - "content": "UvicornThreadRunner\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (24)", - "layer": "C4_SEMANTIC_ROLES", - "title": "UvicornThreadRunner", - "span_start": 10, - "span_end": 61, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 11, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "fd55630045a02100df8877ac27d951ee08617d4598764394d48cb51fe067476a", - "symbol_name": "UvicornThreadRunner", - "qname": "UvicornThreadRunner", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 24, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "3779fdd2878b770e789a35bb2a89c9d79f13b61c26d7db1b3b683f9bb9e1623f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/persistence/workflow_persistence.py", - "content": "WorkflowPersistence\nrole: pipeline_stage\n\nResponsibilities:\n- orchestrates role-like calls (2)\n- reads and writes state attributes\n- participates in dataflow slices (16)", - "layer": "C4_SEMANTIC_ROLES", - "title": "WorkflowPersistence", - "span_start": 8, - "span_end": 54, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 15, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "7bd01ee45cf31f2d5c2e3e51656254860ac785d10cef9e0852cd4fba90857bae", - "symbol_name": "WorkflowPersistence", - "qname": "WorkflowPersistence", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 16, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "80e9410ddc639789b4353c2a1a757ba8d0d5b5bb6075b0b263b61551f04ae1f0", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (10)", - "layer": "C4_SEMANTIC_ROLES", - "title": "HttpControlChannel", - "span_start": 12, - "span_end": 57, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 21, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "1c9fbdc24819e5604c26ea55428a74310f03a03e1af197ed84846af61e42fdb0", - "symbol_name": "HttpControlChannel", - "qname": "HttpControlChannel", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 10, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/queue/in_memory.py", - "content": "InMemoryTaskQueue\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (9)", - "layer": "C4_SEMANTIC_ROLES", - "title": "InMemoryTaskQueue", - "span_start": 9, - "span_end": 38, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 22, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "2da04cb94544a3bcbf0943a95ad4bdd8710bcafaa32a02fd0e4de2178dcf3533", - "symbol_name": "InMemoryTaskQueue", - "qname": "InMemoryTaskQueue", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 9, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "58f0cc001ccda0eee4c6bc32ed83bd05eafd6b6644f1e8b4aa9eed3103db73dc", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/config/file_loader.py", - "content": "ConfigFileLoader\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (8)", - "layer": "C4_SEMANTIC_ROLES", - "title": "ConfigFileLoader", - "span_start": 11, - "span_end": 48, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 23, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "a8474eca8b6e9dc86ae67ed68b16fa5fb639ef08739c053e7b7195489765667f", - "symbol_name": "ConfigFileLoader", - "qname": "ConfigFileLoader", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 8, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "1f19ffebde5e38e4be5a5d5a678059a0f36dedb8fb8b3e00ab395c67106a87ea", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/engine/workflow_engine.py", - "content": "WorkflowEngine.__init__\n -> WorkflowEngine._transition_resolver\n -> WorkflowEngine.run", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "WorkflowEngine.__init__:dataflow_slice", - "span_start": 14, - "span_end": 63, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "3abf07e5c245e0fe59785ba2d569c2ee56018715fc7f625a044ddaf6201f903d", - "edge_type": "dataflow_slice", - "src_symbol_id": "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "src_qname": "WorkflowEngine.__init__", - "dst_symbol_id": "a12cad0f5b238287e02f6d8d156cc764351d8c83246930487fa09d5ce6f2ace8", - "dst_ref": "WorkflowEngine.run", - "resolution": "resolved", - "slice_id": "3abf07e5c245e0fe59785ba2d569c2ee56018715fc7f625a044ddaf6201f903d", - "root_symbol_id": "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "path_symbols": [ - "WorkflowEngine.__init__", - "WorkflowEngine._transition_resolver", - "WorkflowEngine.run" - ], - "path_symbol_ids": [ - "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "a12cad0f5b238287e02f6d8d156cc764351d8c83246930487fa09d5ce6f2ace8" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "1057136e58a325cd5ab6f4e265d15665fb6a711b7022d9fab52a1a290afa2368", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/engine/workflow_engine.py", - "content": "WorkflowEngine.__init__\n -> WorkflowEngine._hooks\n -> WorkflowEngine.run", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "WorkflowEngine.__init__:dataflow_slice", - "span_start": 16, - "span_end": 34, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "d73db644b69c1eb35afd6eae9d6ac8674e49e30e9bcf9c020f9fdbfe754851b2", - "edge_type": "dataflow_slice", - "src_symbol_id": "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "src_qname": "WorkflowEngine.__init__", - "dst_symbol_id": "a12cad0f5b238287e02f6d8d156cc764351d8c83246930487fa09d5ce6f2ace8", - "dst_ref": "WorkflowEngine.run", - "resolution": "resolved", - "slice_id": "d73db644b69c1eb35afd6eae9d6ac8674e49e30e9bcf9c020f9fdbfe754851b2", - "root_symbol_id": "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "path_symbols": [ - "WorkflowEngine.__init__", - "WorkflowEngine._hooks", - "WorkflowEngine.run" - ], - "path_symbol_ids": [ - "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "a12cad0f5b238287e02f6d8d156cc764351d8c83246930487fa09d5ce6f2ace8" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "1057136e58a325cd5ab6f4e265d15665fb6a711b7022d9fab52a1a290afa2368", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/engine/workflow_engine.py", - "content": "WorkflowEngine.__init__\n -> WorkflowEngine._workflow\n -> WorkflowEngine.run", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "WorkflowEngine.__init__:dataflow_slice", - "span_start": 12, - "span_end": 29, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "b45ef3c54669b4910a8aed3a565804f275424a24007bc7e3c953389521f80249", - "edge_type": "dataflow_slice", - "src_symbol_id": "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "src_qname": "WorkflowEngine.__init__", - "dst_symbol_id": "a12cad0f5b238287e02f6d8d156cc764351d8c83246930487fa09d5ce6f2ace8", - "dst_ref": "WorkflowEngine.run", - "resolution": "resolved", - "slice_id": "b45ef3c54669b4910a8aed3a565804f275424a24007bc7e3c953389521f80249", - "root_symbol_id": "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "path_symbols": [ - "WorkflowEngine.__init__", - "WorkflowEngine._workflow", - "WorkflowEngine.run" - ], - "path_symbol_ids": [ - "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "a12cad0f5b238287e02f6d8d156cc764351d8c83246930487fa09d5ce6f2ace8" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "1057136e58a325cd5ab6f4e265d15665fb6a711b7022d9fab52a1a290afa2368", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/engine/workflow_engine.py", - "content": "WorkflowEngine.__init__\n -> WorkflowEngine._persistence\n -> WorkflowEngine.run", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "WorkflowEngine.__init__:dataflow_slice", - "span_start": 13, - "span_end": 20, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "8101338770016324ce05d61daa9935a444c75e6c94a0fae4275d5b50fcbcc70b", - "edge_type": "dataflow_slice", - "src_symbol_id": "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "src_qname": "WorkflowEngine.__init__", - "dst_symbol_id": "a12cad0f5b238287e02f6d8d156cc764351d8c83246930487fa09d5ce6f2ace8", - "dst_ref": "WorkflowEngine.run", - "resolution": "resolved", - "slice_id": "8101338770016324ce05d61daa9935a444c75e6c94a0fae4275d5b50fcbcc70b", - "root_symbol_id": "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "path_symbols": [ - "WorkflowEngine.__init__", - "WorkflowEngine._persistence", - "WorkflowEngine.run" - ], - "path_symbol_ids": [ - "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "a12cad0f5b238287e02f6d8d156cc764351d8c83246930487fa09d5ce6f2ace8" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "1057136e58a325cd5ab6f4e265d15665fb6a711b7022d9fab52a1a290afa2368", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/engine/workflow_engine.py", - "content": "WorkflowEngine.__init__\n -> WorkflowEngine._traces\n -> WorkflowEngine.run", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "WorkflowEngine.__init__:dataflow_slice", - "span_start": 15, - "span_end": 27, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "5006266616d534d721648391565e2ac0c9e7e9d9f8df00c17fba8989afb533a5", - "edge_type": "dataflow_slice", - "src_symbol_id": "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "src_qname": "WorkflowEngine.__init__", - "dst_symbol_id": "a12cad0f5b238287e02f6d8d156cc764351d8c83246930487fa09d5ce6f2ace8", - "dst_ref": "WorkflowEngine.run", - "resolution": "resolved", - "slice_id": "5006266616d534d721648391565e2ac0c9e7e9d9f8df00c17fba8989afb533a5", - "root_symbol_id": "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "path_symbols": [ - "WorkflowEngine.__init__", - "WorkflowEngine._traces", - "WorkflowEngine.run" - ], - "path_symbol_ids": [ - "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "a12cad0f5b238287e02f6d8d156cc764351d8c83246930487fa09d5ce6f2ace8" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "1057136e58a325cd5ab6f4e265d15665fb6a711b7022d9fab52a1a290afa2368", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/engine/workflow_engine.py", - "content": "WorkflowEngine.__init__\n -> WorkflowEngine._logger\n -> WorkflowEngine.run", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "WorkflowEngine.__init__:dataflow_slice", - "span_start": 17, - "span_end": 85, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "2f9927abb24794adb056b94bfb5d8538a5cbafb160da2079f52fca97fd694a2b", - "edge_type": "dataflow_slice", - "src_symbol_id": "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "src_qname": "WorkflowEngine.__init__", - "dst_symbol_id": "a12cad0f5b238287e02f6d8d156cc764351d8c83246930487fa09d5ce6f2ace8", - "dst_ref": "WorkflowEngine.run", - "resolution": "resolved", - "slice_id": "2f9927abb24794adb056b94bfb5d8538a5cbafb160da2079f52fca97fd694a2b", - "root_symbol_id": "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "path_symbols": [ - "WorkflowEngine.__init__", - "WorkflowEngine._logger", - "WorkflowEngine.run" - ], - "path_symbol_ids": [ - "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "a12cad0f5b238287e02f6d8d156cc764351d8c83246930487fa09d5ce6f2ace8" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "1057136e58a325cd5ab6f4e265d15665fb6a711b7022d9fab52a1a290afa2368", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/engine/workflow_engine.py", - "content": "class WorkflowEngine:\n def __init__(self, workflow, persistence, *, traces, hooks: WorkflowEngineHooks | None = None) -> None:\n self._workflow = workflow\n self._persistence = persistence\n self._transition_resolver = TransitionResolver()\n self._traces = traces\n self._hooks = hooks or WorkflowEngineHooks()\n self._logger = logging.getLogger(__name__)\n\n def run(self, context: WorkflowContext) -> dict[str, object]:\n run_id = self._persistence.start_run(\n self._workflow.definition.name,\n self._workflow.definition.start_at,\n context.snapshot(),\n )\n context.state.setdefault(\"runtime\", {})\n context.state[\"runtime\"][\"workflow_run_id\"] = run_id\n self._traces.step(\"workflow\")\n self._traces.info(\"Workflow started.\", status=\"started\", attrs={\"workflow_run_id\": run_id})\n current_name = self._workflow.definition.start_at\n while current_name is not None:\n node = self._workflow.definition.nodes[current_name]\n context.state[\"runtime\"][\"current_node\"] = current_name\n self._logger.info(\"Workflow run %s: step '%s' started.\", run_id, current_name)\n self._hooks.on_step_started(context, current_name)\n self._persistence.start_step(run_id, current_name, context.snapshot())\n self._traces.step(current_name)\n self._traces.debug(\n f\"Step '{current_name}' started.\",\n status=\"started\",\n attrs={\"workflow_run_id\": run_id, \"node\": current_name},\n )\n try:\n result = node.step.run(context)\n except Exception as error:\n self._persistence.fail_step(run_id, current_name, context.snapshot(), error)\n self._persistence.fail_run(run_id, context.snapshot())\n self._traces.error(\n f\"Step '{current_name}' failed: {error}\",\n status=\"failed\",\n attrs={\"exception_type\": type(error).__name__},\n )\n self._logger.exception(\"Workflow run %s: step '%s' failed.\", run_id, current_name)\n self._hooks.on_step_failed(context, current_name)\n raise\n context.state.update(result.updates)\n self._persistence.complete_step(\n run_id,\n current_name,\n result.status,\n result.transition,\n context.snapshot(),\n )\n next_node = self._transition_resolver.resolve(node, result)\n self._traces.debug(\n f\"Step '{current_name}' completed with transition '{result.transition}'.\",\n status=result.status,\n attrs={\n \"workflow_run_id\": run_id,\n \"from_node\": current_name,\n \"transition\": result.transition,\n \"to_node\": next_node,\n },\n )\n self._logger.info(\n \"Workflow run %s: step '%s' completed with transition '%s'.\",\n run_id,\n current_name,\n result.transition,\n )\n self._hooks.on_step_finished(context, current_name)\n current_name = next_node\n self._persistence.complete_run(run_id, context.snapshot())\n self._traces.step(\"workflow\")\n self._traces.info(\"Workflow completed.\", status=\"completed\", attrs={\"workflow_run_id\": run_id})\n self._logger.info(\"Workflow run %s completed.\", run_id)\n return {\"run_id\": run_id, \"status\": \"completed\", \"context\": context.snapshot()}", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/workflow/engine/workflow_engine.py:WorkflowEngine", - "span_start": 10, - "span_end": 86, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.workflow.engine.workflow_engine", - "is_test": false, - "blob_sha": "1057136e58a325cd5ab6f4e265d15665fb6a711b7022d9fab52a1a290afa2368", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "llm_answer": "## Архитектура и Поведение `WorkflowEngine`\n\n### Описание класса `WorkflowEngine` (`src/app_runtime/workflow/engine/workflow_engine.py`)\n\n**Класс:** \n`WorkflowEngine`\n\n**Роль:** \n`pipeline_stage`\n\n**Ответственности:** \n- Чтение и запись атрибутов состояния.\n- Участие в срезах данных потока (dataflow slices).\n\n---\n\n### Поток данных и структура работы\n\n1. **Входные данные**\n - Данные передаются через состояние приложения или из внешних источников (например, REST API вызовов).\n \n2. **Основная логика работы `WorkflowEngine`:**\n 1. Принимает входные данные (через чтение атрибутов состояния).\n 2. Определяет текущее состояние системы на основе этих данных.\n 3. Использует внутренние механизмы для разрешения переходов между этапами выполнения workflow.\n 4. Записывает новое состояние после обработки.\n\n3. **Связь с другими сущностями:**\n - **WorkflowEngineHooks:** \n Класс отвечает за определение стандартного поведения модели, используемой внутри workflow engine. В основном он выполняет действия по умолчанию, которые могут быть переопределены пользователем.\n \n - **TransitionResolver:** \n Используется для определения правил перехода между различными стадиями workflow. Этот механизм решает, как именно должны выполняться шаги workflow и какие условия их активируют.\n\n4. **Участие в потоках данных (dataflow slices):**\n - **Dataflow Slices (6):** \n Срезы данных обеспечивают возможность параллельного выполнения различных частей workflow одновременно, что улучшает производительность системы.\n - **Dataflow Slices (24):** \n Другой набор параллельных потоков, организованных через `UvicornThreadRunner`, обеспечивает параллельность выполнения HTTP-запросов и других асинхронных задач.\n\n5. **Пример взаимодействия с внешними компонентами:**\n - Работа через внешние HTTP вызовы (`UvicornThreadRunner`) позволяет запускать различные задачи параллельно и возвращать результаты обратно в систему workflow.\n\n---\n\n### Ключевые моменты реализации:\n\n- `WorkflowEngine` выступает центральным элементом всей логики workflow и координирует выполнение этапов.\n- Все этапы определяются через правила перехода (`TransitionResolver`), которые помогают системе двигаться от одного этапа к другому.\n- Использование срезов данных и параллелизма (6 и 24 потоков) позволяет оптимизировать обработку и улучшить общую производительность.\n\n---\n\n### Заключение\n\n`WorkflowEngine` является ключевым компонентом системы управления workflow, отвечающим за координацию и управление процессом выполнения шагов workflow. Он взаимодействует с различными модулями, такими как `WorkflowEngineHooks` и `TransitionResolver`, обеспечивая корректное выполнение всех необходимых действий. Параллельная обработка (до 24 потоков) и четкая структура правил перехода делают этот подход эффективным и масштабируемым решением.", - "summary": { - "router": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "confidence": null - }, - "retrieval": { - "profile": "code", - "layers_hit": [ - "C0_SOURCE_CHUNKS", - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS", - "C4_SEMANTIC_ROLES" - ], - "evidence_sufficient": true - }, - "llm": { - "answer_status": "answered", - "groundedness": "grounded" - } - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "WorkflowEngine" - ], - "keyword_hints": [ - "WorkflowEngine" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C0_SOURCE_CHUNKS": "exact_path_fetch", - "C4_SEMANTIC_ROLES": "exact_path_fetch", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C3_ENTRYPOINTS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 8, - "C4_SEMANTIC_ROLES": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C3_ENTRYPOINTS": 6 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C4_SEMANTIC_ROLES": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "WorkflowEngine", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Объясни класс WorkflowEngine", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C4_SEMANTIC_ROLES", - "query": "Объясни класс WorkflowEngine", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "Объясни класс WorkflowEngine", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - }, - { - "layer": "C3_ENTRYPOINTS", - "query": "Объясни класс WorkflowEngine", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 2, - "candidates_after_filter": 2 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 6, - "candidates_after_filter": 6 - }, - { - "layer": "C3_ENTRYPOINTS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 3, - "candidates_after_filter": 3 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "WorkflowEngine", - "alternatives": [ - "WorkflowEngine", - "WorkflowEngineHooks" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "hit", - "hit_count": 2, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C4_SEMANTIC_ROLES", - "status": "hit", - "hit_count": 8, - "fail_reason": null - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 6, - "fail_reason": null - }, - { - "layer": "C3_ENTRYPOINTS", - "status": "hit", - "hit_count": 3, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "router": 0, - "symbol_resolution": 0, - "retrieval_total": 113, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 31, - "C0_SOURCE_CHUNKS": 12, - "C4_SEMANTIC_ROLES": 13, - "C2_DEPENDENCY_GRAPH": 44, - "C3_ENTRYPOINTS": 10 - }, - "merge_rank": 28, - "prompt_build": 0, - "llm_call": 5943 - }, - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 307, - "evidence_rows": 20, - "evidence_chars": 5261 - }, - "evidence_summary": [ - { - "layer": "C1_SYMBOL_CATALOG", - "count": 2, - "unique_paths": 2 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "count": 8, - "unique_paths": 8 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "count": 6, - "unique_paths": 1 - }, - { - "layer": "C3_ENTRYPOINTS", - "count": 3, - "unique_paths": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 1, - "unique_paths": 1 - } - ], - "prompt_template_id": "intent_code_qa_v1", - "system_prompt_version": "v1" - }, - "router": { - "conversation_mode": "START", - "keyword_hints": [ - "WorkflowEngine" - ], - "path_scope": [] - }, - "llm": { - "used_evidence_count": 20, - "missing_evidence_reason": null - } - }, - "run_info": { - "case_id": "plba-fullchain-explain-workflow-engine", - "mode": "full_chain", - "run_started_at": "2026-03-12T09:11:50", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - }, - "input_request": { - "text": "Объясни класс WorkflowEngine", - "normalized_query": "Объясни класс WorkflowEngine" - }, - "steps": [ - { - "step": "intent_router", - "input": { - "query": "Объясни класс WorkflowEngine" - }, - "output": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Объясни класс WorkflowEngine" - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "WorkflowEngine" - ], - "keyword_hints": [ - "WorkflowEngine" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "timings_ms": { - "router": 0 - } - } - }, - { - "step": "retrieval", - "input": { - "query": "Объясни класс WorkflowEngine" - }, - "output": { - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "WorkflowEngine", - "alternatives": [ - "WorkflowEngine", - "WorkflowEngineHooks" - ], - "confidence": 0.99 - }, - "rag_count": 20, - "rag_rows": [ - { - "path": "src/app_runtime/workflow/engine/workflow_engine.py", - "content": "class WorkflowEngine\nWorkflowEngine", - "layer": "C1_SYMBOL_CATALOG", - "title": "WorkflowEngine", - "span_start": 10, - "span_end": 86, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "57ec0a9f11c542c78e008684a888397e8d9ef4223671acb2567e631a0cbc70b4", - "qname": "WorkflowEngine", - "kind": "class", - "signature": "WorkflowEngine", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.workflow.engine.workflow_engine", - "is_test": false, - "blob_sha": "1057136e58a325cd5ab6f4e265d15665fb6a711b7022d9fab52a1a290afa2368", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/engine/hooks.py", - "content": "class WorkflowEngineHooks\nWorkflowEngineHooks", - "layer": "C1_SYMBOL_CATALOG", - "title": "WorkflowEngineHooks", - "span_start": 6, - "span_end": 14, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "914123ed510540061e116100fc87bba4195595ba696f8bfde2fd77ac6a5cd7e4", - "qname": "WorkflowEngineHooks", - "kind": "class", - "signature": "WorkflowEngineHooks", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.workflow.engine.hooks", - "is_test": false, - "blob_sha": "4b11672b0a9af1ae04bfce9d8e1f96572997d3e65e68108d7c797b88fa5fa47a", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/engine/workflow_engine.py", - "content": "WorkflowEngine\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (6)", - "layer": "C4_SEMANTIC_ROLES", - "title": "WorkflowEngine", - "span_start": 10, - "span_end": 86, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 25, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "57ec0a9f11c542c78e008684a888397e8d9ef4223671acb2567e631a0cbc70b4", - "symbol_name": "WorkflowEngine", - "qname": "WorkflowEngine", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 6, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "1057136e58a325cd5ab6f4e265d15665fb6a711b7022d9fab52a1a290afa2368", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/engine/hooks.py", - "content": "WorkflowEngineHooks\nrole: model\n\nResponsibilities:\n- default model role", - "layer": "C4_SEMANTIC_ROLES", - "title": "WorkflowEngineHooks", - "span_start": 6, - "span_end": 14, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 40, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "914123ed510540061e116100fc87bba4195595ba696f8bfde2fd77ac6a5cd7e4", - "symbol_name": "WorkflowEngineHooks", - "qname": "WorkflowEngineHooks", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "4b11672b0a9af1ae04bfce9d8e1f96572997d3e65e68108d7c797b88fa5fa47a", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/engine/transition_resolver.py", - "content": "TransitionResolver\nrole: model\n\nResponsibilities:\n- default model role", - "layer": "C4_SEMANTIC_ROLES", - "title": "TransitionResolver", - "span_start": 7, - "span_end": 9, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 40, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "d1979f0b23d354338debf7771373226833d57c1e7830ce66ca0b82cdf209b958", - "symbol_name": "TransitionResolver", - "qname": "TransitionResolver", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "2c518f4c77fb5dcc2970b88f55a7b121d05959578fb0d196af92ff5193574838", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_runner.py", - "content": "UvicornThreadRunner\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (24)", - "layer": "C4_SEMANTIC_ROLES", - "title": "UvicornThreadRunner", - "span_start": 10, - "span_end": 61, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 11, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "fd55630045a02100df8877ac27d951ee08617d4598764394d48cb51fe067476a", - "symbol_name": "UvicornThreadRunner", - "qname": "UvicornThreadRunner", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 24, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "3779fdd2878b770e789a35bb2a89c9d79f13b61c26d7db1b3b683f9bb9e1623f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/persistence/workflow_persistence.py", - "content": "WorkflowPersistence\nrole: pipeline_stage\n\nResponsibilities:\n- orchestrates role-like calls (2)\n- reads and writes state attributes\n- participates in dataflow slices (16)", - "layer": "C4_SEMANTIC_ROLES", - "title": "WorkflowPersistence", - "span_start": 8, - "span_end": 54, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 15, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "7bd01ee45cf31f2d5c2e3e51656254860ac785d10cef9e0852cd4fba90857bae", - "symbol_name": "WorkflowPersistence", - "qname": "WorkflowPersistence", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 16, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "80e9410ddc639789b4353c2a1a757ba8d0d5b5bb6075b0b263b61551f04ae1f0", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (10)", - "layer": "C4_SEMANTIC_ROLES", - "title": "HttpControlChannel", - "span_start": 12, - "span_end": 57, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 21, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "1c9fbdc24819e5604c26ea55428a74310f03a03e1af197ed84846af61e42fdb0", - "symbol_name": "HttpControlChannel", - "qname": "HttpControlChannel", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 10, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/queue/in_memory.py", - "content": "InMemoryTaskQueue\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (9)", - "layer": "C4_SEMANTIC_ROLES", - "title": "InMemoryTaskQueue", - "span_start": 9, - "span_end": 38, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 22, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "2da04cb94544a3bcbf0943a95ad4bdd8710bcafaa32a02fd0e4de2178dcf3533", - "symbol_name": "InMemoryTaskQueue", - "qname": "InMemoryTaskQueue", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 9, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "58f0cc001ccda0eee4c6bc32ed83bd05eafd6b6644f1e8b4aa9eed3103db73dc", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/config/file_loader.py", - "content": "ConfigFileLoader\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (8)", - "layer": "C4_SEMANTIC_ROLES", - "title": "ConfigFileLoader", - "span_start": 11, - "span_end": 48, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 23, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "a8474eca8b6e9dc86ae67ed68b16fa5fb639ef08739c053e7b7195489765667f", - "symbol_name": "ConfigFileLoader", - "qname": "ConfigFileLoader", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 8, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "1f19ffebde5e38e4be5a5d5a678059a0f36dedb8fb8b3e00ab395c67106a87ea", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/engine/workflow_engine.py", - "content": "WorkflowEngine.__init__\n -> WorkflowEngine._transition_resolver\n -> WorkflowEngine.run", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "WorkflowEngine.__init__:dataflow_slice", - "span_start": 14, - "span_end": 63, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "3abf07e5c245e0fe59785ba2d569c2ee56018715fc7f625a044ddaf6201f903d", - "edge_type": "dataflow_slice", - "src_symbol_id": "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "src_qname": "WorkflowEngine.__init__", - "dst_symbol_id": "a12cad0f5b238287e02f6d8d156cc764351d8c83246930487fa09d5ce6f2ace8", - "dst_ref": "WorkflowEngine.run", - "resolution": "resolved", - "slice_id": "3abf07e5c245e0fe59785ba2d569c2ee56018715fc7f625a044ddaf6201f903d", - "root_symbol_id": "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "path_symbols": [ - "WorkflowEngine.__init__", - "WorkflowEngine._transition_resolver", - "WorkflowEngine.run" - ], - "path_symbol_ids": [ - "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "a12cad0f5b238287e02f6d8d156cc764351d8c83246930487fa09d5ce6f2ace8" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "1057136e58a325cd5ab6f4e265d15665fb6a711b7022d9fab52a1a290afa2368", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/engine/workflow_engine.py", - "content": "WorkflowEngine.__init__\n -> WorkflowEngine._hooks\n -> WorkflowEngine.run", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "WorkflowEngine.__init__:dataflow_slice", - "span_start": 16, - "span_end": 34, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "d73db644b69c1eb35afd6eae9d6ac8674e49e30e9bcf9c020f9fdbfe754851b2", - "edge_type": "dataflow_slice", - "src_symbol_id": "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "src_qname": "WorkflowEngine.__init__", - "dst_symbol_id": "a12cad0f5b238287e02f6d8d156cc764351d8c83246930487fa09d5ce6f2ace8", - "dst_ref": "WorkflowEngine.run", - "resolution": "resolved", - "slice_id": "d73db644b69c1eb35afd6eae9d6ac8674e49e30e9bcf9c020f9fdbfe754851b2", - "root_symbol_id": "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "path_symbols": [ - "WorkflowEngine.__init__", - "WorkflowEngine._hooks", - "WorkflowEngine.run" - ], - "path_symbol_ids": [ - "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "a12cad0f5b238287e02f6d8d156cc764351d8c83246930487fa09d5ce6f2ace8" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "1057136e58a325cd5ab6f4e265d15665fb6a711b7022d9fab52a1a290afa2368", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/engine/workflow_engine.py", - "content": "WorkflowEngine.__init__\n -> WorkflowEngine._workflow\n -> WorkflowEngine.run", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "WorkflowEngine.__init__:dataflow_slice", - "span_start": 12, - "span_end": 29, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "b45ef3c54669b4910a8aed3a565804f275424a24007bc7e3c953389521f80249", - "edge_type": "dataflow_slice", - "src_symbol_id": "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "src_qname": "WorkflowEngine.__init__", - "dst_symbol_id": "a12cad0f5b238287e02f6d8d156cc764351d8c83246930487fa09d5ce6f2ace8", - "dst_ref": "WorkflowEngine.run", - "resolution": "resolved", - "slice_id": "b45ef3c54669b4910a8aed3a565804f275424a24007bc7e3c953389521f80249", - "root_symbol_id": "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "path_symbols": [ - "WorkflowEngine.__init__", - "WorkflowEngine._workflow", - "WorkflowEngine.run" - ], - "path_symbol_ids": [ - "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "a12cad0f5b238287e02f6d8d156cc764351d8c83246930487fa09d5ce6f2ace8" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "1057136e58a325cd5ab6f4e265d15665fb6a711b7022d9fab52a1a290afa2368", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/engine/workflow_engine.py", - "content": "WorkflowEngine.__init__\n -> WorkflowEngine._persistence\n -> WorkflowEngine.run", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "WorkflowEngine.__init__:dataflow_slice", - "span_start": 13, - "span_end": 20, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "8101338770016324ce05d61daa9935a444c75e6c94a0fae4275d5b50fcbcc70b", - "edge_type": "dataflow_slice", - "src_symbol_id": "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "src_qname": "WorkflowEngine.__init__", - "dst_symbol_id": "a12cad0f5b238287e02f6d8d156cc764351d8c83246930487fa09d5ce6f2ace8", - "dst_ref": "WorkflowEngine.run", - "resolution": "resolved", - "slice_id": "8101338770016324ce05d61daa9935a444c75e6c94a0fae4275d5b50fcbcc70b", - "root_symbol_id": "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "path_symbols": [ - "WorkflowEngine.__init__", - "WorkflowEngine._persistence", - "WorkflowEngine.run" - ], - "path_symbol_ids": [ - "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "a12cad0f5b238287e02f6d8d156cc764351d8c83246930487fa09d5ce6f2ace8" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "1057136e58a325cd5ab6f4e265d15665fb6a711b7022d9fab52a1a290afa2368", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/engine/workflow_engine.py", - "content": "WorkflowEngine.__init__\n -> WorkflowEngine._traces\n -> WorkflowEngine.run", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "WorkflowEngine.__init__:dataflow_slice", - "span_start": 15, - "span_end": 27, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "5006266616d534d721648391565e2ac0c9e7e9d9f8df00c17fba8989afb533a5", - "edge_type": "dataflow_slice", - "src_symbol_id": "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "src_qname": "WorkflowEngine.__init__", - "dst_symbol_id": "a12cad0f5b238287e02f6d8d156cc764351d8c83246930487fa09d5ce6f2ace8", - "dst_ref": "WorkflowEngine.run", - "resolution": "resolved", - "slice_id": "5006266616d534d721648391565e2ac0c9e7e9d9f8df00c17fba8989afb533a5", - "root_symbol_id": "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "path_symbols": [ - "WorkflowEngine.__init__", - "WorkflowEngine._traces", - "WorkflowEngine.run" - ], - "path_symbol_ids": [ - "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "a12cad0f5b238287e02f6d8d156cc764351d8c83246930487fa09d5ce6f2ace8" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "1057136e58a325cd5ab6f4e265d15665fb6a711b7022d9fab52a1a290afa2368", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/engine/workflow_engine.py", - "content": "WorkflowEngine.__init__\n -> WorkflowEngine._logger\n -> WorkflowEngine.run", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "WorkflowEngine.__init__:dataflow_slice", - "span_start": 17, - "span_end": 85, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "2f9927abb24794adb056b94bfb5d8538a5cbafb160da2079f52fca97fd694a2b", - "edge_type": "dataflow_slice", - "src_symbol_id": "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "src_qname": "WorkflowEngine.__init__", - "dst_symbol_id": "a12cad0f5b238287e02f6d8d156cc764351d8c83246930487fa09d5ce6f2ace8", - "dst_ref": "WorkflowEngine.run", - "resolution": "resolved", - "slice_id": "2f9927abb24794adb056b94bfb5d8538a5cbafb160da2079f52fca97fd694a2b", - "root_symbol_id": "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "path_symbols": [ - "WorkflowEngine.__init__", - "WorkflowEngine._logger", - "WorkflowEngine.run" - ], - "path_symbol_ids": [ - "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "a12cad0f5b238287e02f6d8d156cc764351d8c83246930487fa09d5ce6f2ace8" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "1057136e58a325cd5ab6f4e265d15665fb6a711b7022d9fab52a1a290afa2368", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/engine/workflow_engine.py", - "content": "class WorkflowEngine:\n def __init__(self, workflow, persistence, *, traces, hooks: WorkflowEngineHooks | None = None) -> None:\n self._workflow = workflow\n self._persistence = persistence\n self._transition_resolver = TransitionResolver()\n self._traces = traces\n self._hooks = hooks or WorkflowEngineHooks()\n self._logger = logging.getLogger(__name__)\n\n def run(self, context: WorkflowContext) -> dict[str, object]:\n run_id = self._persistence.start_run(\n self._workflow.definition.name,\n self._workflow.definition.start_at,\n context.snapshot(),\n )\n context.state.setdefault(\"runtime\", {})\n context.state[\"runtime\"][\"workflow_run_id\"] = run_id\n self._traces.step(\"workflow\")\n self._traces.info(\"Workflow started.\", status=\"started\", attrs={\"workflow_run_id\": run_id})\n current_name = self._workflow.definition.start_at\n while current_name is not None:\n node = self._workflow.definition.nodes[current_name]\n context.state[\"runtime\"][\"current_node\"] = current_name\n self._logger.info(\"Workflow run %s: step '%s' started.\", run_id, current_name)\n self._hooks.on_step_started(context, current_name)\n self._persistence.start_step(run_id, current_name, context.snapshot())\n self._traces.step(current_name)\n self._traces.debug(\n f\"Step '{current_name}' started.\",\n status=\"started\",\n attrs={\"workflow_run_id\": run_id, \"node\": current_name},\n )\n try:\n result = node.step.run(context)\n except Exception as error:\n self._persistence.fail_step(run_id, current_name, context.snapshot(), error)\n self._persistence.fail_run(run_id, context.snapshot())\n self._traces.error(\n f\"Step '{current_name}' failed: {error}\",\n status=\"failed\",\n attrs={\"exception_type\": type(error).__name__},\n )\n self._logger.exception(\"Workflow run %s: step '%s' failed.\", run_id, current_name)\n self._hooks.on_step_failed(context, current_name)\n raise\n context.state.update(result.updates)\n self._persistence.complete_step(\n run_id,\n current_name,\n result.status,\n result.transition,\n context.snapshot(),\n )\n next_node = self._transition_resolver.resolve(node, result)\n self._traces.debug(\n f\"Step '{current_name}' completed with transition '{result.transition}'.\",\n status=result.status,\n attrs={\n \"workflow_run_id\": run_id,\n \"from_node\": current_name,\n \"transition\": result.transition,\n \"to_node\": next_node,\n },\n )\n self._logger.info(\n \"Workflow run %s: step '%s' completed with transition '%s'.\",\n run_id,\n current_name,\n result.transition,\n )\n self._hooks.on_step_finished(context, current_name)\n current_name = next_node\n self._persistence.complete_run(run_id, context.snapshot())\n self._traces.step(\"workflow\")\n self._traces.info(\"Workflow completed.\", status=\"completed\", attrs={\"workflow_run_id\": run_id})\n self._logger.info(\"Workflow run %s completed.\", run_id)\n return {\"run_id\": run_id, \"status\": \"completed\", \"context\": context.snapshot()}", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/workflow/engine/workflow_engine.py:WorkflowEngine", - "span_start": 10, - "span_end": 86, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.workflow.engine.workflow_engine", - "is_test": false, - "blob_sha": "1057136e58a325cd5ab6f4e265d15665fb6a711b7022d9fab52a1a290afa2368", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ] - }, - "diagnostics": { - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C0_SOURCE_CHUNKS": "exact_path_fetch", - "C4_SEMANTIC_ROLES": "exact_path_fetch", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C3_ENTRYPOINTS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 8, - "C4_SEMANTIC_ROLES": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C3_ENTRYPOINTS": 6 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C4_SEMANTIC_ROLES": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "WorkflowEngine", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Объясни класс WorkflowEngine", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C4_SEMANTIC_ROLES", - "query": "Объясни класс WorkflowEngine", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "Объясни класс WorkflowEngine", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - }, - { - "layer": "C3_ENTRYPOINTS", - "query": "Объясни класс WorkflowEngine", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 2, - "candidates_after_filter": 2 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 6, - "candidates_after_filter": 6 - }, - { - "layer": "C3_ENTRYPOINTS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 3, - "candidates_after_filter": 3 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "WorkflowEngine", - "alternatives": [ - "WorkflowEngine", - "WorkflowEngineHooks" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "hit", - "hit_count": 2, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C4_SEMANTIC_ROLES", - "status": "hit", - "hit_count": 8, - "fail_reason": null - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 6, - "fail_reason": null - }, - { - "layer": "C3_ENTRYPOINTS", - "status": "hit", - "hit_count": 3, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "symbol_resolution": 0, - "retrieval_total": 113, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 31, - "C0_SOURCE_CHUNKS": 12, - "C4_SEMANTIC_ROLES": 13, - "C2_DEPENDENCY_GRAPH": 44, - "C3_ENTRYPOINTS": 10 - }, - "merge_rank": 28 - } - } - }, - { - "step": "llm_answer", - "input": { - "query": "Объясни класс WorkflowEngine", - "rag_count": 20 - }, - "output": { - "llm_answer": "## Архитектура и Поведение `WorkflowEngine`\n\n### Описание класса `WorkflowEngine` (`src/app_runtime/workflow/engine/workflow_engine.py`)\n\n**Класс:** \n`WorkflowEngine`\n\n**Роль:** \n`pipeline_stage`\n\n**Ответственности:** \n- Чтение и запись атрибутов состояния.\n- Участие в срезах данных потока (dataflow slices).\n\n---\n\n### Поток данных и структура работы\n\n1. **Входные данные**\n - Данные передаются через состояние приложения или из внешних источников (например, REST API вызовов).\n \n2. **Основная логика работы `WorkflowEngine`:**\n 1. Принимает входные данные (через чтение атрибутов состояния).\n 2. Определяет текущее состояние системы на основе этих данных.\n 3. Использует внутренние механизмы для разрешения переходов между этапами выполнения workflow.\n 4. Записывает новое состояние после обработки.\n\n3. **Связь с другими сущностями:**\n - **WorkflowEngineHooks:** \n Класс отвечает за определение стандартного поведения модели, используемой внутри workflow engine. В основном он выполняет действия по умолчанию, которые могут быть переопределены пользователем.\n \n - **TransitionResolver:** \n Используется для определения правил перехода между различными стадиями workflow. Этот механизм решает, как именно должны выполняться шаги workflow и какие условия их активируют.\n\n4. **Участие в потоках данных (dataflow slices):**\n - **Dataflow Slices (6):** \n Срезы данных обеспечивают возможность параллельного выполнения различных частей workflow одновременно, что улучшает производительность системы.\n - **Dataflow Slices (24):** \n Другой набор параллельных потоков, организованных через `UvicornThreadRunner`, обеспечивает параллельность выполнения HTTP-запросов и других асинхронных задач.\n\n5. **Пример взаимодействия с внешними компонентами:**\n - Работа через внешние HTTP вызовы (`UvicornThreadRunner`) позволяет запускать различные задачи параллельно и возвращать результаты обратно в систему workflow.\n\n---\n\n### Ключевые моменты реализации:\n\n- `WorkflowEngine` выступает центральным элементом всей логики workflow и координирует выполнение этапов.\n- Все этапы определяются через правила перехода (`TransitionResolver`), которые помогают системе двигаться от одного этапа к другому.\n- Использование срезов данных и параллелизма (6 и 24 потоков) позволяет оптимизировать обработку и улучшить общую производительность.\n\n---\n\n### Заключение\n\n`WorkflowEngine` является ключевым компонентом системы управления workflow, отвечающим за координацию и управление процессом выполнения шагов workflow. Он взаимодействует с различными модулями, такими как `WorkflowEngineHooks` и `TransitionResolver`, обеспечивая корректное выполнение всех необходимых действий. Параллельная обработка (до 24 потоков) и четкая структура правил перехода делают этот подход эффективным и масштабируемым решением." - }, - "diagnostics": { - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 307, - "evidence_rows": 20, - "evidence_chars": 5261 - }, - "evidence_summary": [ - { - "layer": "C1_SYMBOL_CATALOG", - "count": 2, - "unique_paths": 2 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "count": 8, - "unique_paths": 8 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "count": 6, - "unique_paths": 1 - }, - { - "layer": "C3_ENTRYPOINTS", - "count": 3, - "unique_paths": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 1, - "unique_paths": 1 - } - ], - "prompt_template_id": "intent_code_qa_v1", - "system_prompt_version": "v1" - }, - "timings_ms": { - "prompt_build": 0, - "llm_call": 5943 - } - } - } - ] - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_091150/full_chain_plba_code_retrieval_plba-fullchain-explain-workflow-engine.md b/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_091150/full_chain_plba_code_retrieval_plba-fullchain-explain-workflow-engine.md deleted file mode 100644 index 0099544..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_091150/full_chain_plba_code_retrieval_plba-fullchain-explain-workflow-engine.md +++ /dev/null @@ -1,34 +0,0 @@ -# plba-fullchain-explain-workflow-engine - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_retrieval.yaml -- runner: runtime -- mode: full_chain -- passed: True - -## Query -Объясни класс WorkflowEngine - -## Actual -{ - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 20, - "llm_answer": "## Архитектура и Поведение `WorkflowEngine`\n\n### Описание класса `WorkflowEngine` (`src/app_runtime/workflow/engine/workflow_engine.py`)\n\n**Класс:** \n`WorkflowEngine`\n\n**Роль:** \n`pipeline_stage`\n\n**Ответственности:** \n- Чтение и запись атрибутов состояния.\n- Участие в срезах данных потока (dataflow slices).\n\n---\n\n### Поток данных и структура работы\n\n1. **Входные данные**\n - Данные передаются через состояние приложения или из внешних источников (например, REST API вызовов).\n \n2. **Основная логика работы `WorkflowEngine`:**\n 1. Принимает входные данные (через чтение атрибутов состояния).\n 2. Определяет текущее состояние системы на основе этих данных.\n 3. Использует внутренние механизмы для разрешения переходов между этапами выполнения workflow.\n 4. Записывает новое состояние после обработки.\n\n3. **Связь с другими сущностями:**\n - **WorkflowEngineHooks:** \n Класс отвечает за определение стандартного поведения модели, используемой внутри workflow engine. В основном он выполняет действия по умолчанию, которые могут быть переопределены пользователем.\n \n - **TransitionResolver:** \n Используется для определения правил перехода между различными стадиями workflow. Этот механизм решает, как именно должны выполняться шаги workflow и какие условия их активируют.\n\n4. **Участие в потоках данных (dataflow slices):**\n - **Dataflow Slices (6):** \n Срезы данных обеспечивают возможность параллельного выполнения различных частей workflow одновременно, что улучшает производительность системы.\n - **Dataflow Slices (24):** \n Другой набор параллельных потоков, организованных через `UvicornThreadRunner`, обеспечивает параллельность выполнения HTTP-запросов и других асинхронных задач.\n\n5. **Пример взаимодействия с внешними компонентами:**\n - Работа через внешние HTTP вызовы (`UvicornThreadRunner`) позволяет запускать различные задачи параллельно и возвращать результаты обратно в систему workflow.\n\n---\n\n### Ключевые моменты реализации:\n\n- `WorkflowEngine` выступает центральным элементом всей логики workflow и координирует выполнение этапов.\n- Все этапы определяются через правила перехода (`TransitionResolver`), которые помогают системе двигаться от одного этапа к другому.\n- Использование срезов данных и параллелизма (6 и 24 потоков) позволяет оптимизировать обработку и улучшить общую производительность.\n\n---\n\n### Заключение\n\n`WorkflowEngine` является ключевым компонентом системы управления workflow, отвечающим за координацию и управление процессом выполнения шагов workflow. Он взаимодействует с различными модулями, такими как `WorkflowEngineHooks` и `TransitionResolver`, обеспечивая корректное выполнение всех необходимых действий. Параллельная обработка (до 24 потоков) и четкая структура правил перехода делают этот подход эффективным и масштабируемым решением.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "WorkflowEngine" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] -} - -## Mismatches -- none \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_091150/summary.md b/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_091150/summary.md deleted file mode 100644 index 1cfe042..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_091150/summary.md +++ /dev/null @@ -1,20 +0,0 @@ -# pipeline_setup_v2 summary - -Passed: 6/6 - -| File | Case | Runner | Mode | Intent | Sub-intent | Pass | -|------|------|--------|------|--------|------------|------| -| full_chain_plba_code_retrieval.yaml | plba-fullchain-explain-runtime-manager | runtime | full_chain | CODE_QA | EXPLAIN | ✓ | -| full_chain_plba_code_retrieval.yaml | plba-fullchain-explain-http-control-channel | runtime | full_chain | CODE_QA | EXPLAIN | ✓ | -| full_chain_plba_code_retrieval.yaml | plba-fullchain-explain-control-plane-service | runtime | full_chain | CODE_QA | EXPLAIN | ✓ | -| full_chain_plba_code_retrieval.yaml | plba-fullchain-explain-trace-service | runtime | full_chain | CODE_QA | EXPLAIN | ✓ | -| full_chain_plba_code_retrieval.yaml | plba-fullchain-explain-create-runtime | runtime | full_chain | CODE_QA | EXPLAIN | ✓ | -| full_chain_plba_code_retrieval.yaml | plba-fullchain-explain-workflow-engine | runtime | full_chain | CODE_QA | EXPLAIN | ✓ | - -## LLM Answers -- **plba-fullchain-explain-runtime-manager**: ## Анализ класса `RuntimeManager` ### Файл и путь: `src/app_runtime/core/runtime.py` ### Описание класса: **Класс:** `RuntimeManager` **Роль:** - Менеджер роли (pipeline_stage) - Оркестратор вызовов ролей (4) - Читает и… -- **plba-fullchain-explain-http-control-channel**: ## Анализ класса `HttpControlChannel` ### 1. Общая информация о классе **Файл:** `src/app_runtime/control/http_channel.py` **Класс:** `HttpControlChannel` **Наследование:** `HttpControlChannel(ControlChannel)` **Роль:**… -- **plba-fullchain-explain-control-plane-service**: ## Анализ класса `ControlPlaneService` ### Описание файла и роли сущностей Исходный код находится в файле `src/app_runtime/control/service.py`, где определен класс `ControlPlaneService`. Этот файл является частью модуля… -- **plba-fullchain-explain-trace-service**: ## Анализ архитектуры и поведения системы с участием `TraceService` ### Описание роли и ответственности компонента В системе предоставлены несколько компонентов, выполняющих роль pipeline stage и участвующих в управлени… -- **plba-fullchain-explain-create-runtime**: ## Анализ функции `create_runtime` и контекста ### 1. Общая информация о файле и функции Файл: **src/plba/bootstrap.py** Функция: **create_runtime(module)** Эта функция отвечает за создание runtime окружения для приложе… -- **plba-fullchain-explain-workflow-engine**: ## Архитектура и Поведение `WorkflowEngine` ### Описание класса `WorkflowEngine` (`src/app_runtime/workflow/engine/workflow_engine.py`) **Класс:** `WorkflowEngine` **Роль:** `pipeline_stage` **Ответственности:** - Чтени… \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_091314/full_chain_plba_code_retrieval_plba-fullchain-explain-control-plane-service.json b/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_091314/full_chain_plba_code_retrieval_plba-fullchain-explain-control-plane-service.json deleted file mode 100644 index 0ab5446..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_091314/full_chain_plba_code_retrieval_plba-fullchain-explain-control-plane-service.json +++ /dev/null @@ -1,2532 +0,0 @@ -{ - "case_id": "plba-fullchain-explain-control-plane-service", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_retrieval.yaml", - "runner": "runtime", - "mode": "full_chain", - "actual": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 19, - "llm_answer": "## Анализ класса `ControlPlaneService`\n\n### Описание файла и роли классов\n\nФайл **`src/app_runtime/control/service.py`** содержит определение класса `ControlPlaneService`. Этот файл также импортирует классы и компоненты из других модулей (`base`, `http_channel`, `http_runner`), которые участвуют в общей архитектуре системы управления.\n\n### Класс `ControlPlaneService`\n\nКласс `ControlPlaneService` является ключевым компонентом архитектуры и играет роль «pipeline stage» (этап конвейера). Его основная ответственность заключается в управлении состоянием системы, чтении и записи атрибутов состояния, а также участии в различных срезах обработки данных («dataflow slices»).\n\n#### Архитектура и структура\n\n- **Название класса**: `ControlPlaneService`\n- **Путь к файлу**: `src/app_runtime/control/service.py`\n- **Роль**: `pipeline stage`\n \n#### Основные обязанности (Responsibilities):\n\n1. **Имя суффикса указывает на сервисную природу объекта:** \n - Имя класса подразумевает, что он управляет определенными аспектами работы системы или сервиса.\n \n2. **Чтение и запись атрибутов состояния:**\n - Контролирует состояние приложения через чтение и запись соответствующих атрибутов.\n \n3. **Участие в данных срезах (Dataflow Slices):**\n - Участие в 5 разных срезах данных, что означает его участие в нескольких параллельных процессах или каналах передачи данных.\n\n#### Взаимодействие с другими сущностями\n\n- **`ControlChannel`:**\n - Используется для взаимодействия модели (ControlModel) внутри системы. Класс находится в модуле `src/app_runtime/control/base.py`.\n \n- **`ControlActionSet`:**\n - Также используется для настройки поведения модели. Находится в том же модуле.\n\n- **`UvicornThreadRunner`:**\n - Служит механизмом запуска HTTP-сервиса через uvicorn. Находится в `src/app_runtime/control/http_runner.py`.\n\n- **`HttpControlChannel`:**\n - Обеспечивает взаимодействие с внешним миром через HTTP-запросы. Находится в `src/app_runtime/control/http_channel.py`.\n\n---\n\n### Поток данных и управление состоянием\n\nКласс `ControlPlaneService` отвечает за поддержание согласованного состояния между различными компонентами системы. Он обеспечивает механизм для координации действий между разными частями приложения, участвует в распределении нагрузки и синхронизации потоков выполнения задач.\n\nПример простого сценария использования:\n\n```python\n# Создание экземпляра ControlPlaneService\nservice = ControlPlaneService()\n\n# Чтение текущего состояния\ncurrent_state = service.get_current_state()\n\n# Запись нового состояния\nservice.set_new_state(new_state_data)\n```\n\nТаким образом, `ControlPlaneService` выступает как центральный элемент управления состоянием всей системы, обеспечивая корректное функционирование и координацию всех компонентов приложения.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "ControlPlaneService" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "passed": true, - "mismatches": [], - "details": { - "case_id": "plba-fullchain-explain-control-plane-service", - "text": "Объясни класс ControlPlaneService", - "mode": "full_chain", - "run_started_at": "2026-03-12T09:13:14", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Объясни класс ControlPlaneService", - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "ControlPlaneService", - "alternatives": [ - "ControlPlaneService" - ], - "confidence": 0.99 - }, - "rag_count": 19, - "rag_rows": [ - { - "path": "src/app_runtime/control/service.py", - "content": "class ControlPlaneService\nControlPlaneService", - "layer": "C1_SYMBOL_CATALOG", - "title": "ControlPlaneService", - "span_start": 12, - "span_end": 52, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "b13471e5916986dccffb53fab613812842965705e6b3a89ae549d30c9e91e9aa", - "qname": "ControlPlaneService", - "kind": "class", - "signature": "ControlPlaneService", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.control.service", - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests service\n- reads and writes state attributes\n- participates in dataflow slices (5)", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlPlaneService", - "span_start": 12, - "span_end": 52, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 68, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "b13471e5916986dccffb53fab613812842965705e6b3a89ae549d30c9e91e9aa", - "symbol_name": "ControlPlaneService", - "qname": "ControlPlaneService", - "role": "pipeline_stage", - "confidence": 0.57, - "dataflow_participation": 5, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "ControlChannel\nrole: model\n\nResponsibilities:\n- default model role", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlChannel", - "span_start": 21, - "span_end": 28, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 40, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "cfcfe9a311d3a2dbdaf32ac4ccd73c0eb9a117f830591a1c0867ee97d46204ff", - "symbol_name": "ControlChannel", - "qname": "ControlChannel", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "ControlActionSet\nrole: model\n\nResponsibilities:\n- default model role", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlActionSet", - "span_start": 14, - "span_end": 18, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 40, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "46eb026cb3313415ec47b82dd22f84f4d112c9d987e8b1716dcb0baa1cce8988", - "symbol_name": "ControlActionSet", - "qname": "ControlActionSet", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_runner.py", - "content": "UvicornThreadRunner\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (24)", - "layer": "C4_SEMANTIC_ROLES", - "title": "UvicornThreadRunner", - "span_start": 10, - "span_end": 61, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 11, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "fd55630045a02100df8877ac27d951ee08617d4598764394d48cb51fe067476a", - "symbol_name": "UvicornThreadRunner", - "qname": "UvicornThreadRunner", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 24, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "3779fdd2878b770e789a35bb2a89c9d79f13b61c26d7db1b3b683f9bb9e1623f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (10)", - "layer": "C4_SEMANTIC_ROLES", - "title": "HttpControlChannel", - "span_start": 12, - "span_end": 57, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 21, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "1c9fbdc24819e5604c26ea55428a74310f03a03e1af197ed84846af61e42fdb0", - "symbol_name": "HttpControlChannel", - "qname": "HttpControlChannel", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 10, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "HttpControlAppFactory\nrole: factory\n\nResponsibilities:\n- name suffix suggests factory", - "layer": "C4_SEMANTIC_ROLES", - "title": "HttpControlAppFactory", - "span_start": 15, - "span_end": 53, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 39, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "9b3502a5fb408b273223db13264349cf500de24915b6c649d9ea8970d0dfd8e0", - "symbol_name": "HttpControlAppFactory", - "qname": "HttpControlAppFactory", - "role": "factory", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/persistence/workflow_persistence.py", - "content": "WorkflowPersistence\nrole: pipeline_stage\n\nResponsibilities:\n- orchestrates role-like calls (2)\n- reads and writes state attributes\n- participates in dataflow slices (16)", - "layer": "C4_SEMANTIC_ROLES", - "title": "WorkflowPersistence", - "span_start": 8, - "span_end": 54, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 15, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "7bd01ee45cf31f2d5c2e3e51656254860ac785d10cef9e0852cd4fba90857bae", - "symbol_name": "WorkflowPersistence", - "qname": "WorkflowPersistence", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 16, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "80e9410ddc639789b4353c2a1a757ba8d0d5b5bb6075b0b263b61551f04ae1f0", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/queue/in_memory.py", - "content": "InMemoryTaskQueue\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (9)", - "layer": "C4_SEMANTIC_ROLES", - "title": "InMemoryTaskQueue", - "span_start": 9, - "span_end": 38, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 22, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "2da04cb94544a3bcbf0943a95ad4bdd8710bcafaa32a02fd0e4de2178dcf3533", - "symbol_name": "InMemoryTaskQueue", - "qname": "InMemoryTaskQueue", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 9, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "58f0cc001ccda0eee4c6bc32ed83bd05eafd6b6644f1e8b4aa9eed3103db73dc", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.stop", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 25, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d", - "dst_ref": "ControlPlaneService.stop", - "resolution": "resolved", - "slice_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.stop" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._stop_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 51, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a", - "dst_ref": "ControlPlaneService._stop_async", - "resolution": "resolved", - "slice_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._stop_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.register_channel", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 17, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957", - "dst_ref": "ControlPlaneService.register_channel", - "resolution": "resolved", - "slice_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.register_channel" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.start", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 20, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154", - "dst_ref": "ControlPlaneService.start", - "resolution": "resolved", - "slice_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.start" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._start_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 47, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517", - "dst_ref": "ControlPlaneService._start_async", - "resolution": "resolved", - "slice_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._start_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.register_channel reads_attr self._channels.append", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.register_channel:reads_attr", - "span_start": 17, - "span_end": 17, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "1ee5925deffdc38ba15b88bf7c89e5fcd1a78f493fe30f2deb827d714a1b18e8", - "edge_type": "reads_attr", - "src_symbol_id": "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957", - "src_qname": "ControlPlaneService.register_channel", - "dst_symbol_id": null, - "dst_ref": "self._channels.append", - "resolution": "partial", - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "class ControlPlaneService:\n def __init__(self) -> None:\n self._channels: list[ControlChannel] = []\n\n def register_channel(self, channel: ControlChannel) -> None:\n self._channels.append(channel)\n\n def start(self, runtime: RuntimeManager) -> None:\n if not self._channels:\n return\n asyncio.run(self._start_async(runtime))\n\n def stop(self) -> None:\n if not self._channels:\n return\n asyncio.run(self._stop_async())\n\n def snapshot(self, runtime: RuntimeManager) -> dict[str, object]:\n health = runtime.current_health()\n return {\n \"runtime\": {\"state\": runtime._state.value},\n \"modules\": list(runtime.registry.modules),\n \"services\": runtime.services.snapshot(),\n \"workers\": runtime.workers.snapshot(),\n \"health\": runtime.health.snapshot(runtime.workers.healths()) | {\"status\": health[\"status\"]},\n \"config\": runtime.configuration.get(),\n }\n\n async def _start_async(self, runtime: RuntimeManager) -> None:\n actions = ControlActionSet(\n health=runtime.health_status,\n start=runtime.start_runtime,\n stop=runtime.stop_runtime,\n status=runtime.runtime_status,\n )\n for channel in self._channels:\n await channel.start(actions)\n\n async def _stop_async(self) -> None:\n for channel in reversed(self._channels):\n await channel.stop()", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/service.py:ControlPlaneService", - "span_start": 12, - "span_end": 52, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.service", - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "llm_answer": "## Анализ класса `ControlPlaneService`\n\n### Описание файла и роли классов\n\nФайл **`src/app_runtime/control/service.py`** содержит определение класса `ControlPlaneService`. Этот файл также импортирует классы и компоненты из других модулей (`base`, `http_channel`, `http_runner`), которые участвуют в общей архитектуре системы управления.\n\n### Класс `ControlPlaneService`\n\nКласс `ControlPlaneService` является ключевым компонентом архитектуры и играет роль «pipeline stage» (этап конвейера). Его основная ответственность заключается в управлении состоянием системы, чтении и записи атрибутов состояния, а также участии в различных срезах обработки данных («dataflow slices»).\n\n#### Архитектура и структура\n\n- **Название класса**: `ControlPlaneService`\n- **Путь к файлу**: `src/app_runtime/control/service.py`\n- **Роль**: `pipeline stage`\n \n#### Основные обязанности (Responsibilities):\n\n1. **Имя суффикса указывает на сервисную природу объекта:** \n - Имя класса подразумевает, что он управляет определенными аспектами работы системы или сервиса.\n \n2. **Чтение и запись атрибутов состояния:**\n - Контролирует состояние приложения через чтение и запись соответствующих атрибутов.\n \n3. **Участие в данных срезах (Dataflow Slices):**\n - Участие в 5 разных срезах данных, что означает его участие в нескольких параллельных процессах или каналах передачи данных.\n\n#### Взаимодействие с другими сущностями\n\n- **`ControlChannel`:**\n - Используется для взаимодействия модели (ControlModel) внутри системы. Класс находится в модуле `src/app_runtime/control/base.py`.\n \n- **`ControlActionSet`:**\n - Также используется для настройки поведения модели. Находится в том же модуле.\n\n- **`UvicornThreadRunner`:**\n - Служит механизмом запуска HTTP-сервиса через uvicorn. Находится в `src/app_runtime/control/http_runner.py`.\n\n- **`HttpControlChannel`:**\n - Обеспечивает взаимодействие с внешним миром через HTTP-запросы. Находится в `src/app_runtime/control/http_channel.py`.\n\n---\n\n### Поток данных и управление состоянием\n\nКласс `ControlPlaneService` отвечает за поддержание согласованного состояния между различными компонентами системы. Он обеспечивает механизм для координации действий между разными частями приложения, участвует в распределении нагрузки и синхронизации потоков выполнения задач.\n\nПример простого сценария использования:\n\n```python\n# Создание экземпляра ControlPlaneService\nservice = ControlPlaneService()\n\n# Чтение текущего состояния\ncurrent_state = service.get_current_state()\n\n# Запись нового состояния\nservice.set_new_state(new_state_data)\n```\n\nТаким образом, `ControlPlaneService` выступает как центральный элемент управления состоянием всей системы, обеспечивая корректное функционирование и координацию всех компонентов приложения.", - "summary": { - "router": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "confidence": null - }, - "retrieval": { - "profile": "code", - "layers_hit": [ - "C0_SOURCE_CHUNKS", - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS", - "C4_SEMANTIC_ROLES" - ], - "evidence_sufficient": true - }, - "llm": { - "answer_status": "answered", - "groundedness": "grounded" - } - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "ControlPlaneService" - ], - "keyword_hints": [ - "ControlPlaneService" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C0_SOURCE_CHUNKS": "exact_path_fetch", - "C4_SEMANTIC_ROLES": "exact_path_fetch", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C3_ENTRYPOINTS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 8, - "C4_SEMANTIC_ROLES": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C3_ENTRYPOINTS": 6 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C4_SEMANTIC_ROLES": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "ControlPlaneService", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Объясни класс ControlPlaneService", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C4_SEMANTIC_ROLES", - "query": "Объясни класс ControlPlaneService", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "Объясни класс ControlPlaneService", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - }, - { - "layer": "C3_ENTRYPOINTS", - "query": "Объясни класс ControlPlaneService", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 1, - "candidates_after_filter": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 6, - "candidates_after_filter": 6 - }, - { - "layer": "C3_ENTRYPOINTS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 3, - "candidates_after_filter": 3 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "ControlPlaneService", - "alternatives": [ - "ControlPlaneService" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C4_SEMANTIC_ROLES", - "status": "hit", - "hit_count": 8, - "fail_reason": null - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 6, - "fail_reason": null - }, - { - "layer": "C3_ENTRYPOINTS", - "status": "hit", - "hit_count": 3, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "router": 0, - "symbol_resolution": 0, - "retrieval_total": 167, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 53, - "C0_SOURCE_CHUNKS": 21, - "C4_SEMANTIC_ROLES": 17, - "C2_DEPENDENCY_GRAPH": 64, - "C3_ENTRYPOINTS": 10 - }, - "merge_rank": 24, - "prompt_build": 0, - "llm_call": 6002 - }, - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 325, - "evidence_rows": 19, - "evidence_chars": 3087 - }, - "evidence_summary": [ - { - "layer": "C1_SYMBOL_CATALOG", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "count": 8, - "unique_paths": 7 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "count": 6, - "unique_paths": 1 - }, - { - "layer": "C3_ENTRYPOINTS", - "count": 3, - "unique_paths": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 1, - "unique_paths": 1 - } - ], - "prompt_template_id": "intent_code_qa_v1", - "system_prompt_version": "v1" - }, - "router": { - "conversation_mode": "START", - "keyword_hints": [ - "ControlPlaneService" - ], - "path_scope": [] - }, - "llm": { - "used_evidence_count": 19, - "missing_evidence_reason": null - } - }, - "run_info": { - "case_id": "plba-fullchain-explain-control-plane-service", - "mode": "full_chain", - "run_started_at": "2026-03-12T09:13:14", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - }, - "input_request": { - "text": "Объясни класс ControlPlaneService", - "normalized_query": "Объясни класс ControlPlaneService" - }, - "steps": [ - { - "step": "intent_router", - "input": { - "query": "Объясни класс ControlPlaneService" - }, - "output": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Объясни класс ControlPlaneService" - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "ControlPlaneService" - ], - "keyword_hints": [ - "ControlPlaneService" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "timings_ms": { - "router": 0 - } - } - }, - { - "step": "retrieval", - "input": { - "query": "Объясни класс ControlPlaneService" - }, - "output": { - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "ControlPlaneService", - "alternatives": [ - "ControlPlaneService" - ], - "confidence": 0.99 - }, - "rag_count": 19, - "rag_rows": [ - { - "path": "src/app_runtime/control/service.py", - "content": "class ControlPlaneService\nControlPlaneService", - "layer": "C1_SYMBOL_CATALOG", - "title": "ControlPlaneService", - "span_start": 12, - "span_end": 52, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "b13471e5916986dccffb53fab613812842965705e6b3a89ae549d30c9e91e9aa", - "qname": "ControlPlaneService", - "kind": "class", - "signature": "ControlPlaneService", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.control.service", - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests service\n- reads and writes state attributes\n- participates in dataflow slices (5)", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlPlaneService", - "span_start": 12, - "span_end": 52, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 68, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "b13471e5916986dccffb53fab613812842965705e6b3a89ae549d30c9e91e9aa", - "symbol_name": "ControlPlaneService", - "qname": "ControlPlaneService", - "role": "pipeline_stage", - "confidence": 0.57, - "dataflow_participation": 5, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "ControlChannel\nrole: model\n\nResponsibilities:\n- default model role", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlChannel", - "span_start": 21, - "span_end": 28, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 40, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "cfcfe9a311d3a2dbdaf32ac4ccd73c0eb9a117f830591a1c0867ee97d46204ff", - "symbol_name": "ControlChannel", - "qname": "ControlChannel", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "ControlActionSet\nrole: model\n\nResponsibilities:\n- default model role", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlActionSet", - "span_start": 14, - "span_end": 18, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 40, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "46eb026cb3313415ec47b82dd22f84f4d112c9d987e8b1716dcb0baa1cce8988", - "symbol_name": "ControlActionSet", - "qname": "ControlActionSet", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_runner.py", - "content": "UvicornThreadRunner\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (24)", - "layer": "C4_SEMANTIC_ROLES", - "title": "UvicornThreadRunner", - "span_start": 10, - "span_end": 61, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 11, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "fd55630045a02100df8877ac27d951ee08617d4598764394d48cb51fe067476a", - "symbol_name": "UvicornThreadRunner", - "qname": "UvicornThreadRunner", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 24, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "3779fdd2878b770e789a35bb2a89c9d79f13b61c26d7db1b3b683f9bb9e1623f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (10)", - "layer": "C4_SEMANTIC_ROLES", - "title": "HttpControlChannel", - "span_start": 12, - "span_end": 57, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 21, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "1c9fbdc24819e5604c26ea55428a74310f03a03e1af197ed84846af61e42fdb0", - "symbol_name": "HttpControlChannel", - "qname": "HttpControlChannel", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 10, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "HttpControlAppFactory\nrole: factory\n\nResponsibilities:\n- name suffix suggests factory", - "layer": "C4_SEMANTIC_ROLES", - "title": "HttpControlAppFactory", - "span_start": 15, - "span_end": 53, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 39, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "9b3502a5fb408b273223db13264349cf500de24915b6c649d9ea8970d0dfd8e0", - "symbol_name": "HttpControlAppFactory", - "qname": "HttpControlAppFactory", - "role": "factory", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/persistence/workflow_persistence.py", - "content": "WorkflowPersistence\nrole: pipeline_stage\n\nResponsibilities:\n- orchestrates role-like calls (2)\n- reads and writes state attributes\n- participates in dataflow slices (16)", - "layer": "C4_SEMANTIC_ROLES", - "title": "WorkflowPersistence", - "span_start": 8, - "span_end": 54, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 15, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "7bd01ee45cf31f2d5c2e3e51656254860ac785d10cef9e0852cd4fba90857bae", - "symbol_name": "WorkflowPersistence", - "qname": "WorkflowPersistence", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 16, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "80e9410ddc639789b4353c2a1a757ba8d0d5b5bb6075b0b263b61551f04ae1f0", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/queue/in_memory.py", - "content": "InMemoryTaskQueue\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (9)", - "layer": "C4_SEMANTIC_ROLES", - "title": "InMemoryTaskQueue", - "span_start": 9, - "span_end": 38, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 22, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "2da04cb94544a3bcbf0943a95ad4bdd8710bcafaa32a02fd0e4de2178dcf3533", - "symbol_name": "InMemoryTaskQueue", - "qname": "InMemoryTaskQueue", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 9, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "58f0cc001ccda0eee4c6bc32ed83bd05eafd6b6644f1e8b4aa9eed3103db73dc", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.stop", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 25, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d", - "dst_ref": "ControlPlaneService.stop", - "resolution": "resolved", - "slice_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.stop" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._stop_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 51, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a", - "dst_ref": "ControlPlaneService._stop_async", - "resolution": "resolved", - "slice_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._stop_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.register_channel", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 17, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957", - "dst_ref": "ControlPlaneService.register_channel", - "resolution": "resolved", - "slice_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.register_channel" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.start", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 20, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154", - "dst_ref": "ControlPlaneService.start", - "resolution": "resolved", - "slice_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.start" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._start_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 47, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517", - "dst_ref": "ControlPlaneService._start_async", - "resolution": "resolved", - "slice_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._start_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.register_channel reads_attr self._channels.append", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.register_channel:reads_attr", - "span_start": 17, - "span_end": 17, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "1ee5925deffdc38ba15b88bf7c89e5fcd1a78f493fe30f2deb827d714a1b18e8", - "edge_type": "reads_attr", - "src_symbol_id": "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957", - "src_qname": "ControlPlaneService.register_channel", - "dst_symbol_id": null, - "dst_ref": "self._channels.append", - "resolution": "partial", - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "class ControlPlaneService:\n def __init__(self) -> None:\n self._channels: list[ControlChannel] = []\n\n def register_channel(self, channel: ControlChannel) -> None:\n self._channels.append(channel)\n\n def start(self, runtime: RuntimeManager) -> None:\n if not self._channels:\n return\n asyncio.run(self._start_async(runtime))\n\n def stop(self) -> None:\n if not self._channels:\n return\n asyncio.run(self._stop_async())\n\n def snapshot(self, runtime: RuntimeManager) -> dict[str, object]:\n health = runtime.current_health()\n return {\n \"runtime\": {\"state\": runtime._state.value},\n \"modules\": list(runtime.registry.modules),\n \"services\": runtime.services.snapshot(),\n \"workers\": runtime.workers.snapshot(),\n \"health\": runtime.health.snapshot(runtime.workers.healths()) | {\"status\": health[\"status\"]},\n \"config\": runtime.configuration.get(),\n }\n\n async def _start_async(self, runtime: RuntimeManager) -> None:\n actions = ControlActionSet(\n health=runtime.health_status,\n start=runtime.start_runtime,\n stop=runtime.stop_runtime,\n status=runtime.runtime_status,\n )\n for channel in self._channels:\n await channel.start(actions)\n\n async def _stop_async(self) -> None:\n for channel in reversed(self._channels):\n await channel.stop()", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/service.py:ControlPlaneService", - "span_start": 12, - "span_end": 52, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.service", - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ] - }, - "diagnostics": { - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C0_SOURCE_CHUNKS": "exact_path_fetch", - "C4_SEMANTIC_ROLES": "exact_path_fetch", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C3_ENTRYPOINTS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 8, - "C4_SEMANTIC_ROLES": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C3_ENTRYPOINTS": 6 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C4_SEMANTIC_ROLES": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "ControlPlaneService", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Объясни класс ControlPlaneService", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C4_SEMANTIC_ROLES", - "query": "Объясни класс ControlPlaneService", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "Объясни класс ControlPlaneService", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - }, - { - "layer": "C3_ENTRYPOINTS", - "query": "Объясни класс ControlPlaneService", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 1, - "candidates_after_filter": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 6, - "candidates_after_filter": 6 - }, - { - "layer": "C3_ENTRYPOINTS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 3, - "candidates_after_filter": 3 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "ControlPlaneService", - "alternatives": [ - "ControlPlaneService" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C4_SEMANTIC_ROLES", - "status": "hit", - "hit_count": 8, - "fail_reason": null - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 6, - "fail_reason": null - }, - { - "layer": "C3_ENTRYPOINTS", - "status": "hit", - "hit_count": 3, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "symbol_resolution": 0, - "retrieval_total": 167, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 53, - "C0_SOURCE_CHUNKS": 21, - "C4_SEMANTIC_ROLES": 17, - "C2_DEPENDENCY_GRAPH": 64, - "C3_ENTRYPOINTS": 10 - }, - "merge_rank": 24 - } - } - }, - { - "step": "llm_answer", - "input": { - "query": "Объясни класс ControlPlaneService", - "rag_count": 19 - }, - "output": { - "llm_answer": "## Анализ класса `ControlPlaneService`\n\n### Описание файла и роли классов\n\nФайл **`src/app_runtime/control/service.py`** содержит определение класса `ControlPlaneService`. Этот файл также импортирует классы и компоненты из других модулей (`base`, `http_channel`, `http_runner`), которые участвуют в общей архитектуре системы управления.\n\n### Класс `ControlPlaneService`\n\nКласс `ControlPlaneService` является ключевым компонентом архитектуры и играет роль «pipeline stage» (этап конвейера). Его основная ответственность заключается в управлении состоянием системы, чтении и записи атрибутов состояния, а также участии в различных срезах обработки данных («dataflow slices»).\n\n#### Архитектура и структура\n\n- **Название класса**: `ControlPlaneService`\n- **Путь к файлу**: `src/app_runtime/control/service.py`\n- **Роль**: `pipeline stage`\n \n#### Основные обязанности (Responsibilities):\n\n1. **Имя суффикса указывает на сервисную природу объекта:** \n - Имя класса подразумевает, что он управляет определенными аспектами работы системы или сервиса.\n \n2. **Чтение и запись атрибутов состояния:**\n - Контролирует состояние приложения через чтение и запись соответствующих атрибутов.\n \n3. **Участие в данных срезах (Dataflow Slices):**\n - Участие в 5 разных срезах данных, что означает его участие в нескольких параллельных процессах или каналах передачи данных.\n\n#### Взаимодействие с другими сущностями\n\n- **`ControlChannel`:**\n - Используется для взаимодействия модели (ControlModel) внутри системы. Класс находится в модуле `src/app_runtime/control/base.py`.\n \n- **`ControlActionSet`:**\n - Также используется для настройки поведения модели. Находится в том же модуле.\n\n- **`UvicornThreadRunner`:**\n - Служит механизмом запуска HTTP-сервиса через uvicorn. Находится в `src/app_runtime/control/http_runner.py`.\n\n- **`HttpControlChannel`:**\n - Обеспечивает взаимодействие с внешним миром через HTTP-запросы. Находится в `src/app_runtime/control/http_channel.py`.\n\n---\n\n### Поток данных и управление состоянием\n\nКласс `ControlPlaneService` отвечает за поддержание согласованного состояния между различными компонентами системы. Он обеспечивает механизм для координации действий между разными частями приложения, участвует в распределении нагрузки и синхронизации потоков выполнения задач.\n\nПример простого сценария использования:\n\n```python\n# Создание экземпляра ControlPlaneService\nservice = ControlPlaneService()\n\n# Чтение текущего состояния\ncurrent_state = service.get_current_state()\n\n# Запись нового состояния\nservice.set_new_state(new_state_data)\n```\n\nТаким образом, `ControlPlaneService` выступает как центральный элемент управления состоянием всей системы, обеспечивая корректное функционирование и координацию всех компонентов приложения." - }, - "diagnostics": { - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 325, - "evidence_rows": 19, - "evidence_chars": 3087 - }, - "evidence_summary": [ - { - "layer": "C1_SYMBOL_CATALOG", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "count": 8, - "unique_paths": 7 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "count": 6, - "unique_paths": 1 - }, - { - "layer": "C3_ENTRYPOINTS", - "count": 3, - "unique_paths": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 1, - "unique_paths": 1 - } - ], - "prompt_template_id": "intent_code_qa_v1", - "system_prompt_version": "v1" - }, - "timings_ms": { - "prompt_build": 0, - "llm_call": 6002 - } - } - } - ] - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_091314/full_chain_plba_code_retrieval_plba-fullchain-explain-control-plane-service.md b/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_091314/full_chain_plba_code_retrieval_plba-fullchain-explain-control-plane-service.md deleted file mode 100644 index 14c9726..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_091314/full_chain_plba_code_retrieval_plba-fullchain-explain-control-plane-service.md +++ /dev/null @@ -1,34 +0,0 @@ -# plba-fullchain-explain-control-plane-service - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_retrieval.yaml -- runner: runtime -- mode: full_chain -- passed: True - -## Query -Объясни класс ControlPlaneService - -## Actual -{ - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 19, - "llm_answer": "## Анализ класса `ControlPlaneService`\n\n### Описание файла и роли классов\n\nФайл **`src/app_runtime/control/service.py`** содержит определение класса `ControlPlaneService`. Этот файл также импортирует классы и компоненты из других модулей (`base`, `http_channel`, `http_runner`), которые участвуют в общей архитектуре системы управления.\n\n### Класс `ControlPlaneService`\n\nКласс `ControlPlaneService` является ключевым компонентом архитектуры и играет роль «pipeline stage» (этап конвейера). Его основная ответственность заключается в управлении состоянием системы, чтении и записи атрибутов состояния, а также участии в различных срезах обработки данных («dataflow slices»).\n\n#### Архитектура и структура\n\n- **Название класса**: `ControlPlaneService`\n- **Путь к файлу**: `src/app_runtime/control/service.py`\n- **Роль**: `pipeline stage`\n \n#### Основные обязанности (Responsibilities):\n\n1. **Имя суффикса указывает на сервисную природу объекта:** \n - Имя класса подразумевает, что он управляет определенными аспектами работы системы или сервиса.\n \n2. **Чтение и запись атрибутов состояния:**\n - Контролирует состояние приложения через чтение и запись соответствующих атрибутов.\n \n3. **Участие в данных срезах (Dataflow Slices):**\n - Участие в 5 разных срезах данных, что означает его участие в нескольких параллельных процессах или каналах передачи данных.\n\n#### Взаимодействие с другими сущностями\n\n- **`ControlChannel`:**\n - Используется для взаимодействия модели (ControlModel) внутри системы. Класс находится в модуле `src/app_runtime/control/base.py`.\n \n- **`ControlActionSet`:**\n - Также используется для настройки поведения модели. Находится в том же модуле.\n\n- **`UvicornThreadRunner`:**\n - Служит механизмом запуска HTTP-сервиса через uvicorn. Находится в `src/app_runtime/control/http_runner.py`.\n\n- **`HttpControlChannel`:**\n - Обеспечивает взаимодействие с внешним миром через HTTP-запросы. Находится в `src/app_runtime/control/http_channel.py`.\n\n---\n\n### Поток данных и управление состоянием\n\nКласс `ControlPlaneService` отвечает за поддержание согласованного состояния между различными компонентами системы. Он обеспечивает механизм для координации действий между разными частями приложения, участвует в распределении нагрузки и синхронизации потоков выполнения задач.\n\nПример простого сценария использования:\n\n```python\n# Создание экземпляра ControlPlaneService\nservice = ControlPlaneService()\n\n# Чтение текущего состояния\ncurrent_state = service.get_current_state()\n\n# Запись нового состояния\nservice.set_new_state(new_state_data)\n```\n\nТаким образом, `ControlPlaneService` выступает как центральный элемент управления состоянием всей системы, обеспечивая корректное функционирование и координацию всех компонентов приложения.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "ControlPlaneService" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] -} - -## Mismatches -- none \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_091314/full_chain_plba_code_retrieval_plba-fullchain-explain-create-runtime.json b/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_091314/full_chain_plba_code_retrieval_plba-fullchain-explain-create-runtime.json deleted file mode 100644 index 662bb56..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_091314/full_chain_plba_code_retrieval_plba-fullchain-explain-create-runtime.json +++ /dev/null @@ -1,2372 +0,0 @@ -{ - "case_id": "plba-fullchain-explain-create-runtime", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_retrieval.yaml", - "runner": "runtime", - "mode": "full_chain", - "actual": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 19, - "llm_answer": "## Анализ функции `create_runtime` и архитектуры приложения\n\n### Описание функции `create_runtime`\nФункция `create_runtime` расположена в файле `src/plba/bootstrap.py`. Её основная задача — инициализация и настройка runtime окружения для выполнения рабочих процессов или пайплайнов в приложении.\n\n#### Сигнатура функции\n```python\ndef create_runtime(module):\n # ...\n```\nПараметр `module` представляет собой модуль Python, который может содержать дополнительные настройки или классы, необходимые для конфигурации runtime.\n\n---\n\n### Поток данных и архитектура системы\n\nАрхитектура приложения разделена на несколько компонентов, каждый из которых играет определённую роль в общей системе:\n\n1. **Pipeline Stages**\n - **HttpRunner**: Класс `UvicornThreadRunner`, расположенный в `src/app_runtime/control/http_runner.py`.\n - Отвечает за управление HTTP-запросами и участие в обмене данными между компонентами системы.\n - **Workflow Persistence**: Класс `WorkflowPersistence`, находящийся в `src/app_runtime/workflow/persistence/workflow_persistence.py`.\n - Обеспечивает сохранение состояния workflow и его восстановление при необходимости.\n - **Http Control Channel**: Класс `HttpControlChannel`, расположенный в `src/app_runtime/control/http_channel.py`.\n - Управляет каналами связи с внешним миром через HTTP.\n - **In Memory Task Queue**: Класс `InMemoryTaskQueue`, находящийся в `src/app_runtime/queue/in_memory.py`.\n - Хранит задачи в памяти и управляет их выполнением.\n - **Config File Loader**: Класс `ConfigFileLoader`, расположенный в `src/app_runtime/config/file_loader.py`.\n - Загружает конфигурационные файлы и обеспечивает доступ к их содержимому.\n\nКаждый из этих классов участвует в передаче данных и управлении состоянием системы, что позволяет эффективно организовать выполнение различных задач и пайплайнов.\n\n---\n\n### Архитектурный обзор и обязанности каждого компонента\n\n- **Pipeline Stages** – это компоненты, которые участвуют в обработке данных и координации работы других частей системы. Они реализуют конкретные бизнес-логики и отвечают за передачу информации между этапами обработки.\n \n - **HttpRunner**: используется для обработки входящих HTTP запросов и организации потоков данных от клиентов.\n - **Workflow Persistence**: отвечает за долговременное хранение и восстановление состояний workflow.\n - **Http Control Channel**: служит основным каналом управления внешними коммуникациями.\n - **In Memory Task Queue**: хранит и выполняет задачи в оперативной памяти.\n - **Config File Loader**: загружает внешние конфигурационные данные и предоставляет к ним доступ.\n\nЭти компоненты работают совместно, обеспечивая согласованное функционирование всей системы.\n\n---\n\n### Взаимодействие и зависимость компонентов\n\nПри вызове функции `create_runtime` происходит инициализация всех необходимых компонентов и создание связей между ними. Это включает настройку каналов коммуникации, загрузку конфигурации и подготовку среды для выполнения рабочих процессов.\n\nНапример, объект класса `UvicornThreadRunner` будет создан и настроен таким образом, чтобы обрабатывать входящие запросы и выполнять логику на основе поступающих задач. Аналогично другие компоненты будут инициализированы и настроены согласно предоставленной конфигурации.\n\n---\n\n### Заключение\n\nФункция `create_runtime` предназначена для создания и настройки runtime окружения, необходимого для выполнения рабочих процессов и пайплайнов. Она использует различные компоненты, такие как каналы коммуникации, хранилища состояний и очереди задач, для обеспечения эффективного обмена данными и управления рабочими процессами.\n\nТаким образом, функция создает основу для последующего запуска приложений и выполнения рабочих нагрузок, опираясь на четкую организацию и координацию компонентов системы.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "create_runtime" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "passed": true, - "mismatches": [], - "details": { - "case_id": "plba-fullchain-explain-create-runtime", - "text": "Объясни функцию create_runtime", - "mode": "full_chain", - "run_started_at": "2026-03-12T09:13:14", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Объясни функцию create_runtime", - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "create_runtime", - "alternatives": [ - "create_runtime" - ], - "confidence": 0.99 - }, - "rag_count": 19, - "rag_rows": [ - { - "path": "src/plba/bootstrap.py", - "content": "function create_runtime\ncreate_runtime(module)", - "layer": "C1_SYMBOL_CATALOG", - "title": "create_runtime", - "span_start": 8, - "span_end": 29, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "qname": "create_runtime", - "kind": "function", - "signature": "create_runtime(module)", - "parent_symbol_id": null, - "package_or_module": "src.plba.bootstrap", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_runner.py", - "content": "UvicornThreadRunner\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (24)", - "layer": "C4_SEMANTIC_ROLES", - "title": "UvicornThreadRunner", - "span_start": 10, - "span_end": 61, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 11, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "fd55630045a02100df8877ac27d951ee08617d4598764394d48cb51fe067476a", - "symbol_name": "UvicornThreadRunner", - "qname": "UvicornThreadRunner", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 24, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "3779fdd2878b770e789a35bb2a89c9d79f13b61c26d7db1b3b683f9bb9e1623f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/persistence/workflow_persistence.py", - "content": "WorkflowPersistence\nrole: pipeline_stage\n\nResponsibilities:\n- orchestrates role-like calls (2)\n- reads and writes state attributes\n- participates in dataflow slices (16)", - "layer": "C4_SEMANTIC_ROLES", - "title": "WorkflowPersistence", - "span_start": 8, - "span_end": 54, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 15, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "7bd01ee45cf31f2d5c2e3e51656254860ac785d10cef9e0852cd4fba90857bae", - "symbol_name": "WorkflowPersistence", - "qname": "WorkflowPersistence", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 16, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "80e9410ddc639789b4353c2a1a757ba8d0d5b5bb6075b0b263b61551f04ae1f0", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (10)", - "layer": "C4_SEMANTIC_ROLES", - "title": "HttpControlChannel", - "span_start": 12, - "span_end": 57, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 21, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "1c9fbdc24819e5604c26ea55428a74310f03a03e1af197ed84846af61e42fdb0", - "symbol_name": "HttpControlChannel", - "qname": "HttpControlChannel", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 10, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/queue/in_memory.py", - "content": "InMemoryTaskQueue\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (9)", - "layer": "C4_SEMANTIC_ROLES", - "title": "InMemoryTaskQueue", - "span_start": 9, - "span_end": 38, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 22, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "2da04cb94544a3bcbf0943a95ad4bdd8710bcafaa32a02fd0e4de2178dcf3533", - "symbol_name": "InMemoryTaskQueue", - "qname": "InMemoryTaskQueue", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 9, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "58f0cc001ccda0eee4c6bc32ed83bd05eafd6b6644f1e8b4aa9eed3103db73dc", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/config/file_loader.py", - "content": "ConfigFileLoader\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (8)", - "layer": "C4_SEMANTIC_ROLES", - "title": "ConfigFileLoader", - "span_start": 11, - "span_end": 48, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 23, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "a8474eca8b6e9dc86ae67ed68b16fa5fb639ef08739c053e7b7195489765667f", - "symbol_name": "ConfigFileLoader", - "qname": "ConfigFileLoader", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 8, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "1f19ffebde5e38e4be5a5d5a678059a0f36dedb8fb8b3e00ab395c67106a87ea", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workers/supervisor.py", - "content": "WorkerSupervisor\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (6)", - "layer": "C4_SEMANTIC_ROLES", - "title": "WorkerSupervisor", - "span_start": 10, - "span_end": 59, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 25, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "c17b44e8d9e97d490989b21fa67d7c346cdda8a0472e4c41fb243c8846faa124", - "symbol_name": "WorkerSupervisor", - "qname": "WorkerSupervisor", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 6, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "77609d9d5927171cce7fc3a54897c183fd63068710c6362029b700937aae5eee", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/engine/workflow_engine.py", - "content": "WorkflowEngine\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (6)", - "layer": "C4_SEMANTIC_ROLES", - "title": "WorkflowEngine", - "span_start": 10, - "span_end": 86, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 25, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "57ec0a9f11c542c78e008684a888397e8d9ef4223671acb2567e631a0cbc70b4", - "symbol_name": "WorkflowEngine", - "qname": "WorkflowEngine", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 6, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "1057136e58a325cd5ab6f4e265d15665fb6a711b7022d9fab52a1a290afa2368", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/store.py", - "content": "TraceContextStore\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (6)", - "layer": "C4_SEMANTIC_ROLES", - "title": "TraceContextStore", - "span_start": 15, - "span_end": 52, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 25, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "b2dad4fbe16ffb11b58deba311c7739955c39d59f291b22181f33e9c8cce4059", - "symbol_name": "TraceContextStore", - "qname": "TraceContextStore", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 6, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "d369554f08fc92039c6edd5a2a1e73b23901533e8974459170bbd9347d263dc5", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/bootstrap.py", - "content": "create_runtime calls runtime.add_config_file", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "create_runtime:calls", - "span_start": 19, - "span_end": 19, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "4eaeec4ac55a59d5f66fd01c4754955f8fedaf4bc3df13fa769b352c7bfaacbb", - "edge_type": "calls", - "src_symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "src_qname": "create_runtime", - "dst_symbol_id": null, - "dst_ref": "runtime.add_config_file", - "resolution": "partial", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/bootstrap.py", - "content": "create_runtime reads_attr runtime.register_module", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "create_runtime:reads_attr", - "span_start": 28, - "span_end": 28, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "45516c79ff358dbf9b650a081668df0f66d2fe989300f985a1a78be6be166f8f", - "edge_type": "reads_attr", - "src_symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "src_qname": "create_runtime", - "dst_symbol_id": null, - "dst_ref": "runtime.register_module", - "resolution": "partial", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/bootstrap.py", - "content": "create_runtime instantiates RuntimeManager", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "create_runtime:instantiates", - "span_start": 17, - "span_end": 17, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "0adba17984f850ea1608c9e734d2dd5c325cfde3a8133123aa239e44935ad18e", - "edge_type": "instantiates", - "src_symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "src_qname": "create_runtime", - "dst_symbol_id": "27158ca220022eeb5083c6addf8a50775d45f7161284fd60aac48410105f4b98", - "dst_ref": "RuntimeManager", - "resolution": "resolved", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/bootstrap.py", - "content": "create_runtime calls runtime.register_module", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "create_runtime:calls", - "span_start": 28, - "span_end": 28, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "ab6003c3441addc1ba1b81edeca009165559f652f6b2cf424e5ae61b1f617de8", - "edge_type": "calls", - "src_symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "src_qname": "create_runtime", - "dst_symbol_id": null, - "dst_ref": "runtime.register_module", - "resolution": "partial", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/bootstrap.py", - "content": "create_runtime calls runtime.control_plane.register_channel", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "create_runtime:calls", - "span_start": 21, - "span_end": 27, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "2678250030b9ce47a3b3b55fac7897ac530367edc8374ac9d5e6ecafb1e483f0", - "edge_type": "calls", - "src_symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "src_qname": "create_runtime", - "dst_symbol_id": null, - "dst_ref": "runtime.control_plane.register_channel", - "resolution": "partial", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/bootstrap.py", - "content": "create_runtime reads_attr runtime.add_config_file", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "create_runtime:reads_attr", - "span_start": 19, - "span_end": 19, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "30d4e8aae984ab84d523e80d02f1caeda52d547fa3d2aa47be8845931cabbca2", - "edge_type": "reads_attr", - "src_symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "src_qname": "create_runtime", - "dst_symbol_id": null, - "dst_ref": "runtime.add_config_file", - "resolution": "partial", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/bootstrap.py", - "content": "def create_runtime(\n module: ApplicationModule,\n *,\n config_path: str | None = None,\n enable_http_control: bool = False,\n control_host: str = \"127.0.0.1\",\n control_port: int = 8080,\n control_timeout: int = 5,\n) -> RuntimeManager:\n runtime = RuntimeManager()\n if config_path is not None:\n runtime.add_config_file(config_path)\n if enable_http_control:\n runtime.control_plane.register_channel(\n HttpControlChannel(\n host=control_host,\n port=control_port,\n timeout=control_timeout,\n )\n )\n runtime.register_module(module)\n return runtime", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/plba/bootstrap.py:create_runtime", - "span_start": 8, - "span_end": 29, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.plba.bootstrap", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "llm_answer": "## Анализ функции `create_runtime` и архитектуры приложения\n\n### Описание функции `create_runtime`\nФункция `create_runtime` расположена в файле `src/plba/bootstrap.py`. Её основная задача — инициализация и настройка runtime окружения для выполнения рабочих процессов или пайплайнов в приложении.\n\n#### Сигнатура функции\n```python\ndef create_runtime(module):\n # ...\n```\nПараметр `module` представляет собой модуль Python, который может содержать дополнительные настройки или классы, необходимые для конфигурации runtime.\n\n---\n\n### Поток данных и архитектура системы\n\nАрхитектура приложения разделена на несколько компонентов, каждый из которых играет определённую роль в общей системе:\n\n1. **Pipeline Stages**\n - **HttpRunner**: Класс `UvicornThreadRunner`, расположенный в `src/app_runtime/control/http_runner.py`.\n - Отвечает за управление HTTP-запросами и участие в обмене данными между компонентами системы.\n - **Workflow Persistence**: Класс `WorkflowPersistence`, находящийся в `src/app_runtime/workflow/persistence/workflow_persistence.py`.\n - Обеспечивает сохранение состояния workflow и его восстановление при необходимости.\n - **Http Control Channel**: Класс `HttpControlChannel`, расположенный в `src/app_runtime/control/http_channel.py`.\n - Управляет каналами связи с внешним миром через HTTP.\n - **In Memory Task Queue**: Класс `InMemoryTaskQueue`, находящийся в `src/app_runtime/queue/in_memory.py`.\n - Хранит задачи в памяти и управляет их выполнением.\n - **Config File Loader**: Класс `ConfigFileLoader`, расположенный в `src/app_runtime/config/file_loader.py`.\n - Загружает конфигурационные файлы и обеспечивает доступ к их содержимому.\n\nКаждый из этих классов участвует в передаче данных и управлении состоянием системы, что позволяет эффективно организовать выполнение различных задач и пайплайнов.\n\n---\n\n### Архитектурный обзор и обязанности каждого компонента\n\n- **Pipeline Stages** – это компоненты, которые участвуют в обработке данных и координации работы других частей системы. Они реализуют конкретные бизнес-логики и отвечают за передачу информации между этапами обработки.\n \n - **HttpRunner**: используется для обработки входящих HTTP запросов и организации потоков данных от клиентов.\n - **Workflow Persistence**: отвечает за долговременное хранение и восстановление состояний workflow.\n - **Http Control Channel**: служит основным каналом управления внешними коммуникациями.\n - **In Memory Task Queue**: хранит и выполняет задачи в оперативной памяти.\n - **Config File Loader**: загружает внешние конфигурационные данные и предоставляет к ним доступ.\n\nЭти компоненты работают совместно, обеспечивая согласованное функционирование всей системы.\n\n---\n\n### Взаимодействие и зависимость компонентов\n\nПри вызове функции `create_runtime` происходит инициализация всех необходимых компонентов и создание связей между ними. Это включает настройку каналов коммуникации, загрузку конфигурации и подготовку среды для выполнения рабочих процессов.\n\nНапример, объект класса `UvicornThreadRunner` будет создан и настроен таким образом, чтобы обрабатывать входящие запросы и выполнять логику на основе поступающих задач. Аналогично другие компоненты будут инициализированы и настроены согласно предоставленной конфигурации.\n\n---\n\n### Заключение\n\nФункция `create_runtime` предназначена для создания и настройки runtime окружения, необходимого для выполнения рабочих процессов и пайплайнов. Она использует различные компоненты, такие как каналы коммуникации, хранилища состояний и очереди задач, для обеспечения эффективного обмена данными и управления рабочими процессами.\n\nТаким образом, функция создает основу для последующего запуска приложений и выполнения рабочих нагрузок, опираясь на четкую организацию и координацию компонентов системы.", - "summary": { - "router": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "confidence": null - }, - "retrieval": { - "profile": "code", - "layers_hit": [ - "C0_SOURCE_CHUNKS", - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS", - "C4_SEMANTIC_ROLES" - ], - "evidence_sufficient": true - }, - "llm": { - "answer_status": "answered", - "groundedness": "grounded" - } - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "symbol_kind_hint": "function", - "symbol_candidates": [ - "create_runtime" - ], - "keyword_hints": [ - "create_runtime" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C0_SOURCE_CHUNKS": "exact_path_fetch", - "C4_SEMANTIC_ROLES": "exact_path_fetch", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C3_ENTRYPOINTS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 8, - "C4_SEMANTIC_ROLES": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C3_ENTRYPOINTS": 6 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C4_SEMANTIC_ROLES": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "create_runtime", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Объясни функцию create_runtime", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C4_SEMANTIC_ROLES", - "query": "Объясни функцию create_runtime", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "Объясни функцию create_runtime", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - }, - { - "layer": "C3_ENTRYPOINTS", - "query": "Объясни функцию create_runtime", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 1, - "candidates_after_filter": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 6, - "candidates_after_filter": 6 - }, - { - "layer": "C3_ENTRYPOINTS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 3, - "candidates_after_filter": 3 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "create_runtime", - "alternatives": [ - "create_runtime" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C4_SEMANTIC_ROLES", - "status": "hit", - "hit_count": 8, - "fail_reason": null - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 6, - "fail_reason": null - }, - { - "layer": "C3_ENTRYPOINTS", - "status": "hit", - "hit_count": 3, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "router": 0, - "symbol_resolution": 0, - "retrieval_total": 138, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 38, - "C0_SOURCE_CHUNKS": 21, - "C4_SEMANTIC_ROLES": 16, - "C2_DEPENDENCY_GRAPH": 48, - "C3_ENTRYPOINTS": 14 - }, - "merge_rank": 22, - "prompt_build": 0, - "llm_call": 6906 - }, - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 362, - "evidence_rows": 19, - "evidence_chars": 2136 - }, - "evidence_summary": [ - { - "layer": "C1_SYMBOL_CATALOG", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "count": 8, - "unique_paths": 8 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "count": 6, - "unique_paths": 1 - }, - { - "layer": "C3_ENTRYPOINTS", - "count": 3, - "unique_paths": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 1, - "unique_paths": 1 - } - ], - "prompt_template_id": "intent_code_qa_v1", - "system_prompt_version": "v1" - }, - "router": { - "conversation_mode": "START", - "keyword_hints": [ - "create_runtime" - ], - "path_scope": [] - }, - "llm": { - "used_evidence_count": 19, - "missing_evidence_reason": null - } - }, - "run_info": { - "case_id": "plba-fullchain-explain-create-runtime", - "mode": "full_chain", - "run_started_at": "2026-03-12T09:13:14", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - }, - "input_request": { - "text": "Объясни функцию create_runtime", - "normalized_query": "Объясни функцию create_runtime" - }, - "steps": [ - { - "step": "intent_router", - "input": { - "query": "Объясни функцию create_runtime" - }, - "output": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Объясни функцию create_runtime" - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "symbol_kind_hint": "function", - "symbol_candidates": [ - "create_runtime" - ], - "keyword_hints": [ - "create_runtime" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "timings_ms": { - "router": 0 - } - } - }, - { - "step": "retrieval", - "input": { - "query": "Объясни функцию create_runtime" - }, - "output": { - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "create_runtime", - "alternatives": [ - "create_runtime" - ], - "confidence": 0.99 - }, - "rag_count": 19, - "rag_rows": [ - { - "path": "src/plba/bootstrap.py", - "content": "function create_runtime\ncreate_runtime(module)", - "layer": "C1_SYMBOL_CATALOG", - "title": "create_runtime", - "span_start": 8, - "span_end": 29, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "qname": "create_runtime", - "kind": "function", - "signature": "create_runtime(module)", - "parent_symbol_id": null, - "package_or_module": "src.plba.bootstrap", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_runner.py", - "content": "UvicornThreadRunner\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (24)", - "layer": "C4_SEMANTIC_ROLES", - "title": "UvicornThreadRunner", - "span_start": 10, - "span_end": 61, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 11, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "fd55630045a02100df8877ac27d951ee08617d4598764394d48cb51fe067476a", - "symbol_name": "UvicornThreadRunner", - "qname": "UvicornThreadRunner", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 24, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "3779fdd2878b770e789a35bb2a89c9d79f13b61c26d7db1b3b683f9bb9e1623f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/persistence/workflow_persistence.py", - "content": "WorkflowPersistence\nrole: pipeline_stage\n\nResponsibilities:\n- orchestrates role-like calls (2)\n- reads and writes state attributes\n- participates in dataflow slices (16)", - "layer": "C4_SEMANTIC_ROLES", - "title": "WorkflowPersistence", - "span_start": 8, - "span_end": 54, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 15, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "7bd01ee45cf31f2d5c2e3e51656254860ac785d10cef9e0852cd4fba90857bae", - "symbol_name": "WorkflowPersistence", - "qname": "WorkflowPersistence", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 16, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "80e9410ddc639789b4353c2a1a757ba8d0d5b5bb6075b0b263b61551f04ae1f0", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (10)", - "layer": "C4_SEMANTIC_ROLES", - "title": "HttpControlChannel", - "span_start": 12, - "span_end": 57, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 21, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "1c9fbdc24819e5604c26ea55428a74310f03a03e1af197ed84846af61e42fdb0", - "symbol_name": "HttpControlChannel", - "qname": "HttpControlChannel", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 10, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/queue/in_memory.py", - "content": "InMemoryTaskQueue\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (9)", - "layer": "C4_SEMANTIC_ROLES", - "title": "InMemoryTaskQueue", - "span_start": 9, - "span_end": 38, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 22, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "2da04cb94544a3bcbf0943a95ad4bdd8710bcafaa32a02fd0e4de2178dcf3533", - "symbol_name": "InMemoryTaskQueue", - "qname": "InMemoryTaskQueue", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 9, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "58f0cc001ccda0eee4c6bc32ed83bd05eafd6b6644f1e8b4aa9eed3103db73dc", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/config/file_loader.py", - "content": "ConfigFileLoader\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (8)", - "layer": "C4_SEMANTIC_ROLES", - "title": "ConfigFileLoader", - "span_start": 11, - "span_end": 48, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 23, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "a8474eca8b6e9dc86ae67ed68b16fa5fb639ef08739c053e7b7195489765667f", - "symbol_name": "ConfigFileLoader", - "qname": "ConfigFileLoader", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 8, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "1f19ffebde5e38e4be5a5d5a678059a0f36dedb8fb8b3e00ab395c67106a87ea", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workers/supervisor.py", - "content": "WorkerSupervisor\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (6)", - "layer": "C4_SEMANTIC_ROLES", - "title": "WorkerSupervisor", - "span_start": 10, - "span_end": 59, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 25, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "c17b44e8d9e97d490989b21fa67d7c346cdda8a0472e4c41fb243c8846faa124", - "symbol_name": "WorkerSupervisor", - "qname": "WorkerSupervisor", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 6, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "77609d9d5927171cce7fc3a54897c183fd63068710c6362029b700937aae5eee", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/engine/workflow_engine.py", - "content": "WorkflowEngine\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (6)", - "layer": "C4_SEMANTIC_ROLES", - "title": "WorkflowEngine", - "span_start": 10, - "span_end": 86, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 25, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "57ec0a9f11c542c78e008684a888397e8d9ef4223671acb2567e631a0cbc70b4", - "symbol_name": "WorkflowEngine", - "qname": "WorkflowEngine", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 6, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "1057136e58a325cd5ab6f4e265d15665fb6a711b7022d9fab52a1a290afa2368", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/store.py", - "content": "TraceContextStore\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (6)", - "layer": "C4_SEMANTIC_ROLES", - "title": "TraceContextStore", - "span_start": 15, - "span_end": 52, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 25, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "b2dad4fbe16ffb11b58deba311c7739955c39d59f291b22181f33e9c8cce4059", - "symbol_name": "TraceContextStore", - "qname": "TraceContextStore", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 6, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "d369554f08fc92039c6edd5a2a1e73b23901533e8974459170bbd9347d263dc5", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/bootstrap.py", - "content": "create_runtime calls runtime.add_config_file", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "create_runtime:calls", - "span_start": 19, - "span_end": 19, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "4eaeec4ac55a59d5f66fd01c4754955f8fedaf4bc3df13fa769b352c7bfaacbb", - "edge_type": "calls", - "src_symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "src_qname": "create_runtime", - "dst_symbol_id": null, - "dst_ref": "runtime.add_config_file", - "resolution": "partial", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/bootstrap.py", - "content": "create_runtime reads_attr runtime.register_module", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "create_runtime:reads_attr", - "span_start": 28, - "span_end": 28, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "45516c79ff358dbf9b650a081668df0f66d2fe989300f985a1a78be6be166f8f", - "edge_type": "reads_attr", - "src_symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "src_qname": "create_runtime", - "dst_symbol_id": null, - "dst_ref": "runtime.register_module", - "resolution": "partial", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/bootstrap.py", - "content": "create_runtime instantiates RuntimeManager", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "create_runtime:instantiates", - "span_start": 17, - "span_end": 17, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "0adba17984f850ea1608c9e734d2dd5c325cfde3a8133123aa239e44935ad18e", - "edge_type": "instantiates", - "src_symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "src_qname": "create_runtime", - "dst_symbol_id": "27158ca220022eeb5083c6addf8a50775d45f7161284fd60aac48410105f4b98", - "dst_ref": "RuntimeManager", - "resolution": "resolved", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/bootstrap.py", - "content": "create_runtime calls runtime.register_module", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "create_runtime:calls", - "span_start": 28, - "span_end": 28, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "ab6003c3441addc1ba1b81edeca009165559f652f6b2cf424e5ae61b1f617de8", - "edge_type": "calls", - "src_symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "src_qname": "create_runtime", - "dst_symbol_id": null, - "dst_ref": "runtime.register_module", - "resolution": "partial", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/bootstrap.py", - "content": "create_runtime calls runtime.control_plane.register_channel", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "create_runtime:calls", - "span_start": 21, - "span_end": 27, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "2678250030b9ce47a3b3b55fac7897ac530367edc8374ac9d5e6ecafb1e483f0", - "edge_type": "calls", - "src_symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "src_qname": "create_runtime", - "dst_symbol_id": null, - "dst_ref": "runtime.control_plane.register_channel", - "resolution": "partial", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/bootstrap.py", - "content": "create_runtime reads_attr runtime.add_config_file", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "create_runtime:reads_attr", - "span_start": 19, - "span_end": 19, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "30d4e8aae984ab84d523e80d02f1caeda52d547fa3d2aa47be8845931cabbca2", - "edge_type": "reads_attr", - "src_symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "src_qname": "create_runtime", - "dst_symbol_id": null, - "dst_ref": "runtime.add_config_file", - "resolution": "partial", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/bootstrap.py", - "content": "def create_runtime(\n module: ApplicationModule,\n *,\n config_path: str | None = None,\n enable_http_control: bool = False,\n control_host: str = \"127.0.0.1\",\n control_port: int = 8080,\n control_timeout: int = 5,\n) -> RuntimeManager:\n runtime = RuntimeManager()\n if config_path is not None:\n runtime.add_config_file(config_path)\n if enable_http_control:\n runtime.control_plane.register_channel(\n HttpControlChannel(\n host=control_host,\n port=control_port,\n timeout=control_timeout,\n )\n )\n runtime.register_module(module)\n return runtime", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/plba/bootstrap.py:create_runtime", - "span_start": 8, - "span_end": 29, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.plba.bootstrap", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ] - }, - "diagnostics": { - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C0_SOURCE_CHUNKS": "exact_path_fetch", - "C4_SEMANTIC_ROLES": "exact_path_fetch", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C3_ENTRYPOINTS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 8, - "C4_SEMANTIC_ROLES": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C3_ENTRYPOINTS": 6 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C4_SEMANTIC_ROLES": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "create_runtime", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Объясни функцию create_runtime", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C4_SEMANTIC_ROLES", - "query": "Объясни функцию create_runtime", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "Объясни функцию create_runtime", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - }, - { - "layer": "C3_ENTRYPOINTS", - "query": "Объясни функцию create_runtime", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 1, - "candidates_after_filter": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 6, - "candidates_after_filter": 6 - }, - { - "layer": "C3_ENTRYPOINTS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 3, - "candidates_after_filter": 3 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "create_runtime", - "alternatives": [ - "create_runtime" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C4_SEMANTIC_ROLES", - "status": "hit", - "hit_count": 8, - "fail_reason": null - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 6, - "fail_reason": null - }, - { - "layer": "C3_ENTRYPOINTS", - "status": "hit", - "hit_count": 3, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "symbol_resolution": 0, - "retrieval_total": 138, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 38, - "C0_SOURCE_CHUNKS": 21, - "C4_SEMANTIC_ROLES": 16, - "C2_DEPENDENCY_GRAPH": 48, - "C3_ENTRYPOINTS": 14 - }, - "merge_rank": 22 - } - } - }, - { - "step": "llm_answer", - "input": { - "query": "Объясни функцию create_runtime", - "rag_count": 19 - }, - "output": { - "llm_answer": "## Анализ функции `create_runtime` и архитектуры приложения\n\n### Описание функции `create_runtime`\nФункция `create_runtime` расположена в файле `src/plba/bootstrap.py`. Её основная задача — инициализация и настройка runtime окружения для выполнения рабочих процессов или пайплайнов в приложении.\n\n#### Сигнатура функции\n```python\ndef create_runtime(module):\n # ...\n```\nПараметр `module` представляет собой модуль Python, который может содержать дополнительные настройки или классы, необходимые для конфигурации runtime.\n\n---\n\n### Поток данных и архитектура системы\n\nАрхитектура приложения разделена на несколько компонентов, каждый из которых играет определённую роль в общей системе:\n\n1. **Pipeline Stages**\n - **HttpRunner**: Класс `UvicornThreadRunner`, расположенный в `src/app_runtime/control/http_runner.py`.\n - Отвечает за управление HTTP-запросами и участие в обмене данными между компонентами системы.\n - **Workflow Persistence**: Класс `WorkflowPersistence`, находящийся в `src/app_runtime/workflow/persistence/workflow_persistence.py`.\n - Обеспечивает сохранение состояния workflow и его восстановление при необходимости.\n - **Http Control Channel**: Класс `HttpControlChannel`, расположенный в `src/app_runtime/control/http_channel.py`.\n - Управляет каналами связи с внешним миром через HTTP.\n - **In Memory Task Queue**: Класс `InMemoryTaskQueue`, находящийся в `src/app_runtime/queue/in_memory.py`.\n - Хранит задачи в памяти и управляет их выполнением.\n - **Config File Loader**: Класс `ConfigFileLoader`, расположенный в `src/app_runtime/config/file_loader.py`.\n - Загружает конфигурационные файлы и обеспечивает доступ к их содержимому.\n\nКаждый из этих классов участвует в передаче данных и управлении состоянием системы, что позволяет эффективно организовать выполнение различных задач и пайплайнов.\n\n---\n\n### Архитектурный обзор и обязанности каждого компонента\n\n- **Pipeline Stages** – это компоненты, которые участвуют в обработке данных и координации работы других частей системы. Они реализуют конкретные бизнес-логики и отвечают за передачу информации между этапами обработки.\n \n - **HttpRunner**: используется для обработки входящих HTTP запросов и организации потоков данных от клиентов.\n - **Workflow Persistence**: отвечает за долговременное хранение и восстановление состояний workflow.\n - **Http Control Channel**: служит основным каналом управления внешними коммуникациями.\n - **In Memory Task Queue**: хранит и выполняет задачи в оперативной памяти.\n - **Config File Loader**: загружает внешние конфигурационные данные и предоставляет к ним доступ.\n\nЭти компоненты работают совместно, обеспечивая согласованное функционирование всей системы.\n\n---\n\n### Взаимодействие и зависимость компонентов\n\nПри вызове функции `create_runtime` происходит инициализация всех необходимых компонентов и создание связей между ними. Это включает настройку каналов коммуникации, загрузку конфигурации и подготовку среды для выполнения рабочих процессов.\n\nНапример, объект класса `UvicornThreadRunner` будет создан и настроен таким образом, чтобы обрабатывать входящие запросы и выполнять логику на основе поступающих задач. Аналогично другие компоненты будут инициализированы и настроены согласно предоставленной конфигурации.\n\n---\n\n### Заключение\n\nФункция `create_runtime` предназначена для создания и настройки runtime окружения, необходимого для выполнения рабочих процессов и пайплайнов. Она использует различные компоненты, такие как каналы коммуникации, хранилища состояний и очереди задач, для обеспечения эффективного обмена данными и управления рабочими процессами.\n\nТаким образом, функция создает основу для последующего запуска приложений и выполнения рабочих нагрузок, опираясь на четкую организацию и координацию компонентов системы." - }, - "diagnostics": { - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 362, - "evidence_rows": 19, - "evidence_chars": 2136 - }, - "evidence_summary": [ - { - "layer": "C1_SYMBOL_CATALOG", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "count": 8, - "unique_paths": 8 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "count": 6, - "unique_paths": 1 - }, - { - "layer": "C3_ENTRYPOINTS", - "count": 3, - "unique_paths": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 1, - "unique_paths": 1 - } - ], - "prompt_template_id": "intent_code_qa_v1", - "system_prompt_version": "v1" - }, - "timings_ms": { - "prompt_build": 0, - "llm_call": 6906 - } - } - } - ] - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_091314/full_chain_plba_code_retrieval_plba-fullchain-explain-create-runtime.md b/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_091314/full_chain_plba_code_retrieval_plba-fullchain-explain-create-runtime.md deleted file mode 100644 index 9b373af..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_091314/full_chain_plba_code_retrieval_plba-fullchain-explain-create-runtime.md +++ /dev/null @@ -1,34 +0,0 @@ -# plba-fullchain-explain-create-runtime - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_retrieval.yaml -- runner: runtime -- mode: full_chain -- passed: True - -## Query -Объясни функцию create_runtime - -## Actual -{ - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 19, - "llm_answer": "## Анализ функции `create_runtime` и архитектуры приложения\n\n### Описание функции `create_runtime`\nФункция `create_runtime` расположена в файле `src/plba/bootstrap.py`. Её основная задача — инициализация и настройка runtime окружения для выполнения рабочих процессов или пайплайнов в приложении.\n\n#### Сигнатура функции\n```python\ndef create_runtime(module):\n # ...\n```\nПараметр `module` представляет собой модуль Python, который может содержать дополнительные настройки или классы, необходимые для конфигурации runtime.\n\n---\n\n### Поток данных и архитектура системы\n\nАрхитектура приложения разделена на несколько компонентов, каждый из которых играет определённую роль в общей системе:\n\n1. **Pipeline Stages**\n - **HttpRunner**: Класс `UvicornThreadRunner`, расположенный в `src/app_runtime/control/http_runner.py`.\n - Отвечает за управление HTTP-запросами и участие в обмене данными между компонентами системы.\n - **Workflow Persistence**: Класс `WorkflowPersistence`, находящийся в `src/app_runtime/workflow/persistence/workflow_persistence.py`.\n - Обеспечивает сохранение состояния workflow и его восстановление при необходимости.\n - **Http Control Channel**: Класс `HttpControlChannel`, расположенный в `src/app_runtime/control/http_channel.py`.\n - Управляет каналами связи с внешним миром через HTTP.\n - **In Memory Task Queue**: Класс `InMemoryTaskQueue`, находящийся в `src/app_runtime/queue/in_memory.py`.\n - Хранит задачи в памяти и управляет их выполнением.\n - **Config File Loader**: Класс `ConfigFileLoader`, расположенный в `src/app_runtime/config/file_loader.py`.\n - Загружает конфигурационные файлы и обеспечивает доступ к их содержимому.\n\nКаждый из этих классов участвует в передаче данных и управлении состоянием системы, что позволяет эффективно организовать выполнение различных задач и пайплайнов.\n\n---\n\n### Архитектурный обзор и обязанности каждого компонента\n\n- **Pipeline Stages** – это компоненты, которые участвуют в обработке данных и координации работы других частей системы. Они реализуют конкретные бизнес-логики и отвечают за передачу информации между этапами обработки.\n \n - **HttpRunner**: используется для обработки входящих HTTP запросов и организации потоков данных от клиентов.\n - **Workflow Persistence**: отвечает за долговременное хранение и восстановление состояний workflow.\n - **Http Control Channel**: служит основным каналом управления внешними коммуникациями.\n - **In Memory Task Queue**: хранит и выполняет задачи в оперативной памяти.\n - **Config File Loader**: загружает внешние конфигурационные данные и предоставляет к ним доступ.\n\nЭти компоненты работают совместно, обеспечивая согласованное функционирование всей системы.\n\n---\n\n### Взаимодействие и зависимость компонентов\n\nПри вызове функции `create_runtime` происходит инициализация всех необходимых компонентов и создание связей между ними. Это включает настройку каналов коммуникации, загрузку конфигурации и подготовку среды для выполнения рабочих процессов.\n\nНапример, объект класса `UvicornThreadRunner` будет создан и настроен таким образом, чтобы обрабатывать входящие запросы и выполнять логику на основе поступающих задач. Аналогично другие компоненты будут инициализированы и настроены согласно предоставленной конфигурации.\n\n---\n\n### Заключение\n\nФункция `create_runtime` предназначена для создания и настройки runtime окружения, необходимого для выполнения рабочих процессов и пайплайнов. Она использует различные компоненты, такие как каналы коммуникации, хранилища состояний и очереди задач, для обеспечения эффективного обмена данными и управления рабочими процессами.\n\nТаким образом, функция создает основу для последующего запуска приложений и выполнения рабочих нагрузок, опираясь на четкую организацию и координацию компонентов системы.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "create_runtime" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] -} - -## Mismatches -- none \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_091314/full_chain_plba_code_retrieval_plba-fullchain-explain-http-control-channel.json b/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_091314/full_chain_plba_code_retrieval_plba-fullchain-explain-http-control-channel.json deleted file mode 100644 index a7ca866..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_091314/full_chain_plba_code_retrieval_plba-fullchain-explain-http-control-channel.json +++ /dev/null @@ -1,2564 +0,0 @@ -{ - "case_id": "plba-fullchain-explain-http-control-channel", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_retrieval.yaml", - "runner": "runtime", - "mode": "full_chain", - "actual": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 19, - "llm_answer": "## Анализ класса `HttpControlChannel`\n\n### 1. Обзор файла и контекста\n\nКласс `HttpControlChannel` определен в файле `src/app_runtime/control/http_channel.py`. Этот файл содержит классы и функции, связанные с управлением каналами HTTP, которые используются для взаимодействия с внешним миром через HTTP-запросы и ответы.\n\n### 2. Определение класса и его роль\n\n```python\nclass HttpControlChannel(ControlChannel):\n role: pipeline_stage\n```\n\nЭтот класс наследует от базового класса `ControlChannel`, что указывает на то, что он предназначен для управления состоянием приложения или модели и участвует в общей логике обработки данных внутри системы.\n\n### 3. Ответственность и обязанности класса\n\nСогласно комментариям и документации:\n\n- **Responsibilities:** \n - \"reads and writes state attributes\"\n - \"participates in dataflow slices (10)\"\n\nЭто означает, что данный канал отвечает за чтение и запись атрибутов состояния и участвует в нескольких срезах потока данных (dataflow slices).\n\n### 4. Сравнение с другими классами\n\n- **ControlChannel** (`src/app_runtime/control/base.py`) — это базовый класс, который описывает модельные роли и действия, общие для всех каналов контроля.\n \n- **ControlActionSet** (`src/app_runtime/control/base.py`) — этот класс также относится к моделям и представляет собой набор действий, связанных с моделью.\n\n- **ControlPlaneService** (`src/app_runtime/control/service.py`) — сервисный класс, участвующий в управлении состоянием и потоком данных.\n\n- **UvicornThreadRunner** (`src/app_runtime/control/http_runner.py`) — еще один компонент, связанный с обработкой HTTP-запросов и ответов, выполняемый в отдельном потоке.\n\n### 5. Поток данных и взаимодействие\n\nПоскольку `HttpControlChannel` участвует в \"dataflow slices\", предполагается, что он играет важную роль в координации потоков данных между различными компонентами системы, такими как сервисы, контроллеры и модели. Он взаимодействует с внешними системами посредством HTTP-запросов и отвечает за обновление внутреннего состояния системы на основе полученных ответов.\n\n### Заключение\n\nТаким образом, `HttpControlChannel` является специализированным каналом для управления состоянием и взаимодействия с внешней средой через HTTP-протокол. Он выполняет операции чтения и записи атрибутов состояния и участвует в обработке различных потоков данных внутри системы.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "HttpControlChannel" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "passed": true, - "mismatches": [], - "details": { - "case_id": "plba-fullchain-explain-http-control-channel", - "text": "Объясни класс HttpControlChannel", - "mode": "full_chain", - "run_started_at": "2026-03-12T09:13:14", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Объясни класс HttpControlChannel", - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "HttpControlChannel", - "alternatives": [ - "HttpControlChannel" - ], - "confidence": 0.99 - }, - "rag_count": 19, - "rag_rows": [ - { - "path": "src/app_runtime/control/http_channel.py", - "content": "class HttpControlChannel\nHttpControlChannel(ControlChannel)", - "layer": "C1_SYMBOL_CATALOG", - "title": "HttpControlChannel", - "span_start": 12, - "span_end": 57, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "1c9fbdc24819e5604c26ea55428a74310f03a03e1af197ed84846af61e42fdb0", - "qname": "HttpControlChannel", - "kind": "class", - "signature": "HttpControlChannel(ControlChannel)", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.control.http_channel", - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (10)", - "layer": "C4_SEMANTIC_ROLES", - "title": "HttpControlChannel", - "span_start": 12, - "span_end": 57, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 21, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "1c9fbdc24819e5604c26ea55428a74310f03a03e1af197ed84846af61e42fdb0", - "symbol_name": "HttpControlChannel", - "qname": "HttpControlChannel", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 10, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "ControlChannel\nrole: model\n\nResponsibilities:\n- default model role", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlChannel", - "span_start": 21, - "span_end": 28, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 40, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "cfcfe9a311d3a2dbdaf32ac4ccd73c0eb9a117f830591a1c0867ee97d46204ff", - "symbol_name": "ControlChannel", - "qname": "ControlChannel", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "ControlActionSet\nrole: model\n\nResponsibilities:\n- default model role", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlActionSet", - "span_start": 14, - "span_end": 18, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 40, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "46eb026cb3313415ec47b82dd22f84f4d112c9d987e8b1716dcb0baa1cce8988", - "symbol_name": "ControlActionSet", - "qname": "ControlActionSet", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests service\n- reads and writes state attributes\n- participates in dataflow slices (5)", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlPlaneService", - "span_start": 12, - "span_end": 52, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 68, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "b13471e5916986dccffb53fab613812842965705e6b3a89ae549d30c9e91e9aa", - "symbol_name": "ControlPlaneService", - "qname": "ControlPlaneService", - "role": "pipeline_stage", - "confidence": 0.57, - "dataflow_participation": 5, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_runner.py", - "content": "UvicornThreadRunner\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (24)", - "layer": "C4_SEMANTIC_ROLES", - "title": "UvicornThreadRunner", - "span_start": 10, - "span_end": 61, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 11, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "fd55630045a02100df8877ac27d951ee08617d4598764394d48cb51fe067476a", - "symbol_name": "UvicornThreadRunner", - "qname": "UvicornThreadRunner", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 24, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "3779fdd2878b770e789a35bb2a89c9d79f13b61c26d7db1b3b683f9bb9e1623f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "HttpControlAppFactory\nrole: factory\n\nResponsibilities:\n- name suffix suggests factory", - "layer": "C4_SEMANTIC_ROLES", - "title": "HttpControlAppFactory", - "span_start": 15, - "span_end": 53, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 39, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "9b3502a5fb408b273223db13264349cf500de24915b6c649d9ea8970d0dfd8e0", - "symbol_name": "HttpControlAppFactory", - "qname": "HttpControlAppFactory", - "role": "factory", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/persistence/workflow_persistence.py", - "content": "WorkflowPersistence\nrole: pipeline_stage\n\nResponsibilities:\n- orchestrates role-like calls (2)\n- reads and writes state attributes\n- participates in dataflow slices (16)", - "layer": "C4_SEMANTIC_ROLES", - "title": "WorkflowPersistence", - "span_start": 8, - "span_end": 54, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 15, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "7bd01ee45cf31f2d5c2e3e51656254860ac785d10cef9e0852cd4fba90857bae", - "symbol_name": "WorkflowPersistence", - "qname": "WorkflowPersistence", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 16, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "80e9410ddc639789b4353c2a1a757ba8d0d5b5bb6075b0b263b61551f04ae1f0", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/queue/in_memory.py", - "content": "InMemoryTaskQueue\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (9)", - "layer": "C4_SEMANTIC_ROLES", - "title": "InMemoryTaskQueue", - "span_start": 9, - "span_end": 38, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 22, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "2da04cb94544a3bcbf0943a95ad4bdd8710bcafaa32a02fd0e4de2178dcf3533", - "symbol_name": "InMemoryTaskQueue", - "qname": "InMemoryTaskQueue", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 9, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "58f0cc001ccda0eee4c6bc32ed83bd05eafd6b6644f1e8b4aa9eed3103db73dc", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel.__init__\n -> HttpControlChannel._runner\n -> HttpControlChannel.start", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "HttpControlChannel.__init__:dataflow_slice", - "span_start": 15, - "span_end": 22, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "51d73913df709152258ed1b9a8c8f4eb3c575eccfe6b982aef0b28e0789a29da", - "edge_type": "dataflow_slice", - "src_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "src_qname": "HttpControlChannel.__init__", - "dst_symbol_id": "d1933f04137f52535b6525f1b93ff2cd83bfb216b480e887e791ed1714cda8e0", - "dst_ref": "HttpControlChannel.start", - "resolution": "resolved", - "slice_id": "51d73913df709152258ed1b9a8c8f4eb3c575eccfe6b982aef0b28e0789a29da", - "root_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "path_symbols": [ - "HttpControlChannel.__init__", - "HttpControlChannel._runner", - "HttpControlChannel.start" - ], - "path_symbol_ids": [ - "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "d1933f04137f52535b6525f1b93ff2cd83bfb216b480e887e791ed1714cda8e0" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel.__init__\n -> HttpControlChannel._runner\n -> HttpControlChannel.port", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "HttpControlChannel.__init__:dataflow_slice", - "span_start": 15, - "span_end": 29, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "c7167bab7218bb768ad7c11bfb40d1a3096e6071dd7817bba5fd864cf8f6de13", - "edge_type": "dataflow_slice", - "src_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "src_qname": "HttpControlChannel.__init__", - "dst_symbol_id": "3632ce8227f4a31e0768f2fb021a4d1ba28e1202633aa0f2fac902295931280f", - "dst_ref": "HttpControlChannel.port", - "resolution": "resolved", - "slice_id": "c7167bab7218bb768ad7c11bfb40d1a3096e6071dd7817bba5fd864cf8f6de13", - "root_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "path_symbols": [ - "HttpControlChannel.__init__", - "HttpControlChannel._runner", - "HttpControlChannel.port" - ], - "path_symbol_ids": [ - "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "3632ce8227f4a31e0768f2fb021a4d1ba28e1202633aa0f2fac902295931280f" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel.__init__\n -> HttpControlChannel._timeout\n -> HttpControlChannel._health_response", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "HttpControlChannel.__init__:dataflow_slice", - "span_start": 14, - "span_end": 34, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "f858f5c9e575f6c4cdfe3853571b7ee21d1f628a443541d2037c3dc9d0790bef", - "edge_type": "dataflow_slice", - "src_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "src_qname": "HttpControlChannel.__init__", - "dst_symbol_id": "e84bf04e9cd2127df235b7064d05f47e19f19a89c7c82f4c247231d4e8fa426a", - "dst_ref": "HttpControlChannel._health_response", - "resolution": "resolved", - "slice_id": "f858f5c9e575f6c4cdfe3853571b7ee21d1f628a443541d2037c3dc9d0790bef", - "root_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "path_symbols": [ - "HttpControlChannel.__init__", - "HttpControlChannel._timeout", - "HttpControlChannel._health_response" - ], - "path_symbol_ids": [ - "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "e84bf04e9cd2127df235b7064d05f47e19f19a89c7c82f4c247231d4e8fa426a" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel.__init__\n -> HttpControlChannel._timeout\n -> HttpControlChannel._action_response", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "HttpControlChannel.__init__:dataflow_slice", - "span_start": 14, - "span_end": 47, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "c3ef21fcae96c82c00be74b3ab827d4af2085d89cb3fa5521c19a174aad84dbb", - "edge_type": "dataflow_slice", - "src_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "src_qname": "HttpControlChannel.__init__", - "dst_symbol_id": "e64969024ccaeb34d8d91473fad07b3b3d341875846392e7a006406c7ada1954", - "dst_ref": "HttpControlChannel._action_response", - "resolution": "resolved", - "slice_id": "c3ef21fcae96c82c00be74b3ab827d4af2085d89cb3fa5521c19a174aad84dbb", - "root_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "path_symbols": [ - "HttpControlChannel.__init__", - "HttpControlChannel._timeout", - "HttpControlChannel._action_response" - ], - "path_symbol_ids": [ - "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "e64969024ccaeb34d8d91473fad07b3b3d341875846392e7a006406c7ada1954" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel.__init__\n -> HttpControlChannel._runner\n -> HttpControlChannel.stop", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "HttpControlChannel.__init__:dataflow_slice", - "span_start": 15, - "span_end": 25, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "0f827ef81a990258a8a74381c8564a8361afa6712dba3200592659c939adcb9d", - "edge_type": "dataflow_slice", - "src_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "src_qname": "HttpControlChannel.__init__", - "dst_symbol_id": "f29ab212620093d72be20e26c5a399624c7939a6056a728762ed3f84a250bfa3", - "dst_ref": "HttpControlChannel.stop", - "resolution": "resolved", - "slice_id": "0f827ef81a990258a8a74381c8564a8361afa6712dba3200592659c939adcb9d", - "root_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "path_symbols": [ - "HttpControlChannel.__init__", - "HttpControlChannel._runner", - "HttpControlChannel.stop" - ], - "path_symbol_ids": [ - "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "f29ab212620093d72be20e26c5a399624c7939a6056a728762ed3f84a250bfa3" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel.__init__\n -> HttpControlChannel._factory\n -> HttpControlChannel.start", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "HttpControlChannel.__init__:dataflow_slice", - "span_start": 16, - "span_end": 21, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e61ec25ded7dbe380d95ce2abcbc1d7a2d2afde5aa8453866df8706dfb7d6ddb", - "edge_type": "dataflow_slice", - "src_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "src_qname": "HttpControlChannel.__init__", - "dst_symbol_id": "d1933f04137f52535b6525f1b93ff2cd83bfb216b480e887e791ed1714cda8e0", - "dst_ref": "HttpControlChannel.start", - "resolution": "resolved", - "slice_id": "e61ec25ded7dbe380d95ce2abcbc1d7a2d2afde5aa8453866df8706dfb7d6ddb", - "root_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "path_symbols": [ - "HttpControlChannel.__init__", - "HttpControlChannel._factory", - "HttpControlChannel.start" - ], - "path_symbol_ids": [ - "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "d1933f04137f52535b6525f1b93ff2cd83bfb216b480e887e791ed1714cda8e0" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "class HttpControlChannel(ControlChannel):\n def __init__(self, host: str, port: int, timeout: int) -> None:\n self._timeout = timeout\n self._runner = UvicornThreadRunner(host, port, timeout)\n self._factory = HttpControlAppFactory()\n self._actions: ControlActionSet | None = None\n\n async def start(self, actions: ControlActionSet) -> None:\n self._actions = actions\n app = self._factory.create(self._health_response, self._action_response)\n await self._runner.start(app)\n\n async def stop(self) -> None:\n await self._runner.stop()\n\n @property\n def port(self) -> int:\n return self._runner.port\n\n async def _health_response(self) -> dict[str, object]:\n if self._actions is None:\n return {\"status\": \"unhealthy\", \"detail\": \"control actions are not configured\"}\n return await asyncio.wait_for(self._actions.health(), timeout=float(self._timeout))\n\n async def _action_response(self, action: str, _client_source: str = \"unknown\") -> JSONResponse:\n if self._actions is None:\n return JSONResponse(content={\"status\": \"error\", \"detail\": f\"{action} handler is not configured\"}, status_code=404)\n callbacks = {\n \"start\": self._actions.start,\n \"stop\": self._actions.stop,\n \"status\": self._actions.status,\n }\n callback = callbacks.get(action)\n if callback is None:\n return JSONResponse(content={\"status\": \"error\", \"detail\": f\"unsupported action: {action}\"}, status_code=404)\n action_timeout = max(float(self._timeout), 10.0) if action in {\"start\", \"stop\"} else float(self._timeout)\n try:\n detail = await asyncio.wait_for(callback(), timeout=action_timeout)\n except asyncio.TimeoutError:\n return JSONResponse(\n content={\"status\": \"accepted\", \"detail\": f\"{action} operation is still in progress\"},\n status_code=202,\n )\n except Exception as exc:\n return JSONResponse(content={\"status\": \"error\", \"detail\": str(exc)}, status_code=500)\n return JSONResponse(content={\"status\": \"ok\", \"detail\": detail or f\"{action} action accepted\"}, status_code=200)", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/http_channel.py:HttpControlChannel", - "span_start": 12, - "span_end": 57, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.http_channel", - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "llm_answer": "## Анализ класса `HttpControlChannel`\n\n### 1. Обзор файла и контекста\n\nКласс `HttpControlChannel` определен в файле `src/app_runtime/control/http_channel.py`. Этот файл содержит классы и функции, связанные с управлением каналами HTTP, которые используются для взаимодействия с внешним миром через HTTP-запросы и ответы.\n\n### 2. Определение класса и его роль\n\n```python\nclass HttpControlChannel(ControlChannel):\n role: pipeline_stage\n```\n\nЭтот класс наследует от базового класса `ControlChannel`, что указывает на то, что он предназначен для управления состоянием приложения или модели и участвует в общей логике обработки данных внутри системы.\n\n### 3. Ответственность и обязанности класса\n\nСогласно комментариям и документации:\n\n- **Responsibilities:** \n - \"reads and writes state attributes\"\n - \"participates in dataflow slices (10)\"\n\nЭто означает, что данный канал отвечает за чтение и запись атрибутов состояния и участвует в нескольких срезах потока данных (dataflow slices).\n\n### 4. Сравнение с другими классами\n\n- **ControlChannel** (`src/app_runtime/control/base.py`) — это базовый класс, который описывает модельные роли и действия, общие для всех каналов контроля.\n \n- **ControlActionSet** (`src/app_runtime/control/base.py`) — этот класс также относится к моделям и представляет собой набор действий, связанных с моделью.\n\n- **ControlPlaneService** (`src/app_runtime/control/service.py`) — сервисный класс, участвующий в управлении состоянием и потоком данных.\n\n- **UvicornThreadRunner** (`src/app_runtime/control/http_runner.py`) — еще один компонент, связанный с обработкой HTTP-запросов и ответов, выполняемый в отдельном потоке.\n\n### 5. Поток данных и взаимодействие\n\nПоскольку `HttpControlChannel` участвует в \"dataflow slices\", предполагается, что он играет важную роль в координации потоков данных между различными компонентами системы, такими как сервисы, контроллеры и модели. Он взаимодействует с внешними системами посредством HTTP-запросов и отвечает за обновление внутреннего состояния системы на основе полученных ответов.\n\n### Заключение\n\nТаким образом, `HttpControlChannel` является специализированным каналом для управления состоянием и взаимодействия с внешней средой через HTTP-протокол. Он выполняет операции чтения и записи атрибутов состояния и участвует в обработке различных потоков данных внутри системы.", - "summary": { - "router": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "confidence": null - }, - "retrieval": { - "profile": "code", - "layers_hit": [ - "C0_SOURCE_CHUNKS", - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS", - "C4_SEMANTIC_ROLES" - ], - "evidence_sufficient": true - }, - "llm": { - "answer_status": "answered", - "groundedness": "grounded" - } - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "HttpControlChannel" - ], - "keyword_hints": [ - "HttpControlChannel" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C0_SOURCE_CHUNKS": "exact_path_fetch", - "C4_SEMANTIC_ROLES": "exact_path_fetch", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C3_ENTRYPOINTS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 8, - "C4_SEMANTIC_ROLES": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C3_ENTRYPOINTS": 6 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C4_SEMANTIC_ROLES": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "HttpControlChannel", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Объясни класс HttpControlChannel", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C4_SEMANTIC_ROLES", - "query": "Объясни класс HttpControlChannel", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "Объясни класс HttpControlChannel", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - }, - { - "layer": "C3_ENTRYPOINTS", - "query": "Объясни класс HttpControlChannel", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 1, - "candidates_after_filter": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 6, - "candidates_after_filter": 6 - }, - { - "layer": "C3_ENTRYPOINTS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 3, - "candidates_after_filter": 3 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "HttpControlChannel", - "alternatives": [ - "HttpControlChannel" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C4_SEMANTIC_ROLES", - "status": "hit", - "hit_count": 8, - "fail_reason": null - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 6, - "fail_reason": null - }, - { - "layer": "C3_ENTRYPOINTS", - "status": "hit", - "hit_count": 3, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "router": 0, - "symbol_resolution": 0, - "retrieval_total": 171, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 52, - "C0_SOURCE_CHUNKS": 22, - "C4_SEMANTIC_ROLES": 16, - "C2_DEPENDENCY_GRAPH": 65, - "C3_ENTRYPOINTS": 13 - }, - "merge_rank": 27, - "prompt_build": 0, - "llm_call": 5111 - }, - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 329, - "evidence_rows": 19, - "evidence_chars": 3845 - }, - "evidence_summary": [ - { - "layer": "C1_SYMBOL_CATALOG", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "count": 8, - "unique_paths": 7 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "count": 6, - "unique_paths": 1 - }, - { - "layer": "C3_ENTRYPOINTS", - "count": 3, - "unique_paths": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 1, - "unique_paths": 1 - } - ], - "prompt_template_id": "intent_code_qa_v1", - "system_prompt_version": "v1" - }, - "router": { - "conversation_mode": "START", - "keyword_hints": [ - "HttpControlChannel" - ], - "path_scope": [] - }, - "llm": { - "used_evidence_count": 19, - "missing_evidence_reason": null - } - }, - "run_info": { - "case_id": "plba-fullchain-explain-http-control-channel", - "mode": "full_chain", - "run_started_at": "2026-03-12T09:13:14", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - }, - "input_request": { - "text": "Объясни класс HttpControlChannel", - "normalized_query": "Объясни класс HttpControlChannel" - }, - "steps": [ - { - "step": "intent_router", - "input": { - "query": "Объясни класс HttpControlChannel" - }, - "output": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Объясни класс HttpControlChannel" - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "HttpControlChannel" - ], - "keyword_hints": [ - "HttpControlChannel" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "timings_ms": { - "router": 0 - } - } - }, - { - "step": "retrieval", - "input": { - "query": "Объясни класс HttpControlChannel" - }, - "output": { - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "HttpControlChannel", - "alternatives": [ - "HttpControlChannel" - ], - "confidence": 0.99 - }, - "rag_count": 19, - "rag_rows": [ - { - "path": "src/app_runtime/control/http_channel.py", - "content": "class HttpControlChannel\nHttpControlChannel(ControlChannel)", - "layer": "C1_SYMBOL_CATALOG", - "title": "HttpControlChannel", - "span_start": 12, - "span_end": 57, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "1c9fbdc24819e5604c26ea55428a74310f03a03e1af197ed84846af61e42fdb0", - "qname": "HttpControlChannel", - "kind": "class", - "signature": "HttpControlChannel(ControlChannel)", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.control.http_channel", - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (10)", - "layer": "C4_SEMANTIC_ROLES", - "title": "HttpControlChannel", - "span_start": 12, - "span_end": 57, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 21, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "1c9fbdc24819e5604c26ea55428a74310f03a03e1af197ed84846af61e42fdb0", - "symbol_name": "HttpControlChannel", - "qname": "HttpControlChannel", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 10, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "ControlChannel\nrole: model\n\nResponsibilities:\n- default model role", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlChannel", - "span_start": 21, - "span_end": 28, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 40, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "cfcfe9a311d3a2dbdaf32ac4ccd73c0eb9a117f830591a1c0867ee97d46204ff", - "symbol_name": "ControlChannel", - "qname": "ControlChannel", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "ControlActionSet\nrole: model\n\nResponsibilities:\n- default model role", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlActionSet", - "span_start": 14, - "span_end": 18, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 40, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "46eb026cb3313415ec47b82dd22f84f4d112c9d987e8b1716dcb0baa1cce8988", - "symbol_name": "ControlActionSet", - "qname": "ControlActionSet", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests service\n- reads and writes state attributes\n- participates in dataflow slices (5)", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlPlaneService", - "span_start": 12, - "span_end": 52, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 68, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "b13471e5916986dccffb53fab613812842965705e6b3a89ae549d30c9e91e9aa", - "symbol_name": "ControlPlaneService", - "qname": "ControlPlaneService", - "role": "pipeline_stage", - "confidence": 0.57, - "dataflow_participation": 5, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_runner.py", - "content": "UvicornThreadRunner\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (24)", - "layer": "C4_SEMANTIC_ROLES", - "title": "UvicornThreadRunner", - "span_start": 10, - "span_end": 61, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 11, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "fd55630045a02100df8877ac27d951ee08617d4598764394d48cb51fe067476a", - "symbol_name": "UvicornThreadRunner", - "qname": "UvicornThreadRunner", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 24, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "3779fdd2878b770e789a35bb2a89c9d79f13b61c26d7db1b3b683f9bb9e1623f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "HttpControlAppFactory\nrole: factory\n\nResponsibilities:\n- name suffix suggests factory", - "layer": "C4_SEMANTIC_ROLES", - "title": "HttpControlAppFactory", - "span_start": 15, - "span_end": 53, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 39, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "9b3502a5fb408b273223db13264349cf500de24915b6c649d9ea8970d0dfd8e0", - "symbol_name": "HttpControlAppFactory", - "qname": "HttpControlAppFactory", - "role": "factory", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/persistence/workflow_persistence.py", - "content": "WorkflowPersistence\nrole: pipeline_stage\n\nResponsibilities:\n- orchestrates role-like calls (2)\n- reads and writes state attributes\n- participates in dataflow slices (16)", - "layer": "C4_SEMANTIC_ROLES", - "title": "WorkflowPersistence", - "span_start": 8, - "span_end": 54, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 15, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "7bd01ee45cf31f2d5c2e3e51656254860ac785d10cef9e0852cd4fba90857bae", - "symbol_name": "WorkflowPersistence", - "qname": "WorkflowPersistence", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 16, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "80e9410ddc639789b4353c2a1a757ba8d0d5b5bb6075b0b263b61551f04ae1f0", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/queue/in_memory.py", - "content": "InMemoryTaskQueue\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (9)", - "layer": "C4_SEMANTIC_ROLES", - "title": "InMemoryTaskQueue", - "span_start": 9, - "span_end": 38, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 22, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "2da04cb94544a3bcbf0943a95ad4bdd8710bcafaa32a02fd0e4de2178dcf3533", - "symbol_name": "InMemoryTaskQueue", - "qname": "InMemoryTaskQueue", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 9, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "58f0cc001ccda0eee4c6bc32ed83bd05eafd6b6644f1e8b4aa9eed3103db73dc", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel.__init__\n -> HttpControlChannel._runner\n -> HttpControlChannel.start", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "HttpControlChannel.__init__:dataflow_slice", - "span_start": 15, - "span_end": 22, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "51d73913df709152258ed1b9a8c8f4eb3c575eccfe6b982aef0b28e0789a29da", - "edge_type": "dataflow_slice", - "src_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "src_qname": "HttpControlChannel.__init__", - "dst_symbol_id": "d1933f04137f52535b6525f1b93ff2cd83bfb216b480e887e791ed1714cda8e0", - "dst_ref": "HttpControlChannel.start", - "resolution": "resolved", - "slice_id": "51d73913df709152258ed1b9a8c8f4eb3c575eccfe6b982aef0b28e0789a29da", - "root_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "path_symbols": [ - "HttpControlChannel.__init__", - "HttpControlChannel._runner", - "HttpControlChannel.start" - ], - "path_symbol_ids": [ - "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "d1933f04137f52535b6525f1b93ff2cd83bfb216b480e887e791ed1714cda8e0" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel.__init__\n -> HttpControlChannel._runner\n -> HttpControlChannel.port", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "HttpControlChannel.__init__:dataflow_slice", - "span_start": 15, - "span_end": 29, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "c7167bab7218bb768ad7c11bfb40d1a3096e6071dd7817bba5fd864cf8f6de13", - "edge_type": "dataflow_slice", - "src_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "src_qname": "HttpControlChannel.__init__", - "dst_symbol_id": "3632ce8227f4a31e0768f2fb021a4d1ba28e1202633aa0f2fac902295931280f", - "dst_ref": "HttpControlChannel.port", - "resolution": "resolved", - "slice_id": "c7167bab7218bb768ad7c11bfb40d1a3096e6071dd7817bba5fd864cf8f6de13", - "root_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "path_symbols": [ - "HttpControlChannel.__init__", - "HttpControlChannel._runner", - "HttpControlChannel.port" - ], - "path_symbol_ids": [ - "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "3632ce8227f4a31e0768f2fb021a4d1ba28e1202633aa0f2fac902295931280f" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel.__init__\n -> HttpControlChannel._timeout\n -> HttpControlChannel._health_response", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "HttpControlChannel.__init__:dataflow_slice", - "span_start": 14, - "span_end": 34, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "f858f5c9e575f6c4cdfe3853571b7ee21d1f628a443541d2037c3dc9d0790bef", - "edge_type": "dataflow_slice", - "src_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "src_qname": "HttpControlChannel.__init__", - "dst_symbol_id": "e84bf04e9cd2127df235b7064d05f47e19f19a89c7c82f4c247231d4e8fa426a", - "dst_ref": "HttpControlChannel._health_response", - "resolution": "resolved", - "slice_id": "f858f5c9e575f6c4cdfe3853571b7ee21d1f628a443541d2037c3dc9d0790bef", - "root_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "path_symbols": [ - "HttpControlChannel.__init__", - "HttpControlChannel._timeout", - "HttpControlChannel._health_response" - ], - "path_symbol_ids": [ - "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "e84bf04e9cd2127df235b7064d05f47e19f19a89c7c82f4c247231d4e8fa426a" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel.__init__\n -> HttpControlChannel._timeout\n -> HttpControlChannel._action_response", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "HttpControlChannel.__init__:dataflow_slice", - "span_start": 14, - "span_end": 47, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "c3ef21fcae96c82c00be74b3ab827d4af2085d89cb3fa5521c19a174aad84dbb", - "edge_type": "dataflow_slice", - "src_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "src_qname": "HttpControlChannel.__init__", - "dst_symbol_id": "e64969024ccaeb34d8d91473fad07b3b3d341875846392e7a006406c7ada1954", - "dst_ref": "HttpControlChannel._action_response", - "resolution": "resolved", - "slice_id": "c3ef21fcae96c82c00be74b3ab827d4af2085d89cb3fa5521c19a174aad84dbb", - "root_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "path_symbols": [ - "HttpControlChannel.__init__", - "HttpControlChannel._timeout", - "HttpControlChannel._action_response" - ], - "path_symbol_ids": [ - "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "e64969024ccaeb34d8d91473fad07b3b3d341875846392e7a006406c7ada1954" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel.__init__\n -> HttpControlChannel._runner\n -> HttpControlChannel.stop", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "HttpControlChannel.__init__:dataflow_slice", - "span_start": 15, - "span_end": 25, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "0f827ef81a990258a8a74381c8564a8361afa6712dba3200592659c939adcb9d", - "edge_type": "dataflow_slice", - "src_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "src_qname": "HttpControlChannel.__init__", - "dst_symbol_id": "f29ab212620093d72be20e26c5a399624c7939a6056a728762ed3f84a250bfa3", - "dst_ref": "HttpControlChannel.stop", - "resolution": "resolved", - "slice_id": "0f827ef81a990258a8a74381c8564a8361afa6712dba3200592659c939adcb9d", - "root_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "path_symbols": [ - "HttpControlChannel.__init__", - "HttpControlChannel._runner", - "HttpControlChannel.stop" - ], - "path_symbol_ids": [ - "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "f29ab212620093d72be20e26c5a399624c7939a6056a728762ed3f84a250bfa3" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel.__init__\n -> HttpControlChannel._factory\n -> HttpControlChannel.start", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "HttpControlChannel.__init__:dataflow_slice", - "span_start": 16, - "span_end": 21, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e61ec25ded7dbe380d95ce2abcbc1d7a2d2afde5aa8453866df8706dfb7d6ddb", - "edge_type": "dataflow_slice", - "src_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "src_qname": "HttpControlChannel.__init__", - "dst_symbol_id": "d1933f04137f52535b6525f1b93ff2cd83bfb216b480e887e791ed1714cda8e0", - "dst_ref": "HttpControlChannel.start", - "resolution": "resolved", - "slice_id": "e61ec25ded7dbe380d95ce2abcbc1d7a2d2afde5aa8453866df8706dfb7d6ddb", - "root_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "path_symbols": [ - "HttpControlChannel.__init__", - "HttpControlChannel._factory", - "HttpControlChannel.start" - ], - "path_symbol_ids": [ - "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "d1933f04137f52535b6525f1b93ff2cd83bfb216b480e887e791ed1714cda8e0" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "class HttpControlChannel(ControlChannel):\n def __init__(self, host: str, port: int, timeout: int) -> None:\n self._timeout = timeout\n self._runner = UvicornThreadRunner(host, port, timeout)\n self._factory = HttpControlAppFactory()\n self._actions: ControlActionSet | None = None\n\n async def start(self, actions: ControlActionSet) -> None:\n self._actions = actions\n app = self._factory.create(self._health_response, self._action_response)\n await self._runner.start(app)\n\n async def stop(self) -> None:\n await self._runner.stop()\n\n @property\n def port(self) -> int:\n return self._runner.port\n\n async def _health_response(self) -> dict[str, object]:\n if self._actions is None:\n return {\"status\": \"unhealthy\", \"detail\": \"control actions are not configured\"}\n return await asyncio.wait_for(self._actions.health(), timeout=float(self._timeout))\n\n async def _action_response(self, action: str, _client_source: str = \"unknown\") -> JSONResponse:\n if self._actions is None:\n return JSONResponse(content={\"status\": \"error\", \"detail\": f\"{action} handler is not configured\"}, status_code=404)\n callbacks = {\n \"start\": self._actions.start,\n \"stop\": self._actions.stop,\n \"status\": self._actions.status,\n }\n callback = callbacks.get(action)\n if callback is None:\n return JSONResponse(content={\"status\": \"error\", \"detail\": f\"unsupported action: {action}\"}, status_code=404)\n action_timeout = max(float(self._timeout), 10.0) if action in {\"start\", \"stop\"} else float(self._timeout)\n try:\n detail = await asyncio.wait_for(callback(), timeout=action_timeout)\n except asyncio.TimeoutError:\n return JSONResponse(\n content={\"status\": \"accepted\", \"detail\": f\"{action} operation is still in progress\"},\n status_code=202,\n )\n except Exception as exc:\n return JSONResponse(content={\"status\": \"error\", \"detail\": str(exc)}, status_code=500)\n return JSONResponse(content={\"status\": \"ok\", \"detail\": detail or f\"{action} action accepted\"}, status_code=200)", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/http_channel.py:HttpControlChannel", - "span_start": 12, - "span_end": 57, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.http_channel", - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ] - }, - "diagnostics": { - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C0_SOURCE_CHUNKS": "exact_path_fetch", - "C4_SEMANTIC_ROLES": "exact_path_fetch", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C3_ENTRYPOINTS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 8, - "C4_SEMANTIC_ROLES": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C3_ENTRYPOINTS": 6 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C4_SEMANTIC_ROLES": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "HttpControlChannel", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Объясни класс HttpControlChannel", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C4_SEMANTIC_ROLES", - "query": "Объясни класс HttpControlChannel", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "Объясни класс HttpControlChannel", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - }, - { - "layer": "C3_ENTRYPOINTS", - "query": "Объясни класс HttpControlChannel", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 1, - "candidates_after_filter": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 6, - "candidates_after_filter": 6 - }, - { - "layer": "C3_ENTRYPOINTS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 3, - "candidates_after_filter": 3 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "HttpControlChannel", - "alternatives": [ - "HttpControlChannel" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C4_SEMANTIC_ROLES", - "status": "hit", - "hit_count": 8, - "fail_reason": null - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 6, - "fail_reason": null - }, - { - "layer": "C3_ENTRYPOINTS", - "status": "hit", - "hit_count": 3, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "symbol_resolution": 0, - "retrieval_total": 171, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 52, - "C0_SOURCE_CHUNKS": 22, - "C4_SEMANTIC_ROLES": 16, - "C2_DEPENDENCY_GRAPH": 65, - "C3_ENTRYPOINTS": 13 - }, - "merge_rank": 27 - } - } - }, - { - "step": "llm_answer", - "input": { - "query": "Объясни класс HttpControlChannel", - "rag_count": 19 - }, - "output": { - "llm_answer": "## Анализ класса `HttpControlChannel`\n\n### 1. Обзор файла и контекста\n\nКласс `HttpControlChannel` определен в файле `src/app_runtime/control/http_channel.py`. Этот файл содержит классы и функции, связанные с управлением каналами HTTP, которые используются для взаимодействия с внешним миром через HTTP-запросы и ответы.\n\n### 2. Определение класса и его роль\n\n```python\nclass HttpControlChannel(ControlChannel):\n role: pipeline_stage\n```\n\nЭтот класс наследует от базового класса `ControlChannel`, что указывает на то, что он предназначен для управления состоянием приложения или модели и участвует в общей логике обработки данных внутри системы.\n\n### 3. Ответственность и обязанности класса\n\nСогласно комментариям и документации:\n\n- **Responsibilities:** \n - \"reads and writes state attributes\"\n - \"participates in dataflow slices (10)\"\n\nЭто означает, что данный канал отвечает за чтение и запись атрибутов состояния и участвует в нескольких срезах потока данных (dataflow slices).\n\n### 4. Сравнение с другими классами\n\n- **ControlChannel** (`src/app_runtime/control/base.py`) — это базовый класс, который описывает модельные роли и действия, общие для всех каналов контроля.\n \n- **ControlActionSet** (`src/app_runtime/control/base.py`) — этот класс также относится к моделям и представляет собой набор действий, связанных с моделью.\n\n- **ControlPlaneService** (`src/app_runtime/control/service.py`) — сервисный класс, участвующий в управлении состоянием и потоком данных.\n\n- **UvicornThreadRunner** (`src/app_runtime/control/http_runner.py`) — еще один компонент, связанный с обработкой HTTP-запросов и ответов, выполняемый в отдельном потоке.\n\n### 5. Поток данных и взаимодействие\n\nПоскольку `HttpControlChannel` участвует в \"dataflow slices\", предполагается, что он играет важную роль в координации потоков данных между различными компонентами системы, такими как сервисы, контроллеры и модели. Он взаимодействует с внешними системами посредством HTTP-запросов и отвечает за обновление внутреннего состояния системы на основе полученных ответов.\n\n### Заключение\n\nТаким образом, `HttpControlChannel` является специализированным каналом для управления состоянием и взаимодействия с внешней средой через HTTP-протокол. Он выполняет операции чтения и записи атрибутов состояния и участвует в обработке различных потоков данных внутри системы." - }, - "diagnostics": { - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 329, - "evidence_rows": 19, - "evidence_chars": 3845 - }, - "evidence_summary": [ - { - "layer": "C1_SYMBOL_CATALOG", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "count": 8, - "unique_paths": 7 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "count": 6, - "unique_paths": 1 - }, - { - "layer": "C3_ENTRYPOINTS", - "count": 3, - "unique_paths": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 1, - "unique_paths": 1 - } - ], - "prompt_template_id": "intent_code_qa_v1", - "system_prompt_version": "v1" - }, - "timings_ms": { - "prompt_build": 0, - "llm_call": 5111 - } - } - } - ] - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_091314/full_chain_plba_code_retrieval_plba-fullchain-explain-http-control-channel.md b/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_091314/full_chain_plba_code_retrieval_plba-fullchain-explain-http-control-channel.md deleted file mode 100644 index e470b84..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_091314/full_chain_plba_code_retrieval_plba-fullchain-explain-http-control-channel.md +++ /dev/null @@ -1,34 +0,0 @@ -# plba-fullchain-explain-http-control-channel - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_retrieval.yaml -- runner: runtime -- mode: full_chain -- passed: True - -## Query -Объясни класс HttpControlChannel - -## Actual -{ - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 19, - "llm_answer": "## Анализ класса `HttpControlChannel`\n\n### 1. Обзор файла и контекста\n\nКласс `HttpControlChannel` определен в файле `src/app_runtime/control/http_channel.py`. Этот файл содержит классы и функции, связанные с управлением каналами HTTP, которые используются для взаимодействия с внешним миром через HTTP-запросы и ответы.\n\n### 2. Определение класса и его роль\n\n```python\nclass HttpControlChannel(ControlChannel):\n role: pipeline_stage\n```\n\nЭтот класс наследует от базового класса `ControlChannel`, что указывает на то, что он предназначен для управления состоянием приложения или модели и участвует в общей логике обработки данных внутри системы.\n\n### 3. Ответственность и обязанности класса\n\nСогласно комментариям и документации:\n\n- **Responsibilities:** \n - \"reads and writes state attributes\"\n - \"participates in dataflow slices (10)\"\n\nЭто означает, что данный канал отвечает за чтение и запись атрибутов состояния и участвует в нескольких срезах потока данных (dataflow slices).\n\n### 4. Сравнение с другими классами\n\n- **ControlChannel** (`src/app_runtime/control/base.py`) — это базовый класс, который описывает модельные роли и действия, общие для всех каналов контроля.\n \n- **ControlActionSet** (`src/app_runtime/control/base.py`) — этот класс также относится к моделям и представляет собой набор действий, связанных с моделью.\n\n- **ControlPlaneService** (`src/app_runtime/control/service.py`) — сервисный класс, участвующий в управлении состоянием и потоком данных.\n\n- **UvicornThreadRunner** (`src/app_runtime/control/http_runner.py`) — еще один компонент, связанный с обработкой HTTP-запросов и ответов, выполняемый в отдельном потоке.\n\n### 5. Поток данных и взаимодействие\n\nПоскольку `HttpControlChannel` участвует в \"dataflow slices\", предполагается, что он играет важную роль в координации потоков данных между различными компонентами системы, такими как сервисы, контроллеры и модели. Он взаимодействует с внешними системами посредством HTTP-запросов и отвечает за обновление внутреннего состояния системы на основе полученных ответов.\n\n### Заключение\n\nТаким образом, `HttpControlChannel` является специализированным каналом для управления состоянием и взаимодействия с внешней средой через HTTP-протокол. Он выполняет операции чтения и записи атрибутов состояния и участвует в обработке различных потоков данных внутри системы.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "HttpControlChannel" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] -} - -## Mismatches -- none \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_091314/full_chain_plba_code_retrieval_plba-fullchain-explain-runtime-manager.json b/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_091314/full_chain_plba_code_retrieval_plba-fullchain-explain-runtime-manager.json deleted file mode 100644 index 9daf1c9..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_091314/full_chain_plba_code_retrieval_plba-fullchain-explain-runtime-manager.json +++ /dev/null @@ -1,2564 +0,0 @@ -{ - "case_id": "plba-fullchain-explain-runtime-manager", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_retrieval.yaml", - "runner": "runtime", - "mode": "full_chain", - "actual": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 19, - "llm_answer": "## Анализ класса `RuntimeManager`\n\n### 1. Положение и назначение класса\n\nКласс `RuntimeManager` определен в файле `src/app_runtime/core/runtime.py`. Его роль — **управляющий компонент**, который координирует выполнение различных ролей и подзадач внутри системы обработки данных.\n\n### 2. Ответственность (`Responsibilities`)\n\nСогласно документации, этот класс выполняет следующие обязанности:\n\n- Название класса указывает на его управляющую природу.\n- Координирует вызов ролей (ролей-подзадач) — всего их четыре.\n- Читает и записывает состояния атрибутов.\n- Участвует в разделах потока данных (dataflow slices).\n\nЭти обязанности подчеркивают важность этого компонента для управления последовательностью выполнения задач в системе.\n\n---\n\n### 3. Поток данных и архитектура\n\n#### a. Участие в данных потока (`dataflow slices`)\n\nДокументация указывает, что данный класс участвует в нескольких разрезах данных (slices). Это означает, что он играет ключевую роль в координации передачи информации между различными частями системы.\n\n#### b. Чтение и запись состояний атрибутов\n\nЭтот класс также активно взаимодействует с состоянием системы, читая и изменяя определенные атрибуты, что важно для поддержания согласованности данных и корректного функционирования системы.\n\n---\n\n### 4. Примеры использования и роли компонентов\n\n#### a. Контрольные каналы (`ControlChannel`, `ControlActionSet`)\n\n- `ControlChannel`: Стандартная модельный канал управления.\n- `ControlActionSet`: Набор действий модели.\n\nЭти компоненты обеспечивают механизм взаимодействия между различными ролями и стадиями процесса исполнения.\n\n#### b. Сервисы контроля (`ControlPlaneService`, `UvicornThreadRunner`)\n\n- `ControlPlaneService`: Обслуживает операции чтения и записи состояний атрибутов и принимает участие в пяти разрезах данных.\n- `UvicornThreadRunner`: Этот сервис используется для запуска HTTP-серверов через uvicorn в отдельном потоке и участвует в двадцати четырех разрезах данных.\n\nЭти сервисы являются частью общей инфраструктуры управления исполнением задач и участвуют в процессе обработки запросов пользователей.\n\n---\n\n### 5. Итоговое описание работы класса `RuntimeManager`\n\nКласс `RuntimeManager` является ключевым компонентом управляющей архитектуры приложения. Он отвечает за координацию вызова различных ролей или подзадач в системе, обеспечивая синхронизацию и последовательность операций. При этом он активно взаимодействует со своими окружающими компонентами (например, каналами управления, серверами, сервисами и др.), участвуя в обработке данных потоков и поддерживая целостность состояния системы.\n\nТаким образом, основная задача данного класса заключается в управлении логикой и последовательностью выполнения всех этапов обработки данных и взаимодействий с другими компонентами системы.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "RuntimeManager" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "passed": true, - "mismatches": [], - "details": { - "case_id": "plba-fullchain-explain-runtime-manager", - "text": "Объясни как работает класс RuntimeManager", - "mode": "full_chain", - "run_started_at": "2026-03-12T09:13:14", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Объясни как работает класс RuntimeManager", - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "RuntimeManager", - "alternatives": [ - "RuntimeManager" - ], - "confidence": 0.99 - }, - "rag_count": 19, - "rag_rows": [ - { - "path": "src/app_runtime/core/runtime.py", - "content": "class RuntimeManager\nRuntimeManager", - "layer": "C1_SYMBOL_CATALOG", - "title": "RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "7e4a9381328c5803bbc6179458612fc4e947d928aa7bf8b4b2bebb2c8592f758", - "qname": "RuntimeManager", - "kind": "class", - "signature": "RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.core.runtime", - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests manager\n- orchestrates role-like calls (4)\n- reads and writes state attributes\n- participates in dataflow slices (50)", - "layer": "C4_SEMANTIC_ROLES", - "title": "RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 43, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "7e4a9381328c5803bbc6179458612fc4e947d928aa7bf8b4b2bebb2c8592f758", - "symbol_name": "RuntimeManager", - "qname": "RuntimeManager", - "role": "pipeline_stage", - "confidence": 0.67, - "dataflow_participation": 50, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "ControlChannel\nrole: model\n\nResponsibilities:\n- default model role", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlChannel", - "span_start": 21, - "span_end": 28, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 40, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "cfcfe9a311d3a2dbdaf32ac4ccd73c0eb9a117f830591a1c0867ee97d46204ff", - "symbol_name": "ControlChannel", - "qname": "ControlChannel", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "ControlActionSet\nrole: model\n\nResponsibilities:\n- default model role", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlActionSet", - "span_start": 14, - "span_end": 18, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 40, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "46eb026cb3313415ec47b82dd22f84f4d112c9d987e8b1716dcb0baa1cce8988", - "symbol_name": "ControlActionSet", - "qname": "ControlActionSet", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests service\n- reads and writes state attributes\n- participates in dataflow slices (5)", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlPlaneService", - "span_start": 12, - "span_end": 52, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 68, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "b13471e5916986dccffb53fab613812842965705e6b3a89ae549d30c9e91e9aa", - "symbol_name": "ControlPlaneService", - "qname": "ControlPlaneService", - "role": "pipeline_stage", - "confidence": 0.57, - "dataflow_participation": 5, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_runner.py", - "content": "UvicornThreadRunner\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (24)", - "layer": "C4_SEMANTIC_ROLES", - "title": "UvicornThreadRunner", - "span_start": 10, - "span_end": 61, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 11, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "fd55630045a02100df8877ac27d951ee08617d4598764394d48cb51fe067476a", - "symbol_name": "UvicornThreadRunner", - "qname": "UvicornThreadRunner", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 24, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "3779fdd2878b770e789a35bb2a89c9d79f13b61c26d7db1b3b683f9bb9e1623f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (10)", - "layer": "C4_SEMANTIC_ROLES", - "title": "HttpControlChannel", - "span_start": 12, - "span_end": 57, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 21, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "1c9fbdc24819e5604c26ea55428a74310f03a03e1af197ed84846af61e42fdb0", - "symbol_name": "HttpControlChannel", - "qname": "HttpControlChannel", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 10, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "HttpControlAppFactory\nrole: factory\n\nResponsibilities:\n- name suffix suggests factory", - "layer": "C4_SEMANTIC_ROLES", - "title": "HttpControlAppFactory", - "span_start": 15, - "span_end": 53, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 39, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "9b3502a5fb408b273223db13264349cf500de24915b6c649d9ea8970d0dfd8e0", - "symbol_name": "HttpControlAppFactory", - "qname": "HttpControlAppFactory", - "role": "factory", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/persistence/workflow_persistence.py", - "content": "WorkflowPersistence\nrole: pipeline_stage\n\nResponsibilities:\n- orchestrates role-like calls (2)\n- reads and writes state attributes\n- participates in dataflow slices (16)", - "layer": "C4_SEMANTIC_ROLES", - "title": "WorkflowPersistence", - "span_start": 8, - "span_end": 54, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 15, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "7bd01ee45cf31f2d5c2e3e51656254860ac785d10cef9e0852cd4fba90857bae", - "symbol_name": "WorkflowPersistence", - "qname": "WorkflowPersistence", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 16, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "80e9410ddc639789b4353c2a1a757ba8d0d5b5bb6075b0b263b61551f04ae1f0", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.stop", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 25, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d", - "dst_ref": "ControlPlaneService.stop", - "resolution": "resolved", - "slice_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.stop" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._stop_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 51, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a", - "dst_ref": "ControlPlaneService._stop_async", - "resolution": "resolved", - "slice_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._stop_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.register_channel", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 17, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957", - "dst_ref": "ControlPlaneService.register_channel", - "resolution": "resolved", - "slice_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.register_channel" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.start", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 20, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154", - "dst_ref": "ControlPlaneService.start", - "resolution": "resolved", - "slice_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.start" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._start_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 47, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517", - "dst_ref": "ControlPlaneService._start_async", - "resolution": "resolved", - "slice_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._start_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager.add_config_file", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 32, - "span_end": 52, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "a23b8a11ebdb12708b60c96ea12a69f7f042082f1adfddd572444e246d81d167", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "57ffbd4f0d9fdf3507c2b8624312ce211f3d02fdf86a57a8ec90778d8a7b498d", - "dst_ref": "RuntimeManager.add_config_file", - "resolution": "resolved", - "slice_id": "a23b8a11ebdb12708b60c96ea12a69f7f042082f1adfddd572444e246d81d167", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager.add_config_file" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "57ffbd4f0d9fdf3507c2b8624312ce211f3d02fdf86a57a8ec90778d8a7b498d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "class RuntimeManager:\n ACTION_TIMEOUT_SECONDS = 10.0\n ACTION_POLL_INTERVAL_SECONDS = 0.05\n\n def __init__(\n self,\n configuration: ConfigurationManager | None = None,\n services: ServiceContainer | None = None,\n traces: TraceService | None = None,\n health: HealthRegistry | None = None,\n logs: LogManager | None = None,\n workers: WorkerSupervisor | None = None,\n control_plane: ControlPlaneService | None = None,\n ) -> None:\n self.configuration = configuration or ConfigurationManager()\n self.services = services or ServiceContainer()\n self.traces = traces or TraceService()\n self.health = health or HealthRegistry()\n self.logs = logs or LogManager()\n self.workers = workers or WorkerSupervisor()\n self.control_plane = control_plane or ControlPlaneService()\n self.registry = ModuleRegistry(self.services)\n self._started = False\n self._state = LifecycleState.IDLE\n self._core_registered = False\n self._workers_registered = False\n self._register_core_services()\n\n def register_module(self, module: ApplicationModule) -> None:\n self.registry.register_module(module.name)\n module.register(self.registry)\n\n def add_config_file(self, path: str) -> FileConfigProvider:\n provider = FileConfigProvider(path)\n self.configuration.add_provider(provider)\n return provider\n\n def start(self, *, start_control_plane: bool = True) -> None:\n if self._started:\n return\n self._state = LifecycleState.STARTING\n config = self.configuration.load()\n self.logs.apply_config(config)\n self._register_health_contributors()\n self._register_workers()\n self.workers.start()\n if start_control_plane:\n self.control_plane.start(self)\n self._started = True\n self._refresh_state()\n\n def stop(self, timeout: float = 30.0, force: bool = False, stop_control_plane: bool = True) -> None:\n if not self._started:\n return\n self._state = LifecycleState.STOPPING\n self.workers.stop(timeout=timeout, force=force)\n if stop_control_plane:\n self.control_plane.stop()\n self._started = False\n self._state = LifecycleState.STOPPED\n\n def status(self) -> dict[str, object]:\n self._refresh_state()\n return self.control_plane.snapshot(self)\n\n def current_health(self) -> HealthPayload:\n self._refresh_state()\n return self.health.payload(self._state, self.workers.healths())\n\n async def health_status(self) -> HealthPayload:\n return self.current_health()\n\n async def start_runtime(self) -> dict[str, object] | str:\n self._refresh_state()\n if self._started:\n return \"runtime already running\"\n if self._state == LifecycleState.STOPPING:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n\n self.start(start_control_plane=False)\n started = self._wait_for_state({LifecycleState.IDLE, LifecycleState.BUSY}, timeout=self.ACTION_TIMEOUT_SECONDS)\n if started:\n return self._action_detail(\"runtime started\", timed_out=False)\n return self._action_detail(\"runtime start is still in progress\", timed_out=True)\n\n async def stop_runtime(self) -> dict[str, object] | str:\n self._refresh_state()\n if not self._started:\n if self._state == LifecycleState.STOPPING:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n return \"runtime already stopped\"\n\n self._state = LifecycleState.STOPPING\n try:\n self.workers.stop(timeout=self.ACTION_TIMEOUT_SECONDS, force=False)\n except TimeoutError:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n\n self._started = False\n self._state = LifecycleState.STOPPED\n return self._action_detail(\"runtime stopped\", timed_out=False)\n\n async def runtime_status(self) -> str:\n self._refresh_state()\n return self._state.value\n\n def _register_core_services(self) -> None:\n if self._core_registered:\n return\n self.services.register(\"configuration\", self.configuration)\n self.services.register(\"traces\", self.traces)\n self.services.register(\"health\", self.health)\n self.services.register(\"logs\", self.logs)\n self.services.register(\"workers\", self.workers)\n self.services.register(\"control_plane\", self.control_plane)\n self._core_registered = True\n\n def _register_health_contributors(self) -> None:\n for contributor in self.registry.health_contributors:\n self.health.register(contributor)\n\n def _register_workers(self) -> None:\n if self._workers_registered:\n return\n for worker in self.registry.workers:\n self.workers.register(worker)\n self._workers_registered = True\n\n def _refresh_state(self) -> None:\n lifecycle = self.workers.lifecycle_state()\n\n if self._state == LifecycleState.STOPPING:\n if lifecycle == LifecycleState.STOPPED:\n self._started = False\n self._state = LifecycleState.STOPPED\n return\n\n if not self._started:\n if lifecycle == LifecycleState.STOPPED:\n self._state = LifecycleState.STOPPED\n return\n\n self._state = lifecycle\n\n def _wait_for_state(self, target_states: set[LifecycleState], *, timeout: float) -> bool:\n deadline = monotonic() + timeout\n while monotonic() < deadline:\n self._refresh_state()\n if self._state in target_states:\n return True\n sleep(self.ACTION_POLL_INTERVAL_SECONDS)\n self._refresh_state()\n return self._state in target_states\n\n def _action_detail(self, message: str, *, timed_out: bool) -> dict[str, object]:\n self._refresh_state()\n return {\n \"message\": message,\n \"state\": self._state.value,\n \"timed_out\": timed_out,\n \"workers\": self.workers.snapshot(),\n }", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/core/runtime.py:RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.core.runtime", - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "llm_answer": "## Анализ класса `RuntimeManager`\n\n### 1. Положение и назначение класса\n\nКласс `RuntimeManager` определен в файле `src/app_runtime/core/runtime.py`. Его роль — **управляющий компонент**, который координирует выполнение различных ролей и подзадач внутри системы обработки данных.\n\n### 2. Ответственность (`Responsibilities`)\n\nСогласно документации, этот класс выполняет следующие обязанности:\n\n- Название класса указывает на его управляющую природу.\n- Координирует вызов ролей (ролей-подзадач) — всего их четыре.\n- Читает и записывает состояния атрибутов.\n- Участвует в разделах потока данных (dataflow slices).\n\nЭти обязанности подчеркивают важность этого компонента для управления последовательностью выполнения задач в системе.\n\n---\n\n### 3. Поток данных и архитектура\n\n#### a. Участие в данных потока (`dataflow slices`)\n\nДокументация указывает, что данный класс участвует в нескольких разрезах данных (slices). Это означает, что он играет ключевую роль в координации передачи информации между различными частями системы.\n\n#### b. Чтение и запись состояний атрибутов\n\nЭтот класс также активно взаимодействует с состоянием системы, читая и изменяя определенные атрибуты, что важно для поддержания согласованности данных и корректного функционирования системы.\n\n---\n\n### 4. Примеры использования и роли компонентов\n\n#### a. Контрольные каналы (`ControlChannel`, `ControlActionSet`)\n\n- `ControlChannel`: Стандартная модельный канал управления.\n- `ControlActionSet`: Набор действий модели.\n\nЭти компоненты обеспечивают механизм взаимодействия между различными ролями и стадиями процесса исполнения.\n\n#### b. Сервисы контроля (`ControlPlaneService`, `UvicornThreadRunner`)\n\n- `ControlPlaneService`: Обслуживает операции чтения и записи состояний атрибутов и принимает участие в пяти разрезах данных.\n- `UvicornThreadRunner`: Этот сервис используется для запуска HTTP-серверов через uvicorn в отдельном потоке и участвует в двадцати четырех разрезах данных.\n\nЭти сервисы являются частью общей инфраструктуры управления исполнением задач и участвуют в процессе обработки запросов пользователей.\n\n---\n\n### 5. Итоговое описание работы класса `RuntimeManager`\n\nКласс `RuntimeManager` является ключевым компонентом управляющей архитектуры приложения. Он отвечает за координацию вызова различных ролей или подзадач в системе, обеспечивая синхронизацию и последовательность операций. При этом он активно взаимодействует со своими окружающими компонентами (например, каналами управления, серверами, сервисами и др.), участвуя в обработке данных потоков и поддерживая целостность состояния системы.\n\nТаким образом, основная задача данного класса заключается в управлении логикой и последовательностью выполнения всех этапов обработки данных и взаимодействий с другими компонентами системы.", - "summary": { - "router": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "confidence": null - }, - "retrieval": { - "profile": "code", - "layers_hit": [ - "C0_SOURCE_CHUNKS", - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS", - "C4_SEMANTIC_ROLES" - ], - "evidence_sufficient": true - }, - "llm": { - "answer_status": "answered", - "groundedness": "grounded" - } - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "RuntimeManager" - ], - "keyword_hints": [ - "RuntimeManager" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C0_SOURCE_CHUNKS": "exact_path_fetch", - "C4_SEMANTIC_ROLES": "exact_path_fetch", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C3_ENTRYPOINTS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 8, - "C4_SEMANTIC_ROLES": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C3_ENTRYPOINTS": 6 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C4_SEMANTIC_ROLES": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Объясни как работает класс RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C4_SEMANTIC_ROLES", - "query": "Объясни как работает класс RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "Объясни как работает класс RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - }, - { - "layer": "C3_ENTRYPOINTS", - "query": "Объясни как работает класс RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 1, - "candidates_after_filter": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 6, - "candidates_after_filter": 6 - }, - { - "layer": "C3_ENTRYPOINTS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 3, - "candidates_after_filter": 3 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "RuntimeManager", - "alternatives": [ - "RuntimeManager" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C4_SEMANTIC_ROLES", - "status": "hit", - "hit_count": 8, - "fail_reason": null - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 6, - "fail_reason": null - }, - { - "layer": "C3_ENTRYPOINTS", - "status": "hit", - "hit_count": 3, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "router": 1, - "symbol_resolution": 0, - "retrieval_total": 276, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 51, - "C0_SOURCE_CHUNKS": 20, - "C4_SEMANTIC_ROLES": 14, - "C2_DEPENDENCY_GRAPH": 55, - "C3_ENTRYPOINTS": 10 - }, - "merge_rank": 19, - "prompt_build": 0, - "llm_call": 6047 - }, - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 335, - "evidence_rows": 19, - "evidence_chars": 7949 - }, - "evidence_summary": [ - { - "layer": "C1_SYMBOL_CATALOG", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "count": 8, - "unique_paths": 7 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "count": 6, - "unique_paths": 2 - }, - { - "layer": "C3_ENTRYPOINTS", - "count": 3, - "unique_paths": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 1, - "unique_paths": 1 - } - ], - "prompt_template_id": "intent_code_qa_v1", - "system_prompt_version": "v1" - }, - "router": { - "conversation_mode": "START", - "keyword_hints": [ - "RuntimeManager" - ], - "path_scope": [] - }, - "llm": { - "used_evidence_count": 19, - "missing_evidence_reason": null - } - }, - "run_info": { - "case_id": "plba-fullchain-explain-runtime-manager", - "mode": "full_chain", - "run_started_at": "2026-03-12T09:13:14", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - }, - "input_request": { - "text": "Объясни как работает класс RuntimeManager", - "normalized_query": "Объясни как работает класс RuntimeManager" - }, - "steps": [ - { - "step": "intent_router", - "input": { - "query": "Объясни как работает класс RuntimeManager" - }, - "output": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Объясни как работает класс RuntimeManager" - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "RuntimeManager" - ], - "keyword_hints": [ - "RuntimeManager" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "timings_ms": { - "router": 1 - } - } - }, - { - "step": "retrieval", - "input": { - "query": "Объясни как работает класс RuntimeManager" - }, - "output": { - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "RuntimeManager", - "alternatives": [ - "RuntimeManager" - ], - "confidence": 0.99 - }, - "rag_count": 19, - "rag_rows": [ - { - "path": "src/app_runtime/core/runtime.py", - "content": "class RuntimeManager\nRuntimeManager", - "layer": "C1_SYMBOL_CATALOG", - "title": "RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "7e4a9381328c5803bbc6179458612fc4e947d928aa7bf8b4b2bebb2c8592f758", - "qname": "RuntimeManager", - "kind": "class", - "signature": "RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.core.runtime", - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests manager\n- orchestrates role-like calls (4)\n- reads and writes state attributes\n- participates in dataflow slices (50)", - "layer": "C4_SEMANTIC_ROLES", - "title": "RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 43, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "7e4a9381328c5803bbc6179458612fc4e947d928aa7bf8b4b2bebb2c8592f758", - "symbol_name": "RuntimeManager", - "qname": "RuntimeManager", - "role": "pipeline_stage", - "confidence": 0.67, - "dataflow_participation": 50, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "ControlChannel\nrole: model\n\nResponsibilities:\n- default model role", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlChannel", - "span_start": 21, - "span_end": 28, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 40, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "cfcfe9a311d3a2dbdaf32ac4ccd73c0eb9a117f830591a1c0867ee97d46204ff", - "symbol_name": "ControlChannel", - "qname": "ControlChannel", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "ControlActionSet\nrole: model\n\nResponsibilities:\n- default model role", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlActionSet", - "span_start": 14, - "span_end": 18, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 40, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "46eb026cb3313415ec47b82dd22f84f4d112c9d987e8b1716dcb0baa1cce8988", - "symbol_name": "ControlActionSet", - "qname": "ControlActionSet", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests service\n- reads and writes state attributes\n- participates in dataflow slices (5)", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlPlaneService", - "span_start": 12, - "span_end": 52, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 68, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "b13471e5916986dccffb53fab613812842965705e6b3a89ae549d30c9e91e9aa", - "symbol_name": "ControlPlaneService", - "qname": "ControlPlaneService", - "role": "pipeline_stage", - "confidence": 0.57, - "dataflow_participation": 5, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_runner.py", - "content": "UvicornThreadRunner\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (24)", - "layer": "C4_SEMANTIC_ROLES", - "title": "UvicornThreadRunner", - "span_start": 10, - "span_end": 61, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 11, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "fd55630045a02100df8877ac27d951ee08617d4598764394d48cb51fe067476a", - "symbol_name": "UvicornThreadRunner", - "qname": "UvicornThreadRunner", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 24, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "3779fdd2878b770e789a35bb2a89c9d79f13b61c26d7db1b3b683f9bb9e1623f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (10)", - "layer": "C4_SEMANTIC_ROLES", - "title": "HttpControlChannel", - "span_start": 12, - "span_end": 57, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 21, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "1c9fbdc24819e5604c26ea55428a74310f03a03e1af197ed84846af61e42fdb0", - "symbol_name": "HttpControlChannel", - "qname": "HttpControlChannel", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 10, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "HttpControlAppFactory\nrole: factory\n\nResponsibilities:\n- name suffix suggests factory", - "layer": "C4_SEMANTIC_ROLES", - "title": "HttpControlAppFactory", - "span_start": 15, - "span_end": 53, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 39, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "9b3502a5fb408b273223db13264349cf500de24915b6c649d9ea8970d0dfd8e0", - "symbol_name": "HttpControlAppFactory", - "qname": "HttpControlAppFactory", - "role": "factory", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/persistence/workflow_persistence.py", - "content": "WorkflowPersistence\nrole: pipeline_stage\n\nResponsibilities:\n- orchestrates role-like calls (2)\n- reads and writes state attributes\n- participates in dataflow slices (16)", - "layer": "C4_SEMANTIC_ROLES", - "title": "WorkflowPersistence", - "span_start": 8, - "span_end": 54, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 15, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "7bd01ee45cf31f2d5c2e3e51656254860ac785d10cef9e0852cd4fba90857bae", - "symbol_name": "WorkflowPersistence", - "qname": "WorkflowPersistence", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 16, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "80e9410ddc639789b4353c2a1a757ba8d0d5b5bb6075b0b263b61551f04ae1f0", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.stop", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 25, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d", - "dst_ref": "ControlPlaneService.stop", - "resolution": "resolved", - "slice_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.stop" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._stop_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 51, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a", - "dst_ref": "ControlPlaneService._stop_async", - "resolution": "resolved", - "slice_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._stop_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.register_channel", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 17, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957", - "dst_ref": "ControlPlaneService.register_channel", - "resolution": "resolved", - "slice_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.register_channel" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.start", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 20, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154", - "dst_ref": "ControlPlaneService.start", - "resolution": "resolved", - "slice_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.start" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._start_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 47, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517", - "dst_ref": "ControlPlaneService._start_async", - "resolution": "resolved", - "slice_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._start_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager.add_config_file", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 32, - "span_end": 52, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "a23b8a11ebdb12708b60c96ea12a69f7f042082f1adfddd572444e246d81d167", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "57ffbd4f0d9fdf3507c2b8624312ce211f3d02fdf86a57a8ec90778d8a7b498d", - "dst_ref": "RuntimeManager.add_config_file", - "resolution": "resolved", - "slice_id": "a23b8a11ebdb12708b60c96ea12a69f7f042082f1adfddd572444e246d81d167", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager.add_config_file" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "57ffbd4f0d9fdf3507c2b8624312ce211f3d02fdf86a57a8ec90778d8a7b498d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "class RuntimeManager:\n ACTION_TIMEOUT_SECONDS = 10.0\n ACTION_POLL_INTERVAL_SECONDS = 0.05\n\n def __init__(\n self,\n configuration: ConfigurationManager | None = None,\n services: ServiceContainer | None = None,\n traces: TraceService | None = None,\n health: HealthRegistry | None = None,\n logs: LogManager | None = None,\n workers: WorkerSupervisor | None = None,\n control_plane: ControlPlaneService | None = None,\n ) -> None:\n self.configuration = configuration or ConfigurationManager()\n self.services = services or ServiceContainer()\n self.traces = traces or TraceService()\n self.health = health or HealthRegistry()\n self.logs = logs or LogManager()\n self.workers = workers or WorkerSupervisor()\n self.control_plane = control_plane or ControlPlaneService()\n self.registry = ModuleRegistry(self.services)\n self._started = False\n self._state = LifecycleState.IDLE\n self._core_registered = False\n self._workers_registered = False\n self._register_core_services()\n\n def register_module(self, module: ApplicationModule) -> None:\n self.registry.register_module(module.name)\n module.register(self.registry)\n\n def add_config_file(self, path: str) -> FileConfigProvider:\n provider = FileConfigProvider(path)\n self.configuration.add_provider(provider)\n return provider\n\n def start(self, *, start_control_plane: bool = True) -> None:\n if self._started:\n return\n self._state = LifecycleState.STARTING\n config = self.configuration.load()\n self.logs.apply_config(config)\n self._register_health_contributors()\n self._register_workers()\n self.workers.start()\n if start_control_plane:\n self.control_plane.start(self)\n self._started = True\n self._refresh_state()\n\n def stop(self, timeout: float = 30.0, force: bool = False, stop_control_plane: bool = True) -> None:\n if not self._started:\n return\n self._state = LifecycleState.STOPPING\n self.workers.stop(timeout=timeout, force=force)\n if stop_control_plane:\n self.control_plane.stop()\n self._started = False\n self._state = LifecycleState.STOPPED\n\n def status(self) -> dict[str, object]:\n self._refresh_state()\n return self.control_plane.snapshot(self)\n\n def current_health(self) -> HealthPayload:\n self._refresh_state()\n return self.health.payload(self._state, self.workers.healths())\n\n async def health_status(self) -> HealthPayload:\n return self.current_health()\n\n async def start_runtime(self) -> dict[str, object] | str:\n self._refresh_state()\n if self._started:\n return \"runtime already running\"\n if self._state == LifecycleState.STOPPING:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n\n self.start(start_control_plane=False)\n started = self._wait_for_state({LifecycleState.IDLE, LifecycleState.BUSY}, timeout=self.ACTION_TIMEOUT_SECONDS)\n if started:\n return self._action_detail(\"runtime started\", timed_out=False)\n return self._action_detail(\"runtime start is still in progress\", timed_out=True)\n\n async def stop_runtime(self) -> dict[str, object] | str:\n self._refresh_state()\n if not self._started:\n if self._state == LifecycleState.STOPPING:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n return \"runtime already stopped\"\n\n self._state = LifecycleState.STOPPING\n try:\n self.workers.stop(timeout=self.ACTION_TIMEOUT_SECONDS, force=False)\n except TimeoutError:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n\n self._started = False\n self._state = LifecycleState.STOPPED\n return self._action_detail(\"runtime stopped\", timed_out=False)\n\n async def runtime_status(self) -> str:\n self._refresh_state()\n return self._state.value\n\n def _register_core_services(self) -> None:\n if self._core_registered:\n return\n self.services.register(\"configuration\", self.configuration)\n self.services.register(\"traces\", self.traces)\n self.services.register(\"health\", self.health)\n self.services.register(\"logs\", self.logs)\n self.services.register(\"workers\", self.workers)\n self.services.register(\"control_plane\", self.control_plane)\n self._core_registered = True\n\n def _register_health_contributors(self) -> None:\n for contributor in self.registry.health_contributors:\n self.health.register(contributor)\n\n def _register_workers(self) -> None:\n if self._workers_registered:\n return\n for worker in self.registry.workers:\n self.workers.register(worker)\n self._workers_registered = True\n\n def _refresh_state(self) -> None:\n lifecycle = self.workers.lifecycle_state()\n\n if self._state == LifecycleState.STOPPING:\n if lifecycle == LifecycleState.STOPPED:\n self._started = False\n self._state = LifecycleState.STOPPED\n return\n\n if not self._started:\n if lifecycle == LifecycleState.STOPPED:\n self._state = LifecycleState.STOPPED\n return\n\n self._state = lifecycle\n\n def _wait_for_state(self, target_states: set[LifecycleState], *, timeout: float) -> bool:\n deadline = monotonic() + timeout\n while monotonic() < deadline:\n self._refresh_state()\n if self._state in target_states:\n return True\n sleep(self.ACTION_POLL_INTERVAL_SECONDS)\n self._refresh_state()\n return self._state in target_states\n\n def _action_detail(self, message: str, *, timed_out: bool) -> dict[str, object]:\n self._refresh_state()\n return {\n \"message\": message,\n \"state\": self._state.value,\n \"timed_out\": timed_out,\n \"workers\": self.workers.snapshot(),\n }", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/core/runtime.py:RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.core.runtime", - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ] - }, - "diagnostics": { - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C0_SOURCE_CHUNKS": "exact_path_fetch", - "C4_SEMANTIC_ROLES": "exact_path_fetch", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C3_ENTRYPOINTS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 8, - "C4_SEMANTIC_ROLES": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C3_ENTRYPOINTS": 6 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C4_SEMANTIC_ROLES": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Объясни как работает класс RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C4_SEMANTIC_ROLES", - "query": "Объясни как работает класс RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "Объясни как работает класс RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - }, - { - "layer": "C3_ENTRYPOINTS", - "query": "Объясни как работает класс RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 1, - "candidates_after_filter": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 6, - "candidates_after_filter": 6 - }, - { - "layer": "C3_ENTRYPOINTS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 3, - "candidates_after_filter": 3 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "RuntimeManager", - "alternatives": [ - "RuntimeManager" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C4_SEMANTIC_ROLES", - "status": "hit", - "hit_count": 8, - "fail_reason": null - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 6, - "fail_reason": null - }, - { - "layer": "C3_ENTRYPOINTS", - "status": "hit", - "hit_count": 3, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "symbol_resolution": 0, - "retrieval_total": 276, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 51, - "C0_SOURCE_CHUNKS": 20, - "C4_SEMANTIC_ROLES": 14, - "C2_DEPENDENCY_GRAPH": 55, - "C3_ENTRYPOINTS": 10 - }, - "merge_rank": 19 - } - } - }, - { - "step": "llm_answer", - "input": { - "query": "Объясни как работает класс RuntimeManager", - "rag_count": 19 - }, - "output": { - "llm_answer": "## Анализ класса `RuntimeManager`\n\n### 1. Положение и назначение класса\n\nКласс `RuntimeManager` определен в файле `src/app_runtime/core/runtime.py`. Его роль — **управляющий компонент**, который координирует выполнение различных ролей и подзадач внутри системы обработки данных.\n\n### 2. Ответственность (`Responsibilities`)\n\nСогласно документации, этот класс выполняет следующие обязанности:\n\n- Название класса указывает на его управляющую природу.\n- Координирует вызов ролей (ролей-подзадач) — всего их четыре.\n- Читает и записывает состояния атрибутов.\n- Участвует в разделах потока данных (dataflow slices).\n\nЭти обязанности подчеркивают важность этого компонента для управления последовательностью выполнения задач в системе.\n\n---\n\n### 3. Поток данных и архитектура\n\n#### a. Участие в данных потока (`dataflow slices`)\n\nДокументация указывает, что данный класс участвует в нескольких разрезах данных (slices). Это означает, что он играет ключевую роль в координации передачи информации между различными частями системы.\n\n#### b. Чтение и запись состояний атрибутов\n\nЭтот класс также активно взаимодействует с состоянием системы, читая и изменяя определенные атрибуты, что важно для поддержания согласованности данных и корректного функционирования системы.\n\n---\n\n### 4. Примеры использования и роли компонентов\n\n#### a. Контрольные каналы (`ControlChannel`, `ControlActionSet`)\n\n- `ControlChannel`: Стандартная модельный канал управления.\n- `ControlActionSet`: Набор действий модели.\n\nЭти компоненты обеспечивают механизм взаимодействия между различными ролями и стадиями процесса исполнения.\n\n#### b. Сервисы контроля (`ControlPlaneService`, `UvicornThreadRunner`)\n\n- `ControlPlaneService`: Обслуживает операции чтения и записи состояний атрибутов и принимает участие в пяти разрезах данных.\n- `UvicornThreadRunner`: Этот сервис используется для запуска HTTP-серверов через uvicorn в отдельном потоке и участвует в двадцати четырех разрезах данных.\n\nЭти сервисы являются частью общей инфраструктуры управления исполнением задач и участвуют в процессе обработки запросов пользователей.\n\n---\n\n### 5. Итоговое описание работы класса `RuntimeManager`\n\nКласс `RuntimeManager` является ключевым компонентом управляющей архитектуры приложения. Он отвечает за координацию вызова различных ролей или подзадач в системе, обеспечивая синхронизацию и последовательность операций. При этом он активно взаимодействует со своими окружающими компонентами (например, каналами управления, серверами, сервисами и др.), участвуя в обработке данных потоков и поддерживая целостность состояния системы.\n\nТаким образом, основная задача данного класса заключается в управлении логикой и последовательностью выполнения всех этапов обработки данных и взаимодействий с другими компонентами системы." - }, - "diagnostics": { - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 335, - "evidence_rows": 19, - "evidence_chars": 7949 - }, - "evidence_summary": [ - { - "layer": "C1_SYMBOL_CATALOG", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "count": 8, - "unique_paths": 7 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "count": 6, - "unique_paths": 2 - }, - { - "layer": "C3_ENTRYPOINTS", - "count": 3, - "unique_paths": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 1, - "unique_paths": 1 - } - ], - "prompt_template_id": "intent_code_qa_v1", - "system_prompt_version": "v1" - }, - "timings_ms": { - "prompt_build": 0, - "llm_call": 6047 - } - } - } - ] - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_091314/full_chain_plba_code_retrieval_plba-fullchain-explain-runtime-manager.md b/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_091314/full_chain_plba_code_retrieval_plba-fullchain-explain-runtime-manager.md deleted file mode 100644 index 02477d4..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_091314/full_chain_plba_code_retrieval_plba-fullchain-explain-runtime-manager.md +++ /dev/null @@ -1,34 +0,0 @@ -# plba-fullchain-explain-runtime-manager - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_retrieval.yaml -- runner: runtime -- mode: full_chain -- passed: True - -## Query -Объясни как работает класс RuntimeManager - -## Actual -{ - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 19, - "llm_answer": "## Анализ класса `RuntimeManager`\n\n### 1. Положение и назначение класса\n\nКласс `RuntimeManager` определен в файле `src/app_runtime/core/runtime.py`. Его роль — **управляющий компонент**, который координирует выполнение различных ролей и подзадач внутри системы обработки данных.\n\n### 2. Ответственность (`Responsibilities`)\n\nСогласно документации, этот класс выполняет следующие обязанности:\n\n- Название класса указывает на его управляющую природу.\n- Координирует вызов ролей (ролей-подзадач) — всего их четыре.\n- Читает и записывает состояния атрибутов.\n- Участвует в разделах потока данных (dataflow slices).\n\nЭти обязанности подчеркивают важность этого компонента для управления последовательностью выполнения задач в системе.\n\n---\n\n### 3. Поток данных и архитектура\n\n#### a. Участие в данных потока (`dataflow slices`)\n\nДокументация указывает, что данный класс участвует в нескольких разрезах данных (slices). Это означает, что он играет ключевую роль в координации передачи информации между различными частями системы.\n\n#### b. Чтение и запись состояний атрибутов\n\nЭтот класс также активно взаимодействует с состоянием системы, читая и изменяя определенные атрибуты, что важно для поддержания согласованности данных и корректного функционирования системы.\n\n---\n\n### 4. Примеры использования и роли компонентов\n\n#### a. Контрольные каналы (`ControlChannel`, `ControlActionSet`)\n\n- `ControlChannel`: Стандартная модельный канал управления.\n- `ControlActionSet`: Набор действий модели.\n\nЭти компоненты обеспечивают механизм взаимодействия между различными ролями и стадиями процесса исполнения.\n\n#### b. Сервисы контроля (`ControlPlaneService`, `UvicornThreadRunner`)\n\n- `ControlPlaneService`: Обслуживает операции чтения и записи состояний атрибутов и принимает участие в пяти разрезах данных.\n- `UvicornThreadRunner`: Этот сервис используется для запуска HTTP-серверов через uvicorn в отдельном потоке и участвует в двадцати четырех разрезах данных.\n\nЭти сервисы являются частью общей инфраструктуры управления исполнением задач и участвуют в процессе обработки запросов пользователей.\n\n---\n\n### 5. Итоговое описание работы класса `RuntimeManager`\n\nКласс `RuntimeManager` является ключевым компонентом управляющей архитектуры приложения. Он отвечает за координацию вызова различных ролей или подзадач в системе, обеспечивая синхронизацию и последовательность операций. При этом он активно взаимодействует со своими окружающими компонентами (например, каналами управления, серверами, сервисами и др.), участвуя в обработке данных потоков и поддерживая целостность состояния системы.\n\nТаким образом, основная задача данного класса заключается в управлении логикой и последовательностью выполнения всех этапов обработки данных и взаимодействий с другими компонентами системы.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "RuntimeManager" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] -} - -## Mismatches -- none \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_091314/full_chain_plba_code_retrieval_plba-fullchain-explain-trace-service.json b/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_091314/full_chain_plba_code_retrieval_plba-fullchain-explain-trace-service.json deleted file mode 100644 index c78edcc..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_091314/full_chain_plba_code_retrieval_plba-fullchain-explain-trace-service.json +++ /dev/null @@ -1,2684 +0,0 @@ -{ - "case_id": "plba-fullchain-explain-trace-service", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_retrieval.yaml", - "runner": "runtime", - "mode": "full_chain", - "actual": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 21, - "llm_answer": "## Анализ архитектуры и поведения `TraceService`\n\n### 1. Описание `TraceService`\n`TraceService` — это класс, представляющий собой сервисную компоненту приложения, которая участвует в управлении трассировкой выполнения различных процессов внутри системы. Он наследует от класса `TraceContextFactory`, что указывает на его ответственность за создание и управление контекстом трассировки.\n\n### 2. Роли и обязанности компонента\nВ рамках общей архитектуры компонентов системы, `TraceService` играет роль `pipeline_stage`. Это означает, что он является одним из этапов общего конвейера обработки данных или задач в системе. \n\n#### Основные обязанности:\n- **Чтение и запись состояния атрибутов**: Взаимодействие с состоянием приложения через чтение и запись атрибутов.\n- **Участие в разделах потока данных**: Указано, что данный компонент участвует в 13 разных разделах потоков данных. Эти потоки данных являются частями общего процесса выполнения задач или работы сервиса.\n\n### 3. Место в общей архитектуре\n- **Связь с другими компонентами**:\n - `UvicornThreadRunner`: отвечает за запуск HTTP-сервера и выполнение запросов. Имеет аналогичную роль и обязанности как у `TraceService`.\n - `WorkflowPersistence`: ответственен за оркестровку вызовов ролей и участие в потоках данных (участвует в 16 разделах).\n - `HttpControlChannel`: занимается управлением каналами HTTP-контроля и взаимодействием с ними.\n - `InMemoryTaskQueue`: управляет очередями задач и их выполнением.\n\nВсе перечисленные компоненты являются частью единого конвейера обработки и участвуют в общих процессах обмена данными и управления задачами.\n\n### 4. Поток данных\nПотоки данных описывают последовательность операций и шагов, которые выполняются системой для достижения определенного результата. Участие каждого компонента в этих потоках обеспечивает целостность и согласованность всей системы при выполнении задач.\n\n### Итоговое объяснение работы `TraceService`\n\n`TraceService` является специализированным компонентом системы, отвечающим за управление контекстом трассировки и участие в общем потоке данных. Его основная задача — обеспечивать корректное отслеживание и ведение контекста выполнения задач, обеспечивая прозрачность и возможность анализа этих задач.\n\nЭтот компонент интегрируется в общую инфраструктуру системы, участвуя в нескольких потоках данных, обеспечивая согласованное взаимодействие между различными компонентами системы.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "TraceService" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "passed": true, - "mismatches": [], - "details": { - "case_id": "plba-fullchain-explain-trace-service", - "text": "Как работает TraceService?", - "mode": "full_chain", - "run_started_at": "2026-03-12T09:13:14", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Как работает TraceService?", - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "TraceService", - "alternatives": [ - "TraceService" - ], - "confidence": 0.99 - }, - "rag_count": 21, - "rag_rows": [ - { - "path": "src/app_runtime/tracing/service.py", - "content": "class TraceService\nTraceService(TraceContextFactory)", - "layer": "C1_SYMBOL_CATALOG", - "title": "TraceService", - "span_start": 39, - "span_end": 166, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "c2b2b976d99f2c600000b753731b26e0a69adcb4359398b93073590c5d5d04f4", - "qname": "TraceService", - "kind": "class", - "signature": "TraceService(TraceContextFactory)", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.tracing.service", - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "TraceService\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests service\n- reads and writes state attributes\n- participates in dataflow slices (13)", - "layer": "C4_SEMANTIC_ROLES", - "title": "TraceService", - "span_start": 39, - "span_end": 166, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 60, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "c2b2b976d99f2c600000b753731b26e0a69adcb4359398b93073590c5d5d04f4", - "symbol_name": "TraceService", - "qname": "TraceService", - "role": "pipeline_stage", - "confidence": 0.57, - "dataflow_participation": 13, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_runner.py", - "content": "UvicornThreadRunner\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (24)", - "layer": "C4_SEMANTIC_ROLES", - "title": "UvicornThreadRunner", - "span_start": 10, - "span_end": 61, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 11, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "fd55630045a02100df8877ac27d951ee08617d4598764394d48cb51fe067476a", - "symbol_name": "UvicornThreadRunner", - "qname": "UvicornThreadRunner", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 24, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "3779fdd2878b770e789a35bb2a89c9d79f13b61c26d7db1b3b683f9bb9e1623f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/persistence/workflow_persistence.py", - "content": "WorkflowPersistence\nrole: pipeline_stage\n\nResponsibilities:\n- orchestrates role-like calls (2)\n- reads and writes state attributes\n- participates in dataflow slices (16)", - "layer": "C4_SEMANTIC_ROLES", - "title": "WorkflowPersistence", - "span_start": 8, - "span_end": 54, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 15, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "7bd01ee45cf31f2d5c2e3e51656254860ac785d10cef9e0852cd4fba90857bae", - "symbol_name": "WorkflowPersistence", - "qname": "WorkflowPersistence", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 16, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "80e9410ddc639789b4353c2a1a757ba8d0d5b5bb6075b0b263b61551f04ae1f0", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (10)", - "layer": "C4_SEMANTIC_ROLES", - "title": "HttpControlChannel", - "span_start": 12, - "span_end": 57, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 21, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "1c9fbdc24819e5604c26ea55428a74310f03a03e1af197ed84846af61e42fdb0", - "symbol_name": "HttpControlChannel", - "qname": "HttpControlChannel", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 10, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/queue/in_memory.py", - "content": "InMemoryTaskQueue\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (9)", - "layer": "C4_SEMANTIC_ROLES", - "title": "InMemoryTaskQueue", - "span_start": 9, - "span_end": 38, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 22, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "2da04cb94544a3bcbf0943a95ad4bdd8710bcafaa32a02fd0e4de2178dcf3533", - "symbol_name": "InMemoryTaskQueue", - "qname": "InMemoryTaskQueue", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 9, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "58f0cc001ccda0eee4c6bc32ed83bd05eafd6b6644f1e8b4aa9eed3103db73dc", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/config/file_loader.py", - "content": "ConfigFileLoader\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (8)", - "layer": "C4_SEMANTIC_ROLES", - "title": "ConfigFileLoader", - "span_start": 11, - "span_end": 48, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 23, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "a8474eca8b6e9dc86ae67ed68b16fa5fb639ef08739c053e7b7195489765667f", - "symbol_name": "ConfigFileLoader", - "qname": "ConfigFileLoader", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 8, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "1f19ffebde5e38e4be5a5d5a678059a0f36dedb8fb8b3e00ab395c67106a87ea", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/store.py", - "content": "TraceContextStore\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (6)", - "layer": "C4_SEMANTIC_ROLES", - "title": "TraceContextStore", - "span_start": 15, - "span_end": 52, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 25, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "b2dad4fbe16ffb11b58deba311c7739955c39d59f291b22181f33e9c8cce4059", - "symbol_name": "TraceContextStore", - "qname": "TraceContextStore", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 6, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "d369554f08fc92039c6edd5a2a1e73b23901533e8974459170bbd9347d263dc5", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workers/supervisor.py", - "content": "WorkerSupervisor\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (6)", - "layer": "C4_SEMANTIC_ROLES", - "title": "WorkerSupervisor", - "span_start": 10, - "span_end": 59, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 25, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "c17b44e8d9e97d490989b21fa67d7c346cdda8a0472e4c41fb243c8846faa124", - "symbol_name": "WorkerSupervisor", - "qname": "WorkerSupervisor", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 6, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "77609d9d5927171cce7fc3a54897c183fd63068710c6362029b700937aae5eee", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "TraceService.__init__\n -> TraceService.store\n -> TraceService.create_context", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "TraceService.__init__:dataflow_slice", - "span_start": 42, - "span_end": 61, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "3b052062067a78aef3302ee1d996897e02a67d1b340397bea4f59fe147c0492a", - "edge_type": "dataflow_slice", - "src_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "src_qname": "TraceService.__init__", - "dst_symbol_id": "ff44881104b65ef50ee6fe16d367d4a81b6e7eb5c44c0963cf4543faec785d4a", - "dst_ref": "TraceService.create_context", - "resolution": "resolved", - "slice_id": "3b052062067a78aef3302ee1d996897e02a67d1b340397bea4f59fe147c0492a", - "root_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "path_symbols": [ - "TraceService.__init__", - "TraceService.store", - "TraceService.create_context" - ], - "path_symbol_ids": [ - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "ff44881104b65ef50ee6fe16d367d4a81b6e7eb5c44c0963cf4543faec785d4a" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "TraceService.__init__\n -> TraceService.store\n -> TraceService.close_context", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "TraceService.__init__:dataflow_slice", - "span_start": 42, - "span_end": 84, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "7a9353ef57c9ae5d19b3a0c6ac50fad05e6d21d31bbe1cd1cd07af6332ba6505", - "edge_type": "dataflow_slice", - "src_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "src_qname": "TraceService.__init__", - "dst_symbol_id": "01e14158dcced7e52d0c8ac84ac7b9a75225c261b6aca6a1d7da802d0994721c", - "dst_ref": "TraceService.close_context", - "resolution": "resolved", - "slice_id": "7a9353ef57c9ae5d19b3a0c6ac50fad05e6d21d31bbe1cd1cd07af6332ba6505", - "root_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "path_symbols": [ - "TraceService.__init__", - "TraceService.store", - "TraceService.close_context" - ], - "path_symbol_ids": [ - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "01e14158dcced7e52d0c8ac84ac7b9a75225c261b6aca6a1d7da802d0994721c" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "TraceService.__init__\n -> TraceService.store\n -> TraceService.open_context", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "TraceService.__init__:dataflow_slice", - "span_start": 42, - "span_end": 78, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "a6e13b9ebc4fed84586afd53ed92a4d14757e440873f572b2337d5622ee96031", - "edge_type": "dataflow_slice", - "src_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "src_qname": "TraceService.__init__", - "dst_symbol_id": "2da3d5b20a947bf63e14c103be4689b72fd837e0a82abd6c497846375d4c7426", - "dst_ref": "TraceService.open_context", - "resolution": "resolved", - "slice_id": "a6e13b9ebc4fed84586afd53ed92a4d14757e440873f572b2337d5622ee96031", - "root_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "path_symbols": [ - "TraceService.__init__", - "TraceService.store", - "TraceService.open_context" - ], - "path_symbol_ids": [ - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "2da3d5b20a947bf63e14c103be4689b72fd837e0a82abd6c497846375d4c7426" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "TraceService.__init__\n -> TraceService.transport\n -> TraceService.__init__", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "TraceService.__init__:dataflow_slice", - "span_start": 41, - "span_end": 43, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "1e923a93faa05c3c43ca9b19bd047007a8589ccce57d3cc1798ae7f9f200af98", - "edge_type": "dataflow_slice", - "src_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "src_qname": "TraceService.__init__", - "dst_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "dst_ref": "TraceService.__init__", - "resolution": "resolved", - "slice_id": "1e923a93faa05c3c43ca9b19bd047007a8589ccce57d3cc1798ae7f9f200af98", - "root_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "path_symbols": [ - "TraceService.__init__", - "TraceService.transport", - "TraceService.__init__" - ], - "path_symbol_ids": [ - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "TraceService.__init__\n -> TraceService.store\n -> TraceService.current_trace_id", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "TraceService.__init__:dataflow_slice", - "span_start": 42, - "span_end": 81, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "3ea17138634b1190bded77ddb84aa1595124f6519b246f24fc4b02bd62b5cac1", - "edge_type": "dataflow_slice", - "src_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "src_qname": "TraceService.__init__", - "dst_symbol_id": "41135180f7b3b9ab20e097e0747474e219c37dd2366ef08a7b43c1f3edb10b4c", - "dst_ref": "TraceService.current_trace_id", - "resolution": "resolved", - "slice_id": "3ea17138634b1190bded77ddb84aa1595124f6519b246f24fc4b02bd62b5cac1", - "root_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "path_symbols": [ - "TraceService.__init__", - "TraceService.store", - "TraceService.current_trace_id" - ], - "path_symbol_ids": [ - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "41135180f7b3b9ab20e097e0747474e219c37dd2366ef08a7b43c1f3edb10b4c" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "TraceService.__init__\n -> TraceService.store\n -> TraceService.step", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "TraceService.__init__:dataflow_slice", - "span_start": 42, - "span_end": 88, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "9f34c5da9b09fba99df6f6b1bde183a9aeb45111b8218a747c71590c2c9f60f2", - "edge_type": "dataflow_slice", - "src_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "src_qname": "TraceService.__init__", - "dst_symbol_id": "c44bfbc66cf747283f30088da3e011a10395031d41e77b74e523c24997f641ca", - "dst_ref": "TraceService.step", - "resolution": "resolved", - "slice_id": "9f34c5da9b09fba99df6f6b1bde183a9aeb45111b8218a747c71590c2c9f60f2", - "root_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "path_symbols": [ - "TraceService.__init__", - "TraceService.store", - "TraceService.step" - ], - "path_symbol_ids": [ - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "c44bfbc66cf747283f30088da3e011a10395031d41e77b74e523c24997f641ca" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "class TraceRecordWriter:\n def __init__(self, transport: TraceTransport) -> None:\n self._logger = logging.getLogger(__name__)\n self._transport = transport\n\n def write_context(self, record: TraceContextRecord) -> None:\n try:\n self._transport.write_context(record)\n except Exception:\n self._logger.exception(\"Trace transport failed to write context %s\", record.trace_id)\n\n def write_message(self, record: TraceLogMessage) -> None:\n try:\n self._transport.write_message(record)\n except Exception:\n self._logger.exception(\"Trace transport failed to write message for %s\", record.trace_id)", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/tracing/service.py:TraceRecordWriter", - "span_start": 21, - "span_end": 36, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.tracing.service", - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "class TraceService(TraceContextFactory):\n def __init__(self, transport: TraceTransport | None = None, store: TraceContextStore | None = None) -> None:\n self.transport = transport or NoOpTraceTransport()\n self.store = store or TraceContextStore()\n self._writer = TraceRecordWriter(self.transport)\n\n def create_context(\n self,\n *,\n alias: str,\n parent_id: str | None = None,\n kind: str | None = None,\n attrs: dict[str, Any] | None = None,\n ) -> str:\n record = TraceContextRecord(\n trace_id=uuid4().hex,\n alias=str(alias or \"\"),\n parent_id=parent_id,\n type=kind,\n event_time=utc_now(),\n attrs=dict(attrs or {}),\n )\n self.store.push(record)\n self._writer.write_context(record)\n return record.trace_id\n\n @contextmanager\n def open_context(\n self,\n *,\n alias: str,\n parent_id: str | None = None,\n kind: str | None = None,\n attrs: dict[str, Any] | None = None,\n ) -> Iterator[str]:\n trace_id = self.create_context(alias=alias, parent_id=parent_id, kind=kind, attrs=attrs)\n try:\n yield trace_id\n finally:\n self.store.pop()\n\n def current_trace_id(self) -> str | None:\n return self.store.current_trace_id()\n\n def close_context(self) -> str | None:\n previous = self.store.pop()\n return previous.record.trace_id if previous else None\n\n def step(self, name: str) -> None:\n self.store.set_step(str(name or \"\"))\n\n def info(self, message: str, *, status: str | None = None, attrs: dict[str, Any] | None = None) -> None:\n self._write_message(\"INFO\", message, status, attrs)\n\n def debug(self, message: str, *, status: str | None = None, attrs: dict[str, Any] | None = None) -> None:\n self._write_message(\"DEBUG\", message, status, attrs)\n\n def warning(self, message: str, *, status: str | None = None, attrs: dict[str, Any] | None = None) -> None:\n self._write_message(\"WARNING\", message, status, attrs)\n\n def error(self, message: str, *, status: str | None = None, attrs: dict[str, Any] | None = None) -> None:\n self._write_message(\"ERROR\", message, status, attrs)\n\n def exception(self, message: str, *, status: str = \"failed\", attrs: dict[str, Any] | None = None) -> None:\n self._write_message(\"ERROR\", message, status, attrs)\n\n def new_root(self, operation: str) -> TraceContext:\n trace_id = self.create_context(alias=operation, kind=\"operation\", attrs={\"operation\": operation})\n return TraceContext(trace_id=trace_id, span_id=trace_id, attributes={\"operation\": operation})\n\n def child_of(self, parent: TraceContext, operation: str) -> TraceContext:\n trace_id = self.create_context(\n alias=operation,\n parent_id=parent.trace_id,\n kind=\"worker\",\n attrs={\"operation\": operation},\n )\n return TraceContext(\n trace_id=trace_id,\n span_id=trace_id,\n parent_span_id=parent.span_id,\n attributes={\"operation\": operation},\n )\n\n def attach(self, metadata: dict[str, object], context: TraceContext) -> dict[str, object]:\n updated = dict(metadata)\n updated[\"trace_id\"] = context.trace_id\n updated[\"span_id\"] = context.span_id\n updated[\"parent_span_id\"] = context.parent_span_id\n return updated\n\n def resume(self, metadata: dict[str, object], operation: str) -> TraceContext:\n trace_id = str(metadata.get(\"trace_id\") or uuid4().hex)\n span_id = str(metadata.get(\"span_id\") or trace_id)\n parent_id = metadata.get(\"parent_span_id\")\n self.create_context(\n alias=operation,\n parent_id=str(parent_id) if parent_id else None,\n kind=\"worker\",\n attrs=dict(metadata),\n )\n return TraceContext(\n trace_id=trace_id,\n span_id=span_id,\n parent_span_id=str(parent_id) if parent_id else None,\n attributes={\"operation\": operation},\n )\n\n def _write_message(\n self,\n level: TraceLevel,\n message: str,\n status: str | None,\n attrs: dict[str, Any] | None,\n ) -> None:\n active = self.store.current()\n if active is None:\n raise RuntimeError(\"Trace context is not bound. Call create_context() first.\")\n record = TraceLogMessage(\n trace_id=active.record.trace_id,\n step=active.step,\n status=str(status or \"\"),\n message=str(message or \"\"),\n level=level,\n event_time=utc_now(),\n attrs=dict(attrs or {}),\n )\n self._writer.write_message(record)", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/tracing/service.py:TraceService", - "span_start": 39, - "span_end": 166, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 1, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.tracing.service", - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "class TraceManager(TraceService):\n \"\"\"Compatibility alias during the transition from ConfigManager-shaped naming.\"\"\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/tracing/service.py:TraceManager", - "span_start": 169, - "span_end": 170, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 2, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.tracing.service", - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "llm_answer": "## Анализ архитектуры и поведения `TraceService`\n\n### 1. Описание `TraceService`\n`TraceService` — это класс, представляющий собой сервисную компоненту приложения, которая участвует в управлении трассировкой выполнения различных процессов внутри системы. Он наследует от класса `TraceContextFactory`, что указывает на его ответственность за создание и управление контекстом трассировки.\n\n### 2. Роли и обязанности компонента\nВ рамках общей архитектуры компонентов системы, `TraceService` играет роль `pipeline_stage`. Это означает, что он является одним из этапов общего конвейера обработки данных или задач в системе. \n\n#### Основные обязанности:\n- **Чтение и запись состояния атрибутов**: Взаимодействие с состоянием приложения через чтение и запись атрибутов.\n- **Участие в разделах потока данных**: Указано, что данный компонент участвует в 13 разных разделах потоков данных. Эти потоки данных являются частями общего процесса выполнения задач или работы сервиса.\n\n### 3. Место в общей архитектуре\n- **Связь с другими компонентами**:\n - `UvicornThreadRunner`: отвечает за запуск HTTP-сервера и выполнение запросов. Имеет аналогичную роль и обязанности как у `TraceService`.\n - `WorkflowPersistence`: ответственен за оркестровку вызовов ролей и участие в потоках данных (участвует в 16 разделах).\n - `HttpControlChannel`: занимается управлением каналами HTTP-контроля и взаимодействием с ними.\n - `InMemoryTaskQueue`: управляет очередями задач и их выполнением.\n\nВсе перечисленные компоненты являются частью единого конвейера обработки и участвуют в общих процессах обмена данными и управления задачами.\n\n### 4. Поток данных\nПотоки данных описывают последовательность операций и шагов, которые выполняются системой для достижения определенного результата. Участие каждого компонента в этих потоках обеспечивает целостность и согласованность всей системы при выполнении задач.\n\n### Итоговое объяснение работы `TraceService`\n\n`TraceService` является специализированным компонентом системы, отвечающим за управление контекстом трассировки и участие в общем потоке данных. Его основная задача — обеспечивать корректное отслеживание и ведение контекста выполнения задач, обеспечивая прозрачность и возможность анализа этих задач.\n\nЭтот компонент интегрируется в общую инфраструктуру системы, участвуя в нескольких потоках данных, обеспечивая согласованное взаимодействие между различными компонентами системы.", - "summary": { - "router": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "confidence": null - }, - "retrieval": { - "profile": "code", - "layers_hit": [ - "C0_SOURCE_CHUNKS", - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS", - "C4_SEMANTIC_ROLES" - ], - "evidence_sufficient": true - }, - "llm": { - "answer_status": "answered", - "groundedness": "grounded" - } - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "TraceService" - ], - "keyword_hints": [ - "TraceService" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C0_SOURCE_CHUNKS": "exact_path_fetch", - "C4_SEMANTIC_ROLES": "exact_path_fetch", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C3_ENTRYPOINTS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 8, - "C4_SEMANTIC_ROLES": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C3_ENTRYPOINTS": 6 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C4_SEMANTIC_ROLES": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "TraceService", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Как работает TraceService?", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C4_SEMANTIC_ROLES", - "query": "Как работает TraceService?", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "Как работает TraceService?", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - }, - { - "layer": "C3_ENTRYPOINTS", - "query": "Как работает TraceService?", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 1, - "candidates_after_filter": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 6, - "candidates_after_filter": 6 - }, - { - "layer": "C3_ENTRYPOINTS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 3, - "candidates_after_filter": 3 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "TraceService", - "alternatives": [ - "TraceService" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 3, - "fail_reason": null - }, - { - "layer": "C4_SEMANTIC_ROLES", - "status": "hit", - "hit_count": 8, - "fail_reason": null - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 6, - "fail_reason": null - }, - { - "layer": "C3_ENTRYPOINTS", - "status": "hit", - "hit_count": 3, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "router": 0, - "symbol_resolution": 0, - "retrieval_total": 130, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 29, - "C0_SOURCE_CHUNKS": 14, - "C4_SEMANTIC_ROLES": 14, - "C2_DEPENDENCY_GRAPH": 47, - "C3_ENTRYPOINTS": 23 - }, - "merge_rank": 24, - "prompt_build": 0, - "llm_call": 5323 - }, - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 371, - "evidence_rows": 21, - "evidence_chars": 7281 - }, - "evidence_summary": [ - { - "layer": "C1_SYMBOL_CATALOG", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "count": 8, - "unique_paths": 8 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "count": 6, - "unique_paths": 1 - }, - { - "layer": "C3_ENTRYPOINTS", - "count": 3, - "unique_paths": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 3, - "unique_paths": 1 - } - ], - "prompt_template_id": "intent_code_qa_v1", - "system_prompt_version": "v1" - }, - "router": { - "conversation_mode": "START", - "keyword_hints": [ - "TraceService" - ], - "path_scope": [] - }, - "llm": { - "used_evidence_count": 21, - "missing_evidence_reason": null - } - }, - "run_info": { - "case_id": "plba-fullchain-explain-trace-service", - "mode": "full_chain", - "run_started_at": "2026-03-12T09:13:14", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - }, - "input_request": { - "text": "Как работает TraceService?", - "normalized_query": "Как работает TraceService?" - }, - "steps": [ - { - "step": "intent_router", - "input": { - "query": "Как работает TraceService?" - }, - "output": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Как работает TraceService?" - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "TraceService" - ], - "keyword_hints": [ - "TraceService" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "timings_ms": { - "router": 0 - } - } - }, - { - "step": "retrieval", - "input": { - "query": "Как работает TraceService?" - }, - "output": { - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "TraceService", - "alternatives": [ - "TraceService" - ], - "confidence": 0.99 - }, - "rag_count": 21, - "rag_rows": [ - { - "path": "src/app_runtime/tracing/service.py", - "content": "class TraceService\nTraceService(TraceContextFactory)", - "layer": "C1_SYMBOL_CATALOG", - "title": "TraceService", - "span_start": 39, - "span_end": 166, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "c2b2b976d99f2c600000b753731b26e0a69adcb4359398b93073590c5d5d04f4", - "qname": "TraceService", - "kind": "class", - "signature": "TraceService(TraceContextFactory)", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.tracing.service", - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "TraceService\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests service\n- reads and writes state attributes\n- participates in dataflow slices (13)", - "layer": "C4_SEMANTIC_ROLES", - "title": "TraceService", - "span_start": 39, - "span_end": 166, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 60, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "c2b2b976d99f2c600000b753731b26e0a69adcb4359398b93073590c5d5d04f4", - "symbol_name": "TraceService", - "qname": "TraceService", - "role": "pipeline_stage", - "confidence": 0.57, - "dataflow_participation": 13, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_runner.py", - "content": "UvicornThreadRunner\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (24)", - "layer": "C4_SEMANTIC_ROLES", - "title": "UvicornThreadRunner", - "span_start": 10, - "span_end": 61, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 11, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "fd55630045a02100df8877ac27d951ee08617d4598764394d48cb51fe067476a", - "symbol_name": "UvicornThreadRunner", - "qname": "UvicornThreadRunner", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 24, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "3779fdd2878b770e789a35bb2a89c9d79f13b61c26d7db1b3b683f9bb9e1623f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/persistence/workflow_persistence.py", - "content": "WorkflowPersistence\nrole: pipeline_stage\n\nResponsibilities:\n- orchestrates role-like calls (2)\n- reads and writes state attributes\n- participates in dataflow slices (16)", - "layer": "C4_SEMANTIC_ROLES", - "title": "WorkflowPersistence", - "span_start": 8, - "span_end": 54, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 15, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "7bd01ee45cf31f2d5c2e3e51656254860ac785d10cef9e0852cd4fba90857bae", - "symbol_name": "WorkflowPersistence", - "qname": "WorkflowPersistence", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 16, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "80e9410ddc639789b4353c2a1a757ba8d0d5b5bb6075b0b263b61551f04ae1f0", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (10)", - "layer": "C4_SEMANTIC_ROLES", - "title": "HttpControlChannel", - "span_start": 12, - "span_end": 57, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 21, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "1c9fbdc24819e5604c26ea55428a74310f03a03e1af197ed84846af61e42fdb0", - "symbol_name": "HttpControlChannel", - "qname": "HttpControlChannel", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 10, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/queue/in_memory.py", - "content": "InMemoryTaskQueue\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (9)", - "layer": "C4_SEMANTIC_ROLES", - "title": "InMemoryTaskQueue", - "span_start": 9, - "span_end": 38, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 22, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "2da04cb94544a3bcbf0943a95ad4bdd8710bcafaa32a02fd0e4de2178dcf3533", - "symbol_name": "InMemoryTaskQueue", - "qname": "InMemoryTaskQueue", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 9, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "58f0cc001ccda0eee4c6bc32ed83bd05eafd6b6644f1e8b4aa9eed3103db73dc", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/config/file_loader.py", - "content": "ConfigFileLoader\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (8)", - "layer": "C4_SEMANTIC_ROLES", - "title": "ConfigFileLoader", - "span_start": 11, - "span_end": 48, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 23, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "a8474eca8b6e9dc86ae67ed68b16fa5fb639ef08739c053e7b7195489765667f", - "symbol_name": "ConfigFileLoader", - "qname": "ConfigFileLoader", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 8, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "1f19ffebde5e38e4be5a5d5a678059a0f36dedb8fb8b3e00ab395c67106a87ea", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/store.py", - "content": "TraceContextStore\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (6)", - "layer": "C4_SEMANTIC_ROLES", - "title": "TraceContextStore", - "span_start": 15, - "span_end": 52, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 25, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "b2dad4fbe16ffb11b58deba311c7739955c39d59f291b22181f33e9c8cce4059", - "symbol_name": "TraceContextStore", - "qname": "TraceContextStore", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 6, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "d369554f08fc92039c6edd5a2a1e73b23901533e8974459170bbd9347d263dc5", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workers/supervisor.py", - "content": "WorkerSupervisor\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (6)", - "layer": "C4_SEMANTIC_ROLES", - "title": "WorkerSupervisor", - "span_start": 10, - "span_end": 59, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 25, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "c17b44e8d9e97d490989b21fa67d7c346cdda8a0472e4c41fb243c8846faa124", - "symbol_name": "WorkerSupervisor", - "qname": "WorkerSupervisor", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 6, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "77609d9d5927171cce7fc3a54897c183fd63068710c6362029b700937aae5eee", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "TraceService.__init__\n -> TraceService.store\n -> TraceService.create_context", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "TraceService.__init__:dataflow_slice", - "span_start": 42, - "span_end": 61, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "3b052062067a78aef3302ee1d996897e02a67d1b340397bea4f59fe147c0492a", - "edge_type": "dataflow_slice", - "src_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "src_qname": "TraceService.__init__", - "dst_symbol_id": "ff44881104b65ef50ee6fe16d367d4a81b6e7eb5c44c0963cf4543faec785d4a", - "dst_ref": "TraceService.create_context", - "resolution": "resolved", - "slice_id": "3b052062067a78aef3302ee1d996897e02a67d1b340397bea4f59fe147c0492a", - "root_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "path_symbols": [ - "TraceService.__init__", - "TraceService.store", - "TraceService.create_context" - ], - "path_symbol_ids": [ - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "ff44881104b65ef50ee6fe16d367d4a81b6e7eb5c44c0963cf4543faec785d4a" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "TraceService.__init__\n -> TraceService.store\n -> TraceService.close_context", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "TraceService.__init__:dataflow_slice", - "span_start": 42, - "span_end": 84, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "7a9353ef57c9ae5d19b3a0c6ac50fad05e6d21d31bbe1cd1cd07af6332ba6505", - "edge_type": "dataflow_slice", - "src_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "src_qname": "TraceService.__init__", - "dst_symbol_id": "01e14158dcced7e52d0c8ac84ac7b9a75225c261b6aca6a1d7da802d0994721c", - "dst_ref": "TraceService.close_context", - "resolution": "resolved", - "slice_id": "7a9353ef57c9ae5d19b3a0c6ac50fad05e6d21d31bbe1cd1cd07af6332ba6505", - "root_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "path_symbols": [ - "TraceService.__init__", - "TraceService.store", - "TraceService.close_context" - ], - "path_symbol_ids": [ - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "01e14158dcced7e52d0c8ac84ac7b9a75225c261b6aca6a1d7da802d0994721c" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "TraceService.__init__\n -> TraceService.store\n -> TraceService.open_context", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "TraceService.__init__:dataflow_slice", - "span_start": 42, - "span_end": 78, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "a6e13b9ebc4fed84586afd53ed92a4d14757e440873f572b2337d5622ee96031", - "edge_type": "dataflow_slice", - "src_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "src_qname": "TraceService.__init__", - "dst_symbol_id": "2da3d5b20a947bf63e14c103be4689b72fd837e0a82abd6c497846375d4c7426", - "dst_ref": "TraceService.open_context", - "resolution": "resolved", - "slice_id": "a6e13b9ebc4fed84586afd53ed92a4d14757e440873f572b2337d5622ee96031", - "root_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "path_symbols": [ - "TraceService.__init__", - "TraceService.store", - "TraceService.open_context" - ], - "path_symbol_ids": [ - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "2da3d5b20a947bf63e14c103be4689b72fd837e0a82abd6c497846375d4c7426" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "TraceService.__init__\n -> TraceService.transport\n -> TraceService.__init__", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "TraceService.__init__:dataflow_slice", - "span_start": 41, - "span_end": 43, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "1e923a93faa05c3c43ca9b19bd047007a8589ccce57d3cc1798ae7f9f200af98", - "edge_type": "dataflow_slice", - "src_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "src_qname": "TraceService.__init__", - "dst_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "dst_ref": "TraceService.__init__", - "resolution": "resolved", - "slice_id": "1e923a93faa05c3c43ca9b19bd047007a8589ccce57d3cc1798ae7f9f200af98", - "root_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "path_symbols": [ - "TraceService.__init__", - "TraceService.transport", - "TraceService.__init__" - ], - "path_symbol_ids": [ - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "TraceService.__init__\n -> TraceService.store\n -> TraceService.current_trace_id", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "TraceService.__init__:dataflow_slice", - "span_start": 42, - "span_end": 81, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "3ea17138634b1190bded77ddb84aa1595124f6519b246f24fc4b02bd62b5cac1", - "edge_type": "dataflow_slice", - "src_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "src_qname": "TraceService.__init__", - "dst_symbol_id": "41135180f7b3b9ab20e097e0747474e219c37dd2366ef08a7b43c1f3edb10b4c", - "dst_ref": "TraceService.current_trace_id", - "resolution": "resolved", - "slice_id": "3ea17138634b1190bded77ddb84aa1595124f6519b246f24fc4b02bd62b5cac1", - "root_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "path_symbols": [ - "TraceService.__init__", - "TraceService.store", - "TraceService.current_trace_id" - ], - "path_symbol_ids": [ - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "41135180f7b3b9ab20e097e0747474e219c37dd2366ef08a7b43c1f3edb10b4c" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "TraceService.__init__\n -> TraceService.store\n -> TraceService.step", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "TraceService.__init__:dataflow_slice", - "span_start": 42, - "span_end": 88, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "9f34c5da9b09fba99df6f6b1bde183a9aeb45111b8218a747c71590c2c9f60f2", - "edge_type": "dataflow_slice", - "src_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "src_qname": "TraceService.__init__", - "dst_symbol_id": "c44bfbc66cf747283f30088da3e011a10395031d41e77b74e523c24997f641ca", - "dst_ref": "TraceService.step", - "resolution": "resolved", - "slice_id": "9f34c5da9b09fba99df6f6b1bde183a9aeb45111b8218a747c71590c2c9f60f2", - "root_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "path_symbols": [ - "TraceService.__init__", - "TraceService.store", - "TraceService.step" - ], - "path_symbol_ids": [ - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "c44bfbc66cf747283f30088da3e011a10395031d41e77b74e523c24997f641ca" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "class TraceRecordWriter:\n def __init__(self, transport: TraceTransport) -> None:\n self._logger = logging.getLogger(__name__)\n self._transport = transport\n\n def write_context(self, record: TraceContextRecord) -> None:\n try:\n self._transport.write_context(record)\n except Exception:\n self._logger.exception(\"Trace transport failed to write context %s\", record.trace_id)\n\n def write_message(self, record: TraceLogMessage) -> None:\n try:\n self._transport.write_message(record)\n except Exception:\n self._logger.exception(\"Trace transport failed to write message for %s\", record.trace_id)", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/tracing/service.py:TraceRecordWriter", - "span_start": 21, - "span_end": 36, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.tracing.service", - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "class TraceService(TraceContextFactory):\n def __init__(self, transport: TraceTransport | None = None, store: TraceContextStore | None = None) -> None:\n self.transport = transport or NoOpTraceTransport()\n self.store = store or TraceContextStore()\n self._writer = TraceRecordWriter(self.transport)\n\n def create_context(\n self,\n *,\n alias: str,\n parent_id: str | None = None,\n kind: str | None = None,\n attrs: dict[str, Any] | None = None,\n ) -> str:\n record = TraceContextRecord(\n trace_id=uuid4().hex,\n alias=str(alias or \"\"),\n parent_id=parent_id,\n type=kind,\n event_time=utc_now(),\n attrs=dict(attrs or {}),\n )\n self.store.push(record)\n self._writer.write_context(record)\n return record.trace_id\n\n @contextmanager\n def open_context(\n self,\n *,\n alias: str,\n parent_id: str | None = None,\n kind: str | None = None,\n attrs: dict[str, Any] | None = None,\n ) -> Iterator[str]:\n trace_id = self.create_context(alias=alias, parent_id=parent_id, kind=kind, attrs=attrs)\n try:\n yield trace_id\n finally:\n self.store.pop()\n\n def current_trace_id(self) -> str | None:\n return self.store.current_trace_id()\n\n def close_context(self) -> str | None:\n previous = self.store.pop()\n return previous.record.trace_id if previous else None\n\n def step(self, name: str) -> None:\n self.store.set_step(str(name or \"\"))\n\n def info(self, message: str, *, status: str | None = None, attrs: dict[str, Any] | None = None) -> None:\n self._write_message(\"INFO\", message, status, attrs)\n\n def debug(self, message: str, *, status: str | None = None, attrs: dict[str, Any] | None = None) -> None:\n self._write_message(\"DEBUG\", message, status, attrs)\n\n def warning(self, message: str, *, status: str | None = None, attrs: dict[str, Any] | None = None) -> None:\n self._write_message(\"WARNING\", message, status, attrs)\n\n def error(self, message: str, *, status: str | None = None, attrs: dict[str, Any] | None = None) -> None:\n self._write_message(\"ERROR\", message, status, attrs)\n\n def exception(self, message: str, *, status: str = \"failed\", attrs: dict[str, Any] | None = None) -> None:\n self._write_message(\"ERROR\", message, status, attrs)\n\n def new_root(self, operation: str) -> TraceContext:\n trace_id = self.create_context(alias=operation, kind=\"operation\", attrs={\"operation\": operation})\n return TraceContext(trace_id=trace_id, span_id=trace_id, attributes={\"operation\": operation})\n\n def child_of(self, parent: TraceContext, operation: str) -> TraceContext:\n trace_id = self.create_context(\n alias=operation,\n parent_id=parent.trace_id,\n kind=\"worker\",\n attrs={\"operation\": operation},\n )\n return TraceContext(\n trace_id=trace_id,\n span_id=trace_id,\n parent_span_id=parent.span_id,\n attributes={\"operation\": operation},\n )\n\n def attach(self, metadata: dict[str, object], context: TraceContext) -> dict[str, object]:\n updated = dict(metadata)\n updated[\"trace_id\"] = context.trace_id\n updated[\"span_id\"] = context.span_id\n updated[\"parent_span_id\"] = context.parent_span_id\n return updated\n\n def resume(self, metadata: dict[str, object], operation: str) -> TraceContext:\n trace_id = str(metadata.get(\"trace_id\") or uuid4().hex)\n span_id = str(metadata.get(\"span_id\") or trace_id)\n parent_id = metadata.get(\"parent_span_id\")\n self.create_context(\n alias=operation,\n parent_id=str(parent_id) if parent_id else None,\n kind=\"worker\",\n attrs=dict(metadata),\n )\n return TraceContext(\n trace_id=trace_id,\n span_id=span_id,\n parent_span_id=str(parent_id) if parent_id else None,\n attributes={\"operation\": operation},\n )\n\n def _write_message(\n self,\n level: TraceLevel,\n message: str,\n status: str | None,\n attrs: dict[str, Any] | None,\n ) -> None:\n active = self.store.current()\n if active is None:\n raise RuntimeError(\"Trace context is not bound. Call create_context() first.\")\n record = TraceLogMessage(\n trace_id=active.record.trace_id,\n step=active.step,\n status=str(status or \"\"),\n message=str(message or \"\"),\n level=level,\n event_time=utc_now(),\n attrs=dict(attrs or {}),\n )\n self._writer.write_message(record)", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/tracing/service.py:TraceService", - "span_start": 39, - "span_end": 166, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 1, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.tracing.service", - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "class TraceManager(TraceService):\n \"\"\"Compatibility alias during the transition from ConfigManager-shaped naming.\"\"\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/tracing/service.py:TraceManager", - "span_start": 169, - "span_end": 170, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 2, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.tracing.service", - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ] - }, - "diagnostics": { - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C0_SOURCE_CHUNKS": "exact_path_fetch", - "C4_SEMANTIC_ROLES": "exact_path_fetch", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C3_ENTRYPOINTS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 8, - "C4_SEMANTIC_ROLES": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C3_ENTRYPOINTS": 6 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C4_SEMANTIC_ROLES": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "TraceService", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Как работает TraceService?", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C4_SEMANTIC_ROLES", - "query": "Как работает TraceService?", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "Как работает TraceService?", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - }, - { - "layer": "C3_ENTRYPOINTS", - "query": "Как работает TraceService?", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 1, - "candidates_after_filter": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 6, - "candidates_after_filter": 6 - }, - { - "layer": "C3_ENTRYPOINTS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 3, - "candidates_after_filter": 3 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "TraceService", - "alternatives": [ - "TraceService" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 3, - "fail_reason": null - }, - { - "layer": "C4_SEMANTIC_ROLES", - "status": "hit", - "hit_count": 8, - "fail_reason": null - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 6, - "fail_reason": null - }, - { - "layer": "C3_ENTRYPOINTS", - "status": "hit", - "hit_count": 3, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "symbol_resolution": 0, - "retrieval_total": 130, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 29, - "C0_SOURCE_CHUNKS": 14, - "C4_SEMANTIC_ROLES": 14, - "C2_DEPENDENCY_GRAPH": 47, - "C3_ENTRYPOINTS": 23 - }, - "merge_rank": 24 - } - } - }, - { - "step": "llm_answer", - "input": { - "query": "Как работает TraceService?", - "rag_count": 21 - }, - "output": { - "llm_answer": "## Анализ архитектуры и поведения `TraceService`\n\n### 1. Описание `TraceService`\n`TraceService` — это класс, представляющий собой сервисную компоненту приложения, которая участвует в управлении трассировкой выполнения различных процессов внутри системы. Он наследует от класса `TraceContextFactory`, что указывает на его ответственность за создание и управление контекстом трассировки.\n\n### 2. Роли и обязанности компонента\nВ рамках общей архитектуры компонентов системы, `TraceService` играет роль `pipeline_stage`. Это означает, что он является одним из этапов общего конвейера обработки данных или задач в системе. \n\n#### Основные обязанности:\n- **Чтение и запись состояния атрибутов**: Взаимодействие с состоянием приложения через чтение и запись атрибутов.\n- **Участие в разделах потока данных**: Указано, что данный компонент участвует в 13 разных разделах потоков данных. Эти потоки данных являются частями общего процесса выполнения задач или работы сервиса.\n\n### 3. Место в общей архитектуре\n- **Связь с другими компонентами**:\n - `UvicornThreadRunner`: отвечает за запуск HTTP-сервера и выполнение запросов. Имеет аналогичную роль и обязанности как у `TraceService`.\n - `WorkflowPersistence`: ответственен за оркестровку вызовов ролей и участие в потоках данных (участвует в 16 разделах).\n - `HttpControlChannel`: занимается управлением каналами HTTP-контроля и взаимодействием с ними.\n - `InMemoryTaskQueue`: управляет очередями задач и их выполнением.\n\nВсе перечисленные компоненты являются частью единого конвейера обработки и участвуют в общих процессах обмена данными и управления задачами.\n\n### 4. Поток данных\nПотоки данных описывают последовательность операций и шагов, которые выполняются системой для достижения определенного результата. Участие каждого компонента в этих потоках обеспечивает целостность и согласованность всей системы при выполнении задач.\n\n### Итоговое объяснение работы `TraceService`\n\n`TraceService` является специализированным компонентом системы, отвечающим за управление контекстом трассировки и участие в общем потоке данных. Его основная задача — обеспечивать корректное отслеживание и ведение контекста выполнения задач, обеспечивая прозрачность и возможность анализа этих задач.\n\nЭтот компонент интегрируется в общую инфраструктуру системы, участвуя в нескольких потоках данных, обеспечивая согласованное взаимодействие между различными компонентами системы." - }, - "diagnostics": { - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 371, - "evidence_rows": 21, - "evidence_chars": 7281 - }, - "evidence_summary": [ - { - "layer": "C1_SYMBOL_CATALOG", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "count": 8, - "unique_paths": 8 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "count": 6, - "unique_paths": 1 - }, - { - "layer": "C3_ENTRYPOINTS", - "count": 3, - "unique_paths": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 3, - "unique_paths": 1 - } - ], - "prompt_template_id": "intent_code_qa_v1", - "system_prompt_version": "v1" - }, - "timings_ms": { - "prompt_build": 0, - "llm_call": 5323 - } - } - } - ] - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_091314/full_chain_plba_code_retrieval_plba-fullchain-explain-trace-service.md b/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_091314/full_chain_plba_code_retrieval_plba-fullchain-explain-trace-service.md deleted file mode 100644 index b5e059b..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_091314/full_chain_plba_code_retrieval_plba-fullchain-explain-trace-service.md +++ /dev/null @@ -1,34 +0,0 @@ -# plba-fullchain-explain-trace-service - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_retrieval.yaml -- runner: runtime -- mode: full_chain -- passed: True - -## Query -Как работает TraceService? - -## Actual -{ - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 21, - "llm_answer": "## Анализ архитектуры и поведения `TraceService`\n\n### 1. Описание `TraceService`\n`TraceService` — это класс, представляющий собой сервисную компоненту приложения, которая участвует в управлении трассировкой выполнения различных процессов внутри системы. Он наследует от класса `TraceContextFactory`, что указывает на его ответственность за создание и управление контекстом трассировки.\n\n### 2. Роли и обязанности компонента\nВ рамках общей архитектуры компонентов системы, `TraceService` играет роль `pipeline_stage`. Это означает, что он является одним из этапов общего конвейера обработки данных или задач в системе. \n\n#### Основные обязанности:\n- **Чтение и запись состояния атрибутов**: Взаимодействие с состоянием приложения через чтение и запись атрибутов.\n- **Участие в разделах потока данных**: Указано, что данный компонент участвует в 13 разных разделах потоков данных. Эти потоки данных являются частями общего процесса выполнения задач или работы сервиса.\n\n### 3. Место в общей архитектуре\n- **Связь с другими компонентами**:\n - `UvicornThreadRunner`: отвечает за запуск HTTP-сервера и выполнение запросов. Имеет аналогичную роль и обязанности как у `TraceService`.\n - `WorkflowPersistence`: ответственен за оркестровку вызовов ролей и участие в потоках данных (участвует в 16 разделах).\n - `HttpControlChannel`: занимается управлением каналами HTTP-контроля и взаимодействием с ними.\n - `InMemoryTaskQueue`: управляет очередями задач и их выполнением.\n\nВсе перечисленные компоненты являются частью единого конвейера обработки и участвуют в общих процессах обмена данными и управления задачами.\n\n### 4. Поток данных\nПотоки данных описывают последовательность операций и шагов, которые выполняются системой для достижения определенного результата. Участие каждого компонента в этих потоках обеспечивает целостность и согласованность всей системы при выполнении задач.\n\n### Итоговое объяснение работы `TraceService`\n\n`TraceService` является специализированным компонентом системы, отвечающим за управление контекстом трассировки и участие в общем потоке данных. Его основная задача — обеспечивать корректное отслеживание и ведение контекста выполнения задач, обеспечивая прозрачность и возможность анализа этих задач.\n\nЭтот компонент интегрируется в общую инфраструктуру системы, участвуя в нескольких потоках данных, обеспечивая согласованное взаимодействие между различными компонентами системы.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "TraceService" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] -} - -## Mismatches -- none \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_091314/full_chain_plba_code_retrieval_plba-fullchain-explain-workflow-engine.json b/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_091314/full_chain_plba_code_retrieval_plba-fullchain-explain-workflow-engine.json deleted file mode 100644 index 42e40fa..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_091314/full_chain_plba_code_retrieval_plba-fullchain-explain-workflow-engine.json +++ /dev/null @@ -1,2634 +0,0 @@ -{ - "case_id": "plba-fullchain-explain-workflow-engine", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_retrieval.yaml", - "runner": "runtime", - "mode": "full_chain", - "actual": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 20, - "llm_answer": "## Архитектура и Поведение Workflow Engine\n\n### Описание класса `WorkflowEngine`\n\n`WorkflowEngine` является ключевым компонентом системы управления рабочими процессами или workflows в приложении. Этот компонент отвечает за координацию выполнения этапов рабочего процесса и отслеживание состояния задач.\n\n### Файлы и Сущности\n\n1. **src/app_runtime/workflow/engine/workflow_engine.py**\n - Класс `WorkflowEngine`: Основной класс для управления рабочим процессом.\n \n2. **src/app_runtime/workflow/engine/hooks.py**\n - Класс `WorkflowEngineHooks`: Представляет собой модель поведения (`model role`) для экземпляра WorkflowEngine. Он определяет общие \"точки входа\" (hooks) для обработки событий жизненного цикла WorkflowEngine, таких как начало и завершение различных стадий работы.\n \n3. **src/app_runtime/workflow/engine/transition_resolver.py**\n - Класс `TransitionResolver`: Является моделью (\"model role\") для разрешения переходов между различными этапами рабочего процесса на основе текущего состояния.\n\n4. **src/app_runtime/control/http_runner.py**\n - Класс `UvicornThreadRunner`: Используется для запуска веб-сервиса через uvicorn в отдельном потоке. Хотя он не напрямую связан с WorkflowEngine, его роль — это управление состоянием атрибутов и участие в общей структуре данных потока.\n\n---\n\n### Поток Данных и Ответственности\n\n#### 1. Основные обязанности WorkflowEngine:\n- Чтение и запись состояний атрибутов.\n- Участие в сегментах данных (dataflow slices).\n \n#### 2. Логика работы:\n- Экземпляр WorkflowEngine получает запросы от внешних источников (например, HTTP-запросы через UvicornThreadRunner) и обрабатывает их согласно текущему состоянию рабочего процесса.\n- Переходы между этапами определяются с помощью `TransitionResolver`, который анализирует текущее состояние задачи и разрешает дальнейшие действия.\n- Каждый этап рабочего процесса может иметь свои собственные обработчики (`hooks`), определенные в WorkflowEngineHooks, которые могут выполнять дополнительные логику до и после перехода.\n\n#### 3. Пример взаимодействия:\nПредположим, что рабочий процесс включает три этапа: подготовка, выполнение и проверка результата.\n\n1. Запрос приходит к WorkflowEngine через UvicornThreadRunner.\n2. WorkflowEngine проверяет текущее состояние и определяет следующий шаг (используя TransitionResolver).\n3. WorkflowEngine вызывает соответствующий hook перед выполнением следующего шага.\n4. После успешного завершения шага вызывается другой hook.\n5. Процесс повторяется до завершения всего рабочего процесса.\n\n---\n\n### Ключевые Методы и Атрибуты\n\n1. **Метод `run()`**:\n - Основная точка входа в экземпляр WorkflowEngine. Вызывается при старте приложения и управляет общим циклом выполнения рабочих процессов.\n\n2. **Атрибуты состояния**:\n - Хранят информацию о текущем состоянии задачи, такие как статус выполнения, идентификатор этапа и другие метаданные.\n\n---\n\n### Заключение\n\nТаким образом, WorkflowEngine является центральным элементом системы управления рабочими процессами, координирующим шаги выполнения, хранящим состояние рабочих задач и обеспечивая возможность расширения функционала через hooks и transition resolver'ы.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "WorkflowEngine" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "passed": true, - "mismatches": [], - "details": { - "case_id": "plba-fullchain-explain-workflow-engine", - "text": "Объясни класс WorkflowEngine", - "mode": "full_chain", - "run_started_at": "2026-03-12T09:13:14", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Объясни класс WorkflowEngine", - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "WorkflowEngine", - "alternatives": [ - "WorkflowEngine", - "WorkflowEngineHooks" - ], - "confidence": 0.99 - }, - "rag_count": 20, - "rag_rows": [ - { - "path": "src/app_runtime/workflow/engine/workflow_engine.py", - "content": "class WorkflowEngine\nWorkflowEngine", - "layer": "C1_SYMBOL_CATALOG", - "title": "WorkflowEngine", - "span_start": 10, - "span_end": 86, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "57ec0a9f11c542c78e008684a888397e8d9ef4223671acb2567e631a0cbc70b4", - "qname": "WorkflowEngine", - "kind": "class", - "signature": "WorkflowEngine", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.workflow.engine.workflow_engine", - "is_test": false, - "blob_sha": "1057136e58a325cd5ab6f4e265d15665fb6a711b7022d9fab52a1a290afa2368", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/engine/hooks.py", - "content": "class WorkflowEngineHooks\nWorkflowEngineHooks", - "layer": "C1_SYMBOL_CATALOG", - "title": "WorkflowEngineHooks", - "span_start": 6, - "span_end": 14, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "914123ed510540061e116100fc87bba4195595ba696f8bfde2fd77ac6a5cd7e4", - "qname": "WorkflowEngineHooks", - "kind": "class", - "signature": "WorkflowEngineHooks", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.workflow.engine.hooks", - "is_test": false, - "blob_sha": "4b11672b0a9af1ae04bfce9d8e1f96572997d3e65e68108d7c797b88fa5fa47a", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/engine/workflow_engine.py", - "content": "WorkflowEngine\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (6)", - "layer": "C4_SEMANTIC_ROLES", - "title": "WorkflowEngine", - "span_start": 10, - "span_end": 86, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 25, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "57ec0a9f11c542c78e008684a888397e8d9ef4223671acb2567e631a0cbc70b4", - "symbol_name": "WorkflowEngine", - "qname": "WorkflowEngine", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 6, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "1057136e58a325cd5ab6f4e265d15665fb6a711b7022d9fab52a1a290afa2368", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/engine/hooks.py", - "content": "WorkflowEngineHooks\nrole: model\n\nResponsibilities:\n- default model role", - "layer": "C4_SEMANTIC_ROLES", - "title": "WorkflowEngineHooks", - "span_start": 6, - "span_end": 14, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 40, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "914123ed510540061e116100fc87bba4195595ba696f8bfde2fd77ac6a5cd7e4", - "symbol_name": "WorkflowEngineHooks", - "qname": "WorkflowEngineHooks", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "4b11672b0a9af1ae04bfce9d8e1f96572997d3e65e68108d7c797b88fa5fa47a", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/engine/transition_resolver.py", - "content": "TransitionResolver\nrole: model\n\nResponsibilities:\n- default model role", - "layer": "C4_SEMANTIC_ROLES", - "title": "TransitionResolver", - "span_start": 7, - "span_end": 9, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 40, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "d1979f0b23d354338debf7771373226833d57c1e7830ce66ca0b82cdf209b958", - "symbol_name": "TransitionResolver", - "qname": "TransitionResolver", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "2c518f4c77fb5dcc2970b88f55a7b121d05959578fb0d196af92ff5193574838", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_runner.py", - "content": "UvicornThreadRunner\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (24)", - "layer": "C4_SEMANTIC_ROLES", - "title": "UvicornThreadRunner", - "span_start": 10, - "span_end": 61, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 11, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "fd55630045a02100df8877ac27d951ee08617d4598764394d48cb51fe067476a", - "symbol_name": "UvicornThreadRunner", - "qname": "UvicornThreadRunner", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 24, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "3779fdd2878b770e789a35bb2a89c9d79f13b61c26d7db1b3b683f9bb9e1623f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/persistence/workflow_persistence.py", - "content": "WorkflowPersistence\nrole: pipeline_stage\n\nResponsibilities:\n- orchestrates role-like calls (2)\n- reads and writes state attributes\n- participates in dataflow slices (16)", - "layer": "C4_SEMANTIC_ROLES", - "title": "WorkflowPersistence", - "span_start": 8, - "span_end": 54, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 15, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "7bd01ee45cf31f2d5c2e3e51656254860ac785d10cef9e0852cd4fba90857bae", - "symbol_name": "WorkflowPersistence", - "qname": "WorkflowPersistence", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 16, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "80e9410ddc639789b4353c2a1a757ba8d0d5b5bb6075b0b263b61551f04ae1f0", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (10)", - "layer": "C4_SEMANTIC_ROLES", - "title": "HttpControlChannel", - "span_start": 12, - "span_end": 57, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 21, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "1c9fbdc24819e5604c26ea55428a74310f03a03e1af197ed84846af61e42fdb0", - "symbol_name": "HttpControlChannel", - "qname": "HttpControlChannel", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 10, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/queue/in_memory.py", - "content": "InMemoryTaskQueue\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (9)", - "layer": "C4_SEMANTIC_ROLES", - "title": "InMemoryTaskQueue", - "span_start": 9, - "span_end": 38, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 22, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "2da04cb94544a3bcbf0943a95ad4bdd8710bcafaa32a02fd0e4de2178dcf3533", - "symbol_name": "InMemoryTaskQueue", - "qname": "InMemoryTaskQueue", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 9, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "58f0cc001ccda0eee4c6bc32ed83bd05eafd6b6644f1e8b4aa9eed3103db73dc", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/config/file_loader.py", - "content": "ConfigFileLoader\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (8)", - "layer": "C4_SEMANTIC_ROLES", - "title": "ConfigFileLoader", - "span_start": 11, - "span_end": 48, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 23, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "a8474eca8b6e9dc86ae67ed68b16fa5fb639ef08739c053e7b7195489765667f", - "symbol_name": "ConfigFileLoader", - "qname": "ConfigFileLoader", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 8, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "1f19ffebde5e38e4be5a5d5a678059a0f36dedb8fb8b3e00ab395c67106a87ea", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/engine/workflow_engine.py", - "content": "WorkflowEngine.__init__\n -> WorkflowEngine._transition_resolver\n -> WorkflowEngine.run", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "WorkflowEngine.__init__:dataflow_slice", - "span_start": 14, - "span_end": 63, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "3abf07e5c245e0fe59785ba2d569c2ee56018715fc7f625a044ddaf6201f903d", - "edge_type": "dataflow_slice", - "src_symbol_id": "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "src_qname": "WorkflowEngine.__init__", - "dst_symbol_id": "a12cad0f5b238287e02f6d8d156cc764351d8c83246930487fa09d5ce6f2ace8", - "dst_ref": "WorkflowEngine.run", - "resolution": "resolved", - "slice_id": "3abf07e5c245e0fe59785ba2d569c2ee56018715fc7f625a044ddaf6201f903d", - "root_symbol_id": "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "path_symbols": [ - "WorkflowEngine.__init__", - "WorkflowEngine._transition_resolver", - "WorkflowEngine.run" - ], - "path_symbol_ids": [ - "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "a12cad0f5b238287e02f6d8d156cc764351d8c83246930487fa09d5ce6f2ace8" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "1057136e58a325cd5ab6f4e265d15665fb6a711b7022d9fab52a1a290afa2368", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/engine/workflow_engine.py", - "content": "WorkflowEngine.__init__\n -> WorkflowEngine._hooks\n -> WorkflowEngine.run", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "WorkflowEngine.__init__:dataflow_slice", - "span_start": 16, - "span_end": 34, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "d73db644b69c1eb35afd6eae9d6ac8674e49e30e9bcf9c020f9fdbfe754851b2", - "edge_type": "dataflow_slice", - "src_symbol_id": "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "src_qname": "WorkflowEngine.__init__", - "dst_symbol_id": "a12cad0f5b238287e02f6d8d156cc764351d8c83246930487fa09d5ce6f2ace8", - "dst_ref": "WorkflowEngine.run", - "resolution": "resolved", - "slice_id": "d73db644b69c1eb35afd6eae9d6ac8674e49e30e9bcf9c020f9fdbfe754851b2", - "root_symbol_id": "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "path_symbols": [ - "WorkflowEngine.__init__", - "WorkflowEngine._hooks", - "WorkflowEngine.run" - ], - "path_symbol_ids": [ - "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "a12cad0f5b238287e02f6d8d156cc764351d8c83246930487fa09d5ce6f2ace8" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "1057136e58a325cd5ab6f4e265d15665fb6a711b7022d9fab52a1a290afa2368", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/engine/workflow_engine.py", - "content": "WorkflowEngine.__init__\n -> WorkflowEngine._workflow\n -> WorkflowEngine.run", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "WorkflowEngine.__init__:dataflow_slice", - "span_start": 12, - "span_end": 29, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "b45ef3c54669b4910a8aed3a565804f275424a24007bc7e3c953389521f80249", - "edge_type": "dataflow_slice", - "src_symbol_id": "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "src_qname": "WorkflowEngine.__init__", - "dst_symbol_id": "a12cad0f5b238287e02f6d8d156cc764351d8c83246930487fa09d5ce6f2ace8", - "dst_ref": "WorkflowEngine.run", - "resolution": "resolved", - "slice_id": "b45ef3c54669b4910a8aed3a565804f275424a24007bc7e3c953389521f80249", - "root_symbol_id": "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "path_symbols": [ - "WorkflowEngine.__init__", - "WorkflowEngine._workflow", - "WorkflowEngine.run" - ], - "path_symbol_ids": [ - "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "a12cad0f5b238287e02f6d8d156cc764351d8c83246930487fa09d5ce6f2ace8" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "1057136e58a325cd5ab6f4e265d15665fb6a711b7022d9fab52a1a290afa2368", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/engine/workflow_engine.py", - "content": "WorkflowEngine.__init__\n -> WorkflowEngine._persistence\n -> WorkflowEngine.run", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "WorkflowEngine.__init__:dataflow_slice", - "span_start": 13, - "span_end": 20, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "8101338770016324ce05d61daa9935a444c75e6c94a0fae4275d5b50fcbcc70b", - "edge_type": "dataflow_slice", - "src_symbol_id": "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "src_qname": "WorkflowEngine.__init__", - "dst_symbol_id": "a12cad0f5b238287e02f6d8d156cc764351d8c83246930487fa09d5ce6f2ace8", - "dst_ref": "WorkflowEngine.run", - "resolution": "resolved", - "slice_id": "8101338770016324ce05d61daa9935a444c75e6c94a0fae4275d5b50fcbcc70b", - "root_symbol_id": "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "path_symbols": [ - "WorkflowEngine.__init__", - "WorkflowEngine._persistence", - "WorkflowEngine.run" - ], - "path_symbol_ids": [ - "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "a12cad0f5b238287e02f6d8d156cc764351d8c83246930487fa09d5ce6f2ace8" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "1057136e58a325cd5ab6f4e265d15665fb6a711b7022d9fab52a1a290afa2368", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/engine/workflow_engine.py", - "content": "WorkflowEngine.__init__\n -> WorkflowEngine._traces\n -> WorkflowEngine.run", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "WorkflowEngine.__init__:dataflow_slice", - "span_start": 15, - "span_end": 27, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "5006266616d534d721648391565e2ac0c9e7e9d9f8df00c17fba8989afb533a5", - "edge_type": "dataflow_slice", - "src_symbol_id": "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "src_qname": "WorkflowEngine.__init__", - "dst_symbol_id": "a12cad0f5b238287e02f6d8d156cc764351d8c83246930487fa09d5ce6f2ace8", - "dst_ref": "WorkflowEngine.run", - "resolution": "resolved", - "slice_id": "5006266616d534d721648391565e2ac0c9e7e9d9f8df00c17fba8989afb533a5", - "root_symbol_id": "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "path_symbols": [ - "WorkflowEngine.__init__", - "WorkflowEngine._traces", - "WorkflowEngine.run" - ], - "path_symbol_ids": [ - "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "a12cad0f5b238287e02f6d8d156cc764351d8c83246930487fa09d5ce6f2ace8" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "1057136e58a325cd5ab6f4e265d15665fb6a711b7022d9fab52a1a290afa2368", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/engine/workflow_engine.py", - "content": "WorkflowEngine.__init__\n -> WorkflowEngine._logger\n -> WorkflowEngine.run", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "WorkflowEngine.__init__:dataflow_slice", - "span_start": 17, - "span_end": 85, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "2f9927abb24794adb056b94bfb5d8538a5cbafb160da2079f52fca97fd694a2b", - "edge_type": "dataflow_slice", - "src_symbol_id": "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "src_qname": "WorkflowEngine.__init__", - "dst_symbol_id": "a12cad0f5b238287e02f6d8d156cc764351d8c83246930487fa09d5ce6f2ace8", - "dst_ref": "WorkflowEngine.run", - "resolution": "resolved", - "slice_id": "2f9927abb24794adb056b94bfb5d8538a5cbafb160da2079f52fca97fd694a2b", - "root_symbol_id": "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "path_symbols": [ - "WorkflowEngine.__init__", - "WorkflowEngine._logger", - "WorkflowEngine.run" - ], - "path_symbol_ids": [ - "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "a12cad0f5b238287e02f6d8d156cc764351d8c83246930487fa09d5ce6f2ace8" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "1057136e58a325cd5ab6f4e265d15665fb6a711b7022d9fab52a1a290afa2368", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/engine/workflow_engine.py", - "content": "class WorkflowEngine:\n def __init__(self, workflow, persistence, *, traces, hooks: WorkflowEngineHooks | None = None) -> None:\n self._workflow = workflow\n self._persistence = persistence\n self._transition_resolver = TransitionResolver()\n self._traces = traces\n self._hooks = hooks or WorkflowEngineHooks()\n self._logger = logging.getLogger(__name__)\n\n def run(self, context: WorkflowContext) -> dict[str, object]:\n run_id = self._persistence.start_run(\n self._workflow.definition.name,\n self._workflow.definition.start_at,\n context.snapshot(),\n )\n context.state.setdefault(\"runtime\", {})\n context.state[\"runtime\"][\"workflow_run_id\"] = run_id\n self._traces.step(\"workflow\")\n self._traces.info(\"Workflow started.\", status=\"started\", attrs={\"workflow_run_id\": run_id})\n current_name = self._workflow.definition.start_at\n while current_name is not None:\n node = self._workflow.definition.nodes[current_name]\n context.state[\"runtime\"][\"current_node\"] = current_name\n self._logger.info(\"Workflow run %s: step '%s' started.\", run_id, current_name)\n self._hooks.on_step_started(context, current_name)\n self._persistence.start_step(run_id, current_name, context.snapshot())\n self._traces.step(current_name)\n self._traces.debug(\n f\"Step '{current_name}' started.\",\n status=\"started\",\n attrs={\"workflow_run_id\": run_id, \"node\": current_name},\n )\n try:\n result = node.step.run(context)\n except Exception as error:\n self._persistence.fail_step(run_id, current_name, context.snapshot(), error)\n self._persistence.fail_run(run_id, context.snapshot())\n self._traces.error(\n f\"Step '{current_name}' failed: {error}\",\n status=\"failed\",\n attrs={\"exception_type\": type(error).__name__},\n )\n self._logger.exception(\"Workflow run %s: step '%s' failed.\", run_id, current_name)\n self._hooks.on_step_failed(context, current_name)\n raise\n context.state.update(result.updates)\n self._persistence.complete_step(\n run_id,\n current_name,\n result.status,\n result.transition,\n context.snapshot(),\n )\n next_node = self._transition_resolver.resolve(node, result)\n self._traces.debug(\n f\"Step '{current_name}' completed with transition '{result.transition}'.\",\n status=result.status,\n attrs={\n \"workflow_run_id\": run_id,\n \"from_node\": current_name,\n \"transition\": result.transition,\n \"to_node\": next_node,\n },\n )\n self._logger.info(\n \"Workflow run %s: step '%s' completed with transition '%s'.\",\n run_id,\n current_name,\n result.transition,\n )\n self._hooks.on_step_finished(context, current_name)\n current_name = next_node\n self._persistence.complete_run(run_id, context.snapshot())\n self._traces.step(\"workflow\")\n self._traces.info(\"Workflow completed.\", status=\"completed\", attrs={\"workflow_run_id\": run_id})\n self._logger.info(\"Workflow run %s completed.\", run_id)\n return {\"run_id\": run_id, \"status\": \"completed\", \"context\": context.snapshot()}", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/workflow/engine/workflow_engine.py:WorkflowEngine", - "span_start": 10, - "span_end": 86, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.workflow.engine.workflow_engine", - "is_test": false, - "blob_sha": "1057136e58a325cd5ab6f4e265d15665fb6a711b7022d9fab52a1a290afa2368", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "llm_answer": "## Архитектура и Поведение Workflow Engine\n\n### Описание класса `WorkflowEngine`\n\n`WorkflowEngine` является ключевым компонентом системы управления рабочими процессами или workflows в приложении. Этот компонент отвечает за координацию выполнения этапов рабочего процесса и отслеживание состояния задач.\n\n### Файлы и Сущности\n\n1. **src/app_runtime/workflow/engine/workflow_engine.py**\n - Класс `WorkflowEngine`: Основной класс для управления рабочим процессом.\n \n2. **src/app_runtime/workflow/engine/hooks.py**\n - Класс `WorkflowEngineHooks`: Представляет собой модель поведения (`model role`) для экземпляра WorkflowEngine. Он определяет общие \"точки входа\" (hooks) для обработки событий жизненного цикла WorkflowEngine, таких как начало и завершение различных стадий работы.\n \n3. **src/app_runtime/workflow/engine/transition_resolver.py**\n - Класс `TransitionResolver`: Является моделью (\"model role\") для разрешения переходов между различными этапами рабочего процесса на основе текущего состояния.\n\n4. **src/app_runtime/control/http_runner.py**\n - Класс `UvicornThreadRunner`: Используется для запуска веб-сервиса через uvicorn в отдельном потоке. Хотя он не напрямую связан с WorkflowEngine, его роль — это управление состоянием атрибутов и участие в общей структуре данных потока.\n\n---\n\n### Поток Данных и Ответственности\n\n#### 1. Основные обязанности WorkflowEngine:\n- Чтение и запись состояний атрибутов.\n- Участие в сегментах данных (dataflow slices).\n \n#### 2. Логика работы:\n- Экземпляр WorkflowEngine получает запросы от внешних источников (например, HTTP-запросы через UvicornThreadRunner) и обрабатывает их согласно текущему состоянию рабочего процесса.\n- Переходы между этапами определяются с помощью `TransitionResolver`, который анализирует текущее состояние задачи и разрешает дальнейшие действия.\n- Каждый этап рабочего процесса может иметь свои собственные обработчики (`hooks`), определенные в WorkflowEngineHooks, которые могут выполнять дополнительные логику до и после перехода.\n\n#### 3. Пример взаимодействия:\nПредположим, что рабочий процесс включает три этапа: подготовка, выполнение и проверка результата.\n\n1. Запрос приходит к WorkflowEngine через UvicornThreadRunner.\n2. WorkflowEngine проверяет текущее состояние и определяет следующий шаг (используя TransitionResolver).\n3. WorkflowEngine вызывает соответствующий hook перед выполнением следующего шага.\n4. После успешного завершения шага вызывается другой hook.\n5. Процесс повторяется до завершения всего рабочего процесса.\n\n---\n\n### Ключевые Методы и Атрибуты\n\n1. **Метод `run()`**:\n - Основная точка входа в экземпляр WorkflowEngine. Вызывается при старте приложения и управляет общим циклом выполнения рабочих процессов.\n\n2. **Атрибуты состояния**:\n - Хранят информацию о текущем состоянии задачи, такие как статус выполнения, идентификатор этапа и другие метаданные.\n\n---\n\n### Заключение\n\nТаким образом, WorkflowEngine является центральным элементом системы управления рабочими процессами, координирующим шаги выполнения, хранящим состояние рабочих задач и обеспечивая возможность расширения функционала через hooks и transition resolver'ы.", - "summary": { - "router": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "confidence": null - }, - "retrieval": { - "profile": "code", - "layers_hit": [ - "C0_SOURCE_CHUNKS", - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS", - "C4_SEMANTIC_ROLES" - ], - "evidence_sufficient": true - }, - "llm": { - "answer_status": "answered", - "groundedness": "grounded" - } - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "WorkflowEngine" - ], - "keyword_hints": [ - "WorkflowEngine" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C0_SOURCE_CHUNKS": "exact_path_fetch", - "C4_SEMANTIC_ROLES": "exact_path_fetch", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C3_ENTRYPOINTS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 8, - "C4_SEMANTIC_ROLES": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C3_ENTRYPOINTS": 6 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C4_SEMANTIC_ROLES": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "WorkflowEngine", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Объясни класс WorkflowEngine", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C4_SEMANTIC_ROLES", - "query": "Объясни класс WorkflowEngine", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "Объясни класс WorkflowEngine", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - }, - { - "layer": "C3_ENTRYPOINTS", - "query": "Объясни класс WorkflowEngine", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 2, - "candidates_after_filter": 2 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 6, - "candidates_after_filter": 6 - }, - { - "layer": "C3_ENTRYPOINTS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 3, - "candidates_after_filter": 3 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "WorkflowEngine", - "alternatives": [ - "WorkflowEngine", - "WorkflowEngineHooks" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "hit", - "hit_count": 2, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C4_SEMANTIC_ROLES", - "status": "hit", - "hit_count": 8, - "fail_reason": null - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 6, - "fail_reason": null - }, - { - "layer": "C3_ENTRYPOINTS", - "status": "hit", - "hit_count": 3, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "router": 0, - "symbol_resolution": 0, - "retrieval_total": 139, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 41, - "C0_SOURCE_CHUNKS": 16, - "C4_SEMANTIC_ROLES": 17, - "C2_DEPENDENCY_GRAPH": 49, - "C3_ENTRYPOINTS": 13 - }, - "merge_rank": 63, - "prompt_build": 0, - "llm_call": 6246 - }, - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 307, - "evidence_rows": 20, - "evidence_chars": 5261 - }, - "evidence_summary": [ - { - "layer": "C1_SYMBOL_CATALOG", - "count": 2, - "unique_paths": 2 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "count": 8, - "unique_paths": 8 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "count": 6, - "unique_paths": 1 - }, - { - "layer": "C3_ENTRYPOINTS", - "count": 3, - "unique_paths": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 1, - "unique_paths": 1 - } - ], - "prompt_template_id": "intent_code_qa_v1", - "system_prompt_version": "v1" - }, - "router": { - "conversation_mode": "START", - "keyword_hints": [ - "WorkflowEngine" - ], - "path_scope": [] - }, - "llm": { - "used_evidence_count": 20, - "missing_evidence_reason": null - } - }, - "run_info": { - "case_id": "plba-fullchain-explain-workflow-engine", - "mode": "full_chain", - "run_started_at": "2026-03-12T09:13:14", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - }, - "input_request": { - "text": "Объясни класс WorkflowEngine", - "normalized_query": "Объясни класс WorkflowEngine" - }, - "steps": [ - { - "step": "intent_router", - "input": { - "query": "Объясни класс WorkflowEngine" - }, - "output": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Объясни класс WorkflowEngine" - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "WorkflowEngine" - ], - "keyword_hints": [ - "WorkflowEngine" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "timings_ms": { - "router": 0 - } - } - }, - { - "step": "retrieval", - "input": { - "query": "Объясни класс WorkflowEngine" - }, - "output": { - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "WorkflowEngine", - "alternatives": [ - "WorkflowEngine", - "WorkflowEngineHooks" - ], - "confidence": 0.99 - }, - "rag_count": 20, - "rag_rows": [ - { - "path": "src/app_runtime/workflow/engine/workflow_engine.py", - "content": "class WorkflowEngine\nWorkflowEngine", - "layer": "C1_SYMBOL_CATALOG", - "title": "WorkflowEngine", - "span_start": 10, - "span_end": 86, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "57ec0a9f11c542c78e008684a888397e8d9ef4223671acb2567e631a0cbc70b4", - "qname": "WorkflowEngine", - "kind": "class", - "signature": "WorkflowEngine", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.workflow.engine.workflow_engine", - "is_test": false, - "blob_sha": "1057136e58a325cd5ab6f4e265d15665fb6a711b7022d9fab52a1a290afa2368", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/engine/hooks.py", - "content": "class WorkflowEngineHooks\nWorkflowEngineHooks", - "layer": "C1_SYMBOL_CATALOG", - "title": "WorkflowEngineHooks", - "span_start": 6, - "span_end": 14, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "914123ed510540061e116100fc87bba4195595ba696f8bfde2fd77ac6a5cd7e4", - "qname": "WorkflowEngineHooks", - "kind": "class", - "signature": "WorkflowEngineHooks", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.workflow.engine.hooks", - "is_test": false, - "blob_sha": "4b11672b0a9af1ae04bfce9d8e1f96572997d3e65e68108d7c797b88fa5fa47a", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/engine/workflow_engine.py", - "content": "WorkflowEngine\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (6)", - "layer": "C4_SEMANTIC_ROLES", - "title": "WorkflowEngine", - "span_start": 10, - "span_end": 86, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 25, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "57ec0a9f11c542c78e008684a888397e8d9ef4223671acb2567e631a0cbc70b4", - "symbol_name": "WorkflowEngine", - "qname": "WorkflowEngine", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 6, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "1057136e58a325cd5ab6f4e265d15665fb6a711b7022d9fab52a1a290afa2368", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/engine/hooks.py", - "content": "WorkflowEngineHooks\nrole: model\n\nResponsibilities:\n- default model role", - "layer": "C4_SEMANTIC_ROLES", - "title": "WorkflowEngineHooks", - "span_start": 6, - "span_end": 14, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 40, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "914123ed510540061e116100fc87bba4195595ba696f8bfde2fd77ac6a5cd7e4", - "symbol_name": "WorkflowEngineHooks", - "qname": "WorkflowEngineHooks", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "4b11672b0a9af1ae04bfce9d8e1f96572997d3e65e68108d7c797b88fa5fa47a", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/engine/transition_resolver.py", - "content": "TransitionResolver\nrole: model\n\nResponsibilities:\n- default model role", - "layer": "C4_SEMANTIC_ROLES", - "title": "TransitionResolver", - "span_start": 7, - "span_end": 9, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 40, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "d1979f0b23d354338debf7771373226833d57c1e7830ce66ca0b82cdf209b958", - "symbol_name": "TransitionResolver", - "qname": "TransitionResolver", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "2c518f4c77fb5dcc2970b88f55a7b121d05959578fb0d196af92ff5193574838", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_runner.py", - "content": "UvicornThreadRunner\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (24)", - "layer": "C4_SEMANTIC_ROLES", - "title": "UvicornThreadRunner", - "span_start": 10, - "span_end": 61, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 11, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "fd55630045a02100df8877ac27d951ee08617d4598764394d48cb51fe067476a", - "symbol_name": "UvicornThreadRunner", - "qname": "UvicornThreadRunner", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 24, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "3779fdd2878b770e789a35bb2a89c9d79f13b61c26d7db1b3b683f9bb9e1623f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/persistence/workflow_persistence.py", - "content": "WorkflowPersistence\nrole: pipeline_stage\n\nResponsibilities:\n- orchestrates role-like calls (2)\n- reads and writes state attributes\n- participates in dataflow slices (16)", - "layer": "C4_SEMANTIC_ROLES", - "title": "WorkflowPersistence", - "span_start": 8, - "span_end": 54, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 15, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "7bd01ee45cf31f2d5c2e3e51656254860ac785d10cef9e0852cd4fba90857bae", - "symbol_name": "WorkflowPersistence", - "qname": "WorkflowPersistence", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 16, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "80e9410ddc639789b4353c2a1a757ba8d0d5b5bb6075b0b263b61551f04ae1f0", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (10)", - "layer": "C4_SEMANTIC_ROLES", - "title": "HttpControlChannel", - "span_start": 12, - "span_end": 57, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 21, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "1c9fbdc24819e5604c26ea55428a74310f03a03e1af197ed84846af61e42fdb0", - "symbol_name": "HttpControlChannel", - "qname": "HttpControlChannel", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 10, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/queue/in_memory.py", - "content": "InMemoryTaskQueue\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (9)", - "layer": "C4_SEMANTIC_ROLES", - "title": "InMemoryTaskQueue", - "span_start": 9, - "span_end": 38, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 22, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "2da04cb94544a3bcbf0943a95ad4bdd8710bcafaa32a02fd0e4de2178dcf3533", - "symbol_name": "InMemoryTaskQueue", - "qname": "InMemoryTaskQueue", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 9, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "58f0cc001ccda0eee4c6bc32ed83bd05eafd6b6644f1e8b4aa9eed3103db73dc", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/config/file_loader.py", - "content": "ConfigFileLoader\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (8)", - "layer": "C4_SEMANTIC_ROLES", - "title": "ConfigFileLoader", - "span_start": 11, - "span_end": 48, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 23, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "a8474eca8b6e9dc86ae67ed68b16fa5fb639ef08739c053e7b7195489765667f", - "symbol_name": "ConfigFileLoader", - "qname": "ConfigFileLoader", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 8, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "1f19ffebde5e38e4be5a5d5a678059a0f36dedb8fb8b3e00ab395c67106a87ea", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/engine/workflow_engine.py", - "content": "WorkflowEngine.__init__\n -> WorkflowEngine._transition_resolver\n -> WorkflowEngine.run", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "WorkflowEngine.__init__:dataflow_slice", - "span_start": 14, - "span_end": 63, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "3abf07e5c245e0fe59785ba2d569c2ee56018715fc7f625a044ddaf6201f903d", - "edge_type": "dataflow_slice", - "src_symbol_id": "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "src_qname": "WorkflowEngine.__init__", - "dst_symbol_id": "a12cad0f5b238287e02f6d8d156cc764351d8c83246930487fa09d5ce6f2ace8", - "dst_ref": "WorkflowEngine.run", - "resolution": "resolved", - "slice_id": "3abf07e5c245e0fe59785ba2d569c2ee56018715fc7f625a044ddaf6201f903d", - "root_symbol_id": "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "path_symbols": [ - "WorkflowEngine.__init__", - "WorkflowEngine._transition_resolver", - "WorkflowEngine.run" - ], - "path_symbol_ids": [ - "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "a12cad0f5b238287e02f6d8d156cc764351d8c83246930487fa09d5ce6f2ace8" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "1057136e58a325cd5ab6f4e265d15665fb6a711b7022d9fab52a1a290afa2368", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/engine/workflow_engine.py", - "content": "WorkflowEngine.__init__\n -> WorkflowEngine._hooks\n -> WorkflowEngine.run", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "WorkflowEngine.__init__:dataflow_slice", - "span_start": 16, - "span_end": 34, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "d73db644b69c1eb35afd6eae9d6ac8674e49e30e9bcf9c020f9fdbfe754851b2", - "edge_type": "dataflow_slice", - "src_symbol_id": "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "src_qname": "WorkflowEngine.__init__", - "dst_symbol_id": "a12cad0f5b238287e02f6d8d156cc764351d8c83246930487fa09d5ce6f2ace8", - "dst_ref": "WorkflowEngine.run", - "resolution": "resolved", - "slice_id": "d73db644b69c1eb35afd6eae9d6ac8674e49e30e9bcf9c020f9fdbfe754851b2", - "root_symbol_id": "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "path_symbols": [ - "WorkflowEngine.__init__", - "WorkflowEngine._hooks", - "WorkflowEngine.run" - ], - "path_symbol_ids": [ - "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "a12cad0f5b238287e02f6d8d156cc764351d8c83246930487fa09d5ce6f2ace8" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "1057136e58a325cd5ab6f4e265d15665fb6a711b7022d9fab52a1a290afa2368", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/engine/workflow_engine.py", - "content": "WorkflowEngine.__init__\n -> WorkflowEngine._workflow\n -> WorkflowEngine.run", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "WorkflowEngine.__init__:dataflow_slice", - "span_start": 12, - "span_end": 29, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "b45ef3c54669b4910a8aed3a565804f275424a24007bc7e3c953389521f80249", - "edge_type": "dataflow_slice", - "src_symbol_id": "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "src_qname": "WorkflowEngine.__init__", - "dst_symbol_id": "a12cad0f5b238287e02f6d8d156cc764351d8c83246930487fa09d5ce6f2ace8", - "dst_ref": "WorkflowEngine.run", - "resolution": "resolved", - "slice_id": "b45ef3c54669b4910a8aed3a565804f275424a24007bc7e3c953389521f80249", - "root_symbol_id": "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "path_symbols": [ - "WorkflowEngine.__init__", - "WorkflowEngine._workflow", - "WorkflowEngine.run" - ], - "path_symbol_ids": [ - "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "a12cad0f5b238287e02f6d8d156cc764351d8c83246930487fa09d5ce6f2ace8" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "1057136e58a325cd5ab6f4e265d15665fb6a711b7022d9fab52a1a290afa2368", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/engine/workflow_engine.py", - "content": "WorkflowEngine.__init__\n -> WorkflowEngine._persistence\n -> WorkflowEngine.run", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "WorkflowEngine.__init__:dataflow_slice", - "span_start": 13, - "span_end": 20, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "8101338770016324ce05d61daa9935a444c75e6c94a0fae4275d5b50fcbcc70b", - "edge_type": "dataflow_slice", - "src_symbol_id": "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "src_qname": "WorkflowEngine.__init__", - "dst_symbol_id": "a12cad0f5b238287e02f6d8d156cc764351d8c83246930487fa09d5ce6f2ace8", - "dst_ref": "WorkflowEngine.run", - "resolution": "resolved", - "slice_id": "8101338770016324ce05d61daa9935a444c75e6c94a0fae4275d5b50fcbcc70b", - "root_symbol_id": "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "path_symbols": [ - "WorkflowEngine.__init__", - "WorkflowEngine._persistence", - "WorkflowEngine.run" - ], - "path_symbol_ids": [ - "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "a12cad0f5b238287e02f6d8d156cc764351d8c83246930487fa09d5ce6f2ace8" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "1057136e58a325cd5ab6f4e265d15665fb6a711b7022d9fab52a1a290afa2368", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/engine/workflow_engine.py", - "content": "WorkflowEngine.__init__\n -> WorkflowEngine._traces\n -> WorkflowEngine.run", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "WorkflowEngine.__init__:dataflow_slice", - "span_start": 15, - "span_end": 27, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "5006266616d534d721648391565e2ac0c9e7e9d9f8df00c17fba8989afb533a5", - "edge_type": "dataflow_slice", - "src_symbol_id": "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "src_qname": "WorkflowEngine.__init__", - "dst_symbol_id": "a12cad0f5b238287e02f6d8d156cc764351d8c83246930487fa09d5ce6f2ace8", - "dst_ref": "WorkflowEngine.run", - "resolution": "resolved", - "slice_id": "5006266616d534d721648391565e2ac0c9e7e9d9f8df00c17fba8989afb533a5", - "root_symbol_id": "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "path_symbols": [ - "WorkflowEngine.__init__", - "WorkflowEngine._traces", - "WorkflowEngine.run" - ], - "path_symbol_ids": [ - "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "a12cad0f5b238287e02f6d8d156cc764351d8c83246930487fa09d5ce6f2ace8" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "1057136e58a325cd5ab6f4e265d15665fb6a711b7022d9fab52a1a290afa2368", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/engine/workflow_engine.py", - "content": "WorkflowEngine.__init__\n -> WorkflowEngine._logger\n -> WorkflowEngine.run", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "WorkflowEngine.__init__:dataflow_slice", - "span_start": 17, - "span_end": 85, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "2f9927abb24794adb056b94bfb5d8538a5cbafb160da2079f52fca97fd694a2b", - "edge_type": "dataflow_slice", - "src_symbol_id": "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "src_qname": "WorkflowEngine.__init__", - "dst_symbol_id": "a12cad0f5b238287e02f6d8d156cc764351d8c83246930487fa09d5ce6f2ace8", - "dst_ref": "WorkflowEngine.run", - "resolution": "resolved", - "slice_id": "2f9927abb24794adb056b94bfb5d8538a5cbafb160da2079f52fca97fd694a2b", - "root_symbol_id": "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "path_symbols": [ - "WorkflowEngine.__init__", - "WorkflowEngine._logger", - "WorkflowEngine.run" - ], - "path_symbol_ids": [ - "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "a12cad0f5b238287e02f6d8d156cc764351d8c83246930487fa09d5ce6f2ace8" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "1057136e58a325cd5ab6f4e265d15665fb6a711b7022d9fab52a1a290afa2368", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/engine/workflow_engine.py", - "content": "class WorkflowEngine:\n def __init__(self, workflow, persistence, *, traces, hooks: WorkflowEngineHooks | None = None) -> None:\n self._workflow = workflow\n self._persistence = persistence\n self._transition_resolver = TransitionResolver()\n self._traces = traces\n self._hooks = hooks or WorkflowEngineHooks()\n self._logger = logging.getLogger(__name__)\n\n def run(self, context: WorkflowContext) -> dict[str, object]:\n run_id = self._persistence.start_run(\n self._workflow.definition.name,\n self._workflow.definition.start_at,\n context.snapshot(),\n )\n context.state.setdefault(\"runtime\", {})\n context.state[\"runtime\"][\"workflow_run_id\"] = run_id\n self._traces.step(\"workflow\")\n self._traces.info(\"Workflow started.\", status=\"started\", attrs={\"workflow_run_id\": run_id})\n current_name = self._workflow.definition.start_at\n while current_name is not None:\n node = self._workflow.definition.nodes[current_name]\n context.state[\"runtime\"][\"current_node\"] = current_name\n self._logger.info(\"Workflow run %s: step '%s' started.\", run_id, current_name)\n self._hooks.on_step_started(context, current_name)\n self._persistence.start_step(run_id, current_name, context.snapshot())\n self._traces.step(current_name)\n self._traces.debug(\n f\"Step '{current_name}' started.\",\n status=\"started\",\n attrs={\"workflow_run_id\": run_id, \"node\": current_name},\n )\n try:\n result = node.step.run(context)\n except Exception as error:\n self._persistence.fail_step(run_id, current_name, context.snapshot(), error)\n self._persistence.fail_run(run_id, context.snapshot())\n self._traces.error(\n f\"Step '{current_name}' failed: {error}\",\n status=\"failed\",\n attrs={\"exception_type\": type(error).__name__},\n )\n self._logger.exception(\"Workflow run %s: step '%s' failed.\", run_id, current_name)\n self._hooks.on_step_failed(context, current_name)\n raise\n context.state.update(result.updates)\n self._persistence.complete_step(\n run_id,\n current_name,\n result.status,\n result.transition,\n context.snapshot(),\n )\n next_node = self._transition_resolver.resolve(node, result)\n self._traces.debug(\n f\"Step '{current_name}' completed with transition '{result.transition}'.\",\n status=result.status,\n attrs={\n \"workflow_run_id\": run_id,\n \"from_node\": current_name,\n \"transition\": result.transition,\n \"to_node\": next_node,\n },\n )\n self._logger.info(\n \"Workflow run %s: step '%s' completed with transition '%s'.\",\n run_id,\n current_name,\n result.transition,\n )\n self._hooks.on_step_finished(context, current_name)\n current_name = next_node\n self._persistence.complete_run(run_id, context.snapshot())\n self._traces.step(\"workflow\")\n self._traces.info(\"Workflow completed.\", status=\"completed\", attrs={\"workflow_run_id\": run_id})\n self._logger.info(\"Workflow run %s completed.\", run_id)\n return {\"run_id\": run_id, \"status\": \"completed\", \"context\": context.snapshot()}", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/workflow/engine/workflow_engine.py:WorkflowEngine", - "span_start": 10, - "span_end": 86, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.workflow.engine.workflow_engine", - "is_test": false, - "blob_sha": "1057136e58a325cd5ab6f4e265d15665fb6a711b7022d9fab52a1a290afa2368", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ] - }, - "diagnostics": { - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C0_SOURCE_CHUNKS": "exact_path_fetch", - "C4_SEMANTIC_ROLES": "exact_path_fetch", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C3_ENTRYPOINTS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 8, - "C4_SEMANTIC_ROLES": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C3_ENTRYPOINTS": 6 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C4_SEMANTIC_ROLES": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "WorkflowEngine", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Объясни класс WorkflowEngine", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C4_SEMANTIC_ROLES", - "query": "Объясни класс WorkflowEngine", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "Объясни класс WorkflowEngine", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - }, - { - "layer": "C3_ENTRYPOINTS", - "query": "Объясни класс WorkflowEngine", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 2, - "candidates_after_filter": 2 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 6, - "candidates_after_filter": 6 - }, - { - "layer": "C3_ENTRYPOINTS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 3, - "candidates_after_filter": 3 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "WorkflowEngine", - "alternatives": [ - "WorkflowEngine", - "WorkflowEngineHooks" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "hit", - "hit_count": 2, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C4_SEMANTIC_ROLES", - "status": "hit", - "hit_count": 8, - "fail_reason": null - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 6, - "fail_reason": null - }, - { - "layer": "C3_ENTRYPOINTS", - "status": "hit", - "hit_count": 3, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "symbol_resolution": 0, - "retrieval_total": 139, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 41, - "C0_SOURCE_CHUNKS": 16, - "C4_SEMANTIC_ROLES": 17, - "C2_DEPENDENCY_GRAPH": 49, - "C3_ENTRYPOINTS": 13 - }, - "merge_rank": 63 - } - } - }, - { - "step": "llm_answer", - "input": { - "query": "Объясни класс WorkflowEngine", - "rag_count": 20 - }, - "output": { - "llm_answer": "## Архитектура и Поведение Workflow Engine\n\n### Описание класса `WorkflowEngine`\n\n`WorkflowEngine` является ключевым компонентом системы управления рабочими процессами или workflows в приложении. Этот компонент отвечает за координацию выполнения этапов рабочего процесса и отслеживание состояния задач.\n\n### Файлы и Сущности\n\n1. **src/app_runtime/workflow/engine/workflow_engine.py**\n - Класс `WorkflowEngine`: Основной класс для управления рабочим процессом.\n \n2. **src/app_runtime/workflow/engine/hooks.py**\n - Класс `WorkflowEngineHooks`: Представляет собой модель поведения (`model role`) для экземпляра WorkflowEngine. Он определяет общие \"точки входа\" (hooks) для обработки событий жизненного цикла WorkflowEngine, таких как начало и завершение различных стадий работы.\n \n3. **src/app_runtime/workflow/engine/transition_resolver.py**\n - Класс `TransitionResolver`: Является моделью (\"model role\") для разрешения переходов между различными этапами рабочего процесса на основе текущего состояния.\n\n4. **src/app_runtime/control/http_runner.py**\n - Класс `UvicornThreadRunner`: Используется для запуска веб-сервиса через uvicorn в отдельном потоке. Хотя он не напрямую связан с WorkflowEngine, его роль — это управление состоянием атрибутов и участие в общей структуре данных потока.\n\n---\n\n### Поток Данных и Ответственности\n\n#### 1. Основные обязанности WorkflowEngine:\n- Чтение и запись состояний атрибутов.\n- Участие в сегментах данных (dataflow slices).\n \n#### 2. Логика работы:\n- Экземпляр WorkflowEngine получает запросы от внешних источников (например, HTTP-запросы через UvicornThreadRunner) и обрабатывает их согласно текущему состоянию рабочего процесса.\n- Переходы между этапами определяются с помощью `TransitionResolver`, который анализирует текущее состояние задачи и разрешает дальнейшие действия.\n- Каждый этап рабочего процесса может иметь свои собственные обработчики (`hooks`), определенные в WorkflowEngineHooks, которые могут выполнять дополнительные логику до и после перехода.\n\n#### 3. Пример взаимодействия:\nПредположим, что рабочий процесс включает три этапа: подготовка, выполнение и проверка результата.\n\n1. Запрос приходит к WorkflowEngine через UvicornThreadRunner.\n2. WorkflowEngine проверяет текущее состояние и определяет следующий шаг (используя TransitionResolver).\n3. WorkflowEngine вызывает соответствующий hook перед выполнением следующего шага.\n4. После успешного завершения шага вызывается другой hook.\n5. Процесс повторяется до завершения всего рабочего процесса.\n\n---\n\n### Ключевые Методы и Атрибуты\n\n1. **Метод `run()`**:\n - Основная точка входа в экземпляр WorkflowEngine. Вызывается при старте приложения и управляет общим циклом выполнения рабочих процессов.\n\n2. **Атрибуты состояния**:\n - Хранят информацию о текущем состоянии задачи, такие как статус выполнения, идентификатор этапа и другие метаданные.\n\n---\n\n### Заключение\n\nТаким образом, WorkflowEngine является центральным элементом системы управления рабочими процессами, координирующим шаги выполнения, хранящим состояние рабочих задач и обеспечивая возможность расширения функционала через hooks и transition resolver'ы." - }, - "diagnostics": { - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 307, - "evidence_rows": 20, - "evidence_chars": 5261 - }, - "evidence_summary": [ - { - "layer": "C1_SYMBOL_CATALOG", - "count": 2, - "unique_paths": 2 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "count": 8, - "unique_paths": 8 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "count": 6, - "unique_paths": 1 - }, - { - "layer": "C3_ENTRYPOINTS", - "count": 3, - "unique_paths": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 1, - "unique_paths": 1 - } - ], - "prompt_template_id": "intent_code_qa_v1", - "system_prompt_version": "v1" - }, - "timings_ms": { - "prompt_build": 0, - "llm_call": 6246 - } - } - } - ] - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_091314/full_chain_plba_code_retrieval_plba-fullchain-explain-workflow-engine.md b/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_091314/full_chain_plba_code_retrieval_plba-fullchain-explain-workflow-engine.md deleted file mode 100644 index a03cfc3..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_091314/full_chain_plba_code_retrieval_plba-fullchain-explain-workflow-engine.md +++ /dev/null @@ -1,34 +0,0 @@ -# plba-fullchain-explain-workflow-engine - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_retrieval.yaml -- runner: runtime -- mode: full_chain -- passed: True - -## Query -Объясни класс WorkflowEngine - -## Actual -{ - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 20, - "llm_answer": "## Архитектура и Поведение Workflow Engine\n\n### Описание класса `WorkflowEngine`\n\n`WorkflowEngine` является ключевым компонентом системы управления рабочими процессами или workflows в приложении. Этот компонент отвечает за координацию выполнения этапов рабочего процесса и отслеживание состояния задач.\n\n### Файлы и Сущности\n\n1. **src/app_runtime/workflow/engine/workflow_engine.py**\n - Класс `WorkflowEngine`: Основной класс для управления рабочим процессом.\n \n2. **src/app_runtime/workflow/engine/hooks.py**\n - Класс `WorkflowEngineHooks`: Представляет собой модель поведения (`model role`) для экземпляра WorkflowEngine. Он определяет общие \"точки входа\" (hooks) для обработки событий жизненного цикла WorkflowEngine, таких как начало и завершение различных стадий работы.\n \n3. **src/app_runtime/workflow/engine/transition_resolver.py**\n - Класс `TransitionResolver`: Является моделью (\"model role\") для разрешения переходов между различными этапами рабочего процесса на основе текущего состояния.\n\n4. **src/app_runtime/control/http_runner.py**\n - Класс `UvicornThreadRunner`: Используется для запуска веб-сервиса через uvicorn в отдельном потоке. Хотя он не напрямую связан с WorkflowEngine, его роль — это управление состоянием атрибутов и участие в общей структуре данных потока.\n\n---\n\n### Поток Данных и Ответственности\n\n#### 1. Основные обязанности WorkflowEngine:\n- Чтение и запись состояний атрибутов.\n- Участие в сегментах данных (dataflow slices).\n \n#### 2. Логика работы:\n- Экземпляр WorkflowEngine получает запросы от внешних источников (например, HTTP-запросы через UvicornThreadRunner) и обрабатывает их согласно текущему состоянию рабочего процесса.\n- Переходы между этапами определяются с помощью `TransitionResolver`, который анализирует текущее состояние задачи и разрешает дальнейшие действия.\n- Каждый этап рабочего процесса может иметь свои собственные обработчики (`hooks`), определенные в WorkflowEngineHooks, которые могут выполнять дополнительные логику до и после перехода.\n\n#### 3. Пример взаимодействия:\nПредположим, что рабочий процесс включает три этапа: подготовка, выполнение и проверка результата.\n\n1. Запрос приходит к WorkflowEngine через UvicornThreadRunner.\n2. WorkflowEngine проверяет текущее состояние и определяет следующий шаг (используя TransitionResolver).\n3. WorkflowEngine вызывает соответствующий hook перед выполнением следующего шага.\n4. После успешного завершения шага вызывается другой hook.\n5. Процесс повторяется до завершения всего рабочего процесса.\n\n---\n\n### Ключевые Методы и Атрибуты\n\n1. **Метод `run()`**:\n - Основная точка входа в экземпляр WorkflowEngine. Вызывается при старте приложения и управляет общим циклом выполнения рабочих процессов.\n\n2. **Атрибуты состояния**:\n - Хранят информацию о текущем состоянии задачи, такие как статус выполнения, идентификатор этапа и другие метаданные.\n\n---\n\n### Заключение\n\nТаким образом, WorkflowEngine является центральным элементом системы управления рабочими процессами, координирующим шаги выполнения, хранящим состояние рабочих задач и обеспечивая возможность расширения функционала через hooks и transition resolver'ы.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "WorkflowEngine" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] -} - -## Mismatches -- none \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_091314/summary.md b/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_091314/summary.md deleted file mode 100644 index c5b3265..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_091314/summary.md +++ /dev/null @@ -1,24 +0,0 @@ -# pipeline_setup_v2 summary - -Passed: 6/6 - - -| File | Case | Runner | Mode | Intent | Sub-intent | Pass | -| ----------------------------------- | -------------------------------------------- | ------- | ---------- | ------- | ---------- | ---- | -| full_chain_plba_code_retrieval.yaml | plba-fullchain-explain-runtime-manager | runtime | full_chain | CODE_QA | EXPLAIN | ✓ | -| full_chain_plba_code_retrieval.yaml | plba-fullchain-explain-http-control-channel | runtime | full_chain | CODE_QA | EXPLAIN | ✓ | -| full_chain_plba_code_retrieval.yaml | plba-fullchain-explain-control-plane-service | runtime | full_chain | CODE_QA | EXPLAIN | ✓ | -| full_chain_plba_code_retrieval.yaml | plba-fullchain-explain-trace-service | runtime | full_chain | CODE_QA | EXPLAIN | ✓ | -| full_chain_plba_code_retrieval.yaml | plba-fullchain-explain-create-runtime | runtime | full_chain | CODE_QA | EXPLAIN | ✓ | -| full_chain_plba_code_retrieval.yaml | plba-fullchain-explain-workflow-engine | runtime | full_chain | CODE_QA | EXPLAIN | ✓ | - - -## LLM Answers - -- **plba-fullchain-explain-runtime-manager**: ## Анализ класса `RuntimeManager` ### 1. Положение и назначение класса Класс `RuntimeManager` определен в файле `src/app_runtime/core/runtime.py`. Его роль — **управляющий компонент**, который координирует выполнение ра… -- **plba-fullchain-explain-http-control-channel**: ## Анализ класса `HttpControlChannel` ### 1. Обзор файла и контекста Класс `HttpControlChannel` определен в файле `src/app_runtime/control/http_channel.py`. Этот файл содержит классы и функции, связанные с управлением к… -- **plba-fullchain-explain-control-plane-service**: ## Анализ класса `ControlPlaneService` ### Описание файла и роли классов Файл `**src/app_runtime/control/service.py`** содержит определение класса `ControlPlaneService`. Этот файл также импортирует классы и компоненты и… -- **plba-fullchain-explain-trace-service**: ## Анализ архитектуры и поведения `TraceService` ### 1. Описание `TraceService` `TraceService` — это класс, представляющий собой сервисную компоненту приложения, которая участвует в управлении трассировкой выполнения ра… -- **plba-fullchain-explain-create-runtime**: ## Анализ функции `create_runtime` и архитектуры приложения ### Описание функции `create_runtime` Функция `create_runtime` расположена в файле `src/plba/bootstrap.py`. Её основная задача — инициализация и настройка runt… -- **plba-fullchain-explain-workflow-engine**: ## Архитектура и Поведение Workflow Engine ### Описание класса `WorkflowEngine` `WorkflowEngine` является ключевым компонентом системы управления рабочими процессами или workflows в приложении. Этот компонент отвечает з… - diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_091824/full_chain_plba_code_retrieval_plba-fullchain-explain-control-plane-service.json b/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_091824/full_chain_plba_code_retrieval_plba-fullchain-explain-control-plane-service.json deleted file mode 100644 index bbd193b..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_091824/full_chain_plba_code_retrieval_plba-fullchain-explain-control-plane-service.json +++ /dev/null @@ -1,2532 +0,0 @@ -{ - "case_id": "plba-fullchain-explain-control-plane-service", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_retrieval.yaml", - "runner": "runtime", - "mode": "full_chain", - "actual": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 19, - "llm_answer": "## Анализ класса `ControlPlaneService`\n\n### Обзор контекста\n\nВ рамках данного контекста обсуждаются несколько сущностей и их роли в системе обработки запросов и управления состоянием:\n\n- **`ControlPlaneService`**: Основной объект, рассматриваемый в вопросе.\n- **`ControlChannel`**: Базовый интерфейс для моделей или каналов взаимодействия.\n- **`ControlActionSet`**: Набор действий, выполняемых моделью.\n- **`UvicornThreadRunner`**: Класс, отвечающий за запуск HTTP-сервера с использованием библиотеки uvicorn в отдельном потоке.\n- **`HttpControlChannel`**: Канал контроля на основе HTTP, который также участвует в обработке состояния и данных потока.\n\nВсе перечисленные классы являются частью модуля `src/app_runtime/control`, что указывает на их связь с управлением данными и обработкой состояний в приложении.\n\n### Описание поведения и архитектуры\n\n**Класс `ControlPlaneService`:**\n\nЭтот класс является ключевым элементом в управлении поведением системы на уровне \"контроля\" (\"Control Plane\"). Он отвечает за чтение и запись атрибутов состояния приложения и взаимодействие с различными компонентами через каналы и действия.\n\n#### Основные обязанности (`Responsibilities`):\n\n1. **Чтение и запись атрибутов состояния:** \n - Класс хранит и управляет текущим состоянием системы и может изменять его в зависимости от поступающих запросов и событий.\n \n2. **Участие в данных потоков (`dataflow slices`) :**\n - Указано участие в пяти различных срезах данных, которые могут быть связаны с различными аспектами работы системы (например, обработка запросов, выполнение вычислений, управление логикой бизнес-процессов).\n\n#### Поток данных и логика выполнения\n\nПоскольку конкретные детали реализации не предоставлены, можно предположить следующий общий сценарий функционирования `ControlPlaneService`:\n\n1. Получение запроса извне (через HTTP или другой канал).\n2. Валидация и преобразование входных данных.\n3. Вызов соответствующих методов или действий из объекта `ControlActionSet`.\n4. Запись изменений состояния системы (если это необходимо) и передача информации обратно пользователю.\n\n### Заключение\n\nТаким образом, `ControlPlaneService` играет роль центрального контроллера, координирующего работу различных компонентов системы через свои интерфейсы (каналы и действия). Его основная задача — обеспечивать согласованность и корректность изменения состояния системы в ответ на внешние запросы.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "ControlPlaneService" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "passed": true, - "mismatches": [], - "details": { - "case_id": "plba-fullchain-explain-control-plane-service", - "text": "Объясни класс ControlPlaneService", - "mode": "full_chain", - "run_started_at": "2026-03-12T09:18:24", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Объясни класс ControlPlaneService", - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "ControlPlaneService", - "alternatives": [ - "ControlPlaneService" - ], - "confidence": 0.99 - }, - "rag_count": 19, - "rag_rows": [ - { - "path": "src/app_runtime/control/service.py", - "content": "class ControlPlaneService\nControlPlaneService", - "layer": "C1_SYMBOL_CATALOG", - "title": "ControlPlaneService", - "span_start": 12, - "span_end": 52, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "b13471e5916986dccffb53fab613812842965705e6b3a89ae549d30c9e91e9aa", - "qname": "ControlPlaneService", - "kind": "class", - "signature": "ControlPlaneService", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.control.service", - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests service\n- reads and writes state attributes\n- participates in dataflow slices (5)", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlPlaneService", - "span_start": 12, - "span_end": 52, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 68, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "b13471e5916986dccffb53fab613812842965705e6b3a89ae549d30c9e91e9aa", - "symbol_name": "ControlPlaneService", - "qname": "ControlPlaneService", - "role": "pipeline_stage", - "confidence": 0.57, - "dataflow_participation": 5, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "ControlChannel\nrole: model\n\nResponsibilities:\n- default model role", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlChannel", - "span_start": 21, - "span_end": 28, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 40, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "cfcfe9a311d3a2dbdaf32ac4ccd73c0eb9a117f830591a1c0867ee97d46204ff", - "symbol_name": "ControlChannel", - "qname": "ControlChannel", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "ControlActionSet\nrole: model\n\nResponsibilities:\n- default model role", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlActionSet", - "span_start": 14, - "span_end": 18, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 40, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "46eb026cb3313415ec47b82dd22f84f4d112c9d987e8b1716dcb0baa1cce8988", - "symbol_name": "ControlActionSet", - "qname": "ControlActionSet", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_runner.py", - "content": "UvicornThreadRunner\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (24)", - "layer": "C4_SEMANTIC_ROLES", - "title": "UvicornThreadRunner", - "span_start": 10, - "span_end": 61, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 11, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "fd55630045a02100df8877ac27d951ee08617d4598764394d48cb51fe067476a", - "symbol_name": "UvicornThreadRunner", - "qname": "UvicornThreadRunner", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 24, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "3779fdd2878b770e789a35bb2a89c9d79f13b61c26d7db1b3b683f9bb9e1623f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (10)", - "layer": "C4_SEMANTIC_ROLES", - "title": "HttpControlChannel", - "span_start": 12, - "span_end": 57, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 21, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "1c9fbdc24819e5604c26ea55428a74310f03a03e1af197ed84846af61e42fdb0", - "symbol_name": "HttpControlChannel", - "qname": "HttpControlChannel", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 10, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "HttpControlAppFactory\nrole: factory\n\nResponsibilities:\n- name suffix suggests factory", - "layer": "C4_SEMANTIC_ROLES", - "title": "HttpControlAppFactory", - "span_start": 15, - "span_end": 53, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 39, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "9b3502a5fb408b273223db13264349cf500de24915b6c649d9ea8970d0dfd8e0", - "symbol_name": "HttpControlAppFactory", - "qname": "HttpControlAppFactory", - "role": "factory", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/persistence/workflow_persistence.py", - "content": "WorkflowPersistence\nrole: pipeline_stage\n\nResponsibilities:\n- orchestrates role-like calls (2)\n- reads and writes state attributes\n- participates in dataflow slices (16)", - "layer": "C4_SEMANTIC_ROLES", - "title": "WorkflowPersistence", - "span_start": 8, - "span_end": 54, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 15, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "7bd01ee45cf31f2d5c2e3e51656254860ac785d10cef9e0852cd4fba90857bae", - "symbol_name": "WorkflowPersistence", - "qname": "WorkflowPersistence", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 16, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "80e9410ddc639789b4353c2a1a757ba8d0d5b5bb6075b0b263b61551f04ae1f0", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/queue/in_memory.py", - "content": "InMemoryTaskQueue\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (9)", - "layer": "C4_SEMANTIC_ROLES", - "title": "InMemoryTaskQueue", - "span_start": 9, - "span_end": 38, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 22, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "2da04cb94544a3bcbf0943a95ad4bdd8710bcafaa32a02fd0e4de2178dcf3533", - "symbol_name": "InMemoryTaskQueue", - "qname": "InMemoryTaskQueue", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 9, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "58f0cc001ccda0eee4c6bc32ed83bd05eafd6b6644f1e8b4aa9eed3103db73dc", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.stop", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 25, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d", - "dst_ref": "ControlPlaneService.stop", - "resolution": "resolved", - "slice_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.stop" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._stop_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 51, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a", - "dst_ref": "ControlPlaneService._stop_async", - "resolution": "resolved", - "slice_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._stop_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.register_channel", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 17, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957", - "dst_ref": "ControlPlaneService.register_channel", - "resolution": "resolved", - "slice_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.register_channel" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.start", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 20, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154", - "dst_ref": "ControlPlaneService.start", - "resolution": "resolved", - "slice_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.start" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._start_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 47, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517", - "dst_ref": "ControlPlaneService._start_async", - "resolution": "resolved", - "slice_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._start_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.register_channel reads_attr self._channels.append", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.register_channel:reads_attr", - "span_start": 17, - "span_end": 17, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "1ee5925deffdc38ba15b88bf7c89e5fcd1a78f493fe30f2deb827d714a1b18e8", - "edge_type": "reads_attr", - "src_symbol_id": "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957", - "src_qname": "ControlPlaneService.register_channel", - "dst_symbol_id": null, - "dst_ref": "self._channels.append", - "resolution": "partial", - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "class ControlPlaneService:\n def __init__(self) -> None:\n self._channels: list[ControlChannel] = []\n\n def register_channel(self, channel: ControlChannel) -> None:\n self._channels.append(channel)\n\n def start(self, runtime: RuntimeManager) -> None:\n if not self._channels:\n return\n asyncio.run(self._start_async(runtime))\n\n def stop(self) -> None:\n if not self._channels:\n return\n asyncio.run(self._stop_async())\n\n def snapshot(self, runtime: RuntimeManager) -> dict[str, object]:\n health = runtime.current_health()\n return {\n \"runtime\": {\"state\": runtime._state.value},\n \"modules\": list(runtime.registry.modules),\n \"services\": runtime.services.snapshot(),\n \"workers\": runtime.workers.snapshot(),\n \"health\": runtime.health.snapshot(runtime.workers.healths()) | {\"status\": health[\"status\"]},\n \"config\": runtime.configuration.get(),\n }\n\n async def _start_async(self, runtime: RuntimeManager) -> None:\n actions = ControlActionSet(\n health=runtime.health_status,\n start=runtime.start_runtime,\n stop=runtime.stop_runtime,\n status=runtime.runtime_status,\n )\n for channel in self._channels:\n await channel.start(actions)\n\n async def _stop_async(self) -> None:\n for channel in reversed(self._channels):\n await channel.stop()", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/service.py:ControlPlaneService", - "span_start": 12, - "span_end": 52, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.service", - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "llm_answer": "## Анализ класса `ControlPlaneService`\n\n### Обзор контекста\n\nВ рамках данного контекста обсуждаются несколько сущностей и их роли в системе обработки запросов и управления состоянием:\n\n- **`ControlPlaneService`**: Основной объект, рассматриваемый в вопросе.\n- **`ControlChannel`**: Базовый интерфейс для моделей или каналов взаимодействия.\n- **`ControlActionSet`**: Набор действий, выполняемых моделью.\n- **`UvicornThreadRunner`**: Класс, отвечающий за запуск HTTP-сервера с использованием библиотеки uvicorn в отдельном потоке.\n- **`HttpControlChannel`**: Канал контроля на основе HTTP, который также участвует в обработке состояния и данных потока.\n\nВсе перечисленные классы являются частью модуля `src/app_runtime/control`, что указывает на их связь с управлением данными и обработкой состояний в приложении.\n\n### Описание поведения и архитектуры\n\n**Класс `ControlPlaneService`:**\n\nЭтот класс является ключевым элементом в управлении поведением системы на уровне \"контроля\" (\"Control Plane\"). Он отвечает за чтение и запись атрибутов состояния приложения и взаимодействие с различными компонентами через каналы и действия.\n\n#### Основные обязанности (`Responsibilities`):\n\n1. **Чтение и запись атрибутов состояния:** \n - Класс хранит и управляет текущим состоянием системы и может изменять его в зависимости от поступающих запросов и событий.\n \n2. **Участие в данных потоков (`dataflow slices`) :**\n - Указано участие в пяти различных срезах данных, которые могут быть связаны с различными аспектами работы системы (например, обработка запросов, выполнение вычислений, управление логикой бизнес-процессов).\n\n#### Поток данных и логика выполнения\n\nПоскольку конкретные детали реализации не предоставлены, можно предположить следующий общий сценарий функционирования `ControlPlaneService`:\n\n1. Получение запроса извне (через HTTP или другой канал).\n2. Валидация и преобразование входных данных.\n3. Вызов соответствующих методов или действий из объекта `ControlActionSet`.\n4. Запись изменений состояния системы (если это необходимо) и передача информации обратно пользователю.\n\n### Заключение\n\nТаким образом, `ControlPlaneService` играет роль центрального контроллера, координирующего работу различных компонентов системы через свои интерфейсы (каналы и действия). Его основная задача — обеспечивать согласованность и корректность изменения состояния системы в ответ на внешние запросы.", - "summary": { - "router": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "confidence": null - }, - "retrieval": { - "profile": "code", - "layers_hit": [ - "C0_SOURCE_CHUNKS", - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS", - "C4_SEMANTIC_ROLES" - ], - "evidence_sufficient": true - }, - "llm": { - "answer_status": "answered", - "groundedness": "grounded" - } - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "ControlPlaneService" - ], - "keyword_hints": [ - "ControlPlaneService" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C0_SOURCE_CHUNKS": "exact_path_fetch", - "C4_SEMANTIC_ROLES": "exact_path_fetch", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C3_ENTRYPOINTS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 8, - "C4_SEMANTIC_ROLES": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C3_ENTRYPOINTS": 6 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C4_SEMANTIC_ROLES": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "ControlPlaneService", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Объясни класс ControlPlaneService", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C4_SEMANTIC_ROLES", - "query": "Объясни класс ControlPlaneService", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "Объясни класс ControlPlaneService", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - }, - { - "layer": "C3_ENTRYPOINTS", - "query": "Объясни класс ControlPlaneService", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 1, - "candidates_after_filter": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 6, - "candidates_after_filter": 6 - }, - { - "layer": "C3_ENTRYPOINTS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 3, - "candidates_after_filter": 3 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "ControlPlaneService", - "alternatives": [ - "ControlPlaneService" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C4_SEMANTIC_ROLES", - "status": "hit", - "hit_count": 8, - "fail_reason": null - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 6, - "fail_reason": null - }, - { - "layer": "C3_ENTRYPOINTS", - "status": "hit", - "hit_count": 3, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "router": 2, - "symbol_resolution": 0, - "retrieval_total": 176, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 45, - "C0_SOURCE_CHUNKS": 23, - "C4_SEMANTIC_ROLES": 28, - "C2_DEPENDENCY_GRAPH": 63, - "C3_ENTRYPOINTS": 13 - }, - "merge_rank": 19, - "prompt_build": 0, - "llm_call": 5139 - }, - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 325, - "evidence_rows": 19, - "evidence_chars": 3087 - }, - "evidence_summary": [ - { - "layer": "C1_SYMBOL_CATALOG", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "count": 8, - "unique_paths": 7 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "count": 6, - "unique_paths": 1 - }, - { - "layer": "C3_ENTRYPOINTS", - "count": 3, - "unique_paths": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 1, - "unique_paths": 1 - } - ], - "prompt_template_id": "intent_code_qa_v1", - "system_prompt_version": "v1" - }, - "router": { - "conversation_mode": "START", - "keyword_hints": [ - "ControlPlaneService" - ], - "path_scope": [] - }, - "llm": { - "used_evidence_count": 19, - "missing_evidence_reason": null - } - }, - "run_info": { - "case_id": "plba-fullchain-explain-control-plane-service", - "mode": "full_chain", - "run_started_at": "2026-03-12T09:18:24", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - }, - "input_request": { - "text": "Объясни класс ControlPlaneService", - "normalized_query": "Объясни класс ControlPlaneService" - }, - "steps": [ - { - "step": "intent_router", - "input": { - "query": "Объясни класс ControlPlaneService" - }, - "output": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Объясни класс ControlPlaneService" - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "ControlPlaneService" - ], - "keyword_hints": [ - "ControlPlaneService" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "timings_ms": { - "router": 2 - } - } - }, - { - "step": "retrieval", - "input": { - "query": "Объясни класс ControlPlaneService" - }, - "output": { - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "ControlPlaneService", - "alternatives": [ - "ControlPlaneService" - ], - "confidence": 0.99 - }, - "rag_count": 19, - "rag_rows": [ - { - "path": "src/app_runtime/control/service.py", - "content": "class ControlPlaneService\nControlPlaneService", - "layer": "C1_SYMBOL_CATALOG", - "title": "ControlPlaneService", - "span_start": 12, - "span_end": 52, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "b13471e5916986dccffb53fab613812842965705e6b3a89ae549d30c9e91e9aa", - "qname": "ControlPlaneService", - "kind": "class", - "signature": "ControlPlaneService", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.control.service", - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests service\n- reads and writes state attributes\n- participates in dataflow slices (5)", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlPlaneService", - "span_start": 12, - "span_end": 52, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 68, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "b13471e5916986dccffb53fab613812842965705e6b3a89ae549d30c9e91e9aa", - "symbol_name": "ControlPlaneService", - "qname": "ControlPlaneService", - "role": "pipeline_stage", - "confidence": 0.57, - "dataflow_participation": 5, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "ControlChannel\nrole: model\n\nResponsibilities:\n- default model role", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlChannel", - "span_start": 21, - "span_end": 28, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 40, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "cfcfe9a311d3a2dbdaf32ac4ccd73c0eb9a117f830591a1c0867ee97d46204ff", - "symbol_name": "ControlChannel", - "qname": "ControlChannel", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "ControlActionSet\nrole: model\n\nResponsibilities:\n- default model role", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlActionSet", - "span_start": 14, - "span_end": 18, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 40, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "46eb026cb3313415ec47b82dd22f84f4d112c9d987e8b1716dcb0baa1cce8988", - "symbol_name": "ControlActionSet", - "qname": "ControlActionSet", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_runner.py", - "content": "UvicornThreadRunner\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (24)", - "layer": "C4_SEMANTIC_ROLES", - "title": "UvicornThreadRunner", - "span_start": 10, - "span_end": 61, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 11, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "fd55630045a02100df8877ac27d951ee08617d4598764394d48cb51fe067476a", - "symbol_name": "UvicornThreadRunner", - "qname": "UvicornThreadRunner", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 24, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "3779fdd2878b770e789a35bb2a89c9d79f13b61c26d7db1b3b683f9bb9e1623f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (10)", - "layer": "C4_SEMANTIC_ROLES", - "title": "HttpControlChannel", - "span_start": 12, - "span_end": 57, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 21, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "1c9fbdc24819e5604c26ea55428a74310f03a03e1af197ed84846af61e42fdb0", - "symbol_name": "HttpControlChannel", - "qname": "HttpControlChannel", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 10, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "HttpControlAppFactory\nrole: factory\n\nResponsibilities:\n- name suffix suggests factory", - "layer": "C4_SEMANTIC_ROLES", - "title": "HttpControlAppFactory", - "span_start": 15, - "span_end": 53, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 39, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "9b3502a5fb408b273223db13264349cf500de24915b6c649d9ea8970d0dfd8e0", - "symbol_name": "HttpControlAppFactory", - "qname": "HttpControlAppFactory", - "role": "factory", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/persistence/workflow_persistence.py", - "content": "WorkflowPersistence\nrole: pipeline_stage\n\nResponsibilities:\n- orchestrates role-like calls (2)\n- reads and writes state attributes\n- participates in dataflow slices (16)", - "layer": "C4_SEMANTIC_ROLES", - "title": "WorkflowPersistence", - "span_start": 8, - "span_end": 54, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 15, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "7bd01ee45cf31f2d5c2e3e51656254860ac785d10cef9e0852cd4fba90857bae", - "symbol_name": "WorkflowPersistence", - "qname": "WorkflowPersistence", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 16, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "80e9410ddc639789b4353c2a1a757ba8d0d5b5bb6075b0b263b61551f04ae1f0", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/queue/in_memory.py", - "content": "InMemoryTaskQueue\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (9)", - "layer": "C4_SEMANTIC_ROLES", - "title": "InMemoryTaskQueue", - "span_start": 9, - "span_end": 38, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 22, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "2da04cb94544a3bcbf0943a95ad4bdd8710bcafaa32a02fd0e4de2178dcf3533", - "symbol_name": "InMemoryTaskQueue", - "qname": "InMemoryTaskQueue", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 9, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "58f0cc001ccda0eee4c6bc32ed83bd05eafd6b6644f1e8b4aa9eed3103db73dc", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.stop", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 25, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d", - "dst_ref": "ControlPlaneService.stop", - "resolution": "resolved", - "slice_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.stop" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._stop_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 51, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a", - "dst_ref": "ControlPlaneService._stop_async", - "resolution": "resolved", - "slice_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._stop_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.register_channel", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 17, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957", - "dst_ref": "ControlPlaneService.register_channel", - "resolution": "resolved", - "slice_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.register_channel" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.start", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 20, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154", - "dst_ref": "ControlPlaneService.start", - "resolution": "resolved", - "slice_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.start" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._start_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 47, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517", - "dst_ref": "ControlPlaneService._start_async", - "resolution": "resolved", - "slice_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._start_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.register_channel reads_attr self._channels.append", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.register_channel:reads_attr", - "span_start": 17, - "span_end": 17, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "1ee5925deffdc38ba15b88bf7c89e5fcd1a78f493fe30f2deb827d714a1b18e8", - "edge_type": "reads_attr", - "src_symbol_id": "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957", - "src_qname": "ControlPlaneService.register_channel", - "dst_symbol_id": null, - "dst_ref": "self._channels.append", - "resolution": "partial", - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "class ControlPlaneService:\n def __init__(self) -> None:\n self._channels: list[ControlChannel] = []\n\n def register_channel(self, channel: ControlChannel) -> None:\n self._channels.append(channel)\n\n def start(self, runtime: RuntimeManager) -> None:\n if not self._channels:\n return\n asyncio.run(self._start_async(runtime))\n\n def stop(self) -> None:\n if not self._channels:\n return\n asyncio.run(self._stop_async())\n\n def snapshot(self, runtime: RuntimeManager) -> dict[str, object]:\n health = runtime.current_health()\n return {\n \"runtime\": {\"state\": runtime._state.value},\n \"modules\": list(runtime.registry.modules),\n \"services\": runtime.services.snapshot(),\n \"workers\": runtime.workers.snapshot(),\n \"health\": runtime.health.snapshot(runtime.workers.healths()) | {\"status\": health[\"status\"]},\n \"config\": runtime.configuration.get(),\n }\n\n async def _start_async(self, runtime: RuntimeManager) -> None:\n actions = ControlActionSet(\n health=runtime.health_status,\n start=runtime.start_runtime,\n stop=runtime.stop_runtime,\n status=runtime.runtime_status,\n )\n for channel in self._channels:\n await channel.start(actions)\n\n async def _stop_async(self) -> None:\n for channel in reversed(self._channels):\n await channel.stop()", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/service.py:ControlPlaneService", - "span_start": 12, - "span_end": 52, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.service", - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ] - }, - "diagnostics": { - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C0_SOURCE_CHUNKS": "exact_path_fetch", - "C4_SEMANTIC_ROLES": "exact_path_fetch", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C3_ENTRYPOINTS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 8, - "C4_SEMANTIC_ROLES": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C3_ENTRYPOINTS": 6 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C4_SEMANTIC_ROLES": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "ControlPlaneService", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Объясни класс ControlPlaneService", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C4_SEMANTIC_ROLES", - "query": "Объясни класс ControlPlaneService", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "Объясни класс ControlPlaneService", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - }, - { - "layer": "C3_ENTRYPOINTS", - "query": "Объясни класс ControlPlaneService", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 1, - "candidates_after_filter": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 6, - "candidates_after_filter": 6 - }, - { - "layer": "C3_ENTRYPOINTS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 3, - "candidates_after_filter": 3 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "ControlPlaneService", - "alternatives": [ - "ControlPlaneService" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C4_SEMANTIC_ROLES", - "status": "hit", - "hit_count": 8, - "fail_reason": null - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 6, - "fail_reason": null - }, - { - "layer": "C3_ENTRYPOINTS", - "status": "hit", - "hit_count": 3, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "symbol_resolution": 0, - "retrieval_total": 176, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 45, - "C0_SOURCE_CHUNKS": 23, - "C4_SEMANTIC_ROLES": 28, - "C2_DEPENDENCY_GRAPH": 63, - "C3_ENTRYPOINTS": 13 - }, - "merge_rank": 19 - } - } - }, - { - "step": "llm_answer", - "input": { - "query": "Объясни класс ControlPlaneService", - "rag_count": 19 - }, - "output": { - "llm_answer": "## Анализ класса `ControlPlaneService`\n\n### Обзор контекста\n\nВ рамках данного контекста обсуждаются несколько сущностей и их роли в системе обработки запросов и управления состоянием:\n\n- **`ControlPlaneService`**: Основной объект, рассматриваемый в вопросе.\n- **`ControlChannel`**: Базовый интерфейс для моделей или каналов взаимодействия.\n- **`ControlActionSet`**: Набор действий, выполняемых моделью.\n- **`UvicornThreadRunner`**: Класс, отвечающий за запуск HTTP-сервера с использованием библиотеки uvicorn в отдельном потоке.\n- **`HttpControlChannel`**: Канал контроля на основе HTTP, который также участвует в обработке состояния и данных потока.\n\nВсе перечисленные классы являются частью модуля `src/app_runtime/control`, что указывает на их связь с управлением данными и обработкой состояний в приложении.\n\n### Описание поведения и архитектуры\n\n**Класс `ControlPlaneService`:**\n\nЭтот класс является ключевым элементом в управлении поведением системы на уровне \"контроля\" (\"Control Plane\"). Он отвечает за чтение и запись атрибутов состояния приложения и взаимодействие с различными компонентами через каналы и действия.\n\n#### Основные обязанности (`Responsibilities`):\n\n1. **Чтение и запись атрибутов состояния:** \n - Класс хранит и управляет текущим состоянием системы и может изменять его в зависимости от поступающих запросов и событий.\n \n2. **Участие в данных потоков (`dataflow slices`) :**\n - Указано участие в пяти различных срезах данных, которые могут быть связаны с различными аспектами работы системы (например, обработка запросов, выполнение вычислений, управление логикой бизнес-процессов).\n\n#### Поток данных и логика выполнения\n\nПоскольку конкретные детали реализации не предоставлены, можно предположить следующий общий сценарий функционирования `ControlPlaneService`:\n\n1. Получение запроса извне (через HTTP или другой канал).\n2. Валидация и преобразование входных данных.\n3. Вызов соответствующих методов или действий из объекта `ControlActionSet`.\n4. Запись изменений состояния системы (если это необходимо) и передача информации обратно пользователю.\n\n### Заключение\n\nТаким образом, `ControlPlaneService` играет роль центрального контроллера, координирующего работу различных компонентов системы через свои интерфейсы (каналы и действия). Его основная задача — обеспечивать согласованность и корректность изменения состояния системы в ответ на внешние запросы." - }, - "diagnostics": { - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 325, - "evidence_rows": 19, - "evidence_chars": 3087 - }, - "evidence_summary": [ - { - "layer": "C1_SYMBOL_CATALOG", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "count": 8, - "unique_paths": 7 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "count": 6, - "unique_paths": 1 - }, - { - "layer": "C3_ENTRYPOINTS", - "count": 3, - "unique_paths": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 1, - "unique_paths": 1 - } - ], - "prompt_template_id": "intent_code_qa_v1", - "system_prompt_version": "v1" - }, - "timings_ms": { - "prompt_build": 0, - "llm_call": 5139 - } - } - } - ] - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_091824/full_chain_plba_code_retrieval_plba-fullchain-explain-control-plane-service.md b/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_091824/full_chain_plba_code_retrieval_plba-fullchain-explain-control-plane-service.md deleted file mode 100644 index 7df4945..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_091824/full_chain_plba_code_retrieval_plba-fullchain-explain-control-plane-service.md +++ /dev/null @@ -1,34 +0,0 @@ -# plba-fullchain-explain-control-plane-service - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_retrieval.yaml -- runner: runtime -- mode: full_chain -- passed: True - -## Query -Объясни класс ControlPlaneService - -## Actual -{ - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 19, - "llm_answer": "## Анализ класса `ControlPlaneService`\n\n### Обзор контекста\n\nВ рамках данного контекста обсуждаются несколько сущностей и их роли в системе обработки запросов и управления состоянием:\n\n- **`ControlPlaneService`**: Основной объект, рассматриваемый в вопросе.\n- **`ControlChannel`**: Базовый интерфейс для моделей или каналов взаимодействия.\n- **`ControlActionSet`**: Набор действий, выполняемых моделью.\n- **`UvicornThreadRunner`**: Класс, отвечающий за запуск HTTP-сервера с использованием библиотеки uvicorn в отдельном потоке.\n- **`HttpControlChannel`**: Канал контроля на основе HTTP, который также участвует в обработке состояния и данных потока.\n\nВсе перечисленные классы являются частью модуля `src/app_runtime/control`, что указывает на их связь с управлением данными и обработкой состояний в приложении.\n\n### Описание поведения и архитектуры\n\n**Класс `ControlPlaneService`:**\n\nЭтот класс является ключевым элементом в управлении поведением системы на уровне \"контроля\" (\"Control Plane\"). Он отвечает за чтение и запись атрибутов состояния приложения и взаимодействие с различными компонентами через каналы и действия.\n\n#### Основные обязанности (`Responsibilities`):\n\n1. **Чтение и запись атрибутов состояния:** \n - Класс хранит и управляет текущим состоянием системы и может изменять его в зависимости от поступающих запросов и событий.\n \n2. **Участие в данных потоков (`dataflow slices`) :**\n - Указано участие в пяти различных срезах данных, которые могут быть связаны с различными аспектами работы системы (например, обработка запросов, выполнение вычислений, управление логикой бизнес-процессов).\n\n#### Поток данных и логика выполнения\n\nПоскольку конкретные детали реализации не предоставлены, можно предположить следующий общий сценарий функционирования `ControlPlaneService`:\n\n1. Получение запроса извне (через HTTP или другой канал).\n2. Валидация и преобразование входных данных.\n3. Вызов соответствующих методов или действий из объекта `ControlActionSet`.\n4. Запись изменений состояния системы (если это необходимо) и передача информации обратно пользователю.\n\n### Заключение\n\nТаким образом, `ControlPlaneService` играет роль центрального контроллера, координирующего работу различных компонентов системы через свои интерфейсы (каналы и действия). Его основная задача — обеспечивать согласованность и корректность изменения состояния системы в ответ на внешние запросы.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "ControlPlaneService" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] -} - -## Mismatches -- none \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_091824/full_chain_plba_code_retrieval_plba-fullchain-explain-create-runtime.json b/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_091824/full_chain_plba_code_retrieval_plba-fullchain-explain-create-runtime.json deleted file mode 100644 index 164815e..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_091824/full_chain_plba_code_retrieval_plba-fullchain-explain-create-runtime.json +++ /dev/null @@ -1,2372 +0,0 @@ -{ - "case_id": "plba-fullchain-explain-create-runtime", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_retrieval.yaml", - "runner": "runtime", - "mode": "full_chain", - "actual": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 19, - "llm_answer": "## Анализ функции `create_runtime` и архитектуры приложения\n\n### Описание задачи\n\nФункция `create_runtime` отвечает за инициализацию и настройку runtime окружения для приложения. Она является ключевым компонентом начальной загрузки системы и участвует в формировании конфигурации и окружения для дальнейшей работы.\n\n### Поток данных и архитектура\n\nАрхитектура приложения организована вокруг нескольких компонентов, которые взаимодействуют между собой через определенные роли (`pipeline_stage`) и участвуют в различных фазах жизненного цикла приложения:\n\n1. **ConfigFileLoader** \n - Роль: pipeline_stage \n - Ответственность: чтение и запись состояния атрибутов; участие в данных потока (dataflow slice 8) \n \n Этот компонент загружает конфигурацию из файла, что позволяет системе настраиваться на основе внешних параметров.\n\n2. **WorkflowPersistence** \n - Роль: pipeline_stage \n - Ответственность: оркестровка вызовов ролей-подчиненных, чтение и запись состояния атрибутов; участие в данных потока (dataflow slice 16) \n \n Эта сущность ответственна за сохранение и восстановление состояний задач и рабочих процессов, обеспечивая консистентность данных и целостность контекста выполнения.\n\n3. **HttpControlChannel** \n - Роль: pipeline_stage \n - Ответственность: чтение и запись состояния атрибутов; участие в данных потока (dataflow slice 10) \n \n Используется для управления каналами HTTP, позволяя приложению принимать запросы и обрабатывать их соответствующим образом.\n\n4. **InMemoryTaskQueue** \n - Роль: pipeline_stage \n - Ответственность: чтение и запись состояния атрибутов; участие в данных потока (dataflow slice 9) \n \n Обеспечивает управление очередями задач, храня их в памяти, что удобно для быстрого доступа и обработки.\n\n5. **UvicornThreadRunner** \n - Роль: pipeline_stage \n - Ответственность: чтение и запись состояния атрибутов; участие в данных потока (dataflow slice 24) \n \n Это класс, который запускает сервер на базе библиотеки uvicorn, управляя его рабочим процессом и обеспечивая выполнение HTTP-запросов асинхронно в отдельных потоках.\n\n### Поведение функции `create_runtime`\n\nФункция `create_runtime` выполняет следующие шаги:\n\n1. Инициализация и настройка конфигурации через объект класса `ConfigFileLoader`, чтобы загрузить необходимые параметры из внешнего файла конфигурации.\n2. Создание экземпляра объекта `WorkflowPersistence`, который управляет сохранением и восстановлением контекстных данных рабочих процессов.\n3. Настройка и запуск службы HTTP-канала с использованием `HttpControlChannel`.\n4. Запуск очереди задач через экземпляр `InMemoryTaskQueue`.\n5. Запуск сервера uvicorn через объект `UvicornThreadRunner`, что обеспечивает обработку входящих HTTP-запросов.\n\nТаким образом, функция `create_runtime` объединяет несколько ключевых компонентов и обеспечивает полное окружение для запуска и обслуживания прикладного уровня приложения.\n\n---\n\nЭтот анализ охватывает основные компоненты и роли, участвующие в процессе создания runtime-среды, а также описывает логику взаимодействия этих сущностей при выполнении задачи.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "create_runtime" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "passed": true, - "mismatches": [], - "details": { - "case_id": "plba-fullchain-explain-create-runtime", - "text": "Объясни функцию create_runtime", - "mode": "full_chain", - "run_started_at": "2026-03-12T09:18:24", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Объясни функцию create_runtime", - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "create_runtime", - "alternatives": [ - "create_runtime" - ], - "confidence": 0.99 - }, - "rag_count": 19, - "rag_rows": [ - { - "path": "src/plba/bootstrap.py", - "content": "function create_runtime\ncreate_runtime(module)", - "layer": "C1_SYMBOL_CATALOG", - "title": "create_runtime", - "span_start": 8, - "span_end": 29, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "qname": "create_runtime", - "kind": "function", - "signature": "create_runtime(module)", - "parent_symbol_id": null, - "package_or_module": "src.plba.bootstrap", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_runner.py", - "content": "UvicornThreadRunner\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (24)", - "layer": "C4_SEMANTIC_ROLES", - "title": "UvicornThreadRunner", - "span_start": 10, - "span_end": 61, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 11, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "fd55630045a02100df8877ac27d951ee08617d4598764394d48cb51fe067476a", - "symbol_name": "UvicornThreadRunner", - "qname": "UvicornThreadRunner", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 24, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "3779fdd2878b770e789a35bb2a89c9d79f13b61c26d7db1b3b683f9bb9e1623f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/persistence/workflow_persistence.py", - "content": "WorkflowPersistence\nrole: pipeline_stage\n\nResponsibilities:\n- orchestrates role-like calls (2)\n- reads and writes state attributes\n- participates in dataflow slices (16)", - "layer": "C4_SEMANTIC_ROLES", - "title": "WorkflowPersistence", - "span_start": 8, - "span_end": 54, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 15, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "7bd01ee45cf31f2d5c2e3e51656254860ac785d10cef9e0852cd4fba90857bae", - "symbol_name": "WorkflowPersistence", - "qname": "WorkflowPersistence", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 16, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "80e9410ddc639789b4353c2a1a757ba8d0d5b5bb6075b0b263b61551f04ae1f0", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (10)", - "layer": "C4_SEMANTIC_ROLES", - "title": "HttpControlChannel", - "span_start": 12, - "span_end": 57, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 21, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "1c9fbdc24819e5604c26ea55428a74310f03a03e1af197ed84846af61e42fdb0", - "symbol_name": "HttpControlChannel", - "qname": "HttpControlChannel", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 10, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/queue/in_memory.py", - "content": "InMemoryTaskQueue\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (9)", - "layer": "C4_SEMANTIC_ROLES", - "title": "InMemoryTaskQueue", - "span_start": 9, - "span_end": 38, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 22, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "2da04cb94544a3bcbf0943a95ad4bdd8710bcafaa32a02fd0e4de2178dcf3533", - "symbol_name": "InMemoryTaskQueue", - "qname": "InMemoryTaskQueue", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 9, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "58f0cc001ccda0eee4c6bc32ed83bd05eafd6b6644f1e8b4aa9eed3103db73dc", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/config/file_loader.py", - "content": "ConfigFileLoader\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (8)", - "layer": "C4_SEMANTIC_ROLES", - "title": "ConfigFileLoader", - "span_start": 11, - "span_end": 48, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 23, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "a8474eca8b6e9dc86ae67ed68b16fa5fb639ef08739c053e7b7195489765667f", - "symbol_name": "ConfigFileLoader", - "qname": "ConfigFileLoader", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 8, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "1f19ffebde5e38e4be5a5d5a678059a0f36dedb8fb8b3e00ab395c67106a87ea", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workers/supervisor.py", - "content": "WorkerSupervisor\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (6)", - "layer": "C4_SEMANTIC_ROLES", - "title": "WorkerSupervisor", - "span_start": 10, - "span_end": 59, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 25, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "c17b44e8d9e97d490989b21fa67d7c346cdda8a0472e4c41fb243c8846faa124", - "symbol_name": "WorkerSupervisor", - "qname": "WorkerSupervisor", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 6, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "77609d9d5927171cce7fc3a54897c183fd63068710c6362029b700937aae5eee", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/engine/workflow_engine.py", - "content": "WorkflowEngine\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (6)", - "layer": "C4_SEMANTIC_ROLES", - "title": "WorkflowEngine", - "span_start": 10, - "span_end": 86, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 25, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "57ec0a9f11c542c78e008684a888397e8d9ef4223671acb2567e631a0cbc70b4", - "symbol_name": "WorkflowEngine", - "qname": "WorkflowEngine", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 6, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "1057136e58a325cd5ab6f4e265d15665fb6a711b7022d9fab52a1a290afa2368", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/store.py", - "content": "TraceContextStore\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (6)", - "layer": "C4_SEMANTIC_ROLES", - "title": "TraceContextStore", - "span_start": 15, - "span_end": 52, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 25, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "b2dad4fbe16ffb11b58deba311c7739955c39d59f291b22181f33e9c8cce4059", - "symbol_name": "TraceContextStore", - "qname": "TraceContextStore", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 6, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "d369554f08fc92039c6edd5a2a1e73b23901533e8974459170bbd9347d263dc5", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/bootstrap.py", - "content": "create_runtime calls runtime.add_config_file", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "create_runtime:calls", - "span_start": 19, - "span_end": 19, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "4eaeec4ac55a59d5f66fd01c4754955f8fedaf4bc3df13fa769b352c7bfaacbb", - "edge_type": "calls", - "src_symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "src_qname": "create_runtime", - "dst_symbol_id": null, - "dst_ref": "runtime.add_config_file", - "resolution": "partial", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/bootstrap.py", - "content": "create_runtime reads_attr runtime.register_module", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "create_runtime:reads_attr", - "span_start": 28, - "span_end": 28, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "45516c79ff358dbf9b650a081668df0f66d2fe989300f985a1a78be6be166f8f", - "edge_type": "reads_attr", - "src_symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "src_qname": "create_runtime", - "dst_symbol_id": null, - "dst_ref": "runtime.register_module", - "resolution": "partial", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/bootstrap.py", - "content": "create_runtime instantiates RuntimeManager", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "create_runtime:instantiates", - "span_start": 17, - "span_end": 17, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "0adba17984f850ea1608c9e734d2dd5c325cfde3a8133123aa239e44935ad18e", - "edge_type": "instantiates", - "src_symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "src_qname": "create_runtime", - "dst_symbol_id": "27158ca220022eeb5083c6addf8a50775d45f7161284fd60aac48410105f4b98", - "dst_ref": "RuntimeManager", - "resolution": "resolved", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/bootstrap.py", - "content": "create_runtime calls runtime.register_module", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "create_runtime:calls", - "span_start": 28, - "span_end": 28, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "ab6003c3441addc1ba1b81edeca009165559f652f6b2cf424e5ae61b1f617de8", - "edge_type": "calls", - "src_symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "src_qname": "create_runtime", - "dst_symbol_id": null, - "dst_ref": "runtime.register_module", - "resolution": "partial", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/bootstrap.py", - "content": "create_runtime calls runtime.control_plane.register_channel", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "create_runtime:calls", - "span_start": 21, - "span_end": 27, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "2678250030b9ce47a3b3b55fac7897ac530367edc8374ac9d5e6ecafb1e483f0", - "edge_type": "calls", - "src_symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "src_qname": "create_runtime", - "dst_symbol_id": null, - "dst_ref": "runtime.control_plane.register_channel", - "resolution": "partial", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/bootstrap.py", - "content": "create_runtime reads_attr runtime.add_config_file", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "create_runtime:reads_attr", - "span_start": 19, - "span_end": 19, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "30d4e8aae984ab84d523e80d02f1caeda52d547fa3d2aa47be8845931cabbca2", - "edge_type": "reads_attr", - "src_symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "src_qname": "create_runtime", - "dst_symbol_id": null, - "dst_ref": "runtime.add_config_file", - "resolution": "partial", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/bootstrap.py", - "content": "def create_runtime(\n module: ApplicationModule,\n *,\n config_path: str | None = None,\n enable_http_control: bool = False,\n control_host: str = \"127.0.0.1\",\n control_port: int = 8080,\n control_timeout: int = 5,\n) -> RuntimeManager:\n runtime = RuntimeManager()\n if config_path is not None:\n runtime.add_config_file(config_path)\n if enable_http_control:\n runtime.control_plane.register_channel(\n HttpControlChannel(\n host=control_host,\n port=control_port,\n timeout=control_timeout,\n )\n )\n runtime.register_module(module)\n return runtime", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/plba/bootstrap.py:create_runtime", - "span_start": 8, - "span_end": 29, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.plba.bootstrap", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "llm_answer": "## Анализ функции `create_runtime` и архитектуры приложения\n\n### Описание задачи\n\nФункция `create_runtime` отвечает за инициализацию и настройку runtime окружения для приложения. Она является ключевым компонентом начальной загрузки системы и участвует в формировании конфигурации и окружения для дальнейшей работы.\n\n### Поток данных и архитектура\n\nАрхитектура приложения организована вокруг нескольких компонентов, которые взаимодействуют между собой через определенные роли (`pipeline_stage`) и участвуют в различных фазах жизненного цикла приложения:\n\n1. **ConfigFileLoader** \n - Роль: pipeline_stage \n - Ответственность: чтение и запись состояния атрибутов; участие в данных потока (dataflow slice 8) \n \n Этот компонент загружает конфигурацию из файла, что позволяет системе настраиваться на основе внешних параметров.\n\n2. **WorkflowPersistence** \n - Роль: pipeline_stage \n - Ответственность: оркестровка вызовов ролей-подчиненных, чтение и запись состояния атрибутов; участие в данных потока (dataflow slice 16) \n \n Эта сущность ответственна за сохранение и восстановление состояний задач и рабочих процессов, обеспечивая консистентность данных и целостность контекста выполнения.\n\n3. **HttpControlChannel** \n - Роль: pipeline_stage \n - Ответственность: чтение и запись состояния атрибутов; участие в данных потока (dataflow slice 10) \n \n Используется для управления каналами HTTP, позволяя приложению принимать запросы и обрабатывать их соответствующим образом.\n\n4. **InMemoryTaskQueue** \n - Роль: pipeline_stage \n - Ответственность: чтение и запись состояния атрибутов; участие в данных потока (dataflow slice 9) \n \n Обеспечивает управление очередями задач, храня их в памяти, что удобно для быстрого доступа и обработки.\n\n5. **UvicornThreadRunner** \n - Роль: pipeline_stage \n - Ответственность: чтение и запись состояния атрибутов; участие в данных потока (dataflow slice 24) \n \n Это класс, который запускает сервер на базе библиотеки uvicorn, управляя его рабочим процессом и обеспечивая выполнение HTTP-запросов асинхронно в отдельных потоках.\n\n### Поведение функции `create_runtime`\n\nФункция `create_runtime` выполняет следующие шаги:\n\n1. Инициализация и настройка конфигурации через объект класса `ConfigFileLoader`, чтобы загрузить необходимые параметры из внешнего файла конфигурации.\n2. Создание экземпляра объекта `WorkflowPersistence`, который управляет сохранением и восстановлением контекстных данных рабочих процессов.\n3. Настройка и запуск службы HTTP-канала с использованием `HttpControlChannel`.\n4. Запуск очереди задач через экземпляр `InMemoryTaskQueue`.\n5. Запуск сервера uvicorn через объект `UvicornThreadRunner`, что обеспечивает обработку входящих HTTP-запросов.\n\nТаким образом, функция `create_runtime` объединяет несколько ключевых компонентов и обеспечивает полное окружение для запуска и обслуживания прикладного уровня приложения.\n\n---\n\nЭтот анализ охватывает основные компоненты и роли, участвующие в процессе создания runtime-среды, а также описывает логику взаимодействия этих сущностей при выполнении задачи.", - "summary": { - "router": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "confidence": null - }, - "retrieval": { - "profile": "code", - "layers_hit": [ - "C0_SOURCE_CHUNKS", - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS", - "C4_SEMANTIC_ROLES" - ], - "evidence_sufficient": true - }, - "llm": { - "answer_status": "answered", - "groundedness": "grounded" - } - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "symbol_kind_hint": "function", - "symbol_candidates": [ - "create_runtime" - ], - "keyword_hints": [ - "create_runtime" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C0_SOURCE_CHUNKS": "exact_path_fetch", - "C4_SEMANTIC_ROLES": "exact_path_fetch", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C3_ENTRYPOINTS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 8, - "C4_SEMANTIC_ROLES": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C3_ENTRYPOINTS": 6 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C4_SEMANTIC_ROLES": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "create_runtime", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Объясни функцию create_runtime", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C4_SEMANTIC_ROLES", - "query": "Объясни функцию create_runtime", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "Объясни функцию create_runtime", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - }, - { - "layer": "C3_ENTRYPOINTS", - "query": "Объясни функцию create_runtime", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 1, - "candidates_after_filter": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 6, - "candidates_after_filter": 6 - }, - { - "layer": "C3_ENTRYPOINTS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 3, - "candidates_after_filter": 3 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "create_runtime", - "alternatives": [ - "create_runtime" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C4_SEMANTIC_ROLES", - "status": "hit", - "hit_count": 8, - "fail_reason": null - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 6, - "fail_reason": null - }, - { - "layer": "C3_ENTRYPOINTS", - "status": "hit", - "hit_count": 3, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "router": 1, - "symbol_resolution": 0, - "retrieval_total": 162, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 49, - "C0_SOURCE_CHUNKS": 24, - "C4_SEMANTIC_ROLES": 21, - "C2_DEPENDENCY_GRAPH": 50, - "C3_ENTRYPOINTS": 16 - }, - "merge_rank": 25, - "prompt_build": 0, - "llm_call": 6221 - }, - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 362, - "evidence_rows": 19, - "evidence_chars": 2136 - }, - "evidence_summary": [ - { - "layer": "C1_SYMBOL_CATALOG", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "count": 8, - "unique_paths": 8 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "count": 6, - "unique_paths": 1 - }, - { - "layer": "C3_ENTRYPOINTS", - "count": 3, - "unique_paths": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 1, - "unique_paths": 1 - } - ], - "prompt_template_id": "intent_code_qa_v1", - "system_prompt_version": "v1" - }, - "router": { - "conversation_mode": "START", - "keyword_hints": [ - "create_runtime" - ], - "path_scope": [] - }, - "llm": { - "used_evidence_count": 19, - "missing_evidence_reason": null - } - }, - "run_info": { - "case_id": "plba-fullchain-explain-create-runtime", - "mode": "full_chain", - "run_started_at": "2026-03-12T09:18:24", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - }, - "input_request": { - "text": "Объясни функцию create_runtime", - "normalized_query": "Объясни функцию create_runtime" - }, - "steps": [ - { - "step": "intent_router", - "input": { - "query": "Объясни функцию create_runtime" - }, - "output": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Объясни функцию create_runtime" - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "symbol_kind_hint": "function", - "symbol_candidates": [ - "create_runtime" - ], - "keyword_hints": [ - "create_runtime" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "timings_ms": { - "router": 1 - } - } - }, - { - "step": "retrieval", - "input": { - "query": "Объясни функцию create_runtime" - }, - "output": { - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "create_runtime", - "alternatives": [ - "create_runtime" - ], - "confidence": 0.99 - }, - "rag_count": 19, - "rag_rows": [ - { - "path": "src/plba/bootstrap.py", - "content": "function create_runtime\ncreate_runtime(module)", - "layer": "C1_SYMBOL_CATALOG", - "title": "create_runtime", - "span_start": 8, - "span_end": 29, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "qname": "create_runtime", - "kind": "function", - "signature": "create_runtime(module)", - "parent_symbol_id": null, - "package_or_module": "src.plba.bootstrap", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_runner.py", - "content": "UvicornThreadRunner\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (24)", - "layer": "C4_SEMANTIC_ROLES", - "title": "UvicornThreadRunner", - "span_start": 10, - "span_end": 61, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 11, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "fd55630045a02100df8877ac27d951ee08617d4598764394d48cb51fe067476a", - "symbol_name": "UvicornThreadRunner", - "qname": "UvicornThreadRunner", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 24, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "3779fdd2878b770e789a35bb2a89c9d79f13b61c26d7db1b3b683f9bb9e1623f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/persistence/workflow_persistence.py", - "content": "WorkflowPersistence\nrole: pipeline_stage\n\nResponsibilities:\n- orchestrates role-like calls (2)\n- reads and writes state attributes\n- participates in dataflow slices (16)", - "layer": "C4_SEMANTIC_ROLES", - "title": "WorkflowPersistence", - "span_start": 8, - "span_end": 54, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 15, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "7bd01ee45cf31f2d5c2e3e51656254860ac785d10cef9e0852cd4fba90857bae", - "symbol_name": "WorkflowPersistence", - "qname": "WorkflowPersistence", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 16, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "80e9410ddc639789b4353c2a1a757ba8d0d5b5bb6075b0b263b61551f04ae1f0", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (10)", - "layer": "C4_SEMANTIC_ROLES", - "title": "HttpControlChannel", - "span_start": 12, - "span_end": 57, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 21, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "1c9fbdc24819e5604c26ea55428a74310f03a03e1af197ed84846af61e42fdb0", - "symbol_name": "HttpControlChannel", - "qname": "HttpControlChannel", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 10, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/queue/in_memory.py", - "content": "InMemoryTaskQueue\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (9)", - "layer": "C4_SEMANTIC_ROLES", - "title": "InMemoryTaskQueue", - "span_start": 9, - "span_end": 38, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 22, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "2da04cb94544a3bcbf0943a95ad4bdd8710bcafaa32a02fd0e4de2178dcf3533", - "symbol_name": "InMemoryTaskQueue", - "qname": "InMemoryTaskQueue", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 9, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "58f0cc001ccda0eee4c6bc32ed83bd05eafd6b6644f1e8b4aa9eed3103db73dc", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/config/file_loader.py", - "content": "ConfigFileLoader\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (8)", - "layer": "C4_SEMANTIC_ROLES", - "title": "ConfigFileLoader", - "span_start": 11, - "span_end": 48, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 23, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "a8474eca8b6e9dc86ae67ed68b16fa5fb639ef08739c053e7b7195489765667f", - "symbol_name": "ConfigFileLoader", - "qname": "ConfigFileLoader", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 8, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "1f19ffebde5e38e4be5a5d5a678059a0f36dedb8fb8b3e00ab395c67106a87ea", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workers/supervisor.py", - "content": "WorkerSupervisor\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (6)", - "layer": "C4_SEMANTIC_ROLES", - "title": "WorkerSupervisor", - "span_start": 10, - "span_end": 59, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 25, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "c17b44e8d9e97d490989b21fa67d7c346cdda8a0472e4c41fb243c8846faa124", - "symbol_name": "WorkerSupervisor", - "qname": "WorkerSupervisor", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 6, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "77609d9d5927171cce7fc3a54897c183fd63068710c6362029b700937aae5eee", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/engine/workflow_engine.py", - "content": "WorkflowEngine\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (6)", - "layer": "C4_SEMANTIC_ROLES", - "title": "WorkflowEngine", - "span_start": 10, - "span_end": 86, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 25, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "57ec0a9f11c542c78e008684a888397e8d9ef4223671acb2567e631a0cbc70b4", - "symbol_name": "WorkflowEngine", - "qname": "WorkflowEngine", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 6, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "1057136e58a325cd5ab6f4e265d15665fb6a711b7022d9fab52a1a290afa2368", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/store.py", - "content": "TraceContextStore\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (6)", - "layer": "C4_SEMANTIC_ROLES", - "title": "TraceContextStore", - "span_start": 15, - "span_end": 52, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 25, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "b2dad4fbe16ffb11b58deba311c7739955c39d59f291b22181f33e9c8cce4059", - "symbol_name": "TraceContextStore", - "qname": "TraceContextStore", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 6, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "d369554f08fc92039c6edd5a2a1e73b23901533e8974459170bbd9347d263dc5", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/bootstrap.py", - "content": "create_runtime calls runtime.add_config_file", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "create_runtime:calls", - "span_start": 19, - "span_end": 19, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "4eaeec4ac55a59d5f66fd01c4754955f8fedaf4bc3df13fa769b352c7bfaacbb", - "edge_type": "calls", - "src_symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "src_qname": "create_runtime", - "dst_symbol_id": null, - "dst_ref": "runtime.add_config_file", - "resolution": "partial", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/bootstrap.py", - "content": "create_runtime reads_attr runtime.register_module", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "create_runtime:reads_attr", - "span_start": 28, - "span_end": 28, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "45516c79ff358dbf9b650a081668df0f66d2fe989300f985a1a78be6be166f8f", - "edge_type": "reads_attr", - "src_symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "src_qname": "create_runtime", - "dst_symbol_id": null, - "dst_ref": "runtime.register_module", - "resolution": "partial", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/bootstrap.py", - "content": "create_runtime instantiates RuntimeManager", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "create_runtime:instantiates", - "span_start": 17, - "span_end": 17, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "0adba17984f850ea1608c9e734d2dd5c325cfde3a8133123aa239e44935ad18e", - "edge_type": "instantiates", - "src_symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "src_qname": "create_runtime", - "dst_symbol_id": "27158ca220022eeb5083c6addf8a50775d45f7161284fd60aac48410105f4b98", - "dst_ref": "RuntimeManager", - "resolution": "resolved", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/bootstrap.py", - "content": "create_runtime calls runtime.register_module", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "create_runtime:calls", - "span_start": 28, - "span_end": 28, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "ab6003c3441addc1ba1b81edeca009165559f652f6b2cf424e5ae61b1f617de8", - "edge_type": "calls", - "src_symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "src_qname": "create_runtime", - "dst_symbol_id": null, - "dst_ref": "runtime.register_module", - "resolution": "partial", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/bootstrap.py", - "content": "create_runtime calls runtime.control_plane.register_channel", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "create_runtime:calls", - "span_start": 21, - "span_end": 27, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "2678250030b9ce47a3b3b55fac7897ac530367edc8374ac9d5e6ecafb1e483f0", - "edge_type": "calls", - "src_symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "src_qname": "create_runtime", - "dst_symbol_id": null, - "dst_ref": "runtime.control_plane.register_channel", - "resolution": "partial", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/bootstrap.py", - "content": "create_runtime reads_attr runtime.add_config_file", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "create_runtime:reads_attr", - "span_start": 19, - "span_end": 19, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "30d4e8aae984ab84d523e80d02f1caeda52d547fa3d2aa47be8845931cabbca2", - "edge_type": "reads_attr", - "src_symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "src_qname": "create_runtime", - "dst_symbol_id": null, - "dst_ref": "runtime.add_config_file", - "resolution": "partial", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/bootstrap.py", - "content": "def create_runtime(\n module: ApplicationModule,\n *,\n config_path: str | None = None,\n enable_http_control: bool = False,\n control_host: str = \"127.0.0.1\",\n control_port: int = 8080,\n control_timeout: int = 5,\n) -> RuntimeManager:\n runtime = RuntimeManager()\n if config_path is not None:\n runtime.add_config_file(config_path)\n if enable_http_control:\n runtime.control_plane.register_channel(\n HttpControlChannel(\n host=control_host,\n port=control_port,\n timeout=control_timeout,\n )\n )\n runtime.register_module(module)\n return runtime", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/plba/bootstrap.py:create_runtime", - "span_start": 8, - "span_end": 29, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.plba.bootstrap", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ] - }, - "diagnostics": { - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C0_SOURCE_CHUNKS": "exact_path_fetch", - "C4_SEMANTIC_ROLES": "exact_path_fetch", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C3_ENTRYPOINTS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 8, - "C4_SEMANTIC_ROLES": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C3_ENTRYPOINTS": 6 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C4_SEMANTIC_ROLES": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "create_runtime", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Объясни функцию create_runtime", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C4_SEMANTIC_ROLES", - "query": "Объясни функцию create_runtime", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "Объясни функцию create_runtime", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - }, - { - "layer": "C3_ENTRYPOINTS", - "query": "Объясни функцию create_runtime", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 1, - "candidates_after_filter": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 6, - "candidates_after_filter": 6 - }, - { - "layer": "C3_ENTRYPOINTS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 3, - "candidates_after_filter": 3 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "create_runtime", - "alternatives": [ - "create_runtime" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C4_SEMANTIC_ROLES", - "status": "hit", - "hit_count": 8, - "fail_reason": null - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 6, - "fail_reason": null - }, - { - "layer": "C3_ENTRYPOINTS", - "status": "hit", - "hit_count": 3, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "symbol_resolution": 0, - "retrieval_total": 162, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 49, - "C0_SOURCE_CHUNKS": 24, - "C4_SEMANTIC_ROLES": 21, - "C2_DEPENDENCY_GRAPH": 50, - "C3_ENTRYPOINTS": 16 - }, - "merge_rank": 25 - } - } - }, - { - "step": "llm_answer", - "input": { - "query": "Объясни функцию create_runtime", - "rag_count": 19 - }, - "output": { - "llm_answer": "## Анализ функции `create_runtime` и архитектуры приложения\n\n### Описание задачи\n\nФункция `create_runtime` отвечает за инициализацию и настройку runtime окружения для приложения. Она является ключевым компонентом начальной загрузки системы и участвует в формировании конфигурации и окружения для дальнейшей работы.\n\n### Поток данных и архитектура\n\nАрхитектура приложения организована вокруг нескольких компонентов, которые взаимодействуют между собой через определенные роли (`pipeline_stage`) и участвуют в различных фазах жизненного цикла приложения:\n\n1. **ConfigFileLoader** \n - Роль: pipeline_stage \n - Ответственность: чтение и запись состояния атрибутов; участие в данных потока (dataflow slice 8) \n \n Этот компонент загружает конфигурацию из файла, что позволяет системе настраиваться на основе внешних параметров.\n\n2. **WorkflowPersistence** \n - Роль: pipeline_stage \n - Ответственность: оркестровка вызовов ролей-подчиненных, чтение и запись состояния атрибутов; участие в данных потока (dataflow slice 16) \n \n Эта сущность ответственна за сохранение и восстановление состояний задач и рабочих процессов, обеспечивая консистентность данных и целостность контекста выполнения.\n\n3. **HttpControlChannel** \n - Роль: pipeline_stage \n - Ответственность: чтение и запись состояния атрибутов; участие в данных потока (dataflow slice 10) \n \n Используется для управления каналами HTTP, позволяя приложению принимать запросы и обрабатывать их соответствующим образом.\n\n4. **InMemoryTaskQueue** \n - Роль: pipeline_stage \n - Ответственность: чтение и запись состояния атрибутов; участие в данных потока (dataflow slice 9) \n \n Обеспечивает управление очередями задач, храня их в памяти, что удобно для быстрого доступа и обработки.\n\n5. **UvicornThreadRunner** \n - Роль: pipeline_stage \n - Ответственность: чтение и запись состояния атрибутов; участие в данных потока (dataflow slice 24) \n \n Это класс, который запускает сервер на базе библиотеки uvicorn, управляя его рабочим процессом и обеспечивая выполнение HTTP-запросов асинхронно в отдельных потоках.\n\n### Поведение функции `create_runtime`\n\nФункция `create_runtime` выполняет следующие шаги:\n\n1. Инициализация и настройка конфигурации через объект класса `ConfigFileLoader`, чтобы загрузить необходимые параметры из внешнего файла конфигурации.\n2. Создание экземпляра объекта `WorkflowPersistence`, который управляет сохранением и восстановлением контекстных данных рабочих процессов.\n3. Настройка и запуск службы HTTP-канала с использованием `HttpControlChannel`.\n4. Запуск очереди задач через экземпляр `InMemoryTaskQueue`.\n5. Запуск сервера uvicorn через объект `UvicornThreadRunner`, что обеспечивает обработку входящих HTTP-запросов.\n\nТаким образом, функция `create_runtime` объединяет несколько ключевых компонентов и обеспечивает полное окружение для запуска и обслуживания прикладного уровня приложения.\n\n---\n\nЭтот анализ охватывает основные компоненты и роли, участвующие в процессе создания runtime-среды, а также описывает логику взаимодействия этих сущностей при выполнении задачи." - }, - "diagnostics": { - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 362, - "evidence_rows": 19, - "evidence_chars": 2136 - }, - "evidence_summary": [ - { - "layer": "C1_SYMBOL_CATALOG", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "count": 8, - "unique_paths": 8 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "count": 6, - "unique_paths": 1 - }, - { - "layer": "C3_ENTRYPOINTS", - "count": 3, - "unique_paths": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 1, - "unique_paths": 1 - } - ], - "prompt_template_id": "intent_code_qa_v1", - "system_prompt_version": "v1" - }, - "timings_ms": { - "prompt_build": 0, - "llm_call": 6221 - } - } - } - ] - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_091824/full_chain_plba_code_retrieval_plba-fullchain-explain-create-runtime.md b/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_091824/full_chain_plba_code_retrieval_plba-fullchain-explain-create-runtime.md deleted file mode 100644 index 27acbe6..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_091824/full_chain_plba_code_retrieval_plba-fullchain-explain-create-runtime.md +++ /dev/null @@ -1,34 +0,0 @@ -# plba-fullchain-explain-create-runtime - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_retrieval.yaml -- runner: runtime -- mode: full_chain -- passed: True - -## Query -Объясни функцию create_runtime - -## Actual -{ - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 19, - "llm_answer": "## Анализ функции `create_runtime` и архитектуры приложения\n\n### Описание задачи\n\nФункция `create_runtime` отвечает за инициализацию и настройку runtime окружения для приложения. Она является ключевым компонентом начальной загрузки системы и участвует в формировании конфигурации и окружения для дальнейшей работы.\n\n### Поток данных и архитектура\n\nАрхитектура приложения организована вокруг нескольких компонентов, которые взаимодействуют между собой через определенные роли (`pipeline_stage`) и участвуют в различных фазах жизненного цикла приложения:\n\n1. **ConfigFileLoader** \n - Роль: pipeline_stage \n - Ответственность: чтение и запись состояния атрибутов; участие в данных потока (dataflow slice 8) \n \n Этот компонент загружает конфигурацию из файла, что позволяет системе настраиваться на основе внешних параметров.\n\n2. **WorkflowPersistence** \n - Роль: pipeline_stage \n - Ответственность: оркестровка вызовов ролей-подчиненных, чтение и запись состояния атрибутов; участие в данных потока (dataflow slice 16) \n \n Эта сущность ответственна за сохранение и восстановление состояний задач и рабочих процессов, обеспечивая консистентность данных и целостность контекста выполнения.\n\n3. **HttpControlChannel** \n - Роль: pipeline_stage \n - Ответственность: чтение и запись состояния атрибутов; участие в данных потока (dataflow slice 10) \n \n Используется для управления каналами HTTP, позволяя приложению принимать запросы и обрабатывать их соответствующим образом.\n\n4. **InMemoryTaskQueue** \n - Роль: pipeline_stage \n - Ответственность: чтение и запись состояния атрибутов; участие в данных потока (dataflow slice 9) \n \n Обеспечивает управление очередями задач, храня их в памяти, что удобно для быстрого доступа и обработки.\n\n5. **UvicornThreadRunner** \n - Роль: pipeline_stage \n - Ответственность: чтение и запись состояния атрибутов; участие в данных потока (dataflow slice 24) \n \n Это класс, который запускает сервер на базе библиотеки uvicorn, управляя его рабочим процессом и обеспечивая выполнение HTTP-запросов асинхронно в отдельных потоках.\n\n### Поведение функции `create_runtime`\n\nФункция `create_runtime` выполняет следующие шаги:\n\n1. Инициализация и настройка конфигурации через объект класса `ConfigFileLoader`, чтобы загрузить необходимые параметры из внешнего файла конфигурации.\n2. Создание экземпляра объекта `WorkflowPersistence`, который управляет сохранением и восстановлением контекстных данных рабочих процессов.\n3. Настройка и запуск службы HTTP-канала с использованием `HttpControlChannel`.\n4. Запуск очереди задач через экземпляр `InMemoryTaskQueue`.\n5. Запуск сервера uvicorn через объект `UvicornThreadRunner`, что обеспечивает обработку входящих HTTP-запросов.\n\nТаким образом, функция `create_runtime` объединяет несколько ключевых компонентов и обеспечивает полное окружение для запуска и обслуживания прикладного уровня приложения.\n\n---\n\nЭтот анализ охватывает основные компоненты и роли, участвующие в процессе создания runtime-среды, а также описывает логику взаимодействия этих сущностей при выполнении задачи.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "create_runtime" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] -} - -## Mismatches -- none \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_091824/full_chain_plba_code_retrieval_plba-fullchain-explain-http-control-channel.json b/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_091824/full_chain_plba_code_retrieval_plba-fullchain-explain-http-control-channel.json deleted file mode 100644 index cff3923..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_091824/full_chain_plba_code_retrieval_plba-fullchain-explain-http-control-channel.json +++ /dev/null @@ -1,2564 +0,0 @@ -{ - "case_id": "plba-fullchain-explain-http-control-channel", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_retrieval.yaml", - "runner": "runtime", - "mode": "full_chain", - "actual": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 19, - "llm_answer": "## Анализ класса `HttpControlChannel`\n\n### Файл и путь:\n- **Файл:** `src/app_runtime/control/http_channel.py`\n- **Класс:** `HttpControlChannel`\n\n### Описание роли и ответственности:\n- **Роль:** `pipeline_stage`\n- **Ответственности:**\n - Чтение и запись атрибутов состояния (`reads and writes state attributes`).\n - Участие в \"слайсах\" данных потока (`participates in dataflow slices`).\n - В документации указано участие в 10 слайсах данных.\n\n### Родительский класс:\n- Наследуется от класса `ControlChannel`, объявленного в файле `src/app_runtime/control/base.py`.\n \n### Подразумеваемая архитектура и поток данных:\n1. **Родительская сущность** (`ControlChannel`) является базовой моделью для каналов управления, определяющей основные обязанности модели.\n - Пример: Класс может иметь стандартный набор методов или атрибутов, которые наследуются всеми дочерними сущностями.\n \n2. **Дочерний класс** (`HttpControlChannel`) расширяет функциональность родительского класса, добавляя специфические обязанности HTTP-канала.\n - Обеспечивает взаимодействие с HTTP протоколом, вероятно, через асинхронные HTTP запросы и ответы.\n\n3. **Участие в данныхфлоу**:\n - Согласно описанию, канал участвует в 10 различных слайсах данных. Это означает, что он обрабатывает части общего потока данных, разделенного на несколько сегментов (\"слайсов\"). \n - Каждый сегмент предназначен для определенной стадии обработки информации внутри системы.\n\n4. **Связь с другими компонентами**:\n - Контроллер взаимодействует с сервисом контроля (`ControlPlaneService`), который также упоминается как `pipeline_stage`. Вероятно, это указывает на то, что контроллер совместно с этим сервисом управляет состоянием и потоком данных между различными стадиями обработки.\n\n### Возможное внутреннее устройство и реализация:\n- Возможно наличие методов чтения и записи атрибутов состояния, а также механизмов отправки и получения сообщений через HTTP-запросы и ответы.\n- Вероятно, присутствуют методы инициализации и конфигурации канала.\n- Поскольку указано, что участвует в нескольких слайсах данных, предполагается наличие инфраструктуры для поддержки параллельного выполнения задач и передачи данных между ними.\n\n### Заключение:\nКанал управления `HttpControlChannel` реализует механизм взаимодействия с HTTP-протоколом, отвечая за чтение и запись состояний и участвуя в передаче данных между стадиями обработки данных. Он наследует базовые принципы поведения от родительской сущности `ControlChannel`, обеспечивая специализированную функциональность для работы с HTTP-соединениями и потоками данных.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "HttpControlChannel" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "passed": true, - "mismatches": [], - "details": { - "case_id": "plba-fullchain-explain-http-control-channel", - "text": "Объясни класс HttpControlChannel", - "mode": "full_chain", - "run_started_at": "2026-03-12T09:18:24", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Объясни класс HttpControlChannel", - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "HttpControlChannel", - "alternatives": [ - "HttpControlChannel" - ], - "confidence": 0.99 - }, - "rag_count": 19, - "rag_rows": [ - { - "path": "src/app_runtime/control/http_channel.py", - "content": "class HttpControlChannel\nHttpControlChannel(ControlChannel)", - "layer": "C1_SYMBOL_CATALOG", - "title": "HttpControlChannel", - "span_start": 12, - "span_end": 57, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "1c9fbdc24819e5604c26ea55428a74310f03a03e1af197ed84846af61e42fdb0", - "qname": "HttpControlChannel", - "kind": "class", - "signature": "HttpControlChannel(ControlChannel)", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.control.http_channel", - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (10)", - "layer": "C4_SEMANTIC_ROLES", - "title": "HttpControlChannel", - "span_start": 12, - "span_end": 57, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 21, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "1c9fbdc24819e5604c26ea55428a74310f03a03e1af197ed84846af61e42fdb0", - "symbol_name": "HttpControlChannel", - "qname": "HttpControlChannel", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 10, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "ControlChannel\nrole: model\n\nResponsibilities:\n- default model role", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlChannel", - "span_start": 21, - "span_end": 28, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 40, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "cfcfe9a311d3a2dbdaf32ac4ccd73c0eb9a117f830591a1c0867ee97d46204ff", - "symbol_name": "ControlChannel", - "qname": "ControlChannel", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "ControlActionSet\nrole: model\n\nResponsibilities:\n- default model role", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlActionSet", - "span_start": 14, - "span_end": 18, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 40, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "46eb026cb3313415ec47b82dd22f84f4d112c9d987e8b1716dcb0baa1cce8988", - "symbol_name": "ControlActionSet", - "qname": "ControlActionSet", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests service\n- reads and writes state attributes\n- participates in dataflow slices (5)", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlPlaneService", - "span_start": 12, - "span_end": 52, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 68, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "b13471e5916986dccffb53fab613812842965705e6b3a89ae549d30c9e91e9aa", - "symbol_name": "ControlPlaneService", - "qname": "ControlPlaneService", - "role": "pipeline_stage", - "confidence": 0.57, - "dataflow_participation": 5, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_runner.py", - "content": "UvicornThreadRunner\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (24)", - "layer": "C4_SEMANTIC_ROLES", - "title": "UvicornThreadRunner", - "span_start": 10, - "span_end": 61, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 11, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "fd55630045a02100df8877ac27d951ee08617d4598764394d48cb51fe067476a", - "symbol_name": "UvicornThreadRunner", - "qname": "UvicornThreadRunner", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 24, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "3779fdd2878b770e789a35bb2a89c9d79f13b61c26d7db1b3b683f9bb9e1623f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "HttpControlAppFactory\nrole: factory\n\nResponsibilities:\n- name suffix suggests factory", - "layer": "C4_SEMANTIC_ROLES", - "title": "HttpControlAppFactory", - "span_start": 15, - "span_end": 53, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 39, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "9b3502a5fb408b273223db13264349cf500de24915b6c649d9ea8970d0dfd8e0", - "symbol_name": "HttpControlAppFactory", - "qname": "HttpControlAppFactory", - "role": "factory", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/persistence/workflow_persistence.py", - "content": "WorkflowPersistence\nrole: pipeline_stage\n\nResponsibilities:\n- orchestrates role-like calls (2)\n- reads and writes state attributes\n- participates in dataflow slices (16)", - "layer": "C4_SEMANTIC_ROLES", - "title": "WorkflowPersistence", - "span_start": 8, - "span_end": 54, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 15, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "7bd01ee45cf31f2d5c2e3e51656254860ac785d10cef9e0852cd4fba90857bae", - "symbol_name": "WorkflowPersistence", - "qname": "WorkflowPersistence", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 16, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "80e9410ddc639789b4353c2a1a757ba8d0d5b5bb6075b0b263b61551f04ae1f0", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/queue/in_memory.py", - "content": "InMemoryTaskQueue\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (9)", - "layer": "C4_SEMANTIC_ROLES", - "title": "InMemoryTaskQueue", - "span_start": 9, - "span_end": 38, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 22, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "2da04cb94544a3bcbf0943a95ad4bdd8710bcafaa32a02fd0e4de2178dcf3533", - "symbol_name": "InMemoryTaskQueue", - "qname": "InMemoryTaskQueue", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 9, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "58f0cc001ccda0eee4c6bc32ed83bd05eafd6b6644f1e8b4aa9eed3103db73dc", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel.__init__\n -> HttpControlChannel._runner\n -> HttpControlChannel.start", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "HttpControlChannel.__init__:dataflow_slice", - "span_start": 15, - "span_end": 22, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "51d73913df709152258ed1b9a8c8f4eb3c575eccfe6b982aef0b28e0789a29da", - "edge_type": "dataflow_slice", - "src_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "src_qname": "HttpControlChannel.__init__", - "dst_symbol_id": "d1933f04137f52535b6525f1b93ff2cd83bfb216b480e887e791ed1714cda8e0", - "dst_ref": "HttpControlChannel.start", - "resolution": "resolved", - "slice_id": "51d73913df709152258ed1b9a8c8f4eb3c575eccfe6b982aef0b28e0789a29da", - "root_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "path_symbols": [ - "HttpControlChannel.__init__", - "HttpControlChannel._runner", - "HttpControlChannel.start" - ], - "path_symbol_ids": [ - "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "d1933f04137f52535b6525f1b93ff2cd83bfb216b480e887e791ed1714cda8e0" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel.__init__\n -> HttpControlChannel._runner\n -> HttpControlChannel.port", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "HttpControlChannel.__init__:dataflow_slice", - "span_start": 15, - "span_end": 29, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "c7167bab7218bb768ad7c11bfb40d1a3096e6071dd7817bba5fd864cf8f6de13", - "edge_type": "dataflow_slice", - "src_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "src_qname": "HttpControlChannel.__init__", - "dst_symbol_id": "3632ce8227f4a31e0768f2fb021a4d1ba28e1202633aa0f2fac902295931280f", - "dst_ref": "HttpControlChannel.port", - "resolution": "resolved", - "slice_id": "c7167bab7218bb768ad7c11bfb40d1a3096e6071dd7817bba5fd864cf8f6de13", - "root_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "path_symbols": [ - "HttpControlChannel.__init__", - "HttpControlChannel._runner", - "HttpControlChannel.port" - ], - "path_symbol_ids": [ - "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "3632ce8227f4a31e0768f2fb021a4d1ba28e1202633aa0f2fac902295931280f" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel.__init__\n -> HttpControlChannel._timeout\n -> HttpControlChannel._health_response", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "HttpControlChannel.__init__:dataflow_slice", - "span_start": 14, - "span_end": 34, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "f858f5c9e575f6c4cdfe3853571b7ee21d1f628a443541d2037c3dc9d0790bef", - "edge_type": "dataflow_slice", - "src_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "src_qname": "HttpControlChannel.__init__", - "dst_symbol_id": "e84bf04e9cd2127df235b7064d05f47e19f19a89c7c82f4c247231d4e8fa426a", - "dst_ref": "HttpControlChannel._health_response", - "resolution": "resolved", - "slice_id": "f858f5c9e575f6c4cdfe3853571b7ee21d1f628a443541d2037c3dc9d0790bef", - "root_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "path_symbols": [ - "HttpControlChannel.__init__", - "HttpControlChannel._timeout", - "HttpControlChannel._health_response" - ], - "path_symbol_ids": [ - "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "e84bf04e9cd2127df235b7064d05f47e19f19a89c7c82f4c247231d4e8fa426a" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel.__init__\n -> HttpControlChannel._timeout\n -> HttpControlChannel._action_response", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "HttpControlChannel.__init__:dataflow_slice", - "span_start": 14, - "span_end": 47, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "c3ef21fcae96c82c00be74b3ab827d4af2085d89cb3fa5521c19a174aad84dbb", - "edge_type": "dataflow_slice", - "src_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "src_qname": "HttpControlChannel.__init__", - "dst_symbol_id": "e64969024ccaeb34d8d91473fad07b3b3d341875846392e7a006406c7ada1954", - "dst_ref": "HttpControlChannel._action_response", - "resolution": "resolved", - "slice_id": "c3ef21fcae96c82c00be74b3ab827d4af2085d89cb3fa5521c19a174aad84dbb", - "root_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "path_symbols": [ - "HttpControlChannel.__init__", - "HttpControlChannel._timeout", - "HttpControlChannel._action_response" - ], - "path_symbol_ids": [ - "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "e64969024ccaeb34d8d91473fad07b3b3d341875846392e7a006406c7ada1954" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel.__init__\n -> HttpControlChannel._runner\n -> HttpControlChannel.stop", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "HttpControlChannel.__init__:dataflow_slice", - "span_start": 15, - "span_end": 25, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "0f827ef81a990258a8a74381c8564a8361afa6712dba3200592659c939adcb9d", - "edge_type": "dataflow_slice", - "src_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "src_qname": "HttpControlChannel.__init__", - "dst_symbol_id": "f29ab212620093d72be20e26c5a399624c7939a6056a728762ed3f84a250bfa3", - "dst_ref": "HttpControlChannel.stop", - "resolution": "resolved", - "slice_id": "0f827ef81a990258a8a74381c8564a8361afa6712dba3200592659c939adcb9d", - "root_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "path_symbols": [ - "HttpControlChannel.__init__", - "HttpControlChannel._runner", - "HttpControlChannel.stop" - ], - "path_symbol_ids": [ - "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "f29ab212620093d72be20e26c5a399624c7939a6056a728762ed3f84a250bfa3" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel.__init__\n -> HttpControlChannel._factory\n -> HttpControlChannel.start", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "HttpControlChannel.__init__:dataflow_slice", - "span_start": 16, - "span_end": 21, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e61ec25ded7dbe380d95ce2abcbc1d7a2d2afde5aa8453866df8706dfb7d6ddb", - "edge_type": "dataflow_slice", - "src_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "src_qname": "HttpControlChannel.__init__", - "dst_symbol_id": "d1933f04137f52535b6525f1b93ff2cd83bfb216b480e887e791ed1714cda8e0", - "dst_ref": "HttpControlChannel.start", - "resolution": "resolved", - "slice_id": "e61ec25ded7dbe380d95ce2abcbc1d7a2d2afde5aa8453866df8706dfb7d6ddb", - "root_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "path_symbols": [ - "HttpControlChannel.__init__", - "HttpControlChannel._factory", - "HttpControlChannel.start" - ], - "path_symbol_ids": [ - "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "d1933f04137f52535b6525f1b93ff2cd83bfb216b480e887e791ed1714cda8e0" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "class HttpControlChannel(ControlChannel):\n def __init__(self, host: str, port: int, timeout: int) -> None:\n self._timeout = timeout\n self._runner = UvicornThreadRunner(host, port, timeout)\n self._factory = HttpControlAppFactory()\n self._actions: ControlActionSet | None = None\n\n async def start(self, actions: ControlActionSet) -> None:\n self._actions = actions\n app = self._factory.create(self._health_response, self._action_response)\n await self._runner.start(app)\n\n async def stop(self) -> None:\n await self._runner.stop()\n\n @property\n def port(self) -> int:\n return self._runner.port\n\n async def _health_response(self) -> dict[str, object]:\n if self._actions is None:\n return {\"status\": \"unhealthy\", \"detail\": \"control actions are not configured\"}\n return await asyncio.wait_for(self._actions.health(), timeout=float(self._timeout))\n\n async def _action_response(self, action: str, _client_source: str = \"unknown\") -> JSONResponse:\n if self._actions is None:\n return JSONResponse(content={\"status\": \"error\", \"detail\": f\"{action} handler is not configured\"}, status_code=404)\n callbacks = {\n \"start\": self._actions.start,\n \"stop\": self._actions.stop,\n \"status\": self._actions.status,\n }\n callback = callbacks.get(action)\n if callback is None:\n return JSONResponse(content={\"status\": \"error\", \"detail\": f\"unsupported action: {action}\"}, status_code=404)\n action_timeout = max(float(self._timeout), 10.0) if action in {\"start\", \"stop\"} else float(self._timeout)\n try:\n detail = await asyncio.wait_for(callback(), timeout=action_timeout)\n except asyncio.TimeoutError:\n return JSONResponse(\n content={\"status\": \"accepted\", \"detail\": f\"{action} operation is still in progress\"},\n status_code=202,\n )\n except Exception as exc:\n return JSONResponse(content={\"status\": \"error\", \"detail\": str(exc)}, status_code=500)\n return JSONResponse(content={\"status\": \"ok\", \"detail\": detail or f\"{action} action accepted\"}, status_code=200)", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/http_channel.py:HttpControlChannel", - "span_start": 12, - "span_end": 57, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.http_channel", - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "llm_answer": "## Анализ класса `HttpControlChannel`\n\n### Файл и путь:\n- **Файл:** `src/app_runtime/control/http_channel.py`\n- **Класс:** `HttpControlChannel`\n\n### Описание роли и ответственности:\n- **Роль:** `pipeline_stage`\n- **Ответственности:**\n - Чтение и запись атрибутов состояния (`reads and writes state attributes`).\n - Участие в \"слайсах\" данных потока (`participates in dataflow slices`).\n - В документации указано участие в 10 слайсах данных.\n\n### Родительский класс:\n- Наследуется от класса `ControlChannel`, объявленного в файле `src/app_runtime/control/base.py`.\n \n### Подразумеваемая архитектура и поток данных:\n1. **Родительская сущность** (`ControlChannel`) является базовой моделью для каналов управления, определяющей основные обязанности модели.\n - Пример: Класс может иметь стандартный набор методов или атрибутов, которые наследуются всеми дочерними сущностями.\n \n2. **Дочерний класс** (`HttpControlChannel`) расширяет функциональность родительского класса, добавляя специфические обязанности HTTP-канала.\n - Обеспечивает взаимодействие с HTTP протоколом, вероятно, через асинхронные HTTP запросы и ответы.\n\n3. **Участие в данныхфлоу**:\n - Согласно описанию, канал участвует в 10 различных слайсах данных. Это означает, что он обрабатывает части общего потока данных, разделенного на несколько сегментов (\"слайсов\"). \n - Каждый сегмент предназначен для определенной стадии обработки информации внутри системы.\n\n4. **Связь с другими компонентами**:\n - Контроллер взаимодействует с сервисом контроля (`ControlPlaneService`), который также упоминается как `pipeline_stage`. Вероятно, это указывает на то, что контроллер совместно с этим сервисом управляет состоянием и потоком данных между различными стадиями обработки.\n\n### Возможное внутреннее устройство и реализация:\n- Возможно наличие методов чтения и записи атрибутов состояния, а также механизмов отправки и получения сообщений через HTTP-запросы и ответы.\n- Вероятно, присутствуют методы инициализации и конфигурации канала.\n- Поскольку указано, что участвует в нескольких слайсах данных, предполагается наличие инфраструктуры для поддержки параллельного выполнения задач и передачи данных между ними.\n\n### Заключение:\nКанал управления `HttpControlChannel` реализует механизм взаимодействия с HTTP-протоколом, отвечая за чтение и запись состояний и участвуя в передаче данных между стадиями обработки данных. Он наследует базовые принципы поведения от родительской сущности `ControlChannel`, обеспечивая специализированную функциональность для работы с HTTP-соединениями и потоками данных.", - "summary": { - "router": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "confidence": null - }, - "retrieval": { - "profile": "code", - "layers_hit": [ - "C0_SOURCE_CHUNKS", - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS", - "C4_SEMANTIC_ROLES" - ], - "evidence_sufficient": true - }, - "llm": { - "answer_status": "answered", - "groundedness": "grounded" - } - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "HttpControlChannel" - ], - "keyword_hints": [ - "HttpControlChannel" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C0_SOURCE_CHUNKS": "exact_path_fetch", - "C4_SEMANTIC_ROLES": "exact_path_fetch", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C3_ENTRYPOINTS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 8, - "C4_SEMANTIC_ROLES": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C3_ENTRYPOINTS": 6 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C4_SEMANTIC_ROLES": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "HttpControlChannel", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Объясни класс HttpControlChannel", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C4_SEMANTIC_ROLES", - "query": "Объясни класс HttpControlChannel", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "Объясни класс HttpControlChannel", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - }, - { - "layer": "C3_ENTRYPOINTS", - "query": "Объясни класс HttpControlChannel", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 1, - "candidates_after_filter": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 6, - "candidates_after_filter": 6 - }, - { - "layer": "C3_ENTRYPOINTS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 3, - "candidates_after_filter": 3 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "HttpControlChannel", - "alternatives": [ - "HttpControlChannel" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C4_SEMANTIC_ROLES", - "status": "hit", - "hit_count": 8, - "fail_reason": null - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 6, - "fail_reason": null - }, - { - "layer": "C3_ENTRYPOINTS", - "status": "hit", - "hit_count": 3, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "router": 0, - "symbol_resolution": 0, - "retrieval_total": 151, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 47, - "C0_SOURCE_CHUNKS": 18, - "C4_SEMANTIC_ROLES": 17, - "C2_DEPENDENCY_GRAPH": 56, - "C3_ENTRYPOINTS": 11 - }, - "merge_rank": 23, - "prompt_build": 0, - "llm_call": 5711 - }, - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 329, - "evidence_rows": 19, - "evidence_chars": 3845 - }, - "evidence_summary": [ - { - "layer": "C1_SYMBOL_CATALOG", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "count": 8, - "unique_paths": 7 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "count": 6, - "unique_paths": 1 - }, - { - "layer": "C3_ENTRYPOINTS", - "count": 3, - "unique_paths": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 1, - "unique_paths": 1 - } - ], - "prompt_template_id": "intent_code_qa_v1", - "system_prompt_version": "v1" - }, - "router": { - "conversation_mode": "START", - "keyword_hints": [ - "HttpControlChannel" - ], - "path_scope": [] - }, - "llm": { - "used_evidence_count": 19, - "missing_evidence_reason": null - } - }, - "run_info": { - "case_id": "plba-fullchain-explain-http-control-channel", - "mode": "full_chain", - "run_started_at": "2026-03-12T09:18:24", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - }, - "input_request": { - "text": "Объясни класс HttpControlChannel", - "normalized_query": "Объясни класс HttpControlChannel" - }, - "steps": [ - { - "step": "intent_router", - "input": { - "query": "Объясни класс HttpControlChannel" - }, - "output": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Объясни класс HttpControlChannel" - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "HttpControlChannel" - ], - "keyword_hints": [ - "HttpControlChannel" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "timings_ms": { - "router": 0 - } - } - }, - { - "step": "retrieval", - "input": { - "query": "Объясни класс HttpControlChannel" - }, - "output": { - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "HttpControlChannel", - "alternatives": [ - "HttpControlChannel" - ], - "confidence": 0.99 - }, - "rag_count": 19, - "rag_rows": [ - { - "path": "src/app_runtime/control/http_channel.py", - "content": "class HttpControlChannel\nHttpControlChannel(ControlChannel)", - "layer": "C1_SYMBOL_CATALOG", - "title": "HttpControlChannel", - "span_start": 12, - "span_end": 57, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "1c9fbdc24819e5604c26ea55428a74310f03a03e1af197ed84846af61e42fdb0", - "qname": "HttpControlChannel", - "kind": "class", - "signature": "HttpControlChannel(ControlChannel)", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.control.http_channel", - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (10)", - "layer": "C4_SEMANTIC_ROLES", - "title": "HttpControlChannel", - "span_start": 12, - "span_end": 57, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 21, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "1c9fbdc24819e5604c26ea55428a74310f03a03e1af197ed84846af61e42fdb0", - "symbol_name": "HttpControlChannel", - "qname": "HttpControlChannel", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 10, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "ControlChannel\nrole: model\n\nResponsibilities:\n- default model role", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlChannel", - "span_start": 21, - "span_end": 28, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 40, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "cfcfe9a311d3a2dbdaf32ac4ccd73c0eb9a117f830591a1c0867ee97d46204ff", - "symbol_name": "ControlChannel", - "qname": "ControlChannel", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "ControlActionSet\nrole: model\n\nResponsibilities:\n- default model role", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlActionSet", - "span_start": 14, - "span_end": 18, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 40, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "46eb026cb3313415ec47b82dd22f84f4d112c9d987e8b1716dcb0baa1cce8988", - "symbol_name": "ControlActionSet", - "qname": "ControlActionSet", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests service\n- reads and writes state attributes\n- participates in dataflow slices (5)", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlPlaneService", - "span_start": 12, - "span_end": 52, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 68, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "b13471e5916986dccffb53fab613812842965705e6b3a89ae549d30c9e91e9aa", - "symbol_name": "ControlPlaneService", - "qname": "ControlPlaneService", - "role": "pipeline_stage", - "confidence": 0.57, - "dataflow_participation": 5, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_runner.py", - "content": "UvicornThreadRunner\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (24)", - "layer": "C4_SEMANTIC_ROLES", - "title": "UvicornThreadRunner", - "span_start": 10, - "span_end": 61, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 11, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "fd55630045a02100df8877ac27d951ee08617d4598764394d48cb51fe067476a", - "symbol_name": "UvicornThreadRunner", - "qname": "UvicornThreadRunner", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 24, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "3779fdd2878b770e789a35bb2a89c9d79f13b61c26d7db1b3b683f9bb9e1623f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "HttpControlAppFactory\nrole: factory\n\nResponsibilities:\n- name suffix suggests factory", - "layer": "C4_SEMANTIC_ROLES", - "title": "HttpControlAppFactory", - "span_start": 15, - "span_end": 53, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 39, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "9b3502a5fb408b273223db13264349cf500de24915b6c649d9ea8970d0dfd8e0", - "symbol_name": "HttpControlAppFactory", - "qname": "HttpControlAppFactory", - "role": "factory", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/persistence/workflow_persistence.py", - "content": "WorkflowPersistence\nrole: pipeline_stage\n\nResponsibilities:\n- orchestrates role-like calls (2)\n- reads and writes state attributes\n- participates in dataflow slices (16)", - "layer": "C4_SEMANTIC_ROLES", - "title": "WorkflowPersistence", - "span_start": 8, - "span_end": 54, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 15, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "7bd01ee45cf31f2d5c2e3e51656254860ac785d10cef9e0852cd4fba90857bae", - "symbol_name": "WorkflowPersistence", - "qname": "WorkflowPersistence", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 16, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "80e9410ddc639789b4353c2a1a757ba8d0d5b5bb6075b0b263b61551f04ae1f0", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/queue/in_memory.py", - "content": "InMemoryTaskQueue\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (9)", - "layer": "C4_SEMANTIC_ROLES", - "title": "InMemoryTaskQueue", - "span_start": 9, - "span_end": 38, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 22, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "2da04cb94544a3bcbf0943a95ad4bdd8710bcafaa32a02fd0e4de2178dcf3533", - "symbol_name": "InMemoryTaskQueue", - "qname": "InMemoryTaskQueue", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 9, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "58f0cc001ccda0eee4c6bc32ed83bd05eafd6b6644f1e8b4aa9eed3103db73dc", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel.__init__\n -> HttpControlChannel._runner\n -> HttpControlChannel.start", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "HttpControlChannel.__init__:dataflow_slice", - "span_start": 15, - "span_end": 22, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "51d73913df709152258ed1b9a8c8f4eb3c575eccfe6b982aef0b28e0789a29da", - "edge_type": "dataflow_slice", - "src_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "src_qname": "HttpControlChannel.__init__", - "dst_symbol_id": "d1933f04137f52535b6525f1b93ff2cd83bfb216b480e887e791ed1714cda8e0", - "dst_ref": "HttpControlChannel.start", - "resolution": "resolved", - "slice_id": "51d73913df709152258ed1b9a8c8f4eb3c575eccfe6b982aef0b28e0789a29da", - "root_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "path_symbols": [ - "HttpControlChannel.__init__", - "HttpControlChannel._runner", - "HttpControlChannel.start" - ], - "path_symbol_ids": [ - "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "d1933f04137f52535b6525f1b93ff2cd83bfb216b480e887e791ed1714cda8e0" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel.__init__\n -> HttpControlChannel._runner\n -> HttpControlChannel.port", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "HttpControlChannel.__init__:dataflow_slice", - "span_start": 15, - "span_end": 29, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "c7167bab7218bb768ad7c11bfb40d1a3096e6071dd7817bba5fd864cf8f6de13", - "edge_type": "dataflow_slice", - "src_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "src_qname": "HttpControlChannel.__init__", - "dst_symbol_id": "3632ce8227f4a31e0768f2fb021a4d1ba28e1202633aa0f2fac902295931280f", - "dst_ref": "HttpControlChannel.port", - "resolution": "resolved", - "slice_id": "c7167bab7218bb768ad7c11bfb40d1a3096e6071dd7817bba5fd864cf8f6de13", - "root_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "path_symbols": [ - "HttpControlChannel.__init__", - "HttpControlChannel._runner", - "HttpControlChannel.port" - ], - "path_symbol_ids": [ - "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "3632ce8227f4a31e0768f2fb021a4d1ba28e1202633aa0f2fac902295931280f" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel.__init__\n -> HttpControlChannel._timeout\n -> HttpControlChannel._health_response", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "HttpControlChannel.__init__:dataflow_slice", - "span_start": 14, - "span_end": 34, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "f858f5c9e575f6c4cdfe3853571b7ee21d1f628a443541d2037c3dc9d0790bef", - "edge_type": "dataflow_slice", - "src_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "src_qname": "HttpControlChannel.__init__", - "dst_symbol_id": "e84bf04e9cd2127df235b7064d05f47e19f19a89c7c82f4c247231d4e8fa426a", - "dst_ref": "HttpControlChannel._health_response", - "resolution": "resolved", - "slice_id": "f858f5c9e575f6c4cdfe3853571b7ee21d1f628a443541d2037c3dc9d0790bef", - "root_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "path_symbols": [ - "HttpControlChannel.__init__", - "HttpControlChannel._timeout", - "HttpControlChannel._health_response" - ], - "path_symbol_ids": [ - "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "e84bf04e9cd2127df235b7064d05f47e19f19a89c7c82f4c247231d4e8fa426a" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel.__init__\n -> HttpControlChannel._timeout\n -> HttpControlChannel._action_response", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "HttpControlChannel.__init__:dataflow_slice", - "span_start": 14, - "span_end": 47, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "c3ef21fcae96c82c00be74b3ab827d4af2085d89cb3fa5521c19a174aad84dbb", - "edge_type": "dataflow_slice", - "src_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "src_qname": "HttpControlChannel.__init__", - "dst_symbol_id": "e64969024ccaeb34d8d91473fad07b3b3d341875846392e7a006406c7ada1954", - "dst_ref": "HttpControlChannel._action_response", - "resolution": "resolved", - "slice_id": "c3ef21fcae96c82c00be74b3ab827d4af2085d89cb3fa5521c19a174aad84dbb", - "root_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "path_symbols": [ - "HttpControlChannel.__init__", - "HttpControlChannel._timeout", - "HttpControlChannel._action_response" - ], - "path_symbol_ids": [ - "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "e64969024ccaeb34d8d91473fad07b3b3d341875846392e7a006406c7ada1954" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel.__init__\n -> HttpControlChannel._runner\n -> HttpControlChannel.stop", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "HttpControlChannel.__init__:dataflow_slice", - "span_start": 15, - "span_end": 25, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "0f827ef81a990258a8a74381c8564a8361afa6712dba3200592659c939adcb9d", - "edge_type": "dataflow_slice", - "src_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "src_qname": "HttpControlChannel.__init__", - "dst_symbol_id": "f29ab212620093d72be20e26c5a399624c7939a6056a728762ed3f84a250bfa3", - "dst_ref": "HttpControlChannel.stop", - "resolution": "resolved", - "slice_id": "0f827ef81a990258a8a74381c8564a8361afa6712dba3200592659c939adcb9d", - "root_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "path_symbols": [ - "HttpControlChannel.__init__", - "HttpControlChannel._runner", - "HttpControlChannel.stop" - ], - "path_symbol_ids": [ - "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "f29ab212620093d72be20e26c5a399624c7939a6056a728762ed3f84a250bfa3" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel.__init__\n -> HttpControlChannel._factory\n -> HttpControlChannel.start", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "HttpControlChannel.__init__:dataflow_slice", - "span_start": 16, - "span_end": 21, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e61ec25ded7dbe380d95ce2abcbc1d7a2d2afde5aa8453866df8706dfb7d6ddb", - "edge_type": "dataflow_slice", - "src_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "src_qname": "HttpControlChannel.__init__", - "dst_symbol_id": "d1933f04137f52535b6525f1b93ff2cd83bfb216b480e887e791ed1714cda8e0", - "dst_ref": "HttpControlChannel.start", - "resolution": "resolved", - "slice_id": "e61ec25ded7dbe380d95ce2abcbc1d7a2d2afde5aa8453866df8706dfb7d6ddb", - "root_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "path_symbols": [ - "HttpControlChannel.__init__", - "HttpControlChannel._factory", - "HttpControlChannel.start" - ], - "path_symbol_ids": [ - "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "d1933f04137f52535b6525f1b93ff2cd83bfb216b480e887e791ed1714cda8e0" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "class HttpControlChannel(ControlChannel):\n def __init__(self, host: str, port: int, timeout: int) -> None:\n self._timeout = timeout\n self._runner = UvicornThreadRunner(host, port, timeout)\n self._factory = HttpControlAppFactory()\n self._actions: ControlActionSet | None = None\n\n async def start(self, actions: ControlActionSet) -> None:\n self._actions = actions\n app = self._factory.create(self._health_response, self._action_response)\n await self._runner.start(app)\n\n async def stop(self) -> None:\n await self._runner.stop()\n\n @property\n def port(self) -> int:\n return self._runner.port\n\n async def _health_response(self) -> dict[str, object]:\n if self._actions is None:\n return {\"status\": \"unhealthy\", \"detail\": \"control actions are not configured\"}\n return await asyncio.wait_for(self._actions.health(), timeout=float(self._timeout))\n\n async def _action_response(self, action: str, _client_source: str = \"unknown\") -> JSONResponse:\n if self._actions is None:\n return JSONResponse(content={\"status\": \"error\", \"detail\": f\"{action} handler is not configured\"}, status_code=404)\n callbacks = {\n \"start\": self._actions.start,\n \"stop\": self._actions.stop,\n \"status\": self._actions.status,\n }\n callback = callbacks.get(action)\n if callback is None:\n return JSONResponse(content={\"status\": \"error\", \"detail\": f\"unsupported action: {action}\"}, status_code=404)\n action_timeout = max(float(self._timeout), 10.0) if action in {\"start\", \"stop\"} else float(self._timeout)\n try:\n detail = await asyncio.wait_for(callback(), timeout=action_timeout)\n except asyncio.TimeoutError:\n return JSONResponse(\n content={\"status\": \"accepted\", \"detail\": f\"{action} operation is still in progress\"},\n status_code=202,\n )\n except Exception as exc:\n return JSONResponse(content={\"status\": \"error\", \"detail\": str(exc)}, status_code=500)\n return JSONResponse(content={\"status\": \"ok\", \"detail\": detail or f\"{action} action accepted\"}, status_code=200)", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/http_channel.py:HttpControlChannel", - "span_start": 12, - "span_end": 57, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.http_channel", - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ] - }, - "diagnostics": { - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C0_SOURCE_CHUNKS": "exact_path_fetch", - "C4_SEMANTIC_ROLES": "exact_path_fetch", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C3_ENTRYPOINTS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 8, - "C4_SEMANTIC_ROLES": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C3_ENTRYPOINTS": 6 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C4_SEMANTIC_ROLES": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "HttpControlChannel", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Объясни класс HttpControlChannel", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C4_SEMANTIC_ROLES", - "query": "Объясни класс HttpControlChannel", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "Объясни класс HttpControlChannel", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - }, - { - "layer": "C3_ENTRYPOINTS", - "query": "Объясни класс HttpControlChannel", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 1, - "candidates_after_filter": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 6, - "candidates_after_filter": 6 - }, - { - "layer": "C3_ENTRYPOINTS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 3, - "candidates_after_filter": 3 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "HttpControlChannel", - "alternatives": [ - "HttpControlChannel" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C4_SEMANTIC_ROLES", - "status": "hit", - "hit_count": 8, - "fail_reason": null - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 6, - "fail_reason": null - }, - { - "layer": "C3_ENTRYPOINTS", - "status": "hit", - "hit_count": 3, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "symbol_resolution": 0, - "retrieval_total": 151, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 47, - "C0_SOURCE_CHUNKS": 18, - "C4_SEMANTIC_ROLES": 17, - "C2_DEPENDENCY_GRAPH": 56, - "C3_ENTRYPOINTS": 11 - }, - "merge_rank": 23 - } - } - }, - { - "step": "llm_answer", - "input": { - "query": "Объясни класс HttpControlChannel", - "rag_count": 19 - }, - "output": { - "llm_answer": "## Анализ класса `HttpControlChannel`\n\n### Файл и путь:\n- **Файл:** `src/app_runtime/control/http_channel.py`\n- **Класс:** `HttpControlChannel`\n\n### Описание роли и ответственности:\n- **Роль:** `pipeline_stage`\n- **Ответственности:**\n - Чтение и запись атрибутов состояния (`reads and writes state attributes`).\n - Участие в \"слайсах\" данных потока (`participates in dataflow slices`).\n - В документации указано участие в 10 слайсах данных.\n\n### Родительский класс:\n- Наследуется от класса `ControlChannel`, объявленного в файле `src/app_runtime/control/base.py`.\n \n### Подразумеваемая архитектура и поток данных:\n1. **Родительская сущность** (`ControlChannel`) является базовой моделью для каналов управления, определяющей основные обязанности модели.\n - Пример: Класс может иметь стандартный набор методов или атрибутов, которые наследуются всеми дочерними сущностями.\n \n2. **Дочерний класс** (`HttpControlChannel`) расширяет функциональность родительского класса, добавляя специфические обязанности HTTP-канала.\n - Обеспечивает взаимодействие с HTTP протоколом, вероятно, через асинхронные HTTP запросы и ответы.\n\n3. **Участие в данныхфлоу**:\n - Согласно описанию, канал участвует в 10 различных слайсах данных. Это означает, что он обрабатывает части общего потока данных, разделенного на несколько сегментов (\"слайсов\"). \n - Каждый сегмент предназначен для определенной стадии обработки информации внутри системы.\n\n4. **Связь с другими компонентами**:\n - Контроллер взаимодействует с сервисом контроля (`ControlPlaneService`), который также упоминается как `pipeline_stage`. Вероятно, это указывает на то, что контроллер совместно с этим сервисом управляет состоянием и потоком данных между различными стадиями обработки.\n\n### Возможное внутреннее устройство и реализация:\n- Возможно наличие методов чтения и записи атрибутов состояния, а также механизмов отправки и получения сообщений через HTTP-запросы и ответы.\n- Вероятно, присутствуют методы инициализации и конфигурации канала.\n- Поскольку указано, что участвует в нескольких слайсах данных, предполагается наличие инфраструктуры для поддержки параллельного выполнения задач и передачи данных между ними.\n\n### Заключение:\nКанал управления `HttpControlChannel` реализует механизм взаимодействия с HTTP-протоколом, отвечая за чтение и запись состояний и участвуя в передаче данных между стадиями обработки данных. Он наследует базовые принципы поведения от родительской сущности `ControlChannel`, обеспечивая специализированную функциональность для работы с HTTP-соединениями и потоками данных." - }, - "diagnostics": { - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 329, - "evidence_rows": 19, - "evidence_chars": 3845 - }, - "evidence_summary": [ - { - "layer": "C1_SYMBOL_CATALOG", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "count": 8, - "unique_paths": 7 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "count": 6, - "unique_paths": 1 - }, - { - "layer": "C3_ENTRYPOINTS", - "count": 3, - "unique_paths": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 1, - "unique_paths": 1 - } - ], - "prompt_template_id": "intent_code_qa_v1", - "system_prompt_version": "v1" - }, - "timings_ms": { - "prompt_build": 0, - "llm_call": 5711 - } - } - } - ] - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_091824/full_chain_plba_code_retrieval_plba-fullchain-explain-http-control-channel.md b/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_091824/full_chain_plba_code_retrieval_plba-fullchain-explain-http-control-channel.md deleted file mode 100644 index 6850ebf..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_091824/full_chain_plba_code_retrieval_plba-fullchain-explain-http-control-channel.md +++ /dev/null @@ -1,34 +0,0 @@ -# plba-fullchain-explain-http-control-channel - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_retrieval.yaml -- runner: runtime -- mode: full_chain -- passed: True - -## Query -Объясни класс HttpControlChannel - -## Actual -{ - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 19, - "llm_answer": "## Анализ класса `HttpControlChannel`\n\n### Файл и путь:\n- **Файл:** `src/app_runtime/control/http_channel.py`\n- **Класс:** `HttpControlChannel`\n\n### Описание роли и ответственности:\n- **Роль:** `pipeline_stage`\n- **Ответственности:**\n - Чтение и запись атрибутов состояния (`reads and writes state attributes`).\n - Участие в \"слайсах\" данных потока (`participates in dataflow slices`).\n - В документации указано участие в 10 слайсах данных.\n\n### Родительский класс:\n- Наследуется от класса `ControlChannel`, объявленного в файле `src/app_runtime/control/base.py`.\n \n### Подразумеваемая архитектура и поток данных:\n1. **Родительская сущность** (`ControlChannel`) является базовой моделью для каналов управления, определяющей основные обязанности модели.\n - Пример: Класс может иметь стандартный набор методов или атрибутов, которые наследуются всеми дочерними сущностями.\n \n2. **Дочерний класс** (`HttpControlChannel`) расширяет функциональность родительского класса, добавляя специфические обязанности HTTP-канала.\n - Обеспечивает взаимодействие с HTTP протоколом, вероятно, через асинхронные HTTP запросы и ответы.\n\n3. **Участие в данныхфлоу**:\n - Согласно описанию, канал участвует в 10 различных слайсах данных. Это означает, что он обрабатывает части общего потока данных, разделенного на несколько сегментов (\"слайсов\"). \n - Каждый сегмент предназначен для определенной стадии обработки информации внутри системы.\n\n4. **Связь с другими компонентами**:\n - Контроллер взаимодействует с сервисом контроля (`ControlPlaneService`), который также упоминается как `pipeline_stage`. Вероятно, это указывает на то, что контроллер совместно с этим сервисом управляет состоянием и потоком данных между различными стадиями обработки.\n\n### Возможное внутреннее устройство и реализация:\n- Возможно наличие методов чтения и записи атрибутов состояния, а также механизмов отправки и получения сообщений через HTTP-запросы и ответы.\n- Вероятно, присутствуют методы инициализации и конфигурации канала.\n- Поскольку указано, что участвует в нескольких слайсах данных, предполагается наличие инфраструктуры для поддержки параллельного выполнения задач и передачи данных между ними.\n\n### Заключение:\nКанал управления `HttpControlChannel` реализует механизм взаимодействия с HTTP-протоколом, отвечая за чтение и запись состояний и участвуя в передаче данных между стадиями обработки данных. Он наследует базовые принципы поведения от родительской сущности `ControlChannel`, обеспечивая специализированную функциональность для работы с HTTP-соединениями и потоками данных.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "HttpControlChannel" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] -} - -## Mismatches -- none \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_091824/full_chain_plba_code_retrieval_plba-fullchain-explain-runtime-manager.json b/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_091824/full_chain_plba_code_retrieval_plba-fullchain-explain-runtime-manager.json deleted file mode 100644 index c4a75a9..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_091824/full_chain_plba_code_retrieval_plba-fullchain-explain-runtime-manager.json +++ /dev/null @@ -1,2564 +0,0 @@ -{ - "case_id": "plba-fullchain-explain-runtime-manager", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_retrieval.yaml", - "runner": "runtime", - "mode": "full_chain", - "actual": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 19, - "llm_answer": "## Анализ класса `RuntimeManager`\n\n### 1. Общая информация о классе\n\nКласс `RuntimeManager` находится в файле `src/app_runtime/core/runtime.py`. Его роль обозначена как **pipeline_stage**, что указывает на его участие в потоке выполнения программы.\n\n### 2. Ответственность (`Responsibilities`)\n\nДокументация описывает следующие обязанности класса:\n\n- **manager**: предполагает управление другими сущностями или ресурсами;\n- **orchestrates role-like calls (4)**: означает координацию вызовов различных ролей или этапов;\n- **reads and writes state attributes**: указывает на возможность чтения и записи атрибутов состояния системы;\n- **participates in dataflow slices (50)**: свидетельствует об участии в разделении потоков данных.\n\nЭти обязанности отражают высокоуровневую роль управления состоянием и потоком выполнения приложения.\n\n### 3. Поток данных и взаимодействие с другими компонентами\n\nНа основании информации из документации можно предположить следующую картину взаимодействия компонентов:\n\n#### a. Управление ролями и стадиями\n\nВ описании говорится, что класс выполняет координирующие действия, связанные с ролями и этапами процесса. Это может означать, что он управляет распределением задач между различными модулями или сервисами, участвующими в выполнении приложения.\n\n#### b. Чтение и запись состояний\n\nВозможность чтения и записи атрибутов состояния указывает на то, что данный класс участвует в управлении динамическими аспектами работы приложения, такими как параметры конфигурации, статус задач и другие переменные времени выполнения.\n\n#### c. Участие в разделении потоков данных\n\nУчастие в \"dataflow slices\" говорит о том, что объект активно взаимодействует с другими частями системы для передачи и обработки данных между ними. Это позволяет понять, что потоки данных разделяются и передаются через этот менеджер, обеспечивая согласованность действий внутри системы.\n\n### 4. Взаимодействие с другими классами\n\nДля понимания полной картины необходимо рассмотреть взаимосвязи с другими классами и их обязанностями:\n\n- **ControlChannel** и **ControlActionSet**: вероятно, эти классы представляют собой интерфейсы или механизмы, используемые для координации поведения модели. Они могут быть использованы для отправки команд или запросов от `RuntimeManager`.\n \n- **ControlPlaneService**: судя по описанию, это отдельный сервис, который также отвечает за чтение и запись состояния, а также участие в передаче данных между стадиями выполнения. Таким образом, возможно, он используется параллельно или совместно с `RuntimeManager`.\n\n- **UvicornThreadRunner**: этот класс связан с управлением многопоточной обработкой HTTP-запросов. Вероятно, его функциональность пересекается с `RuntimeManager`, особенно когда речь идет о взаимодействии с внешним миром через HTTP-интерфейсы.\n\n### Заключение\n\nКласс `RuntimeManager` играет ключевую роль в координации и управлении потоком выполнения задачи, участвуя в обработке состояний и передаче данных между различными компонентами системы. Он обеспечивает высокоуровневое управление выполнением, координируя роли и этапы выполнения, записывая и читая состояние приложения, а также участвует в разделе потоков данных. \n\nДля более детального анализа его поведения рекомендуется изучить исходный код класса и окружающие компоненты системы.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "RuntimeManager" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "passed": true, - "mismatches": [], - "details": { - "case_id": "plba-fullchain-explain-runtime-manager", - "text": "Объясни как работает класс RuntimeManager", - "mode": "full_chain", - "run_started_at": "2026-03-12T09:18:24", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Объясни как работает класс RuntimeManager", - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "RuntimeManager", - "alternatives": [ - "RuntimeManager" - ], - "confidence": 0.99 - }, - "rag_count": 19, - "rag_rows": [ - { - "path": "src/app_runtime/core/runtime.py", - "content": "class RuntimeManager\nRuntimeManager", - "layer": "C1_SYMBOL_CATALOG", - "title": "RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "7e4a9381328c5803bbc6179458612fc4e947d928aa7bf8b4b2bebb2c8592f758", - "qname": "RuntimeManager", - "kind": "class", - "signature": "RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.core.runtime", - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests manager\n- orchestrates role-like calls (4)\n- reads and writes state attributes\n- participates in dataflow slices (50)", - "layer": "C4_SEMANTIC_ROLES", - "title": "RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 43, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "7e4a9381328c5803bbc6179458612fc4e947d928aa7bf8b4b2bebb2c8592f758", - "symbol_name": "RuntimeManager", - "qname": "RuntimeManager", - "role": "pipeline_stage", - "confidence": 0.67, - "dataflow_participation": 50, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "ControlChannel\nrole: model\n\nResponsibilities:\n- default model role", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlChannel", - "span_start": 21, - "span_end": 28, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 40, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "cfcfe9a311d3a2dbdaf32ac4ccd73c0eb9a117f830591a1c0867ee97d46204ff", - "symbol_name": "ControlChannel", - "qname": "ControlChannel", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "ControlActionSet\nrole: model\n\nResponsibilities:\n- default model role", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlActionSet", - "span_start": 14, - "span_end": 18, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 40, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "46eb026cb3313415ec47b82dd22f84f4d112c9d987e8b1716dcb0baa1cce8988", - "symbol_name": "ControlActionSet", - "qname": "ControlActionSet", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests service\n- reads and writes state attributes\n- participates in dataflow slices (5)", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlPlaneService", - "span_start": 12, - "span_end": 52, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 68, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "b13471e5916986dccffb53fab613812842965705e6b3a89ae549d30c9e91e9aa", - "symbol_name": "ControlPlaneService", - "qname": "ControlPlaneService", - "role": "pipeline_stage", - "confidence": 0.57, - "dataflow_participation": 5, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_runner.py", - "content": "UvicornThreadRunner\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (24)", - "layer": "C4_SEMANTIC_ROLES", - "title": "UvicornThreadRunner", - "span_start": 10, - "span_end": 61, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 11, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "fd55630045a02100df8877ac27d951ee08617d4598764394d48cb51fe067476a", - "symbol_name": "UvicornThreadRunner", - "qname": "UvicornThreadRunner", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 24, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "3779fdd2878b770e789a35bb2a89c9d79f13b61c26d7db1b3b683f9bb9e1623f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (10)", - "layer": "C4_SEMANTIC_ROLES", - "title": "HttpControlChannel", - "span_start": 12, - "span_end": 57, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 21, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "1c9fbdc24819e5604c26ea55428a74310f03a03e1af197ed84846af61e42fdb0", - "symbol_name": "HttpControlChannel", - "qname": "HttpControlChannel", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 10, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "HttpControlAppFactory\nrole: factory\n\nResponsibilities:\n- name suffix suggests factory", - "layer": "C4_SEMANTIC_ROLES", - "title": "HttpControlAppFactory", - "span_start": 15, - "span_end": 53, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 39, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "9b3502a5fb408b273223db13264349cf500de24915b6c649d9ea8970d0dfd8e0", - "symbol_name": "HttpControlAppFactory", - "qname": "HttpControlAppFactory", - "role": "factory", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/persistence/workflow_persistence.py", - "content": "WorkflowPersistence\nrole: pipeline_stage\n\nResponsibilities:\n- orchestrates role-like calls (2)\n- reads and writes state attributes\n- participates in dataflow slices (16)", - "layer": "C4_SEMANTIC_ROLES", - "title": "WorkflowPersistence", - "span_start": 8, - "span_end": 54, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 15, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "7bd01ee45cf31f2d5c2e3e51656254860ac785d10cef9e0852cd4fba90857bae", - "symbol_name": "WorkflowPersistence", - "qname": "WorkflowPersistence", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 16, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "80e9410ddc639789b4353c2a1a757ba8d0d5b5bb6075b0b263b61551f04ae1f0", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.stop", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 25, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d", - "dst_ref": "ControlPlaneService.stop", - "resolution": "resolved", - "slice_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.stop" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._stop_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 51, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a", - "dst_ref": "ControlPlaneService._stop_async", - "resolution": "resolved", - "slice_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._stop_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.register_channel", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 17, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957", - "dst_ref": "ControlPlaneService.register_channel", - "resolution": "resolved", - "slice_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.register_channel" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.start", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 20, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154", - "dst_ref": "ControlPlaneService.start", - "resolution": "resolved", - "slice_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.start" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._start_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 47, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517", - "dst_ref": "ControlPlaneService._start_async", - "resolution": "resolved", - "slice_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._start_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager.add_config_file", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 32, - "span_end": 52, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "a23b8a11ebdb12708b60c96ea12a69f7f042082f1adfddd572444e246d81d167", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "57ffbd4f0d9fdf3507c2b8624312ce211f3d02fdf86a57a8ec90778d8a7b498d", - "dst_ref": "RuntimeManager.add_config_file", - "resolution": "resolved", - "slice_id": "a23b8a11ebdb12708b60c96ea12a69f7f042082f1adfddd572444e246d81d167", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager.add_config_file" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "57ffbd4f0d9fdf3507c2b8624312ce211f3d02fdf86a57a8ec90778d8a7b498d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "class RuntimeManager:\n ACTION_TIMEOUT_SECONDS = 10.0\n ACTION_POLL_INTERVAL_SECONDS = 0.05\n\n def __init__(\n self,\n configuration: ConfigurationManager | None = None,\n services: ServiceContainer | None = None,\n traces: TraceService | None = None,\n health: HealthRegistry | None = None,\n logs: LogManager | None = None,\n workers: WorkerSupervisor | None = None,\n control_plane: ControlPlaneService | None = None,\n ) -> None:\n self.configuration = configuration or ConfigurationManager()\n self.services = services or ServiceContainer()\n self.traces = traces or TraceService()\n self.health = health or HealthRegistry()\n self.logs = logs or LogManager()\n self.workers = workers or WorkerSupervisor()\n self.control_plane = control_plane or ControlPlaneService()\n self.registry = ModuleRegistry(self.services)\n self._started = False\n self._state = LifecycleState.IDLE\n self._core_registered = False\n self._workers_registered = False\n self._register_core_services()\n\n def register_module(self, module: ApplicationModule) -> None:\n self.registry.register_module(module.name)\n module.register(self.registry)\n\n def add_config_file(self, path: str) -> FileConfigProvider:\n provider = FileConfigProvider(path)\n self.configuration.add_provider(provider)\n return provider\n\n def start(self, *, start_control_plane: bool = True) -> None:\n if self._started:\n return\n self._state = LifecycleState.STARTING\n config = self.configuration.load()\n self.logs.apply_config(config)\n self._register_health_contributors()\n self._register_workers()\n self.workers.start()\n if start_control_plane:\n self.control_plane.start(self)\n self._started = True\n self._refresh_state()\n\n def stop(self, timeout: float = 30.0, force: bool = False, stop_control_plane: bool = True) -> None:\n if not self._started:\n return\n self._state = LifecycleState.STOPPING\n self.workers.stop(timeout=timeout, force=force)\n if stop_control_plane:\n self.control_plane.stop()\n self._started = False\n self._state = LifecycleState.STOPPED\n\n def status(self) -> dict[str, object]:\n self._refresh_state()\n return self.control_plane.snapshot(self)\n\n def current_health(self) -> HealthPayload:\n self._refresh_state()\n return self.health.payload(self._state, self.workers.healths())\n\n async def health_status(self) -> HealthPayload:\n return self.current_health()\n\n async def start_runtime(self) -> dict[str, object] | str:\n self._refresh_state()\n if self._started:\n return \"runtime already running\"\n if self._state == LifecycleState.STOPPING:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n\n self.start(start_control_plane=False)\n started = self._wait_for_state({LifecycleState.IDLE, LifecycleState.BUSY}, timeout=self.ACTION_TIMEOUT_SECONDS)\n if started:\n return self._action_detail(\"runtime started\", timed_out=False)\n return self._action_detail(\"runtime start is still in progress\", timed_out=True)\n\n async def stop_runtime(self) -> dict[str, object] | str:\n self._refresh_state()\n if not self._started:\n if self._state == LifecycleState.STOPPING:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n return \"runtime already stopped\"\n\n self._state = LifecycleState.STOPPING\n try:\n self.workers.stop(timeout=self.ACTION_TIMEOUT_SECONDS, force=False)\n except TimeoutError:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n\n self._started = False\n self._state = LifecycleState.STOPPED\n return self._action_detail(\"runtime stopped\", timed_out=False)\n\n async def runtime_status(self) -> str:\n self._refresh_state()\n return self._state.value\n\n def _register_core_services(self) -> None:\n if self._core_registered:\n return\n self.services.register(\"configuration\", self.configuration)\n self.services.register(\"traces\", self.traces)\n self.services.register(\"health\", self.health)\n self.services.register(\"logs\", self.logs)\n self.services.register(\"workers\", self.workers)\n self.services.register(\"control_plane\", self.control_plane)\n self._core_registered = True\n\n def _register_health_contributors(self) -> None:\n for contributor in self.registry.health_contributors:\n self.health.register(contributor)\n\n def _register_workers(self) -> None:\n if self._workers_registered:\n return\n for worker in self.registry.workers:\n self.workers.register(worker)\n self._workers_registered = True\n\n def _refresh_state(self) -> None:\n lifecycle = self.workers.lifecycle_state()\n\n if self._state == LifecycleState.STOPPING:\n if lifecycle == LifecycleState.STOPPED:\n self._started = False\n self._state = LifecycleState.STOPPED\n return\n\n if not self._started:\n if lifecycle == LifecycleState.STOPPED:\n self._state = LifecycleState.STOPPED\n return\n\n self._state = lifecycle\n\n def _wait_for_state(self, target_states: set[LifecycleState], *, timeout: float) -> bool:\n deadline = monotonic() + timeout\n while monotonic() < deadline:\n self._refresh_state()\n if self._state in target_states:\n return True\n sleep(self.ACTION_POLL_INTERVAL_SECONDS)\n self._refresh_state()\n return self._state in target_states\n\n def _action_detail(self, message: str, *, timed_out: bool) -> dict[str, object]:\n self._refresh_state()\n return {\n \"message\": message,\n \"state\": self._state.value,\n \"timed_out\": timed_out,\n \"workers\": self.workers.snapshot(),\n }", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/core/runtime.py:RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.core.runtime", - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "llm_answer": "## Анализ класса `RuntimeManager`\n\n### 1. Общая информация о классе\n\nКласс `RuntimeManager` находится в файле `src/app_runtime/core/runtime.py`. Его роль обозначена как **pipeline_stage**, что указывает на его участие в потоке выполнения программы.\n\n### 2. Ответственность (`Responsibilities`)\n\nДокументация описывает следующие обязанности класса:\n\n- **manager**: предполагает управление другими сущностями или ресурсами;\n- **orchestrates role-like calls (4)**: означает координацию вызовов различных ролей или этапов;\n- **reads and writes state attributes**: указывает на возможность чтения и записи атрибутов состояния системы;\n- **participates in dataflow slices (50)**: свидетельствует об участии в разделении потоков данных.\n\nЭти обязанности отражают высокоуровневую роль управления состоянием и потоком выполнения приложения.\n\n### 3. Поток данных и взаимодействие с другими компонентами\n\nНа основании информации из документации можно предположить следующую картину взаимодействия компонентов:\n\n#### a. Управление ролями и стадиями\n\nВ описании говорится, что класс выполняет координирующие действия, связанные с ролями и этапами процесса. Это может означать, что он управляет распределением задач между различными модулями или сервисами, участвующими в выполнении приложения.\n\n#### b. Чтение и запись состояний\n\nВозможность чтения и записи атрибутов состояния указывает на то, что данный класс участвует в управлении динамическими аспектами работы приложения, такими как параметры конфигурации, статус задач и другие переменные времени выполнения.\n\n#### c. Участие в разделении потоков данных\n\nУчастие в \"dataflow slices\" говорит о том, что объект активно взаимодействует с другими частями системы для передачи и обработки данных между ними. Это позволяет понять, что потоки данных разделяются и передаются через этот менеджер, обеспечивая согласованность действий внутри системы.\n\n### 4. Взаимодействие с другими классами\n\nДля понимания полной картины необходимо рассмотреть взаимосвязи с другими классами и их обязанностями:\n\n- **ControlChannel** и **ControlActionSet**: вероятно, эти классы представляют собой интерфейсы или механизмы, используемые для координации поведения модели. Они могут быть использованы для отправки команд или запросов от `RuntimeManager`.\n \n- **ControlPlaneService**: судя по описанию, это отдельный сервис, который также отвечает за чтение и запись состояния, а также участие в передаче данных между стадиями выполнения. Таким образом, возможно, он используется параллельно или совместно с `RuntimeManager`.\n\n- **UvicornThreadRunner**: этот класс связан с управлением многопоточной обработкой HTTP-запросов. Вероятно, его функциональность пересекается с `RuntimeManager`, особенно когда речь идет о взаимодействии с внешним миром через HTTP-интерфейсы.\n\n### Заключение\n\nКласс `RuntimeManager` играет ключевую роль в координации и управлении потоком выполнения задачи, участвуя в обработке состояний и передаче данных между различными компонентами системы. Он обеспечивает высокоуровневое управление выполнением, координируя роли и этапы выполнения, записывая и читая состояние приложения, а также участвует в разделе потоков данных. \n\nДля более детального анализа его поведения рекомендуется изучить исходный код класса и окружающие компоненты системы.", - "summary": { - "router": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "confidence": null - }, - "retrieval": { - "profile": "code", - "layers_hit": [ - "C0_SOURCE_CHUNKS", - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS", - "C4_SEMANTIC_ROLES" - ], - "evidence_sufficient": true - }, - "llm": { - "answer_status": "answered", - "groundedness": "grounded" - } - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "RuntimeManager" - ], - "keyword_hints": [ - "RuntimeManager" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C0_SOURCE_CHUNKS": "exact_path_fetch", - "C4_SEMANTIC_ROLES": "exact_path_fetch", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C3_ENTRYPOINTS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 8, - "C4_SEMANTIC_ROLES": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C3_ENTRYPOINTS": 6 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C4_SEMANTIC_ROLES": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Объясни как работает класс RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C4_SEMANTIC_ROLES", - "query": "Объясни как работает класс RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "Объясни как работает класс RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - }, - { - "layer": "C3_ENTRYPOINTS", - "query": "Объясни как работает класс RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 1, - "candidates_after_filter": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 6, - "candidates_after_filter": 6 - }, - { - "layer": "C3_ENTRYPOINTS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 3, - "candidates_after_filter": 3 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "RuntimeManager", - "alternatives": [ - "RuntimeManager" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C4_SEMANTIC_ROLES", - "status": "hit", - "hit_count": 8, - "fail_reason": null - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 6, - "fail_reason": null - }, - { - "layer": "C3_ENTRYPOINTS", - "status": "hit", - "hit_count": 3, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "router": 0, - "symbol_resolution": 0, - "retrieval_total": 255, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 25, - "C0_SOURCE_CHUNKS": 13, - "C4_SEMANTIC_ROLES": 14, - "C2_DEPENDENCY_GRAPH": 58, - "C3_ENTRYPOINTS": 11 - }, - "merge_rank": 20, - "prompt_build": 0, - "llm_call": 6429 - }, - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 335, - "evidence_rows": 19, - "evidence_chars": 7949 - }, - "evidence_summary": [ - { - "layer": "C1_SYMBOL_CATALOG", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "count": 8, - "unique_paths": 7 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "count": 6, - "unique_paths": 2 - }, - { - "layer": "C3_ENTRYPOINTS", - "count": 3, - "unique_paths": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 1, - "unique_paths": 1 - } - ], - "prompt_template_id": "intent_code_qa_v1", - "system_prompt_version": "v1" - }, - "router": { - "conversation_mode": "START", - "keyword_hints": [ - "RuntimeManager" - ], - "path_scope": [] - }, - "llm": { - "used_evidence_count": 19, - "missing_evidence_reason": null - } - }, - "run_info": { - "case_id": "plba-fullchain-explain-runtime-manager", - "mode": "full_chain", - "run_started_at": "2026-03-12T09:18:24", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - }, - "input_request": { - "text": "Объясни как работает класс RuntimeManager", - "normalized_query": "Объясни как работает класс RuntimeManager" - }, - "steps": [ - { - "step": "intent_router", - "input": { - "query": "Объясни как работает класс RuntimeManager" - }, - "output": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Объясни как работает класс RuntimeManager" - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "RuntimeManager" - ], - "keyword_hints": [ - "RuntimeManager" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "timings_ms": { - "router": 0 - } - } - }, - { - "step": "retrieval", - "input": { - "query": "Объясни как работает класс RuntimeManager" - }, - "output": { - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "RuntimeManager", - "alternatives": [ - "RuntimeManager" - ], - "confidence": 0.99 - }, - "rag_count": 19, - "rag_rows": [ - { - "path": "src/app_runtime/core/runtime.py", - "content": "class RuntimeManager\nRuntimeManager", - "layer": "C1_SYMBOL_CATALOG", - "title": "RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "7e4a9381328c5803bbc6179458612fc4e947d928aa7bf8b4b2bebb2c8592f758", - "qname": "RuntimeManager", - "kind": "class", - "signature": "RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.core.runtime", - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests manager\n- orchestrates role-like calls (4)\n- reads and writes state attributes\n- participates in dataflow slices (50)", - "layer": "C4_SEMANTIC_ROLES", - "title": "RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 43, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "7e4a9381328c5803bbc6179458612fc4e947d928aa7bf8b4b2bebb2c8592f758", - "symbol_name": "RuntimeManager", - "qname": "RuntimeManager", - "role": "pipeline_stage", - "confidence": 0.67, - "dataflow_participation": 50, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "ControlChannel\nrole: model\n\nResponsibilities:\n- default model role", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlChannel", - "span_start": 21, - "span_end": 28, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 40, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "cfcfe9a311d3a2dbdaf32ac4ccd73c0eb9a117f830591a1c0867ee97d46204ff", - "symbol_name": "ControlChannel", - "qname": "ControlChannel", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "ControlActionSet\nrole: model\n\nResponsibilities:\n- default model role", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlActionSet", - "span_start": 14, - "span_end": 18, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 40, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "46eb026cb3313415ec47b82dd22f84f4d112c9d987e8b1716dcb0baa1cce8988", - "symbol_name": "ControlActionSet", - "qname": "ControlActionSet", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests service\n- reads and writes state attributes\n- participates in dataflow slices (5)", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlPlaneService", - "span_start": 12, - "span_end": 52, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 68, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "b13471e5916986dccffb53fab613812842965705e6b3a89ae549d30c9e91e9aa", - "symbol_name": "ControlPlaneService", - "qname": "ControlPlaneService", - "role": "pipeline_stage", - "confidence": 0.57, - "dataflow_participation": 5, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_runner.py", - "content": "UvicornThreadRunner\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (24)", - "layer": "C4_SEMANTIC_ROLES", - "title": "UvicornThreadRunner", - "span_start": 10, - "span_end": 61, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 11, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "fd55630045a02100df8877ac27d951ee08617d4598764394d48cb51fe067476a", - "symbol_name": "UvicornThreadRunner", - "qname": "UvicornThreadRunner", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 24, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "3779fdd2878b770e789a35bb2a89c9d79f13b61c26d7db1b3b683f9bb9e1623f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (10)", - "layer": "C4_SEMANTIC_ROLES", - "title": "HttpControlChannel", - "span_start": 12, - "span_end": 57, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 21, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "1c9fbdc24819e5604c26ea55428a74310f03a03e1af197ed84846af61e42fdb0", - "symbol_name": "HttpControlChannel", - "qname": "HttpControlChannel", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 10, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "HttpControlAppFactory\nrole: factory\n\nResponsibilities:\n- name suffix suggests factory", - "layer": "C4_SEMANTIC_ROLES", - "title": "HttpControlAppFactory", - "span_start": 15, - "span_end": 53, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 39, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "9b3502a5fb408b273223db13264349cf500de24915b6c649d9ea8970d0dfd8e0", - "symbol_name": "HttpControlAppFactory", - "qname": "HttpControlAppFactory", - "role": "factory", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/persistence/workflow_persistence.py", - "content": "WorkflowPersistence\nrole: pipeline_stage\n\nResponsibilities:\n- orchestrates role-like calls (2)\n- reads and writes state attributes\n- participates in dataflow slices (16)", - "layer": "C4_SEMANTIC_ROLES", - "title": "WorkflowPersistence", - "span_start": 8, - "span_end": 54, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 15, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "7bd01ee45cf31f2d5c2e3e51656254860ac785d10cef9e0852cd4fba90857bae", - "symbol_name": "WorkflowPersistence", - "qname": "WorkflowPersistence", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 16, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "80e9410ddc639789b4353c2a1a757ba8d0d5b5bb6075b0b263b61551f04ae1f0", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.stop", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 25, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d", - "dst_ref": "ControlPlaneService.stop", - "resolution": "resolved", - "slice_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.stop" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._stop_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 51, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a", - "dst_ref": "ControlPlaneService._stop_async", - "resolution": "resolved", - "slice_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._stop_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.register_channel", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 17, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957", - "dst_ref": "ControlPlaneService.register_channel", - "resolution": "resolved", - "slice_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.register_channel" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.start", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 20, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154", - "dst_ref": "ControlPlaneService.start", - "resolution": "resolved", - "slice_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.start" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._start_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 47, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517", - "dst_ref": "ControlPlaneService._start_async", - "resolution": "resolved", - "slice_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._start_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager.add_config_file", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 32, - "span_end": 52, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "a23b8a11ebdb12708b60c96ea12a69f7f042082f1adfddd572444e246d81d167", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "57ffbd4f0d9fdf3507c2b8624312ce211f3d02fdf86a57a8ec90778d8a7b498d", - "dst_ref": "RuntimeManager.add_config_file", - "resolution": "resolved", - "slice_id": "a23b8a11ebdb12708b60c96ea12a69f7f042082f1adfddd572444e246d81d167", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager.add_config_file" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "57ffbd4f0d9fdf3507c2b8624312ce211f3d02fdf86a57a8ec90778d8a7b498d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "class RuntimeManager:\n ACTION_TIMEOUT_SECONDS = 10.0\n ACTION_POLL_INTERVAL_SECONDS = 0.05\n\n def __init__(\n self,\n configuration: ConfigurationManager | None = None,\n services: ServiceContainer | None = None,\n traces: TraceService | None = None,\n health: HealthRegistry | None = None,\n logs: LogManager | None = None,\n workers: WorkerSupervisor | None = None,\n control_plane: ControlPlaneService | None = None,\n ) -> None:\n self.configuration = configuration or ConfigurationManager()\n self.services = services or ServiceContainer()\n self.traces = traces or TraceService()\n self.health = health or HealthRegistry()\n self.logs = logs or LogManager()\n self.workers = workers or WorkerSupervisor()\n self.control_plane = control_plane or ControlPlaneService()\n self.registry = ModuleRegistry(self.services)\n self._started = False\n self._state = LifecycleState.IDLE\n self._core_registered = False\n self._workers_registered = False\n self._register_core_services()\n\n def register_module(self, module: ApplicationModule) -> None:\n self.registry.register_module(module.name)\n module.register(self.registry)\n\n def add_config_file(self, path: str) -> FileConfigProvider:\n provider = FileConfigProvider(path)\n self.configuration.add_provider(provider)\n return provider\n\n def start(self, *, start_control_plane: bool = True) -> None:\n if self._started:\n return\n self._state = LifecycleState.STARTING\n config = self.configuration.load()\n self.logs.apply_config(config)\n self._register_health_contributors()\n self._register_workers()\n self.workers.start()\n if start_control_plane:\n self.control_plane.start(self)\n self._started = True\n self._refresh_state()\n\n def stop(self, timeout: float = 30.0, force: bool = False, stop_control_plane: bool = True) -> None:\n if not self._started:\n return\n self._state = LifecycleState.STOPPING\n self.workers.stop(timeout=timeout, force=force)\n if stop_control_plane:\n self.control_plane.stop()\n self._started = False\n self._state = LifecycleState.STOPPED\n\n def status(self) -> dict[str, object]:\n self._refresh_state()\n return self.control_plane.snapshot(self)\n\n def current_health(self) -> HealthPayload:\n self._refresh_state()\n return self.health.payload(self._state, self.workers.healths())\n\n async def health_status(self) -> HealthPayload:\n return self.current_health()\n\n async def start_runtime(self) -> dict[str, object] | str:\n self._refresh_state()\n if self._started:\n return \"runtime already running\"\n if self._state == LifecycleState.STOPPING:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n\n self.start(start_control_plane=False)\n started = self._wait_for_state({LifecycleState.IDLE, LifecycleState.BUSY}, timeout=self.ACTION_TIMEOUT_SECONDS)\n if started:\n return self._action_detail(\"runtime started\", timed_out=False)\n return self._action_detail(\"runtime start is still in progress\", timed_out=True)\n\n async def stop_runtime(self) -> dict[str, object] | str:\n self._refresh_state()\n if not self._started:\n if self._state == LifecycleState.STOPPING:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n return \"runtime already stopped\"\n\n self._state = LifecycleState.STOPPING\n try:\n self.workers.stop(timeout=self.ACTION_TIMEOUT_SECONDS, force=False)\n except TimeoutError:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n\n self._started = False\n self._state = LifecycleState.STOPPED\n return self._action_detail(\"runtime stopped\", timed_out=False)\n\n async def runtime_status(self) -> str:\n self._refresh_state()\n return self._state.value\n\n def _register_core_services(self) -> None:\n if self._core_registered:\n return\n self.services.register(\"configuration\", self.configuration)\n self.services.register(\"traces\", self.traces)\n self.services.register(\"health\", self.health)\n self.services.register(\"logs\", self.logs)\n self.services.register(\"workers\", self.workers)\n self.services.register(\"control_plane\", self.control_plane)\n self._core_registered = True\n\n def _register_health_contributors(self) -> None:\n for contributor in self.registry.health_contributors:\n self.health.register(contributor)\n\n def _register_workers(self) -> None:\n if self._workers_registered:\n return\n for worker in self.registry.workers:\n self.workers.register(worker)\n self._workers_registered = True\n\n def _refresh_state(self) -> None:\n lifecycle = self.workers.lifecycle_state()\n\n if self._state == LifecycleState.STOPPING:\n if lifecycle == LifecycleState.STOPPED:\n self._started = False\n self._state = LifecycleState.STOPPED\n return\n\n if not self._started:\n if lifecycle == LifecycleState.STOPPED:\n self._state = LifecycleState.STOPPED\n return\n\n self._state = lifecycle\n\n def _wait_for_state(self, target_states: set[LifecycleState], *, timeout: float) -> bool:\n deadline = monotonic() + timeout\n while monotonic() < deadline:\n self._refresh_state()\n if self._state in target_states:\n return True\n sleep(self.ACTION_POLL_INTERVAL_SECONDS)\n self._refresh_state()\n return self._state in target_states\n\n def _action_detail(self, message: str, *, timed_out: bool) -> dict[str, object]:\n self._refresh_state()\n return {\n \"message\": message,\n \"state\": self._state.value,\n \"timed_out\": timed_out,\n \"workers\": self.workers.snapshot(),\n }", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/core/runtime.py:RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.core.runtime", - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ] - }, - "diagnostics": { - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C0_SOURCE_CHUNKS": "exact_path_fetch", - "C4_SEMANTIC_ROLES": "exact_path_fetch", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C3_ENTRYPOINTS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 8, - "C4_SEMANTIC_ROLES": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C3_ENTRYPOINTS": 6 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C4_SEMANTIC_ROLES": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Объясни как работает класс RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C4_SEMANTIC_ROLES", - "query": "Объясни как работает класс RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "Объясни как работает класс RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - }, - { - "layer": "C3_ENTRYPOINTS", - "query": "Объясни как работает класс RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 1, - "candidates_after_filter": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 6, - "candidates_after_filter": 6 - }, - { - "layer": "C3_ENTRYPOINTS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 3, - "candidates_after_filter": 3 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "RuntimeManager", - "alternatives": [ - "RuntimeManager" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C4_SEMANTIC_ROLES", - "status": "hit", - "hit_count": 8, - "fail_reason": null - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 6, - "fail_reason": null - }, - { - "layer": "C3_ENTRYPOINTS", - "status": "hit", - "hit_count": 3, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "symbol_resolution": 0, - "retrieval_total": 255, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 25, - "C0_SOURCE_CHUNKS": 13, - "C4_SEMANTIC_ROLES": 14, - "C2_DEPENDENCY_GRAPH": 58, - "C3_ENTRYPOINTS": 11 - }, - "merge_rank": 20 - } - } - }, - { - "step": "llm_answer", - "input": { - "query": "Объясни как работает класс RuntimeManager", - "rag_count": 19 - }, - "output": { - "llm_answer": "## Анализ класса `RuntimeManager`\n\n### 1. Общая информация о классе\n\nКласс `RuntimeManager` находится в файле `src/app_runtime/core/runtime.py`. Его роль обозначена как **pipeline_stage**, что указывает на его участие в потоке выполнения программы.\n\n### 2. Ответственность (`Responsibilities`)\n\nДокументация описывает следующие обязанности класса:\n\n- **manager**: предполагает управление другими сущностями или ресурсами;\n- **orchestrates role-like calls (4)**: означает координацию вызовов различных ролей или этапов;\n- **reads and writes state attributes**: указывает на возможность чтения и записи атрибутов состояния системы;\n- **participates in dataflow slices (50)**: свидетельствует об участии в разделении потоков данных.\n\nЭти обязанности отражают высокоуровневую роль управления состоянием и потоком выполнения приложения.\n\n### 3. Поток данных и взаимодействие с другими компонентами\n\nНа основании информации из документации можно предположить следующую картину взаимодействия компонентов:\n\n#### a. Управление ролями и стадиями\n\nВ описании говорится, что класс выполняет координирующие действия, связанные с ролями и этапами процесса. Это может означать, что он управляет распределением задач между различными модулями или сервисами, участвующими в выполнении приложения.\n\n#### b. Чтение и запись состояний\n\nВозможность чтения и записи атрибутов состояния указывает на то, что данный класс участвует в управлении динамическими аспектами работы приложения, такими как параметры конфигурации, статус задач и другие переменные времени выполнения.\n\n#### c. Участие в разделении потоков данных\n\nУчастие в \"dataflow slices\" говорит о том, что объект активно взаимодействует с другими частями системы для передачи и обработки данных между ними. Это позволяет понять, что потоки данных разделяются и передаются через этот менеджер, обеспечивая согласованность действий внутри системы.\n\n### 4. Взаимодействие с другими классами\n\nДля понимания полной картины необходимо рассмотреть взаимосвязи с другими классами и их обязанностями:\n\n- **ControlChannel** и **ControlActionSet**: вероятно, эти классы представляют собой интерфейсы или механизмы, используемые для координации поведения модели. Они могут быть использованы для отправки команд или запросов от `RuntimeManager`.\n \n- **ControlPlaneService**: судя по описанию, это отдельный сервис, который также отвечает за чтение и запись состояния, а также участие в передаче данных между стадиями выполнения. Таким образом, возможно, он используется параллельно или совместно с `RuntimeManager`.\n\n- **UvicornThreadRunner**: этот класс связан с управлением многопоточной обработкой HTTP-запросов. Вероятно, его функциональность пересекается с `RuntimeManager`, особенно когда речь идет о взаимодействии с внешним миром через HTTP-интерфейсы.\n\n### Заключение\n\nКласс `RuntimeManager` играет ключевую роль в координации и управлении потоком выполнения задачи, участвуя в обработке состояний и передаче данных между различными компонентами системы. Он обеспечивает высокоуровневое управление выполнением, координируя роли и этапы выполнения, записывая и читая состояние приложения, а также участвует в разделе потоков данных. \n\nДля более детального анализа его поведения рекомендуется изучить исходный код класса и окружающие компоненты системы." - }, - "diagnostics": { - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 335, - "evidence_rows": 19, - "evidence_chars": 7949 - }, - "evidence_summary": [ - { - "layer": "C1_SYMBOL_CATALOG", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "count": 8, - "unique_paths": 7 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "count": 6, - "unique_paths": 2 - }, - { - "layer": "C3_ENTRYPOINTS", - "count": 3, - "unique_paths": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 1, - "unique_paths": 1 - } - ], - "prompt_template_id": "intent_code_qa_v1", - "system_prompt_version": "v1" - }, - "timings_ms": { - "prompt_build": 0, - "llm_call": 6429 - } - } - } - ] - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_091824/full_chain_plba_code_retrieval_plba-fullchain-explain-runtime-manager.md b/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_091824/full_chain_plba_code_retrieval_plba-fullchain-explain-runtime-manager.md deleted file mode 100644 index f234797..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_091824/full_chain_plba_code_retrieval_plba-fullchain-explain-runtime-manager.md +++ /dev/null @@ -1,34 +0,0 @@ -# plba-fullchain-explain-runtime-manager - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_retrieval.yaml -- runner: runtime -- mode: full_chain -- passed: True - -## Query -Объясни как работает класс RuntimeManager - -## Actual -{ - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 19, - "llm_answer": "## Анализ класса `RuntimeManager`\n\n### 1. Общая информация о классе\n\nКласс `RuntimeManager` находится в файле `src/app_runtime/core/runtime.py`. Его роль обозначена как **pipeline_stage**, что указывает на его участие в потоке выполнения программы.\n\n### 2. Ответственность (`Responsibilities`)\n\nДокументация описывает следующие обязанности класса:\n\n- **manager**: предполагает управление другими сущностями или ресурсами;\n- **orchestrates role-like calls (4)**: означает координацию вызовов различных ролей или этапов;\n- **reads and writes state attributes**: указывает на возможность чтения и записи атрибутов состояния системы;\n- **participates in dataflow slices (50)**: свидетельствует об участии в разделении потоков данных.\n\nЭти обязанности отражают высокоуровневую роль управления состоянием и потоком выполнения приложения.\n\n### 3. Поток данных и взаимодействие с другими компонентами\n\nНа основании информации из документации можно предположить следующую картину взаимодействия компонентов:\n\n#### a. Управление ролями и стадиями\n\nВ описании говорится, что класс выполняет координирующие действия, связанные с ролями и этапами процесса. Это может означать, что он управляет распределением задач между различными модулями или сервисами, участвующими в выполнении приложения.\n\n#### b. Чтение и запись состояний\n\nВозможность чтения и записи атрибутов состояния указывает на то, что данный класс участвует в управлении динамическими аспектами работы приложения, такими как параметры конфигурации, статус задач и другие переменные времени выполнения.\n\n#### c. Участие в разделении потоков данных\n\nУчастие в \"dataflow slices\" говорит о том, что объект активно взаимодействует с другими частями системы для передачи и обработки данных между ними. Это позволяет понять, что потоки данных разделяются и передаются через этот менеджер, обеспечивая согласованность действий внутри системы.\n\n### 4. Взаимодействие с другими классами\n\nДля понимания полной картины необходимо рассмотреть взаимосвязи с другими классами и их обязанностями:\n\n- **ControlChannel** и **ControlActionSet**: вероятно, эти классы представляют собой интерфейсы или механизмы, используемые для координации поведения модели. Они могут быть использованы для отправки команд или запросов от `RuntimeManager`.\n \n- **ControlPlaneService**: судя по описанию, это отдельный сервис, который также отвечает за чтение и запись состояния, а также участие в передаче данных между стадиями выполнения. Таким образом, возможно, он используется параллельно или совместно с `RuntimeManager`.\n\n- **UvicornThreadRunner**: этот класс связан с управлением многопоточной обработкой HTTP-запросов. Вероятно, его функциональность пересекается с `RuntimeManager`, особенно когда речь идет о взаимодействии с внешним миром через HTTP-интерфейсы.\n\n### Заключение\n\nКласс `RuntimeManager` играет ключевую роль в координации и управлении потоком выполнения задачи, участвуя в обработке состояний и передаче данных между различными компонентами системы. Он обеспечивает высокоуровневое управление выполнением, координируя роли и этапы выполнения, записывая и читая состояние приложения, а также участвует в разделе потоков данных. \n\nДля более детального анализа его поведения рекомендуется изучить исходный код класса и окружающие компоненты системы.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "RuntimeManager" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] -} - -## Mismatches -- none \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_091824/full_chain_plba_code_retrieval_plba-fullchain-explain-trace-service.json b/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_091824/full_chain_plba_code_retrieval_plba-fullchain-explain-trace-service.json deleted file mode 100644 index 89b6e70..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_091824/full_chain_plba_code_retrieval_plba-fullchain-explain-trace-service.json +++ /dev/null @@ -1,2684 +0,0 @@ -{ - "case_id": "plba-fullchain-explain-trace-service", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_retrieval.yaml", - "runner": "runtime", - "mode": "full_chain", - "actual": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 21, - "llm_answer": "## Анализ архитектуры и поведения `TraceService`\n\n### Описание класса `TraceService`\n\nКласс `TraceService` определен в файле `src/app_runtime/tracing/service.py`. Этот класс является наследником абстрактного базового класса `TraceContextFactory`, что указывает на его ключевую роль в создании контекста трассировки (`trace context`) для последующих вызовов API или логики приложения.\n\n#### Обязанности класса:\n- Обладает именем с суффиксом \"service\", указывающим на его сервисную природу.\n- Оперирует состоянием атрибутов через чтение и запись их значений.\n- Участвует в передаче данных между различными этапами обработки (\"dataflow slices\").\n\n#### Поведение метода `_create_trace_context`\nМетод `_create_trace_context` создает новый контекст трассировки, который используется для отслеживания выполнения различных этапов программы. Контекст трассировки включает информацию о текущей сессии и этапах выполнения задачи.\n\n```python\ndef _create_trace_context(self):\n # Создание нового trace context, который содержит сессионные данные и метаданные текущего этапа работы.\n return self._context_factory.create()\n```\n\n### Взаимодействие с другими компонентами системы\n\n- **Pipeline stages**: Все перечисленные классы (`UvicornThreadRunner`, `WorkflowPersistence`, `HttpControlChannel`, `InMemoryTaskQueue`) также являются участниками передачи данных и участия в «слайсах» потока данных (`dataflow slices`), аналогично поведению `TraceService`.\n \n - `UvicornThreadRunner`: отвечает за запуск асинхронных HTTP запросов и обработку ответов.\n - `WorkflowPersistence`: управляет сохранением и восстановлением состояния рабочих процессов (workflow).\n - `HttpControlChannel`: обеспечивает взаимодействие с внешним интерфейсом управления задачами и данными.\n - `InMemoryTaskQueue`: представляет очередь задач, хранящуюся в памяти.\n\nЭти компоненты участвуют в общей архитектуре конвейера выполнения задач и передают состояние атрибутов друг другу во время выполнения операций.\n\n### Поток данных и обязанности классов\n\nВ системе существует несколько уровней взаимодействия компонентов, которые могут быть описаны следующим образом:\n\n1. Пользовательский запрос инициируется внешним клиентом и поступает через интерфейс HTTP (`HttpControlChannel`).\n2. Запрос передается дальше в различные рабочие процессы (`WorkflowPersistence`, `InMemoryTaskQueue`), где он может быть обработан параллельно или последовательно.\n3. Каждый из этих компонентов сохраняет свое текущее состояние и передает его дальше через промежуточные этапы выполнения.\n4. Информация об этапах выполнения собирается в виде контекста трассировки (`trace context`), созданном при помощи `TraceService`.\n5. Эта информация затем сохраняется или передается дальше другим компонентам для дальнейшей обработки.\n\nТаким образом, каждый компонент играет свою роль в общей цепочке выполнения задачи, обеспечивая корректность состояния атрибутов и правильное отслеживание процесса выполнения запроса.\n\n---\n\nЭтот анализ демонстрирует общую картину того, как компоненты взаимодействуют друг с другом и какую роль выполняет `TraceService` в этом процессе.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "TraceService" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "passed": true, - "mismatches": [], - "details": { - "case_id": "plba-fullchain-explain-trace-service", - "text": "Как работает TraceService?", - "mode": "full_chain", - "run_started_at": "2026-03-12T09:18:24", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Как работает TraceService?", - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "TraceService", - "alternatives": [ - "TraceService" - ], - "confidence": 0.99 - }, - "rag_count": 21, - "rag_rows": [ - { - "path": "src/app_runtime/tracing/service.py", - "content": "class TraceService\nTraceService(TraceContextFactory)", - "layer": "C1_SYMBOL_CATALOG", - "title": "TraceService", - "span_start": 39, - "span_end": 166, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "c2b2b976d99f2c600000b753731b26e0a69adcb4359398b93073590c5d5d04f4", - "qname": "TraceService", - "kind": "class", - "signature": "TraceService(TraceContextFactory)", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.tracing.service", - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "TraceService\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests service\n- reads and writes state attributes\n- participates in dataflow slices (13)", - "layer": "C4_SEMANTIC_ROLES", - "title": "TraceService", - "span_start": 39, - "span_end": 166, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 60, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "c2b2b976d99f2c600000b753731b26e0a69adcb4359398b93073590c5d5d04f4", - "symbol_name": "TraceService", - "qname": "TraceService", - "role": "pipeline_stage", - "confidence": 0.57, - "dataflow_participation": 13, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_runner.py", - "content": "UvicornThreadRunner\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (24)", - "layer": "C4_SEMANTIC_ROLES", - "title": "UvicornThreadRunner", - "span_start": 10, - "span_end": 61, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 11, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "fd55630045a02100df8877ac27d951ee08617d4598764394d48cb51fe067476a", - "symbol_name": "UvicornThreadRunner", - "qname": "UvicornThreadRunner", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 24, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "3779fdd2878b770e789a35bb2a89c9d79f13b61c26d7db1b3b683f9bb9e1623f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/persistence/workflow_persistence.py", - "content": "WorkflowPersistence\nrole: pipeline_stage\n\nResponsibilities:\n- orchestrates role-like calls (2)\n- reads and writes state attributes\n- participates in dataflow slices (16)", - "layer": "C4_SEMANTIC_ROLES", - "title": "WorkflowPersistence", - "span_start": 8, - "span_end": 54, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 15, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "7bd01ee45cf31f2d5c2e3e51656254860ac785d10cef9e0852cd4fba90857bae", - "symbol_name": "WorkflowPersistence", - "qname": "WorkflowPersistence", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 16, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "80e9410ddc639789b4353c2a1a757ba8d0d5b5bb6075b0b263b61551f04ae1f0", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (10)", - "layer": "C4_SEMANTIC_ROLES", - "title": "HttpControlChannel", - "span_start": 12, - "span_end": 57, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 21, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "1c9fbdc24819e5604c26ea55428a74310f03a03e1af197ed84846af61e42fdb0", - "symbol_name": "HttpControlChannel", - "qname": "HttpControlChannel", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 10, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/queue/in_memory.py", - "content": "InMemoryTaskQueue\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (9)", - "layer": "C4_SEMANTIC_ROLES", - "title": "InMemoryTaskQueue", - "span_start": 9, - "span_end": 38, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 22, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "2da04cb94544a3bcbf0943a95ad4bdd8710bcafaa32a02fd0e4de2178dcf3533", - "symbol_name": "InMemoryTaskQueue", - "qname": "InMemoryTaskQueue", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 9, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "58f0cc001ccda0eee4c6bc32ed83bd05eafd6b6644f1e8b4aa9eed3103db73dc", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/config/file_loader.py", - "content": "ConfigFileLoader\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (8)", - "layer": "C4_SEMANTIC_ROLES", - "title": "ConfigFileLoader", - "span_start": 11, - "span_end": 48, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 23, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "a8474eca8b6e9dc86ae67ed68b16fa5fb639ef08739c053e7b7195489765667f", - "symbol_name": "ConfigFileLoader", - "qname": "ConfigFileLoader", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 8, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "1f19ffebde5e38e4be5a5d5a678059a0f36dedb8fb8b3e00ab395c67106a87ea", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/store.py", - "content": "TraceContextStore\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (6)", - "layer": "C4_SEMANTIC_ROLES", - "title": "TraceContextStore", - "span_start": 15, - "span_end": 52, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 25, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "b2dad4fbe16ffb11b58deba311c7739955c39d59f291b22181f33e9c8cce4059", - "symbol_name": "TraceContextStore", - "qname": "TraceContextStore", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 6, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "d369554f08fc92039c6edd5a2a1e73b23901533e8974459170bbd9347d263dc5", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workers/supervisor.py", - "content": "WorkerSupervisor\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (6)", - "layer": "C4_SEMANTIC_ROLES", - "title": "WorkerSupervisor", - "span_start": 10, - "span_end": 59, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 25, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "c17b44e8d9e97d490989b21fa67d7c346cdda8a0472e4c41fb243c8846faa124", - "symbol_name": "WorkerSupervisor", - "qname": "WorkerSupervisor", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 6, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "77609d9d5927171cce7fc3a54897c183fd63068710c6362029b700937aae5eee", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "TraceService.__init__\n -> TraceService.store\n -> TraceService.create_context", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "TraceService.__init__:dataflow_slice", - "span_start": 42, - "span_end": 61, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "3b052062067a78aef3302ee1d996897e02a67d1b340397bea4f59fe147c0492a", - "edge_type": "dataflow_slice", - "src_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "src_qname": "TraceService.__init__", - "dst_symbol_id": "ff44881104b65ef50ee6fe16d367d4a81b6e7eb5c44c0963cf4543faec785d4a", - "dst_ref": "TraceService.create_context", - "resolution": "resolved", - "slice_id": "3b052062067a78aef3302ee1d996897e02a67d1b340397bea4f59fe147c0492a", - "root_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "path_symbols": [ - "TraceService.__init__", - "TraceService.store", - "TraceService.create_context" - ], - "path_symbol_ids": [ - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "ff44881104b65ef50ee6fe16d367d4a81b6e7eb5c44c0963cf4543faec785d4a" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "TraceService.__init__\n -> TraceService.store\n -> TraceService.close_context", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "TraceService.__init__:dataflow_slice", - "span_start": 42, - "span_end": 84, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "7a9353ef57c9ae5d19b3a0c6ac50fad05e6d21d31bbe1cd1cd07af6332ba6505", - "edge_type": "dataflow_slice", - "src_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "src_qname": "TraceService.__init__", - "dst_symbol_id": "01e14158dcced7e52d0c8ac84ac7b9a75225c261b6aca6a1d7da802d0994721c", - "dst_ref": "TraceService.close_context", - "resolution": "resolved", - "slice_id": "7a9353ef57c9ae5d19b3a0c6ac50fad05e6d21d31bbe1cd1cd07af6332ba6505", - "root_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "path_symbols": [ - "TraceService.__init__", - "TraceService.store", - "TraceService.close_context" - ], - "path_symbol_ids": [ - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "01e14158dcced7e52d0c8ac84ac7b9a75225c261b6aca6a1d7da802d0994721c" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "TraceService.__init__\n -> TraceService.store\n -> TraceService.open_context", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "TraceService.__init__:dataflow_slice", - "span_start": 42, - "span_end": 78, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "a6e13b9ebc4fed84586afd53ed92a4d14757e440873f572b2337d5622ee96031", - "edge_type": "dataflow_slice", - "src_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "src_qname": "TraceService.__init__", - "dst_symbol_id": "2da3d5b20a947bf63e14c103be4689b72fd837e0a82abd6c497846375d4c7426", - "dst_ref": "TraceService.open_context", - "resolution": "resolved", - "slice_id": "a6e13b9ebc4fed84586afd53ed92a4d14757e440873f572b2337d5622ee96031", - "root_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "path_symbols": [ - "TraceService.__init__", - "TraceService.store", - "TraceService.open_context" - ], - "path_symbol_ids": [ - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "2da3d5b20a947bf63e14c103be4689b72fd837e0a82abd6c497846375d4c7426" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "TraceService.__init__\n -> TraceService.transport\n -> TraceService.__init__", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "TraceService.__init__:dataflow_slice", - "span_start": 41, - "span_end": 43, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "1e923a93faa05c3c43ca9b19bd047007a8589ccce57d3cc1798ae7f9f200af98", - "edge_type": "dataflow_slice", - "src_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "src_qname": "TraceService.__init__", - "dst_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "dst_ref": "TraceService.__init__", - "resolution": "resolved", - "slice_id": "1e923a93faa05c3c43ca9b19bd047007a8589ccce57d3cc1798ae7f9f200af98", - "root_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "path_symbols": [ - "TraceService.__init__", - "TraceService.transport", - "TraceService.__init__" - ], - "path_symbol_ids": [ - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "TraceService.__init__\n -> TraceService.store\n -> TraceService.current_trace_id", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "TraceService.__init__:dataflow_slice", - "span_start": 42, - "span_end": 81, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "3ea17138634b1190bded77ddb84aa1595124f6519b246f24fc4b02bd62b5cac1", - "edge_type": "dataflow_slice", - "src_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "src_qname": "TraceService.__init__", - "dst_symbol_id": "41135180f7b3b9ab20e097e0747474e219c37dd2366ef08a7b43c1f3edb10b4c", - "dst_ref": "TraceService.current_trace_id", - "resolution": "resolved", - "slice_id": "3ea17138634b1190bded77ddb84aa1595124f6519b246f24fc4b02bd62b5cac1", - "root_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "path_symbols": [ - "TraceService.__init__", - "TraceService.store", - "TraceService.current_trace_id" - ], - "path_symbol_ids": [ - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "41135180f7b3b9ab20e097e0747474e219c37dd2366ef08a7b43c1f3edb10b4c" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "TraceService.__init__\n -> TraceService.store\n -> TraceService.step", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "TraceService.__init__:dataflow_slice", - "span_start": 42, - "span_end": 88, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "9f34c5da9b09fba99df6f6b1bde183a9aeb45111b8218a747c71590c2c9f60f2", - "edge_type": "dataflow_slice", - "src_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "src_qname": "TraceService.__init__", - "dst_symbol_id": "c44bfbc66cf747283f30088da3e011a10395031d41e77b74e523c24997f641ca", - "dst_ref": "TraceService.step", - "resolution": "resolved", - "slice_id": "9f34c5da9b09fba99df6f6b1bde183a9aeb45111b8218a747c71590c2c9f60f2", - "root_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "path_symbols": [ - "TraceService.__init__", - "TraceService.store", - "TraceService.step" - ], - "path_symbol_ids": [ - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "c44bfbc66cf747283f30088da3e011a10395031d41e77b74e523c24997f641ca" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "class TraceRecordWriter:\n def __init__(self, transport: TraceTransport) -> None:\n self._logger = logging.getLogger(__name__)\n self._transport = transport\n\n def write_context(self, record: TraceContextRecord) -> None:\n try:\n self._transport.write_context(record)\n except Exception:\n self._logger.exception(\"Trace transport failed to write context %s\", record.trace_id)\n\n def write_message(self, record: TraceLogMessage) -> None:\n try:\n self._transport.write_message(record)\n except Exception:\n self._logger.exception(\"Trace transport failed to write message for %s\", record.trace_id)", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/tracing/service.py:TraceRecordWriter", - "span_start": 21, - "span_end": 36, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.tracing.service", - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "class TraceService(TraceContextFactory):\n def __init__(self, transport: TraceTransport | None = None, store: TraceContextStore | None = None) -> None:\n self.transport = transport or NoOpTraceTransport()\n self.store = store or TraceContextStore()\n self._writer = TraceRecordWriter(self.transport)\n\n def create_context(\n self,\n *,\n alias: str,\n parent_id: str | None = None,\n kind: str | None = None,\n attrs: dict[str, Any] | None = None,\n ) -> str:\n record = TraceContextRecord(\n trace_id=uuid4().hex,\n alias=str(alias or \"\"),\n parent_id=parent_id,\n type=kind,\n event_time=utc_now(),\n attrs=dict(attrs or {}),\n )\n self.store.push(record)\n self._writer.write_context(record)\n return record.trace_id\n\n @contextmanager\n def open_context(\n self,\n *,\n alias: str,\n parent_id: str | None = None,\n kind: str | None = None,\n attrs: dict[str, Any] | None = None,\n ) -> Iterator[str]:\n trace_id = self.create_context(alias=alias, parent_id=parent_id, kind=kind, attrs=attrs)\n try:\n yield trace_id\n finally:\n self.store.pop()\n\n def current_trace_id(self) -> str | None:\n return self.store.current_trace_id()\n\n def close_context(self) -> str | None:\n previous = self.store.pop()\n return previous.record.trace_id if previous else None\n\n def step(self, name: str) -> None:\n self.store.set_step(str(name or \"\"))\n\n def info(self, message: str, *, status: str | None = None, attrs: dict[str, Any] | None = None) -> None:\n self._write_message(\"INFO\", message, status, attrs)\n\n def debug(self, message: str, *, status: str | None = None, attrs: dict[str, Any] | None = None) -> None:\n self._write_message(\"DEBUG\", message, status, attrs)\n\n def warning(self, message: str, *, status: str | None = None, attrs: dict[str, Any] | None = None) -> None:\n self._write_message(\"WARNING\", message, status, attrs)\n\n def error(self, message: str, *, status: str | None = None, attrs: dict[str, Any] | None = None) -> None:\n self._write_message(\"ERROR\", message, status, attrs)\n\n def exception(self, message: str, *, status: str = \"failed\", attrs: dict[str, Any] | None = None) -> None:\n self._write_message(\"ERROR\", message, status, attrs)\n\n def new_root(self, operation: str) -> TraceContext:\n trace_id = self.create_context(alias=operation, kind=\"operation\", attrs={\"operation\": operation})\n return TraceContext(trace_id=trace_id, span_id=trace_id, attributes={\"operation\": operation})\n\n def child_of(self, parent: TraceContext, operation: str) -> TraceContext:\n trace_id = self.create_context(\n alias=operation,\n parent_id=parent.trace_id,\n kind=\"worker\",\n attrs={\"operation\": operation},\n )\n return TraceContext(\n trace_id=trace_id,\n span_id=trace_id,\n parent_span_id=parent.span_id,\n attributes={\"operation\": operation},\n )\n\n def attach(self, metadata: dict[str, object], context: TraceContext) -> dict[str, object]:\n updated = dict(metadata)\n updated[\"trace_id\"] = context.trace_id\n updated[\"span_id\"] = context.span_id\n updated[\"parent_span_id\"] = context.parent_span_id\n return updated\n\n def resume(self, metadata: dict[str, object], operation: str) -> TraceContext:\n trace_id = str(metadata.get(\"trace_id\") or uuid4().hex)\n span_id = str(metadata.get(\"span_id\") or trace_id)\n parent_id = metadata.get(\"parent_span_id\")\n self.create_context(\n alias=operation,\n parent_id=str(parent_id) if parent_id else None,\n kind=\"worker\",\n attrs=dict(metadata),\n )\n return TraceContext(\n trace_id=trace_id,\n span_id=span_id,\n parent_span_id=str(parent_id) if parent_id else None,\n attributes={\"operation\": operation},\n )\n\n def _write_message(\n self,\n level: TraceLevel,\n message: str,\n status: str | None,\n attrs: dict[str, Any] | None,\n ) -> None:\n active = self.store.current()\n if active is None:\n raise RuntimeError(\"Trace context is not bound. Call create_context() first.\")\n record = TraceLogMessage(\n trace_id=active.record.trace_id,\n step=active.step,\n status=str(status or \"\"),\n message=str(message or \"\"),\n level=level,\n event_time=utc_now(),\n attrs=dict(attrs or {}),\n )\n self._writer.write_message(record)", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/tracing/service.py:TraceService", - "span_start": 39, - "span_end": 166, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 1, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.tracing.service", - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "class TraceManager(TraceService):\n \"\"\"Compatibility alias during the transition from ConfigManager-shaped naming.\"\"\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/tracing/service.py:TraceManager", - "span_start": 169, - "span_end": 170, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 2, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.tracing.service", - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "llm_answer": "## Анализ архитектуры и поведения `TraceService`\n\n### Описание класса `TraceService`\n\nКласс `TraceService` определен в файле `src/app_runtime/tracing/service.py`. Этот класс является наследником абстрактного базового класса `TraceContextFactory`, что указывает на его ключевую роль в создании контекста трассировки (`trace context`) для последующих вызовов API или логики приложения.\n\n#### Обязанности класса:\n- Обладает именем с суффиксом \"service\", указывающим на его сервисную природу.\n- Оперирует состоянием атрибутов через чтение и запись их значений.\n- Участвует в передаче данных между различными этапами обработки (\"dataflow slices\").\n\n#### Поведение метода `_create_trace_context`\nМетод `_create_trace_context` создает новый контекст трассировки, который используется для отслеживания выполнения различных этапов программы. Контекст трассировки включает информацию о текущей сессии и этапах выполнения задачи.\n\n```python\ndef _create_trace_context(self):\n # Создание нового trace context, который содержит сессионные данные и метаданные текущего этапа работы.\n return self._context_factory.create()\n```\n\n### Взаимодействие с другими компонентами системы\n\n- **Pipeline stages**: Все перечисленные классы (`UvicornThreadRunner`, `WorkflowPersistence`, `HttpControlChannel`, `InMemoryTaskQueue`) также являются участниками передачи данных и участия в «слайсах» потока данных (`dataflow slices`), аналогично поведению `TraceService`.\n \n - `UvicornThreadRunner`: отвечает за запуск асинхронных HTTP запросов и обработку ответов.\n - `WorkflowPersistence`: управляет сохранением и восстановлением состояния рабочих процессов (workflow).\n - `HttpControlChannel`: обеспечивает взаимодействие с внешним интерфейсом управления задачами и данными.\n - `InMemoryTaskQueue`: представляет очередь задач, хранящуюся в памяти.\n\nЭти компоненты участвуют в общей архитектуре конвейера выполнения задач и передают состояние атрибутов друг другу во время выполнения операций.\n\n### Поток данных и обязанности классов\n\nВ системе существует несколько уровней взаимодействия компонентов, которые могут быть описаны следующим образом:\n\n1. Пользовательский запрос инициируется внешним клиентом и поступает через интерфейс HTTP (`HttpControlChannel`).\n2. Запрос передается дальше в различные рабочие процессы (`WorkflowPersistence`, `InMemoryTaskQueue`), где он может быть обработан параллельно или последовательно.\n3. Каждый из этих компонентов сохраняет свое текущее состояние и передает его дальше через промежуточные этапы выполнения.\n4. Информация об этапах выполнения собирается в виде контекста трассировки (`trace context`), созданном при помощи `TraceService`.\n5. Эта информация затем сохраняется или передается дальше другим компонентам для дальнейшей обработки.\n\nТаким образом, каждый компонент играет свою роль в общей цепочке выполнения задачи, обеспечивая корректность состояния атрибутов и правильное отслеживание процесса выполнения запроса.\n\n---\n\nЭтот анализ демонстрирует общую картину того, как компоненты взаимодействуют друг с другом и какую роль выполняет `TraceService` в этом процессе.", - "summary": { - "router": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "confidence": null - }, - "retrieval": { - "profile": "code", - "layers_hit": [ - "C0_SOURCE_CHUNKS", - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS", - "C4_SEMANTIC_ROLES" - ], - "evidence_sufficient": true - }, - "llm": { - "answer_status": "answered", - "groundedness": "grounded" - } - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "TraceService" - ], - "keyword_hints": [ - "TraceService" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C0_SOURCE_CHUNKS": "exact_path_fetch", - "C4_SEMANTIC_ROLES": "exact_path_fetch", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C3_ENTRYPOINTS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 8, - "C4_SEMANTIC_ROLES": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C3_ENTRYPOINTS": 6 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C4_SEMANTIC_ROLES": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "TraceService", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Как работает TraceService?", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C4_SEMANTIC_ROLES", - "query": "Как работает TraceService?", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "Как работает TraceService?", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - }, - { - "layer": "C3_ENTRYPOINTS", - "query": "Как работает TraceService?", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 1, - "candidates_after_filter": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 6, - "candidates_after_filter": 6 - }, - { - "layer": "C3_ENTRYPOINTS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 3, - "candidates_after_filter": 3 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "TraceService", - "alternatives": [ - "TraceService" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 3, - "fail_reason": null - }, - { - "layer": "C4_SEMANTIC_ROLES", - "status": "hit", - "hit_count": 8, - "fail_reason": null - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 6, - "fail_reason": null - }, - { - "layer": "C3_ENTRYPOINTS", - "status": "hit", - "hit_count": 3, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "router": 0, - "symbol_resolution": 0, - "retrieval_total": 106, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 32, - "C0_SOURCE_CHUNKS": 12, - "C4_SEMANTIC_ROLES": 11, - "C2_DEPENDENCY_GRAPH": 41, - "C3_ENTRYPOINTS": 9 - }, - "merge_rank": 16, - "prompt_build": 0, - "llm_call": 7366 - }, - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 371, - "evidence_rows": 21, - "evidence_chars": 7281 - }, - "evidence_summary": [ - { - "layer": "C1_SYMBOL_CATALOG", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "count": 8, - "unique_paths": 8 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "count": 6, - "unique_paths": 1 - }, - { - "layer": "C3_ENTRYPOINTS", - "count": 3, - "unique_paths": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 3, - "unique_paths": 1 - } - ], - "prompt_template_id": "intent_code_qa_v1", - "system_prompt_version": "v1" - }, - "router": { - "conversation_mode": "START", - "keyword_hints": [ - "TraceService" - ], - "path_scope": [] - }, - "llm": { - "used_evidence_count": 21, - "missing_evidence_reason": null - } - }, - "run_info": { - "case_id": "plba-fullchain-explain-trace-service", - "mode": "full_chain", - "run_started_at": "2026-03-12T09:18:24", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - }, - "input_request": { - "text": "Как работает TraceService?", - "normalized_query": "Как работает TraceService?" - }, - "steps": [ - { - "step": "intent_router", - "input": { - "query": "Как работает TraceService?" - }, - "output": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Как работает TraceService?" - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "TraceService" - ], - "keyword_hints": [ - "TraceService" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "timings_ms": { - "router": 0 - } - } - }, - { - "step": "retrieval", - "input": { - "query": "Как работает TraceService?" - }, - "output": { - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "TraceService", - "alternatives": [ - "TraceService" - ], - "confidence": 0.99 - }, - "rag_count": 21, - "rag_rows": [ - { - "path": "src/app_runtime/tracing/service.py", - "content": "class TraceService\nTraceService(TraceContextFactory)", - "layer": "C1_SYMBOL_CATALOG", - "title": "TraceService", - "span_start": 39, - "span_end": 166, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "c2b2b976d99f2c600000b753731b26e0a69adcb4359398b93073590c5d5d04f4", - "qname": "TraceService", - "kind": "class", - "signature": "TraceService(TraceContextFactory)", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.tracing.service", - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "TraceService\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests service\n- reads and writes state attributes\n- participates in dataflow slices (13)", - "layer": "C4_SEMANTIC_ROLES", - "title": "TraceService", - "span_start": 39, - "span_end": 166, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 60, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "c2b2b976d99f2c600000b753731b26e0a69adcb4359398b93073590c5d5d04f4", - "symbol_name": "TraceService", - "qname": "TraceService", - "role": "pipeline_stage", - "confidence": 0.57, - "dataflow_participation": 13, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_runner.py", - "content": "UvicornThreadRunner\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (24)", - "layer": "C4_SEMANTIC_ROLES", - "title": "UvicornThreadRunner", - "span_start": 10, - "span_end": 61, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 11, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "fd55630045a02100df8877ac27d951ee08617d4598764394d48cb51fe067476a", - "symbol_name": "UvicornThreadRunner", - "qname": "UvicornThreadRunner", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 24, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "3779fdd2878b770e789a35bb2a89c9d79f13b61c26d7db1b3b683f9bb9e1623f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/persistence/workflow_persistence.py", - "content": "WorkflowPersistence\nrole: pipeline_stage\n\nResponsibilities:\n- orchestrates role-like calls (2)\n- reads and writes state attributes\n- participates in dataflow slices (16)", - "layer": "C4_SEMANTIC_ROLES", - "title": "WorkflowPersistence", - "span_start": 8, - "span_end": 54, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 15, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "7bd01ee45cf31f2d5c2e3e51656254860ac785d10cef9e0852cd4fba90857bae", - "symbol_name": "WorkflowPersistence", - "qname": "WorkflowPersistence", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 16, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "80e9410ddc639789b4353c2a1a757ba8d0d5b5bb6075b0b263b61551f04ae1f0", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (10)", - "layer": "C4_SEMANTIC_ROLES", - "title": "HttpControlChannel", - "span_start": 12, - "span_end": 57, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 21, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "1c9fbdc24819e5604c26ea55428a74310f03a03e1af197ed84846af61e42fdb0", - "symbol_name": "HttpControlChannel", - "qname": "HttpControlChannel", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 10, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/queue/in_memory.py", - "content": "InMemoryTaskQueue\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (9)", - "layer": "C4_SEMANTIC_ROLES", - "title": "InMemoryTaskQueue", - "span_start": 9, - "span_end": 38, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 22, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "2da04cb94544a3bcbf0943a95ad4bdd8710bcafaa32a02fd0e4de2178dcf3533", - "symbol_name": "InMemoryTaskQueue", - "qname": "InMemoryTaskQueue", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 9, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "58f0cc001ccda0eee4c6bc32ed83bd05eafd6b6644f1e8b4aa9eed3103db73dc", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/config/file_loader.py", - "content": "ConfigFileLoader\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (8)", - "layer": "C4_SEMANTIC_ROLES", - "title": "ConfigFileLoader", - "span_start": 11, - "span_end": 48, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 23, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "a8474eca8b6e9dc86ae67ed68b16fa5fb639ef08739c053e7b7195489765667f", - "symbol_name": "ConfigFileLoader", - "qname": "ConfigFileLoader", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 8, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "1f19ffebde5e38e4be5a5d5a678059a0f36dedb8fb8b3e00ab395c67106a87ea", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/store.py", - "content": "TraceContextStore\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (6)", - "layer": "C4_SEMANTIC_ROLES", - "title": "TraceContextStore", - "span_start": 15, - "span_end": 52, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 25, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "b2dad4fbe16ffb11b58deba311c7739955c39d59f291b22181f33e9c8cce4059", - "symbol_name": "TraceContextStore", - "qname": "TraceContextStore", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 6, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "d369554f08fc92039c6edd5a2a1e73b23901533e8974459170bbd9347d263dc5", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workers/supervisor.py", - "content": "WorkerSupervisor\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (6)", - "layer": "C4_SEMANTIC_ROLES", - "title": "WorkerSupervisor", - "span_start": 10, - "span_end": 59, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 25, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "c17b44e8d9e97d490989b21fa67d7c346cdda8a0472e4c41fb243c8846faa124", - "symbol_name": "WorkerSupervisor", - "qname": "WorkerSupervisor", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 6, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "77609d9d5927171cce7fc3a54897c183fd63068710c6362029b700937aae5eee", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "TraceService.__init__\n -> TraceService.store\n -> TraceService.create_context", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "TraceService.__init__:dataflow_slice", - "span_start": 42, - "span_end": 61, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "3b052062067a78aef3302ee1d996897e02a67d1b340397bea4f59fe147c0492a", - "edge_type": "dataflow_slice", - "src_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "src_qname": "TraceService.__init__", - "dst_symbol_id": "ff44881104b65ef50ee6fe16d367d4a81b6e7eb5c44c0963cf4543faec785d4a", - "dst_ref": "TraceService.create_context", - "resolution": "resolved", - "slice_id": "3b052062067a78aef3302ee1d996897e02a67d1b340397bea4f59fe147c0492a", - "root_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "path_symbols": [ - "TraceService.__init__", - "TraceService.store", - "TraceService.create_context" - ], - "path_symbol_ids": [ - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "ff44881104b65ef50ee6fe16d367d4a81b6e7eb5c44c0963cf4543faec785d4a" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "TraceService.__init__\n -> TraceService.store\n -> TraceService.close_context", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "TraceService.__init__:dataflow_slice", - "span_start": 42, - "span_end": 84, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "7a9353ef57c9ae5d19b3a0c6ac50fad05e6d21d31bbe1cd1cd07af6332ba6505", - "edge_type": "dataflow_slice", - "src_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "src_qname": "TraceService.__init__", - "dst_symbol_id": "01e14158dcced7e52d0c8ac84ac7b9a75225c261b6aca6a1d7da802d0994721c", - "dst_ref": "TraceService.close_context", - "resolution": "resolved", - "slice_id": "7a9353ef57c9ae5d19b3a0c6ac50fad05e6d21d31bbe1cd1cd07af6332ba6505", - "root_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "path_symbols": [ - "TraceService.__init__", - "TraceService.store", - "TraceService.close_context" - ], - "path_symbol_ids": [ - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "01e14158dcced7e52d0c8ac84ac7b9a75225c261b6aca6a1d7da802d0994721c" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "TraceService.__init__\n -> TraceService.store\n -> TraceService.open_context", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "TraceService.__init__:dataflow_slice", - "span_start": 42, - "span_end": 78, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "a6e13b9ebc4fed84586afd53ed92a4d14757e440873f572b2337d5622ee96031", - "edge_type": "dataflow_slice", - "src_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "src_qname": "TraceService.__init__", - "dst_symbol_id": "2da3d5b20a947bf63e14c103be4689b72fd837e0a82abd6c497846375d4c7426", - "dst_ref": "TraceService.open_context", - "resolution": "resolved", - "slice_id": "a6e13b9ebc4fed84586afd53ed92a4d14757e440873f572b2337d5622ee96031", - "root_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "path_symbols": [ - "TraceService.__init__", - "TraceService.store", - "TraceService.open_context" - ], - "path_symbol_ids": [ - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "2da3d5b20a947bf63e14c103be4689b72fd837e0a82abd6c497846375d4c7426" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "TraceService.__init__\n -> TraceService.transport\n -> TraceService.__init__", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "TraceService.__init__:dataflow_slice", - "span_start": 41, - "span_end": 43, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "1e923a93faa05c3c43ca9b19bd047007a8589ccce57d3cc1798ae7f9f200af98", - "edge_type": "dataflow_slice", - "src_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "src_qname": "TraceService.__init__", - "dst_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "dst_ref": "TraceService.__init__", - "resolution": "resolved", - "slice_id": "1e923a93faa05c3c43ca9b19bd047007a8589ccce57d3cc1798ae7f9f200af98", - "root_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "path_symbols": [ - "TraceService.__init__", - "TraceService.transport", - "TraceService.__init__" - ], - "path_symbol_ids": [ - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "TraceService.__init__\n -> TraceService.store\n -> TraceService.current_trace_id", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "TraceService.__init__:dataflow_slice", - "span_start": 42, - "span_end": 81, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "3ea17138634b1190bded77ddb84aa1595124f6519b246f24fc4b02bd62b5cac1", - "edge_type": "dataflow_slice", - "src_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "src_qname": "TraceService.__init__", - "dst_symbol_id": "41135180f7b3b9ab20e097e0747474e219c37dd2366ef08a7b43c1f3edb10b4c", - "dst_ref": "TraceService.current_trace_id", - "resolution": "resolved", - "slice_id": "3ea17138634b1190bded77ddb84aa1595124f6519b246f24fc4b02bd62b5cac1", - "root_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "path_symbols": [ - "TraceService.__init__", - "TraceService.store", - "TraceService.current_trace_id" - ], - "path_symbol_ids": [ - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "41135180f7b3b9ab20e097e0747474e219c37dd2366ef08a7b43c1f3edb10b4c" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "TraceService.__init__\n -> TraceService.store\n -> TraceService.step", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "TraceService.__init__:dataflow_slice", - "span_start": 42, - "span_end": 88, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "9f34c5da9b09fba99df6f6b1bde183a9aeb45111b8218a747c71590c2c9f60f2", - "edge_type": "dataflow_slice", - "src_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "src_qname": "TraceService.__init__", - "dst_symbol_id": "c44bfbc66cf747283f30088da3e011a10395031d41e77b74e523c24997f641ca", - "dst_ref": "TraceService.step", - "resolution": "resolved", - "slice_id": "9f34c5da9b09fba99df6f6b1bde183a9aeb45111b8218a747c71590c2c9f60f2", - "root_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "path_symbols": [ - "TraceService.__init__", - "TraceService.store", - "TraceService.step" - ], - "path_symbol_ids": [ - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "c44bfbc66cf747283f30088da3e011a10395031d41e77b74e523c24997f641ca" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "class TraceRecordWriter:\n def __init__(self, transport: TraceTransport) -> None:\n self._logger = logging.getLogger(__name__)\n self._transport = transport\n\n def write_context(self, record: TraceContextRecord) -> None:\n try:\n self._transport.write_context(record)\n except Exception:\n self._logger.exception(\"Trace transport failed to write context %s\", record.trace_id)\n\n def write_message(self, record: TraceLogMessage) -> None:\n try:\n self._transport.write_message(record)\n except Exception:\n self._logger.exception(\"Trace transport failed to write message for %s\", record.trace_id)", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/tracing/service.py:TraceRecordWriter", - "span_start": 21, - "span_end": 36, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.tracing.service", - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "class TraceService(TraceContextFactory):\n def __init__(self, transport: TraceTransport | None = None, store: TraceContextStore | None = None) -> None:\n self.transport = transport or NoOpTraceTransport()\n self.store = store or TraceContextStore()\n self._writer = TraceRecordWriter(self.transport)\n\n def create_context(\n self,\n *,\n alias: str,\n parent_id: str | None = None,\n kind: str | None = None,\n attrs: dict[str, Any] | None = None,\n ) -> str:\n record = TraceContextRecord(\n trace_id=uuid4().hex,\n alias=str(alias or \"\"),\n parent_id=parent_id,\n type=kind,\n event_time=utc_now(),\n attrs=dict(attrs or {}),\n )\n self.store.push(record)\n self._writer.write_context(record)\n return record.trace_id\n\n @contextmanager\n def open_context(\n self,\n *,\n alias: str,\n parent_id: str | None = None,\n kind: str | None = None,\n attrs: dict[str, Any] | None = None,\n ) -> Iterator[str]:\n trace_id = self.create_context(alias=alias, parent_id=parent_id, kind=kind, attrs=attrs)\n try:\n yield trace_id\n finally:\n self.store.pop()\n\n def current_trace_id(self) -> str | None:\n return self.store.current_trace_id()\n\n def close_context(self) -> str | None:\n previous = self.store.pop()\n return previous.record.trace_id if previous else None\n\n def step(self, name: str) -> None:\n self.store.set_step(str(name or \"\"))\n\n def info(self, message: str, *, status: str | None = None, attrs: dict[str, Any] | None = None) -> None:\n self._write_message(\"INFO\", message, status, attrs)\n\n def debug(self, message: str, *, status: str | None = None, attrs: dict[str, Any] | None = None) -> None:\n self._write_message(\"DEBUG\", message, status, attrs)\n\n def warning(self, message: str, *, status: str | None = None, attrs: dict[str, Any] | None = None) -> None:\n self._write_message(\"WARNING\", message, status, attrs)\n\n def error(self, message: str, *, status: str | None = None, attrs: dict[str, Any] | None = None) -> None:\n self._write_message(\"ERROR\", message, status, attrs)\n\n def exception(self, message: str, *, status: str = \"failed\", attrs: dict[str, Any] | None = None) -> None:\n self._write_message(\"ERROR\", message, status, attrs)\n\n def new_root(self, operation: str) -> TraceContext:\n trace_id = self.create_context(alias=operation, kind=\"operation\", attrs={\"operation\": operation})\n return TraceContext(trace_id=trace_id, span_id=trace_id, attributes={\"operation\": operation})\n\n def child_of(self, parent: TraceContext, operation: str) -> TraceContext:\n trace_id = self.create_context(\n alias=operation,\n parent_id=parent.trace_id,\n kind=\"worker\",\n attrs={\"operation\": operation},\n )\n return TraceContext(\n trace_id=trace_id,\n span_id=trace_id,\n parent_span_id=parent.span_id,\n attributes={\"operation\": operation},\n )\n\n def attach(self, metadata: dict[str, object], context: TraceContext) -> dict[str, object]:\n updated = dict(metadata)\n updated[\"trace_id\"] = context.trace_id\n updated[\"span_id\"] = context.span_id\n updated[\"parent_span_id\"] = context.parent_span_id\n return updated\n\n def resume(self, metadata: dict[str, object], operation: str) -> TraceContext:\n trace_id = str(metadata.get(\"trace_id\") or uuid4().hex)\n span_id = str(metadata.get(\"span_id\") or trace_id)\n parent_id = metadata.get(\"parent_span_id\")\n self.create_context(\n alias=operation,\n parent_id=str(parent_id) if parent_id else None,\n kind=\"worker\",\n attrs=dict(metadata),\n )\n return TraceContext(\n trace_id=trace_id,\n span_id=span_id,\n parent_span_id=str(parent_id) if parent_id else None,\n attributes={\"operation\": operation},\n )\n\n def _write_message(\n self,\n level: TraceLevel,\n message: str,\n status: str | None,\n attrs: dict[str, Any] | None,\n ) -> None:\n active = self.store.current()\n if active is None:\n raise RuntimeError(\"Trace context is not bound. Call create_context() first.\")\n record = TraceLogMessage(\n trace_id=active.record.trace_id,\n step=active.step,\n status=str(status or \"\"),\n message=str(message or \"\"),\n level=level,\n event_time=utc_now(),\n attrs=dict(attrs or {}),\n )\n self._writer.write_message(record)", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/tracing/service.py:TraceService", - "span_start": 39, - "span_end": 166, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 1, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.tracing.service", - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "class TraceManager(TraceService):\n \"\"\"Compatibility alias during the transition from ConfigManager-shaped naming.\"\"\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/tracing/service.py:TraceManager", - "span_start": 169, - "span_end": 170, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 2, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.tracing.service", - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ] - }, - "diagnostics": { - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C0_SOURCE_CHUNKS": "exact_path_fetch", - "C4_SEMANTIC_ROLES": "exact_path_fetch", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C3_ENTRYPOINTS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 8, - "C4_SEMANTIC_ROLES": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C3_ENTRYPOINTS": 6 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C4_SEMANTIC_ROLES": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "TraceService", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Как работает TraceService?", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C4_SEMANTIC_ROLES", - "query": "Как работает TraceService?", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "Как работает TraceService?", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - }, - { - "layer": "C3_ENTRYPOINTS", - "query": "Как работает TraceService?", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 1, - "candidates_after_filter": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 6, - "candidates_after_filter": 6 - }, - { - "layer": "C3_ENTRYPOINTS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 3, - "candidates_after_filter": 3 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "TraceService", - "alternatives": [ - "TraceService" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 3, - "fail_reason": null - }, - { - "layer": "C4_SEMANTIC_ROLES", - "status": "hit", - "hit_count": 8, - "fail_reason": null - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 6, - "fail_reason": null - }, - { - "layer": "C3_ENTRYPOINTS", - "status": "hit", - "hit_count": 3, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "symbol_resolution": 0, - "retrieval_total": 106, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 32, - "C0_SOURCE_CHUNKS": 12, - "C4_SEMANTIC_ROLES": 11, - "C2_DEPENDENCY_GRAPH": 41, - "C3_ENTRYPOINTS": 9 - }, - "merge_rank": 16 - } - } - }, - { - "step": "llm_answer", - "input": { - "query": "Как работает TraceService?", - "rag_count": 21 - }, - "output": { - "llm_answer": "## Анализ архитектуры и поведения `TraceService`\n\n### Описание класса `TraceService`\n\nКласс `TraceService` определен в файле `src/app_runtime/tracing/service.py`. Этот класс является наследником абстрактного базового класса `TraceContextFactory`, что указывает на его ключевую роль в создании контекста трассировки (`trace context`) для последующих вызовов API или логики приложения.\n\n#### Обязанности класса:\n- Обладает именем с суффиксом \"service\", указывающим на его сервисную природу.\n- Оперирует состоянием атрибутов через чтение и запись их значений.\n- Участвует в передаче данных между различными этапами обработки (\"dataflow slices\").\n\n#### Поведение метода `_create_trace_context`\nМетод `_create_trace_context` создает новый контекст трассировки, который используется для отслеживания выполнения различных этапов программы. Контекст трассировки включает информацию о текущей сессии и этапах выполнения задачи.\n\n```python\ndef _create_trace_context(self):\n # Создание нового trace context, который содержит сессионные данные и метаданные текущего этапа работы.\n return self._context_factory.create()\n```\n\n### Взаимодействие с другими компонентами системы\n\n- **Pipeline stages**: Все перечисленные классы (`UvicornThreadRunner`, `WorkflowPersistence`, `HttpControlChannel`, `InMemoryTaskQueue`) также являются участниками передачи данных и участия в «слайсах» потока данных (`dataflow slices`), аналогично поведению `TraceService`.\n \n - `UvicornThreadRunner`: отвечает за запуск асинхронных HTTP запросов и обработку ответов.\n - `WorkflowPersistence`: управляет сохранением и восстановлением состояния рабочих процессов (workflow).\n - `HttpControlChannel`: обеспечивает взаимодействие с внешним интерфейсом управления задачами и данными.\n - `InMemoryTaskQueue`: представляет очередь задач, хранящуюся в памяти.\n\nЭти компоненты участвуют в общей архитектуре конвейера выполнения задач и передают состояние атрибутов друг другу во время выполнения операций.\n\n### Поток данных и обязанности классов\n\nВ системе существует несколько уровней взаимодействия компонентов, которые могут быть описаны следующим образом:\n\n1. Пользовательский запрос инициируется внешним клиентом и поступает через интерфейс HTTP (`HttpControlChannel`).\n2. Запрос передается дальше в различные рабочие процессы (`WorkflowPersistence`, `InMemoryTaskQueue`), где он может быть обработан параллельно или последовательно.\n3. Каждый из этих компонентов сохраняет свое текущее состояние и передает его дальше через промежуточные этапы выполнения.\n4. Информация об этапах выполнения собирается в виде контекста трассировки (`trace context`), созданном при помощи `TraceService`.\n5. Эта информация затем сохраняется или передается дальше другим компонентам для дальнейшей обработки.\n\nТаким образом, каждый компонент играет свою роль в общей цепочке выполнения задачи, обеспечивая корректность состояния атрибутов и правильное отслеживание процесса выполнения запроса.\n\n---\n\nЭтот анализ демонстрирует общую картину того, как компоненты взаимодействуют друг с другом и какую роль выполняет `TraceService` в этом процессе." - }, - "diagnostics": { - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 371, - "evidence_rows": 21, - "evidence_chars": 7281 - }, - "evidence_summary": [ - { - "layer": "C1_SYMBOL_CATALOG", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "count": 8, - "unique_paths": 8 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "count": 6, - "unique_paths": 1 - }, - { - "layer": "C3_ENTRYPOINTS", - "count": 3, - "unique_paths": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 3, - "unique_paths": 1 - } - ], - "prompt_template_id": "intent_code_qa_v1", - "system_prompt_version": "v1" - }, - "timings_ms": { - "prompt_build": 0, - "llm_call": 7366 - } - } - } - ] - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_091824/full_chain_plba_code_retrieval_plba-fullchain-explain-trace-service.md b/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_091824/full_chain_plba_code_retrieval_plba-fullchain-explain-trace-service.md deleted file mode 100644 index 6587ea8..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_091824/full_chain_plba_code_retrieval_plba-fullchain-explain-trace-service.md +++ /dev/null @@ -1,34 +0,0 @@ -# plba-fullchain-explain-trace-service - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_retrieval.yaml -- runner: runtime -- mode: full_chain -- passed: True - -## Query -Как работает TraceService? - -## Actual -{ - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 21, - "llm_answer": "## Анализ архитектуры и поведения `TraceService`\n\n### Описание класса `TraceService`\n\nКласс `TraceService` определен в файле `src/app_runtime/tracing/service.py`. Этот класс является наследником абстрактного базового класса `TraceContextFactory`, что указывает на его ключевую роль в создании контекста трассировки (`trace context`) для последующих вызовов API или логики приложения.\n\n#### Обязанности класса:\n- Обладает именем с суффиксом \"service\", указывающим на его сервисную природу.\n- Оперирует состоянием атрибутов через чтение и запись их значений.\n- Участвует в передаче данных между различными этапами обработки (\"dataflow slices\").\n\n#### Поведение метода `_create_trace_context`\nМетод `_create_trace_context` создает новый контекст трассировки, который используется для отслеживания выполнения различных этапов программы. Контекст трассировки включает информацию о текущей сессии и этапах выполнения задачи.\n\n```python\ndef _create_trace_context(self):\n # Создание нового trace context, который содержит сессионные данные и метаданные текущего этапа работы.\n return self._context_factory.create()\n```\n\n### Взаимодействие с другими компонентами системы\n\n- **Pipeline stages**: Все перечисленные классы (`UvicornThreadRunner`, `WorkflowPersistence`, `HttpControlChannel`, `InMemoryTaskQueue`) также являются участниками передачи данных и участия в «слайсах» потока данных (`dataflow slices`), аналогично поведению `TraceService`.\n \n - `UvicornThreadRunner`: отвечает за запуск асинхронных HTTP запросов и обработку ответов.\n - `WorkflowPersistence`: управляет сохранением и восстановлением состояния рабочих процессов (workflow).\n - `HttpControlChannel`: обеспечивает взаимодействие с внешним интерфейсом управления задачами и данными.\n - `InMemoryTaskQueue`: представляет очередь задач, хранящуюся в памяти.\n\nЭти компоненты участвуют в общей архитектуре конвейера выполнения задач и передают состояние атрибутов друг другу во время выполнения операций.\n\n### Поток данных и обязанности классов\n\nВ системе существует несколько уровней взаимодействия компонентов, которые могут быть описаны следующим образом:\n\n1. Пользовательский запрос инициируется внешним клиентом и поступает через интерфейс HTTP (`HttpControlChannel`).\n2. Запрос передается дальше в различные рабочие процессы (`WorkflowPersistence`, `InMemoryTaskQueue`), где он может быть обработан параллельно или последовательно.\n3. Каждый из этих компонентов сохраняет свое текущее состояние и передает его дальше через промежуточные этапы выполнения.\n4. Информация об этапах выполнения собирается в виде контекста трассировки (`trace context`), созданном при помощи `TraceService`.\n5. Эта информация затем сохраняется или передается дальше другим компонентам для дальнейшей обработки.\n\nТаким образом, каждый компонент играет свою роль в общей цепочке выполнения задачи, обеспечивая корректность состояния атрибутов и правильное отслеживание процесса выполнения запроса.\n\n---\n\nЭтот анализ демонстрирует общую картину того, как компоненты взаимодействуют друг с другом и какую роль выполняет `TraceService` в этом процессе.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "TraceService" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] -} - -## Mismatches -- none \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_091824/full_chain_plba_code_retrieval_plba-fullchain-explain-workflow-engine.json b/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_091824/full_chain_plba_code_retrieval_plba-fullchain-explain-workflow-engine.json deleted file mode 100644 index aad5209..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_091824/full_chain_plba_code_retrieval_plba-fullchain-explain-workflow-engine.json +++ /dev/null @@ -1,2634 +0,0 @@ -{ - "case_id": "plba-fullchain-explain-workflow-engine", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_retrieval.yaml", - "runner": "runtime", - "mode": "full_chain", - "actual": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 20, - "llm_answer": "## Анализ архитектуры и поведения класса `WorkflowEngine`\n\n### 1. Описание файла и роли классов\n\n#### Файл: `src/app_runtime/workflow/engine/workflow_engine.py`\nВ данном файле находится определение класса **`WorkflowEngine`**, который играет ключевую роль в управлении workflow-приложением.\n\n### 2. Структура класса `WorkflowEngine`\n\n```python\nclass WorkflowEngine:\n # Конструктор класса с инициализацией атрибутов\n def __init__(self):\n self._hooks = WorkflowEngineHooks()\n self.transition_resolver = TransitionResolver()\n \n # Метод для запуска workflow\n async def run(self):\n pass\n\n # Метод для добавления новых хуков\n def add_hooks(self, hooks):\n self._hooks.add(hooks)\n```\n\n### 3. Ответственность и взаимодействие\n\n**Ответственности (`Responsibilities`) класса:**\n- Чтение и запись состояния атрибутов\n- Участие в потоках данных (dataflow slices)\n\n**Роль класса (`role`):**\n- pipeline_stage\n\n**Связанные классы и их роли:**\n- `WorkflowEngineHooks`: модель (`model`), отвечает за обработку событий или действий связанных с жизненным циклом workflow.\n- `TransitionResolver`: модель (`model`), решает переходы между стадиями workflow.\n- `UvicornThreadRunner`: pipeline_stage, используется для выполнения HTTP-запросов и взаимодействия с API.\n\n### 4. Поток данных и структура работы класса\n\nПри запуске метода `run()` происходит следующее:\n1. Инициализация внутренних объектов.\n2. Вызов методов соответствующих стадий и переходов внутри workflow.\n3. Выполнение хуков, зарегистрированных через метод `add_hooks()`.\n\n### 5. Пример использования класса\n\n```python\n# Создание экземпляра WorkflowEngine\nengine = WorkflowEngine()\n\n# Добавление пользовательских хуков\ncustom_hooks = {\n \"before_start\": lambda: print(\"Before start\"),\n \"after_end\": lambda: print(\"After end\")\n}\nengine.add_hooks(custom_hooks)\n\n# Запуск workflow\nawait engine.run()\n```\n\n### Заключение\n\nКласс `WorkflowEngine` является центральным компонентом управления workflow-приложением. Он управляет состоянием приложения, взаимодействует с внешними сервисами и обеспечивает логику перехода между стадиями workflow при помощи встроенных хуков и решений переходов. Использование данного класса позволяет легко расширять функциональность путем регистрации дополнительных хуков и модификации стандартных потоков данных.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "WorkflowEngine" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "passed": true, - "mismatches": [], - "details": { - "case_id": "plba-fullchain-explain-workflow-engine", - "text": "Объясни класс WorkflowEngine", - "mode": "full_chain", - "run_started_at": "2026-03-12T09:18:24", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Объясни класс WorkflowEngine", - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "WorkflowEngine", - "alternatives": [ - "WorkflowEngine", - "WorkflowEngineHooks" - ], - "confidence": 0.99 - }, - "rag_count": 20, - "rag_rows": [ - { - "path": "src/app_runtime/workflow/engine/workflow_engine.py", - "content": "class WorkflowEngine\nWorkflowEngine", - "layer": "C1_SYMBOL_CATALOG", - "title": "WorkflowEngine", - "span_start": 10, - "span_end": 86, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "57ec0a9f11c542c78e008684a888397e8d9ef4223671acb2567e631a0cbc70b4", - "qname": "WorkflowEngine", - "kind": "class", - "signature": "WorkflowEngine", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.workflow.engine.workflow_engine", - "is_test": false, - "blob_sha": "1057136e58a325cd5ab6f4e265d15665fb6a711b7022d9fab52a1a290afa2368", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/engine/hooks.py", - "content": "class WorkflowEngineHooks\nWorkflowEngineHooks", - "layer": "C1_SYMBOL_CATALOG", - "title": "WorkflowEngineHooks", - "span_start": 6, - "span_end": 14, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "914123ed510540061e116100fc87bba4195595ba696f8bfde2fd77ac6a5cd7e4", - "qname": "WorkflowEngineHooks", - "kind": "class", - "signature": "WorkflowEngineHooks", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.workflow.engine.hooks", - "is_test": false, - "blob_sha": "4b11672b0a9af1ae04bfce9d8e1f96572997d3e65e68108d7c797b88fa5fa47a", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/engine/workflow_engine.py", - "content": "WorkflowEngine\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (6)", - "layer": "C4_SEMANTIC_ROLES", - "title": "WorkflowEngine", - "span_start": 10, - "span_end": 86, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 25, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "57ec0a9f11c542c78e008684a888397e8d9ef4223671acb2567e631a0cbc70b4", - "symbol_name": "WorkflowEngine", - "qname": "WorkflowEngine", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 6, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "1057136e58a325cd5ab6f4e265d15665fb6a711b7022d9fab52a1a290afa2368", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/engine/hooks.py", - "content": "WorkflowEngineHooks\nrole: model\n\nResponsibilities:\n- default model role", - "layer": "C4_SEMANTIC_ROLES", - "title": "WorkflowEngineHooks", - "span_start": 6, - "span_end": 14, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 40, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "914123ed510540061e116100fc87bba4195595ba696f8bfde2fd77ac6a5cd7e4", - "symbol_name": "WorkflowEngineHooks", - "qname": "WorkflowEngineHooks", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "4b11672b0a9af1ae04bfce9d8e1f96572997d3e65e68108d7c797b88fa5fa47a", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/engine/transition_resolver.py", - "content": "TransitionResolver\nrole: model\n\nResponsibilities:\n- default model role", - "layer": "C4_SEMANTIC_ROLES", - "title": "TransitionResolver", - "span_start": 7, - "span_end": 9, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 40, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "d1979f0b23d354338debf7771373226833d57c1e7830ce66ca0b82cdf209b958", - "symbol_name": "TransitionResolver", - "qname": "TransitionResolver", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "2c518f4c77fb5dcc2970b88f55a7b121d05959578fb0d196af92ff5193574838", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_runner.py", - "content": "UvicornThreadRunner\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (24)", - "layer": "C4_SEMANTIC_ROLES", - "title": "UvicornThreadRunner", - "span_start": 10, - "span_end": 61, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 11, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "fd55630045a02100df8877ac27d951ee08617d4598764394d48cb51fe067476a", - "symbol_name": "UvicornThreadRunner", - "qname": "UvicornThreadRunner", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 24, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "3779fdd2878b770e789a35bb2a89c9d79f13b61c26d7db1b3b683f9bb9e1623f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/persistence/workflow_persistence.py", - "content": "WorkflowPersistence\nrole: pipeline_stage\n\nResponsibilities:\n- orchestrates role-like calls (2)\n- reads and writes state attributes\n- participates in dataflow slices (16)", - "layer": "C4_SEMANTIC_ROLES", - "title": "WorkflowPersistence", - "span_start": 8, - "span_end": 54, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 15, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "7bd01ee45cf31f2d5c2e3e51656254860ac785d10cef9e0852cd4fba90857bae", - "symbol_name": "WorkflowPersistence", - "qname": "WorkflowPersistence", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 16, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "80e9410ddc639789b4353c2a1a757ba8d0d5b5bb6075b0b263b61551f04ae1f0", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (10)", - "layer": "C4_SEMANTIC_ROLES", - "title": "HttpControlChannel", - "span_start": 12, - "span_end": 57, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 21, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "1c9fbdc24819e5604c26ea55428a74310f03a03e1af197ed84846af61e42fdb0", - "symbol_name": "HttpControlChannel", - "qname": "HttpControlChannel", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 10, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/queue/in_memory.py", - "content": "InMemoryTaskQueue\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (9)", - "layer": "C4_SEMANTIC_ROLES", - "title": "InMemoryTaskQueue", - "span_start": 9, - "span_end": 38, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 22, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "2da04cb94544a3bcbf0943a95ad4bdd8710bcafaa32a02fd0e4de2178dcf3533", - "symbol_name": "InMemoryTaskQueue", - "qname": "InMemoryTaskQueue", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 9, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "58f0cc001ccda0eee4c6bc32ed83bd05eafd6b6644f1e8b4aa9eed3103db73dc", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/config/file_loader.py", - "content": "ConfigFileLoader\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (8)", - "layer": "C4_SEMANTIC_ROLES", - "title": "ConfigFileLoader", - "span_start": 11, - "span_end": 48, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 23, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "a8474eca8b6e9dc86ae67ed68b16fa5fb639ef08739c053e7b7195489765667f", - "symbol_name": "ConfigFileLoader", - "qname": "ConfigFileLoader", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 8, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "1f19ffebde5e38e4be5a5d5a678059a0f36dedb8fb8b3e00ab395c67106a87ea", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/engine/workflow_engine.py", - "content": "WorkflowEngine.__init__\n -> WorkflowEngine._transition_resolver\n -> WorkflowEngine.run", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "WorkflowEngine.__init__:dataflow_slice", - "span_start": 14, - "span_end": 63, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "3abf07e5c245e0fe59785ba2d569c2ee56018715fc7f625a044ddaf6201f903d", - "edge_type": "dataflow_slice", - "src_symbol_id": "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "src_qname": "WorkflowEngine.__init__", - "dst_symbol_id": "a12cad0f5b238287e02f6d8d156cc764351d8c83246930487fa09d5ce6f2ace8", - "dst_ref": "WorkflowEngine.run", - "resolution": "resolved", - "slice_id": "3abf07e5c245e0fe59785ba2d569c2ee56018715fc7f625a044ddaf6201f903d", - "root_symbol_id": "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "path_symbols": [ - "WorkflowEngine.__init__", - "WorkflowEngine._transition_resolver", - "WorkflowEngine.run" - ], - "path_symbol_ids": [ - "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "a12cad0f5b238287e02f6d8d156cc764351d8c83246930487fa09d5ce6f2ace8" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "1057136e58a325cd5ab6f4e265d15665fb6a711b7022d9fab52a1a290afa2368", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/engine/workflow_engine.py", - "content": "WorkflowEngine.__init__\n -> WorkflowEngine._hooks\n -> WorkflowEngine.run", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "WorkflowEngine.__init__:dataflow_slice", - "span_start": 16, - "span_end": 34, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "d73db644b69c1eb35afd6eae9d6ac8674e49e30e9bcf9c020f9fdbfe754851b2", - "edge_type": "dataflow_slice", - "src_symbol_id": "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "src_qname": "WorkflowEngine.__init__", - "dst_symbol_id": "a12cad0f5b238287e02f6d8d156cc764351d8c83246930487fa09d5ce6f2ace8", - "dst_ref": "WorkflowEngine.run", - "resolution": "resolved", - "slice_id": "d73db644b69c1eb35afd6eae9d6ac8674e49e30e9bcf9c020f9fdbfe754851b2", - "root_symbol_id": "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "path_symbols": [ - "WorkflowEngine.__init__", - "WorkflowEngine._hooks", - "WorkflowEngine.run" - ], - "path_symbol_ids": [ - "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "a12cad0f5b238287e02f6d8d156cc764351d8c83246930487fa09d5ce6f2ace8" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "1057136e58a325cd5ab6f4e265d15665fb6a711b7022d9fab52a1a290afa2368", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/engine/workflow_engine.py", - "content": "WorkflowEngine.__init__\n -> WorkflowEngine._workflow\n -> WorkflowEngine.run", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "WorkflowEngine.__init__:dataflow_slice", - "span_start": 12, - "span_end": 29, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "b45ef3c54669b4910a8aed3a565804f275424a24007bc7e3c953389521f80249", - "edge_type": "dataflow_slice", - "src_symbol_id": "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "src_qname": "WorkflowEngine.__init__", - "dst_symbol_id": "a12cad0f5b238287e02f6d8d156cc764351d8c83246930487fa09d5ce6f2ace8", - "dst_ref": "WorkflowEngine.run", - "resolution": "resolved", - "slice_id": "b45ef3c54669b4910a8aed3a565804f275424a24007bc7e3c953389521f80249", - "root_symbol_id": "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "path_symbols": [ - "WorkflowEngine.__init__", - "WorkflowEngine._workflow", - "WorkflowEngine.run" - ], - "path_symbol_ids": [ - "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "a12cad0f5b238287e02f6d8d156cc764351d8c83246930487fa09d5ce6f2ace8" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "1057136e58a325cd5ab6f4e265d15665fb6a711b7022d9fab52a1a290afa2368", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/engine/workflow_engine.py", - "content": "WorkflowEngine.__init__\n -> WorkflowEngine._persistence\n -> WorkflowEngine.run", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "WorkflowEngine.__init__:dataflow_slice", - "span_start": 13, - "span_end": 20, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "8101338770016324ce05d61daa9935a444c75e6c94a0fae4275d5b50fcbcc70b", - "edge_type": "dataflow_slice", - "src_symbol_id": "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "src_qname": "WorkflowEngine.__init__", - "dst_symbol_id": "a12cad0f5b238287e02f6d8d156cc764351d8c83246930487fa09d5ce6f2ace8", - "dst_ref": "WorkflowEngine.run", - "resolution": "resolved", - "slice_id": "8101338770016324ce05d61daa9935a444c75e6c94a0fae4275d5b50fcbcc70b", - "root_symbol_id": "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "path_symbols": [ - "WorkflowEngine.__init__", - "WorkflowEngine._persistence", - "WorkflowEngine.run" - ], - "path_symbol_ids": [ - "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "a12cad0f5b238287e02f6d8d156cc764351d8c83246930487fa09d5ce6f2ace8" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "1057136e58a325cd5ab6f4e265d15665fb6a711b7022d9fab52a1a290afa2368", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/engine/workflow_engine.py", - "content": "WorkflowEngine.__init__\n -> WorkflowEngine._traces\n -> WorkflowEngine.run", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "WorkflowEngine.__init__:dataflow_slice", - "span_start": 15, - "span_end": 27, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "5006266616d534d721648391565e2ac0c9e7e9d9f8df00c17fba8989afb533a5", - "edge_type": "dataflow_slice", - "src_symbol_id": "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "src_qname": "WorkflowEngine.__init__", - "dst_symbol_id": "a12cad0f5b238287e02f6d8d156cc764351d8c83246930487fa09d5ce6f2ace8", - "dst_ref": "WorkflowEngine.run", - "resolution": "resolved", - "slice_id": "5006266616d534d721648391565e2ac0c9e7e9d9f8df00c17fba8989afb533a5", - "root_symbol_id": "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "path_symbols": [ - "WorkflowEngine.__init__", - "WorkflowEngine._traces", - "WorkflowEngine.run" - ], - "path_symbol_ids": [ - "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "a12cad0f5b238287e02f6d8d156cc764351d8c83246930487fa09d5ce6f2ace8" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "1057136e58a325cd5ab6f4e265d15665fb6a711b7022d9fab52a1a290afa2368", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/engine/workflow_engine.py", - "content": "WorkflowEngine.__init__\n -> WorkflowEngine._logger\n -> WorkflowEngine.run", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "WorkflowEngine.__init__:dataflow_slice", - "span_start": 17, - "span_end": 85, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "2f9927abb24794adb056b94bfb5d8538a5cbafb160da2079f52fca97fd694a2b", - "edge_type": "dataflow_slice", - "src_symbol_id": "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "src_qname": "WorkflowEngine.__init__", - "dst_symbol_id": "a12cad0f5b238287e02f6d8d156cc764351d8c83246930487fa09d5ce6f2ace8", - "dst_ref": "WorkflowEngine.run", - "resolution": "resolved", - "slice_id": "2f9927abb24794adb056b94bfb5d8538a5cbafb160da2079f52fca97fd694a2b", - "root_symbol_id": "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "path_symbols": [ - "WorkflowEngine.__init__", - "WorkflowEngine._logger", - "WorkflowEngine.run" - ], - "path_symbol_ids": [ - "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "a12cad0f5b238287e02f6d8d156cc764351d8c83246930487fa09d5ce6f2ace8" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "1057136e58a325cd5ab6f4e265d15665fb6a711b7022d9fab52a1a290afa2368", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/engine/workflow_engine.py", - "content": "class WorkflowEngine:\n def __init__(self, workflow, persistence, *, traces, hooks: WorkflowEngineHooks | None = None) -> None:\n self._workflow = workflow\n self._persistence = persistence\n self._transition_resolver = TransitionResolver()\n self._traces = traces\n self._hooks = hooks or WorkflowEngineHooks()\n self._logger = logging.getLogger(__name__)\n\n def run(self, context: WorkflowContext) -> dict[str, object]:\n run_id = self._persistence.start_run(\n self._workflow.definition.name,\n self._workflow.definition.start_at,\n context.snapshot(),\n )\n context.state.setdefault(\"runtime\", {})\n context.state[\"runtime\"][\"workflow_run_id\"] = run_id\n self._traces.step(\"workflow\")\n self._traces.info(\"Workflow started.\", status=\"started\", attrs={\"workflow_run_id\": run_id})\n current_name = self._workflow.definition.start_at\n while current_name is not None:\n node = self._workflow.definition.nodes[current_name]\n context.state[\"runtime\"][\"current_node\"] = current_name\n self._logger.info(\"Workflow run %s: step '%s' started.\", run_id, current_name)\n self._hooks.on_step_started(context, current_name)\n self._persistence.start_step(run_id, current_name, context.snapshot())\n self._traces.step(current_name)\n self._traces.debug(\n f\"Step '{current_name}' started.\",\n status=\"started\",\n attrs={\"workflow_run_id\": run_id, \"node\": current_name},\n )\n try:\n result = node.step.run(context)\n except Exception as error:\n self._persistence.fail_step(run_id, current_name, context.snapshot(), error)\n self._persistence.fail_run(run_id, context.snapshot())\n self._traces.error(\n f\"Step '{current_name}' failed: {error}\",\n status=\"failed\",\n attrs={\"exception_type\": type(error).__name__},\n )\n self._logger.exception(\"Workflow run %s: step '%s' failed.\", run_id, current_name)\n self._hooks.on_step_failed(context, current_name)\n raise\n context.state.update(result.updates)\n self._persistence.complete_step(\n run_id,\n current_name,\n result.status,\n result.transition,\n context.snapshot(),\n )\n next_node = self._transition_resolver.resolve(node, result)\n self._traces.debug(\n f\"Step '{current_name}' completed with transition '{result.transition}'.\",\n status=result.status,\n attrs={\n \"workflow_run_id\": run_id,\n \"from_node\": current_name,\n \"transition\": result.transition,\n \"to_node\": next_node,\n },\n )\n self._logger.info(\n \"Workflow run %s: step '%s' completed with transition '%s'.\",\n run_id,\n current_name,\n result.transition,\n )\n self._hooks.on_step_finished(context, current_name)\n current_name = next_node\n self._persistence.complete_run(run_id, context.snapshot())\n self._traces.step(\"workflow\")\n self._traces.info(\"Workflow completed.\", status=\"completed\", attrs={\"workflow_run_id\": run_id})\n self._logger.info(\"Workflow run %s completed.\", run_id)\n return {\"run_id\": run_id, \"status\": \"completed\", \"context\": context.snapshot()}", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/workflow/engine/workflow_engine.py:WorkflowEngine", - "span_start": 10, - "span_end": 86, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.workflow.engine.workflow_engine", - "is_test": false, - "blob_sha": "1057136e58a325cd5ab6f4e265d15665fb6a711b7022d9fab52a1a290afa2368", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "llm_answer": "## Анализ архитектуры и поведения класса `WorkflowEngine`\n\n### 1. Описание файла и роли классов\n\n#### Файл: `src/app_runtime/workflow/engine/workflow_engine.py`\nВ данном файле находится определение класса **`WorkflowEngine`**, который играет ключевую роль в управлении workflow-приложением.\n\n### 2. Структура класса `WorkflowEngine`\n\n```python\nclass WorkflowEngine:\n # Конструктор класса с инициализацией атрибутов\n def __init__(self):\n self._hooks = WorkflowEngineHooks()\n self.transition_resolver = TransitionResolver()\n \n # Метод для запуска workflow\n async def run(self):\n pass\n\n # Метод для добавления новых хуков\n def add_hooks(self, hooks):\n self._hooks.add(hooks)\n```\n\n### 3. Ответственность и взаимодействие\n\n**Ответственности (`Responsibilities`) класса:**\n- Чтение и запись состояния атрибутов\n- Участие в потоках данных (dataflow slices)\n\n**Роль класса (`role`):**\n- pipeline_stage\n\n**Связанные классы и их роли:**\n- `WorkflowEngineHooks`: модель (`model`), отвечает за обработку событий или действий связанных с жизненным циклом workflow.\n- `TransitionResolver`: модель (`model`), решает переходы между стадиями workflow.\n- `UvicornThreadRunner`: pipeline_stage, используется для выполнения HTTP-запросов и взаимодействия с API.\n\n### 4. Поток данных и структура работы класса\n\nПри запуске метода `run()` происходит следующее:\n1. Инициализация внутренних объектов.\n2. Вызов методов соответствующих стадий и переходов внутри workflow.\n3. Выполнение хуков, зарегистрированных через метод `add_hooks()`.\n\n### 5. Пример использования класса\n\n```python\n# Создание экземпляра WorkflowEngine\nengine = WorkflowEngine()\n\n# Добавление пользовательских хуков\ncustom_hooks = {\n \"before_start\": lambda: print(\"Before start\"),\n \"after_end\": lambda: print(\"After end\")\n}\nengine.add_hooks(custom_hooks)\n\n# Запуск workflow\nawait engine.run()\n```\n\n### Заключение\n\nКласс `WorkflowEngine` является центральным компонентом управления workflow-приложением. Он управляет состоянием приложения, взаимодействует с внешними сервисами и обеспечивает логику перехода между стадиями workflow при помощи встроенных хуков и решений переходов. Использование данного класса позволяет легко расширять функциональность путем регистрации дополнительных хуков и модификации стандартных потоков данных.", - "summary": { - "router": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "confidence": null - }, - "retrieval": { - "profile": "code", - "layers_hit": [ - "C0_SOURCE_CHUNKS", - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS", - "C4_SEMANTIC_ROLES" - ], - "evidence_sufficient": true - }, - "llm": { - "answer_status": "answered", - "groundedness": "grounded" - } - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "WorkflowEngine" - ], - "keyword_hints": [ - "WorkflowEngine" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C0_SOURCE_CHUNKS": "exact_path_fetch", - "C4_SEMANTIC_ROLES": "exact_path_fetch", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C3_ENTRYPOINTS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 8, - "C4_SEMANTIC_ROLES": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C3_ENTRYPOINTS": 6 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C4_SEMANTIC_ROLES": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "WorkflowEngine", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Объясни класс WorkflowEngine", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C4_SEMANTIC_ROLES", - "query": "Объясни класс WorkflowEngine", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "Объясни класс WorkflowEngine", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - }, - { - "layer": "C3_ENTRYPOINTS", - "query": "Объясни класс WorkflowEngine", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 2, - "candidates_after_filter": 2 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 6, - "candidates_after_filter": 6 - }, - { - "layer": "C3_ENTRYPOINTS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 3, - "candidates_after_filter": 3 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "WorkflowEngine", - "alternatives": [ - "WorkflowEngine", - "WorkflowEngineHooks" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "hit", - "hit_count": 2, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C4_SEMANTIC_ROLES", - "status": "hit", - "hit_count": 8, - "fail_reason": null - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 6, - "fail_reason": null - }, - { - "layer": "C3_ENTRYPOINTS", - "status": "hit", - "hit_count": 3, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "router": 1, - "symbol_resolution": 0, - "retrieval_total": 151, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 37, - "C0_SOURCE_CHUNKS": 22, - "C4_SEMANTIC_ROLES": 21, - "C2_DEPENDENCY_GRAPH": 53, - "C3_ENTRYPOINTS": 15 - }, - "merge_rank": 35, - "prompt_build": 0, - "llm_call": 5185 - }, - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 307, - "evidence_rows": 20, - "evidence_chars": 5261 - }, - "evidence_summary": [ - { - "layer": "C1_SYMBOL_CATALOG", - "count": 2, - "unique_paths": 2 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "count": 8, - "unique_paths": 8 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "count": 6, - "unique_paths": 1 - }, - { - "layer": "C3_ENTRYPOINTS", - "count": 3, - "unique_paths": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 1, - "unique_paths": 1 - } - ], - "prompt_template_id": "intent_code_qa_v1", - "system_prompt_version": "v1" - }, - "router": { - "conversation_mode": "START", - "keyword_hints": [ - "WorkflowEngine" - ], - "path_scope": [] - }, - "llm": { - "used_evidence_count": 20, - "missing_evidence_reason": null - } - }, - "run_info": { - "case_id": "plba-fullchain-explain-workflow-engine", - "mode": "full_chain", - "run_started_at": "2026-03-12T09:18:24", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - }, - "input_request": { - "text": "Объясни класс WorkflowEngine", - "normalized_query": "Объясни класс WorkflowEngine" - }, - "steps": [ - { - "step": "intent_router", - "input": { - "query": "Объясни класс WorkflowEngine" - }, - "output": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Объясни класс WorkflowEngine" - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "WorkflowEngine" - ], - "keyword_hints": [ - "WorkflowEngine" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "timings_ms": { - "router": 1 - } - } - }, - { - "step": "retrieval", - "input": { - "query": "Объясни класс WorkflowEngine" - }, - "output": { - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "WorkflowEngine", - "alternatives": [ - "WorkflowEngine", - "WorkflowEngineHooks" - ], - "confidence": 0.99 - }, - "rag_count": 20, - "rag_rows": [ - { - "path": "src/app_runtime/workflow/engine/workflow_engine.py", - "content": "class WorkflowEngine\nWorkflowEngine", - "layer": "C1_SYMBOL_CATALOG", - "title": "WorkflowEngine", - "span_start": 10, - "span_end": 86, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "57ec0a9f11c542c78e008684a888397e8d9ef4223671acb2567e631a0cbc70b4", - "qname": "WorkflowEngine", - "kind": "class", - "signature": "WorkflowEngine", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.workflow.engine.workflow_engine", - "is_test": false, - "blob_sha": "1057136e58a325cd5ab6f4e265d15665fb6a711b7022d9fab52a1a290afa2368", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/engine/hooks.py", - "content": "class WorkflowEngineHooks\nWorkflowEngineHooks", - "layer": "C1_SYMBOL_CATALOG", - "title": "WorkflowEngineHooks", - "span_start": 6, - "span_end": 14, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "914123ed510540061e116100fc87bba4195595ba696f8bfde2fd77ac6a5cd7e4", - "qname": "WorkflowEngineHooks", - "kind": "class", - "signature": "WorkflowEngineHooks", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.workflow.engine.hooks", - "is_test": false, - "blob_sha": "4b11672b0a9af1ae04bfce9d8e1f96572997d3e65e68108d7c797b88fa5fa47a", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/engine/workflow_engine.py", - "content": "WorkflowEngine\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (6)", - "layer": "C4_SEMANTIC_ROLES", - "title": "WorkflowEngine", - "span_start": 10, - "span_end": 86, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 25, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "57ec0a9f11c542c78e008684a888397e8d9ef4223671acb2567e631a0cbc70b4", - "symbol_name": "WorkflowEngine", - "qname": "WorkflowEngine", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 6, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "1057136e58a325cd5ab6f4e265d15665fb6a711b7022d9fab52a1a290afa2368", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/engine/hooks.py", - "content": "WorkflowEngineHooks\nrole: model\n\nResponsibilities:\n- default model role", - "layer": "C4_SEMANTIC_ROLES", - "title": "WorkflowEngineHooks", - "span_start": 6, - "span_end": 14, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 40, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "914123ed510540061e116100fc87bba4195595ba696f8bfde2fd77ac6a5cd7e4", - "symbol_name": "WorkflowEngineHooks", - "qname": "WorkflowEngineHooks", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "4b11672b0a9af1ae04bfce9d8e1f96572997d3e65e68108d7c797b88fa5fa47a", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/engine/transition_resolver.py", - "content": "TransitionResolver\nrole: model\n\nResponsibilities:\n- default model role", - "layer": "C4_SEMANTIC_ROLES", - "title": "TransitionResolver", - "span_start": 7, - "span_end": 9, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 40, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "d1979f0b23d354338debf7771373226833d57c1e7830ce66ca0b82cdf209b958", - "symbol_name": "TransitionResolver", - "qname": "TransitionResolver", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "2c518f4c77fb5dcc2970b88f55a7b121d05959578fb0d196af92ff5193574838", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_runner.py", - "content": "UvicornThreadRunner\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (24)", - "layer": "C4_SEMANTIC_ROLES", - "title": "UvicornThreadRunner", - "span_start": 10, - "span_end": 61, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 11, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "fd55630045a02100df8877ac27d951ee08617d4598764394d48cb51fe067476a", - "symbol_name": "UvicornThreadRunner", - "qname": "UvicornThreadRunner", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 24, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "3779fdd2878b770e789a35bb2a89c9d79f13b61c26d7db1b3b683f9bb9e1623f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/persistence/workflow_persistence.py", - "content": "WorkflowPersistence\nrole: pipeline_stage\n\nResponsibilities:\n- orchestrates role-like calls (2)\n- reads and writes state attributes\n- participates in dataflow slices (16)", - "layer": "C4_SEMANTIC_ROLES", - "title": "WorkflowPersistence", - "span_start": 8, - "span_end": 54, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 15, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "7bd01ee45cf31f2d5c2e3e51656254860ac785d10cef9e0852cd4fba90857bae", - "symbol_name": "WorkflowPersistence", - "qname": "WorkflowPersistence", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 16, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "80e9410ddc639789b4353c2a1a757ba8d0d5b5bb6075b0b263b61551f04ae1f0", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (10)", - "layer": "C4_SEMANTIC_ROLES", - "title": "HttpControlChannel", - "span_start": 12, - "span_end": 57, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 21, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "1c9fbdc24819e5604c26ea55428a74310f03a03e1af197ed84846af61e42fdb0", - "symbol_name": "HttpControlChannel", - "qname": "HttpControlChannel", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 10, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/queue/in_memory.py", - "content": "InMemoryTaskQueue\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (9)", - "layer": "C4_SEMANTIC_ROLES", - "title": "InMemoryTaskQueue", - "span_start": 9, - "span_end": 38, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 22, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "2da04cb94544a3bcbf0943a95ad4bdd8710bcafaa32a02fd0e4de2178dcf3533", - "symbol_name": "InMemoryTaskQueue", - "qname": "InMemoryTaskQueue", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 9, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "58f0cc001ccda0eee4c6bc32ed83bd05eafd6b6644f1e8b4aa9eed3103db73dc", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/config/file_loader.py", - "content": "ConfigFileLoader\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (8)", - "layer": "C4_SEMANTIC_ROLES", - "title": "ConfigFileLoader", - "span_start": 11, - "span_end": 48, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 23, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "a8474eca8b6e9dc86ae67ed68b16fa5fb639ef08739c053e7b7195489765667f", - "symbol_name": "ConfigFileLoader", - "qname": "ConfigFileLoader", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 8, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "1f19ffebde5e38e4be5a5d5a678059a0f36dedb8fb8b3e00ab395c67106a87ea", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/engine/workflow_engine.py", - "content": "WorkflowEngine.__init__\n -> WorkflowEngine._transition_resolver\n -> WorkflowEngine.run", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "WorkflowEngine.__init__:dataflow_slice", - "span_start": 14, - "span_end": 63, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "3abf07e5c245e0fe59785ba2d569c2ee56018715fc7f625a044ddaf6201f903d", - "edge_type": "dataflow_slice", - "src_symbol_id": "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "src_qname": "WorkflowEngine.__init__", - "dst_symbol_id": "a12cad0f5b238287e02f6d8d156cc764351d8c83246930487fa09d5ce6f2ace8", - "dst_ref": "WorkflowEngine.run", - "resolution": "resolved", - "slice_id": "3abf07e5c245e0fe59785ba2d569c2ee56018715fc7f625a044ddaf6201f903d", - "root_symbol_id": "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "path_symbols": [ - "WorkflowEngine.__init__", - "WorkflowEngine._transition_resolver", - "WorkflowEngine.run" - ], - "path_symbol_ids": [ - "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "a12cad0f5b238287e02f6d8d156cc764351d8c83246930487fa09d5ce6f2ace8" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "1057136e58a325cd5ab6f4e265d15665fb6a711b7022d9fab52a1a290afa2368", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/engine/workflow_engine.py", - "content": "WorkflowEngine.__init__\n -> WorkflowEngine._hooks\n -> WorkflowEngine.run", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "WorkflowEngine.__init__:dataflow_slice", - "span_start": 16, - "span_end": 34, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "d73db644b69c1eb35afd6eae9d6ac8674e49e30e9bcf9c020f9fdbfe754851b2", - "edge_type": "dataflow_slice", - "src_symbol_id": "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "src_qname": "WorkflowEngine.__init__", - "dst_symbol_id": "a12cad0f5b238287e02f6d8d156cc764351d8c83246930487fa09d5ce6f2ace8", - "dst_ref": "WorkflowEngine.run", - "resolution": "resolved", - "slice_id": "d73db644b69c1eb35afd6eae9d6ac8674e49e30e9bcf9c020f9fdbfe754851b2", - "root_symbol_id": "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "path_symbols": [ - "WorkflowEngine.__init__", - "WorkflowEngine._hooks", - "WorkflowEngine.run" - ], - "path_symbol_ids": [ - "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "a12cad0f5b238287e02f6d8d156cc764351d8c83246930487fa09d5ce6f2ace8" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "1057136e58a325cd5ab6f4e265d15665fb6a711b7022d9fab52a1a290afa2368", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/engine/workflow_engine.py", - "content": "WorkflowEngine.__init__\n -> WorkflowEngine._workflow\n -> WorkflowEngine.run", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "WorkflowEngine.__init__:dataflow_slice", - "span_start": 12, - "span_end": 29, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "b45ef3c54669b4910a8aed3a565804f275424a24007bc7e3c953389521f80249", - "edge_type": "dataflow_slice", - "src_symbol_id": "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "src_qname": "WorkflowEngine.__init__", - "dst_symbol_id": "a12cad0f5b238287e02f6d8d156cc764351d8c83246930487fa09d5ce6f2ace8", - "dst_ref": "WorkflowEngine.run", - "resolution": "resolved", - "slice_id": "b45ef3c54669b4910a8aed3a565804f275424a24007bc7e3c953389521f80249", - "root_symbol_id": "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "path_symbols": [ - "WorkflowEngine.__init__", - "WorkflowEngine._workflow", - "WorkflowEngine.run" - ], - "path_symbol_ids": [ - "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "a12cad0f5b238287e02f6d8d156cc764351d8c83246930487fa09d5ce6f2ace8" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "1057136e58a325cd5ab6f4e265d15665fb6a711b7022d9fab52a1a290afa2368", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/engine/workflow_engine.py", - "content": "WorkflowEngine.__init__\n -> WorkflowEngine._persistence\n -> WorkflowEngine.run", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "WorkflowEngine.__init__:dataflow_slice", - "span_start": 13, - "span_end": 20, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "8101338770016324ce05d61daa9935a444c75e6c94a0fae4275d5b50fcbcc70b", - "edge_type": "dataflow_slice", - "src_symbol_id": "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "src_qname": "WorkflowEngine.__init__", - "dst_symbol_id": "a12cad0f5b238287e02f6d8d156cc764351d8c83246930487fa09d5ce6f2ace8", - "dst_ref": "WorkflowEngine.run", - "resolution": "resolved", - "slice_id": "8101338770016324ce05d61daa9935a444c75e6c94a0fae4275d5b50fcbcc70b", - "root_symbol_id": "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "path_symbols": [ - "WorkflowEngine.__init__", - "WorkflowEngine._persistence", - "WorkflowEngine.run" - ], - "path_symbol_ids": [ - "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "a12cad0f5b238287e02f6d8d156cc764351d8c83246930487fa09d5ce6f2ace8" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "1057136e58a325cd5ab6f4e265d15665fb6a711b7022d9fab52a1a290afa2368", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/engine/workflow_engine.py", - "content": "WorkflowEngine.__init__\n -> WorkflowEngine._traces\n -> WorkflowEngine.run", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "WorkflowEngine.__init__:dataflow_slice", - "span_start": 15, - "span_end": 27, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "5006266616d534d721648391565e2ac0c9e7e9d9f8df00c17fba8989afb533a5", - "edge_type": "dataflow_slice", - "src_symbol_id": "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "src_qname": "WorkflowEngine.__init__", - "dst_symbol_id": "a12cad0f5b238287e02f6d8d156cc764351d8c83246930487fa09d5ce6f2ace8", - "dst_ref": "WorkflowEngine.run", - "resolution": "resolved", - "slice_id": "5006266616d534d721648391565e2ac0c9e7e9d9f8df00c17fba8989afb533a5", - "root_symbol_id": "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "path_symbols": [ - "WorkflowEngine.__init__", - "WorkflowEngine._traces", - "WorkflowEngine.run" - ], - "path_symbol_ids": [ - "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "a12cad0f5b238287e02f6d8d156cc764351d8c83246930487fa09d5ce6f2ace8" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "1057136e58a325cd5ab6f4e265d15665fb6a711b7022d9fab52a1a290afa2368", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/engine/workflow_engine.py", - "content": "WorkflowEngine.__init__\n -> WorkflowEngine._logger\n -> WorkflowEngine.run", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "WorkflowEngine.__init__:dataflow_slice", - "span_start": 17, - "span_end": 85, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "2f9927abb24794adb056b94bfb5d8538a5cbafb160da2079f52fca97fd694a2b", - "edge_type": "dataflow_slice", - "src_symbol_id": "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "src_qname": "WorkflowEngine.__init__", - "dst_symbol_id": "a12cad0f5b238287e02f6d8d156cc764351d8c83246930487fa09d5ce6f2ace8", - "dst_ref": "WorkflowEngine.run", - "resolution": "resolved", - "slice_id": "2f9927abb24794adb056b94bfb5d8538a5cbafb160da2079f52fca97fd694a2b", - "root_symbol_id": "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "path_symbols": [ - "WorkflowEngine.__init__", - "WorkflowEngine._logger", - "WorkflowEngine.run" - ], - "path_symbol_ids": [ - "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "a12cad0f5b238287e02f6d8d156cc764351d8c83246930487fa09d5ce6f2ace8" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "1057136e58a325cd5ab6f4e265d15665fb6a711b7022d9fab52a1a290afa2368", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/engine/workflow_engine.py", - "content": "class WorkflowEngine:\n def __init__(self, workflow, persistence, *, traces, hooks: WorkflowEngineHooks | None = None) -> None:\n self._workflow = workflow\n self._persistence = persistence\n self._transition_resolver = TransitionResolver()\n self._traces = traces\n self._hooks = hooks or WorkflowEngineHooks()\n self._logger = logging.getLogger(__name__)\n\n def run(self, context: WorkflowContext) -> dict[str, object]:\n run_id = self._persistence.start_run(\n self._workflow.definition.name,\n self._workflow.definition.start_at,\n context.snapshot(),\n )\n context.state.setdefault(\"runtime\", {})\n context.state[\"runtime\"][\"workflow_run_id\"] = run_id\n self._traces.step(\"workflow\")\n self._traces.info(\"Workflow started.\", status=\"started\", attrs={\"workflow_run_id\": run_id})\n current_name = self._workflow.definition.start_at\n while current_name is not None:\n node = self._workflow.definition.nodes[current_name]\n context.state[\"runtime\"][\"current_node\"] = current_name\n self._logger.info(\"Workflow run %s: step '%s' started.\", run_id, current_name)\n self._hooks.on_step_started(context, current_name)\n self._persistence.start_step(run_id, current_name, context.snapshot())\n self._traces.step(current_name)\n self._traces.debug(\n f\"Step '{current_name}' started.\",\n status=\"started\",\n attrs={\"workflow_run_id\": run_id, \"node\": current_name},\n )\n try:\n result = node.step.run(context)\n except Exception as error:\n self._persistence.fail_step(run_id, current_name, context.snapshot(), error)\n self._persistence.fail_run(run_id, context.snapshot())\n self._traces.error(\n f\"Step '{current_name}' failed: {error}\",\n status=\"failed\",\n attrs={\"exception_type\": type(error).__name__},\n )\n self._logger.exception(\"Workflow run %s: step '%s' failed.\", run_id, current_name)\n self._hooks.on_step_failed(context, current_name)\n raise\n context.state.update(result.updates)\n self._persistence.complete_step(\n run_id,\n current_name,\n result.status,\n result.transition,\n context.snapshot(),\n )\n next_node = self._transition_resolver.resolve(node, result)\n self._traces.debug(\n f\"Step '{current_name}' completed with transition '{result.transition}'.\",\n status=result.status,\n attrs={\n \"workflow_run_id\": run_id,\n \"from_node\": current_name,\n \"transition\": result.transition,\n \"to_node\": next_node,\n },\n )\n self._logger.info(\n \"Workflow run %s: step '%s' completed with transition '%s'.\",\n run_id,\n current_name,\n result.transition,\n )\n self._hooks.on_step_finished(context, current_name)\n current_name = next_node\n self._persistence.complete_run(run_id, context.snapshot())\n self._traces.step(\"workflow\")\n self._traces.info(\"Workflow completed.\", status=\"completed\", attrs={\"workflow_run_id\": run_id})\n self._logger.info(\"Workflow run %s completed.\", run_id)\n return {\"run_id\": run_id, \"status\": \"completed\", \"context\": context.snapshot()}", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/workflow/engine/workflow_engine.py:WorkflowEngine", - "span_start": 10, - "span_end": 86, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.workflow.engine.workflow_engine", - "is_test": false, - "blob_sha": "1057136e58a325cd5ab6f4e265d15665fb6a711b7022d9fab52a1a290afa2368", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ] - }, - "diagnostics": { - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C0_SOURCE_CHUNKS": "exact_path_fetch", - "C4_SEMANTIC_ROLES": "exact_path_fetch", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C3_ENTRYPOINTS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 8, - "C4_SEMANTIC_ROLES": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C3_ENTRYPOINTS": 6 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C4_SEMANTIC_ROLES": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "WorkflowEngine", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Объясни класс WorkflowEngine", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C4_SEMANTIC_ROLES", - "query": "Объясни класс WorkflowEngine", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "Объясни класс WorkflowEngine", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - }, - { - "layer": "C3_ENTRYPOINTS", - "query": "Объясни класс WorkflowEngine", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 2, - "candidates_after_filter": 2 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 6, - "candidates_after_filter": 6 - }, - { - "layer": "C3_ENTRYPOINTS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 3, - "candidates_after_filter": 3 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "WorkflowEngine", - "alternatives": [ - "WorkflowEngine", - "WorkflowEngineHooks" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "hit", - "hit_count": 2, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C4_SEMANTIC_ROLES", - "status": "hit", - "hit_count": 8, - "fail_reason": null - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 6, - "fail_reason": null - }, - { - "layer": "C3_ENTRYPOINTS", - "status": "hit", - "hit_count": 3, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "symbol_resolution": 0, - "retrieval_total": 151, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 37, - "C0_SOURCE_CHUNKS": 22, - "C4_SEMANTIC_ROLES": 21, - "C2_DEPENDENCY_GRAPH": 53, - "C3_ENTRYPOINTS": 15 - }, - "merge_rank": 35 - } - } - }, - { - "step": "llm_answer", - "input": { - "query": "Объясни класс WorkflowEngine", - "rag_count": 20 - }, - "output": { - "llm_answer": "## Анализ архитектуры и поведения класса `WorkflowEngine`\n\n### 1. Описание файла и роли классов\n\n#### Файл: `src/app_runtime/workflow/engine/workflow_engine.py`\nВ данном файле находится определение класса **`WorkflowEngine`**, который играет ключевую роль в управлении workflow-приложением.\n\n### 2. Структура класса `WorkflowEngine`\n\n```python\nclass WorkflowEngine:\n # Конструктор класса с инициализацией атрибутов\n def __init__(self):\n self._hooks = WorkflowEngineHooks()\n self.transition_resolver = TransitionResolver()\n \n # Метод для запуска workflow\n async def run(self):\n pass\n\n # Метод для добавления новых хуков\n def add_hooks(self, hooks):\n self._hooks.add(hooks)\n```\n\n### 3. Ответственность и взаимодействие\n\n**Ответственности (`Responsibilities`) класса:**\n- Чтение и запись состояния атрибутов\n- Участие в потоках данных (dataflow slices)\n\n**Роль класса (`role`):**\n- pipeline_stage\n\n**Связанные классы и их роли:**\n- `WorkflowEngineHooks`: модель (`model`), отвечает за обработку событий или действий связанных с жизненным циклом workflow.\n- `TransitionResolver`: модель (`model`), решает переходы между стадиями workflow.\n- `UvicornThreadRunner`: pipeline_stage, используется для выполнения HTTP-запросов и взаимодействия с API.\n\n### 4. Поток данных и структура работы класса\n\nПри запуске метода `run()` происходит следующее:\n1. Инициализация внутренних объектов.\n2. Вызов методов соответствующих стадий и переходов внутри workflow.\n3. Выполнение хуков, зарегистрированных через метод `add_hooks()`.\n\n### 5. Пример использования класса\n\n```python\n# Создание экземпляра WorkflowEngine\nengine = WorkflowEngine()\n\n# Добавление пользовательских хуков\ncustom_hooks = {\n \"before_start\": lambda: print(\"Before start\"),\n \"after_end\": lambda: print(\"After end\")\n}\nengine.add_hooks(custom_hooks)\n\n# Запуск workflow\nawait engine.run()\n```\n\n### Заключение\n\nКласс `WorkflowEngine` является центральным компонентом управления workflow-приложением. Он управляет состоянием приложения, взаимодействует с внешними сервисами и обеспечивает логику перехода между стадиями workflow при помощи встроенных хуков и решений переходов. Использование данного класса позволяет легко расширять функциональность путем регистрации дополнительных хуков и модификации стандартных потоков данных." - }, - "diagnostics": { - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 307, - "evidence_rows": 20, - "evidence_chars": 5261 - }, - "evidence_summary": [ - { - "layer": "C1_SYMBOL_CATALOG", - "count": 2, - "unique_paths": 2 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "count": 8, - "unique_paths": 8 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "count": 6, - "unique_paths": 1 - }, - { - "layer": "C3_ENTRYPOINTS", - "count": 3, - "unique_paths": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 1, - "unique_paths": 1 - } - ], - "prompt_template_id": "intent_code_qa_v1", - "system_prompt_version": "v1" - }, - "timings_ms": { - "prompt_build": 0, - "llm_call": 5185 - } - } - } - ] - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_091824/full_chain_plba_code_retrieval_plba-fullchain-explain-workflow-engine.md b/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_091824/full_chain_plba_code_retrieval_plba-fullchain-explain-workflow-engine.md deleted file mode 100644 index 86d0354..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_091824/full_chain_plba_code_retrieval_plba-fullchain-explain-workflow-engine.md +++ /dev/null @@ -1,34 +0,0 @@ -# plba-fullchain-explain-workflow-engine - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_retrieval.yaml -- runner: runtime -- mode: full_chain -- passed: True - -## Query -Объясни класс WorkflowEngine - -## Actual -{ - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 20, - "llm_answer": "## Анализ архитектуры и поведения класса `WorkflowEngine`\n\n### 1. Описание файла и роли классов\n\n#### Файл: `src/app_runtime/workflow/engine/workflow_engine.py`\nВ данном файле находится определение класса **`WorkflowEngine`**, который играет ключевую роль в управлении workflow-приложением.\n\n### 2. Структура класса `WorkflowEngine`\n\n```python\nclass WorkflowEngine:\n # Конструктор класса с инициализацией атрибутов\n def __init__(self):\n self._hooks = WorkflowEngineHooks()\n self.transition_resolver = TransitionResolver()\n \n # Метод для запуска workflow\n async def run(self):\n pass\n\n # Метод для добавления новых хуков\n def add_hooks(self, hooks):\n self._hooks.add(hooks)\n```\n\n### 3. Ответственность и взаимодействие\n\n**Ответственности (`Responsibilities`) класса:**\n- Чтение и запись состояния атрибутов\n- Участие в потоках данных (dataflow slices)\n\n**Роль класса (`role`):**\n- pipeline_stage\n\n**Связанные классы и их роли:**\n- `WorkflowEngineHooks`: модель (`model`), отвечает за обработку событий или действий связанных с жизненным циклом workflow.\n- `TransitionResolver`: модель (`model`), решает переходы между стадиями workflow.\n- `UvicornThreadRunner`: pipeline_stage, используется для выполнения HTTP-запросов и взаимодействия с API.\n\n### 4. Поток данных и структура работы класса\n\nПри запуске метода `run()` происходит следующее:\n1. Инициализация внутренних объектов.\n2. Вызов методов соответствующих стадий и переходов внутри workflow.\n3. Выполнение хуков, зарегистрированных через метод `add_hooks()`.\n\n### 5. Пример использования класса\n\n```python\n# Создание экземпляра WorkflowEngine\nengine = WorkflowEngine()\n\n# Добавление пользовательских хуков\ncustom_hooks = {\n \"before_start\": lambda: print(\"Before start\"),\n \"after_end\": lambda: print(\"After end\")\n}\nengine.add_hooks(custom_hooks)\n\n# Запуск workflow\nawait engine.run()\n```\n\n### Заключение\n\nКласс `WorkflowEngine` является центральным компонентом управления workflow-приложением. Он управляет состоянием приложения, взаимодействует с внешними сервисами и обеспечивает логику перехода между стадиями workflow при помощи встроенных хуков и решений переходов. Использование данного класса позволяет легко расширять функциональность путем регистрации дополнительных хуков и модификации стандартных потоков данных.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "WorkflowEngine" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] -} - -## Mismatches -- none \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_091824/summary.md b/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_091824/summary.md deleted file mode 100644 index 992b1c9..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_091824/summary.md +++ /dev/null @@ -1,24 +0,0 @@ -# pipeline_setup_v2 summary - -Passed: 6/6 - - -| File | Case | Runner | Mode | Intent | Sub-intent | Pass | -| ----------------------------------- | -------------------------------------------- | ------- | ---------- | ------- | ---------- | ---- | -| full_chain_plba_code_retrieval.yaml | plba-fullchain-explain-runtime-manager | runtime | full_chain | CODE_QA | EXPLAIN | ✓ | -| full_chain_plba_code_retrieval.yaml | plba-fullchain-explain-http-control-channel | runtime | full_chain | CODE_QA | EXPLAIN | ✓ | -| full_chain_plba_code_retrieval.yaml | plba-fullchain-explain-control-plane-service | runtime | full_chain | CODE_QA | EXPLAIN | ✓ | -| full_chain_plba_code_retrieval.yaml | plba-fullchain-explain-trace-service | runtime | full_chain | CODE_QA | EXPLAIN | ✓ | -| full_chain_plba_code_retrieval.yaml | plba-fullchain-explain-create-runtime | runtime | full_chain | CODE_QA | EXPLAIN | ✓ | -| full_chain_plba_code_retrieval.yaml | plba-fullchain-explain-workflow-engine | runtime | full_chain | CODE_QA | EXPLAIN | ✓ | - - -## LLM Answers - -- **plba-fullchain-explain-runtime-manager**: ## Анализ класса `RuntimeManager` ### 1. Общая информация о классе Класс `RuntimeManager` находится в файле `src/app_runtime/core/runtime.py`. Его роль обозначена как **pipeline_stage**, что указывает на его участие в потоке выполнения программы. ### 2. Ответственность (`Responsibilities`) Документация описывает следующие обязанности класса: - **manager**: предполагает управление другими сущностями или ресурсами; - **orchestrates role-like calls (4)**: означает координацию вызовов различных ролей или этапов; - **reads and writes state attributes**: указывает на возможность чтения и записи атрибутов состояния системы; - **participates in dataflow slices (50)**: свидетельствует об участии в разделении потоков данных. Эти обязанности отражают высокоуровневую роль управления состоянием и потоком выполнения приложения. ### 3. Поток данных и взаимодействие с другими компон… -- **plba-fullchain-explain-http-control-channel**: ## Анализ класса `HttpControlChannel` ### Файл и путь: - **Файл:** `src/app_runtime/control/http_channel.py` - **Класс:** `HttpControlChannel` ### Описание роли и ответственности: - **Роль:** `pipeline_stage` - **Ответственности:** - Чтение и запись атрибутов состояния (`reads and writes state attributes`). - Участие в "слайсах" данных потока (`participates in dataflow slices`). - В документации указано участие в 10 слайсах данных. ### Родительский класс: - Наследуется от класса `ControlChannel`, объявленного в файле `src/app_runtime/control/base.py`. ### Подразумеваемая архитектура и поток данных: 1. **Родительская сущность** (`ControlChannel`) является базовой моделью для каналов управления, определяющей основные обязанности модели. - Пример: Класс может иметь стандартный набор методов или атрибутов, которые наследуются всеми дочерними сущностями. 2. **Дочерний кла… -- **plba-fullchain-explain-control-plane-service**: ## Анализ класса `ControlPlaneService` ### Обзор контекста В рамках данного контекста обсуждаются несколько сущностей и их роли в системе обработки запросов и управления состоянием: - `**ControlPlaneService`**: Основной объект, рассматриваемый в вопросе. - `**ControlChannel**`: Базовый интерфейс для моделей или каналов взаимодействия. - `**ControlActionSet**`: Набор действий, выполняемых моделью. - `**UvicornThreadRunner**`: Класс, отвечающий за запуск HTTP-сервера с использованием библиотеки uvicorn в отдельном потоке. - `**HttpControlChannel**`: Канал контроля на основе HTTP, который также участвует в обработке состояния и данных потока. Все перечисленные классы являются частью модуля `src/app_runtime/control`, что указывает на их связь с управлением данными и обработкой состояний в приложении. ### Описание поведения и архитектуры **Класс `ControlPlaneService`:** Э… -- **plba-fullchain-explain-trace-service**: ## Анализ архитектуры и поведения `TraceService` ### Описание класса `TraceService` Класс `TraceService` определен в файле `src/app_runtime/tracing/service.py`. Этот класс является наследником абстрактного базового класса `TraceContextFactory`, что указывает на его ключевую роль в создании контекста трассировки (`trace context`) для последующих вызовов API или логики приложения. #### Обязанности класса: - Обладает именем с суффиксом "service", указывающим на его сервисную природу. - Оперирует состоянием атрибутов через чтение и запись их значений. - Участвует в передаче данных между различными этапами обработки ("dataflow slices"). #### Поведение метода `_create_trace_context` Метод `_create_trace_context` создает новый контекст трассировки, который используется для отслеживания выполнения различных этапов программы. Контекст трассировки включает информацию о текущей… -- **plba-fullchain-explain-create-runtime**: ## Анализ функции `create_runtime` и архитектуры приложения ### Описание задачи Функция `create_runtime` отвечает за инициализацию и настройку runtime окружения для приложения. Она является ключевым компонентом начальной загрузки системы и участвует в формировании конфигурации и окружения для дальнейшей работы. ### Поток данных и архитектура Архитектура приложения организована вокруг нескольких компонентов, которые взаимодействуют между собой через определенные роли (`pipeline_stage`) и участвуют в различных фазах жизненного цикла приложения: 1. **ConfigFileLoader** - Роль: pipeline_stage - Ответственность: чтение и запись состояния атрибутов; участие в данных потока (dataflow slice 8) Этот компонент загружает конфигурацию из файла, что позволяет системе настраиваться на основе внешних параметров. 2. **WorkflowPersistence** - Роль: pipeline_stage - Ответственность: о… -- **plba-fullchain-explain-workflow-engine**: ## Анализ архитектуры и поведения класса `WorkflowEngine` ### 1. Описание файла и роли классов #### Файл: `src/app_runtime/workflow/engine/workflow_engine.py` В данном файле находится определение класса `**WorkflowEngine`**, который играет ключевую роль в управлении workflow-приложением. ### 2. Структура класса `WorkflowEngine` `python class WorkflowEngine: # Конструктор класса с инициализацией атрибутов def __init__(self): self._hooks = WorkflowEngineHooks() self.transition_resolver = TransitionResolver() # Метод для запуска workflow async def run(self): pass # Метод для добавления новых хуков def add_hooks(self, hooks): self._hooks.add(hooks)` ### 3. Ответственность и взаимодействие **Ответственности (`Responsibilities`) класса:** - Чтение и запись состояния атрибутов - Участие в потоках данных (dataflow slices) **Роль класса (`role`):** - pipeline_stage **Свя… - diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_112158/full_chain_plba_code_retrieval_plba-fullchain-explain-control-plane-service.json b/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_112158/full_chain_plba_code_retrieval_plba-fullchain-explain-control-plane-service.json deleted file mode 100644 index eaf333b..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_112158/full_chain_plba_code_retrieval_plba-fullchain-explain-control-plane-service.json +++ /dev/null @@ -1,2056 +0,0 @@ -{ - "case_id": "plba-fullchain-explain-control-plane-service", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_retrieval.yaml", - "runner": "runtime", - "mode": "full_chain", - "actual": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 12, - "llm_answer": "## Назначение\n\n`ControlPlaneService` — это сущность, отвечающая за управление каналами (`ControlChannel`) и координацию действий по запуску и остановке различных компонентов системы. Этот сервис играет роль `pipeline_stage`, что указывает на его участие в конвейере обработки данных или управлении состоянием приложения.\n\n## Ключевые зависимости\n\n### Файлы и сущности\n- **src/app_runtime/control/service.py**: местоположение определения класса `ControlPlaneService`.\n- Используется библиотека **asyncio** для асинхронного выполнения задач.\n\n### Внешние зависимости\n- `RuntimeManager`: менеджер управления рабочим окружением и состоянием приложения.\n- `ControlChannel`: каналы взаимодействия с внешними компонентами или службами.\n- `ControlActionSet`: набор действий, которые могут быть выполнены при старте или останове сервиса.\n\n## Поток данных или вызовов\n\n1. **Инициализация и регистрация каналов**\n - Конструктор `__init__` инициализирует пустой список `_channels` и создаёт пустую коллекцию каналов.\n - Метод `register_channel` добавляет новый канал в список.\n \n2. **Запуск сервиса**\n - Метод `start` проверяет наличие зарегистрированных каналов и вызывает асинхронную функцию `_start_async`.\n - Внутри `_start_async` выполняется выполнение действий через объект `ControlActionSet`. Эти действия включают старт и останов рабочих процессов, проверку текущего состояния здоровья (`health_status`), а также запуск самого рабочего окружения (`start_runtime`).\n\n3. **Остановка сервиса**\n - Метод `stop` аналогично проверяет наличие каналов и вызывает асинхронную функцию `_stop_async`, которая выполняет очистку ресурсов и завершение работы всех каналов.\n\n4. **Создание снимка состояния**\n - Метод `snapshot` собирает информацию о текущем состоянии приложения, включая рабочие процессы, модули, сервисы, состояние работников, текущее здоровье и конфигурационные параметры.\n\n## Важные детали реализации\n\n1. **Асинхронность операций**\n - Использование функций `asyncio.run()` внутри методов `_start_async` и `_stop_async` позволяет выполнять задачи асинхронно, что важно для высокопроизводительных систем.\n\n2. **Состояние и конфигурация**\n - Объект `RuntimeManager` хранит текущие данные о состоянии приложения и конфигурации, что используется для создания снимков состояния и проверки текущих статусов.\n\n3. **Сообщения об ошибках**\n - Если каналы отсутствуют, метод `start` и `stop` просто возвращают без выполнения каких-либо действий.\n\n## Осторожные выводы\n\nНа основании анализа структуры зависимостей и объявлений классов можно предположить, что данный сервис является частью более крупной архитектуры и взаимодействует с другими модулями, такими как HTTP API (`app.post`) и системой регистрации модулей и сервисов (`registry.modules`). Однако прямых доказательств этого нет, поэтому данный вывод считается осторожным.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "ControlPlaneService" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "passed": true, - "mismatches": [], - "details": { - "case_id": "plba-fullchain-explain-control-plane-service", - "text": "Объясни класс ControlPlaneService", - "mode": "full_chain", - "run_started_at": "2026-03-12T11:21:59", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Объясни класс ControlPlaneService", - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "ControlPlaneService", - "alternatives": [ - "ControlPlaneService" - ], - "confidence": 0.99 - }, - "rag_count": 12, - "rag_rows": [ - { - "path": "src/app_runtime/control/service.py", - "content": "class ControlPlaneService\nControlPlaneService", - "layer": "C1_SYMBOL_CATALOG", - "title": "ControlPlaneService", - "span_start": 12, - "span_end": 52, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "b13471e5916986dccffb53fab613812842965705e6b3a89ae549d30c9e91e9aa", - "qname": "ControlPlaneService", - "kind": "class", - "signature": "ControlPlaneService", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.control.service", - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests service\n- reads and writes state attributes\n- participates in dataflow slices (5)", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlPlaneService", - "span_start": 12, - "span_end": 52, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 68, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "b13471e5916986dccffb53fab613812842965705e6b3a89ae549d30c9e91e9aa", - "symbol_name": "ControlPlaneService", - "qname": "ControlPlaneService", - "role": "pipeline_stage", - "confidence": 0.57, - "dataflow_participation": 5, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.stop", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 25, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d", - "dst_ref": "ControlPlaneService.stop", - "resolution": "resolved", - "slice_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.stop" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._stop_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 51, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a", - "dst_ref": "ControlPlaneService._stop_async", - "resolution": "resolved", - "slice_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._stop_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.register_channel", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 17, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957", - "dst_ref": "ControlPlaneService.register_channel", - "resolution": "resolved", - "slice_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.register_channel" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.start", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 20, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154", - "dst_ref": "ControlPlaneService.start", - "resolution": "resolved", - "slice_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.start" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._start_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 47, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517", - "dst_ref": "ControlPlaneService._start_async", - "resolution": "resolved", - "slice_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._start_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.register_channel reads_attr self._channels.append", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.register_channel:reads_attr", - "span_start": 17, - "span_end": 17, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "1ee5925deffdc38ba15b88bf7c89e5fcd1a78f493fe30f2deb827d714a1b18e8", - "edge_type": "reads_attr", - "src_symbol_id": "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957", - "src_qname": "ControlPlaneService.register_channel", - "dst_symbol_id": null, - "dst_ref": "self._channels.append", - "resolution": "partial", - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "class ControlPlaneService:\n def __init__(self) -> None:\n self._channels: list[ControlChannel] = []\n\n def register_channel(self, channel: ControlChannel) -> None:\n self._channels.append(channel)\n\n def start(self, runtime: RuntimeManager) -> None:\n if not self._channels:\n return\n asyncio.run(self._start_async(runtime))\n\n def stop(self) -> None:\n if not self._channels:\n return\n asyncio.run(self._stop_async())\n\n def snapshot(self, runtime: RuntimeManager) -> dict[str, object]:\n health = runtime.current_health()\n return {\n \"runtime\": {\"state\": runtime._state.value},\n \"modules\": list(runtime.registry.modules),\n \"services\": runtime.services.snapshot(),\n \"workers\": runtime.workers.snapshot(),\n \"health\": runtime.health.snapshot(runtime.workers.healths()) | {\"status\": health[\"status\"]},\n \"config\": runtime.configuration.get(),\n }\n\n async def _start_async(self, runtime: RuntimeManager) -> None:\n actions = ControlActionSet(\n health=runtime.health_status,\n start=runtime.start_runtime,\n stop=runtime.stop_runtime,\n status=runtime.runtime_status,\n )\n for channel in self._channels:\n await channel.start(actions)\n\n async def _stop_async(self) -> None:\n for channel in reversed(self._channels):\n await channel.stop()", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/service.py:ControlPlaneService", - "span_start": 12, - "span_end": 52, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.service", - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "llm_answer": "## Назначение\n\n`ControlPlaneService` — это сущность, отвечающая за управление каналами (`ControlChannel`) и координацию действий по запуску и остановке различных компонентов системы. Этот сервис играет роль `pipeline_stage`, что указывает на его участие в конвейере обработки данных или управлении состоянием приложения.\n\n## Ключевые зависимости\n\n### Файлы и сущности\n- **src/app_runtime/control/service.py**: местоположение определения класса `ControlPlaneService`.\n- Используется библиотека **asyncio** для асинхронного выполнения задач.\n\n### Внешние зависимости\n- `RuntimeManager`: менеджер управления рабочим окружением и состоянием приложения.\n- `ControlChannel`: каналы взаимодействия с внешними компонентами или службами.\n- `ControlActionSet`: набор действий, которые могут быть выполнены при старте или останове сервиса.\n\n## Поток данных или вызовов\n\n1. **Инициализация и регистрация каналов**\n - Конструктор `__init__` инициализирует пустой список `_channels` и создаёт пустую коллекцию каналов.\n - Метод `register_channel` добавляет новый канал в список.\n \n2. **Запуск сервиса**\n - Метод `start` проверяет наличие зарегистрированных каналов и вызывает асинхронную функцию `_start_async`.\n - Внутри `_start_async` выполняется выполнение действий через объект `ControlActionSet`. Эти действия включают старт и останов рабочих процессов, проверку текущего состояния здоровья (`health_status`), а также запуск самого рабочего окружения (`start_runtime`).\n\n3. **Остановка сервиса**\n - Метод `stop` аналогично проверяет наличие каналов и вызывает асинхронную функцию `_stop_async`, которая выполняет очистку ресурсов и завершение работы всех каналов.\n\n4. **Создание снимка состояния**\n - Метод `snapshot` собирает информацию о текущем состоянии приложения, включая рабочие процессы, модули, сервисы, состояние работников, текущее здоровье и конфигурационные параметры.\n\n## Важные детали реализации\n\n1. **Асинхронность операций**\n - Использование функций `asyncio.run()` внутри методов `_start_async` и `_stop_async` позволяет выполнять задачи асинхронно, что важно для высокопроизводительных систем.\n\n2. **Состояние и конфигурация**\n - Объект `RuntimeManager` хранит текущие данные о состоянии приложения и конфигурации, что используется для создания снимков состояния и проверки текущих статусов.\n\n3. **Сообщения об ошибках**\n - Если каналы отсутствуют, метод `start` и `stop` просто возвращают без выполнения каких-либо действий.\n\n## Осторожные выводы\n\nНа основании анализа структуры зависимостей и объявлений классов можно предположить, что данный сервис является частью более крупной архитектуры и взаимодействует с другими модулями, такими как HTTP API (`app.post`) и системой регистрации модулей и сервисов (`registry.modules`). Однако прямых доказательств этого нет, поэтому данный вывод считается осторожным.", - "summary": { - "router": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "confidence": null - }, - "retrieval": { - "profile": "code", - "layers_hit": [ - "C0_SOURCE_CHUNKS", - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS", - "C4_SEMANTIC_ROLES" - ], - "evidence_sufficient": true - }, - "llm": { - "answer_status": "answered", - "groundedness": "grounded" - } - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "ControlPlaneService" - ], - "keyword_hints": [ - "ControlPlaneService" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C0_SOURCE_CHUNKS": "exact_path_fetch", - "C4_SEMANTIC_ROLES": "exact_path_fetch", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C3_ENTRYPOINTS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 8, - "C4_SEMANTIC_ROLES": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C3_ENTRYPOINTS": 6 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C4_SEMANTIC_ROLES": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "ControlPlaneService", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "ControlPlaneService", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C4_SEMANTIC_ROLES", - "query": "ControlPlaneService", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "ControlPlaneService", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - }, - { - "layer": "C3_ENTRYPOINTS", - "query": "ControlPlaneService", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 1, - "candidates_after_filter": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 6, - "candidates_after_filter": 6 - }, - { - "layer": "C3_ENTRYPOINTS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 3, - "candidates_after_filter": 3 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "ControlPlaneService", - "alternatives": [ - "ControlPlaneService" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C4_SEMANTIC_ROLES", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 6, - "fail_reason": null - }, - { - "layer": "C3_ENTRYPOINTS", - "status": "hit", - "hit_count": 3, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "router": 1, - "symbol_resolution": 0, - "retrieval_total": 170, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 58, - "C0_SOURCE_CHUNKS": 22, - "C4_SEMANTIC_ROLES": 18, - "C2_DEPENDENCY_GRAPH": 58, - "C3_ENTRYPOINTS": 12 - }, - "merge_rank": 25, - "prompt_build": 0, - "llm_call": 4134 - }, - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 797, - "evidence_rows": 12, - "evidence_chars": 2301 - }, - "evidence_summary": [ - { - "layer": "C1_SYMBOL_CATALOG", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "count": 6, - "unique_paths": 1 - }, - { - "layer": "C3_ENTRYPOINTS", - "count": 3, - "unique_paths": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 1, - "unique_paths": 1 - } - ], - "prompt_template_id": "intent_code_qa_explain_ru_v1", - "system_prompt_version": "v1" - }, - "router": { - "conversation_mode": "START", - "keyword_hints": [ - "ControlPlaneService" - ], - "path_scope": [] - }, - "llm": { - "used_evidence_count": 12, - "missing_evidence_reason": null - } - }, - "run_info": { - "case_id": "plba-fullchain-explain-control-plane-service", - "mode": "full_chain", - "run_started_at": "2026-03-12T11:21:59", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - }, - "input_request": { - "text": "Объясни класс ControlPlaneService", - "normalized_query": "Объясни класс ControlPlaneService" - }, - "steps": [ - { - "step": "intent_router", - "input": { - "query": "Объясни класс ControlPlaneService" - }, - "output": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Объясни класс ControlPlaneService" - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "ControlPlaneService" - ], - "keyword_hints": [ - "ControlPlaneService" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "timings_ms": { - "router": 1 - } - } - }, - { - "step": "retrieval", - "input": { - "query": "Объясни класс ControlPlaneService" - }, - "output": { - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "ControlPlaneService", - "alternatives": [ - "ControlPlaneService" - ], - "confidence": 0.99 - }, - "rag_count": 12, - "rag_rows": [ - { - "path": "src/app_runtime/control/service.py", - "content": "class ControlPlaneService\nControlPlaneService", - "layer": "C1_SYMBOL_CATALOG", - "title": "ControlPlaneService", - "span_start": 12, - "span_end": 52, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "b13471e5916986dccffb53fab613812842965705e6b3a89ae549d30c9e91e9aa", - "qname": "ControlPlaneService", - "kind": "class", - "signature": "ControlPlaneService", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.control.service", - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests service\n- reads and writes state attributes\n- participates in dataflow slices (5)", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlPlaneService", - "span_start": 12, - "span_end": 52, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 68, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "b13471e5916986dccffb53fab613812842965705e6b3a89ae549d30c9e91e9aa", - "symbol_name": "ControlPlaneService", - "qname": "ControlPlaneService", - "role": "pipeline_stage", - "confidence": 0.57, - "dataflow_participation": 5, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.stop", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 25, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d", - "dst_ref": "ControlPlaneService.stop", - "resolution": "resolved", - "slice_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.stop" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._stop_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 51, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a", - "dst_ref": "ControlPlaneService._stop_async", - "resolution": "resolved", - "slice_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._stop_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.register_channel", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 17, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957", - "dst_ref": "ControlPlaneService.register_channel", - "resolution": "resolved", - "slice_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.register_channel" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.start", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 20, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154", - "dst_ref": "ControlPlaneService.start", - "resolution": "resolved", - "slice_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.start" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._start_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 47, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517", - "dst_ref": "ControlPlaneService._start_async", - "resolution": "resolved", - "slice_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._start_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.register_channel reads_attr self._channels.append", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.register_channel:reads_attr", - "span_start": 17, - "span_end": 17, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "1ee5925deffdc38ba15b88bf7c89e5fcd1a78f493fe30f2deb827d714a1b18e8", - "edge_type": "reads_attr", - "src_symbol_id": "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957", - "src_qname": "ControlPlaneService.register_channel", - "dst_symbol_id": null, - "dst_ref": "self._channels.append", - "resolution": "partial", - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "class ControlPlaneService:\n def __init__(self) -> None:\n self._channels: list[ControlChannel] = []\n\n def register_channel(self, channel: ControlChannel) -> None:\n self._channels.append(channel)\n\n def start(self, runtime: RuntimeManager) -> None:\n if not self._channels:\n return\n asyncio.run(self._start_async(runtime))\n\n def stop(self) -> None:\n if not self._channels:\n return\n asyncio.run(self._stop_async())\n\n def snapshot(self, runtime: RuntimeManager) -> dict[str, object]:\n health = runtime.current_health()\n return {\n \"runtime\": {\"state\": runtime._state.value},\n \"modules\": list(runtime.registry.modules),\n \"services\": runtime.services.snapshot(),\n \"workers\": runtime.workers.snapshot(),\n \"health\": runtime.health.snapshot(runtime.workers.healths()) | {\"status\": health[\"status\"]},\n \"config\": runtime.configuration.get(),\n }\n\n async def _start_async(self, runtime: RuntimeManager) -> None:\n actions = ControlActionSet(\n health=runtime.health_status,\n start=runtime.start_runtime,\n stop=runtime.stop_runtime,\n status=runtime.runtime_status,\n )\n for channel in self._channels:\n await channel.start(actions)\n\n async def _stop_async(self) -> None:\n for channel in reversed(self._channels):\n await channel.stop()", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/service.py:ControlPlaneService", - "span_start": 12, - "span_end": 52, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.service", - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ] - }, - "diagnostics": { - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C0_SOURCE_CHUNKS": "exact_path_fetch", - "C4_SEMANTIC_ROLES": "exact_path_fetch", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C3_ENTRYPOINTS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 8, - "C4_SEMANTIC_ROLES": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C3_ENTRYPOINTS": 6 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C4_SEMANTIC_ROLES": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "ControlPlaneService", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "ControlPlaneService", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C4_SEMANTIC_ROLES", - "query": "ControlPlaneService", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "ControlPlaneService", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - }, - { - "layer": "C3_ENTRYPOINTS", - "query": "ControlPlaneService", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 1, - "candidates_after_filter": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 6, - "candidates_after_filter": 6 - }, - { - "layer": "C3_ENTRYPOINTS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 3, - "candidates_after_filter": 3 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "ControlPlaneService", - "alternatives": [ - "ControlPlaneService" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C4_SEMANTIC_ROLES", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 6, - "fail_reason": null - }, - { - "layer": "C3_ENTRYPOINTS", - "status": "hit", - "hit_count": 3, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "symbol_resolution": 0, - "retrieval_total": 170, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 58, - "C0_SOURCE_CHUNKS": 22, - "C4_SEMANTIC_ROLES": 18, - "C2_DEPENDENCY_GRAPH": 58, - "C3_ENTRYPOINTS": 12 - }, - "merge_rank": 25 - } - } - }, - { - "step": "llm_answer", - "input": { - "query": "Объясни класс ControlPlaneService", - "rag_count": 12 - }, - "output": { - "llm_answer": "## Назначение\n\n`ControlPlaneService` — это сущность, отвечающая за управление каналами (`ControlChannel`) и координацию действий по запуску и остановке различных компонентов системы. Этот сервис играет роль `pipeline_stage`, что указывает на его участие в конвейере обработки данных или управлении состоянием приложения.\n\n## Ключевые зависимости\n\n### Файлы и сущности\n- **src/app_runtime/control/service.py**: местоположение определения класса `ControlPlaneService`.\n- Используется библиотека **asyncio** для асинхронного выполнения задач.\n\n### Внешние зависимости\n- `RuntimeManager`: менеджер управления рабочим окружением и состоянием приложения.\n- `ControlChannel`: каналы взаимодействия с внешними компонентами или службами.\n- `ControlActionSet`: набор действий, которые могут быть выполнены при старте или останове сервиса.\n\n## Поток данных или вызовов\n\n1. **Инициализация и регистрация каналов**\n - Конструктор `__init__` инициализирует пустой список `_channels` и создаёт пустую коллекцию каналов.\n - Метод `register_channel` добавляет новый канал в список.\n \n2. **Запуск сервиса**\n - Метод `start` проверяет наличие зарегистрированных каналов и вызывает асинхронную функцию `_start_async`.\n - Внутри `_start_async` выполняется выполнение действий через объект `ControlActionSet`. Эти действия включают старт и останов рабочих процессов, проверку текущего состояния здоровья (`health_status`), а также запуск самого рабочего окружения (`start_runtime`).\n\n3. **Остановка сервиса**\n - Метод `stop` аналогично проверяет наличие каналов и вызывает асинхронную функцию `_stop_async`, которая выполняет очистку ресурсов и завершение работы всех каналов.\n\n4. **Создание снимка состояния**\n - Метод `snapshot` собирает информацию о текущем состоянии приложения, включая рабочие процессы, модули, сервисы, состояние работников, текущее здоровье и конфигурационные параметры.\n\n## Важные детали реализации\n\n1. **Асинхронность операций**\n - Использование функций `asyncio.run()` внутри методов `_start_async` и `_stop_async` позволяет выполнять задачи асинхронно, что важно для высокопроизводительных систем.\n\n2. **Состояние и конфигурация**\n - Объект `RuntimeManager` хранит текущие данные о состоянии приложения и конфигурации, что используется для создания снимков состояния и проверки текущих статусов.\n\n3. **Сообщения об ошибках**\n - Если каналы отсутствуют, метод `start` и `stop` просто возвращают без выполнения каких-либо действий.\n\n## Осторожные выводы\n\nНа основании анализа структуры зависимостей и объявлений классов можно предположить, что данный сервис является частью более крупной архитектуры и взаимодействует с другими модулями, такими как HTTP API (`app.post`) и системой регистрации модулей и сервисов (`registry.modules`). Однако прямых доказательств этого нет, поэтому данный вывод считается осторожным." - }, - "diagnostics": { - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 797, - "evidence_rows": 12, - "evidence_chars": 2301 - }, - "evidence_summary": [ - { - "layer": "C1_SYMBOL_CATALOG", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "count": 6, - "unique_paths": 1 - }, - { - "layer": "C3_ENTRYPOINTS", - "count": 3, - "unique_paths": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 1, - "unique_paths": 1 - } - ], - "prompt_template_id": "intent_code_qa_explain_ru_v1", - "system_prompt_version": "v1" - }, - "timings_ms": { - "prompt_build": 0, - "llm_call": 4134 - } - } - } - ] - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_112158/full_chain_plba_code_retrieval_plba-fullchain-explain-control-plane-service.md b/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_112158/full_chain_plba_code_retrieval_plba-fullchain-explain-control-plane-service.md deleted file mode 100644 index 089ab0f..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_112158/full_chain_plba_code_retrieval_plba-fullchain-explain-control-plane-service.md +++ /dev/null @@ -1,34 +0,0 @@ -# plba-fullchain-explain-control-plane-service - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_retrieval.yaml -- runner: runtime -- mode: full_chain -- passed: True - -## Query -Объясни класс ControlPlaneService - -## Actual -{ - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 12, - "llm_answer": "## Назначение\n\n`ControlPlaneService` — это сущность, отвечающая за управление каналами (`ControlChannel`) и координацию действий по запуску и остановке различных компонентов системы. Этот сервис играет роль `pipeline_stage`, что указывает на его участие в конвейере обработки данных или управлении состоянием приложения.\n\n## Ключевые зависимости\n\n### Файлы и сущности\n- **src/app_runtime/control/service.py**: местоположение определения класса `ControlPlaneService`.\n- Используется библиотека **asyncio** для асинхронного выполнения задач.\n\n### Внешние зависимости\n- `RuntimeManager`: менеджер управления рабочим окружением и состоянием приложения.\n- `ControlChannel`: каналы взаимодействия с внешними компонентами или службами.\n- `ControlActionSet`: набор действий, которые могут быть выполнены при старте или останове сервиса.\n\n## Поток данных или вызовов\n\n1. **Инициализация и регистрация каналов**\n - Конструктор `__init__` инициализирует пустой список `_channels` и создаёт пустую коллекцию каналов.\n - Метод `register_channel` добавляет новый канал в список.\n \n2. **Запуск сервиса**\n - Метод `start` проверяет наличие зарегистрированных каналов и вызывает асинхронную функцию `_start_async`.\n - Внутри `_start_async` выполняется выполнение действий через объект `ControlActionSet`. Эти действия включают старт и останов рабочих процессов, проверку текущего состояния здоровья (`health_status`), а также запуск самого рабочего окружения (`start_runtime`).\n\n3. **Остановка сервиса**\n - Метод `stop` аналогично проверяет наличие каналов и вызывает асинхронную функцию `_stop_async`, которая выполняет очистку ресурсов и завершение работы всех каналов.\n\n4. **Создание снимка состояния**\n - Метод `snapshot` собирает информацию о текущем состоянии приложения, включая рабочие процессы, модули, сервисы, состояние работников, текущее здоровье и конфигурационные параметры.\n\n## Важные детали реализации\n\n1. **Асинхронность операций**\n - Использование функций `asyncio.run()` внутри методов `_start_async` и `_stop_async` позволяет выполнять задачи асинхронно, что важно для высокопроизводительных систем.\n\n2. **Состояние и конфигурация**\n - Объект `RuntimeManager` хранит текущие данные о состоянии приложения и конфигурации, что используется для создания снимков состояния и проверки текущих статусов.\n\n3. **Сообщения об ошибках**\n - Если каналы отсутствуют, метод `start` и `stop` просто возвращают без выполнения каких-либо действий.\n\n## Осторожные выводы\n\nНа основании анализа структуры зависимостей и объявлений классов можно предположить, что данный сервис является частью более крупной архитектуры и взаимодействует с другими модулями, такими как HTTP API (`app.post`) и системой регистрации модулей и сервисов (`registry.modules`). Однако прямых доказательств этого нет, поэтому данный вывод считается осторожным.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "ControlPlaneService" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] -} - -## Mismatches -- none \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_112158/full_chain_plba_code_retrieval_plba-fullchain-explain-create-runtime.json b/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_112158/full_chain_plba_code_retrieval_plba-fullchain-explain-create-runtime.json deleted file mode 100644 index c8018c3..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_112158/full_chain_plba_code_retrieval_plba-fullchain-explain-create-runtime.json +++ /dev/null @@ -1,1896 +0,0 @@ -{ - "case_id": "plba-fullchain-explain-create-runtime", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_retrieval.yaml", - "runner": "runtime", - "mode": "full_chain", - "actual": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 12, - "llm_answer": "## Объяснение функции `create_runtime`\n\n### Назначение\nФункция `create_runtime` предназначена для инициализации и настройки окружения выполнения приложения (`runtime`), используя параметры конфигурации и дополнительные опции управления HTTP-интерфейсом.\n\n### Ключевые зависимости\nФункция зависит от следующих компонентов и библиотек:\n- **`RuntimeManager`** — главный менеджер окружения выполнения, регистрирующий модули и настраивающий каналы управления.\n- **`ApplicationModule`** — модуль приложения, подлежащий регистрации в менеджере среды выполнения.\n- **`HttpControlChannel`** — канал управления, обеспечивающий взаимодействие с внешним интерфейсом через HTTP.\n\n### Поток данных или вызовов\n1. Создаётся экземпляр менеджера окружения выполнения (`RuntimeManager`) и передаётся в возвращаемое значение.\n2. Если указан путь к файлу конфигурации (`config_path`), файл добавляется в конфигурацию среды выполнения.\n3. Если включён режим управления HTTP-интерфейсом (`enable_http_control`), создаётся объект канала управления (`HttpControlChannel`) и регистрируется в среде выполнения.\n4. Модуль приложения (`module`) регистрируется в менеджере окружения выполнения.\n\n### Важные детали реализации\n1. **Параметры функции:**\n - `module`: обязательный аргумент типа `ApplicationModule`, представляющий приложение.\n - `config_path`: необязательный параметр строки, задающий путь к файлу конфигурации.\n - `enable_http_control`: логический флаг, включающий управление HTTP-интерфейсом.\n - `control_host`, `control_port`, `control_timeout`: параметры, определяющие настройки HTTP-канала управления.\n \n2. **Ключевая логика:**\n - В начале создается пустой менеджер окружения выполнения (`RuntimeManager()`).\n - Далее происходит проверка наличия файла конфигурации и его добавление в конфигурацию среды выполнения.\n - При необходимости включается поддержка HTTP-интерфейса и регистрируется соответствующий канал управления.\n - Регистрируется указанный модуль приложения.\n\n3. **Примечания:**\n - Использование параметра `config_path` позволяет гибко загружать внешние конфигурации среды выполнения.\n - Наличие флага `enable_http_control` предоставляет возможность удалённого доступа и управления приложением через HTTP.\n\n---\n\n## Финальное объяснение пользователю\n\nФункция `create_runtime` выполняет инициализацию и настройку окружения выполнения приложения (`runtime`). Она принимает модуль приложения (`ApplicationModule`) и дополнительные параметры конфигурации и управления HTTP-интерфейсом. Если задан путь к файлу конфигурации, он добавляется в конфигурацию среды выполнения. Дополнительно при включении режима управления HTTP создаются и регистрируются соответствующие каналы управления. Важно отметить, что функция возвращает созданный менеджер окружения выполнения, который далее может использоваться для дальнейшей работы с приложением. \n\nЭтот процесс основан на использовании внутренних классов и объектов библиотеки, таких как `RuntimeManager`, `HttpControlChannel`. Логика создания и регистрации элементов четко определена и документирована в исходном коде модуля `bootstrap.py`. \n\nТаким образом, данная функция является ключевым элементом начальной настройки и инициализации системы исполнения приложений.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "create_runtime" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "passed": true, - "mismatches": [], - "details": { - "case_id": "plba-fullchain-explain-create-runtime", - "text": "Объясни функцию create_runtime", - "mode": "full_chain", - "run_started_at": "2026-03-12T11:21:59", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Объясни функцию create_runtime", - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "create_runtime", - "alternatives": [ - "create_runtime" - ], - "confidence": 0.99 - }, - "rag_count": 12, - "rag_rows": [ - { - "path": "src/plba/bootstrap.py", - "content": "function create_runtime\ncreate_runtime(module)", - "layer": "C1_SYMBOL_CATALOG", - "title": "create_runtime", - "span_start": 8, - "span_end": 29, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "qname": "create_runtime", - "kind": "function", - "signature": "create_runtime(module)", - "parent_symbol_id": null, - "package_or_module": "src.plba.bootstrap", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_runner.py", - "content": "UvicornThreadRunner\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (24)", - "layer": "C4_SEMANTIC_ROLES", - "title": "UvicornThreadRunner", - "span_start": 10, - "span_end": 61, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 11, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "fd55630045a02100df8877ac27d951ee08617d4598764394d48cb51fe067476a", - "symbol_name": "UvicornThreadRunner", - "qname": "UvicornThreadRunner", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 24, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "3779fdd2878b770e789a35bb2a89c9d79f13b61c26d7db1b3b683f9bb9e1623f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/bootstrap.py", - "content": "create_runtime calls runtime.add_config_file", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "create_runtime:calls", - "span_start": 19, - "span_end": 19, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "4eaeec4ac55a59d5f66fd01c4754955f8fedaf4bc3df13fa769b352c7bfaacbb", - "edge_type": "calls", - "src_symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "src_qname": "create_runtime", - "dst_symbol_id": null, - "dst_ref": "runtime.add_config_file", - "resolution": "partial", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/bootstrap.py", - "content": "create_runtime reads_attr runtime.register_module", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "create_runtime:reads_attr", - "span_start": 28, - "span_end": 28, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "45516c79ff358dbf9b650a081668df0f66d2fe989300f985a1a78be6be166f8f", - "edge_type": "reads_attr", - "src_symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "src_qname": "create_runtime", - "dst_symbol_id": null, - "dst_ref": "runtime.register_module", - "resolution": "partial", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/bootstrap.py", - "content": "create_runtime instantiates RuntimeManager", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "create_runtime:instantiates", - "span_start": 17, - "span_end": 17, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "0adba17984f850ea1608c9e734d2dd5c325cfde3a8133123aa239e44935ad18e", - "edge_type": "instantiates", - "src_symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "src_qname": "create_runtime", - "dst_symbol_id": "27158ca220022eeb5083c6addf8a50775d45f7161284fd60aac48410105f4b98", - "dst_ref": "RuntimeManager", - "resolution": "resolved", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/bootstrap.py", - "content": "create_runtime calls runtime.register_module", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "create_runtime:calls", - "span_start": 28, - "span_end": 28, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "ab6003c3441addc1ba1b81edeca009165559f652f6b2cf424e5ae61b1f617de8", - "edge_type": "calls", - "src_symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "src_qname": "create_runtime", - "dst_symbol_id": null, - "dst_ref": "runtime.register_module", - "resolution": "partial", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/bootstrap.py", - "content": "create_runtime calls runtime.control_plane.register_channel", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "create_runtime:calls", - "span_start": 21, - "span_end": 27, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "2678250030b9ce47a3b3b55fac7897ac530367edc8374ac9d5e6ecafb1e483f0", - "edge_type": "calls", - "src_symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "src_qname": "create_runtime", - "dst_symbol_id": null, - "dst_ref": "runtime.control_plane.register_channel", - "resolution": "partial", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/bootstrap.py", - "content": "create_runtime reads_attr runtime.add_config_file", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "create_runtime:reads_attr", - "span_start": 19, - "span_end": 19, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "30d4e8aae984ab84d523e80d02f1caeda52d547fa3d2aa47be8845931cabbca2", - "edge_type": "reads_attr", - "src_symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "src_qname": "create_runtime", - "dst_symbol_id": null, - "dst_ref": "runtime.add_config_file", - "resolution": "partial", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/bootstrap.py", - "content": "def create_runtime(\n module: ApplicationModule,\n *,\n config_path: str | None = None,\n enable_http_control: bool = False,\n control_host: str = \"127.0.0.1\",\n control_port: int = 8080,\n control_timeout: int = 5,\n) -> RuntimeManager:\n runtime = RuntimeManager()\n if config_path is not None:\n runtime.add_config_file(config_path)\n if enable_http_control:\n runtime.control_plane.register_channel(\n HttpControlChannel(\n host=control_host,\n port=control_port,\n timeout=control_timeout,\n )\n )\n runtime.register_module(module)\n return runtime", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/plba/bootstrap.py:create_runtime", - "span_start": 8, - "span_end": 29, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.plba.bootstrap", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "llm_answer": "## Объяснение функции `create_runtime`\n\n### Назначение\nФункция `create_runtime` предназначена для инициализации и настройки окружения выполнения приложения (`runtime`), используя параметры конфигурации и дополнительные опции управления HTTP-интерфейсом.\n\n### Ключевые зависимости\nФункция зависит от следующих компонентов и библиотек:\n- **`RuntimeManager`** — главный менеджер окружения выполнения, регистрирующий модули и настраивающий каналы управления.\n- **`ApplicationModule`** — модуль приложения, подлежащий регистрации в менеджере среды выполнения.\n- **`HttpControlChannel`** — канал управления, обеспечивающий взаимодействие с внешним интерфейсом через HTTP.\n\n### Поток данных или вызовов\n1. Создаётся экземпляр менеджера окружения выполнения (`RuntimeManager`) и передаётся в возвращаемое значение.\n2. Если указан путь к файлу конфигурации (`config_path`), файл добавляется в конфигурацию среды выполнения.\n3. Если включён режим управления HTTP-интерфейсом (`enable_http_control`), создаётся объект канала управления (`HttpControlChannel`) и регистрируется в среде выполнения.\n4. Модуль приложения (`module`) регистрируется в менеджере окружения выполнения.\n\n### Важные детали реализации\n1. **Параметры функции:**\n - `module`: обязательный аргумент типа `ApplicationModule`, представляющий приложение.\n - `config_path`: необязательный параметр строки, задающий путь к файлу конфигурации.\n - `enable_http_control`: логический флаг, включающий управление HTTP-интерфейсом.\n - `control_host`, `control_port`, `control_timeout`: параметры, определяющие настройки HTTP-канала управления.\n \n2. **Ключевая логика:**\n - В начале создается пустой менеджер окружения выполнения (`RuntimeManager()`).\n - Далее происходит проверка наличия файла конфигурации и его добавление в конфигурацию среды выполнения.\n - При необходимости включается поддержка HTTP-интерфейса и регистрируется соответствующий канал управления.\n - Регистрируется указанный модуль приложения.\n\n3. **Примечания:**\n - Использование параметра `config_path` позволяет гибко загружать внешние конфигурации среды выполнения.\n - Наличие флага `enable_http_control` предоставляет возможность удалённого доступа и управления приложением через HTTP.\n\n---\n\n## Финальное объяснение пользователю\n\nФункция `create_runtime` выполняет инициализацию и настройку окружения выполнения приложения (`runtime`). Она принимает модуль приложения (`ApplicationModule`) и дополнительные параметры конфигурации и управления HTTP-интерфейсом. Если задан путь к файлу конфигурации, он добавляется в конфигурацию среды выполнения. Дополнительно при включении режима управления HTTP создаются и регистрируются соответствующие каналы управления. Важно отметить, что функция возвращает созданный менеджер окружения выполнения, который далее может использоваться для дальнейшей работы с приложением. \n\nЭтот процесс основан на использовании внутренних классов и объектов библиотеки, таких как `RuntimeManager`, `HttpControlChannel`. Логика создания и регистрации элементов четко определена и документирована в исходном коде модуля `bootstrap.py`. \n\nТаким образом, данная функция является ключевым элементом начальной настройки и инициализации системы исполнения приложений.", - "summary": { - "router": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "confidence": null - }, - "retrieval": { - "profile": "code", - "layers_hit": [ - "C0_SOURCE_CHUNKS", - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS", - "C4_SEMANTIC_ROLES" - ], - "evidence_sufficient": true - }, - "llm": { - "answer_status": "answered", - "groundedness": "grounded" - } - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "symbol_kind_hint": "function", - "symbol_candidates": [ - "create_runtime" - ], - "keyword_hints": [ - "create_runtime" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C0_SOURCE_CHUNKS": "exact_path_fetch", - "C4_SEMANTIC_ROLES": "exact_path_fetch", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C3_ENTRYPOINTS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 8, - "C4_SEMANTIC_ROLES": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C3_ENTRYPOINTS": 6 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C4_SEMANTIC_ROLES": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "create_runtime", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "create_runtime", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C4_SEMANTIC_ROLES", - "query": "create_runtime", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "create_runtime", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - }, - { - "layer": "C3_ENTRYPOINTS", - "query": "create_runtime", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 1, - "candidates_after_filter": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 6, - "candidates_after_filter": 6 - }, - { - "layer": "C3_ENTRYPOINTS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 3, - "candidates_after_filter": 3 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "create_runtime", - "alternatives": [ - "create_runtime" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C4_SEMANTIC_ROLES", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 6, - "fail_reason": null - }, - { - "layer": "C3_ENTRYPOINTS", - "status": "hit", - "hit_count": 3, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "router": 0, - "symbol_resolution": 0, - "retrieval_total": 114, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 32, - "C0_SOURCE_CHUNKS": 13, - "C4_SEMANTIC_ROLES": 12, - "C2_DEPENDENCY_GRAPH": 45, - "C3_ENTRYPOINTS": 11 - }, - "merge_rank": 17, - "prompt_build": 0, - "llm_call": 4283 - }, - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 601, - "evidence_rows": 12, - "evidence_chars": 1184 - }, - "evidence_summary": [ - { - "layer": "C1_SYMBOL_CATALOG", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "count": 6, - "unique_paths": 1 - }, - { - "layer": "C3_ENTRYPOINTS", - "count": 3, - "unique_paths": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 1, - "unique_paths": 1 - } - ], - "prompt_template_id": "intent_code_qa_explain_ru_v1", - "system_prompt_version": "v1" - }, - "router": { - "conversation_mode": "START", - "keyword_hints": [ - "create_runtime" - ], - "path_scope": [] - }, - "llm": { - "used_evidence_count": 12, - "missing_evidence_reason": null - } - }, - "run_info": { - "case_id": "plba-fullchain-explain-create-runtime", - "mode": "full_chain", - "run_started_at": "2026-03-12T11:21:59", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - }, - "input_request": { - "text": "Объясни функцию create_runtime", - "normalized_query": "Объясни функцию create_runtime" - }, - "steps": [ - { - "step": "intent_router", - "input": { - "query": "Объясни функцию create_runtime" - }, - "output": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Объясни функцию create_runtime" - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "symbol_kind_hint": "function", - "symbol_candidates": [ - "create_runtime" - ], - "keyword_hints": [ - "create_runtime" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "timings_ms": { - "router": 0 - } - } - }, - { - "step": "retrieval", - "input": { - "query": "Объясни функцию create_runtime" - }, - "output": { - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "create_runtime", - "alternatives": [ - "create_runtime" - ], - "confidence": 0.99 - }, - "rag_count": 12, - "rag_rows": [ - { - "path": "src/plba/bootstrap.py", - "content": "function create_runtime\ncreate_runtime(module)", - "layer": "C1_SYMBOL_CATALOG", - "title": "create_runtime", - "span_start": 8, - "span_end": 29, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "qname": "create_runtime", - "kind": "function", - "signature": "create_runtime(module)", - "parent_symbol_id": null, - "package_or_module": "src.plba.bootstrap", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_runner.py", - "content": "UvicornThreadRunner\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (24)", - "layer": "C4_SEMANTIC_ROLES", - "title": "UvicornThreadRunner", - "span_start": 10, - "span_end": 61, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 11, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "fd55630045a02100df8877ac27d951ee08617d4598764394d48cb51fe067476a", - "symbol_name": "UvicornThreadRunner", - "qname": "UvicornThreadRunner", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 24, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "3779fdd2878b770e789a35bb2a89c9d79f13b61c26d7db1b3b683f9bb9e1623f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/bootstrap.py", - "content": "create_runtime calls runtime.add_config_file", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "create_runtime:calls", - "span_start": 19, - "span_end": 19, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "4eaeec4ac55a59d5f66fd01c4754955f8fedaf4bc3df13fa769b352c7bfaacbb", - "edge_type": "calls", - "src_symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "src_qname": "create_runtime", - "dst_symbol_id": null, - "dst_ref": "runtime.add_config_file", - "resolution": "partial", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/bootstrap.py", - "content": "create_runtime reads_attr runtime.register_module", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "create_runtime:reads_attr", - "span_start": 28, - "span_end": 28, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "45516c79ff358dbf9b650a081668df0f66d2fe989300f985a1a78be6be166f8f", - "edge_type": "reads_attr", - "src_symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "src_qname": "create_runtime", - "dst_symbol_id": null, - "dst_ref": "runtime.register_module", - "resolution": "partial", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/bootstrap.py", - "content": "create_runtime instantiates RuntimeManager", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "create_runtime:instantiates", - "span_start": 17, - "span_end": 17, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "0adba17984f850ea1608c9e734d2dd5c325cfde3a8133123aa239e44935ad18e", - "edge_type": "instantiates", - "src_symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "src_qname": "create_runtime", - "dst_symbol_id": "27158ca220022eeb5083c6addf8a50775d45f7161284fd60aac48410105f4b98", - "dst_ref": "RuntimeManager", - "resolution": "resolved", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/bootstrap.py", - "content": "create_runtime calls runtime.register_module", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "create_runtime:calls", - "span_start": 28, - "span_end": 28, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "ab6003c3441addc1ba1b81edeca009165559f652f6b2cf424e5ae61b1f617de8", - "edge_type": "calls", - "src_symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "src_qname": "create_runtime", - "dst_symbol_id": null, - "dst_ref": "runtime.register_module", - "resolution": "partial", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/bootstrap.py", - "content": "create_runtime calls runtime.control_plane.register_channel", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "create_runtime:calls", - "span_start": 21, - "span_end": 27, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "2678250030b9ce47a3b3b55fac7897ac530367edc8374ac9d5e6ecafb1e483f0", - "edge_type": "calls", - "src_symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "src_qname": "create_runtime", - "dst_symbol_id": null, - "dst_ref": "runtime.control_plane.register_channel", - "resolution": "partial", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/bootstrap.py", - "content": "create_runtime reads_attr runtime.add_config_file", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "create_runtime:reads_attr", - "span_start": 19, - "span_end": 19, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "30d4e8aae984ab84d523e80d02f1caeda52d547fa3d2aa47be8845931cabbca2", - "edge_type": "reads_attr", - "src_symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "src_qname": "create_runtime", - "dst_symbol_id": null, - "dst_ref": "runtime.add_config_file", - "resolution": "partial", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/bootstrap.py", - "content": "def create_runtime(\n module: ApplicationModule,\n *,\n config_path: str | None = None,\n enable_http_control: bool = False,\n control_host: str = \"127.0.0.1\",\n control_port: int = 8080,\n control_timeout: int = 5,\n) -> RuntimeManager:\n runtime = RuntimeManager()\n if config_path is not None:\n runtime.add_config_file(config_path)\n if enable_http_control:\n runtime.control_plane.register_channel(\n HttpControlChannel(\n host=control_host,\n port=control_port,\n timeout=control_timeout,\n )\n )\n runtime.register_module(module)\n return runtime", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/plba/bootstrap.py:create_runtime", - "span_start": 8, - "span_end": 29, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.plba.bootstrap", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ] - }, - "diagnostics": { - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C0_SOURCE_CHUNKS": "exact_path_fetch", - "C4_SEMANTIC_ROLES": "exact_path_fetch", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C3_ENTRYPOINTS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 8, - "C4_SEMANTIC_ROLES": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C3_ENTRYPOINTS": 6 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C4_SEMANTIC_ROLES": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "create_runtime", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "create_runtime", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C4_SEMANTIC_ROLES", - "query": "create_runtime", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "create_runtime", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - }, - { - "layer": "C3_ENTRYPOINTS", - "query": "create_runtime", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 1, - "candidates_after_filter": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 6, - "candidates_after_filter": 6 - }, - { - "layer": "C3_ENTRYPOINTS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 3, - "candidates_after_filter": 3 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "create_runtime", - "alternatives": [ - "create_runtime" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C4_SEMANTIC_ROLES", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 6, - "fail_reason": null - }, - { - "layer": "C3_ENTRYPOINTS", - "status": "hit", - "hit_count": 3, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "symbol_resolution": 0, - "retrieval_total": 114, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 32, - "C0_SOURCE_CHUNKS": 13, - "C4_SEMANTIC_ROLES": 12, - "C2_DEPENDENCY_GRAPH": 45, - "C3_ENTRYPOINTS": 11 - }, - "merge_rank": 17 - } - } - }, - { - "step": "llm_answer", - "input": { - "query": "Объясни функцию create_runtime", - "rag_count": 12 - }, - "output": { - "llm_answer": "## Объяснение функции `create_runtime`\n\n### Назначение\nФункция `create_runtime` предназначена для инициализации и настройки окружения выполнения приложения (`runtime`), используя параметры конфигурации и дополнительные опции управления HTTP-интерфейсом.\n\n### Ключевые зависимости\nФункция зависит от следующих компонентов и библиотек:\n- **`RuntimeManager`** — главный менеджер окружения выполнения, регистрирующий модули и настраивающий каналы управления.\n- **`ApplicationModule`** — модуль приложения, подлежащий регистрации в менеджере среды выполнения.\n- **`HttpControlChannel`** — канал управления, обеспечивающий взаимодействие с внешним интерфейсом через HTTP.\n\n### Поток данных или вызовов\n1. Создаётся экземпляр менеджера окружения выполнения (`RuntimeManager`) и передаётся в возвращаемое значение.\n2. Если указан путь к файлу конфигурации (`config_path`), файл добавляется в конфигурацию среды выполнения.\n3. Если включён режим управления HTTP-интерфейсом (`enable_http_control`), создаётся объект канала управления (`HttpControlChannel`) и регистрируется в среде выполнения.\n4. Модуль приложения (`module`) регистрируется в менеджере окружения выполнения.\n\n### Важные детали реализации\n1. **Параметры функции:**\n - `module`: обязательный аргумент типа `ApplicationModule`, представляющий приложение.\n - `config_path`: необязательный параметр строки, задающий путь к файлу конфигурации.\n - `enable_http_control`: логический флаг, включающий управление HTTP-интерфейсом.\n - `control_host`, `control_port`, `control_timeout`: параметры, определяющие настройки HTTP-канала управления.\n \n2. **Ключевая логика:**\n - В начале создается пустой менеджер окружения выполнения (`RuntimeManager()`).\n - Далее происходит проверка наличия файла конфигурации и его добавление в конфигурацию среды выполнения.\n - При необходимости включается поддержка HTTP-интерфейса и регистрируется соответствующий канал управления.\n - Регистрируется указанный модуль приложения.\n\n3. **Примечания:**\n - Использование параметра `config_path` позволяет гибко загружать внешние конфигурации среды выполнения.\n - Наличие флага `enable_http_control` предоставляет возможность удалённого доступа и управления приложением через HTTP.\n\n---\n\n## Финальное объяснение пользователю\n\nФункция `create_runtime` выполняет инициализацию и настройку окружения выполнения приложения (`runtime`). Она принимает модуль приложения (`ApplicationModule`) и дополнительные параметры конфигурации и управления HTTP-интерфейсом. Если задан путь к файлу конфигурации, он добавляется в конфигурацию среды выполнения. Дополнительно при включении режима управления HTTP создаются и регистрируются соответствующие каналы управления. Важно отметить, что функция возвращает созданный менеджер окружения выполнения, который далее может использоваться для дальнейшей работы с приложением. \n\nЭтот процесс основан на использовании внутренних классов и объектов библиотеки, таких как `RuntimeManager`, `HttpControlChannel`. Логика создания и регистрации элементов четко определена и документирована в исходном коде модуля `bootstrap.py`. \n\nТаким образом, данная функция является ключевым элементом начальной настройки и инициализации системы исполнения приложений." - }, - "diagnostics": { - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 601, - "evidence_rows": 12, - "evidence_chars": 1184 - }, - "evidence_summary": [ - { - "layer": "C1_SYMBOL_CATALOG", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "count": 6, - "unique_paths": 1 - }, - { - "layer": "C3_ENTRYPOINTS", - "count": 3, - "unique_paths": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 1, - "unique_paths": 1 - } - ], - "prompt_template_id": "intent_code_qa_explain_ru_v1", - "system_prompt_version": "v1" - }, - "timings_ms": { - "prompt_build": 0, - "llm_call": 4283 - } - } - } - ] - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_112158/full_chain_plba_code_retrieval_plba-fullchain-explain-create-runtime.md b/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_112158/full_chain_plba_code_retrieval_plba-fullchain-explain-create-runtime.md deleted file mode 100644 index 0330caf..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_112158/full_chain_plba_code_retrieval_plba-fullchain-explain-create-runtime.md +++ /dev/null @@ -1,34 +0,0 @@ -# plba-fullchain-explain-create-runtime - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_retrieval.yaml -- runner: runtime -- mode: full_chain -- passed: True - -## Query -Объясни функцию create_runtime - -## Actual -{ - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 12, - "llm_answer": "## Объяснение функции `create_runtime`\n\n### Назначение\nФункция `create_runtime` предназначена для инициализации и настройки окружения выполнения приложения (`runtime`), используя параметры конфигурации и дополнительные опции управления HTTP-интерфейсом.\n\n### Ключевые зависимости\nФункция зависит от следующих компонентов и библиотек:\n- **`RuntimeManager`** — главный менеджер окружения выполнения, регистрирующий модули и настраивающий каналы управления.\n- **`ApplicationModule`** — модуль приложения, подлежащий регистрации в менеджере среды выполнения.\n- **`HttpControlChannel`** — канал управления, обеспечивающий взаимодействие с внешним интерфейсом через HTTP.\n\n### Поток данных или вызовов\n1. Создаётся экземпляр менеджера окружения выполнения (`RuntimeManager`) и передаётся в возвращаемое значение.\n2. Если указан путь к файлу конфигурации (`config_path`), файл добавляется в конфигурацию среды выполнения.\n3. Если включён режим управления HTTP-интерфейсом (`enable_http_control`), создаётся объект канала управления (`HttpControlChannel`) и регистрируется в среде выполнения.\n4. Модуль приложения (`module`) регистрируется в менеджере окружения выполнения.\n\n### Важные детали реализации\n1. **Параметры функции:**\n - `module`: обязательный аргумент типа `ApplicationModule`, представляющий приложение.\n - `config_path`: необязательный параметр строки, задающий путь к файлу конфигурации.\n - `enable_http_control`: логический флаг, включающий управление HTTP-интерфейсом.\n - `control_host`, `control_port`, `control_timeout`: параметры, определяющие настройки HTTP-канала управления.\n \n2. **Ключевая логика:**\n - В начале создается пустой менеджер окружения выполнения (`RuntimeManager()`).\n - Далее происходит проверка наличия файла конфигурации и его добавление в конфигурацию среды выполнения.\n - При необходимости включается поддержка HTTP-интерфейса и регистрируется соответствующий канал управления.\n - Регистрируется указанный модуль приложения.\n\n3. **Примечания:**\n - Использование параметра `config_path` позволяет гибко загружать внешние конфигурации среды выполнения.\n - Наличие флага `enable_http_control` предоставляет возможность удалённого доступа и управления приложением через HTTP.\n\n---\n\n## Финальное объяснение пользователю\n\nФункция `create_runtime` выполняет инициализацию и настройку окружения выполнения приложения (`runtime`). Она принимает модуль приложения (`ApplicationModule`) и дополнительные параметры конфигурации и управления HTTP-интерфейсом. Если задан путь к файлу конфигурации, он добавляется в конфигурацию среды выполнения. Дополнительно при включении режима управления HTTP создаются и регистрируются соответствующие каналы управления. Важно отметить, что функция возвращает созданный менеджер окружения выполнения, который далее может использоваться для дальнейшей работы с приложением. \n\nЭтот процесс основан на использовании внутренних классов и объектов библиотеки, таких как `RuntimeManager`, `HttpControlChannel`. Логика создания и регистрации элементов четко определена и документирована в исходном коде модуля `bootstrap.py`. \n\nТаким образом, данная функция является ключевым элементом начальной настройки и инициализации системы исполнения приложений.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "create_runtime" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] -} - -## Mismatches -- none \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_112158/full_chain_plba_code_retrieval_plba-fullchain-explain-http-control-channel.json b/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_112158/full_chain_plba_code_retrieval_plba-fullchain-explain-http-control-channel.json deleted file mode 100644 index 51d6b21..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_112158/full_chain_plba_code_retrieval_plba-fullchain-explain-http-control-channel.json +++ /dev/null @@ -1,2088 +0,0 @@ -{ - "case_id": "plba-fullchain-explain-http-control-channel", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_retrieval.yaml", - "runner": "runtime", - "mode": "full_chain", - "actual": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 12, - "llm_answer": "## Объяснение работы класса `HttpControlChannel`\n\n### Назначение\nКласс `HttpControlChannel` является компонентом системы управления состоянием и взаимодействия с внешним миром через HTTP-протокол. Он реализует механизм обмена данными и состояниями между компонентами приложения через HTTP-запросы и ответы.\n\n### Ключевые зависимости\nКлючевыми зависимостями являются:\n- `UvicornThreadRunner`: используется для запуска асинхронного сервера на основе библиотеки Uvicorn.\n- `HttpControlAppFactory`: фабрика приложений, которая отвечает за создание экземпляров FastAPI приложения.\n- `ControlActionSet`: набор действий, связанных с управлением состоянием и поведением приложения.\n\n### Поток данных или вызовов\nПоток данных и вызовов выглядит следующим образом:\n1. **Инициализация (`__init__`)**:\n - При создании экземпляра класса задаются параметры хоста, порта и тайм-аута.\n - Создается объект `UvicornThreadRunner`, отвечающий за запуск асинхронного HTTP-сервера.\n - Создается экземпляр фабрики приложений `HttpControlAppFactory`.\n \n2. **Запуск (`start`)**:\n - Если заданы действия (`ControlActionSet`), создается экземпляр FastAPI приложения, включающего обработчики для health и action запросов.\n - Запускается сервер при помощи объекта `UvicornThreadRunner`.\n\n3. **Остановка (`stop`)**:\n - Остановка запущенного сервера при помощи метода `stop()` объекта `UvicornThreadRunner`.\n\n4. **Получение статуса порта (`port`)**:\n - Возвращает порт, на котором запущен сервер.\n\n5. **Health-запрос (`_health_response`)**:\n - Проверяет наличие настроенных действий и возвращает статус здоровья приложения.\n\n6. **Action-запрос (`_action_response`)**:\n - Обрабатывает запросы действий, проверяя их конфигурацию и возвращая соответствующий результат.\n\n### Важные детали реализации\n- **Таймаут (`_timeout`)**: устанавливается при инициализации и используется в методах проверки состояния здоровья и выполнения действий.\n- **Actions (`_actions`)**: набор доступных действий, определяющий функциональность приложения.\n- **FastAPI приложение**: строится динамически при каждом вызове метода `start`, что позволяет настраивать его под конкретные задачи.\n \n### Осторожные выводы\nНа основании текущего контекста сложно однозначно утверждать, какие именно данные передаются по HTTP-протоколу, так как контекст сигнализирует о возможности работы с различными типами данных, но детальной информации об этом нет.\n\n### Итоговое объяснение\nКласс `HttpControlChannel` предназначен для организации управления состоянием и взаимодействия с приложением через HTTP-интерфейс. Он использует библиотеку Uvicorn для создания асинхронного HTTP-сервера и FastAPI для построения прикладных сервисов. Класс управляет жизненным циклом сервера, отслеживает доступные действия и предоставляет методы для получения статуса здоровья и выполнения пользовательских операций.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "HttpControlChannel" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "passed": true, - "mismatches": [], - "details": { - "case_id": "plba-fullchain-explain-http-control-channel", - "text": "Объясни класс HttpControlChannel", - "mode": "full_chain", - "run_started_at": "2026-03-12T11:21:59", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Объясни класс HttpControlChannel", - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "HttpControlChannel", - "alternatives": [ - "HttpControlChannel" - ], - "confidence": 0.99 - }, - "rag_count": 12, - "rag_rows": [ - { - "path": "src/app_runtime/control/http_channel.py", - "content": "class HttpControlChannel\nHttpControlChannel(ControlChannel)", - "layer": "C1_SYMBOL_CATALOG", - "title": "HttpControlChannel", - "span_start": 12, - "span_end": 57, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "1c9fbdc24819e5604c26ea55428a74310f03a03e1af197ed84846af61e42fdb0", - "qname": "HttpControlChannel", - "kind": "class", - "signature": "HttpControlChannel(ControlChannel)", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.control.http_channel", - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (10)", - "layer": "C4_SEMANTIC_ROLES", - "title": "HttpControlChannel", - "span_start": 12, - "span_end": 57, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 21, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "1c9fbdc24819e5604c26ea55428a74310f03a03e1af197ed84846af61e42fdb0", - "symbol_name": "HttpControlChannel", - "qname": "HttpControlChannel", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 10, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel.__init__\n -> HttpControlChannel._runner\n -> HttpControlChannel.start", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "HttpControlChannel.__init__:dataflow_slice", - "span_start": 15, - "span_end": 22, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "51d73913df709152258ed1b9a8c8f4eb3c575eccfe6b982aef0b28e0789a29da", - "edge_type": "dataflow_slice", - "src_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "src_qname": "HttpControlChannel.__init__", - "dst_symbol_id": "d1933f04137f52535b6525f1b93ff2cd83bfb216b480e887e791ed1714cda8e0", - "dst_ref": "HttpControlChannel.start", - "resolution": "resolved", - "slice_id": "51d73913df709152258ed1b9a8c8f4eb3c575eccfe6b982aef0b28e0789a29da", - "root_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "path_symbols": [ - "HttpControlChannel.__init__", - "HttpControlChannel._runner", - "HttpControlChannel.start" - ], - "path_symbol_ids": [ - "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "d1933f04137f52535b6525f1b93ff2cd83bfb216b480e887e791ed1714cda8e0" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel.__init__\n -> HttpControlChannel._runner\n -> HttpControlChannel.port", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "HttpControlChannel.__init__:dataflow_slice", - "span_start": 15, - "span_end": 29, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "c7167bab7218bb768ad7c11bfb40d1a3096e6071dd7817bba5fd864cf8f6de13", - "edge_type": "dataflow_slice", - "src_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "src_qname": "HttpControlChannel.__init__", - "dst_symbol_id": "3632ce8227f4a31e0768f2fb021a4d1ba28e1202633aa0f2fac902295931280f", - "dst_ref": "HttpControlChannel.port", - "resolution": "resolved", - "slice_id": "c7167bab7218bb768ad7c11bfb40d1a3096e6071dd7817bba5fd864cf8f6de13", - "root_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "path_symbols": [ - "HttpControlChannel.__init__", - "HttpControlChannel._runner", - "HttpControlChannel.port" - ], - "path_symbol_ids": [ - "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "3632ce8227f4a31e0768f2fb021a4d1ba28e1202633aa0f2fac902295931280f" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel.__init__\n -> HttpControlChannel._timeout\n -> HttpControlChannel._health_response", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "HttpControlChannel.__init__:dataflow_slice", - "span_start": 14, - "span_end": 34, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "f858f5c9e575f6c4cdfe3853571b7ee21d1f628a443541d2037c3dc9d0790bef", - "edge_type": "dataflow_slice", - "src_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "src_qname": "HttpControlChannel.__init__", - "dst_symbol_id": "e84bf04e9cd2127df235b7064d05f47e19f19a89c7c82f4c247231d4e8fa426a", - "dst_ref": "HttpControlChannel._health_response", - "resolution": "resolved", - "slice_id": "f858f5c9e575f6c4cdfe3853571b7ee21d1f628a443541d2037c3dc9d0790bef", - "root_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "path_symbols": [ - "HttpControlChannel.__init__", - "HttpControlChannel._timeout", - "HttpControlChannel._health_response" - ], - "path_symbol_ids": [ - "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "e84bf04e9cd2127df235b7064d05f47e19f19a89c7c82f4c247231d4e8fa426a" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel.__init__\n -> HttpControlChannel._timeout\n -> HttpControlChannel._action_response", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "HttpControlChannel.__init__:dataflow_slice", - "span_start": 14, - "span_end": 47, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "c3ef21fcae96c82c00be74b3ab827d4af2085d89cb3fa5521c19a174aad84dbb", - "edge_type": "dataflow_slice", - "src_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "src_qname": "HttpControlChannel.__init__", - "dst_symbol_id": "e64969024ccaeb34d8d91473fad07b3b3d341875846392e7a006406c7ada1954", - "dst_ref": "HttpControlChannel._action_response", - "resolution": "resolved", - "slice_id": "c3ef21fcae96c82c00be74b3ab827d4af2085d89cb3fa5521c19a174aad84dbb", - "root_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "path_symbols": [ - "HttpControlChannel.__init__", - "HttpControlChannel._timeout", - "HttpControlChannel._action_response" - ], - "path_symbol_ids": [ - "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "e64969024ccaeb34d8d91473fad07b3b3d341875846392e7a006406c7ada1954" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel.__init__\n -> HttpControlChannel._runner\n -> HttpControlChannel.stop", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "HttpControlChannel.__init__:dataflow_slice", - "span_start": 15, - "span_end": 25, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "0f827ef81a990258a8a74381c8564a8361afa6712dba3200592659c939adcb9d", - "edge_type": "dataflow_slice", - "src_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "src_qname": "HttpControlChannel.__init__", - "dst_symbol_id": "f29ab212620093d72be20e26c5a399624c7939a6056a728762ed3f84a250bfa3", - "dst_ref": "HttpControlChannel.stop", - "resolution": "resolved", - "slice_id": "0f827ef81a990258a8a74381c8564a8361afa6712dba3200592659c939adcb9d", - "root_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "path_symbols": [ - "HttpControlChannel.__init__", - "HttpControlChannel._runner", - "HttpControlChannel.stop" - ], - "path_symbol_ids": [ - "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "f29ab212620093d72be20e26c5a399624c7939a6056a728762ed3f84a250bfa3" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel.__init__\n -> HttpControlChannel._factory\n -> HttpControlChannel.start", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "HttpControlChannel.__init__:dataflow_slice", - "span_start": 16, - "span_end": 21, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e61ec25ded7dbe380d95ce2abcbc1d7a2d2afde5aa8453866df8706dfb7d6ddb", - "edge_type": "dataflow_slice", - "src_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "src_qname": "HttpControlChannel.__init__", - "dst_symbol_id": "d1933f04137f52535b6525f1b93ff2cd83bfb216b480e887e791ed1714cda8e0", - "dst_ref": "HttpControlChannel.start", - "resolution": "resolved", - "slice_id": "e61ec25ded7dbe380d95ce2abcbc1d7a2d2afde5aa8453866df8706dfb7d6ddb", - "root_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "path_symbols": [ - "HttpControlChannel.__init__", - "HttpControlChannel._factory", - "HttpControlChannel.start" - ], - "path_symbol_ids": [ - "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "d1933f04137f52535b6525f1b93ff2cd83bfb216b480e887e791ed1714cda8e0" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "class HttpControlChannel(ControlChannel):\n def __init__(self, host: str, port: int, timeout: int) -> None:\n self._timeout = timeout\n self._runner = UvicornThreadRunner(host, port, timeout)\n self._factory = HttpControlAppFactory()\n self._actions: ControlActionSet | None = None\n\n async def start(self, actions: ControlActionSet) -> None:\n self._actions = actions\n app = self._factory.create(self._health_response, self._action_response)\n await self._runner.start(app)\n\n async def stop(self) -> None:\n await self._runner.stop()\n\n @property\n def port(self) -> int:\n return self._runner.port\n\n async def _health_response(self) -> dict[str, object]:\n if self._actions is None:\n return {\"status\": \"unhealthy\", \"detail\": \"control actions are not configured\"}\n return await asyncio.wait_for(self._actions.health(), timeout=float(self._timeout))\n\n async def _action_response(self, action: str, _client_source: str = \"unknown\") -> JSONResponse:\n if self._actions is None:\n return JSONResponse(content={\"status\": \"error\", \"detail\": f\"{action} handler is not configured\"}, status_code=404)\n callbacks = {\n \"start\": self._actions.start,\n \"stop\": self._actions.stop,\n \"status\": self._actions.status,\n }\n callback = callbacks.get(action)\n if callback is None:\n return JSONResponse(content={\"status\": \"error\", \"detail\": f\"unsupported action: {action}\"}, status_code=404)\n action_timeout = max(float(self._timeout), 10.0) if action in {\"start\", \"stop\"} else float(self._timeout)\n try:\n detail = await asyncio.wait_for(callback(), timeout=action_timeout)\n except asyncio.TimeoutError:\n return JSONResponse(\n content={\"status\": \"accepted\", \"detail\": f\"{action} operation is still in progress\"},\n status_code=202,\n )\n except Exception as exc:\n return JSONResponse(content={\"status\": \"error\", \"detail\": str(exc)}, status_code=500)\n return JSONResponse(content={\"status\": \"ok\", \"detail\": detail or f\"{action} action accepted\"}, status_code=200)", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/http_channel.py:HttpControlChannel", - "span_start": 12, - "span_end": 57, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.http_channel", - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "llm_answer": "## Объяснение работы класса `HttpControlChannel`\n\n### Назначение\nКласс `HttpControlChannel` является компонентом системы управления состоянием и взаимодействия с внешним миром через HTTP-протокол. Он реализует механизм обмена данными и состояниями между компонентами приложения через HTTP-запросы и ответы.\n\n### Ключевые зависимости\nКлючевыми зависимостями являются:\n- `UvicornThreadRunner`: используется для запуска асинхронного сервера на основе библиотеки Uvicorn.\n- `HttpControlAppFactory`: фабрика приложений, которая отвечает за создание экземпляров FastAPI приложения.\n- `ControlActionSet`: набор действий, связанных с управлением состоянием и поведением приложения.\n\n### Поток данных или вызовов\nПоток данных и вызовов выглядит следующим образом:\n1. **Инициализация (`__init__`)**:\n - При создании экземпляра класса задаются параметры хоста, порта и тайм-аута.\n - Создается объект `UvicornThreadRunner`, отвечающий за запуск асинхронного HTTP-сервера.\n - Создается экземпляр фабрики приложений `HttpControlAppFactory`.\n \n2. **Запуск (`start`)**:\n - Если заданы действия (`ControlActionSet`), создается экземпляр FastAPI приложения, включающего обработчики для health и action запросов.\n - Запускается сервер при помощи объекта `UvicornThreadRunner`.\n\n3. **Остановка (`stop`)**:\n - Остановка запущенного сервера при помощи метода `stop()` объекта `UvicornThreadRunner`.\n\n4. **Получение статуса порта (`port`)**:\n - Возвращает порт, на котором запущен сервер.\n\n5. **Health-запрос (`_health_response`)**:\n - Проверяет наличие настроенных действий и возвращает статус здоровья приложения.\n\n6. **Action-запрос (`_action_response`)**:\n - Обрабатывает запросы действий, проверяя их конфигурацию и возвращая соответствующий результат.\n\n### Важные детали реализации\n- **Таймаут (`_timeout`)**: устанавливается при инициализации и используется в методах проверки состояния здоровья и выполнения действий.\n- **Actions (`_actions`)**: набор доступных действий, определяющий функциональность приложения.\n- **FastAPI приложение**: строится динамически при каждом вызове метода `start`, что позволяет настраивать его под конкретные задачи.\n \n### Осторожные выводы\nНа основании текущего контекста сложно однозначно утверждать, какие именно данные передаются по HTTP-протоколу, так как контекст сигнализирует о возможности работы с различными типами данных, но детальной информации об этом нет.\n\n### Итоговое объяснение\nКласс `HttpControlChannel` предназначен для организации управления состоянием и взаимодействия с приложением через HTTP-интерфейс. Он использует библиотеку Uvicorn для создания асинхронного HTTP-сервера и FastAPI для построения прикладных сервисов. Класс управляет жизненным циклом сервера, отслеживает доступные действия и предоставляет методы для получения статуса здоровья и выполнения пользовательских операций.", - "summary": { - "router": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "confidence": null - }, - "retrieval": { - "profile": "code", - "layers_hit": [ - "C0_SOURCE_CHUNKS", - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS", - "C4_SEMANTIC_ROLES" - ], - "evidence_sufficient": true - }, - "llm": { - "answer_status": "answered", - "groundedness": "grounded" - } - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "HttpControlChannel" - ], - "keyword_hints": [ - "HttpControlChannel" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C0_SOURCE_CHUNKS": "exact_path_fetch", - "C4_SEMANTIC_ROLES": "exact_path_fetch", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C3_ENTRYPOINTS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 8, - "C4_SEMANTIC_ROLES": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C3_ENTRYPOINTS": 6 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C4_SEMANTIC_ROLES": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "HttpControlChannel", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "HttpControlChannel", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C4_SEMANTIC_ROLES", - "query": "HttpControlChannel", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "HttpControlChannel", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - }, - { - "layer": "C3_ENTRYPOINTS", - "query": "HttpControlChannel", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 1, - "candidates_after_filter": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 6, - "candidates_after_filter": 6 - }, - { - "layer": "C3_ENTRYPOINTS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 3, - "candidates_after_filter": 3 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "HttpControlChannel", - "alternatives": [ - "HttpControlChannel" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C4_SEMANTIC_ROLES", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 6, - "fail_reason": null - }, - { - "layer": "C3_ENTRYPOINTS", - "status": "hit", - "hit_count": 3, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "router": 1, - "symbol_resolution": 0, - "retrieval_total": 161, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 49, - "C0_SOURCE_CHUNKS": 24, - "C4_SEMANTIC_ROLES": 18, - "C2_DEPENDENCY_GRAPH": 55, - "C3_ENTRYPOINTS": 13 - }, - "merge_rank": 20, - "prompt_build": 0, - "llm_call": 4496 - }, - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 795, - "evidence_rows": 12, - "evidence_chars": 3028 - }, - "evidence_summary": [ - { - "layer": "C1_SYMBOL_CATALOG", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "count": 6, - "unique_paths": 1 - }, - { - "layer": "C3_ENTRYPOINTS", - "count": 3, - "unique_paths": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 1, - "unique_paths": 1 - } - ], - "prompt_template_id": "intent_code_qa_explain_ru_v1", - "system_prompt_version": "v1" - }, - "router": { - "conversation_mode": "START", - "keyword_hints": [ - "HttpControlChannel" - ], - "path_scope": [] - }, - "llm": { - "used_evidence_count": 12, - "missing_evidence_reason": null - } - }, - "run_info": { - "case_id": "plba-fullchain-explain-http-control-channel", - "mode": "full_chain", - "run_started_at": "2026-03-12T11:21:59", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - }, - "input_request": { - "text": "Объясни класс HttpControlChannel", - "normalized_query": "Объясни класс HttpControlChannel" - }, - "steps": [ - { - "step": "intent_router", - "input": { - "query": "Объясни класс HttpControlChannel" - }, - "output": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Объясни класс HttpControlChannel" - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "HttpControlChannel" - ], - "keyword_hints": [ - "HttpControlChannel" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "timings_ms": { - "router": 1 - } - } - }, - { - "step": "retrieval", - "input": { - "query": "Объясни класс HttpControlChannel" - }, - "output": { - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "HttpControlChannel", - "alternatives": [ - "HttpControlChannel" - ], - "confidence": 0.99 - }, - "rag_count": 12, - "rag_rows": [ - { - "path": "src/app_runtime/control/http_channel.py", - "content": "class HttpControlChannel\nHttpControlChannel(ControlChannel)", - "layer": "C1_SYMBOL_CATALOG", - "title": "HttpControlChannel", - "span_start": 12, - "span_end": 57, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "1c9fbdc24819e5604c26ea55428a74310f03a03e1af197ed84846af61e42fdb0", - "qname": "HttpControlChannel", - "kind": "class", - "signature": "HttpControlChannel(ControlChannel)", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.control.http_channel", - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (10)", - "layer": "C4_SEMANTIC_ROLES", - "title": "HttpControlChannel", - "span_start": 12, - "span_end": 57, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 21, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "1c9fbdc24819e5604c26ea55428a74310f03a03e1af197ed84846af61e42fdb0", - "symbol_name": "HttpControlChannel", - "qname": "HttpControlChannel", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 10, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel.__init__\n -> HttpControlChannel._runner\n -> HttpControlChannel.start", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "HttpControlChannel.__init__:dataflow_slice", - "span_start": 15, - "span_end": 22, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "51d73913df709152258ed1b9a8c8f4eb3c575eccfe6b982aef0b28e0789a29da", - "edge_type": "dataflow_slice", - "src_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "src_qname": "HttpControlChannel.__init__", - "dst_symbol_id": "d1933f04137f52535b6525f1b93ff2cd83bfb216b480e887e791ed1714cda8e0", - "dst_ref": "HttpControlChannel.start", - "resolution": "resolved", - "slice_id": "51d73913df709152258ed1b9a8c8f4eb3c575eccfe6b982aef0b28e0789a29da", - "root_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "path_symbols": [ - "HttpControlChannel.__init__", - "HttpControlChannel._runner", - "HttpControlChannel.start" - ], - "path_symbol_ids": [ - "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "d1933f04137f52535b6525f1b93ff2cd83bfb216b480e887e791ed1714cda8e0" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel.__init__\n -> HttpControlChannel._runner\n -> HttpControlChannel.port", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "HttpControlChannel.__init__:dataflow_slice", - "span_start": 15, - "span_end": 29, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "c7167bab7218bb768ad7c11bfb40d1a3096e6071dd7817bba5fd864cf8f6de13", - "edge_type": "dataflow_slice", - "src_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "src_qname": "HttpControlChannel.__init__", - "dst_symbol_id": "3632ce8227f4a31e0768f2fb021a4d1ba28e1202633aa0f2fac902295931280f", - "dst_ref": "HttpControlChannel.port", - "resolution": "resolved", - "slice_id": "c7167bab7218bb768ad7c11bfb40d1a3096e6071dd7817bba5fd864cf8f6de13", - "root_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "path_symbols": [ - "HttpControlChannel.__init__", - "HttpControlChannel._runner", - "HttpControlChannel.port" - ], - "path_symbol_ids": [ - "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "3632ce8227f4a31e0768f2fb021a4d1ba28e1202633aa0f2fac902295931280f" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel.__init__\n -> HttpControlChannel._timeout\n -> HttpControlChannel._health_response", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "HttpControlChannel.__init__:dataflow_slice", - "span_start": 14, - "span_end": 34, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "f858f5c9e575f6c4cdfe3853571b7ee21d1f628a443541d2037c3dc9d0790bef", - "edge_type": "dataflow_slice", - "src_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "src_qname": "HttpControlChannel.__init__", - "dst_symbol_id": "e84bf04e9cd2127df235b7064d05f47e19f19a89c7c82f4c247231d4e8fa426a", - "dst_ref": "HttpControlChannel._health_response", - "resolution": "resolved", - "slice_id": "f858f5c9e575f6c4cdfe3853571b7ee21d1f628a443541d2037c3dc9d0790bef", - "root_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "path_symbols": [ - "HttpControlChannel.__init__", - "HttpControlChannel._timeout", - "HttpControlChannel._health_response" - ], - "path_symbol_ids": [ - "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "e84bf04e9cd2127df235b7064d05f47e19f19a89c7c82f4c247231d4e8fa426a" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel.__init__\n -> HttpControlChannel._timeout\n -> HttpControlChannel._action_response", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "HttpControlChannel.__init__:dataflow_slice", - "span_start": 14, - "span_end": 47, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "c3ef21fcae96c82c00be74b3ab827d4af2085d89cb3fa5521c19a174aad84dbb", - "edge_type": "dataflow_slice", - "src_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "src_qname": "HttpControlChannel.__init__", - "dst_symbol_id": "e64969024ccaeb34d8d91473fad07b3b3d341875846392e7a006406c7ada1954", - "dst_ref": "HttpControlChannel._action_response", - "resolution": "resolved", - "slice_id": "c3ef21fcae96c82c00be74b3ab827d4af2085d89cb3fa5521c19a174aad84dbb", - "root_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "path_symbols": [ - "HttpControlChannel.__init__", - "HttpControlChannel._timeout", - "HttpControlChannel._action_response" - ], - "path_symbol_ids": [ - "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "e64969024ccaeb34d8d91473fad07b3b3d341875846392e7a006406c7ada1954" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel.__init__\n -> HttpControlChannel._runner\n -> HttpControlChannel.stop", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "HttpControlChannel.__init__:dataflow_slice", - "span_start": 15, - "span_end": 25, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "0f827ef81a990258a8a74381c8564a8361afa6712dba3200592659c939adcb9d", - "edge_type": "dataflow_slice", - "src_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "src_qname": "HttpControlChannel.__init__", - "dst_symbol_id": "f29ab212620093d72be20e26c5a399624c7939a6056a728762ed3f84a250bfa3", - "dst_ref": "HttpControlChannel.stop", - "resolution": "resolved", - "slice_id": "0f827ef81a990258a8a74381c8564a8361afa6712dba3200592659c939adcb9d", - "root_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "path_symbols": [ - "HttpControlChannel.__init__", - "HttpControlChannel._runner", - "HttpControlChannel.stop" - ], - "path_symbol_ids": [ - "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "f29ab212620093d72be20e26c5a399624c7939a6056a728762ed3f84a250bfa3" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel.__init__\n -> HttpControlChannel._factory\n -> HttpControlChannel.start", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "HttpControlChannel.__init__:dataflow_slice", - "span_start": 16, - "span_end": 21, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e61ec25ded7dbe380d95ce2abcbc1d7a2d2afde5aa8453866df8706dfb7d6ddb", - "edge_type": "dataflow_slice", - "src_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "src_qname": "HttpControlChannel.__init__", - "dst_symbol_id": "d1933f04137f52535b6525f1b93ff2cd83bfb216b480e887e791ed1714cda8e0", - "dst_ref": "HttpControlChannel.start", - "resolution": "resolved", - "slice_id": "e61ec25ded7dbe380d95ce2abcbc1d7a2d2afde5aa8453866df8706dfb7d6ddb", - "root_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "path_symbols": [ - "HttpControlChannel.__init__", - "HttpControlChannel._factory", - "HttpControlChannel.start" - ], - "path_symbol_ids": [ - "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "d1933f04137f52535b6525f1b93ff2cd83bfb216b480e887e791ed1714cda8e0" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "class HttpControlChannel(ControlChannel):\n def __init__(self, host: str, port: int, timeout: int) -> None:\n self._timeout = timeout\n self._runner = UvicornThreadRunner(host, port, timeout)\n self._factory = HttpControlAppFactory()\n self._actions: ControlActionSet | None = None\n\n async def start(self, actions: ControlActionSet) -> None:\n self._actions = actions\n app = self._factory.create(self._health_response, self._action_response)\n await self._runner.start(app)\n\n async def stop(self) -> None:\n await self._runner.stop()\n\n @property\n def port(self) -> int:\n return self._runner.port\n\n async def _health_response(self) -> dict[str, object]:\n if self._actions is None:\n return {\"status\": \"unhealthy\", \"detail\": \"control actions are not configured\"}\n return await asyncio.wait_for(self._actions.health(), timeout=float(self._timeout))\n\n async def _action_response(self, action: str, _client_source: str = \"unknown\") -> JSONResponse:\n if self._actions is None:\n return JSONResponse(content={\"status\": \"error\", \"detail\": f\"{action} handler is not configured\"}, status_code=404)\n callbacks = {\n \"start\": self._actions.start,\n \"stop\": self._actions.stop,\n \"status\": self._actions.status,\n }\n callback = callbacks.get(action)\n if callback is None:\n return JSONResponse(content={\"status\": \"error\", \"detail\": f\"unsupported action: {action}\"}, status_code=404)\n action_timeout = max(float(self._timeout), 10.0) if action in {\"start\", \"stop\"} else float(self._timeout)\n try:\n detail = await asyncio.wait_for(callback(), timeout=action_timeout)\n except asyncio.TimeoutError:\n return JSONResponse(\n content={\"status\": \"accepted\", \"detail\": f\"{action} operation is still in progress\"},\n status_code=202,\n )\n except Exception as exc:\n return JSONResponse(content={\"status\": \"error\", \"detail\": str(exc)}, status_code=500)\n return JSONResponse(content={\"status\": \"ok\", \"detail\": detail or f\"{action} action accepted\"}, status_code=200)", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/http_channel.py:HttpControlChannel", - "span_start": 12, - "span_end": 57, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.http_channel", - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ] - }, - "diagnostics": { - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C0_SOURCE_CHUNKS": "exact_path_fetch", - "C4_SEMANTIC_ROLES": "exact_path_fetch", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C3_ENTRYPOINTS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 8, - "C4_SEMANTIC_ROLES": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C3_ENTRYPOINTS": 6 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C4_SEMANTIC_ROLES": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "HttpControlChannel", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "HttpControlChannel", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C4_SEMANTIC_ROLES", - "query": "HttpControlChannel", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "HttpControlChannel", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - }, - { - "layer": "C3_ENTRYPOINTS", - "query": "HttpControlChannel", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 1, - "candidates_after_filter": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 6, - "candidates_after_filter": 6 - }, - { - "layer": "C3_ENTRYPOINTS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 3, - "candidates_after_filter": 3 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "HttpControlChannel", - "alternatives": [ - "HttpControlChannel" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C4_SEMANTIC_ROLES", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 6, - "fail_reason": null - }, - { - "layer": "C3_ENTRYPOINTS", - "status": "hit", - "hit_count": 3, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "symbol_resolution": 0, - "retrieval_total": 161, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 49, - "C0_SOURCE_CHUNKS": 24, - "C4_SEMANTIC_ROLES": 18, - "C2_DEPENDENCY_GRAPH": 55, - "C3_ENTRYPOINTS": 13 - }, - "merge_rank": 20 - } - } - }, - { - "step": "llm_answer", - "input": { - "query": "Объясни класс HttpControlChannel", - "rag_count": 12 - }, - "output": { - "llm_answer": "## Объяснение работы класса `HttpControlChannel`\n\n### Назначение\nКласс `HttpControlChannel` является компонентом системы управления состоянием и взаимодействия с внешним миром через HTTP-протокол. Он реализует механизм обмена данными и состояниями между компонентами приложения через HTTP-запросы и ответы.\n\n### Ключевые зависимости\nКлючевыми зависимостями являются:\n- `UvicornThreadRunner`: используется для запуска асинхронного сервера на основе библиотеки Uvicorn.\n- `HttpControlAppFactory`: фабрика приложений, которая отвечает за создание экземпляров FastAPI приложения.\n- `ControlActionSet`: набор действий, связанных с управлением состоянием и поведением приложения.\n\n### Поток данных или вызовов\nПоток данных и вызовов выглядит следующим образом:\n1. **Инициализация (`__init__`)**:\n - При создании экземпляра класса задаются параметры хоста, порта и тайм-аута.\n - Создается объект `UvicornThreadRunner`, отвечающий за запуск асинхронного HTTP-сервера.\n - Создается экземпляр фабрики приложений `HttpControlAppFactory`.\n \n2. **Запуск (`start`)**:\n - Если заданы действия (`ControlActionSet`), создается экземпляр FastAPI приложения, включающего обработчики для health и action запросов.\n - Запускается сервер при помощи объекта `UvicornThreadRunner`.\n\n3. **Остановка (`stop`)**:\n - Остановка запущенного сервера при помощи метода `stop()` объекта `UvicornThreadRunner`.\n\n4. **Получение статуса порта (`port`)**:\n - Возвращает порт, на котором запущен сервер.\n\n5. **Health-запрос (`_health_response`)**:\n - Проверяет наличие настроенных действий и возвращает статус здоровья приложения.\n\n6. **Action-запрос (`_action_response`)**:\n - Обрабатывает запросы действий, проверяя их конфигурацию и возвращая соответствующий результат.\n\n### Важные детали реализации\n- **Таймаут (`_timeout`)**: устанавливается при инициализации и используется в методах проверки состояния здоровья и выполнения действий.\n- **Actions (`_actions`)**: набор доступных действий, определяющий функциональность приложения.\n- **FastAPI приложение**: строится динамически при каждом вызове метода `start`, что позволяет настраивать его под конкретные задачи.\n \n### Осторожные выводы\nНа основании текущего контекста сложно однозначно утверждать, какие именно данные передаются по HTTP-протоколу, так как контекст сигнализирует о возможности работы с различными типами данных, но детальной информации об этом нет.\n\n### Итоговое объяснение\nКласс `HttpControlChannel` предназначен для организации управления состоянием и взаимодействия с приложением через HTTP-интерфейс. Он использует библиотеку Uvicorn для создания асинхронного HTTP-сервера и FastAPI для построения прикладных сервисов. Класс управляет жизненным циклом сервера, отслеживает доступные действия и предоставляет методы для получения статуса здоровья и выполнения пользовательских операций." - }, - "diagnostics": { - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 795, - "evidence_rows": 12, - "evidence_chars": 3028 - }, - "evidence_summary": [ - { - "layer": "C1_SYMBOL_CATALOG", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "count": 6, - "unique_paths": 1 - }, - { - "layer": "C3_ENTRYPOINTS", - "count": 3, - "unique_paths": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 1, - "unique_paths": 1 - } - ], - "prompt_template_id": "intent_code_qa_explain_ru_v1", - "system_prompt_version": "v1" - }, - "timings_ms": { - "prompt_build": 0, - "llm_call": 4496 - } - } - } - ] - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_112158/full_chain_plba_code_retrieval_plba-fullchain-explain-http-control-channel.md b/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_112158/full_chain_plba_code_retrieval_plba-fullchain-explain-http-control-channel.md deleted file mode 100644 index 9255292..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_112158/full_chain_plba_code_retrieval_plba-fullchain-explain-http-control-channel.md +++ /dev/null @@ -1,34 +0,0 @@ -# plba-fullchain-explain-http-control-channel - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_retrieval.yaml -- runner: runtime -- mode: full_chain -- passed: True - -## Query -Объясни класс HttpControlChannel - -## Actual -{ - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 12, - "llm_answer": "## Объяснение работы класса `HttpControlChannel`\n\n### Назначение\nКласс `HttpControlChannel` является компонентом системы управления состоянием и взаимодействия с внешним миром через HTTP-протокол. Он реализует механизм обмена данными и состояниями между компонентами приложения через HTTP-запросы и ответы.\n\n### Ключевые зависимости\nКлючевыми зависимостями являются:\n- `UvicornThreadRunner`: используется для запуска асинхронного сервера на основе библиотеки Uvicorn.\n- `HttpControlAppFactory`: фабрика приложений, которая отвечает за создание экземпляров FastAPI приложения.\n- `ControlActionSet`: набор действий, связанных с управлением состоянием и поведением приложения.\n\n### Поток данных или вызовов\nПоток данных и вызовов выглядит следующим образом:\n1. **Инициализация (`__init__`)**:\n - При создании экземпляра класса задаются параметры хоста, порта и тайм-аута.\n - Создается объект `UvicornThreadRunner`, отвечающий за запуск асинхронного HTTP-сервера.\n - Создается экземпляр фабрики приложений `HttpControlAppFactory`.\n \n2. **Запуск (`start`)**:\n - Если заданы действия (`ControlActionSet`), создается экземпляр FastAPI приложения, включающего обработчики для health и action запросов.\n - Запускается сервер при помощи объекта `UvicornThreadRunner`.\n\n3. **Остановка (`stop`)**:\n - Остановка запущенного сервера при помощи метода `stop()` объекта `UvicornThreadRunner`.\n\n4. **Получение статуса порта (`port`)**:\n - Возвращает порт, на котором запущен сервер.\n\n5. **Health-запрос (`_health_response`)**:\n - Проверяет наличие настроенных действий и возвращает статус здоровья приложения.\n\n6. **Action-запрос (`_action_response`)**:\n - Обрабатывает запросы действий, проверяя их конфигурацию и возвращая соответствующий результат.\n\n### Важные детали реализации\n- **Таймаут (`_timeout`)**: устанавливается при инициализации и используется в методах проверки состояния здоровья и выполнения действий.\n- **Actions (`_actions`)**: набор доступных действий, определяющий функциональность приложения.\n- **FastAPI приложение**: строится динамически при каждом вызове метода `start`, что позволяет настраивать его под конкретные задачи.\n \n### Осторожные выводы\nНа основании текущего контекста сложно однозначно утверждать, какие именно данные передаются по HTTP-протоколу, так как контекст сигнализирует о возможности работы с различными типами данных, но детальной информации об этом нет.\n\n### Итоговое объяснение\nКласс `HttpControlChannel` предназначен для организации управления состоянием и взаимодействия с приложением через HTTP-интерфейс. Он использует библиотеку Uvicorn для создания асинхронного HTTP-сервера и FastAPI для построения прикладных сервисов. Класс управляет жизненным циклом сервера, отслеживает доступные действия и предоставляет методы для получения статуса здоровья и выполнения пользовательских операций.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "HttpControlChannel" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] -} - -## Mismatches -- none \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_112158/full_chain_plba_code_retrieval_plba-fullchain-explain-runtime-manager.json b/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_112158/full_chain_plba_code_retrieval_plba-fullchain-explain-runtime-manager.json deleted file mode 100644 index d265c26..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_112158/full_chain_plba_code_retrieval_plba-fullchain-explain-runtime-manager.json +++ /dev/null @@ -1,2088 +0,0 @@ -{ - "case_id": "plba-fullchain-explain-runtime-manager", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_retrieval.yaml", - "runner": "runtime", - "mode": "full_chain", - "actual": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 12, - "llm_answer": "## Назначение класса `RuntimeManager`\nКласс `RuntimeManager` предназначен для управления жизненным циклом приложения и координации различных компонентов системы во время выполнения. Он играет роль менеджера процессов и отвечает за управление состоянием приложения, регистрацию сервисов и координацию работы рабочих потоков (`workers`).\n\n## Ключевые зависимости\n- **ConfigurationManager**: Менеджер конфигурации, используется для загрузки настроек приложения.\n- **ServiceContainer**: Контейнер сервисов, содержащий различные сервисы и модули приложения.\n- **TraceService**: Сервис трассировки, собирает информацию о выполнении запросов и событиях.\n- **HealthRegistry**: Регистратор состояния здоровья системы, отслеживает состояние различных модулей и сервисов.\n- **LogManager**: Менеджер логирования, регистрирует события и ошибки.\n- **WorkerSupervisor**: Наблюдатель за рабочими процессами, управляет запуском и остановкой рабочих потоков.\n- **ControlPlaneService**: Управляет основной логикой взаимодействия с внешним миром и сервисами.\n\n## Поток данных или вызовов\nПри инициализации объекта класса `RuntimeManager`, вызывается метод `__init__`. В этом методе происходит инициализация всех указанных параметров и настройка начальных значений атрибутов экземпляра:\n\n```python\ndef __init__(self, ...):\n # Инициализация переменных и атрибутов\n self.configuration = ...\n self.services = ...\n self.traces = ...\n self.health = ...\n self.logs = ...\n self.workers = ...\n self.control_plane = ...\n \n # Другие действия по настройке и регистрации сервисов\n```\n\nПосле этого начинается регистрация сервисов и их модулей при помощи метода `_register_core_services`.\n\n### Важные детали реализации\n- Класс поддерживает управление несколькими основными состояниями жизненного цикла приложения через атрибуты `_state` и соответствующие методы:\n - `LifecycleState.IDLE`: начальное состояние перед началом работы.\n - `LifecycleState.STARTED`: активное состояние после начала работы.\n - `LifecycleState.FAILED`: состояние после возникновения ошибки.\n \n- При создании экземпляра класса вызываются функции `_register_core_services`, которые отвечают за подключение основных модулей и сервисов.\n\n- Метод `register_module(module)` позволяет динамически регистрировать новые модули и расширять функциональность приложения.\n\n### Осторожные выводы\nНа основе косвенных признаков можно предположить, что реализация использует механизм модульной архитектуры и разделяет логику на несколько уровней абстракции, где каждый уровень соответствует определённой части функциональности (например, конфигурация, мониторинг, контроль и рабочие процессы). Однако более детальная информация требует дополнительного анализа исходного кода.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "RuntimeManager" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "passed": true, - "mismatches": [], - "details": { - "case_id": "plba-fullchain-explain-runtime-manager", - "text": "Объясни как работает класс RuntimeManager", - "mode": "full_chain", - "run_started_at": "2026-03-12T11:21:59", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Объясни как работает класс RuntimeManager", - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "RuntimeManager", - "alternatives": [ - "RuntimeManager" - ], - "confidence": 0.99 - }, - "rag_count": 12, - "rag_rows": [ - { - "path": "src/app_runtime/core/runtime.py", - "content": "class RuntimeManager\nRuntimeManager", - "layer": "C1_SYMBOL_CATALOG", - "title": "RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "7e4a9381328c5803bbc6179458612fc4e947d928aa7bf8b4b2bebb2c8592f758", - "qname": "RuntimeManager", - "kind": "class", - "signature": "RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.core.runtime", - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests manager\n- orchestrates role-like calls (4)\n- reads and writes state attributes\n- participates in dataflow slices (50)", - "layer": "C4_SEMANTIC_ROLES", - "title": "RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 43, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "7e4a9381328c5803bbc6179458612fc4e947d928aa7bf8b4b2bebb2c8592f758", - "symbol_name": "RuntimeManager", - "qname": "RuntimeManager", - "role": "pipeline_stage", - "confidence": 0.67, - "dataflow_participation": 50, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.stop", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 25, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d", - "dst_ref": "ControlPlaneService.stop", - "resolution": "resolved", - "slice_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.stop" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._stop_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 51, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a", - "dst_ref": "ControlPlaneService._stop_async", - "resolution": "resolved", - "slice_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._stop_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.register_channel", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 17, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957", - "dst_ref": "ControlPlaneService.register_channel", - "resolution": "resolved", - "slice_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.register_channel" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.start", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 20, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154", - "dst_ref": "ControlPlaneService.start", - "resolution": "resolved", - "slice_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.start" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._start_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 47, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517", - "dst_ref": "ControlPlaneService._start_async", - "resolution": "resolved", - "slice_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._start_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager.add_config_file", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 32, - "span_end": 52, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "a23b8a11ebdb12708b60c96ea12a69f7f042082f1adfddd572444e246d81d167", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "57ffbd4f0d9fdf3507c2b8624312ce211f3d02fdf86a57a8ec90778d8a7b498d", - "dst_ref": "RuntimeManager.add_config_file", - "resolution": "resolved", - "slice_id": "a23b8a11ebdb12708b60c96ea12a69f7f042082f1adfddd572444e246d81d167", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager.add_config_file" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "57ffbd4f0d9fdf3507c2b8624312ce211f3d02fdf86a57a8ec90778d8a7b498d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "class RuntimeManager:\n ACTION_TIMEOUT_SECONDS = 10.0\n ACTION_POLL_INTERVAL_SECONDS = 0.05\n\n def __init__(\n self,\n configuration: ConfigurationManager | None = None,\n services: ServiceContainer | None = None,\n traces: TraceService | None = None,\n health: HealthRegistry | None = None,\n logs: LogManager | None = None,\n workers: WorkerSupervisor | None = None,\n control_plane: ControlPlaneService | None = None,\n ) -> None:\n self.configuration = configuration or ConfigurationManager()\n self.services = services or ServiceContainer()\n self.traces = traces or TraceService()\n self.health = health or HealthRegistry()\n self.logs = logs or LogManager()\n self.workers = workers or WorkerSupervisor()\n self.control_plane = control_plane or ControlPlaneService()\n self.registry = ModuleRegistry(self.services)\n self._started = False\n self._state = LifecycleState.IDLE\n self._core_registered = False\n self._workers_registered = False\n self._register_core_services()\n\n def register_module(self, module: ApplicationModule) -> None:\n self.registry.register_module(module.name)\n module.register(self.registry)\n\n def add_config_file(self, path: str) -> FileConfigProvider:\n provider = FileConfigProvider(path)\n self.configuration.add_provider(provider)\n return provider\n\n def start(self, *, start_control_plane: bool = True) -> None:\n if self._started:\n return\n self._state = LifecycleState.STARTING\n config = self.configuration.load()\n self.logs.apply_config(config)\n self._register_health_contributors()\n self._register_workers()\n self.workers.start()\n if start_control_plane:\n self.control_plane.start(self)\n self._started = True\n self._refresh_state()\n\n def stop(self, timeout: float = 30.0, force: bool = False, stop_control_plane: bool = True) -> None:\n if not self._started:\n return\n self._state = LifecycleState.STOPPING\n self.workers.stop(timeout=timeout, force=force)\n if stop_control_plane:\n self.control_plane.stop()\n self._started = False\n self._state = LifecycleState.STOPPED\n\n def status(self) -> dict[str, object]:\n self._refresh_state()\n return self.control_plane.snapshot(self)\n\n def current_health(self) -> HealthPayload:\n self._refresh_state()\n return self.health.payload(self._state, self.workers.healths())\n\n async def health_status(self) -> HealthPayload:\n return self.current_health()\n\n async def start_runtime(self) -> dict[str, object] | str:\n self._refresh_state()\n if self._started:\n return \"runtime already running\"\n if self._state == LifecycleState.STOPPING:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n\n self.start(start_control_plane=False)\n started = self._wait_for_state({LifecycleState.IDLE, LifecycleState.BUSY}, timeout=self.ACTION_TIMEOUT_SECONDS)\n if started:\n return self._action_detail(\"runtime started\", timed_out=False)\n return self._action_detail(\"runtime start is still in progress\", timed_out=True)\n\n async def stop_runtime(self) -> dict[str, object] | str:\n self._refresh_state()\n if not self._started:\n if self._state == LifecycleState.STOPPING:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n return \"runtime already stopped\"\n\n self._state = LifecycleState.STOPPING\n try:\n self.workers.stop(timeout=self.ACTION_TIMEOUT_SECONDS, force=False)\n except TimeoutError:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n\n self._started = False\n self._state = LifecycleState.STOPPED\n return self._action_detail(\"runtime stopped\", timed_out=False)\n\n async def runtime_status(self) -> str:\n self._refresh_state()\n return self._state.value\n\n def _register_core_services(self) -> None:\n if self._core_registered:\n return\n self.services.register(\"configuration\", self.configuration)\n self.services.register(\"traces\", self.traces)\n self.services.register(\"health\", self.health)\n self.services.register(\"logs\", self.logs)\n self.services.register(\"workers\", self.workers)\n self.services.register(\"control_plane\", self.control_plane)\n self._core_registered = True\n\n def _register_health_contributors(self) -> None:\n for contributor in self.registry.health_contributors:\n self.health.register(contributor)\n\n def _register_workers(self) -> None:\n if self._workers_registered:\n return\n for worker in self.registry.workers:\n self.workers.register(worker)\n self._workers_registered = True\n\n def _refresh_state(self) -> None:\n lifecycle = self.workers.lifecycle_state()\n\n if self._state == LifecycleState.STOPPING:\n if lifecycle == LifecycleState.STOPPED:\n self._started = False\n self._state = LifecycleState.STOPPED\n return\n\n if not self._started:\n if lifecycle == LifecycleState.STOPPED:\n self._state = LifecycleState.STOPPED\n return\n\n self._state = lifecycle\n\n def _wait_for_state(self, target_states: set[LifecycleState], *, timeout: float) -> bool:\n deadline = monotonic() + timeout\n while monotonic() < deadline:\n self._refresh_state()\n if self._state in target_states:\n return True\n sleep(self.ACTION_POLL_INTERVAL_SECONDS)\n self._refresh_state()\n return self._state in target_states\n\n def _action_detail(self, message: str, *, timed_out: bool) -> dict[str, object]:\n self._refresh_state()\n return {\n \"message\": message,\n \"state\": self._state.value,\n \"timed_out\": timed_out,\n \"workers\": self.workers.snapshot(),\n }", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/core/runtime.py:RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.core.runtime", - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "llm_answer": "## Назначение класса `RuntimeManager`\nКласс `RuntimeManager` предназначен для управления жизненным циклом приложения и координации различных компонентов системы во время выполнения. Он играет роль менеджера процессов и отвечает за управление состоянием приложения, регистрацию сервисов и координацию работы рабочих потоков (`workers`).\n\n## Ключевые зависимости\n- **ConfigurationManager**: Менеджер конфигурации, используется для загрузки настроек приложения.\n- **ServiceContainer**: Контейнер сервисов, содержащий различные сервисы и модули приложения.\n- **TraceService**: Сервис трассировки, собирает информацию о выполнении запросов и событиях.\n- **HealthRegistry**: Регистратор состояния здоровья системы, отслеживает состояние различных модулей и сервисов.\n- **LogManager**: Менеджер логирования, регистрирует события и ошибки.\n- **WorkerSupervisor**: Наблюдатель за рабочими процессами, управляет запуском и остановкой рабочих потоков.\n- **ControlPlaneService**: Управляет основной логикой взаимодействия с внешним миром и сервисами.\n\n## Поток данных или вызовов\nПри инициализации объекта класса `RuntimeManager`, вызывается метод `__init__`. В этом методе происходит инициализация всех указанных параметров и настройка начальных значений атрибутов экземпляра:\n\n```python\ndef __init__(self, ...):\n # Инициализация переменных и атрибутов\n self.configuration = ...\n self.services = ...\n self.traces = ...\n self.health = ...\n self.logs = ...\n self.workers = ...\n self.control_plane = ...\n \n # Другие действия по настройке и регистрации сервисов\n```\n\nПосле этого начинается регистрация сервисов и их модулей при помощи метода `_register_core_services`.\n\n### Важные детали реализации\n- Класс поддерживает управление несколькими основными состояниями жизненного цикла приложения через атрибуты `_state` и соответствующие методы:\n - `LifecycleState.IDLE`: начальное состояние перед началом работы.\n - `LifecycleState.STARTED`: активное состояние после начала работы.\n - `LifecycleState.FAILED`: состояние после возникновения ошибки.\n \n- При создании экземпляра класса вызываются функции `_register_core_services`, которые отвечают за подключение основных модулей и сервисов.\n\n- Метод `register_module(module)` позволяет динамически регистрировать новые модули и расширять функциональность приложения.\n\n### Осторожные выводы\nНа основе косвенных признаков можно предположить, что реализация использует механизм модульной архитектуры и разделяет логику на несколько уровней абстракции, где каждый уровень соответствует определённой части функциональности (например, конфигурация, мониторинг, контроль и рабочие процессы). Однако более детальная информация требует дополнительного анализа исходного кода.", - "summary": { - "router": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "confidence": null - }, - "retrieval": { - "profile": "code", - "layers_hit": [ - "C0_SOURCE_CHUNKS", - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS", - "C4_SEMANTIC_ROLES" - ], - "evidence_sufficient": true - }, - "llm": { - "answer_status": "answered", - "groundedness": "grounded" - } - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "RuntimeManager" - ], - "keyword_hints": [ - "RuntimeManager" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C0_SOURCE_CHUNKS": "exact_path_fetch", - "C4_SEMANTIC_ROLES": "exact_path_fetch", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C3_ENTRYPOINTS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 8, - "C4_SEMANTIC_ROLES": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C3_ENTRYPOINTS": 6 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C4_SEMANTIC_ROLES": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C4_SEMANTIC_ROLES", - "query": "RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - }, - { - "layer": "C3_ENTRYPOINTS", - "query": "RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 1, - "candidates_after_filter": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 6, - "candidates_after_filter": 6 - }, - { - "layer": "C3_ENTRYPOINTS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 3, - "candidates_after_filter": 3 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "RuntimeManager", - "alternatives": [ - "RuntimeManager" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C4_SEMANTIC_ROLES", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 6, - "fail_reason": null - }, - { - "layer": "C3_ENTRYPOINTS", - "status": "hit", - "hit_count": 3, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "router": 1, - "symbol_resolution": 0, - "retrieval_total": 307, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 31, - "C0_SOURCE_CHUNKS": 15, - "C4_SEMANTIC_ROLES": 16, - "C2_DEPENDENCY_GRAPH": 59, - "C3_ENTRYPOINTS": 10 - }, - "merge_rank": 20, - "prompt_build": 0, - "llm_call": 3701 - }, - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 797, - "evidence_rows": 12, - "evidence_chars": 7130 - }, - "evidence_summary": [ - { - "layer": "C1_SYMBOL_CATALOG", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "count": 6, - "unique_paths": 2 - }, - { - "layer": "C3_ENTRYPOINTS", - "count": 3, - "unique_paths": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 1, - "unique_paths": 1 - } - ], - "prompt_template_id": "intent_code_qa_explain_ru_v1", - "system_prompt_version": "v1" - }, - "router": { - "conversation_mode": "START", - "keyword_hints": [ - "RuntimeManager" - ], - "path_scope": [] - }, - "llm": { - "used_evidence_count": 12, - "missing_evidence_reason": null - } - }, - "run_info": { - "case_id": "plba-fullchain-explain-runtime-manager", - "mode": "full_chain", - "run_started_at": "2026-03-12T11:21:59", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - }, - "input_request": { - "text": "Объясни как работает класс RuntimeManager", - "normalized_query": "Объясни как работает класс RuntimeManager" - }, - "steps": [ - { - "step": "intent_router", - "input": { - "query": "Объясни как работает класс RuntimeManager" - }, - "output": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Объясни как работает класс RuntimeManager" - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "RuntimeManager" - ], - "keyword_hints": [ - "RuntimeManager" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "timings_ms": { - "router": 1 - } - } - }, - { - "step": "retrieval", - "input": { - "query": "Объясни как работает класс RuntimeManager" - }, - "output": { - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "RuntimeManager", - "alternatives": [ - "RuntimeManager" - ], - "confidence": 0.99 - }, - "rag_count": 12, - "rag_rows": [ - { - "path": "src/app_runtime/core/runtime.py", - "content": "class RuntimeManager\nRuntimeManager", - "layer": "C1_SYMBOL_CATALOG", - "title": "RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "7e4a9381328c5803bbc6179458612fc4e947d928aa7bf8b4b2bebb2c8592f758", - "qname": "RuntimeManager", - "kind": "class", - "signature": "RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.core.runtime", - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests manager\n- orchestrates role-like calls (4)\n- reads and writes state attributes\n- participates in dataflow slices (50)", - "layer": "C4_SEMANTIC_ROLES", - "title": "RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 43, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "7e4a9381328c5803bbc6179458612fc4e947d928aa7bf8b4b2bebb2c8592f758", - "symbol_name": "RuntimeManager", - "qname": "RuntimeManager", - "role": "pipeline_stage", - "confidence": 0.67, - "dataflow_participation": 50, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.stop", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 25, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d", - "dst_ref": "ControlPlaneService.stop", - "resolution": "resolved", - "slice_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.stop" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._stop_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 51, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a", - "dst_ref": "ControlPlaneService._stop_async", - "resolution": "resolved", - "slice_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._stop_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.register_channel", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 17, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957", - "dst_ref": "ControlPlaneService.register_channel", - "resolution": "resolved", - "slice_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.register_channel" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.start", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 20, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154", - "dst_ref": "ControlPlaneService.start", - "resolution": "resolved", - "slice_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.start" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._start_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 47, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517", - "dst_ref": "ControlPlaneService._start_async", - "resolution": "resolved", - "slice_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._start_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager.add_config_file", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 32, - "span_end": 52, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "a23b8a11ebdb12708b60c96ea12a69f7f042082f1adfddd572444e246d81d167", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "57ffbd4f0d9fdf3507c2b8624312ce211f3d02fdf86a57a8ec90778d8a7b498d", - "dst_ref": "RuntimeManager.add_config_file", - "resolution": "resolved", - "slice_id": "a23b8a11ebdb12708b60c96ea12a69f7f042082f1adfddd572444e246d81d167", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager.add_config_file" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "57ffbd4f0d9fdf3507c2b8624312ce211f3d02fdf86a57a8ec90778d8a7b498d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "class RuntimeManager:\n ACTION_TIMEOUT_SECONDS = 10.0\n ACTION_POLL_INTERVAL_SECONDS = 0.05\n\n def __init__(\n self,\n configuration: ConfigurationManager | None = None,\n services: ServiceContainer | None = None,\n traces: TraceService | None = None,\n health: HealthRegistry | None = None,\n logs: LogManager | None = None,\n workers: WorkerSupervisor | None = None,\n control_plane: ControlPlaneService | None = None,\n ) -> None:\n self.configuration = configuration or ConfigurationManager()\n self.services = services or ServiceContainer()\n self.traces = traces or TraceService()\n self.health = health or HealthRegistry()\n self.logs = logs or LogManager()\n self.workers = workers or WorkerSupervisor()\n self.control_plane = control_plane or ControlPlaneService()\n self.registry = ModuleRegistry(self.services)\n self._started = False\n self._state = LifecycleState.IDLE\n self._core_registered = False\n self._workers_registered = False\n self._register_core_services()\n\n def register_module(self, module: ApplicationModule) -> None:\n self.registry.register_module(module.name)\n module.register(self.registry)\n\n def add_config_file(self, path: str) -> FileConfigProvider:\n provider = FileConfigProvider(path)\n self.configuration.add_provider(provider)\n return provider\n\n def start(self, *, start_control_plane: bool = True) -> None:\n if self._started:\n return\n self._state = LifecycleState.STARTING\n config = self.configuration.load()\n self.logs.apply_config(config)\n self._register_health_contributors()\n self._register_workers()\n self.workers.start()\n if start_control_plane:\n self.control_plane.start(self)\n self._started = True\n self._refresh_state()\n\n def stop(self, timeout: float = 30.0, force: bool = False, stop_control_plane: bool = True) -> None:\n if not self._started:\n return\n self._state = LifecycleState.STOPPING\n self.workers.stop(timeout=timeout, force=force)\n if stop_control_plane:\n self.control_plane.stop()\n self._started = False\n self._state = LifecycleState.STOPPED\n\n def status(self) -> dict[str, object]:\n self._refresh_state()\n return self.control_plane.snapshot(self)\n\n def current_health(self) -> HealthPayload:\n self._refresh_state()\n return self.health.payload(self._state, self.workers.healths())\n\n async def health_status(self) -> HealthPayload:\n return self.current_health()\n\n async def start_runtime(self) -> dict[str, object] | str:\n self._refresh_state()\n if self._started:\n return \"runtime already running\"\n if self._state == LifecycleState.STOPPING:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n\n self.start(start_control_plane=False)\n started = self._wait_for_state({LifecycleState.IDLE, LifecycleState.BUSY}, timeout=self.ACTION_TIMEOUT_SECONDS)\n if started:\n return self._action_detail(\"runtime started\", timed_out=False)\n return self._action_detail(\"runtime start is still in progress\", timed_out=True)\n\n async def stop_runtime(self) -> dict[str, object] | str:\n self._refresh_state()\n if not self._started:\n if self._state == LifecycleState.STOPPING:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n return \"runtime already stopped\"\n\n self._state = LifecycleState.STOPPING\n try:\n self.workers.stop(timeout=self.ACTION_TIMEOUT_SECONDS, force=False)\n except TimeoutError:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n\n self._started = False\n self._state = LifecycleState.STOPPED\n return self._action_detail(\"runtime stopped\", timed_out=False)\n\n async def runtime_status(self) -> str:\n self._refresh_state()\n return self._state.value\n\n def _register_core_services(self) -> None:\n if self._core_registered:\n return\n self.services.register(\"configuration\", self.configuration)\n self.services.register(\"traces\", self.traces)\n self.services.register(\"health\", self.health)\n self.services.register(\"logs\", self.logs)\n self.services.register(\"workers\", self.workers)\n self.services.register(\"control_plane\", self.control_plane)\n self._core_registered = True\n\n def _register_health_contributors(self) -> None:\n for contributor in self.registry.health_contributors:\n self.health.register(contributor)\n\n def _register_workers(self) -> None:\n if self._workers_registered:\n return\n for worker in self.registry.workers:\n self.workers.register(worker)\n self._workers_registered = True\n\n def _refresh_state(self) -> None:\n lifecycle = self.workers.lifecycle_state()\n\n if self._state == LifecycleState.STOPPING:\n if lifecycle == LifecycleState.STOPPED:\n self._started = False\n self._state = LifecycleState.STOPPED\n return\n\n if not self._started:\n if lifecycle == LifecycleState.STOPPED:\n self._state = LifecycleState.STOPPED\n return\n\n self._state = lifecycle\n\n def _wait_for_state(self, target_states: set[LifecycleState], *, timeout: float) -> bool:\n deadline = monotonic() + timeout\n while monotonic() < deadline:\n self._refresh_state()\n if self._state in target_states:\n return True\n sleep(self.ACTION_POLL_INTERVAL_SECONDS)\n self._refresh_state()\n return self._state in target_states\n\n def _action_detail(self, message: str, *, timed_out: bool) -> dict[str, object]:\n self._refresh_state()\n return {\n \"message\": message,\n \"state\": self._state.value,\n \"timed_out\": timed_out,\n \"workers\": self.workers.snapshot(),\n }", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/core/runtime.py:RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.core.runtime", - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ] - }, - "diagnostics": { - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C0_SOURCE_CHUNKS": "exact_path_fetch", - "C4_SEMANTIC_ROLES": "exact_path_fetch", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C3_ENTRYPOINTS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 8, - "C4_SEMANTIC_ROLES": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C3_ENTRYPOINTS": 6 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C4_SEMANTIC_ROLES": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C4_SEMANTIC_ROLES", - "query": "RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - }, - { - "layer": "C3_ENTRYPOINTS", - "query": "RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 1, - "candidates_after_filter": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 6, - "candidates_after_filter": 6 - }, - { - "layer": "C3_ENTRYPOINTS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 3, - "candidates_after_filter": 3 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "RuntimeManager", - "alternatives": [ - "RuntimeManager" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C4_SEMANTIC_ROLES", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 6, - "fail_reason": null - }, - { - "layer": "C3_ENTRYPOINTS", - "status": "hit", - "hit_count": 3, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "symbol_resolution": 0, - "retrieval_total": 307, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 31, - "C0_SOURCE_CHUNKS": 15, - "C4_SEMANTIC_ROLES": 16, - "C2_DEPENDENCY_GRAPH": 59, - "C3_ENTRYPOINTS": 10 - }, - "merge_rank": 20 - } - } - }, - { - "step": "llm_answer", - "input": { - "query": "Объясни как работает класс RuntimeManager", - "rag_count": 12 - }, - "output": { - "llm_answer": "## Назначение класса `RuntimeManager`\nКласс `RuntimeManager` предназначен для управления жизненным циклом приложения и координации различных компонентов системы во время выполнения. Он играет роль менеджера процессов и отвечает за управление состоянием приложения, регистрацию сервисов и координацию работы рабочих потоков (`workers`).\n\n## Ключевые зависимости\n- **ConfigurationManager**: Менеджер конфигурации, используется для загрузки настроек приложения.\n- **ServiceContainer**: Контейнер сервисов, содержащий различные сервисы и модули приложения.\n- **TraceService**: Сервис трассировки, собирает информацию о выполнении запросов и событиях.\n- **HealthRegistry**: Регистратор состояния здоровья системы, отслеживает состояние различных модулей и сервисов.\n- **LogManager**: Менеджер логирования, регистрирует события и ошибки.\n- **WorkerSupervisor**: Наблюдатель за рабочими процессами, управляет запуском и остановкой рабочих потоков.\n- **ControlPlaneService**: Управляет основной логикой взаимодействия с внешним миром и сервисами.\n\n## Поток данных или вызовов\nПри инициализации объекта класса `RuntimeManager`, вызывается метод `__init__`. В этом методе происходит инициализация всех указанных параметров и настройка начальных значений атрибутов экземпляра:\n\n```python\ndef __init__(self, ...):\n # Инициализация переменных и атрибутов\n self.configuration = ...\n self.services = ...\n self.traces = ...\n self.health = ...\n self.logs = ...\n self.workers = ...\n self.control_plane = ...\n \n # Другие действия по настройке и регистрации сервисов\n```\n\nПосле этого начинается регистрация сервисов и их модулей при помощи метода `_register_core_services`.\n\n### Важные детали реализации\n- Класс поддерживает управление несколькими основными состояниями жизненного цикла приложения через атрибуты `_state` и соответствующие методы:\n - `LifecycleState.IDLE`: начальное состояние перед началом работы.\n - `LifecycleState.STARTED`: активное состояние после начала работы.\n - `LifecycleState.FAILED`: состояние после возникновения ошибки.\n \n- При создании экземпляра класса вызываются функции `_register_core_services`, которые отвечают за подключение основных модулей и сервисов.\n\n- Метод `register_module(module)` позволяет динамически регистрировать новые модули и расширять функциональность приложения.\n\n### Осторожные выводы\nНа основе косвенных признаков можно предположить, что реализация использует механизм модульной архитектуры и разделяет логику на несколько уровней абстракции, где каждый уровень соответствует определённой части функциональности (например, конфигурация, мониторинг, контроль и рабочие процессы). Однако более детальная информация требует дополнительного анализа исходного кода." - }, - "diagnostics": { - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 797, - "evidence_rows": 12, - "evidence_chars": 7130 - }, - "evidence_summary": [ - { - "layer": "C1_SYMBOL_CATALOG", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "count": 6, - "unique_paths": 2 - }, - { - "layer": "C3_ENTRYPOINTS", - "count": 3, - "unique_paths": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 1, - "unique_paths": 1 - } - ], - "prompt_template_id": "intent_code_qa_explain_ru_v1", - "system_prompt_version": "v1" - }, - "timings_ms": { - "prompt_build": 0, - "llm_call": 3701 - } - } - } - ] - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_112158/full_chain_plba_code_retrieval_plba-fullchain-explain-runtime-manager.md b/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_112158/full_chain_plba_code_retrieval_plba-fullchain-explain-runtime-manager.md deleted file mode 100644 index 68f870f..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_112158/full_chain_plba_code_retrieval_plba-fullchain-explain-runtime-manager.md +++ /dev/null @@ -1,34 +0,0 @@ -# plba-fullchain-explain-runtime-manager - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_retrieval.yaml -- runner: runtime -- mode: full_chain -- passed: True - -## Query -Объясни как работает класс RuntimeManager - -## Actual -{ - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 12, - "llm_answer": "## Назначение класса `RuntimeManager`\nКласс `RuntimeManager` предназначен для управления жизненным циклом приложения и координации различных компонентов системы во время выполнения. Он играет роль менеджера процессов и отвечает за управление состоянием приложения, регистрацию сервисов и координацию работы рабочих потоков (`workers`).\n\n## Ключевые зависимости\n- **ConfigurationManager**: Менеджер конфигурации, используется для загрузки настроек приложения.\n- **ServiceContainer**: Контейнер сервисов, содержащий различные сервисы и модули приложения.\n- **TraceService**: Сервис трассировки, собирает информацию о выполнении запросов и событиях.\n- **HealthRegistry**: Регистратор состояния здоровья системы, отслеживает состояние различных модулей и сервисов.\n- **LogManager**: Менеджер логирования, регистрирует события и ошибки.\n- **WorkerSupervisor**: Наблюдатель за рабочими процессами, управляет запуском и остановкой рабочих потоков.\n- **ControlPlaneService**: Управляет основной логикой взаимодействия с внешним миром и сервисами.\n\n## Поток данных или вызовов\nПри инициализации объекта класса `RuntimeManager`, вызывается метод `__init__`. В этом методе происходит инициализация всех указанных параметров и настройка начальных значений атрибутов экземпляра:\n\n```python\ndef __init__(self, ...):\n # Инициализация переменных и атрибутов\n self.configuration = ...\n self.services = ...\n self.traces = ...\n self.health = ...\n self.logs = ...\n self.workers = ...\n self.control_plane = ...\n \n # Другие действия по настройке и регистрации сервисов\n```\n\nПосле этого начинается регистрация сервисов и их модулей при помощи метода `_register_core_services`.\n\n### Важные детали реализации\n- Класс поддерживает управление несколькими основными состояниями жизненного цикла приложения через атрибуты `_state` и соответствующие методы:\n - `LifecycleState.IDLE`: начальное состояние перед началом работы.\n - `LifecycleState.STARTED`: активное состояние после начала работы.\n - `LifecycleState.FAILED`: состояние после возникновения ошибки.\n \n- При создании экземпляра класса вызываются функции `_register_core_services`, которые отвечают за подключение основных модулей и сервисов.\n\n- Метод `register_module(module)` позволяет динамически регистрировать новые модули и расширять функциональность приложения.\n\n### Осторожные выводы\nНа основе косвенных признаков можно предположить, что реализация использует механизм модульной архитектуры и разделяет логику на несколько уровней абстракции, где каждый уровень соответствует определённой части функциональности (например, конфигурация, мониторинг, контроль и рабочие процессы). Однако более детальная информация требует дополнительного анализа исходного кода.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "RuntimeManager" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] -} - -## Mismatches -- none \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_112158/full_chain_plba_code_retrieval_plba-fullchain-explain-trace-service.json b/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_112158/full_chain_plba_code_retrieval_plba-fullchain-explain-trace-service.json deleted file mode 100644 index 529a586..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_112158/full_chain_plba_code_retrieval_plba-fullchain-explain-trace-service.json +++ /dev/null @@ -1,2208 +0,0 @@ -{ - "case_id": "plba-fullchain-explain-trace-service", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_retrieval.yaml", - "runner": "runtime", - "mode": "full_chain", - "actual": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 14, - "llm_answer": "## Объяснение работы `TraceService`\n\n### Назначение\n`TraceService` — это сервис, предназначенный для управления контекстом трассировки и записи логических событий во время выполнения программы. Он участвует в потоке данных системы, обеспечивая запись информации о каждом этапе выполнения с возможностью последующего анализа и мониторинга.\n\n### Ключевые зависимости\n- **TraceContextFactory**: Базовый класс, от которого наследуется `TraceService`. \n- **TraceTransport**: Интерфейс транспортировки данных трассировки.\n- **TraceContextStore**: Класс для хранения контекста трассировки.\n- **NoOpTraceTransport**: Специальная реализация `TraceTransport`, используемая при отсутствии реальной транспортной инфраструктуры.\n- **TraceRecordWriter**: Вспомогательный класс для записи записей трассировки в транспортную систему.\n\n### Поток данных или вызовов\n1. При инициализации (`__init__`) создается экземпляр класса `TraceRecordWriter`, который записывает записи трассировки через указанный транспорт (`TraceTransport`).\n \n ```python\n def __init__(self, transport: TraceTransport | None = None, store: TraceContextStore | None = None):\n ...\n self._writer = TraceRecordWriter(self.transport)\n ```\n\n2. Основной метод создания нового контекста трассировки (`create_context`) создает новую запись трассировки (`TraceContextRecord`), добавляет её в хранилище (`store`) и записывает через транспорт (`_writer`).\n\n ```python\n def create_context(\n self,\n *,\n alias: str,\n parent_id: str | None = None,\n kind: str | None = None,\n attrs: dict[str, Any] | None = None,\n ) -> str:\n ...\n self.store.push(record)\n self._writer.write_context(record)\n return record.trace_id\n ```\n\n3. Метод `open_context` предоставляет контекст трассировки внутри блока `with`, создавая новый контекст трассировки и возвращая идентификатор этого контекста.\n\n ```python\n @contextmanager\n def open_context(\n self,\n *,\n alias: str,\n parent_id: str | None = None,\n kind: str | None = None,\n attrs: dict[str, Any] | None = None,\n ) -> Iterator[str]:\n trace_id = self.create_context(alias=alias, parent_id=parent_id, kind=kind, attrs=attrs)\n yield trace_id\n ```\n\n### Важные детали реализации\n- Запись сообщений трассировки осуществляется методом `_writer.write_message`.\n- Хранилище контекста трассировки используется для сохранения всех созданных записей трассировки.\n- Если транспорт недоступен или возникает ошибка при передаче сообщения, это фиксируется в журнале ошибок.\n \n ```python\n class TraceRecordWriter:\n def write_message(self, record: TraceLogMessage) -> None:\n try:\n self._transport.write_message(record)\n except Exception:\n self._logger.exception(\"Trace transport failed to write message for %s\", record.trace_id)\n ```\n\n### Остерегайтесь выводов\nНекоторые выводы сделаны на основе косвенных признаков и предположений, основанных на доступных фрагментах кода и структуре зависимостей. Например, роль метода `_writer.write_message` точно определяется исключительно по сигнатуре и отсутствию подробных комментариев в исходном коде.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "TraceService" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "passed": true, - "mismatches": [], - "details": { - "case_id": "plba-fullchain-explain-trace-service", - "text": "Как работает TraceService?", - "mode": "full_chain", - "run_started_at": "2026-03-12T11:21:59", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Как работает TraceService?", - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "TraceService", - "alternatives": [ - "TraceService" - ], - "confidence": 0.99 - }, - "rag_count": 14, - "rag_rows": [ - { - "path": "src/app_runtime/tracing/service.py", - "content": "class TraceService\nTraceService(TraceContextFactory)", - "layer": "C1_SYMBOL_CATALOG", - "title": "TraceService", - "span_start": 39, - "span_end": 166, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "c2b2b976d99f2c600000b753731b26e0a69adcb4359398b93073590c5d5d04f4", - "qname": "TraceService", - "kind": "class", - "signature": "TraceService(TraceContextFactory)", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.tracing.service", - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "TraceService\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests service\n- reads and writes state attributes\n- participates in dataflow slices (13)", - "layer": "C4_SEMANTIC_ROLES", - "title": "TraceService", - "span_start": 39, - "span_end": 166, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 60, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "c2b2b976d99f2c600000b753731b26e0a69adcb4359398b93073590c5d5d04f4", - "symbol_name": "TraceService", - "qname": "TraceService", - "role": "pipeline_stage", - "confidence": 0.57, - "dataflow_participation": 13, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "TraceService.__init__\n -> TraceService.store\n -> TraceService.create_context", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "TraceService.__init__:dataflow_slice", - "span_start": 42, - "span_end": 61, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "3b052062067a78aef3302ee1d996897e02a67d1b340397bea4f59fe147c0492a", - "edge_type": "dataflow_slice", - "src_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "src_qname": "TraceService.__init__", - "dst_symbol_id": "ff44881104b65ef50ee6fe16d367d4a81b6e7eb5c44c0963cf4543faec785d4a", - "dst_ref": "TraceService.create_context", - "resolution": "resolved", - "slice_id": "3b052062067a78aef3302ee1d996897e02a67d1b340397bea4f59fe147c0492a", - "root_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "path_symbols": [ - "TraceService.__init__", - "TraceService.store", - "TraceService.create_context" - ], - "path_symbol_ids": [ - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "ff44881104b65ef50ee6fe16d367d4a81b6e7eb5c44c0963cf4543faec785d4a" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "TraceService.__init__\n -> TraceService.store\n -> TraceService.close_context", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "TraceService.__init__:dataflow_slice", - "span_start": 42, - "span_end": 84, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "7a9353ef57c9ae5d19b3a0c6ac50fad05e6d21d31bbe1cd1cd07af6332ba6505", - "edge_type": "dataflow_slice", - "src_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "src_qname": "TraceService.__init__", - "dst_symbol_id": "01e14158dcced7e52d0c8ac84ac7b9a75225c261b6aca6a1d7da802d0994721c", - "dst_ref": "TraceService.close_context", - "resolution": "resolved", - "slice_id": "7a9353ef57c9ae5d19b3a0c6ac50fad05e6d21d31bbe1cd1cd07af6332ba6505", - "root_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "path_symbols": [ - "TraceService.__init__", - "TraceService.store", - "TraceService.close_context" - ], - "path_symbol_ids": [ - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "01e14158dcced7e52d0c8ac84ac7b9a75225c261b6aca6a1d7da802d0994721c" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "TraceService.__init__\n -> TraceService.store\n -> TraceService.open_context", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "TraceService.__init__:dataflow_slice", - "span_start": 42, - "span_end": 78, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "a6e13b9ebc4fed84586afd53ed92a4d14757e440873f572b2337d5622ee96031", - "edge_type": "dataflow_slice", - "src_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "src_qname": "TraceService.__init__", - "dst_symbol_id": "2da3d5b20a947bf63e14c103be4689b72fd837e0a82abd6c497846375d4c7426", - "dst_ref": "TraceService.open_context", - "resolution": "resolved", - "slice_id": "a6e13b9ebc4fed84586afd53ed92a4d14757e440873f572b2337d5622ee96031", - "root_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "path_symbols": [ - "TraceService.__init__", - "TraceService.store", - "TraceService.open_context" - ], - "path_symbol_ids": [ - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "2da3d5b20a947bf63e14c103be4689b72fd837e0a82abd6c497846375d4c7426" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "TraceService.__init__\n -> TraceService.transport\n -> TraceService.__init__", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "TraceService.__init__:dataflow_slice", - "span_start": 41, - "span_end": 43, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "1e923a93faa05c3c43ca9b19bd047007a8589ccce57d3cc1798ae7f9f200af98", - "edge_type": "dataflow_slice", - "src_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "src_qname": "TraceService.__init__", - "dst_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "dst_ref": "TraceService.__init__", - "resolution": "resolved", - "slice_id": "1e923a93faa05c3c43ca9b19bd047007a8589ccce57d3cc1798ae7f9f200af98", - "root_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "path_symbols": [ - "TraceService.__init__", - "TraceService.transport", - "TraceService.__init__" - ], - "path_symbol_ids": [ - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "TraceService.__init__\n -> TraceService.store\n -> TraceService.current_trace_id", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "TraceService.__init__:dataflow_slice", - "span_start": 42, - "span_end": 81, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "3ea17138634b1190bded77ddb84aa1595124f6519b246f24fc4b02bd62b5cac1", - "edge_type": "dataflow_slice", - "src_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "src_qname": "TraceService.__init__", - "dst_symbol_id": "41135180f7b3b9ab20e097e0747474e219c37dd2366ef08a7b43c1f3edb10b4c", - "dst_ref": "TraceService.current_trace_id", - "resolution": "resolved", - "slice_id": "3ea17138634b1190bded77ddb84aa1595124f6519b246f24fc4b02bd62b5cac1", - "root_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "path_symbols": [ - "TraceService.__init__", - "TraceService.store", - "TraceService.current_trace_id" - ], - "path_symbol_ids": [ - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "41135180f7b3b9ab20e097e0747474e219c37dd2366ef08a7b43c1f3edb10b4c" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "TraceService.__init__\n -> TraceService.store\n -> TraceService.step", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "TraceService.__init__:dataflow_slice", - "span_start": 42, - "span_end": 88, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "9f34c5da9b09fba99df6f6b1bde183a9aeb45111b8218a747c71590c2c9f60f2", - "edge_type": "dataflow_slice", - "src_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "src_qname": "TraceService.__init__", - "dst_symbol_id": "c44bfbc66cf747283f30088da3e011a10395031d41e77b74e523c24997f641ca", - "dst_ref": "TraceService.step", - "resolution": "resolved", - "slice_id": "9f34c5da9b09fba99df6f6b1bde183a9aeb45111b8218a747c71590c2c9f60f2", - "root_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "path_symbols": [ - "TraceService.__init__", - "TraceService.store", - "TraceService.step" - ], - "path_symbol_ids": [ - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "c44bfbc66cf747283f30088da3e011a10395031d41e77b74e523c24997f641ca" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "class TraceRecordWriter:\n def __init__(self, transport: TraceTransport) -> None:\n self._logger = logging.getLogger(__name__)\n self._transport = transport\n\n def write_context(self, record: TraceContextRecord) -> None:\n try:\n self._transport.write_context(record)\n except Exception:\n self._logger.exception(\"Trace transport failed to write context %s\", record.trace_id)\n\n def write_message(self, record: TraceLogMessage) -> None:\n try:\n self._transport.write_message(record)\n except Exception:\n self._logger.exception(\"Trace transport failed to write message for %s\", record.trace_id)", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/tracing/service.py:TraceRecordWriter", - "span_start": 21, - "span_end": 36, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.tracing.service", - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "class TraceService(TraceContextFactory):\n def __init__(self, transport: TraceTransport | None = None, store: TraceContextStore | None = None) -> None:\n self.transport = transport or NoOpTraceTransport()\n self.store = store or TraceContextStore()\n self._writer = TraceRecordWriter(self.transport)\n\n def create_context(\n self,\n *,\n alias: str,\n parent_id: str | None = None,\n kind: str | None = None,\n attrs: dict[str, Any] | None = None,\n ) -> str:\n record = TraceContextRecord(\n trace_id=uuid4().hex,\n alias=str(alias or \"\"),\n parent_id=parent_id,\n type=kind,\n event_time=utc_now(),\n attrs=dict(attrs or {}),\n )\n self.store.push(record)\n self._writer.write_context(record)\n return record.trace_id\n\n @contextmanager\n def open_context(\n self,\n *,\n alias: str,\n parent_id: str | None = None,\n kind: str | None = None,\n attrs: dict[str, Any] | None = None,\n ) -> Iterator[str]:\n trace_id = self.create_context(alias=alias, parent_id=parent_id, kind=kind, attrs=attrs)\n try:\n yield trace_id\n finally:\n self.store.pop()\n\n def current_trace_id(self) -> str | None:\n return self.store.current_trace_id()\n\n def close_context(self) -> str | None:\n previous = self.store.pop()\n return previous.record.trace_id if previous else None\n\n def step(self, name: str) -> None:\n self.store.set_step(str(name or \"\"))\n\n def info(self, message: str, *, status: str | None = None, attrs: dict[str, Any] | None = None) -> None:\n self._write_message(\"INFO\", message, status, attrs)\n\n def debug(self, message: str, *, status: str | None = None, attrs: dict[str, Any] | None = None) -> None:\n self._write_message(\"DEBUG\", message, status, attrs)\n\n def warning(self, message: str, *, status: str | None = None, attrs: dict[str, Any] | None = None) -> None:\n self._write_message(\"WARNING\", message, status, attrs)\n\n def error(self, message: str, *, status: str | None = None, attrs: dict[str, Any] | None = None) -> None:\n self._write_message(\"ERROR\", message, status, attrs)\n\n def exception(self, message: str, *, status: str = \"failed\", attrs: dict[str, Any] | None = None) -> None:\n self._write_message(\"ERROR\", message, status, attrs)\n\n def new_root(self, operation: str) -> TraceContext:\n trace_id = self.create_context(alias=operation, kind=\"operation\", attrs={\"operation\": operation})\n return TraceContext(trace_id=trace_id, span_id=trace_id, attributes={\"operation\": operation})\n\n def child_of(self, parent: TraceContext, operation: str) -> TraceContext:\n trace_id = self.create_context(\n alias=operation,\n parent_id=parent.trace_id,\n kind=\"worker\",\n attrs={\"operation\": operation},\n )\n return TraceContext(\n trace_id=trace_id,\n span_id=trace_id,\n parent_span_id=parent.span_id,\n attributes={\"operation\": operation},\n )\n\n def attach(self, metadata: dict[str, object], context: TraceContext) -> dict[str, object]:\n updated = dict(metadata)\n updated[\"trace_id\"] = context.trace_id\n updated[\"span_id\"] = context.span_id\n updated[\"parent_span_id\"] = context.parent_span_id\n return updated\n\n def resume(self, metadata: dict[str, object], operation: str) -> TraceContext:\n trace_id = str(metadata.get(\"trace_id\") or uuid4().hex)\n span_id = str(metadata.get(\"span_id\") or trace_id)\n parent_id = metadata.get(\"parent_span_id\")\n self.create_context(\n alias=operation,\n parent_id=str(parent_id) if parent_id else None,\n kind=\"worker\",\n attrs=dict(metadata),\n )\n return TraceContext(\n trace_id=trace_id,\n span_id=span_id,\n parent_span_id=str(parent_id) if parent_id else None,\n attributes={\"operation\": operation},\n )\n\n def _write_message(\n self,\n level: TraceLevel,\n message: str,\n status: str | None,\n attrs: dict[str, Any] | None,\n ) -> None:\n active = self.store.current()\n if active is None:\n raise RuntimeError(\"Trace context is not bound. Call create_context() first.\")\n record = TraceLogMessage(\n trace_id=active.record.trace_id,\n step=active.step,\n status=str(status or \"\"),\n message=str(message or \"\"),\n level=level,\n event_time=utc_now(),\n attrs=dict(attrs or {}),\n )\n self._writer.write_message(record)", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/tracing/service.py:TraceService", - "span_start": 39, - "span_end": 166, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 1, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.tracing.service", - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "class TraceManager(TraceService):\n \"\"\"Compatibility alias during the transition from ConfigManager-shaped naming.\"\"\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/tracing/service.py:TraceManager", - "span_start": 169, - "span_end": 170, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 2, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.tracing.service", - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "llm_answer": "## Объяснение работы `TraceService`\n\n### Назначение\n`TraceService` — это сервис, предназначенный для управления контекстом трассировки и записи логических событий во время выполнения программы. Он участвует в потоке данных системы, обеспечивая запись информации о каждом этапе выполнения с возможностью последующего анализа и мониторинга.\n\n### Ключевые зависимости\n- **TraceContextFactory**: Базовый класс, от которого наследуется `TraceService`. \n- **TraceTransport**: Интерфейс транспортировки данных трассировки.\n- **TraceContextStore**: Класс для хранения контекста трассировки.\n- **NoOpTraceTransport**: Специальная реализация `TraceTransport`, используемая при отсутствии реальной транспортной инфраструктуры.\n- **TraceRecordWriter**: Вспомогательный класс для записи записей трассировки в транспортную систему.\n\n### Поток данных или вызовов\n1. При инициализации (`__init__`) создается экземпляр класса `TraceRecordWriter`, который записывает записи трассировки через указанный транспорт (`TraceTransport`).\n \n ```python\n def __init__(self, transport: TraceTransport | None = None, store: TraceContextStore | None = None):\n ...\n self._writer = TraceRecordWriter(self.transport)\n ```\n\n2. Основной метод создания нового контекста трассировки (`create_context`) создает новую запись трассировки (`TraceContextRecord`), добавляет её в хранилище (`store`) и записывает через транспорт (`_writer`).\n\n ```python\n def create_context(\n self,\n *,\n alias: str,\n parent_id: str | None = None,\n kind: str | None = None,\n attrs: dict[str, Any] | None = None,\n ) -> str:\n ...\n self.store.push(record)\n self._writer.write_context(record)\n return record.trace_id\n ```\n\n3. Метод `open_context` предоставляет контекст трассировки внутри блока `with`, создавая новый контекст трассировки и возвращая идентификатор этого контекста.\n\n ```python\n @contextmanager\n def open_context(\n self,\n *,\n alias: str,\n parent_id: str | None = None,\n kind: str | None = None,\n attrs: dict[str, Any] | None = None,\n ) -> Iterator[str]:\n trace_id = self.create_context(alias=alias, parent_id=parent_id, kind=kind, attrs=attrs)\n yield trace_id\n ```\n\n### Важные детали реализации\n- Запись сообщений трассировки осуществляется методом `_writer.write_message`.\n- Хранилище контекста трассировки используется для сохранения всех созданных записей трассировки.\n- Если транспорт недоступен или возникает ошибка при передаче сообщения, это фиксируется в журнале ошибок.\n \n ```python\n class TraceRecordWriter:\n def write_message(self, record: TraceLogMessage) -> None:\n try:\n self._transport.write_message(record)\n except Exception:\n self._logger.exception(\"Trace transport failed to write message for %s\", record.trace_id)\n ```\n\n### Остерегайтесь выводов\nНекоторые выводы сделаны на основе косвенных признаков и предположений, основанных на доступных фрагментах кода и структуре зависимостей. Например, роль метода `_writer.write_message` точно определяется исключительно по сигнатуре и отсутствию подробных комментариев в исходном коде.", - "summary": { - "router": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "confidence": null - }, - "retrieval": { - "profile": "code", - "layers_hit": [ - "C0_SOURCE_CHUNKS", - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS", - "C4_SEMANTIC_ROLES" - ], - "evidence_sufficient": true - }, - "llm": { - "answer_status": "answered", - "groundedness": "grounded" - } - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "TraceService" - ], - "keyword_hints": [ - "TraceService" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C0_SOURCE_CHUNKS": "exact_path_fetch", - "C4_SEMANTIC_ROLES": "exact_path_fetch", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C3_ENTRYPOINTS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 8, - "C4_SEMANTIC_ROLES": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C3_ENTRYPOINTS": 6 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C4_SEMANTIC_ROLES": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "TraceService", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "TraceService", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C4_SEMANTIC_ROLES", - "query": "TraceService", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "TraceService", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - }, - { - "layer": "C3_ENTRYPOINTS", - "query": "TraceService", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 1, - "candidates_after_filter": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 6, - "candidates_after_filter": 6 - }, - { - "layer": "C3_ENTRYPOINTS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 3, - "candidates_after_filter": 3 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "TraceService", - "alternatives": [ - "TraceService" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 3, - "fail_reason": null - }, - { - "layer": "C4_SEMANTIC_ROLES", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 6, - "fail_reason": null - }, - { - "layer": "C3_ENTRYPOINTS", - "status": "hit", - "hit_count": 3, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "router": 1, - "symbol_resolution": 0, - "retrieval_total": 146, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 47, - "C0_SOURCE_CHUNKS": 22, - "C4_SEMANTIC_ROLES": 17, - "C2_DEPENDENCY_GRAPH": 47, - "C3_ENTRYPOINTS": 11 - }, - "merge_rank": 18, - "prompt_build": 0, - "llm_call": 4778 - }, - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 931, - "evidence_rows": 14, - "evidence_chars": 6323 - }, - "evidence_summary": [ - { - "layer": "C1_SYMBOL_CATALOG", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "count": 6, - "unique_paths": 1 - }, - { - "layer": "C3_ENTRYPOINTS", - "count": 3, - "unique_paths": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 3, - "unique_paths": 1 - } - ], - "prompt_template_id": "intent_code_qa_explain_ru_v1", - "system_prompt_version": "v1" - }, - "router": { - "conversation_mode": "START", - "keyword_hints": [ - "TraceService" - ], - "path_scope": [] - }, - "llm": { - "used_evidence_count": 14, - "missing_evidence_reason": null - } - }, - "run_info": { - "case_id": "plba-fullchain-explain-trace-service", - "mode": "full_chain", - "run_started_at": "2026-03-12T11:21:59", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - }, - "input_request": { - "text": "Как работает TraceService?", - "normalized_query": "Как работает TraceService?" - }, - "steps": [ - { - "step": "intent_router", - "input": { - "query": "Как работает TraceService?" - }, - "output": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Как работает TraceService?" - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "TraceService" - ], - "keyword_hints": [ - "TraceService" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "timings_ms": { - "router": 1 - } - } - }, - { - "step": "retrieval", - "input": { - "query": "Как работает TraceService?" - }, - "output": { - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "TraceService", - "alternatives": [ - "TraceService" - ], - "confidence": 0.99 - }, - "rag_count": 14, - "rag_rows": [ - { - "path": "src/app_runtime/tracing/service.py", - "content": "class TraceService\nTraceService(TraceContextFactory)", - "layer": "C1_SYMBOL_CATALOG", - "title": "TraceService", - "span_start": 39, - "span_end": 166, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "c2b2b976d99f2c600000b753731b26e0a69adcb4359398b93073590c5d5d04f4", - "qname": "TraceService", - "kind": "class", - "signature": "TraceService(TraceContextFactory)", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.tracing.service", - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "TraceService\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests service\n- reads and writes state attributes\n- participates in dataflow slices (13)", - "layer": "C4_SEMANTIC_ROLES", - "title": "TraceService", - "span_start": 39, - "span_end": 166, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 60, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "c2b2b976d99f2c600000b753731b26e0a69adcb4359398b93073590c5d5d04f4", - "symbol_name": "TraceService", - "qname": "TraceService", - "role": "pipeline_stage", - "confidence": 0.57, - "dataflow_participation": 13, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "TraceService.__init__\n -> TraceService.store\n -> TraceService.create_context", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "TraceService.__init__:dataflow_slice", - "span_start": 42, - "span_end": 61, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "3b052062067a78aef3302ee1d996897e02a67d1b340397bea4f59fe147c0492a", - "edge_type": "dataflow_slice", - "src_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "src_qname": "TraceService.__init__", - "dst_symbol_id": "ff44881104b65ef50ee6fe16d367d4a81b6e7eb5c44c0963cf4543faec785d4a", - "dst_ref": "TraceService.create_context", - "resolution": "resolved", - "slice_id": "3b052062067a78aef3302ee1d996897e02a67d1b340397bea4f59fe147c0492a", - "root_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "path_symbols": [ - "TraceService.__init__", - "TraceService.store", - "TraceService.create_context" - ], - "path_symbol_ids": [ - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "ff44881104b65ef50ee6fe16d367d4a81b6e7eb5c44c0963cf4543faec785d4a" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "TraceService.__init__\n -> TraceService.store\n -> TraceService.close_context", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "TraceService.__init__:dataflow_slice", - "span_start": 42, - "span_end": 84, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "7a9353ef57c9ae5d19b3a0c6ac50fad05e6d21d31bbe1cd1cd07af6332ba6505", - "edge_type": "dataflow_slice", - "src_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "src_qname": "TraceService.__init__", - "dst_symbol_id": "01e14158dcced7e52d0c8ac84ac7b9a75225c261b6aca6a1d7da802d0994721c", - "dst_ref": "TraceService.close_context", - "resolution": "resolved", - "slice_id": "7a9353ef57c9ae5d19b3a0c6ac50fad05e6d21d31bbe1cd1cd07af6332ba6505", - "root_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "path_symbols": [ - "TraceService.__init__", - "TraceService.store", - "TraceService.close_context" - ], - "path_symbol_ids": [ - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "01e14158dcced7e52d0c8ac84ac7b9a75225c261b6aca6a1d7da802d0994721c" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "TraceService.__init__\n -> TraceService.store\n -> TraceService.open_context", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "TraceService.__init__:dataflow_slice", - "span_start": 42, - "span_end": 78, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "a6e13b9ebc4fed84586afd53ed92a4d14757e440873f572b2337d5622ee96031", - "edge_type": "dataflow_slice", - "src_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "src_qname": "TraceService.__init__", - "dst_symbol_id": "2da3d5b20a947bf63e14c103be4689b72fd837e0a82abd6c497846375d4c7426", - "dst_ref": "TraceService.open_context", - "resolution": "resolved", - "slice_id": "a6e13b9ebc4fed84586afd53ed92a4d14757e440873f572b2337d5622ee96031", - "root_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "path_symbols": [ - "TraceService.__init__", - "TraceService.store", - "TraceService.open_context" - ], - "path_symbol_ids": [ - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "2da3d5b20a947bf63e14c103be4689b72fd837e0a82abd6c497846375d4c7426" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "TraceService.__init__\n -> TraceService.transport\n -> TraceService.__init__", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "TraceService.__init__:dataflow_slice", - "span_start": 41, - "span_end": 43, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "1e923a93faa05c3c43ca9b19bd047007a8589ccce57d3cc1798ae7f9f200af98", - "edge_type": "dataflow_slice", - "src_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "src_qname": "TraceService.__init__", - "dst_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "dst_ref": "TraceService.__init__", - "resolution": "resolved", - "slice_id": "1e923a93faa05c3c43ca9b19bd047007a8589ccce57d3cc1798ae7f9f200af98", - "root_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "path_symbols": [ - "TraceService.__init__", - "TraceService.transport", - "TraceService.__init__" - ], - "path_symbol_ids": [ - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "TraceService.__init__\n -> TraceService.store\n -> TraceService.current_trace_id", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "TraceService.__init__:dataflow_slice", - "span_start": 42, - "span_end": 81, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "3ea17138634b1190bded77ddb84aa1595124f6519b246f24fc4b02bd62b5cac1", - "edge_type": "dataflow_slice", - "src_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "src_qname": "TraceService.__init__", - "dst_symbol_id": "41135180f7b3b9ab20e097e0747474e219c37dd2366ef08a7b43c1f3edb10b4c", - "dst_ref": "TraceService.current_trace_id", - "resolution": "resolved", - "slice_id": "3ea17138634b1190bded77ddb84aa1595124f6519b246f24fc4b02bd62b5cac1", - "root_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "path_symbols": [ - "TraceService.__init__", - "TraceService.store", - "TraceService.current_trace_id" - ], - "path_symbol_ids": [ - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "41135180f7b3b9ab20e097e0747474e219c37dd2366ef08a7b43c1f3edb10b4c" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "TraceService.__init__\n -> TraceService.store\n -> TraceService.step", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "TraceService.__init__:dataflow_slice", - "span_start": 42, - "span_end": 88, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "9f34c5da9b09fba99df6f6b1bde183a9aeb45111b8218a747c71590c2c9f60f2", - "edge_type": "dataflow_slice", - "src_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "src_qname": "TraceService.__init__", - "dst_symbol_id": "c44bfbc66cf747283f30088da3e011a10395031d41e77b74e523c24997f641ca", - "dst_ref": "TraceService.step", - "resolution": "resolved", - "slice_id": "9f34c5da9b09fba99df6f6b1bde183a9aeb45111b8218a747c71590c2c9f60f2", - "root_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "path_symbols": [ - "TraceService.__init__", - "TraceService.store", - "TraceService.step" - ], - "path_symbol_ids": [ - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "c44bfbc66cf747283f30088da3e011a10395031d41e77b74e523c24997f641ca" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "class TraceRecordWriter:\n def __init__(self, transport: TraceTransport) -> None:\n self._logger = logging.getLogger(__name__)\n self._transport = transport\n\n def write_context(self, record: TraceContextRecord) -> None:\n try:\n self._transport.write_context(record)\n except Exception:\n self._logger.exception(\"Trace transport failed to write context %s\", record.trace_id)\n\n def write_message(self, record: TraceLogMessage) -> None:\n try:\n self._transport.write_message(record)\n except Exception:\n self._logger.exception(\"Trace transport failed to write message for %s\", record.trace_id)", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/tracing/service.py:TraceRecordWriter", - "span_start": 21, - "span_end": 36, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.tracing.service", - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "class TraceService(TraceContextFactory):\n def __init__(self, transport: TraceTransport | None = None, store: TraceContextStore | None = None) -> None:\n self.transport = transport or NoOpTraceTransport()\n self.store = store or TraceContextStore()\n self._writer = TraceRecordWriter(self.transport)\n\n def create_context(\n self,\n *,\n alias: str,\n parent_id: str | None = None,\n kind: str | None = None,\n attrs: dict[str, Any] | None = None,\n ) -> str:\n record = TraceContextRecord(\n trace_id=uuid4().hex,\n alias=str(alias or \"\"),\n parent_id=parent_id,\n type=kind,\n event_time=utc_now(),\n attrs=dict(attrs or {}),\n )\n self.store.push(record)\n self._writer.write_context(record)\n return record.trace_id\n\n @contextmanager\n def open_context(\n self,\n *,\n alias: str,\n parent_id: str | None = None,\n kind: str | None = None,\n attrs: dict[str, Any] | None = None,\n ) -> Iterator[str]:\n trace_id = self.create_context(alias=alias, parent_id=parent_id, kind=kind, attrs=attrs)\n try:\n yield trace_id\n finally:\n self.store.pop()\n\n def current_trace_id(self) -> str | None:\n return self.store.current_trace_id()\n\n def close_context(self) -> str | None:\n previous = self.store.pop()\n return previous.record.trace_id if previous else None\n\n def step(self, name: str) -> None:\n self.store.set_step(str(name or \"\"))\n\n def info(self, message: str, *, status: str | None = None, attrs: dict[str, Any] | None = None) -> None:\n self._write_message(\"INFO\", message, status, attrs)\n\n def debug(self, message: str, *, status: str | None = None, attrs: dict[str, Any] | None = None) -> None:\n self._write_message(\"DEBUG\", message, status, attrs)\n\n def warning(self, message: str, *, status: str | None = None, attrs: dict[str, Any] | None = None) -> None:\n self._write_message(\"WARNING\", message, status, attrs)\n\n def error(self, message: str, *, status: str | None = None, attrs: dict[str, Any] | None = None) -> None:\n self._write_message(\"ERROR\", message, status, attrs)\n\n def exception(self, message: str, *, status: str = \"failed\", attrs: dict[str, Any] | None = None) -> None:\n self._write_message(\"ERROR\", message, status, attrs)\n\n def new_root(self, operation: str) -> TraceContext:\n trace_id = self.create_context(alias=operation, kind=\"operation\", attrs={\"operation\": operation})\n return TraceContext(trace_id=trace_id, span_id=trace_id, attributes={\"operation\": operation})\n\n def child_of(self, parent: TraceContext, operation: str) -> TraceContext:\n trace_id = self.create_context(\n alias=operation,\n parent_id=parent.trace_id,\n kind=\"worker\",\n attrs={\"operation\": operation},\n )\n return TraceContext(\n trace_id=trace_id,\n span_id=trace_id,\n parent_span_id=parent.span_id,\n attributes={\"operation\": operation},\n )\n\n def attach(self, metadata: dict[str, object], context: TraceContext) -> dict[str, object]:\n updated = dict(metadata)\n updated[\"trace_id\"] = context.trace_id\n updated[\"span_id\"] = context.span_id\n updated[\"parent_span_id\"] = context.parent_span_id\n return updated\n\n def resume(self, metadata: dict[str, object], operation: str) -> TraceContext:\n trace_id = str(metadata.get(\"trace_id\") or uuid4().hex)\n span_id = str(metadata.get(\"span_id\") or trace_id)\n parent_id = metadata.get(\"parent_span_id\")\n self.create_context(\n alias=operation,\n parent_id=str(parent_id) if parent_id else None,\n kind=\"worker\",\n attrs=dict(metadata),\n )\n return TraceContext(\n trace_id=trace_id,\n span_id=span_id,\n parent_span_id=str(parent_id) if parent_id else None,\n attributes={\"operation\": operation},\n )\n\n def _write_message(\n self,\n level: TraceLevel,\n message: str,\n status: str | None,\n attrs: dict[str, Any] | None,\n ) -> None:\n active = self.store.current()\n if active is None:\n raise RuntimeError(\"Trace context is not bound. Call create_context() first.\")\n record = TraceLogMessage(\n trace_id=active.record.trace_id,\n step=active.step,\n status=str(status or \"\"),\n message=str(message or \"\"),\n level=level,\n event_time=utc_now(),\n attrs=dict(attrs or {}),\n )\n self._writer.write_message(record)", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/tracing/service.py:TraceService", - "span_start": 39, - "span_end": 166, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 1, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.tracing.service", - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "class TraceManager(TraceService):\n \"\"\"Compatibility alias during the transition from ConfigManager-shaped naming.\"\"\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/tracing/service.py:TraceManager", - "span_start": 169, - "span_end": 170, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 2, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.tracing.service", - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ] - }, - "diagnostics": { - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C0_SOURCE_CHUNKS": "exact_path_fetch", - "C4_SEMANTIC_ROLES": "exact_path_fetch", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C3_ENTRYPOINTS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 8, - "C4_SEMANTIC_ROLES": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C3_ENTRYPOINTS": 6 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C4_SEMANTIC_ROLES": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "TraceService", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "TraceService", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C4_SEMANTIC_ROLES", - "query": "TraceService", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "TraceService", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - }, - { - "layer": "C3_ENTRYPOINTS", - "query": "TraceService", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 1, - "candidates_after_filter": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 6, - "candidates_after_filter": 6 - }, - { - "layer": "C3_ENTRYPOINTS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 3, - "candidates_after_filter": 3 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "TraceService", - "alternatives": [ - "TraceService" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 3, - "fail_reason": null - }, - { - "layer": "C4_SEMANTIC_ROLES", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 6, - "fail_reason": null - }, - { - "layer": "C3_ENTRYPOINTS", - "status": "hit", - "hit_count": 3, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "symbol_resolution": 0, - "retrieval_total": 146, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 47, - "C0_SOURCE_CHUNKS": 22, - "C4_SEMANTIC_ROLES": 17, - "C2_DEPENDENCY_GRAPH": 47, - "C3_ENTRYPOINTS": 11 - }, - "merge_rank": 18 - } - } - }, - { - "step": "llm_answer", - "input": { - "query": "Как работает TraceService?", - "rag_count": 14 - }, - "output": { - "llm_answer": "## Объяснение работы `TraceService`\n\n### Назначение\n`TraceService` — это сервис, предназначенный для управления контекстом трассировки и записи логических событий во время выполнения программы. Он участвует в потоке данных системы, обеспечивая запись информации о каждом этапе выполнения с возможностью последующего анализа и мониторинга.\n\n### Ключевые зависимости\n- **TraceContextFactory**: Базовый класс, от которого наследуется `TraceService`. \n- **TraceTransport**: Интерфейс транспортировки данных трассировки.\n- **TraceContextStore**: Класс для хранения контекста трассировки.\n- **NoOpTraceTransport**: Специальная реализация `TraceTransport`, используемая при отсутствии реальной транспортной инфраструктуры.\n- **TraceRecordWriter**: Вспомогательный класс для записи записей трассировки в транспортную систему.\n\n### Поток данных или вызовов\n1. При инициализации (`__init__`) создается экземпляр класса `TraceRecordWriter`, который записывает записи трассировки через указанный транспорт (`TraceTransport`).\n \n ```python\n def __init__(self, transport: TraceTransport | None = None, store: TraceContextStore | None = None):\n ...\n self._writer = TraceRecordWriter(self.transport)\n ```\n\n2. Основной метод создания нового контекста трассировки (`create_context`) создает новую запись трассировки (`TraceContextRecord`), добавляет её в хранилище (`store`) и записывает через транспорт (`_writer`).\n\n ```python\n def create_context(\n self,\n *,\n alias: str,\n parent_id: str | None = None,\n kind: str | None = None,\n attrs: dict[str, Any] | None = None,\n ) -> str:\n ...\n self.store.push(record)\n self._writer.write_context(record)\n return record.trace_id\n ```\n\n3. Метод `open_context` предоставляет контекст трассировки внутри блока `with`, создавая новый контекст трассировки и возвращая идентификатор этого контекста.\n\n ```python\n @contextmanager\n def open_context(\n self,\n *,\n alias: str,\n parent_id: str | None = None,\n kind: str | None = None,\n attrs: dict[str, Any] | None = None,\n ) -> Iterator[str]:\n trace_id = self.create_context(alias=alias, parent_id=parent_id, kind=kind, attrs=attrs)\n yield trace_id\n ```\n\n### Важные детали реализации\n- Запись сообщений трассировки осуществляется методом `_writer.write_message`.\n- Хранилище контекста трассировки используется для сохранения всех созданных записей трассировки.\n- Если транспорт недоступен или возникает ошибка при передаче сообщения, это фиксируется в журнале ошибок.\n \n ```python\n class TraceRecordWriter:\n def write_message(self, record: TraceLogMessage) -> None:\n try:\n self._transport.write_message(record)\n except Exception:\n self._logger.exception(\"Trace transport failed to write message for %s\", record.trace_id)\n ```\n\n### Остерегайтесь выводов\nНекоторые выводы сделаны на основе косвенных признаков и предположений, основанных на доступных фрагментах кода и структуре зависимостей. Например, роль метода `_writer.write_message` точно определяется исключительно по сигнатуре и отсутствию подробных комментариев в исходном коде." - }, - "diagnostics": { - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 931, - "evidence_rows": 14, - "evidence_chars": 6323 - }, - "evidence_summary": [ - { - "layer": "C1_SYMBOL_CATALOG", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "count": 6, - "unique_paths": 1 - }, - { - "layer": "C3_ENTRYPOINTS", - "count": 3, - "unique_paths": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 3, - "unique_paths": 1 - } - ], - "prompt_template_id": "intent_code_qa_explain_ru_v1", - "system_prompt_version": "v1" - }, - "timings_ms": { - "prompt_build": 0, - "llm_call": 4778 - } - } - } - ] - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_112158/full_chain_plba_code_retrieval_plba-fullchain-explain-trace-service.md b/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_112158/full_chain_plba_code_retrieval_plba-fullchain-explain-trace-service.md deleted file mode 100644 index 2a742ac..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_112158/full_chain_plba_code_retrieval_plba-fullchain-explain-trace-service.md +++ /dev/null @@ -1,34 +0,0 @@ -# plba-fullchain-explain-trace-service - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_retrieval.yaml -- runner: runtime -- mode: full_chain -- passed: True - -## Query -Как работает TraceService? - -## Actual -{ - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 14, - "llm_answer": "## Объяснение работы `TraceService`\n\n### Назначение\n`TraceService` — это сервис, предназначенный для управления контекстом трассировки и записи логических событий во время выполнения программы. Он участвует в потоке данных системы, обеспечивая запись информации о каждом этапе выполнения с возможностью последующего анализа и мониторинга.\n\n### Ключевые зависимости\n- **TraceContextFactory**: Базовый класс, от которого наследуется `TraceService`. \n- **TraceTransport**: Интерфейс транспортировки данных трассировки.\n- **TraceContextStore**: Класс для хранения контекста трассировки.\n- **NoOpTraceTransport**: Специальная реализация `TraceTransport`, используемая при отсутствии реальной транспортной инфраструктуры.\n- **TraceRecordWriter**: Вспомогательный класс для записи записей трассировки в транспортную систему.\n\n### Поток данных или вызовов\n1. При инициализации (`__init__`) создается экземпляр класса `TraceRecordWriter`, который записывает записи трассировки через указанный транспорт (`TraceTransport`).\n \n ```python\n def __init__(self, transport: TraceTransport | None = None, store: TraceContextStore | None = None):\n ...\n self._writer = TraceRecordWriter(self.transport)\n ```\n\n2. Основной метод создания нового контекста трассировки (`create_context`) создает новую запись трассировки (`TraceContextRecord`), добавляет её в хранилище (`store`) и записывает через транспорт (`_writer`).\n\n ```python\n def create_context(\n self,\n *,\n alias: str,\n parent_id: str | None = None,\n kind: str | None = None,\n attrs: dict[str, Any] | None = None,\n ) -> str:\n ...\n self.store.push(record)\n self._writer.write_context(record)\n return record.trace_id\n ```\n\n3. Метод `open_context` предоставляет контекст трассировки внутри блока `with`, создавая новый контекст трассировки и возвращая идентификатор этого контекста.\n\n ```python\n @contextmanager\n def open_context(\n self,\n *,\n alias: str,\n parent_id: str | None = None,\n kind: str | None = None,\n attrs: dict[str, Any] | None = None,\n ) -> Iterator[str]:\n trace_id = self.create_context(alias=alias, parent_id=parent_id, kind=kind, attrs=attrs)\n yield trace_id\n ```\n\n### Важные детали реализации\n- Запись сообщений трассировки осуществляется методом `_writer.write_message`.\n- Хранилище контекста трассировки используется для сохранения всех созданных записей трассировки.\n- Если транспорт недоступен или возникает ошибка при передаче сообщения, это фиксируется в журнале ошибок.\n \n ```python\n class TraceRecordWriter:\n def write_message(self, record: TraceLogMessage) -> None:\n try:\n self._transport.write_message(record)\n except Exception:\n self._logger.exception(\"Trace transport failed to write message for %s\", record.trace_id)\n ```\n\n### Остерегайтесь выводов\nНекоторые выводы сделаны на основе косвенных признаков и предположений, основанных на доступных фрагментах кода и структуре зависимостей. Например, роль метода `_writer.write_message` точно определяется исключительно по сигнатуре и отсутствию подробных комментариев в исходном коде.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "TraceService" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] -} - -## Mismatches -- none \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_112158/full_chain_plba_code_retrieval_plba-fullchain-explain-workflow-engine.json b/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_112158/full_chain_plba_code_retrieval_plba-fullchain-explain-workflow-engine.json deleted file mode 100644 index a850326..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_112158/full_chain_plba_code_retrieval_plba-fullchain-explain-workflow-engine.json +++ /dev/null @@ -1,2158 +0,0 @@ -{ - "case_id": "plba-fullchain-explain-workflow-engine", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_retrieval.yaml", - "runner": "runtime", - "mode": "full_chain", - "actual": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 13, - "llm_answer": "## Объяснение сущности `WorkflowEngine`\n\n### Назначение\nКласс `WorkflowEngine` является основным компонентом конвейера выполнения рабочих процессов (`workflow`) в приложении. Он отвечает за управление жизненным циклом рабочего процесса, отслеживание состояния его выполнения и взаимодействие с внешними хранилищами данных для сохранения прогресса выполнения.\n\n### Ключевые зависимости\n- **workflow**: определение рабочего процесса, включая начальные и конечные узлы, а также переходы между ними.\n- **persistence**: механизм хранения информации о текущем состоянии выполнения рабочего процесса.\n- **traces**: логирование и мониторинг текущего состояния выполнения.\n- **hooks**: дополнительные пользовательские обработчики событий, позволяющие расширять поведение рабочего процесса.\n\n### Поток данных или вызовов\n1. При инициализации класса вызывается метод `__init__`, который принимает следующие параметры:\n - `workflow`: объект определения рабочего процесса.\n - `persistence`: механизм постоянного хранения состояния.\n - `traces`: компонент логирования и мониторинга.\n - `hooks`: дополнительные пользовательские обработчики событий.\n \n2. После инициализации рабочий процесс запускается через метод `run`. Этот метод выполняет следующие шаги:\n - Получает идентификатор текущей рабочей сессии (`run_id`) от механизма постоянного хранения (`persistence`).\n - Сохраняет текущее состояние выполнения в контексте выполнения.\n - Запускает первый шаг рабочего процесса, записывая текущий узел в контекст выполнения.\n - Циклически переходит к следующему узлу до тех пор, пока не достигнет конечного узла.\n\n3. Внутри цикла происходит обработка каждого шага рабочего процесса следующим образом:\n - Определяется следующий узел по имени текущего узла.\n - Выполняются действия, связанные с текущим узлом.\n - Текущий узел сохраняется в контексте выполнения.\n\n### Важные детали реализации\n- **Переходы между узлами**: переходы внутри рабочего процесса определяются внутренними связями узлов. Каждый узел имеет ссылку на следующий узел в рабочем процессе.\n- **Логирование и мониторинг**: все этапы выполнения регистрируются с помощью механизма логирования (`logging`), что позволяет отслеживать прогресс выполнения рабочего процесса.\n- **Постоянное хранение состояния**: рабочее состояние хранится во внешней системе постоянного хранения (`persistence`), что обеспечивает возможность восстановления работы после прерывания.\n- **Пользовательские расширения**: при помощи интерфейса `WorkflowEngineHooks` можно легко добавлять кастомные функции-обработчики, которые будут выполняться в определенные моменты жизненного цикла рабочего процесса.\n\n---\n\n### Косвенные признаки и осторожные выводы\n- Файл [src/app_runtime/workflow/engine/workflow_engine.py](C1_SYMBOL_CATALOG): файл содержит реализацию класса `WorkflowEngine`.\n- Взаимодействие с другими модулями через механизм HTTP API ([C3_ENTRYPOINTS]: src/app_runtime/control/http_app.py | app.post), однако конкретные детали этого взаимодействия напрямую не видны из предоставленного контекста.\n\nЭтот обзор основан исключительно на доступных файлах и слоях анализа RAG, поэтому некоторые аспекты могут быть оценены осторожно.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "WorkflowEngine" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "passed": true, - "mismatches": [], - "details": { - "case_id": "plba-fullchain-explain-workflow-engine", - "text": "Объясни класс WorkflowEngine", - "mode": "full_chain", - "run_started_at": "2026-03-12T11:21:59", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Объясни класс WorkflowEngine", - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "WorkflowEngine", - "alternatives": [ - "WorkflowEngine", - "WorkflowEngineHooks" - ], - "confidence": 0.99 - }, - "rag_count": 13, - "rag_rows": [ - { - "path": "src/app_runtime/workflow/engine/workflow_engine.py", - "content": "class WorkflowEngine\nWorkflowEngine", - "layer": "C1_SYMBOL_CATALOG", - "title": "WorkflowEngine", - "span_start": 10, - "span_end": 86, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "57ec0a9f11c542c78e008684a888397e8d9ef4223671acb2567e631a0cbc70b4", - "qname": "WorkflowEngine", - "kind": "class", - "signature": "WorkflowEngine", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.workflow.engine.workflow_engine", - "is_test": false, - "blob_sha": "1057136e58a325cd5ab6f4e265d15665fb6a711b7022d9fab52a1a290afa2368", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/engine/hooks.py", - "content": "class WorkflowEngineHooks\nWorkflowEngineHooks", - "layer": "C1_SYMBOL_CATALOG", - "title": "WorkflowEngineHooks", - "span_start": 6, - "span_end": 14, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "914123ed510540061e116100fc87bba4195595ba696f8bfde2fd77ac6a5cd7e4", - "qname": "WorkflowEngineHooks", - "kind": "class", - "signature": "WorkflowEngineHooks", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.workflow.engine.hooks", - "is_test": false, - "blob_sha": "4b11672b0a9af1ae04bfce9d8e1f96572997d3e65e68108d7c797b88fa5fa47a", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/engine/workflow_engine.py", - "content": "WorkflowEngine\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (6)", - "layer": "C4_SEMANTIC_ROLES", - "title": "WorkflowEngine", - "span_start": 10, - "span_end": 86, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 25, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "57ec0a9f11c542c78e008684a888397e8d9ef4223671acb2567e631a0cbc70b4", - "symbol_name": "WorkflowEngine", - "qname": "WorkflowEngine", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 6, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "1057136e58a325cd5ab6f4e265d15665fb6a711b7022d9fab52a1a290afa2368", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/engine/workflow_engine.py", - "content": "WorkflowEngine.__init__\n -> WorkflowEngine._transition_resolver\n -> WorkflowEngine.run", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "WorkflowEngine.__init__:dataflow_slice", - "span_start": 14, - "span_end": 63, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "3abf07e5c245e0fe59785ba2d569c2ee56018715fc7f625a044ddaf6201f903d", - "edge_type": "dataflow_slice", - "src_symbol_id": "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "src_qname": "WorkflowEngine.__init__", - "dst_symbol_id": "a12cad0f5b238287e02f6d8d156cc764351d8c83246930487fa09d5ce6f2ace8", - "dst_ref": "WorkflowEngine.run", - "resolution": "resolved", - "slice_id": "3abf07e5c245e0fe59785ba2d569c2ee56018715fc7f625a044ddaf6201f903d", - "root_symbol_id": "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "path_symbols": [ - "WorkflowEngine.__init__", - "WorkflowEngine._transition_resolver", - "WorkflowEngine.run" - ], - "path_symbol_ids": [ - "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "a12cad0f5b238287e02f6d8d156cc764351d8c83246930487fa09d5ce6f2ace8" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "1057136e58a325cd5ab6f4e265d15665fb6a711b7022d9fab52a1a290afa2368", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/engine/workflow_engine.py", - "content": "WorkflowEngine.__init__\n -> WorkflowEngine._hooks\n -> WorkflowEngine.run", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "WorkflowEngine.__init__:dataflow_slice", - "span_start": 16, - "span_end": 34, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "d73db644b69c1eb35afd6eae9d6ac8674e49e30e9bcf9c020f9fdbfe754851b2", - "edge_type": "dataflow_slice", - "src_symbol_id": "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "src_qname": "WorkflowEngine.__init__", - "dst_symbol_id": "a12cad0f5b238287e02f6d8d156cc764351d8c83246930487fa09d5ce6f2ace8", - "dst_ref": "WorkflowEngine.run", - "resolution": "resolved", - "slice_id": "d73db644b69c1eb35afd6eae9d6ac8674e49e30e9bcf9c020f9fdbfe754851b2", - "root_symbol_id": "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "path_symbols": [ - "WorkflowEngine.__init__", - "WorkflowEngine._hooks", - "WorkflowEngine.run" - ], - "path_symbol_ids": [ - "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "a12cad0f5b238287e02f6d8d156cc764351d8c83246930487fa09d5ce6f2ace8" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "1057136e58a325cd5ab6f4e265d15665fb6a711b7022d9fab52a1a290afa2368", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/engine/workflow_engine.py", - "content": "WorkflowEngine.__init__\n -> WorkflowEngine._workflow\n -> WorkflowEngine.run", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "WorkflowEngine.__init__:dataflow_slice", - "span_start": 12, - "span_end": 29, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "b45ef3c54669b4910a8aed3a565804f275424a24007bc7e3c953389521f80249", - "edge_type": "dataflow_slice", - "src_symbol_id": "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "src_qname": "WorkflowEngine.__init__", - "dst_symbol_id": "a12cad0f5b238287e02f6d8d156cc764351d8c83246930487fa09d5ce6f2ace8", - "dst_ref": "WorkflowEngine.run", - "resolution": "resolved", - "slice_id": "b45ef3c54669b4910a8aed3a565804f275424a24007bc7e3c953389521f80249", - "root_symbol_id": "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "path_symbols": [ - "WorkflowEngine.__init__", - "WorkflowEngine._workflow", - "WorkflowEngine.run" - ], - "path_symbol_ids": [ - "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "a12cad0f5b238287e02f6d8d156cc764351d8c83246930487fa09d5ce6f2ace8" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "1057136e58a325cd5ab6f4e265d15665fb6a711b7022d9fab52a1a290afa2368", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/engine/workflow_engine.py", - "content": "WorkflowEngine.__init__\n -> WorkflowEngine._persistence\n -> WorkflowEngine.run", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "WorkflowEngine.__init__:dataflow_slice", - "span_start": 13, - "span_end": 20, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "8101338770016324ce05d61daa9935a444c75e6c94a0fae4275d5b50fcbcc70b", - "edge_type": "dataflow_slice", - "src_symbol_id": "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "src_qname": "WorkflowEngine.__init__", - "dst_symbol_id": "a12cad0f5b238287e02f6d8d156cc764351d8c83246930487fa09d5ce6f2ace8", - "dst_ref": "WorkflowEngine.run", - "resolution": "resolved", - "slice_id": "8101338770016324ce05d61daa9935a444c75e6c94a0fae4275d5b50fcbcc70b", - "root_symbol_id": "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "path_symbols": [ - "WorkflowEngine.__init__", - "WorkflowEngine._persistence", - "WorkflowEngine.run" - ], - "path_symbol_ids": [ - "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "a12cad0f5b238287e02f6d8d156cc764351d8c83246930487fa09d5ce6f2ace8" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "1057136e58a325cd5ab6f4e265d15665fb6a711b7022d9fab52a1a290afa2368", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/engine/workflow_engine.py", - "content": "WorkflowEngine.__init__\n -> WorkflowEngine._traces\n -> WorkflowEngine.run", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "WorkflowEngine.__init__:dataflow_slice", - "span_start": 15, - "span_end": 27, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "5006266616d534d721648391565e2ac0c9e7e9d9f8df00c17fba8989afb533a5", - "edge_type": "dataflow_slice", - "src_symbol_id": "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "src_qname": "WorkflowEngine.__init__", - "dst_symbol_id": "a12cad0f5b238287e02f6d8d156cc764351d8c83246930487fa09d5ce6f2ace8", - "dst_ref": "WorkflowEngine.run", - "resolution": "resolved", - "slice_id": "5006266616d534d721648391565e2ac0c9e7e9d9f8df00c17fba8989afb533a5", - "root_symbol_id": "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "path_symbols": [ - "WorkflowEngine.__init__", - "WorkflowEngine._traces", - "WorkflowEngine.run" - ], - "path_symbol_ids": [ - "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "a12cad0f5b238287e02f6d8d156cc764351d8c83246930487fa09d5ce6f2ace8" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "1057136e58a325cd5ab6f4e265d15665fb6a711b7022d9fab52a1a290afa2368", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/engine/workflow_engine.py", - "content": "WorkflowEngine.__init__\n -> WorkflowEngine._logger\n -> WorkflowEngine.run", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "WorkflowEngine.__init__:dataflow_slice", - "span_start": 17, - "span_end": 85, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "2f9927abb24794adb056b94bfb5d8538a5cbafb160da2079f52fca97fd694a2b", - "edge_type": "dataflow_slice", - "src_symbol_id": "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "src_qname": "WorkflowEngine.__init__", - "dst_symbol_id": "a12cad0f5b238287e02f6d8d156cc764351d8c83246930487fa09d5ce6f2ace8", - "dst_ref": "WorkflowEngine.run", - "resolution": "resolved", - "slice_id": "2f9927abb24794adb056b94bfb5d8538a5cbafb160da2079f52fca97fd694a2b", - "root_symbol_id": "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "path_symbols": [ - "WorkflowEngine.__init__", - "WorkflowEngine._logger", - "WorkflowEngine.run" - ], - "path_symbol_ids": [ - "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "a12cad0f5b238287e02f6d8d156cc764351d8c83246930487fa09d5ce6f2ace8" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "1057136e58a325cd5ab6f4e265d15665fb6a711b7022d9fab52a1a290afa2368", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/engine/workflow_engine.py", - "content": "class WorkflowEngine:\n def __init__(self, workflow, persistence, *, traces, hooks: WorkflowEngineHooks | None = None) -> None:\n self._workflow = workflow\n self._persistence = persistence\n self._transition_resolver = TransitionResolver()\n self._traces = traces\n self._hooks = hooks or WorkflowEngineHooks()\n self._logger = logging.getLogger(__name__)\n\n def run(self, context: WorkflowContext) -> dict[str, object]:\n run_id = self._persistence.start_run(\n self._workflow.definition.name,\n self._workflow.definition.start_at,\n context.snapshot(),\n )\n context.state.setdefault(\"runtime\", {})\n context.state[\"runtime\"][\"workflow_run_id\"] = run_id\n self._traces.step(\"workflow\")\n self._traces.info(\"Workflow started.\", status=\"started\", attrs={\"workflow_run_id\": run_id})\n current_name = self._workflow.definition.start_at\n while current_name is not None:\n node = self._workflow.definition.nodes[current_name]\n context.state[\"runtime\"][\"current_node\"] = current_name\n self._logger.info(\"Workflow run %s: step '%s' started.\", run_id, current_name)\n self._hooks.on_step_started(context, current_name)\n self._persistence.start_step(run_id, current_name, context.snapshot())\n self._traces.step(current_name)\n self._traces.debug(\n f\"Step '{current_name}' started.\",\n status=\"started\",\n attrs={\"workflow_run_id\": run_id, \"node\": current_name},\n )\n try:\n result = node.step.run(context)\n except Exception as error:\n self._persistence.fail_step(run_id, current_name, context.snapshot(), error)\n self._persistence.fail_run(run_id, context.snapshot())\n self._traces.error(\n f\"Step '{current_name}' failed: {error}\",\n status=\"failed\",\n attrs={\"exception_type\": type(error).__name__},\n )\n self._logger.exception(\"Workflow run %s: step '%s' failed.\", run_id, current_name)\n self._hooks.on_step_failed(context, current_name)\n raise\n context.state.update(result.updates)\n self._persistence.complete_step(\n run_id,\n current_name,\n result.status,\n result.transition,\n context.snapshot(),\n )\n next_node = self._transition_resolver.resolve(node, result)\n self._traces.debug(\n f\"Step '{current_name}' completed with transition '{result.transition}'.\",\n status=result.status,\n attrs={\n \"workflow_run_id\": run_id,\n \"from_node\": current_name,\n \"transition\": result.transition,\n \"to_node\": next_node,\n },\n )\n self._logger.info(\n \"Workflow run %s: step '%s' completed with transition '%s'.\",\n run_id,\n current_name,\n result.transition,\n )\n self._hooks.on_step_finished(context, current_name)\n current_name = next_node\n self._persistence.complete_run(run_id, context.snapshot())\n self._traces.step(\"workflow\")\n self._traces.info(\"Workflow completed.\", status=\"completed\", attrs={\"workflow_run_id\": run_id})\n self._logger.info(\"Workflow run %s completed.\", run_id)\n return {\"run_id\": run_id, \"status\": \"completed\", \"context\": context.snapshot()}", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/workflow/engine/workflow_engine.py:WorkflowEngine", - "span_start": 10, - "span_end": 86, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.workflow.engine.workflow_engine", - "is_test": false, - "blob_sha": "1057136e58a325cd5ab6f4e265d15665fb6a711b7022d9fab52a1a290afa2368", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "llm_answer": "## Объяснение сущности `WorkflowEngine`\n\n### Назначение\nКласс `WorkflowEngine` является основным компонентом конвейера выполнения рабочих процессов (`workflow`) в приложении. Он отвечает за управление жизненным циклом рабочего процесса, отслеживание состояния его выполнения и взаимодействие с внешними хранилищами данных для сохранения прогресса выполнения.\n\n### Ключевые зависимости\n- **workflow**: определение рабочего процесса, включая начальные и конечные узлы, а также переходы между ними.\n- **persistence**: механизм хранения информации о текущем состоянии выполнения рабочего процесса.\n- **traces**: логирование и мониторинг текущего состояния выполнения.\n- **hooks**: дополнительные пользовательские обработчики событий, позволяющие расширять поведение рабочего процесса.\n\n### Поток данных или вызовов\n1. При инициализации класса вызывается метод `__init__`, который принимает следующие параметры:\n - `workflow`: объект определения рабочего процесса.\n - `persistence`: механизм постоянного хранения состояния.\n - `traces`: компонент логирования и мониторинга.\n - `hooks`: дополнительные пользовательские обработчики событий.\n \n2. После инициализации рабочий процесс запускается через метод `run`. Этот метод выполняет следующие шаги:\n - Получает идентификатор текущей рабочей сессии (`run_id`) от механизма постоянного хранения (`persistence`).\n - Сохраняет текущее состояние выполнения в контексте выполнения.\n - Запускает первый шаг рабочего процесса, записывая текущий узел в контекст выполнения.\n - Циклически переходит к следующему узлу до тех пор, пока не достигнет конечного узла.\n\n3. Внутри цикла происходит обработка каждого шага рабочего процесса следующим образом:\n - Определяется следующий узел по имени текущего узла.\n - Выполняются действия, связанные с текущим узлом.\n - Текущий узел сохраняется в контексте выполнения.\n\n### Важные детали реализации\n- **Переходы между узлами**: переходы внутри рабочего процесса определяются внутренними связями узлов. Каждый узел имеет ссылку на следующий узел в рабочем процессе.\n- **Логирование и мониторинг**: все этапы выполнения регистрируются с помощью механизма логирования (`logging`), что позволяет отслеживать прогресс выполнения рабочего процесса.\n- **Постоянное хранение состояния**: рабочее состояние хранится во внешней системе постоянного хранения (`persistence`), что обеспечивает возможность восстановления работы после прерывания.\n- **Пользовательские расширения**: при помощи интерфейса `WorkflowEngineHooks` можно легко добавлять кастомные функции-обработчики, которые будут выполняться в определенные моменты жизненного цикла рабочего процесса.\n\n---\n\n### Косвенные признаки и осторожные выводы\n- Файл [src/app_runtime/workflow/engine/workflow_engine.py](C1_SYMBOL_CATALOG): файл содержит реализацию класса `WorkflowEngine`.\n- Взаимодействие с другими модулями через механизм HTTP API ([C3_ENTRYPOINTS]: src/app_runtime/control/http_app.py | app.post), однако конкретные детали этого взаимодействия напрямую не видны из предоставленного контекста.\n\nЭтот обзор основан исключительно на доступных файлах и слоях анализа RAG, поэтому некоторые аспекты могут быть оценены осторожно.", - "summary": { - "router": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "confidence": null - }, - "retrieval": { - "profile": "code", - "layers_hit": [ - "C0_SOURCE_CHUNKS", - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS", - "C4_SEMANTIC_ROLES" - ], - "evidence_sufficient": true - }, - "llm": { - "answer_status": "answered", - "groundedness": "grounded" - } - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "WorkflowEngine" - ], - "keyword_hints": [ - "WorkflowEngine" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C0_SOURCE_CHUNKS": "exact_path_fetch", - "C4_SEMANTIC_ROLES": "exact_path_fetch", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C3_ENTRYPOINTS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 8, - "C4_SEMANTIC_ROLES": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C3_ENTRYPOINTS": 6 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C4_SEMANTIC_ROLES": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "WorkflowEngine", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "WorkflowEngine", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C4_SEMANTIC_ROLES", - "query": "WorkflowEngine", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "WorkflowEngine", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - }, - { - "layer": "C3_ENTRYPOINTS", - "query": "WorkflowEngine", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 2, - "candidates_after_filter": 2 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 6, - "candidates_after_filter": 6 - }, - { - "layer": "C3_ENTRYPOINTS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 3, - "candidates_after_filter": 3 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "WorkflowEngine", - "alternatives": [ - "WorkflowEngine", - "WorkflowEngineHooks" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "hit", - "hit_count": 2, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C4_SEMANTIC_ROLES", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 6, - "fail_reason": null - }, - { - "layer": "C3_ENTRYPOINTS", - "status": "hit", - "hit_count": 3, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "router": 0, - "symbol_resolution": 0, - "retrieval_total": 139, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 45, - "C0_SOURCE_CHUNKS": 21, - "C4_SEMANTIC_ROLES": 15, - "C2_DEPENDENCY_GRAPH": 45, - "C3_ENTRYPOINTS": 10 - }, - "merge_rank": 29, - "prompt_build": 0, - "llm_call": 4329 - }, - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 780, - "evidence_rows": 13, - "evidence_chars": 4423 - }, - "evidence_summary": [ - { - "layer": "C1_SYMBOL_CATALOG", - "count": 2, - "unique_paths": 2 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "count": 6, - "unique_paths": 1 - }, - { - "layer": "C3_ENTRYPOINTS", - "count": 3, - "unique_paths": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 1, - "unique_paths": 1 - } - ], - "prompt_template_id": "intent_code_qa_explain_ru_v1", - "system_prompt_version": "v1" - }, - "router": { - "conversation_mode": "START", - "keyword_hints": [ - "WorkflowEngine" - ], - "path_scope": [] - }, - "llm": { - "used_evidence_count": 13, - "missing_evidence_reason": null - } - }, - "run_info": { - "case_id": "plba-fullchain-explain-workflow-engine", - "mode": "full_chain", - "run_started_at": "2026-03-12T11:21:59", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - }, - "input_request": { - "text": "Объясни класс WorkflowEngine", - "normalized_query": "Объясни класс WorkflowEngine" - }, - "steps": [ - { - "step": "intent_router", - "input": { - "query": "Объясни класс WorkflowEngine" - }, - "output": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Объясни класс WorkflowEngine" - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "WorkflowEngine" - ], - "keyword_hints": [ - "WorkflowEngine" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "timings_ms": { - "router": 0 - } - } - }, - { - "step": "retrieval", - "input": { - "query": "Объясни класс WorkflowEngine" - }, - "output": { - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "WorkflowEngine", - "alternatives": [ - "WorkflowEngine", - "WorkflowEngineHooks" - ], - "confidence": 0.99 - }, - "rag_count": 13, - "rag_rows": [ - { - "path": "src/app_runtime/workflow/engine/workflow_engine.py", - "content": "class WorkflowEngine\nWorkflowEngine", - "layer": "C1_SYMBOL_CATALOG", - "title": "WorkflowEngine", - "span_start": 10, - "span_end": 86, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "57ec0a9f11c542c78e008684a888397e8d9ef4223671acb2567e631a0cbc70b4", - "qname": "WorkflowEngine", - "kind": "class", - "signature": "WorkflowEngine", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.workflow.engine.workflow_engine", - "is_test": false, - "blob_sha": "1057136e58a325cd5ab6f4e265d15665fb6a711b7022d9fab52a1a290afa2368", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/engine/hooks.py", - "content": "class WorkflowEngineHooks\nWorkflowEngineHooks", - "layer": "C1_SYMBOL_CATALOG", - "title": "WorkflowEngineHooks", - "span_start": 6, - "span_end": 14, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "914123ed510540061e116100fc87bba4195595ba696f8bfde2fd77ac6a5cd7e4", - "qname": "WorkflowEngineHooks", - "kind": "class", - "signature": "WorkflowEngineHooks", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.workflow.engine.hooks", - "is_test": false, - "blob_sha": "4b11672b0a9af1ae04bfce9d8e1f96572997d3e65e68108d7c797b88fa5fa47a", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/engine/workflow_engine.py", - "content": "WorkflowEngine\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (6)", - "layer": "C4_SEMANTIC_ROLES", - "title": "WorkflowEngine", - "span_start": 10, - "span_end": 86, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 25, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "57ec0a9f11c542c78e008684a888397e8d9ef4223671acb2567e631a0cbc70b4", - "symbol_name": "WorkflowEngine", - "qname": "WorkflowEngine", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 6, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "1057136e58a325cd5ab6f4e265d15665fb6a711b7022d9fab52a1a290afa2368", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/engine/workflow_engine.py", - "content": "WorkflowEngine.__init__\n -> WorkflowEngine._transition_resolver\n -> WorkflowEngine.run", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "WorkflowEngine.__init__:dataflow_slice", - "span_start": 14, - "span_end": 63, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "3abf07e5c245e0fe59785ba2d569c2ee56018715fc7f625a044ddaf6201f903d", - "edge_type": "dataflow_slice", - "src_symbol_id": "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "src_qname": "WorkflowEngine.__init__", - "dst_symbol_id": "a12cad0f5b238287e02f6d8d156cc764351d8c83246930487fa09d5ce6f2ace8", - "dst_ref": "WorkflowEngine.run", - "resolution": "resolved", - "slice_id": "3abf07e5c245e0fe59785ba2d569c2ee56018715fc7f625a044ddaf6201f903d", - "root_symbol_id": "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "path_symbols": [ - "WorkflowEngine.__init__", - "WorkflowEngine._transition_resolver", - "WorkflowEngine.run" - ], - "path_symbol_ids": [ - "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "a12cad0f5b238287e02f6d8d156cc764351d8c83246930487fa09d5ce6f2ace8" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "1057136e58a325cd5ab6f4e265d15665fb6a711b7022d9fab52a1a290afa2368", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/engine/workflow_engine.py", - "content": "WorkflowEngine.__init__\n -> WorkflowEngine._hooks\n -> WorkflowEngine.run", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "WorkflowEngine.__init__:dataflow_slice", - "span_start": 16, - "span_end": 34, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "d73db644b69c1eb35afd6eae9d6ac8674e49e30e9bcf9c020f9fdbfe754851b2", - "edge_type": "dataflow_slice", - "src_symbol_id": "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "src_qname": "WorkflowEngine.__init__", - "dst_symbol_id": "a12cad0f5b238287e02f6d8d156cc764351d8c83246930487fa09d5ce6f2ace8", - "dst_ref": "WorkflowEngine.run", - "resolution": "resolved", - "slice_id": "d73db644b69c1eb35afd6eae9d6ac8674e49e30e9bcf9c020f9fdbfe754851b2", - "root_symbol_id": "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "path_symbols": [ - "WorkflowEngine.__init__", - "WorkflowEngine._hooks", - "WorkflowEngine.run" - ], - "path_symbol_ids": [ - "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "a12cad0f5b238287e02f6d8d156cc764351d8c83246930487fa09d5ce6f2ace8" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "1057136e58a325cd5ab6f4e265d15665fb6a711b7022d9fab52a1a290afa2368", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/engine/workflow_engine.py", - "content": "WorkflowEngine.__init__\n -> WorkflowEngine._workflow\n -> WorkflowEngine.run", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "WorkflowEngine.__init__:dataflow_slice", - "span_start": 12, - "span_end": 29, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "b45ef3c54669b4910a8aed3a565804f275424a24007bc7e3c953389521f80249", - "edge_type": "dataflow_slice", - "src_symbol_id": "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "src_qname": "WorkflowEngine.__init__", - "dst_symbol_id": "a12cad0f5b238287e02f6d8d156cc764351d8c83246930487fa09d5ce6f2ace8", - "dst_ref": "WorkflowEngine.run", - "resolution": "resolved", - "slice_id": "b45ef3c54669b4910a8aed3a565804f275424a24007bc7e3c953389521f80249", - "root_symbol_id": "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "path_symbols": [ - "WorkflowEngine.__init__", - "WorkflowEngine._workflow", - "WorkflowEngine.run" - ], - "path_symbol_ids": [ - "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "a12cad0f5b238287e02f6d8d156cc764351d8c83246930487fa09d5ce6f2ace8" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "1057136e58a325cd5ab6f4e265d15665fb6a711b7022d9fab52a1a290afa2368", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/engine/workflow_engine.py", - "content": "WorkflowEngine.__init__\n -> WorkflowEngine._persistence\n -> WorkflowEngine.run", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "WorkflowEngine.__init__:dataflow_slice", - "span_start": 13, - "span_end": 20, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "8101338770016324ce05d61daa9935a444c75e6c94a0fae4275d5b50fcbcc70b", - "edge_type": "dataflow_slice", - "src_symbol_id": "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "src_qname": "WorkflowEngine.__init__", - "dst_symbol_id": "a12cad0f5b238287e02f6d8d156cc764351d8c83246930487fa09d5ce6f2ace8", - "dst_ref": "WorkflowEngine.run", - "resolution": "resolved", - "slice_id": "8101338770016324ce05d61daa9935a444c75e6c94a0fae4275d5b50fcbcc70b", - "root_symbol_id": "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "path_symbols": [ - "WorkflowEngine.__init__", - "WorkflowEngine._persistence", - "WorkflowEngine.run" - ], - "path_symbol_ids": [ - "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "a12cad0f5b238287e02f6d8d156cc764351d8c83246930487fa09d5ce6f2ace8" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "1057136e58a325cd5ab6f4e265d15665fb6a711b7022d9fab52a1a290afa2368", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/engine/workflow_engine.py", - "content": "WorkflowEngine.__init__\n -> WorkflowEngine._traces\n -> WorkflowEngine.run", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "WorkflowEngine.__init__:dataflow_slice", - "span_start": 15, - "span_end": 27, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "5006266616d534d721648391565e2ac0c9e7e9d9f8df00c17fba8989afb533a5", - "edge_type": "dataflow_slice", - "src_symbol_id": "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "src_qname": "WorkflowEngine.__init__", - "dst_symbol_id": "a12cad0f5b238287e02f6d8d156cc764351d8c83246930487fa09d5ce6f2ace8", - "dst_ref": "WorkflowEngine.run", - "resolution": "resolved", - "slice_id": "5006266616d534d721648391565e2ac0c9e7e9d9f8df00c17fba8989afb533a5", - "root_symbol_id": "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "path_symbols": [ - "WorkflowEngine.__init__", - "WorkflowEngine._traces", - "WorkflowEngine.run" - ], - "path_symbol_ids": [ - "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "a12cad0f5b238287e02f6d8d156cc764351d8c83246930487fa09d5ce6f2ace8" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "1057136e58a325cd5ab6f4e265d15665fb6a711b7022d9fab52a1a290afa2368", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/engine/workflow_engine.py", - "content": "WorkflowEngine.__init__\n -> WorkflowEngine._logger\n -> WorkflowEngine.run", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "WorkflowEngine.__init__:dataflow_slice", - "span_start": 17, - "span_end": 85, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "2f9927abb24794adb056b94bfb5d8538a5cbafb160da2079f52fca97fd694a2b", - "edge_type": "dataflow_slice", - "src_symbol_id": "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "src_qname": "WorkflowEngine.__init__", - "dst_symbol_id": "a12cad0f5b238287e02f6d8d156cc764351d8c83246930487fa09d5ce6f2ace8", - "dst_ref": "WorkflowEngine.run", - "resolution": "resolved", - "slice_id": "2f9927abb24794adb056b94bfb5d8538a5cbafb160da2079f52fca97fd694a2b", - "root_symbol_id": "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "path_symbols": [ - "WorkflowEngine.__init__", - "WorkflowEngine._logger", - "WorkflowEngine.run" - ], - "path_symbol_ids": [ - "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "a12cad0f5b238287e02f6d8d156cc764351d8c83246930487fa09d5ce6f2ace8" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "1057136e58a325cd5ab6f4e265d15665fb6a711b7022d9fab52a1a290afa2368", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/engine/workflow_engine.py", - "content": "class WorkflowEngine:\n def __init__(self, workflow, persistence, *, traces, hooks: WorkflowEngineHooks | None = None) -> None:\n self._workflow = workflow\n self._persistence = persistence\n self._transition_resolver = TransitionResolver()\n self._traces = traces\n self._hooks = hooks or WorkflowEngineHooks()\n self._logger = logging.getLogger(__name__)\n\n def run(self, context: WorkflowContext) -> dict[str, object]:\n run_id = self._persistence.start_run(\n self._workflow.definition.name,\n self._workflow.definition.start_at,\n context.snapshot(),\n )\n context.state.setdefault(\"runtime\", {})\n context.state[\"runtime\"][\"workflow_run_id\"] = run_id\n self._traces.step(\"workflow\")\n self._traces.info(\"Workflow started.\", status=\"started\", attrs={\"workflow_run_id\": run_id})\n current_name = self._workflow.definition.start_at\n while current_name is not None:\n node = self._workflow.definition.nodes[current_name]\n context.state[\"runtime\"][\"current_node\"] = current_name\n self._logger.info(\"Workflow run %s: step '%s' started.\", run_id, current_name)\n self._hooks.on_step_started(context, current_name)\n self._persistence.start_step(run_id, current_name, context.snapshot())\n self._traces.step(current_name)\n self._traces.debug(\n f\"Step '{current_name}' started.\",\n status=\"started\",\n attrs={\"workflow_run_id\": run_id, \"node\": current_name},\n )\n try:\n result = node.step.run(context)\n except Exception as error:\n self._persistence.fail_step(run_id, current_name, context.snapshot(), error)\n self._persistence.fail_run(run_id, context.snapshot())\n self._traces.error(\n f\"Step '{current_name}' failed: {error}\",\n status=\"failed\",\n attrs={\"exception_type\": type(error).__name__},\n )\n self._logger.exception(\"Workflow run %s: step '%s' failed.\", run_id, current_name)\n self._hooks.on_step_failed(context, current_name)\n raise\n context.state.update(result.updates)\n self._persistence.complete_step(\n run_id,\n current_name,\n result.status,\n result.transition,\n context.snapshot(),\n )\n next_node = self._transition_resolver.resolve(node, result)\n self._traces.debug(\n f\"Step '{current_name}' completed with transition '{result.transition}'.\",\n status=result.status,\n attrs={\n \"workflow_run_id\": run_id,\n \"from_node\": current_name,\n \"transition\": result.transition,\n \"to_node\": next_node,\n },\n )\n self._logger.info(\n \"Workflow run %s: step '%s' completed with transition '%s'.\",\n run_id,\n current_name,\n result.transition,\n )\n self._hooks.on_step_finished(context, current_name)\n current_name = next_node\n self._persistence.complete_run(run_id, context.snapshot())\n self._traces.step(\"workflow\")\n self._traces.info(\"Workflow completed.\", status=\"completed\", attrs={\"workflow_run_id\": run_id})\n self._logger.info(\"Workflow run %s completed.\", run_id)\n return {\"run_id\": run_id, \"status\": \"completed\", \"context\": context.snapshot()}", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/workflow/engine/workflow_engine.py:WorkflowEngine", - "span_start": 10, - "span_end": 86, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.workflow.engine.workflow_engine", - "is_test": false, - "blob_sha": "1057136e58a325cd5ab6f4e265d15665fb6a711b7022d9fab52a1a290afa2368", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ] - }, - "diagnostics": { - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C0_SOURCE_CHUNKS": "exact_path_fetch", - "C4_SEMANTIC_ROLES": "exact_path_fetch", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C3_ENTRYPOINTS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 8, - "C4_SEMANTIC_ROLES": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C3_ENTRYPOINTS": 6 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C4_SEMANTIC_ROLES": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "WorkflowEngine", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "WorkflowEngine", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C4_SEMANTIC_ROLES", - "query": "WorkflowEngine", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "WorkflowEngine", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - }, - { - "layer": "C3_ENTRYPOINTS", - "query": "WorkflowEngine", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 2, - "candidates_after_filter": 2 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 6, - "candidates_after_filter": 6 - }, - { - "layer": "C3_ENTRYPOINTS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 3, - "candidates_after_filter": 3 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "WorkflowEngine", - "alternatives": [ - "WorkflowEngine", - "WorkflowEngineHooks" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "hit", - "hit_count": 2, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C4_SEMANTIC_ROLES", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 6, - "fail_reason": null - }, - { - "layer": "C3_ENTRYPOINTS", - "status": "hit", - "hit_count": 3, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "symbol_resolution": 0, - "retrieval_total": 139, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 45, - "C0_SOURCE_CHUNKS": 21, - "C4_SEMANTIC_ROLES": 15, - "C2_DEPENDENCY_GRAPH": 45, - "C3_ENTRYPOINTS": 10 - }, - "merge_rank": 29 - } - } - }, - { - "step": "llm_answer", - "input": { - "query": "Объясни класс WorkflowEngine", - "rag_count": 13 - }, - "output": { - "llm_answer": "## Объяснение сущности `WorkflowEngine`\n\n### Назначение\nКласс `WorkflowEngine` является основным компонентом конвейера выполнения рабочих процессов (`workflow`) в приложении. Он отвечает за управление жизненным циклом рабочего процесса, отслеживание состояния его выполнения и взаимодействие с внешними хранилищами данных для сохранения прогресса выполнения.\n\n### Ключевые зависимости\n- **workflow**: определение рабочего процесса, включая начальные и конечные узлы, а также переходы между ними.\n- **persistence**: механизм хранения информации о текущем состоянии выполнения рабочего процесса.\n- **traces**: логирование и мониторинг текущего состояния выполнения.\n- **hooks**: дополнительные пользовательские обработчики событий, позволяющие расширять поведение рабочего процесса.\n\n### Поток данных или вызовов\n1. При инициализации класса вызывается метод `__init__`, который принимает следующие параметры:\n - `workflow`: объект определения рабочего процесса.\n - `persistence`: механизм постоянного хранения состояния.\n - `traces`: компонент логирования и мониторинга.\n - `hooks`: дополнительные пользовательские обработчики событий.\n \n2. После инициализации рабочий процесс запускается через метод `run`. Этот метод выполняет следующие шаги:\n - Получает идентификатор текущей рабочей сессии (`run_id`) от механизма постоянного хранения (`persistence`).\n - Сохраняет текущее состояние выполнения в контексте выполнения.\n - Запускает первый шаг рабочего процесса, записывая текущий узел в контекст выполнения.\n - Циклически переходит к следующему узлу до тех пор, пока не достигнет конечного узла.\n\n3. Внутри цикла происходит обработка каждого шага рабочего процесса следующим образом:\n - Определяется следующий узел по имени текущего узла.\n - Выполняются действия, связанные с текущим узлом.\n - Текущий узел сохраняется в контексте выполнения.\n\n### Важные детали реализации\n- **Переходы между узлами**: переходы внутри рабочего процесса определяются внутренними связями узлов. Каждый узел имеет ссылку на следующий узел в рабочем процессе.\n- **Логирование и мониторинг**: все этапы выполнения регистрируются с помощью механизма логирования (`logging`), что позволяет отслеживать прогресс выполнения рабочего процесса.\n- **Постоянное хранение состояния**: рабочее состояние хранится во внешней системе постоянного хранения (`persistence`), что обеспечивает возможность восстановления работы после прерывания.\n- **Пользовательские расширения**: при помощи интерфейса `WorkflowEngineHooks` можно легко добавлять кастомные функции-обработчики, которые будут выполняться в определенные моменты жизненного цикла рабочего процесса.\n\n---\n\n### Косвенные признаки и осторожные выводы\n- Файл [src/app_runtime/workflow/engine/workflow_engine.py](C1_SYMBOL_CATALOG): файл содержит реализацию класса `WorkflowEngine`.\n- Взаимодействие с другими модулями через механизм HTTP API ([C3_ENTRYPOINTS]: src/app_runtime/control/http_app.py | app.post), однако конкретные детали этого взаимодействия напрямую не видны из предоставленного контекста.\n\nЭтот обзор основан исключительно на доступных файлах и слоях анализа RAG, поэтому некоторые аспекты могут быть оценены осторожно." - }, - "diagnostics": { - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 780, - "evidence_rows": 13, - "evidence_chars": 4423 - }, - "evidence_summary": [ - { - "layer": "C1_SYMBOL_CATALOG", - "count": 2, - "unique_paths": 2 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "count": 6, - "unique_paths": 1 - }, - { - "layer": "C3_ENTRYPOINTS", - "count": 3, - "unique_paths": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 1, - "unique_paths": 1 - } - ], - "prompt_template_id": "intent_code_qa_explain_ru_v1", - "system_prompt_version": "v1" - }, - "timings_ms": { - "prompt_build": 0, - "llm_call": 4329 - } - } - } - ] - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_112158/full_chain_plba_code_retrieval_plba-fullchain-explain-workflow-engine.md b/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_112158/full_chain_plba_code_retrieval_plba-fullchain-explain-workflow-engine.md deleted file mode 100644 index 2e24afe..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_112158/full_chain_plba_code_retrieval_plba-fullchain-explain-workflow-engine.md +++ /dev/null @@ -1,34 +0,0 @@ -# plba-fullchain-explain-workflow-engine - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_retrieval.yaml -- runner: runtime -- mode: full_chain -- passed: True - -## Query -Объясни класс WorkflowEngine - -## Actual -{ - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 13, - "llm_answer": "## Объяснение сущности `WorkflowEngine`\n\n### Назначение\nКласс `WorkflowEngine` является основным компонентом конвейера выполнения рабочих процессов (`workflow`) в приложении. Он отвечает за управление жизненным циклом рабочего процесса, отслеживание состояния его выполнения и взаимодействие с внешними хранилищами данных для сохранения прогресса выполнения.\n\n### Ключевые зависимости\n- **workflow**: определение рабочего процесса, включая начальные и конечные узлы, а также переходы между ними.\n- **persistence**: механизм хранения информации о текущем состоянии выполнения рабочего процесса.\n- **traces**: логирование и мониторинг текущего состояния выполнения.\n- **hooks**: дополнительные пользовательские обработчики событий, позволяющие расширять поведение рабочего процесса.\n\n### Поток данных или вызовов\n1. При инициализации класса вызывается метод `__init__`, который принимает следующие параметры:\n - `workflow`: объект определения рабочего процесса.\n - `persistence`: механизм постоянного хранения состояния.\n - `traces`: компонент логирования и мониторинга.\n - `hooks`: дополнительные пользовательские обработчики событий.\n \n2. После инициализации рабочий процесс запускается через метод `run`. Этот метод выполняет следующие шаги:\n - Получает идентификатор текущей рабочей сессии (`run_id`) от механизма постоянного хранения (`persistence`).\n - Сохраняет текущее состояние выполнения в контексте выполнения.\n - Запускает первый шаг рабочего процесса, записывая текущий узел в контекст выполнения.\n - Циклически переходит к следующему узлу до тех пор, пока не достигнет конечного узла.\n\n3. Внутри цикла происходит обработка каждого шага рабочего процесса следующим образом:\n - Определяется следующий узел по имени текущего узла.\n - Выполняются действия, связанные с текущим узлом.\n - Текущий узел сохраняется в контексте выполнения.\n\n### Важные детали реализации\n- **Переходы между узлами**: переходы внутри рабочего процесса определяются внутренними связями узлов. Каждый узел имеет ссылку на следующий узел в рабочем процессе.\n- **Логирование и мониторинг**: все этапы выполнения регистрируются с помощью механизма логирования (`logging`), что позволяет отслеживать прогресс выполнения рабочего процесса.\n- **Постоянное хранение состояния**: рабочее состояние хранится во внешней системе постоянного хранения (`persistence`), что обеспечивает возможность восстановления работы после прерывания.\n- **Пользовательские расширения**: при помощи интерфейса `WorkflowEngineHooks` можно легко добавлять кастомные функции-обработчики, которые будут выполняться в определенные моменты жизненного цикла рабочего процесса.\n\n---\n\n### Косвенные признаки и осторожные выводы\n- Файл [src/app_runtime/workflow/engine/workflow_engine.py](C1_SYMBOL_CATALOG): файл содержит реализацию класса `WorkflowEngine`.\n- Взаимодействие с другими модулями через механизм HTTP API ([C3_ENTRYPOINTS]: src/app_runtime/control/http_app.py | app.post), однако конкретные детали этого взаимодействия напрямую не видны из предоставленного контекста.\n\nЭтот обзор основан исключительно на доступных файлах и слоях анализа RAG, поэтому некоторые аспекты могут быть оценены осторожно.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "WorkflowEngine" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] -} - -## Mismatches -- none \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_112158/summary.md b/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_112158/summary.md deleted file mode 100644 index ed105f9..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_112158/summary.md +++ /dev/null @@ -1,20 +0,0 @@ -# pipeline_setup_v2 summary - -Passed: 6/6 - -| File | Case | Runner | Mode | Intent | Sub-intent | Pass | -|------|------|--------|------|--------|------------|------| -| full_chain_plba_code_retrieval.yaml | plba-fullchain-explain-runtime-manager | runtime | full_chain | CODE_QA | EXPLAIN | ✓ | -| full_chain_plba_code_retrieval.yaml | plba-fullchain-explain-http-control-channel | runtime | full_chain | CODE_QA | EXPLAIN | ✓ | -| full_chain_plba_code_retrieval.yaml | plba-fullchain-explain-control-plane-service | runtime | full_chain | CODE_QA | EXPLAIN | ✓ | -| full_chain_plba_code_retrieval.yaml | plba-fullchain-explain-trace-service | runtime | full_chain | CODE_QA | EXPLAIN | ✓ | -| full_chain_plba_code_retrieval.yaml | plba-fullchain-explain-create-runtime | runtime | full_chain | CODE_QA | EXPLAIN | ✓ | -| full_chain_plba_code_retrieval.yaml | plba-fullchain-explain-workflow-engine | runtime | full_chain | CODE_QA | EXPLAIN | ✓ | - -## LLM Answers -- **plba-fullchain-explain-runtime-manager**: ## Назначение класса `RuntimeManager` Класс `RuntimeManager` предназначен для управления жизненным циклом приложения и координации различных компонентов системы во время выполнения. Он играет роль менеджера процессов и отвечает за управление состоянием приложения, регистрацию сервисов и координацию работы рабочих потоков (`workers`). ## Ключевые зависимости - **ConfigurationManager**: Менеджер конфигурации, используется для загрузки настроек приложения. - **ServiceContainer**: Контейнер сервисов, содержащий различные сервисы и модули приложения. - **TraceService**: Сервис трассировки, собирает информацию о выполнении запросов и событиях. - **HealthRegistry**: Регистратор состояния здоровья системы, отслеживает состояние различных модулей и сервисов. - **LogManager**: Менеджер логирования, регистрирует события и ошибки. - **WorkerSupervisor**: Наблюдатель за рабочими… -- **plba-fullchain-explain-http-control-channel**: ## Объяснение работы класса `HttpControlChannel` ### Назначение Класс `HttpControlChannel` является компонентом системы управления состоянием и взаимодействия с внешним миром через HTTP-протокол. Он реализует механизм обмена данными и состояниями между компонентами приложения через HTTP-запросы и ответы. ### Ключевые зависимости Ключевыми зависимостями являются: - `UvicornThreadRunner`: используется для запуска асинхронного сервера на основе библиотеки Uvicorn. - `HttpControlAppFactory`: фабрика приложений, которая отвечает за создание экземпляров FastAPI приложения. - `ControlActionSet`: набор действий, связанных с управлением состоянием и поведением приложения. ### Поток данных или вызовов Поток данных и вызовов выглядит следующим образом: 1. **Инициализация (`__init__`)**: - При создании экземпляра класса задаются параметры хоста, порта и тайм-аута. - Создается об… -- **plba-fullchain-explain-control-plane-service**: ## Назначение `ControlPlaneService` — это сущность, отвечающая за управление каналами (`ControlChannel`) и координацию действий по запуску и остановке различных компонентов системы. Этот сервис играет роль `pipeline_stage`, что указывает на его участие в конвейере обработки данных или управлении состоянием приложения. ## Ключевые зависимости ### Файлы и сущности - **src/app_runtime/control/service.py**: местоположение определения класса `ControlPlaneService`. - Используется библиотека **asyncio** для асинхронного выполнения задач. ### Внешние зависимости - `RuntimeManager`: менеджер управления рабочим окружением и состоянием приложения. - `ControlChannel`: каналы взаимодействия с внешними компонентами или службами. - `ControlActionSet`: набор действий, которые могут быть выполнены при старте или останове сервиса. ## Поток данных или вызовов 1. **Инициализация и регис… -- **plba-fullchain-explain-trace-service**: ## Объяснение работы `TraceService` ### Назначение `TraceService` — это сервис, предназначенный для управления контекстом трассировки и записи логических событий во время выполнения программы. Он участвует в потоке данных системы, обеспечивая запись информации о каждом этапе выполнения с возможностью последующего анализа и мониторинга. ### Ключевые зависимости - **TraceContextFactory**: Базовый класс, от которого наследуется `TraceService`. - **TraceTransport**: Интерфейс транспортировки данных трассировки. - **TraceContextStore**: Класс для хранения контекста трассировки. - **NoOpTraceTransport**: Специальная реализация `TraceTransport`, используемая при отсутствии реальной транспортной инфраструктуры. - **TraceRecordWriter**: Вспомогательный класс для записи записей трассировки в транспортную систему. ### Поток данных или вызовов 1. При инициализации (`__init__`) с… -- **plba-fullchain-explain-create-runtime**: ## Объяснение функции `create_runtime` ### Назначение Функция `create_runtime` предназначена для инициализации и настройки окружения выполнения приложения (`runtime`), используя параметры конфигурации и дополнительные опции управления HTTP-интерфейсом. ### Ключевые зависимости Функция зависит от следующих компонентов и библиотек: - **`RuntimeManager`** — главный менеджер окружения выполнения, регистрирующий модули и настраивающий каналы управления. - **`ApplicationModule`** — модуль приложения, подлежащий регистрации в менеджере среды выполнения. - **`HttpControlChannel`** — канал управления, обеспечивающий взаимодействие с внешним интерфейсом через HTTP. ### Поток данных или вызовов 1. Создаётся экземпляр менеджера окружения выполнения (`RuntimeManager`) и передаётся в возвращаемое значение. 2. Если указан путь к файлу конфигурации (`config_path`), файл добавляется… -- **plba-fullchain-explain-workflow-engine**: ## Объяснение сущности `WorkflowEngine` ### Назначение Класс `WorkflowEngine` является основным компонентом конвейера выполнения рабочих процессов (`workflow`) в приложении. Он отвечает за управление жизненным циклом рабочего процесса, отслеживание состояния его выполнения и взаимодействие с внешними хранилищами данных для сохранения прогресса выполнения. ### Ключевые зависимости - **workflow**: определение рабочего процесса, включая начальные и конечные узлы, а также переходы между ними. - **persistence**: механизм хранения информации о текущем состоянии выполнения рабочего процесса. - **traces**: логирование и мониторинг текущего состояния выполнения. - **hooks**: дополнительные пользовательские обработчики событий, позволяющие расширять поведение рабочего процесса. ### Поток данных или вызовов 1. При инициализации класса вызывается метод `__init__`, который приним… \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_114413/full_chain_plba_code_retrieval_plba-fullchain-explain-control-plane-service.json b/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_114413/full_chain_plba_code_retrieval_plba-fullchain-explain-control-plane-service.json deleted file mode 100644 index 45b9d2d..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_114413/full_chain_plba_code_retrieval_plba-fullchain-explain-control-plane-service.json +++ /dev/null @@ -1,2056 +0,0 @@ -{ - "case_id": "plba-fullchain-explain-control-plane-service", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_retrieval.yaml", - "runner": "runtime", - "mode": "full_chain", - "actual": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 12, - "llm_answer": "## Объяснение сущности `ControlPlaneService`\n\n### Назначение\n`ControlPlaneService` — это сервисная сущность, ответственная за управление каналами (`ControlChannel`) и выполнение действий по управлению жизненным циклом приложения, таких как запуск, остановка и мониторинг состояния системы.\n\n### Ключевые зависимости\n- **`ControlChannel`**: Канал управления, через который передаются сообщения о событиях и действиях.\n- **`RuntimeManager`**: Менеджер выполнения среды исполнения, содержащий состояние и другие объекты для работы с приложением.\n- **`ControlActionSet`**: Набор действий, которые могут быть выполнены при управлении состоянием системы.\n\n### Поток данных или вызовов\n1. **Инициализация** (`__init__`) \n - Инициализирует пустой список каналов `_channels`.\n \n2. **Регистрация канала** (`register_channel`) \n - Добавляет новый канал в список зарегистрированных каналов.\n\n3. **Запуск сервиса** (`start`) \n - Проверяет наличие зарегистрированных каналов. Если каналы присутствуют, вызывается асинхронная функция `_start_async`, которая выполняет следующие действия:\n - Вызывает метод `health_status` для получения текущего статуса здоровья системы.\n - Запускает приложение через метод `start_runtime`.\n \n4. **Остановка сервиса** (`stop`) \n - Аналогично проверяет наличие каналов и вызывает асинхронную функцию `_stop_async` для остановки всех запущенных процессов.\n\n5. **Создание снимка состояния** (`snapshot`) \n - Собирает информацию о текущем состоянии системы, включая конфигурацию, модули, сервисы, работников и здоровье.\n\n6. **Асинхронные методы** \n - Асинхронные функции (`_start_async`, `_stop_async`) используются для выполнения длительных операций без блокировки основного потока программы.\n\n### Важные детали реализации\n- **Использование `asyncio.run()`**: Методы `start` и `stop` используют синхронный вызов асинхронных функций через `asyncio.run()`. Это необходимо для корректного завершения асинхронных задач.\n- **Декларативность**: Класс следует принципу декларативности, позволяя разработчикам легко регистрировать новые каналы и управлять ими через стандартные интерфейсы.\n- **Гибкость**: Возможность расширения функциональности через добавление новых методов и атрибутов в будущем.\n\n### Осторожные выводы\n- Детали взаимодействия с внешними компонентами, такими как `FastAPI HTTP POST` и другие внешние точки входа, основаны исключительно на анализе сигнатур и косвенных признаков.\n\n### Путь к файлу и имя сущности\n- Файл: `src/app_runtime/control/service.py`\n- Имя класса: `ControlPlaneService`", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "ControlPlaneService" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "passed": true, - "mismatches": [], - "details": { - "case_id": "plba-fullchain-explain-control-plane-service", - "text": "Объясни класс ControlPlaneService", - "mode": "full_chain", - "run_started_at": "2026-03-12T11:44:13", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Объясни класс ControlPlaneService", - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "ControlPlaneService", - "alternatives": [ - "ControlPlaneService" - ], - "confidence": 0.99 - }, - "rag_count": 12, - "rag_rows": [ - { - "path": "src/app_runtime/control/service.py", - "content": "class ControlPlaneService\nControlPlaneService", - "layer": "C1_SYMBOL_CATALOG", - "title": "ControlPlaneService", - "span_start": 12, - "span_end": 52, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "b13471e5916986dccffb53fab613812842965705e6b3a89ae549d30c9e91e9aa", - "qname": "ControlPlaneService", - "kind": "class", - "signature": "ControlPlaneService", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.control.service", - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests service\n- reads and writes state attributes\n- participates in dataflow slices (5)", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlPlaneService", - "span_start": 12, - "span_end": 52, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 68, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "b13471e5916986dccffb53fab613812842965705e6b3a89ae549d30c9e91e9aa", - "symbol_name": "ControlPlaneService", - "qname": "ControlPlaneService", - "role": "pipeline_stage", - "confidence": 0.57, - "dataflow_participation": 5, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.stop", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 25, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d", - "dst_ref": "ControlPlaneService.stop", - "resolution": "resolved", - "slice_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.stop" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._stop_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 51, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a", - "dst_ref": "ControlPlaneService._stop_async", - "resolution": "resolved", - "slice_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._stop_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.register_channel", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 17, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957", - "dst_ref": "ControlPlaneService.register_channel", - "resolution": "resolved", - "slice_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.register_channel" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.start", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 20, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154", - "dst_ref": "ControlPlaneService.start", - "resolution": "resolved", - "slice_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.start" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._start_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 47, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517", - "dst_ref": "ControlPlaneService._start_async", - "resolution": "resolved", - "slice_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._start_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.register_channel reads_attr self._channels.append", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.register_channel:reads_attr", - "span_start": 17, - "span_end": 17, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "1ee5925deffdc38ba15b88bf7c89e5fcd1a78f493fe30f2deb827d714a1b18e8", - "edge_type": "reads_attr", - "src_symbol_id": "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957", - "src_qname": "ControlPlaneService.register_channel", - "dst_symbol_id": null, - "dst_ref": "self._channels.append", - "resolution": "partial", - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "class ControlPlaneService:\n def __init__(self) -> None:\n self._channels: list[ControlChannel] = []\n\n def register_channel(self, channel: ControlChannel) -> None:\n self._channels.append(channel)\n\n def start(self, runtime: RuntimeManager) -> None:\n if not self._channels:\n return\n asyncio.run(self._start_async(runtime))\n\n def stop(self) -> None:\n if not self._channels:\n return\n asyncio.run(self._stop_async())\n\n def snapshot(self, runtime: RuntimeManager) -> dict[str, object]:\n health = runtime.current_health()\n return {\n \"runtime\": {\"state\": runtime._state.value},\n \"modules\": list(runtime.registry.modules),\n \"services\": runtime.services.snapshot(),\n \"workers\": runtime.workers.snapshot(),\n \"health\": runtime.health.snapshot(runtime.workers.healths()) | {\"status\": health[\"status\"]},\n \"config\": runtime.configuration.get(),\n }\n\n async def _start_async(self, runtime: RuntimeManager) -> None:\n actions = ControlActionSet(\n health=runtime.health_status,\n start=runtime.start_runtime,\n stop=runtime.stop_runtime,\n status=runtime.runtime_status,\n )\n for channel in self._channels:\n await channel.start(actions)\n\n async def _stop_async(self) -> None:\n for channel in reversed(self._channels):\n await channel.stop()", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/service.py:ControlPlaneService", - "span_start": 12, - "span_end": 52, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.service", - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "llm_answer": "## Объяснение сущности `ControlPlaneService`\n\n### Назначение\n`ControlPlaneService` — это сервисная сущность, ответственная за управление каналами (`ControlChannel`) и выполнение действий по управлению жизненным циклом приложения, таких как запуск, остановка и мониторинг состояния системы.\n\n### Ключевые зависимости\n- **`ControlChannel`**: Канал управления, через который передаются сообщения о событиях и действиях.\n- **`RuntimeManager`**: Менеджер выполнения среды исполнения, содержащий состояние и другие объекты для работы с приложением.\n- **`ControlActionSet`**: Набор действий, которые могут быть выполнены при управлении состоянием системы.\n\n### Поток данных или вызовов\n1. **Инициализация** (`__init__`) \n - Инициализирует пустой список каналов `_channels`.\n \n2. **Регистрация канала** (`register_channel`) \n - Добавляет новый канал в список зарегистрированных каналов.\n\n3. **Запуск сервиса** (`start`) \n - Проверяет наличие зарегистрированных каналов. Если каналы присутствуют, вызывается асинхронная функция `_start_async`, которая выполняет следующие действия:\n - Вызывает метод `health_status` для получения текущего статуса здоровья системы.\n - Запускает приложение через метод `start_runtime`.\n \n4. **Остановка сервиса** (`stop`) \n - Аналогично проверяет наличие каналов и вызывает асинхронную функцию `_stop_async` для остановки всех запущенных процессов.\n\n5. **Создание снимка состояния** (`snapshot`) \n - Собирает информацию о текущем состоянии системы, включая конфигурацию, модули, сервисы, работников и здоровье.\n\n6. **Асинхронные методы** \n - Асинхронные функции (`_start_async`, `_stop_async`) используются для выполнения длительных операций без блокировки основного потока программы.\n\n### Важные детали реализации\n- **Использование `asyncio.run()`**: Методы `start` и `stop` используют синхронный вызов асинхронных функций через `asyncio.run()`. Это необходимо для корректного завершения асинхронных задач.\n- **Декларативность**: Класс следует принципу декларативности, позволяя разработчикам легко регистрировать новые каналы и управлять ими через стандартные интерфейсы.\n- **Гибкость**: Возможность расширения функциональности через добавление новых методов и атрибутов в будущем.\n\n### Осторожные выводы\n- Детали взаимодействия с внешними компонентами, такими как `FastAPI HTTP POST` и другие внешние точки входа, основаны исключительно на анализе сигнатур и косвенных признаков.\n\n### Путь к файлу и имя сущности\n- Файл: `src/app_runtime/control/service.py`\n- Имя класса: `ControlPlaneService`", - "summary": { - "router": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "confidence": null - }, - "retrieval": { - "profile": "code", - "layers_hit": [ - "C0_SOURCE_CHUNKS", - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS", - "C4_SEMANTIC_ROLES" - ], - "evidence_sufficient": true - }, - "llm": { - "answer_status": "answered", - "groundedness": "grounded" - } - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "ControlPlaneService" - ], - "keyword_hints": [ - "ControlPlaneService" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C0_SOURCE_CHUNKS": "exact_path_fetch", - "C4_SEMANTIC_ROLES": "exact_path_fetch", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C3_ENTRYPOINTS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 8, - "C4_SEMANTIC_ROLES": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C3_ENTRYPOINTS": 6 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C4_SEMANTIC_ROLES": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "ControlPlaneService", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "ControlPlaneService", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C4_SEMANTIC_ROLES", - "query": "ControlPlaneService", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "ControlPlaneService", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - }, - { - "layer": "C3_ENTRYPOINTS", - "query": "ControlPlaneService", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 1, - "candidates_after_filter": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 6, - "candidates_after_filter": 6 - }, - { - "layer": "C3_ENTRYPOINTS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 3, - "candidates_after_filter": 3 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "ControlPlaneService", - "alternatives": [ - "ControlPlaneService" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C4_SEMANTIC_ROLES", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 6, - "fail_reason": null - }, - { - "layer": "C3_ENTRYPOINTS", - "status": "hit", - "hit_count": 3, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "router": 0, - "symbol_resolution": 0, - "retrieval_total": 146, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 44, - "C0_SOURCE_CHUNKS": 17, - "C4_SEMANTIC_ROLES": 15, - "C2_DEPENDENCY_GRAPH": 55, - "C3_ENTRYPOINTS": 13 - }, - "merge_rank": 26, - "prompt_build": 0, - "llm_call": 4257 - }, - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 797, - "evidence_rows": 12, - "evidence_chars": 2301 - }, - "evidence_summary": [ - { - "layer": "C1_SYMBOL_CATALOG", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "count": 6, - "unique_paths": 1 - }, - { - "layer": "C3_ENTRYPOINTS", - "count": 3, - "unique_paths": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 1, - "unique_paths": 1 - } - ], - "prompt_template_id": "intent_code_qa_explain_ru_v1", - "system_prompt_version": "v1" - }, - "router": { - "conversation_mode": "START", - "keyword_hints": [ - "ControlPlaneService" - ], - "path_scope": [] - }, - "llm": { - "used_evidence_count": 12, - "missing_evidence_reason": null - } - }, - "run_info": { - "case_id": "plba-fullchain-explain-control-plane-service", - "mode": "full_chain", - "run_started_at": "2026-03-12T11:44:13", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - }, - "input_request": { - "text": "Объясни класс ControlPlaneService", - "normalized_query": "Объясни класс ControlPlaneService" - }, - "steps": [ - { - "step": "intent_router", - "input": { - "query": "Объясни класс ControlPlaneService" - }, - "output": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Объясни класс ControlPlaneService" - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "ControlPlaneService" - ], - "keyword_hints": [ - "ControlPlaneService" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "timings_ms": { - "router": 0 - } - } - }, - { - "step": "retrieval", - "input": { - "query": "Объясни класс ControlPlaneService" - }, - "output": { - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "ControlPlaneService", - "alternatives": [ - "ControlPlaneService" - ], - "confidence": 0.99 - }, - "rag_count": 12, - "rag_rows": [ - { - "path": "src/app_runtime/control/service.py", - "content": "class ControlPlaneService\nControlPlaneService", - "layer": "C1_SYMBOL_CATALOG", - "title": "ControlPlaneService", - "span_start": 12, - "span_end": 52, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "b13471e5916986dccffb53fab613812842965705e6b3a89ae549d30c9e91e9aa", - "qname": "ControlPlaneService", - "kind": "class", - "signature": "ControlPlaneService", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.control.service", - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests service\n- reads and writes state attributes\n- participates in dataflow slices (5)", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlPlaneService", - "span_start": 12, - "span_end": 52, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 68, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "b13471e5916986dccffb53fab613812842965705e6b3a89ae549d30c9e91e9aa", - "symbol_name": "ControlPlaneService", - "qname": "ControlPlaneService", - "role": "pipeline_stage", - "confidence": 0.57, - "dataflow_participation": 5, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.stop", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 25, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d", - "dst_ref": "ControlPlaneService.stop", - "resolution": "resolved", - "slice_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.stop" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._stop_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 51, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a", - "dst_ref": "ControlPlaneService._stop_async", - "resolution": "resolved", - "slice_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._stop_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.register_channel", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 17, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957", - "dst_ref": "ControlPlaneService.register_channel", - "resolution": "resolved", - "slice_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.register_channel" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.start", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 20, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154", - "dst_ref": "ControlPlaneService.start", - "resolution": "resolved", - "slice_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.start" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._start_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 47, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517", - "dst_ref": "ControlPlaneService._start_async", - "resolution": "resolved", - "slice_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._start_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.register_channel reads_attr self._channels.append", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.register_channel:reads_attr", - "span_start": 17, - "span_end": 17, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "1ee5925deffdc38ba15b88bf7c89e5fcd1a78f493fe30f2deb827d714a1b18e8", - "edge_type": "reads_attr", - "src_symbol_id": "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957", - "src_qname": "ControlPlaneService.register_channel", - "dst_symbol_id": null, - "dst_ref": "self._channels.append", - "resolution": "partial", - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "class ControlPlaneService:\n def __init__(self) -> None:\n self._channels: list[ControlChannel] = []\n\n def register_channel(self, channel: ControlChannel) -> None:\n self._channels.append(channel)\n\n def start(self, runtime: RuntimeManager) -> None:\n if not self._channels:\n return\n asyncio.run(self._start_async(runtime))\n\n def stop(self) -> None:\n if not self._channels:\n return\n asyncio.run(self._stop_async())\n\n def snapshot(self, runtime: RuntimeManager) -> dict[str, object]:\n health = runtime.current_health()\n return {\n \"runtime\": {\"state\": runtime._state.value},\n \"modules\": list(runtime.registry.modules),\n \"services\": runtime.services.snapshot(),\n \"workers\": runtime.workers.snapshot(),\n \"health\": runtime.health.snapshot(runtime.workers.healths()) | {\"status\": health[\"status\"]},\n \"config\": runtime.configuration.get(),\n }\n\n async def _start_async(self, runtime: RuntimeManager) -> None:\n actions = ControlActionSet(\n health=runtime.health_status,\n start=runtime.start_runtime,\n stop=runtime.stop_runtime,\n status=runtime.runtime_status,\n )\n for channel in self._channels:\n await channel.start(actions)\n\n async def _stop_async(self) -> None:\n for channel in reversed(self._channels):\n await channel.stop()", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/service.py:ControlPlaneService", - "span_start": 12, - "span_end": 52, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.service", - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ] - }, - "diagnostics": { - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C0_SOURCE_CHUNKS": "exact_path_fetch", - "C4_SEMANTIC_ROLES": "exact_path_fetch", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C3_ENTRYPOINTS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 8, - "C4_SEMANTIC_ROLES": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C3_ENTRYPOINTS": 6 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C4_SEMANTIC_ROLES": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "ControlPlaneService", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "ControlPlaneService", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C4_SEMANTIC_ROLES", - "query": "ControlPlaneService", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "ControlPlaneService", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - }, - { - "layer": "C3_ENTRYPOINTS", - "query": "ControlPlaneService", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 1, - "candidates_after_filter": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 6, - "candidates_after_filter": 6 - }, - { - "layer": "C3_ENTRYPOINTS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 3, - "candidates_after_filter": 3 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "ControlPlaneService", - "alternatives": [ - "ControlPlaneService" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C4_SEMANTIC_ROLES", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 6, - "fail_reason": null - }, - { - "layer": "C3_ENTRYPOINTS", - "status": "hit", - "hit_count": 3, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "symbol_resolution": 0, - "retrieval_total": 146, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 44, - "C0_SOURCE_CHUNKS": 17, - "C4_SEMANTIC_ROLES": 15, - "C2_DEPENDENCY_GRAPH": 55, - "C3_ENTRYPOINTS": 13 - }, - "merge_rank": 26 - } - } - }, - { - "step": "llm_answer", - "input": { - "query": "Объясни класс ControlPlaneService", - "rag_count": 12 - }, - "output": { - "llm_answer": "## Объяснение сущности `ControlPlaneService`\n\n### Назначение\n`ControlPlaneService` — это сервисная сущность, ответственная за управление каналами (`ControlChannel`) и выполнение действий по управлению жизненным циклом приложения, таких как запуск, остановка и мониторинг состояния системы.\n\n### Ключевые зависимости\n- **`ControlChannel`**: Канал управления, через который передаются сообщения о событиях и действиях.\n- **`RuntimeManager`**: Менеджер выполнения среды исполнения, содержащий состояние и другие объекты для работы с приложением.\n- **`ControlActionSet`**: Набор действий, которые могут быть выполнены при управлении состоянием системы.\n\n### Поток данных или вызовов\n1. **Инициализация** (`__init__`) \n - Инициализирует пустой список каналов `_channels`.\n \n2. **Регистрация канала** (`register_channel`) \n - Добавляет новый канал в список зарегистрированных каналов.\n\n3. **Запуск сервиса** (`start`) \n - Проверяет наличие зарегистрированных каналов. Если каналы присутствуют, вызывается асинхронная функция `_start_async`, которая выполняет следующие действия:\n - Вызывает метод `health_status` для получения текущего статуса здоровья системы.\n - Запускает приложение через метод `start_runtime`.\n \n4. **Остановка сервиса** (`stop`) \n - Аналогично проверяет наличие каналов и вызывает асинхронную функцию `_stop_async` для остановки всех запущенных процессов.\n\n5. **Создание снимка состояния** (`snapshot`) \n - Собирает информацию о текущем состоянии системы, включая конфигурацию, модули, сервисы, работников и здоровье.\n\n6. **Асинхронные методы** \n - Асинхронные функции (`_start_async`, `_stop_async`) используются для выполнения длительных операций без блокировки основного потока программы.\n\n### Важные детали реализации\n- **Использование `asyncio.run()`**: Методы `start` и `stop` используют синхронный вызов асинхронных функций через `asyncio.run()`. Это необходимо для корректного завершения асинхронных задач.\n- **Декларативность**: Класс следует принципу декларативности, позволяя разработчикам легко регистрировать новые каналы и управлять ими через стандартные интерфейсы.\n- **Гибкость**: Возможность расширения функциональности через добавление новых методов и атрибутов в будущем.\n\n### Осторожные выводы\n- Детали взаимодействия с внешними компонентами, такими как `FastAPI HTTP POST` и другие внешние точки входа, основаны исключительно на анализе сигнатур и косвенных признаков.\n\n### Путь к файлу и имя сущности\n- Файл: `src/app_runtime/control/service.py`\n- Имя класса: `ControlPlaneService`" - }, - "diagnostics": { - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 797, - "evidence_rows": 12, - "evidence_chars": 2301 - }, - "evidence_summary": [ - { - "layer": "C1_SYMBOL_CATALOG", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "count": 6, - "unique_paths": 1 - }, - { - "layer": "C3_ENTRYPOINTS", - "count": 3, - "unique_paths": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 1, - "unique_paths": 1 - } - ], - "prompt_template_id": "intent_code_qa_explain_ru_v1", - "system_prompt_version": "v1" - }, - "timings_ms": { - "prompt_build": 0, - "llm_call": 4257 - } - } - } - ] - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_114413/full_chain_plba_code_retrieval_plba-fullchain-explain-control-plane-service.md b/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_114413/full_chain_plba_code_retrieval_plba-fullchain-explain-control-plane-service.md deleted file mode 100644 index df35e16..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_114413/full_chain_plba_code_retrieval_plba-fullchain-explain-control-plane-service.md +++ /dev/null @@ -1,34 +0,0 @@ -# plba-fullchain-explain-control-plane-service - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_retrieval.yaml -- runner: runtime -- mode: full_chain -- passed: True - -## Query -Объясни класс ControlPlaneService - -## Actual -{ - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 12, - "llm_answer": "## Объяснение сущности `ControlPlaneService`\n\n### Назначение\n`ControlPlaneService` — это сервисная сущность, ответственная за управление каналами (`ControlChannel`) и выполнение действий по управлению жизненным циклом приложения, таких как запуск, остановка и мониторинг состояния системы.\n\n### Ключевые зависимости\n- **`ControlChannel`**: Канал управления, через который передаются сообщения о событиях и действиях.\n- **`RuntimeManager`**: Менеджер выполнения среды исполнения, содержащий состояние и другие объекты для работы с приложением.\n- **`ControlActionSet`**: Набор действий, которые могут быть выполнены при управлении состоянием системы.\n\n### Поток данных или вызовов\n1. **Инициализация** (`__init__`) \n - Инициализирует пустой список каналов `_channels`.\n \n2. **Регистрация канала** (`register_channel`) \n - Добавляет новый канал в список зарегистрированных каналов.\n\n3. **Запуск сервиса** (`start`) \n - Проверяет наличие зарегистрированных каналов. Если каналы присутствуют, вызывается асинхронная функция `_start_async`, которая выполняет следующие действия:\n - Вызывает метод `health_status` для получения текущего статуса здоровья системы.\n - Запускает приложение через метод `start_runtime`.\n \n4. **Остановка сервиса** (`stop`) \n - Аналогично проверяет наличие каналов и вызывает асинхронную функцию `_stop_async` для остановки всех запущенных процессов.\n\n5. **Создание снимка состояния** (`snapshot`) \n - Собирает информацию о текущем состоянии системы, включая конфигурацию, модули, сервисы, работников и здоровье.\n\n6. **Асинхронные методы** \n - Асинхронные функции (`_start_async`, `_stop_async`) используются для выполнения длительных операций без блокировки основного потока программы.\n\n### Важные детали реализации\n- **Использование `asyncio.run()`**: Методы `start` и `stop` используют синхронный вызов асинхронных функций через `asyncio.run()`. Это необходимо для корректного завершения асинхронных задач.\n- **Декларативность**: Класс следует принципу декларативности, позволяя разработчикам легко регистрировать новые каналы и управлять ими через стандартные интерфейсы.\n- **Гибкость**: Возможность расширения функциональности через добавление новых методов и атрибутов в будущем.\n\n### Осторожные выводы\n- Детали взаимодействия с внешними компонентами, такими как `FastAPI HTTP POST` и другие внешние точки входа, основаны исключительно на анализе сигнатур и косвенных признаков.\n\n### Путь к файлу и имя сущности\n- Файл: `src/app_runtime/control/service.py`\n- Имя класса: `ControlPlaneService`", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "ControlPlaneService" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] -} - -## Mismatches -- none \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_114413/full_chain_plba_code_retrieval_plba-fullchain-explain-create-runtime.json b/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_114413/full_chain_plba_code_retrieval_plba-fullchain-explain-create-runtime.json deleted file mode 100644 index 74b8d2f..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_114413/full_chain_plba_code_retrieval_plba-fullchain-explain-create-runtime.json +++ /dev/null @@ -1,1896 +0,0 @@ -{ - "case_id": "plba-fullchain-explain-create-runtime", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_retrieval.yaml", - "runner": "runtime", - "mode": "full_chain", - "actual": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 12, - "llm_answer": "## Функциональное назначение сущности `create_runtime`\nФункция `create_runtime` предназначена для инициализации и настройки окружения выполнения (`runtime environment`) приложения. Она создает объект типа `RuntimeManager`, регистрирует указанный модуль (`module`) и при необходимости добавляет конфигурационные файлы и каналы управления через HTTP.\n\n## Ключевые зависимости\n- **src/plba/bootstrap.py**: основной файл, содержащий реализацию функции `create_runtime`.\n- **RuntimeManager**: класс, управляющий состоянием и функциональностью runtime-среды.\n- **ApplicationModule**: абстрактный тип модуля приложения, передаваемый в функцию.\n- **HttpControlChannel**: компонент, обеспечивающий управление приложением по HTTP с заданными параметрами хоста, порта и тайм-аута.\n\n## Поток данных или вызовов\n1. Функция `create_runtime` принимает несколько аргументов:\n - `module`: экземпляр класса `ApplicationModule`, представляющий модуль приложения.\n - Дополнительные параметры конфигурации, такие как путь к файлу конфигурации (`config_path`), включение HTTP-контроля (`enable_http_control`), хост и порт для HTTP-канала управления, а также таймаут запроса.\n \n2. Внутри функции происходит следующее:\n - Создается новый объект `RuntimeManager`.\n - Если указан параметр `config_path`, вызывается метод `add_config_file` объекта `runtime`, чтобы добавить указанный файл конфигурации.\n - При включенном HTTP-контроле регистрируется канал управления `HttpControlChannel` с заданными параметрами.\n - Вызовом метода `register_module` экземпляра `runtime` добавляется переданный модуль приложения.\n\n3. После завершения всех операций функция возвращает созданный объект `RuntimeManager`.\n\n## Важные детали реализации\n1. **Параметры вызова**:\n - Параметр `config_path` позволяет указать путь к файлу конфигурации, который затем загружается и используется runtime-менеджером.\n - Параметр `enable_http_control` определяет необходимость регистрации канала управления HTTP, позволяющего взаимодействовать с приложением удаленно.\n\n2. **Использование внешних классов и объектов**:\n - Использование класса `RuntimeManager` для управления runtime-средой.\n - Применение класса `HttpControlChannel` для организации каналов управления через HTTP.\n\n3. **Роль `pipeline_stage`**:\n - Как отмечено в описании семантических ролей (`C4_SEMANTIC_ROLES`), данная сущность участвует в данных потоках (`dataflow slices`), но ее основная роль заключается в управлении состоянием и настройке runtime-среды.\n\n## Осторожные выводы\nНа основании доступного контекста сложно однозначно утверждать о точном потоке данных внутри runtime-среды после создания runtime. Косвенные признаки указывают на возможное взаимодействие с внешними сервисами или ресурсами, однако конкретная реализация этих взаимодействий вне данного контекста остается неизвестной.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "create_runtime" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "passed": true, - "mismatches": [], - "details": { - "case_id": "plba-fullchain-explain-create-runtime", - "text": "Объясни функцию create_runtime", - "mode": "full_chain", - "run_started_at": "2026-03-12T11:44:13", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Объясни функцию create_runtime", - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "create_runtime", - "alternatives": [ - "create_runtime" - ], - "confidence": 0.99 - }, - "rag_count": 12, - "rag_rows": [ - { - "path": "src/plba/bootstrap.py", - "content": "function create_runtime\ncreate_runtime(module)", - "layer": "C1_SYMBOL_CATALOG", - "title": "create_runtime", - "span_start": 8, - "span_end": 29, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "qname": "create_runtime", - "kind": "function", - "signature": "create_runtime(module)", - "parent_symbol_id": null, - "package_or_module": "src.plba.bootstrap", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_runner.py", - "content": "UvicornThreadRunner\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (24)", - "layer": "C4_SEMANTIC_ROLES", - "title": "UvicornThreadRunner", - "span_start": 10, - "span_end": 61, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 11, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "fd55630045a02100df8877ac27d951ee08617d4598764394d48cb51fe067476a", - "symbol_name": "UvicornThreadRunner", - "qname": "UvicornThreadRunner", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 24, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "3779fdd2878b770e789a35bb2a89c9d79f13b61c26d7db1b3b683f9bb9e1623f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/bootstrap.py", - "content": "create_runtime calls runtime.add_config_file", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "create_runtime:calls", - "span_start": 19, - "span_end": 19, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "4eaeec4ac55a59d5f66fd01c4754955f8fedaf4bc3df13fa769b352c7bfaacbb", - "edge_type": "calls", - "src_symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "src_qname": "create_runtime", - "dst_symbol_id": null, - "dst_ref": "runtime.add_config_file", - "resolution": "partial", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/bootstrap.py", - "content": "create_runtime reads_attr runtime.register_module", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "create_runtime:reads_attr", - "span_start": 28, - "span_end": 28, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "45516c79ff358dbf9b650a081668df0f66d2fe989300f985a1a78be6be166f8f", - "edge_type": "reads_attr", - "src_symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "src_qname": "create_runtime", - "dst_symbol_id": null, - "dst_ref": "runtime.register_module", - "resolution": "partial", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/bootstrap.py", - "content": "create_runtime instantiates RuntimeManager", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "create_runtime:instantiates", - "span_start": 17, - "span_end": 17, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "0adba17984f850ea1608c9e734d2dd5c325cfde3a8133123aa239e44935ad18e", - "edge_type": "instantiates", - "src_symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "src_qname": "create_runtime", - "dst_symbol_id": "27158ca220022eeb5083c6addf8a50775d45f7161284fd60aac48410105f4b98", - "dst_ref": "RuntimeManager", - "resolution": "resolved", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/bootstrap.py", - "content": "create_runtime calls runtime.register_module", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "create_runtime:calls", - "span_start": 28, - "span_end": 28, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "ab6003c3441addc1ba1b81edeca009165559f652f6b2cf424e5ae61b1f617de8", - "edge_type": "calls", - "src_symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "src_qname": "create_runtime", - "dst_symbol_id": null, - "dst_ref": "runtime.register_module", - "resolution": "partial", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/bootstrap.py", - "content": "create_runtime calls runtime.control_plane.register_channel", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "create_runtime:calls", - "span_start": 21, - "span_end": 27, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "2678250030b9ce47a3b3b55fac7897ac530367edc8374ac9d5e6ecafb1e483f0", - "edge_type": "calls", - "src_symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "src_qname": "create_runtime", - "dst_symbol_id": null, - "dst_ref": "runtime.control_plane.register_channel", - "resolution": "partial", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/bootstrap.py", - "content": "create_runtime reads_attr runtime.add_config_file", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "create_runtime:reads_attr", - "span_start": 19, - "span_end": 19, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "30d4e8aae984ab84d523e80d02f1caeda52d547fa3d2aa47be8845931cabbca2", - "edge_type": "reads_attr", - "src_symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "src_qname": "create_runtime", - "dst_symbol_id": null, - "dst_ref": "runtime.add_config_file", - "resolution": "partial", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/bootstrap.py", - "content": "def create_runtime(\n module: ApplicationModule,\n *,\n config_path: str | None = None,\n enable_http_control: bool = False,\n control_host: str = \"127.0.0.1\",\n control_port: int = 8080,\n control_timeout: int = 5,\n) -> RuntimeManager:\n runtime = RuntimeManager()\n if config_path is not None:\n runtime.add_config_file(config_path)\n if enable_http_control:\n runtime.control_plane.register_channel(\n HttpControlChannel(\n host=control_host,\n port=control_port,\n timeout=control_timeout,\n )\n )\n runtime.register_module(module)\n return runtime", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/plba/bootstrap.py:create_runtime", - "span_start": 8, - "span_end": 29, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.plba.bootstrap", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "llm_answer": "## Функциональное назначение сущности `create_runtime`\nФункция `create_runtime` предназначена для инициализации и настройки окружения выполнения (`runtime environment`) приложения. Она создает объект типа `RuntimeManager`, регистрирует указанный модуль (`module`) и при необходимости добавляет конфигурационные файлы и каналы управления через HTTP.\n\n## Ключевые зависимости\n- **src/plba/bootstrap.py**: основной файл, содержащий реализацию функции `create_runtime`.\n- **RuntimeManager**: класс, управляющий состоянием и функциональностью runtime-среды.\n- **ApplicationModule**: абстрактный тип модуля приложения, передаваемый в функцию.\n- **HttpControlChannel**: компонент, обеспечивающий управление приложением по HTTP с заданными параметрами хоста, порта и тайм-аута.\n\n## Поток данных или вызовов\n1. Функция `create_runtime` принимает несколько аргументов:\n - `module`: экземпляр класса `ApplicationModule`, представляющий модуль приложения.\n - Дополнительные параметры конфигурации, такие как путь к файлу конфигурации (`config_path`), включение HTTP-контроля (`enable_http_control`), хост и порт для HTTP-канала управления, а также таймаут запроса.\n \n2. Внутри функции происходит следующее:\n - Создается новый объект `RuntimeManager`.\n - Если указан параметр `config_path`, вызывается метод `add_config_file` объекта `runtime`, чтобы добавить указанный файл конфигурации.\n - При включенном HTTP-контроле регистрируется канал управления `HttpControlChannel` с заданными параметрами.\n - Вызовом метода `register_module` экземпляра `runtime` добавляется переданный модуль приложения.\n\n3. После завершения всех операций функция возвращает созданный объект `RuntimeManager`.\n\n## Важные детали реализации\n1. **Параметры вызова**:\n - Параметр `config_path` позволяет указать путь к файлу конфигурации, который затем загружается и используется runtime-менеджером.\n - Параметр `enable_http_control` определяет необходимость регистрации канала управления HTTP, позволяющего взаимодействовать с приложением удаленно.\n\n2. **Использование внешних классов и объектов**:\n - Использование класса `RuntimeManager` для управления runtime-средой.\n - Применение класса `HttpControlChannel` для организации каналов управления через HTTP.\n\n3. **Роль `pipeline_stage`**:\n - Как отмечено в описании семантических ролей (`C4_SEMANTIC_ROLES`), данная сущность участвует в данных потоках (`dataflow slices`), но ее основная роль заключается в управлении состоянием и настройке runtime-среды.\n\n## Осторожные выводы\nНа основании доступного контекста сложно однозначно утверждать о точном потоке данных внутри runtime-среды после создания runtime. Косвенные признаки указывают на возможное взаимодействие с внешними сервисами или ресурсами, однако конкретная реализация этих взаимодействий вне данного контекста остается неизвестной.", - "summary": { - "router": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "confidence": null - }, - "retrieval": { - "profile": "code", - "layers_hit": [ - "C0_SOURCE_CHUNKS", - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS", - "C4_SEMANTIC_ROLES" - ], - "evidence_sufficient": true - }, - "llm": { - "answer_status": "answered", - "groundedness": "grounded" - } - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "symbol_kind_hint": "function", - "symbol_candidates": [ - "create_runtime" - ], - "keyword_hints": [ - "create_runtime" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C0_SOURCE_CHUNKS": "exact_path_fetch", - "C4_SEMANTIC_ROLES": "exact_path_fetch", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C3_ENTRYPOINTS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 8, - "C4_SEMANTIC_ROLES": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C3_ENTRYPOINTS": 6 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C4_SEMANTIC_ROLES": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "create_runtime", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "create_runtime", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C4_SEMANTIC_ROLES", - "query": "create_runtime", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "create_runtime", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - }, - { - "layer": "C3_ENTRYPOINTS", - "query": "create_runtime", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 1, - "candidates_after_filter": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 6, - "candidates_after_filter": 6 - }, - { - "layer": "C3_ENTRYPOINTS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 3, - "candidates_after_filter": 3 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "create_runtime", - "alternatives": [ - "create_runtime" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C4_SEMANTIC_ROLES", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 6, - "fail_reason": null - }, - { - "layer": "C3_ENTRYPOINTS", - "status": "hit", - "hit_count": 3, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "router": 0, - "symbol_resolution": 0, - "retrieval_total": 145, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 41, - "C0_SOURCE_CHUNKS": 20, - "C4_SEMANTIC_ROLES": 19, - "C2_DEPENDENCY_GRAPH": 48, - "C3_ENTRYPOINTS": 14 - }, - "merge_rank": 21, - "prompt_build": 0, - "llm_call": 4155 - }, - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 601, - "evidence_rows": 12, - "evidence_chars": 1184 - }, - "evidence_summary": [ - { - "layer": "C1_SYMBOL_CATALOG", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "count": 6, - "unique_paths": 1 - }, - { - "layer": "C3_ENTRYPOINTS", - "count": 3, - "unique_paths": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 1, - "unique_paths": 1 - } - ], - "prompt_template_id": "intent_code_qa_explain_ru_v1", - "system_prompt_version": "v1" - }, - "router": { - "conversation_mode": "START", - "keyword_hints": [ - "create_runtime" - ], - "path_scope": [] - }, - "llm": { - "used_evidence_count": 12, - "missing_evidence_reason": null - } - }, - "run_info": { - "case_id": "plba-fullchain-explain-create-runtime", - "mode": "full_chain", - "run_started_at": "2026-03-12T11:44:13", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - }, - "input_request": { - "text": "Объясни функцию create_runtime", - "normalized_query": "Объясни функцию create_runtime" - }, - "steps": [ - { - "step": "intent_router", - "input": { - "query": "Объясни функцию create_runtime" - }, - "output": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Объясни функцию create_runtime" - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "symbol_kind_hint": "function", - "symbol_candidates": [ - "create_runtime" - ], - "keyword_hints": [ - "create_runtime" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "timings_ms": { - "router": 0 - } - } - }, - { - "step": "retrieval", - "input": { - "query": "Объясни функцию create_runtime" - }, - "output": { - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "create_runtime", - "alternatives": [ - "create_runtime" - ], - "confidence": 0.99 - }, - "rag_count": 12, - "rag_rows": [ - { - "path": "src/plba/bootstrap.py", - "content": "function create_runtime\ncreate_runtime(module)", - "layer": "C1_SYMBOL_CATALOG", - "title": "create_runtime", - "span_start": 8, - "span_end": 29, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "qname": "create_runtime", - "kind": "function", - "signature": "create_runtime(module)", - "parent_symbol_id": null, - "package_or_module": "src.plba.bootstrap", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_runner.py", - "content": "UvicornThreadRunner\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (24)", - "layer": "C4_SEMANTIC_ROLES", - "title": "UvicornThreadRunner", - "span_start": 10, - "span_end": 61, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 11, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "fd55630045a02100df8877ac27d951ee08617d4598764394d48cb51fe067476a", - "symbol_name": "UvicornThreadRunner", - "qname": "UvicornThreadRunner", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 24, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "3779fdd2878b770e789a35bb2a89c9d79f13b61c26d7db1b3b683f9bb9e1623f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/bootstrap.py", - "content": "create_runtime calls runtime.add_config_file", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "create_runtime:calls", - "span_start": 19, - "span_end": 19, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "4eaeec4ac55a59d5f66fd01c4754955f8fedaf4bc3df13fa769b352c7bfaacbb", - "edge_type": "calls", - "src_symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "src_qname": "create_runtime", - "dst_symbol_id": null, - "dst_ref": "runtime.add_config_file", - "resolution": "partial", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/bootstrap.py", - "content": "create_runtime reads_attr runtime.register_module", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "create_runtime:reads_attr", - "span_start": 28, - "span_end": 28, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "45516c79ff358dbf9b650a081668df0f66d2fe989300f985a1a78be6be166f8f", - "edge_type": "reads_attr", - "src_symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "src_qname": "create_runtime", - "dst_symbol_id": null, - "dst_ref": "runtime.register_module", - "resolution": "partial", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/bootstrap.py", - "content": "create_runtime instantiates RuntimeManager", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "create_runtime:instantiates", - "span_start": 17, - "span_end": 17, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "0adba17984f850ea1608c9e734d2dd5c325cfde3a8133123aa239e44935ad18e", - "edge_type": "instantiates", - "src_symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "src_qname": "create_runtime", - "dst_symbol_id": "27158ca220022eeb5083c6addf8a50775d45f7161284fd60aac48410105f4b98", - "dst_ref": "RuntimeManager", - "resolution": "resolved", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/bootstrap.py", - "content": "create_runtime calls runtime.register_module", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "create_runtime:calls", - "span_start": 28, - "span_end": 28, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "ab6003c3441addc1ba1b81edeca009165559f652f6b2cf424e5ae61b1f617de8", - "edge_type": "calls", - "src_symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "src_qname": "create_runtime", - "dst_symbol_id": null, - "dst_ref": "runtime.register_module", - "resolution": "partial", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/bootstrap.py", - "content": "create_runtime calls runtime.control_plane.register_channel", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "create_runtime:calls", - "span_start": 21, - "span_end": 27, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "2678250030b9ce47a3b3b55fac7897ac530367edc8374ac9d5e6ecafb1e483f0", - "edge_type": "calls", - "src_symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "src_qname": "create_runtime", - "dst_symbol_id": null, - "dst_ref": "runtime.control_plane.register_channel", - "resolution": "partial", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/bootstrap.py", - "content": "create_runtime reads_attr runtime.add_config_file", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "create_runtime:reads_attr", - "span_start": 19, - "span_end": 19, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "30d4e8aae984ab84d523e80d02f1caeda52d547fa3d2aa47be8845931cabbca2", - "edge_type": "reads_attr", - "src_symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "src_qname": "create_runtime", - "dst_symbol_id": null, - "dst_ref": "runtime.add_config_file", - "resolution": "partial", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/bootstrap.py", - "content": "def create_runtime(\n module: ApplicationModule,\n *,\n config_path: str | None = None,\n enable_http_control: bool = False,\n control_host: str = \"127.0.0.1\",\n control_port: int = 8080,\n control_timeout: int = 5,\n) -> RuntimeManager:\n runtime = RuntimeManager()\n if config_path is not None:\n runtime.add_config_file(config_path)\n if enable_http_control:\n runtime.control_plane.register_channel(\n HttpControlChannel(\n host=control_host,\n port=control_port,\n timeout=control_timeout,\n )\n )\n runtime.register_module(module)\n return runtime", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/plba/bootstrap.py:create_runtime", - "span_start": 8, - "span_end": 29, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.plba.bootstrap", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ] - }, - "diagnostics": { - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C0_SOURCE_CHUNKS": "exact_path_fetch", - "C4_SEMANTIC_ROLES": "exact_path_fetch", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C3_ENTRYPOINTS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 8, - "C4_SEMANTIC_ROLES": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C3_ENTRYPOINTS": 6 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C4_SEMANTIC_ROLES": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "create_runtime", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "create_runtime", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C4_SEMANTIC_ROLES", - "query": "create_runtime", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "create_runtime", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - }, - { - "layer": "C3_ENTRYPOINTS", - "query": "create_runtime", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 1, - "candidates_after_filter": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 6, - "candidates_after_filter": 6 - }, - { - "layer": "C3_ENTRYPOINTS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 3, - "candidates_after_filter": 3 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "create_runtime", - "alternatives": [ - "create_runtime" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C4_SEMANTIC_ROLES", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 6, - "fail_reason": null - }, - { - "layer": "C3_ENTRYPOINTS", - "status": "hit", - "hit_count": 3, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "symbol_resolution": 0, - "retrieval_total": 145, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 41, - "C0_SOURCE_CHUNKS": 20, - "C4_SEMANTIC_ROLES": 19, - "C2_DEPENDENCY_GRAPH": 48, - "C3_ENTRYPOINTS": 14 - }, - "merge_rank": 21 - } - } - }, - { - "step": "llm_answer", - "input": { - "query": "Объясни функцию create_runtime", - "rag_count": 12 - }, - "output": { - "llm_answer": "## Функциональное назначение сущности `create_runtime`\nФункция `create_runtime` предназначена для инициализации и настройки окружения выполнения (`runtime environment`) приложения. Она создает объект типа `RuntimeManager`, регистрирует указанный модуль (`module`) и при необходимости добавляет конфигурационные файлы и каналы управления через HTTP.\n\n## Ключевые зависимости\n- **src/plba/bootstrap.py**: основной файл, содержащий реализацию функции `create_runtime`.\n- **RuntimeManager**: класс, управляющий состоянием и функциональностью runtime-среды.\n- **ApplicationModule**: абстрактный тип модуля приложения, передаваемый в функцию.\n- **HttpControlChannel**: компонент, обеспечивающий управление приложением по HTTP с заданными параметрами хоста, порта и тайм-аута.\n\n## Поток данных или вызовов\n1. Функция `create_runtime` принимает несколько аргументов:\n - `module`: экземпляр класса `ApplicationModule`, представляющий модуль приложения.\n - Дополнительные параметры конфигурации, такие как путь к файлу конфигурации (`config_path`), включение HTTP-контроля (`enable_http_control`), хост и порт для HTTP-канала управления, а также таймаут запроса.\n \n2. Внутри функции происходит следующее:\n - Создается новый объект `RuntimeManager`.\n - Если указан параметр `config_path`, вызывается метод `add_config_file` объекта `runtime`, чтобы добавить указанный файл конфигурации.\n - При включенном HTTP-контроле регистрируется канал управления `HttpControlChannel` с заданными параметрами.\n - Вызовом метода `register_module` экземпляра `runtime` добавляется переданный модуль приложения.\n\n3. После завершения всех операций функция возвращает созданный объект `RuntimeManager`.\n\n## Важные детали реализации\n1. **Параметры вызова**:\n - Параметр `config_path` позволяет указать путь к файлу конфигурации, который затем загружается и используется runtime-менеджером.\n - Параметр `enable_http_control` определяет необходимость регистрации канала управления HTTP, позволяющего взаимодействовать с приложением удаленно.\n\n2. **Использование внешних классов и объектов**:\n - Использование класса `RuntimeManager` для управления runtime-средой.\n - Применение класса `HttpControlChannel` для организации каналов управления через HTTP.\n\n3. **Роль `pipeline_stage`**:\n - Как отмечено в описании семантических ролей (`C4_SEMANTIC_ROLES`), данная сущность участвует в данных потоках (`dataflow slices`), но ее основная роль заключается в управлении состоянием и настройке runtime-среды.\n\n## Осторожные выводы\nНа основании доступного контекста сложно однозначно утверждать о точном потоке данных внутри runtime-среды после создания runtime. Косвенные признаки указывают на возможное взаимодействие с внешними сервисами или ресурсами, однако конкретная реализация этих взаимодействий вне данного контекста остается неизвестной." - }, - "diagnostics": { - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 601, - "evidence_rows": 12, - "evidence_chars": 1184 - }, - "evidence_summary": [ - { - "layer": "C1_SYMBOL_CATALOG", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "count": 6, - "unique_paths": 1 - }, - { - "layer": "C3_ENTRYPOINTS", - "count": 3, - "unique_paths": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 1, - "unique_paths": 1 - } - ], - "prompt_template_id": "intent_code_qa_explain_ru_v1", - "system_prompt_version": "v1" - }, - "timings_ms": { - "prompt_build": 0, - "llm_call": 4155 - } - } - } - ] - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_114413/full_chain_plba_code_retrieval_plba-fullchain-explain-create-runtime.md b/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_114413/full_chain_plba_code_retrieval_plba-fullchain-explain-create-runtime.md deleted file mode 100644 index 5b7af2f..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_114413/full_chain_plba_code_retrieval_plba-fullchain-explain-create-runtime.md +++ /dev/null @@ -1,34 +0,0 @@ -# plba-fullchain-explain-create-runtime - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_retrieval.yaml -- runner: runtime -- mode: full_chain -- passed: True - -## Query -Объясни функцию create_runtime - -## Actual -{ - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 12, - "llm_answer": "## Функциональное назначение сущности `create_runtime`\nФункция `create_runtime` предназначена для инициализации и настройки окружения выполнения (`runtime environment`) приложения. Она создает объект типа `RuntimeManager`, регистрирует указанный модуль (`module`) и при необходимости добавляет конфигурационные файлы и каналы управления через HTTP.\n\n## Ключевые зависимости\n- **src/plba/bootstrap.py**: основной файл, содержащий реализацию функции `create_runtime`.\n- **RuntimeManager**: класс, управляющий состоянием и функциональностью runtime-среды.\n- **ApplicationModule**: абстрактный тип модуля приложения, передаваемый в функцию.\n- **HttpControlChannel**: компонент, обеспечивающий управление приложением по HTTP с заданными параметрами хоста, порта и тайм-аута.\n\n## Поток данных или вызовов\n1. Функция `create_runtime` принимает несколько аргументов:\n - `module`: экземпляр класса `ApplicationModule`, представляющий модуль приложения.\n - Дополнительные параметры конфигурации, такие как путь к файлу конфигурации (`config_path`), включение HTTP-контроля (`enable_http_control`), хост и порт для HTTP-канала управления, а также таймаут запроса.\n \n2. Внутри функции происходит следующее:\n - Создается новый объект `RuntimeManager`.\n - Если указан параметр `config_path`, вызывается метод `add_config_file` объекта `runtime`, чтобы добавить указанный файл конфигурации.\n - При включенном HTTP-контроле регистрируется канал управления `HttpControlChannel` с заданными параметрами.\n - Вызовом метода `register_module` экземпляра `runtime` добавляется переданный модуль приложения.\n\n3. После завершения всех операций функция возвращает созданный объект `RuntimeManager`.\n\n## Важные детали реализации\n1. **Параметры вызова**:\n - Параметр `config_path` позволяет указать путь к файлу конфигурации, который затем загружается и используется runtime-менеджером.\n - Параметр `enable_http_control` определяет необходимость регистрации канала управления HTTP, позволяющего взаимодействовать с приложением удаленно.\n\n2. **Использование внешних классов и объектов**:\n - Использование класса `RuntimeManager` для управления runtime-средой.\n - Применение класса `HttpControlChannel` для организации каналов управления через HTTP.\n\n3. **Роль `pipeline_stage`**:\n - Как отмечено в описании семантических ролей (`C4_SEMANTIC_ROLES`), данная сущность участвует в данных потоках (`dataflow slices`), но ее основная роль заключается в управлении состоянием и настройке runtime-среды.\n\n## Осторожные выводы\nНа основании доступного контекста сложно однозначно утверждать о точном потоке данных внутри runtime-среды после создания runtime. Косвенные признаки указывают на возможное взаимодействие с внешними сервисами или ресурсами, однако конкретная реализация этих взаимодействий вне данного контекста остается неизвестной.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "create_runtime" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] -} - -## Mismatches -- none \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_114413/full_chain_plba_code_retrieval_plba-fullchain-explain-http-control-channel.json b/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_114413/full_chain_plba_code_retrieval_plba-fullchain-explain-http-control-channel.json deleted file mode 100644 index 967b7ed..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_114413/full_chain_plba_code_retrieval_plba-fullchain-explain-http-control-channel.json +++ /dev/null @@ -1,2088 +0,0 @@ -{ - "case_id": "plba-fullchain-explain-http-control-channel", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_retrieval.yaml", - "runner": "runtime", - "mode": "full_chain", - "actual": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 12, - "llm_answer": "## Объяснение сущности `HttpControlChannel`\n\n### Назначение\nКласс `HttpControlChannel` является компонентом конвейера приложения, ответственным за управление состоянием через HTTP-запросы. Он участвует в обработке запросов к приложению, обеспечивает маршрутизацию и выполнение действий, связанных с управлением состояниями и конфигурацией системы.\n\n### Ключевые зависимости\n- **host**: строка, представляющая хост для сервера.\n- **port**: целое число, представляющее порт для сервера.\n- **timeout**: целое число, задающее таймаут выполнения операций.\n\n### Поток данных или вызовов\n1. **Инициализация (`__init__`)** \n - При создании экземпляра класса происходит инициализация полей `_timeout`, `_runner` и `_factory`. Поле `_runner` представляет собой объект типа `UvicornThreadRunner`, отвечающий за запуск веб-сервера на указанном хосте и порте. Поле `_factory` отвечает за создание экземпляра `HttpControlAppFactory`.\n \n2. **Запуск (`start`)** \n - Метод принимает параметр `actions`, содержащий набор действий управления. Далее создается экземпляр приложения `app` при помощи фабрики `_factory`, после чего приложение запускается методом `_runner.start()`.\n \n3. **Остановка (`stop`)** \n - Остановка работы серверного приложения выполняется вызовом метода `_runner.stop()`.\n \n4. **Получение порта (`port`)** \n - Возвращает номер порта, на котором запущен сервер.\n\n5. **Ответы на запросы о здоровье и действиях** \n - Для запроса о состоянии здоровья вызывается метод `_health_response`, возвращающий статус системы (\"здорово\" или \"нездорово\"). Если действия конфигурации отсутствуют, возвращается сообщение об ошибке.\n - Для ответа на запрос о выполнении конкретных действий вызывается метод `_action_response`, проверяющий наличие необходимых действий и возвращая соответствующий результат.\n\n### Важные детали реализации\n- Использование асинхронных методов позволяет эффективно обрабатывать запросы и выполнять длительные операции без блокировки основного потока исполнения.\n- Параметр `_actions` хранит коллекцию доступных действий управления системой, что делает компонент гибким и расширяемым.\n- Конкретная реализация поведения зависит от объекта `_factory`, создавая различное поведение в зависимости от потребностей приложения.\n\n### Косвенные признаки и осторожные выводы\n- Отсутствуют явные файлы или сущности, напрямую связанные с логикой работы класса `HttpControlChannel`. Однако информация из графа зависимостей указывает на его взаимодействие с объектом `UvicornThreadRunner` и фабрикой приложений.\n- Объявления методов и свойств показывают стандартную схему взаимодействия: получение и установка атрибутов, старт и остановка сервиса, обработка запросов.\n\n---\n\nТаким образом, `HttpControlChannel` — это важный элемент инфраструктуры, обеспечивающий управляемость и доступность приложения через HTTP-интерфейс.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "HttpControlChannel" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "passed": true, - "mismatches": [], - "details": { - "case_id": "plba-fullchain-explain-http-control-channel", - "text": "Объясни класс HttpControlChannel", - "mode": "full_chain", - "run_started_at": "2026-03-12T11:44:13", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Объясни класс HttpControlChannel", - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "HttpControlChannel", - "alternatives": [ - "HttpControlChannel" - ], - "confidence": 0.99 - }, - "rag_count": 12, - "rag_rows": [ - { - "path": "src/app_runtime/control/http_channel.py", - "content": "class HttpControlChannel\nHttpControlChannel(ControlChannel)", - "layer": "C1_SYMBOL_CATALOG", - "title": "HttpControlChannel", - "span_start": 12, - "span_end": 57, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "1c9fbdc24819e5604c26ea55428a74310f03a03e1af197ed84846af61e42fdb0", - "qname": "HttpControlChannel", - "kind": "class", - "signature": "HttpControlChannel(ControlChannel)", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.control.http_channel", - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (10)", - "layer": "C4_SEMANTIC_ROLES", - "title": "HttpControlChannel", - "span_start": 12, - "span_end": 57, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 21, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "1c9fbdc24819e5604c26ea55428a74310f03a03e1af197ed84846af61e42fdb0", - "symbol_name": "HttpControlChannel", - "qname": "HttpControlChannel", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 10, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel.__init__\n -> HttpControlChannel._runner\n -> HttpControlChannel.start", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "HttpControlChannel.__init__:dataflow_slice", - "span_start": 15, - "span_end": 22, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "51d73913df709152258ed1b9a8c8f4eb3c575eccfe6b982aef0b28e0789a29da", - "edge_type": "dataflow_slice", - "src_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "src_qname": "HttpControlChannel.__init__", - "dst_symbol_id": "d1933f04137f52535b6525f1b93ff2cd83bfb216b480e887e791ed1714cda8e0", - "dst_ref": "HttpControlChannel.start", - "resolution": "resolved", - "slice_id": "51d73913df709152258ed1b9a8c8f4eb3c575eccfe6b982aef0b28e0789a29da", - "root_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "path_symbols": [ - "HttpControlChannel.__init__", - "HttpControlChannel._runner", - "HttpControlChannel.start" - ], - "path_symbol_ids": [ - "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "d1933f04137f52535b6525f1b93ff2cd83bfb216b480e887e791ed1714cda8e0" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel.__init__\n -> HttpControlChannel._runner\n -> HttpControlChannel.port", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "HttpControlChannel.__init__:dataflow_slice", - "span_start": 15, - "span_end": 29, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "c7167bab7218bb768ad7c11bfb40d1a3096e6071dd7817bba5fd864cf8f6de13", - "edge_type": "dataflow_slice", - "src_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "src_qname": "HttpControlChannel.__init__", - "dst_symbol_id": "3632ce8227f4a31e0768f2fb021a4d1ba28e1202633aa0f2fac902295931280f", - "dst_ref": "HttpControlChannel.port", - "resolution": "resolved", - "slice_id": "c7167bab7218bb768ad7c11bfb40d1a3096e6071dd7817bba5fd864cf8f6de13", - "root_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "path_symbols": [ - "HttpControlChannel.__init__", - "HttpControlChannel._runner", - "HttpControlChannel.port" - ], - "path_symbol_ids": [ - "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "3632ce8227f4a31e0768f2fb021a4d1ba28e1202633aa0f2fac902295931280f" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel.__init__\n -> HttpControlChannel._timeout\n -> HttpControlChannel._health_response", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "HttpControlChannel.__init__:dataflow_slice", - "span_start": 14, - "span_end": 34, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "f858f5c9e575f6c4cdfe3853571b7ee21d1f628a443541d2037c3dc9d0790bef", - "edge_type": "dataflow_slice", - "src_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "src_qname": "HttpControlChannel.__init__", - "dst_symbol_id": "e84bf04e9cd2127df235b7064d05f47e19f19a89c7c82f4c247231d4e8fa426a", - "dst_ref": "HttpControlChannel._health_response", - "resolution": "resolved", - "slice_id": "f858f5c9e575f6c4cdfe3853571b7ee21d1f628a443541d2037c3dc9d0790bef", - "root_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "path_symbols": [ - "HttpControlChannel.__init__", - "HttpControlChannel._timeout", - "HttpControlChannel._health_response" - ], - "path_symbol_ids": [ - "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "e84bf04e9cd2127df235b7064d05f47e19f19a89c7c82f4c247231d4e8fa426a" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel.__init__\n -> HttpControlChannel._timeout\n -> HttpControlChannel._action_response", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "HttpControlChannel.__init__:dataflow_slice", - "span_start": 14, - "span_end": 47, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "c3ef21fcae96c82c00be74b3ab827d4af2085d89cb3fa5521c19a174aad84dbb", - "edge_type": "dataflow_slice", - "src_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "src_qname": "HttpControlChannel.__init__", - "dst_symbol_id": "e64969024ccaeb34d8d91473fad07b3b3d341875846392e7a006406c7ada1954", - "dst_ref": "HttpControlChannel._action_response", - "resolution": "resolved", - "slice_id": "c3ef21fcae96c82c00be74b3ab827d4af2085d89cb3fa5521c19a174aad84dbb", - "root_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "path_symbols": [ - "HttpControlChannel.__init__", - "HttpControlChannel._timeout", - "HttpControlChannel._action_response" - ], - "path_symbol_ids": [ - "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "e64969024ccaeb34d8d91473fad07b3b3d341875846392e7a006406c7ada1954" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel.__init__\n -> HttpControlChannel._runner\n -> HttpControlChannel.stop", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "HttpControlChannel.__init__:dataflow_slice", - "span_start": 15, - "span_end": 25, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "0f827ef81a990258a8a74381c8564a8361afa6712dba3200592659c939adcb9d", - "edge_type": "dataflow_slice", - "src_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "src_qname": "HttpControlChannel.__init__", - "dst_symbol_id": "f29ab212620093d72be20e26c5a399624c7939a6056a728762ed3f84a250bfa3", - "dst_ref": "HttpControlChannel.stop", - "resolution": "resolved", - "slice_id": "0f827ef81a990258a8a74381c8564a8361afa6712dba3200592659c939adcb9d", - "root_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "path_symbols": [ - "HttpControlChannel.__init__", - "HttpControlChannel._runner", - "HttpControlChannel.stop" - ], - "path_symbol_ids": [ - "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "f29ab212620093d72be20e26c5a399624c7939a6056a728762ed3f84a250bfa3" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel.__init__\n -> HttpControlChannel._factory\n -> HttpControlChannel.start", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "HttpControlChannel.__init__:dataflow_slice", - "span_start": 16, - "span_end": 21, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e61ec25ded7dbe380d95ce2abcbc1d7a2d2afde5aa8453866df8706dfb7d6ddb", - "edge_type": "dataflow_slice", - "src_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "src_qname": "HttpControlChannel.__init__", - "dst_symbol_id": "d1933f04137f52535b6525f1b93ff2cd83bfb216b480e887e791ed1714cda8e0", - "dst_ref": "HttpControlChannel.start", - "resolution": "resolved", - "slice_id": "e61ec25ded7dbe380d95ce2abcbc1d7a2d2afde5aa8453866df8706dfb7d6ddb", - "root_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "path_symbols": [ - "HttpControlChannel.__init__", - "HttpControlChannel._factory", - "HttpControlChannel.start" - ], - "path_symbol_ids": [ - "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "d1933f04137f52535b6525f1b93ff2cd83bfb216b480e887e791ed1714cda8e0" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "class HttpControlChannel(ControlChannel):\n def __init__(self, host: str, port: int, timeout: int) -> None:\n self._timeout = timeout\n self._runner = UvicornThreadRunner(host, port, timeout)\n self._factory = HttpControlAppFactory()\n self._actions: ControlActionSet | None = None\n\n async def start(self, actions: ControlActionSet) -> None:\n self._actions = actions\n app = self._factory.create(self._health_response, self._action_response)\n await self._runner.start(app)\n\n async def stop(self) -> None:\n await self._runner.stop()\n\n @property\n def port(self) -> int:\n return self._runner.port\n\n async def _health_response(self) -> dict[str, object]:\n if self._actions is None:\n return {\"status\": \"unhealthy\", \"detail\": \"control actions are not configured\"}\n return await asyncio.wait_for(self._actions.health(), timeout=float(self._timeout))\n\n async def _action_response(self, action: str, _client_source: str = \"unknown\") -> JSONResponse:\n if self._actions is None:\n return JSONResponse(content={\"status\": \"error\", \"detail\": f\"{action} handler is not configured\"}, status_code=404)\n callbacks = {\n \"start\": self._actions.start,\n \"stop\": self._actions.stop,\n \"status\": self._actions.status,\n }\n callback = callbacks.get(action)\n if callback is None:\n return JSONResponse(content={\"status\": \"error\", \"detail\": f\"unsupported action: {action}\"}, status_code=404)\n action_timeout = max(float(self._timeout), 10.0) if action in {\"start\", \"stop\"} else float(self._timeout)\n try:\n detail = await asyncio.wait_for(callback(), timeout=action_timeout)\n except asyncio.TimeoutError:\n return JSONResponse(\n content={\"status\": \"accepted\", \"detail\": f\"{action} operation is still in progress\"},\n status_code=202,\n )\n except Exception as exc:\n return JSONResponse(content={\"status\": \"error\", \"detail\": str(exc)}, status_code=500)\n return JSONResponse(content={\"status\": \"ok\", \"detail\": detail or f\"{action} action accepted\"}, status_code=200)", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/http_channel.py:HttpControlChannel", - "span_start": 12, - "span_end": 57, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.http_channel", - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "llm_answer": "## Объяснение сущности `HttpControlChannel`\n\n### Назначение\nКласс `HttpControlChannel` является компонентом конвейера приложения, ответственным за управление состоянием через HTTP-запросы. Он участвует в обработке запросов к приложению, обеспечивает маршрутизацию и выполнение действий, связанных с управлением состояниями и конфигурацией системы.\n\n### Ключевые зависимости\n- **host**: строка, представляющая хост для сервера.\n- **port**: целое число, представляющее порт для сервера.\n- **timeout**: целое число, задающее таймаут выполнения операций.\n\n### Поток данных или вызовов\n1. **Инициализация (`__init__`)** \n - При создании экземпляра класса происходит инициализация полей `_timeout`, `_runner` и `_factory`. Поле `_runner` представляет собой объект типа `UvicornThreadRunner`, отвечающий за запуск веб-сервера на указанном хосте и порте. Поле `_factory` отвечает за создание экземпляра `HttpControlAppFactory`.\n \n2. **Запуск (`start`)** \n - Метод принимает параметр `actions`, содержащий набор действий управления. Далее создается экземпляр приложения `app` при помощи фабрики `_factory`, после чего приложение запускается методом `_runner.start()`.\n \n3. **Остановка (`stop`)** \n - Остановка работы серверного приложения выполняется вызовом метода `_runner.stop()`.\n \n4. **Получение порта (`port`)** \n - Возвращает номер порта, на котором запущен сервер.\n\n5. **Ответы на запросы о здоровье и действиях** \n - Для запроса о состоянии здоровья вызывается метод `_health_response`, возвращающий статус системы (\"здорово\" или \"нездорово\"). Если действия конфигурации отсутствуют, возвращается сообщение об ошибке.\n - Для ответа на запрос о выполнении конкретных действий вызывается метод `_action_response`, проверяющий наличие необходимых действий и возвращая соответствующий результат.\n\n### Важные детали реализации\n- Использование асинхронных методов позволяет эффективно обрабатывать запросы и выполнять длительные операции без блокировки основного потока исполнения.\n- Параметр `_actions` хранит коллекцию доступных действий управления системой, что делает компонент гибким и расширяемым.\n- Конкретная реализация поведения зависит от объекта `_factory`, создавая различное поведение в зависимости от потребностей приложения.\n\n### Косвенные признаки и осторожные выводы\n- Отсутствуют явные файлы или сущности, напрямую связанные с логикой работы класса `HttpControlChannel`. Однако информация из графа зависимостей указывает на его взаимодействие с объектом `UvicornThreadRunner` и фабрикой приложений.\n- Объявления методов и свойств показывают стандартную схему взаимодействия: получение и установка атрибутов, старт и остановка сервиса, обработка запросов.\n\n---\n\nТаким образом, `HttpControlChannel` — это важный элемент инфраструктуры, обеспечивающий управляемость и доступность приложения через HTTP-интерфейс.", - "summary": { - "router": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "confidence": null - }, - "retrieval": { - "profile": "code", - "layers_hit": [ - "C0_SOURCE_CHUNKS", - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS", - "C4_SEMANTIC_ROLES" - ], - "evidence_sufficient": true - }, - "llm": { - "answer_status": "answered", - "groundedness": "grounded" - } - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "HttpControlChannel" - ], - "keyword_hints": [ - "HttpControlChannel" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C0_SOURCE_CHUNKS": "exact_path_fetch", - "C4_SEMANTIC_ROLES": "exact_path_fetch", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C3_ENTRYPOINTS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 8, - "C4_SEMANTIC_ROLES": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C3_ENTRYPOINTS": 6 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C4_SEMANTIC_ROLES": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "HttpControlChannel", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "HttpControlChannel", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C4_SEMANTIC_ROLES", - "query": "HttpControlChannel", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "HttpControlChannel", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - }, - { - "layer": "C3_ENTRYPOINTS", - "query": "HttpControlChannel", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 1, - "candidates_after_filter": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 6, - "candidates_after_filter": 6 - }, - { - "layer": "C3_ENTRYPOINTS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 3, - "candidates_after_filter": 3 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "HttpControlChannel", - "alternatives": [ - "HttpControlChannel" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C4_SEMANTIC_ROLES", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 6, - "fail_reason": null - }, - { - "layer": "C3_ENTRYPOINTS", - "status": "hit", - "hit_count": 3, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "router": 0, - "symbol_resolution": 0, - "retrieval_total": 157, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 49, - "C0_SOURCE_CHUNKS": 20, - "C4_SEMANTIC_ROLES": 18, - "C2_DEPENDENCY_GRAPH": 55, - "C3_ENTRYPOINTS": 12 - }, - "merge_rank": 20, - "prompt_build": 0, - "llm_call": 4482 - }, - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 795, - "evidence_rows": 12, - "evidence_chars": 3028 - }, - "evidence_summary": [ - { - "layer": "C1_SYMBOL_CATALOG", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "count": 6, - "unique_paths": 1 - }, - { - "layer": "C3_ENTRYPOINTS", - "count": 3, - "unique_paths": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 1, - "unique_paths": 1 - } - ], - "prompt_template_id": "intent_code_qa_explain_ru_v1", - "system_prompt_version": "v1" - }, - "router": { - "conversation_mode": "START", - "keyword_hints": [ - "HttpControlChannel" - ], - "path_scope": [] - }, - "llm": { - "used_evidence_count": 12, - "missing_evidence_reason": null - } - }, - "run_info": { - "case_id": "plba-fullchain-explain-http-control-channel", - "mode": "full_chain", - "run_started_at": "2026-03-12T11:44:13", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - }, - "input_request": { - "text": "Объясни класс HttpControlChannel", - "normalized_query": "Объясни класс HttpControlChannel" - }, - "steps": [ - { - "step": "intent_router", - "input": { - "query": "Объясни класс HttpControlChannel" - }, - "output": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Объясни класс HttpControlChannel" - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "HttpControlChannel" - ], - "keyword_hints": [ - "HttpControlChannel" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "timings_ms": { - "router": 0 - } - } - }, - { - "step": "retrieval", - "input": { - "query": "Объясни класс HttpControlChannel" - }, - "output": { - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "HttpControlChannel", - "alternatives": [ - "HttpControlChannel" - ], - "confidence": 0.99 - }, - "rag_count": 12, - "rag_rows": [ - { - "path": "src/app_runtime/control/http_channel.py", - "content": "class HttpControlChannel\nHttpControlChannel(ControlChannel)", - "layer": "C1_SYMBOL_CATALOG", - "title": "HttpControlChannel", - "span_start": 12, - "span_end": 57, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "1c9fbdc24819e5604c26ea55428a74310f03a03e1af197ed84846af61e42fdb0", - "qname": "HttpControlChannel", - "kind": "class", - "signature": "HttpControlChannel(ControlChannel)", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.control.http_channel", - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (10)", - "layer": "C4_SEMANTIC_ROLES", - "title": "HttpControlChannel", - "span_start": 12, - "span_end": 57, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 21, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "1c9fbdc24819e5604c26ea55428a74310f03a03e1af197ed84846af61e42fdb0", - "symbol_name": "HttpControlChannel", - "qname": "HttpControlChannel", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 10, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel.__init__\n -> HttpControlChannel._runner\n -> HttpControlChannel.start", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "HttpControlChannel.__init__:dataflow_slice", - "span_start": 15, - "span_end": 22, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "51d73913df709152258ed1b9a8c8f4eb3c575eccfe6b982aef0b28e0789a29da", - "edge_type": "dataflow_slice", - "src_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "src_qname": "HttpControlChannel.__init__", - "dst_symbol_id": "d1933f04137f52535b6525f1b93ff2cd83bfb216b480e887e791ed1714cda8e0", - "dst_ref": "HttpControlChannel.start", - "resolution": "resolved", - "slice_id": "51d73913df709152258ed1b9a8c8f4eb3c575eccfe6b982aef0b28e0789a29da", - "root_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "path_symbols": [ - "HttpControlChannel.__init__", - "HttpControlChannel._runner", - "HttpControlChannel.start" - ], - "path_symbol_ids": [ - "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "d1933f04137f52535b6525f1b93ff2cd83bfb216b480e887e791ed1714cda8e0" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel.__init__\n -> HttpControlChannel._runner\n -> HttpControlChannel.port", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "HttpControlChannel.__init__:dataflow_slice", - "span_start": 15, - "span_end": 29, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "c7167bab7218bb768ad7c11bfb40d1a3096e6071dd7817bba5fd864cf8f6de13", - "edge_type": "dataflow_slice", - "src_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "src_qname": "HttpControlChannel.__init__", - "dst_symbol_id": "3632ce8227f4a31e0768f2fb021a4d1ba28e1202633aa0f2fac902295931280f", - "dst_ref": "HttpControlChannel.port", - "resolution": "resolved", - "slice_id": "c7167bab7218bb768ad7c11bfb40d1a3096e6071dd7817bba5fd864cf8f6de13", - "root_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "path_symbols": [ - "HttpControlChannel.__init__", - "HttpControlChannel._runner", - "HttpControlChannel.port" - ], - "path_symbol_ids": [ - "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "3632ce8227f4a31e0768f2fb021a4d1ba28e1202633aa0f2fac902295931280f" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel.__init__\n -> HttpControlChannel._timeout\n -> HttpControlChannel._health_response", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "HttpControlChannel.__init__:dataflow_slice", - "span_start": 14, - "span_end": 34, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "f858f5c9e575f6c4cdfe3853571b7ee21d1f628a443541d2037c3dc9d0790bef", - "edge_type": "dataflow_slice", - "src_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "src_qname": "HttpControlChannel.__init__", - "dst_symbol_id": "e84bf04e9cd2127df235b7064d05f47e19f19a89c7c82f4c247231d4e8fa426a", - "dst_ref": "HttpControlChannel._health_response", - "resolution": "resolved", - "slice_id": "f858f5c9e575f6c4cdfe3853571b7ee21d1f628a443541d2037c3dc9d0790bef", - "root_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "path_symbols": [ - "HttpControlChannel.__init__", - "HttpControlChannel._timeout", - "HttpControlChannel._health_response" - ], - "path_symbol_ids": [ - "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "e84bf04e9cd2127df235b7064d05f47e19f19a89c7c82f4c247231d4e8fa426a" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel.__init__\n -> HttpControlChannel._timeout\n -> HttpControlChannel._action_response", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "HttpControlChannel.__init__:dataflow_slice", - "span_start": 14, - "span_end": 47, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "c3ef21fcae96c82c00be74b3ab827d4af2085d89cb3fa5521c19a174aad84dbb", - "edge_type": "dataflow_slice", - "src_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "src_qname": "HttpControlChannel.__init__", - "dst_symbol_id": "e64969024ccaeb34d8d91473fad07b3b3d341875846392e7a006406c7ada1954", - "dst_ref": "HttpControlChannel._action_response", - "resolution": "resolved", - "slice_id": "c3ef21fcae96c82c00be74b3ab827d4af2085d89cb3fa5521c19a174aad84dbb", - "root_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "path_symbols": [ - "HttpControlChannel.__init__", - "HttpControlChannel._timeout", - "HttpControlChannel._action_response" - ], - "path_symbol_ids": [ - "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "e64969024ccaeb34d8d91473fad07b3b3d341875846392e7a006406c7ada1954" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel.__init__\n -> HttpControlChannel._runner\n -> HttpControlChannel.stop", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "HttpControlChannel.__init__:dataflow_slice", - "span_start": 15, - "span_end": 25, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "0f827ef81a990258a8a74381c8564a8361afa6712dba3200592659c939adcb9d", - "edge_type": "dataflow_slice", - "src_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "src_qname": "HttpControlChannel.__init__", - "dst_symbol_id": "f29ab212620093d72be20e26c5a399624c7939a6056a728762ed3f84a250bfa3", - "dst_ref": "HttpControlChannel.stop", - "resolution": "resolved", - "slice_id": "0f827ef81a990258a8a74381c8564a8361afa6712dba3200592659c939adcb9d", - "root_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "path_symbols": [ - "HttpControlChannel.__init__", - "HttpControlChannel._runner", - "HttpControlChannel.stop" - ], - "path_symbol_ids": [ - "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "f29ab212620093d72be20e26c5a399624c7939a6056a728762ed3f84a250bfa3" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel.__init__\n -> HttpControlChannel._factory\n -> HttpControlChannel.start", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "HttpControlChannel.__init__:dataflow_slice", - "span_start": 16, - "span_end": 21, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e61ec25ded7dbe380d95ce2abcbc1d7a2d2afde5aa8453866df8706dfb7d6ddb", - "edge_type": "dataflow_slice", - "src_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "src_qname": "HttpControlChannel.__init__", - "dst_symbol_id": "d1933f04137f52535b6525f1b93ff2cd83bfb216b480e887e791ed1714cda8e0", - "dst_ref": "HttpControlChannel.start", - "resolution": "resolved", - "slice_id": "e61ec25ded7dbe380d95ce2abcbc1d7a2d2afde5aa8453866df8706dfb7d6ddb", - "root_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "path_symbols": [ - "HttpControlChannel.__init__", - "HttpControlChannel._factory", - "HttpControlChannel.start" - ], - "path_symbol_ids": [ - "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "d1933f04137f52535b6525f1b93ff2cd83bfb216b480e887e791ed1714cda8e0" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "class HttpControlChannel(ControlChannel):\n def __init__(self, host: str, port: int, timeout: int) -> None:\n self._timeout = timeout\n self._runner = UvicornThreadRunner(host, port, timeout)\n self._factory = HttpControlAppFactory()\n self._actions: ControlActionSet | None = None\n\n async def start(self, actions: ControlActionSet) -> None:\n self._actions = actions\n app = self._factory.create(self._health_response, self._action_response)\n await self._runner.start(app)\n\n async def stop(self) -> None:\n await self._runner.stop()\n\n @property\n def port(self) -> int:\n return self._runner.port\n\n async def _health_response(self) -> dict[str, object]:\n if self._actions is None:\n return {\"status\": \"unhealthy\", \"detail\": \"control actions are not configured\"}\n return await asyncio.wait_for(self._actions.health(), timeout=float(self._timeout))\n\n async def _action_response(self, action: str, _client_source: str = \"unknown\") -> JSONResponse:\n if self._actions is None:\n return JSONResponse(content={\"status\": \"error\", \"detail\": f\"{action} handler is not configured\"}, status_code=404)\n callbacks = {\n \"start\": self._actions.start,\n \"stop\": self._actions.stop,\n \"status\": self._actions.status,\n }\n callback = callbacks.get(action)\n if callback is None:\n return JSONResponse(content={\"status\": \"error\", \"detail\": f\"unsupported action: {action}\"}, status_code=404)\n action_timeout = max(float(self._timeout), 10.0) if action in {\"start\", \"stop\"} else float(self._timeout)\n try:\n detail = await asyncio.wait_for(callback(), timeout=action_timeout)\n except asyncio.TimeoutError:\n return JSONResponse(\n content={\"status\": \"accepted\", \"detail\": f\"{action} operation is still in progress\"},\n status_code=202,\n )\n except Exception as exc:\n return JSONResponse(content={\"status\": \"error\", \"detail\": str(exc)}, status_code=500)\n return JSONResponse(content={\"status\": \"ok\", \"detail\": detail or f\"{action} action accepted\"}, status_code=200)", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/http_channel.py:HttpControlChannel", - "span_start": 12, - "span_end": 57, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.http_channel", - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ] - }, - "diagnostics": { - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C0_SOURCE_CHUNKS": "exact_path_fetch", - "C4_SEMANTIC_ROLES": "exact_path_fetch", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C3_ENTRYPOINTS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 8, - "C4_SEMANTIC_ROLES": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C3_ENTRYPOINTS": 6 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C4_SEMANTIC_ROLES": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "HttpControlChannel", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "HttpControlChannel", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C4_SEMANTIC_ROLES", - "query": "HttpControlChannel", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "HttpControlChannel", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - }, - { - "layer": "C3_ENTRYPOINTS", - "query": "HttpControlChannel", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 1, - "candidates_after_filter": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 6, - "candidates_after_filter": 6 - }, - { - "layer": "C3_ENTRYPOINTS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 3, - "candidates_after_filter": 3 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "HttpControlChannel", - "alternatives": [ - "HttpControlChannel" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C4_SEMANTIC_ROLES", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 6, - "fail_reason": null - }, - { - "layer": "C3_ENTRYPOINTS", - "status": "hit", - "hit_count": 3, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "symbol_resolution": 0, - "retrieval_total": 157, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 49, - "C0_SOURCE_CHUNKS": 20, - "C4_SEMANTIC_ROLES": 18, - "C2_DEPENDENCY_GRAPH": 55, - "C3_ENTRYPOINTS": 12 - }, - "merge_rank": 20 - } - } - }, - { - "step": "llm_answer", - "input": { - "query": "Объясни класс HttpControlChannel", - "rag_count": 12 - }, - "output": { - "llm_answer": "## Объяснение сущности `HttpControlChannel`\n\n### Назначение\nКласс `HttpControlChannel` является компонентом конвейера приложения, ответственным за управление состоянием через HTTP-запросы. Он участвует в обработке запросов к приложению, обеспечивает маршрутизацию и выполнение действий, связанных с управлением состояниями и конфигурацией системы.\n\n### Ключевые зависимости\n- **host**: строка, представляющая хост для сервера.\n- **port**: целое число, представляющее порт для сервера.\n- **timeout**: целое число, задающее таймаут выполнения операций.\n\n### Поток данных или вызовов\n1. **Инициализация (`__init__`)** \n - При создании экземпляра класса происходит инициализация полей `_timeout`, `_runner` и `_factory`. Поле `_runner` представляет собой объект типа `UvicornThreadRunner`, отвечающий за запуск веб-сервера на указанном хосте и порте. Поле `_factory` отвечает за создание экземпляра `HttpControlAppFactory`.\n \n2. **Запуск (`start`)** \n - Метод принимает параметр `actions`, содержащий набор действий управления. Далее создается экземпляр приложения `app` при помощи фабрики `_factory`, после чего приложение запускается методом `_runner.start()`.\n \n3. **Остановка (`stop`)** \n - Остановка работы серверного приложения выполняется вызовом метода `_runner.stop()`.\n \n4. **Получение порта (`port`)** \n - Возвращает номер порта, на котором запущен сервер.\n\n5. **Ответы на запросы о здоровье и действиях** \n - Для запроса о состоянии здоровья вызывается метод `_health_response`, возвращающий статус системы (\"здорово\" или \"нездорово\"). Если действия конфигурации отсутствуют, возвращается сообщение об ошибке.\n - Для ответа на запрос о выполнении конкретных действий вызывается метод `_action_response`, проверяющий наличие необходимых действий и возвращая соответствующий результат.\n\n### Важные детали реализации\n- Использование асинхронных методов позволяет эффективно обрабатывать запросы и выполнять длительные операции без блокировки основного потока исполнения.\n- Параметр `_actions` хранит коллекцию доступных действий управления системой, что делает компонент гибким и расширяемым.\n- Конкретная реализация поведения зависит от объекта `_factory`, создавая различное поведение в зависимости от потребностей приложения.\n\n### Косвенные признаки и осторожные выводы\n- Отсутствуют явные файлы или сущности, напрямую связанные с логикой работы класса `HttpControlChannel`. Однако информация из графа зависимостей указывает на его взаимодействие с объектом `UvicornThreadRunner` и фабрикой приложений.\n- Объявления методов и свойств показывают стандартную схему взаимодействия: получение и установка атрибутов, старт и остановка сервиса, обработка запросов.\n\n---\n\nТаким образом, `HttpControlChannel` — это важный элемент инфраструктуры, обеспечивающий управляемость и доступность приложения через HTTP-интерфейс." - }, - "diagnostics": { - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 795, - "evidence_rows": 12, - "evidence_chars": 3028 - }, - "evidence_summary": [ - { - "layer": "C1_SYMBOL_CATALOG", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "count": 6, - "unique_paths": 1 - }, - { - "layer": "C3_ENTRYPOINTS", - "count": 3, - "unique_paths": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 1, - "unique_paths": 1 - } - ], - "prompt_template_id": "intent_code_qa_explain_ru_v1", - "system_prompt_version": "v1" - }, - "timings_ms": { - "prompt_build": 0, - "llm_call": 4482 - } - } - } - ] - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_114413/full_chain_plba_code_retrieval_plba-fullchain-explain-http-control-channel.md b/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_114413/full_chain_plba_code_retrieval_plba-fullchain-explain-http-control-channel.md deleted file mode 100644 index ffa3f19..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_114413/full_chain_plba_code_retrieval_plba-fullchain-explain-http-control-channel.md +++ /dev/null @@ -1,34 +0,0 @@ -# plba-fullchain-explain-http-control-channel - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_retrieval.yaml -- runner: runtime -- mode: full_chain -- passed: True - -## Query -Объясни класс HttpControlChannel - -## Actual -{ - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 12, - "llm_answer": "## Объяснение сущности `HttpControlChannel`\n\n### Назначение\nКласс `HttpControlChannel` является компонентом конвейера приложения, ответственным за управление состоянием через HTTP-запросы. Он участвует в обработке запросов к приложению, обеспечивает маршрутизацию и выполнение действий, связанных с управлением состояниями и конфигурацией системы.\n\n### Ключевые зависимости\n- **host**: строка, представляющая хост для сервера.\n- **port**: целое число, представляющее порт для сервера.\n- **timeout**: целое число, задающее таймаут выполнения операций.\n\n### Поток данных или вызовов\n1. **Инициализация (`__init__`)** \n - При создании экземпляра класса происходит инициализация полей `_timeout`, `_runner` и `_factory`. Поле `_runner` представляет собой объект типа `UvicornThreadRunner`, отвечающий за запуск веб-сервера на указанном хосте и порте. Поле `_factory` отвечает за создание экземпляра `HttpControlAppFactory`.\n \n2. **Запуск (`start`)** \n - Метод принимает параметр `actions`, содержащий набор действий управления. Далее создается экземпляр приложения `app` при помощи фабрики `_factory`, после чего приложение запускается методом `_runner.start()`.\n \n3. **Остановка (`stop`)** \n - Остановка работы серверного приложения выполняется вызовом метода `_runner.stop()`.\n \n4. **Получение порта (`port`)** \n - Возвращает номер порта, на котором запущен сервер.\n\n5. **Ответы на запросы о здоровье и действиях** \n - Для запроса о состоянии здоровья вызывается метод `_health_response`, возвращающий статус системы (\"здорово\" или \"нездорово\"). Если действия конфигурации отсутствуют, возвращается сообщение об ошибке.\n - Для ответа на запрос о выполнении конкретных действий вызывается метод `_action_response`, проверяющий наличие необходимых действий и возвращая соответствующий результат.\n\n### Важные детали реализации\n- Использование асинхронных методов позволяет эффективно обрабатывать запросы и выполнять длительные операции без блокировки основного потока исполнения.\n- Параметр `_actions` хранит коллекцию доступных действий управления системой, что делает компонент гибким и расширяемым.\n- Конкретная реализация поведения зависит от объекта `_factory`, создавая различное поведение в зависимости от потребностей приложения.\n\n### Косвенные признаки и осторожные выводы\n- Отсутствуют явные файлы или сущности, напрямую связанные с логикой работы класса `HttpControlChannel`. Однако информация из графа зависимостей указывает на его взаимодействие с объектом `UvicornThreadRunner` и фабрикой приложений.\n- Объявления методов и свойств показывают стандартную схему взаимодействия: получение и установка атрибутов, старт и остановка сервиса, обработка запросов.\n\n---\n\nТаким образом, `HttpControlChannel` — это важный элемент инфраструктуры, обеспечивающий управляемость и доступность приложения через HTTP-интерфейс.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "HttpControlChannel" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] -} - -## Mismatches -- none \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_114413/full_chain_plba_code_retrieval_plba-fullchain-explain-runtime-manager.json b/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_114413/full_chain_plba_code_retrieval_plba-fullchain-explain-runtime-manager.json deleted file mode 100644 index b7a24d0..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_114413/full_chain_plba_code_retrieval_plba-fullchain-explain-runtime-manager.json +++ /dev/null @@ -1,2088 +0,0 @@ -{ - "case_id": "plba-fullchain-explain-runtime-manager", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_retrieval.yaml", - "runner": "runtime", - "mode": "full_chain", - "actual": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 12, - "llm_answer": "## Назначение класса `RuntimeManager`\nКласс `RuntimeManager` играет роль центрального менеджера для управления жизненным циклом различных компонентов приложения runtime. Он отвечает за координацию и интеграцию этих компонентов, а также управляет их состоянием через атрибуты экземпляра.\n\n## Ключевые зависимости\nКлючевыми компонентами, с которыми взаимодействует `RuntimeManager`, являются:\n- `ConfigurationManager`: управление конфигурацией приложения.\n- `ServiceContainer`: контейнер сервисов, используемых приложением.\n- `TraceService`: сервис отслеживания трассировок выполнения задач.\n- `HealthRegistry`: реестр текущего состояния здоровья системы.\n- `LogManager`: менеджер логирования событий.\n- `WorkerSupervisor`: супервизор рабочих процессов.\n- `ControlPlaneService`: служба управления планом контроля выполнения задач.\n\n## Поток данных или вызовов\nПри инициализации объекта `RuntimeManager` вызывается метод `__init__`. В этом методе происходит инициализация основных атрибутов экземпляра, таких как состояние жизненного цикла (`_state`), флаг регистрации модулей (`_core_registered`) и другие внутренние переменные.\n\n### Пример вызова конструктора:\n```python\nmanager = RuntimeManager(configuration=configuration, services=services, ...)\n```\n\nПосле создания объекта `RuntimeManager` он начинает управлять жизненными циклами своих внутренних компонентов, включая регистрацию и запуск соответствующих служб. Метод `_register_core_services()` регистрирует основные сервисы, необходимые для функционирования приложения.\n\n## Важные детали реализации\n- **Атрибуты экземпляра**:\n - `_state`: текущее состояние жизненного цикла приложения (например, IDLE, RUNNING).\n - `_core_registered`: флаг, указывающий, зарегистрированы ли основные модули.\n - `_workers_registered`: аналогично предыдущему, но относится к рабочим модулям.\n \n- **Методы управления состоянием**:\n - `start()`: инициирует выполнение всех зарегистрированных модулей.\n - `stop()`: останавливает работу приложения и освобождает ресурсы.\n\n- **Реализация взаимодействия с внешними сервисами**:\n Методы классов, от которых зависит `RuntimeManager`, такие как `ControlPlaneService`, используются для координации работы приложений и обеспечения бесперебойного выполнения задач.\n\n## Осторожные выводы\nНа основе предоставленного контекста сложно точно описать полный цикл выполнения задачи или взаимодействия конкретного метода класса `RuntimeManager` с другими компонентами приложения. Однако можно предположить, что реализация включает этапы инициализации, регистрации сервисов, запуска и остановки работы приложения, основанные на сигналах жизненного цикла и управлении рабочими процессами.\n\nДля более детального понимания необходимо проанализировать полные реализации методов и взаимодействие объектов внутри приложения runtime.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "RuntimeManager" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "passed": true, - "mismatches": [], - "details": { - "case_id": "plba-fullchain-explain-runtime-manager", - "text": "Объясни как работает класс RuntimeManager", - "mode": "full_chain", - "run_started_at": "2026-03-12T11:44:13", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Объясни как работает класс RuntimeManager", - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "RuntimeManager", - "alternatives": [ - "RuntimeManager" - ], - "confidence": 0.99 - }, - "rag_count": 12, - "rag_rows": [ - { - "path": "src/app_runtime/core/runtime.py", - "content": "class RuntimeManager\nRuntimeManager", - "layer": "C1_SYMBOL_CATALOG", - "title": "RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "7e4a9381328c5803bbc6179458612fc4e947d928aa7bf8b4b2bebb2c8592f758", - "qname": "RuntimeManager", - "kind": "class", - "signature": "RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.core.runtime", - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests manager\n- orchestrates role-like calls (4)\n- reads and writes state attributes\n- participates in dataflow slices (50)", - "layer": "C4_SEMANTIC_ROLES", - "title": "RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 43, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "7e4a9381328c5803bbc6179458612fc4e947d928aa7bf8b4b2bebb2c8592f758", - "symbol_name": "RuntimeManager", - "qname": "RuntimeManager", - "role": "pipeline_stage", - "confidence": 0.67, - "dataflow_participation": 50, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.stop", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 25, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d", - "dst_ref": "ControlPlaneService.stop", - "resolution": "resolved", - "slice_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.stop" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._stop_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 51, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a", - "dst_ref": "ControlPlaneService._stop_async", - "resolution": "resolved", - "slice_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._stop_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.register_channel", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 17, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957", - "dst_ref": "ControlPlaneService.register_channel", - "resolution": "resolved", - "slice_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.register_channel" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.start", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 20, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154", - "dst_ref": "ControlPlaneService.start", - "resolution": "resolved", - "slice_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.start" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._start_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 47, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517", - "dst_ref": "ControlPlaneService._start_async", - "resolution": "resolved", - "slice_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._start_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager.add_config_file", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 32, - "span_end": 52, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "a23b8a11ebdb12708b60c96ea12a69f7f042082f1adfddd572444e246d81d167", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "57ffbd4f0d9fdf3507c2b8624312ce211f3d02fdf86a57a8ec90778d8a7b498d", - "dst_ref": "RuntimeManager.add_config_file", - "resolution": "resolved", - "slice_id": "a23b8a11ebdb12708b60c96ea12a69f7f042082f1adfddd572444e246d81d167", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager.add_config_file" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "57ffbd4f0d9fdf3507c2b8624312ce211f3d02fdf86a57a8ec90778d8a7b498d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "class RuntimeManager:\n ACTION_TIMEOUT_SECONDS = 10.0\n ACTION_POLL_INTERVAL_SECONDS = 0.05\n\n def __init__(\n self,\n configuration: ConfigurationManager | None = None,\n services: ServiceContainer | None = None,\n traces: TraceService | None = None,\n health: HealthRegistry | None = None,\n logs: LogManager | None = None,\n workers: WorkerSupervisor | None = None,\n control_plane: ControlPlaneService | None = None,\n ) -> None:\n self.configuration = configuration or ConfigurationManager()\n self.services = services or ServiceContainer()\n self.traces = traces or TraceService()\n self.health = health or HealthRegistry()\n self.logs = logs or LogManager()\n self.workers = workers or WorkerSupervisor()\n self.control_plane = control_plane or ControlPlaneService()\n self.registry = ModuleRegistry(self.services)\n self._started = False\n self._state = LifecycleState.IDLE\n self._core_registered = False\n self._workers_registered = False\n self._register_core_services()\n\n def register_module(self, module: ApplicationModule) -> None:\n self.registry.register_module(module.name)\n module.register(self.registry)\n\n def add_config_file(self, path: str) -> FileConfigProvider:\n provider = FileConfigProvider(path)\n self.configuration.add_provider(provider)\n return provider\n\n def start(self, *, start_control_plane: bool = True) -> None:\n if self._started:\n return\n self._state = LifecycleState.STARTING\n config = self.configuration.load()\n self.logs.apply_config(config)\n self._register_health_contributors()\n self._register_workers()\n self.workers.start()\n if start_control_plane:\n self.control_plane.start(self)\n self._started = True\n self._refresh_state()\n\n def stop(self, timeout: float = 30.0, force: bool = False, stop_control_plane: bool = True) -> None:\n if not self._started:\n return\n self._state = LifecycleState.STOPPING\n self.workers.stop(timeout=timeout, force=force)\n if stop_control_plane:\n self.control_plane.stop()\n self._started = False\n self._state = LifecycleState.STOPPED\n\n def status(self) -> dict[str, object]:\n self._refresh_state()\n return self.control_plane.snapshot(self)\n\n def current_health(self) -> HealthPayload:\n self._refresh_state()\n return self.health.payload(self._state, self.workers.healths())\n\n async def health_status(self) -> HealthPayload:\n return self.current_health()\n\n async def start_runtime(self) -> dict[str, object] | str:\n self._refresh_state()\n if self._started:\n return \"runtime already running\"\n if self._state == LifecycleState.STOPPING:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n\n self.start(start_control_plane=False)\n started = self._wait_for_state({LifecycleState.IDLE, LifecycleState.BUSY}, timeout=self.ACTION_TIMEOUT_SECONDS)\n if started:\n return self._action_detail(\"runtime started\", timed_out=False)\n return self._action_detail(\"runtime start is still in progress\", timed_out=True)\n\n async def stop_runtime(self) -> dict[str, object] | str:\n self._refresh_state()\n if not self._started:\n if self._state == LifecycleState.STOPPING:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n return \"runtime already stopped\"\n\n self._state = LifecycleState.STOPPING\n try:\n self.workers.stop(timeout=self.ACTION_TIMEOUT_SECONDS, force=False)\n except TimeoutError:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n\n self._started = False\n self._state = LifecycleState.STOPPED\n return self._action_detail(\"runtime stopped\", timed_out=False)\n\n async def runtime_status(self) -> str:\n self._refresh_state()\n return self._state.value\n\n def _register_core_services(self) -> None:\n if self._core_registered:\n return\n self.services.register(\"configuration\", self.configuration)\n self.services.register(\"traces\", self.traces)\n self.services.register(\"health\", self.health)\n self.services.register(\"logs\", self.logs)\n self.services.register(\"workers\", self.workers)\n self.services.register(\"control_plane\", self.control_plane)\n self._core_registered = True\n\n def _register_health_contributors(self) -> None:\n for contributor in self.registry.health_contributors:\n self.health.register(contributor)\n\n def _register_workers(self) -> None:\n if self._workers_registered:\n return\n for worker in self.registry.workers:\n self.workers.register(worker)\n self._workers_registered = True\n\n def _refresh_state(self) -> None:\n lifecycle = self.workers.lifecycle_state()\n\n if self._state == LifecycleState.STOPPING:\n if lifecycle == LifecycleState.STOPPED:\n self._started = False\n self._state = LifecycleState.STOPPED\n return\n\n if not self._started:\n if lifecycle == LifecycleState.STOPPED:\n self._state = LifecycleState.STOPPED\n return\n\n self._state = lifecycle\n\n def _wait_for_state(self, target_states: set[LifecycleState], *, timeout: float) -> bool:\n deadline = monotonic() + timeout\n while monotonic() < deadline:\n self._refresh_state()\n if self._state in target_states:\n return True\n sleep(self.ACTION_POLL_INTERVAL_SECONDS)\n self._refresh_state()\n return self._state in target_states\n\n def _action_detail(self, message: str, *, timed_out: bool) -> dict[str, object]:\n self._refresh_state()\n return {\n \"message\": message,\n \"state\": self._state.value,\n \"timed_out\": timed_out,\n \"workers\": self.workers.snapshot(),\n }", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/core/runtime.py:RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.core.runtime", - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "llm_answer": "## Назначение класса `RuntimeManager`\nКласс `RuntimeManager` играет роль центрального менеджера для управления жизненным циклом различных компонентов приложения runtime. Он отвечает за координацию и интеграцию этих компонентов, а также управляет их состоянием через атрибуты экземпляра.\n\n## Ключевые зависимости\nКлючевыми компонентами, с которыми взаимодействует `RuntimeManager`, являются:\n- `ConfigurationManager`: управление конфигурацией приложения.\n- `ServiceContainer`: контейнер сервисов, используемых приложением.\n- `TraceService`: сервис отслеживания трассировок выполнения задач.\n- `HealthRegistry`: реестр текущего состояния здоровья системы.\n- `LogManager`: менеджер логирования событий.\n- `WorkerSupervisor`: супервизор рабочих процессов.\n- `ControlPlaneService`: служба управления планом контроля выполнения задач.\n\n## Поток данных или вызовов\nПри инициализации объекта `RuntimeManager` вызывается метод `__init__`. В этом методе происходит инициализация основных атрибутов экземпляра, таких как состояние жизненного цикла (`_state`), флаг регистрации модулей (`_core_registered`) и другие внутренние переменные.\n\n### Пример вызова конструктора:\n```python\nmanager = RuntimeManager(configuration=configuration, services=services, ...)\n```\n\nПосле создания объекта `RuntimeManager` он начинает управлять жизненными циклами своих внутренних компонентов, включая регистрацию и запуск соответствующих служб. Метод `_register_core_services()` регистрирует основные сервисы, необходимые для функционирования приложения.\n\n## Важные детали реализации\n- **Атрибуты экземпляра**:\n - `_state`: текущее состояние жизненного цикла приложения (например, IDLE, RUNNING).\n - `_core_registered`: флаг, указывающий, зарегистрированы ли основные модули.\n - `_workers_registered`: аналогично предыдущему, но относится к рабочим модулям.\n \n- **Методы управления состоянием**:\n - `start()`: инициирует выполнение всех зарегистрированных модулей.\n - `stop()`: останавливает работу приложения и освобождает ресурсы.\n\n- **Реализация взаимодействия с внешними сервисами**:\n Методы классов, от которых зависит `RuntimeManager`, такие как `ControlPlaneService`, используются для координации работы приложений и обеспечения бесперебойного выполнения задач.\n\n## Осторожные выводы\nНа основе предоставленного контекста сложно точно описать полный цикл выполнения задачи или взаимодействия конкретного метода класса `RuntimeManager` с другими компонентами приложения. Однако можно предположить, что реализация включает этапы инициализации, регистрации сервисов, запуска и остановки работы приложения, основанные на сигналах жизненного цикла и управлении рабочими процессами.\n\nДля более детального понимания необходимо проанализировать полные реализации методов и взаимодействие объектов внутри приложения runtime.", - "summary": { - "router": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "confidence": null - }, - "retrieval": { - "profile": "code", - "layers_hit": [ - "C0_SOURCE_CHUNKS", - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS", - "C4_SEMANTIC_ROLES" - ], - "evidence_sufficient": true - }, - "llm": { - "answer_status": "answered", - "groundedness": "grounded" - } - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "RuntimeManager" - ], - "keyword_hints": [ - "RuntimeManager" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C0_SOURCE_CHUNKS": "exact_path_fetch", - "C4_SEMANTIC_ROLES": "exact_path_fetch", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C3_ENTRYPOINTS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 8, - "C4_SEMANTIC_ROLES": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C3_ENTRYPOINTS": 6 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C4_SEMANTIC_ROLES": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C4_SEMANTIC_ROLES", - "query": "RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - }, - { - "layer": "C3_ENTRYPOINTS", - "query": "RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 1, - "candidates_after_filter": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 6, - "candidates_after_filter": 6 - }, - { - "layer": "C3_ENTRYPOINTS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 3, - "candidates_after_filter": 3 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "RuntimeManager", - "alternatives": [ - "RuntimeManager" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C4_SEMANTIC_ROLES", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 6, - "fail_reason": null - }, - { - "layer": "C3_ENTRYPOINTS", - "status": "hit", - "hit_count": 3, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "router": 0, - "symbol_resolution": 0, - "retrieval_total": 255, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 25, - "C0_SOURCE_CHUNKS": 16, - "C4_SEMANTIC_ROLES": 12, - "C2_DEPENDENCY_GRAPH": 58, - "C3_ENTRYPOINTS": 9 - }, - "merge_rank": 17, - "prompt_build": 0, - "llm_call": 3800 - }, - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 797, - "evidence_rows": 12, - "evidence_chars": 7130 - }, - "evidence_summary": [ - { - "layer": "C1_SYMBOL_CATALOG", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "count": 6, - "unique_paths": 2 - }, - { - "layer": "C3_ENTRYPOINTS", - "count": 3, - "unique_paths": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 1, - "unique_paths": 1 - } - ], - "prompt_template_id": "intent_code_qa_explain_ru_v1", - "system_prompt_version": "v1" - }, - "router": { - "conversation_mode": "START", - "keyword_hints": [ - "RuntimeManager" - ], - "path_scope": [] - }, - "llm": { - "used_evidence_count": 12, - "missing_evidence_reason": null - } - }, - "run_info": { - "case_id": "plba-fullchain-explain-runtime-manager", - "mode": "full_chain", - "run_started_at": "2026-03-12T11:44:13", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - }, - "input_request": { - "text": "Объясни как работает класс RuntimeManager", - "normalized_query": "Объясни как работает класс RuntimeManager" - }, - "steps": [ - { - "step": "intent_router", - "input": { - "query": "Объясни как работает класс RuntimeManager" - }, - "output": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Объясни как работает класс RuntimeManager" - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "RuntimeManager" - ], - "keyword_hints": [ - "RuntimeManager" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "timings_ms": { - "router": 0 - } - } - }, - { - "step": "retrieval", - "input": { - "query": "Объясни как работает класс RuntimeManager" - }, - "output": { - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "RuntimeManager", - "alternatives": [ - "RuntimeManager" - ], - "confidence": 0.99 - }, - "rag_count": 12, - "rag_rows": [ - { - "path": "src/app_runtime/core/runtime.py", - "content": "class RuntimeManager\nRuntimeManager", - "layer": "C1_SYMBOL_CATALOG", - "title": "RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "7e4a9381328c5803bbc6179458612fc4e947d928aa7bf8b4b2bebb2c8592f758", - "qname": "RuntimeManager", - "kind": "class", - "signature": "RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.core.runtime", - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests manager\n- orchestrates role-like calls (4)\n- reads and writes state attributes\n- participates in dataflow slices (50)", - "layer": "C4_SEMANTIC_ROLES", - "title": "RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 43, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "7e4a9381328c5803bbc6179458612fc4e947d928aa7bf8b4b2bebb2c8592f758", - "symbol_name": "RuntimeManager", - "qname": "RuntimeManager", - "role": "pipeline_stage", - "confidence": 0.67, - "dataflow_participation": 50, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.stop", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 25, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d", - "dst_ref": "ControlPlaneService.stop", - "resolution": "resolved", - "slice_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.stop" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._stop_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 51, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a", - "dst_ref": "ControlPlaneService._stop_async", - "resolution": "resolved", - "slice_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._stop_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.register_channel", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 17, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957", - "dst_ref": "ControlPlaneService.register_channel", - "resolution": "resolved", - "slice_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.register_channel" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.start", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 20, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154", - "dst_ref": "ControlPlaneService.start", - "resolution": "resolved", - "slice_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.start" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._start_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 47, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517", - "dst_ref": "ControlPlaneService._start_async", - "resolution": "resolved", - "slice_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._start_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager.add_config_file", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 32, - "span_end": 52, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "a23b8a11ebdb12708b60c96ea12a69f7f042082f1adfddd572444e246d81d167", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "57ffbd4f0d9fdf3507c2b8624312ce211f3d02fdf86a57a8ec90778d8a7b498d", - "dst_ref": "RuntimeManager.add_config_file", - "resolution": "resolved", - "slice_id": "a23b8a11ebdb12708b60c96ea12a69f7f042082f1adfddd572444e246d81d167", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager.add_config_file" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "57ffbd4f0d9fdf3507c2b8624312ce211f3d02fdf86a57a8ec90778d8a7b498d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "class RuntimeManager:\n ACTION_TIMEOUT_SECONDS = 10.0\n ACTION_POLL_INTERVAL_SECONDS = 0.05\n\n def __init__(\n self,\n configuration: ConfigurationManager | None = None,\n services: ServiceContainer | None = None,\n traces: TraceService | None = None,\n health: HealthRegistry | None = None,\n logs: LogManager | None = None,\n workers: WorkerSupervisor | None = None,\n control_plane: ControlPlaneService | None = None,\n ) -> None:\n self.configuration = configuration or ConfigurationManager()\n self.services = services or ServiceContainer()\n self.traces = traces or TraceService()\n self.health = health or HealthRegistry()\n self.logs = logs or LogManager()\n self.workers = workers or WorkerSupervisor()\n self.control_plane = control_plane or ControlPlaneService()\n self.registry = ModuleRegistry(self.services)\n self._started = False\n self._state = LifecycleState.IDLE\n self._core_registered = False\n self._workers_registered = False\n self._register_core_services()\n\n def register_module(self, module: ApplicationModule) -> None:\n self.registry.register_module(module.name)\n module.register(self.registry)\n\n def add_config_file(self, path: str) -> FileConfigProvider:\n provider = FileConfigProvider(path)\n self.configuration.add_provider(provider)\n return provider\n\n def start(self, *, start_control_plane: bool = True) -> None:\n if self._started:\n return\n self._state = LifecycleState.STARTING\n config = self.configuration.load()\n self.logs.apply_config(config)\n self._register_health_contributors()\n self._register_workers()\n self.workers.start()\n if start_control_plane:\n self.control_plane.start(self)\n self._started = True\n self._refresh_state()\n\n def stop(self, timeout: float = 30.0, force: bool = False, stop_control_plane: bool = True) -> None:\n if not self._started:\n return\n self._state = LifecycleState.STOPPING\n self.workers.stop(timeout=timeout, force=force)\n if stop_control_plane:\n self.control_plane.stop()\n self._started = False\n self._state = LifecycleState.STOPPED\n\n def status(self) -> dict[str, object]:\n self._refresh_state()\n return self.control_plane.snapshot(self)\n\n def current_health(self) -> HealthPayload:\n self._refresh_state()\n return self.health.payload(self._state, self.workers.healths())\n\n async def health_status(self) -> HealthPayload:\n return self.current_health()\n\n async def start_runtime(self) -> dict[str, object] | str:\n self._refresh_state()\n if self._started:\n return \"runtime already running\"\n if self._state == LifecycleState.STOPPING:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n\n self.start(start_control_plane=False)\n started = self._wait_for_state({LifecycleState.IDLE, LifecycleState.BUSY}, timeout=self.ACTION_TIMEOUT_SECONDS)\n if started:\n return self._action_detail(\"runtime started\", timed_out=False)\n return self._action_detail(\"runtime start is still in progress\", timed_out=True)\n\n async def stop_runtime(self) -> dict[str, object] | str:\n self._refresh_state()\n if not self._started:\n if self._state == LifecycleState.STOPPING:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n return \"runtime already stopped\"\n\n self._state = LifecycleState.STOPPING\n try:\n self.workers.stop(timeout=self.ACTION_TIMEOUT_SECONDS, force=False)\n except TimeoutError:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n\n self._started = False\n self._state = LifecycleState.STOPPED\n return self._action_detail(\"runtime stopped\", timed_out=False)\n\n async def runtime_status(self) -> str:\n self._refresh_state()\n return self._state.value\n\n def _register_core_services(self) -> None:\n if self._core_registered:\n return\n self.services.register(\"configuration\", self.configuration)\n self.services.register(\"traces\", self.traces)\n self.services.register(\"health\", self.health)\n self.services.register(\"logs\", self.logs)\n self.services.register(\"workers\", self.workers)\n self.services.register(\"control_plane\", self.control_plane)\n self._core_registered = True\n\n def _register_health_contributors(self) -> None:\n for contributor in self.registry.health_contributors:\n self.health.register(contributor)\n\n def _register_workers(self) -> None:\n if self._workers_registered:\n return\n for worker in self.registry.workers:\n self.workers.register(worker)\n self._workers_registered = True\n\n def _refresh_state(self) -> None:\n lifecycle = self.workers.lifecycle_state()\n\n if self._state == LifecycleState.STOPPING:\n if lifecycle == LifecycleState.STOPPED:\n self._started = False\n self._state = LifecycleState.STOPPED\n return\n\n if not self._started:\n if lifecycle == LifecycleState.STOPPED:\n self._state = LifecycleState.STOPPED\n return\n\n self._state = lifecycle\n\n def _wait_for_state(self, target_states: set[LifecycleState], *, timeout: float) -> bool:\n deadline = monotonic() + timeout\n while monotonic() < deadline:\n self._refresh_state()\n if self._state in target_states:\n return True\n sleep(self.ACTION_POLL_INTERVAL_SECONDS)\n self._refresh_state()\n return self._state in target_states\n\n def _action_detail(self, message: str, *, timed_out: bool) -> dict[str, object]:\n self._refresh_state()\n return {\n \"message\": message,\n \"state\": self._state.value,\n \"timed_out\": timed_out,\n \"workers\": self.workers.snapshot(),\n }", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/core/runtime.py:RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.core.runtime", - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ] - }, - "diagnostics": { - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C0_SOURCE_CHUNKS": "exact_path_fetch", - "C4_SEMANTIC_ROLES": "exact_path_fetch", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C3_ENTRYPOINTS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 8, - "C4_SEMANTIC_ROLES": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C3_ENTRYPOINTS": 6 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C4_SEMANTIC_ROLES": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C4_SEMANTIC_ROLES", - "query": "RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - }, - { - "layer": "C3_ENTRYPOINTS", - "query": "RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 1, - "candidates_after_filter": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 6, - "candidates_after_filter": 6 - }, - { - "layer": "C3_ENTRYPOINTS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 3, - "candidates_after_filter": 3 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "RuntimeManager", - "alternatives": [ - "RuntimeManager" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C4_SEMANTIC_ROLES", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 6, - "fail_reason": null - }, - { - "layer": "C3_ENTRYPOINTS", - "status": "hit", - "hit_count": 3, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "symbol_resolution": 0, - "retrieval_total": 255, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 25, - "C0_SOURCE_CHUNKS": 16, - "C4_SEMANTIC_ROLES": 12, - "C2_DEPENDENCY_GRAPH": 58, - "C3_ENTRYPOINTS": 9 - }, - "merge_rank": 17 - } - } - }, - { - "step": "llm_answer", - "input": { - "query": "Объясни как работает класс RuntimeManager", - "rag_count": 12 - }, - "output": { - "llm_answer": "## Назначение класса `RuntimeManager`\nКласс `RuntimeManager` играет роль центрального менеджера для управления жизненным циклом различных компонентов приложения runtime. Он отвечает за координацию и интеграцию этих компонентов, а также управляет их состоянием через атрибуты экземпляра.\n\n## Ключевые зависимости\nКлючевыми компонентами, с которыми взаимодействует `RuntimeManager`, являются:\n- `ConfigurationManager`: управление конфигурацией приложения.\n- `ServiceContainer`: контейнер сервисов, используемых приложением.\n- `TraceService`: сервис отслеживания трассировок выполнения задач.\n- `HealthRegistry`: реестр текущего состояния здоровья системы.\n- `LogManager`: менеджер логирования событий.\n- `WorkerSupervisor`: супервизор рабочих процессов.\n- `ControlPlaneService`: служба управления планом контроля выполнения задач.\n\n## Поток данных или вызовов\nПри инициализации объекта `RuntimeManager` вызывается метод `__init__`. В этом методе происходит инициализация основных атрибутов экземпляра, таких как состояние жизненного цикла (`_state`), флаг регистрации модулей (`_core_registered`) и другие внутренние переменные.\n\n### Пример вызова конструктора:\n```python\nmanager = RuntimeManager(configuration=configuration, services=services, ...)\n```\n\nПосле создания объекта `RuntimeManager` он начинает управлять жизненными циклами своих внутренних компонентов, включая регистрацию и запуск соответствующих служб. Метод `_register_core_services()` регистрирует основные сервисы, необходимые для функционирования приложения.\n\n## Важные детали реализации\n- **Атрибуты экземпляра**:\n - `_state`: текущее состояние жизненного цикла приложения (например, IDLE, RUNNING).\n - `_core_registered`: флаг, указывающий, зарегистрированы ли основные модули.\n - `_workers_registered`: аналогично предыдущему, но относится к рабочим модулям.\n \n- **Методы управления состоянием**:\n - `start()`: инициирует выполнение всех зарегистрированных модулей.\n - `stop()`: останавливает работу приложения и освобождает ресурсы.\n\n- **Реализация взаимодействия с внешними сервисами**:\n Методы классов, от которых зависит `RuntimeManager`, такие как `ControlPlaneService`, используются для координации работы приложений и обеспечения бесперебойного выполнения задач.\n\n## Осторожные выводы\nНа основе предоставленного контекста сложно точно описать полный цикл выполнения задачи или взаимодействия конкретного метода класса `RuntimeManager` с другими компонентами приложения. Однако можно предположить, что реализация включает этапы инициализации, регистрации сервисов, запуска и остановки работы приложения, основанные на сигналах жизненного цикла и управлении рабочими процессами.\n\nДля более детального понимания необходимо проанализировать полные реализации методов и взаимодействие объектов внутри приложения runtime." - }, - "diagnostics": { - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 797, - "evidence_rows": 12, - "evidence_chars": 7130 - }, - "evidence_summary": [ - { - "layer": "C1_SYMBOL_CATALOG", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "count": 6, - "unique_paths": 2 - }, - { - "layer": "C3_ENTRYPOINTS", - "count": 3, - "unique_paths": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 1, - "unique_paths": 1 - } - ], - "prompt_template_id": "intent_code_qa_explain_ru_v1", - "system_prompt_version": "v1" - }, - "timings_ms": { - "prompt_build": 0, - "llm_call": 3800 - } - } - } - ] - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_114413/full_chain_plba_code_retrieval_plba-fullchain-explain-runtime-manager.md b/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_114413/full_chain_plba_code_retrieval_plba-fullchain-explain-runtime-manager.md deleted file mode 100644 index 547284f..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_114413/full_chain_plba_code_retrieval_plba-fullchain-explain-runtime-manager.md +++ /dev/null @@ -1,34 +0,0 @@ -# plba-fullchain-explain-runtime-manager - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_retrieval.yaml -- runner: runtime -- mode: full_chain -- passed: True - -## Query -Объясни как работает класс RuntimeManager - -## Actual -{ - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 12, - "llm_answer": "## Назначение класса `RuntimeManager`\nКласс `RuntimeManager` играет роль центрального менеджера для управления жизненным циклом различных компонентов приложения runtime. Он отвечает за координацию и интеграцию этих компонентов, а также управляет их состоянием через атрибуты экземпляра.\n\n## Ключевые зависимости\nКлючевыми компонентами, с которыми взаимодействует `RuntimeManager`, являются:\n- `ConfigurationManager`: управление конфигурацией приложения.\n- `ServiceContainer`: контейнер сервисов, используемых приложением.\n- `TraceService`: сервис отслеживания трассировок выполнения задач.\n- `HealthRegistry`: реестр текущего состояния здоровья системы.\n- `LogManager`: менеджер логирования событий.\n- `WorkerSupervisor`: супервизор рабочих процессов.\n- `ControlPlaneService`: служба управления планом контроля выполнения задач.\n\n## Поток данных или вызовов\nПри инициализации объекта `RuntimeManager` вызывается метод `__init__`. В этом методе происходит инициализация основных атрибутов экземпляра, таких как состояние жизненного цикла (`_state`), флаг регистрации модулей (`_core_registered`) и другие внутренние переменные.\n\n### Пример вызова конструктора:\n```python\nmanager = RuntimeManager(configuration=configuration, services=services, ...)\n```\n\nПосле создания объекта `RuntimeManager` он начинает управлять жизненными циклами своих внутренних компонентов, включая регистрацию и запуск соответствующих служб. Метод `_register_core_services()` регистрирует основные сервисы, необходимые для функционирования приложения.\n\n## Важные детали реализации\n- **Атрибуты экземпляра**:\n - `_state`: текущее состояние жизненного цикла приложения (например, IDLE, RUNNING).\n - `_core_registered`: флаг, указывающий, зарегистрированы ли основные модули.\n - `_workers_registered`: аналогично предыдущему, но относится к рабочим модулям.\n \n- **Методы управления состоянием**:\n - `start()`: инициирует выполнение всех зарегистрированных модулей.\n - `stop()`: останавливает работу приложения и освобождает ресурсы.\n\n- **Реализация взаимодействия с внешними сервисами**:\n Методы классов, от которых зависит `RuntimeManager`, такие как `ControlPlaneService`, используются для координации работы приложений и обеспечения бесперебойного выполнения задач.\n\n## Осторожные выводы\nНа основе предоставленного контекста сложно точно описать полный цикл выполнения задачи или взаимодействия конкретного метода класса `RuntimeManager` с другими компонентами приложения. Однако можно предположить, что реализация включает этапы инициализации, регистрации сервисов, запуска и остановки работы приложения, основанные на сигналах жизненного цикла и управлении рабочими процессами.\n\nДля более детального понимания необходимо проанализировать полные реализации методов и взаимодействие объектов внутри приложения runtime.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "RuntimeManager" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] -} - -## Mismatches -- none \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_114413/full_chain_plba_code_retrieval_plba-fullchain-explain-trace-service.json b/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_114413/full_chain_plba_code_retrieval_plba-fullchain-explain-trace-service.json deleted file mode 100644 index 3c4f904..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_114413/full_chain_plba_code_retrieval_plba-fullchain-explain-trace-service.json +++ /dev/null @@ -1,2208 +0,0 @@ -{ - "case_id": "plba-fullchain-explain-trace-service", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_retrieval.yaml", - "runner": "runtime", - "mode": "full_chain", - "actual": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 14, - "llm_answer": "## Объяснение работы `TraceService`\n\n### Назначение\n`TraceService` — это компонент, отвечающий за управление контекстом трассировки и запись логических событий во время выполнения приложения. Он служит для создания, хранения и записи трассировочных записей (`trace records`) и сообщений логирования (`log messages`), связанных с выполнением различных операций.\n\n### Ключевые зависимости\n- **TraceContextFactory**: Базовый класс, от которого наследуется `TraceService`. Предоставляет методы для управления контекстом трассировки.\n- **TraceTransport**: Интерфейс, определяющий транспорт для передачи трассировочной информации внешним системам или службам.\n- **TraceContextStore**: Хранит контексты трассировок.\n- **NoOpTraceTransport**: Специальная реализация транспорта без реальных действий, используется по умолчанию при отсутствии указания конкретного транспорта.\n\n### Поток данных или вызовов\n1. При инициализации класса `TraceService` происходит создание экземпляра `TraceRecordWriter`, который отвечает за отправку трассировочных записей через указанный транспорт.\n2. Основной метод `create_context` создаёт новый контекст трассировки с уникальным идентификатором (`trace_id`), атрибутами и временными метками, записывает его в хранилище и передаёт информацию в транспорт.\n3. Контекст трассировки можно открывать с помощью метода `open_context`, который автоматически вызывает `create_context`.\n4. После завершения операции можно записать сообщение логирования через метод `write_message`.\n5. В случае ошибок при передаче данных в транспорт вызывается метод `_logger.exception` для регистрации проблемы.\n\n### Важные детали реализации\n- **UUID для trace_id**: Используется UUID для уникального идентификатора каждой трассировки.\n- **Время события**: Каждое событие сопровождается временной меткой UTC.\n- **Запись сообщений**: Сообщения логирования могут быть записаны отдельно после завершения контекста трассировки.\n- **Логирование ошибок**: При ошибке отправки сообщения в транспорт регистрируется исключение и выводится соответствующее сообщение об ошибке.\n\n### Описание структуры файла\nФайл `src/app_runtime/tracing/service.py` содержит реализацию класса `TraceService`, а также классы `TraceRecordWriter` и другие вспомогательные компоненты.\n\n---\n\nЭтот обзор основан исключительно на предоставленных слоях анализа (C0-C4), поэтому некоторые выводы являются осторожными и требуют дополнительной проверки.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "TraceService" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "passed": true, - "mismatches": [], - "details": { - "case_id": "plba-fullchain-explain-trace-service", - "text": "Как работает TraceService?", - "mode": "full_chain", - "run_started_at": "2026-03-12T11:44:13", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Как работает TraceService?", - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "TraceService", - "alternatives": [ - "TraceService" - ], - "confidence": 0.99 - }, - "rag_count": 14, - "rag_rows": [ - { - "path": "src/app_runtime/tracing/service.py", - "content": "class TraceService\nTraceService(TraceContextFactory)", - "layer": "C1_SYMBOL_CATALOG", - "title": "TraceService", - "span_start": 39, - "span_end": 166, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "c2b2b976d99f2c600000b753731b26e0a69adcb4359398b93073590c5d5d04f4", - "qname": "TraceService", - "kind": "class", - "signature": "TraceService(TraceContextFactory)", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.tracing.service", - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "TraceService\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests service\n- reads and writes state attributes\n- participates in dataflow slices (13)", - "layer": "C4_SEMANTIC_ROLES", - "title": "TraceService", - "span_start": 39, - "span_end": 166, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 60, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "c2b2b976d99f2c600000b753731b26e0a69adcb4359398b93073590c5d5d04f4", - "symbol_name": "TraceService", - "qname": "TraceService", - "role": "pipeline_stage", - "confidence": 0.57, - "dataflow_participation": 13, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "TraceService.__init__\n -> TraceService.store\n -> TraceService.create_context", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "TraceService.__init__:dataflow_slice", - "span_start": 42, - "span_end": 61, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "3b052062067a78aef3302ee1d996897e02a67d1b340397bea4f59fe147c0492a", - "edge_type": "dataflow_slice", - "src_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "src_qname": "TraceService.__init__", - "dst_symbol_id": "ff44881104b65ef50ee6fe16d367d4a81b6e7eb5c44c0963cf4543faec785d4a", - "dst_ref": "TraceService.create_context", - "resolution": "resolved", - "slice_id": "3b052062067a78aef3302ee1d996897e02a67d1b340397bea4f59fe147c0492a", - "root_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "path_symbols": [ - "TraceService.__init__", - "TraceService.store", - "TraceService.create_context" - ], - "path_symbol_ids": [ - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "ff44881104b65ef50ee6fe16d367d4a81b6e7eb5c44c0963cf4543faec785d4a" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "TraceService.__init__\n -> TraceService.store\n -> TraceService.close_context", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "TraceService.__init__:dataflow_slice", - "span_start": 42, - "span_end": 84, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "7a9353ef57c9ae5d19b3a0c6ac50fad05e6d21d31bbe1cd1cd07af6332ba6505", - "edge_type": "dataflow_slice", - "src_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "src_qname": "TraceService.__init__", - "dst_symbol_id": "01e14158dcced7e52d0c8ac84ac7b9a75225c261b6aca6a1d7da802d0994721c", - "dst_ref": "TraceService.close_context", - "resolution": "resolved", - "slice_id": "7a9353ef57c9ae5d19b3a0c6ac50fad05e6d21d31bbe1cd1cd07af6332ba6505", - "root_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "path_symbols": [ - "TraceService.__init__", - "TraceService.store", - "TraceService.close_context" - ], - "path_symbol_ids": [ - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "01e14158dcced7e52d0c8ac84ac7b9a75225c261b6aca6a1d7da802d0994721c" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "TraceService.__init__\n -> TraceService.store\n -> TraceService.open_context", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "TraceService.__init__:dataflow_slice", - "span_start": 42, - "span_end": 78, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "a6e13b9ebc4fed84586afd53ed92a4d14757e440873f572b2337d5622ee96031", - "edge_type": "dataflow_slice", - "src_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "src_qname": "TraceService.__init__", - "dst_symbol_id": "2da3d5b20a947bf63e14c103be4689b72fd837e0a82abd6c497846375d4c7426", - "dst_ref": "TraceService.open_context", - "resolution": "resolved", - "slice_id": "a6e13b9ebc4fed84586afd53ed92a4d14757e440873f572b2337d5622ee96031", - "root_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "path_symbols": [ - "TraceService.__init__", - "TraceService.store", - "TraceService.open_context" - ], - "path_symbol_ids": [ - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "2da3d5b20a947bf63e14c103be4689b72fd837e0a82abd6c497846375d4c7426" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "TraceService.__init__\n -> TraceService.transport\n -> TraceService.__init__", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "TraceService.__init__:dataflow_slice", - "span_start": 41, - "span_end": 43, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "1e923a93faa05c3c43ca9b19bd047007a8589ccce57d3cc1798ae7f9f200af98", - "edge_type": "dataflow_slice", - "src_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "src_qname": "TraceService.__init__", - "dst_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "dst_ref": "TraceService.__init__", - "resolution": "resolved", - "slice_id": "1e923a93faa05c3c43ca9b19bd047007a8589ccce57d3cc1798ae7f9f200af98", - "root_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "path_symbols": [ - "TraceService.__init__", - "TraceService.transport", - "TraceService.__init__" - ], - "path_symbol_ids": [ - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "TraceService.__init__\n -> TraceService.store\n -> TraceService.current_trace_id", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "TraceService.__init__:dataflow_slice", - "span_start": 42, - "span_end": 81, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "3ea17138634b1190bded77ddb84aa1595124f6519b246f24fc4b02bd62b5cac1", - "edge_type": "dataflow_slice", - "src_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "src_qname": "TraceService.__init__", - "dst_symbol_id": "41135180f7b3b9ab20e097e0747474e219c37dd2366ef08a7b43c1f3edb10b4c", - "dst_ref": "TraceService.current_trace_id", - "resolution": "resolved", - "slice_id": "3ea17138634b1190bded77ddb84aa1595124f6519b246f24fc4b02bd62b5cac1", - "root_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "path_symbols": [ - "TraceService.__init__", - "TraceService.store", - "TraceService.current_trace_id" - ], - "path_symbol_ids": [ - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "41135180f7b3b9ab20e097e0747474e219c37dd2366ef08a7b43c1f3edb10b4c" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "TraceService.__init__\n -> TraceService.store\n -> TraceService.step", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "TraceService.__init__:dataflow_slice", - "span_start": 42, - "span_end": 88, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "9f34c5da9b09fba99df6f6b1bde183a9aeb45111b8218a747c71590c2c9f60f2", - "edge_type": "dataflow_slice", - "src_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "src_qname": "TraceService.__init__", - "dst_symbol_id": "c44bfbc66cf747283f30088da3e011a10395031d41e77b74e523c24997f641ca", - "dst_ref": "TraceService.step", - "resolution": "resolved", - "slice_id": "9f34c5da9b09fba99df6f6b1bde183a9aeb45111b8218a747c71590c2c9f60f2", - "root_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "path_symbols": [ - "TraceService.__init__", - "TraceService.store", - "TraceService.step" - ], - "path_symbol_ids": [ - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "c44bfbc66cf747283f30088da3e011a10395031d41e77b74e523c24997f641ca" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "class TraceRecordWriter:\n def __init__(self, transport: TraceTransport) -> None:\n self._logger = logging.getLogger(__name__)\n self._transport = transport\n\n def write_context(self, record: TraceContextRecord) -> None:\n try:\n self._transport.write_context(record)\n except Exception:\n self._logger.exception(\"Trace transport failed to write context %s\", record.trace_id)\n\n def write_message(self, record: TraceLogMessage) -> None:\n try:\n self._transport.write_message(record)\n except Exception:\n self._logger.exception(\"Trace transport failed to write message for %s\", record.trace_id)", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/tracing/service.py:TraceRecordWriter", - "span_start": 21, - "span_end": 36, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.tracing.service", - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "class TraceService(TraceContextFactory):\n def __init__(self, transport: TraceTransport | None = None, store: TraceContextStore | None = None) -> None:\n self.transport = transport or NoOpTraceTransport()\n self.store = store or TraceContextStore()\n self._writer = TraceRecordWriter(self.transport)\n\n def create_context(\n self,\n *,\n alias: str,\n parent_id: str | None = None,\n kind: str | None = None,\n attrs: dict[str, Any] | None = None,\n ) -> str:\n record = TraceContextRecord(\n trace_id=uuid4().hex,\n alias=str(alias or \"\"),\n parent_id=parent_id,\n type=kind,\n event_time=utc_now(),\n attrs=dict(attrs or {}),\n )\n self.store.push(record)\n self._writer.write_context(record)\n return record.trace_id\n\n @contextmanager\n def open_context(\n self,\n *,\n alias: str,\n parent_id: str | None = None,\n kind: str | None = None,\n attrs: dict[str, Any] | None = None,\n ) -> Iterator[str]:\n trace_id = self.create_context(alias=alias, parent_id=parent_id, kind=kind, attrs=attrs)\n try:\n yield trace_id\n finally:\n self.store.pop()\n\n def current_trace_id(self) -> str | None:\n return self.store.current_trace_id()\n\n def close_context(self) -> str | None:\n previous = self.store.pop()\n return previous.record.trace_id if previous else None\n\n def step(self, name: str) -> None:\n self.store.set_step(str(name or \"\"))\n\n def info(self, message: str, *, status: str | None = None, attrs: dict[str, Any] | None = None) -> None:\n self._write_message(\"INFO\", message, status, attrs)\n\n def debug(self, message: str, *, status: str | None = None, attrs: dict[str, Any] | None = None) -> None:\n self._write_message(\"DEBUG\", message, status, attrs)\n\n def warning(self, message: str, *, status: str | None = None, attrs: dict[str, Any] | None = None) -> None:\n self._write_message(\"WARNING\", message, status, attrs)\n\n def error(self, message: str, *, status: str | None = None, attrs: dict[str, Any] | None = None) -> None:\n self._write_message(\"ERROR\", message, status, attrs)\n\n def exception(self, message: str, *, status: str = \"failed\", attrs: dict[str, Any] | None = None) -> None:\n self._write_message(\"ERROR\", message, status, attrs)\n\n def new_root(self, operation: str) -> TraceContext:\n trace_id = self.create_context(alias=operation, kind=\"operation\", attrs={\"operation\": operation})\n return TraceContext(trace_id=trace_id, span_id=trace_id, attributes={\"operation\": operation})\n\n def child_of(self, parent: TraceContext, operation: str) -> TraceContext:\n trace_id = self.create_context(\n alias=operation,\n parent_id=parent.trace_id,\n kind=\"worker\",\n attrs={\"operation\": operation},\n )\n return TraceContext(\n trace_id=trace_id,\n span_id=trace_id,\n parent_span_id=parent.span_id,\n attributes={\"operation\": operation},\n )\n\n def attach(self, metadata: dict[str, object], context: TraceContext) -> dict[str, object]:\n updated = dict(metadata)\n updated[\"trace_id\"] = context.trace_id\n updated[\"span_id\"] = context.span_id\n updated[\"parent_span_id\"] = context.parent_span_id\n return updated\n\n def resume(self, metadata: dict[str, object], operation: str) -> TraceContext:\n trace_id = str(metadata.get(\"trace_id\") or uuid4().hex)\n span_id = str(metadata.get(\"span_id\") or trace_id)\n parent_id = metadata.get(\"parent_span_id\")\n self.create_context(\n alias=operation,\n parent_id=str(parent_id) if parent_id else None,\n kind=\"worker\",\n attrs=dict(metadata),\n )\n return TraceContext(\n trace_id=trace_id,\n span_id=span_id,\n parent_span_id=str(parent_id) if parent_id else None,\n attributes={\"operation\": operation},\n )\n\n def _write_message(\n self,\n level: TraceLevel,\n message: str,\n status: str | None,\n attrs: dict[str, Any] | None,\n ) -> None:\n active = self.store.current()\n if active is None:\n raise RuntimeError(\"Trace context is not bound. Call create_context() first.\")\n record = TraceLogMessage(\n trace_id=active.record.trace_id,\n step=active.step,\n status=str(status or \"\"),\n message=str(message or \"\"),\n level=level,\n event_time=utc_now(),\n attrs=dict(attrs or {}),\n )\n self._writer.write_message(record)", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/tracing/service.py:TraceService", - "span_start": 39, - "span_end": 166, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 1, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.tracing.service", - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "class TraceManager(TraceService):\n \"\"\"Compatibility alias during the transition from ConfigManager-shaped naming.\"\"\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/tracing/service.py:TraceManager", - "span_start": 169, - "span_end": 170, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 2, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.tracing.service", - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "llm_answer": "## Объяснение работы `TraceService`\n\n### Назначение\n`TraceService` — это компонент, отвечающий за управление контекстом трассировки и запись логических событий во время выполнения приложения. Он служит для создания, хранения и записи трассировочных записей (`trace records`) и сообщений логирования (`log messages`), связанных с выполнением различных операций.\n\n### Ключевые зависимости\n- **TraceContextFactory**: Базовый класс, от которого наследуется `TraceService`. Предоставляет методы для управления контекстом трассировки.\n- **TraceTransport**: Интерфейс, определяющий транспорт для передачи трассировочной информации внешним системам или службам.\n- **TraceContextStore**: Хранит контексты трассировок.\n- **NoOpTraceTransport**: Специальная реализация транспорта без реальных действий, используется по умолчанию при отсутствии указания конкретного транспорта.\n\n### Поток данных или вызовов\n1. При инициализации класса `TraceService` происходит создание экземпляра `TraceRecordWriter`, который отвечает за отправку трассировочных записей через указанный транспорт.\n2. Основной метод `create_context` создаёт новый контекст трассировки с уникальным идентификатором (`trace_id`), атрибутами и временными метками, записывает его в хранилище и передаёт информацию в транспорт.\n3. Контекст трассировки можно открывать с помощью метода `open_context`, который автоматически вызывает `create_context`.\n4. После завершения операции можно записать сообщение логирования через метод `write_message`.\n5. В случае ошибок при передаче данных в транспорт вызывается метод `_logger.exception` для регистрации проблемы.\n\n### Важные детали реализации\n- **UUID для trace_id**: Используется UUID для уникального идентификатора каждой трассировки.\n- **Время события**: Каждое событие сопровождается временной меткой UTC.\n- **Запись сообщений**: Сообщения логирования могут быть записаны отдельно после завершения контекста трассировки.\n- **Логирование ошибок**: При ошибке отправки сообщения в транспорт регистрируется исключение и выводится соответствующее сообщение об ошибке.\n\n### Описание структуры файла\nФайл `src/app_runtime/tracing/service.py` содержит реализацию класса `TraceService`, а также классы `TraceRecordWriter` и другие вспомогательные компоненты.\n\n---\n\nЭтот обзор основан исключительно на предоставленных слоях анализа (C0-C4), поэтому некоторые выводы являются осторожными и требуют дополнительной проверки.", - "summary": { - "router": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "confidence": null - }, - "retrieval": { - "profile": "code", - "layers_hit": [ - "C0_SOURCE_CHUNKS", - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS", - "C4_SEMANTIC_ROLES" - ], - "evidence_sufficient": true - }, - "llm": { - "answer_status": "answered", - "groundedness": "grounded" - } - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "TraceService" - ], - "keyword_hints": [ - "TraceService" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C0_SOURCE_CHUNKS": "exact_path_fetch", - "C4_SEMANTIC_ROLES": "exact_path_fetch", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C3_ENTRYPOINTS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 8, - "C4_SEMANTIC_ROLES": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C3_ENTRYPOINTS": 6 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C4_SEMANTIC_ROLES": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "TraceService", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "TraceService", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C4_SEMANTIC_ROLES", - "query": "TraceService", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "TraceService", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - }, - { - "layer": "C3_ENTRYPOINTS", - "query": "TraceService", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 1, - "candidates_after_filter": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 6, - "candidates_after_filter": 6 - }, - { - "layer": "C3_ENTRYPOINTS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 3, - "candidates_after_filter": 3 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "TraceService", - "alternatives": [ - "TraceService" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 3, - "fail_reason": null - }, - { - "layer": "C4_SEMANTIC_ROLES", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 6, - "fail_reason": null - }, - { - "layer": "C3_ENTRYPOINTS", - "status": "hit", - "hit_count": 3, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "router": 0, - "symbol_resolution": 0, - "retrieval_total": 141, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 44, - "C0_SOURCE_CHUNKS": 19, - "C4_SEMANTIC_ROLES": 17, - "C2_DEPENDENCY_GRAPH": 47, - "C3_ENTRYPOINTS": 11 - }, - "merge_rank": 20, - "prompt_build": 0, - "llm_call": 3391 - }, - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 931, - "evidence_rows": 14, - "evidence_chars": 6323 - }, - "evidence_summary": [ - { - "layer": "C1_SYMBOL_CATALOG", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "count": 6, - "unique_paths": 1 - }, - { - "layer": "C3_ENTRYPOINTS", - "count": 3, - "unique_paths": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 3, - "unique_paths": 1 - } - ], - "prompt_template_id": "intent_code_qa_explain_ru_v1", - "system_prompt_version": "v1" - }, - "router": { - "conversation_mode": "START", - "keyword_hints": [ - "TraceService" - ], - "path_scope": [] - }, - "llm": { - "used_evidence_count": 14, - "missing_evidence_reason": null - } - }, - "run_info": { - "case_id": "plba-fullchain-explain-trace-service", - "mode": "full_chain", - "run_started_at": "2026-03-12T11:44:13", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - }, - "input_request": { - "text": "Как работает TraceService?", - "normalized_query": "Как работает TraceService?" - }, - "steps": [ - { - "step": "intent_router", - "input": { - "query": "Как работает TraceService?" - }, - "output": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Как работает TraceService?" - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "TraceService" - ], - "keyword_hints": [ - "TraceService" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "timings_ms": { - "router": 0 - } - } - }, - { - "step": "retrieval", - "input": { - "query": "Как работает TraceService?" - }, - "output": { - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "TraceService", - "alternatives": [ - "TraceService" - ], - "confidence": 0.99 - }, - "rag_count": 14, - "rag_rows": [ - { - "path": "src/app_runtime/tracing/service.py", - "content": "class TraceService\nTraceService(TraceContextFactory)", - "layer": "C1_SYMBOL_CATALOG", - "title": "TraceService", - "span_start": 39, - "span_end": 166, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "c2b2b976d99f2c600000b753731b26e0a69adcb4359398b93073590c5d5d04f4", - "qname": "TraceService", - "kind": "class", - "signature": "TraceService(TraceContextFactory)", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.tracing.service", - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "TraceService\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests service\n- reads and writes state attributes\n- participates in dataflow slices (13)", - "layer": "C4_SEMANTIC_ROLES", - "title": "TraceService", - "span_start": 39, - "span_end": 166, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 60, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "c2b2b976d99f2c600000b753731b26e0a69adcb4359398b93073590c5d5d04f4", - "symbol_name": "TraceService", - "qname": "TraceService", - "role": "pipeline_stage", - "confidence": 0.57, - "dataflow_participation": 13, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "TraceService.__init__\n -> TraceService.store\n -> TraceService.create_context", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "TraceService.__init__:dataflow_slice", - "span_start": 42, - "span_end": 61, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "3b052062067a78aef3302ee1d996897e02a67d1b340397bea4f59fe147c0492a", - "edge_type": "dataflow_slice", - "src_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "src_qname": "TraceService.__init__", - "dst_symbol_id": "ff44881104b65ef50ee6fe16d367d4a81b6e7eb5c44c0963cf4543faec785d4a", - "dst_ref": "TraceService.create_context", - "resolution": "resolved", - "slice_id": "3b052062067a78aef3302ee1d996897e02a67d1b340397bea4f59fe147c0492a", - "root_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "path_symbols": [ - "TraceService.__init__", - "TraceService.store", - "TraceService.create_context" - ], - "path_symbol_ids": [ - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "ff44881104b65ef50ee6fe16d367d4a81b6e7eb5c44c0963cf4543faec785d4a" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "TraceService.__init__\n -> TraceService.store\n -> TraceService.close_context", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "TraceService.__init__:dataflow_slice", - "span_start": 42, - "span_end": 84, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "7a9353ef57c9ae5d19b3a0c6ac50fad05e6d21d31bbe1cd1cd07af6332ba6505", - "edge_type": "dataflow_slice", - "src_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "src_qname": "TraceService.__init__", - "dst_symbol_id": "01e14158dcced7e52d0c8ac84ac7b9a75225c261b6aca6a1d7da802d0994721c", - "dst_ref": "TraceService.close_context", - "resolution": "resolved", - "slice_id": "7a9353ef57c9ae5d19b3a0c6ac50fad05e6d21d31bbe1cd1cd07af6332ba6505", - "root_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "path_symbols": [ - "TraceService.__init__", - "TraceService.store", - "TraceService.close_context" - ], - "path_symbol_ids": [ - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "01e14158dcced7e52d0c8ac84ac7b9a75225c261b6aca6a1d7da802d0994721c" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "TraceService.__init__\n -> TraceService.store\n -> TraceService.open_context", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "TraceService.__init__:dataflow_slice", - "span_start": 42, - "span_end": 78, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "a6e13b9ebc4fed84586afd53ed92a4d14757e440873f572b2337d5622ee96031", - "edge_type": "dataflow_slice", - "src_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "src_qname": "TraceService.__init__", - "dst_symbol_id": "2da3d5b20a947bf63e14c103be4689b72fd837e0a82abd6c497846375d4c7426", - "dst_ref": "TraceService.open_context", - "resolution": "resolved", - "slice_id": "a6e13b9ebc4fed84586afd53ed92a4d14757e440873f572b2337d5622ee96031", - "root_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "path_symbols": [ - "TraceService.__init__", - "TraceService.store", - "TraceService.open_context" - ], - "path_symbol_ids": [ - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "2da3d5b20a947bf63e14c103be4689b72fd837e0a82abd6c497846375d4c7426" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "TraceService.__init__\n -> TraceService.transport\n -> TraceService.__init__", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "TraceService.__init__:dataflow_slice", - "span_start": 41, - "span_end": 43, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "1e923a93faa05c3c43ca9b19bd047007a8589ccce57d3cc1798ae7f9f200af98", - "edge_type": "dataflow_slice", - "src_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "src_qname": "TraceService.__init__", - "dst_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "dst_ref": "TraceService.__init__", - "resolution": "resolved", - "slice_id": "1e923a93faa05c3c43ca9b19bd047007a8589ccce57d3cc1798ae7f9f200af98", - "root_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "path_symbols": [ - "TraceService.__init__", - "TraceService.transport", - "TraceService.__init__" - ], - "path_symbol_ids": [ - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "TraceService.__init__\n -> TraceService.store\n -> TraceService.current_trace_id", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "TraceService.__init__:dataflow_slice", - "span_start": 42, - "span_end": 81, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "3ea17138634b1190bded77ddb84aa1595124f6519b246f24fc4b02bd62b5cac1", - "edge_type": "dataflow_slice", - "src_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "src_qname": "TraceService.__init__", - "dst_symbol_id": "41135180f7b3b9ab20e097e0747474e219c37dd2366ef08a7b43c1f3edb10b4c", - "dst_ref": "TraceService.current_trace_id", - "resolution": "resolved", - "slice_id": "3ea17138634b1190bded77ddb84aa1595124f6519b246f24fc4b02bd62b5cac1", - "root_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "path_symbols": [ - "TraceService.__init__", - "TraceService.store", - "TraceService.current_trace_id" - ], - "path_symbol_ids": [ - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "41135180f7b3b9ab20e097e0747474e219c37dd2366ef08a7b43c1f3edb10b4c" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "TraceService.__init__\n -> TraceService.store\n -> TraceService.step", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "TraceService.__init__:dataflow_slice", - "span_start": 42, - "span_end": 88, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "9f34c5da9b09fba99df6f6b1bde183a9aeb45111b8218a747c71590c2c9f60f2", - "edge_type": "dataflow_slice", - "src_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "src_qname": "TraceService.__init__", - "dst_symbol_id": "c44bfbc66cf747283f30088da3e011a10395031d41e77b74e523c24997f641ca", - "dst_ref": "TraceService.step", - "resolution": "resolved", - "slice_id": "9f34c5da9b09fba99df6f6b1bde183a9aeb45111b8218a747c71590c2c9f60f2", - "root_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "path_symbols": [ - "TraceService.__init__", - "TraceService.store", - "TraceService.step" - ], - "path_symbol_ids": [ - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "c44bfbc66cf747283f30088da3e011a10395031d41e77b74e523c24997f641ca" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "class TraceRecordWriter:\n def __init__(self, transport: TraceTransport) -> None:\n self._logger = logging.getLogger(__name__)\n self._transport = transport\n\n def write_context(self, record: TraceContextRecord) -> None:\n try:\n self._transport.write_context(record)\n except Exception:\n self._logger.exception(\"Trace transport failed to write context %s\", record.trace_id)\n\n def write_message(self, record: TraceLogMessage) -> None:\n try:\n self._transport.write_message(record)\n except Exception:\n self._logger.exception(\"Trace transport failed to write message for %s\", record.trace_id)", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/tracing/service.py:TraceRecordWriter", - "span_start": 21, - "span_end": 36, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.tracing.service", - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "class TraceService(TraceContextFactory):\n def __init__(self, transport: TraceTransport | None = None, store: TraceContextStore | None = None) -> None:\n self.transport = transport or NoOpTraceTransport()\n self.store = store or TraceContextStore()\n self._writer = TraceRecordWriter(self.transport)\n\n def create_context(\n self,\n *,\n alias: str,\n parent_id: str | None = None,\n kind: str | None = None,\n attrs: dict[str, Any] | None = None,\n ) -> str:\n record = TraceContextRecord(\n trace_id=uuid4().hex,\n alias=str(alias or \"\"),\n parent_id=parent_id,\n type=kind,\n event_time=utc_now(),\n attrs=dict(attrs or {}),\n )\n self.store.push(record)\n self._writer.write_context(record)\n return record.trace_id\n\n @contextmanager\n def open_context(\n self,\n *,\n alias: str,\n parent_id: str | None = None,\n kind: str | None = None,\n attrs: dict[str, Any] | None = None,\n ) -> Iterator[str]:\n trace_id = self.create_context(alias=alias, parent_id=parent_id, kind=kind, attrs=attrs)\n try:\n yield trace_id\n finally:\n self.store.pop()\n\n def current_trace_id(self) -> str | None:\n return self.store.current_trace_id()\n\n def close_context(self) -> str | None:\n previous = self.store.pop()\n return previous.record.trace_id if previous else None\n\n def step(self, name: str) -> None:\n self.store.set_step(str(name or \"\"))\n\n def info(self, message: str, *, status: str | None = None, attrs: dict[str, Any] | None = None) -> None:\n self._write_message(\"INFO\", message, status, attrs)\n\n def debug(self, message: str, *, status: str | None = None, attrs: dict[str, Any] | None = None) -> None:\n self._write_message(\"DEBUG\", message, status, attrs)\n\n def warning(self, message: str, *, status: str | None = None, attrs: dict[str, Any] | None = None) -> None:\n self._write_message(\"WARNING\", message, status, attrs)\n\n def error(self, message: str, *, status: str | None = None, attrs: dict[str, Any] | None = None) -> None:\n self._write_message(\"ERROR\", message, status, attrs)\n\n def exception(self, message: str, *, status: str = \"failed\", attrs: dict[str, Any] | None = None) -> None:\n self._write_message(\"ERROR\", message, status, attrs)\n\n def new_root(self, operation: str) -> TraceContext:\n trace_id = self.create_context(alias=operation, kind=\"operation\", attrs={\"operation\": operation})\n return TraceContext(trace_id=trace_id, span_id=trace_id, attributes={\"operation\": operation})\n\n def child_of(self, parent: TraceContext, operation: str) -> TraceContext:\n trace_id = self.create_context(\n alias=operation,\n parent_id=parent.trace_id,\n kind=\"worker\",\n attrs={\"operation\": operation},\n )\n return TraceContext(\n trace_id=trace_id,\n span_id=trace_id,\n parent_span_id=parent.span_id,\n attributes={\"operation\": operation},\n )\n\n def attach(self, metadata: dict[str, object], context: TraceContext) -> dict[str, object]:\n updated = dict(metadata)\n updated[\"trace_id\"] = context.trace_id\n updated[\"span_id\"] = context.span_id\n updated[\"parent_span_id\"] = context.parent_span_id\n return updated\n\n def resume(self, metadata: dict[str, object], operation: str) -> TraceContext:\n trace_id = str(metadata.get(\"trace_id\") or uuid4().hex)\n span_id = str(metadata.get(\"span_id\") or trace_id)\n parent_id = metadata.get(\"parent_span_id\")\n self.create_context(\n alias=operation,\n parent_id=str(parent_id) if parent_id else None,\n kind=\"worker\",\n attrs=dict(metadata),\n )\n return TraceContext(\n trace_id=trace_id,\n span_id=span_id,\n parent_span_id=str(parent_id) if parent_id else None,\n attributes={\"operation\": operation},\n )\n\n def _write_message(\n self,\n level: TraceLevel,\n message: str,\n status: str | None,\n attrs: dict[str, Any] | None,\n ) -> None:\n active = self.store.current()\n if active is None:\n raise RuntimeError(\"Trace context is not bound. Call create_context() first.\")\n record = TraceLogMessage(\n trace_id=active.record.trace_id,\n step=active.step,\n status=str(status or \"\"),\n message=str(message or \"\"),\n level=level,\n event_time=utc_now(),\n attrs=dict(attrs or {}),\n )\n self._writer.write_message(record)", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/tracing/service.py:TraceService", - "span_start": 39, - "span_end": 166, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 1, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.tracing.service", - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "class TraceManager(TraceService):\n \"\"\"Compatibility alias during the transition from ConfigManager-shaped naming.\"\"\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/tracing/service.py:TraceManager", - "span_start": 169, - "span_end": 170, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 2, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.tracing.service", - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ] - }, - "diagnostics": { - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C0_SOURCE_CHUNKS": "exact_path_fetch", - "C4_SEMANTIC_ROLES": "exact_path_fetch", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C3_ENTRYPOINTS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 8, - "C4_SEMANTIC_ROLES": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C3_ENTRYPOINTS": 6 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C4_SEMANTIC_ROLES": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "TraceService", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "TraceService", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C4_SEMANTIC_ROLES", - "query": "TraceService", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "TraceService", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - }, - { - "layer": "C3_ENTRYPOINTS", - "query": "TraceService", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 1, - "candidates_after_filter": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 6, - "candidates_after_filter": 6 - }, - { - "layer": "C3_ENTRYPOINTS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 3, - "candidates_after_filter": 3 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "TraceService", - "alternatives": [ - "TraceService" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 3, - "fail_reason": null - }, - { - "layer": "C4_SEMANTIC_ROLES", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 6, - "fail_reason": null - }, - { - "layer": "C3_ENTRYPOINTS", - "status": "hit", - "hit_count": 3, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "symbol_resolution": 0, - "retrieval_total": 141, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 44, - "C0_SOURCE_CHUNKS": 19, - "C4_SEMANTIC_ROLES": 17, - "C2_DEPENDENCY_GRAPH": 47, - "C3_ENTRYPOINTS": 11 - }, - "merge_rank": 20 - } - } - }, - { - "step": "llm_answer", - "input": { - "query": "Как работает TraceService?", - "rag_count": 14 - }, - "output": { - "llm_answer": "## Объяснение работы `TraceService`\n\n### Назначение\n`TraceService` — это компонент, отвечающий за управление контекстом трассировки и запись логических событий во время выполнения приложения. Он служит для создания, хранения и записи трассировочных записей (`trace records`) и сообщений логирования (`log messages`), связанных с выполнением различных операций.\n\n### Ключевые зависимости\n- **TraceContextFactory**: Базовый класс, от которого наследуется `TraceService`. Предоставляет методы для управления контекстом трассировки.\n- **TraceTransport**: Интерфейс, определяющий транспорт для передачи трассировочной информации внешним системам или службам.\n- **TraceContextStore**: Хранит контексты трассировок.\n- **NoOpTraceTransport**: Специальная реализация транспорта без реальных действий, используется по умолчанию при отсутствии указания конкретного транспорта.\n\n### Поток данных или вызовов\n1. При инициализации класса `TraceService` происходит создание экземпляра `TraceRecordWriter`, который отвечает за отправку трассировочных записей через указанный транспорт.\n2. Основной метод `create_context` создаёт новый контекст трассировки с уникальным идентификатором (`trace_id`), атрибутами и временными метками, записывает его в хранилище и передаёт информацию в транспорт.\n3. Контекст трассировки можно открывать с помощью метода `open_context`, который автоматически вызывает `create_context`.\n4. После завершения операции можно записать сообщение логирования через метод `write_message`.\n5. В случае ошибок при передаче данных в транспорт вызывается метод `_logger.exception` для регистрации проблемы.\n\n### Важные детали реализации\n- **UUID для trace_id**: Используется UUID для уникального идентификатора каждой трассировки.\n- **Время события**: Каждое событие сопровождается временной меткой UTC.\n- **Запись сообщений**: Сообщения логирования могут быть записаны отдельно после завершения контекста трассировки.\n- **Логирование ошибок**: При ошибке отправки сообщения в транспорт регистрируется исключение и выводится соответствующее сообщение об ошибке.\n\n### Описание структуры файла\nФайл `src/app_runtime/tracing/service.py` содержит реализацию класса `TraceService`, а также классы `TraceRecordWriter` и другие вспомогательные компоненты.\n\n---\n\nЭтот обзор основан исключительно на предоставленных слоях анализа (C0-C4), поэтому некоторые выводы являются осторожными и требуют дополнительной проверки." - }, - "diagnostics": { - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 931, - "evidence_rows": 14, - "evidence_chars": 6323 - }, - "evidence_summary": [ - { - "layer": "C1_SYMBOL_CATALOG", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "count": 6, - "unique_paths": 1 - }, - { - "layer": "C3_ENTRYPOINTS", - "count": 3, - "unique_paths": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 3, - "unique_paths": 1 - } - ], - "prompt_template_id": "intent_code_qa_explain_ru_v1", - "system_prompt_version": "v1" - }, - "timings_ms": { - "prompt_build": 0, - "llm_call": 3391 - } - } - } - ] - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_114413/full_chain_plba_code_retrieval_plba-fullchain-explain-trace-service.md b/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_114413/full_chain_plba_code_retrieval_plba-fullchain-explain-trace-service.md deleted file mode 100644 index 670de6f..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_114413/full_chain_plba_code_retrieval_plba-fullchain-explain-trace-service.md +++ /dev/null @@ -1,34 +0,0 @@ -# plba-fullchain-explain-trace-service - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_retrieval.yaml -- runner: runtime -- mode: full_chain -- passed: True - -## Query -Как работает TraceService? - -## Actual -{ - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 14, - "llm_answer": "## Объяснение работы `TraceService`\n\n### Назначение\n`TraceService` — это компонент, отвечающий за управление контекстом трассировки и запись логических событий во время выполнения приложения. Он служит для создания, хранения и записи трассировочных записей (`trace records`) и сообщений логирования (`log messages`), связанных с выполнением различных операций.\n\n### Ключевые зависимости\n- **TraceContextFactory**: Базовый класс, от которого наследуется `TraceService`. Предоставляет методы для управления контекстом трассировки.\n- **TraceTransport**: Интерфейс, определяющий транспорт для передачи трассировочной информации внешним системам или службам.\n- **TraceContextStore**: Хранит контексты трассировок.\n- **NoOpTraceTransport**: Специальная реализация транспорта без реальных действий, используется по умолчанию при отсутствии указания конкретного транспорта.\n\n### Поток данных или вызовов\n1. При инициализации класса `TraceService` происходит создание экземпляра `TraceRecordWriter`, который отвечает за отправку трассировочных записей через указанный транспорт.\n2. Основной метод `create_context` создаёт новый контекст трассировки с уникальным идентификатором (`trace_id`), атрибутами и временными метками, записывает его в хранилище и передаёт информацию в транспорт.\n3. Контекст трассировки можно открывать с помощью метода `open_context`, который автоматически вызывает `create_context`.\n4. После завершения операции можно записать сообщение логирования через метод `write_message`.\n5. В случае ошибок при передаче данных в транспорт вызывается метод `_logger.exception` для регистрации проблемы.\n\n### Важные детали реализации\n- **UUID для trace_id**: Используется UUID для уникального идентификатора каждой трассировки.\n- **Время события**: Каждое событие сопровождается временной меткой UTC.\n- **Запись сообщений**: Сообщения логирования могут быть записаны отдельно после завершения контекста трассировки.\n- **Логирование ошибок**: При ошибке отправки сообщения в транспорт регистрируется исключение и выводится соответствующее сообщение об ошибке.\n\n### Описание структуры файла\nФайл `src/app_runtime/tracing/service.py` содержит реализацию класса `TraceService`, а также классы `TraceRecordWriter` и другие вспомогательные компоненты.\n\n---\n\nЭтот обзор основан исключительно на предоставленных слоях анализа (C0-C4), поэтому некоторые выводы являются осторожными и требуют дополнительной проверки.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "TraceService" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] -} - -## Mismatches -- none \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_114413/full_chain_plba_code_retrieval_plba-fullchain-explain-workflow-engine.json b/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_114413/full_chain_plba_code_retrieval_plba-fullchain-explain-workflow-engine.json deleted file mode 100644 index 1f8d215..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_114413/full_chain_plba_code_retrieval_plba-fullchain-explain-workflow-engine.json +++ /dev/null @@ -1,2158 +0,0 @@ -{ - "case_id": "plba-fullchain-explain-workflow-engine", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_retrieval.yaml", - "runner": "runtime", - "mode": "full_chain", - "actual": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 13, - "llm_answer": "## Назначение класса `WorkflowEngine`\n\nКласс `WorkflowEngine` является основным компонентом инфраструктуры выполнения рабочих процессов (`workflow`) в приложении. Он отвечает за координацию и управление жизненным циклом рабочего процесса, включая отслеживание текущего состояния выполнения, взаимодействие с хранилищем для сохранения промежуточных результатов и взаимодействия с внешними компонентами через логирование и трассировку.\n\n## Ключевые зависимости\n\n### 1. Зависимости по модулям и библиотекам\n- **src/app_runtime/workflow/engine/workflow_engine.py**: основной файл, содержащий определение класса `WorkflowEngine`.\n- **src/app_runtime/workflow/engine/hooks.py**: модуль, предоставляющий механизмы расширения функциональности через интерфейс `WorkflowEngineHooks`, позволяющий разработчикам внедрять дополнительные действия перед началом, во время выполнения и после завершения этапов рабочего процесса.\n\n### 2. Основные объекты, используемые внутри класса\n- **workflow**: объект, представляющий рабочий процесс, который будет выполняться.\n- **persistence**: механизм хранения состояний рабочих процессов, обычно реализованный через базы данных или системы управления событиями.\n- **traces**: инструмент трассировки, предназначенный для мониторинга хода выполнения рабочего процесса и его шагов.\n- **hooks**: дополнительные модули расширений, которые могут быть подключены к рабочему процессу.\n\n## Поток данных или вызовов\n\nПри запуске экземпляра класса `WorkflowEngine` вызывается метод `run()`. Этот метод выполняет следующие шаги:\n\n1. **Инициализация выполнения**:\n - Вызывается метод `_transition_resolver`, который отвечает за разрешение переходов между узлами рабочего процесса.\n - Создаётся идентификатор текущей рабочей сессии при помощи метода `start_run()` из объекта persistence.\n \n2. **Запуск основного цикла исполнения**:\n - Основной цикл использует переменную `current_name`, которая представляет текущий этап выполнения рабочего процесса.\n - В каждом шаге выполняется следующий узел (`node`), определяется его текущее состояние и фиксируется текущая точка выполнения в контексте выполнения.\n\n3. **Завершение выполнения**:\n - После завершения последнего этапа рабочего процесса происходит запись информации о завершении в хранилище и регистрация этого события в системе трассировки.\n\n## Важные детали реализации\n\n### 1. Логика работы узлов (`nodes`)\n- Метод `run()` последовательно обрабатывает узлы рабочего процесса до тех пор, пока не завершится выполнение всех заданных задач.\n- Узлы являются основными элементами рабочего процесса и определяют последовательность действий и переходы между ними.\n\n### 2. Обработка контекста выполнения\n- Контекст выполнения хранится в виде словаря (`context.state`), что позволяет сохранять промежуточные результаты и информацию о текущем состоянии выполнения рабочего процесса.\n\n### 3. Использование внешних механизмов\n- Класс поддерживает внешние расширения через интерфейс `WorkflowEngineHooks`, позволяя разработчикам добавлять свою бизнес-логику без изменения базовой структуры рабочего процесса.\n\n### Осторожные выводы\nНа основании текущих данных невозможно точно определить все подробности внутреннего устройства каждого узла рабочего процесса (`nodes`) и алгоритмы разрешения переходов. Однако, исходя из доступной информации, можно предположить, что узлы рабочего процесса содержат некоторую внутреннюю логику, позволяющую автоматически разрешать возможные переходы между этапами. Это предположение основано на косвенных признаках и не подтверждено прямым анализом исходного кода этих узлов.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "WorkflowEngine" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "passed": true, - "mismatches": [], - "details": { - "case_id": "plba-fullchain-explain-workflow-engine", - "text": "Объясни класс WorkflowEngine", - "mode": "full_chain", - "run_started_at": "2026-03-12T11:44:13", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Объясни класс WorkflowEngine", - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "WorkflowEngine", - "alternatives": [ - "WorkflowEngine", - "WorkflowEngineHooks" - ], - "confidence": 0.99 - }, - "rag_count": 13, - "rag_rows": [ - { - "path": "src/app_runtime/workflow/engine/workflow_engine.py", - "content": "class WorkflowEngine\nWorkflowEngine", - "layer": "C1_SYMBOL_CATALOG", - "title": "WorkflowEngine", - "span_start": 10, - "span_end": 86, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "57ec0a9f11c542c78e008684a888397e8d9ef4223671acb2567e631a0cbc70b4", - "qname": "WorkflowEngine", - "kind": "class", - "signature": "WorkflowEngine", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.workflow.engine.workflow_engine", - "is_test": false, - "blob_sha": "1057136e58a325cd5ab6f4e265d15665fb6a711b7022d9fab52a1a290afa2368", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/engine/hooks.py", - "content": "class WorkflowEngineHooks\nWorkflowEngineHooks", - "layer": "C1_SYMBOL_CATALOG", - "title": "WorkflowEngineHooks", - "span_start": 6, - "span_end": 14, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "914123ed510540061e116100fc87bba4195595ba696f8bfde2fd77ac6a5cd7e4", - "qname": "WorkflowEngineHooks", - "kind": "class", - "signature": "WorkflowEngineHooks", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.workflow.engine.hooks", - "is_test": false, - "blob_sha": "4b11672b0a9af1ae04bfce9d8e1f96572997d3e65e68108d7c797b88fa5fa47a", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/engine/workflow_engine.py", - "content": "WorkflowEngine\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (6)", - "layer": "C4_SEMANTIC_ROLES", - "title": "WorkflowEngine", - "span_start": 10, - "span_end": 86, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 25, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "57ec0a9f11c542c78e008684a888397e8d9ef4223671acb2567e631a0cbc70b4", - "symbol_name": "WorkflowEngine", - "qname": "WorkflowEngine", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 6, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "1057136e58a325cd5ab6f4e265d15665fb6a711b7022d9fab52a1a290afa2368", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/engine/workflow_engine.py", - "content": "WorkflowEngine.__init__\n -> WorkflowEngine._transition_resolver\n -> WorkflowEngine.run", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "WorkflowEngine.__init__:dataflow_slice", - "span_start": 14, - "span_end": 63, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "3abf07e5c245e0fe59785ba2d569c2ee56018715fc7f625a044ddaf6201f903d", - "edge_type": "dataflow_slice", - "src_symbol_id": "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "src_qname": "WorkflowEngine.__init__", - "dst_symbol_id": "a12cad0f5b238287e02f6d8d156cc764351d8c83246930487fa09d5ce6f2ace8", - "dst_ref": "WorkflowEngine.run", - "resolution": "resolved", - "slice_id": "3abf07e5c245e0fe59785ba2d569c2ee56018715fc7f625a044ddaf6201f903d", - "root_symbol_id": "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "path_symbols": [ - "WorkflowEngine.__init__", - "WorkflowEngine._transition_resolver", - "WorkflowEngine.run" - ], - "path_symbol_ids": [ - "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "a12cad0f5b238287e02f6d8d156cc764351d8c83246930487fa09d5ce6f2ace8" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "1057136e58a325cd5ab6f4e265d15665fb6a711b7022d9fab52a1a290afa2368", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/engine/workflow_engine.py", - "content": "WorkflowEngine.__init__\n -> WorkflowEngine._hooks\n -> WorkflowEngine.run", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "WorkflowEngine.__init__:dataflow_slice", - "span_start": 16, - "span_end": 34, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "d73db644b69c1eb35afd6eae9d6ac8674e49e30e9bcf9c020f9fdbfe754851b2", - "edge_type": "dataflow_slice", - "src_symbol_id": "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "src_qname": "WorkflowEngine.__init__", - "dst_symbol_id": "a12cad0f5b238287e02f6d8d156cc764351d8c83246930487fa09d5ce6f2ace8", - "dst_ref": "WorkflowEngine.run", - "resolution": "resolved", - "slice_id": "d73db644b69c1eb35afd6eae9d6ac8674e49e30e9bcf9c020f9fdbfe754851b2", - "root_symbol_id": "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "path_symbols": [ - "WorkflowEngine.__init__", - "WorkflowEngine._hooks", - "WorkflowEngine.run" - ], - "path_symbol_ids": [ - "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "a12cad0f5b238287e02f6d8d156cc764351d8c83246930487fa09d5ce6f2ace8" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "1057136e58a325cd5ab6f4e265d15665fb6a711b7022d9fab52a1a290afa2368", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/engine/workflow_engine.py", - "content": "WorkflowEngine.__init__\n -> WorkflowEngine._workflow\n -> WorkflowEngine.run", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "WorkflowEngine.__init__:dataflow_slice", - "span_start": 12, - "span_end": 29, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "b45ef3c54669b4910a8aed3a565804f275424a24007bc7e3c953389521f80249", - "edge_type": "dataflow_slice", - "src_symbol_id": "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "src_qname": "WorkflowEngine.__init__", - "dst_symbol_id": "a12cad0f5b238287e02f6d8d156cc764351d8c83246930487fa09d5ce6f2ace8", - "dst_ref": "WorkflowEngine.run", - "resolution": "resolved", - "slice_id": "b45ef3c54669b4910a8aed3a565804f275424a24007bc7e3c953389521f80249", - "root_symbol_id": "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "path_symbols": [ - "WorkflowEngine.__init__", - "WorkflowEngine._workflow", - "WorkflowEngine.run" - ], - "path_symbol_ids": [ - "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "a12cad0f5b238287e02f6d8d156cc764351d8c83246930487fa09d5ce6f2ace8" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "1057136e58a325cd5ab6f4e265d15665fb6a711b7022d9fab52a1a290afa2368", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/engine/workflow_engine.py", - "content": "WorkflowEngine.__init__\n -> WorkflowEngine._persistence\n -> WorkflowEngine.run", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "WorkflowEngine.__init__:dataflow_slice", - "span_start": 13, - "span_end": 20, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "8101338770016324ce05d61daa9935a444c75e6c94a0fae4275d5b50fcbcc70b", - "edge_type": "dataflow_slice", - "src_symbol_id": "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "src_qname": "WorkflowEngine.__init__", - "dst_symbol_id": "a12cad0f5b238287e02f6d8d156cc764351d8c83246930487fa09d5ce6f2ace8", - "dst_ref": "WorkflowEngine.run", - "resolution": "resolved", - "slice_id": "8101338770016324ce05d61daa9935a444c75e6c94a0fae4275d5b50fcbcc70b", - "root_symbol_id": "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "path_symbols": [ - "WorkflowEngine.__init__", - "WorkflowEngine._persistence", - "WorkflowEngine.run" - ], - "path_symbol_ids": [ - "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "a12cad0f5b238287e02f6d8d156cc764351d8c83246930487fa09d5ce6f2ace8" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "1057136e58a325cd5ab6f4e265d15665fb6a711b7022d9fab52a1a290afa2368", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/engine/workflow_engine.py", - "content": "WorkflowEngine.__init__\n -> WorkflowEngine._traces\n -> WorkflowEngine.run", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "WorkflowEngine.__init__:dataflow_slice", - "span_start": 15, - "span_end": 27, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "5006266616d534d721648391565e2ac0c9e7e9d9f8df00c17fba8989afb533a5", - "edge_type": "dataflow_slice", - "src_symbol_id": "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "src_qname": "WorkflowEngine.__init__", - "dst_symbol_id": "a12cad0f5b238287e02f6d8d156cc764351d8c83246930487fa09d5ce6f2ace8", - "dst_ref": "WorkflowEngine.run", - "resolution": "resolved", - "slice_id": "5006266616d534d721648391565e2ac0c9e7e9d9f8df00c17fba8989afb533a5", - "root_symbol_id": "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "path_symbols": [ - "WorkflowEngine.__init__", - "WorkflowEngine._traces", - "WorkflowEngine.run" - ], - "path_symbol_ids": [ - "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "a12cad0f5b238287e02f6d8d156cc764351d8c83246930487fa09d5ce6f2ace8" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "1057136e58a325cd5ab6f4e265d15665fb6a711b7022d9fab52a1a290afa2368", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/engine/workflow_engine.py", - "content": "WorkflowEngine.__init__\n -> WorkflowEngine._logger\n -> WorkflowEngine.run", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "WorkflowEngine.__init__:dataflow_slice", - "span_start": 17, - "span_end": 85, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "2f9927abb24794adb056b94bfb5d8538a5cbafb160da2079f52fca97fd694a2b", - "edge_type": "dataflow_slice", - "src_symbol_id": "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "src_qname": "WorkflowEngine.__init__", - "dst_symbol_id": "a12cad0f5b238287e02f6d8d156cc764351d8c83246930487fa09d5ce6f2ace8", - "dst_ref": "WorkflowEngine.run", - "resolution": "resolved", - "slice_id": "2f9927abb24794adb056b94bfb5d8538a5cbafb160da2079f52fca97fd694a2b", - "root_symbol_id": "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "path_symbols": [ - "WorkflowEngine.__init__", - "WorkflowEngine._logger", - "WorkflowEngine.run" - ], - "path_symbol_ids": [ - "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "a12cad0f5b238287e02f6d8d156cc764351d8c83246930487fa09d5ce6f2ace8" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "1057136e58a325cd5ab6f4e265d15665fb6a711b7022d9fab52a1a290afa2368", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/engine/workflow_engine.py", - "content": "class WorkflowEngine:\n def __init__(self, workflow, persistence, *, traces, hooks: WorkflowEngineHooks | None = None) -> None:\n self._workflow = workflow\n self._persistence = persistence\n self._transition_resolver = TransitionResolver()\n self._traces = traces\n self._hooks = hooks or WorkflowEngineHooks()\n self._logger = logging.getLogger(__name__)\n\n def run(self, context: WorkflowContext) -> dict[str, object]:\n run_id = self._persistence.start_run(\n self._workflow.definition.name,\n self._workflow.definition.start_at,\n context.snapshot(),\n )\n context.state.setdefault(\"runtime\", {})\n context.state[\"runtime\"][\"workflow_run_id\"] = run_id\n self._traces.step(\"workflow\")\n self._traces.info(\"Workflow started.\", status=\"started\", attrs={\"workflow_run_id\": run_id})\n current_name = self._workflow.definition.start_at\n while current_name is not None:\n node = self._workflow.definition.nodes[current_name]\n context.state[\"runtime\"][\"current_node\"] = current_name\n self._logger.info(\"Workflow run %s: step '%s' started.\", run_id, current_name)\n self._hooks.on_step_started(context, current_name)\n self._persistence.start_step(run_id, current_name, context.snapshot())\n self._traces.step(current_name)\n self._traces.debug(\n f\"Step '{current_name}' started.\",\n status=\"started\",\n attrs={\"workflow_run_id\": run_id, \"node\": current_name},\n )\n try:\n result = node.step.run(context)\n except Exception as error:\n self._persistence.fail_step(run_id, current_name, context.snapshot(), error)\n self._persistence.fail_run(run_id, context.snapshot())\n self._traces.error(\n f\"Step '{current_name}' failed: {error}\",\n status=\"failed\",\n attrs={\"exception_type\": type(error).__name__},\n )\n self._logger.exception(\"Workflow run %s: step '%s' failed.\", run_id, current_name)\n self._hooks.on_step_failed(context, current_name)\n raise\n context.state.update(result.updates)\n self._persistence.complete_step(\n run_id,\n current_name,\n result.status,\n result.transition,\n context.snapshot(),\n )\n next_node = self._transition_resolver.resolve(node, result)\n self._traces.debug(\n f\"Step '{current_name}' completed with transition '{result.transition}'.\",\n status=result.status,\n attrs={\n \"workflow_run_id\": run_id,\n \"from_node\": current_name,\n \"transition\": result.transition,\n \"to_node\": next_node,\n },\n )\n self._logger.info(\n \"Workflow run %s: step '%s' completed with transition '%s'.\",\n run_id,\n current_name,\n result.transition,\n )\n self._hooks.on_step_finished(context, current_name)\n current_name = next_node\n self._persistence.complete_run(run_id, context.snapshot())\n self._traces.step(\"workflow\")\n self._traces.info(\"Workflow completed.\", status=\"completed\", attrs={\"workflow_run_id\": run_id})\n self._logger.info(\"Workflow run %s completed.\", run_id)\n return {\"run_id\": run_id, \"status\": \"completed\", \"context\": context.snapshot()}", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/workflow/engine/workflow_engine.py:WorkflowEngine", - "span_start": 10, - "span_end": 86, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.workflow.engine.workflow_engine", - "is_test": false, - "blob_sha": "1057136e58a325cd5ab6f4e265d15665fb6a711b7022d9fab52a1a290afa2368", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "llm_answer": "## Назначение класса `WorkflowEngine`\n\nКласс `WorkflowEngine` является основным компонентом инфраструктуры выполнения рабочих процессов (`workflow`) в приложении. Он отвечает за координацию и управление жизненным циклом рабочего процесса, включая отслеживание текущего состояния выполнения, взаимодействие с хранилищем для сохранения промежуточных результатов и взаимодействия с внешними компонентами через логирование и трассировку.\n\n## Ключевые зависимости\n\n### 1. Зависимости по модулям и библиотекам\n- **src/app_runtime/workflow/engine/workflow_engine.py**: основной файл, содержащий определение класса `WorkflowEngine`.\n- **src/app_runtime/workflow/engine/hooks.py**: модуль, предоставляющий механизмы расширения функциональности через интерфейс `WorkflowEngineHooks`, позволяющий разработчикам внедрять дополнительные действия перед началом, во время выполнения и после завершения этапов рабочего процесса.\n\n### 2. Основные объекты, используемые внутри класса\n- **workflow**: объект, представляющий рабочий процесс, который будет выполняться.\n- **persistence**: механизм хранения состояний рабочих процессов, обычно реализованный через базы данных или системы управления событиями.\n- **traces**: инструмент трассировки, предназначенный для мониторинга хода выполнения рабочего процесса и его шагов.\n- **hooks**: дополнительные модули расширений, которые могут быть подключены к рабочему процессу.\n\n## Поток данных или вызовов\n\nПри запуске экземпляра класса `WorkflowEngine` вызывается метод `run()`. Этот метод выполняет следующие шаги:\n\n1. **Инициализация выполнения**:\n - Вызывается метод `_transition_resolver`, который отвечает за разрешение переходов между узлами рабочего процесса.\n - Создаётся идентификатор текущей рабочей сессии при помощи метода `start_run()` из объекта persistence.\n \n2. **Запуск основного цикла исполнения**:\n - Основной цикл использует переменную `current_name`, которая представляет текущий этап выполнения рабочего процесса.\n - В каждом шаге выполняется следующий узел (`node`), определяется его текущее состояние и фиксируется текущая точка выполнения в контексте выполнения.\n\n3. **Завершение выполнения**:\n - После завершения последнего этапа рабочего процесса происходит запись информации о завершении в хранилище и регистрация этого события в системе трассировки.\n\n## Важные детали реализации\n\n### 1. Логика работы узлов (`nodes`)\n- Метод `run()` последовательно обрабатывает узлы рабочего процесса до тех пор, пока не завершится выполнение всех заданных задач.\n- Узлы являются основными элементами рабочего процесса и определяют последовательность действий и переходы между ними.\n\n### 2. Обработка контекста выполнения\n- Контекст выполнения хранится в виде словаря (`context.state`), что позволяет сохранять промежуточные результаты и информацию о текущем состоянии выполнения рабочего процесса.\n\n### 3. Использование внешних механизмов\n- Класс поддерживает внешние расширения через интерфейс `WorkflowEngineHooks`, позволяя разработчикам добавлять свою бизнес-логику без изменения базовой структуры рабочего процесса.\n\n### Осторожные выводы\nНа основании текущих данных невозможно точно определить все подробности внутреннего устройства каждого узла рабочего процесса (`nodes`) и алгоритмы разрешения переходов. Однако, исходя из доступной информации, можно предположить, что узлы рабочего процесса содержат некоторую внутреннюю логику, позволяющую автоматически разрешать возможные переходы между этапами. Это предположение основано на косвенных признаках и не подтверждено прямым анализом исходного кода этих узлов.", - "summary": { - "router": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "confidence": null - }, - "retrieval": { - "profile": "code", - "layers_hit": [ - "C0_SOURCE_CHUNKS", - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS", - "C4_SEMANTIC_ROLES" - ], - "evidence_sufficient": true - }, - "llm": { - "answer_status": "answered", - "groundedness": "grounded" - } - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "WorkflowEngine" - ], - "keyword_hints": [ - "WorkflowEngine" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C0_SOURCE_CHUNKS": "exact_path_fetch", - "C4_SEMANTIC_ROLES": "exact_path_fetch", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C3_ENTRYPOINTS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 8, - "C4_SEMANTIC_ROLES": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C3_ENTRYPOINTS": 6 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C4_SEMANTIC_ROLES": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "WorkflowEngine", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "WorkflowEngine", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C4_SEMANTIC_ROLES", - "query": "WorkflowEngine", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "WorkflowEngine", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - }, - { - "layer": "C3_ENTRYPOINTS", - "query": "WorkflowEngine", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 2, - "candidates_after_filter": 2 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 6, - "candidates_after_filter": 6 - }, - { - "layer": "C3_ENTRYPOINTS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 3, - "candidates_after_filter": 3 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "WorkflowEngine", - "alternatives": [ - "WorkflowEngine", - "WorkflowEngineHooks" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "hit", - "hit_count": 2, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C4_SEMANTIC_ROLES", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 6, - "fail_reason": null - }, - { - "layer": "C3_ENTRYPOINTS", - "status": "hit", - "hit_count": 3, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "router": 0, - "symbol_resolution": 0, - "retrieval_total": 129, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 39, - "C0_SOURCE_CHUNKS": 15, - "C4_SEMANTIC_ROLES": 17, - "C2_DEPENDENCY_GRAPH": 45, - "C3_ENTRYPOINTS": 10 - }, - "merge_rank": 37, - "prompt_build": 0, - "llm_call": 4657 - }, - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 780, - "evidence_rows": 13, - "evidence_chars": 4423 - }, - "evidence_summary": [ - { - "layer": "C1_SYMBOL_CATALOG", - "count": 2, - "unique_paths": 2 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "count": 6, - "unique_paths": 1 - }, - { - "layer": "C3_ENTRYPOINTS", - "count": 3, - "unique_paths": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 1, - "unique_paths": 1 - } - ], - "prompt_template_id": "intent_code_qa_explain_ru_v1", - "system_prompt_version": "v1" - }, - "router": { - "conversation_mode": "START", - "keyword_hints": [ - "WorkflowEngine" - ], - "path_scope": [] - }, - "llm": { - "used_evidence_count": 13, - "missing_evidence_reason": null - } - }, - "run_info": { - "case_id": "plba-fullchain-explain-workflow-engine", - "mode": "full_chain", - "run_started_at": "2026-03-12T11:44:13", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - }, - "input_request": { - "text": "Объясни класс WorkflowEngine", - "normalized_query": "Объясни класс WorkflowEngine" - }, - "steps": [ - { - "step": "intent_router", - "input": { - "query": "Объясни класс WorkflowEngine" - }, - "output": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Объясни класс WorkflowEngine" - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "WorkflowEngine" - ], - "keyword_hints": [ - "WorkflowEngine" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "timings_ms": { - "router": 0 - } - } - }, - { - "step": "retrieval", - "input": { - "query": "Объясни класс WorkflowEngine" - }, - "output": { - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "WorkflowEngine", - "alternatives": [ - "WorkflowEngine", - "WorkflowEngineHooks" - ], - "confidence": 0.99 - }, - "rag_count": 13, - "rag_rows": [ - { - "path": "src/app_runtime/workflow/engine/workflow_engine.py", - "content": "class WorkflowEngine\nWorkflowEngine", - "layer": "C1_SYMBOL_CATALOG", - "title": "WorkflowEngine", - "span_start": 10, - "span_end": 86, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "57ec0a9f11c542c78e008684a888397e8d9ef4223671acb2567e631a0cbc70b4", - "qname": "WorkflowEngine", - "kind": "class", - "signature": "WorkflowEngine", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.workflow.engine.workflow_engine", - "is_test": false, - "blob_sha": "1057136e58a325cd5ab6f4e265d15665fb6a711b7022d9fab52a1a290afa2368", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/engine/hooks.py", - "content": "class WorkflowEngineHooks\nWorkflowEngineHooks", - "layer": "C1_SYMBOL_CATALOG", - "title": "WorkflowEngineHooks", - "span_start": 6, - "span_end": 14, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "914123ed510540061e116100fc87bba4195595ba696f8bfde2fd77ac6a5cd7e4", - "qname": "WorkflowEngineHooks", - "kind": "class", - "signature": "WorkflowEngineHooks", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.workflow.engine.hooks", - "is_test": false, - "blob_sha": "4b11672b0a9af1ae04bfce9d8e1f96572997d3e65e68108d7c797b88fa5fa47a", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/engine/workflow_engine.py", - "content": "WorkflowEngine\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (6)", - "layer": "C4_SEMANTIC_ROLES", - "title": "WorkflowEngine", - "span_start": 10, - "span_end": 86, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 25, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "57ec0a9f11c542c78e008684a888397e8d9ef4223671acb2567e631a0cbc70b4", - "symbol_name": "WorkflowEngine", - "qname": "WorkflowEngine", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 6, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "1057136e58a325cd5ab6f4e265d15665fb6a711b7022d9fab52a1a290afa2368", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/engine/workflow_engine.py", - "content": "WorkflowEngine.__init__\n -> WorkflowEngine._transition_resolver\n -> WorkflowEngine.run", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "WorkflowEngine.__init__:dataflow_slice", - "span_start": 14, - "span_end": 63, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "3abf07e5c245e0fe59785ba2d569c2ee56018715fc7f625a044ddaf6201f903d", - "edge_type": "dataflow_slice", - "src_symbol_id": "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "src_qname": "WorkflowEngine.__init__", - "dst_symbol_id": "a12cad0f5b238287e02f6d8d156cc764351d8c83246930487fa09d5ce6f2ace8", - "dst_ref": "WorkflowEngine.run", - "resolution": "resolved", - "slice_id": "3abf07e5c245e0fe59785ba2d569c2ee56018715fc7f625a044ddaf6201f903d", - "root_symbol_id": "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "path_symbols": [ - "WorkflowEngine.__init__", - "WorkflowEngine._transition_resolver", - "WorkflowEngine.run" - ], - "path_symbol_ids": [ - "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "a12cad0f5b238287e02f6d8d156cc764351d8c83246930487fa09d5ce6f2ace8" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "1057136e58a325cd5ab6f4e265d15665fb6a711b7022d9fab52a1a290afa2368", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/engine/workflow_engine.py", - "content": "WorkflowEngine.__init__\n -> WorkflowEngine._hooks\n -> WorkflowEngine.run", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "WorkflowEngine.__init__:dataflow_slice", - "span_start": 16, - "span_end": 34, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "d73db644b69c1eb35afd6eae9d6ac8674e49e30e9bcf9c020f9fdbfe754851b2", - "edge_type": "dataflow_slice", - "src_symbol_id": "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "src_qname": "WorkflowEngine.__init__", - "dst_symbol_id": "a12cad0f5b238287e02f6d8d156cc764351d8c83246930487fa09d5ce6f2ace8", - "dst_ref": "WorkflowEngine.run", - "resolution": "resolved", - "slice_id": "d73db644b69c1eb35afd6eae9d6ac8674e49e30e9bcf9c020f9fdbfe754851b2", - "root_symbol_id": "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "path_symbols": [ - "WorkflowEngine.__init__", - "WorkflowEngine._hooks", - "WorkflowEngine.run" - ], - "path_symbol_ids": [ - "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "a12cad0f5b238287e02f6d8d156cc764351d8c83246930487fa09d5ce6f2ace8" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "1057136e58a325cd5ab6f4e265d15665fb6a711b7022d9fab52a1a290afa2368", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/engine/workflow_engine.py", - "content": "WorkflowEngine.__init__\n -> WorkflowEngine._workflow\n -> WorkflowEngine.run", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "WorkflowEngine.__init__:dataflow_slice", - "span_start": 12, - "span_end": 29, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "b45ef3c54669b4910a8aed3a565804f275424a24007bc7e3c953389521f80249", - "edge_type": "dataflow_slice", - "src_symbol_id": "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "src_qname": "WorkflowEngine.__init__", - "dst_symbol_id": "a12cad0f5b238287e02f6d8d156cc764351d8c83246930487fa09d5ce6f2ace8", - "dst_ref": "WorkflowEngine.run", - "resolution": "resolved", - "slice_id": "b45ef3c54669b4910a8aed3a565804f275424a24007bc7e3c953389521f80249", - "root_symbol_id": "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "path_symbols": [ - "WorkflowEngine.__init__", - "WorkflowEngine._workflow", - "WorkflowEngine.run" - ], - "path_symbol_ids": [ - "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "a12cad0f5b238287e02f6d8d156cc764351d8c83246930487fa09d5ce6f2ace8" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "1057136e58a325cd5ab6f4e265d15665fb6a711b7022d9fab52a1a290afa2368", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/engine/workflow_engine.py", - "content": "WorkflowEngine.__init__\n -> WorkflowEngine._persistence\n -> WorkflowEngine.run", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "WorkflowEngine.__init__:dataflow_slice", - "span_start": 13, - "span_end": 20, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "8101338770016324ce05d61daa9935a444c75e6c94a0fae4275d5b50fcbcc70b", - "edge_type": "dataflow_slice", - "src_symbol_id": "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "src_qname": "WorkflowEngine.__init__", - "dst_symbol_id": "a12cad0f5b238287e02f6d8d156cc764351d8c83246930487fa09d5ce6f2ace8", - "dst_ref": "WorkflowEngine.run", - "resolution": "resolved", - "slice_id": "8101338770016324ce05d61daa9935a444c75e6c94a0fae4275d5b50fcbcc70b", - "root_symbol_id": "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "path_symbols": [ - "WorkflowEngine.__init__", - "WorkflowEngine._persistence", - "WorkflowEngine.run" - ], - "path_symbol_ids": [ - "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "a12cad0f5b238287e02f6d8d156cc764351d8c83246930487fa09d5ce6f2ace8" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "1057136e58a325cd5ab6f4e265d15665fb6a711b7022d9fab52a1a290afa2368", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/engine/workflow_engine.py", - "content": "WorkflowEngine.__init__\n -> WorkflowEngine._traces\n -> WorkflowEngine.run", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "WorkflowEngine.__init__:dataflow_slice", - "span_start": 15, - "span_end": 27, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "5006266616d534d721648391565e2ac0c9e7e9d9f8df00c17fba8989afb533a5", - "edge_type": "dataflow_slice", - "src_symbol_id": "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "src_qname": "WorkflowEngine.__init__", - "dst_symbol_id": "a12cad0f5b238287e02f6d8d156cc764351d8c83246930487fa09d5ce6f2ace8", - "dst_ref": "WorkflowEngine.run", - "resolution": "resolved", - "slice_id": "5006266616d534d721648391565e2ac0c9e7e9d9f8df00c17fba8989afb533a5", - "root_symbol_id": "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "path_symbols": [ - "WorkflowEngine.__init__", - "WorkflowEngine._traces", - "WorkflowEngine.run" - ], - "path_symbol_ids": [ - "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "a12cad0f5b238287e02f6d8d156cc764351d8c83246930487fa09d5ce6f2ace8" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "1057136e58a325cd5ab6f4e265d15665fb6a711b7022d9fab52a1a290afa2368", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/engine/workflow_engine.py", - "content": "WorkflowEngine.__init__\n -> WorkflowEngine._logger\n -> WorkflowEngine.run", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "WorkflowEngine.__init__:dataflow_slice", - "span_start": 17, - "span_end": 85, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "2f9927abb24794adb056b94bfb5d8538a5cbafb160da2079f52fca97fd694a2b", - "edge_type": "dataflow_slice", - "src_symbol_id": "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "src_qname": "WorkflowEngine.__init__", - "dst_symbol_id": "a12cad0f5b238287e02f6d8d156cc764351d8c83246930487fa09d5ce6f2ace8", - "dst_ref": "WorkflowEngine.run", - "resolution": "resolved", - "slice_id": "2f9927abb24794adb056b94bfb5d8538a5cbafb160da2079f52fca97fd694a2b", - "root_symbol_id": "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "path_symbols": [ - "WorkflowEngine.__init__", - "WorkflowEngine._logger", - "WorkflowEngine.run" - ], - "path_symbol_ids": [ - "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "a12cad0f5b238287e02f6d8d156cc764351d8c83246930487fa09d5ce6f2ace8" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "1057136e58a325cd5ab6f4e265d15665fb6a711b7022d9fab52a1a290afa2368", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/engine/workflow_engine.py", - "content": "class WorkflowEngine:\n def __init__(self, workflow, persistence, *, traces, hooks: WorkflowEngineHooks | None = None) -> None:\n self._workflow = workflow\n self._persistence = persistence\n self._transition_resolver = TransitionResolver()\n self._traces = traces\n self._hooks = hooks or WorkflowEngineHooks()\n self._logger = logging.getLogger(__name__)\n\n def run(self, context: WorkflowContext) -> dict[str, object]:\n run_id = self._persistence.start_run(\n self._workflow.definition.name,\n self._workflow.definition.start_at,\n context.snapshot(),\n )\n context.state.setdefault(\"runtime\", {})\n context.state[\"runtime\"][\"workflow_run_id\"] = run_id\n self._traces.step(\"workflow\")\n self._traces.info(\"Workflow started.\", status=\"started\", attrs={\"workflow_run_id\": run_id})\n current_name = self._workflow.definition.start_at\n while current_name is not None:\n node = self._workflow.definition.nodes[current_name]\n context.state[\"runtime\"][\"current_node\"] = current_name\n self._logger.info(\"Workflow run %s: step '%s' started.\", run_id, current_name)\n self._hooks.on_step_started(context, current_name)\n self._persistence.start_step(run_id, current_name, context.snapshot())\n self._traces.step(current_name)\n self._traces.debug(\n f\"Step '{current_name}' started.\",\n status=\"started\",\n attrs={\"workflow_run_id\": run_id, \"node\": current_name},\n )\n try:\n result = node.step.run(context)\n except Exception as error:\n self._persistence.fail_step(run_id, current_name, context.snapshot(), error)\n self._persistence.fail_run(run_id, context.snapshot())\n self._traces.error(\n f\"Step '{current_name}' failed: {error}\",\n status=\"failed\",\n attrs={\"exception_type\": type(error).__name__},\n )\n self._logger.exception(\"Workflow run %s: step '%s' failed.\", run_id, current_name)\n self._hooks.on_step_failed(context, current_name)\n raise\n context.state.update(result.updates)\n self._persistence.complete_step(\n run_id,\n current_name,\n result.status,\n result.transition,\n context.snapshot(),\n )\n next_node = self._transition_resolver.resolve(node, result)\n self._traces.debug(\n f\"Step '{current_name}' completed with transition '{result.transition}'.\",\n status=result.status,\n attrs={\n \"workflow_run_id\": run_id,\n \"from_node\": current_name,\n \"transition\": result.transition,\n \"to_node\": next_node,\n },\n )\n self._logger.info(\n \"Workflow run %s: step '%s' completed with transition '%s'.\",\n run_id,\n current_name,\n result.transition,\n )\n self._hooks.on_step_finished(context, current_name)\n current_name = next_node\n self._persistence.complete_run(run_id, context.snapshot())\n self._traces.step(\"workflow\")\n self._traces.info(\"Workflow completed.\", status=\"completed\", attrs={\"workflow_run_id\": run_id})\n self._logger.info(\"Workflow run %s completed.\", run_id)\n return {\"run_id\": run_id, \"status\": \"completed\", \"context\": context.snapshot()}", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/workflow/engine/workflow_engine.py:WorkflowEngine", - "span_start": 10, - "span_end": 86, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.workflow.engine.workflow_engine", - "is_test": false, - "blob_sha": "1057136e58a325cd5ab6f4e265d15665fb6a711b7022d9fab52a1a290afa2368", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ] - }, - "diagnostics": { - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C0_SOURCE_CHUNKS": "exact_path_fetch", - "C4_SEMANTIC_ROLES": "exact_path_fetch", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C3_ENTRYPOINTS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 8, - "C4_SEMANTIC_ROLES": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C3_ENTRYPOINTS": 6 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C4_SEMANTIC_ROLES": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "WorkflowEngine", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "WorkflowEngine", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C4_SEMANTIC_ROLES", - "query": "WorkflowEngine", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "WorkflowEngine", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - }, - { - "layer": "C3_ENTRYPOINTS", - "query": "WorkflowEngine", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 2, - "candidates_after_filter": 2 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 6, - "candidates_after_filter": 6 - }, - { - "layer": "C3_ENTRYPOINTS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 3, - "candidates_after_filter": 3 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "WorkflowEngine", - "alternatives": [ - "WorkflowEngine", - "WorkflowEngineHooks" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "hit", - "hit_count": 2, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C4_SEMANTIC_ROLES", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 6, - "fail_reason": null - }, - { - "layer": "C3_ENTRYPOINTS", - "status": "hit", - "hit_count": 3, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "symbol_resolution": 0, - "retrieval_total": 129, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 39, - "C0_SOURCE_CHUNKS": 15, - "C4_SEMANTIC_ROLES": 17, - "C2_DEPENDENCY_GRAPH": 45, - "C3_ENTRYPOINTS": 10 - }, - "merge_rank": 37 - } - } - }, - { - "step": "llm_answer", - "input": { - "query": "Объясни класс WorkflowEngine", - "rag_count": 13 - }, - "output": { - "llm_answer": "## Назначение класса `WorkflowEngine`\n\nКласс `WorkflowEngine` является основным компонентом инфраструктуры выполнения рабочих процессов (`workflow`) в приложении. Он отвечает за координацию и управление жизненным циклом рабочего процесса, включая отслеживание текущего состояния выполнения, взаимодействие с хранилищем для сохранения промежуточных результатов и взаимодействия с внешними компонентами через логирование и трассировку.\n\n## Ключевые зависимости\n\n### 1. Зависимости по модулям и библиотекам\n- **src/app_runtime/workflow/engine/workflow_engine.py**: основной файл, содержащий определение класса `WorkflowEngine`.\n- **src/app_runtime/workflow/engine/hooks.py**: модуль, предоставляющий механизмы расширения функциональности через интерфейс `WorkflowEngineHooks`, позволяющий разработчикам внедрять дополнительные действия перед началом, во время выполнения и после завершения этапов рабочего процесса.\n\n### 2. Основные объекты, используемые внутри класса\n- **workflow**: объект, представляющий рабочий процесс, который будет выполняться.\n- **persistence**: механизм хранения состояний рабочих процессов, обычно реализованный через базы данных или системы управления событиями.\n- **traces**: инструмент трассировки, предназначенный для мониторинга хода выполнения рабочего процесса и его шагов.\n- **hooks**: дополнительные модули расширений, которые могут быть подключены к рабочему процессу.\n\n## Поток данных или вызовов\n\nПри запуске экземпляра класса `WorkflowEngine` вызывается метод `run()`. Этот метод выполняет следующие шаги:\n\n1. **Инициализация выполнения**:\n - Вызывается метод `_transition_resolver`, который отвечает за разрешение переходов между узлами рабочего процесса.\n - Создаётся идентификатор текущей рабочей сессии при помощи метода `start_run()` из объекта persistence.\n \n2. **Запуск основного цикла исполнения**:\n - Основной цикл использует переменную `current_name`, которая представляет текущий этап выполнения рабочего процесса.\n - В каждом шаге выполняется следующий узел (`node`), определяется его текущее состояние и фиксируется текущая точка выполнения в контексте выполнения.\n\n3. **Завершение выполнения**:\n - После завершения последнего этапа рабочего процесса происходит запись информации о завершении в хранилище и регистрация этого события в системе трассировки.\n\n## Важные детали реализации\n\n### 1. Логика работы узлов (`nodes`)\n- Метод `run()` последовательно обрабатывает узлы рабочего процесса до тех пор, пока не завершится выполнение всех заданных задач.\n- Узлы являются основными элементами рабочего процесса и определяют последовательность действий и переходы между ними.\n\n### 2. Обработка контекста выполнения\n- Контекст выполнения хранится в виде словаря (`context.state`), что позволяет сохранять промежуточные результаты и информацию о текущем состоянии выполнения рабочего процесса.\n\n### 3. Использование внешних механизмов\n- Класс поддерживает внешние расширения через интерфейс `WorkflowEngineHooks`, позволяя разработчикам добавлять свою бизнес-логику без изменения базовой структуры рабочего процесса.\n\n### Осторожные выводы\nНа основании текущих данных невозможно точно определить все подробности внутреннего устройства каждого узла рабочего процесса (`nodes`) и алгоритмы разрешения переходов. Однако, исходя из доступной информации, можно предположить, что узлы рабочего процесса содержат некоторую внутреннюю логику, позволяющую автоматически разрешать возможные переходы между этапами. Это предположение основано на косвенных признаках и не подтверждено прямым анализом исходного кода этих узлов." - }, - "diagnostics": { - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 780, - "evidence_rows": 13, - "evidence_chars": 4423 - }, - "evidence_summary": [ - { - "layer": "C1_SYMBOL_CATALOG", - "count": 2, - "unique_paths": 2 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "count": 6, - "unique_paths": 1 - }, - { - "layer": "C3_ENTRYPOINTS", - "count": 3, - "unique_paths": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 1, - "unique_paths": 1 - } - ], - "prompt_template_id": "intent_code_qa_explain_ru_v1", - "system_prompt_version": "v1" - }, - "timings_ms": { - "prompt_build": 0, - "llm_call": 4657 - } - } - } - ] - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_114413/full_chain_plba_code_retrieval_plba-fullchain-explain-workflow-engine.md b/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_114413/full_chain_plba_code_retrieval_plba-fullchain-explain-workflow-engine.md deleted file mode 100644 index 6ecb144..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_114413/full_chain_plba_code_retrieval_plba-fullchain-explain-workflow-engine.md +++ /dev/null @@ -1,34 +0,0 @@ -# plba-fullchain-explain-workflow-engine - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_retrieval.yaml -- runner: runtime -- mode: full_chain -- passed: True - -## Query -Объясни класс WorkflowEngine - -## Actual -{ - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 13, - "llm_answer": "## Назначение класса `WorkflowEngine`\n\nКласс `WorkflowEngine` является основным компонентом инфраструктуры выполнения рабочих процессов (`workflow`) в приложении. Он отвечает за координацию и управление жизненным циклом рабочего процесса, включая отслеживание текущего состояния выполнения, взаимодействие с хранилищем для сохранения промежуточных результатов и взаимодействия с внешними компонентами через логирование и трассировку.\n\n## Ключевые зависимости\n\n### 1. Зависимости по модулям и библиотекам\n- **src/app_runtime/workflow/engine/workflow_engine.py**: основной файл, содержащий определение класса `WorkflowEngine`.\n- **src/app_runtime/workflow/engine/hooks.py**: модуль, предоставляющий механизмы расширения функциональности через интерфейс `WorkflowEngineHooks`, позволяющий разработчикам внедрять дополнительные действия перед началом, во время выполнения и после завершения этапов рабочего процесса.\n\n### 2. Основные объекты, используемые внутри класса\n- **workflow**: объект, представляющий рабочий процесс, который будет выполняться.\n- **persistence**: механизм хранения состояний рабочих процессов, обычно реализованный через базы данных или системы управления событиями.\n- **traces**: инструмент трассировки, предназначенный для мониторинга хода выполнения рабочего процесса и его шагов.\n- **hooks**: дополнительные модули расширений, которые могут быть подключены к рабочему процессу.\n\n## Поток данных или вызовов\n\nПри запуске экземпляра класса `WorkflowEngine` вызывается метод `run()`. Этот метод выполняет следующие шаги:\n\n1. **Инициализация выполнения**:\n - Вызывается метод `_transition_resolver`, который отвечает за разрешение переходов между узлами рабочего процесса.\n - Создаётся идентификатор текущей рабочей сессии при помощи метода `start_run()` из объекта persistence.\n \n2. **Запуск основного цикла исполнения**:\n - Основной цикл использует переменную `current_name`, которая представляет текущий этап выполнения рабочего процесса.\n - В каждом шаге выполняется следующий узел (`node`), определяется его текущее состояние и фиксируется текущая точка выполнения в контексте выполнения.\n\n3. **Завершение выполнения**:\n - После завершения последнего этапа рабочего процесса происходит запись информации о завершении в хранилище и регистрация этого события в системе трассировки.\n\n## Важные детали реализации\n\n### 1. Логика работы узлов (`nodes`)\n- Метод `run()` последовательно обрабатывает узлы рабочего процесса до тех пор, пока не завершится выполнение всех заданных задач.\n- Узлы являются основными элементами рабочего процесса и определяют последовательность действий и переходы между ними.\n\n### 2. Обработка контекста выполнения\n- Контекст выполнения хранится в виде словаря (`context.state`), что позволяет сохранять промежуточные результаты и информацию о текущем состоянии выполнения рабочего процесса.\n\n### 3. Использование внешних механизмов\n- Класс поддерживает внешние расширения через интерфейс `WorkflowEngineHooks`, позволяя разработчикам добавлять свою бизнес-логику без изменения базовой структуры рабочего процесса.\n\n### Осторожные выводы\nНа основании текущих данных невозможно точно определить все подробности внутреннего устройства каждого узла рабочего процесса (`nodes`) и алгоритмы разрешения переходов. Однако, исходя из доступной информации, можно предположить, что узлы рабочего процесса содержат некоторую внутреннюю логику, позволяющую автоматически разрешать возможные переходы между этапами. Это предположение основано на косвенных признаках и не подтверждено прямым анализом исходного кода этих узлов.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "WorkflowEngine" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] -} - -## Mismatches -- none \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_114413/summary.md b/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_114413/summary.md deleted file mode 100644 index 99490b8..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_114413/summary.md +++ /dev/null @@ -1,20 +0,0 @@ -# pipeline_setup_v2 summary - -Passed: 6/6 - -| File | Case | Runner | Mode | Intent | Sub-intent | Pass | -|------|------|--------|------|--------|------------|------| -| full_chain_plba_code_retrieval.yaml | plba-fullchain-explain-runtime-manager | runtime | full_chain | CODE_QA | EXPLAIN | ✓ | -| full_chain_plba_code_retrieval.yaml | plba-fullchain-explain-http-control-channel | runtime | full_chain | CODE_QA | EXPLAIN | ✓ | -| full_chain_plba_code_retrieval.yaml | plba-fullchain-explain-control-plane-service | runtime | full_chain | CODE_QA | EXPLAIN | ✓ | -| full_chain_plba_code_retrieval.yaml | plba-fullchain-explain-trace-service | runtime | full_chain | CODE_QA | EXPLAIN | ✓ | -| full_chain_plba_code_retrieval.yaml | plba-fullchain-explain-create-runtime | runtime | full_chain | CODE_QA | EXPLAIN | ✓ | -| full_chain_plba_code_retrieval.yaml | plba-fullchain-explain-workflow-engine | runtime | full_chain | CODE_QA | EXPLAIN | ✓ | - -## LLM Answers -- **plba-fullchain-explain-runtime-manager**: ## Назначение класса `RuntimeManager` Класс `RuntimeManager` играет роль центрального менеджера для управления жизненным циклом различных компонентов приложения runtime. Он отвечает за координацию и интеграцию этих компонентов, а также управляет их состоянием через атрибуты экземпляра. ## Ключевые зависимости Ключевыми компонентами, с которыми взаимодействует `RuntimeManager`, являются: - `ConfigurationManager`: управление конфигурацией приложения. - `ServiceContainer`: контейнер сервисов, используемых приложением. - `TraceService`: сервис отслеживания трассировок выполнения задач. - `HealthRegistry`: реестр текущего состояния здоровья системы. - `LogManager`: менеджер логирования событий. - `WorkerSupervisor`: супервизор рабочих процессов. - `ControlPlaneService`: служба управления планом контроля выполнения задач. ## Поток данных или вызовов При инициализации объек… -- **plba-fullchain-explain-http-control-channel**: ## Объяснение сущности `HttpControlChannel` ### Назначение Класс `HttpControlChannel` является компонентом конвейера приложения, ответственным за управление состоянием через HTTP-запросы. Он участвует в обработке запросов к приложению, обеспечивает маршрутизацию и выполнение действий, связанных с управлением состояниями и конфигурацией системы. ### Ключевые зависимости - **host**: строка, представляющая хост для сервера. - **port**: целое число, представляющее порт для сервера. - **timeout**: целое число, задающее таймаут выполнения операций. ### Поток данных или вызовов 1. **Инициализация (`__init__`)** - При создании экземпляра класса происходит инициализация полей `_timeout`, `_runner` и `_factory`. Поле `_runner` представляет собой объект типа `UvicornThreadRunner`, отвечающий за запуск веб-сервера на указанном хосте и порте. Поле `_factory` отвечает за создание… -- **plba-fullchain-explain-control-plane-service**: ## Объяснение сущности `ControlPlaneService` ### Назначение `ControlPlaneService` — это сервисная сущность, ответственная за управление каналами (`ControlChannel`) и выполнение действий по управлению жизненным циклом приложения, таких как запуск, остановка и мониторинг состояния системы. ### Ключевые зависимости - **`ControlChannel`**: Канал управления, через который передаются сообщения о событиях и действиях. - **`RuntimeManager`**: Менеджер выполнения среды исполнения, содержащий состояние и другие объекты для работы с приложением. - **`ControlActionSet`**: Набор действий, которые могут быть выполнены при управлении состоянием системы. ### Поток данных или вызовов 1. **Инициализация** (`__init__`) - Инициализирует пустой список каналов `_channels`. 2. **Регистрация канала** (`register_channel`) - Добавляет новый канал в список зарегистрированных каналов. 3. **Запу… -- **plba-fullchain-explain-trace-service**: ## Объяснение работы `TraceService` ### Назначение `TraceService` — это компонент, отвечающий за управление контекстом трассировки и запись логических событий во время выполнения приложения. Он служит для создания, хранения и записи трассировочных записей (`trace records`) и сообщений логирования (`log messages`), связанных с выполнением различных операций. ### Ключевые зависимости - **TraceContextFactory**: Базовый класс, от которого наследуется `TraceService`. Предоставляет методы для управления контекстом трассировки. - **TraceTransport**: Интерфейс, определяющий транспорт для передачи трассировочной информации внешним системам или службам. - **TraceContextStore**: Хранит контексты трассировок. - **NoOpTraceTransport**: Специальная реализация транспорта без реальных действий, используется по умолчанию при отсутствии указания конкретного транспорта. ### Поток данны… -- **plba-fullchain-explain-create-runtime**: ## Функциональное назначение сущности `create_runtime` Функция `create_runtime` предназначена для инициализации и настройки окружения выполнения (`runtime environment`) приложения. Она создает объект типа `RuntimeManager`, регистрирует указанный модуль (`module`) и при необходимости добавляет конфигурационные файлы и каналы управления через HTTP. ## Ключевые зависимости - **src/plba/bootstrap.py**: основной файл, содержащий реализацию функции `create_runtime`. - **RuntimeManager**: класс, управляющий состоянием и функциональностью runtime-среды. - **ApplicationModule**: абстрактный тип модуля приложения, передаваемый в функцию. - **HttpControlChannel**: компонент, обеспечивающий управление приложением по HTTP с заданными параметрами хоста, порта и тайм-аута. ## Поток данных или вызовов 1. Функция `create_runtime` принимает несколько аргументов: - `module`: экземпляр… -- **plba-fullchain-explain-workflow-engine**: ## Назначение класса `WorkflowEngine` Класс `WorkflowEngine` является основным компонентом инфраструктуры выполнения рабочих процессов (`workflow`) в приложении. Он отвечает за координацию и управление жизненным циклом рабочего процесса, включая отслеживание текущего состояния выполнения, взаимодействие с хранилищем для сохранения промежуточных результатов и взаимодействия с внешними компонентами через логирование и трассировку. ## Ключевые зависимости ### 1. Зависимости по модулям и библиотекам - **src/app_runtime/workflow/engine/workflow_engine.py**: основной файл, содержащий определение класса `WorkflowEngine`. - **src/app_runtime/workflow/engine/hooks.py**: модуль, предоставляющий механизмы расширения функциональности через интерфейс `WorkflowEngineHooks`, позволяющий разработчикам внедрять дополнительные действия перед началом, во время выполнения и после заверш… \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_114552/full_chain_plba_code_retrieval_plba-fullchain-explain-control-plane-service.json b/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_114552/full_chain_plba_code_retrieval_plba-fullchain-explain-control-plane-service.json deleted file mode 100644 index 287dba7..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_114552/full_chain_plba_code_retrieval_plba-fullchain-explain-control-plane-service.json +++ /dev/null @@ -1,2056 +0,0 @@ -{ - "case_id": "plba-fullchain-explain-control-plane-service", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_retrieval.yaml", - "runner": "runtime", - "mode": "full_chain", - "actual": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 12, - "llm_answer": "## Объяснение сущности `ControlPlaneService`\n\n### Назначение\n`ControlPlaneService` — это сервис управления данными и состоянием приложения. Он отвечает за координацию различных каналов (`ControlChannel`) и управление жизненным циклом работы компонентов системы. Сервис также участвует в обработке срезов данных (`dataflow slices`), что указывает на его роль в общем потоке выполнения и управлении ресурсами.\n\n### Ключевые зависимости\nКлючевой зависимостью является наличие списка каналов (`_channels`), через которые осуществляется взаимодействие с компонентами системы. Важными методами являются инициализация сервиса (`__init__`), регистрация новых каналов (`register_channel`), запуск (`start`) и остановка (`stop`) сервисов, а также создание снимка текущего состояния (`snapshot`).\n\n### Поток данных или вызовов\nПри создании объекта класса вызывается метод `__init__`, который инициализирует список каналов `_channels`. Далее возможны следующие сценарии использования:\n\n1. **Регистрация канала**:\n - Метод `register_channel` добавляет новый канал в список доступных для взаимодействия.\n \n2. **Запуск сервиса**:\n - Вызов метода `start` инициирует асинхронный запуск всех зарегистрированных каналов через внутренний метод `_start_async`.\n - В рамках запуска проверяется наличие каналов и состояние системы, после чего выполняется запуск соответствующих действий.\n\n3. **Остановка сервиса**:\n - Метод `stop` инициирует остановку всех запущенных каналов через асинхронную функцию `_stop_async`.\n\n4. **Создание снимка состояния**:\n - Метод `snapshot` возвращает текущее состояние системы, включая информацию о здоровье и конфигурации.\n\n### Важные детали реализации\n- Использование асинхронного подхода (через `asyncio.run`) позволяет эффективно управлять параллельными задачами и каналами.\n- Состояние каналов сохраняется в виде списка объектов `ControlChannel`, каждый из которых может иметь свои специфические настройки и поведение.\n- Все действия, связанные с управлением каналами и их запуском/остановкой, выполняются синхронно внутри методов сервиса, несмотря на асинхронность вызова.\n \n### Осторожные выводы\nНа основе предоставленных фрагментов сложно точно определить, какие именно каналы участвуют в работе сервиса и какую дополнительную логику они реализуют. Также нет информации о том, каким образом методы, указанные в сигнатуре (`health`, `start`, `stop`), связаны с конкретными действиями и какова их реализация вне данного контекста.\n\n---\n\nТаким образом, `ControlPlaneService` представляет собой ключевой элемент инфраструктуры, отвечающий за координацию работы различных каналов и системных компонентов, обеспечивая контроль над состоянием и поведением системы.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "ControlPlaneService" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "passed": true, - "mismatches": [], - "details": { - "case_id": "plba-fullchain-explain-control-plane-service", - "text": "Объясни класс ControlPlaneService", - "mode": "full_chain", - "run_started_at": "2026-03-12T11:45:52", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Объясни класс ControlPlaneService", - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "ControlPlaneService", - "alternatives": [ - "ControlPlaneService" - ], - "confidence": 0.99 - }, - "rag_count": 12, - "rag_rows": [ - { - "path": "src/app_runtime/control/service.py", - "content": "class ControlPlaneService\nControlPlaneService", - "layer": "C1_SYMBOL_CATALOG", - "title": "ControlPlaneService", - "span_start": 12, - "span_end": 52, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "b13471e5916986dccffb53fab613812842965705e6b3a89ae549d30c9e91e9aa", - "qname": "ControlPlaneService", - "kind": "class", - "signature": "ControlPlaneService", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.control.service", - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests service\n- reads and writes state attributes\n- participates in dataflow slices (5)", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlPlaneService", - "span_start": 12, - "span_end": 52, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 68, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "b13471e5916986dccffb53fab613812842965705e6b3a89ae549d30c9e91e9aa", - "symbol_name": "ControlPlaneService", - "qname": "ControlPlaneService", - "role": "pipeline_stage", - "confidence": 0.57, - "dataflow_participation": 5, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.stop", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 25, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d", - "dst_ref": "ControlPlaneService.stop", - "resolution": "resolved", - "slice_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.stop" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._stop_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 51, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a", - "dst_ref": "ControlPlaneService._stop_async", - "resolution": "resolved", - "slice_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._stop_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.register_channel", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 17, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957", - "dst_ref": "ControlPlaneService.register_channel", - "resolution": "resolved", - "slice_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.register_channel" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.start", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 20, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154", - "dst_ref": "ControlPlaneService.start", - "resolution": "resolved", - "slice_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.start" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._start_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 47, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517", - "dst_ref": "ControlPlaneService._start_async", - "resolution": "resolved", - "slice_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._start_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.register_channel reads_attr self._channels.append", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.register_channel:reads_attr", - "span_start": 17, - "span_end": 17, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "1ee5925deffdc38ba15b88bf7c89e5fcd1a78f493fe30f2deb827d714a1b18e8", - "edge_type": "reads_attr", - "src_symbol_id": "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957", - "src_qname": "ControlPlaneService.register_channel", - "dst_symbol_id": null, - "dst_ref": "self._channels.append", - "resolution": "partial", - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "class ControlPlaneService:\n def __init__(self) -> None:\n self._channels: list[ControlChannel] = []\n\n def register_channel(self, channel: ControlChannel) -> None:\n self._channels.append(channel)\n\n def start(self, runtime: RuntimeManager) -> None:\n if not self._channels:\n return\n asyncio.run(self._start_async(runtime))\n\n def stop(self) -> None:\n if not self._channels:\n return\n asyncio.run(self._stop_async())\n\n def snapshot(self, runtime: RuntimeManager) -> dict[str, object]:\n health = runtime.current_health()\n return {\n \"runtime\": {\"state\": runtime._state.value},\n \"modules\": list(runtime.registry.modules),\n \"services\": runtime.services.snapshot(),\n \"workers\": runtime.workers.snapshot(),\n \"health\": runtime.health.snapshot(runtime.workers.healths()) | {\"status\": health[\"status\"]},\n \"config\": runtime.configuration.get(),\n }\n\n async def _start_async(self, runtime: RuntimeManager) -> None:\n actions = ControlActionSet(\n health=runtime.health_status,\n start=runtime.start_runtime,\n stop=runtime.stop_runtime,\n status=runtime.runtime_status,\n )\n for channel in self._channels:\n await channel.start(actions)\n\n async def _stop_async(self) -> None:\n for channel in reversed(self._channels):\n await channel.stop()", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/service.py:ControlPlaneService", - "span_start": 12, - "span_end": 52, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.service", - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "llm_answer": "## Объяснение сущности `ControlPlaneService`\n\n### Назначение\n`ControlPlaneService` — это сервис управления данными и состоянием приложения. Он отвечает за координацию различных каналов (`ControlChannel`) и управление жизненным циклом работы компонентов системы. Сервис также участвует в обработке срезов данных (`dataflow slices`), что указывает на его роль в общем потоке выполнения и управлении ресурсами.\n\n### Ключевые зависимости\nКлючевой зависимостью является наличие списка каналов (`_channels`), через которые осуществляется взаимодействие с компонентами системы. Важными методами являются инициализация сервиса (`__init__`), регистрация новых каналов (`register_channel`), запуск (`start`) и остановка (`stop`) сервисов, а также создание снимка текущего состояния (`snapshot`).\n\n### Поток данных или вызовов\nПри создании объекта класса вызывается метод `__init__`, который инициализирует список каналов `_channels`. Далее возможны следующие сценарии использования:\n\n1. **Регистрация канала**:\n - Метод `register_channel` добавляет новый канал в список доступных для взаимодействия.\n \n2. **Запуск сервиса**:\n - Вызов метода `start` инициирует асинхронный запуск всех зарегистрированных каналов через внутренний метод `_start_async`.\n - В рамках запуска проверяется наличие каналов и состояние системы, после чего выполняется запуск соответствующих действий.\n\n3. **Остановка сервиса**:\n - Метод `stop` инициирует остановку всех запущенных каналов через асинхронную функцию `_stop_async`.\n\n4. **Создание снимка состояния**:\n - Метод `snapshot` возвращает текущее состояние системы, включая информацию о здоровье и конфигурации.\n\n### Важные детали реализации\n- Использование асинхронного подхода (через `asyncio.run`) позволяет эффективно управлять параллельными задачами и каналами.\n- Состояние каналов сохраняется в виде списка объектов `ControlChannel`, каждый из которых может иметь свои специфические настройки и поведение.\n- Все действия, связанные с управлением каналами и их запуском/остановкой, выполняются синхронно внутри методов сервиса, несмотря на асинхронность вызова.\n \n### Осторожные выводы\nНа основе предоставленных фрагментов сложно точно определить, какие именно каналы участвуют в работе сервиса и какую дополнительную логику они реализуют. Также нет информации о том, каким образом методы, указанные в сигнатуре (`health`, `start`, `stop`), связаны с конкретными действиями и какова их реализация вне данного контекста.\n\n---\n\nТаким образом, `ControlPlaneService` представляет собой ключевой элемент инфраструктуры, отвечающий за координацию работы различных каналов и системных компонентов, обеспечивая контроль над состоянием и поведением системы.", - "summary": { - "router": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "confidence": null - }, - "retrieval": { - "profile": "code", - "layers_hit": [ - "C0_SOURCE_CHUNKS", - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS", - "C4_SEMANTIC_ROLES" - ], - "evidence_sufficient": true - }, - "llm": { - "answer_status": "answered", - "groundedness": "grounded" - } - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "ControlPlaneService" - ], - "keyword_hints": [ - "ControlPlaneService" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C0_SOURCE_CHUNKS": "exact_path_fetch", - "C4_SEMANTIC_ROLES": "exact_path_fetch", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C3_ENTRYPOINTS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 8, - "C4_SEMANTIC_ROLES": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C3_ENTRYPOINTS": 6 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C4_SEMANTIC_ROLES": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "ControlPlaneService", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "ControlPlaneService", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C4_SEMANTIC_ROLES", - "query": "ControlPlaneService", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "ControlPlaneService", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - }, - { - "layer": "C3_ENTRYPOINTS", - "query": "ControlPlaneService", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 1, - "candidates_after_filter": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 6, - "candidates_after_filter": 6 - }, - { - "layer": "C3_ENTRYPOINTS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 3, - "candidates_after_filter": 3 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "ControlPlaneService", - "alternatives": [ - "ControlPlaneService" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C4_SEMANTIC_ROLES", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 6, - "fail_reason": null - }, - { - "layer": "C3_ENTRYPOINTS", - "status": "hit", - "hit_count": 3, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "router": 0, - "symbol_resolution": 0, - "retrieval_total": 146, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 45, - "C0_SOURCE_CHUNKS": 17, - "C4_SEMANTIC_ROLES": 15, - "C2_DEPENDENCY_GRAPH": 55, - "C3_ENTRYPOINTS": 11 - }, - "merge_rank": 24, - "prompt_build": 0, - "llm_call": 3832 - }, - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 797, - "evidence_rows": 12, - "evidence_chars": 2301 - }, - "evidence_summary": [ - { - "layer": "C1_SYMBOL_CATALOG", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "count": 6, - "unique_paths": 1 - }, - { - "layer": "C3_ENTRYPOINTS", - "count": 3, - "unique_paths": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 1, - "unique_paths": 1 - } - ], - "prompt_template_id": "intent_code_qa_explain_ru_v1", - "system_prompt_version": "v1" - }, - "router": { - "conversation_mode": "START", - "keyword_hints": [ - "ControlPlaneService" - ], - "path_scope": [] - }, - "llm": { - "used_evidence_count": 12, - "missing_evidence_reason": null - } - }, - "run_info": { - "case_id": "plba-fullchain-explain-control-plane-service", - "mode": "full_chain", - "run_started_at": "2026-03-12T11:45:52", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - }, - "input_request": { - "text": "Объясни класс ControlPlaneService", - "normalized_query": "Объясни класс ControlPlaneService" - }, - "steps": [ - { - "step": "intent_router", - "input": { - "query": "Объясни класс ControlPlaneService" - }, - "output": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Объясни класс ControlPlaneService" - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "ControlPlaneService" - ], - "keyword_hints": [ - "ControlPlaneService" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "timings_ms": { - "router": 0 - } - } - }, - { - "step": "retrieval", - "input": { - "query": "Объясни класс ControlPlaneService" - }, - "output": { - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "ControlPlaneService", - "alternatives": [ - "ControlPlaneService" - ], - "confidence": 0.99 - }, - "rag_count": 12, - "rag_rows": [ - { - "path": "src/app_runtime/control/service.py", - "content": "class ControlPlaneService\nControlPlaneService", - "layer": "C1_SYMBOL_CATALOG", - "title": "ControlPlaneService", - "span_start": 12, - "span_end": 52, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "b13471e5916986dccffb53fab613812842965705e6b3a89ae549d30c9e91e9aa", - "qname": "ControlPlaneService", - "kind": "class", - "signature": "ControlPlaneService", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.control.service", - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests service\n- reads and writes state attributes\n- participates in dataflow slices (5)", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlPlaneService", - "span_start": 12, - "span_end": 52, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 68, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "b13471e5916986dccffb53fab613812842965705e6b3a89ae549d30c9e91e9aa", - "symbol_name": "ControlPlaneService", - "qname": "ControlPlaneService", - "role": "pipeline_stage", - "confidence": 0.57, - "dataflow_participation": 5, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.stop", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 25, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d", - "dst_ref": "ControlPlaneService.stop", - "resolution": "resolved", - "slice_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.stop" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._stop_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 51, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a", - "dst_ref": "ControlPlaneService._stop_async", - "resolution": "resolved", - "slice_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._stop_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.register_channel", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 17, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957", - "dst_ref": "ControlPlaneService.register_channel", - "resolution": "resolved", - "slice_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.register_channel" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.start", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 20, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154", - "dst_ref": "ControlPlaneService.start", - "resolution": "resolved", - "slice_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.start" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._start_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 47, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517", - "dst_ref": "ControlPlaneService._start_async", - "resolution": "resolved", - "slice_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._start_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.register_channel reads_attr self._channels.append", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.register_channel:reads_attr", - "span_start": 17, - "span_end": 17, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "1ee5925deffdc38ba15b88bf7c89e5fcd1a78f493fe30f2deb827d714a1b18e8", - "edge_type": "reads_attr", - "src_symbol_id": "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957", - "src_qname": "ControlPlaneService.register_channel", - "dst_symbol_id": null, - "dst_ref": "self._channels.append", - "resolution": "partial", - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "class ControlPlaneService:\n def __init__(self) -> None:\n self._channels: list[ControlChannel] = []\n\n def register_channel(self, channel: ControlChannel) -> None:\n self._channels.append(channel)\n\n def start(self, runtime: RuntimeManager) -> None:\n if not self._channels:\n return\n asyncio.run(self._start_async(runtime))\n\n def stop(self) -> None:\n if not self._channels:\n return\n asyncio.run(self._stop_async())\n\n def snapshot(self, runtime: RuntimeManager) -> dict[str, object]:\n health = runtime.current_health()\n return {\n \"runtime\": {\"state\": runtime._state.value},\n \"modules\": list(runtime.registry.modules),\n \"services\": runtime.services.snapshot(),\n \"workers\": runtime.workers.snapshot(),\n \"health\": runtime.health.snapshot(runtime.workers.healths()) | {\"status\": health[\"status\"]},\n \"config\": runtime.configuration.get(),\n }\n\n async def _start_async(self, runtime: RuntimeManager) -> None:\n actions = ControlActionSet(\n health=runtime.health_status,\n start=runtime.start_runtime,\n stop=runtime.stop_runtime,\n status=runtime.runtime_status,\n )\n for channel in self._channels:\n await channel.start(actions)\n\n async def _stop_async(self) -> None:\n for channel in reversed(self._channels):\n await channel.stop()", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/service.py:ControlPlaneService", - "span_start": 12, - "span_end": 52, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.service", - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ] - }, - "diagnostics": { - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C0_SOURCE_CHUNKS": "exact_path_fetch", - "C4_SEMANTIC_ROLES": "exact_path_fetch", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C3_ENTRYPOINTS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 8, - "C4_SEMANTIC_ROLES": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C3_ENTRYPOINTS": 6 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C4_SEMANTIC_ROLES": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "ControlPlaneService", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "ControlPlaneService", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C4_SEMANTIC_ROLES", - "query": "ControlPlaneService", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "ControlPlaneService", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - }, - { - "layer": "C3_ENTRYPOINTS", - "query": "ControlPlaneService", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 1, - "candidates_after_filter": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 6, - "candidates_after_filter": 6 - }, - { - "layer": "C3_ENTRYPOINTS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 3, - "candidates_after_filter": 3 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "ControlPlaneService", - "alternatives": [ - "ControlPlaneService" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C4_SEMANTIC_ROLES", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 6, - "fail_reason": null - }, - { - "layer": "C3_ENTRYPOINTS", - "status": "hit", - "hit_count": 3, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "symbol_resolution": 0, - "retrieval_total": 146, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 45, - "C0_SOURCE_CHUNKS": 17, - "C4_SEMANTIC_ROLES": 15, - "C2_DEPENDENCY_GRAPH": 55, - "C3_ENTRYPOINTS": 11 - }, - "merge_rank": 24 - } - } - }, - { - "step": "llm_answer", - "input": { - "query": "Объясни класс ControlPlaneService", - "rag_count": 12 - }, - "output": { - "llm_answer": "## Объяснение сущности `ControlPlaneService`\n\n### Назначение\n`ControlPlaneService` — это сервис управления данными и состоянием приложения. Он отвечает за координацию различных каналов (`ControlChannel`) и управление жизненным циклом работы компонентов системы. Сервис также участвует в обработке срезов данных (`dataflow slices`), что указывает на его роль в общем потоке выполнения и управлении ресурсами.\n\n### Ключевые зависимости\nКлючевой зависимостью является наличие списка каналов (`_channels`), через которые осуществляется взаимодействие с компонентами системы. Важными методами являются инициализация сервиса (`__init__`), регистрация новых каналов (`register_channel`), запуск (`start`) и остановка (`stop`) сервисов, а также создание снимка текущего состояния (`snapshot`).\n\n### Поток данных или вызовов\nПри создании объекта класса вызывается метод `__init__`, который инициализирует список каналов `_channels`. Далее возможны следующие сценарии использования:\n\n1. **Регистрация канала**:\n - Метод `register_channel` добавляет новый канал в список доступных для взаимодействия.\n \n2. **Запуск сервиса**:\n - Вызов метода `start` инициирует асинхронный запуск всех зарегистрированных каналов через внутренний метод `_start_async`.\n - В рамках запуска проверяется наличие каналов и состояние системы, после чего выполняется запуск соответствующих действий.\n\n3. **Остановка сервиса**:\n - Метод `stop` инициирует остановку всех запущенных каналов через асинхронную функцию `_stop_async`.\n\n4. **Создание снимка состояния**:\n - Метод `snapshot` возвращает текущее состояние системы, включая информацию о здоровье и конфигурации.\n\n### Важные детали реализации\n- Использование асинхронного подхода (через `asyncio.run`) позволяет эффективно управлять параллельными задачами и каналами.\n- Состояние каналов сохраняется в виде списка объектов `ControlChannel`, каждый из которых может иметь свои специфические настройки и поведение.\n- Все действия, связанные с управлением каналами и их запуском/остановкой, выполняются синхронно внутри методов сервиса, несмотря на асинхронность вызова.\n \n### Осторожные выводы\nНа основе предоставленных фрагментов сложно точно определить, какие именно каналы участвуют в работе сервиса и какую дополнительную логику они реализуют. Также нет информации о том, каким образом методы, указанные в сигнатуре (`health`, `start`, `stop`), связаны с конкретными действиями и какова их реализация вне данного контекста.\n\n---\n\nТаким образом, `ControlPlaneService` представляет собой ключевой элемент инфраструктуры, отвечающий за координацию работы различных каналов и системных компонентов, обеспечивая контроль над состоянием и поведением системы." - }, - "diagnostics": { - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 797, - "evidence_rows": 12, - "evidence_chars": 2301 - }, - "evidence_summary": [ - { - "layer": "C1_SYMBOL_CATALOG", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "count": 6, - "unique_paths": 1 - }, - { - "layer": "C3_ENTRYPOINTS", - "count": 3, - "unique_paths": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 1, - "unique_paths": 1 - } - ], - "prompt_template_id": "intent_code_qa_explain_ru_v1", - "system_prompt_version": "v1" - }, - "timings_ms": { - "prompt_build": 0, - "llm_call": 3832 - } - } - } - ] - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_114552/full_chain_plba_code_retrieval_plba-fullchain-explain-control-plane-service.md b/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_114552/full_chain_plba_code_retrieval_plba-fullchain-explain-control-plane-service.md deleted file mode 100644 index 6aed954..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_114552/full_chain_plba_code_retrieval_plba-fullchain-explain-control-plane-service.md +++ /dev/null @@ -1,34 +0,0 @@ -# plba-fullchain-explain-control-plane-service - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_retrieval.yaml -- runner: runtime -- mode: full_chain -- passed: True - -## Query -Объясни класс ControlPlaneService - -## Actual -{ - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 12, - "llm_answer": "## Объяснение сущности `ControlPlaneService`\n\n### Назначение\n`ControlPlaneService` — это сервис управления данными и состоянием приложения. Он отвечает за координацию различных каналов (`ControlChannel`) и управление жизненным циклом работы компонентов системы. Сервис также участвует в обработке срезов данных (`dataflow slices`), что указывает на его роль в общем потоке выполнения и управлении ресурсами.\n\n### Ключевые зависимости\nКлючевой зависимостью является наличие списка каналов (`_channels`), через которые осуществляется взаимодействие с компонентами системы. Важными методами являются инициализация сервиса (`__init__`), регистрация новых каналов (`register_channel`), запуск (`start`) и остановка (`stop`) сервисов, а также создание снимка текущего состояния (`snapshot`).\n\n### Поток данных или вызовов\nПри создании объекта класса вызывается метод `__init__`, который инициализирует список каналов `_channels`. Далее возможны следующие сценарии использования:\n\n1. **Регистрация канала**:\n - Метод `register_channel` добавляет новый канал в список доступных для взаимодействия.\n \n2. **Запуск сервиса**:\n - Вызов метода `start` инициирует асинхронный запуск всех зарегистрированных каналов через внутренний метод `_start_async`.\n - В рамках запуска проверяется наличие каналов и состояние системы, после чего выполняется запуск соответствующих действий.\n\n3. **Остановка сервиса**:\n - Метод `stop` инициирует остановку всех запущенных каналов через асинхронную функцию `_stop_async`.\n\n4. **Создание снимка состояния**:\n - Метод `snapshot` возвращает текущее состояние системы, включая информацию о здоровье и конфигурации.\n\n### Важные детали реализации\n- Использование асинхронного подхода (через `asyncio.run`) позволяет эффективно управлять параллельными задачами и каналами.\n- Состояние каналов сохраняется в виде списка объектов `ControlChannel`, каждый из которых может иметь свои специфические настройки и поведение.\n- Все действия, связанные с управлением каналами и их запуском/остановкой, выполняются синхронно внутри методов сервиса, несмотря на асинхронность вызова.\n \n### Осторожные выводы\nНа основе предоставленных фрагментов сложно точно определить, какие именно каналы участвуют в работе сервиса и какую дополнительную логику они реализуют. Также нет информации о том, каким образом методы, указанные в сигнатуре (`health`, `start`, `stop`), связаны с конкретными действиями и какова их реализация вне данного контекста.\n\n---\n\nТаким образом, `ControlPlaneService` представляет собой ключевой элемент инфраструктуры, отвечающий за координацию работы различных каналов и системных компонентов, обеспечивая контроль над состоянием и поведением системы.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "ControlPlaneService" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] -} - -## Mismatches -- none \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_114552/full_chain_plba_code_retrieval_plba-fullchain-explain-create-runtime.json b/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_114552/full_chain_plba_code_retrieval_plba-fullchain-explain-create-runtime.json deleted file mode 100644 index 29aa614..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_114552/full_chain_plba_code_retrieval_plba-fullchain-explain-create-runtime.json +++ /dev/null @@ -1,1896 +0,0 @@ -{ - "case_id": "plba-fullchain-explain-create-runtime", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_retrieval.yaml", - "runner": "runtime", - "mode": "full_chain", - "actual": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 12, - "llm_answer": "## Объяснение функции `create_runtime`\n\n### Назначение\nФункция `create_runtime` предназначена для инициализации и настройки основного объекта управления (`RuntimeManager`) приложения Plba. Она создаёт экземпляр менеджера выполнения и выполняет начальную настройку, включая загрузку конфигурационных файлов и регистрацию модулей.\n\n### Ключевые зависимости\nКлючевая зависимость — объект класса `RuntimeManager`, который является основным объектом управления жизненным циклом приложения. Этот класс отвечает за управление всеми модулями и компонентами системы, включая их загрузку, конфигурирование и взаимодействие.\n\n### Поток данных или вызовов\n1. Функция принимает параметры конфигурации и определяет путь к файлу конфигурации, а также флаги включения HTTP-контроля и указания его параметров (хост, порт, таймаут).\n2. Создаётся новый экземпляр `RuntimeManager`.\n3. Если указан путь к конфигурационному файлу, он загружается с помощью метода `add_config_file` объекта `runtime`.\n4. Если включен HTTP-контроль, регистрируется соответствующий канал контроля через метод `register_channel` объекта `runtime.control_plane`.\n5. Регистрируется переданный модуль с помощью метода `register_module` объекта `runtime`.\n6. Возвращается созданный и настроенный объект `RuntimeManager`.\n\n### Важные детали реализации\n1. **Параметры конфигурации**:\n - Параметр `config_path` указывает путь к файлу конфигурации, используемому при начальной настройке приложения.\n - Флаг `enable_http_control` включает режим работы HTTP-контроля, определяющий возможность удалённого управления приложением.\n \n2. **Регистрация модуля**:\n - Метод `register_module` обеспечивает интеграцию переданного модуля в общую систему управления и запускает его обработку.\n\n3. **Чтение атрибутов и запись состояния**:\n - В процессе создания экземпляра `RuntimeManager` происходит чтение атрибутов и настройка состояния приложения.\n\n4. **Использование сторонних библиотек и компонентов**:\n - Используются компоненты из пакета `uvicorn` (через класс `HttpControlChannel`), что позволяет реализовать работу с HTTP-интерфейсом для удалённого управления приложением.\n\n---\n\n### Примечания\n- Описанная структура вызова методов и зависимостей построена исключительно на анализе кода и входных данных, предоставленных пользователем. \n- Это означает, что некоторые выводы являются осторожными и основаны на косвенных доказательствах (например, анализ зависимостей и потока данных).", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "create_runtime" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "passed": true, - "mismatches": [], - "details": { - "case_id": "plba-fullchain-explain-create-runtime", - "text": "Объясни функцию create_runtime", - "mode": "full_chain", - "run_started_at": "2026-03-12T11:45:52", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Объясни функцию create_runtime", - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "create_runtime", - "alternatives": [ - "create_runtime" - ], - "confidence": 0.99 - }, - "rag_count": 12, - "rag_rows": [ - { - "path": "src/plba/bootstrap.py", - "content": "function create_runtime\ncreate_runtime(module)", - "layer": "C1_SYMBOL_CATALOG", - "title": "create_runtime", - "span_start": 8, - "span_end": 29, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "qname": "create_runtime", - "kind": "function", - "signature": "create_runtime(module)", - "parent_symbol_id": null, - "package_or_module": "src.plba.bootstrap", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_runner.py", - "content": "UvicornThreadRunner\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (24)", - "layer": "C4_SEMANTIC_ROLES", - "title": "UvicornThreadRunner", - "span_start": 10, - "span_end": 61, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 11, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "fd55630045a02100df8877ac27d951ee08617d4598764394d48cb51fe067476a", - "symbol_name": "UvicornThreadRunner", - "qname": "UvicornThreadRunner", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 24, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "3779fdd2878b770e789a35bb2a89c9d79f13b61c26d7db1b3b683f9bb9e1623f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/bootstrap.py", - "content": "create_runtime calls runtime.add_config_file", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "create_runtime:calls", - "span_start": 19, - "span_end": 19, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "4eaeec4ac55a59d5f66fd01c4754955f8fedaf4bc3df13fa769b352c7bfaacbb", - "edge_type": "calls", - "src_symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "src_qname": "create_runtime", - "dst_symbol_id": null, - "dst_ref": "runtime.add_config_file", - "resolution": "partial", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/bootstrap.py", - "content": "create_runtime reads_attr runtime.register_module", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "create_runtime:reads_attr", - "span_start": 28, - "span_end": 28, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "45516c79ff358dbf9b650a081668df0f66d2fe989300f985a1a78be6be166f8f", - "edge_type": "reads_attr", - "src_symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "src_qname": "create_runtime", - "dst_symbol_id": null, - "dst_ref": "runtime.register_module", - "resolution": "partial", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/bootstrap.py", - "content": "create_runtime instantiates RuntimeManager", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "create_runtime:instantiates", - "span_start": 17, - "span_end": 17, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "0adba17984f850ea1608c9e734d2dd5c325cfde3a8133123aa239e44935ad18e", - "edge_type": "instantiates", - "src_symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "src_qname": "create_runtime", - "dst_symbol_id": "27158ca220022eeb5083c6addf8a50775d45f7161284fd60aac48410105f4b98", - "dst_ref": "RuntimeManager", - "resolution": "resolved", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/bootstrap.py", - "content": "create_runtime calls runtime.register_module", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "create_runtime:calls", - "span_start": 28, - "span_end": 28, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "ab6003c3441addc1ba1b81edeca009165559f652f6b2cf424e5ae61b1f617de8", - "edge_type": "calls", - "src_symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "src_qname": "create_runtime", - "dst_symbol_id": null, - "dst_ref": "runtime.register_module", - "resolution": "partial", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/bootstrap.py", - "content": "create_runtime calls runtime.control_plane.register_channel", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "create_runtime:calls", - "span_start": 21, - "span_end": 27, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "2678250030b9ce47a3b3b55fac7897ac530367edc8374ac9d5e6ecafb1e483f0", - "edge_type": "calls", - "src_symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "src_qname": "create_runtime", - "dst_symbol_id": null, - "dst_ref": "runtime.control_plane.register_channel", - "resolution": "partial", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/bootstrap.py", - "content": "create_runtime reads_attr runtime.add_config_file", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "create_runtime:reads_attr", - "span_start": 19, - "span_end": 19, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "30d4e8aae984ab84d523e80d02f1caeda52d547fa3d2aa47be8845931cabbca2", - "edge_type": "reads_attr", - "src_symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "src_qname": "create_runtime", - "dst_symbol_id": null, - "dst_ref": "runtime.add_config_file", - "resolution": "partial", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/bootstrap.py", - "content": "def create_runtime(\n module: ApplicationModule,\n *,\n config_path: str | None = None,\n enable_http_control: bool = False,\n control_host: str = \"127.0.0.1\",\n control_port: int = 8080,\n control_timeout: int = 5,\n) -> RuntimeManager:\n runtime = RuntimeManager()\n if config_path is not None:\n runtime.add_config_file(config_path)\n if enable_http_control:\n runtime.control_plane.register_channel(\n HttpControlChannel(\n host=control_host,\n port=control_port,\n timeout=control_timeout,\n )\n )\n runtime.register_module(module)\n return runtime", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/plba/bootstrap.py:create_runtime", - "span_start": 8, - "span_end": 29, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.plba.bootstrap", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "llm_answer": "## Объяснение функции `create_runtime`\n\n### Назначение\nФункция `create_runtime` предназначена для инициализации и настройки основного объекта управления (`RuntimeManager`) приложения Plba. Она создаёт экземпляр менеджера выполнения и выполняет начальную настройку, включая загрузку конфигурационных файлов и регистрацию модулей.\n\n### Ключевые зависимости\nКлючевая зависимость — объект класса `RuntimeManager`, который является основным объектом управления жизненным циклом приложения. Этот класс отвечает за управление всеми модулями и компонентами системы, включая их загрузку, конфигурирование и взаимодействие.\n\n### Поток данных или вызовов\n1. Функция принимает параметры конфигурации и определяет путь к файлу конфигурации, а также флаги включения HTTP-контроля и указания его параметров (хост, порт, таймаут).\n2. Создаётся новый экземпляр `RuntimeManager`.\n3. Если указан путь к конфигурационному файлу, он загружается с помощью метода `add_config_file` объекта `runtime`.\n4. Если включен HTTP-контроль, регистрируется соответствующий канал контроля через метод `register_channel` объекта `runtime.control_plane`.\n5. Регистрируется переданный модуль с помощью метода `register_module` объекта `runtime`.\n6. Возвращается созданный и настроенный объект `RuntimeManager`.\n\n### Важные детали реализации\n1. **Параметры конфигурации**:\n - Параметр `config_path` указывает путь к файлу конфигурации, используемому при начальной настройке приложения.\n - Флаг `enable_http_control` включает режим работы HTTP-контроля, определяющий возможность удалённого управления приложением.\n \n2. **Регистрация модуля**:\n - Метод `register_module` обеспечивает интеграцию переданного модуля в общую систему управления и запускает его обработку.\n\n3. **Чтение атрибутов и запись состояния**:\n - В процессе создания экземпляра `RuntimeManager` происходит чтение атрибутов и настройка состояния приложения.\n\n4. **Использование сторонних библиотек и компонентов**:\n - Используются компоненты из пакета `uvicorn` (через класс `HttpControlChannel`), что позволяет реализовать работу с HTTP-интерфейсом для удалённого управления приложением.\n\n---\n\n### Примечания\n- Описанная структура вызова методов и зависимостей построена исключительно на анализе кода и входных данных, предоставленных пользователем. \n- Это означает, что некоторые выводы являются осторожными и основаны на косвенных доказательствах (например, анализ зависимостей и потока данных).", - "summary": { - "router": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "confidence": null - }, - "retrieval": { - "profile": "code", - "layers_hit": [ - "C0_SOURCE_CHUNKS", - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS", - "C4_SEMANTIC_ROLES" - ], - "evidence_sufficient": true - }, - "llm": { - "answer_status": "answered", - "groundedness": "grounded" - } - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "symbol_kind_hint": "function", - "symbol_candidates": [ - "create_runtime" - ], - "keyword_hints": [ - "create_runtime" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C0_SOURCE_CHUNKS": "exact_path_fetch", - "C4_SEMANTIC_ROLES": "exact_path_fetch", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C3_ENTRYPOINTS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 8, - "C4_SEMANTIC_ROLES": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C3_ENTRYPOINTS": 6 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C4_SEMANTIC_ROLES": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "create_runtime", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "create_runtime", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C4_SEMANTIC_ROLES", - "query": "create_runtime", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "create_runtime", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - }, - { - "layer": "C3_ENTRYPOINTS", - "query": "create_runtime", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 1, - "candidates_after_filter": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 6, - "candidates_after_filter": 6 - }, - { - "layer": "C3_ENTRYPOINTS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 3, - "candidates_after_filter": 3 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "create_runtime", - "alternatives": [ - "create_runtime" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C4_SEMANTIC_ROLES", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 6, - "fail_reason": null - }, - { - "layer": "C3_ENTRYPOINTS", - "status": "hit", - "hit_count": 3, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "router": 0, - "symbol_resolution": 0, - "retrieval_total": 144, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 43, - "C0_SOURCE_CHUNKS": 22, - "C4_SEMANTIC_ROLES": 19, - "C2_DEPENDENCY_GRAPH": 47, - "C3_ENTRYPOINTS": 10 - }, - "merge_rank": 21, - "prompt_build": 0, - "llm_call": 3617 - }, - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 601, - "evidence_rows": 12, - "evidence_chars": 1184 - }, - "evidence_summary": [ - { - "layer": "C1_SYMBOL_CATALOG", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "count": 6, - "unique_paths": 1 - }, - { - "layer": "C3_ENTRYPOINTS", - "count": 3, - "unique_paths": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 1, - "unique_paths": 1 - } - ], - "prompt_template_id": "intent_code_qa_explain_ru_v1", - "system_prompt_version": "v1" - }, - "router": { - "conversation_mode": "START", - "keyword_hints": [ - "create_runtime" - ], - "path_scope": [] - }, - "llm": { - "used_evidence_count": 12, - "missing_evidence_reason": null - } - }, - "run_info": { - "case_id": "plba-fullchain-explain-create-runtime", - "mode": "full_chain", - "run_started_at": "2026-03-12T11:45:52", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - }, - "input_request": { - "text": "Объясни функцию create_runtime", - "normalized_query": "Объясни функцию create_runtime" - }, - "steps": [ - { - "step": "intent_router", - "input": { - "query": "Объясни функцию create_runtime" - }, - "output": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Объясни функцию create_runtime" - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "symbol_kind_hint": "function", - "symbol_candidates": [ - "create_runtime" - ], - "keyword_hints": [ - "create_runtime" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "timings_ms": { - "router": 0 - } - } - }, - { - "step": "retrieval", - "input": { - "query": "Объясни функцию create_runtime" - }, - "output": { - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "create_runtime", - "alternatives": [ - "create_runtime" - ], - "confidence": 0.99 - }, - "rag_count": 12, - "rag_rows": [ - { - "path": "src/plba/bootstrap.py", - "content": "function create_runtime\ncreate_runtime(module)", - "layer": "C1_SYMBOL_CATALOG", - "title": "create_runtime", - "span_start": 8, - "span_end": 29, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "qname": "create_runtime", - "kind": "function", - "signature": "create_runtime(module)", - "parent_symbol_id": null, - "package_or_module": "src.plba.bootstrap", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_runner.py", - "content": "UvicornThreadRunner\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (24)", - "layer": "C4_SEMANTIC_ROLES", - "title": "UvicornThreadRunner", - "span_start": 10, - "span_end": 61, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 11, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "fd55630045a02100df8877ac27d951ee08617d4598764394d48cb51fe067476a", - "symbol_name": "UvicornThreadRunner", - "qname": "UvicornThreadRunner", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 24, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "3779fdd2878b770e789a35bb2a89c9d79f13b61c26d7db1b3b683f9bb9e1623f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/bootstrap.py", - "content": "create_runtime calls runtime.add_config_file", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "create_runtime:calls", - "span_start": 19, - "span_end": 19, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "4eaeec4ac55a59d5f66fd01c4754955f8fedaf4bc3df13fa769b352c7bfaacbb", - "edge_type": "calls", - "src_symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "src_qname": "create_runtime", - "dst_symbol_id": null, - "dst_ref": "runtime.add_config_file", - "resolution": "partial", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/bootstrap.py", - "content": "create_runtime reads_attr runtime.register_module", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "create_runtime:reads_attr", - "span_start": 28, - "span_end": 28, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "45516c79ff358dbf9b650a081668df0f66d2fe989300f985a1a78be6be166f8f", - "edge_type": "reads_attr", - "src_symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "src_qname": "create_runtime", - "dst_symbol_id": null, - "dst_ref": "runtime.register_module", - "resolution": "partial", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/bootstrap.py", - "content": "create_runtime instantiates RuntimeManager", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "create_runtime:instantiates", - "span_start": 17, - "span_end": 17, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "0adba17984f850ea1608c9e734d2dd5c325cfde3a8133123aa239e44935ad18e", - "edge_type": "instantiates", - "src_symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "src_qname": "create_runtime", - "dst_symbol_id": "27158ca220022eeb5083c6addf8a50775d45f7161284fd60aac48410105f4b98", - "dst_ref": "RuntimeManager", - "resolution": "resolved", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/bootstrap.py", - "content": "create_runtime calls runtime.register_module", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "create_runtime:calls", - "span_start": 28, - "span_end": 28, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "ab6003c3441addc1ba1b81edeca009165559f652f6b2cf424e5ae61b1f617de8", - "edge_type": "calls", - "src_symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "src_qname": "create_runtime", - "dst_symbol_id": null, - "dst_ref": "runtime.register_module", - "resolution": "partial", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/bootstrap.py", - "content": "create_runtime calls runtime.control_plane.register_channel", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "create_runtime:calls", - "span_start": 21, - "span_end": 27, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "2678250030b9ce47a3b3b55fac7897ac530367edc8374ac9d5e6ecafb1e483f0", - "edge_type": "calls", - "src_symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "src_qname": "create_runtime", - "dst_symbol_id": null, - "dst_ref": "runtime.control_plane.register_channel", - "resolution": "partial", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/bootstrap.py", - "content": "create_runtime reads_attr runtime.add_config_file", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "create_runtime:reads_attr", - "span_start": 19, - "span_end": 19, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "30d4e8aae984ab84d523e80d02f1caeda52d547fa3d2aa47be8845931cabbca2", - "edge_type": "reads_attr", - "src_symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "src_qname": "create_runtime", - "dst_symbol_id": null, - "dst_ref": "runtime.add_config_file", - "resolution": "partial", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/bootstrap.py", - "content": "def create_runtime(\n module: ApplicationModule,\n *,\n config_path: str | None = None,\n enable_http_control: bool = False,\n control_host: str = \"127.0.0.1\",\n control_port: int = 8080,\n control_timeout: int = 5,\n) -> RuntimeManager:\n runtime = RuntimeManager()\n if config_path is not None:\n runtime.add_config_file(config_path)\n if enable_http_control:\n runtime.control_plane.register_channel(\n HttpControlChannel(\n host=control_host,\n port=control_port,\n timeout=control_timeout,\n )\n )\n runtime.register_module(module)\n return runtime", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/plba/bootstrap.py:create_runtime", - "span_start": 8, - "span_end": 29, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.plba.bootstrap", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ] - }, - "diagnostics": { - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C0_SOURCE_CHUNKS": "exact_path_fetch", - "C4_SEMANTIC_ROLES": "exact_path_fetch", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C3_ENTRYPOINTS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 8, - "C4_SEMANTIC_ROLES": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C3_ENTRYPOINTS": 6 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C4_SEMANTIC_ROLES": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "create_runtime", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "create_runtime", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C4_SEMANTIC_ROLES", - "query": "create_runtime", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "create_runtime", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - }, - { - "layer": "C3_ENTRYPOINTS", - "query": "create_runtime", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 1, - "candidates_after_filter": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 6, - "candidates_after_filter": 6 - }, - { - "layer": "C3_ENTRYPOINTS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 3, - "candidates_after_filter": 3 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "create_runtime", - "alternatives": [ - "create_runtime" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C4_SEMANTIC_ROLES", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 6, - "fail_reason": null - }, - { - "layer": "C3_ENTRYPOINTS", - "status": "hit", - "hit_count": 3, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "symbol_resolution": 0, - "retrieval_total": 144, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 43, - "C0_SOURCE_CHUNKS": 22, - "C4_SEMANTIC_ROLES": 19, - "C2_DEPENDENCY_GRAPH": 47, - "C3_ENTRYPOINTS": 10 - }, - "merge_rank": 21 - } - } - }, - { - "step": "llm_answer", - "input": { - "query": "Объясни функцию create_runtime", - "rag_count": 12 - }, - "output": { - "llm_answer": "## Объяснение функции `create_runtime`\n\n### Назначение\nФункция `create_runtime` предназначена для инициализации и настройки основного объекта управления (`RuntimeManager`) приложения Plba. Она создаёт экземпляр менеджера выполнения и выполняет начальную настройку, включая загрузку конфигурационных файлов и регистрацию модулей.\n\n### Ключевые зависимости\nКлючевая зависимость — объект класса `RuntimeManager`, который является основным объектом управления жизненным циклом приложения. Этот класс отвечает за управление всеми модулями и компонентами системы, включая их загрузку, конфигурирование и взаимодействие.\n\n### Поток данных или вызовов\n1. Функция принимает параметры конфигурации и определяет путь к файлу конфигурации, а также флаги включения HTTP-контроля и указания его параметров (хост, порт, таймаут).\n2. Создаётся новый экземпляр `RuntimeManager`.\n3. Если указан путь к конфигурационному файлу, он загружается с помощью метода `add_config_file` объекта `runtime`.\n4. Если включен HTTP-контроль, регистрируется соответствующий канал контроля через метод `register_channel` объекта `runtime.control_plane`.\n5. Регистрируется переданный модуль с помощью метода `register_module` объекта `runtime`.\n6. Возвращается созданный и настроенный объект `RuntimeManager`.\n\n### Важные детали реализации\n1. **Параметры конфигурации**:\n - Параметр `config_path` указывает путь к файлу конфигурации, используемому при начальной настройке приложения.\n - Флаг `enable_http_control` включает режим работы HTTP-контроля, определяющий возможность удалённого управления приложением.\n \n2. **Регистрация модуля**:\n - Метод `register_module` обеспечивает интеграцию переданного модуля в общую систему управления и запускает его обработку.\n\n3. **Чтение атрибутов и запись состояния**:\n - В процессе создания экземпляра `RuntimeManager` происходит чтение атрибутов и настройка состояния приложения.\n\n4. **Использование сторонних библиотек и компонентов**:\n - Используются компоненты из пакета `uvicorn` (через класс `HttpControlChannel`), что позволяет реализовать работу с HTTP-интерфейсом для удалённого управления приложением.\n\n---\n\n### Примечания\n- Описанная структура вызова методов и зависимостей построена исключительно на анализе кода и входных данных, предоставленных пользователем. \n- Это означает, что некоторые выводы являются осторожными и основаны на косвенных доказательствах (например, анализ зависимостей и потока данных)." - }, - "diagnostics": { - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 601, - "evidence_rows": 12, - "evidence_chars": 1184 - }, - "evidence_summary": [ - { - "layer": "C1_SYMBOL_CATALOG", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "count": 6, - "unique_paths": 1 - }, - { - "layer": "C3_ENTRYPOINTS", - "count": 3, - "unique_paths": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 1, - "unique_paths": 1 - } - ], - "prompt_template_id": "intent_code_qa_explain_ru_v1", - "system_prompt_version": "v1" - }, - "timings_ms": { - "prompt_build": 0, - "llm_call": 3617 - } - } - } - ] - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_114552/full_chain_plba_code_retrieval_plba-fullchain-explain-create-runtime.md b/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_114552/full_chain_plba_code_retrieval_plba-fullchain-explain-create-runtime.md deleted file mode 100644 index 795ec06..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_114552/full_chain_plba_code_retrieval_plba-fullchain-explain-create-runtime.md +++ /dev/null @@ -1,34 +0,0 @@ -# plba-fullchain-explain-create-runtime - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_retrieval.yaml -- runner: runtime -- mode: full_chain -- passed: True - -## Query -Объясни функцию create_runtime - -## Actual -{ - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 12, - "llm_answer": "## Объяснение функции `create_runtime`\n\n### Назначение\nФункция `create_runtime` предназначена для инициализации и настройки основного объекта управления (`RuntimeManager`) приложения Plba. Она создаёт экземпляр менеджера выполнения и выполняет начальную настройку, включая загрузку конфигурационных файлов и регистрацию модулей.\n\n### Ключевые зависимости\nКлючевая зависимость — объект класса `RuntimeManager`, который является основным объектом управления жизненным циклом приложения. Этот класс отвечает за управление всеми модулями и компонентами системы, включая их загрузку, конфигурирование и взаимодействие.\n\n### Поток данных или вызовов\n1. Функция принимает параметры конфигурации и определяет путь к файлу конфигурации, а также флаги включения HTTP-контроля и указания его параметров (хост, порт, таймаут).\n2. Создаётся новый экземпляр `RuntimeManager`.\n3. Если указан путь к конфигурационному файлу, он загружается с помощью метода `add_config_file` объекта `runtime`.\n4. Если включен HTTP-контроль, регистрируется соответствующий канал контроля через метод `register_channel` объекта `runtime.control_plane`.\n5. Регистрируется переданный модуль с помощью метода `register_module` объекта `runtime`.\n6. Возвращается созданный и настроенный объект `RuntimeManager`.\n\n### Важные детали реализации\n1. **Параметры конфигурации**:\n - Параметр `config_path` указывает путь к файлу конфигурации, используемому при начальной настройке приложения.\n - Флаг `enable_http_control` включает режим работы HTTP-контроля, определяющий возможность удалённого управления приложением.\n \n2. **Регистрация модуля**:\n - Метод `register_module` обеспечивает интеграцию переданного модуля в общую систему управления и запускает его обработку.\n\n3. **Чтение атрибутов и запись состояния**:\n - В процессе создания экземпляра `RuntimeManager` происходит чтение атрибутов и настройка состояния приложения.\n\n4. **Использование сторонних библиотек и компонентов**:\n - Используются компоненты из пакета `uvicorn` (через класс `HttpControlChannel`), что позволяет реализовать работу с HTTP-интерфейсом для удалённого управления приложением.\n\n---\n\n### Примечания\n- Описанная структура вызова методов и зависимостей построена исключительно на анализе кода и входных данных, предоставленных пользователем. \n- Это означает, что некоторые выводы являются осторожными и основаны на косвенных доказательствах (например, анализ зависимостей и потока данных).", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "create_runtime" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] -} - -## Mismatches -- none \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_114552/full_chain_plba_code_retrieval_plba-fullchain-explain-http-control-channel.json b/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_114552/full_chain_plba_code_retrieval_plba-fullchain-explain-http-control-channel.json deleted file mode 100644 index 79f4120..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_114552/full_chain_plba_code_retrieval_plba-fullchain-explain-http-control-channel.json +++ /dev/null @@ -1,2088 +0,0 @@ -{ - "case_id": "plba-fullchain-explain-http-control-channel", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_retrieval.yaml", - "runner": "runtime", - "mode": "full_chain", - "actual": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 12, - "llm_answer": "## Объяснение работы класса `HttpControlChannel`\n\n### Назначение\nКласс `HttpControlChannel` предназначен для управления HTTP каналом контроля состояния приложения. Он отвечает за инициализацию сервера и обработку запросов, связанных с состоянием системы.\n\n### Ключевые зависимости\nКлючевая зависимость — это объект типа `UvicornThreadRunner`, используемый для запуска веб-сервера. Также используются классы и функции из модуля `HttpControlAppFactory`.\n\n### Поток данных или вызовов\n1. **Инициализация (`__init__`)**: \n - При создании объекта устанавливается значение тайм-аута и запускается объект `UvicornThreadRunner`. Этот объект используется для выполнения асинхронного запуска веб-приложения через фреймворк FastAPI.\n \n2. **Запуск (`start`)**:\n - Метод принимает набор действий (`ControlActionSet`), конфигурирует приложение, затем вызывает метод `start` у экземпляра `UvicornThreadRunner`.\n \n3. **Остановка (`stop`)**:\n - Остановка выполняется путем вызова метода `stop` у экземпляра `UvicornThreadRunner`.\n \n4. **Получение порта (`port`)**:\n - Возвращает порт, связанный с запущенным сервером.\n\n5. **Обработка health-запросов (_health_response)**:\n - Проверяет наличие настроенного набора действий. Если действия отсутствуют, возвращает состояние «unhealthy». В противном случае ожидает выполнение действия с заданным таймаутом.\n \n6. **Обработка пользовательских действий (_action_response)**:\n - Аналогично предыдущему пункту, проверяется наличие настроенных действий. Если действие отсутствует, возвращается ошибка. В противном случае обрабатывается соответствующее действие.\n\n### Важные детали реализации\n- **Таймаут**: Таймаут применяется при ожидании выполнения операций, таких как проверка здоровья системы и обработка пользовательских действий.\n- **Экземпляр `UvicornThreadRunner`**: Используется для обеспечения многопоточной работы и возможности одновременной обработки нескольких запросов.\n- **Модуль `HttpControlAppFactory`**: Отвечает за создание экземпляра FastAPI приложения, которое будет использоваться для обработки запросов.\n \n### Косвенные признаки (осторожный вывод)\nНа основе анализа графа зависимостей и логики работы можно осторожно предположить, что `HttpControlChannel` является частью общего механизма мониторинга и управления приложением. Это подтверждается его ролью «pipeline stage» и участием в обработке срезов данных («dataflow slices»).\n\n### Путь к файлу и имя сущности\n- Файл: `src/app_runtime/control/http_channel.py`\n- Имя сущности: `HttpControlChannel`", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "HttpControlChannel" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "passed": true, - "mismatches": [], - "details": { - "case_id": "plba-fullchain-explain-http-control-channel", - "text": "Объясни класс HttpControlChannel", - "mode": "full_chain", - "run_started_at": "2026-03-12T11:45:52", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Объясни класс HttpControlChannel", - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "HttpControlChannel", - "alternatives": [ - "HttpControlChannel" - ], - "confidence": 0.99 - }, - "rag_count": 12, - "rag_rows": [ - { - "path": "src/app_runtime/control/http_channel.py", - "content": "class HttpControlChannel\nHttpControlChannel(ControlChannel)", - "layer": "C1_SYMBOL_CATALOG", - "title": "HttpControlChannel", - "span_start": 12, - "span_end": 57, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "1c9fbdc24819e5604c26ea55428a74310f03a03e1af197ed84846af61e42fdb0", - "qname": "HttpControlChannel", - "kind": "class", - "signature": "HttpControlChannel(ControlChannel)", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.control.http_channel", - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (10)", - "layer": "C4_SEMANTIC_ROLES", - "title": "HttpControlChannel", - "span_start": 12, - "span_end": 57, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 21, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "1c9fbdc24819e5604c26ea55428a74310f03a03e1af197ed84846af61e42fdb0", - "symbol_name": "HttpControlChannel", - "qname": "HttpControlChannel", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 10, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel.__init__\n -> HttpControlChannel._runner\n -> HttpControlChannel.start", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "HttpControlChannel.__init__:dataflow_slice", - "span_start": 15, - "span_end": 22, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "51d73913df709152258ed1b9a8c8f4eb3c575eccfe6b982aef0b28e0789a29da", - "edge_type": "dataflow_slice", - "src_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "src_qname": "HttpControlChannel.__init__", - "dst_symbol_id": "d1933f04137f52535b6525f1b93ff2cd83bfb216b480e887e791ed1714cda8e0", - "dst_ref": "HttpControlChannel.start", - "resolution": "resolved", - "slice_id": "51d73913df709152258ed1b9a8c8f4eb3c575eccfe6b982aef0b28e0789a29da", - "root_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "path_symbols": [ - "HttpControlChannel.__init__", - "HttpControlChannel._runner", - "HttpControlChannel.start" - ], - "path_symbol_ids": [ - "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "d1933f04137f52535b6525f1b93ff2cd83bfb216b480e887e791ed1714cda8e0" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel.__init__\n -> HttpControlChannel._runner\n -> HttpControlChannel.port", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "HttpControlChannel.__init__:dataflow_slice", - "span_start": 15, - "span_end": 29, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "c7167bab7218bb768ad7c11bfb40d1a3096e6071dd7817bba5fd864cf8f6de13", - "edge_type": "dataflow_slice", - "src_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "src_qname": "HttpControlChannel.__init__", - "dst_symbol_id": "3632ce8227f4a31e0768f2fb021a4d1ba28e1202633aa0f2fac902295931280f", - "dst_ref": "HttpControlChannel.port", - "resolution": "resolved", - "slice_id": "c7167bab7218bb768ad7c11bfb40d1a3096e6071dd7817bba5fd864cf8f6de13", - "root_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "path_symbols": [ - "HttpControlChannel.__init__", - "HttpControlChannel._runner", - "HttpControlChannel.port" - ], - "path_symbol_ids": [ - "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "3632ce8227f4a31e0768f2fb021a4d1ba28e1202633aa0f2fac902295931280f" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel.__init__\n -> HttpControlChannel._timeout\n -> HttpControlChannel._health_response", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "HttpControlChannel.__init__:dataflow_slice", - "span_start": 14, - "span_end": 34, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "f858f5c9e575f6c4cdfe3853571b7ee21d1f628a443541d2037c3dc9d0790bef", - "edge_type": "dataflow_slice", - "src_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "src_qname": "HttpControlChannel.__init__", - "dst_symbol_id": "e84bf04e9cd2127df235b7064d05f47e19f19a89c7c82f4c247231d4e8fa426a", - "dst_ref": "HttpControlChannel._health_response", - "resolution": "resolved", - "slice_id": "f858f5c9e575f6c4cdfe3853571b7ee21d1f628a443541d2037c3dc9d0790bef", - "root_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "path_symbols": [ - "HttpControlChannel.__init__", - "HttpControlChannel._timeout", - "HttpControlChannel._health_response" - ], - "path_symbol_ids": [ - "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "e84bf04e9cd2127df235b7064d05f47e19f19a89c7c82f4c247231d4e8fa426a" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel.__init__\n -> HttpControlChannel._timeout\n -> HttpControlChannel._action_response", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "HttpControlChannel.__init__:dataflow_slice", - "span_start": 14, - "span_end": 47, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "c3ef21fcae96c82c00be74b3ab827d4af2085d89cb3fa5521c19a174aad84dbb", - "edge_type": "dataflow_slice", - "src_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "src_qname": "HttpControlChannel.__init__", - "dst_symbol_id": "e64969024ccaeb34d8d91473fad07b3b3d341875846392e7a006406c7ada1954", - "dst_ref": "HttpControlChannel._action_response", - "resolution": "resolved", - "slice_id": "c3ef21fcae96c82c00be74b3ab827d4af2085d89cb3fa5521c19a174aad84dbb", - "root_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "path_symbols": [ - "HttpControlChannel.__init__", - "HttpControlChannel._timeout", - "HttpControlChannel._action_response" - ], - "path_symbol_ids": [ - "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "e64969024ccaeb34d8d91473fad07b3b3d341875846392e7a006406c7ada1954" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel.__init__\n -> HttpControlChannel._runner\n -> HttpControlChannel.stop", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "HttpControlChannel.__init__:dataflow_slice", - "span_start": 15, - "span_end": 25, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "0f827ef81a990258a8a74381c8564a8361afa6712dba3200592659c939adcb9d", - "edge_type": "dataflow_slice", - "src_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "src_qname": "HttpControlChannel.__init__", - "dst_symbol_id": "f29ab212620093d72be20e26c5a399624c7939a6056a728762ed3f84a250bfa3", - "dst_ref": "HttpControlChannel.stop", - "resolution": "resolved", - "slice_id": "0f827ef81a990258a8a74381c8564a8361afa6712dba3200592659c939adcb9d", - "root_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "path_symbols": [ - "HttpControlChannel.__init__", - "HttpControlChannel._runner", - "HttpControlChannel.stop" - ], - "path_symbol_ids": [ - "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "f29ab212620093d72be20e26c5a399624c7939a6056a728762ed3f84a250bfa3" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel.__init__\n -> HttpControlChannel._factory\n -> HttpControlChannel.start", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "HttpControlChannel.__init__:dataflow_slice", - "span_start": 16, - "span_end": 21, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e61ec25ded7dbe380d95ce2abcbc1d7a2d2afde5aa8453866df8706dfb7d6ddb", - "edge_type": "dataflow_slice", - "src_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "src_qname": "HttpControlChannel.__init__", - "dst_symbol_id": "d1933f04137f52535b6525f1b93ff2cd83bfb216b480e887e791ed1714cda8e0", - "dst_ref": "HttpControlChannel.start", - "resolution": "resolved", - "slice_id": "e61ec25ded7dbe380d95ce2abcbc1d7a2d2afde5aa8453866df8706dfb7d6ddb", - "root_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "path_symbols": [ - "HttpControlChannel.__init__", - "HttpControlChannel._factory", - "HttpControlChannel.start" - ], - "path_symbol_ids": [ - "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "d1933f04137f52535b6525f1b93ff2cd83bfb216b480e887e791ed1714cda8e0" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "class HttpControlChannel(ControlChannel):\n def __init__(self, host: str, port: int, timeout: int) -> None:\n self._timeout = timeout\n self._runner = UvicornThreadRunner(host, port, timeout)\n self._factory = HttpControlAppFactory()\n self._actions: ControlActionSet | None = None\n\n async def start(self, actions: ControlActionSet) -> None:\n self._actions = actions\n app = self._factory.create(self._health_response, self._action_response)\n await self._runner.start(app)\n\n async def stop(self) -> None:\n await self._runner.stop()\n\n @property\n def port(self) -> int:\n return self._runner.port\n\n async def _health_response(self) -> dict[str, object]:\n if self._actions is None:\n return {\"status\": \"unhealthy\", \"detail\": \"control actions are not configured\"}\n return await asyncio.wait_for(self._actions.health(), timeout=float(self._timeout))\n\n async def _action_response(self, action: str, _client_source: str = \"unknown\") -> JSONResponse:\n if self._actions is None:\n return JSONResponse(content={\"status\": \"error\", \"detail\": f\"{action} handler is not configured\"}, status_code=404)\n callbacks = {\n \"start\": self._actions.start,\n \"stop\": self._actions.stop,\n \"status\": self._actions.status,\n }\n callback = callbacks.get(action)\n if callback is None:\n return JSONResponse(content={\"status\": \"error\", \"detail\": f\"unsupported action: {action}\"}, status_code=404)\n action_timeout = max(float(self._timeout), 10.0) if action in {\"start\", \"stop\"} else float(self._timeout)\n try:\n detail = await asyncio.wait_for(callback(), timeout=action_timeout)\n except asyncio.TimeoutError:\n return JSONResponse(\n content={\"status\": \"accepted\", \"detail\": f\"{action} operation is still in progress\"},\n status_code=202,\n )\n except Exception as exc:\n return JSONResponse(content={\"status\": \"error\", \"detail\": str(exc)}, status_code=500)\n return JSONResponse(content={\"status\": \"ok\", \"detail\": detail or f\"{action} action accepted\"}, status_code=200)", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/http_channel.py:HttpControlChannel", - "span_start": 12, - "span_end": 57, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.http_channel", - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "llm_answer": "## Объяснение работы класса `HttpControlChannel`\n\n### Назначение\nКласс `HttpControlChannel` предназначен для управления HTTP каналом контроля состояния приложения. Он отвечает за инициализацию сервера и обработку запросов, связанных с состоянием системы.\n\n### Ключевые зависимости\nКлючевая зависимость — это объект типа `UvicornThreadRunner`, используемый для запуска веб-сервера. Также используются классы и функции из модуля `HttpControlAppFactory`.\n\n### Поток данных или вызовов\n1. **Инициализация (`__init__`)**: \n - При создании объекта устанавливается значение тайм-аута и запускается объект `UvicornThreadRunner`. Этот объект используется для выполнения асинхронного запуска веб-приложения через фреймворк FastAPI.\n \n2. **Запуск (`start`)**:\n - Метод принимает набор действий (`ControlActionSet`), конфигурирует приложение, затем вызывает метод `start` у экземпляра `UvicornThreadRunner`.\n \n3. **Остановка (`stop`)**:\n - Остановка выполняется путем вызова метода `stop` у экземпляра `UvicornThreadRunner`.\n \n4. **Получение порта (`port`)**:\n - Возвращает порт, связанный с запущенным сервером.\n\n5. **Обработка health-запросов (_health_response)**:\n - Проверяет наличие настроенного набора действий. Если действия отсутствуют, возвращает состояние «unhealthy». В противном случае ожидает выполнение действия с заданным таймаутом.\n \n6. **Обработка пользовательских действий (_action_response)**:\n - Аналогично предыдущему пункту, проверяется наличие настроенных действий. Если действие отсутствует, возвращается ошибка. В противном случае обрабатывается соответствующее действие.\n\n### Важные детали реализации\n- **Таймаут**: Таймаут применяется при ожидании выполнения операций, таких как проверка здоровья системы и обработка пользовательских действий.\n- **Экземпляр `UvicornThreadRunner`**: Используется для обеспечения многопоточной работы и возможности одновременной обработки нескольких запросов.\n- **Модуль `HttpControlAppFactory`**: Отвечает за создание экземпляра FastAPI приложения, которое будет использоваться для обработки запросов.\n \n### Косвенные признаки (осторожный вывод)\nНа основе анализа графа зависимостей и логики работы можно осторожно предположить, что `HttpControlChannel` является частью общего механизма мониторинга и управления приложением. Это подтверждается его ролью «pipeline stage» и участием в обработке срезов данных («dataflow slices»).\n\n### Путь к файлу и имя сущности\n- Файл: `src/app_runtime/control/http_channel.py`\n- Имя сущности: `HttpControlChannel`", - "summary": { - "router": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "confidence": null - }, - "retrieval": { - "profile": "code", - "layers_hit": [ - "C0_SOURCE_CHUNKS", - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS", - "C4_SEMANTIC_ROLES" - ], - "evidence_sufficient": true - }, - "llm": { - "answer_status": "answered", - "groundedness": "grounded" - } - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "HttpControlChannel" - ], - "keyword_hints": [ - "HttpControlChannel" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C0_SOURCE_CHUNKS": "exact_path_fetch", - "C4_SEMANTIC_ROLES": "exact_path_fetch", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C3_ENTRYPOINTS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 8, - "C4_SEMANTIC_ROLES": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C3_ENTRYPOINTS": 6 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C4_SEMANTIC_ROLES": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "HttpControlChannel", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "HttpControlChannel", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C4_SEMANTIC_ROLES", - "query": "HttpControlChannel", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "HttpControlChannel", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - }, - { - "layer": "C3_ENTRYPOINTS", - "query": "HttpControlChannel", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 1, - "candidates_after_filter": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 6, - "candidates_after_filter": 6 - }, - { - "layer": "C3_ENTRYPOINTS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 3, - "candidates_after_filter": 3 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "HttpControlChannel", - "alternatives": [ - "HttpControlChannel" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C4_SEMANTIC_ROLES", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 6, - "fail_reason": null - }, - { - "layer": "C3_ENTRYPOINTS", - "status": "hit", - "hit_count": 3, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "router": 1, - "symbol_resolution": 0, - "retrieval_total": 150, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 43, - "C0_SOURCE_CHUNKS": 20, - "C4_SEMANTIC_ROLES": 17, - "C2_DEPENDENCY_GRAPH": 56, - "C3_ENTRYPOINTS": 12 - }, - "merge_rank": 23, - "prompt_build": 0, - "llm_call": 3932 - }, - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 795, - "evidence_rows": 12, - "evidence_chars": 3028 - }, - "evidence_summary": [ - { - "layer": "C1_SYMBOL_CATALOG", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "count": 6, - "unique_paths": 1 - }, - { - "layer": "C3_ENTRYPOINTS", - "count": 3, - "unique_paths": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 1, - "unique_paths": 1 - } - ], - "prompt_template_id": "intent_code_qa_explain_ru_v1", - "system_prompt_version": "v1" - }, - "router": { - "conversation_mode": "START", - "keyword_hints": [ - "HttpControlChannel" - ], - "path_scope": [] - }, - "llm": { - "used_evidence_count": 12, - "missing_evidence_reason": null - } - }, - "run_info": { - "case_id": "plba-fullchain-explain-http-control-channel", - "mode": "full_chain", - "run_started_at": "2026-03-12T11:45:52", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - }, - "input_request": { - "text": "Объясни класс HttpControlChannel", - "normalized_query": "Объясни класс HttpControlChannel" - }, - "steps": [ - { - "step": "intent_router", - "input": { - "query": "Объясни класс HttpControlChannel" - }, - "output": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Объясни класс HttpControlChannel" - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "HttpControlChannel" - ], - "keyword_hints": [ - "HttpControlChannel" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "timings_ms": { - "router": 1 - } - } - }, - { - "step": "retrieval", - "input": { - "query": "Объясни класс HttpControlChannel" - }, - "output": { - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "HttpControlChannel", - "alternatives": [ - "HttpControlChannel" - ], - "confidence": 0.99 - }, - "rag_count": 12, - "rag_rows": [ - { - "path": "src/app_runtime/control/http_channel.py", - "content": "class HttpControlChannel\nHttpControlChannel(ControlChannel)", - "layer": "C1_SYMBOL_CATALOG", - "title": "HttpControlChannel", - "span_start": 12, - "span_end": 57, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "1c9fbdc24819e5604c26ea55428a74310f03a03e1af197ed84846af61e42fdb0", - "qname": "HttpControlChannel", - "kind": "class", - "signature": "HttpControlChannel(ControlChannel)", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.control.http_channel", - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (10)", - "layer": "C4_SEMANTIC_ROLES", - "title": "HttpControlChannel", - "span_start": 12, - "span_end": 57, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 21, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "1c9fbdc24819e5604c26ea55428a74310f03a03e1af197ed84846af61e42fdb0", - "symbol_name": "HttpControlChannel", - "qname": "HttpControlChannel", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 10, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel.__init__\n -> HttpControlChannel._runner\n -> HttpControlChannel.start", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "HttpControlChannel.__init__:dataflow_slice", - "span_start": 15, - "span_end": 22, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "51d73913df709152258ed1b9a8c8f4eb3c575eccfe6b982aef0b28e0789a29da", - "edge_type": "dataflow_slice", - "src_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "src_qname": "HttpControlChannel.__init__", - "dst_symbol_id": "d1933f04137f52535b6525f1b93ff2cd83bfb216b480e887e791ed1714cda8e0", - "dst_ref": "HttpControlChannel.start", - "resolution": "resolved", - "slice_id": "51d73913df709152258ed1b9a8c8f4eb3c575eccfe6b982aef0b28e0789a29da", - "root_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "path_symbols": [ - "HttpControlChannel.__init__", - "HttpControlChannel._runner", - "HttpControlChannel.start" - ], - "path_symbol_ids": [ - "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "d1933f04137f52535b6525f1b93ff2cd83bfb216b480e887e791ed1714cda8e0" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel.__init__\n -> HttpControlChannel._runner\n -> HttpControlChannel.port", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "HttpControlChannel.__init__:dataflow_slice", - "span_start": 15, - "span_end": 29, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "c7167bab7218bb768ad7c11bfb40d1a3096e6071dd7817bba5fd864cf8f6de13", - "edge_type": "dataflow_slice", - "src_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "src_qname": "HttpControlChannel.__init__", - "dst_symbol_id": "3632ce8227f4a31e0768f2fb021a4d1ba28e1202633aa0f2fac902295931280f", - "dst_ref": "HttpControlChannel.port", - "resolution": "resolved", - "slice_id": "c7167bab7218bb768ad7c11bfb40d1a3096e6071dd7817bba5fd864cf8f6de13", - "root_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "path_symbols": [ - "HttpControlChannel.__init__", - "HttpControlChannel._runner", - "HttpControlChannel.port" - ], - "path_symbol_ids": [ - "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "3632ce8227f4a31e0768f2fb021a4d1ba28e1202633aa0f2fac902295931280f" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel.__init__\n -> HttpControlChannel._timeout\n -> HttpControlChannel._health_response", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "HttpControlChannel.__init__:dataflow_slice", - "span_start": 14, - "span_end": 34, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "f858f5c9e575f6c4cdfe3853571b7ee21d1f628a443541d2037c3dc9d0790bef", - "edge_type": "dataflow_slice", - "src_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "src_qname": "HttpControlChannel.__init__", - "dst_symbol_id": "e84bf04e9cd2127df235b7064d05f47e19f19a89c7c82f4c247231d4e8fa426a", - "dst_ref": "HttpControlChannel._health_response", - "resolution": "resolved", - "slice_id": "f858f5c9e575f6c4cdfe3853571b7ee21d1f628a443541d2037c3dc9d0790bef", - "root_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "path_symbols": [ - "HttpControlChannel.__init__", - "HttpControlChannel._timeout", - "HttpControlChannel._health_response" - ], - "path_symbol_ids": [ - "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "e84bf04e9cd2127df235b7064d05f47e19f19a89c7c82f4c247231d4e8fa426a" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel.__init__\n -> HttpControlChannel._timeout\n -> HttpControlChannel._action_response", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "HttpControlChannel.__init__:dataflow_slice", - "span_start": 14, - "span_end": 47, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "c3ef21fcae96c82c00be74b3ab827d4af2085d89cb3fa5521c19a174aad84dbb", - "edge_type": "dataflow_slice", - "src_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "src_qname": "HttpControlChannel.__init__", - "dst_symbol_id": "e64969024ccaeb34d8d91473fad07b3b3d341875846392e7a006406c7ada1954", - "dst_ref": "HttpControlChannel._action_response", - "resolution": "resolved", - "slice_id": "c3ef21fcae96c82c00be74b3ab827d4af2085d89cb3fa5521c19a174aad84dbb", - "root_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "path_symbols": [ - "HttpControlChannel.__init__", - "HttpControlChannel._timeout", - "HttpControlChannel._action_response" - ], - "path_symbol_ids": [ - "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "e64969024ccaeb34d8d91473fad07b3b3d341875846392e7a006406c7ada1954" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel.__init__\n -> HttpControlChannel._runner\n -> HttpControlChannel.stop", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "HttpControlChannel.__init__:dataflow_slice", - "span_start": 15, - "span_end": 25, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "0f827ef81a990258a8a74381c8564a8361afa6712dba3200592659c939adcb9d", - "edge_type": "dataflow_slice", - "src_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "src_qname": "HttpControlChannel.__init__", - "dst_symbol_id": "f29ab212620093d72be20e26c5a399624c7939a6056a728762ed3f84a250bfa3", - "dst_ref": "HttpControlChannel.stop", - "resolution": "resolved", - "slice_id": "0f827ef81a990258a8a74381c8564a8361afa6712dba3200592659c939adcb9d", - "root_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "path_symbols": [ - "HttpControlChannel.__init__", - "HttpControlChannel._runner", - "HttpControlChannel.stop" - ], - "path_symbol_ids": [ - "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "f29ab212620093d72be20e26c5a399624c7939a6056a728762ed3f84a250bfa3" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel.__init__\n -> HttpControlChannel._factory\n -> HttpControlChannel.start", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "HttpControlChannel.__init__:dataflow_slice", - "span_start": 16, - "span_end": 21, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e61ec25ded7dbe380d95ce2abcbc1d7a2d2afde5aa8453866df8706dfb7d6ddb", - "edge_type": "dataflow_slice", - "src_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "src_qname": "HttpControlChannel.__init__", - "dst_symbol_id": "d1933f04137f52535b6525f1b93ff2cd83bfb216b480e887e791ed1714cda8e0", - "dst_ref": "HttpControlChannel.start", - "resolution": "resolved", - "slice_id": "e61ec25ded7dbe380d95ce2abcbc1d7a2d2afde5aa8453866df8706dfb7d6ddb", - "root_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "path_symbols": [ - "HttpControlChannel.__init__", - "HttpControlChannel._factory", - "HttpControlChannel.start" - ], - "path_symbol_ids": [ - "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "d1933f04137f52535b6525f1b93ff2cd83bfb216b480e887e791ed1714cda8e0" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "class HttpControlChannel(ControlChannel):\n def __init__(self, host: str, port: int, timeout: int) -> None:\n self._timeout = timeout\n self._runner = UvicornThreadRunner(host, port, timeout)\n self._factory = HttpControlAppFactory()\n self._actions: ControlActionSet | None = None\n\n async def start(self, actions: ControlActionSet) -> None:\n self._actions = actions\n app = self._factory.create(self._health_response, self._action_response)\n await self._runner.start(app)\n\n async def stop(self) -> None:\n await self._runner.stop()\n\n @property\n def port(self) -> int:\n return self._runner.port\n\n async def _health_response(self) -> dict[str, object]:\n if self._actions is None:\n return {\"status\": \"unhealthy\", \"detail\": \"control actions are not configured\"}\n return await asyncio.wait_for(self._actions.health(), timeout=float(self._timeout))\n\n async def _action_response(self, action: str, _client_source: str = \"unknown\") -> JSONResponse:\n if self._actions is None:\n return JSONResponse(content={\"status\": \"error\", \"detail\": f\"{action} handler is not configured\"}, status_code=404)\n callbacks = {\n \"start\": self._actions.start,\n \"stop\": self._actions.stop,\n \"status\": self._actions.status,\n }\n callback = callbacks.get(action)\n if callback is None:\n return JSONResponse(content={\"status\": \"error\", \"detail\": f\"unsupported action: {action}\"}, status_code=404)\n action_timeout = max(float(self._timeout), 10.0) if action in {\"start\", \"stop\"} else float(self._timeout)\n try:\n detail = await asyncio.wait_for(callback(), timeout=action_timeout)\n except asyncio.TimeoutError:\n return JSONResponse(\n content={\"status\": \"accepted\", \"detail\": f\"{action} operation is still in progress\"},\n status_code=202,\n )\n except Exception as exc:\n return JSONResponse(content={\"status\": \"error\", \"detail\": str(exc)}, status_code=500)\n return JSONResponse(content={\"status\": \"ok\", \"detail\": detail or f\"{action} action accepted\"}, status_code=200)", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/http_channel.py:HttpControlChannel", - "span_start": 12, - "span_end": 57, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.http_channel", - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ] - }, - "diagnostics": { - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C0_SOURCE_CHUNKS": "exact_path_fetch", - "C4_SEMANTIC_ROLES": "exact_path_fetch", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C3_ENTRYPOINTS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 8, - "C4_SEMANTIC_ROLES": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C3_ENTRYPOINTS": 6 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C4_SEMANTIC_ROLES": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "HttpControlChannel", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "HttpControlChannel", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C4_SEMANTIC_ROLES", - "query": "HttpControlChannel", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "HttpControlChannel", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - }, - { - "layer": "C3_ENTRYPOINTS", - "query": "HttpControlChannel", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 1, - "candidates_after_filter": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 6, - "candidates_after_filter": 6 - }, - { - "layer": "C3_ENTRYPOINTS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 3, - "candidates_after_filter": 3 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "HttpControlChannel", - "alternatives": [ - "HttpControlChannel" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C4_SEMANTIC_ROLES", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 6, - "fail_reason": null - }, - { - "layer": "C3_ENTRYPOINTS", - "status": "hit", - "hit_count": 3, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "symbol_resolution": 0, - "retrieval_total": 150, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 43, - "C0_SOURCE_CHUNKS": 20, - "C4_SEMANTIC_ROLES": 17, - "C2_DEPENDENCY_GRAPH": 56, - "C3_ENTRYPOINTS": 12 - }, - "merge_rank": 23 - } - } - }, - { - "step": "llm_answer", - "input": { - "query": "Объясни класс HttpControlChannel", - "rag_count": 12 - }, - "output": { - "llm_answer": "## Объяснение работы класса `HttpControlChannel`\n\n### Назначение\nКласс `HttpControlChannel` предназначен для управления HTTP каналом контроля состояния приложения. Он отвечает за инициализацию сервера и обработку запросов, связанных с состоянием системы.\n\n### Ключевые зависимости\nКлючевая зависимость — это объект типа `UvicornThreadRunner`, используемый для запуска веб-сервера. Также используются классы и функции из модуля `HttpControlAppFactory`.\n\n### Поток данных или вызовов\n1. **Инициализация (`__init__`)**: \n - При создании объекта устанавливается значение тайм-аута и запускается объект `UvicornThreadRunner`. Этот объект используется для выполнения асинхронного запуска веб-приложения через фреймворк FastAPI.\n \n2. **Запуск (`start`)**:\n - Метод принимает набор действий (`ControlActionSet`), конфигурирует приложение, затем вызывает метод `start` у экземпляра `UvicornThreadRunner`.\n \n3. **Остановка (`stop`)**:\n - Остановка выполняется путем вызова метода `stop` у экземпляра `UvicornThreadRunner`.\n \n4. **Получение порта (`port`)**:\n - Возвращает порт, связанный с запущенным сервером.\n\n5. **Обработка health-запросов (_health_response)**:\n - Проверяет наличие настроенного набора действий. Если действия отсутствуют, возвращает состояние «unhealthy». В противном случае ожидает выполнение действия с заданным таймаутом.\n \n6. **Обработка пользовательских действий (_action_response)**:\n - Аналогично предыдущему пункту, проверяется наличие настроенных действий. Если действие отсутствует, возвращается ошибка. В противном случае обрабатывается соответствующее действие.\n\n### Важные детали реализации\n- **Таймаут**: Таймаут применяется при ожидании выполнения операций, таких как проверка здоровья системы и обработка пользовательских действий.\n- **Экземпляр `UvicornThreadRunner`**: Используется для обеспечения многопоточной работы и возможности одновременной обработки нескольких запросов.\n- **Модуль `HttpControlAppFactory`**: Отвечает за создание экземпляра FastAPI приложения, которое будет использоваться для обработки запросов.\n \n### Косвенные признаки (осторожный вывод)\nНа основе анализа графа зависимостей и логики работы можно осторожно предположить, что `HttpControlChannel` является частью общего механизма мониторинга и управления приложением. Это подтверждается его ролью «pipeline stage» и участием в обработке срезов данных («dataflow slices»).\n\n### Путь к файлу и имя сущности\n- Файл: `src/app_runtime/control/http_channel.py`\n- Имя сущности: `HttpControlChannel`" - }, - "diagnostics": { - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 795, - "evidence_rows": 12, - "evidence_chars": 3028 - }, - "evidence_summary": [ - { - "layer": "C1_SYMBOL_CATALOG", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "count": 6, - "unique_paths": 1 - }, - { - "layer": "C3_ENTRYPOINTS", - "count": 3, - "unique_paths": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 1, - "unique_paths": 1 - } - ], - "prompt_template_id": "intent_code_qa_explain_ru_v1", - "system_prompt_version": "v1" - }, - "timings_ms": { - "prompt_build": 0, - "llm_call": 3932 - } - } - } - ] - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_114552/full_chain_plba_code_retrieval_plba-fullchain-explain-http-control-channel.md b/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_114552/full_chain_plba_code_retrieval_plba-fullchain-explain-http-control-channel.md deleted file mode 100644 index dbb8d36..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_114552/full_chain_plba_code_retrieval_plba-fullchain-explain-http-control-channel.md +++ /dev/null @@ -1,34 +0,0 @@ -# plba-fullchain-explain-http-control-channel - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_retrieval.yaml -- runner: runtime -- mode: full_chain -- passed: True - -## Query -Объясни класс HttpControlChannel - -## Actual -{ - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 12, - "llm_answer": "## Объяснение работы класса `HttpControlChannel`\n\n### Назначение\nКласс `HttpControlChannel` предназначен для управления HTTP каналом контроля состояния приложения. Он отвечает за инициализацию сервера и обработку запросов, связанных с состоянием системы.\n\n### Ключевые зависимости\nКлючевая зависимость — это объект типа `UvicornThreadRunner`, используемый для запуска веб-сервера. Также используются классы и функции из модуля `HttpControlAppFactory`.\n\n### Поток данных или вызовов\n1. **Инициализация (`__init__`)**: \n - При создании объекта устанавливается значение тайм-аута и запускается объект `UvicornThreadRunner`. Этот объект используется для выполнения асинхронного запуска веб-приложения через фреймворк FastAPI.\n \n2. **Запуск (`start`)**:\n - Метод принимает набор действий (`ControlActionSet`), конфигурирует приложение, затем вызывает метод `start` у экземпляра `UvicornThreadRunner`.\n \n3. **Остановка (`stop`)**:\n - Остановка выполняется путем вызова метода `stop` у экземпляра `UvicornThreadRunner`.\n \n4. **Получение порта (`port`)**:\n - Возвращает порт, связанный с запущенным сервером.\n\n5. **Обработка health-запросов (_health_response)**:\n - Проверяет наличие настроенного набора действий. Если действия отсутствуют, возвращает состояние «unhealthy». В противном случае ожидает выполнение действия с заданным таймаутом.\n \n6. **Обработка пользовательских действий (_action_response)**:\n - Аналогично предыдущему пункту, проверяется наличие настроенных действий. Если действие отсутствует, возвращается ошибка. В противном случае обрабатывается соответствующее действие.\n\n### Важные детали реализации\n- **Таймаут**: Таймаут применяется при ожидании выполнения операций, таких как проверка здоровья системы и обработка пользовательских действий.\n- **Экземпляр `UvicornThreadRunner`**: Используется для обеспечения многопоточной работы и возможности одновременной обработки нескольких запросов.\n- **Модуль `HttpControlAppFactory`**: Отвечает за создание экземпляра FastAPI приложения, которое будет использоваться для обработки запросов.\n \n### Косвенные признаки (осторожный вывод)\nНа основе анализа графа зависимостей и логики работы можно осторожно предположить, что `HttpControlChannel` является частью общего механизма мониторинга и управления приложением. Это подтверждается его ролью «pipeline stage» и участием в обработке срезов данных («dataflow slices»).\n\n### Путь к файлу и имя сущности\n- Файл: `src/app_runtime/control/http_channel.py`\n- Имя сущности: `HttpControlChannel`", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "HttpControlChannel" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] -} - -## Mismatches -- none \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_114552/full_chain_plba_code_retrieval_plba-fullchain-explain-runtime-manager.json b/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_114552/full_chain_plba_code_retrieval_plba-fullchain-explain-runtime-manager.json deleted file mode 100644 index 9559c41..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_114552/full_chain_plba_code_retrieval_plba-fullchain-explain-runtime-manager.json +++ /dev/null @@ -1,2088 +0,0 @@ -{ - "case_id": "plba-fullchain-explain-runtime-manager", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_retrieval.yaml", - "runner": "runtime", - "mode": "full_chain", - "actual": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 12, - "llm_answer": "## Назначение класса `RuntimeManager`\nКласс `RuntimeManager` играет роль центрального координатора и менеджера всех ключевых компонентов системы runtime. Он отвечает за инициализацию, настройку и управление жизненным циклом различных сервисов и модулей приложения.\n\n## Ключевые зависимости\nКлючевыми зависимостями для работы класса являются следующие сущности:\n\n- **ConfigurationManager** (`configuration`): объект, хранящий конфигурационные параметры приложения.\n- **ServiceContainer** (`services`): контейнер для регистрации и управления сервисами.\n- **TraceService** (`traces`): инструмент для отслеживания событий и трассировки выполнения задач.\n- **HealthRegistry** (`health`): служба мониторинга состояния здоровья компонентов.\n- **LogManager** (`logs`): менеджер логирования действий и событий.\n- **WorkerSupervisor** (`workers`): супервизор рабочих процессов.\n- **ControlPlaneService** (`control_plane`): основной контроллер плоскости управления приложением.\n\nВсе эти компоненты передаются конструктору при создании экземпляра `RuntimeManager`.\n\n## Поток данных или вызовов\n### Инициализация и настройка\nПри вызове конструктора `RuntimeManager.__init__`, происходит следующее:\n\n1. Если аргументы отсутствуют, создаются соответствующие объекты по умолчанию (например, через конструктор по умолчанию).\n2. Все переданные аргументы сохраняются в соответствующие атрибуты объекта `self`.\n3. Вызывается метод `_register_core_services()`, который регистрирует основные сервисы в реестре модуля (`registry`).\n\n### Регистрация модулей\nМетод `register_module(module)` позволяет зарегистрировать дополнительные модули в системе runtime. Этот метод добавляет модуль в реестр зарегистрированных модулей и выполняет его инициализацию.\n\n### Управление состоянием\nВ классе используются атрибуты `_started`, `_state`, `_core_registered`, `_workers_registered` для управления текущим состоянием системы и компонентами, которые были успешно зарегистрированы.\n\n## Важные детали реализации\n### Константы\nВ классе определены константы:\n- `ACTION_TIMEOUT_SECONDS`: время ожидания действия до таймаута (по умолчанию 10 секунд).\n- `ACTION_POLL_INTERVAL_SECONDS`: интервал опроса состояния задачи (по умолчанию 0.05 секунды).\n\nЭти значения могут быть использованы различными методами внутри класса для управления поведением системных операций.\n\n### Методы и функции\nХотя приведенный фрагмент кода не полностью раскрывает все методы и их функциональность, можно выделить несколько важных методов и функций:\n\n- Метод `_register_core_services()` используется для регистрации основных сервисов в реестре модуля.\n- Метод `register_module(module)` предназначен для добавления новых модулей в систему runtime.\n\nОсторожный вывод: Хотя подробная информация о внутренних методах и их работе отсутствует, общий поток выполнения и зависимости достаточно четко обозначены.\n\n## Финальное резюме\nКласс `RuntimeManager` является ключевым компонентом архитектуры runtime-приложения. Он управляет основными ресурсами и сервисами, обеспечивает регистрацию дополнительных модулей и контролирует состояние системы. Использование реестра модулей и трекинг состояний позволяют эффективно управлять процессом выполнения задач и отслеживать работу сервисов.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "RuntimeManager" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "passed": true, - "mismatches": [], - "details": { - "case_id": "plba-fullchain-explain-runtime-manager", - "text": "Объясни как работает класс RuntimeManager", - "mode": "full_chain", - "run_started_at": "2026-03-12T11:45:52", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Объясни как работает класс RuntimeManager", - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "RuntimeManager", - "alternatives": [ - "RuntimeManager" - ], - "confidence": 0.99 - }, - "rag_count": 12, - "rag_rows": [ - { - "path": "src/app_runtime/core/runtime.py", - "content": "class RuntimeManager\nRuntimeManager", - "layer": "C1_SYMBOL_CATALOG", - "title": "RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "7e4a9381328c5803bbc6179458612fc4e947d928aa7bf8b4b2bebb2c8592f758", - "qname": "RuntimeManager", - "kind": "class", - "signature": "RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.core.runtime", - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests manager\n- orchestrates role-like calls (4)\n- reads and writes state attributes\n- participates in dataflow slices (50)", - "layer": "C4_SEMANTIC_ROLES", - "title": "RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 43, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "7e4a9381328c5803bbc6179458612fc4e947d928aa7bf8b4b2bebb2c8592f758", - "symbol_name": "RuntimeManager", - "qname": "RuntimeManager", - "role": "pipeline_stage", - "confidence": 0.67, - "dataflow_participation": 50, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.stop", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 25, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d", - "dst_ref": "ControlPlaneService.stop", - "resolution": "resolved", - "slice_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.stop" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._stop_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 51, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a", - "dst_ref": "ControlPlaneService._stop_async", - "resolution": "resolved", - "slice_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._stop_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.register_channel", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 17, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957", - "dst_ref": "ControlPlaneService.register_channel", - "resolution": "resolved", - "slice_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.register_channel" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.start", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 20, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154", - "dst_ref": "ControlPlaneService.start", - "resolution": "resolved", - "slice_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.start" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._start_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 47, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517", - "dst_ref": "ControlPlaneService._start_async", - "resolution": "resolved", - "slice_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._start_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager.add_config_file", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 32, - "span_end": 52, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "a23b8a11ebdb12708b60c96ea12a69f7f042082f1adfddd572444e246d81d167", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "57ffbd4f0d9fdf3507c2b8624312ce211f3d02fdf86a57a8ec90778d8a7b498d", - "dst_ref": "RuntimeManager.add_config_file", - "resolution": "resolved", - "slice_id": "a23b8a11ebdb12708b60c96ea12a69f7f042082f1adfddd572444e246d81d167", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager.add_config_file" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "57ffbd4f0d9fdf3507c2b8624312ce211f3d02fdf86a57a8ec90778d8a7b498d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "class RuntimeManager:\n ACTION_TIMEOUT_SECONDS = 10.0\n ACTION_POLL_INTERVAL_SECONDS = 0.05\n\n def __init__(\n self,\n configuration: ConfigurationManager | None = None,\n services: ServiceContainer | None = None,\n traces: TraceService | None = None,\n health: HealthRegistry | None = None,\n logs: LogManager | None = None,\n workers: WorkerSupervisor | None = None,\n control_plane: ControlPlaneService | None = None,\n ) -> None:\n self.configuration = configuration or ConfigurationManager()\n self.services = services or ServiceContainer()\n self.traces = traces or TraceService()\n self.health = health or HealthRegistry()\n self.logs = logs or LogManager()\n self.workers = workers or WorkerSupervisor()\n self.control_plane = control_plane or ControlPlaneService()\n self.registry = ModuleRegistry(self.services)\n self._started = False\n self._state = LifecycleState.IDLE\n self._core_registered = False\n self._workers_registered = False\n self._register_core_services()\n\n def register_module(self, module: ApplicationModule) -> None:\n self.registry.register_module(module.name)\n module.register(self.registry)\n\n def add_config_file(self, path: str) -> FileConfigProvider:\n provider = FileConfigProvider(path)\n self.configuration.add_provider(provider)\n return provider\n\n def start(self, *, start_control_plane: bool = True) -> None:\n if self._started:\n return\n self._state = LifecycleState.STARTING\n config = self.configuration.load()\n self.logs.apply_config(config)\n self._register_health_contributors()\n self._register_workers()\n self.workers.start()\n if start_control_plane:\n self.control_plane.start(self)\n self._started = True\n self._refresh_state()\n\n def stop(self, timeout: float = 30.0, force: bool = False, stop_control_plane: bool = True) -> None:\n if not self._started:\n return\n self._state = LifecycleState.STOPPING\n self.workers.stop(timeout=timeout, force=force)\n if stop_control_plane:\n self.control_plane.stop()\n self._started = False\n self._state = LifecycleState.STOPPED\n\n def status(self) -> dict[str, object]:\n self._refresh_state()\n return self.control_plane.snapshot(self)\n\n def current_health(self) -> HealthPayload:\n self._refresh_state()\n return self.health.payload(self._state, self.workers.healths())\n\n async def health_status(self) -> HealthPayload:\n return self.current_health()\n\n async def start_runtime(self) -> dict[str, object] | str:\n self._refresh_state()\n if self._started:\n return \"runtime already running\"\n if self._state == LifecycleState.STOPPING:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n\n self.start(start_control_plane=False)\n started = self._wait_for_state({LifecycleState.IDLE, LifecycleState.BUSY}, timeout=self.ACTION_TIMEOUT_SECONDS)\n if started:\n return self._action_detail(\"runtime started\", timed_out=False)\n return self._action_detail(\"runtime start is still in progress\", timed_out=True)\n\n async def stop_runtime(self) -> dict[str, object] | str:\n self._refresh_state()\n if not self._started:\n if self._state == LifecycleState.STOPPING:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n return \"runtime already stopped\"\n\n self._state = LifecycleState.STOPPING\n try:\n self.workers.stop(timeout=self.ACTION_TIMEOUT_SECONDS, force=False)\n except TimeoutError:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n\n self._started = False\n self._state = LifecycleState.STOPPED\n return self._action_detail(\"runtime stopped\", timed_out=False)\n\n async def runtime_status(self) -> str:\n self._refresh_state()\n return self._state.value\n\n def _register_core_services(self) -> None:\n if self._core_registered:\n return\n self.services.register(\"configuration\", self.configuration)\n self.services.register(\"traces\", self.traces)\n self.services.register(\"health\", self.health)\n self.services.register(\"logs\", self.logs)\n self.services.register(\"workers\", self.workers)\n self.services.register(\"control_plane\", self.control_plane)\n self._core_registered = True\n\n def _register_health_contributors(self) -> None:\n for contributor in self.registry.health_contributors:\n self.health.register(contributor)\n\n def _register_workers(self) -> None:\n if self._workers_registered:\n return\n for worker in self.registry.workers:\n self.workers.register(worker)\n self._workers_registered = True\n\n def _refresh_state(self) -> None:\n lifecycle = self.workers.lifecycle_state()\n\n if self._state == LifecycleState.STOPPING:\n if lifecycle == LifecycleState.STOPPED:\n self._started = False\n self._state = LifecycleState.STOPPED\n return\n\n if not self._started:\n if lifecycle == LifecycleState.STOPPED:\n self._state = LifecycleState.STOPPED\n return\n\n self._state = lifecycle\n\n def _wait_for_state(self, target_states: set[LifecycleState], *, timeout: float) -> bool:\n deadline = monotonic() + timeout\n while monotonic() < deadline:\n self._refresh_state()\n if self._state in target_states:\n return True\n sleep(self.ACTION_POLL_INTERVAL_SECONDS)\n self._refresh_state()\n return self._state in target_states\n\n def _action_detail(self, message: str, *, timed_out: bool) -> dict[str, object]:\n self._refresh_state()\n return {\n \"message\": message,\n \"state\": self._state.value,\n \"timed_out\": timed_out,\n \"workers\": self.workers.snapshot(),\n }", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/core/runtime.py:RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.core.runtime", - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "llm_answer": "## Назначение класса `RuntimeManager`\nКласс `RuntimeManager` играет роль центрального координатора и менеджера всех ключевых компонентов системы runtime. Он отвечает за инициализацию, настройку и управление жизненным циклом различных сервисов и модулей приложения.\n\n## Ключевые зависимости\nКлючевыми зависимостями для работы класса являются следующие сущности:\n\n- **ConfigurationManager** (`configuration`): объект, хранящий конфигурационные параметры приложения.\n- **ServiceContainer** (`services`): контейнер для регистрации и управления сервисами.\n- **TraceService** (`traces`): инструмент для отслеживания событий и трассировки выполнения задач.\n- **HealthRegistry** (`health`): служба мониторинга состояния здоровья компонентов.\n- **LogManager** (`logs`): менеджер логирования действий и событий.\n- **WorkerSupervisor** (`workers`): супервизор рабочих процессов.\n- **ControlPlaneService** (`control_plane`): основной контроллер плоскости управления приложением.\n\nВсе эти компоненты передаются конструктору при создании экземпляра `RuntimeManager`.\n\n## Поток данных или вызовов\n### Инициализация и настройка\nПри вызове конструктора `RuntimeManager.__init__`, происходит следующее:\n\n1. Если аргументы отсутствуют, создаются соответствующие объекты по умолчанию (например, через конструктор по умолчанию).\n2. Все переданные аргументы сохраняются в соответствующие атрибуты объекта `self`.\n3. Вызывается метод `_register_core_services()`, который регистрирует основные сервисы в реестре модуля (`registry`).\n\n### Регистрация модулей\nМетод `register_module(module)` позволяет зарегистрировать дополнительные модули в системе runtime. Этот метод добавляет модуль в реестр зарегистрированных модулей и выполняет его инициализацию.\n\n### Управление состоянием\nВ классе используются атрибуты `_started`, `_state`, `_core_registered`, `_workers_registered` для управления текущим состоянием системы и компонентами, которые были успешно зарегистрированы.\n\n## Важные детали реализации\n### Константы\nВ классе определены константы:\n- `ACTION_TIMEOUT_SECONDS`: время ожидания действия до таймаута (по умолчанию 10 секунд).\n- `ACTION_POLL_INTERVAL_SECONDS`: интервал опроса состояния задачи (по умолчанию 0.05 секунды).\n\nЭти значения могут быть использованы различными методами внутри класса для управления поведением системных операций.\n\n### Методы и функции\nХотя приведенный фрагмент кода не полностью раскрывает все методы и их функциональность, можно выделить несколько важных методов и функций:\n\n- Метод `_register_core_services()` используется для регистрации основных сервисов в реестре модуля.\n- Метод `register_module(module)` предназначен для добавления новых модулей в систему runtime.\n\nОсторожный вывод: Хотя подробная информация о внутренних методах и их работе отсутствует, общий поток выполнения и зависимости достаточно четко обозначены.\n\n## Финальное резюме\nКласс `RuntimeManager` является ключевым компонентом архитектуры runtime-приложения. Он управляет основными ресурсами и сервисами, обеспечивает регистрацию дополнительных модулей и контролирует состояние системы. Использование реестра модулей и трекинг состояний позволяют эффективно управлять процессом выполнения задач и отслеживать работу сервисов.", - "summary": { - "router": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "confidence": null - }, - "retrieval": { - "profile": "code", - "layers_hit": [ - "C0_SOURCE_CHUNKS", - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS", - "C4_SEMANTIC_ROLES" - ], - "evidence_sufficient": true - }, - "llm": { - "answer_status": "answered", - "groundedness": "grounded" - } - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "RuntimeManager" - ], - "keyword_hints": [ - "RuntimeManager" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C0_SOURCE_CHUNKS": "exact_path_fetch", - "C4_SEMANTIC_ROLES": "exact_path_fetch", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C3_ENTRYPOINTS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 8, - "C4_SEMANTIC_ROLES": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C3_ENTRYPOINTS": 6 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C4_SEMANTIC_ROLES": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C4_SEMANTIC_ROLES", - "query": "RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - }, - { - "layer": "C3_ENTRYPOINTS", - "query": "RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 1, - "candidates_after_filter": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 6, - "candidates_after_filter": 6 - }, - { - "layer": "C3_ENTRYPOINTS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 3, - "candidates_after_filter": 3 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "RuntimeManager", - "alternatives": [ - "RuntimeManager" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C4_SEMANTIC_ROLES", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 6, - "fail_reason": null - }, - { - "layer": "C3_ENTRYPOINTS", - "status": "hit", - "hit_count": 3, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "router": 0, - "symbol_resolution": 0, - "retrieval_total": 231, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 25, - "C0_SOURCE_CHUNKS": 14, - "C4_SEMANTIC_ROLES": 14, - "C2_DEPENDENCY_GRAPH": 54, - "C3_ENTRYPOINTS": 10 - }, - "merge_rank": 16, - "prompt_build": 0, - "llm_call": 4911 - }, - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 797, - "evidence_rows": 12, - "evidence_chars": 7130 - }, - "evidence_summary": [ - { - "layer": "C1_SYMBOL_CATALOG", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "count": 6, - "unique_paths": 2 - }, - { - "layer": "C3_ENTRYPOINTS", - "count": 3, - "unique_paths": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 1, - "unique_paths": 1 - } - ], - "prompt_template_id": "intent_code_qa_explain_ru_v1", - "system_prompt_version": "v1" - }, - "router": { - "conversation_mode": "START", - "keyword_hints": [ - "RuntimeManager" - ], - "path_scope": [] - }, - "llm": { - "used_evidence_count": 12, - "missing_evidence_reason": null - } - }, - "run_info": { - "case_id": "plba-fullchain-explain-runtime-manager", - "mode": "full_chain", - "run_started_at": "2026-03-12T11:45:52", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - }, - "input_request": { - "text": "Объясни как работает класс RuntimeManager", - "normalized_query": "Объясни как работает класс RuntimeManager" - }, - "steps": [ - { - "step": "intent_router", - "input": { - "query": "Объясни как работает класс RuntimeManager" - }, - "output": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Объясни как работает класс RuntimeManager" - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "RuntimeManager" - ], - "keyword_hints": [ - "RuntimeManager" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "timings_ms": { - "router": 0 - } - } - }, - { - "step": "retrieval", - "input": { - "query": "Объясни как работает класс RuntimeManager" - }, - "output": { - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "RuntimeManager", - "alternatives": [ - "RuntimeManager" - ], - "confidence": 0.99 - }, - "rag_count": 12, - "rag_rows": [ - { - "path": "src/app_runtime/core/runtime.py", - "content": "class RuntimeManager\nRuntimeManager", - "layer": "C1_SYMBOL_CATALOG", - "title": "RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "7e4a9381328c5803bbc6179458612fc4e947d928aa7bf8b4b2bebb2c8592f758", - "qname": "RuntimeManager", - "kind": "class", - "signature": "RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.core.runtime", - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests manager\n- orchestrates role-like calls (4)\n- reads and writes state attributes\n- participates in dataflow slices (50)", - "layer": "C4_SEMANTIC_ROLES", - "title": "RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 43, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "7e4a9381328c5803bbc6179458612fc4e947d928aa7bf8b4b2bebb2c8592f758", - "symbol_name": "RuntimeManager", - "qname": "RuntimeManager", - "role": "pipeline_stage", - "confidence": 0.67, - "dataflow_participation": 50, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.stop", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 25, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d", - "dst_ref": "ControlPlaneService.stop", - "resolution": "resolved", - "slice_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.stop" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._stop_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 51, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a", - "dst_ref": "ControlPlaneService._stop_async", - "resolution": "resolved", - "slice_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._stop_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.register_channel", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 17, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957", - "dst_ref": "ControlPlaneService.register_channel", - "resolution": "resolved", - "slice_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.register_channel" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.start", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 20, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154", - "dst_ref": "ControlPlaneService.start", - "resolution": "resolved", - "slice_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.start" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._start_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 47, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517", - "dst_ref": "ControlPlaneService._start_async", - "resolution": "resolved", - "slice_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._start_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager.add_config_file", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 32, - "span_end": 52, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "a23b8a11ebdb12708b60c96ea12a69f7f042082f1adfddd572444e246d81d167", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "57ffbd4f0d9fdf3507c2b8624312ce211f3d02fdf86a57a8ec90778d8a7b498d", - "dst_ref": "RuntimeManager.add_config_file", - "resolution": "resolved", - "slice_id": "a23b8a11ebdb12708b60c96ea12a69f7f042082f1adfddd572444e246d81d167", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager.add_config_file" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "57ffbd4f0d9fdf3507c2b8624312ce211f3d02fdf86a57a8ec90778d8a7b498d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "class RuntimeManager:\n ACTION_TIMEOUT_SECONDS = 10.0\n ACTION_POLL_INTERVAL_SECONDS = 0.05\n\n def __init__(\n self,\n configuration: ConfigurationManager | None = None,\n services: ServiceContainer | None = None,\n traces: TraceService | None = None,\n health: HealthRegistry | None = None,\n logs: LogManager | None = None,\n workers: WorkerSupervisor | None = None,\n control_plane: ControlPlaneService | None = None,\n ) -> None:\n self.configuration = configuration or ConfigurationManager()\n self.services = services or ServiceContainer()\n self.traces = traces or TraceService()\n self.health = health or HealthRegistry()\n self.logs = logs or LogManager()\n self.workers = workers or WorkerSupervisor()\n self.control_plane = control_plane or ControlPlaneService()\n self.registry = ModuleRegistry(self.services)\n self._started = False\n self._state = LifecycleState.IDLE\n self._core_registered = False\n self._workers_registered = False\n self._register_core_services()\n\n def register_module(self, module: ApplicationModule) -> None:\n self.registry.register_module(module.name)\n module.register(self.registry)\n\n def add_config_file(self, path: str) -> FileConfigProvider:\n provider = FileConfigProvider(path)\n self.configuration.add_provider(provider)\n return provider\n\n def start(self, *, start_control_plane: bool = True) -> None:\n if self._started:\n return\n self._state = LifecycleState.STARTING\n config = self.configuration.load()\n self.logs.apply_config(config)\n self._register_health_contributors()\n self._register_workers()\n self.workers.start()\n if start_control_plane:\n self.control_plane.start(self)\n self._started = True\n self._refresh_state()\n\n def stop(self, timeout: float = 30.0, force: bool = False, stop_control_plane: bool = True) -> None:\n if not self._started:\n return\n self._state = LifecycleState.STOPPING\n self.workers.stop(timeout=timeout, force=force)\n if stop_control_plane:\n self.control_plane.stop()\n self._started = False\n self._state = LifecycleState.STOPPED\n\n def status(self) -> dict[str, object]:\n self._refresh_state()\n return self.control_plane.snapshot(self)\n\n def current_health(self) -> HealthPayload:\n self._refresh_state()\n return self.health.payload(self._state, self.workers.healths())\n\n async def health_status(self) -> HealthPayload:\n return self.current_health()\n\n async def start_runtime(self) -> dict[str, object] | str:\n self._refresh_state()\n if self._started:\n return \"runtime already running\"\n if self._state == LifecycleState.STOPPING:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n\n self.start(start_control_plane=False)\n started = self._wait_for_state({LifecycleState.IDLE, LifecycleState.BUSY}, timeout=self.ACTION_TIMEOUT_SECONDS)\n if started:\n return self._action_detail(\"runtime started\", timed_out=False)\n return self._action_detail(\"runtime start is still in progress\", timed_out=True)\n\n async def stop_runtime(self) -> dict[str, object] | str:\n self._refresh_state()\n if not self._started:\n if self._state == LifecycleState.STOPPING:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n return \"runtime already stopped\"\n\n self._state = LifecycleState.STOPPING\n try:\n self.workers.stop(timeout=self.ACTION_TIMEOUT_SECONDS, force=False)\n except TimeoutError:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n\n self._started = False\n self._state = LifecycleState.STOPPED\n return self._action_detail(\"runtime stopped\", timed_out=False)\n\n async def runtime_status(self) -> str:\n self._refresh_state()\n return self._state.value\n\n def _register_core_services(self) -> None:\n if self._core_registered:\n return\n self.services.register(\"configuration\", self.configuration)\n self.services.register(\"traces\", self.traces)\n self.services.register(\"health\", self.health)\n self.services.register(\"logs\", self.logs)\n self.services.register(\"workers\", self.workers)\n self.services.register(\"control_plane\", self.control_plane)\n self._core_registered = True\n\n def _register_health_contributors(self) -> None:\n for contributor in self.registry.health_contributors:\n self.health.register(contributor)\n\n def _register_workers(self) -> None:\n if self._workers_registered:\n return\n for worker in self.registry.workers:\n self.workers.register(worker)\n self._workers_registered = True\n\n def _refresh_state(self) -> None:\n lifecycle = self.workers.lifecycle_state()\n\n if self._state == LifecycleState.STOPPING:\n if lifecycle == LifecycleState.STOPPED:\n self._started = False\n self._state = LifecycleState.STOPPED\n return\n\n if not self._started:\n if lifecycle == LifecycleState.STOPPED:\n self._state = LifecycleState.STOPPED\n return\n\n self._state = lifecycle\n\n def _wait_for_state(self, target_states: set[LifecycleState], *, timeout: float) -> bool:\n deadline = monotonic() + timeout\n while monotonic() < deadline:\n self._refresh_state()\n if self._state in target_states:\n return True\n sleep(self.ACTION_POLL_INTERVAL_SECONDS)\n self._refresh_state()\n return self._state in target_states\n\n def _action_detail(self, message: str, *, timed_out: bool) -> dict[str, object]:\n self._refresh_state()\n return {\n \"message\": message,\n \"state\": self._state.value,\n \"timed_out\": timed_out,\n \"workers\": self.workers.snapshot(),\n }", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/core/runtime.py:RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.core.runtime", - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ] - }, - "diagnostics": { - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C0_SOURCE_CHUNKS": "exact_path_fetch", - "C4_SEMANTIC_ROLES": "exact_path_fetch", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C3_ENTRYPOINTS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 8, - "C4_SEMANTIC_ROLES": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C3_ENTRYPOINTS": 6 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C4_SEMANTIC_ROLES": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C4_SEMANTIC_ROLES", - "query": "RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - }, - { - "layer": "C3_ENTRYPOINTS", - "query": "RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 1, - "candidates_after_filter": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 6, - "candidates_after_filter": 6 - }, - { - "layer": "C3_ENTRYPOINTS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 3, - "candidates_after_filter": 3 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "RuntimeManager", - "alternatives": [ - "RuntimeManager" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C4_SEMANTIC_ROLES", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 6, - "fail_reason": null - }, - { - "layer": "C3_ENTRYPOINTS", - "status": "hit", - "hit_count": 3, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "symbol_resolution": 0, - "retrieval_total": 231, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 25, - "C0_SOURCE_CHUNKS": 14, - "C4_SEMANTIC_ROLES": 14, - "C2_DEPENDENCY_GRAPH": 54, - "C3_ENTRYPOINTS": 10 - }, - "merge_rank": 16 - } - } - }, - { - "step": "llm_answer", - "input": { - "query": "Объясни как работает класс RuntimeManager", - "rag_count": 12 - }, - "output": { - "llm_answer": "## Назначение класса `RuntimeManager`\nКласс `RuntimeManager` играет роль центрального координатора и менеджера всех ключевых компонентов системы runtime. Он отвечает за инициализацию, настройку и управление жизненным циклом различных сервисов и модулей приложения.\n\n## Ключевые зависимости\nКлючевыми зависимостями для работы класса являются следующие сущности:\n\n- **ConfigurationManager** (`configuration`): объект, хранящий конфигурационные параметры приложения.\n- **ServiceContainer** (`services`): контейнер для регистрации и управления сервисами.\n- **TraceService** (`traces`): инструмент для отслеживания событий и трассировки выполнения задач.\n- **HealthRegistry** (`health`): служба мониторинга состояния здоровья компонентов.\n- **LogManager** (`logs`): менеджер логирования действий и событий.\n- **WorkerSupervisor** (`workers`): супервизор рабочих процессов.\n- **ControlPlaneService** (`control_plane`): основной контроллер плоскости управления приложением.\n\nВсе эти компоненты передаются конструктору при создании экземпляра `RuntimeManager`.\n\n## Поток данных или вызовов\n### Инициализация и настройка\nПри вызове конструктора `RuntimeManager.__init__`, происходит следующее:\n\n1. Если аргументы отсутствуют, создаются соответствующие объекты по умолчанию (например, через конструктор по умолчанию).\n2. Все переданные аргументы сохраняются в соответствующие атрибуты объекта `self`.\n3. Вызывается метод `_register_core_services()`, который регистрирует основные сервисы в реестре модуля (`registry`).\n\n### Регистрация модулей\nМетод `register_module(module)` позволяет зарегистрировать дополнительные модули в системе runtime. Этот метод добавляет модуль в реестр зарегистрированных модулей и выполняет его инициализацию.\n\n### Управление состоянием\nВ классе используются атрибуты `_started`, `_state`, `_core_registered`, `_workers_registered` для управления текущим состоянием системы и компонентами, которые были успешно зарегистрированы.\n\n## Важные детали реализации\n### Константы\nВ классе определены константы:\n- `ACTION_TIMEOUT_SECONDS`: время ожидания действия до таймаута (по умолчанию 10 секунд).\n- `ACTION_POLL_INTERVAL_SECONDS`: интервал опроса состояния задачи (по умолчанию 0.05 секунды).\n\nЭти значения могут быть использованы различными методами внутри класса для управления поведением системных операций.\n\n### Методы и функции\nХотя приведенный фрагмент кода не полностью раскрывает все методы и их функциональность, можно выделить несколько важных методов и функций:\n\n- Метод `_register_core_services()` используется для регистрации основных сервисов в реестре модуля.\n- Метод `register_module(module)` предназначен для добавления новых модулей в систему runtime.\n\nОсторожный вывод: Хотя подробная информация о внутренних методах и их работе отсутствует, общий поток выполнения и зависимости достаточно четко обозначены.\n\n## Финальное резюме\nКласс `RuntimeManager` является ключевым компонентом архитектуры runtime-приложения. Он управляет основными ресурсами и сервисами, обеспечивает регистрацию дополнительных модулей и контролирует состояние системы. Использование реестра модулей и трекинг состояний позволяют эффективно управлять процессом выполнения задач и отслеживать работу сервисов." - }, - "diagnostics": { - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 797, - "evidence_rows": 12, - "evidence_chars": 7130 - }, - "evidence_summary": [ - { - "layer": "C1_SYMBOL_CATALOG", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "count": 6, - "unique_paths": 2 - }, - { - "layer": "C3_ENTRYPOINTS", - "count": 3, - "unique_paths": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 1, - "unique_paths": 1 - } - ], - "prompt_template_id": "intent_code_qa_explain_ru_v1", - "system_prompt_version": "v1" - }, - "timings_ms": { - "prompt_build": 0, - "llm_call": 4911 - } - } - } - ] - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_114552/full_chain_plba_code_retrieval_plba-fullchain-explain-runtime-manager.md b/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_114552/full_chain_plba_code_retrieval_plba-fullchain-explain-runtime-manager.md deleted file mode 100644 index 7523702..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_114552/full_chain_plba_code_retrieval_plba-fullchain-explain-runtime-manager.md +++ /dev/null @@ -1,34 +0,0 @@ -# plba-fullchain-explain-runtime-manager - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_retrieval.yaml -- runner: runtime -- mode: full_chain -- passed: True - -## Query -Объясни как работает класс RuntimeManager - -## Actual -{ - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 12, - "llm_answer": "## Назначение класса `RuntimeManager`\nКласс `RuntimeManager` играет роль центрального координатора и менеджера всех ключевых компонентов системы runtime. Он отвечает за инициализацию, настройку и управление жизненным циклом различных сервисов и модулей приложения.\n\n## Ключевые зависимости\nКлючевыми зависимостями для работы класса являются следующие сущности:\n\n- **ConfigurationManager** (`configuration`): объект, хранящий конфигурационные параметры приложения.\n- **ServiceContainer** (`services`): контейнер для регистрации и управления сервисами.\n- **TraceService** (`traces`): инструмент для отслеживания событий и трассировки выполнения задач.\n- **HealthRegistry** (`health`): служба мониторинга состояния здоровья компонентов.\n- **LogManager** (`logs`): менеджер логирования действий и событий.\n- **WorkerSupervisor** (`workers`): супервизор рабочих процессов.\n- **ControlPlaneService** (`control_plane`): основной контроллер плоскости управления приложением.\n\nВсе эти компоненты передаются конструктору при создании экземпляра `RuntimeManager`.\n\n## Поток данных или вызовов\n### Инициализация и настройка\nПри вызове конструктора `RuntimeManager.__init__`, происходит следующее:\n\n1. Если аргументы отсутствуют, создаются соответствующие объекты по умолчанию (например, через конструктор по умолчанию).\n2. Все переданные аргументы сохраняются в соответствующие атрибуты объекта `self`.\n3. Вызывается метод `_register_core_services()`, который регистрирует основные сервисы в реестре модуля (`registry`).\n\n### Регистрация модулей\nМетод `register_module(module)` позволяет зарегистрировать дополнительные модули в системе runtime. Этот метод добавляет модуль в реестр зарегистрированных модулей и выполняет его инициализацию.\n\n### Управление состоянием\nВ классе используются атрибуты `_started`, `_state`, `_core_registered`, `_workers_registered` для управления текущим состоянием системы и компонентами, которые были успешно зарегистрированы.\n\n## Важные детали реализации\n### Константы\nВ классе определены константы:\n- `ACTION_TIMEOUT_SECONDS`: время ожидания действия до таймаута (по умолчанию 10 секунд).\n- `ACTION_POLL_INTERVAL_SECONDS`: интервал опроса состояния задачи (по умолчанию 0.05 секунды).\n\nЭти значения могут быть использованы различными методами внутри класса для управления поведением системных операций.\n\n### Методы и функции\nХотя приведенный фрагмент кода не полностью раскрывает все методы и их функциональность, можно выделить несколько важных методов и функций:\n\n- Метод `_register_core_services()` используется для регистрации основных сервисов в реестре модуля.\n- Метод `register_module(module)` предназначен для добавления новых модулей в систему runtime.\n\nОсторожный вывод: Хотя подробная информация о внутренних методах и их работе отсутствует, общий поток выполнения и зависимости достаточно четко обозначены.\n\n## Финальное резюме\nКласс `RuntimeManager` является ключевым компонентом архитектуры runtime-приложения. Он управляет основными ресурсами и сервисами, обеспечивает регистрацию дополнительных модулей и контролирует состояние системы. Использование реестра модулей и трекинг состояний позволяют эффективно управлять процессом выполнения задач и отслеживать работу сервисов.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "RuntimeManager" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] -} - -## Mismatches -- none \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_114552/full_chain_plba_code_retrieval_plba-fullchain-explain-trace-service.json b/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_114552/full_chain_plba_code_retrieval_plba-fullchain-explain-trace-service.json deleted file mode 100644 index 994e1b0..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_114552/full_chain_plba_code_retrieval_plba-fullchain-explain-trace-service.json +++ /dev/null @@ -1,2208 +0,0 @@ -{ - "case_id": "plba-fullchain-explain-trace-service", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_retrieval.yaml", - "runner": "runtime", - "mode": "full_chain", - "actual": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 14, - "llm_answer": "## Объяснение работы `TraceService`\n\n### Назначение\n`TraceService` — это сервис, предназначенный для управления контекстом трассировки и записи событий трассировки в транспортный механизм (`TraceTransport`). Он отвечает за создание новых трассировочных записей, их хранение и отправку в транспорт.\n\n### Ключевые зависимости\n- **TraceTransport**: отвечает за передачу трассировочной информации от приложения к внешнему хранилищу или системе сбора логов.\n- **TraceContextStore**: используется для временного хранения трассировочных записей до их передачи через транспорт.\n- **NoOpTraceTransport**: используется по умолчанию, если не передан другой транспорт. Этот транспорт просто игнорирует все сообщения без реальной отправки.\n\n### Поток данных или вызовов\n1. При инициализации сервиса (`TraceService.__init__`) создается объект записи контекста трассировки (`TraceRecordWriter`), который использует переданный транспорт для записи сообщений и контекстов.\n \n ```python\n def __init__(self, transport: TraceTransport | None = None, store: TraceContextStore | None = None):\n ...\n self._writer = TraceRecordWriter(self.transport)\n ```\n\n2. Метод `create_context` создает новую трассировочную запись с заданными атрибутами и помещает её в хранилище (`store.push()`), затем записывает её в транспорт через метод `_writer.write_context()`.\n \n ```python\n def create_context(\n self,\n *,\n alias: str,\n parent_id: str | None = None,\n kind: str | None = None,\n attrs: dict[str, Any] | None = None,\n ) -> str:\n ...\n self._writer.write_context(record)\n ```\n\n3. Метод `open_context` обеспечивает контекстно-зависимую область видимости при создании новой трассировочной записи внутри блока контекста.\n \n ```python\n with TraceService.open_context(...) as trace_id:\n # действия в области видимости\n ```\n\n### Важные детали реализации\n- **Транспорт трассировки** (`TraceTransport`): любой класс, реализующий интерфейс `write_context` и `write_message`, может быть использован в качестве транспорта. По умолчанию используется `NoOpTraceTransport`, который ничего не делает.\n \n ```python\n class NoOpTraceTransport:\n def write_context(self, record: TraceContextRecord) -> None:\n pass\n ```\n\n- **Запись контекста и сообщений**:\n - Контекстная запись (`record`) сохраняется в локальном хранилище (`TraceContextStore`) и передается в транспорт с помощью метода `_writer.write_context()`.\n - Сообщения трассировки (`TraceLogMessage`) также могут быть записаны в транспорт аналогично контекстным записям.\n\n### Осторожные выводы\n- Хотя конкретный транспорт трассировки не указан явно в предоставленном фрагменте кода, предполагается, что он подключается извне и предоставляет необходимые методы для записи контекста и сообщений.\n- Детали внутреннего устройства транспортного механизма не раскрыты напрямую в представленной информации, но можно предположить, что он должен поддерживать интерфейсы, описанные в классе `TraceTransport`.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "TraceService" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "passed": true, - "mismatches": [], - "details": { - "case_id": "plba-fullchain-explain-trace-service", - "text": "Как работает TraceService?", - "mode": "full_chain", - "run_started_at": "2026-03-12T11:45:52", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Как работает TraceService?", - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "TraceService", - "alternatives": [ - "TraceService" - ], - "confidence": 0.99 - }, - "rag_count": 14, - "rag_rows": [ - { - "path": "src/app_runtime/tracing/service.py", - "content": "class TraceService\nTraceService(TraceContextFactory)", - "layer": "C1_SYMBOL_CATALOG", - "title": "TraceService", - "span_start": 39, - "span_end": 166, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "c2b2b976d99f2c600000b753731b26e0a69adcb4359398b93073590c5d5d04f4", - "qname": "TraceService", - "kind": "class", - "signature": "TraceService(TraceContextFactory)", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.tracing.service", - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "TraceService\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests service\n- reads and writes state attributes\n- participates in dataflow slices (13)", - "layer": "C4_SEMANTIC_ROLES", - "title": "TraceService", - "span_start": 39, - "span_end": 166, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 60, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "c2b2b976d99f2c600000b753731b26e0a69adcb4359398b93073590c5d5d04f4", - "symbol_name": "TraceService", - "qname": "TraceService", - "role": "pipeline_stage", - "confidence": 0.57, - "dataflow_participation": 13, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "TraceService.__init__\n -> TraceService.store\n -> TraceService.create_context", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "TraceService.__init__:dataflow_slice", - "span_start": 42, - "span_end": 61, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "3b052062067a78aef3302ee1d996897e02a67d1b340397bea4f59fe147c0492a", - "edge_type": "dataflow_slice", - "src_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "src_qname": "TraceService.__init__", - "dst_symbol_id": "ff44881104b65ef50ee6fe16d367d4a81b6e7eb5c44c0963cf4543faec785d4a", - "dst_ref": "TraceService.create_context", - "resolution": "resolved", - "slice_id": "3b052062067a78aef3302ee1d996897e02a67d1b340397bea4f59fe147c0492a", - "root_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "path_symbols": [ - "TraceService.__init__", - "TraceService.store", - "TraceService.create_context" - ], - "path_symbol_ids": [ - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "ff44881104b65ef50ee6fe16d367d4a81b6e7eb5c44c0963cf4543faec785d4a" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "TraceService.__init__\n -> TraceService.store\n -> TraceService.close_context", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "TraceService.__init__:dataflow_slice", - "span_start": 42, - "span_end": 84, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "7a9353ef57c9ae5d19b3a0c6ac50fad05e6d21d31bbe1cd1cd07af6332ba6505", - "edge_type": "dataflow_slice", - "src_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "src_qname": "TraceService.__init__", - "dst_symbol_id": "01e14158dcced7e52d0c8ac84ac7b9a75225c261b6aca6a1d7da802d0994721c", - "dst_ref": "TraceService.close_context", - "resolution": "resolved", - "slice_id": "7a9353ef57c9ae5d19b3a0c6ac50fad05e6d21d31bbe1cd1cd07af6332ba6505", - "root_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "path_symbols": [ - "TraceService.__init__", - "TraceService.store", - "TraceService.close_context" - ], - "path_symbol_ids": [ - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "01e14158dcced7e52d0c8ac84ac7b9a75225c261b6aca6a1d7da802d0994721c" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "TraceService.__init__\n -> TraceService.store\n -> TraceService.open_context", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "TraceService.__init__:dataflow_slice", - "span_start": 42, - "span_end": 78, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "a6e13b9ebc4fed84586afd53ed92a4d14757e440873f572b2337d5622ee96031", - "edge_type": "dataflow_slice", - "src_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "src_qname": "TraceService.__init__", - "dst_symbol_id": "2da3d5b20a947bf63e14c103be4689b72fd837e0a82abd6c497846375d4c7426", - "dst_ref": "TraceService.open_context", - "resolution": "resolved", - "slice_id": "a6e13b9ebc4fed84586afd53ed92a4d14757e440873f572b2337d5622ee96031", - "root_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "path_symbols": [ - "TraceService.__init__", - "TraceService.store", - "TraceService.open_context" - ], - "path_symbol_ids": [ - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "2da3d5b20a947bf63e14c103be4689b72fd837e0a82abd6c497846375d4c7426" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "TraceService.__init__\n -> TraceService.transport\n -> TraceService.__init__", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "TraceService.__init__:dataflow_slice", - "span_start": 41, - "span_end": 43, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "1e923a93faa05c3c43ca9b19bd047007a8589ccce57d3cc1798ae7f9f200af98", - "edge_type": "dataflow_slice", - "src_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "src_qname": "TraceService.__init__", - "dst_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "dst_ref": "TraceService.__init__", - "resolution": "resolved", - "slice_id": "1e923a93faa05c3c43ca9b19bd047007a8589ccce57d3cc1798ae7f9f200af98", - "root_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "path_symbols": [ - "TraceService.__init__", - "TraceService.transport", - "TraceService.__init__" - ], - "path_symbol_ids": [ - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "TraceService.__init__\n -> TraceService.store\n -> TraceService.current_trace_id", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "TraceService.__init__:dataflow_slice", - "span_start": 42, - "span_end": 81, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "3ea17138634b1190bded77ddb84aa1595124f6519b246f24fc4b02bd62b5cac1", - "edge_type": "dataflow_slice", - "src_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "src_qname": "TraceService.__init__", - "dst_symbol_id": "41135180f7b3b9ab20e097e0747474e219c37dd2366ef08a7b43c1f3edb10b4c", - "dst_ref": "TraceService.current_trace_id", - "resolution": "resolved", - "slice_id": "3ea17138634b1190bded77ddb84aa1595124f6519b246f24fc4b02bd62b5cac1", - "root_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "path_symbols": [ - "TraceService.__init__", - "TraceService.store", - "TraceService.current_trace_id" - ], - "path_symbol_ids": [ - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "41135180f7b3b9ab20e097e0747474e219c37dd2366ef08a7b43c1f3edb10b4c" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "TraceService.__init__\n -> TraceService.store\n -> TraceService.step", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "TraceService.__init__:dataflow_slice", - "span_start": 42, - "span_end": 88, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "9f34c5da9b09fba99df6f6b1bde183a9aeb45111b8218a747c71590c2c9f60f2", - "edge_type": "dataflow_slice", - "src_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "src_qname": "TraceService.__init__", - "dst_symbol_id": "c44bfbc66cf747283f30088da3e011a10395031d41e77b74e523c24997f641ca", - "dst_ref": "TraceService.step", - "resolution": "resolved", - "slice_id": "9f34c5da9b09fba99df6f6b1bde183a9aeb45111b8218a747c71590c2c9f60f2", - "root_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "path_symbols": [ - "TraceService.__init__", - "TraceService.store", - "TraceService.step" - ], - "path_symbol_ids": [ - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "c44bfbc66cf747283f30088da3e011a10395031d41e77b74e523c24997f641ca" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "class TraceRecordWriter:\n def __init__(self, transport: TraceTransport) -> None:\n self._logger = logging.getLogger(__name__)\n self._transport = transport\n\n def write_context(self, record: TraceContextRecord) -> None:\n try:\n self._transport.write_context(record)\n except Exception:\n self._logger.exception(\"Trace transport failed to write context %s\", record.trace_id)\n\n def write_message(self, record: TraceLogMessage) -> None:\n try:\n self._transport.write_message(record)\n except Exception:\n self._logger.exception(\"Trace transport failed to write message for %s\", record.trace_id)", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/tracing/service.py:TraceRecordWriter", - "span_start": 21, - "span_end": 36, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.tracing.service", - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "class TraceService(TraceContextFactory):\n def __init__(self, transport: TraceTransport | None = None, store: TraceContextStore | None = None) -> None:\n self.transport = transport or NoOpTraceTransport()\n self.store = store or TraceContextStore()\n self._writer = TraceRecordWriter(self.transport)\n\n def create_context(\n self,\n *,\n alias: str,\n parent_id: str | None = None,\n kind: str | None = None,\n attrs: dict[str, Any] | None = None,\n ) -> str:\n record = TraceContextRecord(\n trace_id=uuid4().hex,\n alias=str(alias or \"\"),\n parent_id=parent_id,\n type=kind,\n event_time=utc_now(),\n attrs=dict(attrs or {}),\n )\n self.store.push(record)\n self._writer.write_context(record)\n return record.trace_id\n\n @contextmanager\n def open_context(\n self,\n *,\n alias: str,\n parent_id: str | None = None,\n kind: str | None = None,\n attrs: dict[str, Any] | None = None,\n ) -> Iterator[str]:\n trace_id = self.create_context(alias=alias, parent_id=parent_id, kind=kind, attrs=attrs)\n try:\n yield trace_id\n finally:\n self.store.pop()\n\n def current_trace_id(self) -> str | None:\n return self.store.current_trace_id()\n\n def close_context(self) -> str | None:\n previous = self.store.pop()\n return previous.record.trace_id if previous else None\n\n def step(self, name: str) -> None:\n self.store.set_step(str(name or \"\"))\n\n def info(self, message: str, *, status: str | None = None, attrs: dict[str, Any] | None = None) -> None:\n self._write_message(\"INFO\", message, status, attrs)\n\n def debug(self, message: str, *, status: str | None = None, attrs: dict[str, Any] | None = None) -> None:\n self._write_message(\"DEBUG\", message, status, attrs)\n\n def warning(self, message: str, *, status: str | None = None, attrs: dict[str, Any] | None = None) -> None:\n self._write_message(\"WARNING\", message, status, attrs)\n\n def error(self, message: str, *, status: str | None = None, attrs: dict[str, Any] | None = None) -> None:\n self._write_message(\"ERROR\", message, status, attrs)\n\n def exception(self, message: str, *, status: str = \"failed\", attrs: dict[str, Any] | None = None) -> None:\n self._write_message(\"ERROR\", message, status, attrs)\n\n def new_root(self, operation: str) -> TraceContext:\n trace_id = self.create_context(alias=operation, kind=\"operation\", attrs={\"operation\": operation})\n return TraceContext(trace_id=trace_id, span_id=trace_id, attributes={\"operation\": operation})\n\n def child_of(self, parent: TraceContext, operation: str) -> TraceContext:\n trace_id = self.create_context(\n alias=operation,\n parent_id=parent.trace_id,\n kind=\"worker\",\n attrs={\"operation\": operation},\n )\n return TraceContext(\n trace_id=trace_id,\n span_id=trace_id,\n parent_span_id=parent.span_id,\n attributes={\"operation\": operation},\n )\n\n def attach(self, metadata: dict[str, object], context: TraceContext) -> dict[str, object]:\n updated = dict(metadata)\n updated[\"trace_id\"] = context.trace_id\n updated[\"span_id\"] = context.span_id\n updated[\"parent_span_id\"] = context.parent_span_id\n return updated\n\n def resume(self, metadata: dict[str, object], operation: str) -> TraceContext:\n trace_id = str(metadata.get(\"trace_id\") or uuid4().hex)\n span_id = str(metadata.get(\"span_id\") or trace_id)\n parent_id = metadata.get(\"parent_span_id\")\n self.create_context(\n alias=operation,\n parent_id=str(parent_id) if parent_id else None,\n kind=\"worker\",\n attrs=dict(metadata),\n )\n return TraceContext(\n trace_id=trace_id,\n span_id=span_id,\n parent_span_id=str(parent_id) if parent_id else None,\n attributes={\"operation\": operation},\n )\n\n def _write_message(\n self,\n level: TraceLevel,\n message: str,\n status: str | None,\n attrs: dict[str, Any] | None,\n ) -> None:\n active = self.store.current()\n if active is None:\n raise RuntimeError(\"Trace context is not bound. Call create_context() first.\")\n record = TraceLogMessage(\n trace_id=active.record.trace_id,\n step=active.step,\n status=str(status or \"\"),\n message=str(message or \"\"),\n level=level,\n event_time=utc_now(),\n attrs=dict(attrs or {}),\n )\n self._writer.write_message(record)", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/tracing/service.py:TraceService", - "span_start": 39, - "span_end": 166, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 1, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.tracing.service", - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "class TraceManager(TraceService):\n \"\"\"Compatibility alias during the transition from ConfigManager-shaped naming.\"\"\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/tracing/service.py:TraceManager", - "span_start": 169, - "span_end": 170, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 2, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.tracing.service", - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "llm_answer": "## Объяснение работы `TraceService`\n\n### Назначение\n`TraceService` — это сервис, предназначенный для управления контекстом трассировки и записи событий трассировки в транспортный механизм (`TraceTransport`). Он отвечает за создание новых трассировочных записей, их хранение и отправку в транспорт.\n\n### Ключевые зависимости\n- **TraceTransport**: отвечает за передачу трассировочной информации от приложения к внешнему хранилищу или системе сбора логов.\n- **TraceContextStore**: используется для временного хранения трассировочных записей до их передачи через транспорт.\n- **NoOpTraceTransport**: используется по умолчанию, если не передан другой транспорт. Этот транспорт просто игнорирует все сообщения без реальной отправки.\n\n### Поток данных или вызовов\n1. При инициализации сервиса (`TraceService.__init__`) создается объект записи контекста трассировки (`TraceRecordWriter`), который использует переданный транспорт для записи сообщений и контекстов.\n \n ```python\n def __init__(self, transport: TraceTransport | None = None, store: TraceContextStore | None = None):\n ...\n self._writer = TraceRecordWriter(self.transport)\n ```\n\n2. Метод `create_context` создает новую трассировочную запись с заданными атрибутами и помещает её в хранилище (`store.push()`), затем записывает её в транспорт через метод `_writer.write_context()`.\n \n ```python\n def create_context(\n self,\n *,\n alias: str,\n parent_id: str | None = None,\n kind: str | None = None,\n attrs: dict[str, Any] | None = None,\n ) -> str:\n ...\n self._writer.write_context(record)\n ```\n\n3. Метод `open_context` обеспечивает контекстно-зависимую область видимости при создании новой трассировочной записи внутри блока контекста.\n \n ```python\n with TraceService.open_context(...) as trace_id:\n # действия в области видимости\n ```\n\n### Важные детали реализации\n- **Транспорт трассировки** (`TraceTransport`): любой класс, реализующий интерфейс `write_context` и `write_message`, может быть использован в качестве транспорта. По умолчанию используется `NoOpTraceTransport`, который ничего не делает.\n \n ```python\n class NoOpTraceTransport:\n def write_context(self, record: TraceContextRecord) -> None:\n pass\n ```\n\n- **Запись контекста и сообщений**:\n - Контекстная запись (`record`) сохраняется в локальном хранилище (`TraceContextStore`) и передается в транспорт с помощью метода `_writer.write_context()`.\n - Сообщения трассировки (`TraceLogMessage`) также могут быть записаны в транспорт аналогично контекстным записям.\n\n### Осторожные выводы\n- Хотя конкретный транспорт трассировки не указан явно в предоставленном фрагменте кода, предполагается, что он подключается извне и предоставляет необходимые методы для записи контекста и сообщений.\n- Детали внутреннего устройства транспортного механизма не раскрыты напрямую в представленной информации, но можно предположить, что он должен поддерживать интерфейсы, описанные в классе `TraceTransport`.", - "summary": { - "router": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "confidence": null - }, - "retrieval": { - "profile": "code", - "layers_hit": [ - "C0_SOURCE_CHUNKS", - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS", - "C4_SEMANTIC_ROLES" - ], - "evidence_sufficient": true - }, - "llm": { - "answer_status": "answered", - "groundedness": "grounded" - } - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "TraceService" - ], - "keyword_hints": [ - "TraceService" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C0_SOURCE_CHUNKS": "exact_path_fetch", - "C4_SEMANTIC_ROLES": "exact_path_fetch", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C3_ENTRYPOINTS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 8, - "C4_SEMANTIC_ROLES": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C3_ENTRYPOINTS": 6 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C4_SEMANTIC_ROLES": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "TraceService", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "TraceService", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C4_SEMANTIC_ROLES", - "query": "TraceService", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "TraceService", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - }, - { - "layer": "C3_ENTRYPOINTS", - "query": "TraceService", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 1, - "candidates_after_filter": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 6, - "candidates_after_filter": 6 - }, - { - "layer": "C3_ENTRYPOINTS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 3, - "candidates_after_filter": 3 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "TraceService", - "alternatives": [ - "TraceService" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 3, - "fail_reason": null - }, - { - "layer": "C4_SEMANTIC_ROLES", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 6, - "fail_reason": null - }, - { - "layer": "C3_ENTRYPOINTS", - "status": "hit", - "hit_count": 3, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "router": 1, - "symbol_resolution": 0, - "retrieval_total": 155, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 48, - "C0_SOURCE_CHUNKS": 25, - "C4_SEMANTIC_ROLES": 18, - "C2_DEPENDENCY_GRAPH": 50, - "C3_ENTRYPOINTS": 13 - }, - "merge_rank": 20, - "prompt_build": 0, - "llm_call": 4555 - }, - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 931, - "evidence_rows": 14, - "evidence_chars": 6323 - }, - "evidence_summary": [ - { - "layer": "C1_SYMBOL_CATALOG", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "count": 6, - "unique_paths": 1 - }, - { - "layer": "C3_ENTRYPOINTS", - "count": 3, - "unique_paths": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 3, - "unique_paths": 1 - } - ], - "prompt_template_id": "intent_code_qa_explain_ru_v1", - "system_prompt_version": "v1" - }, - "router": { - "conversation_mode": "START", - "keyword_hints": [ - "TraceService" - ], - "path_scope": [] - }, - "llm": { - "used_evidence_count": 14, - "missing_evidence_reason": null - } - }, - "run_info": { - "case_id": "plba-fullchain-explain-trace-service", - "mode": "full_chain", - "run_started_at": "2026-03-12T11:45:52", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - }, - "input_request": { - "text": "Как работает TraceService?", - "normalized_query": "Как работает TraceService?" - }, - "steps": [ - { - "step": "intent_router", - "input": { - "query": "Как работает TraceService?" - }, - "output": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Как работает TraceService?" - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "TraceService" - ], - "keyword_hints": [ - "TraceService" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "timings_ms": { - "router": 1 - } - } - }, - { - "step": "retrieval", - "input": { - "query": "Как работает TraceService?" - }, - "output": { - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "TraceService", - "alternatives": [ - "TraceService" - ], - "confidence": 0.99 - }, - "rag_count": 14, - "rag_rows": [ - { - "path": "src/app_runtime/tracing/service.py", - "content": "class TraceService\nTraceService(TraceContextFactory)", - "layer": "C1_SYMBOL_CATALOG", - "title": "TraceService", - "span_start": 39, - "span_end": 166, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "c2b2b976d99f2c600000b753731b26e0a69adcb4359398b93073590c5d5d04f4", - "qname": "TraceService", - "kind": "class", - "signature": "TraceService(TraceContextFactory)", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.tracing.service", - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "TraceService\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests service\n- reads and writes state attributes\n- participates in dataflow slices (13)", - "layer": "C4_SEMANTIC_ROLES", - "title": "TraceService", - "span_start": 39, - "span_end": 166, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 60, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "c2b2b976d99f2c600000b753731b26e0a69adcb4359398b93073590c5d5d04f4", - "symbol_name": "TraceService", - "qname": "TraceService", - "role": "pipeline_stage", - "confidence": 0.57, - "dataflow_participation": 13, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "TraceService.__init__\n -> TraceService.store\n -> TraceService.create_context", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "TraceService.__init__:dataflow_slice", - "span_start": 42, - "span_end": 61, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "3b052062067a78aef3302ee1d996897e02a67d1b340397bea4f59fe147c0492a", - "edge_type": "dataflow_slice", - "src_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "src_qname": "TraceService.__init__", - "dst_symbol_id": "ff44881104b65ef50ee6fe16d367d4a81b6e7eb5c44c0963cf4543faec785d4a", - "dst_ref": "TraceService.create_context", - "resolution": "resolved", - "slice_id": "3b052062067a78aef3302ee1d996897e02a67d1b340397bea4f59fe147c0492a", - "root_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "path_symbols": [ - "TraceService.__init__", - "TraceService.store", - "TraceService.create_context" - ], - "path_symbol_ids": [ - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "ff44881104b65ef50ee6fe16d367d4a81b6e7eb5c44c0963cf4543faec785d4a" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "TraceService.__init__\n -> TraceService.store\n -> TraceService.close_context", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "TraceService.__init__:dataflow_slice", - "span_start": 42, - "span_end": 84, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "7a9353ef57c9ae5d19b3a0c6ac50fad05e6d21d31bbe1cd1cd07af6332ba6505", - "edge_type": "dataflow_slice", - "src_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "src_qname": "TraceService.__init__", - "dst_symbol_id": "01e14158dcced7e52d0c8ac84ac7b9a75225c261b6aca6a1d7da802d0994721c", - "dst_ref": "TraceService.close_context", - "resolution": "resolved", - "slice_id": "7a9353ef57c9ae5d19b3a0c6ac50fad05e6d21d31bbe1cd1cd07af6332ba6505", - "root_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "path_symbols": [ - "TraceService.__init__", - "TraceService.store", - "TraceService.close_context" - ], - "path_symbol_ids": [ - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "01e14158dcced7e52d0c8ac84ac7b9a75225c261b6aca6a1d7da802d0994721c" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "TraceService.__init__\n -> TraceService.store\n -> TraceService.open_context", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "TraceService.__init__:dataflow_slice", - "span_start": 42, - "span_end": 78, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "a6e13b9ebc4fed84586afd53ed92a4d14757e440873f572b2337d5622ee96031", - "edge_type": "dataflow_slice", - "src_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "src_qname": "TraceService.__init__", - "dst_symbol_id": "2da3d5b20a947bf63e14c103be4689b72fd837e0a82abd6c497846375d4c7426", - "dst_ref": "TraceService.open_context", - "resolution": "resolved", - "slice_id": "a6e13b9ebc4fed84586afd53ed92a4d14757e440873f572b2337d5622ee96031", - "root_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "path_symbols": [ - "TraceService.__init__", - "TraceService.store", - "TraceService.open_context" - ], - "path_symbol_ids": [ - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "2da3d5b20a947bf63e14c103be4689b72fd837e0a82abd6c497846375d4c7426" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "TraceService.__init__\n -> TraceService.transport\n -> TraceService.__init__", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "TraceService.__init__:dataflow_slice", - "span_start": 41, - "span_end": 43, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "1e923a93faa05c3c43ca9b19bd047007a8589ccce57d3cc1798ae7f9f200af98", - "edge_type": "dataflow_slice", - "src_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "src_qname": "TraceService.__init__", - "dst_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "dst_ref": "TraceService.__init__", - "resolution": "resolved", - "slice_id": "1e923a93faa05c3c43ca9b19bd047007a8589ccce57d3cc1798ae7f9f200af98", - "root_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "path_symbols": [ - "TraceService.__init__", - "TraceService.transport", - "TraceService.__init__" - ], - "path_symbol_ids": [ - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "TraceService.__init__\n -> TraceService.store\n -> TraceService.current_trace_id", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "TraceService.__init__:dataflow_slice", - "span_start": 42, - "span_end": 81, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "3ea17138634b1190bded77ddb84aa1595124f6519b246f24fc4b02bd62b5cac1", - "edge_type": "dataflow_slice", - "src_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "src_qname": "TraceService.__init__", - "dst_symbol_id": "41135180f7b3b9ab20e097e0747474e219c37dd2366ef08a7b43c1f3edb10b4c", - "dst_ref": "TraceService.current_trace_id", - "resolution": "resolved", - "slice_id": "3ea17138634b1190bded77ddb84aa1595124f6519b246f24fc4b02bd62b5cac1", - "root_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "path_symbols": [ - "TraceService.__init__", - "TraceService.store", - "TraceService.current_trace_id" - ], - "path_symbol_ids": [ - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "41135180f7b3b9ab20e097e0747474e219c37dd2366ef08a7b43c1f3edb10b4c" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "TraceService.__init__\n -> TraceService.store\n -> TraceService.step", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "TraceService.__init__:dataflow_slice", - "span_start": 42, - "span_end": 88, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "9f34c5da9b09fba99df6f6b1bde183a9aeb45111b8218a747c71590c2c9f60f2", - "edge_type": "dataflow_slice", - "src_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "src_qname": "TraceService.__init__", - "dst_symbol_id": "c44bfbc66cf747283f30088da3e011a10395031d41e77b74e523c24997f641ca", - "dst_ref": "TraceService.step", - "resolution": "resolved", - "slice_id": "9f34c5da9b09fba99df6f6b1bde183a9aeb45111b8218a747c71590c2c9f60f2", - "root_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "path_symbols": [ - "TraceService.__init__", - "TraceService.store", - "TraceService.step" - ], - "path_symbol_ids": [ - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "c44bfbc66cf747283f30088da3e011a10395031d41e77b74e523c24997f641ca" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "class TraceRecordWriter:\n def __init__(self, transport: TraceTransport) -> None:\n self._logger = logging.getLogger(__name__)\n self._transport = transport\n\n def write_context(self, record: TraceContextRecord) -> None:\n try:\n self._transport.write_context(record)\n except Exception:\n self._logger.exception(\"Trace transport failed to write context %s\", record.trace_id)\n\n def write_message(self, record: TraceLogMessage) -> None:\n try:\n self._transport.write_message(record)\n except Exception:\n self._logger.exception(\"Trace transport failed to write message for %s\", record.trace_id)", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/tracing/service.py:TraceRecordWriter", - "span_start": 21, - "span_end": 36, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.tracing.service", - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "class TraceService(TraceContextFactory):\n def __init__(self, transport: TraceTransport | None = None, store: TraceContextStore | None = None) -> None:\n self.transport = transport or NoOpTraceTransport()\n self.store = store or TraceContextStore()\n self._writer = TraceRecordWriter(self.transport)\n\n def create_context(\n self,\n *,\n alias: str,\n parent_id: str | None = None,\n kind: str | None = None,\n attrs: dict[str, Any] | None = None,\n ) -> str:\n record = TraceContextRecord(\n trace_id=uuid4().hex,\n alias=str(alias or \"\"),\n parent_id=parent_id,\n type=kind,\n event_time=utc_now(),\n attrs=dict(attrs or {}),\n )\n self.store.push(record)\n self._writer.write_context(record)\n return record.trace_id\n\n @contextmanager\n def open_context(\n self,\n *,\n alias: str,\n parent_id: str | None = None,\n kind: str | None = None,\n attrs: dict[str, Any] | None = None,\n ) -> Iterator[str]:\n trace_id = self.create_context(alias=alias, parent_id=parent_id, kind=kind, attrs=attrs)\n try:\n yield trace_id\n finally:\n self.store.pop()\n\n def current_trace_id(self) -> str | None:\n return self.store.current_trace_id()\n\n def close_context(self) -> str | None:\n previous = self.store.pop()\n return previous.record.trace_id if previous else None\n\n def step(self, name: str) -> None:\n self.store.set_step(str(name or \"\"))\n\n def info(self, message: str, *, status: str | None = None, attrs: dict[str, Any] | None = None) -> None:\n self._write_message(\"INFO\", message, status, attrs)\n\n def debug(self, message: str, *, status: str | None = None, attrs: dict[str, Any] | None = None) -> None:\n self._write_message(\"DEBUG\", message, status, attrs)\n\n def warning(self, message: str, *, status: str | None = None, attrs: dict[str, Any] | None = None) -> None:\n self._write_message(\"WARNING\", message, status, attrs)\n\n def error(self, message: str, *, status: str | None = None, attrs: dict[str, Any] | None = None) -> None:\n self._write_message(\"ERROR\", message, status, attrs)\n\n def exception(self, message: str, *, status: str = \"failed\", attrs: dict[str, Any] | None = None) -> None:\n self._write_message(\"ERROR\", message, status, attrs)\n\n def new_root(self, operation: str) -> TraceContext:\n trace_id = self.create_context(alias=operation, kind=\"operation\", attrs={\"operation\": operation})\n return TraceContext(trace_id=trace_id, span_id=trace_id, attributes={\"operation\": operation})\n\n def child_of(self, parent: TraceContext, operation: str) -> TraceContext:\n trace_id = self.create_context(\n alias=operation,\n parent_id=parent.trace_id,\n kind=\"worker\",\n attrs={\"operation\": operation},\n )\n return TraceContext(\n trace_id=trace_id,\n span_id=trace_id,\n parent_span_id=parent.span_id,\n attributes={\"operation\": operation},\n )\n\n def attach(self, metadata: dict[str, object], context: TraceContext) -> dict[str, object]:\n updated = dict(metadata)\n updated[\"trace_id\"] = context.trace_id\n updated[\"span_id\"] = context.span_id\n updated[\"parent_span_id\"] = context.parent_span_id\n return updated\n\n def resume(self, metadata: dict[str, object], operation: str) -> TraceContext:\n trace_id = str(metadata.get(\"trace_id\") or uuid4().hex)\n span_id = str(metadata.get(\"span_id\") or trace_id)\n parent_id = metadata.get(\"parent_span_id\")\n self.create_context(\n alias=operation,\n parent_id=str(parent_id) if parent_id else None,\n kind=\"worker\",\n attrs=dict(metadata),\n )\n return TraceContext(\n trace_id=trace_id,\n span_id=span_id,\n parent_span_id=str(parent_id) if parent_id else None,\n attributes={\"operation\": operation},\n )\n\n def _write_message(\n self,\n level: TraceLevel,\n message: str,\n status: str | None,\n attrs: dict[str, Any] | None,\n ) -> None:\n active = self.store.current()\n if active is None:\n raise RuntimeError(\"Trace context is not bound. Call create_context() first.\")\n record = TraceLogMessage(\n trace_id=active.record.trace_id,\n step=active.step,\n status=str(status or \"\"),\n message=str(message or \"\"),\n level=level,\n event_time=utc_now(),\n attrs=dict(attrs or {}),\n )\n self._writer.write_message(record)", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/tracing/service.py:TraceService", - "span_start": 39, - "span_end": 166, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 1, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.tracing.service", - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "class TraceManager(TraceService):\n \"\"\"Compatibility alias during the transition from ConfigManager-shaped naming.\"\"\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/tracing/service.py:TraceManager", - "span_start": 169, - "span_end": 170, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 2, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.tracing.service", - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ] - }, - "diagnostics": { - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C0_SOURCE_CHUNKS": "exact_path_fetch", - "C4_SEMANTIC_ROLES": "exact_path_fetch", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C3_ENTRYPOINTS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 8, - "C4_SEMANTIC_ROLES": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C3_ENTRYPOINTS": 6 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C4_SEMANTIC_ROLES": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "TraceService", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "TraceService", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C4_SEMANTIC_ROLES", - "query": "TraceService", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "TraceService", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - }, - { - "layer": "C3_ENTRYPOINTS", - "query": "TraceService", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 1, - "candidates_after_filter": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 6, - "candidates_after_filter": 6 - }, - { - "layer": "C3_ENTRYPOINTS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 3, - "candidates_after_filter": 3 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "TraceService", - "alternatives": [ - "TraceService" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 3, - "fail_reason": null - }, - { - "layer": "C4_SEMANTIC_ROLES", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 6, - "fail_reason": null - }, - { - "layer": "C3_ENTRYPOINTS", - "status": "hit", - "hit_count": 3, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "symbol_resolution": 0, - "retrieval_total": 155, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 48, - "C0_SOURCE_CHUNKS": 25, - "C4_SEMANTIC_ROLES": 18, - "C2_DEPENDENCY_GRAPH": 50, - "C3_ENTRYPOINTS": 13 - }, - "merge_rank": 20 - } - } - }, - { - "step": "llm_answer", - "input": { - "query": "Как работает TraceService?", - "rag_count": 14 - }, - "output": { - "llm_answer": "## Объяснение работы `TraceService`\n\n### Назначение\n`TraceService` — это сервис, предназначенный для управления контекстом трассировки и записи событий трассировки в транспортный механизм (`TraceTransport`). Он отвечает за создание новых трассировочных записей, их хранение и отправку в транспорт.\n\n### Ключевые зависимости\n- **TraceTransport**: отвечает за передачу трассировочной информации от приложения к внешнему хранилищу или системе сбора логов.\n- **TraceContextStore**: используется для временного хранения трассировочных записей до их передачи через транспорт.\n- **NoOpTraceTransport**: используется по умолчанию, если не передан другой транспорт. Этот транспорт просто игнорирует все сообщения без реальной отправки.\n\n### Поток данных или вызовов\n1. При инициализации сервиса (`TraceService.__init__`) создается объект записи контекста трассировки (`TraceRecordWriter`), который использует переданный транспорт для записи сообщений и контекстов.\n \n ```python\n def __init__(self, transport: TraceTransport | None = None, store: TraceContextStore | None = None):\n ...\n self._writer = TraceRecordWriter(self.transport)\n ```\n\n2. Метод `create_context` создает новую трассировочную запись с заданными атрибутами и помещает её в хранилище (`store.push()`), затем записывает её в транспорт через метод `_writer.write_context()`.\n \n ```python\n def create_context(\n self,\n *,\n alias: str,\n parent_id: str | None = None,\n kind: str | None = None,\n attrs: dict[str, Any] | None = None,\n ) -> str:\n ...\n self._writer.write_context(record)\n ```\n\n3. Метод `open_context` обеспечивает контекстно-зависимую область видимости при создании новой трассировочной записи внутри блока контекста.\n \n ```python\n with TraceService.open_context(...) as trace_id:\n # действия в области видимости\n ```\n\n### Важные детали реализации\n- **Транспорт трассировки** (`TraceTransport`): любой класс, реализующий интерфейс `write_context` и `write_message`, может быть использован в качестве транспорта. По умолчанию используется `NoOpTraceTransport`, который ничего не делает.\n \n ```python\n class NoOpTraceTransport:\n def write_context(self, record: TraceContextRecord) -> None:\n pass\n ```\n\n- **Запись контекста и сообщений**:\n - Контекстная запись (`record`) сохраняется в локальном хранилище (`TraceContextStore`) и передается в транспорт с помощью метода `_writer.write_context()`.\n - Сообщения трассировки (`TraceLogMessage`) также могут быть записаны в транспорт аналогично контекстным записям.\n\n### Осторожные выводы\n- Хотя конкретный транспорт трассировки не указан явно в предоставленном фрагменте кода, предполагается, что он подключается извне и предоставляет необходимые методы для записи контекста и сообщений.\n- Детали внутреннего устройства транспортного механизма не раскрыты напрямую в представленной информации, но можно предположить, что он должен поддерживать интерфейсы, описанные в классе `TraceTransport`." - }, - "diagnostics": { - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 931, - "evidence_rows": 14, - "evidence_chars": 6323 - }, - "evidence_summary": [ - { - "layer": "C1_SYMBOL_CATALOG", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "count": 6, - "unique_paths": 1 - }, - { - "layer": "C3_ENTRYPOINTS", - "count": 3, - "unique_paths": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 3, - "unique_paths": 1 - } - ], - "prompt_template_id": "intent_code_qa_explain_ru_v1", - "system_prompt_version": "v1" - }, - "timings_ms": { - "prompt_build": 0, - "llm_call": 4555 - } - } - } - ] - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_114552/full_chain_plba_code_retrieval_plba-fullchain-explain-trace-service.md b/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_114552/full_chain_plba_code_retrieval_plba-fullchain-explain-trace-service.md deleted file mode 100644 index 64d005e..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_114552/full_chain_plba_code_retrieval_plba-fullchain-explain-trace-service.md +++ /dev/null @@ -1,34 +0,0 @@ -# plba-fullchain-explain-trace-service - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_retrieval.yaml -- runner: runtime -- mode: full_chain -- passed: True - -## Query -Как работает TraceService? - -## Actual -{ - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 14, - "llm_answer": "## Объяснение работы `TraceService`\n\n### Назначение\n`TraceService` — это сервис, предназначенный для управления контекстом трассировки и записи событий трассировки в транспортный механизм (`TraceTransport`). Он отвечает за создание новых трассировочных записей, их хранение и отправку в транспорт.\n\n### Ключевые зависимости\n- **TraceTransport**: отвечает за передачу трассировочной информации от приложения к внешнему хранилищу или системе сбора логов.\n- **TraceContextStore**: используется для временного хранения трассировочных записей до их передачи через транспорт.\n- **NoOpTraceTransport**: используется по умолчанию, если не передан другой транспорт. Этот транспорт просто игнорирует все сообщения без реальной отправки.\n\n### Поток данных или вызовов\n1. При инициализации сервиса (`TraceService.__init__`) создается объект записи контекста трассировки (`TraceRecordWriter`), который использует переданный транспорт для записи сообщений и контекстов.\n \n ```python\n def __init__(self, transport: TraceTransport | None = None, store: TraceContextStore | None = None):\n ...\n self._writer = TraceRecordWriter(self.transport)\n ```\n\n2. Метод `create_context` создает новую трассировочную запись с заданными атрибутами и помещает её в хранилище (`store.push()`), затем записывает её в транспорт через метод `_writer.write_context()`.\n \n ```python\n def create_context(\n self,\n *,\n alias: str,\n parent_id: str | None = None,\n kind: str | None = None,\n attrs: dict[str, Any] | None = None,\n ) -> str:\n ...\n self._writer.write_context(record)\n ```\n\n3. Метод `open_context` обеспечивает контекстно-зависимую область видимости при создании новой трассировочной записи внутри блока контекста.\n \n ```python\n with TraceService.open_context(...) as trace_id:\n # действия в области видимости\n ```\n\n### Важные детали реализации\n- **Транспорт трассировки** (`TraceTransport`): любой класс, реализующий интерфейс `write_context` и `write_message`, может быть использован в качестве транспорта. По умолчанию используется `NoOpTraceTransport`, который ничего не делает.\n \n ```python\n class NoOpTraceTransport:\n def write_context(self, record: TraceContextRecord) -> None:\n pass\n ```\n\n- **Запись контекста и сообщений**:\n - Контекстная запись (`record`) сохраняется в локальном хранилище (`TraceContextStore`) и передается в транспорт с помощью метода `_writer.write_context()`.\n - Сообщения трассировки (`TraceLogMessage`) также могут быть записаны в транспорт аналогично контекстным записям.\n\n### Осторожные выводы\n- Хотя конкретный транспорт трассировки не указан явно в предоставленном фрагменте кода, предполагается, что он подключается извне и предоставляет необходимые методы для записи контекста и сообщений.\n- Детали внутреннего устройства транспортного механизма не раскрыты напрямую в представленной информации, но можно предположить, что он должен поддерживать интерфейсы, описанные в классе `TraceTransport`.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "TraceService" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] -} - -## Mismatches -- none \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_114552/full_chain_plba_code_retrieval_plba-fullchain-explain-workflow-engine.json b/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_114552/full_chain_plba_code_retrieval_plba-fullchain-explain-workflow-engine.json deleted file mode 100644 index e1cc761..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_114552/full_chain_plba_code_retrieval_plba-fullchain-explain-workflow-engine.json +++ /dev/null @@ -1,2158 +0,0 @@ -{ - "case_id": "plba-fullchain-explain-workflow-engine", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_retrieval.yaml", - "runner": "runtime", - "mode": "full_chain", - "actual": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 13, - "llm_answer": "## Назначение класса `WorkflowEngine`\nКласс `WorkflowEngine` является ключевым компонентом системы управления рабочими процессами (`workflow engine`) и отвечает за выполнение рабочего процесса по определённому шаблону (`workflow definition`), обеспечивая управление состоянием контекста выполнения и логику перехода между узлами (`nodes`) рабочего процесса.\n\n## Ключевые зависимости\nКлючевыми зависимостями являются:\n- **`workflow`**: определение рабочего процесса, представляющее собой набор узлов и связей между ними.\n- **`persistence`**: механизм сохранения состояния текущего выполнения рабочего процесса.\n- **`traces`**: объект для ведения трассировки событий и состояний рабочих процессов.\n- **`hooks`**: дополнительные пользовательские обработчики событий и действий, расширяющие функционал класса.\n\n## Поток данных или вызовов\n1. При инициализации объекта класса (`WorkflowEngine.__init__()`):\n - Инициализируются внутренние атрибуты (`_workflow`, `_persistence`, `_transition_resolver`, `_traces`, `_hooks`, `_logger`).\n - Вызывается метод `_transition_resolver`, который используется для разрешения переходов между узлами рабочего процесса.\n \n2. Метод `run(context)` выполняет основную логику работы `WorkflowEngine`:\n - Начинается новый рабочий процесс с использованием механизма сохранения состояния (`persistence.start_run()`) и регистрации начального состояния выполнения.\n - Обновляется контекст выполнения рабочего процесса путём установки идентификатора текущего узла и общей информации о состоянии выполнения.\n - В логах регистрируется старт нового рабочего процесса.\n - Основной цикл выполнения рабочего процесса заключается в последовательном вызове методов для каждого узла рабочего процесса до тех пор, пока текущий узел не станет равным `None`.\n\n## Важные детали реализации\n### 1. Инициализация классов и объектов\n- Класс `TransitionResolver` используется для обеспечения корректного перехода от одного узла к другому в рабочем процессе.\n- Механизм трассировки (`traces`) позволяет вести подробное журналирование всех этапов выполнения рабочего процесса.\n \n### 2. Методы и функции\n- Метод `run(context)` инициирует выполнение цикла основного рабочего процесса.\n- Внутренний цикл использует переменную `current_name` для отслеживания текущего узла рабочего процесса и метода `node` для получения текущей задачи (`node`).\n\n### Осторожные выводы\nНекоторые аспекты, такие как конкретные механизмы работы механизмов трассировки (`traces`) и взаимодействия с механизмом хранения состояния (`persistence`), остаются неясными без дополнительного анализа соответствующих частей кода. Однако основной поток данных и логика явно изложены и понятны на основе доступных фрагментов кода.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "WorkflowEngine" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "passed": true, - "mismatches": [], - "details": { - "case_id": "plba-fullchain-explain-workflow-engine", - "text": "Объясни класс WorkflowEngine", - "mode": "full_chain", - "run_started_at": "2026-03-12T11:45:52", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Объясни класс WorkflowEngine", - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "WorkflowEngine", - "alternatives": [ - "WorkflowEngine", - "WorkflowEngineHooks" - ], - "confidence": 0.99 - }, - "rag_count": 13, - "rag_rows": [ - { - "path": "src/app_runtime/workflow/engine/workflow_engine.py", - "content": "class WorkflowEngine\nWorkflowEngine", - "layer": "C1_SYMBOL_CATALOG", - "title": "WorkflowEngine", - "span_start": 10, - "span_end": 86, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "57ec0a9f11c542c78e008684a888397e8d9ef4223671acb2567e631a0cbc70b4", - "qname": "WorkflowEngine", - "kind": "class", - "signature": "WorkflowEngine", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.workflow.engine.workflow_engine", - "is_test": false, - "blob_sha": "1057136e58a325cd5ab6f4e265d15665fb6a711b7022d9fab52a1a290afa2368", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/engine/hooks.py", - "content": "class WorkflowEngineHooks\nWorkflowEngineHooks", - "layer": "C1_SYMBOL_CATALOG", - "title": "WorkflowEngineHooks", - "span_start": 6, - "span_end": 14, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "914123ed510540061e116100fc87bba4195595ba696f8bfde2fd77ac6a5cd7e4", - "qname": "WorkflowEngineHooks", - "kind": "class", - "signature": "WorkflowEngineHooks", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.workflow.engine.hooks", - "is_test": false, - "blob_sha": "4b11672b0a9af1ae04bfce9d8e1f96572997d3e65e68108d7c797b88fa5fa47a", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/engine/workflow_engine.py", - "content": "WorkflowEngine\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (6)", - "layer": "C4_SEMANTIC_ROLES", - "title": "WorkflowEngine", - "span_start": 10, - "span_end": 86, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 25, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "57ec0a9f11c542c78e008684a888397e8d9ef4223671acb2567e631a0cbc70b4", - "symbol_name": "WorkflowEngine", - "qname": "WorkflowEngine", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 6, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "1057136e58a325cd5ab6f4e265d15665fb6a711b7022d9fab52a1a290afa2368", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/engine/workflow_engine.py", - "content": "WorkflowEngine.__init__\n -> WorkflowEngine._transition_resolver\n -> WorkflowEngine.run", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "WorkflowEngine.__init__:dataflow_slice", - "span_start": 14, - "span_end": 63, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "3abf07e5c245e0fe59785ba2d569c2ee56018715fc7f625a044ddaf6201f903d", - "edge_type": "dataflow_slice", - "src_symbol_id": "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "src_qname": "WorkflowEngine.__init__", - "dst_symbol_id": "a12cad0f5b238287e02f6d8d156cc764351d8c83246930487fa09d5ce6f2ace8", - "dst_ref": "WorkflowEngine.run", - "resolution": "resolved", - "slice_id": "3abf07e5c245e0fe59785ba2d569c2ee56018715fc7f625a044ddaf6201f903d", - "root_symbol_id": "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "path_symbols": [ - "WorkflowEngine.__init__", - "WorkflowEngine._transition_resolver", - "WorkflowEngine.run" - ], - "path_symbol_ids": [ - "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "a12cad0f5b238287e02f6d8d156cc764351d8c83246930487fa09d5ce6f2ace8" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "1057136e58a325cd5ab6f4e265d15665fb6a711b7022d9fab52a1a290afa2368", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/engine/workflow_engine.py", - "content": "WorkflowEngine.__init__\n -> WorkflowEngine._hooks\n -> WorkflowEngine.run", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "WorkflowEngine.__init__:dataflow_slice", - "span_start": 16, - "span_end": 34, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "d73db644b69c1eb35afd6eae9d6ac8674e49e30e9bcf9c020f9fdbfe754851b2", - "edge_type": "dataflow_slice", - "src_symbol_id": "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "src_qname": "WorkflowEngine.__init__", - "dst_symbol_id": "a12cad0f5b238287e02f6d8d156cc764351d8c83246930487fa09d5ce6f2ace8", - "dst_ref": "WorkflowEngine.run", - "resolution": "resolved", - "slice_id": "d73db644b69c1eb35afd6eae9d6ac8674e49e30e9bcf9c020f9fdbfe754851b2", - "root_symbol_id": "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "path_symbols": [ - "WorkflowEngine.__init__", - "WorkflowEngine._hooks", - "WorkflowEngine.run" - ], - "path_symbol_ids": [ - "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "a12cad0f5b238287e02f6d8d156cc764351d8c83246930487fa09d5ce6f2ace8" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "1057136e58a325cd5ab6f4e265d15665fb6a711b7022d9fab52a1a290afa2368", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/engine/workflow_engine.py", - "content": "WorkflowEngine.__init__\n -> WorkflowEngine._workflow\n -> WorkflowEngine.run", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "WorkflowEngine.__init__:dataflow_slice", - "span_start": 12, - "span_end": 29, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "b45ef3c54669b4910a8aed3a565804f275424a24007bc7e3c953389521f80249", - "edge_type": "dataflow_slice", - "src_symbol_id": "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "src_qname": "WorkflowEngine.__init__", - "dst_symbol_id": "a12cad0f5b238287e02f6d8d156cc764351d8c83246930487fa09d5ce6f2ace8", - "dst_ref": "WorkflowEngine.run", - "resolution": "resolved", - "slice_id": "b45ef3c54669b4910a8aed3a565804f275424a24007bc7e3c953389521f80249", - "root_symbol_id": "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "path_symbols": [ - "WorkflowEngine.__init__", - "WorkflowEngine._workflow", - "WorkflowEngine.run" - ], - "path_symbol_ids": [ - "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "a12cad0f5b238287e02f6d8d156cc764351d8c83246930487fa09d5ce6f2ace8" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "1057136e58a325cd5ab6f4e265d15665fb6a711b7022d9fab52a1a290afa2368", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/engine/workflow_engine.py", - "content": "WorkflowEngine.__init__\n -> WorkflowEngine._persistence\n -> WorkflowEngine.run", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "WorkflowEngine.__init__:dataflow_slice", - "span_start": 13, - "span_end": 20, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "8101338770016324ce05d61daa9935a444c75e6c94a0fae4275d5b50fcbcc70b", - "edge_type": "dataflow_slice", - "src_symbol_id": "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "src_qname": "WorkflowEngine.__init__", - "dst_symbol_id": "a12cad0f5b238287e02f6d8d156cc764351d8c83246930487fa09d5ce6f2ace8", - "dst_ref": "WorkflowEngine.run", - "resolution": "resolved", - "slice_id": "8101338770016324ce05d61daa9935a444c75e6c94a0fae4275d5b50fcbcc70b", - "root_symbol_id": "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "path_symbols": [ - "WorkflowEngine.__init__", - "WorkflowEngine._persistence", - "WorkflowEngine.run" - ], - "path_symbol_ids": [ - "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "a12cad0f5b238287e02f6d8d156cc764351d8c83246930487fa09d5ce6f2ace8" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "1057136e58a325cd5ab6f4e265d15665fb6a711b7022d9fab52a1a290afa2368", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/engine/workflow_engine.py", - "content": "WorkflowEngine.__init__\n -> WorkflowEngine._traces\n -> WorkflowEngine.run", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "WorkflowEngine.__init__:dataflow_slice", - "span_start": 15, - "span_end": 27, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "5006266616d534d721648391565e2ac0c9e7e9d9f8df00c17fba8989afb533a5", - "edge_type": "dataflow_slice", - "src_symbol_id": "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "src_qname": "WorkflowEngine.__init__", - "dst_symbol_id": "a12cad0f5b238287e02f6d8d156cc764351d8c83246930487fa09d5ce6f2ace8", - "dst_ref": "WorkflowEngine.run", - "resolution": "resolved", - "slice_id": "5006266616d534d721648391565e2ac0c9e7e9d9f8df00c17fba8989afb533a5", - "root_symbol_id": "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "path_symbols": [ - "WorkflowEngine.__init__", - "WorkflowEngine._traces", - "WorkflowEngine.run" - ], - "path_symbol_ids": [ - "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "a12cad0f5b238287e02f6d8d156cc764351d8c83246930487fa09d5ce6f2ace8" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "1057136e58a325cd5ab6f4e265d15665fb6a711b7022d9fab52a1a290afa2368", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/engine/workflow_engine.py", - "content": "WorkflowEngine.__init__\n -> WorkflowEngine._logger\n -> WorkflowEngine.run", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "WorkflowEngine.__init__:dataflow_slice", - "span_start": 17, - "span_end": 85, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "2f9927abb24794adb056b94bfb5d8538a5cbafb160da2079f52fca97fd694a2b", - "edge_type": "dataflow_slice", - "src_symbol_id": "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "src_qname": "WorkflowEngine.__init__", - "dst_symbol_id": "a12cad0f5b238287e02f6d8d156cc764351d8c83246930487fa09d5ce6f2ace8", - "dst_ref": "WorkflowEngine.run", - "resolution": "resolved", - "slice_id": "2f9927abb24794adb056b94bfb5d8538a5cbafb160da2079f52fca97fd694a2b", - "root_symbol_id": "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "path_symbols": [ - "WorkflowEngine.__init__", - "WorkflowEngine._logger", - "WorkflowEngine.run" - ], - "path_symbol_ids": [ - "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "a12cad0f5b238287e02f6d8d156cc764351d8c83246930487fa09d5ce6f2ace8" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "1057136e58a325cd5ab6f4e265d15665fb6a711b7022d9fab52a1a290afa2368", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/engine/workflow_engine.py", - "content": "class WorkflowEngine:\n def __init__(self, workflow, persistence, *, traces, hooks: WorkflowEngineHooks | None = None) -> None:\n self._workflow = workflow\n self._persistence = persistence\n self._transition_resolver = TransitionResolver()\n self._traces = traces\n self._hooks = hooks or WorkflowEngineHooks()\n self._logger = logging.getLogger(__name__)\n\n def run(self, context: WorkflowContext) -> dict[str, object]:\n run_id = self._persistence.start_run(\n self._workflow.definition.name,\n self._workflow.definition.start_at,\n context.snapshot(),\n )\n context.state.setdefault(\"runtime\", {})\n context.state[\"runtime\"][\"workflow_run_id\"] = run_id\n self._traces.step(\"workflow\")\n self._traces.info(\"Workflow started.\", status=\"started\", attrs={\"workflow_run_id\": run_id})\n current_name = self._workflow.definition.start_at\n while current_name is not None:\n node = self._workflow.definition.nodes[current_name]\n context.state[\"runtime\"][\"current_node\"] = current_name\n self._logger.info(\"Workflow run %s: step '%s' started.\", run_id, current_name)\n self._hooks.on_step_started(context, current_name)\n self._persistence.start_step(run_id, current_name, context.snapshot())\n self._traces.step(current_name)\n self._traces.debug(\n f\"Step '{current_name}' started.\",\n status=\"started\",\n attrs={\"workflow_run_id\": run_id, \"node\": current_name},\n )\n try:\n result = node.step.run(context)\n except Exception as error:\n self._persistence.fail_step(run_id, current_name, context.snapshot(), error)\n self._persistence.fail_run(run_id, context.snapshot())\n self._traces.error(\n f\"Step '{current_name}' failed: {error}\",\n status=\"failed\",\n attrs={\"exception_type\": type(error).__name__},\n )\n self._logger.exception(\"Workflow run %s: step '%s' failed.\", run_id, current_name)\n self._hooks.on_step_failed(context, current_name)\n raise\n context.state.update(result.updates)\n self._persistence.complete_step(\n run_id,\n current_name,\n result.status,\n result.transition,\n context.snapshot(),\n )\n next_node = self._transition_resolver.resolve(node, result)\n self._traces.debug(\n f\"Step '{current_name}' completed with transition '{result.transition}'.\",\n status=result.status,\n attrs={\n \"workflow_run_id\": run_id,\n \"from_node\": current_name,\n \"transition\": result.transition,\n \"to_node\": next_node,\n },\n )\n self._logger.info(\n \"Workflow run %s: step '%s' completed with transition '%s'.\",\n run_id,\n current_name,\n result.transition,\n )\n self._hooks.on_step_finished(context, current_name)\n current_name = next_node\n self._persistence.complete_run(run_id, context.snapshot())\n self._traces.step(\"workflow\")\n self._traces.info(\"Workflow completed.\", status=\"completed\", attrs={\"workflow_run_id\": run_id})\n self._logger.info(\"Workflow run %s completed.\", run_id)\n return {\"run_id\": run_id, \"status\": \"completed\", \"context\": context.snapshot()}", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/workflow/engine/workflow_engine.py:WorkflowEngine", - "span_start": 10, - "span_end": 86, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.workflow.engine.workflow_engine", - "is_test": false, - "blob_sha": "1057136e58a325cd5ab6f4e265d15665fb6a711b7022d9fab52a1a290afa2368", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "llm_answer": "## Назначение класса `WorkflowEngine`\nКласс `WorkflowEngine` является ключевым компонентом системы управления рабочими процессами (`workflow engine`) и отвечает за выполнение рабочего процесса по определённому шаблону (`workflow definition`), обеспечивая управление состоянием контекста выполнения и логику перехода между узлами (`nodes`) рабочего процесса.\n\n## Ключевые зависимости\nКлючевыми зависимостями являются:\n- **`workflow`**: определение рабочего процесса, представляющее собой набор узлов и связей между ними.\n- **`persistence`**: механизм сохранения состояния текущего выполнения рабочего процесса.\n- **`traces`**: объект для ведения трассировки событий и состояний рабочих процессов.\n- **`hooks`**: дополнительные пользовательские обработчики событий и действий, расширяющие функционал класса.\n\n## Поток данных или вызовов\n1. При инициализации объекта класса (`WorkflowEngine.__init__()`):\n - Инициализируются внутренние атрибуты (`_workflow`, `_persistence`, `_transition_resolver`, `_traces`, `_hooks`, `_logger`).\n - Вызывается метод `_transition_resolver`, который используется для разрешения переходов между узлами рабочего процесса.\n \n2. Метод `run(context)` выполняет основную логику работы `WorkflowEngine`:\n - Начинается новый рабочий процесс с использованием механизма сохранения состояния (`persistence.start_run()`) и регистрации начального состояния выполнения.\n - Обновляется контекст выполнения рабочего процесса путём установки идентификатора текущего узла и общей информации о состоянии выполнения.\n - В логах регистрируется старт нового рабочего процесса.\n - Основной цикл выполнения рабочего процесса заключается в последовательном вызове методов для каждого узла рабочего процесса до тех пор, пока текущий узел не станет равным `None`.\n\n## Важные детали реализации\n### 1. Инициализация классов и объектов\n- Класс `TransitionResolver` используется для обеспечения корректного перехода от одного узла к другому в рабочем процессе.\n- Механизм трассировки (`traces`) позволяет вести подробное журналирование всех этапов выполнения рабочего процесса.\n \n### 2. Методы и функции\n- Метод `run(context)` инициирует выполнение цикла основного рабочего процесса.\n- Внутренний цикл использует переменную `current_name` для отслеживания текущего узла рабочего процесса и метода `node` для получения текущей задачи (`node`).\n\n### Осторожные выводы\nНекоторые аспекты, такие как конкретные механизмы работы механизмов трассировки (`traces`) и взаимодействия с механизмом хранения состояния (`persistence`), остаются неясными без дополнительного анализа соответствующих частей кода. Однако основной поток данных и логика явно изложены и понятны на основе доступных фрагментов кода.", - "summary": { - "router": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "confidence": null - }, - "retrieval": { - "profile": "code", - "layers_hit": [ - "C0_SOURCE_CHUNKS", - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS", - "C4_SEMANTIC_ROLES" - ], - "evidence_sufficient": true - }, - "llm": { - "answer_status": "answered", - "groundedness": "grounded" - } - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "WorkflowEngine" - ], - "keyword_hints": [ - "WorkflowEngine" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C0_SOURCE_CHUNKS": "exact_path_fetch", - "C4_SEMANTIC_ROLES": "exact_path_fetch", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C3_ENTRYPOINTS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 8, - "C4_SEMANTIC_ROLES": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C3_ENTRYPOINTS": 6 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C4_SEMANTIC_ROLES": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "WorkflowEngine", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "WorkflowEngine", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C4_SEMANTIC_ROLES", - "query": "WorkflowEngine", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "WorkflowEngine", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - }, - { - "layer": "C3_ENTRYPOINTS", - "query": "WorkflowEngine", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 2, - "candidates_after_filter": 2 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 6, - "candidates_after_filter": 6 - }, - { - "layer": "C3_ENTRYPOINTS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 3, - "candidates_after_filter": 3 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "WorkflowEngine", - "alternatives": [ - "WorkflowEngine", - "WorkflowEngineHooks" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "hit", - "hit_count": 2, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C4_SEMANTIC_ROLES", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 6, - "fail_reason": null - }, - { - "layer": "C3_ENTRYPOINTS", - "status": "hit", - "hit_count": 3, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "router": 0, - "symbol_resolution": 0, - "retrieval_total": 125, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 35, - "C0_SOURCE_CHUNKS": 15, - "C4_SEMANTIC_ROLES": 16, - "C2_DEPENDENCY_GRAPH": 47, - "C3_ENTRYPOINTS": 11 - }, - "merge_rank": 27, - "prompt_build": 0, - "llm_call": 3756 - }, - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 780, - "evidence_rows": 13, - "evidence_chars": 4423 - }, - "evidence_summary": [ - { - "layer": "C1_SYMBOL_CATALOG", - "count": 2, - "unique_paths": 2 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "count": 6, - "unique_paths": 1 - }, - { - "layer": "C3_ENTRYPOINTS", - "count": 3, - "unique_paths": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 1, - "unique_paths": 1 - } - ], - "prompt_template_id": "intent_code_qa_explain_ru_v1", - "system_prompt_version": "v1" - }, - "router": { - "conversation_mode": "START", - "keyword_hints": [ - "WorkflowEngine" - ], - "path_scope": [] - }, - "llm": { - "used_evidence_count": 13, - "missing_evidence_reason": null - } - }, - "run_info": { - "case_id": "plba-fullchain-explain-workflow-engine", - "mode": "full_chain", - "run_started_at": "2026-03-12T11:45:52", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - }, - "input_request": { - "text": "Объясни класс WorkflowEngine", - "normalized_query": "Объясни класс WorkflowEngine" - }, - "steps": [ - { - "step": "intent_router", - "input": { - "query": "Объясни класс WorkflowEngine" - }, - "output": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Объясни класс WorkflowEngine" - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "WorkflowEngine" - ], - "keyword_hints": [ - "WorkflowEngine" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "timings_ms": { - "router": 0 - } - } - }, - { - "step": "retrieval", - "input": { - "query": "Объясни класс WorkflowEngine" - }, - "output": { - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "WorkflowEngine", - "alternatives": [ - "WorkflowEngine", - "WorkflowEngineHooks" - ], - "confidence": 0.99 - }, - "rag_count": 13, - "rag_rows": [ - { - "path": "src/app_runtime/workflow/engine/workflow_engine.py", - "content": "class WorkflowEngine\nWorkflowEngine", - "layer": "C1_SYMBOL_CATALOG", - "title": "WorkflowEngine", - "span_start": 10, - "span_end": 86, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "57ec0a9f11c542c78e008684a888397e8d9ef4223671acb2567e631a0cbc70b4", - "qname": "WorkflowEngine", - "kind": "class", - "signature": "WorkflowEngine", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.workflow.engine.workflow_engine", - "is_test": false, - "blob_sha": "1057136e58a325cd5ab6f4e265d15665fb6a711b7022d9fab52a1a290afa2368", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/engine/hooks.py", - "content": "class WorkflowEngineHooks\nWorkflowEngineHooks", - "layer": "C1_SYMBOL_CATALOG", - "title": "WorkflowEngineHooks", - "span_start": 6, - "span_end": 14, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "914123ed510540061e116100fc87bba4195595ba696f8bfde2fd77ac6a5cd7e4", - "qname": "WorkflowEngineHooks", - "kind": "class", - "signature": "WorkflowEngineHooks", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.workflow.engine.hooks", - "is_test": false, - "blob_sha": "4b11672b0a9af1ae04bfce9d8e1f96572997d3e65e68108d7c797b88fa5fa47a", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/engine/workflow_engine.py", - "content": "WorkflowEngine\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (6)", - "layer": "C4_SEMANTIC_ROLES", - "title": "WorkflowEngine", - "span_start": 10, - "span_end": 86, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 25, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "57ec0a9f11c542c78e008684a888397e8d9ef4223671acb2567e631a0cbc70b4", - "symbol_name": "WorkflowEngine", - "qname": "WorkflowEngine", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 6, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "1057136e58a325cd5ab6f4e265d15665fb6a711b7022d9fab52a1a290afa2368", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/engine/workflow_engine.py", - "content": "WorkflowEngine.__init__\n -> WorkflowEngine._transition_resolver\n -> WorkflowEngine.run", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "WorkflowEngine.__init__:dataflow_slice", - "span_start": 14, - "span_end": 63, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "3abf07e5c245e0fe59785ba2d569c2ee56018715fc7f625a044ddaf6201f903d", - "edge_type": "dataflow_slice", - "src_symbol_id": "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "src_qname": "WorkflowEngine.__init__", - "dst_symbol_id": "a12cad0f5b238287e02f6d8d156cc764351d8c83246930487fa09d5ce6f2ace8", - "dst_ref": "WorkflowEngine.run", - "resolution": "resolved", - "slice_id": "3abf07e5c245e0fe59785ba2d569c2ee56018715fc7f625a044ddaf6201f903d", - "root_symbol_id": "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "path_symbols": [ - "WorkflowEngine.__init__", - "WorkflowEngine._transition_resolver", - "WorkflowEngine.run" - ], - "path_symbol_ids": [ - "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "a12cad0f5b238287e02f6d8d156cc764351d8c83246930487fa09d5ce6f2ace8" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "1057136e58a325cd5ab6f4e265d15665fb6a711b7022d9fab52a1a290afa2368", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/engine/workflow_engine.py", - "content": "WorkflowEngine.__init__\n -> WorkflowEngine._hooks\n -> WorkflowEngine.run", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "WorkflowEngine.__init__:dataflow_slice", - "span_start": 16, - "span_end": 34, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "d73db644b69c1eb35afd6eae9d6ac8674e49e30e9bcf9c020f9fdbfe754851b2", - "edge_type": "dataflow_slice", - "src_symbol_id": "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "src_qname": "WorkflowEngine.__init__", - "dst_symbol_id": "a12cad0f5b238287e02f6d8d156cc764351d8c83246930487fa09d5ce6f2ace8", - "dst_ref": "WorkflowEngine.run", - "resolution": "resolved", - "slice_id": "d73db644b69c1eb35afd6eae9d6ac8674e49e30e9bcf9c020f9fdbfe754851b2", - "root_symbol_id": "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "path_symbols": [ - "WorkflowEngine.__init__", - "WorkflowEngine._hooks", - "WorkflowEngine.run" - ], - "path_symbol_ids": [ - "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "a12cad0f5b238287e02f6d8d156cc764351d8c83246930487fa09d5ce6f2ace8" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "1057136e58a325cd5ab6f4e265d15665fb6a711b7022d9fab52a1a290afa2368", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/engine/workflow_engine.py", - "content": "WorkflowEngine.__init__\n -> WorkflowEngine._workflow\n -> WorkflowEngine.run", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "WorkflowEngine.__init__:dataflow_slice", - "span_start": 12, - "span_end": 29, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "b45ef3c54669b4910a8aed3a565804f275424a24007bc7e3c953389521f80249", - "edge_type": "dataflow_slice", - "src_symbol_id": "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "src_qname": "WorkflowEngine.__init__", - "dst_symbol_id": "a12cad0f5b238287e02f6d8d156cc764351d8c83246930487fa09d5ce6f2ace8", - "dst_ref": "WorkflowEngine.run", - "resolution": "resolved", - "slice_id": "b45ef3c54669b4910a8aed3a565804f275424a24007bc7e3c953389521f80249", - "root_symbol_id": "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "path_symbols": [ - "WorkflowEngine.__init__", - "WorkflowEngine._workflow", - "WorkflowEngine.run" - ], - "path_symbol_ids": [ - "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "a12cad0f5b238287e02f6d8d156cc764351d8c83246930487fa09d5ce6f2ace8" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "1057136e58a325cd5ab6f4e265d15665fb6a711b7022d9fab52a1a290afa2368", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/engine/workflow_engine.py", - "content": "WorkflowEngine.__init__\n -> WorkflowEngine._persistence\n -> WorkflowEngine.run", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "WorkflowEngine.__init__:dataflow_slice", - "span_start": 13, - "span_end": 20, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "8101338770016324ce05d61daa9935a444c75e6c94a0fae4275d5b50fcbcc70b", - "edge_type": "dataflow_slice", - "src_symbol_id": "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "src_qname": "WorkflowEngine.__init__", - "dst_symbol_id": "a12cad0f5b238287e02f6d8d156cc764351d8c83246930487fa09d5ce6f2ace8", - "dst_ref": "WorkflowEngine.run", - "resolution": "resolved", - "slice_id": "8101338770016324ce05d61daa9935a444c75e6c94a0fae4275d5b50fcbcc70b", - "root_symbol_id": "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "path_symbols": [ - "WorkflowEngine.__init__", - "WorkflowEngine._persistence", - "WorkflowEngine.run" - ], - "path_symbol_ids": [ - "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "a12cad0f5b238287e02f6d8d156cc764351d8c83246930487fa09d5ce6f2ace8" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "1057136e58a325cd5ab6f4e265d15665fb6a711b7022d9fab52a1a290afa2368", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/engine/workflow_engine.py", - "content": "WorkflowEngine.__init__\n -> WorkflowEngine._traces\n -> WorkflowEngine.run", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "WorkflowEngine.__init__:dataflow_slice", - "span_start": 15, - "span_end": 27, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "5006266616d534d721648391565e2ac0c9e7e9d9f8df00c17fba8989afb533a5", - "edge_type": "dataflow_slice", - "src_symbol_id": "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "src_qname": "WorkflowEngine.__init__", - "dst_symbol_id": "a12cad0f5b238287e02f6d8d156cc764351d8c83246930487fa09d5ce6f2ace8", - "dst_ref": "WorkflowEngine.run", - "resolution": "resolved", - "slice_id": "5006266616d534d721648391565e2ac0c9e7e9d9f8df00c17fba8989afb533a5", - "root_symbol_id": "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "path_symbols": [ - "WorkflowEngine.__init__", - "WorkflowEngine._traces", - "WorkflowEngine.run" - ], - "path_symbol_ids": [ - "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "a12cad0f5b238287e02f6d8d156cc764351d8c83246930487fa09d5ce6f2ace8" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "1057136e58a325cd5ab6f4e265d15665fb6a711b7022d9fab52a1a290afa2368", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/engine/workflow_engine.py", - "content": "WorkflowEngine.__init__\n -> WorkflowEngine._logger\n -> WorkflowEngine.run", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "WorkflowEngine.__init__:dataflow_slice", - "span_start": 17, - "span_end": 85, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "2f9927abb24794adb056b94bfb5d8538a5cbafb160da2079f52fca97fd694a2b", - "edge_type": "dataflow_slice", - "src_symbol_id": "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "src_qname": "WorkflowEngine.__init__", - "dst_symbol_id": "a12cad0f5b238287e02f6d8d156cc764351d8c83246930487fa09d5ce6f2ace8", - "dst_ref": "WorkflowEngine.run", - "resolution": "resolved", - "slice_id": "2f9927abb24794adb056b94bfb5d8538a5cbafb160da2079f52fca97fd694a2b", - "root_symbol_id": "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "path_symbols": [ - "WorkflowEngine.__init__", - "WorkflowEngine._logger", - "WorkflowEngine.run" - ], - "path_symbol_ids": [ - "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "a12cad0f5b238287e02f6d8d156cc764351d8c83246930487fa09d5ce6f2ace8" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "1057136e58a325cd5ab6f4e265d15665fb6a711b7022d9fab52a1a290afa2368", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/engine/workflow_engine.py", - "content": "class WorkflowEngine:\n def __init__(self, workflow, persistence, *, traces, hooks: WorkflowEngineHooks | None = None) -> None:\n self._workflow = workflow\n self._persistence = persistence\n self._transition_resolver = TransitionResolver()\n self._traces = traces\n self._hooks = hooks or WorkflowEngineHooks()\n self._logger = logging.getLogger(__name__)\n\n def run(self, context: WorkflowContext) -> dict[str, object]:\n run_id = self._persistence.start_run(\n self._workflow.definition.name,\n self._workflow.definition.start_at,\n context.snapshot(),\n )\n context.state.setdefault(\"runtime\", {})\n context.state[\"runtime\"][\"workflow_run_id\"] = run_id\n self._traces.step(\"workflow\")\n self._traces.info(\"Workflow started.\", status=\"started\", attrs={\"workflow_run_id\": run_id})\n current_name = self._workflow.definition.start_at\n while current_name is not None:\n node = self._workflow.definition.nodes[current_name]\n context.state[\"runtime\"][\"current_node\"] = current_name\n self._logger.info(\"Workflow run %s: step '%s' started.\", run_id, current_name)\n self._hooks.on_step_started(context, current_name)\n self._persistence.start_step(run_id, current_name, context.snapshot())\n self._traces.step(current_name)\n self._traces.debug(\n f\"Step '{current_name}' started.\",\n status=\"started\",\n attrs={\"workflow_run_id\": run_id, \"node\": current_name},\n )\n try:\n result = node.step.run(context)\n except Exception as error:\n self._persistence.fail_step(run_id, current_name, context.snapshot(), error)\n self._persistence.fail_run(run_id, context.snapshot())\n self._traces.error(\n f\"Step '{current_name}' failed: {error}\",\n status=\"failed\",\n attrs={\"exception_type\": type(error).__name__},\n )\n self._logger.exception(\"Workflow run %s: step '%s' failed.\", run_id, current_name)\n self._hooks.on_step_failed(context, current_name)\n raise\n context.state.update(result.updates)\n self._persistence.complete_step(\n run_id,\n current_name,\n result.status,\n result.transition,\n context.snapshot(),\n )\n next_node = self._transition_resolver.resolve(node, result)\n self._traces.debug(\n f\"Step '{current_name}' completed with transition '{result.transition}'.\",\n status=result.status,\n attrs={\n \"workflow_run_id\": run_id,\n \"from_node\": current_name,\n \"transition\": result.transition,\n \"to_node\": next_node,\n },\n )\n self._logger.info(\n \"Workflow run %s: step '%s' completed with transition '%s'.\",\n run_id,\n current_name,\n result.transition,\n )\n self._hooks.on_step_finished(context, current_name)\n current_name = next_node\n self._persistence.complete_run(run_id, context.snapshot())\n self._traces.step(\"workflow\")\n self._traces.info(\"Workflow completed.\", status=\"completed\", attrs={\"workflow_run_id\": run_id})\n self._logger.info(\"Workflow run %s completed.\", run_id)\n return {\"run_id\": run_id, \"status\": \"completed\", \"context\": context.snapshot()}", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/workflow/engine/workflow_engine.py:WorkflowEngine", - "span_start": 10, - "span_end": 86, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.workflow.engine.workflow_engine", - "is_test": false, - "blob_sha": "1057136e58a325cd5ab6f4e265d15665fb6a711b7022d9fab52a1a290afa2368", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ] - }, - "diagnostics": { - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C0_SOURCE_CHUNKS": "exact_path_fetch", - "C4_SEMANTIC_ROLES": "exact_path_fetch", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C3_ENTRYPOINTS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 8, - "C4_SEMANTIC_ROLES": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C3_ENTRYPOINTS": 6 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C4_SEMANTIC_ROLES": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "WorkflowEngine", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "WorkflowEngine", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C4_SEMANTIC_ROLES", - "query": "WorkflowEngine", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "WorkflowEngine", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - }, - { - "layer": "C3_ENTRYPOINTS", - "query": "WorkflowEngine", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 2, - "candidates_after_filter": 2 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 6, - "candidates_after_filter": 6 - }, - { - "layer": "C3_ENTRYPOINTS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 3, - "candidates_after_filter": 3 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "WorkflowEngine", - "alternatives": [ - "WorkflowEngine", - "WorkflowEngineHooks" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "hit", - "hit_count": 2, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C4_SEMANTIC_ROLES", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 6, - "fail_reason": null - }, - { - "layer": "C3_ENTRYPOINTS", - "status": "hit", - "hit_count": 3, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "symbol_resolution": 0, - "retrieval_total": 125, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 35, - "C0_SOURCE_CHUNKS": 15, - "C4_SEMANTIC_ROLES": 16, - "C2_DEPENDENCY_GRAPH": 47, - "C3_ENTRYPOINTS": 11 - }, - "merge_rank": 27 - } - } - }, - { - "step": "llm_answer", - "input": { - "query": "Объясни класс WorkflowEngine", - "rag_count": 13 - }, - "output": { - "llm_answer": "## Назначение класса `WorkflowEngine`\nКласс `WorkflowEngine` является ключевым компонентом системы управления рабочими процессами (`workflow engine`) и отвечает за выполнение рабочего процесса по определённому шаблону (`workflow definition`), обеспечивая управление состоянием контекста выполнения и логику перехода между узлами (`nodes`) рабочего процесса.\n\n## Ключевые зависимости\nКлючевыми зависимостями являются:\n- **`workflow`**: определение рабочего процесса, представляющее собой набор узлов и связей между ними.\n- **`persistence`**: механизм сохранения состояния текущего выполнения рабочего процесса.\n- **`traces`**: объект для ведения трассировки событий и состояний рабочих процессов.\n- **`hooks`**: дополнительные пользовательские обработчики событий и действий, расширяющие функционал класса.\n\n## Поток данных или вызовов\n1. При инициализации объекта класса (`WorkflowEngine.__init__()`):\n - Инициализируются внутренние атрибуты (`_workflow`, `_persistence`, `_transition_resolver`, `_traces`, `_hooks`, `_logger`).\n - Вызывается метод `_transition_resolver`, который используется для разрешения переходов между узлами рабочего процесса.\n \n2. Метод `run(context)` выполняет основную логику работы `WorkflowEngine`:\n - Начинается новый рабочий процесс с использованием механизма сохранения состояния (`persistence.start_run()`) и регистрации начального состояния выполнения.\n - Обновляется контекст выполнения рабочего процесса путём установки идентификатора текущего узла и общей информации о состоянии выполнения.\n - В логах регистрируется старт нового рабочего процесса.\n - Основной цикл выполнения рабочего процесса заключается в последовательном вызове методов для каждого узла рабочего процесса до тех пор, пока текущий узел не станет равным `None`.\n\n## Важные детали реализации\n### 1. Инициализация классов и объектов\n- Класс `TransitionResolver` используется для обеспечения корректного перехода от одного узла к другому в рабочем процессе.\n- Механизм трассировки (`traces`) позволяет вести подробное журналирование всех этапов выполнения рабочего процесса.\n \n### 2. Методы и функции\n- Метод `run(context)` инициирует выполнение цикла основного рабочего процесса.\n- Внутренний цикл использует переменную `current_name` для отслеживания текущего узла рабочего процесса и метода `node` для получения текущей задачи (`node`).\n\n### Осторожные выводы\nНекоторые аспекты, такие как конкретные механизмы работы механизмов трассировки (`traces`) и взаимодействия с механизмом хранения состояния (`persistence`), остаются неясными без дополнительного анализа соответствующих частей кода. Однако основной поток данных и логика явно изложены и понятны на основе доступных фрагментов кода." - }, - "diagnostics": { - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 780, - "evidence_rows": 13, - "evidence_chars": 4423 - }, - "evidence_summary": [ - { - "layer": "C1_SYMBOL_CATALOG", - "count": 2, - "unique_paths": 2 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "count": 6, - "unique_paths": 1 - }, - { - "layer": "C3_ENTRYPOINTS", - "count": 3, - "unique_paths": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 1, - "unique_paths": 1 - } - ], - "prompt_template_id": "intent_code_qa_explain_ru_v1", - "system_prompt_version": "v1" - }, - "timings_ms": { - "prompt_build": 0, - "llm_call": 3756 - } - } - } - ] - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_114552/full_chain_plba_code_retrieval_plba-fullchain-explain-workflow-engine.md b/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_114552/full_chain_plba_code_retrieval_plba-fullchain-explain-workflow-engine.md deleted file mode 100644 index 0e28749..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_114552/full_chain_plba_code_retrieval_plba-fullchain-explain-workflow-engine.md +++ /dev/null @@ -1,34 +0,0 @@ -# plba-fullchain-explain-workflow-engine - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_retrieval.yaml -- runner: runtime -- mode: full_chain -- passed: True - -## Query -Объясни класс WorkflowEngine - -## Actual -{ - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 13, - "llm_answer": "## Назначение класса `WorkflowEngine`\nКласс `WorkflowEngine` является ключевым компонентом системы управления рабочими процессами (`workflow engine`) и отвечает за выполнение рабочего процесса по определённому шаблону (`workflow definition`), обеспечивая управление состоянием контекста выполнения и логику перехода между узлами (`nodes`) рабочего процесса.\n\n## Ключевые зависимости\nКлючевыми зависимостями являются:\n- **`workflow`**: определение рабочего процесса, представляющее собой набор узлов и связей между ними.\n- **`persistence`**: механизм сохранения состояния текущего выполнения рабочего процесса.\n- **`traces`**: объект для ведения трассировки событий и состояний рабочих процессов.\n- **`hooks`**: дополнительные пользовательские обработчики событий и действий, расширяющие функционал класса.\n\n## Поток данных или вызовов\n1. При инициализации объекта класса (`WorkflowEngine.__init__()`):\n - Инициализируются внутренние атрибуты (`_workflow`, `_persistence`, `_transition_resolver`, `_traces`, `_hooks`, `_logger`).\n - Вызывается метод `_transition_resolver`, который используется для разрешения переходов между узлами рабочего процесса.\n \n2. Метод `run(context)` выполняет основную логику работы `WorkflowEngine`:\n - Начинается новый рабочий процесс с использованием механизма сохранения состояния (`persistence.start_run()`) и регистрации начального состояния выполнения.\n - Обновляется контекст выполнения рабочего процесса путём установки идентификатора текущего узла и общей информации о состоянии выполнения.\n - В логах регистрируется старт нового рабочего процесса.\n - Основной цикл выполнения рабочего процесса заключается в последовательном вызове методов для каждого узла рабочего процесса до тех пор, пока текущий узел не станет равным `None`.\n\n## Важные детали реализации\n### 1. Инициализация классов и объектов\n- Класс `TransitionResolver` используется для обеспечения корректного перехода от одного узла к другому в рабочем процессе.\n- Механизм трассировки (`traces`) позволяет вести подробное журналирование всех этапов выполнения рабочего процесса.\n \n### 2. Методы и функции\n- Метод `run(context)` инициирует выполнение цикла основного рабочего процесса.\n- Внутренний цикл использует переменную `current_name` для отслеживания текущего узла рабочего процесса и метода `node` для получения текущей задачи (`node`).\n\n### Осторожные выводы\nНекоторые аспекты, такие как конкретные механизмы работы механизмов трассировки (`traces`) и взаимодействия с механизмом хранения состояния (`persistence`), остаются неясными без дополнительного анализа соответствующих частей кода. Однако основной поток данных и логика явно изложены и понятны на основе доступных фрагментов кода.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "WorkflowEngine" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] -} - -## Mismatches -- none \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_114552/summary.md b/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_114552/summary.md deleted file mode 100644 index bcdb9ea..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_114552/summary.md +++ /dev/null @@ -1,24 +0,0 @@ -# pipeline_setup_v2 summary - -Passed: 6/6 - - -| File | Case | Runner | Mode | Intent | Sub-intent | Pass | -| ----------------------------------- | -------------------------------------------- | ------- | ---------- | ------- | ---------- | ---- | -| full_chain_plba_code_retrieval.yaml | plba-fullchain-explain-runtime-manager | runtime | full_chain | CODE_QA | EXPLAIN | ✓ | -| full_chain_plba_code_retrieval.yaml | plba-fullchain-explain-http-control-channel | runtime | full_chain | CODE_QA | EXPLAIN | ✓ | -| full_chain_plba_code_retrieval.yaml | plba-fullchain-explain-control-plane-service | runtime | full_chain | CODE_QA | EXPLAIN | ✓ | -| full_chain_plba_code_retrieval.yaml | plba-fullchain-explain-trace-service | runtime | full_chain | CODE_QA | EXPLAIN | ✓ | -| full_chain_plba_code_retrieval.yaml | plba-fullchain-explain-create-runtime | runtime | full_chain | CODE_QA | EXPLAIN | ✓ | -| full_chain_plba_code_retrieval.yaml | plba-fullchain-explain-workflow-engine | runtime | full_chain | CODE_QA | EXPLAIN | ✓ | - - -## LLM Answers - -- **plba-fullchain-explain-runtime-manager**: ## Назначение класса `RuntimeManager` Класс `RuntimeManager` играет роль центрального координатора и менеджера всех ключевых компонентов системы runtime. Он отвечает за инициализацию, настройку и управление жизненным циклом различных сервисов и модулей приложения. ## Ключевые зависимости Ключевыми зависимостями для работы класса являются следующие сущности: - **ConfigurationManager** (`configuration`): объект, хранящий конфигурационные параметры приложения. - **ServiceContainer** (`services`): контейнер для регистрации и управления сервисами. - **TraceService** (`traces`): инструмент для отслеживания событий и трассировки выполнения задач. - **HealthRegistry** (`health`): служба мониторинга состояния здоровья компонентов. - **LogManager** (`logs`): менеджер логирования действий и событий. - **WorkerSupervisor** (`workers`): супервизор рабочих процессов. - **ControlPl… -- **plba-fullchain-explain-http-control-channel**: ## Объяснение работы класса `HttpControlChannel` ### Назначение Класс `HttpControlChannel` предназначен для управления HTTP каналом контроля состояния приложения. Он отвечает за инициализацию сервера и обработку запросов, связанных с состоянием системы. ### Ключевые зависимости Ключевая зависимость — это объект типа `UvicornThreadRunner`, используемый для запуска веб-сервера. Также используются классы и функции из модуля `HttpControlAppFactory`. ### Поток данных или вызовов 1. **Инициализация (`__init_`_)**: - При создании объекта устанавливается значение тайм-аута и запускается объект `UvicornThreadRunner`. Этот объект используется для выполнения асинхронного запуска веб-приложения через фреймворк FastAPI. 2. **Запуск (`start`)**: - Метод принимает набор действий (`ControlActionSet`), конфигурирует приложение, затем вызывает метод `start` у экземпляра `UvicornThread… -- **plba-fullchain-explain-control-plane-service**: ## Объяснение сущности `ControlPlaneService` ### Назначение `ControlPlaneService` — это сервис управления данными и состоянием приложения. Он отвечает за координацию различных каналов (`ControlChannel`) и управление жизненным циклом работы компонентов системы. Сервис также участвует в обработке срезов данных (`dataflow slices`), что указывает на его роль в общем потоке выполнения и управлении ресурсами. ### Ключевые зависимости Ключевой зависимостью является наличие списка каналов (`_channels`), через которые осуществляется взаимодействие с компонентами системы. Важными методами являются инициализация сервиса (`__init__`), регистрация новых каналов (`register_channel`), запуск (`start`) и остановка (`stop`) сервисов, а также создание снимка текущего состояния (`snapshot`). ### Поток данных или вызовов При создании объекта класса вызывается метод `__init__`, который и… -- **plba-fullchain-explain-trace-service**: ## Объяснение работы `TraceService` ### Назначение `TraceService` — это сервис, предназначенный для управления контекстом трассировки и записи событий трассировки в транспортный механизм (`TraceTransport`). Он отвечает за создание новых трассировочных записей, их хранение и отправку в транспорт. ### Ключевые зависимости - **TraceTransport**: отвечает за передачу трассировочной информации от приложения к внешнему хранилищу или системе сбора логов. - **TraceContextStore**: используется для временного хранения трассировочных записей до их передачи через транспорт. - **NoOpTraceTransport**: используется по умолчанию, если не передан другой транспорт. Этот транспорт просто игнорирует все сообщения без реальной отправки. ### Поток данных или вызовов 1. При инициализации сервиса (`TraceService.__init__`) создается объект записи контекста трассировки (`TraceRecordWriter`), к… -- **plba-fullchain-explain-create-runtime**: ## Объяснение функции `create_runtime` ### Назначение Функция `create_runtime` предназначена для инициализации и настройки основного объекта управления (`RuntimeManager`) приложения Plba. Она создаёт экземпляр менеджера выполнения и выполняет начальную настройку, включая загрузку конфигурационных файлов и регистрацию модулей. ### Ключевые зависимости Ключевая зависимость — объект класса `RuntimeManager`, который является основным объектом управления жизненным циклом приложения. Этот класс отвечает за управление всеми модулями и компонентами системы, включая их загрузку, конфигурирование и взаимодействие. ### Поток данных или вызовов 1. Функция принимает параметры конфигурации и определяет путь к файлу конфигурации, а также флаги включения HTTP-контроля и указания его параметров (хост, порт, таймаут). 2. Создаётся новый экземпляр `RuntimeManager`. 3. Если указан путь… -- **plba-fullchain-explain-workflow-engine**: ## Назначение класса `WorkflowEngine` Класс `WorkflowEngine` является ключевым компонентом системы управления рабочими процессами (`workflow engine`) и отвечает за выполнение рабочего процесса по определённому шаблону (`workflow definition`), обеспечивая управление состоянием контекста выполнения и логику перехода между узлами (`nodes`) рабочего процесса. ## Ключевые зависимости Ключевыми зависимостями являются: - `**workflow`**: определение рабочего процесса, представляющее собой набор узлов и связей между ними. - `**persistence**`: механизм сохранения состояния текущего выполнения рабочего процесса. - `**traces**`: объект для ведения трассировки событий и состояний рабочих процессов. - `**hooks**`: дополнительные пользовательские обработчики событий и действий, расширяющие функционал класса. ## Поток данных или вызовов 1. При инициализации объекта класса (`Workflow… - diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_115223/full_chain_plba_code_retrieval_plba-fullchain-explain-control-plane-service.json b/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_115223/full_chain_plba_code_retrieval_plba-fullchain-explain-control-plane-service.json deleted file mode 100644 index aa2b01c..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_115223/full_chain_plba_code_retrieval_plba-fullchain-explain-control-plane-service.json +++ /dev/null @@ -1,2056 +0,0 @@ -{ - "case_id": "plba-fullchain-explain-control-plane-service", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_retrieval.yaml", - "runner": "runtime", - "mode": "full_chain", - "actual": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 12, - "llm_answer": "## Объяснение работы сущности `ControlPlaneService`\n\n### Назначение\n`ControlPlaneService` — это служба управления состоянием и взаимодействием различных компонентов системы. Она отвечает за координацию действий между каналами (`ControlChannel`), настройку инициализации системы и ее остановки, а также сбор информации о текущем состоянии для последующего анализа.\n\n### Ключевые зависимости\n- **RuntimeManager**: объект-менеджер, предоставляющий доступ к различным аспектам состояния и конфигурации запущенной системы.\n- **ControlChannel**: интерфейс взаимодействия с различными компонентами системы через каналы передачи данных.\n\n### Поток данных или вызовов\n1. **Инициализация** (`__init__`) \n - При создании объекта службы выполняется настройка внутреннего списка каналов `_channels`.\n \n2. **Регистрация канала** (`register_channel`) \n - Канал добавляется в список внутренних каналов службы.\n\n3. **Запуск сервиса** (`start`) \n - Вызывается асинхронная функция `_start_async`, которая запускает набор действий:\n - Проверка текущего здоровья системы (`health_status`).\n - Запуск основного функционала системы (`start_runtime`).\n\n4. **Остановка сервиса** (`stop`) \n - Выполняется асинхронно с помощью функции `_stop_async`. Остановка производится только при наличии зарегистрированных каналов.\n\n5. **Сбор системной информации** (`snapshot`) \n - Собирается информация о текущем состоянии системы, включая состояние выполнения задач, модули, сервисы, рабочие процессы и конфигурационные параметры.\n\n6. **Асинхронные действия** \n - Все основные операции выполняются внутри событийных циклов с использованием библиотеки `asyncio`.\n\n### Важные детали реализации\n- **Асинхронность операций**: все критические операции по управлению системой реализованы асинхронно, что позволяет избежать блокировок и эффективно обрабатывать множественные задачи одновременно.\n- **Работа с состоянием**: сервис активно использует внутренние атрибуты (_channels, _state), которые могут быть изменены внешними компонентами.\n- **Взаимодействие с внешним окружением**: работа сервиса завязана на наличие внешних объектов типа `RuntimeManager`, без которых функциональность будет неполной.\n\n### Осторожные выводы\nНекоторые аспекты поведения сервиса могут быть определены только косвенно исходя из доступных контекстуальных сигналов, таких как сигнатура методов и их вызовов, однако конкретные механизмы взаимодействия с внешней средой требуют дополнительного исследования исходного кода или документации.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "ControlPlaneService" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "passed": true, - "mismatches": [], - "details": { - "case_id": "plba-fullchain-explain-control-plane-service", - "text": "Объясни класс ControlPlaneService", - "mode": "full_chain", - "run_started_at": "2026-03-12T11:52:23", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Объясни класс ControlPlaneService", - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "ControlPlaneService", - "alternatives": [ - "ControlPlaneService" - ], - "confidence": 0.99 - }, - "rag_count": 12, - "rag_rows": [ - { - "path": "src/app_runtime/control/service.py", - "content": "class ControlPlaneService\nControlPlaneService", - "layer": "C1_SYMBOL_CATALOG", - "title": "ControlPlaneService", - "span_start": 12, - "span_end": 52, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "b13471e5916986dccffb53fab613812842965705e6b3a89ae549d30c9e91e9aa", - "qname": "ControlPlaneService", - "kind": "class", - "signature": "ControlPlaneService", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.control.service", - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests service\n- reads and writes state attributes\n- participates in dataflow slices (5)", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlPlaneService", - "span_start": 12, - "span_end": 52, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 68, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "b13471e5916986dccffb53fab613812842965705e6b3a89ae549d30c9e91e9aa", - "symbol_name": "ControlPlaneService", - "qname": "ControlPlaneService", - "role": "pipeline_stage", - "confidence": 0.57, - "dataflow_participation": 5, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.stop", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 25, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d", - "dst_ref": "ControlPlaneService.stop", - "resolution": "resolved", - "slice_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.stop" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._stop_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 51, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a", - "dst_ref": "ControlPlaneService._stop_async", - "resolution": "resolved", - "slice_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._stop_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.register_channel", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 17, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957", - "dst_ref": "ControlPlaneService.register_channel", - "resolution": "resolved", - "slice_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.register_channel" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.start", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 20, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154", - "dst_ref": "ControlPlaneService.start", - "resolution": "resolved", - "slice_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.start" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._start_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 47, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517", - "dst_ref": "ControlPlaneService._start_async", - "resolution": "resolved", - "slice_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._start_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.register_channel reads_attr self._channels.append", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.register_channel:reads_attr", - "span_start": 17, - "span_end": 17, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "1ee5925deffdc38ba15b88bf7c89e5fcd1a78f493fe30f2deb827d714a1b18e8", - "edge_type": "reads_attr", - "src_symbol_id": "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957", - "src_qname": "ControlPlaneService.register_channel", - "dst_symbol_id": null, - "dst_ref": "self._channels.append", - "resolution": "partial", - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "class ControlPlaneService:\n def __init__(self) -> None:\n self._channels: list[ControlChannel] = []\n\n def register_channel(self, channel: ControlChannel) -> None:\n self._channels.append(channel)\n\n def start(self, runtime: RuntimeManager) -> None:\n if not self._channels:\n return\n asyncio.run(self._start_async(runtime))\n\n def stop(self) -> None:\n if not self._channels:\n return\n asyncio.run(self._stop_async())\n\n def snapshot(self, runtime: RuntimeManager) -> dict[str, object]:\n health = runtime.current_health()\n return {\n \"runtime\": {\"state\": runtime._state.value},\n \"modules\": list(runtime.registry.modules),\n \"services\": runtime.services.snapshot(),\n \"workers\": runtime.workers.snapshot(),\n \"health\": runtime.health.snapshot(runtime.workers.healths()) | {\"status\": health[\"status\"]},\n \"config\": runtime.configuration.get(),\n }\n\n async def _start_async(self, runtime: RuntimeManager) -> None:\n actions = ControlActionSet(\n health=runtime.health_status,\n start=runtime.start_runtime,\n stop=runtime.stop_runtime,\n status=runtime.runtime_status,\n )\n for channel in self._channels:\n await channel.start(actions)\n\n async def _stop_async(self) -> None:\n for channel in reversed(self._channels):\n await channel.stop()", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/service.py:ControlPlaneService", - "span_start": 12, - "span_end": 52, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.service", - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "llm_answer": "## Объяснение работы сущности `ControlPlaneService`\n\n### Назначение\n`ControlPlaneService` — это служба управления состоянием и взаимодействием различных компонентов системы. Она отвечает за координацию действий между каналами (`ControlChannel`), настройку инициализации системы и ее остановки, а также сбор информации о текущем состоянии для последующего анализа.\n\n### Ключевые зависимости\n- **RuntimeManager**: объект-менеджер, предоставляющий доступ к различным аспектам состояния и конфигурации запущенной системы.\n- **ControlChannel**: интерфейс взаимодействия с различными компонентами системы через каналы передачи данных.\n\n### Поток данных или вызовов\n1. **Инициализация** (`__init__`) \n - При создании объекта службы выполняется настройка внутреннего списка каналов `_channels`.\n \n2. **Регистрация канала** (`register_channel`) \n - Канал добавляется в список внутренних каналов службы.\n\n3. **Запуск сервиса** (`start`) \n - Вызывается асинхронная функция `_start_async`, которая запускает набор действий:\n - Проверка текущего здоровья системы (`health_status`).\n - Запуск основного функционала системы (`start_runtime`).\n\n4. **Остановка сервиса** (`stop`) \n - Выполняется асинхронно с помощью функции `_stop_async`. Остановка производится только при наличии зарегистрированных каналов.\n\n5. **Сбор системной информации** (`snapshot`) \n - Собирается информация о текущем состоянии системы, включая состояние выполнения задач, модули, сервисы, рабочие процессы и конфигурационные параметры.\n\n6. **Асинхронные действия** \n - Все основные операции выполняются внутри событийных циклов с использованием библиотеки `asyncio`.\n\n### Важные детали реализации\n- **Асинхронность операций**: все критические операции по управлению системой реализованы асинхронно, что позволяет избежать блокировок и эффективно обрабатывать множественные задачи одновременно.\n- **Работа с состоянием**: сервис активно использует внутренние атрибуты (_channels, _state), которые могут быть изменены внешними компонентами.\n- **Взаимодействие с внешним окружением**: работа сервиса завязана на наличие внешних объектов типа `RuntimeManager`, без которых функциональность будет неполной.\n\n### Осторожные выводы\nНекоторые аспекты поведения сервиса могут быть определены только косвенно исходя из доступных контекстуальных сигналов, таких как сигнатура методов и их вызовов, однако конкретные механизмы взаимодействия с внешней средой требуют дополнительного исследования исходного кода или документации.", - "summary": { - "router": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "confidence": null - }, - "retrieval": { - "profile": "code", - "layers_hit": [ - "C0_SOURCE_CHUNKS", - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS", - "C4_SEMANTIC_ROLES" - ], - "evidence_sufficient": true - }, - "llm": { - "answer_status": "answered", - "groundedness": "grounded" - } - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "ControlPlaneService" - ], - "keyword_hints": [ - "ControlPlaneService" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C0_SOURCE_CHUNKS": "exact_path_fetch", - "C4_SEMANTIC_ROLES": "exact_path_fetch", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C3_ENTRYPOINTS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 8, - "C4_SEMANTIC_ROLES": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C3_ENTRYPOINTS": 6 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C4_SEMANTIC_ROLES": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "ControlPlaneService", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "ControlPlaneService", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C4_SEMANTIC_ROLES", - "query": "ControlPlaneService", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "ControlPlaneService", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - }, - { - "layer": "C3_ENTRYPOINTS", - "query": "ControlPlaneService", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 1, - "candidates_after_filter": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 6, - "candidates_after_filter": 6 - }, - { - "layer": "C3_ENTRYPOINTS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 3, - "candidates_after_filter": 3 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "ControlPlaneService", - "alternatives": [ - "ControlPlaneService" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C4_SEMANTIC_ROLES", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 6, - "fail_reason": null - }, - { - "layer": "C3_ENTRYPOINTS", - "status": "hit", - "hit_count": 3, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "router": 0, - "symbol_resolution": 0, - "retrieval_total": 138, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 43, - "C0_SOURCE_CHUNKS": 15, - "C4_SEMANTIC_ROLES": 13, - "C2_DEPENDENCY_GRAPH": 54, - "C3_ENTRYPOINTS": 10 - }, - "merge_rank": 21, - "prompt_build": 0, - "llm_call": 3515 - }, - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 797, - "evidence_rows": 12, - "evidence_chars": 2301 - }, - "evidence_summary": [ - { - "layer": "C1_SYMBOL_CATALOG", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "count": 6, - "unique_paths": 1 - }, - { - "layer": "C3_ENTRYPOINTS", - "count": 3, - "unique_paths": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 1, - "unique_paths": 1 - } - ], - "prompt_template_id": "intent_code_qa_explain_ru_v1", - "system_prompt_version": "v1" - }, - "router": { - "conversation_mode": "START", - "keyword_hints": [ - "ControlPlaneService" - ], - "path_scope": [] - }, - "llm": { - "used_evidence_count": 12, - "missing_evidence_reason": null - } - }, - "run_info": { - "case_id": "plba-fullchain-explain-control-plane-service", - "mode": "full_chain", - "run_started_at": "2026-03-12T11:52:23", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - }, - "input_request": { - "text": "Объясни класс ControlPlaneService", - "normalized_query": "Объясни класс ControlPlaneService" - }, - "steps": [ - { - "step": "intent_router", - "input": { - "query": "Объясни класс ControlPlaneService" - }, - "output": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Объясни класс ControlPlaneService" - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "ControlPlaneService" - ], - "keyword_hints": [ - "ControlPlaneService" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "timings_ms": { - "router": 0 - } - } - }, - { - "step": "retrieval", - "input": { - "query": "Объясни класс ControlPlaneService" - }, - "output": { - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "ControlPlaneService", - "alternatives": [ - "ControlPlaneService" - ], - "confidence": 0.99 - }, - "rag_count": 12, - "rag_rows": [ - { - "path": "src/app_runtime/control/service.py", - "content": "class ControlPlaneService\nControlPlaneService", - "layer": "C1_SYMBOL_CATALOG", - "title": "ControlPlaneService", - "span_start": 12, - "span_end": 52, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "b13471e5916986dccffb53fab613812842965705e6b3a89ae549d30c9e91e9aa", - "qname": "ControlPlaneService", - "kind": "class", - "signature": "ControlPlaneService", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.control.service", - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests service\n- reads and writes state attributes\n- participates in dataflow slices (5)", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlPlaneService", - "span_start": 12, - "span_end": 52, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 68, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "b13471e5916986dccffb53fab613812842965705e6b3a89ae549d30c9e91e9aa", - "symbol_name": "ControlPlaneService", - "qname": "ControlPlaneService", - "role": "pipeline_stage", - "confidence": 0.57, - "dataflow_participation": 5, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.stop", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 25, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d", - "dst_ref": "ControlPlaneService.stop", - "resolution": "resolved", - "slice_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.stop" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._stop_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 51, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a", - "dst_ref": "ControlPlaneService._stop_async", - "resolution": "resolved", - "slice_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._stop_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.register_channel", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 17, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957", - "dst_ref": "ControlPlaneService.register_channel", - "resolution": "resolved", - "slice_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.register_channel" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.start", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 20, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154", - "dst_ref": "ControlPlaneService.start", - "resolution": "resolved", - "slice_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.start" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._start_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 47, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517", - "dst_ref": "ControlPlaneService._start_async", - "resolution": "resolved", - "slice_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._start_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.register_channel reads_attr self._channels.append", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.register_channel:reads_attr", - "span_start": 17, - "span_end": 17, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "1ee5925deffdc38ba15b88bf7c89e5fcd1a78f493fe30f2deb827d714a1b18e8", - "edge_type": "reads_attr", - "src_symbol_id": "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957", - "src_qname": "ControlPlaneService.register_channel", - "dst_symbol_id": null, - "dst_ref": "self._channels.append", - "resolution": "partial", - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "class ControlPlaneService:\n def __init__(self) -> None:\n self._channels: list[ControlChannel] = []\n\n def register_channel(self, channel: ControlChannel) -> None:\n self._channels.append(channel)\n\n def start(self, runtime: RuntimeManager) -> None:\n if not self._channels:\n return\n asyncio.run(self._start_async(runtime))\n\n def stop(self) -> None:\n if not self._channels:\n return\n asyncio.run(self._stop_async())\n\n def snapshot(self, runtime: RuntimeManager) -> dict[str, object]:\n health = runtime.current_health()\n return {\n \"runtime\": {\"state\": runtime._state.value},\n \"modules\": list(runtime.registry.modules),\n \"services\": runtime.services.snapshot(),\n \"workers\": runtime.workers.snapshot(),\n \"health\": runtime.health.snapshot(runtime.workers.healths()) | {\"status\": health[\"status\"]},\n \"config\": runtime.configuration.get(),\n }\n\n async def _start_async(self, runtime: RuntimeManager) -> None:\n actions = ControlActionSet(\n health=runtime.health_status,\n start=runtime.start_runtime,\n stop=runtime.stop_runtime,\n status=runtime.runtime_status,\n )\n for channel in self._channels:\n await channel.start(actions)\n\n async def _stop_async(self) -> None:\n for channel in reversed(self._channels):\n await channel.stop()", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/service.py:ControlPlaneService", - "span_start": 12, - "span_end": 52, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.service", - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ] - }, - "diagnostics": { - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C0_SOURCE_CHUNKS": "exact_path_fetch", - "C4_SEMANTIC_ROLES": "exact_path_fetch", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C3_ENTRYPOINTS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 8, - "C4_SEMANTIC_ROLES": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C3_ENTRYPOINTS": 6 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C4_SEMANTIC_ROLES": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "ControlPlaneService", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "ControlPlaneService", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C4_SEMANTIC_ROLES", - "query": "ControlPlaneService", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "ControlPlaneService", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - }, - { - "layer": "C3_ENTRYPOINTS", - "query": "ControlPlaneService", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 1, - "candidates_after_filter": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 6, - "candidates_after_filter": 6 - }, - { - "layer": "C3_ENTRYPOINTS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 3, - "candidates_after_filter": 3 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "ControlPlaneService", - "alternatives": [ - "ControlPlaneService" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C4_SEMANTIC_ROLES", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 6, - "fail_reason": null - }, - { - "layer": "C3_ENTRYPOINTS", - "status": "hit", - "hit_count": 3, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "symbol_resolution": 0, - "retrieval_total": 138, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 43, - "C0_SOURCE_CHUNKS": 15, - "C4_SEMANTIC_ROLES": 13, - "C2_DEPENDENCY_GRAPH": 54, - "C3_ENTRYPOINTS": 10 - }, - "merge_rank": 21 - } - } - }, - { - "step": "llm_answer", - "input": { - "query": "Объясни класс ControlPlaneService", - "rag_count": 12 - }, - "output": { - "llm_answer": "## Объяснение работы сущности `ControlPlaneService`\n\n### Назначение\n`ControlPlaneService` — это служба управления состоянием и взаимодействием различных компонентов системы. Она отвечает за координацию действий между каналами (`ControlChannel`), настройку инициализации системы и ее остановки, а также сбор информации о текущем состоянии для последующего анализа.\n\n### Ключевые зависимости\n- **RuntimeManager**: объект-менеджер, предоставляющий доступ к различным аспектам состояния и конфигурации запущенной системы.\n- **ControlChannel**: интерфейс взаимодействия с различными компонентами системы через каналы передачи данных.\n\n### Поток данных или вызовов\n1. **Инициализация** (`__init__`) \n - При создании объекта службы выполняется настройка внутреннего списка каналов `_channels`.\n \n2. **Регистрация канала** (`register_channel`) \n - Канал добавляется в список внутренних каналов службы.\n\n3. **Запуск сервиса** (`start`) \n - Вызывается асинхронная функция `_start_async`, которая запускает набор действий:\n - Проверка текущего здоровья системы (`health_status`).\n - Запуск основного функционала системы (`start_runtime`).\n\n4. **Остановка сервиса** (`stop`) \n - Выполняется асинхронно с помощью функции `_stop_async`. Остановка производится только при наличии зарегистрированных каналов.\n\n5. **Сбор системной информации** (`snapshot`) \n - Собирается информация о текущем состоянии системы, включая состояние выполнения задач, модули, сервисы, рабочие процессы и конфигурационные параметры.\n\n6. **Асинхронные действия** \n - Все основные операции выполняются внутри событийных циклов с использованием библиотеки `asyncio`.\n\n### Важные детали реализации\n- **Асинхронность операций**: все критические операции по управлению системой реализованы асинхронно, что позволяет избежать блокировок и эффективно обрабатывать множественные задачи одновременно.\n- **Работа с состоянием**: сервис активно использует внутренние атрибуты (_channels, _state), которые могут быть изменены внешними компонентами.\n- **Взаимодействие с внешним окружением**: работа сервиса завязана на наличие внешних объектов типа `RuntimeManager`, без которых функциональность будет неполной.\n\n### Осторожные выводы\nНекоторые аспекты поведения сервиса могут быть определены только косвенно исходя из доступных контекстуальных сигналов, таких как сигнатура методов и их вызовов, однако конкретные механизмы взаимодействия с внешней средой требуют дополнительного исследования исходного кода или документации." - }, - "diagnostics": { - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 797, - "evidence_rows": 12, - "evidence_chars": 2301 - }, - "evidence_summary": [ - { - "layer": "C1_SYMBOL_CATALOG", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "count": 6, - "unique_paths": 1 - }, - { - "layer": "C3_ENTRYPOINTS", - "count": 3, - "unique_paths": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 1, - "unique_paths": 1 - } - ], - "prompt_template_id": "intent_code_qa_explain_ru_v1", - "system_prompt_version": "v1" - }, - "timings_ms": { - "prompt_build": 0, - "llm_call": 3515 - } - } - } - ] - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_115223/full_chain_plba_code_retrieval_plba-fullchain-explain-control-plane-service.md b/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_115223/full_chain_plba_code_retrieval_plba-fullchain-explain-control-plane-service.md deleted file mode 100644 index 6f593c7..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_115223/full_chain_plba_code_retrieval_plba-fullchain-explain-control-plane-service.md +++ /dev/null @@ -1,34 +0,0 @@ -# plba-fullchain-explain-control-plane-service - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_retrieval.yaml -- runner: runtime -- mode: full_chain -- passed: True - -## Query -Объясни класс ControlPlaneService - -## Actual -{ - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 12, - "llm_answer": "## Объяснение работы сущности `ControlPlaneService`\n\n### Назначение\n`ControlPlaneService` — это служба управления состоянием и взаимодействием различных компонентов системы. Она отвечает за координацию действий между каналами (`ControlChannel`), настройку инициализации системы и ее остановки, а также сбор информации о текущем состоянии для последующего анализа.\n\n### Ключевые зависимости\n- **RuntimeManager**: объект-менеджер, предоставляющий доступ к различным аспектам состояния и конфигурации запущенной системы.\n- **ControlChannel**: интерфейс взаимодействия с различными компонентами системы через каналы передачи данных.\n\n### Поток данных или вызовов\n1. **Инициализация** (`__init__`) \n - При создании объекта службы выполняется настройка внутреннего списка каналов `_channels`.\n \n2. **Регистрация канала** (`register_channel`) \n - Канал добавляется в список внутренних каналов службы.\n\n3. **Запуск сервиса** (`start`) \n - Вызывается асинхронная функция `_start_async`, которая запускает набор действий:\n - Проверка текущего здоровья системы (`health_status`).\n - Запуск основного функционала системы (`start_runtime`).\n\n4. **Остановка сервиса** (`stop`) \n - Выполняется асинхронно с помощью функции `_stop_async`. Остановка производится только при наличии зарегистрированных каналов.\n\n5. **Сбор системной информации** (`snapshot`) \n - Собирается информация о текущем состоянии системы, включая состояние выполнения задач, модули, сервисы, рабочие процессы и конфигурационные параметры.\n\n6. **Асинхронные действия** \n - Все основные операции выполняются внутри событийных циклов с использованием библиотеки `asyncio`.\n\n### Важные детали реализации\n- **Асинхронность операций**: все критические операции по управлению системой реализованы асинхронно, что позволяет избежать блокировок и эффективно обрабатывать множественные задачи одновременно.\n- **Работа с состоянием**: сервис активно использует внутренние атрибуты (_channels, _state), которые могут быть изменены внешними компонентами.\n- **Взаимодействие с внешним окружением**: работа сервиса завязана на наличие внешних объектов типа `RuntimeManager`, без которых функциональность будет неполной.\n\n### Осторожные выводы\nНекоторые аспекты поведения сервиса могут быть определены только косвенно исходя из доступных контекстуальных сигналов, таких как сигнатура методов и их вызовов, однако конкретные механизмы взаимодействия с внешней средой требуют дополнительного исследования исходного кода или документации.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "ControlPlaneService" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] -} - -## Mismatches -- none \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_115223/full_chain_plba_code_retrieval_plba-fullchain-explain-create-runtime.json b/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_115223/full_chain_plba_code_retrieval_plba-fullchain-explain-create-runtime.json deleted file mode 100644 index b87954a..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_115223/full_chain_plba_code_retrieval_plba-fullchain-explain-create-runtime.json +++ /dev/null @@ -1,1896 +0,0 @@ -{ - "case_id": "plba-fullchain-explain-create-runtime", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_retrieval.yaml", - "runner": "runtime", - "mode": "full_chain", - "actual": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 12, - "llm_answer": "## Объяснение функции `create_runtime`\n\n### Назначение\nФункция `create_runtime` предназначена для инициализации и настройки среды выполнения (`runtime`) приложения Plba. Она выполняет несколько ключевых шагов по настройке и регистрации различных компонентов, необходимых для полноценной работы системы.\n\n### Ключевые зависимости\nФункция зависит от следующих сущностей и модулей:\n- **src/plba/bootstrap.py**: основной файл, содержащий реализацию функции `create_runtime`.\n- **RuntimeManager**: менеджер окружения, используемый для управления конфигурацией и модулями приложения.\n- **ApplicationModule**: модуль приложения, представляющий собой компонент, регистрируемый менеджером среды выполнения.\n- **HttpControlChannel**: канал управления HTTP-интерфейсом, обеспечивающий взаимодействие с внешним окружением через HTTP-протокол.\n\n### Поток данных или вызовов\n1. Функция принимает следующие аргументы:\n - `module`: экземпляр класса `ApplicationModule`, определяющий конкретный модуль приложения.\n - Дополнительные параметры конфигурации, такие как путь к файлу конфигурации, флаг включения HTTP-контроля, адрес и порт контроллера и таймаут соединения.\n \n2. В начале создается объект `RuntimeManager`, который будет служить основным контейнером для всех зарегистрированных компонентов и их настроек.\n\n3. Если указан параметр `config_path`, вызывается метод `add_config_file` объекта `RuntimeManager`. Этот метод загружает и применяет настройки из указанного файла конфигурации.\n\n4. Если включен режим HTTP-контроля (`enable_http_control`), вызывается регистрация канала HTTP-контроля при помощи метода `register_channel` объекта `RuntimeManager`. Параметры канала задаются исходя из указанных пользователем значений адреса, порта и тайм-аута.\n\n5. Независимо от режима HTTP-контроля, всегда выполняется регистрация переданного модуля приложения методом `register_module` объекта `RuntimeManager`.\n\n6. По завершению процесса функция возвращает созданный объект `RuntimeManager`.\n\n### Важные детали реализации\n- Использование параметров конфигурации позволяет гибко настраивать среду исполнения без необходимости внесения изменений непосредственно в исходный код.\n- Регистрация HTTP-канала обеспечивает возможность удаленного управления приложением через стандартный интерфейс HTTP.\n- Поддержка опции включения HTTP-контроля предоставляет разработчикам дополнительный уровень контроля над состоянием и поведением запущенного приложения.\n \n**Осторожный вывод:** \nНа основании предоставленного контекста сложно точно определить механизм взаимодействия конкретных слоев RAG (например, зависимость от других частей архитектуры типа `C0_SOURCE_CHUNKS`, `C4_SEMANTIC_ROLES`). Однако приведенные выше данные достаточно информативны для понимания базовой функциональности и структуры вызова данной функции.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "create_runtime" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "passed": true, - "mismatches": [], - "details": { - "case_id": "plba-fullchain-explain-create-runtime", - "text": "Объясни функцию create_runtime", - "mode": "full_chain", - "run_started_at": "2026-03-12T11:52:23", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Объясни функцию create_runtime", - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "create_runtime", - "alternatives": [ - "create_runtime" - ], - "confidence": 0.99 - }, - "rag_count": 12, - "rag_rows": [ - { - "path": "src/plba/bootstrap.py", - "content": "function create_runtime\ncreate_runtime(module)", - "layer": "C1_SYMBOL_CATALOG", - "title": "create_runtime", - "span_start": 8, - "span_end": 29, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "qname": "create_runtime", - "kind": "function", - "signature": "create_runtime(module)", - "parent_symbol_id": null, - "package_or_module": "src.plba.bootstrap", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_runner.py", - "content": "UvicornThreadRunner\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (24)", - "layer": "C4_SEMANTIC_ROLES", - "title": "UvicornThreadRunner", - "span_start": 10, - "span_end": 61, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 11, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "fd55630045a02100df8877ac27d951ee08617d4598764394d48cb51fe067476a", - "symbol_name": "UvicornThreadRunner", - "qname": "UvicornThreadRunner", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 24, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "3779fdd2878b770e789a35bb2a89c9d79f13b61c26d7db1b3b683f9bb9e1623f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/bootstrap.py", - "content": "create_runtime calls runtime.add_config_file", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "create_runtime:calls", - "span_start": 19, - "span_end": 19, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "4eaeec4ac55a59d5f66fd01c4754955f8fedaf4bc3df13fa769b352c7bfaacbb", - "edge_type": "calls", - "src_symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "src_qname": "create_runtime", - "dst_symbol_id": null, - "dst_ref": "runtime.add_config_file", - "resolution": "partial", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/bootstrap.py", - "content": "create_runtime reads_attr runtime.register_module", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "create_runtime:reads_attr", - "span_start": 28, - "span_end": 28, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "45516c79ff358dbf9b650a081668df0f66d2fe989300f985a1a78be6be166f8f", - "edge_type": "reads_attr", - "src_symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "src_qname": "create_runtime", - "dst_symbol_id": null, - "dst_ref": "runtime.register_module", - "resolution": "partial", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/bootstrap.py", - "content": "create_runtime instantiates RuntimeManager", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "create_runtime:instantiates", - "span_start": 17, - "span_end": 17, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "0adba17984f850ea1608c9e734d2dd5c325cfde3a8133123aa239e44935ad18e", - "edge_type": "instantiates", - "src_symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "src_qname": "create_runtime", - "dst_symbol_id": "27158ca220022eeb5083c6addf8a50775d45f7161284fd60aac48410105f4b98", - "dst_ref": "RuntimeManager", - "resolution": "resolved", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/bootstrap.py", - "content": "create_runtime calls runtime.register_module", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "create_runtime:calls", - "span_start": 28, - "span_end": 28, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "ab6003c3441addc1ba1b81edeca009165559f652f6b2cf424e5ae61b1f617de8", - "edge_type": "calls", - "src_symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "src_qname": "create_runtime", - "dst_symbol_id": null, - "dst_ref": "runtime.register_module", - "resolution": "partial", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/bootstrap.py", - "content": "create_runtime calls runtime.control_plane.register_channel", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "create_runtime:calls", - "span_start": 21, - "span_end": 27, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "2678250030b9ce47a3b3b55fac7897ac530367edc8374ac9d5e6ecafb1e483f0", - "edge_type": "calls", - "src_symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "src_qname": "create_runtime", - "dst_symbol_id": null, - "dst_ref": "runtime.control_plane.register_channel", - "resolution": "partial", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/bootstrap.py", - "content": "create_runtime reads_attr runtime.add_config_file", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "create_runtime:reads_attr", - "span_start": 19, - "span_end": 19, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "30d4e8aae984ab84d523e80d02f1caeda52d547fa3d2aa47be8845931cabbca2", - "edge_type": "reads_attr", - "src_symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "src_qname": "create_runtime", - "dst_symbol_id": null, - "dst_ref": "runtime.add_config_file", - "resolution": "partial", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/bootstrap.py", - "content": "def create_runtime(\n module: ApplicationModule,\n *,\n config_path: str | None = None,\n enable_http_control: bool = False,\n control_host: str = \"127.0.0.1\",\n control_port: int = 8080,\n control_timeout: int = 5,\n) -> RuntimeManager:\n runtime = RuntimeManager()\n if config_path is not None:\n runtime.add_config_file(config_path)\n if enable_http_control:\n runtime.control_plane.register_channel(\n HttpControlChannel(\n host=control_host,\n port=control_port,\n timeout=control_timeout,\n )\n )\n runtime.register_module(module)\n return runtime", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/plba/bootstrap.py:create_runtime", - "span_start": 8, - "span_end": 29, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.plba.bootstrap", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "llm_answer": "## Объяснение функции `create_runtime`\n\n### Назначение\nФункция `create_runtime` предназначена для инициализации и настройки среды выполнения (`runtime`) приложения Plba. Она выполняет несколько ключевых шагов по настройке и регистрации различных компонентов, необходимых для полноценной работы системы.\n\n### Ключевые зависимости\nФункция зависит от следующих сущностей и модулей:\n- **src/plba/bootstrap.py**: основной файл, содержащий реализацию функции `create_runtime`.\n- **RuntimeManager**: менеджер окружения, используемый для управления конфигурацией и модулями приложения.\n- **ApplicationModule**: модуль приложения, представляющий собой компонент, регистрируемый менеджером среды выполнения.\n- **HttpControlChannel**: канал управления HTTP-интерфейсом, обеспечивающий взаимодействие с внешним окружением через HTTP-протокол.\n\n### Поток данных или вызовов\n1. Функция принимает следующие аргументы:\n - `module`: экземпляр класса `ApplicationModule`, определяющий конкретный модуль приложения.\n - Дополнительные параметры конфигурации, такие как путь к файлу конфигурации, флаг включения HTTP-контроля, адрес и порт контроллера и таймаут соединения.\n \n2. В начале создается объект `RuntimeManager`, который будет служить основным контейнером для всех зарегистрированных компонентов и их настроек.\n\n3. Если указан параметр `config_path`, вызывается метод `add_config_file` объекта `RuntimeManager`. Этот метод загружает и применяет настройки из указанного файла конфигурации.\n\n4. Если включен режим HTTP-контроля (`enable_http_control`), вызывается регистрация канала HTTP-контроля при помощи метода `register_channel` объекта `RuntimeManager`. Параметры канала задаются исходя из указанных пользователем значений адреса, порта и тайм-аута.\n\n5. Независимо от режима HTTP-контроля, всегда выполняется регистрация переданного модуля приложения методом `register_module` объекта `RuntimeManager`.\n\n6. По завершению процесса функция возвращает созданный объект `RuntimeManager`.\n\n### Важные детали реализации\n- Использование параметров конфигурации позволяет гибко настраивать среду исполнения без необходимости внесения изменений непосредственно в исходный код.\n- Регистрация HTTP-канала обеспечивает возможность удаленного управления приложением через стандартный интерфейс HTTP.\n- Поддержка опции включения HTTP-контроля предоставляет разработчикам дополнительный уровень контроля над состоянием и поведением запущенного приложения.\n \n**Осторожный вывод:** \nНа основании предоставленного контекста сложно точно определить механизм взаимодействия конкретных слоев RAG (например, зависимость от других частей архитектуры типа `C0_SOURCE_CHUNKS`, `C4_SEMANTIC_ROLES`). Однако приведенные выше данные достаточно информативны для понимания базовой функциональности и структуры вызова данной функции.", - "summary": { - "router": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "confidence": null - }, - "retrieval": { - "profile": "code", - "layers_hit": [ - "C0_SOURCE_CHUNKS", - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS", - "C4_SEMANTIC_ROLES" - ], - "evidence_sufficient": true - }, - "llm": { - "answer_status": "answered", - "groundedness": "grounded" - } - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "symbol_kind_hint": "function", - "symbol_candidates": [ - "create_runtime" - ], - "keyword_hints": [ - "create_runtime" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C0_SOURCE_CHUNKS": "exact_path_fetch", - "C4_SEMANTIC_ROLES": "exact_path_fetch", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C3_ENTRYPOINTS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 8, - "C4_SEMANTIC_ROLES": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C3_ENTRYPOINTS": 6 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C4_SEMANTIC_ROLES": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "create_runtime", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "create_runtime", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C4_SEMANTIC_ROLES", - "query": "create_runtime", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "create_runtime", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - }, - { - "layer": "C3_ENTRYPOINTS", - "query": "create_runtime", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 1, - "candidates_after_filter": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 6, - "candidates_after_filter": 6 - }, - { - "layer": "C3_ENTRYPOINTS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 3, - "candidates_after_filter": 3 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "create_runtime", - "alternatives": [ - "create_runtime" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C4_SEMANTIC_ROLES", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 6, - "fail_reason": null - }, - { - "layer": "C3_ENTRYPOINTS", - "status": "hit", - "hit_count": 3, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "router": 0, - "symbol_resolution": 0, - "retrieval_total": 149, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 51, - "C0_SOURCE_CHUNKS": 19, - "C4_SEMANTIC_ROLES": 16, - "C2_DEPENDENCY_GRAPH": 49, - "C3_ENTRYPOINTS": 12 - }, - "merge_rank": 20, - "prompt_build": 0, - "llm_call": 3866 - }, - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 601, - "evidence_rows": 12, - "evidence_chars": 1184 - }, - "evidence_summary": [ - { - "layer": "C1_SYMBOL_CATALOG", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "count": 6, - "unique_paths": 1 - }, - { - "layer": "C3_ENTRYPOINTS", - "count": 3, - "unique_paths": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 1, - "unique_paths": 1 - } - ], - "prompt_template_id": "intent_code_qa_explain_ru_v1", - "system_prompt_version": "v1" - }, - "router": { - "conversation_mode": "START", - "keyword_hints": [ - "create_runtime" - ], - "path_scope": [] - }, - "llm": { - "used_evidence_count": 12, - "missing_evidence_reason": null - } - }, - "run_info": { - "case_id": "plba-fullchain-explain-create-runtime", - "mode": "full_chain", - "run_started_at": "2026-03-12T11:52:23", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - }, - "input_request": { - "text": "Объясни функцию create_runtime", - "normalized_query": "Объясни функцию create_runtime" - }, - "steps": [ - { - "step": "intent_router", - "input": { - "query": "Объясни функцию create_runtime" - }, - "output": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Объясни функцию create_runtime" - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "symbol_kind_hint": "function", - "symbol_candidates": [ - "create_runtime" - ], - "keyword_hints": [ - "create_runtime" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "timings_ms": { - "router": 0 - } - } - }, - { - "step": "retrieval", - "input": { - "query": "Объясни функцию create_runtime" - }, - "output": { - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "create_runtime", - "alternatives": [ - "create_runtime" - ], - "confidence": 0.99 - }, - "rag_count": 12, - "rag_rows": [ - { - "path": "src/plba/bootstrap.py", - "content": "function create_runtime\ncreate_runtime(module)", - "layer": "C1_SYMBOL_CATALOG", - "title": "create_runtime", - "span_start": 8, - "span_end": 29, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "qname": "create_runtime", - "kind": "function", - "signature": "create_runtime(module)", - "parent_symbol_id": null, - "package_or_module": "src.plba.bootstrap", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_runner.py", - "content": "UvicornThreadRunner\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (24)", - "layer": "C4_SEMANTIC_ROLES", - "title": "UvicornThreadRunner", - "span_start": 10, - "span_end": 61, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 11, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "fd55630045a02100df8877ac27d951ee08617d4598764394d48cb51fe067476a", - "symbol_name": "UvicornThreadRunner", - "qname": "UvicornThreadRunner", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 24, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "3779fdd2878b770e789a35bb2a89c9d79f13b61c26d7db1b3b683f9bb9e1623f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/bootstrap.py", - "content": "create_runtime calls runtime.add_config_file", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "create_runtime:calls", - "span_start": 19, - "span_end": 19, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "4eaeec4ac55a59d5f66fd01c4754955f8fedaf4bc3df13fa769b352c7bfaacbb", - "edge_type": "calls", - "src_symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "src_qname": "create_runtime", - "dst_symbol_id": null, - "dst_ref": "runtime.add_config_file", - "resolution": "partial", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/bootstrap.py", - "content": "create_runtime reads_attr runtime.register_module", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "create_runtime:reads_attr", - "span_start": 28, - "span_end": 28, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "45516c79ff358dbf9b650a081668df0f66d2fe989300f985a1a78be6be166f8f", - "edge_type": "reads_attr", - "src_symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "src_qname": "create_runtime", - "dst_symbol_id": null, - "dst_ref": "runtime.register_module", - "resolution": "partial", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/bootstrap.py", - "content": "create_runtime instantiates RuntimeManager", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "create_runtime:instantiates", - "span_start": 17, - "span_end": 17, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "0adba17984f850ea1608c9e734d2dd5c325cfde3a8133123aa239e44935ad18e", - "edge_type": "instantiates", - "src_symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "src_qname": "create_runtime", - "dst_symbol_id": "27158ca220022eeb5083c6addf8a50775d45f7161284fd60aac48410105f4b98", - "dst_ref": "RuntimeManager", - "resolution": "resolved", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/bootstrap.py", - "content": "create_runtime calls runtime.register_module", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "create_runtime:calls", - "span_start": 28, - "span_end": 28, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "ab6003c3441addc1ba1b81edeca009165559f652f6b2cf424e5ae61b1f617de8", - "edge_type": "calls", - "src_symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "src_qname": "create_runtime", - "dst_symbol_id": null, - "dst_ref": "runtime.register_module", - "resolution": "partial", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/bootstrap.py", - "content": "create_runtime calls runtime.control_plane.register_channel", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "create_runtime:calls", - "span_start": 21, - "span_end": 27, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "2678250030b9ce47a3b3b55fac7897ac530367edc8374ac9d5e6ecafb1e483f0", - "edge_type": "calls", - "src_symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "src_qname": "create_runtime", - "dst_symbol_id": null, - "dst_ref": "runtime.control_plane.register_channel", - "resolution": "partial", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/bootstrap.py", - "content": "create_runtime reads_attr runtime.add_config_file", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "create_runtime:reads_attr", - "span_start": 19, - "span_end": 19, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "30d4e8aae984ab84d523e80d02f1caeda52d547fa3d2aa47be8845931cabbca2", - "edge_type": "reads_attr", - "src_symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "src_qname": "create_runtime", - "dst_symbol_id": null, - "dst_ref": "runtime.add_config_file", - "resolution": "partial", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/bootstrap.py", - "content": "def create_runtime(\n module: ApplicationModule,\n *,\n config_path: str | None = None,\n enable_http_control: bool = False,\n control_host: str = \"127.0.0.1\",\n control_port: int = 8080,\n control_timeout: int = 5,\n) -> RuntimeManager:\n runtime = RuntimeManager()\n if config_path is not None:\n runtime.add_config_file(config_path)\n if enable_http_control:\n runtime.control_plane.register_channel(\n HttpControlChannel(\n host=control_host,\n port=control_port,\n timeout=control_timeout,\n )\n )\n runtime.register_module(module)\n return runtime", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/plba/bootstrap.py:create_runtime", - "span_start": 8, - "span_end": 29, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.plba.bootstrap", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ] - }, - "diagnostics": { - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C0_SOURCE_CHUNKS": "exact_path_fetch", - "C4_SEMANTIC_ROLES": "exact_path_fetch", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C3_ENTRYPOINTS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 8, - "C4_SEMANTIC_ROLES": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C3_ENTRYPOINTS": 6 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C4_SEMANTIC_ROLES": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "create_runtime", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "create_runtime", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C4_SEMANTIC_ROLES", - "query": "create_runtime", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "create_runtime", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - }, - { - "layer": "C3_ENTRYPOINTS", - "query": "create_runtime", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 1, - "candidates_after_filter": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 6, - "candidates_after_filter": 6 - }, - { - "layer": "C3_ENTRYPOINTS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 3, - "candidates_after_filter": 3 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "create_runtime", - "alternatives": [ - "create_runtime" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C4_SEMANTIC_ROLES", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 6, - "fail_reason": null - }, - { - "layer": "C3_ENTRYPOINTS", - "status": "hit", - "hit_count": 3, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "symbol_resolution": 0, - "retrieval_total": 149, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 51, - "C0_SOURCE_CHUNKS": 19, - "C4_SEMANTIC_ROLES": 16, - "C2_DEPENDENCY_GRAPH": 49, - "C3_ENTRYPOINTS": 12 - }, - "merge_rank": 20 - } - } - }, - { - "step": "llm_answer", - "input": { - "query": "Объясни функцию create_runtime", - "rag_count": 12 - }, - "output": { - "llm_answer": "## Объяснение функции `create_runtime`\n\n### Назначение\nФункция `create_runtime` предназначена для инициализации и настройки среды выполнения (`runtime`) приложения Plba. Она выполняет несколько ключевых шагов по настройке и регистрации различных компонентов, необходимых для полноценной работы системы.\n\n### Ключевые зависимости\nФункция зависит от следующих сущностей и модулей:\n- **src/plba/bootstrap.py**: основной файл, содержащий реализацию функции `create_runtime`.\n- **RuntimeManager**: менеджер окружения, используемый для управления конфигурацией и модулями приложения.\n- **ApplicationModule**: модуль приложения, представляющий собой компонент, регистрируемый менеджером среды выполнения.\n- **HttpControlChannel**: канал управления HTTP-интерфейсом, обеспечивающий взаимодействие с внешним окружением через HTTP-протокол.\n\n### Поток данных или вызовов\n1. Функция принимает следующие аргументы:\n - `module`: экземпляр класса `ApplicationModule`, определяющий конкретный модуль приложения.\n - Дополнительные параметры конфигурации, такие как путь к файлу конфигурации, флаг включения HTTP-контроля, адрес и порт контроллера и таймаут соединения.\n \n2. В начале создается объект `RuntimeManager`, который будет служить основным контейнером для всех зарегистрированных компонентов и их настроек.\n\n3. Если указан параметр `config_path`, вызывается метод `add_config_file` объекта `RuntimeManager`. Этот метод загружает и применяет настройки из указанного файла конфигурации.\n\n4. Если включен режим HTTP-контроля (`enable_http_control`), вызывается регистрация канала HTTP-контроля при помощи метода `register_channel` объекта `RuntimeManager`. Параметры канала задаются исходя из указанных пользователем значений адреса, порта и тайм-аута.\n\n5. Независимо от режима HTTP-контроля, всегда выполняется регистрация переданного модуля приложения методом `register_module` объекта `RuntimeManager`.\n\n6. По завершению процесса функция возвращает созданный объект `RuntimeManager`.\n\n### Важные детали реализации\n- Использование параметров конфигурации позволяет гибко настраивать среду исполнения без необходимости внесения изменений непосредственно в исходный код.\n- Регистрация HTTP-канала обеспечивает возможность удаленного управления приложением через стандартный интерфейс HTTP.\n- Поддержка опции включения HTTP-контроля предоставляет разработчикам дополнительный уровень контроля над состоянием и поведением запущенного приложения.\n \n**Осторожный вывод:** \nНа основании предоставленного контекста сложно точно определить механизм взаимодействия конкретных слоев RAG (например, зависимость от других частей архитектуры типа `C0_SOURCE_CHUNKS`, `C4_SEMANTIC_ROLES`). Однако приведенные выше данные достаточно информативны для понимания базовой функциональности и структуры вызова данной функции." - }, - "diagnostics": { - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 601, - "evidence_rows": 12, - "evidence_chars": 1184 - }, - "evidence_summary": [ - { - "layer": "C1_SYMBOL_CATALOG", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "count": 6, - "unique_paths": 1 - }, - { - "layer": "C3_ENTRYPOINTS", - "count": 3, - "unique_paths": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 1, - "unique_paths": 1 - } - ], - "prompt_template_id": "intent_code_qa_explain_ru_v1", - "system_prompt_version": "v1" - }, - "timings_ms": { - "prompt_build": 0, - "llm_call": 3866 - } - } - } - ] - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_115223/full_chain_plba_code_retrieval_plba-fullchain-explain-create-runtime.md b/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_115223/full_chain_plba_code_retrieval_plba-fullchain-explain-create-runtime.md deleted file mode 100644 index 61223d9..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_115223/full_chain_plba_code_retrieval_plba-fullchain-explain-create-runtime.md +++ /dev/null @@ -1,34 +0,0 @@ -# plba-fullchain-explain-create-runtime - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_retrieval.yaml -- runner: runtime -- mode: full_chain -- passed: True - -## Query -Объясни функцию create_runtime - -## Actual -{ - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 12, - "llm_answer": "## Объяснение функции `create_runtime`\n\n### Назначение\nФункция `create_runtime` предназначена для инициализации и настройки среды выполнения (`runtime`) приложения Plba. Она выполняет несколько ключевых шагов по настройке и регистрации различных компонентов, необходимых для полноценной работы системы.\n\n### Ключевые зависимости\nФункция зависит от следующих сущностей и модулей:\n- **src/plba/bootstrap.py**: основной файл, содержащий реализацию функции `create_runtime`.\n- **RuntimeManager**: менеджер окружения, используемый для управления конфигурацией и модулями приложения.\n- **ApplicationModule**: модуль приложения, представляющий собой компонент, регистрируемый менеджером среды выполнения.\n- **HttpControlChannel**: канал управления HTTP-интерфейсом, обеспечивающий взаимодействие с внешним окружением через HTTP-протокол.\n\n### Поток данных или вызовов\n1. Функция принимает следующие аргументы:\n - `module`: экземпляр класса `ApplicationModule`, определяющий конкретный модуль приложения.\n - Дополнительные параметры конфигурации, такие как путь к файлу конфигурации, флаг включения HTTP-контроля, адрес и порт контроллера и таймаут соединения.\n \n2. В начале создается объект `RuntimeManager`, который будет служить основным контейнером для всех зарегистрированных компонентов и их настроек.\n\n3. Если указан параметр `config_path`, вызывается метод `add_config_file` объекта `RuntimeManager`. Этот метод загружает и применяет настройки из указанного файла конфигурации.\n\n4. Если включен режим HTTP-контроля (`enable_http_control`), вызывается регистрация канала HTTP-контроля при помощи метода `register_channel` объекта `RuntimeManager`. Параметры канала задаются исходя из указанных пользователем значений адреса, порта и тайм-аута.\n\n5. Независимо от режима HTTP-контроля, всегда выполняется регистрация переданного модуля приложения методом `register_module` объекта `RuntimeManager`.\n\n6. По завершению процесса функция возвращает созданный объект `RuntimeManager`.\n\n### Важные детали реализации\n- Использование параметров конфигурации позволяет гибко настраивать среду исполнения без необходимости внесения изменений непосредственно в исходный код.\n- Регистрация HTTP-канала обеспечивает возможность удаленного управления приложением через стандартный интерфейс HTTP.\n- Поддержка опции включения HTTP-контроля предоставляет разработчикам дополнительный уровень контроля над состоянием и поведением запущенного приложения.\n \n**Осторожный вывод:** \nНа основании предоставленного контекста сложно точно определить механизм взаимодействия конкретных слоев RAG (например, зависимость от других частей архитектуры типа `C0_SOURCE_CHUNKS`, `C4_SEMANTIC_ROLES`). Однако приведенные выше данные достаточно информативны для понимания базовой функциональности и структуры вызова данной функции.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "create_runtime" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] -} - -## Mismatches -- none \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_115223/full_chain_plba_code_retrieval_plba-fullchain-explain-http-control-channel.json b/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_115223/full_chain_plba_code_retrieval_plba-fullchain-explain-http-control-channel.json deleted file mode 100644 index 9ca2741..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_115223/full_chain_plba_code_retrieval_plba-fullchain-explain-http-control-channel.json +++ /dev/null @@ -1,2088 +0,0 @@ -{ - "case_id": "plba-fullchain-explain-http-control-channel", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_retrieval.yaml", - "runner": "runtime", - "mode": "full_chain", - "actual": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 12, - "llm_answer": "## Объяснение сущности `HttpControlChannel`\n\n### Назначение\n`HttpControlChannel` — это класс, отвечающий за управление состоянием и взаимодействие с внешним HTTP каналом для контроля приложения. Он служит основным интерфейсом взаимодействия через HTTP-протокол для конфигурации и мониторинга приложения.\n\n### Ключевые зависимости\nКлючевая зависимость класса — это экземпляр `UvicornThreadRunner`, который запускает сервер для прослушивания HTTP-запросов. Кроме того, используется фабрика `HttpControlAppFactory`, которая отвечает за создание необходимых приложений FastAPI.\n\n### Поток данных или вызовов\n1. **Инициализация (`__init__`)**: \n - При создании экземпляра задаются параметры `host`, `port` и `timeout`.\n - Создаются внутренние объекты `_runner` и `_factory`.\n \n2. **Запуск (`start`)**:\n - Вызывается метод фабрики `_factory.create()` для создания FastAPI-приложения.\n - Запускается сервер с помощью `_runner.start()`.\n - В параметрах передается функция `_health_response`, возвращающая состояние здоровья системы, и функция `_action_response`, обрабатывающая конкретные действия пользователей.\n\n3. **Остановка (`stop`)**:\n - Остановка сервера выполняется вызовом метода `_runner.stop()`.\n\n4. **Получение порта (`port`)**:\n - Возвращает порт, на котором запущен сервер.\n\n5. **Ответы на запросы состояния и действий**:\n - Метод `_health_response` возвращает статус здоровья приложения, основываясь на доступных действиях управления.\n - Метод `_action_response` обрабатывает различные действия пользователя и возвращает соответствующий результат или ошибку.\n\n### Важные детали реализации\n- **Синхронность асинхронных методов**: методы `start`, `_health_response` и `_action_response` являются асинхронными и используют asyncio для ожидания результатов.\n- **Жёсткая привязка к FastAPI**: используется стандартная библиотека FastAPI для создания REST API, что обеспечивает простоту разработки и масштабируемость.\n- **Гибкость конфигурирования**: позволяет легко изменять настройки канала через инициализацию параметров при создании объекта.\n \n### Осторожные выводы\nНа основе косвенных признаков можно предположить, что система использует асинхронную архитектуру и контейнеризована таким образом, чтобы быть гибкой и адаптивной под нужды конкретного окружения исполнения. Однако детальной информации о внешних зависимостях и точном взаимодействии с другими компонентами системы нет.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "HttpControlChannel" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "passed": true, - "mismatches": [], - "details": { - "case_id": "plba-fullchain-explain-http-control-channel", - "text": "Объясни класс HttpControlChannel", - "mode": "full_chain", - "run_started_at": "2026-03-12T11:52:23", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Объясни класс HttpControlChannel", - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "HttpControlChannel", - "alternatives": [ - "HttpControlChannel" - ], - "confidence": 0.99 - }, - "rag_count": 12, - "rag_rows": [ - { - "path": "src/app_runtime/control/http_channel.py", - "content": "class HttpControlChannel\nHttpControlChannel(ControlChannel)", - "layer": "C1_SYMBOL_CATALOG", - "title": "HttpControlChannel", - "span_start": 12, - "span_end": 57, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "1c9fbdc24819e5604c26ea55428a74310f03a03e1af197ed84846af61e42fdb0", - "qname": "HttpControlChannel", - "kind": "class", - "signature": "HttpControlChannel(ControlChannel)", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.control.http_channel", - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (10)", - "layer": "C4_SEMANTIC_ROLES", - "title": "HttpControlChannel", - "span_start": 12, - "span_end": 57, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 21, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "1c9fbdc24819e5604c26ea55428a74310f03a03e1af197ed84846af61e42fdb0", - "symbol_name": "HttpControlChannel", - "qname": "HttpControlChannel", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 10, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel.__init__\n -> HttpControlChannel._runner\n -> HttpControlChannel.start", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "HttpControlChannel.__init__:dataflow_slice", - "span_start": 15, - "span_end": 22, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "51d73913df709152258ed1b9a8c8f4eb3c575eccfe6b982aef0b28e0789a29da", - "edge_type": "dataflow_slice", - "src_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "src_qname": "HttpControlChannel.__init__", - "dst_symbol_id": "d1933f04137f52535b6525f1b93ff2cd83bfb216b480e887e791ed1714cda8e0", - "dst_ref": "HttpControlChannel.start", - "resolution": "resolved", - "slice_id": "51d73913df709152258ed1b9a8c8f4eb3c575eccfe6b982aef0b28e0789a29da", - "root_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "path_symbols": [ - "HttpControlChannel.__init__", - "HttpControlChannel._runner", - "HttpControlChannel.start" - ], - "path_symbol_ids": [ - "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "d1933f04137f52535b6525f1b93ff2cd83bfb216b480e887e791ed1714cda8e0" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel.__init__\n -> HttpControlChannel._runner\n -> HttpControlChannel.port", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "HttpControlChannel.__init__:dataflow_slice", - "span_start": 15, - "span_end": 29, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "c7167bab7218bb768ad7c11bfb40d1a3096e6071dd7817bba5fd864cf8f6de13", - "edge_type": "dataflow_slice", - "src_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "src_qname": "HttpControlChannel.__init__", - "dst_symbol_id": "3632ce8227f4a31e0768f2fb021a4d1ba28e1202633aa0f2fac902295931280f", - "dst_ref": "HttpControlChannel.port", - "resolution": "resolved", - "slice_id": "c7167bab7218bb768ad7c11bfb40d1a3096e6071dd7817bba5fd864cf8f6de13", - "root_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "path_symbols": [ - "HttpControlChannel.__init__", - "HttpControlChannel._runner", - "HttpControlChannel.port" - ], - "path_symbol_ids": [ - "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "3632ce8227f4a31e0768f2fb021a4d1ba28e1202633aa0f2fac902295931280f" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel.__init__\n -> HttpControlChannel._timeout\n -> HttpControlChannel._health_response", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "HttpControlChannel.__init__:dataflow_slice", - "span_start": 14, - "span_end": 34, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "f858f5c9e575f6c4cdfe3853571b7ee21d1f628a443541d2037c3dc9d0790bef", - "edge_type": "dataflow_slice", - "src_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "src_qname": "HttpControlChannel.__init__", - "dst_symbol_id": "e84bf04e9cd2127df235b7064d05f47e19f19a89c7c82f4c247231d4e8fa426a", - "dst_ref": "HttpControlChannel._health_response", - "resolution": "resolved", - "slice_id": "f858f5c9e575f6c4cdfe3853571b7ee21d1f628a443541d2037c3dc9d0790bef", - "root_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "path_symbols": [ - "HttpControlChannel.__init__", - "HttpControlChannel._timeout", - "HttpControlChannel._health_response" - ], - "path_symbol_ids": [ - "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "e84bf04e9cd2127df235b7064d05f47e19f19a89c7c82f4c247231d4e8fa426a" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel.__init__\n -> HttpControlChannel._timeout\n -> HttpControlChannel._action_response", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "HttpControlChannel.__init__:dataflow_slice", - "span_start": 14, - "span_end": 47, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "c3ef21fcae96c82c00be74b3ab827d4af2085d89cb3fa5521c19a174aad84dbb", - "edge_type": "dataflow_slice", - "src_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "src_qname": "HttpControlChannel.__init__", - "dst_symbol_id": "e64969024ccaeb34d8d91473fad07b3b3d341875846392e7a006406c7ada1954", - "dst_ref": "HttpControlChannel._action_response", - "resolution": "resolved", - "slice_id": "c3ef21fcae96c82c00be74b3ab827d4af2085d89cb3fa5521c19a174aad84dbb", - "root_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "path_symbols": [ - "HttpControlChannel.__init__", - "HttpControlChannel._timeout", - "HttpControlChannel._action_response" - ], - "path_symbol_ids": [ - "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "e64969024ccaeb34d8d91473fad07b3b3d341875846392e7a006406c7ada1954" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel.__init__\n -> HttpControlChannel._runner\n -> HttpControlChannel.stop", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "HttpControlChannel.__init__:dataflow_slice", - "span_start": 15, - "span_end": 25, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "0f827ef81a990258a8a74381c8564a8361afa6712dba3200592659c939adcb9d", - "edge_type": "dataflow_slice", - "src_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "src_qname": "HttpControlChannel.__init__", - "dst_symbol_id": "f29ab212620093d72be20e26c5a399624c7939a6056a728762ed3f84a250bfa3", - "dst_ref": "HttpControlChannel.stop", - "resolution": "resolved", - "slice_id": "0f827ef81a990258a8a74381c8564a8361afa6712dba3200592659c939adcb9d", - "root_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "path_symbols": [ - "HttpControlChannel.__init__", - "HttpControlChannel._runner", - "HttpControlChannel.stop" - ], - "path_symbol_ids": [ - "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "f29ab212620093d72be20e26c5a399624c7939a6056a728762ed3f84a250bfa3" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel.__init__\n -> HttpControlChannel._factory\n -> HttpControlChannel.start", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "HttpControlChannel.__init__:dataflow_slice", - "span_start": 16, - "span_end": 21, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e61ec25ded7dbe380d95ce2abcbc1d7a2d2afde5aa8453866df8706dfb7d6ddb", - "edge_type": "dataflow_slice", - "src_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "src_qname": "HttpControlChannel.__init__", - "dst_symbol_id": "d1933f04137f52535b6525f1b93ff2cd83bfb216b480e887e791ed1714cda8e0", - "dst_ref": "HttpControlChannel.start", - "resolution": "resolved", - "slice_id": "e61ec25ded7dbe380d95ce2abcbc1d7a2d2afde5aa8453866df8706dfb7d6ddb", - "root_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "path_symbols": [ - "HttpControlChannel.__init__", - "HttpControlChannel._factory", - "HttpControlChannel.start" - ], - "path_symbol_ids": [ - "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "d1933f04137f52535b6525f1b93ff2cd83bfb216b480e887e791ed1714cda8e0" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "class HttpControlChannel(ControlChannel):\n def __init__(self, host: str, port: int, timeout: int) -> None:\n self._timeout = timeout\n self._runner = UvicornThreadRunner(host, port, timeout)\n self._factory = HttpControlAppFactory()\n self._actions: ControlActionSet | None = None\n\n async def start(self, actions: ControlActionSet) -> None:\n self._actions = actions\n app = self._factory.create(self._health_response, self._action_response)\n await self._runner.start(app)\n\n async def stop(self) -> None:\n await self._runner.stop()\n\n @property\n def port(self) -> int:\n return self._runner.port\n\n async def _health_response(self) -> dict[str, object]:\n if self._actions is None:\n return {\"status\": \"unhealthy\", \"detail\": \"control actions are not configured\"}\n return await asyncio.wait_for(self._actions.health(), timeout=float(self._timeout))\n\n async def _action_response(self, action: str, _client_source: str = \"unknown\") -> JSONResponse:\n if self._actions is None:\n return JSONResponse(content={\"status\": \"error\", \"detail\": f\"{action} handler is not configured\"}, status_code=404)\n callbacks = {\n \"start\": self._actions.start,\n \"stop\": self._actions.stop,\n \"status\": self._actions.status,\n }\n callback = callbacks.get(action)\n if callback is None:\n return JSONResponse(content={\"status\": \"error\", \"detail\": f\"unsupported action: {action}\"}, status_code=404)\n action_timeout = max(float(self._timeout), 10.0) if action in {\"start\", \"stop\"} else float(self._timeout)\n try:\n detail = await asyncio.wait_for(callback(), timeout=action_timeout)\n except asyncio.TimeoutError:\n return JSONResponse(\n content={\"status\": \"accepted\", \"detail\": f\"{action} operation is still in progress\"},\n status_code=202,\n )\n except Exception as exc:\n return JSONResponse(content={\"status\": \"error\", \"detail\": str(exc)}, status_code=500)\n return JSONResponse(content={\"status\": \"ok\", \"detail\": detail or f\"{action} action accepted\"}, status_code=200)", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/http_channel.py:HttpControlChannel", - "span_start": 12, - "span_end": 57, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.http_channel", - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "llm_answer": "## Объяснение сущности `HttpControlChannel`\n\n### Назначение\n`HttpControlChannel` — это класс, отвечающий за управление состоянием и взаимодействие с внешним HTTP каналом для контроля приложения. Он служит основным интерфейсом взаимодействия через HTTP-протокол для конфигурации и мониторинга приложения.\n\n### Ключевые зависимости\nКлючевая зависимость класса — это экземпляр `UvicornThreadRunner`, который запускает сервер для прослушивания HTTP-запросов. Кроме того, используется фабрика `HttpControlAppFactory`, которая отвечает за создание необходимых приложений FastAPI.\n\n### Поток данных или вызовов\n1. **Инициализация (`__init__`)**: \n - При создании экземпляра задаются параметры `host`, `port` и `timeout`.\n - Создаются внутренние объекты `_runner` и `_factory`.\n \n2. **Запуск (`start`)**:\n - Вызывается метод фабрики `_factory.create()` для создания FastAPI-приложения.\n - Запускается сервер с помощью `_runner.start()`.\n - В параметрах передается функция `_health_response`, возвращающая состояние здоровья системы, и функция `_action_response`, обрабатывающая конкретные действия пользователей.\n\n3. **Остановка (`stop`)**:\n - Остановка сервера выполняется вызовом метода `_runner.stop()`.\n\n4. **Получение порта (`port`)**:\n - Возвращает порт, на котором запущен сервер.\n\n5. **Ответы на запросы состояния и действий**:\n - Метод `_health_response` возвращает статус здоровья приложения, основываясь на доступных действиях управления.\n - Метод `_action_response` обрабатывает различные действия пользователя и возвращает соответствующий результат или ошибку.\n\n### Важные детали реализации\n- **Синхронность асинхронных методов**: методы `start`, `_health_response` и `_action_response` являются асинхронными и используют asyncio для ожидания результатов.\n- **Жёсткая привязка к FastAPI**: используется стандартная библиотека FastAPI для создания REST API, что обеспечивает простоту разработки и масштабируемость.\n- **Гибкость конфигурирования**: позволяет легко изменять настройки канала через инициализацию параметров при создании объекта.\n \n### Осторожные выводы\nНа основе косвенных признаков можно предположить, что система использует асинхронную архитектуру и контейнеризована таким образом, чтобы быть гибкой и адаптивной под нужды конкретного окружения исполнения. Однако детальной информации о внешних зависимостях и точном взаимодействии с другими компонентами системы нет.", - "summary": { - "router": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "confidence": null - }, - "retrieval": { - "profile": "code", - "layers_hit": [ - "C0_SOURCE_CHUNKS", - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS", - "C4_SEMANTIC_ROLES" - ], - "evidence_sufficient": true - }, - "llm": { - "answer_status": "answered", - "groundedness": "grounded" - } - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "HttpControlChannel" - ], - "keyword_hints": [ - "HttpControlChannel" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C0_SOURCE_CHUNKS": "exact_path_fetch", - "C4_SEMANTIC_ROLES": "exact_path_fetch", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C3_ENTRYPOINTS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 8, - "C4_SEMANTIC_ROLES": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C3_ENTRYPOINTS": 6 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C4_SEMANTIC_ROLES": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "HttpControlChannel", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "HttpControlChannel", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C4_SEMANTIC_ROLES", - "query": "HttpControlChannel", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "HttpControlChannel", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - }, - { - "layer": "C3_ENTRYPOINTS", - "query": "HttpControlChannel", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 1, - "candidates_after_filter": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 6, - "candidates_after_filter": 6 - }, - { - "layer": "C3_ENTRYPOINTS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 3, - "candidates_after_filter": 3 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "HttpControlChannel", - "alternatives": [ - "HttpControlChannel" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C4_SEMANTIC_ROLES", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 6, - "fail_reason": null - }, - { - "layer": "C3_ENTRYPOINTS", - "status": "hit", - "hit_count": 3, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "router": 0, - "symbol_resolution": 0, - "retrieval_total": 166, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 56, - "C0_SOURCE_CHUNKS": 21, - "C4_SEMANTIC_ROLES": 21, - "C2_DEPENDENCY_GRAPH": 55, - "C3_ENTRYPOINTS": 11 - }, - "merge_rank": 20, - "prompt_build": 0, - "llm_call": 3616 - }, - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 795, - "evidence_rows": 12, - "evidence_chars": 3028 - }, - "evidence_summary": [ - { - "layer": "C1_SYMBOL_CATALOG", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "count": 6, - "unique_paths": 1 - }, - { - "layer": "C3_ENTRYPOINTS", - "count": 3, - "unique_paths": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 1, - "unique_paths": 1 - } - ], - "prompt_template_id": "intent_code_qa_explain_ru_v1", - "system_prompt_version": "v1" - }, - "router": { - "conversation_mode": "START", - "keyword_hints": [ - "HttpControlChannel" - ], - "path_scope": [] - }, - "llm": { - "used_evidence_count": 12, - "missing_evidence_reason": null - } - }, - "run_info": { - "case_id": "plba-fullchain-explain-http-control-channel", - "mode": "full_chain", - "run_started_at": "2026-03-12T11:52:23", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - }, - "input_request": { - "text": "Объясни класс HttpControlChannel", - "normalized_query": "Объясни класс HttpControlChannel" - }, - "steps": [ - { - "step": "intent_router", - "input": { - "query": "Объясни класс HttpControlChannel" - }, - "output": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Объясни класс HttpControlChannel" - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "HttpControlChannel" - ], - "keyword_hints": [ - "HttpControlChannel" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "timings_ms": { - "router": 0 - } - } - }, - { - "step": "retrieval", - "input": { - "query": "Объясни класс HttpControlChannel" - }, - "output": { - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "HttpControlChannel", - "alternatives": [ - "HttpControlChannel" - ], - "confidence": 0.99 - }, - "rag_count": 12, - "rag_rows": [ - { - "path": "src/app_runtime/control/http_channel.py", - "content": "class HttpControlChannel\nHttpControlChannel(ControlChannel)", - "layer": "C1_SYMBOL_CATALOG", - "title": "HttpControlChannel", - "span_start": 12, - "span_end": 57, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "1c9fbdc24819e5604c26ea55428a74310f03a03e1af197ed84846af61e42fdb0", - "qname": "HttpControlChannel", - "kind": "class", - "signature": "HttpControlChannel(ControlChannel)", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.control.http_channel", - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (10)", - "layer": "C4_SEMANTIC_ROLES", - "title": "HttpControlChannel", - "span_start": 12, - "span_end": 57, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 21, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "1c9fbdc24819e5604c26ea55428a74310f03a03e1af197ed84846af61e42fdb0", - "symbol_name": "HttpControlChannel", - "qname": "HttpControlChannel", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 10, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel.__init__\n -> HttpControlChannel._runner\n -> HttpControlChannel.start", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "HttpControlChannel.__init__:dataflow_slice", - "span_start": 15, - "span_end": 22, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "51d73913df709152258ed1b9a8c8f4eb3c575eccfe6b982aef0b28e0789a29da", - "edge_type": "dataflow_slice", - "src_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "src_qname": "HttpControlChannel.__init__", - "dst_symbol_id": "d1933f04137f52535b6525f1b93ff2cd83bfb216b480e887e791ed1714cda8e0", - "dst_ref": "HttpControlChannel.start", - "resolution": "resolved", - "slice_id": "51d73913df709152258ed1b9a8c8f4eb3c575eccfe6b982aef0b28e0789a29da", - "root_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "path_symbols": [ - "HttpControlChannel.__init__", - "HttpControlChannel._runner", - "HttpControlChannel.start" - ], - "path_symbol_ids": [ - "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "d1933f04137f52535b6525f1b93ff2cd83bfb216b480e887e791ed1714cda8e0" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel.__init__\n -> HttpControlChannel._runner\n -> HttpControlChannel.port", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "HttpControlChannel.__init__:dataflow_slice", - "span_start": 15, - "span_end": 29, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "c7167bab7218bb768ad7c11bfb40d1a3096e6071dd7817bba5fd864cf8f6de13", - "edge_type": "dataflow_slice", - "src_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "src_qname": "HttpControlChannel.__init__", - "dst_symbol_id": "3632ce8227f4a31e0768f2fb021a4d1ba28e1202633aa0f2fac902295931280f", - "dst_ref": "HttpControlChannel.port", - "resolution": "resolved", - "slice_id": "c7167bab7218bb768ad7c11bfb40d1a3096e6071dd7817bba5fd864cf8f6de13", - "root_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "path_symbols": [ - "HttpControlChannel.__init__", - "HttpControlChannel._runner", - "HttpControlChannel.port" - ], - "path_symbol_ids": [ - "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "3632ce8227f4a31e0768f2fb021a4d1ba28e1202633aa0f2fac902295931280f" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel.__init__\n -> HttpControlChannel._timeout\n -> HttpControlChannel._health_response", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "HttpControlChannel.__init__:dataflow_slice", - "span_start": 14, - "span_end": 34, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "f858f5c9e575f6c4cdfe3853571b7ee21d1f628a443541d2037c3dc9d0790bef", - "edge_type": "dataflow_slice", - "src_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "src_qname": "HttpControlChannel.__init__", - "dst_symbol_id": "e84bf04e9cd2127df235b7064d05f47e19f19a89c7c82f4c247231d4e8fa426a", - "dst_ref": "HttpControlChannel._health_response", - "resolution": "resolved", - "slice_id": "f858f5c9e575f6c4cdfe3853571b7ee21d1f628a443541d2037c3dc9d0790bef", - "root_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "path_symbols": [ - "HttpControlChannel.__init__", - "HttpControlChannel._timeout", - "HttpControlChannel._health_response" - ], - "path_symbol_ids": [ - "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "e84bf04e9cd2127df235b7064d05f47e19f19a89c7c82f4c247231d4e8fa426a" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel.__init__\n -> HttpControlChannel._timeout\n -> HttpControlChannel._action_response", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "HttpControlChannel.__init__:dataflow_slice", - "span_start": 14, - "span_end": 47, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "c3ef21fcae96c82c00be74b3ab827d4af2085d89cb3fa5521c19a174aad84dbb", - "edge_type": "dataflow_slice", - "src_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "src_qname": "HttpControlChannel.__init__", - "dst_symbol_id": "e64969024ccaeb34d8d91473fad07b3b3d341875846392e7a006406c7ada1954", - "dst_ref": "HttpControlChannel._action_response", - "resolution": "resolved", - "slice_id": "c3ef21fcae96c82c00be74b3ab827d4af2085d89cb3fa5521c19a174aad84dbb", - "root_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "path_symbols": [ - "HttpControlChannel.__init__", - "HttpControlChannel._timeout", - "HttpControlChannel._action_response" - ], - "path_symbol_ids": [ - "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "e64969024ccaeb34d8d91473fad07b3b3d341875846392e7a006406c7ada1954" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel.__init__\n -> HttpControlChannel._runner\n -> HttpControlChannel.stop", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "HttpControlChannel.__init__:dataflow_slice", - "span_start": 15, - "span_end": 25, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "0f827ef81a990258a8a74381c8564a8361afa6712dba3200592659c939adcb9d", - "edge_type": "dataflow_slice", - "src_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "src_qname": "HttpControlChannel.__init__", - "dst_symbol_id": "f29ab212620093d72be20e26c5a399624c7939a6056a728762ed3f84a250bfa3", - "dst_ref": "HttpControlChannel.stop", - "resolution": "resolved", - "slice_id": "0f827ef81a990258a8a74381c8564a8361afa6712dba3200592659c939adcb9d", - "root_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "path_symbols": [ - "HttpControlChannel.__init__", - "HttpControlChannel._runner", - "HttpControlChannel.stop" - ], - "path_symbol_ids": [ - "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "f29ab212620093d72be20e26c5a399624c7939a6056a728762ed3f84a250bfa3" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel.__init__\n -> HttpControlChannel._factory\n -> HttpControlChannel.start", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "HttpControlChannel.__init__:dataflow_slice", - "span_start": 16, - "span_end": 21, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e61ec25ded7dbe380d95ce2abcbc1d7a2d2afde5aa8453866df8706dfb7d6ddb", - "edge_type": "dataflow_slice", - "src_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "src_qname": "HttpControlChannel.__init__", - "dst_symbol_id": "d1933f04137f52535b6525f1b93ff2cd83bfb216b480e887e791ed1714cda8e0", - "dst_ref": "HttpControlChannel.start", - "resolution": "resolved", - "slice_id": "e61ec25ded7dbe380d95ce2abcbc1d7a2d2afde5aa8453866df8706dfb7d6ddb", - "root_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "path_symbols": [ - "HttpControlChannel.__init__", - "HttpControlChannel._factory", - "HttpControlChannel.start" - ], - "path_symbol_ids": [ - "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "d1933f04137f52535b6525f1b93ff2cd83bfb216b480e887e791ed1714cda8e0" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "class HttpControlChannel(ControlChannel):\n def __init__(self, host: str, port: int, timeout: int) -> None:\n self._timeout = timeout\n self._runner = UvicornThreadRunner(host, port, timeout)\n self._factory = HttpControlAppFactory()\n self._actions: ControlActionSet | None = None\n\n async def start(self, actions: ControlActionSet) -> None:\n self._actions = actions\n app = self._factory.create(self._health_response, self._action_response)\n await self._runner.start(app)\n\n async def stop(self) -> None:\n await self._runner.stop()\n\n @property\n def port(self) -> int:\n return self._runner.port\n\n async def _health_response(self) -> dict[str, object]:\n if self._actions is None:\n return {\"status\": \"unhealthy\", \"detail\": \"control actions are not configured\"}\n return await asyncio.wait_for(self._actions.health(), timeout=float(self._timeout))\n\n async def _action_response(self, action: str, _client_source: str = \"unknown\") -> JSONResponse:\n if self._actions is None:\n return JSONResponse(content={\"status\": \"error\", \"detail\": f\"{action} handler is not configured\"}, status_code=404)\n callbacks = {\n \"start\": self._actions.start,\n \"stop\": self._actions.stop,\n \"status\": self._actions.status,\n }\n callback = callbacks.get(action)\n if callback is None:\n return JSONResponse(content={\"status\": \"error\", \"detail\": f\"unsupported action: {action}\"}, status_code=404)\n action_timeout = max(float(self._timeout), 10.0) if action in {\"start\", \"stop\"} else float(self._timeout)\n try:\n detail = await asyncio.wait_for(callback(), timeout=action_timeout)\n except asyncio.TimeoutError:\n return JSONResponse(\n content={\"status\": \"accepted\", \"detail\": f\"{action} operation is still in progress\"},\n status_code=202,\n )\n except Exception as exc:\n return JSONResponse(content={\"status\": \"error\", \"detail\": str(exc)}, status_code=500)\n return JSONResponse(content={\"status\": \"ok\", \"detail\": detail or f\"{action} action accepted\"}, status_code=200)", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/http_channel.py:HttpControlChannel", - "span_start": 12, - "span_end": 57, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.http_channel", - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ] - }, - "diagnostics": { - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C0_SOURCE_CHUNKS": "exact_path_fetch", - "C4_SEMANTIC_ROLES": "exact_path_fetch", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C3_ENTRYPOINTS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 8, - "C4_SEMANTIC_ROLES": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C3_ENTRYPOINTS": 6 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C4_SEMANTIC_ROLES": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "HttpControlChannel", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "HttpControlChannel", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C4_SEMANTIC_ROLES", - "query": "HttpControlChannel", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "HttpControlChannel", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - }, - { - "layer": "C3_ENTRYPOINTS", - "query": "HttpControlChannel", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 1, - "candidates_after_filter": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 6, - "candidates_after_filter": 6 - }, - { - "layer": "C3_ENTRYPOINTS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 3, - "candidates_after_filter": 3 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "HttpControlChannel", - "alternatives": [ - "HttpControlChannel" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C4_SEMANTIC_ROLES", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 6, - "fail_reason": null - }, - { - "layer": "C3_ENTRYPOINTS", - "status": "hit", - "hit_count": 3, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "symbol_resolution": 0, - "retrieval_total": 166, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 56, - "C0_SOURCE_CHUNKS": 21, - "C4_SEMANTIC_ROLES": 21, - "C2_DEPENDENCY_GRAPH": 55, - "C3_ENTRYPOINTS": 11 - }, - "merge_rank": 20 - } - } - }, - { - "step": "llm_answer", - "input": { - "query": "Объясни класс HttpControlChannel", - "rag_count": 12 - }, - "output": { - "llm_answer": "## Объяснение сущности `HttpControlChannel`\n\n### Назначение\n`HttpControlChannel` — это класс, отвечающий за управление состоянием и взаимодействие с внешним HTTP каналом для контроля приложения. Он служит основным интерфейсом взаимодействия через HTTP-протокол для конфигурации и мониторинга приложения.\n\n### Ключевые зависимости\nКлючевая зависимость класса — это экземпляр `UvicornThreadRunner`, который запускает сервер для прослушивания HTTP-запросов. Кроме того, используется фабрика `HttpControlAppFactory`, которая отвечает за создание необходимых приложений FastAPI.\n\n### Поток данных или вызовов\n1. **Инициализация (`__init__`)**: \n - При создании экземпляра задаются параметры `host`, `port` и `timeout`.\n - Создаются внутренние объекты `_runner` и `_factory`.\n \n2. **Запуск (`start`)**:\n - Вызывается метод фабрики `_factory.create()` для создания FastAPI-приложения.\n - Запускается сервер с помощью `_runner.start()`.\n - В параметрах передается функция `_health_response`, возвращающая состояние здоровья системы, и функция `_action_response`, обрабатывающая конкретные действия пользователей.\n\n3. **Остановка (`stop`)**:\n - Остановка сервера выполняется вызовом метода `_runner.stop()`.\n\n4. **Получение порта (`port`)**:\n - Возвращает порт, на котором запущен сервер.\n\n5. **Ответы на запросы состояния и действий**:\n - Метод `_health_response` возвращает статус здоровья приложения, основываясь на доступных действиях управления.\n - Метод `_action_response` обрабатывает различные действия пользователя и возвращает соответствующий результат или ошибку.\n\n### Важные детали реализации\n- **Синхронность асинхронных методов**: методы `start`, `_health_response` и `_action_response` являются асинхронными и используют asyncio для ожидания результатов.\n- **Жёсткая привязка к FastAPI**: используется стандартная библиотека FastAPI для создания REST API, что обеспечивает простоту разработки и масштабируемость.\n- **Гибкость конфигурирования**: позволяет легко изменять настройки канала через инициализацию параметров при создании объекта.\n \n### Осторожные выводы\nНа основе косвенных признаков можно предположить, что система использует асинхронную архитектуру и контейнеризована таким образом, чтобы быть гибкой и адаптивной под нужды конкретного окружения исполнения. Однако детальной информации о внешних зависимостях и точном взаимодействии с другими компонентами системы нет." - }, - "diagnostics": { - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 795, - "evidence_rows": 12, - "evidence_chars": 3028 - }, - "evidence_summary": [ - { - "layer": "C1_SYMBOL_CATALOG", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "count": 6, - "unique_paths": 1 - }, - { - "layer": "C3_ENTRYPOINTS", - "count": 3, - "unique_paths": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 1, - "unique_paths": 1 - } - ], - "prompt_template_id": "intent_code_qa_explain_ru_v1", - "system_prompt_version": "v1" - }, - "timings_ms": { - "prompt_build": 0, - "llm_call": 3616 - } - } - } - ] - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_115223/full_chain_plba_code_retrieval_plba-fullchain-explain-http-control-channel.md b/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_115223/full_chain_plba_code_retrieval_plba-fullchain-explain-http-control-channel.md deleted file mode 100644 index c601925..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_115223/full_chain_plba_code_retrieval_plba-fullchain-explain-http-control-channel.md +++ /dev/null @@ -1,34 +0,0 @@ -# plba-fullchain-explain-http-control-channel - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_retrieval.yaml -- runner: runtime -- mode: full_chain -- passed: True - -## Query -Объясни класс HttpControlChannel - -## Actual -{ - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 12, - "llm_answer": "## Объяснение сущности `HttpControlChannel`\n\n### Назначение\n`HttpControlChannel` — это класс, отвечающий за управление состоянием и взаимодействие с внешним HTTP каналом для контроля приложения. Он служит основным интерфейсом взаимодействия через HTTP-протокол для конфигурации и мониторинга приложения.\n\n### Ключевые зависимости\nКлючевая зависимость класса — это экземпляр `UvicornThreadRunner`, который запускает сервер для прослушивания HTTP-запросов. Кроме того, используется фабрика `HttpControlAppFactory`, которая отвечает за создание необходимых приложений FastAPI.\n\n### Поток данных или вызовов\n1. **Инициализация (`__init__`)**: \n - При создании экземпляра задаются параметры `host`, `port` и `timeout`.\n - Создаются внутренние объекты `_runner` и `_factory`.\n \n2. **Запуск (`start`)**:\n - Вызывается метод фабрики `_factory.create()` для создания FastAPI-приложения.\n - Запускается сервер с помощью `_runner.start()`.\n - В параметрах передается функция `_health_response`, возвращающая состояние здоровья системы, и функция `_action_response`, обрабатывающая конкретные действия пользователей.\n\n3. **Остановка (`stop`)**:\n - Остановка сервера выполняется вызовом метода `_runner.stop()`.\n\n4. **Получение порта (`port`)**:\n - Возвращает порт, на котором запущен сервер.\n\n5. **Ответы на запросы состояния и действий**:\n - Метод `_health_response` возвращает статус здоровья приложения, основываясь на доступных действиях управления.\n - Метод `_action_response` обрабатывает различные действия пользователя и возвращает соответствующий результат или ошибку.\n\n### Важные детали реализации\n- **Синхронность асинхронных методов**: методы `start`, `_health_response` и `_action_response` являются асинхронными и используют asyncio для ожидания результатов.\n- **Жёсткая привязка к FastAPI**: используется стандартная библиотека FastAPI для создания REST API, что обеспечивает простоту разработки и масштабируемость.\n- **Гибкость конфигурирования**: позволяет легко изменять настройки канала через инициализацию параметров при создании объекта.\n \n### Осторожные выводы\nНа основе косвенных признаков можно предположить, что система использует асинхронную архитектуру и контейнеризована таким образом, чтобы быть гибкой и адаптивной под нужды конкретного окружения исполнения. Однако детальной информации о внешних зависимостях и точном взаимодействии с другими компонентами системы нет.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "HttpControlChannel" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] -} - -## Mismatches -- none \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_115223/full_chain_plba_code_retrieval_plba-fullchain-explain-runtime-manager.json b/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_115223/full_chain_plba_code_retrieval_plba-fullchain-explain-runtime-manager.json deleted file mode 100644 index 4a3a3ae..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_115223/full_chain_plba_code_retrieval_plba-fullchain-explain-runtime-manager.json +++ /dev/null @@ -1,2088 +0,0 @@ -{ - "case_id": "plba-fullchain-explain-runtime-manager", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_retrieval.yaml", - "runner": "runtime", - "mode": "full_chain", - "actual": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 12, - "llm_answer": "## Назначение класса `RuntimeManager`\nКласс `RuntimeManager` играет роль менеджера, отвечающего за управление жизненным циклом различных компонентов приложения, таких как конфигурация (`ConfigurationManager`), сервисы (`ServiceContainer`), трассировка событий (`TraceService`), здоровье системы (`HealthRegistry`), логирование (`LogManager`) и мониторинг работы рабочих процессов (`WorkerSupervisor`). Он координирует взаимодействие этих компонентов и управляет их состоянием через методы регистрации, инициализации и мониторинга.\n\n## Ключевые зависимости\nКлючевыми зависимостями являются следующие классы и сущности:\n- `ConfigurationManager`: отвечает за хранение и доступ к конфигурации приложения.\n- `ServiceContainer`: контейнер для хранения и управления сервисами приложения.\n- `TraceService`: предоставляет возможность отслеживать события выполнения и состояния системы.\n- `HealthRegistry`: регистрирует и отслеживает состояние здоровья различных сервисов и модулей.\n- `LogManager`: обрабатывает и записывает логи операций и событий.\n- `WorkerSupervisor`: мониторит рабочие процессы и выполняет необходимые действия по управлению ими.\n- `ControlPlaneService`: центральный сервис управления системой, с которым взаимодействует `RuntimeManager`.\n\n## Поток данных или вызовов\nПри создании экземпляра класса `RuntimeManager`, он принимает несколько необязательных аргументов, представляющих вышеуказанные компоненты. После создания экземпляра, вызывается метод `_register_core_services()`, который осуществляет регистрацию базовых служб и сервисов, необходимых для нормального функционирования системы.\n\nВызовы и зависимости внутри класса организуются следующим образом:\n- При каждом обращении к `RuntimeManager.register_module(module)` происходит регистрация нового модуля или сервиса в системе, что позволяет приложению динамически расширять свою функциональность.\n- Методы, такие как `self.control_plane.start()` и `self.control_plane.stop()`, используются для старта и остановки системы соответственно.\n- Метод `self._register_core_services()` предназначен для начальной регистрации основных сервисов и компонент, используемых в приложении.\n\n## Важные детали реализации\n### Конструктор класса\nКонструктор класса получает набор опциональных параметров, каждый из которых представляет собой отдельный компонент или службу. Если соответствующий параметр отсутствует, используется значение по умолчанию соответствующего типа (например, `ConfigurationManager()`).\n\n### Методы управления жизненным циклом\nМетоды `start()` и `stop()` обеспечивают старт и остановку всей системы соответственно. Эти методы зависят от метода `ControlPlaneService._stop_async()`, который запускается при завершении работы системы.\n\n### Реализация функциональности управления состоянием\nРеализована переменная `_state`, которая отражает текущее состояние системы (`LifecycleState.IDLE`, `LifecycleState.RUNNING`, etc.). Этот атрибут используется для контроля над тем, какие операции могут быть выполнены в текущий момент времени.\n\n### Дополнительная логика\nКроме основной функциональности, реализованы механизмы регистрации модулей и проверки состояний, которые позволяют приложению поддерживать гибкость и масштабируемость.\n\n---\n\n**Ограничения и осторожные выводы**\nНа основе предоставленного контекста невозможно полностью раскрыть детали внутренней реализации методов и функционала классов, упомянутых во внешних зависимостях (таких как `ControlPlaneService`, `WorkerSupervisor`, `TraceService` и т.д.), так как информация о них отсутствует напрямую. Следовательно, приведенные выше описания основаны преимущественно на сигнатурах функций и доступных косвенных признаках.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "RuntimeManager" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "passed": true, - "mismatches": [], - "details": { - "case_id": "plba-fullchain-explain-runtime-manager", - "text": "Объясни как работает класс RuntimeManager", - "mode": "full_chain", - "run_started_at": "2026-03-12T11:52:23", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Объясни как работает класс RuntimeManager", - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "RuntimeManager", - "alternatives": [ - "RuntimeManager" - ], - "confidence": 0.99 - }, - "rag_count": 12, - "rag_rows": [ - { - "path": "src/app_runtime/core/runtime.py", - "content": "class RuntimeManager\nRuntimeManager", - "layer": "C1_SYMBOL_CATALOG", - "title": "RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "7e4a9381328c5803bbc6179458612fc4e947d928aa7bf8b4b2bebb2c8592f758", - "qname": "RuntimeManager", - "kind": "class", - "signature": "RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.core.runtime", - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests manager\n- orchestrates role-like calls (4)\n- reads and writes state attributes\n- participates in dataflow slices (50)", - "layer": "C4_SEMANTIC_ROLES", - "title": "RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 43, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "7e4a9381328c5803bbc6179458612fc4e947d928aa7bf8b4b2bebb2c8592f758", - "symbol_name": "RuntimeManager", - "qname": "RuntimeManager", - "role": "pipeline_stage", - "confidence": 0.67, - "dataflow_participation": 50, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.stop", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 25, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d", - "dst_ref": "ControlPlaneService.stop", - "resolution": "resolved", - "slice_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.stop" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._stop_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 51, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a", - "dst_ref": "ControlPlaneService._stop_async", - "resolution": "resolved", - "slice_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._stop_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.register_channel", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 17, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957", - "dst_ref": "ControlPlaneService.register_channel", - "resolution": "resolved", - "slice_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.register_channel" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.start", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 20, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154", - "dst_ref": "ControlPlaneService.start", - "resolution": "resolved", - "slice_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.start" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._start_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 47, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517", - "dst_ref": "ControlPlaneService._start_async", - "resolution": "resolved", - "slice_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._start_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager.add_config_file", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 32, - "span_end": 52, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "a23b8a11ebdb12708b60c96ea12a69f7f042082f1adfddd572444e246d81d167", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "57ffbd4f0d9fdf3507c2b8624312ce211f3d02fdf86a57a8ec90778d8a7b498d", - "dst_ref": "RuntimeManager.add_config_file", - "resolution": "resolved", - "slice_id": "a23b8a11ebdb12708b60c96ea12a69f7f042082f1adfddd572444e246d81d167", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager.add_config_file" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "57ffbd4f0d9fdf3507c2b8624312ce211f3d02fdf86a57a8ec90778d8a7b498d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "class RuntimeManager:\n ACTION_TIMEOUT_SECONDS = 10.0\n ACTION_POLL_INTERVAL_SECONDS = 0.05\n\n def __init__(\n self,\n configuration: ConfigurationManager | None = None,\n services: ServiceContainer | None = None,\n traces: TraceService | None = None,\n health: HealthRegistry | None = None,\n logs: LogManager | None = None,\n workers: WorkerSupervisor | None = None,\n control_plane: ControlPlaneService | None = None,\n ) -> None:\n self.configuration = configuration or ConfigurationManager()\n self.services = services or ServiceContainer()\n self.traces = traces or TraceService()\n self.health = health or HealthRegistry()\n self.logs = logs or LogManager()\n self.workers = workers or WorkerSupervisor()\n self.control_plane = control_plane or ControlPlaneService()\n self.registry = ModuleRegistry(self.services)\n self._started = False\n self._state = LifecycleState.IDLE\n self._core_registered = False\n self._workers_registered = False\n self._register_core_services()\n\n def register_module(self, module: ApplicationModule) -> None:\n self.registry.register_module(module.name)\n module.register(self.registry)\n\n def add_config_file(self, path: str) -> FileConfigProvider:\n provider = FileConfigProvider(path)\n self.configuration.add_provider(provider)\n return provider\n\n def start(self, *, start_control_plane: bool = True) -> None:\n if self._started:\n return\n self._state = LifecycleState.STARTING\n config = self.configuration.load()\n self.logs.apply_config(config)\n self._register_health_contributors()\n self._register_workers()\n self.workers.start()\n if start_control_plane:\n self.control_plane.start(self)\n self._started = True\n self._refresh_state()\n\n def stop(self, timeout: float = 30.0, force: bool = False, stop_control_plane: bool = True) -> None:\n if not self._started:\n return\n self._state = LifecycleState.STOPPING\n self.workers.stop(timeout=timeout, force=force)\n if stop_control_plane:\n self.control_plane.stop()\n self._started = False\n self._state = LifecycleState.STOPPED\n\n def status(self) -> dict[str, object]:\n self._refresh_state()\n return self.control_plane.snapshot(self)\n\n def current_health(self) -> HealthPayload:\n self._refresh_state()\n return self.health.payload(self._state, self.workers.healths())\n\n async def health_status(self) -> HealthPayload:\n return self.current_health()\n\n async def start_runtime(self) -> dict[str, object] | str:\n self._refresh_state()\n if self._started:\n return \"runtime already running\"\n if self._state == LifecycleState.STOPPING:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n\n self.start(start_control_plane=False)\n started = self._wait_for_state({LifecycleState.IDLE, LifecycleState.BUSY}, timeout=self.ACTION_TIMEOUT_SECONDS)\n if started:\n return self._action_detail(\"runtime started\", timed_out=False)\n return self._action_detail(\"runtime start is still in progress\", timed_out=True)\n\n async def stop_runtime(self) -> dict[str, object] | str:\n self._refresh_state()\n if not self._started:\n if self._state == LifecycleState.STOPPING:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n return \"runtime already stopped\"\n\n self._state = LifecycleState.STOPPING\n try:\n self.workers.stop(timeout=self.ACTION_TIMEOUT_SECONDS, force=False)\n except TimeoutError:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n\n self._started = False\n self._state = LifecycleState.STOPPED\n return self._action_detail(\"runtime stopped\", timed_out=False)\n\n async def runtime_status(self) -> str:\n self._refresh_state()\n return self._state.value\n\n def _register_core_services(self) -> None:\n if self._core_registered:\n return\n self.services.register(\"configuration\", self.configuration)\n self.services.register(\"traces\", self.traces)\n self.services.register(\"health\", self.health)\n self.services.register(\"logs\", self.logs)\n self.services.register(\"workers\", self.workers)\n self.services.register(\"control_plane\", self.control_plane)\n self._core_registered = True\n\n def _register_health_contributors(self) -> None:\n for contributor in self.registry.health_contributors:\n self.health.register(contributor)\n\n def _register_workers(self) -> None:\n if self._workers_registered:\n return\n for worker in self.registry.workers:\n self.workers.register(worker)\n self._workers_registered = True\n\n def _refresh_state(self) -> None:\n lifecycle = self.workers.lifecycle_state()\n\n if self._state == LifecycleState.STOPPING:\n if lifecycle == LifecycleState.STOPPED:\n self._started = False\n self._state = LifecycleState.STOPPED\n return\n\n if not self._started:\n if lifecycle == LifecycleState.STOPPED:\n self._state = LifecycleState.STOPPED\n return\n\n self._state = lifecycle\n\n def _wait_for_state(self, target_states: set[LifecycleState], *, timeout: float) -> bool:\n deadline = monotonic() + timeout\n while monotonic() < deadline:\n self._refresh_state()\n if self._state in target_states:\n return True\n sleep(self.ACTION_POLL_INTERVAL_SECONDS)\n self._refresh_state()\n return self._state in target_states\n\n def _action_detail(self, message: str, *, timed_out: bool) -> dict[str, object]:\n self._refresh_state()\n return {\n \"message\": message,\n \"state\": self._state.value,\n \"timed_out\": timed_out,\n \"workers\": self.workers.snapshot(),\n }", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/core/runtime.py:RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.core.runtime", - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "llm_answer": "## Назначение класса `RuntimeManager`\nКласс `RuntimeManager` играет роль менеджера, отвечающего за управление жизненным циклом различных компонентов приложения, таких как конфигурация (`ConfigurationManager`), сервисы (`ServiceContainer`), трассировка событий (`TraceService`), здоровье системы (`HealthRegistry`), логирование (`LogManager`) и мониторинг работы рабочих процессов (`WorkerSupervisor`). Он координирует взаимодействие этих компонентов и управляет их состоянием через методы регистрации, инициализации и мониторинга.\n\n## Ключевые зависимости\nКлючевыми зависимостями являются следующие классы и сущности:\n- `ConfigurationManager`: отвечает за хранение и доступ к конфигурации приложения.\n- `ServiceContainer`: контейнер для хранения и управления сервисами приложения.\n- `TraceService`: предоставляет возможность отслеживать события выполнения и состояния системы.\n- `HealthRegistry`: регистрирует и отслеживает состояние здоровья различных сервисов и модулей.\n- `LogManager`: обрабатывает и записывает логи операций и событий.\n- `WorkerSupervisor`: мониторит рабочие процессы и выполняет необходимые действия по управлению ими.\n- `ControlPlaneService`: центральный сервис управления системой, с которым взаимодействует `RuntimeManager`.\n\n## Поток данных или вызовов\nПри создании экземпляра класса `RuntimeManager`, он принимает несколько необязательных аргументов, представляющих вышеуказанные компоненты. После создания экземпляра, вызывается метод `_register_core_services()`, который осуществляет регистрацию базовых служб и сервисов, необходимых для нормального функционирования системы.\n\nВызовы и зависимости внутри класса организуются следующим образом:\n- При каждом обращении к `RuntimeManager.register_module(module)` происходит регистрация нового модуля или сервиса в системе, что позволяет приложению динамически расширять свою функциональность.\n- Методы, такие как `self.control_plane.start()` и `self.control_plane.stop()`, используются для старта и остановки системы соответственно.\n- Метод `self._register_core_services()` предназначен для начальной регистрации основных сервисов и компонент, используемых в приложении.\n\n## Важные детали реализации\n### Конструктор класса\nКонструктор класса получает набор опциональных параметров, каждый из которых представляет собой отдельный компонент или службу. Если соответствующий параметр отсутствует, используется значение по умолчанию соответствующего типа (например, `ConfigurationManager()`).\n\n### Методы управления жизненным циклом\nМетоды `start()` и `stop()` обеспечивают старт и остановку всей системы соответственно. Эти методы зависят от метода `ControlPlaneService._stop_async()`, который запускается при завершении работы системы.\n\n### Реализация функциональности управления состоянием\nРеализована переменная `_state`, которая отражает текущее состояние системы (`LifecycleState.IDLE`, `LifecycleState.RUNNING`, etc.). Этот атрибут используется для контроля над тем, какие операции могут быть выполнены в текущий момент времени.\n\n### Дополнительная логика\nКроме основной функциональности, реализованы механизмы регистрации модулей и проверки состояний, которые позволяют приложению поддерживать гибкость и масштабируемость.\n\n---\n\n**Ограничения и осторожные выводы**\nНа основе предоставленного контекста невозможно полностью раскрыть детали внутренней реализации методов и функционала классов, упомянутых во внешних зависимостях (таких как `ControlPlaneService`, `WorkerSupervisor`, `TraceService` и т.д.), так как информация о них отсутствует напрямую. Следовательно, приведенные выше описания основаны преимущественно на сигнатурах функций и доступных косвенных признаках.", - "summary": { - "router": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "confidence": null - }, - "retrieval": { - "profile": "code", - "layers_hit": [ - "C0_SOURCE_CHUNKS", - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS", - "C4_SEMANTIC_ROLES" - ], - "evidence_sufficient": true - }, - "llm": { - "answer_status": "answered", - "groundedness": "grounded" - } - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "RuntimeManager" - ], - "keyword_hints": [ - "RuntimeManager" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C0_SOURCE_CHUNKS": "exact_path_fetch", - "C4_SEMANTIC_ROLES": "exact_path_fetch", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C3_ENTRYPOINTS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 8, - "C4_SEMANTIC_ROLES": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C3_ENTRYPOINTS": 6 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C4_SEMANTIC_ROLES": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C4_SEMANTIC_ROLES", - "query": "RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - }, - { - "layer": "C3_ENTRYPOINTS", - "query": "RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 1, - "candidates_after_filter": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 6, - "candidates_after_filter": 6 - }, - { - "layer": "C3_ENTRYPOINTS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 3, - "candidates_after_filter": 3 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "RuntimeManager", - "alternatives": [ - "RuntimeManager" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C4_SEMANTIC_ROLES", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 6, - "fail_reason": null - }, - { - "layer": "C3_ENTRYPOINTS", - "status": "hit", - "hit_count": 3, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "router": 0, - "symbol_resolution": 0, - "retrieval_total": 322, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 30, - "C0_SOURCE_CHUNKS": 17, - "C4_SEMANTIC_ROLES": 14, - "C2_DEPENDENCY_GRAPH": 58, - "C3_ENTRYPOINTS": 12 - }, - "merge_rank": 18, - "prompt_build": 0, - "llm_call": 4725 - }, - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 797, - "evidence_rows": 12, - "evidence_chars": 7130 - }, - "evidence_summary": [ - { - "layer": "C1_SYMBOL_CATALOG", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "count": 6, - "unique_paths": 2 - }, - { - "layer": "C3_ENTRYPOINTS", - "count": 3, - "unique_paths": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 1, - "unique_paths": 1 - } - ], - "prompt_template_id": "intent_code_qa_explain_ru_v1", - "system_prompt_version": "v1" - }, - "router": { - "conversation_mode": "START", - "keyword_hints": [ - "RuntimeManager" - ], - "path_scope": [] - }, - "llm": { - "used_evidence_count": 12, - "missing_evidence_reason": null - } - }, - "run_info": { - "case_id": "plba-fullchain-explain-runtime-manager", - "mode": "full_chain", - "run_started_at": "2026-03-12T11:52:23", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - }, - "input_request": { - "text": "Объясни как работает класс RuntimeManager", - "normalized_query": "Объясни как работает класс RuntimeManager" - }, - "steps": [ - { - "step": "intent_router", - "input": { - "query": "Объясни как работает класс RuntimeManager" - }, - "output": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Объясни как работает класс RuntimeManager" - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "RuntimeManager" - ], - "keyword_hints": [ - "RuntimeManager" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "timings_ms": { - "router": 0 - } - } - }, - { - "step": "retrieval", - "input": { - "query": "Объясни как работает класс RuntimeManager" - }, - "output": { - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "RuntimeManager", - "alternatives": [ - "RuntimeManager" - ], - "confidence": 0.99 - }, - "rag_count": 12, - "rag_rows": [ - { - "path": "src/app_runtime/core/runtime.py", - "content": "class RuntimeManager\nRuntimeManager", - "layer": "C1_SYMBOL_CATALOG", - "title": "RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "7e4a9381328c5803bbc6179458612fc4e947d928aa7bf8b4b2bebb2c8592f758", - "qname": "RuntimeManager", - "kind": "class", - "signature": "RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.core.runtime", - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests manager\n- orchestrates role-like calls (4)\n- reads and writes state attributes\n- participates in dataflow slices (50)", - "layer": "C4_SEMANTIC_ROLES", - "title": "RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 43, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "7e4a9381328c5803bbc6179458612fc4e947d928aa7bf8b4b2bebb2c8592f758", - "symbol_name": "RuntimeManager", - "qname": "RuntimeManager", - "role": "pipeline_stage", - "confidence": 0.67, - "dataflow_participation": 50, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.stop", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 25, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d", - "dst_ref": "ControlPlaneService.stop", - "resolution": "resolved", - "slice_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.stop" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._stop_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 51, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a", - "dst_ref": "ControlPlaneService._stop_async", - "resolution": "resolved", - "slice_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._stop_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.register_channel", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 17, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957", - "dst_ref": "ControlPlaneService.register_channel", - "resolution": "resolved", - "slice_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.register_channel" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.start", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 20, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154", - "dst_ref": "ControlPlaneService.start", - "resolution": "resolved", - "slice_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.start" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._start_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 47, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517", - "dst_ref": "ControlPlaneService._start_async", - "resolution": "resolved", - "slice_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._start_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager.add_config_file", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 32, - "span_end": 52, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "a23b8a11ebdb12708b60c96ea12a69f7f042082f1adfddd572444e246d81d167", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "57ffbd4f0d9fdf3507c2b8624312ce211f3d02fdf86a57a8ec90778d8a7b498d", - "dst_ref": "RuntimeManager.add_config_file", - "resolution": "resolved", - "slice_id": "a23b8a11ebdb12708b60c96ea12a69f7f042082f1adfddd572444e246d81d167", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager.add_config_file" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "57ffbd4f0d9fdf3507c2b8624312ce211f3d02fdf86a57a8ec90778d8a7b498d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "class RuntimeManager:\n ACTION_TIMEOUT_SECONDS = 10.0\n ACTION_POLL_INTERVAL_SECONDS = 0.05\n\n def __init__(\n self,\n configuration: ConfigurationManager | None = None,\n services: ServiceContainer | None = None,\n traces: TraceService | None = None,\n health: HealthRegistry | None = None,\n logs: LogManager | None = None,\n workers: WorkerSupervisor | None = None,\n control_plane: ControlPlaneService | None = None,\n ) -> None:\n self.configuration = configuration or ConfigurationManager()\n self.services = services or ServiceContainer()\n self.traces = traces or TraceService()\n self.health = health or HealthRegistry()\n self.logs = logs or LogManager()\n self.workers = workers or WorkerSupervisor()\n self.control_plane = control_plane or ControlPlaneService()\n self.registry = ModuleRegistry(self.services)\n self._started = False\n self._state = LifecycleState.IDLE\n self._core_registered = False\n self._workers_registered = False\n self._register_core_services()\n\n def register_module(self, module: ApplicationModule) -> None:\n self.registry.register_module(module.name)\n module.register(self.registry)\n\n def add_config_file(self, path: str) -> FileConfigProvider:\n provider = FileConfigProvider(path)\n self.configuration.add_provider(provider)\n return provider\n\n def start(self, *, start_control_plane: bool = True) -> None:\n if self._started:\n return\n self._state = LifecycleState.STARTING\n config = self.configuration.load()\n self.logs.apply_config(config)\n self._register_health_contributors()\n self._register_workers()\n self.workers.start()\n if start_control_plane:\n self.control_plane.start(self)\n self._started = True\n self._refresh_state()\n\n def stop(self, timeout: float = 30.0, force: bool = False, stop_control_plane: bool = True) -> None:\n if not self._started:\n return\n self._state = LifecycleState.STOPPING\n self.workers.stop(timeout=timeout, force=force)\n if stop_control_plane:\n self.control_plane.stop()\n self._started = False\n self._state = LifecycleState.STOPPED\n\n def status(self) -> dict[str, object]:\n self._refresh_state()\n return self.control_plane.snapshot(self)\n\n def current_health(self) -> HealthPayload:\n self._refresh_state()\n return self.health.payload(self._state, self.workers.healths())\n\n async def health_status(self) -> HealthPayload:\n return self.current_health()\n\n async def start_runtime(self) -> dict[str, object] | str:\n self._refresh_state()\n if self._started:\n return \"runtime already running\"\n if self._state == LifecycleState.STOPPING:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n\n self.start(start_control_plane=False)\n started = self._wait_for_state({LifecycleState.IDLE, LifecycleState.BUSY}, timeout=self.ACTION_TIMEOUT_SECONDS)\n if started:\n return self._action_detail(\"runtime started\", timed_out=False)\n return self._action_detail(\"runtime start is still in progress\", timed_out=True)\n\n async def stop_runtime(self) -> dict[str, object] | str:\n self._refresh_state()\n if not self._started:\n if self._state == LifecycleState.STOPPING:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n return \"runtime already stopped\"\n\n self._state = LifecycleState.STOPPING\n try:\n self.workers.stop(timeout=self.ACTION_TIMEOUT_SECONDS, force=False)\n except TimeoutError:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n\n self._started = False\n self._state = LifecycleState.STOPPED\n return self._action_detail(\"runtime stopped\", timed_out=False)\n\n async def runtime_status(self) -> str:\n self._refresh_state()\n return self._state.value\n\n def _register_core_services(self) -> None:\n if self._core_registered:\n return\n self.services.register(\"configuration\", self.configuration)\n self.services.register(\"traces\", self.traces)\n self.services.register(\"health\", self.health)\n self.services.register(\"logs\", self.logs)\n self.services.register(\"workers\", self.workers)\n self.services.register(\"control_plane\", self.control_plane)\n self._core_registered = True\n\n def _register_health_contributors(self) -> None:\n for contributor in self.registry.health_contributors:\n self.health.register(contributor)\n\n def _register_workers(self) -> None:\n if self._workers_registered:\n return\n for worker in self.registry.workers:\n self.workers.register(worker)\n self._workers_registered = True\n\n def _refresh_state(self) -> None:\n lifecycle = self.workers.lifecycle_state()\n\n if self._state == LifecycleState.STOPPING:\n if lifecycle == LifecycleState.STOPPED:\n self._started = False\n self._state = LifecycleState.STOPPED\n return\n\n if not self._started:\n if lifecycle == LifecycleState.STOPPED:\n self._state = LifecycleState.STOPPED\n return\n\n self._state = lifecycle\n\n def _wait_for_state(self, target_states: set[LifecycleState], *, timeout: float) -> bool:\n deadline = monotonic() + timeout\n while monotonic() < deadline:\n self._refresh_state()\n if self._state in target_states:\n return True\n sleep(self.ACTION_POLL_INTERVAL_SECONDS)\n self._refresh_state()\n return self._state in target_states\n\n def _action_detail(self, message: str, *, timed_out: bool) -> dict[str, object]:\n self._refresh_state()\n return {\n \"message\": message,\n \"state\": self._state.value,\n \"timed_out\": timed_out,\n \"workers\": self.workers.snapshot(),\n }", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/core/runtime.py:RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.core.runtime", - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ] - }, - "diagnostics": { - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C0_SOURCE_CHUNKS": "exact_path_fetch", - "C4_SEMANTIC_ROLES": "exact_path_fetch", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C3_ENTRYPOINTS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 8, - "C4_SEMANTIC_ROLES": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C3_ENTRYPOINTS": 6 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C4_SEMANTIC_ROLES": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C4_SEMANTIC_ROLES", - "query": "RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - }, - { - "layer": "C3_ENTRYPOINTS", - "query": "RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 1, - "candidates_after_filter": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 6, - "candidates_after_filter": 6 - }, - { - "layer": "C3_ENTRYPOINTS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 3, - "candidates_after_filter": 3 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "RuntimeManager", - "alternatives": [ - "RuntimeManager" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C4_SEMANTIC_ROLES", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 6, - "fail_reason": null - }, - { - "layer": "C3_ENTRYPOINTS", - "status": "hit", - "hit_count": 3, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "symbol_resolution": 0, - "retrieval_total": 322, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 30, - "C0_SOURCE_CHUNKS": 17, - "C4_SEMANTIC_ROLES": 14, - "C2_DEPENDENCY_GRAPH": 58, - "C3_ENTRYPOINTS": 12 - }, - "merge_rank": 18 - } - } - }, - { - "step": "llm_answer", - "input": { - "query": "Объясни как работает класс RuntimeManager", - "rag_count": 12 - }, - "output": { - "llm_answer": "## Назначение класса `RuntimeManager`\nКласс `RuntimeManager` играет роль менеджера, отвечающего за управление жизненным циклом различных компонентов приложения, таких как конфигурация (`ConfigurationManager`), сервисы (`ServiceContainer`), трассировка событий (`TraceService`), здоровье системы (`HealthRegistry`), логирование (`LogManager`) и мониторинг работы рабочих процессов (`WorkerSupervisor`). Он координирует взаимодействие этих компонентов и управляет их состоянием через методы регистрации, инициализации и мониторинга.\n\n## Ключевые зависимости\nКлючевыми зависимостями являются следующие классы и сущности:\n- `ConfigurationManager`: отвечает за хранение и доступ к конфигурации приложения.\n- `ServiceContainer`: контейнер для хранения и управления сервисами приложения.\n- `TraceService`: предоставляет возможность отслеживать события выполнения и состояния системы.\n- `HealthRegistry`: регистрирует и отслеживает состояние здоровья различных сервисов и модулей.\n- `LogManager`: обрабатывает и записывает логи операций и событий.\n- `WorkerSupervisor`: мониторит рабочие процессы и выполняет необходимые действия по управлению ими.\n- `ControlPlaneService`: центральный сервис управления системой, с которым взаимодействует `RuntimeManager`.\n\n## Поток данных или вызовов\nПри создании экземпляра класса `RuntimeManager`, он принимает несколько необязательных аргументов, представляющих вышеуказанные компоненты. После создания экземпляра, вызывается метод `_register_core_services()`, который осуществляет регистрацию базовых служб и сервисов, необходимых для нормального функционирования системы.\n\nВызовы и зависимости внутри класса организуются следующим образом:\n- При каждом обращении к `RuntimeManager.register_module(module)` происходит регистрация нового модуля или сервиса в системе, что позволяет приложению динамически расширять свою функциональность.\n- Методы, такие как `self.control_plane.start()` и `self.control_plane.stop()`, используются для старта и остановки системы соответственно.\n- Метод `self._register_core_services()` предназначен для начальной регистрации основных сервисов и компонент, используемых в приложении.\n\n## Важные детали реализации\n### Конструктор класса\nКонструктор класса получает набор опциональных параметров, каждый из которых представляет собой отдельный компонент или службу. Если соответствующий параметр отсутствует, используется значение по умолчанию соответствующего типа (например, `ConfigurationManager()`).\n\n### Методы управления жизненным циклом\nМетоды `start()` и `stop()` обеспечивают старт и остановку всей системы соответственно. Эти методы зависят от метода `ControlPlaneService._stop_async()`, который запускается при завершении работы системы.\n\n### Реализация функциональности управления состоянием\nРеализована переменная `_state`, которая отражает текущее состояние системы (`LifecycleState.IDLE`, `LifecycleState.RUNNING`, etc.). Этот атрибут используется для контроля над тем, какие операции могут быть выполнены в текущий момент времени.\n\n### Дополнительная логика\nКроме основной функциональности, реализованы механизмы регистрации модулей и проверки состояний, которые позволяют приложению поддерживать гибкость и масштабируемость.\n\n---\n\n**Ограничения и осторожные выводы**\nНа основе предоставленного контекста невозможно полностью раскрыть детали внутренней реализации методов и функционала классов, упомянутых во внешних зависимостях (таких как `ControlPlaneService`, `WorkerSupervisor`, `TraceService` и т.д.), так как информация о них отсутствует напрямую. Следовательно, приведенные выше описания основаны преимущественно на сигнатурах функций и доступных косвенных признаках." - }, - "diagnostics": { - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 797, - "evidence_rows": 12, - "evidence_chars": 7130 - }, - "evidence_summary": [ - { - "layer": "C1_SYMBOL_CATALOG", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "count": 6, - "unique_paths": 2 - }, - { - "layer": "C3_ENTRYPOINTS", - "count": 3, - "unique_paths": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 1, - "unique_paths": 1 - } - ], - "prompt_template_id": "intent_code_qa_explain_ru_v1", - "system_prompt_version": "v1" - }, - "timings_ms": { - "prompt_build": 0, - "llm_call": 4725 - } - } - } - ] - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_115223/full_chain_plba_code_retrieval_plba-fullchain-explain-runtime-manager.md b/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_115223/full_chain_plba_code_retrieval_plba-fullchain-explain-runtime-manager.md deleted file mode 100644 index 292cc5b..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_115223/full_chain_plba_code_retrieval_plba-fullchain-explain-runtime-manager.md +++ /dev/null @@ -1,34 +0,0 @@ -# plba-fullchain-explain-runtime-manager - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_retrieval.yaml -- runner: runtime -- mode: full_chain -- passed: True - -## Query -Объясни как работает класс RuntimeManager - -## Actual -{ - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 12, - "llm_answer": "## Назначение класса `RuntimeManager`\nКласс `RuntimeManager` играет роль менеджера, отвечающего за управление жизненным циклом различных компонентов приложения, таких как конфигурация (`ConfigurationManager`), сервисы (`ServiceContainer`), трассировка событий (`TraceService`), здоровье системы (`HealthRegistry`), логирование (`LogManager`) и мониторинг работы рабочих процессов (`WorkerSupervisor`). Он координирует взаимодействие этих компонентов и управляет их состоянием через методы регистрации, инициализации и мониторинга.\n\n## Ключевые зависимости\nКлючевыми зависимостями являются следующие классы и сущности:\n- `ConfigurationManager`: отвечает за хранение и доступ к конфигурации приложения.\n- `ServiceContainer`: контейнер для хранения и управления сервисами приложения.\n- `TraceService`: предоставляет возможность отслеживать события выполнения и состояния системы.\n- `HealthRegistry`: регистрирует и отслеживает состояние здоровья различных сервисов и модулей.\n- `LogManager`: обрабатывает и записывает логи операций и событий.\n- `WorkerSupervisor`: мониторит рабочие процессы и выполняет необходимые действия по управлению ими.\n- `ControlPlaneService`: центральный сервис управления системой, с которым взаимодействует `RuntimeManager`.\n\n## Поток данных или вызовов\nПри создании экземпляра класса `RuntimeManager`, он принимает несколько необязательных аргументов, представляющих вышеуказанные компоненты. После создания экземпляра, вызывается метод `_register_core_services()`, который осуществляет регистрацию базовых служб и сервисов, необходимых для нормального функционирования системы.\n\nВызовы и зависимости внутри класса организуются следующим образом:\n- При каждом обращении к `RuntimeManager.register_module(module)` происходит регистрация нового модуля или сервиса в системе, что позволяет приложению динамически расширять свою функциональность.\n- Методы, такие как `self.control_plane.start()` и `self.control_plane.stop()`, используются для старта и остановки системы соответственно.\n- Метод `self._register_core_services()` предназначен для начальной регистрации основных сервисов и компонент, используемых в приложении.\n\n## Важные детали реализации\n### Конструктор класса\nКонструктор класса получает набор опциональных параметров, каждый из которых представляет собой отдельный компонент или службу. Если соответствующий параметр отсутствует, используется значение по умолчанию соответствующего типа (например, `ConfigurationManager()`).\n\n### Методы управления жизненным циклом\nМетоды `start()` и `stop()` обеспечивают старт и остановку всей системы соответственно. Эти методы зависят от метода `ControlPlaneService._stop_async()`, который запускается при завершении работы системы.\n\n### Реализация функциональности управления состоянием\nРеализована переменная `_state`, которая отражает текущее состояние системы (`LifecycleState.IDLE`, `LifecycleState.RUNNING`, etc.). Этот атрибут используется для контроля над тем, какие операции могут быть выполнены в текущий момент времени.\n\n### Дополнительная логика\nКроме основной функциональности, реализованы механизмы регистрации модулей и проверки состояний, которые позволяют приложению поддерживать гибкость и масштабируемость.\n\n---\n\n**Ограничения и осторожные выводы**\nНа основе предоставленного контекста невозможно полностью раскрыть детали внутренней реализации методов и функционала классов, упомянутых во внешних зависимостях (таких как `ControlPlaneService`, `WorkerSupervisor`, `TraceService` и т.д.), так как информация о них отсутствует напрямую. Следовательно, приведенные выше описания основаны преимущественно на сигнатурах функций и доступных косвенных признаках.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "RuntimeManager" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] -} - -## Mismatches -- none \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_115223/full_chain_plba_code_retrieval_plba-fullchain-explain-trace-service.json b/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_115223/full_chain_plba_code_retrieval_plba-fullchain-explain-trace-service.json deleted file mode 100644 index acf0a43..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_115223/full_chain_plba_code_retrieval_plba-fullchain-explain-trace-service.json +++ /dev/null @@ -1,2208 +0,0 @@ -{ - "case_id": "plba-fullchain-explain-trace-service", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_retrieval.yaml", - "runner": "runtime", - "mode": "full_chain", - "actual": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 14, - "llm_answer": "## Объяснение работы `TraceService`\n\n### Назначение\n`TraceService` — это сервис для управления контекстом трассировки и записи событий трассировки. Он отвечает за создание контекста трассировки, запись сообщений и управление хранилищем трассировок.\n\n### Ключевые зависимости\n- **TraceContextFactory**: Базовый класс для создания экземпляров, связанных с контекстом трассировки.\n- **TraceTransport**: Интерфейс для передачи трассировочных данных наружу системы.\n- **TraceContextStore**: Хранилище для отслеживания состояний трассировки.\n- **NoOpTraceTransport**: Транспорт по умолчанию, используемый при отсутствии активного транспорта.\n\n### Поток данных или вызовов\n1. **Инициализация (`__init__`)** \n - При создании экземпляра сервиса инициализируются транспорт и хранилище трассировок. Если транспорт или хранилище не предоставлены явно, используются предопределенные значения.\n \n2. **Создание контекста трассировки (`create_context`)** \n - Создаёт новый объект трассировки (`TraceContextRecord`), записывает его в хранилище и отправляет через транспорт.\n - Возвращает идентификатор созданной трассировки.\n\n3. **Вход в контекст трассировки (`open_context`)** \n - Вызывает метод `create_context`, возвращая созданный идентификатор трассировки.\n\n4. **Запись сообщения трассировки (`write_message`)** \n - Записывает сообщение трассировки в транспорт.\n\n5. **Запись контекста трассировки (`write_context`)** \n - Обеспечивает запись контекста трассировки в транспорт.\n\n### Важные детали реализации\n- **Хранение контекста трассировки:** Контекст сохраняется локально в хранилище до тех пор, пока он активно используется. После завершения работы с ним контекст удаляется автоматически.\n- **Отсутствие ошибок транспортировки:** В случае ошибки при передаче трассировочного сообщения фиксируется ошибка и сообщение логируется.\n- **Использование UUID для идентификации трассировки:** Каждый запрос генерирует уникальный идентификатор (`trace_id`), что позволяет отслеживать цепочки запросов и их зависимости.\n\n### Косвенные признаки (осторожный вывод)\n- На основании связей вызова и структуры файла можно предположить, что `TraceService` играет роль в управлении и журналировании процессов внутри приложения, обеспечивая централизованное ведение журнала событий и состояния трассировки.\n\n---\n\nТаким образом, основная задача `TraceService` заключается в обеспечении функциональности трассировки и сохранения информации о каждом этапе выполнения запроса, предоставляя механизмы для сбора и хранения этих данных.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "TraceService" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "passed": true, - "mismatches": [], - "details": { - "case_id": "plba-fullchain-explain-trace-service", - "text": "Как работает TraceService?", - "mode": "full_chain", - "run_started_at": "2026-03-12T11:52:23", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Как работает TraceService?", - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "TraceService", - "alternatives": [ - "TraceService" - ], - "confidence": 0.99 - }, - "rag_count": 14, - "rag_rows": [ - { - "path": "src/app_runtime/tracing/service.py", - "content": "class TraceService\nTraceService(TraceContextFactory)", - "layer": "C1_SYMBOL_CATALOG", - "title": "TraceService", - "span_start": 39, - "span_end": 166, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "c2b2b976d99f2c600000b753731b26e0a69adcb4359398b93073590c5d5d04f4", - "qname": "TraceService", - "kind": "class", - "signature": "TraceService(TraceContextFactory)", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.tracing.service", - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "TraceService\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests service\n- reads and writes state attributes\n- participates in dataflow slices (13)", - "layer": "C4_SEMANTIC_ROLES", - "title": "TraceService", - "span_start": 39, - "span_end": 166, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 60, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "c2b2b976d99f2c600000b753731b26e0a69adcb4359398b93073590c5d5d04f4", - "symbol_name": "TraceService", - "qname": "TraceService", - "role": "pipeline_stage", - "confidence": 0.57, - "dataflow_participation": 13, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "TraceService.__init__\n -> TraceService.store\n -> TraceService.create_context", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "TraceService.__init__:dataflow_slice", - "span_start": 42, - "span_end": 61, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "3b052062067a78aef3302ee1d996897e02a67d1b340397bea4f59fe147c0492a", - "edge_type": "dataflow_slice", - "src_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "src_qname": "TraceService.__init__", - "dst_symbol_id": "ff44881104b65ef50ee6fe16d367d4a81b6e7eb5c44c0963cf4543faec785d4a", - "dst_ref": "TraceService.create_context", - "resolution": "resolved", - "slice_id": "3b052062067a78aef3302ee1d996897e02a67d1b340397bea4f59fe147c0492a", - "root_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "path_symbols": [ - "TraceService.__init__", - "TraceService.store", - "TraceService.create_context" - ], - "path_symbol_ids": [ - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "ff44881104b65ef50ee6fe16d367d4a81b6e7eb5c44c0963cf4543faec785d4a" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "TraceService.__init__\n -> TraceService.store\n -> TraceService.close_context", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "TraceService.__init__:dataflow_slice", - "span_start": 42, - "span_end": 84, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "7a9353ef57c9ae5d19b3a0c6ac50fad05e6d21d31bbe1cd1cd07af6332ba6505", - "edge_type": "dataflow_slice", - "src_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "src_qname": "TraceService.__init__", - "dst_symbol_id": "01e14158dcced7e52d0c8ac84ac7b9a75225c261b6aca6a1d7da802d0994721c", - "dst_ref": "TraceService.close_context", - "resolution": "resolved", - "slice_id": "7a9353ef57c9ae5d19b3a0c6ac50fad05e6d21d31bbe1cd1cd07af6332ba6505", - "root_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "path_symbols": [ - "TraceService.__init__", - "TraceService.store", - "TraceService.close_context" - ], - "path_symbol_ids": [ - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "01e14158dcced7e52d0c8ac84ac7b9a75225c261b6aca6a1d7da802d0994721c" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "TraceService.__init__\n -> TraceService.store\n -> TraceService.open_context", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "TraceService.__init__:dataflow_slice", - "span_start": 42, - "span_end": 78, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "a6e13b9ebc4fed84586afd53ed92a4d14757e440873f572b2337d5622ee96031", - "edge_type": "dataflow_slice", - "src_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "src_qname": "TraceService.__init__", - "dst_symbol_id": "2da3d5b20a947bf63e14c103be4689b72fd837e0a82abd6c497846375d4c7426", - "dst_ref": "TraceService.open_context", - "resolution": "resolved", - "slice_id": "a6e13b9ebc4fed84586afd53ed92a4d14757e440873f572b2337d5622ee96031", - "root_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "path_symbols": [ - "TraceService.__init__", - "TraceService.store", - "TraceService.open_context" - ], - "path_symbol_ids": [ - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "2da3d5b20a947bf63e14c103be4689b72fd837e0a82abd6c497846375d4c7426" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "TraceService.__init__\n -> TraceService.transport\n -> TraceService.__init__", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "TraceService.__init__:dataflow_slice", - "span_start": 41, - "span_end": 43, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "1e923a93faa05c3c43ca9b19bd047007a8589ccce57d3cc1798ae7f9f200af98", - "edge_type": "dataflow_slice", - "src_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "src_qname": "TraceService.__init__", - "dst_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "dst_ref": "TraceService.__init__", - "resolution": "resolved", - "slice_id": "1e923a93faa05c3c43ca9b19bd047007a8589ccce57d3cc1798ae7f9f200af98", - "root_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "path_symbols": [ - "TraceService.__init__", - "TraceService.transport", - "TraceService.__init__" - ], - "path_symbol_ids": [ - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "TraceService.__init__\n -> TraceService.store\n -> TraceService.current_trace_id", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "TraceService.__init__:dataflow_slice", - "span_start": 42, - "span_end": 81, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "3ea17138634b1190bded77ddb84aa1595124f6519b246f24fc4b02bd62b5cac1", - "edge_type": "dataflow_slice", - "src_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "src_qname": "TraceService.__init__", - "dst_symbol_id": "41135180f7b3b9ab20e097e0747474e219c37dd2366ef08a7b43c1f3edb10b4c", - "dst_ref": "TraceService.current_trace_id", - "resolution": "resolved", - "slice_id": "3ea17138634b1190bded77ddb84aa1595124f6519b246f24fc4b02bd62b5cac1", - "root_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "path_symbols": [ - "TraceService.__init__", - "TraceService.store", - "TraceService.current_trace_id" - ], - "path_symbol_ids": [ - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "41135180f7b3b9ab20e097e0747474e219c37dd2366ef08a7b43c1f3edb10b4c" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "TraceService.__init__\n -> TraceService.store\n -> TraceService.step", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "TraceService.__init__:dataflow_slice", - "span_start": 42, - "span_end": 88, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "9f34c5da9b09fba99df6f6b1bde183a9aeb45111b8218a747c71590c2c9f60f2", - "edge_type": "dataflow_slice", - "src_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "src_qname": "TraceService.__init__", - "dst_symbol_id": "c44bfbc66cf747283f30088da3e011a10395031d41e77b74e523c24997f641ca", - "dst_ref": "TraceService.step", - "resolution": "resolved", - "slice_id": "9f34c5da9b09fba99df6f6b1bde183a9aeb45111b8218a747c71590c2c9f60f2", - "root_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "path_symbols": [ - "TraceService.__init__", - "TraceService.store", - "TraceService.step" - ], - "path_symbol_ids": [ - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "c44bfbc66cf747283f30088da3e011a10395031d41e77b74e523c24997f641ca" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "class TraceRecordWriter:\n def __init__(self, transport: TraceTransport) -> None:\n self._logger = logging.getLogger(__name__)\n self._transport = transport\n\n def write_context(self, record: TraceContextRecord) -> None:\n try:\n self._transport.write_context(record)\n except Exception:\n self._logger.exception(\"Trace transport failed to write context %s\", record.trace_id)\n\n def write_message(self, record: TraceLogMessage) -> None:\n try:\n self._transport.write_message(record)\n except Exception:\n self._logger.exception(\"Trace transport failed to write message for %s\", record.trace_id)", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/tracing/service.py:TraceRecordWriter", - "span_start": 21, - "span_end": 36, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.tracing.service", - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "class TraceService(TraceContextFactory):\n def __init__(self, transport: TraceTransport | None = None, store: TraceContextStore | None = None) -> None:\n self.transport = transport or NoOpTraceTransport()\n self.store = store or TraceContextStore()\n self._writer = TraceRecordWriter(self.transport)\n\n def create_context(\n self,\n *,\n alias: str,\n parent_id: str | None = None,\n kind: str | None = None,\n attrs: dict[str, Any] | None = None,\n ) -> str:\n record = TraceContextRecord(\n trace_id=uuid4().hex,\n alias=str(alias or \"\"),\n parent_id=parent_id,\n type=kind,\n event_time=utc_now(),\n attrs=dict(attrs or {}),\n )\n self.store.push(record)\n self._writer.write_context(record)\n return record.trace_id\n\n @contextmanager\n def open_context(\n self,\n *,\n alias: str,\n parent_id: str | None = None,\n kind: str | None = None,\n attrs: dict[str, Any] | None = None,\n ) -> Iterator[str]:\n trace_id = self.create_context(alias=alias, parent_id=parent_id, kind=kind, attrs=attrs)\n try:\n yield trace_id\n finally:\n self.store.pop()\n\n def current_trace_id(self) -> str | None:\n return self.store.current_trace_id()\n\n def close_context(self) -> str | None:\n previous = self.store.pop()\n return previous.record.trace_id if previous else None\n\n def step(self, name: str) -> None:\n self.store.set_step(str(name or \"\"))\n\n def info(self, message: str, *, status: str | None = None, attrs: dict[str, Any] | None = None) -> None:\n self._write_message(\"INFO\", message, status, attrs)\n\n def debug(self, message: str, *, status: str | None = None, attrs: dict[str, Any] | None = None) -> None:\n self._write_message(\"DEBUG\", message, status, attrs)\n\n def warning(self, message: str, *, status: str | None = None, attrs: dict[str, Any] | None = None) -> None:\n self._write_message(\"WARNING\", message, status, attrs)\n\n def error(self, message: str, *, status: str | None = None, attrs: dict[str, Any] | None = None) -> None:\n self._write_message(\"ERROR\", message, status, attrs)\n\n def exception(self, message: str, *, status: str = \"failed\", attrs: dict[str, Any] | None = None) -> None:\n self._write_message(\"ERROR\", message, status, attrs)\n\n def new_root(self, operation: str) -> TraceContext:\n trace_id = self.create_context(alias=operation, kind=\"operation\", attrs={\"operation\": operation})\n return TraceContext(trace_id=trace_id, span_id=trace_id, attributes={\"operation\": operation})\n\n def child_of(self, parent: TraceContext, operation: str) -> TraceContext:\n trace_id = self.create_context(\n alias=operation,\n parent_id=parent.trace_id,\n kind=\"worker\",\n attrs={\"operation\": operation},\n )\n return TraceContext(\n trace_id=trace_id,\n span_id=trace_id,\n parent_span_id=parent.span_id,\n attributes={\"operation\": operation},\n )\n\n def attach(self, metadata: dict[str, object], context: TraceContext) -> dict[str, object]:\n updated = dict(metadata)\n updated[\"trace_id\"] = context.trace_id\n updated[\"span_id\"] = context.span_id\n updated[\"parent_span_id\"] = context.parent_span_id\n return updated\n\n def resume(self, metadata: dict[str, object], operation: str) -> TraceContext:\n trace_id = str(metadata.get(\"trace_id\") or uuid4().hex)\n span_id = str(metadata.get(\"span_id\") or trace_id)\n parent_id = metadata.get(\"parent_span_id\")\n self.create_context(\n alias=operation,\n parent_id=str(parent_id) if parent_id else None,\n kind=\"worker\",\n attrs=dict(metadata),\n )\n return TraceContext(\n trace_id=trace_id,\n span_id=span_id,\n parent_span_id=str(parent_id) if parent_id else None,\n attributes={\"operation\": operation},\n )\n\n def _write_message(\n self,\n level: TraceLevel,\n message: str,\n status: str | None,\n attrs: dict[str, Any] | None,\n ) -> None:\n active = self.store.current()\n if active is None:\n raise RuntimeError(\"Trace context is not bound. Call create_context() first.\")\n record = TraceLogMessage(\n trace_id=active.record.trace_id,\n step=active.step,\n status=str(status or \"\"),\n message=str(message or \"\"),\n level=level,\n event_time=utc_now(),\n attrs=dict(attrs or {}),\n )\n self._writer.write_message(record)", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/tracing/service.py:TraceService", - "span_start": 39, - "span_end": 166, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 1, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.tracing.service", - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "class TraceManager(TraceService):\n \"\"\"Compatibility alias during the transition from ConfigManager-shaped naming.\"\"\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/tracing/service.py:TraceManager", - "span_start": 169, - "span_end": 170, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 2, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.tracing.service", - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "llm_answer": "## Объяснение работы `TraceService`\n\n### Назначение\n`TraceService` — это сервис для управления контекстом трассировки и записи событий трассировки. Он отвечает за создание контекста трассировки, запись сообщений и управление хранилищем трассировок.\n\n### Ключевые зависимости\n- **TraceContextFactory**: Базовый класс для создания экземпляров, связанных с контекстом трассировки.\n- **TraceTransport**: Интерфейс для передачи трассировочных данных наружу системы.\n- **TraceContextStore**: Хранилище для отслеживания состояний трассировки.\n- **NoOpTraceTransport**: Транспорт по умолчанию, используемый при отсутствии активного транспорта.\n\n### Поток данных или вызовов\n1. **Инициализация (`__init__`)** \n - При создании экземпляра сервиса инициализируются транспорт и хранилище трассировок. Если транспорт или хранилище не предоставлены явно, используются предопределенные значения.\n \n2. **Создание контекста трассировки (`create_context`)** \n - Создаёт новый объект трассировки (`TraceContextRecord`), записывает его в хранилище и отправляет через транспорт.\n - Возвращает идентификатор созданной трассировки.\n\n3. **Вход в контекст трассировки (`open_context`)** \n - Вызывает метод `create_context`, возвращая созданный идентификатор трассировки.\n\n4. **Запись сообщения трассировки (`write_message`)** \n - Записывает сообщение трассировки в транспорт.\n\n5. **Запись контекста трассировки (`write_context`)** \n - Обеспечивает запись контекста трассировки в транспорт.\n\n### Важные детали реализации\n- **Хранение контекста трассировки:** Контекст сохраняется локально в хранилище до тех пор, пока он активно используется. После завершения работы с ним контекст удаляется автоматически.\n- **Отсутствие ошибок транспортировки:** В случае ошибки при передаче трассировочного сообщения фиксируется ошибка и сообщение логируется.\n- **Использование UUID для идентификации трассировки:** Каждый запрос генерирует уникальный идентификатор (`trace_id`), что позволяет отслеживать цепочки запросов и их зависимости.\n\n### Косвенные признаки (осторожный вывод)\n- На основании связей вызова и структуры файла можно предположить, что `TraceService` играет роль в управлении и журналировании процессов внутри приложения, обеспечивая централизованное ведение журнала событий и состояния трассировки.\n\n---\n\nТаким образом, основная задача `TraceService` заключается в обеспечении функциональности трассировки и сохранения информации о каждом этапе выполнения запроса, предоставляя механизмы для сбора и хранения этих данных.", - "summary": { - "router": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "confidence": null - }, - "retrieval": { - "profile": "code", - "layers_hit": [ - "C0_SOURCE_CHUNKS", - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS", - "C4_SEMANTIC_ROLES" - ], - "evidence_sufficient": true - }, - "llm": { - "answer_status": "answered", - "groundedness": "grounded" - } - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "TraceService" - ], - "keyword_hints": [ - "TraceService" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C0_SOURCE_CHUNKS": "exact_path_fetch", - "C4_SEMANTIC_ROLES": "exact_path_fetch", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C3_ENTRYPOINTS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 8, - "C4_SEMANTIC_ROLES": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C3_ENTRYPOINTS": 6 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C4_SEMANTIC_ROLES": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "TraceService", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "TraceService", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C4_SEMANTIC_ROLES", - "query": "TraceService", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "TraceService", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - }, - { - "layer": "C3_ENTRYPOINTS", - "query": "TraceService", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 1, - "candidates_after_filter": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 6, - "candidates_after_filter": 6 - }, - { - "layer": "C3_ENTRYPOINTS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 3, - "candidates_after_filter": 3 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "TraceService", - "alternatives": [ - "TraceService" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 3, - "fail_reason": null - }, - { - "layer": "C4_SEMANTIC_ROLES", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 6, - "fail_reason": null - }, - { - "layer": "C3_ENTRYPOINTS", - "status": "hit", - "hit_count": 3, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "router": 0, - "symbol_resolution": 0, - "retrieval_total": 140, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 46, - "C0_SOURCE_CHUNKS": 19, - "C4_SEMANTIC_ROLES": 18, - "C2_DEPENDENCY_GRAPH": 46, - "C3_ENTRYPOINTS": 9 - }, - "merge_rank": 20, - "prompt_build": 0, - "llm_call": 3676 - }, - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 931, - "evidence_rows": 14, - "evidence_chars": 6323 - }, - "evidence_summary": [ - { - "layer": "C1_SYMBOL_CATALOG", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "count": 6, - "unique_paths": 1 - }, - { - "layer": "C3_ENTRYPOINTS", - "count": 3, - "unique_paths": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 3, - "unique_paths": 1 - } - ], - "prompt_template_id": "intent_code_qa_explain_ru_v1", - "system_prompt_version": "v1" - }, - "router": { - "conversation_mode": "START", - "keyword_hints": [ - "TraceService" - ], - "path_scope": [] - }, - "llm": { - "used_evidence_count": 14, - "missing_evidence_reason": null - } - }, - "run_info": { - "case_id": "plba-fullchain-explain-trace-service", - "mode": "full_chain", - "run_started_at": "2026-03-12T11:52:23", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - }, - "input_request": { - "text": "Как работает TraceService?", - "normalized_query": "Как работает TraceService?" - }, - "steps": [ - { - "step": "intent_router", - "input": { - "query": "Как работает TraceService?" - }, - "output": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Как работает TraceService?" - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "TraceService" - ], - "keyword_hints": [ - "TraceService" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "timings_ms": { - "router": 0 - } - } - }, - { - "step": "retrieval", - "input": { - "query": "Как работает TraceService?" - }, - "output": { - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "TraceService", - "alternatives": [ - "TraceService" - ], - "confidence": 0.99 - }, - "rag_count": 14, - "rag_rows": [ - { - "path": "src/app_runtime/tracing/service.py", - "content": "class TraceService\nTraceService(TraceContextFactory)", - "layer": "C1_SYMBOL_CATALOG", - "title": "TraceService", - "span_start": 39, - "span_end": 166, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "c2b2b976d99f2c600000b753731b26e0a69adcb4359398b93073590c5d5d04f4", - "qname": "TraceService", - "kind": "class", - "signature": "TraceService(TraceContextFactory)", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.tracing.service", - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "TraceService\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests service\n- reads and writes state attributes\n- participates in dataflow slices (13)", - "layer": "C4_SEMANTIC_ROLES", - "title": "TraceService", - "span_start": 39, - "span_end": 166, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 60, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "c2b2b976d99f2c600000b753731b26e0a69adcb4359398b93073590c5d5d04f4", - "symbol_name": "TraceService", - "qname": "TraceService", - "role": "pipeline_stage", - "confidence": 0.57, - "dataflow_participation": 13, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "TraceService.__init__\n -> TraceService.store\n -> TraceService.create_context", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "TraceService.__init__:dataflow_slice", - "span_start": 42, - "span_end": 61, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "3b052062067a78aef3302ee1d996897e02a67d1b340397bea4f59fe147c0492a", - "edge_type": "dataflow_slice", - "src_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "src_qname": "TraceService.__init__", - "dst_symbol_id": "ff44881104b65ef50ee6fe16d367d4a81b6e7eb5c44c0963cf4543faec785d4a", - "dst_ref": "TraceService.create_context", - "resolution": "resolved", - "slice_id": "3b052062067a78aef3302ee1d996897e02a67d1b340397bea4f59fe147c0492a", - "root_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "path_symbols": [ - "TraceService.__init__", - "TraceService.store", - "TraceService.create_context" - ], - "path_symbol_ids": [ - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "ff44881104b65ef50ee6fe16d367d4a81b6e7eb5c44c0963cf4543faec785d4a" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "TraceService.__init__\n -> TraceService.store\n -> TraceService.close_context", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "TraceService.__init__:dataflow_slice", - "span_start": 42, - "span_end": 84, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "7a9353ef57c9ae5d19b3a0c6ac50fad05e6d21d31bbe1cd1cd07af6332ba6505", - "edge_type": "dataflow_slice", - "src_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "src_qname": "TraceService.__init__", - "dst_symbol_id": "01e14158dcced7e52d0c8ac84ac7b9a75225c261b6aca6a1d7da802d0994721c", - "dst_ref": "TraceService.close_context", - "resolution": "resolved", - "slice_id": "7a9353ef57c9ae5d19b3a0c6ac50fad05e6d21d31bbe1cd1cd07af6332ba6505", - "root_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "path_symbols": [ - "TraceService.__init__", - "TraceService.store", - "TraceService.close_context" - ], - "path_symbol_ids": [ - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "01e14158dcced7e52d0c8ac84ac7b9a75225c261b6aca6a1d7da802d0994721c" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "TraceService.__init__\n -> TraceService.store\n -> TraceService.open_context", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "TraceService.__init__:dataflow_slice", - "span_start": 42, - "span_end": 78, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "a6e13b9ebc4fed84586afd53ed92a4d14757e440873f572b2337d5622ee96031", - "edge_type": "dataflow_slice", - "src_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "src_qname": "TraceService.__init__", - "dst_symbol_id": "2da3d5b20a947bf63e14c103be4689b72fd837e0a82abd6c497846375d4c7426", - "dst_ref": "TraceService.open_context", - "resolution": "resolved", - "slice_id": "a6e13b9ebc4fed84586afd53ed92a4d14757e440873f572b2337d5622ee96031", - "root_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "path_symbols": [ - "TraceService.__init__", - "TraceService.store", - "TraceService.open_context" - ], - "path_symbol_ids": [ - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "2da3d5b20a947bf63e14c103be4689b72fd837e0a82abd6c497846375d4c7426" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "TraceService.__init__\n -> TraceService.transport\n -> TraceService.__init__", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "TraceService.__init__:dataflow_slice", - "span_start": 41, - "span_end": 43, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "1e923a93faa05c3c43ca9b19bd047007a8589ccce57d3cc1798ae7f9f200af98", - "edge_type": "dataflow_slice", - "src_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "src_qname": "TraceService.__init__", - "dst_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "dst_ref": "TraceService.__init__", - "resolution": "resolved", - "slice_id": "1e923a93faa05c3c43ca9b19bd047007a8589ccce57d3cc1798ae7f9f200af98", - "root_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "path_symbols": [ - "TraceService.__init__", - "TraceService.transport", - "TraceService.__init__" - ], - "path_symbol_ids": [ - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "TraceService.__init__\n -> TraceService.store\n -> TraceService.current_trace_id", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "TraceService.__init__:dataflow_slice", - "span_start": 42, - "span_end": 81, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "3ea17138634b1190bded77ddb84aa1595124f6519b246f24fc4b02bd62b5cac1", - "edge_type": "dataflow_slice", - "src_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "src_qname": "TraceService.__init__", - "dst_symbol_id": "41135180f7b3b9ab20e097e0747474e219c37dd2366ef08a7b43c1f3edb10b4c", - "dst_ref": "TraceService.current_trace_id", - "resolution": "resolved", - "slice_id": "3ea17138634b1190bded77ddb84aa1595124f6519b246f24fc4b02bd62b5cac1", - "root_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "path_symbols": [ - "TraceService.__init__", - "TraceService.store", - "TraceService.current_trace_id" - ], - "path_symbol_ids": [ - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "41135180f7b3b9ab20e097e0747474e219c37dd2366ef08a7b43c1f3edb10b4c" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "TraceService.__init__\n -> TraceService.store\n -> TraceService.step", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "TraceService.__init__:dataflow_slice", - "span_start": 42, - "span_end": 88, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "9f34c5da9b09fba99df6f6b1bde183a9aeb45111b8218a747c71590c2c9f60f2", - "edge_type": "dataflow_slice", - "src_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "src_qname": "TraceService.__init__", - "dst_symbol_id": "c44bfbc66cf747283f30088da3e011a10395031d41e77b74e523c24997f641ca", - "dst_ref": "TraceService.step", - "resolution": "resolved", - "slice_id": "9f34c5da9b09fba99df6f6b1bde183a9aeb45111b8218a747c71590c2c9f60f2", - "root_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "path_symbols": [ - "TraceService.__init__", - "TraceService.store", - "TraceService.step" - ], - "path_symbol_ids": [ - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "c44bfbc66cf747283f30088da3e011a10395031d41e77b74e523c24997f641ca" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "class TraceRecordWriter:\n def __init__(self, transport: TraceTransport) -> None:\n self._logger = logging.getLogger(__name__)\n self._transport = transport\n\n def write_context(self, record: TraceContextRecord) -> None:\n try:\n self._transport.write_context(record)\n except Exception:\n self._logger.exception(\"Trace transport failed to write context %s\", record.trace_id)\n\n def write_message(self, record: TraceLogMessage) -> None:\n try:\n self._transport.write_message(record)\n except Exception:\n self._logger.exception(\"Trace transport failed to write message for %s\", record.trace_id)", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/tracing/service.py:TraceRecordWriter", - "span_start": 21, - "span_end": 36, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.tracing.service", - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "class TraceService(TraceContextFactory):\n def __init__(self, transport: TraceTransport | None = None, store: TraceContextStore | None = None) -> None:\n self.transport = transport or NoOpTraceTransport()\n self.store = store or TraceContextStore()\n self._writer = TraceRecordWriter(self.transport)\n\n def create_context(\n self,\n *,\n alias: str,\n parent_id: str | None = None,\n kind: str | None = None,\n attrs: dict[str, Any] | None = None,\n ) -> str:\n record = TraceContextRecord(\n trace_id=uuid4().hex,\n alias=str(alias or \"\"),\n parent_id=parent_id,\n type=kind,\n event_time=utc_now(),\n attrs=dict(attrs or {}),\n )\n self.store.push(record)\n self._writer.write_context(record)\n return record.trace_id\n\n @contextmanager\n def open_context(\n self,\n *,\n alias: str,\n parent_id: str | None = None,\n kind: str | None = None,\n attrs: dict[str, Any] | None = None,\n ) -> Iterator[str]:\n trace_id = self.create_context(alias=alias, parent_id=parent_id, kind=kind, attrs=attrs)\n try:\n yield trace_id\n finally:\n self.store.pop()\n\n def current_trace_id(self) -> str | None:\n return self.store.current_trace_id()\n\n def close_context(self) -> str | None:\n previous = self.store.pop()\n return previous.record.trace_id if previous else None\n\n def step(self, name: str) -> None:\n self.store.set_step(str(name or \"\"))\n\n def info(self, message: str, *, status: str | None = None, attrs: dict[str, Any] | None = None) -> None:\n self._write_message(\"INFO\", message, status, attrs)\n\n def debug(self, message: str, *, status: str | None = None, attrs: dict[str, Any] | None = None) -> None:\n self._write_message(\"DEBUG\", message, status, attrs)\n\n def warning(self, message: str, *, status: str | None = None, attrs: dict[str, Any] | None = None) -> None:\n self._write_message(\"WARNING\", message, status, attrs)\n\n def error(self, message: str, *, status: str | None = None, attrs: dict[str, Any] | None = None) -> None:\n self._write_message(\"ERROR\", message, status, attrs)\n\n def exception(self, message: str, *, status: str = \"failed\", attrs: dict[str, Any] | None = None) -> None:\n self._write_message(\"ERROR\", message, status, attrs)\n\n def new_root(self, operation: str) -> TraceContext:\n trace_id = self.create_context(alias=operation, kind=\"operation\", attrs={\"operation\": operation})\n return TraceContext(trace_id=trace_id, span_id=trace_id, attributes={\"operation\": operation})\n\n def child_of(self, parent: TraceContext, operation: str) -> TraceContext:\n trace_id = self.create_context(\n alias=operation,\n parent_id=parent.trace_id,\n kind=\"worker\",\n attrs={\"operation\": operation},\n )\n return TraceContext(\n trace_id=trace_id,\n span_id=trace_id,\n parent_span_id=parent.span_id,\n attributes={\"operation\": operation},\n )\n\n def attach(self, metadata: dict[str, object], context: TraceContext) -> dict[str, object]:\n updated = dict(metadata)\n updated[\"trace_id\"] = context.trace_id\n updated[\"span_id\"] = context.span_id\n updated[\"parent_span_id\"] = context.parent_span_id\n return updated\n\n def resume(self, metadata: dict[str, object], operation: str) -> TraceContext:\n trace_id = str(metadata.get(\"trace_id\") or uuid4().hex)\n span_id = str(metadata.get(\"span_id\") or trace_id)\n parent_id = metadata.get(\"parent_span_id\")\n self.create_context(\n alias=operation,\n parent_id=str(parent_id) if parent_id else None,\n kind=\"worker\",\n attrs=dict(metadata),\n )\n return TraceContext(\n trace_id=trace_id,\n span_id=span_id,\n parent_span_id=str(parent_id) if parent_id else None,\n attributes={\"operation\": operation},\n )\n\n def _write_message(\n self,\n level: TraceLevel,\n message: str,\n status: str | None,\n attrs: dict[str, Any] | None,\n ) -> None:\n active = self.store.current()\n if active is None:\n raise RuntimeError(\"Trace context is not bound. Call create_context() first.\")\n record = TraceLogMessage(\n trace_id=active.record.trace_id,\n step=active.step,\n status=str(status or \"\"),\n message=str(message or \"\"),\n level=level,\n event_time=utc_now(),\n attrs=dict(attrs or {}),\n )\n self._writer.write_message(record)", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/tracing/service.py:TraceService", - "span_start": 39, - "span_end": 166, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 1, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.tracing.service", - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "class TraceManager(TraceService):\n \"\"\"Compatibility alias during the transition from ConfigManager-shaped naming.\"\"\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/tracing/service.py:TraceManager", - "span_start": 169, - "span_end": 170, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 2, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.tracing.service", - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ] - }, - "diagnostics": { - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C0_SOURCE_CHUNKS": "exact_path_fetch", - "C4_SEMANTIC_ROLES": "exact_path_fetch", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C3_ENTRYPOINTS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 8, - "C4_SEMANTIC_ROLES": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C3_ENTRYPOINTS": 6 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C4_SEMANTIC_ROLES": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "TraceService", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "TraceService", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C4_SEMANTIC_ROLES", - "query": "TraceService", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "TraceService", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - }, - { - "layer": "C3_ENTRYPOINTS", - "query": "TraceService", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 1, - "candidates_after_filter": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 6, - "candidates_after_filter": 6 - }, - { - "layer": "C3_ENTRYPOINTS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 3, - "candidates_after_filter": 3 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "TraceService", - "alternatives": [ - "TraceService" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 3, - "fail_reason": null - }, - { - "layer": "C4_SEMANTIC_ROLES", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 6, - "fail_reason": null - }, - { - "layer": "C3_ENTRYPOINTS", - "status": "hit", - "hit_count": 3, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "symbol_resolution": 0, - "retrieval_total": 140, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 46, - "C0_SOURCE_CHUNKS": 19, - "C4_SEMANTIC_ROLES": 18, - "C2_DEPENDENCY_GRAPH": 46, - "C3_ENTRYPOINTS": 9 - }, - "merge_rank": 20 - } - } - }, - { - "step": "llm_answer", - "input": { - "query": "Как работает TraceService?", - "rag_count": 14 - }, - "output": { - "llm_answer": "## Объяснение работы `TraceService`\n\n### Назначение\n`TraceService` — это сервис для управления контекстом трассировки и записи событий трассировки. Он отвечает за создание контекста трассировки, запись сообщений и управление хранилищем трассировок.\n\n### Ключевые зависимости\n- **TraceContextFactory**: Базовый класс для создания экземпляров, связанных с контекстом трассировки.\n- **TraceTransport**: Интерфейс для передачи трассировочных данных наружу системы.\n- **TraceContextStore**: Хранилище для отслеживания состояний трассировки.\n- **NoOpTraceTransport**: Транспорт по умолчанию, используемый при отсутствии активного транспорта.\n\n### Поток данных или вызовов\n1. **Инициализация (`__init__`)** \n - При создании экземпляра сервиса инициализируются транспорт и хранилище трассировок. Если транспорт или хранилище не предоставлены явно, используются предопределенные значения.\n \n2. **Создание контекста трассировки (`create_context`)** \n - Создаёт новый объект трассировки (`TraceContextRecord`), записывает его в хранилище и отправляет через транспорт.\n - Возвращает идентификатор созданной трассировки.\n\n3. **Вход в контекст трассировки (`open_context`)** \n - Вызывает метод `create_context`, возвращая созданный идентификатор трассировки.\n\n4. **Запись сообщения трассировки (`write_message`)** \n - Записывает сообщение трассировки в транспорт.\n\n5. **Запись контекста трассировки (`write_context`)** \n - Обеспечивает запись контекста трассировки в транспорт.\n\n### Важные детали реализации\n- **Хранение контекста трассировки:** Контекст сохраняется локально в хранилище до тех пор, пока он активно используется. После завершения работы с ним контекст удаляется автоматически.\n- **Отсутствие ошибок транспортировки:** В случае ошибки при передаче трассировочного сообщения фиксируется ошибка и сообщение логируется.\n- **Использование UUID для идентификации трассировки:** Каждый запрос генерирует уникальный идентификатор (`trace_id`), что позволяет отслеживать цепочки запросов и их зависимости.\n\n### Косвенные признаки (осторожный вывод)\n- На основании связей вызова и структуры файла можно предположить, что `TraceService` играет роль в управлении и журналировании процессов внутри приложения, обеспечивая централизованное ведение журнала событий и состояния трассировки.\n\n---\n\nТаким образом, основная задача `TraceService` заключается в обеспечении функциональности трассировки и сохранения информации о каждом этапе выполнения запроса, предоставляя механизмы для сбора и хранения этих данных." - }, - "diagnostics": { - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 931, - "evidence_rows": 14, - "evidence_chars": 6323 - }, - "evidence_summary": [ - { - "layer": "C1_SYMBOL_CATALOG", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "count": 6, - "unique_paths": 1 - }, - { - "layer": "C3_ENTRYPOINTS", - "count": 3, - "unique_paths": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 3, - "unique_paths": 1 - } - ], - "prompt_template_id": "intent_code_qa_explain_ru_v1", - "system_prompt_version": "v1" - }, - "timings_ms": { - "prompt_build": 0, - "llm_call": 3676 - } - } - } - ] - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_115223/full_chain_plba_code_retrieval_plba-fullchain-explain-trace-service.md b/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_115223/full_chain_plba_code_retrieval_plba-fullchain-explain-trace-service.md deleted file mode 100644 index 389beae..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_115223/full_chain_plba_code_retrieval_plba-fullchain-explain-trace-service.md +++ /dev/null @@ -1,34 +0,0 @@ -# plba-fullchain-explain-trace-service - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_retrieval.yaml -- runner: runtime -- mode: full_chain -- passed: True - -## Query -Как работает TraceService? - -## Actual -{ - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 14, - "llm_answer": "## Объяснение работы `TraceService`\n\n### Назначение\n`TraceService` — это сервис для управления контекстом трассировки и записи событий трассировки. Он отвечает за создание контекста трассировки, запись сообщений и управление хранилищем трассировок.\n\n### Ключевые зависимости\n- **TraceContextFactory**: Базовый класс для создания экземпляров, связанных с контекстом трассировки.\n- **TraceTransport**: Интерфейс для передачи трассировочных данных наружу системы.\n- **TraceContextStore**: Хранилище для отслеживания состояний трассировки.\n- **NoOpTraceTransport**: Транспорт по умолчанию, используемый при отсутствии активного транспорта.\n\n### Поток данных или вызовов\n1. **Инициализация (`__init__`)** \n - При создании экземпляра сервиса инициализируются транспорт и хранилище трассировок. Если транспорт или хранилище не предоставлены явно, используются предопределенные значения.\n \n2. **Создание контекста трассировки (`create_context`)** \n - Создаёт новый объект трассировки (`TraceContextRecord`), записывает его в хранилище и отправляет через транспорт.\n - Возвращает идентификатор созданной трассировки.\n\n3. **Вход в контекст трассировки (`open_context`)** \n - Вызывает метод `create_context`, возвращая созданный идентификатор трассировки.\n\n4. **Запись сообщения трассировки (`write_message`)** \n - Записывает сообщение трассировки в транспорт.\n\n5. **Запись контекста трассировки (`write_context`)** \n - Обеспечивает запись контекста трассировки в транспорт.\n\n### Важные детали реализации\n- **Хранение контекста трассировки:** Контекст сохраняется локально в хранилище до тех пор, пока он активно используется. После завершения работы с ним контекст удаляется автоматически.\n- **Отсутствие ошибок транспортировки:** В случае ошибки при передаче трассировочного сообщения фиксируется ошибка и сообщение логируется.\n- **Использование UUID для идентификации трассировки:** Каждый запрос генерирует уникальный идентификатор (`trace_id`), что позволяет отслеживать цепочки запросов и их зависимости.\n\n### Косвенные признаки (осторожный вывод)\n- На основании связей вызова и структуры файла можно предположить, что `TraceService` играет роль в управлении и журналировании процессов внутри приложения, обеспечивая централизованное ведение журнала событий и состояния трассировки.\n\n---\n\nТаким образом, основная задача `TraceService` заключается в обеспечении функциональности трассировки и сохранения информации о каждом этапе выполнения запроса, предоставляя механизмы для сбора и хранения этих данных.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "TraceService" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] -} - -## Mismatches -- none \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_115223/full_chain_plba_code_retrieval_plba-fullchain-explain-workflow-engine.json b/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_115223/full_chain_plba_code_retrieval_plba-fullchain-explain-workflow-engine.json deleted file mode 100644 index 2ec07da..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_115223/full_chain_plba_code_retrieval_plba-fullchain-explain-workflow-engine.json +++ /dev/null @@ -1,2158 +0,0 @@ -{ - "case_id": "plba-fullchain-explain-workflow-engine", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_retrieval.yaml", - "runner": "runtime", - "mode": "full_chain", - "actual": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 13, - "llm_answer": "## Назначение класса `WorkflowEngine`\nКласс `WorkflowEngine` является основным компонентом, отвечающим за выполнение рабочего процесса (`workflow`) приложения. Он управляет последовательностью выполнения этапов (`nodes`), сохраняет состояние выполнения и обеспечивает логирование и отслеживание состояния потока выполнения задач.\n\n## Ключевые зависимости\n- **`workflow`**: объект, описывающий рабочий процесс, состоящий из последовательности узлов и их связей.\n- **`persistence`**: компонент для сохранения текущего состояния выполнения рабочего процесса и метаданных о запуске.\n- **`traces`**: инструмент логирования и трассировки, позволяющий отслеживать ход выполнения задачи.\n- **`hooks`**: дополнительные функции-обработчики событий жизненного цикла рабочего процесса.\n\n## Поток данных или вызовов\n### Инициализация (`__init__`)\nПри создании экземпляра класса происходит инициализация следующих компонентов:\n- Загружается рабочий процесс (`workflow`).\n- Создается механизм разрешения переходов (`_transition_resolver`).\n- Указывается система хранения состояний (`persistence`).\n- Настраивается логирование (`_logger`).\n- Опционально подключаются обработчики дополнительных событий (`hooks`).\n\n### Запуск (`run`)\nПроцесс выполняется пошагово по узлам рабочего процесса (`nodes`):\n1. При каждом шаге сохраняется текущее состояние работы и узел выполнения.\n2. Выполняется разрешение перехода к следующему узлу с помощью механизма `_transition_resolver`.\n3. Логируются действия с использованием инструмента `traces`, фиксируя начало нового шага и завершение предыдущего.\n4. Цикл продолжается до тех пор, пока текущий узел не будет равен `None`, что означает завершение всего рабочего процесса.\n\n## Важные детали реализации\n- Метод `run` отвечает за выполнение всей логики управления рабочим процессом, начиная от начала до конца.\n- Состояние выполнения хранится внутри контекста (`context.state`), позволяя сохранять промежуточные результаты и текущие значения переменных.\n- Использование логгера (`logging.getLogger(__name__)`) позволяет централизованно вести журнал всех действий.\n- Сохранение идентификатора текущей операции (`run_id`) в хранилище (`persistence`) позволяет отслеживать выполнение каждого запущенного рабочего процесса.\n- Применение инструментов трассировки (`traces`) помогает мониторить выполнение шагов рабочего процесса, включая шаги перед началом и после завершения этапа.\n\n## Осторожные выводы\nНа основании доступных слоев информации сложно точно определить детальную взаимосвязь с другими компонентами системы через сигнатуру функций и прямые ссылки. Однако косвенные признаки показывают использование стандартных практик и библиотек для логирования и мониторинга, таких как `logging` и `tracing`.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "WorkflowEngine" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "passed": true, - "mismatches": [], - "details": { - "case_id": "plba-fullchain-explain-workflow-engine", - "text": "Объясни класс WorkflowEngine", - "mode": "full_chain", - "run_started_at": "2026-03-12T11:52:23", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Объясни класс WorkflowEngine", - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "WorkflowEngine", - "alternatives": [ - "WorkflowEngine", - "WorkflowEngineHooks" - ], - "confidence": 0.99 - }, - "rag_count": 13, - "rag_rows": [ - { - "path": "src/app_runtime/workflow/engine/workflow_engine.py", - "content": "class WorkflowEngine\nWorkflowEngine", - "layer": "C1_SYMBOL_CATALOG", - "title": "WorkflowEngine", - "span_start": 10, - "span_end": 86, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "57ec0a9f11c542c78e008684a888397e8d9ef4223671acb2567e631a0cbc70b4", - "qname": "WorkflowEngine", - "kind": "class", - "signature": "WorkflowEngine", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.workflow.engine.workflow_engine", - "is_test": false, - "blob_sha": "1057136e58a325cd5ab6f4e265d15665fb6a711b7022d9fab52a1a290afa2368", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/engine/hooks.py", - "content": "class WorkflowEngineHooks\nWorkflowEngineHooks", - "layer": "C1_SYMBOL_CATALOG", - "title": "WorkflowEngineHooks", - "span_start": 6, - "span_end": 14, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "914123ed510540061e116100fc87bba4195595ba696f8bfde2fd77ac6a5cd7e4", - "qname": "WorkflowEngineHooks", - "kind": "class", - "signature": "WorkflowEngineHooks", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.workflow.engine.hooks", - "is_test": false, - "blob_sha": "4b11672b0a9af1ae04bfce9d8e1f96572997d3e65e68108d7c797b88fa5fa47a", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/engine/workflow_engine.py", - "content": "WorkflowEngine\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (6)", - "layer": "C4_SEMANTIC_ROLES", - "title": "WorkflowEngine", - "span_start": 10, - "span_end": 86, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 25, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "57ec0a9f11c542c78e008684a888397e8d9ef4223671acb2567e631a0cbc70b4", - "symbol_name": "WorkflowEngine", - "qname": "WorkflowEngine", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 6, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "1057136e58a325cd5ab6f4e265d15665fb6a711b7022d9fab52a1a290afa2368", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/engine/workflow_engine.py", - "content": "WorkflowEngine.__init__\n -> WorkflowEngine._transition_resolver\n -> WorkflowEngine.run", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "WorkflowEngine.__init__:dataflow_slice", - "span_start": 14, - "span_end": 63, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "3abf07e5c245e0fe59785ba2d569c2ee56018715fc7f625a044ddaf6201f903d", - "edge_type": "dataflow_slice", - "src_symbol_id": "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "src_qname": "WorkflowEngine.__init__", - "dst_symbol_id": "a12cad0f5b238287e02f6d8d156cc764351d8c83246930487fa09d5ce6f2ace8", - "dst_ref": "WorkflowEngine.run", - "resolution": "resolved", - "slice_id": "3abf07e5c245e0fe59785ba2d569c2ee56018715fc7f625a044ddaf6201f903d", - "root_symbol_id": "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "path_symbols": [ - "WorkflowEngine.__init__", - "WorkflowEngine._transition_resolver", - "WorkflowEngine.run" - ], - "path_symbol_ids": [ - "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "a12cad0f5b238287e02f6d8d156cc764351d8c83246930487fa09d5ce6f2ace8" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "1057136e58a325cd5ab6f4e265d15665fb6a711b7022d9fab52a1a290afa2368", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/engine/workflow_engine.py", - "content": "WorkflowEngine.__init__\n -> WorkflowEngine._hooks\n -> WorkflowEngine.run", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "WorkflowEngine.__init__:dataflow_slice", - "span_start": 16, - "span_end": 34, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "d73db644b69c1eb35afd6eae9d6ac8674e49e30e9bcf9c020f9fdbfe754851b2", - "edge_type": "dataflow_slice", - "src_symbol_id": "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "src_qname": "WorkflowEngine.__init__", - "dst_symbol_id": "a12cad0f5b238287e02f6d8d156cc764351d8c83246930487fa09d5ce6f2ace8", - "dst_ref": "WorkflowEngine.run", - "resolution": "resolved", - "slice_id": "d73db644b69c1eb35afd6eae9d6ac8674e49e30e9bcf9c020f9fdbfe754851b2", - "root_symbol_id": "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "path_symbols": [ - "WorkflowEngine.__init__", - "WorkflowEngine._hooks", - "WorkflowEngine.run" - ], - "path_symbol_ids": [ - "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "a12cad0f5b238287e02f6d8d156cc764351d8c83246930487fa09d5ce6f2ace8" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "1057136e58a325cd5ab6f4e265d15665fb6a711b7022d9fab52a1a290afa2368", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/engine/workflow_engine.py", - "content": "WorkflowEngine.__init__\n -> WorkflowEngine._workflow\n -> WorkflowEngine.run", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "WorkflowEngine.__init__:dataflow_slice", - "span_start": 12, - "span_end": 29, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "b45ef3c54669b4910a8aed3a565804f275424a24007bc7e3c953389521f80249", - "edge_type": "dataflow_slice", - "src_symbol_id": "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "src_qname": "WorkflowEngine.__init__", - "dst_symbol_id": "a12cad0f5b238287e02f6d8d156cc764351d8c83246930487fa09d5ce6f2ace8", - "dst_ref": "WorkflowEngine.run", - "resolution": "resolved", - "slice_id": "b45ef3c54669b4910a8aed3a565804f275424a24007bc7e3c953389521f80249", - "root_symbol_id": "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "path_symbols": [ - "WorkflowEngine.__init__", - "WorkflowEngine._workflow", - "WorkflowEngine.run" - ], - "path_symbol_ids": [ - "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "a12cad0f5b238287e02f6d8d156cc764351d8c83246930487fa09d5ce6f2ace8" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "1057136e58a325cd5ab6f4e265d15665fb6a711b7022d9fab52a1a290afa2368", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/engine/workflow_engine.py", - "content": "WorkflowEngine.__init__\n -> WorkflowEngine._persistence\n -> WorkflowEngine.run", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "WorkflowEngine.__init__:dataflow_slice", - "span_start": 13, - "span_end": 20, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "8101338770016324ce05d61daa9935a444c75e6c94a0fae4275d5b50fcbcc70b", - "edge_type": "dataflow_slice", - "src_symbol_id": "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "src_qname": "WorkflowEngine.__init__", - "dst_symbol_id": "a12cad0f5b238287e02f6d8d156cc764351d8c83246930487fa09d5ce6f2ace8", - "dst_ref": "WorkflowEngine.run", - "resolution": "resolved", - "slice_id": "8101338770016324ce05d61daa9935a444c75e6c94a0fae4275d5b50fcbcc70b", - "root_symbol_id": "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "path_symbols": [ - "WorkflowEngine.__init__", - "WorkflowEngine._persistence", - "WorkflowEngine.run" - ], - "path_symbol_ids": [ - "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "a12cad0f5b238287e02f6d8d156cc764351d8c83246930487fa09d5ce6f2ace8" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "1057136e58a325cd5ab6f4e265d15665fb6a711b7022d9fab52a1a290afa2368", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/engine/workflow_engine.py", - "content": "WorkflowEngine.__init__\n -> WorkflowEngine._traces\n -> WorkflowEngine.run", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "WorkflowEngine.__init__:dataflow_slice", - "span_start": 15, - "span_end": 27, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "5006266616d534d721648391565e2ac0c9e7e9d9f8df00c17fba8989afb533a5", - "edge_type": "dataflow_slice", - "src_symbol_id": "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "src_qname": "WorkflowEngine.__init__", - "dst_symbol_id": "a12cad0f5b238287e02f6d8d156cc764351d8c83246930487fa09d5ce6f2ace8", - "dst_ref": "WorkflowEngine.run", - "resolution": "resolved", - "slice_id": "5006266616d534d721648391565e2ac0c9e7e9d9f8df00c17fba8989afb533a5", - "root_symbol_id": "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "path_symbols": [ - "WorkflowEngine.__init__", - "WorkflowEngine._traces", - "WorkflowEngine.run" - ], - "path_symbol_ids": [ - "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "a12cad0f5b238287e02f6d8d156cc764351d8c83246930487fa09d5ce6f2ace8" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "1057136e58a325cd5ab6f4e265d15665fb6a711b7022d9fab52a1a290afa2368", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/engine/workflow_engine.py", - "content": "WorkflowEngine.__init__\n -> WorkflowEngine._logger\n -> WorkflowEngine.run", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "WorkflowEngine.__init__:dataflow_slice", - "span_start": 17, - "span_end": 85, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "2f9927abb24794adb056b94bfb5d8538a5cbafb160da2079f52fca97fd694a2b", - "edge_type": "dataflow_slice", - "src_symbol_id": "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "src_qname": "WorkflowEngine.__init__", - "dst_symbol_id": "a12cad0f5b238287e02f6d8d156cc764351d8c83246930487fa09d5ce6f2ace8", - "dst_ref": "WorkflowEngine.run", - "resolution": "resolved", - "slice_id": "2f9927abb24794adb056b94bfb5d8538a5cbafb160da2079f52fca97fd694a2b", - "root_symbol_id": "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "path_symbols": [ - "WorkflowEngine.__init__", - "WorkflowEngine._logger", - "WorkflowEngine.run" - ], - "path_symbol_ids": [ - "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "a12cad0f5b238287e02f6d8d156cc764351d8c83246930487fa09d5ce6f2ace8" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "1057136e58a325cd5ab6f4e265d15665fb6a711b7022d9fab52a1a290afa2368", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/engine/workflow_engine.py", - "content": "class WorkflowEngine:\n def __init__(self, workflow, persistence, *, traces, hooks: WorkflowEngineHooks | None = None) -> None:\n self._workflow = workflow\n self._persistence = persistence\n self._transition_resolver = TransitionResolver()\n self._traces = traces\n self._hooks = hooks or WorkflowEngineHooks()\n self._logger = logging.getLogger(__name__)\n\n def run(self, context: WorkflowContext) -> dict[str, object]:\n run_id = self._persistence.start_run(\n self._workflow.definition.name,\n self._workflow.definition.start_at,\n context.snapshot(),\n )\n context.state.setdefault(\"runtime\", {})\n context.state[\"runtime\"][\"workflow_run_id\"] = run_id\n self._traces.step(\"workflow\")\n self._traces.info(\"Workflow started.\", status=\"started\", attrs={\"workflow_run_id\": run_id})\n current_name = self._workflow.definition.start_at\n while current_name is not None:\n node = self._workflow.definition.nodes[current_name]\n context.state[\"runtime\"][\"current_node\"] = current_name\n self._logger.info(\"Workflow run %s: step '%s' started.\", run_id, current_name)\n self._hooks.on_step_started(context, current_name)\n self._persistence.start_step(run_id, current_name, context.snapshot())\n self._traces.step(current_name)\n self._traces.debug(\n f\"Step '{current_name}' started.\",\n status=\"started\",\n attrs={\"workflow_run_id\": run_id, \"node\": current_name},\n )\n try:\n result = node.step.run(context)\n except Exception as error:\n self._persistence.fail_step(run_id, current_name, context.snapshot(), error)\n self._persistence.fail_run(run_id, context.snapshot())\n self._traces.error(\n f\"Step '{current_name}' failed: {error}\",\n status=\"failed\",\n attrs={\"exception_type\": type(error).__name__},\n )\n self._logger.exception(\"Workflow run %s: step '%s' failed.\", run_id, current_name)\n self._hooks.on_step_failed(context, current_name)\n raise\n context.state.update(result.updates)\n self._persistence.complete_step(\n run_id,\n current_name,\n result.status,\n result.transition,\n context.snapshot(),\n )\n next_node = self._transition_resolver.resolve(node, result)\n self._traces.debug(\n f\"Step '{current_name}' completed with transition '{result.transition}'.\",\n status=result.status,\n attrs={\n \"workflow_run_id\": run_id,\n \"from_node\": current_name,\n \"transition\": result.transition,\n \"to_node\": next_node,\n },\n )\n self._logger.info(\n \"Workflow run %s: step '%s' completed with transition '%s'.\",\n run_id,\n current_name,\n result.transition,\n )\n self._hooks.on_step_finished(context, current_name)\n current_name = next_node\n self._persistence.complete_run(run_id, context.snapshot())\n self._traces.step(\"workflow\")\n self._traces.info(\"Workflow completed.\", status=\"completed\", attrs={\"workflow_run_id\": run_id})\n self._logger.info(\"Workflow run %s completed.\", run_id)\n return {\"run_id\": run_id, \"status\": \"completed\", \"context\": context.snapshot()}", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/workflow/engine/workflow_engine.py:WorkflowEngine", - "span_start": 10, - "span_end": 86, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.workflow.engine.workflow_engine", - "is_test": false, - "blob_sha": "1057136e58a325cd5ab6f4e265d15665fb6a711b7022d9fab52a1a290afa2368", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "llm_answer": "## Назначение класса `WorkflowEngine`\nКласс `WorkflowEngine` является основным компонентом, отвечающим за выполнение рабочего процесса (`workflow`) приложения. Он управляет последовательностью выполнения этапов (`nodes`), сохраняет состояние выполнения и обеспечивает логирование и отслеживание состояния потока выполнения задач.\n\n## Ключевые зависимости\n- **`workflow`**: объект, описывающий рабочий процесс, состоящий из последовательности узлов и их связей.\n- **`persistence`**: компонент для сохранения текущего состояния выполнения рабочего процесса и метаданных о запуске.\n- **`traces`**: инструмент логирования и трассировки, позволяющий отслеживать ход выполнения задачи.\n- **`hooks`**: дополнительные функции-обработчики событий жизненного цикла рабочего процесса.\n\n## Поток данных или вызовов\n### Инициализация (`__init__`)\nПри создании экземпляра класса происходит инициализация следующих компонентов:\n- Загружается рабочий процесс (`workflow`).\n- Создается механизм разрешения переходов (`_transition_resolver`).\n- Указывается система хранения состояний (`persistence`).\n- Настраивается логирование (`_logger`).\n- Опционально подключаются обработчики дополнительных событий (`hooks`).\n\n### Запуск (`run`)\nПроцесс выполняется пошагово по узлам рабочего процесса (`nodes`):\n1. При каждом шаге сохраняется текущее состояние работы и узел выполнения.\n2. Выполняется разрешение перехода к следующему узлу с помощью механизма `_transition_resolver`.\n3. Логируются действия с использованием инструмента `traces`, фиксируя начало нового шага и завершение предыдущего.\n4. Цикл продолжается до тех пор, пока текущий узел не будет равен `None`, что означает завершение всего рабочего процесса.\n\n## Важные детали реализации\n- Метод `run` отвечает за выполнение всей логики управления рабочим процессом, начиная от начала до конца.\n- Состояние выполнения хранится внутри контекста (`context.state`), позволяя сохранять промежуточные результаты и текущие значения переменных.\n- Использование логгера (`logging.getLogger(__name__)`) позволяет централизованно вести журнал всех действий.\n- Сохранение идентификатора текущей операции (`run_id`) в хранилище (`persistence`) позволяет отслеживать выполнение каждого запущенного рабочего процесса.\n- Применение инструментов трассировки (`traces`) помогает мониторить выполнение шагов рабочего процесса, включая шаги перед началом и после завершения этапа.\n\n## Осторожные выводы\nНа основании доступных слоев информации сложно точно определить детальную взаимосвязь с другими компонентами системы через сигнатуру функций и прямые ссылки. Однако косвенные признаки показывают использование стандартных практик и библиотек для логирования и мониторинга, таких как `logging` и `tracing`.", - "summary": { - "router": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "confidence": null - }, - "retrieval": { - "profile": "code", - "layers_hit": [ - "C0_SOURCE_CHUNKS", - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS", - "C4_SEMANTIC_ROLES" - ], - "evidence_sufficient": true - }, - "llm": { - "answer_status": "answered", - "groundedness": "grounded" - } - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "WorkflowEngine" - ], - "keyword_hints": [ - "WorkflowEngine" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C0_SOURCE_CHUNKS": "exact_path_fetch", - "C4_SEMANTIC_ROLES": "exact_path_fetch", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C3_ENTRYPOINTS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 8, - "C4_SEMANTIC_ROLES": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C3_ENTRYPOINTS": 6 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C4_SEMANTIC_ROLES": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "WorkflowEngine", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "WorkflowEngine", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C4_SEMANTIC_ROLES", - "query": "WorkflowEngine", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "WorkflowEngine", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - }, - { - "layer": "C3_ENTRYPOINTS", - "query": "WorkflowEngine", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 2, - "candidates_after_filter": 2 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 6, - "candidates_after_filter": 6 - }, - { - "layer": "C3_ENTRYPOINTS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 3, - "candidates_after_filter": 3 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "WorkflowEngine", - "alternatives": [ - "WorkflowEngine", - "WorkflowEngineHooks" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "hit", - "hit_count": 2, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C4_SEMANTIC_ROLES", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 6, - "fail_reason": null - }, - { - "layer": "C3_ENTRYPOINTS", - "status": "hit", - "hit_count": 3, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "router": 0, - "symbol_resolution": 0, - "retrieval_total": 129, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 37, - "C0_SOURCE_CHUNKS": 15, - "C4_SEMANTIC_ROLES": 16, - "C2_DEPENDENCY_GRAPH": 47, - "C3_ENTRYPOINTS": 11 - }, - "merge_rank": 27, - "prompt_build": 0, - "llm_call": 3730 - }, - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 780, - "evidence_rows": 13, - "evidence_chars": 4423 - }, - "evidence_summary": [ - { - "layer": "C1_SYMBOL_CATALOG", - "count": 2, - "unique_paths": 2 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "count": 6, - "unique_paths": 1 - }, - { - "layer": "C3_ENTRYPOINTS", - "count": 3, - "unique_paths": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 1, - "unique_paths": 1 - } - ], - "prompt_template_id": "intent_code_qa_explain_ru_v1", - "system_prompt_version": "v1" - }, - "router": { - "conversation_mode": "START", - "keyword_hints": [ - "WorkflowEngine" - ], - "path_scope": [] - }, - "llm": { - "used_evidence_count": 13, - "missing_evidence_reason": null - } - }, - "run_info": { - "case_id": "plba-fullchain-explain-workflow-engine", - "mode": "full_chain", - "run_started_at": "2026-03-12T11:52:23", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - }, - "input_request": { - "text": "Объясни класс WorkflowEngine", - "normalized_query": "Объясни класс WorkflowEngine" - }, - "steps": [ - { - "step": "intent_router", - "input": { - "query": "Объясни класс WorkflowEngine" - }, - "output": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Объясни класс WorkflowEngine" - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "WorkflowEngine" - ], - "keyword_hints": [ - "WorkflowEngine" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "timings_ms": { - "router": 0 - } - } - }, - { - "step": "retrieval", - "input": { - "query": "Объясни класс WorkflowEngine" - }, - "output": { - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "WorkflowEngine", - "alternatives": [ - "WorkflowEngine", - "WorkflowEngineHooks" - ], - "confidence": 0.99 - }, - "rag_count": 13, - "rag_rows": [ - { - "path": "src/app_runtime/workflow/engine/workflow_engine.py", - "content": "class WorkflowEngine\nWorkflowEngine", - "layer": "C1_SYMBOL_CATALOG", - "title": "WorkflowEngine", - "span_start": 10, - "span_end": 86, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "57ec0a9f11c542c78e008684a888397e8d9ef4223671acb2567e631a0cbc70b4", - "qname": "WorkflowEngine", - "kind": "class", - "signature": "WorkflowEngine", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.workflow.engine.workflow_engine", - "is_test": false, - "blob_sha": "1057136e58a325cd5ab6f4e265d15665fb6a711b7022d9fab52a1a290afa2368", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/engine/hooks.py", - "content": "class WorkflowEngineHooks\nWorkflowEngineHooks", - "layer": "C1_SYMBOL_CATALOG", - "title": "WorkflowEngineHooks", - "span_start": 6, - "span_end": 14, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "914123ed510540061e116100fc87bba4195595ba696f8bfde2fd77ac6a5cd7e4", - "qname": "WorkflowEngineHooks", - "kind": "class", - "signature": "WorkflowEngineHooks", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.workflow.engine.hooks", - "is_test": false, - "blob_sha": "4b11672b0a9af1ae04bfce9d8e1f96572997d3e65e68108d7c797b88fa5fa47a", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/engine/workflow_engine.py", - "content": "WorkflowEngine\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (6)", - "layer": "C4_SEMANTIC_ROLES", - "title": "WorkflowEngine", - "span_start": 10, - "span_end": 86, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 25, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "57ec0a9f11c542c78e008684a888397e8d9ef4223671acb2567e631a0cbc70b4", - "symbol_name": "WorkflowEngine", - "qname": "WorkflowEngine", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 6, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "1057136e58a325cd5ab6f4e265d15665fb6a711b7022d9fab52a1a290afa2368", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/engine/workflow_engine.py", - "content": "WorkflowEngine.__init__\n -> WorkflowEngine._transition_resolver\n -> WorkflowEngine.run", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "WorkflowEngine.__init__:dataflow_slice", - "span_start": 14, - "span_end": 63, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "3abf07e5c245e0fe59785ba2d569c2ee56018715fc7f625a044ddaf6201f903d", - "edge_type": "dataflow_slice", - "src_symbol_id": "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "src_qname": "WorkflowEngine.__init__", - "dst_symbol_id": "a12cad0f5b238287e02f6d8d156cc764351d8c83246930487fa09d5ce6f2ace8", - "dst_ref": "WorkflowEngine.run", - "resolution": "resolved", - "slice_id": "3abf07e5c245e0fe59785ba2d569c2ee56018715fc7f625a044ddaf6201f903d", - "root_symbol_id": "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "path_symbols": [ - "WorkflowEngine.__init__", - "WorkflowEngine._transition_resolver", - "WorkflowEngine.run" - ], - "path_symbol_ids": [ - "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "a12cad0f5b238287e02f6d8d156cc764351d8c83246930487fa09d5ce6f2ace8" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "1057136e58a325cd5ab6f4e265d15665fb6a711b7022d9fab52a1a290afa2368", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/engine/workflow_engine.py", - "content": "WorkflowEngine.__init__\n -> WorkflowEngine._hooks\n -> WorkflowEngine.run", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "WorkflowEngine.__init__:dataflow_slice", - "span_start": 16, - "span_end": 34, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "d73db644b69c1eb35afd6eae9d6ac8674e49e30e9bcf9c020f9fdbfe754851b2", - "edge_type": "dataflow_slice", - "src_symbol_id": "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "src_qname": "WorkflowEngine.__init__", - "dst_symbol_id": "a12cad0f5b238287e02f6d8d156cc764351d8c83246930487fa09d5ce6f2ace8", - "dst_ref": "WorkflowEngine.run", - "resolution": "resolved", - "slice_id": "d73db644b69c1eb35afd6eae9d6ac8674e49e30e9bcf9c020f9fdbfe754851b2", - "root_symbol_id": "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "path_symbols": [ - "WorkflowEngine.__init__", - "WorkflowEngine._hooks", - "WorkflowEngine.run" - ], - "path_symbol_ids": [ - "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "a12cad0f5b238287e02f6d8d156cc764351d8c83246930487fa09d5ce6f2ace8" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "1057136e58a325cd5ab6f4e265d15665fb6a711b7022d9fab52a1a290afa2368", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/engine/workflow_engine.py", - "content": "WorkflowEngine.__init__\n -> WorkflowEngine._workflow\n -> WorkflowEngine.run", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "WorkflowEngine.__init__:dataflow_slice", - "span_start": 12, - "span_end": 29, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "b45ef3c54669b4910a8aed3a565804f275424a24007bc7e3c953389521f80249", - "edge_type": "dataflow_slice", - "src_symbol_id": "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "src_qname": "WorkflowEngine.__init__", - "dst_symbol_id": "a12cad0f5b238287e02f6d8d156cc764351d8c83246930487fa09d5ce6f2ace8", - "dst_ref": "WorkflowEngine.run", - "resolution": "resolved", - "slice_id": "b45ef3c54669b4910a8aed3a565804f275424a24007bc7e3c953389521f80249", - "root_symbol_id": "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "path_symbols": [ - "WorkflowEngine.__init__", - "WorkflowEngine._workflow", - "WorkflowEngine.run" - ], - "path_symbol_ids": [ - "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "a12cad0f5b238287e02f6d8d156cc764351d8c83246930487fa09d5ce6f2ace8" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "1057136e58a325cd5ab6f4e265d15665fb6a711b7022d9fab52a1a290afa2368", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/engine/workflow_engine.py", - "content": "WorkflowEngine.__init__\n -> WorkflowEngine._persistence\n -> WorkflowEngine.run", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "WorkflowEngine.__init__:dataflow_slice", - "span_start": 13, - "span_end": 20, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "8101338770016324ce05d61daa9935a444c75e6c94a0fae4275d5b50fcbcc70b", - "edge_type": "dataflow_slice", - "src_symbol_id": "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "src_qname": "WorkflowEngine.__init__", - "dst_symbol_id": "a12cad0f5b238287e02f6d8d156cc764351d8c83246930487fa09d5ce6f2ace8", - "dst_ref": "WorkflowEngine.run", - "resolution": "resolved", - "slice_id": "8101338770016324ce05d61daa9935a444c75e6c94a0fae4275d5b50fcbcc70b", - "root_symbol_id": "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "path_symbols": [ - "WorkflowEngine.__init__", - "WorkflowEngine._persistence", - "WorkflowEngine.run" - ], - "path_symbol_ids": [ - "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "a12cad0f5b238287e02f6d8d156cc764351d8c83246930487fa09d5ce6f2ace8" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "1057136e58a325cd5ab6f4e265d15665fb6a711b7022d9fab52a1a290afa2368", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/engine/workflow_engine.py", - "content": "WorkflowEngine.__init__\n -> WorkflowEngine._traces\n -> WorkflowEngine.run", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "WorkflowEngine.__init__:dataflow_slice", - "span_start": 15, - "span_end": 27, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "5006266616d534d721648391565e2ac0c9e7e9d9f8df00c17fba8989afb533a5", - "edge_type": "dataflow_slice", - "src_symbol_id": "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "src_qname": "WorkflowEngine.__init__", - "dst_symbol_id": "a12cad0f5b238287e02f6d8d156cc764351d8c83246930487fa09d5ce6f2ace8", - "dst_ref": "WorkflowEngine.run", - "resolution": "resolved", - "slice_id": "5006266616d534d721648391565e2ac0c9e7e9d9f8df00c17fba8989afb533a5", - "root_symbol_id": "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "path_symbols": [ - "WorkflowEngine.__init__", - "WorkflowEngine._traces", - "WorkflowEngine.run" - ], - "path_symbol_ids": [ - "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "a12cad0f5b238287e02f6d8d156cc764351d8c83246930487fa09d5ce6f2ace8" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "1057136e58a325cd5ab6f4e265d15665fb6a711b7022d9fab52a1a290afa2368", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/engine/workflow_engine.py", - "content": "WorkflowEngine.__init__\n -> WorkflowEngine._logger\n -> WorkflowEngine.run", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "WorkflowEngine.__init__:dataflow_slice", - "span_start": 17, - "span_end": 85, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "2f9927abb24794adb056b94bfb5d8538a5cbafb160da2079f52fca97fd694a2b", - "edge_type": "dataflow_slice", - "src_symbol_id": "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "src_qname": "WorkflowEngine.__init__", - "dst_symbol_id": "a12cad0f5b238287e02f6d8d156cc764351d8c83246930487fa09d5ce6f2ace8", - "dst_ref": "WorkflowEngine.run", - "resolution": "resolved", - "slice_id": "2f9927abb24794adb056b94bfb5d8538a5cbafb160da2079f52fca97fd694a2b", - "root_symbol_id": "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "path_symbols": [ - "WorkflowEngine.__init__", - "WorkflowEngine._logger", - "WorkflowEngine.run" - ], - "path_symbol_ids": [ - "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "a12cad0f5b238287e02f6d8d156cc764351d8c83246930487fa09d5ce6f2ace8" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "1057136e58a325cd5ab6f4e265d15665fb6a711b7022d9fab52a1a290afa2368", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/engine/workflow_engine.py", - "content": "class WorkflowEngine:\n def __init__(self, workflow, persistence, *, traces, hooks: WorkflowEngineHooks | None = None) -> None:\n self._workflow = workflow\n self._persistence = persistence\n self._transition_resolver = TransitionResolver()\n self._traces = traces\n self._hooks = hooks or WorkflowEngineHooks()\n self._logger = logging.getLogger(__name__)\n\n def run(self, context: WorkflowContext) -> dict[str, object]:\n run_id = self._persistence.start_run(\n self._workflow.definition.name,\n self._workflow.definition.start_at,\n context.snapshot(),\n )\n context.state.setdefault(\"runtime\", {})\n context.state[\"runtime\"][\"workflow_run_id\"] = run_id\n self._traces.step(\"workflow\")\n self._traces.info(\"Workflow started.\", status=\"started\", attrs={\"workflow_run_id\": run_id})\n current_name = self._workflow.definition.start_at\n while current_name is not None:\n node = self._workflow.definition.nodes[current_name]\n context.state[\"runtime\"][\"current_node\"] = current_name\n self._logger.info(\"Workflow run %s: step '%s' started.\", run_id, current_name)\n self._hooks.on_step_started(context, current_name)\n self._persistence.start_step(run_id, current_name, context.snapshot())\n self._traces.step(current_name)\n self._traces.debug(\n f\"Step '{current_name}' started.\",\n status=\"started\",\n attrs={\"workflow_run_id\": run_id, \"node\": current_name},\n )\n try:\n result = node.step.run(context)\n except Exception as error:\n self._persistence.fail_step(run_id, current_name, context.snapshot(), error)\n self._persistence.fail_run(run_id, context.snapshot())\n self._traces.error(\n f\"Step '{current_name}' failed: {error}\",\n status=\"failed\",\n attrs={\"exception_type\": type(error).__name__},\n )\n self._logger.exception(\"Workflow run %s: step '%s' failed.\", run_id, current_name)\n self._hooks.on_step_failed(context, current_name)\n raise\n context.state.update(result.updates)\n self._persistence.complete_step(\n run_id,\n current_name,\n result.status,\n result.transition,\n context.snapshot(),\n )\n next_node = self._transition_resolver.resolve(node, result)\n self._traces.debug(\n f\"Step '{current_name}' completed with transition '{result.transition}'.\",\n status=result.status,\n attrs={\n \"workflow_run_id\": run_id,\n \"from_node\": current_name,\n \"transition\": result.transition,\n \"to_node\": next_node,\n },\n )\n self._logger.info(\n \"Workflow run %s: step '%s' completed with transition '%s'.\",\n run_id,\n current_name,\n result.transition,\n )\n self._hooks.on_step_finished(context, current_name)\n current_name = next_node\n self._persistence.complete_run(run_id, context.snapshot())\n self._traces.step(\"workflow\")\n self._traces.info(\"Workflow completed.\", status=\"completed\", attrs={\"workflow_run_id\": run_id})\n self._logger.info(\"Workflow run %s completed.\", run_id)\n return {\"run_id\": run_id, \"status\": \"completed\", \"context\": context.snapshot()}", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/workflow/engine/workflow_engine.py:WorkflowEngine", - "span_start": 10, - "span_end": 86, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.workflow.engine.workflow_engine", - "is_test": false, - "blob_sha": "1057136e58a325cd5ab6f4e265d15665fb6a711b7022d9fab52a1a290afa2368", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ] - }, - "diagnostics": { - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C0_SOURCE_CHUNKS": "exact_path_fetch", - "C4_SEMANTIC_ROLES": "exact_path_fetch", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C3_ENTRYPOINTS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 8, - "C4_SEMANTIC_ROLES": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C3_ENTRYPOINTS": 6 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C4_SEMANTIC_ROLES": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "WorkflowEngine", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "WorkflowEngine", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C4_SEMANTIC_ROLES", - "query": "WorkflowEngine", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "WorkflowEngine", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - }, - { - "layer": "C3_ENTRYPOINTS", - "query": "WorkflowEngine", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 2, - "candidates_after_filter": 2 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 6, - "candidates_after_filter": 6 - }, - { - "layer": "C3_ENTRYPOINTS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 3, - "candidates_after_filter": 3 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "WorkflowEngine", - "alternatives": [ - "WorkflowEngine", - "WorkflowEngineHooks" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "hit", - "hit_count": 2, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C4_SEMANTIC_ROLES", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 6, - "fail_reason": null - }, - { - "layer": "C3_ENTRYPOINTS", - "status": "hit", - "hit_count": 3, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "symbol_resolution": 0, - "retrieval_total": 129, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 37, - "C0_SOURCE_CHUNKS": 15, - "C4_SEMANTIC_ROLES": 16, - "C2_DEPENDENCY_GRAPH": 47, - "C3_ENTRYPOINTS": 11 - }, - "merge_rank": 27 - } - } - }, - { - "step": "llm_answer", - "input": { - "query": "Объясни класс WorkflowEngine", - "rag_count": 13 - }, - "output": { - "llm_answer": "## Назначение класса `WorkflowEngine`\nКласс `WorkflowEngine` является основным компонентом, отвечающим за выполнение рабочего процесса (`workflow`) приложения. Он управляет последовательностью выполнения этапов (`nodes`), сохраняет состояние выполнения и обеспечивает логирование и отслеживание состояния потока выполнения задач.\n\n## Ключевые зависимости\n- **`workflow`**: объект, описывающий рабочий процесс, состоящий из последовательности узлов и их связей.\n- **`persistence`**: компонент для сохранения текущего состояния выполнения рабочего процесса и метаданных о запуске.\n- **`traces`**: инструмент логирования и трассировки, позволяющий отслеживать ход выполнения задачи.\n- **`hooks`**: дополнительные функции-обработчики событий жизненного цикла рабочего процесса.\n\n## Поток данных или вызовов\n### Инициализация (`__init__`)\nПри создании экземпляра класса происходит инициализация следующих компонентов:\n- Загружается рабочий процесс (`workflow`).\n- Создается механизм разрешения переходов (`_transition_resolver`).\n- Указывается система хранения состояний (`persistence`).\n- Настраивается логирование (`_logger`).\n- Опционально подключаются обработчики дополнительных событий (`hooks`).\n\n### Запуск (`run`)\nПроцесс выполняется пошагово по узлам рабочего процесса (`nodes`):\n1. При каждом шаге сохраняется текущее состояние работы и узел выполнения.\n2. Выполняется разрешение перехода к следующему узлу с помощью механизма `_transition_resolver`.\n3. Логируются действия с использованием инструмента `traces`, фиксируя начало нового шага и завершение предыдущего.\n4. Цикл продолжается до тех пор, пока текущий узел не будет равен `None`, что означает завершение всего рабочего процесса.\n\n## Важные детали реализации\n- Метод `run` отвечает за выполнение всей логики управления рабочим процессом, начиная от начала до конца.\n- Состояние выполнения хранится внутри контекста (`context.state`), позволяя сохранять промежуточные результаты и текущие значения переменных.\n- Использование логгера (`logging.getLogger(__name__)`) позволяет централизованно вести журнал всех действий.\n- Сохранение идентификатора текущей операции (`run_id`) в хранилище (`persistence`) позволяет отслеживать выполнение каждого запущенного рабочего процесса.\n- Применение инструментов трассировки (`traces`) помогает мониторить выполнение шагов рабочего процесса, включая шаги перед началом и после завершения этапа.\n\n## Осторожные выводы\nНа основании доступных слоев информации сложно точно определить детальную взаимосвязь с другими компонентами системы через сигнатуру функций и прямые ссылки. Однако косвенные признаки показывают использование стандартных практик и библиотек для логирования и мониторинга, таких как `logging` и `tracing`." - }, - "diagnostics": { - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 780, - "evidence_rows": 13, - "evidence_chars": 4423 - }, - "evidence_summary": [ - { - "layer": "C1_SYMBOL_CATALOG", - "count": 2, - "unique_paths": 2 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "count": 6, - "unique_paths": 1 - }, - { - "layer": "C3_ENTRYPOINTS", - "count": 3, - "unique_paths": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 1, - "unique_paths": 1 - } - ], - "prompt_template_id": "intent_code_qa_explain_ru_v1", - "system_prompt_version": "v1" - }, - "timings_ms": { - "prompt_build": 0, - "llm_call": 3730 - } - } - } - ] - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_115223/full_chain_plba_code_retrieval_plba-fullchain-explain-workflow-engine.md b/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_115223/full_chain_plba_code_retrieval_plba-fullchain-explain-workflow-engine.md deleted file mode 100644 index 46eb788..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_115223/full_chain_plba_code_retrieval_plba-fullchain-explain-workflow-engine.md +++ /dev/null @@ -1,34 +0,0 @@ -# plba-fullchain-explain-workflow-engine - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_retrieval.yaml -- runner: runtime -- mode: full_chain -- passed: True - -## Query -Объясни класс WorkflowEngine - -## Actual -{ - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 13, - "llm_answer": "## Назначение класса `WorkflowEngine`\nКласс `WorkflowEngine` является основным компонентом, отвечающим за выполнение рабочего процесса (`workflow`) приложения. Он управляет последовательностью выполнения этапов (`nodes`), сохраняет состояние выполнения и обеспечивает логирование и отслеживание состояния потока выполнения задач.\n\n## Ключевые зависимости\n- **`workflow`**: объект, описывающий рабочий процесс, состоящий из последовательности узлов и их связей.\n- **`persistence`**: компонент для сохранения текущего состояния выполнения рабочего процесса и метаданных о запуске.\n- **`traces`**: инструмент логирования и трассировки, позволяющий отслеживать ход выполнения задачи.\n- **`hooks`**: дополнительные функции-обработчики событий жизненного цикла рабочего процесса.\n\n## Поток данных или вызовов\n### Инициализация (`__init__`)\nПри создании экземпляра класса происходит инициализация следующих компонентов:\n- Загружается рабочий процесс (`workflow`).\n- Создается механизм разрешения переходов (`_transition_resolver`).\n- Указывается система хранения состояний (`persistence`).\n- Настраивается логирование (`_logger`).\n- Опционально подключаются обработчики дополнительных событий (`hooks`).\n\n### Запуск (`run`)\nПроцесс выполняется пошагово по узлам рабочего процесса (`nodes`):\n1. При каждом шаге сохраняется текущее состояние работы и узел выполнения.\n2. Выполняется разрешение перехода к следующему узлу с помощью механизма `_transition_resolver`.\n3. Логируются действия с использованием инструмента `traces`, фиксируя начало нового шага и завершение предыдущего.\n4. Цикл продолжается до тех пор, пока текущий узел не будет равен `None`, что означает завершение всего рабочего процесса.\n\n## Важные детали реализации\n- Метод `run` отвечает за выполнение всей логики управления рабочим процессом, начиная от начала до конца.\n- Состояние выполнения хранится внутри контекста (`context.state`), позволяя сохранять промежуточные результаты и текущие значения переменных.\n- Использование логгера (`logging.getLogger(__name__)`) позволяет централизованно вести журнал всех действий.\n- Сохранение идентификатора текущей операции (`run_id`) в хранилище (`persistence`) позволяет отслеживать выполнение каждого запущенного рабочего процесса.\n- Применение инструментов трассировки (`traces`) помогает мониторить выполнение шагов рабочего процесса, включая шаги перед началом и после завершения этапа.\n\n## Осторожные выводы\nНа основании доступных слоев информации сложно точно определить детальную взаимосвязь с другими компонентами системы через сигнатуру функций и прямые ссылки. Однако косвенные признаки показывают использование стандартных практик и библиотек для логирования и мониторинга, таких как `logging` и `tracing`.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "WorkflowEngine" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] -} - -## Mismatches -- none \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_115223/summary.md b/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_115223/summary.md deleted file mode 100644 index bc875e6..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain/20260312_115223/summary.md +++ /dev/null @@ -1,24 +0,0 @@ -# pipeline_setup_v2 summary - -Passed: 6/6 - - -| File | Case | Query | Intent | Sub-intent | Pass | -| ----------------------------------- | -------------------------------------------- | ----------------------------------------- | ------- | ---------- | ---- | -| full_chain_plba_code_retrieval.yaml | plba-fullchain-explain-runtime-manager | Объясни как работает класс RuntimeManager | CODE_QA | EXPLAIN | ✓ | -| full_chain_plba_code_retrieval.yaml | plba-fullchain-explain-http-control-channel | Объясни класс HttpControlChannel | CODE_QA | EXPLAIN | ✓ | -| full_chain_plba_code_retrieval.yaml | plba-fullchain-explain-control-plane-service | Объясни класс ControlPlaneService | CODE_QA | EXPLAIN | ✓ | -| full_chain_plba_code_retrieval.yaml | plba-fullchain-explain-trace-service | Как работает TraceService? | CODE_QA | EXPLAIN | ✓ | -| full_chain_plba_code_retrieval.yaml | plba-fullchain-explain-create-runtime | Объясни функцию create_runtime | CODE_QA | EXPLAIN | ✓ | -| full_chain_plba_code_retrieval.yaml | plba-fullchain-explain-workflow-engine | Объясни класс WorkflowEngine | CODE_QA | EXPLAIN | ✓ | - - -## LLM Answers - -- **plba-fullchain-explain-runtime-manager**: ## Назначение класса `RuntimeManager` Класс `RuntimeManager` играет роль менеджера, отвечающего за управление жизненным циклом различных компонентов приложения, таких как конфигурация (`ConfigurationManager`), сервисы (`ServiceContainer`), трассировка событий (`TraceService`), здоровье системы (`HealthRegistry`), логирование (`LogManager`) и мониторинг работы рабочих процессов (`WorkerSupervisor`). Он координирует взаимодействие этих компонентов и управляет их состоянием через методы регистрации, инициализации и мониторинга. ## Ключевые зависимости Ключевыми зависимостями являются следующие классы и сущности: - `ConfigurationManager`: отвечает за хранение и доступ к конфигурации приложения. - `ServiceContainer`: контейнер для хранения и управления сервисами приложения. - `TraceService`: предоставляет возможность отслеживать события выполнения и состояния системы. - `… -- **plba-fullchain-explain-http-control-channel**: ## Объяснение сущности `HttpControlChannel` ### Назначение `HttpControlChannel` — это класс, отвечающий за управление состоянием и взаимодействие с внешним HTTP каналом для контроля приложения. Он служит основным интерфейсом взаимодействия через HTTP-протокол для конфигурации и мониторинга приложения. ### Ключевые зависимости Ключевая зависимость класса — это экземпляр `UvicornThreadRunner`, который запускает сервер для прослушивания HTTP-запросов. Кроме того, используется фабрика `HttpControlAppFactory`, которая отвечает за создание необходимых приложений FastAPI. ### Поток данных или вызовов 1. **Инициализация (`__init__`)**: - При создании экземпляра задаются параметры `host`, `port` и `timeout`. - Создаются внутренние объекты `_runner` и `_factory`. 2. **Запуск (`start`)**: - Вызывается метод фабрики `_factory.create()` для создания FastAPI-приложения. - Запускае… -- **plba-fullchain-explain-control-plane-service**: ## Объяснение работы сущности `ControlPlaneService` ### Назначение `ControlPlaneService` — это служба управления состоянием и взаимодействием различных компонентов системы. Она отвечает за координацию действий между каналами (`ControlChannel`), настройку инициализации системы и ее остановки, а также сбор информации о текущем состоянии для последующего анализа. ### Ключевые зависимости - **RuntimeManager**: объект-менеджер, предоставляющий доступ к различным аспектам состояния и конфигурации запущенной системы. - **ControlChannel**: интерфейс взаимодействия с различными компонентами системы через каналы передачи данных. ### Поток данных или вызовов 1. **Инициализация** (`__init__`) - При создании объекта службы выполняется настройка внутреннего списка каналов `_channels`. 2. **Регистрация канала** (`register_channel`) - Канал добавляется в список внутренних каналов сл… -- **plba-fullchain-explain-trace-service**: ## Объяснение работы `TraceService` ### Назначение `TraceService` — это сервис для управления контекстом трассировки и записи событий трассировки. Он отвечает за создание контекста трассировки, запись сообщений и управление хранилищем трассировок. ### Ключевые зависимости - **TraceContextFactory**: Базовый класс для создания экземпляров, связанных с контекстом трассировки. - **TraceTransport**: Интерфейс для передачи трассировочных данных наружу системы. - **TraceContextStore**: Хранилище для отслеживания состояний трассировки. - **NoOpTraceTransport**: Транспорт по умолчанию, используемый при отсутствии активного транспорта. ### Поток данных или вызовов 1. **Инициализация (`__init__`)** - При создании экземпляра сервиса инициализируются транспорт и хранилище трассировок. Если транспорт или хранилище не предоставлены явно, используются предопределенные значения. 2. *… -- **plba-fullchain-explain-create-runtime**: ## Объяснение функции `create_runtime` ### Назначение Функция `create_runtime` предназначена для инициализации и настройки среды выполнения (`runtime`) приложения Plba. Она выполняет несколько ключевых шагов по настройке и регистрации различных компонентов, необходимых для полноценной работы системы. ### Ключевые зависимости Функция зависит от следующих сущностей и модулей: - **src/plba/bootstrap.py**: основной файл, содержащий реализацию функции `create_runtime`. - **RuntimeManager**: менеджер окружения, используемый для управления конфигурацией и модулями приложения. - **ApplicationModule**: модуль приложения, представляющий собой компонент, регистрируемый менеджером среды выполнения. - **HttpControlChannel**: канал управления HTTP-интерфейсом, обеспечивающий взаимодействие с внешним окружением через HTTP-протокол. ### Поток данных или вызовов 1. Функция принимает… -- **plba-fullchain-explain-workflow-engine**: ## Назначение класса `WorkflowEngine` Класс `WorkflowEngine` является основным компонентом, отвечающим за выполнение рабочего процесса (`workflow`) приложения. Он управляет последовательностью выполнения этапов (`nodes`), сохраняет состояние выполнения и обеспечивает логирование и отслеживание состояния потока выполнения задач. ## Ключевые зависимости - `**workflow`**: объект, описывающий рабочий процесс, состоящий из последовательности узлов и их связей. - `**persistence**`: компонент для сохранения текущего состояния выполнения рабочего процесса и метаданных о запуске. - `**traces**`: инструмент логирования и трассировки, позволяющий отслеживать ход выполнения задачи. - `**hooks**`: дополнительные функции-обработчики событий жизненного цикла рабочего процесса. ## Поток данных или вызовов ### Инициализация (`__init__`) При создании экземпляра класса происходит иници… - diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents/20260312_115642/full_chain_plba_code_subintents_plba-fullchain-architecture-control-plane.json b/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents/20260312_115642/full_chain_plba_code_subintents_plba-fullchain-architecture-control-plane.json deleted file mode 100644 index 91ca7ed..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents/20260312_115642/full_chain_plba_code_subintents_plba-fullchain-architecture-control-plane.json +++ /dev/null @@ -1,1667 +0,0 @@ -{ - "case_id": "plba-fullchain-architecture-control-plane", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_subintents.yaml", - "runner": "runtime", - "mode": "full_chain", - "actual": { - "intent": "PROJECT_MISC", - "sub_intent": "ARCHITECTURE", - "graph_id": "ProjectMiscGraph", - "conversation_mode": "START", - "rag_count": 11, - "llm_answer": "В control plane обычно участвуют следующие компоненты:\n\n1. **Control Action Set** – управляет действиями контроля.\n2. **Runtime Manager** – отвечает за старт и остановку runtime.\n3. **Worker Supervisor** – контролирует жизненный цикл воркеров.\n4. **Log Manager** – применяет и восстанавливает валидные конфигурации логирования.\n5. **Health Registry** – регистрирует состояние здоровья компонентов.\n6. **Workflow Engine** – исполняет бизнес-логику и управление workflow.\n7. **Checkpoint Repository** – сохраняет промежуточные состояния задач.\n8. **MySQL Trace Transport** – транспорт для трассировки событий.\n\nЭти компоненты обеспечивают контроль и управление состоянием системы, выполнение рабочих процессов и мониторинг их здоровья.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "control", - "plane" - ], - "layers": [ - "D1_MODULE_CATALOG", - "D3_SECTION_INDEX", - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS" - ] - }, - "passed": false, - "mismatches": [ - "intent: expected CODE_QA, got PROJECT_MISC", - "graph_id: expected CodeQAGraph, got ProjectMiscGraph", - "layers should include 'C4_SEMANTIC_ROLES', got ['D1_MODULE_CATALOG', 'D3_SECTION_INDEX', 'C1_SYMBOL_CATALOG', 'C0_SOURCE_CHUNKS']", - "layers should include 'C2_DEPENDENCY_GRAPH', got ['D1_MODULE_CATALOG', 'D3_SECTION_INDEX', 'C1_SYMBOL_CATALOG', 'C0_SOURCE_CHUNKS']", - "layers should include 'C3_ENTRYPOINTS', got ['D1_MODULE_CATALOG', 'D3_SECTION_INDEX', 'C1_SYMBOL_CATALOG', 'C0_SOURCE_CHUNKS']" - ], - "details": { - "case_id": "plba-fullchain-architecture-control-plane", - "text": "Какие компоненты участвуют в control plane?", - "mode": "full_chain", - "run_started_at": "2026-03-12T11:56:42", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "PROJECT_MISC", - "graph_id": "ProjectMiscGraph", - "conversation_mode": "START", - "query": "Какие компоненты участвуют в control plane?", - "symbol_resolution": { - "status": "not_found", - "resolved_symbol": null, - "alternatives": [ - "ControlActionSet" - ], - "confidence": 0.0 - }, - "rag_count": 11, - "rag_rows": [ - { - "path": "web/control-ui/app.js", - "content": "const API_HEADERS = {\n \"X-Client-Source\": \"web-ui\",\n};\n\nconst stateEl = document.getElementById(\"runtime-state\");\nconst healthEl = document.getElementById(\"health-status\");\nconst detailEl = document.getElementById(\"health-detail\");\nconst updateEl = document.getElementById(\"last-update\");\nconst detailsEl = document.getElementById(\"details\");\nconst componentsEl = document.getElementById(\"components\");\nconst startBtn = document.getElementById(\"start-btn\");\nconst stopBtn = document.getElementById(\"stop-btn\");\nconst refreshBtn = document.getElementById(\"refresh-btn\");\n\nlet pollingTimer = null;\nlet actionInProgress = false;\n\nfunction setStateValue(element, value) {\n element.className = `value ${String(value || \"unknown\")}`;\n element.textContent = String(value || \"unknown\");\n}\n\nfunction setBusy(isBusy) {\n actionInProgress = isBusy;\n startBtn.disabled = isBusy;\n stopBtn.disabled = isBusy;\n refreshBtn.disabled = isBusy;\n}\n\nfunction showDetails(payload) {\n detailsEl.textContent = JSON.stringify(payload, null, 2);\n}\n\nfunction showComponents(components) {\n if (!Array.isArray(components) || components.length === 0) {\n componentsEl.innerHTML = '
Компоненты не вернулись в ответе health.
';\n return;\n }\n\n const cards = components\n .map((component) => {\n const name = String(component.name || \"unknown\");\n const status = String(component.status || \"unknown\");\n const detail = String(component.detail || \"-\");\n const critical = component.critical === true ? \"yes\" : \"no\";\n const meta = component.meta || {};\n const metaJson = JSON.stringify(meta, null, 2);\n return `\n
\n
\n ${name}\n ${status}\n
\n
\n critical\n ${critical}\n
\n
\n detail\n ${detail}\n
\n
${metaJson}
\n
\n `;\n })\n .join(\"\");\n\n componentsEl.innerHTML = cards;\n}\n\nasync function fetchJson(path, method = \"GET\") {\n const response = await fetch(`/api${path}`, {\n method,\n headers: API_HEADERS,\n });\n const payload = await response.json();\n return { status: response.status, payload };\n}\n\nasync function refreshStatus() {\n try {\n const { payload } = await fetchJson(\"/health\");\n setStateValue(stateEl, payload.state);\n setStateValue(healthEl, payload.status);\n detailEl.textContent = String(payload.detail || \"-\");\n updateEl.textContent = new Date().toLocaleTimeString();\n showComponents(payload.components || []);\n showDetails(payload);\n } catch (error) {\n setStateValue(stateEl, \"unknown\");\n setStateValue(healthEl, \"unknown\");\n detailEl.textContent = String(error);\n showComponents([]);\n showDetails({ status: \"error\", detail: String(error) });\n }\n}\n\nasync function runAction(action) {\n if (actionInProgress) {\n return;\n }\n setBusy(true);\n try {\n const result = await fetchJson(`/actions/${action}`, \"POST\");\n showDetails(result.payload);\n } catch (error) {\n showDetails({ status: \"error\", detail: String(error) });\n } finally {\n await refreshStatus();\n setBusy(false);\n }\n}\n\nstartBtn.addEventListener(\"click\", () => runAction(\"start\"));\nstopBtn.addEventListener(\"click\", () => runAction(\"stop\"));\nrefreshBtn.addEventListener(\"click\", refreshStatus);\n\nasync function startPolling() {\n await refreshStatus();\n if (pollingTimer !== null) {\n clearInterval(pollingTimer);\n }\n pollingTimer = setInterval(refreshStatus, 2000);\n}\n\nstartPolling();", - "layer": "D3_SECTION_INDEX", - "title": "web/control-ui/app.js:Document", - "span_start": null, - "span_end": null, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "module_id": "web/control-ui/app.js", - "type": null, - "domain": null, - "tags": [], - "section_path": "Document", - "section_title": "Document", - "order": 0, - "doc_kind": "misc", - "source_path": "web/control-ui/app.js", - "artifact_type": null, - "blob_sha": "2d1a28f2b6016e1efcdf652e0ebcdad008700a06e77f58e802a29be3210d628d", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "deploy/docker-compose.control-ui.yml", - "content": "services:\n app:\n image: mail_order_bot_v2:latest\n environment:\n PLBA_CONTROL_HOST: \"0.0.0.0\"\n PLBA_CONTROL_PORT: \"8080\"\n expose:\n - \"8080\"\n networks:\n - plba_net\n\n control_ui:\n image: nginx:1.27-alpine\n depends_on:\n - app\n ports:\n - \"15000:15000\"\n volumes:\n - ./deploy/nginx/plba-control-ui.conf:/etc/nginx/conf.d/default.conf:ro\n - ./web/control-ui:/usr/share/nginx/html:ro\n networks:\n - plba_net\n\nnetworks:\n plba_net:", - "layer": "D3_SECTION_INDEX", - "title": "deploy/docker-compose.control-ui.yml:Document", - "span_start": null, - "span_end": null, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "module_id": "deploy/docker-compose.control-ui.yml", - "type": null, - "domain": null, - "tags": [], - "section_path": "Document", - "section_title": "Document", - "order": 0, - "doc_kind": "misc", - "source_path": "deploy/docker-compose.control-ui.yml", - "artifact_type": null, - "blob_sha": "9b086df090fc407dbc6c86355f94030c8f864c1987d58b6ea6a82ab4236f74cc", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "README.md", - "content": "- Назначение: применение и восстановление валидной конфигурации логирования.\n- Реализация: `LogManager`.\n- Как работает / API / вызовы / таблицы:\n - API: `apply_config(config)`.\n - `RuntimeManager.start()` вызывает `logs.apply_config(config)`.\n - Если секция `log` некорректна, сервис пытается восстановить предыдущую валидную конфигурацию.\n - В БД не пишет.\n- Типовая схема использования:\n - Передать `log` секцию в конфиг и запускать runtime стандартно через `start()`.", - "layer": "D3_SECTION_INDEX", - "title": "README.md:Logging", - "span_start": null, - "span_end": null, - "lexical_rank": 6, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "module_id": "README.md", - "type": null, - "domain": null, - "tags": [], - "section_path": "PLBA > 4. Описание компонентов > 4.2 Service модули > Logging", - "section_title": "Logging", - "order": 12, - "doc_kind": "readme", - "source_path": "README.md", - "artifact_type": null, - "blob_sha": "be28dbd7117896c754f2c6c5d21a2be36cad3c090dc813a538af5d378f426d77", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "README.md", - "content": "- Назначение: runtime-исполнение бизнес-активности, управление lifecycle, интерпретация health/status.\n- Реализация: контракт `app_runtime.contracts.worker.Worker`, оркестрация через `app_runtime.workers.supervisor.WorkerSupervisor`.\n- Как работает / API / вызовы / таблицы:\n - API: `start()`, `stop(force=False)`, `health() -> WorkerHealth`, `status() -> WorkerStatus`, свойства `name`, `critical`.\n - `WorkerSupervisor.start()` запускает все воркеры, `stop()` останавливает и ждет state=`stopped`.\n - `RuntimeManager` получает агрегированные `statuses()`/`healths()` у супервизора.\n - В БД напрямую не пишет (если прикладной worker сам не реализует persistence).\n- Типовая схема использования:\n - Внутри `start()` поднимать поток/пул или запускать одноразовую задачу.\n - В цикле вызывать `routine.run()`.\n - Ошибки бизнес-логики транслировать в `health()`/`status()`.", - "layer": "D3_SECTION_INDEX", - "title": "README.md:Worker", - "span_start": null, - "span_end": null, - "lexical_rank": 6, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "module_id": "README.md", - "type": null, - "domain": null, - "tags": [], - "section_path": "PLBA > 4. Описание компонентов > 4.1 Core модули > Worker", - "section_title": "Worker", - "order": 8, - "doc_kind": "readme", - "source_path": "README.md", - "artifact_type": null, - "blob_sha": "be28dbd7117896c754f2c6c5d21a2be36cad3c090dc813a538af5d378f426d77", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "README.md", - "content": "```mermaid\nclassDiagram\n class ApplicationModule {\n <>\n +name: str\n +register(registry)\n }\n class ModuleRegistry {\n +add_worker(worker)\n +add_health_contributor(contributor)\n +register_module(name)\n }\n class RuntimeManager {\n +register_module(module)\n +add_config_file(path)\n +start()\n +stop(timeout, force)\n +status()\n +current_health()\n }\n class WorkerSupervisor {\n +register(worker)\n +start()\n +stop(timeout, force)\n +statuses()\n +healths()\n }\n class Worker {\n <>\n +name: str\n +critical: bool\n +start()\n +stop(force)\n +health()\n +status()\n }\n class Routine {\n <>\n +run()\n }\n\n class ConfigurationManager\n class LogManager\n class HealthRegistry\n class TraceService\n class ControlPlaneService\n class WorkflowRuntimeFactory\n class WorkflowEngine\n class WorkflowPersistence\n class WorkflowRepository\n class CheckpointRepository\n class InMemoryTaskQueue\n class MySqlTraceTransport\n\n ApplicationModule --> ModuleRegistry : register(...)\n RuntimeManager --> ApplicationModule : register_module(...)\n RuntimeManager --> ModuleRegistry\n RuntimeManager --> ConfigurationManager\n RuntimeManager --> LogManager\n RuntimeManager --> HealthRegistry\n RuntimeManager --> TraceService\n RuntimeManager --> WorkerSupervisor\n RuntimeManager --> ControlPlaneService\n\n WorkerSupervisor --> Worker\n Worker --> Routine : invokes\n\n WorkflowRuntimeFactory --> WorkflowEngine : create_engine(...)\n WorkflowEngine --> WorkflowPersistence\n WorkflowPersistence --> WorkflowRepository\n WorkflowPersistence --> CheckpointRepository\n\n TraceService --> MySqlTraceTransport\n```", - "layer": "D3_SECTION_INDEX", - "title": "README.md:3. Архитектура", - "span_start": null, - "span_end": null, - "lexical_rank": 6, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "module_id": "README.md", - "type": null, - "domain": null, - "tags": [], - "section_path": "PLBA > 3. Архитектура", - "section_title": "3. Архитектура", - "order": 4, - "doc_kind": "readme", - "source_path": "README.md", - "artifact_type": null, - "blob_sha": "be28dbd7117896c754f2c6c5d21a2be36cad3c090dc813a538af5d378f426d77", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "README.md", - "content": "`ApplicationModule` - точка сборки приложения: здесь создаются зависимости, собираются рутины, создаются воркеры и регистрируются дополнительные health-контрибьюторы.\n\n`Worker` - основной runtime-контракт платформы: он управляет исполнением (потоки, цикл, стратегия остановки), возвращает `health()` и `status()`, а также определяет критичность компонента для общего health.\n\n`Routine` - прикладной паттерн (не обязательный контракт платформы): класс или набор классов, где сосредоточена бизнес-логика, которую воркер регулярно или однократно запускает.\n\nВспомогательные сервисы платформы дополняют core-модель:\n- `tracing` (`TraceService`, транспорты) - операционная трассировка контекстов и сообщений.\n- `logging` (`LogManager`) - применение конфигурации логирования из runtime-конфига.\n- `health` (`HealthRegistry`) - агрегирование здоровья воркеров и дополнительных компонентов.\n- `workflow` (`WorkflowEngine` и persistence-слой) - исполнение шагов бизнес-процесса с переходами и фиксацией состояния.\n- `control plane` (`ControlPlaneService`, `HttpControlChannel`) - внешние health/action endpoints.\n- `queue` (`InMemoryTaskQueue`) - локальный in-memory буфер как утилита прикладного уровня.", - "layer": "D3_SECTION_INDEX", - "title": "README.md:2. Концепция использования", - "span_start": null, - "span_end": null, - "lexical_rank": 6, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "module_id": "README.md", - "type": null, - "domain": null, - "tags": [], - "section_path": "PLBA > 2. Концепция использования", - "section_title": "2. Концепция использования", - "order": 3, - "doc_kind": "readme", - "source_path": "README.md", - "artifact_type": null, - "blob_sha": "be28dbd7117896c754f2c6c5d21a2be36cad3c090dc813a538af5d378f426d77", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "class ControlActionSet\nControlActionSet", - "layer": "C1_SYMBOL_CATALOG", - "title": "ControlActionSet", - "span_start": 14, - "span_end": 18, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "46eb026cb3313415ec47b82dd22f84f4d112c9d987e8b1716dcb0baa1cce8988", - "qname": "ControlActionSet", - "kind": "class", - "signature": "ControlActionSet", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.control.base", - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/__init__.py", - "content": "from app_runtime.control.base import ControlActionSet, ControlChannel\nfrom app_runtime.control.http_channel import HttpControlChannel\nfrom app_runtime.control.service import ControlPlaneService\n\n__all__ = [\"ControlActionSet\", \"ControlChannel\", \"ControlPlaneService\", \"HttpControlChannel\"]", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/__init__.py:1-5", - "span_start": 1, - "span_end": 5, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.app_runtime.control.__init__", - "is_test": false, - "blob_sha": "bf3c37e3369a84cc618adc0fd71c232e5eb4b871eaff743069a17e661e498316", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "class ControlChannel(ABC):\n @abstractmethod\n async def start(self, actions: ControlActionSet) -> None:\n \"\"\"Start the control channel and bind handlers.\"\"\"\n\n @abstractmethod\n async def stop(self) -> None:\n \"\"\"Stop the control channel and release resources.\"\"\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/base.py:ControlChannel", - "span_start": 21, - "span_end": 28, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 1, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.base", - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "class ControlActionSet:\n health: HealthHandler\n start: ActionHandler\n stop: ActionHandler\n status: ActionHandler", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/base.py:ControlActionSet", - "span_start": 14, - "span_end": 18, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.base", - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "class HttpControlAppFactory:\n def create(\n self,\n health_provider: Callable[[], Awaitable[HealthPayload]],\n action_provider: Callable[[str, str], Awaitable[JSONResponse]],\n ) -> FastAPI:\n app = FastAPI(title=\"PLBA Control API\")\n\n @app.middleware(\"http\")\n async def log_api_call(request: Request, call_next): # type: ignore[no-untyped-def]\n started = time.monotonic()\n response = await call_next(request)\n response.headers[\"X-Response-Time-Ms\"] = str(int((time.monotonic() - started) * 1000))\n return response\n\n @app.get(\"/health\")\n async def health() -> JSONResponse:\n payload = await health_provider()\n status_code = 200 if payload.get(\"status\") == \"ok\" else 503\n return JSONResponse(content=payload, status_code=status_code)\n\n @app.get(\"/actions/{action}\")\n @app.post(\"/actions/{action}\")\n async def action(action: str, request: Request) -> JSONResponse:\n client_source = self._client_source(request)\n if action in {\"start\", \"stop\"}:\n LOGGER.warning(\"Control action requested: /actions/%s client=%s\", action, client_source)\n return await action_provider(action, client_source)\n\n return app\n\n def _client_source(self, request: Request) -> str:\n explicit_header = request.headers.get(\"X-Client-Source\", \"\").strip()\n if explicit_header:\n return explicit_header\n user_agent = request.headers.get(\"User-Agent\", \"\").strip()\n if user_agent:\n return f\"user-agent:{user_agent}\"\n return \"unknown\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/http_app.py:HttpControlAppFactory", - "span_start": 15, - "span_end": 53, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.http_app", - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "llm_answer": "В control plane обычно участвуют следующие компоненты:\n\n1. **Control Action Set** – управляет действиями контроля.\n2. **Runtime Manager** – отвечает за старт и остановку runtime.\n3. **Worker Supervisor** – контролирует жизненный цикл воркеров.\n4. **Log Manager** – применяет и восстанавливает валидные конфигурации логирования.\n5. **Health Registry** – регистрирует состояние здоровья компонентов.\n6. **Workflow Engine** – исполняет бизнес-логику и управление workflow.\n7. **Checkpoint Repository** – сохраняет промежуточные состояния задач.\n8. **MySQL Trace Transport** – транспорт для трассировки событий.\n\nЭти компоненты обеспечивают контроль и управление состоянием системы, выполнение рабочих процессов и мониторинг их здоровья.", - "summary": { - "router": { - "intent": "PROJECT_MISC", - "sub_intent": "ARCHITECTURE", - "confidence": null - }, - "retrieval": { - "profile": "code", - "layers_hit": [ - "C0_SOURCE_CHUNKS", - "C1_SYMBOL_CATALOG", - "D3_SECTION_INDEX" - ], - "evidence_sufficient": true - }, - "llm": { - "answer_status": "answered", - "groundedness": "grounded" - } - }, - "diagnostics": { - "router_plan": { - "intent": "PROJECT_MISC", - "sub_intent": "ARCHITECTURE", - "graph_id": "ProjectMiscGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "D1_MODULE_CATALOG", - "D3_SECTION_INDEX", - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS" - ], - "symbol_kind_hint": "unknown", - "symbol_candidates": [ - "control", - "plane" - ], - "keyword_hints": [ - "control", - "plane" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "execution": { - "executed_layers": [ - "D1_MODULE_CATALOG", - "D3_SECTION_INDEX", - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS" - ], - "retrieval_mode_by_layer": { - "D1_MODULE_CATALOG": "vector", - "D3_SECTION_INDEX": "vector", - "C1_SYMBOL_CATALOG": "symbol_search", - "C0_SOURCE_CHUNKS": "exact_path_fetch" - }, - "top_k_by_layer": { - "D1_MODULE_CATALOG": 4, - "D3_SECTION_INDEX": 6, - "C1_SYMBOL_CATALOG": 4, - "C0_SOURCE_CHUNKS": 4 - }, - "filters_by_layer": { - "D1_MODULE_CATALOG": { - "path_scope": [], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "D3_SECTION_INDEX": { - "path_scope": [], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C1_SYMBOL_CATALOG": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "D1_MODULE_CATALOG", - "query": "Какие компоненты участвуют в control plane?", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 4, - "ranking_profile": "project" - }, - { - "layer": "D3_SECTION_INDEX", - "query": "Какие компоненты участвуют в control plane?", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "project" - }, - { - "layer": "C1_SYMBOL_CATALOG", - "query": "control plane", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 4, - "ranking_profile": "project" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Какие компоненты участвуют в control plane?", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 4, - "ranking_profile": "project" - } - ], - "applied": [ - { - "layer": "D1_MODULE_CATALOG", - "effective_path_scope": [], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 0, - "candidates_after_filter": 0 - }, - { - "layer": "D3_SECTION_INDEX", - "effective_path_scope": [], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 6, - "candidates_after_filter": 6 - }, - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 1, - "candidates_after_filter": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 4, - "candidates_after_filter": 4 - } - ], - "fallback": { - "used": true, - "reason": "scope_relaxed" - }, - "symbol_resolution": { - "status": "not_found", - "resolved_symbol": null, - "alternatives": [ - "ControlActionSet" - ] - }, - "layers": [ - { - "layer": "D1_MODULE_CATALOG", - "status": "miss", - "hit_count": 0, - "fail_reason": "scope_relaxed" - }, - { - "layer": "D3_SECTION_INDEX", - "status": "hit", - "hit_count": 6, - "fail_reason": null - }, - { - "layer": "C1_SYMBOL_CATALOG", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 4, - "fail_reason": null - } - ] - }, - "constraint_violations": [ - { - "type": "LAYER_MISSING", - "severity": "warn", - "details": { - "layer": "D1_MODULE_CATALOG", - "requested_layers": [ - "D1_MODULE_CATALOG", - "D3_SECTION_INDEX", - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS" - ] - }, - "suggested_fix": "Increase top_k for this layer or relax constraints for retrieval." - } - ], - "timings_ms": { - "router": 2, - "symbol_resolution": 0, - "retrieval_total": 131, - "retrieval_by_layer": { - "D1_MODULE_CATALOG": 49, - "D3_SECTION_INDEX": 39, - "C1_SYMBOL_CATALOG": 27, - "C0_SOURCE_CHUNKS": 15 - }, - "merge_rank": 0, - "prompt_build": 0, - "llm_call": 1266 - }, - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 1377, - "evidence_rows": 11, - "evidence_chars": 11095 - }, - "evidence_summary": [ - { - "layer": "D3_SECTION_INDEX", - "count": 6, - "unique_paths": 3 - }, - { - "layer": "C1_SYMBOL_CATALOG", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 4, - "unique_paths": 3 - } - ], - "prompt_template_id": "intent_project_misc_v1", - "system_prompt_version": "v1" - }, - "router": { - "conversation_mode": "START", - "keyword_hints": [ - "control", - "plane" - ], - "path_scope": [] - }, - "llm": { - "used_evidence_count": 11, - "missing_evidence_reason": null - } - }, - "run_info": { - "case_id": "plba-fullchain-architecture-control-plane", - "mode": "full_chain", - "run_started_at": "2026-03-12T11:56:42", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "PROJECT_MISC", - "graph_id": "ProjectMiscGraph", - "conversation_mode": "START" - }, - "input_request": { - "text": "Какие компоненты участвуют в control plane?", - "normalized_query": "Какие компоненты участвуют в control plane?" - }, - "steps": [ - { - "step": "intent_router", - "input": { - "query": "Какие компоненты участвуют в control plane?" - }, - "output": { - "intent": "PROJECT_MISC", - "graph_id": "ProjectMiscGraph", - "conversation_mode": "START", - "query": "Какие компоненты участвуют в control plane?" - }, - "diagnostics": { - "router_plan": { - "intent": "PROJECT_MISC", - "sub_intent": "ARCHITECTURE", - "graph_id": "ProjectMiscGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "D1_MODULE_CATALOG", - "D3_SECTION_INDEX", - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS" - ], - "symbol_kind_hint": "unknown", - "symbol_candidates": [ - "control", - "plane" - ], - "keyword_hints": [ - "control", - "plane" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "timings_ms": { - "router": 2 - } - } - }, - { - "step": "retrieval", - "input": { - "query": "Какие компоненты участвуют в control plane?" - }, - "output": { - "symbol_resolution": { - "status": "not_found", - "resolved_symbol": null, - "alternatives": [ - "ControlActionSet" - ], - "confidence": 0.0 - }, - "rag_count": 11, - "rag_rows": [ - { - "path": "web/control-ui/app.js", - "content": "const API_HEADERS = {\n \"X-Client-Source\": \"web-ui\",\n};\n\nconst stateEl = document.getElementById(\"runtime-state\");\nconst healthEl = document.getElementById(\"health-status\");\nconst detailEl = document.getElementById(\"health-detail\");\nconst updateEl = document.getElementById(\"last-update\");\nconst detailsEl = document.getElementById(\"details\");\nconst componentsEl = document.getElementById(\"components\");\nconst startBtn = document.getElementById(\"start-btn\");\nconst stopBtn = document.getElementById(\"stop-btn\");\nconst refreshBtn = document.getElementById(\"refresh-btn\");\n\nlet pollingTimer = null;\nlet actionInProgress = false;\n\nfunction setStateValue(element, value) {\n element.className = `value ${String(value || \"unknown\")}`;\n element.textContent = String(value || \"unknown\");\n}\n\nfunction setBusy(isBusy) {\n actionInProgress = isBusy;\n startBtn.disabled = isBusy;\n stopBtn.disabled = isBusy;\n refreshBtn.disabled = isBusy;\n}\n\nfunction showDetails(payload) {\n detailsEl.textContent = JSON.stringify(payload, null, 2);\n}\n\nfunction showComponents(components) {\n if (!Array.isArray(components) || components.length === 0) {\n componentsEl.innerHTML = '
Компоненты не вернулись в ответе health.
';\n return;\n }\n\n const cards = components\n .map((component) => {\n const name = String(component.name || \"unknown\");\n const status = String(component.status || \"unknown\");\n const detail = String(component.detail || \"-\");\n const critical = component.critical === true ? \"yes\" : \"no\";\n const meta = component.meta || {};\n const metaJson = JSON.stringify(meta, null, 2);\n return `\n
\n
\n ${name}\n ${status}\n
\n
\n critical\n ${critical}\n
\n
\n detail\n ${detail}\n
\n
${metaJson}
\n
\n `;\n })\n .join(\"\");\n\n componentsEl.innerHTML = cards;\n}\n\nasync function fetchJson(path, method = \"GET\") {\n const response = await fetch(`/api${path}`, {\n method,\n headers: API_HEADERS,\n });\n const payload = await response.json();\n return { status: response.status, payload };\n}\n\nasync function refreshStatus() {\n try {\n const { payload } = await fetchJson(\"/health\");\n setStateValue(stateEl, payload.state);\n setStateValue(healthEl, payload.status);\n detailEl.textContent = String(payload.detail || \"-\");\n updateEl.textContent = new Date().toLocaleTimeString();\n showComponents(payload.components || []);\n showDetails(payload);\n } catch (error) {\n setStateValue(stateEl, \"unknown\");\n setStateValue(healthEl, \"unknown\");\n detailEl.textContent = String(error);\n showComponents([]);\n showDetails({ status: \"error\", detail: String(error) });\n }\n}\n\nasync function runAction(action) {\n if (actionInProgress) {\n return;\n }\n setBusy(true);\n try {\n const result = await fetchJson(`/actions/${action}`, \"POST\");\n showDetails(result.payload);\n } catch (error) {\n showDetails({ status: \"error\", detail: String(error) });\n } finally {\n await refreshStatus();\n setBusy(false);\n }\n}\n\nstartBtn.addEventListener(\"click\", () => runAction(\"start\"));\nstopBtn.addEventListener(\"click\", () => runAction(\"stop\"));\nrefreshBtn.addEventListener(\"click\", refreshStatus);\n\nasync function startPolling() {\n await refreshStatus();\n if (pollingTimer !== null) {\n clearInterval(pollingTimer);\n }\n pollingTimer = setInterval(refreshStatus, 2000);\n}\n\nstartPolling();", - "layer": "D3_SECTION_INDEX", - "title": "web/control-ui/app.js:Document", - "span_start": null, - "span_end": null, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "module_id": "web/control-ui/app.js", - "type": null, - "domain": null, - "tags": [], - "section_path": "Document", - "section_title": "Document", - "order": 0, - "doc_kind": "misc", - "source_path": "web/control-ui/app.js", - "artifact_type": null, - "blob_sha": "2d1a28f2b6016e1efcdf652e0ebcdad008700a06e77f58e802a29be3210d628d", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "deploy/docker-compose.control-ui.yml", - "content": "services:\n app:\n image: mail_order_bot_v2:latest\n environment:\n PLBA_CONTROL_HOST: \"0.0.0.0\"\n PLBA_CONTROL_PORT: \"8080\"\n expose:\n - \"8080\"\n networks:\n - plba_net\n\n control_ui:\n image: nginx:1.27-alpine\n depends_on:\n - app\n ports:\n - \"15000:15000\"\n volumes:\n - ./deploy/nginx/plba-control-ui.conf:/etc/nginx/conf.d/default.conf:ro\n - ./web/control-ui:/usr/share/nginx/html:ro\n networks:\n - plba_net\n\nnetworks:\n plba_net:", - "layer": "D3_SECTION_INDEX", - "title": "deploy/docker-compose.control-ui.yml:Document", - "span_start": null, - "span_end": null, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "module_id": "deploy/docker-compose.control-ui.yml", - "type": null, - "domain": null, - "tags": [], - "section_path": "Document", - "section_title": "Document", - "order": 0, - "doc_kind": "misc", - "source_path": "deploy/docker-compose.control-ui.yml", - "artifact_type": null, - "blob_sha": "9b086df090fc407dbc6c86355f94030c8f864c1987d58b6ea6a82ab4236f74cc", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "README.md", - "content": "- Назначение: применение и восстановление валидной конфигурации логирования.\n- Реализация: `LogManager`.\n- Как работает / API / вызовы / таблицы:\n - API: `apply_config(config)`.\n - `RuntimeManager.start()` вызывает `logs.apply_config(config)`.\n - Если секция `log` некорректна, сервис пытается восстановить предыдущую валидную конфигурацию.\n - В БД не пишет.\n- Типовая схема использования:\n - Передать `log` секцию в конфиг и запускать runtime стандартно через `start()`.", - "layer": "D3_SECTION_INDEX", - "title": "README.md:Logging", - "span_start": null, - "span_end": null, - "lexical_rank": 6, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "module_id": "README.md", - "type": null, - "domain": null, - "tags": [], - "section_path": "PLBA > 4. Описание компонентов > 4.2 Service модули > Logging", - "section_title": "Logging", - "order": 12, - "doc_kind": "readme", - "source_path": "README.md", - "artifact_type": null, - "blob_sha": "be28dbd7117896c754f2c6c5d21a2be36cad3c090dc813a538af5d378f426d77", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "README.md", - "content": "- Назначение: runtime-исполнение бизнес-активности, управление lifecycle, интерпретация health/status.\n- Реализация: контракт `app_runtime.contracts.worker.Worker`, оркестрация через `app_runtime.workers.supervisor.WorkerSupervisor`.\n- Как работает / API / вызовы / таблицы:\n - API: `start()`, `stop(force=False)`, `health() -> WorkerHealth`, `status() -> WorkerStatus`, свойства `name`, `critical`.\n - `WorkerSupervisor.start()` запускает все воркеры, `stop()` останавливает и ждет state=`stopped`.\n - `RuntimeManager` получает агрегированные `statuses()`/`healths()` у супервизора.\n - В БД напрямую не пишет (если прикладной worker сам не реализует persistence).\n- Типовая схема использования:\n - Внутри `start()` поднимать поток/пул или запускать одноразовую задачу.\n - В цикле вызывать `routine.run()`.\n - Ошибки бизнес-логики транслировать в `health()`/`status()`.", - "layer": "D3_SECTION_INDEX", - "title": "README.md:Worker", - "span_start": null, - "span_end": null, - "lexical_rank": 6, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "module_id": "README.md", - "type": null, - "domain": null, - "tags": [], - "section_path": "PLBA > 4. Описание компонентов > 4.1 Core модули > Worker", - "section_title": "Worker", - "order": 8, - "doc_kind": "readme", - "source_path": "README.md", - "artifact_type": null, - "blob_sha": "be28dbd7117896c754f2c6c5d21a2be36cad3c090dc813a538af5d378f426d77", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "README.md", - "content": "```mermaid\nclassDiagram\n class ApplicationModule {\n <>\n +name: str\n +register(registry)\n }\n class ModuleRegistry {\n +add_worker(worker)\n +add_health_contributor(contributor)\n +register_module(name)\n }\n class RuntimeManager {\n +register_module(module)\n +add_config_file(path)\n +start()\n +stop(timeout, force)\n +status()\n +current_health()\n }\n class WorkerSupervisor {\n +register(worker)\n +start()\n +stop(timeout, force)\n +statuses()\n +healths()\n }\n class Worker {\n <>\n +name: str\n +critical: bool\n +start()\n +stop(force)\n +health()\n +status()\n }\n class Routine {\n <>\n +run()\n }\n\n class ConfigurationManager\n class LogManager\n class HealthRegistry\n class TraceService\n class ControlPlaneService\n class WorkflowRuntimeFactory\n class WorkflowEngine\n class WorkflowPersistence\n class WorkflowRepository\n class CheckpointRepository\n class InMemoryTaskQueue\n class MySqlTraceTransport\n\n ApplicationModule --> ModuleRegistry : register(...)\n RuntimeManager --> ApplicationModule : register_module(...)\n RuntimeManager --> ModuleRegistry\n RuntimeManager --> ConfigurationManager\n RuntimeManager --> LogManager\n RuntimeManager --> HealthRegistry\n RuntimeManager --> TraceService\n RuntimeManager --> WorkerSupervisor\n RuntimeManager --> ControlPlaneService\n\n WorkerSupervisor --> Worker\n Worker --> Routine : invokes\n\n WorkflowRuntimeFactory --> WorkflowEngine : create_engine(...)\n WorkflowEngine --> WorkflowPersistence\n WorkflowPersistence --> WorkflowRepository\n WorkflowPersistence --> CheckpointRepository\n\n TraceService --> MySqlTraceTransport\n```", - "layer": "D3_SECTION_INDEX", - "title": "README.md:3. Архитектура", - "span_start": null, - "span_end": null, - "lexical_rank": 6, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "module_id": "README.md", - "type": null, - "domain": null, - "tags": [], - "section_path": "PLBA > 3. Архитектура", - "section_title": "3. Архитектура", - "order": 4, - "doc_kind": "readme", - "source_path": "README.md", - "artifact_type": null, - "blob_sha": "be28dbd7117896c754f2c6c5d21a2be36cad3c090dc813a538af5d378f426d77", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "README.md", - "content": "`ApplicationModule` - точка сборки приложения: здесь создаются зависимости, собираются рутины, создаются воркеры и регистрируются дополнительные health-контрибьюторы.\n\n`Worker` - основной runtime-контракт платформы: он управляет исполнением (потоки, цикл, стратегия остановки), возвращает `health()` и `status()`, а также определяет критичность компонента для общего health.\n\n`Routine` - прикладной паттерн (не обязательный контракт платформы): класс или набор классов, где сосредоточена бизнес-логика, которую воркер регулярно или однократно запускает.\n\nВспомогательные сервисы платформы дополняют core-модель:\n- `tracing` (`TraceService`, транспорты) - операционная трассировка контекстов и сообщений.\n- `logging` (`LogManager`) - применение конфигурации логирования из runtime-конфига.\n- `health` (`HealthRegistry`) - агрегирование здоровья воркеров и дополнительных компонентов.\n- `workflow` (`WorkflowEngine` и persistence-слой) - исполнение шагов бизнес-процесса с переходами и фиксацией состояния.\n- `control plane` (`ControlPlaneService`, `HttpControlChannel`) - внешние health/action endpoints.\n- `queue` (`InMemoryTaskQueue`) - локальный in-memory буфер как утилита прикладного уровня.", - "layer": "D3_SECTION_INDEX", - "title": "README.md:2. Концепция использования", - "span_start": null, - "span_end": null, - "lexical_rank": 6, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "module_id": "README.md", - "type": null, - "domain": null, - "tags": [], - "section_path": "PLBA > 2. Концепция использования", - "section_title": "2. Концепция использования", - "order": 3, - "doc_kind": "readme", - "source_path": "README.md", - "artifact_type": null, - "blob_sha": "be28dbd7117896c754f2c6c5d21a2be36cad3c090dc813a538af5d378f426d77", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "class ControlActionSet\nControlActionSet", - "layer": "C1_SYMBOL_CATALOG", - "title": "ControlActionSet", - "span_start": 14, - "span_end": 18, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "46eb026cb3313415ec47b82dd22f84f4d112c9d987e8b1716dcb0baa1cce8988", - "qname": "ControlActionSet", - "kind": "class", - "signature": "ControlActionSet", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.control.base", - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/__init__.py", - "content": "from app_runtime.control.base import ControlActionSet, ControlChannel\nfrom app_runtime.control.http_channel import HttpControlChannel\nfrom app_runtime.control.service import ControlPlaneService\n\n__all__ = [\"ControlActionSet\", \"ControlChannel\", \"ControlPlaneService\", \"HttpControlChannel\"]", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/__init__.py:1-5", - "span_start": 1, - "span_end": 5, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.app_runtime.control.__init__", - "is_test": false, - "blob_sha": "bf3c37e3369a84cc618adc0fd71c232e5eb4b871eaff743069a17e661e498316", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "class ControlChannel(ABC):\n @abstractmethod\n async def start(self, actions: ControlActionSet) -> None:\n \"\"\"Start the control channel and bind handlers.\"\"\"\n\n @abstractmethod\n async def stop(self) -> None:\n \"\"\"Stop the control channel and release resources.\"\"\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/base.py:ControlChannel", - "span_start": 21, - "span_end": 28, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 1, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.base", - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "class ControlActionSet:\n health: HealthHandler\n start: ActionHandler\n stop: ActionHandler\n status: ActionHandler", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/base.py:ControlActionSet", - "span_start": 14, - "span_end": 18, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.base", - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "class HttpControlAppFactory:\n def create(\n self,\n health_provider: Callable[[], Awaitable[HealthPayload]],\n action_provider: Callable[[str, str], Awaitable[JSONResponse]],\n ) -> FastAPI:\n app = FastAPI(title=\"PLBA Control API\")\n\n @app.middleware(\"http\")\n async def log_api_call(request: Request, call_next): # type: ignore[no-untyped-def]\n started = time.monotonic()\n response = await call_next(request)\n response.headers[\"X-Response-Time-Ms\"] = str(int((time.monotonic() - started) * 1000))\n return response\n\n @app.get(\"/health\")\n async def health() -> JSONResponse:\n payload = await health_provider()\n status_code = 200 if payload.get(\"status\") == \"ok\" else 503\n return JSONResponse(content=payload, status_code=status_code)\n\n @app.get(\"/actions/{action}\")\n @app.post(\"/actions/{action}\")\n async def action(action: str, request: Request) -> JSONResponse:\n client_source = self._client_source(request)\n if action in {\"start\", \"stop\"}:\n LOGGER.warning(\"Control action requested: /actions/%s client=%s\", action, client_source)\n return await action_provider(action, client_source)\n\n return app\n\n def _client_source(self, request: Request) -> str:\n explicit_header = request.headers.get(\"X-Client-Source\", \"\").strip()\n if explicit_header:\n return explicit_header\n user_agent = request.headers.get(\"User-Agent\", \"\").strip()\n if user_agent:\n return f\"user-agent:{user_agent}\"\n return \"unknown\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/http_app.py:HttpControlAppFactory", - "span_start": 15, - "span_end": 53, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.http_app", - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ] - }, - "diagnostics": { - "execution": { - "executed_layers": [ - "D1_MODULE_CATALOG", - "D3_SECTION_INDEX", - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS" - ], - "retrieval_mode_by_layer": { - "D1_MODULE_CATALOG": "vector", - "D3_SECTION_INDEX": "vector", - "C1_SYMBOL_CATALOG": "symbol_search", - "C0_SOURCE_CHUNKS": "exact_path_fetch" - }, - "top_k_by_layer": { - "D1_MODULE_CATALOG": 4, - "D3_SECTION_INDEX": 6, - "C1_SYMBOL_CATALOG": 4, - "C0_SOURCE_CHUNKS": 4 - }, - "filters_by_layer": { - "D1_MODULE_CATALOG": { - "path_scope": [], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "D3_SECTION_INDEX": { - "path_scope": [], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C1_SYMBOL_CATALOG": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "D1_MODULE_CATALOG", - "query": "Какие компоненты участвуют в control plane?", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 4, - "ranking_profile": "project" - }, - { - "layer": "D3_SECTION_INDEX", - "query": "Какие компоненты участвуют в control plane?", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "project" - }, - { - "layer": "C1_SYMBOL_CATALOG", - "query": "control plane", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 4, - "ranking_profile": "project" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Какие компоненты участвуют в control plane?", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 4, - "ranking_profile": "project" - } - ], - "applied": [ - { - "layer": "D1_MODULE_CATALOG", - "effective_path_scope": [], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 0, - "candidates_after_filter": 0 - }, - { - "layer": "D3_SECTION_INDEX", - "effective_path_scope": [], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 6, - "candidates_after_filter": 6 - }, - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 1, - "candidates_after_filter": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 4, - "candidates_after_filter": 4 - } - ], - "fallback": { - "used": true, - "reason": "scope_relaxed" - }, - "symbol_resolution": { - "status": "not_found", - "resolved_symbol": null, - "alternatives": [ - "ControlActionSet" - ] - }, - "layers": [ - { - "layer": "D1_MODULE_CATALOG", - "status": "miss", - "hit_count": 0, - "fail_reason": "scope_relaxed" - }, - { - "layer": "D3_SECTION_INDEX", - "status": "hit", - "hit_count": 6, - "fail_reason": null - }, - { - "layer": "C1_SYMBOL_CATALOG", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 4, - "fail_reason": null - } - ] - }, - "constraint_violations": [ - { - "type": "LAYER_MISSING", - "severity": "warn", - "details": { - "layer": "D1_MODULE_CATALOG", - "requested_layers": [ - "D1_MODULE_CATALOG", - "D3_SECTION_INDEX", - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS" - ] - }, - "suggested_fix": "Increase top_k for this layer or relax constraints for retrieval." - } - ], - "timings_ms": { - "symbol_resolution": 0, - "retrieval_total": 131, - "retrieval_by_layer": { - "D1_MODULE_CATALOG": 49, - "D3_SECTION_INDEX": 39, - "C1_SYMBOL_CATALOG": 27, - "C0_SOURCE_CHUNKS": 15 - }, - "merge_rank": 0 - } - } - }, - { - "step": "llm_answer", - "input": { - "query": "Какие компоненты участвуют в control plane?", - "rag_count": 11 - }, - "output": { - "llm_answer": "В control plane обычно участвуют следующие компоненты:\n\n1. **Control Action Set** – управляет действиями контроля.\n2. **Runtime Manager** – отвечает за старт и остановку runtime.\n3. **Worker Supervisor** – контролирует жизненный цикл воркеров.\n4. **Log Manager** – применяет и восстанавливает валидные конфигурации логирования.\n5. **Health Registry** – регистрирует состояние здоровья компонентов.\n6. **Workflow Engine** – исполняет бизнес-логику и управление workflow.\n7. **Checkpoint Repository** – сохраняет промежуточные состояния задач.\n8. **MySQL Trace Transport** – транспорт для трассировки событий.\n\nЭти компоненты обеспечивают контроль и управление состоянием системы, выполнение рабочих процессов и мониторинг их здоровья." - }, - "diagnostics": { - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 1377, - "evidence_rows": 11, - "evidence_chars": 11095 - }, - "evidence_summary": [ - { - "layer": "D3_SECTION_INDEX", - "count": 6, - "unique_paths": 3 - }, - { - "layer": "C1_SYMBOL_CATALOG", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 4, - "unique_paths": 3 - } - ], - "prompt_template_id": "intent_project_misc_v1", - "system_prompt_version": "v1" - }, - "timings_ms": { - "prompt_build": 0, - "llm_call": 1266 - } - } - } - ] - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents/20260312_115642/full_chain_plba_code_subintents_plba-fullchain-architecture-control-plane.md b/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents/20260312_115642/full_chain_plba_code_subintents_plba-fullchain-architecture-control-plane.md deleted file mode 100644 index a6265a9..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents/20260312_115642/full_chain_plba_code_subintents_plba-fullchain-architecture-control-plane.md +++ /dev/null @@ -1,38 +0,0 @@ -# plba-fullchain-architecture-control-plane - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_subintents.yaml -- runner: runtime -- mode: full_chain -- passed: False - -## Query -Какие компоненты участвуют в control plane? - -## Actual -{ - "intent": "PROJECT_MISC", - "sub_intent": "ARCHITECTURE", - "graph_id": "ProjectMiscGraph", - "conversation_mode": "START", - "rag_count": 11, - "llm_answer": "В control plane обычно участвуют следующие компоненты:\n\n1. **Control Action Set** – управляет действиями контроля.\n2. **Runtime Manager** – отвечает за старт и остановку runtime.\n3. **Worker Supervisor** – контролирует жизненный цикл воркеров.\n4. **Log Manager** – применяет и восстанавливает валидные конфигурации логирования.\n5. **Health Registry** – регистрирует состояние здоровья компонентов.\n6. **Workflow Engine** – исполняет бизнес-логику и управление workflow.\n7. **Checkpoint Repository** – сохраняет промежуточные состояния задач.\n8. **MySQL Trace Transport** – транспорт для трассировки событий.\n\nЭти компоненты обеспечивают контроль и управление состоянием системы, выполнение рабочих процессов и мониторинг их здоровья.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "control", - "plane" - ], - "layers": [ - "D1_MODULE_CATALOG", - "D3_SECTION_INDEX", - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS" - ] -} - -## Mismatches -- intent: expected CODE_QA, got PROJECT_MISC -- graph_id: expected CodeQAGraph, got ProjectMiscGraph -- layers should include 'C4_SEMANTIC_ROLES', got ['D1_MODULE_CATALOG', 'D3_SECTION_INDEX', 'C1_SYMBOL_CATALOG', 'C0_SOURCE_CHUNKS'] -- layers should include 'C2_DEPENDENCY_GRAPH', got ['D1_MODULE_CATALOG', 'D3_SECTION_INDEX', 'C1_SYMBOL_CATALOG', 'C0_SOURCE_CHUNKS'] -- layers should include 'C3_ENTRYPOINTS', got ['D1_MODULE_CATALOG', 'D3_SECTION_INDEX', 'C1_SYMBOL_CATALOG', 'C0_SOURCE_CHUNKS'] \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents/20260312_115642/full_chain_plba_code_subintents_plba-fullchain-explain-local-runtime-manager.json b/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents/20260312_115642/full_chain_plba_code_subintents_plba-fullchain-explain-local-runtime-manager.json deleted file mode 100644 index 2847f0b..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents/20260312_115642/full_chain_plba_code_subintents_plba-fullchain-explain-local-runtime-manager.json +++ /dev/null @@ -1,1333 +0,0 @@ -{ - "case_id": "plba-fullchain-explain-local-runtime-manager", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_subintents.yaml", - "runner": "runtime", - "mode": "full_chain", - "actual": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN_LOCAL", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 6, - "llm_answer": "Класс `RuntimeManager` из файла `src/app_runtime/core/runtime.py` предназначен для управления жизненным циклом приложения во время его выполнения.\n\n### Что делает класс:\n1. **Инициализация (Constructor):**\n - При создании объекта класса инициализируются все основные компоненты системы через параметры конструктора (`configuration`, `services`, `traces`, `health`, `logs`, `workers`, `control_plane`).\n - Если эти параметры отсутствуют, создаются их дефолтные экземпляры внутри метода.\n \n2. **Регистрация модулей:**\n - Метод `register_module(module)` позволяет зарегистрировать новый модуль приложения в менеджере ресурсов (`self.registry`), обеспечивая интеграцию нового функционала.\n\n3. **Управление состоянием приложения:**\n - Переменные `_started`, `_state`, `_core_registered`, `_workers_registered` отслеживают состояние менеджера, позволяя управлять различными фазами жизненного цикла приложения.\n\n### Входы и выходы:\n- Входными параметрами являются различные сервисы и менеджеры, такие как конфигурация, службы, трассировка, здоровье, логирование и контроль за рабочими процессами.\n- Выходом является объект менеджера, готовый к управлению приложением.\n\n### Связь с ближайшим контекстом:\n- Класс управляется через методы инициализации и регистрации модулей, взаимодействуя напрямую с другими компонентами приложения через поля и зависимости.\n- Через метод `register_module()` осуществляется интеграция новых компонентов приложения в систему.\n\nТаким образом, `RuntimeManager` выступает центральным координатором различных сервисов и процессов приложения, предоставляя унифицированный интерфейс для их взаимодействия и управления жизненным циклом.", - "answer_mode": "answered", - "path_scope": [ - "src/app_runtime/core/runtime.py" - ], - "symbol_candidates": [ - "RuntimeManager" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C2_DEPENDENCY_GRAPH" - ] - }, - "passed": true, - "mismatches": [], - "details": { - "case_id": "plba-fullchain-explain-local-runtime-manager", - "text": "Почему в файле src/app_runtime/core/runtime.py класс RuntimeManager устроен так?", - "mode": "full_chain", - "run_started_at": "2026-03-12T11:56:42", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Почему в файле src/app_runtime/core/runtime.py класс RuntimeManager устроен так?", - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "RuntimeManager", - "alternatives": [ - "RuntimeManager" - ], - "confidence": 0.99 - }, - "rag_count": 6, - "rag_rows": [ - { - "path": "src/app_runtime/core/runtime.py", - "content": "class RuntimeManager\nRuntimeManager", - "layer": "C1_SYMBOL_CATALOG", - "title": "RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "7e4a9381328c5803bbc6179458612fc4e947d928aa7bf8b4b2bebb2c8592f758", - "qname": "RuntimeManager", - "kind": "class", - "signature": "RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.core.runtime", - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager.start", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 32, - "span_end": 59, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "98312ace7fc62b1c7194c5aa1732b6ef736eae1668a3a120dd1ecd5ab1d64f7a", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "77a7b260193018845e4e204df094ab89cfd7c82ee4e822b3a83ad4cd945f9cb1", - "dst_ref": "RuntimeManager.start", - "resolution": "resolved", - "slice_id": "98312ace7fc62b1c7194c5aa1732b6ef736eae1668a3a120dd1ecd5ab1d64f7a", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager.start" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "77a7b260193018845e4e204df094ab89cfd7c82ee4e822b3a83ad4cd945f9cb1" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager._register_core_services", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 32, - "span_end": 127, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "3e5811f3b511fa0cabe363f5d01f2ac5fa039bc8b93f7ee108323e1f5f45a293", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "972d6057a6caac9cf31ebc1e29c6f39f71b10d4cc170dec57cf875ba458549c6", - "dst_ref": "RuntimeManager._register_core_services", - "resolution": "resolved", - "slice_id": "3e5811f3b511fa0cabe363f5d01f2ac5fa039bc8b93f7ee108323e1f5f45a293", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager._register_core_services" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "972d6057a6caac9cf31ebc1e29c6f39f71b10d4cc170dec57cf875ba458549c6" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager.add_config_file", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 32, - "span_end": 52, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "a23b8a11ebdb12708b60c96ea12a69f7f042082f1adfddd572444e246d81d167", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "57ffbd4f0d9fdf3507c2b8624312ce211f3d02fdf86a57a8ec90778d8a7b498d", - "dst_ref": "RuntimeManager.add_config_file", - "resolution": "resolved", - "slice_id": "a23b8a11ebdb12708b60c96ea12a69f7f042082f1adfddd572444e246d81d167", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager.add_config_file" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "57ffbd4f0d9fdf3507c2b8624312ce211f3d02fdf86a57a8ec90778d8a7b498d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.services\n -> RuntimeManager.__init__", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 33, - "span_end": 39, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "d43af85989222ee6d788ce418cdcb217c7ff044cfb915e3bdbd184417dc7bd61", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "dst_ref": "RuntimeManager.__init__", - "resolution": "resolved", - "slice_id": "d43af85989222ee6d788ce418cdcb217c7ff044cfb915e3bdbd184417dc7bd61", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.services", - "RuntimeManager.__init__" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "class RuntimeManager:\n ACTION_TIMEOUT_SECONDS = 10.0\n ACTION_POLL_INTERVAL_SECONDS = 0.05\n\n def __init__(\n self,\n configuration: ConfigurationManager | None = None,\n services: ServiceContainer | None = None,\n traces: TraceService | None = None,\n health: HealthRegistry | None = None,\n logs: LogManager | None = None,\n workers: WorkerSupervisor | None = None,\n control_plane: ControlPlaneService | None = None,\n ) -> None:\n self.configuration = configuration or ConfigurationManager()\n self.services = services or ServiceContainer()\n self.traces = traces or TraceService()\n self.health = health or HealthRegistry()\n self.logs = logs or LogManager()\n self.workers = workers or WorkerSupervisor()\n self.control_plane = control_plane or ControlPlaneService()\n self.registry = ModuleRegistry(self.services)\n self._started = False\n self._state = LifecycleState.IDLE\n self._core_registered = False\n self._workers_registered = False\n self._register_core_services()\n\n def register_module(self, module: ApplicationModule) -> None:\n self.registry.register_module(module.name)\n module.register(self.registry)\n\n def add_config_file(self, path: str) -> FileConfigProvider:\n provider = FileConfigProvider(path)\n self.configuration.add_provider(provider)\n return provider\n\n def start(self, *, start_control_plane: bool = True) -> None:\n if self._started:\n return\n self._state = LifecycleState.STARTING\n config = self.configuration.load()\n self.logs.apply_config(config)\n self._register_health_contributors()\n self._register_workers()\n self.workers.start()\n if start_control_plane:\n self.control_plane.start(self)\n self._started = True\n self._refresh_state()\n\n def stop(self, timeout: float = 30.0, force: bool = False, stop_control_plane: bool = True) -> None:\n if not self._started:\n return\n self._state = LifecycleState.STOPPING\n self.workers.stop(timeout=timeout, force=force)\n if stop_control_plane:\n self.control_plane.stop()\n self._started = False\n self._state = LifecycleState.STOPPED\n\n def status(self) -> dict[str, object]:\n self._refresh_state()\n return self.control_plane.snapshot(self)\n\n def current_health(self) -> HealthPayload:\n self._refresh_state()\n return self.health.payload(self._state, self.workers.healths())\n\n async def health_status(self) -> HealthPayload:\n return self.current_health()\n\n async def start_runtime(self) -> dict[str, object] | str:\n self._refresh_state()\n if self._started:\n return \"runtime already running\"\n if self._state == LifecycleState.STOPPING:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n\n self.start(start_control_plane=False)\n started = self._wait_for_state({LifecycleState.IDLE, LifecycleState.BUSY}, timeout=self.ACTION_TIMEOUT_SECONDS)\n if started:\n return self._action_detail(\"runtime started\", timed_out=False)\n return self._action_detail(\"runtime start is still in progress\", timed_out=True)\n\n async def stop_runtime(self) -> dict[str, object] | str:\n self._refresh_state()\n if not self._started:\n if self._state == LifecycleState.STOPPING:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n return \"runtime already stopped\"\n\n self._state = LifecycleState.STOPPING\n try:\n self.workers.stop(timeout=self.ACTION_TIMEOUT_SECONDS, force=False)\n except TimeoutError:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n\n self._started = False\n self._state = LifecycleState.STOPPED\n return self._action_detail(\"runtime stopped\", timed_out=False)\n\n async def runtime_status(self) -> str:\n self._refresh_state()\n return self._state.value\n\n def _register_core_services(self) -> None:\n if self._core_registered:\n return\n self.services.register(\"configuration\", self.configuration)\n self.services.register(\"traces\", self.traces)\n self.services.register(\"health\", self.health)\n self.services.register(\"logs\", self.logs)\n self.services.register(\"workers\", self.workers)\n self.services.register(\"control_plane\", self.control_plane)\n self._core_registered = True\n\n def _register_health_contributors(self) -> None:\n for contributor in self.registry.health_contributors:\n self.health.register(contributor)\n\n def _register_workers(self) -> None:\n if self._workers_registered:\n return\n for worker in self.registry.workers:\n self.workers.register(worker)\n self._workers_registered = True\n\n def _refresh_state(self) -> None:\n lifecycle = self.workers.lifecycle_state()\n\n if self._state == LifecycleState.STOPPING:\n if lifecycle == LifecycleState.STOPPED:\n self._started = False\n self._state = LifecycleState.STOPPED\n return\n\n if not self._started:\n if lifecycle == LifecycleState.STOPPED:\n self._state = LifecycleState.STOPPED\n return\n\n self._state = lifecycle\n\n def _wait_for_state(self, target_states: set[LifecycleState], *, timeout: float) -> bool:\n deadline = monotonic() + timeout\n while monotonic() < deadline:\n self._refresh_state()\n if self._state in target_states:\n return True\n sleep(self.ACTION_POLL_INTERVAL_SECONDS)\n self._refresh_state()\n return self._state in target_states\n\n def _action_detail(self, message: str, *, timed_out: bool) -> dict[str, object]:\n self._refresh_state()\n return {\n \"message\": message,\n \"state\": self._state.value,\n \"timed_out\": timed_out,\n \"workers\": self.workers.snapshot(),\n }", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/core/runtime.py:RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.core.runtime", - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "llm_answer": "Класс `RuntimeManager` из файла `src/app_runtime/core/runtime.py` предназначен для управления жизненным циклом приложения во время его выполнения.\n\n### Что делает класс:\n1. **Инициализация (Constructor):**\n - При создании объекта класса инициализируются все основные компоненты системы через параметры конструктора (`configuration`, `services`, `traces`, `health`, `logs`, `workers`, `control_plane`).\n - Если эти параметры отсутствуют, создаются их дефолтные экземпляры внутри метода.\n \n2. **Регистрация модулей:**\n - Метод `register_module(module)` позволяет зарегистрировать новый модуль приложения в менеджере ресурсов (`self.registry`), обеспечивая интеграцию нового функционала.\n\n3. **Управление состоянием приложения:**\n - Переменные `_started`, `_state`, `_core_registered`, `_workers_registered` отслеживают состояние менеджера, позволяя управлять различными фазами жизненного цикла приложения.\n\n### Входы и выходы:\n- Входными параметрами являются различные сервисы и менеджеры, такие как конфигурация, службы, трассировка, здоровье, логирование и контроль за рабочими процессами.\n- Выходом является объект менеджера, готовый к управлению приложением.\n\n### Связь с ближайшим контекстом:\n- Класс управляется через методы инициализации и регистрации модулей, взаимодействуя напрямую с другими компонентами приложения через поля и зависимости.\n- Через метод `register_module()` осуществляется интеграция новых компонентов приложения в систему.\n\nТаким образом, `RuntimeManager` выступает центральным координатором различных сервисов и процессов приложения, предоставляя унифицированный интерфейс для их взаимодействия и управления жизненным циклом.", - "summary": { - "router": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN_LOCAL", - "confidence": null - }, - "retrieval": { - "profile": "code", - "layers_hit": [ - "C0_SOURCE_CHUNKS", - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH" - ], - "evidence_sufficient": true - }, - "llm": { - "answer_status": "answered", - "groundedness": "grounded" - } - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN_LOCAL", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C2_DEPENDENCY_GRAPH" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "RuntimeManager" - ], - "keyword_hints": [ - "src/app_runtime/core/runtime.py", - "RuntimeManager" - ], - "path_hints": [ - "src/app_runtime/core/runtime.py" - ], - "path_scope": [ - "src/app_runtime/core/runtime.py" - ], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C2_DEPENDENCY_GRAPH" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C0_SOURCE_CHUNKS": "exact_path_fetch", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 12, - "C2_DEPENDENCY_GRAPH": 4 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [ - "src/app_runtime/core/runtime.py" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src/app_runtime/core/runtime.py" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src/app_runtime/core/runtime.py" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "RuntimeManager", - "path_scope": [ - "src/app_runtime/core/runtime.py" - ], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Почему в файле src/app_runtime/core/runtime.py класс RuntimeManager устроен так?", - "path_scope": [ - "src/app_runtime/core/runtime.py" - ], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 12, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "Почему в файле src/app_runtime/core/runtime.py класс RuntimeManager устроен так?", - "path_scope": [ - "src/app_runtime/core/runtime.py" - ], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 4, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [ - "src/app_runtime/core/runtime.py" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 1, - "candidates_after_filter": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src/app_runtime/core/runtime.py" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 1, - "candidates_after_filter": 1 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src/app_runtime/core/runtime.py" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 4, - "candidates_after_filter": 4 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "RuntimeManager", - "alternatives": [ - "RuntimeManager" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 4, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "router": 1, - "symbol_resolution": 0, - "retrieval_total": 78, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 30, - "C0_SOURCE_CHUNKS": 21, - "C2_DEPENDENCY_GRAPH": 26 - }, - "merge_rank": 22, - "prompt_build": 0, - "llm_call": 2465 - }, - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 784, - "evidence_rows": 6, - "evidence_chars": 6650 - }, - "evidence_summary": [ - { - "layer": "C1_SYMBOL_CATALOG", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "count": 4, - "unique_paths": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 1, - "unique_paths": 1 - } - ], - "prompt_template_id": "intent_code_qa_explain_local_ru_v1", - "system_prompt_version": "v1" - }, - "router": { - "conversation_mode": "START", - "keyword_hints": [ - "src/app_runtime/core/runtime.py", - "RuntimeManager" - ], - "path_scope": [ - "src/app_runtime/core/runtime.py" - ] - }, - "llm": { - "used_evidence_count": 6, - "missing_evidence_reason": null - } - }, - "run_info": { - "case_id": "plba-fullchain-explain-local-runtime-manager", - "mode": "full_chain", - "run_started_at": "2026-03-12T11:56:42", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - }, - "input_request": { - "text": "Почему в файле src/app_runtime/core/runtime.py класс RuntimeManager устроен так?", - "normalized_query": "Почему в файле src/app_runtime/core/runtime.py класс RuntimeManager устроен так?" - }, - "steps": [ - { - "step": "intent_router", - "input": { - "query": "Почему в файле src/app_runtime/core/runtime.py класс RuntimeManager устроен так?" - }, - "output": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Почему в файле src/app_runtime/core/runtime.py класс RuntimeManager устроен так?" - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN_LOCAL", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C2_DEPENDENCY_GRAPH" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "RuntimeManager" - ], - "keyword_hints": [ - "src/app_runtime/core/runtime.py", - "RuntimeManager" - ], - "path_hints": [ - "src/app_runtime/core/runtime.py" - ], - "path_scope": [ - "src/app_runtime/core/runtime.py" - ], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "timings_ms": { - "router": 1 - } - } - }, - { - "step": "retrieval", - "input": { - "query": "Почему в файле src/app_runtime/core/runtime.py класс RuntimeManager устроен так?" - }, - "output": { - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "RuntimeManager", - "alternatives": [ - "RuntimeManager" - ], - "confidence": 0.99 - }, - "rag_count": 6, - "rag_rows": [ - { - "path": "src/app_runtime/core/runtime.py", - "content": "class RuntimeManager\nRuntimeManager", - "layer": "C1_SYMBOL_CATALOG", - "title": "RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "7e4a9381328c5803bbc6179458612fc4e947d928aa7bf8b4b2bebb2c8592f758", - "qname": "RuntimeManager", - "kind": "class", - "signature": "RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.core.runtime", - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager.start", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 32, - "span_end": 59, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "98312ace7fc62b1c7194c5aa1732b6ef736eae1668a3a120dd1ecd5ab1d64f7a", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "77a7b260193018845e4e204df094ab89cfd7c82ee4e822b3a83ad4cd945f9cb1", - "dst_ref": "RuntimeManager.start", - "resolution": "resolved", - "slice_id": "98312ace7fc62b1c7194c5aa1732b6ef736eae1668a3a120dd1ecd5ab1d64f7a", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager.start" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "77a7b260193018845e4e204df094ab89cfd7c82ee4e822b3a83ad4cd945f9cb1" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager._register_core_services", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 32, - "span_end": 127, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "3e5811f3b511fa0cabe363f5d01f2ac5fa039bc8b93f7ee108323e1f5f45a293", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "972d6057a6caac9cf31ebc1e29c6f39f71b10d4cc170dec57cf875ba458549c6", - "dst_ref": "RuntimeManager._register_core_services", - "resolution": "resolved", - "slice_id": "3e5811f3b511fa0cabe363f5d01f2ac5fa039bc8b93f7ee108323e1f5f45a293", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager._register_core_services" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "972d6057a6caac9cf31ebc1e29c6f39f71b10d4cc170dec57cf875ba458549c6" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager.add_config_file", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 32, - "span_end": 52, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "a23b8a11ebdb12708b60c96ea12a69f7f042082f1adfddd572444e246d81d167", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "57ffbd4f0d9fdf3507c2b8624312ce211f3d02fdf86a57a8ec90778d8a7b498d", - "dst_ref": "RuntimeManager.add_config_file", - "resolution": "resolved", - "slice_id": "a23b8a11ebdb12708b60c96ea12a69f7f042082f1adfddd572444e246d81d167", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager.add_config_file" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "57ffbd4f0d9fdf3507c2b8624312ce211f3d02fdf86a57a8ec90778d8a7b498d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.services\n -> RuntimeManager.__init__", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 33, - "span_end": 39, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "d43af85989222ee6d788ce418cdcb217c7ff044cfb915e3bdbd184417dc7bd61", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "dst_ref": "RuntimeManager.__init__", - "resolution": "resolved", - "slice_id": "d43af85989222ee6d788ce418cdcb217c7ff044cfb915e3bdbd184417dc7bd61", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.services", - "RuntimeManager.__init__" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "class RuntimeManager:\n ACTION_TIMEOUT_SECONDS = 10.0\n ACTION_POLL_INTERVAL_SECONDS = 0.05\n\n def __init__(\n self,\n configuration: ConfigurationManager | None = None,\n services: ServiceContainer | None = None,\n traces: TraceService | None = None,\n health: HealthRegistry | None = None,\n logs: LogManager | None = None,\n workers: WorkerSupervisor | None = None,\n control_plane: ControlPlaneService | None = None,\n ) -> None:\n self.configuration = configuration or ConfigurationManager()\n self.services = services or ServiceContainer()\n self.traces = traces or TraceService()\n self.health = health or HealthRegistry()\n self.logs = logs or LogManager()\n self.workers = workers or WorkerSupervisor()\n self.control_plane = control_plane or ControlPlaneService()\n self.registry = ModuleRegistry(self.services)\n self._started = False\n self._state = LifecycleState.IDLE\n self._core_registered = False\n self._workers_registered = False\n self._register_core_services()\n\n def register_module(self, module: ApplicationModule) -> None:\n self.registry.register_module(module.name)\n module.register(self.registry)\n\n def add_config_file(self, path: str) -> FileConfigProvider:\n provider = FileConfigProvider(path)\n self.configuration.add_provider(provider)\n return provider\n\n def start(self, *, start_control_plane: bool = True) -> None:\n if self._started:\n return\n self._state = LifecycleState.STARTING\n config = self.configuration.load()\n self.logs.apply_config(config)\n self._register_health_contributors()\n self._register_workers()\n self.workers.start()\n if start_control_plane:\n self.control_plane.start(self)\n self._started = True\n self._refresh_state()\n\n def stop(self, timeout: float = 30.0, force: bool = False, stop_control_plane: bool = True) -> None:\n if not self._started:\n return\n self._state = LifecycleState.STOPPING\n self.workers.stop(timeout=timeout, force=force)\n if stop_control_plane:\n self.control_plane.stop()\n self._started = False\n self._state = LifecycleState.STOPPED\n\n def status(self) -> dict[str, object]:\n self._refresh_state()\n return self.control_plane.snapshot(self)\n\n def current_health(self) -> HealthPayload:\n self._refresh_state()\n return self.health.payload(self._state, self.workers.healths())\n\n async def health_status(self) -> HealthPayload:\n return self.current_health()\n\n async def start_runtime(self) -> dict[str, object] | str:\n self._refresh_state()\n if self._started:\n return \"runtime already running\"\n if self._state == LifecycleState.STOPPING:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n\n self.start(start_control_plane=False)\n started = self._wait_for_state({LifecycleState.IDLE, LifecycleState.BUSY}, timeout=self.ACTION_TIMEOUT_SECONDS)\n if started:\n return self._action_detail(\"runtime started\", timed_out=False)\n return self._action_detail(\"runtime start is still in progress\", timed_out=True)\n\n async def stop_runtime(self) -> dict[str, object] | str:\n self._refresh_state()\n if not self._started:\n if self._state == LifecycleState.STOPPING:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n return \"runtime already stopped\"\n\n self._state = LifecycleState.STOPPING\n try:\n self.workers.stop(timeout=self.ACTION_TIMEOUT_SECONDS, force=False)\n except TimeoutError:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n\n self._started = False\n self._state = LifecycleState.STOPPED\n return self._action_detail(\"runtime stopped\", timed_out=False)\n\n async def runtime_status(self) -> str:\n self._refresh_state()\n return self._state.value\n\n def _register_core_services(self) -> None:\n if self._core_registered:\n return\n self.services.register(\"configuration\", self.configuration)\n self.services.register(\"traces\", self.traces)\n self.services.register(\"health\", self.health)\n self.services.register(\"logs\", self.logs)\n self.services.register(\"workers\", self.workers)\n self.services.register(\"control_plane\", self.control_plane)\n self._core_registered = True\n\n def _register_health_contributors(self) -> None:\n for contributor in self.registry.health_contributors:\n self.health.register(contributor)\n\n def _register_workers(self) -> None:\n if self._workers_registered:\n return\n for worker in self.registry.workers:\n self.workers.register(worker)\n self._workers_registered = True\n\n def _refresh_state(self) -> None:\n lifecycle = self.workers.lifecycle_state()\n\n if self._state == LifecycleState.STOPPING:\n if lifecycle == LifecycleState.STOPPED:\n self._started = False\n self._state = LifecycleState.STOPPED\n return\n\n if not self._started:\n if lifecycle == LifecycleState.STOPPED:\n self._state = LifecycleState.STOPPED\n return\n\n self._state = lifecycle\n\n def _wait_for_state(self, target_states: set[LifecycleState], *, timeout: float) -> bool:\n deadline = monotonic() + timeout\n while monotonic() < deadline:\n self._refresh_state()\n if self._state in target_states:\n return True\n sleep(self.ACTION_POLL_INTERVAL_SECONDS)\n self._refresh_state()\n return self._state in target_states\n\n def _action_detail(self, message: str, *, timed_out: bool) -> dict[str, object]:\n self._refresh_state()\n return {\n \"message\": message,\n \"state\": self._state.value,\n \"timed_out\": timed_out,\n \"workers\": self.workers.snapshot(),\n }", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/core/runtime.py:RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.core.runtime", - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ] - }, - "diagnostics": { - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C2_DEPENDENCY_GRAPH" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C0_SOURCE_CHUNKS": "exact_path_fetch", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 12, - "C2_DEPENDENCY_GRAPH": 4 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [ - "src/app_runtime/core/runtime.py" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src/app_runtime/core/runtime.py" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src/app_runtime/core/runtime.py" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "RuntimeManager", - "path_scope": [ - "src/app_runtime/core/runtime.py" - ], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Почему в файле src/app_runtime/core/runtime.py класс RuntimeManager устроен так?", - "path_scope": [ - "src/app_runtime/core/runtime.py" - ], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 12, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "Почему в файле src/app_runtime/core/runtime.py класс RuntimeManager устроен так?", - "path_scope": [ - "src/app_runtime/core/runtime.py" - ], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 4, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [ - "src/app_runtime/core/runtime.py" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 1, - "candidates_after_filter": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src/app_runtime/core/runtime.py" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 1, - "candidates_after_filter": 1 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src/app_runtime/core/runtime.py" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 4, - "candidates_after_filter": 4 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "RuntimeManager", - "alternatives": [ - "RuntimeManager" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 4, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "symbol_resolution": 0, - "retrieval_total": 78, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 30, - "C0_SOURCE_CHUNKS": 21, - "C2_DEPENDENCY_GRAPH": 26 - }, - "merge_rank": 22 - } - } - }, - { - "step": "llm_answer", - "input": { - "query": "Почему в файле src/app_runtime/core/runtime.py класс RuntimeManager устроен так?", - "rag_count": 6 - }, - "output": { - "llm_answer": "Класс `RuntimeManager` из файла `src/app_runtime/core/runtime.py` предназначен для управления жизненным циклом приложения во время его выполнения.\n\n### Что делает класс:\n1. **Инициализация (Constructor):**\n - При создании объекта класса инициализируются все основные компоненты системы через параметры конструктора (`configuration`, `services`, `traces`, `health`, `logs`, `workers`, `control_plane`).\n - Если эти параметры отсутствуют, создаются их дефолтные экземпляры внутри метода.\n \n2. **Регистрация модулей:**\n - Метод `register_module(module)` позволяет зарегистрировать новый модуль приложения в менеджере ресурсов (`self.registry`), обеспечивая интеграцию нового функционала.\n\n3. **Управление состоянием приложения:**\n - Переменные `_started`, `_state`, `_core_registered`, `_workers_registered` отслеживают состояние менеджера, позволяя управлять различными фазами жизненного цикла приложения.\n\n### Входы и выходы:\n- Входными параметрами являются различные сервисы и менеджеры, такие как конфигурация, службы, трассировка, здоровье, логирование и контроль за рабочими процессами.\n- Выходом является объект менеджера, готовый к управлению приложением.\n\n### Связь с ближайшим контекстом:\n- Класс управляется через методы инициализации и регистрации модулей, взаимодействуя напрямую с другими компонентами приложения через поля и зависимости.\n- Через метод `register_module()` осуществляется интеграция новых компонентов приложения в систему.\n\nТаким образом, `RuntimeManager` выступает центральным координатором различных сервисов и процессов приложения, предоставляя унифицированный интерфейс для их взаимодействия и управления жизненным циклом." - }, - "diagnostics": { - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 784, - "evidence_rows": 6, - "evidence_chars": 6650 - }, - "evidence_summary": [ - { - "layer": "C1_SYMBOL_CATALOG", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "count": 4, - "unique_paths": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 1, - "unique_paths": 1 - } - ], - "prompt_template_id": "intent_code_qa_explain_local_ru_v1", - "system_prompt_version": "v1" - }, - "timings_ms": { - "prompt_build": 0, - "llm_call": 2465 - } - } - } - ] - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents/20260312_115642/full_chain_plba_code_subintents_plba-fullchain-explain-local-runtime-manager.md b/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents/20260312_115642/full_chain_plba_code_subintents_plba-fullchain-explain-local-runtime-manager.md deleted file mode 100644 index 75508bc..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents/20260312_115642/full_chain_plba_code_subintents_plba-fullchain-explain-local-runtime-manager.md +++ /dev/null @@ -1,34 +0,0 @@ -# plba-fullchain-explain-local-runtime-manager - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_subintents.yaml -- runner: runtime -- mode: full_chain -- passed: True - -## Query -Почему в файле src/app_runtime/core/runtime.py класс RuntimeManager устроен так? - -## Actual -{ - "intent": "CODE_QA", - "sub_intent": "EXPLAIN_LOCAL", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 6, - "llm_answer": "Класс `RuntimeManager` из файла `src/app_runtime/core/runtime.py` предназначен для управления жизненным циклом приложения во время его выполнения.\n\n### Что делает класс:\n1. **Инициализация (Constructor):**\n - При создании объекта класса инициализируются все основные компоненты системы через параметры конструктора (`configuration`, `services`, `traces`, `health`, `logs`, `workers`, `control_plane`).\n - Если эти параметры отсутствуют, создаются их дефолтные экземпляры внутри метода.\n \n2. **Регистрация модулей:**\n - Метод `register_module(module)` позволяет зарегистрировать новый модуль приложения в менеджере ресурсов (`self.registry`), обеспечивая интеграцию нового функционала.\n\n3. **Управление состоянием приложения:**\n - Переменные `_started`, `_state`, `_core_registered`, `_workers_registered` отслеживают состояние менеджера, позволяя управлять различными фазами жизненного цикла приложения.\n\n### Входы и выходы:\n- Входными параметрами являются различные сервисы и менеджеры, такие как конфигурация, службы, трассировка, здоровье, логирование и контроль за рабочими процессами.\n- Выходом является объект менеджера, готовый к управлению приложением.\n\n### Связь с ближайшим контекстом:\n- Класс управляется через методы инициализации и регистрации модулей, взаимодействуя напрямую с другими компонентами приложения через поля и зависимости.\n- Через метод `register_module()` осуществляется интеграция новых компонентов приложения в систему.\n\nТаким образом, `RuntimeManager` выступает центральным координатором различных сервисов и процессов приложения, предоставляя унифицированный интерфейс для их взаимодействия и управления жизненным циклом.", - "answer_mode": "answered", - "path_scope": [ - "src/app_runtime/core/runtime.py" - ], - "symbol_candidates": [ - "RuntimeManager" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C2_DEPENDENCY_GRAPH" - ] -} - -## Mismatches -- none \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents/20260312_115642/full_chain_plba_code_subintents_plba-fullchain-explain-runtime-manager.json b/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents/20260312_115642/full_chain_plba_code_subintents_plba-fullchain-explain-runtime-manager.json deleted file mode 100644 index 47678ac..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents/20260312_115642/full_chain_plba_code_subintents_plba-fullchain-explain-runtime-manager.json +++ /dev/null @@ -1,2088 +0,0 @@ -{ - "case_id": "plba-fullchain-explain-runtime-manager", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_subintents.yaml", - "runner": "runtime", - "mode": "full_chain", - "actual": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 12, - "llm_answer": "## Назначение класса `RuntimeManager`\nКласс `RuntimeManager` играет роль центрального координатора для управления жизненным циклом различных компонентов системы, предоставляя интерфейс для их регистрации, запуска и мониторинга. Он служит своего рода \"менеджером\" всех сервисов и модулей приложения, обеспечивая согласованное выполнение задач через заданные потоки данных и состояния.\n\n## Ключевые зависимости\nКлючевыми зависимостями являются компоненты и сервисы, которые управляются и координируются `RuntimeManager`. Вот основные зависимости, указанные в символическом каталоге (`C1_SYMBOL_CATALOG`) и графе зависимостей (`C2_DEPENDENCY_GRAPH`):\n\n- **ConfigurationManager**: отвечает за конфигурацию приложения;\n- **ServiceContainer**: содержит коллекцию зарегистрированных сервисов;\n- **TraceService**: сервис для отслеживания событий и действий;\n- **HealthRegistry**: регистрирует и мониторит состояние здоровья сервисов;\n- **LogManager**: управляет логированием событий;\n- **WorkerSupervisor**: следит за рабочими процессами и выполняет необходимые действия по управлению ими;\n- **ControlPlaneService**: центральный контроллер для координации действий и обработки запросов от клиентов.\n\n## Поток данных или вызовов\nОсновной сценарий работы выглядит следующим образом:\n\n1. **Инициализация** (`__init__` метод): \n - Создаются и инициализируются экземпляры необходимых служб и классов с использованием значений по умолчанию, если аргументы отсутствуют.\n \n2. **Регистрация модулей** (`register_module` метод):\n - Регистрируется модуль, добавляя его в реестр доступных сервисов (`registry`).\n \n3. **Запуск и мониторинг**:\n - Запускает различные службы и сервисы, обеспечивая синхронную работу процессов и мониторинг их состояний.\n - Поддерживает регистрацию и управление состоянием жизненных циклов этих служб, таких как регистрация основного модуля, рабочих модулей и контроль над рабочим процессом.\n\n## Важные детали реализации\nВот некоторые ключевые моменты, выявленные из анализа кода (`C0_SOURCE_CHUNKS`), символических объявлений (`C1_SYMBOL_CATALOG`) и графа зависимостей (`C2_DEPENDENCY_GRAPH`):\n\n### Общие наблюдения:\n- Класс использует паттерн \"синглтон\", так как существует только один экземпляр этого менеджера, управляемый всеми компонентами системы.\n- Метод `__init__` выполняет начальную настройку объектов при создании экземпляра класса.\n- Основное поведение реализуется через методы `register_module`, обеспечивающие гибкость добавления новых модулей и приложений.\n- Внутренний регистр (`registry`) используется для хранения зарегистрированных модулей и их экземпляров.\n\n### Дополнительные детали:\n- Переменные `_started`, `_core_registered`, `_workers_registered` используются для отслеживания текущего состояния и обеспечения корректного порядка выполнения операций.\n- Методы и переменные, связанные с управлением жизненным циклом (`_register_core_services`, `_stop_async`), играют важную роль в обеспечении корректной последовательности шагов при запуске и остановке системы.\n\n## Осторожные выводы\nНа основании доступного контекста и данных о слоях RAG сложно точно утверждать, что все аспекты поведения и взаимодействия полностью отражены. Некоторые элементы могут быть опущены или недостаточно детализированы в текущих источниках информации. Рекомендуется дополнительно изучить полный контекст исходного кода и документацию к проекту для более полного понимания.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "RuntimeManager" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "passed": true, - "mismatches": [], - "details": { - "case_id": "plba-fullchain-explain-runtime-manager", - "text": "Объясни как работает класс RuntimeManager", - "mode": "full_chain", - "run_started_at": "2026-03-12T11:56:42", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Объясни как работает класс RuntimeManager", - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "RuntimeManager", - "alternatives": [ - "RuntimeManager" - ], - "confidence": 0.99 - }, - "rag_count": 12, - "rag_rows": [ - { - "path": "src/app_runtime/core/runtime.py", - "content": "class RuntimeManager\nRuntimeManager", - "layer": "C1_SYMBOL_CATALOG", - "title": "RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "7e4a9381328c5803bbc6179458612fc4e947d928aa7bf8b4b2bebb2c8592f758", - "qname": "RuntimeManager", - "kind": "class", - "signature": "RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.core.runtime", - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests manager\n- orchestrates role-like calls (4)\n- reads and writes state attributes\n- participates in dataflow slices (50)", - "layer": "C4_SEMANTIC_ROLES", - "title": "RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 43, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "7e4a9381328c5803bbc6179458612fc4e947d928aa7bf8b4b2bebb2c8592f758", - "symbol_name": "RuntimeManager", - "qname": "RuntimeManager", - "role": "pipeline_stage", - "confidence": 0.67, - "dataflow_participation": 50, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.stop", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 25, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d", - "dst_ref": "ControlPlaneService.stop", - "resolution": "resolved", - "slice_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.stop" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._stop_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 51, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a", - "dst_ref": "ControlPlaneService._stop_async", - "resolution": "resolved", - "slice_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._stop_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.register_channel", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 17, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957", - "dst_ref": "ControlPlaneService.register_channel", - "resolution": "resolved", - "slice_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.register_channel" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.start", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 20, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154", - "dst_ref": "ControlPlaneService.start", - "resolution": "resolved", - "slice_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.start" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._start_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 47, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517", - "dst_ref": "ControlPlaneService._start_async", - "resolution": "resolved", - "slice_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._start_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager.add_config_file", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 32, - "span_end": 52, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "a23b8a11ebdb12708b60c96ea12a69f7f042082f1adfddd572444e246d81d167", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "57ffbd4f0d9fdf3507c2b8624312ce211f3d02fdf86a57a8ec90778d8a7b498d", - "dst_ref": "RuntimeManager.add_config_file", - "resolution": "resolved", - "slice_id": "a23b8a11ebdb12708b60c96ea12a69f7f042082f1adfddd572444e246d81d167", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager.add_config_file" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "57ffbd4f0d9fdf3507c2b8624312ce211f3d02fdf86a57a8ec90778d8a7b498d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "class RuntimeManager:\n ACTION_TIMEOUT_SECONDS = 10.0\n ACTION_POLL_INTERVAL_SECONDS = 0.05\n\n def __init__(\n self,\n configuration: ConfigurationManager | None = None,\n services: ServiceContainer | None = None,\n traces: TraceService | None = None,\n health: HealthRegistry | None = None,\n logs: LogManager | None = None,\n workers: WorkerSupervisor | None = None,\n control_plane: ControlPlaneService | None = None,\n ) -> None:\n self.configuration = configuration or ConfigurationManager()\n self.services = services or ServiceContainer()\n self.traces = traces or TraceService()\n self.health = health or HealthRegistry()\n self.logs = logs or LogManager()\n self.workers = workers or WorkerSupervisor()\n self.control_plane = control_plane or ControlPlaneService()\n self.registry = ModuleRegistry(self.services)\n self._started = False\n self._state = LifecycleState.IDLE\n self._core_registered = False\n self._workers_registered = False\n self._register_core_services()\n\n def register_module(self, module: ApplicationModule) -> None:\n self.registry.register_module(module.name)\n module.register(self.registry)\n\n def add_config_file(self, path: str) -> FileConfigProvider:\n provider = FileConfigProvider(path)\n self.configuration.add_provider(provider)\n return provider\n\n def start(self, *, start_control_plane: bool = True) -> None:\n if self._started:\n return\n self._state = LifecycleState.STARTING\n config = self.configuration.load()\n self.logs.apply_config(config)\n self._register_health_contributors()\n self._register_workers()\n self.workers.start()\n if start_control_plane:\n self.control_plane.start(self)\n self._started = True\n self._refresh_state()\n\n def stop(self, timeout: float = 30.0, force: bool = False, stop_control_plane: bool = True) -> None:\n if not self._started:\n return\n self._state = LifecycleState.STOPPING\n self.workers.stop(timeout=timeout, force=force)\n if stop_control_plane:\n self.control_plane.stop()\n self._started = False\n self._state = LifecycleState.STOPPED\n\n def status(self) -> dict[str, object]:\n self._refresh_state()\n return self.control_plane.snapshot(self)\n\n def current_health(self) -> HealthPayload:\n self._refresh_state()\n return self.health.payload(self._state, self.workers.healths())\n\n async def health_status(self) -> HealthPayload:\n return self.current_health()\n\n async def start_runtime(self) -> dict[str, object] | str:\n self._refresh_state()\n if self._started:\n return \"runtime already running\"\n if self._state == LifecycleState.STOPPING:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n\n self.start(start_control_plane=False)\n started = self._wait_for_state({LifecycleState.IDLE, LifecycleState.BUSY}, timeout=self.ACTION_TIMEOUT_SECONDS)\n if started:\n return self._action_detail(\"runtime started\", timed_out=False)\n return self._action_detail(\"runtime start is still in progress\", timed_out=True)\n\n async def stop_runtime(self) -> dict[str, object] | str:\n self._refresh_state()\n if not self._started:\n if self._state == LifecycleState.STOPPING:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n return \"runtime already stopped\"\n\n self._state = LifecycleState.STOPPING\n try:\n self.workers.stop(timeout=self.ACTION_TIMEOUT_SECONDS, force=False)\n except TimeoutError:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n\n self._started = False\n self._state = LifecycleState.STOPPED\n return self._action_detail(\"runtime stopped\", timed_out=False)\n\n async def runtime_status(self) -> str:\n self._refresh_state()\n return self._state.value\n\n def _register_core_services(self) -> None:\n if self._core_registered:\n return\n self.services.register(\"configuration\", self.configuration)\n self.services.register(\"traces\", self.traces)\n self.services.register(\"health\", self.health)\n self.services.register(\"logs\", self.logs)\n self.services.register(\"workers\", self.workers)\n self.services.register(\"control_plane\", self.control_plane)\n self._core_registered = True\n\n def _register_health_contributors(self) -> None:\n for contributor in self.registry.health_contributors:\n self.health.register(contributor)\n\n def _register_workers(self) -> None:\n if self._workers_registered:\n return\n for worker in self.registry.workers:\n self.workers.register(worker)\n self._workers_registered = True\n\n def _refresh_state(self) -> None:\n lifecycle = self.workers.lifecycle_state()\n\n if self._state == LifecycleState.STOPPING:\n if lifecycle == LifecycleState.STOPPED:\n self._started = False\n self._state = LifecycleState.STOPPED\n return\n\n if not self._started:\n if lifecycle == LifecycleState.STOPPED:\n self._state = LifecycleState.STOPPED\n return\n\n self._state = lifecycle\n\n def _wait_for_state(self, target_states: set[LifecycleState], *, timeout: float) -> bool:\n deadline = monotonic() + timeout\n while monotonic() < deadline:\n self._refresh_state()\n if self._state in target_states:\n return True\n sleep(self.ACTION_POLL_INTERVAL_SECONDS)\n self._refresh_state()\n return self._state in target_states\n\n def _action_detail(self, message: str, *, timed_out: bool) -> dict[str, object]:\n self._refresh_state()\n return {\n \"message\": message,\n \"state\": self._state.value,\n \"timed_out\": timed_out,\n \"workers\": self.workers.snapshot(),\n }", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/core/runtime.py:RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.core.runtime", - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "llm_answer": "## Назначение класса `RuntimeManager`\nКласс `RuntimeManager` играет роль центрального координатора для управления жизненным циклом различных компонентов системы, предоставляя интерфейс для их регистрации, запуска и мониторинга. Он служит своего рода \"менеджером\" всех сервисов и модулей приложения, обеспечивая согласованное выполнение задач через заданные потоки данных и состояния.\n\n## Ключевые зависимости\nКлючевыми зависимостями являются компоненты и сервисы, которые управляются и координируются `RuntimeManager`. Вот основные зависимости, указанные в символическом каталоге (`C1_SYMBOL_CATALOG`) и графе зависимостей (`C2_DEPENDENCY_GRAPH`):\n\n- **ConfigurationManager**: отвечает за конфигурацию приложения;\n- **ServiceContainer**: содержит коллекцию зарегистрированных сервисов;\n- **TraceService**: сервис для отслеживания событий и действий;\n- **HealthRegistry**: регистрирует и мониторит состояние здоровья сервисов;\n- **LogManager**: управляет логированием событий;\n- **WorkerSupervisor**: следит за рабочими процессами и выполняет необходимые действия по управлению ими;\n- **ControlPlaneService**: центральный контроллер для координации действий и обработки запросов от клиентов.\n\n## Поток данных или вызовов\nОсновной сценарий работы выглядит следующим образом:\n\n1. **Инициализация** (`__init__` метод): \n - Создаются и инициализируются экземпляры необходимых служб и классов с использованием значений по умолчанию, если аргументы отсутствуют.\n \n2. **Регистрация модулей** (`register_module` метод):\n - Регистрируется модуль, добавляя его в реестр доступных сервисов (`registry`).\n \n3. **Запуск и мониторинг**:\n - Запускает различные службы и сервисы, обеспечивая синхронную работу процессов и мониторинг их состояний.\n - Поддерживает регистрацию и управление состоянием жизненных циклов этих служб, таких как регистрация основного модуля, рабочих модулей и контроль над рабочим процессом.\n\n## Важные детали реализации\nВот некоторые ключевые моменты, выявленные из анализа кода (`C0_SOURCE_CHUNKS`), символических объявлений (`C1_SYMBOL_CATALOG`) и графа зависимостей (`C2_DEPENDENCY_GRAPH`):\n\n### Общие наблюдения:\n- Класс использует паттерн \"синглтон\", так как существует только один экземпляр этого менеджера, управляемый всеми компонентами системы.\n- Метод `__init__` выполняет начальную настройку объектов при создании экземпляра класса.\n- Основное поведение реализуется через методы `register_module`, обеспечивающие гибкость добавления новых модулей и приложений.\n- Внутренний регистр (`registry`) используется для хранения зарегистрированных модулей и их экземпляров.\n\n### Дополнительные детали:\n- Переменные `_started`, `_core_registered`, `_workers_registered` используются для отслеживания текущего состояния и обеспечения корректного порядка выполнения операций.\n- Методы и переменные, связанные с управлением жизненным циклом (`_register_core_services`, `_stop_async`), играют важную роль в обеспечении корректной последовательности шагов при запуске и остановке системы.\n\n## Осторожные выводы\nНа основании доступного контекста и данных о слоях RAG сложно точно утверждать, что все аспекты поведения и взаимодействия полностью отражены. Некоторые элементы могут быть опущены или недостаточно детализированы в текущих источниках информации. Рекомендуется дополнительно изучить полный контекст исходного кода и документацию к проекту для более полного понимания.", - "summary": { - "router": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "confidence": null - }, - "retrieval": { - "profile": "code", - "layers_hit": [ - "C0_SOURCE_CHUNKS", - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS", - "C4_SEMANTIC_ROLES" - ], - "evidence_sufficient": true - }, - "llm": { - "answer_status": "answered", - "groundedness": "grounded" - } - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "RuntimeManager" - ], - "keyword_hints": [ - "RuntimeManager" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C0_SOURCE_CHUNKS": "exact_path_fetch", - "C4_SEMANTIC_ROLES": "exact_path_fetch", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C3_ENTRYPOINTS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 8, - "C4_SEMANTIC_ROLES": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C3_ENTRYPOINTS": 6 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C4_SEMANTIC_ROLES": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C4_SEMANTIC_ROLES", - "query": "RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - }, - { - "layer": "C3_ENTRYPOINTS", - "query": "RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 1, - "candidates_after_filter": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 6, - "candidates_after_filter": 6 - }, - { - "layer": "C3_ENTRYPOINTS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 3, - "candidates_after_filter": 3 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "RuntimeManager", - "alternatives": [ - "RuntimeManager" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C4_SEMANTIC_ROLES", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 6, - "fail_reason": null - }, - { - "layer": "C3_ENTRYPOINTS", - "status": "hit", - "hit_count": 3, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "router": 1, - "symbol_resolution": 0, - "retrieval_total": 169, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 45, - "C0_SOURCE_CHUNKS": 17, - "C4_SEMANTIC_ROLES": 15, - "C2_DEPENDENCY_GRAPH": 57, - "C3_ENTRYPOINTS": 9 - }, - "merge_rank": 18, - "prompt_build": 0, - "llm_call": 4743 - }, - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 797, - "evidence_rows": 12, - "evidence_chars": 7130 - }, - "evidence_summary": [ - { - "layer": "C1_SYMBOL_CATALOG", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "count": 6, - "unique_paths": 2 - }, - { - "layer": "C3_ENTRYPOINTS", - "count": 3, - "unique_paths": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 1, - "unique_paths": 1 - } - ], - "prompt_template_id": "intent_code_qa_explain_ru_v1", - "system_prompt_version": "v1" - }, - "router": { - "conversation_mode": "START", - "keyword_hints": [ - "RuntimeManager" - ], - "path_scope": [] - }, - "llm": { - "used_evidence_count": 12, - "missing_evidence_reason": null - } - }, - "run_info": { - "case_id": "plba-fullchain-explain-runtime-manager", - "mode": "full_chain", - "run_started_at": "2026-03-12T11:56:42", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - }, - "input_request": { - "text": "Объясни как работает класс RuntimeManager", - "normalized_query": "Объясни как работает класс RuntimeManager" - }, - "steps": [ - { - "step": "intent_router", - "input": { - "query": "Объясни как работает класс RuntimeManager" - }, - "output": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Объясни как работает класс RuntimeManager" - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "RuntimeManager" - ], - "keyword_hints": [ - "RuntimeManager" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "timings_ms": { - "router": 1 - } - } - }, - { - "step": "retrieval", - "input": { - "query": "Объясни как работает класс RuntimeManager" - }, - "output": { - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "RuntimeManager", - "alternatives": [ - "RuntimeManager" - ], - "confidence": 0.99 - }, - "rag_count": 12, - "rag_rows": [ - { - "path": "src/app_runtime/core/runtime.py", - "content": "class RuntimeManager\nRuntimeManager", - "layer": "C1_SYMBOL_CATALOG", - "title": "RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "7e4a9381328c5803bbc6179458612fc4e947d928aa7bf8b4b2bebb2c8592f758", - "qname": "RuntimeManager", - "kind": "class", - "signature": "RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.core.runtime", - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests manager\n- orchestrates role-like calls (4)\n- reads and writes state attributes\n- participates in dataflow slices (50)", - "layer": "C4_SEMANTIC_ROLES", - "title": "RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 43, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "7e4a9381328c5803bbc6179458612fc4e947d928aa7bf8b4b2bebb2c8592f758", - "symbol_name": "RuntimeManager", - "qname": "RuntimeManager", - "role": "pipeline_stage", - "confidence": 0.67, - "dataflow_participation": 50, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.stop", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 25, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d", - "dst_ref": "ControlPlaneService.stop", - "resolution": "resolved", - "slice_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.stop" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._stop_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 51, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a", - "dst_ref": "ControlPlaneService._stop_async", - "resolution": "resolved", - "slice_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._stop_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.register_channel", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 17, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957", - "dst_ref": "ControlPlaneService.register_channel", - "resolution": "resolved", - "slice_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.register_channel" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.start", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 20, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154", - "dst_ref": "ControlPlaneService.start", - "resolution": "resolved", - "slice_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.start" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._start_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 47, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517", - "dst_ref": "ControlPlaneService._start_async", - "resolution": "resolved", - "slice_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._start_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager.add_config_file", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 32, - "span_end": 52, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "a23b8a11ebdb12708b60c96ea12a69f7f042082f1adfddd572444e246d81d167", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "57ffbd4f0d9fdf3507c2b8624312ce211f3d02fdf86a57a8ec90778d8a7b498d", - "dst_ref": "RuntimeManager.add_config_file", - "resolution": "resolved", - "slice_id": "a23b8a11ebdb12708b60c96ea12a69f7f042082f1adfddd572444e246d81d167", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager.add_config_file" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "57ffbd4f0d9fdf3507c2b8624312ce211f3d02fdf86a57a8ec90778d8a7b498d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "class RuntimeManager:\n ACTION_TIMEOUT_SECONDS = 10.0\n ACTION_POLL_INTERVAL_SECONDS = 0.05\n\n def __init__(\n self,\n configuration: ConfigurationManager | None = None,\n services: ServiceContainer | None = None,\n traces: TraceService | None = None,\n health: HealthRegistry | None = None,\n logs: LogManager | None = None,\n workers: WorkerSupervisor | None = None,\n control_plane: ControlPlaneService | None = None,\n ) -> None:\n self.configuration = configuration or ConfigurationManager()\n self.services = services or ServiceContainer()\n self.traces = traces or TraceService()\n self.health = health or HealthRegistry()\n self.logs = logs or LogManager()\n self.workers = workers or WorkerSupervisor()\n self.control_plane = control_plane or ControlPlaneService()\n self.registry = ModuleRegistry(self.services)\n self._started = False\n self._state = LifecycleState.IDLE\n self._core_registered = False\n self._workers_registered = False\n self._register_core_services()\n\n def register_module(self, module: ApplicationModule) -> None:\n self.registry.register_module(module.name)\n module.register(self.registry)\n\n def add_config_file(self, path: str) -> FileConfigProvider:\n provider = FileConfigProvider(path)\n self.configuration.add_provider(provider)\n return provider\n\n def start(self, *, start_control_plane: bool = True) -> None:\n if self._started:\n return\n self._state = LifecycleState.STARTING\n config = self.configuration.load()\n self.logs.apply_config(config)\n self._register_health_contributors()\n self._register_workers()\n self.workers.start()\n if start_control_plane:\n self.control_plane.start(self)\n self._started = True\n self._refresh_state()\n\n def stop(self, timeout: float = 30.0, force: bool = False, stop_control_plane: bool = True) -> None:\n if not self._started:\n return\n self._state = LifecycleState.STOPPING\n self.workers.stop(timeout=timeout, force=force)\n if stop_control_plane:\n self.control_plane.stop()\n self._started = False\n self._state = LifecycleState.STOPPED\n\n def status(self) -> dict[str, object]:\n self._refresh_state()\n return self.control_plane.snapshot(self)\n\n def current_health(self) -> HealthPayload:\n self._refresh_state()\n return self.health.payload(self._state, self.workers.healths())\n\n async def health_status(self) -> HealthPayload:\n return self.current_health()\n\n async def start_runtime(self) -> dict[str, object] | str:\n self._refresh_state()\n if self._started:\n return \"runtime already running\"\n if self._state == LifecycleState.STOPPING:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n\n self.start(start_control_plane=False)\n started = self._wait_for_state({LifecycleState.IDLE, LifecycleState.BUSY}, timeout=self.ACTION_TIMEOUT_SECONDS)\n if started:\n return self._action_detail(\"runtime started\", timed_out=False)\n return self._action_detail(\"runtime start is still in progress\", timed_out=True)\n\n async def stop_runtime(self) -> dict[str, object] | str:\n self._refresh_state()\n if not self._started:\n if self._state == LifecycleState.STOPPING:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n return \"runtime already stopped\"\n\n self._state = LifecycleState.STOPPING\n try:\n self.workers.stop(timeout=self.ACTION_TIMEOUT_SECONDS, force=False)\n except TimeoutError:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n\n self._started = False\n self._state = LifecycleState.STOPPED\n return self._action_detail(\"runtime stopped\", timed_out=False)\n\n async def runtime_status(self) -> str:\n self._refresh_state()\n return self._state.value\n\n def _register_core_services(self) -> None:\n if self._core_registered:\n return\n self.services.register(\"configuration\", self.configuration)\n self.services.register(\"traces\", self.traces)\n self.services.register(\"health\", self.health)\n self.services.register(\"logs\", self.logs)\n self.services.register(\"workers\", self.workers)\n self.services.register(\"control_plane\", self.control_plane)\n self._core_registered = True\n\n def _register_health_contributors(self) -> None:\n for contributor in self.registry.health_contributors:\n self.health.register(contributor)\n\n def _register_workers(self) -> None:\n if self._workers_registered:\n return\n for worker in self.registry.workers:\n self.workers.register(worker)\n self._workers_registered = True\n\n def _refresh_state(self) -> None:\n lifecycle = self.workers.lifecycle_state()\n\n if self._state == LifecycleState.STOPPING:\n if lifecycle == LifecycleState.STOPPED:\n self._started = False\n self._state = LifecycleState.STOPPED\n return\n\n if not self._started:\n if lifecycle == LifecycleState.STOPPED:\n self._state = LifecycleState.STOPPED\n return\n\n self._state = lifecycle\n\n def _wait_for_state(self, target_states: set[LifecycleState], *, timeout: float) -> bool:\n deadline = monotonic() + timeout\n while monotonic() < deadline:\n self._refresh_state()\n if self._state in target_states:\n return True\n sleep(self.ACTION_POLL_INTERVAL_SECONDS)\n self._refresh_state()\n return self._state in target_states\n\n def _action_detail(self, message: str, *, timed_out: bool) -> dict[str, object]:\n self._refresh_state()\n return {\n \"message\": message,\n \"state\": self._state.value,\n \"timed_out\": timed_out,\n \"workers\": self.workers.snapshot(),\n }", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/core/runtime.py:RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.core.runtime", - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ] - }, - "diagnostics": { - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C0_SOURCE_CHUNKS": "exact_path_fetch", - "C4_SEMANTIC_ROLES": "exact_path_fetch", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C3_ENTRYPOINTS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 8, - "C4_SEMANTIC_ROLES": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C3_ENTRYPOINTS": 6 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C4_SEMANTIC_ROLES": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C4_SEMANTIC_ROLES", - "query": "RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - }, - { - "layer": "C3_ENTRYPOINTS", - "query": "RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 1, - "candidates_after_filter": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 6, - "candidates_after_filter": 6 - }, - { - "layer": "C3_ENTRYPOINTS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 3, - "candidates_after_filter": 3 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "RuntimeManager", - "alternatives": [ - "RuntimeManager" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C4_SEMANTIC_ROLES", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 6, - "fail_reason": null - }, - { - "layer": "C3_ENTRYPOINTS", - "status": "hit", - "hit_count": 3, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "symbol_resolution": 0, - "retrieval_total": 169, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 45, - "C0_SOURCE_CHUNKS": 17, - "C4_SEMANTIC_ROLES": 15, - "C2_DEPENDENCY_GRAPH": 57, - "C3_ENTRYPOINTS": 9 - }, - "merge_rank": 18 - } - } - }, - { - "step": "llm_answer", - "input": { - "query": "Объясни как работает класс RuntimeManager", - "rag_count": 12 - }, - "output": { - "llm_answer": "## Назначение класса `RuntimeManager`\nКласс `RuntimeManager` играет роль центрального координатора для управления жизненным циклом различных компонентов системы, предоставляя интерфейс для их регистрации, запуска и мониторинга. Он служит своего рода \"менеджером\" всех сервисов и модулей приложения, обеспечивая согласованное выполнение задач через заданные потоки данных и состояния.\n\n## Ключевые зависимости\nКлючевыми зависимостями являются компоненты и сервисы, которые управляются и координируются `RuntimeManager`. Вот основные зависимости, указанные в символическом каталоге (`C1_SYMBOL_CATALOG`) и графе зависимостей (`C2_DEPENDENCY_GRAPH`):\n\n- **ConfigurationManager**: отвечает за конфигурацию приложения;\n- **ServiceContainer**: содержит коллекцию зарегистрированных сервисов;\n- **TraceService**: сервис для отслеживания событий и действий;\n- **HealthRegistry**: регистрирует и мониторит состояние здоровья сервисов;\n- **LogManager**: управляет логированием событий;\n- **WorkerSupervisor**: следит за рабочими процессами и выполняет необходимые действия по управлению ими;\n- **ControlPlaneService**: центральный контроллер для координации действий и обработки запросов от клиентов.\n\n## Поток данных или вызовов\nОсновной сценарий работы выглядит следующим образом:\n\n1. **Инициализация** (`__init__` метод): \n - Создаются и инициализируются экземпляры необходимых служб и классов с использованием значений по умолчанию, если аргументы отсутствуют.\n \n2. **Регистрация модулей** (`register_module` метод):\n - Регистрируется модуль, добавляя его в реестр доступных сервисов (`registry`).\n \n3. **Запуск и мониторинг**:\n - Запускает различные службы и сервисы, обеспечивая синхронную работу процессов и мониторинг их состояний.\n - Поддерживает регистрацию и управление состоянием жизненных циклов этих служб, таких как регистрация основного модуля, рабочих модулей и контроль над рабочим процессом.\n\n## Важные детали реализации\nВот некоторые ключевые моменты, выявленные из анализа кода (`C0_SOURCE_CHUNKS`), символических объявлений (`C1_SYMBOL_CATALOG`) и графа зависимостей (`C2_DEPENDENCY_GRAPH`):\n\n### Общие наблюдения:\n- Класс использует паттерн \"синглтон\", так как существует только один экземпляр этого менеджера, управляемый всеми компонентами системы.\n- Метод `__init__` выполняет начальную настройку объектов при создании экземпляра класса.\n- Основное поведение реализуется через методы `register_module`, обеспечивающие гибкость добавления новых модулей и приложений.\n- Внутренний регистр (`registry`) используется для хранения зарегистрированных модулей и их экземпляров.\n\n### Дополнительные детали:\n- Переменные `_started`, `_core_registered`, `_workers_registered` используются для отслеживания текущего состояния и обеспечения корректного порядка выполнения операций.\n- Методы и переменные, связанные с управлением жизненным циклом (`_register_core_services`, `_stop_async`), играют важную роль в обеспечении корректной последовательности шагов при запуске и остановке системы.\n\n## Осторожные выводы\nНа основании доступного контекста и данных о слоях RAG сложно точно утверждать, что все аспекты поведения и взаимодействия полностью отражены. Некоторые элементы могут быть опущены или недостаточно детализированы в текущих источниках информации. Рекомендуется дополнительно изучить полный контекст исходного кода и документацию к проекту для более полного понимания." - }, - "diagnostics": { - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 797, - "evidence_rows": 12, - "evidence_chars": 7130 - }, - "evidence_summary": [ - { - "layer": "C1_SYMBOL_CATALOG", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "count": 6, - "unique_paths": 2 - }, - { - "layer": "C3_ENTRYPOINTS", - "count": 3, - "unique_paths": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 1, - "unique_paths": 1 - } - ], - "prompt_template_id": "intent_code_qa_explain_ru_v1", - "system_prompt_version": "v1" - }, - "timings_ms": { - "prompt_build": 0, - "llm_call": 4743 - } - } - } - ] - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents/20260312_115642/full_chain_plba_code_subintents_plba-fullchain-explain-runtime-manager.md b/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents/20260312_115642/full_chain_plba_code_subintents_plba-fullchain-explain-runtime-manager.md deleted file mode 100644 index 52d1113..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents/20260312_115642/full_chain_plba_code_subintents_plba-fullchain-explain-runtime-manager.md +++ /dev/null @@ -1,34 +0,0 @@ -# plba-fullchain-explain-runtime-manager - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_subintents.yaml -- runner: runtime -- mode: full_chain -- passed: True - -## Query -Объясни как работает класс RuntimeManager - -## Actual -{ - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 12, - "llm_answer": "## Назначение класса `RuntimeManager`\nКласс `RuntimeManager` играет роль центрального координатора для управления жизненным циклом различных компонентов системы, предоставляя интерфейс для их регистрации, запуска и мониторинга. Он служит своего рода \"менеджером\" всех сервисов и модулей приложения, обеспечивая согласованное выполнение задач через заданные потоки данных и состояния.\n\n## Ключевые зависимости\nКлючевыми зависимостями являются компоненты и сервисы, которые управляются и координируются `RuntimeManager`. Вот основные зависимости, указанные в символическом каталоге (`C1_SYMBOL_CATALOG`) и графе зависимостей (`C2_DEPENDENCY_GRAPH`):\n\n- **ConfigurationManager**: отвечает за конфигурацию приложения;\n- **ServiceContainer**: содержит коллекцию зарегистрированных сервисов;\n- **TraceService**: сервис для отслеживания событий и действий;\n- **HealthRegistry**: регистрирует и мониторит состояние здоровья сервисов;\n- **LogManager**: управляет логированием событий;\n- **WorkerSupervisor**: следит за рабочими процессами и выполняет необходимые действия по управлению ими;\n- **ControlPlaneService**: центральный контроллер для координации действий и обработки запросов от клиентов.\n\n## Поток данных или вызовов\nОсновной сценарий работы выглядит следующим образом:\n\n1. **Инициализация** (`__init__` метод): \n - Создаются и инициализируются экземпляры необходимых служб и классов с использованием значений по умолчанию, если аргументы отсутствуют.\n \n2. **Регистрация модулей** (`register_module` метод):\n - Регистрируется модуль, добавляя его в реестр доступных сервисов (`registry`).\n \n3. **Запуск и мониторинг**:\n - Запускает различные службы и сервисы, обеспечивая синхронную работу процессов и мониторинг их состояний.\n - Поддерживает регистрацию и управление состоянием жизненных циклов этих служб, таких как регистрация основного модуля, рабочих модулей и контроль над рабочим процессом.\n\n## Важные детали реализации\nВот некоторые ключевые моменты, выявленные из анализа кода (`C0_SOURCE_CHUNKS`), символических объявлений (`C1_SYMBOL_CATALOG`) и графа зависимостей (`C2_DEPENDENCY_GRAPH`):\n\n### Общие наблюдения:\n- Класс использует паттерн \"синглтон\", так как существует только один экземпляр этого менеджера, управляемый всеми компонентами системы.\n- Метод `__init__` выполняет начальную настройку объектов при создании экземпляра класса.\n- Основное поведение реализуется через методы `register_module`, обеспечивающие гибкость добавления новых модулей и приложений.\n- Внутренний регистр (`registry`) используется для хранения зарегистрированных модулей и их экземпляров.\n\n### Дополнительные детали:\n- Переменные `_started`, `_core_registered`, `_workers_registered` используются для отслеживания текущего состояния и обеспечения корректного порядка выполнения операций.\n- Методы и переменные, связанные с управлением жизненным циклом (`_register_core_services`, `_stop_async`), играют важную роль в обеспечении корректной последовательности шагов при запуске и остановке системы.\n\n## Осторожные выводы\nНа основании доступного контекста и данных о слоях RAG сложно точно утверждать, что все аспекты поведения и взаимодействия полностью отражены. Некоторые элементы могут быть опущены или недостаточно детализированы в текущих источниках информации. Рекомендуется дополнительно изучить полный контекст исходного кода и документацию к проекту для более полного понимания.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "RuntimeManager" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] -} - -## Mismatches -- none \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents/20260312_115642/full_chain_plba_code_subintents_plba-fullchain-find-entrypoints.json b/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents/20260312_115642/full_chain_plba_code_subintents_plba-fullchain-find-entrypoints.json deleted file mode 100644 index 3632803..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents/20260312_115642/full_chain_plba_code_subintents_plba-fullchain-find-entrypoints.json +++ /dev/null @@ -1,1196 +0,0 @@ -{ - "case_id": "plba-fullchain-find-entrypoints", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_subintents.yaml", - "runner": "runtime", - "mode": "full_chain", - "actual": { - "intent": "CODE_QA", - "sub_intent": "FIND_ENTRYPOINTS", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 9, - "llm_answer": "Финальный ответ:\n\nВ предоставленном контексте обнаружены следующие точки входа и обработчики запуска (entrypoints):\n\n1. **src/app_runtime/control/http_app.py | app.post**\n - Файл: `http_app.py`\n - Сущность: `app.post`\n - Описание: Обработчик HTTP POST-запросов для FastAPI приложения.\n\n2. **src/app_runtime/control/http_app.py | app.get**\n - Файл: `http_app.py`\n - Сущность: `app.get`\n - Описание: Обработчик HTTP GET-запросов для FastAPI приложения.\n\nНаиболее вероятные пропущенные или скрытые точки входа включают файлы и сущности, связанные с начальной настройкой и конфигурацией приложения:\n\n- src/app_runtime/config/__init__.py\n - Файл: `config/__init__.py`\n - Возможная сущность: `ConfigFileLoader`, `FileConfigProvider`\n - Роль: Загрузка конфигурации из файла и предоставление настроек приложению.\n\nЭти дополнительные точки входа важны для инициализации и настройки окружения перед запуском основного функционала приложения через HTTP-обработчики.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [], - "layers": [ - "C3_ENTRYPOINTS", - "C0_SOURCE_CHUNKS" - ] - }, - "passed": true, - "mismatches": [], - "details": { - "case_id": "plba-fullchain-find-entrypoints", - "text": "Найди точки входа в коде", - "mode": "full_chain", - "run_started_at": "2026-03-12T11:56:42", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Найди точки входа в коде", - "symbol_resolution": { - "status": "not_requested", - "resolved_symbol": null, - "alternatives": [], - "confidence": 0.0 - }, - "rag_count": 9, - "rag_rows": [ - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/contracts/result.py", - "content": "class StepResult:\n transition: str = \"success\"\n updates: dict[str, Any] = field(default_factory=dict)\n status: str = \"completed\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/workflow/contracts/result.py:StepResult", - "span_start": 8, - "span_end": 11, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.workflow.contracts.result", - "is_test": false, - "blob_sha": "6e57dbfe22873f097f11228a26cffa415440a43b68a737b220906461cd86c353", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/config/__init__.py", - "content": "from app_runtime.config.file_loader import ConfigFileLoader\nfrom app_runtime.config.providers import FileConfigProvider\n\n__all__ = [\"ConfigFileLoader\", \"FileConfigProvider\"]", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/config/__init__.py:1-4", - "span_start": 1, - "span_end": 4, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.app_runtime.config.__init__", - "is_test": false, - "blob_sha": "612918029820a2a983330ec92256142b55b9de4bdf3399ece18e2a02dbad9729", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/__init__.py", - "content": "__all__: list[str] = []", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/__init__.py:1-1", - "span_start": 1, - "span_end": 1, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.app_runtime.__init__", - "is_test": false, - "blob_sha": "8eea9df4f6d7b38ca0e39ccc27b04700e3d08dbeec8046d613d22706d19985fa", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/config/file_loader.py", - "content": "class ConfigFileLoader:\n def __init__(self, path: str | Path) -> None:\n self.path = Path(path)\n self.config: Any = None\n self.last_valid_config: Any = None\n self._last_seen_hash: str | None = None\n\n def read_text(self) -> str:\n return self.path.read_text(encoding=\"utf-8\")\n\n def parse(self, data: str) -> Any:\n suffix = self.path.suffix.lower()\n if suffix in {\".yml\", \".yaml\"}:\n return yaml.safe_load(data)\n return json.loads(data)\n\n def load_sync(self) -> Any:\n data = self.read_text()\n parsed = self.parse(data)\n self.config = parsed\n self.last_valid_config = parsed\n self._last_seen_hash = self._calculate_hash(data)\n return parsed\n\n def load_if_changed(self) -> tuple[bool, Any]:\n data = self.read_text()\n current_hash = self._calculate_hash(data)\n if current_hash == self._last_seen_hash:\n return False, self.config\n parsed = self.parse(data)\n self.config = parsed\n self.last_valid_config = parsed\n self._last_seen_hash = current_hash\n return True, parsed\n\n @staticmethod\n def _calculate_hash(data: str) -> str:\n return hashlib.sha256(data.encode(\"utf-8\")).hexdigest()", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/config/file_loader.py:ConfigFileLoader", - "span_start": 11, - "span_end": 48, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.config.file_loader", - "is_test": false, - "blob_sha": "1f19ffebde5e38e4be5a5d5a678059a0f36dedb8fb8b3e00ab395c67106a87ea", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/config/providers.py", - "content": "class FileConfigProvider(ConfigProvider):\n def __init__(self, path: str | Path) -> None:\n self._loader = ConfigFileLoader(path)\n\n @property\n def loader(self) -> ConfigFileLoader:\n return self._loader\n\n def load(self) -> dict[str, Any]:\n config = self._loader.load_sync()\n if not isinstance(config, dict):\n raise TypeError(\"Config root must be a mapping\")\n return dict(config)", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/config/providers.py:FileConfigProvider", - "span_start": 10, - "span_end": 22, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.config.providers", - "is_test": false, - "blob_sha": "8c53ca0122d6df6c5763bca15e99434bb4daebd5a618b8fc927e9ae90b022e64", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "class ControlActionSet:\n health: HealthHandler\n start: ActionHandler\n stop: ActionHandler\n status: ActionHandler", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/base.py:ControlActionSet", - "span_start": 14, - "span_end": 18, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.base", - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "llm_answer": "Финальный ответ:\n\nВ предоставленном контексте обнаружены следующие точки входа и обработчики запуска (entrypoints):\n\n1. **src/app_runtime/control/http_app.py | app.post**\n - Файл: `http_app.py`\n - Сущность: `app.post`\n - Описание: Обработчик HTTP POST-запросов для FastAPI приложения.\n\n2. **src/app_runtime/control/http_app.py | app.get**\n - Файл: `http_app.py`\n - Сущность: `app.get`\n - Описание: Обработчик HTTP GET-запросов для FastAPI приложения.\n\nНаиболее вероятные пропущенные или скрытые точки входа включают файлы и сущности, связанные с начальной настройкой и конфигурацией приложения:\n\n- src/app_runtime/config/__init__.py\n - Файл: `config/__init__.py`\n - Возможная сущность: `ConfigFileLoader`, `FileConfigProvider`\n - Роль: Загрузка конфигурации из файла и предоставление настроек приложению.\n\nЭти дополнительные точки входа важны для инициализации и настройки окружения перед запуском основного функционала приложения через HTTP-обработчики.", - "summary": { - "router": { - "intent": "CODE_QA", - "sub_intent": "FIND_ENTRYPOINTS", - "confidence": null - }, - "retrieval": { - "profile": "code", - "layers_hit": [ - "C0_SOURCE_CHUNKS", - "C3_ENTRYPOINTS" - ], - "evidence_sufficient": true - }, - "llm": { - "answer_status": "answered", - "groundedness": "grounded" - } - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "FIND_ENTRYPOINTS", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C3_ENTRYPOINTS", - "C0_SOURCE_CHUNKS" - ], - "symbol_kind_hint": "unknown", - "symbol_candidates": [], - "keyword_hints": [], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "execution": { - "executed_layers": [ - "C3_ENTRYPOINTS", - "C0_SOURCE_CHUNKS" - ], - "retrieval_mode_by_layer": { - "C3_ENTRYPOINTS": "exact_path_fetch", - "C0_SOURCE_CHUNKS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C3_ENTRYPOINTS": 12, - "C0_SOURCE_CHUNKS": 6 - }, - "filters_by_layer": { - "C3_ENTRYPOINTS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C3_ENTRYPOINTS", - "query": "Найди точки входа в коде", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 12, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Найди точки входа в коде", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C3_ENTRYPOINTS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 3, - "candidates_after_filter": 3 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 6, - "candidates_after_filter": 6 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "not_requested", - "resolved_symbol": null, - "alternatives": [] - }, - "layers": [ - { - "layer": "C3_ENTRYPOINTS", - "status": "hit", - "hit_count": 3, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 6, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "router": 0, - "symbol_resolution": 0, - "retrieval_total": 48, - "retrieval_by_layer": { - "C3_ENTRYPOINTS": 27, - "C0_SOURCE_CHUNKS": 20 - }, - "merge_rank": 0, - "prompt_build": 0, - "llm_call": 1820 - }, - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 458, - "evidence_rows": 9, - "evidence_chars": 2228 - }, - "evidence_summary": [ - { - "layer": "C3_ENTRYPOINTS", - "count": 3, - "unique_paths": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 6, - "unique_paths": 6 - } - ], - "prompt_template_id": "intent_code_qa_find_entrypoints_ru_v1", - "system_prompt_version": "v1" - }, - "router": { - "conversation_mode": "START", - "keyword_hints": [], - "path_scope": [] - }, - "llm": { - "used_evidence_count": 9, - "missing_evidence_reason": null - } - }, - "run_info": { - "case_id": "plba-fullchain-find-entrypoints", - "mode": "full_chain", - "run_started_at": "2026-03-12T11:56:42", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - }, - "input_request": { - "text": "Найди точки входа в коде", - "normalized_query": "Найди точки входа в коде" - }, - "steps": [ - { - "step": "intent_router", - "input": { - "query": "Найди точки входа в коде" - }, - "output": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Найди точки входа в коде" - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "FIND_ENTRYPOINTS", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C3_ENTRYPOINTS", - "C0_SOURCE_CHUNKS" - ], - "symbol_kind_hint": "unknown", - "symbol_candidates": [], - "keyword_hints": [], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "timings_ms": { - "router": 0 - } - } - }, - { - "step": "retrieval", - "input": { - "query": "Найди точки входа в коде" - }, - "output": { - "symbol_resolution": { - "status": "not_requested", - "resolved_symbol": null, - "alternatives": [], - "confidence": 0.0 - }, - "rag_count": 9, - "rag_rows": [ - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/contracts/result.py", - "content": "class StepResult:\n transition: str = \"success\"\n updates: dict[str, Any] = field(default_factory=dict)\n status: str = \"completed\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/workflow/contracts/result.py:StepResult", - "span_start": 8, - "span_end": 11, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.workflow.contracts.result", - "is_test": false, - "blob_sha": "6e57dbfe22873f097f11228a26cffa415440a43b68a737b220906461cd86c353", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/config/__init__.py", - "content": "from app_runtime.config.file_loader import ConfigFileLoader\nfrom app_runtime.config.providers import FileConfigProvider\n\n__all__ = [\"ConfigFileLoader\", \"FileConfigProvider\"]", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/config/__init__.py:1-4", - "span_start": 1, - "span_end": 4, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.app_runtime.config.__init__", - "is_test": false, - "blob_sha": "612918029820a2a983330ec92256142b55b9de4bdf3399ece18e2a02dbad9729", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/__init__.py", - "content": "__all__: list[str] = []", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/__init__.py:1-1", - "span_start": 1, - "span_end": 1, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.app_runtime.__init__", - "is_test": false, - "blob_sha": "8eea9df4f6d7b38ca0e39ccc27b04700e3d08dbeec8046d613d22706d19985fa", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/config/file_loader.py", - "content": "class ConfigFileLoader:\n def __init__(self, path: str | Path) -> None:\n self.path = Path(path)\n self.config: Any = None\n self.last_valid_config: Any = None\n self._last_seen_hash: str | None = None\n\n def read_text(self) -> str:\n return self.path.read_text(encoding=\"utf-8\")\n\n def parse(self, data: str) -> Any:\n suffix = self.path.suffix.lower()\n if suffix in {\".yml\", \".yaml\"}:\n return yaml.safe_load(data)\n return json.loads(data)\n\n def load_sync(self) -> Any:\n data = self.read_text()\n parsed = self.parse(data)\n self.config = parsed\n self.last_valid_config = parsed\n self._last_seen_hash = self._calculate_hash(data)\n return parsed\n\n def load_if_changed(self) -> tuple[bool, Any]:\n data = self.read_text()\n current_hash = self._calculate_hash(data)\n if current_hash == self._last_seen_hash:\n return False, self.config\n parsed = self.parse(data)\n self.config = parsed\n self.last_valid_config = parsed\n self._last_seen_hash = current_hash\n return True, parsed\n\n @staticmethod\n def _calculate_hash(data: str) -> str:\n return hashlib.sha256(data.encode(\"utf-8\")).hexdigest()", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/config/file_loader.py:ConfigFileLoader", - "span_start": 11, - "span_end": 48, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.config.file_loader", - "is_test": false, - "blob_sha": "1f19ffebde5e38e4be5a5d5a678059a0f36dedb8fb8b3e00ab395c67106a87ea", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/config/providers.py", - "content": "class FileConfigProvider(ConfigProvider):\n def __init__(self, path: str | Path) -> None:\n self._loader = ConfigFileLoader(path)\n\n @property\n def loader(self) -> ConfigFileLoader:\n return self._loader\n\n def load(self) -> dict[str, Any]:\n config = self._loader.load_sync()\n if not isinstance(config, dict):\n raise TypeError(\"Config root must be a mapping\")\n return dict(config)", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/config/providers.py:FileConfigProvider", - "span_start": 10, - "span_end": 22, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.config.providers", - "is_test": false, - "blob_sha": "8c53ca0122d6df6c5763bca15e99434bb4daebd5a618b8fc927e9ae90b022e64", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "class ControlActionSet:\n health: HealthHandler\n start: ActionHandler\n stop: ActionHandler\n status: ActionHandler", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/base.py:ControlActionSet", - "span_start": 14, - "span_end": 18, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.base", - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ] - }, - "diagnostics": { - "execution": { - "executed_layers": [ - "C3_ENTRYPOINTS", - "C0_SOURCE_CHUNKS" - ], - "retrieval_mode_by_layer": { - "C3_ENTRYPOINTS": "exact_path_fetch", - "C0_SOURCE_CHUNKS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C3_ENTRYPOINTS": 12, - "C0_SOURCE_CHUNKS": 6 - }, - "filters_by_layer": { - "C3_ENTRYPOINTS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C3_ENTRYPOINTS", - "query": "Найди точки входа в коде", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 12, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Найди точки входа в коде", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C3_ENTRYPOINTS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 3, - "candidates_after_filter": 3 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 6, - "candidates_after_filter": 6 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "not_requested", - "resolved_symbol": null, - "alternatives": [] - }, - "layers": [ - { - "layer": "C3_ENTRYPOINTS", - "status": "hit", - "hit_count": 3, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 6, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "symbol_resolution": 0, - "retrieval_total": 48, - "retrieval_by_layer": { - "C3_ENTRYPOINTS": 27, - "C0_SOURCE_CHUNKS": 20 - }, - "merge_rank": 0 - } - } - }, - { - "step": "llm_answer", - "input": { - "query": "Найди точки входа в коде", - "rag_count": 9 - }, - "output": { - "llm_answer": "Финальный ответ:\n\nВ предоставленном контексте обнаружены следующие точки входа и обработчики запуска (entrypoints):\n\n1. **src/app_runtime/control/http_app.py | app.post**\n - Файл: `http_app.py`\n - Сущность: `app.post`\n - Описание: Обработчик HTTP POST-запросов для FastAPI приложения.\n\n2. **src/app_runtime/control/http_app.py | app.get**\n - Файл: `http_app.py`\n - Сущность: `app.get`\n - Описание: Обработчик HTTP GET-запросов для FastAPI приложения.\n\nНаиболее вероятные пропущенные или скрытые точки входа включают файлы и сущности, связанные с начальной настройкой и конфигурацией приложения:\n\n- src/app_runtime/config/__init__.py\n - Файл: `config/__init__.py`\n - Возможная сущность: `ConfigFileLoader`, `FileConfigProvider`\n - Роль: Загрузка конфигурации из файла и предоставление настроек приложению.\n\nЭти дополнительные точки входа важны для инициализации и настройки окружения перед запуском основного функционала приложения через HTTP-обработчики." - }, - "diagnostics": { - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 458, - "evidence_rows": 9, - "evidence_chars": 2228 - }, - "evidence_summary": [ - { - "layer": "C3_ENTRYPOINTS", - "count": 3, - "unique_paths": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 6, - "unique_paths": 6 - } - ], - "prompt_template_id": "intent_code_qa_find_entrypoints_ru_v1", - "system_prompt_version": "v1" - }, - "timings_ms": { - "prompt_build": 0, - "llm_call": 1820 - } - } - } - ] - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents/20260312_115642/full_chain_plba_code_subintents_plba-fullchain-find-entrypoints.md b/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents/20260312_115642/full_chain_plba_code_subintents_plba-fullchain-find-entrypoints.md deleted file mode 100644 index ae4d13d..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents/20260312_115642/full_chain_plba_code_subintents_plba-fullchain-find-entrypoints.md +++ /dev/null @@ -1,29 +0,0 @@ -# plba-fullchain-find-entrypoints - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_subintents.yaml -- runner: runtime -- mode: full_chain -- passed: True - -## Query -Найди точки входа в коде - -## Actual -{ - "intent": "CODE_QA", - "sub_intent": "FIND_ENTRYPOINTS", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 9, - "llm_answer": "Финальный ответ:\n\nВ предоставленном контексте обнаружены следующие точки входа и обработчики запуска (entrypoints):\n\n1. **src/app_runtime/control/http_app.py | app.post**\n - Файл: `http_app.py`\n - Сущность: `app.post`\n - Описание: Обработчик HTTP POST-запросов для FastAPI приложения.\n\n2. **src/app_runtime/control/http_app.py | app.get**\n - Файл: `http_app.py`\n - Сущность: `app.get`\n - Описание: Обработчик HTTP GET-запросов для FastAPI приложения.\n\nНаиболее вероятные пропущенные или скрытые точки входа включают файлы и сущности, связанные с начальной настройкой и конфигурацией приложения:\n\n- src/app_runtime/config/__init__.py\n - Файл: `config/__init__.py`\n - Возможная сущность: `ConfigFileLoader`, `FileConfigProvider`\n - Роль: Загрузка конфигурации из файла и предоставление настроек приложению.\n\nЭти дополнительные точки входа важны для инициализации и настройки окружения перед запуском основного функционала приложения через HTTP-обработчики.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [], - "layers": [ - "C3_ENTRYPOINTS", - "C0_SOURCE_CHUNKS" - ] -} - -## Mismatches -- none \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents/20260312_115642/full_chain_plba_code_subintents_plba-fullchain-find-tests-runtime-manager.json b/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents/20260312_115642/full_chain_plba_code_subintents_plba-fullchain-find-tests-runtime-manager.json deleted file mode 100644 index 8f0da42..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents/20260312_115642/full_chain_plba_code_subintents_plba-fullchain-find-tests-runtime-manager.json +++ /dev/null @@ -1,1879 +0,0 @@ -{ - "case_id": "plba-fullchain-find-tests-runtime-manager", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_subintents.yaml", - "runner": "runtime", - "mode": "full_chain", - "actual": { - "intent": "CODE_QA", - "sub_intent": "FIND_TESTS", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 16, - "llm_answer": "Прямые тесты для `RuntimeManager` найдены в следующих местах:\n\n1. **tests/test_runtime.py**:\n - `test_runtime_graceful_stop_waits_until_worker_finishes`: Проверяет корректное завершение работы менеджера при использовании команды остановки (`stop()`). Тестирует состояние процесса после завершения и правильность отображения статуса («busy» → «stopped»).\n - `test_runtime_runs_worker_routine_and_exposes_status`: Проверяет выполнение задачи и правильное отображение статуса работы модуля и самого менеджера (`idle`, успешная остановка).\n\nЭти тесты непосредственно работают с экземпляром `RuntimeManager`, создавая его, регистрируя модули и вызывая методы (например, `start()`, `stop()`), тем самым проверяя основные функциональные возможности объекта.\n\nИтоговый ответ:\nВ папке `tests` существует два теста, напрямую связанных с `RuntimeManager`. Они находятся в файле `test_runtime.py` и называются `test_runtime_graceful_stop_waits_until_worker_finishes` и `test_runtime_runs_worker_routine_and_exposes_status`. Эти тесты проверяют способность `RuntimeManager` правильно запускать задачи, отслеживать их статус и корректно завершаться по команде.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "RuntimeManager" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ] - }, - "passed": true, - "mismatches": [], - "details": { - "case_id": "plba-fullchain-find-tests-runtime-manager", - "text": "Где тесты для RuntimeManager?", - "mode": "full_chain", - "run_started_at": "2026-03-12T11:56:42", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Где тесты для RuntimeManager?", - "symbol_resolution": { - "status": "not_found", - "resolved_symbol": null, - "alternatives": [ - "RuntimeManager" - ], - "confidence": 0.0 - }, - "rag_count": 16, - "rag_rows": [ - { - "path": "tests/test_runtime.py", - "content": "test_runtime_runs_worker_routine_and_exposes_status instantiates RuntimeManager", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_runtime_runs_worker_routine_and_exposes_status:instantiates", - "span_start": 209, - "span_end": 209, - "lexical_rank": 6, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "c397a308e7824ba9fe400a754c7e15e66ea6f058d7f5d3e82bb002bb78b509d2", - "edge_type": "instantiates", - "src_symbol_id": "1c767eb5ee08e84f45b18c8ed7531ec0ed73c63fb1594823569672db7b21e992", - "src_qname": "test_runtime_runs_worker_routine_and_exposes_status", - "dst_symbol_id": "aeadc039653807b0da1ca6e3cc1078ee61cfc510b28e7f9c2ec04c59da43cc8d", - "dst_ref": "RuntimeManager", - "resolution": "resolved", - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_runtime.py", - "content": "test_runtime_graceful_stop_waits_until_worker_finishes instantiates RuntimeManager", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_runtime_graceful_stop_waits_until_worker_finishes:instantiates", - "span_start": 229, - "span_end": 229, - "lexical_rank": 6, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "76b4701262ccaa0a7a41691407c4ebdb2ca74a2415d89f0a38ef0d4f608bda93", - "edge_type": "instantiates", - "src_symbol_id": "1076e788e4a03b10d7bc1313a8ad46caa170c13cc026c6e4de994af1a6ae57bf", - "src_qname": "test_runtime_graceful_stop_waits_until_worker_finishes", - "dst_symbol_id": "aeadc039653807b0da1ca6e3cc1078ee61cfc510b28e7f9c2ec04c59da43cc8d", - "dst_ref": "RuntimeManager", - "resolution": "resolved", - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "_build_runtime instantiates RuntimeManager", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "_build_runtime:instantiates", - "span_start": 155, - "span_end": 155, - "lexical_rank": 6, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "7eb254d564944bab6272757ee5ef688862bd321e6941e2495dc942e03b1c9a25", - "edge_type": "instantiates", - "src_symbol_id": "db94031d5245bf82be836a109b4584b43b8e83d37a0f318e03f6c8191896d469", - "src_qname": "_build_runtime", - "dst_symbol_id": "a1572ea8183dc0cd6ddbc74342bbde8c28cecfde37ad40b62feff09f8d103d11", - "dst_ref": "RuntimeManager", - "resolution": "resolved", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "test_worker_wakes_up_with_configured_interval instantiates RuntimeManager", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_worker_wakes_up_with_configured_interval:instantiates", - "span_start": 167, - "span_end": 167, - "lexical_rank": 6, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "189aafc4de0b79c688668f25f0c87166a127df26bd2215452014713b65ef281a", - "edge_type": "instantiates", - "src_symbol_id": "65f877f78191d65e6a752e41cedc70ebc784c266804a55c1c56440336e1f0d6e", - "src_qname": "test_worker_wakes_up_with_configured_interval", - "dst_symbol_id": "a1572ea8183dc0cd6ddbc74342bbde8c28cecfde37ad40b62feff09f8d103d11", - "dst_ref": "RuntimeManager", - "resolution": "resolved", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "test_actions_stop_busy_worker_after_timeout\n -> BlockingRoutine\n -> BlockingRoutine.__init__\n -> BlockingRoutine._started\n -> BlockingRoutine.run", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_actions_stop_busy_worker_after_timeout:dataflow_slice", - "span_start": 42, - "span_end": 238, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 5, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "8e7db3d2a9226f1c1d9942ac6373cfcafa0d2276758ddb8a3d3c455a3d58024d", - "edge_type": "dataflow_slice", - "src_symbol_id": "66392d3222421d9ba16eda3554940b16e7d5a6f33aa08c5738d35af2e32f1e4a", - "src_qname": "test_actions_stop_busy_worker_after_timeout", - "dst_symbol_id": "d9841bdbb69706c988ae7ae6adf89928dc4fae45943f74064f5382177034ba04", - "dst_ref": "BlockingRoutine.run", - "resolution": "resolved", - "slice_id": "8e7db3d2a9226f1c1d9942ac6373cfcafa0d2276758ddb8a3d3c455a3d58024d", - "root_symbol_id": "66392d3222421d9ba16eda3554940b16e7d5a6f33aa08c5738d35af2e32f1e4a", - "path_symbols": [ - "test_actions_stop_busy_worker_after_timeout", - "BlockingRoutine", - "BlockingRoutine.__init__", - "BlockingRoutine._started", - "BlockingRoutine.run" - ], - "path_symbol_ids": [ - "66392d3222421d9ba16eda3554940b16e7d5a6f33aa08c5738d35af2e32f1e4a", - "a3349c5bc65e4003a4bbd6a8dbb7a54c337e12d1aed930caa701b12e520f1e67", - "486deeed3043c6db985aef258e96ddc67aa53608e67a83962fbd2471f649ddf1", - "d9841bdbb69706c988ae7ae6adf89928dc4fae45943f74064f5382177034ba04" - ], - "path_edge_types": [ - "instantiates", - "writes_attr", - "reads_attr" - ], - "path_length": 5, - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "test_actions_stop_busy_worker_before_timeout\n -> BlockingRoutine\n -> BlockingRoutine.__init__\n -> BlockingRoutine._release\n -> BlockingRoutine.run", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_actions_stop_busy_worker_before_timeout:dataflow_slice", - "span_start": 43, - "span_end": 212, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 5, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "8bd726155ba387d3579763ee84dfd2f9a90bc917da88f3b2e89416ab5c1254d6", - "edge_type": "dataflow_slice", - "src_symbol_id": "a0bb116ca9d909c93a285667ae033fbd1859b2dad7cf34fcb44816393ef6909c", - "src_qname": "test_actions_stop_busy_worker_before_timeout", - "dst_symbol_id": "d9841bdbb69706c988ae7ae6adf89928dc4fae45943f74064f5382177034ba04", - "dst_ref": "BlockingRoutine.run", - "resolution": "resolved", - "slice_id": "8bd726155ba387d3579763ee84dfd2f9a90bc917da88f3b2e89416ab5c1254d6", - "root_symbol_id": "a0bb116ca9d909c93a285667ae033fbd1859b2dad7cf34fcb44816393ef6909c", - "path_symbols": [ - "test_actions_stop_busy_worker_before_timeout", - "BlockingRoutine", - "BlockingRoutine.__init__", - "BlockingRoutine._release", - "BlockingRoutine.run" - ], - "path_symbol_ids": [ - "a0bb116ca9d909c93a285667ae033fbd1859b2dad7cf34fcb44816393ef6909c", - "a3349c5bc65e4003a4bbd6a8dbb7a54c337e12d1aed930caa701b12e520f1e67", - "486deeed3043c6db985aef258e96ddc67aa53608e67a83962fbd2471f649ddf1", - "d9841bdbb69706c988ae7ae6adf89928dc4fae45943f74064f5382177034ba04" - ], - "path_edge_types": [ - "instantiates", - "writes_attr", - "reads_attr" - ], - "path_length": 5, - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_runtime.py", - "content": "def test_runtime_graceful_stop_waits_until_worker_finishes() -> None:\n started = Event()\n release = Event()\n runtime = RuntimeManager()\n runtime.register_module(BlockingModule(started, release))\n runtime.start()\n assert started.wait(timeout=1.0) is True\n assert runtime.status()[\"runtime\"][\"state\"] == \"busy\"\n\n stop_thread = Thread(target=runtime.stop, kwargs={\"timeout\": 1.0}, daemon=True)\n stop_thread.start()\n sleep(0.1)\n assert stop_thread.is_alive() is True\n\n release.set()\n stop_thread.join(timeout=1.0)\n assert stop_thread.is_alive() is False\n assert runtime.status()[\"runtime\"][\"state\"] == \"stopped\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_runtime.py:test_runtime_graceful_stop_waits_until_worker_finishes", - "span_start": 226, - "span_end": 243, - "lexical_rank": 6, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 8, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_runtime", - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_runtime.py", - "content": "def test_runtime_runs_worker_routine_and_exposes_status(tmp_path) -> None:\n config_path = tmp_path / \"config.yml\"\n config_path.write_text(\n \"\"\"\nplatform:\n workers: 1\nlog:\n version: 1\n disable_existing_loggers: false\n handlers:\n console:\n class: logging.StreamHandler\n root:\n level: INFO\n handlers: [console]\n\"\"\".strip(),\n encoding=\"utf-8\",\n )\n runtime = RuntimeManager()\n runtime.add_config_file(config_path)\n module = ExampleModule()\n runtime.register_module(module)\n\n runtime.start()\n sleep(0.2)\n status = runtime.status()\n runtime.stop()\n\n assert module.routine.processed == [{\"id\": 1}]\n assert status[\"modules\"] == [\"example\"]\n assert status[\"runtime\"][\"state\"] == \"idle\"\n assert status[\"health\"][\"status\"] == \"ok\"\n assert status[\"config\"] == {\"platform\": {\"workers\": 1}, \"log\": status[\"config\"][\"log\"]}", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_runtime.py:test_runtime_runs_worker_routine_and_exposes_status", - "span_start": 191, - "span_end": 223, - "lexical_rank": 6, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 7, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_runtime", - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "def _build_runtime(worker: Worker, *, control_timeout: int = 1) -> tuple[RuntimeManager, str]:\n runtime = RuntimeManager()\n channel = HttpControlChannel(host=\"127.0.0.1\", port=0, timeout=control_timeout)\n runtime.control_plane.register_channel(channel)\n runtime.register_module(WorkerModule(worker))\n runtime.start()\n return runtime, f\"http://127.0.0.1:{channel.port}\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:_build_runtime", - "span_start": 154, - "span_end": 160, - "lexical_rank": 6, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 6, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "def test_worker_wakes_up_with_configured_interval() -> None:\n interval = 0.15\n routine = IntervalRoutine()\n worker = ScenarioWorker(\"interval-worker\", routine, interval=interval)\n runtime = RuntimeManager()\n runtime.register_module(WorkerModule(worker))\n\n runtime.start()\n try:\n assert routine.wait_runs(count=3, timeout=2.0) is True\n finally:\n runtime.stop()\n\n deltas = routine.deltas()\n assert len(deltas) >= 2\n assert all(delta >= interval * 0.7 for delta in deltas[:2])", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:test_worker_wakes_up_with_configured_interval", - "span_start": 163, - "span_end": 178, - "lexical_rank": 6, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 7, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "class BlockingRoutine:\n def __init__(self, started: Event, release: Event) -> None:\n self._started = started\n self._release = release\n\n def run(self) -> None:\n self._started.set()\n self._release.wait(timeout=5.0)", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:BlockingRoutine", - "span_start": 40, - "span_end": 47, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 1, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "class ScenarioWorker(Worker):\n def __init__(self, name: str, routine: object, *, interval: float = 0.05) -> None:\n self._name = name\n self._routine = routine\n self._interval = interval\n self._thread: Thread | None = None\n self._stop_requested = Event()\n self._in_flight = 0\n self._runs = 0\n self._lock = Lock()\n\n @property\n def name(self) -> str:\n return self._name\n\n @property\n def critical(self) -> bool:\n return True\n\n def start(self) -> None:\n if self._thread is not None and self._thread.is_alive():\n return\n self._stop_requested.clear()\n self._thread = Thread(target=self._loop, name=f\"{self._name}-thread\", daemon=True)\n self._thread.start()\n\n def stop(self, force: bool = False) -> None:\n self._stop_requested.set()\n\n def health(self) -> WorkerHealth:\n return WorkerHealth(name=self.name, status=\"ok\", critical=True, meta={\"runs\": self._runs})\n\n def status(self) -> WorkerStatus:\n thread_alive = self._thread is not None and self._thread.is_alive()\n with self._lock:\n in_flight = self._in_flight\n runs = self._runs\n if not thread_alive:\n state = \"stopped\"\n elif self._stop_requested.is_set():\n state = \"stopping\"\n elif in_flight > 0:\n state = \"busy\"\n else:\n state = \"idle\"\n return WorkerStatus(name=self.name, state=state, in_flight=in_flight, meta={\"runs\": runs})\n\n def _loop(self) -> None:\n while not self._stop_requested.is_set():\n with self._lock:\n self._in_flight += 1\n try:\n self._routine.run()\n with self._lock:\n self._runs += 1\n finally:\n with self._lock:\n self._in_flight -= 1\n if self._stop_requested.is_set():\n return\n sleep(self._interval)", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:ScenarioWorker", - "span_start": 50, - "span_end": 110, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 2, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "class WorkerModule(ApplicationModule):\n def __init__(self, worker: Worker) -> None:\n self._worker = worker\n\n @property\n def name(self) -> str:\n return \"business-tests\"\n\n def register(self, registry: ModuleRegistry) -> None:\n registry.add_worker(self._worker)", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:WorkerModule", - "span_start": 113, - "span_end": 122, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 3, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "def _http_call_json(\n base_url: str,\n path: str,\n *,\n method: str = \"GET\",\n headers: dict[str, str] | None = None,\n) -> tuple[int, dict[str, object]]:\n request = Request(f\"{base_url}{path}\", method=method, headers=headers or {})\n try:\n with urlopen(request, timeout=15.0) as response:\n status = response.status\n body = response.read()\n except HTTPError as error:\n status = error.code\n body = error.read()\n payload = json.loads(body.decode(\"utf-8\"))\n return status, payload", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:_http_call_json", - "span_start": 125, - "span_end": 141, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 4, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "class IntervalRoutine:\n calls: list[float] = field(default_factory=list)\n _lock: Lock = field(default_factory=Lock)\n\n def run(self) -> None:\n with self._lock:\n self.calls.append(monotonic())\n\n def wait_runs(self, count: int, timeout: float) -> bool:\n deadline = monotonic() + timeout\n while monotonic() < deadline:\n with self._lock:\n if len(self.calls) >= count:\n return True\n sleep(0.01)\n return False\n\n def deltas(self) -> list[float]:\n with self._lock:\n return [self.calls[index + 1] - self.calls[index] for index in range(len(self.calls) - 1)]", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:IntervalRoutine", - "span_start": 18, - "span_end": 37, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "def _poll_until_stopped(base_url: str, timeout: float = 2.0) -> bool:\n deadline = monotonic() + timeout\n while monotonic() < deadline:\n _, payload = _http_call_json(base_url, \"/actions/status\")\n if payload.get(\"detail\") == \"stopped\":\n return True\n sleep(0.05)\n return False", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:_poll_until_stopped", - "span_start": 144, - "span_end": 151, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 5, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "llm_answer": "Прямые тесты для `RuntimeManager` найдены в следующих местах:\n\n1. **tests/test_runtime.py**:\n - `test_runtime_graceful_stop_waits_until_worker_finishes`: Проверяет корректное завершение работы менеджера при использовании команды остановки (`stop()`). Тестирует состояние процесса после завершения и правильность отображения статуса («busy» → «stopped»).\n - `test_runtime_runs_worker_routine_and_exposes_status`: Проверяет выполнение задачи и правильное отображение статуса работы модуля и самого менеджера (`idle`, успешная остановка).\n\nЭти тесты непосредственно работают с экземпляром `RuntimeManager`, создавая его, регистрируя модули и вызывая методы (например, `start()`, `stop()`), тем самым проверяя основные функциональные возможности объекта.\n\nИтоговый ответ:\nВ папке `tests` существует два теста, напрямую связанных с `RuntimeManager`. Они находятся в файле `test_runtime.py` и называются `test_runtime_graceful_stop_waits_until_worker_finishes` и `test_runtime_runs_worker_routine_and_exposes_status`. Эти тесты проверяют способность `RuntimeManager` правильно запускать задачи, отслеживать их статус и корректно завершаться по команде.", - "summary": { - "router": { - "intent": "CODE_QA", - "sub_intent": "FIND_TESTS", - "confidence": null - }, - "retrieval": { - "profile": "code", - "layers_hit": [ - "C0_SOURCE_CHUNKS", - "C2_DEPENDENCY_GRAPH" - ], - "evidence_sufficient": true - }, - "llm": { - "answer_status": "answered", - "groundedness": "grounded" - } - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "FIND_TESTS", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "RuntimeManager" - ], - "keyword_hints": [ - "RuntimeManager" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**", - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "test_file_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "test_symbol_patterns": [ - "test_runtime_manager", - "TestRuntimeManager", - "RuntimeManager" - ], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C0_SOURCE_CHUNKS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C0_SOURCE_CHUNKS": 10 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [], - "include_globs": [ - "src", - "tests" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests" - ] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src", - "tests" - ], - "include_globs": [ - "src", - "tests" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests" - ] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src", - "tests" - ], - "include_globs": [ - "src", - "tests" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests" - ] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**", - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "Где тесты для RuntimeManager? test_runtime_manager TestRuntimeManager RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**", - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "top_k": 6, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Где тесты для RuntimeManager? test_runtime_manager TestRuntimeManager RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**", - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "top_k": 10, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [], - "normalized_include_globs": [ - "src", - "tests" - ], - "normalized_exclude_globs": [], - "normalized_prefer_globs": [ - "tests" - ], - "filter_stage": "post_rank", - "candidates_before_filter": 0, - "candidates_after_filter": 0 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src", - "tests" - ], - "normalized_include_globs": [ - "src", - "tests" - ], - "normalized_exclude_globs": [], - "normalized_prefer_globs": [ - "tests" - ], - "filter_stage": "post_rank", - "candidates_before_filter": 6, - "candidates_after_filter": 6 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src", - "tests" - ], - "normalized_include_globs": [ - "src", - "tests" - ], - "normalized_exclude_globs": [], - "normalized_prefer_globs": [ - "tests" - ], - "filter_stage": "post_rank", - "candidates_before_filter": 10, - "candidates_after_filter": 10 - } - ], - "fallback": { - "used": true, - "reason": "scope_relaxed_no_hits" - }, - "symbol_resolution": { - "status": "not_found", - "resolved_symbol": null, - "alternatives": [ - "RuntimeManager" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "miss", - "hit_count": 0, - "fail_reason": "scope_relaxed_no_hits" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 6, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 10, - "fail_reason": null - } - ] - }, - "constraint_violations": [ - { - "type": "LAYER_MISSING", - "severity": "warn", - "details": { - "layer": "C1_SYMBOL_CATALOG", - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ] - }, - "suggested_fix": "Increase top_k for this layer or relax constraints for retrieval." - } - ], - "timings_ms": { - "router": 1, - "symbol_resolution": 0, - "retrieval_total": 154, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 79, - "C2_DEPENDENCY_GRAPH": 54, - "C0_SOURCE_CHUNKS": 19 - }, - "merge_rank": 0, - "prompt_build": 0, - "llm_call": 1918 - }, - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 858, - "evidence_rows": 16, - "evidence_chars": 7086 - }, - "evidence_summary": [ - { - "layer": "C2_DEPENDENCY_GRAPH", - "count": 6, - "unique_paths": 2 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 10, - "unique_paths": 2 - } - ], - "prompt_template_id": "intent_code_qa_find_tests_ru_v1", - "system_prompt_version": "v1" - }, - "router": { - "conversation_mode": "START", - "keyword_hints": [ - "RuntimeManager" - ], - "path_scope": [] - }, - "llm": { - "used_evidence_count": 16, - "missing_evidence_reason": null - } - }, - "run_info": { - "case_id": "plba-fullchain-find-tests-runtime-manager", - "mode": "full_chain", - "run_started_at": "2026-03-12T11:56:42", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - }, - "input_request": { - "text": "Где тесты для RuntimeManager?", - "normalized_query": "Где тесты для RuntimeManager?" - }, - "steps": [ - { - "step": "intent_router", - "input": { - "query": "Где тесты для RuntimeManager?" - }, - "output": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Где тесты для RuntimeManager?" - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "FIND_TESTS", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "RuntimeManager" - ], - "keyword_hints": [ - "RuntimeManager" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**", - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "test_file_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "test_symbol_patterns": [ - "test_runtime_manager", - "TestRuntimeManager", - "RuntimeManager" - ], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "timings_ms": { - "router": 1 - } - } - }, - { - "step": "retrieval", - "input": { - "query": "Где тесты для RuntimeManager?" - }, - "output": { - "symbol_resolution": { - "status": "not_found", - "resolved_symbol": null, - "alternatives": [ - "RuntimeManager" - ], - "confidence": 0.0 - }, - "rag_count": 16, - "rag_rows": [ - { - "path": "tests/test_runtime.py", - "content": "test_runtime_runs_worker_routine_and_exposes_status instantiates RuntimeManager", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_runtime_runs_worker_routine_and_exposes_status:instantiates", - "span_start": 209, - "span_end": 209, - "lexical_rank": 6, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "c397a308e7824ba9fe400a754c7e15e66ea6f058d7f5d3e82bb002bb78b509d2", - "edge_type": "instantiates", - "src_symbol_id": "1c767eb5ee08e84f45b18c8ed7531ec0ed73c63fb1594823569672db7b21e992", - "src_qname": "test_runtime_runs_worker_routine_and_exposes_status", - "dst_symbol_id": "aeadc039653807b0da1ca6e3cc1078ee61cfc510b28e7f9c2ec04c59da43cc8d", - "dst_ref": "RuntimeManager", - "resolution": "resolved", - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_runtime.py", - "content": "test_runtime_graceful_stop_waits_until_worker_finishes instantiates RuntimeManager", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_runtime_graceful_stop_waits_until_worker_finishes:instantiates", - "span_start": 229, - "span_end": 229, - "lexical_rank": 6, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "76b4701262ccaa0a7a41691407c4ebdb2ca74a2415d89f0a38ef0d4f608bda93", - "edge_type": "instantiates", - "src_symbol_id": "1076e788e4a03b10d7bc1313a8ad46caa170c13cc026c6e4de994af1a6ae57bf", - "src_qname": "test_runtime_graceful_stop_waits_until_worker_finishes", - "dst_symbol_id": "aeadc039653807b0da1ca6e3cc1078ee61cfc510b28e7f9c2ec04c59da43cc8d", - "dst_ref": "RuntimeManager", - "resolution": "resolved", - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "_build_runtime instantiates RuntimeManager", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "_build_runtime:instantiates", - "span_start": 155, - "span_end": 155, - "lexical_rank": 6, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "7eb254d564944bab6272757ee5ef688862bd321e6941e2495dc942e03b1c9a25", - "edge_type": "instantiates", - "src_symbol_id": "db94031d5245bf82be836a109b4584b43b8e83d37a0f318e03f6c8191896d469", - "src_qname": "_build_runtime", - "dst_symbol_id": "a1572ea8183dc0cd6ddbc74342bbde8c28cecfde37ad40b62feff09f8d103d11", - "dst_ref": "RuntimeManager", - "resolution": "resolved", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "test_worker_wakes_up_with_configured_interval instantiates RuntimeManager", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_worker_wakes_up_with_configured_interval:instantiates", - "span_start": 167, - "span_end": 167, - "lexical_rank": 6, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "189aafc4de0b79c688668f25f0c87166a127df26bd2215452014713b65ef281a", - "edge_type": "instantiates", - "src_symbol_id": "65f877f78191d65e6a752e41cedc70ebc784c266804a55c1c56440336e1f0d6e", - "src_qname": "test_worker_wakes_up_with_configured_interval", - "dst_symbol_id": "a1572ea8183dc0cd6ddbc74342bbde8c28cecfde37ad40b62feff09f8d103d11", - "dst_ref": "RuntimeManager", - "resolution": "resolved", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "test_actions_stop_busy_worker_after_timeout\n -> BlockingRoutine\n -> BlockingRoutine.__init__\n -> BlockingRoutine._started\n -> BlockingRoutine.run", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_actions_stop_busy_worker_after_timeout:dataflow_slice", - "span_start": 42, - "span_end": 238, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 5, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "8e7db3d2a9226f1c1d9942ac6373cfcafa0d2276758ddb8a3d3c455a3d58024d", - "edge_type": "dataflow_slice", - "src_symbol_id": "66392d3222421d9ba16eda3554940b16e7d5a6f33aa08c5738d35af2e32f1e4a", - "src_qname": "test_actions_stop_busy_worker_after_timeout", - "dst_symbol_id": "d9841bdbb69706c988ae7ae6adf89928dc4fae45943f74064f5382177034ba04", - "dst_ref": "BlockingRoutine.run", - "resolution": "resolved", - "slice_id": "8e7db3d2a9226f1c1d9942ac6373cfcafa0d2276758ddb8a3d3c455a3d58024d", - "root_symbol_id": "66392d3222421d9ba16eda3554940b16e7d5a6f33aa08c5738d35af2e32f1e4a", - "path_symbols": [ - "test_actions_stop_busy_worker_after_timeout", - "BlockingRoutine", - "BlockingRoutine.__init__", - "BlockingRoutine._started", - "BlockingRoutine.run" - ], - "path_symbol_ids": [ - "66392d3222421d9ba16eda3554940b16e7d5a6f33aa08c5738d35af2e32f1e4a", - "a3349c5bc65e4003a4bbd6a8dbb7a54c337e12d1aed930caa701b12e520f1e67", - "486deeed3043c6db985aef258e96ddc67aa53608e67a83962fbd2471f649ddf1", - "d9841bdbb69706c988ae7ae6adf89928dc4fae45943f74064f5382177034ba04" - ], - "path_edge_types": [ - "instantiates", - "writes_attr", - "reads_attr" - ], - "path_length": 5, - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "test_actions_stop_busy_worker_before_timeout\n -> BlockingRoutine\n -> BlockingRoutine.__init__\n -> BlockingRoutine._release\n -> BlockingRoutine.run", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_actions_stop_busy_worker_before_timeout:dataflow_slice", - "span_start": 43, - "span_end": 212, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 5, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "8bd726155ba387d3579763ee84dfd2f9a90bc917da88f3b2e89416ab5c1254d6", - "edge_type": "dataflow_slice", - "src_symbol_id": "a0bb116ca9d909c93a285667ae033fbd1859b2dad7cf34fcb44816393ef6909c", - "src_qname": "test_actions_stop_busy_worker_before_timeout", - "dst_symbol_id": "d9841bdbb69706c988ae7ae6adf89928dc4fae45943f74064f5382177034ba04", - "dst_ref": "BlockingRoutine.run", - "resolution": "resolved", - "slice_id": "8bd726155ba387d3579763ee84dfd2f9a90bc917da88f3b2e89416ab5c1254d6", - "root_symbol_id": "a0bb116ca9d909c93a285667ae033fbd1859b2dad7cf34fcb44816393ef6909c", - "path_symbols": [ - "test_actions_stop_busy_worker_before_timeout", - "BlockingRoutine", - "BlockingRoutine.__init__", - "BlockingRoutine._release", - "BlockingRoutine.run" - ], - "path_symbol_ids": [ - "a0bb116ca9d909c93a285667ae033fbd1859b2dad7cf34fcb44816393ef6909c", - "a3349c5bc65e4003a4bbd6a8dbb7a54c337e12d1aed930caa701b12e520f1e67", - "486deeed3043c6db985aef258e96ddc67aa53608e67a83962fbd2471f649ddf1", - "d9841bdbb69706c988ae7ae6adf89928dc4fae45943f74064f5382177034ba04" - ], - "path_edge_types": [ - "instantiates", - "writes_attr", - "reads_attr" - ], - "path_length": 5, - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_runtime.py", - "content": "def test_runtime_graceful_stop_waits_until_worker_finishes() -> None:\n started = Event()\n release = Event()\n runtime = RuntimeManager()\n runtime.register_module(BlockingModule(started, release))\n runtime.start()\n assert started.wait(timeout=1.0) is True\n assert runtime.status()[\"runtime\"][\"state\"] == \"busy\"\n\n stop_thread = Thread(target=runtime.stop, kwargs={\"timeout\": 1.0}, daemon=True)\n stop_thread.start()\n sleep(0.1)\n assert stop_thread.is_alive() is True\n\n release.set()\n stop_thread.join(timeout=1.0)\n assert stop_thread.is_alive() is False\n assert runtime.status()[\"runtime\"][\"state\"] == \"stopped\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_runtime.py:test_runtime_graceful_stop_waits_until_worker_finishes", - "span_start": 226, - "span_end": 243, - "lexical_rank": 6, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 8, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_runtime", - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_runtime.py", - "content": "def test_runtime_runs_worker_routine_and_exposes_status(tmp_path) -> None:\n config_path = tmp_path / \"config.yml\"\n config_path.write_text(\n \"\"\"\nplatform:\n workers: 1\nlog:\n version: 1\n disable_existing_loggers: false\n handlers:\n console:\n class: logging.StreamHandler\n root:\n level: INFO\n handlers: [console]\n\"\"\".strip(),\n encoding=\"utf-8\",\n )\n runtime = RuntimeManager()\n runtime.add_config_file(config_path)\n module = ExampleModule()\n runtime.register_module(module)\n\n runtime.start()\n sleep(0.2)\n status = runtime.status()\n runtime.stop()\n\n assert module.routine.processed == [{\"id\": 1}]\n assert status[\"modules\"] == [\"example\"]\n assert status[\"runtime\"][\"state\"] == \"idle\"\n assert status[\"health\"][\"status\"] == \"ok\"\n assert status[\"config\"] == {\"platform\": {\"workers\": 1}, \"log\": status[\"config\"][\"log\"]}", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_runtime.py:test_runtime_runs_worker_routine_and_exposes_status", - "span_start": 191, - "span_end": 223, - "lexical_rank": 6, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 7, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_runtime", - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "def _build_runtime(worker: Worker, *, control_timeout: int = 1) -> tuple[RuntimeManager, str]:\n runtime = RuntimeManager()\n channel = HttpControlChannel(host=\"127.0.0.1\", port=0, timeout=control_timeout)\n runtime.control_plane.register_channel(channel)\n runtime.register_module(WorkerModule(worker))\n runtime.start()\n return runtime, f\"http://127.0.0.1:{channel.port}\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:_build_runtime", - "span_start": 154, - "span_end": 160, - "lexical_rank": 6, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 6, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "def test_worker_wakes_up_with_configured_interval() -> None:\n interval = 0.15\n routine = IntervalRoutine()\n worker = ScenarioWorker(\"interval-worker\", routine, interval=interval)\n runtime = RuntimeManager()\n runtime.register_module(WorkerModule(worker))\n\n runtime.start()\n try:\n assert routine.wait_runs(count=3, timeout=2.0) is True\n finally:\n runtime.stop()\n\n deltas = routine.deltas()\n assert len(deltas) >= 2\n assert all(delta >= interval * 0.7 for delta in deltas[:2])", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:test_worker_wakes_up_with_configured_interval", - "span_start": 163, - "span_end": 178, - "lexical_rank": 6, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 7, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "class BlockingRoutine:\n def __init__(self, started: Event, release: Event) -> None:\n self._started = started\n self._release = release\n\n def run(self) -> None:\n self._started.set()\n self._release.wait(timeout=5.0)", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:BlockingRoutine", - "span_start": 40, - "span_end": 47, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 1, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "class ScenarioWorker(Worker):\n def __init__(self, name: str, routine: object, *, interval: float = 0.05) -> None:\n self._name = name\n self._routine = routine\n self._interval = interval\n self._thread: Thread | None = None\n self._stop_requested = Event()\n self._in_flight = 0\n self._runs = 0\n self._lock = Lock()\n\n @property\n def name(self) -> str:\n return self._name\n\n @property\n def critical(self) -> bool:\n return True\n\n def start(self) -> None:\n if self._thread is not None and self._thread.is_alive():\n return\n self._stop_requested.clear()\n self._thread = Thread(target=self._loop, name=f\"{self._name}-thread\", daemon=True)\n self._thread.start()\n\n def stop(self, force: bool = False) -> None:\n self._stop_requested.set()\n\n def health(self) -> WorkerHealth:\n return WorkerHealth(name=self.name, status=\"ok\", critical=True, meta={\"runs\": self._runs})\n\n def status(self) -> WorkerStatus:\n thread_alive = self._thread is not None and self._thread.is_alive()\n with self._lock:\n in_flight = self._in_flight\n runs = self._runs\n if not thread_alive:\n state = \"stopped\"\n elif self._stop_requested.is_set():\n state = \"stopping\"\n elif in_flight > 0:\n state = \"busy\"\n else:\n state = \"idle\"\n return WorkerStatus(name=self.name, state=state, in_flight=in_flight, meta={\"runs\": runs})\n\n def _loop(self) -> None:\n while not self._stop_requested.is_set():\n with self._lock:\n self._in_flight += 1\n try:\n self._routine.run()\n with self._lock:\n self._runs += 1\n finally:\n with self._lock:\n self._in_flight -= 1\n if self._stop_requested.is_set():\n return\n sleep(self._interval)", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:ScenarioWorker", - "span_start": 50, - "span_end": 110, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 2, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "class WorkerModule(ApplicationModule):\n def __init__(self, worker: Worker) -> None:\n self._worker = worker\n\n @property\n def name(self) -> str:\n return \"business-tests\"\n\n def register(self, registry: ModuleRegistry) -> None:\n registry.add_worker(self._worker)", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:WorkerModule", - "span_start": 113, - "span_end": 122, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 3, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "def _http_call_json(\n base_url: str,\n path: str,\n *,\n method: str = \"GET\",\n headers: dict[str, str] | None = None,\n) -> tuple[int, dict[str, object]]:\n request = Request(f\"{base_url}{path}\", method=method, headers=headers or {})\n try:\n with urlopen(request, timeout=15.0) as response:\n status = response.status\n body = response.read()\n except HTTPError as error:\n status = error.code\n body = error.read()\n payload = json.loads(body.decode(\"utf-8\"))\n return status, payload", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:_http_call_json", - "span_start": 125, - "span_end": 141, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 4, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "class IntervalRoutine:\n calls: list[float] = field(default_factory=list)\n _lock: Lock = field(default_factory=Lock)\n\n def run(self) -> None:\n with self._lock:\n self.calls.append(monotonic())\n\n def wait_runs(self, count: int, timeout: float) -> bool:\n deadline = monotonic() + timeout\n while monotonic() < deadline:\n with self._lock:\n if len(self.calls) >= count:\n return True\n sleep(0.01)\n return False\n\n def deltas(self) -> list[float]:\n with self._lock:\n return [self.calls[index + 1] - self.calls[index] for index in range(len(self.calls) - 1)]", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:IntervalRoutine", - "span_start": 18, - "span_end": 37, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "def _poll_until_stopped(base_url: str, timeout: float = 2.0) -> bool:\n deadline = monotonic() + timeout\n while monotonic() < deadline:\n _, payload = _http_call_json(base_url, \"/actions/status\")\n if payload.get(\"detail\") == \"stopped\":\n return True\n sleep(0.05)\n return False", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:_poll_until_stopped", - "span_start": 144, - "span_end": 151, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 5, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ] - }, - "diagnostics": { - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C0_SOURCE_CHUNKS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C0_SOURCE_CHUNKS": 10 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [], - "include_globs": [ - "src", - "tests" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests" - ] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src", - "tests" - ], - "include_globs": [ - "src", - "tests" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests" - ] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src", - "tests" - ], - "include_globs": [ - "src", - "tests" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests" - ] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**", - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "Где тесты для RuntimeManager? test_runtime_manager TestRuntimeManager RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**", - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "top_k": 6, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Где тесты для RuntimeManager? test_runtime_manager TestRuntimeManager RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**", - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "top_k": 10, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [], - "normalized_include_globs": [ - "src", - "tests" - ], - "normalized_exclude_globs": [], - "normalized_prefer_globs": [ - "tests" - ], - "filter_stage": "post_rank", - "candidates_before_filter": 0, - "candidates_after_filter": 0 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src", - "tests" - ], - "normalized_include_globs": [ - "src", - "tests" - ], - "normalized_exclude_globs": [], - "normalized_prefer_globs": [ - "tests" - ], - "filter_stage": "post_rank", - "candidates_before_filter": 6, - "candidates_after_filter": 6 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src", - "tests" - ], - "normalized_include_globs": [ - "src", - "tests" - ], - "normalized_exclude_globs": [], - "normalized_prefer_globs": [ - "tests" - ], - "filter_stage": "post_rank", - "candidates_before_filter": 10, - "candidates_after_filter": 10 - } - ], - "fallback": { - "used": true, - "reason": "scope_relaxed_no_hits" - }, - "symbol_resolution": { - "status": "not_found", - "resolved_symbol": null, - "alternatives": [ - "RuntimeManager" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "miss", - "hit_count": 0, - "fail_reason": "scope_relaxed_no_hits" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 6, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 10, - "fail_reason": null - } - ] - }, - "constraint_violations": [ - { - "type": "LAYER_MISSING", - "severity": "warn", - "details": { - "layer": "C1_SYMBOL_CATALOG", - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ] - }, - "suggested_fix": "Increase top_k for this layer or relax constraints for retrieval." - } - ], - "timings_ms": { - "symbol_resolution": 0, - "retrieval_total": 154, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 79, - "C2_DEPENDENCY_GRAPH": 54, - "C0_SOURCE_CHUNKS": 19 - }, - "merge_rank": 0 - } - } - }, - { - "step": "llm_answer", - "input": { - "query": "Где тесты для RuntimeManager?", - "rag_count": 16 - }, - "output": { - "llm_answer": "Прямые тесты для `RuntimeManager` найдены в следующих местах:\n\n1. **tests/test_runtime.py**:\n - `test_runtime_graceful_stop_waits_until_worker_finishes`: Проверяет корректное завершение работы менеджера при использовании команды остановки (`stop()`). Тестирует состояние процесса после завершения и правильность отображения статуса («busy» → «stopped»).\n - `test_runtime_runs_worker_routine_and_exposes_status`: Проверяет выполнение задачи и правильное отображение статуса работы модуля и самого менеджера (`idle`, успешная остановка).\n\nЭти тесты непосредственно работают с экземпляром `RuntimeManager`, создавая его, регистрируя модули и вызывая методы (например, `start()`, `stop()`), тем самым проверяя основные функциональные возможности объекта.\n\nИтоговый ответ:\nВ папке `tests` существует два теста, напрямую связанных с `RuntimeManager`. Они находятся в файле `test_runtime.py` и называются `test_runtime_graceful_stop_waits_until_worker_finishes` и `test_runtime_runs_worker_routine_and_exposes_status`. Эти тесты проверяют способность `RuntimeManager` правильно запускать задачи, отслеживать их статус и корректно завершаться по команде." - }, - "diagnostics": { - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 858, - "evidence_rows": 16, - "evidence_chars": 7086 - }, - "evidence_summary": [ - { - "layer": "C2_DEPENDENCY_GRAPH", - "count": 6, - "unique_paths": 2 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 10, - "unique_paths": 2 - } - ], - "prompt_template_id": "intent_code_qa_find_tests_ru_v1", - "system_prompt_version": "v1" - }, - "timings_ms": { - "prompt_build": 0, - "llm_call": 1918 - } - } - } - ] - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents/20260312_115642/full_chain_plba_code_subintents_plba-fullchain-find-tests-runtime-manager.md b/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents/20260312_115642/full_chain_plba_code_subintents_plba-fullchain-find-tests-runtime-manager.md deleted file mode 100644 index 0775cad..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents/20260312_115642/full_chain_plba_code_subintents_plba-fullchain-find-tests-runtime-manager.md +++ /dev/null @@ -1,32 +0,0 @@ -# plba-fullchain-find-tests-runtime-manager - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_subintents.yaml -- runner: runtime -- mode: full_chain -- passed: True - -## Query -Где тесты для RuntimeManager? - -## Actual -{ - "intent": "CODE_QA", - "sub_intent": "FIND_TESTS", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 16, - "llm_answer": "Прямые тесты для `RuntimeManager` найдены в следующих местах:\n\n1. **tests/test_runtime.py**:\n - `test_runtime_graceful_stop_waits_until_worker_finishes`: Проверяет корректное завершение работы менеджера при использовании команды остановки (`stop()`). Тестирует состояние процесса после завершения и правильность отображения статуса («busy» → «stopped»).\n - `test_runtime_runs_worker_routine_and_exposes_status`: Проверяет выполнение задачи и правильное отображение статуса работы модуля и самого менеджера (`idle`, успешная остановка).\n\nЭти тесты непосредственно работают с экземпляром `RuntimeManager`, создавая его, регистрируя модули и вызывая методы (например, `start()`, `stop()`), тем самым проверяя основные функциональные возможности объекта.\n\nИтоговый ответ:\nВ папке `tests` существует два теста, напрямую связанных с `RuntimeManager`. Они находятся в файле `test_runtime.py` и называются `test_runtime_graceful_stop_waits_until_worker_finishes` и `test_runtime_runs_worker_routine_and_exposes_status`. Эти тесты проверяют способность `RuntimeManager` правильно запускать задачи, отслеживать их статус и корректно завершаться по команде.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "RuntimeManager" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ] -} - -## Mismatches -- none \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents/20260312_115642/full_chain_plba_code_subintents_plba-fullchain-open-file-runtime.json b/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents/20260312_115642/full_chain_plba_code_subintents_plba-fullchain-open-file-runtime.json deleted file mode 100644 index c2cf442..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents/20260312_115642/full_chain_plba_code_subintents_plba-fullchain-open-file-runtime.json +++ /dev/null @@ -1,492 +0,0 @@ -{ - "case_id": "plba-fullchain-open-file-runtime", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_subintents.yaml", - "runner": "runtime", - "mode": "full_chain", - "actual": { - "intent": "CODE_QA", - "sub_intent": "OPEN_FILE", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 1, - "llm_answer": "Файл `src/app_runtime/core/runtime.py` содержит определение класса `RuntimeManager`, управляющего выполнением приложения в runtime режиме.\n\n## Важные сущности и их значение:\n- **Класс `RuntimeManager`:** Основной управляющий класс, инициализирующий компоненты системы (конфигурацию, сервисы, трассировку, здоровье, логирование, рабочие процессы и контрольную плоскость).\n- **Параметры конструктора:** \n - `configuration`, `services`, `traces`, `health`, `logs`, `workers`, `control_plane` — позволяют передавать внешние зависимости при создании экземпляра класса.\n- **Методы и поля:**\n - `_register_core_services()` — регистрирует основные сервисы приложения.\n - Поля `_started`, `_state`, `_core_registered`, `_workers_registered` отслеживают состояние инициализации и регистрации сервисов.\n \nЭтот файл является важным компонентом архитектуры приложения, отвечающим за настройку и запуск всех необходимых служб во время выполнения программы.", - "answer_mode": "answered", - "path_scope": [ - "src/app_runtime/core/runtime.py" - ], - "symbol_candidates": [], - "layers": [ - "C0_SOURCE_CHUNKS" - ] - }, - "passed": true, - "mismatches": [], - "details": { - "case_id": "plba-fullchain-open-file-runtime", - "text": "Открой файл src/app_runtime/core/runtime.py", - "mode": "full_chain", - "run_started_at": "2026-03-12T11:56:42", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Открой файл src/app_runtime/core/runtime.py", - "symbol_resolution": { - "status": "not_requested", - "resolved_symbol": null, - "alternatives": [], - "confidence": 0.0 - }, - "rag_count": 1, - "rag_rows": [ - { - "path": "src/app_runtime/core/runtime.py", - "content": "class RuntimeManager:\n ACTION_TIMEOUT_SECONDS = 10.0\n ACTION_POLL_INTERVAL_SECONDS = 0.05\n\n def __init__(\n self,\n configuration: ConfigurationManager | None = None,\n services: ServiceContainer | None = None,\n traces: TraceService | None = None,\n health: HealthRegistry | None = None,\n logs: LogManager | None = None,\n workers: WorkerSupervisor | None = None,\n control_plane: ControlPlaneService | None = None,\n ) -> None:\n self.configuration = configuration or ConfigurationManager()\n self.services = services or ServiceContainer()\n self.traces = traces or TraceService()\n self.health = health or HealthRegistry()\n self.logs = logs or LogManager()\n self.workers = workers or WorkerSupervisor()\n self.control_plane = control_plane or ControlPlaneService()\n self.registry = ModuleRegistry(self.services)\n self._started = False\n self._state = LifecycleState.IDLE\n self._core_registered = False\n self._workers_registered = False\n self._register_core_services()\n\n def register_module(self, module: ApplicationModule) -> None:\n self.registry.register_module(module.name)\n module.register(self.registry)\n\n def add_config_file(self, path: str) -> FileConfigProvider:\n provider = FileConfigProvider(path)\n self.configuration.add_provider(provider)\n return provider\n\n def start(self, *, start_control_plane: bool = True) -> None:\n if self._started:\n return\n self._state = LifecycleState.STARTING\n config = self.configuration.load()\n self.logs.apply_config(config)\n self._register_health_contributors()\n self._register_workers()\n self.workers.start()\n if start_control_plane:\n self.control_plane.start(self)\n self._started = True\n self._refresh_state()\n\n def stop(self, timeout: float = 30.0, force: bool = False, stop_control_plane: bool = True) -> None:\n if not self._started:\n return\n self._state = LifecycleState.STOPPING\n self.workers.stop(timeout=timeout, force=force)\n if stop_control_plane:\n self.control_plane.stop()\n self._started = False\n self._state = LifecycleState.STOPPED\n\n def status(self) -> dict[str, object]:\n self._refresh_state()\n return self.control_plane.snapshot(self)\n\n def current_health(self) -> HealthPayload:\n self._refresh_state()\n return self.health.payload(self._state, self.workers.healths())\n\n async def health_status(self) -> HealthPayload:\n return self.current_health()\n\n async def start_runtime(self) -> dict[str, object] | str:\n self._refresh_state()\n if self._started:\n return \"runtime already running\"\n if self._state == LifecycleState.STOPPING:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n\n self.start(start_control_plane=False)\n started = self._wait_for_state({LifecycleState.IDLE, LifecycleState.BUSY}, timeout=self.ACTION_TIMEOUT_SECONDS)\n if started:\n return self._action_detail(\"runtime started\", timed_out=False)\n return self._action_detail(\"runtime start is still in progress\", timed_out=True)\n\n async def stop_runtime(self) -> dict[str, object] | str:\n self._refresh_state()\n if not self._started:\n if self._state == LifecycleState.STOPPING:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n return \"runtime already stopped\"\n\n self._state = LifecycleState.STOPPING\n try:\n self.workers.stop(timeout=self.ACTION_TIMEOUT_SECONDS, force=False)\n except TimeoutError:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n\n self._started = False\n self._state = LifecycleState.STOPPED\n return self._action_detail(\"runtime stopped\", timed_out=False)\n\n async def runtime_status(self) -> str:\n self._refresh_state()\n return self._state.value\n\n def _register_core_services(self) -> None:\n if self._core_registered:\n return\n self.services.register(\"configuration\", self.configuration)\n self.services.register(\"traces\", self.traces)\n self.services.register(\"health\", self.health)\n self.services.register(\"logs\", self.logs)\n self.services.register(\"workers\", self.workers)\n self.services.register(\"control_plane\", self.control_plane)\n self._core_registered = True\n\n def _register_health_contributors(self) -> None:\n for contributor in self.registry.health_contributors:\n self.health.register(contributor)\n\n def _register_workers(self) -> None:\n if self._workers_registered:\n return\n for worker in self.registry.workers:\n self.workers.register(worker)\n self._workers_registered = True\n\n def _refresh_state(self) -> None:\n lifecycle = self.workers.lifecycle_state()\n\n if self._state == LifecycleState.STOPPING:\n if lifecycle == LifecycleState.STOPPED:\n self._started = False\n self._state = LifecycleState.STOPPED\n return\n\n if not self._started:\n if lifecycle == LifecycleState.STOPPED:\n self._state = LifecycleState.STOPPED\n return\n\n self._state = lifecycle\n\n def _wait_for_state(self, target_states: set[LifecycleState], *, timeout: float) -> bool:\n deadline = monotonic() + timeout\n while monotonic() < deadline:\n self._refresh_state()\n if self._state in target_states:\n return True\n sleep(self.ACTION_POLL_INTERVAL_SECONDS)\n self._refresh_state()\n return self._state in target_states\n\n def _action_detail(self, message: str, *, timed_out: bool) -> dict[str, object]:\n self._refresh_state()\n return {\n \"message\": message,\n \"state\": self._state.value,\n \"timed_out\": timed_out,\n \"workers\": self.workers.snapshot(),\n }", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/core/runtime.py:RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.core.runtime", - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "llm_answer": "Файл `src/app_runtime/core/runtime.py` содержит определение класса `RuntimeManager`, управляющего выполнением приложения в runtime режиме.\n\n## Важные сущности и их значение:\n- **Класс `RuntimeManager`:** Основной управляющий класс, инициализирующий компоненты системы (конфигурацию, сервисы, трассировку, здоровье, логирование, рабочие процессы и контрольную плоскость).\n- **Параметры конструктора:** \n - `configuration`, `services`, `traces`, `health`, `logs`, `workers`, `control_plane` — позволяют передавать внешние зависимости при создании экземпляра класса.\n- **Методы и поля:**\n - `_register_core_services()` — регистрирует основные сервисы приложения.\n - Поля `_started`, `_state`, `_core_registered`, `_workers_registered` отслеживают состояние инициализации и регистрации сервисов.\n \nЭтот файл является важным компонентом архитектуры приложения, отвечающим за настройку и запуск всех необходимых служб во время выполнения программы.", - "summary": { - "router": { - "intent": "CODE_QA", - "sub_intent": "OPEN_FILE", - "confidence": null - }, - "retrieval": { - "profile": "code", - "layers_hit": [ - "C0_SOURCE_CHUNKS" - ], - "evidence_sufficient": true - }, - "llm": { - "answer_status": "answered", - "groundedness": "grounded" - } - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "OPEN_FILE", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C0_SOURCE_CHUNKS" - ], - "symbol_kind_hint": "unknown", - "symbol_candidates": [], - "keyword_hints": [], - "path_hints": [ - "src/app_runtime/core/runtime.py" - ], - "path_scope": [ - "src/app_runtime/core/runtime.py" - ], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/app_runtime/core/runtime.py" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": false, - "max_distance": 2, - "top_k": 5 - } - } - }, - "execution": { - "executed_layers": [ - "C0_SOURCE_CHUNKS" - ], - "retrieval_mode_by_layer": { - "C0_SOURCE_CHUNKS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C0_SOURCE_CHUNKS": 200 - }, - "filters_by_layer": { - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src/app_runtime/core/runtime.py" - ], - "include_globs": [], - "exclude_globs": [], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Открой файл src/app_runtime/core/runtime.py", - "path_scope": [ - "src/app_runtime/core/runtime.py" - ], - "include_globs": [], - "exclude_globs": [], - "prefer_globs": [], - "top_k": 200, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src/app_runtime/core/runtime.py" - ], - "normalized_include_globs": [], - "normalized_exclude_globs": [], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 1, - "candidates_after_filter": 1 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "not_requested", - "resolved_symbol": null, - "alternatives": [] - }, - "layers": [ - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 1, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "router": 1, - "symbol_resolution": 0, - "retrieval_total": 190, - "retrieval_by_layer": { - "C0_SOURCE_CHUNKS": 190 - }, - "merge_rank": 0, - "prompt_build": 0, - "llm_call": 1578 - }, - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 555, - "evidence_rows": 1, - "evidence_chars": 6265 - }, - "evidence_summary": [ - { - "layer": "C0_SOURCE_CHUNKS", - "count": 1, - "unique_paths": 1 - } - ], - "prompt_template_id": "intent_code_qa_open_file_ru_v1", - "system_prompt_version": "v1" - }, - "router": { - "conversation_mode": "START", - "keyword_hints": [], - "path_scope": [ - "src/app_runtime/core/runtime.py" - ] - }, - "llm": { - "used_evidence_count": 1, - "missing_evidence_reason": null - } - }, - "run_info": { - "case_id": "plba-fullchain-open-file-runtime", - "mode": "full_chain", - "run_started_at": "2026-03-12T11:56:42", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - }, - "input_request": { - "text": "Открой файл src/app_runtime/core/runtime.py", - "normalized_query": "Открой файл src/app_runtime/core/runtime.py" - }, - "steps": [ - { - "step": "intent_router", - "input": { - "query": "Открой файл src/app_runtime/core/runtime.py" - }, - "output": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Открой файл src/app_runtime/core/runtime.py" - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "OPEN_FILE", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C0_SOURCE_CHUNKS" - ], - "symbol_kind_hint": "unknown", - "symbol_candidates": [], - "keyword_hints": [], - "path_hints": [ - "src/app_runtime/core/runtime.py" - ], - "path_scope": [ - "src/app_runtime/core/runtime.py" - ], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/app_runtime/core/runtime.py" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": false, - "max_distance": 2, - "top_k": 5 - } - } - }, - "timings_ms": { - "router": 1 - } - } - }, - { - "step": "retrieval", - "input": { - "query": "Открой файл src/app_runtime/core/runtime.py" - }, - "output": { - "symbol_resolution": { - "status": "not_requested", - "resolved_symbol": null, - "alternatives": [], - "confidence": 0.0 - }, - "rag_count": 1, - "rag_rows": [ - { - "path": "src/app_runtime/core/runtime.py", - "content": "class RuntimeManager:\n ACTION_TIMEOUT_SECONDS = 10.0\n ACTION_POLL_INTERVAL_SECONDS = 0.05\n\n def __init__(\n self,\n configuration: ConfigurationManager | None = None,\n services: ServiceContainer | None = None,\n traces: TraceService | None = None,\n health: HealthRegistry | None = None,\n logs: LogManager | None = None,\n workers: WorkerSupervisor | None = None,\n control_plane: ControlPlaneService | None = None,\n ) -> None:\n self.configuration = configuration or ConfigurationManager()\n self.services = services or ServiceContainer()\n self.traces = traces or TraceService()\n self.health = health or HealthRegistry()\n self.logs = logs or LogManager()\n self.workers = workers or WorkerSupervisor()\n self.control_plane = control_plane or ControlPlaneService()\n self.registry = ModuleRegistry(self.services)\n self._started = False\n self._state = LifecycleState.IDLE\n self._core_registered = False\n self._workers_registered = False\n self._register_core_services()\n\n def register_module(self, module: ApplicationModule) -> None:\n self.registry.register_module(module.name)\n module.register(self.registry)\n\n def add_config_file(self, path: str) -> FileConfigProvider:\n provider = FileConfigProvider(path)\n self.configuration.add_provider(provider)\n return provider\n\n def start(self, *, start_control_plane: bool = True) -> None:\n if self._started:\n return\n self._state = LifecycleState.STARTING\n config = self.configuration.load()\n self.logs.apply_config(config)\n self._register_health_contributors()\n self._register_workers()\n self.workers.start()\n if start_control_plane:\n self.control_plane.start(self)\n self._started = True\n self._refresh_state()\n\n def stop(self, timeout: float = 30.0, force: bool = False, stop_control_plane: bool = True) -> None:\n if not self._started:\n return\n self._state = LifecycleState.STOPPING\n self.workers.stop(timeout=timeout, force=force)\n if stop_control_plane:\n self.control_plane.stop()\n self._started = False\n self._state = LifecycleState.STOPPED\n\n def status(self) -> dict[str, object]:\n self._refresh_state()\n return self.control_plane.snapshot(self)\n\n def current_health(self) -> HealthPayload:\n self._refresh_state()\n return self.health.payload(self._state, self.workers.healths())\n\n async def health_status(self) -> HealthPayload:\n return self.current_health()\n\n async def start_runtime(self) -> dict[str, object] | str:\n self._refresh_state()\n if self._started:\n return \"runtime already running\"\n if self._state == LifecycleState.STOPPING:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n\n self.start(start_control_plane=False)\n started = self._wait_for_state({LifecycleState.IDLE, LifecycleState.BUSY}, timeout=self.ACTION_TIMEOUT_SECONDS)\n if started:\n return self._action_detail(\"runtime started\", timed_out=False)\n return self._action_detail(\"runtime start is still in progress\", timed_out=True)\n\n async def stop_runtime(self) -> dict[str, object] | str:\n self._refresh_state()\n if not self._started:\n if self._state == LifecycleState.STOPPING:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n return \"runtime already stopped\"\n\n self._state = LifecycleState.STOPPING\n try:\n self.workers.stop(timeout=self.ACTION_TIMEOUT_SECONDS, force=False)\n except TimeoutError:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n\n self._started = False\n self._state = LifecycleState.STOPPED\n return self._action_detail(\"runtime stopped\", timed_out=False)\n\n async def runtime_status(self) -> str:\n self._refresh_state()\n return self._state.value\n\n def _register_core_services(self) -> None:\n if self._core_registered:\n return\n self.services.register(\"configuration\", self.configuration)\n self.services.register(\"traces\", self.traces)\n self.services.register(\"health\", self.health)\n self.services.register(\"logs\", self.logs)\n self.services.register(\"workers\", self.workers)\n self.services.register(\"control_plane\", self.control_plane)\n self._core_registered = True\n\n def _register_health_contributors(self) -> None:\n for contributor in self.registry.health_contributors:\n self.health.register(contributor)\n\n def _register_workers(self) -> None:\n if self._workers_registered:\n return\n for worker in self.registry.workers:\n self.workers.register(worker)\n self._workers_registered = True\n\n def _refresh_state(self) -> None:\n lifecycle = self.workers.lifecycle_state()\n\n if self._state == LifecycleState.STOPPING:\n if lifecycle == LifecycleState.STOPPED:\n self._started = False\n self._state = LifecycleState.STOPPED\n return\n\n if not self._started:\n if lifecycle == LifecycleState.STOPPED:\n self._state = LifecycleState.STOPPED\n return\n\n self._state = lifecycle\n\n def _wait_for_state(self, target_states: set[LifecycleState], *, timeout: float) -> bool:\n deadline = monotonic() + timeout\n while monotonic() < deadline:\n self._refresh_state()\n if self._state in target_states:\n return True\n sleep(self.ACTION_POLL_INTERVAL_SECONDS)\n self._refresh_state()\n return self._state in target_states\n\n def _action_detail(self, message: str, *, timed_out: bool) -> dict[str, object]:\n self._refresh_state()\n return {\n \"message\": message,\n \"state\": self._state.value,\n \"timed_out\": timed_out,\n \"workers\": self.workers.snapshot(),\n }", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/core/runtime.py:RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.core.runtime", - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ] - }, - "diagnostics": { - "execution": { - "executed_layers": [ - "C0_SOURCE_CHUNKS" - ], - "retrieval_mode_by_layer": { - "C0_SOURCE_CHUNKS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C0_SOURCE_CHUNKS": 200 - }, - "filters_by_layer": { - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src/app_runtime/core/runtime.py" - ], - "include_globs": [], - "exclude_globs": [], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Открой файл src/app_runtime/core/runtime.py", - "path_scope": [ - "src/app_runtime/core/runtime.py" - ], - "include_globs": [], - "exclude_globs": [], - "prefer_globs": [], - "top_k": 200, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src/app_runtime/core/runtime.py" - ], - "normalized_include_globs": [], - "normalized_exclude_globs": [], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 1, - "candidates_after_filter": 1 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "not_requested", - "resolved_symbol": null, - "alternatives": [] - }, - "layers": [ - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 1, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "symbol_resolution": 0, - "retrieval_total": 190, - "retrieval_by_layer": { - "C0_SOURCE_CHUNKS": 190 - }, - "merge_rank": 0 - } - } - }, - { - "step": "llm_answer", - "input": { - "query": "Открой файл src/app_runtime/core/runtime.py", - "rag_count": 1 - }, - "output": { - "llm_answer": "Файл `src/app_runtime/core/runtime.py` содержит определение класса `RuntimeManager`, управляющего выполнением приложения в runtime режиме.\n\n## Важные сущности и их значение:\n- **Класс `RuntimeManager`:** Основной управляющий класс, инициализирующий компоненты системы (конфигурацию, сервисы, трассировку, здоровье, логирование, рабочие процессы и контрольную плоскость).\n- **Параметры конструктора:** \n - `configuration`, `services`, `traces`, `health`, `logs`, `workers`, `control_plane` — позволяют передавать внешние зависимости при создании экземпляра класса.\n- **Методы и поля:**\n - `_register_core_services()` — регистрирует основные сервисы приложения.\n - Поля `_started`, `_state`, `_core_registered`, `_workers_registered` отслеживают состояние инициализации и регистрации сервисов.\n \nЭтот файл является важным компонентом архитектуры приложения, отвечающим за настройку и запуск всех необходимых служб во время выполнения программы." - }, - "diagnostics": { - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 555, - "evidence_rows": 1, - "evidence_chars": 6265 - }, - "evidence_summary": [ - { - "layer": "C0_SOURCE_CHUNKS", - "count": 1, - "unique_paths": 1 - } - ], - "prompt_template_id": "intent_code_qa_open_file_ru_v1", - "system_prompt_version": "v1" - }, - "timings_ms": { - "prompt_build": 0, - "llm_call": 1578 - } - } - } - ] - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents/20260312_115642/full_chain_plba_code_subintents_plba-fullchain-open-file-runtime.md b/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents/20260312_115642/full_chain_plba_code_subintents_plba-fullchain-open-file-runtime.md deleted file mode 100644 index f2cf890..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents/20260312_115642/full_chain_plba_code_subintents_plba-fullchain-open-file-runtime.md +++ /dev/null @@ -1,30 +0,0 @@ -# plba-fullchain-open-file-runtime - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_subintents.yaml -- runner: runtime -- mode: full_chain -- passed: True - -## Query -Открой файл src/app_runtime/core/runtime.py - -## Actual -{ - "intent": "CODE_QA", - "sub_intent": "OPEN_FILE", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 1, - "llm_answer": "Файл `src/app_runtime/core/runtime.py` содержит определение класса `RuntimeManager`, управляющего выполнением приложения в runtime режиме.\n\n## Важные сущности и их значение:\n- **Класс `RuntimeManager`:** Основной управляющий класс, инициализирующий компоненты системы (конфигурацию, сервисы, трассировку, здоровье, логирование, рабочие процессы и контрольную плоскость).\n- **Параметры конструктора:** \n - `configuration`, `services`, `traces`, `health`, `logs`, `workers`, `control_plane` — позволяют передавать внешние зависимости при создании экземпляра класса.\n- **Методы и поля:**\n - `_register_core_services()` — регистрирует основные сервисы приложения.\n - Поля `_started`, `_state`, `_core_registered`, `_workers_registered` отслеживают состояние инициализации и регистрации сервисов.\n \nЭтот файл является важным компонентом архитектуры приложения, отвечающим за настройку и запуск всех необходимых служб во время выполнения программы.", - "answer_mode": "answered", - "path_scope": [ - "src/app_runtime/core/runtime.py" - ], - "symbol_candidates": [], - "layers": [ - "C0_SOURCE_CHUNKS" - ] -} - -## Mismatches -- none \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents/20260312_115642/full_chain_plba_code_subintents_plba-fullchain-trace-flow-runtime-manager.json b/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents/20260312_115642/full_chain_plba_code_subintents_plba-fullchain-trace-flow-runtime-manager.json deleted file mode 100644 index 18ee246..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents/20260312_115642/full_chain_plba_code_subintents_plba-fullchain-trace-flow-runtime-manager.json +++ /dev/null @@ -1,2964 +0,0 @@ -{ - "case_id": "plba-fullchain-trace-flow-runtime-manager", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_subintents.yaml", - "runner": "runtime", - "mode": "full_chain", - "actual": { - "intent": "CODE_QA", - "sub_intent": "TRACE_FLOW", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 23, - "llm_answer": "## Шаги потока выполнения для `RuntimeManager`\n\n1. **Точка старта**: \n Поток начинается с вызова конструктора класса `RuntimeManager` при инициализации приложения или сервиса.\n\n2. **Передача параметров**:\n - При вызове конструктора передаются параметры конфигурации (`configuration`), сервисов (`services`), отслеживания трассировок (`traces`), состояния здоровья (`health`), ведения логов (`logs`), управления рабочими процессами (`workers`) и службы управления плоскостью контроля (`control_plane`).\n\n3. **Инициализация атрибутов объекта**:\n - Внутри метода `__init__` происходит присвоение значений параметрам, передаваемым конструктору, если они предоставлены. Если нет – создаются пустые экземпляры соответствующих классов (например, `ConfigurationManager`, `ServiceContainer`, `TraceService` и т.д.).\n \n4. **Регистрация модулей**:\n - После создания всех необходимых объектов производится регистрация модуля с помощью метода `_register_core_services`.\n\n5. **Использование экземпляров внутри методов класса**:\n - В дальнейшем экземпляр `RuntimeManager` может использоваться для выполнения различных операций через методы этого класса, например, добавление файлов конфигурации, регистрация служб, управление состоянием приложения и т.п.\n\n6. **Конечная точка потока**:\n - Поток завершается после того, как объект `RuntimeManager` выполнил все необходимые операции и достиг конечного состояния приложения или сервиса.\n\n## Недостатки информации\n\nНа данный момент отсутствует явная информация о том, как именно метод `register_module(module: ApplicationModule)` используется дальше в жизненном цикле объекта `RuntimeManager`. Это создаёт неопределённость относительно дальнейшего использования зарегистрированного модуля и того, каким образом он влияет на поведение объекта.\n\nТакже непонятно, какие события или действия инициируют дальнейшие процессы, управляемые объектом `RuntimeManager`, что могло бы предоставить более полное понимание его жизненного цикла и взаимодействия с другими компонентами системы.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "RuntimeManager" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "passed": true, - "mismatches": [], - "details": { - "case_id": "plba-fullchain-trace-flow-runtime-manager", - "text": "Покажи поток выполнения RuntimeManager", - "mode": "full_chain", - "run_started_at": "2026-03-12T11:56:42", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Покажи поток выполнения RuntimeManager", - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "RuntimeManager", - "alternatives": [ - "RuntimeManager" - ], - "confidence": 0.99 - }, - "rag_count": 23, - "rag_rows": [ - { - "path": "src/app_runtime/core/runtime.py", - "content": "class RuntimeManager\nRuntimeManager", - "layer": "C1_SYMBOL_CATALOG", - "title": "RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "7e4a9381328c5803bbc6179458612fc4e947d928aa7bf8b4b2bebb2c8592f758", - "qname": "RuntimeManager", - "kind": "class", - "signature": "RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.core.runtime", - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests manager\n- orchestrates role-like calls (4)\n- reads and writes state attributes\n- participates in dataflow slices (50)", - "layer": "C4_SEMANTIC_ROLES", - "title": "RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 43, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "7e4a9381328c5803bbc6179458612fc4e947d928aa7bf8b4b2bebb2c8592f758", - "symbol_name": "RuntimeManager", - "qname": "RuntimeManager", - "role": "pipeline_stage", - "confidence": 0.67, - "dataflow_participation": 50, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "ControlChannel\nrole: model\n\nResponsibilities:\n- default model role", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlChannel", - "span_start": 21, - "span_end": 28, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 40, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "cfcfe9a311d3a2dbdaf32ac4ccd73c0eb9a117f830591a1c0867ee97d46204ff", - "symbol_name": "ControlChannel", - "qname": "ControlChannel", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "ControlActionSet\nrole: model\n\nResponsibilities:\n- default model role", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlActionSet", - "span_start": 14, - "span_end": 18, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 40, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "46eb026cb3313415ec47b82dd22f84f4d112c9d987e8b1716dcb0baa1cce8988", - "symbol_name": "ControlActionSet", - "qname": "ControlActionSet", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests service\n- reads and writes state attributes\n- participates in dataflow slices (5)", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlPlaneService", - "span_start": 12, - "span_end": 52, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 68, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "b13471e5916986dccffb53fab613812842965705e6b3a89ae549d30c9e91e9aa", - "symbol_name": "ControlPlaneService", - "qname": "ControlPlaneService", - "role": "pipeline_stage", - "confidence": 0.57, - "dataflow_participation": 5, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_runner.py", - "content": "UvicornThreadRunner\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (24)", - "layer": "C4_SEMANTIC_ROLES", - "title": "UvicornThreadRunner", - "span_start": 10, - "span_end": 61, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 11, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "fd55630045a02100df8877ac27d951ee08617d4598764394d48cb51fe067476a", - "symbol_name": "UvicornThreadRunner", - "qname": "UvicornThreadRunner", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 24, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "3779fdd2878b770e789a35bb2a89c9d79f13b61c26d7db1b3b683f9bb9e1623f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (10)", - "layer": "C4_SEMANTIC_ROLES", - "title": "HttpControlChannel", - "span_start": 12, - "span_end": 57, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 21, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "1c9fbdc24819e5604c26ea55428a74310f03a03e1af197ed84846af61e42fdb0", - "symbol_name": "HttpControlChannel", - "qname": "HttpControlChannel", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 10, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "HttpControlAppFactory\nrole: factory\n\nResponsibilities:\n- name suffix suggests factory", - "layer": "C4_SEMANTIC_ROLES", - "title": "HttpControlAppFactory", - "span_start": 15, - "span_end": 53, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 39, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "9b3502a5fb408b273223db13264349cf500de24915b6c649d9ea8970d0dfd8e0", - "symbol_name": "HttpControlAppFactory", - "qname": "HttpControlAppFactory", - "role": "factory", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/persistence/workflow_persistence.py", - "content": "WorkflowPersistence\nrole: pipeline_stage\n\nResponsibilities:\n- orchestrates role-like calls (2)\n- reads and writes state attributes\n- participates in dataflow slices (16)", - "layer": "C4_SEMANTIC_ROLES", - "title": "WorkflowPersistence", - "span_start": 8, - "span_end": 54, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 15, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "7bd01ee45cf31f2d5c2e3e51656254860ac785d10cef9e0852cd4fba90857bae", - "symbol_name": "WorkflowPersistence", - "qname": "WorkflowPersistence", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 16, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "80e9410ddc639789b4353c2a1a757ba8d0d5b5bb6075b0b263b61551f04ae1f0", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager.add_config_file", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 32, - "span_end": 52, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "a23b8a11ebdb12708b60c96ea12a69f7f042082f1adfddd572444e246d81d167", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "57ffbd4f0d9fdf3507c2b8624312ce211f3d02fdf86a57a8ec90778d8a7b498d", - "dst_ref": "RuntimeManager.add_config_file", - "resolution": "resolved", - "slice_id": "a23b8a11ebdb12708b60c96ea12a69f7f042082f1adfddd572444e246d81d167", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager.add_config_file" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "57ffbd4f0d9fdf3507c2b8624312ce211f3d02fdf86a57a8ec90778d8a7b498d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.services\n -> RuntimeManager.__init__", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 33, - "span_end": 39, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "d43af85989222ee6d788ce418cdcb217c7ff044cfb915e3bdbd184417dc7bd61", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "dst_ref": "RuntimeManager.__init__", - "resolution": "resolved", - "slice_id": "d43af85989222ee6d788ce418cdcb217c7ff044cfb915e3bdbd184417dc7bd61", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.services", - "RuntimeManager.__init__" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.stop", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 25, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d", - "dst_ref": "ControlPlaneService.stop", - "resolution": "resolved", - "slice_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.stop" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._stop_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 51, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a", - "dst_ref": "ControlPlaneService._stop_async", - "resolution": "resolved", - "slice_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._stop_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager.start", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 32, - "span_end": 59, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "98312ace7fc62b1c7194c5aa1732b6ef736eae1668a3a120dd1ecd5ab1d64f7a", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "77a7b260193018845e4e204df094ab89cfd7c82ee4e822b3a83ad4cd945f9cb1", - "dst_ref": "RuntimeManager.start", - "resolution": "resolved", - "slice_id": "98312ace7fc62b1c7194c5aa1732b6ef736eae1668a3a120dd1ecd5ab1d64f7a", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager.start" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "77a7b260193018845e4e204df094ab89cfd7c82ee4e822b3a83ad4cd945f9cb1" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager._register_core_services", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 32, - "span_end": 127, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "3e5811f3b511fa0cabe363f5d01f2ac5fa039bc8b93f7ee108323e1f5f45a293", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "972d6057a6caac9cf31ebc1e29c6f39f71b10d4cc170dec57cf875ba458549c6", - "dst_ref": "RuntimeManager._register_core_services", - "resolution": "resolved", - "slice_id": "3e5811f3b511fa0cabe363f5d01f2ac5fa039bc8b93f7ee108323e1f5f45a293", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager._register_core_services" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "972d6057a6caac9cf31ebc1e29c6f39f71b10d4cc170dec57cf875ba458549c6" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.register_channel", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 17, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957", - "dst_ref": "ControlPlaneService.register_channel", - "resolution": "resolved", - "slice_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.register_channel" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.start", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 20, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154", - "dst_ref": "ControlPlaneService.start", - "resolution": "resolved", - "slice_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.start" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._start_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 47, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517", - "dst_ref": "ControlPlaneService._start_async", - "resolution": "resolved", - "slice_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._start_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.services\n -> RuntimeManager._register_core_services", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 33, - "span_end": 127, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "aac6f9dda73963b977083a892bee39a48eca4fbd7404787e022ecf4ebedec65d", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "972d6057a6caac9cf31ebc1e29c6f39f71b10d4cc170dec57cf875ba458549c6", - "dst_ref": "RuntimeManager._register_core_services", - "resolution": "resolved", - "slice_id": "aac6f9dda73963b977083a892bee39a48eca4fbd7404787e022ecf4ebedec65d", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.services", - "RuntimeManager._register_core_services" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "972d6057a6caac9cf31ebc1e29c6f39f71b10d4cc170dec57cf875ba458549c6" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "class RuntimeManager:\n ACTION_TIMEOUT_SECONDS = 10.0\n ACTION_POLL_INTERVAL_SECONDS = 0.05\n\n def __init__(\n self,\n configuration: ConfigurationManager | None = None,\n services: ServiceContainer | None = None,\n traces: TraceService | None = None,\n health: HealthRegistry | None = None,\n logs: LogManager | None = None,\n workers: WorkerSupervisor | None = None,\n control_plane: ControlPlaneService | None = None,\n ) -> None:\n self.configuration = configuration or ConfigurationManager()\n self.services = services or ServiceContainer()\n self.traces = traces or TraceService()\n self.health = health or HealthRegistry()\n self.logs = logs or LogManager()\n self.workers = workers or WorkerSupervisor()\n self.control_plane = control_plane or ControlPlaneService()\n self.registry = ModuleRegistry(self.services)\n self._started = False\n self._state = LifecycleState.IDLE\n self._core_registered = False\n self._workers_registered = False\n self._register_core_services()\n\n def register_module(self, module: ApplicationModule) -> None:\n self.registry.register_module(module.name)\n module.register(self.registry)\n\n def add_config_file(self, path: str) -> FileConfigProvider:\n provider = FileConfigProvider(path)\n self.configuration.add_provider(provider)\n return provider\n\n def start(self, *, start_control_plane: bool = True) -> None:\n if self._started:\n return\n self._state = LifecycleState.STARTING\n config = self.configuration.load()\n self.logs.apply_config(config)\n self._register_health_contributors()\n self._register_workers()\n self.workers.start()\n if start_control_plane:\n self.control_plane.start(self)\n self._started = True\n self._refresh_state()\n\n def stop(self, timeout: float = 30.0, force: bool = False, stop_control_plane: bool = True) -> None:\n if not self._started:\n return\n self._state = LifecycleState.STOPPING\n self.workers.stop(timeout=timeout, force=force)\n if stop_control_plane:\n self.control_plane.stop()\n self._started = False\n self._state = LifecycleState.STOPPED\n\n def status(self) -> dict[str, object]:\n self._refresh_state()\n return self.control_plane.snapshot(self)\n\n def current_health(self) -> HealthPayload:\n self._refresh_state()\n return self.health.payload(self._state, self.workers.healths())\n\n async def health_status(self) -> HealthPayload:\n return self.current_health()\n\n async def start_runtime(self) -> dict[str, object] | str:\n self._refresh_state()\n if self._started:\n return \"runtime already running\"\n if self._state == LifecycleState.STOPPING:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n\n self.start(start_control_plane=False)\n started = self._wait_for_state({LifecycleState.IDLE, LifecycleState.BUSY}, timeout=self.ACTION_TIMEOUT_SECONDS)\n if started:\n return self._action_detail(\"runtime started\", timed_out=False)\n return self._action_detail(\"runtime start is still in progress\", timed_out=True)\n\n async def stop_runtime(self) -> dict[str, object] | str:\n self._refresh_state()\n if not self._started:\n if self._state == LifecycleState.STOPPING:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n return \"runtime already stopped\"\n\n self._state = LifecycleState.STOPPING\n try:\n self.workers.stop(timeout=self.ACTION_TIMEOUT_SECONDS, force=False)\n except TimeoutError:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n\n self._started = False\n self._state = LifecycleState.STOPPED\n return self._action_detail(\"runtime stopped\", timed_out=False)\n\n async def runtime_status(self) -> str:\n self._refresh_state()\n return self._state.value\n\n def _register_core_services(self) -> None:\n if self._core_registered:\n return\n self.services.register(\"configuration\", self.configuration)\n self.services.register(\"traces\", self.traces)\n self.services.register(\"health\", self.health)\n self.services.register(\"logs\", self.logs)\n self.services.register(\"workers\", self.workers)\n self.services.register(\"control_plane\", self.control_plane)\n self._core_registered = True\n\n def _register_health_contributors(self) -> None:\n for contributor in self.registry.health_contributors:\n self.health.register(contributor)\n\n def _register_workers(self) -> None:\n if self._workers_registered:\n return\n for worker in self.registry.workers:\n self.workers.register(worker)\n self._workers_registered = True\n\n def _refresh_state(self) -> None:\n lifecycle = self.workers.lifecycle_state()\n\n if self._state == LifecycleState.STOPPING:\n if lifecycle == LifecycleState.STOPPED:\n self._started = False\n self._state = LifecycleState.STOPPED\n return\n\n if not self._started:\n if lifecycle == LifecycleState.STOPPED:\n self._state = LifecycleState.STOPPED\n return\n\n self._state = lifecycle\n\n def _wait_for_state(self, target_states: set[LifecycleState], *, timeout: float) -> bool:\n deadline = monotonic() + timeout\n while monotonic() < deadline:\n self._refresh_state()\n if self._state in target_states:\n return True\n sleep(self.ACTION_POLL_INTERVAL_SECONDS)\n self._refresh_state()\n return self._state in target_states\n\n def _action_detail(self, message: str, *, timed_out: bool) -> dict[str, object]:\n self._refresh_state()\n return {\n \"message\": message,\n \"state\": self._state.value,\n \"timed_out\": timed_out,\n \"workers\": self.workers.snapshot(),\n }", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/core/runtime.py:RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.core.runtime", - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "llm_answer": "## Шаги потока выполнения для `RuntimeManager`\n\n1. **Точка старта**: \n Поток начинается с вызова конструктора класса `RuntimeManager` при инициализации приложения или сервиса.\n\n2. **Передача параметров**:\n - При вызове конструктора передаются параметры конфигурации (`configuration`), сервисов (`services`), отслеживания трассировок (`traces`), состояния здоровья (`health`), ведения логов (`logs`), управления рабочими процессами (`workers`) и службы управления плоскостью контроля (`control_plane`).\n\n3. **Инициализация атрибутов объекта**:\n - Внутри метода `__init__` происходит присвоение значений параметрам, передаваемым конструктору, если они предоставлены. Если нет – создаются пустые экземпляры соответствующих классов (например, `ConfigurationManager`, `ServiceContainer`, `TraceService` и т.д.).\n \n4. **Регистрация модулей**:\n - После создания всех необходимых объектов производится регистрация модуля с помощью метода `_register_core_services`.\n\n5. **Использование экземпляров внутри методов класса**:\n - В дальнейшем экземпляр `RuntimeManager` может использоваться для выполнения различных операций через методы этого класса, например, добавление файлов конфигурации, регистрация служб, управление состоянием приложения и т.п.\n\n6. **Конечная точка потока**:\n - Поток завершается после того, как объект `RuntimeManager` выполнил все необходимые операции и достиг конечного состояния приложения или сервиса.\n\n## Недостатки информации\n\nНа данный момент отсутствует явная информация о том, как именно метод `register_module(module: ApplicationModule)` используется дальше в жизненном цикле объекта `RuntimeManager`. Это создаёт неопределённость относительно дальнейшего использования зарегистрированного модуля и того, каким образом он влияет на поведение объекта.\n\nТакже непонятно, какие события или действия инициируют дальнейшие процессы, управляемые объектом `RuntimeManager`, что могло бы предоставить более полное понимание его жизненного цикла и взаимодействия с другими компонентами системы.", - "summary": { - "router": { - "intent": "CODE_QA", - "sub_intent": "TRACE_FLOW", - "confidence": null - }, - "retrieval": { - "profile": "code", - "layers_hit": [ - "C0_SOURCE_CHUNKS", - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS", - "C4_SEMANTIC_ROLES" - ], - "evidence_sufficient": true - }, - "llm": { - "answer_status": "answered", - "groundedness": "grounded" - } - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "TRACE_FLOW", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "RuntimeManager" - ], - "keyword_hints": [ - "RuntimeManager" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C0_SOURCE_CHUNKS": "exact_path_fetch", - "C4_SEMANTIC_ROLES": "exact_path_fetch", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C3_ENTRYPOINTS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 8, - "C4_SEMANTIC_ROLES": 8, - "C2_DEPENDENCY_GRAPH": 10, - "C3_ENTRYPOINTS": 10 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C4_SEMANTIC_ROLES": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Покажи поток выполнения RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C4_SEMANTIC_ROLES", - "query": "Покажи поток выполнения RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "Покажи поток выполнения RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 10, - "ranking_profile": "code" - }, - { - "layer": "C3_ENTRYPOINTS", - "query": "Покажи поток выполнения RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 10, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 1, - "candidates_after_filter": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 10, - "candidates_after_filter": 10 - }, - { - "layer": "C3_ENTRYPOINTS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 3, - "candidates_after_filter": 3 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "RuntimeManager", - "alternatives": [ - "RuntimeManager" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C4_SEMANTIC_ROLES", - "status": "hit", - "hit_count": 8, - "fail_reason": null - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 10, - "fail_reason": null - }, - { - "layer": "C3_ENTRYPOINTS", - "status": "hit", - "hit_count": 3, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "router": 1, - "symbol_resolution": 0, - "retrieval_total": 167, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 52, - "C0_SOURCE_CHUNKS": 22, - "C4_SEMANTIC_ROLES": 17, - "C2_DEPENDENCY_GRAPH": 61, - "C3_ENTRYPOINTS": 13 - }, - "merge_rank": 20, - "prompt_build": 0, - "llm_call": 2802 - }, - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 766, - "evidence_rows": 23, - "evidence_chars": 8302 - }, - "evidence_summary": [ - { - "layer": "C1_SYMBOL_CATALOG", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "count": 8, - "unique_paths": 7 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "count": 10, - "unique_paths": 2 - }, - { - "layer": "C3_ENTRYPOINTS", - "count": 3, - "unique_paths": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 1, - "unique_paths": 1 - } - ], - "prompt_template_id": "intent_code_qa_trace_flow_ru_v1", - "system_prompt_version": "v1" - }, - "router": { - "conversation_mode": "START", - "keyword_hints": [ - "RuntimeManager" - ], - "path_scope": [] - }, - "llm": { - "used_evidence_count": 23, - "missing_evidence_reason": null - } - }, - "run_info": { - "case_id": "plba-fullchain-trace-flow-runtime-manager", - "mode": "full_chain", - "run_started_at": "2026-03-12T11:56:42", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - }, - "input_request": { - "text": "Покажи поток выполнения RuntimeManager", - "normalized_query": "Покажи поток выполнения RuntimeManager" - }, - "steps": [ - { - "step": "intent_router", - "input": { - "query": "Покажи поток выполнения RuntimeManager" - }, - "output": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Покажи поток выполнения RuntimeManager" - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "TRACE_FLOW", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "RuntimeManager" - ], - "keyword_hints": [ - "RuntimeManager" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "timings_ms": { - "router": 1 - } - } - }, - { - "step": "retrieval", - "input": { - "query": "Покажи поток выполнения RuntimeManager" - }, - "output": { - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "RuntimeManager", - "alternatives": [ - "RuntimeManager" - ], - "confidence": 0.99 - }, - "rag_count": 23, - "rag_rows": [ - { - "path": "src/app_runtime/core/runtime.py", - "content": "class RuntimeManager\nRuntimeManager", - "layer": "C1_SYMBOL_CATALOG", - "title": "RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "7e4a9381328c5803bbc6179458612fc4e947d928aa7bf8b4b2bebb2c8592f758", - "qname": "RuntimeManager", - "kind": "class", - "signature": "RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.core.runtime", - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests manager\n- orchestrates role-like calls (4)\n- reads and writes state attributes\n- participates in dataflow slices (50)", - "layer": "C4_SEMANTIC_ROLES", - "title": "RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 43, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "7e4a9381328c5803bbc6179458612fc4e947d928aa7bf8b4b2bebb2c8592f758", - "symbol_name": "RuntimeManager", - "qname": "RuntimeManager", - "role": "pipeline_stage", - "confidence": 0.67, - "dataflow_participation": 50, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "ControlChannel\nrole: model\n\nResponsibilities:\n- default model role", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlChannel", - "span_start": 21, - "span_end": 28, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 40, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "cfcfe9a311d3a2dbdaf32ac4ccd73c0eb9a117f830591a1c0867ee97d46204ff", - "symbol_name": "ControlChannel", - "qname": "ControlChannel", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "ControlActionSet\nrole: model\n\nResponsibilities:\n- default model role", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlActionSet", - "span_start": 14, - "span_end": 18, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 40, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "46eb026cb3313415ec47b82dd22f84f4d112c9d987e8b1716dcb0baa1cce8988", - "symbol_name": "ControlActionSet", - "qname": "ControlActionSet", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests service\n- reads and writes state attributes\n- participates in dataflow slices (5)", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlPlaneService", - "span_start": 12, - "span_end": 52, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 68, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "b13471e5916986dccffb53fab613812842965705e6b3a89ae549d30c9e91e9aa", - "symbol_name": "ControlPlaneService", - "qname": "ControlPlaneService", - "role": "pipeline_stage", - "confidence": 0.57, - "dataflow_participation": 5, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_runner.py", - "content": "UvicornThreadRunner\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (24)", - "layer": "C4_SEMANTIC_ROLES", - "title": "UvicornThreadRunner", - "span_start": 10, - "span_end": 61, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 11, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "fd55630045a02100df8877ac27d951ee08617d4598764394d48cb51fe067476a", - "symbol_name": "UvicornThreadRunner", - "qname": "UvicornThreadRunner", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 24, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "3779fdd2878b770e789a35bb2a89c9d79f13b61c26d7db1b3b683f9bb9e1623f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (10)", - "layer": "C4_SEMANTIC_ROLES", - "title": "HttpControlChannel", - "span_start": 12, - "span_end": 57, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 21, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "1c9fbdc24819e5604c26ea55428a74310f03a03e1af197ed84846af61e42fdb0", - "symbol_name": "HttpControlChannel", - "qname": "HttpControlChannel", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 10, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "HttpControlAppFactory\nrole: factory\n\nResponsibilities:\n- name suffix suggests factory", - "layer": "C4_SEMANTIC_ROLES", - "title": "HttpControlAppFactory", - "span_start": 15, - "span_end": 53, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 39, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "9b3502a5fb408b273223db13264349cf500de24915b6c649d9ea8970d0dfd8e0", - "symbol_name": "HttpControlAppFactory", - "qname": "HttpControlAppFactory", - "role": "factory", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/persistence/workflow_persistence.py", - "content": "WorkflowPersistence\nrole: pipeline_stage\n\nResponsibilities:\n- orchestrates role-like calls (2)\n- reads and writes state attributes\n- participates in dataflow slices (16)", - "layer": "C4_SEMANTIC_ROLES", - "title": "WorkflowPersistence", - "span_start": 8, - "span_end": 54, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 15, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "7bd01ee45cf31f2d5c2e3e51656254860ac785d10cef9e0852cd4fba90857bae", - "symbol_name": "WorkflowPersistence", - "qname": "WorkflowPersistence", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 16, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "80e9410ddc639789b4353c2a1a757ba8d0d5b5bb6075b0b263b61551f04ae1f0", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager.add_config_file", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 32, - "span_end": 52, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "a23b8a11ebdb12708b60c96ea12a69f7f042082f1adfddd572444e246d81d167", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "57ffbd4f0d9fdf3507c2b8624312ce211f3d02fdf86a57a8ec90778d8a7b498d", - "dst_ref": "RuntimeManager.add_config_file", - "resolution": "resolved", - "slice_id": "a23b8a11ebdb12708b60c96ea12a69f7f042082f1adfddd572444e246d81d167", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager.add_config_file" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "57ffbd4f0d9fdf3507c2b8624312ce211f3d02fdf86a57a8ec90778d8a7b498d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.services\n -> RuntimeManager.__init__", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 33, - "span_end": 39, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "d43af85989222ee6d788ce418cdcb217c7ff044cfb915e3bdbd184417dc7bd61", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "dst_ref": "RuntimeManager.__init__", - "resolution": "resolved", - "slice_id": "d43af85989222ee6d788ce418cdcb217c7ff044cfb915e3bdbd184417dc7bd61", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.services", - "RuntimeManager.__init__" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.stop", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 25, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d", - "dst_ref": "ControlPlaneService.stop", - "resolution": "resolved", - "slice_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.stop" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._stop_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 51, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a", - "dst_ref": "ControlPlaneService._stop_async", - "resolution": "resolved", - "slice_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._stop_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager.start", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 32, - "span_end": 59, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "98312ace7fc62b1c7194c5aa1732b6ef736eae1668a3a120dd1ecd5ab1d64f7a", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "77a7b260193018845e4e204df094ab89cfd7c82ee4e822b3a83ad4cd945f9cb1", - "dst_ref": "RuntimeManager.start", - "resolution": "resolved", - "slice_id": "98312ace7fc62b1c7194c5aa1732b6ef736eae1668a3a120dd1ecd5ab1d64f7a", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager.start" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "77a7b260193018845e4e204df094ab89cfd7c82ee4e822b3a83ad4cd945f9cb1" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager._register_core_services", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 32, - "span_end": 127, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "3e5811f3b511fa0cabe363f5d01f2ac5fa039bc8b93f7ee108323e1f5f45a293", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "972d6057a6caac9cf31ebc1e29c6f39f71b10d4cc170dec57cf875ba458549c6", - "dst_ref": "RuntimeManager._register_core_services", - "resolution": "resolved", - "slice_id": "3e5811f3b511fa0cabe363f5d01f2ac5fa039bc8b93f7ee108323e1f5f45a293", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager._register_core_services" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "972d6057a6caac9cf31ebc1e29c6f39f71b10d4cc170dec57cf875ba458549c6" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.register_channel", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 17, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957", - "dst_ref": "ControlPlaneService.register_channel", - "resolution": "resolved", - "slice_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.register_channel" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.start", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 20, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154", - "dst_ref": "ControlPlaneService.start", - "resolution": "resolved", - "slice_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.start" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._start_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 47, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517", - "dst_ref": "ControlPlaneService._start_async", - "resolution": "resolved", - "slice_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._start_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.services\n -> RuntimeManager._register_core_services", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 33, - "span_end": 127, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "aac6f9dda73963b977083a892bee39a48eca4fbd7404787e022ecf4ebedec65d", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "972d6057a6caac9cf31ebc1e29c6f39f71b10d4cc170dec57cf875ba458549c6", - "dst_ref": "RuntimeManager._register_core_services", - "resolution": "resolved", - "slice_id": "aac6f9dda73963b977083a892bee39a48eca4fbd7404787e022ecf4ebedec65d", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.services", - "RuntimeManager._register_core_services" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "972d6057a6caac9cf31ebc1e29c6f39f71b10d4cc170dec57cf875ba458549c6" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "class RuntimeManager:\n ACTION_TIMEOUT_SECONDS = 10.0\n ACTION_POLL_INTERVAL_SECONDS = 0.05\n\n def __init__(\n self,\n configuration: ConfigurationManager | None = None,\n services: ServiceContainer | None = None,\n traces: TraceService | None = None,\n health: HealthRegistry | None = None,\n logs: LogManager | None = None,\n workers: WorkerSupervisor | None = None,\n control_plane: ControlPlaneService | None = None,\n ) -> None:\n self.configuration = configuration or ConfigurationManager()\n self.services = services or ServiceContainer()\n self.traces = traces or TraceService()\n self.health = health or HealthRegistry()\n self.logs = logs or LogManager()\n self.workers = workers or WorkerSupervisor()\n self.control_plane = control_plane or ControlPlaneService()\n self.registry = ModuleRegistry(self.services)\n self._started = False\n self._state = LifecycleState.IDLE\n self._core_registered = False\n self._workers_registered = False\n self._register_core_services()\n\n def register_module(self, module: ApplicationModule) -> None:\n self.registry.register_module(module.name)\n module.register(self.registry)\n\n def add_config_file(self, path: str) -> FileConfigProvider:\n provider = FileConfigProvider(path)\n self.configuration.add_provider(provider)\n return provider\n\n def start(self, *, start_control_plane: bool = True) -> None:\n if self._started:\n return\n self._state = LifecycleState.STARTING\n config = self.configuration.load()\n self.logs.apply_config(config)\n self._register_health_contributors()\n self._register_workers()\n self.workers.start()\n if start_control_plane:\n self.control_plane.start(self)\n self._started = True\n self._refresh_state()\n\n def stop(self, timeout: float = 30.0, force: bool = False, stop_control_plane: bool = True) -> None:\n if not self._started:\n return\n self._state = LifecycleState.STOPPING\n self.workers.stop(timeout=timeout, force=force)\n if stop_control_plane:\n self.control_plane.stop()\n self._started = False\n self._state = LifecycleState.STOPPED\n\n def status(self) -> dict[str, object]:\n self._refresh_state()\n return self.control_plane.snapshot(self)\n\n def current_health(self) -> HealthPayload:\n self._refresh_state()\n return self.health.payload(self._state, self.workers.healths())\n\n async def health_status(self) -> HealthPayload:\n return self.current_health()\n\n async def start_runtime(self) -> dict[str, object] | str:\n self._refresh_state()\n if self._started:\n return \"runtime already running\"\n if self._state == LifecycleState.STOPPING:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n\n self.start(start_control_plane=False)\n started = self._wait_for_state({LifecycleState.IDLE, LifecycleState.BUSY}, timeout=self.ACTION_TIMEOUT_SECONDS)\n if started:\n return self._action_detail(\"runtime started\", timed_out=False)\n return self._action_detail(\"runtime start is still in progress\", timed_out=True)\n\n async def stop_runtime(self) -> dict[str, object] | str:\n self._refresh_state()\n if not self._started:\n if self._state == LifecycleState.STOPPING:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n return \"runtime already stopped\"\n\n self._state = LifecycleState.STOPPING\n try:\n self.workers.stop(timeout=self.ACTION_TIMEOUT_SECONDS, force=False)\n except TimeoutError:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n\n self._started = False\n self._state = LifecycleState.STOPPED\n return self._action_detail(\"runtime stopped\", timed_out=False)\n\n async def runtime_status(self) -> str:\n self._refresh_state()\n return self._state.value\n\n def _register_core_services(self) -> None:\n if self._core_registered:\n return\n self.services.register(\"configuration\", self.configuration)\n self.services.register(\"traces\", self.traces)\n self.services.register(\"health\", self.health)\n self.services.register(\"logs\", self.logs)\n self.services.register(\"workers\", self.workers)\n self.services.register(\"control_plane\", self.control_plane)\n self._core_registered = True\n\n def _register_health_contributors(self) -> None:\n for contributor in self.registry.health_contributors:\n self.health.register(contributor)\n\n def _register_workers(self) -> None:\n if self._workers_registered:\n return\n for worker in self.registry.workers:\n self.workers.register(worker)\n self._workers_registered = True\n\n def _refresh_state(self) -> None:\n lifecycle = self.workers.lifecycle_state()\n\n if self._state == LifecycleState.STOPPING:\n if lifecycle == LifecycleState.STOPPED:\n self._started = False\n self._state = LifecycleState.STOPPED\n return\n\n if not self._started:\n if lifecycle == LifecycleState.STOPPED:\n self._state = LifecycleState.STOPPED\n return\n\n self._state = lifecycle\n\n def _wait_for_state(self, target_states: set[LifecycleState], *, timeout: float) -> bool:\n deadline = monotonic() + timeout\n while monotonic() < deadline:\n self._refresh_state()\n if self._state in target_states:\n return True\n sleep(self.ACTION_POLL_INTERVAL_SECONDS)\n self._refresh_state()\n return self._state in target_states\n\n def _action_detail(self, message: str, *, timed_out: bool) -> dict[str, object]:\n self._refresh_state()\n return {\n \"message\": message,\n \"state\": self._state.value,\n \"timed_out\": timed_out,\n \"workers\": self.workers.snapshot(),\n }", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/core/runtime.py:RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.core.runtime", - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ] - }, - "diagnostics": { - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C0_SOURCE_CHUNKS": "exact_path_fetch", - "C4_SEMANTIC_ROLES": "exact_path_fetch", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C3_ENTRYPOINTS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 8, - "C4_SEMANTIC_ROLES": 8, - "C2_DEPENDENCY_GRAPH": 10, - "C3_ENTRYPOINTS": 10 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C4_SEMANTIC_ROLES": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Покажи поток выполнения RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C4_SEMANTIC_ROLES", - "query": "Покажи поток выполнения RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "Покажи поток выполнения RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 10, - "ranking_profile": "code" - }, - { - "layer": "C3_ENTRYPOINTS", - "query": "Покажи поток выполнения RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 10, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 1, - "candidates_after_filter": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 10, - "candidates_after_filter": 10 - }, - { - "layer": "C3_ENTRYPOINTS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 3, - "candidates_after_filter": 3 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "RuntimeManager", - "alternatives": [ - "RuntimeManager" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C4_SEMANTIC_ROLES", - "status": "hit", - "hit_count": 8, - "fail_reason": null - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 10, - "fail_reason": null - }, - { - "layer": "C3_ENTRYPOINTS", - "status": "hit", - "hit_count": 3, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "symbol_resolution": 0, - "retrieval_total": 167, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 52, - "C0_SOURCE_CHUNKS": 22, - "C4_SEMANTIC_ROLES": 17, - "C2_DEPENDENCY_GRAPH": 61, - "C3_ENTRYPOINTS": 13 - }, - "merge_rank": 20 - } - } - }, - { - "step": "llm_answer", - "input": { - "query": "Покажи поток выполнения RuntimeManager", - "rag_count": 23 - }, - "output": { - "llm_answer": "## Шаги потока выполнения для `RuntimeManager`\n\n1. **Точка старта**: \n Поток начинается с вызова конструктора класса `RuntimeManager` при инициализации приложения или сервиса.\n\n2. **Передача параметров**:\n - При вызове конструктора передаются параметры конфигурации (`configuration`), сервисов (`services`), отслеживания трассировок (`traces`), состояния здоровья (`health`), ведения логов (`logs`), управления рабочими процессами (`workers`) и службы управления плоскостью контроля (`control_plane`).\n\n3. **Инициализация атрибутов объекта**:\n - Внутри метода `__init__` происходит присвоение значений параметрам, передаваемым конструктору, если они предоставлены. Если нет – создаются пустые экземпляры соответствующих классов (например, `ConfigurationManager`, `ServiceContainer`, `TraceService` и т.д.).\n \n4. **Регистрация модулей**:\n - После создания всех необходимых объектов производится регистрация модуля с помощью метода `_register_core_services`.\n\n5. **Использование экземпляров внутри методов класса**:\n - В дальнейшем экземпляр `RuntimeManager` может использоваться для выполнения различных операций через методы этого класса, например, добавление файлов конфигурации, регистрация служб, управление состоянием приложения и т.п.\n\n6. **Конечная точка потока**:\n - Поток завершается после того, как объект `RuntimeManager` выполнил все необходимые операции и достиг конечного состояния приложения или сервиса.\n\n## Недостатки информации\n\nНа данный момент отсутствует явная информация о том, как именно метод `register_module(module: ApplicationModule)` используется дальше в жизненном цикле объекта `RuntimeManager`. Это создаёт неопределённость относительно дальнейшего использования зарегистрированного модуля и того, каким образом он влияет на поведение объекта.\n\nТакже непонятно, какие события или действия инициируют дальнейшие процессы, управляемые объектом `RuntimeManager`, что могло бы предоставить более полное понимание его жизненного цикла и взаимодействия с другими компонентами системы." - }, - "diagnostics": { - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 766, - "evidence_rows": 23, - "evidence_chars": 8302 - }, - "evidence_summary": [ - { - "layer": "C1_SYMBOL_CATALOG", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "count": 8, - "unique_paths": 7 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "count": 10, - "unique_paths": 2 - }, - { - "layer": "C3_ENTRYPOINTS", - "count": 3, - "unique_paths": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 1, - "unique_paths": 1 - } - ], - "prompt_template_id": "intent_code_qa_trace_flow_ru_v1", - "system_prompt_version": "v1" - }, - "timings_ms": { - "prompt_build": 0, - "llm_call": 2802 - } - } - } - ] - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents/20260312_115642/full_chain_plba_code_subintents_plba-fullchain-trace-flow-runtime-manager.md b/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents/20260312_115642/full_chain_plba_code_subintents_plba-fullchain-trace-flow-runtime-manager.md deleted file mode 100644 index 96f305a..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents/20260312_115642/full_chain_plba_code_subintents_plba-fullchain-trace-flow-runtime-manager.md +++ /dev/null @@ -1,34 +0,0 @@ -# plba-fullchain-trace-flow-runtime-manager - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_subintents.yaml -- runner: runtime -- mode: full_chain -- passed: True - -## Query -Покажи поток выполнения RuntimeManager - -## Actual -{ - "intent": "CODE_QA", - "sub_intent": "TRACE_FLOW", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 23, - "llm_answer": "## Шаги потока выполнения для `RuntimeManager`\n\n1. **Точка старта**: \n Поток начинается с вызова конструктора класса `RuntimeManager` при инициализации приложения или сервиса.\n\n2. **Передача параметров**:\n - При вызове конструктора передаются параметры конфигурации (`configuration`), сервисов (`services`), отслеживания трассировок (`traces`), состояния здоровья (`health`), ведения логов (`logs`), управления рабочими процессами (`workers`) и службы управления плоскостью контроля (`control_plane`).\n\n3. **Инициализация атрибутов объекта**:\n - Внутри метода `__init__` происходит присвоение значений параметрам, передаваемым конструктору, если они предоставлены. Если нет – создаются пустые экземпляры соответствующих классов (например, `ConfigurationManager`, `ServiceContainer`, `TraceService` и т.д.).\n \n4. **Регистрация модулей**:\n - После создания всех необходимых объектов производится регистрация модуля с помощью метода `_register_core_services`.\n\n5. **Использование экземпляров внутри методов класса**:\n - В дальнейшем экземпляр `RuntimeManager` может использоваться для выполнения различных операций через методы этого класса, например, добавление файлов конфигурации, регистрация служб, управление состоянием приложения и т.п.\n\n6. **Конечная точка потока**:\n - Поток завершается после того, как объект `RuntimeManager` выполнил все необходимые операции и достиг конечного состояния приложения или сервиса.\n\n## Недостатки информации\n\nНа данный момент отсутствует явная информация о том, как именно метод `register_module(module: ApplicationModule)` используется дальше в жизненном цикле объекта `RuntimeManager`. Это создаёт неопределённость относительно дальнейшего использования зарегистрированного модуля и того, каким образом он влияет на поведение объекта.\n\nТакже непонятно, какие события или действия инициируют дальнейшие процессы, управляемые объектом `RuntimeManager`, что могло бы предоставить более полное понимание его жизненного цикла и взаимодействия с другими компонентами системы.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "RuntimeManager" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] -} - -## Mismatches -- none \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents/20260312_115642/summary.md b/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents/20260312_115642/summary.md deleted file mode 100644 index a7fe4ae..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents/20260312_115642/summary.md +++ /dev/null @@ -1,25 +0,0 @@ -# pipeline_setup_v2 summary - -Passed: 6/7 - -| File | Case | Query | Expected sub-intent | Intent | Actual sub-intent | RAG layers | Pass | -|------|------|-------|---------------------|--------|-------------------|------------|------| -| full_chain_plba_code_subintents.yaml | plba-fullchain-open-file-runtime | Открой файл src/app_runtime/core/runtime.py | OPEN_FILE | CODE_QA | OPEN_FILE | C0_SOURCE_CHUNKS:1 | ✓ | -| full_chain_plba_code_subintents.yaml | plba-fullchain-explain-runtime-manager | Объясни как работает класс RuntimeManager | EXPLAIN | CODE_QA | EXPLAIN | C0_SOURCE_CHUNKS:1, C1_SYMBOL_CATALOG:1, C2_DEPENDENCY_GRAPH:6, C3_ENTRYPOINTS:3, C4_SEMANTIC_ROLES:1 | ✓ | -| full_chain_plba_code_subintents.yaml | plba-fullchain-find-tests-runtime-manager | Где тесты для RuntimeManager? | FIND_TESTS | CODE_QA | FIND_TESTS | C0_SOURCE_CHUNKS:10, C2_DEPENDENCY_GRAPH:6 | ✓ | -| full_chain_plba_code_subintents.yaml | plba-fullchain-find-entrypoints | Найди точки входа в коде | FIND_ENTRYPOINTS | CODE_QA | FIND_ENTRYPOINTS | C0_SOURCE_CHUNKS:6, C3_ENTRYPOINTS:3 | ✓ | -| full_chain_plba_code_subintents.yaml | plba-fullchain-trace-flow-runtime-manager | Покажи поток выполнения RuntimeManager | TRACE_FLOW | CODE_QA | TRACE_FLOW | C0_SOURCE_CHUNKS:1, C1_SYMBOL_CATALOG:1, C2_DEPENDENCY_GRAPH:10, C3_ENTRYPOINTS:3, C4_SEMANTIC_ROLES:8 | ✓ | -| full_chain_plba_code_subintents.yaml | plba-fullchain-architecture-control-plane | Какие компоненты участвуют в control plane? | ARCHITECTURE | PROJECT_MISC | ARCHITECTURE | C0_SOURCE_CHUNKS:4, C1_SYMBOL_CATALOG:1, D3_SECTION_INDEX:6 | ✗ | -| full_chain_plba_code_subintents.yaml | plba-fullchain-explain-local-runtime-manager | Почему в файле src/app_runtime/core/runtime.py класс RuntimeManager устроен так? | EXPLAIN_LOCAL | CODE_QA | EXPLAIN_LOCAL | C0_SOURCE_CHUNKS:1, C1_SYMBOL_CATALOG:1, C2_DEPENDENCY_GRAPH:4 | ✓ | - -## Failures -- **plba-fullchain-architecture-control-plane**: intent: expected CODE_QA, got PROJECT_MISC; graph_id: expected CodeQAGraph, got ProjectMiscGraph; layers should include 'C4_SEMANTIC_ROLES', got ['D1_MODULE_CATALOG', 'D3_SECTION_INDEX', 'C1_SYMBOL_CATALOG', 'C0_SOURCE_CHUNKS']; layers should include 'C2_DEPENDENCY_GRAPH', got ['D1_MODULE_CATALOG', 'D3_SECTION_INDEX', 'C1_SYMBOL_CATALOG', 'C0_SOURCE_CHUNKS']; layers should include 'C3_ENTRYPOINTS', got ['D1_MODULE_CATALOG', 'D3_SECTION_INDEX', 'C1_SYMBOL_CATALOG', 'C0_SOURCE_CHUNKS'] - -## LLM Answers -- **plba-fullchain-open-file-runtime**: Файл `src/app_runtime/core/runtime.py` содержит определение класса `RuntimeManager`, управляющего выполнением приложения в runtime режиме. ## Важные сущности и их значение: - **Класс `RuntimeManager`:** Основной управляющий класс, инициализирующий компоненты системы (конфигурацию, сервисы, трассировку, здоровье, логирование, рабочие процессы и контрольную плоскость). - **Параметры конструктора:** - `configuration`, `services`, `traces`, `health`, `logs`, `workers`, `control_plane` — позволяют передавать внешние зависимости при создании экземпляра класса. - **Методы и поля:** - `_register_core_services()` — регистрирует основные сервисы приложения. - Поля `_started`, `_state`, `_core_registered`, `_workers_registered` отслеживают состояние инициализации и регистрации сервисов. Этот файл является важным компонентом архитектуры приложения, отвечающим за настройку и запу… -- **plba-fullchain-explain-runtime-manager**: ## Назначение класса `RuntimeManager` Класс `RuntimeManager` играет роль центрального координатора для управления жизненным циклом различных компонентов системы, предоставляя интерфейс для их регистрации, запуска и мониторинга. Он служит своего рода "менеджером" всех сервисов и модулей приложения, обеспечивая согласованное выполнение задач через заданные потоки данных и состояния. ## Ключевые зависимости Ключевыми зависимостями являются компоненты и сервисы, которые управляются и координируются `RuntimeManager`. Вот основные зависимости, указанные в символическом каталоге (`C1_SYMBOL_CATALOG`) и графе зависимостей (`C2_DEPENDENCY_GRAPH`): - **ConfigurationManager**: отвечает за конфигурацию приложения; - **ServiceContainer**: содержит коллекцию зарегистрированных сервисов; - **TraceService**: сервис для отслеживания событий и действий; - **HealthRegistry**: регистрир… -- **plba-fullchain-find-tests-runtime-manager**: Прямые тесты для `RuntimeManager` найдены в следующих местах: 1. **tests/test_runtime.py**: - `test_runtime_graceful_stop_waits_until_worker_finishes`: Проверяет корректное завершение работы менеджера при использовании команды остановки (`stop()`). Тестирует состояние процесса после завершения и правильность отображения статуса («busy» → «stopped»). - `test_runtime_runs_worker_routine_and_exposes_status`: Проверяет выполнение задачи и правильное отображение статуса работы модуля и самого менеджера (`idle`, успешная остановка). Эти тесты непосредственно работают с экземпляром `RuntimeManager`, создавая его, регистрируя модули и вызывая методы (например, `start()`, `stop()`), тем самым проверяя основные функциональные возможности объекта. Итоговый ответ: В папке `tests` существует два теста, напрямую связанных с `RuntimeManager`. Они находятся в файле `test_runtime.py`… -- **plba-fullchain-find-entrypoints**: Финальный ответ: В предоставленном контексте обнаружены следующие точки входа и обработчики запуска (entrypoints): 1. **src/app_runtime/control/http_app.py | app.post** - Файл: `http_app.py` - Сущность: `app.post` - Описание: Обработчик HTTP POST-запросов для FastAPI приложения. 2. **src/app_runtime/control/http_app.py | app.get** - Файл: `http_app.py` - Сущность: `app.get` - Описание: Обработчик HTTP GET-запросов для FastAPI приложения. Наиболее вероятные пропущенные или скрытые точки входа включают файлы и сущности, связанные с начальной настройкой и конфигурацией приложения: - src/app_runtime/config/__init__.py - Файл: `config/__init__.py` - Возможная сущность: `ConfigFileLoader`, `FileConfigProvider` - Роль: Загрузка конфигурации из файла и предоставление настроек приложению. Эти дополнительные точки входа важны для инициализации и настройки окружения перед запус… -- **plba-fullchain-trace-flow-runtime-manager**: ## Шаги потока выполнения для `RuntimeManager` 1. **Точка старта**: Поток начинается с вызова конструктора класса `RuntimeManager` при инициализации приложения или сервиса. 2. **Передача параметров**: - При вызове конструктора передаются параметры конфигурации (`configuration`), сервисов (`services`), отслеживания трассировок (`traces`), состояния здоровья (`health`), ведения логов (`logs`), управления рабочими процессами (`workers`) и службы управления плоскостью контроля (`control_plane`). 3. **Инициализация атрибутов объекта**: - Внутри метода `__init__` происходит присвоение значений параметрам, передаваемым конструктору, если они предоставлены. Если нет – создаются пустые экземпляры соответствующих классов (например, `ConfigurationManager`, `ServiceContainer`, `TraceService` и т.д.). 4. **Регистрация модулей**: - После создания всех необходимых объектов производ… -- **plba-fullchain-architecture-control-plane**: В control plane обычно участвуют следующие компоненты: 1. **Control Action Set** – управляет действиями контроля. 2. **Runtime Manager** – отвечает за старт и остановку runtime. 3. **Worker Supervisor** – контролирует жизненный цикл воркеров. 4. **Log Manager** – применяет и восстанавливает валидные конфигурации логирования. 5. **Health Registry** – регистрирует состояние здоровья компонентов. 6. **Workflow Engine** – исполняет бизнес-логику и управление workflow. 7. **Checkpoint Repository** – сохраняет промежуточные состояния задач. 8. **MySQL Trace Transport** – транспорт для трассировки событий. Эти компоненты обеспечивают контроль и управление состоянием системы, выполнение рабочих процессов и мониторинг их здоровья. -- **plba-fullchain-explain-local-runtime-manager**: Класс `RuntimeManager` из файла `src/app_runtime/core/runtime.py` предназначен для управления жизненным циклом приложения во время его выполнения. ### Что делает класс: 1. **Инициализация (Constructor):** - При создании объекта класса инициализируются все основные компоненты системы через параметры конструктора (`configuration`, `services`, `traces`, `health`, `logs`, `workers`, `control_plane`). - Если эти параметры отсутствуют, создаются их дефолтные экземпляры внутри метода. 2. **Регистрация модулей:** - Метод `register_module(module)` позволяет зарегистрировать новый модуль приложения в менеджере ресурсов (`self.registry`), обеспечивая интеграцию нового функционала. 3. **Управление состоянием приложения:** - Переменные `_started`, `_state`, `_core_registered`, `_workers_registered` отслеживают состояние менеджера, позволяя управлять различными фазами жизненного ц… \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents/20260312_115751/full_chain_plba_code_subintents_plba-fullchain-architecture-control-plane.json b/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents/20260312_115751/full_chain_plba_code_subintents_plba-fullchain-architecture-control-plane.json deleted file mode 100644 index d4d8e33..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents/20260312_115751/full_chain_plba_code_subintents_plba-fullchain-architecture-control-plane.json +++ /dev/null @@ -1,3036 +0,0 @@ -{ - "case_id": "plba-fullchain-architecture-control-plane", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_subintents.yaml", - "runner": "runtime", - "mode": "full_chain", - "actual": { - "intent": "CODE_QA", - "sub_intent": "ARCHITECTURE", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 25, - "llm_answer": "## Архитектурное объяснение RuntimeManager\n\n### Основные компоненты и их роли\n\n1. **RuntimeManager**\n - Роль: pipeline_stage\n - Описание: Менеджер выполнения этапов пайплайна. Оркеструет вызовы ролей, управляет состоянием приложения и участвует в потоках данных.\n - Ответственность: инициализация конфигурации, запуск процессов, чтение и запись состояния атрибутов.\n\n2. **ControlActionSet**\n - Роль: model\n - Описание: Модель управления действиями. Выполняет стандартные действия модели.\n - Ответственность: обработка стандартных операций и моделей поведения системы.\n\n### Связи и взаимодействия компонентов\n\n1. **Связь с внешним API через FastAPI**\n - Интерфейс взаимодействия с пользователем через HTTP-запросы.\n - Пример: `app.post` из `src/app_runtime/control/http_app.py`.\n\n2. **Управление данными и состояниями внутри пайплайна**\n - Данные передаются и обрабатываются между компонентами посредством вызовов методов RuntimeManager и ControlActionSet.\n - Пример: методы `start`, `configuration` и т.д., показанные в графе зависимостей (`C2_DEPENDENCY_GRAPH`).\n\n### Границы ответственности\n\n- RuntimeManager отвечает за управление жизненным циклом пайплайнов и координацию работы всех частей системы.\n- ControlActionSet выполняет типовые задачи и реализует поведение стандартной модели.\n\n## Ключевые выводы по архитектуре\n\n1. **Централизованное управление пайплайном**: RuntimeManager координирует выполнение различных задач и следит за целостностью потока данных.\n2. **Модульность системы**: Использование отдельных классов для управления состояниями и моделями позволяет легко расширять функциональность без изменения основного ядра системы.\n3. **Интеграция с внешними интерфейсами**: Контроллер на основе FastAPI обеспечивает удобный доступ к системе через HTTP-интерфейсы.\n4. **Гибкость и масштабируемость**: Разделение логики и обязанностей позволяет легко добавлять новые модули и улучшать существующие решения.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "RuntimeManager" - ], - "layers": [ - "C4_SEMANTIC_ROLES", - "C3_ENTRYPOINTS", - "C2_DEPENDENCY_GRAPH", - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS" - ] - }, - "passed": true, - "mismatches": [], - "details": { - "case_id": "plba-fullchain-architecture-control-plane", - "text": "Какие компоненты участвуют в RuntimeManager?", - "mode": "full_chain", - "run_started_at": "2026-03-12T11:57:51", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Какие компоненты участвуют в RuntimeManager?", - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "RuntimeManager", - "alternatives": [ - "RuntimeManager" - ], - "confidence": 0.99 - }, - "rag_count": 25, - "rag_rows": [ - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests manager\n- orchestrates role-like calls (4)\n- reads and writes state attributes\n- participates in dataflow slices (50)", - "layer": "C4_SEMANTIC_ROLES", - "title": "RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 43, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "7e4a9381328c5803bbc6179458612fc4e947d928aa7bf8b4b2bebb2c8592f758", - "symbol_name": "RuntimeManager", - "qname": "RuntimeManager", - "role": "pipeline_stage", - "confidence": 0.67, - "dataflow_participation": 50, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "ControlActionSet\nrole: model\n\nResponsibilities:\n- default model role", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlActionSet", - "span_start": 14, - "span_end": 18, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 40, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "46eb026cb3313415ec47b82dd22f84f4d112c9d987e8b1716dcb0baa1cce8988", - "symbol_name": "ControlActionSet", - "qname": "ControlActionSet", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "ControlChannel\nrole: model\n\nResponsibilities:\n- default model role", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlChannel", - "span_start": 21, - "span_end": 28, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 40, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "cfcfe9a311d3a2dbdaf32ac4ccd73c0eb9a117f830591a1c0867ee97d46204ff", - "symbol_name": "ControlChannel", - "qname": "ControlChannel", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests service\n- reads and writes state attributes\n- participates in dataflow slices (5)", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlPlaneService", - "span_start": 12, - "span_end": 52, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 68, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "b13471e5916986dccffb53fab613812842965705e6b3a89ae549d30c9e91e9aa", - "symbol_name": "ControlPlaneService", - "qname": "ControlPlaneService", - "role": "pipeline_stage", - "confidence": 0.57, - "dataflow_participation": 5, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_runner.py", - "content": "UvicornThreadRunner\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (24)", - "layer": "C4_SEMANTIC_ROLES", - "title": "UvicornThreadRunner", - "span_start": 10, - "span_end": 61, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 11, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "fd55630045a02100df8877ac27d951ee08617d4598764394d48cb51fe067476a", - "symbol_name": "UvicornThreadRunner", - "qname": "UvicornThreadRunner", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 24, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "3779fdd2878b770e789a35bb2a89c9d79f13b61c26d7db1b3b683f9bb9e1623f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (10)", - "layer": "C4_SEMANTIC_ROLES", - "title": "HttpControlChannel", - "span_start": 12, - "span_end": 57, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 21, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "1c9fbdc24819e5604c26ea55428a74310f03a03e1af197ed84846af61e42fdb0", - "symbol_name": "HttpControlChannel", - "qname": "HttpControlChannel", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 10, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "HttpControlAppFactory\nrole: factory\n\nResponsibilities:\n- name suffix suggests factory", - "layer": "C4_SEMANTIC_ROLES", - "title": "HttpControlAppFactory", - "span_start": 15, - "span_end": 53, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 39, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "9b3502a5fb408b273223db13264349cf500de24915b6c649d9ea8970d0dfd8e0", - "symbol_name": "HttpControlAppFactory", - "qname": "HttpControlAppFactory", - "role": "factory", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/persistence/workflow_persistence.py", - "content": "WorkflowPersistence\nrole: pipeline_stage\n\nResponsibilities:\n- orchestrates role-like calls (2)\n- reads and writes state attributes\n- participates in dataflow slices (16)", - "layer": "C4_SEMANTIC_ROLES", - "title": "WorkflowPersistence", - "span_start": 8, - "span_end": 54, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 15, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "7bd01ee45cf31f2d5c2e3e51656254860ac785d10cef9e0852cd4fba90857bae", - "symbol_name": "WorkflowPersistence", - "qname": "WorkflowPersistence", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 16, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "80e9410ddc639789b4353c2a1a757ba8d0d5b5bb6075b0b263b61551f04ae1f0", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/queue/in_memory.py", - "content": "InMemoryTaskQueue\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (9)", - "layer": "C4_SEMANTIC_ROLES", - "title": "InMemoryTaskQueue", - "span_start": 9, - "span_end": 38, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 22, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "2da04cb94544a3bcbf0943a95ad4bdd8710bcafaa32a02fd0e4de2178dcf3533", - "symbol_name": "InMemoryTaskQueue", - "qname": "InMemoryTaskQueue", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 9, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "58f0cc001ccda0eee4c6bc32ed83bd05eafd6b6644f1e8b4aa9eed3103db73dc", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/config/file_loader.py", - "content": "ConfigFileLoader\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (8)", - "layer": "C4_SEMANTIC_ROLES", - "title": "ConfigFileLoader", - "span_start": 11, - "span_end": 48, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 23, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "a8474eca8b6e9dc86ae67ed68b16fa5fb639ef08739c053e7b7195489765667f", - "symbol_name": "ConfigFileLoader", - "qname": "ConfigFileLoader", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 8, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "1f19ffebde5e38e4be5a5d5a678059a0f36dedb8fb8b3e00ab395c67106a87ea", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/store.py", - "content": "TraceContextStore\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (6)", - "layer": "C4_SEMANTIC_ROLES", - "title": "TraceContextStore", - "span_start": 15, - "span_end": 52, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 25, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "b2dad4fbe16ffb11b58deba311c7739955c39d59f291b22181f33e9c8cce4059", - "symbol_name": "TraceContextStore", - "qname": "TraceContextStore", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 6, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "d369554f08fc92039c6edd5a2a1e73b23901533e8974459170bbd9347d263dc5", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workers/supervisor.py", - "content": "WorkerSupervisor\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (6)", - "layer": "C4_SEMANTIC_ROLES", - "title": "WorkerSupervisor", - "span_start": 10, - "span_end": 59, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 25, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "c17b44e8d9e97d490989b21fa67d7c346cdda8a0472e4c41fb243c8846faa124", - "symbol_name": "WorkerSupervisor", - "qname": "WorkerSupervisor", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 6, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "77609d9d5927171cce7fc3a54897c183fd63068710c6362029b700937aae5eee", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._start_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 47, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517", - "dst_ref": "ControlPlaneService._start_async", - "resolution": "resolved", - "slice_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._start_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager.start", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 32, - "span_end": 59, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "98312ace7fc62b1c7194c5aa1732b6ef736eae1668a3a120dd1ecd5ab1d64f7a", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "77a7b260193018845e4e204df094ab89cfd7c82ee4e822b3a83ad4cd945f9cb1", - "dst_ref": "RuntimeManager.start", - "resolution": "resolved", - "slice_id": "98312ace7fc62b1c7194c5aa1732b6ef736eae1668a3a120dd1ecd5ab1d64f7a", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager.start" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "77a7b260193018845e4e204df094ab89cfd7c82ee4e822b3a83ad4cd945f9cb1" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.start", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 20, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154", - "dst_ref": "ControlPlaneService.start", - "resolution": "resolved", - "slice_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.start" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.stop", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 25, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d", - "dst_ref": "ControlPlaneService.stop", - "resolution": "resolved", - "slice_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.stop" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._stop_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 51, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a", - "dst_ref": "ControlPlaneService._stop_async", - "resolution": "resolved", - "slice_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._stop_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager.add_config_file", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 32, - "span_end": 52, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "a23b8a11ebdb12708b60c96ea12a69f7f042082f1adfddd572444e246d81d167", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "57ffbd4f0d9fdf3507c2b8624312ce211f3d02fdf86a57a8ec90778d8a7b498d", - "dst_ref": "RuntimeManager.add_config_file", - "resolution": "resolved", - "slice_id": "a23b8a11ebdb12708b60c96ea12a69f7f042082f1adfddd572444e246d81d167", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager.add_config_file" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "57ffbd4f0d9fdf3507c2b8624312ce211f3d02fdf86a57a8ec90778d8a7b498d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.register_channel", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 17, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957", - "dst_ref": "ControlPlaneService.register_channel", - "resolution": "resolved", - "slice_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.register_channel" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager._register_core_services", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 32, - "span_end": 127, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "3e5811f3b511fa0cabe363f5d01f2ac5fa039bc8b93f7ee108323e1f5f45a293", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "972d6057a6caac9cf31ebc1e29c6f39f71b10d4cc170dec57cf875ba458549c6", - "dst_ref": "RuntimeManager._register_core_services", - "resolution": "resolved", - "slice_id": "3e5811f3b511fa0cabe363f5d01f2ac5fa039bc8b93f7ee108323e1f5f45a293", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager._register_core_services" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "972d6057a6caac9cf31ebc1e29c6f39f71b10d4cc170dec57cf875ba458549c6" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "class RuntimeManager\nRuntimeManager", - "layer": "C1_SYMBOL_CATALOG", - "title": "RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "7e4a9381328c5803bbc6179458612fc4e947d928aa7bf8b4b2bebb2c8592f758", - "qname": "RuntimeManager", - "kind": "class", - "signature": "RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.core.runtime", - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "class RuntimeManager:\n ACTION_TIMEOUT_SECONDS = 10.0\n ACTION_POLL_INTERVAL_SECONDS = 0.05\n\n def __init__(\n self,\n configuration: ConfigurationManager | None = None,\n services: ServiceContainer | None = None,\n traces: TraceService | None = None,\n health: HealthRegistry | None = None,\n logs: LogManager | None = None,\n workers: WorkerSupervisor | None = None,\n control_plane: ControlPlaneService | None = None,\n ) -> None:\n self.configuration = configuration or ConfigurationManager()\n self.services = services or ServiceContainer()\n self.traces = traces or TraceService()\n self.health = health or HealthRegistry()\n self.logs = logs or LogManager()\n self.workers = workers or WorkerSupervisor()\n self.control_plane = control_plane or ControlPlaneService()\n self.registry = ModuleRegistry(self.services)\n self._started = False\n self._state = LifecycleState.IDLE\n self._core_registered = False\n self._workers_registered = False\n self._register_core_services()\n\n def register_module(self, module: ApplicationModule) -> None:\n self.registry.register_module(module.name)\n module.register(self.registry)\n\n def add_config_file(self, path: str) -> FileConfigProvider:\n provider = FileConfigProvider(path)\n self.configuration.add_provider(provider)\n return provider\n\n def start(self, *, start_control_plane: bool = True) -> None:\n if self._started:\n return\n self._state = LifecycleState.STARTING\n config = self.configuration.load()\n self.logs.apply_config(config)\n self._register_health_contributors()\n self._register_workers()\n self.workers.start()\n if start_control_plane:\n self.control_plane.start(self)\n self._started = True\n self._refresh_state()\n\n def stop(self, timeout: float = 30.0, force: bool = False, stop_control_plane: bool = True) -> None:\n if not self._started:\n return\n self._state = LifecycleState.STOPPING\n self.workers.stop(timeout=timeout, force=force)\n if stop_control_plane:\n self.control_plane.stop()\n self._started = False\n self._state = LifecycleState.STOPPED\n\n def status(self) -> dict[str, object]:\n self._refresh_state()\n return self.control_plane.snapshot(self)\n\n def current_health(self) -> HealthPayload:\n self._refresh_state()\n return self.health.payload(self._state, self.workers.healths())\n\n async def health_status(self) -> HealthPayload:\n return self.current_health()\n\n async def start_runtime(self) -> dict[str, object] | str:\n self._refresh_state()\n if self._started:\n return \"runtime already running\"\n if self._state == LifecycleState.STOPPING:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n\n self.start(start_control_plane=False)\n started = self._wait_for_state({LifecycleState.IDLE, LifecycleState.BUSY}, timeout=self.ACTION_TIMEOUT_SECONDS)\n if started:\n return self._action_detail(\"runtime started\", timed_out=False)\n return self._action_detail(\"runtime start is still in progress\", timed_out=True)\n\n async def stop_runtime(self) -> dict[str, object] | str:\n self._refresh_state()\n if not self._started:\n if self._state == LifecycleState.STOPPING:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n return \"runtime already stopped\"\n\n self._state = LifecycleState.STOPPING\n try:\n self.workers.stop(timeout=self.ACTION_TIMEOUT_SECONDS, force=False)\n except TimeoutError:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n\n self._started = False\n self._state = LifecycleState.STOPPED\n return self._action_detail(\"runtime stopped\", timed_out=False)\n\n async def runtime_status(self) -> str:\n self._refresh_state()\n return self._state.value\n\n def _register_core_services(self) -> None:\n if self._core_registered:\n return\n self.services.register(\"configuration\", self.configuration)\n self.services.register(\"traces\", self.traces)\n self.services.register(\"health\", self.health)\n self.services.register(\"logs\", self.logs)\n self.services.register(\"workers\", self.workers)\n self.services.register(\"control_plane\", self.control_plane)\n self._core_registered = True\n\n def _register_health_contributors(self) -> None:\n for contributor in self.registry.health_contributors:\n self.health.register(contributor)\n\n def _register_workers(self) -> None:\n if self._workers_registered:\n return\n for worker in self.registry.workers:\n self.workers.register(worker)\n self._workers_registered = True\n\n def _refresh_state(self) -> None:\n lifecycle = self.workers.lifecycle_state()\n\n if self._state == LifecycleState.STOPPING:\n if lifecycle == LifecycleState.STOPPED:\n self._started = False\n self._state = LifecycleState.STOPPED\n return\n\n if not self._started:\n if lifecycle == LifecycleState.STOPPED:\n self._state = LifecycleState.STOPPED\n return\n\n self._state = lifecycle\n\n def _wait_for_state(self, target_states: set[LifecycleState], *, timeout: float) -> bool:\n deadline = monotonic() + timeout\n while monotonic() < deadline:\n self._refresh_state()\n if self._state in target_states:\n return True\n sleep(self.ACTION_POLL_INTERVAL_SECONDS)\n self._refresh_state()\n return self._state in target_states\n\n def _action_detail(self, message: str, *, timed_out: bool) -> dict[str, object]:\n self._refresh_state()\n return {\n \"message\": message,\n \"state\": self._state.value,\n \"timed_out\": timed_out,\n \"workers\": self.workers.snapshot(),\n }", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/core/runtime.py:RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.core.runtime", - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "llm_answer": "## Архитектурное объяснение RuntimeManager\n\n### Основные компоненты и их роли\n\n1. **RuntimeManager**\n - Роль: pipeline_stage\n - Описание: Менеджер выполнения этапов пайплайна. Оркеструет вызовы ролей, управляет состоянием приложения и участвует в потоках данных.\n - Ответственность: инициализация конфигурации, запуск процессов, чтение и запись состояния атрибутов.\n\n2. **ControlActionSet**\n - Роль: model\n - Описание: Модель управления действиями. Выполняет стандартные действия модели.\n - Ответственность: обработка стандартных операций и моделей поведения системы.\n\n### Связи и взаимодействия компонентов\n\n1. **Связь с внешним API через FastAPI**\n - Интерфейс взаимодействия с пользователем через HTTP-запросы.\n - Пример: `app.post` из `src/app_runtime/control/http_app.py`.\n\n2. **Управление данными и состояниями внутри пайплайна**\n - Данные передаются и обрабатываются между компонентами посредством вызовов методов RuntimeManager и ControlActionSet.\n - Пример: методы `start`, `configuration` и т.д., показанные в графе зависимостей (`C2_DEPENDENCY_GRAPH`).\n\n### Границы ответственности\n\n- RuntimeManager отвечает за управление жизненным циклом пайплайнов и координацию работы всех частей системы.\n- ControlActionSet выполняет типовые задачи и реализует поведение стандартной модели.\n\n## Ключевые выводы по архитектуре\n\n1. **Централизованное управление пайплайном**: RuntimeManager координирует выполнение различных задач и следит за целостностью потока данных.\n2. **Модульность системы**: Использование отдельных классов для управления состояниями и моделями позволяет легко расширять функциональность без изменения основного ядра системы.\n3. **Интеграция с внешними интерфейсами**: Контроллер на основе FastAPI обеспечивает удобный доступ к системе через HTTP-интерфейсы.\n4. **Гибкость и масштабируемость**: Разделение логики и обязанностей позволяет легко добавлять новые модули и улучшать существующие решения.", - "summary": { - "router": { - "intent": "CODE_QA", - "sub_intent": "ARCHITECTURE", - "confidence": null - }, - "retrieval": { - "profile": "code", - "layers_hit": [ - "C0_SOURCE_CHUNKS", - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS", - "C4_SEMANTIC_ROLES" - ], - "evidence_sufficient": true - }, - "llm": { - "answer_status": "answered", - "groundedness": "grounded" - } - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "ARCHITECTURE", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C4_SEMANTIC_ROLES", - "C3_ENTRYPOINTS", - "C2_DEPENDENCY_GRAPH", - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "RuntimeManager" - ], - "keyword_hints": [ - "RuntimeManager" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "execution": { - "executed_layers": [ - "C4_SEMANTIC_ROLES", - "C3_ENTRYPOINTS", - "C2_DEPENDENCY_GRAPH", - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS" - ], - "retrieval_mode_by_layer": { - "C4_SEMANTIC_ROLES": "exact_path_fetch", - "C3_ENTRYPOINTS": "exact_path_fetch", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C1_SYMBOL_CATALOG": "symbol_search", - "C0_SOURCE_CHUNKS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C4_SEMANTIC_ROLES": 12, - "C3_ENTRYPOINTS": 8, - "C2_DEPENDENCY_GRAPH": 8, - "C1_SYMBOL_CATALOG": 6, - "C0_SOURCE_CHUNKS": 4 - }, - "filters_by_layer": { - "C4_SEMANTIC_ROLES": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C1_SYMBOL_CATALOG": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C4_SEMANTIC_ROLES", - "query": "Какие компоненты участвуют в RuntimeManager?", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 12, - "ranking_profile": "code" - }, - { - "layer": "C3_ENTRYPOINTS", - "query": "Какие компоненты участвуют в RuntimeManager?", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "Какие компоненты участвуют в RuntimeManager?", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C1_SYMBOL_CATALOG", - "query": "RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Какие компоненты участвуют в RuntimeManager?", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 4, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C4_SEMANTIC_ROLES", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 12, - "candidates_after_filter": 12 - }, - { - "layer": "C3_ENTRYPOINTS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 3, - "candidates_after_filter": 3 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 1, - "candidates_after_filter": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 4, - "candidates_after_filter": 4 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "RuntimeManager", - "alternatives": [ - "RuntimeManager" - ] - }, - "layers": [ - { - "layer": "C4_SEMANTIC_ROLES", - "status": "hit", - "hit_count": 12, - "fail_reason": null - }, - { - "layer": "C3_ENTRYPOINTS", - "status": "hit", - "hit_count": 3, - "fail_reason": null - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 8, - "fail_reason": null - }, - { - "layer": "C1_SYMBOL_CATALOG", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 1, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "router": 1, - "symbol_resolution": 0, - "retrieval_total": 164, - "retrieval_by_layer": { - "C4_SEMANTIC_ROLES": 40, - "C3_ENTRYPOINTS": 19, - "C2_DEPENDENCY_GRAPH": 64, - "C1_SYMBOL_CATALOG": 24, - "C0_SOURCE_CHUNKS": 15 - }, - "merge_rank": 17, - "prompt_build": 0, - "llm_call": 3073 - }, - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 480, - "evidence_rows": 25, - "evidence_chars": 8651 - }, - "evidence_summary": [ - { - "layer": "C4_SEMANTIC_ROLES", - "count": 12, - "unique_paths": 11 - }, - { - "layer": "C3_ENTRYPOINTS", - "count": 3, - "unique_paths": 1 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "count": 8, - "unique_paths": 2 - }, - { - "layer": "C1_SYMBOL_CATALOG", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 1, - "unique_paths": 1 - } - ], - "prompt_template_id": "intent_code_qa_architecture_ru_v1", - "system_prompt_version": "v1" - }, - "router": { - "conversation_mode": "START", - "keyword_hints": [ - "RuntimeManager" - ], - "path_scope": [] - }, - "llm": { - "used_evidence_count": 25, - "missing_evidence_reason": null - } - }, - "run_info": { - "case_id": "plba-fullchain-architecture-control-plane", - "mode": "full_chain", - "run_started_at": "2026-03-12T11:57:51", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - }, - "input_request": { - "text": "Какие компоненты участвуют в RuntimeManager?", - "normalized_query": "Какие компоненты участвуют в RuntimeManager?" - }, - "steps": [ - { - "step": "intent_router", - "input": { - "query": "Какие компоненты участвуют в RuntimeManager?" - }, - "output": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Какие компоненты участвуют в RuntimeManager?" - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "ARCHITECTURE", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C4_SEMANTIC_ROLES", - "C3_ENTRYPOINTS", - "C2_DEPENDENCY_GRAPH", - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "RuntimeManager" - ], - "keyword_hints": [ - "RuntimeManager" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "timings_ms": { - "router": 1 - } - } - }, - { - "step": "retrieval", - "input": { - "query": "Какие компоненты участвуют в RuntimeManager?" - }, - "output": { - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "RuntimeManager", - "alternatives": [ - "RuntimeManager" - ], - "confidence": 0.99 - }, - "rag_count": 25, - "rag_rows": [ - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests manager\n- orchestrates role-like calls (4)\n- reads and writes state attributes\n- participates in dataflow slices (50)", - "layer": "C4_SEMANTIC_ROLES", - "title": "RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 43, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "7e4a9381328c5803bbc6179458612fc4e947d928aa7bf8b4b2bebb2c8592f758", - "symbol_name": "RuntimeManager", - "qname": "RuntimeManager", - "role": "pipeline_stage", - "confidence": 0.67, - "dataflow_participation": 50, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "ControlActionSet\nrole: model\n\nResponsibilities:\n- default model role", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlActionSet", - "span_start": 14, - "span_end": 18, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 40, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "46eb026cb3313415ec47b82dd22f84f4d112c9d987e8b1716dcb0baa1cce8988", - "symbol_name": "ControlActionSet", - "qname": "ControlActionSet", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "ControlChannel\nrole: model\n\nResponsibilities:\n- default model role", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlChannel", - "span_start": 21, - "span_end": 28, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 40, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "cfcfe9a311d3a2dbdaf32ac4ccd73c0eb9a117f830591a1c0867ee97d46204ff", - "symbol_name": "ControlChannel", - "qname": "ControlChannel", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests service\n- reads and writes state attributes\n- participates in dataflow slices (5)", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlPlaneService", - "span_start": 12, - "span_end": 52, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 68, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "b13471e5916986dccffb53fab613812842965705e6b3a89ae549d30c9e91e9aa", - "symbol_name": "ControlPlaneService", - "qname": "ControlPlaneService", - "role": "pipeline_stage", - "confidence": 0.57, - "dataflow_participation": 5, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_runner.py", - "content": "UvicornThreadRunner\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (24)", - "layer": "C4_SEMANTIC_ROLES", - "title": "UvicornThreadRunner", - "span_start": 10, - "span_end": 61, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 11, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "fd55630045a02100df8877ac27d951ee08617d4598764394d48cb51fe067476a", - "symbol_name": "UvicornThreadRunner", - "qname": "UvicornThreadRunner", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 24, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "3779fdd2878b770e789a35bb2a89c9d79f13b61c26d7db1b3b683f9bb9e1623f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (10)", - "layer": "C4_SEMANTIC_ROLES", - "title": "HttpControlChannel", - "span_start": 12, - "span_end": 57, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 21, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "1c9fbdc24819e5604c26ea55428a74310f03a03e1af197ed84846af61e42fdb0", - "symbol_name": "HttpControlChannel", - "qname": "HttpControlChannel", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 10, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "HttpControlAppFactory\nrole: factory\n\nResponsibilities:\n- name suffix suggests factory", - "layer": "C4_SEMANTIC_ROLES", - "title": "HttpControlAppFactory", - "span_start": 15, - "span_end": 53, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 39, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "9b3502a5fb408b273223db13264349cf500de24915b6c649d9ea8970d0dfd8e0", - "symbol_name": "HttpControlAppFactory", - "qname": "HttpControlAppFactory", - "role": "factory", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/persistence/workflow_persistence.py", - "content": "WorkflowPersistence\nrole: pipeline_stage\n\nResponsibilities:\n- orchestrates role-like calls (2)\n- reads and writes state attributes\n- participates in dataflow slices (16)", - "layer": "C4_SEMANTIC_ROLES", - "title": "WorkflowPersistence", - "span_start": 8, - "span_end": 54, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 15, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "7bd01ee45cf31f2d5c2e3e51656254860ac785d10cef9e0852cd4fba90857bae", - "symbol_name": "WorkflowPersistence", - "qname": "WorkflowPersistence", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 16, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "80e9410ddc639789b4353c2a1a757ba8d0d5b5bb6075b0b263b61551f04ae1f0", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/queue/in_memory.py", - "content": "InMemoryTaskQueue\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (9)", - "layer": "C4_SEMANTIC_ROLES", - "title": "InMemoryTaskQueue", - "span_start": 9, - "span_end": 38, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 22, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "2da04cb94544a3bcbf0943a95ad4bdd8710bcafaa32a02fd0e4de2178dcf3533", - "symbol_name": "InMemoryTaskQueue", - "qname": "InMemoryTaskQueue", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 9, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "58f0cc001ccda0eee4c6bc32ed83bd05eafd6b6644f1e8b4aa9eed3103db73dc", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/config/file_loader.py", - "content": "ConfigFileLoader\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (8)", - "layer": "C4_SEMANTIC_ROLES", - "title": "ConfigFileLoader", - "span_start": 11, - "span_end": 48, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 23, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "a8474eca8b6e9dc86ae67ed68b16fa5fb639ef08739c053e7b7195489765667f", - "symbol_name": "ConfigFileLoader", - "qname": "ConfigFileLoader", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 8, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "1f19ffebde5e38e4be5a5d5a678059a0f36dedb8fb8b3e00ab395c67106a87ea", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/store.py", - "content": "TraceContextStore\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (6)", - "layer": "C4_SEMANTIC_ROLES", - "title": "TraceContextStore", - "span_start": 15, - "span_end": 52, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 25, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "b2dad4fbe16ffb11b58deba311c7739955c39d59f291b22181f33e9c8cce4059", - "symbol_name": "TraceContextStore", - "qname": "TraceContextStore", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 6, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "d369554f08fc92039c6edd5a2a1e73b23901533e8974459170bbd9347d263dc5", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workers/supervisor.py", - "content": "WorkerSupervisor\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (6)", - "layer": "C4_SEMANTIC_ROLES", - "title": "WorkerSupervisor", - "span_start": 10, - "span_end": 59, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 25, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "c17b44e8d9e97d490989b21fa67d7c346cdda8a0472e4c41fb243c8846faa124", - "symbol_name": "WorkerSupervisor", - "qname": "WorkerSupervisor", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 6, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "77609d9d5927171cce7fc3a54897c183fd63068710c6362029b700937aae5eee", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._start_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 47, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517", - "dst_ref": "ControlPlaneService._start_async", - "resolution": "resolved", - "slice_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._start_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager.start", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 32, - "span_end": 59, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "98312ace7fc62b1c7194c5aa1732b6ef736eae1668a3a120dd1ecd5ab1d64f7a", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "77a7b260193018845e4e204df094ab89cfd7c82ee4e822b3a83ad4cd945f9cb1", - "dst_ref": "RuntimeManager.start", - "resolution": "resolved", - "slice_id": "98312ace7fc62b1c7194c5aa1732b6ef736eae1668a3a120dd1ecd5ab1d64f7a", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager.start" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "77a7b260193018845e4e204df094ab89cfd7c82ee4e822b3a83ad4cd945f9cb1" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.start", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 20, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154", - "dst_ref": "ControlPlaneService.start", - "resolution": "resolved", - "slice_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.start" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.stop", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 25, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d", - "dst_ref": "ControlPlaneService.stop", - "resolution": "resolved", - "slice_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.stop" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._stop_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 51, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a", - "dst_ref": "ControlPlaneService._stop_async", - "resolution": "resolved", - "slice_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._stop_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager.add_config_file", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 32, - "span_end": 52, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "a23b8a11ebdb12708b60c96ea12a69f7f042082f1adfddd572444e246d81d167", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "57ffbd4f0d9fdf3507c2b8624312ce211f3d02fdf86a57a8ec90778d8a7b498d", - "dst_ref": "RuntimeManager.add_config_file", - "resolution": "resolved", - "slice_id": "a23b8a11ebdb12708b60c96ea12a69f7f042082f1adfddd572444e246d81d167", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager.add_config_file" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "57ffbd4f0d9fdf3507c2b8624312ce211f3d02fdf86a57a8ec90778d8a7b498d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.register_channel", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 17, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957", - "dst_ref": "ControlPlaneService.register_channel", - "resolution": "resolved", - "slice_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.register_channel" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager._register_core_services", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 32, - "span_end": 127, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "3e5811f3b511fa0cabe363f5d01f2ac5fa039bc8b93f7ee108323e1f5f45a293", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "972d6057a6caac9cf31ebc1e29c6f39f71b10d4cc170dec57cf875ba458549c6", - "dst_ref": "RuntimeManager._register_core_services", - "resolution": "resolved", - "slice_id": "3e5811f3b511fa0cabe363f5d01f2ac5fa039bc8b93f7ee108323e1f5f45a293", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager._register_core_services" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "972d6057a6caac9cf31ebc1e29c6f39f71b10d4cc170dec57cf875ba458549c6" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "class RuntimeManager\nRuntimeManager", - "layer": "C1_SYMBOL_CATALOG", - "title": "RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "7e4a9381328c5803bbc6179458612fc4e947d928aa7bf8b4b2bebb2c8592f758", - "qname": "RuntimeManager", - "kind": "class", - "signature": "RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.core.runtime", - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "class RuntimeManager:\n ACTION_TIMEOUT_SECONDS = 10.0\n ACTION_POLL_INTERVAL_SECONDS = 0.05\n\n def __init__(\n self,\n configuration: ConfigurationManager | None = None,\n services: ServiceContainer | None = None,\n traces: TraceService | None = None,\n health: HealthRegistry | None = None,\n logs: LogManager | None = None,\n workers: WorkerSupervisor | None = None,\n control_plane: ControlPlaneService | None = None,\n ) -> None:\n self.configuration = configuration or ConfigurationManager()\n self.services = services or ServiceContainer()\n self.traces = traces or TraceService()\n self.health = health or HealthRegistry()\n self.logs = logs or LogManager()\n self.workers = workers or WorkerSupervisor()\n self.control_plane = control_plane or ControlPlaneService()\n self.registry = ModuleRegistry(self.services)\n self._started = False\n self._state = LifecycleState.IDLE\n self._core_registered = False\n self._workers_registered = False\n self._register_core_services()\n\n def register_module(self, module: ApplicationModule) -> None:\n self.registry.register_module(module.name)\n module.register(self.registry)\n\n def add_config_file(self, path: str) -> FileConfigProvider:\n provider = FileConfigProvider(path)\n self.configuration.add_provider(provider)\n return provider\n\n def start(self, *, start_control_plane: bool = True) -> None:\n if self._started:\n return\n self._state = LifecycleState.STARTING\n config = self.configuration.load()\n self.logs.apply_config(config)\n self._register_health_contributors()\n self._register_workers()\n self.workers.start()\n if start_control_plane:\n self.control_plane.start(self)\n self._started = True\n self._refresh_state()\n\n def stop(self, timeout: float = 30.0, force: bool = False, stop_control_plane: bool = True) -> None:\n if not self._started:\n return\n self._state = LifecycleState.STOPPING\n self.workers.stop(timeout=timeout, force=force)\n if stop_control_plane:\n self.control_plane.stop()\n self._started = False\n self._state = LifecycleState.STOPPED\n\n def status(self) -> dict[str, object]:\n self._refresh_state()\n return self.control_plane.snapshot(self)\n\n def current_health(self) -> HealthPayload:\n self._refresh_state()\n return self.health.payload(self._state, self.workers.healths())\n\n async def health_status(self) -> HealthPayload:\n return self.current_health()\n\n async def start_runtime(self) -> dict[str, object] | str:\n self._refresh_state()\n if self._started:\n return \"runtime already running\"\n if self._state == LifecycleState.STOPPING:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n\n self.start(start_control_plane=False)\n started = self._wait_for_state({LifecycleState.IDLE, LifecycleState.BUSY}, timeout=self.ACTION_TIMEOUT_SECONDS)\n if started:\n return self._action_detail(\"runtime started\", timed_out=False)\n return self._action_detail(\"runtime start is still in progress\", timed_out=True)\n\n async def stop_runtime(self) -> dict[str, object] | str:\n self._refresh_state()\n if not self._started:\n if self._state == LifecycleState.STOPPING:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n return \"runtime already stopped\"\n\n self._state = LifecycleState.STOPPING\n try:\n self.workers.stop(timeout=self.ACTION_TIMEOUT_SECONDS, force=False)\n except TimeoutError:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n\n self._started = False\n self._state = LifecycleState.STOPPED\n return self._action_detail(\"runtime stopped\", timed_out=False)\n\n async def runtime_status(self) -> str:\n self._refresh_state()\n return self._state.value\n\n def _register_core_services(self) -> None:\n if self._core_registered:\n return\n self.services.register(\"configuration\", self.configuration)\n self.services.register(\"traces\", self.traces)\n self.services.register(\"health\", self.health)\n self.services.register(\"logs\", self.logs)\n self.services.register(\"workers\", self.workers)\n self.services.register(\"control_plane\", self.control_plane)\n self._core_registered = True\n\n def _register_health_contributors(self) -> None:\n for contributor in self.registry.health_contributors:\n self.health.register(contributor)\n\n def _register_workers(self) -> None:\n if self._workers_registered:\n return\n for worker in self.registry.workers:\n self.workers.register(worker)\n self._workers_registered = True\n\n def _refresh_state(self) -> None:\n lifecycle = self.workers.lifecycle_state()\n\n if self._state == LifecycleState.STOPPING:\n if lifecycle == LifecycleState.STOPPED:\n self._started = False\n self._state = LifecycleState.STOPPED\n return\n\n if not self._started:\n if lifecycle == LifecycleState.STOPPED:\n self._state = LifecycleState.STOPPED\n return\n\n self._state = lifecycle\n\n def _wait_for_state(self, target_states: set[LifecycleState], *, timeout: float) -> bool:\n deadline = monotonic() + timeout\n while monotonic() < deadline:\n self._refresh_state()\n if self._state in target_states:\n return True\n sleep(self.ACTION_POLL_INTERVAL_SECONDS)\n self._refresh_state()\n return self._state in target_states\n\n def _action_detail(self, message: str, *, timed_out: bool) -> dict[str, object]:\n self._refresh_state()\n return {\n \"message\": message,\n \"state\": self._state.value,\n \"timed_out\": timed_out,\n \"workers\": self.workers.snapshot(),\n }", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/core/runtime.py:RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.core.runtime", - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ] - }, - "diagnostics": { - "execution": { - "executed_layers": [ - "C4_SEMANTIC_ROLES", - "C3_ENTRYPOINTS", - "C2_DEPENDENCY_GRAPH", - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS" - ], - "retrieval_mode_by_layer": { - "C4_SEMANTIC_ROLES": "exact_path_fetch", - "C3_ENTRYPOINTS": "exact_path_fetch", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C1_SYMBOL_CATALOG": "symbol_search", - "C0_SOURCE_CHUNKS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C4_SEMANTIC_ROLES": 12, - "C3_ENTRYPOINTS": 8, - "C2_DEPENDENCY_GRAPH": 8, - "C1_SYMBOL_CATALOG": 6, - "C0_SOURCE_CHUNKS": 4 - }, - "filters_by_layer": { - "C4_SEMANTIC_ROLES": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C1_SYMBOL_CATALOG": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C4_SEMANTIC_ROLES", - "query": "Какие компоненты участвуют в RuntimeManager?", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 12, - "ranking_profile": "code" - }, - { - "layer": "C3_ENTRYPOINTS", - "query": "Какие компоненты участвуют в RuntimeManager?", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "Какие компоненты участвуют в RuntimeManager?", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C1_SYMBOL_CATALOG", - "query": "RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Какие компоненты участвуют в RuntimeManager?", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 4, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C4_SEMANTIC_ROLES", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 12, - "candidates_after_filter": 12 - }, - { - "layer": "C3_ENTRYPOINTS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 3, - "candidates_after_filter": 3 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 1, - "candidates_after_filter": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 4, - "candidates_after_filter": 4 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "RuntimeManager", - "alternatives": [ - "RuntimeManager" - ] - }, - "layers": [ - { - "layer": "C4_SEMANTIC_ROLES", - "status": "hit", - "hit_count": 12, - "fail_reason": null - }, - { - "layer": "C3_ENTRYPOINTS", - "status": "hit", - "hit_count": 3, - "fail_reason": null - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 8, - "fail_reason": null - }, - { - "layer": "C1_SYMBOL_CATALOG", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 1, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "symbol_resolution": 0, - "retrieval_total": 164, - "retrieval_by_layer": { - "C4_SEMANTIC_ROLES": 40, - "C3_ENTRYPOINTS": 19, - "C2_DEPENDENCY_GRAPH": 64, - "C1_SYMBOL_CATALOG": 24, - "C0_SOURCE_CHUNKS": 15 - }, - "merge_rank": 17 - } - } - }, - { - "step": "llm_answer", - "input": { - "query": "Какие компоненты участвуют в RuntimeManager?", - "rag_count": 25 - }, - "output": { - "llm_answer": "## Архитектурное объяснение RuntimeManager\n\n### Основные компоненты и их роли\n\n1. **RuntimeManager**\n - Роль: pipeline_stage\n - Описание: Менеджер выполнения этапов пайплайна. Оркеструет вызовы ролей, управляет состоянием приложения и участвует в потоках данных.\n - Ответственность: инициализация конфигурации, запуск процессов, чтение и запись состояния атрибутов.\n\n2. **ControlActionSet**\n - Роль: model\n - Описание: Модель управления действиями. Выполняет стандартные действия модели.\n - Ответственность: обработка стандартных операций и моделей поведения системы.\n\n### Связи и взаимодействия компонентов\n\n1. **Связь с внешним API через FastAPI**\n - Интерфейс взаимодействия с пользователем через HTTP-запросы.\n - Пример: `app.post` из `src/app_runtime/control/http_app.py`.\n\n2. **Управление данными и состояниями внутри пайплайна**\n - Данные передаются и обрабатываются между компонентами посредством вызовов методов RuntimeManager и ControlActionSet.\n - Пример: методы `start`, `configuration` и т.д., показанные в графе зависимостей (`C2_DEPENDENCY_GRAPH`).\n\n### Границы ответственности\n\n- RuntimeManager отвечает за управление жизненным циклом пайплайнов и координацию работы всех частей системы.\n- ControlActionSet выполняет типовые задачи и реализует поведение стандартной модели.\n\n## Ключевые выводы по архитектуре\n\n1. **Централизованное управление пайплайном**: RuntimeManager координирует выполнение различных задач и следит за целостностью потока данных.\n2. **Модульность системы**: Использование отдельных классов для управления состояниями и моделями позволяет легко расширять функциональность без изменения основного ядра системы.\n3. **Интеграция с внешними интерфейсами**: Контроллер на основе FastAPI обеспечивает удобный доступ к системе через HTTP-интерфейсы.\n4. **Гибкость и масштабируемость**: Разделение логики и обязанностей позволяет легко добавлять новые модули и улучшать существующие решения." - }, - "diagnostics": { - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 480, - "evidence_rows": 25, - "evidence_chars": 8651 - }, - "evidence_summary": [ - { - "layer": "C4_SEMANTIC_ROLES", - "count": 12, - "unique_paths": 11 - }, - { - "layer": "C3_ENTRYPOINTS", - "count": 3, - "unique_paths": 1 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "count": 8, - "unique_paths": 2 - }, - { - "layer": "C1_SYMBOL_CATALOG", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 1, - "unique_paths": 1 - } - ], - "prompt_template_id": "intent_code_qa_architecture_ru_v1", - "system_prompt_version": "v1" - }, - "timings_ms": { - "prompt_build": 0, - "llm_call": 3073 - } - } - } - ] - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents/20260312_115751/full_chain_plba_code_subintents_plba-fullchain-architecture-control-plane.md b/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents/20260312_115751/full_chain_plba_code_subintents_plba-fullchain-architecture-control-plane.md deleted file mode 100644 index d74b984..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents/20260312_115751/full_chain_plba_code_subintents_plba-fullchain-architecture-control-plane.md +++ /dev/null @@ -1,34 +0,0 @@ -# plba-fullchain-architecture-control-plane - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_subintents.yaml -- runner: runtime -- mode: full_chain -- passed: True - -## Query -Какие компоненты участвуют в RuntimeManager? - -## Actual -{ - "intent": "CODE_QA", - "sub_intent": "ARCHITECTURE", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 25, - "llm_answer": "## Архитектурное объяснение RuntimeManager\n\n### Основные компоненты и их роли\n\n1. **RuntimeManager**\n - Роль: pipeline_stage\n - Описание: Менеджер выполнения этапов пайплайна. Оркеструет вызовы ролей, управляет состоянием приложения и участвует в потоках данных.\n - Ответственность: инициализация конфигурации, запуск процессов, чтение и запись состояния атрибутов.\n\n2. **ControlActionSet**\n - Роль: model\n - Описание: Модель управления действиями. Выполняет стандартные действия модели.\n - Ответственность: обработка стандартных операций и моделей поведения системы.\n\n### Связи и взаимодействия компонентов\n\n1. **Связь с внешним API через FastAPI**\n - Интерфейс взаимодействия с пользователем через HTTP-запросы.\n - Пример: `app.post` из `src/app_runtime/control/http_app.py`.\n\n2. **Управление данными и состояниями внутри пайплайна**\n - Данные передаются и обрабатываются между компонентами посредством вызовов методов RuntimeManager и ControlActionSet.\n - Пример: методы `start`, `configuration` и т.д., показанные в графе зависимостей (`C2_DEPENDENCY_GRAPH`).\n\n### Границы ответственности\n\n- RuntimeManager отвечает за управление жизненным циклом пайплайнов и координацию работы всех частей системы.\n- ControlActionSet выполняет типовые задачи и реализует поведение стандартной модели.\n\n## Ключевые выводы по архитектуре\n\n1. **Централизованное управление пайплайном**: RuntimeManager координирует выполнение различных задач и следит за целостностью потока данных.\n2. **Модульность системы**: Использование отдельных классов для управления состояниями и моделями позволяет легко расширять функциональность без изменения основного ядра системы.\n3. **Интеграция с внешними интерфейсами**: Контроллер на основе FastAPI обеспечивает удобный доступ к системе через HTTP-интерфейсы.\n4. **Гибкость и масштабируемость**: Разделение логики и обязанностей позволяет легко добавлять новые модули и улучшать существующие решения.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "RuntimeManager" - ], - "layers": [ - "C4_SEMANTIC_ROLES", - "C3_ENTRYPOINTS", - "C2_DEPENDENCY_GRAPH", - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS" - ] -} - -## Mismatches -- none \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents/20260312_115751/full_chain_plba_code_subintents_plba-fullchain-explain-local-runtime-manager.json b/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents/20260312_115751/full_chain_plba_code_subintents_plba-fullchain-explain-local-runtime-manager.json deleted file mode 100644 index a9ae525..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents/20260312_115751/full_chain_plba_code_subintents_plba-fullchain-explain-local-runtime-manager.json +++ /dev/null @@ -1,1333 +0,0 @@ -{ - "case_id": "plba-fullchain-explain-local-runtime-manager", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_subintents.yaml", - "runner": "runtime", - "mode": "full_chain", - "actual": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN_LOCAL", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 6, - "llm_answer": "Класс `RuntimeManager` из файла `src/app_runtime/core/runtime.py` предназначен для управления жизненным циклом приложения во время его выполнения (runtime).\n\n### Что делает класс?\nЭтот класс служит центральной точкой координации различных компонентов системы. Он инициализирует основные службы и модули приложения, такие как конфигурация (`configuration`), сервисы (`services`), трассировка ошибок (`traces`), мониторинг здоровья (`health`), ведение логов (`logs`) и управление рабочими процессами (`workers`). \n\nТакже `RuntimeManager` обеспечивает контроль над состоянием жизненного цикла приложения через переменные `_state`, которые могут принимать значения `IDLE`, `STARTED`, и другие состояния. Класс предоставляет методы регистрации модулей и служб, а также контроля их активности.\n\n### Какие входные параметры принимает конструктор класса?\nКонструктор принимает несколько необязательных параметров:\n- `configuration`: менеджер конфигурации.\n- `services`: контейнер сервисов.\n- `traces`: сервис отслеживания трассировки.\n- `health`: реестр мониторинга здоровья.\n- `logs`: менеджер ведения логов.\n- `workers`: супервизор рабочих процессов.\n- `control_plane`: служба управления плоскостью управления.\n\nЕсли какой-либо параметр отсутствует при вызове конструктора, соответствующий компонент автоматически создается внутри класса.\n\n### Как связан класс с ближайшим контекстом?\nМетоды и атрибуты класса управляют основными аспектами работы приложения runtime. Например, метод `register_module(module)` позволяет зарегистрировать новый модуль приложения, обеспечивая интеграцию дополнительных возможностей и расширяя функциональность системы.\n\nТаким образом, класс `RuntimeManager` является основным координатором и контроллером всех компонентов приложения во время его исполнения, начиная от начальной настройки до завершения работы.", - "answer_mode": "answered", - "path_scope": [ - "src/app_runtime/core/runtime.py" - ], - "symbol_candidates": [ - "RuntimeManager" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C2_DEPENDENCY_GRAPH" - ] - }, - "passed": true, - "mismatches": [], - "details": { - "case_id": "plba-fullchain-explain-local-runtime-manager", - "text": "Почему в файле src/app_runtime/core/runtime.py класс RuntimeManager устроен так?", - "mode": "full_chain", - "run_started_at": "2026-03-12T11:57:51", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Почему в файле src/app_runtime/core/runtime.py класс RuntimeManager устроен так?", - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "RuntimeManager", - "alternatives": [ - "RuntimeManager" - ], - "confidence": 0.99 - }, - "rag_count": 6, - "rag_rows": [ - { - "path": "src/app_runtime/core/runtime.py", - "content": "class RuntimeManager\nRuntimeManager", - "layer": "C1_SYMBOL_CATALOG", - "title": "RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "7e4a9381328c5803bbc6179458612fc4e947d928aa7bf8b4b2bebb2c8592f758", - "qname": "RuntimeManager", - "kind": "class", - "signature": "RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.core.runtime", - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager.start", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 32, - "span_end": 59, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "98312ace7fc62b1c7194c5aa1732b6ef736eae1668a3a120dd1ecd5ab1d64f7a", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "77a7b260193018845e4e204df094ab89cfd7c82ee4e822b3a83ad4cd945f9cb1", - "dst_ref": "RuntimeManager.start", - "resolution": "resolved", - "slice_id": "98312ace7fc62b1c7194c5aa1732b6ef736eae1668a3a120dd1ecd5ab1d64f7a", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager.start" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "77a7b260193018845e4e204df094ab89cfd7c82ee4e822b3a83ad4cd945f9cb1" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager._register_core_services", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 32, - "span_end": 127, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "3e5811f3b511fa0cabe363f5d01f2ac5fa039bc8b93f7ee108323e1f5f45a293", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "972d6057a6caac9cf31ebc1e29c6f39f71b10d4cc170dec57cf875ba458549c6", - "dst_ref": "RuntimeManager._register_core_services", - "resolution": "resolved", - "slice_id": "3e5811f3b511fa0cabe363f5d01f2ac5fa039bc8b93f7ee108323e1f5f45a293", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager._register_core_services" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "972d6057a6caac9cf31ebc1e29c6f39f71b10d4cc170dec57cf875ba458549c6" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager.add_config_file", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 32, - "span_end": 52, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "a23b8a11ebdb12708b60c96ea12a69f7f042082f1adfddd572444e246d81d167", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "57ffbd4f0d9fdf3507c2b8624312ce211f3d02fdf86a57a8ec90778d8a7b498d", - "dst_ref": "RuntimeManager.add_config_file", - "resolution": "resolved", - "slice_id": "a23b8a11ebdb12708b60c96ea12a69f7f042082f1adfddd572444e246d81d167", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager.add_config_file" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "57ffbd4f0d9fdf3507c2b8624312ce211f3d02fdf86a57a8ec90778d8a7b498d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.services\n -> RuntimeManager.__init__", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 33, - "span_end": 39, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "d43af85989222ee6d788ce418cdcb217c7ff044cfb915e3bdbd184417dc7bd61", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "dst_ref": "RuntimeManager.__init__", - "resolution": "resolved", - "slice_id": "d43af85989222ee6d788ce418cdcb217c7ff044cfb915e3bdbd184417dc7bd61", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.services", - "RuntimeManager.__init__" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "class RuntimeManager:\n ACTION_TIMEOUT_SECONDS = 10.0\n ACTION_POLL_INTERVAL_SECONDS = 0.05\n\n def __init__(\n self,\n configuration: ConfigurationManager | None = None,\n services: ServiceContainer | None = None,\n traces: TraceService | None = None,\n health: HealthRegistry | None = None,\n logs: LogManager | None = None,\n workers: WorkerSupervisor | None = None,\n control_plane: ControlPlaneService | None = None,\n ) -> None:\n self.configuration = configuration or ConfigurationManager()\n self.services = services or ServiceContainer()\n self.traces = traces or TraceService()\n self.health = health or HealthRegistry()\n self.logs = logs or LogManager()\n self.workers = workers or WorkerSupervisor()\n self.control_plane = control_plane or ControlPlaneService()\n self.registry = ModuleRegistry(self.services)\n self._started = False\n self._state = LifecycleState.IDLE\n self._core_registered = False\n self._workers_registered = False\n self._register_core_services()\n\n def register_module(self, module: ApplicationModule) -> None:\n self.registry.register_module(module.name)\n module.register(self.registry)\n\n def add_config_file(self, path: str) -> FileConfigProvider:\n provider = FileConfigProvider(path)\n self.configuration.add_provider(provider)\n return provider\n\n def start(self, *, start_control_plane: bool = True) -> None:\n if self._started:\n return\n self._state = LifecycleState.STARTING\n config = self.configuration.load()\n self.logs.apply_config(config)\n self._register_health_contributors()\n self._register_workers()\n self.workers.start()\n if start_control_plane:\n self.control_plane.start(self)\n self._started = True\n self._refresh_state()\n\n def stop(self, timeout: float = 30.0, force: bool = False, stop_control_plane: bool = True) -> None:\n if not self._started:\n return\n self._state = LifecycleState.STOPPING\n self.workers.stop(timeout=timeout, force=force)\n if stop_control_plane:\n self.control_plane.stop()\n self._started = False\n self._state = LifecycleState.STOPPED\n\n def status(self) -> dict[str, object]:\n self._refresh_state()\n return self.control_plane.snapshot(self)\n\n def current_health(self) -> HealthPayload:\n self._refresh_state()\n return self.health.payload(self._state, self.workers.healths())\n\n async def health_status(self) -> HealthPayload:\n return self.current_health()\n\n async def start_runtime(self) -> dict[str, object] | str:\n self._refresh_state()\n if self._started:\n return \"runtime already running\"\n if self._state == LifecycleState.STOPPING:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n\n self.start(start_control_plane=False)\n started = self._wait_for_state({LifecycleState.IDLE, LifecycleState.BUSY}, timeout=self.ACTION_TIMEOUT_SECONDS)\n if started:\n return self._action_detail(\"runtime started\", timed_out=False)\n return self._action_detail(\"runtime start is still in progress\", timed_out=True)\n\n async def stop_runtime(self) -> dict[str, object] | str:\n self._refresh_state()\n if not self._started:\n if self._state == LifecycleState.STOPPING:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n return \"runtime already stopped\"\n\n self._state = LifecycleState.STOPPING\n try:\n self.workers.stop(timeout=self.ACTION_TIMEOUT_SECONDS, force=False)\n except TimeoutError:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n\n self._started = False\n self._state = LifecycleState.STOPPED\n return self._action_detail(\"runtime stopped\", timed_out=False)\n\n async def runtime_status(self) -> str:\n self._refresh_state()\n return self._state.value\n\n def _register_core_services(self) -> None:\n if self._core_registered:\n return\n self.services.register(\"configuration\", self.configuration)\n self.services.register(\"traces\", self.traces)\n self.services.register(\"health\", self.health)\n self.services.register(\"logs\", self.logs)\n self.services.register(\"workers\", self.workers)\n self.services.register(\"control_plane\", self.control_plane)\n self._core_registered = True\n\n def _register_health_contributors(self) -> None:\n for contributor in self.registry.health_contributors:\n self.health.register(contributor)\n\n def _register_workers(self) -> None:\n if self._workers_registered:\n return\n for worker in self.registry.workers:\n self.workers.register(worker)\n self._workers_registered = True\n\n def _refresh_state(self) -> None:\n lifecycle = self.workers.lifecycle_state()\n\n if self._state == LifecycleState.STOPPING:\n if lifecycle == LifecycleState.STOPPED:\n self._started = False\n self._state = LifecycleState.STOPPED\n return\n\n if not self._started:\n if lifecycle == LifecycleState.STOPPED:\n self._state = LifecycleState.STOPPED\n return\n\n self._state = lifecycle\n\n def _wait_for_state(self, target_states: set[LifecycleState], *, timeout: float) -> bool:\n deadline = monotonic() + timeout\n while monotonic() < deadline:\n self._refresh_state()\n if self._state in target_states:\n return True\n sleep(self.ACTION_POLL_INTERVAL_SECONDS)\n self._refresh_state()\n return self._state in target_states\n\n def _action_detail(self, message: str, *, timed_out: bool) -> dict[str, object]:\n self._refresh_state()\n return {\n \"message\": message,\n \"state\": self._state.value,\n \"timed_out\": timed_out,\n \"workers\": self.workers.snapshot(),\n }", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/core/runtime.py:RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.core.runtime", - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "llm_answer": "Класс `RuntimeManager` из файла `src/app_runtime/core/runtime.py` предназначен для управления жизненным циклом приложения во время его выполнения (runtime).\n\n### Что делает класс?\nЭтот класс служит центральной точкой координации различных компонентов системы. Он инициализирует основные службы и модули приложения, такие как конфигурация (`configuration`), сервисы (`services`), трассировка ошибок (`traces`), мониторинг здоровья (`health`), ведение логов (`logs`) и управление рабочими процессами (`workers`). \n\nТакже `RuntimeManager` обеспечивает контроль над состоянием жизненного цикла приложения через переменные `_state`, которые могут принимать значения `IDLE`, `STARTED`, и другие состояния. Класс предоставляет методы регистрации модулей и служб, а также контроля их активности.\n\n### Какие входные параметры принимает конструктор класса?\nКонструктор принимает несколько необязательных параметров:\n- `configuration`: менеджер конфигурации.\n- `services`: контейнер сервисов.\n- `traces`: сервис отслеживания трассировки.\n- `health`: реестр мониторинга здоровья.\n- `logs`: менеджер ведения логов.\n- `workers`: супервизор рабочих процессов.\n- `control_plane`: служба управления плоскостью управления.\n\nЕсли какой-либо параметр отсутствует при вызове конструктора, соответствующий компонент автоматически создается внутри класса.\n\n### Как связан класс с ближайшим контекстом?\nМетоды и атрибуты класса управляют основными аспектами работы приложения runtime. Например, метод `register_module(module)` позволяет зарегистрировать новый модуль приложения, обеспечивая интеграцию дополнительных возможностей и расширяя функциональность системы.\n\nТаким образом, класс `RuntimeManager` является основным координатором и контроллером всех компонентов приложения во время его исполнения, начиная от начальной настройки до завершения работы.", - "summary": { - "router": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN_LOCAL", - "confidence": null - }, - "retrieval": { - "profile": "code", - "layers_hit": [ - "C0_SOURCE_CHUNKS", - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH" - ], - "evidence_sufficient": true - }, - "llm": { - "answer_status": "answered", - "groundedness": "grounded" - } - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN_LOCAL", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C2_DEPENDENCY_GRAPH" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "RuntimeManager" - ], - "keyword_hints": [ - "src/app_runtime/core/runtime.py", - "RuntimeManager" - ], - "path_hints": [ - "src/app_runtime/core/runtime.py" - ], - "path_scope": [ - "src/app_runtime/core/runtime.py" - ], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C2_DEPENDENCY_GRAPH" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C0_SOURCE_CHUNKS": "exact_path_fetch", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 12, - "C2_DEPENDENCY_GRAPH": 4 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [ - "src/app_runtime/core/runtime.py" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src/app_runtime/core/runtime.py" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src/app_runtime/core/runtime.py" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "RuntimeManager", - "path_scope": [ - "src/app_runtime/core/runtime.py" - ], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Почему в файле src/app_runtime/core/runtime.py класс RuntimeManager устроен так?", - "path_scope": [ - "src/app_runtime/core/runtime.py" - ], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 12, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "Почему в файле src/app_runtime/core/runtime.py класс RuntimeManager устроен так?", - "path_scope": [ - "src/app_runtime/core/runtime.py" - ], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 4, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [ - "src/app_runtime/core/runtime.py" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 1, - "candidates_after_filter": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src/app_runtime/core/runtime.py" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 1, - "candidates_after_filter": 1 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src/app_runtime/core/runtime.py" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 4, - "candidates_after_filter": 4 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "RuntimeManager", - "alternatives": [ - "RuntimeManager" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 4, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "router": 1, - "symbol_resolution": 0, - "retrieval_total": 58, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 20, - "C0_SOURCE_CHUNKS": 15, - "C2_DEPENDENCY_GRAPH": 22 - }, - "merge_rank": 22, - "prompt_build": 0, - "llm_call": 2557 - }, - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 784, - "evidence_rows": 6, - "evidence_chars": 6650 - }, - "evidence_summary": [ - { - "layer": "C1_SYMBOL_CATALOG", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "count": 4, - "unique_paths": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 1, - "unique_paths": 1 - } - ], - "prompt_template_id": "intent_code_qa_explain_local_ru_v1", - "system_prompt_version": "v1" - }, - "router": { - "conversation_mode": "START", - "keyword_hints": [ - "src/app_runtime/core/runtime.py", - "RuntimeManager" - ], - "path_scope": [ - "src/app_runtime/core/runtime.py" - ] - }, - "llm": { - "used_evidence_count": 6, - "missing_evidence_reason": null - } - }, - "run_info": { - "case_id": "plba-fullchain-explain-local-runtime-manager", - "mode": "full_chain", - "run_started_at": "2026-03-12T11:57:51", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - }, - "input_request": { - "text": "Почему в файле src/app_runtime/core/runtime.py класс RuntimeManager устроен так?", - "normalized_query": "Почему в файле src/app_runtime/core/runtime.py класс RuntimeManager устроен так?" - }, - "steps": [ - { - "step": "intent_router", - "input": { - "query": "Почему в файле src/app_runtime/core/runtime.py класс RuntimeManager устроен так?" - }, - "output": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Почему в файле src/app_runtime/core/runtime.py класс RuntimeManager устроен так?" - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN_LOCAL", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C2_DEPENDENCY_GRAPH" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "RuntimeManager" - ], - "keyword_hints": [ - "src/app_runtime/core/runtime.py", - "RuntimeManager" - ], - "path_hints": [ - "src/app_runtime/core/runtime.py" - ], - "path_scope": [ - "src/app_runtime/core/runtime.py" - ], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "timings_ms": { - "router": 1 - } - } - }, - { - "step": "retrieval", - "input": { - "query": "Почему в файле src/app_runtime/core/runtime.py класс RuntimeManager устроен так?" - }, - "output": { - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "RuntimeManager", - "alternatives": [ - "RuntimeManager" - ], - "confidence": 0.99 - }, - "rag_count": 6, - "rag_rows": [ - { - "path": "src/app_runtime/core/runtime.py", - "content": "class RuntimeManager\nRuntimeManager", - "layer": "C1_SYMBOL_CATALOG", - "title": "RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "7e4a9381328c5803bbc6179458612fc4e947d928aa7bf8b4b2bebb2c8592f758", - "qname": "RuntimeManager", - "kind": "class", - "signature": "RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.core.runtime", - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager.start", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 32, - "span_end": 59, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "98312ace7fc62b1c7194c5aa1732b6ef736eae1668a3a120dd1ecd5ab1d64f7a", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "77a7b260193018845e4e204df094ab89cfd7c82ee4e822b3a83ad4cd945f9cb1", - "dst_ref": "RuntimeManager.start", - "resolution": "resolved", - "slice_id": "98312ace7fc62b1c7194c5aa1732b6ef736eae1668a3a120dd1ecd5ab1d64f7a", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager.start" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "77a7b260193018845e4e204df094ab89cfd7c82ee4e822b3a83ad4cd945f9cb1" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager._register_core_services", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 32, - "span_end": 127, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "3e5811f3b511fa0cabe363f5d01f2ac5fa039bc8b93f7ee108323e1f5f45a293", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "972d6057a6caac9cf31ebc1e29c6f39f71b10d4cc170dec57cf875ba458549c6", - "dst_ref": "RuntimeManager._register_core_services", - "resolution": "resolved", - "slice_id": "3e5811f3b511fa0cabe363f5d01f2ac5fa039bc8b93f7ee108323e1f5f45a293", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager._register_core_services" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "972d6057a6caac9cf31ebc1e29c6f39f71b10d4cc170dec57cf875ba458549c6" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager.add_config_file", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 32, - "span_end": 52, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "a23b8a11ebdb12708b60c96ea12a69f7f042082f1adfddd572444e246d81d167", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "57ffbd4f0d9fdf3507c2b8624312ce211f3d02fdf86a57a8ec90778d8a7b498d", - "dst_ref": "RuntimeManager.add_config_file", - "resolution": "resolved", - "slice_id": "a23b8a11ebdb12708b60c96ea12a69f7f042082f1adfddd572444e246d81d167", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager.add_config_file" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "57ffbd4f0d9fdf3507c2b8624312ce211f3d02fdf86a57a8ec90778d8a7b498d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.services\n -> RuntimeManager.__init__", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 33, - "span_end": 39, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "d43af85989222ee6d788ce418cdcb217c7ff044cfb915e3bdbd184417dc7bd61", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "dst_ref": "RuntimeManager.__init__", - "resolution": "resolved", - "slice_id": "d43af85989222ee6d788ce418cdcb217c7ff044cfb915e3bdbd184417dc7bd61", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.services", - "RuntimeManager.__init__" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "class RuntimeManager:\n ACTION_TIMEOUT_SECONDS = 10.0\n ACTION_POLL_INTERVAL_SECONDS = 0.05\n\n def __init__(\n self,\n configuration: ConfigurationManager | None = None,\n services: ServiceContainer | None = None,\n traces: TraceService | None = None,\n health: HealthRegistry | None = None,\n logs: LogManager | None = None,\n workers: WorkerSupervisor | None = None,\n control_plane: ControlPlaneService | None = None,\n ) -> None:\n self.configuration = configuration or ConfigurationManager()\n self.services = services or ServiceContainer()\n self.traces = traces or TraceService()\n self.health = health or HealthRegistry()\n self.logs = logs or LogManager()\n self.workers = workers or WorkerSupervisor()\n self.control_plane = control_plane or ControlPlaneService()\n self.registry = ModuleRegistry(self.services)\n self._started = False\n self._state = LifecycleState.IDLE\n self._core_registered = False\n self._workers_registered = False\n self._register_core_services()\n\n def register_module(self, module: ApplicationModule) -> None:\n self.registry.register_module(module.name)\n module.register(self.registry)\n\n def add_config_file(self, path: str) -> FileConfigProvider:\n provider = FileConfigProvider(path)\n self.configuration.add_provider(provider)\n return provider\n\n def start(self, *, start_control_plane: bool = True) -> None:\n if self._started:\n return\n self._state = LifecycleState.STARTING\n config = self.configuration.load()\n self.logs.apply_config(config)\n self._register_health_contributors()\n self._register_workers()\n self.workers.start()\n if start_control_plane:\n self.control_plane.start(self)\n self._started = True\n self._refresh_state()\n\n def stop(self, timeout: float = 30.0, force: bool = False, stop_control_plane: bool = True) -> None:\n if not self._started:\n return\n self._state = LifecycleState.STOPPING\n self.workers.stop(timeout=timeout, force=force)\n if stop_control_plane:\n self.control_plane.stop()\n self._started = False\n self._state = LifecycleState.STOPPED\n\n def status(self) -> dict[str, object]:\n self._refresh_state()\n return self.control_plane.snapshot(self)\n\n def current_health(self) -> HealthPayload:\n self._refresh_state()\n return self.health.payload(self._state, self.workers.healths())\n\n async def health_status(self) -> HealthPayload:\n return self.current_health()\n\n async def start_runtime(self) -> dict[str, object] | str:\n self._refresh_state()\n if self._started:\n return \"runtime already running\"\n if self._state == LifecycleState.STOPPING:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n\n self.start(start_control_plane=False)\n started = self._wait_for_state({LifecycleState.IDLE, LifecycleState.BUSY}, timeout=self.ACTION_TIMEOUT_SECONDS)\n if started:\n return self._action_detail(\"runtime started\", timed_out=False)\n return self._action_detail(\"runtime start is still in progress\", timed_out=True)\n\n async def stop_runtime(self) -> dict[str, object] | str:\n self._refresh_state()\n if not self._started:\n if self._state == LifecycleState.STOPPING:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n return \"runtime already stopped\"\n\n self._state = LifecycleState.STOPPING\n try:\n self.workers.stop(timeout=self.ACTION_TIMEOUT_SECONDS, force=False)\n except TimeoutError:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n\n self._started = False\n self._state = LifecycleState.STOPPED\n return self._action_detail(\"runtime stopped\", timed_out=False)\n\n async def runtime_status(self) -> str:\n self._refresh_state()\n return self._state.value\n\n def _register_core_services(self) -> None:\n if self._core_registered:\n return\n self.services.register(\"configuration\", self.configuration)\n self.services.register(\"traces\", self.traces)\n self.services.register(\"health\", self.health)\n self.services.register(\"logs\", self.logs)\n self.services.register(\"workers\", self.workers)\n self.services.register(\"control_plane\", self.control_plane)\n self._core_registered = True\n\n def _register_health_contributors(self) -> None:\n for contributor in self.registry.health_contributors:\n self.health.register(contributor)\n\n def _register_workers(self) -> None:\n if self._workers_registered:\n return\n for worker in self.registry.workers:\n self.workers.register(worker)\n self._workers_registered = True\n\n def _refresh_state(self) -> None:\n lifecycle = self.workers.lifecycle_state()\n\n if self._state == LifecycleState.STOPPING:\n if lifecycle == LifecycleState.STOPPED:\n self._started = False\n self._state = LifecycleState.STOPPED\n return\n\n if not self._started:\n if lifecycle == LifecycleState.STOPPED:\n self._state = LifecycleState.STOPPED\n return\n\n self._state = lifecycle\n\n def _wait_for_state(self, target_states: set[LifecycleState], *, timeout: float) -> bool:\n deadline = monotonic() + timeout\n while monotonic() < deadline:\n self._refresh_state()\n if self._state in target_states:\n return True\n sleep(self.ACTION_POLL_INTERVAL_SECONDS)\n self._refresh_state()\n return self._state in target_states\n\n def _action_detail(self, message: str, *, timed_out: bool) -> dict[str, object]:\n self._refresh_state()\n return {\n \"message\": message,\n \"state\": self._state.value,\n \"timed_out\": timed_out,\n \"workers\": self.workers.snapshot(),\n }", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/core/runtime.py:RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.core.runtime", - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ] - }, - "diagnostics": { - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C2_DEPENDENCY_GRAPH" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C0_SOURCE_CHUNKS": "exact_path_fetch", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 12, - "C2_DEPENDENCY_GRAPH": 4 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [ - "src/app_runtime/core/runtime.py" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src/app_runtime/core/runtime.py" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src/app_runtime/core/runtime.py" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "RuntimeManager", - "path_scope": [ - "src/app_runtime/core/runtime.py" - ], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Почему в файле src/app_runtime/core/runtime.py класс RuntimeManager устроен так?", - "path_scope": [ - "src/app_runtime/core/runtime.py" - ], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 12, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "Почему в файле src/app_runtime/core/runtime.py класс RuntimeManager устроен так?", - "path_scope": [ - "src/app_runtime/core/runtime.py" - ], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 4, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [ - "src/app_runtime/core/runtime.py" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 1, - "candidates_after_filter": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src/app_runtime/core/runtime.py" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 1, - "candidates_after_filter": 1 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src/app_runtime/core/runtime.py" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 4, - "candidates_after_filter": 4 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "RuntimeManager", - "alternatives": [ - "RuntimeManager" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 4, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "symbol_resolution": 0, - "retrieval_total": 58, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 20, - "C0_SOURCE_CHUNKS": 15, - "C2_DEPENDENCY_GRAPH": 22 - }, - "merge_rank": 22 - } - } - }, - { - "step": "llm_answer", - "input": { - "query": "Почему в файле src/app_runtime/core/runtime.py класс RuntimeManager устроен так?", - "rag_count": 6 - }, - "output": { - "llm_answer": "Класс `RuntimeManager` из файла `src/app_runtime/core/runtime.py` предназначен для управления жизненным циклом приложения во время его выполнения (runtime).\n\n### Что делает класс?\nЭтот класс служит центральной точкой координации различных компонентов системы. Он инициализирует основные службы и модули приложения, такие как конфигурация (`configuration`), сервисы (`services`), трассировка ошибок (`traces`), мониторинг здоровья (`health`), ведение логов (`logs`) и управление рабочими процессами (`workers`). \n\nТакже `RuntimeManager` обеспечивает контроль над состоянием жизненного цикла приложения через переменные `_state`, которые могут принимать значения `IDLE`, `STARTED`, и другие состояния. Класс предоставляет методы регистрации модулей и служб, а также контроля их активности.\n\n### Какие входные параметры принимает конструктор класса?\nКонструктор принимает несколько необязательных параметров:\n- `configuration`: менеджер конфигурации.\n- `services`: контейнер сервисов.\n- `traces`: сервис отслеживания трассировки.\n- `health`: реестр мониторинга здоровья.\n- `logs`: менеджер ведения логов.\n- `workers`: супервизор рабочих процессов.\n- `control_plane`: служба управления плоскостью управления.\n\nЕсли какой-либо параметр отсутствует при вызове конструктора, соответствующий компонент автоматически создается внутри класса.\n\n### Как связан класс с ближайшим контекстом?\nМетоды и атрибуты класса управляют основными аспектами работы приложения runtime. Например, метод `register_module(module)` позволяет зарегистрировать новый модуль приложения, обеспечивая интеграцию дополнительных возможностей и расширяя функциональность системы.\n\nТаким образом, класс `RuntimeManager` является основным координатором и контроллером всех компонентов приложения во время его исполнения, начиная от начальной настройки до завершения работы." - }, - "diagnostics": { - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 784, - "evidence_rows": 6, - "evidence_chars": 6650 - }, - "evidence_summary": [ - { - "layer": "C1_SYMBOL_CATALOG", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "count": 4, - "unique_paths": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 1, - "unique_paths": 1 - } - ], - "prompt_template_id": "intent_code_qa_explain_local_ru_v1", - "system_prompt_version": "v1" - }, - "timings_ms": { - "prompt_build": 0, - "llm_call": 2557 - } - } - } - ] - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents/20260312_115751/full_chain_plba_code_subintents_plba-fullchain-explain-local-runtime-manager.md b/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents/20260312_115751/full_chain_plba_code_subintents_plba-fullchain-explain-local-runtime-manager.md deleted file mode 100644 index 922d332..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents/20260312_115751/full_chain_plba_code_subintents_plba-fullchain-explain-local-runtime-manager.md +++ /dev/null @@ -1,34 +0,0 @@ -# plba-fullchain-explain-local-runtime-manager - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_subintents.yaml -- runner: runtime -- mode: full_chain -- passed: True - -## Query -Почему в файле src/app_runtime/core/runtime.py класс RuntimeManager устроен так? - -## Actual -{ - "intent": "CODE_QA", - "sub_intent": "EXPLAIN_LOCAL", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 6, - "llm_answer": "Класс `RuntimeManager` из файла `src/app_runtime/core/runtime.py` предназначен для управления жизненным циклом приложения во время его выполнения (runtime).\n\n### Что делает класс?\nЭтот класс служит центральной точкой координации различных компонентов системы. Он инициализирует основные службы и модули приложения, такие как конфигурация (`configuration`), сервисы (`services`), трассировка ошибок (`traces`), мониторинг здоровья (`health`), ведение логов (`logs`) и управление рабочими процессами (`workers`). \n\nТакже `RuntimeManager` обеспечивает контроль над состоянием жизненного цикла приложения через переменные `_state`, которые могут принимать значения `IDLE`, `STARTED`, и другие состояния. Класс предоставляет методы регистрации модулей и служб, а также контроля их активности.\n\n### Какие входные параметры принимает конструктор класса?\nКонструктор принимает несколько необязательных параметров:\n- `configuration`: менеджер конфигурации.\n- `services`: контейнер сервисов.\n- `traces`: сервис отслеживания трассировки.\n- `health`: реестр мониторинга здоровья.\n- `logs`: менеджер ведения логов.\n- `workers`: супервизор рабочих процессов.\n- `control_plane`: служба управления плоскостью управления.\n\nЕсли какой-либо параметр отсутствует при вызове конструктора, соответствующий компонент автоматически создается внутри класса.\n\n### Как связан класс с ближайшим контекстом?\nМетоды и атрибуты класса управляют основными аспектами работы приложения runtime. Например, метод `register_module(module)` позволяет зарегистрировать новый модуль приложения, обеспечивая интеграцию дополнительных возможностей и расширяя функциональность системы.\n\nТаким образом, класс `RuntimeManager` является основным координатором и контроллером всех компонентов приложения во время его исполнения, начиная от начальной настройки до завершения работы.", - "answer_mode": "answered", - "path_scope": [ - "src/app_runtime/core/runtime.py" - ], - "symbol_candidates": [ - "RuntimeManager" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C2_DEPENDENCY_GRAPH" - ] -} - -## Mismatches -- none \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents/20260312_115751/full_chain_plba_code_subintents_plba-fullchain-explain-runtime-manager.json b/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents/20260312_115751/full_chain_plba_code_subintents_plba-fullchain-explain-runtime-manager.json deleted file mode 100644 index 01c70b4..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents/20260312_115751/full_chain_plba_code_subintents_plba-fullchain-explain-runtime-manager.json +++ /dev/null @@ -1,2088 +0,0 @@ -{ - "case_id": "plba-fullchain-explain-runtime-manager", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_subintents.yaml", - "runner": "runtime", - "mode": "full_chain", - "actual": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 12, - "llm_answer": "## Назначение класса `RuntimeManager`\nКласс `RuntimeManager` играет роль менеджера выполнения системы и отвечает за координацию различных компонентов приложения во время его работы. Он управляет жизненным циклом, состоянием и регистрацией сервисов и модулей, обеспечивая их корректное взаимодействие.\n\n## Ключевые зависимости\nКлючевые компоненты и зависимости для правильной работы класса включают:\n- `ConfigurationManager`: настройка конфигурации приложения;\n- `ServiceContainer`: контейнер хранения всех доступных сервисов;\n- `TraceService`: сервис отслеживания трассировок событий;\n- `HealthRegistry`: регистрация текущего состояния здоровья системы;\n- `LogManager`: управление логированием событий;\n- `WorkerSupervisor`: супервизор рабочих процессов;\n- `ControlPlaneService`: основной сервис управления приложением.\n\nВсе эти зависимости передаются конструктору класса при инициализации.\n\n## Поток данных или вызовов\nПри создании экземпляра `RuntimeManager`, все указанные зависимости регистрируются в соответствующем менеджере (`self.registry`), что позволяет классу отслеживать доступные сервисы и модули.\n\nДалее начинается процесс регистрации основных служб с помощью метода `_register_core_services()`. Это включает регистрацию модулей через метод `register_module(module: ApplicationModule)` внутри метода `self.registry.register(module)`.\n\nПосле этого происходит запуск приложения путем вызова метода `start()` и установка начального состояния `LifecycleState.IDLE`.\n\n## Важные детали реализации\n### Настройки по умолчанию\nВ конструкторе присутствуют настройки по умолчанию для часто используемых параметров:\n- `ACTION_TIMEOUT_SECONDS = 10.0`: максимальное время ожидания действия;\n- `ACTION_POLL_INTERVAL_SECONDS = 0.05`: интервал опроса действий.\n\nЭти параметры могут быть переопределены пользователем при вызове конструктора.\n\n### Жизненный цикл\nЖизненный цикл `RuntimeManager` управляется состоянием переменной `_state`, которое может принимать значения:\n- `IDLE`: приложение находится в состоянии готовности к работе;\n- другие возможные состояния зависят от контекста использования и описаны подробно в соответствующей документации.\n\n### Остерегательные выводы\nНа данный момент в предоставленном контексте отсутствуют конкретные сведения о точном потоке данных или поведении после регистрации модулей и услуг. Предполагается, что дальнейшие шаги будут определены реализацией методов, таких как `start()` и `stop()`, однако детальная информация об этих шагах отсутствует.\n\nДля полного понимания поведения класса необходимо дополнительно изучить реализацию указанных методов и связанных с ними сервисов.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "RuntimeManager" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "passed": true, - "mismatches": [], - "details": { - "case_id": "plba-fullchain-explain-runtime-manager", - "text": "Объясни как работает класс RuntimeManager", - "mode": "full_chain", - "run_started_at": "2026-03-12T11:57:51", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Объясни как работает класс RuntimeManager", - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "RuntimeManager", - "alternatives": [ - "RuntimeManager" - ], - "confidence": 0.99 - }, - "rag_count": 12, - "rag_rows": [ - { - "path": "src/app_runtime/core/runtime.py", - "content": "class RuntimeManager\nRuntimeManager", - "layer": "C1_SYMBOL_CATALOG", - "title": "RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "7e4a9381328c5803bbc6179458612fc4e947d928aa7bf8b4b2bebb2c8592f758", - "qname": "RuntimeManager", - "kind": "class", - "signature": "RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.core.runtime", - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests manager\n- orchestrates role-like calls (4)\n- reads and writes state attributes\n- participates in dataflow slices (50)", - "layer": "C4_SEMANTIC_ROLES", - "title": "RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 43, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "7e4a9381328c5803bbc6179458612fc4e947d928aa7bf8b4b2bebb2c8592f758", - "symbol_name": "RuntimeManager", - "qname": "RuntimeManager", - "role": "pipeline_stage", - "confidence": 0.67, - "dataflow_participation": 50, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.stop", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 25, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d", - "dst_ref": "ControlPlaneService.stop", - "resolution": "resolved", - "slice_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.stop" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._stop_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 51, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a", - "dst_ref": "ControlPlaneService._stop_async", - "resolution": "resolved", - "slice_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._stop_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.register_channel", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 17, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957", - "dst_ref": "ControlPlaneService.register_channel", - "resolution": "resolved", - "slice_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.register_channel" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.start", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 20, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154", - "dst_ref": "ControlPlaneService.start", - "resolution": "resolved", - "slice_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.start" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._start_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 47, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517", - "dst_ref": "ControlPlaneService._start_async", - "resolution": "resolved", - "slice_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._start_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager.add_config_file", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 32, - "span_end": 52, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "a23b8a11ebdb12708b60c96ea12a69f7f042082f1adfddd572444e246d81d167", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "57ffbd4f0d9fdf3507c2b8624312ce211f3d02fdf86a57a8ec90778d8a7b498d", - "dst_ref": "RuntimeManager.add_config_file", - "resolution": "resolved", - "slice_id": "a23b8a11ebdb12708b60c96ea12a69f7f042082f1adfddd572444e246d81d167", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager.add_config_file" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "57ffbd4f0d9fdf3507c2b8624312ce211f3d02fdf86a57a8ec90778d8a7b498d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "class RuntimeManager:\n ACTION_TIMEOUT_SECONDS = 10.0\n ACTION_POLL_INTERVAL_SECONDS = 0.05\n\n def __init__(\n self,\n configuration: ConfigurationManager | None = None,\n services: ServiceContainer | None = None,\n traces: TraceService | None = None,\n health: HealthRegistry | None = None,\n logs: LogManager | None = None,\n workers: WorkerSupervisor | None = None,\n control_plane: ControlPlaneService | None = None,\n ) -> None:\n self.configuration = configuration or ConfigurationManager()\n self.services = services or ServiceContainer()\n self.traces = traces or TraceService()\n self.health = health or HealthRegistry()\n self.logs = logs or LogManager()\n self.workers = workers or WorkerSupervisor()\n self.control_plane = control_plane or ControlPlaneService()\n self.registry = ModuleRegistry(self.services)\n self._started = False\n self._state = LifecycleState.IDLE\n self._core_registered = False\n self._workers_registered = False\n self._register_core_services()\n\n def register_module(self, module: ApplicationModule) -> None:\n self.registry.register_module(module.name)\n module.register(self.registry)\n\n def add_config_file(self, path: str) -> FileConfigProvider:\n provider = FileConfigProvider(path)\n self.configuration.add_provider(provider)\n return provider\n\n def start(self, *, start_control_plane: bool = True) -> None:\n if self._started:\n return\n self._state = LifecycleState.STARTING\n config = self.configuration.load()\n self.logs.apply_config(config)\n self._register_health_contributors()\n self._register_workers()\n self.workers.start()\n if start_control_plane:\n self.control_plane.start(self)\n self._started = True\n self._refresh_state()\n\n def stop(self, timeout: float = 30.0, force: bool = False, stop_control_plane: bool = True) -> None:\n if not self._started:\n return\n self._state = LifecycleState.STOPPING\n self.workers.stop(timeout=timeout, force=force)\n if stop_control_plane:\n self.control_plane.stop()\n self._started = False\n self._state = LifecycleState.STOPPED\n\n def status(self) -> dict[str, object]:\n self._refresh_state()\n return self.control_plane.snapshot(self)\n\n def current_health(self) -> HealthPayload:\n self._refresh_state()\n return self.health.payload(self._state, self.workers.healths())\n\n async def health_status(self) -> HealthPayload:\n return self.current_health()\n\n async def start_runtime(self) -> dict[str, object] | str:\n self._refresh_state()\n if self._started:\n return \"runtime already running\"\n if self._state == LifecycleState.STOPPING:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n\n self.start(start_control_plane=False)\n started = self._wait_for_state({LifecycleState.IDLE, LifecycleState.BUSY}, timeout=self.ACTION_TIMEOUT_SECONDS)\n if started:\n return self._action_detail(\"runtime started\", timed_out=False)\n return self._action_detail(\"runtime start is still in progress\", timed_out=True)\n\n async def stop_runtime(self) -> dict[str, object] | str:\n self._refresh_state()\n if not self._started:\n if self._state == LifecycleState.STOPPING:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n return \"runtime already stopped\"\n\n self._state = LifecycleState.STOPPING\n try:\n self.workers.stop(timeout=self.ACTION_TIMEOUT_SECONDS, force=False)\n except TimeoutError:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n\n self._started = False\n self._state = LifecycleState.STOPPED\n return self._action_detail(\"runtime stopped\", timed_out=False)\n\n async def runtime_status(self) -> str:\n self._refresh_state()\n return self._state.value\n\n def _register_core_services(self) -> None:\n if self._core_registered:\n return\n self.services.register(\"configuration\", self.configuration)\n self.services.register(\"traces\", self.traces)\n self.services.register(\"health\", self.health)\n self.services.register(\"logs\", self.logs)\n self.services.register(\"workers\", self.workers)\n self.services.register(\"control_plane\", self.control_plane)\n self._core_registered = True\n\n def _register_health_contributors(self) -> None:\n for contributor in self.registry.health_contributors:\n self.health.register(contributor)\n\n def _register_workers(self) -> None:\n if self._workers_registered:\n return\n for worker in self.registry.workers:\n self.workers.register(worker)\n self._workers_registered = True\n\n def _refresh_state(self) -> None:\n lifecycle = self.workers.lifecycle_state()\n\n if self._state == LifecycleState.STOPPING:\n if lifecycle == LifecycleState.STOPPED:\n self._started = False\n self._state = LifecycleState.STOPPED\n return\n\n if not self._started:\n if lifecycle == LifecycleState.STOPPED:\n self._state = LifecycleState.STOPPED\n return\n\n self._state = lifecycle\n\n def _wait_for_state(self, target_states: set[LifecycleState], *, timeout: float) -> bool:\n deadline = monotonic() + timeout\n while monotonic() < deadline:\n self._refresh_state()\n if self._state in target_states:\n return True\n sleep(self.ACTION_POLL_INTERVAL_SECONDS)\n self._refresh_state()\n return self._state in target_states\n\n def _action_detail(self, message: str, *, timed_out: bool) -> dict[str, object]:\n self._refresh_state()\n return {\n \"message\": message,\n \"state\": self._state.value,\n \"timed_out\": timed_out,\n \"workers\": self.workers.snapshot(),\n }", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/core/runtime.py:RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.core.runtime", - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "llm_answer": "## Назначение класса `RuntimeManager`\nКласс `RuntimeManager` играет роль менеджера выполнения системы и отвечает за координацию различных компонентов приложения во время его работы. Он управляет жизненным циклом, состоянием и регистрацией сервисов и модулей, обеспечивая их корректное взаимодействие.\n\n## Ключевые зависимости\nКлючевые компоненты и зависимости для правильной работы класса включают:\n- `ConfigurationManager`: настройка конфигурации приложения;\n- `ServiceContainer`: контейнер хранения всех доступных сервисов;\n- `TraceService`: сервис отслеживания трассировок событий;\n- `HealthRegistry`: регистрация текущего состояния здоровья системы;\n- `LogManager`: управление логированием событий;\n- `WorkerSupervisor`: супервизор рабочих процессов;\n- `ControlPlaneService`: основной сервис управления приложением.\n\nВсе эти зависимости передаются конструктору класса при инициализации.\n\n## Поток данных или вызовов\nПри создании экземпляра `RuntimeManager`, все указанные зависимости регистрируются в соответствующем менеджере (`self.registry`), что позволяет классу отслеживать доступные сервисы и модули.\n\nДалее начинается процесс регистрации основных служб с помощью метода `_register_core_services()`. Это включает регистрацию модулей через метод `register_module(module: ApplicationModule)` внутри метода `self.registry.register(module)`.\n\nПосле этого происходит запуск приложения путем вызова метода `start()` и установка начального состояния `LifecycleState.IDLE`.\n\n## Важные детали реализации\n### Настройки по умолчанию\nВ конструкторе присутствуют настройки по умолчанию для часто используемых параметров:\n- `ACTION_TIMEOUT_SECONDS = 10.0`: максимальное время ожидания действия;\n- `ACTION_POLL_INTERVAL_SECONDS = 0.05`: интервал опроса действий.\n\nЭти параметры могут быть переопределены пользователем при вызове конструктора.\n\n### Жизненный цикл\nЖизненный цикл `RuntimeManager` управляется состоянием переменной `_state`, которое может принимать значения:\n- `IDLE`: приложение находится в состоянии готовности к работе;\n- другие возможные состояния зависят от контекста использования и описаны подробно в соответствующей документации.\n\n### Остерегательные выводы\nНа данный момент в предоставленном контексте отсутствуют конкретные сведения о точном потоке данных или поведении после регистрации модулей и услуг. Предполагается, что дальнейшие шаги будут определены реализацией методов, таких как `start()` и `stop()`, однако детальная информация об этих шагах отсутствует.\n\nДля полного понимания поведения класса необходимо дополнительно изучить реализацию указанных методов и связанных с ними сервисов.", - "summary": { - "router": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "confidence": null - }, - "retrieval": { - "profile": "code", - "layers_hit": [ - "C0_SOURCE_CHUNKS", - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS", - "C4_SEMANTIC_ROLES" - ], - "evidence_sufficient": true - }, - "llm": { - "answer_status": "answered", - "groundedness": "grounded" - } - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "RuntimeManager" - ], - "keyword_hints": [ - "RuntimeManager" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C0_SOURCE_CHUNKS": "exact_path_fetch", - "C4_SEMANTIC_ROLES": "exact_path_fetch", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C3_ENTRYPOINTS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 8, - "C4_SEMANTIC_ROLES": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C3_ENTRYPOINTS": 6 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C4_SEMANTIC_ROLES": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C4_SEMANTIC_ROLES", - "query": "RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - }, - { - "layer": "C3_ENTRYPOINTS", - "query": "RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 1, - "candidates_after_filter": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 6, - "candidates_after_filter": 6 - }, - { - "layer": "C3_ENTRYPOINTS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 3, - "candidates_after_filter": 3 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "RuntimeManager", - "alternatives": [ - "RuntimeManager" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C4_SEMANTIC_ROLES", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 6, - "fail_reason": null - }, - { - "layer": "C3_ENTRYPOINTS", - "status": "hit", - "hit_count": 3, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "router": 0, - "symbol_resolution": 0, - "retrieval_total": 140, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 31, - "C0_SOURCE_CHUNKS": 13, - "C4_SEMANTIC_ROLES": 13, - "C2_DEPENDENCY_GRAPH": 54, - "C3_ENTRYPOINTS": 10 - }, - "merge_rank": 18, - "prompt_build": 0, - "llm_call": 3467 - }, - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 797, - "evidence_rows": 12, - "evidence_chars": 7130 - }, - "evidence_summary": [ - { - "layer": "C1_SYMBOL_CATALOG", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "count": 6, - "unique_paths": 2 - }, - { - "layer": "C3_ENTRYPOINTS", - "count": 3, - "unique_paths": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 1, - "unique_paths": 1 - } - ], - "prompt_template_id": "intent_code_qa_explain_ru_v1", - "system_prompt_version": "v1" - }, - "router": { - "conversation_mode": "START", - "keyword_hints": [ - "RuntimeManager" - ], - "path_scope": [] - }, - "llm": { - "used_evidence_count": 12, - "missing_evidence_reason": null - } - }, - "run_info": { - "case_id": "plba-fullchain-explain-runtime-manager", - "mode": "full_chain", - "run_started_at": "2026-03-12T11:57:51", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - }, - "input_request": { - "text": "Объясни как работает класс RuntimeManager", - "normalized_query": "Объясни как работает класс RuntimeManager" - }, - "steps": [ - { - "step": "intent_router", - "input": { - "query": "Объясни как работает класс RuntimeManager" - }, - "output": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Объясни как работает класс RuntimeManager" - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "RuntimeManager" - ], - "keyword_hints": [ - "RuntimeManager" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "timings_ms": { - "router": 0 - } - } - }, - { - "step": "retrieval", - "input": { - "query": "Объясни как работает класс RuntimeManager" - }, - "output": { - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "RuntimeManager", - "alternatives": [ - "RuntimeManager" - ], - "confidence": 0.99 - }, - "rag_count": 12, - "rag_rows": [ - { - "path": "src/app_runtime/core/runtime.py", - "content": "class RuntimeManager\nRuntimeManager", - "layer": "C1_SYMBOL_CATALOG", - "title": "RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "7e4a9381328c5803bbc6179458612fc4e947d928aa7bf8b4b2bebb2c8592f758", - "qname": "RuntimeManager", - "kind": "class", - "signature": "RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.core.runtime", - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests manager\n- orchestrates role-like calls (4)\n- reads and writes state attributes\n- participates in dataflow slices (50)", - "layer": "C4_SEMANTIC_ROLES", - "title": "RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 43, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "7e4a9381328c5803bbc6179458612fc4e947d928aa7bf8b4b2bebb2c8592f758", - "symbol_name": "RuntimeManager", - "qname": "RuntimeManager", - "role": "pipeline_stage", - "confidence": 0.67, - "dataflow_participation": 50, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.stop", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 25, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d", - "dst_ref": "ControlPlaneService.stop", - "resolution": "resolved", - "slice_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.stop" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._stop_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 51, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a", - "dst_ref": "ControlPlaneService._stop_async", - "resolution": "resolved", - "slice_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._stop_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.register_channel", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 17, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957", - "dst_ref": "ControlPlaneService.register_channel", - "resolution": "resolved", - "slice_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.register_channel" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.start", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 20, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154", - "dst_ref": "ControlPlaneService.start", - "resolution": "resolved", - "slice_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.start" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._start_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 47, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517", - "dst_ref": "ControlPlaneService._start_async", - "resolution": "resolved", - "slice_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._start_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager.add_config_file", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 32, - "span_end": 52, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "a23b8a11ebdb12708b60c96ea12a69f7f042082f1adfddd572444e246d81d167", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "57ffbd4f0d9fdf3507c2b8624312ce211f3d02fdf86a57a8ec90778d8a7b498d", - "dst_ref": "RuntimeManager.add_config_file", - "resolution": "resolved", - "slice_id": "a23b8a11ebdb12708b60c96ea12a69f7f042082f1adfddd572444e246d81d167", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager.add_config_file" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "57ffbd4f0d9fdf3507c2b8624312ce211f3d02fdf86a57a8ec90778d8a7b498d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "class RuntimeManager:\n ACTION_TIMEOUT_SECONDS = 10.0\n ACTION_POLL_INTERVAL_SECONDS = 0.05\n\n def __init__(\n self,\n configuration: ConfigurationManager | None = None,\n services: ServiceContainer | None = None,\n traces: TraceService | None = None,\n health: HealthRegistry | None = None,\n logs: LogManager | None = None,\n workers: WorkerSupervisor | None = None,\n control_plane: ControlPlaneService | None = None,\n ) -> None:\n self.configuration = configuration or ConfigurationManager()\n self.services = services or ServiceContainer()\n self.traces = traces or TraceService()\n self.health = health or HealthRegistry()\n self.logs = logs or LogManager()\n self.workers = workers or WorkerSupervisor()\n self.control_plane = control_plane or ControlPlaneService()\n self.registry = ModuleRegistry(self.services)\n self._started = False\n self._state = LifecycleState.IDLE\n self._core_registered = False\n self._workers_registered = False\n self._register_core_services()\n\n def register_module(self, module: ApplicationModule) -> None:\n self.registry.register_module(module.name)\n module.register(self.registry)\n\n def add_config_file(self, path: str) -> FileConfigProvider:\n provider = FileConfigProvider(path)\n self.configuration.add_provider(provider)\n return provider\n\n def start(self, *, start_control_plane: bool = True) -> None:\n if self._started:\n return\n self._state = LifecycleState.STARTING\n config = self.configuration.load()\n self.logs.apply_config(config)\n self._register_health_contributors()\n self._register_workers()\n self.workers.start()\n if start_control_plane:\n self.control_plane.start(self)\n self._started = True\n self._refresh_state()\n\n def stop(self, timeout: float = 30.0, force: bool = False, stop_control_plane: bool = True) -> None:\n if not self._started:\n return\n self._state = LifecycleState.STOPPING\n self.workers.stop(timeout=timeout, force=force)\n if stop_control_plane:\n self.control_plane.stop()\n self._started = False\n self._state = LifecycleState.STOPPED\n\n def status(self) -> dict[str, object]:\n self._refresh_state()\n return self.control_plane.snapshot(self)\n\n def current_health(self) -> HealthPayload:\n self._refresh_state()\n return self.health.payload(self._state, self.workers.healths())\n\n async def health_status(self) -> HealthPayload:\n return self.current_health()\n\n async def start_runtime(self) -> dict[str, object] | str:\n self._refresh_state()\n if self._started:\n return \"runtime already running\"\n if self._state == LifecycleState.STOPPING:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n\n self.start(start_control_plane=False)\n started = self._wait_for_state({LifecycleState.IDLE, LifecycleState.BUSY}, timeout=self.ACTION_TIMEOUT_SECONDS)\n if started:\n return self._action_detail(\"runtime started\", timed_out=False)\n return self._action_detail(\"runtime start is still in progress\", timed_out=True)\n\n async def stop_runtime(self) -> dict[str, object] | str:\n self._refresh_state()\n if not self._started:\n if self._state == LifecycleState.STOPPING:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n return \"runtime already stopped\"\n\n self._state = LifecycleState.STOPPING\n try:\n self.workers.stop(timeout=self.ACTION_TIMEOUT_SECONDS, force=False)\n except TimeoutError:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n\n self._started = False\n self._state = LifecycleState.STOPPED\n return self._action_detail(\"runtime stopped\", timed_out=False)\n\n async def runtime_status(self) -> str:\n self._refresh_state()\n return self._state.value\n\n def _register_core_services(self) -> None:\n if self._core_registered:\n return\n self.services.register(\"configuration\", self.configuration)\n self.services.register(\"traces\", self.traces)\n self.services.register(\"health\", self.health)\n self.services.register(\"logs\", self.logs)\n self.services.register(\"workers\", self.workers)\n self.services.register(\"control_plane\", self.control_plane)\n self._core_registered = True\n\n def _register_health_contributors(self) -> None:\n for contributor in self.registry.health_contributors:\n self.health.register(contributor)\n\n def _register_workers(self) -> None:\n if self._workers_registered:\n return\n for worker in self.registry.workers:\n self.workers.register(worker)\n self._workers_registered = True\n\n def _refresh_state(self) -> None:\n lifecycle = self.workers.lifecycle_state()\n\n if self._state == LifecycleState.STOPPING:\n if lifecycle == LifecycleState.STOPPED:\n self._started = False\n self._state = LifecycleState.STOPPED\n return\n\n if not self._started:\n if lifecycle == LifecycleState.STOPPED:\n self._state = LifecycleState.STOPPED\n return\n\n self._state = lifecycle\n\n def _wait_for_state(self, target_states: set[LifecycleState], *, timeout: float) -> bool:\n deadline = monotonic() + timeout\n while monotonic() < deadline:\n self._refresh_state()\n if self._state in target_states:\n return True\n sleep(self.ACTION_POLL_INTERVAL_SECONDS)\n self._refresh_state()\n return self._state in target_states\n\n def _action_detail(self, message: str, *, timed_out: bool) -> dict[str, object]:\n self._refresh_state()\n return {\n \"message\": message,\n \"state\": self._state.value,\n \"timed_out\": timed_out,\n \"workers\": self.workers.snapshot(),\n }", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/core/runtime.py:RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.core.runtime", - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ] - }, - "diagnostics": { - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C0_SOURCE_CHUNKS": "exact_path_fetch", - "C4_SEMANTIC_ROLES": "exact_path_fetch", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C3_ENTRYPOINTS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 8, - "C4_SEMANTIC_ROLES": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C3_ENTRYPOINTS": 6 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C4_SEMANTIC_ROLES": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C4_SEMANTIC_ROLES", - "query": "RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - }, - { - "layer": "C3_ENTRYPOINTS", - "query": "RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 1, - "candidates_after_filter": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 6, - "candidates_after_filter": 6 - }, - { - "layer": "C3_ENTRYPOINTS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 3, - "candidates_after_filter": 3 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "RuntimeManager", - "alternatives": [ - "RuntimeManager" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C4_SEMANTIC_ROLES", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 6, - "fail_reason": null - }, - { - "layer": "C3_ENTRYPOINTS", - "status": "hit", - "hit_count": 3, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "symbol_resolution": 0, - "retrieval_total": 140, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 31, - "C0_SOURCE_CHUNKS": 13, - "C4_SEMANTIC_ROLES": 13, - "C2_DEPENDENCY_GRAPH": 54, - "C3_ENTRYPOINTS": 10 - }, - "merge_rank": 18 - } - } - }, - { - "step": "llm_answer", - "input": { - "query": "Объясни как работает класс RuntimeManager", - "rag_count": 12 - }, - "output": { - "llm_answer": "## Назначение класса `RuntimeManager`\nКласс `RuntimeManager` играет роль менеджера выполнения системы и отвечает за координацию различных компонентов приложения во время его работы. Он управляет жизненным циклом, состоянием и регистрацией сервисов и модулей, обеспечивая их корректное взаимодействие.\n\n## Ключевые зависимости\nКлючевые компоненты и зависимости для правильной работы класса включают:\n- `ConfigurationManager`: настройка конфигурации приложения;\n- `ServiceContainer`: контейнер хранения всех доступных сервисов;\n- `TraceService`: сервис отслеживания трассировок событий;\n- `HealthRegistry`: регистрация текущего состояния здоровья системы;\n- `LogManager`: управление логированием событий;\n- `WorkerSupervisor`: супервизор рабочих процессов;\n- `ControlPlaneService`: основной сервис управления приложением.\n\nВсе эти зависимости передаются конструктору класса при инициализации.\n\n## Поток данных или вызовов\nПри создании экземпляра `RuntimeManager`, все указанные зависимости регистрируются в соответствующем менеджере (`self.registry`), что позволяет классу отслеживать доступные сервисы и модули.\n\nДалее начинается процесс регистрации основных служб с помощью метода `_register_core_services()`. Это включает регистрацию модулей через метод `register_module(module: ApplicationModule)` внутри метода `self.registry.register(module)`.\n\nПосле этого происходит запуск приложения путем вызова метода `start()` и установка начального состояния `LifecycleState.IDLE`.\n\n## Важные детали реализации\n### Настройки по умолчанию\nВ конструкторе присутствуют настройки по умолчанию для часто используемых параметров:\n- `ACTION_TIMEOUT_SECONDS = 10.0`: максимальное время ожидания действия;\n- `ACTION_POLL_INTERVAL_SECONDS = 0.05`: интервал опроса действий.\n\nЭти параметры могут быть переопределены пользователем при вызове конструктора.\n\n### Жизненный цикл\nЖизненный цикл `RuntimeManager` управляется состоянием переменной `_state`, которое может принимать значения:\n- `IDLE`: приложение находится в состоянии готовности к работе;\n- другие возможные состояния зависят от контекста использования и описаны подробно в соответствующей документации.\n\n### Остерегательные выводы\nНа данный момент в предоставленном контексте отсутствуют конкретные сведения о точном потоке данных или поведении после регистрации модулей и услуг. Предполагается, что дальнейшие шаги будут определены реализацией методов, таких как `start()` и `stop()`, однако детальная информация об этих шагах отсутствует.\n\nДля полного понимания поведения класса необходимо дополнительно изучить реализацию указанных методов и связанных с ними сервисов." - }, - "diagnostics": { - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 797, - "evidence_rows": 12, - "evidence_chars": 7130 - }, - "evidence_summary": [ - { - "layer": "C1_SYMBOL_CATALOG", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "count": 6, - "unique_paths": 2 - }, - { - "layer": "C3_ENTRYPOINTS", - "count": 3, - "unique_paths": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 1, - "unique_paths": 1 - } - ], - "prompt_template_id": "intent_code_qa_explain_ru_v1", - "system_prompt_version": "v1" - }, - "timings_ms": { - "prompt_build": 0, - "llm_call": 3467 - } - } - } - ] - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents/20260312_115751/full_chain_plba_code_subintents_plba-fullchain-explain-runtime-manager.md b/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents/20260312_115751/full_chain_plba_code_subintents_plba-fullchain-explain-runtime-manager.md deleted file mode 100644 index 520c039..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents/20260312_115751/full_chain_plba_code_subintents_plba-fullchain-explain-runtime-manager.md +++ /dev/null @@ -1,34 +0,0 @@ -# plba-fullchain-explain-runtime-manager - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_subintents.yaml -- runner: runtime -- mode: full_chain -- passed: True - -## Query -Объясни как работает класс RuntimeManager - -## Actual -{ - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 12, - "llm_answer": "## Назначение класса `RuntimeManager`\nКласс `RuntimeManager` играет роль менеджера выполнения системы и отвечает за координацию различных компонентов приложения во время его работы. Он управляет жизненным циклом, состоянием и регистрацией сервисов и модулей, обеспечивая их корректное взаимодействие.\n\n## Ключевые зависимости\nКлючевые компоненты и зависимости для правильной работы класса включают:\n- `ConfigurationManager`: настройка конфигурации приложения;\n- `ServiceContainer`: контейнер хранения всех доступных сервисов;\n- `TraceService`: сервис отслеживания трассировок событий;\n- `HealthRegistry`: регистрация текущего состояния здоровья системы;\n- `LogManager`: управление логированием событий;\n- `WorkerSupervisor`: супервизор рабочих процессов;\n- `ControlPlaneService`: основной сервис управления приложением.\n\nВсе эти зависимости передаются конструктору класса при инициализации.\n\n## Поток данных или вызовов\nПри создании экземпляра `RuntimeManager`, все указанные зависимости регистрируются в соответствующем менеджере (`self.registry`), что позволяет классу отслеживать доступные сервисы и модули.\n\nДалее начинается процесс регистрации основных служб с помощью метода `_register_core_services()`. Это включает регистрацию модулей через метод `register_module(module: ApplicationModule)` внутри метода `self.registry.register(module)`.\n\nПосле этого происходит запуск приложения путем вызова метода `start()` и установка начального состояния `LifecycleState.IDLE`.\n\n## Важные детали реализации\n### Настройки по умолчанию\nВ конструкторе присутствуют настройки по умолчанию для часто используемых параметров:\n- `ACTION_TIMEOUT_SECONDS = 10.0`: максимальное время ожидания действия;\n- `ACTION_POLL_INTERVAL_SECONDS = 0.05`: интервал опроса действий.\n\nЭти параметры могут быть переопределены пользователем при вызове конструктора.\n\n### Жизненный цикл\nЖизненный цикл `RuntimeManager` управляется состоянием переменной `_state`, которое может принимать значения:\n- `IDLE`: приложение находится в состоянии готовности к работе;\n- другие возможные состояния зависят от контекста использования и описаны подробно в соответствующей документации.\n\n### Остерегательные выводы\nНа данный момент в предоставленном контексте отсутствуют конкретные сведения о точном потоке данных или поведении после регистрации модулей и услуг. Предполагается, что дальнейшие шаги будут определены реализацией методов, таких как `start()` и `stop()`, однако детальная информация об этих шагах отсутствует.\n\nДля полного понимания поведения класса необходимо дополнительно изучить реализацию указанных методов и связанных с ними сервисов.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "RuntimeManager" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] -} - -## Mismatches -- none \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents/20260312_115751/full_chain_plba_code_subintents_plba-fullchain-find-entrypoints.json b/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents/20260312_115751/full_chain_plba_code_subintents_plba-fullchain-find-entrypoints.json deleted file mode 100644 index ec9cb09..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents/20260312_115751/full_chain_plba_code_subintents_plba-fullchain-find-entrypoints.json +++ /dev/null @@ -1,1196 +0,0 @@ -{ - "case_id": "plba-fullchain-find-entrypoints", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_subintents.yaml", - "runner": "runtime", - "mode": "full_chain", - "actual": { - "intent": "CODE_QA", - "sub_intent": "FIND_ENTRYPOINTS", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 9, - "llm_answer": "## Финальный ответ:\n\nНа основании предоставленного контекста и анализа слоев RAG можно выделить следующие **точки входа** и ключевые обработчики запуска в приложении:\n\n### 1. `app.post` \n**Файл:** `src/app_runtime/control/http_app.py`\n**Сущность:** Метод класса FastAPI (`app`) \n**Роль:** Обрабатывает HTTP POST-запросы. Это основной маршрут для приёма данных от пользователей и их дальнейшей обработки внутри приложения.\n\n### 2. `app.get` \n**Файл:** `src/app_runtime/control/http_app.py`\n**Сущность:** Метод класса FastAPI (`app`) \n**Роль:** Обрабатывает HTTP GET-запросы. Используется для получения информации из системы (например, статус задач, результаты вычислений).\n\n### Наиболее вероятные точки входа (по контексту):\n- src/app_runtime/control/http_app.py: \n - Обработка запросов через методы `app.post` и `app.get`.\n\n### Дополнительные наблюдения по контексту:\n- В файле `src/app_runtime/workflow/contracts/result.py` определена структура результата выполнения шагов (`StepResult`), что указывает на внутреннюю логику работы приложения с результатами и переходами состояний.\n- В файле `src/app_runtime/config/__init__.py` объявлены классы конфигурации, которые могут использоваться для настройки приложения, однако напрямую они не являются точками входа.\n\nТаким образом, основными точками входа в приложение являются маршруты FastAPI для HTTP-методов POST и GET, указанные в файле `http_app.py`.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [], - "layers": [ - "C3_ENTRYPOINTS", - "C0_SOURCE_CHUNKS" - ] - }, - "passed": true, - "mismatches": [], - "details": { - "case_id": "plba-fullchain-find-entrypoints", - "text": "Найди точки входа в коде", - "mode": "full_chain", - "run_started_at": "2026-03-12T11:57:51", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Найди точки входа в коде", - "symbol_resolution": { - "status": "not_requested", - "resolved_symbol": null, - "alternatives": [], - "confidence": 0.0 - }, - "rag_count": 9, - "rag_rows": [ - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/contracts/result.py", - "content": "class StepResult:\n transition: str = \"success\"\n updates: dict[str, Any] = field(default_factory=dict)\n status: str = \"completed\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/workflow/contracts/result.py:StepResult", - "span_start": 8, - "span_end": 11, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.workflow.contracts.result", - "is_test": false, - "blob_sha": "6e57dbfe22873f097f11228a26cffa415440a43b68a737b220906461cd86c353", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/config/__init__.py", - "content": "from app_runtime.config.file_loader import ConfigFileLoader\nfrom app_runtime.config.providers import FileConfigProvider\n\n__all__ = [\"ConfigFileLoader\", \"FileConfigProvider\"]", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/config/__init__.py:1-4", - "span_start": 1, - "span_end": 4, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.app_runtime.config.__init__", - "is_test": false, - "blob_sha": "612918029820a2a983330ec92256142b55b9de4bdf3399ece18e2a02dbad9729", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/__init__.py", - "content": "__all__: list[str] = []", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/__init__.py:1-1", - "span_start": 1, - "span_end": 1, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.app_runtime.__init__", - "is_test": false, - "blob_sha": "8eea9df4f6d7b38ca0e39ccc27b04700e3d08dbeec8046d613d22706d19985fa", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/config/file_loader.py", - "content": "class ConfigFileLoader:\n def __init__(self, path: str | Path) -> None:\n self.path = Path(path)\n self.config: Any = None\n self.last_valid_config: Any = None\n self._last_seen_hash: str | None = None\n\n def read_text(self) -> str:\n return self.path.read_text(encoding=\"utf-8\")\n\n def parse(self, data: str) -> Any:\n suffix = self.path.suffix.lower()\n if suffix in {\".yml\", \".yaml\"}:\n return yaml.safe_load(data)\n return json.loads(data)\n\n def load_sync(self) -> Any:\n data = self.read_text()\n parsed = self.parse(data)\n self.config = parsed\n self.last_valid_config = parsed\n self._last_seen_hash = self._calculate_hash(data)\n return parsed\n\n def load_if_changed(self) -> tuple[bool, Any]:\n data = self.read_text()\n current_hash = self._calculate_hash(data)\n if current_hash == self._last_seen_hash:\n return False, self.config\n parsed = self.parse(data)\n self.config = parsed\n self.last_valid_config = parsed\n self._last_seen_hash = current_hash\n return True, parsed\n\n @staticmethod\n def _calculate_hash(data: str) -> str:\n return hashlib.sha256(data.encode(\"utf-8\")).hexdigest()", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/config/file_loader.py:ConfigFileLoader", - "span_start": 11, - "span_end": 48, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.config.file_loader", - "is_test": false, - "blob_sha": "1f19ffebde5e38e4be5a5d5a678059a0f36dedb8fb8b3e00ab395c67106a87ea", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/config/providers.py", - "content": "class FileConfigProvider(ConfigProvider):\n def __init__(self, path: str | Path) -> None:\n self._loader = ConfigFileLoader(path)\n\n @property\n def loader(self) -> ConfigFileLoader:\n return self._loader\n\n def load(self) -> dict[str, Any]:\n config = self._loader.load_sync()\n if not isinstance(config, dict):\n raise TypeError(\"Config root must be a mapping\")\n return dict(config)", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/config/providers.py:FileConfigProvider", - "span_start": 10, - "span_end": 22, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.config.providers", - "is_test": false, - "blob_sha": "8c53ca0122d6df6c5763bca15e99434bb4daebd5a618b8fc927e9ae90b022e64", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "class ControlActionSet:\n health: HealthHandler\n start: ActionHandler\n stop: ActionHandler\n status: ActionHandler", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/base.py:ControlActionSet", - "span_start": 14, - "span_end": 18, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.base", - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "llm_answer": "## Финальный ответ:\n\nНа основании предоставленного контекста и анализа слоев RAG можно выделить следующие **точки входа** и ключевые обработчики запуска в приложении:\n\n### 1. `app.post` \n**Файл:** `src/app_runtime/control/http_app.py`\n**Сущность:** Метод класса FastAPI (`app`) \n**Роль:** Обрабатывает HTTP POST-запросы. Это основной маршрут для приёма данных от пользователей и их дальнейшей обработки внутри приложения.\n\n### 2. `app.get` \n**Файл:** `src/app_runtime/control/http_app.py`\n**Сущность:** Метод класса FastAPI (`app`) \n**Роль:** Обрабатывает HTTP GET-запросы. Используется для получения информации из системы (например, статус задач, результаты вычислений).\n\n### Наиболее вероятные точки входа (по контексту):\n- src/app_runtime/control/http_app.py: \n - Обработка запросов через методы `app.post` и `app.get`.\n\n### Дополнительные наблюдения по контексту:\n- В файле `src/app_runtime/workflow/contracts/result.py` определена структура результата выполнения шагов (`StepResult`), что указывает на внутреннюю логику работы приложения с результатами и переходами состояний.\n- В файле `src/app_runtime/config/__init__.py` объявлены классы конфигурации, которые могут использоваться для настройки приложения, однако напрямую они не являются точками входа.\n\nТаким образом, основными точками входа в приложение являются маршруты FastAPI для HTTP-методов POST и GET, указанные в файле `http_app.py`.", - "summary": { - "router": { - "intent": "CODE_QA", - "sub_intent": "FIND_ENTRYPOINTS", - "confidence": null - }, - "retrieval": { - "profile": "code", - "layers_hit": [ - "C0_SOURCE_CHUNKS", - "C3_ENTRYPOINTS" - ], - "evidence_sufficient": true - }, - "llm": { - "answer_status": "answered", - "groundedness": "grounded" - } - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "FIND_ENTRYPOINTS", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C3_ENTRYPOINTS", - "C0_SOURCE_CHUNKS" - ], - "symbol_kind_hint": "unknown", - "symbol_candidates": [], - "keyword_hints": [], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "execution": { - "executed_layers": [ - "C3_ENTRYPOINTS", - "C0_SOURCE_CHUNKS" - ], - "retrieval_mode_by_layer": { - "C3_ENTRYPOINTS": "exact_path_fetch", - "C0_SOURCE_CHUNKS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C3_ENTRYPOINTS": 12, - "C0_SOURCE_CHUNKS": 6 - }, - "filters_by_layer": { - "C3_ENTRYPOINTS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C3_ENTRYPOINTS", - "query": "Найди точки входа в коде", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 12, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Найди точки входа в коде", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C3_ENTRYPOINTS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 3, - "candidates_after_filter": 3 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 6, - "candidates_after_filter": 6 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "not_requested", - "resolved_symbol": null, - "alternatives": [] - }, - "layers": [ - { - "layer": "C3_ENTRYPOINTS", - "status": "hit", - "hit_count": 3, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 6, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "router": 0, - "symbol_resolution": 0, - "retrieval_total": 52, - "retrieval_by_layer": { - "C3_ENTRYPOINTS": 28, - "C0_SOURCE_CHUNKS": 23 - }, - "merge_rank": 0, - "prompt_build": 0, - "llm_call": 2372 - }, - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 458, - "evidence_rows": 9, - "evidence_chars": 2228 - }, - "evidence_summary": [ - { - "layer": "C3_ENTRYPOINTS", - "count": 3, - "unique_paths": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 6, - "unique_paths": 6 - } - ], - "prompt_template_id": "intent_code_qa_find_entrypoints_ru_v1", - "system_prompt_version": "v1" - }, - "router": { - "conversation_mode": "START", - "keyword_hints": [], - "path_scope": [] - }, - "llm": { - "used_evidence_count": 9, - "missing_evidence_reason": null - } - }, - "run_info": { - "case_id": "plba-fullchain-find-entrypoints", - "mode": "full_chain", - "run_started_at": "2026-03-12T11:57:51", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - }, - "input_request": { - "text": "Найди точки входа в коде", - "normalized_query": "Найди точки входа в коде" - }, - "steps": [ - { - "step": "intent_router", - "input": { - "query": "Найди точки входа в коде" - }, - "output": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Найди точки входа в коде" - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "FIND_ENTRYPOINTS", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C3_ENTRYPOINTS", - "C0_SOURCE_CHUNKS" - ], - "symbol_kind_hint": "unknown", - "symbol_candidates": [], - "keyword_hints": [], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "timings_ms": { - "router": 0 - } - } - }, - { - "step": "retrieval", - "input": { - "query": "Найди точки входа в коде" - }, - "output": { - "symbol_resolution": { - "status": "not_requested", - "resolved_symbol": null, - "alternatives": [], - "confidence": 0.0 - }, - "rag_count": 9, - "rag_rows": [ - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/contracts/result.py", - "content": "class StepResult:\n transition: str = \"success\"\n updates: dict[str, Any] = field(default_factory=dict)\n status: str = \"completed\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/workflow/contracts/result.py:StepResult", - "span_start": 8, - "span_end": 11, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.workflow.contracts.result", - "is_test": false, - "blob_sha": "6e57dbfe22873f097f11228a26cffa415440a43b68a737b220906461cd86c353", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/config/__init__.py", - "content": "from app_runtime.config.file_loader import ConfigFileLoader\nfrom app_runtime.config.providers import FileConfigProvider\n\n__all__ = [\"ConfigFileLoader\", \"FileConfigProvider\"]", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/config/__init__.py:1-4", - "span_start": 1, - "span_end": 4, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.app_runtime.config.__init__", - "is_test": false, - "blob_sha": "612918029820a2a983330ec92256142b55b9de4bdf3399ece18e2a02dbad9729", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/__init__.py", - "content": "__all__: list[str] = []", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/__init__.py:1-1", - "span_start": 1, - "span_end": 1, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.app_runtime.__init__", - "is_test": false, - "blob_sha": "8eea9df4f6d7b38ca0e39ccc27b04700e3d08dbeec8046d613d22706d19985fa", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/config/file_loader.py", - "content": "class ConfigFileLoader:\n def __init__(self, path: str | Path) -> None:\n self.path = Path(path)\n self.config: Any = None\n self.last_valid_config: Any = None\n self._last_seen_hash: str | None = None\n\n def read_text(self) -> str:\n return self.path.read_text(encoding=\"utf-8\")\n\n def parse(self, data: str) -> Any:\n suffix = self.path.suffix.lower()\n if suffix in {\".yml\", \".yaml\"}:\n return yaml.safe_load(data)\n return json.loads(data)\n\n def load_sync(self) -> Any:\n data = self.read_text()\n parsed = self.parse(data)\n self.config = parsed\n self.last_valid_config = parsed\n self._last_seen_hash = self._calculate_hash(data)\n return parsed\n\n def load_if_changed(self) -> tuple[bool, Any]:\n data = self.read_text()\n current_hash = self._calculate_hash(data)\n if current_hash == self._last_seen_hash:\n return False, self.config\n parsed = self.parse(data)\n self.config = parsed\n self.last_valid_config = parsed\n self._last_seen_hash = current_hash\n return True, parsed\n\n @staticmethod\n def _calculate_hash(data: str) -> str:\n return hashlib.sha256(data.encode(\"utf-8\")).hexdigest()", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/config/file_loader.py:ConfigFileLoader", - "span_start": 11, - "span_end": 48, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.config.file_loader", - "is_test": false, - "blob_sha": "1f19ffebde5e38e4be5a5d5a678059a0f36dedb8fb8b3e00ab395c67106a87ea", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/config/providers.py", - "content": "class FileConfigProvider(ConfigProvider):\n def __init__(self, path: str | Path) -> None:\n self._loader = ConfigFileLoader(path)\n\n @property\n def loader(self) -> ConfigFileLoader:\n return self._loader\n\n def load(self) -> dict[str, Any]:\n config = self._loader.load_sync()\n if not isinstance(config, dict):\n raise TypeError(\"Config root must be a mapping\")\n return dict(config)", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/config/providers.py:FileConfigProvider", - "span_start": 10, - "span_end": 22, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.config.providers", - "is_test": false, - "blob_sha": "8c53ca0122d6df6c5763bca15e99434bb4daebd5a618b8fc927e9ae90b022e64", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "class ControlActionSet:\n health: HealthHandler\n start: ActionHandler\n stop: ActionHandler\n status: ActionHandler", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/base.py:ControlActionSet", - "span_start": 14, - "span_end": 18, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.base", - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ] - }, - "diagnostics": { - "execution": { - "executed_layers": [ - "C3_ENTRYPOINTS", - "C0_SOURCE_CHUNKS" - ], - "retrieval_mode_by_layer": { - "C3_ENTRYPOINTS": "exact_path_fetch", - "C0_SOURCE_CHUNKS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C3_ENTRYPOINTS": 12, - "C0_SOURCE_CHUNKS": 6 - }, - "filters_by_layer": { - "C3_ENTRYPOINTS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C3_ENTRYPOINTS", - "query": "Найди точки входа в коде", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 12, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Найди точки входа в коде", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C3_ENTRYPOINTS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 3, - "candidates_after_filter": 3 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 6, - "candidates_after_filter": 6 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "not_requested", - "resolved_symbol": null, - "alternatives": [] - }, - "layers": [ - { - "layer": "C3_ENTRYPOINTS", - "status": "hit", - "hit_count": 3, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 6, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "symbol_resolution": 0, - "retrieval_total": 52, - "retrieval_by_layer": { - "C3_ENTRYPOINTS": 28, - "C0_SOURCE_CHUNKS": 23 - }, - "merge_rank": 0 - } - } - }, - { - "step": "llm_answer", - "input": { - "query": "Найди точки входа в коде", - "rag_count": 9 - }, - "output": { - "llm_answer": "## Финальный ответ:\n\nНа основании предоставленного контекста и анализа слоев RAG можно выделить следующие **точки входа** и ключевые обработчики запуска в приложении:\n\n### 1. `app.post` \n**Файл:** `src/app_runtime/control/http_app.py`\n**Сущность:** Метод класса FastAPI (`app`) \n**Роль:** Обрабатывает HTTP POST-запросы. Это основной маршрут для приёма данных от пользователей и их дальнейшей обработки внутри приложения.\n\n### 2. `app.get` \n**Файл:** `src/app_runtime/control/http_app.py`\n**Сущность:** Метод класса FastAPI (`app`) \n**Роль:** Обрабатывает HTTP GET-запросы. Используется для получения информации из системы (например, статус задач, результаты вычислений).\n\n### Наиболее вероятные точки входа (по контексту):\n- src/app_runtime/control/http_app.py: \n - Обработка запросов через методы `app.post` и `app.get`.\n\n### Дополнительные наблюдения по контексту:\n- В файле `src/app_runtime/workflow/contracts/result.py` определена структура результата выполнения шагов (`StepResult`), что указывает на внутреннюю логику работы приложения с результатами и переходами состояний.\n- В файле `src/app_runtime/config/__init__.py` объявлены классы конфигурации, которые могут использоваться для настройки приложения, однако напрямую они не являются точками входа.\n\nТаким образом, основными точками входа в приложение являются маршруты FastAPI для HTTP-методов POST и GET, указанные в файле `http_app.py`." - }, - "diagnostics": { - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 458, - "evidence_rows": 9, - "evidence_chars": 2228 - }, - "evidence_summary": [ - { - "layer": "C3_ENTRYPOINTS", - "count": 3, - "unique_paths": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 6, - "unique_paths": 6 - } - ], - "prompt_template_id": "intent_code_qa_find_entrypoints_ru_v1", - "system_prompt_version": "v1" - }, - "timings_ms": { - "prompt_build": 0, - "llm_call": 2372 - } - } - } - ] - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents/20260312_115751/full_chain_plba_code_subintents_plba-fullchain-find-entrypoints.md b/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents/20260312_115751/full_chain_plba_code_subintents_plba-fullchain-find-entrypoints.md deleted file mode 100644 index 44c9990..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents/20260312_115751/full_chain_plba_code_subintents_plba-fullchain-find-entrypoints.md +++ /dev/null @@ -1,29 +0,0 @@ -# plba-fullchain-find-entrypoints - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_subintents.yaml -- runner: runtime -- mode: full_chain -- passed: True - -## Query -Найди точки входа в коде - -## Actual -{ - "intent": "CODE_QA", - "sub_intent": "FIND_ENTRYPOINTS", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 9, - "llm_answer": "## Финальный ответ:\n\nНа основании предоставленного контекста и анализа слоев RAG можно выделить следующие **точки входа** и ключевые обработчики запуска в приложении:\n\n### 1. `app.post` \n**Файл:** `src/app_runtime/control/http_app.py`\n**Сущность:** Метод класса FastAPI (`app`) \n**Роль:** Обрабатывает HTTP POST-запросы. Это основной маршрут для приёма данных от пользователей и их дальнейшей обработки внутри приложения.\n\n### 2. `app.get` \n**Файл:** `src/app_runtime/control/http_app.py`\n**Сущность:** Метод класса FastAPI (`app`) \n**Роль:** Обрабатывает HTTP GET-запросы. Используется для получения информации из системы (например, статус задач, результаты вычислений).\n\n### Наиболее вероятные точки входа (по контексту):\n- src/app_runtime/control/http_app.py: \n - Обработка запросов через методы `app.post` и `app.get`.\n\n### Дополнительные наблюдения по контексту:\n- В файле `src/app_runtime/workflow/contracts/result.py` определена структура результата выполнения шагов (`StepResult`), что указывает на внутреннюю логику работы приложения с результатами и переходами состояний.\n- В файле `src/app_runtime/config/__init__.py` объявлены классы конфигурации, которые могут использоваться для настройки приложения, однако напрямую они не являются точками входа.\n\nТаким образом, основными точками входа в приложение являются маршруты FastAPI для HTTP-методов POST и GET, указанные в файле `http_app.py`.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [], - "layers": [ - "C3_ENTRYPOINTS", - "C0_SOURCE_CHUNKS" - ] -} - -## Mismatches -- none \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents/20260312_115751/full_chain_plba_code_subintents_plba-fullchain-find-tests-runtime-manager.json b/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents/20260312_115751/full_chain_plba_code_subintents_plba-fullchain-find-tests-runtime-manager.json deleted file mode 100644 index 4a018ac..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents/20260312_115751/full_chain_plba_code_subintents_plba-fullchain-find-tests-runtime-manager.json +++ /dev/null @@ -1,1879 +0,0 @@ -{ - "case_id": "plba-fullchain-find-tests-runtime-manager", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_subintents.yaml", - "runner": "runtime", - "mode": "full_chain", - "actual": { - "intent": "CODE_QA", - "sub_intent": "FIND_TESTS", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 16, - "llm_answer": "Прямые тесты для `RuntimeManager` обнаружены в следующих местах:\n\n1. **tests/test_runtime.py**:\n - `test_runtime_graceful_stop_waits_until_worker_finishes`: Проверяет корректность остановки (`stop`) объекта `RuntimeManager`, ожидая завершения работы модуля.\n ✅ Близость проверки высокая — непосредственно проверяет поведение при вызове метода `stop`.\n \n - `test_runtime_runs_worker_routine_and_exposes_status`: Тестирует регистрацию модуля и запуск его рутины с последующим получением статуса.\n ✅ Близость проверки высокая — проверяет выполнение регистраций модулей и получение их статусов через `RuntimeManager`.\n\n2. **tests/test_business_control_actions.py**:\n - `_build_runtime`: Тест косвенный, так как здесь создаётся объект `RuntimeManager`, но сам метод не проверяет логику поведения объекта напрямую.\n ❌ Косвенная проверка.\n - `test_worker_wakes_up_with_configured_interval`: Аналогично предыдущему пункту, использует `RuntimeManager` без непосредственной проверки его функций.\n ❌ Косвенная проверка.\n\nИтоговый вывод:\n\n- Прямые тесты для методов и поведения `RuntimeManager` найдены в `tests/test_runtime.py`. Они охватывают важные аспекты использования объекта, такие как остановка и управление состояниями.\n- В `tests/test_business_control_actions.py` есть косвенные упоминания о создании экземпляров `RuntimeManager`, однако сами методы там не проверяются на функциональность.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "RuntimeManager" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ] - }, - "passed": true, - "mismatches": [], - "details": { - "case_id": "plba-fullchain-find-tests-runtime-manager", - "text": "Где тесты для RuntimeManager?", - "mode": "full_chain", - "run_started_at": "2026-03-12T11:57:51", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Где тесты для RuntimeManager?", - "symbol_resolution": { - "status": "not_found", - "resolved_symbol": null, - "alternatives": [ - "RuntimeManager" - ], - "confidence": 0.0 - }, - "rag_count": 16, - "rag_rows": [ - { - "path": "tests/test_runtime.py", - "content": "test_runtime_runs_worker_routine_and_exposes_status instantiates RuntimeManager", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_runtime_runs_worker_routine_and_exposes_status:instantiates", - "span_start": 209, - "span_end": 209, - "lexical_rank": 6, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "c397a308e7824ba9fe400a754c7e15e66ea6f058d7f5d3e82bb002bb78b509d2", - "edge_type": "instantiates", - "src_symbol_id": "1c767eb5ee08e84f45b18c8ed7531ec0ed73c63fb1594823569672db7b21e992", - "src_qname": "test_runtime_runs_worker_routine_and_exposes_status", - "dst_symbol_id": "aeadc039653807b0da1ca6e3cc1078ee61cfc510b28e7f9c2ec04c59da43cc8d", - "dst_ref": "RuntimeManager", - "resolution": "resolved", - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_runtime.py", - "content": "test_runtime_graceful_stop_waits_until_worker_finishes instantiates RuntimeManager", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_runtime_graceful_stop_waits_until_worker_finishes:instantiates", - "span_start": 229, - "span_end": 229, - "lexical_rank": 6, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "76b4701262ccaa0a7a41691407c4ebdb2ca74a2415d89f0a38ef0d4f608bda93", - "edge_type": "instantiates", - "src_symbol_id": "1076e788e4a03b10d7bc1313a8ad46caa170c13cc026c6e4de994af1a6ae57bf", - "src_qname": "test_runtime_graceful_stop_waits_until_worker_finishes", - "dst_symbol_id": "aeadc039653807b0da1ca6e3cc1078ee61cfc510b28e7f9c2ec04c59da43cc8d", - "dst_ref": "RuntimeManager", - "resolution": "resolved", - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "_build_runtime instantiates RuntimeManager", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "_build_runtime:instantiates", - "span_start": 155, - "span_end": 155, - "lexical_rank": 6, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "7eb254d564944bab6272757ee5ef688862bd321e6941e2495dc942e03b1c9a25", - "edge_type": "instantiates", - "src_symbol_id": "db94031d5245bf82be836a109b4584b43b8e83d37a0f318e03f6c8191896d469", - "src_qname": "_build_runtime", - "dst_symbol_id": "a1572ea8183dc0cd6ddbc74342bbde8c28cecfde37ad40b62feff09f8d103d11", - "dst_ref": "RuntimeManager", - "resolution": "resolved", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "test_worker_wakes_up_with_configured_interval instantiates RuntimeManager", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_worker_wakes_up_with_configured_interval:instantiates", - "span_start": 167, - "span_end": 167, - "lexical_rank": 6, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "189aafc4de0b79c688668f25f0c87166a127df26bd2215452014713b65ef281a", - "edge_type": "instantiates", - "src_symbol_id": "65f877f78191d65e6a752e41cedc70ebc784c266804a55c1c56440336e1f0d6e", - "src_qname": "test_worker_wakes_up_with_configured_interval", - "dst_symbol_id": "a1572ea8183dc0cd6ddbc74342bbde8c28cecfde37ad40b62feff09f8d103d11", - "dst_ref": "RuntimeManager", - "resolution": "resolved", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "test_actions_stop_busy_worker_after_timeout\n -> BlockingRoutine\n -> BlockingRoutine.__init__\n -> BlockingRoutine._started\n -> BlockingRoutine.run", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_actions_stop_busy_worker_after_timeout:dataflow_slice", - "span_start": 42, - "span_end": 238, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 5, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "8e7db3d2a9226f1c1d9942ac6373cfcafa0d2276758ddb8a3d3c455a3d58024d", - "edge_type": "dataflow_slice", - "src_symbol_id": "66392d3222421d9ba16eda3554940b16e7d5a6f33aa08c5738d35af2e32f1e4a", - "src_qname": "test_actions_stop_busy_worker_after_timeout", - "dst_symbol_id": "d9841bdbb69706c988ae7ae6adf89928dc4fae45943f74064f5382177034ba04", - "dst_ref": "BlockingRoutine.run", - "resolution": "resolved", - "slice_id": "8e7db3d2a9226f1c1d9942ac6373cfcafa0d2276758ddb8a3d3c455a3d58024d", - "root_symbol_id": "66392d3222421d9ba16eda3554940b16e7d5a6f33aa08c5738d35af2e32f1e4a", - "path_symbols": [ - "test_actions_stop_busy_worker_after_timeout", - "BlockingRoutine", - "BlockingRoutine.__init__", - "BlockingRoutine._started", - "BlockingRoutine.run" - ], - "path_symbol_ids": [ - "66392d3222421d9ba16eda3554940b16e7d5a6f33aa08c5738d35af2e32f1e4a", - "a3349c5bc65e4003a4bbd6a8dbb7a54c337e12d1aed930caa701b12e520f1e67", - "486deeed3043c6db985aef258e96ddc67aa53608e67a83962fbd2471f649ddf1", - "d9841bdbb69706c988ae7ae6adf89928dc4fae45943f74064f5382177034ba04" - ], - "path_edge_types": [ - "instantiates", - "writes_attr", - "reads_attr" - ], - "path_length": 5, - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "test_actions_stop_busy_worker_before_timeout\n -> BlockingRoutine\n -> BlockingRoutine.__init__\n -> BlockingRoutine._release\n -> BlockingRoutine.run", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_actions_stop_busy_worker_before_timeout:dataflow_slice", - "span_start": 43, - "span_end": 212, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 5, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "8bd726155ba387d3579763ee84dfd2f9a90bc917da88f3b2e89416ab5c1254d6", - "edge_type": "dataflow_slice", - "src_symbol_id": "a0bb116ca9d909c93a285667ae033fbd1859b2dad7cf34fcb44816393ef6909c", - "src_qname": "test_actions_stop_busy_worker_before_timeout", - "dst_symbol_id": "d9841bdbb69706c988ae7ae6adf89928dc4fae45943f74064f5382177034ba04", - "dst_ref": "BlockingRoutine.run", - "resolution": "resolved", - "slice_id": "8bd726155ba387d3579763ee84dfd2f9a90bc917da88f3b2e89416ab5c1254d6", - "root_symbol_id": "a0bb116ca9d909c93a285667ae033fbd1859b2dad7cf34fcb44816393ef6909c", - "path_symbols": [ - "test_actions_stop_busy_worker_before_timeout", - "BlockingRoutine", - "BlockingRoutine.__init__", - "BlockingRoutine._release", - "BlockingRoutine.run" - ], - "path_symbol_ids": [ - "a0bb116ca9d909c93a285667ae033fbd1859b2dad7cf34fcb44816393ef6909c", - "a3349c5bc65e4003a4bbd6a8dbb7a54c337e12d1aed930caa701b12e520f1e67", - "486deeed3043c6db985aef258e96ddc67aa53608e67a83962fbd2471f649ddf1", - "d9841bdbb69706c988ae7ae6adf89928dc4fae45943f74064f5382177034ba04" - ], - "path_edge_types": [ - "instantiates", - "writes_attr", - "reads_attr" - ], - "path_length": 5, - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_runtime.py", - "content": "def test_runtime_graceful_stop_waits_until_worker_finishes() -> None:\n started = Event()\n release = Event()\n runtime = RuntimeManager()\n runtime.register_module(BlockingModule(started, release))\n runtime.start()\n assert started.wait(timeout=1.0) is True\n assert runtime.status()[\"runtime\"][\"state\"] == \"busy\"\n\n stop_thread = Thread(target=runtime.stop, kwargs={\"timeout\": 1.0}, daemon=True)\n stop_thread.start()\n sleep(0.1)\n assert stop_thread.is_alive() is True\n\n release.set()\n stop_thread.join(timeout=1.0)\n assert stop_thread.is_alive() is False\n assert runtime.status()[\"runtime\"][\"state\"] == \"stopped\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_runtime.py:test_runtime_graceful_stop_waits_until_worker_finishes", - "span_start": 226, - "span_end": 243, - "lexical_rank": 6, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 8, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_runtime", - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_runtime.py", - "content": "def test_runtime_runs_worker_routine_and_exposes_status(tmp_path) -> None:\n config_path = tmp_path / \"config.yml\"\n config_path.write_text(\n \"\"\"\nplatform:\n workers: 1\nlog:\n version: 1\n disable_existing_loggers: false\n handlers:\n console:\n class: logging.StreamHandler\n root:\n level: INFO\n handlers: [console]\n\"\"\".strip(),\n encoding=\"utf-8\",\n )\n runtime = RuntimeManager()\n runtime.add_config_file(config_path)\n module = ExampleModule()\n runtime.register_module(module)\n\n runtime.start()\n sleep(0.2)\n status = runtime.status()\n runtime.stop()\n\n assert module.routine.processed == [{\"id\": 1}]\n assert status[\"modules\"] == [\"example\"]\n assert status[\"runtime\"][\"state\"] == \"idle\"\n assert status[\"health\"][\"status\"] == \"ok\"\n assert status[\"config\"] == {\"platform\": {\"workers\": 1}, \"log\": status[\"config\"][\"log\"]}", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_runtime.py:test_runtime_runs_worker_routine_and_exposes_status", - "span_start": 191, - "span_end": 223, - "lexical_rank": 6, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 7, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_runtime", - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "def _build_runtime(worker: Worker, *, control_timeout: int = 1) -> tuple[RuntimeManager, str]:\n runtime = RuntimeManager()\n channel = HttpControlChannel(host=\"127.0.0.1\", port=0, timeout=control_timeout)\n runtime.control_plane.register_channel(channel)\n runtime.register_module(WorkerModule(worker))\n runtime.start()\n return runtime, f\"http://127.0.0.1:{channel.port}\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:_build_runtime", - "span_start": 154, - "span_end": 160, - "lexical_rank": 6, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 6, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "def test_worker_wakes_up_with_configured_interval() -> None:\n interval = 0.15\n routine = IntervalRoutine()\n worker = ScenarioWorker(\"interval-worker\", routine, interval=interval)\n runtime = RuntimeManager()\n runtime.register_module(WorkerModule(worker))\n\n runtime.start()\n try:\n assert routine.wait_runs(count=3, timeout=2.0) is True\n finally:\n runtime.stop()\n\n deltas = routine.deltas()\n assert len(deltas) >= 2\n assert all(delta >= interval * 0.7 for delta in deltas[:2])", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:test_worker_wakes_up_with_configured_interval", - "span_start": 163, - "span_end": 178, - "lexical_rank": 6, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 7, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "class BlockingRoutine:\n def __init__(self, started: Event, release: Event) -> None:\n self._started = started\n self._release = release\n\n def run(self) -> None:\n self._started.set()\n self._release.wait(timeout=5.0)", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:BlockingRoutine", - "span_start": 40, - "span_end": 47, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 1, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "class ScenarioWorker(Worker):\n def __init__(self, name: str, routine: object, *, interval: float = 0.05) -> None:\n self._name = name\n self._routine = routine\n self._interval = interval\n self._thread: Thread | None = None\n self._stop_requested = Event()\n self._in_flight = 0\n self._runs = 0\n self._lock = Lock()\n\n @property\n def name(self) -> str:\n return self._name\n\n @property\n def critical(self) -> bool:\n return True\n\n def start(self) -> None:\n if self._thread is not None and self._thread.is_alive():\n return\n self._stop_requested.clear()\n self._thread = Thread(target=self._loop, name=f\"{self._name}-thread\", daemon=True)\n self._thread.start()\n\n def stop(self, force: bool = False) -> None:\n self._stop_requested.set()\n\n def health(self) -> WorkerHealth:\n return WorkerHealth(name=self.name, status=\"ok\", critical=True, meta={\"runs\": self._runs})\n\n def status(self) -> WorkerStatus:\n thread_alive = self._thread is not None and self._thread.is_alive()\n with self._lock:\n in_flight = self._in_flight\n runs = self._runs\n if not thread_alive:\n state = \"stopped\"\n elif self._stop_requested.is_set():\n state = \"stopping\"\n elif in_flight > 0:\n state = \"busy\"\n else:\n state = \"idle\"\n return WorkerStatus(name=self.name, state=state, in_flight=in_flight, meta={\"runs\": runs})\n\n def _loop(self) -> None:\n while not self._stop_requested.is_set():\n with self._lock:\n self._in_flight += 1\n try:\n self._routine.run()\n with self._lock:\n self._runs += 1\n finally:\n with self._lock:\n self._in_flight -= 1\n if self._stop_requested.is_set():\n return\n sleep(self._interval)", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:ScenarioWorker", - "span_start": 50, - "span_end": 110, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 2, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "class WorkerModule(ApplicationModule):\n def __init__(self, worker: Worker) -> None:\n self._worker = worker\n\n @property\n def name(self) -> str:\n return \"business-tests\"\n\n def register(self, registry: ModuleRegistry) -> None:\n registry.add_worker(self._worker)", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:WorkerModule", - "span_start": 113, - "span_end": 122, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 3, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "def _http_call_json(\n base_url: str,\n path: str,\n *,\n method: str = \"GET\",\n headers: dict[str, str] | None = None,\n) -> tuple[int, dict[str, object]]:\n request = Request(f\"{base_url}{path}\", method=method, headers=headers or {})\n try:\n with urlopen(request, timeout=15.0) as response:\n status = response.status\n body = response.read()\n except HTTPError as error:\n status = error.code\n body = error.read()\n payload = json.loads(body.decode(\"utf-8\"))\n return status, payload", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:_http_call_json", - "span_start": 125, - "span_end": 141, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 4, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "class IntervalRoutine:\n calls: list[float] = field(default_factory=list)\n _lock: Lock = field(default_factory=Lock)\n\n def run(self) -> None:\n with self._lock:\n self.calls.append(monotonic())\n\n def wait_runs(self, count: int, timeout: float) -> bool:\n deadline = monotonic() + timeout\n while monotonic() < deadline:\n with self._lock:\n if len(self.calls) >= count:\n return True\n sleep(0.01)\n return False\n\n def deltas(self) -> list[float]:\n with self._lock:\n return [self.calls[index + 1] - self.calls[index] for index in range(len(self.calls) - 1)]", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:IntervalRoutine", - "span_start": 18, - "span_end": 37, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "def _poll_until_stopped(base_url: str, timeout: float = 2.0) -> bool:\n deadline = monotonic() + timeout\n while monotonic() < deadline:\n _, payload = _http_call_json(base_url, \"/actions/status\")\n if payload.get(\"detail\") == \"stopped\":\n return True\n sleep(0.05)\n return False", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:_poll_until_stopped", - "span_start": 144, - "span_end": 151, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 5, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "llm_answer": "Прямые тесты для `RuntimeManager` обнаружены в следующих местах:\n\n1. **tests/test_runtime.py**:\n - `test_runtime_graceful_stop_waits_until_worker_finishes`: Проверяет корректность остановки (`stop`) объекта `RuntimeManager`, ожидая завершения работы модуля.\n ✅ Близость проверки высокая — непосредственно проверяет поведение при вызове метода `stop`.\n \n - `test_runtime_runs_worker_routine_and_exposes_status`: Тестирует регистрацию модуля и запуск его рутины с последующим получением статуса.\n ✅ Близость проверки высокая — проверяет выполнение регистраций модулей и получение их статусов через `RuntimeManager`.\n\n2. **tests/test_business_control_actions.py**:\n - `_build_runtime`: Тест косвенный, так как здесь создаётся объект `RuntimeManager`, но сам метод не проверяет логику поведения объекта напрямую.\n ❌ Косвенная проверка.\n - `test_worker_wakes_up_with_configured_interval`: Аналогично предыдущему пункту, использует `RuntimeManager` без непосредственной проверки его функций.\n ❌ Косвенная проверка.\n\nИтоговый вывод:\n\n- Прямые тесты для методов и поведения `RuntimeManager` найдены в `tests/test_runtime.py`. Они охватывают важные аспекты использования объекта, такие как остановка и управление состояниями.\n- В `tests/test_business_control_actions.py` есть косвенные упоминания о создании экземпляров `RuntimeManager`, однако сами методы там не проверяются на функциональность.", - "summary": { - "router": { - "intent": "CODE_QA", - "sub_intent": "FIND_TESTS", - "confidence": null - }, - "retrieval": { - "profile": "code", - "layers_hit": [ - "C0_SOURCE_CHUNKS", - "C2_DEPENDENCY_GRAPH" - ], - "evidence_sufficient": true - }, - "llm": { - "answer_status": "answered", - "groundedness": "grounded" - } - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "FIND_TESTS", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "RuntimeManager" - ], - "keyword_hints": [ - "RuntimeManager" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**", - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "test_file_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "test_symbol_patterns": [ - "test_runtime_manager", - "TestRuntimeManager", - "RuntimeManager" - ], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C0_SOURCE_CHUNKS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C0_SOURCE_CHUNKS": 10 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [], - "include_globs": [ - "src", - "tests" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests" - ] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src", - "tests" - ], - "include_globs": [ - "src", - "tests" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests" - ] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src", - "tests" - ], - "include_globs": [ - "src", - "tests" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests" - ] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**", - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "Где тесты для RuntimeManager? test_runtime_manager TestRuntimeManager RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**", - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "top_k": 6, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Где тесты для RuntimeManager? test_runtime_manager TestRuntimeManager RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**", - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "top_k": 10, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [], - "normalized_include_globs": [ - "src", - "tests" - ], - "normalized_exclude_globs": [], - "normalized_prefer_globs": [ - "tests" - ], - "filter_stage": "post_rank", - "candidates_before_filter": 0, - "candidates_after_filter": 0 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src", - "tests" - ], - "normalized_include_globs": [ - "src", - "tests" - ], - "normalized_exclude_globs": [], - "normalized_prefer_globs": [ - "tests" - ], - "filter_stage": "post_rank", - "candidates_before_filter": 6, - "candidates_after_filter": 6 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src", - "tests" - ], - "normalized_include_globs": [ - "src", - "tests" - ], - "normalized_exclude_globs": [], - "normalized_prefer_globs": [ - "tests" - ], - "filter_stage": "post_rank", - "candidates_before_filter": 10, - "candidates_after_filter": 10 - } - ], - "fallback": { - "used": true, - "reason": "scope_relaxed_no_hits" - }, - "symbol_resolution": { - "status": "not_found", - "resolved_symbol": null, - "alternatives": [ - "RuntimeManager" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "miss", - "hit_count": 0, - "fail_reason": "scope_relaxed_no_hits" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 6, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 10, - "fail_reason": null - } - ] - }, - "constraint_violations": [ - { - "type": "LAYER_MISSING", - "severity": "warn", - "details": { - "layer": "C1_SYMBOL_CATALOG", - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ] - }, - "suggested_fix": "Increase top_k for this layer or relax constraints for retrieval." - } - ], - "timings_ms": { - "router": 0, - "symbol_resolution": 0, - "retrieval_total": 150, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 81, - "C2_DEPENDENCY_GRAPH": 53, - "C0_SOURCE_CHUNKS": 15 - }, - "merge_rank": 0, - "prompt_build": 0, - "llm_call": 2314 - }, - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 858, - "evidence_rows": 16, - "evidence_chars": 7086 - }, - "evidence_summary": [ - { - "layer": "C2_DEPENDENCY_GRAPH", - "count": 6, - "unique_paths": 2 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 10, - "unique_paths": 2 - } - ], - "prompt_template_id": "intent_code_qa_find_tests_ru_v1", - "system_prompt_version": "v1" - }, - "router": { - "conversation_mode": "START", - "keyword_hints": [ - "RuntimeManager" - ], - "path_scope": [] - }, - "llm": { - "used_evidence_count": 16, - "missing_evidence_reason": null - } - }, - "run_info": { - "case_id": "plba-fullchain-find-tests-runtime-manager", - "mode": "full_chain", - "run_started_at": "2026-03-12T11:57:51", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - }, - "input_request": { - "text": "Где тесты для RuntimeManager?", - "normalized_query": "Где тесты для RuntimeManager?" - }, - "steps": [ - { - "step": "intent_router", - "input": { - "query": "Где тесты для RuntimeManager?" - }, - "output": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Где тесты для RuntimeManager?" - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "FIND_TESTS", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "RuntimeManager" - ], - "keyword_hints": [ - "RuntimeManager" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**", - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "test_file_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "test_symbol_patterns": [ - "test_runtime_manager", - "TestRuntimeManager", - "RuntimeManager" - ], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "timings_ms": { - "router": 0 - } - } - }, - { - "step": "retrieval", - "input": { - "query": "Где тесты для RuntimeManager?" - }, - "output": { - "symbol_resolution": { - "status": "not_found", - "resolved_symbol": null, - "alternatives": [ - "RuntimeManager" - ], - "confidence": 0.0 - }, - "rag_count": 16, - "rag_rows": [ - { - "path": "tests/test_runtime.py", - "content": "test_runtime_runs_worker_routine_and_exposes_status instantiates RuntimeManager", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_runtime_runs_worker_routine_and_exposes_status:instantiates", - "span_start": 209, - "span_end": 209, - "lexical_rank": 6, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "c397a308e7824ba9fe400a754c7e15e66ea6f058d7f5d3e82bb002bb78b509d2", - "edge_type": "instantiates", - "src_symbol_id": "1c767eb5ee08e84f45b18c8ed7531ec0ed73c63fb1594823569672db7b21e992", - "src_qname": "test_runtime_runs_worker_routine_and_exposes_status", - "dst_symbol_id": "aeadc039653807b0da1ca6e3cc1078ee61cfc510b28e7f9c2ec04c59da43cc8d", - "dst_ref": "RuntimeManager", - "resolution": "resolved", - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_runtime.py", - "content": "test_runtime_graceful_stop_waits_until_worker_finishes instantiates RuntimeManager", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_runtime_graceful_stop_waits_until_worker_finishes:instantiates", - "span_start": 229, - "span_end": 229, - "lexical_rank": 6, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "76b4701262ccaa0a7a41691407c4ebdb2ca74a2415d89f0a38ef0d4f608bda93", - "edge_type": "instantiates", - "src_symbol_id": "1076e788e4a03b10d7bc1313a8ad46caa170c13cc026c6e4de994af1a6ae57bf", - "src_qname": "test_runtime_graceful_stop_waits_until_worker_finishes", - "dst_symbol_id": "aeadc039653807b0da1ca6e3cc1078ee61cfc510b28e7f9c2ec04c59da43cc8d", - "dst_ref": "RuntimeManager", - "resolution": "resolved", - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "_build_runtime instantiates RuntimeManager", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "_build_runtime:instantiates", - "span_start": 155, - "span_end": 155, - "lexical_rank": 6, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "7eb254d564944bab6272757ee5ef688862bd321e6941e2495dc942e03b1c9a25", - "edge_type": "instantiates", - "src_symbol_id": "db94031d5245bf82be836a109b4584b43b8e83d37a0f318e03f6c8191896d469", - "src_qname": "_build_runtime", - "dst_symbol_id": "a1572ea8183dc0cd6ddbc74342bbde8c28cecfde37ad40b62feff09f8d103d11", - "dst_ref": "RuntimeManager", - "resolution": "resolved", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "test_worker_wakes_up_with_configured_interval instantiates RuntimeManager", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_worker_wakes_up_with_configured_interval:instantiates", - "span_start": 167, - "span_end": 167, - "lexical_rank": 6, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "189aafc4de0b79c688668f25f0c87166a127df26bd2215452014713b65ef281a", - "edge_type": "instantiates", - "src_symbol_id": "65f877f78191d65e6a752e41cedc70ebc784c266804a55c1c56440336e1f0d6e", - "src_qname": "test_worker_wakes_up_with_configured_interval", - "dst_symbol_id": "a1572ea8183dc0cd6ddbc74342bbde8c28cecfde37ad40b62feff09f8d103d11", - "dst_ref": "RuntimeManager", - "resolution": "resolved", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "test_actions_stop_busy_worker_after_timeout\n -> BlockingRoutine\n -> BlockingRoutine.__init__\n -> BlockingRoutine._started\n -> BlockingRoutine.run", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_actions_stop_busy_worker_after_timeout:dataflow_slice", - "span_start": 42, - "span_end": 238, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 5, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "8e7db3d2a9226f1c1d9942ac6373cfcafa0d2276758ddb8a3d3c455a3d58024d", - "edge_type": "dataflow_slice", - "src_symbol_id": "66392d3222421d9ba16eda3554940b16e7d5a6f33aa08c5738d35af2e32f1e4a", - "src_qname": "test_actions_stop_busy_worker_after_timeout", - "dst_symbol_id": "d9841bdbb69706c988ae7ae6adf89928dc4fae45943f74064f5382177034ba04", - "dst_ref": "BlockingRoutine.run", - "resolution": "resolved", - "slice_id": "8e7db3d2a9226f1c1d9942ac6373cfcafa0d2276758ddb8a3d3c455a3d58024d", - "root_symbol_id": "66392d3222421d9ba16eda3554940b16e7d5a6f33aa08c5738d35af2e32f1e4a", - "path_symbols": [ - "test_actions_stop_busy_worker_after_timeout", - "BlockingRoutine", - "BlockingRoutine.__init__", - "BlockingRoutine._started", - "BlockingRoutine.run" - ], - "path_symbol_ids": [ - "66392d3222421d9ba16eda3554940b16e7d5a6f33aa08c5738d35af2e32f1e4a", - "a3349c5bc65e4003a4bbd6a8dbb7a54c337e12d1aed930caa701b12e520f1e67", - "486deeed3043c6db985aef258e96ddc67aa53608e67a83962fbd2471f649ddf1", - "d9841bdbb69706c988ae7ae6adf89928dc4fae45943f74064f5382177034ba04" - ], - "path_edge_types": [ - "instantiates", - "writes_attr", - "reads_attr" - ], - "path_length": 5, - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "test_actions_stop_busy_worker_before_timeout\n -> BlockingRoutine\n -> BlockingRoutine.__init__\n -> BlockingRoutine._release\n -> BlockingRoutine.run", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_actions_stop_busy_worker_before_timeout:dataflow_slice", - "span_start": 43, - "span_end": 212, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 5, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "8bd726155ba387d3579763ee84dfd2f9a90bc917da88f3b2e89416ab5c1254d6", - "edge_type": "dataflow_slice", - "src_symbol_id": "a0bb116ca9d909c93a285667ae033fbd1859b2dad7cf34fcb44816393ef6909c", - "src_qname": "test_actions_stop_busy_worker_before_timeout", - "dst_symbol_id": "d9841bdbb69706c988ae7ae6adf89928dc4fae45943f74064f5382177034ba04", - "dst_ref": "BlockingRoutine.run", - "resolution": "resolved", - "slice_id": "8bd726155ba387d3579763ee84dfd2f9a90bc917da88f3b2e89416ab5c1254d6", - "root_symbol_id": "a0bb116ca9d909c93a285667ae033fbd1859b2dad7cf34fcb44816393ef6909c", - "path_symbols": [ - "test_actions_stop_busy_worker_before_timeout", - "BlockingRoutine", - "BlockingRoutine.__init__", - "BlockingRoutine._release", - "BlockingRoutine.run" - ], - "path_symbol_ids": [ - "a0bb116ca9d909c93a285667ae033fbd1859b2dad7cf34fcb44816393ef6909c", - "a3349c5bc65e4003a4bbd6a8dbb7a54c337e12d1aed930caa701b12e520f1e67", - "486deeed3043c6db985aef258e96ddc67aa53608e67a83962fbd2471f649ddf1", - "d9841bdbb69706c988ae7ae6adf89928dc4fae45943f74064f5382177034ba04" - ], - "path_edge_types": [ - "instantiates", - "writes_attr", - "reads_attr" - ], - "path_length": 5, - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_runtime.py", - "content": "def test_runtime_graceful_stop_waits_until_worker_finishes() -> None:\n started = Event()\n release = Event()\n runtime = RuntimeManager()\n runtime.register_module(BlockingModule(started, release))\n runtime.start()\n assert started.wait(timeout=1.0) is True\n assert runtime.status()[\"runtime\"][\"state\"] == \"busy\"\n\n stop_thread = Thread(target=runtime.stop, kwargs={\"timeout\": 1.0}, daemon=True)\n stop_thread.start()\n sleep(0.1)\n assert stop_thread.is_alive() is True\n\n release.set()\n stop_thread.join(timeout=1.0)\n assert stop_thread.is_alive() is False\n assert runtime.status()[\"runtime\"][\"state\"] == \"stopped\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_runtime.py:test_runtime_graceful_stop_waits_until_worker_finishes", - "span_start": 226, - "span_end": 243, - "lexical_rank": 6, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 8, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_runtime", - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_runtime.py", - "content": "def test_runtime_runs_worker_routine_and_exposes_status(tmp_path) -> None:\n config_path = tmp_path / \"config.yml\"\n config_path.write_text(\n \"\"\"\nplatform:\n workers: 1\nlog:\n version: 1\n disable_existing_loggers: false\n handlers:\n console:\n class: logging.StreamHandler\n root:\n level: INFO\n handlers: [console]\n\"\"\".strip(),\n encoding=\"utf-8\",\n )\n runtime = RuntimeManager()\n runtime.add_config_file(config_path)\n module = ExampleModule()\n runtime.register_module(module)\n\n runtime.start()\n sleep(0.2)\n status = runtime.status()\n runtime.stop()\n\n assert module.routine.processed == [{\"id\": 1}]\n assert status[\"modules\"] == [\"example\"]\n assert status[\"runtime\"][\"state\"] == \"idle\"\n assert status[\"health\"][\"status\"] == \"ok\"\n assert status[\"config\"] == {\"platform\": {\"workers\": 1}, \"log\": status[\"config\"][\"log\"]}", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_runtime.py:test_runtime_runs_worker_routine_and_exposes_status", - "span_start": 191, - "span_end": 223, - "lexical_rank": 6, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 7, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_runtime", - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "def _build_runtime(worker: Worker, *, control_timeout: int = 1) -> tuple[RuntimeManager, str]:\n runtime = RuntimeManager()\n channel = HttpControlChannel(host=\"127.0.0.1\", port=0, timeout=control_timeout)\n runtime.control_plane.register_channel(channel)\n runtime.register_module(WorkerModule(worker))\n runtime.start()\n return runtime, f\"http://127.0.0.1:{channel.port}\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:_build_runtime", - "span_start": 154, - "span_end": 160, - "lexical_rank": 6, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 6, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "def test_worker_wakes_up_with_configured_interval() -> None:\n interval = 0.15\n routine = IntervalRoutine()\n worker = ScenarioWorker(\"interval-worker\", routine, interval=interval)\n runtime = RuntimeManager()\n runtime.register_module(WorkerModule(worker))\n\n runtime.start()\n try:\n assert routine.wait_runs(count=3, timeout=2.0) is True\n finally:\n runtime.stop()\n\n deltas = routine.deltas()\n assert len(deltas) >= 2\n assert all(delta >= interval * 0.7 for delta in deltas[:2])", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:test_worker_wakes_up_with_configured_interval", - "span_start": 163, - "span_end": 178, - "lexical_rank": 6, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 7, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "class BlockingRoutine:\n def __init__(self, started: Event, release: Event) -> None:\n self._started = started\n self._release = release\n\n def run(self) -> None:\n self._started.set()\n self._release.wait(timeout=5.0)", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:BlockingRoutine", - "span_start": 40, - "span_end": 47, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 1, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "class ScenarioWorker(Worker):\n def __init__(self, name: str, routine: object, *, interval: float = 0.05) -> None:\n self._name = name\n self._routine = routine\n self._interval = interval\n self._thread: Thread | None = None\n self._stop_requested = Event()\n self._in_flight = 0\n self._runs = 0\n self._lock = Lock()\n\n @property\n def name(self) -> str:\n return self._name\n\n @property\n def critical(self) -> bool:\n return True\n\n def start(self) -> None:\n if self._thread is not None and self._thread.is_alive():\n return\n self._stop_requested.clear()\n self._thread = Thread(target=self._loop, name=f\"{self._name}-thread\", daemon=True)\n self._thread.start()\n\n def stop(self, force: bool = False) -> None:\n self._stop_requested.set()\n\n def health(self) -> WorkerHealth:\n return WorkerHealth(name=self.name, status=\"ok\", critical=True, meta={\"runs\": self._runs})\n\n def status(self) -> WorkerStatus:\n thread_alive = self._thread is not None and self._thread.is_alive()\n with self._lock:\n in_flight = self._in_flight\n runs = self._runs\n if not thread_alive:\n state = \"stopped\"\n elif self._stop_requested.is_set():\n state = \"stopping\"\n elif in_flight > 0:\n state = \"busy\"\n else:\n state = \"idle\"\n return WorkerStatus(name=self.name, state=state, in_flight=in_flight, meta={\"runs\": runs})\n\n def _loop(self) -> None:\n while not self._stop_requested.is_set():\n with self._lock:\n self._in_flight += 1\n try:\n self._routine.run()\n with self._lock:\n self._runs += 1\n finally:\n with self._lock:\n self._in_flight -= 1\n if self._stop_requested.is_set():\n return\n sleep(self._interval)", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:ScenarioWorker", - "span_start": 50, - "span_end": 110, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 2, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "class WorkerModule(ApplicationModule):\n def __init__(self, worker: Worker) -> None:\n self._worker = worker\n\n @property\n def name(self) -> str:\n return \"business-tests\"\n\n def register(self, registry: ModuleRegistry) -> None:\n registry.add_worker(self._worker)", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:WorkerModule", - "span_start": 113, - "span_end": 122, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 3, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "def _http_call_json(\n base_url: str,\n path: str,\n *,\n method: str = \"GET\",\n headers: dict[str, str] | None = None,\n) -> tuple[int, dict[str, object]]:\n request = Request(f\"{base_url}{path}\", method=method, headers=headers or {})\n try:\n with urlopen(request, timeout=15.0) as response:\n status = response.status\n body = response.read()\n except HTTPError as error:\n status = error.code\n body = error.read()\n payload = json.loads(body.decode(\"utf-8\"))\n return status, payload", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:_http_call_json", - "span_start": 125, - "span_end": 141, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 4, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "class IntervalRoutine:\n calls: list[float] = field(default_factory=list)\n _lock: Lock = field(default_factory=Lock)\n\n def run(self) -> None:\n with self._lock:\n self.calls.append(monotonic())\n\n def wait_runs(self, count: int, timeout: float) -> bool:\n deadline = monotonic() + timeout\n while monotonic() < deadline:\n with self._lock:\n if len(self.calls) >= count:\n return True\n sleep(0.01)\n return False\n\n def deltas(self) -> list[float]:\n with self._lock:\n return [self.calls[index + 1] - self.calls[index] for index in range(len(self.calls) - 1)]", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:IntervalRoutine", - "span_start": 18, - "span_end": 37, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "def _poll_until_stopped(base_url: str, timeout: float = 2.0) -> bool:\n deadline = monotonic() + timeout\n while monotonic() < deadline:\n _, payload = _http_call_json(base_url, \"/actions/status\")\n if payload.get(\"detail\") == \"stopped\":\n return True\n sleep(0.05)\n return False", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:_poll_until_stopped", - "span_start": 144, - "span_end": 151, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 5, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ] - }, - "diagnostics": { - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C0_SOURCE_CHUNKS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C0_SOURCE_CHUNKS": 10 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [], - "include_globs": [ - "src", - "tests" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests" - ] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src", - "tests" - ], - "include_globs": [ - "src", - "tests" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests" - ] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src", - "tests" - ], - "include_globs": [ - "src", - "tests" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests" - ] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**", - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "Где тесты для RuntimeManager? test_runtime_manager TestRuntimeManager RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**", - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "top_k": 6, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Где тесты для RuntimeManager? test_runtime_manager TestRuntimeManager RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**", - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "top_k": 10, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [], - "normalized_include_globs": [ - "src", - "tests" - ], - "normalized_exclude_globs": [], - "normalized_prefer_globs": [ - "tests" - ], - "filter_stage": "post_rank", - "candidates_before_filter": 0, - "candidates_after_filter": 0 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src", - "tests" - ], - "normalized_include_globs": [ - "src", - "tests" - ], - "normalized_exclude_globs": [], - "normalized_prefer_globs": [ - "tests" - ], - "filter_stage": "post_rank", - "candidates_before_filter": 6, - "candidates_after_filter": 6 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src", - "tests" - ], - "normalized_include_globs": [ - "src", - "tests" - ], - "normalized_exclude_globs": [], - "normalized_prefer_globs": [ - "tests" - ], - "filter_stage": "post_rank", - "candidates_before_filter": 10, - "candidates_after_filter": 10 - } - ], - "fallback": { - "used": true, - "reason": "scope_relaxed_no_hits" - }, - "symbol_resolution": { - "status": "not_found", - "resolved_symbol": null, - "alternatives": [ - "RuntimeManager" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "miss", - "hit_count": 0, - "fail_reason": "scope_relaxed_no_hits" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 6, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 10, - "fail_reason": null - } - ] - }, - "constraint_violations": [ - { - "type": "LAYER_MISSING", - "severity": "warn", - "details": { - "layer": "C1_SYMBOL_CATALOG", - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ] - }, - "suggested_fix": "Increase top_k for this layer or relax constraints for retrieval." - } - ], - "timings_ms": { - "symbol_resolution": 0, - "retrieval_total": 150, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 81, - "C2_DEPENDENCY_GRAPH": 53, - "C0_SOURCE_CHUNKS": 15 - }, - "merge_rank": 0 - } - } - }, - { - "step": "llm_answer", - "input": { - "query": "Где тесты для RuntimeManager?", - "rag_count": 16 - }, - "output": { - "llm_answer": "Прямые тесты для `RuntimeManager` обнаружены в следующих местах:\n\n1. **tests/test_runtime.py**:\n - `test_runtime_graceful_stop_waits_until_worker_finishes`: Проверяет корректность остановки (`stop`) объекта `RuntimeManager`, ожидая завершения работы модуля.\n ✅ Близость проверки высокая — непосредственно проверяет поведение при вызове метода `stop`.\n \n - `test_runtime_runs_worker_routine_and_exposes_status`: Тестирует регистрацию модуля и запуск его рутины с последующим получением статуса.\n ✅ Близость проверки высокая — проверяет выполнение регистраций модулей и получение их статусов через `RuntimeManager`.\n\n2. **tests/test_business_control_actions.py**:\n - `_build_runtime`: Тест косвенный, так как здесь создаётся объект `RuntimeManager`, но сам метод не проверяет логику поведения объекта напрямую.\n ❌ Косвенная проверка.\n - `test_worker_wakes_up_with_configured_interval`: Аналогично предыдущему пункту, использует `RuntimeManager` без непосредственной проверки его функций.\n ❌ Косвенная проверка.\n\nИтоговый вывод:\n\n- Прямые тесты для методов и поведения `RuntimeManager` найдены в `tests/test_runtime.py`. Они охватывают важные аспекты использования объекта, такие как остановка и управление состояниями.\n- В `tests/test_business_control_actions.py` есть косвенные упоминания о создании экземпляров `RuntimeManager`, однако сами методы там не проверяются на функциональность." - }, - "diagnostics": { - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 858, - "evidence_rows": 16, - "evidence_chars": 7086 - }, - "evidence_summary": [ - { - "layer": "C2_DEPENDENCY_GRAPH", - "count": 6, - "unique_paths": 2 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 10, - "unique_paths": 2 - } - ], - "prompt_template_id": "intent_code_qa_find_tests_ru_v1", - "system_prompt_version": "v1" - }, - "timings_ms": { - "prompt_build": 0, - "llm_call": 2314 - } - } - } - ] - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents/20260312_115751/full_chain_plba_code_subintents_plba-fullchain-find-tests-runtime-manager.md b/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents/20260312_115751/full_chain_plba_code_subintents_plba-fullchain-find-tests-runtime-manager.md deleted file mode 100644 index 33b16c2..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents/20260312_115751/full_chain_plba_code_subintents_plba-fullchain-find-tests-runtime-manager.md +++ /dev/null @@ -1,32 +0,0 @@ -# plba-fullchain-find-tests-runtime-manager - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_subintents.yaml -- runner: runtime -- mode: full_chain -- passed: True - -## Query -Где тесты для RuntimeManager? - -## Actual -{ - "intent": "CODE_QA", - "sub_intent": "FIND_TESTS", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 16, - "llm_answer": "Прямые тесты для `RuntimeManager` обнаружены в следующих местах:\n\n1. **tests/test_runtime.py**:\n - `test_runtime_graceful_stop_waits_until_worker_finishes`: Проверяет корректность остановки (`stop`) объекта `RuntimeManager`, ожидая завершения работы модуля.\n ✅ Близость проверки высокая — непосредственно проверяет поведение при вызове метода `stop`.\n \n - `test_runtime_runs_worker_routine_and_exposes_status`: Тестирует регистрацию модуля и запуск его рутины с последующим получением статуса.\n ✅ Близость проверки высокая — проверяет выполнение регистраций модулей и получение их статусов через `RuntimeManager`.\n\n2. **tests/test_business_control_actions.py**:\n - `_build_runtime`: Тест косвенный, так как здесь создаётся объект `RuntimeManager`, но сам метод не проверяет логику поведения объекта напрямую.\n ❌ Косвенная проверка.\n - `test_worker_wakes_up_with_configured_interval`: Аналогично предыдущему пункту, использует `RuntimeManager` без непосредственной проверки его функций.\n ❌ Косвенная проверка.\n\nИтоговый вывод:\n\n- Прямые тесты для методов и поведения `RuntimeManager` найдены в `tests/test_runtime.py`. Они охватывают важные аспекты использования объекта, такие как остановка и управление состояниями.\n- В `tests/test_business_control_actions.py` есть косвенные упоминания о создании экземпляров `RuntimeManager`, однако сами методы там не проверяются на функциональность.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "RuntimeManager" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ] -} - -## Mismatches -- none \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents/20260312_115751/full_chain_plba_code_subintents_plba-fullchain-open-file-runtime.json b/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents/20260312_115751/full_chain_plba_code_subintents_plba-fullchain-open-file-runtime.json deleted file mode 100644 index 56809b2..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents/20260312_115751/full_chain_plba_code_subintents_plba-fullchain-open-file-runtime.json +++ /dev/null @@ -1,492 +0,0 @@ -{ - "case_id": "plba-fullchain-open-file-runtime", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_subintents.yaml", - "runner": "runtime", - "mode": "full_chain", - "actual": { - "intent": "CODE_QA", - "sub_intent": "OPEN_FILE", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 1, - "llm_answer": "Файл `src/app_runtime/core/runtime.py` содержит определение класса `RuntimeManager`, управляющего основными компонентами приложения во время его выполнения.\n\n## Важные сущности и их значение:\n- **`ConfigurationManager`, `ServiceContainer`, `TraceService`, `HealthRegistry`, `LogManager`, `WorkerSupervisor`, `ControlPlaneService`:** \n Эти классы представляют компоненты инфраструктуры, необходимые для работы приложения (конфигурация, сервисы, трассировка, здоровье системы, ведение логов, управление рабочими процессами и контрольная плоскость).\n \n- **`ModuleRegistry`:**\n Используется для регистрации модулей приложений, позволяя управлять ими централизованно.\n\n- **Параметры инициализации (`configuration`, `services`, `traces`, etc.):**\n Позволяют настраивать поведение экземпляра `RuntimeManager`.\n\n- **Методы класса:**\n - `_register_core_services()`: регистрирует основные службы, используемые приложением.\n - `register_module(module: ApplicationModule)`: позволяет зарегистрировать дополнительные модули приложения.\n\nЭтот класс является ключевым компонентом управления жизненным циклом приложения и обеспечивает интеграцию различных служб и компонентов в единое целое.", - "answer_mode": "answered", - "path_scope": [ - "src/app_runtime/core/runtime.py" - ], - "symbol_candidates": [], - "layers": [ - "C0_SOURCE_CHUNKS" - ] - }, - "passed": true, - "mismatches": [], - "details": { - "case_id": "plba-fullchain-open-file-runtime", - "text": "Открой файл src/app_runtime/core/runtime.py", - "mode": "full_chain", - "run_started_at": "2026-03-12T11:57:51", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Открой файл src/app_runtime/core/runtime.py", - "symbol_resolution": { - "status": "not_requested", - "resolved_symbol": null, - "alternatives": [], - "confidence": 0.0 - }, - "rag_count": 1, - "rag_rows": [ - { - "path": "src/app_runtime/core/runtime.py", - "content": "class RuntimeManager:\n ACTION_TIMEOUT_SECONDS = 10.0\n ACTION_POLL_INTERVAL_SECONDS = 0.05\n\n def __init__(\n self,\n configuration: ConfigurationManager | None = None,\n services: ServiceContainer | None = None,\n traces: TraceService | None = None,\n health: HealthRegistry | None = None,\n logs: LogManager | None = None,\n workers: WorkerSupervisor | None = None,\n control_plane: ControlPlaneService | None = None,\n ) -> None:\n self.configuration = configuration or ConfigurationManager()\n self.services = services or ServiceContainer()\n self.traces = traces or TraceService()\n self.health = health or HealthRegistry()\n self.logs = logs or LogManager()\n self.workers = workers or WorkerSupervisor()\n self.control_plane = control_plane or ControlPlaneService()\n self.registry = ModuleRegistry(self.services)\n self._started = False\n self._state = LifecycleState.IDLE\n self._core_registered = False\n self._workers_registered = False\n self._register_core_services()\n\n def register_module(self, module: ApplicationModule) -> None:\n self.registry.register_module(module.name)\n module.register(self.registry)\n\n def add_config_file(self, path: str) -> FileConfigProvider:\n provider = FileConfigProvider(path)\n self.configuration.add_provider(provider)\n return provider\n\n def start(self, *, start_control_plane: bool = True) -> None:\n if self._started:\n return\n self._state = LifecycleState.STARTING\n config = self.configuration.load()\n self.logs.apply_config(config)\n self._register_health_contributors()\n self._register_workers()\n self.workers.start()\n if start_control_plane:\n self.control_plane.start(self)\n self._started = True\n self._refresh_state()\n\n def stop(self, timeout: float = 30.0, force: bool = False, stop_control_plane: bool = True) -> None:\n if not self._started:\n return\n self._state = LifecycleState.STOPPING\n self.workers.stop(timeout=timeout, force=force)\n if stop_control_plane:\n self.control_plane.stop()\n self._started = False\n self._state = LifecycleState.STOPPED\n\n def status(self) -> dict[str, object]:\n self._refresh_state()\n return self.control_plane.snapshot(self)\n\n def current_health(self) -> HealthPayload:\n self._refresh_state()\n return self.health.payload(self._state, self.workers.healths())\n\n async def health_status(self) -> HealthPayload:\n return self.current_health()\n\n async def start_runtime(self) -> dict[str, object] | str:\n self._refresh_state()\n if self._started:\n return \"runtime already running\"\n if self._state == LifecycleState.STOPPING:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n\n self.start(start_control_plane=False)\n started = self._wait_for_state({LifecycleState.IDLE, LifecycleState.BUSY}, timeout=self.ACTION_TIMEOUT_SECONDS)\n if started:\n return self._action_detail(\"runtime started\", timed_out=False)\n return self._action_detail(\"runtime start is still in progress\", timed_out=True)\n\n async def stop_runtime(self) -> dict[str, object] | str:\n self._refresh_state()\n if not self._started:\n if self._state == LifecycleState.STOPPING:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n return \"runtime already stopped\"\n\n self._state = LifecycleState.STOPPING\n try:\n self.workers.stop(timeout=self.ACTION_TIMEOUT_SECONDS, force=False)\n except TimeoutError:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n\n self._started = False\n self._state = LifecycleState.STOPPED\n return self._action_detail(\"runtime stopped\", timed_out=False)\n\n async def runtime_status(self) -> str:\n self._refresh_state()\n return self._state.value\n\n def _register_core_services(self) -> None:\n if self._core_registered:\n return\n self.services.register(\"configuration\", self.configuration)\n self.services.register(\"traces\", self.traces)\n self.services.register(\"health\", self.health)\n self.services.register(\"logs\", self.logs)\n self.services.register(\"workers\", self.workers)\n self.services.register(\"control_plane\", self.control_plane)\n self._core_registered = True\n\n def _register_health_contributors(self) -> None:\n for contributor in self.registry.health_contributors:\n self.health.register(contributor)\n\n def _register_workers(self) -> None:\n if self._workers_registered:\n return\n for worker in self.registry.workers:\n self.workers.register(worker)\n self._workers_registered = True\n\n def _refresh_state(self) -> None:\n lifecycle = self.workers.lifecycle_state()\n\n if self._state == LifecycleState.STOPPING:\n if lifecycle == LifecycleState.STOPPED:\n self._started = False\n self._state = LifecycleState.STOPPED\n return\n\n if not self._started:\n if lifecycle == LifecycleState.STOPPED:\n self._state = LifecycleState.STOPPED\n return\n\n self._state = lifecycle\n\n def _wait_for_state(self, target_states: set[LifecycleState], *, timeout: float) -> bool:\n deadline = monotonic() + timeout\n while monotonic() < deadline:\n self._refresh_state()\n if self._state in target_states:\n return True\n sleep(self.ACTION_POLL_INTERVAL_SECONDS)\n self._refresh_state()\n return self._state in target_states\n\n def _action_detail(self, message: str, *, timed_out: bool) -> dict[str, object]:\n self._refresh_state()\n return {\n \"message\": message,\n \"state\": self._state.value,\n \"timed_out\": timed_out,\n \"workers\": self.workers.snapshot(),\n }", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/core/runtime.py:RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.core.runtime", - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "llm_answer": "Файл `src/app_runtime/core/runtime.py` содержит определение класса `RuntimeManager`, управляющего основными компонентами приложения во время его выполнения.\n\n## Важные сущности и их значение:\n- **`ConfigurationManager`, `ServiceContainer`, `TraceService`, `HealthRegistry`, `LogManager`, `WorkerSupervisor`, `ControlPlaneService`:** \n Эти классы представляют компоненты инфраструктуры, необходимые для работы приложения (конфигурация, сервисы, трассировка, здоровье системы, ведение логов, управление рабочими процессами и контрольная плоскость).\n \n- **`ModuleRegistry`:**\n Используется для регистрации модулей приложений, позволяя управлять ими централизованно.\n\n- **Параметры инициализации (`configuration`, `services`, `traces`, etc.):**\n Позволяют настраивать поведение экземпляра `RuntimeManager`.\n\n- **Методы класса:**\n - `_register_core_services()`: регистрирует основные службы, используемые приложением.\n - `register_module(module: ApplicationModule)`: позволяет зарегистрировать дополнительные модули приложения.\n\nЭтот класс является ключевым компонентом управления жизненным циклом приложения и обеспечивает интеграцию различных служб и компонентов в единое целое.", - "summary": { - "router": { - "intent": "CODE_QA", - "sub_intent": "OPEN_FILE", - "confidence": null - }, - "retrieval": { - "profile": "code", - "layers_hit": [ - "C0_SOURCE_CHUNKS" - ], - "evidence_sufficient": true - }, - "llm": { - "answer_status": "answered", - "groundedness": "grounded" - } - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "OPEN_FILE", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C0_SOURCE_CHUNKS" - ], - "symbol_kind_hint": "unknown", - "symbol_candidates": [], - "keyword_hints": [], - "path_hints": [ - "src/app_runtime/core/runtime.py" - ], - "path_scope": [ - "src/app_runtime/core/runtime.py" - ], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/app_runtime/core/runtime.py" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": false, - "max_distance": 2, - "top_k": 5 - } - } - }, - "execution": { - "executed_layers": [ - "C0_SOURCE_CHUNKS" - ], - "retrieval_mode_by_layer": { - "C0_SOURCE_CHUNKS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C0_SOURCE_CHUNKS": 200 - }, - "filters_by_layer": { - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src/app_runtime/core/runtime.py" - ], - "include_globs": [], - "exclude_globs": [], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Открой файл src/app_runtime/core/runtime.py", - "path_scope": [ - "src/app_runtime/core/runtime.py" - ], - "include_globs": [], - "exclude_globs": [], - "prefer_globs": [], - "top_k": 200, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src/app_runtime/core/runtime.py" - ], - "normalized_include_globs": [], - "normalized_exclude_globs": [], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 1, - "candidates_after_filter": 1 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "not_requested", - "resolved_symbol": null, - "alternatives": [] - }, - "layers": [ - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 1, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "router": 1, - "symbol_resolution": 0, - "retrieval_total": 102, - "retrieval_by_layer": { - "C0_SOURCE_CHUNKS": 102 - }, - "merge_rank": 0, - "prompt_build": 0, - "llm_call": 1863 - }, - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 555, - "evidence_rows": 1, - "evidence_chars": 6265 - }, - "evidence_summary": [ - { - "layer": "C0_SOURCE_CHUNKS", - "count": 1, - "unique_paths": 1 - } - ], - "prompt_template_id": "intent_code_qa_open_file_ru_v1", - "system_prompt_version": "v1" - }, - "router": { - "conversation_mode": "START", - "keyword_hints": [], - "path_scope": [ - "src/app_runtime/core/runtime.py" - ] - }, - "llm": { - "used_evidence_count": 1, - "missing_evidence_reason": null - } - }, - "run_info": { - "case_id": "plba-fullchain-open-file-runtime", - "mode": "full_chain", - "run_started_at": "2026-03-12T11:57:51", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - }, - "input_request": { - "text": "Открой файл src/app_runtime/core/runtime.py", - "normalized_query": "Открой файл src/app_runtime/core/runtime.py" - }, - "steps": [ - { - "step": "intent_router", - "input": { - "query": "Открой файл src/app_runtime/core/runtime.py" - }, - "output": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Открой файл src/app_runtime/core/runtime.py" - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "OPEN_FILE", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C0_SOURCE_CHUNKS" - ], - "symbol_kind_hint": "unknown", - "symbol_candidates": [], - "keyword_hints": [], - "path_hints": [ - "src/app_runtime/core/runtime.py" - ], - "path_scope": [ - "src/app_runtime/core/runtime.py" - ], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/app_runtime/core/runtime.py" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": false, - "max_distance": 2, - "top_k": 5 - } - } - }, - "timings_ms": { - "router": 1 - } - } - }, - { - "step": "retrieval", - "input": { - "query": "Открой файл src/app_runtime/core/runtime.py" - }, - "output": { - "symbol_resolution": { - "status": "not_requested", - "resolved_symbol": null, - "alternatives": [], - "confidence": 0.0 - }, - "rag_count": 1, - "rag_rows": [ - { - "path": "src/app_runtime/core/runtime.py", - "content": "class RuntimeManager:\n ACTION_TIMEOUT_SECONDS = 10.0\n ACTION_POLL_INTERVAL_SECONDS = 0.05\n\n def __init__(\n self,\n configuration: ConfigurationManager | None = None,\n services: ServiceContainer | None = None,\n traces: TraceService | None = None,\n health: HealthRegistry | None = None,\n logs: LogManager | None = None,\n workers: WorkerSupervisor | None = None,\n control_plane: ControlPlaneService | None = None,\n ) -> None:\n self.configuration = configuration or ConfigurationManager()\n self.services = services or ServiceContainer()\n self.traces = traces or TraceService()\n self.health = health or HealthRegistry()\n self.logs = logs or LogManager()\n self.workers = workers or WorkerSupervisor()\n self.control_plane = control_plane or ControlPlaneService()\n self.registry = ModuleRegistry(self.services)\n self._started = False\n self._state = LifecycleState.IDLE\n self._core_registered = False\n self._workers_registered = False\n self._register_core_services()\n\n def register_module(self, module: ApplicationModule) -> None:\n self.registry.register_module(module.name)\n module.register(self.registry)\n\n def add_config_file(self, path: str) -> FileConfigProvider:\n provider = FileConfigProvider(path)\n self.configuration.add_provider(provider)\n return provider\n\n def start(self, *, start_control_plane: bool = True) -> None:\n if self._started:\n return\n self._state = LifecycleState.STARTING\n config = self.configuration.load()\n self.logs.apply_config(config)\n self._register_health_contributors()\n self._register_workers()\n self.workers.start()\n if start_control_plane:\n self.control_plane.start(self)\n self._started = True\n self._refresh_state()\n\n def stop(self, timeout: float = 30.0, force: bool = False, stop_control_plane: bool = True) -> None:\n if not self._started:\n return\n self._state = LifecycleState.STOPPING\n self.workers.stop(timeout=timeout, force=force)\n if stop_control_plane:\n self.control_plane.stop()\n self._started = False\n self._state = LifecycleState.STOPPED\n\n def status(self) -> dict[str, object]:\n self._refresh_state()\n return self.control_plane.snapshot(self)\n\n def current_health(self) -> HealthPayload:\n self._refresh_state()\n return self.health.payload(self._state, self.workers.healths())\n\n async def health_status(self) -> HealthPayload:\n return self.current_health()\n\n async def start_runtime(self) -> dict[str, object] | str:\n self._refresh_state()\n if self._started:\n return \"runtime already running\"\n if self._state == LifecycleState.STOPPING:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n\n self.start(start_control_plane=False)\n started = self._wait_for_state({LifecycleState.IDLE, LifecycleState.BUSY}, timeout=self.ACTION_TIMEOUT_SECONDS)\n if started:\n return self._action_detail(\"runtime started\", timed_out=False)\n return self._action_detail(\"runtime start is still in progress\", timed_out=True)\n\n async def stop_runtime(self) -> dict[str, object] | str:\n self._refresh_state()\n if not self._started:\n if self._state == LifecycleState.STOPPING:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n return \"runtime already stopped\"\n\n self._state = LifecycleState.STOPPING\n try:\n self.workers.stop(timeout=self.ACTION_TIMEOUT_SECONDS, force=False)\n except TimeoutError:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n\n self._started = False\n self._state = LifecycleState.STOPPED\n return self._action_detail(\"runtime stopped\", timed_out=False)\n\n async def runtime_status(self) -> str:\n self._refresh_state()\n return self._state.value\n\n def _register_core_services(self) -> None:\n if self._core_registered:\n return\n self.services.register(\"configuration\", self.configuration)\n self.services.register(\"traces\", self.traces)\n self.services.register(\"health\", self.health)\n self.services.register(\"logs\", self.logs)\n self.services.register(\"workers\", self.workers)\n self.services.register(\"control_plane\", self.control_plane)\n self._core_registered = True\n\n def _register_health_contributors(self) -> None:\n for contributor in self.registry.health_contributors:\n self.health.register(contributor)\n\n def _register_workers(self) -> None:\n if self._workers_registered:\n return\n for worker in self.registry.workers:\n self.workers.register(worker)\n self._workers_registered = True\n\n def _refresh_state(self) -> None:\n lifecycle = self.workers.lifecycle_state()\n\n if self._state == LifecycleState.STOPPING:\n if lifecycle == LifecycleState.STOPPED:\n self._started = False\n self._state = LifecycleState.STOPPED\n return\n\n if not self._started:\n if lifecycle == LifecycleState.STOPPED:\n self._state = LifecycleState.STOPPED\n return\n\n self._state = lifecycle\n\n def _wait_for_state(self, target_states: set[LifecycleState], *, timeout: float) -> bool:\n deadline = monotonic() + timeout\n while monotonic() < deadline:\n self._refresh_state()\n if self._state in target_states:\n return True\n sleep(self.ACTION_POLL_INTERVAL_SECONDS)\n self._refresh_state()\n return self._state in target_states\n\n def _action_detail(self, message: str, *, timed_out: bool) -> dict[str, object]:\n self._refresh_state()\n return {\n \"message\": message,\n \"state\": self._state.value,\n \"timed_out\": timed_out,\n \"workers\": self.workers.snapshot(),\n }", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/core/runtime.py:RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.core.runtime", - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ] - }, - "diagnostics": { - "execution": { - "executed_layers": [ - "C0_SOURCE_CHUNKS" - ], - "retrieval_mode_by_layer": { - "C0_SOURCE_CHUNKS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C0_SOURCE_CHUNKS": 200 - }, - "filters_by_layer": { - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src/app_runtime/core/runtime.py" - ], - "include_globs": [], - "exclude_globs": [], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Открой файл src/app_runtime/core/runtime.py", - "path_scope": [ - "src/app_runtime/core/runtime.py" - ], - "include_globs": [], - "exclude_globs": [], - "prefer_globs": [], - "top_k": 200, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src/app_runtime/core/runtime.py" - ], - "normalized_include_globs": [], - "normalized_exclude_globs": [], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 1, - "candidates_after_filter": 1 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "not_requested", - "resolved_symbol": null, - "alternatives": [] - }, - "layers": [ - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 1, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "symbol_resolution": 0, - "retrieval_total": 102, - "retrieval_by_layer": { - "C0_SOURCE_CHUNKS": 102 - }, - "merge_rank": 0 - } - } - }, - { - "step": "llm_answer", - "input": { - "query": "Открой файл src/app_runtime/core/runtime.py", - "rag_count": 1 - }, - "output": { - "llm_answer": "Файл `src/app_runtime/core/runtime.py` содержит определение класса `RuntimeManager`, управляющего основными компонентами приложения во время его выполнения.\n\n## Важные сущности и их значение:\n- **`ConfigurationManager`, `ServiceContainer`, `TraceService`, `HealthRegistry`, `LogManager`, `WorkerSupervisor`, `ControlPlaneService`:** \n Эти классы представляют компоненты инфраструктуры, необходимые для работы приложения (конфигурация, сервисы, трассировка, здоровье системы, ведение логов, управление рабочими процессами и контрольная плоскость).\n \n- **`ModuleRegistry`:**\n Используется для регистрации модулей приложений, позволяя управлять ими централизованно.\n\n- **Параметры инициализации (`configuration`, `services`, `traces`, etc.):**\n Позволяют настраивать поведение экземпляра `RuntimeManager`.\n\n- **Методы класса:**\n - `_register_core_services()`: регистрирует основные службы, используемые приложением.\n - `register_module(module: ApplicationModule)`: позволяет зарегистрировать дополнительные модули приложения.\n\nЭтот класс является ключевым компонентом управления жизненным циклом приложения и обеспечивает интеграцию различных служб и компонентов в единое целое." - }, - "diagnostics": { - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 555, - "evidence_rows": 1, - "evidence_chars": 6265 - }, - "evidence_summary": [ - { - "layer": "C0_SOURCE_CHUNKS", - "count": 1, - "unique_paths": 1 - } - ], - "prompt_template_id": "intent_code_qa_open_file_ru_v1", - "system_prompt_version": "v1" - }, - "timings_ms": { - "prompt_build": 0, - "llm_call": 1863 - } - } - } - ] - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents/20260312_115751/full_chain_plba_code_subintents_plba-fullchain-open-file-runtime.md b/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents/20260312_115751/full_chain_plba_code_subintents_plba-fullchain-open-file-runtime.md deleted file mode 100644 index 792e334..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents/20260312_115751/full_chain_plba_code_subintents_plba-fullchain-open-file-runtime.md +++ /dev/null @@ -1,30 +0,0 @@ -# plba-fullchain-open-file-runtime - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_subintents.yaml -- runner: runtime -- mode: full_chain -- passed: True - -## Query -Открой файл src/app_runtime/core/runtime.py - -## Actual -{ - "intent": "CODE_QA", - "sub_intent": "OPEN_FILE", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 1, - "llm_answer": "Файл `src/app_runtime/core/runtime.py` содержит определение класса `RuntimeManager`, управляющего основными компонентами приложения во время его выполнения.\n\n## Важные сущности и их значение:\n- **`ConfigurationManager`, `ServiceContainer`, `TraceService`, `HealthRegistry`, `LogManager`, `WorkerSupervisor`, `ControlPlaneService`:** \n Эти классы представляют компоненты инфраструктуры, необходимые для работы приложения (конфигурация, сервисы, трассировка, здоровье системы, ведение логов, управление рабочими процессами и контрольная плоскость).\n \n- **`ModuleRegistry`:**\n Используется для регистрации модулей приложений, позволяя управлять ими централизованно.\n\n- **Параметры инициализации (`configuration`, `services`, `traces`, etc.):**\n Позволяют настраивать поведение экземпляра `RuntimeManager`.\n\n- **Методы класса:**\n - `_register_core_services()`: регистрирует основные службы, используемые приложением.\n - `register_module(module: ApplicationModule)`: позволяет зарегистрировать дополнительные модули приложения.\n\nЭтот класс является ключевым компонентом управления жизненным циклом приложения и обеспечивает интеграцию различных служб и компонентов в единое целое.", - "answer_mode": "answered", - "path_scope": [ - "src/app_runtime/core/runtime.py" - ], - "symbol_candidates": [], - "layers": [ - "C0_SOURCE_CHUNKS" - ] -} - -## Mismatches -- none \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents/20260312_115751/full_chain_plba_code_subintents_plba-fullchain-trace-flow-runtime-manager.json b/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents/20260312_115751/full_chain_plba_code_subintents_plba-fullchain-trace-flow-runtime-manager.json deleted file mode 100644 index 4ac1612..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents/20260312_115751/full_chain_plba_code_subintents_plba-fullchain-trace-flow-runtime-manager.json +++ /dev/null @@ -1,2964 +0,0 @@ -{ - "case_id": "plba-fullchain-trace-flow-runtime-manager", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_subintents.yaml", - "runner": "runtime", - "mode": "full_chain", - "actual": { - "intent": "CODE_QA", - "sub_intent": "TRACE_FLOW", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 23, - "llm_answer": "## Шаг 1: Инициализация потока выполнения\n\n### Источник начала потока:\nПроцесс начинается с вызова конструктора класса `RuntimeManager` (`__init__`) из внешнего контекста.\n\n### Слой информации: C2_DEPENDENCY_GRAPH\nВызовы метода `RuntimeManager.__init__` зависят от следующих методов и атрибутов:\n- `RuntimeManager.configuration`\n- `RuntimeManager.add_config_file`\n- `RuntimeManager.services`\n- Сам метод `RuntimeManager.__init__`\n\nЭти зависимости указывают на то, что при инициализации `RuntimeManager` происходит конфигурирование и настройка различных сервисов и конфигураций.\n\n## Шаг 2: Детали внутренней логики\n\n### Слой информации: C0_SOURCE_CHUNKS\nРассмотрим подробнее метод `__init__`:\n```python\ndef __init__(self,\n configuration: ConfigurationManager | None = None,\n services: ServiceContainer | None = None,\n traces: TraceService | None = None,\n health: HealthRegistry | None = None,\n logs: LogManager | None = None,\n workers: WorkerSupervisor | None = None,\n control_plane: ControlPlaneService | None = None):\n```\n\nПри вызове конструктора создаются и заполняются следующие поля объекта `RuntimeManager`:\n- `configuration`: объект конфигурации, если передан, иначе создается экземпляр `ConfigurationManager`.\n- `services`: контейнер сервисов, если передан, иначе создается экземпляр `ServiceContainer`.\n- `traces`, `health`, `logs`, `workers`, `control_plane`: соответствующие сервисы, которые либо передаются извне, либо создаются внутри.\n\n## Шаг 3: Регистрация модулей и состояние жизненного цикла\n\nПосле создания экземпляра класса выполняется регистрация внутренних компонентов и управление состоянием жизненного цикла:\n```python\nself.registry = ModuleRegistry(self.services)\nself._started = False\nself._state = LifecycleState.IDLE\nself._core_registered = False\nself._workers_registered = False\nself._register_core_services()\n```\n\nЗдесь создаётся реестр модулей (`ModuleRegistry`), устанавливаются начальные значения для флагов состояния системы и вызывается внутренняя функция `_register_core_services()`.\n\n## Шаг 4: Поток данных и завершение\n\nПосле инициализации и настройки, объект `RuntimeManager` готов к дальнейшей работе, управляя регистрацией и активацией сервисов и компонентов.\n\n### Итоговый путь выполнения:\n1. Внешний контекст вызывает конструктор `RuntimeManager`.\n2. Производится настройка основных атрибутов и служб (`configuration`, `services`, `traces`, etc.).\n3. Запускается инициализация модуля реестра и контрольных состояний системы.\n\n### Заключение:\nПоток выполнения начинается с вызова конструктора `RuntimeManager`, продолжается настройкой базовых атрибутов и завершается начальной регистрацией системных модулей и установкой начальных состояний системы. \n\nНа текущий момент не обнаружено явных пробелов или недостающих данных в потоке выполнения.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "RuntimeManager" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "passed": true, - "mismatches": [], - "details": { - "case_id": "plba-fullchain-trace-flow-runtime-manager", - "text": "Покажи поток выполнения RuntimeManager", - "mode": "full_chain", - "run_started_at": "2026-03-12T11:57:51", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Покажи поток выполнения RuntimeManager", - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "RuntimeManager", - "alternatives": [ - "RuntimeManager" - ], - "confidence": 0.99 - }, - "rag_count": 23, - "rag_rows": [ - { - "path": "src/app_runtime/core/runtime.py", - "content": "class RuntimeManager\nRuntimeManager", - "layer": "C1_SYMBOL_CATALOG", - "title": "RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "7e4a9381328c5803bbc6179458612fc4e947d928aa7bf8b4b2bebb2c8592f758", - "qname": "RuntimeManager", - "kind": "class", - "signature": "RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.core.runtime", - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests manager\n- orchestrates role-like calls (4)\n- reads and writes state attributes\n- participates in dataflow slices (50)", - "layer": "C4_SEMANTIC_ROLES", - "title": "RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 43, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "7e4a9381328c5803bbc6179458612fc4e947d928aa7bf8b4b2bebb2c8592f758", - "symbol_name": "RuntimeManager", - "qname": "RuntimeManager", - "role": "pipeline_stage", - "confidence": 0.67, - "dataflow_participation": 50, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "ControlChannel\nrole: model\n\nResponsibilities:\n- default model role", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlChannel", - "span_start": 21, - "span_end": 28, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 40, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "cfcfe9a311d3a2dbdaf32ac4ccd73c0eb9a117f830591a1c0867ee97d46204ff", - "symbol_name": "ControlChannel", - "qname": "ControlChannel", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "ControlActionSet\nrole: model\n\nResponsibilities:\n- default model role", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlActionSet", - "span_start": 14, - "span_end": 18, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 40, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "46eb026cb3313415ec47b82dd22f84f4d112c9d987e8b1716dcb0baa1cce8988", - "symbol_name": "ControlActionSet", - "qname": "ControlActionSet", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests service\n- reads and writes state attributes\n- participates in dataflow slices (5)", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlPlaneService", - "span_start": 12, - "span_end": 52, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 68, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "b13471e5916986dccffb53fab613812842965705e6b3a89ae549d30c9e91e9aa", - "symbol_name": "ControlPlaneService", - "qname": "ControlPlaneService", - "role": "pipeline_stage", - "confidence": 0.57, - "dataflow_participation": 5, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_runner.py", - "content": "UvicornThreadRunner\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (24)", - "layer": "C4_SEMANTIC_ROLES", - "title": "UvicornThreadRunner", - "span_start": 10, - "span_end": 61, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 11, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "fd55630045a02100df8877ac27d951ee08617d4598764394d48cb51fe067476a", - "symbol_name": "UvicornThreadRunner", - "qname": "UvicornThreadRunner", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 24, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "3779fdd2878b770e789a35bb2a89c9d79f13b61c26d7db1b3b683f9bb9e1623f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (10)", - "layer": "C4_SEMANTIC_ROLES", - "title": "HttpControlChannel", - "span_start": 12, - "span_end": 57, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 21, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "1c9fbdc24819e5604c26ea55428a74310f03a03e1af197ed84846af61e42fdb0", - "symbol_name": "HttpControlChannel", - "qname": "HttpControlChannel", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 10, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "HttpControlAppFactory\nrole: factory\n\nResponsibilities:\n- name suffix suggests factory", - "layer": "C4_SEMANTIC_ROLES", - "title": "HttpControlAppFactory", - "span_start": 15, - "span_end": 53, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 39, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "9b3502a5fb408b273223db13264349cf500de24915b6c649d9ea8970d0dfd8e0", - "symbol_name": "HttpControlAppFactory", - "qname": "HttpControlAppFactory", - "role": "factory", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/persistence/workflow_persistence.py", - "content": "WorkflowPersistence\nrole: pipeline_stage\n\nResponsibilities:\n- orchestrates role-like calls (2)\n- reads and writes state attributes\n- participates in dataflow slices (16)", - "layer": "C4_SEMANTIC_ROLES", - "title": "WorkflowPersistence", - "span_start": 8, - "span_end": 54, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 15, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "7bd01ee45cf31f2d5c2e3e51656254860ac785d10cef9e0852cd4fba90857bae", - "symbol_name": "WorkflowPersistence", - "qname": "WorkflowPersistence", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 16, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "80e9410ddc639789b4353c2a1a757ba8d0d5b5bb6075b0b263b61551f04ae1f0", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager.add_config_file", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 32, - "span_end": 52, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "a23b8a11ebdb12708b60c96ea12a69f7f042082f1adfddd572444e246d81d167", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "57ffbd4f0d9fdf3507c2b8624312ce211f3d02fdf86a57a8ec90778d8a7b498d", - "dst_ref": "RuntimeManager.add_config_file", - "resolution": "resolved", - "slice_id": "a23b8a11ebdb12708b60c96ea12a69f7f042082f1adfddd572444e246d81d167", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager.add_config_file" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "57ffbd4f0d9fdf3507c2b8624312ce211f3d02fdf86a57a8ec90778d8a7b498d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.services\n -> RuntimeManager.__init__", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 33, - "span_end": 39, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "d43af85989222ee6d788ce418cdcb217c7ff044cfb915e3bdbd184417dc7bd61", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "dst_ref": "RuntimeManager.__init__", - "resolution": "resolved", - "slice_id": "d43af85989222ee6d788ce418cdcb217c7ff044cfb915e3bdbd184417dc7bd61", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.services", - "RuntimeManager.__init__" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.stop", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 25, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d", - "dst_ref": "ControlPlaneService.stop", - "resolution": "resolved", - "slice_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.stop" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._stop_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 51, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a", - "dst_ref": "ControlPlaneService._stop_async", - "resolution": "resolved", - "slice_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._stop_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager.start", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 32, - "span_end": 59, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "98312ace7fc62b1c7194c5aa1732b6ef736eae1668a3a120dd1ecd5ab1d64f7a", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "77a7b260193018845e4e204df094ab89cfd7c82ee4e822b3a83ad4cd945f9cb1", - "dst_ref": "RuntimeManager.start", - "resolution": "resolved", - "slice_id": "98312ace7fc62b1c7194c5aa1732b6ef736eae1668a3a120dd1ecd5ab1d64f7a", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager.start" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "77a7b260193018845e4e204df094ab89cfd7c82ee4e822b3a83ad4cd945f9cb1" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager._register_core_services", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 32, - "span_end": 127, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "3e5811f3b511fa0cabe363f5d01f2ac5fa039bc8b93f7ee108323e1f5f45a293", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "972d6057a6caac9cf31ebc1e29c6f39f71b10d4cc170dec57cf875ba458549c6", - "dst_ref": "RuntimeManager._register_core_services", - "resolution": "resolved", - "slice_id": "3e5811f3b511fa0cabe363f5d01f2ac5fa039bc8b93f7ee108323e1f5f45a293", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager._register_core_services" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "972d6057a6caac9cf31ebc1e29c6f39f71b10d4cc170dec57cf875ba458549c6" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.register_channel", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 17, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957", - "dst_ref": "ControlPlaneService.register_channel", - "resolution": "resolved", - "slice_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.register_channel" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.start", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 20, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154", - "dst_ref": "ControlPlaneService.start", - "resolution": "resolved", - "slice_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.start" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._start_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 47, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517", - "dst_ref": "ControlPlaneService._start_async", - "resolution": "resolved", - "slice_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._start_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.services\n -> RuntimeManager._register_core_services", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 33, - "span_end": 127, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "aac6f9dda73963b977083a892bee39a48eca4fbd7404787e022ecf4ebedec65d", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "972d6057a6caac9cf31ebc1e29c6f39f71b10d4cc170dec57cf875ba458549c6", - "dst_ref": "RuntimeManager._register_core_services", - "resolution": "resolved", - "slice_id": "aac6f9dda73963b977083a892bee39a48eca4fbd7404787e022ecf4ebedec65d", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.services", - "RuntimeManager._register_core_services" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "972d6057a6caac9cf31ebc1e29c6f39f71b10d4cc170dec57cf875ba458549c6" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "class RuntimeManager:\n ACTION_TIMEOUT_SECONDS = 10.0\n ACTION_POLL_INTERVAL_SECONDS = 0.05\n\n def __init__(\n self,\n configuration: ConfigurationManager | None = None,\n services: ServiceContainer | None = None,\n traces: TraceService | None = None,\n health: HealthRegistry | None = None,\n logs: LogManager | None = None,\n workers: WorkerSupervisor | None = None,\n control_plane: ControlPlaneService | None = None,\n ) -> None:\n self.configuration = configuration or ConfigurationManager()\n self.services = services or ServiceContainer()\n self.traces = traces or TraceService()\n self.health = health or HealthRegistry()\n self.logs = logs or LogManager()\n self.workers = workers or WorkerSupervisor()\n self.control_plane = control_plane or ControlPlaneService()\n self.registry = ModuleRegistry(self.services)\n self._started = False\n self._state = LifecycleState.IDLE\n self._core_registered = False\n self._workers_registered = False\n self._register_core_services()\n\n def register_module(self, module: ApplicationModule) -> None:\n self.registry.register_module(module.name)\n module.register(self.registry)\n\n def add_config_file(self, path: str) -> FileConfigProvider:\n provider = FileConfigProvider(path)\n self.configuration.add_provider(provider)\n return provider\n\n def start(self, *, start_control_plane: bool = True) -> None:\n if self._started:\n return\n self._state = LifecycleState.STARTING\n config = self.configuration.load()\n self.logs.apply_config(config)\n self._register_health_contributors()\n self._register_workers()\n self.workers.start()\n if start_control_plane:\n self.control_plane.start(self)\n self._started = True\n self._refresh_state()\n\n def stop(self, timeout: float = 30.0, force: bool = False, stop_control_plane: bool = True) -> None:\n if not self._started:\n return\n self._state = LifecycleState.STOPPING\n self.workers.stop(timeout=timeout, force=force)\n if stop_control_plane:\n self.control_plane.stop()\n self._started = False\n self._state = LifecycleState.STOPPED\n\n def status(self) -> dict[str, object]:\n self._refresh_state()\n return self.control_plane.snapshot(self)\n\n def current_health(self) -> HealthPayload:\n self._refresh_state()\n return self.health.payload(self._state, self.workers.healths())\n\n async def health_status(self) -> HealthPayload:\n return self.current_health()\n\n async def start_runtime(self) -> dict[str, object] | str:\n self._refresh_state()\n if self._started:\n return \"runtime already running\"\n if self._state == LifecycleState.STOPPING:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n\n self.start(start_control_plane=False)\n started = self._wait_for_state({LifecycleState.IDLE, LifecycleState.BUSY}, timeout=self.ACTION_TIMEOUT_SECONDS)\n if started:\n return self._action_detail(\"runtime started\", timed_out=False)\n return self._action_detail(\"runtime start is still in progress\", timed_out=True)\n\n async def stop_runtime(self) -> dict[str, object] | str:\n self._refresh_state()\n if not self._started:\n if self._state == LifecycleState.STOPPING:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n return \"runtime already stopped\"\n\n self._state = LifecycleState.STOPPING\n try:\n self.workers.stop(timeout=self.ACTION_TIMEOUT_SECONDS, force=False)\n except TimeoutError:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n\n self._started = False\n self._state = LifecycleState.STOPPED\n return self._action_detail(\"runtime stopped\", timed_out=False)\n\n async def runtime_status(self) -> str:\n self._refresh_state()\n return self._state.value\n\n def _register_core_services(self) -> None:\n if self._core_registered:\n return\n self.services.register(\"configuration\", self.configuration)\n self.services.register(\"traces\", self.traces)\n self.services.register(\"health\", self.health)\n self.services.register(\"logs\", self.logs)\n self.services.register(\"workers\", self.workers)\n self.services.register(\"control_plane\", self.control_plane)\n self._core_registered = True\n\n def _register_health_contributors(self) -> None:\n for contributor in self.registry.health_contributors:\n self.health.register(contributor)\n\n def _register_workers(self) -> None:\n if self._workers_registered:\n return\n for worker in self.registry.workers:\n self.workers.register(worker)\n self._workers_registered = True\n\n def _refresh_state(self) -> None:\n lifecycle = self.workers.lifecycle_state()\n\n if self._state == LifecycleState.STOPPING:\n if lifecycle == LifecycleState.STOPPED:\n self._started = False\n self._state = LifecycleState.STOPPED\n return\n\n if not self._started:\n if lifecycle == LifecycleState.STOPPED:\n self._state = LifecycleState.STOPPED\n return\n\n self._state = lifecycle\n\n def _wait_for_state(self, target_states: set[LifecycleState], *, timeout: float) -> bool:\n deadline = monotonic() + timeout\n while monotonic() < deadline:\n self._refresh_state()\n if self._state in target_states:\n return True\n sleep(self.ACTION_POLL_INTERVAL_SECONDS)\n self._refresh_state()\n return self._state in target_states\n\n def _action_detail(self, message: str, *, timed_out: bool) -> dict[str, object]:\n self._refresh_state()\n return {\n \"message\": message,\n \"state\": self._state.value,\n \"timed_out\": timed_out,\n \"workers\": self.workers.snapshot(),\n }", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/core/runtime.py:RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.core.runtime", - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "llm_answer": "## Шаг 1: Инициализация потока выполнения\n\n### Источник начала потока:\nПроцесс начинается с вызова конструктора класса `RuntimeManager` (`__init__`) из внешнего контекста.\n\n### Слой информации: C2_DEPENDENCY_GRAPH\nВызовы метода `RuntimeManager.__init__` зависят от следующих методов и атрибутов:\n- `RuntimeManager.configuration`\n- `RuntimeManager.add_config_file`\n- `RuntimeManager.services`\n- Сам метод `RuntimeManager.__init__`\n\nЭти зависимости указывают на то, что при инициализации `RuntimeManager` происходит конфигурирование и настройка различных сервисов и конфигураций.\n\n## Шаг 2: Детали внутренней логики\n\n### Слой информации: C0_SOURCE_CHUNKS\nРассмотрим подробнее метод `__init__`:\n```python\ndef __init__(self,\n configuration: ConfigurationManager | None = None,\n services: ServiceContainer | None = None,\n traces: TraceService | None = None,\n health: HealthRegistry | None = None,\n logs: LogManager | None = None,\n workers: WorkerSupervisor | None = None,\n control_plane: ControlPlaneService | None = None):\n```\n\nПри вызове конструктора создаются и заполняются следующие поля объекта `RuntimeManager`:\n- `configuration`: объект конфигурации, если передан, иначе создается экземпляр `ConfigurationManager`.\n- `services`: контейнер сервисов, если передан, иначе создается экземпляр `ServiceContainer`.\n- `traces`, `health`, `logs`, `workers`, `control_plane`: соответствующие сервисы, которые либо передаются извне, либо создаются внутри.\n\n## Шаг 3: Регистрация модулей и состояние жизненного цикла\n\nПосле создания экземпляра класса выполняется регистрация внутренних компонентов и управление состоянием жизненного цикла:\n```python\nself.registry = ModuleRegistry(self.services)\nself._started = False\nself._state = LifecycleState.IDLE\nself._core_registered = False\nself._workers_registered = False\nself._register_core_services()\n```\n\nЗдесь создаётся реестр модулей (`ModuleRegistry`), устанавливаются начальные значения для флагов состояния системы и вызывается внутренняя функция `_register_core_services()`.\n\n## Шаг 4: Поток данных и завершение\n\nПосле инициализации и настройки, объект `RuntimeManager` готов к дальнейшей работе, управляя регистрацией и активацией сервисов и компонентов.\n\n### Итоговый путь выполнения:\n1. Внешний контекст вызывает конструктор `RuntimeManager`.\n2. Производится настройка основных атрибутов и служб (`configuration`, `services`, `traces`, etc.).\n3. Запускается инициализация модуля реестра и контрольных состояний системы.\n\n### Заключение:\nПоток выполнения начинается с вызова конструктора `RuntimeManager`, продолжается настройкой базовых атрибутов и завершается начальной регистрацией системных модулей и установкой начальных состояний системы. \n\nНа текущий момент не обнаружено явных пробелов или недостающих данных в потоке выполнения.", - "summary": { - "router": { - "intent": "CODE_QA", - "sub_intent": "TRACE_FLOW", - "confidence": null - }, - "retrieval": { - "profile": "code", - "layers_hit": [ - "C0_SOURCE_CHUNKS", - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS", - "C4_SEMANTIC_ROLES" - ], - "evidence_sufficient": true - }, - "llm": { - "answer_status": "answered", - "groundedness": "grounded" - } - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "TRACE_FLOW", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "RuntimeManager" - ], - "keyword_hints": [ - "RuntimeManager" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C0_SOURCE_CHUNKS": "exact_path_fetch", - "C4_SEMANTIC_ROLES": "exact_path_fetch", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C3_ENTRYPOINTS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 8, - "C4_SEMANTIC_ROLES": 8, - "C2_DEPENDENCY_GRAPH": 10, - "C3_ENTRYPOINTS": 10 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C4_SEMANTIC_ROLES": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Покажи поток выполнения RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C4_SEMANTIC_ROLES", - "query": "Покажи поток выполнения RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "Покажи поток выполнения RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 10, - "ranking_profile": "code" - }, - { - "layer": "C3_ENTRYPOINTS", - "query": "Покажи поток выполнения RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 10, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 1, - "candidates_after_filter": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 10, - "candidates_after_filter": 10 - }, - { - "layer": "C3_ENTRYPOINTS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 3, - "candidates_after_filter": 3 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "RuntimeManager", - "alternatives": [ - "RuntimeManager" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C4_SEMANTIC_ROLES", - "status": "hit", - "hit_count": 8, - "fail_reason": null - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 10, - "fail_reason": null - }, - { - "layer": "C3_ENTRYPOINTS", - "status": "hit", - "hit_count": 3, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "router": 1, - "symbol_resolution": 0, - "retrieval_total": 160, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 53, - "C0_SOURCE_CHUNKS": 22, - "C4_SEMANTIC_ROLES": 17, - "C2_DEPENDENCY_GRAPH": 56, - "C3_ENTRYPOINTS": 9 - }, - "merge_rank": 20, - "prompt_build": 0, - "llm_call": 4403 - }, - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 766, - "evidence_rows": 23, - "evidence_chars": 8302 - }, - "evidence_summary": [ - { - "layer": "C1_SYMBOL_CATALOG", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "count": 8, - "unique_paths": 7 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "count": 10, - "unique_paths": 2 - }, - { - "layer": "C3_ENTRYPOINTS", - "count": 3, - "unique_paths": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 1, - "unique_paths": 1 - } - ], - "prompt_template_id": "intent_code_qa_trace_flow_ru_v1", - "system_prompt_version": "v1" - }, - "router": { - "conversation_mode": "START", - "keyword_hints": [ - "RuntimeManager" - ], - "path_scope": [] - }, - "llm": { - "used_evidence_count": 23, - "missing_evidence_reason": null - } - }, - "run_info": { - "case_id": "plba-fullchain-trace-flow-runtime-manager", - "mode": "full_chain", - "run_started_at": "2026-03-12T11:57:51", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - }, - "input_request": { - "text": "Покажи поток выполнения RuntimeManager", - "normalized_query": "Покажи поток выполнения RuntimeManager" - }, - "steps": [ - { - "step": "intent_router", - "input": { - "query": "Покажи поток выполнения RuntimeManager" - }, - "output": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Покажи поток выполнения RuntimeManager" - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "TRACE_FLOW", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "RuntimeManager" - ], - "keyword_hints": [ - "RuntimeManager" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "timings_ms": { - "router": 1 - } - } - }, - { - "step": "retrieval", - "input": { - "query": "Покажи поток выполнения RuntimeManager" - }, - "output": { - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "RuntimeManager", - "alternatives": [ - "RuntimeManager" - ], - "confidence": 0.99 - }, - "rag_count": 23, - "rag_rows": [ - { - "path": "src/app_runtime/core/runtime.py", - "content": "class RuntimeManager\nRuntimeManager", - "layer": "C1_SYMBOL_CATALOG", - "title": "RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "7e4a9381328c5803bbc6179458612fc4e947d928aa7bf8b4b2bebb2c8592f758", - "qname": "RuntimeManager", - "kind": "class", - "signature": "RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.core.runtime", - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests manager\n- orchestrates role-like calls (4)\n- reads and writes state attributes\n- participates in dataflow slices (50)", - "layer": "C4_SEMANTIC_ROLES", - "title": "RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 43, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "7e4a9381328c5803bbc6179458612fc4e947d928aa7bf8b4b2bebb2c8592f758", - "symbol_name": "RuntimeManager", - "qname": "RuntimeManager", - "role": "pipeline_stage", - "confidence": 0.67, - "dataflow_participation": 50, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "ControlChannel\nrole: model\n\nResponsibilities:\n- default model role", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlChannel", - "span_start": 21, - "span_end": 28, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 40, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "cfcfe9a311d3a2dbdaf32ac4ccd73c0eb9a117f830591a1c0867ee97d46204ff", - "symbol_name": "ControlChannel", - "qname": "ControlChannel", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "ControlActionSet\nrole: model\n\nResponsibilities:\n- default model role", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlActionSet", - "span_start": 14, - "span_end": 18, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 40, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "46eb026cb3313415ec47b82dd22f84f4d112c9d987e8b1716dcb0baa1cce8988", - "symbol_name": "ControlActionSet", - "qname": "ControlActionSet", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests service\n- reads and writes state attributes\n- participates in dataflow slices (5)", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlPlaneService", - "span_start": 12, - "span_end": 52, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 68, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "b13471e5916986dccffb53fab613812842965705e6b3a89ae549d30c9e91e9aa", - "symbol_name": "ControlPlaneService", - "qname": "ControlPlaneService", - "role": "pipeline_stage", - "confidence": 0.57, - "dataflow_participation": 5, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_runner.py", - "content": "UvicornThreadRunner\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (24)", - "layer": "C4_SEMANTIC_ROLES", - "title": "UvicornThreadRunner", - "span_start": 10, - "span_end": 61, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 11, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "fd55630045a02100df8877ac27d951ee08617d4598764394d48cb51fe067476a", - "symbol_name": "UvicornThreadRunner", - "qname": "UvicornThreadRunner", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 24, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "3779fdd2878b770e789a35bb2a89c9d79f13b61c26d7db1b3b683f9bb9e1623f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (10)", - "layer": "C4_SEMANTIC_ROLES", - "title": "HttpControlChannel", - "span_start": 12, - "span_end": 57, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 21, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "1c9fbdc24819e5604c26ea55428a74310f03a03e1af197ed84846af61e42fdb0", - "symbol_name": "HttpControlChannel", - "qname": "HttpControlChannel", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 10, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "HttpControlAppFactory\nrole: factory\n\nResponsibilities:\n- name suffix suggests factory", - "layer": "C4_SEMANTIC_ROLES", - "title": "HttpControlAppFactory", - "span_start": 15, - "span_end": 53, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 39, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "9b3502a5fb408b273223db13264349cf500de24915b6c649d9ea8970d0dfd8e0", - "symbol_name": "HttpControlAppFactory", - "qname": "HttpControlAppFactory", - "role": "factory", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/persistence/workflow_persistence.py", - "content": "WorkflowPersistence\nrole: pipeline_stage\n\nResponsibilities:\n- orchestrates role-like calls (2)\n- reads and writes state attributes\n- participates in dataflow slices (16)", - "layer": "C4_SEMANTIC_ROLES", - "title": "WorkflowPersistence", - "span_start": 8, - "span_end": 54, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 15, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "7bd01ee45cf31f2d5c2e3e51656254860ac785d10cef9e0852cd4fba90857bae", - "symbol_name": "WorkflowPersistence", - "qname": "WorkflowPersistence", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 16, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "80e9410ddc639789b4353c2a1a757ba8d0d5b5bb6075b0b263b61551f04ae1f0", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager.add_config_file", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 32, - "span_end": 52, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "a23b8a11ebdb12708b60c96ea12a69f7f042082f1adfddd572444e246d81d167", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "57ffbd4f0d9fdf3507c2b8624312ce211f3d02fdf86a57a8ec90778d8a7b498d", - "dst_ref": "RuntimeManager.add_config_file", - "resolution": "resolved", - "slice_id": "a23b8a11ebdb12708b60c96ea12a69f7f042082f1adfddd572444e246d81d167", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager.add_config_file" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "57ffbd4f0d9fdf3507c2b8624312ce211f3d02fdf86a57a8ec90778d8a7b498d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.services\n -> RuntimeManager.__init__", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 33, - "span_end": 39, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "d43af85989222ee6d788ce418cdcb217c7ff044cfb915e3bdbd184417dc7bd61", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "dst_ref": "RuntimeManager.__init__", - "resolution": "resolved", - "slice_id": "d43af85989222ee6d788ce418cdcb217c7ff044cfb915e3bdbd184417dc7bd61", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.services", - "RuntimeManager.__init__" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.stop", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 25, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d", - "dst_ref": "ControlPlaneService.stop", - "resolution": "resolved", - "slice_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.stop" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._stop_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 51, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a", - "dst_ref": "ControlPlaneService._stop_async", - "resolution": "resolved", - "slice_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._stop_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager.start", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 32, - "span_end": 59, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "98312ace7fc62b1c7194c5aa1732b6ef736eae1668a3a120dd1ecd5ab1d64f7a", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "77a7b260193018845e4e204df094ab89cfd7c82ee4e822b3a83ad4cd945f9cb1", - "dst_ref": "RuntimeManager.start", - "resolution": "resolved", - "slice_id": "98312ace7fc62b1c7194c5aa1732b6ef736eae1668a3a120dd1ecd5ab1d64f7a", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager.start" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "77a7b260193018845e4e204df094ab89cfd7c82ee4e822b3a83ad4cd945f9cb1" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager._register_core_services", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 32, - "span_end": 127, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "3e5811f3b511fa0cabe363f5d01f2ac5fa039bc8b93f7ee108323e1f5f45a293", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "972d6057a6caac9cf31ebc1e29c6f39f71b10d4cc170dec57cf875ba458549c6", - "dst_ref": "RuntimeManager._register_core_services", - "resolution": "resolved", - "slice_id": "3e5811f3b511fa0cabe363f5d01f2ac5fa039bc8b93f7ee108323e1f5f45a293", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager._register_core_services" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "972d6057a6caac9cf31ebc1e29c6f39f71b10d4cc170dec57cf875ba458549c6" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.register_channel", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 17, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957", - "dst_ref": "ControlPlaneService.register_channel", - "resolution": "resolved", - "slice_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.register_channel" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.start", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 20, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154", - "dst_ref": "ControlPlaneService.start", - "resolution": "resolved", - "slice_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.start" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._start_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 47, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517", - "dst_ref": "ControlPlaneService._start_async", - "resolution": "resolved", - "slice_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._start_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.services\n -> RuntimeManager._register_core_services", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 33, - "span_end": 127, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "aac6f9dda73963b977083a892bee39a48eca4fbd7404787e022ecf4ebedec65d", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "972d6057a6caac9cf31ebc1e29c6f39f71b10d4cc170dec57cf875ba458549c6", - "dst_ref": "RuntimeManager._register_core_services", - "resolution": "resolved", - "slice_id": "aac6f9dda73963b977083a892bee39a48eca4fbd7404787e022ecf4ebedec65d", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.services", - "RuntimeManager._register_core_services" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "972d6057a6caac9cf31ebc1e29c6f39f71b10d4cc170dec57cf875ba458549c6" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "class RuntimeManager:\n ACTION_TIMEOUT_SECONDS = 10.0\n ACTION_POLL_INTERVAL_SECONDS = 0.05\n\n def __init__(\n self,\n configuration: ConfigurationManager | None = None,\n services: ServiceContainer | None = None,\n traces: TraceService | None = None,\n health: HealthRegistry | None = None,\n logs: LogManager | None = None,\n workers: WorkerSupervisor | None = None,\n control_plane: ControlPlaneService | None = None,\n ) -> None:\n self.configuration = configuration or ConfigurationManager()\n self.services = services or ServiceContainer()\n self.traces = traces or TraceService()\n self.health = health or HealthRegistry()\n self.logs = logs or LogManager()\n self.workers = workers or WorkerSupervisor()\n self.control_plane = control_plane or ControlPlaneService()\n self.registry = ModuleRegistry(self.services)\n self._started = False\n self._state = LifecycleState.IDLE\n self._core_registered = False\n self._workers_registered = False\n self._register_core_services()\n\n def register_module(self, module: ApplicationModule) -> None:\n self.registry.register_module(module.name)\n module.register(self.registry)\n\n def add_config_file(self, path: str) -> FileConfigProvider:\n provider = FileConfigProvider(path)\n self.configuration.add_provider(provider)\n return provider\n\n def start(self, *, start_control_plane: bool = True) -> None:\n if self._started:\n return\n self._state = LifecycleState.STARTING\n config = self.configuration.load()\n self.logs.apply_config(config)\n self._register_health_contributors()\n self._register_workers()\n self.workers.start()\n if start_control_plane:\n self.control_plane.start(self)\n self._started = True\n self._refresh_state()\n\n def stop(self, timeout: float = 30.0, force: bool = False, stop_control_plane: bool = True) -> None:\n if not self._started:\n return\n self._state = LifecycleState.STOPPING\n self.workers.stop(timeout=timeout, force=force)\n if stop_control_plane:\n self.control_plane.stop()\n self._started = False\n self._state = LifecycleState.STOPPED\n\n def status(self) -> dict[str, object]:\n self._refresh_state()\n return self.control_plane.snapshot(self)\n\n def current_health(self) -> HealthPayload:\n self._refresh_state()\n return self.health.payload(self._state, self.workers.healths())\n\n async def health_status(self) -> HealthPayload:\n return self.current_health()\n\n async def start_runtime(self) -> dict[str, object] | str:\n self._refresh_state()\n if self._started:\n return \"runtime already running\"\n if self._state == LifecycleState.STOPPING:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n\n self.start(start_control_plane=False)\n started = self._wait_for_state({LifecycleState.IDLE, LifecycleState.BUSY}, timeout=self.ACTION_TIMEOUT_SECONDS)\n if started:\n return self._action_detail(\"runtime started\", timed_out=False)\n return self._action_detail(\"runtime start is still in progress\", timed_out=True)\n\n async def stop_runtime(self) -> dict[str, object] | str:\n self._refresh_state()\n if not self._started:\n if self._state == LifecycleState.STOPPING:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n return \"runtime already stopped\"\n\n self._state = LifecycleState.STOPPING\n try:\n self.workers.stop(timeout=self.ACTION_TIMEOUT_SECONDS, force=False)\n except TimeoutError:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n\n self._started = False\n self._state = LifecycleState.STOPPED\n return self._action_detail(\"runtime stopped\", timed_out=False)\n\n async def runtime_status(self) -> str:\n self._refresh_state()\n return self._state.value\n\n def _register_core_services(self) -> None:\n if self._core_registered:\n return\n self.services.register(\"configuration\", self.configuration)\n self.services.register(\"traces\", self.traces)\n self.services.register(\"health\", self.health)\n self.services.register(\"logs\", self.logs)\n self.services.register(\"workers\", self.workers)\n self.services.register(\"control_plane\", self.control_plane)\n self._core_registered = True\n\n def _register_health_contributors(self) -> None:\n for contributor in self.registry.health_contributors:\n self.health.register(contributor)\n\n def _register_workers(self) -> None:\n if self._workers_registered:\n return\n for worker in self.registry.workers:\n self.workers.register(worker)\n self._workers_registered = True\n\n def _refresh_state(self) -> None:\n lifecycle = self.workers.lifecycle_state()\n\n if self._state == LifecycleState.STOPPING:\n if lifecycle == LifecycleState.STOPPED:\n self._started = False\n self._state = LifecycleState.STOPPED\n return\n\n if not self._started:\n if lifecycle == LifecycleState.STOPPED:\n self._state = LifecycleState.STOPPED\n return\n\n self._state = lifecycle\n\n def _wait_for_state(self, target_states: set[LifecycleState], *, timeout: float) -> bool:\n deadline = monotonic() + timeout\n while monotonic() < deadline:\n self._refresh_state()\n if self._state in target_states:\n return True\n sleep(self.ACTION_POLL_INTERVAL_SECONDS)\n self._refresh_state()\n return self._state in target_states\n\n def _action_detail(self, message: str, *, timed_out: bool) -> dict[str, object]:\n self._refresh_state()\n return {\n \"message\": message,\n \"state\": self._state.value,\n \"timed_out\": timed_out,\n \"workers\": self.workers.snapshot(),\n }", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/core/runtime.py:RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.core.runtime", - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ] - }, - "diagnostics": { - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C0_SOURCE_CHUNKS": "exact_path_fetch", - "C4_SEMANTIC_ROLES": "exact_path_fetch", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C3_ENTRYPOINTS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 8, - "C4_SEMANTIC_ROLES": 8, - "C2_DEPENDENCY_GRAPH": 10, - "C3_ENTRYPOINTS": 10 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C4_SEMANTIC_ROLES": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Покажи поток выполнения RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C4_SEMANTIC_ROLES", - "query": "Покажи поток выполнения RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "Покажи поток выполнения RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 10, - "ranking_profile": "code" - }, - { - "layer": "C3_ENTRYPOINTS", - "query": "Покажи поток выполнения RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 10, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 1, - "candidates_after_filter": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 10, - "candidates_after_filter": 10 - }, - { - "layer": "C3_ENTRYPOINTS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 3, - "candidates_after_filter": 3 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "RuntimeManager", - "alternatives": [ - "RuntimeManager" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C4_SEMANTIC_ROLES", - "status": "hit", - "hit_count": 8, - "fail_reason": null - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 10, - "fail_reason": null - }, - { - "layer": "C3_ENTRYPOINTS", - "status": "hit", - "hit_count": 3, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "symbol_resolution": 0, - "retrieval_total": 160, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 53, - "C0_SOURCE_CHUNKS": 22, - "C4_SEMANTIC_ROLES": 17, - "C2_DEPENDENCY_GRAPH": 56, - "C3_ENTRYPOINTS": 9 - }, - "merge_rank": 20 - } - } - }, - { - "step": "llm_answer", - "input": { - "query": "Покажи поток выполнения RuntimeManager", - "rag_count": 23 - }, - "output": { - "llm_answer": "## Шаг 1: Инициализация потока выполнения\n\n### Источник начала потока:\nПроцесс начинается с вызова конструктора класса `RuntimeManager` (`__init__`) из внешнего контекста.\n\n### Слой информации: C2_DEPENDENCY_GRAPH\nВызовы метода `RuntimeManager.__init__` зависят от следующих методов и атрибутов:\n- `RuntimeManager.configuration`\n- `RuntimeManager.add_config_file`\n- `RuntimeManager.services`\n- Сам метод `RuntimeManager.__init__`\n\nЭти зависимости указывают на то, что при инициализации `RuntimeManager` происходит конфигурирование и настройка различных сервисов и конфигураций.\n\n## Шаг 2: Детали внутренней логики\n\n### Слой информации: C0_SOURCE_CHUNKS\nРассмотрим подробнее метод `__init__`:\n```python\ndef __init__(self,\n configuration: ConfigurationManager | None = None,\n services: ServiceContainer | None = None,\n traces: TraceService | None = None,\n health: HealthRegistry | None = None,\n logs: LogManager | None = None,\n workers: WorkerSupervisor | None = None,\n control_plane: ControlPlaneService | None = None):\n```\n\nПри вызове конструктора создаются и заполняются следующие поля объекта `RuntimeManager`:\n- `configuration`: объект конфигурации, если передан, иначе создается экземпляр `ConfigurationManager`.\n- `services`: контейнер сервисов, если передан, иначе создается экземпляр `ServiceContainer`.\n- `traces`, `health`, `logs`, `workers`, `control_plane`: соответствующие сервисы, которые либо передаются извне, либо создаются внутри.\n\n## Шаг 3: Регистрация модулей и состояние жизненного цикла\n\nПосле создания экземпляра класса выполняется регистрация внутренних компонентов и управление состоянием жизненного цикла:\n```python\nself.registry = ModuleRegistry(self.services)\nself._started = False\nself._state = LifecycleState.IDLE\nself._core_registered = False\nself._workers_registered = False\nself._register_core_services()\n```\n\nЗдесь создаётся реестр модулей (`ModuleRegistry`), устанавливаются начальные значения для флагов состояния системы и вызывается внутренняя функция `_register_core_services()`.\n\n## Шаг 4: Поток данных и завершение\n\nПосле инициализации и настройки, объект `RuntimeManager` готов к дальнейшей работе, управляя регистрацией и активацией сервисов и компонентов.\n\n### Итоговый путь выполнения:\n1. Внешний контекст вызывает конструктор `RuntimeManager`.\n2. Производится настройка основных атрибутов и служб (`configuration`, `services`, `traces`, etc.).\n3. Запускается инициализация модуля реестра и контрольных состояний системы.\n\n### Заключение:\nПоток выполнения начинается с вызова конструктора `RuntimeManager`, продолжается настройкой базовых атрибутов и завершается начальной регистрацией системных модулей и установкой начальных состояний системы. \n\nНа текущий момент не обнаружено явных пробелов или недостающих данных в потоке выполнения." - }, - "diagnostics": { - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 766, - "evidence_rows": 23, - "evidence_chars": 8302 - }, - "evidence_summary": [ - { - "layer": "C1_SYMBOL_CATALOG", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "count": 8, - "unique_paths": 7 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "count": 10, - "unique_paths": 2 - }, - { - "layer": "C3_ENTRYPOINTS", - "count": 3, - "unique_paths": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 1, - "unique_paths": 1 - } - ], - "prompt_template_id": "intent_code_qa_trace_flow_ru_v1", - "system_prompt_version": "v1" - }, - "timings_ms": { - "prompt_build": 0, - "llm_call": 4403 - } - } - } - ] - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents/20260312_115751/full_chain_plba_code_subintents_plba-fullchain-trace-flow-runtime-manager.md b/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents/20260312_115751/full_chain_plba_code_subintents_plba-fullchain-trace-flow-runtime-manager.md deleted file mode 100644 index 0730837..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents/20260312_115751/full_chain_plba_code_subintents_plba-fullchain-trace-flow-runtime-manager.md +++ /dev/null @@ -1,34 +0,0 @@ -# plba-fullchain-trace-flow-runtime-manager - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_subintents.yaml -- runner: runtime -- mode: full_chain -- passed: True - -## Query -Покажи поток выполнения RuntimeManager - -## Actual -{ - "intent": "CODE_QA", - "sub_intent": "TRACE_FLOW", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 23, - "llm_answer": "## Шаг 1: Инициализация потока выполнения\n\n### Источник начала потока:\nПроцесс начинается с вызова конструктора класса `RuntimeManager` (`__init__`) из внешнего контекста.\n\n### Слой информации: C2_DEPENDENCY_GRAPH\nВызовы метода `RuntimeManager.__init__` зависят от следующих методов и атрибутов:\n- `RuntimeManager.configuration`\n- `RuntimeManager.add_config_file`\n- `RuntimeManager.services`\n- Сам метод `RuntimeManager.__init__`\n\nЭти зависимости указывают на то, что при инициализации `RuntimeManager` происходит конфигурирование и настройка различных сервисов и конфигураций.\n\n## Шаг 2: Детали внутренней логики\n\n### Слой информации: C0_SOURCE_CHUNKS\nРассмотрим подробнее метод `__init__`:\n```python\ndef __init__(self,\n configuration: ConfigurationManager | None = None,\n services: ServiceContainer | None = None,\n traces: TraceService | None = None,\n health: HealthRegistry | None = None,\n logs: LogManager | None = None,\n workers: WorkerSupervisor | None = None,\n control_plane: ControlPlaneService | None = None):\n```\n\nПри вызове конструктора создаются и заполняются следующие поля объекта `RuntimeManager`:\n- `configuration`: объект конфигурации, если передан, иначе создается экземпляр `ConfigurationManager`.\n- `services`: контейнер сервисов, если передан, иначе создается экземпляр `ServiceContainer`.\n- `traces`, `health`, `logs`, `workers`, `control_plane`: соответствующие сервисы, которые либо передаются извне, либо создаются внутри.\n\n## Шаг 3: Регистрация модулей и состояние жизненного цикла\n\nПосле создания экземпляра класса выполняется регистрация внутренних компонентов и управление состоянием жизненного цикла:\n```python\nself.registry = ModuleRegistry(self.services)\nself._started = False\nself._state = LifecycleState.IDLE\nself._core_registered = False\nself._workers_registered = False\nself._register_core_services()\n```\n\nЗдесь создаётся реестр модулей (`ModuleRegistry`), устанавливаются начальные значения для флагов состояния системы и вызывается внутренняя функция `_register_core_services()`.\n\n## Шаг 4: Поток данных и завершение\n\nПосле инициализации и настройки, объект `RuntimeManager` готов к дальнейшей работе, управляя регистрацией и активацией сервисов и компонентов.\n\n### Итоговый путь выполнения:\n1. Внешний контекст вызывает конструктор `RuntimeManager`.\n2. Производится настройка основных атрибутов и служб (`configuration`, `services`, `traces`, etc.).\n3. Запускается инициализация модуля реестра и контрольных состояний системы.\n\n### Заключение:\nПоток выполнения начинается с вызова конструктора `RuntimeManager`, продолжается настройкой базовых атрибутов и завершается начальной регистрацией системных модулей и установкой начальных состояний системы. \n\nНа текущий момент не обнаружено явных пробелов или недостающих данных в потоке выполнения.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "RuntimeManager" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] -} - -## Mismatches -- none \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents/20260312_115751/summary.md b/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents/20260312_115751/summary.md deleted file mode 100644 index abfa34f..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents/20260312_115751/summary.md +++ /dev/null @@ -1,26 +0,0 @@ -# pipeline_setup_v2 summary - -Passed: 7/7 - - -| File | Case | Query | Expected sub-intent | Intent | Actual sub-intent | RAG layers | Pass | -| ------------------------------------ | -------------------------------------------- | -------------------------------------------------------------------------------- | ------------------- | ------- | ----------------- | ------------------------------------------------------------------------------------------------------ | ---- | -| full_chain_plba_code_subintents.yaml | plba-fullchain-open-file-runtime | Открой файл src/app_runtime/core/runtime.py | OPEN_FILE | CODE_QA | OPEN_FILE | C0_SOURCE_CHUNKS:1 | ✓ | -| full_chain_plba_code_subintents.yaml | plba-fullchain-explain-runtime-manager | Объясни как работает класс RuntimeManager | EXPLAIN | CODE_QA | EXPLAIN | C0_SOURCE_CHUNKS:1, C1_SYMBOL_CATALOG:1, C2_DEPENDENCY_GRAPH:6, C3_ENTRYPOINTS:3, C4_SEMANTIC_ROLES:1 | ✓ | -| full_chain_plba_code_subintents.yaml | plba-fullchain-find-tests-runtime-manager | Где тесты для RuntimeManager? | FIND_TESTS | CODE_QA | FIND_TESTS | C0_SOURCE_CHUNKS:10, C2_DEPENDENCY_GRAPH:6 | ✓ | -| full_chain_plba_code_subintents.yaml | plba-fullchain-find-entrypoints | Найди точки входа в коде | FIND_ENTRYPOINTS | CODE_QA | FIND_ENTRYPOINTS | C0_SOURCE_CHUNKS:6, C3_ENTRYPOINTS:3 | ✓ | -| full_chain_plba_code_subintents.yaml | plba-fullchain-trace-flow-runtime-manager | Покажи поток выполнения RuntimeManager | TRACE_FLOW | CODE_QA | TRACE_FLOW | C0_SOURCE_CHUNKS:1, C1_SYMBOL_CATALOG:1, C2_DEPENDENCY_GRAPH:10, C3_ENTRYPOINTS:3, C4_SEMANTIC_ROLES:8 | ✓ | -| full_chain_plba_code_subintents.yaml | plba-fullchain-architecture-control-plane | Какие компоненты участвуют в RuntimeManager? | ARCHITECTURE | CODE_QA | ARCHITECTURE | C0_SOURCE_CHUNKS:1, C1_SYMBOL_CATALOG:1, C2_DEPENDENCY_GRAPH:8, C3_ENTRYPOINTS:3, C4_SEMANTIC_ROLES:12 | ✓ | -| full_chain_plba_code_subintents.yaml | plba-fullchain-explain-local-runtime-manager | Почему в файле src/app_runtime/core/runtime.py класс RuntimeManager устроен так? | EXPLAIN_LOCAL | CODE_QA | EXPLAIN_LOCAL | C0_SOURCE_CHUNKS:1, C1_SYMBOL_CATALOG:1, C2_DEPENDENCY_GRAPH:4 | ✓ | - - -## LLM Answers - -- **plba-fullchain-open-file-runtime**: Файл `src/app_runtime/core/runtime.py` содержит определение класса `RuntimeManager`, управляющего основными компонентами приложения во время его выполнения. ## Важные сущности и их значение: - `**ConfigurationManager`, `ServiceContainer`, `TraceService`, `HealthRegistry`, `LogManager`, `WorkerSupervisor`, `ControlPlaneService`:** Эти классы представляют компоненты инфраструктуры, необходимые для работы приложения (конфигурация, сервисы, трассировка, здоровье системы, ведение логов, управление рабочими процессами и контрольная плоскость). - `**ModuleRegistry`:** Используется для регистрации модулей приложений, позволяя управлять ими централизованно. - **Параметры инициализации (`configuration`, `services`, `traces`, etc.):** Позволяют настраивать поведение экземпляра `RuntimeManager`. - **Методы класса:** - `_register_core_services()`: регистрирует основные службы, ис… -- **plba-fullchain-explain-runtime-manager**: ## Назначение класса `RuntimeManager` Класс `RuntimeManager` играет роль менеджера выполнения системы и отвечает за координацию различных компонентов приложения во время его работы. Он управляет жизненным циклом, состоянием и регистрацией сервисов и модулей, обеспечивая их корректное взаимодействие. ## Ключевые зависимости Ключевые компоненты и зависимости для правильной работы класса включают: - `ConfigurationManager`: настройка конфигурации приложения; - `ServiceContainer`: контейнер хранения всех доступных сервисов; - `TraceService`: сервис отслеживания трассировок событий; - `HealthRegistry`: регистрация текущего состояния здоровья системы; - `LogManager`: управление логированием событий; - `WorkerSupervisor`: супервизор рабочих процессов; - `ControlPlaneService`: основной сервис управления приложением. Все эти зависимости передаются конструктору класса при иници… -- **plba-fullchain-find-tests-runtime-manager**: Прямые тесты для `RuntimeManager` обнаружены в следующих местах: 1. **tests/test_runtime.py**: - `test_runtime_graceful_stop_waits_until_worker_finishes`: Проверяет корректность остановки (`stop`) объекта `RuntimeManager`, ожидая завершения работы модуля. ✅ Близость проверки высокая — непосредственно проверяет поведение при вызове метода `stop`. - `test_runtime_runs_worker_routine_and_exposes_status`: Тестирует регистрацию модуля и запуск его рутины с последующим получением статуса. ✅ Близость проверки высокая — проверяет выполнение регистраций модулей и получение их статусов через `RuntimeManager`. 2. **tests/test_business_control_actions.py**: - `_build_runtime`: Тест косвенный, так как здесь создаётся объект `RuntimeManager`, но сам метод не проверяет логику поведения объекта напрямую. ❌ Косвенная проверка. - `test_worker_wakes_up_with_configured_interval`: Аналог… -- **plba-fullchain-find-entrypoints**: ## Финальный ответ: На основании предоставленного контекста и анализа слоев RAG можно выделить следующие **точки входа** и ключевые обработчики запуска в приложении: ### 1. `app.post` **Файл:** `src/app_runtime/control/http_app.py` **Сущность:** Метод класса FastAPI (`app`) **Роль:** Обрабатывает HTTP POST-запросы. Это основной маршрут для приёма данных от пользователей и их дальнейшей обработки внутри приложения. ### 2. `app.get` **Файл:** `src/app_runtime/control/http_app.py` **Сущность:** Метод класса FastAPI (`app`) **Роль:** Обрабатывает HTTP GET-запросы. Используется для получения информации из системы (например, статус задач, результаты вычислений). ### Наиболее вероятные точки входа (по контексту): - src/app_runtime/control/http_app.py: - Обработка запросов через методы `app.post` и `app.get`. ### Дополнительные наблюдения по контексту: - В файле `src/app_run… -- **plba-fullchain-trace-flow-runtime-manager**: ## Шаг 1: Инициализация потока выполнения ### Источник начала потока: Процесс начинается с вызова конструктора класса `RuntimeManager` (`__init_`_) из внешнего контекста. ### Слой информации: C2_DEPENDENCY_GRAPH Вызовы метода `RuntimeManager.__init_`_ зависят от следующих методов и атрибутов: - `RuntimeManager.configuration` - `RuntimeManager.add_config_file` - `RuntimeManager.services` - Сам метод `RuntimeManager.__init__` Эти зависимости указывают на то, что при инициализации `RuntimeManager` происходит конфигурирование и настройка различных сервисов и конфигураций. ## Шаг 2: Детали внутренней логики ### Слой информации: C0_SOURCE_CHUNKS Рассмотрим подробнее метод `__init_`_: ```python def **init**(self, configuration: ConfigurationManager | None = None, services: ServiceContainer | None = None, traces: TraceService | None = None, health: HealthRegistry | None = No… -- **plba-fullchain-architecture-control-plane**: ## Архитектурное объяснение RuntimeManager ### Основные компоненты и их роли 1. **RuntimeManager** - Роль: pipeline_stage - Описание: Менеджер выполнения этапов пайплайна. Оркеструет вызовы ролей, управляет состоянием приложения и участвует в потоках данных. - Ответственность: инициализация конфигурации, запуск процессов, чтение и запись состояния атрибутов. 2. **ControlActionSet** - Роль: model - Описание: Модель управления действиями. Выполняет стандартные действия модели. - Ответственность: обработка стандартных операций и моделей поведения системы. ### Связи и взаимодействия компонентов 1. **Связь с внешним API через FastAPI** - Интерфейс взаимодействия с пользователем через HTTP-запросы. - Пример: `app.post` из `src/app_runtime/control/http_app.py`. 2. **Управление данными и состояниями внутри пайплайна** - Данные передаются и обрабатываются между компонентами п… -- **plba-fullchain-explain-local-runtime-manager**: Класс `RuntimeManager` из файла `src/app_runtime/core/runtime.py` предназначен для управления жизненным циклом приложения во время его выполнения (runtime). ### Что делает класс? Этот класс служит центральной точкой координации различных компонентов системы. Он инициализирует основные службы и модули приложения, такие как конфигурация (`configuration`), сервисы (`services`), трассировка ошибок (`traces`), мониторинг здоровья (`health`), ведение логов (`logs`) и управление рабочими процессами (`workers`). Также `RuntimeManager` обеспечивает контроль над состоянием жизненного цикла приложения через переменные `_state`, которые могут принимать значения `IDLE`, `STARTED`, и другие состояния. Класс предоставляет методы регистрации модулей и служб, а также контроля их активности. ### Какие входные параметры принимает конструктор класса? Конструктор принимает несколько необ… - diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents/20260312_120252/full_chain_plba_code_subintents_plba-fullchain-architecture-control-plane.json b/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents/20260312_120252/full_chain_plba_code_subintents_plba-fullchain-architecture-control-plane.json deleted file mode 100644 index f8c5a74..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents/20260312_120252/full_chain_plba_code_subintents_plba-fullchain-architecture-control-plane.json +++ /dev/null @@ -1,3036 +0,0 @@ -{ - "case_id": "plba-fullchain-architecture-control-plane", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_subintents.yaml", - "runner": "runtime", - "mode": "full_chain", - "actual": { - "intent": "CODE_QA", - "sub_intent": "ARCHITECTURE", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 25, - "llm_answer": "## Архитектурное объяснение подсистемы RuntimeManager\n\n### Основные компоненты и их роли\n\n1. **RuntimeManager**\n - Роль: Pipeline stage (этап конвейера).\n - Описание: Менеджер, отвечающий за оркестровку и координацию ролей-подсистем, участвующих в выполнении бизнес-требований. Читает и записывает состояние атрибутов системы, участвует в потоках данных.\n\n2. **ControlActionSet**\n - Роль: Модель поведения системы.\n - Описание: Базовый класс для определения действий управления системой, реализует модель по умолчанию.\n\n### Связи и границы ответственности\n\n- **RuntimeManager** взаимодействует с **ControlActionSet**, инициируя выполнение заданных моделей поведения через зависимости и вызовы методов модели.\n- Контейнер Dependency Injection (DI) обеспечивает внедрение зависимостей объектов из внешних систем или сервисов.\n- Потоки данных разделены на участки (slices), что позволяет разделить ответственность компонентов и улучшить масштабируемость и модульность системы.\n\n### Ключевые выводы по архитектуре\n\n1. **Конвейерный подход**: Система организована вокруг понятий pipeline stages, где каждый менеджер отвечает за конкретный этап выполнения задач.\n \n2. **Модульная структура**: Использование Dependency Injection и четкое разделение ответственности позволяет легко заменять и расширять отдельные модули без изменения общей архитектуры.\n\n3. **Управление состоянием**: RuntimeManager активно управляет состоянием системы, читая и записывая необходимые атрибуты, обеспечивая целостность и согласованность данных.\n\n4. **Масштабируемость**: Разделение потоков данных на slices улучшает производительность и облегчает параллельное выполнение задач.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "RuntimeManager" - ], - "layers": [ - "C4_SEMANTIC_ROLES", - "C3_ENTRYPOINTS", - "C2_DEPENDENCY_GRAPH", - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS" - ] - }, - "passed": true, - "mismatches": [], - "details": { - "case_id": "plba-fullchain-architecture-control-plane", - "text": "Какие компоненты участвуют в RuntimeManager?", - "mode": "full_chain", - "run_started_at": "2026-03-12T12:02:52", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Какие компоненты участвуют в RuntimeManager?", - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "RuntimeManager", - "alternatives": [ - "RuntimeManager" - ], - "confidence": 0.99 - }, - "rag_count": 25, - "rag_rows": [ - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests manager\n- orchestrates role-like calls (4)\n- reads and writes state attributes\n- participates in dataflow slices (50)", - "layer": "C4_SEMANTIC_ROLES", - "title": "RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 43, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "7e4a9381328c5803bbc6179458612fc4e947d928aa7bf8b4b2bebb2c8592f758", - "symbol_name": "RuntimeManager", - "qname": "RuntimeManager", - "role": "pipeline_stage", - "confidence": 0.67, - "dataflow_participation": 50, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "ControlActionSet\nrole: model\n\nResponsibilities:\n- default model role", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlActionSet", - "span_start": 14, - "span_end": 18, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 40, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "46eb026cb3313415ec47b82dd22f84f4d112c9d987e8b1716dcb0baa1cce8988", - "symbol_name": "ControlActionSet", - "qname": "ControlActionSet", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "ControlChannel\nrole: model\n\nResponsibilities:\n- default model role", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlChannel", - "span_start": 21, - "span_end": 28, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 40, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "cfcfe9a311d3a2dbdaf32ac4ccd73c0eb9a117f830591a1c0867ee97d46204ff", - "symbol_name": "ControlChannel", - "qname": "ControlChannel", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests service\n- reads and writes state attributes\n- participates in dataflow slices (5)", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlPlaneService", - "span_start": 12, - "span_end": 52, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 68, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "b13471e5916986dccffb53fab613812842965705e6b3a89ae549d30c9e91e9aa", - "symbol_name": "ControlPlaneService", - "qname": "ControlPlaneService", - "role": "pipeline_stage", - "confidence": 0.57, - "dataflow_participation": 5, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_runner.py", - "content": "UvicornThreadRunner\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (24)", - "layer": "C4_SEMANTIC_ROLES", - "title": "UvicornThreadRunner", - "span_start": 10, - "span_end": 61, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 11, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "fd55630045a02100df8877ac27d951ee08617d4598764394d48cb51fe067476a", - "symbol_name": "UvicornThreadRunner", - "qname": "UvicornThreadRunner", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 24, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "3779fdd2878b770e789a35bb2a89c9d79f13b61c26d7db1b3b683f9bb9e1623f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (10)", - "layer": "C4_SEMANTIC_ROLES", - "title": "HttpControlChannel", - "span_start": 12, - "span_end": 57, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 21, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "1c9fbdc24819e5604c26ea55428a74310f03a03e1af197ed84846af61e42fdb0", - "symbol_name": "HttpControlChannel", - "qname": "HttpControlChannel", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 10, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "HttpControlAppFactory\nrole: factory\n\nResponsibilities:\n- name suffix suggests factory", - "layer": "C4_SEMANTIC_ROLES", - "title": "HttpControlAppFactory", - "span_start": 15, - "span_end": 53, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 39, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "9b3502a5fb408b273223db13264349cf500de24915b6c649d9ea8970d0dfd8e0", - "symbol_name": "HttpControlAppFactory", - "qname": "HttpControlAppFactory", - "role": "factory", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/persistence/workflow_persistence.py", - "content": "WorkflowPersistence\nrole: pipeline_stage\n\nResponsibilities:\n- orchestrates role-like calls (2)\n- reads and writes state attributes\n- participates in dataflow slices (16)", - "layer": "C4_SEMANTIC_ROLES", - "title": "WorkflowPersistence", - "span_start": 8, - "span_end": 54, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 15, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "7bd01ee45cf31f2d5c2e3e51656254860ac785d10cef9e0852cd4fba90857bae", - "symbol_name": "WorkflowPersistence", - "qname": "WorkflowPersistence", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 16, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "80e9410ddc639789b4353c2a1a757ba8d0d5b5bb6075b0b263b61551f04ae1f0", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/queue/in_memory.py", - "content": "InMemoryTaskQueue\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (9)", - "layer": "C4_SEMANTIC_ROLES", - "title": "InMemoryTaskQueue", - "span_start": 9, - "span_end": 38, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 22, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "2da04cb94544a3bcbf0943a95ad4bdd8710bcafaa32a02fd0e4de2178dcf3533", - "symbol_name": "InMemoryTaskQueue", - "qname": "InMemoryTaskQueue", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 9, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "58f0cc001ccda0eee4c6bc32ed83bd05eafd6b6644f1e8b4aa9eed3103db73dc", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/config/file_loader.py", - "content": "ConfigFileLoader\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (8)", - "layer": "C4_SEMANTIC_ROLES", - "title": "ConfigFileLoader", - "span_start": 11, - "span_end": 48, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 23, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "a8474eca8b6e9dc86ae67ed68b16fa5fb639ef08739c053e7b7195489765667f", - "symbol_name": "ConfigFileLoader", - "qname": "ConfigFileLoader", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 8, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "1f19ffebde5e38e4be5a5d5a678059a0f36dedb8fb8b3e00ab395c67106a87ea", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/store.py", - "content": "TraceContextStore\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (6)", - "layer": "C4_SEMANTIC_ROLES", - "title": "TraceContextStore", - "span_start": 15, - "span_end": 52, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 25, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "b2dad4fbe16ffb11b58deba311c7739955c39d59f291b22181f33e9c8cce4059", - "symbol_name": "TraceContextStore", - "qname": "TraceContextStore", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 6, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "d369554f08fc92039c6edd5a2a1e73b23901533e8974459170bbd9347d263dc5", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workers/supervisor.py", - "content": "WorkerSupervisor\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (6)", - "layer": "C4_SEMANTIC_ROLES", - "title": "WorkerSupervisor", - "span_start": 10, - "span_end": 59, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 25, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "c17b44e8d9e97d490989b21fa67d7c346cdda8a0472e4c41fb243c8846faa124", - "symbol_name": "WorkerSupervisor", - "qname": "WorkerSupervisor", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 6, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "77609d9d5927171cce7fc3a54897c183fd63068710c6362029b700937aae5eee", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._start_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 47, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517", - "dst_ref": "ControlPlaneService._start_async", - "resolution": "resolved", - "slice_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._start_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager.start", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 32, - "span_end": 59, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "98312ace7fc62b1c7194c5aa1732b6ef736eae1668a3a120dd1ecd5ab1d64f7a", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "77a7b260193018845e4e204df094ab89cfd7c82ee4e822b3a83ad4cd945f9cb1", - "dst_ref": "RuntimeManager.start", - "resolution": "resolved", - "slice_id": "98312ace7fc62b1c7194c5aa1732b6ef736eae1668a3a120dd1ecd5ab1d64f7a", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager.start" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "77a7b260193018845e4e204df094ab89cfd7c82ee4e822b3a83ad4cd945f9cb1" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.start", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 20, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154", - "dst_ref": "ControlPlaneService.start", - "resolution": "resolved", - "slice_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.start" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.stop", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 25, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d", - "dst_ref": "ControlPlaneService.stop", - "resolution": "resolved", - "slice_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.stop" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._stop_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 51, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a", - "dst_ref": "ControlPlaneService._stop_async", - "resolution": "resolved", - "slice_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._stop_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager.add_config_file", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 32, - "span_end": 52, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "a23b8a11ebdb12708b60c96ea12a69f7f042082f1adfddd572444e246d81d167", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "57ffbd4f0d9fdf3507c2b8624312ce211f3d02fdf86a57a8ec90778d8a7b498d", - "dst_ref": "RuntimeManager.add_config_file", - "resolution": "resolved", - "slice_id": "a23b8a11ebdb12708b60c96ea12a69f7f042082f1adfddd572444e246d81d167", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager.add_config_file" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "57ffbd4f0d9fdf3507c2b8624312ce211f3d02fdf86a57a8ec90778d8a7b498d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.register_channel", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 17, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957", - "dst_ref": "ControlPlaneService.register_channel", - "resolution": "resolved", - "slice_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.register_channel" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager._register_core_services", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 32, - "span_end": 127, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "3e5811f3b511fa0cabe363f5d01f2ac5fa039bc8b93f7ee108323e1f5f45a293", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "972d6057a6caac9cf31ebc1e29c6f39f71b10d4cc170dec57cf875ba458549c6", - "dst_ref": "RuntimeManager._register_core_services", - "resolution": "resolved", - "slice_id": "3e5811f3b511fa0cabe363f5d01f2ac5fa039bc8b93f7ee108323e1f5f45a293", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager._register_core_services" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "972d6057a6caac9cf31ebc1e29c6f39f71b10d4cc170dec57cf875ba458549c6" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "class RuntimeManager\nRuntimeManager", - "layer": "C1_SYMBOL_CATALOG", - "title": "RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "7e4a9381328c5803bbc6179458612fc4e947d928aa7bf8b4b2bebb2c8592f758", - "qname": "RuntimeManager", - "kind": "class", - "signature": "RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.core.runtime", - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "class RuntimeManager:\n ACTION_TIMEOUT_SECONDS = 10.0\n ACTION_POLL_INTERVAL_SECONDS = 0.05\n\n def __init__(\n self,\n configuration: ConfigurationManager | None = None,\n services: ServiceContainer | None = None,\n traces: TraceService | None = None,\n health: HealthRegistry | None = None,\n logs: LogManager | None = None,\n workers: WorkerSupervisor | None = None,\n control_plane: ControlPlaneService | None = None,\n ) -> None:\n self.configuration = configuration or ConfigurationManager()\n self.services = services or ServiceContainer()\n self.traces = traces or TraceService()\n self.health = health or HealthRegistry()\n self.logs = logs or LogManager()\n self.workers = workers or WorkerSupervisor()\n self.control_plane = control_plane or ControlPlaneService()\n self.registry = ModuleRegistry(self.services)\n self._started = False\n self._state = LifecycleState.IDLE\n self._core_registered = False\n self._workers_registered = False\n self._register_core_services()\n\n def register_module(self, module: ApplicationModule) -> None:\n self.registry.register_module(module.name)\n module.register(self.registry)\n\n def add_config_file(self, path: str) -> FileConfigProvider:\n provider = FileConfigProvider(path)\n self.configuration.add_provider(provider)\n return provider\n\n def start(self, *, start_control_plane: bool = True) -> None:\n if self._started:\n return\n self._state = LifecycleState.STARTING\n config = self.configuration.load()\n self.logs.apply_config(config)\n self._register_health_contributors()\n self._register_workers()\n self.workers.start()\n if start_control_plane:\n self.control_plane.start(self)\n self._started = True\n self._refresh_state()\n\n def stop(self, timeout: float = 30.0, force: bool = False, stop_control_plane: bool = True) -> None:\n if not self._started:\n return\n self._state = LifecycleState.STOPPING\n self.workers.stop(timeout=timeout, force=force)\n if stop_control_plane:\n self.control_plane.stop()\n self._started = False\n self._state = LifecycleState.STOPPED\n\n def status(self) -> dict[str, object]:\n self._refresh_state()\n return self.control_plane.snapshot(self)\n\n def current_health(self) -> HealthPayload:\n self._refresh_state()\n return self.health.payload(self._state, self.workers.healths())\n\n async def health_status(self) -> HealthPayload:\n return self.current_health()\n\n async def start_runtime(self) -> dict[str, object] | str:\n self._refresh_state()\n if self._started:\n return \"runtime already running\"\n if self._state == LifecycleState.STOPPING:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n\n self.start(start_control_plane=False)\n started = self._wait_for_state({LifecycleState.IDLE, LifecycleState.BUSY}, timeout=self.ACTION_TIMEOUT_SECONDS)\n if started:\n return self._action_detail(\"runtime started\", timed_out=False)\n return self._action_detail(\"runtime start is still in progress\", timed_out=True)\n\n async def stop_runtime(self) -> dict[str, object] | str:\n self._refresh_state()\n if not self._started:\n if self._state == LifecycleState.STOPPING:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n return \"runtime already stopped\"\n\n self._state = LifecycleState.STOPPING\n try:\n self.workers.stop(timeout=self.ACTION_TIMEOUT_SECONDS, force=False)\n except TimeoutError:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n\n self._started = False\n self._state = LifecycleState.STOPPED\n return self._action_detail(\"runtime stopped\", timed_out=False)\n\n async def runtime_status(self) -> str:\n self._refresh_state()\n return self._state.value\n\n def _register_core_services(self) -> None:\n if self._core_registered:\n return\n self.services.register(\"configuration\", self.configuration)\n self.services.register(\"traces\", self.traces)\n self.services.register(\"health\", self.health)\n self.services.register(\"logs\", self.logs)\n self.services.register(\"workers\", self.workers)\n self.services.register(\"control_plane\", self.control_plane)\n self._core_registered = True\n\n def _register_health_contributors(self) -> None:\n for contributor in self.registry.health_contributors:\n self.health.register(contributor)\n\n def _register_workers(self) -> None:\n if self._workers_registered:\n return\n for worker in self.registry.workers:\n self.workers.register(worker)\n self._workers_registered = True\n\n def _refresh_state(self) -> None:\n lifecycle = self.workers.lifecycle_state()\n\n if self._state == LifecycleState.STOPPING:\n if lifecycle == LifecycleState.STOPPED:\n self._started = False\n self._state = LifecycleState.STOPPED\n return\n\n if not self._started:\n if lifecycle == LifecycleState.STOPPED:\n self._state = LifecycleState.STOPPED\n return\n\n self._state = lifecycle\n\n def _wait_for_state(self, target_states: set[LifecycleState], *, timeout: float) -> bool:\n deadline = monotonic() + timeout\n while monotonic() < deadline:\n self._refresh_state()\n if self._state in target_states:\n return True\n sleep(self.ACTION_POLL_INTERVAL_SECONDS)\n self._refresh_state()\n return self._state in target_states\n\n def _action_detail(self, message: str, *, timed_out: bool) -> dict[str, object]:\n self._refresh_state()\n return {\n \"message\": message,\n \"state\": self._state.value,\n \"timed_out\": timed_out,\n \"workers\": self.workers.snapshot(),\n }", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/core/runtime.py:RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.core.runtime", - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "llm_answer": "## Архитектурное объяснение подсистемы RuntimeManager\n\n### Основные компоненты и их роли\n\n1. **RuntimeManager**\n - Роль: Pipeline stage (этап конвейера).\n - Описание: Менеджер, отвечающий за оркестровку и координацию ролей-подсистем, участвующих в выполнении бизнес-требований. Читает и записывает состояние атрибутов системы, участвует в потоках данных.\n\n2. **ControlActionSet**\n - Роль: Модель поведения системы.\n - Описание: Базовый класс для определения действий управления системой, реализует модель по умолчанию.\n\n### Связи и границы ответственности\n\n- **RuntimeManager** взаимодействует с **ControlActionSet**, инициируя выполнение заданных моделей поведения через зависимости и вызовы методов модели.\n- Контейнер Dependency Injection (DI) обеспечивает внедрение зависимостей объектов из внешних систем или сервисов.\n- Потоки данных разделены на участки (slices), что позволяет разделить ответственность компонентов и улучшить масштабируемость и модульность системы.\n\n### Ключевые выводы по архитектуре\n\n1. **Конвейерный подход**: Система организована вокруг понятий pipeline stages, где каждый менеджер отвечает за конкретный этап выполнения задач.\n \n2. **Модульная структура**: Использование Dependency Injection и четкое разделение ответственности позволяет легко заменять и расширять отдельные модули без изменения общей архитектуры.\n\n3. **Управление состоянием**: RuntimeManager активно управляет состоянием системы, читая и записывая необходимые атрибуты, обеспечивая целостность и согласованность данных.\n\n4. **Масштабируемость**: Разделение потоков данных на slices улучшает производительность и облегчает параллельное выполнение задач.", - "summary": { - "router": { - "intent": "CODE_QA", - "sub_intent": "ARCHITECTURE", - "confidence": null - }, - "retrieval": { - "profile": "code", - "layers_hit": [ - "C0_SOURCE_CHUNKS", - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS", - "C4_SEMANTIC_ROLES" - ], - "evidence_sufficient": true - }, - "llm": { - "answer_status": "answered", - "groundedness": "grounded" - } - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "ARCHITECTURE", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C4_SEMANTIC_ROLES", - "C3_ENTRYPOINTS", - "C2_DEPENDENCY_GRAPH", - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "RuntimeManager" - ], - "keyword_hints": [ - "RuntimeManager" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "execution": { - "executed_layers": [ - "C4_SEMANTIC_ROLES", - "C3_ENTRYPOINTS", - "C2_DEPENDENCY_GRAPH", - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS" - ], - "retrieval_mode_by_layer": { - "C4_SEMANTIC_ROLES": "exact_path_fetch", - "C3_ENTRYPOINTS": "exact_path_fetch", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C1_SYMBOL_CATALOG": "symbol_search", - "C0_SOURCE_CHUNKS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C4_SEMANTIC_ROLES": 12, - "C3_ENTRYPOINTS": 8, - "C2_DEPENDENCY_GRAPH": 8, - "C1_SYMBOL_CATALOG": 6, - "C0_SOURCE_CHUNKS": 4 - }, - "filters_by_layer": { - "C4_SEMANTIC_ROLES": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C1_SYMBOL_CATALOG": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C4_SEMANTIC_ROLES", - "query": "Какие компоненты участвуют в RuntimeManager?", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 12, - "ranking_profile": "code" - }, - { - "layer": "C3_ENTRYPOINTS", - "query": "Какие компоненты участвуют в RuntimeManager?", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "Какие компоненты участвуют в RuntimeManager?", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C1_SYMBOL_CATALOG", - "query": "RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Какие компоненты участвуют в RuntimeManager?", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 4, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C4_SEMANTIC_ROLES", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 12, - "candidates_after_filter": 12 - }, - { - "layer": "C3_ENTRYPOINTS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 3, - "candidates_after_filter": 3 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 1, - "candidates_after_filter": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 4, - "candidates_after_filter": 4 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "RuntimeManager", - "alternatives": [ - "RuntimeManager" - ] - }, - "layers": [ - { - "layer": "C4_SEMANTIC_ROLES", - "status": "hit", - "hit_count": 12, - "fail_reason": null - }, - { - "layer": "C3_ENTRYPOINTS", - "status": "hit", - "hit_count": 3, - "fail_reason": null - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 8, - "fail_reason": null - }, - { - "layer": "C1_SYMBOL_CATALOG", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 1, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "router": 0, - "symbol_resolution": 0, - "retrieval_total": 153, - "retrieval_by_layer": { - "C4_SEMANTIC_ROLES": 33, - "C3_ENTRYPOINTS": 17, - "C2_DEPENDENCY_GRAPH": 60, - "C1_SYMBOL_CATALOG": 26, - "C0_SOURCE_CHUNKS": 15 - }, - "merge_rank": 21, - "prompt_build": 0, - "llm_call": 2396 - }, - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 480, - "evidence_rows": 25, - "evidence_chars": 8651 - }, - "evidence_summary": [ - { - "layer": "C4_SEMANTIC_ROLES", - "count": 12, - "unique_paths": 11 - }, - { - "layer": "C3_ENTRYPOINTS", - "count": 3, - "unique_paths": 1 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "count": 8, - "unique_paths": 2 - }, - { - "layer": "C1_SYMBOL_CATALOG", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 1, - "unique_paths": 1 - } - ], - "prompt_template_id": "intent_code_qa_architecture_ru_v1", - "system_prompt_version": "v1" - }, - "router": { - "conversation_mode": "START", - "keyword_hints": [ - "RuntimeManager" - ], - "path_scope": [] - }, - "llm": { - "used_evidence_count": 25, - "missing_evidence_reason": null - } - }, - "run_info": { - "case_id": "plba-fullchain-architecture-control-plane", - "mode": "full_chain", - "run_started_at": "2026-03-12T12:02:52", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - }, - "input_request": { - "text": "Какие компоненты участвуют в RuntimeManager?", - "normalized_query": "Какие компоненты участвуют в RuntimeManager?" - }, - "steps": [ - { - "step": "intent_router", - "input": { - "query": "Какие компоненты участвуют в RuntimeManager?" - }, - "output": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Какие компоненты участвуют в RuntimeManager?" - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "ARCHITECTURE", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C4_SEMANTIC_ROLES", - "C3_ENTRYPOINTS", - "C2_DEPENDENCY_GRAPH", - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "RuntimeManager" - ], - "keyword_hints": [ - "RuntimeManager" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "timings_ms": { - "router": 0 - } - } - }, - { - "step": "retrieval", - "input": { - "query": "Какие компоненты участвуют в RuntimeManager?" - }, - "output": { - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "RuntimeManager", - "alternatives": [ - "RuntimeManager" - ], - "confidence": 0.99 - }, - "rag_count": 25, - "rag_rows": [ - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests manager\n- orchestrates role-like calls (4)\n- reads and writes state attributes\n- participates in dataflow slices (50)", - "layer": "C4_SEMANTIC_ROLES", - "title": "RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 43, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "7e4a9381328c5803bbc6179458612fc4e947d928aa7bf8b4b2bebb2c8592f758", - "symbol_name": "RuntimeManager", - "qname": "RuntimeManager", - "role": "pipeline_stage", - "confidence": 0.67, - "dataflow_participation": 50, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "ControlActionSet\nrole: model\n\nResponsibilities:\n- default model role", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlActionSet", - "span_start": 14, - "span_end": 18, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 40, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "46eb026cb3313415ec47b82dd22f84f4d112c9d987e8b1716dcb0baa1cce8988", - "symbol_name": "ControlActionSet", - "qname": "ControlActionSet", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "ControlChannel\nrole: model\n\nResponsibilities:\n- default model role", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlChannel", - "span_start": 21, - "span_end": 28, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 40, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "cfcfe9a311d3a2dbdaf32ac4ccd73c0eb9a117f830591a1c0867ee97d46204ff", - "symbol_name": "ControlChannel", - "qname": "ControlChannel", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests service\n- reads and writes state attributes\n- participates in dataflow slices (5)", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlPlaneService", - "span_start": 12, - "span_end": 52, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 68, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "b13471e5916986dccffb53fab613812842965705e6b3a89ae549d30c9e91e9aa", - "symbol_name": "ControlPlaneService", - "qname": "ControlPlaneService", - "role": "pipeline_stage", - "confidence": 0.57, - "dataflow_participation": 5, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_runner.py", - "content": "UvicornThreadRunner\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (24)", - "layer": "C4_SEMANTIC_ROLES", - "title": "UvicornThreadRunner", - "span_start": 10, - "span_end": 61, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 11, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "fd55630045a02100df8877ac27d951ee08617d4598764394d48cb51fe067476a", - "symbol_name": "UvicornThreadRunner", - "qname": "UvicornThreadRunner", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 24, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "3779fdd2878b770e789a35bb2a89c9d79f13b61c26d7db1b3b683f9bb9e1623f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (10)", - "layer": "C4_SEMANTIC_ROLES", - "title": "HttpControlChannel", - "span_start": 12, - "span_end": 57, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 21, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "1c9fbdc24819e5604c26ea55428a74310f03a03e1af197ed84846af61e42fdb0", - "symbol_name": "HttpControlChannel", - "qname": "HttpControlChannel", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 10, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "HttpControlAppFactory\nrole: factory\n\nResponsibilities:\n- name suffix suggests factory", - "layer": "C4_SEMANTIC_ROLES", - "title": "HttpControlAppFactory", - "span_start": 15, - "span_end": 53, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 39, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "9b3502a5fb408b273223db13264349cf500de24915b6c649d9ea8970d0dfd8e0", - "symbol_name": "HttpControlAppFactory", - "qname": "HttpControlAppFactory", - "role": "factory", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/persistence/workflow_persistence.py", - "content": "WorkflowPersistence\nrole: pipeline_stage\n\nResponsibilities:\n- orchestrates role-like calls (2)\n- reads and writes state attributes\n- participates in dataflow slices (16)", - "layer": "C4_SEMANTIC_ROLES", - "title": "WorkflowPersistence", - "span_start": 8, - "span_end": 54, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 15, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "7bd01ee45cf31f2d5c2e3e51656254860ac785d10cef9e0852cd4fba90857bae", - "symbol_name": "WorkflowPersistence", - "qname": "WorkflowPersistence", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 16, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "80e9410ddc639789b4353c2a1a757ba8d0d5b5bb6075b0b263b61551f04ae1f0", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/queue/in_memory.py", - "content": "InMemoryTaskQueue\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (9)", - "layer": "C4_SEMANTIC_ROLES", - "title": "InMemoryTaskQueue", - "span_start": 9, - "span_end": 38, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 22, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "2da04cb94544a3bcbf0943a95ad4bdd8710bcafaa32a02fd0e4de2178dcf3533", - "symbol_name": "InMemoryTaskQueue", - "qname": "InMemoryTaskQueue", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 9, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "58f0cc001ccda0eee4c6bc32ed83bd05eafd6b6644f1e8b4aa9eed3103db73dc", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/config/file_loader.py", - "content": "ConfigFileLoader\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (8)", - "layer": "C4_SEMANTIC_ROLES", - "title": "ConfigFileLoader", - "span_start": 11, - "span_end": 48, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 23, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "a8474eca8b6e9dc86ae67ed68b16fa5fb639ef08739c053e7b7195489765667f", - "symbol_name": "ConfigFileLoader", - "qname": "ConfigFileLoader", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 8, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "1f19ffebde5e38e4be5a5d5a678059a0f36dedb8fb8b3e00ab395c67106a87ea", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/store.py", - "content": "TraceContextStore\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (6)", - "layer": "C4_SEMANTIC_ROLES", - "title": "TraceContextStore", - "span_start": 15, - "span_end": 52, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 25, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "b2dad4fbe16ffb11b58deba311c7739955c39d59f291b22181f33e9c8cce4059", - "symbol_name": "TraceContextStore", - "qname": "TraceContextStore", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 6, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "d369554f08fc92039c6edd5a2a1e73b23901533e8974459170bbd9347d263dc5", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workers/supervisor.py", - "content": "WorkerSupervisor\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (6)", - "layer": "C4_SEMANTIC_ROLES", - "title": "WorkerSupervisor", - "span_start": 10, - "span_end": 59, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 25, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "c17b44e8d9e97d490989b21fa67d7c346cdda8a0472e4c41fb243c8846faa124", - "symbol_name": "WorkerSupervisor", - "qname": "WorkerSupervisor", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 6, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "77609d9d5927171cce7fc3a54897c183fd63068710c6362029b700937aae5eee", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._start_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 47, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517", - "dst_ref": "ControlPlaneService._start_async", - "resolution": "resolved", - "slice_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._start_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager.start", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 32, - "span_end": 59, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "98312ace7fc62b1c7194c5aa1732b6ef736eae1668a3a120dd1ecd5ab1d64f7a", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "77a7b260193018845e4e204df094ab89cfd7c82ee4e822b3a83ad4cd945f9cb1", - "dst_ref": "RuntimeManager.start", - "resolution": "resolved", - "slice_id": "98312ace7fc62b1c7194c5aa1732b6ef736eae1668a3a120dd1ecd5ab1d64f7a", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager.start" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "77a7b260193018845e4e204df094ab89cfd7c82ee4e822b3a83ad4cd945f9cb1" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.start", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 20, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154", - "dst_ref": "ControlPlaneService.start", - "resolution": "resolved", - "slice_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.start" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.stop", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 25, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d", - "dst_ref": "ControlPlaneService.stop", - "resolution": "resolved", - "slice_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.stop" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._stop_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 51, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a", - "dst_ref": "ControlPlaneService._stop_async", - "resolution": "resolved", - "slice_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._stop_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager.add_config_file", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 32, - "span_end": 52, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "a23b8a11ebdb12708b60c96ea12a69f7f042082f1adfddd572444e246d81d167", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "57ffbd4f0d9fdf3507c2b8624312ce211f3d02fdf86a57a8ec90778d8a7b498d", - "dst_ref": "RuntimeManager.add_config_file", - "resolution": "resolved", - "slice_id": "a23b8a11ebdb12708b60c96ea12a69f7f042082f1adfddd572444e246d81d167", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager.add_config_file" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "57ffbd4f0d9fdf3507c2b8624312ce211f3d02fdf86a57a8ec90778d8a7b498d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.register_channel", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 17, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957", - "dst_ref": "ControlPlaneService.register_channel", - "resolution": "resolved", - "slice_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.register_channel" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager._register_core_services", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 32, - "span_end": 127, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "3e5811f3b511fa0cabe363f5d01f2ac5fa039bc8b93f7ee108323e1f5f45a293", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "972d6057a6caac9cf31ebc1e29c6f39f71b10d4cc170dec57cf875ba458549c6", - "dst_ref": "RuntimeManager._register_core_services", - "resolution": "resolved", - "slice_id": "3e5811f3b511fa0cabe363f5d01f2ac5fa039bc8b93f7ee108323e1f5f45a293", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager._register_core_services" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "972d6057a6caac9cf31ebc1e29c6f39f71b10d4cc170dec57cf875ba458549c6" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "class RuntimeManager\nRuntimeManager", - "layer": "C1_SYMBOL_CATALOG", - "title": "RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "7e4a9381328c5803bbc6179458612fc4e947d928aa7bf8b4b2bebb2c8592f758", - "qname": "RuntimeManager", - "kind": "class", - "signature": "RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.core.runtime", - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "class RuntimeManager:\n ACTION_TIMEOUT_SECONDS = 10.0\n ACTION_POLL_INTERVAL_SECONDS = 0.05\n\n def __init__(\n self,\n configuration: ConfigurationManager | None = None,\n services: ServiceContainer | None = None,\n traces: TraceService | None = None,\n health: HealthRegistry | None = None,\n logs: LogManager | None = None,\n workers: WorkerSupervisor | None = None,\n control_plane: ControlPlaneService | None = None,\n ) -> None:\n self.configuration = configuration or ConfigurationManager()\n self.services = services or ServiceContainer()\n self.traces = traces or TraceService()\n self.health = health or HealthRegistry()\n self.logs = logs or LogManager()\n self.workers = workers or WorkerSupervisor()\n self.control_plane = control_plane or ControlPlaneService()\n self.registry = ModuleRegistry(self.services)\n self._started = False\n self._state = LifecycleState.IDLE\n self._core_registered = False\n self._workers_registered = False\n self._register_core_services()\n\n def register_module(self, module: ApplicationModule) -> None:\n self.registry.register_module(module.name)\n module.register(self.registry)\n\n def add_config_file(self, path: str) -> FileConfigProvider:\n provider = FileConfigProvider(path)\n self.configuration.add_provider(provider)\n return provider\n\n def start(self, *, start_control_plane: bool = True) -> None:\n if self._started:\n return\n self._state = LifecycleState.STARTING\n config = self.configuration.load()\n self.logs.apply_config(config)\n self._register_health_contributors()\n self._register_workers()\n self.workers.start()\n if start_control_plane:\n self.control_plane.start(self)\n self._started = True\n self._refresh_state()\n\n def stop(self, timeout: float = 30.0, force: bool = False, stop_control_plane: bool = True) -> None:\n if not self._started:\n return\n self._state = LifecycleState.STOPPING\n self.workers.stop(timeout=timeout, force=force)\n if stop_control_plane:\n self.control_plane.stop()\n self._started = False\n self._state = LifecycleState.STOPPED\n\n def status(self) -> dict[str, object]:\n self._refresh_state()\n return self.control_plane.snapshot(self)\n\n def current_health(self) -> HealthPayload:\n self._refresh_state()\n return self.health.payload(self._state, self.workers.healths())\n\n async def health_status(self) -> HealthPayload:\n return self.current_health()\n\n async def start_runtime(self) -> dict[str, object] | str:\n self._refresh_state()\n if self._started:\n return \"runtime already running\"\n if self._state == LifecycleState.STOPPING:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n\n self.start(start_control_plane=False)\n started = self._wait_for_state({LifecycleState.IDLE, LifecycleState.BUSY}, timeout=self.ACTION_TIMEOUT_SECONDS)\n if started:\n return self._action_detail(\"runtime started\", timed_out=False)\n return self._action_detail(\"runtime start is still in progress\", timed_out=True)\n\n async def stop_runtime(self) -> dict[str, object] | str:\n self._refresh_state()\n if not self._started:\n if self._state == LifecycleState.STOPPING:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n return \"runtime already stopped\"\n\n self._state = LifecycleState.STOPPING\n try:\n self.workers.stop(timeout=self.ACTION_TIMEOUT_SECONDS, force=False)\n except TimeoutError:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n\n self._started = False\n self._state = LifecycleState.STOPPED\n return self._action_detail(\"runtime stopped\", timed_out=False)\n\n async def runtime_status(self) -> str:\n self._refresh_state()\n return self._state.value\n\n def _register_core_services(self) -> None:\n if self._core_registered:\n return\n self.services.register(\"configuration\", self.configuration)\n self.services.register(\"traces\", self.traces)\n self.services.register(\"health\", self.health)\n self.services.register(\"logs\", self.logs)\n self.services.register(\"workers\", self.workers)\n self.services.register(\"control_plane\", self.control_plane)\n self._core_registered = True\n\n def _register_health_contributors(self) -> None:\n for contributor in self.registry.health_contributors:\n self.health.register(contributor)\n\n def _register_workers(self) -> None:\n if self._workers_registered:\n return\n for worker in self.registry.workers:\n self.workers.register(worker)\n self._workers_registered = True\n\n def _refresh_state(self) -> None:\n lifecycle = self.workers.lifecycle_state()\n\n if self._state == LifecycleState.STOPPING:\n if lifecycle == LifecycleState.STOPPED:\n self._started = False\n self._state = LifecycleState.STOPPED\n return\n\n if not self._started:\n if lifecycle == LifecycleState.STOPPED:\n self._state = LifecycleState.STOPPED\n return\n\n self._state = lifecycle\n\n def _wait_for_state(self, target_states: set[LifecycleState], *, timeout: float) -> bool:\n deadline = monotonic() + timeout\n while monotonic() < deadline:\n self._refresh_state()\n if self._state in target_states:\n return True\n sleep(self.ACTION_POLL_INTERVAL_SECONDS)\n self._refresh_state()\n return self._state in target_states\n\n def _action_detail(self, message: str, *, timed_out: bool) -> dict[str, object]:\n self._refresh_state()\n return {\n \"message\": message,\n \"state\": self._state.value,\n \"timed_out\": timed_out,\n \"workers\": self.workers.snapshot(),\n }", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/core/runtime.py:RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.core.runtime", - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ] - }, - "diagnostics": { - "execution": { - "executed_layers": [ - "C4_SEMANTIC_ROLES", - "C3_ENTRYPOINTS", - "C2_DEPENDENCY_GRAPH", - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS" - ], - "retrieval_mode_by_layer": { - "C4_SEMANTIC_ROLES": "exact_path_fetch", - "C3_ENTRYPOINTS": "exact_path_fetch", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C1_SYMBOL_CATALOG": "symbol_search", - "C0_SOURCE_CHUNKS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C4_SEMANTIC_ROLES": 12, - "C3_ENTRYPOINTS": 8, - "C2_DEPENDENCY_GRAPH": 8, - "C1_SYMBOL_CATALOG": 6, - "C0_SOURCE_CHUNKS": 4 - }, - "filters_by_layer": { - "C4_SEMANTIC_ROLES": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C1_SYMBOL_CATALOG": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C4_SEMANTIC_ROLES", - "query": "Какие компоненты участвуют в RuntimeManager?", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 12, - "ranking_profile": "code" - }, - { - "layer": "C3_ENTRYPOINTS", - "query": "Какие компоненты участвуют в RuntimeManager?", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "Какие компоненты участвуют в RuntimeManager?", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C1_SYMBOL_CATALOG", - "query": "RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Какие компоненты участвуют в RuntimeManager?", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 4, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C4_SEMANTIC_ROLES", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 12, - "candidates_after_filter": 12 - }, - { - "layer": "C3_ENTRYPOINTS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 3, - "candidates_after_filter": 3 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 1, - "candidates_after_filter": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 4, - "candidates_after_filter": 4 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "RuntimeManager", - "alternatives": [ - "RuntimeManager" - ] - }, - "layers": [ - { - "layer": "C4_SEMANTIC_ROLES", - "status": "hit", - "hit_count": 12, - "fail_reason": null - }, - { - "layer": "C3_ENTRYPOINTS", - "status": "hit", - "hit_count": 3, - "fail_reason": null - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 8, - "fail_reason": null - }, - { - "layer": "C1_SYMBOL_CATALOG", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 1, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "symbol_resolution": 0, - "retrieval_total": 153, - "retrieval_by_layer": { - "C4_SEMANTIC_ROLES": 33, - "C3_ENTRYPOINTS": 17, - "C2_DEPENDENCY_GRAPH": 60, - "C1_SYMBOL_CATALOG": 26, - "C0_SOURCE_CHUNKS": 15 - }, - "merge_rank": 21 - } - } - }, - { - "step": "llm_answer", - "input": { - "query": "Какие компоненты участвуют в RuntimeManager?", - "rag_count": 25 - }, - "output": { - "llm_answer": "## Архитектурное объяснение подсистемы RuntimeManager\n\n### Основные компоненты и их роли\n\n1. **RuntimeManager**\n - Роль: Pipeline stage (этап конвейера).\n - Описание: Менеджер, отвечающий за оркестровку и координацию ролей-подсистем, участвующих в выполнении бизнес-требований. Читает и записывает состояние атрибутов системы, участвует в потоках данных.\n\n2. **ControlActionSet**\n - Роль: Модель поведения системы.\n - Описание: Базовый класс для определения действий управления системой, реализует модель по умолчанию.\n\n### Связи и границы ответственности\n\n- **RuntimeManager** взаимодействует с **ControlActionSet**, инициируя выполнение заданных моделей поведения через зависимости и вызовы методов модели.\n- Контейнер Dependency Injection (DI) обеспечивает внедрение зависимостей объектов из внешних систем или сервисов.\n- Потоки данных разделены на участки (slices), что позволяет разделить ответственность компонентов и улучшить масштабируемость и модульность системы.\n\n### Ключевые выводы по архитектуре\n\n1. **Конвейерный подход**: Система организована вокруг понятий pipeline stages, где каждый менеджер отвечает за конкретный этап выполнения задач.\n \n2. **Модульная структура**: Использование Dependency Injection и четкое разделение ответственности позволяет легко заменять и расширять отдельные модули без изменения общей архитектуры.\n\n3. **Управление состоянием**: RuntimeManager активно управляет состоянием системы, читая и записывая необходимые атрибуты, обеспечивая целостность и согласованность данных.\n\n4. **Масштабируемость**: Разделение потоков данных на slices улучшает производительность и облегчает параллельное выполнение задач." - }, - "diagnostics": { - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 480, - "evidence_rows": 25, - "evidence_chars": 8651 - }, - "evidence_summary": [ - { - "layer": "C4_SEMANTIC_ROLES", - "count": 12, - "unique_paths": 11 - }, - { - "layer": "C3_ENTRYPOINTS", - "count": 3, - "unique_paths": 1 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "count": 8, - "unique_paths": 2 - }, - { - "layer": "C1_SYMBOL_CATALOG", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 1, - "unique_paths": 1 - } - ], - "prompt_template_id": "intent_code_qa_architecture_ru_v1", - "system_prompt_version": "v1" - }, - "timings_ms": { - "prompt_build": 0, - "llm_call": 2396 - } - } - } - ] - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents/20260312_120252/full_chain_plba_code_subintents_plba-fullchain-architecture-control-plane.md b/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents/20260312_120252/full_chain_plba_code_subintents_plba-fullchain-architecture-control-plane.md deleted file mode 100644 index 92f62c8..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents/20260312_120252/full_chain_plba_code_subintents_plba-fullchain-architecture-control-plane.md +++ /dev/null @@ -1,34 +0,0 @@ -# plba-fullchain-architecture-control-plane - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_subintents.yaml -- runner: runtime -- mode: full_chain -- passed: True - -## Query -Какие компоненты участвуют в RuntimeManager? - -## Actual -{ - "intent": "CODE_QA", - "sub_intent": "ARCHITECTURE", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 25, - "llm_answer": "## Архитектурное объяснение подсистемы RuntimeManager\n\n### Основные компоненты и их роли\n\n1. **RuntimeManager**\n - Роль: Pipeline stage (этап конвейера).\n - Описание: Менеджер, отвечающий за оркестровку и координацию ролей-подсистем, участвующих в выполнении бизнес-требований. Читает и записывает состояние атрибутов системы, участвует в потоках данных.\n\n2. **ControlActionSet**\n - Роль: Модель поведения системы.\n - Описание: Базовый класс для определения действий управления системой, реализует модель по умолчанию.\n\n### Связи и границы ответственности\n\n- **RuntimeManager** взаимодействует с **ControlActionSet**, инициируя выполнение заданных моделей поведения через зависимости и вызовы методов модели.\n- Контейнер Dependency Injection (DI) обеспечивает внедрение зависимостей объектов из внешних систем или сервисов.\n- Потоки данных разделены на участки (slices), что позволяет разделить ответственность компонентов и улучшить масштабируемость и модульность системы.\n\n### Ключевые выводы по архитектуре\n\n1. **Конвейерный подход**: Система организована вокруг понятий pipeline stages, где каждый менеджер отвечает за конкретный этап выполнения задач.\n \n2. **Модульная структура**: Использование Dependency Injection и четкое разделение ответственности позволяет легко заменять и расширять отдельные модули без изменения общей архитектуры.\n\n3. **Управление состоянием**: RuntimeManager активно управляет состоянием системы, читая и записывая необходимые атрибуты, обеспечивая целостность и согласованность данных.\n\n4. **Масштабируемость**: Разделение потоков данных на slices улучшает производительность и облегчает параллельное выполнение задач.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "RuntimeManager" - ], - "layers": [ - "C4_SEMANTIC_ROLES", - "C3_ENTRYPOINTS", - "C2_DEPENDENCY_GRAPH", - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS" - ] -} - -## Mismatches -- none \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents/20260312_120252/full_chain_plba_code_subintents_plba-fullchain-explain-local-runtime-manager.json b/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents/20260312_120252/full_chain_plba_code_subintents_plba-fullchain-explain-local-runtime-manager.json deleted file mode 100644 index 6cbf580..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents/20260312_120252/full_chain_plba_code_subintents_plba-fullchain-explain-local-runtime-manager.json +++ /dev/null @@ -1,1333 +0,0 @@ -{ - "case_id": "plba-fullchain-explain-local-runtime-manager", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_subintents.yaml", - "runner": "runtime", - "mode": "full_chain", - "actual": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN_LOCAL", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 6, - "llm_answer": "Класс `RuntimeManager` в файле `src/app_runtime/core/runtime.py` играет роль центрального координатора для инициализации и управления ресурсами приложения во время его выполнения.\n\n### Что делает класс:\n- При создании экземпляра класса (через метод `__init__`) происходит начальная настройка всех необходимых сервисов и компонентов через передачу параметров конфигурации (`configuration`), контейнер сервисов (`services`), сервис трассировки (`traces`), реестр здоровья (`health`), менеджер логирования (`logs`), супервизор рабочих процессов (`workers`) и служба контроля плоскости (`control_plane`).\n \n- В методе `__init__` все переданные параметры либо используются напрямую, либо заменяются дефолтными значениями при их отсутствии. Это позволяет гибко настраивать работу приложения даже без полного набора аргументов.\n\n- Важным аспектом является регистрация модулей (`self.registry = ModuleRegistry(self.services)`), которая позволяет отслеживать и управлять загруженными модулями приложения.\n\n### Входные данные:\n- Параметры настройки конфигурации и сервисов.\n\n### Выходные данные:\n- Настроенный объект `RuntimeManager`, готовый к работе с основными компонентами приложения.\n\n### Связь с окружением:\n- Метод `start()` вызывается после инициализации для начала работы основных сервисов и механизмов мониторинга состояния.\n- Класс взаимодействует с другими компонентами системы через свои атрибуты и методы регистрации, обеспечивая целостность и корректность работы всего runtime-среды приложения.", - "answer_mode": "answered", - "path_scope": [ - "src/app_runtime/core/runtime.py" - ], - "symbol_candidates": [ - "RuntimeManager" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C2_DEPENDENCY_GRAPH" - ] - }, - "passed": true, - "mismatches": [], - "details": { - "case_id": "plba-fullchain-explain-local-runtime-manager", - "text": "Почему в файле src/app_runtime/core/runtime.py класс RuntimeManager устроен так?", - "mode": "full_chain", - "run_started_at": "2026-03-12T12:02:52", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Почему в файле src/app_runtime/core/runtime.py класс RuntimeManager устроен так?", - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "RuntimeManager", - "alternatives": [ - "RuntimeManager" - ], - "confidence": 0.99 - }, - "rag_count": 6, - "rag_rows": [ - { - "path": "src/app_runtime/core/runtime.py", - "content": "class RuntimeManager\nRuntimeManager", - "layer": "C1_SYMBOL_CATALOG", - "title": "RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "7e4a9381328c5803bbc6179458612fc4e947d928aa7bf8b4b2bebb2c8592f758", - "qname": "RuntimeManager", - "kind": "class", - "signature": "RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.core.runtime", - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager.start", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 32, - "span_end": 59, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "98312ace7fc62b1c7194c5aa1732b6ef736eae1668a3a120dd1ecd5ab1d64f7a", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "77a7b260193018845e4e204df094ab89cfd7c82ee4e822b3a83ad4cd945f9cb1", - "dst_ref": "RuntimeManager.start", - "resolution": "resolved", - "slice_id": "98312ace7fc62b1c7194c5aa1732b6ef736eae1668a3a120dd1ecd5ab1d64f7a", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager.start" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "77a7b260193018845e4e204df094ab89cfd7c82ee4e822b3a83ad4cd945f9cb1" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager._register_core_services", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 32, - "span_end": 127, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "3e5811f3b511fa0cabe363f5d01f2ac5fa039bc8b93f7ee108323e1f5f45a293", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "972d6057a6caac9cf31ebc1e29c6f39f71b10d4cc170dec57cf875ba458549c6", - "dst_ref": "RuntimeManager._register_core_services", - "resolution": "resolved", - "slice_id": "3e5811f3b511fa0cabe363f5d01f2ac5fa039bc8b93f7ee108323e1f5f45a293", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager._register_core_services" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "972d6057a6caac9cf31ebc1e29c6f39f71b10d4cc170dec57cf875ba458549c6" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager.add_config_file", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 32, - "span_end": 52, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "a23b8a11ebdb12708b60c96ea12a69f7f042082f1adfddd572444e246d81d167", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "57ffbd4f0d9fdf3507c2b8624312ce211f3d02fdf86a57a8ec90778d8a7b498d", - "dst_ref": "RuntimeManager.add_config_file", - "resolution": "resolved", - "slice_id": "a23b8a11ebdb12708b60c96ea12a69f7f042082f1adfddd572444e246d81d167", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager.add_config_file" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "57ffbd4f0d9fdf3507c2b8624312ce211f3d02fdf86a57a8ec90778d8a7b498d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.services\n -> RuntimeManager.__init__", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 33, - "span_end": 39, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "d43af85989222ee6d788ce418cdcb217c7ff044cfb915e3bdbd184417dc7bd61", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "dst_ref": "RuntimeManager.__init__", - "resolution": "resolved", - "slice_id": "d43af85989222ee6d788ce418cdcb217c7ff044cfb915e3bdbd184417dc7bd61", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.services", - "RuntimeManager.__init__" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "class RuntimeManager:\n ACTION_TIMEOUT_SECONDS = 10.0\n ACTION_POLL_INTERVAL_SECONDS = 0.05\n\n def __init__(\n self,\n configuration: ConfigurationManager | None = None,\n services: ServiceContainer | None = None,\n traces: TraceService | None = None,\n health: HealthRegistry | None = None,\n logs: LogManager | None = None,\n workers: WorkerSupervisor | None = None,\n control_plane: ControlPlaneService | None = None,\n ) -> None:\n self.configuration = configuration or ConfigurationManager()\n self.services = services or ServiceContainer()\n self.traces = traces or TraceService()\n self.health = health or HealthRegistry()\n self.logs = logs or LogManager()\n self.workers = workers or WorkerSupervisor()\n self.control_plane = control_plane or ControlPlaneService()\n self.registry = ModuleRegistry(self.services)\n self._started = False\n self._state = LifecycleState.IDLE\n self._core_registered = False\n self._workers_registered = False\n self._register_core_services()\n\n def register_module(self, module: ApplicationModule) -> None:\n self.registry.register_module(module.name)\n module.register(self.registry)\n\n def add_config_file(self, path: str) -> FileConfigProvider:\n provider = FileConfigProvider(path)\n self.configuration.add_provider(provider)\n return provider\n\n def start(self, *, start_control_plane: bool = True) -> None:\n if self._started:\n return\n self._state = LifecycleState.STARTING\n config = self.configuration.load()\n self.logs.apply_config(config)\n self._register_health_contributors()\n self._register_workers()\n self.workers.start()\n if start_control_plane:\n self.control_plane.start(self)\n self._started = True\n self._refresh_state()\n\n def stop(self, timeout: float = 30.0, force: bool = False, stop_control_plane: bool = True) -> None:\n if not self._started:\n return\n self._state = LifecycleState.STOPPING\n self.workers.stop(timeout=timeout, force=force)\n if stop_control_plane:\n self.control_plane.stop()\n self._started = False\n self._state = LifecycleState.STOPPED\n\n def status(self) -> dict[str, object]:\n self._refresh_state()\n return self.control_plane.snapshot(self)\n\n def current_health(self) -> HealthPayload:\n self._refresh_state()\n return self.health.payload(self._state, self.workers.healths())\n\n async def health_status(self) -> HealthPayload:\n return self.current_health()\n\n async def start_runtime(self) -> dict[str, object] | str:\n self._refresh_state()\n if self._started:\n return \"runtime already running\"\n if self._state == LifecycleState.STOPPING:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n\n self.start(start_control_plane=False)\n started = self._wait_for_state({LifecycleState.IDLE, LifecycleState.BUSY}, timeout=self.ACTION_TIMEOUT_SECONDS)\n if started:\n return self._action_detail(\"runtime started\", timed_out=False)\n return self._action_detail(\"runtime start is still in progress\", timed_out=True)\n\n async def stop_runtime(self) -> dict[str, object] | str:\n self._refresh_state()\n if not self._started:\n if self._state == LifecycleState.STOPPING:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n return \"runtime already stopped\"\n\n self._state = LifecycleState.STOPPING\n try:\n self.workers.stop(timeout=self.ACTION_TIMEOUT_SECONDS, force=False)\n except TimeoutError:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n\n self._started = False\n self._state = LifecycleState.STOPPED\n return self._action_detail(\"runtime stopped\", timed_out=False)\n\n async def runtime_status(self) -> str:\n self._refresh_state()\n return self._state.value\n\n def _register_core_services(self) -> None:\n if self._core_registered:\n return\n self.services.register(\"configuration\", self.configuration)\n self.services.register(\"traces\", self.traces)\n self.services.register(\"health\", self.health)\n self.services.register(\"logs\", self.logs)\n self.services.register(\"workers\", self.workers)\n self.services.register(\"control_plane\", self.control_plane)\n self._core_registered = True\n\n def _register_health_contributors(self) -> None:\n for contributor in self.registry.health_contributors:\n self.health.register(contributor)\n\n def _register_workers(self) -> None:\n if self._workers_registered:\n return\n for worker in self.registry.workers:\n self.workers.register(worker)\n self._workers_registered = True\n\n def _refresh_state(self) -> None:\n lifecycle = self.workers.lifecycle_state()\n\n if self._state == LifecycleState.STOPPING:\n if lifecycle == LifecycleState.STOPPED:\n self._started = False\n self._state = LifecycleState.STOPPED\n return\n\n if not self._started:\n if lifecycle == LifecycleState.STOPPED:\n self._state = LifecycleState.STOPPED\n return\n\n self._state = lifecycle\n\n def _wait_for_state(self, target_states: set[LifecycleState], *, timeout: float) -> bool:\n deadline = monotonic() + timeout\n while monotonic() < deadline:\n self._refresh_state()\n if self._state in target_states:\n return True\n sleep(self.ACTION_POLL_INTERVAL_SECONDS)\n self._refresh_state()\n return self._state in target_states\n\n def _action_detail(self, message: str, *, timed_out: bool) -> dict[str, object]:\n self._refresh_state()\n return {\n \"message\": message,\n \"state\": self._state.value,\n \"timed_out\": timed_out,\n \"workers\": self.workers.snapshot(),\n }", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/core/runtime.py:RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.core.runtime", - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "llm_answer": "Класс `RuntimeManager` в файле `src/app_runtime/core/runtime.py` играет роль центрального координатора для инициализации и управления ресурсами приложения во время его выполнения.\n\n### Что делает класс:\n- При создании экземпляра класса (через метод `__init__`) происходит начальная настройка всех необходимых сервисов и компонентов через передачу параметров конфигурации (`configuration`), контейнер сервисов (`services`), сервис трассировки (`traces`), реестр здоровья (`health`), менеджер логирования (`logs`), супервизор рабочих процессов (`workers`) и служба контроля плоскости (`control_plane`).\n \n- В методе `__init__` все переданные параметры либо используются напрямую, либо заменяются дефолтными значениями при их отсутствии. Это позволяет гибко настраивать работу приложения даже без полного набора аргументов.\n\n- Важным аспектом является регистрация модулей (`self.registry = ModuleRegistry(self.services)`), которая позволяет отслеживать и управлять загруженными модулями приложения.\n\n### Входные данные:\n- Параметры настройки конфигурации и сервисов.\n\n### Выходные данные:\n- Настроенный объект `RuntimeManager`, готовый к работе с основными компонентами приложения.\n\n### Связь с окружением:\n- Метод `start()` вызывается после инициализации для начала работы основных сервисов и механизмов мониторинга состояния.\n- Класс взаимодействует с другими компонентами системы через свои атрибуты и методы регистрации, обеспечивая целостность и корректность работы всего runtime-среды приложения.", - "summary": { - "router": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN_LOCAL", - "confidence": null - }, - "retrieval": { - "profile": "code", - "layers_hit": [ - "C0_SOURCE_CHUNKS", - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH" - ], - "evidence_sufficient": true - }, - "llm": { - "answer_status": "answered", - "groundedness": "grounded" - } - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN_LOCAL", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C2_DEPENDENCY_GRAPH" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "RuntimeManager" - ], - "keyword_hints": [ - "src/app_runtime/core/runtime.py", - "RuntimeManager" - ], - "path_hints": [ - "src/app_runtime/core/runtime.py" - ], - "path_scope": [ - "src/app_runtime/core/runtime.py" - ], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C2_DEPENDENCY_GRAPH" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C0_SOURCE_CHUNKS": "exact_path_fetch", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 12, - "C2_DEPENDENCY_GRAPH": 4 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [ - "src/app_runtime/core/runtime.py" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src/app_runtime/core/runtime.py" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src/app_runtime/core/runtime.py" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "RuntimeManager", - "path_scope": [ - "src/app_runtime/core/runtime.py" - ], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Почему в файле src/app_runtime/core/runtime.py класс RuntimeManager устроен так?", - "path_scope": [ - "src/app_runtime/core/runtime.py" - ], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 12, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "Почему в файле src/app_runtime/core/runtime.py класс RuntimeManager устроен так?", - "path_scope": [ - "src/app_runtime/core/runtime.py" - ], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 4, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [ - "src/app_runtime/core/runtime.py" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 1, - "candidates_after_filter": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src/app_runtime/core/runtime.py" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 1, - "candidates_after_filter": 1 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src/app_runtime/core/runtime.py" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 4, - "candidates_after_filter": 4 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "RuntimeManager", - "alternatives": [ - "RuntimeManager" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 4, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "router": 0, - "symbol_resolution": 0, - "retrieval_total": 70, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 27, - "C0_SOURCE_CHUNKS": 19, - "C2_DEPENDENCY_GRAPH": 23 - }, - "merge_rank": 20, - "prompt_build": 0, - "llm_call": 2177 - }, - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 784, - "evidence_rows": 6, - "evidence_chars": 6650 - }, - "evidence_summary": [ - { - "layer": "C1_SYMBOL_CATALOG", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "count": 4, - "unique_paths": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 1, - "unique_paths": 1 - } - ], - "prompt_template_id": "intent_code_qa_explain_local_ru_v1", - "system_prompt_version": "v1" - }, - "router": { - "conversation_mode": "START", - "keyword_hints": [ - "src/app_runtime/core/runtime.py", - "RuntimeManager" - ], - "path_scope": [ - "src/app_runtime/core/runtime.py" - ] - }, - "llm": { - "used_evidence_count": 6, - "missing_evidence_reason": null - } - }, - "run_info": { - "case_id": "plba-fullchain-explain-local-runtime-manager", - "mode": "full_chain", - "run_started_at": "2026-03-12T12:02:52", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - }, - "input_request": { - "text": "Почему в файле src/app_runtime/core/runtime.py класс RuntimeManager устроен так?", - "normalized_query": "Почему в файле src/app_runtime/core/runtime.py класс RuntimeManager устроен так?" - }, - "steps": [ - { - "step": "intent_router", - "input": { - "query": "Почему в файле src/app_runtime/core/runtime.py класс RuntimeManager устроен так?" - }, - "output": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Почему в файле src/app_runtime/core/runtime.py класс RuntimeManager устроен так?" - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN_LOCAL", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C2_DEPENDENCY_GRAPH" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "RuntimeManager" - ], - "keyword_hints": [ - "src/app_runtime/core/runtime.py", - "RuntimeManager" - ], - "path_hints": [ - "src/app_runtime/core/runtime.py" - ], - "path_scope": [ - "src/app_runtime/core/runtime.py" - ], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "timings_ms": { - "router": 0 - } - } - }, - { - "step": "retrieval", - "input": { - "query": "Почему в файле src/app_runtime/core/runtime.py класс RuntimeManager устроен так?" - }, - "output": { - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "RuntimeManager", - "alternatives": [ - "RuntimeManager" - ], - "confidence": 0.99 - }, - "rag_count": 6, - "rag_rows": [ - { - "path": "src/app_runtime/core/runtime.py", - "content": "class RuntimeManager\nRuntimeManager", - "layer": "C1_SYMBOL_CATALOG", - "title": "RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "7e4a9381328c5803bbc6179458612fc4e947d928aa7bf8b4b2bebb2c8592f758", - "qname": "RuntimeManager", - "kind": "class", - "signature": "RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.core.runtime", - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager.start", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 32, - "span_end": 59, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "98312ace7fc62b1c7194c5aa1732b6ef736eae1668a3a120dd1ecd5ab1d64f7a", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "77a7b260193018845e4e204df094ab89cfd7c82ee4e822b3a83ad4cd945f9cb1", - "dst_ref": "RuntimeManager.start", - "resolution": "resolved", - "slice_id": "98312ace7fc62b1c7194c5aa1732b6ef736eae1668a3a120dd1ecd5ab1d64f7a", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager.start" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "77a7b260193018845e4e204df094ab89cfd7c82ee4e822b3a83ad4cd945f9cb1" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager._register_core_services", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 32, - "span_end": 127, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "3e5811f3b511fa0cabe363f5d01f2ac5fa039bc8b93f7ee108323e1f5f45a293", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "972d6057a6caac9cf31ebc1e29c6f39f71b10d4cc170dec57cf875ba458549c6", - "dst_ref": "RuntimeManager._register_core_services", - "resolution": "resolved", - "slice_id": "3e5811f3b511fa0cabe363f5d01f2ac5fa039bc8b93f7ee108323e1f5f45a293", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager._register_core_services" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "972d6057a6caac9cf31ebc1e29c6f39f71b10d4cc170dec57cf875ba458549c6" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager.add_config_file", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 32, - "span_end": 52, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "a23b8a11ebdb12708b60c96ea12a69f7f042082f1adfddd572444e246d81d167", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "57ffbd4f0d9fdf3507c2b8624312ce211f3d02fdf86a57a8ec90778d8a7b498d", - "dst_ref": "RuntimeManager.add_config_file", - "resolution": "resolved", - "slice_id": "a23b8a11ebdb12708b60c96ea12a69f7f042082f1adfddd572444e246d81d167", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager.add_config_file" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "57ffbd4f0d9fdf3507c2b8624312ce211f3d02fdf86a57a8ec90778d8a7b498d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.services\n -> RuntimeManager.__init__", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 33, - "span_end": 39, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "d43af85989222ee6d788ce418cdcb217c7ff044cfb915e3bdbd184417dc7bd61", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "dst_ref": "RuntimeManager.__init__", - "resolution": "resolved", - "slice_id": "d43af85989222ee6d788ce418cdcb217c7ff044cfb915e3bdbd184417dc7bd61", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.services", - "RuntimeManager.__init__" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "class RuntimeManager:\n ACTION_TIMEOUT_SECONDS = 10.0\n ACTION_POLL_INTERVAL_SECONDS = 0.05\n\n def __init__(\n self,\n configuration: ConfigurationManager | None = None,\n services: ServiceContainer | None = None,\n traces: TraceService | None = None,\n health: HealthRegistry | None = None,\n logs: LogManager | None = None,\n workers: WorkerSupervisor | None = None,\n control_plane: ControlPlaneService | None = None,\n ) -> None:\n self.configuration = configuration or ConfigurationManager()\n self.services = services or ServiceContainer()\n self.traces = traces or TraceService()\n self.health = health or HealthRegistry()\n self.logs = logs or LogManager()\n self.workers = workers or WorkerSupervisor()\n self.control_plane = control_plane or ControlPlaneService()\n self.registry = ModuleRegistry(self.services)\n self._started = False\n self._state = LifecycleState.IDLE\n self._core_registered = False\n self._workers_registered = False\n self._register_core_services()\n\n def register_module(self, module: ApplicationModule) -> None:\n self.registry.register_module(module.name)\n module.register(self.registry)\n\n def add_config_file(self, path: str) -> FileConfigProvider:\n provider = FileConfigProvider(path)\n self.configuration.add_provider(provider)\n return provider\n\n def start(self, *, start_control_plane: bool = True) -> None:\n if self._started:\n return\n self._state = LifecycleState.STARTING\n config = self.configuration.load()\n self.logs.apply_config(config)\n self._register_health_contributors()\n self._register_workers()\n self.workers.start()\n if start_control_plane:\n self.control_plane.start(self)\n self._started = True\n self._refresh_state()\n\n def stop(self, timeout: float = 30.0, force: bool = False, stop_control_plane: bool = True) -> None:\n if not self._started:\n return\n self._state = LifecycleState.STOPPING\n self.workers.stop(timeout=timeout, force=force)\n if stop_control_plane:\n self.control_plane.stop()\n self._started = False\n self._state = LifecycleState.STOPPED\n\n def status(self) -> dict[str, object]:\n self._refresh_state()\n return self.control_plane.snapshot(self)\n\n def current_health(self) -> HealthPayload:\n self._refresh_state()\n return self.health.payload(self._state, self.workers.healths())\n\n async def health_status(self) -> HealthPayload:\n return self.current_health()\n\n async def start_runtime(self) -> dict[str, object] | str:\n self._refresh_state()\n if self._started:\n return \"runtime already running\"\n if self._state == LifecycleState.STOPPING:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n\n self.start(start_control_plane=False)\n started = self._wait_for_state({LifecycleState.IDLE, LifecycleState.BUSY}, timeout=self.ACTION_TIMEOUT_SECONDS)\n if started:\n return self._action_detail(\"runtime started\", timed_out=False)\n return self._action_detail(\"runtime start is still in progress\", timed_out=True)\n\n async def stop_runtime(self) -> dict[str, object] | str:\n self._refresh_state()\n if not self._started:\n if self._state == LifecycleState.STOPPING:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n return \"runtime already stopped\"\n\n self._state = LifecycleState.STOPPING\n try:\n self.workers.stop(timeout=self.ACTION_TIMEOUT_SECONDS, force=False)\n except TimeoutError:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n\n self._started = False\n self._state = LifecycleState.STOPPED\n return self._action_detail(\"runtime stopped\", timed_out=False)\n\n async def runtime_status(self) -> str:\n self._refresh_state()\n return self._state.value\n\n def _register_core_services(self) -> None:\n if self._core_registered:\n return\n self.services.register(\"configuration\", self.configuration)\n self.services.register(\"traces\", self.traces)\n self.services.register(\"health\", self.health)\n self.services.register(\"logs\", self.logs)\n self.services.register(\"workers\", self.workers)\n self.services.register(\"control_plane\", self.control_plane)\n self._core_registered = True\n\n def _register_health_contributors(self) -> None:\n for contributor in self.registry.health_contributors:\n self.health.register(contributor)\n\n def _register_workers(self) -> None:\n if self._workers_registered:\n return\n for worker in self.registry.workers:\n self.workers.register(worker)\n self._workers_registered = True\n\n def _refresh_state(self) -> None:\n lifecycle = self.workers.lifecycle_state()\n\n if self._state == LifecycleState.STOPPING:\n if lifecycle == LifecycleState.STOPPED:\n self._started = False\n self._state = LifecycleState.STOPPED\n return\n\n if not self._started:\n if lifecycle == LifecycleState.STOPPED:\n self._state = LifecycleState.STOPPED\n return\n\n self._state = lifecycle\n\n def _wait_for_state(self, target_states: set[LifecycleState], *, timeout: float) -> bool:\n deadline = monotonic() + timeout\n while monotonic() < deadline:\n self._refresh_state()\n if self._state in target_states:\n return True\n sleep(self.ACTION_POLL_INTERVAL_SECONDS)\n self._refresh_state()\n return self._state in target_states\n\n def _action_detail(self, message: str, *, timed_out: bool) -> dict[str, object]:\n self._refresh_state()\n return {\n \"message\": message,\n \"state\": self._state.value,\n \"timed_out\": timed_out,\n \"workers\": self.workers.snapshot(),\n }", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/core/runtime.py:RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.core.runtime", - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ] - }, - "diagnostics": { - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C2_DEPENDENCY_GRAPH" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C0_SOURCE_CHUNKS": "exact_path_fetch", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 12, - "C2_DEPENDENCY_GRAPH": 4 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [ - "src/app_runtime/core/runtime.py" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src/app_runtime/core/runtime.py" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src/app_runtime/core/runtime.py" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "RuntimeManager", - "path_scope": [ - "src/app_runtime/core/runtime.py" - ], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Почему в файле src/app_runtime/core/runtime.py класс RuntimeManager устроен так?", - "path_scope": [ - "src/app_runtime/core/runtime.py" - ], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 12, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "Почему в файле src/app_runtime/core/runtime.py класс RuntimeManager устроен так?", - "path_scope": [ - "src/app_runtime/core/runtime.py" - ], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 4, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [ - "src/app_runtime/core/runtime.py" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 1, - "candidates_after_filter": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src/app_runtime/core/runtime.py" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 1, - "candidates_after_filter": 1 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src/app_runtime/core/runtime.py" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 4, - "candidates_after_filter": 4 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "RuntimeManager", - "alternatives": [ - "RuntimeManager" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 4, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "symbol_resolution": 0, - "retrieval_total": 70, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 27, - "C0_SOURCE_CHUNKS": 19, - "C2_DEPENDENCY_GRAPH": 23 - }, - "merge_rank": 20 - } - } - }, - { - "step": "llm_answer", - "input": { - "query": "Почему в файле src/app_runtime/core/runtime.py класс RuntimeManager устроен так?", - "rag_count": 6 - }, - "output": { - "llm_answer": "Класс `RuntimeManager` в файле `src/app_runtime/core/runtime.py` играет роль центрального координатора для инициализации и управления ресурсами приложения во время его выполнения.\n\n### Что делает класс:\n- При создании экземпляра класса (через метод `__init__`) происходит начальная настройка всех необходимых сервисов и компонентов через передачу параметров конфигурации (`configuration`), контейнер сервисов (`services`), сервис трассировки (`traces`), реестр здоровья (`health`), менеджер логирования (`logs`), супервизор рабочих процессов (`workers`) и служба контроля плоскости (`control_plane`).\n \n- В методе `__init__` все переданные параметры либо используются напрямую, либо заменяются дефолтными значениями при их отсутствии. Это позволяет гибко настраивать работу приложения даже без полного набора аргументов.\n\n- Важным аспектом является регистрация модулей (`self.registry = ModuleRegistry(self.services)`), которая позволяет отслеживать и управлять загруженными модулями приложения.\n\n### Входные данные:\n- Параметры настройки конфигурации и сервисов.\n\n### Выходные данные:\n- Настроенный объект `RuntimeManager`, готовый к работе с основными компонентами приложения.\n\n### Связь с окружением:\n- Метод `start()` вызывается после инициализации для начала работы основных сервисов и механизмов мониторинга состояния.\n- Класс взаимодействует с другими компонентами системы через свои атрибуты и методы регистрации, обеспечивая целостность и корректность работы всего runtime-среды приложения." - }, - "diagnostics": { - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 784, - "evidence_rows": 6, - "evidence_chars": 6650 - }, - "evidence_summary": [ - { - "layer": "C1_SYMBOL_CATALOG", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "count": 4, - "unique_paths": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 1, - "unique_paths": 1 - } - ], - "prompt_template_id": "intent_code_qa_explain_local_ru_v1", - "system_prompt_version": "v1" - }, - "timings_ms": { - "prompt_build": 0, - "llm_call": 2177 - } - } - } - ] - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents/20260312_120252/full_chain_plba_code_subintents_plba-fullchain-explain-local-runtime-manager.md b/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents/20260312_120252/full_chain_plba_code_subintents_plba-fullchain-explain-local-runtime-manager.md deleted file mode 100644 index 5ddd657..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents/20260312_120252/full_chain_plba_code_subintents_plba-fullchain-explain-local-runtime-manager.md +++ /dev/null @@ -1,34 +0,0 @@ -# plba-fullchain-explain-local-runtime-manager - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_subintents.yaml -- runner: runtime -- mode: full_chain -- passed: True - -## Query -Почему в файле src/app_runtime/core/runtime.py класс RuntimeManager устроен так? - -## Actual -{ - "intent": "CODE_QA", - "sub_intent": "EXPLAIN_LOCAL", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 6, - "llm_answer": "Класс `RuntimeManager` в файле `src/app_runtime/core/runtime.py` играет роль центрального координатора для инициализации и управления ресурсами приложения во время его выполнения.\n\n### Что делает класс:\n- При создании экземпляра класса (через метод `__init__`) происходит начальная настройка всех необходимых сервисов и компонентов через передачу параметров конфигурации (`configuration`), контейнер сервисов (`services`), сервис трассировки (`traces`), реестр здоровья (`health`), менеджер логирования (`logs`), супервизор рабочих процессов (`workers`) и служба контроля плоскости (`control_plane`).\n \n- В методе `__init__` все переданные параметры либо используются напрямую, либо заменяются дефолтными значениями при их отсутствии. Это позволяет гибко настраивать работу приложения даже без полного набора аргументов.\n\n- Важным аспектом является регистрация модулей (`self.registry = ModuleRegistry(self.services)`), которая позволяет отслеживать и управлять загруженными модулями приложения.\n\n### Входные данные:\n- Параметры настройки конфигурации и сервисов.\n\n### Выходные данные:\n- Настроенный объект `RuntimeManager`, готовый к работе с основными компонентами приложения.\n\n### Связь с окружением:\n- Метод `start()` вызывается после инициализации для начала работы основных сервисов и механизмов мониторинга состояния.\n- Класс взаимодействует с другими компонентами системы через свои атрибуты и методы регистрации, обеспечивая целостность и корректность работы всего runtime-среды приложения.", - "answer_mode": "answered", - "path_scope": [ - "src/app_runtime/core/runtime.py" - ], - "symbol_candidates": [ - "RuntimeManager" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C2_DEPENDENCY_GRAPH" - ] -} - -## Mismatches -- none \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents/20260312_120252/full_chain_plba_code_subintents_plba-fullchain-explain-runtime-manager.json b/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents/20260312_120252/full_chain_plba_code_subintents_plba-fullchain-explain-runtime-manager.json deleted file mode 100644 index 02396ae..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents/20260312_120252/full_chain_plba_code_subintents_plba-fullchain-explain-runtime-manager.json +++ /dev/null @@ -1,2088 +0,0 @@ -{ - "case_id": "plba-fullchain-explain-runtime-manager", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_subintents.yaml", - "runner": "runtime", - "mode": "full_chain", - "actual": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 12, - "llm_answer": "## Назначение\n\nКласс `RuntimeManager` играет роль менеджера выполнения приложения, координирующего различные компоненты и сервисы, необходимые для управления жизненным циклом runtime-среды. Он отвечает за регистрацию сервисов, управление их состоянием и координацию действий по выполнению бизнес-процессов.\n\n## Ключевые зависимости\n\nКлючевыми зависимостями класса являются следующие сущности и библиотеки:\n\n- **ConfigurationManager** (`configuration`) — управляет конфигурацией runtime-среды.\n- **ServiceContainer** (`services`) — контейнер сервисов, предоставляющий доступ к различным сервисам runtime.\n- **TraceService** (`traces`) — сервис отслеживания событий и трассировки выполнения задач.\n- **HealthRegistry** (`health`) — служба мониторинга состояния и здоровья runtime-среды.\n- **LogManager** (`logs`) — менеджер логирования событий и сообщений от runtime-среды.\n- **WorkerSupervisor** (`workers`) — супервизор рабочих процессов, управляющий рабочими потоками и задачами.\n- **ControlPlaneService** (`control_plane`) — главный сервис управления жизненным циклом runtime.\n\n## Поток данных или вызовов\n\nПроцесс работы `RuntimeManager` можно описать следующим образом:\n\n1. При инициализации создается экземпляр класса с заданными параметрами конфигурации и сервисов.\n2. В конструкторе вызывается метод `_register_core_services`, который регистрирует основные модули и сервисы runtime-среды.\n3. Метод `register_module` позволяет динамически регистрировать дополнительные модули приложений.\n4. Управляющие методы позволяют менять состояние runtime-среды (например, переходы между состояниями жизненного цикла).\n5. Управление рабочим процессом осуществляется через супервизор рабочих потоков (`WorkerSupervisor`), который запускает задачи и следит за их выполнением.\n6. Сервис мониторинга (`TraceService`) фиксирует события и ошибки во время выполнения runtime-среды.\n7. Логирование событий и сообщений выполняется через `LogManager`.\n8. Контрольные проверки состояния среды выполняются службой мониторинга (`HealthRegistry`).\n9. Главный сервис управления (`ControlPlaneService`) обеспечивает синхронизацию и координацию различных компонентов runtime.\n\n## Важные детали реализации\n\n### Настройки и параметры\n\n- Константы `ACTION_TIMEOUT_SECONDS` и `ACTION_POLL_INTERVAL_SECONDS` задают таймауты и интервалы опроса для управления поведением runtime-среды.\n\n### Жизненный цикл runtime\n\nЖизненный цикл runtime-среды управляется посредством изменения состояния объекта `RuntimeManager`. Состояния могут изменяться следующими методами:\n\n- `start`: переводит runtime-среду в активное состояние.\n- `stop`: останавливает выполнение runtime-среды.\n- `restart`: перезапускает runtime-среду после остановки.\n\nЭти методы обеспечивают корректное завершение текущих операций и освобождение ресурсов перед остановкой runtime.\n\n### Динамическая регистрация модулей\n\nМетод `register_module` позволяет динамически добавлять новые модули приложений без необходимости перекомпиляции runtime-среды. Это делает систему гибкой и легко расширяемой.\n\n### Осторожные выводы\n\nНа основе косвенных признаков можно предположить следующее:\n\n- Поскольку атрибуты `_core_registered` и `_workers_registered` используются внутри метода `_register_core_services`, предполагается наличие дополнительных методов или механизмов регистрации основных сервисов и рабочих потоков.\n- Хотя зависимость `ControlPlaneService` явно указана в графе зависимостей, её точная реализация и функциональность остаются неизвестными без дополнительного анализа исходного кода.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "RuntimeManager" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "passed": true, - "mismatches": [], - "details": { - "case_id": "plba-fullchain-explain-runtime-manager", - "text": "Объясни как работает класс RuntimeManager", - "mode": "full_chain", - "run_started_at": "2026-03-12T12:02:52", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Объясни как работает класс RuntimeManager", - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "RuntimeManager", - "alternatives": [ - "RuntimeManager" - ], - "confidence": 0.99 - }, - "rag_count": 12, - "rag_rows": [ - { - "path": "src/app_runtime/core/runtime.py", - "content": "class RuntimeManager\nRuntimeManager", - "layer": "C1_SYMBOL_CATALOG", - "title": "RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "7e4a9381328c5803bbc6179458612fc4e947d928aa7bf8b4b2bebb2c8592f758", - "qname": "RuntimeManager", - "kind": "class", - "signature": "RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.core.runtime", - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests manager\n- orchestrates role-like calls (4)\n- reads and writes state attributes\n- participates in dataflow slices (50)", - "layer": "C4_SEMANTIC_ROLES", - "title": "RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 43, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "7e4a9381328c5803bbc6179458612fc4e947d928aa7bf8b4b2bebb2c8592f758", - "symbol_name": "RuntimeManager", - "qname": "RuntimeManager", - "role": "pipeline_stage", - "confidence": 0.67, - "dataflow_participation": 50, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.stop", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 25, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d", - "dst_ref": "ControlPlaneService.stop", - "resolution": "resolved", - "slice_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.stop" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._stop_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 51, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a", - "dst_ref": "ControlPlaneService._stop_async", - "resolution": "resolved", - "slice_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._stop_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.register_channel", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 17, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957", - "dst_ref": "ControlPlaneService.register_channel", - "resolution": "resolved", - "slice_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.register_channel" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.start", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 20, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154", - "dst_ref": "ControlPlaneService.start", - "resolution": "resolved", - "slice_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.start" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._start_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 47, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517", - "dst_ref": "ControlPlaneService._start_async", - "resolution": "resolved", - "slice_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._start_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager.add_config_file", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 32, - "span_end": 52, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "a23b8a11ebdb12708b60c96ea12a69f7f042082f1adfddd572444e246d81d167", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "57ffbd4f0d9fdf3507c2b8624312ce211f3d02fdf86a57a8ec90778d8a7b498d", - "dst_ref": "RuntimeManager.add_config_file", - "resolution": "resolved", - "slice_id": "a23b8a11ebdb12708b60c96ea12a69f7f042082f1adfddd572444e246d81d167", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager.add_config_file" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "57ffbd4f0d9fdf3507c2b8624312ce211f3d02fdf86a57a8ec90778d8a7b498d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "class RuntimeManager:\n ACTION_TIMEOUT_SECONDS = 10.0\n ACTION_POLL_INTERVAL_SECONDS = 0.05\n\n def __init__(\n self,\n configuration: ConfigurationManager | None = None,\n services: ServiceContainer | None = None,\n traces: TraceService | None = None,\n health: HealthRegistry | None = None,\n logs: LogManager | None = None,\n workers: WorkerSupervisor | None = None,\n control_plane: ControlPlaneService | None = None,\n ) -> None:\n self.configuration = configuration or ConfigurationManager()\n self.services = services or ServiceContainer()\n self.traces = traces or TraceService()\n self.health = health or HealthRegistry()\n self.logs = logs or LogManager()\n self.workers = workers or WorkerSupervisor()\n self.control_plane = control_plane or ControlPlaneService()\n self.registry = ModuleRegistry(self.services)\n self._started = False\n self._state = LifecycleState.IDLE\n self._core_registered = False\n self._workers_registered = False\n self._register_core_services()\n\n def register_module(self, module: ApplicationModule) -> None:\n self.registry.register_module(module.name)\n module.register(self.registry)\n\n def add_config_file(self, path: str) -> FileConfigProvider:\n provider = FileConfigProvider(path)\n self.configuration.add_provider(provider)\n return provider\n\n def start(self, *, start_control_plane: bool = True) -> None:\n if self._started:\n return\n self._state = LifecycleState.STARTING\n config = self.configuration.load()\n self.logs.apply_config(config)\n self._register_health_contributors()\n self._register_workers()\n self.workers.start()\n if start_control_plane:\n self.control_plane.start(self)\n self._started = True\n self._refresh_state()\n\n def stop(self, timeout: float = 30.0, force: bool = False, stop_control_plane: bool = True) -> None:\n if not self._started:\n return\n self._state = LifecycleState.STOPPING\n self.workers.stop(timeout=timeout, force=force)\n if stop_control_plane:\n self.control_plane.stop()\n self._started = False\n self._state = LifecycleState.STOPPED\n\n def status(self) -> dict[str, object]:\n self._refresh_state()\n return self.control_plane.snapshot(self)\n\n def current_health(self) -> HealthPayload:\n self._refresh_state()\n return self.health.payload(self._state, self.workers.healths())\n\n async def health_status(self) -> HealthPayload:\n return self.current_health()\n\n async def start_runtime(self) -> dict[str, object] | str:\n self._refresh_state()\n if self._started:\n return \"runtime already running\"\n if self._state == LifecycleState.STOPPING:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n\n self.start(start_control_plane=False)\n started = self._wait_for_state({LifecycleState.IDLE, LifecycleState.BUSY}, timeout=self.ACTION_TIMEOUT_SECONDS)\n if started:\n return self._action_detail(\"runtime started\", timed_out=False)\n return self._action_detail(\"runtime start is still in progress\", timed_out=True)\n\n async def stop_runtime(self) -> dict[str, object] | str:\n self._refresh_state()\n if not self._started:\n if self._state == LifecycleState.STOPPING:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n return \"runtime already stopped\"\n\n self._state = LifecycleState.STOPPING\n try:\n self.workers.stop(timeout=self.ACTION_TIMEOUT_SECONDS, force=False)\n except TimeoutError:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n\n self._started = False\n self._state = LifecycleState.STOPPED\n return self._action_detail(\"runtime stopped\", timed_out=False)\n\n async def runtime_status(self) -> str:\n self._refresh_state()\n return self._state.value\n\n def _register_core_services(self) -> None:\n if self._core_registered:\n return\n self.services.register(\"configuration\", self.configuration)\n self.services.register(\"traces\", self.traces)\n self.services.register(\"health\", self.health)\n self.services.register(\"logs\", self.logs)\n self.services.register(\"workers\", self.workers)\n self.services.register(\"control_plane\", self.control_plane)\n self._core_registered = True\n\n def _register_health_contributors(self) -> None:\n for contributor in self.registry.health_contributors:\n self.health.register(contributor)\n\n def _register_workers(self) -> None:\n if self._workers_registered:\n return\n for worker in self.registry.workers:\n self.workers.register(worker)\n self._workers_registered = True\n\n def _refresh_state(self) -> None:\n lifecycle = self.workers.lifecycle_state()\n\n if self._state == LifecycleState.STOPPING:\n if lifecycle == LifecycleState.STOPPED:\n self._started = False\n self._state = LifecycleState.STOPPED\n return\n\n if not self._started:\n if lifecycle == LifecycleState.STOPPED:\n self._state = LifecycleState.STOPPED\n return\n\n self._state = lifecycle\n\n def _wait_for_state(self, target_states: set[LifecycleState], *, timeout: float) -> bool:\n deadline = monotonic() + timeout\n while monotonic() < deadline:\n self._refresh_state()\n if self._state in target_states:\n return True\n sleep(self.ACTION_POLL_INTERVAL_SECONDS)\n self._refresh_state()\n return self._state in target_states\n\n def _action_detail(self, message: str, *, timed_out: bool) -> dict[str, object]:\n self._refresh_state()\n return {\n \"message\": message,\n \"state\": self._state.value,\n \"timed_out\": timed_out,\n \"workers\": self.workers.snapshot(),\n }", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/core/runtime.py:RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.core.runtime", - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "llm_answer": "## Назначение\n\nКласс `RuntimeManager` играет роль менеджера выполнения приложения, координирующего различные компоненты и сервисы, необходимые для управления жизненным циклом runtime-среды. Он отвечает за регистрацию сервисов, управление их состоянием и координацию действий по выполнению бизнес-процессов.\n\n## Ключевые зависимости\n\nКлючевыми зависимостями класса являются следующие сущности и библиотеки:\n\n- **ConfigurationManager** (`configuration`) — управляет конфигурацией runtime-среды.\n- **ServiceContainer** (`services`) — контейнер сервисов, предоставляющий доступ к различным сервисам runtime.\n- **TraceService** (`traces`) — сервис отслеживания событий и трассировки выполнения задач.\n- **HealthRegistry** (`health`) — служба мониторинга состояния и здоровья runtime-среды.\n- **LogManager** (`logs`) — менеджер логирования событий и сообщений от runtime-среды.\n- **WorkerSupervisor** (`workers`) — супервизор рабочих процессов, управляющий рабочими потоками и задачами.\n- **ControlPlaneService** (`control_plane`) — главный сервис управления жизненным циклом runtime.\n\n## Поток данных или вызовов\n\nПроцесс работы `RuntimeManager` можно описать следующим образом:\n\n1. При инициализации создается экземпляр класса с заданными параметрами конфигурации и сервисов.\n2. В конструкторе вызывается метод `_register_core_services`, который регистрирует основные модули и сервисы runtime-среды.\n3. Метод `register_module` позволяет динамически регистрировать дополнительные модули приложений.\n4. Управляющие методы позволяют менять состояние runtime-среды (например, переходы между состояниями жизненного цикла).\n5. Управление рабочим процессом осуществляется через супервизор рабочих потоков (`WorkerSupervisor`), который запускает задачи и следит за их выполнением.\n6. Сервис мониторинга (`TraceService`) фиксирует события и ошибки во время выполнения runtime-среды.\n7. Логирование событий и сообщений выполняется через `LogManager`.\n8. Контрольные проверки состояния среды выполняются службой мониторинга (`HealthRegistry`).\n9. Главный сервис управления (`ControlPlaneService`) обеспечивает синхронизацию и координацию различных компонентов runtime.\n\n## Важные детали реализации\n\n### Настройки и параметры\n\n- Константы `ACTION_TIMEOUT_SECONDS` и `ACTION_POLL_INTERVAL_SECONDS` задают таймауты и интервалы опроса для управления поведением runtime-среды.\n\n### Жизненный цикл runtime\n\nЖизненный цикл runtime-среды управляется посредством изменения состояния объекта `RuntimeManager`. Состояния могут изменяться следующими методами:\n\n- `start`: переводит runtime-среду в активное состояние.\n- `stop`: останавливает выполнение runtime-среды.\n- `restart`: перезапускает runtime-среду после остановки.\n\nЭти методы обеспечивают корректное завершение текущих операций и освобождение ресурсов перед остановкой runtime.\n\n### Динамическая регистрация модулей\n\nМетод `register_module` позволяет динамически добавлять новые модули приложений без необходимости перекомпиляции runtime-среды. Это делает систему гибкой и легко расширяемой.\n\n### Осторожные выводы\n\nНа основе косвенных признаков можно предположить следующее:\n\n- Поскольку атрибуты `_core_registered` и `_workers_registered` используются внутри метода `_register_core_services`, предполагается наличие дополнительных методов или механизмов регистрации основных сервисов и рабочих потоков.\n- Хотя зависимость `ControlPlaneService` явно указана в графе зависимостей, её точная реализация и функциональность остаются неизвестными без дополнительного анализа исходного кода.", - "summary": { - "router": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "confidence": null - }, - "retrieval": { - "profile": "code", - "layers_hit": [ - "C0_SOURCE_CHUNKS", - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS", - "C4_SEMANTIC_ROLES" - ], - "evidence_sufficient": true - }, - "llm": { - "answer_status": "answered", - "groundedness": "grounded" - } - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "RuntimeManager" - ], - "keyword_hints": [ - "RuntimeManager" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C0_SOURCE_CHUNKS": "exact_path_fetch", - "C4_SEMANTIC_ROLES": "exact_path_fetch", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C3_ENTRYPOINTS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 8, - "C4_SEMANTIC_ROLES": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C3_ENTRYPOINTS": 6 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C4_SEMANTIC_ROLES": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C4_SEMANTIC_ROLES", - "query": "RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - }, - { - "layer": "C3_ENTRYPOINTS", - "query": "RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 1, - "candidates_after_filter": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 6, - "candidates_after_filter": 6 - }, - { - "layer": "C3_ENTRYPOINTS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 3, - "candidates_after_filter": 3 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "RuntimeManager", - "alternatives": [ - "RuntimeManager" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C4_SEMANTIC_ROLES", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 6, - "fail_reason": null - }, - { - "layer": "C3_ENTRYPOINTS", - "status": "hit", - "hit_count": 3, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "router": 0, - "symbol_resolution": 0, - "retrieval_total": 169, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 39, - "C0_SOURCE_CHUNKS": 15, - "C4_SEMANTIC_ROLES": 13, - "C2_DEPENDENCY_GRAPH": 72, - "C3_ENTRYPOINTS": 8 - }, - "merge_rank": 15, - "prompt_build": 0, - "llm_call": 5054 - }, - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 797, - "evidence_rows": 12, - "evidence_chars": 7130 - }, - "evidence_summary": [ - { - "layer": "C1_SYMBOL_CATALOG", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "count": 6, - "unique_paths": 2 - }, - { - "layer": "C3_ENTRYPOINTS", - "count": 3, - "unique_paths": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 1, - "unique_paths": 1 - } - ], - "prompt_template_id": "intent_code_qa_explain_ru_v1", - "system_prompt_version": "v1" - }, - "router": { - "conversation_mode": "START", - "keyword_hints": [ - "RuntimeManager" - ], - "path_scope": [] - }, - "llm": { - "used_evidence_count": 12, - "missing_evidence_reason": null - } - }, - "run_info": { - "case_id": "plba-fullchain-explain-runtime-manager", - "mode": "full_chain", - "run_started_at": "2026-03-12T12:02:52", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - }, - "input_request": { - "text": "Объясни как работает класс RuntimeManager", - "normalized_query": "Объясни как работает класс RuntimeManager" - }, - "steps": [ - { - "step": "intent_router", - "input": { - "query": "Объясни как работает класс RuntimeManager" - }, - "output": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Объясни как работает класс RuntimeManager" - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "RuntimeManager" - ], - "keyword_hints": [ - "RuntimeManager" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "timings_ms": { - "router": 0 - } - } - }, - { - "step": "retrieval", - "input": { - "query": "Объясни как работает класс RuntimeManager" - }, - "output": { - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "RuntimeManager", - "alternatives": [ - "RuntimeManager" - ], - "confidence": 0.99 - }, - "rag_count": 12, - "rag_rows": [ - { - "path": "src/app_runtime/core/runtime.py", - "content": "class RuntimeManager\nRuntimeManager", - "layer": "C1_SYMBOL_CATALOG", - "title": "RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "7e4a9381328c5803bbc6179458612fc4e947d928aa7bf8b4b2bebb2c8592f758", - "qname": "RuntimeManager", - "kind": "class", - "signature": "RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.core.runtime", - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests manager\n- orchestrates role-like calls (4)\n- reads and writes state attributes\n- participates in dataflow slices (50)", - "layer": "C4_SEMANTIC_ROLES", - "title": "RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 43, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "7e4a9381328c5803bbc6179458612fc4e947d928aa7bf8b4b2bebb2c8592f758", - "symbol_name": "RuntimeManager", - "qname": "RuntimeManager", - "role": "pipeline_stage", - "confidence": 0.67, - "dataflow_participation": 50, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.stop", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 25, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d", - "dst_ref": "ControlPlaneService.stop", - "resolution": "resolved", - "slice_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.stop" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._stop_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 51, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a", - "dst_ref": "ControlPlaneService._stop_async", - "resolution": "resolved", - "slice_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._stop_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.register_channel", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 17, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957", - "dst_ref": "ControlPlaneService.register_channel", - "resolution": "resolved", - "slice_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.register_channel" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.start", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 20, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154", - "dst_ref": "ControlPlaneService.start", - "resolution": "resolved", - "slice_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.start" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._start_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 47, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517", - "dst_ref": "ControlPlaneService._start_async", - "resolution": "resolved", - "slice_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._start_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager.add_config_file", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 32, - "span_end": 52, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "a23b8a11ebdb12708b60c96ea12a69f7f042082f1adfddd572444e246d81d167", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "57ffbd4f0d9fdf3507c2b8624312ce211f3d02fdf86a57a8ec90778d8a7b498d", - "dst_ref": "RuntimeManager.add_config_file", - "resolution": "resolved", - "slice_id": "a23b8a11ebdb12708b60c96ea12a69f7f042082f1adfddd572444e246d81d167", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager.add_config_file" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "57ffbd4f0d9fdf3507c2b8624312ce211f3d02fdf86a57a8ec90778d8a7b498d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "class RuntimeManager:\n ACTION_TIMEOUT_SECONDS = 10.0\n ACTION_POLL_INTERVAL_SECONDS = 0.05\n\n def __init__(\n self,\n configuration: ConfigurationManager | None = None,\n services: ServiceContainer | None = None,\n traces: TraceService | None = None,\n health: HealthRegistry | None = None,\n logs: LogManager | None = None,\n workers: WorkerSupervisor | None = None,\n control_plane: ControlPlaneService | None = None,\n ) -> None:\n self.configuration = configuration or ConfigurationManager()\n self.services = services or ServiceContainer()\n self.traces = traces or TraceService()\n self.health = health or HealthRegistry()\n self.logs = logs or LogManager()\n self.workers = workers or WorkerSupervisor()\n self.control_plane = control_plane or ControlPlaneService()\n self.registry = ModuleRegistry(self.services)\n self._started = False\n self._state = LifecycleState.IDLE\n self._core_registered = False\n self._workers_registered = False\n self._register_core_services()\n\n def register_module(self, module: ApplicationModule) -> None:\n self.registry.register_module(module.name)\n module.register(self.registry)\n\n def add_config_file(self, path: str) -> FileConfigProvider:\n provider = FileConfigProvider(path)\n self.configuration.add_provider(provider)\n return provider\n\n def start(self, *, start_control_plane: bool = True) -> None:\n if self._started:\n return\n self._state = LifecycleState.STARTING\n config = self.configuration.load()\n self.logs.apply_config(config)\n self._register_health_contributors()\n self._register_workers()\n self.workers.start()\n if start_control_plane:\n self.control_plane.start(self)\n self._started = True\n self._refresh_state()\n\n def stop(self, timeout: float = 30.0, force: bool = False, stop_control_plane: bool = True) -> None:\n if not self._started:\n return\n self._state = LifecycleState.STOPPING\n self.workers.stop(timeout=timeout, force=force)\n if stop_control_plane:\n self.control_plane.stop()\n self._started = False\n self._state = LifecycleState.STOPPED\n\n def status(self) -> dict[str, object]:\n self._refresh_state()\n return self.control_plane.snapshot(self)\n\n def current_health(self) -> HealthPayload:\n self._refresh_state()\n return self.health.payload(self._state, self.workers.healths())\n\n async def health_status(self) -> HealthPayload:\n return self.current_health()\n\n async def start_runtime(self) -> dict[str, object] | str:\n self._refresh_state()\n if self._started:\n return \"runtime already running\"\n if self._state == LifecycleState.STOPPING:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n\n self.start(start_control_plane=False)\n started = self._wait_for_state({LifecycleState.IDLE, LifecycleState.BUSY}, timeout=self.ACTION_TIMEOUT_SECONDS)\n if started:\n return self._action_detail(\"runtime started\", timed_out=False)\n return self._action_detail(\"runtime start is still in progress\", timed_out=True)\n\n async def stop_runtime(self) -> dict[str, object] | str:\n self._refresh_state()\n if not self._started:\n if self._state == LifecycleState.STOPPING:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n return \"runtime already stopped\"\n\n self._state = LifecycleState.STOPPING\n try:\n self.workers.stop(timeout=self.ACTION_TIMEOUT_SECONDS, force=False)\n except TimeoutError:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n\n self._started = False\n self._state = LifecycleState.STOPPED\n return self._action_detail(\"runtime stopped\", timed_out=False)\n\n async def runtime_status(self) -> str:\n self._refresh_state()\n return self._state.value\n\n def _register_core_services(self) -> None:\n if self._core_registered:\n return\n self.services.register(\"configuration\", self.configuration)\n self.services.register(\"traces\", self.traces)\n self.services.register(\"health\", self.health)\n self.services.register(\"logs\", self.logs)\n self.services.register(\"workers\", self.workers)\n self.services.register(\"control_plane\", self.control_plane)\n self._core_registered = True\n\n def _register_health_contributors(self) -> None:\n for contributor in self.registry.health_contributors:\n self.health.register(contributor)\n\n def _register_workers(self) -> None:\n if self._workers_registered:\n return\n for worker in self.registry.workers:\n self.workers.register(worker)\n self._workers_registered = True\n\n def _refresh_state(self) -> None:\n lifecycle = self.workers.lifecycle_state()\n\n if self._state == LifecycleState.STOPPING:\n if lifecycle == LifecycleState.STOPPED:\n self._started = False\n self._state = LifecycleState.STOPPED\n return\n\n if not self._started:\n if lifecycle == LifecycleState.STOPPED:\n self._state = LifecycleState.STOPPED\n return\n\n self._state = lifecycle\n\n def _wait_for_state(self, target_states: set[LifecycleState], *, timeout: float) -> bool:\n deadline = monotonic() + timeout\n while monotonic() < deadline:\n self._refresh_state()\n if self._state in target_states:\n return True\n sleep(self.ACTION_POLL_INTERVAL_SECONDS)\n self._refresh_state()\n return self._state in target_states\n\n def _action_detail(self, message: str, *, timed_out: bool) -> dict[str, object]:\n self._refresh_state()\n return {\n \"message\": message,\n \"state\": self._state.value,\n \"timed_out\": timed_out,\n \"workers\": self.workers.snapshot(),\n }", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/core/runtime.py:RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.core.runtime", - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ] - }, - "diagnostics": { - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C0_SOURCE_CHUNKS": "exact_path_fetch", - "C4_SEMANTIC_ROLES": "exact_path_fetch", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C3_ENTRYPOINTS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 8, - "C4_SEMANTIC_ROLES": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C3_ENTRYPOINTS": 6 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C4_SEMANTIC_ROLES": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C4_SEMANTIC_ROLES", - "query": "RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - }, - { - "layer": "C3_ENTRYPOINTS", - "query": "RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 1, - "candidates_after_filter": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 6, - "candidates_after_filter": 6 - }, - { - "layer": "C3_ENTRYPOINTS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 3, - "candidates_after_filter": 3 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "RuntimeManager", - "alternatives": [ - "RuntimeManager" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C4_SEMANTIC_ROLES", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 6, - "fail_reason": null - }, - { - "layer": "C3_ENTRYPOINTS", - "status": "hit", - "hit_count": 3, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "symbol_resolution": 0, - "retrieval_total": 169, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 39, - "C0_SOURCE_CHUNKS": 15, - "C4_SEMANTIC_ROLES": 13, - "C2_DEPENDENCY_GRAPH": 72, - "C3_ENTRYPOINTS": 8 - }, - "merge_rank": 15 - } - } - }, - { - "step": "llm_answer", - "input": { - "query": "Объясни как работает класс RuntimeManager", - "rag_count": 12 - }, - "output": { - "llm_answer": "## Назначение\n\nКласс `RuntimeManager` играет роль менеджера выполнения приложения, координирующего различные компоненты и сервисы, необходимые для управления жизненным циклом runtime-среды. Он отвечает за регистрацию сервисов, управление их состоянием и координацию действий по выполнению бизнес-процессов.\n\n## Ключевые зависимости\n\nКлючевыми зависимостями класса являются следующие сущности и библиотеки:\n\n- **ConfigurationManager** (`configuration`) — управляет конфигурацией runtime-среды.\n- **ServiceContainer** (`services`) — контейнер сервисов, предоставляющий доступ к различным сервисам runtime.\n- **TraceService** (`traces`) — сервис отслеживания событий и трассировки выполнения задач.\n- **HealthRegistry** (`health`) — служба мониторинга состояния и здоровья runtime-среды.\n- **LogManager** (`logs`) — менеджер логирования событий и сообщений от runtime-среды.\n- **WorkerSupervisor** (`workers`) — супервизор рабочих процессов, управляющий рабочими потоками и задачами.\n- **ControlPlaneService** (`control_plane`) — главный сервис управления жизненным циклом runtime.\n\n## Поток данных или вызовов\n\nПроцесс работы `RuntimeManager` можно описать следующим образом:\n\n1. При инициализации создается экземпляр класса с заданными параметрами конфигурации и сервисов.\n2. В конструкторе вызывается метод `_register_core_services`, который регистрирует основные модули и сервисы runtime-среды.\n3. Метод `register_module` позволяет динамически регистрировать дополнительные модули приложений.\n4. Управляющие методы позволяют менять состояние runtime-среды (например, переходы между состояниями жизненного цикла).\n5. Управление рабочим процессом осуществляется через супервизор рабочих потоков (`WorkerSupervisor`), который запускает задачи и следит за их выполнением.\n6. Сервис мониторинга (`TraceService`) фиксирует события и ошибки во время выполнения runtime-среды.\n7. Логирование событий и сообщений выполняется через `LogManager`.\n8. Контрольные проверки состояния среды выполняются службой мониторинга (`HealthRegistry`).\n9. Главный сервис управления (`ControlPlaneService`) обеспечивает синхронизацию и координацию различных компонентов runtime.\n\n## Важные детали реализации\n\n### Настройки и параметры\n\n- Константы `ACTION_TIMEOUT_SECONDS` и `ACTION_POLL_INTERVAL_SECONDS` задают таймауты и интервалы опроса для управления поведением runtime-среды.\n\n### Жизненный цикл runtime\n\nЖизненный цикл runtime-среды управляется посредством изменения состояния объекта `RuntimeManager`. Состояния могут изменяться следующими методами:\n\n- `start`: переводит runtime-среду в активное состояние.\n- `stop`: останавливает выполнение runtime-среды.\n- `restart`: перезапускает runtime-среду после остановки.\n\nЭти методы обеспечивают корректное завершение текущих операций и освобождение ресурсов перед остановкой runtime.\n\n### Динамическая регистрация модулей\n\nМетод `register_module` позволяет динамически добавлять новые модули приложений без необходимости перекомпиляции runtime-среды. Это делает систему гибкой и легко расширяемой.\n\n### Осторожные выводы\n\nНа основе косвенных признаков можно предположить следующее:\n\n- Поскольку атрибуты `_core_registered` и `_workers_registered` используются внутри метода `_register_core_services`, предполагается наличие дополнительных методов или механизмов регистрации основных сервисов и рабочих потоков.\n- Хотя зависимость `ControlPlaneService` явно указана в графе зависимостей, её точная реализация и функциональность остаются неизвестными без дополнительного анализа исходного кода." - }, - "diagnostics": { - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 797, - "evidence_rows": 12, - "evidence_chars": 7130 - }, - "evidence_summary": [ - { - "layer": "C1_SYMBOL_CATALOG", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "count": 6, - "unique_paths": 2 - }, - { - "layer": "C3_ENTRYPOINTS", - "count": 3, - "unique_paths": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 1, - "unique_paths": 1 - } - ], - "prompt_template_id": "intent_code_qa_explain_ru_v1", - "system_prompt_version": "v1" - }, - "timings_ms": { - "prompt_build": 0, - "llm_call": 5054 - } - } - } - ] - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents/20260312_120252/full_chain_plba_code_subintents_plba-fullchain-explain-runtime-manager.md b/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents/20260312_120252/full_chain_plba_code_subintents_plba-fullchain-explain-runtime-manager.md deleted file mode 100644 index cab6df1..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents/20260312_120252/full_chain_plba_code_subintents_plba-fullchain-explain-runtime-manager.md +++ /dev/null @@ -1,34 +0,0 @@ -# plba-fullchain-explain-runtime-manager - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_subintents.yaml -- runner: runtime -- mode: full_chain -- passed: True - -## Query -Объясни как работает класс RuntimeManager - -## Actual -{ - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 12, - "llm_answer": "## Назначение\n\nКласс `RuntimeManager` играет роль менеджера выполнения приложения, координирующего различные компоненты и сервисы, необходимые для управления жизненным циклом runtime-среды. Он отвечает за регистрацию сервисов, управление их состоянием и координацию действий по выполнению бизнес-процессов.\n\n## Ключевые зависимости\n\nКлючевыми зависимостями класса являются следующие сущности и библиотеки:\n\n- **ConfigurationManager** (`configuration`) — управляет конфигурацией runtime-среды.\n- **ServiceContainer** (`services`) — контейнер сервисов, предоставляющий доступ к различным сервисам runtime.\n- **TraceService** (`traces`) — сервис отслеживания событий и трассировки выполнения задач.\n- **HealthRegistry** (`health`) — служба мониторинга состояния и здоровья runtime-среды.\n- **LogManager** (`logs`) — менеджер логирования событий и сообщений от runtime-среды.\n- **WorkerSupervisor** (`workers`) — супервизор рабочих процессов, управляющий рабочими потоками и задачами.\n- **ControlPlaneService** (`control_plane`) — главный сервис управления жизненным циклом runtime.\n\n## Поток данных или вызовов\n\nПроцесс работы `RuntimeManager` можно описать следующим образом:\n\n1. При инициализации создается экземпляр класса с заданными параметрами конфигурации и сервисов.\n2. В конструкторе вызывается метод `_register_core_services`, который регистрирует основные модули и сервисы runtime-среды.\n3. Метод `register_module` позволяет динамически регистрировать дополнительные модули приложений.\n4. Управляющие методы позволяют менять состояние runtime-среды (например, переходы между состояниями жизненного цикла).\n5. Управление рабочим процессом осуществляется через супервизор рабочих потоков (`WorkerSupervisor`), который запускает задачи и следит за их выполнением.\n6. Сервис мониторинга (`TraceService`) фиксирует события и ошибки во время выполнения runtime-среды.\n7. Логирование событий и сообщений выполняется через `LogManager`.\n8. Контрольные проверки состояния среды выполняются службой мониторинга (`HealthRegistry`).\n9. Главный сервис управления (`ControlPlaneService`) обеспечивает синхронизацию и координацию различных компонентов runtime.\n\n## Важные детали реализации\n\n### Настройки и параметры\n\n- Константы `ACTION_TIMEOUT_SECONDS` и `ACTION_POLL_INTERVAL_SECONDS` задают таймауты и интервалы опроса для управления поведением runtime-среды.\n\n### Жизненный цикл runtime\n\nЖизненный цикл runtime-среды управляется посредством изменения состояния объекта `RuntimeManager`. Состояния могут изменяться следующими методами:\n\n- `start`: переводит runtime-среду в активное состояние.\n- `stop`: останавливает выполнение runtime-среды.\n- `restart`: перезапускает runtime-среду после остановки.\n\nЭти методы обеспечивают корректное завершение текущих операций и освобождение ресурсов перед остановкой runtime.\n\n### Динамическая регистрация модулей\n\nМетод `register_module` позволяет динамически добавлять новые модули приложений без необходимости перекомпиляции runtime-среды. Это делает систему гибкой и легко расширяемой.\n\n### Осторожные выводы\n\nНа основе косвенных признаков можно предположить следующее:\n\n- Поскольку атрибуты `_core_registered` и `_workers_registered` используются внутри метода `_register_core_services`, предполагается наличие дополнительных методов или механизмов регистрации основных сервисов и рабочих потоков.\n- Хотя зависимость `ControlPlaneService` явно указана в графе зависимостей, её точная реализация и функциональность остаются неизвестными без дополнительного анализа исходного кода.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "RuntimeManager" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] -} - -## Mismatches -- none \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents/20260312_120252/full_chain_plba_code_subintents_plba-fullchain-find-entrypoints.json b/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents/20260312_120252/full_chain_plba_code_subintents_plba-fullchain-find-entrypoints.json deleted file mode 100644 index 3cfe42c..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents/20260312_120252/full_chain_plba_code_subintents_plba-fullchain-find-entrypoints.json +++ /dev/null @@ -1,1196 +0,0 @@ -{ - "case_id": "plba-fullchain-find-entrypoints", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_subintents.yaml", - "runner": "runtime", - "mode": "full_chain", - "actual": { - "intent": "CODE_QA", - "sub_intent": "FIND_ENTRYPOINTS", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 9, - "llm_answer": "## Финальный ответ:\n\nНа основании предоставленного контекста и слоев анализа RAG, удалось выявить следующие **точки входа** и их возможные роли:\n\n### 1. `src/app_runtime/control/http_app.py`\n- **app.post**: \n - Роль: Обработчик HTTP POST-запросов FastAPI. Вероятно, используется для приема данных от клиента и инициирования последующих шагов обработки (например, вызова функций, выполняющих бизнес-логику).\n- **app.get**: \n - Роль: Обработчик HTTP GET-запросов FastAPI. Аналогично предыдущему пункту, вероятно обрабатывает запросы на получение информации.\n\n### Наиболее вероятные точки входа:\nЭти две точки (`app.post` и `app.get`) выглядят наиболее вероятными местами начальной обработки запросов в системе, поскольку они явно указаны в слое `C3_ENTRYPOINTS`.\n\n---\n\nОбратите внимание, что слой `C0_SOURCE_CHUNKS` содержит классы и функции без явных упоминаний точек входа, поэтому требуется дополнительное исследование исходного кода вокруг этих классов и функций, чтобы определить их контекст использования.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [], - "layers": [ - "C3_ENTRYPOINTS", - "C0_SOURCE_CHUNKS" - ] - }, - "passed": true, - "mismatches": [], - "details": { - "case_id": "plba-fullchain-find-entrypoints", - "text": "Найди точки входа в коде", - "mode": "full_chain", - "run_started_at": "2026-03-12T12:02:52", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Найди точки входа в коде", - "symbol_resolution": { - "status": "not_requested", - "resolved_symbol": null, - "alternatives": [], - "confidence": 0.0 - }, - "rag_count": 9, - "rag_rows": [ - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/contracts/result.py", - "content": "class StepResult:\n transition: str = \"success\"\n updates: dict[str, Any] = field(default_factory=dict)\n status: str = \"completed\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/workflow/contracts/result.py:StepResult", - "span_start": 8, - "span_end": 11, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.workflow.contracts.result", - "is_test": false, - "blob_sha": "6e57dbfe22873f097f11228a26cffa415440a43b68a737b220906461cd86c353", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/config/__init__.py", - "content": "from app_runtime.config.file_loader import ConfigFileLoader\nfrom app_runtime.config.providers import FileConfigProvider\n\n__all__ = [\"ConfigFileLoader\", \"FileConfigProvider\"]", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/config/__init__.py:1-4", - "span_start": 1, - "span_end": 4, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.app_runtime.config.__init__", - "is_test": false, - "blob_sha": "612918029820a2a983330ec92256142b55b9de4bdf3399ece18e2a02dbad9729", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/__init__.py", - "content": "__all__: list[str] = []", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/__init__.py:1-1", - "span_start": 1, - "span_end": 1, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.app_runtime.__init__", - "is_test": false, - "blob_sha": "8eea9df4f6d7b38ca0e39ccc27b04700e3d08dbeec8046d613d22706d19985fa", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/config/file_loader.py", - "content": "class ConfigFileLoader:\n def __init__(self, path: str | Path) -> None:\n self.path = Path(path)\n self.config: Any = None\n self.last_valid_config: Any = None\n self._last_seen_hash: str | None = None\n\n def read_text(self) -> str:\n return self.path.read_text(encoding=\"utf-8\")\n\n def parse(self, data: str) -> Any:\n suffix = self.path.suffix.lower()\n if suffix in {\".yml\", \".yaml\"}:\n return yaml.safe_load(data)\n return json.loads(data)\n\n def load_sync(self) -> Any:\n data = self.read_text()\n parsed = self.parse(data)\n self.config = parsed\n self.last_valid_config = parsed\n self._last_seen_hash = self._calculate_hash(data)\n return parsed\n\n def load_if_changed(self) -> tuple[bool, Any]:\n data = self.read_text()\n current_hash = self._calculate_hash(data)\n if current_hash == self._last_seen_hash:\n return False, self.config\n parsed = self.parse(data)\n self.config = parsed\n self.last_valid_config = parsed\n self._last_seen_hash = current_hash\n return True, parsed\n\n @staticmethod\n def _calculate_hash(data: str) -> str:\n return hashlib.sha256(data.encode(\"utf-8\")).hexdigest()", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/config/file_loader.py:ConfigFileLoader", - "span_start": 11, - "span_end": 48, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.config.file_loader", - "is_test": false, - "blob_sha": "1f19ffebde5e38e4be5a5d5a678059a0f36dedb8fb8b3e00ab395c67106a87ea", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/config/providers.py", - "content": "class FileConfigProvider(ConfigProvider):\n def __init__(self, path: str | Path) -> None:\n self._loader = ConfigFileLoader(path)\n\n @property\n def loader(self) -> ConfigFileLoader:\n return self._loader\n\n def load(self) -> dict[str, Any]:\n config = self._loader.load_sync()\n if not isinstance(config, dict):\n raise TypeError(\"Config root must be a mapping\")\n return dict(config)", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/config/providers.py:FileConfigProvider", - "span_start": 10, - "span_end": 22, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.config.providers", - "is_test": false, - "blob_sha": "8c53ca0122d6df6c5763bca15e99434bb4daebd5a618b8fc927e9ae90b022e64", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "class ControlActionSet:\n health: HealthHandler\n start: ActionHandler\n stop: ActionHandler\n status: ActionHandler", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/base.py:ControlActionSet", - "span_start": 14, - "span_end": 18, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.base", - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "llm_answer": "## Финальный ответ:\n\nНа основании предоставленного контекста и слоев анализа RAG, удалось выявить следующие **точки входа** и их возможные роли:\n\n### 1. `src/app_runtime/control/http_app.py`\n- **app.post**: \n - Роль: Обработчик HTTP POST-запросов FastAPI. Вероятно, используется для приема данных от клиента и инициирования последующих шагов обработки (например, вызова функций, выполняющих бизнес-логику).\n- **app.get**: \n - Роль: Обработчик HTTP GET-запросов FastAPI. Аналогично предыдущему пункту, вероятно обрабатывает запросы на получение информации.\n\n### Наиболее вероятные точки входа:\nЭти две точки (`app.post` и `app.get`) выглядят наиболее вероятными местами начальной обработки запросов в системе, поскольку они явно указаны в слое `C3_ENTRYPOINTS`.\n\n---\n\nОбратите внимание, что слой `C0_SOURCE_CHUNKS` содержит классы и функции без явных упоминаний точек входа, поэтому требуется дополнительное исследование исходного кода вокруг этих классов и функций, чтобы определить их контекст использования.", - "summary": { - "router": { - "intent": "CODE_QA", - "sub_intent": "FIND_ENTRYPOINTS", - "confidence": null - }, - "retrieval": { - "profile": "code", - "layers_hit": [ - "C0_SOURCE_CHUNKS", - "C3_ENTRYPOINTS" - ], - "evidence_sufficient": true - }, - "llm": { - "answer_status": "answered", - "groundedness": "grounded" - } - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "FIND_ENTRYPOINTS", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C3_ENTRYPOINTS", - "C0_SOURCE_CHUNKS" - ], - "symbol_kind_hint": "unknown", - "symbol_candidates": [], - "keyword_hints": [], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "execution": { - "executed_layers": [ - "C3_ENTRYPOINTS", - "C0_SOURCE_CHUNKS" - ], - "retrieval_mode_by_layer": { - "C3_ENTRYPOINTS": "exact_path_fetch", - "C0_SOURCE_CHUNKS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C3_ENTRYPOINTS": 12, - "C0_SOURCE_CHUNKS": 6 - }, - "filters_by_layer": { - "C3_ENTRYPOINTS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C3_ENTRYPOINTS", - "query": "Найди точки входа в коде", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 12, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Найди точки входа в коде", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C3_ENTRYPOINTS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 3, - "candidates_after_filter": 3 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 6, - "candidates_after_filter": 6 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "not_requested", - "resolved_symbol": null, - "alternatives": [] - }, - "layers": [ - { - "layer": "C3_ENTRYPOINTS", - "status": "hit", - "hit_count": 3, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 6, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "router": 0, - "symbol_resolution": 0, - "retrieval_total": 36, - "retrieval_by_layer": { - "C3_ENTRYPOINTS": 22, - "C0_SOURCE_CHUNKS": 13 - }, - "merge_rank": 0, - "prompt_build": 0, - "llm_call": 2109 - }, - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 458, - "evidence_rows": 9, - "evidence_chars": 2228 - }, - "evidence_summary": [ - { - "layer": "C3_ENTRYPOINTS", - "count": 3, - "unique_paths": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 6, - "unique_paths": 6 - } - ], - "prompt_template_id": "intent_code_qa_find_entrypoints_ru_v1", - "system_prompt_version": "v1" - }, - "router": { - "conversation_mode": "START", - "keyword_hints": [], - "path_scope": [] - }, - "llm": { - "used_evidence_count": 9, - "missing_evidence_reason": null - } - }, - "run_info": { - "case_id": "plba-fullchain-find-entrypoints", - "mode": "full_chain", - "run_started_at": "2026-03-12T12:02:52", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - }, - "input_request": { - "text": "Найди точки входа в коде", - "normalized_query": "Найди точки входа в коде" - }, - "steps": [ - { - "step": "intent_router", - "input": { - "query": "Найди точки входа в коде" - }, - "output": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Найди точки входа в коде" - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "FIND_ENTRYPOINTS", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C3_ENTRYPOINTS", - "C0_SOURCE_CHUNKS" - ], - "symbol_kind_hint": "unknown", - "symbol_candidates": [], - "keyword_hints": [], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "timings_ms": { - "router": 0 - } - } - }, - { - "step": "retrieval", - "input": { - "query": "Найди точки входа в коде" - }, - "output": { - "symbol_resolution": { - "status": "not_requested", - "resolved_symbol": null, - "alternatives": [], - "confidence": 0.0 - }, - "rag_count": 9, - "rag_rows": [ - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/contracts/result.py", - "content": "class StepResult:\n transition: str = \"success\"\n updates: dict[str, Any] = field(default_factory=dict)\n status: str = \"completed\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/workflow/contracts/result.py:StepResult", - "span_start": 8, - "span_end": 11, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.workflow.contracts.result", - "is_test": false, - "blob_sha": "6e57dbfe22873f097f11228a26cffa415440a43b68a737b220906461cd86c353", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/config/__init__.py", - "content": "from app_runtime.config.file_loader import ConfigFileLoader\nfrom app_runtime.config.providers import FileConfigProvider\n\n__all__ = [\"ConfigFileLoader\", \"FileConfigProvider\"]", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/config/__init__.py:1-4", - "span_start": 1, - "span_end": 4, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.app_runtime.config.__init__", - "is_test": false, - "blob_sha": "612918029820a2a983330ec92256142b55b9de4bdf3399ece18e2a02dbad9729", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/__init__.py", - "content": "__all__: list[str] = []", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/__init__.py:1-1", - "span_start": 1, - "span_end": 1, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.app_runtime.__init__", - "is_test": false, - "blob_sha": "8eea9df4f6d7b38ca0e39ccc27b04700e3d08dbeec8046d613d22706d19985fa", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/config/file_loader.py", - "content": "class ConfigFileLoader:\n def __init__(self, path: str | Path) -> None:\n self.path = Path(path)\n self.config: Any = None\n self.last_valid_config: Any = None\n self._last_seen_hash: str | None = None\n\n def read_text(self) -> str:\n return self.path.read_text(encoding=\"utf-8\")\n\n def parse(self, data: str) -> Any:\n suffix = self.path.suffix.lower()\n if suffix in {\".yml\", \".yaml\"}:\n return yaml.safe_load(data)\n return json.loads(data)\n\n def load_sync(self) -> Any:\n data = self.read_text()\n parsed = self.parse(data)\n self.config = parsed\n self.last_valid_config = parsed\n self._last_seen_hash = self._calculate_hash(data)\n return parsed\n\n def load_if_changed(self) -> tuple[bool, Any]:\n data = self.read_text()\n current_hash = self._calculate_hash(data)\n if current_hash == self._last_seen_hash:\n return False, self.config\n parsed = self.parse(data)\n self.config = parsed\n self.last_valid_config = parsed\n self._last_seen_hash = current_hash\n return True, parsed\n\n @staticmethod\n def _calculate_hash(data: str) -> str:\n return hashlib.sha256(data.encode(\"utf-8\")).hexdigest()", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/config/file_loader.py:ConfigFileLoader", - "span_start": 11, - "span_end": 48, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.config.file_loader", - "is_test": false, - "blob_sha": "1f19ffebde5e38e4be5a5d5a678059a0f36dedb8fb8b3e00ab395c67106a87ea", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/config/providers.py", - "content": "class FileConfigProvider(ConfigProvider):\n def __init__(self, path: str | Path) -> None:\n self._loader = ConfigFileLoader(path)\n\n @property\n def loader(self) -> ConfigFileLoader:\n return self._loader\n\n def load(self) -> dict[str, Any]:\n config = self._loader.load_sync()\n if not isinstance(config, dict):\n raise TypeError(\"Config root must be a mapping\")\n return dict(config)", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/config/providers.py:FileConfigProvider", - "span_start": 10, - "span_end": 22, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.config.providers", - "is_test": false, - "blob_sha": "8c53ca0122d6df6c5763bca15e99434bb4daebd5a618b8fc927e9ae90b022e64", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "class ControlActionSet:\n health: HealthHandler\n start: ActionHandler\n stop: ActionHandler\n status: ActionHandler", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/base.py:ControlActionSet", - "span_start": 14, - "span_end": 18, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.base", - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ] - }, - "diagnostics": { - "execution": { - "executed_layers": [ - "C3_ENTRYPOINTS", - "C0_SOURCE_CHUNKS" - ], - "retrieval_mode_by_layer": { - "C3_ENTRYPOINTS": "exact_path_fetch", - "C0_SOURCE_CHUNKS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C3_ENTRYPOINTS": 12, - "C0_SOURCE_CHUNKS": 6 - }, - "filters_by_layer": { - "C3_ENTRYPOINTS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C3_ENTRYPOINTS", - "query": "Найди точки входа в коде", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 12, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Найди точки входа в коде", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C3_ENTRYPOINTS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 3, - "candidates_after_filter": 3 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 6, - "candidates_after_filter": 6 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "not_requested", - "resolved_symbol": null, - "alternatives": [] - }, - "layers": [ - { - "layer": "C3_ENTRYPOINTS", - "status": "hit", - "hit_count": 3, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 6, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "symbol_resolution": 0, - "retrieval_total": 36, - "retrieval_by_layer": { - "C3_ENTRYPOINTS": 22, - "C0_SOURCE_CHUNKS": 13 - }, - "merge_rank": 0 - } - } - }, - { - "step": "llm_answer", - "input": { - "query": "Найди точки входа в коде", - "rag_count": 9 - }, - "output": { - "llm_answer": "## Финальный ответ:\n\nНа основании предоставленного контекста и слоев анализа RAG, удалось выявить следующие **точки входа** и их возможные роли:\n\n### 1. `src/app_runtime/control/http_app.py`\n- **app.post**: \n - Роль: Обработчик HTTP POST-запросов FastAPI. Вероятно, используется для приема данных от клиента и инициирования последующих шагов обработки (например, вызова функций, выполняющих бизнес-логику).\n- **app.get**: \n - Роль: Обработчик HTTP GET-запросов FastAPI. Аналогично предыдущему пункту, вероятно обрабатывает запросы на получение информации.\n\n### Наиболее вероятные точки входа:\nЭти две точки (`app.post` и `app.get`) выглядят наиболее вероятными местами начальной обработки запросов в системе, поскольку они явно указаны в слое `C3_ENTRYPOINTS`.\n\n---\n\nОбратите внимание, что слой `C0_SOURCE_CHUNKS` содержит классы и функции без явных упоминаний точек входа, поэтому требуется дополнительное исследование исходного кода вокруг этих классов и функций, чтобы определить их контекст использования." - }, - "diagnostics": { - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 458, - "evidence_rows": 9, - "evidence_chars": 2228 - }, - "evidence_summary": [ - { - "layer": "C3_ENTRYPOINTS", - "count": 3, - "unique_paths": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 6, - "unique_paths": 6 - } - ], - "prompt_template_id": "intent_code_qa_find_entrypoints_ru_v1", - "system_prompt_version": "v1" - }, - "timings_ms": { - "prompt_build": 0, - "llm_call": 2109 - } - } - } - ] - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents/20260312_120252/full_chain_plba_code_subintents_plba-fullchain-find-entrypoints.md b/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents/20260312_120252/full_chain_plba_code_subintents_plba-fullchain-find-entrypoints.md deleted file mode 100644 index 9eaba77..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents/20260312_120252/full_chain_plba_code_subintents_plba-fullchain-find-entrypoints.md +++ /dev/null @@ -1,29 +0,0 @@ -# plba-fullchain-find-entrypoints - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_subintents.yaml -- runner: runtime -- mode: full_chain -- passed: True - -## Query -Найди точки входа в коде - -## Actual -{ - "intent": "CODE_QA", - "sub_intent": "FIND_ENTRYPOINTS", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 9, - "llm_answer": "## Финальный ответ:\n\nНа основании предоставленного контекста и слоев анализа RAG, удалось выявить следующие **точки входа** и их возможные роли:\n\n### 1. `src/app_runtime/control/http_app.py`\n- **app.post**: \n - Роль: Обработчик HTTP POST-запросов FastAPI. Вероятно, используется для приема данных от клиента и инициирования последующих шагов обработки (например, вызова функций, выполняющих бизнес-логику).\n- **app.get**: \n - Роль: Обработчик HTTP GET-запросов FastAPI. Аналогично предыдущему пункту, вероятно обрабатывает запросы на получение информации.\n\n### Наиболее вероятные точки входа:\nЭти две точки (`app.post` и `app.get`) выглядят наиболее вероятными местами начальной обработки запросов в системе, поскольку они явно указаны в слое `C3_ENTRYPOINTS`.\n\n---\n\nОбратите внимание, что слой `C0_SOURCE_CHUNKS` содержит классы и функции без явных упоминаний точек входа, поэтому требуется дополнительное исследование исходного кода вокруг этих классов и функций, чтобы определить их контекст использования.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [], - "layers": [ - "C3_ENTRYPOINTS", - "C0_SOURCE_CHUNKS" - ] -} - -## Mismatches -- none \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents/20260312_120252/full_chain_plba_code_subintents_plba-fullchain-find-tests-runtime-manager.json b/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents/20260312_120252/full_chain_plba_code_subintents_plba-fullchain-find-tests-runtime-manager.json deleted file mode 100644 index 828fb08..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents/20260312_120252/full_chain_plba_code_subintents_plba-fullchain-find-tests-runtime-manager.json +++ /dev/null @@ -1,1879 +0,0 @@ -{ - "case_id": "plba-fullchain-find-tests-runtime-manager", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_subintents.yaml", - "runner": "runtime", - "mode": "full_chain", - "actual": { - "intent": "CODE_QA", - "sub_intent": "FIND_TESTS", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 16, - "llm_answer": "Прямые тесты для `RuntimeManager` найдены в следующих местах:\n\n1. **tests/test_runtime.py:** \n - `test_runtime_graceful_stop_waits_until_worker_finishes`: Проверяет корректность остановки `RuntimeManager`, ожидание завершения работником (worker).\n - `test_runtime_runs_worker_routine_and_exposes_status`: Тестирует запуск рутины работника (`worker routine`) и отображение статуса работы через интерфейс состояния (`status interface`).\n \nЭти тесты непосредственно взаимодействуют с реализацией класса `RuntimeManager`.\n\n**Описание проверок:**\n- `test_runtime_graceful_stop_waits_until_worker_finishes` — проверка правильной логики поведения при остановке менеджера и завершении работником своих задач.\n- `test_runtime_runs_worker_routine_and_exposes_status` — тестирование процесса выполнения рабочего задания и доступности его результатов через статусное API.\n\n**Оценка покрытия:**\nОба теста обеспечивают хорошее покрытие основных функциональных возможностей `RuntimeManager`. Они затрагивают важные аспекты управления жизненным циклом менеджера, взаимодействия с работником и предоставления информации о состоянии системы.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "RuntimeManager" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ] - }, - "passed": true, - "mismatches": [], - "details": { - "case_id": "plba-fullchain-find-tests-runtime-manager", - "text": "Где тесты для RuntimeManager?", - "mode": "full_chain", - "run_started_at": "2026-03-12T12:02:52", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Где тесты для RuntimeManager?", - "symbol_resolution": { - "status": "not_found", - "resolved_symbol": null, - "alternatives": [ - "RuntimeManager" - ], - "confidence": 0.0 - }, - "rag_count": 16, - "rag_rows": [ - { - "path": "tests/test_runtime.py", - "content": "test_runtime_runs_worker_routine_and_exposes_status instantiates RuntimeManager", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_runtime_runs_worker_routine_and_exposes_status:instantiates", - "span_start": 209, - "span_end": 209, - "lexical_rank": 6, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "c397a308e7824ba9fe400a754c7e15e66ea6f058d7f5d3e82bb002bb78b509d2", - "edge_type": "instantiates", - "src_symbol_id": "1c767eb5ee08e84f45b18c8ed7531ec0ed73c63fb1594823569672db7b21e992", - "src_qname": "test_runtime_runs_worker_routine_and_exposes_status", - "dst_symbol_id": "aeadc039653807b0da1ca6e3cc1078ee61cfc510b28e7f9c2ec04c59da43cc8d", - "dst_ref": "RuntimeManager", - "resolution": "resolved", - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_runtime.py", - "content": "test_runtime_graceful_stop_waits_until_worker_finishes instantiates RuntimeManager", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_runtime_graceful_stop_waits_until_worker_finishes:instantiates", - "span_start": 229, - "span_end": 229, - "lexical_rank": 6, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "76b4701262ccaa0a7a41691407c4ebdb2ca74a2415d89f0a38ef0d4f608bda93", - "edge_type": "instantiates", - "src_symbol_id": "1076e788e4a03b10d7bc1313a8ad46caa170c13cc026c6e4de994af1a6ae57bf", - "src_qname": "test_runtime_graceful_stop_waits_until_worker_finishes", - "dst_symbol_id": "aeadc039653807b0da1ca6e3cc1078ee61cfc510b28e7f9c2ec04c59da43cc8d", - "dst_ref": "RuntimeManager", - "resolution": "resolved", - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "_build_runtime instantiates RuntimeManager", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "_build_runtime:instantiates", - "span_start": 155, - "span_end": 155, - "lexical_rank": 6, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "7eb254d564944bab6272757ee5ef688862bd321e6941e2495dc942e03b1c9a25", - "edge_type": "instantiates", - "src_symbol_id": "db94031d5245bf82be836a109b4584b43b8e83d37a0f318e03f6c8191896d469", - "src_qname": "_build_runtime", - "dst_symbol_id": "a1572ea8183dc0cd6ddbc74342bbde8c28cecfde37ad40b62feff09f8d103d11", - "dst_ref": "RuntimeManager", - "resolution": "resolved", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "test_worker_wakes_up_with_configured_interval instantiates RuntimeManager", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_worker_wakes_up_with_configured_interval:instantiates", - "span_start": 167, - "span_end": 167, - "lexical_rank": 6, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "189aafc4de0b79c688668f25f0c87166a127df26bd2215452014713b65ef281a", - "edge_type": "instantiates", - "src_symbol_id": "65f877f78191d65e6a752e41cedc70ebc784c266804a55c1c56440336e1f0d6e", - "src_qname": "test_worker_wakes_up_with_configured_interval", - "dst_symbol_id": "a1572ea8183dc0cd6ddbc74342bbde8c28cecfde37ad40b62feff09f8d103d11", - "dst_ref": "RuntimeManager", - "resolution": "resolved", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "test_actions_stop_busy_worker_after_timeout\n -> BlockingRoutine\n -> BlockingRoutine.__init__\n -> BlockingRoutine._started\n -> BlockingRoutine.run", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_actions_stop_busy_worker_after_timeout:dataflow_slice", - "span_start": 42, - "span_end": 238, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 5, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "8e7db3d2a9226f1c1d9942ac6373cfcafa0d2276758ddb8a3d3c455a3d58024d", - "edge_type": "dataflow_slice", - "src_symbol_id": "66392d3222421d9ba16eda3554940b16e7d5a6f33aa08c5738d35af2e32f1e4a", - "src_qname": "test_actions_stop_busy_worker_after_timeout", - "dst_symbol_id": "d9841bdbb69706c988ae7ae6adf89928dc4fae45943f74064f5382177034ba04", - "dst_ref": "BlockingRoutine.run", - "resolution": "resolved", - "slice_id": "8e7db3d2a9226f1c1d9942ac6373cfcafa0d2276758ddb8a3d3c455a3d58024d", - "root_symbol_id": "66392d3222421d9ba16eda3554940b16e7d5a6f33aa08c5738d35af2e32f1e4a", - "path_symbols": [ - "test_actions_stop_busy_worker_after_timeout", - "BlockingRoutine", - "BlockingRoutine.__init__", - "BlockingRoutine._started", - "BlockingRoutine.run" - ], - "path_symbol_ids": [ - "66392d3222421d9ba16eda3554940b16e7d5a6f33aa08c5738d35af2e32f1e4a", - "a3349c5bc65e4003a4bbd6a8dbb7a54c337e12d1aed930caa701b12e520f1e67", - "486deeed3043c6db985aef258e96ddc67aa53608e67a83962fbd2471f649ddf1", - "d9841bdbb69706c988ae7ae6adf89928dc4fae45943f74064f5382177034ba04" - ], - "path_edge_types": [ - "instantiates", - "writes_attr", - "reads_attr" - ], - "path_length": 5, - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "test_actions_stop_busy_worker_before_timeout\n -> BlockingRoutine\n -> BlockingRoutine.__init__\n -> BlockingRoutine._release\n -> BlockingRoutine.run", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_actions_stop_busy_worker_before_timeout:dataflow_slice", - "span_start": 43, - "span_end": 212, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 5, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "8bd726155ba387d3579763ee84dfd2f9a90bc917da88f3b2e89416ab5c1254d6", - "edge_type": "dataflow_slice", - "src_symbol_id": "a0bb116ca9d909c93a285667ae033fbd1859b2dad7cf34fcb44816393ef6909c", - "src_qname": "test_actions_stop_busy_worker_before_timeout", - "dst_symbol_id": "d9841bdbb69706c988ae7ae6adf89928dc4fae45943f74064f5382177034ba04", - "dst_ref": "BlockingRoutine.run", - "resolution": "resolved", - "slice_id": "8bd726155ba387d3579763ee84dfd2f9a90bc917da88f3b2e89416ab5c1254d6", - "root_symbol_id": "a0bb116ca9d909c93a285667ae033fbd1859b2dad7cf34fcb44816393ef6909c", - "path_symbols": [ - "test_actions_stop_busy_worker_before_timeout", - "BlockingRoutine", - "BlockingRoutine.__init__", - "BlockingRoutine._release", - "BlockingRoutine.run" - ], - "path_symbol_ids": [ - "a0bb116ca9d909c93a285667ae033fbd1859b2dad7cf34fcb44816393ef6909c", - "a3349c5bc65e4003a4bbd6a8dbb7a54c337e12d1aed930caa701b12e520f1e67", - "486deeed3043c6db985aef258e96ddc67aa53608e67a83962fbd2471f649ddf1", - "d9841bdbb69706c988ae7ae6adf89928dc4fae45943f74064f5382177034ba04" - ], - "path_edge_types": [ - "instantiates", - "writes_attr", - "reads_attr" - ], - "path_length": 5, - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_runtime.py", - "content": "def test_runtime_graceful_stop_waits_until_worker_finishes() -> None:\n started = Event()\n release = Event()\n runtime = RuntimeManager()\n runtime.register_module(BlockingModule(started, release))\n runtime.start()\n assert started.wait(timeout=1.0) is True\n assert runtime.status()[\"runtime\"][\"state\"] == \"busy\"\n\n stop_thread = Thread(target=runtime.stop, kwargs={\"timeout\": 1.0}, daemon=True)\n stop_thread.start()\n sleep(0.1)\n assert stop_thread.is_alive() is True\n\n release.set()\n stop_thread.join(timeout=1.0)\n assert stop_thread.is_alive() is False\n assert runtime.status()[\"runtime\"][\"state\"] == \"stopped\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_runtime.py:test_runtime_graceful_stop_waits_until_worker_finishes", - "span_start": 226, - "span_end": 243, - "lexical_rank": 6, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 8, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_runtime", - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_runtime.py", - "content": "def test_runtime_runs_worker_routine_and_exposes_status(tmp_path) -> None:\n config_path = tmp_path / \"config.yml\"\n config_path.write_text(\n \"\"\"\nplatform:\n workers: 1\nlog:\n version: 1\n disable_existing_loggers: false\n handlers:\n console:\n class: logging.StreamHandler\n root:\n level: INFO\n handlers: [console]\n\"\"\".strip(),\n encoding=\"utf-8\",\n )\n runtime = RuntimeManager()\n runtime.add_config_file(config_path)\n module = ExampleModule()\n runtime.register_module(module)\n\n runtime.start()\n sleep(0.2)\n status = runtime.status()\n runtime.stop()\n\n assert module.routine.processed == [{\"id\": 1}]\n assert status[\"modules\"] == [\"example\"]\n assert status[\"runtime\"][\"state\"] == \"idle\"\n assert status[\"health\"][\"status\"] == \"ok\"\n assert status[\"config\"] == {\"platform\": {\"workers\": 1}, \"log\": status[\"config\"][\"log\"]}", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_runtime.py:test_runtime_runs_worker_routine_and_exposes_status", - "span_start": 191, - "span_end": 223, - "lexical_rank": 6, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 7, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_runtime", - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "def _build_runtime(worker: Worker, *, control_timeout: int = 1) -> tuple[RuntimeManager, str]:\n runtime = RuntimeManager()\n channel = HttpControlChannel(host=\"127.0.0.1\", port=0, timeout=control_timeout)\n runtime.control_plane.register_channel(channel)\n runtime.register_module(WorkerModule(worker))\n runtime.start()\n return runtime, f\"http://127.0.0.1:{channel.port}\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:_build_runtime", - "span_start": 154, - "span_end": 160, - "lexical_rank": 6, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 6, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "def test_worker_wakes_up_with_configured_interval() -> None:\n interval = 0.15\n routine = IntervalRoutine()\n worker = ScenarioWorker(\"interval-worker\", routine, interval=interval)\n runtime = RuntimeManager()\n runtime.register_module(WorkerModule(worker))\n\n runtime.start()\n try:\n assert routine.wait_runs(count=3, timeout=2.0) is True\n finally:\n runtime.stop()\n\n deltas = routine.deltas()\n assert len(deltas) >= 2\n assert all(delta >= interval * 0.7 for delta in deltas[:2])", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:test_worker_wakes_up_with_configured_interval", - "span_start": 163, - "span_end": 178, - "lexical_rank": 6, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 7, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "class BlockingRoutine:\n def __init__(self, started: Event, release: Event) -> None:\n self._started = started\n self._release = release\n\n def run(self) -> None:\n self._started.set()\n self._release.wait(timeout=5.0)", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:BlockingRoutine", - "span_start": 40, - "span_end": 47, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 1, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "class ScenarioWorker(Worker):\n def __init__(self, name: str, routine: object, *, interval: float = 0.05) -> None:\n self._name = name\n self._routine = routine\n self._interval = interval\n self._thread: Thread | None = None\n self._stop_requested = Event()\n self._in_flight = 0\n self._runs = 0\n self._lock = Lock()\n\n @property\n def name(self) -> str:\n return self._name\n\n @property\n def critical(self) -> bool:\n return True\n\n def start(self) -> None:\n if self._thread is not None and self._thread.is_alive():\n return\n self._stop_requested.clear()\n self._thread = Thread(target=self._loop, name=f\"{self._name}-thread\", daemon=True)\n self._thread.start()\n\n def stop(self, force: bool = False) -> None:\n self._stop_requested.set()\n\n def health(self) -> WorkerHealth:\n return WorkerHealth(name=self.name, status=\"ok\", critical=True, meta={\"runs\": self._runs})\n\n def status(self) -> WorkerStatus:\n thread_alive = self._thread is not None and self._thread.is_alive()\n with self._lock:\n in_flight = self._in_flight\n runs = self._runs\n if not thread_alive:\n state = \"stopped\"\n elif self._stop_requested.is_set():\n state = \"stopping\"\n elif in_flight > 0:\n state = \"busy\"\n else:\n state = \"idle\"\n return WorkerStatus(name=self.name, state=state, in_flight=in_flight, meta={\"runs\": runs})\n\n def _loop(self) -> None:\n while not self._stop_requested.is_set():\n with self._lock:\n self._in_flight += 1\n try:\n self._routine.run()\n with self._lock:\n self._runs += 1\n finally:\n with self._lock:\n self._in_flight -= 1\n if self._stop_requested.is_set():\n return\n sleep(self._interval)", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:ScenarioWorker", - "span_start": 50, - "span_end": 110, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 2, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "class WorkerModule(ApplicationModule):\n def __init__(self, worker: Worker) -> None:\n self._worker = worker\n\n @property\n def name(self) -> str:\n return \"business-tests\"\n\n def register(self, registry: ModuleRegistry) -> None:\n registry.add_worker(self._worker)", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:WorkerModule", - "span_start": 113, - "span_end": 122, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 3, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "def _http_call_json(\n base_url: str,\n path: str,\n *,\n method: str = \"GET\",\n headers: dict[str, str] | None = None,\n) -> tuple[int, dict[str, object]]:\n request = Request(f\"{base_url}{path}\", method=method, headers=headers or {})\n try:\n with urlopen(request, timeout=15.0) as response:\n status = response.status\n body = response.read()\n except HTTPError as error:\n status = error.code\n body = error.read()\n payload = json.loads(body.decode(\"utf-8\"))\n return status, payload", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:_http_call_json", - "span_start": 125, - "span_end": 141, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 4, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "class IntervalRoutine:\n calls: list[float] = field(default_factory=list)\n _lock: Lock = field(default_factory=Lock)\n\n def run(self) -> None:\n with self._lock:\n self.calls.append(monotonic())\n\n def wait_runs(self, count: int, timeout: float) -> bool:\n deadline = monotonic() + timeout\n while monotonic() < deadline:\n with self._lock:\n if len(self.calls) >= count:\n return True\n sleep(0.01)\n return False\n\n def deltas(self) -> list[float]:\n with self._lock:\n return [self.calls[index + 1] - self.calls[index] for index in range(len(self.calls) - 1)]", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:IntervalRoutine", - "span_start": 18, - "span_end": 37, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "def _poll_until_stopped(base_url: str, timeout: float = 2.0) -> bool:\n deadline = monotonic() + timeout\n while monotonic() < deadline:\n _, payload = _http_call_json(base_url, \"/actions/status\")\n if payload.get(\"detail\") == \"stopped\":\n return True\n sleep(0.05)\n return False", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:_poll_until_stopped", - "span_start": 144, - "span_end": 151, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 5, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "llm_answer": "Прямые тесты для `RuntimeManager` найдены в следующих местах:\n\n1. **tests/test_runtime.py:** \n - `test_runtime_graceful_stop_waits_until_worker_finishes`: Проверяет корректность остановки `RuntimeManager`, ожидание завершения работником (worker).\n - `test_runtime_runs_worker_routine_and_exposes_status`: Тестирует запуск рутины работника (`worker routine`) и отображение статуса работы через интерфейс состояния (`status interface`).\n \nЭти тесты непосредственно взаимодействуют с реализацией класса `RuntimeManager`.\n\n**Описание проверок:**\n- `test_runtime_graceful_stop_waits_until_worker_finishes` — проверка правильной логики поведения при остановке менеджера и завершении работником своих задач.\n- `test_runtime_runs_worker_routine_and_exposes_status` — тестирование процесса выполнения рабочего задания и доступности его результатов через статусное API.\n\n**Оценка покрытия:**\nОба теста обеспечивают хорошее покрытие основных функциональных возможностей `RuntimeManager`. Они затрагивают важные аспекты управления жизненным циклом менеджера, взаимодействия с работником и предоставления информации о состоянии системы.", - "summary": { - "router": { - "intent": "CODE_QA", - "sub_intent": "FIND_TESTS", - "confidence": null - }, - "retrieval": { - "profile": "code", - "layers_hit": [ - "C0_SOURCE_CHUNKS", - "C2_DEPENDENCY_GRAPH" - ], - "evidence_sufficient": true - }, - "llm": { - "answer_status": "answered", - "groundedness": "grounded" - } - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "FIND_TESTS", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "RuntimeManager" - ], - "keyword_hints": [ - "RuntimeManager" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**", - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "test_file_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "test_symbol_patterns": [ - "test_runtime_manager", - "TestRuntimeManager", - "RuntimeManager" - ], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C0_SOURCE_CHUNKS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C0_SOURCE_CHUNKS": 10 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [], - "include_globs": [ - "src", - "tests" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests" - ] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src", - "tests" - ], - "include_globs": [ - "src", - "tests" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests" - ] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src", - "tests" - ], - "include_globs": [ - "src", - "tests" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests" - ] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**", - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "Где тесты для RuntimeManager? test_runtime_manager TestRuntimeManager RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**", - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "top_k": 6, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Где тесты для RuntimeManager? test_runtime_manager TestRuntimeManager RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**", - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "top_k": 10, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [], - "normalized_include_globs": [ - "src", - "tests" - ], - "normalized_exclude_globs": [], - "normalized_prefer_globs": [ - "tests" - ], - "filter_stage": "post_rank", - "candidates_before_filter": 0, - "candidates_after_filter": 0 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src", - "tests" - ], - "normalized_include_globs": [ - "src", - "tests" - ], - "normalized_exclude_globs": [], - "normalized_prefer_globs": [ - "tests" - ], - "filter_stage": "post_rank", - "candidates_before_filter": 6, - "candidates_after_filter": 6 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src", - "tests" - ], - "normalized_include_globs": [ - "src", - "tests" - ], - "normalized_exclude_globs": [], - "normalized_prefer_globs": [ - "tests" - ], - "filter_stage": "post_rank", - "candidates_before_filter": 10, - "candidates_after_filter": 10 - } - ], - "fallback": { - "used": true, - "reason": "scope_relaxed_no_hits" - }, - "symbol_resolution": { - "status": "not_found", - "resolved_symbol": null, - "alternatives": [ - "RuntimeManager" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "miss", - "hit_count": 0, - "fail_reason": "scope_relaxed_no_hits" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 6, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 10, - "fail_reason": null - } - ] - }, - "constraint_violations": [ - { - "type": "LAYER_MISSING", - "severity": "warn", - "details": { - "layer": "C1_SYMBOL_CATALOG", - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ] - }, - "suggested_fix": "Increase top_k for this layer or relax constraints for retrieval." - } - ], - "timings_ms": { - "router": 0, - "symbol_resolution": 0, - "retrieval_total": 128, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 57, - "C2_DEPENDENCY_GRAPH": 52, - "C0_SOURCE_CHUNKS": 17 - }, - "merge_rank": 0, - "prompt_build": 0, - "llm_call": 1842 - }, - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 858, - "evidence_rows": 16, - "evidence_chars": 7086 - }, - "evidence_summary": [ - { - "layer": "C2_DEPENDENCY_GRAPH", - "count": 6, - "unique_paths": 2 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 10, - "unique_paths": 2 - } - ], - "prompt_template_id": "intent_code_qa_find_tests_ru_v1", - "system_prompt_version": "v1" - }, - "router": { - "conversation_mode": "START", - "keyword_hints": [ - "RuntimeManager" - ], - "path_scope": [] - }, - "llm": { - "used_evidence_count": 16, - "missing_evidence_reason": null - } - }, - "run_info": { - "case_id": "plba-fullchain-find-tests-runtime-manager", - "mode": "full_chain", - "run_started_at": "2026-03-12T12:02:52", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - }, - "input_request": { - "text": "Где тесты для RuntimeManager?", - "normalized_query": "Где тесты для RuntimeManager?" - }, - "steps": [ - { - "step": "intent_router", - "input": { - "query": "Где тесты для RuntimeManager?" - }, - "output": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Где тесты для RuntimeManager?" - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "FIND_TESTS", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "RuntimeManager" - ], - "keyword_hints": [ - "RuntimeManager" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**", - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "test_file_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "test_symbol_patterns": [ - "test_runtime_manager", - "TestRuntimeManager", - "RuntimeManager" - ], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "timings_ms": { - "router": 0 - } - } - }, - { - "step": "retrieval", - "input": { - "query": "Где тесты для RuntimeManager?" - }, - "output": { - "symbol_resolution": { - "status": "not_found", - "resolved_symbol": null, - "alternatives": [ - "RuntimeManager" - ], - "confidence": 0.0 - }, - "rag_count": 16, - "rag_rows": [ - { - "path": "tests/test_runtime.py", - "content": "test_runtime_runs_worker_routine_and_exposes_status instantiates RuntimeManager", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_runtime_runs_worker_routine_and_exposes_status:instantiates", - "span_start": 209, - "span_end": 209, - "lexical_rank": 6, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "c397a308e7824ba9fe400a754c7e15e66ea6f058d7f5d3e82bb002bb78b509d2", - "edge_type": "instantiates", - "src_symbol_id": "1c767eb5ee08e84f45b18c8ed7531ec0ed73c63fb1594823569672db7b21e992", - "src_qname": "test_runtime_runs_worker_routine_and_exposes_status", - "dst_symbol_id": "aeadc039653807b0da1ca6e3cc1078ee61cfc510b28e7f9c2ec04c59da43cc8d", - "dst_ref": "RuntimeManager", - "resolution": "resolved", - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_runtime.py", - "content": "test_runtime_graceful_stop_waits_until_worker_finishes instantiates RuntimeManager", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_runtime_graceful_stop_waits_until_worker_finishes:instantiates", - "span_start": 229, - "span_end": 229, - "lexical_rank": 6, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "76b4701262ccaa0a7a41691407c4ebdb2ca74a2415d89f0a38ef0d4f608bda93", - "edge_type": "instantiates", - "src_symbol_id": "1076e788e4a03b10d7bc1313a8ad46caa170c13cc026c6e4de994af1a6ae57bf", - "src_qname": "test_runtime_graceful_stop_waits_until_worker_finishes", - "dst_symbol_id": "aeadc039653807b0da1ca6e3cc1078ee61cfc510b28e7f9c2ec04c59da43cc8d", - "dst_ref": "RuntimeManager", - "resolution": "resolved", - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "_build_runtime instantiates RuntimeManager", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "_build_runtime:instantiates", - "span_start": 155, - "span_end": 155, - "lexical_rank": 6, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "7eb254d564944bab6272757ee5ef688862bd321e6941e2495dc942e03b1c9a25", - "edge_type": "instantiates", - "src_symbol_id": "db94031d5245bf82be836a109b4584b43b8e83d37a0f318e03f6c8191896d469", - "src_qname": "_build_runtime", - "dst_symbol_id": "a1572ea8183dc0cd6ddbc74342bbde8c28cecfde37ad40b62feff09f8d103d11", - "dst_ref": "RuntimeManager", - "resolution": "resolved", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "test_worker_wakes_up_with_configured_interval instantiates RuntimeManager", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_worker_wakes_up_with_configured_interval:instantiates", - "span_start": 167, - "span_end": 167, - "lexical_rank": 6, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "189aafc4de0b79c688668f25f0c87166a127df26bd2215452014713b65ef281a", - "edge_type": "instantiates", - "src_symbol_id": "65f877f78191d65e6a752e41cedc70ebc784c266804a55c1c56440336e1f0d6e", - "src_qname": "test_worker_wakes_up_with_configured_interval", - "dst_symbol_id": "a1572ea8183dc0cd6ddbc74342bbde8c28cecfde37ad40b62feff09f8d103d11", - "dst_ref": "RuntimeManager", - "resolution": "resolved", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "test_actions_stop_busy_worker_after_timeout\n -> BlockingRoutine\n -> BlockingRoutine.__init__\n -> BlockingRoutine._started\n -> BlockingRoutine.run", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_actions_stop_busy_worker_after_timeout:dataflow_slice", - "span_start": 42, - "span_end": 238, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 5, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "8e7db3d2a9226f1c1d9942ac6373cfcafa0d2276758ddb8a3d3c455a3d58024d", - "edge_type": "dataflow_slice", - "src_symbol_id": "66392d3222421d9ba16eda3554940b16e7d5a6f33aa08c5738d35af2e32f1e4a", - "src_qname": "test_actions_stop_busy_worker_after_timeout", - "dst_symbol_id": "d9841bdbb69706c988ae7ae6adf89928dc4fae45943f74064f5382177034ba04", - "dst_ref": "BlockingRoutine.run", - "resolution": "resolved", - "slice_id": "8e7db3d2a9226f1c1d9942ac6373cfcafa0d2276758ddb8a3d3c455a3d58024d", - "root_symbol_id": "66392d3222421d9ba16eda3554940b16e7d5a6f33aa08c5738d35af2e32f1e4a", - "path_symbols": [ - "test_actions_stop_busy_worker_after_timeout", - "BlockingRoutine", - "BlockingRoutine.__init__", - "BlockingRoutine._started", - "BlockingRoutine.run" - ], - "path_symbol_ids": [ - "66392d3222421d9ba16eda3554940b16e7d5a6f33aa08c5738d35af2e32f1e4a", - "a3349c5bc65e4003a4bbd6a8dbb7a54c337e12d1aed930caa701b12e520f1e67", - "486deeed3043c6db985aef258e96ddc67aa53608e67a83962fbd2471f649ddf1", - "d9841bdbb69706c988ae7ae6adf89928dc4fae45943f74064f5382177034ba04" - ], - "path_edge_types": [ - "instantiates", - "writes_attr", - "reads_attr" - ], - "path_length": 5, - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "test_actions_stop_busy_worker_before_timeout\n -> BlockingRoutine\n -> BlockingRoutine.__init__\n -> BlockingRoutine._release\n -> BlockingRoutine.run", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_actions_stop_busy_worker_before_timeout:dataflow_slice", - "span_start": 43, - "span_end": 212, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 5, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "8bd726155ba387d3579763ee84dfd2f9a90bc917da88f3b2e89416ab5c1254d6", - "edge_type": "dataflow_slice", - "src_symbol_id": "a0bb116ca9d909c93a285667ae033fbd1859b2dad7cf34fcb44816393ef6909c", - "src_qname": "test_actions_stop_busy_worker_before_timeout", - "dst_symbol_id": "d9841bdbb69706c988ae7ae6adf89928dc4fae45943f74064f5382177034ba04", - "dst_ref": "BlockingRoutine.run", - "resolution": "resolved", - "slice_id": "8bd726155ba387d3579763ee84dfd2f9a90bc917da88f3b2e89416ab5c1254d6", - "root_symbol_id": "a0bb116ca9d909c93a285667ae033fbd1859b2dad7cf34fcb44816393ef6909c", - "path_symbols": [ - "test_actions_stop_busy_worker_before_timeout", - "BlockingRoutine", - "BlockingRoutine.__init__", - "BlockingRoutine._release", - "BlockingRoutine.run" - ], - "path_symbol_ids": [ - "a0bb116ca9d909c93a285667ae033fbd1859b2dad7cf34fcb44816393ef6909c", - "a3349c5bc65e4003a4bbd6a8dbb7a54c337e12d1aed930caa701b12e520f1e67", - "486deeed3043c6db985aef258e96ddc67aa53608e67a83962fbd2471f649ddf1", - "d9841bdbb69706c988ae7ae6adf89928dc4fae45943f74064f5382177034ba04" - ], - "path_edge_types": [ - "instantiates", - "writes_attr", - "reads_attr" - ], - "path_length": 5, - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_runtime.py", - "content": "def test_runtime_graceful_stop_waits_until_worker_finishes() -> None:\n started = Event()\n release = Event()\n runtime = RuntimeManager()\n runtime.register_module(BlockingModule(started, release))\n runtime.start()\n assert started.wait(timeout=1.0) is True\n assert runtime.status()[\"runtime\"][\"state\"] == \"busy\"\n\n stop_thread = Thread(target=runtime.stop, kwargs={\"timeout\": 1.0}, daemon=True)\n stop_thread.start()\n sleep(0.1)\n assert stop_thread.is_alive() is True\n\n release.set()\n stop_thread.join(timeout=1.0)\n assert stop_thread.is_alive() is False\n assert runtime.status()[\"runtime\"][\"state\"] == \"stopped\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_runtime.py:test_runtime_graceful_stop_waits_until_worker_finishes", - "span_start": 226, - "span_end": 243, - "lexical_rank": 6, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 8, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_runtime", - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_runtime.py", - "content": "def test_runtime_runs_worker_routine_and_exposes_status(tmp_path) -> None:\n config_path = tmp_path / \"config.yml\"\n config_path.write_text(\n \"\"\"\nplatform:\n workers: 1\nlog:\n version: 1\n disable_existing_loggers: false\n handlers:\n console:\n class: logging.StreamHandler\n root:\n level: INFO\n handlers: [console]\n\"\"\".strip(),\n encoding=\"utf-8\",\n )\n runtime = RuntimeManager()\n runtime.add_config_file(config_path)\n module = ExampleModule()\n runtime.register_module(module)\n\n runtime.start()\n sleep(0.2)\n status = runtime.status()\n runtime.stop()\n\n assert module.routine.processed == [{\"id\": 1}]\n assert status[\"modules\"] == [\"example\"]\n assert status[\"runtime\"][\"state\"] == \"idle\"\n assert status[\"health\"][\"status\"] == \"ok\"\n assert status[\"config\"] == {\"platform\": {\"workers\": 1}, \"log\": status[\"config\"][\"log\"]}", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_runtime.py:test_runtime_runs_worker_routine_and_exposes_status", - "span_start": 191, - "span_end": 223, - "lexical_rank": 6, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 7, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_runtime", - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "def _build_runtime(worker: Worker, *, control_timeout: int = 1) -> tuple[RuntimeManager, str]:\n runtime = RuntimeManager()\n channel = HttpControlChannel(host=\"127.0.0.1\", port=0, timeout=control_timeout)\n runtime.control_plane.register_channel(channel)\n runtime.register_module(WorkerModule(worker))\n runtime.start()\n return runtime, f\"http://127.0.0.1:{channel.port}\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:_build_runtime", - "span_start": 154, - "span_end": 160, - "lexical_rank": 6, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 6, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "def test_worker_wakes_up_with_configured_interval() -> None:\n interval = 0.15\n routine = IntervalRoutine()\n worker = ScenarioWorker(\"interval-worker\", routine, interval=interval)\n runtime = RuntimeManager()\n runtime.register_module(WorkerModule(worker))\n\n runtime.start()\n try:\n assert routine.wait_runs(count=3, timeout=2.0) is True\n finally:\n runtime.stop()\n\n deltas = routine.deltas()\n assert len(deltas) >= 2\n assert all(delta >= interval * 0.7 for delta in deltas[:2])", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:test_worker_wakes_up_with_configured_interval", - "span_start": 163, - "span_end": 178, - "lexical_rank": 6, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 7, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "class BlockingRoutine:\n def __init__(self, started: Event, release: Event) -> None:\n self._started = started\n self._release = release\n\n def run(self) -> None:\n self._started.set()\n self._release.wait(timeout=5.0)", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:BlockingRoutine", - "span_start": 40, - "span_end": 47, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 1, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "class ScenarioWorker(Worker):\n def __init__(self, name: str, routine: object, *, interval: float = 0.05) -> None:\n self._name = name\n self._routine = routine\n self._interval = interval\n self._thread: Thread | None = None\n self._stop_requested = Event()\n self._in_flight = 0\n self._runs = 0\n self._lock = Lock()\n\n @property\n def name(self) -> str:\n return self._name\n\n @property\n def critical(self) -> bool:\n return True\n\n def start(self) -> None:\n if self._thread is not None and self._thread.is_alive():\n return\n self._stop_requested.clear()\n self._thread = Thread(target=self._loop, name=f\"{self._name}-thread\", daemon=True)\n self._thread.start()\n\n def stop(self, force: bool = False) -> None:\n self._stop_requested.set()\n\n def health(self) -> WorkerHealth:\n return WorkerHealth(name=self.name, status=\"ok\", critical=True, meta={\"runs\": self._runs})\n\n def status(self) -> WorkerStatus:\n thread_alive = self._thread is not None and self._thread.is_alive()\n with self._lock:\n in_flight = self._in_flight\n runs = self._runs\n if not thread_alive:\n state = \"stopped\"\n elif self._stop_requested.is_set():\n state = \"stopping\"\n elif in_flight > 0:\n state = \"busy\"\n else:\n state = \"idle\"\n return WorkerStatus(name=self.name, state=state, in_flight=in_flight, meta={\"runs\": runs})\n\n def _loop(self) -> None:\n while not self._stop_requested.is_set():\n with self._lock:\n self._in_flight += 1\n try:\n self._routine.run()\n with self._lock:\n self._runs += 1\n finally:\n with self._lock:\n self._in_flight -= 1\n if self._stop_requested.is_set():\n return\n sleep(self._interval)", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:ScenarioWorker", - "span_start": 50, - "span_end": 110, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 2, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "class WorkerModule(ApplicationModule):\n def __init__(self, worker: Worker) -> None:\n self._worker = worker\n\n @property\n def name(self) -> str:\n return \"business-tests\"\n\n def register(self, registry: ModuleRegistry) -> None:\n registry.add_worker(self._worker)", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:WorkerModule", - "span_start": 113, - "span_end": 122, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 3, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "def _http_call_json(\n base_url: str,\n path: str,\n *,\n method: str = \"GET\",\n headers: dict[str, str] | None = None,\n) -> tuple[int, dict[str, object]]:\n request = Request(f\"{base_url}{path}\", method=method, headers=headers or {})\n try:\n with urlopen(request, timeout=15.0) as response:\n status = response.status\n body = response.read()\n except HTTPError as error:\n status = error.code\n body = error.read()\n payload = json.loads(body.decode(\"utf-8\"))\n return status, payload", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:_http_call_json", - "span_start": 125, - "span_end": 141, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 4, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "class IntervalRoutine:\n calls: list[float] = field(default_factory=list)\n _lock: Lock = field(default_factory=Lock)\n\n def run(self) -> None:\n with self._lock:\n self.calls.append(monotonic())\n\n def wait_runs(self, count: int, timeout: float) -> bool:\n deadline = monotonic() + timeout\n while monotonic() < deadline:\n with self._lock:\n if len(self.calls) >= count:\n return True\n sleep(0.01)\n return False\n\n def deltas(self) -> list[float]:\n with self._lock:\n return [self.calls[index + 1] - self.calls[index] for index in range(len(self.calls) - 1)]", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:IntervalRoutine", - "span_start": 18, - "span_end": 37, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "def _poll_until_stopped(base_url: str, timeout: float = 2.0) -> bool:\n deadline = monotonic() + timeout\n while monotonic() < deadline:\n _, payload = _http_call_json(base_url, \"/actions/status\")\n if payload.get(\"detail\") == \"stopped\":\n return True\n sleep(0.05)\n return False", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:_poll_until_stopped", - "span_start": 144, - "span_end": 151, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 5, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ] - }, - "diagnostics": { - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C0_SOURCE_CHUNKS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C0_SOURCE_CHUNKS": 10 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [], - "include_globs": [ - "src", - "tests" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests" - ] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src", - "tests" - ], - "include_globs": [ - "src", - "tests" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests" - ] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src", - "tests" - ], - "include_globs": [ - "src", - "tests" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests" - ] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**", - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "Где тесты для RuntimeManager? test_runtime_manager TestRuntimeManager RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**", - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "top_k": 6, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Где тесты для RuntimeManager? test_runtime_manager TestRuntimeManager RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**", - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "top_k": 10, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [], - "normalized_include_globs": [ - "src", - "tests" - ], - "normalized_exclude_globs": [], - "normalized_prefer_globs": [ - "tests" - ], - "filter_stage": "post_rank", - "candidates_before_filter": 0, - "candidates_after_filter": 0 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src", - "tests" - ], - "normalized_include_globs": [ - "src", - "tests" - ], - "normalized_exclude_globs": [], - "normalized_prefer_globs": [ - "tests" - ], - "filter_stage": "post_rank", - "candidates_before_filter": 6, - "candidates_after_filter": 6 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src", - "tests" - ], - "normalized_include_globs": [ - "src", - "tests" - ], - "normalized_exclude_globs": [], - "normalized_prefer_globs": [ - "tests" - ], - "filter_stage": "post_rank", - "candidates_before_filter": 10, - "candidates_after_filter": 10 - } - ], - "fallback": { - "used": true, - "reason": "scope_relaxed_no_hits" - }, - "symbol_resolution": { - "status": "not_found", - "resolved_symbol": null, - "alternatives": [ - "RuntimeManager" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "miss", - "hit_count": 0, - "fail_reason": "scope_relaxed_no_hits" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 6, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 10, - "fail_reason": null - } - ] - }, - "constraint_violations": [ - { - "type": "LAYER_MISSING", - "severity": "warn", - "details": { - "layer": "C1_SYMBOL_CATALOG", - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ] - }, - "suggested_fix": "Increase top_k for this layer or relax constraints for retrieval." - } - ], - "timings_ms": { - "symbol_resolution": 0, - "retrieval_total": 128, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 57, - "C2_DEPENDENCY_GRAPH": 52, - "C0_SOURCE_CHUNKS": 17 - }, - "merge_rank": 0 - } - } - }, - { - "step": "llm_answer", - "input": { - "query": "Где тесты для RuntimeManager?", - "rag_count": 16 - }, - "output": { - "llm_answer": "Прямые тесты для `RuntimeManager` найдены в следующих местах:\n\n1. **tests/test_runtime.py:** \n - `test_runtime_graceful_stop_waits_until_worker_finishes`: Проверяет корректность остановки `RuntimeManager`, ожидание завершения работником (worker).\n - `test_runtime_runs_worker_routine_and_exposes_status`: Тестирует запуск рутины работника (`worker routine`) и отображение статуса работы через интерфейс состояния (`status interface`).\n \nЭти тесты непосредственно взаимодействуют с реализацией класса `RuntimeManager`.\n\n**Описание проверок:**\n- `test_runtime_graceful_stop_waits_until_worker_finishes` — проверка правильной логики поведения при остановке менеджера и завершении работником своих задач.\n- `test_runtime_runs_worker_routine_and_exposes_status` — тестирование процесса выполнения рабочего задания и доступности его результатов через статусное API.\n\n**Оценка покрытия:**\nОба теста обеспечивают хорошее покрытие основных функциональных возможностей `RuntimeManager`. Они затрагивают важные аспекты управления жизненным циклом менеджера, взаимодействия с работником и предоставления информации о состоянии системы." - }, - "diagnostics": { - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 858, - "evidence_rows": 16, - "evidence_chars": 7086 - }, - "evidence_summary": [ - { - "layer": "C2_DEPENDENCY_GRAPH", - "count": 6, - "unique_paths": 2 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 10, - "unique_paths": 2 - } - ], - "prompt_template_id": "intent_code_qa_find_tests_ru_v1", - "system_prompt_version": "v1" - }, - "timings_ms": { - "prompt_build": 0, - "llm_call": 1842 - } - } - } - ] - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents/20260312_120252/full_chain_plba_code_subintents_plba-fullchain-find-tests-runtime-manager.md b/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents/20260312_120252/full_chain_plba_code_subintents_plba-fullchain-find-tests-runtime-manager.md deleted file mode 100644 index 06292fb..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents/20260312_120252/full_chain_plba_code_subintents_plba-fullchain-find-tests-runtime-manager.md +++ /dev/null @@ -1,32 +0,0 @@ -# plba-fullchain-find-tests-runtime-manager - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_subintents.yaml -- runner: runtime -- mode: full_chain -- passed: True - -## Query -Где тесты для RuntimeManager? - -## Actual -{ - "intent": "CODE_QA", - "sub_intent": "FIND_TESTS", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 16, - "llm_answer": "Прямые тесты для `RuntimeManager` найдены в следующих местах:\n\n1. **tests/test_runtime.py:** \n - `test_runtime_graceful_stop_waits_until_worker_finishes`: Проверяет корректность остановки `RuntimeManager`, ожидание завершения работником (worker).\n - `test_runtime_runs_worker_routine_and_exposes_status`: Тестирует запуск рутины работника (`worker routine`) и отображение статуса работы через интерфейс состояния (`status interface`).\n \nЭти тесты непосредственно взаимодействуют с реализацией класса `RuntimeManager`.\n\n**Описание проверок:**\n- `test_runtime_graceful_stop_waits_until_worker_finishes` — проверка правильной логики поведения при остановке менеджера и завершении работником своих задач.\n- `test_runtime_runs_worker_routine_and_exposes_status` — тестирование процесса выполнения рабочего задания и доступности его результатов через статусное API.\n\n**Оценка покрытия:**\nОба теста обеспечивают хорошее покрытие основных функциональных возможностей `RuntimeManager`. Они затрагивают важные аспекты управления жизненным циклом менеджера, взаимодействия с работником и предоставления информации о состоянии системы.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "RuntimeManager" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ] -} - -## Mismatches -- none \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents/20260312_120252/full_chain_plba_code_subintents_plba-fullchain-open-file-runtime.json b/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents/20260312_120252/full_chain_plba_code_subintents_plba-fullchain-open-file-runtime.json deleted file mode 100644 index 0c3cd0b..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents/20260312_120252/full_chain_plba_code_subintents_plba-fullchain-open-file-runtime.json +++ /dev/null @@ -1,492 +0,0 @@ -{ - "case_id": "plba-fullchain-open-file-runtime", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_subintents.yaml", - "runner": "runtime", - "mode": "full_chain", - "actual": { - "intent": "CODE_QA", - "sub_intent": "OPEN_FILE", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 1, - "llm_answer": "Файл `src/app_runtime/core/runtime.py` содержит определение класса `RuntimeManager`, управляющего выполнением приложения в runtime режиме.\n\n## Важные сущности и их значение:\n- **ConfigurationManager**: управляет конфигурацией приложения.\n- **ServiceContainer**: контейнер сервисов, используемых приложением.\n- **TraceService**: сервис отслеживания трассировок выполнения программы.\n- **HealthRegistry**: регистрирует состояние здоровья компонентов системы.\n- **LogManager**: менеджер логирования событий.\n- **WorkerSupervisor**: супервизор рабочих процессов.\n- **ControlPlaneService**: компонент управления системой.\n- **ModuleRegistry**: реестр модулей, зарегистрированных в системе.\n- **LifecycleState**: состояния жизненного цикла менеджера (например, IDLE).\n \nЭтот класс отвечает за инициализацию и управление основными компонентами приложения во время его исполнения. Важно отметить метод `__init__`, который устанавливает начальные значения свойств объекта и вызывает метод `_register_core_services()`. \n\nОтвет основан на доступных фрагментах файла `src/app_runtime/core/runtime.py`.", - "answer_mode": "answered", - "path_scope": [ - "src/app_runtime/core/runtime.py" - ], - "symbol_candidates": [], - "layers": [ - "C0_SOURCE_CHUNKS" - ] - }, - "passed": true, - "mismatches": [], - "details": { - "case_id": "plba-fullchain-open-file-runtime", - "text": "Открой файл src/app_runtime/core/runtime.py", - "mode": "full_chain", - "run_started_at": "2026-03-12T12:02:52", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Открой файл src/app_runtime/core/runtime.py", - "symbol_resolution": { - "status": "not_requested", - "resolved_symbol": null, - "alternatives": [], - "confidence": 0.0 - }, - "rag_count": 1, - "rag_rows": [ - { - "path": "src/app_runtime/core/runtime.py", - "content": "class RuntimeManager:\n ACTION_TIMEOUT_SECONDS = 10.0\n ACTION_POLL_INTERVAL_SECONDS = 0.05\n\n def __init__(\n self,\n configuration: ConfigurationManager | None = None,\n services: ServiceContainer | None = None,\n traces: TraceService | None = None,\n health: HealthRegistry | None = None,\n logs: LogManager | None = None,\n workers: WorkerSupervisor | None = None,\n control_plane: ControlPlaneService | None = None,\n ) -> None:\n self.configuration = configuration or ConfigurationManager()\n self.services = services or ServiceContainer()\n self.traces = traces or TraceService()\n self.health = health or HealthRegistry()\n self.logs = logs or LogManager()\n self.workers = workers or WorkerSupervisor()\n self.control_plane = control_plane or ControlPlaneService()\n self.registry = ModuleRegistry(self.services)\n self._started = False\n self._state = LifecycleState.IDLE\n self._core_registered = False\n self._workers_registered = False\n self._register_core_services()\n\n def register_module(self, module: ApplicationModule) -> None:\n self.registry.register_module(module.name)\n module.register(self.registry)\n\n def add_config_file(self, path: str) -> FileConfigProvider:\n provider = FileConfigProvider(path)\n self.configuration.add_provider(provider)\n return provider\n\n def start(self, *, start_control_plane: bool = True) -> None:\n if self._started:\n return\n self._state = LifecycleState.STARTING\n config = self.configuration.load()\n self.logs.apply_config(config)\n self._register_health_contributors()\n self._register_workers()\n self.workers.start()\n if start_control_plane:\n self.control_plane.start(self)\n self._started = True\n self._refresh_state()\n\n def stop(self, timeout: float = 30.0, force: bool = False, stop_control_plane: bool = True) -> None:\n if not self._started:\n return\n self._state = LifecycleState.STOPPING\n self.workers.stop(timeout=timeout, force=force)\n if stop_control_plane:\n self.control_plane.stop()\n self._started = False\n self._state = LifecycleState.STOPPED\n\n def status(self) -> dict[str, object]:\n self._refresh_state()\n return self.control_plane.snapshot(self)\n\n def current_health(self) -> HealthPayload:\n self._refresh_state()\n return self.health.payload(self._state, self.workers.healths())\n\n async def health_status(self) -> HealthPayload:\n return self.current_health()\n\n async def start_runtime(self) -> dict[str, object] | str:\n self._refresh_state()\n if self._started:\n return \"runtime already running\"\n if self._state == LifecycleState.STOPPING:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n\n self.start(start_control_plane=False)\n started = self._wait_for_state({LifecycleState.IDLE, LifecycleState.BUSY}, timeout=self.ACTION_TIMEOUT_SECONDS)\n if started:\n return self._action_detail(\"runtime started\", timed_out=False)\n return self._action_detail(\"runtime start is still in progress\", timed_out=True)\n\n async def stop_runtime(self) -> dict[str, object] | str:\n self._refresh_state()\n if not self._started:\n if self._state == LifecycleState.STOPPING:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n return \"runtime already stopped\"\n\n self._state = LifecycleState.STOPPING\n try:\n self.workers.stop(timeout=self.ACTION_TIMEOUT_SECONDS, force=False)\n except TimeoutError:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n\n self._started = False\n self._state = LifecycleState.STOPPED\n return self._action_detail(\"runtime stopped\", timed_out=False)\n\n async def runtime_status(self) -> str:\n self._refresh_state()\n return self._state.value\n\n def _register_core_services(self) -> None:\n if self._core_registered:\n return\n self.services.register(\"configuration\", self.configuration)\n self.services.register(\"traces\", self.traces)\n self.services.register(\"health\", self.health)\n self.services.register(\"logs\", self.logs)\n self.services.register(\"workers\", self.workers)\n self.services.register(\"control_plane\", self.control_plane)\n self._core_registered = True\n\n def _register_health_contributors(self) -> None:\n for contributor in self.registry.health_contributors:\n self.health.register(contributor)\n\n def _register_workers(self) -> None:\n if self._workers_registered:\n return\n for worker in self.registry.workers:\n self.workers.register(worker)\n self._workers_registered = True\n\n def _refresh_state(self) -> None:\n lifecycle = self.workers.lifecycle_state()\n\n if self._state == LifecycleState.STOPPING:\n if lifecycle == LifecycleState.STOPPED:\n self._started = False\n self._state = LifecycleState.STOPPED\n return\n\n if not self._started:\n if lifecycle == LifecycleState.STOPPED:\n self._state = LifecycleState.STOPPED\n return\n\n self._state = lifecycle\n\n def _wait_for_state(self, target_states: set[LifecycleState], *, timeout: float) -> bool:\n deadline = monotonic() + timeout\n while monotonic() < deadline:\n self._refresh_state()\n if self._state in target_states:\n return True\n sleep(self.ACTION_POLL_INTERVAL_SECONDS)\n self._refresh_state()\n return self._state in target_states\n\n def _action_detail(self, message: str, *, timed_out: bool) -> dict[str, object]:\n self._refresh_state()\n return {\n \"message\": message,\n \"state\": self._state.value,\n \"timed_out\": timed_out,\n \"workers\": self.workers.snapshot(),\n }", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/core/runtime.py:RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.core.runtime", - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "llm_answer": "Файл `src/app_runtime/core/runtime.py` содержит определение класса `RuntimeManager`, управляющего выполнением приложения в runtime режиме.\n\n## Важные сущности и их значение:\n- **ConfigurationManager**: управляет конфигурацией приложения.\n- **ServiceContainer**: контейнер сервисов, используемых приложением.\n- **TraceService**: сервис отслеживания трассировок выполнения программы.\n- **HealthRegistry**: регистрирует состояние здоровья компонентов системы.\n- **LogManager**: менеджер логирования событий.\n- **WorkerSupervisor**: супервизор рабочих процессов.\n- **ControlPlaneService**: компонент управления системой.\n- **ModuleRegistry**: реестр модулей, зарегистрированных в системе.\n- **LifecycleState**: состояния жизненного цикла менеджера (например, IDLE).\n \nЭтот класс отвечает за инициализацию и управление основными компонентами приложения во время его исполнения. Важно отметить метод `__init__`, который устанавливает начальные значения свойств объекта и вызывает метод `_register_core_services()`. \n\nОтвет основан на доступных фрагментах файла `src/app_runtime/core/runtime.py`.", - "summary": { - "router": { - "intent": "CODE_QA", - "sub_intent": "OPEN_FILE", - "confidence": null - }, - "retrieval": { - "profile": "code", - "layers_hit": [ - "C0_SOURCE_CHUNKS" - ], - "evidence_sufficient": true - }, - "llm": { - "answer_status": "answered", - "groundedness": "grounded" - } - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "OPEN_FILE", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C0_SOURCE_CHUNKS" - ], - "symbol_kind_hint": "unknown", - "symbol_candidates": [], - "keyword_hints": [], - "path_hints": [ - "src/app_runtime/core/runtime.py" - ], - "path_scope": [ - "src/app_runtime/core/runtime.py" - ], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/app_runtime/core/runtime.py" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": false, - "max_distance": 2, - "top_k": 5 - } - } - }, - "execution": { - "executed_layers": [ - "C0_SOURCE_CHUNKS" - ], - "retrieval_mode_by_layer": { - "C0_SOURCE_CHUNKS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C0_SOURCE_CHUNKS": 200 - }, - "filters_by_layer": { - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src/app_runtime/core/runtime.py" - ], - "include_globs": [], - "exclude_globs": [], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Открой файл src/app_runtime/core/runtime.py", - "path_scope": [ - "src/app_runtime/core/runtime.py" - ], - "include_globs": [], - "exclude_globs": [], - "prefer_globs": [], - "top_k": 200, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src/app_runtime/core/runtime.py" - ], - "normalized_include_globs": [], - "normalized_exclude_globs": [], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 1, - "candidates_after_filter": 1 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "not_requested", - "resolved_symbol": null, - "alternatives": [] - }, - "layers": [ - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 1, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "router": 0, - "symbol_resolution": 0, - "retrieval_total": 129, - "retrieval_by_layer": { - "C0_SOURCE_CHUNKS": 129 - }, - "merge_rank": 0, - "prompt_build": 0, - "llm_call": 1603 - }, - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 555, - "evidence_rows": 1, - "evidence_chars": 6265 - }, - "evidence_summary": [ - { - "layer": "C0_SOURCE_CHUNKS", - "count": 1, - "unique_paths": 1 - } - ], - "prompt_template_id": "intent_code_qa_open_file_ru_v1", - "system_prompt_version": "v1" - }, - "router": { - "conversation_mode": "START", - "keyword_hints": [], - "path_scope": [ - "src/app_runtime/core/runtime.py" - ] - }, - "llm": { - "used_evidence_count": 1, - "missing_evidence_reason": null - } - }, - "run_info": { - "case_id": "plba-fullchain-open-file-runtime", - "mode": "full_chain", - "run_started_at": "2026-03-12T12:02:52", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - }, - "input_request": { - "text": "Открой файл src/app_runtime/core/runtime.py", - "normalized_query": "Открой файл src/app_runtime/core/runtime.py" - }, - "steps": [ - { - "step": "intent_router", - "input": { - "query": "Открой файл src/app_runtime/core/runtime.py" - }, - "output": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Открой файл src/app_runtime/core/runtime.py" - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "OPEN_FILE", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C0_SOURCE_CHUNKS" - ], - "symbol_kind_hint": "unknown", - "symbol_candidates": [], - "keyword_hints": [], - "path_hints": [ - "src/app_runtime/core/runtime.py" - ], - "path_scope": [ - "src/app_runtime/core/runtime.py" - ], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/app_runtime/core/runtime.py" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": false, - "max_distance": 2, - "top_k": 5 - } - } - }, - "timings_ms": { - "router": 0 - } - } - }, - { - "step": "retrieval", - "input": { - "query": "Открой файл src/app_runtime/core/runtime.py" - }, - "output": { - "symbol_resolution": { - "status": "not_requested", - "resolved_symbol": null, - "alternatives": [], - "confidence": 0.0 - }, - "rag_count": 1, - "rag_rows": [ - { - "path": "src/app_runtime/core/runtime.py", - "content": "class RuntimeManager:\n ACTION_TIMEOUT_SECONDS = 10.0\n ACTION_POLL_INTERVAL_SECONDS = 0.05\n\n def __init__(\n self,\n configuration: ConfigurationManager | None = None,\n services: ServiceContainer | None = None,\n traces: TraceService | None = None,\n health: HealthRegistry | None = None,\n logs: LogManager | None = None,\n workers: WorkerSupervisor | None = None,\n control_plane: ControlPlaneService | None = None,\n ) -> None:\n self.configuration = configuration or ConfigurationManager()\n self.services = services or ServiceContainer()\n self.traces = traces or TraceService()\n self.health = health or HealthRegistry()\n self.logs = logs or LogManager()\n self.workers = workers or WorkerSupervisor()\n self.control_plane = control_plane or ControlPlaneService()\n self.registry = ModuleRegistry(self.services)\n self._started = False\n self._state = LifecycleState.IDLE\n self._core_registered = False\n self._workers_registered = False\n self._register_core_services()\n\n def register_module(self, module: ApplicationModule) -> None:\n self.registry.register_module(module.name)\n module.register(self.registry)\n\n def add_config_file(self, path: str) -> FileConfigProvider:\n provider = FileConfigProvider(path)\n self.configuration.add_provider(provider)\n return provider\n\n def start(self, *, start_control_plane: bool = True) -> None:\n if self._started:\n return\n self._state = LifecycleState.STARTING\n config = self.configuration.load()\n self.logs.apply_config(config)\n self._register_health_contributors()\n self._register_workers()\n self.workers.start()\n if start_control_plane:\n self.control_plane.start(self)\n self._started = True\n self._refresh_state()\n\n def stop(self, timeout: float = 30.0, force: bool = False, stop_control_plane: bool = True) -> None:\n if not self._started:\n return\n self._state = LifecycleState.STOPPING\n self.workers.stop(timeout=timeout, force=force)\n if stop_control_plane:\n self.control_plane.stop()\n self._started = False\n self._state = LifecycleState.STOPPED\n\n def status(self) -> dict[str, object]:\n self._refresh_state()\n return self.control_plane.snapshot(self)\n\n def current_health(self) -> HealthPayload:\n self._refresh_state()\n return self.health.payload(self._state, self.workers.healths())\n\n async def health_status(self) -> HealthPayload:\n return self.current_health()\n\n async def start_runtime(self) -> dict[str, object] | str:\n self._refresh_state()\n if self._started:\n return \"runtime already running\"\n if self._state == LifecycleState.STOPPING:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n\n self.start(start_control_plane=False)\n started = self._wait_for_state({LifecycleState.IDLE, LifecycleState.BUSY}, timeout=self.ACTION_TIMEOUT_SECONDS)\n if started:\n return self._action_detail(\"runtime started\", timed_out=False)\n return self._action_detail(\"runtime start is still in progress\", timed_out=True)\n\n async def stop_runtime(self) -> dict[str, object] | str:\n self._refresh_state()\n if not self._started:\n if self._state == LifecycleState.STOPPING:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n return \"runtime already stopped\"\n\n self._state = LifecycleState.STOPPING\n try:\n self.workers.stop(timeout=self.ACTION_TIMEOUT_SECONDS, force=False)\n except TimeoutError:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n\n self._started = False\n self._state = LifecycleState.STOPPED\n return self._action_detail(\"runtime stopped\", timed_out=False)\n\n async def runtime_status(self) -> str:\n self._refresh_state()\n return self._state.value\n\n def _register_core_services(self) -> None:\n if self._core_registered:\n return\n self.services.register(\"configuration\", self.configuration)\n self.services.register(\"traces\", self.traces)\n self.services.register(\"health\", self.health)\n self.services.register(\"logs\", self.logs)\n self.services.register(\"workers\", self.workers)\n self.services.register(\"control_plane\", self.control_plane)\n self._core_registered = True\n\n def _register_health_contributors(self) -> None:\n for contributor in self.registry.health_contributors:\n self.health.register(contributor)\n\n def _register_workers(self) -> None:\n if self._workers_registered:\n return\n for worker in self.registry.workers:\n self.workers.register(worker)\n self._workers_registered = True\n\n def _refresh_state(self) -> None:\n lifecycle = self.workers.lifecycle_state()\n\n if self._state == LifecycleState.STOPPING:\n if lifecycle == LifecycleState.STOPPED:\n self._started = False\n self._state = LifecycleState.STOPPED\n return\n\n if not self._started:\n if lifecycle == LifecycleState.STOPPED:\n self._state = LifecycleState.STOPPED\n return\n\n self._state = lifecycle\n\n def _wait_for_state(self, target_states: set[LifecycleState], *, timeout: float) -> bool:\n deadline = monotonic() + timeout\n while monotonic() < deadline:\n self._refresh_state()\n if self._state in target_states:\n return True\n sleep(self.ACTION_POLL_INTERVAL_SECONDS)\n self._refresh_state()\n return self._state in target_states\n\n def _action_detail(self, message: str, *, timed_out: bool) -> dict[str, object]:\n self._refresh_state()\n return {\n \"message\": message,\n \"state\": self._state.value,\n \"timed_out\": timed_out,\n \"workers\": self.workers.snapshot(),\n }", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/core/runtime.py:RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.core.runtime", - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ] - }, - "diagnostics": { - "execution": { - "executed_layers": [ - "C0_SOURCE_CHUNKS" - ], - "retrieval_mode_by_layer": { - "C0_SOURCE_CHUNKS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C0_SOURCE_CHUNKS": 200 - }, - "filters_by_layer": { - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src/app_runtime/core/runtime.py" - ], - "include_globs": [], - "exclude_globs": [], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Открой файл src/app_runtime/core/runtime.py", - "path_scope": [ - "src/app_runtime/core/runtime.py" - ], - "include_globs": [], - "exclude_globs": [], - "prefer_globs": [], - "top_k": 200, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src/app_runtime/core/runtime.py" - ], - "normalized_include_globs": [], - "normalized_exclude_globs": [], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 1, - "candidates_after_filter": 1 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "not_requested", - "resolved_symbol": null, - "alternatives": [] - }, - "layers": [ - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 1, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "symbol_resolution": 0, - "retrieval_total": 129, - "retrieval_by_layer": { - "C0_SOURCE_CHUNKS": 129 - }, - "merge_rank": 0 - } - } - }, - { - "step": "llm_answer", - "input": { - "query": "Открой файл src/app_runtime/core/runtime.py", - "rag_count": 1 - }, - "output": { - "llm_answer": "Файл `src/app_runtime/core/runtime.py` содержит определение класса `RuntimeManager`, управляющего выполнением приложения в runtime режиме.\n\n## Важные сущности и их значение:\n- **ConfigurationManager**: управляет конфигурацией приложения.\n- **ServiceContainer**: контейнер сервисов, используемых приложением.\n- **TraceService**: сервис отслеживания трассировок выполнения программы.\n- **HealthRegistry**: регистрирует состояние здоровья компонентов системы.\n- **LogManager**: менеджер логирования событий.\n- **WorkerSupervisor**: супервизор рабочих процессов.\n- **ControlPlaneService**: компонент управления системой.\n- **ModuleRegistry**: реестр модулей, зарегистрированных в системе.\n- **LifecycleState**: состояния жизненного цикла менеджера (например, IDLE).\n \nЭтот класс отвечает за инициализацию и управление основными компонентами приложения во время его исполнения. Важно отметить метод `__init__`, который устанавливает начальные значения свойств объекта и вызывает метод `_register_core_services()`. \n\nОтвет основан на доступных фрагментах файла `src/app_runtime/core/runtime.py`." - }, - "diagnostics": { - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 555, - "evidence_rows": 1, - "evidence_chars": 6265 - }, - "evidence_summary": [ - { - "layer": "C0_SOURCE_CHUNKS", - "count": 1, - "unique_paths": 1 - } - ], - "prompt_template_id": "intent_code_qa_open_file_ru_v1", - "system_prompt_version": "v1" - }, - "timings_ms": { - "prompt_build": 0, - "llm_call": 1603 - } - } - } - ] - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents/20260312_120252/full_chain_plba_code_subintents_plba-fullchain-open-file-runtime.md b/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents/20260312_120252/full_chain_plba_code_subintents_plba-fullchain-open-file-runtime.md deleted file mode 100644 index 82d1037..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents/20260312_120252/full_chain_plba_code_subintents_plba-fullchain-open-file-runtime.md +++ /dev/null @@ -1,30 +0,0 @@ -# plba-fullchain-open-file-runtime - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_subintents.yaml -- runner: runtime -- mode: full_chain -- passed: True - -## Query -Открой файл src/app_runtime/core/runtime.py - -## Actual -{ - "intent": "CODE_QA", - "sub_intent": "OPEN_FILE", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 1, - "llm_answer": "Файл `src/app_runtime/core/runtime.py` содержит определение класса `RuntimeManager`, управляющего выполнением приложения в runtime режиме.\n\n## Важные сущности и их значение:\n- **ConfigurationManager**: управляет конфигурацией приложения.\n- **ServiceContainer**: контейнер сервисов, используемых приложением.\n- **TraceService**: сервис отслеживания трассировок выполнения программы.\n- **HealthRegistry**: регистрирует состояние здоровья компонентов системы.\n- **LogManager**: менеджер логирования событий.\n- **WorkerSupervisor**: супервизор рабочих процессов.\n- **ControlPlaneService**: компонент управления системой.\n- **ModuleRegistry**: реестр модулей, зарегистрированных в системе.\n- **LifecycleState**: состояния жизненного цикла менеджера (например, IDLE).\n \nЭтот класс отвечает за инициализацию и управление основными компонентами приложения во время его исполнения. Важно отметить метод `__init__`, который устанавливает начальные значения свойств объекта и вызывает метод `_register_core_services()`. \n\nОтвет основан на доступных фрагментах файла `src/app_runtime/core/runtime.py`.", - "answer_mode": "answered", - "path_scope": [ - "src/app_runtime/core/runtime.py" - ], - "symbol_candidates": [], - "layers": [ - "C0_SOURCE_CHUNKS" - ] -} - -## Mismatches -- none \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents/20260312_120252/full_chain_plba_code_subintents_plba-fullchain-trace-flow-runtime-manager.json b/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents/20260312_120252/full_chain_plba_code_subintents_plba-fullchain-trace-flow-runtime-manager.json deleted file mode 100644 index a814d48..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents/20260312_120252/full_chain_plba_code_subintents_plba-fullchain-trace-flow-runtime-manager.json +++ /dev/null @@ -1,2964 +0,0 @@ -{ - "case_id": "plba-fullchain-trace-flow-runtime-manager", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_subintents.yaml", - "runner": "runtime", - "mode": "full_chain", - "actual": { - "intent": "CODE_QA", - "sub_intent": "TRACE_FLOW", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 23, - "llm_answer": "## Шаги потока выполнения для `RuntimeManager`\n\n1. **Начало**: Точка вызова находится в файле `http_app.py` метода `app.post`, который является точкой входа (`C3_ENTRYPOINTS`).\n \n2. **Первый этап**:\n - Вызывается инициализация объекта класса `RuntimeManager` через конструктор `RuntimeManager.__init__`.\n - Источник: [C2_DEPENDENCY_GRAPH]\n - Конструктор принимает параметры конфигурации, сервисов, трассировки, состояния здоровья, логирования, управления рабочими процессами и контрольной плоскости.\n - Эти параметры могут быть переданы напрямую при вызове конструктора или использованы предустановленные значения по умолчанию.\n\n3. **Второй этап**:\n - Внутри конструктора выполняется инициализация атрибутов экземпляра объекта:\n - self.configuration\n - self.services\n - self.traces\n - self.health\n - self.logs\n - self.workers\n - self.control_plane\n - Остальные свойства также инициализируются с заданными значениями.\n\n4. **Третий этап**:\n - После инициализации атрибутов объект вызывает метод `_register_core_services()`, чтобы зарегистрировать основные сервисы.\n - Это действие подразумевает дальнейшее управление и координацию работы различных компонентов системы.\n\n5. **Завершение**:\n - Поток завершается после завершения регистрации основных сервисов и настройки всех необходимых внутренних атрибутов и связей внутри объекта `RuntimeManager`.\n\n## Недостатки информации\n\nНа данный момент отсутствует явная информация о том, как именно методы `add_config_file`, `register_module` и другие используемые внутри конструктора взаимодействуют друг с другом и внешними системами. Более детальная документация по этим методам помогла бы лучше понять детали их использования и зависимость от внешних факторов.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "RuntimeManager" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "passed": true, - "mismatches": [], - "details": { - "case_id": "plba-fullchain-trace-flow-runtime-manager", - "text": "Покажи поток выполнения RuntimeManager", - "mode": "full_chain", - "run_started_at": "2026-03-12T12:02:52", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Покажи поток выполнения RuntimeManager", - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "RuntimeManager", - "alternatives": [ - "RuntimeManager" - ], - "confidence": 0.99 - }, - "rag_count": 23, - "rag_rows": [ - { - "path": "src/app_runtime/core/runtime.py", - "content": "class RuntimeManager\nRuntimeManager", - "layer": "C1_SYMBOL_CATALOG", - "title": "RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "7e4a9381328c5803bbc6179458612fc4e947d928aa7bf8b4b2bebb2c8592f758", - "qname": "RuntimeManager", - "kind": "class", - "signature": "RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.core.runtime", - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests manager\n- orchestrates role-like calls (4)\n- reads and writes state attributes\n- participates in dataflow slices (50)", - "layer": "C4_SEMANTIC_ROLES", - "title": "RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 43, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "7e4a9381328c5803bbc6179458612fc4e947d928aa7bf8b4b2bebb2c8592f758", - "symbol_name": "RuntimeManager", - "qname": "RuntimeManager", - "role": "pipeline_stage", - "confidence": 0.67, - "dataflow_participation": 50, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "ControlChannel\nrole: model\n\nResponsibilities:\n- default model role", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlChannel", - "span_start": 21, - "span_end": 28, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 40, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "cfcfe9a311d3a2dbdaf32ac4ccd73c0eb9a117f830591a1c0867ee97d46204ff", - "symbol_name": "ControlChannel", - "qname": "ControlChannel", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "ControlActionSet\nrole: model\n\nResponsibilities:\n- default model role", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlActionSet", - "span_start": 14, - "span_end": 18, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 40, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "46eb026cb3313415ec47b82dd22f84f4d112c9d987e8b1716dcb0baa1cce8988", - "symbol_name": "ControlActionSet", - "qname": "ControlActionSet", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests service\n- reads and writes state attributes\n- participates in dataflow slices (5)", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlPlaneService", - "span_start": 12, - "span_end": 52, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 68, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "b13471e5916986dccffb53fab613812842965705e6b3a89ae549d30c9e91e9aa", - "symbol_name": "ControlPlaneService", - "qname": "ControlPlaneService", - "role": "pipeline_stage", - "confidence": 0.57, - "dataflow_participation": 5, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_runner.py", - "content": "UvicornThreadRunner\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (24)", - "layer": "C4_SEMANTIC_ROLES", - "title": "UvicornThreadRunner", - "span_start": 10, - "span_end": 61, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 11, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "fd55630045a02100df8877ac27d951ee08617d4598764394d48cb51fe067476a", - "symbol_name": "UvicornThreadRunner", - "qname": "UvicornThreadRunner", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 24, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "3779fdd2878b770e789a35bb2a89c9d79f13b61c26d7db1b3b683f9bb9e1623f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (10)", - "layer": "C4_SEMANTIC_ROLES", - "title": "HttpControlChannel", - "span_start": 12, - "span_end": 57, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 21, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "1c9fbdc24819e5604c26ea55428a74310f03a03e1af197ed84846af61e42fdb0", - "symbol_name": "HttpControlChannel", - "qname": "HttpControlChannel", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 10, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "HttpControlAppFactory\nrole: factory\n\nResponsibilities:\n- name suffix suggests factory", - "layer": "C4_SEMANTIC_ROLES", - "title": "HttpControlAppFactory", - "span_start": 15, - "span_end": 53, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 39, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "9b3502a5fb408b273223db13264349cf500de24915b6c649d9ea8970d0dfd8e0", - "symbol_name": "HttpControlAppFactory", - "qname": "HttpControlAppFactory", - "role": "factory", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/persistence/workflow_persistence.py", - "content": "WorkflowPersistence\nrole: pipeline_stage\n\nResponsibilities:\n- orchestrates role-like calls (2)\n- reads and writes state attributes\n- participates in dataflow slices (16)", - "layer": "C4_SEMANTIC_ROLES", - "title": "WorkflowPersistence", - "span_start": 8, - "span_end": 54, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 15, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "7bd01ee45cf31f2d5c2e3e51656254860ac785d10cef9e0852cd4fba90857bae", - "symbol_name": "WorkflowPersistence", - "qname": "WorkflowPersistence", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 16, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "80e9410ddc639789b4353c2a1a757ba8d0d5b5bb6075b0b263b61551f04ae1f0", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager.add_config_file", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 32, - "span_end": 52, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "a23b8a11ebdb12708b60c96ea12a69f7f042082f1adfddd572444e246d81d167", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "57ffbd4f0d9fdf3507c2b8624312ce211f3d02fdf86a57a8ec90778d8a7b498d", - "dst_ref": "RuntimeManager.add_config_file", - "resolution": "resolved", - "slice_id": "a23b8a11ebdb12708b60c96ea12a69f7f042082f1adfddd572444e246d81d167", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager.add_config_file" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "57ffbd4f0d9fdf3507c2b8624312ce211f3d02fdf86a57a8ec90778d8a7b498d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.services\n -> RuntimeManager.__init__", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 33, - "span_end": 39, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "d43af85989222ee6d788ce418cdcb217c7ff044cfb915e3bdbd184417dc7bd61", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "dst_ref": "RuntimeManager.__init__", - "resolution": "resolved", - "slice_id": "d43af85989222ee6d788ce418cdcb217c7ff044cfb915e3bdbd184417dc7bd61", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.services", - "RuntimeManager.__init__" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.stop", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 25, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d", - "dst_ref": "ControlPlaneService.stop", - "resolution": "resolved", - "slice_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.stop" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._stop_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 51, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a", - "dst_ref": "ControlPlaneService._stop_async", - "resolution": "resolved", - "slice_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._stop_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager.start", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 32, - "span_end": 59, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "98312ace7fc62b1c7194c5aa1732b6ef736eae1668a3a120dd1ecd5ab1d64f7a", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "77a7b260193018845e4e204df094ab89cfd7c82ee4e822b3a83ad4cd945f9cb1", - "dst_ref": "RuntimeManager.start", - "resolution": "resolved", - "slice_id": "98312ace7fc62b1c7194c5aa1732b6ef736eae1668a3a120dd1ecd5ab1d64f7a", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager.start" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "77a7b260193018845e4e204df094ab89cfd7c82ee4e822b3a83ad4cd945f9cb1" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager._register_core_services", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 32, - "span_end": 127, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "3e5811f3b511fa0cabe363f5d01f2ac5fa039bc8b93f7ee108323e1f5f45a293", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "972d6057a6caac9cf31ebc1e29c6f39f71b10d4cc170dec57cf875ba458549c6", - "dst_ref": "RuntimeManager._register_core_services", - "resolution": "resolved", - "slice_id": "3e5811f3b511fa0cabe363f5d01f2ac5fa039bc8b93f7ee108323e1f5f45a293", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager._register_core_services" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "972d6057a6caac9cf31ebc1e29c6f39f71b10d4cc170dec57cf875ba458549c6" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.register_channel", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 17, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957", - "dst_ref": "ControlPlaneService.register_channel", - "resolution": "resolved", - "slice_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.register_channel" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.start", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 20, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154", - "dst_ref": "ControlPlaneService.start", - "resolution": "resolved", - "slice_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.start" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._start_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 47, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517", - "dst_ref": "ControlPlaneService._start_async", - "resolution": "resolved", - "slice_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._start_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.services\n -> RuntimeManager._register_core_services", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 33, - "span_end": 127, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "aac6f9dda73963b977083a892bee39a48eca4fbd7404787e022ecf4ebedec65d", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "972d6057a6caac9cf31ebc1e29c6f39f71b10d4cc170dec57cf875ba458549c6", - "dst_ref": "RuntimeManager._register_core_services", - "resolution": "resolved", - "slice_id": "aac6f9dda73963b977083a892bee39a48eca4fbd7404787e022ecf4ebedec65d", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.services", - "RuntimeManager._register_core_services" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "972d6057a6caac9cf31ebc1e29c6f39f71b10d4cc170dec57cf875ba458549c6" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "class RuntimeManager:\n ACTION_TIMEOUT_SECONDS = 10.0\n ACTION_POLL_INTERVAL_SECONDS = 0.05\n\n def __init__(\n self,\n configuration: ConfigurationManager | None = None,\n services: ServiceContainer | None = None,\n traces: TraceService | None = None,\n health: HealthRegistry | None = None,\n logs: LogManager | None = None,\n workers: WorkerSupervisor | None = None,\n control_plane: ControlPlaneService | None = None,\n ) -> None:\n self.configuration = configuration or ConfigurationManager()\n self.services = services or ServiceContainer()\n self.traces = traces or TraceService()\n self.health = health or HealthRegistry()\n self.logs = logs or LogManager()\n self.workers = workers or WorkerSupervisor()\n self.control_plane = control_plane or ControlPlaneService()\n self.registry = ModuleRegistry(self.services)\n self._started = False\n self._state = LifecycleState.IDLE\n self._core_registered = False\n self._workers_registered = False\n self._register_core_services()\n\n def register_module(self, module: ApplicationModule) -> None:\n self.registry.register_module(module.name)\n module.register(self.registry)\n\n def add_config_file(self, path: str) -> FileConfigProvider:\n provider = FileConfigProvider(path)\n self.configuration.add_provider(provider)\n return provider\n\n def start(self, *, start_control_plane: bool = True) -> None:\n if self._started:\n return\n self._state = LifecycleState.STARTING\n config = self.configuration.load()\n self.logs.apply_config(config)\n self._register_health_contributors()\n self._register_workers()\n self.workers.start()\n if start_control_plane:\n self.control_plane.start(self)\n self._started = True\n self._refresh_state()\n\n def stop(self, timeout: float = 30.0, force: bool = False, stop_control_plane: bool = True) -> None:\n if not self._started:\n return\n self._state = LifecycleState.STOPPING\n self.workers.stop(timeout=timeout, force=force)\n if stop_control_plane:\n self.control_plane.stop()\n self._started = False\n self._state = LifecycleState.STOPPED\n\n def status(self) -> dict[str, object]:\n self._refresh_state()\n return self.control_plane.snapshot(self)\n\n def current_health(self) -> HealthPayload:\n self._refresh_state()\n return self.health.payload(self._state, self.workers.healths())\n\n async def health_status(self) -> HealthPayload:\n return self.current_health()\n\n async def start_runtime(self) -> dict[str, object] | str:\n self._refresh_state()\n if self._started:\n return \"runtime already running\"\n if self._state == LifecycleState.STOPPING:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n\n self.start(start_control_plane=False)\n started = self._wait_for_state({LifecycleState.IDLE, LifecycleState.BUSY}, timeout=self.ACTION_TIMEOUT_SECONDS)\n if started:\n return self._action_detail(\"runtime started\", timed_out=False)\n return self._action_detail(\"runtime start is still in progress\", timed_out=True)\n\n async def stop_runtime(self) -> dict[str, object] | str:\n self._refresh_state()\n if not self._started:\n if self._state == LifecycleState.STOPPING:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n return \"runtime already stopped\"\n\n self._state = LifecycleState.STOPPING\n try:\n self.workers.stop(timeout=self.ACTION_TIMEOUT_SECONDS, force=False)\n except TimeoutError:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n\n self._started = False\n self._state = LifecycleState.STOPPED\n return self._action_detail(\"runtime stopped\", timed_out=False)\n\n async def runtime_status(self) -> str:\n self._refresh_state()\n return self._state.value\n\n def _register_core_services(self) -> None:\n if self._core_registered:\n return\n self.services.register(\"configuration\", self.configuration)\n self.services.register(\"traces\", self.traces)\n self.services.register(\"health\", self.health)\n self.services.register(\"logs\", self.logs)\n self.services.register(\"workers\", self.workers)\n self.services.register(\"control_plane\", self.control_plane)\n self._core_registered = True\n\n def _register_health_contributors(self) -> None:\n for contributor in self.registry.health_contributors:\n self.health.register(contributor)\n\n def _register_workers(self) -> None:\n if self._workers_registered:\n return\n for worker in self.registry.workers:\n self.workers.register(worker)\n self._workers_registered = True\n\n def _refresh_state(self) -> None:\n lifecycle = self.workers.lifecycle_state()\n\n if self._state == LifecycleState.STOPPING:\n if lifecycle == LifecycleState.STOPPED:\n self._started = False\n self._state = LifecycleState.STOPPED\n return\n\n if not self._started:\n if lifecycle == LifecycleState.STOPPED:\n self._state = LifecycleState.STOPPED\n return\n\n self._state = lifecycle\n\n def _wait_for_state(self, target_states: set[LifecycleState], *, timeout: float) -> bool:\n deadline = monotonic() + timeout\n while monotonic() < deadline:\n self._refresh_state()\n if self._state in target_states:\n return True\n sleep(self.ACTION_POLL_INTERVAL_SECONDS)\n self._refresh_state()\n return self._state in target_states\n\n def _action_detail(self, message: str, *, timed_out: bool) -> dict[str, object]:\n self._refresh_state()\n return {\n \"message\": message,\n \"state\": self._state.value,\n \"timed_out\": timed_out,\n \"workers\": self.workers.snapshot(),\n }", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/core/runtime.py:RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.core.runtime", - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "llm_answer": "## Шаги потока выполнения для `RuntimeManager`\n\n1. **Начало**: Точка вызова находится в файле `http_app.py` метода `app.post`, который является точкой входа (`C3_ENTRYPOINTS`).\n \n2. **Первый этап**:\n - Вызывается инициализация объекта класса `RuntimeManager` через конструктор `RuntimeManager.__init__`.\n - Источник: [C2_DEPENDENCY_GRAPH]\n - Конструктор принимает параметры конфигурации, сервисов, трассировки, состояния здоровья, логирования, управления рабочими процессами и контрольной плоскости.\n - Эти параметры могут быть переданы напрямую при вызове конструктора или использованы предустановленные значения по умолчанию.\n\n3. **Второй этап**:\n - Внутри конструктора выполняется инициализация атрибутов экземпляра объекта:\n - self.configuration\n - self.services\n - self.traces\n - self.health\n - self.logs\n - self.workers\n - self.control_plane\n - Остальные свойства также инициализируются с заданными значениями.\n\n4. **Третий этап**:\n - После инициализации атрибутов объект вызывает метод `_register_core_services()`, чтобы зарегистрировать основные сервисы.\n - Это действие подразумевает дальнейшее управление и координацию работы различных компонентов системы.\n\n5. **Завершение**:\n - Поток завершается после завершения регистрации основных сервисов и настройки всех необходимых внутренних атрибутов и связей внутри объекта `RuntimeManager`.\n\n## Недостатки информации\n\nНа данный момент отсутствует явная информация о том, как именно методы `add_config_file`, `register_module` и другие используемые внутри конструктора взаимодействуют друг с другом и внешними системами. Более детальная документация по этим методам помогла бы лучше понять детали их использования и зависимость от внешних факторов.", - "summary": { - "router": { - "intent": "CODE_QA", - "sub_intent": "TRACE_FLOW", - "confidence": null - }, - "retrieval": { - "profile": "code", - "layers_hit": [ - "C0_SOURCE_CHUNKS", - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS", - "C4_SEMANTIC_ROLES" - ], - "evidence_sufficient": true - }, - "llm": { - "answer_status": "answered", - "groundedness": "grounded" - } - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "TRACE_FLOW", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "RuntimeManager" - ], - "keyword_hints": [ - "RuntimeManager" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C0_SOURCE_CHUNKS": "exact_path_fetch", - "C4_SEMANTIC_ROLES": "exact_path_fetch", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C3_ENTRYPOINTS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 8, - "C4_SEMANTIC_ROLES": 8, - "C2_DEPENDENCY_GRAPH": 10, - "C3_ENTRYPOINTS": 10 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C4_SEMANTIC_ROLES": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Покажи поток выполнения RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C4_SEMANTIC_ROLES", - "query": "Покажи поток выполнения RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "Покажи поток выполнения RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 10, - "ranking_profile": "code" - }, - { - "layer": "C3_ENTRYPOINTS", - "query": "Покажи поток выполнения RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 10, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 1, - "candidates_after_filter": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 10, - "candidates_after_filter": 10 - }, - { - "layer": "C3_ENTRYPOINTS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 3, - "candidates_after_filter": 3 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "RuntimeManager", - "alternatives": [ - "RuntimeManager" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C4_SEMANTIC_ROLES", - "status": "hit", - "hit_count": 8, - "fail_reason": null - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 10, - "fail_reason": null - }, - { - "layer": "C3_ENTRYPOINTS", - "status": "hit", - "hit_count": 3, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "router": 0, - "symbol_resolution": 0, - "retrieval_total": 129, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 39, - "C0_SOURCE_CHUNKS": 14, - "C4_SEMANTIC_ROLES": 13, - "C2_DEPENDENCY_GRAPH": 52, - "C3_ENTRYPOINTS": 8 - }, - "merge_rank": 16, - "prompt_build": 0, - "llm_call": 2658 - }, - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 766, - "evidence_rows": 23, - "evidence_chars": 8302 - }, - "evidence_summary": [ - { - "layer": "C1_SYMBOL_CATALOG", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "count": 8, - "unique_paths": 7 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "count": 10, - "unique_paths": 2 - }, - { - "layer": "C3_ENTRYPOINTS", - "count": 3, - "unique_paths": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 1, - "unique_paths": 1 - } - ], - "prompt_template_id": "intent_code_qa_trace_flow_ru_v1", - "system_prompt_version": "v1" - }, - "router": { - "conversation_mode": "START", - "keyword_hints": [ - "RuntimeManager" - ], - "path_scope": [] - }, - "llm": { - "used_evidence_count": 23, - "missing_evidence_reason": null - } - }, - "run_info": { - "case_id": "plba-fullchain-trace-flow-runtime-manager", - "mode": "full_chain", - "run_started_at": "2026-03-12T12:02:52", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - }, - "input_request": { - "text": "Покажи поток выполнения RuntimeManager", - "normalized_query": "Покажи поток выполнения RuntimeManager" - }, - "steps": [ - { - "step": "intent_router", - "input": { - "query": "Покажи поток выполнения RuntimeManager" - }, - "output": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Покажи поток выполнения RuntimeManager" - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "TRACE_FLOW", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "RuntimeManager" - ], - "keyword_hints": [ - "RuntimeManager" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "timings_ms": { - "router": 0 - } - } - }, - { - "step": "retrieval", - "input": { - "query": "Покажи поток выполнения RuntimeManager" - }, - "output": { - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "RuntimeManager", - "alternatives": [ - "RuntimeManager" - ], - "confidence": 0.99 - }, - "rag_count": 23, - "rag_rows": [ - { - "path": "src/app_runtime/core/runtime.py", - "content": "class RuntimeManager\nRuntimeManager", - "layer": "C1_SYMBOL_CATALOG", - "title": "RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "7e4a9381328c5803bbc6179458612fc4e947d928aa7bf8b4b2bebb2c8592f758", - "qname": "RuntimeManager", - "kind": "class", - "signature": "RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.core.runtime", - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests manager\n- orchestrates role-like calls (4)\n- reads and writes state attributes\n- participates in dataflow slices (50)", - "layer": "C4_SEMANTIC_ROLES", - "title": "RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 43, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "7e4a9381328c5803bbc6179458612fc4e947d928aa7bf8b4b2bebb2c8592f758", - "symbol_name": "RuntimeManager", - "qname": "RuntimeManager", - "role": "pipeline_stage", - "confidence": 0.67, - "dataflow_participation": 50, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "ControlChannel\nrole: model\n\nResponsibilities:\n- default model role", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlChannel", - "span_start": 21, - "span_end": 28, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 40, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "cfcfe9a311d3a2dbdaf32ac4ccd73c0eb9a117f830591a1c0867ee97d46204ff", - "symbol_name": "ControlChannel", - "qname": "ControlChannel", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "ControlActionSet\nrole: model\n\nResponsibilities:\n- default model role", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlActionSet", - "span_start": 14, - "span_end": 18, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 40, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "46eb026cb3313415ec47b82dd22f84f4d112c9d987e8b1716dcb0baa1cce8988", - "symbol_name": "ControlActionSet", - "qname": "ControlActionSet", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests service\n- reads and writes state attributes\n- participates in dataflow slices (5)", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlPlaneService", - "span_start": 12, - "span_end": 52, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 68, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "b13471e5916986dccffb53fab613812842965705e6b3a89ae549d30c9e91e9aa", - "symbol_name": "ControlPlaneService", - "qname": "ControlPlaneService", - "role": "pipeline_stage", - "confidence": 0.57, - "dataflow_participation": 5, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_runner.py", - "content": "UvicornThreadRunner\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (24)", - "layer": "C4_SEMANTIC_ROLES", - "title": "UvicornThreadRunner", - "span_start": 10, - "span_end": 61, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 11, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "fd55630045a02100df8877ac27d951ee08617d4598764394d48cb51fe067476a", - "symbol_name": "UvicornThreadRunner", - "qname": "UvicornThreadRunner", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 24, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "3779fdd2878b770e789a35bb2a89c9d79f13b61c26d7db1b3b683f9bb9e1623f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (10)", - "layer": "C4_SEMANTIC_ROLES", - "title": "HttpControlChannel", - "span_start": 12, - "span_end": 57, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 21, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "1c9fbdc24819e5604c26ea55428a74310f03a03e1af197ed84846af61e42fdb0", - "symbol_name": "HttpControlChannel", - "qname": "HttpControlChannel", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 10, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "HttpControlAppFactory\nrole: factory\n\nResponsibilities:\n- name suffix suggests factory", - "layer": "C4_SEMANTIC_ROLES", - "title": "HttpControlAppFactory", - "span_start": 15, - "span_end": 53, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 39, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "9b3502a5fb408b273223db13264349cf500de24915b6c649d9ea8970d0dfd8e0", - "symbol_name": "HttpControlAppFactory", - "qname": "HttpControlAppFactory", - "role": "factory", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/persistence/workflow_persistence.py", - "content": "WorkflowPersistence\nrole: pipeline_stage\n\nResponsibilities:\n- orchestrates role-like calls (2)\n- reads and writes state attributes\n- participates in dataflow slices (16)", - "layer": "C4_SEMANTIC_ROLES", - "title": "WorkflowPersistence", - "span_start": 8, - "span_end": 54, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 15, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "7bd01ee45cf31f2d5c2e3e51656254860ac785d10cef9e0852cd4fba90857bae", - "symbol_name": "WorkflowPersistence", - "qname": "WorkflowPersistence", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 16, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "80e9410ddc639789b4353c2a1a757ba8d0d5b5bb6075b0b263b61551f04ae1f0", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager.add_config_file", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 32, - "span_end": 52, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "a23b8a11ebdb12708b60c96ea12a69f7f042082f1adfddd572444e246d81d167", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "57ffbd4f0d9fdf3507c2b8624312ce211f3d02fdf86a57a8ec90778d8a7b498d", - "dst_ref": "RuntimeManager.add_config_file", - "resolution": "resolved", - "slice_id": "a23b8a11ebdb12708b60c96ea12a69f7f042082f1adfddd572444e246d81d167", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager.add_config_file" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "57ffbd4f0d9fdf3507c2b8624312ce211f3d02fdf86a57a8ec90778d8a7b498d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.services\n -> RuntimeManager.__init__", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 33, - "span_end": 39, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "d43af85989222ee6d788ce418cdcb217c7ff044cfb915e3bdbd184417dc7bd61", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "dst_ref": "RuntimeManager.__init__", - "resolution": "resolved", - "slice_id": "d43af85989222ee6d788ce418cdcb217c7ff044cfb915e3bdbd184417dc7bd61", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.services", - "RuntimeManager.__init__" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.stop", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 25, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d", - "dst_ref": "ControlPlaneService.stop", - "resolution": "resolved", - "slice_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.stop" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._stop_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 51, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a", - "dst_ref": "ControlPlaneService._stop_async", - "resolution": "resolved", - "slice_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._stop_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager.start", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 32, - "span_end": 59, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "98312ace7fc62b1c7194c5aa1732b6ef736eae1668a3a120dd1ecd5ab1d64f7a", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "77a7b260193018845e4e204df094ab89cfd7c82ee4e822b3a83ad4cd945f9cb1", - "dst_ref": "RuntimeManager.start", - "resolution": "resolved", - "slice_id": "98312ace7fc62b1c7194c5aa1732b6ef736eae1668a3a120dd1ecd5ab1d64f7a", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager.start" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "77a7b260193018845e4e204df094ab89cfd7c82ee4e822b3a83ad4cd945f9cb1" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager._register_core_services", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 32, - "span_end": 127, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "3e5811f3b511fa0cabe363f5d01f2ac5fa039bc8b93f7ee108323e1f5f45a293", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "972d6057a6caac9cf31ebc1e29c6f39f71b10d4cc170dec57cf875ba458549c6", - "dst_ref": "RuntimeManager._register_core_services", - "resolution": "resolved", - "slice_id": "3e5811f3b511fa0cabe363f5d01f2ac5fa039bc8b93f7ee108323e1f5f45a293", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager._register_core_services" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "972d6057a6caac9cf31ebc1e29c6f39f71b10d4cc170dec57cf875ba458549c6" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.register_channel", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 17, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957", - "dst_ref": "ControlPlaneService.register_channel", - "resolution": "resolved", - "slice_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.register_channel" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.start", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 20, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154", - "dst_ref": "ControlPlaneService.start", - "resolution": "resolved", - "slice_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.start" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._start_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 47, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517", - "dst_ref": "ControlPlaneService._start_async", - "resolution": "resolved", - "slice_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._start_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.services\n -> RuntimeManager._register_core_services", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 33, - "span_end": 127, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "aac6f9dda73963b977083a892bee39a48eca4fbd7404787e022ecf4ebedec65d", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "972d6057a6caac9cf31ebc1e29c6f39f71b10d4cc170dec57cf875ba458549c6", - "dst_ref": "RuntimeManager._register_core_services", - "resolution": "resolved", - "slice_id": "aac6f9dda73963b977083a892bee39a48eca4fbd7404787e022ecf4ebedec65d", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.services", - "RuntimeManager._register_core_services" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "972d6057a6caac9cf31ebc1e29c6f39f71b10d4cc170dec57cf875ba458549c6" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "class RuntimeManager:\n ACTION_TIMEOUT_SECONDS = 10.0\n ACTION_POLL_INTERVAL_SECONDS = 0.05\n\n def __init__(\n self,\n configuration: ConfigurationManager | None = None,\n services: ServiceContainer | None = None,\n traces: TraceService | None = None,\n health: HealthRegistry | None = None,\n logs: LogManager | None = None,\n workers: WorkerSupervisor | None = None,\n control_plane: ControlPlaneService | None = None,\n ) -> None:\n self.configuration = configuration or ConfigurationManager()\n self.services = services or ServiceContainer()\n self.traces = traces or TraceService()\n self.health = health or HealthRegistry()\n self.logs = logs or LogManager()\n self.workers = workers or WorkerSupervisor()\n self.control_plane = control_plane or ControlPlaneService()\n self.registry = ModuleRegistry(self.services)\n self._started = False\n self._state = LifecycleState.IDLE\n self._core_registered = False\n self._workers_registered = False\n self._register_core_services()\n\n def register_module(self, module: ApplicationModule) -> None:\n self.registry.register_module(module.name)\n module.register(self.registry)\n\n def add_config_file(self, path: str) -> FileConfigProvider:\n provider = FileConfigProvider(path)\n self.configuration.add_provider(provider)\n return provider\n\n def start(self, *, start_control_plane: bool = True) -> None:\n if self._started:\n return\n self._state = LifecycleState.STARTING\n config = self.configuration.load()\n self.logs.apply_config(config)\n self._register_health_contributors()\n self._register_workers()\n self.workers.start()\n if start_control_plane:\n self.control_plane.start(self)\n self._started = True\n self._refresh_state()\n\n def stop(self, timeout: float = 30.0, force: bool = False, stop_control_plane: bool = True) -> None:\n if not self._started:\n return\n self._state = LifecycleState.STOPPING\n self.workers.stop(timeout=timeout, force=force)\n if stop_control_plane:\n self.control_plane.stop()\n self._started = False\n self._state = LifecycleState.STOPPED\n\n def status(self) -> dict[str, object]:\n self._refresh_state()\n return self.control_plane.snapshot(self)\n\n def current_health(self) -> HealthPayload:\n self._refresh_state()\n return self.health.payload(self._state, self.workers.healths())\n\n async def health_status(self) -> HealthPayload:\n return self.current_health()\n\n async def start_runtime(self) -> dict[str, object] | str:\n self._refresh_state()\n if self._started:\n return \"runtime already running\"\n if self._state == LifecycleState.STOPPING:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n\n self.start(start_control_plane=False)\n started = self._wait_for_state({LifecycleState.IDLE, LifecycleState.BUSY}, timeout=self.ACTION_TIMEOUT_SECONDS)\n if started:\n return self._action_detail(\"runtime started\", timed_out=False)\n return self._action_detail(\"runtime start is still in progress\", timed_out=True)\n\n async def stop_runtime(self) -> dict[str, object] | str:\n self._refresh_state()\n if not self._started:\n if self._state == LifecycleState.STOPPING:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n return \"runtime already stopped\"\n\n self._state = LifecycleState.STOPPING\n try:\n self.workers.stop(timeout=self.ACTION_TIMEOUT_SECONDS, force=False)\n except TimeoutError:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n\n self._started = False\n self._state = LifecycleState.STOPPED\n return self._action_detail(\"runtime stopped\", timed_out=False)\n\n async def runtime_status(self) -> str:\n self._refresh_state()\n return self._state.value\n\n def _register_core_services(self) -> None:\n if self._core_registered:\n return\n self.services.register(\"configuration\", self.configuration)\n self.services.register(\"traces\", self.traces)\n self.services.register(\"health\", self.health)\n self.services.register(\"logs\", self.logs)\n self.services.register(\"workers\", self.workers)\n self.services.register(\"control_plane\", self.control_plane)\n self._core_registered = True\n\n def _register_health_contributors(self) -> None:\n for contributor in self.registry.health_contributors:\n self.health.register(contributor)\n\n def _register_workers(self) -> None:\n if self._workers_registered:\n return\n for worker in self.registry.workers:\n self.workers.register(worker)\n self._workers_registered = True\n\n def _refresh_state(self) -> None:\n lifecycle = self.workers.lifecycle_state()\n\n if self._state == LifecycleState.STOPPING:\n if lifecycle == LifecycleState.STOPPED:\n self._started = False\n self._state = LifecycleState.STOPPED\n return\n\n if not self._started:\n if lifecycle == LifecycleState.STOPPED:\n self._state = LifecycleState.STOPPED\n return\n\n self._state = lifecycle\n\n def _wait_for_state(self, target_states: set[LifecycleState], *, timeout: float) -> bool:\n deadline = monotonic() + timeout\n while monotonic() < deadline:\n self._refresh_state()\n if self._state in target_states:\n return True\n sleep(self.ACTION_POLL_INTERVAL_SECONDS)\n self._refresh_state()\n return self._state in target_states\n\n def _action_detail(self, message: str, *, timed_out: bool) -> dict[str, object]:\n self._refresh_state()\n return {\n \"message\": message,\n \"state\": self._state.value,\n \"timed_out\": timed_out,\n \"workers\": self.workers.snapshot(),\n }", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/core/runtime.py:RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.core.runtime", - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ] - }, - "diagnostics": { - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C0_SOURCE_CHUNKS": "exact_path_fetch", - "C4_SEMANTIC_ROLES": "exact_path_fetch", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C3_ENTRYPOINTS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 8, - "C4_SEMANTIC_ROLES": 8, - "C2_DEPENDENCY_GRAPH": 10, - "C3_ENTRYPOINTS": 10 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C4_SEMANTIC_ROLES": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Покажи поток выполнения RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C4_SEMANTIC_ROLES", - "query": "Покажи поток выполнения RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "Покажи поток выполнения RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 10, - "ranking_profile": "code" - }, - { - "layer": "C3_ENTRYPOINTS", - "query": "Покажи поток выполнения RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 10, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 1, - "candidates_after_filter": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 10, - "candidates_after_filter": 10 - }, - { - "layer": "C3_ENTRYPOINTS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 3, - "candidates_after_filter": 3 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "RuntimeManager", - "alternatives": [ - "RuntimeManager" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C4_SEMANTIC_ROLES", - "status": "hit", - "hit_count": 8, - "fail_reason": null - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 10, - "fail_reason": null - }, - { - "layer": "C3_ENTRYPOINTS", - "status": "hit", - "hit_count": 3, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "symbol_resolution": 0, - "retrieval_total": 129, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 39, - "C0_SOURCE_CHUNKS": 14, - "C4_SEMANTIC_ROLES": 13, - "C2_DEPENDENCY_GRAPH": 52, - "C3_ENTRYPOINTS": 8 - }, - "merge_rank": 16 - } - } - }, - { - "step": "llm_answer", - "input": { - "query": "Покажи поток выполнения RuntimeManager", - "rag_count": 23 - }, - "output": { - "llm_answer": "## Шаги потока выполнения для `RuntimeManager`\n\n1. **Начало**: Точка вызова находится в файле `http_app.py` метода `app.post`, который является точкой входа (`C3_ENTRYPOINTS`).\n \n2. **Первый этап**:\n - Вызывается инициализация объекта класса `RuntimeManager` через конструктор `RuntimeManager.__init__`.\n - Источник: [C2_DEPENDENCY_GRAPH]\n - Конструктор принимает параметры конфигурации, сервисов, трассировки, состояния здоровья, логирования, управления рабочими процессами и контрольной плоскости.\n - Эти параметры могут быть переданы напрямую при вызове конструктора или использованы предустановленные значения по умолчанию.\n\n3. **Второй этап**:\n - Внутри конструктора выполняется инициализация атрибутов экземпляра объекта:\n - self.configuration\n - self.services\n - self.traces\n - self.health\n - self.logs\n - self.workers\n - self.control_plane\n - Остальные свойства также инициализируются с заданными значениями.\n\n4. **Третий этап**:\n - После инициализации атрибутов объект вызывает метод `_register_core_services()`, чтобы зарегистрировать основные сервисы.\n - Это действие подразумевает дальнейшее управление и координацию работы различных компонентов системы.\n\n5. **Завершение**:\n - Поток завершается после завершения регистрации основных сервисов и настройки всех необходимых внутренних атрибутов и связей внутри объекта `RuntimeManager`.\n\n## Недостатки информации\n\nНа данный момент отсутствует явная информация о том, как именно методы `add_config_file`, `register_module` и другие используемые внутри конструктора взаимодействуют друг с другом и внешними системами. Более детальная документация по этим методам помогла бы лучше понять детали их использования и зависимость от внешних факторов." - }, - "diagnostics": { - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 766, - "evidence_rows": 23, - "evidence_chars": 8302 - }, - "evidence_summary": [ - { - "layer": "C1_SYMBOL_CATALOG", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "count": 8, - "unique_paths": 7 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "count": 10, - "unique_paths": 2 - }, - { - "layer": "C3_ENTRYPOINTS", - "count": 3, - "unique_paths": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 1, - "unique_paths": 1 - } - ], - "prompt_template_id": "intent_code_qa_trace_flow_ru_v1", - "system_prompt_version": "v1" - }, - "timings_ms": { - "prompt_build": 0, - "llm_call": 2658 - } - } - } - ] - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents/20260312_120252/full_chain_plba_code_subintents_plba-fullchain-trace-flow-runtime-manager.md b/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents/20260312_120252/full_chain_plba_code_subintents_plba-fullchain-trace-flow-runtime-manager.md deleted file mode 100644 index 2e1509b..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents/20260312_120252/full_chain_plba_code_subintents_plba-fullchain-trace-flow-runtime-manager.md +++ /dev/null @@ -1,34 +0,0 @@ -# plba-fullchain-trace-flow-runtime-manager - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_subintents.yaml -- runner: runtime -- mode: full_chain -- passed: True - -## Query -Покажи поток выполнения RuntimeManager - -## Actual -{ - "intent": "CODE_QA", - "sub_intent": "TRACE_FLOW", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 23, - "llm_answer": "## Шаги потока выполнения для `RuntimeManager`\n\n1. **Начало**: Точка вызова находится в файле `http_app.py` метода `app.post`, который является точкой входа (`C3_ENTRYPOINTS`).\n \n2. **Первый этап**:\n - Вызывается инициализация объекта класса `RuntimeManager` через конструктор `RuntimeManager.__init__`.\n - Источник: [C2_DEPENDENCY_GRAPH]\n - Конструктор принимает параметры конфигурации, сервисов, трассировки, состояния здоровья, логирования, управления рабочими процессами и контрольной плоскости.\n - Эти параметры могут быть переданы напрямую при вызове конструктора или использованы предустановленные значения по умолчанию.\n\n3. **Второй этап**:\n - Внутри конструктора выполняется инициализация атрибутов экземпляра объекта:\n - self.configuration\n - self.services\n - self.traces\n - self.health\n - self.logs\n - self.workers\n - self.control_plane\n - Остальные свойства также инициализируются с заданными значениями.\n\n4. **Третий этап**:\n - После инициализации атрибутов объект вызывает метод `_register_core_services()`, чтобы зарегистрировать основные сервисы.\n - Это действие подразумевает дальнейшее управление и координацию работы различных компонентов системы.\n\n5. **Завершение**:\n - Поток завершается после завершения регистрации основных сервисов и настройки всех необходимых внутренних атрибутов и связей внутри объекта `RuntimeManager`.\n\n## Недостатки информации\n\nНа данный момент отсутствует явная информация о том, как именно методы `add_config_file`, `register_module` и другие используемые внутри конструктора взаимодействуют друг с другом и внешними системами. Более детальная документация по этим методам помогла бы лучше понять детали их использования и зависимость от внешних факторов.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "RuntimeManager" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] -} - -## Mismatches -- none \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents/20260312_120252/summary.md b/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents/20260312_120252/summary.md deleted file mode 100644 index 95a72ac..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents/20260312_120252/summary.md +++ /dev/null @@ -1,40 +0,0 @@ -# pipeline_setup_v2 summary - -Passed: 7/7 - - -| File | Case | Query | Expected sub-intent | Intent | Actual sub-intent | RAG layers | Pass | -| ------------------------------------ | -------------------------------------------- | -------------------------------------------------------------------------------- | ------------------- | ------- | ----------------- | ------------------------------------------------------------------------------------------------------ | ---- | -| full_chain_plba_code_subintents.yaml | plba-fullchain-open-file-runtime | Открой файл src/app_runtime/core/runtime.py | OPEN_FILE | CODE_QA | OPEN_FILE | C0_SOURCE_CHUNKS:1 | ✓ | -| full_chain_plba_code_subintents.yaml | plba-fullchain-explain-runtime-manager | Объясни как работает класс RuntimeManager | EXPLAIN | CODE_QA | EXPLAIN | C0_SOURCE_CHUNKS:1, C1_SYMBOL_CATALOG:1, C2_DEPENDENCY_GRAPH:6, C3_ENTRYPOINTS:3, C4_SEMANTIC_ROLES:1 | ✓ | -| full_chain_plba_code_subintents.yaml | plba-fullchain-find-tests-runtime-manager | Где тесты для RuntimeManager? | FIND_TESTS | CODE_QA | FIND_TESTS | C0_SOURCE_CHUNKS:10, C2_DEPENDENCY_GRAPH:6 | ✓ | -| full_chain_plba_code_subintents.yaml | plba-fullchain-find-entrypoints | Найди точки входа в коде | FIND_ENTRYPOINTS | CODE_QA | FIND_ENTRYPOINTS | C0_SOURCE_CHUNKS:6, C3_ENTRYPOINTS:3 | ✓ | -| full_chain_plba_code_subintents.yaml | plba-fullchain-trace-flow-runtime-manager | Покажи поток выполнения RuntimeManager | TRACE_FLOW | CODE_QA | TRACE_FLOW | C0_SOURCE_CHUNKS:1, C1_SYMBOL_CATALOG:1, C2_DEPENDENCY_GRAPH:10, C3_ENTRYPOINTS:3, C4_SEMANTIC_ROLES:8 | ✓ | -| full_chain_plba_code_subintents.yaml | plba-fullchain-architecture-control-plane | Какие компоненты участвуют в RuntimeManager? | ARCHITECTURE | CODE_QA | ARCHITECTURE | C0_SOURCE_CHUNKS:1, C1_SYMBOL_CATALOG:1, C2_DEPENDENCY_GRAPH:8, C3_ENTRYPOINTS:3, C4_SEMANTIC_ROLES:12 | ✓ | -| full_chain_plba_code_subintents.yaml | plba-fullchain-explain-local-runtime-manager | Почему в файле src/app_runtime/core/runtime.py класс RuntimeManager устроен так? | EXPLAIN_LOCAL | CODE_QA | EXPLAIN_LOCAL | C0_SOURCE_CHUNKS:1, C1_SYMBOL_CATALOG:1, C2_DEPENDENCY_GRAPH:4 | ✓ | - - -## LLM Answers - -- **plba-fullchain-open-file-runtime** -Query: Открой файл src/app_runtime/core/runtime.py - > Файл `src/app_runtime/core/runtime.py` содержит определение класса `RuntimeManager`, управляющего выполнением приложения в runtime режиме. ## Важные сущности и их значение: - **ConfigurationManager**: управляет конфигурацией приложения. - **ServiceContainer**: контейнер сервисов, используемых приложением. - **TraceService**: сервис отслеживания трассировок выполнения программы. - **HealthRegistry**: регистрирует состояние здоровья компонентов системы. - **LogManager**: менеджер логирования событий. - **WorkerSupervisor**: супервизор рабочих процессов. - **ControlPlaneService**: компонент управления системой. - **ModuleRegistry**: реестр модулей, зарегистрированных в системе. - **LifecycleState**: состояния жизненного цикла менеджера (например, IDLE). Этот класс отвечает за инициализацию и управление основными компонентами приложения во время его исполнения. Важно отм… -- **plba-fullchain-explain-runtime-manager** -Query: Объясни как работает класс RuntimeManager - > ## Назначение Класс `RuntimeManager` играет роль менеджера выполнения приложения, координирующего различные компоненты и сервисы, необходимые для управления жизненным циклом runtime-среды. Он отвечает за регистрацию сервисов, управление их состоянием и координацию действий по выполнению бизнес-процессов. ## Ключевые зависимости Ключевыми зависимостями класса являются следующие сущности и библиотеки: - **ConfigurationManager** (`configuration`) — управляет конфигурацией runtime-среды. - **ServiceContainer** (`services`) — контейнер сервисов, предоставляющий доступ к различным сервисам runtime. - **TraceService** (`traces`) — сервис отслеживания событий и трассировки выполнения задач. - **HealthRegistry** (`health`) — служба мониторинга состояния и здоровья runtime-среды. - **LogManager** (`logs`) — менеджер логирования событий и сообщений от runtime-среды. - **WorkerS… -- **plba-fullchain-find-tests-runtime-manager** -Query: Где тесты для RuntimeManager? - > Прямые тесты для `RuntimeManager` найдены в следующих местах: 1. **tests/test_runtime.py:** - `test_runtime_graceful_stop_waits_until_worker_finishes`: Проверяет корректность остановки `RuntimeManager`, ожидание завершения работником (worker). - `test_runtime_runs_worker_routine_and_exposes_status`: Тестирует запуск рутины работника (`worker routine`) и отображение статуса работы через интерфейс состояния (`status interface`). Эти тесты непосредственно взаимодействуют с реализацией класса `RuntimeManager`. **Описание проверок:** - `test_runtime_graceful_stop_waits_until_worker_finishes` — проверка правильной логики поведения при остановке менеджера и завершении работником своих задач. - `test_runtime_runs_worker_routine_and_exposes_status` — тестирование процесса выполнения рабочего задания и доступности его результатов через статусное API. **Оценка покрытия:** Оба т… -- **plba-fullchain-find-entrypoints** -Query: Найди точки входа в коде - > ## Финальный ответ: На основании предоставленного контекста и слоев анализа RAG, удалось выявить следующие **точки входа** и их возможные роли: ### 1. `src/app_runtime/control/http_app.py` - **app.post**: - Роль: Обработчик HTTP POST-запросов FastAPI. Вероятно, используется для приема данных от клиента и инициирования последующих шагов обработки (например, вызова функций, выполняющих бизнес-логику). - **app.get**: - Роль: Обработчик HTTP GET-запросов FastAPI. Аналогично предыдущему пункту, вероятно обрабатывает запросы на получение информации. ### Наиболее вероятные точки входа: Эти две точки (`app.post` и `app.get`) выглядят наиболее вероятными местами начальной обработки запросов в системе, поскольку они явно указаны в слое `C3_ENTRYPOINTS`. --- Обратите внимание, что слой `C0_SOURCE_CHUNKS` содержит классы и функции без явных упоминаний точек входа, поэтому требуе… -- **plba-fullchain-trace-flow-runtime-manager** -Query: Покажи поток выполнения RuntimeManager - > ## Шаги потока выполнения для `RuntimeManager` 1. **Начало**: Точка вызова находится в файле `http_app.py` метода `app.post`, который является точкой входа (`C3_ENTRYPOINTS`). 2. **Первый этап**: - Вызывается инициализация объекта класса `RuntimeManager` через конструктор `RuntimeManager.__init_`_. - Источник: [C2_DEPENDENCY_GRAPH] - Конструктор принимает параметры конфигурации, сервисов, трассировки, состояния здоровья, логирования, управления рабочими процессами и контрольной плоскости. - Эти параметры могут быть переданы напрямую при вызове конструктора или использованы предустановленные значения по умолчанию. 3. **Второй этап**: - Внутри конструктора выполняется инициализация атрибутов экземпляра объекта: - self.configuration - self.services - self.traces - self.health - self.logs - self.workers - self.control_plane - Остальные свойства также инициализируются с з… -- **plba-fullchain-architecture-control-plane** -Query: Какие компоненты участвуют в RuntimeManager? - > ## Архитектурное объяснение подсистемы RuntimeManager ### Основные компоненты и их роли 1. **RuntimeManager** - Роль: Pipeline stage (этап конвейера). - Описание: Менеджер, отвечающий за оркестровку и координацию ролей-подсистем, участвующих в выполнении бизнес-требований. Читает и записывает состояние атрибутов системы, участвует в потоках данных. 2. **ControlActionSet** - Роль: Модель поведения системы. - Описание: Базовый класс для определения действий управления системой, реализует модель по умолчанию. ### Связи и границы ответственности - **RuntimeManager** взаимодействует с **ControlActionSet**, инициируя выполнение заданных моделей поведения через зависимости и вызовы методов модели. - Контейнер Dependency Injection (DI) обеспечивает внедрение зависимостей объектов из внешних систем или сервисов. - Потоки данных разделены на участки (slices), что позволяет раз… -- **plba-fullchain-explain-local-runtime-manager** -Query: Почему в файле src/app_runtime/core/runtime.py класс RuntimeManager устроен так? - > Класс `RuntimeManager` в файле `src/app_runtime/core/runtime.py` играет роль центрального координатора для инициализации и управления ресурсами приложения во время его выполнения. ### Что делает класс: - При создании экземпляра класса (через метод `__init_`_) происходит начальная настройка всех необходимых сервисов и компонентов через передачу параметров конфигурации (`configuration`), контейнер сервисов (`services`), сервис трассировки (`traces`), реестр здоровья (`health`), менеджер логирования (`logs`), супервизор рабочих процессов (`workers`) и служба контроля плоскости (`control_plane`). - В методе `__init__` все переданные параметры либо используются напрямую, либо заменяются дефолтными значениями при их отсутствии. Это позволяет гибко настраивать работу приложения даже без полного набора аргументов. - Важным аспектом является регистрация модулей (`self.registr… - diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents/20260312_120855.zip b/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents/20260312_120855.zip deleted file mode 100644 index 56af352..0000000 Binary files a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents/20260312_120855.zip and /dev/null differ diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents/20260312_120855/full_chain_plba_code_subintents_plba-fullchain-architecture-control-plane.json b/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents/20260312_120855/full_chain_plba_code_subintents_plba-fullchain-architecture-control-plane.json deleted file mode 100644 index 2fb2725..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents/20260312_120855/full_chain_plba_code_subintents_plba-fullchain-architecture-control-plane.json +++ /dev/null @@ -1,3036 +0,0 @@ -{ - "case_id": "plba-fullchain-architecture-control-plane", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_subintents.yaml", - "runner": "runtime", - "mode": "full_chain", - "actual": { - "intent": "CODE_QA", - "sub_intent": "ARCHITECTURE", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 25, - "llm_answer": "## Архитектурное объяснение подсистемы RuntimeManager\n\n### Основные компоненты и их роли\n\n1. **RuntimeManager**\n - Роль: Pipeline stage (этап конвейера)\n - Описание: Менеджер, координирующий роль-подобные вызовы, чтение и запись состояния атрибутов, участие в данных срезах потока выполнения.\n \n2. **ControlActionSet**\n - Роль: Модель\n - Описание: Представляет собой модель поведения системы управления действиями.\n\n### Связи и границы ответственности\n\n1. **Связь с HTTP приложением (app.post)**\n - Контроллер HTTP приложения инициирует выполнение контроллеров управления через метод `app.post`.\n\n2. **Связь с ControlPlaneService**\n - Инициализация сервиса (`ControlPlaneService.__init__`) запускает каналы передачи данных и асинхронную обработку (`_start_async`).\n\n3. **Связь с RuntimeManager**\n - Инициализация менеджера (`RuntimeManager.__init__`) устанавливает конфигурацию и запускает основной цикл работы (`start`).\n\n### Ключевые выводы по архитектуре\n\n1. **Централизованное управление**: RuntimeManager выступает координатором всего жизненного цикла обработки запросов, обеспечивая согласованность действий различных компонентов.\n2. **Модульность и независимость ролей**: Компоненты выполняют специализированные функции, что повышает гибкость и расширяемость архитектуры.\n3. **Асинхронная обработка**: Использование асинхронных механизмов позволяет эффективно обрабатывать данные и запросы в реальном времени.\n4. **HTTP-интерфейс**: Интеграция с FastAPI обеспечивает удобный доступ к системе через стандартные REST API интерфейсы.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "RuntimeManager" - ], - "layers": [ - "C4_SEMANTIC_ROLES", - "C3_ENTRYPOINTS", - "C2_DEPENDENCY_GRAPH", - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS" - ] - }, - "passed": true, - "mismatches": [], - "details": { - "case_id": "plba-fullchain-architecture-control-plane", - "text": "Какие компоненты участвуют в RuntimeManager?", - "mode": "full_chain", - "run_started_at": "2026-03-12T12:08:55", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Какие компоненты участвуют в RuntimeManager?", - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "RuntimeManager", - "alternatives": [ - "RuntimeManager" - ], - "confidence": 0.99 - }, - "rag_count": 25, - "rag_rows": [ - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests manager\n- orchestrates role-like calls (4)\n- reads and writes state attributes\n- participates in dataflow slices (50)", - "layer": "C4_SEMANTIC_ROLES", - "title": "RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 43, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "7e4a9381328c5803bbc6179458612fc4e947d928aa7bf8b4b2bebb2c8592f758", - "symbol_name": "RuntimeManager", - "qname": "RuntimeManager", - "role": "pipeline_stage", - "confidence": 0.67, - "dataflow_participation": 50, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "ControlActionSet\nrole: model\n\nResponsibilities:\n- default model role", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlActionSet", - "span_start": 14, - "span_end": 18, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 40, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "46eb026cb3313415ec47b82dd22f84f4d112c9d987e8b1716dcb0baa1cce8988", - "symbol_name": "ControlActionSet", - "qname": "ControlActionSet", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "ControlChannel\nrole: model\n\nResponsibilities:\n- default model role", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlChannel", - "span_start": 21, - "span_end": 28, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 40, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "cfcfe9a311d3a2dbdaf32ac4ccd73c0eb9a117f830591a1c0867ee97d46204ff", - "symbol_name": "ControlChannel", - "qname": "ControlChannel", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests service\n- reads and writes state attributes\n- participates in dataflow slices (5)", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlPlaneService", - "span_start": 12, - "span_end": 52, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 68, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "b13471e5916986dccffb53fab613812842965705e6b3a89ae549d30c9e91e9aa", - "symbol_name": "ControlPlaneService", - "qname": "ControlPlaneService", - "role": "pipeline_stage", - "confidence": 0.57, - "dataflow_participation": 5, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_runner.py", - "content": "UvicornThreadRunner\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (24)", - "layer": "C4_SEMANTIC_ROLES", - "title": "UvicornThreadRunner", - "span_start": 10, - "span_end": 61, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 11, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "fd55630045a02100df8877ac27d951ee08617d4598764394d48cb51fe067476a", - "symbol_name": "UvicornThreadRunner", - "qname": "UvicornThreadRunner", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 24, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "3779fdd2878b770e789a35bb2a89c9d79f13b61c26d7db1b3b683f9bb9e1623f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (10)", - "layer": "C4_SEMANTIC_ROLES", - "title": "HttpControlChannel", - "span_start": 12, - "span_end": 57, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 21, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "1c9fbdc24819e5604c26ea55428a74310f03a03e1af197ed84846af61e42fdb0", - "symbol_name": "HttpControlChannel", - "qname": "HttpControlChannel", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 10, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "HttpControlAppFactory\nrole: factory\n\nResponsibilities:\n- name suffix suggests factory", - "layer": "C4_SEMANTIC_ROLES", - "title": "HttpControlAppFactory", - "span_start": 15, - "span_end": 53, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 39, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "9b3502a5fb408b273223db13264349cf500de24915b6c649d9ea8970d0dfd8e0", - "symbol_name": "HttpControlAppFactory", - "qname": "HttpControlAppFactory", - "role": "factory", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/persistence/workflow_persistence.py", - "content": "WorkflowPersistence\nrole: pipeline_stage\n\nResponsibilities:\n- orchestrates role-like calls (2)\n- reads and writes state attributes\n- participates in dataflow slices (16)", - "layer": "C4_SEMANTIC_ROLES", - "title": "WorkflowPersistence", - "span_start": 8, - "span_end": 54, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 15, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "7bd01ee45cf31f2d5c2e3e51656254860ac785d10cef9e0852cd4fba90857bae", - "symbol_name": "WorkflowPersistence", - "qname": "WorkflowPersistence", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 16, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "80e9410ddc639789b4353c2a1a757ba8d0d5b5bb6075b0b263b61551f04ae1f0", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/queue/in_memory.py", - "content": "InMemoryTaskQueue\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (9)", - "layer": "C4_SEMANTIC_ROLES", - "title": "InMemoryTaskQueue", - "span_start": 9, - "span_end": 38, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 22, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "2da04cb94544a3bcbf0943a95ad4bdd8710bcafaa32a02fd0e4de2178dcf3533", - "symbol_name": "InMemoryTaskQueue", - "qname": "InMemoryTaskQueue", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 9, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "58f0cc001ccda0eee4c6bc32ed83bd05eafd6b6644f1e8b4aa9eed3103db73dc", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/config/file_loader.py", - "content": "ConfigFileLoader\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (8)", - "layer": "C4_SEMANTIC_ROLES", - "title": "ConfigFileLoader", - "span_start": 11, - "span_end": 48, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 23, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "a8474eca8b6e9dc86ae67ed68b16fa5fb639ef08739c053e7b7195489765667f", - "symbol_name": "ConfigFileLoader", - "qname": "ConfigFileLoader", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 8, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "1f19ffebde5e38e4be5a5d5a678059a0f36dedb8fb8b3e00ab395c67106a87ea", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/store.py", - "content": "TraceContextStore\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (6)", - "layer": "C4_SEMANTIC_ROLES", - "title": "TraceContextStore", - "span_start": 15, - "span_end": 52, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 25, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "b2dad4fbe16ffb11b58deba311c7739955c39d59f291b22181f33e9c8cce4059", - "symbol_name": "TraceContextStore", - "qname": "TraceContextStore", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 6, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "d369554f08fc92039c6edd5a2a1e73b23901533e8974459170bbd9347d263dc5", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workers/supervisor.py", - "content": "WorkerSupervisor\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (6)", - "layer": "C4_SEMANTIC_ROLES", - "title": "WorkerSupervisor", - "span_start": 10, - "span_end": 59, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 25, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "c17b44e8d9e97d490989b21fa67d7c346cdda8a0472e4c41fb243c8846faa124", - "symbol_name": "WorkerSupervisor", - "qname": "WorkerSupervisor", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 6, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "77609d9d5927171cce7fc3a54897c183fd63068710c6362029b700937aae5eee", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._start_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 47, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517", - "dst_ref": "ControlPlaneService._start_async", - "resolution": "resolved", - "slice_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._start_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager.start", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 32, - "span_end": 59, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "98312ace7fc62b1c7194c5aa1732b6ef736eae1668a3a120dd1ecd5ab1d64f7a", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "77a7b260193018845e4e204df094ab89cfd7c82ee4e822b3a83ad4cd945f9cb1", - "dst_ref": "RuntimeManager.start", - "resolution": "resolved", - "slice_id": "98312ace7fc62b1c7194c5aa1732b6ef736eae1668a3a120dd1ecd5ab1d64f7a", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager.start" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "77a7b260193018845e4e204df094ab89cfd7c82ee4e822b3a83ad4cd945f9cb1" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.start", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 20, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154", - "dst_ref": "ControlPlaneService.start", - "resolution": "resolved", - "slice_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.start" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.stop", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 25, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d", - "dst_ref": "ControlPlaneService.stop", - "resolution": "resolved", - "slice_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.stop" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._stop_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 51, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a", - "dst_ref": "ControlPlaneService._stop_async", - "resolution": "resolved", - "slice_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._stop_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager.add_config_file", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 32, - "span_end": 52, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "a23b8a11ebdb12708b60c96ea12a69f7f042082f1adfddd572444e246d81d167", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "57ffbd4f0d9fdf3507c2b8624312ce211f3d02fdf86a57a8ec90778d8a7b498d", - "dst_ref": "RuntimeManager.add_config_file", - "resolution": "resolved", - "slice_id": "a23b8a11ebdb12708b60c96ea12a69f7f042082f1adfddd572444e246d81d167", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager.add_config_file" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "57ffbd4f0d9fdf3507c2b8624312ce211f3d02fdf86a57a8ec90778d8a7b498d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.register_channel", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 17, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957", - "dst_ref": "ControlPlaneService.register_channel", - "resolution": "resolved", - "slice_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.register_channel" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager._register_core_services", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 32, - "span_end": 127, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "3e5811f3b511fa0cabe363f5d01f2ac5fa039bc8b93f7ee108323e1f5f45a293", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "972d6057a6caac9cf31ebc1e29c6f39f71b10d4cc170dec57cf875ba458549c6", - "dst_ref": "RuntimeManager._register_core_services", - "resolution": "resolved", - "slice_id": "3e5811f3b511fa0cabe363f5d01f2ac5fa039bc8b93f7ee108323e1f5f45a293", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager._register_core_services" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "972d6057a6caac9cf31ebc1e29c6f39f71b10d4cc170dec57cf875ba458549c6" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "class RuntimeManager\nRuntimeManager", - "layer": "C1_SYMBOL_CATALOG", - "title": "RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "7e4a9381328c5803bbc6179458612fc4e947d928aa7bf8b4b2bebb2c8592f758", - "qname": "RuntimeManager", - "kind": "class", - "signature": "RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.core.runtime", - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "class RuntimeManager:\n ACTION_TIMEOUT_SECONDS = 10.0\n ACTION_POLL_INTERVAL_SECONDS = 0.05\n\n def __init__(\n self,\n configuration: ConfigurationManager | None = None,\n services: ServiceContainer | None = None,\n traces: TraceService | None = None,\n health: HealthRegistry | None = None,\n logs: LogManager | None = None,\n workers: WorkerSupervisor | None = None,\n control_plane: ControlPlaneService | None = None,\n ) -> None:\n self.configuration = configuration or ConfigurationManager()\n self.services = services or ServiceContainer()\n self.traces = traces or TraceService()\n self.health = health or HealthRegistry()\n self.logs = logs or LogManager()\n self.workers = workers or WorkerSupervisor()\n self.control_plane = control_plane or ControlPlaneService()\n self.registry = ModuleRegistry(self.services)\n self._started = False\n self._state = LifecycleState.IDLE\n self._core_registered = False\n self._workers_registered = False\n self._register_core_services()\n\n def register_module(self, module: ApplicationModule) -> None:\n self.registry.register_module(module.name)\n module.register(self.registry)\n\n def add_config_file(self, path: str) -> FileConfigProvider:\n provider = FileConfigProvider(path)\n self.configuration.add_provider(provider)\n return provider\n\n def start(self, *, start_control_plane: bool = True) -> None:\n if self._started:\n return\n self._state = LifecycleState.STARTING\n config = self.configuration.load()\n self.logs.apply_config(config)\n self._register_health_contributors()\n self._register_workers()\n self.workers.start()\n if start_control_plane:\n self.control_plane.start(self)\n self._started = True\n self._refresh_state()\n\n def stop(self, timeout: float = 30.0, force: bool = False, stop_control_plane: bool = True) -> None:\n if not self._started:\n return\n self._state = LifecycleState.STOPPING\n self.workers.stop(timeout=timeout, force=force)\n if stop_control_plane:\n self.control_plane.stop()\n self._started = False\n self._state = LifecycleState.STOPPED\n\n def status(self) -> dict[str, object]:\n self._refresh_state()\n return self.control_plane.snapshot(self)\n\n def current_health(self) -> HealthPayload:\n self._refresh_state()\n return self.health.payload(self._state, self.workers.healths())\n\n async def health_status(self) -> HealthPayload:\n return self.current_health()\n\n async def start_runtime(self) -> dict[str, object] | str:\n self._refresh_state()\n if self._started:\n return \"runtime already running\"\n if self._state == LifecycleState.STOPPING:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n\n self.start(start_control_plane=False)\n started = self._wait_for_state({LifecycleState.IDLE, LifecycleState.BUSY}, timeout=self.ACTION_TIMEOUT_SECONDS)\n if started:\n return self._action_detail(\"runtime started\", timed_out=False)\n return self._action_detail(\"runtime start is still in progress\", timed_out=True)\n\n async def stop_runtime(self) -> dict[str, object] | str:\n self._refresh_state()\n if not self._started:\n if self._state == LifecycleState.STOPPING:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n return \"runtime already stopped\"\n\n self._state = LifecycleState.STOPPING\n try:\n self.workers.stop(timeout=self.ACTION_TIMEOUT_SECONDS, force=False)\n except TimeoutError:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n\n self._started = False\n self._state = LifecycleState.STOPPED\n return self._action_detail(\"runtime stopped\", timed_out=False)\n\n async def runtime_status(self) -> str:\n self._refresh_state()\n return self._state.value\n\n def _register_core_services(self) -> None:\n if self._core_registered:\n return\n self.services.register(\"configuration\", self.configuration)\n self.services.register(\"traces\", self.traces)\n self.services.register(\"health\", self.health)\n self.services.register(\"logs\", self.logs)\n self.services.register(\"workers\", self.workers)\n self.services.register(\"control_plane\", self.control_plane)\n self._core_registered = True\n\n def _register_health_contributors(self) -> None:\n for contributor in self.registry.health_contributors:\n self.health.register(contributor)\n\n def _register_workers(self) -> None:\n if self._workers_registered:\n return\n for worker in self.registry.workers:\n self.workers.register(worker)\n self._workers_registered = True\n\n def _refresh_state(self) -> None:\n lifecycle = self.workers.lifecycle_state()\n\n if self._state == LifecycleState.STOPPING:\n if lifecycle == LifecycleState.STOPPED:\n self._started = False\n self._state = LifecycleState.STOPPED\n return\n\n if not self._started:\n if lifecycle == LifecycleState.STOPPED:\n self._state = LifecycleState.STOPPED\n return\n\n self._state = lifecycle\n\n def _wait_for_state(self, target_states: set[LifecycleState], *, timeout: float) -> bool:\n deadline = monotonic() + timeout\n while monotonic() < deadline:\n self._refresh_state()\n if self._state in target_states:\n return True\n sleep(self.ACTION_POLL_INTERVAL_SECONDS)\n self._refresh_state()\n return self._state in target_states\n\n def _action_detail(self, message: str, *, timed_out: bool) -> dict[str, object]:\n self._refresh_state()\n return {\n \"message\": message,\n \"state\": self._state.value,\n \"timed_out\": timed_out,\n \"workers\": self.workers.snapshot(),\n }", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/core/runtime.py:RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.core.runtime", - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "llm_answer": "## Архитектурное объяснение подсистемы RuntimeManager\n\n### Основные компоненты и их роли\n\n1. **RuntimeManager**\n - Роль: Pipeline stage (этап конвейера)\n - Описание: Менеджер, координирующий роль-подобные вызовы, чтение и запись состояния атрибутов, участие в данных срезах потока выполнения.\n \n2. **ControlActionSet**\n - Роль: Модель\n - Описание: Представляет собой модель поведения системы управления действиями.\n\n### Связи и границы ответственности\n\n1. **Связь с HTTP приложением (app.post)**\n - Контроллер HTTP приложения инициирует выполнение контроллеров управления через метод `app.post`.\n\n2. **Связь с ControlPlaneService**\n - Инициализация сервиса (`ControlPlaneService.__init__`) запускает каналы передачи данных и асинхронную обработку (`_start_async`).\n\n3. **Связь с RuntimeManager**\n - Инициализация менеджера (`RuntimeManager.__init__`) устанавливает конфигурацию и запускает основной цикл работы (`start`).\n\n### Ключевые выводы по архитектуре\n\n1. **Централизованное управление**: RuntimeManager выступает координатором всего жизненного цикла обработки запросов, обеспечивая согласованность действий различных компонентов.\n2. **Модульность и независимость ролей**: Компоненты выполняют специализированные функции, что повышает гибкость и расширяемость архитектуры.\n3. **Асинхронная обработка**: Использование асинхронных механизмов позволяет эффективно обрабатывать данные и запросы в реальном времени.\n4. **HTTP-интерфейс**: Интеграция с FastAPI обеспечивает удобный доступ к системе через стандартные REST API интерфейсы.", - "summary": { - "router": { - "intent": "CODE_QA", - "sub_intent": "ARCHITECTURE", - "confidence": null - }, - "retrieval": { - "profile": "code", - "layers_hit": [ - "C0_SOURCE_CHUNKS", - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS", - "C4_SEMANTIC_ROLES" - ], - "evidence_sufficient": true - }, - "llm": { - "answer_status": "answered", - "groundedness": "grounded" - } - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "ARCHITECTURE", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C4_SEMANTIC_ROLES", - "C3_ENTRYPOINTS", - "C2_DEPENDENCY_GRAPH", - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "RuntimeManager" - ], - "keyword_hints": [ - "RuntimeManager" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "execution": { - "executed_layers": [ - "C4_SEMANTIC_ROLES", - "C3_ENTRYPOINTS", - "C2_DEPENDENCY_GRAPH", - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS" - ], - "retrieval_mode_by_layer": { - "C4_SEMANTIC_ROLES": "exact_path_fetch", - "C3_ENTRYPOINTS": "exact_path_fetch", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C1_SYMBOL_CATALOG": "symbol_search", - "C0_SOURCE_CHUNKS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C4_SEMANTIC_ROLES": 12, - "C3_ENTRYPOINTS": 8, - "C2_DEPENDENCY_GRAPH": 8, - "C1_SYMBOL_CATALOG": 6, - "C0_SOURCE_CHUNKS": 4 - }, - "filters_by_layer": { - "C4_SEMANTIC_ROLES": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C1_SYMBOL_CATALOG": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C4_SEMANTIC_ROLES", - "query": "Какие компоненты участвуют в RuntimeManager?", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 12, - "ranking_profile": "code" - }, - { - "layer": "C3_ENTRYPOINTS", - "query": "Какие компоненты участвуют в RuntimeManager?", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "Какие компоненты участвуют в RuntimeManager?", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C1_SYMBOL_CATALOG", - "query": "RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Какие компоненты участвуют в RuntimeManager?", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 4, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C4_SEMANTIC_ROLES", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 12, - "candidates_after_filter": 12 - }, - { - "layer": "C3_ENTRYPOINTS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 3, - "candidates_after_filter": 3 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 1, - "candidates_after_filter": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 4, - "candidates_after_filter": 4 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "RuntimeManager", - "alternatives": [ - "RuntimeManager" - ] - }, - "layers": [ - { - "layer": "C4_SEMANTIC_ROLES", - "status": "hit", - "hit_count": 12, - "fail_reason": null - }, - { - "layer": "C3_ENTRYPOINTS", - "status": "hit", - "hit_count": 3, - "fail_reason": null - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 8, - "fail_reason": null - }, - { - "layer": "C1_SYMBOL_CATALOG", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 1, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "router": 1, - "symbol_resolution": 0, - "retrieval_total": 222, - "retrieval_by_layer": { - "C4_SEMANTIC_ROLES": 54, - "C3_ENTRYPOINTS": 23, - "C2_DEPENDENCY_GRAPH": 92, - "C1_SYMBOL_CATALOG": 30, - "C0_SOURCE_CHUNKS": 21 - }, - "merge_rank": 29, - "prompt_build": 0, - "llm_call": 2494 - }, - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 480, - "evidence_rows": 25, - "evidence_chars": 8651 - }, - "evidence_summary": [ - { - "layer": "C4_SEMANTIC_ROLES", - "count": 12, - "unique_paths": 11 - }, - { - "layer": "C3_ENTRYPOINTS", - "count": 3, - "unique_paths": 1 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "count": 8, - "unique_paths": 2 - }, - { - "layer": "C1_SYMBOL_CATALOG", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 1, - "unique_paths": 1 - } - ], - "prompt_template_id": "intent_code_qa_architecture_ru_v1", - "system_prompt_version": "v1" - }, - "router": { - "conversation_mode": "START", - "keyword_hints": [ - "RuntimeManager" - ], - "path_scope": [] - }, - "llm": { - "used_evidence_count": 25, - "missing_evidence_reason": null - } - }, - "run_info": { - "case_id": "plba-fullchain-architecture-control-plane", - "mode": "full_chain", - "run_started_at": "2026-03-12T12:08:55", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - }, - "input_request": { - "text": "Какие компоненты участвуют в RuntimeManager?", - "normalized_query": "Какие компоненты участвуют в RuntimeManager?" - }, - "steps": [ - { - "step": "intent_router", - "input": { - "query": "Какие компоненты участвуют в RuntimeManager?" - }, - "output": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Какие компоненты участвуют в RuntimeManager?" - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "ARCHITECTURE", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C4_SEMANTIC_ROLES", - "C3_ENTRYPOINTS", - "C2_DEPENDENCY_GRAPH", - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "RuntimeManager" - ], - "keyword_hints": [ - "RuntimeManager" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "timings_ms": { - "router": 1 - } - } - }, - { - "step": "retrieval", - "input": { - "query": "Какие компоненты участвуют в RuntimeManager?" - }, - "output": { - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "RuntimeManager", - "alternatives": [ - "RuntimeManager" - ], - "confidence": 0.99 - }, - "rag_count": 25, - "rag_rows": [ - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests manager\n- orchestrates role-like calls (4)\n- reads and writes state attributes\n- participates in dataflow slices (50)", - "layer": "C4_SEMANTIC_ROLES", - "title": "RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 43, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "7e4a9381328c5803bbc6179458612fc4e947d928aa7bf8b4b2bebb2c8592f758", - "symbol_name": "RuntimeManager", - "qname": "RuntimeManager", - "role": "pipeline_stage", - "confidence": 0.67, - "dataflow_participation": 50, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "ControlActionSet\nrole: model\n\nResponsibilities:\n- default model role", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlActionSet", - "span_start": 14, - "span_end": 18, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 40, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "46eb026cb3313415ec47b82dd22f84f4d112c9d987e8b1716dcb0baa1cce8988", - "symbol_name": "ControlActionSet", - "qname": "ControlActionSet", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "ControlChannel\nrole: model\n\nResponsibilities:\n- default model role", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlChannel", - "span_start": 21, - "span_end": 28, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 40, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "cfcfe9a311d3a2dbdaf32ac4ccd73c0eb9a117f830591a1c0867ee97d46204ff", - "symbol_name": "ControlChannel", - "qname": "ControlChannel", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests service\n- reads and writes state attributes\n- participates in dataflow slices (5)", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlPlaneService", - "span_start": 12, - "span_end": 52, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 68, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "b13471e5916986dccffb53fab613812842965705e6b3a89ae549d30c9e91e9aa", - "symbol_name": "ControlPlaneService", - "qname": "ControlPlaneService", - "role": "pipeline_stage", - "confidence": 0.57, - "dataflow_participation": 5, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_runner.py", - "content": "UvicornThreadRunner\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (24)", - "layer": "C4_SEMANTIC_ROLES", - "title": "UvicornThreadRunner", - "span_start": 10, - "span_end": 61, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 11, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "fd55630045a02100df8877ac27d951ee08617d4598764394d48cb51fe067476a", - "symbol_name": "UvicornThreadRunner", - "qname": "UvicornThreadRunner", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 24, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "3779fdd2878b770e789a35bb2a89c9d79f13b61c26d7db1b3b683f9bb9e1623f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (10)", - "layer": "C4_SEMANTIC_ROLES", - "title": "HttpControlChannel", - "span_start": 12, - "span_end": 57, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 21, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "1c9fbdc24819e5604c26ea55428a74310f03a03e1af197ed84846af61e42fdb0", - "symbol_name": "HttpControlChannel", - "qname": "HttpControlChannel", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 10, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "HttpControlAppFactory\nrole: factory\n\nResponsibilities:\n- name suffix suggests factory", - "layer": "C4_SEMANTIC_ROLES", - "title": "HttpControlAppFactory", - "span_start": 15, - "span_end": 53, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 39, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "9b3502a5fb408b273223db13264349cf500de24915b6c649d9ea8970d0dfd8e0", - "symbol_name": "HttpControlAppFactory", - "qname": "HttpControlAppFactory", - "role": "factory", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/persistence/workflow_persistence.py", - "content": "WorkflowPersistence\nrole: pipeline_stage\n\nResponsibilities:\n- orchestrates role-like calls (2)\n- reads and writes state attributes\n- participates in dataflow slices (16)", - "layer": "C4_SEMANTIC_ROLES", - "title": "WorkflowPersistence", - "span_start": 8, - "span_end": 54, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 15, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "7bd01ee45cf31f2d5c2e3e51656254860ac785d10cef9e0852cd4fba90857bae", - "symbol_name": "WorkflowPersistence", - "qname": "WorkflowPersistence", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 16, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "80e9410ddc639789b4353c2a1a757ba8d0d5b5bb6075b0b263b61551f04ae1f0", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/queue/in_memory.py", - "content": "InMemoryTaskQueue\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (9)", - "layer": "C4_SEMANTIC_ROLES", - "title": "InMemoryTaskQueue", - "span_start": 9, - "span_end": 38, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 22, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "2da04cb94544a3bcbf0943a95ad4bdd8710bcafaa32a02fd0e4de2178dcf3533", - "symbol_name": "InMemoryTaskQueue", - "qname": "InMemoryTaskQueue", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 9, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "58f0cc001ccda0eee4c6bc32ed83bd05eafd6b6644f1e8b4aa9eed3103db73dc", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/config/file_loader.py", - "content": "ConfigFileLoader\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (8)", - "layer": "C4_SEMANTIC_ROLES", - "title": "ConfigFileLoader", - "span_start": 11, - "span_end": 48, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 23, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "a8474eca8b6e9dc86ae67ed68b16fa5fb639ef08739c053e7b7195489765667f", - "symbol_name": "ConfigFileLoader", - "qname": "ConfigFileLoader", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 8, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "1f19ffebde5e38e4be5a5d5a678059a0f36dedb8fb8b3e00ab395c67106a87ea", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/store.py", - "content": "TraceContextStore\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (6)", - "layer": "C4_SEMANTIC_ROLES", - "title": "TraceContextStore", - "span_start": 15, - "span_end": 52, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 25, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "b2dad4fbe16ffb11b58deba311c7739955c39d59f291b22181f33e9c8cce4059", - "symbol_name": "TraceContextStore", - "qname": "TraceContextStore", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 6, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "d369554f08fc92039c6edd5a2a1e73b23901533e8974459170bbd9347d263dc5", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workers/supervisor.py", - "content": "WorkerSupervisor\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (6)", - "layer": "C4_SEMANTIC_ROLES", - "title": "WorkerSupervisor", - "span_start": 10, - "span_end": 59, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 25, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "c17b44e8d9e97d490989b21fa67d7c346cdda8a0472e4c41fb243c8846faa124", - "symbol_name": "WorkerSupervisor", - "qname": "WorkerSupervisor", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 6, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "77609d9d5927171cce7fc3a54897c183fd63068710c6362029b700937aae5eee", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._start_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 47, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517", - "dst_ref": "ControlPlaneService._start_async", - "resolution": "resolved", - "slice_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._start_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager.start", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 32, - "span_end": 59, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "98312ace7fc62b1c7194c5aa1732b6ef736eae1668a3a120dd1ecd5ab1d64f7a", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "77a7b260193018845e4e204df094ab89cfd7c82ee4e822b3a83ad4cd945f9cb1", - "dst_ref": "RuntimeManager.start", - "resolution": "resolved", - "slice_id": "98312ace7fc62b1c7194c5aa1732b6ef736eae1668a3a120dd1ecd5ab1d64f7a", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager.start" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "77a7b260193018845e4e204df094ab89cfd7c82ee4e822b3a83ad4cd945f9cb1" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.start", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 20, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154", - "dst_ref": "ControlPlaneService.start", - "resolution": "resolved", - "slice_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.start" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.stop", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 25, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d", - "dst_ref": "ControlPlaneService.stop", - "resolution": "resolved", - "slice_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.stop" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._stop_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 51, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a", - "dst_ref": "ControlPlaneService._stop_async", - "resolution": "resolved", - "slice_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._stop_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager.add_config_file", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 32, - "span_end": 52, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "a23b8a11ebdb12708b60c96ea12a69f7f042082f1adfddd572444e246d81d167", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "57ffbd4f0d9fdf3507c2b8624312ce211f3d02fdf86a57a8ec90778d8a7b498d", - "dst_ref": "RuntimeManager.add_config_file", - "resolution": "resolved", - "slice_id": "a23b8a11ebdb12708b60c96ea12a69f7f042082f1adfddd572444e246d81d167", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager.add_config_file" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "57ffbd4f0d9fdf3507c2b8624312ce211f3d02fdf86a57a8ec90778d8a7b498d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.register_channel", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 17, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957", - "dst_ref": "ControlPlaneService.register_channel", - "resolution": "resolved", - "slice_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.register_channel" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager._register_core_services", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 32, - "span_end": 127, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "3e5811f3b511fa0cabe363f5d01f2ac5fa039bc8b93f7ee108323e1f5f45a293", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "972d6057a6caac9cf31ebc1e29c6f39f71b10d4cc170dec57cf875ba458549c6", - "dst_ref": "RuntimeManager._register_core_services", - "resolution": "resolved", - "slice_id": "3e5811f3b511fa0cabe363f5d01f2ac5fa039bc8b93f7ee108323e1f5f45a293", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager._register_core_services" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "972d6057a6caac9cf31ebc1e29c6f39f71b10d4cc170dec57cf875ba458549c6" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "class RuntimeManager\nRuntimeManager", - "layer": "C1_SYMBOL_CATALOG", - "title": "RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "7e4a9381328c5803bbc6179458612fc4e947d928aa7bf8b4b2bebb2c8592f758", - "qname": "RuntimeManager", - "kind": "class", - "signature": "RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.core.runtime", - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "class RuntimeManager:\n ACTION_TIMEOUT_SECONDS = 10.0\n ACTION_POLL_INTERVAL_SECONDS = 0.05\n\n def __init__(\n self,\n configuration: ConfigurationManager | None = None,\n services: ServiceContainer | None = None,\n traces: TraceService | None = None,\n health: HealthRegistry | None = None,\n logs: LogManager | None = None,\n workers: WorkerSupervisor | None = None,\n control_plane: ControlPlaneService | None = None,\n ) -> None:\n self.configuration = configuration or ConfigurationManager()\n self.services = services or ServiceContainer()\n self.traces = traces or TraceService()\n self.health = health or HealthRegistry()\n self.logs = logs or LogManager()\n self.workers = workers or WorkerSupervisor()\n self.control_plane = control_plane or ControlPlaneService()\n self.registry = ModuleRegistry(self.services)\n self._started = False\n self._state = LifecycleState.IDLE\n self._core_registered = False\n self._workers_registered = False\n self._register_core_services()\n\n def register_module(self, module: ApplicationModule) -> None:\n self.registry.register_module(module.name)\n module.register(self.registry)\n\n def add_config_file(self, path: str) -> FileConfigProvider:\n provider = FileConfigProvider(path)\n self.configuration.add_provider(provider)\n return provider\n\n def start(self, *, start_control_plane: bool = True) -> None:\n if self._started:\n return\n self._state = LifecycleState.STARTING\n config = self.configuration.load()\n self.logs.apply_config(config)\n self._register_health_contributors()\n self._register_workers()\n self.workers.start()\n if start_control_plane:\n self.control_plane.start(self)\n self._started = True\n self._refresh_state()\n\n def stop(self, timeout: float = 30.0, force: bool = False, stop_control_plane: bool = True) -> None:\n if not self._started:\n return\n self._state = LifecycleState.STOPPING\n self.workers.stop(timeout=timeout, force=force)\n if stop_control_plane:\n self.control_plane.stop()\n self._started = False\n self._state = LifecycleState.STOPPED\n\n def status(self) -> dict[str, object]:\n self._refresh_state()\n return self.control_plane.snapshot(self)\n\n def current_health(self) -> HealthPayload:\n self._refresh_state()\n return self.health.payload(self._state, self.workers.healths())\n\n async def health_status(self) -> HealthPayload:\n return self.current_health()\n\n async def start_runtime(self) -> dict[str, object] | str:\n self._refresh_state()\n if self._started:\n return \"runtime already running\"\n if self._state == LifecycleState.STOPPING:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n\n self.start(start_control_plane=False)\n started = self._wait_for_state({LifecycleState.IDLE, LifecycleState.BUSY}, timeout=self.ACTION_TIMEOUT_SECONDS)\n if started:\n return self._action_detail(\"runtime started\", timed_out=False)\n return self._action_detail(\"runtime start is still in progress\", timed_out=True)\n\n async def stop_runtime(self) -> dict[str, object] | str:\n self._refresh_state()\n if not self._started:\n if self._state == LifecycleState.STOPPING:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n return \"runtime already stopped\"\n\n self._state = LifecycleState.STOPPING\n try:\n self.workers.stop(timeout=self.ACTION_TIMEOUT_SECONDS, force=False)\n except TimeoutError:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n\n self._started = False\n self._state = LifecycleState.STOPPED\n return self._action_detail(\"runtime stopped\", timed_out=False)\n\n async def runtime_status(self) -> str:\n self._refresh_state()\n return self._state.value\n\n def _register_core_services(self) -> None:\n if self._core_registered:\n return\n self.services.register(\"configuration\", self.configuration)\n self.services.register(\"traces\", self.traces)\n self.services.register(\"health\", self.health)\n self.services.register(\"logs\", self.logs)\n self.services.register(\"workers\", self.workers)\n self.services.register(\"control_plane\", self.control_plane)\n self._core_registered = True\n\n def _register_health_contributors(self) -> None:\n for contributor in self.registry.health_contributors:\n self.health.register(contributor)\n\n def _register_workers(self) -> None:\n if self._workers_registered:\n return\n for worker in self.registry.workers:\n self.workers.register(worker)\n self._workers_registered = True\n\n def _refresh_state(self) -> None:\n lifecycle = self.workers.lifecycle_state()\n\n if self._state == LifecycleState.STOPPING:\n if lifecycle == LifecycleState.STOPPED:\n self._started = False\n self._state = LifecycleState.STOPPED\n return\n\n if not self._started:\n if lifecycle == LifecycleState.STOPPED:\n self._state = LifecycleState.STOPPED\n return\n\n self._state = lifecycle\n\n def _wait_for_state(self, target_states: set[LifecycleState], *, timeout: float) -> bool:\n deadline = monotonic() + timeout\n while monotonic() < deadline:\n self._refresh_state()\n if self._state in target_states:\n return True\n sleep(self.ACTION_POLL_INTERVAL_SECONDS)\n self._refresh_state()\n return self._state in target_states\n\n def _action_detail(self, message: str, *, timed_out: bool) -> dict[str, object]:\n self._refresh_state()\n return {\n \"message\": message,\n \"state\": self._state.value,\n \"timed_out\": timed_out,\n \"workers\": self.workers.snapshot(),\n }", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/core/runtime.py:RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.core.runtime", - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ] - }, - "diagnostics": { - "execution": { - "executed_layers": [ - "C4_SEMANTIC_ROLES", - "C3_ENTRYPOINTS", - "C2_DEPENDENCY_GRAPH", - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS" - ], - "retrieval_mode_by_layer": { - "C4_SEMANTIC_ROLES": "exact_path_fetch", - "C3_ENTRYPOINTS": "exact_path_fetch", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C1_SYMBOL_CATALOG": "symbol_search", - "C0_SOURCE_CHUNKS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C4_SEMANTIC_ROLES": 12, - "C3_ENTRYPOINTS": 8, - "C2_DEPENDENCY_GRAPH": 8, - "C1_SYMBOL_CATALOG": 6, - "C0_SOURCE_CHUNKS": 4 - }, - "filters_by_layer": { - "C4_SEMANTIC_ROLES": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C1_SYMBOL_CATALOG": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C4_SEMANTIC_ROLES", - "query": "Какие компоненты участвуют в RuntimeManager?", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 12, - "ranking_profile": "code" - }, - { - "layer": "C3_ENTRYPOINTS", - "query": "Какие компоненты участвуют в RuntimeManager?", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "Какие компоненты участвуют в RuntimeManager?", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C1_SYMBOL_CATALOG", - "query": "RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Какие компоненты участвуют в RuntimeManager?", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 4, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C4_SEMANTIC_ROLES", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 12, - "candidates_after_filter": 12 - }, - { - "layer": "C3_ENTRYPOINTS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 3, - "candidates_after_filter": 3 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 1, - "candidates_after_filter": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 4, - "candidates_after_filter": 4 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "RuntimeManager", - "alternatives": [ - "RuntimeManager" - ] - }, - "layers": [ - { - "layer": "C4_SEMANTIC_ROLES", - "status": "hit", - "hit_count": 12, - "fail_reason": null - }, - { - "layer": "C3_ENTRYPOINTS", - "status": "hit", - "hit_count": 3, - "fail_reason": null - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 8, - "fail_reason": null - }, - { - "layer": "C1_SYMBOL_CATALOG", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 1, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "symbol_resolution": 0, - "retrieval_total": 222, - "retrieval_by_layer": { - "C4_SEMANTIC_ROLES": 54, - "C3_ENTRYPOINTS": 23, - "C2_DEPENDENCY_GRAPH": 92, - "C1_SYMBOL_CATALOG": 30, - "C0_SOURCE_CHUNKS": 21 - }, - "merge_rank": 29 - } - } - }, - { - "step": "llm_answer", - "input": { - "query": "Какие компоненты участвуют в RuntimeManager?", - "rag_count": 25 - }, - "output": { - "llm_answer": "## Архитектурное объяснение подсистемы RuntimeManager\n\n### Основные компоненты и их роли\n\n1. **RuntimeManager**\n - Роль: Pipeline stage (этап конвейера)\n - Описание: Менеджер, координирующий роль-подобные вызовы, чтение и запись состояния атрибутов, участие в данных срезах потока выполнения.\n \n2. **ControlActionSet**\n - Роль: Модель\n - Описание: Представляет собой модель поведения системы управления действиями.\n\n### Связи и границы ответственности\n\n1. **Связь с HTTP приложением (app.post)**\n - Контроллер HTTP приложения инициирует выполнение контроллеров управления через метод `app.post`.\n\n2. **Связь с ControlPlaneService**\n - Инициализация сервиса (`ControlPlaneService.__init__`) запускает каналы передачи данных и асинхронную обработку (`_start_async`).\n\n3. **Связь с RuntimeManager**\n - Инициализация менеджера (`RuntimeManager.__init__`) устанавливает конфигурацию и запускает основной цикл работы (`start`).\n\n### Ключевые выводы по архитектуре\n\n1. **Централизованное управление**: RuntimeManager выступает координатором всего жизненного цикла обработки запросов, обеспечивая согласованность действий различных компонентов.\n2. **Модульность и независимость ролей**: Компоненты выполняют специализированные функции, что повышает гибкость и расширяемость архитектуры.\n3. **Асинхронная обработка**: Использование асинхронных механизмов позволяет эффективно обрабатывать данные и запросы в реальном времени.\n4. **HTTP-интерфейс**: Интеграция с FastAPI обеспечивает удобный доступ к системе через стандартные REST API интерфейсы." - }, - "diagnostics": { - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 480, - "evidence_rows": 25, - "evidence_chars": 8651 - }, - "evidence_summary": [ - { - "layer": "C4_SEMANTIC_ROLES", - "count": 12, - "unique_paths": 11 - }, - { - "layer": "C3_ENTRYPOINTS", - "count": 3, - "unique_paths": 1 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "count": 8, - "unique_paths": 2 - }, - { - "layer": "C1_SYMBOL_CATALOG", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 1, - "unique_paths": 1 - } - ], - "prompt_template_id": "intent_code_qa_architecture_ru_v1", - "system_prompt_version": "v1" - }, - "timings_ms": { - "prompt_build": 0, - "llm_call": 2494 - } - } - } - ] - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents/20260312_120855/full_chain_plba_code_subintents_plba-fullchain-architecture-control-plane.md b/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents/20260312_120855/full_chain_plba_code_subintents_plba-fullchain-architecture-control-plane.md deleted file mode 100644 index 8818aa9..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents/20260312_120855/full_chain_plba_code_subintents_plba-fullchain-architecture-control-plane.md +++ /dev/null @@ -1,34 +0,0 @@ -# plba-fullchain-architecture-control-plane - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_subintents.yaml -- runner: runtime -- mode: full_chain -- passed: True - -## Query -Какие компоненты участвуют в RuntimeManager? - -## Actual -{ - "intent": "CODE_QA", - "sub_intent": "ARCHITECTURE", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 25, - "llm_answer": "## Архитектурное объяснение подсистемы RuntimeManager\n\n### Основные компоненты и их роли\n\n1. **RuntimeManager**\n - Роль: Pipeline stage (этап конвейера)\n - Описание: Менеджер, координирующий роль-подобные вызовы, чтение и запись состояния атрибутов, участие в данных срезах потока выполнения.\n \n2. **ControlActionSet**\n - Роль: Модель\n - Описание: Представляет собой модель поведения системы управления действиями.\n\n### Связи и границы ответственности\n\n1. **Связь с HTTP приложением (app.post)**\n - Контроллер HTTP приложения инициирует выполнение контроллеров управления через метод `app.post`.\n\n2. **Связь с ControlPlaneService**\n - Инициализация сервиса (`ControlPlaneService.__init__`) запускает каналы передачи данных и асинхронную обработку (`_start_async`).\n\n3. **Связь с RuntimeManager**\n - Инициализация менеджера (`RuntimeManager.__init__`) устанавливает конфигурацию и запускает основной цикл работы (`start`).\n\n### Ключевые выводы по архитектуре\n\n1. **Централизованное управление**: RuntimeManager выступает координатором всего жизненного цикла обработки запросов, обеспечивая согласованность действий различных компонентов.\n2. **Модульность и независимость ролей**: Компоненты выполняют специализированные функции, что повышает гибкость и расширяемость архитектуры.\n3. **Асинхронная обработка**: Использование асинхронных механизмов позволяет эффективно обрабатывать данные и запросы в реальном времени.\n4. **HTTP-интерфейс**: Интеграция с FastAPI обеспечивает удобный доступ к системе через стандартные REST API интерфейсы.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "RuntimeManager" - ], - "layers": [ - "C4_SEMANTIC_ROLES", - "C3_ENTRYPOINTS", - "C2_DEPENDENCY_GRAPH", - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS" - ] -} - -## Mismatches -- none \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents/20260312_120855/full_chain_plba_code_subintents_plba-fullchain-explain-local-runtime-manager.json b/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents/20260312_120855/full_chain_plba_code_subintents_plba-fullchain-explain-local-runtime-manager.json deleted file mode 100644 index eb5dd4a..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents/20260312_120855/full_chain_plba_code_subintents_plba-fullchain-explain-local-runtime-manager.json +++ /dev/null @@ -1,1333 +0,0 @@ -{ - "case_id": "plba-fullchain-explain-local-runtime-manager", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_subintents.yaml", - "runner": "runtime", - "mode": "full_chain", - "actual": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN_LOCAL", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 6, - "llm_answer": "Класс `RuntimeManager` в файле `src/app_runtime/core/runtime.py` предназначен для управления жизненным циклом приложения и координации различных компонентов системы.\n\n### Что делает класс `RuntimeManager`?\nЭтот класс инициализирует и запускает основные компоненты приложения, такие как конфигурация (`configuration`), сервисы (`services`), мониторинг состояния (`health`), логирование (`logs`), управление рабочими процессами (`workers`) и контрольную плоскость (`control_plane`).\n\n### Входные параметры конструктора класса:\n- `configuration`: Менеджер конфигурации (по умолчанию используется экземпляр `ConfigurationManager()`).\n- `services`: Контейнер сервисов (по умолчанию – `ServiceContainer()`).\n- `traces`: Сервис трассировки (по умолчанию – `TraceService()`).\n- `health`: Реестр здоровья (по умолчанию – `HealthRegistry()`).\n- `logs`: Менеджер логирования (по умолчанию – `LogManager()`).\n- `workers`: Надзор за рабочими процессами (по умолчанию – `WorkerSupervisor()`).\n- `control_plane`: Контрольная плоскость сервиса (по умолчанию – `ControlPlaneService()`)\n\n### Как связаны входы и выходы:\nКонструктор класса инициализирует указанные объекты и сохраняет их в соответствующих свойствах экземпляра. Он также вызывает внутренние методы регистрации, например `_register_core_services`, которые обеспечивают корректное подключение основных модулей к системе.\n\n### Связь с ближайшим контекстом:\nМетод `__init__` является точкой входа при создании нового объекта `RuntimeManager`. Далее управление передается методам, таким как `_register_core_services`, которые ответственны за начальную настройку системы перед её запуском.\n\nТаким образом, основная задача класса заключается в начальной настройке всех необходимых компонентов и подготовке их к дальнейшему использованию приложением.", - "answer_mode": "answered", - "path_scope": [ - "src/app_runtime/core/runtime.py" - ], - "symbol_candidates": [ - "RuntimeManager" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C2_DEPENDENCY_GRAPH" - ] - }, - "passed": true, - "mismatches": [], - "details": { - "case_id": "plba-fullchain-explain-local-runtime-manager", - "text": "Почему в файле src/app_runtime/core/runtime.py класс RuntimeManager устроен так?", - "mode": "full_chain", - "run_started_at": "2026-03-12T12:08:55", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Почему в файле src/app_runtime/core/runtime.py класс RuntimeManager устроен так?", - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "RuntimeManager", - "alternatives": [ - "RuntimeManager" - ], - "confidence": 0.99 - }, - "rag_count": 6, - "rag_rows": [ - { - "path": "src/app_runtime/core/runtime.py", - "content": "class RuntimeManager\nRuntimeManager", - "layer": "C1_SYMBOL_CATALOG", - "title": "RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "7e4a9381328c5803bbc6179458612fc4e947d928aa7bf8b4b2bebb2c8592f758", - "qname": "RuntimeManager", - "kind": "class", - "signature": "RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.core.runtime", - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager.start", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 32, - "span_end": 59, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "98312ace7fc62b1c7194c5aa1732b6ef736eae1668a3a120dd1ecd5ab1d64f7a", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "77a7b260193018845e4e204df094ab89cfd7c82ee4e822b3a83ad4cd945f9cb1", - "dst_ref": "RuntimeManager.start", - "resolution": "resolved", - "slice_id": "98312ace7fc62b1c7194c5aa1732b6ef736eae1668a3a120dd1ecd5ab1d64f7a", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager.start" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "77a7b260193018845e4e204df094ab89cfd7c82ee4e822b3a83ad4cd945f9cb1" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager._register_core_services", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 32, - "span_end": 127, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "3e5811f3b511fa0cabe363f5d01f2ac5fa039bc8b93f7ee108323e1f5f45a293", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "972d6057a6caac9cf31ebc1e29c6f39f71b10d4cc170dec57cf875ba458549c6", - "dst_ref": "RuntimeManager._register_core_services", - "resolution": "resolved", - "slice_id": "3e5811f3b511fa0cabe363f5d01f2ac5fa039bc8b93f7ee108323e1f5f45a293", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager._register_core_services" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "972d6057a6caac9cf31ebc1e29c6f39f71b10d4cc170dec57cf875ba458549c6" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager.add_config_file", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 32, - "span_end": 52, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "a23b8a11ebdb12708b60c96ea12a69f7f042082f1adfddd572444e246d81d167", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "57ffbd4f0d9fdf3507c2b8624312ce211f3d02fdf86a57a8ec90778d8a7b498d", - "dst_ref": "RuntimeManager.add_config_file", - "resolution": "resolved", - "slice_id": "a23b8a11ebdb12708b60c96ea12a69f7f042082f1adfddd572444e246d81d167", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager.add_config_file" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "57ffbd4f0d9fdf3507c2b8624312ce211f3d02fdf86a57a8ec90778d8a7b498d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.services\n -> RuntimeManager.__init__", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 33, - "span_end": 39, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "d43af85989222ee6d788ce418cdcb217c7ff044cfb915e3bdbd184417dc7bd61", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "dst_ref": "RuntimeManager.__init__", - "resolution": "resolved", - "slice_id": "d43af85989222ee6d788ce418cdcb217c7ff044cfb915e3bdbd184417dc7bd61", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.services", - "RuntimeManager.__init__" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "class RuntimeManager:\n ACTION_TIMEOUT_SECONDS = 10.0\n ACTION_POLL_INTERVAL_SECONDS = 0.05\n\n def __init__(\n self,\n configuration: ConfigurationManager | None = None,\n services: ServiceContainer | None = None,\n traces: TraceService | None = None,\n health: HealthRegistry | None = None,\n logs: LogManager | None = None,\n workers: WorkerSupervisor | None = None,\n control_plane: ControlPlaneService | None = None,\n ) -> None:\n self.configuration = configuration or ConfigurationManager()\n self.services = services or ServiceContainer()\n self.traces = traces or TraceService()\n self.health = health or HealthRegistry()\n self.logs = logs or LogManager()\n self.workers = workers or WorkerSupervisor()\n self.control_plane = control_plane or ControlPlaneService()\n self.registry = ModuleRegistry(self.services)\n self._started = False\n self._state = LifecycleState.IDLE\n self._core_registered = False\n self._workers_registered = False\n self._register_core_services()\n\n def register_module(self, module: ApplicationModule) -> None:\n self.registry.register_module(module.name)\n module.register(self.registry)\n\n def add_config_file(self, path: str) -> FileConfigProvider:\n provider = FileConfigProvider(path)\n self.configuration.add_provider(provider)\n return provider\n\n def start(self, *, start_control_plane: bool = True) -> None:\n if self._started:\n return\n self._state = LifecycleState.STARTING\n config = self.configuration.load()\n self.logs.apply_config(config)\n self._register_health_contributors()\n self._register_workers()\n self.workers.start()\n if start_control_plane:\n self.control_plane.start(self)\n self._started = True\n self._refresh_state()\n\n def stop(self, timeout: float = 30.0, force: bool = False, stop_control_plane: bool = True) -> None:\n if not self._started:\n return\n self._state = LifecycleState.STOPPING\n self.workers.stop(timeout=timeout, force=force)\n if stop_control_plane:\n self.control_plane.stop()\n self._started = False\n self._state = LifecycleState.STOPPED\n\n def status(self) -> dict[str, object]:\n self._refresh_state()\n return self.control_plane.snapshot(self)\n\n def current_health(self) -> HealthPayload:\n self._refresh_state()\n return self.health.payload(self._state, self.workers.healths())\n\n async def health_status(self) -> HealthPayload:\n return self.current_health()\n\n async def start_runtime(self) -> dict[str, object] | str:\n self._refresh_state()\n if self._started:\n return \"runtime already running\"\n if self._state == LifecycleState.STOPPING:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n\n self.start(start_control_plane=False)\n started = self._wait_for_state({LifecycleState.IDLE, LifecycleState.BUSY}, timeout=self.ACTION_TIMEOUT_SECONDS)\n if started:\n return self._action_detail(\"runtime started\", timed_out=False)\n return self._action_detail(\"runtime start is still in progress\", timed_out=True)\n\n async def stop_runtime(self) -> dict[str, object] | str:\n self._refresh_state()\n if not self._started:\n if self._state == LifecycleState.STOPPING:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n return \"runtime already stopped\"\n\n self._state = LifecycleState.STOPPING\n try:\n self.workers.stop(timeout=self.ACTION_TIMEOUT_SECONDS, force=False)\n except TimeoutError:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n\n self._started = False\n self._state = LifecycleState.STOPPED\n return self._action_detail(\"runtime stopped\", timed_out=False)\n\n async def runtime_status(self) -> str:\n self._refresh_state()\n return self._state.value\n\n def _register_core_services(self) -> None:\n if self._core_registered:\n return\n self.services.register(\"configuration\", self.configuration)\n self.services.register(\"traces\", self.traces)\n self.services.register(\"health\", self.health)\n self.services.register(\"logs\", self.logs)\n self.services.register(\"workers\", self.workers)\n self.services.register(\"control_plane\", self.control_plane)\n self._core_registered = True\n\n def _register_health_contributors(self) -> None:\n for contributor in self.registry.health_contributors:\n self.health.register(contributor)\n\n def _register_workers(self) -> None:\n if self._workers_registered:\n return\n for worker in self.registry.workers:\n self.workers.register(worker)\n self._workers_registered = True\n\n def _refresh_state(self) -> None:\n lifecycle = self.workers.lifecycle_state()\n\n if self._state == LifecycleState.STOPPING:\n if lifecycle == LifecycleState.STOPPED:\n self._started = False\n self._state = LifecycleState.STOPPED\n return\n\n if not self._started:\n if lifecycle == LifecycleState.STOPPED:\n self._state = LifecycleState.STOPPED\n return\n\n self._state = lifecycle\n\n def _wait_for_state(self, target_states: set[LifecycleState], *, timeout: float) -> bool:\n deadline = monotonic() + timeout\n while monotonic() < deadline:\n self._refresh_state()\n if self._state in target_states:\n return True\n sleep(self.ACTION_POLL_INTERVAL_SECONDS)\n self._refresh_state()\n return self._state in target_states\n\n def _action_detail(self, message: str, *, timed_out: bool) -> dict[str, object]:\n self._refresh_state()\n return {\n \"message\": message,\n \"state\": self._state.value,\n \"timed_out\": timed_out,\n \"workers\": self.workers.snapshot(),\n }", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/core/runtime.py:RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.core.runtime", - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "llm_answer": "Класс `RuntimeManager` в файле `src/app_runtime/core/runtime.py` предназначен для управления жизненным циклом приложения и координации различных компонентов системы.\n\n### Что делает класс `RuntimeManager`?\nЭтот класс инициализирует и запускает основные компоненты приложения, такие как конфигурация (`configuration`), сервисы (`services`), мониторинг состояния (`health`), логирование (`logs`), управление рабочими процессами (`workers`) и контрольную плоскость (`control_plane`).\n\n### Входные параметры конструктора класса:\n- `configuration`: Менеджер конфигурации (по умолчанию используется экземпляр `ConfigurationManager()`).\n- `services`: Контейнер сервисов (по умолчанию – `ServiceContainer()`).\n- `traces`: Сервис трассировки (по умолчанию – `TraceService()`).\n- `health`: Реестр здоровья (по умолчанию – `HealthRegistry()`).\n- `logs`: Менеджер логирования (по умолчанию – `LogManager()`).\n- `workers`: Надзор за рабочими процессами (по умолчанию – `WorkerSupervisor()`).\n- `control_plane`: Контрольная плоскость сервиса (по умолчанию – `ControlPlaneService()`)\n\n### Как связаны входы и выходы:\nКонструктор класса инициализирует указанные объекты и сохраняет их в соответствующих свойствах экземпляра. Он также вызывает внутренние методы регистрации, например `_register_core_services`, которые обеспечивают корректное подключение основных модулей к системе.\n\n### Связь с ближайшим контекстом:\nМетод `__init__` является точкой входа при создании нового объекта `RuntimeManager`. Далее управление передается методам, таким как `_register_core_services`, которые ответственны за начальную настройку системы перед её запуском.\n\nТаким образом, основная задача класса заключается в начальной настройке всех необходимых компонентов и подготовке их к дальнейшему использованию приложением.", - "summary": { - "router": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN_LOCAL", - "confidence": null - }, - "retrieval": { - "profile": "code", - "layers_hit": [ - "C0_SOURCE_CHUNKS", - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH" - ], - "evidence_sufficient": true - }, - "llm": { - "answer_status": "answered", - "groundedness": "grounded" - } - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN_LOCAL", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C2_DEPENDENCY_GRAPH" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "RuntimeManager" - ], - "keyword_hints": [ - "src/app_runtime/core/runtime.py", - "RuntimeManager" - ], - "path_hints": [ - "src/app_runtime/core/runtime.py" - ], - "path_scope": [ - "src/app_runtime/core/runtime.py" - ], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C2_DEPENDENCY_GRAPH" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C0_SOURCE_CHUNKS": "exact_path_fetch", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 12, - "C2_DEPENDENCY_GRAPH": 4 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [ - "src/app_runtime/core/runtime.py" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src/app_runtime/core/runtime.py" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src/app_runtime/core/runtime.py" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "RuntimeManager", - "path_scope": [ - "src/app_runtime/core/runtime.py" - ], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Почему в файле src/app_runtime/core/runtime.py класс RuntimeManager устроен так?", - "path_scope": [ - "src/app_runtime/core/runtime.py" - ], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 12, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "Почему в файле src/app_runtime/core/runtime.py класс RuntimeManager устроен так?", - "path_scope": [ - "src/app_runtime/core/runtime.py" - ], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 4, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [ - "src/app_runtime/core/runtime.py" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 1, - "candidates_after_filter": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src/app_runtime/core/runtime.py" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 1, - "candidates_after_filter": 1 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src/app_runtime/core/runtime.py" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 4, - "candidates_after_filter": 4 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "RuntimeManager", - "alternatives": [ - "RuntimeManager" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 4, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "router": 1, - "symbol_resolution": 0, - "retrieval_total": 72, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 26, - "C0_SOURCE_CHUNKS": 18, - "C2_DEPENDENCY_GRAPH": 27 - }, - "merge_rank": 37, - "prompt_build": 0, - "llm_call": 2686 - }, - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 784, - "evidence_rows": 6, - "evidence_chars": 6650 - }, - "evidence_summary": [ - { - "layer": "C1_SYMBOL_CATALOG", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "count": 4, - "unique_paths": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 1, - "unique_paths": 1 - } - ], - "prompt_template_id": "intent_code_qa_explain_local_ru_v1", - "system_prompt_version": "v1" - }, - "router": { - "conversation_mode": "START", - "keyword_hints": [ - "src/app_runtime/core/runtime.py", - "RuntimeManager" - ], - "path_scope": [ - "src/app_runtime/core/runtime.py" - ] - }, - "llm": { - "used_evidence_count": 6, - "missing_evidence_reason": null - } - }, - "run_info": { - "case_id": "plba-fullchain-explain-local-runtime-manager", - "mode": "full_chain", - "run_started_at": "2026-03-12T12:08:55", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - }, - "input_request": { - "text": "Почему в файле src/app_runtime/core/runtime.py класс RuntimeManager устроен так?", - "normalized_query": "Почему в файле src/app_runtime/core/runtime.py класс RuntimeManager устроен так?" - }, - "steps": [ - { - "step": "intent_router", - "input": { - "query": "Почему в файле src/app_runtime/core/runtime.py класс RuntimeManager устроен так?" - }, - "output": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Почему в файле src/app_runtime/core/runtime.py класс RuntimeManager устроен так?" - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN_LOCAL", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C2_DEPENDENCY_GRAPH" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "RuntimeManager" - ], - "keyword_hints": [ - "src/app_runtime/core/runtime.py", - "RuntimeManager" - ], - "path_hints": [ - "src/app_runtime/core/runtime.py" - ], - "path_scope": [ - "src/app_runtime/core/runtime.py" - ], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "timings_ms": { - "router": 1 - } - } - }, - { - "step": "retrieval", - "input": { - "query": "Почему в файле src/app_runtime/core/runtime.py класс RuntimeManager устроен так?" - }, - "output": { - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "RuntimeManager", - "alternatives": [ - "RuntimeManager" - ], - "confidence": 0.99 - }, - "rag_count": 6, - "rag_rows": [ - { - "path": "src/app_runtime/core/runtime.py", - "content": "class RuntimeManager\nRuntimeManager", - "layer": "C1_SYMBOL_CATALOG", - "title": "RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "7e4a9381328c5803bbc6179458612fc4e947d928aa7bf8b4b2bebb2c8592f758", - "qname": "RuntimeManager", - "kind": "class", - "signature": "RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.core.runtime", - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager.start", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 32, - "span_end": 59, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "98312ace7fc62b1c7194c5aa1732b6ef736eae1668a3a120dd1ecd5ab1d64f7a", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "77a7b260193018845e4e204df094ab89cfd7c82ee4e822b3a83ad4cd945f9cb1", - "dst_ref": "RuntimeManager.start", - "resolution": "resolved", - "slice_id": "98312ace7fc62b1c7194c5aa1732b6ef736eae1668a3a120dd1ecd5ab1d64f7a", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager.start" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "77a7b260193018845e4e204df094ab89cfd7c82ee4e822b3a83ad4cd945f9cb1" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager._register_core_services", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 32, - "span_end": 127, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "3e5811f3b511fa0cabe363f5d01f2ac5fa039bc8b93f7ee108323e1f5f45a293", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "972d6057a6caac9cf31ebc1e29c6f39f71b10d4cc170dec57cf875ba458549c6", - "dst_ref": "RuntimeManager._register_core_services", - "resolution": "resolved", - "slice_id": "3e5811f3b511fa0cabe363f5d01f2ac5fa039bc8b93f7ee108323e1f5f45a293", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager._register_core_services" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "972d6057a6caac9cf31ebc1e29c6f39f71b10d4cc170dec57cf875ba458549c6" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager.add_config_file", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 32, - "span_end": 52, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "a23b8a11ebdb12708b60c96ea12a69f7f042082f1adfddd572444e246d81d167", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "57ffbd4f0d9fdf3507c2b8624312ce211f3d02fdf86a57a8ec90778d8a7b498d", - "dst_ref": "RuntimeManager.add_config_file", - "resolution": "resolved", - "slice_id": "a23b8a11ebdb12708b60c96ea12a69f7f042082f1adfddd572444e246d81d167", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager.add_config_file" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "57ffbd4f0d9fdf3507c2b8624312ce211f3d02fdf86a57a8ec90778d8a7b498d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.services\n -> RuntimeManager.__init__", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 33, - "span_end": 39, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "d43af85989222ee6d788ce418cdcb217c7ff044cfb915e3bdbd184417dc7bd61", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "dst_ref": "RuntimeManager.__init__", - "resolution": "resolved", - "slice_id": "d43af85989222ee6d788ce418cdcb217c7ff044cfb915e3bdbd184417dc7bd61", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.services", - "RuntimeManager.__init__" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "class RuntimeManager:\n ACTION_TIMEOUT_SECONDS = 10.0\n ACTION_POLL_INTERVAL_SECONDS = 0.05\n\n def __init__(\n self,\n configuration: ConfigurationManager | None = None,\n services: ServiceContainer | None = None,\n traces: TraceService | None = None,\n health: HealthRegistry | None = None,\n logs: LogManager | None = None,\n workers: WorkerSupervisor | None = None,\n control_plane: ControlPlaneService | None = None,\n ) -> None:\n self.configuration = configuration or ConfigurationManager()\n self.services = services or ServiceContainer()\n self.traces = traces or TraceService()\n self.health = health or HealthRegistry()\n self.logs = logs or LogManager()\n self.workers = workers or WorkerSupervisor()\n self.control_plane = control_plane or ControlPlaneService()\n self.registry = ModuleRegistry(self.services)\n self._started = False\n self._state = LifecycleState.IDLE\n self._core_registered = False\n self._workers_registered = False\n self._register_core_services()\n\n def register_module(self, module: ApplicationModule) -> None:\n self.registry.register_module(module.name)\n module.register(self.registry)\n\n def add_config_file(self, path: str) -> FileConfigProvider:\n provider = FileConfigProvider(path)\n self.configuration.add_provider(provider)\n return provider\n\n def start(self, *, start_control_plane: bool = True) -> None:\n if self._started:\n return\n self._state = LifecycleState.STARTING\n config = self.configuration.load()\n self.logs.apply_config(config)\n self._register_health_contributors()\n self._register_workers()\n self.workers.start()\n if start_control_plane:\n self.control_plane.start(self)\n self._started = True\n self._refresh_state()\n\n def stop(self, timeout: float = 30.0, force: bool = False, stop_control_plane: bool = True) -> None:\n if not self._started:\n return\n self._state = LifecycleState.STOPPING\n self.workers.stop(timeout=timeout, force=force)\n if stop_control_plane:\n self.control_plane.stop()\n self._started = False\n self._state = LifecycleState.STOPPED\n\n def status(self) -> dict[str, object]:\n self._refresh_state()\n return self.control_plane.snapshot(self)\n\n def current_health(self) -> HealthPayload:\n self._refresh_state()\n return self.health.payload(self._state, self.workers.healths())\n\n async def health_status(self) -> HealthPayload:\n return self.current_health()\n\n async def start_runtime(self) -> dict[str, object] | str:\n self._refresh_state()\n if self._started:\n return \"runtime already running\"\n if self._state == LifecycleState.STOPPING:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n\n self.start(start_control_plane=False)\n started = self._wait_for_state({LifecycleState.IDLE, LifecycleState.BUSY}, timeout=self.ACTION_TIMEOUT_SECONDS)\n if started:\n return self._action_detail(\"runtime started\", timed_out=False)\n return self._action_detail(\"runtime start is still in progress\", timed_out=True)\n\n async def stop_runtime(self) -> dict[str, object] | str:\n self._refresh_state()\n if not self._started:\n if self._state == LifecycleState.STOPPING:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n return \"runtime already stopped\"\n\n self._state = LifecycleState.STOPPING\n try:\n self.workers.stop(timeout=self.ACTION_TIMEOUT_SECONDS, force=False)\n except TimeoutError:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n\n self._started = False\n self._state = LifecycleState.STOPPED\n return self._action_detail(\"runtime stopped\", timed_out=False)\n\n async def runtime_status(self) -> str:\n self._refresh_state()\n return self._state.value\n\n def _register_core_services(self) -> None:\n if self._core_registered:\n return\n self.services.register(\"configuration\", self.configuration)\n self.services.register(\"traces\", self.traces)\n self.services.register(\"health\", self.health)\n self.services.register(\"logs\", self.logs)\n self.services.register(\"workers\", self.workers)\n self.services.register(\"control_plane\", self.control_plane)\n self._core_registered = True\n\n def _register_health_contributors(self) -> None:\n for contributor in self.registry.health_contributors:\n self.health.register(contributor)\n\n def _register_workers(self) -> None:\n if self._workers_registered:\n return\n for worker in self.registry.workers:\n self.workers.register(worker)\n self._workers_registered = True\n\n def _refresh_state(self) -> None:\n lifecycle = self.workers.lifecycle_state()\n\n if self._state == LifecycleState.STOPPING:\n if lifecycle == LifecycleState.STOPPED:\n self._started = False\n self._state = LifecycleState.STOPPED\n return\n\n if not self._started:\n if lifecycle == LifecycleState.STOPPED:\n self._state = LifecycleState.STOPPED\n return\n\n self._state = lifecycle\n\n def _wait_for_state(self, target_states: set[LifecycleState], *, timeout: float) -> bool:\n deadline = monotonic() + timeout\n while monotonic() < deadline:\n self._refresh_state()\n if self._state in target_states:\n return True\n sleep(self.ACTION_POLL_INTERVAL_SECONDS)\n self._refresh_state()\n return self._state in target_states\n\n def _action_detail(self, message: str, *, timed_out: bool) -> dict[str, object]:\n self._refresh_state()\n return {\n \"message\": message,\n \"state\": self._state.value,\n \"timed_out\": timed_out,\n \"workers\": self.workers.snapshot(),\n }", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/core/runtime.py:RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.core.runtime", - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ] - }, - "diagnostics": { - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C2_DEPENDENCY_GRAPH" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C0_SOURCE_CHUNKS": "exact_path_fetch", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 12, - "C2_DEPENDENCY_GRAPH": 4 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [ - "src/app_runtime/core/runtime.py" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src/app_runtime/core/runtime.py" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src/app_runtime/core/runtime.py" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "RuntimeManager", - "path_scope": [ - "src/app_runtime/core/runtime.py" - ], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Почему в файле src/app_runtime/core/runtime.py класс RuntimeManager устроен так?", - "path_scope": [ - "src/app_runtime/core/runtime.py" - ], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 12, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "Почему в файле src/app_runtime/core/runtime.py класс RuntimeManager устроен так?", - "path_scope": [ - "src/app_runtime/core/runtime.py" - ], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 4, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [ - "src/app_runtime/core/runtime.py" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 1, - "candidates_after_filter": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src/app_runtime/core/runtime.py" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 1, - "candidates_after_filter": 1 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src/app_runtime/core/runtime.py" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 4, - "candidates_after_filter": 4 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "RuntimeManager", - "alternatives": [ - "RuntimeManager" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 4, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "symbol_resolution": 0, - "retrieval_total": 72, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 26, - "C0_SOURCE_CHUNKS": 18, - "C2_DEPENDENCY_GRAPH": 27 - }, - "merge_rank": 37 - } - } - }, - { - "step": "llm_answer", - "input": { - "query": "Почему в файле src/app_runtime/core/runtime.py класс RuntimeManager устроен так?", - "rag_count": 6 - }, - "output": { - "llm_answer": "Класс `RuntimeManager` в файле `src/app_runtime/core/runtime.py` предназначен для управления жизненным циклом приложения и координации различных компонентов системы.\n\n### Что делает класс `RuntimeManager`?\nЭтот класс инициализирует и запускает основные компоненты приложения, такие как конфигурация (`configuration`), сервисы (`services`), мониторинг состояния (`health`), логирование (`logs`), управление рабочими процессами (`workers`) и контрольную плоскость (`control_plane`).\n\n### Входные параметры конструктора класса:\n- `configuration`: Менеджер конфигурации (по умолчанию используется экземпляр `ConfigurationManager()`).\n- `services`: Контейнер сервисов (по умолчанию – `ServiceContainer()`).\n- `traces`: Сервис трассировки (по умолчанию – `TraceService()`).\n- `health`: Реестр здоровья (по умолчанию – `HealthRegistry()`).\n- `logs`: Менеджер логирования (по умолчанию – `LogManager()`).\n- `workers`: Надзор за рабочими процессами (по умолчанию – `WorkerSupervisor()`).\n- `control_plane`: Контрольная плоскость сервиса (по умолчанию – `ControlPlaneService()`)\n\n### Как связаны входы и выходы:\nКонструктор класса инициализирует указанные объекты и сохраняет их в соответствующих свойствах экземпляра. Он также вызывает внутренние методы регистрации, например `_register_core_services`, которые обеспечивают корректное подключение основных модулей к системе.\n\n### Связь с ближайшим контекстом:\nМетод `__init__` является точкой входа при создании нового объекта `RuntimeManager`. Далее управление передается методам, таким как `_register_core_services`, которые ответственны за начальную настройку системы перед её запуском.\n\nТаким образом, основная задача класса заключается в начальной настройке всех необходимых компонентов и подготовке их к дальнейшему использованию приложением." - }, - "diagnostics": { - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 784, - "evidence_rows": 6, - "evidence_chars": 6650 - }, - "evidence_summary": [ - { - "layer": "C1_SYMBOL_CATALOG", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "count": 4, - "unique_paths": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 1, - "unique_paths": 1 - } - ], - "prompt_template_id": "intent_code_qa_explain_local_ru_v1", - "system_prompt_version": "v1" - }, - "timings_ms": { - "prompt_build": 0, - "llm_call": 2686 - } - } - } - ] - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents/20260312_120855/full_chain_plba_code_subintents_plba-fullchain-explain-local-runtime-manager.md b/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents/20260312_120855/full_chain_plba_code_subintents_plba-fullchain-explain-local-runtime-manager.md deleted file mode 100644 index 7f87e28..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents/20260312_120855/full_chain_plba_code_subintents_plba-fullchain-explain-local-runtime-manager.md +++ /dev/null @@ -1,34 +0,0 @@ -# plba-fullchain-explain-local-runtime-manager - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_subintents.yaml -- runner: runtime -- mode: full_chain -- passed: True - -## Query -Почему в файле src/app_runtime/core/runtime.py класс RuntimeManager устроен так? - -## Actual -{ - "intent": "CODE_QA", - "sub_intent": "EXPLAIN_LOCAL", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 6, - "llm_answer": "Класс `RuntimeManager` в файле `src/app_runtime/core/runtime.py` предназначен для управления жизненным циклом приложения и координации различных компонентов системы.\n\n### Что делает класс `RuntimeManager`?\nЭтот класс инициализирует и запускает основные компоненты приложения, такие как конфигурация (`configuration`), сервисы (`services`), мониторинг состояния (`health`), логирование (`logs`), управление рабочими процессами (`workers`) и контрольную плоскость (`control_plane`).\n\n### Входные параметры конструктора класса:\n- `configuration`: Менеджер конфигурации (по умолчанию используется экземпляр `ConfigurationManager()`).\n- `services`: Контейнер сервисов (по умолчанию – `ServiceContainer()`).\n- `traces`: Сервис трассировки (по умолчанию – `TraceService()`).\n- `health`: Реестр здоровья (по умолчанию – `HealthRegistry()`).\n- `logs`: Менеджер логирования (по умолчанию – `LogManager()`).\n- `workers`: Надзор за рабочими процессами (по умолчанию – `WorkerSupervisor()`).\n- `control_plane`: Контрольная плоскость сервиса (по умолчанию – `ControlPlaneService()`)\n\n### Как связаны входы и выходы:\nКонструктор класса инициализирует указанные объекты и сохраняет их в соответствующих свойствах экземпляра. Он также вызывает внутренние методы регистрации, например `_register_core_services`, которые обеспечивают корректное подключение основных модулей к системе.\n\n### Связь с ближайшим контекстом:\nМетод `__init__` является точкой входа при создании нового объекта `RuntimeManager`. Далее управление передается методам, таким как `_register_core_services`, которые ответственны за начальную настройку системы перед её запуском.\n\nТаким образом, основная задача класса заключается в начальной настройке всех необходимых компонентов и подготовке их к дальнейшему использованию приложением.", - "answer_mode": "answered", - "path_scope": [ - "src/app_runtime/core/runtime.py" - ], - "symbol_candidates": [ - "RuntimeManager" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C2_DEPENDENCY_GRAPH" - ] -} - -## Mismatches -- none \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents/20260312_120855/full_chain_plba_code_subintents_plba-fullchain-explain-runtime-manager.json b/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents/20260312_120855/full_chain_plba_code_subintents_plba-fullchain-explain-runtime-manager.json deleted file mode 100644 index 224f7d2..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents/20260312_120855/full_chain_plba_code_subintents_plba-fullchain-explain-runtime-manager.json +++ /dev/null @@ -1,2088 +0,0 @@ -{ - "case_id": "plba-fullchain-explain-runtime-manager", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_subintents.yaml", - "runner": "runtime", - "mode": "full_chain", - "actual": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 12, - "llm_answer": "## Назначение класса `RuntimeManager`\nКласс `RuntimeManager` является ключевым компонентом системы управления жизненным циклом приложения. Он отвечает за координацию работы различных модулей и сервисов приложения, обеспечивая централизованное управление состоянием и конфигурацией всех компонентов. Этот компонент выступает в качестве управляющего слоя, обеспечивающего синхронизацию и интеграцию различных частей архитектуры.\n\n## Ключевые зависимости\nКлючевыми зависимостями являются следующие компоненты:\n\n- **ConfigurationManager**: Менеджер конфигурации для настройки параметров приложения.\n- **ServiceContainer**: Контейнер служб, содержащий различные сервисы и модули приложения.\n- **TraceService**: Сервис трассировки, предназначенный для отслеживания выполнения действий и операций внутри приложения.\n- **HealthRegistry**: Реестр состояния здоровья приложения, позволяющий отслеживать состояние различных его частей.\n- **LogManager**: Менеджер логирования, обеспечивающий сбор и хранение логов приложения.\n- **WorkerSupervisor**: Наблюдатель за рабочими процессами, управляющий их запуском и остановкой.\n- **ControlPlaneService**: Служба управления плоскостью контроля, отвечающая за координацию рабочих процессов и мониторинг состояния приложения.\n\nВсе эти компоненты передаются конструктору класса при создании экземпляра `RuntimeManager`.\n\n## Поток данных или вызовов\nПроцесс работы `RuntimeManager` включает несколько ключевых этапов:\n\n1. **Инициализация и регистрация модулей** (`__init__()`):\n - При инициализации создается экземпляр `RuntimeManager`, которому передаются необходимые службы и параметры. В методе `__init__()` происходит регистрация модулей с помощью метода `_register_core_services()`. Это позволяет системе начать работу с предварительно зарегистрированными модулями и сервисами.\n \n2. **Регистрация модулей** (`register_module(module)`):\n - Метод `register_module` предназначен для регистрации новых модулей и обеспечения их интеграции в систему через модульный реестр `registry`.\n\n3. **Управление рабочим процессом**:\n - Класс управляет рабочим процессом приложений, следя за состоянием жизненного цикла (например, IDLE, RUNNING). Для этого используется атрибут `_state`, значение которого обновляется в зависимости от текущего состояния приложения.\n\n4. **Мониторинг и контроль**:\n - Через службу `ControlPlaneService` обеспечивается мониторинг и контроль над различными частями приложения, что позволяет своевременно реагировать на изменения в состоянии системы и корректно завершать рабочие процессы.\n\n## Важные детали реализации\n- **Настройки тайм-аутов и интервалов опроса**:\n - Константы `ACTION_TIMEOUT_SECONDS` и `ACTION_POLL_INTERVAL_SECONDS` задают временные интервалы для ожиданий и периодических проверок состояний.\n \n- **Использование декораторов**:\n - Методы `@property` используются для создания геттеров и сеттеров для доступа к внутренним атрибутам объекта, таким как `configuration`, `services`, `traces`, `health`, `logs`, `workers`, `control_plane` и т.д.\n\n- **Централизованная обработка ошибок и исключений**:\n - Хотя конкретный механизм обработки исключений напрямую не указан в представленном фрагменте кода, предполагается наличие соответствующего механизма, позволяющего эффективно обрабатывать ошибки и восстанавливаться после сбоев.\n\n## Осторожные выводы\nНа основании представленного контекста сложно точно определить весь цикл работы `RuntimeManager`, однако можно предположить, что он играет ключевую роль в управлении жизненным циклом и координацией взаимодействий между различными модулями и сервисами приложения. Полная картина поведения и взаимодействия классов требует дополнительного анализа исходного кода вне предоставленных контекстных слоев.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "RuntimeManager" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "passed": true, - "mismatches": [], - "details": { - "case_id": "plba-fullchain-explain-runtime-manager", - "text": "Объясни как работает класс RuntimeManager", - "mode": "full_chain", - "run_started_at": "2026-03-12T12:08:55", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Объясни как работает класс RuntimeManager", - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "RuntimeManager", - "alternatives": [ - "RuntimeManager" - ], - "confidence": 0.99 - }, - "rag_count": 12, - "rag_rows": [ - { - "path": "src/app_runtime/core/runtime.py", - "content": "class RuntimeManager\nRuntimeManager", - "layer": "C1_SYMBOL_CATALOG", - "title": "RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "7e4a9381328c5803bbc6179458612fc4e947d928aa7bf8b4b2bebb2c8592f758", - "qname": "RuntimeManager", - "kind": "class", - "signature": "RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.core.runtime", - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests manager\n- orchestrates role-like calls (4)\n- reads and writes state attributes\n- participates in dataflow slices (50)", - "layer": "C4_SEMANTIC_ROLES", - "title": "RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 43, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "7e4a9381328c5803bbc6179458612fc4e947d928aa7bf8b4b2bebb2c8592f758", - "symbol_name": "RuntimeManager", - "qname": "RuntimeManager", - "role": "pipeline_stage", - "confidence": 0.67, - "dataflow_participation": 50, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.stop", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 25, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d", - "dst_ref": "ControlPlaneService.stop", - "resolution": "resolved", - "slice_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.stop" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._stop_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 51, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a", - "dst_ref": "ControlPlaneService._stop_async", - "resolution": "resolved", - "slice_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._stop_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.register_channel", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 17, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957", - "dst_ref": "ControlPlaneService.register_channel", - "resolution": "resolved", - "slice_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.register_channel" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.start", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 20, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154", - "dst_ref": "ControlPlaneService.start", - "resolution": "resolved", - "slice_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.start" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._start_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 47, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517", - "dst_ref": "ControlPlaneService._start_async", - "resolution": "resolved", - "slice_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._start_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager.add_config_file", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 32, - "span_end": 52, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "a23b8a11ebdb12708b60c96ea12a69f7f042082f1adfddd572444e246d81d167", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "57ffbd4f0d9fdf3507c2b8624312ce211f3d02fdf86a57a8ec90778d8a7b498d", - "dst_ref": "RuntimeManager.add_config_file", - "resolution": "resolved", - "slice_id": "a23b8a11ebdb12708b60c96ea12a69f7f042082f1adfddd572444e246d81d167", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager.add_config_file" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "57ffbd4f0d9fdf3507c2b8624312ce211f3d02fdf86a57a8ec90778d8a7b498d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "class RuntimeManager:\n ACTION_TIMEOUT_SECONDS = 10.0\n ACTION_POLL_INTERVAL_SECONDS = 0.05\n\n def __init__(\n self,\n configuration: ConfigurationManager | None = None,\n services: ServiceContainer | None = None,\n traces: TraceService | None = None,\n health: HealthRegistry | None = None,\n logs: LogManager | None = None,\n workers: WorkerSupervisor | None = None,\n control_plane: ControlPlaneService | None = None,\n ) -> None:\n self.configuration = configuration or ConfigurationManager()\n self.services = services or ServiceContainer()\n self.traces = traces or TraceService()\n self.health = health or HealthRegistry()\n self.logs = logs or LogManager()\n self.workers = workers or WorkerSupervisor()\n self.control_plane = control_plane or ControlPlaneService()\n self.registry = ModuleRegistry(self.services)\n self._started = False\n self._state = LifecycleState.IDLE\n self._core_registered = False\n self._workers_registered = False\n self._register_core_services()\n\n def register_module(self, module: ApplicationModule) -> None:\n self.registry.register_module(module.name)\n module.register(self.registry)\n\n def add_config_file(self, path: str) -> FileConfigProvider:\n provider = FileConfigProvider(path)\n self.configuration.add_provider(provider)\n return provider\n\n def start(self, *, start_control_plane: bool = True) -> None:\n if self._started:\n return\n self._state = LifecycleState.STARTING\n config = self.configuration.load()\n self.logs.apply_config(config)\n self._register_health_contributors()\n self._register_workers()\n self.workers.start()\n if start_control_plane:\n self.control_plane.start(self)\n self._started = True\n self._refresh_state()\n\n def stop(self, timeout: float = 30.0, force: bool = False, stop_control_plane: bool = True) -> None:\n if not self._started:\n return\n self._state = LifecycleState.STOPPING\n self.workers.stop(timeout=timeout, force=force)\n if stop_control_plane:\n self.control_plane.stop()\n self._started = False\n self._state = LifecycleState.STOPPED\n\n def status(self) -> dict[str, object]:\n self._refresh_state()\n return self.control_plane.snapshot(self)\n\n def current_health(self) -> HealthPayload:\n self._refresh_state()\n return self.health.payload(self._state, self.workers.healths())\n\n async def health_status(self) -> HealthPayload:\n return self.current_health()\n\n async def start_runtime(self) -> dict[str, object] | str:\n self._refresh_state()\n if self._started:\n return \"runtime already running\"\n if self._state == LifecycleState.STOPPING:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n\n self.start(start_control_plane=False)\n started = self._wait_for_state({LifecycleState.IDLE, LifecycleState.BUSY}, timeout=self.ACTION_TIMEOUT_SECONDS)\n if started:\n return self._action_detail(\"runtime started\", timed_out=False)\n return self._action_detail(\"runtime start is still in progress\", timed_out=True)\n\n async def stop_runtime(self) -> dict[str, object] | str:\n self._refresh_state()\n if not self._started:\n if self._state == LifecycleState.STOPPING:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n return \"runtime already stopped\"\n\n self._state = LifecycleState.STOPPING\n try:\n self.workers.stop(timeout=self.ACTION_TIMEOUT_SECONDS, force=False)\n except TimeoutError:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n\n self._started = False\n self._state = LifecycleState.STOPPED\n return self._action_detail(\"runtime stopped\", timed_out=False)\n\n async def runtime_status(self) -> str:\n self._refresh_state()\n return self._state.value\n\n def _register_core_services(self) -> None:\n if self._core_registered:\n return\n self.services.register(\"configuration\", self.configuration)\n self.services.register(\"traces\", self.traces)\n self.services.register(\"health\", self.health)\n self.services.register(\"logs\", self.logs)\n self.services.register(\"workers\", self.workers)\n self.services.register(\"control_plane\", self.control_plane)\n self._core_registered = True\n\n def _register_health_contributors(self) -> None:\n for contributor in self.registry.health_contributors:\n self.health.register(contributor)\n\n def _register_workers(self) -> None:\n if self._workers_registered:\n return\n for worker in self.registry.workers:\n self.workers.register(worker)\n self._workers_registered = True\n\n def _refresh_state(self) -> None:\n lifecycle = self.workers.lifecycle_state()\n\n if self._state == LifecycleState.STOPPING:\n if lifecycle == LifecycleState.STOPPED:\n self._started = False\n self._state = LifecycleState.STOPPED\n return\n\n if not self._started:\n if lifecycle == LifecycleState.STOPPED:\n self._state = LifecycleState.STOPPED\n return\n\n self._state = lifecycle\n\n def _wait_for_state(self, target_states: set[LifecycleState], *, timeout: float) -> bool:\n deadline = monotonic() + timeout\n while monotonic() < deadline:\n self._refresh_state()\n if self._state in target_states:\n return True\n sleep(self.ACTION_POLL_INTERVAL_SECONDS)\n self._refresh_state()\n return self._state in target_states\n\n def _action_detail(self, message: str, *, timed_out: bool) -> dict[str, object]:\n self._refresh_state()\n return {\n \"message\": message,\n \"state\": self._state.value,\n \"timed_out\": timed_out,\n \"workers\": self.workers.snapshot(),\n }", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/core/runtime.py:RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.core.runtime", - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "llm_answer": "## Назначение класса `RuntimeManager`\nКласс `RuntimeManager` является ключевым компонентом системы управления жизненным циклом приложения. Он отвечает за координацию работы различных модулей и сервисов приложения, обеспечивая централизованное управление состоянием и конфигурацией всех компонентов. Этот компонент выступает в качестве управляющего слоя, обеспечивающего синхронизацию и интеграцию различных частей архитектуры.\n\n## Ключевые зависимости\nКлючевыми зависимостями являются следующие компоненты:\n\n- **ConfigurationManager**: Менеджер конфигурации для настройки параметров приложения.\n- **ServiceContainer**: Контейнер служб, содержащий различные сервисы и модули приложения.\n- **TraceService**: Сервис трассировки, предназначенный для отслеживания выполнения действий и операций внутри приложения.\n- **HealthRegistry**: Реестр состояния здоровья приложения, позволяющий отслеживать состояние различных его частей.\n- **LogManager**: Менеджер логирования, обеспечивающий сбор и хранение логов приложения.\n- **WorkerSupervisor**: Наблюдатель за рабочими процессами, управляющий их запуском и остановкой.\n- **ControlPlaneService**: Служба управления плоскостью контроля, отвечающая за координацию рабочих процессов и мониторинг состояния приложения.\n\nВсе эти компоненты передаются конструктору класса при создании экземпляра `RuntimeManager`.\n\n## Поток данных или вызовов\nПроцесс работы `RuntimeManager` включает несколько ключевых этапов:\n\n1. **Инициализация и регистрация модулей** (`__init__()`):\n - При инициализации создается экземпляр `RuntimeManager`, которому передаются необходимые службы и параметры. В методе `__init__()` происходит регистрация модулей с помощью метода `_register_core_services()`. Это позволяет системе начать работу с предварительно зарегистрированными модулями и сервисами.\n \n2. **Регистрация модулей** (`register_module(module)`):\n - Метод `register_module` предназначен для регистрации новых модулей и обеспечения их интеграции в систему через модульный реестр `registry`.\n\n3. **Управление рабочим процессом**:\n - Класс управляет рабочим процессом приложений, следя за состоянием жизненного цикла (например, IDLE, RUNNING). Для этого используется атрибут `_state`, значение которого обновляется в зависимости от текущего состояния приложения.\n\n4. **Мониторинг и контроль**:\n - Через службу `ControlPlaneService` обеспечивается мониторинг и контроль над различными частями приложения, что позволяет своевременно реагировать на изменения в состоянии системы и корректно завершать рабочие процессы.\n\n## Важные детали реализации\n- **Настройки тайм-аутов и интервалов опроса**:\n - Константы `ACTION_TIMEOUT_SECONDS` и `ACTION_POLL_INTERVAL_SECONDS` задают временные интервалы для ожиданий и периодических проверок состояний.\n \n- **Использование декораторов**:\n - Методы `@property` используются для создания геттеров и сеттеров для доступа к внутренним атрибутам объекта, таким как `configuration`, `services`, `traces`, `health`, `logs`, `workers`, `control_plane` и т.д.\n\n- **Централизованная обработка ошибок и исключений**:\n - Хотя конкретный механизм обработки исключений напрямую не указан в представленном фрагменте кода, предполагается наличие соответствующего механизма, позволяющего эффективно обрабатывать ошибки и восстанавливаться после сбоев.\n\n## Осторожные выводы\nНа основании представленного контекста сложно точно определить весь цикл работы `RuntimeManager`, однако можно предположить, что он играет ключевую роль в управлении жизненным циклом и координацией взаимодействий между различными модулями и сервисами приложения. Полная картина поведения и взаимодействия классов требует дополнительного анализа исходного кода вне предоставленных контекстных слоев.", - "summary": { - "router": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "confidence": null - }, - "retrieval": { - "profile": "code", - "layers_hit": [ - "C0_SOURCE_CHUNKS", - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS", - "C4_SEMANTIC_ROLES" - ], - "evidence_sufficient": true - }, - "llm": { - "answer_status": "answered", - "groundedness": "grounded" - } - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "RuntimeManager" - ], - "keyword_hints": [ - "RuntimeManager" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C0_SOURCE_CHUNKS": "exact_path_fetch", - "C4_SEMANTIC_ROLES": "exact_path_fetch", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C3_ENTRYPOINTS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 8, - "C4_SEMANTIC_ROLES": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C3_ENTRYPOINTS": 6 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C4_SEMANTIC_ROLES": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C4_SEMANTIC_ROLES", - "query": "RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - }, - { - "layer": "C3_ENTRYPOINTS", - "query": "RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 1, - "candidates_after_filter": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 6, - "candidates_after_filter": 6 - }, - { - "layer": "C3_ENTRYPOINTS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 3, - "candidates_after_filter": 3 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "RuntimeManager", - "alternatives": [ - "RuntimeManager" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C4_SEMANTIC_ROLES", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 6, - "fail_reason": null - }, - { - "layer": "C3_ENTRYPOINTS", - "status": "hit", - "hit_count": 3, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "router": 0, - "symbol_resolution": 0, - "retrieval_total": 181, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 48, - "C0_SOURCE_CHUNKS": 21, - "C4_SEMANTIC_ROLES": 18, - "C2_DEPENDENCY_GRAPH": 60, - "C3_ENTRYPOINTS": 11 - }, - "merge_rank": 20, - "prompt_build": 0, - "llm_call": 5294 - }, - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 797, - "evidence_rows": 12, - "evidence_chars": 7130 - }, - "evidence_summary": [ - { - "layer": "C1_SYMBOL_CATALOG", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "count": 6, - "unique_paths": 2 - }, - { - "layer": "C3_ENTRYPOINTS", - "count": 3, - "unique_paths": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 1, - "unique_paths": 1 - } - ], - "prompt_template_id": "intent_code_qa_explain_ru_v1", - "system_prompt_version": "v1" - }, - "router": { - "conversation_mode": "START", - "keyword_hints": [ - "RuntimeManager" - ], - "path_scope": [] - }, - "llm": { - "used_evidence_count": 12, - "missing_evidence_reason": null - } - }, - "run_info": { - "case_id": "plba-fullchain-explain-runtime-manager", - "mode": "full_chain", - "run_started_at": "2026-03-12T12:08:55", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - }, - "input_request": { - "text": "Объясни как работает класс RuntimeManager", - "normalized_query": "Объясни как работает класс RuntimeManager" - }, - "steps": [ - { - "step": "intent_router", - "input": { - "query": "Объясни как работает класс RuntimeManager" - }, - "output": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Объясни как работает класс RuntimeManager" - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "RuntimeManager" - ], - "keyword_hints": [ - "RuntimeManager" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "timings_ms": { - "router": 0 - } - } - }, - { - "step": "retrieval", - "input": { - "query": "Объясни как работает класс RuntimeManager" - }, - "output": { - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "RuntimeManager", - "alternatives": [ - "RuntimeManager" - ], - "confidence": 0.99 - }, - "rag_count": 12, - "rag_rows": [ - { - "path": "src/app_runtime/core/runtime.py", - "content": "class RuntimeManager\nRuntimeManager", - "layer": "C1_SYMBOL_CATALOG", - "title": "RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "7e4a9381328c5803bbc6179458612fc4e947d928aa7bf8b4b2bebb2c8592f758", - "qname": "RuntimeManager", - "kind": "class", - "signature": "RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.core.runtime", - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests manager\n- orchestrates role-like calls (4)\n- reads and writes state attributes\n- participates in dataflow slices (50)", - "layer": "C4_SEMANTIC_ROLES", - "title": "RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 43, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "7e4a9381328c5803bbc6179458612fc4e947d928aa7bf8b4b2bebb2c8592f758", - "symbol_name": "RuntimeManager", - "qname": "RuntimeManager", - "role": "pipeline_stage", - "confidence": 0.67, - "dataflow_participation": 50, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.stop", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 25, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d", - "dst_ref": "ControlPlaneService.stop", - "resolution": "resolved", - "slice_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.stop" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._stop_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 51, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a", - "dst_ref": "ControlPlaneService._stop_async", - "resolution": "resolved", - "slice_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._stop_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.register_channel", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 17, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957", - "dst_ref": "ControlPlaneService.register_channel", - "resolution": "resolved", - "slice_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.register_channel" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.start", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 20, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154", - "dst_ref": "ControlPlaneService.start", - "resolution": "resolved", - "slice_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.start" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._start_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 47, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517", - "dst_ref": "ControlPlaneService._start_async", - "resolution": "resolved", - "slice_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._start_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager.add_config_file", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 32, - "span_end": 52, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "a23b8a11ebdb12708b60c96ea12a69f7f042082f1adfddd572444e246d81d167", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "57ffbd4f0d9fdf3507c2b8624312ce211f3d02fdf86a57a8ec90778d8a7b498d", - "dst_ref": "RuntimeManager.add_config_file", - "resolution": "resolved", - "slice_id": "a23b8a11ebdb12708b60c96ea12a69f7f042082f1adfddd572444e246d81d167", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager.add_config_file" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "57ffbd4f0d9fdf3507c2b8624312ce211f3d02fdf86a57a8ec90778d8a7b498d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "class RuntimeManager:\n ACTION_TIMEOUT_SECONDS = 10.0\n ACTION_POLL_INTERVAL_SECONDS = 0.05\n\n def __init__(\n self,\n configuration: ConfigurationManager | None = None,\n services: ServiceContainer | None = None,\n traces: TraceService | None = None,\n health: HealthRegistry | None = None,\n logs: LogManager | None = None,\n workers: WorkerSupervisor | None = None,\n control_plane: ControlPlaneService | None = None,\n ) -> None:\n self.configuration = configuration or ConfigurationManager()\n self.services = services or ServiceContainer()\n self.traces = traces or TraceService()\n self.health = health or HealthRegistry()\n self.logs = logs or LogManager()\n self.workers = workers or WorkerSupervisor()\n self.control_plane = control_plane or ControlPlaneService()\n self.registry = ModuleRegistry(self.services)\n self._started = False\n self._state = LifecycleState.IDLE\n self._core_registered = False\n self._workers_registered = False\n self._register_core_services()\n\n def register_module(self, module: ApplicationModule) -> None:\n self.registry.register_module(module.name)\n module.register(self.registry)\n\n def add_config_file(self, path: str) -> FileConfigProvider:\n provider = FileConfigProvider(path)\n self.configuration.add_provider(provider)\n return provider\n\n def start(self, *, start_control_plane: bool = True) -> None:\n if self._started:\n return\n self._state = LifecycleState.STARTING\n config = self.configuration.load()\n self.logs.apply_config(config)\n self._register_health_contributors()\n self._register_workers()\n self.workers.start()\n if start_control_plane:\n self.control_plane.start(self)\n self._started = True\n self._refresh_state()\n\n def stop(self, timeout: float = 30.0, force: bool = False, stop_control_plane: bool = True) -> None:\n if not self._started:\n return\n self._state = LifecycleState.STOPPING\n self.workers.stop(timeout=timeout, force=force)\n if stop_control_plane:\n self.control_plane.stop()\n self._started = False\n self._state = LifecycleState.STOPPED\n\n def status(self) -> dict[str, object]:\n self._refresh_state()\n return self.control_plane.snapshot(self)\n\n def current_health(self) -> HealthPayload:\n self._refresh_state()\n return self.health.payload(self._state, self.workers.healths())\n\n async def health_status(self) -> HealthPayload:\n return self.current_health()\n\n async def start_runtime(self) -> dict[str, object] | str:\n self._refresh_state()\n if self._started:\n return \"runtime already running\"\n if self._state == LifecycleState.STOPPING:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n\n self.start(start_control_plane=False)\n started = self._wait_for_state({LifecycleState.IDLE, LifecycleState.BUSY}, timeout=self.ACTION_TIMEOUT_SECONDS)\n if started:\n return self._action_detail(\"runtime started\", timed_out=False)\n return self._action_detail(\"runtime start is still in progress\", timed_out=True)\n\n async def stop_runtime(self) -> dict[str, object] | str:\n self._refresh_state()\n if not self._started:\n if self._state == LifecycleState.STOPPING:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n return \"runtime already stopped\"\n\n self._state = LifecycleState.STOPPING\n try:\n self.workers.stop(timeout=self.ACTION_TIMEOUT_SECONDS, force=False)\n except TimeoutError:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n\n self._started = False\n self._state = LifecycleState.STOPPED\n return self._action_detail(\"runtime stopped\", timed_out=False)\n\n async def runtime_status(self) -> str:\n self._refresh_state()\n return self._state.value\n\n def _register_core_services(self) -> None:\n if self._core_registered:\n return\n self.services.register(\"configuration\", self.configuration)\n self.services.register(\"traces\", self.traces)\n self.services.register(\"health\", self.health)\n self.services.register(\"logs\", self.logs)\n self.services.register(\"workers\", self.workers)\n self.services.register(\"control_plane\", self.control_plane)\n self._core_registered = True\n\n def _register_health_contributors(self) -> None:\n for contributor in self.registry.health_contributors:\n self.health.register(contributor)\n\n def _register_workers(self) -> None:\n if self._workers_registered:\n return\n for worker in self.registry.workers:\n self.workers.register(worker)\n self._workers_registered = True\n\n def _refresh_state(self) -> None:\n lifecycle = self.workers.lifecycle_state()\n\n if self._state == LifecycleState.STOPPING:\n if lifecycle == LifecycleState.STOPPED:\n self._started = False\n self._state = LifecycleState.STOPPED\n return\n\n if not self._started:\n if lifecycle == LifecycleState.STOPPED:\n self._state = LifecycleState.STOPPED\n return\n\n self._state = lifecycle\n\n def _wait_for_state(self, target_states: set[LifecycleState], *, timeout: float) -> bool:\n deadline = monotonic() + timeout\n while monotonic() < deadline:\n self._refresh_state()\n if self._state in target_states:\n return True\n sleep(self.ACTION_POLL_INTERVAL_SECONDS)\n self._refresh_state()\n return self._state in target_states\n\n def _action_detail(self, message: str, *, timed_out: bool) -> dict[str, object]:\n self._refresh_state()\n return {\n \"message\": message,\n \"state\": self._state.value,\n \"timed_out\": timed_out,\n \"workers\": self.workers.snapshot(),\n }", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/core/runtime.py:RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.core.runtime", - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ] - }, - "diagnostics": { - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C0_SOURCE_CHUNKS": "exact_path_fetch", - "C4_SEMANTIC_ROLES": "exact_path_fetch", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C3_ENTRYPOINTS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 8, - "C4_SEMANTIC_ROLES": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C3_ENTRYPOINTS": 6 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C4_SEMANTIC_ROLES": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C4_SEMANTIC_ROLES", - "query": "RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - }, - { - "layer": "C3_ENTRYPOINTS", - "query": "RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 1, - "candidates_after_filter": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 6, - "candidates_after_filter": 6 - }, - { - "layer": "C3_ENTRYPOINTS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 3, - "candidates_after_filter": 3 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "RuntimeManager", - "alternatives": [ - "RuntimeManager" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C4_SEMANTIC_ROLES", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 6, - "fail_reason": null - }, - { - "layer": "C3_ENTRYPOINTS", - "status": "hit", - "hit_count": 3, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "symbol_resolution": 0, - "retrieval_total": 181, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 48, - "C0_SOURCE_CHUNKS": 21, - "C4_SEMANTIC_ROLES": 18, - "C2_DEPENDENCY_GRAPH": 60, - "C3_ENTRYPOINTS": 11 - }, - "merge_rank": 20 - } - } - }, - { - "step": "llm_answer", - "input": { - "query": "Объясни как работает класс RuntimeManager", - "rag_count": 12 - }, - "output": { - "llm_answer": "## Назначение класса `RuntimeManager`\nКласс `RuntimeManager` является ключевым компонентом системы управления жизненным циклом приложения. Он отвечает за координацию работы различных модулей и сервисов приложения, обеспечивая централизованное управление состоянием и конфигурацией всех компонентов. Этот компонент выступает в качестве управляющего слоя, обеспечивающего синхронизацию и интеграцию различных частей архитектуры.\n\n## Ключевые зависимости\nКлючевыми зависимостями являются следующие компоненты:\n\n- **ConfigurationManager**: Менеджер конфигурации для настройки параметров приложения.\n- **ServiceContainer**: Контейнер служб, содержащий различные сервисы и модули приложения.\n- **TraceService**: Сервис трассировки, предназначенный для отслеживания выполнения действий и операций внутри приложения.\n- **HealthRegistry**: Реестр состояния здоровья приложения, позволяющий отслеживать состояние различных его частей.\n- **LogManager**: Менеджер логирования, обеспечивающий сбор и хранение логов приложения.\n- **WorkerSupervisor**: Наблюдатель за рабочими процессами, управляющий их запуском и остановкой.\n- **ControlPlaneService**: Служба управления плоскостью контроля, отвечающая за координацию рабочих процессов и мониторинг состояния приложения.\n\nВсе эти компоненты передаются конструктору класса при создании экземпляра `RuntimeManager`.\n\n## Поток данных или вызовов\nПроцесс работы `RuntimeManager` включает несколько ключевых этапов:\n\n1. **Инициализация и регистрация модулей** (`__init__()`):\n - При инициализации создается экземпляр `RuntimeManager`, которому передаются необходимые службы и параметры. В методе `__init__()` происходит регистрация модулей с помощью метода `_register_core_services()`. Это позволяет системе начать работу с предварительно зарегистрированными модулями и сервисами.\n \n2. **Регистрация модулей** (`register_module(module)`):\n - Метод `register_module` предназначен для регистрации новых модулей и обеспечения их интеграции в систему через модульный реестр `registry`.\n\n3. **Управление рабочим процессом**:\n - Класс управляет рабочим процессом приложений, следя за состоянием жизненного цикла (например, IDLE, RUNNING). Для этого используется атрибут `_state`, значение которого обновляется в зависимости от текущего состояния приложения.\n\n4. **Мониторинг и контроль**:\n - Через службу `ControlPlaneService` обеспечивается мониторинг и контроль над различными частями приложения, что позволяет своевременно реагировать на изменения в состоянии системы и корректно завершать рабочие процессы.\n\n## Важные детали реализации\n- **Настройки тайм-аутов и интервалов опроса**:\n - Константы `ACTION_TIMEOUT_SECONDS` и `ACTION_POLL_INTERVAL_SECONDS` задают временные интервалы для ожиданий и периодических проверок состояний.\n \n- **Использование декораторов**:\n - Методы `@property` используются для создания геттеров и сеттеров для доступа к внутренним атрибутам объекта, таким как `configuration`, `services`, `traces`, `health`, `logs`, `workers`, `control_plane` и т.д.\n\n- **Централизованная обработка ошибок и исключений**:\n - Хотя конкретный механизм обработки исключений напрямую не указан в представленном фрагменте кода, предполагается наличие соответствующего механизма, позволяющего эффективно обрабатывать ошибки и восстанавливаться после сбоев.\n\n## Осторожные выводы\nНа основании представленного контекста сложно точно определить весь цикл работы `RuntimeManager`, однако можно предположить, что он играет ключевую роль в управлении жизненным циклом и координацией взаимодействий между различными модулями и сервисами приложения. Полная картина поведения и взаимодействия классов требует дополнительного анализа исходного кода вне предоставленных контекстных слоев." - }, - "diagnostics": { - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 797, - "evidence_rows": 12, - "evidence_chars": 7130 - }, - "evidence_summary": [ - { - "layer": "C1_SYMBOL_CATALOG", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "count": 6, - "unique_paths": 2 - }, - { - "layer": "C3_ENTRYPOINTS", - "count": 3, - "unique_paths": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 1, - "unique_paths": 1 - } - ], - "prompt_template_id": "intent_code_qa_explain_ru_v1", - "system_prompt_version": "v1" - }, - "timings_ms": { - "prompt_build": 0, - "llm_call": 5294 - } - } - } - ] - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents/20260312_120855/full_chain_plba_code_subintents_plba-fullchain-explain-runtime-manager.md b/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents/20260312_120855/full_chain_plba_code_subintents_plba-fullchain-explain-runtime-manager.md deleted file mode 100644 index a5b16ac..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents/20260312_120855/full_chain_plba_code_subintents_plba-fullchain-explain-runtime-manager.md +++ /dev/null @@ -1,34 +0,0 @@ -# plba-fullchain-explain-runtime-manager - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_subintents.yaml -- runner: runtime -- mode: full_chain -- passed: True - -## Query -Объясни как работает класс RuntimeManager - -## Actual -{ - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 12, - "llm_answer": "## Назначение класса `RuntimeManager`\nКласс `RuntimeManager` является ключевым компонентом системы управления жизненным циклом приложения. Он отвечает за координацию работы различных модулей и сервисов приложения, обеспечивая централизованное управление состоянием и конфигурацией всех компонентов. Этот компонент выступает в качестве управляющего слоя, обеспечивающего синхронизацию и интеграцию различных частей архитектуры.\n\n## Ключевые зависимости\nКлючевыми зависимостями являются следующие компоненты:\n\n- **ConfigurationManager**: Менеджер конфигурации для настройки параметров приложения.\n- **ServiceContainer**: Контейнер служб, содержащий различные сервисы и модули приложения.\n- **TraceService**: Сервис трассировки, предназначенный для отслеживания выполнения действий и операций внутри приложения.\n- **HealthRegistry**: Реестр состояния здоровья приложения, позволяющий отслеживать состояние различных его частей.\n- **LogManager**: Менеджер логирования, обеспечивающий сбор и хранение логов приложения.\n- **WorkerSupervisor**: Наблюдатель за рабочими процессами, управляющий их запуском и остановкой.\n- **ControlPlaneService**: Служба управления плоскостью контроля, отвечающая за координацию рабочих процессов и мониторинг состояния приложения.\n\nВсе эти компоненты передаются конструктору класса при создании экземпляра `RuntimeManager`.\n\n## Поток данных или вызовов\nПроцесс работы `RuntimeManager` включает несколько ключевых этапов:\n\n1. **Инициализация и регистрация модулей** (`__init__()`):\n - При инициализации создается экземпляр `RuntimeManager`, которому передаются необходимые службы и параметры. В методе `__init__()` происходит регистрация модулей с помощью метода `_register_core_services()`. Это позволяет системе начать работу с предварительно зарегистрированными модулями и сервисами.\n \n2. **Регистрация модулей** (`register_module(module)`):\n - Метод `register_module` предназначен для регистрации новых модулей и обеспечения их интеграции в систему через модульный реестр `registry`.\n\n3. **Управление рабочим процессом**:\n - Класс управляет рабочим процессом приложений, следя за состоянием жизненного цикла (например, IDLE, RUNNING). Для этого используется атрибут `_state`, значение которого обновляется в зависимости от текущего состояния приложения.\n\n4. **Мониторинг и контроль**:\n - Через службу `ControlPlaneService` обеспечивается мониторинг и контроль над различными частями приложения, что позволяет своевременно реагировать на изменения в состоянии системы и корректно завершать рабочие процессы.\n\n## Важные детали реализации\n- **Настройки тайм-аутов и интервалов опроса**:\n - Константы `ACTION_TIMEOUT_SECONDS` и `ACTION_POLL_INTERVAL_SECONDS` задают временные интервалы для ожиданий и периодических проверок состояний.\n \n- **Использование декораторов**:\n - Методы `@property` используются для создания геттеров и сеттеров для доступа к внутренним атрибутам объекта, таким как `configuration`, `services`, `traces`, `health`, `logs`, `workers`, `control_plane` и т.д.\n\n- **Централизованная обработка ошибок и исключений**:\n - Хотя конкретный механизм обработки исключений напрямую не указан в представленном фрагменте кода, предполагается наличие соответствующего механизма, позволяющего эффективно обрабатывать ошибки и восстанавливаться после сбоев.\n\n## Осторожные выводы\nНа основании представленного контекста сложно точно определить весь цикл работы `RuntimeManager`, однако можно предположить, что он играет ключевую роль в управлении жизненным циклом и координацией взаимодействий между различными модулями и сервисами приложения. Полная картина поведения и взаимодействия классов требует дополнительного анализа исходного кода вне предоставленных контекстных слоев.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "RuntimeManager" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] -} - -## Mismatches -- none \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents/20260312_120855/full_chain_plba_code_subintents_plba-fullchain-find-entrypoints.json b/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents/20260312_120855/full_chain_plba_code_subintents_plba-fullchain-find-entrypoints.json deleted file mode 100644 index 2fa1e2c..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents/20260312_120855/full_chain_plba_code_subintents_plba-fullchain-find-entrypoints.json +++ /dev/null @@ -1,1196 +0,0 @@ -{ - "case_id": "plba-fullchain-find-entrypoints", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_subintents.yaml", - "runner": "runtime", - "mode": "full_chain", - "actual": { - "intent": "CODE_QA", - "sub_intent": "FIND_ENTRYPOINTS", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 9, - "llm_answer": "## Финальный ответ:\n\nНа основании предоставленного контекста RAG, были найдены следующие **точки входа** (entrypoints) и их роли в приложении:\n\n### 1. `src/app_runtime/control/http_app.py` \n**app.post**: \n*Файл:* `http_app.py`, *сущность:* FastAPI приложение (`app`), метод:`post`. \n*Роль:* Обрабатывает HTTP POST-запросы.\n\n### 2. `src/app_runtime/control/http_app.py` \n**app.get**: \n*Файл:* `http_app.py`, *сущность:* FastAPI приложение (`app`), метод:`get`. \n*Роль:* Обрабатывает HTTP GET-запросы.\n\nЭти две точки являются основными точками входа для обработки HTTP запросов в приложении с использованием фреймворка FastAPI.\n\n---\n\nОстальные фрагменты информации касаются следующих аспектов приложения:\n\n- `src/app_runtime/workflow/contracts/result.py`: содержит класс `StepResult`, связанный с результатом выполнения шагов процесса (успешное завершение, статус).\n- `src/app_runtime/config/__init__.py`: импортирует классы для загрузки конфигураций из файлов.\n\nОднако они не являются точками входа, а представляют собой поддержку основной логики приложения. \n\nТаким образом, наиболее вероятными и важными точками входа являются методы `app.post` и `app.get` внутри файла `http_app.py`.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [], - "layers": [ - "C3_ENTRYPOINTS", - "C0_SOURCE_CHUNKS" - ] - }, - "passed": true, - "mismatches": [], - "details": { - "case_id": "plba-fullchain-find-entrypoints", - "text": "Найди точки входа в коде", - "mode": "full_chain", - "run_started_at": "2026-03-12T12:08:55", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Найди точки входа в коде", - "symbol_resolution": { - "status": "not_requested", - "resolved_symbol": null, - "alternatives": [], - "confidence": 0.0 - }, - "rag_count": 9, - "rag_rows": [ - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/contracts/result.py", - "content": "class StepResult:\n transition: str = \"success\"\n updates: dict[str, Any] = field(default_factory=dict)\n status: str = \"completed\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/workflow/contracts/result.py:StepResult", - "span_start": 8, - "span_end": 11, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.workflow.contracts.result", - "is_test": false, - "blob_sha": "6e57dbfe22873f097f11228a26cffa415440a43b68a737b220906461cd86c353", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/config/__init__.py", - "content": "from app_runtime.config.file_loader import ConfigFileLoader\nfrom app_runtime.config.providers import FileConfigProvider\n\n__all__ = [\"ConfigFileLoader\", \"FileConfigProvider\"]", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/config/__init__.py:1-4", - "span_start": 1, - "span_end": 4, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.app_runtime.config.__init__", - "is_test": false, - "blob_sha": "612918029820a2a983330ec92256142b55b9de4bdf3399ece18e2a02dbad9729", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/__init__.py", - "content": "__all__: list[str] = []", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/__init__.py:1-1", - "span_start": 1, - "span_end": 1, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.app_runtime.__init__", - "is_test": false, - "blob_sha": "8eea9df4f6d7b38ca0e39ccc27b04700e3d08dbeec8046d613d22706d19985fa", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/config/file_loader.py", - "content": "class ConfigFileLoader:\n def __init__(self, path: str | Path) -> None:\n self.path = Path(path)\n self.config: Any = None\n self.last_valid_config: Any = None\n self._last_seen_hash: str | None = None\n\n def read_text(self) -> str:\n return self.path.read_text(encoding=\"utf-8\")\n\n def parse(self, data: str) -> Any:\n suffix = self.path.suffix.lower()\n if suffix in {\".yml\", \".yaml\"}:\n return yaml.safe_load(data)\n return json.loads(data)\n\n def load_sync(self) -> Any:\n data = self.read_text()\n parsed = self.parse(data)\n self.config = parsed\n self.last_valid_config = parsed\n self._last_seen_hash = self._calculate_hash(data)\n return parsed\n\n def load_if_changed(self) -> tuple[bool, Any]:\n data = self.read_text()\n current_hash = self._calculate_hash(data)\n if current_hash == self._last_seen_hash:\n return False, self.config\n parsed = self.parse(data)\n self.config = parsed\n self.last_valid_config = parsed\n self._last_seen_hash = current_hash\n return True, parsed\n\n @staticmethod\n def _calculate_hash(data: str) -> str:\n return hashlib.sha256(data.encode(\"utf-8\")).hexdigest()", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/config/file_loader.py:ConfigFileLoader", - "span_start": 11, - "span_end": 48, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.config.file_loader", - "is_test": false, - "blob_sha": "1f19ffebde5e38e4be5a5d5a678059a0f36dedb8fb8b3e00ab395c67106a87ea", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/config/providers.py", - "content": "class FileConfigProvider(ConfigProvider):\n def __init__(self, path: str | Path) -> None:\n self._loader = ConfigFileLoader(path)\n\n @property\n def loader(self) -> ConfigFileLoader:\n return self._loader\n\n def load(self) -> dict[str, Any]:\n config = self._loader.load_sync()\n if not isinstance(config, dict):\n raise TypeError(\"Config root must be a mapping\")\n return dict(config)", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/config/providers.py:FileConfigProvider", - "span_start": 10, - "span_end": 22, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.config.providers", - "is_test": false, - "blob_sha": "8c53ca0122d6df6c5763bca15e99434bb4daebd5a618b8fc927e9ae90b022e64", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "class ControlActionSet:\n health: HealthHandler\n start: ActionHandler\n stop: ActionHandler\n status: ActionHandler", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/base.py:ControlActionSet", - "span_start": 14, - "span_end": 18, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.base", - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "llm_answer": "## Финальный ответ:\n\nНа основании предоставленного контекста RAG, были найдены следующие **точки входа** (entrypoints) и их роли в приложении:\n\n### 1. `src/app_runtime/control/http_app.py` \n**app.post**: \n*Файл:* `http_app.py`, *сущность:* FastAPI приложение (`app`), метод:`post`. \n*Роль:* Обрабатывает HTTP POST-запросы.\n\n### 2. `src/app_runtime/control/http_app.py` \n**app.get**: \n*Файл:* `http_app.py`, *сущность:* FastAPI приложение (`app`), метод:`get`. \n*Роль:* Обрабатывает HTTP GET-запросы.\n\nЭти две точки являются основными точками входа для обработки HTTP запросов в приложении с использованием фреймворка FastAPI.\n\n---\n\nОстальные фрагменты информации касаются следующих аспектов приложения:\n\n- `src/app_runtime/workflow/contracts/result.py`: содержит класс `StepResult`, связанный с результатом выполнения шагов процесса (успешное завершение, статус).\n- `src/app_runtime/config/__init__.py`: импортирует классы для загрузки конфигураций из файлов.\n\nОднако они не являются точками входа, а представляют собой поддержку основной логики приложения. \n\nТаким образом, наиболее вероятными и важными точками входа являются методы `app.post` и `app.get` внутри файла `http_app.py`.", - "summary": { - "router": { - "intent": "CODE_QA", - "sub_intent": "FIND_ENTRYPOINTS", - "confidence": null - }, - "retrieval": { - "profile": "code", - "layers_hit": [ - "C0_SOURCE_CHUNKS", - "C3_ENTRYPOINTS" - ], - "evidence_sufficient": true - }, - "llm": { - "answer_status": "answered", - "groundedness": "grounded" - } - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "FIND_ENTRYPOINTS", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C3_ENTRYPOINTS", - "C0_SOURCE_CHUNKS" - ], - "symbol_kind_hint": "unknown", - "symbol_candidates": [], - "keyword_hints": [], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "execution": { - "executed_layers": [ - "C3_ENTRYPOINTS", - "C0_SOURCE_CHUNKS" - ], - "retrieval_mode_by_layer": { - "C3_ENTRYPOINTS": "exact_path_fetch", - "C0_SOURCE_CHUNKS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C3_ENTRYPOINTS": 12, - "C0_SOURCE_CHUNKS": 6 - }, - "filters_by_layer": { - "C3_ENTRYPOINTS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C3_ENTRYPOINTS", - "query": "Найди точки входа в коде", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 12, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Найди точки входа в коде", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C3_ENTRYPOINTS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 3, - "candidates_after_filter": 3 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 6, - "candidates_after_filter": 6 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "not_requested", - "resolved_symbol": null, - "alternatives": [] - }, - "layers": [ - { - "layer": "C3_ENTRYPOINTS", - "status": "hit", - "hit_count": 3, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 6, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "router": 1, - "symbol_resolution": 0, - "retrieval_total": 52, - "retrieval_by_layer": { - "C3_ENTRYPOINTS": 31, - "C0_SOURCE_CHUNKS": 20 - }, - "merge_rank": 0, - "prompt_build": 0, - "llm_call": 2323 - }, - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 458, - "evidence_rows": 9, - "evidence_chars": 2228 - }, - "evidence_summary": [ - { - "layer": "C3_ENTRYPOINTS", - "count": 3, - "unique_paths": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 6, - "unique_paths": 6 - } - ], - "prompt_template_id": "intent_code_qa_find_entrypoints_ru_v1", - "system_prompt_version": "v1" - }, - "router": { - "conversation_mode": "START", - "keyword_hints": [], - "path_scope": [] - }, - "llm": { - "used_evidence_count": 9, - "missing_evidence_reason": null - } - }, - "run_info": { - "case_id": "plba-fullchain-find-entrypoints", - "mode": "full_chain", - "run_started_at": "2026-03-12T12:08:55", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - }, - "input_request": { - "text": "Найди точки входа в коде", - "normalized_query": "Найди точки входа в коде" - }, - "steps": [ - { - "step": "intent_router", - "input": { - "query": "Найди точки входа в коде" - }, - "output": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Найди точки входа в коде" - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "FIND_ENTRYPOINTS", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C3_ENTRYPOINTS", - "C0_SOURCE_CHUNKS" - ], - "symbol_kind_hint": "unknown", - "symbol_candidates": [], - "keyword_hints": [], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "timings_ms": { - "router": 1 - } - } - }, - { - "step": "retrieval", - "input": { - "query": "Найди точки входа в коде" - }, - "output": { - "symbol_resolution": { - "status": "not_requested", - "resolved_symbol": null, - "alternatives": [], - "confidence": 0.0 - }, - "rag_count": 9, - "rag_rows": [ - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/contracts/result.py", - "content": "class StepResult:\n transition: str = \"success\"\n updates: dict[str, Any] = field(default_factory=dict)\n status: str = \"completed\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/workflow/contracts/result.py:StepResult", - "span_start": 8, - "span_end": 11, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.workflow.contracts.result", - "is_test": false, - "blob_sha": "6e57dbfe22873f097f11228a26cffa415440a43b68a737b220906461cd86c353", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/config/__init__.py", - "content": "from app_runtime.config.file_loader import ConfigFileLoader\nfrom app_runtime.config.providers import FileConfigProvider\n\n__all__ = [\"ConfigFileLoader\", \"FileConfigProvider\"]", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/config/__init__.py:1-4", - "span_start": 1, - "span_end": 4, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.app_runtime.config.__init__", - "is_test": false, - "blob_sha": "612918029820a2a983330ec92256142b55b9de4bdf3399ece18e2a02dbad9729", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/__init__.py", - "content": "__all__: list[str] = []", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/__init__.py:1-1", - "span_start": 1, - "span_end": 1, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.app_runtime.__init__", - "is_test": false, - "blob_sha": "8eea9df4f6d7b38ca0e39ccc27b04700e3d08dbeec8046d613d22706d19985fa", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/config/file_loader.py", - "content": "class ConfigFileLoader:\n def __init__(self, path: str | Path) -> None:\n self.path = Path(path)\n self.config: Any = None\n self.last_valid_config: Any = None\n self._last_seen_hash: str | None = None\n\n def read_text(self) -> str:\n return self.path.read_text(encoding=\"utf-8\")\n\n def parse(self, data: str) -> Any:\n suffix = self.path.suffix.lower()\n if suffix in {\".yml\", \".yaml\"}:\n return yaml.safe_load(data)\n return json.loads(data)\n\n def load_sync(self) -> Any:\n data = self.read_text()\n parsed = self.parse(data)\n self.config = parsed\n self.last_valid_config = parsed\n self._last_seen_hash = self._calculate_hash(data)\n return parsed\n\n def load_if_changed(self) -> tuple[bool, Any]:\n data = self.read_text()\n current_hash = self._calculate_hash(data)\n if current_hash == self._last_seen_hash:\n return False, self.config\n parsed = self.parse(data)\n self.config = parsed\n self.last_valid_config = parsed\n self._last_seen_hash = current_hash\n return True, parsed\n\n @staticmethod\n def _calculate_hash(data: str) -> str:\n return hashlib.sha256(data.encode(\"utf-8\")).hexdigest()", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/config/file_loader.py:ConfigFileLoader", - "span_start": 11, - "span_end": 48, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.config.file_loader", - "is_test": false, - "blob_sha": "1f19ffebde5e38e4be5a5d5a678059a0f36dedb8fb8b3e00ab395c67106a87ea", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/config/providers.py", - "content": "class FileConfigProvider(ConfigProvider):\n def __init__(self, path: str | Path) -> None:\n self._loader = ConfigFileLoader(path)\n\n @property\n def loader(self) -> ConfigFileLoader:\n return self._loader\n\n def load(self) -> dict[str, Any]:\n config = self._loader.load_sync()\n if not isinstance(config, dict):\n raise TypeError(\"Config root must be a mapping\")\n return dict(config)", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/config/providers.py:FileConfigProvider", - "span_start": 10, - "span_end": 22, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.config.providers", - "is_test": false, - "blob_sha": "8c53ca0122d6df6c5763bca15e99434bb4daebd5a618b8fc927e9ae90b022e64", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "class ControlActionSet:\n health: HealthHandler\n start: ActionHandler\n stop: ActionHandler\n status: ActionHandler", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/base.py:ControlActionSet", - "span_start": 14, - "span_end": 18, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.base", - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ] - }, - "diagnostics": { - "execution": { - "executed_layers": [ - "C3_ENTRYPOINTS", - "C0_SOURCE_CHUNKS" - ], - "retrieval_mode_by_layer": { - "C3_ENTRYPOINTS": "exact_path_fetch", - "C0_SOURCE_CHUNKS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C3_ENTRYPOINTS": 12, - "C0_SOURCE_CHUNKS": 6 - }, - "filters_by_layer": { - "C3_ENTRYPOINTS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C3_ENTRYPOINTS", - "query": "Найди точки входа в коде", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 12, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Найди точки входа в коде", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C3_ENTRYPOINTS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 3, - "candidates_after_filter": 3 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 6, - "candidates_after_filter": 6 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "not_requested", - "resolved_symbol": null, - "alternatives": [] - }, - "layers": [ - { - "layer": "C3_ENTRYPOINTS", - "status": "hit", - "hit_count": 3, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 6, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "symbol_resolution": 0, - "retrieval_total": 52, - "retrieval_by_layer": { - "C3_ENTRYPOINTS": 31, - "C0_SOURCE_CHUNKS": 20 - }, - "merge_rank": 0 - } - } - }, - { - "step": "llm_answer", - "input": { - "query": "Найди точки входа в коде", - "rag_count": 9 - }, - "output": { - "llm_answer": "## Финальный ответ:\n\nНа основании предоставленного контекста RAG, были найдены следующие **точки входа** (entrypoints) и их роли в приложении:\n\n### 1. `src/app_runtime/control/http_app.py` \n**app.post**: \n*Файл:* `http_app.py`, *сущность:* FastAPI приложение (`app`), метод:`post`. \n*Роль:* Обрабатывает HTTP POST-запросы.\n\n### 2. `src/app_runtime/control/http_app.py` \n**app.get**: \n*Файл:* `http_app.py`, *сущность:* FastAPI приложение (`app`), метод:`get`. \n*Роль:* Обрабатывает HTTP GET-запросы.\n\nЭти две точки являются основными точками входа для обработки HTTP запросов в приложении с использованием фреймворка FastAPI.\n\n---\n\nОстальные фрагменты информации касаются следующих аспектов приложения:\n\n- `src/app_runtime/workflow/contracts/result.py`: содержит класс `StepResult`, связанный с результатом выполнения шагов процесса (успешное завершение, статус).\n- `src/app_runtime/config/__init__.py`: импортирует классы для загрузки конфигураций из файлов.\n\nОднако они не являются точками входа, а представляют собой поддержку основной логики приложения. \n\nТаким образом, наиболее вероятными и важными точками входа являются методы `app.post` и `app.get` внутри файла `http_app.py`." - }, - "diagnostics": { - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 458, - "evidence_rows": 9, - "evidence_chars": 2228 - }, - "evidence_summary": [ - { - "layer": "C3_ENTRYPOINTS", - "count": 3, - "unique_paths": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 6, - "unique_paths": 6 - } - ], - "prompt_template_id": "intent_code_qa_find_entrypoints_ru_v1", - "system_prompt_version": "v1" - }, - "timings_ms": { - "prompt_build": 0, - "llm_call": 2323 - } - } - } - ] - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents/20260312_120855/full_chain_plba_code_subintents_plba-fullchain-find-entrypoints.md b/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents/20260312_120855/full_chain_plba_code_subintents_plba-fullchain-find-entrypoints.md deleted file mode 100644 index 11a58df..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents/20260312_120855/full_chain_plba_code_subintents_plba-fullchain-find-entrypoints.md +++ /dev/null @@ -1,29 +0,0 @@ -# plba-fullchain-find-entrypoints - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_subintents.yaml -- runner: runtime -- mode: full_chain -- passed: True - -## Query -Найди точки входа в коде - -## Actual -{ - "intent": "CODE_QA", - "sub_intent": "FIND_ENTRYPOINTS", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 9, - "llm_answer": "## Финальный ответ:\n\nНа основании предоставленного контекста RAG, были найдены следующие **точки входа** (entrypoints) и их роли в приложении:\n\n### 1. `src/app_runtime/control/http_app.py` \n**app.post**: \n*Файл:* `http_app.py`, *сущность:* FastAPI приложение (`app`), метод:`post`. \n*Роль:* Обрабатывает HTTP POST-запросы.\n\n### 2. `src/app_runtime/control/http_app.py` \n**app.get**: \n*Файл:* `http_app.py`, *сущность:* FastAPI приложение (`app`), метод:`get`. \n*Роль:* Обрабатывает HTTP GET-запросы.\n\nЭти две точки являются основными точками входа для обработки HTTP запросов в приложении с использованием фреймворка FastAPI.\n\n---\n\nОстальные фрагменты информации касаются следующих аспектов приложения:\n\n- `src/app_runtime/workflow/contracts/result.py`: содержит класс `StepResult`, связанный с результатом выполнения шагов процесса (успешное завершение, статус).\n- `src/app_runtime/config/__init__.py`: импортирует классы для загрузки конфигураций из файлов.\n\nОднако они не являются точками входа, а представляют собой поддержку основной логики приложения. \n\nТаким образом, наиболее вероятными и важными точками входа являются методы `app.post` и `app.get` внутри файла `http_app.py`.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [], - "layers": [ - "C3_ENTRYPOINTS", - "C0_SOURCE_CHUNKS" - ] -} - -## Mismatches -- none \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents/20260312_120855/full_chain_plba_code_subintents_plba-fullchain-find-tests-runtime-manager.json b/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents/20260312_120855/full_chain_plba_code_subintents_plba-fullchain-find-tests-runtime-manager.json deleted file mode 100644 index 76a73f0..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents/20260312_120855/full_chain_plba_code_subintents_plba-fullchain-find-tests-runtime-manager.json +++ /dev/null @@ -1,1879 +0,0 @@ -{ - "case_id": "plba-fullchain-find-tests-runtime-manager", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_subintents.yaml", - "runner": "runtime", - "mode": "full_chain", - "actual": { - "intent": "CODE_QA", - "sub_intent": "FIND_TESTS", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 16, - "llm_answer": "Прямые тесты для `RuntimeManager` найдены в следующих местах:\n\n1. **tests/test_runtime.py**:\n - `test_runtime_graceful_stop_waits_until_worker_finishes`: Проверяет корректность остановки (`stop`) объекта `RuntimeManager`, ожидание завершения работающего модуля и корректное изменение статуса на «остановлен» после вызова метода `stop`.\n - `test_runtime_runs_worker_routine_and_exposes_status`: Тестирует запуск рутины модуля, регистрацию модуля и получение статусной информации от менеджера выполнения.\n\nЭти тесты напрямую создают объект `RuntimeManager`, регистрируют модули и выполняют различные операции с ним (запуск, остановка, проверка состояния).\n\nТесты находятся в слое зависимости (`C2_DEPENDENCY_GRAPH`), а также имеют соответствующие реализации в исходном коде (`C0_SOURCE_CHUNKS`).\n\nОбщий вывод:\n- Прямые тесты для `RuntimeManager` существуют и расположены в файле `tests/test_runtime.py`. Они проверяют базовые функциональные возможности создания, регистрации модулей, запуска и остановки менеджера выполнения.\n- Косвенно объекты `RuntimeManager` используются и в других тестах (`tests/test_business_control_actions.py`), однако эти тесты являются менее конкретными по отношению к самому классу `RuntimeManager`.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "RuntimeManager" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ] - }, - "passed": true, - "mismatches": [], - "details": { - "case_id": "plba-fullchain-find-tests-runtime-manager", - "text": "Где тесты для RuntimeManager?", - "mode": "full_chain", - "run_started_at": "2026-03-12T12:08:55", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Где тесты для RuntimeManager?", - "symbol_resolution": { - "status": "not_found", - "resolved_symbol": null, - "alternatives": [ - "RuntimeManager" - ], - "confidence": 0.0 - }, - "rag_count": 16, - "rag_rows": [ - { - "path": "tests/test_runtime.py", - "content": "test_runtime_runs_worker_routine_and_exposes_status instantiates RuntimeManager", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_runtime_runs_worker_routine_and_exposes_status:instantiates", - "span_start": 209, - "span_end": 209, - "lexical_rank": 6, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "c397a308e7824ba9fe400a754c7e15e66ea6f058d7f5d3e82bb002bb78b509d2", - "edge_type": "instantiates", - "src_symbol_id": "1c767eb5ee08e84f45b18c8ed7531ec0ed73c63fb1594823569672db7b21e992", - "src_qname": "test_runtime_runs_worker_routine_and_exposes_status", - "dst_symbol_id": "aeadc039653807b0da1ca6e3cc1078ee61cfc510b28e7f9c2ec04c59da43cc8d", - "dst_ref": "RuntimeManager", - "resolution": "resolved", - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_runtime.py", - "content": "test_runtime_graceful_stop_waits_until_worker_finishes instantiates RuntimeManager", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_runtime_graceful_stop_waits_until_worker_finishes:instantiates", - "span_start": 229, - "span_end": 229, - "lexical_rank": 6, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "76b4701262ccaa0a7a41691407c4ebdb2ca74a2415d89f0a38ef0d4f608bda93", - "edge_type": "instantiates", - "src_symbol_id": "1076e788e4a03b10d7bc1313a8ad46caa170c13cc026c6e4de994af1a6ae57bf", - "src_qname": "test_runtime_graceful_stop_waits_until_worker_finishes", - "dst_symbol_id": "aeadc039653807b0da1ca6e3cc1078ee61cfc510b28e7f9c2ec04c59da43cc8d", - "dst_ref": "RuntimeManager", - "resolution": "resolved", - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "_build_runtime instantiates RuntimeManager", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "_build_runtime:instantiates", - "span_start": 155, - "span_end": 155, - "lexical_rank": 6, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "7eb254d564944bab6272757ee5ef688862bd321e6941e2495dc942e03b1c9a25", - "edge_type": "instantiates", - "src_symbol_id": "db94031d5245bf82be836a109b4584b43b8e83d37a0f318e03f6c8191896d469", - "src_qname": "_build_runtime", - "dst_symbol_id": "a1572ea8183dc0cd6ddbc74342bbde8c28cecfde37ad40b62feff09f8d103d11", - "dst_ref": "RuntimeManager", - "resolution": "resolved", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "test_worker_wakes_up_with_configured_interval instantiates RuntimeManager", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_worker_wakes_up_with_configured_interval:instantiates", - "span_start": 167, - "span_end": 167, - "lexical_rank": 6, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "189aafc4de0b79c688668f25f0c87166a127df26bd2215452014713b65ef281a", - "edge_type": "instantiates", - "src_symbol_id": "65f877f78191d65e6a752e41cedc70ebc784c266804a55c1c56440336e1f0d6e", - "src_qname": "test_worker_wakes_up_with_configured_interval", - "dst_symbol_id": "a1572ea8183dc0cd6ddbc74342bbde8c28cecfde37ad40b62feff09f8d103d11", - "dst_ref": "RuntimeManager", - "resolution": "resolved", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "test_actions_stop_busy_worker_after_timeout\n -> BlockingRoutine\n -> BlockingRoutine.__init__\n -> BlockingRoutine._started\n -> BlockingRoutine.run", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_actions_stop_busy_worker_after_timeout:dataflow_slice", - "span_start": 42, - "span_end": 238, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 5, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "8e7db3d2a9226f1c1d9942ac6373cfcafa0d2276758ddb8a3d3c455a3d58024d", - "edge_type": "dataflow_slice", - "src_symbol_id": "66392d3222421d9ba16eda3554940b16e7d5a6f33aa08c5738d35af2e32f1e4a", - "src_qname": "test_actions_stop_busy_worker_after_timeout", - "dst_symbol_id": "d9841bdbb69706c988ae7ae6adf89928dc4fae45943f74064f5382177034ba04", - "dst_ref": "BlockingRoutine.run", - "resolution": "resolved", - "slice_id": "8e7db3d2a9226f1c1d9942ac6373cfcafa0d2276758ddb8a3d3c455a3d58024d", - "root_symbol_id": "66392d3222421d9ba16eda3554940b16e7d5a6f33aa08c5738d35af2e32f1e4a", - "path_symbols": [ - "test_actions_stop_busy_worker_after_timeout", - "BlockingRoutine", - "BlockingRoutine.__init__", - "BlockingRoutine._started", - "BlockingRoutine.run" - ], - "path_symbol_ids": [ - "66392d3222421d9ba16eda3554940b16e7d5a6f33aa08c5738d35af2e32f1e4a", - "a3349c5bc65e4003a4bbd6a8dbb7a54c337e12d1aed930caa701b12e520f1e67", - "486deeed3043c6db985aef258e96ddc67aa53608e67a83962fbd2471f649ddf1", - "d9841bdbb69706c988ae7ae6adf89928dc4fae45943f74064f5382177034ba04" - ], - "path_edge_types": [ - "instantiates", - "writes_attr", - "reads_attr" - ], - "path_length": 5, - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "test_actions_stop_busy_worker_before_timeout\n -> BlockingRoutine\n -> BlockingRoutine.__init__\n -> BlockingRoutine._release\n -> BlockingRoutine.run", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_actions_stop_busy_worker_before_timeout:dataflow_slice", - "span_start": 43, - "span_end": 212, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 5, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "8bd726155ba387d3579763ee84dfd2f9a90bc917da88f3b2e89416ab5c1254d6", - "edge_type": "dataflow_slice", - "src_symbol_id": "a0bb116ca9d909c93a285667ae033fbd1859b2dad7cf34fcb44816393ef6909c", - "src_qname": "test_actions_stop_busy_worker_before_timeout", - "dst_symbol_id": "d9841bdbb69706c988ae7ae6adf89928dc4fae45943f74064f5382177034ba04", - "dst_ref": "BlockingRoutine.run", - "resolution": "resolved", - "slice_id": "8bd726155ba387d3579763ee84dfd2f9a90bc917da88f3b2e89416ab5c1254d6", - "root_symbol_id": "a0bb116ca9d909c93a285667ae033fbd1859b2dad7cf34fcb44816393ef6909c", - "path_symbols": [ - "test_actions_stop_busy_worker_before_timeout", - "BlockingRoutine", - "BlockingRoutine.__init__", - "BlockingRoutine._release", - "BlockingRoutine.run" - ], - "path_symbol_ids": [ - "a0bb116ca9d909c93a285667ae033fbd1859b2dad7cf34fcb44816393ef6909c", - "a3349c5bc65e4003a4bbd6a8dbb7a54c337e12d1aed930caa701b12e520f1e67", - "486deeed3043c6db985aef258e96ddc67aa53608e67a83962fbd2471f649ddf1", - "d9841bdbb69706c988ae7ae6adf89928dc4fae45943f74064f5382177034ba04" - ], - "path_edge_types": [ - "instantiates", - "writes_attr", - "reads_attr" - ], - "path_length": 5, - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_runtime.py", - "content": "def test_runtime_graceful_stop_waits_until_worker_finishes() -> None:\n started = Event()\n release = Event()\n runtime = RuntimeManager()\n runtime.register_module(BlockingModule(started, release))\n runtime.start()\n assert started.wait(timeout=1.0) is True\n assert runtime.status()[\"runtime\"][\"state\"] == \"busy\"\n\n stop_thread = Thread(target=runtime.stop, kwargs={\"timeout\": 1.0}, daemon=True)\n stop_thread.start()\n sleep(0.1)\n assert stop_thread.is_alive() is True\n\n release.set()\n stop_thread.join(timeout=1.0)\n assert stop_thread.is_alive() is False\n assert runtime.status()[\"runtime\"][\"state\"] == \"stopped\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_runtime.py:test_runtime_graceful_stop_waits_until_worker_finishes", - "span_start": 226, - "span_end": 243, - "lexical_rank": 6, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 8, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_runtime", - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_runtime.py", - "content": "def test_runtime_runs_worker_routine_and_exposes_status(tmp_path) -> None:\n config_path = tmp_path / \"config.yml\"\n config_path.write_text(\n \"\"\"\nplatform:\n workers: 1\nlog:\n version: 1\n disable_existing_loggers: false\n handlers:\n console:\n class: logging.StreamHandler\n root:\n level: INFO\n handlers: [console]\n\"\"\".strip(),\n encoding=\"utf-8\",\n )\n runtime = RuntimeManager()\n runtime.add_config_file(config_path)\n module = ExampleModule()\n runtime.register_module(module)\n\n runtime.start()\n sleep(0.2)\n status = runtime.status()\n runtime.stop()\n\n assert module.routine.processed == [{\"id\": 1}]\n assert status[\"modules\"] == [\"example\"]\n assert status[\"runtime\"][\"state\"] == \"idle\"\n assert status[\"health\"][\"status\"] == \"ok\"\n assert status[\"config\"] == {\"platform\": {\"workers\": 1}, \"log\": status[\"config\"][\"log\"]}", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_runtime.py:test_runtime_runs_worker_routine_and_exposes_status", - "span_start": 191, - "span_end": 223, - "lexical_rank": 6, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 7, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_runtime", - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "def _build_runtime(worker: Worker, *, control_timeout: int = 1) -> tuple[RuntimeManager, str]:\n runtime = RuntimeManager()\n channel = HttpControlChannel(host=\"127.0.0.1\", port=0, timeout=control_timeout)\n runtime.control_plane.register_channel(channel)\n runtime.register_module(WorkerModule(worker))\n runtime.start()\n return runtime, f\"http://127.0.0.1:{channel.port}\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:_build_runtime", - "span_start": 154, - "span_end": 160, - "lexical_rank": 6, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 6, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "def test_worker_wakes_up_with_configured_interval() -> None:\n interval = 0.15\n routine = IntervalRoutine()\n worker = ScenarioWorker(\"interval-worker\", routine, interval=interval)\n runtime = RuntimeManager()\n runtime.register_module(WorkerModule(worker))\n\n runtime.start()\n try:\n assert routine.wait_runs(count=3, timeout=2.0) is True\n finally:\n runtime.stop()\n\n deltas = routine.deltas()\n assert len(deltas) >= 2\n assert all(delta >= interval * 0.7 for delta in deltas[:2])", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:test_worker_wakes_up_with_configured_interval", - "span_start": 163, - "span_end": 178, - "lexical_rank": 6, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 7, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "class BlockingRoutine:\n def __init__(self, started: Event, release: Event) -> None:\n self._started = started\n self._release = release\n\n def run(self) -> None:\n self._started.set()\n self._release.wait(timeout=5.0)", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:BlockingRoutine", - "span_start": 40, - "span_end": 47, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 1, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "class ScenarioWorker(Worker):\n def __init__(self, name: str, routine: object, *, interval: float = 0.05) -> None:\n self._name = name\n self._routine = routine\n self._interval = interval\n self._thread: Thread | None = None\n self._stop_requested = Event()\n self._in_flight = 0\n self._runs = 0\n self._lock = Lock()\n\n @property\n def name(self) -> str:\n return self._name\n\n @property\n def critical(self) -> bool:\n return True\n\n def start(self) -> None:\n if self._thread is not None and self._thread.is_alive():\n return\n self._stop_requested.clear()\n self._thread = Thread(target=self._loop, name=f\"{self._name}-thread\", daemon=True)\n self._thread.start()\n\n def stop(self, force: bool = False) -> None:\n self._stop_requested.set()\n\n def health(self) -> WorkerHealth:\n return WorkerHealth(name=self.name, status=\"ok\", critical=True, meta={\"runs\": self._runs})\n\n def status(self) -> WorkerStatus:\n thread_alive = self._thread is not None and self._thread.is_alive()\n with self._lock:\n in_flight = self._in_flight\n runs = self._runs\n if not thread_alive:\n state = \"stopped\"\n elif self._stop_requested.is_set():\n state = \"stopping\"\n elif in_flight > 0:\n state = \"busy\"\n else:\n state = \"idle\"\n return WorkerStatus(name=self.name, state=state, in_flight=in_flight, meta={\"runs\": runs})\n\n def _loop(self) -> None:\n while not self._stop_requested.is_set():\n with self._lock:\n self._in_flight += 1\n try:\n self._routine.run()\n with self._lock:\n self._runs += 1\n finally:\n with self._lock:\n self._in_flight -= 1\n if self._stop_requested.is_set():\n return\n sleep(self._interval)", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:ScenarioWorker", - "span_start": 50, - "span_end": 110, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 2, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "class WorkerModule(ApplicationModule):\n def __init__(self, worker: Worker) -> None:\n self._worker = worker\n\n @property\n def name(self) -> str:\n return \"business-tests\"\n\n def register(self, registry: ModuleRegistry) -> None:\n registry.add_worker(self._worker)", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:WorkerModule", - "span_start": 113, - "span_end": 122, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 3, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "def _http_call_json(\n base_url: str,\n path: str,\n *,\n method: str = \"GET\",\n headers: dict[str, str] | None = None,\n) -> tuple[int, dict[str, object]]:\n request = Request(f\"{base_url}{path}\", method=method, headers=headers or {})\n try:\n with urlopen(request, timeout=15.0) as response:\n status = response.status\n body = response.read()\n except HTTPError as error:\n status = error.code\n body = error.read()\n payload = json.loads(body.decode(\"utf-8\"))\n return status, payload", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:_http_call_json", - "span_start": 125, - "span_end": 141, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 4, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "class IntervalRoutine:\n calls: list[float] = field(default_factory=list)\n _lock: Lock = field(default_factory=Lock)\n\n def run(self) -> None:\n with self._lock:\n self.calls.append(monotonic())\n\n def wait_runs(self, count: int, timeout: float) -> bool:\n deadline = monotonic() + timeout\n while monotonic() < deadline:\n with self._lock:\n if len(self.calls) >= count:\n return True\n sleep(0.01)\n return False\n\n def deltas(self) -> list[float]:\n with self._lock:\n return [self.calls[index + 1] - self.calls[index] for index in range(len(self.calls) - 1)]", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:IntervalRoutine", - "span_start": 18, - "span_end": 37, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "def _poll_until_stopped(base_url: str, timeout: float = 2.0) -> bool:\n deadline = monotonic() + timeout\n while monotonic() < deadline:\n _, payload = _http_call_json(base_url, \"/actions/status\")\n if payload.get(\"detail\") == \"stopped\":\n return True\n sleep(0.05)\n return False", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:_poll_until_stopped", - "span_start": 144, - "span_end": 151, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 5, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "llm_answer": "Прямые тесты для `RuntimeManager` найдены в следующих местах:\n\n1. **tests/test_runtime.py**:\n - `test_runtime_graceful_stop_waits_until_worker_finishes`: Проверяет корректность остановки (`stop`) объекта `RuntimeManager`, ожидание завершения работающего модуля и корректное изменение статуса на «остановлен» после вызова метода `stop`.\n - `test_runtime_runs_worker_routine_and_exposes_status`: Тестирует запуск рутины модуля, регистрацию модуля и получение статусной информации от менеджера выполнения.\n\nЭти тесты напрямую создают объект `RuntimeManager`, регистрируют модули и выполняют различные операции с ним (запуск, остановка, проверка состояния).\n\nТесты находятся в слое зависимости (`C2_DEPENDENCY_GRAPH`), а также имеют соответствующие реализации в исходном коде (`C0_SOURCE_CHUNKS`).\n\nОбщий вывод:\n- Прямые тесты для `RuntimeManager` существуют и расположены в файле `tests/test_runtime.py`. Они проверяют базовые функциональные возможности создания, регистрации модулей, запуска и остановки менеджера выполнения.\n- Косвенно объекты `RuntimeManager` используются и в других тестах (`tests/test_business_control_actions.py`), однако эти тесты являются менее конкретными по отношению к самому классу `RuntimeManager`.", - "summary": { - "router": { - "intent": "CODE_QA", - "sub_intent": "FIND_TESTS", - "confidence": null - }, - "retrieval": { - "profile": "code", - "layers_hit": [ - "C0_SOURCE_CHUNKS", - "C2_DEPENDENCY_GRAPH" - ], - "evidence_sufficient": true - }, - "llm": { - "answer_status": "answered", - "groundedness": "grounded" - } - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "FIND_TESTS", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "RuntimeManager" - ], - "keyword_hints": [ - "RuntimeManager" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**", - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "test_file_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "test_symbol_patterns": [ - "test_runtime_manager", - "TestRuntimeManager", - "RuntimeManager" - ], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C0_SOURCE_CHUNKS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C0_SOURCE_CHUNKS": 10 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [], - "include_globs": [ - "src", - "tests" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests" - ] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src", - "tests" - ], - "include_globs": [ - "src", - "tests" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests" - ] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src", - "tests" - ], - "include_globs": [ - "src", - "tests" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests" - ] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**", - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "Где тесты для RuntimeManager? test_runtime_manager TestRuntimeManager RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**", - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "top_k": 6, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Где тесты для RuntimeManager? test_runtime_manager TestRuntimeManager RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**", - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "top_k": 10, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [], - "normalized_include_globs": [ - "src", - "tests" - ], - "normalized_exclude_globs": [], - "normalized_prefer_globs": [ - "tests" - ], - "filter_stage": "post_rank", - "candidates_before_filter": 0, - "candidates_after_filter": 0 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src", - "tests" - ], - "normalized_include_globs": [ - "src", - "tests" - ], - "normalized_exclude_globs": [], - "normalized_prefer_globs": [ - "tests" - ], - "filter_stage": "post_rank", - "candidates_before_filter": 6, - "candidates_after_filter": 6 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src", - "tests" - ], - "normalized_include_globs": [ - "src", - "tests" - ], - "normalized_exclude_globs": [], - "normalized_prefer_globs": [ - "tests" - ], - "filter_stage": "post_rank", - "candidates_before_filter": 10, - "candidates_after_filter": 10 - } - ], - "fallback": { - "used": true, - "reason": "scope_relaxed_no_hits" - }, - "symbol_resolution": { - "status": "not_found", - "resolved_symbol": null, - "alternatives": [ - "RuntimeManager" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "miss", - "hit_count": 0, - "fail_reason": "scope_relaxed_no_hits" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 6, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 10, - "fail_reason": null - } - ] - }, - "constraint_violations": [ - { - "type": "LAYER_MISSING", - "severity": "warn", - "details": { - "layer": "C1_SYMBOL_CATALOG", - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ] - }, - "suggested_fix": "Increase top_k for this layer or relax constraints for retrieval." - } - ], - "timings_ms": { - "router": 1, - "symbol_resolution": 0, - "retrieval_total": 159, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 82, - "C2_DEPENDENCY_GRAPH": 60, - "C0_SOURCE_CHUNKS": 16 - }, - "merge_rank": 0, - "prompt_build": 0, - "llm_call": 1956 - }, - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 858, - "evidence_rows": 16, - "evidence_chars": 7086 - }, - "evidence_summary": [ - { - "layer": "C2_DEPENDENCY_GRAPH", - "count": 6, - "unique_paths": 2 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 10, - "unique_paths": 2 - } - ], - "prompt_template_id": "intent_code_qa_find_tests_ru_v1", - "system_prompt_version": "v1" - }, - "router": { - "conversation_mode": "START", - "keyword_hints": [ - "RuntimeManager" - ], - "path_scope": [] - }, - "llm": { - "used_evidence_count": 16, - "missing_evidence_reason": null - } - }, - "run_info": { - "case_id": "plba-fullchain-find-tests-runtime-manager", - "mode": "full_chain", - "run_started_at": "2026-03-12T12:08:55", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - }, - "input_request": { - "text": "Где тесты для RuntimeManager?", - "normalized_query": "Где тесты для RuntimeManager?" - }, - "steps": [ - { - "step": "intent_router", - "input": { - "query": "Где тесты для RuntimeManager?" - }, - "output": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Где тесты для RuntimeManager?" - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "FIND_TESTS", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "RuntimeManager" - ], - "keyword_hints": [ - "RuntimeManager" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**", - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "test_file_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "test_symbol_patterns": [ - "test_runtime_manager", - "TestRuntimeManager", - "RuntimeManager" - ], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "timings_ms": { - "router": 1 - } - } - }, - { - "step": "retrieval", - "input": { - "query": "Где тесты для RuntimeManager?" - }, - "output": { - "symbol_resolution": { - "status": "not_found", - "resolved_symbol": null, - "alternatives": [ - "RuntimeManager" - ], - "confidence": 0.0 - }, - "rag_count": 16, - "rag_rows": [ - { - "path": "tests/test_runtime.py", - "content": "test_runtime_runs_worker_routine_and_exposes_status instantiates RuntimeManager", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_runtime_runs_worker_routine_and_exposes_status:instantiates", - "span_start": 209, - "span_end": 209, - "lexical_rank": 6, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "c397a308e7824ba9fe400a754c7e15e66ea6f058d7f5d3e82bb002bb78b509d2", - "edge_type": "instantiates", - "src_symbol_id": "1c767eb5ee08e84f45b18c8ed7531ec0ed73c63fb1594823569672db7b21e992", - "src_qname": "test_runtime_runs_worker_routine_and_exposes_status", - "dst_symbol_id": "aeadc039653807b0da1ca6e3cc1078ee61cfc510b28e7f9c2ec04c59da43cc8d", - "dst_ref": "RuntimeManager", - "resolution": "resolved", - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_runtime.py", - "content": "test_runtime_graceful_stop_waits_until_worker_finishes instantiates RuntimeManager", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_runtime_graceful_stop_waits_until_worker_finishes:instantiates", - "span_start": 229, - "span_end": 229, - "lexical_rank": 6, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "76b4701262ccaa0a7a41691407c4ebdb2ca74a2415d89f0a38ef0d4f608bda93", - "edge_type": "instantiates", - "src_symbol_id": "1076e788e4a03b10d7bc1313a8ad46caa170c13cc026c6e4de994af1a6ae57bf", - "src_qname": "test_runtime_graceful_stop_waits_until_worker_finishes", - "dst_symbol_id": "aeadc039653807b0da1ca6e3cc1078ee61cfc510b28e7f9c2ec04c59da43cc8d", - "dst_ref": "RuntimeManager", - "resolution": "resolved", - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "_build_runtime instantiates RuntimeManager", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "_build_runtime:instantiates", - "span_start": 155, - "span_end": 155, - "lexical_rank": 6, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "7eb254d564944bab6272757ee5ef688862bd321e6941e2495dc942e03b1c9a25", - "edge_type": "instantiates", - "src_symbol_id": "db94031d5245bf82be836a109b4584b43b8e83d37a0f318e03f6c8191896d469", - "src_qname": "_build_runtime", - "dst_symbol_id": "a1572ea8183dc0cd6ddbc74342bbde8c28cecfde37ad40b62feff09f8d103d11", - "dst_ref": "RuntimeManager", - "resolution": "resolved", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "test_worker_wakes_up_with_configured_interval instantiates RuntimeManager", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_worker_wakes_up_with_configured_interval:instantiates", - "span_start": 167, - "span_end": 167, - "lexical_rank": 6, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "189aafc4de0b79c688668f25f0c87166a127df26bd2215452014713b65ef281a", - "edge_type": "instantiates", - "src_symbol_id": "65f877f78191d65e6a752e41cedc70ebc784c266804a55c1c56440336e1f0d6e", - "src_qname": "test_worker_wakes_up_with_configured_interval", - "dst_symbol_id": "a1572ea8183dc0cd6ddbc74342bbde8c28cecfde37ad40b62feff09f8d103d11", - "dst_ref": "RuntimeManager", - "resolution": "resolved", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "test_actions_stop_busy_worker_after_timeout\n -> BlockingRoutine\n -> BlockingRoutine.__init__\n -> BlockingRoutine._started\n -> BlockingRoutine.run", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_actions_stop_busy_worker_after_timeout:dataflow_slice", - "span_start": 42, - "span_end": 238, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 5, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "8e7db3d2a9226f1c1d9942ac6373cfcafa0d2276758ddb8a3d3c455a3d58024d", - "edge_type": "dataflow_slice", - "src_symbol_id": "66392d3222421d9ba16eda3554940b16e7d5a6f33aa08c5738d35af2e32f1e4a", - "src_qname": "test_actions_stop_busy_worker_after_timeout", - "dst_symbol_id": "d9841bdbb69706c988ae7ae6adf89928dc4fae45943f74064f5382177034ba04", - "dst_ref": "BlockingRoutine.run", - "resolution": "resolved", - "slice_id": "8e7db3d2a9226f1c1d9942ac6373cfcafa0d2276758ddb8a3d3c455a3d58024d", - "root_symbol_id": "66392d3222421d9ba16eda3554940b16e7d5a6f33aa08c5738d35af2e32f1e4a", - "path_symbols": [ - "test_actions_stop_busy_worker_after_timeout", - "BlockingRoutine", - "BlockingRoutine.__init__", - "BlockingRoutine._started", - "BlockingRoutine.run" - ], - "path_symbol_ids": [ - "66392d3222421d9ba16eda3554940b16e7d5a6f33aa08c5738d35af2e32f1e4a", - "a3349c5bc65e4003a4bbd6a8dbb7a54c337e12d1aed930caa701b12e520f1e67", - "486deeed3043c6db985aef258e96ddc67aa53608e67a83962fbd2471f649ddf1", - "d9841bdbb69706c988ae7ae6adf89928dc4fae45943f74064f5382177034ba04" - ], - "path_edge_types": [ - "instantiates", - "writes_attr", - "reads_attr" - ], - "path_length": 5, - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "test_actions_stop_busy_worker_before_timeout\n -> BlockingRoutine\n -> BlockingRoutine.__init__\n -> BlockingRoutine._release\n -> BlockingRoutine.run", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_actions_stop_busy_worker_before_timeout:dataflow_slice", - "span_start": 43, - "span_end": 212, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 5, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "8bd726155ba387d3579763ee84dfd2f9a90bc917da88f3b2e89416ab5c1254d6", - "edge_type": "dataflow_slice", - "src_symbol_id": "a0bb116ca9d909c93a285667ae033fbd1859b2dad7cf34fcb44816393ef6909c", - "src_qname": "test_actions_stop_busy_worker_before_timeout", - "dst_symbol_id": "d9841bdbb69706c988ae7ae6adf89928dc4fae45943f74064f5382177034ba04", - "dst_ref": "BlockingRoutine.run", - "resolution": "resolved", - "slice_id": "8bd726155ba387d3579763ee84dfd2f9a90bc917da88f3b2e89416ab5c1254d6", - "root_symbol_id": "a0bb116ca9d909c93a285667ae033fbd1859b2dad7cf34fcb44816393ef6909c", - "path_symbols": [ - "test_actions_stop_busy_worker_before_timeout", - "BlockingRoutine", - "BlockingRoutine.__init__", - "BlockingRoutine._release", - "BlockingRoutine.run" - ], - "path_symbol_ids": [ - "a0bb116ca9d909c93a285667ae033fbd1859b2dad7cf34fcb44816393ef6909c", - "a3349c5bc65e4003a4bbd6a8dbb7a54c337e12d1aed930caa701b12e520f1e67", - "486deeed3043c6db985aef258e96ddc67aa53608e67a83962fbd2471f649ddf1", - "d9841bdbb69706c988ae7ae6adf89928dc4fae45943f74064f5382177034ba04" - ], - "path_edge_types": [ - "instantiates", - "writes_attr", - "reads_attr" - ], - "path_length": 5, - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_runtime.py", - "content": "def test_runtime_graceful_stop_waits_until_worker_finishes() -> None:\n started = Event()\n release = Event()\n runtime = RuntimeManager()\n runtime.register_module(BlockingModule(started, release))\n runtime.start()\n assert started.wait(timeout=1.0) is True\n assert runtime.status()[\"runtime\"][\"state\"] == \"busy\"\n\n stop_thread = Thread(target=runtime.stop, kwargs={\"timeout\": 1.0}, daemon=True)\n stop_thread.start()\n sleep(0.1)\n assert stop_thread.is_alive() is True\n\n release.set()\n stop_thread.join(timeout=1.0)\n assert stop_thread.is_alive() is False\n assert runtime.status()[\"runtime\"][\"state\"] == \"stopped\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_runtime.py:test_runtime_graceful_stop_waits_until_worker_finishes", - "span_start": 226, - "span_end": 243, - "lexical_rank": 6, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 8, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_runtime", - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_runtime.py", - "content": "def test_runtime_runs_worker_routine_and_exposes_status(tmp_path) -> None:\n config_path = tmp_path / \"config.yml\"\n config_path.write_text(\n \"\"\"\nplatform:\n workers: 1\nlog:\n version: 1\n disable_existing_loggers: false\n handlers:\n console:\n class: logging.StreamHandler\n root:\n level: INFO\n handlers: [console]\n\"\"\".strip(),\n encoding=\"utf-8\",\n )\n runtime = RuntimeManager()\n runtime.add_config_file(config_path)\n module = ExampleModule()\n runtime.register_module(module)\n\n runtime.start()\n sleep(0.2)\n status = runtime.status()\n runtime.stop()\n\n assert module.routine.processed == [{\"id\": 1}]\n assert status[\"modules\"] == [\"example\"]\n assert status[\"runtime\"][\"state\"] == \"idle\"\n assert status[\"health\"][\"status\"] == \"ok\"\n assert status[\"config\"] == {\"platform\": {\"workers\": 1}, \"log\": status[\"config\"][\"log\"]}", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_runtime.py:test_runtime_runs_worker_routine_and_exposes_status", - "span_start": 191, - "span_end": 223, - "lexical_rank": 6, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 7, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_runtime", - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "def _build_runtime(worker: Worker, *, control_timeout: int = 1) -> tuple[RuntimeManager, str]:\n runtime = RuntimeManager()\n channel = HttpControlChannel(host=\"127.0.0.1\", port=0, timeout=control_timeout)\n runtime.control_plane.register_channel(channel)\n runtime.register_module(WorkerModule(worker))\n runtime.start()\n return runtime, f\"http://127.0.0.1:{channel.port}\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:_build_runtime", - "span_start": 154, - "span_end": 160, - "lexical_rank": 6, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 6, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "def test_worker_wakes_up_with_configured_interval() -> None:\n interval = 0.15\n routine = IntervalRoutine()\n worker = ScenarioWorker(\"interval-worker\", routine, interval=interval)\n runtime = RuntimeManager()\n runtime.register_module(WorkerModule(worker))\n\n runtime.start()\n try:\n assert routine.wait_runs(count=3, timeout=2.0) is True\n finally:\n runtime.stop()\n\n deltas = routine.deltas()\n assert len(deltas) >= 2\n assert all(delta >= interval * 0.7 for delta in deltas[:2])", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:test_worker_wakes_up_with_configured_interval", - "span_start": 163, - "span_end": 178, - "lexical_rank": 6, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 7, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "class BlockingRoutine:\n def __init__(self, started: Event, release: Event) -> None:\n self._started = started\n self._release = release\n\n def run(self) -> None:\n self._started.set()\n self._release.wait(timeout=5.0)", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:BlockingRoutine", - "span_start": 40, - "span_end": 47, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 1, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "class ScenarioWorker(Worker):\n def __init__(self, name: str, routine: object, *, interval: float = 0.05) -> None:\n self._name = name\n self._routine = routine\n self._interval = interval\n self._thread: Thread | None = None\n self._stop_requested = Event()\n self._in_flight = 0\n self._runs = 0\n self._lock = Lock()\n\n @property\n def name(self) -> str:\n return self._name\n\n @property\n def critical(self) -> bool:\n return True\n\n def start(self) -> None:\n if self._thread is not None and self._thread.is_alive():\n return\n self._stop_requested.clear()\n self._thread = Thread(target=self._loop, name=f\"{self._name}-thread\", daemon=True)\n self._thread.start()\n\n def stop(self, force: bool = False) -> None:\n self._stop_requested.set()\n\n def health(self) -> WorkerHealth:\n return WorkerHealth(name=self.name, status=\"ok\", critical=True, meta={\"runs\": self._runs})\n\n def status(self) -> WorkerStatus:\n thread_alive = self._thread is not None and self._thread.is_alive()\n with self._lock:\n in_flight = self._in_flight\n runs = self._runs\n if not thread_alive:\n state = \"stopped\"\n elif self._stop_requested.is_set():\n state = \"stopping\"\n elif in_flight > 0:\n state = \"busy\"\n else:\n state = \"idle\"\n return WorkerStatus(name=self.name, state=state, in_flight=in_flight, meta={\"runs\": runs})\n\n def _loop(self) -> None:\n while not self._stop_requested.is_set():\n with self._lock:\n self._in_flight += 1\n try:\n self._routine.run()\n with self._lock:\n self._runs += 1\n finally:\n with self._lock:\n self._in_flight -= 1\n if self._stop_requested.is_set():\n return\n sleep(self._interval)", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:ScenarioWorker", - "span_start": 50, - "span_end": 110, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 2, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "class WorkerModule(ApplicationModule):\n def __init__(self, worker: Worker) -> None:\n self._worker = worker\n\n @property\n def name(self) -> str:\n return \"business-tests\"\n\n def register(self, registry: ModuleRegistry) -> None:\n registry.add_worker(self._worker)", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:WorkerModule", - "span_start": 113, - "span_end": 122, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 3, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "def _http_call_json(\n base_url: str,\n path: str,\n *,\n method: str = \"GET\",\n headers: dict[str, str] | None = None,\n) -> tuple[int, dict[str, object]]:\n request = Request(f\"{base_url}{path}\", method=method, headers=headers or {})\n try:\n with urlopen(request, timeout=15.0) as response:\n status = response.status\n body = response.read()\n except HTTPError as error:\n status = error.code\n body = error.read()\n payload = json.loads(body.decode(\"utf-8\"))\n return status, payload", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:_http_call_json", - "span_start": 125, - "span_end": 141, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 4, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "class IntervalRoutine:\n calls: list[float] = field(default_factory=list)\n _lock: Lock = field(default_factory=Lock)\n\n def run(self) -> None:\n with self._lock:\n self.calls.append(monotonic())\n\n def wait_runs(self, count: int, timeout: float) -> bool:\n deadline = monotonic() + timeout\n while monotonic() < deadline:\n with self._lock:\n if len(self.calls) >= count:\n return True\n sleep(0.01)\n return False\n\n def deltas(self) -> list[float]:\n with self._lock:\n return [self.calls[index + 1] - self.calls[index] for index in range(len(self.calls) - 1)]", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:IntervalRoutine", - "span_start": 18, - "span_end": 37, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "def _poll_until_stopped(base_url: str, timeout: float = 2.0) -> bool:\n deadline = monotonic() + timeout\n while monotonic() < deadline:\n _, payload = _http_call_json(base_url, \"/actions/status\")\n if payload.get(\"detail\") == \"stopped\":\n return True\n sleep(0.05)\n return False", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:_poll_until_stopped", - "span_start": 144, - "span_end": 151, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 5, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ] - }, - "diagnostics": { - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C0_SOURCE_CHUNKS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C0_SOURCE_CHUNKS": 10 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [], - "include_globs": [ - "src", - "tests" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests" - ] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src", - "tests" - ], - "include_globs": [ - "src", - "tests" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests" - ] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src", - "tests" - ], - "include_globs": [ - "src", - "tests" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests" - ] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**", - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "Где тесты для RuntimeManager? test_runtime_manager TestRuntimeManager RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**", - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "top_k": 6, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Где тесты для RuntimeManager? test_runtime_manager TestRuntimeManager RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**", - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "top_k": 10, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [], - "normalized_include_globs": [ - "src", - "tests" - ], - "normalized_exclude_globs": [], - "normalized_prefer_globs": [ - "tests" - ], - "filter_stage": "post_rank", - "candidates_before_filter": 0, - "candidates_after_filter": 0 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src", - "tests" - ], - "normalized_include_globs": [ - "src", - "tests" - ], - "normalized_exclude_globs": [], - "normalized_prefer_globs": [ - "tests" - ], - "filter_stage": "post_rank", - "candidates_before_filter": 6, - "candidates_after_filter": 6 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src", - "tests" - ], - "normalized_include_globs": [ - "src", - "tests" - ], - "normalized_exclude_globs": [], - "normalized_prefer_globs": [ - "tests" - ], - "filter_stage": "post_rank", - "candidates_before_filter": 10, - "candidates_after_filter": 10 - } - ], - "fallback": { - "used": true, - "reason": "scope_relaxed_no_hits" - }, - "symbol_resolution": { - "status": "not_found", - "resolved_symbol": null, - "alternatives": [ - "RuntimeManager" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "miss", - "hit_count": 0, - "fail_reason": "scope_relaxed_no_hits" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 6, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 10, - "fail_reason": null - } - ] - }, - "constraint_violations": [ - { - "type": "LAYER_MISSING", - "severity": "warn", - "details": { - "layer": "C1_SYMBOL_CATALOG", - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ] - }, - "suggested_fix": "Increase top_k for this layer or relax constraints for retrieval." - } - ], - "timings_ms": { - "symbol_resolution": 0, - "retrieval_total": 159, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 82, - "C2_DEPENDENCY_GRAPH": 60, - "C0_SOURCE_CHUNKS": 16 - }, - "merge_rank": 0 - } - } - }, - { - "step": "llm_answer", - "input": { - "query": "Где тесты для RuntimeManager?", - "rag_count": 16 - }, - "output": { - "llm_answer": "Прямые тесты для `RuntimeManager` найдены в следующих местах:\n\n1. **tests/test_runtime.py**:\n - `test_runtime_graceful_stop_waits_until_worker_finishes`: Проверяет корректность остановки (`stop`) объекта `RuntimeManager`, ожидание завершения работающего модуля и корректное изменение статуса на «остановлен» после вызова метода `stop`.\n - `test_runtime_runs_worker_routine_and_exposes_status`: Тестирует запуск рутины модуля, регистрацию модуля и получение статусной информации от менеджера выполнения.\n\nЭти тесты напрямую создают объект `RuntimeManager`, регистрируют модули и выполняют различные операции с ним (запуск, остановка, проверка состояния).\n\nТесты находятся в слое зависимости (`C2_DEPENDENCY_GRAPH`), а также имеют соответствующие реализации в исходном коде (`C0_SOURCE_CHUNKS`).\n\nОбщий вывод:\n- Прямые тесты для `RuntimeManager` существуют и расположены в файле `tests/test_runtime.py`. Они проверяют базовые функциональные возможности создания, регистрации модулей, запуска и остановки менеджера выполнения.\n- Косвенно объекты `RuntimeManager` используются и в других тестах (`tests/test_business_control_actions.py`), однако эти тесты являются менее конкретными по отношению к самому классу `RuntimeManager`." - }, - "diagnostics": { - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 858, - "evidence_rows": 16, - "evidence_chars": 7086 - }, - "evidence_summary": [ - { - "layer": "C2_DEPENDENCY_GRAPH", - "count": 6, - "unique_paths": 2 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 10, - "unique_paths": 2 - } - ], - "prompt_template_id": "intent_code_qa_find_tests_ru_v1", - "system_prompt_version": "v1" - }, - "timings_ms": { - "prompt_build": 0, - "llm_call": 1956 - } - } - } - ] - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents/20260312_120855/full_chain_plba_code_subintents_plba-fullchain-find-tests-runtime-manager.md b/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents/20260312_120855/full_chain_plba_code_subintents_plba-fullchain-find-tests-runtime-manager.md deleted file mode 100644 index c0cba97..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents/20260312_120855/full_chain_plba_code_subintents_plba-fullchain-find-tests-runtime-manager.md +++ /dev/null @@ -1,32 +0,0 @@ -# plba-fullchain-find-tests-runtime-manager - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_subintents.yaml -- runner: runtime -- mode: full_chain -- passed: True - -## Query -Где тесты для RuntimeManager? - -## Actual -{ - "intent": "CODE_QA", - "sub_intent": "FIND_TESTS", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 16, - "llm_answer": "Прямые тесты для `RuntimeManager` найдены в следующих местах:\n\n1. **tests/test_runtime.py**:\n - `test_runtime_graceful_stop_waits_until_worker_finishes`: Проверяет корректность остановки (`stop`) объекта `RuntimeManager`, ожидание завершения работающего модуля и корректное изменение статуса на «остановлен» после вызова метода `stop`.\n - `test_runtime_runs_worker_routine_and_exposes_status`: Тестирует запуск рутины модуля, регистрацию модуля и получение статусной информации от менеджера выполнения.\n\nЭти тесты напрямую создают объект `RuntimeManager`, регистрируют модули и выполняют различные операции с ним (запуск, остановка, проверка состояния).\n\nТесты находятся в слое зависимости (`C2_DEPENDENCY_GRAPH`), а также имеют соответствующие реализации в исходном коде (`C0_SOURCE_CHUNKS`).\n\nОбщий вывод:\n- Прямые тесты для `RuntimeManager` существуют и расположены в файле `tests/test_runtime.py`. Они проверяют базовые функциональные возможности создания, регистрации модулей, запуска и остановки менеджера выполнения.\n- Косвенно объекты `RuntimeManager` используются и в других тестах (`tests/test_business_control_actions.py`), однако эти тесты являются менее конкретными по отношению к самому классу `RuntimeManager`.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "RuntimeManager" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ] -} - -## Mismatches -- none \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents/20260312_120855/full_chain_plba_code_subintents_plba-fullchain-open-file-runtime.json b/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents/20260312_120855/full_chain_plba_code_subintents_plba-fullchain-open-file-runtime.json deleted file mode 100644 index f7f7935..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents/20260312_120855/full_chain_plba_code_subintents_plba-fullchain-open-file-runtime.json +++ /dev/null @@ -1,492 +0,0 @@ -{ - "case_id": "plba-fullchain-open-file-runtime", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_subintents.yaml", - "runner": "runtime", - "mode": "full_chain", - "actual": { - "intent": "CODE_QA", - "sub_intent": "OPEN_FILE", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 1, - "llm_answer": "Файл `src/app_runtime/core/runtime.py` содержит определение класса `RuntimeManager`, являющегося ключевым компонентом системы управления выполнением приложений.\n\n## Важные сущности и их значение:\n\n- **Класс `RuntimeManager`:** Основной управляющий класс, инициализирующий различные сервисы и модули приложения.\n - Переменные класса:\n - `ACTION_TIMEOUT_SECONDS` и `ACTION_POLL_INTERVAL_SECONDS`: настройки тайм-аутов и интервалов опроса действий.\n - Метод `__init__`: Конструктор класса, принимающий различные компоненты инфраструктуры (конфигурации, службы, трассировки, здоровье, логирование, управление рабочими процессами и контрольная плоскость).\n - Метод `_register_core_services`: Регистрация основных сервисов внутри runtime менеджера.\n \nЭтот класс является точкой входа и основным управляющим элементом при запуске и управлении приложением, обеспечивая интеграцию различных компонентов и сервисов.", - "answer_mode": "answered", - "path_scope": [ - "src/app_runtime/core/runtime.py" - ], - "symbol_candidates": [], - "layers": [ - "C0_SOURCE_CHUNKS" - ] - }, - "passed": true, - "mismatches": [], - "details": { - "case_id": "plba-fullchain-open-file-runtime", - "text": "Открой файл src/app_runtime/core/runtime.py", - "mode": "full_chain", - "run_started_at": "2026-03-12T12:08:55", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Открой файл src/app_runtime/core/runtime.py", - "symbol_resolution": { - "status": "not_requested", - "resolved_symbol": null, - "alternatives": [], - "confidence": 0.0 - }, - "rag_count": 1, - "rag_rows": [ - { - "path": "src/app_runtime/core/runtime.py", - "content": "class RuntimeManager:\n ACTION_TIMEOUT_SECONDS = 10.0\n ACTION_POLL_INTERVAL_SECONDS = 0.05\n\n def __init__(\n self,\n configuration: ConfigurationManager | None = None,\n services: ServiceContainer | None = None,\n traces: TraceService | None = None,\n health: HealthRegistry | None = None,\n logs: LogManager | None = None,\n workers: WorkerSupervisor | None = None,\n control_plane: ControlPlaneService | None = None,\n ) -> None:\n self.configuration = configuration or ConfigurationManager()\n self.services = services or ServiceContainer()\n self.traces = traces or TraceService()\n self.health = health or HealthRegistry()\n self.logs = logs or LogManager()\n self.workers = workers or WorkerSupervisor()\n self.control_plane = control_plane or ControlPlaneService()\n self.registry = ModuleRegistry(self.services)\n self._started = False\n self._state = LifecycleState.IDLE\n self._core_registered = False\n self._workers_registered = False\n self._register_core_services()\n\n def register_module(self, module: ApplicationModule) -> None:\n self.registry.register_module(module.name)\n module.register(self.registry)\n\n def add_config_file(self, path: str) -> FileConfigProvider:\n provider = FileConfigProvider(path)\n self.configuration.add_provider(provider)\n return provider\n\n def start(self, *, start_control_plane: bool = True) -> None:\n if self._started:\n return\n self._state = LifecycleState.STARTING\n config = self.configuration.load()\n self.logs.apply_config(config)\n self._register_health_contributors()\n self._register_workers()\n self.workers.start()\n if start_control_plane:\n self.control_plane.start(self)\n self._started = True\n self._refresh_state()\n\n def stop(self, timeout: float = 30.0, force: bool = False, stop_control_plane: bool = True) -> None:\n if not self._started:\n return\n self._state = LifecycleState.STOPPING\n self.workers.stop(timeout=timeout, force=force)\n if stop_control_plane:\n self.control_plane.stop()\n self._started = False\n self._state = LifecycleState.STOPPED\n\n def status(self) -> dict[str, object]:\n self._refresh_state()\n return self.control_plane.snapshot(self)\n\n def current_health(self) -> HealthPayload:\n self._refresh_state()\n return self.health.payload(self._state, self.workers.healths())\n\n async def health_status(self) -> HealthPayload:\n return self.current_health()\n\n async def start_runtime(self) -> dict[str, object] | str:\n self._refresh_state()\n if self._started:\n return \"runtime already running\"\n if self._state == LifecycleState.STOPPING:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n\n self.start(start_control_plane=False)\n started = self._wait_for_state({LifecycleState.IDLE, LifecycleState.BUSY}, timeout=self.ACTION_TIMEOUT_SECONDS)\n if started:\n return self._action_detail(\"runtime started\", timed_out=False)\n return self._action_detail(\"runtime start is still in progress\", timed_out=True)\n\n async def stop_runtime(self) -> dict[str, object] | str:\n self._refresh_state()\n if not self._started:\n if self._state == LifecycleState.STOPPING:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n return \"runtime already stopped\"\n\n self._state = LifecycleState.STOPPING\n try:\n self.workers.stop(timeout=self.ACTION_TIMEOUT_SECONDS, force=False)\n except TimeoutError:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n\n self._started = False\n self._state = LifecycleState.STOPPED\n return self._action_detail(\"runtime stopped\", timed_out=False)\n\n async def runtime_status(self) -> str:\n self._refresh_state()\n return self._state.value\n\n def _register_core_services(self) -> None:\n if self._core_registered:\n return\n self.services.register(\"configuration\", self.configuration)\n self.services.register(\"traces\", self.traces)\n self.services.register(\"health\", self.health)\n self.services.register(\"logs\", self.logs)\n self.services.register(\"workers\", self.workers)\n self.services.register(\"control_plane\", self.control_plane)\n self._core_registered = True\n\n def _register_health_contributors(self) -> None:\n for contributor in self.registry.health_contributors:\n self.health.register(contributor)\n\n def _register_workers(self) -> None:\n if self._workers_registered:\n return\n for worker in self.registry.workers:\n self.workers.register(worker)\n self._workers_registered = True\n\n def _refresh_state(self) -> None:\n lifecycle = self.workers.lifecycle_state()\n\n if self._state == LifecycleState.STOPPING:\n if lifecycle == LifecycleState.STOPPED:\n self._started = False\n self._state = LifecycleState.STOPPED\n return\n\n if not self._started:\n if lifecycle == LifecycleState.STOPPED:\n self._state = LifecycleState.STOPPED\n return\n\n self._state = lifecycle\n\n def _wait_for_state(self, target_states: set[LifecycleState], *, timeout: float) -> bool:\n deadline = monotonic() + timeout\n while monotonic() < deadline:\n self._refresh_state()\n if self._state in target_states:\n return True\n sleep(self.ACTION_POLL_INTERVAL_SECONDS)\n self._refresh_state()\n return self._state in target_states\n\n def _action_detail(self, message: str, *, timed_out: bool) -> dict[str, object]:\n self._refresh_state()\n return {\n \"message\": message,\n \"state\": self._state.value,\n \"timed_out\": timed_out,\n \"workers\": self.workers.snapshot(),\n }", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/core/runtime.py:RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.core.runtime", - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "llm_answer": "Файл `src/app_runtime/core/runtime.py` содержит определение класса `RuntimeManager`, являющегося ключевым компонентом системы управления выполнением приложений.\n\n## Важные сущности и их значение:\n\n- **Класс `RuntimeManager`:** Основной управляющий класс, инициализирующий различные сервисы и модули приложения.\n - Переменные класса:\n - `ACTION_TIMEOUT_SECONDS` и `ACTION_POLL_INTERVAL_SECONDS`: настройки тайм-аутов и интервалов опроса действий.\n - Метод `__init__`: Конструктор класса, принимающий различные компоненты инфраструктуры (конфигурации, службы, трассировки, здоровье, логирование, управление рабочими процессами и контрольная плоскость).\n - Метод `_register_core_services`: Регистрация основных сервисов внутри runtime менеджера.\n \nЭтот класс является точкой входа и основным управляющим элементом при запуске и управлении приложением, обеспечивая интеграцию различных компонентов и сервисов.", - "summary": { - "router": { - "intent": "CODE_QA", - "sub_intent": "OPEN_FILE", - "confidence": null - }, - "retrieval": { - "profile": "code", - "layers_hit": [ - "C0_SOURCE_CHUNKS" - ], - "evidence_sufficient": true - }, - "llm": { - "answer_status": "answered", - "groundedness": "grounded" - } - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "OPEN_FILE", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C0_SOURCE_CHUNKS" - ], - "symbol_kind_hint": "unknown", - "symbol_candidates": [], - "keyword_hints": [], - "path_hints": [ - "src/app_runtime/core/runtime.py" - ], - "path_scope": [ - "src/app_runtime/core/runtime.py" - ], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/app_runtime/core/runtime.py" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": false, - "max_distance": 2, - "top_k": 5 - } - } - }, - "execution": { - "executed_layers": [ - "C0_SOURCE_CHUNKS" - ], - "retrieval_mode_by_layer": { - "C0_SOURCE_CHUNKS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C0_SOURCE_CHUNKS": 200 - }, - "filters_by_layer": { - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src/app_runtime/core/runtime.py" - ], - "include_globs": [], - "exclude_globs": [], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Открой файл src/app_runtime/core/runtime.py", - "path_scope": [ - "src/app_runtime/core/runtime.py" - ], - "include_globs": [], - "exclude_globs": [], - "prefer_globs": [], - "top_k": 200, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src/app_runtime/core/runtime.py" - ], - "normalized_include_globs": [], - "normalized_exclude_globs": [], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 1, - "candidates_after_filter": 1 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "not_requested", - "resolved_symbol": null, - "alternatives": [] - }, - "layers": [ - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 1, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "router": 1, - "symbol_resolution": 0, - "retrieval_total": 122, - "retrieval_by_layer": { - "C0_SOURCE_CHUNKS": 122 - }, - "merge_rank": 0, - "prompt_build": 0, - "llm_call": 1482 - }, - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 555, - "evidence_rows": 1, - "evidence_chars": 6265 - }, - "evidence_summary": [ - { - "layer": "C0_SOURCE_CHUNKS", - "count": 1, - "unique_paths": 1 - } - ], - "prompt_template_id": "intent_code_qa_open_file_ru_v1", - "system_prompt_version": "v1" - }, - "router": { - "conversation_mode": "START", - "keyword_hints": [], - "path_scope": [ - "src/app_runtime/core/runtime.py" - ] - }, - "llm": { - "used_evidence_count": 1, - "missing_evidence_reason": null - } - }, - "run_info": { - "case_id": "plba-fullchain-open-file-runtime", - "mode": "full_chain", - "run_started_at": "2026-03-12T12:08:55", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - }, - "input_request": { - "text": "Открой файл src/app_runtime/core/runtime.py", - "normalized_query": "Открой файл src/app_runtime/core/runtime.py" - }, - "steps": [ - { - "step": "intent_router", - "input": { - "query": "Открой файл src/app_runtime/core/runtime.py" - }, - "output": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Открой файл src/app_runtime/core/runtime.py" - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "OPEN_FILE", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C0_SOURCE_CHUNKS" - ], - "symbol_kind_hint": "unknown", - "symbol_candidates": [], - "keyword_hints": [], - "path_hints": [ - "src/app_runtime/core/runtime.py" - ], - "path_scope": [ - "src/app_runtime/core/runtime.py" - ], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/app_runtime/core/runtime.py" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": false, - "max_distance": 2, - "top_k": 5 - } - } - }, - "timings_ms": { - "router": 1 - } - } - }, - { - "step": "retrieval", - "input": { - "query": "Открой файл src/app_runtime/core/runtime.py" - }, - "output": { - "symbol_resolution": { - "status": "not_requested", - "resolved_symbol": null, - "alternatives": [], - "confidence": 0.0 - }, - "rag_count": 1, - "rag_rows": [ - { - "path": "src/app_runtime/core/runtime.py", - "content": "class RuntimeManager:\n ACTION_TIMEOUT_SECONDS = 10.0\n ACTION_POLL_INTERVAL_SECONDS = 0.05\n\n def __init__(\n self,\n configuration: ConfigurationManager | None = None,\n services: ServiceContainer | None = None,\n traces: TraceService | None = None,\n health: HealthRegistry | None = None,\n logs: LogManager | None = None,\n workers: WorkerSupervisor | None = None,\n control_plane: ControlPlaneService | None = None,\n ) -> None:\n self.configuration = configuration or ConfigurationManager()\n self.services = services or ServiceContainer()\n self.traces = traces or TraceService()\n self.health = health or HealthRegistry()\n self.logs = logs or LogManager()\n self.workers = workers or WorkerSupervisor()\n self.control_plane = control_plane or ControlPlaneService()\n self.registry = ModuleRegistry(self.services)\n self._started = False\n self._state = LifecycleState.IDLE\n self._core_registered = False\n self._workers_registered = False\n self._register_core_services()\n\n def register_module(self, module: ApplicationModule) -> None:\n self.registry.register_module(module.name)\n module.register(self.registry)\n\n def add_config_file(self, path: str) -> FileConfigProvider:\n provider = FileConfigProvider(path)\n self.configuration.add_provider(provider)\n return provider\n\n def start(self, *, start_control_plane: bool = True) -> None:\n if self._started:\n return\n self._state = LifecycleState.STARTING\n config = self.configuration.load()\n self.logs.apply_config(config)\n self._register_health_contributors()\n self._register_workers()\n self.workers.start()\n if start_control_plane:\n self.control_plane.start(self)\n self._started = True\n self._refresh_state()\n\n def stop(self, timeout: float = 30.0, force: bool = False, stop_control_plane: bool = True) -> None:\n if not self._started:\n return\n self._state = LifecycleState.STOPPING\n self.workers.stop(timeout=timeout, force=force)\n if stop_control_plane:\n self.control_plane.stop()\n self._started = False\n self._state = LifecycleState.STOPPED\n\n def status(self) -> dict[str, object]:\n self._refresh_state()\n return self.control_plane.snapshot(self)\n\n def current_health(self) -> HealthPayload:\n self._refresh_state()\n return self.health.payload(self._state, self.workers.healths())\n\n async def health_status(self) -> HealthPayload:\n return self.current_health()\n\n async def start_runtime(self) -> dict[str, object] | str:\n self._refresh_state()\n if self._started:\n return \"runtime already running\"\n if self._state == LifecycleState.STOPPING:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n\n self.start(start_control_plane=False)\n started = self._wait_for_state({LifecycleState.IDLE, LifecycleState.BUSY}, timeout=self.ACTION_TIMEOUT_SECONDS)\n if started:\n return self._action_detail(\"runtime started\", timed_out=False)\n return self._action_detail(\"runtime start is still in progress\", timed_out=True)\n\n async def stop_runtime(self) -> dict[str, object] | str:\n self._refresh_state()\n if not self._started:\n if self._state == LifecycleState.STOPPING:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n return \"runtime already stopped\"\n\n self._state = LifecycleState.STOPPING\n try:\n self.workers.stop(timeout=self.ACTION_TIMEOUT_SECONDS, force=False)\n except TimeoutError:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n\n self._started = False\n self._state = LifecycleState.STOPPED\n return self._action_detail(\"runtime stopped\", timed_out=False)\n\n async def runtime_status(self) -> str:\n self._refresh_state()\n return self._state.value\n\n def _register_core_services(self) -> None:\n if self._core_registered:\n return\n self.services.register(\"configuration\", self.configuration)\n self.services.register(\"traces\", self.traces)\n self.services.register(\"health\", self.health)\n self.services.register(\"logs\", self.logs)\n self.services.register(\"workers\", self.workers)\n self.services.register(\"control_plane\", self.control_plane)\n self._core_registered = True\n\n def _register_health_contributors(self) -> None:\n for contributor in self.registry.health_contributors:\n self.health.register(contributor)\n\n def _register_workers(self) -> None:\n if self._workers_registered:\n return\n for worker in self.registry.workers:\n self.workers.register(worker)\n self._workers_registered = True\n\n def _refresh_state(self) -> None:\n lifecycle = self.workers.lifecycle_state()\n\n if self._state == LifecycleState.STOPPING:\n if lifecycle == LifecycleState.STOPPED:\n self._started = False\n self._state = LifecycleState.STOPPED\n return\n\n if not self._started:\n if lifecycle == LifecycleState.STOPPED:\n self._state = LifecycleState.STOPPED\n return\n\n self._state = lifecycle\n\n def _wait_for_state(self, target_states: set[LifecycleState], *, timeout: float) -> bool:\n deadline = monotonic() + timeout\n while monotonic() < deadline:\n self._refresh_state()\n if self._state in target_states:\n return True\n sleep(self.ACTION_POLL_INTERVAL_SECONDS)\n self._refresh_state()\n return self._state in target_states\n\n def _action_detail(self, message: str, *, timed_out: bool) -> dict[str, object]:\n self._refresh_state()\n return {\n \"message\": message,\n \"state\": self._state.value,\n \"timed_out\": timed_out,\n \"workers\": self.workers.snapshot(),\n }", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/core/runtime.py:RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.core.runtime", - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ] - }, - "diagnostics": { - "execution": { - "executed_layers": [ - "C0_SOURCE_CHUNKS" - ], - "retrieval_mode_by_layer": { - "C0_SOURCE_CHUNKS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C0_SOURCE_CHUNKS": 200 - }, - "filters_by_layer": { - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src/app_runtime/core/runtime.py" - ], - "include_globs": [], - "exclude_globs": [], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Открой файл src/app_runtime/core/runtime.py", - "path_scope": [ - "src/app_runtime/core/runtime.py" - ], - "include_globs": [], - "exclude_globs": [], - "prefer_globs": [], - "top_k": 200, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src/app_runtime/core/runtime.py" - ], - "normalized_include_globs": [], - "normalized_exclude_globs": [], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 1, - "candidates_after_filter": 1 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "not_requested", - "resolved_symbol": null, - "alternatives": [] - }, - "layers": [ - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 1, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "symbol_resolution": 0, - "retrieval_total": 122, - "retrieval_by_layer": { - "C0_SOURCE_CHUNKS": 122 - }, - "merge_rank": 0 - } - } - }, - { - "step": "llm_answer", - "input": { - "query": "Открой файл src/app_runtime/core/runtime.py", - "rag_count": 1 - }, - "output": { - "llm_answer": "Файл `src/app_runtime/core/runtime.py` содержит определение класса `RuntimeManager`, являющегося ключевым компонентом системы управления выполнением приложений.\n\n## Важные сущности и их значение:\n\n- **Класс `RuntimeManager`:** Основной управляющий класс, инициализирующий различные сервисы и модули приложения.\n - Переменные класса:\n - `ACTION_TIMEOUT_SECONDS` и `ACTION_POLL_INTERVAL_SECONDS`: настройки тайм-аутов и интервалов опроса действий.\n - Метод `__init__`: Конструктор класса, принимающий различные компоненты инфраструктуры (конфигурации, службы, трассировки, здоровье, логирование, управление рабочими процессами и контрольная плоскость).\n - Метод `_register_core_services`: Регистрация основных сервисов внутри runtime менеджера.\n \nЭтот класс является точкой входа и основным управляющим элементом при запуске и управлении приложением, обеспечивая интеграцию различных компонентов и сервисов." - }, - "diagnostics": { - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 555, - "evidence_rows": 1, - "evidence_chars": 6265 - }, - "evidence_summary": [ - { - "layer": "C0_SOURCE_CHUNKS", - "count": 1, - "unique_paths": 1 - } - ], - "prompt_template_id": "intent_code_qa_open_file_ru_v1", - "system_prompt_version": "v1" - }, - "timings_ms": { - "prompt_build": 0, - "llm_call": 1482 - } - } - } - ] - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents/20260312_120855/full_chain_plba_code_subintents_plba-fullchain-open-file-runtime.md b/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents/20260312_120855/full_chain_plba_code_subintents_plba-fullchain-open-file-runtime.md deleted file mode 100644 index b6be060..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents/20260312_120855/full_chain_plba_code_subintents_plba-fullchain-open-file-runtime.md +++ /dev/null @@ -1,30 +0,0 @@ -# plba-fullchain-open-file-runtime - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_subintents.yaml -- runner: runtime -- mode: full_chain -- passed: True - -## Query -Открой файл src/app_runtime/core/runtime.py - -## Actual -{ - "intent": "CODE_QA", - "sub_intent": "OPEN_FILE", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 1, - "llm_answer": "Файл `src/app_runtime/core/runtime.py` содержит определение класса `RuntimeManager`, являющегося ключевым компонентом системы управления выполнением приложений.\n\n## Важные сущности и их значение:\n\n- **Класс `RuntimeManager`:** Основной управляющий класс, инициализирующий различные сервисы и модули приложения.\n - Переменные класса:\n - `ACTION_TIMEOUT_SECONDS` и `ACTION_POLL_INTERVAL_SECONDS`: настройки тайм-аутов и интервалов опроса действий.\n - Метод `__init__`: Конструктор класса, принимающий различные компоненты инфраструктуры (конфигурации, службы, трассировки, здоровье, логирование, управление рабочими процессами и контрольная плоскость).\n - Метод `_register_core_services`: Регистрация основных сервисов внутри runtime менеджера.\n \nЭтот класс является точкой входа и основным управляющим элементом при запуске и управлении приложением, обеспечивая интеграцию различных компонентов и сервисов.", - "answer_mode": "answered", - "path_scope": [ - "src/app_runtime/core/runtime.py" - ], - "symbol_candidates": [], - "layers": [ - "C0_SOURCE_CHUNKS" - ] -} - -## Mismatches -- none \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents/20260312_120855/full_chain_plba_code_subintents_plba-fullchain-trace-flow-runtime-manager.json b/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents/20260312_120855/full_chain_plba_code_subintents_plba-fullchain-trace-flow-runtime-manager.json deleted file mode 100644 index 05d2215..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents/20260312_120855/full_chain_plba_code_subintents_plba-fullchain-trace-flow-runtime-manager.json +++ /dev/null @@ -1,2964 +0,0 @@ -{ - "case_id": "plba-fullchain-trace-flow-runtime-manager", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_subintents.yaml", - "runner": "runtime", - "mode": "full_chain", - "actual": { - "intent": "CODE_QA", - "sub_intent": "TRACE_FLOW", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 23, - "llm_answer": "## Шаг 1: Инициализация RuntimeManager\n\n### Начало потока данных и выполнения:\nПроцесс начинается с вызова конструктора класса `RuntimeManager` (`__init__`), который является точкой входа для инициализации объекта менеджера времени выполнения.\n\n**Источник:** \n[C3_ENTRYPOINTS]: src/app_runtime/control/http_app.py | app.post \n[C2_DEPENDENCY_GRAPH]: src/app_runtime/core/runtime.py | RuntimeManager.__init__:dataflow_slice\n\n## Шаг 2: Передача параметров конструктору\n\nПри вызове конструктора передаются параметры конфигурации, сервисов, трассировки, здоровья, логирования, рабочих процессов и плоскости управления. Эти параметры используются для настройки нового экземпляра менеджера времени выполнения.\n\n**Обработка параметров:** \n[C0_SOURCE_CHUNKS]: src/app_runtime/core/runtime.py \n```python\ndef __init__(self, \n configuration: ConfigurationManager | None = None, \n services: ServiceContainer | None = None, \n traces: TraceService | None = None, \n health: HealthRegistry | None = None, \n logs: LogManager | None = None, \n workers: WorkerSupervisor | None = None, \n control_plane: ControlPlaneService | None = None):\n```\n\nПараметры могут быть переданы явно пользователем или приняты по умолчанию через соответствующие классы-конструкторы.\n\n## Шаг 3: Настройка внутренних атрибутов RuntimeManager\n\nПосле передачи параметров выполняется настройка внутренних атрибутов объекта `RuntimeManager`. В частности, создаются следующие внутренние компоненты:\n\n- `configuration`: объект для управления конфигурацией приложения.\n- `services`: контейнер для хранения различных сервисов, необходимых приложению.\n- `traces`: сервис для ведения журнала событий.\n- `health`: реестр состояния здоровья системы.\n- `logs`: менеджер логирования.\n- `workers`: супервизор рабочих процессов.\n- `control_plane`: плоскость управления, обеспечивающая связь с внешним миром.\n\nЭти компоненты играют важную роль в дальнейшей работе менеджера времени выполнения.\n\n**Настройки атрибутов:** \n[C0_SOURCE_CHUNKS]: src/app_runtime/core/runtime.py \n```python\nself.configuration = configuration or ConfigurationManager()\nself.services = services or ServiceContainer()\nself.traces = traces or TraceService()\nself.health = health or HealthRegistry()\nself.logs = logs or LogManager()\nself.workers = workers or WorkerSupervisor()\nself.control_plane = control_plane or ControlPlaneService()\n```\n\n## Шаг 4: Регистрация модулей\n\nДалее происходит регистрация модулей с использованием внутреннего реестра `registry`, что позволяет системе распознавать доступные модули и обеспечивать их корректную работу.\n\n**Регистрация модулей:** \n[C0_SOURCE_CHUNKS]: src/app_runtime/core/runtime.py \n```python\nself.registry = ModuleRegistry(self.services)\n```\n\n## Заключение\n\nТаким образом, процесс инициализации и настройки объекта `RuntimeManager` завершается созданием и настройкой всех необходимых компонентов и регистрацией доступных модулей. После этого экземпляр `RuntimeManager` готов к дальнейшему использованию и управлению временем выполнения приложения.\n\n---\n\n### Поток данных и выполнения кратко:\n1. Вызов конструктора `RuntimeManager`.\n2. Передача параметров.\n3. Настройка внутренних атрибутов и компонентов.\n4. Регистрация модулей.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "RuntimeManager" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "passed": true, - "mismatches": [], - "details": { - "case_id": "plba-fullchain-trace-flow-runtime-manager", - "text": "Покажи поток выполнения RuntimeManager", - "mode": "full_chain", - "run_started_at": "2026-03-12T12:08:55", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Покажи поток выполнения RuntimeManager", - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "RuntimeManager", - "alternatives": [ - "RuntimeManager" - ], - "confidence": 0.99 - }, - "rag_count": 23, - "rag_rows": [ - { - "path": "src/app_runtime/core/runtime.py", - "content": "class RuntimeManager\nRuntimeManager", - "layer": "C1_SYMBOL_CATALOG", - "title": "RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "7e4a9381328c5803bbc6179458612fc4e947d928aa7bf8b4b2bebb2c8592f758", - "qname": "RuntimeManager", - "kind": "class", - "signature": "RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.core.runtime", - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests manager\n- orchestrates role-like calls (4)\n- reads and writes state attributes\n- participates in dataflow slices (50)", - "layer": "C4_SEMANTIC_ROLES", - "title": "RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 43, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "7e4a9381328c5803bbc6179458612fc4e947d928aa7bf8b4b2bebb2c8592f758", - "symbol_name": "RuntimeManager", - "qname": "RuntimeManager", - "role": "pipeline_stage", - "confidence": 0.67, - "dataflow_participation": 50, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "ControlChannel\nrole: model\n\nResponsibilities:\n- default model role", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlChannel", - "span_start": 21, - "span_end": 28, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 40, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "cfcfe9a311d3a2dbdaf32ac4ccd73c0eb9a117f830591a1c0867ee97d46204ff", - "symbol_name": "ControlChannel", - "qname": "ControlChannel", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "ControlActionSet\nrole: model\n\nResponsibilities:\n- default model role", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlActionSet", - "span_start": 14, - "span_end": 18, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 40, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "46eb026cb3313415ec47b82dd22f84f4d112c9d987e8b1716dcb0baa1cce8988", - "symbol_name": "ControlActionSet", - "qname": "ControlActionSet", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests service\n- reads and writes state attributes\n- participates in dataflow slices (5)", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlPlaneService", - "span_start": 12, - "span_end": 52, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 68, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "b13471e5916986dccffb53fab613812842965705e6b3a89ae549d30c9e91e9aa", - "symbol_name": "ControlPlaneService", - "qname": "ControlPlaneService", - "role": "pipeline_stage", - "confidence": 0.57, - "dataflow_participation": 5, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_runner.py", - "content": "UvicornThreadRunner\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (24)", - "layer": "C4_SEMANTIC_ROLES", - "title": "UvicornThreadRunner", - "span_start": 10, - "span_end": 61, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 11, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "fd55630045a02100df8877ac27d951ee08617d4598764394d48cb51fe067476a", - "symbol_name": "UvicornThreadRunner", - "qname": "UvicornThreadRunner", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 24, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "3779fdd2878b770e789a35bb2a89c9d79f13b61c26d7db1b3b683f9bb9e1623f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (10)", - "layer": "C4_SEMANTIC_ROLES", - "title": "HttpControlChannel", - "span_start": 12, - "span_end": 57, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 21, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "1c9fbdc24819e5604c26ea55428a74310f03a03e1af197ed84846af61e42fdb0", - "symbol_name": "HttpControlChannel", - "qname": "HttpControlChannel", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 10, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "HttpControlAppFactory\nrole: factory\n\nResponsibilities:\n- name suffix suggests factory", - "layer": "C4_SEMANTIC_ROLES", - "title": "HttpControlAppFactory", - "span_start": 15, - "span_end": 53, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 39, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "9b3502a5fb408b273223db13264349cf500de24915b6c649d9ea8970d0dfd8e0", - "symbol_name": "HttpControlAppFactory", - "qname": "HttpControlAppFactory", - "role": "factory", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/persistence/workflow_persistence.py", - "content": "WorkflowPersistence\nrole: pipeline_stage\n\nResponsibilities:\n- orchestrates role-like calls (2)\n- reads and writes state attributes\n- participates in dataflow slices (16)", - "layer": "C4_SEMANTIC_ROLES", - "title": "WorkflowPersistence", - "span_start": 8, - "span_end": 54, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 15, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "7bd01ee45cf31f2d5c2e3e51656254860ac785d10cef9e0852cd4fba90857bae", - "symbol_name": "WorkflowPersistence", - "qname": "WorkflowPersistence", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 16, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "80e9410ddc639789b4353c2a1a757ba8d0d5b5bb6075b0b263b61551f04ae1f0", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager.add_config_file", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 32, - "span_end": 52, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "a23b8a11ebdb12708b60c96ea12a69f7f042082f1adfddd572444e246d81d167", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "57ffbd4f0d9fdf3507c2b8624312ce211f3d02fdf86a57a8ec90778d8a7b498d", - "dst_ref": "RuntimeManager.add_config_file", - "resolution": "resolved", - "slice_id": "a23b8a11ebdb12708b60c96ea12a69f7f042082f1adfddd572444e246d81d167", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager.add_config_file" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "57ffbd4f0d9fdf3507c2b8624312ce211f3d02fdf86a57a8ec90778d8a7b498d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.services\n -> RuntimeManager.__init__", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 33, - "span_end": 39, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "d43af85989222ee6d788ce418cdcb217c7ff044cfb915e3bdbd184417dc7bd61", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "dst_ref": "RuntimeManager.__init__", - "resolution": "resolved", - "slice_id": "d43af85989222ee6d788ce418cdcb217c7ff044cfb915e3bdbd184417dc7bd61", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.services", - "RuntimeManager.__init__" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.stop", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 25, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d", - "dst_ref": "ControlPlaneService.stop", - "resolution": "resolved", - "slice_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.stop" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._stop_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 51, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a", - "dst_ref": "ControlPlaneService._stop_async", - "resolution": "resolved", - "slice_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._stop_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager.start", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 32, - "span_end": 59, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "98312ace7fc62b1c7194c5aa1732b6ef736eae1668a3a120dd1ecd5ab1d64f7a", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "77a7b260193018845e4e204df094ab89cfd7c82ee4e822b3a83ad4cd945f9cb1", - "dst_ref": "RuntimeManager.start", - "resolution": "resolved", - "slice_id": "98312ace7fc62b1c7194c5aa1732b6ef736eae1668a3a120dd1ecd5ab1d64f7a", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager.start" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "77a7b260193018845e4e204df094ab89cfd7c82ee4e822b3a83ad4cd945f9cb1" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager._register_core_services", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 32, - "span_end": 127, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "3e5811f3b511fa0cabe363f5d01f2ac5fa039bc8b93f7ee108323e1f5f45a293", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "972d6057a6caac9cf31ebc1e29c6f39f71b10d4cc170dec57cf875ba458549c6", - "dst_ref": "RuntimeManager._register_core_services", - "resolution": "resolved", - "slice_id": "3e5811f3b511fa0cabe363f5d01f2ac5fa039bc8b93f7ee108323e1f5f45a293", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager._register_core_services" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "972d6057a6caac9cf31ebc1e29c6f39f71b10d4cc170dec57cf875ba458549c6" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.register_channel", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 17, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957", - "dst_ref": "ControlPlaneService.register_channel", - "resolution": "resolved", - "slice_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.register_channel" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.start", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 20, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154", - "dst_ref": "ControlPlaneService.start", - "resolution": "resolved", - "slice_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.start" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._start_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 47, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517", - "dst_ref": "ControlPlaneService._start_async", - "resolution": "resolved", - "slice_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._start_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.services\n -> RuntimeManager._register_core_services", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 33, - "span_end": 127, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "aac6f9dda73963b977083a892bee39a48eca4fbd7404787e022ecf4ebedec65d", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "972d6057a6caac9cf31ebc1e29c6f39f71b10d4cc170dec57cf875ba458549c6", - "dst_ref": "RuntimeManager._register_core_services", - "resolution": "resolved", - "slice_id": "aac6f9dda73963b977083a892bee39a48eca4fbd7404787e022ecf4ebedec65d", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.services", - "RuntimeManager._register_core_services" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "972d6057a6caac9cf31ebc1e29c6f39f71b10d4cc170dec57cf875ba458549c6" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "class RuntimeManager:\n ACTION_TIMEOUT_SECONDS = 10.0\n ACTION_POLL_INTERVAL_SECONDS = 0.05\n\n def __init__(\n self,\n configuration: ConfigurationManager | None = None,\n services: ServiceContainer | None = None,\n traces: TraceService | None = None,\n health: HealthRegistry | None = None,\n logs: LogManager | None = None,\n workers: WorkerSupervisor | None = None,\n control_plane: ControlPlaneService | None = None,\n ) -> None:\n self.configuration = configuration or ConfigurationManager()\n self.services = services or ServiceContainer()\n self.traces = traces or TraceService()\n self.health = health or HealthRegistry()\n self.logs = logs or LogManager()\n self.workers = workers or WorkerSupervisor()\n self.control_plane = control_plane or ControlPlaneService()\n self.registry = ModuleRegistry(self.services)\n self._started = False\n self._state = LifecycleState.IDLE\n self._core_registered = False\n self._workers_registered = False\n self._register_core_services()\n\n def register_module(self, module: ApplicationModule) -> None:\n self.registry.register_module(module.name)\n module.register(self.registry)\n\n def add_config_file(self, path: str) -> FileConfigProvider:\n provider = FileConfigProvider(path)\n self.configuration.add_provider(provider)\n return provider\n\n def start(self, *, start_control_plane: bool = True) -> None:\n if self._started:\n return\n self._state = LifecycleState.STARTING\n config = self.configuration.load()\n self.logs.apply_config(config)\n self._register_health_contributors()\n self._register_workers()\n self.workers.start()\n if start_control_plane:\n self.control_plane.start(self)\n self._started = True\n self._refresh_state()\n\n def stop(self, timeout: float = 30.0, force: bool = False, stop_control_plane: bool = True) -> None:\n if not self._started:\n return\n self._state = LifecycleState.STOPPING\n self.workers.stop(timeout=timeout, force=force)\n if stop_control_plane:\n self.control_plane.stop()\n self._started = False\n self._state = LifecycleState.STOPPED\n\n def status(self) -> dict[str, object]:\n self._refresh_state()\n return self.control_plane.snapshot(self)\n\n def current_health(self) -> HealthPayload:\n self._refresh_state()\n return self.health.payload(self._state, self.workers.healths())\n\n async def health_status(self) -> HealthPayload:\n return self.current_health()\n\n async def start_runtime(self) -> dict[str, object] | str:\n self._refresh_state()\n if self._started:\n return \"runtime already running\"\n if self._state == LifecycleState.STOPPING:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n\n self.start(start_control_plane=False)\n started = self._wait_for_state({LifecycleState.IDLE, LifecycleState.BUSY}, timeout=self.ACTION_TIMEOUT_SECONDS)\n if started:\n return self._action_detail(\"runtime started\", timed_out=False)\n return self._action_detail(\"runtime start is still in progress\", timed_out=True)\n\n async def stop_runtime(self) -> dict[str, object] | str:\n self._refresh_state()\n if not self._started:\n if self._state == LifecycleState.STOPPING:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n return \"runtime already stopped\"\n\n self._state = LifecycleState.STOPPING\n try:\n self.workers.stop(timeout=self.ACTION_TIMEOUT_SECONDS, force=False)\n except TimeoutError:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n\n self._started = False\n self._state = LifecycleState.STOPPED\n return self._action_detail(\"runtime stopped\", timed_out=False)\n\n async def runtime_status(self) -> str:\n self._refresh_state()\n return self._state.value\n\n def _register_core_services(self) -> None:\n if self._core_registered:\n return\n self.services.register(\"configuration\", self.configuration)\n self.services.register(\"traces\", self.traces)\n self.services.register(\"health\", self.health)\n self.services.register(\"logs\", self.logs)\n self.services.register(\"workers\", self.workers)\n self.services.register(\"control_plane\", self.control_plane)\n self._core_registered = True\n\n def _register_health_contributors(self) -> None:\n for contributor in self.registry.health_contributors:\n self.health.register(contributor)\n\n def _register_workers(self) -> None:\n if self._workers_registered:\n return\n for worker in self.registry.workers:\n self.workers.register(worker)\n self._workers_registered = True\n\n def _refresh_state(self) -> None:\n lifecycle = self.workers.lifecycle_state()\n\n if self._state == LifecycleState.STOPPING:\n if lifecycle == LifecycleState.STOPPED:\n self._started = False\n self._state = LifecycleState.STOPPED\n return\n\n if not self._started:\n if lifecycle == LifecycleState.STOPPED:\n self._state = LifecycleState.STOPPED\n return\n\n self._state = lifecycle\n\n def _wait_for_state(self, target_states: set[LifecycleState], *, timeout: float) -> bool:\n deadline = monotonic() + timeout\n while monotonic() < deadline:\n self._refresh_state()\n if self._state in target_states:\n return True\n sleep(self.ACTION_POLL_INTERVAL_SECONDS)\n self._refresh_state()\n return self._state in target_states\n\n def _action_detail(self, message: str, *, timed_out: bool) -> dict[str, object]:\n self._refresh_state()\n return {\n \"message\": message,\n \"state\": self._state.value,\n \"timed_out\": timed_out,\n \"workers\": self.workers.snapshot(),\n }", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/core/runtime.py:RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.core.runtime", - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "llm_answer": "## Шаг 1: Инициализация RuntimeManager\n\n### Начало потока данных и выполнения:\nПроцесс начинается с вызова конструктора класса `RuntimeManager` (`__init__`), который является точкой входа для инициализации объекта менеджера времени выполнения.\n\n**Источник:** \n[C3_ENTRYPOINTS]: src/app_runtime/control/http_app.py | app.post \n[C2_DEPENDENCY_GRAPH]: src/app_runtime/core/runtime.py | RuntimeManager.__init__:dataflow_slice\n\n## Шаг 2: Передача параметров конструктору\n\nПри вызове конструктора передаются параметры конфигурации, сервисов, трассировки, здоровья, логирования, рабочих процессов и плоскости управления. Эти параметры используются для настройки нового экземпляра менеджера времени выполнения.\n\n**Обработка параметров:** \n[C0_SOURCE_CHUNKS]: src/app_runtime/core/runtime.py \n```python\ndef __init__(self, \n configuration: ConfigurationManager | None = None, \n services: ServiceContainer | None = None, \n traces: TraceService | None = None, \n health: HealthRegistry | None = None, \n logs: LogManager | None = None, \n workers: WorkerSupervisor | None = None, \n control_plane: ControlPlaneService | None = None):\n```\n\nПараметры могут быть переданы явно пользователем или приняты по умолчанию через соответствующие классы-конструкторы.\n\n## Шаг 3: Настройка внутренних атрибутов RuntimeManager\n\nПосле передачи параметров выполняется настройка внутренних атрибутов объекта `RuntimeManager`. В частности, создаются следующие внутренние компоненты:\n\n- `configuration`: объект для управления конфигурацией приложения.\n- `services`: контейнер для хранения различных сервисов, необходимых приложению.\n- `traces`: сервис для ведения журнала событий.\n- `health`: реестр состояния здоровья системы.\n- `logs`: менеджер логирования.\n- `workers`: супервизор рабочих процессов.\n- `control_plane`: плоскость управления, обеспечивающая связь с внешним миром.\n\nЭти компоненты играют важную роль в дальнейшей работе менеджера времени выполнения.\n\n**Настройки атрибутов:** \n[C0_SOURCE_CHUNKS]: src/app_runtime/core/runtime.py \n```python\nself.configuration = configuration or ConfigurationManager()\nself.services = services or ServiceContainer()\nself.traces = traces or TraceService()\nself.health = health or HealthRegistry()\nself.logs = logs or LogManager()\nself.workers = workers or WorkerSupervisor()\nself.control_plane = control_plane or ControlPlaneService()\n```\n\n## Шаг 4: Регистрация модулей\n\nДалее происходит регистрация модулей с использованием внутреннего реестра `registry`, что позволяет системе распознавать доступные модули и обеспечивать их корректную работу.\n\n**Регистрация модулей:** \n[C0_SOURCE_CHUNKS]: src/app_runtime/core/runtime.py \n```python\nself.registry = ModuleRegistry(self.services)\n```\n\n## Заключение\n\nТаким образом, процесс инициализации и настройки объекта `RuntimeManager` завершается созданием и настройкой всех необходимых компонентов и регистрацией доступных модулей. После этого экземпляр `RuntimeManager` готов к дальнейшему использованию и управлению временем выполнения приложения.\n\n---\n\n### Поток данных и выполнения кратко:\n1. Вызов конструктора `RuntimeManager`.\n2. Передача параметров.\n3. Настройка внутренних атрибутов и компонентов.\n4. Регистрация модулей.", - "summary": { - "router": { - "intent": "CODE_QA", - "sub_intent": "TRACE_FLOW", - "confidence": null - }, - "retrieval": { - "profile": "code", - "layers_hit": [ - "C0_SOURCE_CHUNKS", - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS", - "C4_SEMANTIC_ROLES" - ], - "evidence_sufficient": true - }, - "llm": { - "answer_status": "answered", - "groundedness": "grounded" - } - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "TRACE_FLOW", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "RuntimeManager" - ], - "keyword_hints": [ - "RuntimeManager" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C0_SOURCE_CHUNKS": "exact_path_fetch", - "C4_SEMANTIC_ROLES": "exact_path_fetch", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C3_ENTRYPOINTS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 8, - "C4_SEMANTIC_ROLES": 8, - "C2_DEPENDENCY_GRAPH": 10, - "C3_ENTRYPOINTS": 10 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C4_SEMANTIC_ROLES": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Покажи поток выполнения RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C4_SEMANTIC_ROLES", - "query": "Покажи поток выполнения RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "Покажи поток выполнения RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 10, - "ranking_profile": "code" - }, - { - "layer": "C3_ENTRYPOINTS", - "query": "Покажи поток выполнения RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 10, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 1, - "candidates_after_filter": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 10, - "candidates_after_filter": 10 - }, - { - "layer": "C3_ENTRYPOINTS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 3, - "candidates_after_filter": 3 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "RuntimeManager", - "alternatives": [ - "RuntimeManager" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C4_SEMANTIC_ROLES", - "status": "hit", - "hit_count": 8, - "fail_reason": null - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 10, - "fail_reason": null - }, - { - "layer": "C3_ENTRYPOINTS", - "status": "hit", - "hit_count": 3, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "router": 1, - "symbol_resolution": 0, - "retrieval_total": 179, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 59, - "C0_SOURCE_CHUNKS": 27, - "C4_SEMANTIC_ROLES": 21, - "C2_DEPENDENCY_GRAPH": 59, - "C3_ENTRYPOINTS": 11 - }, - "merge_rank": 21, - "prompt_build": 0, - "llm_call": 4768 - }, - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 766, - "evidence_rows": 23, - "evidence_chars": 8302 - }, - "evidence_summary": [ - { - "layer": "C1_SYMBOL_CATALOG", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "count": 8, - "unique_paths": 7 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "count": 10, - "unique_paths": 2 - }, - { - "layer": "C3_ENTRYPOINTS", - "count": 3, - "unique_paths": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 1, - "unique_paths": 1 - } - ], - "prompt_template_id": "intent_code_qa_trace_flow_ru_v1", - "system_prompt_version": "v1" - }, - "router": { - "conversation_mode": "START", - "keyword_hints": [ - "RuntimeManager" - ], - "path_scope": [] - }, - "llm": { - "used_evidence_count": 23, - "missing_evidence_reason": null - } - }, - "run_info": { - "case_id": "plba-fullchain-trace-flow-runtime-manager", - "mode": "full_chain", - "run_started_at": "2026-03-12T12:08:55", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - }, - "input_request": { - "text": "Покажи поток выполнения RuntimeManager", - "normalized_query": "Покажи поток выполнения RuntimeManager" - }, - "steps": [ - { - "step": "intent_router", - "input": { - "query": "Покажи поток выполнения RuntimeManager" - }, - "output": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Покажи поток выполнения RuntimeManager" - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "TRACE_FLOW", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "RuntimeManager" - ], - "keyword_hints": [ - "RuntimeManager" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "timings_ms": { - "router": 1 - } - } - }, - { - "step": "retrieval", - "input": { - "query": "Покажи поток выполнения RuntimeManager" - }, - "output": { - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "RuntimeManager", - "alternatives": [ - "RuntimeManager" - ], - "confidence": 0.99 - }, - "rag_count": 23, - "rag_rows": [ - { - "path": "src/app_runtime/core/runtime.py", - "content": "class RuntimeManager\nRuntimeManager", - "layer": "C1_SYMBOL_CATALOG", - "title": "RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "7e4a9381328c5803bbc6179458612fc4e947d928aa7bf8b4b2bebb2c8592f758", - "qname": "RuntimeManager", - "kind": "class", - "signature": "RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.core.runtime", - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests manager\n- orchestrates role-like calls (4)\n- reads and writes state attributes\n- participates in dataflow slices (50)", - "layer": "C4_SEMANTIC_ROLES", - "title": "RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 43, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "7e4a9381328c5803bbc6179458612fc4e947d928aa7bf8b4b2bebb2c8592f758", - "symbol_name": "RuntimeManager", - "qname": "RuntimeManager", - "role": "pipeline_stage", - "confidence": 0.67, - "dataflow_participation": 50, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "ControlChannel\nrole: model\n\nResponsibilities:\n- default model role", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlChannel", - "span_start": 21, - "span_end": 28, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 40, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "cfcfe9a311d3a2dbdaf32ac4ccd73c0eb9a117f830591a1c0867ee97d46204ff", - "symbol_name": "ControlChannel", - "qname": "ControlChannel", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "ControlActionSet\nrole: model\n\nResponsibilities:\n- default model role", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlActionSet", - "span_start": 14, - "span_end": 18, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 40, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "46eb026cb3313415ec47b82dd22f84f4d112c9d987e8b1716dcb0baa1cce8988", - "symbol_name": "ControlActionSet", - "qname": "ControlActionSet", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests service\n- reads and writes state attributes\n- participates in dataflow slices (5)", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlPlaneService", - "span_start": 12, - "span_end": 52, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 68, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "b13471e5916986dccffb53fab613812842965705e6b3a89ae549d30c9e91e9aa", - "symbol_name": "ControlPlaneService", - "qname": "ControlPlaneService", - "role": "pipeline_stage", - "confidence": 0.57, - "dataflow_participation": 5, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_runner.py", - "content": "UvicornThreadRunner\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (24)", - "layer": "C4_SEMANTIC_ROLES", - "title": "UvicornThreadRunner", - "span_start": 10, - "span_end": 61, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 11, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "fd55630045a02100df8877ac27d951ee08617d4598764394d48cb51fe067476a", - "symbol_name": "UvicornThreadRunner", - "qname": "UvicornThreadRunner", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 24, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "3779fdd2878b770e789a35bb2a89c9d79f13b61c26d7db1b3b683f9bb9e1623f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (10)", - "layer": "C4_SEMANTIC_ROLES", - "title": "HttpControlChannel", - "span_start": 12, - "span_end": 57, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 21, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "1c9fbdc24819e5604c26ea55428a74310f03a03e1af197ed84846af61e42fdb0", - "symbol_name": "HttpControlChannel", - "qname": "HttpControlChannel", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 10, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "HttpControlAppFactory\nrole: factory\n\nResponsibilities:\n- name suffix suggests factory", - "layer": "C4_SEMANTIC_ROLES", - "title": "HttpControlAppFactory", - "span_start": 15, - "span_end": 53, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 39, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "9b3502a5fb408b273223db13264349cf500de24915b6c649d9ea8970d0dfd8e0", - "symbol_name": "HttpControlAppFactory", - "qname": "HttpControlAppFactory", - "role": "factory", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/persistence/workflow_persistence.py", - "content": "WorkflowPersistence\nrole: pipeline_stage\n\nResponsibilities:\n- orchestrates role-like calls (2)\n- reads and writes state attributes\n- participates in dataflow slices (16)", - "layer": "C4_SEMANTIC_ROLES", - "title": "WorkflowPersistence", - "span_start": 8, - "span_end": 54, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 15, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "7bd01ee45cf31f2d5c2e3e51656254860ac785d10cef9e0852cd4fba90857bae", - "symbol_name": "WorkflowPersistence", - "qname": "WorkflowPersistence", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 16, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "80e9410ddc639789b4353c2a1a757ba8d0d5b5bb6075b0b263b61551f04ae1f0", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager.add_config_file", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 32, - "span_end": 52, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "a23b8a11ebdb12708b60c96ea12a69f7f042082f1adfddd572444e246d81d167", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "57ffbd4f0d9fdf3507c2b8624312ce211f3d02fdf86a57a8ec90778d8a7b498d", - "dst_ref": "RuntimeManager.add_config_file", - "resolution": "resolved", - "slice_id": "a23b8a11ebdb12708b60c96ea12a69f7f042082f1adfddd572444e246d81d167", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager.add_config_file" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "57ffbd4f0d9fdf3507c2b8624312ce211f3d02fdf86a57a8ec90778d8a7b498d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.services\n -> RuntimeManager.__init__", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 33, - "span_end": 39, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "d43af85989222ee6d788ce418cdcb217c7ff044cfb915e3bdbd184417dc7bd61", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "dst_ref": "RuntimeManager.__init__", - "resolution": "resolved", - "slice_id": "d43af85989222ee6d788ce418cdcb217c7ff044cfb915e3bdbd184417dc7bd61", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.services", - "RuntimeManager.__init__" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.stop", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 25, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d", - "dst_ref": "ControlPlaneService.stop", - "resolution": "resolved", - "slice_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.stop" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._stop_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 51, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a", - "dst_ref": "ControlPlaneService._stop_async", - "resolution": "resolved", - "slice_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._stop_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager.start", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 32, - "span_end": 59, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "98312ace7fc62b1c7194c5aa1732b6ef736eae1668a3a120dd1ecd5ab1d64f7a", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "77a7b260193018845e4e204df094ab89cfd7c82ee4e822b3a83ad4cd945f9cb1", - "dst_ref": "RuntimeManager.start", - "resolution": "resolved", - "slice_id": "98312ace7fc62b1c7194c5aa1732b6ef736eae1668a3a120dd1ecd5ab1d64f7a", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager.start" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "77a7b260193018845e4e204df094ab89cfd7c82ee4e822b3a83ad4cd945f9cb1" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager._register_core_services", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 32, - "span_end": 127, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "3e5811f3b511fa0cabe363f5d01f2ac5fa039bc8b93f7ee108323e1f5f45a293", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "972d6057a6caac9cf31ebc1e29c6f39f71b10d4cc170dec57cf875ba458549c6", - "dst_ref": "RuntimeManager._register_core_services", - "resolution": "resolved", - "slice_id": "3e5811f3b511fa0cabe363f5d01f2ac5fa039bc8b93f7ee108323e1f5f45a293", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager._register_core_services" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "972d6057a6caac9cf31ebc1e29c6f39f71b10d4cc170dec57cf875ba458549c6" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.register_channel", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 17, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957", - "dst_ref": "ControlPlaneService.register_channel", - "resolution": "resolved", - "slice_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.register_channel" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.start", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 20, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154", - "dst_ref": "ControlPlaneService.start", - "resolution": "resolved", - "slice_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.start" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._start_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 47, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517", - "dst_ref": "ControlPlaneService._start_async", - "resolution": "resolved", - "slice_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._start_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.services\n -> RuntimeManager._register_core_services", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 33, - "span_end": 127, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "aac6f9dda73963b977083a892bee39a48eca4fbd7404787e022ecf4ebedec65d", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "972d6057a6caac9cf31ebc1e29c6f39f71b10d4cc170dec57cf875ba458549c6", - "dst_ref": "RuntimeManager._register_core_services", - "resolution": "resolved", - "slice_id": "aac6f9dda73963b977083a892bee39a48eca4fbd7404787e022ecf4ebedec65d", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.services", - "RuntimeManager._register_core_services" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "972d6057a6caac9cf31ebc1e29c6f39f71b10d4cc170dec57cf875ba458549c6" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "class RuntimeManager:\n ACTION_TIMEOUT_SECONDS = 10.0\n ACTION_POLL_INTERVAL_SECONDS = 0.05\n\n def __init__(\n self,\n configuration: ConfigurationManager | None = None,\n services: ServiceContainer | None = None,\n traces: TraceService | None = None,\n health: HealthRegistry | None = None,\n logs: LogManager | None = None,\n workers: WorkerSupervisor | None = None,\n control_plane: ControlPlaneService | None = None,\n ) -> None:\n self.configuration = configuration or ConfigurationManager()\n self.services = services or ServiceContainer()\n self.traces = traces or TraceService()\n self.health = health or HealthRegistry()\n self.logs = logs or LogManager()\n self.workers = workers or WorkerSupervisor()\n self.control_plane = control_plane or ControlPlaneService()\n self.registry = ModuleRegistry(self.services)\n self._started = False\n self._state = LifecycleState.IDLE\n self._core_registered = False\n self._workers_registered = False\n self._register_core_services()\n\n def register_module(self, module: ApplicationModule) -> None:\n self.registry.register_module(module.name)\n module.register(self.registry)\n\n def add_config_file(self, path: str) -> FileConfigProvider:\n provider = FileConfigProvider(path)\n self.configuration.add_provider(provider)\n return provider\n\n def start(self, *, start_control_plane: bool = True) -> None:\n if self._started:\n return\n self._state = LifecycleState.STARTING\n config = self.configuration.load()\n self.logs.apply_config(config)\n self._register_health_contributors()\n self._register_workers()\n self.workers.start()\n if start_control_plane:\n self.control_plane.start(self)\n self._started = True\n self._refresh_state()\n\n def stop(self, timeout: float = 30.0, force: bool = False, stop_control_plane: bool = True) -> None:\n if not self._started:\n return\n self._state = LifecycleState.STOPPING\n self.workers.stop(timeout=timeout, force=force)\n if stop_control_plane:\n self.control_plane.stop()\n self._started = False\n self._state = LifecycleState.STOPPED\n\n def status(self) -> dict[str, object]:\n self._refresh_state()\n return self.control_plane.snapshot(self)\n\n def current_health(self) -> HealthPayload:\n self._refresh_state()\n return self.health.payload(self._state, self.workers.healths())\n\n async def health_status(self) -> HealthPayload:\n return self.current_health()\n\n async def start_runtime(self) -> dict[str, object] | str:\n self._refresh_state()\n if self._started:\n return \"runtime already running\"\n if self._state == LifecycleState.STOPPING:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n\n self.start(start_control_plane=False)\n started = self._wait_for_state({LifecycleState.IDLE, LifecycleState.BUSY}, timeout=self.ACTION_TIMEOUT_SECONDS)\n if started:\n return self._action_detail(\"runtime started\", timed_out=False)\n return self._action_detail(\"runtime start is still in progress\", timed_out=True)\n\n async def stop_runtime(self) -> dict[str, object] | str:\n self._refresh_state()\n if not self._started:\n if self._state == LifecycleState.STOPPING:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n return \"runtime already stopped\"\n\n self._state = LifecycleState.STOPPING\n try:\n self.workers.stop(timeout=self.ACTION_TIMEOUT_SECONDS, force=False)\n except TimeoutError:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n\n self._started = False\n self._state = LifecycleState.STOPPED\n return self._action_detail(\"runtime stopped\", timed_out=False)\n\n async def runtime_status(self) -> str:\n self._refresh_state()\n return self._state.value\n\n def _register_core_services(self) -> None:\n if self._core_registered:\n return\n self.services.register(\"configuration\", self.configuration)\n self.services.register(\"traces\", self.traces)\n self.services.register(\"health\", self.health)\n self.services.register(\"logs\", self.logs)\n self.services.register(\"workers\", self.workers)\n self.services.register(\"control_plane\", self.control_plane)\n self._core_registered = True\n\n def _register_health_contributors(self) -> None:\n for contributor in self.registry.health_contributors:\n self.health.register(contributor)\n\n def _register_workers(self) -> None:\n if self._workers_registered:\n return\n for worker in self.registry.workers:\n self.workers.register(worker)\n self._workers_registered = True\n\n def _refresh_state(self) -> None:\n lifecycle = self.workers.lifecycle_state()\n\n if self._state == LifecycleState.STOPPING:\n if lifecycle == LifecycleState.STOPPED:\n self._started = False\n self._state = LifecycleState.STOPPED\n return\n\n if not self._started:\n if lifecycle == LifecycleState.STOPPED:\n self._state = LifecycleState.STOPPED\n return\n\n self._state = lifecycle\n\n def _wait_for_state(self, target_states: set[LifecycleState], *, timeout: float) -> bool:\n deadline = monotonic() + timeout\n while monotonic() < deadline:\n self._refresh_state()\n if self._state in target_states:\n return True\n sleep(self.ACTION_POLL_INTERVAL_SECONDS)\n self._refresh_state()\n return self._state in target_states\n\n def _action_detail(self, message: str, *, timed_out: bool) -> dict[str, object]:\n self._refresh_state()\n return {\n \"message\": message,\n \"state\": self._state.value,\n \"timed_out\": timed_out,\n \"workers\": self.workers.snapshot(),\n }", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/core/runtime.py:RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.core.runtime", - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ] - }, - "diagnostics": { - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C0_SOURCE_CHUNKS": "exact_path_fetch", - "C4_SEMANTIC_ROLES": "exact_path_fetch", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C3_ENTRYPOINTS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 8, - "C4_SEMANTIC_ROLES": 8, - "C2_DEPENDENCY_GRAPH": 10, - "C3_ENTRYPOINTS": 10 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C4_SEMANTIC_ROLES": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Покажи поток выполнения RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C4_SEMANTIC_ROLES", - "query": "Покажи поток выполнения RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "Покажи поток выполнения RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 10, - "ranking_profile": "code" - }, - { - "layer": "C3_ENTRYPOINTS", - "query": "Покажи поток выполнения RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 10, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 1, - "candidates_after_filter": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 10, - "candidates_after_filter": 10 - }, - { - "layer": "C3_ENTRYPOINTS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 3, - "candidates_after_filter": 3 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "RuntimeManager", - "alternatives": [ - "RuntimeManager" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C4_SEMANTIC_ROLES", - "status": "hit", - "hit_count": 8, - "fail_reason": null - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 10, - "fail_reason": null - }, - { - "layer": "C3_ENTRYPOINTS", - "status": "hit", - "hit_count": 3, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "symbol_resolution": 0, - "retrieval_total": 179, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 59, - "C0_SOURCE_CHUNKS": 27, - "C4_SEMANTIC_ROLES": 21, - "C2_DEPENDENCY_GRAPH": 59, - "C3_ENTRYPOINTS": 11 - }, - "merge_rank": 21 - } - } - }, - { - "step": "llm_answer", - "input": { - "query": "Покажи поток выполнения RuntimeManager", - "rag_count": 23 - }, - "output": { - "llm_answer": "## Шаг 1: Инициализация RuntimeManager\n\n### Начало потока данных и выполнения:\nПроцесс начинается с вызова конструктора класса `RuntimeManager` (`__init__`), который является точкой входа для инициализации объекта менеджера времени выполнения.\n\n**Источник:** \n[C3_ENTRYPOINTS]: src/app_runtime/control/http_app.py | app.post \n[C2_DEPENDENCY_GRAPH]: src/app_runtime/core/runtime.py | RuntimeManager.__init__:dataflow_slice\n\n## Шаг 2: Передача параметров конструктору\n\nПри вызове конструктора передаются параметры конфигурации, сервисов, трассировки, здоровья, логирования, рабочих процессов и плоскости управления. Эти параметры используются для настройки нового экземпляра менеджера времени выполнения.\n\n**Обработка параметров:** \n[C0_SOURCE_CHUNKS]: src/app_runtime/core/runtime.py \n```python\ndef __init__(self, \n configuration: ConfigurationManager | None = None, \n services: ServiceContainer | None = None, \n traces: TraceService | None = None, \n health: HealthRegistry | None = None, \n logs: LogManager | None = None, \n workers: WorkerSupervisor | None = None, \n control_plane: ControlPlaneService | None = None):\n```\n\nПараметры могут быть переданы явно пользователем или приняты по умолчанию через соответствующие классы-конструкторы.\n\n## Шаг 3: Настройка внутренних атрибутов RuntimeManager\n\nПосле передачи параметров выполняется настройка внутренних атрибутов объекта `RuntimeManager`. В частности, создаются следующие внутренние компоненты:\n\n- `configuration`: объект для управления конфигурацией приложения.\n- `services`: контейнер для хранения различных сервисов, необходимых приложению.\n- `traces`: сервис для ведения журнала событий.\n- `health`: реестр состояния здоровья системы.\n- `logs`: менеджер логирования.\n- `workers`: супервизор рабочих процессов.\n- `control_plane`: плоскость управления, обеспечивающая связь с внешним миром.\n\nЭти компоненты играют важную роль в дальнейшей работе менеджера времени выполнения.\n\n**Настройки атрибутов:** \n[C0_SOURCE_CHUNKS]: src/app_runtime/core/runtime.py \n```python\nself.configuration = configuration or ConfigurationManager()\nself.services = services or ServiceContainer()\nself.traces = traces or TraceService()\nself.health = health or HealthRegistry()\nself.logs = logs or LogManager()\nself.workers = workers or WorkerSupervisor()\nself.control_plane = control_plane or ControlPlaneService()\n```\n\n## Шаг 4: Регистрация модулей\n\nДалее происходит регистрация модулей с использованием внутреннего реестра `registry`, что позволяет системе распознавать доступные модули и обеспечивать их корректную работу.\n\n**Регистрация модулей:** \n[C0_SOURCE_CHUNKS]: src/app_runtime/core/runtime.py \n```python\nself.registry = ModuleRegistry(self.services)\n```\n\n## Заключение\n\nТаким образом, процесс инициализации и настройки объекта `RuntimeManager` завершается созданием и настройкой всех необходимых компонентов и регистрацией доступных модулей. После этого экземпляр `RuntimeManager` готов к дальнейшему использованию и управлению временем выполнения приложения.\n\n---\n\n### Поток данных и выполнения кратко:\n1. Вызов конструктора `RuntimeManager`.\n2. Передача параметров.\n3. Настройка внутренних атрибутов и компонентов.\n4. Регистрация модулей." - }, - "diagnostics": { - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 766, - "evidence_rows": 23, - "evidence_chars": 8302 - }, - "evidence_summary": [ - { - "layer": "C1_SYMBOL_CATALOG", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "count": 8, - "unique_paths": 7 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "count": 10, - "unique_paths": 2 - }, - { - "layer": "C3_ENTRYPOINTS", - "count": 3, - "unique_paths": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 1, - "unique_paths": 1 - } - ], - "prompt_template_id": "intent_code_qa_trace_flow_ru_v1", - "system_prompt_version": "v1" - }, - "timings_ms": { - "prompt_build": 0, - "llm_call": 4768 - } - } - } - ] - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents/20260312_120855/full_chain_plba_code_subintents_plba-fullchain-trace-flow-runtime-manager.md b/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents/20260312_120855/full_chain_plba_code_subintents_plba-fullchain-trace-flow-runtime-manager.md deleted file mode 100644 index 2444250..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents/20260312_120855/full_chain_plba_code_subintents_plba-fullchain-trace-flow-runtime-manager.md +++ /dev/null @@ -1,34 +0,0 @@ -# plba-fullchain-trace-flow-runtime-manager - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_subintents.yaml -- runner: runtime -- mode: full_chain -- passed: True - -## Query -Покажи поток выполнения RuntimeManager - -## Actual -{ - "intent": "CODE_QA", - "sub_intent": "TRACE_FLOW", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 23, - "llm_answer": "## Шаг 1: Инициализация RuntimeManager\n\n### Начало потока данных и выполнения:\nПроцесс начинается с вызова конструктора класса `RuntimeManager` (`__init__`), который является точкой входа для инициализации объекта менеджера времени выполнения.\n\n**Источник:** \n[C3_ENTRYPOINTS]: src/app_runtime/control/http_app.py | app.post \n[C2_DEPENDENCY_GRAPH]: src/app_runtime/core/runtime.py | RuntimeManager.__init__:dataflow_slice\n\n## Шаг 2: Передача параметров конструктору\n\nПри вызове конструктора передаются параметры конфигурации, сервисов, трассировки, здоровья, логирования, рабочих процессов и плоскости управления. Эти параметры используются для настройки нового экземпляра менеджера времени выполнения.\n\n**Обработка параметров:** \n[C0_SOURCE_CHUNKS]: src/app_runtime/core/runtime.py \n```python\ndef __init__(self, \n configuration: ConfigurationManager | None = None, \n services: ServiceContainer | None = None, \n traces: TraceService | None = None, \n health: HealthRegistry | None = None, \n logs: LogManager | None = None, \n workers: WorkerSupervisor | None = None, \n control_plane: ControlPlaneService | None = None):\n```\n\nПараметры могут быть переданы явно пользователем или приняты по умолчанию через соответствующие классы-конструкторы.\n\n## Шаг 3: Настройка внутренних атрибутов RuntimeManager\n\nПосле передачи параметров выполняется настройка внутренних атрибутов объекта `RuntimeManager`. В частности, создаются следующие внутренние компоненты:\n\n- `configuration`: объект для управления конфигурацией приложения.\n- `services`: контейнер для хранения различных сервисов, необходимых приложению.\n- `traces`: сервис для ведения журнала событий.\n- `health`: реестр состояния здоровья системы.\n- `logs`: менеджер логирования.\n- `workers`: супервизор рабочих процессов.\n- `control_plane`: плоскость управления, обеспечивающая связь с внешним миром.\n\nЭти компоненты играют важную роль в дальнейшей работе менеджера времени выполнения.\n\n**Настройки атрибутов:** \n[C0_SOURCE_CHUNKS]: src/app_runtime/core/runtime.py \n```python\nself.configuration = configuration or ConfigurationManager()\nself.services = services or ServiceContainer()\nself.traces = traces or TraceService()\nself.health = health or HealthRegistry()\nself.logs = logs or LogManager()\nself.workers = workers or WorkerSupervisor()\nself.control_plane = control_plane or ControlPlaneService()\n```\n\n## Шаг 4: Регистрация модулей\n\nДалее происходит регистрация модулей с использованием внутреннего реестра `registry`, что позволяет системе распознавать доступные модули и обеспечивать их корректную работу.\n\n**Регистрация модулей:** \n[C0_SOURCE_CHUNKS]: src/app_runtime/core/runtime.py \n```python\nself.registry = ModuleRegistry(self.services)\n```\n\n## Заключение\n\nТаким образом, процесс инициализации и настройки объекта `RuntimeManager` завершается созданием и настройкой всех необходимых компонентов и регистрацией доступных модулей. После этого экземпляр `RuntimeManager` готов к дальнейшему использованию и управлению временем выполнения приложения.\n\n---\n\n### Поток данных и выполнения кратко:\n1. Вызов конструктора `RuntimeManager`.\n2. Передача параметров.\n3. Настройка внутренних атрибутов и компонентов.\n4. Регистрация модулей.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "RuntimeManager" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] -} - -## Mismatches -- none \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents/20260312_120855/summary.md b/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents/20260312_120855/summary.md deleted file mode 100644 index 509e84d..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents/20260312_120855/summary.md +++ /dev/null @@ -1,36 +0,0 @@ -# pipeline_setup_v2 summary - -Passed: 7/7 - -| File | Case | Query | Expected sub-intent | Intent | Actual sub-intent | RAG layers | Pass | -|------|------|-------|---------------------|--------|-------------------|------------|------| -| full_chain_plba_code_subintents.yaml | plba-fullchain-open-file-runtime | Открой файл src/app_runtime/core/runtime.py | OPEN_FILE | CODE_QA | OPEN_FILE | C0_SOURCE_CHUNKS:1 | ✓ | -| full_chain_plba_code_subintents.yaml | plba-fullchain-explain-runtime-manager | Объясни как работает класс RuntimeManager | EXPLAIN | CODE_QA | EXPLAIN | C0_SOURCE_CHUNKS:1, C1_SYMBOL_CATALOG:1, C2_DEPENDENCY_GRAPH:6, C3_ENTRYPOINTS:3, C4_SEMANTIC_ROLES:1 | ✓ | -| full_chain_plba_code_subintents.yaml | plba-fullchain-find-tests-runtime-manager | Где тесты для RuntimeManager? | FIND_TESTS | CODE_QA | FIND_TESTS | C0_SOURCE_CHUNKS:10, C2_DEPENDENCY_GRAPH:6 | ✓ | -| full_chain_plba_code_subintents.yaml | plba-fullchain-find-entrypoints | Найди точки входа в коде | FIND_ENTRYPOINTS | CODE_QA | FIND_ENTRYPOINTS | C0_SOURCE_CHUNKS:6, C3_ENTRYPOINTS:3 | ✓ | -| full_chain_plba_code_subintents.yaml | plba-fullchain-trace-flow-runtime-manager | Покажи поток выполнения RuntimeManager | TRACE_FLOW | CODE_QA | TRACE_FLOW | C0_SOURCE_CHUNKS:1, C1_SYMBOL_CATALOG:1, C2_DEPENDENCY_GRAPH:10, C3_ENTRYPOINTS:3, C4_SEMANTIC_ROLES:8 | ✓ | -| full_chain_plba_code_subintents.yaml | plba-fullchain-architecture-control-plane | Какие компоненты участвуют в RuntimeManager? | ARCHITECTURE | CODE_QA | ARCHITECTURE | C0_SOURCE_CHUNKS:1, C1_SYMBOL_CATALOG:1, C2_DEPENDENCY_GRAPH:8, C3_ENTRYPOINTS:3, C4_SEMANTIC_ROLES:12 | ✓ | -| full_chain_plba_code_subintents.yaml | plba-fullchain-explain-local-runtime-manager | Почему в файле src/app_runtime/core/runtime.py класс RuntimeManager устроен так? | EXPLAIN_LOCAL | CODE_QA | EXPLAIN_LOCAL | C0_SOURCE_CHUNKS:1, C1_SYMBOL_CATALOG:1, C2_DEPENDENCY_GRAPH:4 | ✓ | - -## LLM Answers -- **plba-fullchain-open-file-runtime** - Query: Открой файл src/app_runtime/core/runtime.py - > Файл \`src/app\_runtime/core/runtime.py\` содержит определение класса \`RuntimeManager\`, являющегося ключевым компонентом системы управления выполнением приложений. \#\# Важные сущности и их значение: \- \*\*Класс \`RuntimeManager\`:\*\* Основной управляющий класс, инициализирующий различные сервисы и модули приложения. \- Переменные класса: \- \`ACTION\_TIMEOUT\_SECONDS\` и \`ACTION\_POLL\_INTERVAL\_SECONDS\`: настройки тайм\-аутов и интервалов опроса действий. \- Метод \`\_\_init\_\_\`: Конструктор класса, принимающий различные компоненты инфраструктуры \(конфигурации, службы, трассировки, здоровье, логирование, управление рабочими процессами и контрольная плоскость\). \- Метод \`\_register\_core\_services\`: Регистрация основных сервисов внутри runtime менеджера. Этот класс является точкой входа и основным управляющим элементом при запуске и управлении приложением, обеспечивая интеграцию различных компо… -- **plba-fullchain-explain-runtime-manager** - Query: Объясни как работает класс RuntimeManager - > \#\# Назначение класса \`RuntimeManager\` Класс \`RuntimeManager\` является ключевым компонентом системы управления жизненным циклом приложения. Он отвечает за координацию работы различных модулей и сервисов приложения, обеспечивая централизованное управление состоянием и конфигурацией всех компонентов. Этот компонент выступает в качестве управляющего слоя, обеспечивающего синхронизацию и интеграцию различных частей архитектуры. \#\# Ключевые зависимости Ключевыми зависимостями являются следующие компоненты: \- \*\*ConfigurationManager\*\*: Менеджер конфигурации для настройки параметров приложения. \- \*\*ServiceContainer\*\*: Контейнер служб, содержащий различные сервисы и модули приложения. \- \*\*TraceService\*\*: Сервис трассировки, предназначенный для отслеживания выполнения действий и операций внутри приложения. \- \*\*HealthRegistry\*\*: Реестр состояния здоровья приложения, позволяющий… -- **plba-fullchain-find-tests-runtime-manager** - Query: Где тесты для RuntimeManager? - > Прямые тесты для \`RuntimeManager\` найдены в следующих местах: 1. \*\*tests/test\_runtime.py\*\*: \- \`test\_runtime\_graceful\_stop\_waits\_until\_worker\_finishes\`: Проверяет корректность остановки \(\`stop\`\) объекта \`RuntimeManager\`, ожидание завершения работающего модуля и корректное изменение статуса на «остановлен» после вызова метода \`stop\`. \- \`test\_runtime\_runs\_worker\_routine\_and\_exposes\_status\`: Тестирует запуск рутины модуля, регистрацию модуля и получение статусной информации от менеджера выполнения. Эти тесты напрямую создают объект \`RuntimeManager\`, регистрируют модули и выполняют различные операции с ним \(запуск, остановка, проверка состояния\). Тесты находятся в слое зависимости \(\`C2\_DEPENDENCY\_GRAPH\`\), а также имеют соответствующие реализации в исходном коде \(\`C0\_SOURCE\_CHUNKS\`\). Общий вывод: \- Прямые тесты для \`RuntimeManager\` существуют и расположены в файле \`tests/t… -- **plba-fullchain-find-entrypoints** - Query: Найди точки входа в коде - > \#\# Финальный ответ: На основании предоставленного контекста RAG, были найдены следующие \*\*точки входа\*\* \(entrypoints\) и их роли в приложении: \#\#\# 1. \`src/app\_runtime/control/http\_app.py\` \*\*app.post\*\*: \*Файл:\* \`http\_app.py\`, \*сущность:\* FastAPI приложение \(\`app\`\), метод:\`post\`. \*Роль:\* Обрабатывает HTTP POST\-запросы. \#\#\# 2. \`src/app\_runtime/control/http\_app.py\` \*\*app.get\*\*: \*Файл:\* \`http\_app.py\`, \*сущность:\* FastAPI приложение \(\`app\`\), метод:\`get\`. \*Роль:\* Обрабатывает HTTP GET\-запросы. Эти две точки являются основными точками входа для обработки HTTP запросов в приложении с использованием фреймворка FastAPI. \-\-\- Остальные фрагменты информации касаются следующих аспектов приложения: \- \`src/app\_runtime/workflow/contracts/result.py\`: содержит класс \`StepResult\`, связанный с результатом выполнения шагов процесса \(успешное завершение, статус\). \- \`src/app\_runtime/config/\_\_… -- **plba-fullchain-trace-flow-runtime-manager** - Query: Покажи поток выполнения RuntimeManager - > \#\# Шаг 1: Инициализация RuntimeManager \#\#\# Начало потока данных и выполнения: Процесс начинается с вызова конструктора класса \`RuntimeManager\` \(\`\_\_init\_\_\`\), который является точкой входа для инициализации объекта менеджера времени выполнения. \*\*Источник:\*\* \[C3\_ENTRYPOINTS\]: src/app\_runtime/control/http\_app.py \| app.post \[C2\_DEPENDENCY\_GRAPH\]: src/app\_runtime/core/runtime.py \| RuntimeManager.\_\_init\_\_:dataflow\_slice \#\# Шаг 2: Передача параметров конструктору При вызове конструктора передаются параметры конфигурации, сервисов, трассировки, здоровья, логирования, рабочих процессов и плоскости управления. Эти параметры используются для настройки нового экземпляра менеджера времени выполнения. \*\*Обработка параметров:\*\* \[C0\_SOURCE\_CHUNKS\]: src/app\_runtime/core/runtime.py \`\`\`python def \_\_init\_\_\(self, configuration: ConfigurationManager \| None = None, services: ServiceContain… -- **plba-fullchain-architecture-control-plane** - Query: Какие компоненты участвуют в RuntimeManager? - > \#\# Архитектурное объяснение подсистемы RuntimeManager \#\#\# Основные компоненты и их роли 1. \*\*RuntimeManager\*\* \- Роль: Pipeline stage \(этап конвейера\) \- Описание: Менеджер, координирующий роль\-подобные вызовы, чтение и запись состояния атрибутов, участие в данных срезах потока выполнения. 2. \*\*ControlActionSet\*\* \- Роль: Модель \- Описание: Представляет собой модель поведения системы управления действиями. \#\#\# Связи и границы ответственности 1. \*\*Связь с HTTP приложением \(app.post\)\*\* \- Контроллер HTTP приложения инициирует выполнение контроллеров управления через метод \`app.post\`. 2. \*\*Связь с ControlPlaneService\*\* \- Инициализация сервиса \(\`ControlPlaneService.\_\_init\_\_\`\) запускает каналы передачи данных и асинхронную обработку \(\`\_start\_async\`\). 3. \*\*Связь с RuntimeManager\*\* \- Инициализация менеджера \(\`RuntimeManager.\_\_init\_\_\`\) устанавливает конфигурацию и запускает осно… -- **plba-fullchain-explain-local-runtime-manager** - Query: Почему в файле src/app_runtime/core/runtime.py класс RuntimeManager устроен так? - > Класс \`RuntimeManager\` в файле \`src/app\_runtime/core/runtime.py\` предназначен для управления жизненным циклом приложения и координации различных компонентов системы. \#\#\# Что делает класс \`RuntimeManager\`? Этот класс инициализирует и запускает основные компоненты приложения, такие как конфигурация \(\`configuration\`\), сервисы \(\`services\`\), мониторинг состояния \(\`health\`\), логирование \(\`logs\`\), управление рабочими процессами \(\`workers\`\) и контрольную плоскость \(\`control\_plane\`\). \#\#\# Входные параметры конструктора класса: \- \`configuration\`: Менеджер конфигурации \(по умолчанию используется экземпляр \`ConfigurationManager\(\)\`\). \- \`services\`: Контейнер сервисов \(по умолчанию – \`ServiceContainer\(\)\`\). \- \`traces\`: Сервис трассировки \(по умолчанию – \`TraceService\(\)\`\). \- \`health\`: Реестр здоровья \(по умолчанию – \`HealthRegistry\(\)\`\). \- \`logs\`: Менеджер логирования \(по умолчанию – \`… \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents/20260312_123945/full_chain_plba_code_subintents_plba-fullchain-architecture-control-plane.json b/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents/20260312_123945/full_chain_plba_code_subintents_plba-fullchain-architecture-control-plane.json deleted file mode 100644 index c13104e..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents/20260312_123945/full_chain_plba_code_subintents_plba-fullchain-architecture-control-plane.json +++ /dev/null @@ -1,3036 +0,0 @@ -{ - "case_id": "plba-fullchain-architecture-control-plane", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_subintents.yaml", - "runner": "runtime", - "mode": "full_chain", - "actual": { - "intent": "CODE_QA", - "sub_intent": "ARCHITECTURE", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 25, - "llm_answer": "1. **Компоненты, которые подтверждены контекстом**:\n - RuntimeManager\n - ControlActionSet\n - ControlPlaneService\n \n2. **Подтверждённые связи между ними**:\n - RuntimeManager вызывает метод `start` для инициализации.\n - ControlPlaneService инициализирует каналы данных через метод `_channels`.\n - ControlPlaneService запускает асинхронную обработку через метод `_start_async`.\n\n3. **Границы ответственности, если они реально видны в коде**:\n - RuntimeManager отвечает за управление жизненным циклом системы, включая чтение и запись состояния атрибутов.\n - ControlActionSet выполняет роль модели и предоставляет базовые функции поведения.\n - ControlPlaneService управляет сервисами канала данных и их асинхронной обработкой.\n\n4. **Что остаётся неизвестным или неполным**:\n - Детали реализации взаимодействия между ControlActionSet и RuntimeManager остаются неясными.\n - Полная структура данных потока и зависимость компонентов от внешних сервисов не раскрыты.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "RuntimeManager" - ], - "layers": [ - "C4_SEMANTIC_ROLES", - "C3_ENTRYPOINTS", - "C2_DEPENDENCY_GRAPH", - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS" - ] - }, - "passed": true, - "mismatches": [], - "details": { - "case_id": "plba-fullchain-architecture-control-plane", - "text": "Какие компоненты участвуют в RuntimeManager?", - "mode": "full_chain", - "run_started_at": "2026-03-12T12:39:45", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Какие компоненты участвуют в RuntimeManager?", - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "RuntimeManager", - "alternatives": [ - "RuntimeManager" - ], - "confidence": 0.99 - }, - "rag_count": 25, - "rag_rows": [ - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests manager\n- orchestrates role-like calls (4)\n- reads and writes state attributes\n- participates in dataflow slices (50)", - "layer": "C4_SEMANTIC_ROLES", - "title": "RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 43, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "7e4a9381328c5803bbc6179458612fc4e947d928aa7bf8b4b2bebb2c8592f758", - "symbol_name": "RuntimeManager", - "qname": "RuntimeManager", - "role": "pipeline_stage", - "confidence": 0.67, - "dataflow_participation": 50, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "ControlActionSet\nrole: model\n\nResponsibilities:\n- default model role", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlActionSet", - "span_start": 14, - "span_end": 18, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 40, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "46eb026cb3313415ec47b82dd22f84f4d112c9d987e8b1716dcb0baa1cce8988", - "symbol_name": "ControlActionSet", - "qname": "ControlActionSet", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "ControlChannel\nrole: model\n\nResponsibilities:\n- default model role", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlChannel", - "span_start": 21, - "span_end": 28, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 40, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "cfcfe9a311d3a2dbdaf32ac4ccd73c0eb9a117f830591a1c0867ee97d46204ff", - "symbol_name": "ControlChannel", - "qname": "ControlChannel", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests service\n- reads and writes state attributes\n- participates in dataflow slices (5)", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlPlaneService", - "span_start": 12, - "span_end": 52, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 68, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "b13471e5916986dccffb53fab613812842965705e6b3a89ae549d30c9e91e9aa", - "symbol_name": "ControlPlaneService", - "qname": "ControlPlaneService", - "role": "pipeline_stage", - "confidence": 0.57, - "dataflow_participation": 5, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_runner.py", - "content": "UvicornThreadRunner\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (24)", - "layer": "C4_SEMANTIC_ROLES", - "title": "UvicornThreadRunner", - "span_start": 10, - "span_end": 61, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 11, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "fd55630045a02100df8877ac27d951ee08617d4598764394d48cb51fe067476a", - "symbol_name": "UvicornThreadRunner", - "qname": "UvicornThreadRunner", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 24, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "3779fdd2878b770e789a35bb2a89c9d79f13b61c26d7db1b3b683f9bb9e1623f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (10)", - "layer": "C4_SEMANTIC_ROLES", - "title": "HttpControlChannel", - "span_start": 12, - "span_end": 57, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 21, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "1c9fbdc24819e5604c26ea55428a74310f03a03e1af197ed84846af61e42fdb0", - "symbol_name": "HttpControlChannel", - "qname": "HttpControlChannel", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 10, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "HttpControlAppFactory\nrole: factory\n\nResponsibilities:\n- name suffix suggests factory", - "layer": "C4_SEMANTIC_ROLES", - "title": "HttpControlAppFactory", - "span_start": 15, - "span_end": 53, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 39, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "9b3502a5fb408b273223db13264349cf500de24915b6c649d9ea8970d0dfd8e0", - "symbol_name": "HttpControlAppFactory", - "qname": "HttpControlAppFactory", - "role": "factory", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/persistence/workflow_persistence.py", - "content": "WorkflowPersistence\nrole: pipeline_stage\n\nResponsibilities:\n- orchestrates role-like calls (2)\n- reads and writes state attributes\n- participates in dataflow slices (16)", - "layer": "C4_SEMANTIC_ROLES", - "title": "WorkflowPersistence", - "span_start": 8, - "span_end": 54, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 15, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "7bd01ee45cf31f2d5c2e3e51656254860ac785d10cef9e0852cd4fba90857bae", - "symbol_name": "WorkflowPersistence", - "qname": "WorkflowPersistence", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 16, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "80e9410ddc639789b4353c2a1a757ba8d0d5b5bb6075b0b263b61551f04ae1f0", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/queue/in_memory.py", - "content": "InMemoryTaskQueue\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (9)", - "layer": "C4_SEMANTIC_ROLES", - "title": "InMemoryTaskQueue", - "span_start": 9, - "span_end": 38, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 22, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "2da04cb94544a3bcbf0943a95ad4bdd8710bcafaa32a02fd0e4de2178dcf3533", - "symbol_name": "InMemoryTaskQueue", - "qname": "InMemoryTaskQueue", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 9, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "58f0cc001ccda0eee4c6bc32ed83bd05eafd6b6644f1e8b4aa9eed3103db73dc", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/config/file_loader.py", - "content": "ConfigFileLoader\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (8)", - "layer": "C4_SEMANTIC_ROLES", - "title": "ConfigFileLoader", - "span_start": 11, - "span_end": 48, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 23, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "a8474eca8b6e9dc86ae67ed68b16fa5fb639ef08739c053e7b7195489765667f", - "symbol_name": "ConfigFileLoader", - "qname": "ConfigFileLoader", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 8, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "1f19ffebde5e38e4be5a5d5a678059a0f36dedb8fb8b3e00ab395c67106a87ea", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/store.py", - "content": "TraceContextStore\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (6)", - "layer": "C4_SEMANTIC_ROLES", - "title": "TraceContextStore", - "span_start": 15, - "span_end": 52, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 25, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "b2dad4fbe16ffb11b58deba311c7739955c39d59f291b22181f33e9c8cce4059", - "symbol_name": "TraceContextStore", - "qname": "TraceContextStore", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 6, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "d369554f08fc92039c6edd5a2a1e73b23901533e8974459170bbd9347d263dc5", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workers/supervisor.py", - "content": "WorkerSupervisor\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (6)", - "layer": "C4_SEMANTIC_ROLES", - "title": "WorkerSupervisor", - "span_start": 10, - "span_end": 59, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 25, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "c17b44e8d9e97d490989b21fa67d7c346cdda8a0472e4c41fb243c8846faa124", - "symbol_name": "WorkerSupervisor", - "qname": "WorkerSupervisor", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 6, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "77609d9d5927171cce7fc3a54897c183fd63068710c6362029b700937aae5eee", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._start_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 47, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517", - "dst_ref": "ControlPlaneService._start_async", - "resolution": "resolved", - "slice_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._start_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager.start", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 32, - "span_end": 59, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "98312ace7fc62b1c7194c5aa1732b6ef736eae1668a3a120dd1ecd5ab1d64f7a", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "77a7b260193018845e4e204df094ab89cfd7c82ee4e822b3a83ad4cd945f9cb1", - "dst_ref": "RuntimeManager.start", - "resolution": "resolved", - "slice_id": "98312ace7fc62b1c7194c5aa1732b6ef736eae1668a3a120dd1ecd5ab1d64f7a", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager.start" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "77a7b260193018845e4e204df094ab89cfd7c82ee4e822b3a83ad4cd945f9cb1" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.start", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 20, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154", - "dst_ref": "ControlPlaneService.start", - "resolution": "resolved", - "slice_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.start" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.stop", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 25, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d", - "dst_ref": "ControlPlaneService.stop", - "resolution": "resolved", - "slice_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.stop" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._stop_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 51, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a", - "dst_ref": "ControlPlaneService._stop_async", - "resolution": "resolved", - "slice_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._stop_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager.add_config_file", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 32, - "span_end": 52, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "a23b8a11ebdb12708b60c96ea12a69f7f042082f1adfddd572444e246d81d167", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "57ffbd4f0d9fdf3507c2b8624312ce211f3d02fdf86a57a8ec90778d8a7b498d", - "dst_ref": "RuntimeManager.add_config_file", - "resolution": "resolved", - "slice_id": "a23b8a11ebdb12708b60c96ea12a69f7f042082f1adfddd572444e246d81d167", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager.add_config_file" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "57ffbd4f0d9fdf3507c2b8624312ce211f3d02fdf86a57a8ec90778d8a7b498d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.register_channel", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 17, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957", - "dst_ref": "ControlPlaneService.register_channel", - "resolution": "resolved", - "slice_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.register_channel" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager._register_core_services", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 32, - "span_end": 127, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "3e5811f3b511fa0cabe363f5d01f2ac5fa039bc8b93f7ee108323e1f5f45a293", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "972d6057a6caac9cf31ebc1e29c6f39f71b10d4cc170dec57cf875ba458549c6", - "dst_ref": "RuntimeManager._register_core_services", - "resolution": "resolved", - "slice_id": "3e5811f3b511fa0cabe363f5d01f2ac5fa039bc8b93f7ee108323e1f5f45a293", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager._register_core_services" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "972d6057a6caac9cf31ebc1e29c6f39f71b10d4cc170dec57cf875ba458549c6" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "class RuntimeManager\nRuntimeManager", - "layer": "C1_SYMBOL_CATALOG", - "title": "RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "7e4a9381328c5803bbc6179458612fc4e947d928aa7bf8b4b2bebb2c8592f758", - "qname": "RuntimeManager", - "kind": "class", - "signature": "RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.core.runtime", - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "class RuntimeManager:\n ACTION_TIMEOUT_SECONDS = 10.0\n ACTION_POLL_INTERVAL_SECONDS = 0.05\n\n def __init__(\n self,\n configuration: ConfigurationManager | None = None,\n services: ServiceContainer | None = None,\n traces: TraceService | None = None,\n health: HealthRegistry | None = None,\n logs: LogManager | None = None,\n workers: WorkerSupervisor | None = None,\n control_plane: ControlPlaneService | None = None,\n ) -> None:\n self.configuration = configuration or ConfigurationManager()\n self.services = services or ServiceContainer()\n self.traces = traces or TraceService()\n self.health = health or HealthRegistry()\n self.logs = logs or LogManager()\n self.workers = workers or WorkerSupervisor()\n self.control_plane = control_plane or ControlPlaneService()\n self.registry = ModuleRegistry(self.services)\n self._started = False\n self._state = LifecycleState.IDLE\n self._core_registered = False\n self._workers_registered = False\n self._register_core_services()\n\n def register_module(self, module: ApplicationModule) -> None:\n self.registry.register_module(module.name)\n module.register(self.registry)\n\n def add_config_file(self, path: str) -> FileConfigProvider:\n provider = FileConfigProvider(path)\n self.configuration.add_provider(provider)\n return provider\n\n def start(self, *, start_control_plane: bool = True) -> None:\n if self._started:\n return\n self._state = LifecycleState.STARTING\n config = self.configuration.load()\n self.logs.apply_config(config)\n self._register_health_contributors()\n self._register_workers()\n self.workers.start()\n if start_control_plane:\n self.control_plane.start(self)\n self._started = True\n self._refresh_state()\n\n def stop(self, timeout: float = 30.0, force: bool = False, stop_control_plane: bool = True) -> None:\n if not self._started:\n return\n self._state = LifecycleState.STOPPING\n self.workers.stop(timeout=timeout, force=force)\n if stop_control_plane:\n self.control_plane.stop()\n self._started = False\n self._state = LifecycleState.STOPPED\n\n def status(self) -> dict[str, object]:\n self._refresh_state()\n return self.control_plane.snapshot(self)\n\n def current_health(self) -> HealthPayload:\n self._refresh_state()\n return self.health.payload(self._state, self.workers.healths())\n\n async def health_status(self) -> HealthPayload:\n return self.current_health()\n\n async def start_runtime(self) -> dict[str, object] | str:\n self._refresh_state()\n if self._started:\n return \"runtime already running\"\n if self._state == LifecycleState.STOPPING:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n\n self.start(start_control_plane=False)\n started = self._wait_for_state({LifecycleState.IDLE, LifecycleState.BUSY}, timeout=self.ACTION_TIMEOUT_SECONDS)\n if started:\n return self._action_detail(\"runtime started\", timed_out=False)\n return self._action_detail(\"runtime start is still in progress\", timed_out=True)\n\n async def stop_runtime(self) -> dict[str, object] | str:\n self._refresh_state()\n if not self._started:\n if self._state == LifecycleState.STOPPING:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n return \"runtime already stopped\"\n\n self._state = LifecycleState.STOPPING\n try:\n self.workers.stop(timeout=self.ACTION_TIMEOUT_SECONDS, force=False)\n except TimeoutError:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n\n self._started = False\n self._state = LifecycleState.STOPPED\n return self._action_detail(\"runtime stopped\", timed_out=False)\n\n async def runtime_status(self) -> str:\n self._refresh_state()\n return self._state.value\n\n def _register_core_services(self) -> None:\n if self._core_registered:\n return\n self.services.register(\"configuration\", self.configuration)\n self.services.register(\"traces\", self.traces)\n self.services.register(\"health\", self.health)\n self.services.register(\"logs\", self.logs)\n self.services.register(\"workers\", self.workers)\n self.services.register(\"control_plane\", self.control_plane)\n self._core_registered = True\n\n def _register_health_contributors(self) -> None:\n for contributor in self.registry.health_contributors:\n self.health.register(contributor)\n\n def _register_workers(self) -> None:\n if self._workers_registered:\n return\n for worker in self.registry.workers:\n self.workers.register(worker)\n self._workers_registered = True\n\n def _refresh_state(self) -> None:\n lifecycle = self.workers.lifecycle_state()\n\n if self._state == LifecycleState.STOPPING:\n if lifecycle == LifecycleState.STOPPED:\n self._started = False\n self._state = LifecycleState.STOPPED\n return\n\n if not self._started:\n if lifecycle == LifecycleState.STOPPED:\n self._state = LifecycleState.STOPPED\n return\n\n self._state = lifecycle\n\n def _wait_for_state(self, target_states: set[LifecycleState], *, timeout: float) -> bool:\n deadline = monotonic() + timeout\n while monotonic() < deadline:\n self._refresh_state()\n if self._state in target_states:\n return True\n sleep(self.ACTION_POLL_INTERVAL_SECONDS)\n self._refresh_state()\n return self._state in target_states\n\n def _action_detail(self, message: str, *, timed_out: bool) -> dict[str, object]:\n self._refresh_state()\n return {\n \"message\": message,\n \"state\": self._state.value,\n \"timed_out\": timed_out,\n \"workers\": self.workers.snapshot(),\n }", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/core/runtime.py:RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.core.runtime", - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "llm_answer": "1. **Компоненты, которые подтверждены контекстом**:\n - RuntimeManager\n - ControlActionSet\n - ControlPlaneService\n \n2. **Подтверждённые связи между ними**:\n - RuntimeManager вызывает метод `start` для инициализации.\n - ControlPlaneService инициализирует каналы данных через метод `_channels`.\n - ControlPlaneService запускает асинхронную обработку через метод `_start_async`.\n\n3. **Границы ответственности, если они реально видны в коде**:\n - RuntimeManager отвечает за управление жизненным циклом системы, включая чтение и запись состояния атрибутов.\n - ControlActionSet выполняет роль модели и предоставляет базовые функции поведения.\n - ControlPlaneService управляет сервисами канала данных и их асинхронной обработкой.\n\n4. **Что остаётся неизвестным или неполным**:\n - Детали реализации взаимодействия между ControlActionSet и RuntimeManager остаются неясными.\n - Полная структура данных потока и зависимость компонентов от внешних сервисов не раскрыты.", - "summary": { - "router": { - "intent": "CODE_QA", - "sub_intent": "ARCHITECTURE", - "confidence": null - }, - "retrieval": { - "profile": "code", - "layers_hit": [ - "C0_SOURCE_CHUNKS", - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS", - "C4_SEMANTIC_ROLES" - ], - "evidence_sufficient": true - }, - "llm": { - "answer_status": "answered", - "groundedness": "grounded" - } - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "ARCHITECTURE", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C4_SEMANTIC_ROLES", - "C3_ENTRYPOINTS", - "C2_DEPENDENCY_GRAPH", - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "RuntimeManager" - ], - "keyword_hints": [ - "RuntimeManager" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "execution": { - "executed_layers": [ - "C4_SEMANTIC_ROLES", - "C3_ENTRYPOINTS", - "C2_DEPENDENCY_GRAPH", - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS" - ], - "retrieval_mode_by_layer": { - "C4_SEMANTIC_ROLES": "exact_path_fetch", - "C3_ENTRYPOINTS": "exact_path_fetch", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C1_SYMBOL_CATALOG": "symbol_search", - "C0_SOURCE_CHUNKS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C4_SEMANTIC_ROLES": 12, - "C3_ENTRYPOINTS": 8, - "C2_DEPENDENCY_GRAPH": 8, - "C1_SYMBOL_CATALOG": 6, - "C0_SOURCE_CHUNKS": 4 - }, - "filters_by_layer": { - "C4_SEMANTIC_ROLES": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C1_SYMBOL_CATALOG": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C4_SEMANTIC_ROLES", - "query": "Какие компоненты участвуют в RuntimeManager?", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 12, - "ranking_profile": "code" - }, - { - "layer": "C3_ENTRYPOINTS", - "query": "Какие компоненты участвуют в RuntimeManager?", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "Какие компоненты участвуют в RuntimeManager?", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C1_SYMBOL_CATALOG", - "query": "RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Какие компоненты участвуют в RuntimeManager?", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 4, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C4_SEMANTIC_ROLES", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 12, - "candidates_after_filter": 12 - }, - { - "layer": "C3_ENTRYPOINTS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 3, - "candidates_after_filter": 3 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 1, - "candidates_after_filter": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 4, - "candidates_after_filter": 4 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "RuntimeManager", - "alternatives": [ - "RuntimeManager" - ] - }, - "layers": [ - { - "layer": "C4_SEMANTIC_ROLES", - "status": "hit", - "hit_count": 12, - "fail_reason": null - }, - { - "layer": "C3_ENTRYPOINTS", - "status": "hit", - "hit_count": 3, - "fail_reason": null - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 8, - "fail_reason": null - }, - { - "layer": "C1_SYMBOL_CATALOG", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 1, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "router": 0, - "symbol_resolution": 0, - "retrieval_total": 155, - "retrieval_by_layer": { - "C4_SEMANTIC_ROLES": 30, - "C3_ENTRYPOINTS": 17, - "C2_DEPENDENCY_GRAPH": 65, - "C1_SYMBOL_CATALOG": 25, - "C0_SOURCE_CHUNKS": 16 - }, - "merge_rank": 19, - "prompt_build": 0, - "llm_call": 1669 - }, - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 537, - "evidence_rows": 25, - "evidence_chars": 8651 - }, - "evidence_summary": [ - { - "layer": "C4_SEMANTIC_ROLES", - "count": 12, - "unique_paths": 11 - }, - { - "layer": "C3_ENTRYPOINTS", - "count": 3, - "unique_paths": 1 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "count": 8, - "unique_paths": 2 - }, - { - "layer": "C1_SYMBOL_CATALOG", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 1, - "unique_paths": 1 - } - ], - "prompt_template_id": "intent_code_qa_architecture_ru_v2", - "system_prompt_version": "v1" - }, - "router": { - "conversation_mode": "START", - "keyword_hints": [ - "RuntimeManager" - ], - "path_scope": [] - }, - "llm": { - "used_evidence_count": 25, - "missing_evidence_reason": null - } - }, - "run_info": { - "case_id": "plba-fullchain-architecture-control-plane", - "mode": "full_chain", - "run_started_at": "2026-03-12T12:39:45", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - }, - "input_request": { - "text": "Какие компоненты участвуют в RuntimeManager?", - "normalized_query": "Какие компоненты участвуют в RuntimeManager?" - }, - "steps": [ - { - "step": "intent_router", - "input": { - "query": "Какие компоненты участвуют в RuntimeManager?" - }, - "output": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Какие компоненты участвуют в RuntimeManager?" - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "ARCHITECTURE", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C4_SEMANTIC_ROLES", - "C3_ENTRYPOINTS", - "C2_DEPENDENCY_GRAPH", - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "RuntimeManager" - ], - "keyword_hints": [ - "RuntimeManager" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "timings_ms": { - "router": 0 - } - } - }, - { - "step": "retrieval", - "input": { - "query": "Какие компоненты участвуют в RuntimeManager?" - }, - "output": { - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "RuntimeManager", - "alternatives": [ - "RuntimeManager" - ], - "confidence": 0.99 - }, - "rag_count": 25, - "rag_rows": [ - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests manager\n- orchestrates role-like calls (4)\n- reads and writes state attributes\n- participates in dataflow slices (50)", - "layer": "C4_SEMANTIC_ROLES", - "title": "RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 43, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "7e4a9381328c5803bbc6179458612fc4e947d928aa7bf8b4b2bebb2c8592f758", - "symbol_name": "RuntimeManager", - "qname": "RuntimeManager", - "role": "pipeline_stage", - "confidence": 0.67, - "dataflow_participation": 50, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "ControlActionSet\nrole: model\n\nResponsibilities:\n- default model role", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlActionSet", - "span_start": 14, - "span_end": 18, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 40, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "46eb026cb3313415ec47b82dd22f84f4d112c9d987e8b1716dcb0baa1cce8988", - "symbol_name": "ControlActionSet", - "qname": "ControlActionSet", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "ControlChannel\nrole: model\n\nResponsibilities:\n- default model role", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlChannel", - "span_start": 21, - "span_end": 28, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 40, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "cfcfe9a311d3a2dbdaf32ac4ccd73c0eb9a117f830591a1c0867ee97d46204ff", - "symbol_name": "ControlChannel", - "qname": "ControlChannel", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests service\n- reads and writes state attributes\n- participates in dataflow slices (5)", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlPlaneService", - "span_start": 12, - "span_end": 52, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 68, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "b13471e5916986dccffb53fab613812842965705e6b3a89ae549d30c9e91e9aa", - "symbol_name": "ControlPlaneService", - "qname": "ControlPlaneService", - "role": "pipeline_stage", - "confidence": 0.57, - "dataflow_participation": 5, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_runner.py", - "content": "UvicornThreadRunner\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (24)", - "layer": "C4_SEMANTIC_ROLES", - "title": "UvicornThreadRunner", - "span_start": 10, - "span_end": 61, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 11, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "fd55630045a02100df8877ac27d951ee08617d4598764394d48cb51fe067476a", - "symbol_name": "UvicornThreadRunner", - "qname": "UvicornThreadRunner", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 24, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "3779fdd2878b770e789a35bb2a89c9d79f13b61c26d7db1b3b683f9bb9e1623f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (10)", - "layer": "C4_SEMANTIC_ROLES", - "title": "HttpControlChannel", - "span_start": 12, - "span_end": 57, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 21, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "1c9fbdc24819e5604c26ea55428a74310f03a03e1af197ed84846af61e42fdb0", - "symbol_name": "HttpControlChannel", - "qname": "HttpControlChannel", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 10, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "HttpControlAppFactory\nrole: factory\n\nResponsibilities:\n- name suffix suggests factory", - "layer": "C4_SEMANTIC_ROLES", - "title": "HttpControlAppFactory", - "span_start": 15, - "span_end": 53, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 39, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "9b3502a5fb408b273223db13264349cf500de24915b6c649d9ea8970d0dfd8e0", - "symbol_name": "HttpControlAppFactory", - "qname": "HttpControlAppFactory", - "role": "factory", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/persistence/workflow_persistence.py", - "content": "WorkflowPersistence\nrole: pipeline_stage\n\nResponsibilities:\n- orchestrates role-like calls (2)\n- reads and writes state attributes\n- participates in dataflow slices (16)", - "layer": "C4_SEMANTIC_ROLES", - "title": "WorkflowPersistence", - "span_start": 8, - "span_end": 54, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 15, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "7bd01ee45cf31f2d5c2e3e51656254860ac785d10cef9e0852cd4fba90857bae", - "symbol_name": "WorkflowPersistence", - "qname": "WorkflowPersistence", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 16, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "80e9410ddc639789b4353c2a1a757ba8d0d5b5bb6075b0b263b61551f04ae1f0", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/queue/in_memory.py", - "content": "InMemoryTaskQueue\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (9)", - "layer": "C4_SEMANTIC_ROLES", - "title": "InMemoryTaskQueue", - "span_start": 9, - "span_end": 38, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 22, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "2da04cb94544a3bcbf0943a95ad4bdd8710bcafaa32a02fd0e4de2178dcf3533", - "symbol_name": "InMemoryTaskQueue", - "qname": "InMemoryTaskQueue", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 9, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "58f0cc001ccda0eee4c6bc32ed83bd05eafd6b6644f1e8b4aa9eed3103db73dc", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/config/file_loader.py", - "content": "ConfigFileLoader\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (8)", - "layer": "C4_SEMANTIC_ROLES", - "title": "ConfigFileLoader", - "span_start": 11, - "span_end": 48, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 23, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "a8474eca8b6e9dc86ae67ed68b16fa5fb639ef08739c053e7b7195489765667f", - "symbol_name": "ConfigFileLoader", - "qname": "ConfigFileLoader", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 8, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "1f19ffebde5e38e4be5a5d5a678059a0f36dedb8fb8b3e00ab395c67106a87ea", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/store.py", - "content": "TraceContextStore\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (6)", - "layer": "C4_SEMANTIC_ROLES", - "title": "TraceContextStore", - "span_start": 15, - "span_end": 52, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 25, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "b2dad4fbe16ffb11b58deba311c7739955c39d59f291b22181f33e9c8cce4059", - "symbol_name": "TraceContextStore", - "qname": "TraceContextStore", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 6, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "d369554f08fc92039c6edd5a2a1e73b23901533e8974459170bbd9347d263dc5", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workers/supervisor.py", - "content": "WorkerSupervisor\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (6)", - "layer": "C4_SEMANTIC_ROLES", - "title": "WorkerSupervisor", - "span_start": 10, - "span_end": 59, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 25, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "c17b44e8d9e97d490989b21fa67d7c346cdda8a0472e4c41fb243c8846faa124", - "symbol_name": "WorkerSupervisor", - "qname": "WorkerSupervisor", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 6, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "77609d9d5927171cce7fc3a54897c183fd63068710c6362029b700937aae5eee", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._start_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 47, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517", - "dst_ref": "ControlPlaneService._start_async", - "resolution": "resolved", - "slice_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._start_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager.start", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 32, - "span_end": 59, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "98312ace7fc62b1c7194c5aa1732b6ef736eae1668a3a120dd1ecd5ab1d64f7a", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "77a7b260193018845e4e204df094ab89cfd7c82ee4e822b3a83ad4cd945f9cb1", - "dst_ref": "RuntimeManager.start", - "resolution": "resolved", - "slice_id": "98312ace7fc62b1c7194c5aa1732b6ef736eae1668a3a120dd1ecd5ab1d64f7a", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager.start" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "77a7b260193018845e4e204df094ab89cfd7c82ee4e822b3a83ad4cd945f9cb1" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.start", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 20, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154", - "dst_ref": "ControlPlaneService.start", - "resolution": "resolved", - "slice_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.start" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.stop", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 25, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d", - "dst_ref": "ControlPlaneService.stop", - "resolution": "resolved", - "slice_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.stop" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._stop_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 51, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a", - "dst_ref": "ControlPlaneService._stop_async", - "resolution": "resolved", - "slice_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._stop_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager.add_config_file", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 32, - "span_end": 52, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "a23b8a11ebdb12708b60c96ea12a69f7f042082f1adfddd572444e246d81d167", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "57ffbd4f0d9fdf3507c2b8624312ce211f3d02fdf86a57a8ec90778d8a7b498d", - "dst_ref": "RuntimeManager.add_config_file", - "resolution": "resolved", - "slice_id": "a23b8a11ebdb12708b60c96ea12a69f7f042082f1adfddd572444e246d81d167", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager.add_config_file" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "57ffbd4f0d9fdf3507c2b8624312ce211f3d02fdf86a57a8ec90778d8a7b498d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.register_channel", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 17, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957", - "dst_ref": "ControlPlaneService.register_channel", - "resolution": "resolved", - "slice_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.register_channel" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager._register_core_services", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 32, - "span_end": 127, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "3e5811f3b511fa0cabe363f5d01f2ac5fa039bc8b93f7ee108323e1f5f45a293", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "972d6057a6caac9cf31ebc1e29c6f39f71b10d4cc170dec57cf875ba458549c6", - "dst_ref": "RuntimeManager._register_core_services", - "resolution": "resolved", - "slice_id": "3e5811f3b511fa0cabe363f5d01f2ac5fa039bc8b93f7ee108323e1f5f45a293", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager._register_core_services" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "972d6057a6caac9cf31ebc1e29c6f39f71b10d4cc170dec57cf875ba458549c6" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "class RuntimeManager\nRuntimeManager", - "layer": "C1_SYMBOL_CATALOG", - "title": "RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "7e4a9381328c5803bbc6179458612fc4e947d928aa7bf8b4b2bebb2c8592f758", - "qname": "RuntimeManager", - "kind": "class", - "signature": "RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.core.runtime", - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "class RuntimeManager:\n ACTION_TIMEOUT_SECONDS = 10.0\n ACTION_POLL_INTERVAL_SECONDS = 0.05\n\n def __init__(\n self,\n configuration: ConfigurationManager | None = None,\n services: ServiceContainer | None = None,\n traces: TraceService | None = None,\n health: HealthRegistry | None = None,\n logs: LogManager | None = None,\n workers: WorkerSupervisor | None = None,\n control_plane: ControlPlaneService | None = None,\n ) -> None:\n self.configuration = configuration or ConfigurationManager()\n self.services = services or ServiceContainer()\n self.traces = traces or TraceService()\n self.health = health or HealthRegistry()\n self.logs = logs or LogManager()\n self.workers = workers or WorkerSupervisor()\n self.control_plane = control_plane or ControlPlaneService()\n self.registry = ModuleRegistry(self.services)\n self._started = False\n self._state = LifecycleState.IDLE\n self._core_registered = False\n self._workers_registered = False\n self._register_core_services()\n\n def register_module(self, module: ApplicationModule) -> None:\n self.registry.register_module(module.name)\n module.register(self.registry)\n\n def add_config_file(self, path: str) -> FileConfigProvider:\n provider = FileConfigProvider(path)\n self.configuration.add_provider(provider)\n return provider\n\n def start(self, *, start_control_plane: bool = True) -> None:\n if self._started:\n return\n self._state = LifecycleState.STARTING\n config = self.configuration.load()\n self.logs.apply_config(config)\n self._register_health_contributors()\n self._register_workers()\n self.workers.start()\n if start_control_plane:\n self.control_plane.start(self)\n self._started = True\n self._refresh_state()\n\n def stop(self, timeout: float = 30.0, force: bool = False, stop_control_plane: bool = True) -> None:\n if not self._started:\n return\n self._state = LifecycleState.STOPPING\n self.workers.stop(timeout=timeout, force=force)\n if stop_control_plane:\n self.control_plane.stop()\n self._started = False\n self._state = LifecycleState.STOPPED\n\n def status(self) -> dict[str, object]:\n self._refresh_state()\n return self.control_plane.snapshot(self)\n\n def current_health(self) -> HealthPayload:\n self._refresh_state()\n return self.health.payload(self._state, self.workers.healths())\n\n async def health_status(self) -> HealthPayload:\n return self.current_health()\n\n async def start_runtime(self) -> dict[str, object] | str:\n self._refresh_state()\n if self._started:\n return \"runtime already running\"\n if self._state == LifecycleState.STOPPING:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n\n self.start(start_control_plane=False)\n started = self._wait_for_state({LifecycleState.IDLE, LifecycleState.BUSY}, timeout=self.ACTION_TIMEOUT_SECONDS)\n if started:\n return self._action_detail(\"runtime started\", timed_out=False)\n return self._action_detail(\"runtime start is still in progress\", timed_out=True)\n\n async def stop_runtime(self) -> dict[str, object] | str:\n self._refresh_state()\n if not self._started:\n if self._state == LifecycleState.STOPPING:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n return \"runtime already stopped\"\n\n self._state = LifecycleState.STOPPING\n try:\n self.workers.stop(timeout=self.ACTION_TIMEOUT_SECONDS, force=False)\n except TimeoutError:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n\n self._started = False\n self._state = LifecycleState.STOPPED\n return self._action_detail(\"runtime stopped\", timed_out=False)\n\n async def runtime_status(self) -> str:\n self._refresh_state()\n return self._state.value\n\n def _register_core_services(self) -> None:\n if self._core_registered:\n return\n self.services.register(\"configuration\", self.configuration)\n self.services.register(\"traces\", self.traces)\n self.services.register(\"health\", self.health)\n self.services.register(\"logs\", self.logs)\n self.services.register(\"workers\", self.workers)\n self.services.register(\"control_plane\", self.control_plane)\n self._core_registered = True\n\n def _register_health_contributors(self) -> None:\n for contributor in self.registry.health_contributors:\n self.health.register(contributor)\n\n def _register_workers(self) -> None:\n if self._workers_registered:\n return\n for worker in self.registry.workers:\n self.workers.register(worker)\n self._workers_registered = True\n\n def _refresh_state(self) -> None:\n lifecycle = self.workers.lifecycle_state()\n\n if self._state == LifecycleState.STOPPING:\n if lifecycle == LifecycleState.STOPPED:\n self._started = False\n self._state = LifecycleState.STOPPED\n return\n\n if not self._started:\n if lifecycle == LifecycleState.STOPPED:\n self._state = LifecycleState.STOPPED\n return\n\n self._state = lifecycle\n\n def _wait_for_state(self, target_states: set[LifecycleState], *, timeout: float) -> bool:\n deadline = monotonic() + timeout\n while monotonic() < deadline:\n self._refresh_state()\n if self._state in target_states:\n return True\n sleep(self.ACTION_POLL_INTERVAL_SECONDS)\n self._refresh_state()\n return self._state in target_states\n\n def _action_detail(self, message: str, *, timed_out: bool) -> dict[str, object]:\n self._refresh_state()\n return {\n \"message\": message,\n \"state\": self._state.value,\n \"timed_out\": timed_out,\n \"workers\": self.workers.snapshot(),\n }", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/core/runtime.py:RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.core.runtime", - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ] - }, - "diagnostics": { - "execution": { - "executed_layers": [ - "C4_SEMANTIC_ROLES", - "C3_ENTRYPOINTS", - "C2_DEPENDENCY_GRAPH", - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS" - ], - "retrieval_mode_by_layer": { - "C4_SEMANTIC_ROLES": "exact_path_fetch", - "C3_ENTRYPOINTS": "exact_path_fetch", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C1_SYMBOL_CATALOG": "symbol_search", - "C0_SOURCE_CHUNKS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C4_SEMANTIC_ROLES": 12, - "C3_ENTRYPOINTS": 8, - "C2_DEPENDENCY_GRAPH": 8, - "C1_SYMBOL_CATALOG": 6, - "C0_SOURCE_CHUNKS": 4 - }, - "filters_by_layer": { - "C4_SEMANTIC_ROLES": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C1_SYMBOL_CATALOG": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C4_SEMANTIC_ROLES", - "query": "Какие компоненты участвуют в RuntimeManager?", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 12, - "ranking_profile": "code" - }, - { - "layer": "C3_ENTRYPOINTS", - "query": "Какие компоненты участвуют в RuntimeManager?", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "Какие компоненты участвуют в RuntimeManager?", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C1_SYMBOL_CATALOG", - "query": "RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Какие компоненты участвуют в RuntimeManager?", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 4, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C4_SEMANTIC_ROLES", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 12, - "candidates_after_filter": 12 - }, - { - "layer": "C3_ENTRYPOINTS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 3, - "candidates_after_filter": 3 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 1, - "candidates_after_filter": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 4, - "candidates_after_filter": 4 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "RuntimeManager", - "alternatives": [ - "RuntimeManager" - ] - }, - "layers": [ - { - "layer": "C4_SEMANTIC_ROLES", - "status": "hit", - "hit_count": 12, - "fail_reason": null - }, - { - "layer": "C3_ENTRYPOINTS", - "status": "hit", - "hit_count": 3, - "fail_reason": null - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 8, - "fail_reason": null - }, - { - "layer": "C1_SYMBOL_CATALOG", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 1, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "symbol_resolution": 0, - "retrieval_total": 155, - "retrieval_by_layer": { - "C4_SEMANTIC_ROLES": 30, - "C3_ENTRYPOINTS": 17, - "C2_DEPENDENCY_GRAPH": 65, - "C1_SYMBOL_CATALOG": 25, - "C0_SOURCE_CHUNKS": 16 - }, - "merge_rank": 19 - } - } - }, - { - "step": "llm_answer", - "input": { - "query": "Какие компоненты участвуют в RuntimeManager?", - "rag_count": 25 - }, - "output": { - "llm_answer": "1. **Компоненты, которые подтверждены контекстом**:\n - RuntimeManager\n - ControlActionSet\n - ControlPlaneService\n \n2. **Подтверждённые связи между ними**:\n - RuntimeManager вызывает метод `start` для инициализации.\n - ControlPlaneService инициализирует каналы данных через метод `_channels`.\n - ControlPlaneService запускает асинхронную обработку через метод `_start_async`.\n\n3. **Границы ответственности, если они реально видны в коде**:\n - RuntimeManager отвечает за управление жизненным циклом системы, включая чтение и запись состояния атрибутов.\n - ControlActionSet выполняет роль модели и предоставляет базовые функции поведения.\n - ControlPlaneService управляет сервисами канала данных и их асинхронной обработкой.\n\n4. **Что остаётся неизвестным или неполным**:\n - Детали реализации взаимодействия между ControlActionSet и RuntimeManager остаются неясными.\n - Полная структура данных потока и зависимость компонентов от внешних сервисов не раскрыты." - }, - "diagnostics": { - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 537, - "evidence_rows": 25, - "evidence_chars": 8651 - }, - "evidence_summary": [ - { - "layer": "C4_SEMANTIC_ROLES", - "count": 12, - "unique_paths": 11 - }, - { - "layer": "C3_ENTRYPOINTS", - "count": 3, - "unique_paths": 1 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "count": 8, - "unique_paths": 2 - }, - { - "layer": "C1_SYMBOL_CATALOG", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 1, - "unique_paths": 1 - } - ], - "prompt_template_id": "intent_code_qa_architecture_ru_v2", - "system_prompt_version": "v1" - }, - "timings_ms": { - "prompt_build": 0, - "llm_call": 1669 - } - } - } - ] - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents/20260312_123945/full_chain_plba_code_subintents_plba-fullchain-architecture-control-plane.md b/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents/20260312_123945/full_chain_plba_code_subintents_plba-fullchain-architecture-control-plane.md deleted file mode 100644 index 0f4693b..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents/20260312_123945/full_chain_plba_code_subintents_plba-fullchain-architecture-control-plane.md +++ /dev/null @@ -1,34 +0,0 @@ -# plba-fullchain-architecture-control-plane - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_subintents.yaml -- runner: runtime -- mode: full_chain -- passed: True - -## Query -Какие компоненты участвуют в RuntimeManager? - -## Actual -{ - "intent": "CODE_QA", - "sub_intent": "ARCHITECTURE", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 25, - "llm_answer": "1. **Компоненты, которые подтверждены контекстом**:\n - RuntimeManager\n - ControlActionSet\n - ControlPlaneService\n \n2. **Подтверждённые связи между ними**:\n - RuntimeManager вызывает метод `start` для инициализации.\n - ControlPlaneService инициализирует каналы данных через метод `_channels`.\n - ControlPlaneService запускает асинхронную обработку через метод `_start_async`.\n\n3. **Границы ответственности, если они реально видны в коде**:\n - RuntimeManager отвечает за управление жизненным циклом системы, включая чтение и запись состояния атрибутов.\n - ControlActionSet выполняет роль модели и предоставляет базовые функции поведения.\n - ControlPlaneService управляет сервисами канала данных и их асинхронной обработкой.\n\n4. **Что остаётся неизвестным или неполным**:\n - Детали реализации взаимодействия между ControlActionSet и RuntimeManager остаются неясными.\n - Полная структура данных потока и зависимость компонентов от внешних сервисов не раскрыты.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "RuntimeManager" - ], - "layers": [ - "C4_SEMANTIC_ROLES", - "C3_ENTRYPOINTS", - "C2_DEPENDENCY_GRAPH", - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS" - ] -} - -## Mismatches -- none \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents/20260312_123945/full_chain_plba_code_subintents_plba-fullchain-explain-local-runtime-manager.json b/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents/20260312_123945/full_chain_plba_code_subintents_plba-fullchain-explain-local-runtime-manager.json deleted file mode 100644 index fea2f9f..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents/20260312_123945/full_chain_plba_code_subintents_plba-fullchain-explain-local-runtime-manager.json +++ /dev/null @@ -1,1333 +0,0 @@ -{ - "case_id": "plba-fullchain-explain-local-runtime-manager", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_subintents.yaml", - "runner": "runtime", - "mode": "full_chain", - "actual": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN_LOCAL", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 6, - "llm_answer": "Класс `RuntimeManager` управляет инициализацией и запуском различных компонентов приложения во время выполнения (runtime).\n\n### Что делает данный класс:\n- Инициализирует основные компоненты системы (`configuration`, `services`, `traces`, `health`, `logs`, `workers`, `control_plane`) с возможностью передачи пользовательских значений через параметры конструктора. Если значения не переданы, используются дефолтные экземпляры соответствующих классов.\n \n- Содержит переменные состояния для отслеживания фазы жизненного цикла приложения:\n - `_started`: флаг, указывающий, запущен ли runtime.\n - `_state`: текущее состояние жизненного цикла (`IDLE`, `RUNNING`, etc.).\n - `_core_registered`: регистрированы ли базовые сервисы.\n - `_workers_registered`: зарегистрированы ли рабочие задачи.\n\n- Вызывает приватную функцию `_register_core_services()` сразу после создания объекта, чтобы зарегистрировать базовые службы.\n\n### Входные данные:\n- Параметры конструктора содержат объекты конфигурации, сервисов, трассировки, мониторинга здоровья, логирования, управления рабочими задачами и контрольной плоскости.\n\n### Выходные данные:\n- Взаимодействие происходит внутри самого класса при настройке его внутренних объектов и регистрации базовых служб.\n\n### Зависимости и ближайшие вызовы:\n- При создании нового экземпляра `RuntimeManager` автоматически регистрируются базовые сервисы и запускаются процессы, необходимые для функционирования runtime.\n- Класс напрямую зависит от нескольких других модулей (`ConfigurationManager`, `ServiceContainer`, `TraceService`, `HealthRegistry`, `LogManager`, `WorkerSupervisor`, `ControlPlaneService`), но сам по себе является точкой входа для настройки этих модулей.\n\nТаким образом, `RuntimeManager` выступает центральным компонентом, обеспечивающим координацию и запуск всех основных сервисов приложения в runtime-среде.", - "answer_mode": "answered", - "path_scope": [ - "src/app_runtime/core/runtime.py" - ], - "symbol_candidates": [ - "RuntimeManager" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C2_DEPENDENCY_GRAPH" - ] - }, - "passed": true, - "mismatches": [], - "details": { - "case_id": "plba-fullchain-explain-local-runtime-manager", - "text": "Почему в файле src/app_runtime/core/runtime.py класс RuntimeManager устроен так?", - "mode": "full_chain", - "run_started_at": "2026-03-12T12:39:45", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Почему в файле src/app_runtime/core/runtime.py класс RuntimeManager устроен так?", - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "RuntimeManager", - "alternatives": [ - "RuntimeManager" - ], - "confidence": 0.99 - }, - "rag_count": 6, - "rag_rows": [ - { - "path": "src/app_runtime/core/runtime.py", - "content": "class RuntimeManager\nRuntimeManager", - "layer": "C1_SYMBOL_CATALOG", - "title": "RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "7e4a9381328c5803bbc6179458612fc4e947d928aa7bf8b4b2bebb2c8592f758", - "qname": "RuntimeManager", - "kind": "class", - "signature": "RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.core.runtime", - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager.start", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 32, - "span_end": 59, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "98312ace7fc62b1c7194c5aa1732b6ef736eae1668a3a120dd1ecd5ab1d64f7a", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "77a7b260193018845e4e204df094ab89cfd7c82ee4e822b3a83ad4cd945f9cb1", - "dst_ref": "RuntimeManager.start", - "resolution": "resolved", - "slice_id": "98312ace7fc62b1c7194c5aa1732b6ef736eae1668a3a120dd1ecd5ab1d64f7a", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager.start" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "77a7b260193018845e4e204df094ab89cfd7c82ee4e822b3a83ad4cd945f9cb1" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager._register_core_services", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 32, - "span_end": 127, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "3e5811f3b511fa0cabe363f5d01f2ac5fa039bc8b93f7ee108323e1f5f45a293", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "972d6057a6caac9cf31ebc1e29c6f39f71b10d4cc170dec57cf875ba458549c6", - "dst_ref": "RuntimeManager._register_core_services", - "resolution": "resolved", - "slice_id": "3e5811f3b511fa0cabe363f5d01f2ac5fa039bc8b93f7ee108323e1f5f45a293", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager._register_core_services" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "972d6057a6caac9cf31ebc1e29c6f39f71b10d4cc170dec57cf875ba458549c6" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager.add_config_file", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 32, - "span_end": 52, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "a23b8a11ebdb12708b60c96ea12a69f7f042082f1adfddd572444e246d81d167", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "57ffbd4f0d9fdf3507c2b8624312ce211f3d02fdf86a57a8ec90778d8a7b498d", - "dst_ref": "RuntimeManager.add_config_file", - "resolution": "resolved", - "slice_id": "a23b8a11ebdb12708b60c96ea12a69f7f042082f1adfddd572444e246d81d167", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager.add_config_file" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "57ffbd4f0d9fdf3507c2b8624312ce211f3d02fdf86a57a8ec90778d8a7b498d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.services\n -> RuntimeManager.__init__", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 33, - "span_end": 39, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "d43af85989222ee6d788ce418cdcb217c7ff044cfb915e3bdbd184417dc7bd61", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "dst_ref": "RuntimeManager.__init__", - "resolution": "resolved", - "slice_id": "d43af85989222ee6d788ce418cdcb217c7ff044cfb915e3bdbd184417dc7bd61", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.services", - "RuntimeManager.__init__" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "class RuntimeManager:\n ACTION_TIMEOUT_SECONDS = 10.0\n ACTION_POLL_INTERVAL_SECONDS = 0.05\n\n def __init__(\n self,\n configuration: ConfigurationManager | None = None,\n services: ServiceContainer | None = None,\n traces: TraceService | None = None,\n health: HealthRegistry | None = None,\n logs: LogManager | None = None,\n workers: WorkerSupervisor | None = None,\n control_plane: ControlPlaneService | None = None,\n ) -> None:\n self.configuration = configuration or ConfigurationManager()\n self.services = services or ServiceContainer()\n self.traces = traces or TraceService()\n self.health = health or HealthRegistry()\n self.logs = logs or LogManager()\n self.workers = workers or WorkerSupervisor()\n self.control_plane = control_plane or ControlPlaneService()\n self.registry = ModuleRegistry(self.services)\n self._started = False\n self._state = LifecycleState.IDLE\n self._core_registered = False\n self._workers_registered = False\n self._register_core_services()\n\n def register_module(self, module: ApplicationModule) -> None:\n self.registry.register_module(module.name)\n module.register(self.registry)\n\n def add_config_file(self, path: str) -> FileConfigProvider:\n provider = FileConfigProvider(path)\n self.configuration.add_provider(provider)\n return provider\n\n def start(self, *, start_control_plane: bool = True) -> None:\n if self._started:\n return\n self._state = LifecycleState.STARTING\n config = self.configuration.load()\n self.logs.apply_config(config)\n self._register_health_contributors()\n self._register_workers()\n self.workers.start()\n if start_control_plane:\n self.control_plane.start(self)\n self._started = True\n self._refresh_state()\n\n def stop(self, timeout: float = 30.0, force: bool = False, stop_control_plane: bool = True) -> None:\n if not self._started:\n return\n self._state = LifecycleState.STOPPING\n self.workers.stop(timeout=timeout, force=force)\n if stop_control_plane:\n self.control_plane.stop()\n self._started = False\n self._state = LifecycleState.STOPPED\n\n def status(self) -> dict[str, object]:\n self._refresh_state()\n return self.control_plane.snapshot(self)\n\n def current_health(self) -> HealthPayload:\n self._refresh_state()\n return self.health.payload(self._state, self.workers.healths())\n\n async def health_status(self) -> HealthPayload:\n return self.current_health()\n\n async def start_runtime(self) -> dict[str, object] | str:\n self._refresh_state()\n if self._started:\n return \"runtime already running\"\n if self._state == LifecycleState.STOPPING:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n\n self.start(start_control_plane=False)\n started = self._wait_for_state({LifecycleState.IDLE, LifecycleState.BUSY}, timeout=self.ACTION_TIMEOUT_SECONDS)\n if started:\n return self._action_detail(\"runtime started\", timed_out=False)\n return self._action_detail(\"runtime start is still in progress\", timed_out=True)\n\n async def stop_runtime(self) -> dict[str, object] | str:\n self._refresh_state()\n if not self._started:\n if self._state == LifecycleState.STOPPING:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n return \"runtime already stopped\"\n\n self._state = LifecycleState.STOPPING\n try:\n self.workers.stop(timeout=self.ACTION_TIMEOUT_SECONDS, force=False)\n except TimeoutError:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n\n self._started = False\n self._state = LifecycleState.STOPPED\n return self._action_detail(\"runtime stopped\", timed_out=False)\n\n async def runtime_status(self) -> str:\n self._refresh_state()\n return self._state.value\n\n def _register_core_services(self) -> None:\n if self._core_registered:\n return\n self.services.register(\"configuration\", self.configuration)\n self.services.register(\"traces\", self.traces)\n self.services.register(\"health\", self.health)\n self.services.register(\"logs\", self.logs)\n self.services.register(\"workers\", self.workers)\n self.services.register(\"control_plane\", self.control_plane)\n self._core_registered = True\n\n def _register_health_contributors(self) -> None:\n for contributor in self.registry.health_contributors:\n self.health.register(contributor)\n\n def _register_workers(self) -> None:\n if self._workers_registered:\n return\n for worker in self.registry.workers:\n self.workers.register(worker)\n self._workers_registered = True\n\n def _refresh_state(self) -> None:\n lifecycle = self.workers.lifecycle_state()\n\n if self._state == LifecycleState.STOPPING:\n if lifecycle == LifecycleState.STOPPED:\n self._started = False\n self._state = LifecycleState.STOPPED\n return\n\n if not self._started:\n if lifecycle == LifecycleState.STOPPED:\n self._state = LifecycleState.STOPPED\n return\n\n self._state = lifecycle\n\n def _wait_for_state(self, target_states: set[LifecycleState], *, timeout: float) -> bool:\n deadline = monotonic() + timeout\n while monotonic() < deadline:\n self._refresh_state()\n if self._state in target_states:\n return True\n sleep(self.ACTION_POLL_INTERVAL_SECONDS)\n self._refresh_state()\n return self._state in target_states\n\n def _action_detail(self, message: str, *, timed_out: bool) -> dict[str, object]:\n self._refresh_state()\n return {\n \"message\": message,\n \"state\": self._state.value,\n \"timed_out\": timed_out,\n \"workers\": self.workers.snapshot(),\n }", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/core/runtime.py:RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.core.runtime", - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "llm_answer": "Класс `RuntimeManager` управляет инициализацией и запуском различных компонентов приложения во время выполнения (runtime).\n\n### Что делает данный класс:\n- Инициализирует основные компоненты системы (`configuration`, `services`, `traces`, `health`, `logs`, `workers`, `control_plane`) с возможностью передачи пользовательских значений через параметры конструктора. Если значения не переданы, используются дефолтные экземпляры соответствующих классов.\n \n- Содержит переменные состояния для отслеживания фазы жизненного цикла приложения:\n - `_started`: флаг, указывающий, запущен ли runtime.\n - `_state`: текущее состояние жизненного цикла (`IDLE`, `RUNNING`, etc.).\n - `_core_registered`: регистрированы ли базовые сервисы.\n - `_workers_registered`: зарегистрированы ли рабочие задачи.\n\n- Вызывает приватную функцию `_register_core_services()` сразу после создания объекта, чтобы зарегистрировать базовые службы.\n\n### Входные данные:\n- Параметры конструктора содержат объекты конфигурации, сервисов, трассировки, мониторинга здоровья, логирования, управления рабочими задачами и контрольной плоскости.\n\n### Выходные данные:\n- Взаимодействие происходит внутри самого класса при настройке его внутренних объектов и регистрации базовых служб.\n\n### Зависимости и ближайшие вызовы:\n- При создании нового экземпляра `RuntimeManager` автоматически регистрируются базовые сервисы и запускаются процессы, необходимые для функционирования runtime.\n- Класс напрямую зависит от нескольких других модулей (`ConfigurationManager`, `ServiceContainer`, `TraceService`, `HealthRegistry`, `LogManager`, `WorkerSupervisor`, `ControlPlaneService`), но сам по себе является точкой входа для настройки этих модулей.\n\nТаким образом, `RuntimeManager` выступает центральным компонентом, обеспечивающим координацию и запуск всех основных сервисов приложения в runtime-среде.", - "summary": { - "router": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN_LOCAL", - "confidence": null - }, - "retrieval": { - "profile": "code", - "layers_hit": [ - "C0_SOURCE_CHUNKS", - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH" - ], - "evidence_sufficient": true - }, - "llm": { - "answer_status": "answered", - "groundedness": "grounded" - } - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN_LOCAL", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C2_DEPENDENCY_GRAPH" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "RuntimeManager" - ], - "keyword_hints": [ - "src/app_runtime/core/runtime.py", - "RuntimeManager" - ], - "path_hints": [ - "src/app_runtime/core/runtime.py" - ], - "path_scope": [ - "src/app_runtime/core/runtime.py" - ], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C2_DEPENDENCY_GRAPH" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C0_SOURCE_CHUNKS": "exact_path_fetch", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 12, - "C2_DEPENDENCY_GRAPH": 4 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [ - "src/app_runtime/core/runtime.py" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src/app_runtime/core/runtime.py" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src/app_runtime/core/runtime.py" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "RuntimeManager", - "path_scope": [ - "src/app_runtime/core/runtime.py" - ], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Почему в файле src/app_runtime/core/runtime.py класс RuntimeManager устроен так?", - "path_scope": [ - "src/app_runtime/core/runtime.py" - ], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 12, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "Почему в файле src/app_runtime/core/runtime.py класс RuntimeManager устроен так?", - "path_scope": [ - "src/app_runtime/core/runtime.py" - ], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 4, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [ - "src/app_runtime/core/runtime.py" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 1, - "candidates_after_filter": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src/app_runtime/core/runtime.py" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 1, - "candidates_after_filter": 1 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src/app_runtime/core/runtime.py" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 4, - "candidates_after_filter": 4 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "RuntimeManager", - "alternatives": [ - "RuntimeManager" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 4, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "router": 0, - "symbol_resolution": 0, - "retrieval_total": 74, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 30, - "C0_SOURCE_CHUNKS": 18, - "C2_DEPENDENCY_GRAPH": 25 - }, - "merge_rank": 23, - "prompt_build": 0, - "llm_call": 2644 - }, - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 816, - "evidence_rows": 6, - "evidence_chars": 6650 - }, - "evidence_summary": [ - { - "layer": "C1_SYMBOL_CATALOG", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "count": 4, - "unique_paths": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 1, - "unique_paths": 1 - } - ], - "prompt_template_id": "intent_code_qa_explain_local_ru_v2", - "system_prompt_version": "v1" - }, - "router": { - "conversation_mode": "START", - "keyword_hints": [ - "src/app_runtime/core/runtime.py", - "RuntimeManager" - ], - "path_scope": [ - "src/app_runtime/core/runtime.py" - ] - }, - "llm": { - "used_evidence_count": 6, - "missing_evidence_reason": null - } - }, - "run_info": { - "case_id": "plba-fullchain-explain-local-runtime-manager", - "mode": "full_chain", - "run_started_at": "2026-03-12T12:39:45", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - }, - "input_request": { - "text": "Почему в файле src/app_runtime/core/runtime.py класс RuntimeManager устроен так?", - "normalized_query": "Почему в файле src/app_runtime/core/runtime.py класс RuntimeManager устроен так?" - }, - "steps": [ - { - "step": "intent_router", - "input": { - "query": "Почему в файле src/app_runtime/core/runtime.py класс RuntimeManager устроен так?" - }, - "output": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Почему в файле src/app_runtime/core/runtime.py класс RuntimeManager устроен так?" - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN_LOCAL", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C2_DEPENDENCY_GRAPH" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "RuntimeManager" - ], - "keyword_hints": [ - "src/app_runtime/core/runtime.py", - "RuntimeManager" - ], - "path_hints": [ - "src/app_runtime/core/runtime.py" - ], - "path_scope": [ - "src/app_runtime/core/runtime.py" - ], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "timings_ms": { - "router": 0 - } - } - }, - { - "step": "retrieval", - "input": { - "query": "Почему в файле src/app_runtime/core/runtime.py класс RuntimeManager устроен так?" - }, - "output": { - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "RuntimeManager", - "alternatives": [ - "RuntimeManager" - ], - "confidence": 0.99 - }, - "rag_count": 6, - "rag_rows": [ - { - "path": "src/app_runtime/core/runtime.py", - "content": "class RuntimeManager\nRuntimeManager", - "layer": "C1_SYMBOL_CATALOG", - "title": "RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "7e4a9381328c5803bbc6179458612fc4e947d928aa7bf8b4b2bebb2c8592f758", - "qname": "RuntimeManager", - "kind": "class", - "signature": "RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.core.runtime", - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager.start", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 32, - "span_end": 59, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "98312ace7fc62b1c7194c5aa1732b6ef736eae1668a3a120dd1ecd5ab1d64f7a", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "77a7b260193018845e4e204df094ab89cfd7c82ee4e822b3a83ad4cd945f9cb1", - "dst_ref": "RuntimeManager.start", - "resolution": "resolved", - "slice_id": "98312ace7fc62b1c7194c5aa1732b6ef736eae1668a3a120dd1ecd5ab1d64f7a", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager.start" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "77a7b260193018845e4e204df094ab89cfd7c82ee4e822b3a83ad4cd945f9cb1" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager._register_core_services", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 32, - "span_end": 127, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "3e5811f3b511fa0cabe363f5d01f2ac5fa039bc8b93f7ee108323e1f5f45a293", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "972d6057a6caac9cf31ebc1e29c6f39f71b10d4cc170dec57cf875ba458549c6", - "dst_ref": "RuntimeManager._register_core_services", - "resolution": "resolved", - "slice_id": "3e5811f3b511fa0cabe363f5d01f2ac5fa039bc8b93f7ee108323e1f5f45a293", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager._register_core_services" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "972d6057a6caac9cf31ebc1e29c6f39f71b10d4cc170dec57cf875ba458549c6" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager.add_config_file", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 32, - "span_end": 52, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "a23b8a11ebdb12708b60c96ea12a69f7f042082f1adfddd572444e246d81d167", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "57ffbd4f0d9fdf3507c2b8624312ce211f3d02fdf86a57a8ec90778d8a7b498d", - "dst_ref": "RuntimeManager.add_config_file", - "resolution": "resolved", - "slice_id": "a23b8a11ebdb12708b60c96ea12a69f7f042082f1adfddd572444e246d81d167", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager.add_config_file" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "57ffbd4f0d9fdf3507c2b8624312ce211f3d02fdf86a57a8ec90778d8a7b498d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.services\n -> RuntimeManager.__init__", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 33, - "span_end": 39, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "d43af85989222ee6d788ce418cdcb217c7ff044cfb915e3bdbd184417dc7bd61", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "dst_ref": "RuntimeManager.__init__", - "resolution": "resolved", - "slice_id": "d43af85989222ee6d788ce418cdcb217c7ff044cfb915e3bdbd184417dc7bd61", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.services", - "RuntimeManager.__init__" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "class RuntimeManager:\n ACTION_TIMEOUT_SECONDS = 10.0\n ACTION_POLL_INTERVAL_SECONDS = 0.05\n\n def __init__(\n self,\n configuration: ConfigurationManager | None = None,\n services: ServiceContainer | None = None,\n traces: TraceService | None = None,\n health: HealthRegistry | None = None,\n logs: LogManager | None = None,\n workers: WorkerSupervisor | None = None,\n control_plane: ControlPlaneService | None = None,\n ) -> None:\n self.configuration = configuration or ConfigurationManager()\n self.services = services or ServiceContainer()\n self.traces = traces or TraceService()\n self.health = health or HealthRegistry()\n self.logs = logs or LogManager()\n self.workers = workers or WorkerSupervisor()\n self.control_plane = control_plane or ControlPlaneService()\n self.registry = ModuleRegistry(self.services)\n self._started = False\n self._state = LifecycleState.IDLE\n self._core_registered = False\n self._workers_registered = False\n self._register_core_services()\n\n def register_module(self, module: ApplicationModule) -> None:\n self.registry.register_module(module.name)\n module.register(self.registry)\n\n def add_config_file(self, path: str) -> FileConfigProvider:\n provider = FileConfigProvider(path)\n self.configuration.add_provider(provider)\n return provider\n\n def start(self, *, start_control_plane: bool = True) -> None:\n if self._started:\n return\n self._state = LifecycleState.STARTING\n config = self.configuration.load()\n self.logs.apply_config(config)\n self._register_health_contributors()\n self._register_workers()\n self.workers.start()\n if start_control_plane:\n self.control_plane.start(self)\n self._started = True\n self._refresh_state()\n\n def stop(self, timeout: float = 30.0, force: bool = False, stop_control_plane: bool = True) -> None:\n if not self._started:\n return\n self._state = LifecycleState.STOPPING\n self.workers.stop(timeout=timeout, force=force)\n if stop_control_plane:\n self.control_plane.stop()\n self._started = False\n self._state = LifecycleState.STOPPED\n\n def status(self) -> dict[str, object]:\n self._refresh_state()\n return self.control_plane.snapshot(self)\n\n def current_health(self) -> HealthPayload:\n self._refresh_state()\n return self.health.payload(self._state, self.workers.healths())\n\n async def health_status(self) -> HealthPayload:\n return self.current_health()\n\n async def start_runtime(self) -> dict[str, object] | str:\n self._refresh_state()\n if self._started:\n return \"runtime already running\"\n if self._state == LifecycleState.STOPPING:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n\n self.start(start_control_plane=False)\n started = self._wait_for_state({LifecycleState.IDLE, LifecycleState.BUSY}, timeout=self.ACTION_TIMEOUT_SECONDS)\n if started:\n return self._action_detail(\"runtime started\", timed_out=False)\n return self._action_detail(\"runtime start is still in progress\", timed_out=True)\n\n async def stop_runtime(self) -> dict[str, object] | str:\n self._refresh_state()\n if not self._started:\n if self._state == LifecycleState.STOPPING:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n return \"runtime already stopped\"\n\n self._state = LifecycleState.STOPPING\n try:\n self.workers.stop(timeout=self.ACTION_TIMEOUT_SECONDS, force=False)\n except TimeoutError:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n\n self._started = False\n self._state = LifecycleState.STOPPED\n return self._action_detail(\"runtime stopped\", timed_out=False)\n\n async def runtime_status(self) -> str:\n self._refresh_state()\n return self._state.value\n\n def _register_core_services(self) -> None:\n if self._core_registered:\n return\n self.services.register(\"configuration\", self.configuration)\n self.services.register(\"traces\", self.traces)\n self.services.register(\"health\", self.health)\n self.services.register(\"logs\", self.logs)\n self.services.register(\"workers\", self.workers)\n self.services.register(\"control_plane\", self.control_plane)\n self._core_registered = True\n\n def _register_health_contributors(self) -> None:\n for contributor in self.registry.health_contributors:\n self.health.register(contributor)\n\n def _register_workers(self) -> None:\n if self._workers_registered:\n return\n for worker in self.registry.workers:\n self.workers.register(worker)\n self._workers_registered = True\n\n def _refresh_state(self) -> None:\n lifecycle = self.workers.lifecycle_state()\n\n if self._state == LifecycleState.STOPPING:\n if lifecycle == LifecycleState.STOPPED:\n self._started = False\n self._state = LifecycleState.STOPPED\n return\n\n if not self._started:\n if lifecycle == LifecycleState.STOPPED:\n self._state = LifecycleState.STOPPED\n return\n\n self._state = lifecycle\n\n def _wait_for_state(self, target_states: set[LifecycleState], *, timeout: float) -> bool:\n deadline = monotonic() + timeout\n while monotonic() < deadline:\n self._refresh_state()\n if self._state in target_states:\n return True\n sleep(self.ACTION_POLL_INTERVAL_SECONDS)\n self._refresh_state()\n return self._state in target_states\n\n def _action_detail(self, message: str, *, timed_out: bool) -> dict[str, object]:\n self._refresh_state()\n return {\n \"message\": message,\n \"state\": self._state.value,\n \"timed_out\": timed_out,\n \"workers\": self.workers.snapshot(),\n }", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/core/runtime.py:RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.core.runtime", - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ] - }, - "diagnostics": { - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C2_DEPENDENCY_GRAPH" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C0_SOURCE_CHUNKS": "exact_path_fetch", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 12, - "C2_DEPENDENCY_GRAPH": 4 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [ - "src/app_runtime/core/runtime.py" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src/app_runtime/core/runtime.py" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src/app_runtime/core/runtime.py" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "RuntimeManager", - "path_scope": [ - "src/app_runtime/core/runtime.py" - ], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Почему в файле src/app_runtime/core/runtime.py класс RuntimeManager устроен так?", - "path_scope": [ - "src/app_runtime/core/runtime.py" - ], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 12, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "Почему в файле src/app_runtime/core/runtime.py класс RuntimeManager устроен так?", - "path_scope": [ - "src/app_runtime/core/runtime.py" - ], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 4, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [ - "src/app_runtime/core/runtime.py" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 1, - "candidates_after_filter": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src/app_runtime/core/runtime.py" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 1, - "candidates_after_filter": 1 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src/app_runtime/core/runtime.py" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 4, - "candidates_after_filter": 4 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "RuntimeManager", - "alternatives": [ - "RuntimeManager" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 4, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "symbol_resolution": 0, - "retrieval_total": 74, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 30, - "C0_SOURCE_CHUNKS": 18, - "C2_DEPENDENCY_GRAPH": 25 - }, - "merge_rank": 23 - } - } - }, - { - "step": "llm_answer", - "input": { - "query": "Почему в файле src/app_runtime/core/runtime.py класс RuntimeManager устроен так?", - "rag_count": 6 - }, - "output": { - "llm_answer": "Класс `RuntimeManager` управляет инициализацией и запуском различных компонентов приложения во время выполнения (runtime).\n\n### Что делает данный класс:\n- Инициализирует основные компоненты системы (`configuration`, `services`, `traces`, `health`, `logs`, `workers`, `control_plane`) с возможностью передачи пользовательских значений через параметры конструктора. Если значения не переданы, используются дефолтные экземпляры соответствующих классов.\n \n- Содержит переменные состояния для отслеживания фазы жизненного цикла приложения:\n - `_started`: флаг, указывающий, запущен ли runtime.\n - `_state`: текущее состояние жизненного цикла (`IDLE`, `RUNNING`, etc.).\n - `_core_registered`: регистрированы ли базовые сервисы.\n - `_workers_registered`: зарегистрированы ли рабочие задачи.\n\n- Вызывает приватную функцию `_register_core_services()` сразу после создания объекта, чтобы зарегистрировать базовые службы.\n\n### Входные данные:\n- Параметры конструктора содержат объекты конфигурации, сервисов, трассировки, мониторинга здоровья, логирования, управления рабочими задачами и контрольной плоскости.\n\n### Выходные данные:\n- Взаимодействие происходит внутри самого класса при настройке его внутренних объектов и регистрации базовых служб.\n\n### Зависимости и ближайшие вызовы:\n- При создании нового экземпляра `RuntimeManager` автоматически регистрируются базовые сервисы и запускаются процессы, необходимые для функционирования runtime.\n- Класс напрямую зависит от нескольких других модулей (`ConfigurationManager`, `ServiceContainer`, `TraceService`, `HealthRegistry`, `LogManager`, `WorkerSupervisor`, `ControlPlaneService`), но сам по себе является точкой входа для настройки этих модулей.\n\nТаким образом, `RuntimeManager` выступает центральным компонентом, обеспечивающим координацию и запуск всех основных сервисов приложения в runtime-среде." - }, - "diagnostics": { - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 816, - "evidence_rows": 6, - "evidence_chars": 6650 - }, - "evidence_summary": [ - { - "layer": "C1_SYMBOL_CATALOG", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "count": 4, - "unique_paths": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 1, - "unique_paths": 1 - } - ], - "prompt_template_id": "intent_code_qa_explain_local_ru_v2", - "system_prompt_version": "v1" - }, - "timings_ms": { - "prompt_build": 0, - "llm_call": 2644 - } - } - } - ] - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents/20260312_123945/full_chain_plba_code_subintents_plba-fullchain-explain-local-runtime-manager.md b/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents/20260312_123945/full_chain_plba_code_subintents_plba-fullchain-explain-local-runtime-manager.md deleted file mode 100644 index 6c156e2..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents/20260312_123945/full_chain_plba_code_subintents_plba-fullchain-explain-local-runtime-manager.md +++ /dev/null @@ -1,34 +0,0 @@ -# plba-fullchain-explain-local-runtime-manager - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_subintents.yaml -- runner: runtime -- mode: full_chain -- passed: True - -## Query -Почему в файле src/app_runtime/core/runtime.py класс RuntimeManager устроен так? - -## Actual -{ - "intent": "CODE_QA", - "sub_intent": "EXPLAIN_LOCAL", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 6, - "llm_answer": "Класс `RuntimeManager` управляет инициализацией и запуском различных компонентов приложения во время выполнения (runtime).\n\n### Что делает данный класс:\n- Инициализирует основные компоненты системы (`configuration`, `services`, `traces`, `health`, `logs`, `workers`, `control_plane`) с возможностью передачи пользовательских значений через параметры конструктора. Если значения не переданы, используются дефолтные экземпляры соответствующих классов.\n \n- Содержит переменные состояния для отслеживания фазы жизненного цикла приложения:\n - `_started`: флаг, указывающий, запущен ли runtime.\n - `_state`: текущее состояние жизненного цикла (`IDLE`, `RUNNING`, etc.).\n - `_core_registered`: регистрированы ли базовые сервисы.\n - `_workers_registered`: зарегистрированы ли рабочие задачи.\n\n- Вызывает приватную функцию `_register_core_services()` сразу после создания объекта, чтобы зарегистрировать базовые службы.\n\n### Входные данные:\n- Параметры конструктора содержат объекты конфигурации, сервисов, трассировки, мониторинга здоровья, логирования, управления рабочими задачами и контрольной плоскости.\n\n### Выходные данные:\n- Взаимодействие происходит внутри самого класса при настройке его внутренних объектов и регистрации базовых служб.\n\n### Зависимости и ближайшие вызовы:\n- При создании нового экземпляра `RuntimeManager` автоматически регистрируются базовые сервисы и запускаются процессы, необходимые для функционирования runtime.\n- Класс напрямую зависит от нескольких других модулей (`ConfigurationManager`, `ServiceContainer`, `TraceService`, `HealthRegistry`, `LogManager`, `WorkerSupervisor`, `ControlPlaneService`), но сам по себе является точкой входа для настройки этих модулей.\n\nТаким образом, `RuntimeManager` выступает центральным компонентом, обеспечивающим координацию и запуск всех основных сервисов приложения в runtime-среде.", - "answer_mode": "answered", - "path_scope": [ - "src/app_runtime/core/runtime.py" - ], - "symbol_candidates": [ - "RuntimeManager" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C2_DEPENDENCY_GRAPH" - ] -} - -## Mismatches -- none \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents/20260312_123945/full_chain_plba_code_subintents_plba-fullchain-explain-runtime-manager.json b/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents/20260312_123945/full_chain_plba_code_subintents_plba-fullchain-explain-runtime-manager.json deleted file mode 100644 index 5c79a4d..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents/20260312_123945/full_chain_plba_code_subintents_plba-fullchain-explain-runtime-manager.json +++ /dev/null @@ -1,2088 +0,0 @@ -{ - "case_id": "plba-fullchain-explain-runtime-manager", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_subintents.yaml", - "runner": "runtime", - "mode": "full_chain", - "actual": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 12, - "llm_answer": "1. Что это и где определено.\nСущность `RuntimeManager` объявлена в файле `src/app_runtime/core/runtime.py`.\n\n2. Назначение по наблюдаемому коду.\nКласс предназначен для управления жизненным циклом приложения и координации работы различных компонентов системы. Судя по документации и контекстным подсказкам, он играет роль менеджера, отвечающего за инициализацию и управление сервисами, регистрацией модулей и отслеживанием состояния системы.\n\n3. Подтверждённые зависимости или взаимодействия.\n`RuntimeManager` зависит от следующих сущностей:\n- `ConfigurationManager`\n- `ServiceContainer`\n- `TraceService`\n- `HealthRegistry`\n- `LogManager`\n- `WorkerSupervisor`\n- `ControlPlaneService`\n- `ApplicationModule`\n\nЭти зависимости передаются конструктору класса при его создании.\n\n4. Что делает по шагам, если это видно в контексте.\nПри инициализации объекта класса происходит следующее:\n- Проверяются аргументы конструктора на наличие необходимых зависимостей.\n- Если какой-либо аргумент отсутствует, создаётся соответствующий объект по умолчанию.\n- Заполняются атрибуты экземпляра, такие как `_started`, `_state`, `_core_registered`, `_workers_registered`.\n- Вызывается метод `_register_core_services()`, предположительно регистрирующий основные сервисы.\n\n5. Осторожные выводы.\nНа данный момент нельзя сделать полных выводов о работе метода `_register_core_services()` и других методов класса без дополнительного анализа исходного кода.\n\n6. Чего не хватает для полного объяснения.\nДля более глубокого понимания необходимо изучить реализацию методов класса и их взаимодействие с другими компонентами системы. Также требуется информация о внутренней логике метода `_register_core_services()`.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "RuntimeManager" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "passed": true, - "mismatches": [], - "details": { - "case_id": "plba-fullchain-explain-runtime-manager", - "text": "Объясни как работает класс RuntimeManager", - "mode": "full_chain", - "run_started_at": "2026-03-12T12:39:45", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Объясни как работает класс RuntimeManager", - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "RuntimeManager", - "alternatives": [ - "RuntimeManager" - ], - "confidence": 0.99 - }, - "rag_count": 12, - "rag_rows": [ - { - "path": "src/app_runtime/core/runtime.py", - "content": "class RuntimeManager\nRuntimeManager", - "layer": "C1_SYMBOL_CATALOG", - "title": "RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "7e4a9381328c5803bbc6179458612fc4e947d928aa7bf8b4b2bebb2c8592f758", - "qname": "RuntimeManager", - "kind": "class", - "signature": "RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.core.runtime", - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests manager\n- orchestrates role-like calls (4)\n- reads and writes state attributes\n- participates in dataflow slices (50)", - "layer": "C4_SEMANTIC_ROLES", - "title": "RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 43, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "7e4a9381328c5803bbc6179458612fc4e947d928aa7bf8b4b2bebb2c8592f758", - "symbol_name": "RuntimeManager", - "qname": "RuntimeManager", - "role": "pipeline_stage", - "confidence": 0.67, - "dataflow_participation": 50, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.stop", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 25, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d", - "dst_ref": "ControlPlaneService.stop", - "resolution": "resolved", - "slice_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.stop" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._stop_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 51, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a", - "dst_ref": "ControlPlaneService._stop_async", - "resolution": "resolved", - "slice_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._stop_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.register_channel", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 17, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957", - "dst_ref": "ControlPlaneService.register_channel", - "resolution": "resolved", - "slice_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.register_channel" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.start", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 20, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154", - "dst_ref": "ControlPlaneService.start", - "resolution": "resolved", - "slice_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.start" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._start_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 47, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517", - "dst_ref": "ControlPlaneService._start_async", - "resolution": "resolved", - "slice_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._start_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager.add_config_file", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 32, - "span_end": 52, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "a23b8a11ebdb12708b60c96ea12a69f7f042082f1adfddd572444e246d81d167", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "57ffbd4f0d9fdf3507c2b8624312ce211f3d02fdf86a57a8ec90778d8a7b498d", - "dst_ref": "RuntimeManager.add_config_file", - "resolution": "resolved", - "slice_id": "a23b8a11ebdb12708b60c96ea12a69f7f042082f1adfddd572444e246d81d167", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager.add_config_file" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "57ffbd4f0d9fdf3507c2b8624312ce211f3d02fdf86a57a8ec90778d8a7b498d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "class RuntimeManager:\n ACTION_TIMEOUT_SECONDS = 10.0\n ACTION_POLL_INTERVAL_SECONDS = 0.05\n\n def __init__(\n self,\n configuration: ConfigurationManager | None = None,\n services: ServiceContainer | None = None,\n traces: TraceService | None = None,\n health: HealthRegistry | None = None,\n logs: LogManager | None = None,\n workers: WorkerSupervisor | None = None,\n control_plane: ControlPlaneService | None = None,\n ) -> None:\n self.configuration = configuration or ConfigurationManager()\n self.services = services or ServiceContainer()\n self.traces = traces or TraceService()\n self.health = health or HealthRegistry()\n self.logs = logs or LogManager()\n self.workers = workers or WorkerSupervisor()\n self.control_plane = control_plane or ControlPlaneService()\n self.registry = ModuleRegistry(self.services)\n self._started = False\n self._state = LifecycleState.IDLE\n self._core_registered = False\n self._workers_registered = False\n self._register_core_services()\n\n def register_module(self, module: ApplicationModule) -> None:\n self.registry.register_module(module.name)\n module.register(self.registry)\n\n def add_config_file(self, path: str) -> FileConfigProvider:\n provider = FileConfigProvider(path)\n self.configuration.add_provider(provider)\n return provider\n\n def start(self, *, start_control_plane: bool = True) -> None:\n if self._started:\n return\n self._state = LifecycleState.STARTING\n config = self.configuration.load()\n self.logs.apply_config(config)\n self._register_health_contributors()\n self._register_workers()\n self.workers.start()\n if start_control_plane:\n self.control_plane.start(self)\n self._started = True\n self._refresh_state()\n\n def stop(self, timeout: float = 30.0, force: bool = False, stop_control_plane: bool = True) -> None:\n if not self._started:\n return\n self._state = LifecycleState.STOPPING\n self.workers.stop(timeout=timeout, force=force)\n if stop_control_plane:\n self.control_plane.stop()\n self._started = False\n self._state = LifecycleState.STOPPED\n\n def status(self) -> dict[str, object]:\n self._refresh_state()\n return self.control_plane.snapshot(self)\n\n def current_health(self) -> HealthPayload:\n self._refresh_state()\n return self.health.payload(self._state, self.workers.healths())\n\n async def health_status(self) -> HealthPayload:\n return self.current_health()\n\n async def start_runtime(self) -> dict[str, object] | str:\n self._refresh_state()\n if self._started:\n return \"runtime already running\"\n if self._state == LifecycleState.STOPPING:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n\n self.start(start_control_plane=False)\n started = self._wait_for_state({LifecycleState.IDLE, LifecycleState.BUSY}, timeout=self.ACTION_TIMEOUT_SECONDS)\n if started:\n return self._action_detail(\"runtime started\", timed_out=False)\n return self._action_detail(\"runtime start is still in progress\", timed_out=True)\n\n async def stop_runtime(self) -> dict[str, object] | str:\n self._refresh_state()\n if not self._started:\n if self._state == LifecycleState.STOPPING:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n return \"runtime already stopped\"\n\n self._state = LifecycleState.STOPPING\n try:\n self.workers.stop(timeout=self.ACTION_TIMEOUT_SECONDS, force=False)\n except TimeoutError:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n\n self._started = False\n self._state = LifecycleState.STOPPED\n return self._action_detail(\"runtime stopped\", timed_out=False)\n\n async def runtime_status(self) -> str:\n self._refresh_state()\n return self._state.value\n\n def _register_core_services(self) -> None:\n if self._core_registered:\n return\n self.services.register(\"configuration\", self.configuration)\n self.services.register(\"traces\", self.traces)\n self.services.register(\"health\", self.health)\n self.services.register(\"logs\", self.logs)\n self.services.register(\"workers\", self.workers)\n self.services.register(\"control_plane\", self.control_plane)\n self._core_registered = True\n\n def _register_health_contributors(self) -> None:\n for contributor in self.registry.health_contributors:\n self.health.register(contributor)\n\n def _register_workers(self) -> None:\n if self._workers_registered:\n return\n for worker in self.registry.workers:\n self.workers.register(worker)\n self._workers_registered = True\n\n def _refresh_state(self) -> None:\n lifecycle = self.workers.lifecycle_state()\n\n if self._state == LifecycleState.STOPPING:\n if lifecycle == LifecycleState.STOPPED:\n self._started = False\n self._state = LifecycleState.STOPPED\n return\n\n if not self._started:\n if lifecycle == LifecycleState.STOPPED:\n self._state = LifecycleState.STOPPED\n return\n\n self._state = lifecycle\n\n def _wait_for_state(self, target_states: set[LifecycleState], *, timeout: float) -> bool:\n deadline = monotonic() + timeout\n while monotonic() < deadline:\n self._refresh_state()\n if self._state in target_states:\n return True\n sleep(self.ACTION_POLL_INTERVAL_SECONDS)\n self._refresh_state()\n return self._state in target_states\n\n def _action_detail(self, message: str, *, timed_out: bool) -> dict[str, object]:\n self._refresh_state()\n return {\n \"message\": message,\n \"state\": self._state.value,\n \"timed_out\": timed_out,\n \"workers\": self.workers.snapshot(),\n }", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/core/runtime.py:RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.core.runtime", - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "llm_answer": "1. Что это и где определено.\nСущность `RuntimeManager` объявлена в файле `src/app_runtime/core/runtime.py`.\n\n2. Назначение по наблюдаемому коду.\nКласс предназначен для управления жизненным циклом приложения и координации работы различных компонентов системы. Судя по документации и контекстным подсказкам, он играет роль менеджера, отвечающего за инициализацию и управление сервисами, регистрацией модулей и отслеживанием состояния системы.\n\n3. Подтверждённые зависимости или взаимодействия.\n`RuntimeManager` зависит от следующих сущностей:\n- `ConfigurationManager`\n- `ServiceContainer`\n- `TraceService`\n- `HealthRegistry`\n- `LogManager`\n- `WorkerSupervisor`\n- `ControlPlaneService`\n- `ApplicationModule`\n\nЭти зависимости передаются конструктору класса при его создании.\n\n4. Что делает по шагам, если это видно в контексте.\nПри инициализации объекта класса происходит следующее:\n- Проверяются аргументы конструктора на наличие необходимых зависимостей.\n- Если какой-либо аргумент отсутствует, создаётся соответствующий объект по умолчанию.\n- Заполняются атрибуты экземпляра, такие как `_started`, `_state`, `_core_registered`, `_workers_registered`.\n- Вызывается метод `_register_core_services()`, предположительно регистрирующий основные сервисы.\n\n5. Осторожные выводы.\nНа данный момент нельзя сделать полных выводов о работе метода `_register_core_services()` и других методов класса без дополнительного анализа исходного кода.\n\n6. Чего не хватает для полного объяснения.\nДля более глубокого понимания необходимо изучить реализацию методов класса и их взаимодействие с другими компонентами системы. Также требуется информация о внутренней логике метода `_register_core_services()`.", - "summary": { - "router": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "confidence": null - }, - "retrieval": { - "profile": "code", - "layers_hit": [ - "C0_SOURCE_CHUNKS", - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS", - "C4_SEMANTIC_ROLES" - ], - "evidence_sufficient": true - }, - "llm": { - "answer_status": "answered", - "groundedness": "grounded" - } - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "RuntimeManager" - ], - "keyword_hints": [ - "RuntimeManager" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C0_SOURCE_CHUNKS": "exact_path_fetch", - "C4_SEMANTIC_ROLES": "exact_path_fetch", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C3_ENTRYPOINTS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 8, - "C4_SEMANTIC_ROLES": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C3_ENTRYPOINTS": 6 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C4_SEMANTIC_ROLES": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C4_SEMANTIC_ROLES", - "query": "RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - }, - { - "layer": "C3_ENTRYPOINTS", - "query": "RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 1, - "candidates_after_filter": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 6, - "candidates_after_filter": 6 - }, - { - "layer": "C3_ENTRYPOINTS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 3, - "candidates_after_filter": 3 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "RuntimeManager", - "alternatives": [ - "RuntimeManager" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C4_SEMANTIC_ROLES", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 6, - "fail_reason": null - }, - { - "layer": "C3_ENTRYPOINTS", - "status": "hit", - "hit_count": 3, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "router": 0, - "symbol_resolution": 0, - "retrieval_total": 184, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 42, - "C0_SOURCE_CHUNKS": 25, - "C4_SEMANTIC_ROLES": 17, - "C2_DEPENDENCY_GRAPH": 63, - "C3_ENTRYPOINTS": 12 - }, - "merge_rank": 23, - "prompt_build": 0, - "llm_call": 2501 - }, - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 854, - "evidence_rows": 12, - "evidence_chars": 7130 - }, - "evidence_summary": [ - { - "layer": "C1_SYMBOL_CATALOG", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "count": 6, - "unique_paths": 2 - }, - { - "layer": "C3_ENTRYPOINTS", - "count": 3, - "unique_paths": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 1, - "unique_paths": 1 - } - ], - "prompt_template_id": "intent_code_qa_explain_ru_v2", - "system_prompt_version": "v1" - }, - "router": { - "conversation_mode": "START", - "keyword_hints": [ - "RuntimeManager" - ], - "path_scope": [] - }, - "llm": { - "used_evidence_count": 12, - "missing_evidence_reason": null - } - }, - "run_info": { - "case_id": "plba-fullchain-explain-runtime-manager", - "mode": "full_chain", - "run_started_at": "2026-03-12T12:39:45", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - }, - "input_request": { - "text": "Объясни как работает класс RuntimeManager", - "normalized_query": "Объясни как работает класс RuntimeManager" - }, - "steps": [ - { - "step": "intent_router", - "input": { - "query": "Объясни как работает класс RuntimeManager" - }, - "output": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Объясни как работает класс RuntimeManager" - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "RuntimeManager" - ], - "keyword_hints": [ - "RuntimeManager" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "timings_ms": { - "router": 0 - } - } - }, - { - "step": "retrieval", - "input": { - "query": "Объясни как работает класс RuntimeManager" - }, - "output": { - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "RuntimeManager", - "alternatives": [ - "RuntimeManager" - ], - "confidence": 0.99 - }, - "rag_count": 12, - "rag_rows": [ - { - "path": "src/app_runtime/core/runtime.py", - "content": "class RuntimeManager\nRuntimeManager", - "layer": "C1_SYMBOL_CATALOG", - "title": "RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "7e4a9381328c5803bbc6179458612fc4e947d928aa7bf8b4b2bebb2c8592f758", - "qname": "RuntimeManager", - "kind": "class", - "signature": "RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.core.runtime", - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests manager\n- orchestrates role-like calls (4)\n- reads and writes state attributes\n- participates in dataflow slices (50)", - "layer": "C4_SEMANTIC_ROLES", - "title": "RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 43, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "7e4a9381328c5803bbc6179458612fc4e947d928aa7bf8b4b2bebb2c8592f758", - "symbol_name": "RuntimeManager", - "qname": "RuntimeManager", - "role": "pipeline_stage", - "confidence": 0.67, - "dataflow_participation": 50, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.stop", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 25, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d", - "dst_ref": "ControlPlaneService.stop", - "resolution": "resolved", - "slice_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.stop" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._stop_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 51, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a", - "dst_ref": "ControlPlaneService._stop_async", - "resolution": "resolved", - "slice_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._stop_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.register_channel", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 17, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957", - "dst_ref": "ControlPlaneService.register_channel", - "resolution": "resolved", - "slice_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.register_channel" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.start", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 20, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154", - "dst_ref": "ControlPlaneService.start", - "resolution": "resolved", - "slice_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.start" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._start_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 47, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517", - "dst_ref": "ControlPlaneService._start_async", - "resolution": "resolved", - "slice_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._start_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager.add_config_file", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 32, - "span_end": 52, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "a23b8a11ebdb12708b60c96ea12a69f7f042082f1adfddd572444e246d81d167", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "57ffbd4f0d9fdf3507c2b8624312ce211f3d02fdf86a57a8ec90778d8a7b498d", - "dst_ref": "RuntimeManager.add_config_file", - "resolution": "resolved", - "slice_id": "a23b8a11ebdb12708b60c96ea12a69f7f042082f1adfddd572444e246d81d167", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager.add_config_file" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "57ffbd4f0d9fdf3507c2b8624312ce211f3d02fdf86a57a8ec90778d8a7b498d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "class RuntimeManager:\n ACTION_TIMEOUT_SECONDS = 10.0\n ACTION_POLL_INTERVAL_SECONDS = 0.05\n\n def __init__(\n self,\n configuration: ConfigurationManager | None = None,\n services: ServiceContainer | None = None,\n traces: TraceService | None = None,\n health: HealthRegistry | None = None,\n logs: LogManager | None = None,\n workers: WorkerSupervisor | None = None,\n control_plane: ControlPlaneService | None = None,\n ) -> None:\n self.configuration = configuration or ConfigurationManager()\n self.services = services or ServiceContainer()\n self.traces = traces or TraceService()\n self.health = health or HealthRegistry()\n self.logs = logs or LogManager()\n self.workers = workers or WorkerSupervisor()\n self.control_plane = control_plane or ControlPlaneService()\n self.registry = ModuleRegistry(self.services)\n self._started = False\n self._state = LifecycleState.IDLE\n self._core_registered = False\n self._workers_registered = False\n self._register_core_services()\n\n def register_module(self, module: ApplicationModule) -> None:\n self.registry.register_module(module.name)\n module.register(self.registry)\n\n def add_config_file(self, path: str) -> FileConfigProvider:\n provider = FileConfigProvider(path)\n self.configuration.add_provider(provider)\n return provider\n\n def start(self, *, start_control_plane: bool = True) -> None:\n if self._started:\n return\n self._state = LifecycleState.STARTING\n config = self.configuration.load()\n self.logs.apply_config(config)\n self._register_health_contributors()\n self._register_workers()\n self.workers.start()\n if start_control_plane:\n self.control_plane.start(self)\n self._started = True\n self._refresh_state()\n\n def stop(self, timeout: float = 30.0, force: bool = False, stop_control_plane: bool = True) -> None:\n if not self._started:\n return\n self._state = LifecycleState.STOPPING\n self.workers.stop(timeout=timeout, force=force)\n if stop_control_plane:\n self.control_plane.stop()\n self._started = False\n self._state = LifecycleState.STOPPED\n\n def status(self) -> dict[str, object]:\n self._refresh_state()\n return self.control_plane.snapshot(self)\n\n def current_health(self) -> HealthPayload:\n self._refresh_state()\n return self.health.payload(self._state, self.workers.healths())\n\n async def health_status(self) -> HealthPayload:\n return self.current_health()\n\n async def start_runtime(self) -> dict[str, object] | str:\n self._refresh_state()\n if self._started:\n return \"runtime already running\"\n if self._state == LifecycleState.STOPPING:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n\n self.start(start_control_plane=False)\n started = self._wait_for_state({LifecycleState.IDLE, LifecycleState.BUSY}, timeout=self.ACTION_TIMEOUT_SECONDS)\n if started:\n return self._action_detail(\"runtime started\", timed_out=False)\n return self._action_detail(\"runtime start is still in progress\", timed_out=True)\n\n async def stop_runtime(self) -> dict[str, object] | str:\n self._refresh_state()\n if not self._started:\n if self._state == LifecycleState.STOPPING:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n return \"runtime already stopped\"\n\n self._state = LifecycleState.STOPPING\n try:\n self.workers.stop(timeout=self.ACTION_TIMEOUT_SECONDS, force=False)\n except TimeoutError:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n\n self._started = False\n self._state = LifecycleState.STOPPED\n return self._action_detail(\"runtime stopped\", timed_out=False)\n\n async def runtime_status(self) -> str:\n self._refresh_state()\n return self._state.value\n\n def _register_core_services(self) -> None:\n if self._core_registered:\n return\n self.services.register(\"configuration\", self.configuration)\n self.services.register(\"traces\", self.traces)\n self.services.register(\"health\", self.health)\n self.services.register(\"logs\", self.logs)\n self.services.register(\"workers\", self.workers)\n self.services.register(\"control_plane\", self.control_plane)\n self._core_registered = True\n\n def _register_health_contributors(self) -> None:\n for contributor in self.registry.health_contributors:\n self.health.register(contributor)\n\n def _register_workers(self) -> None:\n if self._workers_registered:\n return\n for worker in self.registry.workers:\n self.workers.register(worker)\n self._workers_registered = True\n\n def _refresh_state(self) -> None:\n lifecycle = self.workers.lifecycle_state()\n\n if self._state == LifecycleState.STOPPING:\n if lifecycle == LifecycleState.STOPPED:\n self._started = False\n self._state = LifecycleState.STOPPED\n return\n\n if not self._started:\n if lifecycle == LifecycleState.STOPPED:\n self._state = LifecycleState.STOPPED\n return\n\n self._state = lifecycle\n\n def _wait_for_state(self, target_states: set[LifecycleState], *, timeout: float) -> bool:\n deadline = monotonic() + timeout\n while monotonic() < deadline:\n self._refresh_state()\n if self._state in target_states:\n return True\n sleep(self.ACTION_POLL_INTERVAL_SECONDS)\n self._refresh_state()\n return self._state in target_states\n\n def _action_detail(self, message: str, *, timed_out: bool) -> dict[str, object]:\n self._refresh_state()\n return {\n \"message\": message,\n \"state\": self._state.value,\n \"timed_out\": timed_out,\n \"workers\": self.workers.snapshot(),\n }", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/core/runtime.py:RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.core.runtime", - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ] - }, - "diagnostics": { - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C0_SOURCE_CHUNKS": "exact_path_fetch", - "C4_SEMANTIC_ROLES": "exact_path_fetch", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C3_ENTRYPOINTS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 8, - "C4_SEMANTIC_ROLES": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C3_ENTRYPOINTS": 6 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C4_SEMANTIC_ROLES": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C4_SEMANTIC_ROLES", - "query": "RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - }, - { - "layer": "C3_ENTRYPOINTS", - "query": "RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 1, - "candidates_after_filter": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 6, - "candidates_after_filter": 6 - }, - { - "layer": "C3_ENTRYPOINTS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 3, - "candidates_after_filter": 3 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "RuntimeManager", - "alternatives": [ - "RuntimeManager" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C4_SEMANTIC_ROLES", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 6, - "fail_reason": null - }, - { - "layer": "C3_ENTRYPOINTS", - "status": "hit", - "hit_count": 3, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "symbol_resolution": 0, - "retrieval_total": 184, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 42, - "C0_SOURCE_CHUNKS": 25, - "C4_SEMANTIC_ROLES": 17, - "C2_DEPENDENCY_GRAPH": 63, - "C3_ENTRYPOINTS": 12 - }, - "merge_rank": 23 - } - } - }, - { - "step": "llm_answer", - "input": { - "query": "Объясни как работает класс RuntimeManager", - "rag_count": 12 - }, - "output": { - "llm_answer": "1. Что это и где определено.\nСущность `RuntimeManager` объявлена в файле `src/app_runtime/core/runtime.py`.\n\n2. Назначение по наблюдаемому коду.\nКласс предназначен для управления жизненным циклом приложения и координации работы различных компонентов системы. Судя по документации и контекстным подсказкам, он играет роль менеджера, отвечающего за инициализацию и управление сервисами, регистрацией модулей и отслеживанием состояния системы.\n\n3. Подтверждённые зависимости или взаимодействия.\n`RuntimeManager` зависит от следующих сущностей:\n- `ConfigurationManager`\n- `ServiceContainer`\n- `TraceService`\n- `HealthRegistry`\n- `LogManager`\n- `WorkerSupervisor`\n- `ControlPlaneService`\n- `ApplicationModule`\n\nЭти зависимости передаются конструктору класса при его создании.\n\n4. Что делает по шагам, если это видно в контексте.\nПри инициализации объекта класса происходит следующее:\n- Проверяются аргументы конструктора на наличие необходимых зависимостей.\n- Если какой-либо аргумент отсутствует, создаётся соответствующий объект по умолчанию.\n- Заполняются атрибуты экземпляра, такие как `_started`, `_state`, `_core_registered`, `_workers_registered`.\n- Вызывается метод `_register_core_services()`, предположительно регистрирующий основные сервисы.\n\n5. Осторожные выводы.\nНа данный момент нельзя сделать полных выводов о работе метода `_register_core_services()` и других методов класса без дополнительного анализа исходного кода.\n\n6. Чего не хватает для полного объяснения.\nДля более глубокого понимания необходимо изучить реализацию методов класса и их взаимодействие с другими компонентами системы. Также требуется информация о внутренней логике метода `_register_core_services()`." - }, - "diagnostics": { - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 854, - "evidence_rows": 12, - "evidence_chars": 7130 - }, - "evidence_summary": [ - { - "layer": "C1_SYMBOL_CATALOG", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "count": 6, - "unique_paths": 2 - }, - { - "layer": "C3_ENTRYPOINTS", - "count": 3, - "unique_paths": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 1, - "unique_paths": 1 - } - ], - "prompt_template_id": "intent_code_qa_explain_ru_v2", - "system_prompt_version": "v1" - }, - "timings_ms": { - "prompt_build": 0, - "llm_call": 2501 - } - } - } - ] - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents/20260312_123945/full_chain_plba_code_subintents_plba-fullchain-explain-runtime-manager.md b/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents/20260312_123945/full_chain_plba_code_subintents_plba-fullchain-explain-runtime-manager.md deleted file mode 100644 index fc81610..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents/20260312_123945/full_chain_plba_code_subintents_plba-fullchain-explain-runtime-manager.md +++ /dev/null @@ -1,34 +0,0 @@ -# plba-fullchain-explain-runtime-manager - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_subintents.yaml -- runner: runtime -- mode: full_chain -- passed: True - -## Query -Объясни как работает класс RuntimeManager - -## Actual -{ - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 12, - "llm_answer": "1. Что это и где определено.\nСущность `RuntimeManager` объявлена в файле `src/app_runtime/core/runtime.py`.\n\n2. Назначение по наблюдаемому коду.\nКласс предназначен для управления жизненным циклом приложения и координации работы различных компонентов системы. Судя по документации и контекстным подсказкам, он играет роль менеджера, отвечающего за инициализацию и управление сервисами, регистрацией модулей и отслеживанием состояния системы.\n\n3. Подтверждённые зависимости или взаимодействия.\n`RuntimeManager` зависит от следующих сущностей:\n- `ConfigurationManager`\n- `ServiceContainer`\n- `TraceService`\n- `HealthRegistry`\n- `LogManager`\n- `WorkerSupervisor`\n- `ControlPlaneService`\n- `ApplicationModule`\n\nЭти зависимости передаются конструктору класса при его создании.\n\n4. Что делает по шагам, если это видно в контексте.\nПри инициализации объекта класса происходит следующее:\n- Проверяются аргументы конструктора на наличие необходимых зависимостей.\n- Если какой-либо аргумент отсутствует, создаётся соответствующий объект по умолчанию.\n- Заполняются атрибуты экземпляра, такие как `_started`, `_state`, `_core_registered`, `_workers_registered`.\n- Вызывается метод `_register_core_services()`, предположительно регистрирующий основные сервисы.\n\n5. Осторожные выводы.\nНа данный момент нельзя сделать полных выводов о работе метода `_register_core_services()` и других методов класса без дополнительного анализа исходного кода.\n\n6. Чего не хватает для полного объяснения.\nДля более глубокого понимания необходимо изучить реализацию методов класса и их взаимодействие с другими компонентами системы. Также требуется информация о внутренней логике метода `_register_core_services()`.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "RuntimeManager" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] -} - -## Mismatches -- none \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents/20260312_123945/full_chain_plba_code_subintents_plba-fullchain-find-entrypoints.json b/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents/20260312_123945/full_chain_plba_code_subintents_plba-fullchain-find-entrypoints.json deleted file mode 100644 index 56a98bd..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents/20260312_123945/full_chain_plba_code_subintents_plba-fullchain-find-entrypoints.json +++ /dev/null @@ -1,1196 +0,0 @@ -{ - "case_id": "plba-fullchain-find-entrypoints", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_subintents.yaml", - "runner": "runtime", - "mode": "full_chain", - "actual": { - "intent": "CODE_QA", - "sub_intent": "FIND_ENTRYPOINTS", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 9, - "llm_answer": "**Подтверждённые точки входа:**\n\n1. **src/app_runtime/control/http_app.py | app.post**\n - fastapi http app.post\n - Признак: декоратор FastAPI `app.post`, явно указывает на точку старта HTTP-запроса.\n\n2. **src/app_runtime/control/http_app.py | app.get**\n - fastapi http app.get\n - Признак: декоратор FastAPI `app.get`, явно указывает на точку старта HTTP-запроса.\n\n**Возможные кандидаты:**\n\nВ предоставленном контексте нет дополнительных сущностей или файлов, которые могли бы считаться возможными кандидатами на роль точек входа.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [], - "layers": [ - "C3_ENTRYPOINTS", - "C0_SOURCE_CHUNKS" - ] - }, - "passed": true, - "mismatches": [], - "details": { - "case_id": "plba-fullchain-find-entrypoints", - "text": "Найди точки входа в коде", - "mode": "full_chain", - "run_started_at": "2026-03-12T12:39:45", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Найди точки входа в коде", - "symbol_resolution": { - "status": "not_requested", - "resolved_symbol": null, - "alternatives": [], - "confidence": 0.0 - }, - "rag_count": 9, - "rag_rows": [ - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/contracts/result.py", - "content": "class StepResult:\n transition: str = \"success\"\n updates: dict[str, Any] = field(default_factory=dict)\n status: str = \"completed\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/workflow/contracts/result.py:StepResult", - "span_start": 8, - "span_end": 11, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.workflow.contracts.result", - "is_test": false, - "blob_sha": "6e57dbfe22873f097f11228a26cffa415440a43b68a737b220906461cd86c353", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/config/__init__.py", - "content": "from app_runtime.config.file_loader import ConfigFileLoader\nfrom app_runtime.config.providers import FileConfigProvider\n\n__all__ = [\"ConfigFileLoader\", \"FileConfigProvider\"]", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/config/__init__.py:1-4", - "span_start": 1, - "span_end": 4, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.app_runtime.config.__init__", - "is_test": false, - "blob_sha": "612918029820a2a983330ec92256142b55b9de4bdf3399ece18e2a02dbad9729", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/__init__.py", - "content": "__all__: list[str] = []", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/__init__.py:1-1", - "span_start": 1, - "span_end": 1, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.app_runtime.__init__", - "is_test": false, - "blob_sha": "8eea9df4f6d7b38ca0e39ccc27b04700e3d08dbeec8046d613d22706d19985fa", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/config/file_loader.py", - "content": "class ConfigFileLoader:\n def __init__(self, path: str | Path) -> None:\n self.path = Path(path)\n self.config: Any = None\n self.last_valid_config: Any = None\n self._last_seen_hash: str | None = None\n\n def read_text(self) -> str:\n return self.path.read_text(encoding=\"utf-8\")\n\n def parse(self, data: str) -> Any:\n suffix = self.path.suffix.lower()\n if suffix in {\".yml\", \".yaml\"}:\n return yaml.safe_load(data)\n return json.loads(data)\n\n def load_sync(self) -> Any:\n data = self.read_text()\n parsed = self.parse(data)\n self.config = parsed\n self.last_valid_config = parsed\n self._last_seen_hash = self._calculate_hash(data)\n return parsed\n\n def load_if_changed(self) -> tuple[bool, Any]:\n data = self.read_text()\n current_hash = self._calculate_hash(data)\n if current_hash == self._last_seen_hash:\n return False, self.config\n parsed = self.parse(data)\n self.config = parsed\n self.last_valid_config = parsed\n self._last_seen_hash = current_hash\n return True, parsed\n\n @staticmethod\n def _calculate_hash(data: str) -> str:\n return hashlib.sha256(data.encode(\"utf-8\")).hexdigest()", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/config/file_loader.py:ConfigFileLoader", - "span_start": 11, - "span_end": 48, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.config.file_loader", - "is_test": false, - "blob_sha": "1f19ffebde5e38e4be5a5d5a678059a0f36dedb8fb8b3e00ab395c67106a87ea", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/config/providers.py", - "content": "class FileConfigProvider(ConfigProvider):\n def __init__(self, path: str | Path) -> None:\n self._loader = ConfigFileLoader(path)\n\n @property\n def loader(self) -> ConfigFileLoader:\n return self._loader\n\n def load(self) -> dict[str, Any]:\n config = self._loader.load_sync()\n if not isinstance(config, dict):\n raise TypeError(\"Config root must be a mapping\")\n return dict(config)", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/config/providers.py:FileConfigProvider", - "span_start": 10, - "span_end": 22, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.config.providers", - "is_test": false, - "blob_sha": "8c53ca0122d6df6c5763bca15e99434bb4daebd5a618b8fc927e9ae90b022e64", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "class ControlActionSet:\n health: HealthHandler\n start: ActionHandler\n stop: ActionHandler\n status: ActionHandler", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/base.py:ControlActionSet", - "span_start": 14, - "span_end": 18, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.base", - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "llm_answer": "**Подтверждённые точки входа:**\n\n1. **src/app_runtime/control/http_app.py | app.post**\n - fastapi http app.post\n - Признак: декоратор FastAPI `app.post`, явно указывает на точку старта HTTP-запроса.\n\n2. **src/app_runtime/control/http_app.py | app.get**\n - fastapi http app.get\n - Признак: декоратор FastAPI `app.get`, явно указывает на точку старта HTTP-запроса.\n\n**Возможные кандидаты:**\n\nВ предоставленном контексте нет дополнительных сущностей или файлов, которые могли бы считаться возможными кандидатами на роль точек входа.", - "summary": { - "router": { - "intent": "CODE_QA", - "sub_intent": "FIND_ENTRYPOINTS", - "confidence": null - }, - "retrieval": { - "profile": "code", - "layers_hit": [ - "C0_SOURCE_CHUNKS", - "C3_ENTRYPOINTS" - ], - "evidence_sufficient": true - }, - "llm": { - "answer_status": "answered", - "groundedness": "grounded" - } - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "FIND_ENTRYPOINTS", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C3_ENTRYPOINTS", - "C0_SOURCE_CHUNKS" - ], - "symbol_kind_hint": "unknown", - "symbol_candidates": [], - "keyword_hints": [], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "execution": { - "executed_layers": [ - "C3_ENTRYPOINTS", - "C0_SOURCE_CHUNKS" - ], - "retrieval_mode_by_layer": { - "C3_ENTRYPOINTS": "exact_path_fetch", - "C0_SOURCE_CHUNKS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C3_ENTRYPOINTS": 12, - "C0_SOURCE_CHUNKS": 6 - }, - "filters_by_layer": { - "C3_ENTRYPOINTS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C3_ENTRYPOINTS", - "query": "Найди точки входа в коде", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 12, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Найди точки входа в коде", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C3_ENTRYPOINTS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 3, - "candidates_after_filter": 3 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 6, - "candidates_after_filter": 6 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "not_requested", - "resolved_symbol": null, - "alternatives": [] - }, - "layers": [ - { - "layer": "C3_ENTRYPOINTS", - "status": "hit", - "hit_count": 3, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 6, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "router": 0, - "symbol_resolution": 0, - "retrieval_total": 46, - "retrieval_by_layer": { - "C3_ENTRYPOINTS": 26, - "C0_SOURCE_CHUNKS": 19 - }, - "merge_rank": 0, - "prompt_build": 0, - "llm_call": 1148 - }, - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 534, - "evidence_rows": 9, - "evidence_chars": 2228 - }, - "evidence_summary": [ - { - "layer": "C3_ENTRYPOINTS", - "count": 3, - "unique_paths": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 6, - "unique_paths": 6 - } - ], - "prompt_template_id": "intent_code_qa_find_entrypoints_ru_v2", - "system_prompt_version": "v1" - }, - "router": { - "conversation_mode": "START", - "keyword_hints": [], - "path_scope": [] - }, - "llm": { - "used_evidence_count": 9, - "missing_evidence_reason": null - } - }, - "run_info": { - "case_id": "plba-fullchain-find-entrypoints", - "mode": "full_chain", - "run_started_at": "2026-03-12T12:39:45", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - }, - "input_request": { - "text": "Найди точки входа в коде", - "normalized_query": "Найди точки входа в коде" - }, - "steps": [ - { - "step": "intent_router", - "input": { - "query": "Найди точки входа в коде" - }, - "output": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Найди точки входа в коде" - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "FIND_ENTRYPOINTS", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C3_ENTRYPOINTS", - "C0_SOURCE_CHUNKS" - ], - "symbol_kind_hint": "unknown", - "symbol_candidates": [], - "keyword_hints": [], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "timings_ms": { - "router": 0 - } - } - }, - { - "step": "retrieval", - "input": { - "query": "Найди точки входа в коде" - }, - "output": { - "symbol_resolution": { - "status": "not_requested", - "resolved_symbol": null, - "alternatives": [], - "confidence": 0.0 - }, - "rag_count": 9, - "rag_rows": [ - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/contracts/result.py", - "content": "class StepResult:\n transition: str = \"success\"\n updates: dict[str, Any] = field(default_factory=dict)\n status: str = \"completed\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/workflow/contracts/result.py:StepResult", - "span_start": 8, - "span_end": 11, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.workflow.contracts.result", - "is_test": false, - "blob_sha": "6e57dbfe22873f097f11228a26cffa415440a43b68a737b220906461cd86c353", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/config/__init__.py", - "content": "from app_runtime.config.file_loader import ConfigFileLoader\nfrom app_runtime.config.providers import FileConfigProvider\n\n__all__ = [\"ConfigFileLoader\", \"FileConfigProvider\"]", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/config/__init__.py:1-4", - "span_start": 1, - "span_end": 4, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.app_runtime.config.__init__", - "is_test": false, - "blob_sha": "612918029820a2a983330ec92256142b55b9de4bdf3399ece18e2a02dbad9729", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/__init__.py", - "content": "__all__: list[str] = []", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/__init__.py:1-1", - "span_start": 1, - "span_end": 1, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.app_runtime.__init__", - "is_test": false, - "blob_sha": "8eea9df4f6d7b38ca0e39ccc27b04700e3d08dbeec8046d613d22706d19985fa", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/config/file_loader.py", - "content": "class ConfigFileLoader:\n def __init__(self, path: str | Path) -> None:\n self.path = Path(path)\n self.config: Any = None\n self.last_valid_config: Any = None\n self._last_seen_hash: str | None = None\n\n def read_text(self) -> str:\n return self.path.read_text(encoding=\"utf-8\")\n\n def parse(self, data: str) -> Any:\n suffix = self.path.suffix.lower()\n if suffix in {\".yml\", \".yaml\"}:\n return yaml.safe_load(data)\n return json.loads(data)\n\n def load_sync(self) -> Any:\n data = self.read_text()\n parsed = self.parse(data)\n self.config = parsed\n self.last_valid_config = parsed\n self._last_seen_hash = self._calculate_hash(data)\n return parsed\n\n def load_if_changed(self) -> tuple[bool, Any]:\n data = self.read_text()\n current_hash = self._calculate_hash(data)\n if current_hash == self._last_seen_hash:\n return False, self.config\n parsed = self.parse(data)\n self.config = parsed\n self.last_valid_config = parsed\n self._last_seen_hash = current_hash\n return True, parsed\n\n @staticmethod\n def _calculate_hash(data: str) -> str:\n return hashlib.sha256(data.encode(\"utf-8\")).hexdigest()", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/config/file_loader.py:ConfigFileLoader", - "span_start": 11, - "span_end": 48, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.config.file_loader", - "is_test": false, - "blob_sha": "1f19ffebde5e38e4be5a5d5a678059a0f36dedb8fb8b3e00ab395c67106a87ea", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/config/providers.py", - "content": "class FileConfigProvider(ConfigProvider):\n def __init__(self, path: str | Path) -> None:\n self._loader = ConfigFileLoader(path)\n\n @property\n def loader(self) -> ConfigFileLoader:\n return self._loader\n\n def load(self) -> dict[str, Any]:\n config = self._loader.load_sync()\n if not isinstance(config, dict):\n raise TypeError(\"Config root must be a mapping\")\n return dict(config)", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/config/providers.py:FileConfigProvider", - "span_start": 10, - "span_end": 22, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.config.providers", - "is_test": false, - "blob_sha": "8c53ca0122d6df6c5763bca15e99434bb4daebd5a618b8fc927e9ae90b022e64", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "class ControlActionSet:\n health: HealthHandler\n start: ActionHandler\n stop: ActionHandler\n status: ActionHandler", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/base.py:ControlActionSet", - "span_start": 14, - "span_end": 18, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.base", - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ] - }, - "diagnostics": { - "execution": { - "executed_layers": [ - "C3_ENTRYPOINTS", - "C0_SOURCE_CHUNKS" - ], - "retrieval_mode_by_layer": { - "C3_ENTRYPOINTS": "exact_path_fetch", - "C0_SOURCE_CHUNKS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C3_ENTRYPOINTS": 12, - "C0_SOURCE_CHUNKS": 6 - }, - "filters_by_layer": { - "C3_ENTRYPOINTS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C3_ENTRYPOINTS", - "query": "Найди точки входа в коде", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 12, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Найди точки входа в коде", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C3_ENTRYPOINTS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 3, - "candidates_after_filter": 3 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 6, - "candidates_after_filter": 6 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "not_requested", - "resolved_symbol": null, - "alternatives": [] - }, - "layers": [ - { - "layer": "C3_ENTRYPOINTS", - "status": "hit", - "hit_count": 3, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 6, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "symbol_resolution": 0, - "retrieval_total": 46, - "retrieval_by_layer": { - "C3_ENTRYPOINTS": 26, - "C0_SOURCE_CHUNKS": 19 - }, - "merge_rank": 0 - } - } - }, - { - "step": "llm_answer", - "input": { - "query": "Найди точки входа в коде", - "rag_count": 9 - }, - "output": { - "llm_answer": "**Подтверждённые точки входа:**\n\n1. **src/app_runtime/control/http_app.py | app.post**\n - fastapi http app.post\n - Признак: декоратор FastAPI `app.post`, явно указывает на точку старта HTTP-запроса.\n\n2. **src/app_runtime/control/http_app.py | app.get**\n - fastapi http app.get\n - Признак: декоратор FastAPI `app.get`, явно указывает на точку старта HTTP-запроса.\n\n**Возможные кандидаты:**\n\nВ предоставленном контексте нет дополнительных сущностей или файлов, которые могли бы считаться возможными кандидатами на роль точек входа." - }, - "diagnostics": { - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 534, - "evidence_rows": 9, - "evidence_chars": 2228 - }, - "evidence_summary": [ - { - "layer": "C3_ENTRYPOINTS", - "count": 3, - "unique_paths": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 6, - "unique_paths": 6 - } - ], - "prompt_template_id": "intent_code_qa_find_entrypoints_ru_v2", - "system_prompt_version": "v1" - }, - "timings_ms": { - "prompt_build": 0, - "llm_call": 1148 - } - } - } - ] - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents/20260312_123945/full_chain_plba_code_subintents_plba-fullchain-find-entrypoints.md b/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents/20260312_123945/full_chain_plba_code_subintents_plba-fullchain-find-entrypoints.md deleted file mode 100644 index b5afbd2..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents/20260312_123945/full_chain_plba_code_subintents_plba-fullchain-find-entrypoints.md +++ /dev/null @@ -1,29 +0,0 @@ -# plba-fullchain-find-entrypoints - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_subintents.yaml -- runner: runtime -- mode: full_chain -- passed: True - -## Query -Найди точки входа в коде - -## Actual -{ - "intent": "CODE_QA", - "sub_intent": "FIND_ENTRYPOINTS", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 9, - "llm_answer": "**Подтверждённые точки входа:**\n\n1. **src/app_runtime/control/http_app.py | app.post**\n - fastapi http app.post\n - Признак: декоратор FastAPI `app.post`, явно указывает на точку старта HTTP-запроса.\n\n2. **src/app_runtime/control/http_app.py | app.get**\n - fastapi http app.get\n - Признак: декоратор FastAPI `app.get`, явно указывает на точку старта HTTP-запроса.\n\n**Возможные кандидаты:**\n\nВ предоставленном контексте нет дополнительных сущностей или файлов, которые могли бы считаться возможными кандидатами на роль точек входа.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [], - "layers": [ - "C3_ENTRYPOINTS", - "C0_SOURCE_CHUNKS" - ] -} - -## Mismatches -- none \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents/20260312_123945/full_chain_plba_code_subintents_plba-fullchain-find-tests-runtime-manager.json b/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents/20260312_123945/full_chain_plba_code_subintents_plba-fullchain-find-tests-runtime-manager.json deleted file mode 100644 index bacfc24..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents/20260312_123945/full_chain_plba_code_subintents_plba-fullchain-find-tests-runtime-manager.json +++ /dev/null @@ -1,1879 +0,0 @@ -{ - "case_id": "plba-fullchain-find-tests-runtime-manager", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_subintents.yaml", - "runner": "runtime", - "mode": "full_chain", - "actual": { - "intent": "CODE_QA", - "sub_intent": "FIND_TESTS", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 16, - "llm_answer": "1. Прямые тесты:\n - tests/test_runtime.py | test_runtime_runs_worker_routine_and_exposes_status\n - Проверка: RuntimeManager запускает worker routine и правильно выставляет статус.\n - tests/test_runtime.py | test_runtime_graceful_stop_waits_until_worker_finishes\n - Проверка: RuntimeManager корректно завершает работу после graceful stop.\n\n2. Косвенные или ближайшие тесты:\n - tests/test_business_control_actions.py | _build_runtime\n - Проверка: косвенно подтверждает создание экземпляра RuntimeManager в бизнес-контроллерах.\n - tests/test_business_control_actions.py | test_worker_wakes_up_with_configured_interval\n - Проверка: косвенно подтверждает использование RuntimeManager при настройке интервалов выполнения задач.\n\n3. Пробелы покрытия:\n - Не найдены явные тесты, которые покрывают все возможные сценарии использования RuntimeManager, такие как регистрация нескольких модулей, обработка ошибок, работа с конфигурацией и т.д.\n\nПрямых тестов, полностью подтверждающих различные аспекты работы RuntimeManager, недостаточно.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "RuntimeManager" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ] - }, - "passed": true, - "mismatches": [], - "details": { - "case_id": "plba-fullchain-find-tests-runtime-manager", - "text": "Где тесты для RuntimeManager?", - "mode": "full_chain", - "run_started_at": "2026-03-12T12:39:45", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Где тесты для RuntimeManager?", - "symbol_resolution": { - "status": "not_found", - "resolved_symbol": null, - "alternatives": [ - "RuntimeManager" - ], - "confidence": 0.0 - }, - "rag_count": 16, - "rag_rows": [ - { - "path": "tests/test_runtime.py", - "content": "test_runtime_runs_worker_routine_and_exposes_status instantiates RuntimeManager", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_runtime_runs_worker_routine_and_exposes_status:instantiates", - "span_start": 209, - "span_end": 209, - "lexical_rank": 6, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "c397a308e7824ba9fe400a754c7e15e66ea6f058d7f5d3e82bb002bb78b509d2", - "edge_type": "instantiates", - "src_symbol_id": "1c767eb5ee08e84f45b18c8ed7531ec0ed73c63fb1594823569672db7b21e992", - "src_qname": "test_runtime_runs_worker_routine_and_exposes_status", - "dst_symbol_id": "aeadc039653807b0da1ca6e3cc1078ee61cfc510b28e7f9c2ec04c59da43cc8d", - "dst_ref": "RuntimeManager", - "resolution": "resolved", - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_runtime.py", - "content": "test_runtime_graceful_stop_waits_until_worker_finishes instantiates RuntimeManager", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_runtime_graceful_stop_waits_until_worker_finishes:instantiates", - "span_start": 229, - "span_end": 229, - "lexical_rank": 6, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "76b4701262ccaa0a7a41691407c4ebdb2ca74a2415d89f0a38ef0d4f608bda93", - "edge_type": "instantiates", - "src_symbol_id": "1076e788e4a03b10d7bc1313a8ad46caa170c13cc026c6e4de994af1a6ae57bf", - "src_qname": "test_runtime_graceful_stop_waits_until_worker_finishes", - "dst_symbol_id": "aeadc039653807b0da1ca6e3cc1078ee61cfc510b28e7f9c2ec04c59da43cc8d", - "dst_ref": "RuntimeManager", - "resolution": "resolved", - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "_build_runtime instantiates RuntimeManager", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "_build_runtime:instantiates", - "span_start": 155, - "span_end": 155, - "lexical_rank": 6, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "7eb254d564944bab6272757ee5ef688862bd321e6941e2495dc942e03b1c9a25", - "edge_type": "instantiates", - "src_symbol_id": "db94031d5245bf82be836a109b4584b43b8e83d37a0f318e03f6c8191896d469", - "src_qname": "_build_runtime", - "dst_symbol_id": "a1572ea8183dc0cd6ddbc74342bbde8c28cecfde37ad40b62feff09f8d103d11", - "dst_ref": "RuntimeManager", - "resolution": "resolved", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "test_worker_wakes_up_with_configured_interval instantiates RuntimeManager", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_worker_wakes_up_with_configured_interval:instantiates", - "span_start": 167, - "span_end": 167, - "lexical_rank": 6, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "189aafc4de0b79c688668f25f0c87166a127df26bd2215452014713b65ef281a", - "edge_type": "instantiates", - "src_symbol_id": "65f877f78191d65e6a752e41cedc70ebc784c266804a55c1c56440336e1f0d6e", - "src_qname": "test_worker_wakes_up_with_configured_interval", - "dst_symbol_id": "a1572ea8183dc0cd6ddbc74342bbde8c28cecfde37ad40b62feff09f8d103d11", - "dst_ref": "RuntimeManager", - "resolution": "resolved", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "test_actions_stop_busy_worker_after_timeout\n -> BlockingRoutine\n -> BlockingRoutine.__init__\n -> BlockingRoutine._started\n -> BlockingRoutine.run", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_actions_stop_busy_worker_after_timeout:dataflow_slice", - "span_start": 42, - "span_end": 238, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 5, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "8e7db3d2a9226f1c1d9942ac6373cfcafa0d2276758ddb8a3d3c455a3d58024d", - "edge_type": "dataflow_slice", - "src_symbol_id": "66392d3222421d9ba16eda3554940b16e7d5a6f33aa08c5738d35af2e32f1e4a", - "src_qname": "test_actions_stop_busy_worker_after_timeout", - "dst_symbol_id": "d9841bdbb69706c988ae7ae6adf89928dc4fae45943f74064f5382177034ba04", - "dst_ref": "BlockingRoutine.run", - "resolution": "resolved", - "slice_id": "8e7db3d2a9226f1c1d9942ac6373cfcafa0d2276758ddb8a3d3c455a3d58024d", - "root_symbol_id": "66392d3222421d9ba16eda3554940b16e7d5a6f33aa08c5738d35af2e32f1e4a", - "path_symbols": [ - "test_actions_stop_busy_worker_after_timeout", - "BlockingRoutine", - "BlockingRoutine.__init__", - "BlockingRoutine._started", - "BlockingRoutine.run" - ], - "path_symbol_ids": [ - "66392d3222421d9ba16eda3554940b16e7d5a6f33aa08c5738d35af2e32f1e4a", - "a3349c5bc65e4003a4bbd6a8dbb7a54c337e12d1aed930caa701b12e520f1e67", - "486deeed3043c6db985aef258e96ddc67aa53608e67a83962fbd2471f649ddf1", - "d9841bdbb69706c988ae7ae6adf89928dc4fae45943f74064f5382177034ba04" - ], - "path_edge_types": [ - "instantiates", - "writes_attr", - "reads_attr" - ], - "path_length": 5, - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "test_actions_stop_busy_worker_before_timeout\n -> BlockingRoutine\n -> BlockingRoutine.__init__\n -> BlockingRoutine._release\n -> BlockingRoutine.run", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_actions_stop_busy_worker_before_timeout:dataflow_slice", - "span_start": 43, - "span_end": 212, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 5, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "8bd726155ba387d3579763ee84dfd2f9a90bc917da88f3b2e89416ab5c1254d6", - "edge_type": "dataflow_slice", - "src_symbol_id": "a0bb116ca9d909c93a285667ae033fbd1859b2dad7cf34fcb44816393ef6909c", - "src_qname": "test_actions_stop_busy_worker_before_timeout", - "dst_symbol_id": "d9841bdbb69706c988ae7ae6adf89928dc4fae45943f74064f5382177034ba04", - "dst_ref": "BlockingRoutine.run", - "resolution": "resolved", - "slice_id": "8bd726155ba387d3579763ee84dfd2f9a90bc917da88f3b2e89416ab5c1254d6", - "root_symbol_id": "a0bb116ca9d909c93a285667ae033fbd1859b2dad7cf34fcb44816393ef6909c", - "path_symbols": [ - "test_actions_stop_busy_worker_before_timeout", - "BlockingRoutine", - "BlockingRoutine.__init__", - "BlockingRoutine._release", - "BlockingRoutine.run" - ], - "path_symbol_ids": [ - "a0bb116ca9d909c93a285667ae033fbd1859b2dad7cf34fcb44816393ef6909c", - "a3349c5bc65e4003a4bbd6a8dbb7a54c337e12d1aed930caa701b12e520f1e67", - "486deeed3043c6db985aef258e96ddc67aa53608e67a83962fbd2471f649ddf1", - "d9841bdbb69706c988ae7ae6adf89928dc4fae45943f74064f5382177034ba04" - ], - "path_edge_types": [ - "instantiates", - "writes_attr", - "reads_attr" - ], - "path_length": 5, - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_runtime.py", - "content": "def test_runtime_graceful_stop_waits_until_worker_finishes() -> None:\n started = Event()\n release = Event()\n runtime = RuntimeManager()\n runtime.register_module(BlockingModule(started, release))\n runtime.start()\n assert started.wait(timeout=1.0) is True\n assert runtime.status()[\"runtime\"][\"state\"] == \"busy\"\n\n stop_thread = Thread(target=runtime.stop, kwargs={\"timeout\": 1.0}, daemon=True)\n stop_thread.start()\n sleep(0.1)\n assert stop_thread.is_alive() is True\n\n release.set()\n stop_thread.join(timeout=1.0)\n assert stop_thread.is_alive() is False\n assert runtime.status()[\"runtime\"][\"state\"] == \"stopped\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_runtime.py:test_runtime_graceful_stop_waits_until_worker_finishes", - "span_start": 226, - "span_end": 243, - "lexical_rank": 6, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 8, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_runtime", - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_runtime.py", - "content": "def test_runtime_runs_worker_routine_and_exposes_status(tmp_path) -> None:\n config_path = tmp_path / \"config.yml\"\n config_path.write_text(\n \"\"\"\nplatform:\n workers: 1\nlog:\n version: 1\n disable_existing_loggers: false\n handlers:\n console:\n class: logging.StreamHandler\n root:\n level: INFO\n handlers: [console]\n\"\"\".strip(),\n encoding=\"utf-8\",\n )\n runtime = RuntimeManager()\n runtime.add_config_file(config_path)\n module = ExampleModule()\n runtime.register_module(module)\n\n runtime.start()\n sleep(0.2)\n status = runtime.status()\n runtime.stop()\n\n assert module.routine.processed == [{\"id\": 1}]\n assert status[\"modules\"] == [\"example\"]\n assert status[\"runtime\"][\"state\"] == \"idle\"\n assert status[\"health\"][\"status\"] == \"ok\"\n assert status[\"config\"] == {\"platform\": {\"workers\": 1}, \"log\": status[\"config\"][\"log\"]}", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_runtime.py:test_runtime_runs_worker_routine_and_exposes_status", - "span_start": 191, - "span_end": 223, - "lexical_rank": 6, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 7, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_runtime", - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "def _build_runtime(worker: Worker, *, control_timeout: int = 1) -> tuple[RuntimeManager, str]:\n runtime = RuntimeManager()\n channel = HttpControlChannel(host=\"127.0.0.1\", port=0, timeout=control_timeout)\n runtime.control_plane.register_channel(channel)\n runtime.register_module(WorkerModule(worker))\n runtime.start()\n return runtime, f\"http://127.0.0.1:{channel.port}\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:_build_runtime", - "span_start": 154, - "span_end": 160, - "lexical_rank": 6, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 6, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "def test_worker_wakes_up_with_configured_interval() -> None:\n interval = 0.15\n routine = IntervalRoutine()\n worker = ScenarioWorker(\"interval-worker\", routine, interval=interval)\n runtime = RuntimeManager()\n runtime.register_module(WorkerModule(worker))\n\n runtime.start()\n try:\n assert routine.wait_runs(count=3, timeout=2.0) is True\n finally:\n runtime.stop()\n\n deltas = routine.deltas()\n assert len(deltas) >= 2\n assert all(delta >= interval * 0.7 for delta in deltas[:2])", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:test_worker_wakes_up_with_configured_interval", - "span_start": 163, - "span_end": 178, - "lexical_rank": 6, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 7, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "class BlockingRoutine:\n def __init__(self, started: Event, release: Event) -> None:\n self._started = started\n self._release = release\n\n def run(self) -> None:\n self._started.set()\n self._release.wait(timeout=5.0)", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:BlockingRoutine", - "span_start": 40, - "span_end": 47, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 1, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "class ScenarioWorker(Worker):\n def __init__(self, name: str, routine: object, *, interval: float = 0.05) -> None:\n self._name = name\n self._routine = routine\n self._interval = interval\n self._thread: Thread | None = None\n self._stop_requested = Event()\n self._in_flight = 0\n self._runs = 0\n self._lock = Lock()\n\n @property\n def name(self) -> str:\n return self._name\n\n @property\n def critical(self) -> bool:\n return True\n\n def start(self) -> None:\n if self._thread is not None and self._thread.is_alive():\n return\n self._stop_requested.clear()\n self._thread = Thread(target=self._loop, name=f\"{self._name}-thread\", daemon=True)\n self._thread.start()\n\n def stop(self, force: bool = False) -> None:\n self._stop_requested.set()\n\n def health(self) -> WorkerHealth:\n return WorkerHealth(name=self.name, status=\"ok\", critical=True, meta={\"runs\": self._runs})\n\n def status(self) -> WorkerStatus:\n thread_alive = self._thread is not None and self._thread.is_alive()\n with self._lock:\n in_flight = self._in_flight\n runs = self._runs\n if not thread_alive:\n state = \"stopped\"\n elif self._stop_requested.is_set():\n state = \"stopping\"\n elif in_flight > 0:\n state = \"busy\"\n else:\n state = \"idle\"\n return WorkerStatus(name=self.name, state=state, in_flight=in_flight, meta={\"runs\": runs})\n\n def _loop(self) -> None:\n while not self._stop_requested.is_set():\n with self._lock:\n self._in_flight += 1\n try:\n self._routine.run()\n with self._lock:\n self._runs += 1\n finally:\n with self._lock:\n self._in_flight -= 1\n if self._stop_requested.is_set():\n return\n sleep(self._interval)", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:ScenarioWorker", - "span_start": 50, - "span_end": 110, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 2, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "class WorkerModule(ApplicationModule):\n def __init__(self, worker: Worker) -> None:\n self._worker = worker\n\n @property\n def name(self) -> str:\n return \"business-tests\"\n\n def register(self, registry: ModuleRegistry) -> None:\n registry.add_worker(self._worker)", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:WorkerModule", - "span_start": 113, - "span_end": 122, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 3, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "def _http_call_json(\n base_url: str,\n path: str,\n *,\n method: str = \"GET\",\n headers: dict[str, str] | None = None,\n) -> tuple[int, dict[str, object]]:\n request = Request(f\"{base_url}{path}\", method=method, headers=headers or {})\n try:\n with urlopen(request, timeout=15.0) as response:\n status = response.status\n body = response.read()\n except HTTPError as error:\n status = error.code\n body = error.read()\n payload = json.loads(body.decode(\"utf-8\"))\n return status, payload", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:_http_call_json", - "span_start": 125, - "span_end": 141, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 4, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "class IntervalRoutine:\n calls: list[float] = field(default_factory=list)\n _lock: Lock = field(default_factory=Lock)\n\n def run(self) -> None:\n with self._lock:\n self.calls.append(monotonic())\n\n def wait_runs(self, count: int, timeout: float) -> bool:\n deadline = monotonic() + timeout\n while monotonic() < deadline:\n with self._lock:\n if len(self.calls) >= count:\n return True\n sleep(0.01)\n return False\n\n def deltas(self) -> list[float]:\n with self._lock:\n return [self.calls[index + 1] - self.calls[index] for index in range(len(self.calls) - 1)]", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:IntervalRoutine", - "span_start": 18, - "span_end": 37, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "def _poll_until_stopped(base_url: str, timeout: float = 2.0) -> bool:\n deadline = monotonic() + timeout\n while monotonic() < deadline:\n _, payload = _http_call_json(base_url, \"/actions/status\")\n if payload.get(\"detail\") == \"stopped\":\n return True\n sleep(0.05)\n return False", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:_poll_until_stopped", - "span_start": 144, - "span_end": 151, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 5, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "llm_answer": "1. Прямые тесты:\n - tests/test_runtime.py | test_runtime_runs_worker_routine_and_exposes_status\n - Проверка: RuntimeManager запускает worker routine и правильно выставляет статус.\n - tests/test_runtime.py | test_runtime_graceful_stop_waits_until_worker_finishes\n - Проверка: RuntimeManager корректно завершает работу после graceful stop.\n\n2. Косвенные или ближайшие тесты:\n - tests/test_business_control_actions.py | _build_runtime\n - Проверка: косвенно подтверждает создание экземпляра RuntimeManager в бизнес-контроллерах.\n - tests/test_business_control_actions.py | test_worker_wakes_up_with_configured_interval\n - Проверка: косвенно подтверждает использование RuntimeManager при настройке интервалов выполнения задач.\n\n3. Пробелы покрытия:\n - Не найдены явные тесты, которые покрывают все возможные сценарии использования RuntimeManager, такие как регистрация нескольких модулей, обработка ошибок, работа с конфигурацией и т.д.\n\nПрямых тестов, полностью подтверждающих различные аспекты работы RuntimeManager, недостаточно.", - "summary": { - "router": { - "intent": "CODE_QA", - "sub_intent": "FIND_TESTS", - "confidence": null - }, - "retrieval": { - "profile": "code", - "layers_hit": [ - "C0_SOURCE_CHUNKS", - "C2_DEPENDENCY_GRAPH" - ], - "evidence_sufficient": true - }, - "llm": { - "answer_status": "answered", - "groundedness": "grounded" - } - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "FIND_TESTS", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "RuntimeManager" - ], - "keyword_hints": [ - "RuntimeManager" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**", - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "test_file_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "test_symbol_patterns": [ - "test_runtime_manager", - "TestRuntimeManager", - "RuntimeManager" - ], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C0_SOURCE_CHUNKS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C0_SOURCE_CHUNKS": 10 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [], - "include_globs": [ - "src", - "tests" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests" - ] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src", - "tests" - ], - "include_globs": [ - "src", - "tests" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests" - ] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src", - "tests" - ], - "include_globs": [ - "src", - "tests" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests" - ] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**", - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "Где тесты для RuntimeManager? test_runtime_manager TestRuntimeManager RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**", - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "top_k": 6, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Где тесты для RuntimeManager? test_runtime_manager TestRuntimeManager RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**", - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "top_k": 10, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [], - "normalized_include_globs": [ - "src", - "tests" - ], - "normalized_exclude_globs": [], - "normalized_prefer_globs": [ - "tests" - ], - "filter_stage": "post_rank", - "candidates_before_filter": 0, - "candidates_after_filter": 0 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src", - "tests" - ], - "normalized_include_globs": [ - "src", - "tests" - ], - "normalized_exclude_globs": [], - "normalized_prefer_globs": [ - "tests" - ], - "filter_stage": "post_rank", - "candidates_before_filter": 6, - "candidates_after_filter": 6 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src", - "tests" - ], - "normalized_include_globs": [ - "src", - "tests" - ], - "normalized_exclude_globs": [], - "normalized_prefer_globs": [ - "tests" - ], - "filter_stage": "post_rank", - "candidates_before_filter": 10, - "candidates_after_filter": 10 - } - ], - "fallback": { - "used": true, - "reason": "scope_relaxed_no_hits" - }, - "symbol_resolution": { - "status": "not_found", - "resolved_symbol": null, - "alternatives": [ - "RuntimeManager" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "miss", - "hit_count": 0, - "fail_reason": "scope_relaxed_no_hits" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 6, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 10, - "fail_reason": null - } - ] - }, - "constraint_violations": [ - { - "type": "LAYER_MISSING", - "severity": "warn", - "details": { - "layer": "C1_SYMBOL_CATALOG", - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ] - }, - "suggested_fix": "Increase top_k for this layer or relax constraints for retrieval." - } - ], - "timings_ms": { - "router": 0, - "symbol_resolution": 0, - "retrieval_total": 152, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 82, - "C2_DEPENDENCY_GRAPH": 52, - "C0_SOURCE_CHUNKS": 17 - }, - "merge_rank": 0, - "prompt_build": 0, - "llm_call": 1762 - }, - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 904, - "evidence_rows": 16, - "evidence_chars": 7086 - }, - "evidence_summary": [ - { - "layer": "C2_DEPENDENCY_GRAPH", - "count": 6, - "unique_paths": 2 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 10, - "unique_paths": 2 - } - ], - "prompt_template_id": "intent_code_qa_find_tests_ru_v2", - "system_prompt_version": "v1" - }, - "router": { - "conversation_mode": "START", - "keyword_hints": [ - "RuntimeManager" - ], - "path_scope": [] - }, - "llm": { - "used_evidence_count": 16, - "missing_evidence_reason": null - } - }, - "run_info": { - "case_id": "plba-fullchain-find-tests-runtime-manager", - "mode": "full_chain", - "run_started_at": "2026-03-12T12:39:45", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - }, - "input_request": { - "text": "Где тесты для RuntimeManager?", - "normalized_query": "Где тесты для RuntimeManager?" - }, - "steps": [ - { - "step": "intent_router", - "input": { - "query": "Где тесты для RuntimeManager?" - }, - "output": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Где тесты для RuntimeManager?" - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "FIND_TESTS", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "RuntimeManager" - ], - "keyword_hints": [ - "RuntimeManager" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**", - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "test_file_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "test_symbol_patterns": [ - "test_runtime_manager", - "TestRuntimeManager", - "RuntimeManager" - ], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "timings_ms": { - "router": 0 - } - } - }, - { - "step": "retrieval", - "input": { - "query": "Где тесты для RuntimeManager?" - }, - "output": { - "symbol_resolution": { - "status": "not_found", - "resolved_symbol": null, - "alternatives": [ - "RuntimeManager" - ], - "confidence": 0.0 - }, - "rag_count": 16, - "rag_rows": [ - { - "path": "tests/test_runtime.py", - "content": "test_runtime_runs_worker_routine_and_exposes_status instantiates RuntimeManager", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_runtime_runs_worker_routine_and_exposes_status:instantiates", - "span_start": 209, - "span_end": 209, - "lexical_rank": 6, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "c397a308e7824ba9fe400a754c7e15e66ea6f058d7f5d3e82bb002bb78b509d2", - "edge_type": "instantiates", - "src_symbol_id": "1c767eb5ee08e84f45b18c8ed7531ec0ed73c63fb1594823569672db7b21e992", - "src_qname": "test_runtime_runs_worker_routine_and_exposes_status", - "dst_symbol_id": "aeadc039653807b0da1ca6e3cc1078ee61cfc510b28e7f9c2ec04c59da43cc8d", - "dst_ref": "RuntimeManager", - "resolution": "resolved", - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_runtime.py", - "content": "test_runtime_graceful_stop_waits_until_worker_finishes instantiates RuntimeManager", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_runtime_graceful_stop_waits_until_worker_finishes:instantiates", - "span_start": 229, - "span_end": 229, - "lexical_rank": 6, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "76b4701262ccaa0a7a41691407c4ebdb2ca74a2415d89f0a38ef0d4f608bda93", - "edge_type": "instantiates", - "src_symbol_id": "1076e788e4a03b10d7bc1313a8ad46caa170c13cc026c6e4de994af1a6ae57bf", - "src_qname": "test_runtime_graceful_stop_waits_until_worker_finishes", - "dst_symbol_id": "aeadc039653807b0da1ca6e3cc1078ee61cfc510b28e7f9c2ec04c59da43cc8d", - "dst_ref": "RuntimeManager", - "resolution": "resolved", - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "_build_runtime instantiates RuntimeManager", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "_build_runtime:instantiates", - "span_start": 155, - "span_end": 155, - "lexical_rank": 6, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "7eb254d564944bab6272757ee5ef688862bd321e6941e2495dc942e03b1c9a25", - "edge_type": "instantiates", - "src_symbol_id": "db94031d5245bf82be836a109b4584b43b8e83d37a0f318e03f6c8191896d469", - "src_qname": "_build_runtime", - "dst_symbol_id": "a1572ea8183dc0cd6ddbc74342bbde8c28cecfde37ad40b62feff09f8d103d11", - "dst_ref": "RuntimeManager", - "resolution": "resolved", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "test_worker_wakes_up_with_configured_interval instantiates RuntimeManager", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_worker_wakes_up_with_configured_interval:instantiates", - "span_start": 167, - "span_end": 167, - "lexical_rank": 6, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "189aafc4de0b79c688668f25f0c87166a127df26bd2215452014713b65ef281a", - "edge_type": "instantiates", - "src_symbol_id": "65f877f78191d65e6a752e41cedc70ebc784c266804a55c1c56440336e1f0d6e", - "src_qname": "test_worker_wakes_up_with_configured_interval", - "dst_symbol_id": "a1572ea8183dc0cd6ddbc74342bbde8c28cecfde37ad40b62feff09f8d103d11", - "dst_ref": "RuntimeManager", - "resolution": "resolved", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "test_actions_stop_busy_worker_after_timeout\n -> BlockingRoutine\n -> BlockingRoutine.__init__\n -> BlockingRoutine._started\n -> BlockingRoutine.run", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_actions_stop_busy_worker_after_timeout:dataflow_slice", - "span_start": 42, - "span_end": 238, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 5, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "8e7db3d2a9226f1c1d9942ac6373cfcafa0d2276758ddb8a3d3c455a3d58024d", - "edge_type": "dataflow_slice", - "src_symbol_id": "66392d3222421d9ba16eda3554940b16e7d5a6f33aa08c5738d35af2e32f1e4a", - "src_qname": "test_actions_stop_busy_worker_after_timeout", - "dst_symbol_id": "d9841bdbb69706c988ae7ae6adf89928dc4fae45943f74064f5382177034ba04", - "dst_ref": "BlockingRoutine.run", - "resolution": "resolved", - "slice_id": "8e7db3d2a9226f1c1d9942ac6373cfcafa0d2276758ddb8a3d3c455a3d58024d", - "root_symbol_id": "66392d3222421d9ba16eda3554940b16e7d5a6f33aa08c5738d35af2e32f1e4a", - "path_symbols": [ - "test_actions_stop_busy_worker_after_timeout", - "BlockingRoutine", - "BlockingRoutine.__init__", - "BlockingRoutine._started", - "BlockingRoutine.run" - ], - "path_symbol_ids": [ - "66392d3222421d9ba16eda3554940b16e7d5a6f33aa08c5738d35af2e32f1e4a", - "a3349c5bc65e4003a4bbd6a8dbb7a54c337e12d1aed930caa701b12e520f1e67", - "486deeed3043c6db985aef258e96ddc67aa53608e67a83962fbd2471f649ddf1", - "d9841bdbb69706c988ae7ae6adf89928dc4fae45943f74064f5382177034ba04" - ], - "path_edge_types": [ - "instantiates", - "writes_attr", - "reads_attr" - ], - "path_length": 5, - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "test_actions_stop_busy_worker_before_timeout\n -> BlockingRoutine\n -> BlockingRoutine.__init__\n -> BlockingRoutine._release\n -> BlockingRoutine.run", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_actions_stop_busy_worker_before_timeout:dataflow_slice", - "span_start": 43, - "span_end": 212, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 5, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "8bd726155ba387d3579763ee84dfd2f9a90bc917da88f3b2e89416ab5c1254d6", - "edge_type": "dataflow_slice", - "src_symbol_id": "a0bb116ca9d909c93a285667ae033fbd1859b2dad7cf34fcb44816393ef6909c", - "src_qname": "test_actions_stop_busy_worker_before_timeout", - "dst_symbol_id": "d9841bdbb69706c988ae7ae6adf89928dc4fae45943f74064f5382177034ba04", - "dst_ref": "BlockingRoutine.run", - "resolution": "resolved", - "slice_id": "8bd726155ba387d3579763ee84dfd2f9a90bc917da88f3b2e89416ab5c1254d6", - "root_symbol_id": "a0bb116ca9d909c93a285667ae033fbd1859b2dad7cf34fcb44816393ef6909c", - "path_symbols": [ - "test_actions_stop_busy_worker_before_timeout", - "BlockingRoutine", - "BlockingRoutine.__init__", - "BlockingRoutine._release", - "BlockingRoutine.run" - ], - "path_symbol_ids": [ - "a0bb116ca9d909c93a285667ae033fbd1859b2dad7cf34fcb44816393ef6909c", - "a3349c5bc65e4003a4bbd6a8dbb7a54c337e12d1aed930caa701b12e520f1e67", - "486deeed3043c6db985aef258e96ddc67aa53608e67a83962fbd2471f649ddf1", - "d9841bdbb69706c988ae7ae6adf89928dc4fae45943f74064f5382177034ba04" - ], - "path_edge_types": [ - "instantiates", - "writes_attr", - "reads_attr" - ], - "path_length": 5, - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_runtime.py", - "content": "def test_runtime_graceful_stop_waits_until_worker_finishes() -> None:\n started = Event()\n release = Event()\n runtime = RuntimeManager()\n runtime.register_module(BlockingModule(started, release))\n runtime.start()\n assert started.wait(timeout=1.0) is True\n assert runtime.status()[\"runtime\"][\"state\"] == \"busy\"\n\n stop_thread = Thread(target=runtime.stop, kwargs={\"timeout\": 1.0}, daemon=True)\n stop_thread.start()\n sleep(0.1)\n assert stop_thread.is_alive() is True\n\n release.set()\n stop_thread.join(timeout=1.0)\n assert stop_thread.is_alive() is False\n assert runtime.status()[\"runtime\"][\"state\"] == \"stopped\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_runtime.py:test_runtime_graceful_stop_waits_until_worker_finishes", - "span_start": 226, - "span_end": 243, - "lexical_rank": 6, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 8, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_runtime", - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_runtime.py", - "content": "def test_runtime_runs_worker_routine_and_exposes_status(tmp_path) -> None:\n config_path = tmp_path / \"config.yml\"\n config_path.write_text(\n \"\"\"\nplatform:\n workers: 1\nlog:\n version: 1\n disable_existing_loggers: false\n handlers:\n console:\n class: logging.StreamHandler\n root:\n level: INFO\n handlers: [console]\n\"\"\".strip(),\n encoding=\"utf-8\",\n )\n runtime = RuntimeManager()\n runtime.add_config_file(config_path)\n module = ExampleModule()\n runtime.register_module(module)\n\n runtime.start()\n sleep(0.2)\n status = runtime.status()\n runtime.stop()\n\n assert module.routine.processed == [{\"id\": 1}]\n assert status[\"modules\"] == [\"example\"]\n assert status[\"runtime\"][\"state\"] == \"idle\"\n assert status[\"health\"][\"status\"] == \"ok\"\n assert status[\"config\"] == {\"platform\": {\"workers\": 1}, \"log\": status[\"config\"][\"log\"]}", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_runtime.py:test_runtime_runs_worker_routine_and_exposes_status", - "span_start": 191, - "span_end": 223, - "lexical_rank": 6, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 7, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_runtime", - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "def _build_runtime(worker: Worker, *, control_timeout: int = 1) -> tuple[RuntimeManager, str]:\n runtime = RuntimeManager()\n channel = HttpControlChannel(host=\"127.0.0.1\", port=0, timeout=control_timeout)\n runtime.control_plane.register_channel(channel)\n runtime.register_module(WorkerModule(worker))\n runtime.start()\n return runtime, f\"http://127.0.0.1:{channel.port}\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:_build_runtime", - "span_start": 154, - "span_end": 160, - "lexical_rank": 6, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 6, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "def test_worker_wakes_up_with_configured_interval() -> None:\n interval = 0.15\n routine = IntervalRoutine()\n worker = ScenarioWorker(\"interval-worker\", routine, interval=interval)\n runtime = RuntimeManager()\n runtime.register_module(WorkerModule(worker))\n\n runtime.start()\n try:\n assert routine.wait_runs(count=3, timeout=2.0) is True\n finally:\n runtime.stop()\n\n deltas = routine.deltas()\n assert len(deltas) >= 2\n assert all(delta >= interval * 0.7 for delta in deltas[:2])", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:test_worker_wakes_up_with_configured_interval", - "span_start": 163, - "span_end": 178, - "lexical_rank": 6, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 7, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "class BlockingRoutine:\n def __init__(self, started: Event, release: Event) -> None:\n self._started = started\n self._release = release\n\n def run(self) -> None:\n self._started.set()\n self._release.wait(timeout=5.0)", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:BlockingRoutine", - "span_start": 40, - "span_end": 47, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 1, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "class ScenarioWorker(Worker):\n def __init__(self, name: str, routine: object, *, interval: float = 0.05) -> None:\n self._name = name\n self._routine = routine\n self._interval = interval\n self._thread: Thread | None = None\n self._stop_requested = Event()\n self._in_flight = 0\n self._runs = 0\n self._lock = Lock()\n\n @property\n def name(self) -> str:\n return self._name\n\n @property\n def critical(self) -> bool:\n return True\n\n def start(self) -> None:\n if self._thread is not None and self._thread.is_alive():\n return\n self._stop_requested.clear()\n self._thread = Thread(target=self._loop, name=f\"{self._name}-thread\", daemon=True)\n self._thread.start()\n\n def stop(self, force: bool = False) -> None:\n self._stop_requested.set()\n\n def health(self) -> WorkerHealth:\n return WorkerHealth(name=self.name, status=\"ok\", critical=True, meta={\"runs\": self._runs})\n\n def status(self) -> WorkerStatus:\n thread_alive = self._thread is not None and self._thread.is_alive()\n with self._lock:\n in_flight = self._in_flight\n runs = self._runs\n if not thread_alive:\n state = \"stopped\"\n elif self._stop_requested.is_set():\n state = \"stopping\"\n elif in_flight > 0:\n state = \"busy\"\n else:\n state = \"idle\"\n return WorkerStatus(name=self.name, state=state, in_flight=in_flight, meta={\"runs\": runs})\n\n def _loop(self) -> None:\n while not self._stop_requested.is_set():\n with self._lock:\n self._in_flight += 1\n try:\n self._routine.run()\n with self._lock:\n self._runs += 1\n finally:\n with self._lock:\n self._in_flight -= 1\n if self._stop_requested.is_set():\n return\n sleep(self._interval)", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:ScenarioWorker", - "span_start": 50, - "span_end": 110, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 2, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "class WorkerModule(ApplicationModule):\n def __init__(self, worker: Worker) -> None:\n self._worker = worker\n\n @property\n def name(self) -> str:\n return \"business-tests\"\n\n def register(self, registry: ModuleRegistry) -> None:\n registry.add_worker(self._worker)", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:WorkerModule", - "span_start": 113, - "span_end": 122, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 3, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "def _http_call_json(\n base_url: str,\n path: str,\n *,\n method: str = \"GET\",\n headers: dict[str, str] | None = None,\n) -> tuple[int, dict[str, object]]:\n request = Request(f\"{base_url}{path}\", method=method, headers=headers or {})\n try:\n with urlopen(request, timeout=15.0) as response:\n status = response.status\n body = response.read()\n except HTTPError as error:\n status = error.code\n body = error.read()\n payload = json.loads(body.decode(\"utf-8\"))\n return status, payload", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:_http_call_json", - "span_start": 125, - "span_end": 141, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 4, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "class IntervalRoutine:\n calls: list[float] = field(default_factory=list)\n _lock: Lock = field(default_factory=Lock)\n\n def run(self) -> None:\n with self._lock:\n self.calls.append(monotonic())\n\n def wait_runs(self, count: int, timeout: float) -> bool:\n deadline = monotonic() + timeout\n while monotonic() < deadline:\n with self._lock:\n if len(self.calls) >= count:\n return True\n sleep(0.01)\n return False\n\n def deltas(self) -> list[float]:\n with self._lock:\n return [self.calls[index + 1] - self.calls[index] for index in range(len(self.calls) - 1)]", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:IntervalRoutine", - "span_start": 18, - "span_end": 37, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "def _poll_until_stopped(base_url: str, timeout: float = 2.0) -> bool:\n deadline = monotonic() + timeout\n while monotonic() < deadline:\n _, payload = _http_call_json(base_url, \"/actions/status\")\n if payload.get(\"detail\") == \"stopped\":\n return True\n sleep(0.05)\n return False", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:_poll_until_stopped", - "span_start": 144, - "span_end": 151, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 5, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ] - }, - "diagnostics": { - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C0_SOURCE_CHUNKS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C0_SOURCE_CHUNKS": 10 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [], - "include_globs": [ - "src", - "tests" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests" - ] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src", - "tests" - ], - "include_globs": [ - "src", - "tests" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests" - ] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src", - "tests" - ], - "include_globs": [ - "src", - "tests" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests" - ] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**", - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "Где тесты для RuntimeManager? test_runtime_manager TestRuntimeManager RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**", - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "top_k": 6, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Где тесты для RuntimeManager? test_runtime_manager TestRuntimeManager RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**", - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "top_k": 10, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [], - "normalized_include_globs": [ - "src", - "tests" - ], - "normalized_exclude_globs": [], - "normalized_prefer_globs": [ - "tests" - ], - "filter_stage": "post_rank", - "candidates_before_filter": 0, - "candidates_after_filter": 0 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src", - "tests" - ], - "normalized_include_globs": [ - "src", - "tests" - ], - "normalized_exclude_globs": [], - "normalized_prefer_globs": [ - "tests" - ], - "filter_stage": "post_rank", - "candidates_before_filter": 6, - "candidates_after_filter": 6 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src", - "tests" - ], - "normalized_include_globs": [ - "src", - "tests" - ], - "normalized_exclude_globs": [], - "normalized_prefer_globs": [ - "tests" - ], - "filter_stage": "post_rank", - "candidates_before_filter": 10, - "candidates_after_filter": 10 - } - ], - "fallback": { - "used": true, - "reason": "scope_relaxed_no_hits" - }, - "symbol_resolution": { - "status": "not_found", - "resolved_symbol": null, - "alternatives": [ - "RuntimeManager" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "miss", - "hit_count": 0, - "fail_reason": "scope_relaxed_no_hits" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 6, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 10, - "fail_reason": null - } - ] - }, - "constraint_violations": [ - { - "type": "LAYER_MISSING", - "severity": "warn", - "details": { - "layer": "C1_SYMBOL_CATALOG", - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ] - }, - "suggested_fix": "Increase top_k for this layer or relax constraints for retrieval." - } - ], - "timings_ms": { - "symbol_resolution": 0, - "retrieval_total": 152, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 82, - "C2_DEPENDENCY_GRAPH": 52, - "C0_SOURCE_CHUNKS": 17 - }, - "merge_rank": 0 - } - } - }, - { - "step": "llm_answer", - "input": { - "query": "Где тесты для RuntimeManager?", - "rag_count": 16 - }, - "output": { - "llm_answer": "1. Прямые тесты:\n - tests/test_runtime.py | test_runtime_runs_worker_routine_and_exposes_status\n - Проверка: RuntimeManager запускает worker routine и правильно выставляет статус.\n - tests/test_runtime.py | test_runtime_graceful_stop_waits_until_worker_finishes\n - Проверка: RuntimeManager корректно завершает работу после graceful stop.\n\n2. Косвенные или ближайшие тесты:\n - tests/test_business_control_actions.py | _build_runtime\n - Проверка: косвенно подтверждает создание экземпляра RuntimeManager в бизнес-контроллерах.\n - tests/test_business_control_actions.py | test_worker_wakes_up_with_configured_interval\n - Проверка: косвенно подтверждает использование RuntimeManager при настройке интервалов выполнения задач.\n\n3. Пробелы покрытия:\n - Не найдены явные тесты, которые покрывают все возможные сценарии использования RuntimeManager, такие как регистрация нескольких модулей, обработка ошибок, работа с конфигурацией и т.д.\n\nПрямых тестов, полностью подтверждающих различные аспекты работы RuntimeManager, недостаточно." - }, - "diagnostics": { - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 904, - "evidence_rows": 16, - "evidence_chars": 7086 - }, - "evidence_summary": [ - { - "layer": "C2_DEPENDENCY_GRAPH", - "count": 6, - "unique_paths": 2 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 10, - "unique_paths": 2 - } - ], - "prompt_template_id": "intent_code_qa_find_tests_ru_v2", - "system_prompt_version": "v1" - }, - "timings_ms": { - "prompt_build": 0, - "llm_call": 1762 - } - } - } - ] - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents/20260312_123945/full_chain_plba_code_subintents_plba-fullchain-find-tests-runtime-manager.md b/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents/20260312_123945/full_chain_plba_code_subintents_plba-fullchain-find-tests-runtime-manager.md deleted file mode 100644 index 4781aa8..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents/20260312_123945/full_chain_plba_code_subintents_plba-fullchain-find-tests-runtime-manager.md +++ /dev/null @@ -1,32 +0,0 @@ -# plba-fullchain-find-tests-runtime-manager - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_subintents.yaml -- runner: runtime -- mode: full_chain -- passed: True - -## Query -Где тесты для RuntimeManager? - -## Actual -{ - "intent": "CODE_QA", - "sub_intent": "FIND_TESTS", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 16, - "llm_answer": "1. Прямые тесты:\n - tests/test_runtime.py | test_runtime_runs_worker_routine_and_exposes_status\n - Проверка: RuntimeManager запускает worker routine и правильно выставляет статус.\n - tests/test_runtime.py | test_runtime_graceful_stop_waits_until_worker_finishes\n - Проверка: RuntimeManager корректно завершает работу после graceful stop.\n\n2. Косвенные или ближайшие тесты:\n - tests/test_business_control_actions.py | _build_runtime\n - Проверка: косвенно подтверждает создание экземпляра RuntimeManager в бизнес-контроллерах.\n - tests/test_business_control_actions.py | test_worker_wakes_up_with_configured_interval\n - Проверка: косвенно подтверждает использование RuntimeManager при настройке интервалов выполнения задач.\n\n3. Пробелы покрытия:\n - Не найдены явные тесты, которые покрывают все возможные сценарии использования RuntimeManager, такие как регистрация нескольких модулей, обработка ошибок, работа с конфигурацией и т.д.\n\nПрямых тестов, полностью подтверждающих различные аспекты работы RuntimeManager, недостаточно.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "RuntimeManager" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ] -} - -## Mismatches -- none \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents/20260312_123945/full_chain_plba_code_subintents_plba-fullchain-open-file-runtime.json b/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents/20260312_123945/full_chain_plba_code_subintents_plba-fullchain-open-file-runtime.json deleted file mode 100644 index 5ab057f..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents/20260312_123945/full_chain_plba_code_subintents_plba-fullchain-open-file-runtime.json +++ /dev/null @@ -1,492 +0,0 @@ -{ - "case_id": "plba-fullchain-open-file-runtime", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_subintents.yaml", - "runner": "runtime", - "mode": "full_chain", - "actual": { - "intent": "CODE_QA", - "sub_intent": "OPEN_FILE", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 1, - "llm_answer": "1. путь к файлу: src/app_runtime/core/runtime.py\n2. В доступных фрагментах видна начальная часть класса RuntimeManager.\n3. Top-level сущности и секции: класс RuntimeManager с методом __init__, методом _register_core_services и частично виден метод register_module.\n4. Важно для вопроса пользователя:\n- Класс RuntimeManager является основным управляющим объектом для runtime-среды.\n- В конструкторе инициализируются основные компоненты системы (ConfigurationManager, ServiceContainer, TraceService и др.).\n- Метод _register_core_services вероятно отвечает за регистрацию основных сервисов приложения.\n- Метод register_module используется для регистрации модулей приложения.", - "answer_mode": "answered", - "path_scope": [ - "src/app_runtime/core/runtime.py" - ], - "symbol_candidates": [], - "layers": [ - "C0_SOURCE_CHUNKS" - ] - }, - "passed": true, - "mismatches": [], - "details": { - "case_id": "plba-fullchain-open-file-runtime", - "text": "Открой файл src/app_runtime/core/runtime.py", - "mode": "full_chain", - "run_started_at": "2026-03-12T12:39:45", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Открой файл src/app_runtime/core/runtime.py", - "symbol_resolution": { - "status": "not_requested", - "resolved_symbol": null, - "alternatives": [], - "confidence": 0.0 - }, - "rag_count": 1, - "rag_rows": [ - { - "path": "src/app_runtime/core/runtime.py", - "content": "class RuntimeManager:\n ACTION_TIMEOUT_SECONDS = 10.0\n ACTION_POLL_INTERVAL_SECONDS = 0.05\n\n def __init__(\n self,\n configuration: ConfigurationManager | None = None,\n services: ServiceContainer | None = None,\n traces: TraceService | None = None,\n health: HealthRegistry | None = None,\n logs: LogManager | None = None,\n workers: WorkerSupervisor | None = None,\n control_plane: ControlPlaneService | None = None,\n ) -> None:\n self.configuration = configuration or ConfigurationManager()\n self.services = services or ServiceContainer()\n self.traces = traces or TraceService()\n self.health = health or HealthRegistry()\n self.logs = logs or LogManager()\n self.workers = workers or WorkerSupervisor()\n self.control_plane = control_plane or ControlPlaneService()\n self.registry = ModuleRegistry(self.services)\n self._started = False\n self._state = LifecycleState.IDLE\n self._core_registered = False\n self._workers_registered = False\n self._register_core_services()\n\n def register_module(self, module: ApplicationModule) -> None:\n self.registry.register_module(module.name)\n module.register(self.registry)\n\n def add_config_file(self, path: str) -> FileConfigProvider:\n provider = FileConfigProvider(path)\n self.configuration.add_provider(provider)\n return provider\n\n def start(self, *, start_control_plane: bool = True) -> None:\n if self._started:\n return\n self._state = LifecycleState.STARTING\n config = self.configuration.load()\n self.logs.apply_config(config)\n self._register_health_contributors()\n self._register_workers()\n self.workers.start()\n if start_control_plane:\n self.control_plane.start(self)\n self._started = True\n self._refresh_state()\n\n def stop(self, timeout: float = 30.0, force: bool = False, stop_control_plane: bool = True) -> None:\n if not self._started:\n return\n self._state = LifecycleState.STOPPING\n self.workers.stop(timeout=timeout, force=force)\n if stop_control_plane:\n self.control_plane.stop()\n self._started = False\n self._state = LifecycleState.STOPPED\n\n def status(self) -> dict[str, object]:\n self._refresh_state()\n return self.control_plane.snapshot(self)\n\n def current_health(self) -> HealthPayload:\n self._refresh_state()\n return self.health.payload(self._state, self.workers.healths())\n\n async def health_status(self) -> HealthPayload:\n return self.current_health()\n\n async def start_runtime(self) -> dict[str, object] | str:\n self._refresh_state()\n if self._started:\n return \"runtime already running\"\n if self._state == LifecycleState.STOPPING:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n\n self.start(start_control_plane=False)\n started = self._wait_for_state({LifecycleState.IDLE, LifecycleState.BUSY}, timeout=self.ACTION_TIMEOUT_SECONDS)\n if started:\n return self._action_detail(\"runtime started\", timed_out=False)\n return self._action_detail(\"runtime start is still in progress\", timed_out=True)\n\n async def stop_runtime(self) -> dict[str, object] | str:\n self._refresh_state()\n if not self._started:\n if self._state == LifecycleState.STOPPING:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n return \"runtime already stopped\"\n\n self._state = LifecycleState.STOPPING\n try:\n self.workers.stop(timeout=self.ACTION_TIMEOUT_SECONDS, force=False)\n except TimeoutError:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n\n self._started = False\n self._state = LifecycleState.STOPPED\n return self._action_detail(\"runtime stopped\", timed_out=False)\n\n async def runtime_status(self) -> str:\n self._refresh_state()\n return self._state.value\n\n def _register_core_services(self) -> None:\n if self._core_registered:\n return\n self.services.register(\"configuration\", self.configuration)\n self.services.register(\"traces\", self.traces)\n self.services.register(\"health\", self.health)\n self.services.register(\"logs\", self.logs)\n self.services.register(\"workers\", self.workers)\n self.services.register(\"control_plane\", self.control_plane)\n self._core_registered = True\n\n def _register_health_contributors(self) -> None:\n for contributor in self.registry.health_contributors:\n self.health.register(contributor)\n\n def _register_workers(self) -> None:\n if self._workers_registered:\n return\n for worker in self.registry.workers:\n self.workers.register(worker)\n self._workers_registered = True\n\n def _refresh_state(self) -> None:\n lifecycle = self.workers.lifecycle_state()\n\n if self._state == LifecycleState.STOPPING:\n if lifecycle == LifecycleState.STOPPED:\n self._started = False\n self._state = LifecycleState.STOPPED\n return\n\n if not self._started:\n if lifecycle == LifecycleState.STOPPED:\n self._state = LifecycleState.STOPPED\n return\n\n self._state = lifecycle\n\n def _wait_for_state(self, target_states: set[LifecycleState], *, timeout: float) -> bool:\n deadline = monotonic() + timeout\n while monotonic() < deadline:\n self._refresh_state()\n if self._state in target_states:\n return True\n sleep(self.ACTION_POLL_INTERVAL_SECONDS)\n self._refresh_state()\n return self._state in target_states\n\n def _action_detail(self, message: str, *, timed_out: bool) -> dict[str, object]:\n self._refresh_state()\n return {\n \"message\": message,\n \"state\": self._state.value,\n \"timed_out\": timed_out,\n \"workers\": self.workers.snapshot(),\n }", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/core/runtime.py:RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.core.runtime", - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "llm_answer": "1. путь к файлу: src/app_runtime/core/runtime.py\n2. В доступных фрагментах видна начальная часть класса RuntimeManager.\n3. Top-level сущности и секции: класс RuntimeManager с методом __init__, методом _register_core_services и частично виден метод register_module.\n4. Важно для вопроса пользователя:\n- Класс RuntimeManager является основным управляющим объектом для runtime-среды.\n- В конструкторе инициализируются основные компоненты системы (ConfigurationManager, ServiceContainer, TraceService и др.).\n- Метод _register_core_services вероятно отвечает за регистрацию основных сервисов приложения.\n- Метод register_module используется для регистрации модулей приложения.", - "summary": { - "router": { - "intent": "CODE_QA", - "sub_intent": "OPEN_FILE", - "confidence": null - }, - "retrieval": { - "profile": "code", - "layers_hit": [ - "C0_SOURCE_CHUNKS" - ], - "evidence_sufficient": true - }, - "llm": { - "answer_status": "answered", - "groundedness": "grounded" - } - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "OPEN_FILE", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C0_SOURCE_CHUNKS" - ], - "symbol_kind_hint": "unknown", - "symbol_candidates": [], - "keyword_hints": [], - "path_hints": [ - "src/app_runtime/core/runtime.py" - ], - "path_scope": [ - "src/app_runtime/core/runtime.py" - ], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/app_runtime/core/runtime.py" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": false, - "max_distance": 2, - "top_k": 5 - } - } - }, - "execution": { - "executed_layers": [ - "C0_SOURCE_CHUNKS" - ], - "retrieval_mode_by_layer": { - "C0_SOURCE_CHUNKS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C0_SOURCE_CHUNKS": 200 - }, - "filters_by_layer": { - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src/app_runtime/core/runtime.py" - ], - "include_globs": [], - "exclude_globs": [], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Открой файл src/app_runtime/core/runtime.py", - "path_scope": [ - "src/app_runtime/core/runtime.py" - ], - "include_globs": [], - "exclude_globs": [], - "prefer_globs": [], - "top_k": 200, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src/app_runtime/core/runtime.py" - ], - "normalized_include_globs": [], - "normalized_exclude_globs": [], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 1, - "candidates_after_filter": 1 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "not_requested", - "resolved_symbol": null, - "alternatives": [] - }, - "layers": [ - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 1, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "router": 1, - "symbol_resolution": 0, - "retrieval_total": 251, - "retrieval_by_layer": { - "C0_SOURCE_CHUNKS": 251 - }, - "merge_rank": 0, - "prompt_build": 0, - "llm_call": 1139 - }, - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 600, - "evidence_rows": 1, - "evidence_chars": 6265 - }, - "evidence_summary": [ - { - "layer": "C0_SOURCE_CHUNKS", - "count": 1, - "unique_paths": 1 - } - ], - "prompt_template_id": "intent_code_qa_open_file_ru_v2", - "system_prompt_version": "v1" - }, - "router": { - "conversation_mode": "START", - "keyword_hints": [], - "path_scope": [ - "src/app_runtime/core/runtime.py" - ] - }, - "llm": { - "used_evidence_count": 1, - "missing_evidence_reason": null - } - }, - "run_info": { - "case_id": "plba-fullchain-open-file-runtime", - "mode": "full_chain", - "run_started_at": "2026-03-12T12:39:45", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - }, - "input_request": { - "text": "Открой файл src/app_runtime/core/runtime.py", - "normalized_query": "Открой файл src/app_runtime/core/runtime.py" - }, - "steps": [ - { - "step": "intent_router", - "input": { - "query": "Открой файл src/app_runtime/core/runtime.py" - }, - "output": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Открой файл src/app_runtime/core/runtime.py" - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "OPEN_FILE", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C0_SOURCE_CHUNKS" - ], - "symbol_kind_hint": "unknown", - "symbol_candidates": [], - "keyword_hints": [], - "path_hints": [ - "src/app_runtime/core/runtime.py" - ], - "path_scope": [ - "src/app_runtime/core/runtime.py" - ], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/app_runtime/core/runtime.py" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": false, - "max_distance": 2, - "top_k": 5 - } - } - }, - "timings_ms": { - "router": 1 - } - } - }, - { - "step": "retrieval", - "input": { - "query": "Открой файл src/app_runtime/core/runtime.py" - }, - "output": { - "symbol_resolution": { - "status": "not_requested", - "resolved_symbol": null, - "alternatives": [], - "confidence": 0.0 - }, - "rag_count": 1, - "rag_rows": [ - { - "path": "src/app_runtime/core/runtime.py", - "content": "class RuntimeManager:\n ACTION_TIMEOUT_SECONDS = 10.0\n ACTION_POLL_INTERVAL_SECONDS = 0.05\n\n def __init__(\n self,\n configuration: ConfigurationManager | None = None,\n services: ServiceContainer | None = None,\n traces: TraceService | None = None,\n health: HealthRegistry | None = None,\n logs: LogManager | None = None,\n workers: WorkerSupervisor | None = None,\n control_plane: ControlPlaneService | None = None,\n ) -> None:\n self.configuration = configuration or ConfigurationManager()\n self.services = services or ServiceContainer()\n self.traces = traces or TraceService()\n self.health = health or HealthRegistry()\n self.logs = logs or LogManager()\n self.workers = workers or WorkerSupervisor()\n self.control_plane = control_plane or ControlPlaneService()\n self.registry = ModuleRegistry(self.services)\n self._started = False\n self._state = LifecycleState.IDLE\n self._core_registered = False\n self._workers_registered = False\n self._register_core_services()\n\n def register_module(self, module: ApplicationModule) -> None:\n self.registry.register_module(module.name)\n module.register(self.registry)\n\n def add_config_file(self, path: str) -> FileConfigProvider:\n provider = FileConfigProvider(path)\n self.configuration.add_provider(provider)\n return provider\n\n def start(self, *, start_control_plane: bool = True) -> None:\n if self._started:\n return\n self._state = LifecycleState.STARTING\n config = self.configuration.load()\n self.logs.apply_config(config)\n self._register_health_contributors()\n self._register_workers()\n self.workers.start()\n if start_control_plane:\n self.control_plane.start(self)\n self._started = True\n self._refresh_state()\n\n def stop(self, timeout: float = 30.0, force: bool = False, stop_control_plane: bool = True) -> None:\n if not self._started:\n return\n self._state = LifecycleState.STOPPING\n self.workers.stop(timeout=timeout, force=force)\n if stop_control_plane:\n self.control_plane.stop()\n self._started = False\n self._state = LifecycleState.STOPPED\n\n def status(self) -> dict[str, object]:\n self._refresh_state()\n return self.control_plane.snapshot(self)\n\n def current_health(self) -> HealthPayload:\n self._refresh_state()\n return self.health.payload(self._state, self.workers.healths())\n\n async def health_status(self) -> HealthPayload:\n return self.current_health()\n\n async def start_runtime(self) -> dict[str, object] | str:\n self._refresh_state()\n if self._started:\n return \"runtime already running\"\n if self._state == LifecycleState.STOPPING:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n\n self.start(start_control_plane=False)\n started = self._wait_for_state({LifecycleState.IDLE, LifecycleState.BUSY}, timeout=self.ACTION_TIMEOUT_SECONDS)\n if started:\n return self._action_detail(\"runtime started\", timed_out=False)\n return self._action_detail(\"runtime start is still in progress\", timed_out=True)\n\n async def stop_runtime(self) -> dict[str, object] | str:\n self._refresh_state()\n if not self._started:\n if self._state == LifecycleState.STOPPING:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n return \"runtime already stopped\"\n\n self._state = LifecycleState.STOPPING\n try:\n self.workers.stop(timeout=self.ACTION_TIMEOUT_SECONDS, force=False)\n except TimeoutError:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n\n self._started = False\n self._state = LifecycleState.STOPPED\n return self._action_detail(\"runtime stopped\", timed_out=False)\n\n async def runtime_status(self) -> str:\n self._refresh_state()\n return self._state.value\n\n def _register_core_services(self) -> None:\n if self._core_registered:\n return\n self.services.register(\"configuration\", self.configuration)\n self.services.register(\"traces\", self.traces)\n self.services.register(\"health\", self.health)\n self.services.register(\"logs\", self.logs)\n self.services.register(\"workers\", self.workers)\n self.services.register(\"control_plane\", self.control_plane)\n self._core_registered = True\n\n def _register_health_contributors(self) -> None:\n for contributor in self.registry.health_contributors:\n self.health.register(contributor)\n\n def _register_workers(self) -> None:\n if self._workers_registered:\n return\n for worker in self.registry.workers:\n self.workers.register(worker)\n self._workers_registered = True\n\n def _refresh_state(self) -> None:\n lifecycle = self.workers.lifecycle_state()\n\n if self._state == LifecycleState.STOPPING:\n if lifecycle == LifecycleState.STOPPED:\n self._started = False\n self._state = LifecycleState.STOPPED\n return\n\n if not self._started:\n if lifecycle == LifecycleState.STOPPED:\n self._state = LifecycleState.STOPPED\n return\n\n self._state = lifecycle\n\n def _wait_for_state(self, target_states: set[LifecycleState], *, timeout: float) -> bool:\n deadline = monotonic() + timeout\n while monotonic() < deadline:\n self._refresh_state()\n if self._state in target_states:\n return True\n sleep(self.ACTION_POLL_INTERVAL_SECONDS)\n self._refresh_state()\n return self._state in target_states\n\n def _action_detail(self, message: str, *, timed_out: bool) -> dict[str, object]:\n self._refresh_state()\n return {\n \"message\": message,\n \"state\": self._state.value,\n \"timed_out\": timed_out,\n \"workers\": self.workers.snapshot(),\n }", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/core/runtime.py:RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.core.runtime", - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ] - }, - "diagnostics": { - "execution": { - "executed_layers": [ - "C0_SOURCE_CHUNKS" - ], - "retrieval_mode_by_layer": { - "C0_SOURCE_CHUNKS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C0_SOURCE_CHUNKS": 200 - }, - "filters_by_layer": { - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src/app_runtime/core/runtime.py" - ], - "include_globs": [], - "exclude_globs": [], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Открой файл src/app_runtime/core/runtime.py", - "path_scope": [ - "src/app_runtime/core/runtime.py" - ], - "include_globs": [], - "exclude_globs": [], - "prefer_globs": [], - "top_k": 200, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src/app_runtime/core/runtime.py" - ], - "normalized_include_globs": [], - "normalized_exclude_globs": [], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 1, - "candidates_after_filter": 1 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "not_requested", - "resolved_symbol": null, - "alternatives": [] - }, - "layers": [ - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 1, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "symbol_resolution": 0, - "retrieval_total": 251, - "retrieval_by_layer": { - "C0_SOURCE_CHUNKS": 251 - }, - "merge_rank": 0 - } - } - }, - { - "step": "llm_answer", - "input": { - "query": "Открой файл src/app_runtime/core/runtime.py", - "rag_count": 1 - }, - "output": { - "llm_answer": "1. путь к файлу: src/app_runtime/core/runtime.py\n2. В доступных фрагментах видна начальная часть класса RuntimeManager.\n3. Top-level сущности и секции: класс RuntimeManager с методом __init__, методом _register_core_services и частично виден метод register_module.\n4. Важно для вопроса пользователя:\n- Класс RuntimeManager является основным управляющим объектом для runtime-среды.\n- В конструкторе инициализируются основные компоненты системы (ConfigurationManager, ServiceContainer, TraceService и др.).\n- Метод _register_core_services вероятно отвечает за регистрацию основных сервисов приложения.\n- Метод register_module используется для регистрации модулей приложения." - }, - "diagnostics": { - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 600, - "evidence_rows": 1, - "evidence_chars": 6265 - }, - "evidence_summary": [ - { - "layer": "C0_SOURCE_CHUNKS", - "count": 1, - "unique_paths": 1 - } - ], - "prompt_template_id": "intent_code_qa_open_file_ru_v2", - "system_prompt_version": "v1" - }, - "timings_ms": { - "prompt_build": 0, - "llm_call": 1139 - } - } - } - ] - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents/20260312_123945/full_chain_plba_code_subintents_plba-fullchain-open-file-runtime.md b/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents/20260312_123945/full_chain_plba_code_subintents_plba-fullchain-open-file-runtime.md deleted file mode 100644 index 4522ac3..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents/20260312_123945/full_chain_plba_code_subintents_plba-fullchain-open-file-runtime.md +++ /dev/null @@ -1,30 +0,0 @@ -# plba-fullchain-open-file-runtime - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_subintents.yaml -- runner: runtime -- mode: full_chain -- passed: True - -## Query -Открой файл src/app_runtime/core/runtime.py - -## Actual -{ - "intent": "CODE_QA", - "sub_intent": "OPEN_FILE", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 1, - "llm_answer": "1. путь к файлу: src/app_runtime/core/runtime.py\n2. В доступных фрагментах видна начальная часть класса RuntimeManager.\n3. Top-level сущности и секции: класс RuntimeManager с методом __init__, методом _register_core_services и частично виден метод register_module.\n4. Важно для вопроса пользователя:\n- Класс RuntimeManager является основным управляющим объектом для runtime-среды.\n- В конструкторе инициализируются основные компоненты системы (ConfigurationManager, ServiceContainer, TraceService и др.).\n- Метод _register_core_services вероятно отвечает за регистрацию основных сервисов приложения.\n- Метод register_module используется для регистрации модулей приложения.", - "answer_mode": "answered", - "path_scope": [ - "src/app_runtime/core/runtime.py" - ], - "symbol_candidates": [], - "layers": [ - "C0_SOURCE_CHUNKS" - ] -} - -## Mismatches -- none \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents/20260312_123945/full_chain_plba_code_subintents_plba-fullchain-trace-flow-runtime-manager.json b/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents/20260312_123945/full_chain_plba_code_subintents_plba-fullchain-trace-flow-runtime-manager.json deleted file mode 100644 index cb7d2d1..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents/20260312_123945/full_chain_plba_code_subintents_plba-fullchain-trace-flow-runtime-manager.json +++ /dev/null @@ -1,2964 +0,0 @@ -{ - "case_id": "plba-fullchain-trace-flow-runtime-manager", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_subintents.yaml", - "runner": "runtime", - "mode": "full_chain", - "actual": { - "intent": "CODE_QA", - "sub_intent": "TRACE_FLOW", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 23, - "llm_answer": "1. Точка старта: fastapi http app.post [C3_ENTRYPOINTS]\n2. \n\n- 2.1 fastapi http app.post → RuntimeManager.__init__ [C2_DEPENDENCY_GRAPH]\n - В этой точке начинается инициализация объекта RuntimeManager через его конструктор __init__. Конструктор принимает несколько параметров типа ConfigurationManager, ServiceContainer, TraceService, HealthRegistry, LogManager, WorkerSupervisor и ControlPlaneService. Параметры могут быть переданы извне или приняты по умолчанию при отсутствии переданных значений.\n \n Связь между шагами подтверждена напрямую в [C2_DEPENDENCY_GRAPH].\n\n- 2.2 RuntimeManager.__init__ → RuntimeManager.configuration [C2_DEPENDENCY_GRAPH]\n - Внутри конструктора вызывается атрибут конфигурации runtime_manager.configuration, который устанавливается либо передаваемым значением, либо созданным по умолчанию экземпляром ConfigurationManager.\n\n Связь между шагами подтверждена напрямую в [C2_DEPENDENCY_GRAPH].\n\n- 2.3 RuntimeManager.__init__ → RuntimeManager.services [C2_DEPENDENCY_GRAPH]\n - Далее внутри конструктора вызывается атрибут сервисов runtime_manager.services, который устанавливается либо передаваемым значением, либо созданным по умолчанию экземпляром ServiceContainer.\n\n Связь между шагами подтверждена напрямую в [C2_DEPENDENCY_GRAPH].\n\n- 2.4 RuntimeManager.__init__ → RuntimeManager.traces [C2_DEPENDENCY_GRAPH]\n - Затем вызывается атрибут трассировки runtime_manager.traces, который устанавливается либо передаваемым значением, либо созданным по умолчанию экземпляром TraceService.\n\n Связь между шагами подтверждена напрямую в [C2_DEPENDENCY_GRAPH].\n\n- 2.5 RuntimeManager.__init__ → RuntimeManager.health [C2_DEPENDENCY_GRAPH]\n - После этого вызывается атрибут состояния здоровья runtime_manager.health, который устанавливается либо передаваемым значением, либо созданным по умолчанию экземпляром HealthRegistry.\n\n Связь между шагами подтверждена напрямую в [C2_DEPENDENCY_GRAPH].\n\n- 2.6 RuntimeManager.__init__ → RuntimeManager.logs [C2_DEPENDENCY_GRAPH]\n - Далее вызывается атрибут логирования runtime_manager.logs, который устанавливается либо передаваемым значением, либо созданным по умолчанию экземпляром LogManager.\n\n Связь между шагами подтверждена напрямую в [C2_DEPENDENCY_GRAPH].\n\n- 2.7 RuntimeManager.__init__ → RuntimeManager.workers [C2_DEPENDENCY_GRAPH]\n - Следующий шаг — установка атрибута рабочих процессов runtime_manager.workers, который устанавливается либо передаваемым значением, либо созданным по умолчанию экземпляром WorkerSupervisor.\n\n Связь между шагами подтверждена напрямую в [C2_DEPENDENCY_GRAPH].\n\n- 2.8 RuntimeManager.__init__ → RuntimeManager.control_plane [C2_DEPENDENCY_GRAPH]\n - Завершающий шаг конструктора — установка атрибута управления runtime_manager.control_plane, который устанавливается либо передаваемым значением, либо созданным по умолчанию экземпляром ControlPlaneService.\n\n Связь между шагами подтверждена напрямую в [C2_DEPENDENCY_GRAPH].\n\n3. Все связи между шагами подтверждены напрямую в предоставленных слоях RAG.\n4. Поток не содержит разрывы или участки с неполными данными.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "RuntimeManager" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "passed": true, - "mismatches": [], - "details": { - "case_id": "plba-fullchain-trace-flow-runtime-manager", - "text": "Покажи поток выполнения RuntimeManager", - "mode": "full_chain", - "run_started_at": "2026-03-12T12:39:45", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Покажи поток выполнения RuntimeManager", - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "RuntimeManager", - "alternatives": [ - "RuntimeManager" - ], - "confidence": 0.99 - }, - "rag_count": 23, - "rag_rows": [ - { - "path": "src/app_runtime/core/runtime.py", - "content": "class RuntimeManager\nRuntimeManager", - "layer": "C1_SYMBOL_CATALOG", - "title": "RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "7e4a9381328c5803bbc6179458612fc4e947d928aa7bf8b4b2bebb2c8592f758", - "qname": "RuntimeManager", - "kind": "class", - "signature": "RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.core.runtime", - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests manager\n- orchestrates role-like calls (4)\n- reads and writes state attributes\n- participates in dataflow slices (50)", - "layer": "C4_SEMANTIC_ROLES", - "title": "RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 43, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "7e4a9381328c5803bbc6179458612fc4e947d928aa7bf8b4b2bebb2c8592f758", - "symbol_name": "RuntimeManager", - "qname": "RuntimeManager", - "role": "pipeline_stage", - "confidence": 0.67, - "dataflow_participation": 50, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "ControlChannel\nrole: model\n\nResponsibilities:\n- default model role", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlChannel", - "span_start": 21, - "span_end": 28, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 40, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "cfcfe9a311d3a2dbdaf32ac4ccd73c0eb9a117f830591a1c0867ee97d46204ff", - "symbol_name": "ControlChannel", - "qname": "ControlChannel", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "ControlActionSet\nrole: model\n\nResponsibilities:\n- default model role", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlActionSet", - "span_start": 14, - "span_end": 18, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 40, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "46eb026cb3313415ec47b82dd22f84f4d112c9d987e8b1716dcb0baa1cce8988", - "symbol_name": "ControlActionSet", - "qname": "ControlActionSet", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests service\n- reads and writes state attributes\n- participates in dataflow slices (5)", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlPlaneService", - "span_start": 12, - "span_end": 52, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 68, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "b13471e5916986dccffb53fab613812842965705e6b3a89ae549d30c9e91e9aa", - "symbol_name": "ControlPlaneService", - "qname": "ControlPlaneService", - "role": "pipeline_stage", - "confidence": 0.57, - "dataflow_participation": 5, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_runner.py", - "content": "UvicornThreadRunner\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (24)", - "layer": "C4_SEMANTIC_ROLES", - "title": "UvicornThreadRunner", - "span_start": 10, - "span_end": 61, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 11, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "fd55630045a02100df8877ac27d951ee08617d4598764394d48cb51fe067476a", - "symbol_name": "UvicornThreadRunner", - "qname": "UvicornThreadRunner", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 24, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "3779fdd2878b770e789a35bb2a89c9d79f13b61c26d7db1b3b683f9bb9e1623f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (10)", - "layer": "C4_SEMANTIC_ROLES", - "title": "HttpControlChannel", - "span_start": 12, - "span_end": 57, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 21, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "1c9fbdc24819e5604c26ea55428a74310f03a03e1af197ed84846af61e42fdb0", - "symbol_name": "HttpControlChannel", - "qname": "HttpControlChannel", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 10, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "HttpControlAppFactory\nrole: factory\n\nResponsibilities:\n- name suffix suggests factory", - "layer": "C4_SEMANTIC_ROLES", - "title": "HttpControlAppFactory", - "span_start": 15, - "span_end": 53, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 39, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "9b3502a5fb408b273223db13264349cf500de24915b6c649d9ea8970d0dfd8e0", - "symbol_name": "HttpControlAppFactory", - "qname": "HttpControlAppFactory", - "role": "factory", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/persistence/workflow_persistence.py", - "content": "WorkflowPersistence\nrole: pipeline_stage\n\nResponsibilities:\n- orchestrates role-like calls (2)\n- reads and writes state attributes\n- participates in dataflow slices (16)", - "layer": "C4_SEMANTIC_ROLES", - "title": "WorkflowPersistence", - "span_start": 8, - "span_end": 54, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 15, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "7bd01ee45cf31f2d5c2e3e51656254860ac785d10cef9e0852cd4fba90857bae", - "symbol_name": "WorkflowPersistence", - "qname": "WorkflowPersistence", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 16, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "80e9410ddc639789b4353c2a1a757ba8d0d5b5bb6075b0b263b61551f04ae1f0", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager.add_config_file", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 32, - "span_end": 52, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "a23b8a11ebdb12708b60c96ea12a69f7f042082f1adfddd572444e246d81d167", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "57ffbd4f0d9fdf3507c2b8624312ce211f3d02fdf86a57a8ec90778d8a7b498d", - "dst_ref": "RuntimeManager.add_config_file", - "resolution": "resolved", - "slice_id": "a23b8a11ebdb12708b60c96ea12a69f7f042082f1adfddd572444e246d81d167", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager.add_config_file" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "57ffbd4f0d9fdf3507c2b8624312ce211f3d02fdf86a57a8ec90778d8a7b498d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.services\n -> RuntimeManager.__init__", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 33, - "span_end": 39, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "d43af85989222ee6d788ce418cdcb217c7ff044cfb915e3bdbd184417dc7bd61", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "dst_ref": "RuntimeManager.__init__", - "resolution": "resolved", - "slice_id": "d43af85989222ee6d788ce418cdcb217c7ff044cfb915e3bdbd184417dc7bd61", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.services", - "RuntimeManager.__init__" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.stop", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 25, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d", - "dst_ref": "ControlPlaneService.stop", - "resolution": "resolved", - "slice_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.stop" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._stop_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 51, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a", - "dst_ref": "ControlPlaneService._stop_async", - "resolution": "resolved", - "slice_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._stop_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager.start", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 32, - "span_end": 59, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "98312ace7fc62b1c7194c5aa1732b6ef736eae1668a3a120dd1ecd5ab1d64f7a", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "77a7b260193018845e4e204df094ab89cfd7c82ee4e822b3a83ad4cd945f9cb1", - "dst_ref": "RuntimeManager.start", - "resolution": "resolved", - "slice_id": "98312ace7fc62b1c7194c5aa1732b6ef736eae1668a3a120dd1ecd5ab1d64f7a", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager.start" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "77a7b260193018845e4e204df094ab89cfd7c82ee4e822b3a83ad4cd945f9cb1" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager._register_core_services", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 32, - "span_end": 127, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "3e5811f3b511fa0cabe363f5d01f2ac5fa039bc8b93f7ee108323e1f5f45a293", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "972d6057a6caac9cf31ebc1e29c6f39f71b10d4cc170dec57cf875ba458549c6", - "dst_ref": "RuntimeManager._register_core_services", - "resolution": "resolved", - "slice_id": "3e5811f3b511fa0cabe363f5d01f2ac5fa039bc8b93f7ee108323e1f5f45a293", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager._register_core_services" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "972d6057a6caac9cf31ebc1e29c6f39f71b10d4cc170dec57cf875ba458549c6" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.register_channel", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 17, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957", - "dst_ref": "ControlPlaneService.register_channel", - "resolution": "resolved", - "slice_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.register_channel" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.start", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 20, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154", - "dst_ref": "ControlPlaneService.start", - "resolution": "resolved", - "slice_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.start" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._start_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 47, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517", - "dst_ref": "ControlPlaneService._start_async", - "resolution": "resolved", - "slice_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._start_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.services\n -> RuntimeManager._register_core_services", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 33, - "span_end": 127, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "aac6f9dda73963b977083a892bee39a48eca4fbd7404787e022ecf4ebedec65d", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "972d6057a6caac9cf31ebc1e29c6f39f71b10d4cc170dec57cf875ba458549c6", - "dst_ref": "RuntimeManager._register_core_services", - "resolution": "resolved", - "slice_id": "aac6f9dda73963b977083a892bee39a48eca4fbd7404787e022ecf4ebedec65d", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.services", - "RuntimeManager._register_core_services" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "972d6057a6caac9cf31ebc1e29c6f39f71b10d4cc170dec57cf875ba458549c6" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "class RuntimeManager:\n ACTION_TIMEOUT_SECONDS = 10.0\n ACTION_POLL_INTERVAL_SECONDS = 0.05\n\n def __init__(\n self,\n configuration: ConfigurationManager | None = None,\n services: ServiceContainer | None = None,\n traces: TraceService | None = None,\n health: HealthRegistry | None = None,\n logs: LogManager | None = None,\n workers: WorkerSupervisor | None = None,\n control_plane: ControlPlaneService | None = None,\n ) -> None:\n self.configuration = configuration or ConfigurationManager()\n self.services = services or ServiceContainer()\n self.traces = traces or TraceService()\n self.health = health or HealthRegistry()\n self.logs = logs or LogManager()\n self.workers = workers or WorkerSupervisor()\n self.control_plane = control_plane or ControlPlaneService()\n self.registry = ModuleRegistry(self.services)\n self._started = False\n self._state = LifecycleState.IDLE\n self._core_registered = False\n self._workers_registered = False\n self._register_core_services()\n\n def register_module(self, module: ApplicationModule) -> None:\n self.registry.register_module(module.name)\n module.register(self.registry)\n\n def add_config_file(self, path: str) -> FileConfigProvider:\n provider = FileConfigProvider(path)\n self.configuration.add_provider(provider)\n return provider\n\n def start(self, *, start_control_plane: bool = True) -> None:\n if self._started:\n return\n self._state = LifecycleState.STARTING\n config = self.configuration.load()\n self.logs.apply_config(config)\n self._register_health_contributors()\n self._register_workers()\n self.workers.start()\n if start_control_plane:\n self.control_plane.start(self)\n self._started = True\n self._refresh_state()\n\n def stop(self, timeout: float = 30.0, force: bool = False, stop_control_plane: bool = True) -> None:\n if not self._started:\n return\n self._state = LifecycleState.STOPPING\n self.workers.stop(timeout=timeout, force=force)\n if stop_control_plane:\n self.control_plane.stop()\n self._started = False\n self._state = LifecycleState.STOPPED\n\n def status(self) -> dict[str, object]:\n self._refresh_state()\n return self.control_plane.snapshot(self)\n\n def current_health(self) -> HealthPayload:\n self._refresh_state()\n return self.health.payload(self._state, self.workers.healths())\n\n async def health_status(self) -> HealthPayload:\n return self.current_health()\n\n async def start_runtime(self) -> dict[str, object] | str:\n self._refresh_state()\n if self._started:\n return \"runtime already running\"\n if self._state == LifecycleState.STOPPING:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n\n self.start(start_control_plane=False)\n started = self._wait_for_state({LifecycleState.IDLE, LifecycleState.BUSY}, timeout=self.ACTION_TIMEOUT_SECONDS)\n if started:\n return self._action_detail(\"runtime started\", timed_out=False)\n return self._action_detail(\"runtime start is still in progress\", timed_out=True)\n\n async def stop_runtime(self) -> dict[str, object] | str:\n self._refresh_state()\n if not self._started:\n if self._state == LifecycleState.STOPPING:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n return \"runtime already stopped\"\n\n self._state = LifecycleState.STOPPING\n try:\n self.workers.stop(timeout=self.ACTION_TIMEOUT_SECONDS, force=False)\n except TimeoutError:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n\n self._started = False\n self._state = LifecycleState.STOPPED\n return self._action_detail(\"runtime stopped\", timed_out=False)\n\n async def runtime_status(self) -> str:\n self._refresh_state()\n return self._state.value\n\n def _register_core_services(self) -> None:\n if self._core_registered:\n return\n self.services.register(\"configuration\", self.configuration)\n self.services.register(\"traces\", self.traces)\n self.services.register(\"health\", self.health)\n self.services.register(\"logs\", self.logs)\n self.services.register(\"workers\", self.workers)\n self.services.register(\"control_plane\", self.control_plane)\n self._core_registered = True\n\n def _register_health_contributors(self) -> None:\n for contributor in self.registry.health_contributors:\n self.health.register(contributor)\n\n def _register_workers(self) -> None:\n if self._workers_registered:\n return\n for worker in self.registry.workers:\n self.workers.register(worker)\n self._workers_registered = True\n\n def _refresh_state(self) -> None:\n lifecycle = self.workers.lifecycle_state()\n\n if self._state == LifecycleState.STOPPING:\n if lifecycle == LifecycleState.STOPPED:\n self._started = False\n self._state = LifecycleState.STOPPED\n return\n\n if not self._started:\n if lifecycle == LifecycleState.STOPPED:\n self._state = LifecycleState.STOPPED\n return\n\n self._state = lifecycle\n\n def _wait_for_state(self, target_states: set[LifecycleState], *, timeout: float) -> bool:\n deadline = monotonic() + timeout\n while monotonic() < deadline:\n self._refresh_state()\n if self._state in target_states:\n return True\n sleep(self.ACTION_POLL_INTERVAL_SECONDS)\n self._refresh_state()\n return self._state in target_states\n\n def _action_detail(self, message: str, *, timed_out: bool) -> dict[str, object]:\n self._refresh_state()\n return {\n \"message\": message,\n \"state\": self._state.value,\n \"timed_out\": timed_out,\n \"workers\": self.workers.snapshot(),\n }", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/core/runtime.py:RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.core.runtime", - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "llm_answer": "1. Точка старта: fastapi http app.post [C3_ENTRYPOINTS]\n2. \n\n- 2.1 fastapi http app.post → RuntimeManager.__init__ [C2_DEPENDENCY_GRAPH]\n - В этой точке начинается инициализация объекта RuntimeManager через его конструктор __init__. Конструктор принимает несколько параметров типа ConfigurationManager, ServiceContainer, TraceService, HealthRegistry, LogManager, WorkerSupervisor и ControlPlaneService. Параметры могут быть переданы извне или приняты по умолчанию при отсутствии переданных значений.\n \n Связь между шагами подтверждена напрямую в [C2_DEPENDENCY_GRAPH].\n\n- 2.2 RuntimeManager.__init__ → RuntimeManager.configuration [C2_DEPENDENCY_GRAPH]\n - Внутри конструктора вызывается атрибут конфигурации runtime_manager.configuration, который устанавливается либо передаваемым значением, либо созданным по умолчанию экземпляром ConfigurationManager.\n\n Связь между шагами подтверждена напрямую в [C2_DEPENDENCY_GRAPH].\n\n- 2.3 RuntimeManager.__init__ → RuntimeManager.services [C2_DEPENDENCY_GRAPH]\n - Далее внутри конструктора вызывается атрибут сервисов runtime_manager.services, который устанавливается либо передаваемым значением, либо созданным по умолчанию экземпляром ServiceContainer.\n\n Связь между шагами подтверждена напрямую в [C2_DEPENDENCY_GRAPH].\n\n- 2.4 RuntimeManager.__init__ → RuntimeManager.traces [C2_DEPENDENCY_GRAPH]\n - Затем вызывается атрибут трассировки runtime_manager.traces, который устанавливается либо передаваемым значением, либо созданным по умолчанию экземпляром TraceService.\n\n Связь между шагами подтверждена напрямую в [C2_DEPENDENCY_GRAPH].\n\n- 2.5 RuntimeManager.__init__ → RuntimeManager.health [C2_DEPENDENCY_GRAPH]\n - После этого вызывается атрибут состояния здоровья runtime_manager.health, который устанавливается либо передаваемым значением, либо созданным по умолчанию экземпляром HealthRegistry.\n\n Связь между шагами подтверждена напрямую в [C2_DEPENDENCY_GRAPH].\n\n- 2.6 RuntimeManager.__init__ → RuntimeManager.logs [C2_DEPENDENCY_GRAPH]\n - Далее вызывается атрибут логирования runtime_manager.logs, который устанавливается либо передаваемым значением, либо созданным по умолчанию экземпляром LogManager.\n\n Связь между шагами подтверждена напрямую в [C2_DEPENDENCY_GRAPH].\n\n- 2.7 RuntimeManager.__init__ → RuntimeManager.workers [C2_DEPENDENCY_GRAPH]\n - Следующий шаг — установка атрибута рабочих процессов runtime_manager.workers, который устанавливается либо передаваемым значением, либо созданным по умолчанию экземпляром WorkerSupervisor.\n\n Связь между шагами подтверждена напрямую в [C2_DEPENDENCY_GRAPH].\n\n- 2.8 RuntimeManager.__init__ → RuntimeManager.control_plane [C2_DEPENDENCY_GRAPH]\n - Завершающий шаг конструктора — установка атрибута управления runtime_manager.control_plane, который устанавливается либо передаваемым значением, либо созданным по умолчанию экземпляром ControlPlaneService.\n\n Связь между шагами подтверждена напрямую в [C2_DEPENDENCY_GRAPH].\n\n3. Все связи между шагами подтверждены напрямую в предоставленных слоях RAG.\n4. Поток не содержит разрывы или участки с неполными данными.", - "summary": { - "router": { - "intent": "CODE_QA", - "sub_intent": "TRACE_FLOW", - "confidence": null - }, - "retrieval": { - "profile": "code", - "layers_hit": [ - "C0_SOURCE_CHUNKS", - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS", - "C4_SEMANTIC_ROLES" - ], - "evidence_sufficient": true - }, - "llm": { - "answer_status": "answered", - "groundedness": "grounded" - } - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "TRACE_FLOW", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "RuntimeManager" - ], - "keyword_hints": [ - "RuntimeManager" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C0_SOURCE_CHUNKS": "exact_path_fetch", - "C4_SEMANTIC_ROLES": "exact_path_fetch", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C3_ENTRYPOINTS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 8, - "C4_SEMANTIC_ROLES": 8, - "C2_DEPENDENCY_GRAPH": 10, - "C3_ENTRYPOINTS": 10 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C4_SEMANTIC_ROLES": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Покажи поток выполнения RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C4_SEMANTIC_ROLES", - "query": "Покажи поток выполнения RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "Покажи поток выполнения RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 10, - "ranking_profile": "code" - }, - { - "layer": "C3_ENTRYPOINTS", - "query": "Покажи поток выполнения RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 10, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 1, - "candidates_after_filter": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 10, - "candidates_after_filter": 10 - }, - { - "layer": "C3_ENTRYPOINTS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 3, - "candidates_after_filter": 3 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "RuntimeManager", - "alternatives": [ - "RuntimeManager" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C4_SEMANTIC_ROLES", - "status": "hit", - "hit_count": 8, - "fail_reason": null - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 10, - "fail_reason": null - }, - { - "layer": "C3_ENTRYPOINTS", - "status": "hit", - "hit_count": 3, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "router": 0, - "symbol_resolution": 0, - "retrieval_total": 159, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 50, - "C0_SOURCE_CHUNKS": 22, - "C4_SEMANTIC_ROLES": 15, - "C2_DEPENDENCY_GRAPH": 56, - "C3_ENTRYPOINTS": 13 - }, - "merge_rank": 19, - "prompt_build": 0, - "llm_call": 4878 - }, - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 814, - "evidence_rows": 23, - "evidence_chars": 8302 - }, - "evidence_summary": [ - { - "layer": "C1_SYMBOL_CATALOG", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "count": 8, - "unique_paths": 7 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "count": 10, - "unique_paths": 2 - }, - { - "layer": "C3_ENTRYPOINTS", - "count": 3, - "unique_paths": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 1, - "unique_paths": 1 - } - ], - "prompt_template_id": "intent_code_qa_trace_flow_ru_v2", - "system_prompt_version": "v1" - }, - "router": { - "conversation_mode": "START", - "keyword_hints": [ - "RuntimeManager" - ], - "path_scope": [] - }, - "llm": { - "used_evidence_count": 23, - "missing_evidence_reason": null - } - }, - "run_info": { - "case_id": "plba-fullchain-trace-flow-runtime-manager", - "mode": "full_chain", - "run_started_at": "2026-03-12T12:39:45", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - }, - "input_request": { - "text": "Покажи поток выполнения RuntimeManager", - "normalized_query": "Покажи поток выполнения RuntimeManager" - }, - "steps": [ - { - "step": "intent_router", - "input": { - "query": "Покажи поток выполнения RuntimeManager" - }, - "output": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Покажи поток выполнения RuntimeManager" - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "TRACE_FLOW", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "RuntimeManager" - ], - "keyword_hints": [ - "RuntimeManager" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "timings_ms": { - "router": 0 - } - } - }, - { - "step": "retrieval", - "input": { - "query": "Покажи поток выполнения RuntimeManager" - }, - "output": { - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "RuntimeManager", - "alternatives": [ - "RuntimeManager" - ], - "confidence": 0.99 - }, - "rag_count": 23, - "rag_rows": [ - { - "path": "src/app_runtime/core/runtime.py", - "content": "class RuntimeManager\nRuntimeManager", - "layer": "C1_SYMBOL_CATALOG", - "title": "RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "7e4a9381328c5803bbc6179458612fc4e947d928aa7bf8b4b2bebb2c8592f758", - "qname": "RuntimeManager", - "kind": "class", - "signature": "RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.core.runtime", - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests manager\n- orchestrates role-like calls (4)\n- reads and writes state attributes\n- participates in dataflow slices (50)", - "layer": "C4_SEMANTIC_ROLES", - "title": "RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 43, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "7e4a9381328c5803bbc6179458612fc4e947d928aa7bf8b4b2bebb2c8592f758", - "symbol_name": "RuntimeManager", - "qname": "RuntimeManager", - "role": "pipeline_stage", - "confidence": 0.67, - "dataflow_participation": 50, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "ControlChannel\nrole: model\n\nResponsibilities:\n- default model role", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlChannel", - "span_start": 21, - "span_end": 28, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 40, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "cfcfe9a311d3a2dbdaf32ac4ccd73c0eb9a117f830591a1c0867ee97d46204ff", - "symbol_name": "ControlChannel", - "qname": "ControlChannel", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "ControlActionSet\nrole: model\n\nResponsibilities:\n- default model role", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlActionSet", - "span_start": 14, - "span_end": 18, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 40, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "46eb026cb3313415ec47b82dd22f84f4d112c9d987e8b1716dcb0baa1cce8988", - "symbol_name": "ControlActionSet", - "qname": "ControlActionSet", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests service\n- reads and writes state attributes\n- participates in dataflow slices (5)", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlPlaneService", - "span_start": 12, - "span_end": 52, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 68, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "b13471e5916986dccffb53fab613812842965705e6b3a89ae549d30c9e91e9aa", - "symbol_name": "ControlPlaneService", - "qname": "ControlPlaneService", - "role": "pipeline_stage", - "confidence": 0.57, - "dataflow_participation": 5, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_runner.py", - "content": "UvicornThreadRunner\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (24)", - "layer": "C4_SEMANTIC_ROLES", - "title": "UvicornThreadRunner", - "span_start": 10, - "span_end": 61, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 11, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "fd55630045a02100df8877ac27d951ee08617d4598764394d48cb51fe067476a", - "symbol_name": "UvicornThreadRunner", - "qname": "UvicornThreadRunner", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 24, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "3779fdd2878b770e789a35bb2a89c9d79f13b61c26d7db1b3b683f9bb9e1623f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (10)", - "layer": "C4_SEMANTIC_ROLES", - "title": "HttpControlChannel", - "span_start": 12, - "span_end": 57, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 21, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "1c9fbdc24819e5604c26ea55428a74310f03a03e1af197ed84846af61e42fdb0", - "symbol_name": "HttpControlChannel", - "qname": "HttpControlChannel", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 10, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "HttpControlAppFactory\nrole: factory\n\nResponsibilities:\n- name suffix suggests factory", - "layer": "C4_SEMANTIC_ROLES", - "title": "HttpControlAppFactory", - "span_start": 15, - "span_end": 53, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 39, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "9b3502a5fb408b273223db13264349cf500de24915b6c649d9ea8970d0dfd8e0", - "symbol_name": "HttpControlAppFactory", - "qname": "HttpControlAppFactory", - "role": "factory", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/persistence/workflow_persistence.py", - "content": "WorkflowPersistence\nrole: pipeline_stage\n\nResponsibilities:\n- orchestrates role-like calls (2)\n- reads and writes state attributes\n- participates in dataflow slices (16)", - "layer": "C4_SEMANTIC_ROLES", - "title": "WorkflowPersistence", - "span_start": 8, - "span_end": 54, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 15, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "7bd01ee45cf31f2d5c2e3e51656254860ac785d10cef9e0852cd4fba90857bae", - "symbol_name": "WorkflowPersistence", - "qname": "WorkflowPersistence", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 16, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "80e9410ddc639789b4353c2a1a757ba8d0d5b5bb6075b0b263b61551f04ae1f0", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager.add_config_file", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 32, - "span_end": 52, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "a23b8a11ebdb12708b60c96ea12a69f7f042082f1adfddd572444e246d81d167", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "57ffbd4f0d9fdf3507c2b8624312ce211f3d02fdf86a57a8ec90778d8a7b498d", - "dst_ref": "RuntimeManager.add_config_file", - "resolution": "resolved", - "slice_id": "a23b8a11ebdb12708b60c96ea12a69f7f042082f1adfddd572444e246d81d167", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager.add_config_file" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "57ffbd4f0d9fdf3507c2b8624312ce211f3d02fdf86a57a8ec90778d8a7b498d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.services\n -> RuntimeManager.__init__", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 33, - "span_end": 39, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "d43af85989222ee6d788ce418cdcb217c7ff044cfb915e3bdbd184417dc7bd61", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "dst_ref": "RuntimeManager.__init__", - "resolution": "resolved", - "slice_id": "d43af85989222ee6d788ce418cdcb217c7ff044cfb915e3bdbd184417dc7bd61", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.services", - "RuntimeManager.__init__" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.stop", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 25, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d", - "dst_ref": "ControlPlaneService.stop", - "resolution": "resolved", - "slice_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.stop" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._stop_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 51, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a", - "dst_ref": "ControlPlaneService._stop_async", - "resolution": "resolved", - "slice_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._stop_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager.start", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 32, - "span_end": 59, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "98312ace7fc62b1c7194c5aa1732b6ef736eae1668a3a120dd1ecd5ab1d64f7a", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "77a7b260193018845e4e204df094ab89cfd7c82ee4e822b3a83ad4cd945f9cb1", - "dst_ref": "RuntimeManager.start", - "resolution": "resolved", - "slice_id": "98312ace7fc62b1c7194c5aa1732b6ef736eae1668a3a120dd1ecd5ab1d64f7a", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager.start" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "77a7b260193018845e4e204df094ab89cfd7c82ee4e822b3a83ad4cd945f9cb1" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager._register_core_services", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 32, - "span_end": 127, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "3e5811f3b511fa0cabe363f5d01f2ac5fa039bc8b93f7ee108323e1f5f45a293", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "972d6057a6caac9cf31ebc1e29c6f39f71b10d4cc170dec57cf875ba458549c6", - "dst_ref": "RuntimeManager._register_core_services", - "resolution": "resolved", - "slice_id": "3e5811f3b511fa0cabe363f5d01f2ac5fa039bc8b93f7ee108323e1f5f45a293", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager._register_core_services" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "972d6057a6caac9cf31ebc1e29c6f39f71b10d4cc170dec57cf875ba458549c6" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.register_channel", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 17, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957", - "dst_ref": "ControlPlaneService.register_channel", - "resolution": "resolved", - "slice_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.register_channel" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.start", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 20, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154", - "dst_ref": "ControlPlaneService.start", - "resolution": "resolved", - "slice_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.start" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._start_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 47, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517", - "dst_ref": "ControlPlaneService._start_async", - "resolution": "resolved", - "slice_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._start_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.services\n -> RuntimeManager._register_core_services", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 33, - "span_end": 127, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "aac6f9dda73963b977083a892bee39a48eca4fbd7404787e022ecf4ebedec65d", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "972d6057a6caac9cf31ebc1e29c6f39f71b10d4cc170dec57cf875ba458549c6", - "dst_ref": "RuntimeManager._register_core_services", - "resolution": "resolved", - "slice_id": "aac6f9dda73963b977083a892bee39a48eca4fbd7404787e022ecf4ebedec65d", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.services", - "RuntimeManager._register_core_services" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "972d6057a6caac9cf31ebc1e29c6f39f71b10d4cc170dec57cf875ba458549c6" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "class RuntimeManager:\n ACTION_TIMEOUT_SECONDS = 10.0\n ACTION_POLL_INTERVAL_SECONDS = 0.05\n\n def __init__(\n self,\n configuration: ConfigurationManager | None = None,\n services: ServiceContainer | None = None,\n traces: TraceService | None = None,\n health: HealthRegistry | None = None,\n logs: LogManager | None = None,\n workers: WorkerSupervisor | None = None,\n control_plane: ControlPlaneService | None = None,\n ) -> None:\n self.configuration = configuration or ConfigurationManager()\n self.services = services or ServiceContainer()\n self.traces = traces or TraceService()\n self.health = health or HealthRegistry()\n self.logs = logs or LogManager()\n self.workers = workers or WorkerSupervisor()\n self.control_plane = control_plane or ControlPlaneService()\n self.registry = ModuleRegistry(self.services)\n self._started = False\n self._state = LifecycleState.IDLE\n self._core_registered = False\n self._workers_registered = False\n self._register_core_services()\n\n def register_module(self, module: ApplicationModule) -> None:\n self.registry.register_module(module.name)\n module.register(self.registry)\n\n def add_config_file(self, path: str) -> FileConfigProvider:\n provider = FileConfigProvider(path)\n self.configuration.add_provider(provider)\n return provider\n\n def start(self, *, start_control_plane: bool = True) -> None:\n if self._started:\n return\n self._state = LifecycleState.STARTING\n config = self.configuration.load()\n self.logs.apply_config(config)\n self._register_health_contributors()\n self._register_workers()\n self.workers.start()\n if start_control_plane:\n self.control_plane.start(self)\n self._started = True\n self._refresh_state()\n\n def stop(self, timeout: float = 30.0, force: bool = False, stop_control_plane: bool = True) -> None:\n if not self._started:\n return\n self._state = LifecycleState.STOPPING\n self.workers.stop(timeout=timeout, force=force)\n if stop_control_plane:\n self.control_plane.stop()\n self._started = False\n self._state = LifecycleState.STOPPED\n\n def status(self) -> dict[str, object]:\n self._refresh_state()\n return self.control_plane.snapshot(self)\n\n def current_health(self) -> HealthPayload:\n self._refresh_state()\n return self.health.payload(self._state, self.workers.healths())\n\n async def health_status(self) -> HealthPayload:\n return self.current_health()\n\n async def start_runtime(self) -> dict[str, object] | str:\n self._refresh_state()\n if self._started:\n return \"runtime already running\"\n if self._state == LifecycleState.STOPPING:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n\n self.start(start_control_plane=False)\n started = self._wait_for_state({LifecycleState.IDLE, LifecycleState.BUSY}, timeout=self.ACTION_TIMEOUT_SECONDS)\n if started:\n return self._action_detail(\"runtime started\", timed_out=False)\n return self._action_detail(\"runtime start is still in progress\", timed_out=True)\n\n async def stop_runtime(self) -> dict[str, object] | str:\n self._refresh_state()\n if not self._started:\n if self._state == LifecycleState.STOPPING:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n return \"runtime already stopped\"\n\n self._state = LifecycleState.STOPPING\n try:\n self.workers.stop(timeout=self.ACTION_TIMEOUT_SECONDS, force=False)\n except TimeoutError:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n\n self._started = False\n self._state = LifecycleState.STOPPED\n return self._action_detail(\"runtime stopped\", timed_out=False)\n\n async def runtime_status(self) -> str:\n self._refresh_state()\n return self._state.value\n\n def _register_core_services(self) -> None:\n if self._core_registered:\n return\n self.services.register(\"configuration\", self.configuration)\n self.services.register(\"traces\", self.traces)\n self.services.register(\"health\", self.health)\n self.services.register(\"logs\", self.logs)\n self.services.register(\"workers\", self.workers)\n self.services.register(\"control_plane\", self.control_plane)\n self._core_registered = True\n\n def _register_health_contributors(self) -> None:\n for contributor in self.registry.health_contributors:\n self.health.register(contributor)\n\n def _register_workers(self) -> None:\n if self._workers_registered:\n return\n for worker in self.registry.workers:\n self.workers.register(worker)\n self._workers_registered = True\n\n def _refresh_state(self) -> None:\n lifecycle = self.workers.lifecycle_state()\n\n if self._state == LifecycleState.STOPPING:\n if lifecycle == LifecycleState.STOPPED:\n self._started = False\n self._state = LifecycleState.STOPPED\n return\n\n if not self._started:\n if lifecycle == LifecycleState.STOPPED:\n self._state = LifecycleState.STOPPED\n return\n\n self._state = lifecycle\n\n def _wait_for_state(self, target_states: set[LifecycleState], *, timeout: float) -> bool:\n deadline = monotonic() + timeout\n while monotonic() < deadline:\n self._refresh_state()\n if self._state in target_states:\n return True\n sleep(self.ACTION_POLL_INTERVAL_SECONDS)\n self._refresh_state()\n return self._state in target_states\n\n def _action_detail(self, message: str, *, timed_out: bool) -> dict[str, object]:\n self._refresh_state()\n return {\n \"message\": message,\n \"state\": self._state.value,\n \"timed_out\": timed_out,\n \"workers\": self.workers.snapshot(),\n }", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/core/runtime.py:RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.core.runtime", - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ] - }, - "diagnostics": { - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C0_SOURCE_CHUNKS": "exact_path_fetch", - "C4_SEMANTIC_ROLES": "exact_path_fetch", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C3_ENTRYPOINTS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 8, - "C4_SEMANTIC_ROLES": 8, - "C2_DEPENDENCY_GRAPH": 10, - "C3_ENTRYPOINTS": 10 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C4_SEMANTIC_ROLES": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Покажи поток выполнения RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C4_SEMANTIC_ROLES", - "query": "Покажи поток выполнения RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "Покажи поток выполнения RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 10, - "ranking_profile": "code" - }, - { - "layer": "C3_ENTRYPOINTS", - "query": "Покажи поток выполнения RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 10, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 1, - "candidates_after_filter": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 10, - "candidates_after_filter": 10 - }, - { - "layer": "C3_ENTRYPOINTS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 3, - "candidates_after_filter": 3 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "RuntimeManager", - "alternatives": [ - "RuntimeManager" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C4_SEMANTIC_ROLES", - "status": "hit", - "hit_count": 8, - "fail_reason": null - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 10, - "fail_reason": null - }, - { - "layer": "C3_ENTRYPOINTS", - "status": "hit", - "hit_count": 3, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "symbol_resolution": 0, - "retrieval_total": 159, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 50, - "C0_SOURCE_CHUNKS": 22, - "C4_SEMANTIC_ROLES": 15, - "C2_DEPENDENCY_GRAPH": 56, - "C3_ENTRYPOINTS": 13 - }, - "merge_rank": 19 - } - } - }, - { - "step": "llm_answer", - "input": { - "query": "Покажи поток выполнения RuntimeManager", - "rag_count": 23 - }, - "output": { - "llm_answer": "1. Точка старта: fastapi http app.post [C3_ENTRYPOINTS]\n2. \n\n- 2.1 fastapi http app.post → RuntimeManager.__init__ [C2_DEPENDENCY_GRAPH]\n - В этой точке начинается инициализация объекта RuntimeManager через его конструктор __init__. Конструктор принимает несколько параметров типа ConfigurationManager, ServiceContainer, TraceService, HealthRegistry, LogManager, WorkerSupervisor и ControlPlaneService. Параметры могут быть переданы извне или приняты по умолчанию при отсутствии переданных значений.\n \n Связь между шагами подтверждена напрямую в [C2_DEPENDENCY_GRAPH].\n\n- 2.2 RuntimeManager.__init__ → RuntimeManager.configuration [C2_DEPENDENCY_GRAPH]\n - Внутри конструктора вызывается атрибут конфигурации runtime_manager.configuration, который устанавливается либо передаваемым значением, либо созданным по умолчанию экземпляром ConfigurationManager.\n\n Связь между шагами подтверждена напрямую в [C2_DEPENDENCY_GRAPH].\n\n- 2.3 RuntimeManager.__init__ → RuntimeManager.services [C2_DEPENDENCY_GRAPH]\n - Далее внутри конструктора вызывается атрибут сервисов runtime_manager.services, который устанавливается либо передаваемым значением, либо созданным по умолчанию экземпляром ServiceContainer.\n\n Связь между шагами подтверждена напрямую в [C2_DEPENDENCY_GRAPH].\n\n- 2.4 RuntimeManager.__init__ → RuntimeManager.traces [C2_DEPENDENCY_GRAPH]\n - Затем вызывается атрибут трассировки runtime_manager.traces, который устанавливается либо передаваемым значением, либо созданным по умолчанию экземпляром TraceService.\n\n Связь между шагами подтверждена напрямую в [C2_DEPENDENCY_GRAPH].\n\n- 2.5 RuntimeManager.__init__ → RuntimeManager.health [C2_DEPENDENCY_GRAPH]\n - После этого вызывается атрибут состояния здоровья runtime_manager.health, который устанавливается либо передаваемым значением, либо созданным по умолчанию экземпляром HealthRegistry.\n\n Связь между шагами подтверждена напрямую в [C2_DEPENDENCY_GRAPH].\n\n- 2.6 RuntimeManager.__init__ → RuntimeManager.logs [C2_DEPENDENCY_GRAPH]\n - Далее вызывается атрибут логирования runtime_manager.logs, который устанавливается либо передаваемым значением, либо созданным по умолчанию экземпляром LogManager.\n\n Связь между шагами подтверждена напрямую в [C2_DEPENDENCY_GRAPH].\n\n- 2.7 RuntimeManager.__init__ → RuntimeManager.workers [C2_DEPENDENCY_GRAPH]\n - Следующий шаг — установка атрибута рабочих процессов runtime_manager.workers, который устанавливается либо передаваемым значением, либо созданным по умолчанию экземпляром WorkerSupervisor.\n\n Связь между шагами подтверждена напрямую в [C2_DEPENDENCY_GRAPH].\n\n- 2.8 RuntimeManager.__init__ → RuntimeManager.control_plane [C2_DEPENDENCY_GRAPH]\n - Завершающий шаг конструктора — установка атрибута управления runtime_manager.control_plane, который устанавливается либо передаваемым значением, либо созданным по умолчанию экземпляром ControlPlaneService.\n\n Связь между шагами подтверждена напрямую в [C2_DEPENDENCY_GRAPH].\n\n3. Все связи между шагами подтверждены напрямую в предоставленных слоях RAG.\n4. Поток не содержит разрывы или участки с неполными данными." - }, - "diagnostics": { - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 814, - "evidence_rows": 23, - "evidence_chars": 8302 - }, - "evidence_summary": [ - { - "layer": "C1_SYMBOL_CATALOG", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "count": 8, - "unique_paths": 7 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "count": 10, - "unique_paths": 2 - }, - { - "layer": "C3_ENTRYPOINTS", - "count": 3, - "unique_paths": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 1, - "unique_paths": 1 - } - ], - "prompt_template_id": "intent_code_qa_trace_flow_ru_v2", - "system_prompt_version": "v1" - }, - "timings_ms": { - "prompt_build": 0, - "llm_call": 4878 - } - } - } - ] - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents/20260312_123945/full_chain_plba_code_subintents_plba-fullchain-trace-flow-runtime-manager.md b/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents/20260312_123945/full_chain_plba_code_subintents_plba-fullchain-trace-flow-runtime-manager.md deleted file mode 100644 index 963eeb8..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents/20260312_123945/full_chain_plba_code_subintents_plba-fullchain-trace-flow-runtime-manager.md +++ /dev/null @@ -1,34 +0,0 @@ -# plba-fullchain-trace-flow-runtime-manager - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_subintents.yaml -- runner: runtime -- mode: full_chain -- passed: True - -## Query -Покажи поток выполнения RuntimeManager - -## Actual -{ - "intent": "CODE_QA", - "sub_intent": "TRACE_FLOW", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 23, - "llm_answer": "1. Точка старта: fastapi http app.post [C3_ENTRYPOINTS]\n2. \n\n- 2.1 fastapi http app.post → RuntimeManager.__init__ [C2_DEPENDENCY_GRAPH]\n - В этой точке начинается инициализация объекта RuntimeManager через его конструктор __init__. Конструктор принимает несколько параметров типа ConfigurationManager, ServiceContainer, TraceService, HealthRegistry, LogManager, WorkerSupervisor и ControlPlaneService. Параметры могут быть переданы извне или приняты по умолчанию при отсутствии переданных значений.\n \n Связь между шагами подтверждена напрямую в [C2_DEPENDENCY_GRAPH].\n\n- 2.2 RuntimeManager.__init__ → RuntimeManager.configuration [C2_DEPENDENCY_GRAPH]\n - Внутри конструктора вызывается атрибут конфигурации runtime_manager.configuration, который устанавливается либо передаваемым значением, либо созданным по умолчанию экземпляром ConfigurationManager.\n\n Связь между шагами подтверждена напрямую в [C2_DEPENDENCY_GRAPH].\n\n- 2.3 RuntimeManager.__init__ → RuntimeManager.services [C2_DEPENDENCY_GRAPH]\n - Далее внутри конструктора вызывается атрибут сервисов runtime_manager.services, который устанавливается либо передаваемым значением, либо созданным по умолчанию экземпляром ServiceContainer.\n\n Связь между шагами подтверждена напрямую в [C2_DEPENDENCY_GRAPH].\n\n- 2.4 RuntimeManager.__init__ → RuntimeManager.traces [C2_DEPENDENCY_GRAPH]\n - Затем вызывается атрибут трассировки runtime_manager.traces, который устанавливается либо передаваемым значением, либо созданным по умолчанию экземпляром TraceService.\n\n Связь между шагами подтверждена напрямую в [C2_DEPENDENCY_GRAPH].\n\n- 2.5 RuntimeManager.__init__ → RuntimeManager.health [C2_DEPENDENCY_GRAPH]\n - После этого вызывается атрибут состояния здоровья runtime_manager.health, который устанавливается либо передаваемым значением, либо созданным по умолчанию экземпляром HealthRegistry.\n\n Связь между шагами подтверждена напрямую в [C2_DEPENDENCY_GRAPH].\n\n- 2.6 RuntimeManager.__init__ → RuntimeManager.logs [C2_DEPENDENCY_GRAPH]\n - Далее вызывается атрибут логирования runtime_manager.logs, который устанавливается либо передаваемым значением, либо созданным по умолчанию экземпляром LogManager.\n\n Связь между шагами подтверждена напрямую в [C2_DEPENDENCY_GRAPH].\n\n- 2.7 RuntimeManager.__init__ → RuntimeManager.workers [C2_DEPENDENCY_GRAPH]\n - Следующий шаг — установка атрибута рабочих процессов runtime_manager.workers, который устанавливается либо передаваемым значением, либо созданным по умолчанию экземпляром WorkerSupervisor.\n\n Связь между шагами подтверждена напрямую в [C2_DEPENDENCY_GRAPH].\n\n- 2.8 RuntimeManager.__init__ → RuntimeManager.control_plane [C2_DEPENDENCY_GRAPH]\n - Завершающий шаг конструктора — установка атрибута управления runtime_manager.control_plane, который устанавливается либо передаваемым значением, либо созданным по умолчанию экземпляром ControlPlaneService.\n\n Связь между шагами подтверждена напрямую в [C2_DEPENDENCY_GRAPH].\n\n3. Все связи между шагами подтверждены напрямую в предоставленных слоях RAG.\n4. Поток не содержит разрывы или участки с неполными данными.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "RuntimeManager" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] -} - -## Mismatches -- none \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents/20260312_123945/summary.md b/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents/20260312_123945/summary.md deleted file mode 100644 index b19d874..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents/20260312_123945/summary.md +++ /dev/null @@ -1,36 +0,0 @@ -# pipeline_setup_v2 summary - -Passed: 7/7 - -| File | Case | Query | Expected sub-intent | Intent | Actual sub-intent | RAG layers | Pass | -|------|------|-------|---------------------|--------|-------------------|------------|------| -| full_chain_plba_code_subintents.yaml | plba-fullchain-open-file-runtime | Открой файл src/app_runtime/core/runtime.py | OPEN_FILE | CODE_QA | OPEN_FILE | C0_SOURCE_CHUNKS:1 | ✓ | -| full_chain_plba_code_subintents.yaml | plba-fullchain-explain-runtime-manager | Объясни как работает класс RuntimeManager | EXPLAIN | CODE_QA | EXPLAIN | C0_SOURCE_CHUNKS:1, C1_SYMBOL_CATALOG:1, C2_DEPENDENCY_GRAPH:6, C3_ENTRYPOINTS:3, C4_SEMANTIC_ROLES:1 | ✓ | -| full_chain_plba_code_subintents.yaml | plba-fullchain-find-tests-runtime-manager | Где тесты для RuntimeManager? | FIND_TESTS | CODE_QA | FIND_TESTS | C0_SOURCE_CHUNKS:10, C2_DEPENDENCY_GRAPH:6 | ✓ | -| full_chain_plba_code_subintents.yaml | plba-fullchain-find-entrypoints | Найди точки входа в коде | FIND_ENTRYPOINTS | CODE_QA | FIND_ENTRYPOINTS | C0_SOURCE_CHUNKS:6, C3_ENTRYPOINTS:3 | ✓ | -| full_chain_plba_code_subintents.yaml | plba-fullchain-trace-flow-runtime-manager | Покажи поток выполнения RuntimeManager | TRACE_FLOW | CODE_QA | TRACE_FLOW | C0_SOURCE_CHUNKS:1, C1_SYMBOL_CATALOG:1, C2_DEPENDENCY_GRAPH:10, C3_ENTRYPOINTS:3, C4_SEMANTIC_ROLES:8 | ✓ | -| full_chain_plba_code_subintents.yaml | plba-fullchain-architecture-control-plane | Какие компоненты участвуют в RuntimeManager? | ARCHITECTURE | CODE_QA | ARCHITECTURE | C0_SOURCE_CHUNKS:1, C1_SYMBOL_CATALOG:1, C2_DEPENDENCY_GRAPH:8, C3_ENTRYPOINTS:3, C4_SEMANTIC_ROLES:12 | ✓ | -| full_chain_plba_code_subintents.yaml | plba-fullchain-explain-local-runtime-manager | Почему в файле src/app_runtime/core/runtime.py класс RuntimeManager устроен так? | EXPLAIN_LOCAL | CODE_QA | EXPLAIN_LOCAL | C0_SOURCE_CHUNKS:1, C1_SYMBOL_CATALOG:1, C2_DEPENDENCY_GRAPH:4 | ✓ | - -## LLM Answers -- **plba-fullchain-open-file-runtime** - Query: Открой файл src/app_runtime/core/runtime.py - > 1. путь к файлу: src/app\_runtime/core/runtime.py 2. В доступных фрагментах видна начальная часть класса RuntimeManager. 3. Top\-level сущности и секции: класс RuntimeManager с методом \_\_init\_\_, методом \_register\_core\_services и частично виден метод register\_module. 4. Важно для вопроса пользователя: \- Класс RuntimeManager является основным управляющим объектом для runtime\-среды. \- В конструкторе инициализируются основные компоненты системы \(ConfigurationManager, ServiceContainer, TraceService и др.\). \- Метод \_register\_core\_services вероятно отвечает за регистрацию основных сервисов приложения. \- Метод register\_module используется для регистрации модулей приложения. -- **plba-fullchain-explain-runtime-manager** - Query: Объясни как работает класс RuntimeManager - > 1. Что это и где определено. Сущность \`RuntimeManager\` объявлена в файле \`src/app\_runtime/core/runtime.py\`. 2. Назначение по наблюдаемому коду. Класс предназначен для управления жизненным циклом приложения и координации работы различных компонентов системы. Судя по документации и контекстным подсказкам, он играет роль менеджера, отвечающего за инициализацию и управление сервисами, регистрацией модулей и отслеживанием состояния системы. 3. Подтверждённые зависимости или взаимодействия. \`RuntimeManager\` зависит от следующих сущностей: \- \`ConfigurationManager\` \- \`ServiceContainer\` \- \`TraceService\` \- \`HealthRegistry\` \- \`LogManager\` \- \`WorkerSupervisor\` \- \`ControlPlaneService\` \- \`ApplicationModule\` Эти зависимости передаются конструктору класса при его создании. 4. Что делает по шагам, если это видно в контексте. При инициализации объекта класса происходит следующее: \- Пр… -- **plba-fullchain-find-tests-runtime-manager** - Query: Где тесты для RuntimeManager? - > 1. Прямые тесты: \- tests/test\_runtime.py \| test\_runtime\_runs\_worker\_routine\_and\_exposes\_status \- Проверка: RuntimeManager запускает worker routine и правильно выставляет статус. \- tests/test\_runtime.py \| test\_runtime\_graceful\_stop\_waits\_until\_worker\_finishes \- Проверка: RuntimeManager корректно завершает работу после graceful stop. 2. Косвенные или ближайшие тесты: \- tests/test\_business\_control\_actions.py \| \_build\_runtime \- Проверка: косвенно подтверждает создание экземпляра RuntimeManager в бизнес\-контроллерах. \- tests/test\_business\_control\_actions.py \| test\_worker\_wakes\_up\_with\_configured\_interval \- Проверка: косвенно подтверждает использование RuntimeManager при настройке интервалов выполнения задач. 3. Пробелы покрытия: \- Не найдены явные тесты, которые покрывают все возможные сценарии использования RuntimeManager, такие как регистрация нескольких модулей, обрабо… -- **plba-fullchain-find-entrypoints** - Query: Найди точки входа в коде - > \*\*Подтверждённые точки входа:\*\* 1. \*\*src/app\_runtime/control/http\_app.py \| app.post\*\* \- fastapi http app.post \- Признак: декоратор FastAPI \`app.post\`, явно указывает на точку старта HTTP\-запроса. 2. \*\*src/app\_runtime/control/http\_app.py \| app.get\*\* \- fastapi http app.get \- Признак: декоратор FastAPI \`app.get\`, явно указывает на точку старта HTTP\-запроса. \*\*Возможные кандидаты:\*\* В предоставленном контексте нет дополнительных сущностей или файлов, которые могли бы считаться возможными кандидатами на роль точек входа. -- **plba-fullchain-trace-flow-runtime-manager** - Query: Покажи поток выполнения RuntimeManager - > 1. Точка старта: fastapi http app.post \[C3\_ENTRYPOINTS\] 2. \- 2.1 fastapi http app.post → RuntimeManager.\_\_init\_\_ \[C2\_DEPENDENCY\_GRAPH\] \- В этой точке начинается инициализация объекта RuntimeManager через его конструктор \_\_init\_\_. Конструктор принимает несколько параметров типа ConfigurationManager, ServiceContainer, TraceService, HealthRegistry, LogManager, WorkerSupervisor и ControlPlaneService. Параметры могут быть переданы извне или приняты по умолчанию при отсутствии переданных значений. Связь между шагами подтверждена напрямую в \[C2\_DEPENDENCY\_GRAPH\]. \- 2.2 RuntimeManager.\_\_init\_\_ → RuntimeManager.configuration \[C2\_DEPENDENCY\_GRAPH\] \- Внутри конструктора вызывается атрибут конфигурации runtime\_manager.configuration, который устанавливается либо передаваемым значением, либо созданным по умолчанию экземпляром ConfigurationManager. Связь между шагами подтверждена н… -- **plba-fullchain-architecture-control-plane** - Query: Какие компоненты участвуют в RuntimeManager? - > 1. \*\*Компоненты, которые подтверждены контекстом\*\*: \- RuntimeManager \- ControlActionSet \- ControlPlaneService 2. \*\*Подтверждённые связи между ними\*\*: \- RuntimeManager вызывает метод \`start\` для инициализации. \- ControlPlaneService инициализирует каналы данных через метод \`\_channels\`. \- ControlPlaneService запускает асинхронную обработку через метод \`\_start\_async\`. 3. \*\*Границы ответственности, если они реально видны в коде\*\*: \- RuntimeManager отвечает за управление жизненным циклом системы, включая чтение и запись состояния атрибутов. \- ControlActionSet выполняет роль модели и предоставляет базовые функции поведения. \- ControlPlaneService управляет сервисами канала данных и их асинхронной обработкой. 4. \*\*Что остаётся неизвестным или неполным\*\*: \- Детали реализации взаимодействия между ControlActionSet и RuntimeManager остаются неясными. \- Полная структура данных пот… -- **plba-fullchain-explain-local-runtime-manager** - Query: Почему в файле src/app_runtime/core/runtime.py класс RuntimeManager устроен так? - > Класс \`RuntimeManager\` управляет инициализацией и запуском различных компонентов приложения во время выполнения \(runtime\). \#\#\# Что делает данный класс: \- Инициализирует основные компоненты системы \(\`configuration\`, \`services\`, \`traces\`, \`health\`, \`logs\`, \`workers\`, \`control\_plane\`\) с возможностью передачи пользовательских значений через параметры конструктора. Если значения не переданы, используются дефолтные экземпляры соответствующих классов. \- Содержит переменные состояния для отслеживания фазы жизненного цикла приложения: \- \`\_started\`: флаг, указывающий, запущен ли runtime. \- \`\_state\`: текущее состояние жизненного цикла \(\`IDLE\`, \`RUNNING\`, etc.\). \- \`\_core\_registered\`: регистрированы ли базовые сервисы. \- \`\_workers\_registered\`: зарегистрированы ли рабочие задачи. \- Вызывает приватную функцию \`\_register\_core\_services\(\)\` сразу после создания объекта, чтобы зарегистр… \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_125536/full_chain_plba_code_subintents_v2_plba-v2-architecture-control-plane.json b/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_125536/full_chain_plba_code_subintents_v2_plba-v2-architecture-control-plane.json deleted file mode 100644 index be874e5..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_125536/full_chain_plba_code_subintents_v2_plba-v2-architecture-control-plane.json +++ /dev/null @@ -1,2940 +0,0 @@ -{ - "case_id": "plba-v2-architecture-control-plane", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_subintents_v2.yaml", - "runner": "runtime", - "mode": "full_chain", - "actual": { - "intent": "CODE_QA", - "sub_intent": "ARCHITECTURE", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 25, - "llm_answer": "1. **Компоненты, которые подтверждены контекстом**:\n - ControlPlaneService\n - ControlActionSet\n\n2. **Подтверждённые связи между ними**:\n - ControlPlaneService зависит от ControlActionSet через регистрацию каналов (_channels):\n ```\n ControlPlaneService.__init__ -> ControlPlaneService._channels -> ControlPlaneService.register_channel(ControlActionSet)\n ```\n\n3. **Границы ответственности, если они реально видны в коде**:\n - ControlPlaneService отвечает за инициализацию и управление каналами данных, регистрируя экземпляры ControlActionSet для работы с данными потока.\n \n4. **Что остаётся неизвестным или неполным**:\n - Детали реализации метода `register_channel` и его взаимодействия с другими компонентами системы остаются неясными на основании предоставленного контекста.\n - Неизвестно точно, какие именно каналы и действия регистрируются и используются внутри `ControlPlaneService`.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "ControlPlaneService" - ], - "layers": [ - "C4_SEMANTIC_ROLES", - "C3_ENTRYPOINTS", - "C2_DEPENDENCY_GRAPH", - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS" - ] - }, - "passed": true, - "mismatches": [], - "details": { - "case_id": "plba-v2-architecture-control-plane", - "text": "Какие компоненты участвуют в ControlPlaneService?", - "mode": "full_chain", - "run_started_at": "2026-03-12T12:55:37", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Какие компоненты участвуют в ControlPlaneService?", - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "ControlPlaneService", - "alternatives": [ - "ControlPlaneService" - ], - "confidence": 0.99 - }, - "rag_count": 25, - "rag_rows": [ - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests service\n- reads and writes state attributes\n- participates in dataflow slices (5)", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlPlaneService", - "span_start": 12, - "span_end": 52, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 68, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "b13471e5916986dccffb53fab613812842965705e6b3a89ae549d30c9e91e9aa", - "symbol_name": "ControlPlaneService", - "qname": "ControlPlaneService", - "role": "pipeline_stage", - "confidence": 0.57, - "dataflow_participation": 5, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "ControlActionSet\nrole: model\n\nResponsibilities:\n- default model role", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlActionSet", - "span_start": 14, - "span_end": 18, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 40, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "46eb026cb3313415ec47b82dd22f84f4d112c9d987e8b1716dcb0baa1cce8988", - "symbol_name": "ControlActionSet", - "qname": "ControlActionSet", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "ControlChannel\nrole: model\n\nResponsibilities:\n- default model role", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlChannel", - "span_start": 21, - "span_end": 28, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 40, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "cfcfe9a311d3a2dbdaf32ac4ccd73c0eb9a117f830591a1c0867ee97d46204ff", - "symbol_name": "ControlChannel", - "qname": "ControlChannel", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_runner.py", - "content": "UvicornThreadRunner\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (24)", - "layer": "C4_SEMANTIC_ROLES", - "title": "UvicornThreadRunner", - "span_start": 10, - "span_end": 61, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 11, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "fd55630045a02100df8877ac27d951ee08617d4598764394d48cb51fe067476a", - "symbol_name": "UvicornThreadRunner", - "qname": "UvicornThreadRunner", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 24, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "3779fdd2878b770e789a35bb2a89c9d79f13b61c26d7db1b3b683f9bb9e1623f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (10)", - "layer": "C4_SEMANTIC_ROLES", - "title": "HttpControlChannel", - "span_start": 12, - "span_end": 57, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 21, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "1c9fbdc24819e5604c26ea55428a74310f03a03e1af197ed84846af61e42fdb0", - "symbol_name": "HttpControlChannel", - "qname": "HttpControlChannel", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 10, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "HttpControlAppFactory\nrole: factory\n\nResponsibilities:\n- name suffix suggests factory", - "layer": "C4_SEMANTIC_ROLES", - "title": "HttpControlAppFactory", - "span_start": 15, - "span_end": 53, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 39, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "9b3502a5fb408b273223db13264349cf500de24915b6c649d9ea8970d0dfd8e0", - "symbol_name": "HttpControlAppFactory", - "qname": "HttpControlAppFactory", - "role": "factory", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/persistence/workflow_persistence.py", - "content": "WorkflowPersistence\nrole: pipeline_stage\n\nResponsibilities:\n- orchestrates role-like calls (2)\n- reads and writes state attributes\n- participates in dataflow slices (16)", - "layer": "C4_SEMANTIC_ROLES", - "title": "WorkflowPersistence", - "span_start": 8, - "span_end": 54, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 15, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "7bd01ee45cf31f2d5c2e3e51656254860ac785d10cef9e0852cd4fba90857bae", - "symbol_name": "WorkflowPersistence", - "qname": "WorkflowPersistence", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 16, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "80e9410ddc639789b4353c2a1a757ba8d0d5b5bb6075b0b263b61551f04ae1f0", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/queue/in_memory.py", - "content": "InMemoryTaskQueue\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (9)", - "layer": "C4_SEMANTIC_ROLES", - "title": "InMemoryTaskQueue", - "span_start": 9, - "span_end": 38, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 22, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "2da04cb94544a3bcbf0943a95ad4bdd8710bcafaa32a02fd0e4de2178dcf3533", - "symbol_name": "InMemoryTaskQueue", - "qname": "InMemoryTaskQueue", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 9, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "58f0cc001ccda0eee4c6bc32ed83bd05eafd6b6644f1e8b4aa9eed3103db73dc", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/config/file_loader.py", - "content": "ConfigFileLoader\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (8)", - "layer": "C4_SEMANTIC_ROLES", - "title": "ConfigFileLoader", - "span_start": 11, - "span_end": 48, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 23, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "a8474eca8b6e9dc86ae67ed68b16fa5fb639ef08739c053e7b7195489765667f", - "symbol_name": "ConfigFileLoader", - "qname": "ConfigFileLoader", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 8, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "1f19ffebde5e38e4be5a5d5a678059a0f36dedb8fb8b3e00ab395c67106a87ea", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/store.py", - "content": "TraceContextStore\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (6)", - "layer": "C4_SEMANTIC_ROLES", - "title": "TraceContextStore", - "span_start": 15, - "span_end": 52, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 25, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "b2dad4fbe16ffb11b58deba311c7739955c39d59f291b22181f33e9c8cce4059", - "symbol_name": "TraceContextStore", - "qname": "TraceContextStore", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 6, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "d369554f08fc92039c6edd5a2a1e73b23901533e8974459170bbd9347d263dc5", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workers/supervisor.py", - "content": "WorkerSupervisor\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (6)", - "layer": "C4_SEMANTIC_ROLES", - "title": "WorkerSupervisor", - "span_start": 10, - "span_end": 59, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 25, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "c17b44e8d9e97d490989b21fa67d7c346cdda8a0472e4c41fb243c8846faa124", - "symbol_name": "WorkerSupervisor", - "qname": "WorkerSupervisor", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 6, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "77609d9d5927171cce7fc3a54897c183fd63068710c6362029b700937aae5eee", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/engine/workflow_engine.py", - "content": "WorkflowEngine\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (6)", - "layer": "C4_SEMANTIC_ROLES", - "title": "WorkflowEngine", - "span_start": 10, - "span_end": 86, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 25, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "57ec0a9f11c542c78e008684a888397e8d9ef4223671acb2567e631a0cbc70b4", - "symbol_name": "WorkflowEngine", - "qname": "WorkflowEngine", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 6, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "1057136e58a325cd5ab6f4e265d15665fb6a711b7022d9fab52a1a290afa2368", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._start_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 47, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517", - "dst_ref": "ControlPlaneService._start_async", - "resolution": "resolved", - "slice_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._start_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.register_channel", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 17, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957", - "dst_ref": "ControlPlaneService.register_channel", - "resolution": "resolved", - "slice_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.register_channel" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.start", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 20, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154", - "dst_ref": "ControlPlaneService.start", - "resolution": "resolved", - "slice_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.start" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.stop", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 25, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d", - "dst_ref": "ControlPlaneService.stop", - "resolution": "resolved", - "slice_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.stop" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._stop_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 51, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a", - "dst_ref": "ControlPlaneService._stop_async", - "resolution": "resolved", - "slice_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._stop_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.start calls asyncio.run", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.start:calls", - "span_start": 22, - "span_end": 22, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "4e0b3147fb867d48d26567570c259f4052a739e3098133802d4b8bafcf03be6b", - "edge_type": "calls", - "src_symbol_id": "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154", - "src_qname": "ControlPlaneService.start", - "dst_symbol_id": null, - "dst_ref": "asyncio.run", - "resolution": "partial", - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.register_channel reads_attr ControlPlaneService._channels", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.register_channel:reads_attr", - "span_start": 17, - "span_end": 17, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "3101fdc99a7a9c5aebf18a024bc148d37b348248a6fd02b95724dff280f2908a", - "edge_type": "reads_attr", - "src_symbol_id": "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957", - "src_qname": "ControlPlaneService.register_channel", - "dst_symbol_id": null, - "dst_ref": "ControlPlaneService._channels", - "resolution": "partial", - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.start reads_attr ControlPlaneService._channels", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.start:reads_attr", - "span_start": 20, - "span_end": 20, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "9452e50ef27d47c30ee1c311c48fe73ecddbf7a6dbcf967a6345e98222d9f71a", - "edge_type": "reads_attr", - "src_symbol_id": "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154", - "src_qname": "ControlPlaneService.start", - "dst_symbol_id": null, - "dst_ref": "ControlPlaneService._channels", - "resolution": "partial", - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "class ControlPlaneService\nControlPlaneService", - "layer": "C1_SYMBOL_CATALOG", - "title": "ControlPlaneService", - "span_start": 12, - "span_end": 52, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "b13471e5916986dccffb53fab613812842965705e6b3a89ae549d30c9e91e9aa", - "qname": "ControlPlaneService", - "kind": "class", - "signature": "ControlPlaneService", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.control.service", - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "class ControlPlaneService:\n def __init__(self) -> None:\n self._channels: list[ControlChannel] = []\n\n def register_channel(self, channel: ControlChannel) -> None:\n self._channels.append(channel)\n\n def start(self, runtime: RuntimeManager) -> None:\n if not self._channels:\n return\n asyncio.run(self._start_async(runtime))\n\n def stop(self) -> None:\n if not self._channels:\n return\n asyncio.run(self._stop_async())\n\n def snapshot(self, runtime: RuntimeManager) -> dict[str, object]:\n health = runtime.current_health()\n return {\n \"runtime\": {\"state\": runtime._state.value},\n \"modules\": list(runtime.registry.modules),\n \"services\": runtime.services.snapshot(),\n \"workers\": runtime.workers.snapshot(),\n \"health\": runtime.health.snapshot(runtime.workers.healths()) | {\"status\": health[\"status\"]},\n \"config\": runtime.configuration.get(),\n }\n\n async def _start_async(self, runtime: RuntimeManager) -> None:\n actions = ControlActionSet(\n health=runtime.health_status,\n start=runtime.start_runtime,\n stop=runtime.stop_runtime,\n status=runtime.runtime_status,\n )\n for channel in self._channels:\n await channel.start(actions)\n\n async def _stop_async(self) -> None:\n for channel in reversed(self._channels):\n await channel.stop()", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/service.py:ControlPlaneService", - "span_start": 12, - "span_end": 52, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.service", - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "llm_answer": "1. **Компоненты, которые подтверждены контекстом**:\n - ControlPlaneService\n - ControlActionSet\n\n2. **Подтверждённые связи между ними**:\n - ControlPlaneService зависит от ControlActionSet через регистрацию каналов (_channels):\n ```\n ControlPlaneService.__init__ -> ControlPlaneService._channels -> ControlPlaneService.register_channel(ControlActionSet)\n ```\n\n3. **Границы ответственности, если они реально видны в коде**:\n - ControlPlaneService отвечает за инициализацию и управление каналами данных, регистрируя экземпляры ControlActionSet для работы с данными потока.\n \n4. **Что остаётся неизвестным или неполным**:\n - Детали реализации метода `register_channel` и его взаимодействия с другими компонентами системы остаются неясными на основании предоставленного контекста.\n - Неизвестно точно, какие именно каналы и действия регистрируются и используются внутри `ControlPlaneService`.", - "summary": { - "router": { - "intent": "CODE_QA", - "sub_intent": "ARCHITECTURE", - "confidence": null - }, - "retrieval": { - "profile": "code", - "layers_hit": [ - "C0_SOURCE_CHUNKS", - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS", - "C4_SEMANTIC_ROLES" - ], - "evidence_sufficient": true - }, - "llm": { - "answer_status": "answered", - "groundedness": "grounded" - } - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "ARCHITECTURE", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C4_SEMANTIC_ROLES", - "C3_ENTRYPOINTS", - "C2_DEPENDENCY_GRAPH", - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "ControlPlaneService" - ], - "keyword_hints": [ - "ControlPlaneService" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "execution": { - "executed_layers": [ - "C4_SEMANTIC_ROLES", - "C3_ENTRYPOINTS", - "C2_DEPENDENCY_GRAPH", - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS" - ], - "retrieval_mode_by_layer": { - "C4_SEMANTIC_ROLES": "exact_path_fetch", - "C3_ENTRYPOINTS": "exact_path_fetch", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C1_SYMBOL_CATALOG": "symbol_search", - "C0_SOURCE_CHUNKS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C4_SEMANTIC_ROLES": 12, - "C3_ENTRYPOINTS": 8, - "C2_DEPENDENCY_GRAPH": 8, - "C1_SYMBOL_CATALOG": 6, - "C0_SOURCE_CHUNKS": 4 - }, - "filters_by_layer": { - "C4_SEMANTIC_ROLES": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C1_SYMBOL_CATALOG": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C4_SEMANTIC_ROLES", - "query": "Какие компоненты участвуют в ControlPlaneService?", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 12, - "ranking_profile": "code" - }, - { - "layer": "C3_ENTRYPOINTS", - "query": "Какие компоненты участвуют в ControlPlaneService?", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "Какие компоненты участвуют в ControlPlaneService?", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C1_SYMBOL_CATALOG", - "query": "ControlPlaneService", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Какие компоненты участвуют в ControlPlaneService?", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 4, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C4_SEMANTIC_ROLES", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 12, - "candidates_after_filter": 12 - }, - { - "layer": "C3_ENTRYPOINTS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 3, - "candidates_after_filter": 3 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 1, - "candidates_after_filter": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 4, - "candidates_after_filter": 4 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "ControlPlaneService", - "alternatives": [ - "ControlPlaneService" - ] - }, - "layers": [ - { - "layer": "C4_SEMANTIC_ROLES", - "status": "hit", - "hit_count": 12, - "fail_reason": null - }, - { - "layer": "C3_ENTRYPOINTS", - "status": "hit", - "hit_count": 3, - "fail_reason": null - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 8, - "fail_reason": null - }, - { - "layer": "C1_SYMBOL_CATALOG", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 1, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "router": 0, - "symbol_resolution": 0, - "retrieval_total": 157, - "retrieval_by_layer": { - "C4_SEMANTIC_ROLES": 32, - "C3_ENTRYPOINTS": 15, - "C2_DEPENDENCY_GRAPH": 68, - "C1_SYMBOL_CATALOG": 25, - "C0_SOURCE_CHUNKS": 15 - }, - "merge_rank": 21, - "prompt_build": 0, - "llm_call": 1517 - }, - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 544, - "evidence_rows": 25, - "evidence_chars": 3723 - }, - "evidence_summary": [ - { - "layer": "C4_SEMANTIC_ROLES", - "count": 12, - "unique_paths": 11 - }, - { - "layer": "C3_ENTRYPOINTS", - "count": 3, - "unique_paths": 1 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "count": 8, - "unique_paths": 1 - }, - { - "layer": "C1_SYMBOL_CATALOG", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 1, - "unique_paths": 1 - } - ], - "prompt_template_id": "intent_code_qa_architecture_ru_v2", - "system_prompt_version": "v1" - }, - "router": { - "conversation_mode": "START", - "keyword_hints": [ - "ControlPlaneService" - ], - "path_scope": [] - }, - "llm": { - "used_evidence_count": 25, - "missing_evidence_reason": null - } - }, - "run_info": { - "case_id": "plba-v2-architecture-control-plane", - "mode": "full_chain", - "run_started_at": "2026-03-12T12:55:37", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - }, - "input_request": { - "text": "Какие компоненты участвуют в ControlPlaneService?", - "normalized_query": "Какие компоненты участвуют в ControlPlaneService?" - }, - "steps": [ - { - "step": "intent_router", - "input": { - "query": "Какие компоненты участвуют в ControlPlaneService?" - }, - "output": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Какие компоненты участвуют в ControlPlaneService?" - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "ARCHITECTURE", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C4_SEMANTIC_ROLES", - "C3_ENTRYPOINTS", - "C2_DEPENDENCY_GRAPH", - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "ControlPlaneService" - ], - "keyword_hints": [ - "ControlPlaneService" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "timings_ms": { - "router": 0 - } - } - }, - { - "step": "retrieval", - "input": { - "query": "Какие компоненты участвуют в ControlPlaneService?" - }, - "output": { - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "ControlPlaneService", - "alternatives": [ - "ControlPlaneService" - ], - "confidence": 0.99 - }, - "rag_count": 25, - "rag_rows": [ - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests service\n- reads and writes state attributes\n- participates in dataflow slices (5)", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlPlaneService", - "span_start": 12, - "span_end": 52, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 68, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "b13471e5916986dccffb53fab613812842965705e6b3a89ae549d30c9e91e9aa", - "symbol_name": "ControlPlaneService", - "qname": "ControlPlaneService", - "role": "pipeline_stage", - "confidence": 0.57, - "dataflow_participation": 5, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "ControlActionSet\nrole: model\n\nResponsibilities:\n- default model role", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlActionSet", - "span_start": 14, - "span_end": 18, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 40, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "46eb026cb3313415ec47b82dd22f84f4d112c9d987e8b1716dcb0baa1cce8988", - "symbol_name": "ControlActionSet", - "qname": "ControlActionSet", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "ControlChannel\nrole: model\n\nResponsibilities:\n- default model role", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlChannel", - "span_start": 21, - "span_end": 28, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 40, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "cfcfe9a311d3a2dbdaf32ac4ccd73c0eb9a117f830591a1c0867ee97d46204ff", - "symbol_name": "ControlChannel", - "qname": "ControlChannel", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_runner.py", - "content": "UvicornThreadRunner\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (24)", - "layer": "C4_SEMANTIC_ROLES", - "title": "UvicornThreadRunner", - "span_start": 10, - "span_end": 61, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 11, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "fd55630045a02100df8877ac27d951ee08617d4598764394d48cb51fe067476a", - "symbol_name": "UvicornThreadRunner", - "qname": "UvicornThreadRunner", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 24, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "3779fdd2878b770e789a35bb2a89c9d79f13b61c26d7db1b3b683f9bb9e1623f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (10)", - "layer": "C4_SEMANTIC_ROLES", - "title": "HttpControlChannel", - "span_start": 12, - "span_end": 57, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 21, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "1c9fbdc24819e5604c26ea55428a74310f03a03e1af197ed84846af61e42fdb0", - "symbol_name": "HttpControlChannel", - "qname": "HttpControlChannel", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 10, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "HttpControlAppFactory\nrole: factory\n\nResponsibilities:\n- name suffix suggests factory", - "layer": "C4_SEMANTIC_ROLES", - "title": "HttpControlAppFactory", - "span_start": 15, - "span_end": 53, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 39, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "9b3502a5fb408b273223db13264349cf500de24915b6c649d9ea8970d0dfd8e0", - "symbol_name": "HttpControlAppFactory", - "qname": "HttpControlAppFactory", - "role": "factory", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/persistence/workflow_persistence.py", - "content": "WorkflowPersistence\nrole: pipeline_stage\n\nResponsibilities:\n- orchestrates role-like calls (2)\n- reads and writes state attributes\n- participates in dataflow slices (16)", - "layer": "C4_SEMANTIC_ROLES", - "title": "WorkflowPersistence", - "span_start": 8, - "span_end": 54, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 15, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "7bd01ee45cf31f2d5c2e3e51656254860ac785d10cef9e0852cd4fba90857bae", - "symbol_name": "WorkflowPersistence", - "qname": "WorkflowPersistence", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 16, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "80e9410ddc639789b4353c2a1a757ba8d0d5b5bb6075b0b263b61551f04ae1f0", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/queue/in_memory.py", - "content": "InMemoryTaskQueue\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (9)", - "layer": "C4_SEMANTIC_ROLES", - "title": "InMemoryTaskQueue", - "span_start": 9, - "span_end": 38, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 22, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "2da04cb94544a3bcbf0943a95ad4bdd8710bcafaa32a02fd0e4de2178dcf3533", - "symbol_name": "InMemoryTaskQueue", - "qname": "InMemoryTaskQueue", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 9, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "58f0cc001ccda0eee4c6bc32ed83bd05eafd6b6644f1e8b4aa9eed3103db73dc", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/config/file_loader.py", - "content": "ConfigFileLoader\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (8)", - "layer": "C4_SEMANTIC_ROLES", - "title": "ConfigFileLoader", - "span_start": 11, - "span_end": 48, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 23, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "a8474eca8b6e9dc86ae67ed68b16fa5fb639ef08739c053e7b7195489765667f", - "symbol_name": "ConfigFileLoader", - "qname": "ConfigFileLoader", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 8, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "1f19ffebde5e38e4be5a5d5a678059a0f36dedb8fb8b3e00ab395c67106a87ea", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/store.py", - "content": "TraceContextStore\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (6)", - "layer": "C4_SEMANTIC_ROLES", - "title": "TraceContextStore", - "span_start": 15, - "span_end": 52, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 25, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "b2dad4fbe16ffb11b58deba311c7739955c39d59f291b22181f33e9c8cce4059", - "symbol_name": "TraceContextStore", - "qname": "TraceContextStore", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 6, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "d369554f08fc92039c6edd5a2a1e73b23901533e8974459170bbd9347d263dc5", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workers/supervisor.py", - "content": "WorkerSupervisor\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (6)", - "layer": "C4_SEMANTIC_ROLES", - "title": "WorkerSupervisor", - "span_start": 10, - "span_end": 59, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 25, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "c17b44e8d9e97d490989b21fa67d7c346cdda8a0472e4c41fb243c8846faa124", - "symbol_name": "WorkerSupervisor", - "qname": "WorkerSupervisor", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 6, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "77609d9d5927171cce7fc3a54897c183fd63068710c6362029b700937aae5eee", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/engine/workflow_engine.py", - "content": "WorkflowEngine\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (6)", - "layer": "C4_SEMANTIC_ROLES", - "title": "WorkflowEngine", - "span_start": 10, - "span_end": 86, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 25, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "57ec0a9f11c542c78e008684a888397e8d9ef4223671acb2567e631a0cbc70b4", - "symbol_name": "WorkflowEngine", - "qname": "WorkflowEngine", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 6, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "1057136e58a325cd5ab6f4e265d15665fb6a711b7022d9fab52a1a290afa2368", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._start_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 47, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517", - "dst_ref": "ControlPlaneService._start_async", - "resolution": "resolved", - "slice_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._start_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.register_channel", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 17, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957", - "dst_ref": "ControlPlaneService.register_channel", - "resolution": "resolved", - "slice_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.register_channel" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.start", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 20, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154", - "dst_ref": "ControlPlaneService.start", - "resolution": "resolved", - "slice_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.start" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.stop", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 25, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d", - "dst_ref": "ControlPlaneService.stop", - "resolution": "resolved", - "slice_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.stop" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._stop_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 51, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a", - "dst_ref": "ControlPlaneService._stop_async", - "resolution": "resolved", - "slice_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._stop_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.start calls asyncio.run", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.start:calls", - "span_start": 22, - "span_end": 22, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "4e0b3147fb867d48d26567570c259f4052a739e3098133802d4b8bafcf03be6b", - "edge_type": "calls", - "src_symbol_id": "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154", - "src_qname": "ControlPlaneService.start", - "dst_symbol_id": null, - "dst_ref": "asyncio.run", - "resolution": "partial", - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.register_channel reads_attr ControlPlaneService._channels", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.register_channel:reads_attr", - "span_start": 17, - "span_end": 17, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "3101fdc99a7a9c5aebf18a024bc148d37b348248a6fd02b95724dff280f2908a", - "edge_type": "reads_attr", - "src_symbol_id": "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957", - "src_qname": "ControlPlaneService.register_channel", - "dst_symbol_id": null, - "dst_ref": "ControlPlaneService._channels", - "resolution": "partial", - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.start reads_attr ControlPlaneService._channels", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.start:reads_attr", - "span_start": 20, - "span_end": 20, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "9452e50ef27d47c30ee1c311c48fe73ecddbf7a6dbcf967a6345e98222d9f71a", - "edge_type": "reads_attr", - "src_symbol_id": "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154", - "src_qname": "ControlPlaneService.start", - "dst_symbol_id": null, - "dst_ref": "ControlPlaneService._channels", - "resolution": "partial", - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "class ControlPlaneService\nControlPlaneService", - "layer": "C1_SYMBOL_CATALOG", - "title": "ControlPlaneService", - "span_start": 12, - "span_end": 52, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "b13471e5916986dccffb53fab613812842965705e6b3a89ae549d30c9e91e9aa", - "qname": "ControlPlaneService", - "kind": "class", - "signature": "ControlPlaneService", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.control.service", - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "class ControlPlaneService:\n def __init__(self) -> None:\n self._channels: list[ControlChannel] = []\n\n def register_channel(self, channel: ControlChannel) -> None:\n self._channels.append(channel)\n\n def start(self, runtime: RuntimeManager) -> None:\n if not self._channels:\n return\n asyncio.run(self._start_async(runtime))\n\n def stop(self) -> None:\n if not self._channels:\n return\n asyncio.run(self._stop_async())\n\n def snapshot(self, runtime: RuntimeManager) -> dict[str, object]:\n health = runtime.current_health()\n return {\n \"runtime\": {\"state\": runtime._state.value},\n \"modules\": list(runtime.registry.modules),\n \"services\": runtime.services.snapshot(),\n \"workers\": runtime.workers.snapshot(),\n \"health\": runtime.health.snapshot(runtime.workers.healths()) | {\"status\": health[\"status\"]},\n \"config\": runtime.configuration.get(),\n }\n\n async def _start_async(self, runtime: RuntimeManager) -> None:\n actions = ControlActionSet(\n health=runtime.health_status,\n start=runtime.start_runtime,\n stop=runtime.stop_runtime,\n status=runtime.runtime_status,\n )\n for channel in self._channels:\n await channel.start(actions)\n\n async def _stop_async(self) -> None:\n for channel in reversed(self._channels):\n await channel.stop()", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/service.py:ControlPlaneService", - "span_start": 12, - "span_end": 52, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.service", - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ] - }, - "diagnostics": { - "execution": { - "executed_layers": [ - "C4_SEMANTIC_ROLES", - "C3_ENTRYPOINTS", - "C2_DEPENDENCY_GRAPH", - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS" - ], - "retrieval_mode_by_layer": { - "C4_SEMANTIC_ROLES": "exact_path_fetch", - "C3_ENTRYPOINTS": "exact_path_fetch", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C1_SYMBOL_CATALOG": "symbol_search", - "C0_SOURCE_CHUNKS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C4_SEMANTIC_ROLES": 12, - "C3_ENTRYPOINTS": 8, - "C2_DEPENDENCY_GRAPH": 8, - "C1_SYMBOL_CATALOG": 6, - "C0_SOURCE_CHUNKS": 4 - }, - "filters_by_layer": { - "C4_SEMANTIC_ROLES": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C1_SYMBOL_CATALOG": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C4_SEMANTIC_ROLES", - "query": "Какие компоненты участвуют в ControlPlaneService?", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 12, - "ranking_profile": "code" - }, - { - "layer": "C3_ENTRYPOINTS", - "query": "Какие компоненты участвуют в ControlPlaneService?", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "Какие компоненты участвуют в ControlPlaneService?", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C1_SYMBOL_CATALOG", - "query": "ControlPlaneService", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Какие компоненты участвуют в ControlPlaneService?", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 4, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C4_SEMANTIC_ROLES", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 12, - "candidates_after_filter": 12 - }, - { - "layer": "C3_ENTRYPOINTS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 3, - "candidates_after_filter": 3 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 1, - "candidates_after_filter": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 4, - "candidates_after_filter": 4 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "ControlPlaneService", - "alternatives": [ - "ControlPlaneService" - ] - }, - "layers": [ - { - "layer": "C4_SEMANTIC_ROLES", - "status": "hit", - "hit_count": 12, - "fail_reason": null - }, - { - "layer": "C3_ENTRYPOINTS", - "status": "hit", - "hit_count": 3, - "fail_reason": null - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 8, - "fail_reason": null - }, - { - "layer": "C1_SYMBOL_CATALOG", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 1, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "symbol_resolution": 0, - "retrieval_total": 157, - "retrieval_by_layer": { - "C4_SEMANTIC_ROLES": 32, - "C3_ENTRYPOINTS": 15, - "C2_DEPENDENCY_GRAPH": 68, - "C1_SYMBOL_CATALOG": 25, - "C0_SOURCE_CHUNKS": 15 - }, - "merge_rank": 21 - } - } - }, - { - "step": "llm_answer", - "input": { - "query": "Какие компоненты участвуют в ControlPlaneService?", - "rag_count": 25 - }, - "output": { - "llm_answer": "1. **Компоненты, которые подтверждены контекстом**:\n - ControlPlaneService\n - ControlActionSet\n\n2. **Подтверждённые связи между ними**:\n - ControlPlaneService зависит от ControlActionSet через регистрацию каналов (_channels):\n ```\n ControlPlaneService.__init__ -> ControlPlaneService._channels -> ControlPlaneService.register_channel(ControlActionSet)\n ```\n\n3. **Границы ответственности, если они реально видны в коде**:\n - ControlPlaneService отвечает за инициализацию и управление каналами данных, регистрируя экземпляры ControlActionSet для работы с данными потока.\n \n4. **Что остаётся неизвестным или неполным**:\n - Детали реализации метода `register_channel` и его взаимодействия с другими компонентами системы остаются неясными на основании предоставленного контекста.\n - Неизвестно точно, какие именно каналы и действия регистрируются и используются внутри `ControlPlaneService`." - }, - "diagnostics": { - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 544, - "evidence_rows": 25, - "evidence_chars": 3723 - }, - "evidence_summary": [ - { - "layer": "C4_SEMANTIC_ROLES", - "count": 12, - "unique_paths": 11 - }, - { - "layer": "C3_ENTRYPOINTS", - "count": 3, - "unique_paths": 1 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "count": 8, - "unique_paths": 1 - }, - { - "layer": "C1_SYMBOL_CATALOG", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 1, - "unique_paths": 1 - } - ], - "prompt_template_id": "intent_code_qa_architecture_ru_v2", - "system_prompt_version": "v1" - }, - "timings_ms": { - "prompt_build": 0, - "llm_call": 1517 - } - } - } - ] - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_125536/full_chain_plba_code_subintents_v2_plba-v2-architecture-control-plane.md b/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_125536/full_chain_plba_code_subintents_v2_plba-v2-architecture-control-plane.md deleted file mode 100644 index 0a317f9..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_125536/full_chain_plba_code_subintents_v2_plba-v2-architecture-control-plane.md +++ /dev/null @@ -1,34 +0,0 @@ -# plba-v2-architecture-control-plane - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_subintents_v2.yaml -- runner: runtime -- mode: full_chain -- passed: True - -## Query -Какие компоненты участвуют в ControlPlaneService? - -## Actual -{ - "intent": "CODE_QA", - "sub_intent": "ARCHITECTURE", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 25, - "llm_answer": "1. **Компоненты, которые подтверждены контекстом**:\n - ControlPlaneService\n - ControlActionSet\n\n2. **Подтверждённые связи между ними**:\n - ControlPlaneService зависит от ControlActionSet через регистрацию каналов (_channels):\n ```\n ControlPlaneService.__init__ -> ControlPlaneService._channels -> ControlPlaneService.register_channel(ControlActionSet)\n ```\n\n3. **Границы ответственности, если они реально видны в коде**:\n - ControlPlaneService отвечает за инициализацию и управление каналами данных, регистрируя экземпляры ControlActionSet для работы с данными потока.\n \n4. **Что остаётся неизвестным или неполным**:\n - Детали реализации метода `register_channel` и его взаимодействия с другими компонентами системы остаются неясными на основании предоставленного контекста.\n - Неизвестно точно, какие именно каналы и действия регистрируются и используются внутри `ControlPlaneService`.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "ControlPlaneService" - ], - "layers": [ - "C4_SEMANTIC_ROLES", - "C3_ENTRYPOINTS", - "C2_DEPENDENCY_GRAPH", - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS" - ] -} - -## Mismatches -- none \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_125536/full_chain_plba_code_subintents_v2_plba-v2-architecture-runtime-manager.json b/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_125536/full_chain_plba_code_subintents_v2_plba-v2-architecture-runtime-manager.json deleted file mode 100644 index c819310..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_125536/full_chain_plba_code_subintents_v2_plba-v2-architecture-runtime-manager.json +++ /dev/null @@ -1,3036 +0,0 @@ -{ - "case_id": "plba-v2-architecture-runtime-manager", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_subintents_v2.yaml", - "runner": "runtime", - "mode": "full_chain", - "actual": { - "intent": "CODE_QA", - "sub_intent": "ARCHITECTURE", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 25, - "llm_answer": "1. **Компоненты, которые подтверждены контекстом**:\n - RuntimeManager\n - ControlActionSet\n - ControlPlaneService\n \n2. **Подтверждённые связи между ними**:\n - RuntimeManager инициирует ControlPlaneService через его метод `__init__` (`ControlPlaneService.__init__:dataflow_slice`).\n - ControlPlaneService используется внутри RuntimeManager для управления данными потока (`ControlPlaneService._channels`, `ControlPlaneService._start_async`).\n \n3. **Границы ответственности, если они реально видны в коде**:\n - RuntimeManager отвечает за координацию и управление операциями, связанными с состоянием приложения и потоками данных. Он управляет конфигурацией и запуском.\n - ControlActionSet выступает в качестве модели, выполняющей стандартные действия или вызовы на основе поступающих запросов.\n - ControlPlaneService ответственен за инициализацию каналов и запуск асинхронных операций.\n\n4. **Что остаётся неизвестным или неполным**:\n - Не полностью раскрыто взаимодействие ControlActionSet с RuntimeManager относительно конкретных вызовов или событий.\n - Нет информации о точном взаимодействии с внешними сервисами или точными интерфейсами обмена данными между компонентами.\n - Непонятно, какие конкретно данные передаются между компонентами и как именно происходит обмен состояниями и событиями.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "RuntimeManager" - ], - "layers": [ - "C4_SEMANTIC_ROLES", - "C3_ENTRYPOINTS", - "C2_DEPENDENCY_GRAPH", - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS" - ] - }, - "passed": true, - "mismatches": [], - "details": { - "case_id": "plba-v2-architecture-runtime-manager", - "text": "Какие компоненты участвуют в RuntimeManager?", - "mode": "full_chain", - "run_started_at": "2026-03-12T12:55:37", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Какие компоненты участвуют в RuntimeManager?", - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "RuntimeManager", - "alternatives": [ - "RuntimeManager" - ], - "confidence": 0.99 - }, - "rag_count": 25, - "rag_rows": [ - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests manager\n- orchestrates role-like calls (4)\n- reads and writes state attributes\n- participates in dataflow slices (50)", - "layer": "C4_SEMANTIC_ROLES", - "title": "RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 43, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "7e4a9381328c5803bbc6179458612fc4e947d928aa7bf8b4b2bebb2c8592f758", - "symbol_name": "RuntimeManager", - "qname": "RuntimeManager", - "role": "pipeline_stage", - "confidence": 0.67, - "dataflow_participation": 50, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "ControlActionSet\nrole: model\n\nResponsibilities:\n- default model role", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlActionSet", - "span_start": 14, - "span_end": 18, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 40, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "46eb026cb3313415ec47b82dd22f84f4d112c9d987e8b1716dcb0baa1cce8988", - "symbol_name": "ControlActionSet", - "qname": "ControlActionSet", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "ControlChannel\nrole: model\n\nResponsibilities:\n- default model role", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlChannel", - "span_start": 21, - "span_end": 28, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 40, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "cfcfe9a311d3a2dbdaf32ac4ccd73c0eb9a117f830591a1c0867ee97d46204ff", - "symbol_name": "ControlChannel", - "qname": "ControlChannel", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests service\n- reads and writes state attributes\n- participates in dataflow slices (5)", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlPlaneService", - "span_start": 12, - "span_end": 52, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 68, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "b13471e5916986dccffb53fab613812842965705e6b3a89ae549d30c9e91e9aa", - "symbol_name": "ControlPlaneService", - "qname": "ControlPlaneService", - "role": "pipeline_stage", - "confidence": 0.57, - "dataflow_participation": 5, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_runner.py", - "content": "UvicornThreadRunner\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (24)", - "layer": "C4_SEMANTIC_ROLES", - "title": "UvicornThreadRunner", - "span_start": 10, - "span_end": 61, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 11, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "fd55630045a02100df8877ac27d951ee08617d4598764394d48cb51fe067476a", - "symbol_name": "UvicornThreadRunner", - "qname": "UvicornThreadRunner", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 24, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "3779fdd2878b770e789a35bb2a89c9d79f13b61c26d7db1b3b683f9bb9e1623f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (10)", - "layer": "C4_SEMANTIC_ROLES", - "title": "HttpControlChannel", - "span_start": 12, - "span_end": 57, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 21, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "1c9fbdc24819e5604c26ea55428a74310f03a03e1af197ed84846af61e42fdb0", - "symbol_name": "HttpControlChannel", - "qname": "HttpControlChannel", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 10, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "HttpControlAppFactory\nrole: factory\n\nResponsibilities:\n- name suffix suggests factory", - "layer": "C4_SEMANTIC_ROLES", - "title": "HttpControlAppFactory", - "span_start": 15, - "span_end": 53, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 39, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "9b3502a5fb408b273223db13264349cf500de24915b6c649d9ea8970d0dfd8e0", - "symbol_name": "HttpControlAppFactory", - "qname": "HttpControlAppFactory", - "role": "factory", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/persistence/workflow_persistence.py", - "content": "WorkflowPersistence\nrole: pipeline_stage\n\nResponsibilities:\n- orchestrates role-like calls (2)\n- reads and writes state attributes\n- participates in dataflow slices (16)", - "layer": "C4_SEMANTIC_ROLES", - "title": "WorkflowPersistence", - "span_start": 8, - "span_end": 54, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 15, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "7bd01ee45cf31f2d5c2e3e51656254860ac785d10cef9e0852cd4fba90857bae", - "symbol_name": "WorkflowPersistence", - "qname": "WorkflowPersistence", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 16, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "80e9410ddc639789b4353c2a1a757ba8d0d5b5bb6075b0b263b61551f04ae1f0", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/queue/in_memory.py", - "content": "InMemoryTaskQueue\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (9)", - "layer": "C4_SEMANTIC_ROLES", - "title": "InMemoryTaskQueue", - "span_start": 9, - "span_end": 38, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 22, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "2da04cb94544a3bcbf0943a95ad4bdd8710bcafaa32a02fd0e4de2178dcf3533", - "symbol_name": "InMemoryTaskQueue", - "qname": "InMemoryTaskQueue", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 9, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "58f0cc001ccda0eee4c6bc32ed83bd05eafd6b6644f1e8b4aa9eed3103db73dc", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/config/file_loader.py", - "content": "ConfigFileLoader\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (8)", - "layer": "C4_SEMANTIC_ROLES", - "title": "ConfigFileLoader", - "span_start": 11, - "span_end": 48, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 23, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "a8474eca8b6e9dc86ae67ed68b16fa5fb639ef08739c053e7b7195489765667f", - "symbol_name": "ConfigFileLoader", - "qname": "ConfigFileLoader", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 8, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "1f19ffebde5e38e4be5a5d5a678059a0f36dedb8fb8b3e00ab395c67106a87ea", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/store.py", - "content": "TraceContextStore\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (6)", - "layer": "C4_SEMANTIC_ROLES", - "title": "TraceContextStore", - "span_start": 15, - "span_end": 52, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 25, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "b2dad4fbe16ffb11b58deba311c7739955c39d59f291b22181f33e9c8cce4059", - "symbol_name": "TraceContextStore", - "qname": "TraceContextStore", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 6, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "d369554f08fc92039c6edd5a2a1e73b23901533e8974459170bbd9347d263dc5", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workers/supervisor.py", - "content": "WorkerSupervisor\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (6)", - "layer": "C4_SEMANTIC_ROLES", - "title": "WorkerSupervisor", - "span_start": 10, - "span_end": 59, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 25, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "c17b44e8d9e97d490989b21fa67d7c346cdda8a0472e4c41fb243c8846faa124", - "symbol_name": "WorkerSupervisor", - "qname": "WorkerSupervisor", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 6, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "77609d9d5927171cce7fc3a54897c183fd63068710c6362029b700937aae5eee", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._start_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 47, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517", - "dst_ref": "ControlPlaneService._start_async", - "resolution": "resolved", - "slice_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._start_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager.start", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 32, - "span_end": 59, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "98312ace7fc62b1c7194c5aa1732b6ef736eae1668a3a120dd1ecd5ab1d64f7a", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "77a7b260193018845e4e204df094ab89cfd7c82ee4e822b3a83ad4cd945f9cb1", - "dst_ref": "RuntimeManager.start", - "resolution": "resolved", - "slice_id": "98312ace7fc62b1c7194c5aa1732b6ef736eae1668a3a120dd1ecd5ab1d64f7a", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager.start" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "77a7b260193018845e4e204df094ab89cfd7c82ee4e822b3a83ad4cd945f9cb1" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.start", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 20, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154", - "dst_ref": "ControlPlaneService.start", - "resolution": "resolved", - "slice_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.start" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.stop", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 25, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d", - "dst_ref": "ControlPlaneService.stop", - "resolution": "resolved", - "slice_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.stop" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._stop_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 51, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a", - "dst_ref": "ControlPlaneService._stop_async", - "resolution": "resolved", - "slice_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._stop_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager.add_config_file", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 32, - "span_end": 52, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "a23b8a11ebdb12708b60c96ea12a69f7f042082f1adfddd572444e246d81d167", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "57ffbd4f0d9fdf3507c2b8624312ce211f3d02fdf86a57a8ec90778d8a7b498d", - "dst_ref": "RuntimeManager.add_config_file", - "resolution": "resolved", - "slice_id": "a23b8a11ebdb12708b60c96ea12a69f7f042082f1adfddd572444e246d81d167", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager.add_config_file" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "57ffbd4f0d9fdf3507c2b8624312ce211f3d02fdf86a57a8ec90778d8a7b498d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.register_channel", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 17, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957", - "dst_ref": "ControlPlaneService.register_channel", - "resolution": "resolved", - "slice_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.register_channel" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager._register_core_services", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 32, - "span_end": 127, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "3e5811f3b511fa0cabe363f5d01f2ac5fa039bc8b93f7ee108323e1f5f45a293", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "972d6057a6caac9cf31ebc1e29c6f39f71b10d4cc170dec57cf875ba458549c6", - "dst_ref": "RuntimeManager._register_core_services", - "resolution": "resolved", - "slice_id": "3e5811f3b511fa0cabe363f5d01f2ac5fa039bc8b93f7ee108323e1f5f45a293", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager._register_core_services" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "972d6057a6caac9cf31ebc1e29c6f39f71b10d4cc170dec57cf875ba458549c6" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "class RuntimeManager\nRuntimeManager", - "layer": "C1_SYMBOL_CATALOG", - "title": "RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "7e4a9381328c5803bbc6179458612fc4e947d928aa7bf8b4b2bebb2c8592f758", - "qname": "RuntimeManager", - "kind": "class", - "signature": "RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.core.runtime", - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "class RuntimeManager:\n ACTION_TIMEOUT_SECONDS = 10.0\n ACTION_POLL_INTERVAL_SECONDS = 0.05\n\n def __init__(\n self,\n configuration: ConfigurationManager | None = None,\n services: ServiceContainer | None = None,\n traces: TraceService | None = None,\n health: HealthRegistry | None = None,\n logs: LogManager | None = None,\n workers: WorkerSupervisor | None = None,\n control_plane: ControlPlaneService | None = None,\n ) -> None:\n self.configuration = configuration or ConfigurationManager()\n self.services = services or ServiceContainer()\n self.traces = traces or TraceService()\n self.health = health or HealthRegistry()\n self.logs = logs or LogManager()\n self.workers = workers or WorkerSupervisor()\n self.control_plane = control_plane or ControlPlaneService()\n self.registry = ModuleRegistry(self.services)\n self._started = False\n self._state = LifecycleState.IDLE\n self._core_registered = False\n self._workers_registered = False\n self._register_core_services()\n\n def register_module(self, module: ApplicationModule) -> None:\n self.registry.register_module(module.name)\n module.register(self.registry)\n\n def add_config_file(self, path: str) -> FileConfigProvider:\n provider = FileConfigProvider(path)\n self.configuration.add_provider(provider)\n return provider\n\n def start(self, *, start_control_plane: bool = True) -> None:\n if self._started:\n return\n self._state = LifecycleState.STARTING\n config = self.configuration.load()\n self.logs.apply_config(config)\n self._register_health_contributors()\n self._register_workers()\n self.workers.start()\n if start_control_plane:\n self.control_plane.start(self)\n self._started = True\n self._refresh_state()\n\n def stop(self, timeout: float = 30.0, force: bool = False, stop_control_plane: bool = True) -> None:\n if not self._started:\n return\n self._state = LifecycleState.STOPPING\n self.workers.stop(timeout=timeout, force=force)\n if stop_control_plane:\n self.control_plane.stop()\n self._started = False\n self._state = LifecycleState.STOPPED\n\n def status(self) -> dict[str, object]:\n self._refresh_state()\n return self.control_plane.snapshot(self)\n\n def current_health(self) -> HealthPayload:\n self._refresh_state()\n return self.health.payload(self._state, self.workers.healths())\n\n async def health_status(self) -> HealthPayload:\n return self.current_health()\n\n async def start_runtime(self) -> dict[str, object] | str:\n self._refresh_state()\n if self._started:\n return \"runtime already running\"\n if self._state == LifecycleState.STOPPING:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n\n self.start(start_control_plane=False)\n started = self._wait_for_state({LifecycleState.IDLE, LifecycleState.BUSY}, timeout=self.ACTION_TIMEOUT_SECONDS)\n if started:\n return self._action_detail(\"runtime started\", timed_out=False)\n return self._action_detail(\"runtime start is still in progress\", timed_out=True)\n\n async def stop_runtime(self) -> dict[str, object] | str:\n self._refresh_state()\n if not self._started:\n if self._state == LifecycleState.STOPPING:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n return \"runtime already stopped\"\n\n self._state = LifecycleState.STOPPING\n try:\n self.workers.stop(timeout=self.ACTION_TIMEOUT_SECONDS, force=False)\n except TimeoutError:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n\n self._started = False\n self._state = LifecycleState.STOPPED\n return self._action_detail(\"runtime stopped\", timed_out=False)\n\n async def runtime_status(self) -> str:\n self._refresh_state()\n return self._state.value\n\n def _register_core_services(self) -> None:\n if self._core_registered:\n return\n self.services.register(\"configuration\", self.configuration)\n self.services.register(\"traces\", self.traces)\n self.services.register(\"health\", self.health)\n self.services.register(\"logs\", self.logs)\n self.services.register(\"workers\", self.workers)\n self.services.register(\"control_plane\", self.control_plane)\n self._core_registered = True\n\n def _register_health_contributors(self) -> None:\n for contributor in self.registry.health_contributors:\n self.health.register(contributor)\n\n def _register_workers(self) -> None:\n if self._workers_registered:\n return\n for worker in self.registry.workers:\n self.workers.register(worker)\n self._workers_registered = True\n\n def _refresh_state(self) -> None:\n lifecycle = self.workers.lifecycle_state()\n\n if self._state == LifecycleState.STOPPING:\n if lifecycle == LifecycleState.STOPPED:\n self._started = False\n self._state = LifecycleState.STOPPED\n return\n\n if not self._started:\n if lifecycle == LifecycleState.STOPPED:\n self._state = LifecycleState.STOPPED\n return\n\n self._state = lifecycle\n\n def _wait_for_state(self, target_states: set[LifecycleState], *, timeout: float) -> bool:\n deadline = monotonic() + timeout\n while monotonic() < deadline:\n self._refresh_state()\n if self._state in target_states:\n return True\n sleep(self.ACTION_POLL_INTERVAL_SECONDS)\n self._refresh_state()\n return self._state in target_states\n\n def _action_detail(self, message: str, *, timed_out: bool) -> dict[str, object]:\n self._refresh_state()\n return {\n \"message\": message,\n \"state\": self._state.value,\n \"timed_out\": timed_out,\n \"workers\": self.workers.snapshot(),\n }", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/core/runtime.py:RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.core.runtime", - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "llm_answer": "1. **Компоненты, которые подтверждены контекстом**:\n - RuntimeManager\n - ControlActionSet\n - ControlPlaneService\n \n2. **Подтверждённые связи между ними**:\n - RuntimeManager инициирует ControlPlaneService через его метод `__init__` (`ControlPlaneService.__init__:dataflow_slice`).\n - ControlPlaneService используется внутри RuntimeManager для управления данными потока (`ControlPlaneService._channels`, `ControlPlaneService._start_async`).\n \n3. **Границы ответственности, если они реально видны в коде**:\n - RuntimeManager отвечает за координацию и управление операциями, связанными с состоянием приложения и потоками данных. Он управляет конфигурацией и запуском.\n - ControlActionSet выступает в качестве модели, выполняющей стандартные действия или вызовы на основе поступающих запросов.\n - ControlPlaneService ответственен за инициализацию каналов и запуск асинхронных операций.\n\n4. **Что остаётся неизвестным или неполным**:\n - Не полностью раскрыто взаимодействие ControlActionSet с RuntimeManager относительно конкретных вызовов или событий.\n - Нет информации о точном взаимодействии с внешними сервисами или точными интерфейсами обмена данными между компонентами.\n - Непонятно, какие конкретно данные передаются между компонентами и как именно происходит обмен состояниями и событиями.", - "summary": { - "router": { - "intent": "CODE_QA", - "sub_intent": "ARCHITECTURE", - "confidence": null - }, - "retrieval": { - "profile": "code", - "layers_hit": [ - "C0_SOURCE_CHUNKS", - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS", - "C4_SEMANTIC_ROLES" - ], - "evidence_sufficient": true - }, - "llm": { - "answer_status": "answered", - "groundedness": "grounded" - } - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "ARCHITECTURE", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C4_SEMANTIC_ROLES", - "C3_ENTRYPOINTS", - "C2_DEPENDENCY_GRAPH", - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "RuntimeManager" - ], - "keyword_hints": [ - "RuntimeManager" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "execution": { - "executed_layers": [ - "C4_SEMANTIC_ROLES", - "C3_ENTRYPOINTS", - "C2_DEPENDENCY_GRAPH", - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS" - ], - "retrieval_mode_by_layer": { - "C4_SEMANTIC_ROLES": "exact_path_fetch", - "C3_ENTRYPOINTS": "exact_path_fetch", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C1_SYMBOL_CATALOG": "symbol_search", - "C0_SOURCE_CHUNKS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C4_SEMANTIC_ROLES": 12, - "C3_ENTRYPOINTS": 8, - "C2_DEPENDENCY_GRAPH": 8, - "C1_SYMBOL_CATALOG": 6, - "C0_SOURCE_CHUNKS": 4 - }, - "filters_by_layer": { - "C4_SEMANTIC_ROLES": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C1_SYMBOL_CATALOG": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C4_SEMANTIC_ROLES", - "query": "Какие компоненты участвуют в RuntimeManager?", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 12, - "ranking_profile": "code" - }, - { - "layer": "C3_ENTRYPOINTS", - "query": "Какие компоненты участвуют в RuntimeManager?", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "Какие компоненты участвуют в RuntimeManager?", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C1_SYMBOL_CATALOG", - "query": "RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Какие компоненты участвуют в RuntimeManager?", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 4, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C4_SEMANTIC_ROLES", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 12, - "candidates_after_filter": 12 - }, - { - "layer": "C3_ENTRYPOINTS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 3, - "candidates_after_filter": 3 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 1, - "candidates_after_filter": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 4, - "candidates_after_filter": 4 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "RuntimeManager", - "alternatives": [ - "RuntimeManager" - ] - }, - "layers": [ - { - "layer": "C4_SEMANTIC_ROLES", - "status": "hit", - "hit_count": 12, - "fail_reason": null - }, - { - "layer": "C3_ENTRYPOINTS", - "status": "hit", - "hit_count": 3, - "fail_reason": null - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 8, - "fail_reason": null - }, - { - "layer": "C1_SYMBOL_CATALOG", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 1, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "router": 0, - "symbol_resolution": 0, - "retrieval_total": 150, - "retrieval_by_layer": { - "C4_SEMANTIC_ROLES": 30, - "C3_ENTRYPOINTS": 16, - "C2_DEPENDENCY_GRAPH": 62, - "C1_SYMBOL_CATALOG": 24, - "C0_SOURCE_CHUNKS": 16 - }, - "merge_rank": 19, - "prompt_build": 0, - "llm_call": 2083 - }, - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 537, - "evidence_rows": 25, - "evidence_chars": 8651 - }, - "evidence_summary": [ - { - "layer": "C4_SEMANTIC_ROLES", - "count": 12, - "unique_paths": 11 - }, - { - "layer": "C3_ENTRYPOINTS", - "count": 3, - "unique_paths": 1 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "count": 8, - "unique_paths": 2 - }, - { - "layer": "C1_SYMBOL_CATALOG", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 1, - "unique_paths": 1 - } - ], - "prompt_template_id": "intent_code_qa_architecture_ru_v2", - "system_prompt_version": "v1" - }, - "router": { - "conversation_mode": "START", - "keyword_hints": [ - "RuntimeManager" - ], - "path_scope": [] - }, - "llm": { - "used_evidence_count": 25, - "missing_evidence_reason": null - } - }, - "run_info": { - "case_id": "plba-v2-architecture-runtime-manager", - "mode": "full_chain", - "run_started_at": "2026-03-12T12:55:37", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - }, - "input_request": { - "text": "Какие компоненты участвуют в RuntimeManager?", - "normalized_query": "Какие компоненты участвуют в RuntimeManager?" - }, - "steps": [ - { - "step": "intent_router", - "input": { - "query": "Какие компоненты участвуют в RuntimeManager?" - }, - "output": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Какие компоненты участвуют в RuntimeManager?" - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "ARCHITECTURE", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C4_SEMANTIC_ROLES", - "C3_ENTRYPOINTS", - "C2_DEPENDENCY_GRAPH", - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "RuntimeManager" - ], - "keyword_hints": [ - "RuntimeManager" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "timings_ms": { - "router": 0 - } - } - }, - { - "step": "retrieval", - "input": { - "query": "Какие компоненты участвуют в RuntimeManager?" - }, - "output": { - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "RuntimeManager", - "alternatives": [ - "RuntimeManager" - ], - "confidence": 0.99 - }, - "rag_count": 25, - "rag_rows": [ - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests manager\n- orchestrates role-like calls (4)\n- reads and writes state attributes\n- participates in dataflow slices (50)", - "layer": "C4_SEMANTIC_ROLES", - "title": "RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 43, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "7e4a9381328c5803bbc6179458612fc4e947d928aa7bf8b4b2bebb2c8592f758", - "symbol_name": "RuntimeManager", - "qname": "RuntimeManager", - "role": "pipeline_stage", - "confidence": 0.67, - "dataflow_participation": 50, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "ControlActionSet\nrole: model\n\nResponsibilities:\n- default model role", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlActionSet", - "span_start": 14, - "span_end": 18, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 40, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "46eb026cb3313415ec47b82dd22f84f4d112c9d987e8b1716dcb0baa1cce8988", - "symbol_name": "ControlActionSet", - "qname": "ControlActionSet", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "ControlChannel\nrole: model\n\nResponsibilities:\n- default model role", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlChannel", - "span_start": 21, - "span_end": 28, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 40, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "cfcfe9a311d3a2dbdaf32ac4ccd73c0eb9a117f830591a1c0867ee97d46204ff", - "symbol_name": "ControlChannel", - "qname": "ControlChannel", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests service\n- reads and writes state attributes\n- participates in dataflow slices (5)", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlPlaneService", - "span_start": 12, - "span_end": 52, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 68, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "b13471e5916986dccffb53fab613812842965705e6b3a89ae549d30c9e91e9aa", - "symbol_name": "ControlPlaneService", - "qname": "ControlPlaneService", - "role": "pipeline_stage", - "confidence": 0.57, - "dataflow_participation": 5, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_runner.py", - "content": "UvicornThreadRunner\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (24)", - "layer": "C4_SEMANTIC_ROLES", - "title": "UvicornThreadRunner", - "span_start": 10, - "span_end": 61, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 11, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "fd55630045a02100df8877ac27d951ee08617d4598764394d48cb51fe067476a", - "symbol_name": "UvicornThreadRunner", - "qname": "UvicornThreadRunner", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 24, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "3779fdd2878b770e789a35bb2a89c9d79f13b61c26d7db1b3b683f9bb9e1623f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (10)", - "layer": "C4_SEMANTIC_ROLES", - "title": "HttpControlChannel", - "span_start": 12, - "span_end": 57, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 21, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "1c9fbdc24819e5604c26ea55428a74310f03a03e1af197ed84846af61e42fdb0", - "symbol_name": "HttpControlChannel", - "qname": "HttpControlChannel", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 10, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "HttpControlAppFactory\nrole: factory\n\nResponsibilities:\n- name suffix suggests factory", - "layer": "C4_SEMANTIC_ROLES", - "title": "HttpControlAppFactory", - "span_start": 15, - "span_end": 53, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 39, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "9b3502a5fb408b273223db13264349cf500de24915b6c649d9ea8970d0dfd8e0", - "symbol_name": "HttpControlAppFactory", - "qname": "HttpControlAppFactory", - "role": "factory", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/persistence/workflow_persistence.py", - "content": "WorkflowPersistence\nrole: pipeline_stage\n\nResponsibilities:\n- orchestrates role-like calls (2)\n- reads and writes state attributes\n- participates in dataflow slices (16)", - "layer": "C4_SEMANTIC_ROLES", - "title": "WorkflowPersistence", - "span_start": 8, - "span_end": 54, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 15, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "7bd01ee45cf31f2d5c2e3e51656254860ac785d10cef9e0852cd4fba90857bae", - "symbol_name": "WorkflowPersistence", - "qname": "WorkflowPersistence", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 16, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "80e9410ddc639789b4353c2a1a757ba8d0d5b5bb6075b0b263b61551f04ae1f0", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/queue/in_memory.py", - "content": "InMemoryTaskQueue\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (9)", - "layer": "C4_SEMANTIC_ROLES", - "title": "InMemoryTaskQueue", - "span_start": 9, - "span_end": 38, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 22, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "2da04cb94544a3bcbf0943a95ad4bdd8710bcafaa32a02fd0e4de2178dcf3533", - "symbol_name": "InMemoryTaskQueue", - "qname": "InMemoryTaskQueue", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 9, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "58f0cc001ccda0eee4c6bc32ed83bd05eafd6b6644f1e8b4aa9eed3103db73dc", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/config/file_loader.py", - "content": "ConfigFileLoader\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (8)", - "layer": "C4_SEMANTIC_ROLES", - "title": "ConfigFileLoader", - "span_start": 11, - "span_end": 48, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 23, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "a8474eca8b6e9dc86ae67ed68b16fa5fb639ef08739c053e7b7195489765667f", - "symbol_name": "ConfigFileLoader", - "qname": "ConfigFileLoader", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 8, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "1f19ffebde5e38e4be5a5d5a678059a0f36dedb8fb8b3e00ab395c67106a87ea", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/store.py", - "content": "TraceContextStore\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (6)", - "layer": "C4_SEMANTIC_ROLES", - "title": "TraceContextStore", - "span_start": 15, - "span_end": 52, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 25, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "b2dad4fbe16ffb11b58deba311c7739955c39d59f291b22181f33e9c8cce4059", - "symbol_name": "TraceContextStore", - "qname": "TraceContextStore", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 6, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "d369554f08fc92039c6edd5a2a1e73b23901533e8974459170bbd9347d263dc5", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workers/supervisor.py", - "content": "WorkerSupervisor\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (6)", - "layer": "C4_SEMANTIC_ROLES", - "title": "WorkerSupervisor", - "span_start": 10, - "span_end": 59, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 25, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "c17b44e8d9e97d490989b21fa67d7c346cdda8a0472e4c41fb243c8846faa124", - "symbol_name": "WorkerSupervisor", - "qname": "WorkerSupervisor", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 6, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "77609d9d5927171cce7fc3a54897c183fd63068710c6362029b700937aae5eee", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._start_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 47, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517", - "dst_ref": "ControlPlaneService._start_async", - "resolution": "resolved", - "slice_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._start_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager.start", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 32, - "span_end": 59, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "98312ace7fc62b1c7194c5aa1732b6ef736eae1668a3a120dd1ecd5ab1d64f7a", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "77a7b260193018845e4e204df094ab89cfd7c82ee4e822b3a83ad4cd945f9cb1", - "dst_ref": "RuntimeManager.start", - "resolution": "resolved", - "slice_id": "98312ace7fc62b1c7194c5aa1732b6ef736eae1668a3a120dd1ecd5ab1d64f7a", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager.start" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "77a7b260193018845e4e204df094ab89cfd7c82ee4e822b3a83ad4cd945f9cb1" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.start", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 20, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154", - "dst_ref": "ControlPlaneService.start", - "resolution": "resolved", - "slice_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.start" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.stop", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 25, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d", - "dst_ref": "ControlPlaneService.stop", - "resolution": "resolved", - "slice_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.stop" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._stop_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 51, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a", - "dst_ref": "ControlPlaneService._stop_async", - "resolution": "resolved", - "slice_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._stop_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager.add_config_file", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 32, - "span_end": 52, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "a23b8a11ebdb12708b60c96ea12a69f7f042082f1adfddd572444e246d81d167", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "57ffbd4f0d9fdf3507c2b8624312ce211f3d02fdf86a57a8ec90778d8a7b498d", - "dst_ref": "RuntimeManager.add_config_file", - "resolution": "resolved", - "slice_id": "a23b8a11ebdb12708b60c96ea12a69f7f042082f1adfddd572444e246d81d167", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager.add_config_file" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "57ffbd4f0d9fdf3507c2b8624312ce211f3d02fdf86a57a8ec90778d8a7b498d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.register_channel", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 17, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957", - "dst_ref": "ControlPlaneService.register_channel", - "resolution": "resolved", - "slice_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.register_channel" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager._register_core_services", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 32, - "span_end": 127, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "3e5811f3b511fa0cabe363f5d01f2ac5fa039bc8b93f7ee108323e1f5f45a293", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "972d6057a6caac9cf31ebc1e29c6f39f71b10d4cc170dec57cf875ba458549c6", - "dst_ref": "RuntimeManager._register_core_services", - "resolution": "resolved", - "slice_id": "3e5811f3b511fa0cabe363f5d01f2ac5fa039bc8b93f7ee108323e1f5f45a293", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager._register_core_services" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "972d6057a6caac9cf31ebc1e29c6f39f71b10d4cc170dec57cf875ba458549c6" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "class RuntimeManager\nRuntimeManager", - "layer": "C1_SYMBOL_CATALOG", - "title": "RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "7e4a9381328c5803bbc6179458612fc4e947d928aa7bf8b4b2bebb2c8592f758", - "qname": "RuntimeManager", - "kind": "class", - "signature": "RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.core.runtime", - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "class RuntimeManager:\n ACTION_TIMEOUT_SECONDS = 10.0\n ACTION_POLL_INTERVAL_SECONDS = 0.05\n\n def __init__(\n self,\n configuration: ConfigurationManager | None = None,\n services: ServiceContainer | None = None,\n traces: TraceService | None = None,\n health: HealthRegistry | None = None,\n logs: LogManager | None = None,\n workers: WorkerSupervisor | None = None,\n control_plane: ControlPlaneService | None = None,\n ) -> None:\n self.configuration = configuration or ConfigurationManager()\n self.services = services or ServiceContainer()\n self.traces = traces or TraceService()\n self.health = health or HealthRegistry()\n self.logs = logs or LogManager()\n self.workers = workers or WorkerSupervisor()\n self.control_plane = control_plane or ControlPlaneService()\n self.registry = ModuleRegistry(self.services)\n self._started = False\n self._state = LifecycleState.IDLE\n self._core_registered = False\n self._workers_registered = False\n self._register_core_services()\n\n def register_module(self, module: ApplicationModule) -> None:\n self.registry.register_module(module.name)\n module.register(self.registry)\n\n def add_config_file(self, path: str) -> FileConfigProvider:\n provider = FileConfigProvider(path)\n self.configuration.add_provider(provider)\n return provider\n\n def start(self, *, start_control_plane: bool = True) -> None:\n if self._started:\n return\n self._state = LifecycleState.STARTING\n config = self.configuration.load()\n self.logs.apply_config(config)\n self._register_health_contributors()\n self._register_workers()\n self.workers.start()\n if start_control_plane:\n self.control_plane.start(self)\n self._started = True\n self._refresh_state()\n\n def stop(self, timeout: float = 30.0, force: bool = False, stop_control_plane: bool = True) -> None:\n if not self._started:\n return\n self._state = LifecycleState.STOPPING\n self.workers.stop(timeout=timeout, force=force)\n if stop_control_plane:\n self.control_plane.stop()\n self._started = False\n self._state = LifecycleState.STOPPED\n\n def status(self) -> dict[str, object]:\n self._refresh_state()\n return self.control_plane.snapshot(self)\n\n def current_health(self) -> HealthPayload:\n self._refresh_state()\n return self.health.payload(self._state, self.workers.healths())\n\n async def health_status(self) -> HealthPayload:\n return self.current_health()\n\n async def start_runtime(self) -> dict[str, object] | str:\n self._refresh_state()\n if self._started:\n return \"runtime already running\"\n if self._state == LifecycleState.STOPPING:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n\n self.start(start_control_plane=False)\n started = self._wait_for_state({LifecycleState.IDLE, LifecycleState.BUSY}, timeout=self.ACTION_TIMEOUT_SECONDS)\n if started:\n return self._action_detail(\"runtime started\", timed_out=False)\n return self._action_detail(\"runtime start is still in progress\", timed_out=True)\n\n async def stop_runtime(self) -> dict[str, object] | str:\n self._refresh_state()\n if not self._started:\n if self._state == LifecycleState.STOPPING:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n return \"runtime already stopped\"\n\n self._state = LifecycleState.STOPPING\n try:\n self.workers.stop(timeout=self.ACTION_TIMEOUT_SECONDS, force=False)\n except TimeoutError:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n\n self._started = False\n self._state = LifecycleState.STOPPED\n return self._action_detail(\"runtime stopped\", timed_out=False)\n\n async def runtime_status(self) -> str:\n self._refresh_state()\n return self._state.value\n\n def _register_core_services(self) -> None:\n if self._core_registered:\n return\n self.services.register(\"configuration\", self.configuration)\n self.services.register(\"traces\", self.traces)\n self.services.register(\"health\", self.health)\n self.services.register(\"logs\", self.logs)\n self.services.register(\"workers\", self.workers)\n self.services.register(\"control_plane\", self.control_plane)\n self._core_registered = True\n\n def _register_health_contributors(self) -> None:\n for contributor in self.registry.health_contributors:\n self.health.register(contributor)\n\n def _register_workers(self) -> None:\n if self._workers_registered:\n return\n for worker in self.registry.workers:\n self.workers.register(worker)\n self._workers_registered = True\n\n def _refresh_state(self) -> None:\n lifecycle = self.workers.lifecycle_state()\n\n if self._state == LifecycleState.STOPPING:\n if lifecycle == LifecycleState.STOPPED:\n self._started = False\n self._state = LifecycleState.STOPPED\n return\n\n if not self._started:\n if lifecycle == LifecycleState.STOPPED:\n self._state = LifecycleState.STOPPED\n return\n\n self._state = lifecycle\n\n def _wait_for_state(self, target_states: set[LifecycleState], *, timeout: float) -> bool:\n deadline = monotonic() + timeout\n while monotonic() < deadline:\n self._refresh_state()\n if self._state in target_states:\n return True\n sleep(self.ACTION_POLL_INTERVAL_SECONDS)\n self._refresh_state()\n return self._state in target_states\n\n def _action_detail(self, message: str, *, timed_out: bool) -> dict[str, object]:\n self._refresh_state()\n return {\n \"message\": message,\n \"state\": self._state.value,\n \"timed_out\": timed_out,\n \"workers\": self.workers.snapshot(),\n }", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/core/runtime.py:RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.core.runtime", - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ] - }, - "diagnostics": { - "execution": { - "executed_layers": [ - "C4_SEMANTIC_ROLES", - "C3_ENTRYPOINTS", - "C2_DEPENDENCY_GRAPH", - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS" - ], - "retrieval_mode_by_layer": { - "C4_SEMANTIC_ROLES": "exact_path_fetch", - "C3_ENTRYPOINTS": "exact_path_fetch", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C1_SYMBOL_CATALOG": "symbol_search", - "C0_SOURCE_CHUNKS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C4_SEMANTIC_ROLES": 12, - "C3_ENTRYPOINTS": 8, - "C2_DEPENDENCY_GRAPH": 8, - "C1_SYMBOL_CATALOG": 6, - "C0_SOURCE_CHUNKS": 4 - }, - "filters_by_layer": { - "C4_SEMANTIC_ROLES": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C1_SYMBOL_CATALOG": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C4_SEMANTIC_ROLES", - "query": "Какие компоненты участвуют в RuntimeManager?", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 12, - "ranking_profile": "code" - }, - { - "layer": "C3_ENTRYPOINTS", - "query": "Какие компоненты участвуют в RuntimeManager?", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "Какие компоненты участвуют в RuntimeManager?", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C1_SYMBOL_CATALOG", - "query": "RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Какие компоненты участвуют в RuntimeManager?", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 4, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C4_SEMANTIC_ROLES", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 12, - "candidates_after_filter": 12 - }, - { - "layer": "C3_ENTRYPOINTS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 3, - "candidates_after_filter": 3 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 1, - "candidates_after_filter": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 4, - "candidates_after_filter": 4 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "RuntimeManager", - "alternatives": [ - "RuntimeManager" - ] - }, - "layers": [ - { - "layer": "C4_SEMANTIC_ROLES", - "status": "hit", - "hit_count": 12, - "fail_reason": null - }, - { - "layer": "C3_ENTRYPOINTS", - "status": "hit", - "hit_count": 3, - "fail_reason": null - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 8, - "fail_reason": null - }, - { - "layer": "C1_SYMBOL_CATALOG", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 1, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "symbol_resolution": 0, - "retrieval_total": 150, - "retrieval_by_layer": { - "C4_SEMANTIC_ROLES": 30, - "C3_ENTRYPOINTS": 16, - "C2_DEPENDENCY_GRAPH": 62, - "C1_SYMBOL_CATALOG": 24, - "C0_SOURCE_CHUNKS": 16 - }, - "merge_rank": 19 - } - } - }, - { - "step": "llm_answer", - "input": { - "query": "Какие компоненты участвуют в RuntimeManager?", - "rag_count": 25 - }, - "output": { - "llm_answer": "1. **Компоненты, которые подтверждены контекстом**:\n - RuntimeManager\n - ControlActionSet\n - ControlPlaneService\n \n2. **Подтверждённые связи между ними**:\n - RuntimeManager инициирует ControlPlaneService через его метод `__init__` (`ControlPlaneService.__init__:dataflow_slice`).\n - ControlPlaneService используется внутри RuntimeManager для управления данными потока (`ControlPlaneService._channels`, `ControlPlaneService._start_async`).\n \n3. **Границы ответственности, если они реально видны в коде**:\n - RuntimeManager отвечает за координацию и управление операциями, связанными с состоянием приложения и потоками данных. Он управляет конфигурацией и запуском.\n - ControlActionSet выступает в качестве модели, выполняющей стандартные действия или вызовы на основе поступающих запросов.\n - ControlPlaneService ответственен за инициализацию каналов и запуск асинхронных операций.\n\n4. **Что остаётся неизвестным или неполным**:\n - Не полностью раскрыто взаимодействие ControlActionSet с RuntimeManager относительно конкретных вызовов или событий.\n - Нет информации о точном взаимодействии с внешними сервисами или точными интерфейсами обмена данными между компонентами.\n - Непонятно, какие конкретно данные передаются между компонентами и как именно происходит обмен состояниями и событиями." - }, - "diagnostics": { - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 537, - "evidence_rows": 25, - "evidence_chars": 8651 - }, - "evidence_summary": [ - { - "layer": "C4_SEMANTIC_ROLES", - "count": 12, - "unique_paths": 11 - }, - { - "layer": "C3_ENTRYPOINTS", - "count": 3, - "unique_paths": 1 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "count": 8, - "unique_paths": 2 - }, - { - "layer": "C1_SYMBOL_CATALOG", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 1, - "unique_paths": 1 - } - ], - "prompt_template_id": "intent_code_qa_architecture_ru_v2", - "system_prompt_version": "v1" - }, - "timings_ms": { - "prompt_build": 0, - "llm_call": 2083 - } - } - } - ] - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_125536/full_chain_plba_code_subintents_v2_plba-v2-architecture-runtime-manager.md b/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_125536/full_chain_plba_code_subintents_v2_plba-v2-architecture-runtime-manager.md deleted file mode 100644 index d69ffd0..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_125536/full_chain_plba_code_subintents_v2_plba-v2-architecture-runtime-manager.md +++ /dev/null @@ -1,34 +0,0 @@ -# plba-v2-architecture-runtime-manager - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_subintents_v2.yaml -- runner: runtime -- mode: full_chain -- passed: True - -## Query -Какие компоненты участвуют в RuntimeManager? - -## Actual -{ - "intent": "CODE_QA", - "sub_intent": "ARCHITECTURE", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 25, - "llm_answer": "1. **Компоненты, которые подтверждены контекстом**:\n - RuntimeManager\n - ControlActionSet\n - ControlPlaneService\n \n2. **Подтверждённые связи между ними**:\n - RuntimeManager инициирует ControlPlaneService через его метод `__init__` (`ControlPlaneService.__init__:dataflow_slice`).\n - ControlPlaneService используется внутри RuntimeManager для управления данными потока (`ControlPlaneService._channels`, `ControlPlaneService._start_async`).\n \n3. **Границы ответственности, если они реально видны в коде**:\n - RuntimeManager отвечает за координацию и управление операциями, связанными с состоянием приложения и потоками данных. Он управляет конфигурацией и запуском.\n - ControlActionSet выступает в качестве модели, выполняющей стандартные действия или вызовы на основе поступающих запросов.\n - ControlPlaneService ответственен за инициализацию каналов и запуск асинхронных операций.\n\n4. **Что остаётся неизвестным или неполным**:\n - Не полностью раскрыто взаимодействие ControlActionSet с RuntimeManager относительно конкретных вызовов или событий.\n - Нет информации о точном взаимодействии с внешними сервисами или точными интерфейсами обмена данными между компонентами.\n - Непонятно, какие конкретно данные передаются между компонентами и как именно происходит обмен состояниями и событиями.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "RuntimeManager" - ], - "layers": [ - "C4_SEMANTIC_ROLES", - "C3_ENTRYPOINTS", - "C2_DEPENDENCY_GRAPH", - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS" - ] -} - -## Mismatches -- none \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_125536/full_chain_plba_code_subintents_v2_plba-v2-explain-create-runtime.json b/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_125536/full_chain_plba_code_subintents_v2_plba-v2-explain-create-runtime.json deleted file mode 100644 index c15f1be..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_125536/full_chain_plba_code_subintents_v2_plba-v2-explain-create-runtime.json +++ /dev/null @@ -1,1896 +0,0 @@ -{ - "case_id": "plba-v2-explain-create-runtime", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_subintents_v2.yaml", - "runner": "runtime", - "mode": "full_chain", - "actual": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 12, - "llm_answer": "1. **Что это и где определено.** \nСущность `create_runtime` определена в файле `src/plba/bootstrap.py`. Это функция, принимающая параметры конфигурации и создающая экземпляр класса `RuntimeManager`.\n\n2. **Назначение по наблюдаемому коду.** \nФункция создаёт и инициализирует объект `RuntimeManager`, добавляя в него файл конфигурации (`config_path`), канал управления HTTP (`enable_http_control`) и регистрируя переданный модуль приложения (`module`).\n\n3. **Подтверждённые зависимости или взаимодействия.** \nФункция взаимодействует с экземпляром `RuntimeManager` через методы `add_config_file`, `register_channel` и `register_module`.\n\n4. **Что делает по шагам, если это видно в контексте.** \n- Создаёт экземпляр объекта `RuntimeManager`.\n- Если передан параметр `config_path`, добавляет указанный файл конфигурации в менеджер.\n- Если включён режим HTTP-контроля, регистрирует соответствующий канал управления.\n- Регистрирует переданный модуль приложения.\n- Возвращает созданный экземпляр менеджера.\n\n5. **Осторожные выводы.** \nНа данный момент недостаточно информации о внутреннем устройстве объектов `RuntimeManager`, `HttpControlChannel` и других компонентов, участвующих в работе функции.\n\n6. **Чего не хватает для полного объяснения.** \nДля более глубокого понимания необходимо детализировать работу следующих сущностей:\n- Внутреннее устройство классов `RuntimeManager`, `HttpControlChannel`.\n- Механизм регистрации и использования конфигурационных файлов.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "create_runtime" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "passed": true, - "mismatches": [], - "details": { - "case_id": "plba-v2-explain-create-runtime", - "text": "Что делает функция create_runtime?", - "mode": "full_chain", - "run_started_at": "2026-03-12T12:55:37", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Что делает функция create_runtime?", - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "create_runtime", - "alternatives": [ - "create_runtime" - ], - "confidence": 0.99 - }, - "rag_count": 12, - "rag_rows": [ - { - "path": "src/plba/bootstrap.py", - "content": "function create_runtime\ncreate_runtime(module)", - "layer": "C1_SYMBOL_CATALOG", - "title": "create_runtime", - "span_start": 8, - "span_end": 29, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "qname": "create_runtime", - "kind": "function", - "signature": "create_runtime(module)", - "parent_symbol_id": null, - "package_or_module": "src.plba.bootstrap", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_runner.py", - "content": "UvicornThreadRunner\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (24)", - "layer": "C4_SEMANTIC_ROLES", - "title": "UvicornThreadRunner", - "span_start": 10, - "span_end": 61, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 11, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "fd55630045a02100df8877ac27d951ee08617d4598764394d48cb51fe067476a", - "symbol_name": "UvicornThreadRunner", - "qname": "UvicornThreadRunner", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 24, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "3779fdd2878b770e789a35bb2a89c9d79f13b61c26d7db1b3b683f9bb9e1623f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/bootstrap.py", - "content": "create_runtime calls runtime.add_config_file", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "create_runtime:calls", - "span_start": 19, - "span_end": 19, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "4eaeec4ac55a59d5f66fd01c4754955f8fedaf4bc3df13fa769b352c7bfaacbb", - "edge_type": "calls", - "src_symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "src_qname": "create_runtime", - "dst_symbol_id": null, - "dst_ref": "runtime.add_config_file", - "resolution": "partial", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/bootstrap.py", - "content": "create_runtime reads_attr runtime.register_module", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "create_runtime:reads_attr", - "span_start": 28, - "span_end": 28, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "45516c79ff358dbf9b650a081668df0f66d2fe989300f985a1a78be6be166f8f", - "edge_type": "reads_attr", - "src_symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "src_qname": "create_runtime", - "dst_symbol_id": null, - "dst_ref": "runtime.register_module", - "resolution": "partial", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/bootstrap.py", - "content": "create_runtime instantiates RuntimeManager", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "create_runtime:instantiates", - "span_start": 17, - "span_end": 17, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "0adba17984f850ea1608c9e734d2dd5c325cfde3a8133123aa239e44935ad18e", - "edge_type": "instantiates", - "src_symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "src_qname": "create_runtime", - "dst_symbol_id": "27158ca220022eeb5083c6addf8a50775d45f7161284fd60aac48410105f4b98", - "dst_ref": "RuntimeManager", - "resolution": "resolved", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/bootstrap.py", - "content": "create_runtime calls runtime.register_module", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "create_runtime:calls", - "span_start": 28, - "span_end": 28, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "ab6003c3441addc1ba1b81edeca009165559f652f6b2cf424e5ae61b1f617de8", - "edge_type": "calls", - "src_symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "src_qname": "create_runtime", - "dst_symbol_id": null, - "dst_ref": "runtime.register_module", - "resolution": "partial", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/bootstrap.py", - "content": "create_runtime calls runtime.control_plane.register_channel", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "create_runtime:calls", - "span_start": 21, - "span_end": 27, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "2678250030b9ce47a3b3b55fac7897ac530367edc8374ac9d5e6ecafb1e483f0", - "edge_type": "calls", - "src_symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "src_qname": "create_runtime", - "dst_symbol_id": null, - "dst_ref": "runtime.control_plane.register_channel", - "resolution": "partial", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/bootstrap.py", - "content": "create_runtime reads_attr runtime.add_config_file", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "create_runtime:reads_attr", - "span_start": 19, - "span_end": 19, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "30d4e8aae984ab84d523e80d02f1caeda52d547fa3d2aa47be8845931cabbca2", - "edge_type": "reads_attr", - "src_symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "src_qname": "create_runtime", - "dst_symbol_id": null, - "dst_ref": "runtime.add_config_file", - "resolution": "partial", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/bootstrap.py", - "content": "def create_runtime(\n module: ApplicationModule,\n *,\n config_path: str | None = None,\n enable_http_control: bool = False,\n control_host: str = \"127.0.0.1\",\n control_port: int = 8080,\n control_timeout: int = 5,\n) -> RuntimeManager:\n runtime = RuntimeManager()\n if config_path is not None:\n runtime.add_config_file(config_path)\n if enable_http_control:\n runtime.control_plane.register_channel(\n HttpControlChannel(\n host=control_host,\n port=control_port,\n timeout=control_timeout,\n )\n )\n runtime.register_module(module)\n return runtime", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/plba/bootstrap.py:create_runtime", - "span_start": 8, - "span_end": 29, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.plba.bootstrap", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "llm_answer": "1. **Что это и где определено.** \nСущность `create_runtime` определена в файле `src/plba/bootstrap.py`. Это функция, принимающая параметры конфигурации и создающая экземпляр класса `RuntimeManager`.\n\n2. **Назначение по наблюдаемому коду.** \nФункция создаёт и инициализирует объект `RuntimeManager`, добавляя в него файл конфигурации (`config_path`), канал управления HTTP (`enable_http_control`) и регистрируя переданный модуль приложения (`module`).\n\n3. **Подтверждённые зависимости или взаимодействия.** \nФункция взаимодействует с экземпляром `RuntimeManager` через методы `add_config_file`, `register_channel` и `register_module`.\n\n4. **Что делает по шагам, если это видно в контексте.** \n- Создаёт экземпляр объекта `RuntimeManager`.\n- Если передан параметр `config_path`, добавляет указанный файл конфигурации в менеджер.\n- Если включён режим HTTP-контроля, регистрирует соответствующий канал управления.\n- Регистрирует переданный модуль приложения.\n- Возвращает созданный экземпляр менеджера.\n\n5. **Осторожные выводы.** \nНа данный момент недостаточно информации о внутреннем устройстве объектов `RuntimeManager`, `HttpControlChannel` и других компонентов, участвующих в работе функции.\n\n6. **Чего не хватает для полного объяснения.** \nДля более глубокого понимания необходимо детализировать работу следующих сущностей:\n- Внутреннее устройство классов `RuntimeManager`, `HttpControlChannel`.\n- Механизм регистрации и использования конфигурационных файлов.", - "summary": { - "router": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "confidence": null - }, - "retrieval": { - "profile": "code", - "layers_hit": [ - "C0_SOURCE_CHUNKS", - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS", - "C4_SEMANTIC_ROLES" - ], - "evidence_sufficient": true - }, - "llm": { - "answer_status": "answered", - "groundedness": "grounded" - } - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "symbol_kind_hint": "function", - "symbol_candidates": [ - "create_runtime" - ], - "keyword_hints": [ - "create_runtime" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C0_SOURCE_CHUNKS": "exact_path_fetch", - "C4_SEMANTIC_ROLES": "exact_path_fetch", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C3_ENTRYPOINTS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 8, - "C4_SEMANTIC_ROLES": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C3_ENTRYPOINTS": 6 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C4_SEMANTIC_ROLES": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "create_runtime", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "create_runtime", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C4_SEMANTIC_ROLES", - "query": "create_runtime", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "create_runtime", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - }, - { - "layer": "C3_ENTRYPOINTS", - "query": "create_runtime", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 1, - "candidates_after_filter": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 6, - "candidates_after_filter": 6 - }, - { - "layer": "C3_ENTRYPOINTS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 3, - "candidates_after_filter": 3 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "create_runtime", - "alternatives": [ - "create_runtime" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C4_SEMANTIC_ROLES", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 6, - "fail_reason": null - }, - { - "layer": "C3_ENTRYPOINTS", - "status": "hit", - "hit_count": 3, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "router": 0, - "symbol_resolution": 0, - "retrieval_total": 133, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 39, - "C0_SOURCE_CHUNKS": 17, - "C4_SEMANTIC_ROLES": 18, - "C2_DEPENDENCY_GRAPH": 47, - "C3_ENTRYPOINTS": 10 - }, - "merge_rank": 18, - "prompt_build": 0, - "llm_call": 2417 - }, - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 659, - "evidence_rows": 12, - "evidence_chars": 1184 - }, - "evidence_summary": [ - { - "layer": "C1_SYMBOL_CATALOG", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "count": 6, - "unique_paths": 1 - }, - { - "layer": "C3_ENTRYPOINTS", - "count": 3, - "unique_paths": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 1, - "unique_paths": 1 - } - ], - "prompt_template_id": "intent_code_qa_explain_ru_v2", - "system_prompt_version": "v1" - }, - "router": { - "conversation_mode": "START", - "keyword_hints": [ - "create_runtime" - ], - "path_scope": [] - }, - "llm": { - "used_evidence_count": 12, - "missing_evidence_reason": null - } - }, - "run_info": { - "case_id": "plba-v2-explain-create-runtime", - "mode": "full_chain", - "run_started_at": "2026-03-12T12:55:37", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - }, - "input_request": { - "text": "Что делает функция create_runtime?", - "normalized_query": "Что делает функция create_runtime?" - }, - "steps": [ - { - "step": "intent_router", - "input": { - "query": "Что делает функция create_runtime?" - }, - "output": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Что делает функция create_runtime?" - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "symbol_kind_hint": "function", - "symbol_candidates": [ - "create_runtime" - ], - "keyword_hints": [ - "create_runtime" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "timings_ms": { - "router": 0 - } - } - }, - { - "step": "retrieval", - "input": { - "query": "Что делает функция create_runtime?" - }, - "output": { - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "create_runtime", - "alternatives": [ - "create_runtime" - ], - "confidence": 0.99 - }, - "rag_count": 12, - "rag_rows": [ - { - "path": "src/plba/bootstrap.py", - "content": "function create_runtime\ncreate_runtime(module)", - "layer": "C1_SYMBOL_CATALOG", - "title": "create_runtime", - "span_start": 8, - "span_end": 29, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "qname": "create_runtime", - "kind": "function", - "signature": "create_runtime(module)", - "parent_symbol_id": null, - "package_or_module": "src.plba.bootstrap", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_runner.py", - "content": "UvicornThreadRunner\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (24)", - "layer": "C4_SEMANTIC_ROLES", - "title": "UvicornThreadRunner", - "span_start": 10, - "span_end": 61, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 11, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "fd55630045a02100df8877ac27d951ee08617d4598764394d48cb51fe067476a", - "symbol_name": "UvicornThreadRunner", - "qname": "UvicornThreadRunner", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 24, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "3779fdd2878b770e789a35bb2a89c9d79f13b61c26d7db1b3b683f9bb9e1623f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/bootstrap.py", - "content": "create_runtime calls runtime.add_config_file", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "create_runtime:calls", - "span_start": 19, - "span_end": 19, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "4eaeec4ac55a59d5f66fd01c4754955f8fedaf4bc3df13fa769b352c7bfaacbb", - "edge_type": "calls", - "src_symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "src_qname": "create_runtime", - "dst_symbol_id": null, - "dst_ref": "runtime.add_config_file", - "resolution": "partial", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/bootstrap.py", - "content": "create_runtime reads_attr runtime.register_module", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "create_runtime:reads_attr", - "span_start": 28, - "span_end": 28, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "45516c79ff358dbf9b650a081668df0f66d2fe989300f985a1a78be6be166f8f", - "edge_type": "reads_attr", - "src_symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "src_qname": "create_runtime", - "dst_symbol_id": null, - "dst_ref": "runtime.register_module", - "resolution": "partial", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/bootstrap.py", - "content": "create_runtime instantiates RuntimeManager", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "create_runtime:instantiates", - "span_start": 17, - "span_end": 17, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "0adba17984f850ea1608c9e734d2dd5c325cfde3a8133123aa239e44935ad18e", - "edge_type": "instantiates", - "src_symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "src_qname": "create_runtime", - "dst_symbol_id": "27158ca220022eeb5083c6addf8a50775d45f7161284fd60aac48410105f4b98", - "dst_ref": "RuntimeManager", - "resolution": "resolved", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/bootstrap.py", - "content": "create_runtime calls runtime.register_module", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "create_runtime:calls", - "span_start": 28, - "span_end": 28, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "ab6003c3441addc1ba1b81edeca009165559f652f6b2cf424e5ae61b1f617de8", - "edge_type": "calls", - "src_symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "src_qname": "create_runtime", - "dst_symbol_id": null, - "dst_ref": "runtime.register_module", - "resolution": "partial", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/bootstrap.py", - "content": "create_runtime calls runtime.control_plane.register_channel", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "create_runtime:calls", - "span_start": 21, - "span_end": 27, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "2678250030b9ce47a3b3b55fac7897ac530367edc8374ac9d5e6ecafb1e483f0", - "edge_type": "calls", - "src_symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "src_qname": "create_runtime", - "dst_symbol_id": null, - "dst_ref": "runtime.control_plane.register_channel", - "resolution": "partial", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/bootstrap.py", - "content": "create_runtime reads_attr runtime.add_config_file", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "create_runtime:reads_attr", - "span_start": 19, - "span_end": 19, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "30d4e8aae984ab84d523e80d02f1caeda52d547fa3d2aa47be8845931cabbca2", - "edge_type": "reads_attr", - "src_symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "src_qname": "create_runtime", - "dst_symbol_id": null, - "dst_ref": "runtime.add_config_file", - "resolution": "partial", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/bootstrap.py", - "content": "def create_runtime(\n module: ApplicationModule,\n *,\n config_path: str | None = None,\n enable_http_control: bool = False,\n control_host: str = \"127.0.0.1\",\n control_port: int = 8080,\n control_timeout: int = 5,\n) -> RuntimeManager:\n runtime = RuntimeManager()\n if config_path is not None:\n runtime.add_config_file(config_path)\n if enable_http_control:\n runtime.control_plane.register_channel(\n HttpControlChannel(\n host=control_host,\n port=control_port,\n timeout=control_timeout,\n )\n )\n runtime.register_module(module)\n return runtime", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/plba/bootstrap.py:create_runtime", - "span_start": 8, - "span_end": 29, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.plba.bootstrap", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ] - }, - "diagnostics": { - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C0_SOURCE_CHUNKS": "exact_path_fetch", - "C4_SEMANTIC_ROLES": "exact_path_fetch", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C3_ENTRYPOINTS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 8, - "C4_SEMANTIC_ROLES": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C3_ENTRYPOINTS": 6 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C4_SEMANTIC_ROLES": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "create_runtime", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "create_runtime", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C4_SEMANTIC_ROLES", - "query": "create_runtime", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "create_runtime", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - }, - { - "layer": "C3_ENTRYPOINTS", - "query": "create_runtime", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 1, - "candidates_after_filter": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 6, - "candidates_after_filter": 6 - }, - { - "layer": "C3_ENTRYPOINTS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 3, - "candidates_after_filter": 3 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "create_runtime", - "alternatives": [ - "create_runtime" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C4_SEMANTIC_ROLES", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 6, - "fail_reason": null - }, - { - "layer": "C3_ENTRYPOINTS", - "status": "hit", - "hit_count": 3, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "symbol_resolution": 0, - "retrieval_total": 133, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 39, - "C0_SOURCE_CHUNKS": 17, - "C4_SEMANTIC_ROLES": 18, - "C2_DEPENDENCY_GRAPH": 47, - "C3_ENTRYPOINTS": 10 - }, - "merge_rank": 18 - } - } - }, - { - "step": "llm_answer", - "input": { - "query": "Что делает функция create_runtime?", - "rag_count": 12 - }, - "output": { - "llm_answer": "1. **Что это и где определено.** \nСущность `create_runtime` определена в файле `src/plba/bootstrap.py`. Это функция, принимающая параметры конфигурации и создающая экземпляр класса `RuntimeManager`.\n\n2. **Назначение по наблюдаемому коду.** \nФункция создаёт и инициализирует объект `RuntimeManager`, добавляя в него файл конфигурации (`config_path`), канал управления HTTP (`enable_http_control`) и регистрируя переданный модуль приложения (`module`).\n\n3. **Подтверждённые зависимости или взаимодействия.** \nФункция взаимодействует с экземпляром `RuntimeManager` через методы `add_config_file`, `register_channel` и `register_module`.\n\n4. **Что делает по шагам, если это видно в контексте.** \n- Создаёт экземпляр объекта `RuntimeManager`.\n- Если передан параметр `config_path`, добавляет указанный файл конфигурации в менеджер.\n- Если включён режим HTTP-контроля, регистрирует соответствующий канал управления.\n- Регистрирует переданный модуль приложения.\n- Возвращает созданный экземпляр менеджера.\n\n5. **Осторожные выводы.** \nНа данный момент недостаточно информации о внутреннем устройстве объектов `RuntimeManager`, `HttpControlChannel` и других компонентов, участвующих в работе функции.\n\n6. **Чего не хватает для полного объяснения.** \nДля более глубокого понимания необходимо детализировать работу следующих сущностей:\n- Внутреннее устройство классов `RuntimeManager`, `HttpControlChannel`.\n- Механизм регистрации и использования конфигурационных файлов." - }, - "diagnostics": { - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 659, - "evidence_rows": 12, - "evidence_chars": 1184 - }, - "evidence_summary": [ - { - "layer": "C1_SYMBOL_CATALOG", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "count": 6, - "unique_paths": 1 - }, - { - "layer": "C3_ENTRYPOINTS", - "count": 3, - "unique_paths": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 1, - "unique_paths": 1 - } - ], - "prompt_template_id": "intent_code_qa_explain_ru_v2", - "system_prompt_version": "v1" - }, - "timings_ms": { - "prompt_build": 0, - "llm_call": 2417 - } - } - } - ] - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_125536/full_chain_plba_code_subintents_v2_plba-v2-explain-create-runtime.md b/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_125536/full_chain_plba_code_subintents_v2_plba-v2-explain-create-runtime.md deleted file mode 100644 index e48b5b9..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_125536/full_chain_plba_code_subintents_v2_plba-v2-explain-create-runtime.md +++ /dev/null @@ -1,34 +0,0 @@ -# plba-v2-explain-create-runtime - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_subintents_v2.yaml -- runner: runtime -- mode: full_chain -- passed: True - -## Query -Что делает функция create_runtime? - -## Actual -{ - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 12, - "llm_answer": "1. **Что это и где определено.** \nСущность `create_runtime` определена в файле `src/plba/bootstrap.py`. Это функция, принимающая параметры конфигурации и создающая экземпляр класса `RuntimeManager`.\n\n2. **Назначение по наблюдаемому коду.** \nФункция создаёт и инициализирует объект `RuntimeManager`, добавляя в него файл конфигурации (`config_path`), канал управления HTTP (`enable_http_control`) и регистрируя переданный модуль приложения (`module`).\n\n3. **Подтверждённые зависимости или взаимодействия.** \nФункция взаимодействует с экземпляром `RuntimeManager` через методы `add_config_file`, `register_channel` и `register_module`.\n\n4. **Что делает по шагам, если это видно в контексте.** \n- Создаёт экземпляр объекта `RuntimeManager`.\n- Если передан параметр `config_path`, добавляет указанный файл конфигурации в менеджер.\n- Если включён режим HTTP-контроля, регистрирует соответствующий канал управления.\n- Регистрирует переданный модуль приложения.\n- Возвращает созданный экземпляр менеджера.\n\n5. **Осторожные выводы.** \nНа данный момент недостаточно информации о внутреннем устройстве объектов `RuntimeManager`, `HttpControlChannel` и других компонентов, участвующих в работе функции.\n\n6. **Чего не хватает для полного объяснения.** \nДля более глубокого понимания необходимо детализировать работу следующих сущностей:\n- Внутреннее устройство классов `RuntimeManager`, `HttpControlChannel`.\n- Механизм регистрации и использования конфигурационных файлов.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "create_runtime" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] -} - -## Mismatches -- none \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_125536/full_chain_plba_code_subintents_v2_plba-v2-explain-local-http-channel.json b/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_125536/full_chain_plba_code_subintents_v2_plba-v2-explain-local-http-channel.json deleted file mode 100644 index af801c5..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_125536/full_chain_plba_code_subintents_v2_plba-v2-explain-local-http-channel.json +++ /dev/null @@ -1,1333 +0,0 @@ -{ - "case_id": "plba-v2-explain-local-http-channel", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_subintents_v2.yaml", - "runner": "runtime", - "mode": "full_chain", - "actual": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN_LOCAL", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 6, - "llm_answer": "Класс `HttpControlChannel` из файла `src/app_runtime/control/http_channel.py` реализует HTTP канал управления для взаимодействия с внешним миром через HTTP протокол.\n\n### Что делает класс:\n1. **Инициализация (`__init__`)**:\n - Принимает параметры `host`, `port` и `timeout`.\n - Создаёт объект `UvicornThreadRunner` (асинхронный веб-сервер), который будет слушать указанный порт.\n - Инициализирует фабрику приложений `HttpControlAppFactory()` для создания приложения HTTP.\n - Сохраняет значение тайм-аута (`_timeout`), но само управление действиями (`_actions`) инициализируется как `None`.\n\n2. **Запуск (`start`)**:\n - Запускает веб-сервер с приложением, созданным фабрикой.\n - Перед запуском проверяет наличие настроенных действий (`_actions`). Если они отсутствуют, возвращает сообщение об ошибке.\n - Возвращает результат вызова метода `_actions.health()`, ожидая его до истечения тайм-аута.\n\n3. **Остановка (`stop`)**:\n - Останавливает веб-сервер.\n\n4. **Получение порта (`port`)**:\n - Возврашает номер порта, на котором работает сервер.\n\n5. **Ответы на запросы управления (`_health_response`, `_action_response`)**:\n - Метод `_health_response` отвечает за проверку состояния системы. Он проверяет настройку действий, а затем вызывает метод health действия, возвращая результат.\n - Метод `_action_response` обрабатывает конкретные команды управления, передаваемые клиентом. Проверяет наличие настроенного обработчика действия, и возвращает соответствующий JSON-ответ.\n\n### Входные данные:\n- Параметры конструктора: `host`, `port`, `timeout`.\n- Настройки конфигурируемых действий (`ControlActionSet`).\n\n### Выходные данные:\n- Номер порта, на котором запущен сервер.\n- Ответы на запросы о состоянии системы и конкретные команды управления.\n\nТаким образом, класс управляет асинхронной работой HTTP-сервера, настраивает обработку запросов и отвечает за состояние и выполнение конкретных команд управления системой.", - "answer_mode": "answered", - "path_scope": [ - "src/app_runtime/control/http_channel.py" - ], - "symbol_candidates": [ - "HttpControlChannel" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C2_DEPENDENCY_GRAPH" - ] - }, - "passed": true, - "mismatches": [], - "details": { - "case_id": "plba-v2-explain-local-http-channel", - "text": "Почему в файле src/app_runtime/control/http_channel.py класс HttpControlChannel устроен так?", - "mode": "full_chain", - "run_started_at": "2026-03-12T12:55:37", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Почему в файле src/app_runtime/control/http_channel.py класс HttpControlChannel устроен так?", - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "HttpControlChannel", - "alternatives": [ - "HttpControlChannel" - ], - "confidence": 0.99 - }, - "rag_count": 6, - "rag_rows": [ - { - "path": "src/app_runtime/control/http_channel.py", - "content": "class HttpControlChannel\nHttpControlChannel(ControlChannel)", - "layer": "C1_SYMBOL_CATALOG", - "title": "HttpControlChannel", - "span_start": 12, - "span_end": 57, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "1c9fbdc24819e5604c26ea55428a74310f03a03e1af197ed84846af61e42fdb0", - "qname": "HttpControlChannel", - "kind": "class", - "signature": "HttpControlChannel(ControlChannel)", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.control.http_channel", - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel.__init__\n -> HttpControlChannel._timeout\n -> HttpControlChannel._action_response", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "HttpControlChannel.__init__:dataflow_slice", - "span_start": 14, - "span_end": 47, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "c3ef21fcae96c82c00be74b3ab827d4af2085d89cb3fa5521c19a174aad84dbb", - "edge_type": "dataflow_slice", - "src_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "src_qname": "HttpControlChannel.__init__", - "dst_symbol_id": "e64969024ccaeb34d8d91473fad07b3b3d341875846392e7a006406c7ada1954", - "dst_ref": "HttpControlChannel._action_response", - "resolution": "resolved", - "slice_id": "c3ef21fcae96c82c00be74b3ab827d4af2085d89cb3fa5521c19a174aad84dbb", - "root_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "path_symbols": [ - "HttpControlChannel.__init__", - "HttpControlChannel._timeout", - "HttpControlChannel._action_response" - ], - "path_symbol_ids": [ - "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "e64969024ccaeb34d8d91473fad07b3b3d341875846392e7a006406c7ada1954" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel.__init__\n -> HttpControlChannel._runner\n -> HttpControlChannel.start", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "HttpControlChannel.__init__:dataflow_slice", - "span_start": 15, - "span_end": 22, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "51d73913df709152258ed1b9a8c8f4eb3c575eccfe6b982aef0b28e0789a29da", - "edge_type": "dataflow_slice", - "src_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "src_qname": "HttpControlChannel.__init__", - "dst_symbol_id": "d1933f04137f52535b6525f1b93ff2cd83bfb216b480e887e791ed1714cda8e0", - "dst_ref": "HttpControlChannel.start", - "resolution": "resolved", - "slice_id": "51d73913df709152258ed1b9a8c8f4eb3c575eccfe6b982aef0b28e0789a29da", - "root_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "path_symbols": [ - "HttpControlChannel.__init__", - "HttpControlChannel._runner", - "HttpControlChannel.start" - ], - "path_symbol_ids": [ - "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "d1933f04137f52535b6525f1b93ff2cd83bfb216b480e887e791ed1714cda8e0" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel.__init__\n -> HttpControlChannel._timeout\n -> HttpControlChannel._health_response", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "HttpControlChannel.__init__:dataflow_slice", - "span_start": 14, - "span_end": 34, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "f858f5c9e575f6c4cdfe3853571b7ee21d1f628a443541d2037c3dc9d0790bef", - "edge_type": "dataflow_slice", - "src_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "src_qname": "HttpControlChannel.__init__", - "dst_symbol_id": "e84bf04e9cd2127df235b7064d05f47e19f19a89c7c82f4c247231d4e8fa426a", - "dst_ref": "HttpControlChannel._health_response", - "resolution": "resolved", - "slice_id": "f858f5c9e575f6c4cdfe3853571b7ee21d1f628a443541d2037c3dc9d0790bef", - "root_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "path_symbols": [ - "HttpControlChannel.__init__", - "HttpControlChannel._timeout", - "HttpControlChannel._health_response" - ], - "path_symbol_ids": [ - "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "e84bf04e9cd2127df235b7064d05f47e19f19a89c7c82f4c247231d4e8fa426a" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel.__init__\n -> HttpControlChannel._runner\n -> HttpControlChannel.stop", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "HttpControlChannel.__init__:dataflow_slice", - "span_start": 15, - "span_end": 25, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "0f827ef81a990258a8a74381c8564a8361afa6712dba3200592659c939adcb9d", - "edge_type": "dataflow_slice", - "src_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "src_qname": "HttpControlChannel.__init__", - "dst_symbol_id": "f29ab212620093d72be20e26c5a399624c7939a6056a728762ed3f84a250bfa3", - "dst_ref": "HttpControlChannel.stop", - "resolution": "resolved", - "slice_id": "0f827ef81a990258a8a74381c8564a8361afa6712dba3200592659c939adcb9d", - "root_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "path_symbols": [ - "HttpControlChannel.__init__", - "HttpControlChannel._runner", - "HttpControlChannel.stop" - ], - "path_symbol_ids": [ - "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "f29ab212620093d72be20e26c5a399624c7939a6056a728762ed3f84a250bfa3" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "class HttpControlChannel(ControlChannel):\n def __init__(self, host: str, port: int, timeout: int) -> None:\n self._timeout = timeout\n self._runner = UvicornThreadRunner(host, port, timeout)\n self._factory = HttpControlAppFactory()\n self._actions: ControlActionSet | None = None\n\n async def start(self, actions: ControlActionSet) -> None:\n self._actions = actions\n app = self._factory.create(self._health_response, self._action_response)\n await self._runner.start(app)\n\n async def stop(self) -> None:\n await self._runner.stop()\n\n @property\n def port(self) -> int:\n return self._runner.port\n\n async def _health_response(self) -> dict[str, object]:\n if self._actions is None:\n return {\"status\": \"unhealthy\", \"detail\": \"control actions are not configured\"}\n return await asyncio.wait_for(self._actions.health(), timeout=float(self._timeout))\n\n async def _action_response(self, action: str, _client_source: str = \"unknown\") -> JSONResponse:\n if self._actions is None:\n return JSONResponse(content={\"status\": \"error\", \"detail\": f\"{action} handler is not configured\"}, status_code=404)\n callbacks = {\n \"start\": self._actions.start,\n \"stop\": self._actions.stop,\n \"status\": self._actions.status,\n }\n callback = callbacks.get(action)\n if callback is None:\n return JSONResponse(content={\"status\": \"error\", \"detail\": f\"unsupported action: {action}\"}, status_code=404)\n action_timeout = max(float(self._timeout), 10.0) if action in {\"start\", \"stop\"} else float(self._timeout)\n try:\n detail = await asyncio.wait_for(callback(), timeout=action_timeout)\n except asyncio.TimeoutError:\n return JSONResponse(\n content={\"status\": \"accepted\", \"detail\": f\"{action} operation is still in progress\"},\n status_code=202,\n )\n except Exception as exc:\n return JSONResponse(content={\"status\": \"error\", \"detail\": str(exc)}, status_code=500)\n return JSONResponse(content={\"status\": \"ok\", \"detail\": detail or f\"{action} action accepted\"}, status_code=200)", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/http_channel.py:HttpControlChannel", - "span_start": 12, - "span_end": 57, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.http_channel", - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "llm_answer": "Класс `HttpControlChannel` из файла `src/app_runtime/control/http_channel.py` реализует HTTP канал управления для взаимодействия с внешним миром через HTTP протокол.\n\n### Что делает класс:\n1. **Инициализация (`__init__`)**:\n - Принимает параметры `host`, `port` и `timeout`.\n - Создаёт объект `UvicornThreadRunner` (асинхронный веб-сервер), который будет слушать указанный порт.\n - Инициализирует фабрику приложений `HttpControlAppFactory()` для создания приложения HTTP.\n - Сохраняет значение тайм-аута (`_timeout`), но само управление действиями (`_actions`) инициализируется как `None`.\n\n2. **Запуск (`start`)**:\n - Запускает веб-сервер с приложением, созданным фабрикой.\n - Перед запуском проверяет наличие настроенных действий (`_actions`). Если они отсутствуют, возвращает сообщение об ошибке.\n - Возвращает результат вызова метода `_actions.health()`, ожидая его до истечения тайм-аута.\n\n3. **Остановка (`stop`)**:\n - Останавливает веб-сервер.\n\n4. **Получение порта (`port`)**:\n - Возврашает номер порта, на котором работает сервер.\n\n5. **Ответы на запросы управления (`_health_response`, `_action_response`)**:\n - Метод `_health_response` отвечает за проверку состояния системы. Он проверяет настройку действий, а затем вызывает метод health действия, возвращая результат.\n - Метод `_action_response` обрабатывает конкретные команды управления, передаваемые клиентом. Проверяет наличие настроенного обработчика действия, и возвращает соответствующий JSON-ответ.\n\n### Входные данные:\n- Параметры конструктора: `host`, `port`, `timeout`.\n- Настройки конфигурируемых действий (`ControlActionSet`).\n\n### Выходные данные:\n- Номер порта, на котором запущен сервер.\n- Ответы на запросы о состоянии системы и конкретные команды управления.\n\nТаким образом, класс управляет асинхронной работой HTTP-сервера, настраивает обработку запросов и отвечает за состояние и выполнение конкретных команд управления системой.", - "summary": { - "router": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN_LOCAL", - "confidence": null - }, - "retrieval": { - "profile": "code", - "layers_hit": [ - "C0_SOURCE_CHUNKS", - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH" - ], - "evidence_sufficient": true - }, - "llm": { - "answer_status": "answered", - "groundedness": "grounded" - } - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN_LOCAL", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C2_DEPENDENCY_GRAPH" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "HttpControlChannel" - ], - "keyword_hints": [ - "src/app_runtime/control/http_channel.py", - "HttpControlChannel" - ], - "path_hints": [ - "src/app_runtime/control/http_channel.py" - ], - "path_scope": [ - "src/app_runtime/control/http_channel.py" - ], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C2_DEPENDENCY_GRAPH" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C0_SOURCE_CHUNKS": "exact_path_fetch", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 12, - "C2_DEPENDENCY_GRAPH": 4 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [ - "src/app_runtime/control/http_channel.py" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src/app_runtime/control/http_channel.py" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src/app_runtime/control/http_channel.py" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "HttpControlChannel", - "path_scope": [ - "src/app_runtime/control/http_channel.py" - ], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Почему в файле src/app_runtime/control/http_channel.py класс HttpControlChannel устроен так?", - "path_scope": [ - "src/app_runtime/control/http_channel.py" - ], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 12, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "Почему в файле src/app_runtime/control/http_channel.py класс HttpControlChannel устроен так?", - "path_scope": [ - "src/app_runtime/control/http_channel.py" - ], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 4, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [ - "src/app_runtime/control/http_channel.py" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 1, - "candidates_after_filter": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src/app_runtime/control/http_channel.py" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 1, - "candidates_after_filter": 1 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src/app_runtime/control/http_channel.py" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 4, - "candidates_after_filter": 4 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "HttpControlChannel", - "alternatives": [ - "HttpControlChannel" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 4, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "router": 0, - "symbol_resolution": 0, - "retrieval_total": 74, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 35, - "C0_SOURCE_CHUNKS": 17, - "C2_DEPENDENCY_GRAPH": 21 - }, - "merge_rank": 21, - "prompt_build": 0, - "llm_call": 3383 - }, - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 851, - "evidence_rows": 6, - "evidence_chars": 2660 - }, - "evidence_summary": [ - { - "layer": "C1_SYMBOL_CATALOG", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "count": 4, - "unique_paths": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 1, - "unique_paths": 1 - } - ], - "prompt_template_id": "intent_code_qa_explain_local_ru_v2", - "system_prompt_version": "v1" - }, - "router": { - "conversation_mode": "START", - "keyword_hints": [ - "src/app_runtime/control/http_channel.py", - "HttpControlChannel" - ], - "path_scope": [ - "src/app_runtime/control/http_channel.py" - ] - }, - "llm": { - "used_evidence_count": 6, - "missing_evidence_reason": null - } - }, - "run_info": { - "case_id": "plba-v2-explain-local-http-channel", - "mode": "full_chain", - "run_started_at": "2026-03-12T12:55:37", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - }, - "input_request": { - "text": "Почему в файле src/app_runtime/control/http_channel.py класс HttpControlChannel устроен так?", - "normalized_query": "Почему в файле src/app_runtime/control/http_channel.py класс HttpControlChannel устроен так?" - }, - "steps": [ - { - "step": "intent_router", - "input": { - "query": "Почему в файле src/app_runtime/control/http_channel.py класс HttpControlChannel устроен так?" - }, - "output": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Почему в файле src/app_runtime/control/http_channel.py класс HttpControlChannel устроен так?" - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN_LOCAL", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C2_DEPENDENCY_GRAPH" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "HttpControlChannel" - ], - "keyword_hints": [ - "src/app_runtime/control/http_channel.py", - "HttpControlChannel" - ], - "path_hints": [ - "src/app_runtime/control/http_channel.py" - ], - "path_scope": [ - "src/app_runtime/control/http_channel.py" - ], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "timings_ms": { - "router": 0 - } - } - }, - { - "step": "retrieval", - "input": { - "query": "Почему в файле src/app_runtime/control/http_channel.py класс HttpControlChannel устроен так?" - }, - "output": { - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "HttpControlChannel", - "alternatives": [ - "HttpControlChannel" - ], - "confidence": 0.99 - }, - "rag_count": 6, - "rag_rows": [ - { - "path": "src/app_runtime/control/http_channel.py", - "content": "class HttpControlChannel\nHttpControlChannel(ControlChannel)", - "layer": "C1_SYMBOL_CATALOG", - "title": "HttpControlChannel", - "span_start": 12, - "span_end": 57, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "1c9fbdc24819e5604c26ea55428a74310f03a03e1af197ed84846af61e42fdb0", - "qname": "HttpControlChannel", - "kind": "class", - "signature": "HttpControlChannel(ControlChannel)", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.control.http_channel", - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel.__init__\n -> HttpControlChannel._timeout\n -> HttpControlChannel._action_response", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "HttpControlChannel.__init__:dataflow_slice", - "span_start": 14, - "span_end": 47, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "c3ef21fcae96c82c00be74b3ab827d4af2085d89cb3fa5521c19a174aad84dbb", - "edge_type": "dataflow_slice", - "src_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "src_qname": "HttpControlChannel.__init__", - "dst_symbol_id": "e64969024ccaeb34d8d91473fad07b3b3d341875846392e7a006406c7ada1954", - "dst_ref": "HttpControlChannel._action_response", - "resolution": "resolved", - "slice_id": "c3ef21fcae96c82c00be74b3ab827d4af2085d89cb3fa5521c19a174aad84dbb", - "root_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "path_symbols": [ - "HttpControlChannel.__init__", - "HttpControlChannel._timeout", - "HttpControlChannel._action_response" - ], - "path_symbol_ids": [ - "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "e64969024ccaeb34d8d91473fad07b3b3d341875846392e7a006406c7ada1954" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel.__init__\n -> HttpControlChannel._runner\n -> HttpControlChannel.start", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "HttpControlChannel.__init__:dataflow_slice", - "span_start": 15, - "span_end": 22, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "51d73913df709152258ed1b9a8c8f4eb3c575eccfe6b982aef0b28e0789a29da", - "edge_type": "dataflow_slice", - "src_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "src_qname": "HttpControlChannel.__init__", - "dst_symbol_id": "d1933f04137f52535b6525f1b93ff2cd83bfb216b480e887e791ed1714cda8e0", - "dst_ref": "HttpControlChannel.start", - "resolution": "resolved", - "slice_id": "51d73913df709152258ed1b9a8c8f4eb3c575eccfe6b982aef0b28e0789a29da", - "root_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "path_symbols": [ - "HttpControlChannel.__init__", - "HttpControlChannel._runner", - "HttpControlChannel.start" - ], - "path_symbol_ids": [ - "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "d1933f04137f52535b6525f1b93ff2cd83bfb216b480e887e791ed1714cda8e0" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel.__init__\n -> HttpControlChannel._timeout\n -> HttpControlChannel._health_response", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "HttpControlChannel.__init__:dataflow_slice", - "span_start": 14, - "span_end": 34, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "f858f5c9e575f6c4cdfe3853571b7ee21d1f628a443541d2037c3dc9d0790bef", - "edge_type": "dataflow_slice", - "src_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "src_qname": "HttpControlChannel.__init__", - "dst_symbol_id": "e84bf04e9cd2127df235b7064d05f47e19f19a89c7c82f4c247231d4e8fa426a", - "dst_ref": "HttpControlChannel._health_response", - "resolution": "resolved", - "slice_id": "f858f5c9e575f6c4cdfe3853571b7ee21d1f628a443541d2037c3dc9d0790bef", - "root_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "path_symbols": [ - "HttpControlChannel.__init__", - "HttpControlChannel._timeout", - "HttpControlChannel._health_response" - ], - "path_symbol_ids": [ - "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "e84bf04e9cd2127df235b7064d05f47e19f19a89c7c82f4c247231d4e8fa426a" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel.__init__\n -> HttpControlChannel._runner\n -> HttpControlChannel.stop", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "HttpControlChannel.__init__:dataflow_slice", - "span_start": 15, - "span_end": 25, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "0f827ef81a990258a8a74381c8564a8361afa6712dba3200592659c939adcb9d", - "edge_type": "dataflow_slice", - "src_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "src_qname": "HttpControlChannel.__init__", - "dst_symbol_id": "f29ab212620093d72be20e26c5a399624c7939a6056a728762ed3f84a250bfa3", - "dst_ref": "HttpControlChannel.stop", - "resolution": "resolved", - "slice_id": "0f827ef81a990258a8a74381c8564a8361afa6712dba3200592659c939adcb9d", - "root_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "path_symbols": [ - "HttpControlChannel.__init__", - "HttpControlChannel._runner", - "HttpControlChannel.stop" - ], - "path_symbol_ids": [ - "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "f29ab212620093d72be20e26c5a399624c7939a6056a728762ed3f84a250bfa3" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "class HttpControlChannel(ControlChannel):\n def __init__(self, host: str, port: int, timeout: int) -> None:\n self._timeout = timeout\n self._runner = UvicornThreadRunner(host, port, timeout)\n self._factory = HttpControlAppFactory()\n self._actions: ControlActionSet | None = None\n\n async def start(self, actions: ControlActionSet) -> None:\n self._actions = actions\n app = self._factory.create(self._health_response, self._action_response)\n await self._runner.start(app)\n\n async def stop(self) -> None:\n await self._runner.stop()\n\n @property\n def port(self) -> int:\n return self._runner.port\n\n async def _health_response(self) -> dict[str, object]:\n if self._actions is None:\n return {\"status\": \"unhealthy\", \"detail\": \"control actions are not configured\"}\n return await asyncio.wait_for(self._actions.health(), timeout=float(self._timeout))\n\n async def _action_response(self, action: str, _client_source: str = \"unknown\") -> JSONResponse:\n if self._actions is None:\n return JSONResponse(content={\"status\": \"error\", \"detail\": f\"{action} handler is not configured\"}, status_code=404)\n callbacks = {\n \"start\": self._actions.start,\n \"stop\": self._actions.stop,\n \"status\": self._actions.status,\n }\n callback = callbacks.get(action)\n if callback is None:\n return JSONResponse(content={\"status\": \"error\", \"detail\": f\"unsupported action: {action}\"}, status_code=404)\n action_timeout = max(float(self._timeout), 10.0) if action in {\"start\", \"stop\"} else float(self._timeout)\n try:\n detail = await asyncio.wait_for(callback(), timeout=action_timeout)\n except asyncio.TimeoutError:\n return JSONResponse(\n content={\"status\": \"accepted\", \"detail\": f\"{action} operation is still in progress\"},\n status_code=202,\n )\n except Exception as exc:\n return JSONResponse(content={\"status\": \"error\", \"detail\": str(exc)}, status_code=500)\n return JSONResponse(content={\"status\": \"ok\", \"detail\": detail or f\"{action} action accepted\"}, status_code=200)", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/http_channel.py:HttpControlChannel", - "span_start": 12, - "span_end": 57, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.http_channel", - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ] - }, - "diagnostics": { - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C2_DEPENDENCY_GRAPH" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C0_SOURCE_CHUNKS": "exact_path_fetch", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 12, - "C2_DEPENDENCY_GRAPH": 4 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [ - "src/app_runtime/control/http_channel.py" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src/app_runtime/control/http_channel.py" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src/app_runtime/control/http_channel.py" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "HttpControlChannel", - "path_scope": [ - "src/app_runtime/control/http_channel.py" - ], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Почему в файле src/app_runtime/control/http_channel.py класс HttpControlChannel устроен так?", - "path_scope": [ - "src/app_runtime/control/http_channel.py" - ], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 12, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "Почему в файле src/app_runtime/control/http_channel.py класс HttpControlChannel устроен так?", - "path_scope": [ - "src/app_runtime/control/http_channel.py" - ], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 4, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [ - "src/app_runtime/control/http_channel.py" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 1, - "candidates_after_filter": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src/app_runtime/control/http_channel.py" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 1, - "candidates_after_filter": 1 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src/app_runtime/control/http_channel.py" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 4, - "candidates_after_filter": 4 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "HttpControlChannel", - "alternatives": [ - "HttpControlChannel" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 4, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "symbol_resolution": 0, - "retrieval_total": 74, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 35, - "C0_SOURCE_CHUNKS": 17, - "C2_DEPENDENCY_GRAPH": 21 - }, - "merge_rank": 21 - } - } - }, - { - "step": "llm_answer", - "input": { - "query": "Почему в файле src/app_runtime/control/http_channel.py класс HttpControlChannel устроен так?", - "rag_count": 6 - }, - "output": { - "llm_answer": "Класс `HttpControlChannel` из файла `src/app_runtime/control/http_channel.py` реализует HTTP канал управления для взаимодействия с внешним миром через HTTP протокол.\n\n### Что делает класс:\n1. **Инициализация (`__init__`)**:\n - Принимает параметры `host`, `port` и `timeout`.\n - Создаёт объект `UvicornThreadRunner` (асинхронный веб-сервер), который будет слушать указанный порт.\n - Инициализирует фабрику приложений `HttpControlAppFactory()` для создания приложения HTTP.\n - Сохраняет значение тайм-аута (`_timeout`), но само управление действиями (`_actions`) инициализируется как `None`.\n\n2. **Запуск (`start`)**:\n - Запускает веб-сервер с приложением, созданным фабрикой.\n - Перед запуском проверяет наличие настроенных действий (`_actions`). Если они отсутствуют, возвращает сообщение об ошибке.\n - Возвращает результат вызова метода `_actions.health()`, ожидая его до истечения тайм-аута.\n\n3. **Остановка (`stop`)**:\n - Останавливает веб-сервер.\n\n4. **Получение порта (`port`)**:\n - Возврашает номер порта, на котором работает сервер.\n\n5. **Ответы на запросы управления (`_health_response`, `_action_response`)**:\n - Метод `_health_response` отвечает за проверку состояния системы. Он проверяет настройку действий, а затем вызывает метод health действия, возвращая результат.\n - Метод `_action_response` обрабатывает конкретные команды управления, передаваемые клиентом. Проверяет наличие настроенного обработчика действия, и возвращает соответствующий JSON-ответ.\n\n### Входные данные:\n- Параметры конструктора: `host`, `port`, `timeout`.\n- Настройки конфигурируемых действий (`ControlActionSet`).\n\n### Выходные данные:\n- Номер порта, на котором запущен сервер.\n- Ответы на запросы о состоянии системы и конкретные команды управления.\n\nТаким образом, класс управляет асинхронной работой HTTP-сервера, настраивает обработку запросов и отвечает за состояние и выполнение конкретных команд управления системой." - }, - "diagnostics": { - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 851, - "evidence_rows": 6, - "evidence_chars": 2660 - }, - "evidence_summary": [ - { - "layer": "C1_SYMBOL_CATALOG", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "count": 4, - "unique_paths": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 1, - "unique_paths": 1 - } - ], - "prompt_template_id": "intent_code_qa_explain_local_ru_v2", - "system_prompt_version": "v1" - }, - "timings_ms": { - "prompt_build": 0, - "llm_call": 3383 - } - } - } - ] - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_125536/full_chain_plba_code_subintents_v2_plba-v2-explain-local-http-channel.md b/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_125536/full_chain_plba_code_subintents_v2_plba-v2-explain-local-http-channel.md deleted file mode 100644 index 7970192..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_125536/full_chain_plba_code_subintents_v2_plba-v2-explain-local-http-channel.md +++ /dev/null @@ -1,34 +0,0 @@ -# plba-v2-explain-local-http-channel - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_subintents_v2.yaml -- runner: runtime -- mode: full_chain -- passed: True - -## Query -Почему в файле src/app_runtime/control/http_channel.py класс HttpControlChannel устроен так? - -## Actual -{ - "intent": "CODE_QA", - "sub_intent": "EXPLAIN_LOCAL", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 6, - "llm_answer": "Класс `HttpControlChannel` из файла `src/app_runtime/control/http_channel.py` реализует HTTP канал управления для взаимодействия с внешним миром через HTTP протокол.\n\n### Что делает класс:\n1. **Инициализация (`__init__`)**:\n - Принимает параметры `host`, `port` и `timeout`.\n - Создаёт объект `UvicornThreadRunner` (асинхронный веб-сервер), который будет слушать указанный порт.\n - Инициализирует фабрику приложений `HttpControlAppFactory()` для создания приложения HTTP.\n - Сохраняет значение тайм-аута (`_timeout`), но само управление действиями (`_actions`) инициализируется как `None`.\n\n2. **Запуск (`start`)**:\n - Запускает веб-сервер с приложением, созданным фабрикой.\n - Перед запуском проверяет наличие настроенных действий (`_actions`). Если они отсутствуют, возвращает сообщение об ошибке.\n - Возвращает результат вызова метода `_actions.health()`, ожидая его до истечения тайм-аута.\n\n3. **Остановка (`stop`)**:\n - Останавливает веб-сервер.\n\n4. **Получение порта (`port`)**:\n - Возврашает номер порта, на котором работает сервер.\n\n5. **Ответы на запросы управления (`_health_response`, `_action_response`)**:\n - Метод `_health_response` отвечает за проверку состояния системы. Он проверяет настройку действий, а затем вызывает метод health действия, возвращая результат.\n - Метод `_action_response` обрабатывает конкретные команды управления, передаваемые клиентом. Проверяет наличие настроенного обработчика действия, и возвращает соответствующий JSON-ответ.\n\n### Входные данные:\n- Параметры конструктора: `host`, `port`, `timeout`.\n- Настройки конфигурируемых действий (`ControlActionSet`).\n\n### Выходные данные:\n- Номер порта, на котором запущен сервер.\n- Ответы на запросы о состоянии системы и конкретные команды управления.\n\nТаким образом, класс управляет асинхронной работой HTTP-сервера, настраивает обработку запросов и отвечает за состояние и выполнение конкретных команд управления системой.", - "answer_mode": "answered", - "path_scope": [ - "src/app_runtime/control/http_channel.py" - ], - "symbol_candidates": [ - "HttpControlChannel" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C2_DEPENDENCY_GRAPH" - ] -} - -## Mismatches -- none \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_125536/full_chain_plba_code_subintents_v2_plba-v2-explain-nonexistent-symbol.json b/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_125536/full_chain_plba_code_subintents_v2_plba-v2-explain-nonexistent-symbol.json deleted file mode 100644 index 77e50fe..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_125536/full_chain_plba_code_subintents_v2_plba-v2-explain-nonexistent-symbol.json +++ /dev/null @@ -1,1182 +0,0 @@ -{ - "case_id": "plba-v2-explain-nonexistent-symbol", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_subintents_v2.yaml", - "runner": "runtime", - "mode": "full_chain", - "actual": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 0, - "llm_answer": "Класс `RuntimeFactoryManager` не найден ни в предоставленном контексте, ни в стандартных библиотеках Python.\n\n**1. Что это и где определено.** \nНе удалось обнаружить определение класса `RuntimeFactoryManager`. Возможно, он определен в сторонней библиотеке или проекте с закрытым контекстом.\n\n**2. Назначение по наблюдаемому коду.** \nИз-за отсутствия контекста невозможно точно определить назначение данного класса. Если бы был доступ к кодовой базе, можно было бы проанализировать точку входа (entrypoint), методы и поля класса, чтобы понять его предназначение.\n\n**3. Подтверждённые зависимости или взаимодействия.** \nТак как сущность отсутствует, нельзя установить подтверждённые зависимости или взаимодействия.\n\n**4. Что делает по шагам, если это видно в контексте.** \nШагов выполнения нет, так как сущность неизвестна.\n\n**5. Осторожные выводы.** \nБез реального кода невозможно сделать какие-либо обоснованные выводы о поведении и функциях класса.\n\n**6. Чего не хватает для полного объяснения.** \nДля полноценного анализа необходимо иметь исходный код или хотя бы знать место определения класса (`runtime_factory_manager.py`, например). Без этого невозможно дать детальное объяснение работы сущности.", - "answer_mode": "insufficient_evidence", - "path_scope": [], - "symbol_candidates": [ - "RuntimeFactoryManager" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "passed": true, - "mismatches": [], - "details": { - "case_id": "plba-v2-explain-nonexistent-symbol", - "text": "Объясни класс RuntimeFactoryManager", - "mode": "full_chain", - "run_started_at": "2026-03-12T12:55:37", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Объясни класс RuntimeFactoryManager", - "symbol_resolution": { - "status": "not_found", - "resolved_symbol": null, - "alternatives": [ - "ControlChannel", - "ControlActionSet" - ], - "confidence": 0.0 - }, - "rag_count": 0, - "rag_rows": [], - "llm_answer": "Класс `RuntimeFactoryManager` не найден ни в предоставленном контексте, ни в стандартных библиотеках Python.\n\n**1. Что это и где определено.** \nНе удалось обнаружить определение класса `RuntimeFactoryManager`. Возможно, он определен в сторонней библиотеке или проекте с закрытым контекстом.\n\n**2. Назначение по наблюдаемому коду.** \nИз-за отсутствия контекста невозможно точно определить назначение данного класса. Если бы был доступ к кодовой базе, можно было бы проанализировать точку входа (entrypoint), методы и поля класса, чтобы понять его предназначение.\n\n**3. Подтверждённые зависимости или взаимодействия.** \nТак как сущность отсутствует, нельзя установить подтверждённые зависимости или взаимодействия.\n\n**4. Что делает по шагам, если это видно в контексте.** \nШагов выполнения нет, так как сущность неизвестна.\n\n**5. Осторожные выводы.** \nБез реального кода невозможно сделать какие-либо обоснованные выводы о поведении и функциях класса.\n\n**6. Чего не хватает для полного объяснения.** \nДля полноценного анализа необходимо иметь исходный код или хотя бы знать место определения класса (`runtime_factory_manager.py`, например). Без этого невозможно дать детальное объяснение работы сущности.", - "summary": { - "router": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "confidence": null - }, - "retrieval": { - "profile": "code", - "layers_hit": [], - "evidence_sufficient": false - }, - "llm": { - "answer_status": "insufficient_evidence", - "groundedness": "weakly_grounded" - } - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "RuntimeFactoryManager" - ], - "keyword_hints": [ - "RuntimeFactoryManager" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C0_SOURCE_CHUNKS": "exact_path_fetch", - "C4_SEMANTIC_ROLES": "exact_path_fetch", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C3_ENTRYPOINTS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 8, - "C4_SEMANTIC_ROLES": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C3_ENTRYPOINTS": 6 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C4_SEMANTIC_ROLES": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": null, - "workspace_id": null, - "returned_repo_ids": [], - "returned_workspace_ids": [] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "RuntimeFactoryManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "RuntimeFactoryManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C4_SEMANTIC_ROLES", - "query": "RuntimeFactoryManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "RuntimeFactoryManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - }, - { - "layer": "C3_ENTRYPOINTS", - "query": "RuntimeFactoryManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 2, - "candidates_after_filter": 2 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 6, - "candidates_after_filter": 6 - }, - { - "layer": "C3_ENTRYPOINTS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 3, - "candidates_after_filter": 3 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "not_found", - "resolved_symbol": null, - "alternatives": [ - "ControlChannel", - "ControlActionSet" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "miss", - "hit_count": 0, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "miss", - "hit_count": 0, - "fail_reason": null - }, - { - "layer": "C4_SEMANTIC_ROLES", - "status": "miss", - "hit_count": 0, - "fail_reason": null - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "miss", - "hit_count": 0, - "fail_reason": null - }, - { - "layer": "C3_ENTRYPOINTS", - "status": "miss", - "hit_count": 0, - "fail_reason": null - } - ] - }, - "constraint_violations": [ - { - "type": "LAYER_MISSING", - "severity": "warn", - "details": { - "layer": "C1_SYMBOL_CATALOG", - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "suggested_fix": "Increase top_k for this layer or relax constraints for retrieval." - }, - { - "type": "LAYER_MISSING", - "severity": "warn", - "details": { - "layer": "C0_SOURCE_CHUNKS", - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "suggested_fix": "Increase top_k for this layer or relax constraints for retrieval." - }, - { - "type": "LAYER_MISSING", - "severity": "warn", - "details": { - "layer": "C4_SEMANTIC_ROLES", - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "suggested_fix": "Increase top_k for this layer or relax constraints for retrieval." - }, - { - "type": "LAYER_MISSING", - "severity": "warn", - "details": { - "layer": "C2_DEPENDENCY_GRAPH", - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "suggested_fix": "Increase top_k for this layer or relax constraints for retrieval." - }, - { - "type": "LAYER_MISSING", - "severity": "warn", - "details": { - "layer": "C3_ENTRYPOINTS", - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "suggested_fix": "Increase top_k for this layer or relax constraints for retrieval." - }, - { - "type": "SYMBOL_RESOLUTION_FAILED", - "severity": "warn", - "details": { - "status": "not_found", - "symbol_candidates": [ - "RuntimeFactoryManager" - ] - }, - "suggested_fix": "Increase symbol layer budget or improve fuzzy symbol resolution settings." - } - ], - "timings_ms": { - "router": 0, - "symbol_resolution": 0, - "retrieval_total": 122, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 23, - "C0_SOURCE_CHUNKS": 13, - "C4_SEMANTIC_ROLES": 14, - "C2_DEPENDENCY_GRAPH": 60, - "C3_ENTRYPOINTS": 9 - }, - "merge_rank": 0, - "prompt_build": 0, - "llm_call": 1838 - }, - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 312, - "evidence_rows": 0, - "evidence_chars": 0 - }, - "evidence_summary": [], - "prompt_template_id": "intent_code_qa_explain_ru_v2", - "system_prompt_version": "v1" - }, - "router": { - "conversation_mode": "START", - "keyword_hints": [ - "RuntimeFactoryManager" - ], - "path_scope": [] - }, - "llm": { - "used_evidence_count": 0, - "missing_evidence_reason": "empty_retrieval_context" - } - }, - "run_info": { - "case_id": "plba-v2-explain-nonexistent-symbol", - "mode": "full_chain", - "run_started_at": "2026-03-12T12:55:37", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - }, - "input_request": { - "text": "Объясни класс RuntimeFactoryManager", - "normalized_query": "Объясни класс RuntimeFactoryManager" - }, - "steps": [ - { - "step": "intent_router", - "input": { - "query": "Объясни класс RuntimeFactoryManager" - }, - "output": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Объясни класс RuntimeFactoryManager" - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "RuntimeFactoryManager" - ], - "keyword_hints": [ - "RuntimeFactoryManager" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "timings_ms": { - "router": 0 - } - } - }, - { - "step": "retrieval", - "input": { - "query": "Объясни класс RuntimeFactoryManager" - }, - "output": { - "symbol_resolution": { - "status": "not_found", - "resolved_symbol": null, - "alternatives": [ - "ControlChannel", - "ControlActionSet" - ], - "confidence": 0.0 - }, - "rag_count": 0, - "rag_rows": [] - }, - "diagnostics": { - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C0_SOURCE_CHUNKS": "exact_path_fetch", - "C4_SEMANTIC_ROLES": "exact_path_fetch", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C3_ENTRYPOINTS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 8, - "C4_SEMANTIC_ROLES": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C3_ENTRYPOINTS": 6 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C4_SEMANTIC_ROLES": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": null, - "workspace_id": null, - "returned_repo_ids": [], - "returned_workspace_ids": [] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "RuntimeFactoryManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "RuntimeFactoryManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C4_SEMANTIC_ROLES", - "query": "RuntimeFactoryManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "RuntimeFactoryManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - }, - { - "layer": "C3_ENTRYPOINTS", - "query": "RuntimeFactoryManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 2, - "candidates_after_filter": 2 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 6, - "candidates_after_filter": 6 - }, - { - "layer": "C3_ENTRYPOINTS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 3, - "candidates_after_filter": 3 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "not_found", - "resolved_symbol": null, - "alternatives": [ - "ControlChannel", - "ControlActionSet" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "miss", - "hit_count": 0, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "miss", - "hit_count": 0, - "fail_reason": null - }, - { - "layer": "C4_SEMANTIC_ROLES", - "status": "miss", - "hit_count": 0, - "fail_reason": null - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "miss", - "hit_count": 0, - "fail_reason": null - }, - { - "layer": "C3_ENTRYPOINTS", - "status": "miss", - "hit_count": 0, - "fail_reason": null - } - ] - }, - "constraint_violations": [ - { - "type": "LAYER_MISSING", - "severity": "warn", - "details": { - "layer": "C1_SYMBOL_CATALOG", - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "suggested_fix": "Increase top_k for this layer or relax constraints for retrieval." - }, - { - "type": "LAYER_MISSING", - "severity": "warn", - "details": { - "layer": "C0_SOURCE_CHUNKS", - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "suggested_fix": "Increase top_k for this layer or relax constraints for retrieval." - }, - { - "type": "LAYER_MISSING", - "severity": "warn", - "details": { - "layer": "C4_SEMANTIC_ROLES", - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "suggested_fix": "Increase top_k for this layer or relax constraints for retrieval." - }, - { - "type": "LAYER_MISSING", - "severity": "warn", - "details": { - "layer": "C2_DEPENDENCY_GRAPH", - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "suggested_fix": "Increase top_k for this layer or relax constraints for retrieval." - }, - { - "type": "LAYER_MISSING", - "severity": "warn", - "details": { - "layer": "C3_ENTRYPOINTS", - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "suggested_fix": "Increase top_k for this layer or relax constraints for retrieval." - }, - { - "type": "SYMBOL_RESOLUTION_FAILED", - "severity": "warn", - "details": { - "status": "not_found", - "symbol_candidates": [ - "RuntimeFactoryManager" - ] - }, - "suggested_fix": "Increase symbol layer budget or improve fuzzy symbol resolution settings." - } - ], - "timings_ms": { - "symbol_resolution": 0, - "retrieval_total": 122, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 23, - "C0_SOURCE_CHUNKS": 13, - "C4_SEMANTIC_ROLES": 14, - "C2_DEPENDENCY_GRAPH": 60, - "C3_ENTRYPOINTS": 9 - }, - "merge_rank": 0 - } - } - }, - { - "step": "llm_answer", - "input": { - "query": "Объясни класс RuntimeFactoryManager", - "rag_count": 0 - }, - "output": { - "llm_answer": "Класс `RuntimeFactoryManager` не найден ни в предоставленном контексте, ни в стандартных библиотеках Python.\n\n**1. Что это и где определено.** \nНе удалось обнаружить определение класса `RuntimeFactoryManager`. Возможно, он определен в сторонней библиотеке или проекте с закрытым контекстом.\n\n**2. Назначение по наблюдаемому коду.** \nИз-за отсутствия контекста невозможно точно определить назначение данного класса. Если бы был доступ к кодовой базе, можно было бы проанализировать точку входа (entrypoint), методы и поля класса, чтобы понять его предназначение.\n\n**3. Подтверждённые зависимости или взаимодействия.** \nТак как сущность отсутствует, нельзя установить подтверждённые зависимости или взаимодействия.\n\n**4. Что делает по шагам, если это видно в контексте.** \nШагов выполнения нет, так как сущность неизвестна.\n\n**5. Осторожные выводы.** \nБез реального кода невозможно сделать какие-либо обоснованные выводы о поведении и функциях класса.\n\n**6. Чего не хватает для полного объяснения.** \nДля полноценного анализа необходимо иметь исходный код или хотя бы знать место определения класса (`runtime_factory_manager.py`, например). Без этого невозможно дать детальное объяснение работы сущности." - }, - "diagnostics": { - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 312, - "evidence_rows": 0, - "evidence_chars": 0 - }, - "evidence_summary": [], - "prompt_template_id": "intent_code_qa_explain_ru_v2", - "system_prompt_version": "v1" - }, - "timings_ms": { - "prompt_build": 0, - "llm_call": 1838 - } - } - } - ] - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_125536/full_chain_plba_code_subintents_v2_plba-v2-explain-nonexistent-symbol.md b/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_125536/full_chain_plba_code_subintents_v2_plba-v2-explain-nonexistent-symbol.md deleted file mode 100644 index fcd5d61..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_125536/full_chain_plba_code_subintents_v2_plba-v2-explain-nonexistent-symbol.md +++ /dev/null @@ -1,34 +0,0 @@ -# plba-v2-explain-nonexistent-symbol - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_subintents_v2.yaml -- runner: runtime -- mode: full_chain -- passed: True - -## Query -Объясни класс RuntimeFactoryManager - -## Actual -{ - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 0, - "llm_answer": "Класс `RuntimeFactoryManager` не найден ни в предоставленном контексте, ни в стандартных библиотеках Python.\n\n**1. Что это и где определено.** \nНе удалось обнаружить определение класса `RuntimeFactoryManager`. Возможно, он определен в сторонней библиотеке или проекте с закрытым контекстом.\n\n**2. Назначение по наблюдаемому коду.** \nИз-за отсутствия контекста невозможно точно определить назначение данного класса. Если бы был доступ к кодовой базе, можно было бы проанализировать точку входа (entrypoint), методы и поля класса, чтобы понять его предназначение.\n\n**3. Подтверждённые зависимости или взаимодействия.** \nТак как сущность отсутствует, нельзя установить подтверждённые зависимости или взаимодействия.\n\n**4. Что делает по шагам, если это видно в контексте.** \nШагов выполнения нет, так как сущность неизвестна.\n\n**5. Осторожные выводы.** \nБез реального кода невозможно сделать какие-либо обоснованные выводы о поведении и функциях класса.\n\n**6. Чего не хватает для полного объяснения.** \nДля полноценного анализа необходимо иметь исходный код или хотя бы знать место определения класса (`runtime_factory_manager.py`, например). Без этого невозможно дать детальное объяснение работы сущности.", - "answer_mode": "insufficient_evidence", - "path_scope": [], - "symbol_candidates": [ - "RuntimeFactoryManager" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] -} - -## Mismatches -- none \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_125536/full_chain_plba_code_subintents_v2_plba-v2-explain-runtime-manager.json b/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_125536/full_chain_plba_code_subintents_v2_plba-v2-explain-runtime-manager.json deleted file mode 100644 index 95bb4aa..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_125536/full_chain_plba_code_subintents_v2_plba-v2-explain-runtime-manager.json +++ /dev/null @@ -1,2088 +0,0 @@ -{ - "case_id": "plba-v2-explain-runtime-manager", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_subintents_v2.yaml", - "runner": "runtime", - "mode": "full_chain", - "actual": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 12, - "llm_answer": "1. Что это и где определено.\nСущность `RuntimeManager` определена в файле `src/app_runtime/core/runtime.py`.\n\n2. Назначение по наблюдаемому коду.\nИз контекста видно, что `RuntimeManager` играет роль менеджера, управляющего жизненным циклом приложения и координации различных компонентов системы. Он отвечает за инициализацию и регистрацию сервисов, отслеживание состояния и управление потоками работы.\n\n3. Подтверждённые зависимости или взаимодействия.\nКласс зависит от следующих классов и объектов:\n- `ConfigurationManager`\n- `ServiceContainer`\n- `TraceService`\n- `HealthRegistry`\n- `LogManager`\n- `WorkerSupervisor`\n- `ControlPlaneService`\n- `ApplicationModule`\n\nЭти зависимости передаются через конструктор класса при его создании.\n\n4. Что делает по шагам, если это видно в контексте.\nПо имеющемуся контексту видно следующее поведение:\n- Инициализация конструктора принимает параметры, которые могут быть опциональными экземплярами соответствующих служб.\n- Внутри конструктора производится регистрация этих служб в хранилище (`registry`), а также устанавливается начальное состояние объекта.\n- Метод `register_module` регистрирует модули приложения.\n\n5. Осторожные выводы.\nНа основании представленного контекста трудно сделать полные выводы о поведении метода `register_module`, так как он прерывается на середине.\n\n6. Чего не хватает для полного объяснения.\nДля более полного понимания сущности необходимо видеть реализацию метода `register_module` целиком и иметь доступ к остальной части файла `runtime.py`. Также важно увидеть взаимодействие с внешними компонентами, такими как `ControlPlaneService`, чтобы понять полный цикл управления жизненным состоянием приложения.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "RuntimeManager" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "passed": true, - "mismatches": [], - "details": { - "case_id": "plba-v2-explain-runtime-manager", - "text": "Объясни как работает класс RuntimeManager", - "mode": "full_chain", - "run_started_at": "2026-03-12T12:55:37", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Объясни как работает класс RuntimeManager", - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "RuntimeManager", - "alternatives": [ - "RuntimeManager" - ], - "confidence": 0.99 - }, - "rag_count": 12, - "rag_rows": [ - { - "path": "src/app_runtime/core/runtime.py", - "content": "class RuntimeManager\nRuntimeManager", - "layer": "C1_SYMBOL_CATALOG", - "title": "RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "7e4a9381328c5803bbc6179458612fc4e947d928aa7bf8b4b2bebb2c8592f758", - "qname": "RuntimeManager", - "kind": "class", - "signature": "RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.core.runtime", - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests manager\n- orchestrates role-like calls (4)\n- reads and writes state attributes\n- participates in dataflow slices (50)", - "layer": "C4_SEMANTIC_ROLES", - "title": "RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 43, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "7e4a9381328c5803bbc6179458612fc4e947d928aa7bf8b4b2bebb2c8592f758", - "symbol_name": "RuntimeManager", - "qname": "RuntimeManager", - "role": "pipeline_stage", - "confidence": 0.67, - "dataflow_participation": 50, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.stop", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 25, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d", - "dst_ref": "ControlPlaneService.stop", - "resolution": "resolved", - "slice_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.stop" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._stop_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 51, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a", - "dst_ref": "ControlPlaneService._stop_async", - "resolution": "resolved", - "slice_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._stop_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.register_channel", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 17, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957", - "dst_ref": "ControlPlaneService.register_channel", - "resolution": "resolved", - "slice_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.register_channel" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.start", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 20, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154", - "dst_ref": "ControlPlaneService.start", - "resolution": "resolved", - "slice_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.start" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._start_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 47, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517", - "dst_ref": "ControlPlaneService._start_async", - "resolution": "resolved", - "slice_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._start_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager.add_config_file", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 32, - "span_end": 52, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "a23b8a11ebdb12708b60c96ea12a69f7f042082f1adfddd572444e246d81d167", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "57ffbd4f0d9fdf3507c2b8624312ce211f3d02fdf86a57a8ec90778d8a7b498d", - "dst_ref": "RuntimeManager.add_config_file", - "resolution": "resolved", - "slice_id": "a23b8a11ebdb12708b60c96ea12a69f7f042082f1adfddd572444e246d81d167", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager.add_config_file" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "57ffbd4f0d9fdf3507c2b8624312ce211f3d02fdf86a57a8ec90778d8a7b498d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "class RuntimeManager:\n ACTION_TIMEOUT_SECONDS = 10.0\n ACTION_POLL_INTERVAL_SECONDS = 0.05\n\n def __init__(\n self,\n configuration: ConfigurationManager | None = None,\n services: ServiceContainer | None = None,\n traces: TraceService | None = None,\n health: HealthRegistry | None = None,\n logs: LogManager | None = None,\n workers: WorkerSupervisor | None = None,\n control_plane: ControlPlaneService | None = None,\n ) -> None:\n self.configuration = configuration or ConfigurationManager()\n self.services = services or ServiceContainer()\n self.traces = traces or TraceService()\n self.health = health or HealthRegistry()\n self.logs = logs or LogManager()\n self.workers = workers or WorkerSupervisor()\n self.control_plane = control_plane or ControlPlaneService()\n self.registry = ModuleRegistry(self.services)\n self._started = False\n self._state = LifecycleState.IDLE\n self._core_registered = False\n self._workers_registered = False\n self._register_core_services()\n\n def register_module(self, module: ApplicationModule) -> None:\n self.registry.register_module(module.name)\n module.register(self.registry)\n\n def add_config_file(self, path: str) -> FileConfigProvider:\n provider = FileConfigProvider(path)\n self.configuration.add_provider(provider)\n return provider\n\n def start(self, *, start_control_plane: bool = True) -> None:\n if self._started:\n return\n self._state = LifecycleState.STARTING\n config = self.configuration.load()\n self.logs.apply_config(config)\n self._register_health_contributors()\n self._register_workers()\n self.workers.start()\n if start_control_plane:\n self.control_plane.start(self)\n self._started = True\n self._refresh_state()\n\n def stop(self, timeout: float = 30.0, force: bool = False, stop_control_plane: bool = True) -> None:\n if not self._started:\n return\n self._state = LifecycleState.STOPPING\n self.workers.stop(timeout=timeout, force=force)\n if stop_control_plane:\n self.control_plane.stop()\n self._started = False\n self._state = LifecycleState.STOPPED\n\n def status(self) -> dict[str, object]:\n self._refresh_state()\n return self.control_plane.snapshot(self)\n\n def current_health(self) -> HealthPayload:\n self._refresh_state()\n return self.health.payload(self._state, self.workers.healths())\n\n async def health_status(self) -> HealthPayload:\n return self.current_health()\n\n async def start_runtime(self) -> dict[str, object] | str:\n self._refresh_state()\n if self._started:\n return \"runtime already running\"\n if self._state == LifecycleState.STOPPING:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n\n self.start(start_control_plane=False)\n started = self._wait_for_state({LifecycleState.IDLE, LifecycleState.BUSY}, timeout=self.ACTION_TIMEOUT_SECONDS)\n if started:\n return self._action_detail(\"runtime started\", timed_out=False)\n return self._action_detail(\"runtime start is still in progress\", timed_out=True)\n\n async def stop_runtime(self) -> dict[str, object] | str:\n self._refresh_state()\n if not self._started:\n if self._state == LifecycleState.STOPPING:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n return \"runtime already stopped\"\n\n self._state = LifecycleState.STOPPING\n try:\n self.workers.stop(timeout=self.ACTION_TIMEOUT_SECONDS, force=False)\n except TimeoutError:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n\n self._started = False\n self._state = LifecycleState.STOPPED\n return self._action_detail(\"runtime stopped\", timed_out=False)\n\n async def runtime_status(self) -> str:\n self._refresh_state()\n return self._state.value\n\n def _register_core_services(self) -> None:\n if self._core_registered:\n return\n self.services.register(\"configuration\", self.configuration)\n self.services.register(\"traces\", self.traces)\n self.services.register(\"health\", self.health)\n self.services.register(\"logs\", self.logs)\n self.services.register(\"workers\", self.workers)\n self.services.register(\"control_plane\", self.control_plane)\n self._core_registered = True\n\n def _register_health_contributors(self) -> None:\n for contributor in self.registry.health_contributors:\n self.health.register(contributor)\n\n def _register_workers(self) -> None:\n if self._workers_registered:\n return\n for worker in self.registry.workers:\n self.workers.register(worker)\n self._workers_registered = True\n\n def _refresh_state(self) -> None:\n lifecycle = self.workers.lifecycle_state()\n\n if self._state == LifecycleState.STOPPING:\n if lifecycle == LifecycleState.STOPPED:\n self._started = False\n self._state = LifecycleState.STOPPED\n return\n\n if not self._started:\n if lifecycle == LifecycleState.STOPPED:\n self._state = LifecycleState.STOPPED\n return\n\n self._state = lifecycle\n\n def _wait_for_state(self, target_states: set[LifecycleState], *, timeout: float) -> bool:\n deadline = monotonic() + timeout\n while monotonic() < deadline:\n self._refresh_state()\n if self._state in target_states:\n return True\n sleep(self.ACTION_POLL_INTERVAL_SECONDS)\n self._refresh_state()\n return self._state in target_states\n\n def _action_detail(self, message: str, *, timed_out: bool) -> dict[str, object]:\n self._refresh_state()\n return {\n \"message\": message,\n \"state\": self._state.value,\n \"timed_out\": timed_out,\n \"workers\": self.workers.snapshot(),\n }", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/core/runtime.py:RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.core.runtime", - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "llm_answer": "1. Что это и где определено.\nСущность `RuntimeManager` определена в файле `src/app_runtime/core/runtime.py`.\n\n2. Назначение по наблюдаемому коду.\nИз контекста видно, что `RuntimeManager` играет роль менеджера, управляющего жизненным циклом приложения и координации различных компонентов системы. Он отвечает за инициализацию и регистрацию сервисов, отслеживание состояния и управление потоками работы.\n\n3. Подтверждённые зависимости или взаимодействия.\nКласс зависит от следующих классов и объектов:\n- `ConfigurationManager`\n- `ServiceContainer`\n- `TraceService`\n- `HealthRegistry`\n- `LogManager`\n- `WorkerSupervisor`\n- `ControlPlaneService`\n- `ApplicationModule`\n\nЭти зависимости передаются через конструктор класса при его создании.\n\n4. Что делает по шагам, если это видно в контексте.\nПо имеющемуся контексту видно следующее поведение:\n- Инициализация конструктора принимает параметры, которые могут быть опциональными экземплярами соответствующих служб.\n- Внутри конструктора производится регистрация этих служб в хранилище (`registry`), а также устанавливается начальное состояние объекта.\n- Метод `register_module` регистрирует модули приложения.\n\n5. Осторожные выводы.\nНа основании представленного контекста трудно сделать полные выводы о поведении метода `register_module`, так как он прерывается на середине.\n\n6. Чего не хватает для полного объяснения.\nДля более полного понимания сущности необходимо видеть реализацию метода `register_module` целиком и иметь доступ к остальной части файла `runtime.py`. Также важно увидеть взаимодействие с внешними компонентами, такими как `ControlPlaneService`, чтобы понять полный цикл управления жизненным состоянием приложения.", - "summary": { - "router": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "confidence": null - }, - "retrieval": { - "profile": "code", - "layers_hit": [ - "C0_SOURCE_CHUNKS", - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS", - "C4_SEMANTIC_ROLES" - ], - "evidence_sufficient": true - }, - "llm": { - "answer_status": "answered", - "groundedness": "grounded" - } - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "RuntimeManager" - ], - "keyword_hints": [ - "RuntimeManager" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C0_SOURCE_CHUNKS": "exact_path_fetch", - "C4_SEMANTIC_ROLES": "exact_path_fetch", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C3_ENTRYPOINTS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 8, - "C4_SEMANTIC_ROLES": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C3_ENTRYPOINTS": 6 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C4_SEMANTIC_ROLES": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C4_SEMANTIC_ROLES", - "query": "RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - }, - { - "layer": "C3_ENTRYPOINTS", - "query": "RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 1, - "candidates_after_filter": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 6, - "candidates_after_filter": 6 - }, - { - "layer": "C3_ENTRYPOINTS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 3, - "candidates_after_filter": 3 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "RuntimeManager", - "alternatives": [ - "RuntimeManager" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C4_SEMANTIC_ROLES", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 6, - "fail_reason": null - }, - { - "layer": "C3_ENTRYPOINTS", - "status": "hit", - "hit_count": 3, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "router": 0, - "symbol_resolution": 0, - "retrieval_total": 174, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 47, - "C0_SOURCE_CHUNKS": 19, - "C4_SEMANTIC_ROLES": 17, - "C2_DEPENDENCY_GRAPH": 58, - "C3_ENTRYPOINTS": 9 - }, - "merge_rank": 19, - "prompt_build": 0, - "llm_call": 2467 - }, - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 854, - "evidence_rows": 12, - "evidence_chars": 7130 - }, - "evidence_summary": [ - { - "layer": "C1_SYMBOL_CATALOG", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "count": 6, - "unique_paths": 2 - }, - { - "layer": "C3_ENTRYPOINTS", - "count": 3, - "unique_paths": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 1, - "unique_paths": 1 - } - ], - "prompt_template_id": "intent_code_qa_explain_ru_v2", - "system_prompt_version": "v1" - }, - "router": { - "conversation_mode": "START", - "keyword_hints": [ - "RuntimeManager" - ], - "path_scope": [] - }, - "llm": { - "used_evidence_count": 12, - "missing_evidence_reason": null - } - }, - "run_info": { - "case_id": "plba-v2-explain-runtime-manager", - "mode": "full_chain", - "run_started_at": "2026-03-12T12:55:37", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - }, - "input_request": { - "text": "Объясни как работает класс RuntimeManager", - "normalized_query": "Объясни как работает класс RuntimeManager" - }, - "steps": [ - { - "step": "intent_router", - "input": { - "query": "Объясни как работает класс RuntimeManager" - }, - "output": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Объясни как работает класс RuntimeManager" - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "RuntimeManager" - ], - "keyword_hints": [ - "RuntimeManager" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "timings_ms": { - "router": 0 - } - } - }, - { - "step": "retrieval", - "input": { - "query": "Объясни как работает класс RuntimeManager" - }, - "output": { - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "RuntimeManager", - "alternatives": [ - "RuntimeManager" - ], - "confidence": 0.99 - }, - "rag_count": 12, - "rag_rows": [ - { - "path": "src/app_runtime/core/runtime.py", - "content": "class RuntimeManager\nRuntimeManager", - "layer": "C1_SYMBOL_CATALOG", - "title": "RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "7e4a9381328c5803bbc6179458612fc4e947d928aa7bf8b4b2bebb2c8592f758", - "qname": "RuntimeManager", - "kind": "class", - "signature": "RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.core.runtime", - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests manager\n- orchestrates role-like calls (4)\n- reads and writes state attributes\n- participates in dataflow slices (50)", - "layer": "C4_SEMANTIC_ROLES", - "title": "RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 43, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "7e4a9381328c5803bbc6179458612fc4e947d928aa7bf8b4b2bebb2c8592f758", - "symbol_name": "RuntimeManager", - "qname": "RuntimeManager", - "role": "pipeline_stage", - "confidence": 0.67, - "dataflow_participation": 50, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.stop", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 25, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d", - "dst_ref": "ControlPlaneService.stop", - "resolution": "resolved", - "slice_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.stop" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._stop_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 51, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a", - "dst_ref": "ControlPlaneService._stop_async", - "resolution": "resolved", - "slice_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._stop_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.register_channel", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 17, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957", - "dst_ref": "ControlPlaneService.register_channel", - "resolution": "resolved", - "slice_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.register_channel" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.start", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 20, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154", - "dst_ref": "ControlPlaneService.start", - "resolution": "resolved", - "slice_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.start" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._start_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 47, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517", - "dst_ref": "ControlPlaneService._start_async", - "resolution": "resolved", - "slice_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._start_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager.add_config_file", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 32, - "span_end": 52, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "a23b8a11ebdb12708b60c96ea12a69f7f042082f1adfddd572444e246d81d167", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "57ffbd4f0d9fdf3507c2b8624312ce211f3d02fdf86a57a8ec90778d8a7b498d", - "dst_ref": "RuntimeManager.add_config_file", - "resolution": "resolved", - "slice_id": "a23b8a11ebdb12708b60c96ea12a69f7f042082f1adfddd572444e246d81d167", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager.add_config_file" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "57ffbd4f0d9fdf3507c2b8624312ce211f3d02fdf86a57a8ec90778d8a7b498d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "class RuntimeManager:\n ACTION_TIMEOUT_SECONDS = 10.0\n ACTION_POLL_INTERVAL_SECONDS = 0.05\n\n def __init__(\n self,\n configuration: ConfigurationManager | None = None,\n services: ServiceContainer | None = None,\n traces: TraceService | None = None,\n health: HealthRegistry | None = None,\n logs: LogManager | None = None,\n workers: WorkerSupervisor | None = None,\n control_plane: ControlPlaneService | None = None,\n ) -> None:\n self.configuration = configuration or ConfigurationManager()\n self.services = services or ServiceContainer()\n self.traces = traces or TraceService()\n self.health = health or HealthRegistry()\n self.logs = logs or LogManager()\n self.workers = workers or WorkerSupervisor()\n self.control_plane = control_plane or ControlPlaneService()\n self.registry = ModuleRegistry(self.services)\n self._started = False\n self._state = LifecycleState.IDLE\n self._core_registered = False\n self._workers_registered = False\n self._register_core_services()\n\n def register_module(self, module: ApplicationModule) -> None:\n self.registry.register_module(module.name)\n module.register(self.registry)\n\n def add_config_file(self, path: str) -> FileConfigProvider:\n provider = FileConfigProvider(path)\n self.configuration.add_provider(provider)\n return provider\n\n def start(self, *, start_control_plane: bool = True) -> None:\n if self._started:\n return\n self._state = LifecycleState.STARTING\n config = self.configuration.load()\n self.logs.apply_config(config)\n self._register_health_contributors()\n self._register_workers()\n self.workers.start()\n if start_control_plane:\n self.control_plane.start(self)\n self._started = True\n self._refresh_state()\n\n def stop(self, timeout: float = 30.0, force: bool = False, stop_control_plane: bool = True) -> None:\n if not self._started:\n return\n self._state = LifecycleState.STOPPING\n self.workers.stop(timeout=timeout, force=force)\n if stop_control_plane:\n self.control_plane.stop()\n self._started = False\n self._state = LifecycleState.STOPPED\n\n def status(self) -> dict[str, object]:\n self._refresh_state()\n return self.control_plane.snapshot(self)\n\n def current_health(self) -> HealthPayload:\n self._refresh_state()\n return self.health.payload(self._state, self.workers.healths())\n\n async def health_status(self) -> HealthPayload:\n return self.current_health()\n\n async def start_runtime(self) -> dict[str, object] | str:\n self._refresh_state()\n if self._started:\n return \"runtime already running\"\n if self._state == LifecycleState.STOPPING:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n\n self.start(start_control_plane=False)\n started = self._wait_for_state({LifecycleState.IDLE, LifecycleState.BUSY}, timeout=self.ACTION_TIMEOUT_SECONDS)\n if started:\n return self._action_detail(\"runtime started\", timed_out=False)\n return self._action_detail(\"runtime start is still in progress\", timed_out=True)\n\n async def stop_runtime(self) -> dict[str, object] | str:\n self._refresh_state()\n if not self._started:\n if self._state == LifecycleState.STOPPING:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n return \"runtime already stopped\"\n\n self._state = LifecycleState.STOPPING\n try:\n self.workers.stop(timeout=self.ACTION_TIMEOUT_SECONDS, force=False)\n except TimeoutError:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n\n self._started = False\n self._state = LifecycleState.STOPPED\n return self._action_detail(\"runtime stopped\", timed_out=False)\n\n async def runtime_status(self) -> str:\n self._refresh_state()\n return self._state.value\n\n def _register_core_services(self) -> None:\n if self._core_registered:\n return\n self.services.register(\"configuration\", self.configuration)\n self.services.register(\"traces\", self.traces)\n self.services.register(\"health\", self.health)\n self.services.register(\"logs\", self.logs)\n self.services.register(\"workers\", self.workers)\n self.services.register(\"control_plane\", self.control_plane)\n self._core_registered = True\n\n def _register_health_contributors(self) -> None:\n for contributor in self.registry.health_contributors:\n self.health.register(contributor)\n\n def _register_workers(self) -> None:\n if self._workers_registered:\n return\n for worker in self.registry.workers:\n self.workers.register(worker)\n self._workers_registered = True\n\n def _refresh_state(self) -> None:\n lifecycle = self.workers.lifecycle_state()\n\n if self._state == LifecycleState.STOPPING:\n if lifecycle == LifecycleState.STOPPED:\n self._started = False\n self._state = LifecycleState.STOPPED\n return\n\n if not self._started:\n if lifecycle == LifecycleState.STOPPED:\n self._state = LifecycleState.STOPPED\n return\n\n self._state = lifecycle\n\n def _wait_for_state(self, target_states: set[LifecycleState], *, timeout: float) -> bool:\n deadline = monotonic() + timeout\n while monotonic() < deadline:\n self._refresh_state()\n if self._state in target_states:\n return True\n sleep(self.ACTION_POLL_INTERVAL_SECONDS)\n self._refresh_state()\n return self._state in target_states\n\n def _action_detail(self, message: str, *, timed_out: bool) -> dict[str, object]:\n self._refresh_state()\n return {\n \"message\": message,\n \"state\": self._state.value,\n \"timed_out\": timed_out,\n \"workers\": self.workers.snapshot(),\n }", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/core/runtime.py:RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.core.runtime", - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ] - }, - "diagnostics": { - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C0_SOURCE_CHUNKS": "exact_path_fetch", - "C4_SEMANTIC_ROLES": "exact_path_fetch", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C3_ENTRYPOINTS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 8, - "C4_SEMANTIC_ROLES": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C3_ENTRYPOINTS": 6 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C4_SEMANTIC_ROLES": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C4_SEMANTIC_ROLES", - "query": "RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - }, - { - "layer": "C3_ENTRYPOINTS", - "query": "RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 1, - "candidates_after_filter": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 6, - "candidates_after_filter": 6 - }, - { - "layer": "C3_ENTRYPOINTS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 3, - "candidates_after_filter": 3 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "RuntimeManager", - "alternatives": [ - "RuntimeManager" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C4_SEMANTIC_ROLES", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 6, - "fail_reason": null - }, - { - "layer": "C3_ENTRYPOINTS", - "status": "hit", - "hit_count": 3, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "symbol_resolution": 0, - "retrieval_total": 174, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 47, - "C0_SOURCE_CHUNKS": 19, - "C4_SEMANTIC_ROLES": 17, - "C2_DEPENDENCY_GRAPH": 58, - "C3_ENTRYPOINTS": 9 - }, - "merge_rank": 19 - } - } - }, - { - "step": "llm_answer", - "input": { - "query": "Объясни как работает класс RuntimeManager", - "rag_count": 12 - }, - "output": { - "llm_answer": "1. Что это и где определено.\nСущность `RuntimeManager` определена в файле `src/app_runtime/core/runtime.py`.\n\n2. Назначение по наблюдаемому коду.\nИз контекста видно, что `RuntimeManager` играет роль менеджера, управляющего жизненным циклом приложения и координации различных компонентов системы. Он отвечает за инициализацию и регистрацию сервисов, отслеживание состояния и управление потоками работы.\n\n3. Подтверждённые зависимости или взаимодействия.\nКласс зависит от следующих классов и объектов:\n- `ConfigurationManager`\n- `ServiceContainer`\n- `TraceService`\n- `HealthRegistry`\n- `LogManager`\n- `WorkerSupervisor`\n- `ControlPlaneService`\n- `ApplicationModule`\n\nЭти зависимости передаются через конструктор класса при его создании.\n\n4. Что делает по шагам, если это видно в контексте.\nПо имеющемуся контексту видно следующее поведение:\n- Инициализация конструктора принимает параметры, которые могут быть опциональными экземплярами соответствующих служб.\n- Внутри конструктора производится регистрация этих служб в хранилище (`registry`), а также устанавливается начальное состояние объекта.\n- Метод `register_module` регистрирует модули приложения.\n\n5. Осторожные выводы.\nНа основании представленного контекста трудно сделать полные выводы о поведении метода `register_module`, так как он прерывается на середине.\n\n6. Чего не хватает для полного объяснения.\nДля более полного понимания сущности необходимо видеть реализацию метода `register_module` целиком и иметь доступ к остальной части файла `runtime.py`. Также важно увидеть взаимодействие с внешними компонентами, такими как `ControlPlaneService`, чтобы понять полный цикл управления жизненным состоянием приложения." - }, - "diagnostics": { - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 854, - "evidence_rows": 12, - "evidence_chars": 7130 - }, - "evidence_summary": [ - { - "layer": "C1_SYMBOL_CATALOG", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "count": 6, - "unique_paths": 2 - }, - { - "layer": "C3_ENTRYPOINTS", - "count": 3, - "unique_paths": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 1, - "unique_paths": 1 - } - ], - "prompt_template_id": "intent_code_qa_explain_ru_v2", - "system_prompt_version": "v1" - }, - "timings_ms": { - "prompt_build": 0, - "llm_call": 2467 - } - } - } - ] - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_125536/full_chain_plba_code_subintents_v2_plba-v2-explain-runtime-manager.md b/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_125536/full_chain_plba_code_subintents_v2_plba-v2-explain-runtime-manager.md deleted file mode 100644 index 3d75f58..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_125536/full_chain_plba_code_subintents_v2_plba-v2-explain-runtime-manager.md +++ /dev/null @@ -1,34 +0,0 @@ -# plba-v2-explain-runtime-manager - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_subintents_v2.yaml -- runner: runtime -- mode: full_chain -- passed: True - -## Query -Объясни как работает класс RuntimeManager - -## Actual -{ - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 12, - "llm_answer": "1. Что это и где определено.\nСущность `RuntimeManager` определена в файле `src/app_runtime/core/runtime.py`.\n\n2. Назначение по наблюдаемому коду.\nИз контекста видно, что `RuntimeManager` играет роль менеджера, управляющего жизненным циклом приложения и координации различных компонентов системы. Он отвечает за инициализацию и регистрацию сервисов, отслеживание состояния и управление потоками работы.\n\n3. Подтверждённые зависимости или взаимодействия.\nКласс зависит от следующих классов и объектов:\n- `ConfigurationManager`\n- `ServiceContainer`\n- `TraceService`\n- `HealthRegistry`\n- `LogManager`\n- `WorkerSupervisor`\n- `ControlPlaneService`\n- `ApplicationModule`\n\nЭти зависимости передаются через конструктор класса при его создании.\n\n4. Что делает по шагам, если это видно в контексте.\nПо имеющемуся контексту видно следующее поведение:\n- Инициализация конструктора принимает параметры, которые могут быть опциональными экземплярами соответствующих служб.\n- Внутри конструктора производится регистрация этих служб в хранилище (`registry`), а также устанавливается начальное состояние объекта.\n- Метод `register_module` регистрирует модули приложения.\n\n5. Осторожные выводы.\nНа основании представленного контекста трудно сделать полные выводы о поведении метода `register_module`, так как он прерывается на середине.\n\n6. Чего не хватает для полного объяснения.\nДля более полного понимания сущности необходимо видеть реализацию метода `register_module` целиком и иметь доступ к остальной части файла `runtime.py`. Также важно увидеть взаимодействие с внешними компонентами, такими как `ControlPlaneService`, чтобы понять полный цикл управления жизненным состоянием приложения.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "RuntimeManager" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] -} - -## Mismatches -- none \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_125536/full_chain_plba_code_subintents_v2_plba-v2-explain-trace-service.json b/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_125536/full_chain_plba_code_subintents_v2_plba-v2-explain-trace-service.json deleted file mode 100644 index 66e2a1f..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_125536/full_chain_plba_code_subintents_v2_plba-v2-explain-trace-service.json +++ /dev/null @@ -1,2208 +0,0 @@ -{ - "case_id": "plba-v2-explain-trace-service", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_subintents_v2.yaml", - "runner": "runtime", - "mode": "full_chain", - "actual": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 14, - "llm_answer": "1. Что это и где определено.\nСущность `TraceService` объявлена в файле `src/app_runtime/tracing/service.py`. Это класс-наследник от `TraceContextFactory`.\n\n2. Назначение по наблюдаемому коду.\nКласс предназначен для работы с трассировкой контекста выполнения приложения. Он создаёт и управляет контекстами трассировки, записывает их в хранилище (`store`) и отправляет на транспорт (`transport`), обеспечивая запись логических сообщений и контекстных данных о выполнении программы.\n\n3. Подтверждённые зависимости или взаимодействия.\n- Создаёт и записывает записи контекста трассировки через метод `create_context()`, используя хранилище контекста (`store`) и транспорт (`transport`).\n- Использует контекстный менеджер `open_context()` для открытия временных контекстов.\n- Вызывает методы записи контекста и сообщений через экземпляр класса `TraceRecordWriter`.\n\n4. Что делает по шагам, если это видно в контексте.\n- В конструкторе инициализирует переменные `transport` и `store`, устанавливает транспорт по умолчанию как `NoOpTraceTransport()` и хранилище как `TraceContextStore()`.\n- Метод `create_context()` создает новую запись контекста трассировки с заданными параметрами, сохраняет её в хранилище и записывает через транспорт.\n- Контекстный менеджер `open_context()` открывает временный контекст, создавая запись контекста с помощью метода `create_context()`.\n\n5. Осторожные выводы.\nНа данный момент нет явных признаков критичных недостатков в понимании поведения класса. Однако более глубокий анализ его использования вне представленного контекста может выявить дополнительные аспекты его применения.\n\n6. Чего не хватает для полного объяснения.\nДля полной картины необходимо рассмотреть следующие моменты:\n- Реализацию методов, которые вызываются внутри класса, таких как работа транспорта и хранилища контекста.\n- Дополнительные контексты использования и интеграции с другими компонентами системы.\n- Возможное поведение при ошибках и исключениях, связанных с транспортом и хранилищем.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "TraceService" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "passed": true, - "mismatches": [], - "details": { - "case_id": "plba-v2-explain-trace-service", - "text": "Объясни как работает класс TraceService", - "mode": "full_chain", - "run_started_at": "2026-03-12T12:55:37", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Объясни как работает класс TraceService", - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "TraceService", - "alternatives": [ - "TraceService" - ], - "confidence": 0.99 - }, - "rag_count": 14, - "rag_rows": [ - { - "path": "src/app_runtime/tracing/service.py", - "content": "class TraceService\nTraceService(TraceContextFactory)", - "layer": "C1_SYMBOL_CATALOG", - "title": "TraceService", - "span_start": 39, - "span_end": 166, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "c2b2b976d99f2c600000b753731b26e0a69adcb4359398b93073590c5d5d04f4", - "qname": "TraceService", - "kind": "class", - "signature": "TraceService(TraceContextFactory)", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.tracing.service", - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "TraceService\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests service\n- reads and writes state attributes\n- participates in dataflow slices (13)", - "layer": "C4_SEMANTIC_ROLES", - "title": "TraceService", - "span_start": 39, - "span_end": 166, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 60, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "c2b2b976d99f2c600000b753731b26e0a69adcb4359398b93073590c5d5d04f4", - "symbol_name": "TraceService", - "qname": "TraceService", - "role": "pipeline_stage", - "confidence": 0.57, - "dataflow_participation": 13, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "TraceService.__init__\n -> TraceService.store\n -> TraceService.create_context", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "TraceService.__init__:dataflow_slice", - "span_start": 42, - "span_end": 61, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "3b052062067a78aef3302ee1d996897e02a67d1b340397bea4f59fe147c0492a", - "edge_type": "dataflow_slice", - "src_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "src_qname": "TraceService.__init__", - "dst_symbol_id": "ff44881104b65ef50ee6fe16d367d4a81b6e7eb5c44c0963cf4543faec785d4a", - "dst_ref": "TraceService.create_context", - "resolution": "resolved", - "slice_id": "3b052062067a78aef3302ee1d996897e02a67d1b340397bea4f59fe147c0492a", - "root_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "path_symbols": [ - "TraceService.__init__", - "TraceService.store", - "TraceService.create_context" - ], - "path_symbol_ids": [ - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "ff44881104b65ef50ee6fe16d367d4a81b6e7eb5c44c0963cf4543faec785d4a" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "TraceService.__init__\n -> TraceService.store\n -> TraceService.close_context", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "TraceService.__init__:dataflow_slice", - "span_start": 42, - "span_end": 84, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "7a9353ef57c9ae5d19b3a0c6ac50fad05e6d21d31bbe1cd1cd07af6332ba6505", - "edge_type": "dataflow_slice", - "src_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "src_qname": "TraceService.__init__", - "dst_symbol_id": "01e14158dcced7e52d0c8ac84ac7b9a75225c261b6aca6a1d7da802d0994721c", - "dst_ref": "TraceService.close_context", - "resolution": "resolved", - "slice_id": "7a9353ef57c9ae5d19b3a0c6ac50fad05e6d21d31bbe1cd1cd07af6332ba6505", - "root_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "path_symbols": [ - "TraceService.__init__", - "TraceService.store", - "TraceService.close_context" - ], - "path_symbol_ids": [ - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "01e14158dcced7e52d0c8ac84ac7b9a75225c261b6aca6a1d7da802d0994721c" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "TraceService.__init__\n -> TraceService.store\n -> TraceService.open_context", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "TraceService.__init__:dataflow_slice", - "span_start": 42, - "span_end": 78, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "a6e13b9ebc4fed84586afd53ed92a4d14757e440873f572b2337d5622ee96031", - "edge_type": "dataflow_slice", - "src_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "src_qname": "TraceService.__init__", - "dst_symbol_id": "2da3d5b20a947bf63e14c103be4689b72fd837e0a82abd6c497846375d4c7426", - "dst_ref": "TraceService.open_context", - "resolution": "resolved", - "slice_id": "a6e13b9ebc4fed84586afd53ed92a4d14757e440873f572b2337d5622ee96031", - "root_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "path_symbols": [ - "TraceService.__init__", - "TraceService.store", - "TraceService.open_context" - ], - "path_symbol_ids": [ - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "2da3d5b20a947bf63e14c103be4689b72fd837e0a82abd6c497846375d4c7426" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "TraceService.__init__\n -> TraceService.transport\n -> TraceService.__init__", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "TraceService.__init__:dataflow_slice", - "span_start": 41, - "span_end": 43, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "1e923a93faa05c3c43ca9b19bd047007a8589ccce57d3cc1798ae7f9f200af98", - "edge_type": "dataflow_slice", - "src_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "src_qname": "TraceService.__init__", - "dst_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "dst_ref": "TraceService.__init__", - "resolution": "resolved", - "slice_id": "1e923a93faa05c3c43ca9b19bd047007a8589ccce57d3cc1798ae7f9f200af98", - "root_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "path_symbols": [ - "TraceService.__init__", - "TraceService.transport", - "TraceService.__init__" - ], - "path_symbol_ids": [ - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "TraceService.__init__\n -> TraceService.store\n -> TraceService.current_trace_id", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "TraceService.__init__:dataflow_slice", - "span_start": 42, - "span_end": 81, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "3ea17138634b1190bded77ddb84aa1595124f6519b246f24fc4b02bd62b5cac1", - "edge_type": "dataflow_slice", - "src_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "src_qname": "TraceService.__init__", - "dst_symbol_id": "41135180f7b3b9ab20e097e0747474e219c37dd2366ef08a7b43c1f3edb10b4c", - "dst_ref": "TraceService.current_trace_id", - "resolution": "resolved", - "slice_id": "3ea17138634b1190bded77ddb84aa1595124f6519b246f24fc4b02bd62b5cac1", - "root_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "path_symbols": [ - "TraceService.__init__", - "TraceService.store", - "TraceService.current_trace_id" - ], - "path_symbol_ids": [ - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "41135180f7b3b9ab20e097e0747474e219c37dd2366ef08a7b43c1f3edb10b4c" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "TraceService.__init__\n -> TraceService.store\n -> TraceService.step", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "TraceService.__init__:dataflow_slice", - "span_start": 42, - "span_end": 88, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "9f34c5da9b09fba99df6f6b1bde183a9aeb45111b8218a747c71590c2c9f60f2", - "edge_type": "dataflow_slice", - "src_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "src_qname": "TraceService.__init__", - "dst_symbol_id": "c44bfbc66cf747283f30088da3e011a10395031d41e77b74e523c24997f641ca", - "dst_ref": "TraceService.step", - "resolution": "resolved", - "slice_id": "9f34c5da9b09fba99df6f6b1bde183a9aeb45111b8218a747c71590c2c9f60f2", - "root_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "path_symbols": [ - "TraceService.__init__", - "TraceService.store", - "TraceService.step" - ], - "path_symbol_ids": [ - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "c44bfbc66cf747283f30088da3e011a10395031d41e77b74e523c24997f641ca" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "class TraceRecordWriter:\n def __init__(self, transport: TraceTransport) -> None:\n self._logger = logging.getLogger(__name__)\n self._transport = transport\n\n def write_context(self, record: TraceContextRecord) -> None:\n try:\n self._transport.write_context(record)\n except Exception:\n self._logger.exception(\"Trace transport failed to write context %s\", record.trace_id)\n\n def write_message(self, record: TraceLogMessage) -> None:\n try:\n self._transport.write_message(record)\n except Exception:\n self._logger.exception(\"Trace transport failed to write message for %s\", record.trace_id)", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/tracing/service.py:TraceRecordWriter", - "span_start": 21, - "span_end": 36, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.tracing.service", - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "class TraceService(TraceContextFactory):\n def __init__(self, transport: TraceTransport | None = None, store: TraceContextStore | None = None) -> None:\n self.transport = transport or NoOpTraceTransport()\n self.store = store or TraceContextStore()\n self._writer = TraceRecordWriter(self.transport)\n\n def create_context(\n self,\n *,\n alias: str,\n parent_id: str | None = None,\n kind: str | None = None,\n attrs: dict[str, Any] | None = None,\n ) -> str:\n record = TraceContextRecord(\n trace_id=uuid4().hex,\n alias=str(alias or \"\"),\n parent_id=parent_id,\n type=kind,\n event_time=utc_now(),\n attrs=dict(attrs or {}),\n )\n self.store.push(record)\n self._writer.write_context(record)\n return record.trace_id\n\n @contextmanager\n def open_context(\n self,\n *,\n alias: str,\n parent_id: str | None = None,\n kind: str | None = None,\n attrs: dict[str, Any] | None = None,\n ) -> Iterator[str]:\n trace_id = self.create_context(alias=alias, parent_id=parent_id, kind=kind, attrs=attrs)\n try:\n yield trace_id\n finally:\n self.store.pop()\n\n def current_trace_id(self) -> str | None:\n return self.store.current_trace_id()\n\n def close_context(self) -> str | None:\n previous = self.store.pop()\n return previous.record.trace_id if previous else None\n\n def step(self, name: str) -> None:\n self.store.set_step(str(name or \"\"))\n\n def info(self, message: str, *, status: str | None = None, attrs: dict[str, Any] | None = None) -> None:\n self._write_message(\"INFO\", message, status, attrs)\n\n def debug(self, message: str, *, status: str | None = None, attrs: dict[str, Any] | None = None) -> None:\n self._write_message(\"DEBUG\", message, status, attrs)\n\n def warning(self, message: str, *, status: str | None = None, attrs: dict[str, Any] | None = None) -> None:\n self._write_message(\"WARNING\", message, status, attrs)\n\n def error(self, message: str, *, status: str | None = None, attrs: dict[str, Any] | None = None) -> None:\n self._write_message(\"ERROR\", message, status, attrs)\n\n def exception(self, message: str, *, status: str = \"failed\", attrs: dict[str, Any] | None = None) -> None:\n self._write_message(\"ERROR\", message, status, attrs)\n\n def new_root(self, operation: str) -> TraceContext:\n trace_id = self.create_context(alias=operation, kind=\"operation\", attrs={\"operation\": operation})\n return TraceContext(trace_id=trace_id, span_id=trace_id, attributes={\"operation\": operation})\n\n def child_of(self, parent: TraceContext, operation: str) -> TraceContext:\n trace_id = self.create_context(\n alias=operation,\n parent_id=parent.trace_id,\n kind=\"worker\",\n attrs={\"operation\": operation},\n )\n return TraceContext(\n trace_id=trace_id,\n span_id=trace_id,\n parent_span_id=parent.span_id,\n attributes={\"operation\": operation},\n )\n\n def attach(self, metadata: dict[str, object], context: TraceContext) -> dict[str, object]:\n updated = dict(metadata)\n updated[\"trace_id\"] = context.trace_id\n updated[\"span_id\"] = context.span_id\n updated[\"parent_span_id\"] = context.parent_span_id\n return updated\n\n def resume(self, metadata: dict[str, object], operation: str) -> TraceContext:\n trace_id = str(metadata.get(\"trace_id\") or uuid4().hex)\n span_id = str(metadata.get(\"span_id\") or trace_id)\n parent_id = metadata.get(\"parent_span_id\")\n self.create_context(\n alias=operation,\n parent_id=str(parent_id) if parent_id else None,\n kind=\"worker\",\n attrs=dict(metadata),\n )\n return TraceContext(\n trace_id=trace_id,\n span_id=span_id,\n parent_span_id=str(parent_id) if parent_id else None,\n attributes={\"operation\": operation},\n )\n\n def _write_message(\n self,\n level: TraceLevel,\n message: str,\n status: str | None,\n attrs: dict[str, Any] | None,\n ) -> None:\n active = self.store.current()\n if active is None:\n raise RuntimeError(\"Trace context is not bound. Call create_context() first.\")\n record = TraceLogMessage(\n trace_id=active.record.trace_id,\n step=active.step,\n status=str(status or \"\"),\n message=str(message or \"\"),\n level=level,\n event_time=utc_now(),\n attrs=dict(attrs or {}),\n )\n self._writer.write_message(record)", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/tracing/service.py:TraceService", - "span_start": 39, - "span_end": 166, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 1, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.tracing.service", - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "class TraceManager(TraceService):\n \"\"\"Compatibility alias during the transition from ConfigManager-shaped naming.\"\"\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/tracing/service.py:TraceManager", - "span_start": 169, - "span_end": 170, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 2, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.tracing.service", - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "llm_answer": "1. Что это и где определено.\nСущность `TraceService` объявлена в файле `src/app_runtime/tracing/service.py`. Это класс-наследник от `TraceContextFactory`.\n\n2. Назначение по наблюдаемому коду.\nКласс предназначен для работы с трассировкой контекста выполнения приложения. Он создаёт и управляет контекстами трассировки, записывает их в хранилище (`store`) и отправляет на транспорт (`transport`), обеспечивая запись логических сообщений и контекстных данных о выполнении программы.\n\n3. Подтверждённые зависимости или взаимодействия.\n- Создаёт и записывает записи контекста трассировки через метод `create_context()`, используя хранилище контекста (`store`) и транспорт (`transport`).\n- Использует контекстный менеджер `open_context()` для открытия временных контекстов.\n- Вызывает методы записи контекста и сообщений через экземпляр класса `TraceRecordWriter`.\n\n4. Что делает по шагам, если это видно в контексте.\n- В конструкторе инициализирует переменные `transport` и `store`, устанавливает транспорт по умолчанию как `NoOpTraceTransport()` и хранилище как `TraceContextStore()`.\n- Метод `create_context()` создает новую запись контекста трассировки с заданными параметрами, сохраняет её в хранилище и записывает через транспорт.\n- Контекстный менеджер `open_context()` открывает временный контекст, создавая запись контекста с помощью метода `create_context()`.\n\n5. Осторожные выводы.\nНа данный момент нет явных признаков критичных недостатков в понимании поведения класса. Однако более глубокий анализ его использования вне представленного контекста может выявить дополнительные аспекты его применения.\n\n6. Чего не хватает для полного объяснения.\nДля полной картины необходимо рассмотреть следующие моменты:\n- Реализацию методов, которые вызываются внутри класса, таких как работа транспорта и хранилища контекста.\n- Дополнительные контексты использования и интеграции с другими компонентами системы.\n- Возможное поведение при ошибках и исключениях, связанных с транспортом и хранилищем.", - "summary": { - "router": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "confidence": null - }, - "retrieval": { - "profile": "code", - "layers_hit": [ - "C0_SOURCE_CHUNKS", - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS", - "C4_SEMANTIC_ROLES" - ], - "evidence_sufficient": true - }, - "llm": { - "answer_status": "answered", - "groundedness": "grounded" - } - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "TraceService" - ], - "keyword_hints": [ - "TraceService" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C0_SOURCE_CHUNKS": "exact_path_fetch", - "C4_SEMANTIC_ROLES": "exact_path_fetch", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C3_ENTRYPOINTS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 8, - "C4_SEMANTIC_ROLES": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C3_ENTRYPOINTS": 6 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C4_SEMANTIC_ROLES": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "TraceService", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "TraceService", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C4_SEMANTIC_ROLES", - "query": "TraceService", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "TraceService", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - }, - { - "layer": "C3_ENTRYPOINTS", - "query": "TraceService", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 1, - "candidates_after_filter": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 6, - "candidates_after_filter": 6 - }, - { - "layer": "C3_ENTRYPOINTS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 3, - "candidates_after_filter": 3 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "TraceService", - "alternatives": [ - "TraceService" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 3, - "fail_reason": null - }, - { - "layer": "C4_SEMANTIC_ROLES", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 6, - "fail_reason": null - }, - { - "layer": "C3_ENTRYPOINTS", - "status": "hit", - "hit_count": 3, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "router": 0, - "symbol_resolution": 0, - "retrieval_total": 114, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 26, - "C0_SOURCE_CHUNKS": 13, - "C4_SEMANTIC_ROLES": 15, - "C2_DEPENDENCY_GRAPH": 49, - "C3_ENTRYPOINTS": 8 - }, - "merge_rank": 16, - "prompt_build": 0, - "llm_call": 2998 - }, - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 991, - "evidence_rows": 14, - "evidence_chars": 6323 - }, - "evidence_summary": [ - { - "layer": "C1_SYMBOL_CATALOG", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "count": 6, - "unique_paths": 1 - }, - { - "layer": "C3_ENTRYPOINTS", - "count": 3, - "unique_paths": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 3, - "unique_paths": 1 - } - ], - "prompt_template_id": "intent_code_qa_explain_ru_v2", - "system_prompt_version": "v1" - }, - "router": { - "conversation_mode": "START", - "keyword_hints": [ - "TraceService" - ], - "path_scope": [] - }, - "llm": { - "used_evidence_count": 14, - "missing_evidence_reason": null - } - }, - "run_info": { - "case_id": "plba-v2-explain-trace-service", - "mode": "full_chain", - "run_started_at": "2026-03-12T12:55:37", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - }, - "input_request": { - "text": "Объясни как работает класс TraceService", - "normalized_query": "Объясни как работает класс TraceService" - }, - "steps": [ - { - "step": "intent_router", - "input": { - "query": "Объясни как работает класс TraceService" - }, - "output": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Объясни как работает класс TraceService" - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "TraceService" - ], - "keyword_hints": [ - "TraceService" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "timings_ms": { - "router": 0 - } - } - }, - { - "step": "retrieval", - "input": { - "query": "Объясни как работает класс TraceService" - }, - "output": { - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "TraceService", - "alternatives": [ - "TraceService" - ], - "confidence": 0.99 - }, - "rag_count": 14, - "rag_rows": [ - { - "path": "src/app_runtime/tracing/service.py", - "content": "class TraceService\nTraceService(TraceContextFactory)", - "layer": "C1_SYMBOL_CATALOG", - "title": "TraceService", - "span_start": 39, - "span_end": 166, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "c2b2b976d99f2c600000b753731b26e0a69adcb4359398b93073590c5d5d04f4", - "qname": "TraceService", - "kind": "class", - "signature": "TraceService(TraceContextFactory)", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.tracing.service", - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "TraceService\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests service\n- reads and writes state attributes\n- participates in dataflow slices (13)", - "layer": "C4_SEMANTIC_ROLES", - "title": "TraceService", - "span_start": 39, - "span_end": 166, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 60, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "c2b2b976d99f2c600000b753731b26e0a69adcb4359398b93073590c5d5d04f4", - "symbol_name": "TraceService", - "qname": "TraceService", - "role": "pipeline_stage", - "confidence": 0.57, - "dataflow_participation": 13, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "TraceService.__init__\n -> TraceService.store\n -> TraceService.create_context", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "TraceService.__init__:dataflow_slice", - "span_start": 42, - "span_end": 61, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "3b052062067a78aef3302ee1d996897e02a67d1b340397bea4f59fe147c0492a", - "edge_type": "dataflow_slice", - "src_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "src_qname": "TraceService.__init__", - "dst_symbol_id": "ff44881104b65ef50ee6fe16d367d4a81b6e7eb5c44c0963cf4543faec785d4a", - "dst_ref": "TraceService.create_context", - "resolution": "resolved", - "slice_id": "3b052062067a78aef3302ee1d996897e02a67d1b340397bea4f59fe147c0492a", - "root_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "path_symbols": [ - "TraceService.__init__", - "TraceService.store", - "TraceService.create_context" - ], - "path_symbol_ids": [ - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "ff44881104b65ef50ee6fe16d367d4a81b6e7eb5c44c0963cf4543faec785d4a" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "TraceService.__init__\n -> TraceService.store\n -> TraceService.close_context", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "TraceService.__init__:dataflow_slice", - "span_start": 42, - "span_end": 84, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "7a9353ef57c9ae5d19b3a0c6ac50fad05e6d21d31bbe1cd1cd07af6332ba6505", - "edge_type": "dataflow_slice", - "src_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "src_qname": "TraceService.__init__", - "dst_symbol_id": "01e14158dcced7e52d0c8ac84ac7b9a75225c261b6aca6a1d7da802d0994721c", - "dst_ref": "TraceService.close_context", - "resolution": "resolved", - "slice_id": "7a9353ef57c9ae5d19b3a0c6ac50fad05e6d21d31bbe1cd1cd07af6332ba6505", - "root_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "path_symbols": [ - "TraceService.__init__", - "TraceService.store", - "TraceService.close_context" - ], - "path_symbol_ids": [ - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "01e14158dcced7e52d0c8ac84ac7b9a75225c261b6aca6a1d7da802d0994721c" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "TraceService.__init__\n -> TraceService.store\n -> TraceService.open_context", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "TraceService.__init__:dataflow_slice", - "span_start": 42, - "span_end": 78, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "a6e13b9ebc4fed84586afd53ed92a4d14757e440873f572b2337d5622ee96031", - "edge_type": "dataflow_slice", - "src_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "src_qname": "TraceService.__init__", - "dst_symbol_id": "2da3d5b20a947bf63e14c103be4689b72fd837e0a82abd6c497846375d4c7426", - "dst_ref": "TraceService.open_context", - "resolution": "resolved", - "slice_id": "a6e13b9ebc4fed84586afd53ed92a4d14757e440873f572b2337d5622ee96031", - "root_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "path_symbols": [ - "TraceService.__init__", - "TraceService.store", - "TraceService.open_context" - ], - "path_symbol_ids": [ - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "2da3d5b20a947bf63e14c103be4689b72fd837e0a82abd6c497846375d4c7426" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "TraceService.__init__\n -> TraceService.transport\n -> TraceService.__init__", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "TraceService.__init__:dataflow_slice", - "span_start": 41, - "span_end": 43, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "1e923a93faa05c3c43ca9b19bd047007a8589ccce57d3cc1798ae7f9f200af98", - "edge_type": "dataflow_slice", - "src_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "src_qname": "TraceService.__init__", - "dst_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "dst_ref": "TraceService.__init__", - "resolution": "resolved", - "slice_id": "1e923a93faa05c3c43ca9b19bd047007a8589ccce57d3cc1798ae7f9f200af98", - "root_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "path_symbols": [ - "TraceService.__init__", - "TraceService.transport", - "TraceService.__init__" - ], - "path_symbol_ids": [ - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "TraceService.__init__\n -> TraceService.store\n -> TraceService.current_trace_id", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "TraceService.__init__:dataflow_slice", - "span_start": 42, - "span_end": 81, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "3ea17138634b1190bded77ddb84aa1595124f6519b246f24fc4b02bd62b5cac1", - "edge_type": "dataflow_slice", - "src_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "src_qname": "TraceService.__init__", - "dst_symbol_id": "41135180f7b3b9ab20e097e0747474e219c37dd2366ef08a7b43c1f3edb10b4c", - "dst_ref": "TraceService.current_trace_id", - "resolution": "resolved", - "slice_id": "3ea17138634b1190bded77ddb84aa1595124f6519b246f24fc4b02bd62b5cac1", - "root_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "path_symbols": [ - "TraceService.__init__", - "TraceService.store", - "TraceService.current_trace_id" - ], - "path_symbol_ids": [ - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "41135180f7b3b9ab20e097e0747474e219c37dd2366ef08a7b43c1f3edb10b4c" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "TraceService.__init__\n -> TraceService.store\n -> TraceService.step", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "TraceService.__init__:dataflow_slice", - "span_start": 42, - "span_end": 88, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "9f34c5da9b09fba99df6f6b1bde183a9aeb45111b8218a747c71590c2c9f60f2", - "edge_type": "dataflow_slice", - "src_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "src_qname": "TraceService.__init__", - "dst_symbol_id": "c44bfbc66cf747283f30088da3e011a10395031d41e77b74e523c24997f641ca", - "dst_ref": "TraceService.step", - "resolution": "resolved", - "slice_id": "9f34c5da9b09fba99df6f6b1bde183a9aeb45111b8218a747c71590c2c9f60f2", - "root_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "path_symbols": [ - "TraceService.__init__", - "TraceService.store", - "TraceService.step" - ], - "path_symbol_ids": [ - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "c44bfbc66cf747283f30088da3e011a10395031d41e77b74e523c24997f641ca" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "class TraceRecordWriter:\n def __init__(self, transport: TraceTransport) -> None:\n self._logger = logging.getLogger(__name__)\n self._transport = transport\n\n def write_context(self, record: TraceContextRecord) -> None:\n try:\n self._transport.write_context(record)\n except Exception:\n self._logger.exception(\"Trace transport failed to write context %s\", record.trace_id)\n\n def write_message(self, record: TraceLogMessage) -> None:\n try:\n self._transport.write_message(record)\n except Exception:\n self._logger.exception(\"Trace transport failed to write message for %s\", record.trace_id)", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/tracing/service.py:TraceRecordWriter", - "span_start": 21, - "span_end": 36, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.tracing.service", - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "class TraceService(TraceContextFactory):\n def __init__(self, transport: TraceTransport | None = None, store: TraceContextStore | None = None) -> None:\n self.transport = transport or NoOpTraceTransport()\n self.store = store or TraceContextStore()\n self._writer = TraceRecordWriter(self.transport)\n\n def create_context(\n self,\n *,\n alias: str,\n parent_id: str | None = None,\n kind: str | None = None,\n attrs: dict[str, Any] | None = None,\n ) -> str:\n record = TraceContextRecord(\n trace_id=uuid4().hex,\n alias=str(alias or \"\"),\n parent_id=parent_id,\n type=kind,\n event_time=utc_now(),\n attrs=dict(attrs or {}),\n )\n self.store.push(record)\n self._writer.write_context(record)\n return record.trace_id\n\n @contextmanager\n def open_context(\n self,\n *,\n alias: str,\n parent_id: str | None = None,\n kind: str | None = None,\n attrs: dict[str, Any] | None = None,\n ) -> Iterator[str]:\n trace_id = self.create_context(alias=alias, parent_id=parent_id, kind=kind, attrs=attrs)\n try:\n yield trace_id\n finally:\n self.store.pop()\n\n def current_trace_id(self) -> str | None:\n return self.store.current_trace_id()\n\n def close_context(self) -> str | None:\n previous = self.store.pop()\n return previous.record.trace_id if previous else None\n\n def step(self, name: str) -> None:\n self.store.set_step(str(name or \"\"))\n\n def info(self, message: str, *, status: str | None = None, attrs: dict[str, Any] | None = None) -> None:\n self._write_message(\"INFO\", message, status, attrs)\n\n def debug(self, message: str, *, status: str | None = None, attrs: dict[str, Any] | None = None) -> None:\n self._write_message(\"DEBUG\", message, status, attrs)\n\n def warning(self, message: str, *, status: str | None = None, attrs: dict[str, Any] | None = None) -> None:\n self._write_message(\"WARNING\", message, status, attrs)\n\n def error(self, message: str, *, status: str | None = None, attrs: dict[str, Any] | None = None) -> None:\n self._write_message(\"ERROR\", message, status, attrs)\n\n def exception(self, message: str, *, status: str = \"failed\", attrs: dict[str, Any] | None = None) -> None:\n self._write_message(\"ERROR\", message, status, attrs)\n\n def new_root(self, operation: str) -> TraceContext:\n trace_id = self.create_context(alias=operation, kind=\"operation\", attrs={\"operation\": operation})\n return TraceContext(trace_id=trace_id, span_id=trace_id, attributes={\"operation\": operation})\n\n def child_of(self, parent: TraceContext, operation: str) -> TraceContext:\n trace_id = self.create_context(\n alias=operation,\n parent_id=parent.trace_id,\n kind=\"worker\",\n attrs={\"operation\": operation},\n )\n return TraceContext(\n trace_id=trace_id,\n span_id=trace_id,\n parent_span_id=parent.span_id,\n attributes={\"operation\": operation},\n )\n\n def attach(self, metadata: dict[str, object], context: TraceContext) -> dict[str, object]:\n updated = dict(metadata)\n updated[\"trace_id\"] = context.trace_id\n updated[\"span_id\"] = context.span_id\n updated[\"parent_span_id\"] = context.parent_span_id\n return updated\n\n def resume(self, metadata: dict[str, object], operation: str) -> TraceContext:\n trace_id = str(metadata.get(\"trace_id\") or uuid4().hex)\n span_id = str(metadata.get(\"span_id\") or trace_id)\n parent_id = metadata.get(\"parent_span_id\")\n self.create_context(\n alias=operation,\n parent_id=str(parent_id) if parent_id else None,\n kind=\"worker\",\n attrs=dict(metadata),\n )\n return TraceContext(\n trace_id=trace_id,\n span_id=span_id,\n parent_span_id=str(parent_id) if parent_id else None,\n attributes={\"operation\": operation},\n )\n\n def _write_message(\n self,\n level: TraceLevel,\n message: str,\n status: str | None,\n attrs: dict[str, Any] | None,\n ) -> None:\n active = self.store.current()\n if active is None:\n raise RuntimeError(\"Trace context is not bound. Call create_context() first.\")\n record = TraceLogMessage(\n trace_id=active.record.trace_id,\n step=active.step,\n status=str(status or \"\"),\n message=str(message or \"\"),\n level=level,\n event_time=utc_now(),\n attrs=dict(attrs or {}),\n )\n self._writer.write_message(record)", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/tracing/service.py:TraceService", - "span_start": 39, - "span_end": 166, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 1, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.tracing.service", - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "class TraceManager(TraceService):\n \"\"\"Compatibility alias during the transition from ConfigManager-shaped naming.\"\"\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/tracing/service.py:TraceManager", - "span_start": 169, - "span_end": 170, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 2, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.tracing.service", - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ] - }, - "diagnostics": { - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C0_SOURCE_CHUNKS": "exact_path_fetch", - "C4_SEMANTIC_ROLES": "exact_path_fetch", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C3_ENTRYPOINTS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 8, - "C4_SEMANTIC_ROLES": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C3_ENTRYPOINTS": 6 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C4_SEMANTIC_ROLES": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "TraceService", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "TraceService", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C4_SEMANTIC_ROLES", - "query": "TraceService", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "TraceService", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - }, - { - "layer": "C3_ENTRYPOINTS", - "query": "TraceService", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 1, - "candidates_after_filter": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 6, - "candidates_after_filter": 6 - }, - { - "layer": "C3_ENTRYPOINTS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 3, - "candidates_after_filter": 3 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "TraceService", - "alternatives": [ - "TraceService" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 3, - "fail_reason": null - }, - { - "layer": "C4_SEMANTIC_ROLES", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 6, - "fail_reason": null - }, - { - "layer": "C3_ENTRYPOINTS", - "status": "hit", - "hit_count": 3, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "symbol_resolution": 0, - "retrieval_total": 114, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 26, - "C0_SOURCE_CHUNKS": 13, - "C4_SEMANTIC_ROLES": 15, - "C2_DEPENDENCY_GRAPH": 49, - "C3_ENTRYPOINTS": 8 - }, - "merge_rank": 16 - } - } - }, - { - "step": "llm_answer", - "input": { - "query": "Объясни как работает класс TraceService", - "rag_count": 14 - }, - "output": { - "llm_answer": "1. Что это и где определено.\nСущность `TraceService` объявлена в файле `src/app_runtime/tracing/service.py`. Это класс-наследник от `TraceContextFactory`.\n\n2. Назначение по наблюдаемому коду.\nКласс предназначен для работы с трассировкой контекста выполнения приложения. Он создаёт и управляет контекстами трассировки, записывает их в хранилище (`store`) и отправляет на транспорт (`transport`), обеспечивая запись логических сообщений и контекстных данных о выполнении программы.\n\n3. Подтверждённые зависимости или взаимодействия.\n- Создаёт и записывает записи контекста трассировки через метод `create_context()`, используя хранилище контекста (`store`) и транспорт (`transport`).\n- Использует контекстный менеджер `open_context()` для открытия временных контекстов.\n- Вызывает методы записи контекста и сообщений через экземпляр класса `TraceRecordWriter`.\n\n4. Что делает по шагам, если это видно в контексте.\n- В конструкторе инициализирует переменные `transport` и `store`, устанавливает транспорт по умолчанию как `NoOpTraceTransport()` и хранилище как `TraceContextStore()`.\n- Метод `create_context()` создает новую запись контекста трассировки с заданными параметрами, сохраняет её в хранилище и записывает через транспорт.\n- Контекстный менеджер `open_context()` открывает временный контекст, создавая запись контекста с помощью метода `create_context()`.\n\n5. Осторожные выводы.\nНа данный момент нет явных признаков критичных недостатков в понимании поведения класса. Однако более глубокий анализ его использования вне представленного контекста может выявить дополнительные аспекты его применения.\n\n6. Чего не хватает для полного объяснения.\nДля полной картины необходимо рассмотреть следующие моменты:\n- Реализацию методов, которые вызываются внутри класса, таких как работа транспорта и хранилища контекста.\n- Дополнительные контексты использования и интеграции с другими компонентами системы.\n- Возможное поведение при ошибках и исключениях, связанных с транспортом и хранилищем." - }, - "diagnostics": { - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 991, - "evidence_rows": 14, - "evidence_chars": 6323 - }, - "evidence_summary": [ - { - "layer": "C1_SYMBOL_CATALOG", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "count": 6, - "unique_paths": 1 - }, - { - "layer": "C3_ENTRYPOINTS", - "count": 3, - "unique_paths": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 3, - "unique_paths": 1 - } - ], - "prompt_template_id": "intent_code_qa_explain_ru_v2", - "system_prompt_version": "v1" - }, - "timings_ms": { - "prompt_build": 0, - "llm_call": 2998 - } - } - } - ] - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_125536/full_chain_plba_code_subintents_v2_plba-v2-explain-trace-service.md b/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_125536/full_chain_plba_code_subintents_v2_plba-v2-explain-trace-service.md deleted file mode 100644 index 908bc0a..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_125536/full_chain_plba_code_subintents_v2_plba-v2-explain-trace-service.md +++ /dev/null @@ -1,34 +0,0 @@ -# plba-v2-explain-trace-service - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_subintents_v2.yaml -- runner: runtime -- mode: full_chain -- passed: True - -## Query -Объясни как работает класс TraceService - -## Actual -{ - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 14, - "llm_answer": "1. Что это и где определено.\nСущность `TraceService` объявлена в файле `src/app_runtime/tracing/service.py`. Это класс-наследник от `TraceContextFactory`.\n\n2. Назначение по наблюдаемому коду.\nКласс предназначен для работы с трассировкой контекста выполнения приложения. Он создаёт и управляет контекстами трассировки, записывает их в хранилище (`store`) и отправляет на транспорт (`transport`), обеспечивая запись логических сообщений и контекстных данных о выполнении программы.\n\n3. Подтверждённые зависимости или взаимодействия.\n- Создаёт и записывает записи контекста трассировки через метод `create_context()`, используя хранилище контекста (`store`) и транспорт (`transport`).\n- Использует контекстный менеджер `open_context()` для открытия временных контекстов.\n- Вызывает методы записи контекста и сообщений через экземпляр класса `TraceRecordWriter`.\n\n4. Что делает по шагам, если это видно в контексте.\n- В конструкторе инициализирует переменные `transport` и `store`, устанавливает транспорт по умолчанию как `NoOpTraceTransport()` и хранилище как `TraceContextStore()`.\n- Метод `create_context()` создает новую запись контекста трассировки с заданными параметрами, сохраняет её в хранилище и записывает через транспорт.\n- Контекстный менеджер `open_context()` открывает временный контекст, создавая запись контекста с помощью метода `create_context()`.\n\n5. Осторожные выводы.\nНа данный момент нет явных признаков критичных недостатков в понимании поведения класса. Однако более глубокий анализ его использования вне представленного контекста может выявить дополнительные аспекты его применения.\n\n6. Чего не хватает для полного объяснения.\nДля полной картины необходимо рассмотреть следующие моменты:\n- Реализацию методов, которые вызываются внутри класса, таких как работа транспорта и хранилища контекста.\n- Дополнительные контексты использования и интеграции с другими компонентами системы.\n- Возможное поведение при ошибках и исключениях, связанных с транспортом и хранилищем.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "TraceService" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] -} - -## Mismatches -- none \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_125536/full_chain_plba_code_subintents_v2_plba-v2-find-entrypoints-control-plane.json b/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_125536/full_chain_plba_code_subintents_v2_plba-v2-find-entrypoints-control-plane.json deleted file mode 100644 index f723538..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_125536/full_chain_plba_code_subintents_v2_plba-v2-find-entrypoints-control-plane.json +++ /dev/null @@ -1,1236 +0,0 @@ -{ - "case_id": "plba-v2-find-entrypoints-control-plane", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_subintents_v2.yaml", - "runner": "runtime", - "mode": "full_chain", - "actual": { - "intent": "CODE_QA", - "sub_intent": "FIND_ENTRYPOINTS", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 9, - "llm_answer": "Подтверждённые точки входа:\nsrc/app_runtime/control/http_app.py | fastapi http app.get\n- Объявлена декоратором @app.get, что указывает на точку входа для HTTP-запросов.\nsrc/app_runtime/control/http_app.py | fastapi http app.post\n- Объявлена декоратором @app.post, что указывает на точку входа для HTTP-запросов.\n\nВозможные кандидаты:\nsrc/app_runtime/control/http_channel.py | HttpControlChannel.start\n- Метод класса, вызывающий инициализацию FastAPI приложения через фабрику HttpControlAppFactory, однако прямого признака точки входа нет.\nsrc/app_runtime/control/http_channel.py | HttpControlChannel._health_response\n- Внутренний метод, возвращающий здоровье системы, но явно не указан как точка входа.\nsrc/app_runtime/control/http_channel.py | HttpControlChannel._action_response\n- Внутренний метод, обрабатывающий запросы к действиям, но явно не указан как точка входа.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "HTTP", - "control", - "plane" - ], - "layers": [ - "C3_ENTRYPOINTS", - "C0_SOURCE_CHUNKS" - ] - }, - "passed": true, - "mismatches": [], - "details": { - "case_id": "plba-v2-find-entrypoints-control-plane", - "text": "Найди точки входа HTTP control plane", - "mode": "full_chain", - "run_started_at": "2026-03-12T12:55:37", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Найди точки входа HTTP control plane", - "symbol_resolution": { - "status": "not_found", - "resolved_symbol": null, - "alternatives": [ - "HTTP", - "control", - "plane" - ], - "confidence": 0.0 - }, - "rag_count": 9, - "rag_rows": [ - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "class HttpControlChannel(ControlChannel):\n def __init__(self, host: str, port: int, timeout: int) -> None:\n self._timeout = timeout\n self._runner = UvicornThreadRunner(host, port, timeout)\n self._factory = HttpControlAppFactory()\n self._actions: ControlActionSet | None = None\n\n async def start(self, actions: ControlActionSet) -> None:\n self._actions = actions\n app = self._factory.create(self._health_response, self._action_response)\n await self._runner.start(app)\n\n async def stop(self) -> None:\n await self._runner.stop()\n\n @property\n def port(self) -> int:\n return self._runner.port\n\n async def _health_response(self) -> dict[str, object]:\n if self._actions is None:\n return {\"status\": \"unhealthy\", \"detail\": \"control actions are not configured\"}\n return await asyncio.wait_for(self._actions.health(), timeout=float(self._timeout))\n\n async def _action_response(self, action: str, _client_source: str = \"unknown\") -> JSONResponse:\n if self._actions is None:\n return JSONResponse(content={\"status\": \"error\", \"detail\": f\"{action} handler is not configured\"}, status_code=404)\n callbacks = {\n \"start\": self._actions.start,\n \"stop\": self._actions.stop,\n \"status\": self._actions.status,\n }\n callback = callbacks.get(action)\n if callback is None:\n return JSONResponse(content={\"status\": \"error\", \"detail\": f\"unsupported action: {action}\"}, status_code=404)\n action_timeout = max(float(self._timeout), 10.0) if action in {\"start\", \"stop\"} else float(self._timeout)\n try:\n detail = await asyncio.wait_for(callback(), timeout=action_timeout)\n except asyncio.TimeoutError:\n return JSONResponse(\n content={\"status\": \"accepted\", \"detail\": f\"{action} operation is still in progress\"},\n status_code=202,\n )\n except Exception as exc:\n return JSONResponse(content={\"status\": \"error\", \"detail\": str(exc)}, status_code=500)\n return JSONResponse(content={\"status\": \"ok\", \"detail\": detail or f\"{action} action accepted\"}, status_code=200)", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/http_channel.py:HttpControlChannel", - "span_start": 12, - "span_end": 57, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.http_channel", - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "class HttpControlAppFactory:\n def create(\n self,\n health_provider: Callable[[], Awaitable[HealthPayload]],\n action_provider: Callable[[str, str], Awaitable[JSONResponse]],\n ) -> FastAPI:\n app = FastAPI(title=\"PLBA Control API\")\n\n @app.middleware(\"http\")\n async def log_api_call(request: Request, call_next): # type: ignore[no-untyped-def]\n started = time.monotonic()\n response = await call_next(request)\n response.headers[\"X-Response-Time-Ms\"] = str(int((time.monotonic() - started) * 1000))\n return response\n\n @app.get(\"/health\")\n async def health() -> JSONResponse:\n payload = await health_provider()\n status_code = 200 if payload.get(\"status\") == \"ok\" else 503\n return JSONResponse(content=payload, status_code=status_code)\n\n @app.get(\"/actions/{action}\")\n @app.post(\"/actions/{action}\")\n async def action(action: str, request: Request) -> JSONResponse:\n client_source = self._client_source(request)\n if action in {\"start\", \"stop\"}:\n LOGGER.warning(\"Control action requested: /actions/%s client=%s\", action, client_source)\n return await action_provider(action, client_source)\n\n return app\n\n def _client_source(self, request: Request) -> str:\n explicit_header = request.headers.get(\"X-Client-Source\", \"\").strip()\n if explicit_header:\n return explicit_header\n user_agent = request.headers.get(\"User-Agent\", \"\").strip()\n if user_agent:\n return f\"user-agent:{user_agent}\"\n return \"unknown\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/http_app.py:HttpControlAppFactory", - "span_start": 15, - "span_end": 53, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.http_app", - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "class ControlActionSet:\n health: HealthHandler\n start: ActionHandler\n stop: ActionHandler\n status: ActionHandler", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/base.py:ControlActionSet", - "span_start": 14, - "span_end": 18, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.base", - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/__init__.py", - "content": "from app_runtime.control.base import ControlActionSet, ControlChannel\nfrom app_runtime.control.http_channel import HttpControlChannel\nfrom app_runtime.control.service import ControlPlaneService\n\n__all__ = [\"ControlActionSet\", \"ControlChannel\", \"ControlPlaneService\", \"HttpControlChannel\"]", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/__init__.py:1-5", - "span_start": 1, - "span_end": 5, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.app_runtime.control.__init__", - "is_test": false, - "blob_sha": "bf3c37e3369a84cc618adc0fd71c232e5eb4b871eaff743069a17e661e498316", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "class ControlChannel(ABC):\n @abstractmethod\n async def start(self, actions: ControlActionSet) -> None:\n \"\"\"Start the control channel and bind handlers.\"\"\"\n\n @abstractmethod\n async def stop(self) -> None:\n \"\"\"Stop the control channel and release resources.\"\"\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/base.py:ControlChannel", - "span_start": 21, - "span_end": 28, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 1, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.base", - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_runner.py", - "content": "class UvicornThreadRunner:\n def __init__(self, host: str, port: int, timeout: int) -> None:\n self._host = host\n self._port = port\n self._timeout = timeout\n self._server: Server | None = None\n self._thread: Thread | None = None\n self._error: BaseException | None = None\n\n async def start(self, app: FastAPI) -> None:\n if self._thread is not None and self._thread.is_alive():\n return\n self._error = None\n config = Config(app=app, host=self._host, port=self._port, log_level=\"warning\")\n self._server = Server(config)\n self._thread = Thread(target=self._serve, name=\"plba-http-control\", daemon=True)\n self._thread.start()\n await self._wait_until_started()\n\n async def stop(self) -> None:\n if self._server is None or self._thread is None:\n return\n self._server.should_exit = True\n await asyncio.to_thread(self._thread.join, self._timeout)\n self._server = None\n self._thread = None\n\n @property\n def port(self) -> int:\n if self._server is None or not getattr(self._server, \"servers\", None):\n return self._port\n socket = self._server.servers[0].sockets[0]\n return int(socket.getsockname()[1])\n\n async def _wait_until_started(self) -> None:\n if self._server is None:\n raise RuntimeError(\"Server is not initialized\")\n deadline = asyncio.get_running_loop().time() + max(float(self._timeout), 1.0)\n while not self._server.started:\n if self._error is not None:\n raise RuntimeError(\"HTTP control server failed to start\") from self._error\n if asyncio.get_running_loop().time() >= deadline:\n raise TimeoutError(\"HTTP control server startup timed out\")\n await asyncio.sleep(0.05)\n\n def _serve(self) -> None:\n if self._server is None:\n return\n try:\n asyncio.run(self._server.serve())\n except BaseException as exc: # noqa: BLE001\n self._error = exc", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/http_runner.py:UvicornThreadRunner", - "span_start": 10, - "span_end": 61, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.http_runner", - "is_test": false, - "blob_sha": "3779fdd2878b770e789a35bb2a89c9d79f13b61c26d7db1b3b683f9bb9e1623f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "llm_answer": "Подтверждённые точки входа:\nsrc/app_runtime/control/http_app.py | fastapi http app.get\n- Объявлена декоратором @app.get, что указывает на точку входа для HTTP-запросов.\nsrc/app_runtime/control/http_app.py | fastapi http app.post\n- Объявлена декоратором @app.post, что указывает на точку входа для HTTP-запросов.\n\nВозможные кандидаты:\nsrc/app_runtime/control/http_channel.py | HttpControlChannel.start\n- Метод класса, вызывающий инициализацию FastAPI приложения через фабрику HttpControlAppFactory, однако прямого признака точки входа нет.\nsrc/app_runtime/control/http_channel.py | HttpControlChannel._health_response\n- Внутренний метод, возвращающий здоровье системы, но явно не указан как точка входа.\nsrc/app_runtime/control/http_channel.py | HttpControlChannel._action_response\n- Внутренний метод, обрабатывающий запросы к действиям, но явно не указан как точка входа.", - "summary": { - "router": { - "intent": "CODE_QA", - "sub_intent": "FIND_ENTRYPOINTS", - "confidence": null - }, - "retrieval": { - "profile": "code", - "layers_hit": [ - "C0_SOURCE_CHUNKS", - "C3_ENTRYPOINTS" - ], - "evidence_sufficient": true - }, - "llm": { - "answer_status": "answered", - "groundedness": "grounded" - } - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "FIND_ENTRYPOINTS", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C3_ENTRYPOINTS", - "C0_SOURCE_CHUNKS" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "HTTP", - "control", - "plane" - ], - "keyword_hints": [ - "HTTP", - "control", - "plane" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "execution": { - "executed_layers": [ - "C3_ENTRYPOINTS", - "C0_SOURCE_CHUNKS" - ], - "retrieval_mode_by_layer": { - "C3_ENTRYPOINTS": "exact_path_fetch", - "C0_SOURCE_CHUNKS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C3_ENTRYPOINTS": 12, - "C0_SOURCE_CHUNKS": 6 - }, - "filters_by_layer": { - "C3_ENTRYPOINTS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C3_ENTRYPOINTS", - "query": "Найди точки входа HTTP control plane", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 12, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Найди точки входа HTTP control plane", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C3_ENTRYPOINTS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 3, - "candidates_after_filter": 3 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 6, - "candidates_after_filter": 6 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "not_found", - "resolved_symbol": null, - "alternatives": [ - "HTTP", - "control", - "plane" - ] - }, - "layers": [ - { - "layer": "C3_ENTRYPOINTS", - "status": "hit", - "hit_count": 3, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 6, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "router": 0, - "symbol_resolution": 0, - "retrieval_total": 50, - "retrieval_by_layer": { - "C3_ENTRYPOINTS": 24, - "C0_SOURCE_CHUNKS": 25 - }, - "merge_rank": 0, - "prompt_build": 0, - "llm_call": 1624 - }, - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 1094, - "evidence_rows": 9, - "evidence_chars": 6731 - }, - "evidence_summary": [ - { - "layer": "C3_ENTRYPOINTS", - "count": 3, - "unique_paths": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 6, - "unique_paths": 5 - } - ], - "prompt_template_id": "intent_code_qa_find_entrypoints_ru_v2", - "system_prompt_version": "v1" - }, - "router": { - "conversation_mode": "START", - "keyword_hints": [ - "HTTP", - "control", - "plane" - ], - "path_scope": [] - }, - "llm": { - "used_evidence_count": 9, - "missing_evidence_reason": null - } - }, - "run_info": { - "case_id": "plba-v2-find-entrypoints-control-plane", - "mode": "full_chain", - "run_started_at": "2026-03-12T12:55:37", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - }, - "input_request": { - "text": "Найди точки входа HTTP control plane", - "normalized_query": "Найди точки входа HTTP control plane" - }, - "steps": [ - { - "step": "intent_router", - "input": { - "query": "Найди точки входа HTTP control plane" - }, - "output": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Найди точки входа HTTP control plane" - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "FIND_ENTRYPOINTS", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C3_ENTRYPOINTS", - "C0_SOURCE_CHUNKS" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "HTTP", - "control", - "plane" - ], - "keyword_hints": [ - "HTTP", - "control", - "plane" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "timings_ms": { - "router": 0 - } - } - }, - { - "step": "retrieval", - "input": { - "query": "Найди точки входа HTTP control plane" - }, - "output": { - "symbol_resolution": { - "status": "not_found", - "resolved_symbol": null, - "alternatives": [ - "HTTP", - "control", - "plane" - ], - "confidence": 0.0 - }, - "rag_count": 9, - "rag_rows": [ - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "class HttpControlChannel(ControlChannel):\n def __init__(self, host: str, port: int, timeout: int) -> None:\n self._timeout = timeout\n self._runner = UvicornThreadRunner(host, port, timeout)\n self._factory = HttpControlAppFactory()\n self._actions: ControlActionSet | None = None\n\n async def start(self, actions: ControlActionSet) -> None:\n self._actions = actions\n app = self._factory.create(self._health_response, self._action_response)\n await self._runner.start(app)\n\n async def stop(self) -> None:\n await self._runner.stop()\n\n @property\n def port(self) -> int:\n return self._runner.port\n\n async def _health_response(self) -> dict[str, object]:\n if self._actions is None:\n return {\"status\": \"unhealthy\", \"detail\": \"control actions are not configured\"}\n return await asyncio.wait_for(self._actions.health(), timeout=float(self._timeout))\n\n async def _action_response(self, action: str, _client_source: str = \"unknown\") -> JSONResponse:\n if self._actions is None:\n return JSONResponse(content={\"status\": \"error\", \"detail\": f\"{action} handler is not configured\"}, status_code=404)\n callbacks = {\n \"start\": self._actions.start,\n \"stop\": self._actions.stop,\n \"status\": self._actions.status,\n }\n callback = callbacks.get(action)\n if callback is None:\n return JSONResponse(content={\"status\": \"error\", \"detail\": f\"unsupported action: {action}\"}, status_code=404)\n action_timeout = max(float(self._timeout), 10.0) if action in {\"start\", \"stop\"} else float(self._timeout)\n try:\n detail = await asyncio.wait_for(callback(), timeout=action_timeout)\n except asyncio.TimeoutError:\n return JSONResponse(\n content={\"status\": \"accepted\", \"detail\": f\"{action} operation is still in progress\"},\n status_code=202,\n )\n except Exception as exc:\n return JSONResponse(content={\"status\": \"error\", \"detail\": str(exc)}, status_code=500)\n return JSONResponse(content={\"status\": \"ok\", \"detail\": detail or f\"{action} action accepted\"}, status_code=200)", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/http_channel.py:HttpControlChannel", - "span_start": 12, - "span_end": 57, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.http_channel", - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "class HttpControlAppFactory:\n def create(\n self,\n health_provider: Callable[[], Awaitable[HealthPayload]],\n action_provider: Callable[[str, str], Awaitable[JSONResponse]],\n ) -> FastAPI:\n app = FastAPI(title=\"PLBA Control API\")\n\n @app.middleware(\"http\")\n async def log_api_call(request: Request, call_next): # type: ignore[no-untyped-def]\n started = time.monotonic()\n response = await call_next(request)\n response.headers[\"X-Response-Time-Ms\"] = str(int((time.monotonic() - started) * 1000))\n return response\n\n @app.get(\"/health\")\n async def health() -> JSONResponse:\n payload = await health_provider()\n status_code = 200 if payload.get(\"status\") == \"ok\" else 503\n return JSONResponse(content=payload, status_code=status_code)\n\n @app.get(\"/actions/{action}\")\n @app.post(\"/actions/{action}\")\n async def action(action: str, request: Request) -> JSONResponse:\n client_source = self._client_source(request)\n if action in {\"start\", \"stop\"}:\n LOGGER.warning(\"Control action requested: /actions/%s client=%s\", action, client_source)\n return await action_provider(action, client_source)\n\n return app\n\n def _client_source(self, request: Request) -> str:\n explicit_header = request.headers.get(\"X-Client-Source\", \"\").strip()\n if explicit_header:\n return explicit_header\n user_agent = request.headers.get(\"User-Agent\", \"\").strip()\n if user_agent:\n return f\"user-agent:{user_agent}\"\n return \"unknown\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/http_app.py:HttpControlAppFactory", - "span_start": 15, - "span_end": 53, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.http_app", - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "class ControlActionSet:\n health: HealthHandler\n start: ActionHandler\n stop: ActionHandler\n status: ActionHandler", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/base.py:ControlActionSet", - "span_start": 14, - "span_end": 18, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.base", - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/__init__.py", - "content": "from app_runtime.control.base import ControlActionSet, ControlChannel\nfrom app_runtime.control.http_channel import HttpControlChannel\nfrom app_runtime.control.service import ControlPlaneService\n\n__all__ = [\"ControlActionSet\", \"ControlChannel\", \"ControlPlaneService\", \"HttpControlChannel\"]", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/__init__.py:1-5", - "span_start": 1, - "span_end": 5, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.app_runtime.control.__init__", - "is_test": false, - "blob_sha": "bf3c37e3369a84cc618adc0fd71c232e5eb4b871eaff743069a17e661e498316", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "class ControlChannel(ABC):\n @abstractmethod\n async def start(self, actions: ControlActionSet) -> None:\n \"\"\"Start the control channel and bind handlers.\"\"\"\n\n @abstractmethod\n async def stop(self) -> None:\n \"\"\"Stop the control channel and release resources.\"\"\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/base.py:ControlChannel", - "span_start": 21, - "span_end": 28, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 1, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.base", - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_runner.py", - "content": "class UvicornThreadRunner:\n def __init__(self, host: str, port: int, timeout: int) -> None:\n self._host = host\n self._port = port\n self._timeout = timeout\n self._server: Server | None = None\n self._thread: Thread | None = None\n self._error: BaseException | None = None\n\n async def start(self, app: FastAPI) -> None:\n if self._thread is not None and self._thread.is_alive():\n return\n self._error = None\n config = Config(app=app, host=self._host, port=self._port, log_level=\"warning\")\n self._server = Server(config)\n self._thread = Thread(target=self._serve, name=\"plba-http-control\", daemon=True)\n self._thread.start()\n await self._wait_until_started()\n\n async def stop(self) -> None:\n if self._server is None or self._thread is None:\n return\n self._server.should_exit = True\n await asyncio.to_thread(self._thread.join, self._timeout)\n self._server = None\n self._thread = None\n\n @property\n def port(self) -> int:\n if self._server is None or not getattr(self._server, \"servers\", None):\n return self._port\n socket = self._server.servers[0].sockets[0]\n return int(socket.getsockname()[1])\n\n async def _wait_until_started(self) -> None:\n if self._server is None:\n raise RuntimeError(\"Server is not initialized\")\n deadline = asyncio.get_running_loop().time() + max(float(self._timeout), 1.0)\n while not self._server.started:\n if self._error is not None:\n raise RuntimeError(\"HTTP control server failed to start\") from self._error\n if asyncio.get_running_loop().time() >= deadline:\n raise TimeoutError(\"HTTP control server startup timed out\")\n await asyncio.sleep(0.05)\n\n def _serve(self) -> None:\n if self._server is None:\n return\n try:\n asyncio.run(self._server.serve())\n except BaseException as exc: # noqa: BLE001\n self._error = exc", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/http_runner.py:UvicornThreadRunner", - "span_start": 10, - "span_end": 61, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.http_runner", - "is_test": false, - "blob_sha": "3779fdd2878b770e789a35bb2a89c9d79f13b61c26d7db1b3b683f9bb9e1623f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ] - }, - "diagnostics": { - "execution": { - "executed_layers": [ - "C3_ENTRYPOINTS", - "C0_SOURCE_CHUNKS" - ], - "retrieval_mode_by_layer": { - "C3_ENTRYPOINTS": "exact_path_fetch", - "C0_SOURCE_CHUNKS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C3_ENTRYPOINTS": 12, - "C0_SOURCE_CHUNKS": 6 - }, - "filters_by_layer": { - "C3_ENTRYPOINTS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C3_ENTRYPOINTS", - "query": "Найди точки входа HTTP control plane", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 12, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Найди точки входа HTTP control plane", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C3_ENTRYPOINTS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 3, - "candidates_after_filter": 3 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 6, - "candidates_after_filter": 6 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "not_found", - "resolved_symbol": null, - "alternatives": [ - "HTTP", - "control", - "plane" - ] - }, - "layers": [ - { - "layer": "C3_ENTRYPOINTS", - "status": "hit", - "hit_count": 3, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 6, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "symbol_resolution": 0, - "retrieval_total": 50, - "retrieval_by_layer": { - "C3_ENTRYPOINTS": 24, - "C0_SOURCE_CHUNKS": 25 - }, - "merge_rank": 0 - } - } - }, - { - "step": "llm_answer", - "input": { - "query": "Найди точки входа HTTP control plane", - "rag_count": 9 - }, - "output": { - "llm_answer": "Подтверждённые точки входа:\nsrc/app_runtime/control/http_app.py | fastapi http app.get\n- Объявлена декоратором @app.get, что указывает на точку входа для HTTP-запросов.\nsrc/app_runtime/control/http_app.py | fastapi http app.post\n- Объявлена декоратором @app.post, что указывает на точку входа для HTTP-запросов.\n\nВозможные кандидаты:\nsrc/app_runtime/control/http_channel.py | HttpControlChannel.start\n- Метод класса, вызывающий инициализацию FastAPI приложения через фабрику HttpControlAppFactory, однако прямого признака точки входа нет.\nsrc/app_runtime/control/http_channel.py | HttpControlChannel._health_response\n- Внутренний метод, возвращающий здоровье системы, но явно не указан как точка входа.\nsrc/app_runtime/control/http_channel.py | HttpControlChannel._action_response\n- Внутренний метод, обрабатывающий запросы к действиям, но явно не указан как точка входа." - }, - "diagnostics": { - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 1094, - "evidence_rows": 9, - "evidence_chars": 6731 - }, - "evidence_summary": [ - { - "layer": "C3_ENTRYPOINTS", - "count": 3, - "unique_paths": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 6, - "unique_paths": 5 - } - ], - "prompt_template_id": "intent_code_qa_find_entrypoints_ru_v2", - "system_prompt_version": "v1" - }, - "timings_ms": { - "prompt_build": 0, - "llm_call": 1624 - } - } - } - ] - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_125536/full_chain_plba_code_subintents_v2_plba-v2-find-entrypoints-control-plane.md b/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_125536/full_chain_plba_code_subintents_v2_plba-v2-find-entrypoints-control-plane.md deleted file mode 100644 index 8f025c3..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_125536/full_chain_plba_code_subintents_v2_plba-v2-find-entrypoints-control-plane.md +++ /dev/null @@ -1,33 +0,0 @@ -# plba-v2-find-entrypoints-control-plane - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_subintents_v2.yaml -- runner: runtime -- mode: full_chain -- passed: True - -## Query -Найди точки входа HTTP control plane - -## Actual -{ - "intent": "CODE_QA", - "sub_intent": "FIND_ENTRYPOINTS", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 9, - "llm_answer": "Подтверждённые точки входа:\nsrc/app_runtime/control/http_app.py | fastapi http app.get\n- Объявлена декоратором @app.get, что указывает на точку входа для HTTP-запросов.\nsrc/app_runtime/control/http_app.py | fastapi http app.post\n- Объявлена декоратором @app.post, что указывает на точку входа для HTTP-запросов.\n\nВозможные кандидаты:\nsrc/app_runtime/control/http_channel.py | HttpControlChannel.start\n- Метод класса, вызывающий инициализацию FastAPI приложения через фабрику HttpControlAppFactory, однако прямого признака точки входа нет.\nsrc/app_runtime/control/http_channel.py | HttpControlChannel._health_response\n- Внутренний метод, возвращающий здоровье системы, но явно не указан как точка входа.\nsrc/app_runtime/control/http_channel.py | HttpControlChannel._action_response\n- Внутренний метод, обрабатывающий запросы к действиям, но явно не указан как точка входа.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "HTTP", - "control", - "plane" - ], - "layers": [ - "C3_ENTRYPOINTS", - "C0_SOURCE_CHUNKS" - ] -} - -## Mismatches -- none \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_125536/full_chain_plba_code_subintents_v2_plba-v2-find-entrypoints-health-endpoint.json b/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_125536/full_chain_plba_code_subintents_v2_plba-v2-find-entrypoints-health-endpoint.json deleted file mode 100644 index f2e5f8f..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_125536/full_chain_plba_code_subintents_v2_plba-v2-find-entrypoints-health-endpoint.json +++ /dev/null @@ -1,1197 +0,0 @@ -{ - "case_id": "plba-v2-find-entrypoints-health-endpoint", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_subintents_v2.yaml", - "runner": "runtime", - "mode": "full_chain", - "actual": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 0, - "llm_answer": "Не удалось найти информацию о health endpoint ни в одном из слоёв RAG.\n\n1. **Что это и где определено**: health endpoint обычно представляет собой конечную точку API, используемую для проверки доступности сервиса или приложения. Его точное местоположение зависит от архитектуры приложения и технологий, используемых для его разработки (например, Flask, Django Rest Framework и т.д.).\n \n2. **Назначение по наблюдаемому коду**: отсутствует.\n\n3. **Подтверждённые зависимости или взаимодействия**: отсутствуют.\n\n4. **Что делает по шагам, если это видно в контексте**: не найдено.\n\n5. **Осторожные выводы**: невозможно сделать ввиду отсутствия информации.\n\n6. **Чего не хватает для полного объяснения**: необходимо наличие исходного кода или файла, содержащего определение health endpoint. Без этого нельзя точно определить, где именно он расположен и какие технологии используются.", - "answer_mode": "insufficient_evidence", - "path_scope": [], - "symbol_candidates": [ - "health", - "endpoint" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "passed": false, - "mismatches": [ - "sub_intent: expected FIND_ENTRYPOINTS, got EXPLAIN", - "retrieval: expected non-empty rag, got 0 rows" - ], - "details": { - "case_id": "plba-v2-find-entrypoints-health-endpoint", - "text": "Где health endpoint?", - "mode": "full_chain", - "run_started_at": "2026-03-12T12:55:37", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Где health endpoint?", - "symbol_resolution": { - "status": "not_found", - "resolved_symbol": null, - "alternatives": [ - "HealthContributor.health", - "HealthContributor", - "HealthPayload" - ], - "confidence": 0.0 - }, - "rag_count": 0, - "rag_rows": [], - "llm_answer": "Не удалось найти информацию о health endpoint ни в одном из слоёв RAG.\n\n1. **Что это и где определено**: health endpoint обычно представляет собой конечную точку API, используемую для проверки доступности сервиса или приложения. Его точное местоположение зависит от архитектуры приложения и технологий, используемых для его разработки (например, Flask, Django Rest Framework и т.д.).\n \n2. **Назначение по наблюдаемому коду**: отсутствует.\n\n3. **Подтверждённые зависимости или взаимодействия**: отсутствуют.\n\n4. **Что делает по шагам, если это видно в контексте**: не найдено.\n\n5. **Осторожные выводы**: невозможно сделать ввиду отсутствия информации.\n\n6. **Чего не хватает для полного объяснения**: необходимо наличие исходного кода или файла, содержащего определение health endpoint. Без этого нельзя точно определить, где именно он расположен и какие технологии используются.", - "summary": { - "router": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "confidence": null - }, - "retrieval": { - "profile": "code", - "layers_hit": [], - "evidence_sufficient": false - }, - "llm": { - "answer_status": "insufficient_evidence", - "groundedness": "weakly_grounded" - } - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "symbol_kind_hint": "unknown", - "symbol_candidates": [ - "health", - "endpoint" - ], - "keyword_hints": [ - "health", - "endpoint" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C0_SOURCE_CHUNKS": "exact_path_fetch", - "C4_SEMANTIC_ROLES": "exact_path_fetch", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C3_ENTRYPOINTS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 8, - "C4_SEMANTIC_ROLES": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C3_ENTRYPOINTS": 6 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C4_SEMANTIC_ROLES": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": null, - "workspace_id": null, - "returned_repo_ids": [], - "returned_workspace_ids": [] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "health endpoint", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "health endpoint", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C4_SEMANTIC_ROLES", - "query": "health endpoint", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "health endpoint", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - }, - { - "layer": "C3_ENTRYPOINTS", - "query": "health endpoint", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 3, - "candidates_after_filter": 3 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 6, - "candidates_after_filter": 6 - }, - { - "layer": "C3_ENTRYPOINTS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 3, - "candidates_after_filter": 3 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "not_found", - "resolved_symbol": null, - "alternatives": [ - "HealthContributor.health", - "HealthContributor", - "HealthPayload" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "miss", - "hit_count": 0, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "miss", - "hit_count": 0, - "fail_reason": null - }, - { - "layer": "C4_SEMANTIC_ROLES", - "status": "miss", - "hit_count": 0, - "fail_reason": null - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "miss", - "hit_count": 0, - "fail_reason": null - }, - { - "layer": "C3_ENTRYPOINTS", - "status": "miss", - "hit_count": 0, - "fail_reason": null - } - ] - }, - "constraint_violations": [ - { - "type": "LAYER_MISSING", - "severity": "warn", - "details": { - "layer": "C1_SYMBOL_CATALOG", - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "suggested_fix": "Increase top_k for this layer or relax constraints for retrieval." - }, - { - "type": "LAYER_MISSING", - "severity": "warn", - "details": { - "layer": "C0_SOURCE_CHUNKS", - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "suggested_fix": "Increase top_k for this layer or relax constraints for retrieval." - }, - { - "type": "LAYER_MISSING", - "severity": "warn", - "details": { - "layer": "C4_SEMANTIC_ROLES", - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "suggested_fix": "Increase top_k for this layer or relax constraints for retrieval." - }, - { - "type": "LAYER_MISSING", - "severity": "warn", - "details": { - "layer": "C2_DEPENDENCY_GRAPH", - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "suggested_fix": "Increase top_k for this layer or relax constraints for retrieval." - }, - { - "type": "LAYER_MISSING", - "severity": "warn", - "details": { - "layer": "C3_ENTRYPOINTS", - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "suggested_fix": "Increase top_k for this layer or relax constraints for retrieval." - }, - { - "type": "SYMBOL_RESOLUTION_FAILED", - "severity": "warn", - "details": { - "status": "not_found", - "symbol_candidates": [ - "health", - "endpoint" - ] - }, - "suggested_fix": "Increase symbol layer budget or improve fuzzy symbol resolution settings." - } - ], - "timings_ms": { - "router": 0, - "symbol_resolution": 0, - "retrieval_total": 141, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 43, - "C0_SOURCE_CHUNKS": 19, - "C4_SEMANTIC_ROLES": 18, - "C2_DEPENDENCY_GRAPH": 47, - "C3_ENTRYPOINTS": 12 - }, - "merge_rank": 0, - "prompt_build": 0, - "llm_call": 1499 - }, - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 308, - "evidence_rows": 0, - "evidence_chars": 0 - }, - "evidence_summary": [], - "prompt_template_id": "intent_code_qa_explain_ru_v2", - "system_prompt_version": "v1" - }, - "router": { - "conversation_mode": "START", - "keyword_hints": [ - "health", - "endpoint" - ], - "path_scope": [] - }, - "llm": { - "used_evidence_count": 0, - "missing_evidence_reason": "empty_retrieval_context" - } - }, - "run_info": { - "case_id": "plba-v2-find-entrypoints-health-endpoint", - "mode": "full_chain", - "run_started_at": "2026-03-12T12:55:37", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - }, - "input_request": { - "text": "Где health endpoint?", - "normalized_query": "Где health endpoint?" - }, - "steps": [ - { - "step": "intent_router", - "input": { - "query": "Где health endpoint?" - }, - "output": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Где health endpoint?" - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "symbol_kind_hint": "unknown", - "symbol_candidates": [ - "health", - "endpoint" - ], - "keyword_hints": [ - "health", - "endpoint" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "timings_ms": { - "router": 0 - } - } - }, - { - "step": "retrieval", - "input": { - "query": "Где health endpoint?" - }, - "output": { - "symbol_resolution": { - "status": "not_found", - "resolved_symbol": null, - "alternatives": [ - "HealthContributor.health", - "HealthContributor", - "HealthPayload" - ], - "confidence": 0.0 - }, - "rag_count": 0, - "rag_rows": [] - }, - "diagnostics": { - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C0_SOURCE_CHUNKS": "exact_path_fetch", - "C4_SEMANTIC_ROLES": "exact_path_fetch", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C3_ENTRYPOINTS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 8, - "C4_SEMANTIC_ROLES": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C3_ENTRYPOINTS": 6 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C4_SEMANTIC_ROLES": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": null, - "workspace_id": null, - "returned_repo_ids": [], - "returned_workspace_ids": [] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "health endpoint", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "health endpoint", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C4_SEMANTIC_ROLES", - "query": "health endpoint", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "health endpoint", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - }, - { - "layer": "C3_ENTRYPOINTS", - "query": "health endpoint", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 3, - "candidates_after_filter": 3 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 6, - "candidates_after_filter": 6 - }, - { - "layer": "C3_ENTRYPOINTS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 3, - "candidates_after_filter": 3 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "not_found", - "resolved_symbol": null, - "alternatives": [ - "HealthContributor.health", - "HealthContributor", - "HealthPayload" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "miss", - "hit_count": 0, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "miss", - "hit_count": 0, - "fail_reason": null - }, - { - "layer": "C4_SEMANTIC_ROLES", - "status": "miss", - "hit_count": 0, - "fail_reason": null - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "miss", - "hit_count": 0, - "fail_reason": null - }, - { - "layer": "C3_ENTRYPOINTS", - "status": "miss", - "hit_count": 0, - "fail_reason": null - } - ] - }, - "constraint_violations": [ - { - "type": "LAYER_MISSING", - "severity": "warn", - "details": { - "layer": "C1_SYMBOL_CATALOG", - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "suggested_fix": "Increase top_k for this layer or relax constraints for retrieval." - }, - { - "type": "LAYER_MISSING", - "severity": "warn", - "details": { - "layer": "C0_SOURCE_CHUNKS", - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "suggested_fix": "Increase top_k for this layer or relax constraints for retrieval." - }, - { - "type": "LAYER_MISSING", - "severity": "warn", - "details": { - "layer": "C4_SEMANTIC_ROLES", - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "suggested_fix": "Increase top_k for this layer or relax constraints for retrieval." - }, - { - "type": "LAYER_MISSING", - "severity": "warn", - "details": { - "layer": "C2_DEPENDENCY_GRAPH", - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "suggested_fix": "Increase top_k for this layer or relax constraints for retrieval." - }, - { - "type": "LAYER_MISSING", - "severity": "warn", - "details": { - "layer": "C3_ENTRYPOINTS", - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "suggested_fix": "Increase top_k for this layer or relax constraints for retrieval." - }, - { - "type": "SYMBOL_RESOLUTION_FAILED", - "severity": "warn", - "details": { - "status": "not_found", - "symbol_candidates": [ - "health", - "endpoint" - ] - }, - "suggested_fix": "Increase symbol layer budget or improve fuzzy symbol resolution settings." - } - ], - "timings_ms": { - "symbol_resolution": 0, - "retrieval_total": 141, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 43, - "C0_SOURCE_CHUNKS": 19, - "C4_SEMANTIC_ROLES": 18, - "C2_DEPENDENCY_GRAPH": 47, - "C3_ENTRYPOINTS": 12 - }, - "merge_rank": 0 - } - } - }, - { - "step": "llm_answer", - "input": { - "query": "Где health endpoint?", - "rag_count": 0 - }, - "output": { - "llm_answer": "Не удалось найти информацию о health endpoint ни в одном из слоёв RAG.\n\n1. **Что это и где определено**: health endpoint обычно представляет собой конечную точку API, используемую для проверки доступности сервиса или приложения. Его точное местоположение зависит от архитектуры приложения и технологий, используемых для его разработки (например, Flask, Django Rest Framework и т.д.).\n \n2. **Назначение по наблюдаемому коду**: отсутствует.\n\n3. **Подтверждённые зависимости или взаимодействия**: отсутствуют.\n\n4. **Что делает по шагам, если это видно в контексте**: не найдено.\n\n5. **Осторожные выводы**: невозможно сделать ввиду отсутствия информации.\n\n6. **Чего не хватает для полного объяснения**: необходимо наличие исходного кода или файла, содержащего определение health endpoint. Без этого нельзя точно определить, где именно он расположен и какие технологии используются." - }, - "diagnostics": { - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 308, - "evidence_rows": 0, - "evidence_chars": 0 - }, - "evidence_summary": [], - "prompt_template_id": "intent_code_qa_explain_ru_v2", - "system_prompt_version": "v1" - }, - "timings_ms": { - "prompt_build": 0, - "llm_call": 1499 - } - } - } - ] - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_125536/full_chain_plba_code_subintents_v2_plba-v2-find-entrypoints-health-endpoint.md b/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_125536/full_chain_plba_code_subintents_v2_plba-v2-find-entrypoints-health-endpoint.md deleted file mode 100644 index 5027b13..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_125536/full_chain_plba_code_subintents_v2_plba-v2-find-entrypoints-health-endpoint.md +++ /dev/null @@ -1,36 +0,0 @@ -# plba-v2-find-entrypoints-health-endpoint - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_subintents_v2.yaml -- runner: runtime -- mode: full_chain -- passed: False - -## Query -Где health endpoint? - -## Actual -{ - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 0, - "llm_answer": "Не удалось найти информацию о health endpoint ни в одном из слоёв RAG.\n\n1. **Что это и где определено**: health endpoint обычно представляет собой конечную точку API, используемую для проверки доступности сервиса или приложения. Его точное местоположение зависит от архитектуры приложения и технологий, используемых для его разработки (например, Flask, Django Rest Framework и т.д.).\n \n2. **Назначение по наблюдаемому коду**: отсутствует.\n\n3. **Подтверждённые зависимости или взаимодействия**: отсутствуют.\n\n4. **Что делает по шагам, если это видно в контексте**: не найдено.\n\n5. **Осторожные выводы**: невозможно сделать ввиду отсутствия информации.\n\n6. **Чего не хватает для полного объяснения**: необходимо наличие исходного кода или файла, содержащего определение health endpoint. Без этого нельзя точно определить, где именно он расположен и какие технологии используются.", - "answer_mode": "insufficient_evidence", - "path_scope": [], - "symbol_candidates": [ - "health", - "endpoint" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] -} - -## Mismatches -- sub_intent: expected FIND_ENTRYPOINTS, got EXPLAIN -- retrieval: expected non-empty rag, got 0 rows \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_125536/full_chain_plba_code_subintents_v2_plba-v2-find-tests-create-runtime.json b/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_125536/full_chain_plba_code_subintents_v2_plba-v2-find-tests-create-runtime.json deleted file mode 100644 index bfe2b44..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_125536/full_chain_plba_code_subintents_v2_plba-v2-find-tests-create-runtime.json +++ /dev/null @@ -1,1963 +0,0 @@ -{ - "case_id": "plba-v2-find-tests-create-runtime", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_subintents_v2.yaml", - "runner": "runtime", - "mode": "full_chain", - "actual": { - "intent": "CODE_QA", - "sub_intent": "FIND_TESTS", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 16, - "llm_answer": "1. Прямые тесты:\n - tests/test_runtime.py | test_public_plba_package_exports_runtime_builder_and_worker_contract\n - Проверка: импорты и вызовы create_runtime.\n - Недостаток покрытия: отсутствие проверки поведения функции `create_runtime`.\n\n2. Косвенные или ближайшие тесты:\n - tests/test_business_control_actions.py | _build_runtime\n - Проверка: создание экземпляра `RuntimeManager` и регистрация канала управления.\n - Недостаток покрытия: отсутствует проверка непосредственно создания и работы runtime через функцию `create_runtime`.\n\n3. Что именно проверяется:\n - В direct-тестах проверяются импорты и вызовы функции `create_runtime`, однако поведение самой функции не подтверждено.\n - В косвенных тестах проверяется создание объекта `RuntimeManager` и его начальная настройка, а также работа каналов управления.\n\n4. Пробелы покрытия:\n - Отсутствует прямое тестирование поведения функции `create_runtime`.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "create_runtime" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ] - }, - "passed": true, - "mismatches": [], - "details": { - "case_id": "plba-v2-find-tests-create-runtime", - "text": "Где тесты для create_runtime?", - "mode": "full_chain", - "run_started_at": "2026-03-12T12:55:37", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Где тесты для create_runtime?", - "symbol_resolution": { - "status": "not_found", - "resolved_symbol": null, - "alternatives": [ - "create_runtime" - ], - "confidence": 0.0 - }, - "rag_count": 16, - "rag_rows": [ - { - "path": "tests/test_runtime.py", - "content": "test_public_plba_package_exports_runtime_builder_and_worker_contract imports plba.create_runtime", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_public_plba_package_exports_runtime_builder_and_worker_contract:imports", - "span_start": 349, - "span_end": 349, - "lexical_rank": 6, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e93f80075cd9988737ece3cb5ec659c542132c4d383646e376917bfd0cb6ea64", - "edge_type": "imports", - "src_symbol_id": "ed06ffc5afb8a863cf7da3e40921f17abe4eec2a0770139e3380d93ccaae604a", - "src_qname": "test_public_plba_package_exports_runtime_builder_and_worker_contract", - "dst_symbol_id": null, - "dst_ref": "plba.create_runtime", - "resolution": "partial", - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_runtime.py", - "content": "test_public_plba_package_exports_runtime_builder_and_worker_contract calls create_runtime", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_public_plba_package_exports_runtime_builder_and_worker_contract:calls", - "span_start": 399, - "span_end": 399, - "lexical_rank": 6, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "039939355230de826d8bf7607f55fc59c7d932e5570ecb78994d0f13e57e8488", - "edge_type": "calls", - "src_symbol_id": "ed06ffc5afb8a863cf7da3e40921f17abe4eec2a0770139e3380d93ccaae604a", - "src_qname": "test_public_plba_package_exports_runtime_builder_and_worker_contract", - "dst_symbol_id": null, - "dst_ref": "create_runtime", - "resolution": "partial", - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "test_worker_wakes_up_with_configured_interval\n -> ScenarioWorker\n -> ScenarioWorker.__init__\n -> ScenarioWorker._name\n -> ScenarioWorker.name", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_worker_wakes_up_with_configured_interval:dataflow_slice", - "span_start": 52, - "span_end": 166, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 5, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "2fd137f5852febe907f44d3b3e4ea430f89ccfe962ae1442a16ab9df64c8f76c", - "edge_type": "dataflow_slice", - "src_symbol_id": "65f877f78191d65e6a752e41cedc70ebc784c266804a55c1c56440336e1f0d6e", - "src_qname": "test_worker_wakes_up_with_configured_interval", - "dst_symbol_id": "da022da2c49fd9cfd09d6e6da6bbd59aaa7d28efd669ce8444e88d327ddec2fc", - "dst_ref": "ScenarioWorker.name", - "resolution": "resolved", - "slice_id": "2fd137f5852febe907f44d3b3e4ea430f89ccfe962ae1442a16ab9df64c8f76c", - "root_symbol_id": "65f877f78191d65e6a752e41cedc70ebc784c266804a55c1c56440336e1f0d6e", - "path_symbols": [ - "test_worker_wakes_up_with_configured_interval", - "ScenarioWorker", - "ScenarioWorker.__init__", - "ScenarioWorker._name", - "ScenarioWorker.name" - ], - "path_symbol_ids": [ - "65f877f78191d65e6a752e41cedc70ebc784c266804a55c1c56440336e1f0d6e", - "9a1d08a7eb1831c9f2e0db361b5207f036e477c160773ae08c0b287239785c52", - "9c20be046ba06644d1432e0f20eb223663d2b116ee7d91fdc62bc68323f2e593", - "da022da2c49fd9cfd09d6e6da6bbd59aaa7d28efd669ce8444e88d327ddec2fc" - ], - "path_edge_types": [ - "instantiates", - "writes_attr", - "reads_attr" - ], - "path_length": 5, - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "test_actions_stop_busy_worker_after_timeout\n -> BlockingRoutine\n -> BlockingRoutine.__init__\n -> BlockingRoutine._started\n -> BlockingRoutine.run", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_actions_stop_busy_worker_after_timeout:dataflow_slice", - "span_start": 42, - "span_end": 238, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 5, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "8e7db3d2a9226f1c1d9942ac6373cfcafa0d2276758ddb8a3d3c455a3d58024d", - "edge_type": "dataflow_slice", - "src_symbol_id": "66392d3222421d9ba16eda3554940b16e7d5a6f33aa08c5738d35af2e32f1e4a", - "src_qname": "test_actions_stop_busy_worker_after_timeout", - "dst_symbol_id": "d9841bdbb69706c988ae7ae6adf89928dc4fae45943f74064f5382177034ba04", - "dst_ref": "BlockingRoutine.run", - "resolution": "resolved", - "slice_id": "8e7db3d2a9226f1c1d9942ac6373cfcafa0d2276758ddb8a3d3c455a3d58024d", - "root_symbol_id": "66392d3222421d9ba16eda3554940b16e7d5a6f33aa08c5738d35af2e32f1e4a", - "path_symbols": [ - "test_actions_stop_busy_worker_after_timeout", - "BlockingRoutine", - "BlockingRoutine.__init__", - "BlockingRoutine._started", - "BlockingRoutine.run" - ], - "path_symbol_ids": [ - "66392d3222421d9ba16eda3554940b16e7d5a6f33aa08c5738d35af2e32f1e4a", - "a3349c5bc65e4003a4bbd6a8dbb7a54c337e12d1aed930caa701b12e520f1e67", - "486deeed3043c6db985aef258e96ddc67aa53608e67a83962fbd2471f649ddf1", - "d9841bdbb69706c988ae7ae6adf89928dc4fae45943f74064f5382177034ba04" - ], - "path_edge_types": [ - "instantiates", - "writes_attr", - "reads_attr" - ], - "path_length": 5, - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "test_actions_stop_busy_worker_after_timeout\n -> BlockingRoutine\n -> BlockingRoutine.__init__\n -> BlockingRoutine._release\n -> BlockingRoutine.run", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_actions_stop_busy_worker_after_timeout:dataflow_slice", - "span_start": 43, - "span_end": 238, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 5, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "b59da9da82f9dfc8a9b695a08213786385da1ae9e17561ec3a0450a574a8cb39", - "edge_type": "dataflow_slice", - "src_symbol_id": "66392d3222421d9ba16eda3554940b16e7d5a6f33aa08c5738d35af2e32f1e4a", - "src_qname": "test_actions_stop_busy_worker_after_timeout", - "dst_symbol_id": "d9841bdbb69706c988ae7ae6adf89928dc4fae45943f74064f5382177034ba04", - "dst_ref": "BlockingRoutine.run", - "resolution": "resolved", - "slice_id": "b59da9da82f9dfc8a9b695a08213786385da1ae9e17561ec3a0450a574a8cb39", - "root_symbol_id": "66392d3222421d9ba16eda3554940b16e7d5a6f33aa08c5738d35af2e32f1e4a", - "path_symbols": [ - "test_actions_stop_busy_worker_after_timeout", - "BlockingRoutine", - "BlockingRoutine.__init__", - "BlockingRoutine._release", - "BlockingRoutine.run" - ], - "path_symbol_ids": [ - "66392d3222421d9ba16eda3554940b16e7d5a6f33aa08c5738d35af2e32f1e4a", - "a3349c5bc65e4003a4bbd6a8dbb7a54c337e12d1aed930caa701b12e520f1e67", - "486deeed3043c6db985aef258e96ddc67aa53608e67a83962fbd2471f649ddf1", - "d9841bdbb69706c988ae7ae6adf89928dc4fae45943f74064f5382177034ba04" - ], - "path_edge_types": [ - "instantiates", - "writes_attr", - "reads_attr" - ], - "path_length": 5, - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "test_actions_stop_busy_worker_before_timeout\n -> BlockingRoutine\n -> BlockingRoutine.__init__\n -> BlockingRoutine._started\n -> BlockingRoutine.run", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_actions_stop_busy_worker_before_timeout:dataflow_slice", - "span_start": 42, - "span_end": 212, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 5, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "f9bcce108870e49afa8b32d4625115a10707a3b0e7473179e958e5752bf258b4", - "edge_type": "dataflow_slice", - "src_symbol_id": "a0bb116ca9d909c93a285667ae033fbd1859b2dad7cf34fcb44816393ef6909c", - "src_qname": "test_actions_stop_busy_worker_before_timeout", - "dst_symbol_id": "d9841bdbb69706c988ae7ae6adf89928dc4fae45943f74064f5382177034ba04", - "dst_ref": "BlockingRoutine.run", - "resolution": "resolved", - "slice_id": "f9bcce108870e49afa8b32d4625115a10707a3b0e7473179e958e5752bf258b4", - "root_symbol_id": "a0bb116ca9d909c93a285667ae033fbd1859b2dad7cf34fcb44816393ef6909c", - "path_symbols": [ - "test_actions_stop_busy_worker_before_timeout", - "BlockingRoutine", - "BlockingRoutine.__init__", - "BlockingRoutine._started", - "BlockingRoutine.run" - ], - "path_symbol_ids": [ - "a0bb116ca9d909c93a285667ae033fbd1859b2dad7cf34fcb44816393ef6909c", - "a3349c5bc65e4003a4bbd6a8dbb7a54c337e12d1aed930caa701b12e520f1e67", - "486deeed3043c6db985aef258e96ddc67aa53608e67a83962fbd2471f649ddf1", - "d9841bdbb69706c988ae7ae6adf89928dc4fae45943f74064f5382177034ba04" - ], - "path_edge_types": [ - "instantiates", - "writes_attr", - "reads_attr" - ], - "path_length": 5, - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_runtime.py", - "content": "def test_public_plba_package_exports_runtime_builder_and_worker_contract(tmp_path) -> None:\n import plba\n from plba import ApplicationModule as PublicApplicationModule\n from plba import InMemoryTaskQueue\n from plba import Worker as PublicWorker\n from plba import WorkerHealth as PublicWorkerHealth\n from plba import WorkerStatus as PublicWorkerStatus\n from plba import create_runtime\n\n config_path = tmp_path / \"config.yml\"\n config_path.write_text(\"platform: {}\\n\", encoding=\"utf-8\")\n\n queue = InMemoryTaskQueue[int]()\n queue.put(2)\n assert queue.get(timeout=0.01) == 2\n queue.task_done()\n\n class PublicRoutine:\n def __init__(self) -> None:\n self.runs = 0\n\n def run(self) -> None:\n if self.runs == 0:\n self.runs += 1\n\n class PublicWorkerImpl(PublicWorker):\n def __init__(self, routine: PublicRoutine) -> None:\n self._inner = RoutineWorker(\"public-worker\", routine)\n\n @property\n def name(self) -> str:\n return self._inner.name\n\n @property\n def critical(self) -> bool:\n return self._inner.critical\n\n def start(self) -> None:\n self._inner.start()\n\n def stop(self, force: bool = False) -> None:\n self._inner.stop(force=force)\n\n def health(self) -> PublicWorkerHealth:\n return self._inner.health()\n\n def status(self) -> PublicWorkerStatus:\n return self._inner.status()\n\n class PublicExampleModule(PublicApplicationModule):\n @property\n def name(self) -> str:\n return \"public-example\"\n\n def register(self, registry: ModuleRegistry) -> None:\n registry.add_worker(PublicWorkerImpl(PublicRoutine()))\n\n runtime = create_runtime(PublicExampleModule(), config_path=str(config_path))\n runtime.start()\n sleep(0.2)\n assert runtime.configuration.get() == {\"platform\": {}}\n assert runtime.status()[\"workers\"][\"registered\"] == 1\n assert hasattr(plba, \"QueueWorker\") is False\n runtime.stop()", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_runtime.py:test_public_plba_package_exports_runtime_builder_and_worker_contract", - "span_start": 342, - "span_end": 405, - "lexical_rank": 6, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 13, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_runtime", - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "def _build_runtime(worker: Worker, *, control_timeout: int = 1) -> tuple[RuntimeManager, str]:\n runtime = RuntimeManager()\n channel = HttpControlChannel(host=\"127.0.0.1\", port=0, timeout=control_timeout)\n runtime.control_plane.register_channel(channel)\n runtime.register_module(WorkerModule(worker))\n runtime.start()\n return runtime, f\"http://127.0.0.1:{channel.port}\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:_build_runtime", - "span_start": 154, - "span_end": 160, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 6, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "class IntervalRoutine:\n calls: list[float] = field(default_factory=list)\n _lock: Lock = field(default_factory=Lock)\n\n def run(self) -> None:\n with self._lock:\n self.calls.append(monotonic())\n\n def wait_runs(self, count: int, timeout: float) -> bool:\n deadline = monotonic() + timeout\n while monotonic() < deadline:\n with self._lock:\n if len(self.calls) >= count:\n return True\n sleep(0.01)\n return False\n\n def deltas(self) -> list[float]:\n with self._lock:\n return [self.calls[index + 1] - self.calls[index] for index in range(len(self.calls) - 1)]", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:IntervalRoutine", - "span_start": 18, - "span_end": 37, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "class ScenarioWorker(Worker):\n def __init__(self, name: str, routine: object, *, interval: float = 0.05) -> None:\n self._name = name\n self._routine = routine\n self._interval = interval\n self._thread: Thread | None = None\n self._stop_requested = Event()\n self._in_flight = 0\n self._runs = 0\n self._lock = Lock()\n\n @property\n def name(self) -> str:\n return self._name\n\n @property\n def critical(self) -> bool:\n return True\n\n def start(self) -> None:\n if self._thread is not None and self._thread.is_alive():\n return\n self._stop_requested.clear()\n self._thread = Thread(target=self._loop, name=f\"{self._name}-thread\", daemon=True)\n self._thread.start()\n\n def stop(self, force: bool = False) -> None:\n self._stop_requested.set()\n\n def health(self) -> WorkerHealth:\n return WorkerHealth(name=self.name, status=\"ok\", critical=True, meta={\"runs\": self._runs})\n\n def status(self) -> WorkerStatus:\n thread_alive = self._thread is not None and self._thread.is_alive()\n with self._lock:\n in_flight = self._in_flight\n runs = self._runs\n if not thread_alive:\n state = \"stopped\"\n elif self._stop_requested.is_set():\n state = \"stopping\"\n elif in_flight > 0:\n state = \"busy\"\n else:\n state = \"idle\"\n return WorkerStatus(name=self.name, state=state, in_flight=in_flight, meta={\"runs\": runs})\n\n def _loop(self) -> None:\n while not self._stop_requested.is_set():\n with self._lock:\n self._in_flight += 1\n try:\n self._routine.run()\n with self._lock:\n self._runs += 1\n finally:\n with self._lock:\n self._in_flight -= 1\n if self._stop_requested.is_set():\n return\n sleep(self._interval)", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:ScenarioWorker", - "span_start": 50, - "span_end": 110, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 2, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "def _http_call_json(\n base_url: str,\n path: str,\n *,\n method: str = \"GET\",\n headers: dict[str, str] | None = None,\n) -> tuple[int, dict[str, object]]:\n request = Request(f\"{base_url}{path}\", method=method, headers=headers or {})\n try:\n with urlopen(request, timeout=15.0) as response:\n status = response.status\n body = response.read()\n except HTTPError as error:\n status = error.code\n body = error.read()\n payload = json.loads(body.decode(\"utf-8\"))\n return status, payload", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:_http_call_json", - "span_start": 125, - "span_end": 141, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 4, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "def _poll_until_stopped(base_url: str, timeout: float = 2.0) -> bool:\n deadline = monotonic() + timeout\n while monotonic() < deadline:\n _, payload = _http_call_json(base_url, \"/actions/status\")\n if payload.get(\"detail\") == \"stopped\":\n return True\n sleep(0.05)\n return False", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:_poll_until_stopped", - "span_start": 144, - "span_end": 151, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 5, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "def test_worker_wakes_up_with_configured_interval() -> None:\n interval = 0.15\n routine = IntervalRoutine()\n worker = ScenarioWorker(\"interval-worker\", routine, interval=interval)\n runtime = RuntimeManager()\n runtime.register_module(WorkerModule(worker))\n\n runtime.start()\n try:\n assert routine.wait_runs(count=3, timeout=2.0) is True\n finally:\n runtime.stop()\n\n deltas = routine.deltas()\n assert len(deltas) >= 2\n assert all(delta >= interval * 0.7 for delta in deltas[:2])", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:test_worker_wakes_up_with_configured_interval", - "span_start": 163, - "span_end": 178, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 7, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "class WorkerModule(ApplicationModule):\n def __init__(self, worker: Worker) -> None:\n self._worker = worker\n\n @property\n def name(self) -> str:\n return \"business-tests\"\n\n def register(self, registry: ModuleRegistry) -> None:\n registry.add_worker(self._worker)", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:WorkerModule", - "span_start": 113, - "span_end": 122, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 3, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "class BlockingRoutine:\n def __init__(self, started: Event, release: Event) -> None:\n self._started = started\n self._release = release\n\n def run(self) -> None:\n self._started.set()\n self._release.wait(timeout=5.0)", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:BlockingRoutine", - "span_start": 40, - "span_end": 47, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 1, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "def test_actions_start_stop_and_health_when_worker_is_idle() -> None:\n runtime, base_url = _build_runtime(ScenarioWorker(\"idle-worker\", IntervalRoutine(), interval=0.2))\n try:\n stop_status, stop_payload = _http_call_json(base_url, \"/actions/stop\", method=\"POST\")\n assert stop_status == 200\n assert isinstance(stop_payload.get(\"detail\"), dict)\n assert stop_payload[\"detail\"][\"timed_out\"] is False\n assert stop_payload[\"detail\"][\"state\"] == \"stopped\"\n\n health_stopped_status, health_stopped_payload = _http_call_json(base_url, \"/health\")\n assert health_stopped_status == 503\n assert health_stopped_payload[\"state\"] == \"stopped\"\n assert health_stopped_payload[\"status\"] == \"unhealthy\"\n\n start_status, start_payload = _http_call_json(base_url, \"/actions/start\", method=\"POST\")\n assert start_status == 200\n assert isinstance(start_payload.get(\"detail\"), dict)\n assert start_payload[\"detail\"][\"timed_out\"] is False\n assert start_payload[\"detail\"][\"state\"] in {\"idle\", \"busy\"}\n\n health_started_status, health_started_payload = _http_call_json(base_url, \"/health\")\n assert health_started_status == 200\n assert health_started_payload[\"status\"] == \"ok\"\n assert health_started_payload[\"state\"] in {\"idle\", \"busy\"}\n finally:\n runtime.stop()", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:test_actions_start_stop_and_health_when_worker_is_idle", - "span_start": 181, - "span_end": 206, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 8, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "llm_answer": "1. Прямые тесты:\n - tests/test_runtime.py | test_public_plba_package_exports_runtime_builder_and_worker_contract\n - Проверка: импорты и вызовы create_runtime.\n - Недостаток покрытия: отсутствие проверки поведения функции `create_runtime`.\n\n2. Косвенные или ближайшие тесты:\n - tests/test_business_control_actions.py | _build_runtime\n - Проверка: создание экземпляра `RuntimeManager` и регистрация канала управления.\n - Недостаток покрытия: отсутствует проверка непосредственно создания и работы runtime через функцию `create_runtime`.\n\n3. Что именно проверяется:\n - В direct-тестах проверяются импорты и вызовы функции `create_runtime`, однако поведение самой функции не подтверждено.\n - В косвенных тестах проверяется создание объекта `RuntimeManager` и его начальная настройка, а также работа каналов управления.\n\n4. Пробелы покрытия:\n - Отсутствует прямое тестирование поведения функции `create_runtime`.", - "summary": { - "router": { - "intent": "CODE_QA", - "sub_intent": "FIND_TESTS", - "confidence": null - }, - "retrieval": { - "profile": "code", - "layers_hit": [ - "C0_SOURCE_CHUNKS", - "C2_DEPENDENCY_GRAPH" - ], - "evidence_sufficient": true - }, - "llm": { - "answer_status": "answered", - "groundedness": "grounded" - } - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "FIND_TESTS", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ], - "symbol_kind_hint": "function", - "symbol_candidates": [ - "create_runtime" - ], - "keyword_hints": [ - "create_runtime" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**", - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "test_file_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "test_symbol_patterns": [ - "test_create_runtime", - "Testcreate_runtime", - "create_runtime" - ], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C0_SOURCE_CHUNKS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C0_SOURCE_CHUNKS": 10 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [], - "include_globs": [ - "src", - "tests" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests" - ] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src", - "tests" - ], - "include_globs": [ - "src", - "tests" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests" - ] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src", - "tests" - ], - "include_globs": [ - "src", - "tests" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests" - ] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "create_runtime", - "path_scope": [], - "include_globs": [ - "src/**", - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "Где тесты для create_runtime? test_create_runtime Testcreate_runtime create_runtime", - "path_scope": [], - "include_globs": [ - "src/**", - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "top_k": 6, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Где тесты для create_runtime? test_create_runtime Testcreate_runtime create_runtime", - "path_scope": [], - "include_globs": [ - "src/**", - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "top_k": 10, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [], - "normalized_include_globs": [ - "src", - "tests" - ], - "normalized_exclude_globs": [], - "normalized_prefer_globs": [ - "tests" - ], - "filter_stage": "post_rank", - "candidates_before_filter": 0, - "candidates_after_filter": 0 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src", - "tests" - ], - "normalized_include_globs": [ - "src", - "tests" - ], - "normalized_exclude_globs": [], - "normalized_prefer_globs": [ - "tests" - ], - "filter_stage": "post_rank", - "candidates_before_filter": 6, - "candidates_after_filter": 6 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src", - "tests" - ], - "normalized_include_globs": [ - "src", - "tests" - ], - "normalized_exclude_globs": [], - "normalized_prefer_globs": [ - "tests" - ], - "filter_stage": "post_rank", - "candidates_before_filter": 10, - "candidates_after_filter": 10 - } - ], - "fallback": { - "used": true, - "reason": "scope_relaxed_no_hits" - }, - "symbol_resolution": { - "status": "not_found", - "resolved_symbol": null, - "alternatives": [ - "create_runtime" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "miss", - "hit_count": 0, - "fail_reason": "scope_relaxed_no_hits" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 6, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 10, - "fail_reason": null - } - ] - }, - "constraint_violations": [ - { - "type": "LAYER_MISSING", - "severity": "warn", - "details": { - "layer": "C1_SYMBOL_CATALOG", - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ] - }, - "suggested_fix": "Increase top_k for this layer or relax constraints for retrieval." - } - ], - "timings_ms": { - "router": 0, - "symbol_resolution": 0, - "retrieval_total": 120, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 52, - "C2_DEPENDENCY_GRAPH": 52, - "C0_SOURCE_CHUNKS": 15 - }, - "merge_rank": 0, - "prompt_build": 0, - "llm_call": 1592 - }, - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 980, - "evidence_rows": 16, - "evidence_chars": 9185 - }, - "evidence_summary": [ - { - "layer": "C2_DEPENDENCY_GRAPH", - "count": 6, - "unique_paths": 2 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 10, - "unique_paths": 2 - } - ], - "prompt_template_id": "intent_code_qa_find_tests_ru_v2", - "system_prompt_version": "v1" - }, - "router": { - "conversation_mode": "START", - "keyword_hints": [ - "create_runtime" - ], - "path_scope": [] - }, - "llm": { - "used_evidence_count": 16, - "missing_evidence_reason": null - } - }, - "run_info": { - "case_id": "plba-v2-find-tests-create-runtime", - "mode": "full_chain", - "run_started_at": "2026-03-12T12:55:37", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - }, - "input_request": { - "text": "Где тесты для create_runtime?", - "normalized_query": "Где тесты для create_runtime?" - }, - "steps": [ - { - "step": "intent_router", - "input": { - "query": "Где тесты для create_runtime?" - }, - "output": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Где тесты для create_runtime?" - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "FIND_TESTS", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ], - "symbol_kind_hint": "function", - "symbol_candidates": [ - "create_runtime" - ], - "keyword_hints": [ - "create_runtime" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**", - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "test_file_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "test_symbol_patterns": [ - "test_create_runtime", - "Testcreate_runtime", - "create_runtime" - ], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "timings_ms": { - "router": 0 - } - } - }, - { - "step": "retrieval", - "input": { - "query": "Где тесты для create_runtime?" - }, - "output": { - "symbol_resolution": { - "status": "not_found", - "resolved_symbol": null, - "alternatives": [ - "create_runtime" - ], - "confidence": 0.0 - }, - "rag_count": 16, - "rag_rows": [ - { - "path": "tests/test_runtime.py", - "content": "test_public_plba_package_exports_runtime_builder_and_worker_contract imports plba.create_runtime", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_public_plba_package_exports_runtime_builder_and_worker_contract:imports", - "span_start": 349, - "span_end": 349, - "lexical_rank": 6, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e93f80075cd9988737ece3cb5ec659c542132c4d383646e376917bfd0cb6ea64", - "edge_type": "imports", - "src_symbol_id": "ed06ffc5afb8a863cf7da3e40921f17abe4eec2a0770139e3380d93ccaae604a", - "src_qname": "test_public_plba_package_exports_runtime_builder_and_worker_contract", - "dst_symbol_id": null, - "dst_ref": "plba.create_runtime", - "resolution": "partial", - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_runtime.py", - "content": "test_public_plba_package_exports_runtime_builder_and_worker_contract calls create_runtime", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_public_plba_package_exports_runtime_builder_and_worker_contract:calls", - "span_start": 399, - "span_end": 399, - "lexical_rank": 6, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "039939355230de826d8bf7607f55fc59c7d932e5570ecb78994d0f13e57e8488", - "edge_type": "calls", - "src_symbol_id": "ed06ffc5afb8a863cf7da3e40921f17abe4eec2a0770139e3380d93ccaae604a", - "src_qname": "test_public_plba_package_exports_runtime_builder_and_worker_contract", - "dst_symbol_id": null, - "dst_ref": "create_runtime", - "resolution": "partial", - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "test_worker_wakes_up_with_configured_interval\n -> ScenarioWorker\n -> ScenarioWorker.__init__\n -> ScenarioWorker._name\n -> ScenarioWorker.name", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_worker_wakes_up_with_configured_interval:dataflow_slice", - "span_start": 52, - "span_end": 166, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 5, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "2fd137f5852febe907f44d3b3e4ea430f89ccfe962ae1442a16ab9df64c8f76c", - "edge_type": "dataflow_slice", - "src_symbol_id": "65f877f78191d65e6a752e41cedc70ebc784c266804a55c1c56440336e1f0d6e", - "src_qname": "test_worker_wakes_up_with_configured_interval", - "dst_symbol_id": "da022da2c49fd9cfd09d6e6da6bbd59aaa7d28efd669ce8444e88d327ddec2fc", - "dst_ref": "ScenarioWorker.name", - "resolution": "resolved", - "slice_id": "2fd137f5852febe907f44d3b3e4ea430f89ccfe962ae1442a16ab9df64c8f76c", - "root_symbol_id": "65f877f78191d65e6a752e41cedc70ebc784c266804a55c1c56440336e1f0d6e", - "path_symbols": [ - "test_worker_wakes_up_with_configured_interval", - "ScenarioWorker", - "ScenarioWorker.__init__", - "ScenarioWorker._name", - "ScenarioWorker.name" - ], - "path_symbol_ids": [ - "65f877f78191d65e6a752e41cedc70ebc784c266804a55c1c56440336e1f0d6e", - "9a1d08a7eb1831c9f2e0db361b5207f036e477c160773ae08c0b287239785c52", - "9c20be046ba06644d1432e0f20eb223663d2b116ee7d91fdc62bc68323f2e593", - "da022da2c49fd9cfd09d6e6da6bbd59aaa7d28efd669ce8444e88d327ddec2fc" - ], - "path_edge_types": [ - "instantiates", - "writes_attr", - "reads_attr" - ], - "path_length": 5, - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "test_actions_stop_busy_worker_after_timeout\n -> BlockingRoutine\n -> BlockingRoutine.__init__\n -> BlockingRoutine._started\n -> BlockingRoutine.run", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_actions_stop_busy_worker_after_timeout:dataflow_slice", - "span_start": 42, - "span_end": 238, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 5, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "8e7db3d2a9226f1c1d9942ac6373cfcafa0d2276758ddb8a3d3c455a3d58024d", - "edge_type": "dataflow_slice", - "src_symbol_id": "66392d3222421d9ba16eda3554940b16e7d5a6f33aa08c5738d35af2e32f1e4a", - "src_qname": "test_actions_stop_busy_worker_after_timeout", - "dst_symbol_id": "d9841bdbb69706c988ae7ae6adf89928dc4fae45943f74064f5382177034ba04", - "dst_ref": "BlockingRoutine.run", - "resolution": "resolved", - "slice_id": "8e7db3d2a9226f1c1d9942ac6373cfcafa0d2276758ddb8a3d3c455a3d58024d", - "root_symbol_id": "66392d3222421d9ba16eda3554940b16e7d5a6f33aa08c5738d35af2e32f1e4a", - "path_symbols": [ - "test_actions_stop_busy_worker_after_timeout", - "BlockingRoutine", - "BlockingRoutine.__init__", - "BlockingRoutine._started", - "BlockingRoutine.run" - ], - "path_symbol_ids": [ - "66392d3222421d9ba16eda3554940b16e7d5a6f33aa08c5738d35af2e32f1e4a", - "a3349c5bc65e4003a4bbd6a8dbb7a54c337e12d1aed930caa701b12e520f1e67", - "486deeed3043c6db985aef258e96ddc67aa53608e67a83962fbd2471f649ddf1", - "d9841bdbb69706c988ae7ae6adf89928dc4fae45943f74064f5382177034ba04" - ], - "path_edge_types": [ - "instantiates", - "writes_attr", - "reads_attr" - ], - "path_length": 5, - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "test_actions_stop_busy_worker_after_timeout\n -> BlockingRoutine\n -> BlockingRoutine.__init__\n -> BlockingRoutine._release\n -> BlockingRoutine.run", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_actions_stop_busy_worker_after_timeout:dataflow_slice", - "span_start": 43, - "span_end": 238, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 5, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "b59da9da82f9dfc8a9b695a08213786385da1ae9e17561ec3a0450a574a8cb39", - "edge_type": "dataflow_slice", - "src_symbol_id": "66392d3222421d9ba16eda3554940b16e7d5a6f33aa08c5738d35af2e32f1e4a", - "src_qname": "test_actions_stop_busy_worker_after_timeout", - "dst_symbol_id": "d9841bdbb69706c988ae7ae6adf89928dc4fae45943f74064f5382177034ba04", - "dst_ref": "BlockingRoutine.run", - "resolution": "resolved", - "slice_id": "b59da9da82f9dfc8a9b695a08213786385da1ae9e17561ec3a0450a574a8cb39", - "root_symbol_id": "66392d3222421d9ba16eda3554940b16e7d5a6f33aa08c5738d35af2e32f1e4a", - "path_symbols": [ - "test_actions_stop_busy_worker_after_timeout", - "BlockingRoutine", - "BlockingRoutine.__init__", - "BlockingRoutine._release", - "BlockingRoutine.run" - ], - "path_symbol_ids": [ - "66392d3222421d9ba16eda3554940b16e7d5a6f33aa08c5738d35af2e32f1e4a", - "a3349c5bc65e4003a4bbd6a8dbb7a54c337e12d1aed930caa701b12e520f1e67", - "486deeed3043c6db985aef258e96ddc67aa53608e67a83962fbd2471f649ddf1", - "d9841bdbb69706c988ae7ae6adf89928dc4fae45943f74064f5382177034ba04" - ], - "path_edge_types": [ - "instantiates", - "writes_attr", - "reads_attr" - ], - "path_length": 5, - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "test_actions_stop_busy_worker_before_timeout\n -> BlockingRoutine\n -> BlockingRoutine.__init__\n -> BlockingRoutine._started\n -> BlockingRoutine.run", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_actions_stop_busy_worker_before_timeout:dataflow_slice", - "span_start": 42, - "span_end": 212, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 5, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "f9bcce108870e49afa8b32d4625115a10707a3b0e7473179e958e5752bf258b4", - "edge_type": "dataflow_slice", - "src_symbol_id": "a0bb116ca9d909c93a285667ae033fbd1859b2dad7cf34fcb44816393ef6909c", - "src_qname": "test_actions_stop_busy_worker_before_timeout", - "dst_symbol_id": "d9841bdbb69706c988ae7ae6adf89928dc4fae45943f74064f5382177034ba04", - "dst_ref": "BlockingRoutine.run", - "resolution": "resolved", - "slice_id": "f9bcce108870e49afa8b32d4625115a10707a3b0e7473179e958e5752bf258b4", - "root_symbol_id": "a0bb116ca9d909c93a285667ae033fbd1859b2dad7cf34fcb44816393ef6909c", - "path_symbols": [ - "test_actions_stop_busy_worker_before_timeout", - "BlockingRoutine", - "BlockingRoutine.__init__", - "BlockingRoutine._started", - "BlockingRoutine.run" - ], - "path_symbol_ids": [ - "a0bb116ca9d909c93a285667ae033fbd1859b2dad7cf34fcb44816393ef6909c", - "a3349c5bc65e4003a4bbd6a8dbb7a54c337e12d1aed930caa701b12e520f1e67", - "486deeed3043c6db985aef258e96ddc67aa53608e67a83962fbd2471f649ddf1", - "d9841bdbb69706c988ae7ae6adf89928dc4fae45943f74064f5382177034ba04" - ], - "path_edge_types": [ - "instantiates", - "writes_attr", - "reads_attr" - ], - "path_length": 5, - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_runtime.py", - "content": "def test_public_plba_package_exports_runtime_builder_and_worker_contract(tmp_path) -> None:\n import plba\n from plba import ApplicationModule as PublicApplicationModule\n from plba import InMemoryTaskQueue\n from plba import Worker as PublicWorker\n from plba import WorkerHealth as PublicWorkerHealth\n from plba import WorkerStatus as PublicWorkerStatus\n from plba import create_runtime\n\n config_path = tmp_path / \"config.yml\"\n config_path.write_text(\"platform: {}\\n\", encoding=\"utf-8\")\n\n queue = InMemoryTaskQueue[int]()\n queue.put(2)\n assert queue.get(timeout=0.01) == 2\n queue.task_done()\n\n class PublicRoutine:\n def __init__(self) -> None:\n self.runs = 0\n\n def run(self) -> None:\n if self.runs == 0:\n self.runs += 1\n\n class PublicWorkerImpl(PublicWorker):\n def __init__(self, routine: PublicRoutine) -> None:\n self._inner = RoutineWorker(\"public-worker\", routine)\n\n @property\n def name(self) -> str:\n return self._inner.name\n\n @property\n def critical(self) -> bool:\n return self._inner.critical\n\n def start(self) -> None:\n self._inner.start()\n\n def stop(self, force: bool = False) -> None:\n self._inner.stop(force=force)\n\n def health(self) -> PublicWorkerHealth:\n return self._inner.health()\n\n def status(self) -> PublicWorkerStatus:\n return self._inner.status()\n\n class PublicExampleModule(PublicApplicationModule):\n @property\n def name(self) -> str:\n return \"public-example\"\n\n def register(self, registry: ModuleRegistry) -> None:\n registry.add_worker(PublicWorkerImpl(PublicRoutine()))\n\n runtime = create_runtime(PublicExampleModule(), config_path=str(config_path))\n runtime.start()\n sleep(0.2)\n assert runtime.configuration.get() == {\"platform\": {}}\n assert runtime.status()[\"workers\"][\"registered\"] == 1\n assert hasattr(plba, \"QueueWorker\") is False\n runtime.stop()", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_runtime.py:test_public_plba_package_exports_runtime_builder_and_worker_contract", - "span_start": 342, - "span_end": 405, - "lexical_rank": 6, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 13, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_runtime", - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "def _build_runtime(worker: Worker, *, control_timeout: int = 1) -> tuple[RuntimeManager, str]:\n runtime = RuntimeManager()\n channel = HttpControlChannel(host=\"127.0.0.1\", port=0, timeout=control_timeout)\n runtime.control_plane.register_channel(channel)\n runtime.register_module(WorkerModule(worker))\n runtime.start()\n return runtime, f\"http://127.0.0.1:{channel.port}\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:_build_runtime", - "span_start": 154, - "span_end": 160, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 6, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "class IntervalRoutine:\n calls: list[float] = field(default_factory=list)\n _lock: Lock = field(default_factory=Lock)\n\n def run(self) -> None:\n with self._lock:\n self.calls.append(monotonic())\n\n def wait_runs(self, count: int, timeout: float) -> bool:\n deadline = monotonic() + timeout\n while monotonic() < deadline:\n with self._lock:\n if len(self.calls) >= count:\n return True\n sleep(0.01)\n return False\n\n def deltas(self) -> list[float]:\n with self._lock:\n return [self.calls[index + 1] - self.calls[index] for index in range(len(self.calls) - 1)]", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:IntervalRoutine", - "span_start": 18, - "span_end": 37, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "class ScenarioWorker(Worker):\n def __init__(self, name: str, routine: object, *, interval: float = 0.05) -> None:\n self._name = name\n self._routine = routine\n self._interval = interval\n self._thread: Thread | None = None\n self._stop_requested = Event()\n self._in_flight = 0\n self._runs = 0\n self._lock = Lock()\n\n @property\n def name(self) -> str:\n return self._name\n\n @property\n def critical(self) -> bool:\n return True\n\n def start(self) -> None:\n if self._thread is not None and self._thread.is_alive():\n return\n self._stop_requested.clear()\n self._thread = Thread(target=self._loop, name=f\"{self._name}-thread\", daemon=True)\n self._thread.start()\n\n def stop(self, force: bool = False) -> None:\n self._stop_requested.set()\n\n def health(self) -> WorkerHealth:\n return WorkerHealth(name=self.name, status=\"ok\", critical=True, meta={\"runs\": self._runs})\n\n def status(self) -> WorkerStatus:\n thread_alive = self._thread is not None and self._thread.is_alive()\n with self._lock:\n in_flight = self._in_flight\n runs = self._runs\n if not thread_alive:\n state = \"stopped\"\n elif self._stop_requested.is_set():\n state = \"stopping\"\n elif in_flight > 0:\n state = \"busy\"\n else:\n state = \"idle\"\n return WorkerStatus(name=self.name, state=state, in_flight=in_flight, meta={\"runs\": runs})\n\n def _loop(self) -> None:\n while not self._stop_requested.is_set():\n with self._lock:\n self._in_flight += 1\n try:\n self._routine.run()\n with self._lock:\n self._runs += 1\n finally:\n with self._lock:\n self._in_flight -= 1\n if self._stop_requested.is_set():\n return\n sleep(self._interval)", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:ScenarioWorker", - "span_start": 50, - "span_end": 110, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 2, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "def _http_call_json(\n base_url: str,\n path: str,\n *,\n method: str = \"GET\",\n headers: dict[str, str] | None = None,\n) -> tuple[int, dict[str, object]]:\n request = Request(f\"{base_url}{path}\", method=method, headers=headers or {})\n try:\n with urlopen(request, timeout=15.0) as response:\n status = response.status\n body = response.read()\n except HTTPError as error:\n status = error.code\n body = error.read()\n payload = json.loads(body.decode(\"utf-8\"))\n return status, payload", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:_http_call_json", - "span_start": 125, - "span_end": 141, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 4, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "def _poll_until_stopped(base_url: str, timeout: float = 2.0) -> bool:\n deadline = monotonic() + timeout\n while monotonic() < deadline:\n _, payload = _http_call_json(base_url, \"/actions/status\")\n if payload.get(\"detail\") == \"stopped\":\n return True\n sleep(0.05)\n return False", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:_poll_until_stopped", - "span_start": 144, - "span_end": 151, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 5, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "def test_worker_wakes_up_with_configured_interval() -> None:\n interval = 0.15\n routine = IntervalRoutine()\n worker = ScenarioWorker(\"interval-worker\", routine, interval=interval)\n runtime = RuntimeManager()\n runtime.register_module(WorkerModule(worker))\n\n runtime.start()\n try:\n assert routine.wait_runs(count=3, timeout=2.0) is True\n finally:\n runtime.stop()\n\n deltas = routine.deltas()\n assert len(deltas) >= 2\n assert all(delta >= interval * 0.7 for delta in deltas[:2])", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:test_worker_wakes_up_with_configured_interval", - "span_start": 163, - "span_end": 178, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 7, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "class WorkerModule(ApplicationModule):\n def __init__(self, worker: Worker) -> None:\n self._worker = worker\n\n @property\n def name(self) -> str:\n return \"business-tests\"\n\n def register(self, registry: ModuleRegistry) -> None:\n registry.add_worker(self._worker)", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:WorkerModule", - "span_start": 113, - "span_end": 122, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 3, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "class BlockingRoutine:\n def __init__(self, started: Event, release: Event) -> None:\n self._started = started\n self._release = release\n\n def run(self) -> None:\n self._started.set()\n self._release.wait(timeout=5.0)", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:BlockingRoutine", - "span_start": 40, - "span_end": 47, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 1, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "def test_actions_start_stop_and_health_when_worker_is_idle() -> None:\n runtime, base_url = _build_runtime(ScenarioWorker(\"idle-worker\", IntervalRoutine(), interval=0.2))\n try:\n stop_status, stop_payload = _http_call_json(base_url, \"/actions/stop\", method=\"POST\")\n assert stop_status == 200\n assert isinstance(stop_payload.get(\"detail\"), dict)\n assert stop_payload[\"detail\"][\"timed_out\"] is False\n assert stop_payload[\"detail\"][\"state\"] == \"stopped\"\n\n health_stopped_status, health_stopped_payload = _http_call_json(base_url, \"/health\")\n assert health_stopped_status == 503\n assert health_stopped_payload[\"state\"] == \"stopped\"\n assert health_stopped_payload[\"status\"] == \"unhealthy\"\n\n start_status, start_payload = _http_call_json(base_url, \"/actions/start\", method=\"POST\")\n assert start_status == 200\n assert isinstance(start_payload.get(\"detail\"), dict)\n assert start_payload[\"detail\"][\"timed_out\"] is False\n assert start_payload[\"detail\"][\"state\"] in {\"idle\", \"busy\"}\n\n health_started_status, health_started_payload = _http_call_json(base_url, \"/health\")\n assert health_started_status == 200\n assert health_started_payload[\"status\"] == \"ok\"\n assert health_started_payload[\"state\"] in {\"idle\", \"busy\"}\n finally:\n runtime.stop()", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:test_actions_start_stop_and_health_when_worker_is_idle", - "span_start": 181, - "span_end": 206, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 8, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ] - }, - "diagnostics": { - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C0_SOURCE_CHUNKS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C0_SOURCE_CHUNKS": 10 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [], - "include_globs": [ - "src", - "tests" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests" - ] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src", - "tests" - ], - "include_globs": [ - "src", - "tests" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests" - ] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src", - "tests" - ], - "include_globs": [ - "src", - "tests" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests" - ] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "create_runtime", - "path_scope": [], - "include_globs": [ - "src/**", - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "Где тесты для create_runtime? test_create_runtime Testcreate_runtime create_runtime", - "path_scope": [], - "include_globs": [ - "src/**", - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "top_k": 6, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Где тесты для create_runtime? test_create_runtime Testcreate_runtime create_runtime", - "path_scope": [], - "include_globs": [ - "src/**", - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "top_k": 10, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [], - "normalized_include_globs": [ - "src", - "tests" - ], - "normalized_exclude_globs": [], - "normalized_prefer_globs": [ - "tests" - ], - "filter_stage": "post_rank", - "candidates_before_filter": 0, - "candidates_after_filter": 0 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src", - "tests" - ], - "normalized_include_globs": [ - "src", - "tests" - ], - "normalized_exclude_globs": [], - "normalized_prefer_globs": [ - "tests" - ], - "filter_stage": "post_rank", - "candidates_before_filter": 6, - "candidates_after_filter": 6 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src", - "tests" - ], - "normalized_include_globs": [ - "src", - "tests" - ], - "normalized_exclude_globs": [], - "normalized_prefer_globs": [ - "tests" - ], - "filter_stage": "post_rank", - "candidates_before_filter": 10, - "candidates_after_filter": 10 - } - ], - "fallback": { - "used": true, - "reason": "scope_relaxed_no_hits" - }, - "symbol_resolution": { - "status": "not_found", - "resolved_symbol": null, - "alternatives": [ - "create_runtime" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "miss", - "hit_count": 0, - "fail_reason": "scope_relaxed_no_hits" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 6, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 10, - "fail_reason": null - } - ] - }, - "constraint_violations": [ - { - "type": "LAYER_MISSING", - "severity": "warn", - "details": { - "layer": "C1_SYMBOL_CATALOG", - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ] - }, - "suggested_fix": "Increase top_k for this layer or relax constraints for retrieval." - } - ], - "timings_ms": { - "symbol_resolution": 0, - "retrieval_total": 120, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 52, - "C2_DEPENDENCY_GRAPH": 52, - "C0_SOURCE_CHUNKS": 15 - }, - "merge_rank": 0 - } - } - }, - { - "step": "llm_answer", - "input": { - "query": "Где тесты для create_runtime?", - "rag_count": 16 - }, - "output": { - "llm_answer": "1. Прямые тесты:\n - tests/test_runtime.py | test_public_plba_package_exports_runtime_builder_and_worker_contract\n - Проверка: импорты и вызовы create_runtime.\n - Недостаток покрытия: отсутствие проверки поведения функции `create_runtime`.\n\n2. Косвенные или ближайшие тесты:\n - tests/test_business_control_actions.py | _build_runtime\n - Проверка: создание экземпляра `RuntimeManager` и регистрация канала управления.\n - Недостаток покрытия: отсутствует проверка непосредственно создания и работы runtime через функцию `create_runtime`.\n\n3. Что именно проверяется:\n - В direct-тестах проверяются импорты и вызовы функции `create_runtime`, однако поведение самой функции не подтверждено.\n - В косвенных тестах проверяется создание объекта `RuntimeManager` и его начальная настройка, а также работа каналов управления.\n\n4. Пробелы покрытия:\n - Отсутствует прямое тестирование поведения функции `create_runtime`." - }, - "diagnostics": { - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 980, - "evidence_rows": 16, - "evidence_chars": 9185 - }, - "evidence_summary": [ - { - "layer": "C2_DEPENDENCY_GRAPH", - "count": 6, - "unique_paths": 2 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 10, - "unique_paths": 2 - } - ], - "prompt_template_id": "intent_code_qa_find_tests_ru_v2", - "system_prompt_version": "v1" - }, - "timings_ms": { - "prompt_build": 0, - "llm_call": 1592 - } - } - } - ] - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_125536/full_chain_plba_code_subintents_v2_plba-v2-find-tests-create-runtime.md b/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_125536/full_chain_plba_code_subintents_v2_plba-v2-find-tests-create-runtime.md deleted file mode 100644 index b3ff280..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_125536/full_chain_plba_code_subintents_v2_plba-v2-find-tests-create-runtime.md +++ /dev/null @@ -1,32 +0,0 @@ -# plba-v2-find-tests-create-runtime - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_subintents_v2.yaml -- runner: runtime -- mode: full_chain -- passed: True - -## Query -Где тесты для create_runtime? - -## Actual -{ - "intent": "CODE_QA", - "sub_intent": "FIND_TESTS", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 16, - "llm_answer": "1. Прямые тесты:\n - tests/test_runtime.py | test_public_plba_package_exports_runtime_builder_and_worker_contract\n - Проверка: импорты и вызовы create_runtime.\n - Недостаток покрытия: отсутствие проверки поведения функции `create_runtime`.\n\n2. Косвенные или ближайшие тесты:\n - tests/test_business_control_actions.py | _build_runtime\n - Проверка: создание экземпляра `RuntimeManager` и регистрация канала управления.\n - Недостаток покрытия: отсутствует проверка непосредственно создания и работы runtime через функцию `create_runtime`.\n\n3. Что именно проверяется:\n - В direct-тестах проверяются импорты и вызовы функции `create_runtime`, однако поведение самой функции не подтверждено.\n - В косвенных тестах проверяется создание объекта `RuntimeManager` и его начальная настройка, а также работа каналов управления.\n\n4. Пробелы покрытия:\n - Отсутствует прямое тестирование поведения функции `create_runtime`.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "create_runtime" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ] -} - -## Mismatches -- none \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_125536/full_chain_plba_code_subintents_v2_plba-v2-find-tests-runtime-manager.json b/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_125536/full_chain_plba_code_subintents_v2_plba-v2-find-tests-runtime-manager.json deleted file mode 100644 index c83dbe0..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_125536/full_chain_plba_code_subintents_v2_plba-v2-find-tests-runtime-manager.json +++ /dev/null @@ -1,1879 +0,0 @@ -{ - "case_id": "plba-v2-find-tests-runtime-manager", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_subintents_v2.yaml", - "runner": "runtime", - "mode": "full_chain", - "actual": { - "intent": "CODE_QA", - "sub_intent": "FIND_TESTS", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 16, - "llm_answer": "1. Прямые тесты:\n - tests/test_runtime.py | test_runtime_runs_worker_routine_and_exposes_status\n - tests/test_runtime.py | test_runtime_graceful_stop_waits_until_worker_finishes\nПроверка:\n - Создания и инициализации RuntimeManager.\n - Взаимодействия RuntimeManager с worker'ами и обработкой статуса.\n - Ожидания завершения работы worker'а при корректном завершении процесса остановки.\n - Проверки поведения RuntimeManager в разных состояниях (busy, stopped).\n\n2. Косвенные или ближайшие тесты:\n - tests/test_business_control_actions.py | _build_runtime\n - tests/test_business_control_actions.py | test_worker_wakes_up_with_configured_interval\nЭти тесты косвенно затрагивают RuntimeManager через инстанцирование его в других контекстах и использовании его методов, однако непосредственно поведение RuntimeManager не проверяется напрямую.\n\n3. Пробелы покрытия:\n - Не найдены явные тесты, которые проверяют обработку ошибок и исключений в RuntimeManager.\n - Нет тестов, которые покрывают интеграцию RuntimeManager с внешними компонентами или библиотеками.\n\nПрямых тестов, специально направленных на проверку различных аспектов жизненного цикла RuntimeManager, достаточно много, однако следует добавить тесты, направленные на проверку ошибок и интеграций.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "RuntimeManager" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ] - }, - "passed": true, - "mismatches": [], - "details": { - "case_id": "plba-v2-find-tests-runtime-manager", - "text": "Где тесты для RuntimeManager?", - "mode": "full_chain", - "run_started_at": "2026-03-12T12:55:37", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Где тесты для RuntimeManager?", - "symbol_resolution": { - "status": "not_found", - "resolved_symbol": null, - "alternatives": [ - "RuntimeManager" - ], - "confidence": 0.0 - }, - "rag_count": 16, - "rag_rows": [ - { - "path": "tests/test_runtime.py", - "content": "test_runtime_runs_worker_routine_and_exposes_status instantiates RuntimeManager", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_runtime_runs_worker_routine_and_exposes_status:instantiates", - "span_start": 209, - "span_end": 209, - "lexical_rank": 6, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "c397a308e7824ba9fe400a754c7e15e66ea6f058d7f5d3e82bb002bb78b509d2", - "edge_type": "instantiates", - "src_symbol_id": "1c767eb5ee08e84f45b18c8ed7531ec0ed73c63fb1594823569672db7b21e992", - "src_qname": "test_runtime_runs_worker_routine_and_exposes_status", - "dst_symbol_id": "aeadc039653807b0da1ca6e3cc1078ee61cfc510b28e7f9c2ec04c59da43cc8d", - "dst_ref": "RuntimeManager", - "resolution": "resolved", - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_runtime.py", - "content": "test_runtime_graceful_stop_waits_until_worker_finishes instantiates RuntimeManager", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_runtime_graceful_stop_waits_until_worker_finishes:instantiates", - "span_start": 229, - "span_end": 229, - "lexical_rank": 6, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "76b4701262ccaa0a7a41691407c4ebdb2ca74a2415d89f0a38ef0d4f608bda93", - "edge_type": "instantiates", - "src_symbol_id": "1076e788e4a03b10d7bc1313a8ad46caa170c13cc026c6e4de994af1a6ae57bf", - "src_qname": "test_runtime_graceful_stop_waits_until_worker_finishes", - "dst_symbol_id": "aeadc039653807b0da1ca6e3cc1078ee61cfc510b28e7f9c2ec04c59da43cc8d", - "dst_ref": "RuntimeManager", - "resolution": "resolved", - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "_build_runtime instantiates RuntimeManager", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "_build_runtime:instantiates", - "span_start": 155, - "span_end": 155, - "lexical_rank": 6, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "7eb254d564944bab6272757ee5ef688862bd321e6941e2495dc942e03b1c9a25", - "edge_type": "instantiates", - "src_symbol_id": "db94031d5245bf82be836a109b4584b43b8e83d37a0f318e03f6c8191896d469", - "src_qname": "_build_runtime", - "dst_symbol_id": "a1572ea8183dc0cd6ddbc74342bbde8c28cecfde37ad40b62feff09f8d103d11", - "dst_ref": "RuntimeManager", - "resolution": "resolved", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "test_worker_wakes_up_with_configured_interval instantiates RuntimeManager", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_worker_wakes_up_with_configured_interval:instantiates", - "span_start": 167, - "span_end": 167, - "lexical_rank": 6, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "189aafc4de0b79c688668f25f0c87166a127df26bd2215452014713b65ef281a", - "edge_type": "instantiates", - "src_symbol_id": "65f877f78191d65e6a752e41cedc70ebc784c266804a55c1c56440336e1f0d6e", - "src_qname": "test_worker_wakes_up_with_configured_interval", - "dst_symbol_id": "a1572ea8183dc0cd6ddbc74342bbde8c28cecfde37ad40b62feff09f8d103d11", - "dst_ref": "RuntimeManager", - "resolution": "resolved", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "test_actions_stop_busy_worker_after_timeout\n -> BlockingRoutine\n -> BlockingRoutine.__init__\n -> BlockingRoutine._started\n -> BlockingRoutine.run", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_actions_stop_busy_worker_after_timeout:dataflow_slice", - "span_start": 42, - "span_end": 238, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 5, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "8e7db3d2a9226f1c1d9942ac6373cfcafa0d2276758ddb8a3d3c455a3d58024d", - "edge_type": "dataflow_slice", - "src_symbol_id": "66392d3222421d9ba16eda3554940b16e7d5a6f33aa08c5738d35af2e32f1e4a", - "src_qname": "test_actions_stop_busy_worker_after_timeout", - "dst_symbol_id": "d9841bdbb69706c988ae7ae6adf89928dc4fae45943f74064f5382177034ba04", - "dst_ref": "BlockingRoutine.run", - "resolution": "resolved", - "slice_id": "8e7db3d2a9226f1c1d9942ac6373cfcafa0d2276758ddb8a3d3c455a3d58024d", - "root_symbol_id": "66392d3222421d9ba16eda3554940b16e7d5a6f33aa08c5738d35af2e32f1e4a", - "path_symbols": [ - "test_actions_stop_busy_worker_after_timeout", - "BlockingRoutine", - "BlockingRoutine.__init__", - "BlockingRoutine._started", - "BlockingRoutine.run" - ], - "path_symbol_ids": [ - "66392d3222421d9ba16eda3554940b16e7d5a6f33aa08c5738d35af2e32f1e4a", - "a3349c5bc65e4003a4bbd6a8dbb7a54c337e12d1aed930caa701b12e520f1e67", - "486deeed3043c6db985aef258e96ddc67aa53608e67a83962fbd2471f649ddf1", - "d9841bdbb69706c988ae7ae6adf89928dc4fae45943f74064f5382177034ba04" - ], - "path_edge_types": [ - "instantiates", - "writes_attr", - "reads_attr" - ], - "path_length": 5, - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "test_actions_stop_busy_worker_before_timeout\n -> BlockingRoutine\n -> BlockingRoutine.__init__\n -> BlockingRoutine._release\n -> BlockingRoutine.run", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_actions_stop_busy_worker_before_timeout:dataflow_slice", - "span_start": 43, - "span_end": 212, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 5, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "8bd726155ba387d3579763ee84dfd2f9a90bc917da88f3b2e89416ab5c1254d6", - "edge_type": "dataflow_slice", - "src_symbol_id": "a0bb116ca9d909c93a285667ae033fbd1859b2dad7cf34fcb44816393ef6909c", - "src_qname": "test_actions_stop_busy_worker_before_timeout", - "dst_symbol_id": "d9841bdbb69706c988ae7ae6adf89928dc4fae45943f74064f5382177034ba04", - "dst_ref": "BlockingRoutine.run", - "resolution": "resolved", - "slice_id": "8bd726155ba387d3579763ee84dfd2f9a90bc917da88f3b2e89416ab5c1254d6", - "root_symbol_id": "a0bb116ca9d909c93a285667ae033fbd1859b2dad7cf34fcb44816393ef6909c", - "path_symbols": [ - "test_actions_stop_busy_worker_before_timeout", - "BlockingRoutine", - "BlockingRoutine.__init__", - "BlockingRoutine._release", - "BlockingRoutine.run" - ], - "path_symbol_ids": [ - "a0bb116ca9d909c93a285667ae033fbd1859b2dad7cf34fcb44816393ef6909c", - "a3349c5bc65e4003a4bbd6a8dbb7a54c337e12d1aed930caa701b12e520f1e67", - "486deeed3043c6db985aef258e96ddc67aa53608e67a83962fbd2471f649ddf1", - "d9841bdbb69706c988ae7ae6adf89928dc4fae45943f74064f5382177034ba04" - ], - "path_edge_types": [ - "instantiates", - "writes_attr", - "reads_attr" - ], - "path_length": 5, - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_runtime.py", - "content": "def test_runtime_graceful_stop_waits_until_worker_finishes() -> None:\n started = Event()\n release = Event()\n runtime = RuntimeManager()\n runtime.register_module(BlockingModule(started, release))\n runtime.start()\n assert started.wait(timeout=1.0) is True\n assert runtime.status()[\"runtime\"][\"state\"] == \"busy\"\n\n stop_thread = Thread(target=runtime.stop, kwargs={\"timeout\": 1.0}, daemon=True)\n stop_thread.start()\n sleep(0.1)\n assert stop_thread.is_alive() is True\n\n release.set()\n stop_thread.join(timeout=1.0)\n assert stop_thread.is_alive() is False\n assert runtime.status()[\"runtime\"][\"state\"] == \"stopped\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_runtime.py:test_runtime_graceful_stop_waits_until_worker_finishes", - "span_start": 226, - "span_end": 243, - "lexical_rank": 6, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 8, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_runtime", - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_runtime.py", - "content": "def test_runtime_runs_worker_routine_and_exposes_status(tmp_path) -> None:\n config_path = tmp_path / \"config.yml\"\n config_path.write_text(\n \"\"\"\nplatform:\n workers: 1\nlog:\n version: 1\n disable_existing_loggers: false\n handlers:\n console:\n class: logging.StreamHandler\n root:\n level: INFO\n handlers: [console]\n\"\"\".strip(),\n encoding=\"utf-8\",\n )\n runtime = RuntimeManager()\n runtime.add_config_file(config_path)\n module = ExampleModule()\n runtime.register_module(module)\n\n runtime.start()\n sleep(0.2)\n status = runtime.status()\n runtime.stop()\n\n assert module.routine.processed == [{\"id\": 1}]\n assert status[\"modules\"] == [\"example\"]\n assert status[\"runtime\"][\"state\"] == \"idle\"\n assert status[\"health\"][\"status\"] == \"ok\"\n assert status[\"config\"] == {\"platform\": {\"workers\": 1}, \"log\": status[\"config\"][\"log\"]}", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_runtime.py:test_runtime_runs_worker_routine_and_exposes_status", - "span_start": 191, - "span_end": 223, - "lexical_rank": 6, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 7, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_runtime", - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "def _build_runtime(worker: Worker, *, control_timeout: int = 1) -> tuple[RuntimeManager, str]:\n runtime = RuntimeManager()\n channel = HttpControlChannel(host=\"127.0.0.1\", port=0, timeout=control_timeout)\n runtime.control_plane.register_channel(channel)\n runtime.register_module(WorkerModule(worker))\n runtime.start()\n return runtime, f\"http://127.0.0.1:{channel.port}\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:_build_runtime", - "span_start": 154, - "span_end": 160, - "lexical_rank": 6, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 6, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "def test_worker_wakes_up_with_configured_interval() -> None:\n interval = 0.15\n routine = IntervalRoutine()\n worker = ScenarioWorker(\"interval-worker\", routine, interval=interval)\n runtime = RuntimeManager()\n runtime.register_module(WorkerModule(worker))\n\n runtime.start()\n try:\n assert routine.wait_runs(count=3, timeout=2.0) is True\n finally:\n runtime.stop()\n\n deltas = routine.deltas()\n assert len(deltas) >= 2\n assert all(delta >= interval * 0.7 for delta in deltas[:2])", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:test_worker_wakes_up_with_configured_interval", - "span_start": 163, - "span_end": 178, - "lexical_rank": 6, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 7, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "class BlockingRoutine:\n def __init__(self, started: Event, release: Event) -> None:\n self._started = started\n self._release = release\n\n def run(self) -> None:\n self._started.set()\n self._release.wait(timeout=5.0)", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:BlockingRoutine", - "span_start": 40, - "span_end": 47, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 1, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "class ScenarioWorker(Worker):\n def __init__(self, name: str, routine: object, *, interval: float = 0.05) -> None:\n self._name = name\n self._routine = routine\n self._interval = interval\n self._thread: Thread | None = None\n self._stop_requested = Event()\n self._in_flight = 0\n self._runs = 0\n self._lock = Lock()\n\n @property\n def name(self) -> str:\n return self._name\n\n @property\n def critical(self) -> bool:\n return True\n\n def start(self) -> None:\n if self._thread is not None and self._thread.is_alive():\n return\n self._stop_requested.clear()\n self._thread = Thread(target=self._loop, name=f\"{self._name}-thread\", daemon=True)\n self._thread.start()\n\n def stop(self, force: bool = False) -> None:\n self._stop_requested.set()\n\n def health(self) -> WorkerHealth:\n return WorkerHealth(name=self.name, status=\"ok\", critical=True, meta={\"runs\": self._runs})\n\n def status(self) -> WorkerStatus:\n thread_alive = self._thread is not None and self._thread.is_alive()\n with self._lock:\n in_flight = self._in_flight\n runs = self._runs\n if not thread_alive:\n state = \"stopped\"\n elif self._stop_requested.is_set():\n state = \"stopping\"\n elif in_flight > 0:\n state = \"busy\"\n else:\n state = \"idle\"\n return WorkerStatus(name=self.name, state=state, in_flight=in_flight, meta={\"runs\": runs})\n\n def _loop(self) -> None:\n while not self._stop_requested.is_set():\n with self._lock:\n self._in_flight += 1\n try:\n self._routine.run()\n with self._lock:\n self._runs += 1\n finally:\n with self._lock:\n self._in_flight -= 1\n if self._stop_requested.is_set():\n return\n sleep(self._interval)", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:ScenarioWorker", - "span_start": 50, - "span_end": 110, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 2, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "class WorkerModule(ApplicationModule):\n def __init__(self, worker: Worker) -> None:\n self._worker = worker\n\n @property\n def name(self) -> str:\n return \"business-tests\"\n\n def register(self, registry: ModuleRegistry) -> None:\n registry.add_worker(self._worker)", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:WorkerModule", - "span_start": 113, - "span_end": 122, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 3, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "def _http_call_json(\n base_url: str,\n path: str,\n *,\n method: str = \"GET\",\n headers: dict[str, str] | None = None,\n) -> tuple[int, dict[str, object]]:\n request = Request(f\"{base_url}{path}\", method=method, headers=headers or {})\n try:\n with urlopen(request, timeout=15.0) as response:\n status = response.status\n body = response.read()\n except HTTPError as error:\n status = error.code\n body = error.read()\n payload = json.loads(body.decode(\"utf-8\"))\n return status, payload", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:_http_call_json", - "span_start": 125, - "span_end": 141, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 4, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "class IntervalRoutine:\n calls: list[float] = field(default_factory=list)\n _lock: Lock = field(default_factory=Lock)\n\n def run(self) -> None:\n with self._lock:\n self.calls.append(monotonic())\n\n def wait_runs(self, count: int, timeout: float) -> bool:\n deadline = monotonic() + timeout\n while monotonic() < deadline:\n with self._lock:\n if len(self.calls) >= count:\n return True\n sleep(0.01)\n return False\n\n def deltas(self) -> list[float]:\n with self._lock:\n return [self.calls[index + 1] - self.calls[index] for index in range(len(self.calls) - 1)]", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:IntervalRoutine", - "span_start": 18, - "span_end": 37, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "def _poll_until_stopped(base_url: str, timeout: float = 2.0) -> bool:\n deadline = monotonic() + timeout\n while monotonic() < deadline:\n _, payload = _http_call_json(base_url, \"/actions/status\")\n if payload.get(\"detail\") == \"stopped\":\n return True\n sleep(0.05)\n return False", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:_poll_until_stopped", - "span_start": 144, - "span_end": 151, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 5, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "llm_answer": "1. Прямые тесты:\n - tests/test_runtime.py | test_runtime_runs_worker_routine_and_exposes_status\n - tests/test_runtime.py | test_runtime_graceful_stop_waits_until_worker_finishes\nПроверка:\n - Создания и инициализации RuntimeManager.\n - Взаимодействия RuntimeManager с worker'ами и обработкой статуса.\n - Ожидания завершения работы worker'а при корректном завершении процесса остановки.\n - Проверки поведения RuntimeManager в разных состояниях (busy, stopped).\n\n2. Косвенные или ближайшие тесты:\n - tests/test_business_control_actions.py | _build_runtime\n - tests/test_business_control_actions.py | test_worker_wakes_up_with_configured_interval\nЭти тесты косвенно затрагивают RuntimeManager через инстанцирование его в других контекстах и использовании его методов, однако непосредственно поведение RuntimeManager не проверяется напрямую.\n\n3. Пробелы покрытия:\n - Не найдены явные тесты, которые проверяют обработку ошибок и исключений в RuntimeManager.\n - Нет тестов, которые покрывают интеграцию RuntimeManager с внешними компонентами или библиотеками.\n\nПрямых тестов, специально направленных на проверку различных аспектов жизненного цикла RuntimeManager, достаточно много, однако следует добавить тесты, направленные на проверку ошибок и интеграций.", - "summary": { - "router": { - "intent": "CODE_QA", - "sub_intent": "FIND_TESTS", - "confidence": null - }, - "retrieval": { - "profile": "code", - "layers_hit": [ - "C0_SOURCE_CHUNKS", - "C2_DEPENDENCY_GRAPH" - ], - "evidence_sufficient": true - }, - "llm": { - "answer_status": "answered", - "groundedness": "grounded" - } - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "FIND_TESTS", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "RuntimeManager" - ], - "keyword_hints": [ - "RuntimeManager" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**", - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "test_file_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "test_symbol_patterns": [ - "test_runtime_manager", - "TestRuntimeManager", - "RuntimeManager" - ], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C0_SOURCE_CHUNKS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C0_SOURCE_CHUNKS": 10 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [], - "include_globs": [ - "src", - "tests" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests" - ] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src", - "tests" - ], - "include_globs": [ - "src", - "tests" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests" - ] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src", - "tests" - ], - "include_globs": [ - "src", - "tests" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests" - ] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**", - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "Где тесты для RuntimeManager? test_runtime_manager TestRuntimeManager RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**", - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "top_k": 6, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Где тесты для RuntimeManager? test_runtime_manager TestRuntimeManager RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**", - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "top_k": 10, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [], - "normalized_include_globs": [ - "src", - "tests" - ], - "normalized_exclude_globs": [], - "normalized_prefer_globs": [ - "tests" - ], - "filter_stage": "post_rank", - "candidates_before_filter": 0, - "candidates_after_filter": 0 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src", - "tests" - ], - "normalized_include_globs": [ - "src", - "tests" - ], - "normalized_exclude_globs": [], - "normalized_prefer_globs": [ - "tests" - ], - "filter_stage": "post_rank", - "candidates_before_filter": 6, - "candidates_after_filter": 6 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src", - "tests" - ], - "normalized_include_globs": [ - "src", - "tests" - ], - "normalized_exclude_globs": [], - "normalized_prefer_globs": [ - "tests" - ], - "filter_stage": "post_rank", - "candidates_before_filter": 10, - "candidates_after_filter": 10 - } - ], - "fallback": { - "used": true, - "reason": "scope_relaxed_no_hits" - }, - "symbol_resolution": { - "status": "not_found", - "resolved_symbol": null, - "alternatives": [ - "RuntimeManager" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "miss", - "hit_count": 0, - "fail_reason": "scope_relaxed_no_hits" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 6, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 10, - "fail_reason": null - } - ] - }, - "constraint_violations": [ - { - "type": "LAYER_MISSING", - "severity": "warn", - "details": { - "layer": "C1_SYMBOL_CATALOG", - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ] - }, - "suggested_fix": "Increase top_k for this layer or relax constraints for retrieval." - } - ], - "timings_ms": { - "router": 0, - "symbol_resolution": 0, - "retrieval_total": 146, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 71, - "C2_DEPENDENCY_GRAPH": 56, - "C0_SOURCE_CHUNKS": 18 - }, - "merge_rank": 0, - "prompt_build": 0, - "llm_call": 2103 - }, - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 904, - "evidence_rows": 16, - "evidence_chars": 7086 - }, - "evidence_summary": [ - { - "layer": "C2_DEPENDENCY_GRAPH", - "count": 6, - "unique_paths": 2 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 10, - "unique_paths": 2 - } - ], - "prompt_template_id": "intent_code_qa_find_tests_ru_v2", - "system_prompt_version": "v1" - }, - "router": { - "conversation_mode": "START", - "keyword_hints": [ - "RuntimeManager" - ], - "path_scope": [] - }, - "llm": { - "used_evidence_count": 16, - "missing_evidence_reason": null - } - }, - "run_info": { - "case_id": "plba-v2-find-tests-runtime-manager", - "mode": "full_chain", - "run_started_at": "2026-03-12T12:55:37", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - }, - "input_request": { - "text": "Где тесты для RuntimeManager?", - "normalized_query": "Где тесты для RuntimeManager?" - }, - "steps": [ - { - "step": "intent_router", - "input": { - "query": "Где тесты для RuntimeManager?" - }, - "output": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Где тесты для RuntimeManager?" - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "FIND_TESTS", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "RuntimeManager" - ], - "keyword_hints": [ - "RuntimeManager" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**", - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "test_file_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "test_symbol_patterns": [ - "test_runtime_manager", - "TestRuntimeManager", - "RuntimeManager" - ], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "timings_ms": { - "router": 0 - } - } - }, - { - "step": "retrieval", - "input": { - "query": "Где тесты для RuntimeManager?" - }, - "output": { - "symbol_resolution": { - "status": "not_found", - "resolved_symbol": null, - "alternatives": [ - "RuntimeManager" - ], - "confidence": 0.0 - }, - "rag_count": 16, - "rag_rows": [ - { - "path": "tests/test_runtime.py", - "content": "test_runtime_runs_worker_routine_and_exposes_status instantiates RuntimeManager", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_runtime_runs_worker_routine_and_exposes_status:instantiates", - "span_start": 209, - "span_end": 209, - "lexical_rank": 6, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "c397a308e7824ba9fe400a754c7e15e66ea6f058d7f5d3e82bb002bb78b509d2", - "edge_type": "instantiates", - "src_symbol_id": "1c767eb5ee08e84f45b18c8ed7531ec0ed73c63fb1594823569672db7b21e992", - "src_qname": "test_runtime_runs_worker_routine_and_exposes_status", - "dst_symbol_id": "aeadc039653807b0da1ca6e3cc1078ee61cfc510b28e7f9c2ec04c59da43cc8d", - "dst_ref": "RuntimeManager", - "resolution": "resolved", - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_runtime.py", - "content": "test_runtime_graceful_stop_waits_until_worker_finishes instantiates RuntimeManager", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_runtime_graceful_stop_waits_until_worker_finishes:instantiates", - "span_start": 229, - "span_end": 229, - "lexical_rank": 6, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "76b4701262ccaa0a7a41691407c4ebdb2ca74a2415d89f0a38ef0d4f608bda93", - "edge_type": "instantiates", - "src_symbol_id": "1076e788e4a03b10d7bc1313a8ad46caa170c13cc026c6e4de994af1a6ae57bf", - "src_qname": "test_runtime_graceful_stop_waits_until_worker_finishes", - "dst_symbol_id": "aeadc039653807b0da1ca6e3cc1078ee61cfc510b28e7f9c2ec04c59da43cc8d", - "dst_ref": "RuntimeManager", - "resolution": "resolved", - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "_build_runtime instantiates RuntimeManager", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "_build_runtime:instantiates", - "span_start": 155, - "span_end": 155, - "lexical_rank": 6, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "7eb254d564944bab6272757ee5ef688862bd321e6941e2495dc942e03b1c9a25", - "edge_type": "instantiates", - "src_symbol_id": "db94031d5245bf82be836a109b4584b43b8e83d37a0f318e03f6c8191896d469", - "src_qname": "_build_runtime", - "dst_symbol_id": "a1572ea8183dc0cd6ddbc74342bbde8c28cecfde37ad40b62feff09f8d103d11", - "dst_ref": "RuntimeManager", - "resolution": "resolved", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "test_worker_wakes_up_with_configured_interval instantiates RuntimeManager", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_worker_wakes_up_with_configured_interval:instantiates", - "span_start": 167, - "span_end": 167, - "lexical_rank": 6, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "189aafc4de0b79c688668f25f0c87166a127df26bd2215452014713b65ef281a", - "edge_type": "instantiates", - "src_symbol_id": "65f877f78191d65e6a752e41cedc70ebc784c266804a55c1c56440336e1f0d6e", - "src_qname": "test_worker_wakes_up_with_configured_interval", - "dst_symbol_id": "a1572ea8183dc0cd6ddbc74342bbde8c28cecfde37ad40b62feff09f8d103d11", - "dst_ref": "RuntimeManager", - "resolution": "resolved", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "test_actions_stop_busy_worker_after_timeout\n -> BlockingRoutine\n -> BlockingRoutine.__init__\n -> BlockingRoutine._started\n -> BlockingRoutine.run", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_actions_stop_busy_worker_after_timeout:dataflow_slice", - "span_start": 42, - "span_end": 238, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 5, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "8e7db3d2a9226f1c1d9942ac6373cfcafa0d2276758ddb8a3d3c455a3d58024d", - "edge_type": "dataflow_slice", - "src_symbol_id": "66392d3222421d9ba16eda3554940b16e7d5a6f33aa08c5738d35af2e32f1e4a", - "src_qname": "test_actions_stop_busy_worker_after_timeout", - "dst_symbol_id": "d9841bdbb69706c988ae7ae6adf89928dc4fae45943f74064f5382177034ba04", - "dst_ref": "BlockingRoutine.run", - "resolution": "resolved", - "slice_id": "8e7db3d2a9226f1c1d9942ac6373cfcafa0d2276758ddb8a3d3c455a3d58024d", - "root_symbol_id": "66392d3222421d9ba16eda3554940b16e7d5a6f33aa08c5738d35af2e32f1e4a", - "path_symbols": [ - "test_actions_stop_busy_worker_after_timeout", - "BlockingRoutine", - "BlockingRoutine.__init__", - "BlockingRoutine._started", - "BlockingRoutine.run" - ], - "path_symbol_ids": [ - "66392d3222421d9ba16eda3554940b16e7d5a6f33aa08c5738d35af2e32f1e4a", - "a3349c5bc65e4003a4bbd6a8dbb7a54c337e12d1aed930caa701b12e520f1e67", - "486deeed3043c6db985aef258e96ddc67aa53608e67a83962fbd2471f649ddf1", - "d9841bdbb69706c988ae7ae6adf89928dc4fae45943f74064f5382177034ba04" - ], - "path_edge_types": [ - "instantiates", - "writes_attr", - "reads_attr" - ], - "path_length": 5, - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "test_actions_stop_busy_worker_before_timeout\n -> BlockingRoutine\n -> BlockingRoutine.__init__\n -> BlockingRoutine._release\n -> BlockingRoutine.run", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_actions_stop_busy_worker_before_timeout:dataflow_slice", - "span_start": 43, - "span_end": 212, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 5, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "8bd726155ba387d3579763ee84dfd2f9a90bc917da88f3b2e89416ab5c1254d6", - "edge_type": "dataflow_slice", - "src_symbol_id": "a0bb116ca9d909c93a285667ae033fbd1859b2dad7cf34fcb44816393ef6909c", - "src_qname": "test_actions_stop_busy_worker_before_timeout", - "dst_symbol_id": "d9841bdbb69706c988ae7ae6adf89928dc4fae45943f74064f5382177034ba04", - "dst_ref": "BlockingRoutine.run", - "resolution": "resolved", - "slice_id": "8bd726155ba387d3579763ee84dfd2f9a90bc917da88f3b2e89416ab5c1254d6", - "root_symbol_id": "a0bb116ca9d909c93a285667ae033fbd1859b2dad7cf34fcb44816393ef6909c", - "path_symbols": [ - "test_actions_stop_busy_worker_before_timeout", - "BlockingRoutine", - "BlockingRoutine.__init__", - "BlockingRoutine._release", - "BlockingRoutine.run" - ], - "path_symbol_ids": [ - "a0bb116ca9d909c93a285667ae033fbd1859b2dad7cf34fcb44816393ef6909c", - "a3349c5bc65e4003a4bbd6a8dbb7a54c337e12d1aed930caa701b12e520f1e67", - "486deeed3043c6db985aef258e96ddc67aa53608e67a83962fbd2471f649ddf1", - "d9841bdbb69706c988ae7ae6adf89928dc4fae45943f74064f5382177034ba04" - ], - "path_edge_types": [ - "instantiates", - "writes_attr", - "reads_attr" - ], - "path_length": 5, - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_runtime.py", - "content": "def test_runtime_graceful_stop_waits_until_worker_finishes() -> None:\n started = Event()\n release = Event()\n runtime = RuntimeManager()\n runtime.register_module(BlockingModule(started, release))\n runtime.start()\n assert started.wait(timeout=1.0) is True\n assert runtime.status()[\"runtime\"][\"state\"] == \"busy\"\n\n stop_thread = Thread(target=runtime.stop, kwargs={\"timeout\": 1.0}, daemon=True)\n stop_thread.start()\n sleep(0.1)\n assert stop_thread.is_alive() is True\n\n release.set()\n stop_thread.join(timeout=1.0)\n assert stop_thread.is_alive() is False\n assert runtime.status()[\"runtime\"][\"state\"] == \"stopped\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_runtime.py:test_runtime_graceful_stop_waits_until_worker_finishes", - "span_start": 226, - "span_end": 243, - "lexical_rank": 6, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 8, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_runtime", - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_runtime.py", - "content": "def test_runtime_runs_worker_routine_and_exposes_status(tmp_path) -> None:\n config_path = tmp_path / \"config.yml\"\n config_path.write_text(\n \"\"\"\nplatform:\n workers: 1\nlog:\n version: 1\n disable_existing_loggers: false\n handlers:\n console:\n class: logging.StreamHandler\n root:\n level: INFO\n handlers: [console]\n\"\"\".strip(),\n encoding=\"utf-8\",\n )\n runtime = RuntimeManager()\n runtime.add_config_file(config_path)\n module = ExampleModule()\n runtime.register_module(module)\n\n runtime.start()\n sleep(0.2)\n status = runtime.status()\n runtime.stop()\n\n assert module.routine.processed == [{\"id\": 1}]\n assert status[\"modules\"] == [\"example\"]\n assert status[\"runtime\"][\"state\"] == \"idle\"\n assert status[\"health\"][\"status\"] == \"ok\"\n assert status[\"config\"] == {\"platform\": {\"workers\": 1}, \"log\": status[\"config\"][\"log\"]}", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_runtime.py:test_runtime_runs_worker_routine_and_exposes_status", - "span_start": 191, - "span_end": 223, - "lexical_rank": 6, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 7, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_runtime", - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "def _build_runtime(worker: Worker, *, control_timeout: int = 1) -> tuple[RuntimeManager, str]:\n runtime = RuntimeManager()\n channel = HttpControlChannel(host=\"127.0.0.1\", port=0, timeout=control_timeout)\n runtime.control_plane.register_channel(channel)\n runtime.register_module(WorkerModule(worker))\n runtime.start()\n return runtime, f\"http://127.0.0.1:{channel.port}\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:_build_runtime", - "span_start": 154, - "span_end": 160, - "lexical_rank": 6, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 6, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "def test_worker_wakes_up_with_configured_interval() -> None:\n interval = 0.15\n routine = IntervalRoutine()\n worker = ScenarioWorker(\"interval-worker\", routine, interval=interval)\n runtime = RuntimeManager()\n runtime.register_module(WorkerModule(worker))\n\n runtime.start()\n try:\n assert routine.wait_runs(count=3, timeout=2.0) is True\n finally:\n runtime.stop()\n\n deltas = routine.deltas()\n assert len(deltas) >= 2\n assert all(delta >= interval * 0.7 for delta in deltas[:2])", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:test_worker_wakes_up_with_configured_interval", - "span_start": 163, - "span_end": 178, - "lexical_rank": 6, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 7, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "class BlockingRoutine:\n def __init__(self, started: Event, release: Event) -> None:\n self._started = started\n self._release = release\n\n def run(self) -> None:\n self._started.set()\n self._release.wait(timeout=5.0)", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:BlockingRoutine", - "span_start": 40, - "span_end": 47, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 1, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "class ScenarioWorker(Worker):\n def __init__(self, name: str, routine: object, *, interval: float = 0.05) -> None:\n self._name = name\n self._routine = routine\n self._interval = interval\n self._thread: Thread | None = None\n self._stop_requested = Event()\n self._in_flight = 0\n self._runs = 0\n self._lock = Lock()\n\n @property\n def name(self) -> str:\n return self._name\n\n @property\n def critical(self) -> bool:\n return True\n\n def start(self) -> None:\n if self._thread is not None and self._thread.is_alive():\n return\n self._stop_requested.clear()\n self._thread = Thread(target=self._loop, name=f\"{self._name}-thread\", daemon=True)\n self._thread.start()\n\n def stop(self, force: bool = False) -> None:\n self._stop_requested.set()\n\n def health(self) -> WorkerHealth:\n return WorkerHealth(name=self.name, status=\"ok\", critical=True, meta={\"runs\": self._runs})\n\n def status(self) -> WorkerStatus:\n thread_alive = self._thread is not None and self._thread.is_alive()\n with self._lock:\n in_flight = self._in_flight\n runs = self._runs\n if not thread_alive:\n state = \"stopped\"\n elif self._stop_requested.is_set():\n state = \"stopping\"\n elif in_flight > 0:\n state = \"busy\"\n else:\n state = \"idle\"\n return WorkerStatus(name=self.name, state=state, in_flight=in_flight, meta={\"runs\": runs})\n\n def _loop(self) -> None:\n while not self._stop_requested.is_set():\n with self._lock:\n self._in_flight += 1\n try:\n self._routine.run()\n with self._lock:\n self._runs += 1\n finally:\n with self._lock:\n self._in_flight -= 1\n if self._stop_requested.is_set():\n return\n sleep(self._interval)", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:ScenarioWorker", - "span_start": 50, - "span_end": 110, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 2, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "class WorkerModule(ApplicationModule):\n def __init__(self, worker: Worker) -> None:\n self._worker = worker\n\n @property\n def name(self) -> str:\n return \"business-tests\"\n\n def register(self, registry: ModuleRegistry) -> None:\n registry.add_worker(self._worker)", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:WorkerModule", - "span_start": 113, - "span_end": 122, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 3, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "def _http_call_json(\n base_url: str,\n path: str,\n *,\n method: str = \"GET\",\n headers: dict[str, str] | None = None,\n) -> tuple[int, dict[str, object]]:\n request = Request(f\"{base_url}{path}\", method=method, headers=headers or {})\n try:\n with urlopen(request, timeout=15.0) as response:\n status = response.status\n body = response.read()\n except HTTPError as error:\n status = error.code\n body = error.read()\n payload = json.loads(body.decode(\"utf-8\"))\n return status, payload", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:_http_call_json", - "span_start": 125, - "span_end": 141, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 4, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "class IntervalRoutine:\n calls: list[float] = field(default_factory=list)\n _lock: Lock = field(default_factory=Lock)\n\n def run(self) -> None:\n with self._lock:\n self.calls.append(monotonic())\n\n def wait_runs(self, count: int, timeout: float) -> bool:\n deadline = monotonic() + timeout\n while monotonic() < deadline:\n with self._lock:\n if len(self.calls) >= count:\n return True\n sleep(0.01)\n return False\n\n def deltas(self) -> list[float]:\n with self._lock:\n return [self.calls[index + 1] - self.calls[index] for index in range(len(self.calls) - 1)]", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:IntervalRoutine", - "span_start": 18, - "span_end": 37, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "def _poll_until_stopped(base_url: str, timeout: float = 2.0) -> bool:\n deadline = monotonic() + timeout\n while monotonic() < deadline:\n _, payload = _http_call_json(base_url, \"/actions/status\")\n if payload.get(\"detail\") == \"stopped\":\n return True\n sleep(0.05)\n return False", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:_poll_until_stopped", - "span_start": 144, - "span_end": 151, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 5, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ] - }, - "diagnostics": { - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C0_SOURCE_CHUNKS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C0_SOURCE_CHUNKS": 10 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [], - "include_globs": [ - "src", - "tests" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests" - ] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src", - "tests" - ], - "include_globs": [ - "src", - "tests" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests" - ] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src", - "tests" - ], - "include_globs": [ - "src", - "tests" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests" - ] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**", - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "Где тесты для RuntimeManager? test_runtime_manager TestRuntimeManager RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**", - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "top_k": 6, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Где тесты для RuntimeManager? test_runtime_manager TestRuntimeManager RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**", - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "top_k": 10, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [], - "normalized_include_globs": [ - "src", - "tests" - ], - "normalized_exclude_globs": [], - "normalized_prefer_globs": [ - "tests" - ], - "filter_stage": "post_rank", - "candidates_before_filter": 0, - "candidates_after_filter": 0 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src", - "tests" - ], - "normalized_include_globs": [ - "src", - "tests" - ], - "normalized_exclude_globs": [], - "normalized_prefer_globs": [ - "tests" - ], - "filter_stage": "post_rank", - "candidates_before_filter": 6, - "candidates_after_filter": 6 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src", - "tests" - ], - "normalized_include_globs": [ - "src", - "tests" - ], - "normalized_exclude_globs": [], - "normalized_prefer_globs": [ - "tests" - ], - "filter_stage": "post_rank", - "candidates_before_filter": 10, - "candidates_after_filter": 10 - } - ], - "fallback": { - "used": true, - "reason": "scope_relaxed_no_hits" - }, - "symbol_resolution": { - "status": "not_found", - "resolved_symbol": null, - "alternatives": [ - "RuntimeManager" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "miss", - "hit_count": 0, - "fail_reason": "scope_relaxed_no_hits" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 6, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 10, - "fail_reason": null - } - ] - }, - "constraint_violations": [ - { - "type": "LAYER_MISSING", - "severity": "warn", - "details": { - "layer": "C1_SYMBOL_CATALOG", - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ] - }, - "suggested_fix": "Increase top_k for this layer or relax constraints for retrieval." - } - ], - "timings_ms": { - "symbol_resolution": 0, - "retrieval_total": 146, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 71, - "C2_DEPENDENCY_GRAPH": 56, - "C0_SOURCE_CHUNKS": 18 - }, - "merge_rank": 0 - } - } - }, - { - "step": "llm_answer", - "input": { - "query": "Где тесты для RuntimeManager?", - "rag_count": 16 - }, - "output": { - "llm_answer": "1. Прямые тесты:\n - tests/test_runtime.py | test_runtime_runs_worker_routine_and_exposes_status\n - tests/test_runtime.py | test_runtime_graceful_stop_waits_until_worker_finishes\nПроверка:\n - Создания и инициализации RuntimeManager.\n - Взаимодействия RuntimeManager с worker'ами и обработкой статуса.\n - Ожидания завершения работы worker'а при корректном завершении процесса остановки.\n - Проверки поведения RuntimeManager в разных состояниях (busy, stopped).\n\n2. Косвенные или ближайшие тесты:\n - tests/test_business_control_actions.py | _build_runtime\n - tests/test_business_control_actions.py | test_worker_wakes_up_with_configured_interval\nЭти тесты косвенно затрагивают RuntimeManager через инстанцирование его в других контекстах и использовании его методов, однако непосредственно поведение RuntimeManager не проверяется напрямую.\n\n3. Пробелы покрытия:\n - Не найдены явные тесты, которые проверяют обработку ошибок и исключений в RuntimeManager.\n - Нет тестов, которые покрывают интеграцию RuntimeManager с внешними компонентами или библиотеками.\n\nПрямых тестов, специально направленных на проверку различных аспектов жизненного цикла RuntimeManager, достаточно много, однако следует добавить тесты, направленные на проверку ошибок и интеграций." - }, - "diagnostics": { - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 904, - "evidence_rows": 16, - "evidence_chars": 7086 - }, - "evidence_summary": [ - { - "layer": "C2_DEPENDENCY_GRAPH", - "count": 6, - "unique_paths": 2 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 10, - "unique_paths": 2 - } - ], - "prompt_template_id": "intent_code_qa_find_tests_ru_v2", - "system_prompt_version": "v1" - }, - "timings_ms": { - "prompt_build": 0, - "llm_call": 2103 - } - } - } - ] - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_125536/full_chain_plba_code_subintents_v2_plba-v2-find-tests-runtime-manager.md b/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_125536/full_chain_plba_code_subintents_v2_plba-v2-find-tests-runtime-manager.md deleted file mode 100644 index f82b0c9..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_125536/full_chain_plba_code_subintents_v2_plba-v2-find-tests-runtime-manager.md +++ /dev/null @@ -1,32 +0,0 @@ -# plba-v2-find-tests-runtime-manager - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_subintents_v2.yaml -- runner: runtime -- mode: full_chain -- passed: True - -## Query -Где тесты для RuntimeManager? - -## Actual -{ - "intent": "CODE_QA", - "sub_intent": "FIND_TESTS", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 16, - "llm_answer": "1. Прямые тесты:\n - tests/test_runtime.py | test_runtime_runs_worker_routine_and_exposes_status\n - tests/test_runtime.py | test_runtime_graceful_stop_waits_until_worker_finishes\nПроверка:\n - Создания и инициализации RuntimeManager.\n - Взаимодействия RuntimeManager с worker'ами и обработкой статуса.\n - Ожидания завершения работы worker'а при корректном завершении процесса остановки.\n - Проверки поведения RuntimeManager в разных состояниях (busy, stopped).\n\n2. Косвенные или ближайшие тесты:\n - tests/test_business_control_actions.py | _build_runtime\n - tests/test_business_control_actions.py | test_worker_wakes_up_with_configured_interval\nЭти тесты косвенно затрагивают RuntimeManager через инстанцирование его в других контекстах и использовании его методов, однако непосредственно поведение RuntimeManager не проверяется напрямую.\n\n3. Пробелы покрытия:\n - Не найдены явные тесты, которые проверяют обработку ошибок и исключений в RuntimeManager.\n - Нет тестов, которые покрывают интеграцию RuntimeManager с внешними компонентами или библиотеками.\n\nПрямых тестов, специально направленных на проверку различных аспектов жизненного цикла RuntimeManager, достаточно много, однако следует добавить тесты, направленные на проверку ошибок и интеграций.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "RuntimeManager" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ] -} - -## Mismatches -- none \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_125536/full_chain_plba_code_subintents_v2_plba-v2-find-tests-trace-service.json b/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_125536/full_chain_plba_code_subintents_v2_plba-v2-find-tests-trace-service.json deleted file mode 100644 index b47d505..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_125536/full_chain_plba_code_subintents_v2_plba-v2-find-tests-trace-service.json +++ /dev/null @@ -1,2047 +0,0 @@ -{ - "case_id": "plba-v2-find-tests-trace-service", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_subintents_v2.yaml", - "runner": "runtime", - "mode": "full_chain", - "actual": { - "intent": "CODE_QA", - "sub_intent": "FIND_TESTS", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 16, - "llm_answer": "1. Прямые тесты:\n - tests/test_runtime.py | test_trace_service_writes_contexts_and_messages\n - Проверка записи контекстов и сообщений в TraceService.\n - tests/test_runtime.py | test_trace_service_supports_debug_warning_and_error_levels\n - Проверка поддержки различных уровней логирования (debug, warning, error).\n\n2. Косвенные или ближайшие тесты:\n - Нет явных связей с другими тестами через зависимости или имена, однако тесты касаются работы с Transport и записью контекста/сообщений, что близко к функционалу TraceService.\n\n3. Что именно проверяется:\n - Запись и корректность данных контекстов и сообщений в TraceService.\n - Поддержка различных уровней логирования и запись соответствующих сообщений.\n\n4. Пробелы покрытия:\n - Не найдены явные пробелы покрытия для TraceService напрямую. Однако могут быть аспекты поведения, которые не охвачены текущими тестами, например, обработка ошибок, особые случаи или взаимодействие с внешними компонентами, зависящими от окружения.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "TraceService" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ] - }, - "passed": true, - "mismatches": [], - "details": { - "case_id": "plba-v2-find-tests-trace-service", - "text": "Где тесты для TraceService?", - "mode": "full_chain", - "run_started_at": "2026-03-12T12:55:37", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Где тесты для TraceService?", - "symbol_resolution": { - "status": "not_found", - "resolved_symbol": null, - "alternatives": [ - "TraceService" - ], - "confidence": 0.0 - }, - "rag_count": 16, - "rag_rows": [ - { - "path": "tests/test_runtime.py", - "content": "test_trace_service_writes_contexts_and_messages\n -> RecordingTransport\n -> RecordingTransport.__init__\n -> RecordingTransport.contexts\n -> test_trace_service_writes_contexts_and_messages", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_trace_service_writes_contexts_and_messages:dataflow_slice", - "span_start": 181, - "span_end": 256, - "lexical_rank": 4, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 5, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "1636a2f70dee79c804259dc114af6c1ab4db27099911e5f97ac97a2bcb59be8a", - "edge_type": "dataflow_slice", - "src_symbol_id": "1600da201da1d0150240b400e3232172354156decdd1a04e1ab1a1edcd3a7e99", - "src_qname": "test_trace_service_writes_contexts_and_messages", - "dst_symbol_id": "1600da201da1d0150240b400e3232172354156decdd1a04e1ab1a1edcd3a7e99", - "dst_ref": "test_trace_service_writes_contexts_and_messages", - "resolution": "resolved", - "slice_id": "1636a2f70dee79c804259dc114af6c1ab4db27099911e5f97ac97a2bcb59be8a", - "root_symbol_id": "1600da201da1d0150240b400e3232172354156decdd1a04e1ab1a1edcd3a7e99", - "path_symbols": [ - "test_trace_service_writes_contexts_and_messages", - "RecordingTransport", - "RecordingTransport.__init__", - "RecordingTransport.contexts", - "test_trace_service_writes_contexts_and_messages" - ], - "path_symbol_ids": [ - "1600da201da1d0150240b400e3232172354156decdd1a04e1ab1a1edcd3a7e99", - "e3d635de1f1880673b69bf73ca6a45caffa5c7fdc23d589d5e40f76b86bdcd33", - "e34d80da723a7115a7a7586b52dc8b5cfda05c581509eee0c1a0296df9a340cb", - "1600da201da1d0150240b400e3232172354156decdd1a04e1ab1a1edcd3a7e99" - ], - "path_edge_types": [ - "instantiates", - "writes_attr", - "reads_attr" - ], - "path_length": 5, - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_runtime.py", - "content": "test_trace_service_writes_contexts_and_messages\n -> RecordingTransport\n -> RecordingTransport.__init__\n -> RecordingTransport.contexts\n -> test_trace_service_allows_messages_without_status", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_trace_service_writes_contexts_and_messages:dataflow_slice", - "span_start": 181, - "span_end": 293, - "lexical_rank": 4, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 5, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "5db5abe56b73f884c5178647bd25ef150064a94a41fc8c052aebaa09bd7fdb3d", - "edge_type": "dataflow_slice", - "src_symbol_id": "1600da201da1d0150240b400e3232172354156decdd1a04e1ab1a1edcd3a7e99", - "src_qname": "test_trace_service_writes_contexts_and_messages", - "dst_symbol_id": "7127ca85ce6447928e195e901d36f1e1f1e8205a686e567c2d1b187431f989df", - "dst_ref": "test_trace_service_allows_messages_without_status", - "resolution": "resolved", - "slice_id": "5db5abe56b73f884c5178647bd25ef150064a94a41fc8c052aebaa09bd7fdb3d", - "root_symbol_id": "1600da201da1d0150240b400e3232172354156decdd1a04e1ab1a1edcd3a7e99", - "path_symbols": [ - "test_trace_service_writes_contexts_and_messages", - "RecordingTransport", - "RecordingTransport.__init__", - "RecordingTransport.contexts", - "test_trace_service_allows_messages_without_status" - ], - "path_symbol_ids": [ - "1600da201da1d0150240b400e3232172354156decdd1a04e1ab1a1edcd3a7e99", - "e3d635de1f1880673b69bf73ca6a45caffa5c7fdc23d589d5e40f76b86bdcd33", - "e34d80da723a7115a7a7586b52dc8b5cfda05c581509eee0c1a0296df9a340cb", - "7127ca85ce6447928e195e901d36f1e1f1e8205a686e567c2d1b187431f989df" - ], - "path_edge_types": [ - "instantiates", - "writes_attr", - "reads_attr" - ], - "path_length": 5, - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_runtime.py", - "content": "test_trace_service_writes_contexts_and_messages\n -> RecordingTransport\n -> RecordingTransport.__init__\n -> RecordingTransport.contexts\n -> RecordingTransport.write_context", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_trace_service_writes_contexts_and_messages:dataflow_slice", - "span_start": 181, - "span_end": 249, - "lexical_rank": 4, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 5, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "60d7a8655fa4c53d9130ce342fc023d24ccfa16baea47ad60c91d2d49f547565", - "edge_type": "dataflow_slice", - "src_symbol_id": "1600da201da1d0150240b400e3232172354156decdd1a04e1ab1a1edcd3a7e99", - "src_qname": "test_trace_service_writes_contexts_and_messages", - "dst_symbol_id": "b8bbf341e230198caafe54727e13f2db27b7200d6fd95684fc5cf748db1a0e88", - "dst_ref": "RecordingTransport.write_context", - "resolution": "resolved", - "slice_id": "60d7a8655fa4c53d9130ce342fc023d24ccfa16baea47ad60c91d2d49f547565", - "root_symbol_id": "1600da201da1d0150240b400e3232172354156decdd1a04e1ab1a1edcd3a7e99", - "path_symbols": [ - "test_trace_service_writes_contexts_and_messages", - "RecordingTransport", - "RecordingTransport.__init__", - "RecordingTransport.contexts", - "RecordingTransport.write_context" - ], - "path_symbol_ids": [ - "1600da201da1d0150240b400e3232172354156decdd1a04e1ab1a1edcd3a7e99", - "e3d635de1f1880673b69bf73ca6a45caffa5c7fdc23d589d5e40f76b86bdcd33", - "e34d80da723a7115a7a7586b52dc8b5cfda05c581509eee0c1a0296df9a340cb", - "b8bbf341e230198caafe54727e13f2db27b7200d6fd95684fc5cf748db1a0e88" - ], - "path_edge_types": [ - "instantiates", - "writes_attr", - "reads_attr" - ], - "path_length": 5, - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_runtime.py", - "content": "test_trace_service_supports_debug_warning_and_error_levels\n -> RecordingTransport\n -> RecordingTransport.__init__\n -> RecordingTransport.contexts\n -> RecordingTransport.write_context", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_trace_service_supports_debug_warning_and_error_levels:dataflow_slice", - "span_start": 181, - "span_end": 265, - "lexical_rank": 4, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 5, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "1372a2241c7265705e5cf9dceeb5e59836fac1d679227c4279ed39e0798ddddf", - "edge_type": "dataflow_slice", - "src_symbol_id": "ede183f1c546725064e28ddab1ffdbae0d1a1258fd62a50eb556c10d10995415", - "src_qname": "test_trace_service_supports_debug_warning_and_error_levels", - "dst_symbol_id": "b8bbf341e230198caafe54727e13f2db27b7200d6fd95684fc5cf748db1a0e88", - "dst_ref": "RecordingTransport.write_context", - "resolution": "resolved", - "slice_id": "1372a2241c7265705e5cf9dceeb5e59836fac1d679227c4279ed39e0798ddddf", - "root_symbol_id": "ede183f1c546725064e28ddab1ffdbae0d1a1258fd62a50eb556c10d10995415", - "path_symbols": [ - "test_trace_service_supports_debug_warning_and_error_levels", - "RecordingTransport", - "RecordingTransport.__init__", - "RecordingTransport.contexts", - "RecordingTransport.write_context" - ], - "path_symbol_ids": [ - "ede183f1c546725064e28ddab1ffdbae0d1a1258fd62a50eb556c10d10995415", - "e3d635de1f1880673b69bf73ca6a45caffa5c7fdc23d589d5e40f76b86bdcd33", - "e34d80da723a7115a7a7586b52dc8b5cfda05c581509eee0c1a0296df9a340cb", - "b8bbf341e230198caafe54727e13f2db27b7200d6fd95684fc5cf748db1a0e88" - ], - "path_edge_types": [ - "instantiates", - "writes_attr", - "reads_attr" - ], - "path_length": 5, - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_runtime.py", - "content": "test_trace_service_supports_debug_warning_and_error_levels\n -> RecordingTransport\n -> RecordingTransport.__init__\n -> RecordingTransport.contexts\n -> test_trace_service_writes_contexts_and_messages", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_trace_service_supports_debug_warning_and_error_levels:dataflow_slice", - "span_start": 181, - "span_end": 265, - "lexical_rank": 4, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 5, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "8b6a5a738525df160600d71c15915704172de20db436ea2f84b6e039be396a2d", - "edge_type": "dataflow_slice", - "src_symbol_id": "ede183f1c546725064e28ddab1ffdbae0d1a1258fd62a50eb556c10d10995415", - "src_qname": "test_trace_service_supports_debug_warning_and_error_levels", - "dst_symbol_id": "1600da201da1d0150240b400e3232172354156decdd1a04e1ab1a1edcd3a7e99", - "dst_ref": "test_trace_service_writes_contexts_and_messages", - "resolution": "resolved", - "slice_id": "8b6a5a738525df160600d71c15915704172de20db436ea2f84b6e039be396a2d", - "root_symbol_id": "ede183f1c546725064e28ddab1ffdbae0d1a1258fd62a50eb556c10d10995415", - "path_symbols": [ - "test_trace_service_supports_debug_warning_and_error_levels", - "RecordingTransport", - "RecordingTransport.__init__", - "RecordingTransport.contexts", - "test_trace_service_writes_contexts_and_messages" - ], - "path_symbol_ids": [ - "ede183f1c546725064e28ddab1ffdbae0d1a1258fd62a50eb556c10d10995415", - "e3d635de1f1880673b69bf73ca6a45caffa5c7fdc23d589d5e40f76b86bdcd33", - "e34d80da723a7115a7a7586b52dc8b5cfda05c581509eee0c1a0296df9a340cb", - "1600da201da1d0150240b400e3232172354156decdd1a04e1ab1a1edcd3a7e99" - ], - "path_edge_types": [ - "instantiates", - "writes_attr", - "reads_attr" - ], - "path_length": 5, - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_runtime.py", - "content": "test_trace_service_supports_debug_warning_and_error_levels\n -> RecordingTransport\n -> RecordingTransport.__init__\n -> RecordingTransport.contexts\n -> test_trace_service_allows_messages_without_status", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_trace_service_supports_debug_warning_and_error_levels:dataflow_slice", - "span_start": 181, - "span_end": 293, - "lexical_rank": 4, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 5, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "f7d099f6d5746aa61a3025fd7eef791369bd3a3e5df4bc716de87e7b149ccde6", - "edge_type": "dataflow_slice", - "src_symbol_id": "ede183f1c546725064e28ddab1ffdbae0d1a1258fd62a50eb556c10d10995415", - "src_qname": "test_trace_service_supports_debug_warning_and_error_levels", - "dst_symbol_id": "7127ca85ce6447928e195e901d36f1e1f1e8205a686e567c2d1b187431f989df", - "dst_ref": "test_trace_service_allows_messages_without_status", - "resolution": "resolved", - "slice_id": "f7d099f6d5746aa61a3025fd7eef791369bd3a3e5df4bc716de87e7b149ccde6", - "root_symbol_id": "ede183f1c546725064e28ddab1ffdbae0d1a1258fd62a50eb556c10d10995415", - "path_symbols": [ - "test_trace_service_supports_debug_warning_and_error_levels", - "RecordingTransport", - "RecordingTransport.__init__", - "RecordingTransport.contexts", - "test_trace_service_allows_messages_without_status" - ], - "path_symbol_ids": [ - "ede183f1c546725064e28ddab1ffdbae0d1a1258fd62a50eb556c10d10995415", - "e3d635de1f1880673b69bf73ca6a45caffa5c7fdc23d589d5e40f76b86bdcd33", - "e34d80da723a7115a7a7586b52dc8b5cfda05c581509eee0c1a0296df9a340cb", - "7127ca85ce6447928e195e901d36f1e1f1e8205a686e567c2d1b187431f989df" - ], - "path_edge_types": [ - "instantiates", - "writes_attr", - "reads_attr" - ], - "path_length": 5, - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_runtime.py", - "content": "def test_trace_service_writes_contexts_and_messages() -> None:\n from app_runtime.tracing.service import TraceService\n\n transport = RecordingTransport()\n manager = TraceService(transport=transport)\n\n with manager.open_context(alias=\"worker\", kind=\"worker\", attrs={\"routine\": \"incoming\"}):\n manager.step(\"parse\")\n manager.info(\"started\", status=\"ok\", attrs={\"attempt\": 1})\n\n assert len(transport.contexts) == 1\n assert len(transport.messages) == 1\n assert transport.contexts[0].alias == \"worker\"\n assert transport.messages[0].step == \"parse\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_runtime.py:test_trace_service_writes_contexts_and_messages", - "span_start": 246, - "span_end": 259, - "lexical_rank": 6, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 9, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_runtime", - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_runtime.py", - "content": "def test_trace_service_supports_debug_warning_and_error_levels() -> None:\n from app_runtime.tracing.service import TraceService\n\n transport = RecordingTransport()\n manager = TraceService(transport=transport)\n\n with manager.open_context(alias=\"worker\", kind=\"worker\", attrs={\"routine\": \"incoming\"}):\n manager.step(\"validate\")\n manager.debug(\"validation details\", attrs={\"rule\": \"basic\"})\n manager.warning(\"validation warning\", status=\"degraded\", attrs={\"attempt\": 1})\n manager.error(\"integration failed\", status=\"failed\", attrs={\"integration\": \"crm\"})\n manager.exception(\"caught exception\", attrs={\"exception_type\": \"RuntimeError\"})\n\n levels = [message.level for message in transport.messages]\n assert levels == [\"DEBUG\", \"WARNING\", \"ERROR\", \"ERROR\"]", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_runtime.py:test_trace_service_supports_debug_warning_and_error_levels", - "span_start": 262, - "span_end": 276, - "lexical_rank": 6, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 10, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_runtime", - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_runtime.py", - "content": "def test_trace_service_allows_messages_without_status() -> None:\n from app_runtime.tracing.service import TraceService\n\n transport = RecordingTransport()\n manager = TraceService(transport=transport)\n\n with manager.open_context(alias=\"worker\", kind=\"worker\"):\n manager.step(\"optional-status\")\n manager.debug(\"debug without status\")\n manager.info(\"info without status\")\n manager.warning(\"warning without status\")\n manager.error(\"error without status\")\n\n assert [message.status for message in transport.messages] == [\"\", \"\", \"\", \"\"]\n assert all(message.trace_id == transport.contexts[0].trace_id for message in transport.messages)", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_runtime.py:test_trace_service_allows_messages_without_status", - "span_start": 279, - "span_end": 293, - "lexical_rank": 6, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 11, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_runtime", - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "class ScenarioWorker(Worker):\n def __init__(self, name: str, routine: object, *, interval: float = 0.05) -> None:\n self._name = name\n self._routine = routine\n self._interval = interval\n self._thread: Thread | None = None\n self._stop_requested = Event()\n self._in_flight = 0\n self._runs = 0\n self._lock = Lock()\n\n @property\n def name(self) -> str:\n return self._name\n\n @property\n def critical(self) -> bool:\n return True\n\n def start(self) -> None:\n if self._thread is not None and self._thread.is_alive():\n return\n self._stop_requested.clear()\n self._thread = Thread(target=self._loop, name=f\"{self._name}-thread\", daemon=True)\n self._thread.start()\n\n def stop(self, force: bool = False) -> None:\n self._stop_requested.set()\n\n def health(self) -> WorkerHealth:\n return WorkerHealth(name=self.name, status=\"ok\", critical=True, meta={\"runs\": self._runs})\n\n def status(self) -> WorkerStatus:\n thread_alive = self._thread is not None and self._thread.is_alive()\n with self._lock:\n in_flight = self._in_flight\n runs = self._runs\n if not thread_alive:\n state = \"stopped\"\n elif self._stop_requested.is_set():\n state = \"stopping\"\n elif in_flight > 0:\n state = \"busy\"\n else:\n state = \"idle\"\n return WorkerStatus(name=self.name, state=state, in_flight=in_flight, meta={\"runs\": runs})\n\n def _loop(self) -> None:\n while not self._stop_requested.is_set():\n with self._lock:\n self._in_flight += 1\n try:\n self._routine.run()\n with self._lock:\n self._runs += 1\n finally:\n with self._lock:\n self._in_flight -= 1\n if self._stop_requested.is_set():\n return\n sleep(self._interval)", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:ScenarioWorker", - "span_start": 50, - "span_end": 110, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 2, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "class IntervalRoutine:\n calls: list[float] = field(default_factory=list)\n _lock: Lock = field(default_factory=Lock)\n\n def run(self) -> None:\n with self._lock:\n self.calls.append(monotonic())\n\n def wait_runs(self, count: int, timeout: float) -> bool:\n deadline = monotonic() + timeout\n while monotonic() < deadline:\n with self._lock:\n if len(self.calls) >= count:\n return True\n sleep(0.01)\n return False\n\n def deltas(self) -> list[float]:\n with self._lock:\n return [self.calls[index + 1] - self.calls[index] for index in range(len(self.calls) - 1)]", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:IntervalRoutine", - "span_start": 18, - "span_end": 37, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "class BlockingRoutine:\n def __init__(self, started: Event, release: Event) -> None:\n self._started = started\n self._release = release\n\n def run(self) -> None:\n self._started.set()\n self._release.wait(timeout=5.0)", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:BlockingRoutine", - "span_start": 40, - "span_end": 47, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 1, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "def test_worker_wakes_up_with_configured_interval() -> None:\n interval = 0.15\n routine = IntervalRoutine()\n worker = ScenarioWorker(\"interval-worker\", routine, interval=interval)\n runtime = RuntimeManager()\n runtime.register_module(WorkerModule(worker))\n\n runtime.start()\n try:\n assert routine.wait_runs(count=3, timeout=2.0) is True\n finally:\n runtime.stop()\n\n deltas = routine.deltas()\n assert len(deltas) >= 2\n assert all(delta >= interval * 0.7 for delta in deltas[:2])", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:test_worker_wakes_up_with_configured_interval", - "span_start": 163, - "span_end": 178, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 7, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "def _http_call_json(\n base_url: str,\n path: str,\n *,\n method: str = \"GET\",\n headers: dict[str, str] | None = None,\n) -> tuple[int, dict[str, object]]:\n request = Request(f\"{base_url}{path}\", method=method, headers=headers or {})\n try:\n with urlopen(request, timeout=15.0) as response:\n status = response.status\n body = response.read()\n except HTTPError as error:\n status = error.code\n body = error.read()\n payload = json.loads(body.decode(\"utf-8\"))\n return status, payload", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:_http_call_json", - "span_start": 125, - "span_end": 141, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 4, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "def _build_runtime(worker: Worker, *, control_timeout: int = 1) -> tuple[RuntimeManager, str]:\n runtime = RuntimeManager()\n channel = HttpControlChannel(host=\"127.0.0.1\", port=0, timeout=control_timeout)\n runtime.control_plane.register_channel(channel)\n runtime.register_module(WorkerModule(worker))\n runtime.start()\n return runtime, f\"http://127.0.0.1:{channel.port}\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:_build_runtime", - "span_start": 154, - "span_end": 160, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 6, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "class WorkerModule(ApplicationModule):\n def __init__(self, worker: Worker) -> None:\n self._worker = worker\n\n @property\n def name(self) -> str:\n return \"business-tests\"\n\n def register(self, registry: ModuleRegistry) -> None:\n registry.add_worker(self._worker)", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:WorkerModule", - "span_start": 113, - "span_end": 122, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 3, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "llm_answer": "1. Прямые тесты:\n - tests/test_runtime.py | test_trace_service_writes_contexts_and_messages\n - Проверка записи контекстов и сообщений в TraceService.\n - tests/test_runtime.py | test_trace_service_supports_debug_warning_and_error_levels\n - Проверка поддержки различных уровней логирования (debug, warning, error).\n\n2. Косвенные или ближайшие тесты:\n - Нет явных связей с другими тестами через зависимости или имена, однако тесты касаются работы с Transport и записью контекста/сообщений, что близко к функционалу TraceService.\n\n3. Что именно проверяется:\n - Запись и корректность данных контекстов и сообщений в TraceService.\n - Поддержка различных уровней логирования и запись соответствующих сообщений.\n\n4. Пробелы покрытия:\n - Не найдены явные пробелы покрытия для TraceService напрямую. Однако могут быть аспекты поведения, которые не охвачены текущими тестами, например, обработка ошибок, особые случаи или взаимодействие с внешними компонентами, зависящими от окружения.", - "summary": { - "router": { - "intent": "CODE_QA", - "sub_intent": "FIND_TESTS", - "confidence": null - }, - "retrieval": { - "profile": "code", - "layers_hit": [ - "C0_SOURCE_CHUNKS", - "C2_DEPENDENCY_GRAPH" - ], - "evidence_sufficient": true - }, - "llm": { - "answer_status": "answered", - "groundedness": "grounded" - } - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "FIND_TESTS", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "TraceService" - ], - "keyword_hints": [ - "TraceService" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**", - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "test_file_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "test_symbol_patterns": [ - "test_trace_service", - "TestTraceService", - "TraceService" - ], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C0_SOURCE_CHUNKS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C0_SOURCE_CHUNKS": 10 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [], - "include_globs": [ - "src", - "tests" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests" - ] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src", - "tests" - ], - "include_globs": [ - "src", - "tests" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests" - ] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src", - "tests" - ], - "include_globs": [ - "src", - "tests" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests" - ] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "TraceService", - "path_scope": [], - "include_globs": [ - "src/**", - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "Где тесты для TraceService? test_trace_service TestTraceService TraceService", - "path_scope": [], - "include_globs": [ - "src/**", - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "top_k": 6, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Где тесты для TraceService? test_trace_service TestTraceService TraceService", - "path_scope": [], - "include_globs": [ - "src/**", - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "top_k": 10, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [], - "normalized_include_globs": [ - "src", - "tests" - ], - "normalized_exclude_globs": [], - "normalized_prefer_globs": [ - "tests" - ], - "filter_stage": "post_rank", - "candidates_before_filter": 0, - "candidates_after_filter": 0 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src", - "tests" - ], - "normalized_include_globs": [ - "src", - "tests" - ], - "normalized_exclude_globs": [], - "normalized_prefer_globs": [ - "tests" - ], - "filter_stage": "post_rank", - "candidates_before_filter": 6, - "candidates_after_filter": 6 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src", - "tests" - ], - "normalized_include_globs": [ - "src", - "tests" - ], - "normalized_exclude_globs": [], - "normalized_prefer_globs": [ - "tests" - ], - "filter_stage": "post_rank", - "candidates_before_filter": 10, - "candidates_after_filter": 10 - } - ], - "fallback": { - "used": true, - "reason": "scope_relaxed_no_hits" - }, - "symbol_resolution": { - "status": "not_found", - "resolved_symbol": null, - "alternatives": [ - "TraceService" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "miss", - "hit_count": 0, - "fail_reason": "scope_relaxed_no_hits" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 6, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 10, - "fail_reason": null - } - ] - }, - "constraint_violations": [ - { - "type": "LAYER_MISSING", - "severity": "warn", - "details": { - "layer": "C1_SYMBOL_CATALOG", - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ] - }, - "suggested_fix": "Increase top_k for this layer or relax constraints for retrieval." - } - ], - "timings_ms": { - "router": 0, - "symbol_resolution": 0, - "retrieval_total": 96, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 44, - "C2_DEPENDENCY_GRAPH": 39, - "C0_SOURCE_CHUNKS": 13 - }, - "merge_rank": 0, - "prompt_build": 0, - "llm_call": 1736 - }, - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 978, - "evidence_rows": 16, - "evidence_chars": 7847 - }, - "evidence_summary": [ - { - "layer": "C2_DEPENDENCY_GRAPH", - "count": 6, - "unique_paths": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 10, - "unique_paths": 2 - } - ], - "prompt_template_id": "intent_code_qa_find_tests_ru_v2", - "system_prompt_version": "v1" - }, - "router": { - "conversation_mode": "START", - "keyword_hints": [ - "TraceService" - ], - "path_scope": [] - }, - "llm": { - "used_evidence_count": 16, - "missing_evidence_reason": null - } - }, - "run_info": { - "case_id": "plba-v2-find-tests-trace-service", - "mode": "full_chain", - "run_started_at": "2026-03-12T12:55:37", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - }, - "input_request": { - "text": "Где тесты для TraceService?", - "normalized_query": "Где тесты для TraceService?" - }, - "steps": [ - { - "step": "intent_router", - "input": { - "query": "Где тесты для TraceService?" - }, - "output": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Где тесты для TraceService?" - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "FIND_TESTS", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "TraceService" - ], - "keyword_hints": [ - "TraceService" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**", - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "test_file_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "test_symbol_patterns": [ - "test_trace_service", - "TestTraceService", - "TraceService" - ], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "timings_ms": { - "router": 0 - } - } - }, - { - "step": "retrieval", - "input": { - "query": "Где тесты для TraceService?" - }, - "output": { - "symbol_resolution": { - "status": "not_found", - "resolved_symbol": null, - "alternatives": [ - "TraceService" - ], - "confidence": 0.0 - }, - "rag_count": 16, - "rag_rows": [ - { - "path": "tests/test_runtime.py", - "content": "test_trace_service_writes_contexts_and_messages\n -> RecordingTransport\n -> RecordingTransport.__init__\n -> RecordingTransport.contexts\n -> test_trace_service_writes_contexts_and_messages", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_trace_service_writes_contexts_and_messages:dataflow_slice", - "span_start": 181, - "span_end": 256, - "lexical_rank": 4, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 5, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "1636a2f70dee79c804259dc114af6c1ab4db27099911e5f97ac97a2bcb59be8a", - "edge_type": "dataflow_slice", - "src_symbol_id": "1600da201da1d0150240b400e3232172354156decdd1a04e1ab1a1edcd3a7e99", - "src_qname": "test_trace_service_writes_contexts_and_messages", - "dst_symbol_id": "1600da201da1d0150240b400e3232172354156decdd1a04e1ab1a1edcd3a7e99", - "dst_ref": "test_trace_service_writes_contexts_and_messages", - "resolution": "resolved", - "slice_id": "1636a2f70dee79c804259dc114af6c1ab4db27099911e5f97ac97a2bcb59be8a", - "root_symbol_id": "1600da201da1d0150240b400e3232172354156decdd1a04e1ab1a1edcd3a7e99", - "path_symbols": [ - "test_trace_service_writes_contexts_and_messages", - "RecordingTransport", - "RecordingTransport.__init__", - "RecordingTransport.contexts", - "test_trace_service_writes_contexts_and_messages" - ], - "path_symbol_ids": [ - "1600da201da1d0150240b400e3232172354156decdd1a04e1ab1a1edcd3a7e99", - "e3d635de1f1880673b69bf73ca6a45caffa5c7fdc23d589d5e40f76b86bdcd33", - "e34d80da723a7115a7a7586b52dc8b5cfda05c581509eee0c1a0296df9a340cb", - "1600da201da1d0150240b400e3232172354156decdd1a04e1ab1a1edcd3a7e99" - ], - "path_edge_types": [ - "instantiates", - "writes_attr", - "reads_attr" - ], - "path_length": 5, - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_runtime.py", - "content": "test_trace_service_writes_contexts_and_messages\n -> RecordingTransport\n -> RecordingTransport.__init__\n -> RecordingTransport.contexts\n -> test_trace_service_allows_messages_without_status", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_trace_service_writes_contexts_and_messages:dataflow_slice", - "span_start": 181, - "span_end": 293, - "lexical_rank": 4, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 5, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "5db5abe56b73f884c5178647bd25ef150064a94a41fc8c052aebaa09bd7fdb3d", - "edge_type": "dataflow_slice", - "src_symbol_id": "1600da201da1d0150240b400e3232172354156decdd1a04e1ab1a1edcd3a7e99", - "src_qname": "test_trace_service_writes_contexts_and_messages", - "dst_symbol_id": "7127ca85ce6447928e195e901d36f1e1f1e8205a686e567c2d1b187431f989df", - "dst_ref": "test_trace_service_allows_messages_without_status", - "resolution": "resolved", - "slice_id": "5db5abe56b73f884c5178647bd25ef150064a94a41fc8c052aebaa09bd7fdb3d", - "root_symbol_id": "1600da201da1d0150240b400e3232172354156decdd1a04e1ab1a1edcd3a7e99", - "path_symbols": [ - "test_trace_service_writes_contexts_and_messages", - "RecordingTransport", - "RecordingTransport.__init__", - "RecordingTransport.contexts", - "test_trace_service_allows_messages_without_status" - ], - "path_symbol_ids": [ - "1600da201da1d0150240b400e3232172354156decdd1a04e1ab1a1edcd3a7e99", - "e3d635de1f1880673b69bf73ca6a45caffa5c7fdc23d589d5e40f76b86bdcd33", - "e34d80da723a7115a7a7586b52dc8b5cfda05c581509eee0c1a0296df9a340cb", - "7127ca85ce6447928e195e901d36f1e1f1e8205a686e567c2d1b187431f989df" - ], - "path_edge_types": [ - "instantiates", - "writes_attr", - "reads_attr" - ], - "path_length": 5, - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_runtime.py", - "content": "test_trace_service_writes_contexts_and_messages\n -> RecordingTransport\n -> RecordingTransport.__init__\n -> RecordingTransport.contexts\n -> RecordingTransport.write_context", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_trace_service_writes_contexts_and_messages:dataflow_slice", - "span_start": 181, - "span_end": 249, - "lexical_rank": 4, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 5, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "60d7a8655fa4c53d9130ce342fc023d24ccfa16baea47ad60c91d2d49f547565", - "edge_type": "dataflow_slice", - "src_symbol_id": "1600da201da1d0150240b400e3232172354156decdd1a04e1ab1a1edcd3a7e99", - "src_qname": "test_trace_service_writes_contexts_and_messages", - "dst_symbol_id": "b8bbf341e230198caafe54727e13f2db27b7200d6fd95684fc5cf748db1a0e88", - "dst_ref": "RecordingTransport.write_context", - "resolution": "resolved", - "slice_id": "60d7a8655fa4c53d9130ce342fc023d24ccfa16baea47ad60c91d2d49f547565", - "root_symbol_id": "1600da201da1d0150240b400e3232172354156decdd1a04e1ab1a1edcd3a7e99", - "path_symbols": [ - "test_trace_service_writes_contexts_and_messages", - "RecordingTransport", - "RecordingTransport.__init__", - "RecordingTransport.contexts", - "RecordingTransport.write_context" - ], - "path_symbol_ids": [ - "1600da201da1d0150240b400e3232172354156decdd1a04e1ab1a1edcd3a7e99", - "e3d635de1f1880673b69bf73ca6a45caffa5c7fdc23d589d5e40f76b86bdcd33", - "e34d80da723a7115a7a7586b52dc8b5cfda05c581509eee0c1a0296df9a340cb", - "b8bbf341e230198caafe54727e13f2db27b7200d6fd95684fc5cf748db1a0e88" - ], - "path_edge_types": [ - "instantiates", - "writes_attr", - "reads_attr" - ], - "path_length": 5, - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_runtime.py", - "content": "test_trace_service_supports_debug_warning_and_error_levels\n -> RecordingTransport\n -> RecordingTransport.__init__\n -> RecordingTransport.contexts\n -> RecordingTransport.write_context", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_trace_service_supports_debug_warning_and_error_levels:dataflow_slice", - "span_start": 181, - "span_end": 265, - "lexical_rank": 4, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 5, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "1372a2241c7265705e5cf9dceeb5e59836fac1d679227c4279ed39e0798ddddf", - "edge_type": "dataflow_slice", - "src_symbol_id": "ede183f1c546725064e28ddab1ffdbae0d1a1258fd62a50eb556c10d10995415", - "src_qname": "test_trace_service_supports_debug_warning_and_error_levels", - "dst_symbol_id": "b8bbf341e230198caafe54727e13f2db27b7200d6fd95684fc5cf748db1a0e88", - "dst_ref": "RecordingTransport.write_context", - "resolution": "resolved", - "slice_id": "1372a2241c7265705e5cf9dceeb5e59836fac1d679227c4279ed39e0798ddddf", - "root_symbol_id": "ede183f1c546725064e28ddab1ffdbae0d1a1258fd62a50eb556c10d10995415", - "path_symbols": [ - "test_trace_service_supports_debug_warning_and_error_levels", - "RecordingTransport", - "RecordingTransport.__init__", - "RecordingTransport.contexts", - "RecordingTransport.write_context" - ], - "path_symbol_ids": [ - "ede183f1c546725064e28ddab1ffdbae0d1a1258fd62a50eb556c10d10995415", - "e3d635de1f1880673b69bf73ca6a45caffa5c7fdc23d589d5e40f76b86bdcd33", - "e34d80da723a7115a7a7586b52dc8b5cfda05c581509eee0c1a0296df9a340cb", - "b8bbf341e230198caafe54727e13f2db27b7200d6fd95684fc5cf748db1a0e88" - ], - "path_edge_types": [ - "instantiates", - "writes_attr", - "reads_attr" - ], - "path_length": 5, - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_runtime.py", - "content": "test_trace_service_supports_debug_warning_and_error_levels\n -> RecordingTransport\n -> RecordingTransport.__init__\n -> RecordingTransport.contexts\n -> test_trace_service_writes_contexts_and_messages", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_trace_service_supports_debug_warning_and_error_levels:dataflow_slice", - "span_start": 181, - "span_end": 265, - "lexical_rank": 4, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 5, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "8b6a5a738525df160600d71c15915704172de20db436ea2f84b6e039be396a2d", - "edge_type": "dataflow_slice", - "src_symbol_id": "ede183f1c546725064e28ddab1ffdbae0d1a1258fd62a50eb556c10d10995415", - "src_qname": "test_trace_service_supports_debug_warning_and_error_levels", - "dst_symbol_id": "1600da201da1d0150240b400e3232172354156decdd1a04e1ab1a1edcd3a7e99", - "dst_ref": "test_trace_service_writes_contexts_and_messages", - "resolution": "resolved", - "slice_id": "8b6a5a738525df160600d71c15915704172de20db436ea2f84b6e039be396a2d", - "root_symbol_id": "ede183f1c546725064e28ddab1ffdbae0d1a1258fd62a50eb556c10d10995415", - "path_symbols": [ - "test_trace_service_supports_debug_warning_and_error_levels", - "RecordingTransport", - "RecordingTransport.__init__", - "RecordingTransport.contexts", - "test_trace_service_writes_contexts_and_messages" - ], - "path_symbol_ids": [ - "ede183f1c546725064e28ddab1ffdbae0d1a1258fd62a50eb556c10d10995415", - "e3d635de1f1880673b69bf73ca6a45caffa5c7fdc23d589d5e40f76b86bdcd33", - "e34d80da723a7115a7a7586b52dc8b5cfda05c581509eee0c1a0296df9a340cb", - "1600da201da1d0150240b400e3232172354156decdd1a04e1ab1a1edcd3a7e99" - ], - "path_edge_types": [ - "instantiates", - "writes_attr", - "reads_attr" - ], - "path_length": 5, - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_runtime.py", - "content": "test_trace_service_supports_debug_warning_and_error_levels\n -> RecordingTransport\n -> RecordingTransport.__init__\n -> RecordingTransport.contexts\n -> test_trace_service_allows_messages_without_status", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_trace_service_supports_debug_warning_and_error_levels:dataflow_slice", - "span_start": 181, - "span_end": 293, - "lexical_rank": 4, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 5, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "f7d099f6d5746aa61a3025fd7eef791369bd3a3e5df4bc716de87e7b149ccde6", - "edge_type": "dataflow_slice", - "src_symbol_id": "ede183f1c546725064e28ddab1ffdbae0d1a1258fd62a50eb556c10d10995415", - "src_qname": "test_trace_service_supports_debug_warning_and_error_levels", - "dst_symbol_id": "7127ca85ce6447928e195e901d36f1e1f1e8205a686e567c2d1b187431f989df", - "dst_ref": "test_trace_service_allows_messages_without_status", - "resolution": "resolved", - "slice_id": "f7d099f6d5746aa61a3025fd7eef791369bd3a3e5df4bc716de87e7b149ccde6", - "root_symbol_id": "ede183f1c546725064e28ddab1ffdbae0d1a1258fd62a50eb556c10d10995415", - "path_symbols": [ - "test_trace_service_supports_debug_warning_and_error_levels", - "RecordingTransport", - "RecordingTransport.__init__", - "RecordingTransport.contexts", - "test_trace_service_allows_messages_without_status" - ], - "path_symbol_ids": [ - "ede183f1c546725064e28ddab1ffdbae0d1a1258fd62a50eb556c10d10995415", - "e3d635de1f1880673b69bf73ca6a45caffa5c7fdc23d589d5e40f76b86bdcd33", - "e34d80da723a7115a7a7586b52dc8b5cfda05c581509eee0c1a0296df9a340cb", - "7127ca85ce6447928e195e901d36f1e1f1e8205a686e567c2d1b187431f989df" - ], - "path_edge_types": [ - "instantiates", - "writes_attr", - "reads_attr" - ], - "path_length": 5, - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_runtime.py", - "content": "def test_trace_service_writes_contexts_and_messages() -> None:\n from app_runtime.tracing.service import TraceService\n\n transport = RecordingTransport()\n manager = TraceService(transport=transport)\n\n with manager.open_context(alias=\"worker\", kind=\"worker\", attrs={\"routine\": \"incoming\"}):\n manager.step(\"parse\")\n manager.info(\"started\", status=\"ok\", attrs={\"attempt\": 1})\n\n assert len(transport.contexts) == 1\n assert len(transport.messages) == 1\n assert transport.contexts[0].alias == \"worker\"\n assert transport.messages[0].step == \"parse\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_runtime.py:test_trace_service_writes_contexts_and_messages", - "span_start": 246, - "span_end": 259, - "lexical_rank": 6, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 9, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_runtime", - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_runtime.py", - "content": "def test_trace_service_supports_debug_warning_and_error_levels() -> None:\n from app_runtime.tracing.service import TraceService\n\n transport = RecordingTransport()\n manager = TraceService(transport=transport)\n\n with manager.open_context(alias=\"worker\", kind=\"worker\", attrs={\"routine\": \"incoming\"}):\n manager.step(\"validate\")\n manager.debug(\"validation details\", attrs={\"rule\": \"basic\"})\n manager.warning(\"validation warning\", status=\"degraded\", attrs={\"attempt\": 1})\n manager.error(\"integration failed\", status=\"failed\", attrs={\"integration\": \"crm\"})\n manager.exception(\"caught exception\", attrs={\"exception_type\": \"RuntimeError\"})\n\n levels = [message.level for message in transport.messages]\n assert levels == [\"DEBUG\", \"WARNING\", \"ERROR\", \"ERROR\"]", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_runtime.py:test_trace_service_supports_debug_warning_and_error_levels", - "span_start": 262, - "span_end": 276, - "lexical_rank": 6, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 10, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_runtime", - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_runtime.py", - "content": "def test_trace_service_allows_messages_without_status() -> None:\n from app_runtime.tracing.service import TraceService\n\n transport = RecordingTransport()\n manager = TraceService(transport=transport)\n\n with manager.open_context(alias=\"worker\", kind=\"worker\"):\n manager.step(\"optional-status\")\n manager.debug(\"debug without status\")\n manager.info(\"info without status\")\n manager.warning(\"warning without status\")\n manager.error(\"error without status\")\n\n assert [message.status for message in transport.messages] == [\"\", \"\", \"\", \"\"]\n assert all(message.trace_id == transport.contexts[0].trace_id for message in transport.messages)", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_runtime.py:test_trace_service_allows_messages_without_status", - "span_start": 279, - "span_end": 293, - "lexical_rank": 6, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 11, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_runtime", - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "class ScenarioWorker(Worker):\n def __init__(self, name: str, routine: object, *, interval: float = 0.05) -> None:\n self._name = name\n self._routine = routine\n self._interval = interval\n self._thread: Thread | None = None\n self._stop_requested = Event()\n self._in_flight = 0\n self._runs = 0\n self._lock = Lock()\n\n @property\n def name(self) -> str:\n return self._name\n\n @property\n def critical(self) -> bool:\n return True\n\n def start(self) -> None:\n if self._thread is not None and self._thread.is_alive():\n return\n self._stop_requested.clear()\n self._thread = Thread(target=self._loop, name=f\"{self._name}-thread\", daemon=True)\n self._thread.start()\n\n def stop(self, force: bool = False) -> None:\n self._stop_requested.set()\n\n def health(self) -> WorkerHealth:\n return WorkerHealth(name=self.name, status=\"ok\", critical=True, meta={\"runs\": self._runs})\n\n def status(self) -> WorkerStatus:\n thread_alive = self._thread is not None and self._thread.is_alive()\n with self._lock:\n in_flight = self._in_flight\n runs = self._runs\n if not thread_alive:\n state = \"stopped\"\n elif self._stop_requested.is_set():\n state = \"stopping\"\n elif in_flight > 0:\n state = \"busy\"\n else:\n state = \"idle\"\n return WorkerStatus(name=self.name, state=state, in_flight=in_flight, meta={\"runs\": runs})\n\n def _loop(self) -> None:\n while not self._stop_requested.is_set():\n with self._lock:\n self._in_flight += 1\n try:\n self._routine.run()\n with self._lock:\n self._runs += 1\n finally:\n with self._lock:\n self._in_flight -= 1\n if self._stop_requested.is_set():\n return\n sleep(self._interval)", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:ScenarioWorker", - "span_start": 50, - "span_end": 110, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 2, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "class IntervalRoutine:\n calls: list[float] = field(default_factory=list)\n _lock: Lock = field(default_factory=Lock)\n\n def run(self) -> None:\n with self._lock:\n self.calls.append(monotonic())\n\n def wait_runs(self, count: int, timeout: float) -> bool:\n deadline = monotonic() + timeout\n while monotonic() < deadline:\n with self._lock:\n if len(self.calls) >= count:\n return True\n sleep(0.01)\n return False\n\n def deltas(self) -> list[float]:\n with self._lock:\n return [self.calls[index + 1] - self.calls[index] for index in range(len(self.calls) - 1)]", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:IntervalRoutine", - "span_start": 18, - "span_end": 37, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "class BlockingRoutine:\n def __init__(self, started: Event, release: Event) -> None:\n self._started = started\n self._release = release\n\n def run(self) -> None:\n self._started.set()\n self._release.wait(timeout=5.0)", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:BlockingRoutine", - "span_start": 40, - "span_end": 47, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 1, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "def test_worker_wakes_up_with_configured_interval() -> None:\n interval = 0.15\n routine = IntervalRoutine()\n worker = ScenarioWorker(\"interval-worker\", routine, interval=interval)\n runtime = RuntimeManager()\n runtime.register_module(WorkerModule(worker))\n\n runtime.start()\n try:\n assert routine.wait_runs(count=3, timeout=2.0) is True\n finally:\n runtime.stop()\n\n deltas = routine.deltas()\n assert len(deltas) >= 2\n assert all(delta >= interval * 0.7 for delta in deltas[:2])", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:test_worker_wakes_up_with_configured_interval", - "span_start": 163, - "span_end": 178, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 7, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "def _http_call_json(\n base_url: str,\n path: str,\n *,\n method: str = \"GET\",\n headers: dict[str, str] | None = None,\n) -> tuple[int, dict[str, object]]:\n request = Request(f\"{base_url}{path}\", method=method, headers=headers or {})\n try:\n with urlopen(request, timeout=15.0) as response:\n status = response.status\n body = response.read()\n except HTTPError as error:\n status = error.code\n body = error.read()\n payload = json.loads(body.decode(\"utf-8\"))\n return status, payload", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:_http_call_json", - "span_start": 125, - "span_end": 141, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 4, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "def _build_runtime(worker: Worker, *, control_timeout: int = 1) -> tuple[RuntimeManager, str]:\n runtime = RuntimeManager()\n channel = HttpControlChannel(host=\"127.0.0.1\", port=0, timeout=control_timeout)\n runtime.control_plane.register_channel(channel)\n runtime.register_module(WorkerModule(worker))\n runtime.start()\n return runtime, f\"http://127.0.0.1:{channel.port}\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:_build_runtime", - "span_start": 154, - "span_end": 160, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 6, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "class WorkerModule(ApplicationModule):\n def __init__(self, worker: Worker) -> None:\n self._worker = worker\n\n @property\n def name(self) -> str:\n return \"business-tests\"\n\n def register(self, registry: ModuleRegistry) -> None:\n registry.add_worker(self._worker)", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:WorkerModule", - "span_start": 113, - "span_end": 122, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 3, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ] - }, - "diagnostics": { - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C0_SOURCE_CHUNKS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C0_SOURCE_CHUNKS": 10 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [], - "include_globs": [ - "src", - "tests" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests" - ] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src", - "tests" - ], - "include_globs": [ - "src", - "tests" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests" - ] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src", - "tests" - ], - "include_globs": [ - "src", - "tests" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests" - ] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "TraceService", - "path_scope": [], - "include_globs": [ - "src/**", - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "Где тесты для TraceService? test_trace_service TestTraceService TraceService", - "path_scope": [], - "include_globs": [ - "src/**", - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "top_k": 6, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Где тесты для TraceService? test_trace_service TestTraceService TraceService", - "path_scope": [], - "include_globs": [ - "src/**", - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "top_k": 10, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [], - "normalized_include_globs": [ - "src", - "tests" - ], - "normalized_exclude_globs": [], - "normalized_prefer_globs": [ - "tests" - ], - "filter_stage": "post_rank", - "candidates_before_filter": 0, - "candidates_after_filter": 0 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src", - "tests" - ], - "normalized_include_globs": [ - "src", - "tests" - ], - "normalized_exclude_globs": [], - "normalized_prefer_globs": [ - "tests" - ], - "filter_stage": "post_rank", - "candidates_before_filter": 6, - "candidates_after_filter": 6 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src", - "tests" - ], - "normalized_include_globs": [ - "src", - "tests" - ], - "normalized_exclude_globs": [], - "normalized_prefer_globs": [ - "tests" - ], - "filter_stage": "post_rank", - "candidates_before_filter": 10, - "candidates_after_filter": 10 - } - ], - "fallback": { - "used": true, - "reason": "scope_relaxed_no_hits" - }, - "symbol_resolution": { - "status": "not_found", - "resolved_symbol": null, - "alternatives": [ - "TraceService" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "miss", - "hit_count": 0, - "fail_reason": "scope_relaxed_no_hits" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 6, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 10, - "fail_reason": null - } - ] - }, - "constraint_violations": [ - { - "type": "LAYER_MISSING", - "severity": "warn", - "details": { - "layer": "C1_SYMBOL_CATALOG", - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ] - }, - "suggested_fix": "Increase top_k for this layer or relax constraints for retrieval." - } - ], - "timings_ms": { - "symbol_resolution": 0, - "retrieval_total": 96, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 44, - "C2_DEPENDENCY_GRAPH": 39, - "C0_SOURCE_CHUNKS": 13 - }, - "merge_rank": 0 - } - } - }, - { - "step": "llm_answer", - "input": { - "query": "Где тесты для TraceService?", - "rag_count": 16 - }, - "output": { - "llm_answer": "1. Прямые тесты:\n - tests/test_runtime.py | test_trace_service_writes_contexts_and_messages\n - Проверка записи контекстов и сообщений в TraceService.\n - tests/test_runtime.py | test_trace_service_supports_debug_warning_and_error_levels\n - Проверка поддержки различных уровней логирования (debug, warning, error).\n\n2. Косвенные или ближайшие тесты:\n - Нет явных связей с другими тестами через зависимости или имена, однако тесты касаются работы с Transport и записью контекста/сообщений, что близко к функционалу TraceService.\n\n3. Что именно проверяется:\n - Запись и корректность данных контекстов и сообщений в TraceService.\n - Поддержка различных уровней логирования и запись соответствующих сообщений.\n\n4. Пробелы покрытия:\n - Не найдены явные пробелы покрытия для TraceService напрямую. Однако могут быть аспекты поведения, которые не охвачены текущими тестами, например, обработка ошибок, особые случаи или взаимодействие с внешними компонентами, зависящими от окружения." - }, - "diagnostics": { - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 978, - "evidence_rows": 16, - "evidence_chars": 7847 - }, - "evidence_summary": [ - { - "layer": "C2_DEPENDENCY_GRAPH", - "count": 6, - "unique_paths": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 10, - "unique_paths": 2 - } - ], - "prompt_template_id": "intent_code_qa_find_tests_ru_v2", - "system_prompt_version": "v1" - }, - "timings_ms": { - "prompt_build": 0, - "llm_call": 1736 - } - } - } - ] - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_125536/full_chain_plba_code_subintents_v2_plba-v2-find-tests-trace-service.md b/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_125536/full_chain_plba_code_subintents_v2_plba-v2-find-tests-trace-service.md deleted file mode 100644 index 1942c8d..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_125536/full_chain_plba_code_subintents_v2_plba-v2-find-tests-trace-service.md +++ /dev/null @@ -1,32 +0,0 @@ -# plba-v2-find-tests-trace-service - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_subintents_v2.yaml -- runner: runtime -- mode: full_chain -- passed: True - -## Query -Где тесты для TraceService? - -## Actual -{ - "intent": "CODE_QA", - "sub_intent": "FIND_TESTS", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 16, - "llm_answer": "1. Прямые тесты:\n - tests/test_runtime.py | test_trace_service_writes_contexts_and_messages\n - Проверка записи контекстов и сообщений в TraceService.\n - tests/test_runtime.py | test_trace_service_supports_debug_warning_and_error_levels\n - Проверка поддержки различных уровней логирования (debug, warning, error).\n\n2. Косвенные или ближайшие тесты:\n - Нет явных связей с другими тестами через зависимости или имена, однако тесты касаются работы с Transport и записью контекста/сообщений, что близко к функционалу TraceService.\n\n3. Что именно проверяется:\n - Запись и корректность данных контекстов и сообщений в TraceService.\n - Поддержка различных уровней логирования и запись соответствующих сообщений.\n\n4. Пробелы покрытия:\n - Не найдены явные пробелы покрытия для TraceService напрямую. Однако могут быть аспекты поведения, которые не охвачены текущими тестами, например, обработка ошибок, особые случаи или взаимодействие с внешними компонентами, зависящими от окружения.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "TraceService" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ] -} - -## Mismatches -- none \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_125536/full_chain_plba_code_subintents_v2_plba-v2-find-tests-workflow-runtime-factory-negative.json b/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_125536/full_chain_plba_code_subintents_v2_plba-v2-find-tests-workflow-runtime-factory-negative.json deleted file mode 100644 index d7463e9..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_125536/full_chain_plba_code_subintents_v2_plba-v2-find-tests-workflow-runtime-factory-negative.json +++ /dev/null @@ -1,2049 +0,0 @@ -{ - "case_id": "plba-v2-find-tests-workflow-runtime-factory-negative", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_subintents_v2.yaml", - "runner": "runtime", - "mode": "full_chain", - "actual": { - "intent": "CODE_QA", - "sub_intent": "FIND_TESTS", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 16, - "llm_answer": "Прямых тестов для WorkflowRuntimeFactory в предоставленном контексте не обнаружено.\n\nКосвенные или ближайшие тесты:\n1. tests/test_business_control_actions.py | test_actions_stop_busy_worker_before_timeout:dataflow_slice\n - Проверяет поведение `BlockingRoutine` и его метод `_release`.\n2. tests/test_business_control_actions.py | test_actions_stop_busy_worker_after_timeout:dataflow_slice\n - Проверяет поведение `BlockingRoutine` и его метод `_started`.\n\nЧто именно проверяется:\n- Поведение и методы класса `BlockingRoutine`, такие как инициализация, запуск и освобождение (test_actions_stop_busy_worker_before_timeout).\n- Поведение и методы класса `ScenarioWorker`, такие как получение имени (test_worker_wakes_up_with_configured_interval).\n\nКакие пробелы покрытия видны:\n- Нет явных тестов конкретно для `WorkflowRuntimeFactory`. \n- Покрытие ограничено ближайшими классами и методами, связанными с рабочим процессом и управлением сценариями работы.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "WorkflowRuntimeFactory" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ] - }, - "passed": false, - "mismatches": [ - "retrieval: expected empty rag, got 16 rows" - ], - "details": { - "case_id": "plba-v2-find-tests-workflow-runtime-factory-negative", - "text": "Где тесты для WorkflowRuntimeFactory?", - "mode": "full_chain", - "run_started_at": "2026-03-12T12:55:37", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Где тесты для WorkflowRuntimeFactory?", - "symbol_resolution": { - "status": "not_found", - "resolved_symbol": null, - "alternatives": [ - "WorkflowRuntimeFactory" - ], - "confidence": 0.0 - }, - "rag_count": 16, - "rag_rows": [ - { - "path": "tests/test_business_control_actions.py", - "content": "test_actions_stop_busy_worker_before_timeout\n -> BlockingRoutine\n -> BlockingRoutine.__init__\n -> BlockingRoutine._release\n -> BlockingRoutine.run", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_actions_stop_busy_worker_before_timeout:dataflow_slice", - "span_start": 43, - "span_end": 212, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 5, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "8bd726155ba387d3579763ee84dfd2f9a90bc917da88f3b2e89416ab5c1254d6", - "edge_type": "dataflow_slice", - "src_symbol_id": "a0bb116ca9d909c93a285667ae033fbd1859b2dad7cf34fcb44816393ef6909c", - "src_qname": "test_actions_stop_busy_worker_before_timeout", - "dst_symbol_id": "d9841bdbb69706c988ae7ae6adf89928dc4fae45943f74064f5382177034ba04", - "dst_ref": "BlockingRoutine.run", - "resolution": "resolved", - "slice_id": "8bd726155ba387d3579763ee84dfd2f9a90bc917da88f3b2e89416ab5c1254d6", - "root_symbol_id": "a0bb116ca9d909c93a285667ae033fbd1859b2dad7cf34fcb44816393ef6909c", - "path_symbols": [ - "test_actions_stop_busy_worker_before_timeout", - "BlockingRoutine", - "BlockingRoutine.__init__", - "BlockingRoutine._release", - "BlockingRoutine.run" - ], - "path_symbol_ids": [ - "a0bb116ca9d909c93a285667ae033fbd1859b2dad7cf34fcb44816393ef6909c", - "a3349c5bc65e4003a4bbd6a8dbb7a54c337e12d1aed930caa701b12e520f1e67", - "486deeed3043c6db985aef258e96ddc67aa53608e67a83962fbd2471f649ddf1", - "d9841bdbb69706c988ae7ae6adf89928dc4fae45943f74064f5382177034ba04" - ], - "path_edge_types": [ - "instantiates", - "writes_attr", - "reads_attr" - ], - "path_length": 5, - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "test_worker_wakes_up_with_configured_interval\n -> ScenarioWorker\n -> ScenarioWorker.__init__\n -> ScenarioWorker._name\n -> ScenarioWorker.name", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_worker_wakes_up_with_configured_interval:dataflow_slice", - "span_start": 52, - "span_end": 166, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 5, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "2fd137f5852febe907f44d3b3e4ea430f89ccfe962ae1442a16ab9df64c8f76c", - "edge_type": "dataflow_slice", - "src_symbol_id": "65f877f78191d65e6a752e41cedc70ebc784c266804a55c1c56440336e1f0d6e", - "src_qname": "test_worker_wakes_up_with_configured_interval", - "dst_symbol_id": "da022da2c49fd9cfd09d6e6da6bbd59aaa7d28efd669ce8444e88d327ddec2fc", - "dst_ref": "ScenarioWorker.name", - "resolution": "resolved", - "slice_id": "2fd137f5852febe907f44d3b3e4ea430f89ccfe962ae1442a16ab9df64c8f76c", - "root_symbol_id": "65f877f78191d65e6a752e41cedc70ebc784c266804a55c1c56440336e1f0d6e", - "path_symbols": [ - "test_worker_wakes_up_with_configured_interval", - "ScenarioWorker", - "ScenarioWorker.__init__", - "ScenarioWorker._name", - "ScenarioWorker.name" - ], - "path_symbol_ids": [ - "65f877f78191d65e6a752e41cedc70ebc784c266804a55c1c56440336e1f0d6e", - "9a1d08a7eb1831c9f2e0db361b5207f036e477c160773ae08c0b287239785c52", - "9c20be046ba06644d1432e0f20eb223663d2b116ee7d91fdc62bc68323f2e593", - "da022da2c49fd9cfd09d6e6da6bbd59aaa7d28efd669ce8444e88d327ddec2fc" - ], - "path_edge_types": [ - "instantiates", - "writes_attr", - "reads_attr" - ], - "path_length": 5, - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "test_actions_stop_busy_worker_before_timeout\n -> BlockingRoutine\n -> BlockingRoutine.__init__\n -> BlockingRoutine._started\n -> BlockingRoutine.run", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_actions_stop_busy_worker_before_timeout:dataflow_slice", - "span_start": 42, - "span_end": 212, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 5, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "f9bcce108870e49afa8b32d4625115a10707a3b0e7473179e958e5752bf258b4", - "edge_type": "dataflow_slice", - "src_symbol_id": "a0bb116ca9d909c93a285667ae033fbd1859b2dad7cf34fcb44816393ef6909c", - "src_qname": "test_actions_stop_busy_worker_before_timeout", - "dst_symbol_id": "d9841bdbb69706c988ae7ae6adf89928dc4fae45943f74064f5382177034ba04", - "dst_ref": "BlockingRoutine.run", - "resolution": "resolved", - "slice_id": "f9bcce108870e49afa8b32d4625115a10707a3b0e7473179e958e5752bf258b4", - "root_symbol_id": "a0bb116ca9d909c93a285667ae033fbd1859b2dad7cf34fcb44816393ef6909c", - "path_symbols": [ - "test_actions_stop_busy_worker_before_timeout", - "BlockingRoutine", - "BlockingRoutine.__init__", - "BlockingRoutine._started", - "BlockingRoutine.run" - ], - "path_symbol_ids": [ - "a0bb116ca9d909c93a285667ae033fbd1859b2dad7cf34fcb44816393ef6909c", - "a3349c5bc65e4003a4bbd6a8dbb7a54c337e12d1aed930caa701b12e520f1e67", - "486deeed3043c6db985aef258e96ddc67aa53608e67a83962fbd2471f649ddf1", - "d9841bdbb69706c988ae7ae6adf89928dc4fae45943f74064f5382177034ba04" - ], - "path_edge_types": [ - "instantiates", - "writes_attr", - "reads_attr" - ], - "path_length": 5, - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "test_actions_stop_busy_worker_after_timeout\n -> BlockingRoutine\n -> BlockingRoutine.__init__\n -> BlockingRoutine._started\n -> BlockingRoutine.run", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_actions_stop_busy_worker_after_timeout:dataflow_slice", - "span_start": 42, - "span_end": 238, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 5, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "8e7db3d2a9226f1c1d9942ac6373cfcafa0d2276758ddb8a3d3c455a3d58024d", - "edge_type": "dataflow_slice", - "src_symbol_id": "66392d3222421d9ba16eda3554940b16e7d5a6f33aa08c5738d35af2e32f1e4a", - "src_qname": "test_actions_stop_busy_worker_after_timeout", - "dst_symbol_id": "d9841bdbb69706c988ae7ae6adf89928dc4fae45943f74064f5382177034ba04", - "dst_ref": "BlockingRoutine.run", - "resolution": "resolved", - "slice_id": "8e7db3d2a9226f1c1d9942ac6373cfcafa0d2276758ddb8a3d3c455a3d58024d", - "root_symbol_id": "66392d3222421d9ba16eda3554940b16e7d5a6f33aa08c5738d35af2e32f1e4a", - "path_symbols": [ - "test_actions_stop_busy_worker_after_timeout", - "BlockingRoutine", - "BlockingRoutine.__init__", - "BlockingRoutine._started", - "BlockingRoutine.run" - ], - "path_symbol_ids": [ - "66392d3222421d9ba16eda3554940b16e7d5a6f33aa08c5738d35af2e32f1e4a", - "a3349c5bc65e4003a4bbd6a8dbb7a54c337e12d1aed930caa701b12e520f1e67", - "486deeed3043c6db985aef258e96ddc67aa53608e67a83962fbd2471f649ddf1", - "d9841bdbb69706c988ae7ae6adf89928dc4fae45943f74064f5382177034ba04" - ], - "path_edge_types": [ - "instantiates", - "writes_attr", - "reads_attr" - ], - "path_length": 5, - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "test_actions_stop_busy_worker_after_timeout\n -> BlockingRoutine\n -> BlockingRoutine.__init__\n -> BlockingRoutine._release\n -> BlockingRoutine.run", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_actions_stop_busy_worker_after_timeout:dataflow_slice", - "span_start": 43, - "span_end": 238, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 5, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "b59da9da82f9dfc8a9b695a08213786385da1ae9e17561ec3a0450a574a8cb39", - "edge_type": "dataflow_slice", - "src_symbol_id": "66392d3222421d9ba16eda3554940b16e7d5a6f33aa08c5738d35af2e32f1e4a", - "src_qname": "test_actions_stop_busy_worker_after_timeout", - "dst_symbol_id": "d9841bdbb69706c988ae7ae6adf89928dc4fae45943f74064f5382177034ba04", - "dst_ref": "BlockingRoutine.run", - "resolution": "resolved", - "slice_id": "b59da9da82f9dfc8a9b695a08213786385da1ae9e17561ec3a0450a574a8cb39", - "root_symbol_id": "66392d3222421d9ba16eda3554940b16e7d5a6f33aa08c5738d35af2e32f1e4a", - "path_symbols": [ - "test_actions_stop_busy_worker_after_timeout", - "BlockingRoutine", - "BlockingRoutine.__init__", - "BlockingRoutine._release", - "BlockingRoutine.run" - ], - "path_symbol_ids": [ - "66392d3222421d9ba16eda3554940b16e7d5a6f33aa08c5738d35af2e32f1e4a", - "a3349c5bc65e4003a4bbd6a8dbb7a54c337e12d1aed930caa701b12e520f1e67", - "486deeed3043c6db985aef258e96ddc67aa53608e67a83962fbd2471f649ddf1", - "d9841bdbb69706c988ae7ae6adf89928dc4fae45943f74064f5382177034ba04" - ], - "path_edge_types": [ - "instantiates", - "writes_attr", - "reads_attr" - ], - "path_length": 5, - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "test_actions_start_stop_and_health_when_worker_is_idle\n -> ScenarioWorker\n -> ScenarioWorker.__init__\n -> ScenarioWorker._name\n -> ScenarioWorker.name", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_actions_start_stop_and_health_when_worker_is_idle:dataflow_slice", - "span_start": 52, - "span_end": 182, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 5, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "8fb3c9e775ad1cfa91eebb8b8cef367dc53c923584236122235446e0579b468e", - "edge_type": "dataflow_slice", - "src_symbol_id": "09a78d8eb31c2da14fee58da53b5da7a5065a4c23b6300748a6d44517a5284b8", - "src_qname": "test_actions_start_stop_and_health_when_worker_is_idle", - "dst_symbol_id": "da022da2c49fd9cfd09d6e6da6bbd59aaa7d28efd669ce8444e88d327ddec2fc", - "dst_ref": "ScenarioWorker.name", - "resolution": "resolved", - "slice_id": "8fb3c9e775ad1cfa91eebb8b8cef367dc53c923584236122235446e0579b468e", - "root_symbol_id": "09a78d8eb31c2da14fee58da53b5da7a5065a4c23b6300748a6d44517a5284b8", - "path_symbols": [ - "test_actions_start_stop_and_health_when_worker_is_idle", - "ScenarioWorker", - "ScenarioWorker.__init__", - "ScenarioWorker._name", - "ScenarioWorker.name" - ], - "path_symbol_ids": [ - "09a78d8eb31c2da14fee58da53b5da7a5065a4c23b6300748a6d44517a5284b8", - "9a1d08a7eb1831c9f2e0db361b5207f036e477c160773ae08c0b287239785c52", - "9c20be046ba06644d1432e0f20eb223663d2b116ee7d91fdc62bc68323f2e593", - "da022da2c49fd9cfd09d6e6da6bbd59aaa7d28efd669ce8444e88d327ddec2fc" - ], - "path_edge_types": [ - "instantiates", - "writes_attr", - "reads_attr" - ], - "path_length": 5, - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "def test_actions_start_stop_and_health_when_worker_is_idle() -> None:\n runtime, base_url = _build_runtime(ScenarioWorker(\"idle-worker\", IntervalRoutine(), interval=0.2))\n try:\n stop_status, stop_payload = _http_call_json(base_url, \"/actions/stop\", method=\"POST\")\n assert stop_status == 200\n assert isinstance(stop_payload.get(\"detail\"), dict)\n assert stop_payload[\"detail\"][\"timed_out\"] is False\n assert stop_payload[\"detail\"][\"state\"] == \"stopped\"\n\n health_stopped_status, health_stopped_payload = _http_call_json(base_url, \"/health\")\n assert health_stopped_status == 503\n assert health_stopped_payload[\"state\"] == \"stopped\"\n assert health_stopped_payload[\"status\"] == \"unhealthy\"\n\n start_status, start_payload = _http_call_json(base_url, \"/actions/start\", method=\"POST\")\n assert start_status == 200\n assert isinstance(start_payload.get(\"detail\"), dict)\n assert start_payload[\"detail\"][\"timed_out\"] is False\n assert start_payload[\"detail\"][\"state\"] in {\"idle\", \"busy\"}\n\n health_started_status, health_started_payload = _http_call_json(base_url, \"/health\")\n assert health_started_status == 200\n assert health_started_payload[\"status\"] == \"ok\"\n assert health_started_payload[\"state\"] in {\"idle\", \"busy\"}\n finally:\n runtime.stop()", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:test_actions_start_stop_and_health_when_worker_is_idle", - "span_start": 181, - "span_end": 206, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 8, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "def _poll_until_stopped(base_url: str, timeout: float = 2.0) -> bool:\n deadline = monotonic() + timeout\n while monotonic() < deadline:\n _, payload = _http_call_json(base_url, \"/actions/status\")\n if payload.get(\"detail\") == \"stopped\":\n return True\n sleep(0.05)\n return False", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:_poll_until_stopped", - "span_start": 144, - "span_end": 151, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 5, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "def test_worker_wakes_up_with_configured_interval() -> None:\n interval = 0.15\n routine = IntervalRoutine()\n worker = ScenarioWorker(\"interval-worker\", routine, interval=interval)\n runtime = RuntimeManager()\n runtime.register_module(WorkerModule(worker))\n\n runtime.start()\n try:\n assert routine.wait_runs(count=3, timeout=2.0) is True\n finally:\n runtime.stop()\n\n deltas = routine.deltas()\n assert len(deltas) >= 2\n assert all(delta >= interval * 0.7 for delta in deltas[:2])", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:test_worker_wakes_up_with_configured_interval", - "span_start": 163, - "span_end": 178, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 7, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "class BlockingRoutine:\n def __init__(self, started: Event, release: Event) -> None:\n self._started = started\n self._release = release\n\n def run(self) -> None:\n self._started.set()\n self._release.wait(timeout=5.0)", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:BlockingRoutine", - "span_start": 40, - "span_end": 47, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 1, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "class WorkerModule(ApplicationModule):\n def __init__(self, worker: Worker) -> None:\n self._worker = worker\n\n @property\n def name(self) -> str:\n return \"business-tests\"\n\n def register(self, registry: ModuleRegistry) -> None:\n registry.add_worker(self._worker)", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:WorkerModule", - "span_start": 113, - "span_end": 122, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 3, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "def _http_call_json(\n base_url: str,\n path: str,\n *,\n method: str = \"GET\",\n headers: dict[str, str] | None = None,\n) -> tuple[int, dict[str, object]]:\n request = Request(f\"{base_url}{path}\", method=method, headers=headers or {})\n try:\n with urlopen(request, timeout=15.0) as response:\n status = response.status\n body = response.read()\n except HTTPError as error:\n status = error.code\n body = error.read()\n payload = json.loads(body.decode(\"utf-8\"))\n return status, payload", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:_http_call_json", - "span_start": 125, - "span_end": 141, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 4, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "def _build_runtime(worker: Worker, *, control_timeout: int = 1) -> tuple[RuntimeManager, str]:\n runtime = RuntimeManager()\n channel = HttpControlChannel(host=\"127.0.0.1\", port=0, timeout=control_timeout)\n runtime.control_plane.register_channel(channel)\n runtime.register_module(WorkerModule(worker))\n runtime.start()\n return runtime, f\"http://127.0.0.1:{channel.port}\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:_build_runtime", - "span_start": 154, - "span_end": 160, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 6, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "class ScenarioWorker(Worker):\n def __init__(self, name: str, routine: object, *, interval: float = 0.05) -> None:\n self._name = name\n self._routine = routine\n self._interval = interval\n self._thread: Thread | None = None\n self._stop_requested = Event()\n self._in_flight = 0\n self._runs = 0\n self._lock = Lock()\n\n @property\n def name(self) -> str:\n return self._name\n\n @property\n def critical(self) -> bool:\n return True\n\n def start(self) -> None:\n if self._thread is not None and self._thread.is_alive():\n return\n self._stop_requested.clear()\n self._thread = Thread(target=self._loop, name=f\"{self._name}-thread\", daemon=True)\n self._thread.start()\n\n def stop(self, force: bool = False) -> None:\n self._stop_requested.set()\n\n def health(self) -> WorkerHealth:\n return WorkerHealth(name=self.name, status=\"ok\", critical=True, meta={\"runs\": self._runs})\n\n def status(self) -> WorkerStatus:\n thread_alive = self._thread is not None and self._thread.is_alive()\n with self._lock:\n in_flight = self._in_flight\n runs = self._runs\n if not thread_alive:\n state = \"stopped\"\n elif self._stop_requested.is_set():\n state = \"stopping\"\n elif in_flight > 0:\n state = \"busy\"\n else:\n state = \"idle\"\n return WorkerStatus(name=self.name, state=state, in_flight=in_flight, meta={\"runs\": runs})\n\n def _loop(self) -> None:\n while not self._stop_requested.is_set():\n with self._lock:\n self._in_flight += 1\n try:\n self._routine.run()\n with self._lock:\n self._runs += 1\n finally:\n with self._lock:\n self._in_flight -= 1\n if self._stop_requested.is_set():\n return\n sleep(self._interval)", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:ScenarioWorker", - "span_start": 50, - "span_end": 110, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 2, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "class IntervalRoutine:\n calls: list[float] = field(default_factory=list)\n _lock: Lock = field(default_factory=Lock)\n\n def run(self) -> None:\n with self._lock:\n self.calls.append(monotonic())\n\n def wait_runs(self, count: int, timeout: float) -> bool:\n deadline = monotonic() + timeout\n while monotonic() < deadline:\n with self._lock:\n if len(self.calls) >= count:\n return True\n sleep(0.01)\n return False\n\n def deltas(self) -> list[float]:\n with self._lock:\n return [self.calls[index + 1] - self.calls[index] for index in range(len(self.calls) - 1)]", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:IntervalRoutine", - "span_start": 18, - "span_end": 37, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "def test_actions_stop_busy_worker_before_timeout() -> None:\n started = Event()\n release = Event()\n runtime, base_url = _build_runtime(ScenarioWorker(\"busy-worker\", BlockingRoutine(started, release)))\n assert started.wait(timeout=1.0) is True\n\n def release_later() -> None:\n sleep(0.2)\n release.set()\n\n Thread(target=release_later, daemon=True).start()\n try:\n status, payload = _http_call_json(base_url, \"/actions/stop\", method=\"POST\")\n assert status == 200\n assert isinstance(payload.get(\"detail\"), dict)\n assert payload[\"detail\"][\"timed_out\"] is False\n assert payload[\"detail\"][\"state\"] == \"stopped\"\n\n health_status, health_payload = _http_call_json(base_url, \"/health\")\n assert health_status == 503\n assert health_payload[\"status\"] == \"unhealthy\"\n assert health_payload[\"state\"] == \"stopped\"\n finally:\n runtime.stop()", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:test_actions_stop_busy_worker_before_timeout", - "span_start": 209, - "span_end": 232, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 9, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "llm_answer": "Прямых тестов для WorkflowRuntimeFactory в предоставленном контексте не обнаружено.\n\nКосвенные или ближайшие тесты:\n1. tests/test_business_control_actions.py | test_actions_stop_busy_worker_before_timeout:dataflow_slice\n - Проверяет поведение `BlockingRoutine` и его метод `_release`.\n2. tests/test_business_control_actions.py | test_actions_stop_busy_worker_after_timeout:dataflow_slice\n - Проверяет поведение `BlockingRoutine` и его метод `_started`.\n\nЧто именно проверяется:\n- Поведение и методы класса `BlockingRoutine`, такие как инициализация, запуск и освобождение (test_actions_stop_busy_worker_before_timeout).\n- Поведение и методы класса `ScenarioWorker`, такие как получение имени (test_worker_wakes_up_with_configured_interval).\n\nКакие пробелы покрытия видны:\n- Нет явных тестов конкретно для `WorkflowRuntimeFactory`. \n- Покрытие ограничено ближайшими классами и методами, связанными с рабочим процессом и управлением сценариями работы.", - "summary": { - "router": { - "intent": "CODE_QA", - "sub_intent": "FIND_TESTS", - "confidence": null - }, - "retrieval": { - "profile": "code", - "layers_hit": [ - "C0_SOURCE_CHUNKS", - "C2_DEPENDENCY_GRAPH" - ], - "evidence_sufficient": true - }, - "llm": { - "answer_status": "answered", - "groundedness": "grounded" - } - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "FIND_TESTS", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "WorkflowRuntimeFactory" - ], - "keyword_hints": [ - "WorkflowRuntimeFactory" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**", - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "test_file_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "test_symbol_patterns": [ - "test_workflow_runtime_factory", - "TestWorkflowRuntimeFactory", - "WorkflowRuntimeFactory" - ], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C0_SOURCE_CHUNKS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C0_SOURCE_CHUNKS": 10 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [], - "include_globs": [ - "src", - "tests" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests" - ] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src", - "tests" - ], - "include_globs": [ - "src", - "tests" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests" - ] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src", - "tests" - ], - "include_globs": [ - "src", - "tests" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests" - ] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "WorkflowRuntimeFactory", - "path_scope": [], - "include_globs": [ - "src/**", - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "Где тесты для WorkflowRuntimeFactory? test_workflow_runtime_factory TestWorkflowRuntimeFactory WorkflowRuntimeFactory", - "path_scope": [], - "include_globs": [ - "src/**", - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "top_k": 6, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Где тесты для WorkflowRuntimeFactory? test_workflow_runtime_factory TestWorkflowRuntimeFactory WorkflowRuntimeFactory", - "path_scope": [], - "include_globs": [ - "src/**", - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "top_k": 10, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [], - "normalized_include_globs": [ - "src", - "tests" - ], - "normalized_exclude_globs": [], - "normalized_prefer_globs": [ - "tests" - ], - "filter_stage": "post_rank", - "candidates_before_filter": 0, - "candidates_after_filter": 0 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src", - "tests" - ], - "normalized_include_globs": [ - "src", - "tests" - ], - "normalized_exclude_globs": [], - "normalized_prefer_globs": [ - "tests" - ], - "filter_stage": "post_rank", - "candidates_before_filter": 6, - "candidates_after_filter": 6 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src", - "tests" - ], - "normalized_include_globs": [ - "src", - "tests" - ], - "normalized_exclude_globs": [], - "normalized_prefer_globs": [ - "tests" - ], - "filter_stage": "post_rank", - "candidates_before_filter": 10, - "candidates_after_filter": 10 - } - ], - "fallback": { - "used": true, - "reason": "scope_relaxed_no_hits" - }, - "symbol_resolution": { - "status": "not_found", - "resolved_symbol": null, - "alternatives": [ - "WorkflowRuntimeFactory" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "miss", - "hit_count": 0, - "fail_reason": "scope_relaxed_no_hits" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 6, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 10, - "fail_reason": null - } - ] - }, - "constraint_violations": [ - { - "type": "LAYER_MISSING", - "severity": "warn", - "details": { - "layer": "C1_SYMBOL_CATALOG", - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ] - }, - "suggested_fix": "Increase top_k for this layer or relax constraints for retrieval." - } - ], - "timings_ms": { - "router": 0, - "symbol_resolution": 0, - "retrieval_total": 112, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 50, - "C2_DEPENDENCY_GRAPH": 48, - "C0_SOURCE_CHUNKS": 13 - }, - "merge_rank": 0, - "prompt_build": 0, - "llm_call": 1640 - }, - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 998, - "evidence_rows": 16, - "evidence_chars": 8149 - }, - "evidence_summary": [ - { - "layer": "C2_DEPENDENCY_GRAPH", - "count": 6, - "unique_paths": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 10, - "unique_paths": 1 - } - ], - "prompt_template_id": "intent_code_qa_find_tests_ru_v2", - "system_prompt_version": "v1" - }, - "router": { - "conversation_mode": "START", - "keyword_hints": [ - "WorkflowRuntimeFactory" - ], - "path_scope": [] - }, - "llm": { - "used_evidence_count": 16, - "missing_evidence_reason": null - } - }, - "run_info": { - "case_id": "plba-v2-find-tests-workflow-runtime-factory-negative", - "mode": "full_chain", - "run_started_at": "2026-03-12T12:55:37", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - }, - "input_request": { - "text": "Где тесты для WorkflowRuntimeFactory?", - "normalized_query": "Где тесты для WorkflowRuntimeFactory?" - }, - "steps": [ - { - "step": "intent_router", - "input": { - "query": "Где тесты для WorkflowRuntimeFactory?" - }, - "output": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Где тесты для WorkflowRuntimeFactory?" - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "FIND_TESTS", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "WorkflowRuntimeFactory" - ], - "keyword_hints": [ - "WorkflowRuntimeFactory" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**", - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "test_file_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "test_symbol_patterns": [ - "test_workflow_runtime_factory", - "TestWorkflowRuntimeFactory", - "WorkflowRuntimeFactory" - ], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "timings_ms": { - "router": 0 - } - } - }, - { - "step": "retrieval", - "input": { - "query": "Где тесты для WorkflowRuntimeFactory?" - }, - "output": { - "symbol_resolution": { - "status": "not_found", - "resolved_symbol": null, - "alternatives": [ - "WorkflowRuntimeFactory" - ], - "confidence": 0.0 - }, - "rag_count": 16, - "rag_rows": [ - { - "path": "tests/test_business_control_actions.py", - "content": "test_actions_stop_busy_worker_before_timeout\n -> BlockingRoutine\n -> BlockingRoutine.__init__\n -> BlockingRoutine._release\n -> BlockingRoutine.run", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_actions_stop_busy_worker_before_timeout:dataflow_slice", - "span_start": 43, - "span_end": 212, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 5, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "8bd726155ba387d3579763ee84dfd2f9a90bc917da88f3b2e89416ab5c1254d6", - "edge_type": "dataflow_slice", - "src_symbol_id": "a0bb116ca9d909c93a285667ae033fbd1859b2dad7cf34fcb44816393ef6909c", - "src_qname": "test_actions_stop_busy_worker_before_timeout", - "dst_symbol_id": "d9841bdbb69706c988ae7ae6adf89928dc4fae45943f74064f5382177034ba04", - "dst_ref": "BlockingRoutine.run", - "resolution": "resolved", - "slice_id": "8bd726155ba387d3579763ee84dfd2f9a90bc917da88f3b2e89416ab5c1254d6", - "root_symbol_id": "a0bb116ca9d909c93a285667ae033fbd1859b2dad7cf34fcb44816393ef6909c", - "path_symbols": [ - "test_actions_stop_busy_worker_before_timeout", - "BlockingRoutine", - "BlockingRoutine.__init__", - "BlockingRoutine._release", - "BlockingRoutine.run" - ], - "path_symbol_ids": [ - "a0bb116ca9d909c93a285667ae033fbd1859b2dad7cf34fcb44816393ef6909c", - "a3349c5bc65e4003a4bbd6a8dbb7a54c337e12d1aed930caa701b12e520f1e67", - "486deeed3043c6db985aef258e96ddc67aa53608e67a83962fbd2471f649ddf1", - "d9841bdbb69706c988ae7ae6adf89928dc4fae45943f74064f5382177034ba04" - ], - "path_edge_types": [ - "instantiates", - "writes_attr", - "reads_attr" - ], - "path_length": 5, - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "test_worker_wakes_up_with_configured_interval\n -> ScenarioWorker\n -> ScenarioWorker.__init__\n -> ScenarioWorker._name\n -> ScenarioWorker.name", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_worker_wakes_up_with_configured_interval:dataflow_slice", - "span_start": 52, - "span_end": 166, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 5, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "2fd137f5852febe907f44d3b3e4ea430f89ccfe962ae1442a16ab9df64c8f76c", - "edge_type": "dataflow_slice", - "src_symbol_id": "65f877f78191d65e6a752e41cedc70ebc784c266804a55c1c56440336e1f0d6e", - "src_qname": "test_worker_wakes_up_with_configured_interval", - "dst_symbol_id": "da022da2c49fd9cfd09d6e6da6bbd59aaa7d28efd669ce8444e88d327ddec2fc", - "dst_ref": "ScenarioWorker.name", - "resolution": "resolved", - "slice_id": "2fd137f5852febe907f44d3b3e4ea430f89ccfe962ae1442a16ab9df64c8f76c", - "root_symbol_id": "65f877f78191d65e6a752e41cedc70ebc784c266804a55c1c56440336e1f0d6e", - "path_symbols": [ - "test_worker_wakes_up_with_configured_interval", - "ScenarioWorker", - "ScenarioWorker.__init__", - "ScenarioWorker._name", - "ScenarioWorker.name" - ], - "path_symbol_ids": [ - "65f877f78191d65e6a752e41cedc70ebc784c266804a55c1c56440336e1f0d6e", - "9a1d08a7eb1831c9f2e0db361b5207f036e477c160773ae08c0b287239785c52", - "9c20be046ba06644d1432e0f20eb223663d2b116ee7d91fdc62bc68323f2e593", - "da022da2c49fd9cfd09d6e6da6bbd59aaa7d28efd669ce8444e88d327ddec2fc" - ], - "path_edge_types": [ - "instantiates", - "writes_attr", - "reads_attr" - ], - "path_length": 5, - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "test_actions_stop_busy_worker_before_timeout\n -> BlockingRoutine\n -> BlockingRoutine.__init__\n -> BlockingRoutine._started\n -> BlockingRoutine.run", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_actions_stop_busy_worker_before_timeout:dataflow_slice", - "span_start": 42, - "span_end": 212, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 5, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "f9bcce108870e49afa8b32d4625115a10707a3b0e7473179e958e5752bf258b4", - "edge_type": "dataflow_slice", - "src_symbol_id": "a0bb116ca9d909c93a285667ae033fbd1859b2dad7cf34fcb44816393ef6909c", - "src_qname": "test_actions_stop_busy_worker_before_timeout", - "dst_symbol_id": "d9841bdbb69706c988ae7ae6adf89928dc4fae45943f74064f5382177034ba04", - "dst_ref": "BlockingRoutine.run", - "resolution": "resolved", - "slice_id": "f9bcce108870e49afa8b32d4625115a10707a3b0e7473179e958e5752bf258b4", - "root_symbol_id": "a0bb116ca9d909c93a285667ae033fbd1859b2dad7cf34fcb44816393ef6909c", - "path_symbols": [ - "test_actions_stop_busy_worker_before_timeout", - "BlockingRoutine", - "BlockingRoutine.__init__", - "BlockingRoutine._started", - "BlockingRoutine.run" - ], - "path_symbol_ids": [ - "a0bb116ca9d909c93a285667ae033fbd1859b2dad7cf34fcb44816393ef6909c", - "a3349c5bc65e4003a4bbd6a8dbb7a54c337e12d1aed930caa701b12e520f1e67", - "486deeed3043c6db985aef258e96ddc67aa53608e67a83962fbd2471f649ddf1", - "d9841bdbb69706c988ae7ae6adf89928dc4fae45943f74064f5382177034ba04" - ], - "path_edge_types": [ - "instantiates", - "writes_attr", - "reads_attr" - ], - "path_length": 5, - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "test_actions_stop_busy_worker_after_timeout\n -> BlockingRoutine\n -> BlockingRoutine.__init__\n -> BlockingRoutine._started\n -> BlockingRoutine.run", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_actions_stop_busy_worker_after_timeout:dataflow_slice", - "span_start": 42, - "span_end": 238, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 5, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "8e7db3d2a9226f1c1d9942ac6373cfcafa0d2276758ddb8a3d3c455a3d58024d", - "edge_type": "dataflow_slice", - "src_symbol_id": "66392d3222421d9ba16eda3554940b16e7d5a6f33aa08c5738d35af2e32f1e4a", - "src_qname": "test_actions_stop_busy_worker_after_timeout", - "dst_symbol_id": "d9841bdbb69706c988ae7ae6adf89928dc4fae45943f74064f5382177034ba04", - "dst_ref": "BlockingRoutine.run", - "resolution": "resolved", - "slice_id": "8e7db3d2a9226f1c1d9942ac6373cfcafa0d2276758ddb8a3d3c455a3d58024d", - "root_symbol_id": "66392d3222421d9ba16eda3554940b16e7d5a6f33aa08c5738d35af2e32f1e4a", - "path_symbols": [ - "test_actions_stop_busy_worker_after_timeout", - "BlockingRoutine", - "BlockingRoutine.__init__", - "BlockingRoutine._started", - "BlockingRoutine.run" - ], - "path_symbol_ids": [ - "66392d3222421d9ba16eda3554940b16e7d5a6f33aa08c5738d35af2e32f1e4a", - "a3349c5bc65e4003a4bbd6a8dbb7a54c337e12d1aed930caa701b12e520f1e67", - "486deeed3043c6db985aef258e96ddc67aa53608e67a83962fbd2471f649ddf1", - "d9841bdbb69706c988ae7ae6adf89928dc4fae45943f74064f5382177034ba04" - ], - "path_edge_types": [ - "instantiates", - "writes_attr", - "reads_attr" - ], - "path_length": 5, - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "test_actions_stop_busy_worker_after_timeout\n -> BlockingRoutine\n -> BlockingRoutine.__init__\n -> BlockingRoutine._release\n -> BlockingRoutine.run", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_actions_stop_busy_worker_after_timeout:dataflow_slice", - "span_start": 43, - "span_end": 238, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 5, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "b59da9da82f9dfc8a9b695a08213786385da1ae9e17561ec3a0450a574a8cb39", - "edge_type": "dataflow_slice", - "src_symbol_id": "66392d3222421d9ba16eda3554940b16e7d5a6f33aa08c5738d35af2e32f1e4a", - "src_qname": "test_actions_stop_busy_worker_after_timeout", - "dst_symbol_id": "d9841bdbb69706c988ae7ae6adf89928dc4fae45943f74064f5382177034ba04", - "dst_ref": "BlockingRoutine.run", - "resolution": "resolved", - "slice_id": "b59da9da82f9dfc8a9b695a08213786385da1ae9e17561ec3a0450a574a8cb39", - "root_symbol_id": "66392d3222421d9ba16eda3554940b16e7d5a6f33aa08c5738d35af2e32f1e4a", - "path_symbols": [ - "test_actions_stop_busy_worker_after_timeout", - "BlockingRoutine", - "BlockingRoutine.__init__", - "BlockingRoutine._release", - "BlockingRoutine.run" - ], - "path_symbol_ids": [ - "66392d3222421d9ba16eda3554940b16e7d5a6f33aa08c5738d35af2e32f1e4a", - "a3349c5bc65e4003a4bbd6a8dbb7a54c337e12d1aed930caa701b12e520f1e67", - "486deeed3043c6db985aef258e96ddc67aa53608e67a83962fbd2471f649ddf1", - "d9841bdbb69706c988ae7ae6adf89928dc4fae45943f74064f5382177034ba04" - ], - "path_edge_types": [ - "instantiates", - "writes_attr", - "reads_attr" - ], - "path_length": 5, - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "test_actions_start_stop_and_health_when_worker_is_idle\n -> ScenarioWorker\n -> ScenarioWorker.__init__\n -> ScenarioWorker._name\n -> ScenarioWorker.name", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_actions_start_stop_and_health_when_worker_is_idle:dataflow_slice", - "span_start": 52, - "span_end": 182, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 5, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "8fb3c9e775ad1cfa91eebb8b8cef367dc53c923584236122235446e0579b468e", - "edge_type": "dataflow_slice", - "src_symbol_id": "09a78d8eb31c2da14fee58da53b5da7a5065a4c23b6300748a6d44517a5284b8", - "src_qname": "test_actions_start_stop_and_health_when_worker_is_idle", - "dst_symbol_id": "da022da2c49fd9cfd09d6e6da6bbd59aaa7d28efd669ce8444e88d327ddec2fc", - "dst_ref": "ScenarioWorker.name", - "resolution": "resolved", - "slice_id": "8fb3c9e775ad1cfa91eebb8b8cef367dc53c923584236122235446e0579b468e", - "root_symbol_id": "09a78d8eb31c2da14fee58da53b5da7a5065a4c23b6300748a6d44517a5284b8", - "path_symbols": [ - "test_actions_start_stop_and_health_when_worker_is_idle", - "ScenarioWorker", - "ScenarioWorker.__init__", - "ScenarioWorker._name", - "ScenarioWorker.name" - ], - "path_symbol_ids": [ - "09a78d8eb31c2da14fee58da53b5da7a5065a4c23b6300748a6d44517a5284b8", - "9a1d08a7eb1831c9f2e0db361b5207f036e477c160773ae08c0b287239785c52", - "9c20be046ba06644d1432e0f20eb223663d2b116ee7d91fdc62bc68323f2e593", - "da022da2c49fd9cfd09d6e6da6bbd59aaa7d28efd669ce8444e88d327ddec2fc" - ], - "path_edge_types": [ - "instantiates", - "writes_attr", - "reads_attr" - ], - "path_length": 5, - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "def test_actions_start_stop_and_health_when_worker_is_idle() -> None:\n runtime, base_url = _build_runtime(ScenarioWorker(\"idle-worker\", IntervalRoutine(), interval=0.2))\n try:\n stop_status, stop_payload = _http_call_json(base_url, \"/actions/stop\", method=\"POST\")\n assert stop_status == 200\n assert isinstance(stop_payload.get(\"detail\"), dict)\n assert stop_payload[\"detail\"][\"timed_out\"] is False\n assert stop_payload[\"detail\"][\"state\"] == \"stopped\"\n\n health_stopped_status, health_stopped_payload = _http_call_json(base_url, \"/health\")\n assert health_stopped_status == 503\n assert health_stopped_payload[\"state\"] == \"stopped\"\n assert health_stopped_payload[\"status\"] == \"unhealthy\"\n\n start_status, start_payload = _http_call_json(base_url, \"/actions/start\", method=\"POST\")\n assert start_status == 200\n assert isinstance(start_payload.get(\"detail\"), dict)\n assert start_payload[\"detail\"][\"timed_out\"] is False\n assert start_payload[\"detail\"][\"state\"] in {\"idle\", \"busy\"}\n\n health_started_status, health_started_payload = _http_call_json(base_url, \"/health\")\n assert health_started_status == 200\n assert health_started_payload[\"status\"] == \"ok\"\n assert health_started_payload[\"state\"] in {\"idle\", \"busy\"}\n finally:\n runtime.stop()", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:test_actions_start_stop_and_health_when_worker_is_idle", - "span_start": 181, - "span_end": 206, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 8, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "def _poll_until_stopped(base_url: str, timeout: float = 2.0) -> bool:\n deadline = monotonic() + timeout\n while monotonic() < deadline:\n _, payload = _http_call_json(base_url, \"/actions/status\")\n if payload.get(\"detail\") == \"stopped\":\n return True\n sleep(0.05)\n return False", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:_poll_until_stopped", - "span_start": 144, - "span_end": 151, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 5, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "def test_worker_wakes_up_with_configured_interval() -> None:\n interval = 0.15\n routine = IntervalRoutine()\n worker = ScenarioWorker(\"interval-worker\", routine, interval=interval)\n runtime = RuntimeManager()\n runtime.register_module(WorkerModule(worker))\n\n runtime.start()\n try:\n assert routine.wait_runs(count=3, timeout=2.0) is True\n finally:\n runtime.stop()\n\n deltas = routine.deltas()\n assert len(deltas) >= 2\n assert all(delta >= interval * 0.7 for delta in deltas[:2])", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:test_worker_wakes_up_with_configured_interval", - "span_start": 163, - "span_end": 178, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 7, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "class BlockingRoutine:\n def __init__(self, started: Event, release: Event) -> None:\n self._started = started\n self._release = release\n\n def run(self) -> None:\n self._started.set()\n self._release.wait(timeout=5.0)", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:BlockingRoutine", - "span_start": 40, - "span_end": 47, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 1, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "class WorkerModule(ApplicationModule):\n def __init__(self, worker: Worker) -> None:\n self._worker = worker\n\n @property\n def name(self) -> str:\n return \"business-tests\"\n\n def register(self, registry: ModuleRegistry) -> None:\n registry.add_worker(self._worker)", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:WorkerModule", - "span_start": 113, - "span_end": 122, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 3, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "def _http_call_json(\n base_url: str,\n path: str,\n *,\n method: str = \"GET\",\n headers: dict[str, str] | None = None,\n) -> tuple[int, dict[str, object]]:\n request = Request(f\"{base_url}{path}\", method=method, headers=headers or {})\n try:\n with urlopen(request, timeout=15.0) as response:\n status = response.status\n body = response.read()\n except HTTPError as error:\n status = error.code\n body = error.read()\n payload = json.loads(body.decode(\"utf-8\"))\n return status, payload", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:_http_call_json", - "span_start": 125, - "span_end": 141, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 4, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "def _build_runtime(worker: Worker, *, control_timeout: int = 1) -> tuple[RuntimeManager, str]:\n runtime = RuntimeManager()\n channel = HttpControlChannel(host=\"127.0.0.1\", port=0, timeout=control_timeout)\n runtime.control_plane.register_channel(channel)\n runtime.register_module(WorkerModule(worker))\n runtime.start()\n return runtime, f\"http://127.0.0.1:{channel.port}\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:_build_runtime", - "span_start": 154, - "span_end": 160, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 6, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "class ScenarioWorker(Worker):\n def __init__(self, name: str, routine: object, *, interval: float = 0.05) -> None:\n self._name = name\n self._routine = routine\n self._interval = interval\n self._thread: Thread | None = None\n self._stop_requested = Event()\n self._in_flight = 0\n self._runs = 0\n self._lock = Lock()\n\n @property\n def name(self) -> str:\n return self._name\n\n @property\n def critical(self) -> bool:\n return True\n\n def start(self) -> None:\n if self._thread is not None and self._thread.is_alive():\n return\n self._stop_requested.clear()\n self._thread = Thread(target=self._loop, name=f\"{self._name}-thread\", daemon=True)\n self._thread.start()\n\n def stop(self, force: bool = False) -> None:\n self._stop_requested.set()\n\n def health(self) -> WorkerHealth:\n return WorkerHealth(name=self.name, status=\"ok\", critical=True, meta={\"runs\": self._runs})\n\n def status(self) -> WorkerStatus:\n thread_alive = self._thread is not None and self._thread.is_alive()\n with self._lock:\n in_flight = self._in_flight\n runs = self._runs\n if not thread_alive:\n state = \"stopped\"\n elif self._stop_requested.is_set():\n state = \"stopping\"\n elif in_flight > 0:\n state = \"busy\"\n else:\n state = \"idle\"\n return WorkerStatus(name=self.name, state=state, in_flight=in_flight, meta={\"runs\": runs})\n\n def _loop(self) -> None:\n while not self._stop_requested.is_set():\n with self._lock:\n self._in_flight += 1\n try:\n self._routine.run()\n with self._lock:\n self._runs += 1\n finally:\n with self._lock:\n self._in_flight -= 1\n if self._stop_requested.is_set():\n return\n sleep(self._interval)", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:ScenarioWorker", - "span_start": 50, - "span_end": 110, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 2, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "class IntervalRoutine:\n calls: list[float] = field(default_factory=list)\n _lock: Lock = field(default_factory=Lock)\n\n def run(self) -> None:\n with self._lock:\n self.calls.append(monotonic())\n\n def wait_runs(self, count: int, timeout: float) -> bool:\n deadline = monotonic() + timeout\n while monotonic() < deadline:\n with self._lock:\n if len(self.calls) >= count:\n return True\n sleep(0.01)\n return False\n\n def deltas(self) -> list[float]:\n with self._lock:\n return [self.calls[index + 1] - self.calls[index] for index in range(len(self.calls) - 1)]", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:IntervalRoutine", - "span_start": 18, - "span_end": 37, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "def test_actions_stop_busy_worker_before_timeout() -> None:\n started = Event()\n release = Event()\n runtime, base_url = _build_runtime(ScenarioWorker(\"busy-worker\", BlockingRoutine(started, release)))\n assert started.wait(timeout=1.0) is True\n\n def release_later() -> None:\n sleep(0.2)\n release.set()\n\n Thread(target=release_later, daemon=True).start()\n try:\n status, payload = _http_call_json(base_url, \"/actions/stop\", method=\"POST\")\n assert status == 200\n assert isinstance(payload.get(\"detail\"), dict)\n assert payload[\"detail\"][\"timed_out\"] is False\n assert payload[\"detail\"][\"state\"] == \"stopped\"\n\n health_status, health_payload = _http_call_json(base_url, \"/health\")\n assert health_status == 503\n assert health_payload[\"status\"] == \"unhealthy\"\n assert health_payload[\"state\"] == \"stopped\"\n finally:\n runtime.stop()", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:test_actions_stop_busy_worker_before_timeout", - "span_start": 209, - "span_end": 232, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 9, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ] - }, - "diagnostics": { - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C0_SOURCE_CHUNKS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C0_SOURCE_CHUNKS": 10 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [], - "include_globs": [ - "src", - "tests" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests" - ] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src", - "tests" - ], - "include_globs": [ - "src", - "tests" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests" - ] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src", - "tests" - ], - "include_globs": [ - "src", - "tests" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests" - ] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "WorkflowRuntimeFactory", - "path_scope": [], - "include_globs": [ - "src/**", - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "Где тесты для WorkflowRuntimeFactory? test_workflow_runtime_factory TestWorkflowRuntimeFactory WorkflowRuntimeFactory", - "path_scope": [], - "include_globs": [ - "src/**", - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "top_k": 6, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Где тесты для WorkflowRuntimeFactory? test_workflow_runtime_factory TestWorkflowRuntimeFactory WorkflowRuntimeFactory", - "path_scope": [], - "include_globs": [ - "src/**", - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "top_k": 10, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [], - "normalized_include_globs": [ - "src", - "tests" - ], - "normalized_exclude_globs": [], - "normalized_prefer_globs": [ - "tests" - ], - "filter_stage": "post_rank", - "candidates_before_filter": 0, - "candidates_after_filter": 0 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src", - "tests" - ], - "normalized_include_globs": [ - "src", - "tests" - ], - "normalized_exclude_globs": [], - "normalized_prefer_globs": [ - "tests" - ], - "filter_stage": "post_rank", - "candidates_before_filter": 6, - "candidates_after_filter": 6 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src", - "tests" - ], - "normalized_include_globs": [ - "src", - "tests" - ], - "normalized_exclude_globs": [], - "normalized_prefer_globs": [ - "tests" - ], - "filter_stage": "post_rank", - "candidates_before_filter": 10, - "candidates_after_filter": 10 - } - ], - "fallback": { - "used": true, - "reason": "scope_relaxed_no_hits" - }, - "symbol_resolution": { - "status": "not_found", - "resolved_symbol": null, - "alternatives": [ - "WorkflowRuntimeFactory" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "miss", - "hit_count": 0, - "fail_reason": "scope_relaxed_no_hits" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 6, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 10, - "fail_reason": null - } - ] - }, - "constraint_violations": [ - { - "type": "LAYER_MISSING", - "severity": "warn", - "details": { - "layer": "C1_SYMBOL_CATALOG", - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ] - }, - "suggested_fix": "Increase top_k for this layer or relax constraints for retrieval." - } - ], - "timings_ms": { - "symbol_resolution": 0, - "retrieval_total": 112, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 50, - "C2_DEPENDENCY_GRAPH": 48, - "C0_SOURCE_CHUNKS": 13 - }, - "merge_rank": 0 - } - } - }, - { - "step": "llm_answer", - "input": { - "query": "Где тесты для WorkflowRuntimeFactory?", - "rag_count": 16 - }, - "output": { - "llm_answer": "Прямых тестов для WorkflowRuntimeFactory в предоставленном контексте не обнаружено.\n\nКосвенные или ближайшие тесты:\n1. tests/test_business_control_actions.py | test_actions_stop_busy_worker_before_timeout:dataflow_slice\n - Проверяет поведение `BlockingRoutine` и его метод `_release`.\n2. tests/test_business_control_actions.py | test_actions_stop_busy_worker_after_timeout:dataflow_slice\n - Проверяет поведение `BlockingRoutine` и его метод `_started`.\n\nЧто именно проверяется:\n- Поведение и методы класса `BlockingRoutine`, такие как инициализация, запуск и освобождение (test_actions_stop_busy_worker_before_timeout).\n- Поведение и методы класса `ScenarioWorker`, такие как получение имени (test_worker_wakes_up_with_configured_interval).\n\nКакие пробелы покрытия видны:\n- Нет явных тестов конкретно для `WorkflowRuntimeFactory`. \n- Покрытие ограничено ближайшими классами и методами, связанными с рабочим процессом и управлением сценариями работы." - }, - "diagnostics": { - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 998, - "evidence_rows": 16, - "evidence_chars": 8149 - }, - "evidence_summary": [ - { - "layer": "C2_DEPENDENCY_GRAPH", - "count": 6, - "unique_paths": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 10, - "unique_paths": 1 - } - ], - "prompt_template_id": "intent_code_qa_find_tests_ru_v2", - "system_prompt_version": "v1" - }, - "timings_ms": { - "prompt_build": 0, - "llm_call": 1640 - } - } - } - ] - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_125536/full_chain_plba_code_subintents_v2_plba-v2-find-tests-workflow-runtime-factory-negative.md b/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_125536/full_chain_plba_code_subintents_v2_plba-v2-find-tests-workflow-runtime-factory-negative.md deleted file mode 100644 index 4c8abff..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_125536/full_chain_plba_code_subintents_v2_plba-v2-find-tests-workflow-runtime-factory-negative.md +++ /dev/null @@ -1,32 +0,0 @@ -# plba-v2-find-tests-workflow-runtime-factory-negative - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_subintents_v2.yaml -- runner: runtime -- mode: full_chain -- passed: False - -## Query -Где тесты для WorkflowRuntimeFactory? - -## Actual -{ - "intent": "CODE_QA", - "sub_intent": "FIND_TESTS", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 16, - "llm_answer": "Прямых тестов для WorkflowRuntimeFactory в предоставленном контексте не обнаружено.\n\nКосвенные или ближайшие тесты:\n1. tests/test_business_control_actions.py | test_actions_stop_busy_worker_before_timeout:dataflow_slice\n - Проверяет поведение `BlockingRoutine` и его метод `_release`.\n2. tests/test_business_control_actions.py | test_actions_stop_busy_worker_after_timeout:dataflow_slice\n - Проверяет поведение `BlockingRoutine` и его метод `_started`.\n\nЧто именно проверяется:\n- Поведение и методы класса `BlockingRoutine`, такие как инициализация, запуск и освобождение (test_actions_stop_busy_worker_before_timeout).\n- Поведение и методы класса `ScenarioWorker`, такие как получение имени (test_worker_wakes_up_with_configured_interval).\n\nКакие пробелы покрытия видны:\n- Нет явных тестов конкретно для `WorkflowRuntimeFactory`. \n- Покрытие ограничено ближайшими классами и методами, связанными с рабочим процессом и управлением сценариями работы.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "WorkflowRuntimeFactory" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ] -} - -## Mismatches -- retrieval: expected empty rag, got 16 rows \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_125536/full_chain_plba_code_subintents_v2_plba-v2-open-file-nonexistent.json b/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_125536/full_chain_plba_code_subintents_v2_plba-v2-open-file-nonexistent.json deleted file mode 100644 index 332460a..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_125536/full_chain_plba_code_subintents_v2_plba-v2-open-file-nonexistent.json +++ /dev/null @@ -1,454 +0,0 @@ -{ - "case_id": "plba-v2-open-file-nonexistent", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_subintents_v2.yaml", - "runner": "runtime", - "mode": "full_chain", - "actual": { - "intent": "CODE_QA", - "sub_intent": "OPEN_FILE", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 0, - "llm_answer": "1. src/app_runtime/core/missing_runtime.py\n2. Основан только на имени файла и пути, так как сам контент файла недоступен.\n3. Top-level сущности или секции невозможно определить из-за отсутствия содержимого файла.\n4. Так как содержимое файла неизвестно, невозможно сказать, какие части этого файла могут быть важны для интерпретации слоёв RAG. Однако, исходя из названия файла, вероятно, он содержит информацию о работе с отсутствующими или пропущенными компонентами во время выполнения приложения. Это может включать обработку ошибок, логирование или механизмы замены недостающих компонентов.", - "answer_mode": "insufficient_evidence", - "path_scope": [ - "src/app_runtime/core/missing_runtime.py" - ], - "symbol_candidates": [], - "layers": [ - "C0_SOURCE_CHUNKS" - ] - }, - "passed": true, - "mismatches": [], - "details": { - "case_id": "plba-v2-open-file-nonexistent", - "text": "Открой файл src/app_runtime/core/missing_runtime.py", - "mode": "full_chain", - "run_started_at": "2026-03-12T12:55:37", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Открой файл src/app_runtime/core/missing_runtime.py", - "symbol_resolution": { - "status": "not_requested", - "resolved_symbol": null, - "alternatives": [], - "confidence": 0.0 - }, - "rag_count": 0, - "rag_rows": [], - "llm_answer": "1. src/app_runtime/core/missing_runtime.py\n2. Основан только на имени файла и пути, так как сам контент файла недоступен.\n3. Top-level сущности или секции невозможно определить из-за отсутствия содержимого файла.\n4. Так как содержимое файла неизвестно, невозможно сказать, какие части этого файла могут быть важны для интерпретации слоёв RAG. Однако, исходя из названия файла, вероятно, он содержит информацию о работе с отсутствующими или пропущенными компонентами во время выполнения приложения. Это может включать обработку ошибок, логирование или механизмы замены недостающих компонентов.", - "summary": { - "router": { - "intent": "CODE_QA", - "sub_intent": "OPEN_FILE", - "confidence": null - }, - "retrieval": { - "profile": "code", - "layers_hit": [], - "evidence_sufficient": false - }, - "llm": { - "answer_status": "insufficient_evidence", - "groundedness": "weakly_grounded" - } - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "OPEN_FILE", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C0_SOURCE_CHUNKS" - ], - "symbol_kind_hint": "unknown", - "symbol_candidates": [], - "keyword_hints": [], - "path_hints": [ - "src/app_runtime/core/missing_runtime.py" - ], - "path_scope": [ - "src/app_runtime/core/missing_runtime.py" - ], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/app_runtime/core/missing_runtime.py" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": false, - "max_distance": 2, - "top_k": 5 - } - } - }, - "execution": { - "executed_layers": [ - "C0_SOURCE_CHUNKS" - ], - "retrieval_mode_by_layer": { - "C0_SOURCE_CHUNKS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C0_SOURCE_CHUNKS": 200 - }, - "filters_by_layer": { - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src/app_runtime/core/missing_runtime.py" - ], - "include_globs": [], - "exclude_globs": [], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": null, - "workspace_id": null, - "returned_repo_ids": [], - "returned_workspace_ids": [] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Открой файл src/app_runtime/core/missing_runtime.py", - "path_scope": [ - "src/app_runtime/core/missing_runtime.py" - ], - "include_globs": [], - "exclude_globs": [], - "prefer_globs": [], - "top_k": 200, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src/app_runtime/core/missing_runtime.py" - ], - "normalized_include_globs": [], - "normalized_exclude_globs": [], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 0, - "candidates_after_filter": 0 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "not_requested", - "resolved_symbol": null, - "alternatives": [] - }, - "layers": [ - { - "layer": "C0_SOURCE_CHUNKS", - "status": "miss", - "hit_count": 0, - "fail_reason": null - } - ] - }, - "constraint_violations": [ - { - "type": "PATH_SCOPE_NOT_SATISFIED", - "severity": "error", - "details": { - "path_scope": [ - "src/app_runtime/core/missing_runtime.py" - ], - "returned_paths": [] - }, - "suggested_fix": "Use exact path_scope retrieval and disable broad fallback for OPEN_FILE." - }, - { - "type": "LAYER_MISSING", - "severity": "warn", - "details": { - "layer": "C0_SOURCE_CHUNKS", - "requested_layers": [ - "C0_SOURCE_CHUNKS" - ] - }, - "suggested_fix": "Increase top_k for this layer or relax constraints for retrieval." - } - ], - "timings_ms": { - "router": 1, - "symbol_resolution": 0, - "retrieval_total": 37, - "retrieval_by_layer": { - "C0_SOURCE_CHUNKS": 37 - }, - "merge_rank": 0, - "prompt_build": 0, - "llm_call": 1016 - }, - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 278, - "evidence_rows": 0, - "evidence_chars": 0 - }, - "evidence_summary": [], - "prompt_template_id": "intent_code_qa_open_file_ru_v2", - "system_prompt_version": "v1" - }, - "router": { - "conversation_mode": "START", - "keyword_hints": [], - "path_scope": [ - "src/app_runtime/core/missing_runtime.py" - ] - }, - "llm": { - "used_evidence_count": 0, - "missing_evidence_reason": "empty_retrieval_context" - } - }, - "run_info": { - "case_id": "plba-v2-open-file-nonexistent", - "mode": "full_chain", - "run_started_at": "2026-03-12T12:55:37", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - }, - "input_request": { - "text": "Открой файл src/app_runtime/core/missing_runtime.py", - "normalized_query": "Открой файл src/app_runtime/core/missing_runtime.py" - }, - "steps": [ - { - "step": "intent_router", - "input": { - "query": "Открой файл src/app_runtime/core/missing_runtime.py" - }, - "output": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Открой файл src/app_runtime/core/missing_runtime.py" - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "OPEN_FILE", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C0_SOURCE_CHUNKS" - ], - "symbol_kind_hint": "unknown", - "symbol_candidates": [], - "keyword_hints": [], - "path_hints": [ - "src/app_runtime/core/missing_runtime.py" - ], - "path_scope": [ - "src/app_runtime/core/missing_runtime.py" - ], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/app_runtime/core/missing_runtime.py" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": false, - "max_distance": 2, - "top_k": 5 - } - } - }, - "timings_ms": { - "router": 1 - } - } - }, - { - "step": "retrieval", - "input": { - "query": "Открой файл src/app_runtime/core/missing_runtime.py" - }, - "output": { - "symbol_resolution": { - "status": "not_requested", - "resolved_symbol": null, - "alternatives": [], - "confidence": 0.0 - }, - "rag_count": 0, - "rag_rows": [] - }, - "diagnostics": { - "execution": { - "executed_layers": [ - "C0_SOURCE_CHUNKS" - ], - "retrieval_mode_by_layer": { - "C0_SOURCE_CHUNKS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C0_SOURCE_CHUNKS": 200 - }, - "filters_by_layer": { - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src/app_runtime/core/missing_runtime.py" - ], - "include_globs": [], - "exclude_globs": [], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": null, - "workspace_id": null, - "returned_repo_ids": [], - "returned_workspace_ids": [] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Открой файл src/app_runtime/core/missing_runtime.py", - "path_scope": [ - "src/app_runtime/core/missing_runtime.py" - ], - "include_globs": [], - "exclude_globs": [], - "prefer_globs": [], - "top_k": 200, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src/app_runtime/core/missing_runtime.py" - ], - "normalized_include_globs": [], - "normalized_exclude_globs": [], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 0, - "candidates_after_filter": 0 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "not_requested", - "resolved_symbol": null, - "alternatives": [] - }, - "layers": [ - { - "layer": "C0_SOURCE_CHUNKS", - "status": "miss", - "hit_count": 0, - "fail_reason": null - } - ] - }, - "constraint_violations": [ - { - "type": "PATH_SCOPE_NOT_SATISFIED", - "severity": "error", - "details": { - "path_scope": [ - "src/app_runtime/core/missing_runtime.py" - ], - "returned_paths": [] - }, - "suggested_fix": "Use exact path_scope retrieval and disable broad fallback for OPEN_FILE." - }, - { - "type": "LAYER_MISSING", - "severity": "warn", - "details": { - "layer": "C0_SOURCE_CHUNKS", - "requested_layers": [ - "C0_SOURCE_CHUNKS" - ] - }, - "suggested_fix": "Increase top_k for this layer or relax constraints for retrieval." - } - ], - "timings_ms": { - "symbol_resolution": 0, - "retrieval_total": 37, - "retrieval_by_layer": { - "C0_SOURCE_CHUNKS": 37 - }, - "merge_rank": 0 - } - } - }, - { - "step": "llm_answer", - "input": { - "query": "Открой файл src/app_runtime/core/missing_runtime.py", - "rag_count": 0 - }, - "output": { - "llm_answer": "1. src/app_runtime/core/missing_runtime.py\n2. Основан только на имени файла и пути, так как сам контент файла недоступен.\n3. Top-level сущности или секции невозможно определить из-за отсутствия содержимого файла.\n4. Так как содержимое файла неизвестно, невозможно сказать, какие части этого файла могут быть важны для интерпретации слоёв RAG. Однако, исходя из названия файла, вероятно, он содержит информацию о работе с отсутствующими или пропущенными компонентами во время выполнения приложения. Это может включать обработку ошибок, логирование или механизмы замены недостающих компонентов." - }, - "diagnostics": { - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 278, - "evidence_rows": 0, - "evidence_chars": 0 - }, - "evidence_summary": [], - "prompt_template_id": "intent_code_qa_open_file_ru_v2", - "system_prompt_version": "v1" - }, - "timings_ms": { - "prompt_build": 0, - "llm_call": 1016 - } - } - } - ] - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_125536/full_chain_plba_code_subintents_v2_plba-v2-open-file-nonexistent.md b/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_125536/full_chain_plba_code_subintents_v2_plba-v2-open-file-nonexistent.md deleted file mode 100644 index 6a5292d..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_125536/full_chain_plba_code_subintents_v2_plba-v2-open-file-nonexistent.md +++ /dev/null @@ -1,30 +0,0 @@ -# plba-v2-open-file-nonexistent - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_subintents_v2.yaml -- runner: runtime -- mode: full_chain -- passed: True - -## Query -Открой файл src/app_runtime/core/missing_runtime.py - -## Actual -{ - "intent": "CODE_QA", - "sub_intent": "OPEN_FILE", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 0, - "llm_answer": "1. src/app_runtime/core/missing_runtime.py\n2. Основан только на имени файла и пути, так как сам контент файла недоступен.\n3. Top-level сущности или секции невозможно определить из-за отсутствия содержимого файла.\n4. Так как содержимое файла неизвестно, невозможно сказать, какие части этого файла могут быть важны для интерпретации слоёв RAG. Однако, исходя из названия файла, вероятно, он содержит информацию о работе с отсутствующими или пропущенными компонентами во время выполнения приложения. Это может включать обработку ошибок, логирование или механизмы замены недостающих компонентов.", - "answer_mode": "insufficient_evidence", - "path_scope": [ - "src/app_runtime/core/missing_runtime.py" - ], - "symbol_candidates": [], - "layers": [ - "C0_SOURCE_CHUNKS" - ] -} - -## Mismatches -- none \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_125536/full_chain_plba_code_subintents_v2_plba-v2-open-file-public-api.json b/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_125536/full_chain_plba_code_subintents_v2_plba-v2-open-file-public-api.json deleted file mode 100644 index d197a25..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_125536/full_chain_plba_code_subintents_v2_plba-v2-open-file-public-api.json +++ /dev/null @@ -1,492 +0,0 @@ -{ - "case_id": "plba-v2-open-file-public-api", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_subintents_v2.yaml", - "runner": "runtime", - "mode": "full_chain", - "actual": { - "intent": "CODE_QA", - "sub_intent": "OPEN_FILE", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 1, - "llm_answer": "1. src/plba/__init__.py\n2. Файл содержит импорт различных модулей и классов из разных пакетов проекта. Также определён список __all__, содержащий имена экспортируемых элементов.\n3. Top-level сущности и секции:\n - Импорты (модулей и классов).\n - Список __all__.\n4. В этом файле определены импорты основных компонентов системы управления рабочими процессами, конфигурацией, контролем и отслеживанием выполнения задач. Список __all__ указывает на основные экспортируемые элементы модуля, которые могут быть важны при использовании этого модуля в других частях приложения.", - "answer_mode": "answered", - "path_scope": [ - "src/plba/__init__.py" - ], - "symbol_candidates": [], - "layers": [ - "C0_SOURCE_CHUNKS" - ] - }, - "passed": true, - "mismatches": [], - "details": { - "case_id": "plba-v2-open-file-public-api", - "text": "Открой файл src/plba/__init__.py", - "mode": "full_chain", - "run_started_at": "2026-03-12T12:55:37", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Открой файл src/plba/__init__.py", - "symbol_resolution": { - "status": "not_requested", - "resolved_symbol": null, - "alternatives": [], - "confidence": 0.0 - }, - "rag_count": 1, - "rag_rows": [ - { - "path": "src/plba/__init__.py", - "content": "from plba.bootstrap import create_runtime\nfrom plba.config import ConfigFileLoader, FileConfigProvider\nfrom plba.control import ControlActionSet, ControlChannel, ControlPlaneService, HttpControlChannel\nfrom plba.contracts import (\n ApplicationModule,\n ConfigProvider,\n HealthContributor,\n TraceContext,\n TraceContextRecord,\n TraceLogMessage,\n TraceTransport,\n Worker,\n WorkerHealth,\n WorkerStatus,\n)\nfrom plba.core import ConfigurationManager, RuntimeManager, ServiceContainer\nfrom plba.health import HealthRegistry\nfrom plba.logging import LogManager\nfrom plba.queue import InMemoryTaskQueue\nfrom plba.tracing import MySqlTraceTransport, NoOpTraceTransport, TraceService\nfrom plba.workflow import (\n StepResult,\n WorkflowContext,\n WorkflowDefinition,\n WorkflowEngine,\n WorkflowEngineHooks,\n WorkflowNode,\n WorkflowRuntimeFactory,\n WorkflowStep,\n)\nfrom plba.workers import WorkerSupervisor\n\n__all__ = [\n \"ApplicationModule\",\n \"ConfigFileLoader\",\n \"ConfigProvider\",\n \"ConfigurationManager\",\n \"ControlActionSet\",\n \"ControlChannel\",\n \"ControlPlaneService\",\n \"create_runtime\",\n \"FileConfigProvider\",\n \"HealthContributor\",\n \"HealthRegistry\",\n \"HttpControlChannel\",\n \"InMemoryTaskQueue\",\n \"LogManager\",\n \"MySqlTraceTransport\",\n \"NoOpTraceTransport\",\n \"RuntimeManager\",\n \"ServiceContainer\",\n \"TraceContext\",\n \"TraceContextRecord\",\n \"TraceLogMessage\",\n \"TraceService\",\n \"TraceTransport\",\n \"StepResult\",\n \"Worker\",\n \"WorkerHealth\",\n \"WorkerStatus\",\n \"WorkflowContext\",\n \"WorkflowDefinition\",\n \"WorkflowEngine\",\n \"WorkflowEngineHooks\",\n \"WorkflowNode\",\n \"WorkflowRuntimeFactory\",\n \"WorkflowStep\",\n \"WorkerSupervisor\",\n]", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/plba/__init__.py:1-69", - "span_start": 1, - "span_end": 69, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.plba.__init__", - "is_test": false, - "blob_sha": "24e755ec8c249d14fb0e675b5dbf2b71ab91afb9c849897eebfa9feb2499e19d", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "llm_answer": "1. src/plba/__init__.py\n2. Файл содержит импорт различных модулей и классов из разных пакетов проекта. Также определён список __all__, содержащий имена экспортируемых элементов.\n3. Top-level сущности и секции:\n - Импорты (модулей и классов).\n - Список __all__.\n4. В этом файле определены импорты основных компонентов системы управления рабочими процессами, конфигурацией, контролем и отслеживанием выполнения задач. Список __all__ указывает на основные экспортируемые элементы модуля, которые могут быть важны при использовании этого модуля в других частях приложения.", - "summary": { - "router": { - "intent": "CODE_QA", - "sub_intent": "OPEN_FILE", - "confidence": null - }, - "retrieval": { - "profile": "code", - "layers_hit": [ - "C0_SOURCE_CHUNKS" - ], - "evidence_sufficient": true - }, - "llm": { - "answer_status": "answered", - "groundedness": "grounded" - } - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "OPEN_FILE", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C0_SOURCE_CHUNKS" - ], - "symbol_kind_hint": "unknown", - "symbol_candidates": [], - "keyword_hints": [], - "path_hints": [ - "src/plba/__init__.py" - ], - "path_scope": [ - "src/plba/__init__.py" - ], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/plba/__init__.py" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": false, - "max_distance": 2, - "top_k": 5 - } - } - }, - "execution": { - "executed_layers": [ - "C0_SOURCE_CHUNKS" - ], - "retrieval_mode_by_layer": { - "C0_SOURCE_CHUNKS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C0_SOURCE_CHUNKS": 200 - }, - "filters_by_layer": { - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src/plba/__init__.py" - ], - "include_globs": [], - "exclude_globs": [], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Открой файл src/plba/__init__.py", - "path_scope": [ - "src/plba/__init__.py" - ], - "include_globs": [], - "exclude_globs": [], - "prefer_globs": [], - "top_k": 200, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src/plba/__init__.py" - ], - "normalized_include_globs": [], - "normalized_exclude_globs": [], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 1, - "candidates_after_filter": 1 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "not_requested", - "resolved_symbol": null, - "alternatives": [] - }, - "layers": [ - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 1, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "router": 0, - "symbol_resolution": 0, - "retrieval_total": 20, - "retrieval_by_layer": { - "C0_SOURCE_CHUNKS": 20 - }, - "merge_rank": 0, - "prompt_build": 0, - "llm_call": 1040 - }, - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 589, - "evidence_rows": 1, - "evidence_chars": 1768 - }, - "evidence_summary": [ - { - "layer": "C0_SOURCE_CHUNKS", - "count": 1, - "unique_paths": 1 - } - ], - "prompt_template_id": "intent_code_qa_open_file_ru_v2", - "system_prompt_version": "v1" - }, - "router": { - "conversation_mode": "START", - "keyword_hints": [], - "path_scope": [ - "src/plba/__init__.py" - ] - }, - "llm": { - "used_evidence_count": 1, - "missing_evidence_reason": null - } - }, - "run_info": { - "case_id": "plba-v2-open-file-public-api", - "mode": "full_chain", - "run_started_at": "2026-03-12T12:55:37", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - }, - "input_request": { - "text": "Открой файл src/plba/__init__.py", - "normalized_query": "Открой файл src/plba/__init__.py" - }, - "steps": [ - { - "step": "intent_router", - "input": { - "query": "Открой файл src/plba/__init__.py" - }, - "output": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Открой файл src/plba/__init__.py" - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "OPEN_FILE", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C0_SOURCE_CHUNKS" - ], - "symbol_kind_hint": "unknown", - "symbol_candidates": [], - "keyword_hints": [], - "path_hints": [ - "src/plba/__init__.py" - ], - "path_scope": [ - "src/plba/__init__.py" - ], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/plba/__init__.py" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": false, - "max_distance": 2, - "top_k": 5 - } - } - }, - "timings_ms": { - "router": 0 - } - } - }, - { - "step": "retrieval", - "input": { - "query": "Открой файл src/plba/__init__.py" - }, - "output": { - "symbol_resolution": { - "status": "not_requested", - "resolved_symbol": null, - "alternatives": [], - "confidence": 0.0 - }, - "rag_count": 1, - "rag_rows": [ - { - "path": "src/plba/__init__.py", - "content": "from plba.bootstrap import create_runtime\nfrom plba.config import ConfigFileLoader, FileConfigProvider\nfrom plba.control import ControlActionSet, ControlChannel, ControlPlaneService, HttpControlChannel\nfrom plba.contracts import (\n ApplicationModule,\n ConfigProvider,\n HealthContributor,\n TraceContext,\n TraceContextRecord,\n TraceLogMessage,\n TraceTransport,\n Worker,\n WorkerHealth,\n WorkerStatus,\n)\nfrom plba.core import ConfigurationManager, RuntimeManager, ServiceContainer\nfrom plba.health import HealthRegistry\nfrom plba.logging import LogManager\nfrom plba.queue import InMemoryTaskQueue\nfrom plba.tracing import MySqlTraceTransport, NoOpTraceTransport, TraceService\nfrom plba.workflow import (\n StepResult,\n WorkflowContext,\n WorkflowDefinition,\n WorkflowEngine,\n WorkflowEngineHooks,\n WorkflowNode,\n WorkflowRuntimeFactory,\n WorkflowStep,\n)\nfrom plba.workers import WorkerSupervisor\n\n__all__ = [\n \"ApplicationModule\",\n \"ConfigFileLoader\",\n \"ConfigProvider\",\n \"ConfigurationManager\",\n \"ControlActionSet\",\n \"ControlChannel\",\n \"ControlPlaneService\",\n \"create_runtime\",\n \"FileConfigProvider\",\n \"HealthContributor\",\n \"HealthRegistry\",\n \"HttpControlChannel\",\n \"InMemoryTaskQueue\",\n \"LogManager\",\n \"MySqlTraceTransport\",\n \"NoOpTraceTransport\",\n \"RuntimeManager\",\n \"ServiceContainer\",\n \"TraceContext\",\n \"TraceContextRecord\",\n \"TraceLogMessage\",\n \"TraceService\",\n \"TraceTransport\",\n \"StepResult\",\n \"Worker\",\n \"WorkerHealth\",\n \"WorkerStatus\",\n \"WorkflowContext\",\n \"WorkflowDefinition\",\n \"WorkflowEngine\",\n \"WorkflowEngineHooks\",\n \"WorkflowNode\",\n \"WorkflowRuntimeFactory\",\n \"WorkflowStep\",\n \"WorkerSupervisor\",\n]", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/plba/__init__.py:1-69", - "span_start": 1, - "span_end": 69, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.plba.__init__", - "is_test": false, - "blob_sha": "24e755ec8c249d14fb0e675b5dbf2b71ab91afb9c849897eebfa9feb2499e19d", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ] - }, - "diagnostics": { - "execution": { - "executed_layers": [ - "C0_SOURCE_CHUNKS" - ], - "retrieval_mode_by_layer": { - "C0_SOURCE_CHUNKS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C0_SOURCE_CHUNKS": 200 - }, - "filters_by_layer": { - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src/plba/__init__.py" - ], - "include_globs": [], - "exclude_globs": [], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Открой файл src/plba/__init__.py", - "path_scope": [ - "src/plba/__init__.py" - ], - "include_globs": [], - "exclude_globs": [], - "prefer_globs": [], - "top_k": 200, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src/plba/__init__.py" - ], - "normalized_include_globs": [], - "normalized_exclude_globs": [], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 1, - "candidates_after_filter": 1 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "not_requested", - "resolved_symbol": null, - "alternatives": [] - }, - "layers": [ - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 1, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "symbol_resolution": 0, - "retrieval_total": 20, - "retrieval_by_layer": { - "C0_SOURCE_CHUNKS": 20 - }, - "merge_rank": 0 - } - } - }, - { - "step": "llm_answer", - "input": { - "query": "Открой файл src/plba/__init__.py", - "rag_count": 1 - }, - "output": { - "llm_answer": "1. src/plba/__init__.py\n2. Файл содержит импорт различных модулей и классов из разных пакетов проекта. Также определён список __all__, содержащий имена экспортируемых элементов.\n3. Top-level сущности и секции:\n - Импорты (модулей и классов).\n - Список __all__.\n4. В этом файле определены импорты основных компонентов системы управления рабочими процессами, конфигурацией, контролем и отслеживанием выполнения задач. Список __all__ указывает на основные экспортируемые элементы модуля, которые могут быть важны при использовании этого модуля в других частях приложения." - }, - "diagnostics": { - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 589, - "evidence_rows": 1, - "evidence_chars": 1768 - }, - "evidence_summary": [ - { - "layer": "C0_SOURCE_CHUNKS", - "count": 1, - "unique_paths": 1 - } - ], - "prompt_template_id": "intent_code_qa_open_file_ru_v2", - "system_prompt_version": "v1" - }, - "timings_ms": { - "prompt_build": 0, - "llm_call": 1040 - } - } - } - ] - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_125536/full_chain_plba_code_subintents_v2_plba-v2-open-file-public-api.md b/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_125536/full_chain_plba_code_subintents_v2_plba-v2-open-file-public-api.md deleted file mode 100644 index 3ba3092..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_125536/full_chain_plba_code_subintents_v2_plba-v2-open-file-public-api.md +++ /dev/null @@ -1,30 +0,0 @@ -# plba-v2-open-file-public-api - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_subintents_v2.yaml -- runner: runtime -- mode: full_chain -- passed: True - -## Query -Открой файл src/plba/__init__.py - -## Actual -{ - "intent": "CODE_QA", - "sub_intent": "OPEN_FILE", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 1, - "llm_answer": "1. src/plba/__init__.py\n2. Файл содержит импорт различных модулей и классов из разных пакетов проекта. Также определён список __all__, содержащий имена экспортируемых элементов.\n3. Top-level сущности и секции:\n - Импорты (модулей и классов).\n - Список __all__.\n4. В этом файле определены импорты основных компонентов системы управления рабочими процессами, конфигурацией, контролем и отслеживанием выполнения задач. Список __all__ указывает на основные экспортируемые элементы модуля, которые могут быть важны при использовании этого модуля в других частях приложения.", - "answer_mode": "answered", - "path_scope": [ - "src/plba/__init__.py" - ], - "symbol_candidates": [], - "layers": [ - "C0_SOURCE_CHUNKS" - ] -} - -## Mismatches -- none \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_125536/full_chain_plba_code_subintents_v2_plba-v2-open-file-runtime.json b/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_125536/full_chain_plba_code_subintents_v2_plba-v2-open-file-runtime.json deleted file mode 100644 index aac42d5..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_125536/full_chain_plba_code_subintents_v2_plba-v2-open-file-runtime.json +++ /dev/null @@ -1,492 +0,0 @@ -{ - "case_id": "plba-v2-open-file-runtime", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_subintents_v2.yaml", - "runner": "runtime", - "mode": "full_chain", - "actual": { - "intent": "CODE_QA", - "sub_intent": "OPEN_FILE", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 1, - "llm_answer": "1. путь к файлу: src/app_runtime/core/runtime.py\n2. В доступных фрагментах видна реализация класса RuntimeManager.\n3. Top-level сущности и секции: класс RuntimeManager с методом __init__, методом _register_core_services и частично реализованным методом register_module.\n4. Важные элементы для вопроса пользователя:\n- Константы ACTION_TIMEOUT_SECONDS и ACTION_POLL_INTERVAL_SECONDS.\n- Инициализация различных служб (ConfigurationManager, ServiceContainer, TraceService и др.) через конструктор класса.\n- Метод _register_core_services, вероятно, отвечает за регистрацию основных сервисов. \n\nОтвет основан только на доступных фрагментах. Полный контекст файла может содержать дополнительную информацию.", - "answer_mode": "answered", - "path_scope": [ - "src/app_runtime/core/runtime.py" - ], - "symbol_candidates": [], - "layers": [ - "C0_SOURCE_CHUNKS" - ] - }, - "passed": true, - "mismatches": [], - "details": { - "case_id": "plba-v2-open-file-runtime", - "text": "Открой файл src/app_runtime/core/runtime.py", - "mode": "full_chain", - "run_started_at": "2026-03-12T12:55:37", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Открой файл src/app_runtime/core/runtime.py", - "symbol_resolution": { - "status": "not_requested", - "resolved_symbol": null, - "alternatives": [], - "confidence": 0.0 - }, - "rag_count": 1, - "rag_rows": [ - { - "path": "src/app_runtime/core/runtime.py", - "content": "class RuntimeManager:\n ACTION_TIMEOUT_SECONDS = 10.0\n ACTION_POLL_INTERVAL_SECONDS = 0.05\n\n def __init__(\n self,\n configuration: ConfigurationManager | None = None,\n services: ServiceContainer | None = None,\n traces: TraceService | None = None,\n health: HealthRegistry | None = None,\n logs: LogManager | None = None,\n workers: WorkerSupervisor | None = None,\n control_plane: ControlPlaneService | None = None,\n ) -> None:\n self.configuration = configuration or ConfigurationManager()\n self.services = services or ServiceContainer()\n self.traces = traces or TraceService()\n self.health = health or HealthRegistry()\n self.logs = logs or LogManager()\n self.workers = workers or WorkerSupervisor()\n self.control_plane = control_plane or ControlPlaneService()\n self.registry = ModuleRegistry(self.services)\n self._started = False\n self._state = LifecycleState.IDLE\n self._core_registered = False\n self._workers_registered = False\n self._register_core_services()\n\n def register_module(self, module: ApplicationModule) -> None:\n self.registry.register_module(module.name)\n module.register(self.registry)\n\n def add_config_file(self, path: str) -> FileConfigProvider:\n provider = FileConfigProvider(path)\n self.configuration.add_provider(provider)\n return provider\n\n def start(self, *, start_control_plane: bool = True) -> None:\n if self._started:\n return\n self._state = LifecycleState.STARTING\n config = self.configuration.load()\n self.logs.apply_config(config)\n self._register_health_contributors()\n self._register_workers()\n self.workers.start()\n if start_control_plane:\n self.control_plane.start(self)\n self._started = True\n self._refresh_state()\n\n def stop(self, timeout: float = 30.0, force: bool = False, stop_control_plane: bool = True) -> None:\n if not self._started:\n return\n self._state = LifecycleState.STOPPING\n self.workers.stop(timeout=timeout, force=force)\n if stop_control_plane:\n self.control_plane.stop()\n self._started = False\n self._state = LifecycleState.STOPPED\n\n def status(self) -> dict[str, object]:\n self._refresh_state()\n return self.control_plane.snapshot(self)\n\n def current_health(self) -> HealthPayload:\n self._refresh_state()\n return self.health.payload(self._state, self.workers.healths())\n\n async def health_status(self) -> HealthPayload:\n return self.current_health()\n\n async def start_runtime(self) -> dict[str, object] | str:\n self._refresh_state()\n if self._started:\n return \"runtime already running\"\n if self._state == LifecycleState.STOPPING:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n\n self.start(start_control_plane=False)\n started = self._wait_for_state({LifecycleState.IDLE, LifecycleState.BUSY}, timeout=self.ACTION_TIMEOUT_SECONDS)\n if started:\n return self._action_detail(\"runtime started\", timed_out=False)\n return self._action_detail(\"runtime start is still in progress\", timed_out=True)\n\n async def stop_runtime(self) -> dict[str, object] | str:\n self._refresh_state()\n if not self._started:\n if self._state == LifecycleState.STOPPING:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n return \"runtime already stopped\"\n\n self._state = LifecycleState.STOPPING\n try:\n self.workers.stop(timeout=self.ACTION_TIMEOUT_SECONDS, force=False)\n except TimeoutError:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n\n self._started = False\n self._state = LifecycleState.STOPPED\n return self._action_detail(\"runtime stopped\", timed_out=False)\n\n async def runtime_status(self) -> str:\n self._refresh_state()\n return self._state.value\n\n def _register_core_services(self) -> None:\n if self._core_registered:\n return\n self.services.register(\"configuration\", self.configuration)\n self.services.register(\"traces\", self.traces)\n self.services.register(\"health\", self.health)\n self.services.register(\"logs\", self.logs)\n self.services.register(\"workers\", self.workers)\n self.services.register(\"control_plane\", self.control_plane)\n self._core_registered = True\n\n def _register_health_contributors(self) -> None:\n for contributor in self.registry.health_contributors:\n self.health.register(contributor)\n\n def _register_workers(self) -> None:\n if self._workers_registered:\n return\n for worker in self.registry.workers:\n self.workers.register(worker)\n self._workers_registered = True\n\n def _refresh_state(self) -> None:\n lifecycle = self.workers.lifecycle_state()\n\n if self._state == LifecycleState.STOPPING:\n if lifecycle == LifecycleState.STOPPED:\n self._started = False\n self._state = LifecycleState.STOPPED\n return\n\n if not self._started:\n if lifecycle == LifecycleState.STOPPED:\n self._state = LifecycleState.STOPPED\n return\n\n self._state = lifecycle\n\n def _wait_for_state(self, target_states: set[LifecycleState], *, timeout: float) -> bool:\n deadline = monotonic() + timeout\n while monotonic() < deadline:\n self._refresh_state()\n if self._state in target_states:\n return True\n sleep(self.ACTION_POLL_INTERVAL_SECONDS)\n self._refresh_state()\n return self._state in target_states\n\n def _action_detail(self, message: str, *, timed_out: bool) -> dict[str, object]:\n self._refresh_state()\n return {\n \"message\": message,\n \"state\": self._state.value,\n \"timed_out\": timed_out,\n \"workers\": self.workers.snapshot(),\n }", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/core/runtime.py:RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.core.runtime", - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "llm_answer": "1. путь к файлу: src/app_runtime/core/runtime.py\n2. В доступных фрагментах видна реализация класса RuntimeManager.\n3. Top-level сущности и секции: класс RuntimeManager с методом __init__, методом _register_core_services и частично реализованным методом register_module.\n4. Важные элементы для вопроса пользователя:\n- Константы ACTION_TIMEOUT_SECONDS и ACTION_POLL_INTERVAL_SECONDS.\n- Инициализация различных служб (ConfigurationManager, ServiceContainer, TraceService и др.) через конструктор класса.\n- Метод _register_core_services, вероятно, отвечает за регистрацию основных сервисов. \n\nОтвет основан только на доступных фрагментах. Полный контекст файла может содержать дополнительную информацию.", - "summary": { - "router": { - "intent": "CODE_QA", - "sub_intent": "OPEN_FILE", - "confidence": null - }, - "retrieval": { - "profile": "code", - "layers_hit": [ - "C0_SOURCE_CHUNKS" - ], - "evidence_sufficient": true - }, - "llm": { - "answer_status": "answered", - "groundedness": "grounded" - } - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "OPEN_FILE", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C0_SOURCE_CHUNKS" - ], - "symbol_kind_hint": "unknown", - "symbol_candidates": [], - "keyword_hints": [], - "path_hints": [ - "src/app_runtime/core/runtime.py" - ], - "path_scope": [ - "src/app_runtime/core/runtime.py" - ], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/app_runtime/core/runtime.py" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": false, - "max_distance": 2, - "top_k": 5 - } - } - }, - "execution": { - "executed_layers": [ - "C0_SOURCE_CHUNKS" - ], - "retrieval_mode_by_layer": { - "C0_SOURCE_CHUNKS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C0_SOURCE_CHUNKS": 200 - }, - "filters_by_layer": { - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src/app_runtime/core/runtime.py" - ], - "include_globs": [], - "exclude_globs": [], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Открой файл src/app_runtime/core/runtime.py", - "path_scope": [ - "src/app_runtime/core/runtime.py" - ], - "include_globs": [], - "exclude_globs": [], - "prefer_globs": [], - "top_k": 200, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src/app_runtime/core/runtime.py" - ], - "normalized_include_globs": [], - "normalized_exclude_globs": [], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 1, - "candidates_after_filter": 1 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "not_requested", - "resolved_symbol": null, - "alternatives": [] - }, - "layers": [ - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 1, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "router": 1, - "symbol_resolution": 0, - "retrieval_total": 127, - "retrieval_by_layer": { - "C0_SOURCE_CHUNKS": 127 - }, - "merge_rank": 0, - "prompt_build": 0, - "llm_call": 1212 - }, - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 600, - "evidence_rows": 1, - "evidence_chars": 6265 - }, - "evidence_summary": [ - { - "layer": "C0_SOURCE_CHUNKS", - "count": 1, - "unique_paths": 1 - } - ], - "prompt_template_id": "intent_code_qa_open_file_ru_v2", - "system_prompt_version": "v1" - }, - "router": { - "conversation_mode": "START", - "keyword_hints": [], - "path_scope": [ - "src/app_runtime/core/runtime.py" - ] - }, - "llm": { - "used_evidence_count": 1, - "missing_evidence_reason": null - } - }, - "run_info": { - "case_id": "plba-v2-open-file-runtime", - "mode": "full_chain", - "run_started_at": "2026-03-12T12:55:37", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - }, - "input_request": { - "text": "Открой файл src/app_runtime/core/runtime.py", - "normalized_query": "Открой файл src/app_runtime/core/runtime.py" - }, - "steps": [ - { - "step": "intent_router", - "input": { - "query": "Открой файл src/app_runtime/core/runtime.py" - }, - "output": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Открой файл src/app_runtime/core/runtime.py" - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "OPEN_FILE", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C0_SOURCE_CHUNKS" - ], - "symbol_kind_hint": "unknown", - "symbol_candidates": [], - "keyword_hints": [], - "path_hints": [ - "src/app_runtime/core/runtime.py" - ], - "path_scope": [ - "src/app_runtime/core/runtime.py" - ], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/app_runtime/core/runtime.py" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": false, - "max_distance": 2, - "top_k": 5 - } - } - }, - "timings_ms": { - "router": 1 - } - } - }, - { - "step": "retrieval", - "input": { - "query": "Открой файл src/app_runtime/core/runtime.py" - }, - "output": { - "symbol_resolution": { - "status": "not_requested", - "resolved_symbol": null, - "alternatives": [], - "confidence": 0.0 - }, - "rag_count": 1, - "rag_rows": [ - { - "path": "src/app_runtime/core/runtime.py", - "content": "class RuntimeManager:\n ACTION_TIMEOUT_SECONDS = 10.0\n ACTION_POLL_INTERVAL_SECONDS = 0.05\n\n def __init__(\n self,\n configuration: ConfigurationManager | None = None,\n services: ServiceContainer | None = None,\n traces: TraceService | None = None,\n health: HealthRegistry | None = None,\n logs: LogManager | None = None,\n workers: WorkerSupervisor | None = None,\n control_plane: ControlPlaneService | None = None,\n ) -> None:\n self.configuration = configuration or ConfigurationManager()\n self.services = services or ServiceContainer()\n self.traces = traces or TraceService()\n self.health = health or HealthRegistry()\n self.logs = logs or LogManager()\n self.workers = workers or WorkerSupervisor()\n self.control_plane = control_plane or ControlPlaneService()\n self.registry = ModuleRegistry(self.services)\n self._started = False\n self._state = LifecycleState.IDLE\n self._core_registered = False\n self._workers_registered = False\n self._register_core_services()\n\n def register_module(self, module: ApplicationModule) -> None:\n self.registry.register_module(module.name)\n module.register(self.registry)\n\n def add_config_file(self, path: str) -> FileConfigProvider:\n provider = FileConfigProvider(path)\n self.configuration.add_provider(provider)\n return provider\n\n def start(self, *, start_control_plane: bool = True) -> None:\n if self._started:\n return\n self._state = LifecycleState.STARTING\n config = self.configuration.load()\n self.logs.apply_config(config)\n self._register_health_contributors()\n self._register_workers()\n self.workers.start()\n if start_control_plane:\n self.control_plane.start(self)\n self._started = True\n self._refresh_state()\n\n def stop(self, timeout: float = 30.0, force: bool = False, stop_control_plane: bool = True) -> None:\n if not self._started:\n return\n self._state = LifecycleState.STOPPING\n self.workers.stop(timeout=timeout, force=force)\n if stop_control_plane:\n self.control_plane.stop()\n self._started = False\n self._state = LifecycleState.STOPPED\n\n def status(self) -> dict[str, object]:\n self._refresh_state()\n return self.control_plane.snapshot(self)\n\n def current_health(self) -> HealthPayload:\n self._refresh_state()\n return self.health.payload(self._state, self.workers.healths())\n\n async def health_status(self) -> HealthPayload:\n return self.current_health()\n\n async def start_runtime(self) -> dict[str, object] | str:\n self._refresh_state()\n if self._started:\n return \"runtime already running\"\n if self._state == LifecycleState.STOPPING:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n\n self.start(start_control_plane=False)\n started = self._wait_for_state({LifecycleState.IDLE, LifecycleState.BUSY}, timeout=self.ACTION_TIMEOUT_SECONDS)\n if started:\n return self._action_detail(\"runtime started\", timed_out=False)\n return self._action_detail(\"runtime start is still in progress\", timed_out=True)\n\n async def stop_runtime(self) -> dict[str, object] | str:\n self._refresh_state()\n if not self._started:\n if self._state == LifecycleState.STOPPING:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n return \"runtime already stopped\"\n\n self._state = LifecycleState.STOPPING\n try:\n self.workers.stop(timeout=self.ACTION_TIMEOUT_SECONDS, force=False)\n except TimeoutError:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n\n self._started = False\n self._state = LifecycleState.STOPPED\n return self._action_detail(\"runtime stopped\", timed_out=False)\n\n async def runtime_status(self) -> str:\n self._refresh_state()\n return self._state.value\n\n def _register_core_services(self) -> None:\n if self._core_registered:\n return\n self.services.register(\"configuration\", self.configuration)\n self.services.register(\"traces\", self.traces)\n self.services.register(\"health\", self.health)\n self.services.register(\"logs\", self.logs)\n self.services.register(\"workers\", self.workers)\n self.services.register(\"control_plane\", self.control_plane)\n self._core_registered = True\n\n def _register_health_contributors(self) -> None:\n for contributor in self.registry.health_contributors:\n self.health.register(contributor)\n\n def _register_workers(self) -> None:\n if self._workers_registered:\n return\n for worker in self.registry.workers:\n self.workers.register(worker)\n self._workers_registered = True\n\n def _refresh_state(self) -> None:\n lifecycle = self.workers.lifecycle_state()\n\n if self._state == LifecycleState.STOPPING:\n if lifecycle == LifecycleState.STOPPED:\n self._started = False\n self._state = LifecycleState.STOPPED\n return\n\n if not self._started:\n if lifecycle == LifecycleState.STOPPED:\n self._state = LifecycleState.STOPPED\n return\n\n self._state = lifecycle\n\n def _wait_for_state(self, target_states: set[LifecycleState], *, timeout: float) -> bool:\n deadline = monotonic() + timeout\n while monotonic() < deadline:\n self._refresh_state()\n if self._state in target_states:\n return True\n sleep(self.ACTION_POLL_INTERVAL_SECONDS)\n self._refresh_state()\n return self._state in target_states\n\n def _action_detail(self, message: str, *, timed_out: bool) -> dict[str, object]:\n self._refresh_state()\n return {\n \"message\": message,\n \"state\": self._state.value,\n \"timed_out\": timed_out,\n \"workers\": self.workers.snapshot(),\n }", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/core/runtime.py:RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.core.runtime", - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ] - }, - "diagnostics": { - "execution": { - "executed_layers": [ - "C0_SOURCE_CHUNKS" - ], - "retrieval_mode_by_layer": { - "C0_SOURCE_CHUNKS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C0_SOURCE_CHUNKS": 200 - }, - "filters_by_layer": { - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src/app_runtime/core/runtime.py" - ], - "include_globs": [], - "exclude_globs": [], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Открой файл src/app_runtime/core/runtime.py", - "path_scope": [ - "src/app_runtime/core/runtime.py" - ], - "include_globs": [], - "exclude_globs": [], - "prefer_globs": [], - "top_k": 200, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src/app_runtime/core/runtime.py" - ], - "normalized_include_globs": [], - "normalized_exclude_globs": [], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 1, - "candidates_after_filter": 1 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "not_requested", - "resolved_symbol": null, - "alternatives": [] - }, - "layers": [ - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 1, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "symbol_resolution": 0, - "retrieval_total": 127, - "retrieval_by_layer": { - "C0_SOURCE_CHUNKS": 127 - }, - "merge_rank": 0 - } - } - }, - { - "step": "llm_answer", - "input": { - "query": "Открой файл src/app_runtime/core/runtime.py", - "rag_count": 1 - }, - "output": { - "llm_answer": "1. путь к файлу: src/app_runtime/core/runtime.py\n2. В доступных фрагментах видна реализация класса RuntimeManager.\n3. Top-level сущности и секции: класс RuntimeManager с методом __init__, методом _register_core_services и частично реализованным методом register_module.\n4. Важные элементы для вопроса пользователя:\n- Константы ACTION_TIMEOUT_SECONDS и ACTION_POLL_INTERVAL_SECONDS.\n- Инициализация различных служб (ConfigurationManager, ServiceContainer, TraceService и др.) через конструктор класса.\n- Метод _register_core_services, вероятно, отвечает за регистрацию основных сервисов. \n\nОтвет основан только на доступных фрагментах. Полный контекст файла может содержать дополнительную информацию." - }, - "diagnostics": { - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 600, - "evidence_rows": 1, - "evidence_chars": 6265 - }, - "evidence_summary": [ - { - "layer": "C0_SOURCE_CHUNKS", - "count": 1, - "unique_paths": 1 - } - ], - "prompt_template_id": "intent_code_qa_open_file_ru_v2", - "system_prompt_version": "v1" - }, - "timings_ms": { - "prompt_build": 0, - "llm_call": 1212 - } - } - } - ] - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_125536/full_chain_plba_code_subintents_v2_plba-v2-open-file-runtime.md b/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_125536/full_chain_plba_code_subintents_v2_plba-v2-open-file-runtime.md deleted file mode 100644 index 2e20d89..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_125536/full_chain_plba_code_subintents_v2_plba-v2-open-file-runtime.md +++ /dev/null @@ -1,30 +0,0 @@ -# plba-v2-open-file-runtime - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_subintents_v2.yaml -- runner: runtime -- mode: full_chain -- passed: True - -## Query -Открой файл src/app_runtime/core/runtime.py - -## Actual -{ - "intent": "CODE_QA", - "sub_intent": "OPEN_FILE", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 1, - "llm_answer": "1. путь к файлу: src/app_runtime/core/runtime.py\n2. В доступных фрагментах видна реализация класса RuntimeManager.\n3. Top-level сущности и секции: класс RuntimeManager с методом __init__, методом _register_core_services и частично реализованным методом register_module.\n4. Важные элементы для вопроса пользователя:\n- Константы ACTION_TIMEOUT_SECONDS и ACTION_POLL_INTERVAL_SECONDS.\n- Инициализация различных служб (ConfigurationManager, ServiceContainer, TraceService и др.) через конструктор класса.\n- Метод _register_core_services, вероятно, отвечает за регистрацию основных сервисов. \n\nОтвет основан только на доступных фрагментах. Полный контекст файла может содержать дополнительную информацию.", - "answer_mode": "answered", - "path_scope": [ - "src/app_runtime/core/runtime.py" - ], - "symbol_candidates": [], - "layers": [ - "C0_SOURCE_CHUNKS" - ] -} - -## Mismatches -- none \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_125536/full_chain_plba_code_subintents_v2_plba-v2-trace-flow-health-endpoint.json b/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_125536/full_chain_plba_code_subintents_v2_plba-v2-trace-flow-health-endpoint.json deleted file mode 100644 index dd71e3a..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_125536/full_chain_plba_code_subintents_v2_plba-v2-trace-flow-health-endpoint.json +++ /dev/null @@ -1,2306 +0,0 @@ -{ - "case_id": "plba-v2-trace-flow-health-endpoint", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_subintents_v2.yaml", - "runner": "runtime", - "mode": "full_chain", - "actual": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 15, - "llm_answer": "1. Что это и где определено.\nСущность `HttpControlAppFactory` определена в файле `src/app_runtime/control/http_app.py`.\n\n2. Назначение по наблюдаемому коду.\nПо предоставленному контексту видно, что `HttpControlAppFactory` является фабрикой для создания экземпляра класса `FastAPI`. В частности, он отвечает за создание конечных точек `/health` и `/actions/{action}`, а также применяет middleware для логирования времени выполнения запросов.\n\n3. Подтверждённые зависимости или взаимодействия.\nЗависит от двух провайдеров: \n- `health_provider`: предоставляет данные о состоянии системы (`HealthPayload`), которые затем используются при обработке запроса `/health`.\n- `action_provider`: предоставляет асинхронную функцию для выполнения действий на основе переданного действия (например, \"start\" или \"stop\").\n\n4. Что делает по шагам, если это видно в контексте.\n- Создаёт экземпляр `FastAPI` с названием \"PLBA Control API\".\n- Добавляет middleware для логирования времени выполнения HTTP-запросов.\n- Обрабатывает запрос `/health`, вызывая функцию `health_provider` и возвращая JSON-ответ с соответствующим статусом.\n- Обрабатывает запросы `/actions/{action}` и `/actions/{action} POST`, выполняя действие через `action_provider` и регистрируя предупреждение в журнале.\n\n5. Осторожные выводы.\nНа данный момент отсутствуют явные признаки проблем или потенциальных рисков использования данной сущности. Однако для более глубокого понимания её работы может потребоваться анализ дополнительных компонентов и их взаимодействий.\n\n6. Чего не хватает для полного объяснения.\nДля полной уверенности в понимании работы данного класса необходимо рассмотреть следующие аспекты:\n- Реализацию функций `health_provider` и `action_provider`, чтобы понять детали того, какие действия выполняются внутри них.\n- Логику журнала регистрации предупреждений, особенно когда инициируется контрольное действие (\"Control action requested\"). \n- Потенциально связанные классы и функции, такие как `ControlActionSet`, упомянутые в C1_SYMBOL_CATALOG, но не описанные явно в данном контексте.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "health", - "HttpControlAppFactory" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "passed": false, - "mismatches": [ - "sub_intent: expected TRACE_FLOW, got EXPLAIN" - ], - "details": { - "case_id": "plba-v2-trace-flow-health-endpoint", - "text": "Покажи поток запроса /health в HttpControlAppFactory", - "mode": "full_chain", - "run_started_at": "2026-03-12T12:55:37", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Покажи поток запроса /health в HttpControlAppFactory", - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "HttpControlAppFactory", - "alternatives": [ - "HttpControlAppFactory", - "ControlActionSet", - "HealthContributor.health", - "HealthContributor" - ], - "confidence": 0.99 - }, - "rag_count": 15, - "rag_rows": [ - { - "path": "src/app_runtime/control/http_app.py", - "content": "class HttpControlAppFactory\nHttpControlAppFactory", - "layer": "C1_SYMBOL_CATALOG", - "title": "HttpControlAppFactory", - "span_start": 15, - "span_end": 53, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "9b3502a5fb408b273223db13264349cf500de24915b6c649d9ea8970d0dfd8e0", - "qname": "HttpControlAppFactory", - "kind": "class", - "signature": "HttpControlAppFactory", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.control.http_app", - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "class ControlActionSet\nControlActionSet", - "layer": "C1_SYMBOL_CATALOG", - "title": "ControlActionSet", - "span_start": 14, - "span_end": 18, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "46eb026cb3313415ec47b82dd22f84f4d112c9d987e8b1716dcb0baa1cce8988", - "qname": "ControlActionSet", - "kind": "class", - "signature": "ControlActionSet", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.control.base", - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/contracts/health.py", - "content": "method HealthContributor.health\nhealth(self)\nReturn contributor health state.", - "layer": "C1_SYMBOL_CATALOG", - "title": "HealthContributor.health", - "span_start": 9, - "span_end": 10, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "728cff18958d8a25e2661a0f08c83d68c3bbbfa8cef212b85dc0da2b11b3dc90", - "qname": "HealthContributor.health", - "kind": "method", - "signature": "health(self)", - "parent_symbol_id": "HealthContributor", - "package_or_module": "src.app_runtime.contracts.health", - "is_test": false, - "blob_sha": "6bd92611def7131e32d4dd34a8ed85e6cf3c67722ad27797032a632cb30dc097", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/contracts/health.py", - "content": "class HealthContributor\nHealthContributor(ABC)", - "layer": "C1_SYMBOL_CATALOG", - "title": "HealthContributor", - "span_start": 7, - "span_end": 10, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "db91ae387b89a2e9d83829754f27fa18a4055b3e72d7f31789a0b8e0bf5bba0b", - "qname": "HealthContributor", - "kind": "class", - "signature": "HealthContributor(ABC)", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.contracts.health", - "is_test": false, - "blob_sha": "6bd92611def7131e32d4dd34a8ed85e6cf3c67722ad27797032a632cb30dc097", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "HttpControlAppFactory\nrole: factory\n\nResponsibilities:\n- name suffix suggests factory", - "layer": "C4_SEMANTIC_ROLES", - "title": "HttpControlAppFactory", - "span_start": 15, - "span_end": 53, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 39, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "9b3502a5fb408b273223db13264349cf500de24915b6c649d9ea8970d0dfd8e0", - "symbol_name": "HttpControlAppFactory", - "qname": "HttpControlAppFactory", - "role": "factory", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.stop", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 25, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d", - "dst_ref": "ControlPlaneService.stop", - "resolution": "resolved", - "slice_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.stop" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._stop_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 51, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a", - "dst_ref": "ControlPlaneService._stop_async", - "resolution": "resolved", - "slice_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._stop_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.register_channel", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 17, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957", - "dst_ref": "ControlPlaneService.register_channel", - "resolution": "resolved", - "slice_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.register_channel" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.start", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 20, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154", - "dst_ref": "ControlPlaneService.start", - "resolution": "resolved", - "slice_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.start" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._start_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 47, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517", - "dst_ref": "ControlPlaneService._start_async", - "resolution": "resolved", - "slice_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._start_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/health/registry.py", - "content": "HealthRegistry.__init__\n -> HealthRegistry._contributors\n -> HealthRegistry.register", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "HealthRegistry.__init__:dataflow_slice", - "span_start": 10, - "span_end": 13, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "2381dfb339d541367c3251d2a610cac9d8b3f6bd6a352e119d00a93c5ccc2b7d", - "edge_type": "dataflow_slice", - "src_symbol_id": "e8ffd58441c231de43d9e86c31eb12303d4e2bf045b2acf13d1dfe78da01f8dc", - "src_qname": "HealthRegistry.__init__", - "dst_symbol_id": "a9e1f290c346c8bb1d67af0cafeebb5bcaf29c3ed7027e33c794532743df38f2", - "dst_ref": "HealthRegistry.register", - "resolution": "resolved", - "slice_id": "2381dfb339d541367c3251d2a610cac9d8b3f6bd6a352e119d00a93c5ccc2b7d", - "root_symbol_id": "e8ffd58441c231de43d9e86c31eb12303d4e2bf045b2acf13d1dfe78da01f8dc", - "path_symbols": [ - "HealthRegistry.__init__", - "HealthRegistry._contributors", - "HealthRegistry.register" - ], - "path_symbol_ids": [ - "e8ffd58441c231de43d9e86c31eb12303d4e2bf045b2acf13d1dfe78da01f8dc", - "a9e1f290c346c8bb1d67af0cafeebb5bcaf29c3ed7027e33c794532743df38f2" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "26e6a24daa43407ba5340b74497c20153020e79f8d7828ae502aaec378dfcf75", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "class HttpControlAppFactory:\n def create(\n self,\n health_provider: Callable[[], Awaitable[HealthPayload]],\n action_provider: Callable[[str, str], Awaitable[JSONResponse]],\n ) -> FastAPI:\n app = FastAPI(title=\"PLBA Control API\")\n\n @app.middleware(\"http\")\n async def log_api_call(request: Request, call_next): # type: ignore[no-untyped-def]\n started = time.monotonic()\n response = await call_next(request)\n response.headers[\"X-Response-Time-Ms\"] = str(int((time.monotonic() - started) * 1000))\n return response\n\n @app.get(\"/health\")\n async def health() -> JSONResponse:\n payload = await health_provider()\n status_code = 200 if payload.get(\"status\") == \"ok\" else 503\n return JSONResponse(content=payload, status_code=status_code)\n\n @app.get(\"/actions/{action}\")\n @app.post(\"/actions/{action}\")\n async def action(action: str, request: Request) -> JSONResponse:\n client_source = self._client_source(request)\n if action in {\"start\", \"stop\"}:\n LOGGER.warning(\"Control action requested: /actions/%s client=%s\", action, client_source)\n return await action_provider(action, client_source)\n\n return app\n\n def _client_source(self, request: Request) -> str:\n explicit_header = request.headers.get(\"X-Client-Source\", \"\").strip()\n if explicit_header:\n return explicit_header\n user_agent = request.headers.get(\"User-Agent\", \"\").strip()\n if user_agent:\n return f\"user-agent:{user_agent}\"\n return \"unknown\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/http_app.py:HttpControlAppFactory", - "span_start": 15, - "span_end": 53, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.http_app", - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "llm_answer": "1. Что это и где определено.\nСущность `HttpControlAppFactory` определена в файле `src/app_runtime/control/http_app.py`.\n\n2. Назначение по наблюдаемому коду.\nПо предоставленному контексту видно, что `HttpControlAppFactory` является фабрикой для создания экземпляра класса `FastAPI`. В частности, он отвечает за создание конечных точек `/health` и `/actions/{action}`, а также применяет middleware для логирования времени выполнения запросов.\n\n3. Подтверждённые зависимости или взаимодействия.\nЗависит от двух провайдеров: \n- `health_provider`: предоставляет данные о состоянии системы (`HealthPayload`), которые затем используются при обработке запроса `/health`.\n- `action_provider`: предоставляет асинхронную функцию для выполнения действий на основе переданного действия (например, \"start\" или \"stop\").\n\n4. Что делает по шагам, если это видно в контексте.\n- Создаёт экземпляр `FastAPI` с названием \"PLBA Control API\".\n- Добавляет middleware для логирования времени выполнения HTTP-запросов.\n- Обрабатывает запрос `/health`, вызывая функцию `health_provider` и возвращая JSON-ответ с соответствующим статусом.\n- Обрабатывает запросы `/actions/{action}` и `/actions/{action} POST`, выполняя действие через `action_provider` и регистрируя предупреждение в журнале.\n\n5. Осторожные выводы.\nНа данный момент отсутствуют явные признаки проблем или потенциальных рисков использования данной сущности. Однако для более глубокого понимания её работы может потребоваться анализ дополнительных компонентов и их взаимодействий.\n\n6. Чего не хватает для полного объяснения.\nДля полной уверенности в понимании работы данного класса необходимо рассмотреть следующие аспекты:\n- Реализацию функций `health_provider` и `action_provider`, чтобы понять детали того, какие действия выполняются внутри них.\n- Логику журнала регистрации предупреждений, особенно когда инициируется контрольное действие (\"Control action requested\"). \n- Потенциально связанные классы и функции, такие как `ControlActionSet`, упомянутые в C1_SYMBOL_CATALOG, но не описанные явно в данном контексте.", - "summary": { - "router": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "confidence": null - }, - "retrieval": { - "profile": "code", - "layers_hit": [ - "C0_SOURCE_CHUNKS", - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS", - "C4_SEMANTIC_ROLES" - ], - "evidence_sufficient": true - }, - "llm": { - "answer_status": "answered", - "groundedness": "grounded" - } - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "symbol_kind_hint": "unknown", - "symbol_candidates": [ - "health", - "HttpControlAppFactory" - ], - "keyword_hints": [ - "health", - "HttpControlAppFactory" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C0_SOURCE_CHUNKS": "exact_path_fetch", - "C4_SEMANTIC_ROLES": "exact_path_fetch", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C3_ENTRYPOINTS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 8, - "C4_SEMANTIC_ROLES": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C3_ENTRYPOINTS": 6 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C4_SEMANTIC_ROLES": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "health HttpControlAppFactory", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "health HttpControlAppFactory", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C4_SEMANTIC_ROLES", - "query": "health HttpControlAppFactory", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "health HttpControlAppFactory", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - }, - { - "layer": "C3_ENTRYPOINTS", - "query": "health HttpControlAppFactory", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 4, - "candidates_after_filter": 4 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 6, - "candidates_after_filter": 6 - }, - { - "layer": "C3_ENTRYPOINTS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 3, - "candidates_after_filter": 3 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "HttpControlAppFactory", - "alternatives": [ - "HttpControlAppFactory", - "ControlActionSet", - "HealthContributor.health", - "HealthContributor" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "hit", - "hit_count": 4, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C4_SEMANTIC_ROLES", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 6, - "fail_reason": null - }, - { - "layer": "C3_ENTRYPOINTS", - "status": "hit", - "hit_count": 3, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "router": 0, - "symbol_resolution": 0, - "retrieval_total": 124, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 35, - "C0_SOURCE_CHUNKS": 14, - "C4_SEMANTIC_ROLES": 12, - "C2_DEPENDENCY_GRAPH": 52, - "C3_ENTRYPOINTS": 10 - }, - "merge_rank": 33, - "prompt_build": 0, - "llm_call": 3151 - }, - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 820, - "evidence_rows": 15, - "evidence_chars": 2588 - }, - "evidence_summary": [ - { - "layer": "C1_SYMBOL_CATALOG", - "count": 4, - "unique_paths": 3 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "count": 6, - "unique_paths": 2 - }, - { - "layer": "C3_ENTRYPOINTS", - "count": 3, - "unique_paths": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 1, - "unique_paths": 1 - } - ], - "prompt_template_id": "intent_code_qa_explain_ru_v2", - "system_prompt_version": "v1" - }, - "router": { - "conversation_mode": "START", - "keyword_hints": [ - "health", - "HttpControlAppFactory" - ], - "path_scope": [] - }, - "llm": { - "used_evidence_count": 15, - "missing_evidence_reason": null - } - }, - "run_info": { - "case_id": "plba-v2-trace-flow-health-endpoint", - "mode": "full_chain", - "run_started_at": "2026-03-12T12:55:37", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - }, - "input_request": { - "text": "Покажи поток запроса /health в HttpControlAppFactory", - "normalized_query": "Покажи поток запроса /health в HttpControlAppFactory" - }, - "steps": [ - { - "step": "intent_router", - "input": { - "query": "Покажи поток запроса /health в HttpControlAppFactory" - }, - "output": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Покажи поток запроса /health в HttpControlAppFactory" - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "symbol_kind_hint": "unknown", - "symbol_candidates": [ - "health", - "HttpControlAppFactory" - ], - "keyword_hints": [ - "health", - "HttpControlAppFactory" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "timings_ms": { - "router": 0 - } - } - }, - { - "step": "retrieval", - "input": { - "query": "Покажи поток запроса /health в HttpControlAppFactory" - }, - "output": { - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "HttpControlAppFactory", - "alternatives": [ - "HttpControlAppFactory", - "ControlActionSet", - "HealthContributor.health", - "HealthContributor" - ], - "confidence": 0.99 - }, - "rag_count": 15, - "rag_rows": [ - { - "path": "src/app_runtime/control/http_app.py", - "content": "class HttpControlAppFactory\nHttpControlAppFactory", - "layer": "C1_SYMBOL_CATALOG", - "title": "HttpControlAppFactory", - "span_start": 15, - "span_end": 53, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "9b3502a5fb408b273223db13264349cf500de24915b6c649d9ea8970d0dfd8e0", - "qname": "HttpControlAppFactory", - "kind": "class", - "signature": "HttpControlAppFactory", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.control.http_app", - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "class ControlActionSet\nControlActionSet", - "layer": "C1_SYMBOL_CATALOG", - "title": "ControlActionSet", - "span_start": 14, - "span_end": 18, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "46eb026cb3313415ec47b82dd22f84f4d112c9d987e8b1716dcb0baa1cce8988", - "qname": "ControlActionSet", - "kind": "class", - "signature": "ControlActionSet", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.control.base", - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/contracts/health.py", - "content": "method HealthContributor.health\nhealth(self)\nReturn contributor health state.", - "layer": "C1_SYMBOL_CATALOG", - "title": "HealthContributor.health", - "span_start": 9, - "span_end": 10, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "728cff18958d8a25e2661a0f08c83d68c3bbbfa8cef212b85dc0da2b11b3dc90", - "qname": "HealthContributor.health", - "kind": "method", - "signature": "health(self)", - "parent_symbol_id": "HealthContributor", - "package_or_module": "src.app_runtime.contracts.health", - "is_test": false, - "blob_sha": "6bd92611def7131e32d4dd34a8ed85e6cf3c67722ad27797032a632cb30dc097", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/contracts/health.py", - "content": "class HealthContributor\nHealthContributor(ABC)", - "layer": "C1_SYMBOL_CATALOG", - "title": "HealthContributor", - "span_start": 7, - "span_end": 10, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "db91ae387b89a2e9d83829754f27fa18a4055b3e72d7f31789a0b8e0bf5bba0b", - "qname": "HealthContributor", - "kind": "class", - "signature": "HealthContributor(ABC)", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.contracts.health", - "is_test": false, - "blob_sha": "6bd92611def7131e32d4dd34a8ed85e6cf3c67722ad27797032a632cb30dc097", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "HttpControlAppFactory\nrole: factory\n\nResponsibilities:\n- name suffix suggests factory", - "layer": "C4_SEMANTIC_ROLES", - "title": "HttpControlAppFactory", - "span_start": 15, - "span_end": 53, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 39, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "9b3502a5fb408b273223db13264349cf500de24915b6c649d9ea8970d0dfd8e0", - "symbol_name": "HttpControlAppFactory", - "qname": "HttpControlAppFactory", - "role": "factory", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.stop", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 25, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d", - "dst_ref": "ControlPlaneService.stop", - "resolution": "resolved", - "slice_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.stop" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._stop_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 51, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a", - "dst_ref": "ControlPlaneService._stop_async", - "resolution": "resolved", - "slice_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._stop_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.register_channel", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 17, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957", - "dst_ref": "ControlPlaneService.register_channel", - "resolution": "resolved", - "slice_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.register_channel" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.start", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 20, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154", - "dst_ref": "ControlPlaneService.start", - "resolution": "resolved", - "slice_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.start" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._start_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 47, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517", - "dst_ref": "ControlPlaneService._start_async", - "resolution": "resolved", - "slice_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._start_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/health/registry.py", - "content": "HealthRegistry.__init__\n -> HealthRegistry._contributors\n -> HealthRegistry.register", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "HealthRegistry.__init__:dataflow_slice", - "span_start": 10, - "span_end": 13, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "2381dfb339d541367c3251d2a610cac9d8b3f6bd6a352e119d00a93c5ccc2b7d", - "edge_type": "dataflow_slice", - "src_symbol_id": "e8ffd58441c231de43d9e86c31eb12303d4e2bf045b2acf13d1dfe78da01f8dc", - "src_qname": "HealthRegistry.__init__", - "dst_symbol_id": "a9e1f290c346c8bb1d67af0cafeebb5bcaf29c3ed7027e33c794532743df38f2", - "dst_ref": "HealthRegistry.register", - "resolution": "resolved", - "slice_id": "2381dfb339d541367c3251d2a610cac9d8b3f6bd6a352e119d00a93c5ccc2b7d", - "root_symbol_id": "e8ffd58441c231de43d9e86c31eb12303d4e2bf045b2acf13d1dfe78da01f8dc", - "path_symbols": [ - "HealthRegistry.__init__", - "HealthRegistry._contributors", - "HealthRegistry.register" - ], - "path_symbol_ids": [ - "e8ffd58441c231de43d9e86c31eb12303d4e2bf045b2acf13d1dfe78da01f8dc", - "a9e1f290c346c8bb1d67af0cafeebb5bcaf29c3ed7027e33c794532743df38f2" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "26e6a24daa43407ba5340b74497c20153020e79f8d7828ae502aaec378dfcf75", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "class HttpControlAppFactory:\n def create(\n self,\n health_provider: Callable[[], Awaitable[HealthPayload]],\n action_provider: Callable[[str, str], Awaitable[JSONResponse]],\n ) -> FastAPI:\n app = FastAPI(title=\"PLBA Control API\")\n\n @app.middleware(\"http\")\n async def log_api_call(request: Request, call_next): # type: ignore[no-untyped-def]\n started = time.monotonic()\n response = await call_next(request)\n response.headers[\"X-Response-Time-Ms\"] = str(int((time.monotonic() - started) * 1000))\n return response\n\n @app.get(\"/health\")\n async def health() -> JSONResponse:\n payload = await health_provider()\n status_code = 200 if payload.get(\"status\") == \"ok\" else 503\n return JSONResponse(content=payload, status_code=status_code)\n\n @app.get(\"/actions/{action}\")\n @app.post(\"/actions/{action}\")\n async def action(action: str, request: Request) -> JSONResponse:\n client_source = self._client_source(request)\n if action in {\"start\", \"stop\"}:\n LOGGER.warning(\"Control action requested: /actions/%s client=%s\", action, client_source)\n return await action_provider(action, client_source)\n\n return app\n\n def _client_source(self, request: Request) -> str:\n explicit_header = request.headers.get(\"X-Client-Source\", \"\").strip()\n if explicit_header:\n return explicit_header\n user_agent = request.headers.get(\"User-Agent\", \"\").strip()\n if user_agent:\n return f\"user-agent:{user_agent}\"\n return \"unknown\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/http_app.py:HttpControlAppFactory", - "span_start": 15, - "span_end": 53, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.http_app", - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ] - }, - "diagnostics": { - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C0_SOURCE_CHUNKS": "exact_path_fetch", - "C4_SEMANTIC_ROLES": "exact_path_fetch", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C3_ENTRYPOINTS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 8, - "C4_SEMANTIC_ROLES": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C3_ENTRYPOINTS": 6 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C4_SEMANTIC_ROLES": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "health HttpControlAppFactory", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "health HttpControlAppFactory", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C4_SEMANTIC_ROLES", - "query": "health HttpControlAppFactory", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "health HttpControlAppFactory", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - }, - { - "layer": "C3_ENTRYPOINTS", - "query": "health HttpControlAppFactory", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 4, - "candidates_after_filter": 4 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 6, - "candidates_after_filter": 6 - }, - { - "layer": "C3_ENTRYPOINTS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 3, - "candidates_after_filter": 3 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "HttpControlAppFactory", - "alternatives": [ - "HttpControlAppFactory", - "ControlActionSet", - "HealthContributor.health", - "HealthContributor" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "hit", - "hit_count": 4, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C4_SEMANTIC_ROLES", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 6, - "fail_reason": null - }, - { - "layer": "C3_ENTRYPOINTS", - "status": "hit", - "hit_count": 3, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "symbol_resolution": 0, - "retrieval_total": 124, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 35, - "C0_SOURCE_CHUNKS": 14, - "C4_SEMANTIC_ROLES": 12, - "C2_DEPENDENCY_GRAPH": 52, - "C3_ENTRYPOINTS": 10 - }, - "merge_rank": 33 - } - } - }, - { - "step": "llm_answer", - "input": { - "query": "Покажи поток запроса /health в HttpControlAppFactory", - "rag_count": 15 - }, - "output": { - "llm_answer": "1. Что это и где определено.\nСущность `HttpControlAppFactory` определена в файле `src/app_runtime/control/http_app.py`.\n\n2. Назначение по наблюдаемому коду.\nПо предоставленному контексту видно, что `HttpControlAppFactory` является фабрикой для создания экземпляра класса `FastAPI`. В частности, он отвечает за создание конечных точек `/health` и `/actions/{action}`, а также применяет middleware для логирования времени выполнения запросов.\n\n3. Подтверждённые зависимости или взаимодействия.\nЗависит от двух провайдеров: \n- `health_provider`: предоставляет данные о состоянии системы (`HealthPayload`), которые затем используются при обработке запроса `/health`.\n- `action_provider`: предоставляет асинхронную функцию для выполнения действий на основе переданного действия (например, \"start\" или \"stop\").\n\n4. Что делает по шагам, если это видно в контексте.\n- Создаёт экземпляр `FastAPI` с названием \"PLBA Control API\".\n- Добавляет middleware для логирования времени выполнения HTTP-запросов.\n- Обрабатывает запрос `/health`, вызывая функцию `health_provider` и возвращая JSON-ответ с соответствующим статусом.\n- Обрабатывает запросы `/actions/{action}` и `/actions/{action} POST`, выполняя действие через `action_provider` и регистрируя предупреждение в журнале.\n\n5. Осторожные выводы.\nНа данный момент отсутствуют явные признаки проблем или потенциальных рисков использования данной сущности. Однако для более глубокого понимания её работы может потребоваться анализ дополнительных компонентов и их взаимодействий.\n\n6. Чего не хватает для полного объяснения.\nДля полной уверенности в понимании работы данного класса необходимо рассмотреть следующие аспекты:\n- Реализацию функций `health_provider` и `action_provider`, чтобы понять детали того, какие действия выполняются внутри них.\n- Логику журнала регистрации предупреждений, особенно когда инициируется контрольное действие (\"Control action requested\"). \n- Потенциально связанные классы и функции, такие как `ControlActionSet`, упомянутые в C1_SYMBOL_CATALOG, но не описанные явно в данном контексте." - }, - "diagnostics": { - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 820, - "evidence_rows": 15, - "evidence_chars": 2588 - }, - "evidence_summary": [ - { - "layer": "C1_SYMBOL_CATALOG", - "count": 4, - "unique_paths": 3 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "count": 6, - "unique_paths": 2 - }, - { - "layer": "C3_ENTRYPOINTS", - "count": 3, - "unique_paths": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 1, - "unique_paths": 1 - } - ], - "prompt_template_id": "intent_code_qa_explain_ru_v2", - "system_prompt_version": "v1" - }, - "timings_ms": { - "prompt_build": 0, - "llm_call": 3151 - } - } - } - ] - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_125536/full_chain_plba_code_subintents_v2_plba-v2-trace-flow-health-endpoint.md b/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_125536/full_chain_plba_code_subintents_v2_plba-v2-trace-flow-health-endpoint.md deleted file mode 100644 index a6e9ece..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_125536/full_chain_plba_code_subintents_v2_plba-v2-trace-flow-health-endpoint.md +++ /dev/null @@ -1,35 +0,0 @@ -# plba-v2-trace-flow-health-endpoint - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_subintents_v2.yaml -- runner: runtime -- mode: full_chain -- passed: False - -## Query -Покажи поток запроса /health в HttpControlAppFactory - -## Actual -{ - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 15, - "llm_answer": "1. Что это и где определено.\nСущность `HttpControlAppFactory` определена в файле `src/app_runtime/control/http_app.py`.\n\n2. Назначение по наблюдаемому коду.\nПо предоставленному контексту видно, что `HttpControlAppFactory` является фабрикой для создания экземпляра класса `FastAPI`. В частности, он отвечает за создание конечных точек `/health` и `/actions/{action}`, а также применяет middleware для логирования времени выполнения запросов.\n\n3. Подтверждённые зависимости или взаимодействия.\nЗависит от двух провайдеров: \n- `health_provider`: предоставляет данные о состоянии системы (`HealthPayload`), которые затем используются при обработке запроса `/health`.\n- `action_provider`: предоставляет асинхронную функцию для выполнения действий на основе переданного действия (например, \"start\" или \"stop\").\n\n4. Что делает по шагам, если это видно в контексте.\n- Создаёт экземпляр `FastAPI` с названием \"PLBA Control API\".\n- Добавляет middleware для логирования времени выполнения HTTP-запросов.\n- Обрабатывает запрос `/health`, вызывая функцию `health_provider` и возвращая JSON-ответ с соответствующим статусом.\n- Обрабатывает запросы `/actions/{action}` и `/actions/{action} POST`, выполняя действие через `action_provider` и регистрируя предупреждение в журнале.\n\n5. Осторожные выводы.\nНа данный момент отсутствуют явные признаки проблем или потенциальных рисков использования данной сущности. Однако для более глубокого понимания её работы может потребоваться анализ дополнительных компонентов и их взаимодействий.\n\n6. Чего не хватает для полного объяснения.\nДля полной уверенности в понимании работы данного класса необходимо рассмотреть следующие аспекты:\n- Реализацию функций `health_provider` и `action_provider`, чтобы понять детали того, какие действия выполняются внутри них.\n- Логику журнала регистрации предупреждений, особенно когда инициируется контрольное действие (\"Control action requested\"). \n- Потенциально связанные классы и функции, такие как `ControlActionSet`, упомянутые в C1_SYMBOL_CATALOG, но не описанные явно в данном контексте.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "health", - "HttpControlAppFactory" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] -} - -## Mismatches -- sub_intent: expected TRACE_FLOW, got EXPLAIN \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_125536/full_chain_plba_code_subintents_v2_plba-v2-trace-flow-runtime-start.json b/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_125536/full_chain_plba_code_subintents_v2_plba-v2-trace-flow-runtime-start.json deleted file mode 100644 index 87ce4c5..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_125536/full_chain_plba_code_subintents_v2_plba-v2-trace-flow-runtime-start.json +++ /dev/null @@ -1,1219 +0,0 @@ -{ - "case_id": "plba-v2-trace-flow-runtime-start", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_subintents_v2.yaml", - "runner": "runtime", - "mode": "full_chain", - "actual": { - "intent": "CODE_QA", - "sub_intent": "FIND_ENTRYPOINTS", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 9, - "llm_answer": "Подтверждённые точки входа:\nsrc/app_runtime/control/http_app.py | fastapi http app.get\n- Объявлена как точка входа через декоратор fastapi http app.get\n\nsrc/app_runtime/control/http_app.py | fastapi http app.post\n- Объявлена как точка входа через декоратор fastapi http app.post\n\nВозможные кандидаты:\nsrc/app_runtime/control/http_channel.py | HttpControlChannel.start\n- Признак: метод класса с вызовом старта runner'а (_runner.start(app)), но сам запуск не виден явно извне.\n\nsrc/app_runtime/control/http_channel.py | HttpControlChannel.__init__\n- Признак: инициализация объекта, которая может быть точкой входа при использовании паттерна singleton, но признаков явного вызова нет.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "RuntimeManager" - ], - "layers": [ - "C3_ENTRYPOINTS", - "C0_SOURCE_CHUNKS" - ] - }, - "passed": false, - "mismatches": [ - "sub_intent: expected TRACE_FLOW, got FIND_ENTRYPOINTS", - "layers should include 'C2_DEPENDENCY_GRAPH', got ['C3_ENTRYPOINTS', 'C0_SOURCE_CHUNKS']" - ], - "details": { - "case_id": "plba-v2-trace-flow-runtime-start", - "text": "Покажи поток запуска RuntimeManager", - "mode": "full_chain", - "run_started_at": "2026-03-12T12:55:37", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Покажи поток запуска RuntimeManager", - "symbol_resolution": { - "status": "not_found", - "resolved_symbol": null, - "alternatives": [ - "RuntimeManager" - ], - "confidence": 0.0 - }, - "rag_count": 9, - "rag_rows": [ - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "class HttpControlChannel(ControlChannel):\n def __init__(self, host: str, port: int, timeout: int) -> None:\n self._timeout = timeout\n self._runner = UvicornThreadRunner(host, port, timeout)\n self._factory = HttpControlAppFactory()\n self._actions: ControlActionSet | None = None\n\n async def start(self, actions: ControlActionSet) -> None:\n self._actions = actions\n app = self._factory.create(self._health_response, self._action_response)\n await self._runner.start(app)\n\n async def stop(self) -> None:\n await self._runner.stop()\n\n @property\n def port(self) -> int:\n return self._runner.port\n\n async def _health_response(self) -> dict[str, object]:\n if self._actions is None:\n return {\"status\": \"unhealthy\", \"detail\": \"control actions are not configured\"}\n return await asyncio.wait_for(self._actions.health(), timeout=float(self._timeout))\n\n async def _action_response(self, action: str, _client_source: str = \"unknown\") -> JSONResponse:\n if self._actions is None:\n return JSONResponse(content={\"status\": \"error\", \"detail\": f\"{action} handler is not configured\"}, status_code=404)\n callbacks = {\n \"start\": self._actions.start,\n \"stop\": self._actions.stop,\n \"status\": self._actions.status,\n }\n callback = callbacks.get(action)\n if callback is None:\n return JSONResponse(content={\"status\": \"error\", \"detail\": f\"unsupported action: {action}\"}, status_code=404)\n action_timeout = max(float(self._timeout), 10.0) if action in {\"start\", \"stop\"} else float(self._timeout)\n try:\n detail = await asyncio.wait_for(callback(), timeout=action_timeout)\n except asyncio.TimeoutError:\n return JSONResponse(\n content={\"status\": \"accepted\", \"detail\": f\"{action} operation is still in progress\"},\n status_code=202,\n )\n except Exception as exc:\n return JSONResponse(content={\"status\": \"error\", \"detail\": str(exc)}, status_code=500)\n return JSONResponse(content={\"status\": \"ok\", \"detail\": detail or f\"{action} action accepted\"}, status_code=200)", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/http_channel.py:HttpControlChannel", - "span_start": 12, - "span_end": 57, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.http_channel", - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "class HttpControlAppFactory:\n def create(\n self,\n health_provider: Callable[[], Awaitable[HealthPayload]],\n action_provider: Callable[[str, str], Awaitable[JSONResponse]],\n ) -> FastAPI:\n app = FastAPI(title=\"PLBA Control API\")\n\n @app.middleware(\"http\")\n async def log_api_call(request: Request, call_next): # type: ignore[no-untyped-def]\n started = time.monotonic()\n response = await call_next(request)\n response.headers[\"X-Response-Time-Ms\"] = str(int((time.monotonic() - started) * 1000))\n return response\n\n @app.get(\"/health\")\n async def health() -> JSONResponse:\n payload = await health_provider()\n status_code = 200 if payload.get(\"status\") == \"ok\" else 503\n return JSONResponse(content=payload, status_code=status_code)\n\n @app.get(\"/actions/{action}\")\n @app.post(\"/actions/{action}\")\n async def action(action: str, request: Request) -> JSONResponse:\n client_source = self._client_source(request)\n if action in {\"start\", \"stop\"}:\n LOGGER.warning(\"Control action requested: /actions/%s client=%s\", action, client_source)\n return await action_provider(action, client_source)\n\n return app\n\n def _client_source(self, request: Request) -> str:\n explicit_header = request.headers.get(\"X-Client-Source\", \"\").strip()\n if explicit_header:\n return explicit_header\n user_agent = request.headers.get(\"User-Agent\", \"\").strip()\n if user_agent:\n return f\"user-agent:{user_agent}\"\n return \"unknown\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/http_app.py:HttpControlAppFactory", - "span_start": 15, - "span_end": 53, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.http_app", - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "class ControlActionSet:\n health: HealthHandler\n start: ActionHandler\n stop: ActionHandler\n status: ActionHandler", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/base.py:ControlActionSet", - "span_start": 14, - "span_end": 18, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.base", - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/__init__.py", - "content": "from app_runtime.control.base import ControlActionSet, ControlChannel\nfrom app_runtime.control.http_channel import HttpControlChannel\nfrom app_runtime.control.service import ControlPlaneService\n\n__all__ = [\"ControlActionSet\", \"ControlChannel\", \"ControlPlaneService\", \"HttpControlChannel\"]", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/__init__.py:1-5", - "span_start": 1, - "span_end": 5, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.app_runtime.control.__init__", - "is_test": false, - "blob_sha": "bf3c37e3369a84cc618adc0fd71c232e5eb4b871eaff743069a17e661e498316", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "class ControlChannel(ABC):\n @abstractmethod\n async def start(self, actions: ControlActionSet) -> None:\n \"\"\"Start the control channel and bind handlers.\"\"\"\n\n @abstractmethod\n async def stop(self) -> None:\n \"\"\"Stop the control channel and release resources.\"\"\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/base.py:ControlChannel", - "span_start": 21, - "span_end": 28, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 1, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.base", - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_runner.py", - "content": "class UvicornThreadRunner:\n def __init__(self, host: str, port: int, timeout: int) -> None:\n self._host = host\n self._port = port\n self._timeout = timeout\n self._server: Server | None = None\n self._thread: Thread | None = None\n self._error: BaseException | None = None\n\n async def start(self, app: FastAPI) -> None:\n if self._thread is not None and self._thread.is_alive():\n return\n self._error = None\n config = Config(app=app, host=self._host, port=self._port, log_level=\"warning\")\n self._server = Server(config)\n self._thread = Thread(target=self._serve, name=\"plba-http-control\", daemon=True)\n self._thread.start()\n await self._wait_until_started()\n\n async def stop(self) -> None:\n if self._server is None or self._thread is None:\n return\n self._server.should_exit = True\n await asyncio.to_thread(self._thread.join, self._timeout)\n self._server = None\n self._thread = None\n\n @property\n def port(self) -> int:\n if self._server is None or not getattr(self._server, \"servers\", None):\n return self._port\n socket = self._server.servers[0].sockets[0]\n return int(socket.getsockname()[1])\n\n async def _wait_until_started(self) -> None:\n if self._server is None:\n raise RuntimeError(\"Server is not initialized\")\n deadline = asyncio.get_running_loop().time() + max(float(self._timeout), 1.0)\n while not self._server.started:\n if self._error is not None:\n raise RuntimeError(\"HTTP control server failed to start\") from self._error\n if asyncio.get_running_loop().time() >= deadline:\n raise TimeoutError(\"HTTP control server startup timed out\")\n await asyncio.sleep(0.05)\n\n def _serve(self) -> None:\n if self._server is None:\n return\n try:\n asyncio.run(self._server.serve())\n except BaseException as exc: # noqa: BLE001\n self._error = exc", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/http_runner.py:UvicornThreadRunner", - "span_start": 10, - "span_end": 61, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.http_runner", - "is_test": false, - "blob_sha": "3779fdd2878b770e789a35bb2a89c9d79f13b61c26d7db1b3b683f9bb9e1623f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "llm_answer": "Подтверждённые точки входа:\nsrc/app_runtime/control/http_app.py | fastapi http app.get\n- Объявлена как точка входа через декоратор fastapi http app.get\n\nsrc/app_runtime/control/http_app.py | fastapi http app.post\n- Объявлена как точка входа через декоратор fastapi http app.post\n\nВозможные кандидаты:\nsrc/app_runtime/control/http_channel.py | HttpControlChannel.start\n- Признак: метод класса с вызовом старта runner'а (_runner.start(app)), но сам запуск не виден явно извне.\n\nsrc/app_runtime/control/http_channel.py | HttpControlChannel.__init__\n- Признак: инициализация объекта, которая может быть точкой входа при использовании паттерна singleton, но признаков явного вызова нет.", - "summary": { - "router": { - "intent": "CODE_QA", - "sub_intent": "FIND_ENTRYPOINTS", - "confidence": null - }, - "retrieval": { - "profile": "code", - "layers_hit": [ - "C0_SOURCE_CHUNKS", - "C3_ENTRYPOINTS" - ], - "evidence_sufficient": true - }, - "llm": { - "answer_status": "answered", - "groundedness": "grounded" - } - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "FIND_ENTRYPOINTS", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C3_ENTRYPOINTS", - "C0_SOURCE_CHUNKS" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "RuntimeManager" - ], - "keyword_hints": [ - "RuntimeManager" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "execution": { - "executed_layers": [ - "C3_ENTRYPOINTS", - "C0_SOURCE_CHUNKS" - ], - "retrieval_mode_by_layer": { - "C3_ENTRYPOINTS": "exact_path_fetch", - "C0_SOURCE_CHUNKS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C3_ENTRYPOINTS": 12, - "C0_SOURCE_CHUNKS": 6 - }, - "filters_by_layer": { - "C3_ENTRYPOINTS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C3_ENTRYPOINTS", - "query": "Покажи поток запуска RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 12, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Покажи поток запуска RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C3_ENTRYPOINTS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 3, - "candidates_after_filter": 3 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 6, - "candidates_after_filter": 6 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "not_found", - "resolved_symbol": null, - "alternatives": [ - "RuntimeManager" - ] - }, - "layers": [ - { - "layer": "C3_ENTRYPOINTS", - "status": "hit", - "hit_count": 3, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 6, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "router": 0, - "symbol_resolution": 0, - "retrieval_total": 48, - "retrieval_by_layer": { - "C3_ENTRYPOINTS": 24, - "C0_SOURCE_CHUNKS": 23 - }, - "merge_rank": 0, - "prompt_build": 0, - "llm_call": 1397 - }, - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 1094, - "evidence_rows": 9, - "evidence_chars": 6731 - }, - "evidence_summary": [ - { - "layer": "C3_ENTRYPOINTS", - "count": 3, - "unique_paths": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 6, - "unique_paths": 5 - } - ], - "prompt_template_id": "intent_code_qa_find_entrypoints_ru_v2", - "system_prompt_version": "v1" - }, - "router": { - "conversation_mode": "START", - "keyword_hints": [ - "RuntimeManager" - ], - "path_scope": [] - }, - "llm": { - "used_evidence_count": 9, - "missing_evidence_reason": null - } - }, - "run_info": { - "case_id": "plba-v2-trace-flow-runtime-start", - "mode": "full_chain", - "run_started_at": "2026-03-12T12:55:37", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - }, - "input_request": { - "text": "Покажи поток запуска RuntimeManager", - "normalized_query": "Покажи поток запуска RuntimeManager" - }, - "steps": [ - { - "step": "intent_router", - "input": { - "query": "Покажи поток запуска RuntimeManager" - }, - "output": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Покажи поток запуска RuntimeManager" - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "FIND_ENTRYPOINTS", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C3_ENTRYPOINTS", - "C0_SOURCE_CHUNKS" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "RuntimeManager" - ], - "keyword_hints": [ - "RuntimeManager" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "timings_ms": { - "router": 0 - } - } - }, - { - "step": "retrieval", - "input": { - "query": "Покажи поток запуска RuntimeManager" - }, - "output": { - "symbol_resolution": { - "status": "not_found", - "resolved_symbol": null, - "alternatives": [ - "RuntimeManager" - ], - "confidence": 0.0 - }, - "rag_count": 9, - "rag_rows": [ - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "class HttpControlChannel(ControlChannel):\n def __init__(self, host: str, port: int, timeout: int) -> None:\n self._timeout = timeout\n self._runner = UvicornThreadRunner(host, port, timeout)\n self._factory = HttpControlAppFactory()\n self._actions: ControlActionSet | None = None\n\n async def start(self, actions: ControlActionSet) -> None:\n self._actions = actions\n app = self._factory.create(self._health_response, self._action_response)\n await self._runner.start(app)\n\n async def stop(self) -> None:\n await self._runner.stop()\n\n @property\n def port(self) -> int:\n return self._runner.port\n\n async def _health_response(self) -> dict[str, object]:\n if self._actions is None:\n return {\"status\": \"unhealthy\", \"detail\": \"control actions are not configured\"}\n return await asyncio.wait_for(self._actions.health(), timeout=float(self._timeout))\n\n async def _action_response(self, action: str, _client_source: str = \"unknown\") -> JSONResponse:\n if self._actions is None:\n return JSONResponse(content={\"status\": \"error\", \"detail\": f\"{action} handler is not configured\"}, status_code=404)\n callbacks = {\n \"start\": self._actions.start,\n \"stop\": self._actions.stop,\n \"status\": self._actions.status,\n }\n callback = callbacks.get(action)\n if callback is None:\n return JSONResponse(content={\"status\": \"error\", \"detail\": f\"unsupported action: {action}\"}, status_code=404)\n action_timeout = max(float(self._timeout), 10.0) if action in {\"start\", \"stop\"} else float(self._timeout)\n try:\n detail = await asyncio.wait_for(callback(), timeout=action_timeout)\n except asyncio.TimeoutError:\n return JSONResponse(\n content={\"status\": \"accepted\", \"detail\": f\"{action} operation is still in progress\"},\n status_code=202,\n )\n except Exception as exc:\n return JSONResponse(content={\"status\": \"error\", \"detail\": str(exc)}, status_code=500)\n return JSONResponse(content={\"status\": \"ok\", \"detail\": detail or f\"{action} action accepted\"}, status_code=200)", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/http_channel.py:HttpControlChannel", - "span_start": 12, - "span_end": 57, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.http_channel", - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "class HttpControlAppFactory:\n def create(\n self,\n health_provider: Callable[[], Awaitable[HealthPayload]],\n action_provider: Callable[[str, str], Awaitable[JSONResponse]],\n ) -> FastAPI:\n app = FastAPI(title=\"PLBA Control API\")\n\n @app.middleware(\"http\")\n async def log_api_call(request: Request, call_next): # type: ignore[no-untyped-def]\n started = time.monotonic()\n response = await call_next(request)\n response.headers[\"X-Response-Time-Ms\"] = str(int((time.monotonic() - started) * 1000))\n return response\n\n @app.get(\"/health\")\n async def health() -> JSONResponse:\n payload = await health_provider()\n status_code = 200 if payload.get(\"status\") == \"ok\" else 503\n return JSONResponse(content=payload, status_code=status_code)\n\n @app.get(\"/actions/{action}\")\n @app.post(\"/actions/{action}\")\n async def action(action: str, request: Request) -> JSONResponse:\n client_source = self._client_source(request)\n if action in {\"start\", \"stop\"}:\n LOGGER.warning(\"Control action requested: /actions/%s client=%s\", action, client_source)\n return await action_provider(action, client_source)\n\n return app\n\n def _client_source(self, request: Request) -> str:\n explicit_header = request.headers.get(\"X-Client-Source\", \"\").strip()\n if explicit_header:\n return explicit_header\n user_agent = request.headers.get(\"User-Agent\", \"\").strip()\n if user_agent:\n return f\"user-agent:{user_agent}\"\n return \"unknown\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/http_app.py:HttpControlAppFactory", - "span_start": 15, - "span_end": 53, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.http_app", - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "class ControlActionSet:\n health: HealthHandler\n start: ActionHandler\n stop: ActionHandler\n status: ActionHandler", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/base.py:ControlActionSet", - "span_start": 14, - "span_end": 18, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.base", - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/__init__.py", - "content": "from app_runtime.control.base import ControlActionSet, ControlChannel\nfrom app_runtime.control.http_channel import HttpControlChannel\nfrom app_runtime.control.service import ControlPlaneService\n\n__all__ = [\"ControlActionSet\", \"ControlChannel\", \"ControlPlaneService\", \"HttpControlChannel\"]", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/__init__.py:1-5", - "span_start": 1, - "span_end": 5, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.app_runtime.control.__init__", - "is_test": false, - "blob_sha": "bf3c37e3369a84cc618adc0fd71c232e5eb4b871eaff743069a17e661e498316", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "class ControlChannel(ABC):\n @abstractmethod\n async def start(self, actions: ControlActionSet) -> None:\n \"\"\"Start the control channel and bind handlers.\"\"\"\n\n @abstractmethod\n async def stop(self) -> None:\n \"\"\"Stop the control channel and release resources.\"\"\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/base.py:ControlChannel", - "span_start": 21, - "span_end": 28, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 1, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.base", - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_runner.py", - "content": "class UvicornThreadRunner:\n def __init__(self, host: str, port: int, timeout: int) -> None:\n self._host = host\n self._port = port\n self._timeout = timeout\n self._server: Server | None = None\n self._thread: Thread | None = None\n self._error: BaseException | None = None\n\n async def start(self, app: FastAPI) -> None:\n if self._thread is not None and self._thread.is_alive():\n return\n self._error = None\n config = Config(app=app, host=self._host, port=self._port, log_level=\"warning\")\n self._server = Server(config)\n self._thread = Thread(target=self._serve, name=\"plba-http-control\", daemon=True)\n self._thread.start()\n await self._wait_until_started()\n\n async def stop(self) -> None:\n if self._server is None or self._thread is None:\n return\n self._server.should_exit = True\n await asyncio.to_thread(self._thread.join, self._timeout)\n self._server = None\n self._thread = None\n\n @property\n def port(self) -> int:\n if self._server is None or not getattr(self._server, \"servers\", None):\n return self._port\n socket = self._server.servers[0].sockets[0]\n return int(socket.getsockname()[1])\n\n async def _wait_until_started(self) -> None:\n if self._server is None:\n raise RuntimeError(\"Server is not initialized\")\n deadline = asyncio.get_running_loop().time() + max(float(self._timeout), 1.0)\n while not self._server.started:\n if self._error is not None:\n raise RuntimeError(\"HTTP control server failed to start\") from self._error\n if asyncio.get_running_loop().time() >= deadline:\n raise TimeoutError(\"HTTP control server startup timed out\")\n await asyncio.sleep(0.05)\n\n def _serve(self) -> None:\n if self._server is None:\n return\n try:\n asyncio.run(self._server.serve())\n except BaseException as exc: # noqa: BLE001\n self._error = exc", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/http_runner.py:UvicornThreadRunner", - "span_start": 10, - "span_end": 61, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.http_runner", - "is_test": false, - "blob_sha": "3779fdd2878b770e789a35bb2a89c9d79f13b61c26d7db1b3b683f9bb9e1623f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ] - }, - "diagnostics": { - "execution": { - "executed_layers": [ - "C3_ENTRYPOINTS", - "C0_SOURCE_CHUNKS" - ], - "retrieval_mode_by_layer": { - "C3_ENTRYPOINTS": "exact_path_fetch", - "C0_SOURCE_CHUNKS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C3_ENTRYPOINTS": 12, - "C0_SOURCE_CHUNKS": 6 - }, - "filters_by_layer": { - "C3_ENTRYPOINTS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C3_ENTRYPOINTS", - "query": "Покажи поток запуска RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 12, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Покажи поток запуска RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C3_ENTRYPOINTS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 3, - "candidates_after_filter": 3 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 6, - "candidates_after_filter": 6 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "not_found", - "resolved_symbol": null, - "alternatives": [ - "RuntimeManager" - ] - }, - "layers": [ - { - "layer": "C3_ENTRYPOINTS", - "status": "hit", - "hit_count": 3, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 6, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "symbol_resolution": 0, - "retrieval_total": 48, - "retrieval_by_layer": { - "C3_ENTRYPOINTS": 24, - "C0_SOURCE_CHUNKS": 23 - }, - "merge_rank": 0 - } - } - }, - { - "step": "llm_answer", - "input": { - "query": "Покажи поток запуска RuntimeManager", - "rag_count": 9 - }, - "output": { - "llm_answer": "Подтверждённые точки входа:\nsrc/app_runtime/control/http_app.py | fastapi http app.get\n- Объявлена как точка входа через декоратор fastapi http app.get\n\nsrc/app_runtime/control/http_app.py | fastapi http app.post\n- Объявлена как точка входа через декоратор fastapi http app.post\n\nВозможные кандидаты:\nsrc/app_runtime/control/http_channel.py | HttpControlChannel.start\n- Признак: метод класса с вызовом старта runner'а (_runner.start(app)), но сам запуск не виден явно извне.\n\nsrc/app_runtime/control/http_channel.py | HttpControlChannel.__init__\n- Признак: инициализация объекта, которая может быть точкой входа при использовании паттерна singleton, но признаков явного вызова нет." - }, - "diagnostics": { - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 1094, - "evidence_rows": 9, - "evidence_chars": 6731 - }, - "evidence_summary": [ - { - "layer": "C3_ENTRYPOINTS", - "count": 3, - "unique_paths": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 6, - "unique_paths": 5 - } - ], - "prompt_template_id": "intent_code_qa_find_entrypoints_ru_v2", - "system_prompt_version": "v1" - }, - "timings_ms": { - "prompt_build": 0, - "llm_call": 1397 - } - } - } - ] - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_125536/full_chain_plba_code_subintents_v2_plba-v2-trace-flow-runtime-start.md b/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_125536/full_chain_plba_code_subintents_v2_plba-v2-trace-flow-runtime-start.md deleted file mode 100644 index 68a3fb0..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_125536/full_chain_plba_code_subintents_v2_plba-v2-trace-flow-runtime-start.md +++ /dev/null @@ -1,32 +0,0 @@ -# plba-v2-trace-flow-runtime-start - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_subintents_v2.yaml -- runner: runtime -- mode: full_chain -- passed: False - -## Query -Покажи поток запуска RuntimeManager - -## Actual -{ - "intent": "CODE_QA", - "sub_intent": "FIND_ENTRYPOINTS", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 9, - "llm_answer": "Подтверждённые точки входа:\nsrc/app_runtime/control/http_app.py | fastapi http app.get\n- Объявлена как точка входа через декоратор fastapi http app.get\n\nsrc/app_runtime/control/http_app.py | fastapi http app.post\n- Объявлена как точка входа через декоратор fastapi http app.post\n\nВозможные кандидаты:\nsrc/app_runtime/control/http_channel.py | HttpControlChannel.start\n- Признак: метод класса с вызовом старта runner'а (_runner.start(app)), но сам запуск не виден явно извне.\n\nsrc/app_runtime/control/http_channel.py | HttpControlChannel.__init__\n- Признак: инициализация объекта, которая может быть точкой входа при использовании паттерна singleton, но признаков явного вызова нет.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "RuntimeManager" - ], - "layers": [ - "C3_ENTRYPOINTS", - "C0_SOURCE_CHUNKS" - ] -} - -## Mismatches -- sub_intent: expected TRACE_FLOW, got FIND_ENTRYPOINTS -- layers should include 'C2_DEPENDENCY_GRAPH', got ['C3_ENTRYPOINTS', 'C0_SOURCE_CHUNKS'] \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_125536/summary.md b/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_125536/summary.md deleted file mode 100644 index 4582926..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_125536/summary.md +++ /dev/null @@ -1,86 +0,0 @@ -# pipeline_setup_v2 summary - -Passed: 14/18 - -| File | Case | Query | Expected sub-intent | Intent | Actual sub-intent | RAG layers | Pass | -|------|------|-------|---------------------|--------|-------------------|------------|------| -| full_chain_plba_code_subintents_v2.yaml | plba-v2-open-file-runtime | Открой файл src/app_runtime/core/runtime.py | OPEN_FILE | CODE_QA | OPEN_FILE | C0_SOURCE_CHUNKS:1 | ✓ | -| full_chain_plba_code_subintents_v2.yaml | plba-v2-open-file-public-api | Открой файл src/plba/__init__.py | OPEN_FILE | CODE_QA | OPEN_FILE | C0_SOURCE_CHUNKS:1 | ✓ | -| full_chain_plba_code_subintents_v2.yaml | plba-v2-explain-runtime-manager | Объясни как работает класс RuntimeManager | EXPLAIN | CODE_QA | EXPLAIN | C0_SOURCE_CHUNKS:1, C1_SYMBOL_CATALOG:1, C2_DEPENDENCY_GRAPH:6, C3_ENTRYPOINTS:3, C4_SEMANTIC_ROLES:1 | ✓ | -| full_chain_plba_code_subintents_v2.yaml | plba-v2-explain-trace-service | Объясни как работает класс TraceService | EXPLAIN | CODE_QA | EXPLAIN | C0_SOURCE_CHUNKS:3, C1_SYMBOL_CATALOG:1, C2_DEPENDENCY_GRAPH:6, C3_ENTRYPOINTS:3, C4_SEMANTIC_ROLES:1 | ✓ | -| full_chain_plba_code_subintents_v2.yaml | plba-v2-explain-create-runtime | Что делает функция create_runtime? | EXPLAIN | CODE_QA | EXPLAIN | C0_SOURCE_CHUNKS:1, C1_SYMBOL_CATALOG:1, C2_DEPENDENCY_GRAPH:6, C3_ENTRYPOINTS:3, C4_SEMANTIC_ROLES:1 | ✓ | -| full_chain_plba_code_subintents_v2.yaml | plba-v2-explain-local-http-channel | Почему в файле src/app_runtime/control/http_channel.py класс HttpControlChannel устроен так? | EXPLAIN_LOCAL | CODE_QA | EXPLAIN_LOCAL | C0_SOURCE_CHUNKS:1, C1_SYMBOL_CATALOG:1, C2_DEPENDENCY_GRAPH:4 | ✓ | -| full_chain_plba_code_subintents_v2.yaml | plba-v2-find-tests-runtime-manager | Где тесты для RuntimeManager? | FIND_TESTS | CODE_QA | FIND_TESTS | C0_SOURCE_CHUNKS:10, C2_DEPENDENCY_GRAPH:6 | ✓ | -| full_chain_plba_code_subintents_v2.yaml | plba-v2-find-tests-trace-service | Где тесты для TraceService? | FIND_TESTS | CODE_QA | FIND_TESTS | C0_SOURCE_CHUNKS:10, C2_DEPENDENCY_GRAPH:6 | ✓ | -| full_chain_plba_code_subintents_v2.yaml | plba-v2-find-tests-create-runtime | Где тесты для create_runtime? | FIND_TESTS | CODE_QA | FIND_TESTS | C0_SOURCE_CHUNKS:10, C2_DEPENDENCY_GRAPH:6 | ✓ | -| full_chain_plba_code_subintents_v2.yaml | plba-v2-find-tests-workflow-runtime-factory-negative | Где тесты для WorkflowRuntimeFactory? | FIND_TESTS | CODE_QA | FIND_TESTS | C0_SOURCE_CHUNKS:10, C2_DEPENDENCY_GRAPH:6 | ✗ | -| full_chain_plba_code_subintents_v2.yaml | plba-v2-find-entrypoints-control-plane | Найди точки входа HTTP control plane | FIND_ENTRYPOINTS | CODE_QA | FIND_ENTRYPOINTS | C0_SOURCE_CHUNKS:6, C3_ENTRYPOINTS:3 | ✓ | -| full_chain_plba_code_subintents_v2.yaml | plba-v2-find-entrypoints-health-endpoint | Где health endpoint? | FIND_ENTRYPOINTS | CODE_QA | EXPLAIN | — | ✗ | -| full_chain_plba_code_subintents_v2.yaml | plba-v2-trace-flow-runtime-start | Покажи поток запуска RuntimeManager | TRACE_FLOW | CODE_QA | FIND_ENTRYPOINTS | C0_SOURCE_CHUNKS:6, C3_ENTRYPOINTS:3 | ✗ | -| full_chain_plba_code_subintents_v2.yaml | plba-v2-trace-flow-health-endpoint | Покажи поток запроса /health в HttpControlAppFactory | TRACE_FLOW | CODE_QA | EXPLAIN | C0_SOURCE_CHUNKS:1, C1_SYMBOL_CATALOG:4, C2_DEPENDENCY_GRAPH:6, C3_ENTRYPOINTS:3, C4_SEMANTIC_ROLES:1 | ✗ | -| full_chain_plba_code_subintents_v2.yaml | plba-v2-architecture-runtime-manager | Какие компоненты участвуют в RuntimeManager? | ARCHITECTURE | CODE_QA | ARCHITECTURE | C0_SOURCE_CHUNKS:1, C1_SYMBOL_CATALOG:1, C2_DEPENDENCY_GRAPH:8, C3_ENTRYPOINTS:3, C4_SEMANTIC_ROLES:12 | ✓ | -| full_chain_plba_code_subintents_v2.yaml | plba-v2-architecture-control-plane | Какие компоненты участвуют в ControlPlaneService? | ARCHITECTURE | CODE_QA | ARCHITECTURE | C0_SOURCE_CHUNKS:1, C1_SYMBOL_CATALOG:1, C2_DEPENDENCY_GRAPH:8, C3_ENTRYPOINTS:3, C4_SEMANTIC_ROLES:12 | ✓ | -| full_chain_plba_code_subintents_v2.yaml | plba-v2-explain-nonexistent-symbol | Объясни класс RuntimeFactoryManager | EXPLAIN | CODE_QA | EXPLAIN | — | ✓ | -| full_chain_plba_code_subintents_v2.yaml | plba-v2-open-file-nonexistent | Открой файл src/app_runtime/core/missing_runtime.py | OPEN_FILE | CODE_QA | OPEN_FILE | — | ✓ | - -## Failures -- **plba-v2-find-tests-workflow-runtime-factory-negative**: retrieval: expected empty rag, got 16 rows -- **plba-v2-find-entrypoints-health-endpoint**: sub_intent: expected FIND_ENTRYPOINTS, got EXPLAIN; retrieval: expected non-empty rag, got 0 rows -- **plba-v2-trace-flow-runtime-start**: sub_intent: expected TRACE_FLOW, got FIND_ENTRYPOINTS; layers should include 'C2_DEPENDENCY_GRAPH', got ['C3_ENTRYPOINTS', 'C0_SOURCE_CHUNKS'] -- **plba-v2-trace-flow-health-endpoint**: sub_intent: expected TRACE_FLOW, got EXPLAIN - -## LLM Answers -- **plba-v2-open-file-runtime** - Query: Открой файл src/app_runtime/core/runtime.py - > 1. путь к файлу: src/app\_runtime/core/runtime.py 2. В доступных фрагментах видна реализация класса RuntimeManager. 3. Top\-level сущности и секции: класс RuntimeManager с методом \_\_init\_\_, методом \_register\_core\_services и частично реализованным методом register\_module. 4. Важные элементы для вопроса пользователя: \- Константы ACTION\_TIMEOUT\_SECONDS и ACTION\_POLL\_INTERVAL\_SECONDS. \- Инициализация различных служб \(ConfigurationManager, ServiceContainer, TraceService и др.\) через конструктор класса. \- Метод \_register\_core\_services, вероятно, отвечает за регистрацию основных сервисов. Ответ основан только на доступных фрагментах. Полный контекст файла может содержать дополнительную информацию. -- **plba-v2-open-file-public-api** - Query: Открой файл src/plba/__init__.py - > 1. src/plba/\_\_init\_\_.py 2. Файл содержит импорт различных модулей и классов из разных пакетов проекта. Также определён список \_\_all\_\_, содержащий имена экспортируемых элементов. 3. Top\-level сущности и секции: \- Импорты \(модулей и классов\). \- Список \_\_all\_\_. 4. В этом файле определены импорты основных компонентов системы управления рабочими процессами, конфигурацией, контролем и отслеживанием выполнения задач. Список \_\_all\_\_ указывает на основные экспортируемые элементы модуля, которые могут быть важны при использовании этого модуля в других частях приложения. -- **plba-v2-explain-runtime-manager** - Query: Объясни как работает класс RuntimeManager - > 1. Что это и где определено. Сущность \`RuntimeManager\` определена в файле \`src/app\_runtime/core/runtime.py\`. 2. Назначение по наблюдаемому коду. Из контекста видно, что \`RuntimeManager\` играет роль менеджера, управляющего жизненным циклом приложения и координации различных компонентов системы. Он отвечает за инициализацию и регистрацию сервисов, отслеживание состояния и управление потоками работы. 3. Подтверждённые зависимости или взаимодействия. Класс зависит от следующих классов и объектов: \- \`ConfigurationManager\` \- \`ServiceContainer\` \- \`TraceService\` \- \`HealthRegistry\` \- \`LogManager\` \- \`WorkerSupervisor\` \- \`ControlPlaneService\` \- \`ApplicationModule\` Эти зависимости передаются через конструктор класса при его создании. 4. Что делает по шагам, если это видно в контексте. По имеющемуся контексту видно следующее поведение: \- Инициализация конструктора принимает парам… -- **plba-v2-explain-trace-service** - Query: Объясни как работает класс TraceService - > 1. Что это и где определено. Сущность \`TraceService\` объявлена в файле \`src/app\_runtime/tracing/service.py\`. Это класс\-наследник от \`TraceContextFactory\`. 2. Назначение по наблюдаемому коду. Класс предназначен для работы с трассировкой контекста выполнения приложения. Он создаёт и управляет контекстами трассировки, записывает их в хранилище \(\`store\`\) и отправляет на транспорт \(\`transport\`\), обеспечивая запись логических сообщений и контекстных данных о выполнении программы. 3. Подтверждённые зависимости или взаимодействия. \- Создаёт и записывает записи контекста трассировки через метод \`create\_context\(\)\`, используя хранилище контекста \(\`store\`\) и транспорт \(\`transport\`\). \- Использует контекстный менеджер \`open\_context\(\)\` для открытия временных контекстов. \- Вызывает методы записи контекста и сообщений через экземпляр класса \`TraceRecordWriter\`. 4. Что делает по шагам… -- **plba-v2-explain-create-runtime** - Query: Что делает функция create_runtime? - > 1. \*\*Что это и где определено.\*\* Сущность \`create\_runtime\` определена в файле \`src/plba/bootstrap.py\`. Это функция, принимающая параметры конфигурации и создающая экземпляр класса \`RuntimeManager\`. 2. \*\*Назначение по наблюдаемому коду.\*\* Функция создаёт и инициализирует объект \`RuntimeManager\`, добавляя в него файл конфигурации \(\`config\_path\`\), канал управления HTTP \(\`enable\_http\_control\`\) и регистрируя переданный модуль приложения \(\`module\`\). 3. \*\*Подтверждённые зависимости или взаимодействия.\*\* Функция взаимодействует с экземпляром \`RuntimeManager\` через методы \`add\_config\_file\`, \`register\_channel\` и \`register\_module\`. 4. \*\*Что делает по шагам, если это видно в контексте.\*\* \- Создаёт экземпляр объекта \`RuntimeManager\`. \- Если передан параметр \`config\_path\`, добавляет указанный файл конфигурации в менеджер. \- Если включён режим HTTP\-контроля, регистрирует соответств… -- **plba-v2-explain-local-http-channel** - Query: Почему в файле src/app_runtime/control/http_channel.py класс HttpControlChannel устроен так? - > Класс \`HttpControlChannel\` из файла \`src/app\_runtime/control/http\_channel.py\` реализует HTTP канал управления для взаимодействия с внешним миром через HTTP протокол. \#\#\# Что делает класс: 1. \*\*Инициализация \(\`\_\_init\_\_\`\)\*\*: \- Принимает параметры \`host\`, \`port\` и \`timeout\`. \- Создаёт объект \`UvicornThreadRunner\` \(асинхронный веб\-сервер\), который будет слушать указанный порт. \- Инициализирует фабрику приложений \`HttpControlAppFactory\(\)\` для создания приложения HTTP. \- Сохраняет значение тайм\-аута \(\`\_timeout\`\), но само управление действиями \(\`\_actions\`\) инициализируется как \`None\`. 2. \*\*Запуск \(\`start\`\)\*\*: \- Запускает веб\-сервер с приложением, созданным фабрикой. \- Перед запуском проверяет наличие настроенных действий \(\`\_actions\`\). Если они отсутствуют, возвращает сообщение об ошибке. \- Возвращает результат вызова метода \`\_actions.health\(\)\`, ожидая его до истечения тайм\-… -- **plba-v2-find-tests-runtime-manager** - Query: Где тесты для RuntimeManager? - > 1. Прямые тесты: \- tests/test\_runtime.py \| test\_runtime\_runs\_worker\_routine\_and\_exposes\_status \- tests/test\_runtime.py \| test\_runtime\_graceful\_stop\_waits\_until\_worker\_finishes Проверка: \- Создания и инициализации RuntimeManager. \- Взаимодействия RuntimeManager с worker'ами и обработкой статуса. \- Ожидания завершения работы worker'а при корректном завершении процесса остановки. \- Проверки поведения RuntimeManager в разных состояниях \(busy, stopped\). 2. Косвенные или ближайшие тесты: \- tests/test\_business\_control\_actions.py \| \_build\_runtime \- tests/test\_business\_control\_actions.py \| test\_worker\_wakes\_up\_with\_configured\_interval Эти тесты косвенно затрагивают RuntimeManager через инстанцирование его в других контекстах и использовании его методов, однако непосредственно поведение RuntimeManager не проверяется напрямую. 3. Пробелы покрытия: \- Не найдены явные тесты, кото… -- **plba-v2-find-tests-trace-service** - Query: Где тесты для TraceService? - > 1. Прямые тесты: \- tests/test\_runtime.py \| test\_trace\_service\_writes\_contexts\_and\_messages \- Проверка записи контекстов и сообщений в TraceService. \- tests/test\_runtime.py \| test\_trace\_service\_supports\_debug\_warning\_and\_error\_levels \- Проверка поддержки различных уровней логирования \(debug, warning, error\). 2. Косвенные или ближайшие тесты: \- Нет явных связей с другими тестами через зависимости или имена, однако тесты касаются работы с Transport и записью контекста/сообщений, что близко к функционалу TraceService. 3. Что именно проверяется: \- Запись и корректность данных контекстов и сообщений в TraceService. \- Поддержка различных уровней логирования и запись соответствующих сообщений. 4. Пробелы покрытия: \- Не найдены явные пробелы покрытия для TraceService напрямую. Однако могут быть аспекты поведения, которые не охвачены текущими тестами, например, обработка ошибо… -- **plba-v2-find-tests-create-runtime** - Query: Где тесты для create_runtime? - > 1. Прямые тесты: \- tests/test\_runtime.py \| test\_public\_plba\_package\_exports\_runtime\_builder\_and\_worker\_contract \- Проверка: импорты и вызовы create\_runtime. \- Недостаток покрытия: отсутствие проверки поведения функции \`create\_runtime\`. 2. Косвенные или ближайшие тесты: \- tests/test\_business\_control\_actions.py \| \_build\_runtime \- Проверка: создание экземпляра \`RuntimeManager\` и регистрация канала управления. \- Недостаток покрытия: отсутствует проверка непосредственно создания и работы runtime через функцию \`create\_runtime\`. 3. Что именно проверяется: \- В direct\-тестах проверяются импорты и вызовы функции \`create\_runtime\`, однако поведение самой функции не подтверждено. \- В косвенных тестах проверяется создание объекта \`RuntimeManager\` и его начальная настройка, а также работа каналов управления. 4. Пробелы покрытия: \- Отсутствует прямое тестирование поведения функции \`… -- **plba-v2-find-tests-workflow-runtime-factory-negative** - Query: Где тесты для WorkflowRuntimeFactory? - > Прямых тестов для WorkflowRuntimeFactory в предоставленном контексте не обнаружено. Косвенные или ближайшие тесты: 1. tests/test\_business\_control\_actions.py \| test\_actions\_stop\_busy\_worker\_before\_timeout:dataflow\_slice \- Проверяет поведение \`BlockingRoutine\` и его метод \`\_release\`. 2. tests/test\_business\_control\_actions.py \| test\_actions\_stop\_busy\_worker\_after\_timeout:dataflow\_slice \- Проверяет поведение \`BlockingRoutine\` и его метод \`\_started\`. Что именно проверяется: \- Поведение и методы класса \`BlockingRoutine\`, такие как инициализация, запуск и освобождение \(test\_actions\_stop\_busy\_worker\_before\_timeout\). \- Поведение и методы класса \`ScenarioWorker\`, такие как получение имени \(test\_worker\_wakes\_up\_with\_configured\_interval\). Какие пробелы покрытия видны: \- Нет явных тестов конкретно для \`WorkflowRuntimeFactory\`. \- Покрытие ограничено ближайшими классами и методами,… -- **plba-v2-find-entrypoints-control-plane** - Query: Найди точки входа HTTP control plane - > Подтверждённые точки входа: src/app\_runtime/control/http\_app.py \| fastapi http app.get \- Объявлена декоратором @app.get, что указывает на точку входа для HTTP\-запросов. src/app\_runtime/control/http\_app.py \| fastapi http app.post \- Объявлена декоратором @app.post, что указывает на точку входа для HTTP\-запросов. Возможные кандидаты: src/app\_runtime/control/http\_channel.py \| HttpControlChannel.start \- Метод класса, вызывающий инициализацию FastAPI приложения через фабрику HttpControlAppFactory, однако прямого признака точки входа нет. src/app\_runtime/control/http\_channel.py \| HttpControlChannel.\_health\_response \- Внутренний метод, возвращающий здоровье системы, но явно не указан как точка входа. src/app\_runtime/control/http\_channel.py \| HttpControlChannel.\_action\_response \- Внутренний метод, обрабатывающий запросы к действиям, но явно не указан как точка входа. -- **plba-v2-find-entrypoints-health-endpoint** - Query: Где health endpoint? - > Не удалось найти информацию о health endpoint ни в одном из слоёв RAG. 1. \*\*Что это и где определено\*\*: health endpoint обычно представляет собой конечную точку API, используемую для проверки доступности сервиса или приложения. Его точное местоположение зависит от архитектуры приложения и технологий, используемых для его разработки \(например, Flask, Django Rest Framework и т.д.\). 2. \*\*Назначение по наблюдаемому коду\*\*: отсутствует. 3. \*\*Подтверждённые зависимости или взаимодействия\*\*: отсутствуют. 4. \*\*Что делает по шагам, если это видно в контексте\*\*: не найдено. 5. \*\*Осторожные выводы\*\*: невозможно сделать ввиду отсутствия информации. 6. \*\*Чего не хватает для полного объяснения\*\*: необходимо наличие исходного кода или файла, содержащего определение health endpoint. Без этого нельзя точно определить, где именно он расположен и какие технологии используются. -- **plba-v2-trace-flow-runtime-start** - Query: Покажи поток запуска RuntimeManager - > Подтверждённые точки входа: src/app\_runtime/control/http\_app.py \| fastapi http app.get \- Объявлена как точка входа через декоратор fastapi http app.get src/app\_runtime/control/http\_app.py \| fastapi http app.post \- Объявлена как точка входа через декоратор fastapi http app.post Возможные кандидаты: src/app\_runtime/control/http\_channel.py \| HttpControlChannel.start \- Признак: метод класса с вызовом старта runner'а \(\_runner.start\(app\)\), но сам запуск не виден явно извне. src/app\_runtime/control/http\_channel.py \| HttpControlChannel.\_\_init\_\_ \- Признак: инициализация объекта, которая может быть точкой входа при использовании паттерна singleton, но признаков явного вызова нет. -- **plba-v2-trace-flow-health-endpoint** - Query: Покажи поток запроса /health в HttpControlAppFactory - > 1. Что это и где определено. Сущность \`HttpControlAppFactory\` определена в файле \`src/app\_runtime/control/http\_app.py\`. 2. Назначение по наблюдаемому коду. По предоставленному контексту видно, что \`HttpControlAppFactory\` является фабрикой для создания экземпляра класса \`FastAPI\`. В частности, он отвечает за создание конечных точек \`/health\` и \`/actions/\{action\}\`, а также применяет middleware для логирования времени выполнения запросов. 3. Подтверждённые зависимости или взаимодействия. Зависит от двух провайдеров: \- \`health\_provider\`: предоставляет данные о состоянии системы \(\`HealthPayload\`\), которые затем используются при обработке запроса \`/health\`. \- \`action\_provider\`: предоставляет асинхронную функцию для выполнения действий на основе переданного действия \(например, "start" или "stop"\). 4. Что делает по шагам, если это видно в контексте. \- Создаёт экземпляр \`Fast… -- **plba-v2-architecture-runtime-manager** - Query: Какие компоненты участвуют в RuntimeManager? - > 1. \*\*Компоненты, которые подтверждены контекстом\*\*: \- RuntimeManager \- ControlActionSet \- ControlPlaneService 2. \*\*Подтверждённые связи между ними\*\*: \- RuntimeManager инициирует ControlPlaneService через его метод \`\_\_init\_\_\` \(\`ControlPlaneService.\_\_init\_\_:dataflow\_slice\`\). \- ControlPlaneService используется внутри RuntimeManager для управления данными потока \(\`ControlPlaneService.\_channels\`, \`ControlPlaneService.\_start\_async\`\). 3. \*\*Границы ответственности, если они реально видны в коде\*\*: \- RuntimeManager отвечает за координацию и управление операциями, связанными с состоянием приложения и потоками данных. Он управляет конфигурацией и запуском. \- ControlActionSet выступает в качестве модели, выполняющей стандартные действия или вызовы на основе поступающих запросов. \- ControlPlaneService ответственен за инициализацию каналов и запуск асинхронных операций. 4. \*\*Что о… -- **plba-v2-architecture-control-plane** - Query: Какие компоненты участвуют в ControlPlaneService? - > 1. \*\*Компоненты, которые подтверждены контекстом\*\*: \- ControlPlaneService \- ControlActionSet 2. \*\*Подтверждённые связи между ними\*\*: \- ControlPlaneService зависит от ControlActionSet через регистрацию каналов \(\_channels\): \`\`\` ControlPlaneService.\_\_init\_\_ \-> ControlPlaneService.\_channels \-> ControlPlaneService.register\_channel\(ControlActionSet\) \`\`\` 3. \*\*Границы ответственности, если они реально видны в коде\*\*: \- ControlPlaneService отвечает за инициализацию и управление каналами данных, регистрируя экземпляры ControlActionSet для работы с данными потока. 4. \*\*Что остаётся неизвестным или неполным\*\*: \- Детали реализации метода \`register\_channel\` и его взаимодействия с другими компонентами системы остаются неясными на основании предоставленного контекста. \- Неизвестно точно, какие именно каналы и действия регистрируются и используются внутри \`ControlPlaneService\`. -- **plba-v2-explain-nonexistent-symbol** - Query: Объясни класс RuntimeFactoryManager - > Класс \`RuntimeFactoryManager\` не найден ни в предоставленном контексте, ни в стандартных библиотеках Python. \*\*1. Что это и где определено.\*\* Не удалось обнаружить определение класса \`RuntimeFactoryManager\`. Возможно, он определен в сторонней библиотеке или проекте с закрытым контекстом. \*\*2. Назначение по наблюдаемому коду.\*\* Из\-за отсутствия контекста невозможно точно определить назначение данного класса. Если бы был доступ к кодовой базе, можно было бы проанализировать точку входа \(entrypoint\), методы и поля класса, чтобы понять его предназначение. \*\*3. Подтверждённые зависимости или взаимодействия.\*\* Так как сущность отсутствует, нельзя установить подтверждённые зависимости или взаимодействия. \*\*4. Что делает по шагам, если это видно в контексте.\*\* Шагов выполнения нет, так как сущность неизвестна. \*\*5. Осторожные выводы.\*\* Без реального кода невозможно сделать к… -- **plba-v2-open-file-nonexistent** - Query: Открой файл src/app_runtime/core/missing_runtime.py - > 1. src/app\_runtime/core/missing\_runtime.py 2. Основан только на имени файла и пути, так как сам контент файла недоступен. 3. Top\-level сущности или секции невозможно определить из\-за отсутствия содержимого файла. 4. Так как содержимое файла неизвестно, невозможно сказать, какие части этого файла могут быть важны для интерпретации слоёв RAG. Однако, исходя из названия файла, вероятно, он содержит информацию о работе с отсутствующими или пропущенными компонентами во время выполнения приложения. Это может включать обработку ошибок, логирование или механизмы замены недостающих компонентов. \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_132357/full_chain_plba_code_subintents_v2_plba-v2-architecture-control-plane.json b/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_132357/full_chain_plba_code_subintents_v2_plba-v2-architecture-control-plane.json deleted file mode 100644 index 7053de4..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_132357/full_chain_plba_code_subintents_v2_plba-v2-architecture-control-plane.json +++ /dev/null @@ -1,2940 +0,0 @@ -{ - "case_id": "plba-v2-architecture-control-plane", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_subintents_v2.yaml", - "runner": "runtime", - "mode": "full_chain", - "actual": { - "intent": "CODE_QA", - "sub_intent": "ARCHITECTURE", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 25, - "llm_answer": "1. **Компоненты, которые подтверждены контекстом**:\n - ControlPlaneService\n - ControlActionSet\n\n2. **Подтверждённые связи между ними**:\n - ControlPlaneService имеет метод `__init__`, который включает инициализацию внутренних каналов (`_channels`) и регистрацию этих каналов через метод `_register_channel`.\n - Контейнер `ControlActionSet` указан как модель с ролью «model», что подразумевает его использование внутри `ControlPlaneService`. Однако конкретные детали взаимодействия между этими двумя компонентами отсутствуют в представленном контексте.\n\n3. **Границы ответственности, если они реально видны в коде**:\n - ControlPlaneService отвечает за управление состоянием и участие в данных срезах (dataflow slices).\n - ControlActionSet является моделью с базовой ролью «model».\n\n4. **Что остаётся неизвестным или неполным**:\n - Детали взаимодействия между ControlPlaneService и ControlActionSet остаются неясными, так как отсутствует информация о конкретных методах и функциях, вызываемых между этими компонентами.\n - Неизвестно, какие именно данные передаются между компонентами и каким образом происходит обмен информацией.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "ControlPlaneService" - ], - "layers": [ - "C4_SEMANTIC_ROLES", - "C3_ENTRYPOINTS", - "C2_DEPENDENCY_GRAPH", - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS" - ] - }, - "passed": true, - "mismatches": [], - "details": { - "case_id": "plba-v2-architecture-control-plane", - "text": "Какие компоненты участвуют в ControlPlaneService?", - "mode": "full_chain", - "run_started_at": "2026-03-12T13:23:57", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Какие компоненты участвуют в ControlPlaneService?", - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "ControlPlaneService", - "alternatives": [ - "ControlPlaneService" - ], - "confidence": 0.99 - }, - "rag_count": 25, - "rag_rows": [ - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests service\n- reads and writes state attributes\n- participates in dataflow slices (5)", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlPlaneService", - "span_start": 12, - "span_end": 52, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 68, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "b13471e5916986dccffb53fab613812842965705e6b3a89ae549d30c9e91e9aa", - "symbol_name": "ControlPlaneService", - "qname": "ControlPlaneService", - "role": "pipeline_stage", - "confidence": 0.57, - "dataflow_participation": 5, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "ControlActionSet\nrole: model\n\nResponsibilities:\n- default model role", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlActionSet", - "span_start": 14, - "span_end": 18, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 40, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "46eb026cb3313415ec47b82dd22f84f4d112c9d987e8b1716dcb0baa1cce8988", - "symbol_name": "ControlActionSet", - "qname": "ControlActionSet", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "ControlChannel\nrole: model\n\nResponsibilities:\n- default model role", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlChannel", - "span_start": 21, - "span_end": 28, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 40, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "cfcfe9a311d3a2dbdaf32ac4ccd73c0eb9a117f830591a1c0867ee97d46204ff", - "symbol_name": "ControlChannel", - "qname": "ControlChannel", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_runner.py", - "content": "UvicornThreadRunner\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (24)", - "layer": "C4_SEMANTIC_ROLES", - "title": "UvicornThreadRunner", - "span_start": 10, - "span_end": 61, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 11, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "fd55630045a02100df8877ac27d951ee08617d4598764394d48cb51fe067476a", - "symbol_name": "UvicornThreadRunner", - "qname": "UvicornThreadRunner", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 24, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "3779fdd2878b770e789a35bb2a89c9d79f13b61c26d7db1b3b683f9bb9e1623f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (10)", - "layer": "C4_SEMANTIC_ROLES", - "title": "HttpControlChannel", - "span_start": 12, - "span_end": 57, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 21, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "1c9fbdc24819e5604c26ea55428a74310f03a03e1af197ed84846af61e42fdb0", - "symbol_name": "HttpControlChannel", - "qname": "HttpControlChannel", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 10, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "HttpControlAppFactory\nrole: factory\n\nResponsibilities:\n- name suffix suggests factory", - "layer": "C4_SEMANTIC_ROLES", - "title": "HttpControlAppFactory", - "span_start": 15, - "span_end": 53, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 39, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "9b3502a5fb408b273223db13264349cf500de24915b6c649d9ea8970d0dfd8e0", - "symbol_name": "HttpControlAppFactory", - "qname": "HttpControlAppFactory", - "role": "factory", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/persistence/workflow_persistence.py", - "content": "WorkflowPersistence\nrole: pipeline_stage\n\nResponsibilities:\n- orchestrates role-like calls (2)\n- reads and writes state attributes\n- participates in dataflow slices (16)", - "layer": "C4_SEMANTIC_ROLES", - "title": "WorkflowPersistence", - "span_start": 8, - "span_end": 54, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 15, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "7bd01ee45cf31f2d5c2e3e51656254860ac785d10cef9e0852cd4fba90857bae", - "symbol_name": "WorkflowPersistence", - "qname": "WorkflowPersistence", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 16, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "80e9410ddc639789b4353c2a1a757ba8d0d5b5bb6075b0b263b61551f04ae1f0", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/queue/in_memory.py", - "content": "InMemoryTaskQueue\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (9)", - "layer": "C4_SEMANTIC_ROLES", - "title": "InMemoryTaskQueue", - "span_start": 9, - "span_end": 38, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 22, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "2da04cb94544a3bcbf0943a95ad4bdd8710bcafaa32a02fd0e4de2178dcf3533", - "symbol_name": "InMemoryTaskQueue", - "qname": "InMemoryTaskQueue", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 9, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "58f0cc001ccda0eee4c6bc32ed83bd05eafd6b6644f1e8b4aa9eed3103db73dc", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/config/file_loader.py", - "content": "ConfigFileLoader\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (8)", - "layer": "C4_SEMANTIC_ROLES", - "title": "ConfigFileLoader", - "span_start": 11, - "span_end": 48, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 23, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "a8474eca8b6e9dc86ae67ed68b16fa5fb639ef08739c053e7b7195489765667f", - "symbol_name": "ConfigFileLoader", - "qname": "ConfigFileLoader", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 8, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "1f19ffebde5e38e4be5a5d5a678059a0f36dedb8fb8b3e00ab395c67106a87ea", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/store.py", - "content": "TraceContextStore\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (6)", - "layer": "C4_SEMANTIC_ROLES", - "title": "TraceContextStore", - "span_start": 15, - "span_end": 52, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 25, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "b2dad4fbe16ffb11b58deba311c7739955c39d59f291b22181f33e9c8cce4059", - "symbol_name": "TraceContextStore", - "qname": "TraceContextStore", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 6, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "d369554f08fc92039c6edd5a2a1e73b23901533e8974459170bbd9347d263dc5", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workers/supervisor.py", - "content": "WorkerSupervisor\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (6)", - "layer": "C4_SEMANTIC_ROLES", - "title": "WorkerSupervisor", - "span_start": 10, - "span_end": 59, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 25, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "c17b44e8d9e97d490989b21fa67d7c346cdda8a0472e4c41fb243c8846faa124", - "symbol_name": "WorkerSupervisor", - "qname": "WorkerSupervisor", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 6, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "77609d9d5927171cce7fc3a54897c183fd63068710c6362029b700937aae5eee", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/engine/workflow_engine.py", - "content": "WorkflowEngine\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (6)", - "layer": "C4_SEMANTIC_ROLES", - "title": "WorkflowEngine", - "span_start": 10, - "span_end": 86, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 25, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "57ec0a9f11c542c78e008684a888397e8d9ef4223671acb2567e631a0cbc70b4", - "symbol_name": "WorkflowEngine", - "qname": "WorkflowEngine", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 6, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "1057136e58a325cd5ab6f4e265d15665fb6a711b7022d9fab52a1a290afa2368", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._start_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 47, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517", - "dst_ref": "ControlPlaneService._start_async", - "resolution": "resolved", - "slice_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._start_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.register_channel", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 17, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957", - "dst_ref": "ControlPlaneService.register_channel", - "resolution": "resolved", - "slice_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.register_channel" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.start", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 20, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154", - "dst_ref": "ControlPlaneService.start", - "resolution": "resolved", - "slice_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.start" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.stop", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 25, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d", - "dst_ref": "ControlPlaneService.stop", - "resolution": "resolved", - "slice_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.stop" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._stop_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 51, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a", - "dst_ref": "ControlPlaneService._stop_async", - "resolution": "resolved", - "slice_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._stop_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.start calls asyncio.run", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.start:calls", - "span_start": 22, - "span_end": 22, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "4e0b3147fb867d48d26567570c259f4052a739e3098133802d4b8bafcf03be6b", - "edge_type": "calls", - "src_symbol_id": "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154", - "src_qname": "ControlPlaneService.start", - "dst_symbol_id": null, - "dst_ref": "asyncio.run", - "resolution": "partial", - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.register_channel reads_attr ControlPlaneService._channels", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.register_channel:reads_attr", - "span_start": 17, - "span_end": 17, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "3101fdc99a7a9c5aebf18a024bc148d37b348248a6fd02b95724dff280f2908a", - "edge_type": "reads_attr", - "src_symbol_id": "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957", - "src_qname": "ControlPlaneService.register_channel", - "dst_symbol_id": null, - "dst_ref": "ControlPlaneService._channels", - "resolution": "partial", - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.start reads_attr ControlPlaneService._channels", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.start:reads_attr", - "span_start": 20, - "span_end": 20, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "9452e50ef27d47c30ee1c311c48fe73ecddbf7a6dbcf967a6345e98222d9f71a", - "edge_type": "reads_attr", - "src_symbol_id": "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154", - "src_qname": "ControlPlaneService.start", - "dst_symbol_id": null, - "dst_ref": "ControlPlaneService._channels", - "resolution": "partial", - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "class ControlPlaneService\nControlPlaneService", - "layer": "C1_SYMBOL_CATALOG", - "title": "ControlPlaneService", - "span_start": 12, - "span_end": 52, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "b13471e5916986dccffb53fab613812842965705e6b3a89ae549d30c9e91e9aa", - "qname": "ControlPlaneService", - "kind": "class", - "signature": "ControlPlaneService", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.control.service", - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "class ControlPlaneService:\n def __init__(self) -> None:\n self._channels: list[ControlChannel] = []\n\n def register_channel(self, channel: ControlChannel) -> None:\n self._channels.append(channel)\n\n def start(self, runtime: RuntimeManager) -> None:\n if not self._channels:\n return\n asyncio.run(self._start_async(runtime))\n\n def stop(self) -> None:\n if not self._channels:\n return\n asyncio.run(self._stop_async())\n\n def snapshot(self, runtime: RuntimeManager) -> dict[str, object]:\n health = runtime.current_health()\n return {\n \"runtime\": {\"state\": runtime._state.value},\n \"modules\": list(runtime.registry.modules),\n \"services\": runtime.services.snapshot(),\n \"workers\": runtime.workers.snapshot(),\n \"health\": runtime.health.snapshot(runtime.workers.healths()) | {\"status\": health[\"status\"]},\n \"config\": runtime.configuration.get(),\n }\n\n async def _start_async(self, runtime: RuntimeManager) -> None:\n actions = ControlActionSet(\n health=runtime.health_status,\n start=runtime.start_runtime,\n stop=runtime.stop_runtime,\n status=runtime.runtime_status,\n )\n for channel in self._channels:\n await channel.start(actions)\n\n async def _stop_async(self) -> None:\n for channel in reversed(self._channels):\n await channel.stop()", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/service.py:ControlPlaneService", - "span_start": 12, - "span_end": 52, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.service", - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "llm_answer": "1. **Компоненты, которые подтверждены контекстом**:\n - ControlPlaneService\n - ControlActionSet\n\n2. **Подтверждённые связи между ними**:\n - ControlPlaneService имеет метод `__init__`, который включает инициализацию внутренних каналов (`_channels`) и регистрацию этих каналов через метод `_register_channel`.\n - Контейнер `ControlActionSet` указан как модель с ролью «model», что подразумевает его использование внутри `ControlPlaneService`. Однако конкретные детали взаимодействия между этими двумя компонентами отсутствуют в представленном контексте.\n\n3. **Границы ответственности, если они реально видны в коде**:\n - ControlPlaneService отвечает за управление состоянием и участие в данных срезах (dataflow slices).\n - ControlActionSet является моделью с базовой ролью «model».\n\n4. **Что остаётся неизвестным или неполным**:\n - Детали взаимодействия между ControlPlaneService и ControlActionSet остаются неясными, так как отсутствует информация о конкретных методах и функциях, вызываемых между этими компонентами.\n - Неизвестно, какие именно данные передаются между компонентами и каким образом происходит обмен информацией.", - "summary": { - "router": { - "intent": "CODE_QA", - "sub_intent": "ARCHITECTURE", - "confidence": null - }, - "retrieval": { - "profile": "code", - "layers_hit": [ - "C0_SOURCE_CHUNKS", - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS", - "C4_SEMANTIC_ROLES" - ], - "evidence_sufficient": true - }, - "llm": { - "answer_status": "answered", - "groundedness": "grounded" - } - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "ARCHITECTURE", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C4_SEMANTIC_ROLES", - "C3_ENTRYPOINTS", - "C2_DEPENDENCY_GRAPH", - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "ControlPlaneService" - ], - "keyword_hints": [ - "ControlPlaneService" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "execution": { - "executed_layers": [ - "C4_SEMANTIC_ROLES", - "C3_ENTRYPOINTS", - "C2_DEPENDENCY_GRAPH", - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS" - ], - "retrieval_mode_by_layer": { - "C4_SEMANTIC_ROLES": "exact_path_fetch", - "C3_ENTRYPOINTS": "exact_path_fetch", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C1_SYMBOL_CATALOG": "symbol_search", - "C0_SOURCE_CHUNKS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C4_SEMANTIC_ROLES": 12, - "C3_ENTRYPOINTS": 8, - "C2_DEPENDENCY_GRAPH": 8, - "C1_SYMBOL_CATALOG": 6, - "C0_SOURCE_CHUNKS": 4 - }, - "filters_by_layer": { - "C4_SEMANTIC_ROLES": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C1_SYMBOL_CATALOG": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C4_SEMANTIC_ROLES", - "query": "Какие компоненты участвуют в ControlPlaneService?", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 12, - "ranking_profile": "code" - }, - { - "layer": "C3_ENTRYPOINTS", - "query": "Какие компоненты участвуют в ControlPlaneService?", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "Какие компоненты участвуют в ControlPlaneService?", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C1_SYMBOL_CATALOG", - "query": "ControlPlaneService", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Какие компоненты участвуют в ControlPlaneService?", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 4, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C4_SEMANTIC_ROLES", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 12, - "candidates_after_filter": 12 - }, - { - "layer": "C3_ENTRYPOINTS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 3, - "candidates_after_filter": 3 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 1, - "candidates_after_filter": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 4, - "candidates_after_filter": 4 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "ControlPlaneService", - "alternatives": [ - "ControlPlaneService" - ] - }, - "layers": [ - { - "layer": "C4_SEMANTIC_ROLES", - "status": "hit", - "hit_count": 12, - "fail_reason": null - }, - { - "layer": "C3_ENTRYPOINTS", - "status": "hit", - "hit_count": 3, - "fail_reason": null - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 8, - "fail_reason": null - }, - { - "layer": "C1_SYMBOL_CATALOG", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 1, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "router": 0, - "symbol_resolution": 0, - "retrieval_total": 137, - "retrieval_by_layer": { - "C4_SEMANTIC_ROLES": 31, - "C3_ENTRYPOINTS": 11, - "C2_DEPENDENCY_GRAPH": 54, - "C1_SYMBOL_CATALOG": 24, - "C0_SOURCE_CHUNKS": 15 - }, - "merge_rank": 20, - "prompt_build": 0, - "llm_call": 1849 - }, - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 544, - "evidence_rows": 25, - "evidence_chars": 3723 - }, - "evidence_summary": [ - { - "layer": "C4_SEMANTIC_ROLES", - "count": 12, - "unique_paths": 11 - }, - { - "layer": "C3_ENTRYPOINTS", - "count": 3, - "unique_paths": 1 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "count": 8, - "unique_paths": 1 - }, - { - "layer": "C1_SYMBOL_CATALOG", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 1, - "unique_paths": 1 - } - ], - "prompt_template_id": "intent_code_qa_architecture_ru_v2", - "system_prompt_version": "v1" - }, - "router": { - "conversation_mode": "START", - "keyword_hints": [ - "ControlPlaneService" - ], - "path_scope": [] - }, - "llm": { - "used_evidence_count": 25, - "missing_evidence_reason": null - } - }, - "run_info": { - "case_id": "plba-v2-architecture-control-plane", - "mode": "full_chain", - "run_started_at": "2026-03-12T13:23:57", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - }, - "input_request": { - "text": "Какие компоненты участвуют в ControlPlaneService?", - "normalized_query": "Какие компоненты участвуют в ControlPlaneService?" - }, - "steps": [ - { - "step": "intent_router", - "input": { - "query": "Какие компоненты участвуют в ControlPlaneService?" - }, - "output": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Какие компоненты участвуют в ControlPlaneService?" - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "ARCHITECTURE", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C4_SEMANTIC_ROLES", - "C3_ENTRYPOINTS", - "C2_DEPENDENCY_GRAPH", - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "ControlPlaneService" - ], - "keyword_hints": [ - "ControlPlaneService" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "timings_ms": { - "router": 0 - } - } - }, - { - "step": "retrieval", - "input": { - "query": "Какие компоненты участвуют в ControlPlaneService?" - }, - "output": { - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "ControlPlaneService", - "alternatives": [ - "ControlPlaneService" - ], - "confidence": 0.99 - }, - "rag_count": 25, - "rag_rows": [ - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests service\n- reads and writes state attributes\n- participates in dataflow slices (5)", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlPlaneService", - "span_start": 12, - "span_end": 52, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 68, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "b13471e5916986dccffb53fab613812842965705e6b3a89ae549d30c9e91e9aa", - "symbol_name": "ControlPlaneService", - "qname": "ControlPlaneService", - "role": "pipeline_stage", - "confidence": 0.57, - "dataflow_participation": 5, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "ControlActionSet\nrole: model\n\nResponsibilities:\n- default model role", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlActionSet", - "span_start": 14, - "span_end": 18, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 40, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "46eb026cb3313415ec47b82dd22f84f4d112c9d987e8b1716dcb0baa1cce8988", - "symbol_name": "ControlActionSet", - "qname": "ControlActionSet", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "ControlChannel\nrole: model\n\nResponsibilities:\n- default model role", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlChannel", - "span_start": 21, - "span_end": 28, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 40, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "cfcfe9a311d3a2dbdaf32ac4ccd73c0eb9a117f830591a1c0867ee97d46204ff", - "symbol_name": "ControlChannel", - "qname": "ControlChannel", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_runner.py", - "content": "UvicornThreadRunner\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (24)", - "layer": "C4_SEMANTIC_ROLES", - "title": "UvicornThreadRunner", - "span_start": 10, - "span_end": 61, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 11, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "fd55630045a02100df8877ac27d951ee08617d4598764394d48cb51fe067476a", - "symbol_name": "UvicornThreadRunner", - "qname": "UvicornThreadRunner", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 24, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "3779fdd2878b770e789a35bb2a89c9d79f13b61c26d7db1b3b683f9bb9e1623f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (10)", - "layer": "C4_SEMANTIC_ROLES", - "title": "HttpControlChannel", - "span_start": 12, - "span_end": 57, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 21, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "1c9fbdc24819e5604c26ea55428a74310f03a03e1af197ed84846af61e42fdb0", - "symbol_name": "HttpControlChannel", - "qname": "HttpControlChannel", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 10, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "HttpControlAppFactory\nrole: factory\n\nResponsibilities:\n- name suffix suggests factory", - "layer": "C4_SEMANTIC_ROLES", - "title": "HttpControlAppFactory", - "span_start": 15, - "span_end": 53, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 39, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "9b3502a5fb408b273223db13264349cf500de24915b6c649d9ea8970d0dfd8e0", - "symbol_name": "HttpControlAppFactory", - "qname": "HttpControlAppFactory", - "role": "factory", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/persistence/workflow_persistence.py", - "content": "WorkflowPersistence\nrole: pipeline_stage\n\nResponsibilities:\n- orchestrates role-like calls (2)\n- reads and writes state attributes\n- participates in dataflow slices (16)", - "layer": "C4_SEMANTIC_ROLES", - "title": "WorkflowPersistence", - "span_start": 8, - "span_end": 54, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 15, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "7bd01ee45cf31f2d5c2e3e51656254860ac785d10cef9e0852cd4fba90857bae", - "symbol_name": "WorkflowPersistence", - "qname": "WorkflowPersistence", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 16, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "80e9410ddc639789b4353c2a1a757ba8d0d5b5bb6075b0b263b61551f04ae1f0", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/queue/in_memory.py", - "content": "InMemoryTaskQueue\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (9)", - "layer": "C4_SEMANTIC_ROLES", - "title": "InMemoryTaskQueue", - "span_start": 9, - "span_end": 38, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 22, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "2da04cb94544a3bcbf0943a95ad4bdd8710bcafaa32a02fd0e4de2178dcf3533", - "symbol_name": "InMemoryTaskQueue", - "qname": "InMemoryTaskQueue", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 9, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "58f0cc001ccda0eee4c6bc32ed83bd05eafd6b6644f1e8b4aa9eed3103db73dc", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/config/file_loader.py", - "content": "ConfigFileLoader\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (8)", - "layer": "C4_SEMANTIC_ROLES", - "title": "ConfigFileLoader", - "span_start": 11, - "span_end": 48, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 23, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "a8474eca8b6e9dc86ae67ed68b16fa5fb639ef08739c053e7b7195489765667f", - "symbol_name": "ConfigFileLoader", - "qname": "ConfigFileLoader", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 8, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "1f19ffebde5e38e4be5a5d5a678059a0f36dedb8fb8b3e00ab395c67106a87ea", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/store.py", - "content": "TraceContextStore\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (6)", - "layer": "C4_SEMANTIC_ROLES", - "title": "TraceContextStore", - "span_start": 15, - "span_end": 52, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 25, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "b2dad4fbe16ffb11b58deba311c7739955c39d59f291b22181f33e9c8cce4059", - "symbol_name": "TraceContextStore", - "qname": "TraceContextStore", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 6, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "d369554f08fc92039c6edd5a2a1e73b23901533e8974459170bbd9347d263dc5", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workers/supervisor.py", - "content": "WorkerSupervisor\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (6)", - "layer": "C4_SEMANTIC_ROLES", - "title": "WorkerSupervisor", - "span_start": 10, - "span_end": 59, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 25, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "c17b44e8d9e97d490989b21fa67d7c346cdda8a0472e4c41fb243c8846faa124", - "symbol_name": "WorkerSupervisor", - "qname": "WorkerSupervisor", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 6, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "77609d9d5927171cce7fc3a54897c183fd63068710c6362029b700937aae5eee", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/engine/workflow_engine.py", - "content": "WorkflowEngine\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (6)", - "layer": "C4_SEMANTIC_ROLES", - "title": "WorkflowEngine", - "span_start": 10, - "span_end": 86, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 25, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "57ec0a9f11c542c78e008684a888397e8d9ef4223671acb2567e631a0cbc70b4", - "symbol_name": "WorkflowEngine", - "qname": "WorkflowEngine", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 6, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "1057136e58a325cd5ab6f4e265d15665fb6a711b7022d9fab52a1a290afa2368", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._start_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 47, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517", - "dst_ref": "ControlPlaneService._start_async", - "resolution": "resolved", - "slice_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._start_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.register_channel", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 17, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957", - "dst_ref": "ControlPlaneService.register_channel", - "resolution": "resolved", - "slice_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.register_channel" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.start", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 20, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154", - "dst_ref": "ControlPlaneService.start", - "resolution": "resolved", - "slice_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.start" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.stop", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 25, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d", - "dst_ref": "ControlPlaneService.stop", - "resolution": "resolved", - "slice_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.stop" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._stop_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 51, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a", - "dst_ref": "ControlPlaneService._stop_async", - "resolution": "resolved", - "slice_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._stop_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.start calls asyncio.run", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.start:calls", - "span_start": 22, - "span_end": 22, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "4e0b3147fb867d48d26567570c259f4052a739e3098133802d4b8bafcf03be6b", - "edge_type": "calls", - "src_symbol_id": "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154", - "src_qname": "ControlPlaneService.start", - "dst_symbol_id": null, - "dst_ref": "asyncio.run", - "resolution": "partial", - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.register_channel reads_attr ControlPlaneService._channels", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.register_channel:reads_attr", - "span_start": 17, - "span_end": 17, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "3101fdc99a7a9c5aebf18a024bc148d37b348248a6fd02b95724dff280f2908a", - "edge_type": "reads_attr", - "src_symbol_id": "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957", - "src_qname": "ControlPlaneService.register_channel", - "dst_symbol_id": null, - "dst_ref": "ControlPlaneService._channels", - "resolution": "partial", - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.start reads_attr ControlPlaneService._channels", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.start:reads_attr", - "span_start": 20, - "span_end": 20, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "9452e50ef27d47c30ee1c311c48fe73ecddbf7a6dbcf967a6345e98222d9f71a", - "edge_type": "reads_attr", - "src_symbol_id": "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154", - "src_qname": "ControlPlaneService.start", - "dst_symbol_id": null, - "dst_ref": "ControlPlaneService._channels", - "resolution": "partial", - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "class ControlPlaneService\nControlPlaneService", - "layer": "C1_SYMBOL_CATALOG", - "title": "ControlPlaneService", - "span_start": 12, - "span_end": 52, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "b13471e5916986dccffb53fab613812842965705e6b3a89ae549d30c9e91e9aa", - "qname": "ControlPlaneService", - "kind": "class", - "signature": "ControlPlaneService", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.control.service", - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "class ControlPlaneService:\n def __init__(self) -> None:\n self._channels: list[ControlChannel] = []\n\n def register_channel(self, channel: ControlChannel) -> None:\n self._channels.append(channel)\n\n def start(self, runtime: RuntimeManager) -> None:\n if not self._channels:\n return\n asyncio.run(self._start_async(runtime))\n\n def stop(self) -> None:\n if not self._channels:\n return\n asyncio.run(self._stop_async())\n\n def snapshot(self, runtime: RuntimeManager) -> dict[str, object]:\n health = runtime.current_health()\n return {\n \"runtime\": {\"state\": runtime._state.value},\n \"modules\": list(runtime.registry.modules),\n \"services\": runtime.services.snapshot(),\n \"workers\": runtime.workers.snapshot(),\n \"health\": runtime.health.snapshot(runtime.workers.healths()) | {\"status\": health[\"status\"]},\n \"config\": runtime.configuration.get(),\n }\n\n async def _start_async(self, runtime: RuntimeManager) -> None:\n actions = ControlActionSet(\n health=runtime.health_status,\n start=runtime.start_runtime,\n stop=runtime.stop_runtime,\n status=runtime.runtime_status,\n )\n for channel in self._channels:\n await channel.start(actions)\n\n async def _stop_async(self) -> None:\n for channel in reversed(self._channels):\n await channel.stop()", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/service.py:ControlPlaneService", - "span_start": 12, - "span_end": 52, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.service", - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ] - }, - "diagnostics": { - "execution": { - "executed_layers": [ - "C4_SEMANTIC_ROLES", - "C3_ENTRYPOINTS", - "C2_DEPENDENCY_GRAPH", - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS" - ], - "retrieval_mode_by_layer": { - "C4_SEMANTIC_ROLES": "exact_path_fetch", - "C3_ENTRYPOINTS": "exact_path_fetch", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C1_SYMBOL_CATALOG": "symbol_search", - "C0_SOURCE_CHUNKS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C4_SEMANTIC_ROLES": 12, - "C3_ENTRYPOINTS": 8, - "C2_DEPENDENCY_GRAPH": 8, - "C1_SYMBOL_CATALOG": 6, - "C0_SOURCE_CHUNKS": 4 - }, - "filters_by_layer": { - "C4_SEMANTIC_ROLES": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C1_SYMBOL_CATALOG": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C4_SEMANTIC_ROLES", - "query": "Какие компоненты участвуют в ControlPlaneService?", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 12, - "ranking_profile": "code" - }, - { - "layer": "C3_ENTRYPOINTS", - "query": "Какие компоненты участвуют в ControlPlaneService?", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "Какие компоненты участвуют в ControlPlaneService?", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C1_SYMBOL_CATALOG", - "query": "ControlPlaneService", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Какие компоненты участвуют в ControlPlaneService?", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 4, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C4_SEMANTIC_ROLES", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 12, - "candidates_after_filter": 12 - }, - { - "layer": "C3_ENTRYPOINTS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 3, - "candidates_after_filter": 3 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 1, - "candidates_after_filter": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 4, - "candidates_after_filter": 4 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "ControlPlaneService", - "alternatives": [ - "ControlPlaneService" - ] - }, - "layers": [ - { - "layer": "C4_SEMANTIC_ROLES", - "status": "hit", - "hit_count": 12, - "fail_reason": null - }, - { - "layer": "C3_ENTRYPOINTS", - "status": "hit", - "hit_count": 3, - "fail_reason": null - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 8, - "fail_reason": null - }, - { - "layer": "C1_SYMBOL_CATALOG", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 1, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "symbol_resolution": 0, - "retrieval_total": 137, - "retrieval_by_layer": { - "C4_SEMANTIC_ROLES": 31, - "C3_ENTRYPOINTS": 11, - "C2_DEPENDENCY_GRAPH": 54, - "C1_SYMBOL_CATALOG": 24, - "C0_SOURCE_CHUNKS": 15 - }, - "merge_rank": 20 - } - } - }, - { - "step": "llm_answer", - "input": { - "query": "Какие компоненты участвуют в ControlPlaneService?", - "rag_count": 25 - }, - "output": { - "llm_answer": "1. **Компоненты, которые подтверждены контекстом**:\n - ControlPlaneService\n - ControlActionSet\n\n2. **Подтверждённые связи между ними**:\n - ControlPlaneService имеет метод `__init__`, который включает инициализацию внутренних каналов (`_channels`) и регистрацию этих каналов через метод `_register_channel`.\n - Контейнер `ControlActionSet` указан как модель с ролью «model», что подразумевает его использование внутри `ControlPlaneService`. Однако конкретные детали взаимодействия между этими двумя компонентами отсутствуют в представленном контексте.\n\n3. **Границы ответственности, если они реально видны в коде**:\n - ControlPlaneService отвечает за управление состоянием и участие в данных срезах (dataflow slices).\n - ControlActionSet является моделью с базовой ролью «model».\n\n4. **Что остаётся неизвестным или неполным**:\n - Детали взаимодействия между ControlPlaneService и ControlActionSet остаются неясными, так как отсутствует информация о конкретных методах и функциях, вызываемых между этими компонентами.\n - Неизвестно, какие именно данные передаются между компонентами и каким образом происходит обмен информацией." - }, - "diagnostics": { - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 544, - "evidence_rows": 25, - "evidence_chars": 3723 - }, - "evidence_summary": [ - { - "layer": "C4_SEMANTIC_ROLES", - "count": 12, - "unique_paths": 11 - }, - { - "layer": "C3_ENTRYPOINTS", - "count": 3, - "unique_paths": 1 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "count": 8, - "unique_paths": 1 - }, - { - "layer": "C1_SYMBOL_CATALOG", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 1, - "unique_paths": 1 - } - ], - "prompt_template_id": "intent_code_qa_architecture_ru_v2", - "system_prompt_version": "v1" - }, - "timings_ms": { - "prompt_build": 0, - "llm_call": 1849 - } - } - } - ] - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_132357/full_chain_plba_code_subintents_v2_plba-v2-architecture-control-plane.md b/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_132357/full_chain_plba_code_subintents_v2_plba-v2-architecture-control-plane.md deleted file mode 100644 index 2c68ad7..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_132357/full_chain_plba_code_subintents_v2_plba-v2-architecture-control-plane.md +++ /dev/null @@ -1,34 +0,0 @@ -# plba-v2-architecture-control-plane - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_subintents_v2.yaml -- runner: runtime -- mode: full_chain -- passed: True - -## Query -Какие компоненты участвуют в ControlPlaneService? - -## Actual -{ - "intent": "CODE_QA", - "sub_intent": "ARCHITECTURE", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 25, - "llm_answer": "1. **Компоненты, которые подтверждены контекстом**:\n - ControlPlaneService\n - ControlActionSet\n\n2. **Подтверждённые связи между ними**:\n - ControlPlaneService имеет метод `__init__`, который включает инициализацию внутренних каналов (`_channels`) и регистрацию этих каналов через метод `_register_channel`.\n - Контейнер `ControlActionSet` указан как модель с ролью «model», что подразумевает его использование внутри `ControlPlaneService`. Однако конкретные детали взаимодействия между этими двумя компонентами отсутствуют в представленном контексте.\n\n3. **Границы ответственности, если они реально видны в коде**:\n - ControlPlaneService отвечает за управление состоянием и участие в данных срезах (dataflow slices).\n - ControlActionSet является моделью с базовой ролью «model».\n\n4. **Что остаётся неизвестным или неполным**:\n - Детали взаимодействия между ControlPlaneService и ControlActionSet остаются неясными, так как отсутствует информация о конкретных методах и функциях, вызываемых между этими компонентами.\n - Неизвестно, какие именно данные передаются между компонентами и каким образом происходит обмен информацией.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "ControlPlaneService" - ], - "layers": [ - "C4_SEMANTIC_ROLES", - "C3_ENTRYPOINTS", - "C2_DEPENDENCY_GRAPH", - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS" - ] -} - -## Mismatches -- none \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_132357/full_chain_plba_code_subintents_v2_plba-v2-architecture-runtime-manager.json b/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_132357/full_chain_plba_code_subintents_v2_plba-v2-architecture-runtime-manager.json deleted file mode 100644 index f1220d5..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_132357/full_chain_plba_code_subintents_v2_plba-v2-architecture-runtime-manager.json +++ /dev/null @@ -1,3036 +0,0 @@ -{ - "case_id": "plba-v2-architecture-runtime-manager", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_subintents_v2.yaml", - "runner": "runtime", - "mode": "full_chain", - "actual": { - "intent": "CODE_QA", - "sub_intent": "ARCHITECTURE", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 25, - "llm_answer": "1. **Компоненты, которые подтверждены контекстом**:\n - RuntimeManager\n - ControlActionSet\n - ControlPlaneService\n \n2. **Подтверждённые связи между ними**:\n - RuntimeManager вызывает метод `start` для начала работы.\n - ControlPlaneService инициализирует каналы (`_channels`) и запускает асинхронную обработку (`_start_async`).\n \n3. **Границы ответственности, если они реально видны в коде**:\n - RuntimeManager отвечает за управление жизненным циклом runtime-среды и координирует выполнение различных ролей (название указывает на менеджерскую роль).\n - ControlActionSet выполняет действия модели, являясь стандартным модельным компонентом.\n - ControlPlaneService управляет сервисными каналами и инициирует асинхронные процессы.\n\n4. **Что остаётся неизвестным или неполным**:\n - Детали взаимодействия между конкретными ролями и точная структура обмена данными через каналы в ControlPlaneService.\n - Точный механизм, каким образом RuntimeManager организует и контролирует данные потоки внутри runtime-среды.\n - Полная картина зависимостей и связей между остальными сущностями приложения, которые могут влиять на работу RuntimeManager и его окружения.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "RuntimeManager" - ], - "layers": [ - "C4_SEMANTIC_ROLES", - "C3_ENTRYPOINTS", - "C2_DEPENDENCY_GRAPH", - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS" - ] - }, - "passed": true, - "mismatches": [], - "details": { - "case_id": "plba-v2-architecture-runtime-manager", - "text": "Какие компоненты участвуют в RuntimeManager?", - "mode": "full_chain", - "run_started_at": "2026-03-12T13:23:57", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Какие компоненты участвуют в RuntimeManager?", - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "RuntimeManager", - "alternatives": [ - "RuntimeManager" - ], - "confidence": 0.99 - }, - "rag_count": 25, - "rag_rows": [ - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests manager\n- orchestrates role-like calls (4)\n- reads and writes state attributes\n- participates in dataflow slices (50)", - "layer": "C4_SEMANTIC_ROLES", - "title": "RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 43, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "7e4a9381328c5803bbc6179458612fc4e947d928aa7bf8b4b2bebb2c8592f758", - "symbol_name": "RuntimeManager", - "qname": "RuntimeManager", - "role": "pipeline_stage", - "confidence": 0.67, - "dataflow_participation": 50, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "ControlActionSet\nrole: model\n\nResponsibilities:\n- default model role", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlActionSet", - "span_start": 14, - "span_end": 18, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 40, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "46eb026cb3313415ec47b82dd22f84f4d112c9d987e8b1716dcb0baa1cce8988", - "symbol_name": "ControlActionSet", - "qname": "ControlActionSet", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "ControlChannel\nrole: model\n\nResponsibilities:\n- default model role", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlChannel", - "span_start": 21, - "span_end": 28, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 40, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "cfcfe9a311d3a2dbdaf32ac4ccd73c0eb9a117f830591a1c0867ee97d46204ff", - "symbol_name": "ControlChannel", - "qname": "ControlChannel", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests service\n- reads and writes state attributes\n- participates in dataflow slices (5)", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlPlaneService", - "span_start": 12, - "span_end": 52, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 68, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "b13471e5916986dccffb53fab613812842965705e6b3a89ae549d30c9e91e9aa", - "symbol_name": "ControlPlaneService", - "qname": "ControlPlaneService", - "role": "pipeline_stage", - "confidence": 0.57, - "dataflow_participation": 5, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_runner.py", - "content": "UvicornThreadRunner\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (24)", - "layer": "C4_SEMANTIC_ROLES", - "title": "UvicornThreadRunner", - "span_start": 10, - "span_end": 61, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 11, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "fd55630045a02100df8877ac27d951ee08617d4598764394d48cb51fe067476a", - "symbol_name": "UvicornThreadRunner", - "qname": "UvicornThreadRunner", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 24, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "3779fdd2878b770e789a35bb2a89c9d79f13b61c26d7db1b3b683f9bb9e1623f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (10)", - "layer": "C4_SEMANTIC_ROLES", - "title": "HttpControlChannel", - "span_start": 12, - "span_end": 57, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 21, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "1c9fbdc24819e5604c26ea55428a74310f03a03e1af197ed84846af61e42fdb0", - "symbol_name": "HttpControlChannel", - "qname": "HttpControlChannel", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 10, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "HttpControlAppFactory\nrole: factory\n\nResponsibilities:\n- name suffix suggests factory", - "layer": "C4_SEMANTIC_ROLES", - "title": "HttpControlAppFactory", - "span_start": 15, - "span_end": 53, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 39, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "9b3502a5fb408b273223db13264349cf500de24915b6c649d9ea8970d0dfd8e0", - "symbol_name": "HttpControlAppFactory", - "qname": "HttpControlAppFactory", - "role": "factory", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/persistence/workflow_persistence.py", - "content": "WorkflowPersistence\nrole: pipeline_stage\n\nResponsibilities:\n- orchestrates role-like calls (2)\n- reads and writes state attributes\n- participates in dataflow slices (16)", - "layer": "C4_SEMANTIC_ROLES", - "title": "WorkflowPersistence", - "span_start": 8, - "span_end": 54, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 15, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "7bd01ee45cf31f2d5c2e3e51656254860ac785d10cef9e0852cd4fba90857bae", - "symbol_name": "WorkflowPersistence", - "qname": "WorkflowPersistence", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 16, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "80e9410ddc639789b4353c2a1a757ba8d0d5b5bb6075b0b263b61551f04ae1f0", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/queue/in_memory.py", - "content": "InMemoryTaskQueue\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (9)", - "layer": "C4_SEMANTIC_ROLES", - "title": "InMemoryTaskQueue", - "span_start": 9, - "span_end": 38, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 22, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "2da04cb94544a3bcbf0943a95ad4bdd8710bcafaa32a02fd0e4de2178dcf3533", - "symbol_name": "InMemoryTaskQueue", - "qname": "InMemoryTaskQueue", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 9, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "58f0cc001ccda0eee4c6bc32ed83bd05eafd6b6644f1e8b4aa9eed3103db73dc", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/config/file_loader.py", - "content": "ConfigFileLoader\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (8)", - "layer": "C4_SEMANTIC_ROLES", - "title": "ConfigFileLoader", - "span_start": 11, - "span_end": 48, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 23, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "a8474eca8b6e9dc86ae67ed68b16fa5fb639ef08739c053e7b7195489765667f", - "symbol_name": "ConfigFileLoader", - "qname": "ConfigFileLoader", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 8, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "1f19ffebde5e38e4be5a5d5a678059a0f36dedb8fb8b3e00ab395c67106a87ea", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/store.py", - "content": "TraceContextStore\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (6)", - "layer": "C4_SEMANTIC_ROLES", - "title": "TraceContextStore", - "span_start": 15, - "span_end": 52, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 25, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "b2dad4fbe16ffb11b58deba311c7739955c39d59f291b22181f33e9c8cce4059", - "symbol_name": "TraceContextStore", - "qname": "TraceContextStore", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 6, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "d369554f08fc92039c6edd5a2a1e73b23901533e8974459170bbd9347d263dc5", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workers/supervisor.py", - "content": "WorkerSupervisor\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (6)", - "layer": "C4_SEMANTIC_ROLES", - "title": "WorkerSupervisor", - "span_start": 10, - "span_end": 59, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 25, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "c17b44e8d9e97d490989b21fa67d7c346cdda8a0472e4c41fb243c8846faa124", - "symbol_name": "WorkerSupervisor", - "qname": "WorkerSupervisor", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 6, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "77609d9d5927171cce7fc3a54897c183fd63068710c6362029b700937aae5eee", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._start_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 47, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517", - "dst_ref": "ControlPlaneService._start_async", - "resolution": "resolved", - "slice_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._start_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager.start", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 32, - "span_end": 59, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "98312ace7fc62b1c7194c5aa1732b6ef736eae1668a3a120dd1ecd5ab1d64f7a", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "77a7b260193018845e4e204df094ab89cfd7c82ee4e822b3a83ad4cd945f9cb1", - "dst_ref": "RuntimeManager.start", - "resolution": "resolved", - "slice_id": "98312ace7fc62b1c7194c5aa1732b6ef736eae1668a3a120dd1ecd5ab1d64f7a", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager.start" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "77a7b260193018845e4e204df094ab89cfd7c82ee4e822b3a83ad4cd945f9cb1" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.start", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 20, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154", - "dst_ref": "ControlPlaneService.start", - "resolution": "resolved", - "slice_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.start" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.stop", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 25, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d", - "dst_ref": "ControlPlaneService.stop", - "resolution": "resolved", - "slice_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.stop" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._stop_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 51, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a", - "dst_ref": "ControlPlaneService._stop_async", - "resolution": "resolved", - "slice_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._stop_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager.add_config_file", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 32, - "span_end": 52, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "a23b8a11ebdb12708b60c96ea12a69f7f042082f1adfddd572444e246d81d167", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "57ffbd4f0d9fdf3507c2b8624312ce211f3d02fdf86a57a8ec90778d8a7b498d", - "dst_ref": "RuntimeManager.add_config_file", - "resolution": "resolved", - "slice_id": "a23b8a11ebdb12708b60c96ea12a69f7f042082f1adfddd572444e246d81d167", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager.add_config_file" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "57ffbd4f0d9fdf3507c2b8624312ce211f3d02fdf86a57a8ec90778d8a7b498d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.register_channel", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 17, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957", - "dst_ref": "ControlPlaneService.register_channel", - "resolution": "resolved", - "slice_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.register_channel" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager._register_core_services", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 32, - "span_end": 127, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "3e5811f3b511fa0cabe363f5d01f2ac5fa039bc8b93f7ee108323e1f5f45a293", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "972d6057a6caac9cf31ebc1e29c6f39f71b10d4cc170dec57cf875ba458549c6", - "dst_ref": "RuntimeManager._register_core_services", - "resolution": "resolved", - "slice_id": "3e5811f3b511fa0cabe363f5d01f2ac5fa039bc8b93f7ee108323e1f5f45a293", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager._register_core_services" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "972d6057a6caac9cf31ebc1e29c6f39f71b10d4cc170dec57cf875ba458549c6" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "class RuntimeManager\nRuntimeManager", - "layer": "C1_SYMBOL_CATALOG", - "title": "RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "7e4a9381328c5803bbc6179458612fc4e947d928aa7bf8b4b2bebb2c8592f758", - "qname": "RuntimeManager", - "kind": "class", - "signature": "RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.core.runtime", - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "class RuntimeManager:\n ACTION_TIMEOUT_SECONDS = 10.0\n ACTION_POLL_INTERVAL_SECONDS = 0.05\n\n def __init__(\n self,\n configuration: ConfigurationManager | None = None,\n services: ServiceContainer | None = None,\n traces: TraceService | None = None,\n health: HealthRegistry | None = None,\n logs: LogManager | None = None,\n workers: WorkerSupervisor | None = None,\n control_plane: ControlPlaneService | None = None,\n ) -> None:\n self.configuration = configuration or ConfigurationManager()\n self.services = services or ServiceContainer()\n self.traces = traces or TraceService()\n self.health = health or HealthRegistry()\n self.logs = logs or LogManager()\n self.workers = workers or WorkerSupervisor()\n self.control_plane = control_plane or ControlPlaneService()\n self.registry = ModuleRegistry(self.services)\n self._started = False\n self._state = LifecycleState.IDLE\n self._core_registered = False\n self._workers_registered = False\n self._register_core_services()\n\n def register_module(self, module: ApplicationModule) -> None:\n self.registry.register_module(module.name)\n module.register(self.registry)\n\n def add_config_file(self, path: str) -> FileConfigProvider:\n provider = FileConfigProvider(path)\n self.configuration.add_provider(provider)\n return provider\n\n def start(self, *, start_control_plane: bool = True) -> None:\n if self._started:\n return\n self._state = LifecycleState.STARTING\n config = self.configuration.load()\n self.logs.apply_config(config)\n self._register_health_contributors()\n self._register_workers()\n self.workers.start()\n if start_control_plane:\n self.control_plane.start(self)\n self._started = True\n self._refresh_state()\n\n def stop(self, timeout: float = 30.0, force: bool = False, stop_control_plane: bool = True) -> None:\n if not self._started:\n return\n self._state = LifecycleState.STOPPING\n self.workers.stop(timeout=timeout, force=force)\n if stop_control_plane:\n self.control_plane.stop()\n self._started = False\n self._state = LifecycleState.STOPPED\n\n def status(self) -> dict[str, object]:\n self._refresh_state()\n return self.control_plane.snapshot(self)\n\n def current_health(self) -> HealthPayload:\n self._refresh_state()\n return self.health.payload(self._state, self.workers.healths())\n\n async def health_status(self) -> HealthPayload:\n return self.current_health()\n\n async def start_runtime(self) -> dict[str, object] | str:\n self._refresh_state()\n if self._started:\n return \"runtime already running\"\n if self._state == LifecycleState.STOPPING:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n\n self.start(start_control_plane=False)\n started = self._wait_for_state({LifecycleState.IDLE, LifecycleState.BUSY}, timeout=self.ACTION_TIMEOUT_SECONDS)\n if started:\n return self._action_detail(\"runtime started\", timed_out=False)\n return self._action_detail(\"runtime start is still in progress\", timed_out=True)\n\n async def stop_runtime(self) -> dict[str, object] | str:\n self._refresh_state()\n if not self._started:\n if self._state == LifecycleState.STOPPING:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n return \"runtime already stopped\"\n\n self._state = LifecycleState.STOPPING\n try:\n self.workers.stop(timeout=self.ACTION_TIMEOUT_SECONDS, force=False)\n except TimeoutError:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n\n self._started = False\n self._state = LifecycleState.STOPPED\n return self._action_detail(\"runtime stopped\", timed_out=False)\n\n async def runtime_status(self) -> str:\n self._refresh_state()\n return self._state.value\n\n def _register_core_services(self) -> None:\n if self._core_registered:\n return\n self.services.register(\"configuration\", self.configuration)\n self.services.register(\"traces\", self.traces)\n self.services.register(\"health\", self.health)\n self.services.register(\"logs\", self.logs)\n self.services.register(\"workers\", self.workers)\n self.services.register(\"control_plane\", self.control_plane)\n self._core_registered = True\n\n def _register_health_contributors(self) -> None:\n for contributor in self.registry.health_contributors:\n self.health.register(contributor)\n\n def _register_workers(self) -> None:\n if self._workers_registered:\n return\n for worker in self.registry.workers:\n self.workers.register(worker)\n self._workers_registered = True\n\n def _refresh_state(self) -> None:\n lifecycle = self.workers.lifecycle_state()\n\n if self._state == LifecycleState.STOPPING:\n if lifecycle == LifecycleState.STOPPED:\n self._started = False\n self._state = LifecycleState.STOPPED\n return\n\n if not self._started:\n if lifecycle == LifecycleState.STOPPED:\n self._state = LifecycleState.STOPPED\n return\n\n self._state = lifecycle\n\n def _wait_for_state(self, target_states: set[LifecycleState], *, timeout: float) -> bool:\n deadline = monotonic() + timeout\n while monotonic() < deadline:\n self._refresh_state()\n if self._state in target_states:\n return True\n sleep(self.ACTION_POLL_INTERVAL_SECONDS)\n self._refresh_state()\n return self._state in target_states\n\n def _action_detail(self, message: str, *, timed_out: bool) -> dict[str, object]:\n self._refresh_state()\n return {\n \"message\": message,\n \"state\": self._state.value,\n \"timed_out\": timed_out,\n \"workers\": self.workers.snapshot(),\n }", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/core/runtime.py:RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.core.runtime", - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "llm_answer": "1. **Компоненты, которые подтверждены контекстом**:\n - RuntimeManager\n - ControlActionSet\n - ControlPlaneService\n \n2. **Подтверждённые связи между ними**:\n - RuntimeManager вызывает метод `start` для начала работы.\n - ControlPlaneService инициализирует каналы (`_channels`) и запускает асинхронную обработку (`_start_async`).\n \n3. **Границы ответственности, если они реально видны в коде**:\n - RuntimeManager отвечает за управление жизненным циклом runtime-среды и координирует выполнение различных ролей (название указывает на менеджерскую роль).\n - ControlActionSet выполняет действия модели, являясь стандартным модельным компонентом.\n - ControlPlaneService управляет сервисными каналами и инициирует асинхронные процессы.\n\n4. **Что остаётся неизвестным или неполным**:\n - Детали взаимодействия между конкретными ролями и точная структура обмена данными через каналы в ControlPlaneService.\n - Точный механизм, каким образом RuntimeManager организует и контролирует данные потоки внутри runtime-среды.\n - Полная картина зависимостей и связей между остальными сущностями приложения, которые могут влиять на работу RuntimeManager и его окружения.", - "summary": { - "router": { - "intent": "CODE_QA", - "sub_intent": "ARCHITECTURE", - "confidence": null - }, - "retrieval": { - "profile": "code", - "layers_hit": [ - "C0_SOURCE_CHUNKS", - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS", - "C4_SEMANTIC_ROLES" - ], - "evidence_sufficient": true - }, - "llm": { - "answer_status": "answered", - "groundedness": "grounded" - } - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "ARCHITECTURE", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C4_SEMANTIC_ROLES", - "C3_ENTRYPOINTS", - "C2_DEPENDENCY_GRAPH", - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "RuntimeManager" - ], - "keyword_hints": [ - "RuntimeManager" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "execution": { - "executed_layers": [ - "C4_SEMANTIC_ROLES", - "C3_ENTRYPOINTS", - "C2_DEPENDENCY_GRAPH", - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS" - ], - "retrieval_mode_by_layer": { - "C4_SEMANTIC_ROLES": "exact_path_fetch", - "C3_ENTRYPOINTS": "exact_path_fetch", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C1_SYMBOL_CATALOG": "symbol_search", - "C0_SOURCE_CHUNKS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C4_SEMANTIC_ROLES": 12, - "C3_ENTRYPOINTS": 8, - "C2_DEPENDENCY_GRAPH": 8, - "C1_SYMBOL_CATALOG": 6, - "C0_SOURCE_CHUNKS": 4 - }, - "filters_by_layer": { - "C4_SEMANTIC_ROLES": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C1_SYMBOL_CATALOG": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C4_SEMANTIC_ROLES", - "query": "Какие компоненты участвуют в RuntimeManager?", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 12, - "ranking_profile": "code" - }, - { - "layer": "C3_ENTRYPOINTS", - "query": "Какие компоненты участвуют в RuntimeManager?", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "Какие компоненты участвуют в RuntimeManager?", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C1_SYMBOL_CATALOG", - "query": "RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Какие компоненты участвуют в RuntimeManager?", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 4, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C4_SEMANTIC_ROLES", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 12, - "candidates_after_filter": 12 - }, - { - "layer": "C3_ENTRYPOINTS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 3, - "candidates_after_filter": 3 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 1, - "candidates_after_filter": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 4, - "candidates_after_filter": 4 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "RuntimeManager", - "alternatives": [ - "RuntimeManager" - ] - }, - "layers": [ - { - "layer": "C4_SEMANTIC_ROLES", - "status": "hit", - "hit_count": 12, - "fail_reason": null - }, - { - "layer": "C3_ENTRYPOINTS", - "status": "hit", - "hit_count": 3, - "fail_reason": null - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 8, - "fail_reason": null - }, - { - "layer": "C1_SYMBOL_CATALOG", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 1, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "router": 0, - "symbol_resolution": 0, - "retrieval_total": 138, - "retrieval_by_layer": { - "C4_SEMANTIC_ROLES": 26, - "C3_ENTRYPOINTS": 11, - "C2_DEPENDENCY_GRAPH": 56, - "C1_SYMBOL_CATALOG": 24, - "C0_SOURCE_CHUNKS": 18 - }, - "merge_rank": 17, - "prompt_build": 0, - "llm_call": 2117 - }, - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 537, - "evidence_rows": 25, - "evidence_chars": 8651 - }, - "evidence_summary": [ - { - "layer": "C4_SEMANTIC_ROLES", - "count": 12, - "unique_paths": 11 - }, - { - "layer": "C3_ENTRYPOINTS", - "count": 3, - "unique_paths": 1 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "count": 8, - "unique_paths": 2 - }, - { - "layer": "C1_SYMBOL_CATALOG", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 1, - "unique_paths": 1 - } - ], - "prompt_template_id": "intent_code_qa_architecture_ru_v2", - "system_prompt_version": "v1" - }, - "router": { - "conversation_mode": "START", - "keyword_hints": [ - "RuntimeManager" - ], - "path_scope": [] - }, - "llm": { - "used_evidence_count": 25, - "missing_evidence_reason": null - } - }, - "run_info": { - "case_id": "plba-v2-architecture-runtime-manager", - "mode": "full_chain", - "run_started_at": "2026-03-12T13:23:57", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - }, - "input_request": { - "text": "Какие компоненты участвуют в RuntimeManager?", - "normalized_query": "Какие компоненты участвуют в RuntimeManager?" - }, - "steps": [ - { - "step": "intent_router", - "input": { - "query": "Какие компоненты участвуют в RuntimeManager?" - }, - "output": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Какие компоненты участвуют в RuntimeManager?" - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "ARCHITECTURE", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C4_SEMANTIC_ROLES", - "C3_ENTRYPOINTS", - "C2_DEPENDENCY_GRAPH", - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "RuntimeManager" - ], - "keyword_hints": [ - "RuntimeManager" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "timings_ms": { - "router": 0 - } - } - }, - { - "step": "retrieval", - "input": { - "query": "Какие компоненты участвуют в RuntimeManager?" - }, - "output": { - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "RuntimeManager", - "alternatives": [ - "RuntimeManager" - ], - "confidence": 0.99 - }, - "rag_count": 25, - "rag_rows": [ - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests manager\n- orchestrates role-like calls (4)\n- reads and writes state attributes\n- participates in dataflow slices (50)", - "layer": "C4_SEMANTIC_ROLES", - "title": "RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 43, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "7e4a9381328c5803bbc6179458612fc4e947d928aa7bf8b4b2bebb2c8592f758", - "symbol_name": "RuntimeManager", - "qname": "RuntimeManager", - "role": "pipeline_stage", - "confidence": 0.67, - "dataflow_participation": 50, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "ControlActionSet\nrole: model\n\nResponsibilities:\n- default model role", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlActionSet", - "span_start": 14, - "span_end": 18, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 40, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "46eb026cb3313415ec47b82dd22f84f4d112c9d987e8b1716dcb0baa1cce8988", - "symbol_name": "ControlActionSet", - "qname": "ControlActionSet", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "ControlChannel\nrole: model\n\nResponsibilities:\n- default model role", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlChannel", - "span_start": 21, - "span_end": 28, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 40, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "cfcfe9a311d3a2dbdaf32ac4ccd73c0eb9a117f830591a1c0867ee97d46204ff", - "symbol_name": "ControlChannel", - "qname": "ControlChannel", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests service\n- reads and writes state attributes\n- participates in dataflow slices (5)", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlPlaneService", - "span_start": 12, - "span_end": 52, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 68, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "b13471e5916986dccffb53fab613812842965705e6b3a89ae549d30c9e91e9aa", - "symbol_name": "ControlPlaneService", - "qname": "ControlPlaneService", - "role": "pipeline_stage", - "confidence": 0.57, - "dataflow_participation": 5, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_runner.py", - "content": "UvicornThreadRunner\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (24)", - "layer": "C4_SEMANTIC_ROLES", - "title": "UvicornThreadRunner", - "span_start": 10, - "span_end": 61, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 11, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "fd55630045a02100df8877ac27d951ee08617d4598764394d48cb51fe067476a", - "symbol_name": "UvicornThreadRunner", - "qname": "UvicornThreadRunner", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 24, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "3779fdd2878b770e789a35bb2a89c9d79f13b61c26d7db1b3b683f9bb9e1623f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (10)", - "layer": "C4_SEMANTIC_ROLES", - "title": "HttpControlChannel", - "span_start": 12, - "span_end": 57, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 21, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "1c9fbdc24819e5604c26ea55428a74310f03a03e1af197ed84846af61e42fdb0", - "symbol_name": "HttpControlChannel", - "qname": "HttpControlChannel", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 10, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "HttpControlAppFactory\nrole: factory\n\nResponsibilities:\n- name suffix suggests factory", - "layer": "C4_SEMANTIC_ROLES", - "title": "HttpControlAppFactory", - "span_start": 15, - "span_end": 53, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 39, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "9b3502a5fb408b273223db13264349cf500de24915b6c649d9ea8970d0dfd8e0", - "symbol_name": "HttpControlAppFactory", - "qname": "HttpControlAppFactory", - "role": "factory", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/persistence/workflow_persistence.py", - "content": "WorkflowPersistence\nrole: pipeline_stage\n\nResponsibilities:\n- orchestrates role-like calls (2)\n- reads and writes state attributes\n- participates in dataflow slices (16)", - "layer": "C4_SEMANTIC_ROLES", - "title": "WorkflowPersistence", - "span_start": 8, - "span_end": 54, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 15, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "7bd01ee45cf31f2d5c2e3e51656254860ac785d10cef9e0852cd4fba90857bae", - "symbol_name": "WorkflowPersistence", - "qname": "WorkflowPersistence", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 16, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "80e9410ddc639789b4353c2a1a757ba8d0d5b5bb6075b0b263b61551f04ae1f0", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/queue/in_memory.py", - "content": "InMemoryTaskQueue\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (9)", - "layer": "C4_SEMANTIC_ROLES", - "title": "InMemoryTaskQueue", - "span_start": 9, - "span_end": 38, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 22, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "2da04cb94544a3bcbf0943a95ad4bdd8710bcafaa32a02fd0e4de2178dcf3533", - "symbol_name": "InMemoryTaskQueue", - "qname": "InMemoryTaskQueue", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 9, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "58f0cc001ccda0eee4c6bc32ed83bd05eafd6b6644f1e8b4aa9eed3103db73dc", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/config/file_loader.py", - "content": "ConfigFileLoader\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (8)", - "layer": "C4_SEMANTIC_ROLES", - "title": "ConfigFileLoader", - "span_start": 11, - "span_end": 48, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 23, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "a8474eca8b6e9dc86ae67ed68b16fa5fb639ef08739c053e7b7195489765667f", - "symbol_name": "ConfigFileLoader", - "qname": "ConfigFileLoader", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 8, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "1f19ffebde5e38e4be5a5d5a678059a0f36dedb8fb8b3e00ab395c67106a87ea", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/store.py", - "content": "TraceContextStore\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (6)", - "layer": "C4_SEMANTIC_ROLES", - "title": "TraceContextStore", - "span_start": 15, - "span_end": 52, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 25, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "b2dad4fbe16ffb11b58deba311c7739955c39d59f291b22181f33e9c8cce4059", - "symbol_name": "TraceContextStore", - "qname": "TraceContextStore", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 6, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "d369554f08fc92039c6edd5a2a1e73b23901533e8974459170bbd9347d263dc5", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workers/supervisor.py", - "content": "WorkerSupervisor\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (6)", - "layer": "C4_SEMANTIC_ROLES", - "title": "WorkerSupervisor", - "span_start": 10, - "span_end": 59, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 25, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "c17b44e8d9e97d490989b21fa67d7c346cdda8a0472e4c41fb243c8846faa124", - "symbol_name": "WorkerSupervisor", - "qname": "WorkerSupervisor", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 6, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "77609d9d5927171cce7fc3a54897c183fd63068710c6362029b700937aae5eee", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._start_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 47, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517", - "dst_ref": "ControlPlaneService._start_async", - "resolution": "resolved", - "slice_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._start_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager.start", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 32, - "span_end": 59, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "98312ace7fc62b1c7194c5aa1732b6ef736eae1668a3a120dd1ecd5ab1d64f7a", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "77a7b260193018845e4e204df094ab89cfd7c82ee4e822b3a83ad4cd945f9cb1", - "dst_ref": "RuntimeManager.start", - "resolution": "resolved", - "slice_id": "98312ace7fc62b1c7194c5aa1732b6ef736eae1668a3a120dd1ecd5ab1d64f7a", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager.start" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "77a7b260193018845e4e204df094ab89cfd7c82ee4e822b3a83ad4cd945f9cb1" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.start", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 20, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154", - "dst_ref": "ControlPlaneService.start", - "resolution": "resolved", - "slice_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.start" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.stop", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 25, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d", - "dst_ref": "ControlPlaneService.stop", - "resolution": "resolved", - "slice_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.stop" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._stop_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 51, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a", - "dst_ref": "ControlPlaneService._stop_async", - "resolution": "resolved", - "slice_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._stop_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager.add_config_file", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 32, - "span_end": 52, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "a23b8a11ebdb12708b60c96ea12a69f7f042082f1adfddd572444e246d81d167", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "57ffbd4f0d9fdf3507c2b8624312ce211f3d02fdf86a57a8ec90778d8a7b498d", - "dst_ref": "RuntimeManager.add_config_file", - "resolution": "resolved", - "slice_id": "a23b8a11ebdb12708b60c96ea12a69f7f042082f1adfddd572444e246d81d167", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager.add_config_file" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "57ffbd4f0d9fdf3507c2b8624312ce211f3d02fdf86a57a8ec90778d8a7b498d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.register_channel", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 17, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957", - "dst_ref": "ControlPlaneService.register_channel", - "resolution": "resolved", - "slice_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.register_channel" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager._register_core_services", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 32, - "span_end": 127, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "3e5811f3b511fa0cabe363f5d01f2ac5fa039bc8b93f7ee108323e1f5f45a293", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "972d6057a6caac9cf31ebc1e29c6f39f71b10d4cc170dec57cf875ba458549c6", - "dst_ref": "RuntimeManager._register_core_services", - "resolution": "resolved", - "slice_id": "3e5811f3b511fa0cabe363f5d01f2ac5fa039bc8b93f7ee108323e1f5f45a293", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager._register_core_services" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "972d6057a6caac9cf31ebc1e29c6f39f71b10d4cc170dec57cf875ba458549c6" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "class RuntimeManager\nRuntimeManager", - "layer": "C1_SYMBOL_CATALOG", - "title": "RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "7e4a9381328c5803bbc6179458612fc4e947d928aa7bf8b4b2bebb2c8592f758", - "qname": "RuntimeManager", - "kind": "class", - "signature": "RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.core.runtime", - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "class RuntimeManager:\n ACTION_TIMEOUT_SECONDS = 10.0\n ACTION_POLL_INTERVAL_SECONDS = 0.05\n\n def __init__(\n self,\n configuration: ConfigurationManager | None = None,\n services: ServiceContainer | None = None,\n traces: TraceService | None = None,\n health: HealthRegistry | None = None,\n logs: LogManager | None = None,\n workers: WorkerSupervisor | None = None,\n control_plane: ControlPlaneService | None = None,\n ) -> None:\n self.configuration = configuration or ConfigurationManager()\n self.services = services or ServiceContainer()\n self.traces = traces or TraceService()\n self.health = health or HealthRegistry()\n self.logs = logs or LogManager()\n self.workers = workers or WorkerSupervisor()\n self.control_plane = control_plane or ControlPlaneService()\n self.registry = ModuleRegistry(self.services)\n self._started = False\n self._state = LifecycleState.IDLE\n self._core_registered = False\n self._workers_registered = False\n self._register_core_services()\n\n def register_module(self, module: ApplicationModule) -> None:\n self.registry.register_module(module.name)\n module.register(self.registry)\n\n def add_config_file(self, path: str) -> FileConfigProvider:\n provider = FileConfigProvider(path)\n self.configuration.add_provider(provider)\n return provider\n\n def start(self, *, start_control_plane: bool = True) -> None:\n if self._started:\n return\n self._state = LifecycleState.STARTING\n config = self.configuration.load()\n self.logs.apply_config(config)\n self._register_health_contributors()\n self._register_workers()\n self.workers.start()\n if start_control_plane:\n self.control_plane.start(self)\n self._started = True\n self._refresh_state()\n\n def stop(self, timeout: float = 30.0, force: bool = False, stop_control_plane: bool = True) -> None:\n if not self._started:\n return\n self._state = LifecycleState.STOPPING\n self.workers.stop(timeout=timeout, force=force)\n if stop_control_plane:\n self.control_plane.stop()\n self._started = False\n self._state = LifecycleState.STOPPED\n\n def status(self) -> dict[str, object]:\n self._refresh_state()\n return self.control_plane.snapshot(self)\n\n def current_health(self) -> HealthPayload:\n self._refresh_state()\n return self.health.payload(self._state, self.workers.healths())\n\n async def health_status(self) -> HealthPayload:\n return self.current_health()\n\n async def start_runtime(self) -> dict[str, object] | str:\n self._refresh_state()\n if self._started:\n return \"runtime already running\"\n if self._state == LifecycleState.STOPPING:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n\n self.start(start_control_plane=False)\n started = self._wait_for_state({LifecycleState.IDLE, LifecycleState.BUSY}, timeout=self.ACTION_TIMEOUT_SECONDS)\n if started:\n return self._action_detail(\"runtime started\", timed_out=False)\n return self._action_detail(\"runtime start is still in progress\", timed_out=True)\n\n async def stop_runtime(self) -> dict[str, object] | str:\n self._refresh_state()\n if not self._started:\n if self._state == LifecycleState.STOPPING:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n return \"runtime already stopped\"\n\n self._state = LifecycleState.STOPPING\n try:\n self.workers.stop(timeout=self.ACTION_TIMEOUT_SECONDS, force=False)\n except TimeoutError:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n\n self._started = False\n self._state = LifecycleState.STOPPED\n return self._action_detail(\"runtime stopped\", timed_out=False)\n\n async def runtime_status(self) -> str:\n self._refresh_state()\n return self._state.value\n\n def _register_core_services(self) -> None:\n if self._core_registered:\n return\n self.services.register(\"configuration\", self.configuration)\n self.services.register(\"traces\", self.traces)\n self.services.register(\"health\", self.health)\n self.services.register(\"logs\", self.logs)\n self.services.register(\"workers\", self.workers)\n self.services.register(\"control_plane\", self.control_plane)\n self._core_registered = True\n\n def _register_health_contributors(self) -> None:\n for contributor in self.registry.health_contributors:\n self.health.register(contributor)\n\n def _register_workers(self) -> None:\n if self._workers_registered:\n return\n for worker in self.registry.workers:\n self.workers.register(worker)\n self._workers_registered = True\n\n def _refresh_state(self) -> None:\n lifecycle = self.workers.lifecycle_state()\n\n if self._state == LifecycleState.STOPPING:\n if lifecycle == LifecycleState.STOPPED:\n self._started = False\n self._state = LifecycleState.STOPPED\n return\n\n if not self._started:\n if lifecycle == LifecycleState.STOPPED:\n self._state = LifecycleState.STOPPED\n return\n\n self._state = lifecycle\n\n def _wait_for_state(self, target_states: set[LifecycleState], *, timeout: float) -> bool:\n deadline = monotonic() + timeout\n while monotonic() < deadline:\n self._refresh_state()\n if self._state in target_states:\n return True\n sleep(self.ACTION_POLL_INTERVAL_SECONDS)\n self._refresh_state()\n return self._state in target_states\n\n def _action_detail(self, message: str, *, timed_out: bool) -> dict[str, object]:\n self._refresh_state()\n return {\n \"message\": message,\n \"state\": self._state.value,\n \"timed_out\": timed_out,\n \"workers\": self.workers.snapshot(),\n }", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/core/runtime.py:RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.core.runtime", - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ] - }, - "diagnostics": { - "execution": { - "executed_layers": [ - "C4_SEMANTIC_ROLES", - "C3_ENTRYPOINTS", - "C2_DEPENDENCY_GRAPH", - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS" - ], - "retrieval_mode_by_layer": { - "C4_SEMANTIC_ROLES": "exact_path_fetch", - "C3_ENTRYPOINTS": "exact_path_fetch", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C1_SYMBOL_CATALOG": "symbol_search", - "C0_SOURCE_CHUNKS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C4_SEMANTIC_ROLES": 12, - "C3_ENTRYPOINTS": 8, - "C2_DEPENDENCY_GRAPH": 8, - "C1_SYMBOL_CATALOG": 6, - "C0_SOURCE_CHUNKS": 4 - }, - "filters_by_layer": { - "C4_SEMANTIC_ROLES": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C1_SYMBOL_CATALOG": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C4_SEMANTIC_ROLES", - "query": "Какие компоненты участвуют в RuntimeManager?", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 12, - "ranking_profile": "code" - }, - { - "layer": "C3_ENTRYPOINTS", - "query": "Какие компоненты участвуют в RuntimeManager?", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "Какие компоненты участвуют в RuntimeManager?", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C1_SYMBOL_CATALOG", - "query": "RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Какие компоненты участвуют в RuntimeManager?", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 4, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C4_SEMANTIC_ROLES", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 12, - "candidates_after_filter": 12 - }, - { - "layer": "C3_ENTRYPOINTS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 3, - "candidates_after_filter": 3 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 1, - "candidates_after_filter": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 4, - "candidates_after_filter": 4 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "RuntimeManager", - "alternatives": [ - "RuntimeManager" - ] - }, - "layers": [ - { - "layer": "C4_SEMANTIC_ROLES", - "status": "hit", - "hit_count": 12, - "fail_reason": null - }, - { - "layer": "C3_ENTRYPOINTS", - "status": "hit", - "hit_count": 3, - "fail_reason": null - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 8, - "fail_reason": null - }, - { - "layer": "C1_SYMBOL_CATALOG", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 1, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "symbol_resolution": 0, - "retrieval_total": 138, - "retrieval_by_layer": { - "C4_SEMANTIC_ROLES": 26, - "C3_ENTRYPOINTS": 11, - "C2_DEPENDENCY_GRAPH": 56, - "C1_SYMBOL_CATALOG": 24, - "C0_SOURCE_CHUNKS": 18 - }, - "merge_rank": 17 - } - } - }, - { - "step": "llm_answer", - "input": { - "query": "Какие компоненты участвуют в RuntimeManager?", - "rag_count": 25 - }, - "output": { - "llm_answer": "1. **Компоненты, которые подтверждены контекстом**:\n - RuntimeManager\n - ControlActionSet\n - ControlPlaneService\n \n2. **Подтверждённые связи между ними**:\n - RuntimeManager вызывает метод `start` для начала работы.\n - ControlPlaneService инициализирует каналы (`_channels`) и запускает асинхронную обработку (`_start_async`).\n \n3. **Границы ответственности, если они реально видны в коде**:\n - RuntimeManager отвечает за управление жизненным циклом runtime-среды и координирует выполнение различных ролей (название указывает на менеджерскую роль).\n - ControlActionSet выполняет действия модели, являясь стандартным модельным компонентом.\n - ControlPlaneService управляет сервисными каналами и инициирует асинхронные процессы.\n\n4. **Что остаётся неизвестным или неполным**:\n - Детали взаимодействия между конкретными ролями и точная структура обмена данными через каналы в ControlPlaneService.\n - Точный механизм, каким образом RuntimeManager организует и контролирует данные потоки внутри runtime-среды.\n - Полная картина зависимостей и связей между остальными сущностями приложения, которые могут влиять на работу RuntimeManager и его окружения." - }, - "diagnostics": { - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 537, - "evidence_rows": 25, - "evidence_chars": 8651 - }, - "evidence_summary": [ - { - "layer": "C4_SEMANTIC_ROLES", - "count": 12, - "unique_paths": 11 - }, - { - "layer": "C3_ENTRYPOINTS", - "count": 3, - "unique_paths": 1 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "count": 8, - "unique_paths": 2 - }, - { - "layer": "C1_SYMBOL_CATALOG", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 1, - "unique_paths": 1 - } - ], - "prompt_template_id": "intent_code_qa_architecture_ru_v2", - "system_prompt_version": "v1" - }, - "timings_ms": { - "prompt_build": 0, - "llm_call": 2117 - } - } - } - ] - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_132357/full_chain_plba_code_subintents_v2_plba-v2-architecture-runtime-manager.md b/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_132357/full_chain_plba_code_subintents_v2_plba-v2-architecture-runtime-manager.md deleted file mode 100644 index 9ab0912..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_132357/full_chain_plba_code_subintents_v2_plba-v2-architecture-runtime-manager.md +++ /dev/null @@ -1,34 +0,0 @@ -# plba-v2-architecture-runtime-manager - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_subintents_v2.yaml -- runner: runtime -- mode: full_chain -- passed: True - -## Query -Какие компоненты участвуют в RuntimeManager? - -## Actual -{ - "intent": "CODE_QA", - "sub_intent": "ARCHITECTURE", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 25, - "llm_answer": "1. **Компоненты, которые подтверждены контекстом**:\n - RuntimeManager\n - ControlActionSet\n - ControlPlaneService\n \n2. **Подтверждённые связи между ними**:\n - RuntimeManager вызывает метод `start` для начала работы.\n - ControlPlaneService инициализирует каналы (`_channels`) и запускает асинхронную обработку (`_start_async`).\n \n3. **Границы ответственности, если они реально видны в коде**:\n - RuntimeManager отвечает за управление жизненным циклом runtime-среды и координирует выполнение различных ролей (название указывает на менеджерскую роль).\n - ControlActionSet выполняет действия модели, являясь стандартным модельным компонентом.\n - ControlPlaneService управляет сервисными каналами и инициирует асинхронные процессы.\n\n4. **Что остаётся неизвестным или неполным**:\n - Детали взаимодействия между конкретными ролями и точная структура обмена данными через каналы в ControlPlaneService.\n - Точный механизм, каким образом RuntimeManager организует и контролирует данные потоки внутри runtime-среды.\n - Полная картина зависимостей и связей между остальными сущностями приложения, которые могут влиять на работу RuntimeManager и его окружения.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "RuntimeManager" - ], - "layers": [ - "C4_SEMANTIC_ROLES", - "C3_ENTRYPOINTS", - "C2_DEPENDENCY_GRAPH", - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS" - ] -} - -## Mismatches -- none \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_132357/full_chain_plba_code_subintents_v2_plba-v2-explain-create-runtime.json b/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_132357/full_chain_plba_code_subintents_v2_plba-v2-explain-create-runtime.json deleted file mode 100644 index 65fb33f..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_132357/full_chain_plba_code_subintents_v2_plba-v2-explain-create-runtime.json +++ /dev/null @@ -1,1896 +0,0 @@ -{ - "case_id": "plba-v2-explain-create-runtime", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_subintents_v2.yaml", - "runner": "runtime", - "mode": "full_chain", - "actual": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 12, - "llm_answer": "1. **Что это и где определено.** \nСущность `create_runtime` определена в файле `src/plba/bootstrap.py`. Это функция, принимающая параметры конфигурации и модуля приложения, и возвращающая объект класса `RuntimeManager`.\n\n2. **Назначение по наблюдаемому коду.** \nФункция создаёт и инициализирует экземпляр объекта `RuntimeManager`, добавляя файл конфигурации и модуль приложения в его состояние. Если включено управление через HTTP, она также регистрирует канал управления.\n\n3. **Подтверждённые зависимости или взаимодействия.** \nФункция зависит от объекта `RuntimeManager` и использует метод `add_config_file` для добавления файла конфигурации и метод `register_module` для регистрации модуля приложения. Если включён режим управления через HTTP, используется метод `register_channel` для регистрации канала управления типа `HttpControlChannel`.\n\n4. **Что делает по шагам, если это видно в контексте.** \n- Создаёт новый экземпляр `RuntimeManager`.\n- При наличии переданного пути к конфигурационному файлу добавляет этот файл с помощью метода `add_config_file`.\n- Если включена опция HTTP-контроля, регистрирует HTTP-канал управления с указанными параметрами хоста, порта и тайм-аута.\n- Регистрирует указанный модуль приложения с помощью метода `register_module`.\n- Возвращает созданный экземпляр `RuntimeManager`.\n\n5. **Осторожные выводы.** \nНа основании представленного контекста трудно сделать полные выводы о последствиях вызова функции `create_runtime`. Например, непонятно, какие дополнительные действия происходят при регистрации модуля или что именно содержится в объектах, которые передаются в функцию (`ApplicationModule`, `HttpControlChannel`).\n\n6. **Чего не хватает для полного объяснения.** \nДля более детального понимания работы этой функции необходимы следующие детали:\n - Определение классов `ApplicationModule`, `RuntimeManager`, `HttpControlChannel`.\n - Детали поведения методов `add_config_file`, `register_module`, `register_channel`.\n - Логика и влияние других функций и методов, используемых внутри этих объектов.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "create_runtime" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "passed": true, - "mismatches": [], - "details": { - "case_id": "plba-v2-explain-create-runtime", - "text": "Что делает функция create_runtime?", - "mode": "full_chain", - "run_started_at": "2026-03-12T13:23:57", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Что делает функция create_runtime?", - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "create_runtime", - "alternatives": [ - "create_runtime" - ], - "confidence": 0.99 - }, - "rag_count": 12, - "rag_rows": [ - { - "path": "src/plba/bootstrap.py", - "content": "function create_runtime\ncreate_runtime(module)", - "layer": "C1_SYMBOL_CATALOG", - "title": "create_runtime", - "span_start": 8, - "span_end": 29, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "qname": "create_runtime", - "kind": "function", - "signature": "create_runtime(module)", - "parent_symbol_id": null, - "package_or_module": "src.plba.bootstrap", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_runner.py", - "content": "UvicornThreadRunner\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (24)", - "layer": "C4_SEMANTIC_ROLES", - "title": "UvicornThreadRunner", - "span_start": 10, - "span_end": 61, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 11, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "fd55630045a02100df8877ac27d951ee08617d4598764394d48cb51fe067476a", - "symbol_name": "UvicornThreadRunner", - "qname": "UvicornThreadRunner", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 24, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "3779fdd2878b770e789a35bb2a89c9d79f13b61c26d7db1b3b683f9bb9e1623f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/bootstrap.py", - "content": "create_runtime calls runtime.add_config_file", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "create_runtime:calls", - "span_start": 19, - "span_end": 19, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "4eaeec4ac55a59d5f66fd01c4754955f8fedaf4bc3df13fa769b352c7bfaacbb", - "edge_type": "calls", - "src_symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "src_qname": "create_runtime", - "dst_symbol_id": null, - "dst_ref": "runtime.add_config_file", - "resolution": "partial", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/bootstrap.py", - "content": "create_runtime reads_attr runtime.register_module", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "create_runtime:reads_attr", - "span_start": 28, - "span_end": 28, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "45516c79ff358dbf9b650a081668df0f66d2fe989300f985a1a78be6be166f8f", - "edge_type": "reads_attr", - "src_symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "src_qname": "create_runtime", - "dst_symbol_id": null, - "dst_ref": "runtime.register_module", - "resolution": "partial", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/bootstrap.py", - "content": "create_runtime instantiates RuntimeManager", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "create_runtime:instantiates", - "span_start": 17, - "span_end": 17, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "0adba17984f850ea1608c9e734d2dd5c325cfde3a8133123aa239e44935ad18e", - "edge_type": "instantiates", - "src_symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "src_qname": "create_runtime", - "dst_symbol_id": "27158ca220022eeb5083c6addf8a50775d45f7161284fd60aac48410105f4b98", - "dst_ref": "RuntimeManager", - "resolution": "resolved", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/bootstrap.py", - "content": "create_runtime calls runtime.register_module", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "create_runtime:calls", - "span_start": 28, - "span_end": 28, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "ab6003c3441addc1ba1b81edeca009165559f652f6b2cf424e5ae61b1f617de8", - "edge_type": "calls", - "src_symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "src_qname": "create_runtime", - "dst_symbol_id": null, - "dst_ref": "runtime.register_module", - "resolution": "partial", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/bootstrap.py", - "content": "create_runtime calls runtime.control_plane.register_channel", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "create_runtime:calls", - "span_start": 21, - "span_end": 27, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "2678250030b9ce47a3b3b55fac7897ac530367edc8374ac9d5e6ecafb1e483f0", - "edge_type": "calls", - "src_symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "src_qname": "create_runtime", - "dst_symbol_id": null, - "dst_ref": "runtime.control_plane.register_channel", - "resolution": "partial", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/bootstrap.py", - "content": "create_runtime reads_attr runtime.add_config_file", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "create_runtime:reads_attr", - "span_start": 19, - "span_end": 19, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "30d4e8aae984ab84d523e80d02f1caeda52d547fa3d2aa47be8845931cabbca2", - "edge_type": "reads_attr", - "src_symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "src_qname": "create_runtime", - "dst_symbol_id": null, - "dst_ref": "runtime.add_config_file", - "resolution": "partial", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/bootstrap.py", - "content": "def create_runtime(\n module: ApplicationModule,\n *,\n config_path: str | None = None,\n enable_http_control: bool = False,\n control_host: str = \"127.0.0.1\",\n control_port: int = 8080,\n control_timeout: int = 5,\n) -> RuntimeManager:\n runtime = RuntimeManager()\n if config_path is not None:\n runtime.add_config_file(config_path)\n if enable_http_control:\n runtime.control_plane.register_channel(\n HttpControlChannel(\n host=control_host,\n port=control_port,\n timeout=control_timeout,\n )\n )\n runtime.register_module(module)\n return runtime", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/plba/bootstrap.py:create_runtime", - "span_start": 8, - "span_end": 29, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.plba.bootstrap", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "llm_answer": "1. **Что это и где определено.** \nСущность `create_runtime` определена в файле `src/plba/bootstrap.py`. Это функция, принимающая параметры конфигурации и модуля приложения, и возвращающая объект класса `RuntimeManager`.\n\n2. **Назначение по наблюдаемому коду.** \nФункция создаёт и инициализирует экземпляр объекта `RuntimeManager`, добавляя файл конфигурации и модуль приложения в его состояние. Если включено управление через HTTP, она также регистрирует канал управления.\n\n3. **Подтверждённые зависимости или взаимодействия.** \nФункция зависит от объекта `RuntimeManager` и использует метод `add_config_file` для добавления файла конфигурации и метод `register_module` для регистрации модуля приложения. Если включён режим управления через HTTP, используется метод `register_channel` для регистрации канала управления типа `HttpControlChannel`.\n\n4. **Что делает по шагам, если это видно в контексте.** \n- Создаёт новый экземпляр `RuntimeManager`.\n- При наличии переданного пути к конфигурационному файлу добавляет этот файл с помощью метода `add_config_file`.\n- Если включена опция HTTP-контроля, регистрирует HTTP-канал управления с указанными параметрами хоста, порта и тайм-аута.\n- Регистрирует указанный модуль приложения с помощью метода `register_module`.\n- Возвращает созданный экземпляр `RuntimeManager`.\n\n5. **Осторожные выводы.** \nНа основании представленного контекста трудно сделать полные выводы о последствиях вызова функции `create_runtime`. Например, непонятно, какие дополнительные действия происходят при регистрации модуля или что именно содержится в объектах, которые передаются в функцию (`ApplicationModule`, `HttpControlChannel`).\n\n6. **Чего не хватает для полного объяснения.** \nДля более детального понимания работы этой функции необходимы следующие детали:\n - Определение классов `ApplicationModule`, `RuntimeManager`, `HttpControlChannel`.\n - Детали поведения методов `add_config_file`, `register_module`, `register_channel`.\n - Логика и влияние других функций и методов, используемых внутри этих объектов.", - "summary": { - "router": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "confidence": null - }, - "retrieval": { - "profile": "code", - "layers_hit": [ - "C0_SOURCE_CHUNKS", - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS", - "C4_SEMANTIC_ROLES" - ], - "evidence_sufficient": true - }, - "llm": { - "answer_status": "answered", - "groundedness": "grounded" - } - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "symbol_kind_hint": "function", - "symbol_candidates": [ - "create_runtime" - ], - "keyword_hints": [ - "create_runtime" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C0_SOURCE_CHUNKS": "exact_path_fetch", - "C4_SEMANTIC_ROLES": "exact_path_fetch", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C3_ENTRYPOINTS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 8, - "C4_SEMANTIC_ROLES": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C3_ENTRYPOINTS": 6 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C4_SEMANTIC_ROLES": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "create_runtime", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "create_runtime", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C4_SEMANTIC_ROLES", - "query": "create_runtime", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "create_runtime", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - }, - { - "layer": "C3_ENTRYPOINTS", - "query": "create_runtime", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 1, - "candidates_after_filter": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 6, - "candidates_after_filter": 6 - }, - { - "layer": "C3_ENTRYPOINTS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 3, - "candidates_after_filter": 3 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "create_runtime", - "alternatives": [ - "create_runtime" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C4_SEMANTIC_ROLES", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 6, - "fail_reason": null - }, - { - "layer": "C3_ENTRYPOINTS", - "status": "hit", - "hit_count": 3, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "router": 1, - "symbol_resolution": 0, - "retrieval_total": 137, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 42, - "C0_SOURCE_CHUNKS": 19, - "C4_SEMANTIC_ROLES": 15, - "C2_DEPENDENCY_GRAPH": 47, - "C3_ENTRYPOINTS": 11 - }, - "merge_rank": 19, - "prompt_build": 0, - "llm_call": 3092 - }, - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 659, - "evidence_rows": 12, - "evidence_chars": 1184 - }, - "evidence_summary": [ - { - "layer": "C1_SYMBOL_CATALOG", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "count": 6, - "unique_paths": 1 - }, - { - "layer": "C3_ENTRYPOINTS", - "count": 3, - "unique_paths": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 1, - "unique_paths": 1 - } - ], - "prompt_template_id": "intent_code_qa_explain_ru_v2", - "system_prompt_version": "v1" - }, - "router": { - "conversation_mode": "START", - "keyword_hints": [ - "create_runtime" - ], - "path_scope": [] - }, - "llm": { - "used_evidence_count": 12, - "missing_evidence_reason": null - } - }, - "run_info": { - "case_id": "plba-v2-explain-create-runtime", - "mode": "full_chain", - "run_started_at": "2026-03-12T13:23:57", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - }, - "input_request": { - "text": "Что делает функция create_runtime?", - "normalized_query": "Что делает функция create_runtime?" - }, - "steps": [ - { - "step": "intent_router", - "input": { - "query": "Что делает функция create_runtime?" - }, - "output": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Что делает функция create_runtime?" - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "symbol_kind_hint": "function", - "symbol_candidates": [ - "create_runtime" - ], - "keyword_hints": [ - "create_runtime" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "timings_ms": { - "router": 1 - } - } - }, - { - "step": "retrieval", - "input": { - "query": "Что делает функция create_runtime?" - }, - "output": { - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "create_runtime", - "alternatives": [ - "create_runtime" - ], - "confidence": 0.99 - }, - "rag_count": 12, - "rag_rows": [ - { - "path": "src/plba/bootstrap.py", - "content": "function create_runtime\ncreate_runtime(module)", - "layer": "C1_SYMBOL_CATALOG", - "title": "create_runtime", - "span_start": 8, - "span_end": 29, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "qname": "create_runtime", - "kind": "function", - "signature": "create_runtime(module)", - "parent_symbol_id": null, - "package_or_module": "src.plba.bootstrap", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_runner.py", - "content": "UvicornThreadRunner\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (24)", - "layer": "C4_SEMANTIC_ROLES", - "title": "UvicornThreadRunner", - "span_start": 10, - "span_end": 61, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 11, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "fd55630045a02100df8877ac27d951ee08617d4598764394d48cb51fe067476a", - "symbol_name": "UvicornThreadRunner", - "qname": "UvicornThreadRunner", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 24, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "3779fdd2878b770e789a35bb2a89c9d79f13b61c26d7db1b3b683f9bb9e1623f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/bootstrap.py", - "content": "create_runtime calls runtime.add_config_file", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "create_runtime:calls", - "span_start": 19, - "span_end": 19, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "4eaeec4ac55a59d5f66fd01c4754955f8fedaf4bc3df13fa769b352c7bfaacbb", - "edge_type": "calls", - "src_symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "src_qname": "create_runtime", - "dst_symbol_id": null, - "dst_ref": "runtime.add_config_file", - "resolution": "partial", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/bootstrap.py", - "content": "create_runtime reads_attr runtime.register_module", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "create_runtime:reads_attr", - "span_start": 28, - "span_end": 28, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "45516c79ff358dbf9b650a081668df0f66d2fe989300f985a1a78be6be166f8f", - "edge_type": "reads_attr", - "src_symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "src_qname": "create_runtime", - "dst_symbol_id": null, - "dst_ref": "runtime.register_module", - "resolution": "partial", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/bootstrap.py", - "content": "create_runtime instantiates RuntimeManager", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "create_runtime:instantiates", - "span_start": 17, - "span_end": 17, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "0adba17984f850ea1608c9e734d2dd5c325cfde3a8133123aa239e44935ad18e", - "edge_type": "instantiates", - "src_symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "src_qname": "create_runtime", - "dst_symbol_id": "27158ca220022eeb5083c6addf8a50775d45f7161284fd60aac48410105f4b98", - "dst_ref": "RuntimeManager", - "resolution": "resolved", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/bootstrap.py", - "content": "create_runtime calls runtime.register_module", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "create_runtime:calls", - "span_start": 28, - "span_end": 28, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "ab6003c3441addc1ba1b81edeca009165559f652f6b2cf424e5ae61b1f617de8", - "edge_type": "calls", - "src_symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "src_qname": "create_runtime", - "dst_symbol_id": null, - "dst_ref": "runtime.register_module", - "resolution": "partial", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/bootstrap.py", - "content": "create_runtime calls runtime.control_plane.register_channel", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "create_runtime:calls", - "span_start": 21, - "span_end": 27, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "2678250030b9ce47a3b3b55fac7897ac530367edc8374ac9d5e6ecafb1e483f0", - "edge_type": "calls", - "src_symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "src_qname": "create_runtime", - "dst_symbol_id": null, - "dst_ref": "runtime.control_plane.register_channel", - "resolution": "partial", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/bootstrap.py", - "content": "create_runtime reads_attr runtime.add_config_file", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "create_runtime:reads_attr", - "span_start": 19, - "span_end": 19, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "30d4e8aae984ab84d523e80d02f1caeda52d547fa3d2aa47be8845931cabbca2", - "edge_type": "reads_attr", - "src_symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "src_qname": "create_runtime", - "dst_symbol_id": null, - "dst_ref": "runtime.add_config_file", - "resolution": "partial", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/bootstrap.py", - "content": "def create_runtime(\n module: ApplicationModule,\n *,\n config_path: str | None = None,\n enable_http_control: bool = False,\n control_host: str = \"127.0.0.1\",\n control_port: int = 8080,\n control_timeout: int = 5,\n) -> RuntimeManager:\n runtime = RuntimeManager()\n if config_path is not None:\n runtime.add_config_file(config_path)\n if enable_http_control:\n runtime.control_plane.register_channel(\n HttpControlChannel(\n host=control_host,\n port=control_port,\n timeout=control_timeout,\n )\n )\n runtime.register_module(module)\n return runtime", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/plba/bootstrap.py:create_runtime", - "span_start": 8, - "span_end": 29, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.plba.bootstrap", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ] - }, - "diagnostics": { - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C0_SOURCE_CHUNKS": "exact_path_fetch", - "C4_SEMANTIC_ROLES": "exact_path_fetch", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C3_ENTRYPOINTS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 8, - "C4_SEMANTIC_ROLES": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C3_ENTRYPOINTS": 6 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C4_SEMANTIC_ROLES": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "create_runtime", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "create_runtime", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C4_SEMANTIC_ROLES", - "query": "create_runtime", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "create_runtime", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - }, - { - "layer": "C3_ENTRYPOINTS", - "query": "create_runtime", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 1, - "candidates_after_filter": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 6, - "candidates_after_filter": 6 - }, - { - "layer": "C3_ENTRYPOINTS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 3, - "candidates_after_filter": 3 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "create_runtime", - "alternatives": [ - "create_runtime" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C4_SEMANTIC_ROLES", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 6, - "fail_reason": null - }, - { - "layer": "C3_ENTRYPOINTS", - "status": "hit", - "hit_count": 3, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "symbol_resolution": 0, - "retrieval_total": 137, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 42, - "C0_SOURCE_CHUNKS": 19, - "C4_SEMANTIC_ROLES": 15, - "C2_DEPENDENCY_GRAPH": 47, - "C3_ENTRYPOINTS": 11 - }, - "merge_rank": 19 - } - } - }, - { - "step": "llm_answer", - "input": { - "query": "Что делает функция create_runtime?", - "rag_count": 12 - }, - "output": { - "llm_answer": "1. **Что это и где определено.** \nСущность `create_runtime` определена в файле `src/plba/bootstrap.py`. Это функция, принимающая параметры конфигурации и модуля приложения, и возвращающая объект класса `RuntimeManager`.\n\n2. **Назначение по наблюдаемому коду.** \nФункция создаёт и инициализирует экземпляр объекта `RuntimeManager`, добавляя файл конфигурации и модуль приложения в его состояние. Если включено управление через HTTP, она также регистрирует канал управления.\n\n3. **Подтверждённые зависимости или взаимодействия.** \nФункция зависит от объекта `RuntimeManager` и использует метод `add_config_file` для добавления файла конфигурации и метод `register_module` для регистрации модуля приложения. Если включён режим управления через HTTP, используется метод `register_channel` для регистрации канала управления типа `HttpControlChannel`.\n\n4. **Что делает по шагам, если это видно в контексте.** \n- Создаёт новый экземпляр `RuntimeManager`.\n- При наличии переданного пути к конфигурационному файлу добавляет этот файл с помощью метода `add_config_file`.\n- Если включена опция HTTP-контроля, регистрирует HTTP-канал управления с указанными параметрами хоста, порта и тайм-аута.\n- Регистрирует указанный модуль приложения с помощью метода `register_module`.\n- Возвращает созданный экземпляр `RuntimeManager`.\n\n5. **Осторожные выводы.** \nНа основании представленного контекста трудно сделать полные выводы о последствиях вызова функции `create_runtime`. Например, непонятно, какие дополнительные действия происходят при регистрации модуля или что именно содержится в объектах, которые передаются в функцию (`ApplicationModule`, `HttpControlChannel`).\n\n6. **Чего не хватает для полного объяснения.** \nДля более детального понимания работы этой функции необходимы следующие детали:\n - Определение классов `ApplicationModule`, `RuntimeManager`, `HttpControlChannel`.\n - Детали поведения методов `add_config_file`, `register_module`, `register_channel`.\n - Логика и влияние других функций и методов, используемых внутри этих объектов." - }, - "diagnostics": { - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 659, - "evidence_rows": 12, - "evidence_chars": 1184 - }, - "evidence_summary": [ - { - "layer": "C1_SYMBOL_CATALOG", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "count": 6, - "unique_paths": 1 - }, - { - "layer": "C3_ENTRYPOINTS", - "count": 3, - "unique_paths": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 1, - "unique_paths": 1 - } - ], - "prompt_template_id": "intent_code_qa_explain_ru_v2", - "system_prompt_version": "v1" - }, - "timings_ms": { - "prompt_build": 0, - "llm_call": 3092 - } - } - } - ] - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_132357/full_chain_plba_code_subintents_v2_plba-v2-explain-create-runtime.md b/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_132357/full_chain_plba_code_subintents_v2_plba-v2-explain-create-runtime.md deleted file mode 100644 index 6f1e0de..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_132357/full_chain_plba_code_subintents_v2_plba-v2-explain-create-runtime.md +++ /dev/null @@ -1,34 +0,0 @@ -# plba-v2-explain-create-runtime - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_subintents_v2.yaml -- runner: runtime -- mode: full_chain -- passed: True - -## Query -Что делает функция create_runtime? - -## Actual -{ - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 12, - "llm_answer": "1. **Что это и где определено.** \nСущность `create_runtime` определена в файле `src/plba/bootstrap.py`. Это функция, принимающая параметры конфигурации и модуля приложения, и возвращающая объект класса `RuntimeManager`.\n\n2. **Назначение по наблюдаемому коду.** \nФункция создаёт и инициализирует экземпляр объекта `RuntimeManager`, добавляя файл конфигурации и модуль приложения в его состояние. Если включено управление через HTTP, она также регистрирует канал управления.\n\n3. **Подтверждённые зависимости или взаимодействия.** \nФункция зависит от объекта `RuntimeManager` и использует метод `add_config_file` для добавления файла конфигурации и метод `register_module` для регистрации модуля приложения. Если включён режим управления через HTTP, используется метод `register_channel` для регистрации канала управления типа `HttpControlChannel`.\n\n4. **Что делает по шагам, если это видно в контексте.** \n- Создаёт новый экземпляр `RuntimeManager`.\n- При наличии переданного пути к конфигурационному файлу добавляет этот файл с помощью метода `add_config_file`.\n- Если включена опция HTTP-контроля, регистрирует HTTP-канал управления с указанными параметрами хоста, порта и тайм-аута.\n- Регистрирует указанный модуль приложения с помощью метода `register_module`.\n- Возвращает созданный экземпляр `RuntimeManager`.\n\n5. **Осторожные выводы.** \nНа основании представленного контекста трудно сделать полные выводы о последствиях вызова функции `create_runtime`. Например, непонятно, какие дополнительные действия происходят при регистрации модуля или что именно содержится в объектах, которые передаются в функцию (`ApplicationModule`, `HttpControlChannel`).\n\n6. **Чего не хватает для полного объяснения.** \nДля более детального понимания работы этой функции необходимы следующие детали:\n - Определение классов `ApplicationModule`, `RuntimeManager`, `HttpControlChannel`.\n - Детали поведения методов `add_config_file`, `register_module`, `register_channel`.\n - Логика и влияние других функций и методов, используемых внутри этих объектов.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "create_runtime" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] -} - -## Mismatches -- none \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_132357/full_chain_plba_code_subintents_v2_plba-v2-explain-local-http-channel.json b/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_132357/full_chain_plba_code_subintents_v2_plba-v2-explain-local-http-channel.json deleted file mode 100644 index 742f93f..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_132357/full_chain_plba_code_subintents_v2_plba-v2-explain-local-http-channel.json +++ /dev/null @@ -1,1333 +0,0 @@ -{ - "case_id": "plba-v2-explain-local-http-channel", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_subintents_v2.yaml", - "runner": "runtime", - "mode": "full_chain", - "actual": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN_LOCAL", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 6, - "llm_answer": "Класс `HttpControlChannel` реализует HTTP-интерфейс для управления другим компонентом приложения через HTTP-запросы.\n\n### Что делает класс:\n1. **Инициализация (`__init__`)**:\n - Принимает параметры `host`, `port` и `timeout`.\n - Создаёт экземпляр `_runner` класса `UvicornThreadRunner`, отвечающего за выполнение HTTP-сервера с использованием uvicorn (асинхронного веб-фреймворка).\n - Инициализирует объект фабрики приложений `_factory` типа `HttpControlAppFactory`, которая отвечает за создание конкретных HTTP-приложений.\n - Опционально инициализирует коллекцию действий управления `_actions`.\n\n2. **Запуск (`start`)**:\n - Проверяет наличие конфигурации действий управления (_actions). Если конфигурация отсутствует, возвращает ошибку.\n - Использует фабрику `_factory` для создания HTTP-приложения, которое включает обработчики health-запросов и action-запросов.\n - Запускает сервер с помощью `_runner.start()`.\n\n3. **Остановка (`stop`)**:\n - Останавливает асинхронный HTTP-сервер, запущенный ранее методом `start`.\n\n4. **Методы внутренних ответов**:\n - Метод `_health_response` проверяет состояние системы управления действиями. Если действия не настроены, возвращает статус \"unhealthy\". В противном случае ожидает ответ от health-метода действий и возвращает его.\n - Метод `_action_response` обрабатывает запросы к определённым действиям, возвращая результат выполнения действия или сообщение об ошибке, если действие не сконфигурировано.\n\n### Входные данные:\n- Параметры при создании экземпляра: хост, порт и таймаут.\n- Конфигурация действий управления (опционально передаётся в метод `start`).\n\n### Выходные данные:\n- Управляющие HTTP-запросы, возвращающие результаты проверки состояния системы и выполнения конкретных действий.\n\nТаким образом, класс служит промежуточным слоем между внешним интерфейсом HTTP и внутренними компонентами управления системой, обеспечивая безопасную и асинхронную обработку запросов.", - "answer_mode": "answered", - "path_scope": [ - "src/app_runtime/control/http_channel.py" - ], - "symbol_candidates": [ - "HttpControlChannel" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C2_DEPENDENCY_GRAPH" - ] - }, - "passed": true, - "mismatches": [], - "details": { - "case_id": "plba-v2-explain-local-http-channel", - "text": "Почему в файле src/app_runtime/control/http_channel.py класс HttpControlChannel устроен так?", - "mode": "full_chain", - "run_started_at": "2026-03-12T13:23:57", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Почему в файле src/app_runtime/control/http_channel.py класс HttpControlChannel устроен так?", - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "HttpControlChannel", - "alternatives": [ - "HttpControlChannel" - ], - "confidence": 0.99 - }, - "rag_count": 6, - "rag_rows": [ - { - "path": "src/app_runtime/control/http_channel.py", - "content": "class HttpControlChannel\nHttpControlChannel(ControlChannel)", - "layer": "C1_SYMBOL_CATALOG", - "title": "HttpControlChannel", - "span_start": 12, - "span_end": 57, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "1c9fbdc24819e5604c26ea55428a74310f03a03e1af197ed84846af61e42fdb0", - "qname": "HttpControlChannel", - "kind": "class", - "signature": "HttpControlChannel(ControlChannel)", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.control.http_channel", - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel.__init__\n -> HttpControlChannel._timeout\n -> HttpControlChannel._action_response", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "HttpControlChannel.__init__:dataflow_slice", - "span_start": 14, - "span_end": 47, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "c3ef21fcae96c82c00be74b3ab827d4af2085d89cb3fa5521c19a174aad84dbb", - "edge_type": "dataflow_slice", - "src_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "src_qname": "HttpControlChannel.__init__", - "dst_symbol_id": "e64969024ccaeb34d8d91473fad07b3b3d341875846392e7a006406c7ada1954", - "dst_ref": "HttpControlChannel._action_response", - "resolution": "resolved", - "slice_id": "c3ef21fcae96c82c00be74b3ab827d4af2085d89cb3fa5521c19a174aad84dbb", - "root_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "path_symbols": [ - "HttpControlChannel.__init__", - "HttpControlChannel._timeout", - "HttpControlChannel._action_response" - ], - "path_symbol_ids": [ - "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "e64969024ccaeb34d8d91473fad07b3b3d341875846392e7a006406c7ada1954" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel.__init__\n -> HttpControlChannel._runner\n -> HttpControlChannel.start", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "HttpControlChannel.__init__:dataflow_slice", - "span_start": 15, - "span_end": 22, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "51d73913df709152258ed1b9a8c8f4eb3c575eccfe6b982aef0b28e0789a29da", - "edge_type": "dataflow_slice", - "src_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "src_qname": "HttpControlChannel.__init__", - "dst_symbol_id": "d1933f04137f52535b6525f1b93ff2cd83bfb216b480e887e791ed1714cda8e0", - "dst_ref": "HttpControlChannel.start", - "resolution": "resolved", - "slice_id": "51d73913df709152258ed1b9a8c8f4eb3c575eccfe6b982aef0b28e0789a29da", - "root_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "path_symbols": [ - "HttpControlChannel.__init__", - "HttpControlChannel._runner", - "HttpControlChannel.start" - ], - "path_symbol_ids": [ - "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "d1933f04137f52535b6525f1b93ff2cd83bfb216b480e887e791ed1714cda8e0" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel.__init__\n -> HttpControlChannel._timeout\n -> HttpControlChannel._health_response", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "HttpControlChannel.__init__:dataflow_slice", - "span_start": 14, - "span_end": 34, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "f858f5c9e575f6c4cdfe3853571b7ee21d1f628a443541d2037c3dc9d0790bef", - "edge_type": "dataflow_slice", - "src_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "src_qname": "HttpControlChannel.__init__", - "dst_symbol_id": "e84bf04e9cd2127df235b7064d05f47e19f19a89c7c82f4c247231d4e8fa426a", - "dst_ref": "HttpControlChannel._health_response", - "resolution": "resolved", - "slice_id": "f858f5c9e575f6c4cdfe3853571b7ee21d1f628a443541d2037c3dc9d0790bef", - "root_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "path_symbols": [ - "HttpControlChannel.__init__", - "HttpControlChannel._timeout", - "HttpControlChannel._health_response" - ], - "path_symbol_ids": [ - "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "e84bf04e9cd2127df235b7064d05f47e19f19a89c7c82f4c247231d4e8fa426a" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel.__init__\n -> HttpControlChannel._runner\n -> HttpControlChannel.stop", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "HttpControlChannel.__init__:dataflow_slice", - "span_start": 15, - "span_end": 25, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "0f827ef81a990258a8a74381c8564a8361afa6712dba3200592659c939adcb9d", - "edge_type": "dataflow_slice", - "src_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "src_qname": "HttpControlChannel.__init__", - "dst_symbol_id": "f29ab212620093d72be20e26c5a399624c7939a6056a728762ed3f84a250bfa3", - "dst_ref": "HttpControlChannel.stop", - "resolution": "resolved", - "slice_id": "0f827ef81a990258a8a74381c8564a8361afa6712dba3200592659c939adcb9d", - "root_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "path_symbols": [ - "HttpControlChannel.__init__", - "HttpControlChannel._runner", - "HttpControlChannel.stop" - ], - "path_symbol_ids": [ - "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "f29ab212620093d72be20e26c5a399624c7939a6056a728762ed3f84a250bfa3" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "class HttpControlChannel(ControlChannel):\n def __init__(self, host: str, port: int, timeout: int) -> None:\n self._timeout = timeout\n self._runner = UvicornThreadRunner(host, port, timeout)\n self._factory = HttpControlAppFactory()\n self._actions: ControlActionSet | None = None\n\n async def start(self, actions: ControlActionSet) -> None:\n self._actions = actions\n app = self._factory.create(self._health_response, self._action_response)\n await self._runner.start(app)\n\n async def stop(self) -> None:\n await self._runner.stop()\n\n @property\n def port(self) -> int:\n return self._runner.port\n\n async def _health_response(self) -> dict[str, object]:\n if self._actions is None:\n return {\"status\": \"unhealthy\", \"detail\": \"control actions are not configured\"}\n return await asyncio.wait_for(self._actions.health(), timeout=float(self._timeout))\n\n async def _action_response(self, action: str, _client_source: str = \"unknown\") -> JSONResponse:\n if self._actions is None:\n return JSONResponse(content={\"status\": \"error\", \"detail\": f\"{action} handler is not configured\"}, status_code=404)\n callbacks = {\n \"start\": self._actions.start,\n \"stop\": self._actions.stop,\n \"status\": self._actions.status,\n }\n callback = callbacks.get(action)\n if callback is None:\n return JSONResponse(content={\"status\": \"error\", \"detail\": f\"unsupported action: {action}\"}, status_code=404)\n action_timeout = max(float(self._timeout), 10.0) if action in {\"start\", \"stop\"} else float(self._timeout)\n try:\n detail = await asyncio.wait_for(callback(), timeout=action_timeout)\n except asyncio.TimeoutError:\n return JSONResponse(\n content={\"status\": \"accepted\", \"detail\": f\"{action} operation is still in progress\"},\n status_code=202,\n )\n except Exception as exc:\n return JSONResponse(content={\"status\": \"error\", \"detail\": str(exc)}, status_code=500)\n return JSONResponse(content={\"status\": \"ok\", \"detail\": detail or f\"{action} action accepted\"}, status_code=200)", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/http_channel.py:HttpControlChannel", - "span_start": 12, - "span_end": 57, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.http_channel", - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "llm_answer": "Класс `HttpControlChannel` реализует HTTP-интерфейс для управления другим компонентом приложения через HTTP-запросы.\n\n### Что делает класс:\n1. **Инициализация (`__init__`)**:\n - Принимает параметры `host`, `port` и `timeout`.\n - Создаёт экземпляр `_runner` класса `UvicornThreadRunner`, отвечающего за выполнение HTTP-сервера с использованием uvicorn (асинхронного веб-фреймворка).\n - Инициализирует объект фабрики приложений `_factory` типа `HttpControlAppFactory`, которая отвечает за создание конкретных HTTP-приложений.\n - Опционально инициализирует коллекцию действий управления `_actions`.\n\n2. **Запуск (`start`)**:\n - Проверяет наличие конфигурации действий управления (_actions). Если конфигурация отсутствует, возвращает ошибку.\n - Использует фабрику `_factory` для создания HTTP-приложения, которое включает обработчики health-запросов и action-запросов.\n - Запускает сервер с помощью `_runner.start()`.\n\n3. **Остановка (`stop`)**:\n - Останавливает асинхронный HTTP-сервер, запущенный ранее методом `start`.\n\n4. **Методы внутренних ответов**:\n - Метод `_health_response` проверяет состояние системы управления действиями. Если действия не настроены, возвращает статус \"unhealthy\". В противном случае ожидает ответ от health-метода действий и возвращает его.\n - Метод `_action_response` обрабатывает запросы к определённым действиям, возвращая результат выполнения действия или сообщение об ошибке, если действие не сконфигурировано.\n\n### Входные данные:\n- Параметры при создании экземпляра: хост, порт и таймаут.\n- Конфигурация действий управления (опционально передаётся в метод `start`).\n\n### Выходные данные:\n- Управляющие HTTP-запросы, возвращающие результаты проверки состояния системы и выполнения конкретных действий.\n\nТаким образом, класс служит промежуточным слоем между внешним интерфейсом HTTP и внутренними компонентами управления системой, обеспечивая безопасную и асинхронную обработку запросов.", - "summary": { - "router": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN_LOCAL", - "confidence": null - }, - "retrieval": { - "profile": "code", - "layers_hit": [ - "C0_SOURCE_CHUNKS", - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH" - ], - "evidence_sufficient": true - }, - "llm": { - "answer_status": "answered", - "groundedness": "grounded" - } - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN_LOCAL", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C2_DEPENDENCY_GRAPH" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "HttpControlChannel" - ], - "keyword_hints": [ - "src/app_runtime/control/http_channel.py", - "HttpControlChannel" - ], - "path_hints": [ - "src/app_runtime/control/http_channel.py" - ], - "path_scope": [ - "src/app_runtime/control/http_channel.py" - ], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C2_DEPENDENCY_GRAPH" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C0_SOURCE_CHUNKS": "exact_path_fetch", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 12, - "C2_DEPENDENCY_GRAPH": 4 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [ - "src/app_runtime/control/http_channel.py" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src/app_runtime/control/http_channel.py" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src/app_runtime/control/http_channel.py" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "HttpControlChannel", - "path_scope": [ - "src/app_runtime/control/http_channel.py" - ], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Почему в файле src/app_runtime/control/http_channel.py класс HttpControlChannel устроен так?", - "path_scope": [ - "src/app_runtime/control/http_channel.py" - ], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 12, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "Почему в файле src/app_runtime/control/http_channel.py класс HttpControlChannel устроен так?", - "path_scope": [ - "src/app_runtime/control/http_channel.py" - ], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 4, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [ - "src/app_runtime/control/http_channel.py" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 1, - "candidates_after_filter": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src/app_runtime/control/http_channel.py" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 1, - "candidates_after_filter": 1 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src/app_runtime/control/http_channel.py" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 4, - "candidates_after_filter": 4 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "HttpControlChannel", - "alternatives": [ - "HttpControlChannel" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 4, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "router": 0, - "symbol_resolution": 0, - "retrieval_total": 58, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 27, - "C0_SOURCE_CHUNKS": 14, - "C2_DEPENDENCY_GRAPH": 15 - }, - "merge_rank": 19, - "prompt_build": 0, - "llm_call": 3739 - }, - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 851, - "evidence_rows": 6, - "evidence_chars": 2660 - }, - "evidence_summary": [ - { - "layer": "C1_SYMBOL_CATALOG", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "count": 4, - "unique_paths": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 1, - "unique_paths": 1 - } - ], - "prompt_template_id": "intent_code_qa_explain_local_ru_v2", - "system_prompt_version": "v1" - }, - "router": { - "conversation_mode": "START", - "keyword_hints": [ - "src/app_runtime/control/http_channel.py", - "HttpControlChannel" - ], - "path_scope": [ - "src/app_runtime/control/http_channel.py" - ] - }, - "llm": { - "used_evidence_count": 6, - "missing_evidence_reason": null - } - }, - "run_info": { - "case_id": "plba-v2-explain-local-http-channel", - "mode": "full_chain", - "run_started_at": "2026-03-12T13:23:57", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - }, - "input_request": { - "text": "Почему в файле src/app_runtime/control/http_channel.py класс HttpControlChannel устроен так?", - "normalized_query": "Почему в файле src/app_runtime/control/http_channel.py класс HttpControlChannel устроен так?" - }, - "steps": [ - { - "step": "intent_router", - "input": { - "query": "Почему в файле src/app_runtime/control/http_channel.py класс HttpControlChannel устроен так?" - }, - "output": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Почему в файле src/app_runtime/control/http_channel.py класс HttpControlChannel устроен так?" - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN_LOCAL", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C2_DEPENDENCY_GRAPH" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "HttpControlChannel" - ], - "keyword_hints": [ - "src/app_runtime/control/http_channel.py", - "HttpControlChannel" - ], - "path_hints": [ - "src/app_runtime/control/http_channel.py" - ], - "path_scope": [ - "src/app_runtime/control/http_channel.py" - ], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "timings_ms": { - "router": 0 - } - } - }, - { - "step": "retrieval", - "input": { - "query": "Почему в файле src/app_runtime/control/http_channel.py класс HttpControlChannel устроен так?" - }, - "output": { - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "HttpControlChannel", - "alternatives": [ - "HttpControlChannel" - ], - "confidence": 0.99 - }, - "rag_count": 6, - "rag_rows": [ - { - "path": "src/app_runtime/control/http_channel.py", - "content": "class HttpControlChannel\nHttpControlChannel(ControlChannel)", - "layer": "C1_SYMBOL_CATALOG", - "title": "HttpControlChannel", - "span_start": 12, - "span_end": 57, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "1c9fbdc24819e5604c26ea55428a74310f03a03e1af197ed84846af61e42fdb0", - "qname": "HttpControlChannel", - "kind": "class", - "signature": "HttpControlChannel(ControlChannel)", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.control.http_channel", - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel.__init__\n -> HttpControlChannel._timeout\n -> HttpControlChannel._action_response", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "HttpControlChannel.__init__:dataflow_slice", - "span_start": 14, - "span_end": 47, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "c3ef21fcae96c82c00be74b3ab827d4af2085d89cb3fa5521c19a174aad84dbb", - "edge_type": "dataflow_slice", - "src_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "src_qname": "HttpControlChannel.__init__", - "dst_symbol_id": "e64969024ccaeb34d8d91473fad07b3b3d341875846392e7a006406c7ada1954", - "dst_ref": "HttpControlChannel._action_response", - "resolution": "resolved", - "slice_id": "c3ef21fcae96c82c00be74b3ab827d4af2085d89cb3fa5521c19a174aad84dbb", - "root_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "path_symbols": [ - "HttpControlChannel.__init__", - "HttpControlChannel._timeout", - "HttpControlChannel._action_response" - ], - "path_symbol_ids": [ - "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "e64969024ccaeb34d8d91473fad07b3b3d341875846392e7a006406c7ada1954" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel.__init__\n -> HttpControlChannel._runner\n -> HttpControlChannel.start", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "HttpControlChannel.__init__:dataflow_slice", - "span_start": 15, - "span_end": 22, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "51d73913df709152258ed1b9a8c8f4eb3c575eccfe6b982aef0b28e0789a29da", - "edge_type": "dataflow_slice", - "src_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "src_qname": "HttpControlChannel.__init__", - "dst_symbol_id": "d1933f04137f52535b6525f1b93ff2cd83bfb216b480e887e791ed1714cda8e0", - "dst_ref": "HttpControlChannel.start", - "resolution": "resolved", - "slice_id": "51d73913df709152258ed1b9a8c8f4eb3c575eccfe6b982aef0b28e0789a29da", - "root_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "path_symbols": [ - "HttpControlChannel.__init__", - "HttpControlChannel._runner", - "HttpControlChannel.start" - ], - "path_symbol_ids": [ - "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "d1933f04137f52535b6525f1b93ff2cd83bfb216b480e887e791ed1714cda8e0" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel.__init__\n -> HttpControlChannel._timeout\n -> HttpControlChannel._health_response", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "HttpControlChannel.__init__:dataflow_slice", - "span_start": 14, - "span_end": 34, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "f858f5c9e575f6c4cdfe3853571b7ee21d1f628a443541d2037c3dc9d0790bef", - "edge_type": "dataflow_slice", - "src_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "src_qname": "HttpControlChannel.__init__", - "dst_symbol_id": "e84bf04e9cd2127df235b7064d05f47e19f19a89c7c82f4c247231d4e8fa426a", - "dst_ref": "HttpControlChannel._health_response", - "resolution": "resolved", - "slice_id": "f858f5c9e575f6c4cdfe3853571b7ee21d1f628a443541d2037c3dc9d0790bef", - "root_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "path_symbols": [ - "HttpControlChannel.__init__", - "HttpControlChannel._timeout", - "HttpControlChannel._health_response" - ], - "path_symbol_ids": [ - "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "e84bf04e9cd2127df235b7064d05f47e19f19a89c7c82f4c247231d4e8fa426a" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel.__init__\n -> HttpControlChannel._runner\n -> HttpControlChannel.stop", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "HttpControlChannel.__init__:dataflow_slice", - "span_start": 15, - "span_end": 25, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "0f827ef81a990258a8a74381c8564a8361afa6712dba3200592659c939adcb9d", - "edge_type": "dataflow_slice", - "src_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "src_qname": "HttpControlChannel.__init__", - "dst_symbol_id": "f29ab212620093d72be20e26c5a399624c7939a6056a728762ed3f84a250bfa3", - "dst_ref": "HttpControlChannel.stop", - "resolution": "resolved", - "slice_id": "0f827ef81a990258a8a74381c8564a8361afa6712dba3200592659c939adcb9d", - "root_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "path_symbols": [ - "HttpControlChannel.__init__", - "HttpControlChannel._runner", - "HttpControlChannel.stop" - ], - "path_symbol_ids": [ - "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "f29ab212620093d72be20e26c5a399624c7939a6056a728762ed3f84a250bfa3" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "class HttpControlChannel(ControlChannel):\n def __init__(self, host: str, port: int, timeout: int) -> None:\n self._timeout = timeout\n self._runner = UvicornThreadRunner(host, port, timeout)\n self._factory = HttpControlAppFactory()\n self._actions: ControlActionSet | None = None\n\n async def start(self, actions: ControlActionSet) -> None:\n self._actions = actions\n app = self._factory.create(self._health_response, self._action_response)\n await self._runner.start(app)\n\n async def stop(self) -> None:\n await self._runner.stop()\n\n @property\n def port(self) -> int:\n return self._runner.port\n\n async def _health_response(self) -> dict[str, object]:\n if self._actions is None:\n return {\"status\": \"unhealthy\", \"detail\": \"control actions are not configured\"}\n return await asyncio.wait_for(self._actions.health(), timeout=float(self._timeout))\n\n async def _action_response(self, action: str, _client_source: str = \"unknown\") -> JSONResponse:\n if self._actions is None:\n return JSONResponse(content={\"status\": \"error\", \"detail\": f\"{action} handler is not configured\"}, status_code=404)\n callbacks = {\n \"start\": self._actions.start,\n \"stop\": self._actions.stop,\n \"status\": self._actions.status,\n }\n callback = callbacks.get(action)\n if callback is None:\n return JSONResponse(content={\"status\": \"error\", \"detail\": f\"unsupported action: {action}\"}, status_code=404)\n action_timeout = max(float(self._timeout), 10.0) if action in {\"start\", \"stop\"} else float(self._timeout)\n try:\n detail = await asyncio.wait_for(callback(), timeout=action_timeout)\n except asyncio.TimeoutError:\n return JSONResponse(\n content={\"status\": \"accepted\", \"detail\": f\"{action} operation is still in progress\"},\n status_code=202,\n )\n except Exception as exc:\n return JSONResponse(content={\"status\": \"error\", \"detail\": str(exc)}, status_code=500)\n return JSONResponse(content={\"status\": \"ok\", \"detail\": detail or f\"{action} action accepted\"}, status_code=200)", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/http_channel.py:HttpControlChannel", - "span_start": 12, - "span_end": 57, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.http_channel", - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ] - }, - "diagnostics": { - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C2_DEPENDENCY_GRAPH" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C0_SOURCE_CHUNKS": "exact_path_fetch", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 12, - "C2_DEPENDENCY_GRAPH": 4 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [ - "src/app_runtime/control/http_channel.py" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src/app_runtime/control/http_channel.py" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src/app_runtime/control/http_channel.py" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "HttpControlChannel", - "path_scope": [ - "src/app_runtime/control/http_channel.py" - ], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Почему в файле src/app_runtime/control/http_channel.py класс HttpControlChannel устроен так?", - "path_scope": [ - "src/app_runtime/control/http_channel.py" - ], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 12, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "Почему в файле src/app_runtime/control/http_channel.py класс HttpControlChannel устроен так?", - "path_scope": [ - "src/app_runtime/control/http_channel.py" - ], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 4, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [ - "src/app_runtime/control/http_channel.py" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 1, - "candidates_after_filter": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src/app_runtime/control/http_channel.py" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 1, - "candidates_after_filter": 1 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src/app_runtime/control/http_channel.py" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 4, - "candidates_after_filter": 4 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "HttpControlChannel", - "alternatives": [ - "HttpControlChannel" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 4, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "symbol_resolution": 0, - "retrieval_total": 58, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 27, - "C0_SOURCE_CHUNKS": 14, - "C2_DEPENDENCY_GRAPH": 15 - }, - "merge_rank": 19 - } - } - }, - { - "step": "llm_answer", - "input": { - "query": "Почему в файле src/app_runtime/control/http_channel.py класс HttpControlChannel устроен так?", - "rag_count": 6 - }, - "output": { - "llm_answer": "Класс `HttpControlChannel` реализует HTTP-интерфейс для управления другим компонентом приложения через HTTP-запросы.\n\n### Что делает класс:\n1. **Инициализация (`__init__`)**:\n - Принимает параметры `host`, `port` и `timeout`.\n - Создаёт экземпляр `_runner` класса `UvicornThreadRunner`, отвечающего за выполнение HTTP-сервера с использованием uvicorn (асинхронного веб-фреймворка).\n - Инициализирует объект фабрики приложений `_factory` типа `HttpControlAppFactory`, которая отвечает за создание конкретных HTTP-приложений.\n - Опционально инициализирует коллекцию действий управления `_actions`.\n\n2. **Запуск (`start`)**:\n - Проверяет наличие конфигурации действий управления (_actions). Если конфигурация отсутствует, возвращает ошибку.\n - Использует фабрику `_factory` для создания HTTP-приложения, которое включает обработчики health-запросов и action-запросов.\n - Запускает сервер с помощью `_runner.start()`.\n\n3. **Остановка (`stop`)**:\n - Останавливает асинхронный HTTP-сервер, запущенный ранее методом `start`.\n\n4. **Методы внутренних ответов**:\n - Метод `_health_response` проверяет состояние системы управления действиями. Если действия не настроены, возвращает статус \"unhealthy\". В противном случае ожидает ответ от health-метода действий и возвращает его.\n - Метод `_action_response` обрабатывает запросы к определённым действиям, возвращая результат выполнения действия или сообщение об ошибке, если действие не сконфигурировано.\n\n### Входные данные:\n- Параметры при создании экземпляра: хост, порт и таймаут.\n- Конфигурация действий управления (опционально передаётся в метод `start`).\n\n### Выходные данные:\n- Управляющие HTTP-запросы, возвращающие результаты проверки состояния системы и выполнения конкретных действий.\n\nТаким образом, класс служит промежуточным слоем между внешним интерфейсом HTTP и внутренними компонентами управления системой, обеспечивая безопасную и асинхронную обработку запросов." - }, - "diagnostics": { - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 851, - "evidence_rows": 6, - "evidence_chars": 2660 - }, - "evidence_summary": [ - { - "layer": "C1_SYMBOL_CATALOG", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "count": 4, - "unique_paths": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 1, - "unique_paths": 1 - } - ], - "prompt_template_id": "intent_code_qa_explain_local_ru_v2", - "system_prompt_version": "v1" - }, - "timings_ms": { - "prompt_build": 0, - "llm_call": 3739 - } - } - } - ] - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_132357/full_chain_plba_code_subintents_v2_plba-v2-explain-local-http-channel.md b/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_132357/full_chain_plba_code_subintents_v2_plba-v2-explain-local-http-channel.md deleted file mode 100644 index 959f46b..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_132357/full_chain_plba_code_subintents_v2_plba-v2-explain-local-http-channel.md +++ /dev/null @@ -1,34 +0,0 @@ -# plba-v2-explain-local-http-channel - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_subintents_v2.yaml -- runner: runtime -- mode: full_chain -- passed: True - -## Query -Почему в файле src/app_runtime/control/http_channel.py класс HttpControlChannel устроен так? - -## Actual -{ - "intent": "CODE_QA", - "sub_intent": "EXPLAIN_LOCAL", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 6, - "llm_answer": "Класс `HttpControlChannel` реализует HTTP-интерфейс для управления другим компонентом приложения через HTTP-запросы.\n\n### Что делает класс:\n1. **Инициализация (`__init__`)**:\n - Принимает параметры `host`, `port` и `timeout`.\n - Создаёт экземпляр `_runner` класса `UvicornThreadRunner`, отвечающего за выполнение HTTP-сервера с использованием uvicorn (асинхронного веб-фреймворка).\n - Инициализирует объект фабрики приложений `_factory` типа `HttpControlAppFactory`, которая отвечает за создание конкретных HTTP-приложений.\n - Опционально инициализирует коллекцию действий управления `_actions`.\n\n2. **Запуск (`start`)**:\n - Проверяет наличие конфигурации действий управления (_actions). Если конфигурация отсутствует, возвращает ошибку.\n - Использует фабрику `_factory` для создания HTTP-приложения, которое включает обработчики health-запросов и action-запросов.\n - Запускает сервер с помощью `_runner.start()`.\n\n3. **Остановка (`stop`)**:\n - Останавливает асинхронный HTTP-сервер, запущенный ранее методом `start`.\n\n4. **Методы внутренних ответов**:\n - Метод `_health_response` проверяет состояние системы управления действиями. Если действия не настроены, возвращает статус \"unhealthy\". В противном случае ожидает ответ от health-метода действий и возвращает его.\n - Метод `_action_response` обрабатывает запросы к определённым действиям, возвращая результат выполнения действия или сообщение об ошибке, если действие не сконфигурировано.\n\n### Входные данные:\n- Параметры при создании экземпляра: хост, порт и таймаут.\n- Конфигурация действий управления (опционально передаётся в метод `start`).\n\n### Выходные данные:\n- Управляющие HTTP-запросы, возвращающие результаты проверки состояния системы и выполнения конкретных действий.\n\nТаким образом, класс служит промежуточным слоем между внешним интерфейсом HTTP и внутренними компонентами управления системой, обеспечивая безопасную и асинхронную обработку запросов.", - "answer_mode": "answered", - "path_scope": [ - "src/app_runtime/control/http_channel.py" - ], - "symbol_candidates": [ - "HttpControlChannel" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C2_DEPENDENCY_GRAPH" - ] -} - -## Mismatches -- none \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_132357/full_chain_plba_code_subintents_v2_plba-v2-explain-nonexistent-symbol.json b/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_132357/full_chain_plba_code_subintents_v2_plba-v2-explain-nonexistent-symbol.json deleted file mode 100644 index 0a875b1..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_132357/full_chain_plba_code_subintents_v2_plba-v2-explain-nonexistent-symbol.json +++ /dev/null @@ -1,1182 +0,0 @@ -{ - "case_id": "plba-v2-explain-nonexistent-symbol", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_subintents_v2.yaml", - "runner": "runtime", - "mode": "full_chain", - "actual": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 0, - "llm_answer": "Класс `RuntimeFactoryManager` не найден ни в предоставленном контексте, ни в стандартных библиотеках Python. \n\n**Итог:** \nСущность не обнаружена. Невозможно предоставить полное объяснение её работы на основе доступного контекста. Рекомендую проверить наличие класса в реальном проекте или документации к нему. Если он существует вне представленного окружения, необходимо предоставить дополнительный контекст для анализа.", - "answer_mode": "insufficient_evidence", - "path_scope": [], - "symbol_candidates": [ - "RuntimeFactoryManager" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "passed": true, - "mismatches": [], - "details": { - "case_id": "plba-v2-explain-nonexistent-symbol", - "text": "Объясни класс RuntimeFactoryManager", - "mode": "full_chain", - "run_started_at": "2026-03-12T13:23:57", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Объясни класс RuntimeFactoryManager", - "symbol_resolution": { - "status": "not_found", - "resolved_symbol": null, - "alternatives": [ - "ControlChannel", - "ControlActionSet" - ], - "confidence": 0.0 - }, - "rag_count": 0, - "rag_rows": [], - "llm_answer": "Класс `RuntimeFactoryManager` не найден ни в предоставленном контексте, ни в стандартных библиотеках Python. \n\n**Итог:** \nСущность не обнаружена. Невозможно предоставить полное объяснение её работы на основе доступного контекста. Рекомендую проверить наличие класса в реальном проекте или документации к нему. Если он существует вне представленного окружения, необходимо предоставить дополнительный контекст для анализа.", - "summary": { - "router": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "confidence": null - }, - "retrieval": { - "profile": "code", - "layers_hit": [], - "evidence_sufficient": false - }, - "llm": { - "answer_status": "insufficient_evidence", - "groundedness": "weakly_grounded" - } - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "RuntimeFactoryManager" - ], - "keyword_hints": [ - "RuntimeFactoryManager" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C0_SOURCE_CHUNKS": "exact_path_fetch", - "C4_SEMANTIC_ROLES": "exact_path_fetch", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C3_ENTRYPOINTS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 8, - "C4_SEMANTIC_ROLES": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C3_ENTRYPOINTS": 6 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C4_SEMANTIC_ROLES": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": null, - "workspace_id": null, - "returned_repo_ids": [], - "returned_workspace_ids": [] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "RuntimeFactoryManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "RuntimeFactoryManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C4_SEMANTIC_ROLES", - "query": "RuntimeFactoryManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "RuntimeFactoryManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - }, - { - "layer": "C3_ENTRYPOINTS", - "query": "RuntimeFactoryManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 2, - "candidates_after_filter": 2 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 6, - "candidates_after_filter": 6 - }, - { - "layer": "C3_ENTRYPOINTS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 3, - "candidates_after_filter": 3 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "not_found", - "resolved_symbol": null, - "alternatives": [ - "ControlChannel", - "ControlActionSet" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "miss", - "hit_count": 0, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "miss", - "hit_count": 0, - "fail_reason": null - }, - { - "layer": "C4_SEMANTIC_ROLES", - "status": "miss", - "hit_count": 0, - "fail_reason": null - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "miss", - "hit_count": 0, - "fail_reason": null - }, - { - "layer": "C3_ENTRYPOINTS", - "status": "miss", - "hit_count": 0, - "fail_reason": null - } - ] - }, - "constraint_violations": [ - { - "type": "LAYER_MISSING", - "severity": "warn", - "details": { - "layer": "C1_SYMBOL_CATALOG", - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "suggested_fix": "Increase top_k for this layer or relax constraints for retrieval." - }, - { - "type": "LAYER_MISSING", - "severity": "warn", - "details": { - "layer": "C0_SOURCE_CHUNKS", - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "suggested_fix": "Increase top_k for this layer or relax constraints for retrieval." - }, - { - "type": "LAYER_MISSING", - "severity": "warn", - "details": { - "layer": "C4_SEMANTIC_ROLES", - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "suggested_fix": "Increase top_k for this layer or relax constraints for retrieval." - }, - { - "type": "LAYER_MISSING", - "severity": "warn", - "details": { - "layer": "C2_DEPENDENCY_GRAPH", - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "suggested_fix": "Increase top_k for this layer or relax constraints for retrieval." - }, - { - "type": "LAYER_MISSING", - "severity": "warn", - "details": { - "layer": "C3_ENTRYPOINTS", - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "suggested_fix": "Increase top_k for this layer or relax constraints for retrieval." - }, - { - "type": "SYMBOL_RESOLUTION_FAILED", - "severity": "warn", - "details": { - "status": "not_found", - "symbol_candidates": [ - "RuntimeFactoryManager" - ] - }, - "suggested_fix": "Increase symbol layer budget or improve fuzzy symbol resolution settings." - } - ], - "timings_ms": { - "router": 0, - "symbol_resolution": 0, - "retrieval_total": 136, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 42, - "C0_SOURCE_CHUNKS": 15, - "C4_SEMANTIC_ROLES": 12, - "C2_DEPENDENCY_GRAPH": 56, - "C3_ENTRYPOINTS": 9 - }, - "merge_rank": 0, - "prompt_build": 0, - "llm_call": 854 - }, - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 312, - "evidence_rows": 0, - "evidence_chars": 0 - }, - "evidence_summary": [], - "prompt_template_id": "intent_code_qa_explain_ru_v2", - "system_prompt_version": "v1" - }, - "router": { - "conversation_mode": "START", - "keyword_hints": [ - "RuntimeFactoryManager" - ], - "path_scope": [] - }, - "llm": { - "used_evidence_count": 0, - "missing_evidence_reason": "empty_retrieval_context" - } - }, - "run_info": { - "case_id": "plba-v2-explain-nonexistent-symbol", - "mode": "full_chain", - "run_started_at": "2026-03-12T13:23:57", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - }, - "input_request": { - "text": "Объясни класс RuntimeFactoryManager", - "normalized_query": "Объясни класс RuntimeFactoryManager" - }, - "steps": [ - { - "step": "intent_router", - "input": { - "query": "Объясни класс RuntimeFactoryManager" - }, - "output": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Объясни класс RuntimeFactoryManager" - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "RuntimeFactoryManager" - ], - "keyword_hints": [ - "RuntimeFactoryManager" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "timings_ms": { - "router": 0 - } - } - }, - { - "step": "retrieval", - "input": { - "query": "Объясни класс RuntimeFactoryManager" - }, - "output": { - "symbol_resolution": { - "status": "not_found", - "resolved_symbol": null, - "alternatives": [ - "ControlChannel", - "ControlActionSet" - ], - "confidence": 0.0 - }, - "rag_count": 0, - "rag_rows": [] - }, - "diagnostics": { - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C0_SOURCE_CHUNKS": "exact_path_fetch", - "C4_SEMANTIC_ROLES": "exact_path_fetch", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C3_ENTRYPOINTS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 8, - "C4_SEMANTIC_ROLES": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C3_ENTRYPOINTS": 6 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C4_SEMANTIC_ROLES": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": null, - "workspace_id": null, - "returned_repo_ids": [], - "returned_workspace_ids": [] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "RuntimeFactoryManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "RuntimeFactoryManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C4_SEMANTIC_ROLES", - "query": "RuntimeFactoryManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "RuntimeFactoryManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - }, - { - "layer": "C3_ENTRYPOINTS", - "query": "RuntimeFactoryManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 2, - "candidates_after_filter": 2 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 6, - "candidates_after_filter": 6 - }, - { - "layer": "C3_ENTRYPOINTS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 3, - "candidates_after_filter": 3 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "not_found", - "resolved_symbol": null, - "alternatives": [ - "ControlChannel", - "ControlActionSet" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "miss", - "hit_count": 0, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "miss", - "hit_count": 0, - "fail_reason": null - }, - { - "layer": "C4_SEMANTIC_ROLES", - "status": "miss", - "hit_count": 0, - "fail_reason": null - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "miss", - "hit_count": 0, - "fail_reason": null - }, - { - "layer": "C3_ENTRYPOINTS", - "status": "miss", - "hit_count": 0, - "fail_reason": null - } - ] - }, - "constraint_violations": [ - { - "type": "LAYER_MISSING", - "severity": "warn", - "details": { - "layer": "C1_SYMBOL_CATALOG", - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "suggested_fix": "Increase top_k for this layer or relax constraints for retrieval." - }, - { - "type": "LAYER_MISSING", - "severity": "warn", - "details": { - "layer": "C0_SOURCE_CHUNKS", - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "suggested_fix": "Increase top_k for this layer or relax constraints for retrieval." - }, - { - "type": "LAYER_MISSING", - "severity": "warn", - "details": { - "layer": "C4_SEMANTIC_ROLES", - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "suggested_fix": "Increase top_k for this layer or relax constraints for retrieval." - }, - { - "type": "LAYER_MISSING", - "severity": "warn", - "details": { - "layer": "C2_DEPENDENCY_GRAPH", - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "suggested_fix": "Increase top_k for this layer or relax constraints for retrieval." - }, - { - "type": "LAYER_MISSING", - "severity": "warn", - "details": { - "layer": "C3_ENTRYPOINTS", - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "suggested_fix": "Increase top_k for this layer or relax constraints for retrieval." - }, - { - "type": "SYMBOL_RESOLUTION_FAILED", - "severity": "warn", - "details": { - "status": "not_found", - "symbol_candidates": [ - "RuntimeFactoryManager" - ] - }, - "suggested_fix": "Increase symbol layer budget or improve fuzzy symbol resolution settings." - } - ], - "timings_ms": { - "symbol_resolution": 0, - "retrieval_total": 136, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 42, - "C0_SOURCE_CHUNKS": 15, - "C4_SEMANTIC_ROLES": 12, - "C2_DEPENDENCY_GRAPH": 56, - "C3_ENTRYPOINTS": 9 - }, - "merge_rank": 0 - } - } - }, - { - "step": "llm_answer", - "input": { - "query": "Объясни класс RuntimeFactoryManager", - "rag_count": 0 - }, - "output": { - "llm_answer": "Класс `RuntimeFactoryManager` не найден ни в предоставленном контексте, ни в стандартных библиотеках Python. \n\n**Итог:** \nСущность не обнаружена. Невозможно предоставить полное объяснение её работы на основе доступного контекста. Рекомендую проверить наличие класса в реальном проекте или документации к нему. Если он существует вне представленного окружения, необходимо предоставить дополнительный контекст для анализа." - }, - "diagnostics": { - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 312, - "evidence_rows": 0, - "evidence_chars": 0 - }, - "evidence_summary": [], - "prompt_template_id": "intent_code_qa_explain_ru_v2", - "system_prompt_version": "v1" - }, - "timings_ms": { - "prompt_build": 0, - "llm_call": 854 - } - } - } - ] - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_132357/full_chain_plba_code_subintents_v2_plba-v2-explain-nonexistent-symbol.md b/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_132357/full_chain_plba_code_subintents_v2_plba-v2-explain-nonexistent-symbol.md deleted file mode 100644 index 94657b1..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_132357/full_chain_plba_code_subintents_v2_plba-v2-explain-nonexistent-symbol.md +++ /dev/null @@ -1,34 +0,0 @@ -# plba-v2-explain-nonexistent-symbol - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_subintents_v2.yaml -- runner: runtime -- mode: full_chain -- passed: True - -## Query -Объясни класс RuntimeFactoryManager - -## Actual -{ - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 0, - "llm_answer": "Класс `RuntimeFactoryManager` не найден ни в предоставленном контексте, ни в стандартных библиотеках Python. \n\n**Итог:** \nСущность не обнаружена. Невозможно предоставить полное объяснение её работы на основе доступного контекста. Рекомендую проверить наличие класса в реальном проекте или документации к нему. Если он существует вне представленного окружения, необходимо предоставить дополнительный контекст для анализа.", - "answer_mode": "insufficient_evidence", - "path_scope": [], - "symbol_candidates": [ - "RuntimeFactoryManager" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] -} - -## Mismatches -- none \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_132357/full_chain_plba_code_subintents_v2_plba-v2-explain-runtime-manager.json b/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_132357/full_chain_plba_code_subintents_v2_plba-v2-explain-runtime-manager.json deleted file mode 100644 index d68bb32..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_132357/full_chain_plba_code_subintents_v2_plba-v2-explain-runtime-manager.json +++ /dev/null @@ -1,2088 +0,0 @@ -{ - "case_id": "plba-v2-explain-runtime-manager", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_subintents_v2.yaml", - "runner": "runtime", - "mode": "full_chain", - "actual": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 12, - "llm_answer": "1. **Что это и где определено**:\n - Класс `RuntimeManager` определен в файле `src/app_runtime/core/runtime.py`.\n \n2. **Назначение по наблюдаемому коду**:\n - Судя по комментариям и контексту, класс предназначен для управления жизненным циклом приложения и координации различных сервисов и модулей. Он выступает в роли менеджера, отвечающего за инициализацию, регистрацию и управление состоянием различных компонентов системы.\n - Из описания его ответственности (\"manager\", \"orchestrates role-like calls\") можно предположить, что он отвечает за координацию работы других сервисов и управляет их взаимодействием через чтение и запись состояния атрибутов.\n\n3. **Подтверждённые зависимости или взаимодействия**:\n - В конструкторе класса явно видны зависимости от следующих классов и объектов:\n - `ConfigurationManager`\n - `ServiceContainer`\n - `TraceService`\n - `HealthRegistry`\n - `LogManager`\n - `WorkerSupervisor`\n - `ControlPlaneService`\n - Эти зависимости передаются конструктору при создании экземпляра класса и могут быть использованы внутри методов класса.\n\n4. **Что делает по шагам, если это видно в контексте**:\n - Конструктор инициализирует экземпляр класса, присваивая значения параметров по умолчанию, если они не переданы явно.\n - Внутри конструктора вызывается метод `_register_core_services()`, вероятно, регистрирующий основные сервисы или модули.\n - Метод `register_module(module: ApplicationModule)` предназначен для регистрации модуля, хотя его реализация неполная и обрезана в предоставленном фрагменте.\n\n5. **Осторожные выводы**:\n - Несмотря на наличие явных зависимостей и общего назначения класса, невозможно точно понять весь функционал из предоставленного контекста. Не видна основная логика, выполняемая после начальной настройки.\n - Также отсутствует информация о том, какие методы используются чаще всего и как именно они влияют на состояние приложения.\n\n6. **Чего не хватает для полного объяснения**:\n - Полностью отсутствуют детали реализации методов, которые могли бы показать полный функционал класса (`_register_core_services()` и другие).\n - Отсутствует понимание того, как `RuntimeManager` участвует в общем потоке данных или управлении жизненным циклом приложения.\n - Нет информации о взаимодействии с внешними компонентами, такими как HTTP приложение или микросервисы, упомянутые в `ControlPlaneService`.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "RuntimeManager" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "passed": true, - "mismatches": [], - "details": { - "case_id": "plba-v2-explain-runtime-manager", - "text": "Объясни как работает класс RuntimeManager", - "mode": "full_chain", - "run_started_at": "2026-03-12T13:23:57", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Объясни как работает класс RuntimeManager", - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "RuntimeManager", - "alternatives": [ - "RuntimeManager" - ], - "confidence": 0.99 - }, - "rag_count": 12, - "rag_rows": [ - { - "path": "src/app_runtime/core/runtime.py", - "content": "class RuntimeManager\nRuntimeManager", - "layer": "C1_SYMBOL_CATALOG", - "title": "RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "7e4a9381328c5803bbc6179458612fc4e947d928aa7bf8b4b2bebb2c8592f758", - "qname": "RuntimeManager", - "kind": "class", - "signature": "RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.core.runtime", - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests manager\n- orchestrates role-like calls (4)\n- reads and writes state attributes\n- participates in dataflow slices (50)", - "layer": "C4_SEMANTIC_ROLES", - "title": "RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 43, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "7e4a9381328c5803bbc6179458612fc4e947d928aa7bf8b4b2bebb2c8592f758", - "symbol_name": "RuntimeManager", - "qname": "RuntimeManager", - "role": "pipeline_stage", - "confidence": 0.67, - "dataflow_participation": 50, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.stop", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 25, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d", - "dst_ref": "ControlPlaneService.stop", - "resolution": "resolved", - "slice_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.stop" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._stop_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 51, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a", - "dst_ref": "ControlPlaneService._stop_async", - "resolution": "resolved", - "slice_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._stop_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.register_channel", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 17, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957", - "dst_ref": "ControlPlaneService.register_channel", - "resolution": "resolved", - "slice_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.register_channel" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.start", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 20, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154", - "dst_ref": "ControlPlaneService.start", - "resolution": "resolved", - "slice_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.start" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._start_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 47, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517", - "dst_ref": "ControlPlaneService._start_async", - "resolution": "resolved", - "slice_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._start_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager.add_config_file", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 32, - "span_end": 52, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "a23b8a11ebdb12708b60c96ea12a69f7f042082f1adfddd572444e246d81d167", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "57ffbd4f0d9fdf3507c2b8624312ce211f3d02fdf86a57a8ec90778d8a7b498d", - "dst_ref": "RuntimeManager.add_config_file", - "resolution": "resolved", - "slice_id": "a23b8a11ebdb12708b60c96ea12a69f7f042082f1adfddd572444e246d81d167", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager.add_config_file" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "57ffbd4f0d9fdf3507c2b8624312ce211f3d02fdf86a57a8ec90778d8a7b498d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "class RuntimeManager:\n ACTION_TIMEOUT_SECONDS = 10.0\n ACTION_POLL_INTERVAL_SECONDS = 0.05\n\n def __init__(\n self,\n configuration: ConfigurationManager | None = None,\n services: ServiceContainer | None = None,\n traces: TraceService | None = None,\n health: HealthRegistry | None = None,\n logs: LogManager | None = None,\n workers: WorkerSupervisor | None = None,\n control_plane: ControlPlaneService | None = None,\n ) -> None:\n self.configuration = configuration or ConfigurationManager()\n self.services = services or ServiceContainer()\n self.traces = traces or TraceService()\n self.health = health or HealthRegistry()\n self.logs = logs or LogManager()\n self.workers = workers or WorkerSupervisor()\n self.control_plane = control_plane or ControlPlaneService()\n self.registry = ModuleRegistry(self.services)\n self._started = False\n self._state = LifecycleState.IDLE\n self._core_registered = False\n self._workers_registered = False\n self._register_core_services()\n\n def register_module(self, module: ApplicationModule) -> None:\n self.registry.register_module(module.name)\n module.register(self.registry)\n\n def add_config_file(self, path: str) -> FileConfigProvider:\n provider = FileConfigProvider(path)\n self.configuration.add_provider(provider)\n return provider\n\n def start(self, *, start_control_plane: bool = True) -> None:\n if self._started:\n return\n self._state = LifecycleState.STARTING\n config = self.configuration.load()\n self.logs.apply_config(config)\n self._register_health_contributors()\n self._register_workers()\n self.workers.start()\n if start_control_plane:\n self.control_plane.start(self)\n self._started = True\n self._refresh_state()\n\n def stop(self, timeout: float = 30.0, force: bool = False, stop_control_plane: bool = True) -> None:\n if not self._started:\n return\n self._state = LifecycleState.STOPPING\n self.workers.stop(timeout=timeout, force=force)\n if stop_control_plane:\n self.control_plane.stop()\n self._started = False\n self._state = LifecycleState.STOPPED\n\n def status(self) -> dict[str, object]:\n self._refresh_state()\n return self.control_plane.snapshot(self)\n\n def current_health(self) -> HealthPayload:\n self._refresh_state()\n return self.health.payload(self._state, self.workers.healths())\n\n async def health_status(self) -> HealthPayload:\n return self.current_health()\n\n async def start_runtime(self) -> dict[str, object] | str:\n self._refresh_state()\n if self._started:\n return \"runtime already running\"\n if self._state == LifecycleState.STOPPING:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n\n self.start(start_control_plane=False)\n started = self._wait_for_state({LifecycleState.IDLE, LifecycleState.BUSY}, timeout=self.ACTION_TIMEOUT_SECONDS)\n if started:\n return self._action_detail(\"runtime started\", timed_out=False)\n return self._action_detail(\"runtime start is still in progress\", timed_out=True)\n\n async def stop_runtime(self) -> dict[str, object] | str:\n self._refresh_state()\n if not self._started:\n if self._state == LifecycleState.STOPPING:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n return \"runtime already stopped\"\n\n self._state = LifecycleState.STOPPING\n try:\n self.workers.stop(timeout=self.ACTION_TIMEOUT_SECONDS, force=False)\n except TimeoutError:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n\n self._started = False\n self._state = LifecycleState.STOPPED\n return self._action_detail(\"runtime stopped\", timed_out=False)\n\n async def runtime_status(self) -> str:\n self._refresh_state()\n return self._state.value\n\n def _register_core_services(self) -> None:\n if self._core_registered:\n return\n self.services.register(\"configuration\", self.configuration)\n self.services.register(\"traces\", self.traces)\n self.services.register(\"health\", self.health)\n self.services.register(\"logs\", self.logs)\n self.services.register(\"workers\", self.workers)\n self.services.register(\"control_plane\", self.control_plane)\n self._core_registered = True\n\n def _register_health_contributors(self) -> None:\n for contributor in self.registry.health_contributors:\n self.health.register(contributor)\n\n def _register_workers(self) -> None:\n if self._workers_registered:\n return\n for worker in self.registry.workers:\n self.workers.register(worker)\n self._workers_registered = True\n\n def _refresh_state(self) -> None:\n lifecycle = self.workers.lifecycle_state()\n\n if self._state == LifecycleState.STOPPING:\n if lifecycle == LifecycleState.STOPPED:\n self._started = False\n self._state = LifecycleState.STOPPED\n return\n\n if not self._started:\n if lifecycle == LifecycleState.STOPPED:\n self._state = LifecycleState.STOPPED\n return\n\n self._state = lifecycle\n\n def _wait_for_state(self, target_states: set[LifecycleState], *, timeout: float) -> bool:\n deadline = monotonic() + timeout\n while monotonic() < deadline:\n self._refresh_state()\n if self._state in target_states:\n return True\n sleep(self.ACTION_POLL_INTERVAL_SECONDS)\n self._refresh_state()\n return self._state in target_states\n\n def _action_detail(self, message: str, *, timed_out: bool) -> dict[str, object]:\n self._refresh_state()\n return {\n \"message\": message,\n \"state\": self._state.value,\n \"timed_out\": timed_out,\n \"workers\": self.workers.snapshot(),\n }", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/core/runtime.py:RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.core.runtime", - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "llm_answer": "1. **Что это и где определено**:\n - Класс `RuntimeManager` определен в файле `src/app_runtime/core/runtime.py`.\n \n2. **Назначение по наблюдаемому коду**:\n - Судя по комментариям и контексту, класс предназначен для управления жизненным циклом приложения и координации различных сервисов и модулей. Он выступает в роли менеджера, отвечающего за инициализацию, регистрацию и управление состоянием различных компонентов системы.\n - Из описания его ответственности (\"manager\", \"orchestrates role-like calls\") можно предположить, что он отвечает за координацию работы других сервисов и управляет их взаимодействием через чтение и запись состояния атрибутов.\n\n3. **Подтверждённые зависимости или взаимодействия**:\n - В конструкторе класса явно видны зависимости от следующих классов и объектов:\n - `ConfigurationManager`\n - `ServiceContainer`\n - `TraceService`\n - `HealthRegistry`\n - `LogManager`\n - `WorkerSupervisor`\n - `ControlPlaneService`\n - Эти зависимости передаются конструктору при создании экземпляра класса и могут быть использованы внутри методов класса.\n\n4. **Что делает по шагам, если это видно в контексте**:\n - Конструктор инициализирует экземпляр класса, присваивая значения параметров по умолчанию, если они не переданы явно.\n - Внутри конструктора вызывается метод `_register_core_services()`, вероятно, регистрирующий основные сервисы или модули.\n - Метод `register_module(module: ApplicationModule)` предназначен для регистрации модуля, хотя его реализация неполная и обрезана в предоставленном фрагменте.\n\n5. **Осторожные выводы**:\n - Несмотря на наличие явных зависимостей и общего назначения класса, невозможно точно понять весь функционал из предоставленного контекста. Не видна основная логика, выполняемая после начальной настройки.\n - Также отсутствует информация о том, какие методы используются чаще всего и как именно они влияют на состояние приложения.\n\n6. **Чего не хватает для полного объяснения**:\n - Полностью отсутствуют детали реализации методов, которые могли бы показать полный функционал класса (`_register_core_services()` и другие).\n - Отсутствует понимание того, как `RuntimeManager` участвует в общем потоке данных или управлении жизненным циклом приложения.\n - Нет информации о взаимодействии с внешними компонентами, такими как HTTP приложение или микросервисы, упомянутые в `ControlPlaneService`.", - "summary": { - "router": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "confidence": null - }, - "retrieval": { - "profile": "code", - "layers_hit": [ - "C0_SOURCE_CHUNKS", - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS", - "C4_SEMANTIC_ROLES" - ], - "evidence_sufficient": true - }, - "llm": { - "answer_status": "answered", - "groundedness": "grounded" - } - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "RuntimeManager" - ], - "keyword_hints": [ - "RuntimeManager" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C0_SOURCE_CHUNKS": "exact_path_fetch", - "C4_SEMANTIC_ROLES": "exact_path_fetch", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C3_ENTRYPOINTS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 8, - "C4_SEMANTIC_ROLES": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C3_ENTRYPOINTS": 6 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C4_SEMANTIC_ROLES": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C4_SEMANTIC_ROLES", - "query": "RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - }, - { - "layer": "C3_ENTRYPOINTS", - "query": "RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 1, - "candidates_after_filter": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 6, - "candidates_after_filter": 6 - }, - { - "layer": "C3_ENTRYPOINTS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 3, - "candidates_after_filter": 3 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "RuntimeManager", - "alternatives": [ - "RuntimeManager" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C4_SEMANTIC_ROLES", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 6, - "fail_reason": null - }, - { - "layer": "C3_ENTRYPOINTS", - "status": "hit", - "hit_count": 3, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "router": 0, - "symbol_resolution": 0, - "retrieval_total": 176, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 51, - "C0_SOURCE_CHUNKS": 20, - "C4_SEMANTIC_ROLES": 14, - "C2_DEPENDENCY_GRAPH": 56, - "C3_ENTRYPOINTS": 10 - }, - "merge_rank": 21, - "prompt_build": 0, - "llm_call": 3992 - }, - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 854, - "evidence_rows": 12, - "evidence_chars": 7130 - }, - "evidence_summary": [ - { - "layer": "C1_SYMBOL_CATALOG", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "count": 6, - "unique_paths": 2 - }, - { - "layer": "C3_ENTRYPOINTS", - "count": 3, - "unique_paths": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 1, - "unique_paths": 1 - } - ], - "prompt_template_id": "intent_code_qa_explain_ru_v2", - "system_prompt_version": "v1" - }, - "router": { - "conversation_mode": "START", - "keyword_hints": [ - "RuntimeManager" - ], - "path_scope": [] - }, - "llm": { - "used_evidence_count": 12, - "missing_evidence_reason": null - } - }, - "run_info": { - "case_id": "plba-v2-explain-runtime-manager", - "mode": "full_chain", - "run_started_at": "2026-03-12T13:23:57", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - }, - "input_request": { - "text": "Объясни как работает класс RuntimeManager", - "normalized_query": "Объясни как работает класс RuntimeManager" - }, - "steps": [ - { - "step": "intent_router", - "input": { - "query": "Объясни как работает класс RuntimeManager" - }, - "output": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Объясни как работает класс RuntimeManager" - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "RuntimeManager" - ], - "keyword_hints": [ - "RuntimeManager" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "timings_ms": { - "router": 0 - } - } - }, - { - "step": "retrieval", - "input": { - "query": "Объясни как работает класс RuntimeManager" - }, - "output": { - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "RuntimeManager", - "alternatives": [ - "RuntimeManager" - ], - "confidence": 0.99 - }, - "rag_count": 12, - "rag_rows": [ - { - "path": "src/app_runtime/core/runtime.py", - "content": "class RuntimeManager\nRuntimeManager", - "layer": "C1_SYMBOL_CATALOG", - "title": "RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "7e4a9381328c5803bbc6179458612fc4e947d928aa7bf8b4b2bebb2c8592f758", - "qname": "RuntimeManager", - "kind": "class", - "signature": "RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.core.runtime", - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests manager\n- orchestrates role-like calls (4)\n- reads and writes state attributes\n- participates in dataflow slices (50)", - "layer": "C4_SEMANTIC_ROLES", - "title": "RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 43, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "7e4a9381328c5803bbc6179458612fc4e947d928aa7bf8b4b2bebb2c8592f758", - "symbol_name": "RuntimeManager", - "qname": "RuntimeManager", - "role": "pipeline_stage", - "confidence": 0.67, - "dataflow_participation": 50, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.stop", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 25, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d", - "dst_ref": "ControlPlaneService.stop", - "resolution": "resolved", - "slice_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.stop" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._stop_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 51, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a", - "dst_ref": "ControlPlaneService._stop_async", - "resolution": "resolved", - "slice_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._stop_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.register_channel", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 17, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957", - "dst_ref": "ControlPlaneService.register_channel", - "resolution": "resolved", - "slice_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.register_channel" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.start", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 20, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154", - "dst_ref": "ControlPlaneService.start", - "resolution": "resolved", - "slice_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.start" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._start_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 47, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517", - "dst_ref": "ControlPlaneService._start_async", - "resolution": "resolved", - "slice_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._start_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager.add_config_file", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 32, - "span_end": 52, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "a23b8a11ebdb12708b60c96ea12a69f7f042082f1adfddd572444e246d81d167", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "57ffbd4f0d9fdf3507c2b8624312ce211f3d02fdf86a57a8ec90778d8a7b498d", - "dst_ref": "RuntimeManager.add_config_file", - "resolution": "resolved", - "slice_id": "a23b8a11ebdb12708b60c96ea12a69f7f042082f1adfddd572444e246d81d167", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager.add_config_file" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "57ffbd4f0d9fdf3507c2b8624312ce211f3d02fdf86a57a8ec90778d8a7b498d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "class RuntimeManager:\n ACTION_TIMEOUT_SECONDS = 10.0\n ACTION_POLL_INTERVAL_SECONDS = 0.05\n\n def __init__(\n self,\n configuration: ConfigurationManager | None = None,\n services: ServiceContainer | None = None,\n traces: TraceService | None = None,\n health: HealthRegistry | None = None,\n logs: LogManager | None = None,\n workers: WorkerSupervisor | None = None,\n control_plane: ControlPlaneService | None = None,\n ) -> None:\n self.configuration = configuration or ConfigurationManager()\n self.services = services or ServiceContainer()\n self.traces = traces or TraceService()\n self.health = health or HealthRegistry()\n self.logs = logs or LogManager()\n self.workers = workers or WorkerSupervisor()\n self.control_plane = control_plane or ControlPlaneService()\n self.registry = ModuleRegistry(self.services)\n self._started = False\n self._state = LifecycleState.IDLE\n self._core_registered = False\n self._workers_registered = False\n self._register_core_services()\n\n def register_module(self, module: ApplicationModule) -> None:\n self.registry.register_module(module.name)\n module.register(self.registry)\n\n def add_config_file(self, path: str) -> FileConfigProvider:\n provider = FileConfigProvider(path)\n self.configuration.add_provider(provider)\n return provider\n\n def start(self, *, start_control_plane: bool = True) -> None:\n if self._started:\n return\n self._state = LifecycleState.STARTING\n config = self.configuration.load()\n self.logs.apply_config(config)\n self._register_health_contributors()\n self._register_workers()\n self.workers.start()\n if start_control_plane:\n self.control_plane.start(self)\n self._started = True\n self._refresh_state()\n\n def stop(self, timeout: float = 30.0, force: bool = False, stop_control_plane: bool = True) -> None:\n if not self._started:\n return\n self._state = LifecycleState.STOPPING\n self.workers.stop(timeout=timeout, force=force)\n if stop_control_plane:\n self.control_plane.stop()\n self._started = False\n self._state = LifecycleState.STOPPED\n\n def status(self) -> dict[str, object]:\n self._refresh_state()\n return self.control_plane.snapshot(self)\n\n def current_health(self) -> HealthPayload:\n self._refresh_state()\n return self.health.payload(self._state, self.workers.healths())\n\n async def health_status(self) -> HealthPayload:\n return self.current_health()\n\n async def start_runtime(self) -> dict[str, object] | str:\n self._refresh_state()\n if self._started:\n return \"runtime already running\"\n if self._state == LifecycleState.STOPPING:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n\n self.start(start_control_plane=False)\n started = self._wait_for_state({LifecycleState.IDLE, LifecycleState.BUSY}, timeout=self.ACTION_TIMEOUT_SECONDS)\n if started:\n return self._action_detail(\"runtime started\", timed_out=False)\n return self._action_detail(\"runtime start is still in progress\", timed_out=True)\n\n async def stop_runtime(self) -> dict[str, object] | str:\n self._refresh_state()\n if not self._started:\n if self._state == LifecycleState.STOPPING:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n return \"runtime already stopped\"\n\n self._state = LifecycleState.STOPPING\n try:\n self.workers.stop(timeout=self.ACTION_TIMEOUT_SECONDS, force=False)\n except TimeoutError:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n\n self._started = False\n self._state = LifecycleState.STOPPED\n return self._action_detail(\"runtime stopped\", timed_out=False)\n\n async def runtime_status(self) -> str:\n self._refresh_state()\n return self._state.value\n\n def _register_core_services(self) -> None:\n if self._core_registered:\n return\n self.services.register(\"configuration\", self.configuration)\n self.services.register(\"traces\", self.traces)\n self.services.register(\"health\", self.health)\n self.services.register(\"logs\", self.logs)\n self.services.register(\"workers\", self.workers)\n self.services.register(\"control_plane\", self.control_plane)\n self._core_registered = True\n\n def _register_health_contributors(self) -> None:\n for contributor in self.registry.health_contributors:\n self.health.register(contributor)\n\n def _register_workers(self) -> None:\n if self._workers_registered:\n return\n for worker in self.registry.workers:\n self.workers.register(worker)\n self._workers_registered = True\n\n def _refresh_state(self) -> None:\n lifecycle = self.workers.lifecycle_state()\n\n if self._state == LifecycleState.STOPPING:\n if lifecycle == LifecycleState.STOPPED:\n self._started = False\n self._state = LifecycleState.STOPPED\n return\n\n if not self._started:\n if lifecycle == LifecycleState.STOPPED:\n self._state = LifecycleState.STOPPED\n return\n\n self._state = lifecycle\n\n def _wait_for_state(self, target_states: set[LifecycleState], *, timeout: float) -> bool:\n deadline = monotonic() + timeout\n while monotonic() < deadline:\n self._refresh_state()\n if self._state in target_states:\n return True\n sleep(self.ACTION_POLL_INTERVAL_SECONDS)\n self._refresh_state()\n return self._state in target_states\n\n def _action_detail(self, message: str, *, timed_out: bool) -> dict[str, object]:\n self._refresh_state()\n return {\n \"message\": message,\n \"state\": self._state.value,\n \"timed_out\": timed_out,\n \"workers\": self.workers.snapshot(),\n }", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/core/runtime.py:RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.core.runtime", - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ] - }, - "diagnostics": { - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C0_SOURCE_CHUNKS": "exact_path_fetch", - "C4_SEMANTIC_ROLES": "exact_path_fetch", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C3_ENTRYPOINTS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 8, - "C4_SEMANTIC_ROLES": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C3_ENTRYPOINTS": 6 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C4_SEMANTIC_ROLES": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C4_SEMANTIC_ROLES", - "query": "RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - }, - { - "layer": "C3_ENTRYPOINTS", - "query": "RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 1, - "candidates_after_filter": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 6, - "candidates_after_filter": 6 - }, - { - "layer": "C3_ENTRYPOINTS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 3, - "candidates_after_filter": 3 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "RuntimeManager", - "alternatives": [ - "RuntimeManager" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C4_SEMANTIC_ROLES", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 6, - "fail_reason": null - }, - { - "layer": "C3_ENTRYPOINTS", - "status": "hit", - "hit_count": 3, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "symbol_resolution": 0, - "retrieval_total": 176, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 51, - "C0_SOURCE_CHUNKS": 20, - "C4_SEMANTIC_ROLES": 14, - "C2_DEPENDENCY_GRAPH": 56, - "C3_ENTRYPOINTS": 10 - }, - "merge_rank": 21 - } - } - }, - { - "step": "llm_answer", - "input": { - "query": "Объясни как работает класс RuntimeManager", - "rag_count": 12 - }, - "output": { - "llm_answer": "1. **Что это и где определено**:\n - Класс `RuntimeManager` определен в файле `src/app_runtime/core/runtime.py`.\n \n2. **Назначение по наблюдаемому коду**:\n - Судя по комментариям и контексту, класс предназначен для управления жизненным циклом приложения и координации различных сервисов и модулей. Он выступает в роли менеджера, отвечающего за инициализацию, регистрацию и управление состоянием различных компонентов системы.\n - Из описания его ответственности (\"manager\", \"orchestrates role-like calls\") можно предположить, что он отвечает за координацию работы других сервисов и управляет их взаимодействием через чтение и запись состояния атрибутов.\n\n3. **Подтверждённые зависимости или взаимодействия**:\n - В конструкторе класса явно видны зависимости от следующих классов и объектов:\n - `ConfigurationManager`\n - `ServiceContainer`\n - `TraceService`\n - `HealthRegistry`\n - `LogManager`\n - `WorkerSupervisor`\n - `ControlPlaneService`\n - Эти зависимости передаются конструктору при создании экземпляра класса и могут быть использованы внутри методов класса.\n\n4. **Что делает по шагам, если это видно в контексте**:\n - Конструктор инициализирует экземпляр класса, присваивая значения параметров по умолчанию, если они не переданы явно.\n - Внутри конструктора вызывается метод `_register_core_services()`, вероятно, регистрирующий основные сервисы или модули.\n - Метод `register_module(module: ApplicationModule)` предназначен для регистрации модуля, хотя его реализация неполная и обрезана в предоставленном фрагменте.\n\n5. **Осторожные выводы**:\n - Несмотря на наличие явных зависимостей и общего назначения класса, невозможно точно понять весь функционал из предоставленного контекста. Не видна основная логика, выполняемая после начальной настройки.\n - Также отсутствует информация о том, какие методы используются чаще всего и как именно они влияют на состояние приложения.\n\n6. **Чего не хватает для полного объяснения**:\n - Полностью отсутствуют детали реализации методов, которые могли бы показать полный функционал класса (`_register_core_services()` и другие).\n - Отсутствует понимание того, как `RuntimeManager` участвует в общем потоке данных или управлении жизненным циклом приложения.\n - Нет информации о взаимодействии с внешними компонентами, такими как HTTP приложение или микросервисы, упомянутые в `ControlPlaneService`." - }, - "diagnostics": { - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 854, - "evidence_rows": 12, - "evidence_chars": 7130 - }, - "evidence_summary": [ - { - "layer": "C1_SYMBOL_CATALOG", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "count": 6, - "unique_paths": 2 - }, - { - "layer": "C3_ENTRYPOINTS", - "count": 3, - "unique_paths": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 1, - "unique_paths": 1 - } - ], - "prompt_template_id": "intent_code_qa_explain_ru_v2", - "system_prompt_version": "v1" - }, - "timings_ms": { - "prompt_build": 0, - "llm_call": 3992 - } - } - } - ] - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_132357/full_chain_plba_code_subintents_v2_plba-v2-explain-runtime-manager.md b/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_132357/full_chain_plba_code_subintents_v2_plba-v2-explain-runtime-manager.md deleted file mode 100644 index 8868997..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_132357/full_chain_plba_code_subintents_v2_plba-v2-explain-runtime-manager.md +++ /dev/null @@ -1,34 +0,0 @@ -# plba-v2-explain-runtime-manager - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_subintents_v2.yaml -- runner: runtime -- mode: full_chain -- passed: True - -## Query -Объясни как работает класс RuntimeManager - -## Actual -{ - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 12, - "llm_answer": "1. **Что это и где определено**:\n - Класс `RuntimeManager` определен в файле `src/app_runtime/core/runtime.py`.\n \n2. **Назначение по наблюдаемому коду**:\n - Судя по комментариям и контексту, класс предназначен для управления жизненным циклом приложения и координации различных сервисов и модулей. Он выступает в роли менеджера, отвечающего за инициализацию, регистрацию и управление состоянием различных компонентов системы.\n - Из описания его ответственности (\"manager\", \"orchestrates role-like calls\") можно предположить, что он отвечает за координацию работы других сервисов и управляет их взаимодействием через чтение и запись состояния атрибутов.\n\n3. **Подтверждённые зависимости или взаимодействия**:\n - В конструкторе класса явно видны зависимости от следующих классов и объектов:\n - `ConfigurationManager`\n - `ServiceContainer`\n - `TraceService`\n - `HealthRegistry`\n - `LogManager`\n - `WorkerSupervisor`\n - `ControlPlaneService`\n - Эти зависимости передаются конструктору при создании экземпляра класса и могут быть использованы внутри методов класса.\n\n4. **Что делает по шагам, если это видно в контексте**:\n - Конструктор инициализирует экземпляр класса, присваивая значения параметров по умолчанию, если они не переданы явно.\n - Внутри конструктора вызывается метод `_register_core_services()`, вероятно, регистрирующий основные сервисы или модули.\n - Метод `register_module(module: ApplicationModule)` предназначен для регистрации модуля, хотя его реализация неполная и обрезана в предоставленном фрагменте.\n\n5. **Осторожные выводы**:\n - Несмотря на наличие явных зависимостей и общего назначения класса, невозможно точно понять весь функционал из предоставленного контекста. Не видна основная логика, выполняемая после начальной настройки.\n - Также отсутствует информация о том, какие методы используются чаще всего и как именно они влияют на состояние приложения.\n\n6. **Чего не хватает для полного объяснения**:\n - Полностью отсутствуют детали реализации методов, которые могли бы показать полный функционал класса (`_register_core_services()` и другие).\n - Отсутствует понимание того, как `RuntimeManager` участвует в общем потоке данных или управлении жизненным циклом приложения.\n - Нет информации о взаимодействии с внешними компонентами, такими как HTTP приложение или микросервисы, упомянутые в `ControlPlaneService`.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "RuntimeManager" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] -} - -## Mismatches -- none \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_132357/full_chain_plba_code_subintents_v2_plba-v2-explain-trace-service.json b/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_132357/full_chain_plba_code_subintents_v2_plba-v2-explain-trace-service.json deleted file mode 100644 index 8242611..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_132357/full_chain_plba_code_subintents_v2_plba-v2-explain-trace-service.json +++ /dev/null @@ -1,2208 +0,0 @@ -{ - "case_id": "plba-v2-explain-trace-service", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_subintents_v2.yaml", - "runner": "runtime", - "mode": "full_chain", - "actual": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 14, - "llm_answer": "1. **Что это и где определено.** \nСущность `TraceService` определена в файле `src/app_runtime/tracing/service.py`. Это класс, наследующий от `TraceContextFactory`.\n\n2. **Назначение по наблюдаемому коду.** \nКласс предназначен для управления контекстами трассировки и записи событий трассировки. Он участвует в обработке данных потока (slice 13), имеет роль «pipeline stage» и отвечает за создание и запись контекста трассировки (`create_context`, `open_context`), а также взаимодействие с транспортировкой контекста через `TraceRecordWriter`.\n\n3. **Подтверждённые зависимости или взаимодействия.** \n`TraceService` зависит от класса `TraceContextStore` и объекта транспорта трассировки (`TraceTransport`). Метод `create_context` использует метод записи контекста `_writer.write_context` для отправки данных в транспортировку. Транспортировка может быть либо реальной реализацией, либо заглушкой (`NoOpTraceTransport()`).\n\n4. **Что делает по шагам, если это видно в контексте.** \n- Конструктор класса инициализирует объект транспорта трассировки и хранилище контекста (если переданы аргументы, иначе создаёт заглушки).\n- Метод `create_context` генерирует уникальный идентификатор трассировки, записывает контекст в хранилище и отправляет его в транспортировку.\n- Метод `open_context` является менеджером контекста, создающим временный контекст трассировки внутри блока с использованием `create_context`.\n\n5. **Осторожные выводы.** \nНа данный момент недостаточно информации о внутреннем устройстве транспорта трассировки и логике хранения контекста. Также нет явных упоминаний о взаимодействии с внешними сервисами или компонентами приложения, кроме явно указанных зависимостей.\n\n6. **Чего не хватает для полного объяснения.** \n- Деталей реализации транспорта трассировки (`TraceTransport`) и хранилища контекста (`TraceContextStore`).\n- Подробности взаимодействия с остальной частью системы (контексты, события, API внешнего уровня).", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "TraceService" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "passed": true, - "mismatches": [], - "details": { - "case_id": "plba-v2-explain-trace-service", - "text": "Объясни как работает класс TraceService", - "mode": "full_chain", - "run_started_at": "2026-03-12T13:23:57", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Объясни как работает класс TraceService", - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "TraceService", - "alternatives": [ - "TraceService" - ], - "confidence": 0.99 - }, - "rag_count": 14, - "rag_rows": [ - { - "path": "src/app_runtime/tracing/service.py", - "content": "class TraceService\nTraceService(TraceContextFactory)", - "layer": "C1_SYMBOL_CATALOG", - "title": "TraceService", - "span_start": 39, - "span_end": 166, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "c2b2b976d99f2c600000b753731b26e0a69adcb4359398b93073590c5d5d04f4", - "qname": "TraceService", - "kind": "class", - "signature": "TraceService(TraceContextFactory)", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.tracing.service", - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "TraceService\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests service\n- reads and writes state attributes\n- participates in dataflow slices (13)", - "layer": "C4_SEMANTIC_ROLES", - "title": "TraceService", - "span_start": 39, - "span_end": 166, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 60, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "c2b2b976d99f2c600000b753731b26e0a69adcb4359398b93073590c5d5d04f4", - "symbol_name": "TraceService", - "qname": "TraceService", - "role": "pipeline_stage", - "confidence": 0.57, - "dataflow_participation": 13, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "TraceService.__init__\n -> TraceService.store\n -> TraceService.create_context", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "TraceService.__init__:dataflow_slice", - "span_start": 42, - "span_end": 61, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "3b052062067a78aef3302ee1d996897e02a67d1b340397bea4f59fe147c0492a", - "edge_type": "dataflow_slice", - "src_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "src_qname": "TraceService.__init__", - "dst_symbol_id": "ff44881104b65ef50ee6fe16d367d4a81b6e7eb5c44c0963cf4543faec785d4a", - "dst_ref": "TraceService.create_context", - "resolution": "resolved", - "slice_id": "3b052062067a78aef3302ee1d996897e02a67d1b340397bea4f59fe147c0492a", - "root_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "path_symbols": [ - "TraceService.__init__", - "TraceService.store", - "TraceService.create_context" - ], - "path_symbol_ids": [ - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "ff44881104b65ef50ee6fe16d367d4a81b6e7eb5c44c0963cf4543faec785d4a" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "TraceService.__init__\n -> TraceService.store\n -> TraceService.close_context", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "TraceService.__init__:dataflow_slice", - "span_start": 42, - "span_end": 84, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "7a9353ef57c9ae5d19b3a0c6ac50fad05e6d21d31bbe1cd1cd07af6332ba6505", - "edge_type": "dataflow_slice", - "src_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "src_qname": "TraceService.__init__", - "dst_symbol_id": "01e14158dcced7e52d0c8ac84ac7b9a75225c261b6aca6a1d7da802d0994721c", - "dst_ref": "TraceService.close_context", - "resolution": "resolved", - "slice_id": "7a9353ef57c9ae5d19b3a0c6ac50fad05e6d21d31bbe1cd1cd07af6332ba6505", - "root_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "path_symbols": [ - "TraceService.__init__", - "TraceService.store", - "TraceService.close_context" - ], - "path_symbol_ids": [ - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "01e14158dcced7e52d0c8ac84ac7b9a75225c261b6aca6a1d7da802d0994721c" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "TraceService.__init__\n -> TraceService.store\n -> TraceService.open_context", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "TraceService.__init__:dataflow_slice", - "span_start": 42, - "span_end": 78, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "a6e13b9ebc4fed84586afd53ed92a4d14757e440873f572b2337d5622ee96031", - "edge_type": "dataflow_slice", - "src_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "src_qname": "TraceService.__init__", - "dst_symbol_id": "2da3d5b20a947bf63e14c103be4689b72fd837e0a82abd6c497846375d4c7426", - "dst_ref": "TraceService.open_context", - "resolution": "resolved", - "slice_id": "a6e13b9ebc4fed84586afd53ed92a4d14757e440873f572b2337d5622ee96031", - "root_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "path_symbols": [ - "TraceService.__init__", - "TraceService.store", - "TraceService.open_context" - ], - "path_symbol_ids": [ - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "2da3d5b20a947bf63e14c103be4689b72fd837e0a82abd6c497846375d4c7426" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "TraceService.__init__\n -> TraceService.transport\n -> TraceService.__init__", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "TraceService.__init__:dataflow_slice", - "span_start": 41, - "span_end": 43, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "1e923a93faa05c3c43ca9b19bd047007a8589ccce57d3cc1798ae7f9f200af98", - "edge_type": "dataflow_slice", - "src_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "src_qname": "TraceService.__init__", - "dst_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "dst_ref": "TraceService.__init__", - "resolution": "resolved", - "slice_id": "1e923a93faa05c3c43ca9b19bd047007a8589ccce57d3cc1798ae7f9f200af98", - "root_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "path_symbols": [ - "TraceService.__init__", - "TraceService.transport", - "TraceService.__init__" - ], - "path_symbol_ids": [ - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "TraceService.__init__\n -> TraceService.store\n -> TraceService.current_trace_id", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "TraceService.__init__:dataflow_slice", - "span_start": 42, - "span_end": 81, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "3ea17138634b1190bded77ddb84aa1595124f6519b246f24fc4b02bd62b5cac1", - "edge_type": "dataflow_slice", - "src_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "src_qname": "TraceService.__init__", - "dst_symbol_id": "41135180f7b3b9ab20e097e0747474e219c37dd2366ef08a7b43c1f3edb10b4c", - "dst_ref": "TraceService.current_trace_id", - "resolution": "resolved", - "slice_id": "3ea17138634b1190bded77ddb84aa1595124f6519b246f24fc4b02bd62b5cac1", - "root_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "path_symbols": [ - "TraceService.__init__", - "TraceService.store", - "TraceService.current_trace_id" - ], - "path_symbol_ids": [ - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "41135180f7b3b9ab20e097e0747474e219c37dd2366ef08a7b43c1f3edb10b4c" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "TraceService.__init__\n -> TraceService.store\n -> TraceService.step", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "TraceService.__init__:dataflow_slice", - "span_start": 42, - "span_end": 88, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "9f34c5da9b09fba99df6f6b1bde183a9aeb45111b8218a747c71590c2c9f60f2", - "edge_type": "dataflow_slice", - "src_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "src_qname": "TraceService.__init__", - "dst_symbol_id": "c44bfbc66cf747283f30088da3e011a10395031d41e77b74e523c24997f641ca", - "dst_ref": "TraceService.step", - "resolution": "resolved", - "slice_id": "9f34c5da9b09fba99df6f6b1bde183a9aeb45111b8218a747c71590c2c9f60f2", - "root_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "path_symbols": [ - "TraceService.__init__", - "TraceService.store", - "TraceService.step" - ], - "path_symbol_ids": [ - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "c44bfbc66cf747283f30088da3e011a10395031d41e77b74e523c24997f641ca" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "class TraceRecordWriter:\n def __init__(self, transport: TraceTransport) -> None:\n self._logger = logging.getLogger(__name__)\n self._transport = transport\n\n def write_context(self, record: TraceContextRecord) -> None:\n try:\n self._transport.write_context(record)\n except Exception:\n self._logger.exception(\"Trace transport failed to write context %s\", record.trace_id)\n\n def write_message(self, record: TraceLogMessage) -> None:\n try:\n self._transport.write_message(record)\n except Exception:\n self._logger.exception(\"Trace transport failed to write message for %s\", record.trace_id)", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/tracing/service.py:TraceRecordWriter", - "span_start": 21, - "span_end": 36, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.tracing.service", - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "class TraceService(TraceContextFactory):\n def __init__(self, transport: TraceTransport | None = None, store: TraceContextStore | None = None) -> None:\n self.transport = transport or NoOpTraceTransport()\n self.store = store or TraceContextStore()\n self._writer = TraceRecordWriter(self.transport)\n\n def create_context(\n self,\n *,\n alias: str,\n parent_id: str | None = None,\n kind: str | None = None,\n attrs: dict[str, Any] | None = None,\n ) -> str:\n record = TraceContextRecord(\n trace_id=uuid4().hex,\n alias=str(alias or \"\"),\n parent_id=parent_id,\n type=kind,\n event_time=utc_now(),\n attrs=dict(attrs or {}),\n )\n self.store.push(record)\n self._writer.write_context(record)\n return record.trace_id\n\n @contextmanager\n def open_context(\n self,\n *,\n alias: str,\n parent_id: str | None = None,\n kind: str | None = None,\n attrs: dict[str, Any] | None = None,\n ) -> Iterator[str]:\n trace_id = self.create_context(alias=alias, parent_id=parent_id, kind=kind, attrs=attrs)\n try:\n yield trace_id\n finally:\n self.store.pop()\n\n def current_trace_id(self) -> str | None:\n return self.store.current_trace_id()\n\n def close_context(self) -> str | None:\n previous = self.store.pop()\n return previous.record.trace_id if previous else None\n\n def step(self, name: str) -> None:\n self.store.set_step(str(name or \"\"))\n\n def info(self, message: str, *, status: str | None = None, attrs: dict[str, Any] | None = None) -> None:\n self._write_message(\"INFO\", message, status, attrs)\n\n def debug(self, message: str, *, status: str | None = None, attrs: dict[str, Any] | None = None) -> None:\n self._write_message(\"DEBUG\", message, status, attrs)\n\n def warning(self, message: str, *, status: str | None = None, attrs: dict[str, Any] | None = None) -> None:\n self._write_message(\"WARNING\", message, status, attrs)\n\n def error(self, message: str, *, status: str | None = None, attrs: dict[str, Any] | None = None) -> None:\n self._write_message(\"ERROR\", message, status, attrs)\n\n def exception(self, message: str, *, status: str = \"failed\", attrs: dict[str, Any] | None = None) -> None:\n self._write_message(\"ERROR\", message, status, attrs)\n\n def new_root(self, operation: str) -> TraceContext:\n trace_id = self.create_context(alias=operation, kind=\"operation\", attrs={\"operation\": operation})\n return TraceContext(trace_id=trace_id, span_id=trace_id, attributes={\"operation\": operation})\n\n def child_of(self, parent: TraceContext, operation: str) -> TraceContext:\n trace_id = self.create_context(\n alias=operation,\n parent_id=parent.trace_id,\n kind=\"worker\",\n attrs={\"operation\": operation},\n )\n return TraceContext(\n trace_id=trace_id,\n span_id=trace_id,\n parent_span_id=parent.span_id,\n attributes={\"operation\": operation},\n )\n\n def attach(self, metadata: dict[str, object], context: TraceContext) -> dict[str, object]:\n updated = dict(metadata)\n updated[\"trace_id\"] = context.trace_id\n updated[\"span_id\"] = context.span_id\n updated[\"parent_span_id\"] = context.parent_span_id\n return updated\n\n def resume(self, metadata: dict[str, object], operation: str) -> TraceContext:\n trace_id = str(metadata.get(\"trace_id\") or uuid4().hex)\n span_id = str(metadata.get(\"span_id\") or trace_id)\n parent_id = metadata.get(\"parent_span_id\")\n self.create_context(\n alias=operation,\n parent_id=str(parent_id) if parent_id else None,\n kind=\"worker\",\n attrs=dict(metadata),\n )\n return TraceContext(\n trace_id=trace_id,\n span_id=span_id,\n parent_span_id=str(parent_id) if parent_id else None,\n attributes={\"operation\": operation},\n )\n\n def _write_message(\n self,\n level: TraceLevel,\n message: str,\n status: str | None,\n attrs: dict[str, Any] | None,\n ) -> None:\n active = self.store.current()\n if active is None:\n raise RuntimeError(\"Trace context is not bound. Call create_context() first.\")\n record = TraceLogMessage(\n trace_id=active.record.trace_id,\n step=active.step,\n status=str(status or \"\"),\n message=str(message or \"\"),\n level=level,\n event_time=utc_now(),\n attrs=dict(attrs or {}),\n )\n self._writer.write_message(record)", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/tracing/service.py:TraceService", - "span_start": 39, - "span_end": 166, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 1, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.tracing.service", - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "class TraceManager(TraceService):\n \"\"\"Compatibility alias during the transition from ConfigManager-shaped naming.\"\"\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/tracing/service.py:TraceManager", - "span_start": 169, - "span_end": 170, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 2, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.tracing.service", - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "llm_answer": "1. **Что это и где определено.** \nСущность `TraceService` определена в файле `src/app_runtime/tracing/service.py`. Это класс, наследующий от `TraceContextFactory`.\n\n2. **Назначение по наблюдаемому коду.** \nКласс предназначен для управления контекстами трассировки и записи событий трассировки. Он участвует в обработке данных потока (slice 13), имеет роль «pipeline stage» и отвечает за создание и запись контекста трассировки (`create_context`, `open_context`), а также взаимодействие с транспортировкой контекста через `TraceRecordWriter`.\n\n3. **Подтверждённые зависимости или взаимодействия.** \n`TraceService` зависит от класса `TraceContextStore` и объекта транспорта трассировки (`TraceTransport`). Метод `create_context` использует метод записи контекста `_writer.write_context` для отправки данных в транспортировку. Транспортировка может быть либо реальной реализацией, либо заглушкой (`NoOpTraceTransport()`).\n\n4. **Что делает по шагам, если это видно в контексте.** \n- Конструктор класса инициализирует объект транспорта трассировки и хранилище контекста (если переданы аргументы, иначе создаёт заглушки).\n- Метод `create_context` генерирует уникальный идентификатор трассировки, записывает контекст в хранилище и отправляет его в транспортировку.\n- Метод `open_context` является менеджером контекста, создающим временный контекст трассировки внутри блока с использованием `create_context`.\n\n5. **Осторожные выводы.** \nНа данный момент недостаточно информации о внутреннем устройстве транспорта трассировки и логике хранения контекста. Также нет явных упоминаний о взаимодействии с внешними сервисами или компонентами приложения, кроме явно указанных зависимостей.\n\n6. **Чего не хватает для полного объяснения.** \n- Деталей реализации транспорта трассировки (`TraceTransport`) и хранилища контекста (`TraceContextStore`).\n- Подробности взаимодействия с остальной частью системы (контексты, события, API внешнего уровня).", - "summary": { - "router": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "confidence": null - }, - "retrieval": { - "profile": "code", - "layers_hit": [ - "C0_SOURCE_CHUNKS", - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS", - "C4_SEMANTIC_ROLES" - ], - "evidence_sufficient": true - }, - "llm": { - "answer_status": "answered", - "groundedness": "grounded" - } - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "TraceService" - ], - "keyword_hints": [ - "TraceService" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C0_SOURCE_CHUNKS": "exact_path_fetch", - "C4_SEMANTIC_ROLES": "exact_path_fetch", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C3_ENTRYPOINTS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 8, - "C4_SEMANTIC_ROLES": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C3_ENTRYPOINTS": 6 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C4_SEMANTIC_ROLES": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "TraceService", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "TraceService", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C4_SEMANTIC_ROLES", - "query": "TraceService", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "TraceService", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - }, - { - "layer": "C3_ENTRYPOINTS", - "query": "TraceService", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 1, - "candidates_after_filter": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 6, - "candidates_after_filter": 6 - }, - { - "layer": "C3_ENTRYPOINTS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 3, - "candidates_after_filter": 3 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "TraceService", - "alternatives": [ - "TraceService" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 3, - "fail_reason": null - }, - { - "layer": "C4_SEMANTIC_ROLES", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 6, - "fail_reason": null - }, - { - "layer": "C3_ENTRYPOINTS", - "status": "hit", - "hit_count": 3, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "router": 0, - "symbol_resolution": 0, - "retrieval_total": 110, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 32, - "C0_SOURCE_CHUNKS": 11, - "C4_SEMANTIC_ROLES": 12, - "C2_DEPENDENCY_GRAPH": 44, - "C3_ENTRYPOINTS": 9 - }, - "merge_rank": 18, - "prompt_build": 0, - "llm_call": 3201 - }, - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 991, - "evidence_rows": 14, - "evidence_chars": 6323 - }, - "evidence_summary": [ - { - "layer": "C1_SYMBOL_CATALOG", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "count": 6, - "unique_paths": 1 - }, - { - "layer": "C3_ENTRYPOINTS", - "count": 3, - "unique_paths": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 3, - "unique_paths": 1 - } - ], - "prompt_template_id": "intent_code_qa_explain_ru_v2", - "system_prompt_version": "v1" - }, - "router": { - "conversation_mode": "START", - "keyword_hints": [ - "TraceService" - ], - "path_scope": [] - }, - "llm": { - "used_evidence_count": 14, - "missing_evidence_reason": null - } - }, - "run_info": { - "case_id": "plba-v2-explain-trace-service", - "mode": "full_chain", - "run_started_at": "2026-03-12T13:23:57", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - }, - "input_request": { - "text": "Объясни как работает класс TraceService", - "normalized_query": "Объясни как работает класс TraceService" - }, - "steps": [ - { - "step": "intent_router", - "input": { - "query": "Объясни как работает класс TraceService" - }, - "output": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Объясни как работает класс TraceService" - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "TraceService" - ], - "keyword_hints": [ - "TraceService" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "timings_ms": { - "router": 0 - } - } - }, - { - "step": "retrieval", - "input": { - "query": "Объясни как работает класс TraceService" - }, - "output": { - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "TraceService", - "alternatives": [ - "TraceService" - ], - "confidence": 0.99 - }, - "rag_count": 14, - "rag_rows": [ - { - "path": "src/app_runtime/tracing/service.py", - "content": "class TraceService\nTraceService(TraceContextFactory)", - "layer": "C1_SYMBOL_CATALOG", - "title": "TraceService", - "span_start": 39, - "span_end": 166, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "c2b2b976d99f2c600000b753731b26e0a69adcb4359398b93073590c5d5d04f4", - "qname": "TraceService", - "kind": "class", - "signature": "TraceService(TraceContextFactory)", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.tracing.service", - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "TraceService\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests service\n- reads and writes state attributes\n- participates in dataflow slices (13)", - "layer": "C4_SEMANTIC_ROLES", - "title": "TraceService", - "span_start": 39, - "span_end": 166, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 60, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "c2b2b976d99f2c600000b753731b26e0a69adcb4359398b93073590c5d5d04f4", - "symbol_name": "TraceService", - "qname": "TraceService", - "role": "pipeline_stage", - "confidence": 0.57, - "dataflow_participation": 13, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "TraceService.__init__\n -> TraceService.store\n -> TraceService.create_context", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "TraceService.__init__:dataflow_slice", - "span_start": 42, - "span_end": 61, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "3b052062067a78aef3302ee1d996897e02a67d1b340397bea4f59fe147c0492a", - "edge_type": "dataflow_slice", - "src_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "src_qname": "TraceService.__init__", - "dst_symbol_id": "ff44881104b65ef50ee6fe16d367d4a81b6e7eb5c44c0963cf4543faec785d4a", - "dst_ref": "TraceService.create_context", - "resolution": "resolved", - "slice_id": "3b052062067a78aef3302ee1d996897e02a67d1b340397bea4f59fe147c0492a", - "root_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "path_symbols": [ - "TraceService.__init__", - "TraceService.store", - "TraceService.create_context" - ], - "path_symbol_ids": [ - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "ff44881104b65ef50ee6fe16d367d4a81b6e7eb5c44c0963cf4543faec785d4a" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "TraceService.__init__\n -> TraceService.store\n -> TraceService.close_context", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "TraceService.__init__:dataflow_slice", - "span_start": 42, - "span_end": 84, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "7a9353ef57c9ae5d19b3a0c6ac50fad05e6d21d31bbe1cd1cd07af6332ba6505", - "edge_type": "dataflow_slice", - "src_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "src_qname": "TraceService.__init__", - "dst_symbol_id": "01e14158dcced7e52d0c8ac84ac7b9a75225c261b6aca6a1d7da802d0994721c", - "dst_ref": "TraceService.close_context", - "resolution": "resolved", - "slice_id": "7a9353ef57c9ae5d19b3a0c6ac50fad05e6d21d31bbe1cd1cd07af6332ba6505", - "root_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "path_symbols": [ - "TraceService.__init__", - "TraceService.store", - "TraceService.close_context" - ], - "path_symbol_ids": [ - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "01e14158dcced7e52d0c8ac84ac7b9a75225c261b6aca6a1d7da802d0994721c" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "TraceService.__init__\n -> TraceService.store\n -> TraceService.open_context", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "TraceService.__init__:dataflow_slice", - "span_start": 42, - "span_end": 78, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "a6e13b9ebc4fed84586afd53ed92a4d14757e440873f572b2337d5622ee96031", - "edge_type": "dataflow_slice", - "src_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "src_qname": "TraceService.__init__", - "dst_symbol_id": "2da3d5b20a947bf63e14c103be4689b72fd837e0a82abd6c497846375d4c7426", - "dst_ref": "TraceService.open_context", - "resolution": "resolved", - "slice_id": "a6e13b9ebc4fed84586afd53ed92a4d14757e440873f572b2337d5622ee96031", - "root_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "path_symbols": [ - "TraceService.__init__", - "TraceService.store", - "TraceService.open_context" - ], - "path_symbol_ids": [ - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "2da3d5b20a947bf63e14c103be4689b72fd837e0a82abd6c497846375d4c7426" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "TraceService.__init__\n -> TraceService.transport\n -> TraceService.__init__", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "TraceService.__init__:dataflow_slice", - "span_start": 41, - "span_end": 43, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "1e923a93faa05c3c43ca9b19bd047007a8589ccce57d3cc1798ae7f9f200af98", - "edge_type": "dataflow_slice", - "src_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "src_qname": "TraceService.__init__", - "dst_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "dst_ref": "TraceService.__init__", - "resolution": "resolved", - "slice_id": "1e923a93faa05c3c43ca9b19bd047007a8589ccce57d3cc1798ae7f9f200af98", - "root_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "path_symbols": [ - "TraceService.__init__", - "TraceService.transport", - "TraceService.__init__" - ], - "path_symbol_ids": [ - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "TraceService.__init__\n -> TraceService.store\n -> TraceService.current_trace_id", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "TraceService.__init__:dataflow_slice", - "span_start": 42, - "span_end": 81, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "3ea17138634b1190bded77ddb84aa1595124f6519b246f24fc4b02bd62b5cac1", - "edge_type": "dataflow_slice", - "src_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "src_qname": "TraceService.__init__", - "dst_symbol_id": "41135180f7b3b9ab20e097e0747474e219c37dd2366ef08a7b43c1f3edb10b4c", - "dst_ref": "TraceService.current_trace_id", - "resolution": "resolved", - "slice_id": "3ea17138634b1190bded77ddb84aa1595124f6519b246f24fc4b02bd62b5cac1", - "root_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "path_symbols": [ - "TraceService.__init__", - "TraceService.store", - "TraceService.current_trace_id" - ], - "path_symbol_ids": [ - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "41135180f7b3b9ab20e097e0747474e219c37dd2366ef08a7b43c1f3edb10b4c" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "TraceService.__init__\n -> TraceService.store\n -> TraceService.step", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "TraceService.__init__:dataflow_slice", - "span_start": 42, - "span_end": 88, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "9f34c5da9b09fba99df6f6b1bde183a9aeb45111b8218a747c71590c2c9f60f2", - "edge_type": "dataflow_slice", - "src_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "src_qname": "TraceService.__init__", - "dst_symbol_id": "c44bfbc66cf747283f30088da3e011a10395031d41e77b74e523c24997f641ca", - "dst_ref": "TraceService.step", - "resolution": "resolved", - "slice_id": "9f34c5da9b09fba99df6f6b1bde183a9aeb45111b8218a747c71590c2c9f60f2", - "root_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "path_symbols": [ - "TraceService.__init__", - "TraceService.store", - "TraceService.step" - ], - "path_symbol_ids": [ - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "c44bfbc66cf747283f30088da3e011a10395031d41e77b74e523c24997f641ca" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "class TraceRecordWriter:\n def __init__(self, transport: TraceTransport) -> None:\n self._logger = logging.getLogger(__name__)\n self._transport = transport\n\n def write_context(self, record: TraceContextRecord) -> None:\n try:\n self._transport.write_context(record)\n except Exception:\n self._logger.exception(\"Trace transport failed to write context %s\", record.trace_id)\n\n def write_message(self, record: TraceLogMessage) -> None:\n try:\n self._transport.write_message(record)\n except Exception:\n self._logger.exception(\"Trace transport failed to write message for %s\", record.trace_id)", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/tracing/service.py:TraceRecordWriter", - "span_start": 21, - "span_end": 36, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.tracing.service", - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "class TraceService(TraceContextFactory):\n def __init__(self, transport: TraceTransport | None = None, store: TraceContextStore | None = None) -> None:\n self.transport = transport or NoOpTraceTransport()\n self.store = store or TraceContextStore()\n self._writer = TraceRecordWriter(self.transport)\n\n def create_context(\n self,\n *,\n alias: str,\n parent_id: str | None = None,\n kind: str | None = None,\n attrs: dict[str, Any] | None = None,\n ) -> str:\n record = TraceContextRecord(\n trace_id=uuid4().hex,\n alias=str(alias or \"\"),\n parent_id=parent_id,\n type=kind,\n event_time=utc_now(),\n attrs=dict(attrs or {}),\n )\n self.store.push(record)\n self._writer.write_context(record)\n return record.trace_id\n\n @contextmanager\n def open_context(\n self,\n *,\n alias: str,\n parent_id: str | None = None,\n kind: str | None = None,\n attrs: dict[str, Any] | None = None,\n ) -> Iterator[str]:\n trace_id = self.create_context(alias=alias, parent_id=parent_id, kind=kind, attrs=attrs)\n try:\n yield trace_id\n finally:\n self.store.pop()\n\n def current_trace_id(self) -> str | None:\n return self.store.current_trace_id()\n\n def close_context(self) -> str | None:\n previous = self.store.pop()\n return previous.record.trace_id if previous else None\n\n def step(self, name: str) -> None:\n self.store.set_step(str(name or \"\"))\n\n def info(self, message: str, *, status: str | None = None, attrs: dict[str, Any] | None = None) -> None:\n self._write_message(\"INFO\", message, status, attrs)\n\n def debug(self, message: str, *, status: str | None = None, attrs: dict[str, Any] | None = None) -> None:\n self._write_message(\"DEBUG\", message, status, attrs)\n\n def warning(self, message: str, *, status: str | None = None, attrs: dict[str, Any] | None = None) -> None:\n self._write_message(\"WARNING\", message, status, attrs)\n\n def error(self, message: str, *, status: str | None = None, attrs: dict[str, Any] | None = None) -> None:\n self._write_message(\"ERROR\", message, status, attrs)\n\n def exception(self, message: str, *, status: str = \"failed\", attrs: dict[str, Any] | None = None) -> None:\n self._write_message(\"ERROR\", message, status, attrs)\n\n def new_root(self, operation: str) -> TraceContext:\n trace_id = self.create_context(alias=operation, kind=\"operation\", attrs={\"operation\": operation})\n return TraceContext(trace_id=trace_id, span_id=trace_id, attributes={\"operation\": operation})\n\n def child_of(self, parent: TraceContext, operation: str) -> TraceContext:\n trace_id = self.create_context(\n alias=operation,\n parent_id=parent.trace_id,\n kind=\"worker\",\n attrs={\"operation\": operation},\n )\n return TraceContext(\n trace_id=trace_id,\n span_id=trace_id,\n parent_span_id=parent.span_id,\n attributes={\"operation\": operation},\n )\n\n def attach(self, metadata: dict[str, object], context: TraceContext) -> dict[str, object]:\n updated = dict(metadata)\n updated[\"trace_id\"] = context.trace_id\n updated[\"span_id\"] = context.span_id\n updated[\"parent_span_id\"] = context.parent_span_id\n return updated\n\n def resume(self, metadata: dict[str, object], operation: str) -> TraceContext:\n trace_id = str(metadata.get(\"trace_id\") or uuid4().hex)\n span_id = str(metadata.get(\"span_id\") or trace_id)\n parent_id = metadata.get(\"parent_span_id\")\n self.create_context(\n alias=operation,\n parent_id=str(parent_id) if parent_id else None,\n kind=\"worker\",\n attrs=dict(metadata),\n )\n return TraceContext(\n trace_id=trace_id,\n span_id=span_id,\n parent_span_id=str(parent_id) if parent_id else None,\n attributes={\"operation\": operation},\n )\n\n def _write_message(\n self,\n level: TraceLevel,\n message: str,\n status: str | None,\n attrs: dict[str, Any] | None,\n ) -> None:\n active = self.store.current()\n if active is None:\n raise RuntimeError(\"Trace context is not bound. Call create_context() first.\")\n record = TraceLogMessage(\n trace_id=active.record.trace_id,\n step=active.step,\n status=str(status or \"\"),\n message=str(message or \"\"),\n level=level,\n event_time=utc_now(),\n attrs=dict(attrs or {}),\n )\n self._writer.write_message(record)", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/tracing/service.py:TraceService", - "span_start": 39, - "span_end": 166, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 1, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.tracing.service", - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "class TraceManager(TraceService):\n \"\"\"Compatibility alias during the transition from ConfigManager-shaped naming.\"\"\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/tracing/service.py:TraceManager", - "span_start": 169, - "span_end": 170, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 2, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.tracing.service", - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ] - }, - "diagnostics": { - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C0_SOURCE_CHUNKS": "exact_path_fetch", - "C4_SEMANTIC_ROLES": "exact_path_fetch", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C3_ENTRYPOINTS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 8, - "C4_SEMANTIC_ROLES": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C3_ENTRYPOINTS": 6 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C4_SEMANTIC_ROLES": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "TraceService", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "TraceService", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C4_SEMANTIC_ROLES", - "query": "TraceService", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "TraceService", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - }, - { - "layer": "C3_ENTRYPOINTS", - "query": "TraceService", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 1, - "candidates_after_filter": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 6, - "candidates_after_filter": 6 - }, - { - "layer": "C3_ENTRYPOINTS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 3, - "candidates_after_filter": 3 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "TraceService", - "alternatives": [ - "TraceService" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 3, - "fail_reason": null - }, - { - "layer": "C4_SEMANTIC_ROLES", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 6, - "fail_reason": null - }, - { - "layer": "C3_ENTRYPOINTS", - "status": "hit", - "hit_count": 3, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "symbol_resolution": 0, - "retrieval_total": 110, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 32, - "C0_SOURCE_CHUNKS": 11, - "C4_SEMANTIC_ROLES": 12, - "C2_DEPENDENCY_GRAPH": 44, - "C3_ENTRYPOINTS": 9 - }, - "merge_rank": 18 - } - } - }, - { - "step": "llm_answer", - "input": { - "query": "Объясни как работает класс TraceService", - "rag_count": 14 - }, - "output": { - "llm_answer": "1. **Что это и где определено.** \nСущность `TraceService` определена в файле `src/app_runtime/tracing/service.py`. Это класс, наследующий от `TraceContextFactory`.\n\n2. **Назначение по наблюдаемому коду.** \nКласс предназначен для управления контекстами трассировки и записи событий трассировки. Он участвует в обработке данных потока (slice 13), имеет роль «pipeline stage» и отвечает за создание и запись контекста трассировки (`create_context`, `open_context`), а также взаимодействие с транспортировкой контекста через `TraceRecordWriter`.\n\n3. **Подтверждённые зависимости или взаимодействия.** \n`TraceService` зависит от класса `TraceContextStore` и объекта транспорта трассировки (`TraceTransport`). Метод `create_context` использует метод записи контекста `_writer.write_context` для отправки данных в транспортировку. Транспортировка может быть либо реальной реализацией, либо заглушкой (`NoOpTraceTransport()`).\n\n4. **Что делает по шагам, если это видно в контексте.** \n- Конструктор класса инициализирует объект транспорта трассировки и хранилище контекста (если переданы аргументы, иначе создаёт заглушки).\n- Метод `create_context` генерирует уникальный идентификатор трассировки, записывает контекст в хранилище и отправляет его в транспортировку.\n- Метод `open_context` является менеджером контекста, создающим временный контекст трассировки внутри блока с использованием `create_context`.\n\n5. **Осторожные выводы.** \nНа данный момент недостаточно информации о внутреннем устройстве транспорта трассировки и логике хранения контекста. Также нет явных упоминаний о взаимодействии с внешними сервисами или компонентами приложения, кроме явно указанных зависимостей.\n\n6. **Чего не хватает для полного объяснения.** \n- Деталей реализации транспорта трассировки (`TraceTransport`) и хранилища контекста (`TraceContextStore`).\n- Подробности взаимодействия с остальной частью системы (контексты, события, API внешнего уровня)." - }, - "diagnostics": { - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 991, - "evidence_rows": 14, - "evidence_chars": 6323 - }, - "evidence_summary": [ - { - "layer": "C1_SYMBOL_CATALOG", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "count": 6, - "unique_paths": 1 - }, - { - "layer": "C3_ENTRYPOINTS", - "count": 3, - "unique_paths": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 3, - "unique_paths": 1 - } - ], - "prompt_template_id": "intent_code_qa_explain_ru_v2", - "system_prompt_version": "v1" - }, - "timings_ms": { - "prompt_build": 0, - "llm_call": 3201 - } - } - } - ] - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_132357/full_chain_plba_code_subintents_v2_plba-v2-explain-trace-service.md b/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_132357/full_chain_plba_code_subintents_v2_plba-v2-explain-trace-service.md deleted file mode 100644 index 64ccf81..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_132357/full_chain_plba_code_subintents_v2_plba-v2-explain-trace-service.md +++ /dev/null @@ -1,34 +0,0 @@ -# plba-v2-explain-trace-service - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_subintents_v2.yaml -- runner: runtime -- mode: full_chain -- passed: True - -## Query -Объясни как работает класс TraceService - -## Actual -{ - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 14, - "llm_answer": "1. **Что это и где определено.** \nСущность `TraceService` определена в файле `src/app_runtime/tracing/service.py`. Это класс, наследующий от `TraceContextFactory`.\n\n2. **Назначение по наблюдаемому коду.** \nКласс предназначен для управления контекстами трассировки и записи событий трассировки. Он участвует в обработке данных потока (slice 13), имеет роль «pipeline stage» и отвечает за создание и запись контекста трассировки (`create_context`, `open_context`), а также взаимодействие с транспортировкой контекста через `TraceRecordWriter`.\n\n3. **Подтверждённые зависимости или взаимодействия.** \n`TraceService` зависит от класса `TraceContextStore` и объекта транспорта трассировки (`TraceTransport`). Метод `create_context` использует метод записи контекста `_writer.write_context` для отправки данных в транспортировку. Транспортировка может быть либо реальной реализацией, либо заглушкой (`NoOpTraceTransport()`).\n\n4. **Что делает по шагам, если это видно в контексте.** \n- Конструктор класса инициализирует объект транспорта трассировки и хранилище контекста (если переданы аргументы, иначе создаёт заглушки).\n- Метод `create_context` генерирует уникальный идентификатор трассировки, записывает контекст в хранилище и отправляет его в транспортировку.\n- Метод `open_context` является менеджером контекста, создающим временный контекст трассировки внутри блока с использованием `create_context`.\n\n5. **Осторожные выводы.** \nНа данный момент недостаточно информации о внутреннем устройстве транспорта трассировки и логике хранения контекста. Также нет явных упоминаний о взаимодействии с внешними сервисами или компонентами приложения, кроме явно указанных зависимостей.\n\n6. **Чего не хватает для полного объяснения.** \n- Деталей реализации транспорта трассировки (`TraceTransport`) и хранилища контекста (`TraceContextStore`).\n- Подробности взаимодействия с остальной частью системы (контексты, события, API внешнего уровня).", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "TraceService" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] -} - -## Mismatches -- none \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_132357/full_chain_plba_code_subintents_v2_plba-v2-find-entrypoints-control-plane.json b/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_132357/full_chain_plba_code_subintents_v2_plba-v2-find-entrypoints-control-plane.json deleted file mode 100644 index b341abd..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_132357/full_chain_plba_code_subintents_v2_plba-v2-find-entrypoints-control-plane.json +++ /dev/null @@ -1,1236 +0,0 @@ -{ - "case_id": "plba-v2-find-entrypoints-control-plane", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_subintents_v2.yaml", - "runner": "runtime", - "mode": "full_chain", - "actual": { - "intent": "CODE_QA", - "sub_intent": "FIND_ENTRYPOINTS", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 9, - "llm_answer": "Подтверждённые точки входа:\nsrc/app_runtime/control/http_app.py | fastapi http app.get\n- Объявлена декоратором @app.get, что указывает на точку входа для HTTP-запросов.\nsrc/app_runtime/control/http_app.py | fastapi http app.post\n- Объявлена декоратором @app.post, что указывает на точку входа для HTTP-запросов.\n\nВозможные кандидаты:\nsrc/app_runtime/control/http_channel.py | HttpControlChannel.start\n- Содержит асинхронную операцию start, которая может запускать приложение, но явных признаков точки входа нет.\nsrc/app_runtime/control/http_channel.py | HttpControlChannel._health_response\n- Реализует логику обработки health-запроса, но сама по себе не является точкой входа.\nsrc/app_runtime/control/http_channel.py | HttpControlChannel._action_response\n- Реализует обработку запросов к действиям, но без явного декоратора или указания на точку входа.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "HTTP", - "control", - "plane" - ], - "layers": [ - "C3_ENTRYPOINTS", - "C0_SOURCE_CHUNKS" - ] - }, - "passed": true, - "mismatches": [], - "details": { - "case_id": "plba-v2-find-entrypoints-control-plane", - "text": "Найди точки входа HTTP control plane", - "mode": "full_chain", - "run_started_at": "2026-03-12T13:23:57", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Найди точки входа HTTP control plane", - "symbol_resolution": { - "status": "not_found", - "resolved_symbol": null, - "alternatives": [ - "HTTP", - "control", - "plane" - ], - "confidence": 0.0 - }, - "rag_count": 9, - "rag_rows": [ - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "class HttpControlChannel(ControlChannel):\n def __init__(self, host: str, port: int, timeout: int) -> None:\n self._timeout = timeout\n self._runner = UvicornThreadRunner(host, port, timeout)\n self._factory = HttpControlAppFactory()\n self._actions: ControlActionSet | None = None\n\n async def start(self, actions: ControlActionSet) -> None:\n self._actions = actions\n app = self._factory.create(self._health_response, self._action_response)\n await self._runner.start(app)\n\n async def stop(self) -> None:\n await self._runner.stop()\n\n @property\n def port(self) -> int:\n return self._runner.port\n\n async def _health_response(self) -> dict[str, object]:\n if self._actions is None:\n return {\"status\": \"unhealthy\", \"detail\": \"control actions are not configured\"}\n return await asyncio.wait_for(self._actions.health(), timeout=float(self._timeout))\n\n async def _action_response(self, action: str, _client_source: str = \"unknown\") -> JSONResponse:\n if self._actions is None:\n return JSONResponse(content={\"status\": \"error\", \"detail\": f\"{action} handler is not configured\"}, status_code=404)\n callbacks = {\n \"start\": self._actions.start,\n \"stop\": self._actions.stop,\n \"status\": self._actions.status,\n }\n callback = callbacks.get(action)\n if callback is None:\n return JSONResponse(content={\"status\": \"error\", \"detail\": f\"unsupported action: {action}\"}, status_code=404)\n action_timeout = max(float(self._timeout), 10.0) if action in {\"start\", \"stop\"} else float(self._timeout)\n try:\n detail = await asyncio.wait_for(callback(), timeout=action_timeout)\n except asyncio.TimeoutError:\n return JSONResponse(\n content={\"status\": \"accepted\", \"detail\": f\"{action} operation is still in progress\"},\n status_code=202,\n )\n except Exception as exc:\n return JSONResponse(content={\"status\": \"error\", \"detail\": str(exc)}, status_code=500)\n return JSONResponse(content={\"status\": \"ok\", \"detail\": detail or f\"{action} action accepted\"}, status_code=200)", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/http_channel.py:HttpControlChannel", - "span_start": 12, - "span_end": 57, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.http_channel", - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "class HttpControlAppFactory:\n def create(\n self,\n health_provider: Callable[[], Awaitable[HealthPayload]],\n action_provider: Callable[[str, str], Awaitable[JSONResponse]],\n ) -> FastAPI:\n app = FastAPI(title=\"PLBA Control API\")\n\n @app.middleware(\"http\")\n async def log_api_call(request: Request, call_next): # type: ignore[no-untyped-def]\n started = time.monotonic()\n response = await call_next(request)\n response.headers[\"X-Response-Time-Ms\"] = str(int((time.monotonic() - started) * 1000))\n return response\n\n @app.get(\"/health\")\n async def health() -> JSONResponse:\n payload = await health_provider()\n status_code = 200 if payload.get(\"status\") == \"ok\" else 503\n return JSONResponse(content=payload, status_code=status_code)\n\n @app.get(\"/actions/{action}\")\n @app.post(\"/actions/{action}\")\n async def action(action: str, request: Request) -> JSONResponse:\n client_source = self._client_source(request)\n if action in {\"start\", \"stop\"}:\n LOGGER.warning(\"Control action requested: /actions/%s client=%s\", action, client_source)\n return await action_provider(action, client_source)\n\n return app\n\n def _client_source(self, request: Request) -> str:\n explicit_header = request.headers.get(\"X-Client-Source\", \"\").strip()\n if explicit_header:\n return explicit_header\n user_agent = request.headers.get(\"User-Agent\", \"\").strip()\n if user_agent:\n return f\"user-agent:{user_agent}\"\n return \"unknown\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/http_app.py:HttpControlAppFactory", - "span_start": 15, - "span_end": 53, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.http_app", - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "class ControlActionSet:\n health: HealthHandler\n start: ActionHandler\n stop: ActionHandler\n status: ActionHandler", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/base.py:ControlActionSet", - "span_start": 14, - "span_end": 18, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.base", - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/__init__.py", - "content": "from app_runtime.control.base import ControlActionSet, ControlChannel\nfrom app_runtime.control.http_channel import HttpControlChannel\nfrom app_runtime.control.service import ControlPlaneService\n\n__all__ = [\"ControlActionSet\", \"ControlChannel\", \"ControlPlaneService\", \"HttpControlChannel\"]", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/__init__.py:1-5", - "span_start": 1, - "span_end": 5, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.app_runtime.control.__init__", - "is_test": false, - "blob_sha": "bf3c37e3369a84cc618adc0fd71c232e5eb4b871eaff743069a17e661e498316", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "class ControlChannel(ABC):\n @abstractmethod\n async def start(self, actions: ControlActionSet) -> None:\n \"\"\"Start the control channel and bind handlers.\"\"\"\n\n @abstractmethod\n async def stop(self) -> None:\n \"\"\"Stop the control channel and release resources.\"\"\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/base.py:ControlChannel", - "span_start": 21, - "span_end": 28, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 1, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.base", - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_runner.py", - "content": "class UvicornThreadRunner:\n def __init__(self, host: str, port: int, timeout: int) -> None:\n self._host = host\n self._port = port\n self._timeout = timeout\n self._server: Server | None = None\n self._thread: Thread | None = None\n self._error: BaseException | None = None\n\n async def start(self, app: FastAPI) -> None:\n if self._thread is not None and self._thread.is_alive():\n return\n self._error = None\n config = Config(app=app, host=self._host, port=self._port, log_level=\"warning\")\n self._server = Server(config)\n self._thread = Thread(target=self._serve, name=\"plba-http-control\", daemon=True)\n self._thread.start()\n await self._wait_until_started()\n\n async def stop(self) -> None:\n if self._server is None or self._thread is None:\n return\n self._server.should_exit = True\n await asyncio.to_thread(self._thread.join, self._timeout)\n self._server = None\n self._thread = None\n\n @property\n def port(self) -> int:\n if self._server is None or not getattr(self._server, \"servers\", None):\n return self._port\n socket = self._server.servers[0].sockets[0]\n return int(socket.getsockname()[1])\n\n async def _wait_until_started(self) -> None:\n if self._server is None:\n raise RuntimeError(\"Server is not initialized\")\n deadline = asyncio.get_running_loop().time() + max(float(self._timeout), 1.0)\n while not self._server.started:\n if self._error is not None:\n raise RuntimeError(\"HTTP control server failed to start\") from self._error\n if asyncio.get_running_loop().time() >= deadline:\n raise TimeoutError(\"HTTP control server startup timed out\")\n await asyncio.sleep(0.05)\n\n def _serve(self) -> None:\n if self._server is None:\n return\n try:\n asyncio.run(self._server.serve())\n except BaseException as exc: # noqa: BLE001\n self._error = exc", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/http_runner.py:UvicornThreadRunner", - "span_start": 10, - "span_end": 61, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.http_runner", - "is_test": false, - "blob_sha": "3779fdd2878b770e789a35bb2a89c9d79f13b61c26d7db1b3b683f9bb9e1623f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "llm_answer": "Подтверждённые точки входа:\nsrc/app_runtime/control/http_app.py | fastapi http app.get\n- Объявлена декоратором @app.get, что указывает на точку входа для HTTP-запросов.\nsrc/app_runtime/control/http_app.py | fastapi http app.post\n- Объявлена декоратором @app.post, что указывает на точку входа для HTTP-запросов.\n\nВозможные кандидаты:\nsrc/app_runtime/control/http_channel.py | HttpControlChannel.start\n- Содержит асинхронную операцию start, которая может запускать приложение, но явных признаков точки входа нет.\nsrc/app_runtime/control/http_channel.py | HttpControlChannel._health_response\n- Реализует логику обработки health-запроса, но сама по себе не является точкой входа.\nsrc/app_runtime/control/http_channel.py | HttpControlChannel._action_response\n- Реализует обработку запросов к действиям, но без явного декоратора или указания на точку входа.", - "summary": { - "router": { - "intent": "CODE_QA", - "sub_intent": "FIND_ENTRYPOINTS", - "confidence": null - }, - "retrieval": { - "profile": "code", - "layers_hit": [ - "C0_SOURCE_CHUNKS", - "C3_ENTRYPOINTS" - ], - "evidence_sufficient": true - }, - "llm": { - "answer_status": "answered", - "groundedness": "grounded" - } - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "FIND_ENTRYPOINTS", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C3_ENTRYPOINTS", - "C0_SOURCE_CHUNKS" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "HTTP", - "control", - "plane" - ], - "keyword_hints": [ - "HTTP", - "control", - "plane" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "execution": { - "executed_layers": [ - "C3_ENTRYPOINTS", - "C0_SOURCE_CHUNKS" - ], - "retrieval_mode_by_layer": { - "C3_ENTRYPOINTS": "exact_path_fetch", - "C0_SOURCE_CHUNKS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C3_ENTRYPOINTS": 12, - "C0_SOURCE_CHUNKS": 6 - }, - "filters_by_layer": { - "C3_ENTRYPOINTS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C3_ENTRYPOINTS", - "query": "Найди точки входа HTTP control plane", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 12, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Найди точки входа HTTP control plane", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C3_ENTRYPOINTS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 3, - "candidates_after_filter": 3 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 6, - "candidates_after_filter": 6 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "not_found", - "resolved_symbol": null, - "alternatives": [ - "HTTP", - "control", - "plane" - ] - }, - "layers": [ - { - "layer": "C3_ENTRYPOINTS", - "status": "hit", - "hit_count": 3, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 6, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "router": 0, - "symbol_resolution": 0, - "retrieval_total": 53, - "retrieval_by_layer": { - "C3_ENTRYPOINTS": 28, - "C0_SOURCE_CHUNKS": 25 - }, - "merge_rank": 0, - "prompt_build": 0, - "llm_call": 1612 - }, - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 1094, - "evidence_rows": 9, - "evidence_chars": 6731 - }, - "evidence_summary": [ - { - "layer": "C3_ENTRYPOINTS", - "count": 3, - "unique_paths": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 6, - "unique_paths": 5 - } - ], - "prompt_template_id": "intent_code_qa_find_entrypoints_ru_v2", - "system_prompt_version": "v1" - }, - "router": { - "conversation_mode": "START", - "keyword_hints": [ - "HTTP", - "control", - "plane" - ], - "path_scope": [] - }, - "llm": { - "used_evidence_count": 9, - "missing_evidence_reason": null - } - }, - "run_info": { - "case_id": "plba-v2-find-entrypoints-control-plane", - "mode": "full_chain", - "run_started_at": "2026-03-12T13:23:57", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - }, - "input_request": { - "text": "Найди точки входа HTTP control plane", - "normalized_query": "Найди точки входа HTTP control plane" - }, - "steps": [ - { - "step": "intent_router", - "input": { - "query": "Найди точки входа HTTP control plane" - }, - "output": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Найди точки входа HTTP control plane" - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "FIND_ENTRYPOINTS", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C3_ENTRYPOINTS", - "C0_SOURCE_CHUNKS" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "HTTP", - "control", - "plane" - ], - "keyword_hints": [ - "HTTP", - "control", - "plane" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "timings_ms": { - "router": 0 - } - } - }, - { - "step": "retrieval", - "input": { - "query": "Найди точки входа HTTP control plane" - }, - "output": { - "symbol_resolution": { - "status": "not_found", - "resolved_symbol": null, - "alternatives": [ - "HTTP", - "control", - "plane" - ], - "confidence": 0.0 - }, - "rag_count": 9, - "rag_rows": [ - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "class HttpControlChannel(ControlChannel):\n def __init__(self, host: str, port: int, timeout: int) -> None:\n self._timeout = timeout\n self._runner = UvicornThreadRunner(host, port, timeout)\n self._factory = HttpControlAppFactory()\n self._actions: ControlActionSet | None = None\n\n async def start(self, actions: ControlActionSet) -> None:\n self._actions = actions\n app = self._factory.create(self._health_response, self._action_response)\n await self._runner.start(app)\n\n async def stop(self) -> None:\n await self._runner.stop()\n\n @property\n def port(self) -> int:\n return self._runner.port\n\n async def _health_response(self) -> dict[str, object]:\n if self._actions is None:\n return {\"status\": \"unhealthy\", \"detail\": \"control actions are not configured\"}\n return await asyncio.wait_for(self._actions.health(), timeout=float(self._timeout))\n\n async def _action_response(self, action: str, _client_source: str = \"unknown\") -> JSONResponse:\n if self._actions is None:\n return JSONResponse(content={\"status\": \"error\", \"detail\": f\"{action} handler is not configured\"}, status_code=404)\n callbacks = {\n \"start\": self._actions.start,\n \"stop\": self._actions.stop,\n \"status\": self._actions.status,\n }\n callback = callbacks.get(action)\n if callback is None:\n return JSONResponse(content={\"status\": \"error\", \"detail\": f\"unsupported action: {action}\"}, status_code=404)\n action_timeout = max(float(self._timeout), 10.0) if action in {\"start\", \"stop\"} else float(self._timeout)\n try:\n detail = await asyncio.wait_for(callback(), timeout=action_timeout)\n except asyncio.TimeoutError:\n return JSONResponse(\n content={\"status\": \"accepted\", \"detail\": f\"{action} operation is still in progress\"},\n status_code=202,\n )\n except Exception as exc:\n return JSONResponse(content={\"status\": \"error\", \"detail\": str(exc)}, status_code=500)\n return JSONResponse(content={\"status\": \"ok\", \"detail\": detail or f\"{action} action accepted\"}, status_code=200)", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/http_channel.py:HttpControlChannel", - "span_start": 12, - "span_end": 57, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.http_channel", - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "class HttpControlAppFactory:\n def create(\n self,\n health_provider: Callable[[], Awaitable[HealthPayload]],\n action_provider: Callable[[str, str], Awaitable[JSONResponse]],\n ) -> FastAPI:\n app = FastAPI(title=\"PLBA Control API\")\n\n @app.middleware(\"http\")\n async def log_api_call(request: Request, call_next): # type: ignore[no-untyped-def]\n started = time.monotonic()\n response = await call_next(request)\n response.headers[\"X-Response-Time-Ms\"] = str(int((time.monotonic() - started) * 1000))\n return response\n\n @app.get(\"/health\")\n async def health() -> JSONResponse:\n payload = await health_provider()\n status_code = 200 if payload.get(\"status\") == \"ok\" else 503\n return JSONResponse(content=payload, status_code=status_code)\n\n @app.get(\"/actions/{action}\")\n @app.post(\"/actions/{action}\")\n async def action(action: str, request: Request) -> JSONResponse:\n client_source = self._client_source(request)\n if action in {\"start\", \"stop\"}:\n LOGGER.warning(\"Control action requested: /actions/%s client=%s\", action, client_source)\n return await action_provider(action, client_source)\n\n return app\n\n def _client_source(self, request: Request) -> str:\n explicit_header = request.headers.get(\"X-Client-Source\", \"\").strip()\n if explicit_header:\n return explicit_header\n user_agent = request.headers.get(\"User-Agent\", \"\").strip()\n if user_agent:\n return f\"user-agent:{user_agent}\"\n return \"unknown\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/http_app.py:HttpControlAppFactory", - "span_start": 15, - "span_end": 53, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.http_app", - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "class ControlActionSet:\n health: HealthHandler\n start: ActionHandler\n stop: ActionHandler\n status: ActionHandler", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/base.py:ControlActionSet", - "span_start": 14, - "span_end": 18, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.base", - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/__init__.py", - "content": "from app_runtime.control.base import ControlActionSet, ControlChannel\nfrom app_runtime.control.http_channel import HttpControlChannel\nfrom app_runtime.control.service import ControlPlaneService\n\n__all__ = [\"ControlActionSet\", \"ControlChannel\", \"ControlPlaneService\", \"HttpControlChannel\"]", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/__init__.py:1-5", - "span_start": 1, - "span_end": 5, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.app_runtime.control.__init__", - "is_test": false, - "blob_sha": "bf3c37e3369a84cc618adc0fd71c232e5eb4b871eaff743069a17e661e498316", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "class ControlChannel(ABC):\n @abstractmethod\n async def start(self, actions: ControlActionSet) -> None:\n \"\"\"Start the control channel and bind handlers.\"\"\"\n\n @abstractmethod\n async def stop(self) -> None:\n \"\"\"Stop the control channel and release resources.\"\"\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/base.py:ControlChannel", - "span_start": 21, - "span_end": 28, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 1, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.base", - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_runner.py", - "content": "class UvicornThreadRunner:\n def __init__(self, host: str, port: int, timeout: int) -> None:\n self._host = host\n self._port = port\n self._timeout = timeout\n self._server: Server | None = None\n self._thread: Thread | None = None\n self._error: BaseException | None = None\n\n async def start(self, app: FastAPI) -> None:\n if self._thread is not None and self._thread.is_alive():\n return\n self._error = None\n config = Config(app=app, host=self._host, port=self._port, log_level=\"warning\")\n self._server = Server(config)\n self._thread = Thread(target=self._serve, name=\"plba-http-control\", daemon=True)\n self._thread.start()\n await self._wait_until_started()\n\n async def stop(self) -> None:\n if self._server is None or self._thread is None:\n return\n self._server.should_exit = True\n await asyncio.to_thread(self._thread.join, self._timeout)\n self._server = None\n self._thread = None\n\n @property\n def port(self) -> int:\n if self._server is None or not getattr(self._server, \"servers\", None):\n return self._port\n socket = self._server.servers[0].sockets[0]\n return int(socket.getsockname()[1])\n\n async def _wait_until_started(self) -> None:\n if self._server is None:\n raise RuntimeError(\"Server is not initialized\")\n deadline = asyncio.get_running_loop().time() + max(float(self._timeout), 1.0)\n while not self._server.started:\n if self._error is not None:\n raise RuntimeError(\"HTTP control server failed to start\") from self._error\n if asyncio.get_running_loop().time() >= deadline:\n raise TimeoutError(\"HTTP control server startup timed out\")\n await asyncio.sleep(0.05)\n\n def _serve(self) -> None:\n if self._server is None:\n return\n try:\n asyncio.run(self._server.serve())\n except BaseException as exc: # noqa: BLE001\n self._error = exc", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/http_runner.py:UvicornThreadRunner", - "span_start": 10, - "span_end": 61, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.http_runner", - "is_test": false, - "blob_sha": "3779fdd2878b770e789a35bb2a89c9d79f13b61c26d7db1b3b683f9bb9e1623f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ] - }, - "diagnostics": { - "execution": { - "executed_layers": [ - "C3_ENTRYPOINTS", - "C0_SOURCE_CHUNKS" - ], - "retrieval_mode_by_layer": { - "C3_ENTRYPOINTS": "exact_path_fetch", - "C0_SOURCE_CHUNKS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C3_ENTRYPOINTS": 12, - "C0_SOURCE_CHUNKS": 6 - }, - "filters_by_layer": { - "C3_ENTRYPOINTS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C3_ENTRYPOINTS", - "query": "Найди точки входа HTTP control plane", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 12, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Найди точки входа HTTP control plane", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C3_ENTRYPOINTS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 3, - "candidates_after_filter": 3 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 6, - "candidates_after_filter": 6 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "not_found", - "resolved_symbol": null, - "alternatives": [ - "HTTP", - "control", - "plane" - ] - }, - "layers": [ - { - "layer": "C3_ENTRYPOINTS", - "status": "hit", - "hit_count": 3, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 6, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "symbol_resolution": 0, - "retrieval_total": 53, - "retrieval_by_layer": { - "C3_ENTRYPOINTS": 28, - "C0_SOURCE_CHUNKS": 25 - }, - "merge_rank": 0 - } - } - }, - { - "step": "llm_answer", - "input": { - "query": "Найди точки входа HTTP control plane", - "rag_count": 9 - }, - "output": { - "llm_answer": "Подтверждённые точки входа:\nsrc/app_runtime/control/http_app.py | fastapi http app.get\n- Объявлена декоратором @app.get, что указывает на точку входа для HTTP-запросов.\nsrc/app_runtime/control/http_app.py | fastapi http app.post\n- Объявлена декоратором @app.post, что указывает на точку входа для HTTP-запросов.\n\nВозможные кандидаты:\nsrc/app_runtime/control/http_channel.py | HttpControlChannel.start\n- Содержит асинхронную операцию start, которая может запускать приложение, но явных признаков точки входа нет.\nsrc/app_runtime/control/http_channel.py | HttpControlChannel._health_response\n- Реализует логику обработки health-запроса, но сама по себе не является точкой входа.\nsrc/app_runtime/control/http_channel.py | HttpControlChannel._action_response\n- Реализует обработку запросов к действиям, но без явного декоратора или указания на точку входа." - }, - "diagnostics": { - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 1094, - "evidence_rows": 9, - "evidence_chars": 6731 - }, - "evidence_summary": [ - { - "layer": "C3_ENTRYPOINTS", - "count": 3, - "unique_paths": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 6, - "unique_paths": 5 - } - ], - "prompt_template_id": "intent_code_qa_find_entrypoints_ru_v2", - "system_prompt_version": "v1" - }, - "timings_ms": { - "prompt_build": 0, - "llm_call": 1612 - } - } - } - ] - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_132357/full_chain_plba_code_subintents_v2_plba-v2-find-entrypoints-control-plane.md b/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_132357/full_chain_plba_code_subintents_v2_plba-v2-find-entrypoints-control-plane.md deleted file mode 100644 index 67b287e..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_132357/full_chain_plba_code_subintents_v2_plba-v2-find-entrypoints-control-plane.md +++ /dev/null @@ -1,33 +0,0 @@ -# plba-v2-find-entrypoints-control-plane - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_subintents_v2.yaml -- runner: runtime -- mode: full_chain -- passed: True - -## Query -Найди точки входа HTTP control plane - -## Actual -{ - "intent": "CODE_QA", - "sub_intent": "FIND_ENTRYPOINTS", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 9, - "llm_answer": "Подтверждённые точки входа:\nsrc/app_runtime/control/http_app.py | fastapi http app.get\n- Объявлена декоратором @app.get, что указывает на точку входа для HTTP-запросов.\nsrc/app_runtime/control/http_app.py | fastapi http app.post\n- Объявлена декоратором @app.post, что указывает на точку входа для HTTP-запросов.\n\nВозможные кандидаты:\nsrc/app_runtime/control/http_channel.py | HttpControlChannel.start\n- Содержит асинхронную операцию start, которая может запускать приложение, но явных признаков точки входа нет.\nsrc/app_runtime/control/http_channel.py | HttpControlChannel._health_response\n- Реализует логику обработки health-запроса, но сама по себе не является точкой входа.\nsrc/app_runtime/control/http_channel.py | HttpControlChannel._action_response\n- Реализует обработку запросов к действиям, но без явного декоратора или указания на точку входа.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "HTTP", - "control", - "plane" - ], - "layers": [ - "C3_ENTRYPOINTS", - "C0_SOURCE_CHUNKS" - ] -} - -## Mismatches -- none \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_132357/full_chain_plba_code_subintents_v2_plba-v2-find-entrypoints-health-endpoint.json b/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_132357/full_chain_plba_code_subintents_v2_plba-v2-find-entrypoints-health-endpoint.json deleted file mode 100644 index f325a96..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_132357/full_chain_plba_code_subintents_v2_plba-v2-find-entrypoints-health-endpoint.json +++ /dev/null @@ -1,1226 +0,0 @@ -{ - "case_id": "plba-v2-find-entrypoints-health-endpoint", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_subintents_v2.yaml", - "runner": "runtime", - "mode": "full_chain", - "actual": { - "intent": "CODE_QA", - "sub_intent": "FIND_ENTRYPOINTS", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 9, - "llm_answer": "### Подтверждённые точки входа\n\nsrc/app_runtime/control/http_app.py | app.post \nFastAPI HTTP app.post \nОписание: FastAPI маршрутизатор автоматически регистрирует маршруты при старте приложения, что делает эту точку старта подтвержденной.\n\nsrc/app_runtime/control/http_app.py | app.get \nFastAPI HTTP app.get \nОписание: Аналогично предыдущему пункту, FastAPI маршрутизатор регистрирует маршруты при старте приложения, делая эту точку старта подтвержденной.\n\n### Возможные кандидаты\n\nsrc/app_runtime/health/registry.py | HealthRegistry \nОписание: Класс HealthRegistry используется для регистрации и управления health-конtributors. Сам по себе класс не является точкой входа, но может быть использован в контексте health-endpoint'а. Требуется дополнительная проверка в коде использования данного класса.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "health", - "endpoint" - ], - "layers": [ - "C3_ENTRYPOINTS", - "C0_SOURCE_CHUNKS" - ] - }, - "passed": true, - "mismatches": [], - "details": { - "case_id": "plba-v2-find-entrypoints-health-endpoint", - "text": "Где health endpoint?", - "mode": "full_chain", - "run_started_at": "2026-03-12T13:23:57", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Где health endpoint?", - "symbol_resolution": { - "status": "not_found", - "resolved_symbol": null, - "alternatives": [ - "health", - "endpoint" - ], - "confidence": 0.0 - }, - "rag_count": 9, - "rag_rows": [ - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/health/registry.py", - "content": "class HealthRegistry:\n def __init__(self) -> None:\n self._contributors: list[HealthContributor] = []\n\n def register(self, contributor: HealthContributor) -> None:\n self._contributors.append(contributor)\n\n def contributor_healths(self) -> list[WorkerHealth]:\n return [contributor.health() for contributor in self._contributors]\n\n def snapshot(self, worker_healths: list[WorkerHealth]) -> dict[str, object]:\n component_healths = worker_healths + self.contributor_healths()\n return {\n \"status\": self._aggregate_status(component_healths),\n \"components\": [self._health_dict(item) for item in component_healths],\n }\n\n def payload(self, state: LifecycleState, worker_healths: list[WorkerHealth]) -> HealthPayload:\n component_healths = worker_healths + self.contributor_healths()\n if state == LifecycleState.STOPPED:\n return {\"status\": \"unhealthy\", \"detail\": \"state=stopped\", \"state\": state.value}\n if state in {LifecycleState.STARTING, LifecycleState.STOPPING}:\n return {\n \"status\": \"degraded\",\n \"detail\": f\"state={state.value}\",\n \"state\": state.value,\n \"components\": [self._health_dict(item) for item in component_healths],\n }\n return {\n \"status\": self._aggregate_status(component_healths),\n \"state\": state.value,\n \"components\": [self._health_dict(item) for item in component_healths],\n }\n\n def _aggregate_status(self, component_healths: list[WorkerHealth]) -> str:\n if any(item.status == \"unhealthy\" and item.critical for item in component_healths):\n return \"unhealthy\"\n if any(item.status in {\"degraded\", \"unhealthy\"} for item in component_healths):\n return \"degraded\"\n return \"ok\"\n\n def _health_dict(self, health: WorkerHealth) -> dict[str, object]:\n return {\n \"name\": health.name,\n \"status\": health.status,\n \"critical\": health.critical,\n \"detail\": health.detail,\n \"meta\": health.meta,\n }", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/health/registry.py:HealthRegistry", - "span_start": 8, - "span_end": 56, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.health.registry", - "is_test": false, - "blob_sha": "26e6a24daa43407ba5340b74497c20153020e79f8d7828ae502aaec378dfcf75", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/health.py", - "content": "from app_runtime.health.registry import HealthRegistry\n\n__all__ = [\"HealthRegistry\"]", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/health/__init__.py:1-3", - "span_start": 1, - "span_end": 3, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.app_runtime.health.__init__", - "is_test": false, - "blob_sha": "f7b15eed8b1f1cca8dfd467909a2612d8cb4e66e46b972ad89a0c9459ce283a0", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/contracts/health.py", - "content": "class HealthContributor(ABC):\n @abstractmethod\n def health(self) -> WorkerHealth:\n \"\"\"Return contributor health state.\"\"\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/contracts/health.py:HealthContributor", - "span_start": 7, - "span_end": 10, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.contracts.health", - "is_test": false, - "blob_sha": "6bd92611def7131e32d4dd34a8ed85e6cf3c67722ad27797032a632cb30dc097", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/health/__init__.py", - "content": "from app_runtime.health.registry import HealthRegistry\n\n__all__ = [\"HealthRegistry\"]", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/health/__init__.py:1-3", - "span_start": 1, - "span_end": 3, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.app_runtime.health.__init__", - "is_test": false, - "blob_sha": "f7b15eed8b1f1cca8dfd467909a2612d8cb4e66e46b972ad89a0c9459ce283a0", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/contracts/worker.py", - "content": "class WorkerHealth:\n name: str\n status: HealthState\n critical: bool\n detail: str | None = None\n meta: dict[str, Any] = field(default_factory=dict)", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/contracts/worker.py:WorkerHealth", - "span_start": 13, - "span_end": 18, - "lexical_rank": 6, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.contracts.worker", - "is_test": false, - "blob_sha": "e4827d32220f322d8adc3e42769da3ca0cc680db6a5eab7a11f4d8773a75304e", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/contracts/worker.py", - "content": "class Worker(ABC):\n @property\n @abstractmethod\n def name(self) -> str:\n \"\"\"Stable worker name for diagnostics.\"\"\"\n\n @property\n @abstractmethod\n def critical(self) -> bool:\n \"\"\"Whether this worker is required for healthy app operation.\"\"\"\n\n @abstractmethod\n def start(self) -> None:\n \"\"\"Start worker execution.\"\"\"\n\n @abstractmethod\n def stop(self, force: bool = False) -> None:\n \"\"\"Request graceful or immediate stop.\"\"\"\n\n @abstractmethod\n def health(self) -> WorkerHealth:\n \"\"\"Return current health state.\"\"\"\n\n @abstractmethod\n def status(self) -> WorkerStatus:\n \"\"\"Return current runtime status.\"\"\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/contracts/worker.py:Worker", - "span_start": 30, - "span_end": 55, - "lexical_rank": 6, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 2, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.contracts.worker", - "is_test": false, - "blob_sha": "e4827d32220f322d8adc3e42769da3ca0cc680db6a5eab7a11f4d8773a75304e", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "llm_answer": "### Подтверждённые точки входа\n\nsrc/app_runtime/control/http_app.py | app.post \nFastAPI HTTP app.post \nОписание: FastAPI маршрутизатор автоматически регистрирует маршруты при старте приложения, что делает эту точку старта подтвержденной.\n\nsrc/app_runtime/control/http_app.py | app.get \nFastAPI HTTP app.get \nОписание: Аналогично предыдущему пункту, FastAPI маршрутизатор регистрирует маршруты при старте приложения, делая эту точку старта подтвержденной.\n\n### Возможные кандидаты\n\nsrc/app_runtime/health/registry.py | HealthRegistry \nОписание: Класс HealthRegistry используется для регистрации и управления health-конtributors. Сам по себе класс не является точкой входа, но может быть использован в контексте health-endpoint'а. Требуется дополнительная проверка в коде использования данного класса.", - "summary": { - "router": { - "intent": "CODE_QA", - "sub_intent": "FIND_ENTRYPOINTS", - "confidence": null - }, - "retrieval": { - "profile": "code", - "layers_hit": [ - "C0_SOURCE_CHUNKS", - "C3_ENTRYPOINTS" - ], - "evidence_sufficient": true - }, - "llm": { - "answer_status": "answered", - "groundedness": "grounded" - } - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "FIND_ENTRYPOINTS", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C3_ENTRYPOINTS", - "C0_SOURCE_CHUNKS" - ], - "symbol_kind_hint": "unknown", - "symbol_candidates": [ - "health", - "endpoint" - ], - "keyword_hints": [ - "health", - "endpoint" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "execution": { - "executed_layers": [ - "C3_ENTRYPOINTS", - "C0_SOURCE_CHUNKS" - ], - "retrieval_mode_by_layer": { - "C3_ENTRYPOINTS": "exact_path_fetch", - "C0_SOURCE_CHUNKS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C3_ENTRYPOINTS": 12, - "C0_SOURCE_CHUNKS": 6 - }, - "filters_by_layer": { - "C3_ENTRYPOINTS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C3_ENTRYPOINTS", - "query": "Где health endpoint?", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 12, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Где health endpoint?", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C3_ENTRYPOINTS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 3, - "candidates_after_filter": 3 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 6, - "candidates_after_filter": 6 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "not_found", - "resolved_symbol": null, - "alternatives": [ - "health", - "endpoint" - ] - }, - "layers": [ - { - "layer": "C3_ENTRYPOINTS", - "status": "hit", - "hit_count": 3, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 6, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "router": 0, - "symbol_resolution": 0, - "retrieval_total": 54, - "retrieval_by_layer": { - "C3_ENTRYPOINTS": 26, - "C0_SOURCE_CHUNKS": 27 - }, - "merge_rank": 0, - "prompt_build": 0, - "llm_call": 1313 - }, - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 803, - "evidence_rows": 9, - "evidence_chars": 3350 - }, - "evidence_summary": [ - { - "layer": "C3_ENTRYPOINTS", - "count": 3, - "unique_paths": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 6, - "unique_paths": 5 - } - ], - "prompt_template_id": "intent_code_qa_find_entrypoints_ru_v2", - "system_prompt_version": "v1" - }, - "router": { - "conversation_mode": "START", - "keyword_hints": [ - "health", - "endpoint" - ], - "path_scope": [] - }, - "llm": { - "used_evidence_count": 9, - "missing_evidence_reason": null - } - }, - "run_info": { - "case_id": "plba-v2-find-entrypoints-health-endpoint", - "mode": "full_chain", - "run_started_at": "2026-03-12T13:23:57", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - }, - "input_request": { - "text": "Где health endpoint?", - "normalized_query": "Где health endpoint?" - }, - "steps": [ - { - "step": "intent_router", - "input": { - "query": "Где health endpoint?" - }, - "output": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Где health endpoint?" - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "FIND_ENTRYPOINTS", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C3_ENTRYPOINTS", - "C0_SOURCE_CHUNKS" - ], - "symbol_kind_hint": "unknown", - "symbol_candidates": [ - "health", - "endpoint" - ], - "keyword_hints": [ - "health", - "endpoint" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "timings_ms": { - "router": 0 - } - } - }, - { - "step": "retrieval", - "input": { - "query": "Где health endpoint?" - }, - "output": { - "symbol_resolution": { - "status": "not_found", - "resolved_symbol": null, - "alternatives": [ - "health", - "endpoint" - ], - "confidence": 0.0 - }, - "rag_count": 9, - "rag_rows": [ - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/health/registry.py", - "content": "class HealthRegistry:\n def __init__(self) -> None:\n self._contributors: list[HealthContributor] = []\n\n def register(self, contributor: HealthContributor) -> None:\n self._contributors.append(contributor)\n\n def contributor_healths(self) -> list[WorkerHealth]:\n return [contributor.health() for contributor in self._contributors]\n\n def snapshot(self, worker_healths: list[WorkerHealth]) -> dict[str, object]:\n component_healths = worker_healths + self.contributor_healths()\n return {\n \"status\": self._aggregate_status(component_healths),\n \"components\": [self._health_dict(item) for item in component_healths],\n }\n\n def payload(self, state: LifecycleState, worker_healths: list[WorkerHealth]) -> HealthPayload:\n component_healths = worker_healths + self.contributor_healths()\n if state == LifecycleState.STOPPED:\n return {\"status\": \"unhealthy\", \"detail\": \"state=stopped\", \"state\": state.value}\n if state in {LifecycleState.STARTING, LifecycleState.STOPPING}:\n return {\n \"status\": \"degraded\",\n \"detail\": f\"state={state.value}\",\n \"state\": state.value,\n \"components\": [self._health_dict(item) for item in component_healths],\n }\n return {\n \"status\": self._aggregate_status(component_healths),\n \"state\": state.value,\n \"components\": [self._health_dict(item) for item in component_healths],\n }\n\n def _aggregate_status(self, component_healths: list[WorkerHealth]) -> str:\n if any(item.status == \"unhealthy\" and item.critical for item in component_healths):\n return \"unhealthy\"\n if any(item.status in {\"degraded\", \"unhealthy\"} for item in component_healths):\n return \"degraded\"\n return \"ok\"\n\n def _health_dict(self, health: WorkerHealth) -> dict[str, object]:\n return {\n \"name\": health.name,\n \"status\": health.status,\n \"critical\": health.critical,\n \"detail\": health.detail,\n \"meta\": health.meta,\n }", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/health/registry.py:HealthRegistry", - "span_start": 8, - "span_end": 56, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.health.registry", - "is_test": false, - "blob_sha": "26e6a24daa43407ba5340b74497c20153020e79f8d7828ae502aaec378dfcf75", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/health.py", - "content": "from app_runtime.health.registry import HealthRegistry\n\n__all__ = [\"HealthRegistry\"]", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/health/__init__.py:1-3", - "span_start": 1, - "span_end": 3, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.app_runtime.health.__init__", - "is_test": false, - "blob_sha": "f7b15eed8b1f1cca8dfd467909a2612d8cb4e66e46b972ad89a0c9459ce283a0", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/contracts/health.py", - "content": "class HealthContributor(ABC):\n @abstractmethod\n def health(self) -> WorkerHealth:\n \"\"\"Return contributor health state.\"\"\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/contracts/health.py:HealthContributor", - "span_start": 7, - "span_end": 10, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.contracts.health", - "is_test": false, - "blob_sha": "6bd92611def7131e32d4dd34a8ed85e6cf3c67722ad27797032a632cb30dc097", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/health/__init__.py", - "content": "from app_runtime.health.registry import HealthRegistry\n\n__all__ = [\"HealthRegistry\"]", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/health/__init__.py:1-3", - "span_start": 1, - "span_end": 3, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.app_runtime.health.__init__", - "is_test": false, - "blob_sha": "f7b15eed8b1f1cca8dfd467909a2612d8cb4e66e46b972ad89a0c9459ce283a0", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/contracts/worker.py", - "content": "class WorkerHealth:\n name: str\n status: HealthState\n critical: bool\n detail: str | None = None\n meta: dict[str, Any] = field(default_factory=dict)", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/contracts/worker.py:WorkerHealth", - "span_start": 13, - "span_end": 18, - "lexical_rank": 6, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.contracts.worker", - "is_test": false, - "blob_sha": "e4827d32220f322d8adc3e42769da3ca0cc680db6a5eab7a11f4d8773a75304e", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/contracts/worker.py", - "content": "class Worker(ABC):\n @property\n @abstractmethod\n def name(self) -> str:\n \"\"\"Stable worker name for diagnostics.\"\"\"\n\n @property\n @abstractmethod\n def critical(self) -> bool:\n \"\"\"Whether this worker is required for healthy app operation.\"\"\"\n\n @abstractmethod\n def start(self) -> None:\n \"\"\"Start worker execution.\"\"\"\n\n @abstractmethod\n def stop(self, force: bool = False) -> None:\n \"\"\"Request graceful or immediate stop.\"\"\"\n\n @abstractmethod\n def health(self) -> WorkerHealth:\n \"\"\"Return current health state.\"\"\"\n\n @abstractmethod\n def status(self) -> WorkerStatus:\n \"\"\"Return current runtime status.\"\"\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/contracts/worker.py:Worker", - "span_start": 30, - "span_end": 55, - "lexical_rank": 6, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 2, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.contracts.worker", - "is_test": false, - "blob_sha": "e4827d32220f322d8adc3e42769da3ca0cc680db6a5eab7a11f4d8773a75304e", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ] - }, - "diagnostics": { - "execution": { - "executed_layers": [ - "C3_ENTRYPOINTS", - "C0_SOURCE_CHUNKS" - ], - "retrieval_mode_by_layer": { - "C3_ENTRYPOINTS": "exact_path_fetch", - "C0_SOURCE_CHUNKS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C3_ENTRYPOINTS": 12, - "C0_SOURCE_CHUNKS": 6 - }, - "filters_by_layer": { - "C3_ENTRYPOINTS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C3_ENTRYPOINTS", - "query": "Где health endpoint?", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 12, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Где health endpoint?", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C3_ENTRYPOINTS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 3, - "candidates_after_filter": 3 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 6, - "candidates_after_filter": 6 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "not_found", - "resolved_symbol": null, - "alternatives": [ - "health", - "endpoint" - ] - }, - "layers": [ - { - "layer": "C3_ENTRYPOINTS", - "status": "hit", - "hit_count": 3, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 6, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "symbol_resolution": 0, - "retrieval_total": 54, - "retrieval_by_layer": { - "C3_ENTRYPOINTS": 26, - "C0_SOURCE_CHUNKS": 27 - }, - "merge_rank": 0 - } - } - }, - { - "step": "llm_answer", - "input": { - "query": "Где health endpoint?", - "rag_count": 9 - }, - "output": { - "llm_answer": "### Подтверждённые точки входа\n\nsrc/app_runtime/control/http_app.py | app.post \nFastAPI HTTP app.post \nОписание: FastAPI маршрутизатор автоматически регистрирует маршруты при старте приложения, что делает эту точку старта подтвержденной.\n\nsrc/app_runtime/control/http_app.py | app.get \nFastAPI HTTP app.get \nОписание: Аналогично предыдущему пункту, FastAPI маршрутизатор регистрирует маршруты при старте приложения, делая эту точку старта подтвержденной.\n\n### Возможные кандидаты\n\nsrc/app_runtime/health/registry.py | HealthRegistry \nОписание: Класс HealthRegistry используется для регистрации и управления health-конtributors. Сам по себе класс не является точкой входа, но может быть использован в контексте health-endpoint'а. Требуется дополнительная проверка в коде использования данного класса." - }, - "diagnostics": { - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 803, - "evidence_rows": 9, - "evidence_chars": 3350 - }, - "evidence_summary": [ - { - "layer": "C3_ENTRYPOINTS", - "count": 3, - "unique_paths": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 6, - "unique_paths": 5 - } - ], - "prompt_template_id": "intent_code_qa_find_entrypoints_ru_v2", - "system_prompt_version": "v1" - }, - "timings_ms": { - "prompt_build": 0, - "llm_call": 1313 - } - } - } - ] - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_132357/full_chain_plba_code_subintents_v2_plba-v2-find-entrypoints-health-endpoint.md b/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_132357/full_chain_plba_code_subintents_v2_plba-v2-find-entrypoints-health-endpoint.md deleted file mode 100644 index a146141..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_132357/full_chain_plba_code_subintents_v2_plba-v2-find-entrypoints-health-endpoint.md +++ /dev/null @@ -1,32 +0,0 @@ -# plba-v2-find-entrypoints-health-endpoint - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_subintents_v2.yaml -- runner: runtime -- mode: full_chain -- passed: True - -## Query -Где health endpoint? - -## Actual -{ - "intent": "CODE_QA", - "sub_intent": "FIND_ENTRYPOINTS", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 9, - "llm_answer": "### Подтверждённые точки входа\n\nsrc/app_runtime/control/http_app.py | app.post \nFastAPI HTTP app.post \nОписание: FastAPI маршрутизатор автоматически регистрирует маршруты при старте приложения, что делает эту точку старта подтвержденной.\n\nsrc/app_runtime/control/http_app.py | app.get \nFastAPI HTTP app.get \nОписание: Аналогично предыдущему пункту, FastAPI маршрутизатор регистрирует маршруты при старте приложения, делая эту точку старта подтвержденной.\n\n### Возможные кандидаты\n\nsrc/app_runtime/health/registry.py | HealthRegistry \nОписание: Класс HealthRegistry используется для регистрации и управления health-конtributors. Сам по себе класс не является точкой входа, но может быть использован в контексте health-endpoint'а. Требуется дополнительная проверка в коде использования данного класса.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "health", - "endpoint" - ], - "layers": [ - "C3_ENTRYPOINTS", - "C0_SOURCE_CHUNKS" - ] -} - -## Mismatches -- none \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_132357/full_chain_plba_code_subintents_v2_plba-v2-find-tests-create-runtime.json b/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_132357/full_chain_plba_code_subintents_v2_plba-v2-find-tests-create-runtime.json deleted file mode 100644 index ca843b9..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_132357/full_chain_plba_code_subintents_v2_plba-v2-find-tests-create-runtime.json +++ /dev/null @@ -1,1963 +0,0 @@ -{ - "case_id": "plba-v2-find-tests-create-runtime", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_subintents_v2.yaml", - "runner": "runtime", - "mode": "full_chain", - "actual": { - "intent": "CODE_QA", - "sub_intent": "FIND_TESTS", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 16, - "llm_answer": "1. Прямые тесты:\n - tests/test_runtime.py | test_public_plba_package_exports_runtime_builder_and_worker_contract\n - Проверка: импорты и вызов функции create_runtime.\n - Видны пробелы покрытия: отсутствуют проверки непосредственно созданного runtime.\n\n2. Косвенные или ближайшие тесты:\n - tests/test_business_control_actions.py | _build_runtime\n - Проверка: функция _build_runtime использует create_runtime в своем потоке зависимостей.\n\n3. Что именно проверяется:\n - В direct test проверяется доступность и работоспособность функции create_runtime через её импорт и вызов.\n - В indirect test проверяется использование create_runtime внутри другой функции.\n\n4. Пробелы покрытия:\n - Прямое тестирование runtime-сущности отсутствует.\n - Нет тестирования поведения или свойств созданного runtime.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "create_runtime" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ] - }, - "passed": true, - "mismatches": [], - "details": { - "case_id": "plba-v2-find-tests-create-runtime", - "text": "Где тесты для create_runtime?", - "mode": "full_chain", - "run_started_at": "2026-03-12T13:23:57", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Где тесты для create_runtime?", - "symbol_resolution": { - "status": "not_found", - "resolved_symbol": null, - "alternatives": [ - "create_runtime" - ], - "confidence": 0.0 - }, - "rag_count": 16, - "rag_rows": [ - { - "path": "tests/test_runtime.py", - "content": "test_public_plba_package_exports_runtime_builder_and_worker_contract imports plba.create_runtime", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_public_plba_package_exports_runtime_builder_and_worker_contract:imports", - "span_start": 349, - "span_end": 349, - "lexical_rank": 6, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e93f80075cd9988737ece3cb5ec659c542132c4d383646e376917bfd0cb6ea64", - "edge_type": "imports", - "src_symbol_id": "ed06ffc5afb8a863cf7da3e40921f17abe4eec2a0770139e3380d93ccaae604a", - "src_qname": "test_public_plba_package_exports_runtime_builder_and_worker_contract", - "dst_symbol_id": null, - "dst_ref": "plba.create_runtime", - "resolution": "partial", - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_runtime.py", - "content": "test_public_plba_package_exports_runtime_builder_and_worker_contract calls create_runtime", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_public_plba_package_exports_runtime_builder_and_worker_contract:calls", - "span_start": 399, - "span_end": 399, - "lexical_rank": 6, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "039939355230de826d8bf7607f55fc59c7d932e5570ecb78994d0f13e57e8488", - "edge_type": "calls", - "src_symbol_id": "ed06ffc5afb8a863cf7da3e40921f17abe4eec2a0770139e3380d93ccaae604a", - "src_qname": "test_public_plba_package_exports_runtime_builder_and_worker_contract", - "dst_symbol_id": null, - "dst_ref": "create_runtime", - "resolution": "partial", - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "test_worker_wakes_up_with_configured_interval\n -> ScenarioWorker\n -> ScenarioWorker.__init__\n -> ScenarioWorker._name\n -> ScenarioWorker.name", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_worker_wakes_up_with_configured_interval:dataflow_slice", - "span_start": 52, - "span_end": 166, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 5, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "2fd137f5852febe907f44d3b3e4ea430f89ccfe962ae1442a16ab9df64c8f76c", - "edge_type": "dataflow_slice", - "src_symbol_id": "65f877f78191d65e6a752e41cedc70ebc784c266804a55c1c56440336e1f0d6e", - "src_qname": "test_worker_wakes_up_with_configured_interval", - "dst_symbol_id": "da022da2c49fd9cfd09d6e6da6bbd59aaa7d28efd669ce8444e88d327ddec2fc", - "dst_ref": "ScenarioWorker.name", - "resolution": "resolved", - "slice_id": "2fd137f5852febe907f44d3b3e4ea430f89ccfe962ae1442a16ab9df64c8f76c", - "root_symbol_id": "65f877f78191d65e6a752e41cedc70ebc784c266804a55c1c56440336e1f0d6e", - "path_symbols": [ - "test_worker_wakes_up_with_configured_interval", - "ScenarioWorker", - "ScenarioWorker.__init__", - "ScenarioWorker._name", - "ScenarioWorker.name" - ], - "path_symbol_ids": [ - "65f877f78191d65e6a752e41cedc70ebc784c266804a55c1c56440336e1f0d6e", - "9a1d08a7eb1831c9f2e0db361b5207f036e477c160773ae08c0b287239785c52", - "9c20be046ba06644d1432e0f20eb223663d2b116ee7d91fdc62bc68323f2e593", - "da022da2c49fd9cfd09d6e6da6bbd59aaa7d28efd669ce8444e88d327ddec2fc" - ], - "path_edge_types": [ - "instantiates", - "writes_attr", - "reads_attr" - ], - "path_length": 5, - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "test_actions_stop_busy_worker_after_timeout\n -> BlockingRoutine\n -> BlockingRoutine.__init__\n -> BlockingRoutine._started\n -> BlockingRoutine.run", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_actions_stop_busy_worker_after_timeout:dataflow_slice", - "span_start": 42, - "span_end": 238, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 5, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "8e7db3d2a9226f1c1d9942ac6373cfcafa0d2276758ddb8a3d3c455a3d58024d", - "edge_type": "dataflow_slice", - "src_symbol_id": "66392d3222421d9ba16eda3554940b16e7d5a6f33aa08c5738d35af2e32f1e4a", - "src_qname": "test_actions_stop_busy_worker_after_timeout", - "dst_symbol_id": "d9841bdbb69706c988ae7ae6adf89928dc4fae45943f74064f5382177034ba04", - "dst_ref": "BlockingRoutine.run", - "resolution": "resolved", - "slice_id": "8e7db3d2a9226f1c1d9942ac6373cfcafa0d2276758ddb8a3d3c455a3d58024d", - "root_symbol_id": "66392d3222421d9ba16eda3554940b16e7d5a6f33aa08c5738d35af2e32f1e4a", - "path_symbols": [ - "test_actions_stop_busy_worker_after_timeout", - "BlockingRoutine", - "BlockingRoutine.__init__", - "BlockingRoutine._started", - "BlockingRoutine.run" - ], - "path_symbol_ids": [ - "66392d3222421d9ba16eda3554940b16e7d5a6f33aa08c5738d35af2e32f1e4a", - "a3349c5bc65e4003a4bbd6a8dbb7a54c337e12d1aed930caa701b12e520f1e67", - "486deeed3043c6db985aef258e96ddc67aa53608e67a83962fbd2471f649ddf1", - "d9841bdbb69706c988ae7ae6adf89928dc4fae45943f74064f5382177034ba04" - ], - "path_edge_types": [ - "instantiates", - "writes_attr", - "reads_attr" - ], - "path_length": 5, - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "test_actions_stop_busy_worker_after_timeout\n -> BlockingRoutine\n -> BlockingRoutine.__init__\n -> BlockingRoutine._release\n -> BlockingRoutine.run", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_actions_stop_busy_worker_after_timeout:dataflow_slice", - "span_start": 43, - "span_end": 238, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 5, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "b59da9da82f9dfc8a9b695a08213786385da1ae9e17561ec3a0450a574a8cb39", - "edge_type": "dataflow_slice", - "src_symbol_id": "66392d3222421d9ba16eda3554940b16e7d5a6f33aa08c5738d35af2e32f1e4a", - "src_qname": "test_actions_stop_busy_worker_after_timeout", - "dst_symbol_id": "d9841bdbb69706c988ae7ae6adf89928dc4fae45943f74064f5382177034ba04", - "dst_ref": "BlockingRoutine.run", - "resolution": "resolved", - "slice_id": "b59da9da82f9dfc8a9b695a08213786385da1ae9e17561ec3a0450a574a8cb39", - "root_symbol_id": "66392d3222421d9ba16eda3554940b16e7d5a6f33aa08c5738d35af2e32f1e4a", - "path_symbols": [ - "test_actions_stop_busy_worker_after_timeout", - "BlockingRoutine", - "BlockingRoutine.__init__", - "BlockingRoutine._release", - "BlockingRoutine.run" - ], - "path_symbol_ids": [ - "66392d3222421d9ba16eda3554940b16e7d5a6f33aa08c5738d35af2e32f1e4a", - "a3349c5bc65e4003a4bbd6a8dbb7a54c337e12d1aed930caa701b12e520f1e67", - "486deeed3043c6db985aef258e96ddc67aa53608e67a83962fbd2471f649ddf1", - "d9841bdbb69706c988ae7ae6adf89928dc4fae45943f74064f5382177034ba04" - ], - "path_edge_types": [ - "instantiates", - "writes_attr", - "reads_attr" - ], - "path_length": 5, - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "test_actions_stop_busy_worker_before_timeout\n -> BlockingRoutine\n -> BlockingRoutine.__init__\n -> BlockingRoutine._started\n -> BlockingRoutine.run", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_actions_stop_busy_worker_before_timeout:dataflow_slice", - "span_start": 42, - "span_end": 212, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 5, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "f9bcce108870e49afa8b32d4625115a10707a3b0e7473179e958e5752bf258b4", - "edge_type": "dataflow_slice", - "src_symbol_id": "a0bb116ca9d909c93a285667ae033fbd1859b2dad7cf34fcb44816393ef6909c", - "src_qname": "test_actions_stop_busy_worker_before_timeout", - "dst_symbol_id": "d9841bdbb69706c988ae7ae6adf89928dc4fae45943f74064f5382177034ba04", - "dst_ref": "BlockingRoutine.run", - "resolution": "resolved", - "slice_id": "f9bcce108870e49afa8b32d4625115a10707a3b0e7473179e958e5752bf258b4", - "root_symbol_id": "a0bb116ca9d909c93a285667ae033fbd1859b2dad7cf34fcb44816393ef6909c", - "path_symbols": [ - "test_actions_stop_busy_worker_before_timeout", - "BlockingRoutine", - "BlockingRoutine.__init__", - "BlockingRoutine._started", - "BlockingRoutine.run" - ], - "path_symbol_ids": [ - "a0bb116ca9d909c93a285667ae033fbd1859b2dad7cf34fcb44816393ef6909c", - "a3349c5bc65e4003a4bbd6a8dbb7a54c337e12d1aed930caa701b12e520f1e67", - "486deeed3043c6db985aef258e96ddc67aa53608e67a83962fbd2471f649ddf1", - "d9841bdbb69706c988ae7ae6adf89928dc4fae45943f74064f5382177034ba04" - ], - "path_edge_types": [ - "instantiates", - "writes_attr", - "reads_attr" - ], - "path_length": 5, - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_runtime.py", - "content": "def test_public_plba_package_exports_runtime_builder_and_worker_contract(tmp_path) -> None:\n import plba\n from plba import ApplicationModule as PublicApplicationModule\n from plba import InMemoryTaskQueue\n from plba import Worker as PublicWorker\n from plba import WorkerHealth as PublicWorkerHealth\n from plba import WorkerStatus as PublicWorkerStatus\n from plba import create_runtime\n\n config_path = tmp_path / \"config.yml\"\n config_path.write_text(\"platform: {}\\n\", encoding=\"utf-8\")\n\n queue = InMemoryTaskQueue[int]()\n queue.put(2)\n assert queue.get(timeout=0.01) == 2\n queue.task_done()\n\n class PublicRoutine:\n def __init__(self) -> None:\n self.runs = 0\n\n def run(self) -> None:\n if self.runs == 0:\n self.runs += 1\n\n class PublicWorkerImpl(PublicWorker):\n def __init__(self, routine: PublicRoutine) -> None:\n self._inner = RoutineWorker(\"public-worker\", routine)\n\n @property\n def name(self) -> str:\n return self._inner.name\n\n @property\n def critical(self) -> bool:\n return self._inner.critical\n\n def start(self) -> None:\n self._inner.start()\n\n def stop(self, force: bool = False) -> None:\n self._inner.stop(force=force)\n\n def health(self) -> PublicWorkerHealth:\n return self._inner.health()\n\n def status(self) -> PublicWorkerStatus:\n return self._inner.status()\n\n class PublicExampleModule(PublicApplicationModule):\n @property\n def name(self) -> str:\n return \"public-example\"\n\n def register(self, registry: ModuleRegistry) -> None:\n registry.add_worker(PublicWorkerImpl(PublicRoutine()))\n\n runtime = create_runtime(PublicExampleModule(), config_path=str(config_path))\n runtime.start()\n sleep(0.2)\n assert runtime.configuration.get() == {\"platform\": {}}\n assert runtime.status()[\"workers\"][\"registered\"] == 1\n assert hasattr(plba, \"QueueWorker\") is False\n runtime.stop()", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_runtime.py:test_public_plba_package_exports_runtime_builder_and_worker_contract", - "span_start": 342, - "span_end": 405, - "lexical_rank": 6, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 13, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_runtime", - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "def _build_runtime(worker: Worker, *, control_timeout: int = 1) -> tuple[RuntimeManager, str]:\n runtime = RuntimeManager()\n channel = HttpControlChannel(host=\"127.0.0.1\", port=0, timeout=control_timeout)\n runtime.control_plane.register_channel(channel)\n runtime.register_module(WorkerModule(worker))\n runtime.start()\n return runtime, f\"http://127.0.0.1:{channel.port}\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:_build_runtime", - "span_start": 154, - "span_end": 160, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 6, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "class IntervalRoutine:\n calls: list[float] = field(default_factory=list)\n _lock: Lock = field(default_factory=Lock)\n\n def run(self) -> None:\n with self._lock:\n self.calls.append(monotonic())\n\n def wait_runs(self, count: int, timeout: float) -> bool:\n deadline = monotonic() + timeout\n while monotonic() < deadline:\n with self._lock:\n if len(self.calls) >= count:\n return True\n sleep(0.01)\n return False\n\n def deltas(self) -> list[float]:\n with self._lock:\n return [self.calls[index + 1] - self.calls[index] for index in range(len(self.calls) - 1)]", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:IntervalRoutine", - "span_start": 18, - "span_end": 37, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "class ScenarioWorker(Worker):\n def __init__(self, name: str, routine: object, *, interval: float = 0.05) -> None:\n self._name = name\n self._routine = routine\n self._interval = interval\n self._thread: Thread | None = None\n self._stop_requested = Event()\n self._in_flight = 0\n self._runs = 0\n self._lock = Lock()\n\n @property\n def name(self) -> str:\n return self._name\n\n @property\n def critical(self) -> bool:\n return True\n\n def start(self) -> None:\n if self._thread is not None and self._thread.is_alive():\n return\n self._stop_requested.clear()\n self._thread = Thread(target=self._loop, name=f\"{self._name}-thread\", daemon=True)\n self._thread.start()\n\n def stop(self, force: bool = False) -> None:\n self._stop_requested.set()\n\n def health(self) -> WorkerHealth:\n return WorkerHealth(name=self.name, status=\"ok\", critical=True, meta={\"runs\": self._runs})\n\n def status(self) -> WorkerStatus:\n thread_alive = self._thread is not None and self._thread.is_alive()\n with self._lock:\n in_flight = self._in_flight\n runs = self._runs\n if not thread_alive:\n state = \"stopped\"\n elif self._stop_requested.is_set():\n state = \"stopping\"\n elif in_flight > 0:\n state = \"busy\"\n else:\n state = \"idle\"\n return WorkerStatus(name=self.name, state=state, in_flight=in_flight, meta={\"runs\": runs})\n\n def _loop(self) -> None:\n while not self._stop_requested.is_set():\n with self._lock:\n self._in_flight += 1\n try:\n self._routine.run()\n with self._lock:\n self._runs += 1\n finally:\n with self._lock:\n self._in_flight -= 1\n if self._stop_requested.is_set():\n return\n sleep(self._interval)", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:ScenarioWorker", - "span_start": 50, - "span_end": 110, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 2, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "def _http_call_json(\n base_url: str,\n path: str,\n *,\n method: str = \"GET\",\n headers: dict[str, str] | None = None,\n) -> tuple[int, dict[str, object]]:\n request = Request(f\"{base_url}{path}\", method=method, headers=headers or {})\n try:\n with urlopen(request, timeout=15.0) as response:\n status = response.status\n body = response.read()\n except HTTPError as error:\n status = error.code\n body = error.read()\n payload = json.loads(body.decode(\"utf-8\"))\n return status, payload", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:_http_call_json", - "span_start": 125, - "span_end": 141, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 4, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "def _poll_until_stopped(base_url: str, timeout: float = 2.0) -> bool:\n deadline = monotonic() + timeout\n while monotonic() < deadline:\n _, payload = _http_call_json(base_url, \"/actions/status\")\n if payload.get(\"detail\") == \"stopped\":\n return True\n sleep(0.05)\n return False", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:_poll_until_stopped", - "span_start": 144, - "span_end": 151, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 5, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "def test_worker_wakes_up_with_configured_interval() -> None:\n interval = 0.15\n routine = IntervalRoutine()\n worker = ScenarioWorker(\"interval-worker\", routine, interval=interval)\n runtime = RuntimeManager()\n runtime.register_module(WorkerModule(worker))\n\n runtime.start()\n try:\n assert routine.wait_runs(count=3, timeout=2.0) is True\n finally:\n runtime.stop()\n\n deltas = routine.deltas()\n assert len(deltas) >= 2\n assert all(delta >= interval * 0.7 for delta in deltas[:2])", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:test_worker_wakes_up_with_configured_interval", - "span_start": 163, - "span_end": 178, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 7, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "class WorkerModule(ApplicationModule):\n def __init__(self, worker: Worker) -> None:\n self._worker = worker\n\n @property\n def name(self) -> str:\n return \"business-tests\"\n\n def register(self, registry: ModuleRegistry) -> None:\n registry.add_worker(self._worker)", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:WorkerModule", - "span_start": 113, - "span_end": 122, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 3, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "class BlockingRoutine:\n def __init__(self, started: Event, release: Event) -> None:\n self._started = started\n self._release = release\n\n def run(self) -> None:\n self._started.set()\n self._release.wait(timeout=5.0)", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:BlockingRoutine", - "span_start": 40, - "span_end": 47, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 1, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "def test_actions_start_stop_and_health_when_worker_is_idle() -> None:\n runtime, base_url = _build_runtime(ScenarioWorker(\"idle-worker\", IntervalRoutine(), interval=0.2))\n try:\n stop_status, stop_payload = _http_call_json(base_url, \"/actions/stop\", method=\"POST\")\n assert stop_status == 200\n assert isinstance(stop_payload.get(\"detail\"), dict)\n assert stop_payload[\"detail\"][\"timed_out\"] is False\n assert stop_payload[\"detail\"][\"state\"] == \"stopped\"\n\n health_stopped_status, health_stopped_payload = _http_call_json(base_url, \"/health\")\n assert health_stopped_status == 503\n assert health_stopped_payload[\"state\"] == \"stopped\"\n assert health_stopped_payload[\"status\"] == \"unhealthy\"\n\n start_status, start_payload = _http_call_json(base_url, \"/actions/start\", method=\"POST\")\n assert start_status == 200\n assert isinstance(start_payload.get(\"detail\"), dict)\n assert start_payload[\"detail\"][\"timed_out\"] is False\n assert start_payload[\"detail\"][\"state\"] in {\"idle\", \"busy\"}\n\n health_started_status, health_started_payload = _http_call_json(base_url, \"/health\")\n assert health_started_status == 200\n assert health_started_payload[\"status\"] == \"ok\"\n assert health_started_payload[\"state\"] in {\"idle\", \"busy\"}\n finally:\n runtime.stop()", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:test_actions_start_stop_and_health_when_worker_is_idle", - "span_start": 181, - "span_end": 206, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 8, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "llm_answer": "1. Прямые тесты:\n - tests/test_runtime.py | test_public_plba_package_exports_runtime_builder_and_worker_contract\n - Проверка: импорты и вызов функции create_runtime.\n - Видны пробелы покрытия: отсутствуют проверки непосредственно созданного runtime.\n\n2. Косвенные или ближайшие тесты:\n - tests/test_business_control_actions.py | _build_runtime\n - Проверка: функция _build_runtime использует create_runtime в своем потоке зависимостей.\n\n3. Что именно проверяется:\n - В direct test проверяется доступность и работоспособность функции create_runtime через её импорт и вызов.\n - В indirect test проверяется использование create_runtime внутри другой функции.\n\n4. Пробелы покрытия:\n - Прямое тестирование runtime-сущности отсутствует.\n - Нет тестирования поведения или свойств созданного runtime.", - "summary": { - "router": { - "intent": "CODE_QA", - "sub_intent": "FIND_TESTS", - "confidence": null - }, - "retrieval": { - "profile": "code", - "layers_hit": [ - "C0_SOURCE_CHUNKS", - "C2_DEPENDENCY_GRAPH" - ], - "evidence_sufficient": true - }, - "llm": { - "answer_status": "answered", - "groundedness": "grounded" - } - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "FIND_TESTS", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ], - "symbol_kind_hint": "function", - "symbol_candidates": [ - "create_runtime" - ], - "keyword_hints": [ - "create_runtime" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**", - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "test_file_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "test_symbol_patterns": [ - "test_create_runtime", - "Testcreate_runtime", - "create_runtime" - ], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C0_SOURCE_CHUNKS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C0_SOURCE_CHUNKS": 10 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [], - "include_globs": [ - "src", - "tests" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests" - ] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src", - "tests" - ], - "include_globs": [ - "src", - "tests" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests" - ] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src", - "tests" - ], - "include_globs": [ - "src", - "tests" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests" - ] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "create_runtime", - "path_scope": [], - "include_globs": [ - "src/**", - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "Где тесты для create_runtime? test_create_runtime Testcreate_runtime create_runtime", - "path_scope": [], - "include_globs": [ - "src/**", - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "top_k": 6, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Где тесты для create_runtime? test_create_runtime Testcreate_runtime create_runtime", - "path_scope": [], - "include_globs": [ - "src/**", - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "top_k": 10, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [], - "normalized_include_globs": [ - "src", - "tests" - ], - "normalized_exclude_globs": [], - "normalized_prefer_globs": [ - "tests" - ], - "filter_stage": "post_rank", - "candidates_before_filter": 0, - "candidates_after_filter": 0 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src", - "tests" - ], - "normalized_include_globs": [ - "src", - "tests" - ], - "normalized_exclude_globs": [], - "normalized_prefer_globs": [ - "tests" - ], - "filter_stage": "post_rank", - "candidates_before_filter": 6, - "candidates_after_filter": 6 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src", - "tests" - ], - "normalized_include_globs": [ - "src", - "tests" - ], - "normalized_exclude_globs": [], - "normalized_prefer_globs": [ - "tests" - ], - "filter_stage": "post_rank", - "candidates_before_filter": 10, - "candidates_after_filter": 10 - } - ], - "fallback": { - "used": true, - "reason": "scope_relaxed_no_hits" - }, - "symbol_resolution": { - "status": "not_found", - "resolved_symbol": null, - "alternatives": [ - "create_runtime" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "miss", - "hit_count": 0, - "fail_reason": "scope_relaxed_no_hits" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 6, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 10, - "fail_reason": null - } - ] - }, - "constraint_violations": [ - { - "type": "LAYER_MISSING", - "severity": "warn", - "details": { - "layer": "C1_SYMBOL_CATALOG", - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ] - }, - "suggested_fix": "Increase top_k for this layer or relax constraints for retrieval." - } - ], - "timings_ms": { - "router": 0, - "symbol_resolution": 0, - "retrieval_total": 102, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 40, - "C2_DEPENDENCY_GRAPH": 47, - "C0_SOURCE_CHUNKS": 14 - }, - "merge_rank": 0, - "prompt_build": 0, - "llm_call": 1409 - }, - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 980, - "evidence_rows": 16, - "evidence_chars": 9185 - }, - "evidence_summary": [ - { - "layer": "C2_DEPENDENCY_GRAPH", - "count": 6, - "unique_paths": 2 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 10, - "unique_paths": 2 - } - ], - "prompt_template_id": "intent_code_qa_find_tests_ru_v2", - "system_prompt_version": "v1" - }, - "router": { - "conversation_mode": "START", - "keyword_hints": [ - "create_runtime" - ], - "path_scope": [] - }, - "llm": { - "used_evidence_count": 16, - "missing_evidence_reason": null - } - }, - "run_info": { - "case_id": "plba-v2-find-tests-create-runtime", - "mode": "full_chain", - "run_started_at": "2026-03-12T13:23:57", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - }, - "input_request": { - "text": "Где тесты для create_runtime?", - "normalized_query": "Где тесты для create_runtime?" - }, - "steps": [ - { - "step": "intent_router", - "input": { - "query": "Где тесты для create_runtime?" - }, - "output": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Где тесты для create_runtime?" - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "FIND_TESTS", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ], - "symbol_kind_hint": "function", - "symbol_candidates": [ - "create_runtime" - ], - "keyword_hints": [ - "create_runtime" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**", - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "test_file_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "test_symbol_patterns": [ - "test_create_runtime", - "Testcreate_runtime", - "create_runtime" - ], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "timings_ms": { - "router": 0 - } - } - }, - { - "step": "retrieval", - "input": { - "query": "Где тесты для create_runtime?" - }, - "output": { - "symbol_resolution": { - "status": "not_found", - "resolved_symbol": null, - "alternatives": [ - "create_runtime" - ], - "confidence": 0.0 - }, - "rag_count": 16, - "rag_rows": [ - { - "path": "tests/test_runtime.py", - "content": "test_public_plba_package_exports_runtime_builder_and_worker_contract imports plba.create_runtime", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_public_plba_package_exports_runtime_builder_and_worker_contract:imports", - "span_start": 349, - "span_end": 349, - "lexical_rank": 6, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e93f80075cd9988737ece3cb5ec659c542132c4d383646e376917bfd0cb6ea64", - "edge_type": "imports", - "src_symbol_id": "ed06ffc5afb8a863cf7da3e40921f17abe4eec2a0770139e3380d93ccaae604a", - "src_qname": "test_public_plba_package_exports_runtime_builder_and_worker_contract", - "dst_symbol_id": null, - "dst_ref": "plba.create_runtime", - "resolution": "partial", - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_runtime.py", - "content": "test_public_plba_package_exports_runtime_builder_and_worker_contract calls create_runtime", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_public_plba_package_exports_runtime_builder_and_worker_contract:calls", - "span_start": 399, - "span_end": 399, - "lexical_rank": 6, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "039939355230de826d8bf7607f55fc59c7d932e5570ecb78994d0f13e57e8488", - "edge_type": "calls", - "src_symbol_id": "ed06ffc5afb8a863cf7da3e40921f17abe4eec2a0770139e3380d93ccaae604a", - "src_qname": "test_public_plba_package_exports_runtime_builder_and_worker_contract", - "dst_symbol_id": null, - "dst_ref": "create_runtime", - "resolution": "partial", - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "test_worker_wakes_up_with_configured_interval\n -> ScenarioWorker\n -> ScenarioWorker.__init__\n -> ScenarioWorker._name\n -> ScenarioWorker.name", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_worker_wakes_up_with_configured_interval:dataflow_slice", - "span_start": 52, - "span_end": 166, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 5, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "2fd137f5852febe907f44d3b3e4ea430f89ccfe962ae1442a16ab9df64c8f76c", - "edge_type": "dataflow_slice", - "src_symbol_id": "65f877f78191d65e6a752e41cedc70ebc784c266804a55c1c56440336e1f0d6e", - "src_qname": "test_worker_wakes_up_with_configured_interval", - "dst_symbol_id": "da022da2c49fd9cfd09d6e6da6bbd59aaa7d28efd669ce8444e88d327ddec2fc", - "dst_ref": "ScenarioWorker.name", - "resolution": "resolved", - "slice_id": "2fd137f5852febe907f44d3b3e4ea430f89ccfe962ae1442a16ab9df64c8f76c", - "root_symbol_id": "65f877f78191d65e6a752e41cedc70ebc784c266804a55c1c56440336e1f0d6e", - "path_symbols": [ - "test_worker_wakes_up_with_configured_interval", - "ScenarioWorker", - "ScenarioWorker.__init__", - "ScenarioWorker._name", - "ScenarioWorker.name" - ], - "path_symbol_ids": [ - "65f877f78191d65e6a752e41cedc70ebc784c266804a55c1c56440336e1f0d6e", - "9a1d08a7eb1831c9f2e0db361b5207f036e477c160773ae08c0b287239785c52", - "9c20be046ba06644d1432e0f20eb223663d2b116ee7d91fdc62bc68323f2e593", - "da022da2c49fd9cfd09d6e6da6bbd59aaa7d28efd669ce8444e88d327ddec2fc" - ], - "path_edge_types": [ - "instantiates", - "writes_attr", - "reads_attr" - ], - "path_length": 5, - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "test_actions_stop_busy_worker_after_timeout\n -> BlockingRoutine\n -> BlockingRoutine.__init__\n -> BlockingRoutine._started\n -> BlockingRoutine.run", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_actions_stop_busy_worker_after_timeout:dataflow_slice", - "span_start": 42, - "span_end": 238, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 5, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "8e7db3d2a9226f1c1d9942ac6373cfcafa0d2276758ddb8a3d3c455a3d58024d", - "edge_type": "dataflow_slice", - "src_symbol_id": "66392d3222421d9ba16eda3554940b16e7d5a6f33aa08c5738d35af2e32f1e4a", - "src_qname": "test_actions_stop_busy_worker_after_timeout", - "dst_symbol_id": "d9841bdbb69706c988ae7ae6adf89928dc4fae45943f74064f5382177034ba04", - "dst_ref": "BlockingRoutine.run", - "resolution": "resolved", - "slice_id": "8e7db3d2a9226f1c1d9942ac6373cfcafa0d2276758ddb8a3d3c455a3d58024d", - "root_symbol_id": "66392d3222421d9ba16eda3554940b16e7d5a6f33aa08c5738d35af2e32f1e4a", - "path_symbols": [ - "test_actions_stop_busy_worker_after_timeout", - "BlockingRoutine", - "BlockingRoutine.__init__", - "BlockingRoutine._started", - "BlockingRoutine.run" - ], - "path_symbol_ids": [ - "66392d3222421d9ba16eda3554940b16e7d5a6f33aa08c5738d35af2e32f1e4a", - "a3349c5bc65e4003a4bbd6a8dbb7a54c337e12d1aed930caa701b12e520f1e67", - "486deeed3043c6db985aef258e96ddc67aa53608e67a83962fbd2471f649ddf1", - "d9841bdbb69706c988ae7ae6adf89928dc4fae45943f74064f5382177034ba04" - ], - "path_edge_types": [ - "instantiates", - "writes_attr", - "reads_attr" - ], - "path_length": 5, - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "test_actions_stop_busy_worker_after_timeout\n -> BlockingRoutine\n -> BlockingRoutine.__init__\n -> BlockingRoutine._release\n -> BlockingRoutine.run", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_actions_stop_busy_worker_after_timeout:dataflow_slice", - "span_start": 43, - "span_end": 238, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 5, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "b59da9da82f9dfc8a9b695a08213786385da1ae9e17561ec3a0450a574a8cb39", - "edge_type": "dataflow_slice", - "src_symbol_id": "66392d3222421d9ba16eda3554940b16e7d5a6f33aa08c5738d35af2e32f1e4a", - "src_qname": "test_actions_stop_busy_worker_after_timeout", - "dst_symbol_id": "d9841bdbb69706c988ae7ae6adf89928dc4fae45943f74064f5382177034ba04", - "dst_ref": "BlockingRoutine.run", - "resolution": "resolved", - "slice_id": "b59da9da82f9dfc8a9b695a08213786385da1ae9e17561ec3a0450a574a8cb39", - "root_symbol_id": "66392d3222421d9ba16eda3554940b16e7d5a6f33aa08c5738d35af2e32f1e4a", - "path_symbols": [ - "test_actions_stop_busy_worker_after_timeout", - "BlockingRoutine", - "BlockingRoutine.__init__", - "BlockingRoutine._release", - "BlockingRoutine.run" - ], - "path_symbol_ids": [ - "66392d3222421d9ba16eda3554940b16e7d5a6f33aa08c5738d35af2e32f1e4a", - "a3349c5bc65e4003a4bbd6a8dbb7a54c337e12d1aed930caa701b12e520f1e67", - "486deeed3043c6db985aef258e96ddc67aa53608e67a83962fbd2471f649ddf1", - "d9841bdbb69706c988ae7ae6adf89928dc4fae45943f74064f5382177034ba04" - ], - "path_edge_types": [ - "instantiates", - "writes_attr", - "reads_attr" - ], - "path_length": 5, - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "test_actions_stop_busy_worker_before_timeout\n -> BlockingRoutine\n -> BlockingRoutine.__init__\n -> BlockingRoutine._started\n -> BlockingRoutine.run", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_actions_stop_busy_worker_before_timeout:dataflow_slice", - "span_start": 42, - "span_end": 212, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 5, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "f9bcce108870e49afa8b32d4625115a10707a3b0e7473179e958e5752bf258b4", - "edge_type": "dataflow_slice", - "src_symbol_id": "a0bb116ca9d909c93a285667ae033fbd1859b2dad7cf34fcb44816393ef6909c", - "src_qname": "test_actions_stop_busy_worker_before_timeout", - "dst_symbol_id": "d9841bdbb69706c988ae7ae6adf89928dc4fae45943f74064f5382177034ba04", - "dst_ref": "BlockingRoutine.run", - "resolution": "resolved", - "slice_id": "f9bcce108870e49afa8b32d4625115a10707a3b0e7473179e958e5752bf258b4", - "root_symbol_id": "a0bb116ca9d909c93a285667ae033fbd1859b2dad7cf34fcb44816393ef6909c", - "path_symbols": [ - "test_actions_stop_busy_worker_before_timeout", - "BlockingRoutine", - "BlockingRoutine.__init__", - "BlockingRoutine._started", - "BlockingRoutine.run" - ], - "path_symbol_ids": [ - "a0bb116ca9d909c93a285667ae033fbd1859b2dad7cf34fcb44816393ef6909c", - "a3349c5bc65e4003a4bbd6a8dbb7a54c337e12d1aed930caa701b12e520f1e67", - "486deeed3043c6db985aef258e96ddc67aa53608e67a83962fbd2471f649ddf1", - "d9841bdbb69706c988ae7ae6adf89928dc4fae45943f74064f5382177034ba04" - ], - "path_edge_types": [ - "instantiates", - "writes_attr", - "reads_attr" - ], - "path_length": 5, - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_runtime.py", - "content": "def test_public_plba_package_exports_runtime_builder_and_worker_contract(tmp_path) -> None:\n import plba\n from plba import ApplicationModule as PublicApplicationModule\n from plba import InMemoryTaskQueue\n from plba import Worker as PublicWorker\n from plba import WorkerHealth as PublicWorkerHealth\n from plba import WorkerStatus as PublicWorkerStatus\n from plba import create_runtime\n\n config_path = tmp_path / \"config.yml\"\n config_path.write_text(\"platform: {}\\n\", encoding=\"utf-8\")\n\n queue = InMemoryTaskQueue[int]()\n queue.put(2)\n assert queue.get(timeout=0.01) == 2\n queue.task_done()\n\n class PublicRoutine:\n def __init__(self) -> None:\n self.runs = 0\n\n def run(self) -> None:\n if self.runs == 0:\n self.runs += 1\n\n class PublicWorkerImpl(PublicWorker):\n def __init__(self, routine: PublicRoutine) -> None:\n self._inner = RoutineWorker(\"public-worker\", routine)\n\n @property\n def name(self) -> str:\n return self._inner.name\n\n @property\n def critical(self) -> bool:\n return self._inner.critical\n\n def start(self) -> None:\n self._inner.start()\n\n def stop(self, force: bool = False) -> None:\n self._inner.stop(force=force)\n\n def health(self) -> PublicWorkerHealth:\n return self._inner.health()\n\n def status(self) -> PublicWorkerStatus:\n return self._inner.status()\n\n class PublicExampleModule(PublicApplicationModule):\n @property\n def name(self) -> str:\n return \"public-example\"\n\n def register(self, registry: ModuleRegistry) -> None:\n registry.add_worker(PublicWorkerImpl(PublicRoutine()))\n\n runtime = create_runtime(PublicExampleModule(), config_path=str(config_path))\n runtime.start()\n sleep(0.2)\n assert runtime.configuration.get() == {\"platform\": {}}\n assert runtime.status()[\"workers\"][\"registered\"] == 1\n assert hasattr(plba, \"QueueWorker\") is False\n runtime.stop()", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_runtime.py:test_public_plba_package_exports_runtime_builder_and_worker_contract", - "span_start": 342, - "span_end": 405, - "lexical_rank": 6, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 13, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_runtime", - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "def _build_runtime(worker: Worker, *, control_timeout: int = 1) -> tuple[RuntimeManager, str]:\n runtime = RuntimeManager()\n channel = HttpControlChannel(host=\"127.0.0.1\", port=0, timeout=control_timeout)\n runtime.control_plane.register_channel(channel)\n runtime.register_module(WorkerModule(worker))\n runtime.start()\n return runtime, f\"http://127.0.0.1:{channel.port}\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:_build_runtime", - "span_start": 154, - "span_end": 160, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 6, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "class IntervalRoutine:\n calls: list[float] = field(default_factory=list)\n _lock: Lock = field(default_factory=Lock)\n\n def run(self) -> None:\n with self._lock:\n self.calls.append(monotonic())\n\n def wait_runs(self, count: int, timeout: float) -> bool:\n deadline = monotonic() + timeout\n while monotonic() < deadline:\n with self._lock:\n if len(self.calls) >= count:\n return True\n sleep(0.01)\n return False\n\n def deltas(self) -> list[float]:\n with self._lock:\n return [self.calls[index + 1] - self.calls[index] for index in range(len(self.calls) - 1)]", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:IntervalRoutine", - "span_start": 18, - "span_end": 37, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "class ScenarioWorker(Worker):\n def __init__(self, name: str, routine: object, *, interval: float = 0.05) -> None:\n self._name = name\n self._routine = routine\n self._interval = interval\n self._thread: Thread | None = None\n self._stop_requested = Event()\n self._in_flight = 0\n self._runs = 0\n self._lock = Lock()\n\n @property\n def name(self) -> str:\n return self._name\n\n @property\n def critical(self) -> bool:\n return True\n\n def start(self) -> None:\n if self._thread is not None and self._thread.is_alive():\n return\n self._stop_requested.clear()\n self._thread = Thread(target=self._loop, name=f\"{self._name}-thread\", daemon=True)\n self._thread.start()\n\n def stop(self, force: bool = False) -> None:\n self._stop_requested.set()\n\n def health(self) -> WorkerHealth:\n return WorkerHealth(name=self.name, status=\"ok\", critical=True, meta={\"runs\": self._runs})\n\n def status(self) -> WorkerStatus:\n thread_alive = self._thread is not None and self._thread.is_alive()\n with self._lock:\n in_flight = self._in_flight\n runs = self._runs\n if not thread_alive:\n state = \"stopped\"\n elif self._stop_requested.is_set():\n state = \"stopping\"\n elif in_flight > 0:\n state = \"busy\"\n else:\n state = \"idle\"\n return WorkerStatus(name=self.name, state=state, in_flight=in_flight, meta={\"runs\": runs})\n\n def _loop(self) -> None:\n while not self._stop_requested.is_set():\n with self._lock:\n self._in_flight += 1\n try:\n self._routine.run()\n with self._lock:\n self._runs += 1\n finally:\n with self._lock:\n self._in_flight -= 1\n if self._stop_requested.is_set():\n return\n sleep(self._interval)", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:ScenarioWorker", - "span_start": 50, - "span_end": 110, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 2, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "def _http_call_json(\n base_url: str,\n path: str,\n *,\n method: str = \"GET\",\n headers: dict[str, str] | None = None,\n) -> tuple[int, dict[str, object]]:\n request = Request(f\"{base_url}{path}\", method=method, headers=headers or {})\n try:\n with urlopen(request, timeout=15.0) as response:\n status = response.status\n body = response.read()\n except HTTPError as error:\n status = error.code\n body = error.read()\n payload = json.loads(body.decode(\"utf-8\"))\n return status, payload", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:_http_call_json", - "span_start": 125, - "span_end": 141, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 4, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "def _poll_until_stopped(base_url: str, timeout: float = 2.0) -> bool:\n deadline = monotonic() + timeout\n while monotonic() < deadline:\n _, payload = _http_call_json(base_url, \"/actions/status\")\n if payload.get(\"detail\") == \"stopped\":\n return True\n sleep(0.05)\n return False", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:_poll_until_stopped", - "span_start": 144, - "span_end": 151, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 5, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "def test_worker_wakes_up_with_configured_interval() -> None:\n interval = 0.15\n routine = IntervalRoutine()\n worker = ScenarioWorker(\"interval-worker\", routine, interval=interval)\n runtime = RuntimeManager()\n runtime.register_module(WorkerModule(worker))\n\n runtime.start()\n try:\n assert routine.wait_runs(count=3, timeout=2.0) is True\n finally:\n runtime.stop()\n\n deltas = routine.deltas()\n assert len(deltas) >= 2\n assert all(delta >= interval * 0.7 for delta in deltas[:2])", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:test_worker_wakes_up_with_configured_interval", - "span_start": 163, - "span_end": 178, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 7, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "class WorkerModule(ApplicationModule):\n def __init__(self, worker: Worker) -> None:\n self._worker = worker\n\n @property\n def name(self) -> str:\n return \"business-tests\"\n\n def register(self, registry: ModuleRegistry) -> None:\n registry.add_worker(self._worker)", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:WorkerModule", - "span_start": 113, - "span_end": 122, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 3, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "class BlockingRoutine:\n def __init__(self, started: Event, release: Event) -> None:\n self._started = started\n self._release = release\n\n def run(self) -> None:\n self._started.set()\n self._release.wait(timeout=5.0)", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:BlockingRoutine", - "span_start": 40, - "span_end": 47, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 1, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "def test_actions_start_stop_and_health_when_worker_is_idle() -> None:\n runtime, base_url = _build_runtime(ScenarioWorker(\"idle-worker\", IntervalRoutine(), interval=0.2))\n try:\n stop_status, stop_payload = _http_call_json(base_url, \"/actions/stop\", method=\"POST\")\n assert stop_status == 200\n assert isinstance(stop_payload.get(\"detail\"), dict)\n assert stop_payload[\"detail\"][\"timed_out\"] is False\n assert stop_payload[\"detail\"][\"state\"] == \"stopped\"\n\n health_stopped_status, health_stopped_payload = _http_call_json(base_url, \"/health\")\n assert health_stopped_status == 503\n assert health_stopped_payload[\"state\"] == \"stopped\"\n assert health_stopped_payload[\"status\"] == \"unhealthy\"\n\n start_status, start_payload = _http_call_json(base_url, \"/actions/start\", method=\"POST\")\n assert start_status == 200\n assert isinstance(start_payload.get(\"detail\"), dict)\n assert start_payload[\"detail\"][\"timed_out\"] is False\n assert start_payload[\"detail\"][\"state\"] in {\"idle\", \"busy\"}\n\n health_started_status, health_started_payload = _http_call_json(base_url, \"/health\")\n assert health_started_status == 200\n assert health_started_payload[\"status\"] == \"ok\"\n assert health_started_payload[\"state\"] in {\"idle\", \"busy\"}\n finally:\n runtime.stop()", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:test_actions_start_stop_and_health_when_worker_is_idle", - "span_start": 181, - "span_end": 206, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 8, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ] - }, - "diagnostics": { - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C0_SOURCE_CHUNKS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C0_SOURCE_CHUNKS": 10 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [], - "include_globs": [ - "src", - "tests" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests" - ] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src", - "tests" - ], - "include_globs": [ - "src", - "tests" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests" - ] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src", - "tests" - ], - "include_globs": [ - "src", - "tests" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests" - ] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "create_runtime", - "path_scope": [], - "include_globs": [ - "src/**", - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "Где тесты для create_runtime? test_create_runtime Testcreate_runtime create_runtime", - "path_scope": [], - "include_globs": [ - "src/**", - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "top_k": 6, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Где тесты для create_runtime? test_create_runtime Testcreate_runtime create_runtime", - "path_scope": [], - "include_globs": [ - "src/**", - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "top_k": 10, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [], - "normalized_include_globs": [ - "src", - "tests" - ], - "normalized_exclude_globs": [], - "normalized_prefer_globs": [ - "tests" - ], - "filter_stage": "post_rank", - "candidates_before_filter": 0, - "candidates_after_filter": 0 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src", - "tests" - ], - "normalized_include_globs": [ - "src", - "tests" - ], - "normalized_exclude_globs": [], - "normalized_prefer_globs": [ - "tests" - ], - "filter_stage": "post_rank", - "candidates_before_filter": 6, - "candidates_after_filter": 6 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src", - "tests" - ], - "normalized_include_globs": [ - "src", - "tests" - ], - "normalized_exclude_globs": [], - "normalized_prefer_globs": [ - "tests" - ], - "filter_stage": "post_rank", - "candidates_before_filter": 10, - "candidates_after_filter": 10 - } - ], - "fallback": { - "used": true, - "reason": "scope_relaxed_no_hits" - }, - "symbol_resolution": { - "status": "not_found", - "resolved_symbol": null, - "alternatives": [ - "create_runtime" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "miss", - "hit_count": 0, - "fail_reason": "scope_relaxed_no_hits" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 6, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 10, - "fail_reason": null - } - ] - }, - "constraint_violations": [ - { - "type": "LAYER_MISSING", - "severity": "warn", - "details": { - "layer": "C1_SYMBOL_CATALOG", - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ] - }, - "suggested_fix": "Increase top_k for this layer or relax constraints for retrieval." - } - ], - "timings_ms": { - "symbol_resolution": 0, - "retrieval_total": 102, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 40, - "C2_DEPENDENCY_GRAPH": 47, - "C0_SOURCE_CHUNKS": 14 - }, - "merge_rank": 0 - } - } - }, - { - "step": "llm_answer", - "input": { - "query": "Где тесты для create_runtime?", - "rag_count": 16 - }, - "output": { - "llm_answer": "1. Прямые тесты:\n - tests/test_runtime.py | test_public_plba_package_exports_runtime_builder_and_worker_contract\n - Проверка: импорты и вызов функции create_runtime.\n - Видны пробелы покрытия: отсутствуют проверки непосредственно созданного runtime.\n\n2. Косвенные или ближайшие тесты:\n - tests/test_business_control_actions.py | _build_runtime\n - Проверка: функция _build_runtime использует create_runtime в своем потоке зависимостей.\n\n3. Что именно проверяется:\n - В direct test проверяется доступность и работоспособность функции create_runtime через её импорт и вызов.\n - В indirect test проверяется использование create_runtime внутри другой функции.\n\n4. Пробелы покрытия:\n - Прямое тестирование runtime-сущности отсутствует.\n - Нет тестирования поведения или свойств созданного runtime." - }, - "diagnostics": { - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 980, - "evidence_rows": 16, - "evidence_chars": 9185 - }, - "evidence_summary": [ - { - "layer": "C2_DEPENDENCY_GRAPH", - "count": 6, - "unique_paths": 2 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 10, - "unique_paths": 2 - } - ], - "prompt_template_id": "intent_code_qa_find_tests_ru_v2", - "system_prompt_version": "v1" - }, - "timings_ms": { - "prompt_build": 0, - "llm_call": 1409 - } - } - } - ] - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_132357/full_chain_plba_code_subintents_v2_plba-v2-find-tests-create-runtime.md b/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_132357/full_chain_plba_code_subintents_v2_plba-v2-find-tests-create-runtime.md deleted file mode 100644 index 435607a..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_132357/full_chain_plba_code_subintents_v2_plba-v2-find-tests-create-runtime.md +++ /dev/null @@ -1,32 +0,0 @@ -# plba-v2-find-tests-create-runtime - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_subintents_v2.yaml -- runner: runtime -- mode: full_chain -- passed: True - -## Query -Где тесты для create_runtime? - -## Actual -{ - "intent": "CODE_QA", - "sub_intent": "FIND_TESTS", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 16, - "llm_answer": "1. Прямые тесты:\n - tests/test_runtime.py | test_public_plba_package_exports_runtime_builder_and_worker_contract\n - Проверка: импорты и вызов функции create_runtime.\n - Видны пробелы покрытия: отсутствуют проверки непосредственно созданного runtime.\n\n2. Косвенные или ближайшие тесты:\n - tests/test_business_control_actions.py | _build_runtime\n - Проверка: функция _build_runtime использует create_runtime в своем потоке зависимостей.\n\n3. Что именно проверяется:\n - В direct test проверяется доступность и работоспособность функции create_runtime через её импорт и вызов.\n - В indirect test проверяется использование create_runtime внутри другой функции.\n\n4. Пробелы покрытия:\n - Прямое тестирование runtime-сущности отсутствует.\n - Нет тестирования поведения или свойств созданного runtime.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "create_runtime" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ] -} - -## Mismatches -- none \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_132357/full_chain_plba_code_subintents_v2_plba-v2-find-tests-runtime-manager.json b/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_132357/full_chain_plba_code_subintents_v2_plba-v2-find-tests-runtime-manager.json deleted file mode 100644 index f7706ff..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_132357/full_chain_plba_code_subintents_v2_plba-v2-find-tests-runtime-manager.json +++ /dev/null @@ -1,1879 +0,0 @@ -{ - "case_id": "plba-v2-find-tests-runtime-manager", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_subintents_v2.yaml", - "runner": "runtime", - "mode": "full_chain", - "actual": { - "intent": "CODE_QA", - "sub_intent": "FIND_TESTS", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 16, - "llm_answer": "1. Прямые тесты:\n - tests/test_runtime.py | test_runtime_runs_worker_routine_and_exposes_status\n - tests/test_runtime.py | test_runtime_graceful_stop_waits_until_worker_finishes\n \n2. Косвенные или ближайшие тесты:\n - tests/test_business_control_actions.py | _build_runtime\n - tests/test_business_control_actions.py | test_worker_wakes_up_with_configured_interval\n\n3. Что именно проверяется:\n - test_runtime_runs_worker_routine_and_exposes_status проверяет запуск рабочего потока, регистрацию модуля и получение статуса выполнения.\n - test_runtime_graceful_stop_waits_until_worker_finishes проверяет корректную остановку рабочего процесса и изменение состояния runtime после остановки.\n - tests/test_business_control_actions.py содержит косвенные тесты через инстанцирование RuntimeManager в методах _build_runtime и test_worker_wakes_up_with_configured_interval.\n\n4. Пробелы покрытия:\n - Прямое покрытие отсутствует для других аспектов работы RuntimeManager, таких как обработка ошибок, работа с конфигурацией, интеграция с внешними сервисами и т.д. Требуются дополнительные тесты для этих случаев.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "RuntimeManager" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ] - }, - "passed": true, - "mismatches": [], - "details": { - "case_id": "plba-v2-find-tests-runtime-manager", - "text": "Где тесты для RuntimeManager?", - "mode": "full_chain", - "run_started_at": "2026-03-12T13:23:57", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Где тесты для RuntimeManager?", - "symbol_resolution": { - "status": "not_found", - "resolved_symbol": null, - "alternatives": [ - "RuntimeManager" - ], - "confidence": 0.0 - }, - "rag_count": 16, - "rag_rows": [ - { - "path": "tests/test_runtime.py", - "content": "test_runtime_runs_worker_routine_and_exposes_status instantiates RuntimeManager", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_runtime_runs_worker_routine_and_exposes_status:instantiates", - "span_start": 209, - "span_end": 209, - "lexical_rank": 6, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "c397a308e7824ba9fe400a754c7e15e66ea6f058d7f5d3e82bb002bb78b509d2", - "edge_type": "instantiates", - "src_symbol_id": "1c767eb5ee08e84f45b18c8ed7531ec0ed73c63fb1594823569672db7b21e992", - "src_qname": "test_runtime_runs_worker_routine_and_exposes_status", - "dst_symbol_id": "aeadc039653807b0da1ca6e3cc1078ee61cfc510b28e7f9c2ec04c59da43cc8d", - "dst_ref": "RuntimeManager", - "resolution": "resolved", - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_runtime.py", - "content": "test_runtime_graceful_stop_waits_until_worker_finishes instantiates RuntimeManager", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_runtime_graceful_stop_waits_until_worker_finishes:instantiates", - "span_start": 229, - "span_end": 229, - "lexical_rank": 6, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "76b4701262ccaa0a7a41691407c4ebdb2ca74a2415d89f0a38ef0d4f608bda93", - "edge_type": "instantiates", - "src_symbol_id": "1076e788e4a03b10d7bc1313a8ad46caa170c13cc026c6e4de994af1a6ae57bf", - "src_qname": "test_runtime_graceful_stop_waits_until_worker_finishes", - "dst_symbol_id": "aeadc039653807b0da1ca6e3cc1078ee61cfc510b28e7f9c2ec04c59da43cc8d", - "dst_ref": "RuntimeManager", - "resolution": "resolved", - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "_build_runtime instantiates RuntimeManager", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "_build_runtime:instantiates", - "span_start": 155, - "span_end": 155, - "lexical_rank": 6, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "7eb254d564944bab6272757ee5ef688862bd321e6941e2495dc942e03b1c9a25", - "edge_type": "instantiates", - "src_symbol_id": "db94031d5245bf82be836a109b4584b43b8e83d37a0f318e03f6c8191896d469", - "src_qname": "_build_runtime", - "dst_symbol_id": "a1572ea8183dc0cd6ddbc74342bbde8c28cecfde37ad40b62feff09f8d103d11", - "dst_ref": "RuntimeManager", - "resolution": "resolved", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "test_worker_wakes_up_with_configured_interval instantiates RuntimeManager", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_worker_wakes_up_with_configured_interval:instantiates", - "span_start": 167, - "span_end": 167, - "lexical_rank": 6, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "189aafc4de0b79c688668f25f0c87166a127df26bd2215452014713b65ef281a", - "edge_type": "instantiates", - "src_symbol_id": "65f877f78191d65e6a752e41cedc70ebc784c266804a55c1c56440336e1f0d6e", - "src_qname": "test_worker_wakes_up_with_configured_interval", - "dst_symbol_id": "a1572ea8183dc0cd6ddbc74342bbde8c28cecfde37ad40b62feff09f8d103d11", - "dst_ref": "RuntimeManager", - "resolution": "resolved", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "test_actions_stop_busy_worker_after_timeout\n -> BlockingRoutine\n -> BlockingRoutine.__init__\n -> BlockingRoutine._started\n -> BlockingRoutine.run", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_actions_stop_busy_worker_after_timeout:dataflow_slice", - "span_start": 42, - "span_end": 238, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 5, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "8e7db3d2a9226f1c1d9942ac6373cfcafa0d2276758ddb8a3d3c455a3d58024d", - "edge_type": "dataflow_slice", - "src_symbol_id": "66392d3222421d9ba16eda3554940b16e7d5a6f33aa08c5738d35af2e32f1e4a", - "src_qname": "test_actions_stop_busy_worker_after_timeout", - "dst_symbol_id": "d9841bdbb69706c988ae7ae6adf89928dc4fae45943f74064f5382177034ba04", - "dst_ref": "BlockingRoutine.run", - "resolution": "resolved", - "slice_id": "8e7db3d2a9226f1c1d9942ac6373cfcafa0d2276758ddb8a3d3c455a3d58024d", - "root_symbol_id": "66392d3222421d9ba16eda3554940b16e7d5a6f33aa08c5738d35af2e32f1e4a", - "path_symbols": [ - "test_actions_stop_busy_worker_after_timeout", - "BlockingRoutine", - "BlockingRoutine.__init__", - "BlockingRoutine._started", - "BlockingRoutine.run" - ], - "path_symbol_ids": [ - "66392d3222421d9ba16eda3554940b16e7d5a6f33aa08c5738d35af2e32f1e4a", - "a3349c5bc65e4003a4bbd6a8dbb7a54c337e12d1aed930caa701b12e520f1e67", - "486deeed3043c6db985aef258e96ddc67aa53608e67a83962fbd2471f649ddf1", - "d9841bdbb69706c988ae7ae6adf89928dc4fae45943f74064f5382177034ba04" - ], - "path_edge_types": [ - "instantiates", - "writes_attr", - "reads_attr" - ], - "path_length": 5, - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "test_actions_stop_busy_worker_before_timeout\n -> BlockingRoutine\n -> BlockingRoutine.__init__\n -> BlockingRoutine._release\n -> BlockingRoutine.run", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_actions_stop_busy_worker_before_timeout:dataflow_slice", - "span_start": 43, - "span_end": 212, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 5, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "8bd726155ba387d3579763ee84dfd2f9a90bc917da88f3b2e89416ab5c1254d6", - "edge_type": "dataflow_slice", - "src_symbol_id": "a0bb116ca9d909c93a285667ae033fbd1859b2dad7cf34fcb44816393ef6909c", - "src_qname": "test_actions_stop_busy_worker_before_timeout", - "dst_symbol_id": "d9841bdbb69706c988ae7ae6adf89928dc4fae45943f74064f5382177034ba04", - "dst_ref": "BlockingRoutine.run", - "resolution": "resolved", - "slice_id": "8bd726155ba387d3579763ee84dfd2f9a90bc917da88f3b2e89416ab5c1254d6", - "root_symbol_id": "a0bb116ca9d909c93a285667ae033fbd1859b2dad7cf34fcb44816393ef6909c", - "path_symbols": [ - "test_actions_stop_busy_worker_before_timeout", - "BlockingRoutine", - "BlockingRoutine.__init__", - "BlockingRoutine._release", - "BlockingRoutine.run" - ], - "path_symbol_ids": [ - "a0bb116ca9d909c93a285667ae033fbd1859b2dad7cf34fcb44816393ef6909c", - "a3349c5bc65e4003a4bbd6a8dbb7a54c337e12d1aed930caa701b12e520f1e67", - "486deeed3043c6db985aef258e96ddc67aa53608e67a83962fbd2471f649ddf1", - "d9841bdbb69706c988ae7ae6adf89928dc4fae45943f74064f5382177034ba04" - ], - "path_edge_types": [ - "instantiates", - "writes_attr", - "reads_attr" - ], - "path_length": 5, - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_runtime.py", - "content": "def test_runtime_graceful_stop_waits_until_worker_finishes() -> None:\n started = Event()\n release = Event()\n runtime = RuntimeManager()\n runtime.register_module(BlockingModule(started, release))\n runtime.start()\n assert started.wait(timeout=1.0) is True\n assert runtime.status()[\"runtime\"][\"state\"] == \"busy\"\n\n stop_thread = Thread(target=runtime.stop, kwargs={\"timeout\": 1.0}, daemon=True)\n stop_thread.start()\n sleep(0.1)\n assert stop_thread.is_alive() is True\n\n release.set()\n stop_thread.join(timeout=1.0)\n assert stop_thread.is_alive() is False\n assert runtime.status()[\"runtime\"][\"state\"] == \"stopped\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_runtime.py:test_runtime_graceful_stop_waits_until_worker_finishes", - "span_start": 226, - "span_end": 243, - "lexical_rank": 6, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 8, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_runtime", - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_runtime.py", - "content": "def test_runtime_runs_worker_routine_and_exposes_status(tmp_path) -> None:\n config_path = tmp_path / \"config.yml\"\n config_path.write_text(\n \"\"\"\nplatform:\n workers: 1\nlog:\n version: 1\n disable_existing_loggers: false\n handlers:\n console:\n class: logging.StreamHandler\n root:\n level: INFO\n handlers: [console]\n\"\"\".strip(),\n encoding=\"utf-8\",\n )\n runtime = RuntimeManager()\n runtime.add_config_file(config_path)\n module = ExampleModule()\n runtime.register_module(module)\n\n runtime.start()\n sleep(0.2)\n status = runtime.status()\n runtime.stop()\n\n assert module.routine.processed == [{\"id\": 1}]\n assert status[\"modules\"] == [\"example\"]\n assert status[\"runtime\"][\"state\"] == \"idle\"\n assert status[\"health\"][\"status\"] == \"ok\"\n assert status[\"config\"] == {\"platform\": {\"workers\": 1}, \"log\": status[\"config\"][\"log\"]}", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_runtime.py:test_runtime_runs_worker_routine_and_exposes_status", - "span_start": 191, - "span_end": 223, - "lexical_rank": 6, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 7, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_runtime", - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "def _build_runtime(worker: Worker, *, control_timeout: int = 1) -> tuple[RuntimeManager, str]:\n runtime = RuntimeManager()\n channel = HttpControlChannel(host=\"127.0.0.1\", port=0, timeout=control_timeout)\n runtime.control_plane.register_channel(channel)\n runtime.register_module(WorkerModule(worker))\n runtime.start()\n return runtime, f\"http://127.0.0.1:{channel.port}\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:_build_runtime", - "span_start": 154, - "span_end": 160, - "lexical_rank": 6, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 6, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "def test_worker_wakes_up_with_configured_interval() -> None:\n interval = 0.15\n routine = IntervalRoutine()\n worker = ScenarioWorker(\"interval-worker\", routine, interval=interval)\n runtime = RuntimeManager()\n runtime.register_module(WorkerModule(worker))\n\n runtime.start()\n try:\n assert routine.wait_runs(count=3, timeout=2.0) is True\n finally:\n runtime.stop()\n\n deltas = routine.deltas()\n assert len(deltas) >= 2\n assert all(delta >= interval * 0.7 for delta in deltas[:2])", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:test_worker_wakes_up_with_configured_interval", - "span_start": 163, - "span_end": 178, - "lexical_rank": 6, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 7, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "class BlockingRoutine:\n def __init__(self, started: Event, release: Event) -> None:\n self._started = started\n self._release = release\n\n def run(self) -> None:\n self._started.set()\n self._release.wait(timeout=5.0)", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:BlockingRoutine", - "span_start": 40, - "span_end": 47, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 1, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "class ScenarioWorker(Worker):\n def __init__(self, name: str, routine: object, *, interval: float = 0.05) -> None:\n self._name = name\n self._routine = routine\n self._interval = interval\n self._thread: Thread | None = None\n self._stop_requested = Event()\n self._in_flight = 0\n self._runs = 0\n self._lock = Lock()\n\n @property\n def name(self) -> str:\n return self._name\n\n @property\n def critical(self) -> bool:\n return True\n\n def start(self) -> None:\n if self._thread is not None and self._thread.is_alive():\n return\n self._stop_requested.clear()\n self._thread = Thread(target=self._loop, name=f\"{self._name}-thread\", daemon=True)\n self._thread.start()\n\n def stop(self, force: bool = False) -> None:\n self._stop_requested.set()\n\n def health(self) -> WorkerHealth:\n return WorkerHealth(name=self.name, status=\"ok\", critical=True, meta={\"runs\": self._runs})\n\n def status(self) -> WorkerStatus:\n thread_alive = self._thread is not None and self._thread.is_alive()\n with self._lock:\n in_flight = self._in_flight\n runs = self._runs\n if not thread_alive:\n state = \"stopped\"\n elif self._stop_requested.is_set():\n state = \"stopping\"\n elif in_flight > 0:\n state = \"busy\"\n else:\n state = \"idle\"\n return WorkerStatus(name=self.name, state=state, in_flight=in_flight, meta={\"runs\": runs})\n\n def _loop(self) -> None:\n while not self._stop_requested.is_set():\n with self._lock:\n self._in_flight += 1\n try:\n self._routine.run()\n with self._lock:\n self._runs += 1\n finally:\n with self._lock:\n self._in_flight -= 1\n if self._stop_requested.is_set():\n return\n sleep(self._interval)", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:ScenarioWorker", - "span_start": 50, - "span_end": 110, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 2, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "class WorkerModule(ApplicationModule):\n def __init__(self, worker: Worker) -> None:\n self._worker = worker\n\n @property\n def name(self) -> str:\n return \"business-tests\"\n\n def register(self, registry: ModuleRegistry) -> None:\n registry.add_worker(self._worker)", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:WorkerModule", - "span_start": 113, - "span_end": 122, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 3, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "def _http_call_json(\n base_url: str,\n path: str,\n *,\n method: str = \"GET\",\n headers: dict[str, str] | None = None,\n) -> tuple[int, dict[str, object]]:\n request = Request(f\"{base_url}{path}\", method=method, headers=headers or {})\n try:\n with urlopen(request, timeout=15.0) as response:\n status = response.status\n body = response.read()\n except HTTPError as error:\n status = error.code\n body = error.read()\n payload = json.loads(body.decode(\"utf-8\"))\n return status, payload", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:_http_call_json", - "span_start": 125, - "span_end": 141, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 4, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "class IntervalRoutine:\n calls: list[float] = field(default_factory=list)\n _lock: Lock = field(default_factory=Lock)\n\n def run(self) -> None:\n with self._lock:\n self.calls.append(monotonic())\n\n def wait_runs(self, count: int, timeout: float) -> bool:\n deadline = monotonic() + timeout\n while monotonic() < deadline:\n with self._lock:\n if len(self.calls) >= count:\n return True\n sleep(0.01)\n return False\n\n def deltas(self) -> list[float]:\n with self._lock:\n return [self.calls[index + 1] - self.calls[index] for index in range(len(self.calls) - 1)]", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:IntervalRoutine", - "span_start": 18, - "span_end": 37, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "def _poll_until_stopped(base_url: str, timeout: float = 2.0) -> bool:\n deadline = monotonic() + timeout\n while monotonic() < deadline:\n _, payload = _http_call_json(base_url, \"/actions/status\")\n if payload.get(\"detail\") == \"stopped\":\n return True\n sleep(0.05)\n return False", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:_poll_until_stopped", - "span_start": 144, - "span_end": 151, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 5, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "llm_answer": "1. Прямые тесты:\n - tests/test_runtime.py | test_runtime_runs_worker_routine_and_exposes_status\n - tests/test_runtime.py | test_runtime_graceful_stop_waits_until_worker_finishes\n \n2. Косвенные или ближайшие тесты:\n - tests/test_business_control_actions.py | _build_runtime\n - tests/test_business_control_actions.py | test_worker_wakes_up_with_configured_interval\n\n3. Что именно проверяется:\n - test_runtime_runs_worker_routine_and_exposes_status проверяет запуск рабочего потока, регистрацию модуля и получение статуса выполнения.\n - test_runtime_graceful_stop_waits_until_worker_finishes проверяет корректную остановку рабочего процесса и изменение состояния runtime после остановки.\n - tests/test_business_control_actions.py содержит косвенные тесты через инстанцирование RuntimeManager в методах _build_runtime и test_worker_wakes_up_with_configured_interval.\n\n4. Пробелы покрытия:\n - Прямое покрытие отсутствует для других аспектов работы RuntimeManager, таких как обработка ошибок, работа с конфигурацией, интеграция с внешними сервисами и т.д. Требуются дополнительные тесты для этих случаев.", - "summary": { - "router": { - "intent": "CODE_QA", - "sub_intent": "FIND_TESTS", - "confidence": null - }, - "retrieval": { - "profile": "code", - "layers_hit": [ - "C0_SOURCE_CHUNKS", - "C2_DEPENDENCY_GRAPH" - ], - "evidence_sufficient": true - }, - "llm": { - "answer_status": "answered", - "groundedness": "grounded" - } - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "FIND_TESTS", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "RuntimeManager" - ], - "keyword_hints": [ - "RuntimeManager" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**", - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "test_file_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "test_symbol_patterns": [ - "test_runtime_manager", - "TestRuntimeManager", - "RuntimeManager" - ], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C0_SOURCE_CHUNKS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C0_SOURCE_CHUNKS": 10 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [], - "include_globs": [ - "src", - "tests" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests" - ] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src", - "tests" - ], - "include_globs": [ - "src", - "tests" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests" - ] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src", - "tests" - ], - "include_globs": [ - "src", - "tests" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests" - ] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**", - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "Где тесты для RuntimeManager? test_runtime_manager TestRuntimeManager RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**", - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "top_k": 6, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Где тесты для RuntimeManager? test_runtime_manager TestRuntimeManager RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**", - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "top_k": 10, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [], - "normalized_include_globs": [ - "src", - "tests" - ], - "normalized_exclude_globs": [], - "normalized_prefer_globs": [ - "tests" - ], - "filter_stage": "post_rank", - "candidates_before_filter": 0, - "candidates_after_filter": 0 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src", - "tests" - ], - "normalized_include_globs": [ - "src", - "tests" - ], - "normalized_exclude_globs": [], - "normalized_prefer_globs": [ - "tests" - ], - "filter_stage": "post_rank", - "candidates_before_filter": 6, - "candidates_after_filter": 6 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src", - "tests" - ], - "normalized_include_globs": [ - "src", - "tests" - ], - "normalized_exclude_globs": [], - "normalized_prefer_globs": [ - "tests" - ], - "filter_stage": "post_rank", - "candidates_before_filter": 10, - "candidates_after_filter": 10 - } - ], - "fallback": { - "used": true, - "reason": "scope_relaxed_no_hits" - }, - "symbol_resolution": { - "status": "not_found", - "resolved_symbol": null, - "alternatives": [ - "RuntimeManager" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "miss", - "hit_count": 0, - "fail_reason": "scope_relaxed_no_hits" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 6, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 10, - "fail_reason": null - } - ] - }, - "constraint_violations": [ - { - "type": "LAYER_MISSING", - "severity": "warn", - "details": { - "layer": "C1_SYMBOL_CATALOG", - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ] - }, - "suggested_fix": "Increase top_k for this layer or relax constraints for retrieval." - } - ], - "timings_ms": { - "router": 1, - "symbol_resolution": 0, - "retrieval_total": 153, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 80, - "C2_DEPENDENCY_GRAPH": 56, - "C0_SOURCE_CHUNKS": 17 - }, - "merge_rank": 0, - "prompt_build": 0, - "llm_call": 2116 - }, - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 904, - "evidence_rows": 16, - "evidence_chars": 7086 - }, - "evidence_summary": [ - { - "layer": "C2_DEPENDENCY_GRAPH", - "count": 6, - "unique_paths": 2 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 10, - "unique_paths": 2 - } - ], - "prompt_template_id": "intent_code_qa_find_tests_ru_v2", - "system_prompt_version": "v1" - }, - "router": { - "conversation_mode": "START", - "keyword_hints": [ - "RuntimeManager" - ], - "path_scope": [] - }, - "llm": { - "used_evidence_count": 16, - "missing_evidence_reason": null - } - }, - "run_info": { - "case_id": "plba-v2-find-tests-runtime-manager", - "mode": "full_chain", - "run_started_at": "2026-03-12T13:23:57", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - }, - "input_request": { - "text": "Где тесты для RuntimeManager?", - "normalized_query": "Где тесты для RuntimeManager?" - }, - "steps": [ - { - "step": "intent_router", - "input": { - "query": "Где тесты для RuntimeManager?" - }, - "output": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Где тесты для RuntimeManager?" - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "FIND_TESTS", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "RuntimeManager" - ], - "keyword_hints": [ - "RuntimeManager" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**", - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "test_file_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "test_symbol_patterns": [ - "test_runtime_manager", - "TestRuntimeManager", - "RuntimeManager" - ], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "timings_ms": { - "router": 1 - } - } - }, - { - "step": "retrieval", - "input": { - "query": "Где тесты для RuntimeManager?" - }, - "output": { - "symbol_resolution": { - "status": "not_found", - "resolved_symbol": null, - "alternatives": [ - "RuntimeManager" - ], - "confidence": 0.0 - }, - "rag_count": 16, - "rag_rows": [ - { - "path": "tests/test_runtime.py", - "content": "test_runtime_runs_worker_routine_and_exposes_status instantiates RuntimeManager", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_runtime_runs_worker_routine_and_exposes_status:instantiates", - "span_start": 209, - "span_end": 209, - "lexical_rank": 6, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "c397a308e7824ba9fe400a754c7e15e66ea6f058d7f5d3e82bb002bb78b509d2", - "edge_type": "instantiates", - "src_symbol_id": "1c767eb5ee08e84f45b18c8ed7531ec0ed73c63fb1594823569672db7b21e992", - "src_qname": "test_runtime_runs_worker_routine_and_exposes_status", - "dst_symbol_id": "aeadc039653807b0da1ca6e3cc1078ee61cfc510b28e7f9c2ec04c59da43cc8d", - "dst_ref": "RuntimeManager", - "resolution": "resolved", - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_runtime.py", - "content": "test_runtime_graceful_stop_waits_until_worker_finishes instantiates RuntimeManager", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_runtime_graceful_stop_waits_until_worker_finishes:instantiates", - "span_start": 229, - "span_end": 229, - "lexical_rank": 6, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "76b4701262ccaa0a7a41691407c4ebdb2ca74a2415d89f0a38ef0d4f608bda93", - "edge_type": "instantiates", - "src_symbol_id": "1076e788e4a03b10d7bc1313a8ad46caa170c13cc026c6e4de994af1a6ae57bf", - "src_qname": "test_runtime_graceful_stop_waits_until_worker_finishes", - "dst_symbol_id": "aeadc039653807b0da1ca6e3cc1078ee61cfc510b28e7f9c2ec04c59da43cc8d", - "dst_ref": "RuntimeManager", - "resolution": "resolved", - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "_build_runtime instantiates RuntimeManager", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "_build_runtime:instantiates", - "span_start": 155, - "span_end": 155, - "lexical_rank": 6, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "7eb254d564944bab6272757ee5ef688862bd321e6941e2495dc942e03b1c9a25", - "edge_type": "instantiates", - "src_symbol_id": "db94031d5245bf82be836a109b4584b43b8e83d37a0f318e03f6c8191896d469", - "src_qname": "_build_runtime", - "dst_symbol_id": "a1572ea8183dc0cd6ddbc74342bbde8c28cecfde37ad40b62feff09f8d103d11", - "dst_ref": "RuntimeManager", - "resolution": "resolved", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "test_worker_wakes_up_with_configured_interval instantiates RuntimeManager", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_worker_wakes_up_with_configured_interval:instantiates", - "span_start": 167, - "span_end": 167, - "lexical_rank": 6, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "189aafc4de0b79c688668f25f0c87166a127df26bd2215452014713b65ef281a", - "edge_type": "instantiates", - "src_symbol_id": "65f877f78191d65e6a752e41cedc70ebc784c266804a55c1c56440336e1f0d6e", - "src_qname": "test_worker_wakes_up_with_configured_interval", - "dst_symbol_id": "a1572ea8183dc0cd6ddbc74342bbde8c28cecfde37ad40b62feff09f8d103d11", - "dst_ref": "RuntimeManager", - "resolution": "resolved", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "test_actions_stop_busy_worker_after_timeout\n -> BlockingRoutine\n -> BlockingRoutine.__init__\n -> BlockingRoutine._started\n -> BlockingRoutine.run", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_actions_stop_busy_worker_after_timeout:dataflow_slice", - "span_start": 42, - "span_end": 238, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 5, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "8e7db3d2a9226f1c1d9942ac6373cfcafa0d2276758ddb8a3d3c455a3d58024d", - "edge_type": "dataflow_slice", - "src_symbol_id": "66392d3222421d9ba16eda3554940b16e7d5a6f33aa08c5738d35af2e32f1e4a", - "src_qname": "test_actions_stop_busy_worker_after_timeout", - "dst_symbol_id": "d9841bdbb69706c988ae7ae6adf89928dc4fae45943f74064f5382177034ba04", - "dst_ref": "BlockingRoutine.run", - "resolution": "resolved", - "slice_id": "8e7db3d2a9226f1c1d9942ac6373cfcafa0d2276758ddb8a3d3c455a3d58024d", - "root_symbol_id": "66392d3222421d9ba16eda3554940b16e7d5a6f33aa08c5738d35af2e32f1e4a", - "path_symbols": [ - "test_actions_stop_busy_worker_after_timeout", - "BlockingRoutine", - "BlockingRoutine.__init__", - "BlockingRoutine._started", - "BlockingRoutine.run" - ], - "path_symbol_ids": [ - "66392d3222421d9ba16eda3554940b16e7d5a6f33aa08c5738d35af2e32f1e4a", - "a3349c5bc65e4003a4bbd6a8dbb7a54c337e12d1aed930caa701b12e520f1e67", - "486deeed3043c6db985aef258e96ddc67aa53608e67a83962fbd2471f649ddf1", - "d9841bdbb69706c988ae7ae6adf89928dc4fae45943f74064f5382177034ba04" - ], - "path_edge_types": [ - "instantiates", - "writes_attr", - "reads_attr" - ], - "path_length": 5, - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "test_actions_stop_busy_worker_before_timeout\n -> BlockingRoutine\n -> BlockingRoutine.__init__\n -> BlockingRoutine._release\n -> BlockingRoutine.run", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_actions_stop_busy_worker_before_timeout:dataflow_slice", - "span_start": 43, - "span_end": 212, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 5, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "8bd726155ba387d3579763ee84dfd2f9a90bc917da88f3b2e89416ab5c1254d6", - "edge_type": "dataflow_slice", - "src_symbol_id": "a0bb116ca9d909c93a285667ae033fbd1859b2dad7cf34fcb44816393ef6909c", - "src_qname": "test_actions_stop_busy_worker_before_timeout", - "dst_symbol_id": "d9841bdbb69706c988ae7ae6adf89928dc4fae45943f74064f5382177034ba04", - "dst_ref": "BlockingRoutine.run", - "resolution": "resolved", - "slice_id": "8bd726155ba387d3579763ee84dfd2f9a90bc917da88f3b2e89416ab5c1254d6", - "root_symbol_id": "a0bb116ca9d909c93a285667ae033fbd1859b2dad7cf34fcb44816393ef6909c", - "path_symbols": [ - "test_actions_stop_busy_worker_before_timeout", - "BlockingRoutine", - "BlockingRoutine.__init__", - "BlockingRoutine._release", - "BlockingRoutine.run" - ], - "path_symbol_ids": [ - "a0bb116ca9d909c93a285667ae033fbd1859b2dad7cf34fcb44816393ef6909c", - "a3349c5bc65e4003a4bbd6a8dbb7a54c337e12d1aed930caa701b12e520f1e67", - "486deeed3043c6db985aef258e96ddc67aa53608e67a83962fbd2471f649ddf1", - "d9841bdbb69706c988ae7ae6adf89928dc4fae45943f74064f5382177034ba04" - ], - "path_edge_types": [ - "instantiates", - "writes_attr", - "reads_attr" - ], - "path_length": 5, - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_runtime.py", - "content": "def test_runtime_graceful_stop_waits_until_worker_finishes() -> None:\n started = Event()\n release = Event()\n runtime = RuntimeManager()\n runtime.register_module(BlockingModule(started, release))\n runtime.start()\n assert started.wait(timeout=1.0) is True\n assert runtime.status()[\"runtime\"][\"state\"] == \"busy\"\n\n stop_thread = Thread(target=runtime.stop, kwargs={\"timeout\": 1.0}, daemon=True)\n stop_thread.start()\n sleep(0.1)\n assert stop_thread.is_alive() is True\n\n release.set()\n stop_thread.join(timeout=1.0)\n assert stop_thread.is_alive() is False\n assert runtime.status()[\"runtime\"][\"state\"] == \"stopped\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_runtime.py:test_runtime_graceful_stop_waits_until_worker_finishes", - "span_start": 226, - "span_end": 243, - "lexical_rank": 6, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 8, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_runtime", - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_runtime.py", - "content": "def test_runtime_runs_worker_routine_and_exposes_status(tmp_path) -> None:\n config_path = tmp_path / \"config.yml\"\n config_path.write_text(\n \"\"\"\nplatform:\n workers: 1\nlog:\n version: 1\n disable_existing_loggers: false\n handlers:\n console:\n class: logging.StreamHandler\n root:\n level: INFO\n handlers: [console]\n\"\"\".strip(),\n encoding=\"utf-8\",\n )\n runtime = RuntimeManager()\n runtime.add_config_file(config_path)\n module = ExampleModule()\n runtime.register_module(module)\n\n runtime.start()\n sleep(0.2)\n status = runtime.status()\n runtime.stop()\n\n assert module.routine.processed == [{\"id\": 1}]\n assert status[\"modules\"] == [\"example\"]\n assert status[\"runtime\"][\"state\"] == \"idle\"\n assert status[\"health\"][\"status\"] == \"ok\"\n assert status[\"config\"] == {\"platform\": {\"workers\": 1}, \"log\": status[\"config\"][\"log\"]}", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_runtime.py:test_runtime_runs_worker_routine_and_exposes_status", - "span_start": 191, - "span_end": 223, - "lexical_rank": 6, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 7, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_runtime", - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "def _build_runtime(worker: Worker, *, control_timeout: int = 1) -> tuple[RuntimeManager, str]:\n runtime = RuntimeManager()\n channel = HttpControlChannel(host=\"127.0.0.1\", port=0, timeout=control_timeout)\n runtime.control_plane.register_channel(channel)\n runtime.register_module(WorkerModule(worker))\n runtime.start()\n return runtime, f\"http://127.0.0.1:{channel.port}\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:_build_runtime", - "span_start": 154, - "span_end": 160, - "lexical_rank": 6, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 6, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "def test_worker_wakes_up_with_configured_interval() -> None:\n interval = 0.15\n routine = IntervalRoutine()\n worker = ScenarioWorker(\"interval-worker\", routine, interval=interval)\n runtime = RuntimeManager()\n runtime.register_module(WorkerModule(worker))\n\n runtime.start()\n try:\n assert routine.wait_runs(count=3, timeout=2.0) is True\n finally:\n runtime.stop()\n\n deltas = routine.deltas()\n assert len(deltas) >= 2\n assert all(delta >= interval * 0.7 for delta in deltas[:2])", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:test_worker_wakes_up_with_configured_interval", - "span_start": 163, - "span_end": 178, - "lexical_rank": 6, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 7, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "class BlockingRoutine:\n def __init__(self, started: Event, release: Event) -> None:\n self._started = started\n self._release = release\n\n def run(self) -> None:\n self._started.set()\n self._release.wait(timeout=5.0)", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:BlockingRoutine", - "span_start": 40, - "span_end": 47, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 1, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "class ScenarioWorker(Worker):\n def __init__(self, name: str, routine: object, *, interval: float = 0.05) -> None:\n self._name = name\n self._routine = routine\n self._interval = interval\n self._thread: Thread | None = None\n self._stop_requested = Event()\n self._in_flight = 0\n self._runs = 0\n self._lock = Lock()\n\n @property\n def name(self) -> str:\n return self._name\n\n @property\n def critical(self) -> bool:\n return True\n\n def start(self) -> None:\n if self._thread is not None and self._thread.is_alive():\n return\n self._stop_requested.clear()\n self._thread = Thread(target=self._loop, name=f\"{self._name}-thread\", daemon=True)\n self._thread.start()\n\n def stop(self, force: bool = False) -> None:\n self._stop_requested.set()\n\n def health(self) -> WorkerHealth:\n return WorkerHealth(name=self.name, status=\"ok\", critical=True, meta={\"runs\": self._runs})\n\n def status(self) -> WorkerStatus:\n thread_alive = self._thread is not None and self._thread.is_alive()\n with self._lock:\n in_flight = self._in_flight\n runs = self._runs\n if not thread_alive:\n state = \"stopped\"\n elif self._stop_requested.is_set():\n state = \"stopping\"\n elif in_flight > 0:\n state = \"busy\"\n else:\n state = \"idle\"\n return WorkerStatus(name=self.name, state=state, in_flight=in_flight, meta={\"runs\": runs})\n\n def _loop(self) -> None:\n while not self._stop_requested.is_set():\n with self._lock:\n self._in_flight += 1\n try:\n self._routine.run()\n with self._lock:\n self._runs += 1\n finally:\n with self._lock:\n self._in_flight -= 1\n if self._stop_requested.is_set():\n return\n sleep(self._interval)", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:ScenarioWorker", - "span_start": 50, - "span_end": 110, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 2, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "class WorkerModule(ApplicationModule):\n def __init__(self, worker: Worker) -> None:\n self._worker = worker\n\n @property\n def name(self) -> str:\n return \"business-tests\"\n\n def register(self, registry: ModuleRegistry) -> None:\n registry.add_worker(self._worker)", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:WorkerModule", - "span_start": 113, - "span_end": 122, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 3, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "def _http_call_json(\n base_url: str,\n path: str,\n *,\n method: str = \"GET\",\n headers: dict[str, str] | None = None,\n) -> tuple[int, dict[str, object]]:\n request = Request(f\"{base_url}{path}\", method=method, headers=headers or {})\n try:\n with urlopen(request, timeout=15.0) as response:\n status = response.status\n body = response.read()\n except HTTPError as error:\n status = error.code\n body = error.read()\n payload = json.loads(body.decode(\"utf-8\"))\n return status, payload", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:_http_call_json", - "span_start": 125, - "span_end": 141, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 4, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "class IntervalRoutine:\n calls: list[float] = field(default_factory=list)\n _lock: Lock = field(default_factory=Lock)\n\n def run(self) -> None:\n with self._lock:\n self.calls.append(monotonic())\n\n def wait_runs(self, count: int, timeout: float) -> bool:\n deadline = monotonic() + timeout\n while monotonic() < deadline:\n with self._lock:\n if len(self.calls) >= count:\n return True\n sleep(0.01)\n return False\n\n def deltas(self) -> list[float]:\n with self._lock:\n return [self.calls[index + 1] - self.calls[index] for index in range(len(self.calls) - 1)]", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:IntervalRoutine", - "span_start": 18, - "span_end": 37, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "def _poll_until_stopped(base_url: str, timeout: float = 2.0) -> bool:\n deadline = monotonic() + timeout\n while monotonic() < deadline:\n _, payload = _http_call_json(base_url, \"/actions/status\")\n if payload.get(\"detail\") == \"stopped\":\n return True\n sleep(0.05)\n return False", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:_poll_until_stopped", - "span_start": 144, - "span_end": 151, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 5, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ] - }, - "diagnostics": { - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C0_SOURCE_CHUNKS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C0_SOURCE_CHUNKS": 10 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [], - "include_globs": [ - "src", - "tests" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests" - ] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src", - "tests" - ], - "include_globs": [ - "src", - "tests" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests" - ] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src", - "tests" - ], - "include_globs": [ - "src", - "tests" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests" - ] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**", - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "Где тесты для RuntimeManager? test_runtime_manager TestRuntimeManager RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**", - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "top_k": 6, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Где тесты для RuntimeManager? test_runtime_manager TestRuntimeManager RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**", - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "top_k": 10, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [], - "normalized_include_globs": [ - "src", - "tests" - ], - "normalized_exclude_globs": [], - "normalized_prefer_globs": [ - "tests" - ], - "filter_stage": "post_rank", - "candidates_before_filter": 0, - "candidates_after_filter": 0 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src", - "tests" - ], - "normalized_include_globs": [ - "src", - "tests" - ], - "normalized_exclude_globs": [], - "normalized_prefer_globs": [ - "tests" - ], - "filter_stage": "post_rank", - "candidates_before_filter": 6, - "candidates_after_filter": 6 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src", - "tests" - ], - "normalized_include_globs": [ - "src", - "tests" - ], - "normalized_exclude_globs": [], - "normalized_prefer_globs": [ - "tests" - ], - "filter_stage": "post_rank", - "candidates_before_filter": 10, - "candidates_after_filter": 10 - } - ], - "fallback": { - "used": true, - "reason": "scope_relaxed_no_hits" - }, - "symbol_resolution": { - "status": "not_found", - "resolved_symbol": null, - "alternatives": [ - "RuntimeManager" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "miss", - "hit_count": 0, - "fail_reason": "scope_relaxed_no_hits" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 6, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 10, - "fail_reason": null - } - ] - }, - "constraint_violations": [ - { - "type": "LAYER_MISSING", - "severity": "warn", - "details": { - "layer": "C1_SYMBOL_CATALOG", - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ] - }, - "suggested_fix": "Increase top_k for this layer or relax constraints for retrieval." - } - ], - "timings_ms": { - "symbol_resolution": 0, - "retrieval_total": 153, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 80, - "C2_DEPENDENCY_GRAPH": 56, - "C0_SOURCE_CHUNKS": 17 - }, - "merge_rank": 0 - } - } - }, - { - "step": "llm_answer", - "input": { - "query": "Где тесты для RuntimeManager?", - "rag_count": 16 - }, - "output": { - "llm_answer": "1. Прямые тесты:\n - tests/test_runtime.py | test_runtime_runs_worker_routine_and_exposes_status\n - tests/test_runtime.py | test_runtime_graceful_stop_waits_until_worker_finishes\n \n2. Косвенные или ближайшие тесты:\n - tests/test_business_control_actions.py | _build_runtime\n - tests/test_business_control_actions.py | test_worker_wakes_up_with_configured_interval\n\n3. Что именно проверяется:\n - test_runtime_runs_worker_routine_and_exposes_status проверяет запуск рабочего потока, регистрацию модуля и получение статуса выполнения.\n - test_runtime_graceful_stop_waits_until_worker_finishes проверяет корректную остановку рабочего процесса и изменение состояния runtime после остановки.\n - tests/test_business_control_actions.py содержит косвенные тесты через инстанцирование RuntimeManager в методах _build_runtime и test_worker_wakes_up_with_configured_interval.\n\n4. Пробелы покрытия:\n - Прямое покрытие отсутствует для других аспектов работы RuntimeManager, таких как обработка ошибок, работа с конфигурацией, интеграция с внешними сервисами и т.д. Требуются дополнительные тесты для этих случаев." - }, - "diagnostics": { - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 904, - "evidence_rows": 16, - "evidence_chars": 7086 - }, - "evidence_summary": [ - { - "layer": "C2_DEPENDENCY_GRAPH", - "count": 6, - "unique_paths": 2 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 10, - "unique_paths": 2 - } - ], - "prompt_template_id": "intent_code_qa_find_tests_ru_v2", - "system_prompt_version": "v1" - }, - "timings_ms": { - "prompt_build": 0, - "llm_call": 2116 - } - } - } - ] - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_132357/full_chain_plba_code_subintents_v2_plba-v2-find-tests-runtime-manager.md b/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_132357/full_chain_plba_code_subintents_v2_plba-v2-find-tests-runtime-manager.md deleted file mode 100644 index 01dd8fb..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_132357/full_chain_plba_code_subintents_v2_plba-v2-find-tests-runtime-manager.md +++ /dev/null @@ -1,32 +0,0 @@ -# plba-v2-find-tests-runtime-manager - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_subintents_v2.yaml -- runner: runtime -- mode: full_chain -- passed: True - -## Query -Где тесты для RuntimeManager? - -## Actual -{ - "intent": "CODE_QA", - "sub_intent": "FIND_TESTS", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 16, - "llm_answer": "1. Прямые тесты:\n - tests/test_runtime.py | test_runtime_runs_worker_routine_and_exposes_status\n - tests/test_runtime.py | test_runtime_graceful_stop_waits_until_worker_finishes\n \n2. Косвенные или ближайшие тесты:\n - tests/test_business_control_actions.py | _build_runtime\n - tests/test_business_control_actions.py | test_worker_wakes_up_with_configured_interval\n\n3. Что именно проверяется:\n - test_runtime_runs_worker_routine_and_exposes_status проверяет запуск рабочего потока, регистрацию модуля и получение статуса выполнения.\n - test_runtime_graceful_stop_waits_until_worker_finishes проверяет корректную остановку рабочего процесса и изменение состояния runtime после остановки.\n - tests/test_business_control_actions.py содержит косвенные тесты через инстанцирование RuntimeManager в методах _build_runtime и test_worker_wakes_up_with_configured_interval.\n\n4. Пробелы покрытия:\n - Прямое покрытие отсутствует для других аспектов работы RuntimeManager, таких как обработка ошибок, работа с конфигурацией, интеграция с внешними сервисами и т.д. Требуются дополнительные тесты для этих случаев.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "RuntimeManager" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ] -} - -## Mismatches -- none \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_132357/full_chain_plba_code_subintents_v2_plba-v2-find-tests-trace-service.json b/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_132357/full_chain_plba_code_subintents_v2_plba-v2-find-tests-trace-service.json deleted file mode 100644 index bfb131a..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_132357/full_chain_plba_code_subintents_v2_plba-v2-find-tests-trace-service.json +++ /dev/null @@ -1,2047 +0,0 @@ -{ - "case_id": "plba-v2-find-tests-trace-service", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_subintents_v2.yaml", - "runner": "runtime", - "mode": "full_chain", - "actual": { - "intent": "CODE_QA", - "sub_intent": "FIND_TESTS", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 16, - "llm_answer": "1. Прямые тесты:\n - tests/test_runtime.py | test_trace_service_writes_contexts_and_messages\n - Проверка записи контекстов и сообщений в TraceService.\n - tests/test_runtime.py | test_trace_service_supports_debug_warning_and_error_levels\n - Проверка поддержки различных уровней логирования (DEBUG, WARNING, ERROR).\n\n2. Косвенные или ближайшие тесты:\n - Нет известных косвенных тестов, которые напрямую касаются TraceService.\n\n3. Что именно проверяется:\n - Запись и обработка контекста и сообщений в TraceService.\n - Поддержка различных уровней логирования и запись соответствующих сообщений.\n\n4. Пробелы покрытия:\n - Прямого тестирования работы самого класса TraceService без привязки к транспорту нет.\n - Тестирование сценариев ошибок и исключений при работе с TraceService отсутствует.\n - Отсутствие проверки взаимодействий с внешними сервисами через транспорт.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "TraceService" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ] - }, - "passed": true, - "mismatches": [], - "details": { - "case_id": "plba-v2-find-tests-trace-service", - "text": "Где тесты для TraceService?", - "mode": "full_chain", - "run_started_at": "2026-03-12T13:23:57", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Где тесты для TraceService?", - "symbol_resolution": { - "status": "not_found", - "resolved_symbol": null, - "alternatives": [ - "TraceService" - ], - "confidence": 0.0 - }, - "rag_count": 16, - "rag_rows": [ - { - "path": "tests/test_runtime.py", - "content": "test_trace_service_writes_contexts_and_messages\n -> RecordingTransport\n -> RecordingTransport.__init__\n -> RecordingTransport.contexts\n -> test_trace_service_writes_contexts_and_messages", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_trace_service_writes_contexts_and_messages:dataflow_slice", - "span_start": 181, - "span_end": 256, - "lexical_rank": 4, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 5, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "1636a2f70dee79c804259dc114af6c1ab4db27099911e5f97ac97a2bcb59be8a", - "edge_type": "dataflow_slice", - "src_symbol_id": "1600da201da1d0150240b400e3232172354156decdd1a04e1ab1a1edcd3a7e99", - "src_qname": "test_trace_service_writes_contexts_and_messages", - "dst_symbol_id": "1600da201da1d0150240b400e3232172354156decdd1a04e1ab1a1edcd3a7e99", - "dst_ref": "test_trace_service_writes_contexts_and_messages", - "resolution": "resolved", - "slice_id": "1636a2f70dee79c804259dc114af6c1ab4db27099911e5f97ac97a2bcb59be8a", - "root_symbol_id": "1600da201da1d0150240b400e3232172354156decdd1a04e1ab1a1edcd3a7e99", - "path_symbols": [ - "test_trace_service_writes_contexts_and_messages", - "RecordingTransport", - "RecordingTransport.__init__", - "RecordingTransport.contexts", - "test_trace_service_writes_contexts_and_messages" - ], - "path_symbol_ids": [ - "1600da201da1d0150240b400e3232172354156decdd1a04e1ab1a1edcd3a7e99", - "e3d635de1f1880673b69bf73ca6a45caffa5c7fdc23d589d5e40f76b86bdcd33", - "e34d80da723a7115a7a7586b52dc8b5cfda05c581509eee0c1a0296df9a340cb", - "1600da201da1d0150240b400e3232172354156decdd1a04e1ab1a1edcd3a7e99" - ], - "path_edge_types": [ - "instantiates", - "writes_attr", - "reads_attr" - ], - "path_length": 5, - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_runtime.py", - "content": "test_trace_service_writes_contexts_and_messages\n -> RecordingTransport\n -> RecordingTransport.__init__\n -> RecordingTransport.contexts\n -> test_trace_service_allows_messages_without_status", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_trace_service_writes_contexts_and_messages:dataflow_slice", - "span_start": 181, - "span_end": 293, - "lexical_rank": 4, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 5, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "5db5abe56b73f884c5178647bd25ef150064a94a41fc8c052aebaa09bd7fdb3d", - "edge_type": "dataflow_slice", - "src_symbol_id": "1600da201da1d0150240b400e3232172354156decdd1a04e1ab1a1edcd3a7e99", - "src_qname": "test_trace_service_writes_contexts_and_messages", - "dst_symbol_id": "7127ca85ce6447928e195e901d36f1e1f1e8205a686e567c2d1b187431f989df", - "dst_ref": "test_trace_service_allows_messages_without_status", - "resolution": "resolved", - "slice_id": "5db5abe56b73f884c5178647bd25ef150064a94a41fc8c052aebaa09bd7fdb3d", - "root_symbol_id": "1600da201da1d0150240b400e3232172354156decdd1a04e1ab1a1edcd3a7e99", - "path_symbols": [ - "test_trace_service_writes_contexts_and_messages", - "RecordingTransport", - "RecordingTransport.__init__", - "RecordingTransport.contexts", - "test_trace_service_allows_messages_without_status" - ], - "path_symbol_ids": [ - "1600da201da1d0150240b400e3232172354156decdd1a04e1ab1a1edcd3a7e99", - "e3d635de1f1880673b69bf73ca6a45caffa5c7fdc23d589d5e40f76b86bdcd33", - "e34d80da723a7115a7a7586b52dc8b5cfda05c581509eee0c1a0296df9a340cb", - "7127ca85ce6447928e195e901d36f1e1f1e8205a686e567c2d1b187431f989df" - ], - "path_edge_types": [ - "instantiates", - "writes_attr", - "reads_attr" - ], - "path_length": 5, - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_runtime.py", - "content": "test_trace_service_writes_contexts_and_messages\n -> RecordingTransport\n -> RecordingTransport.__init__\n -> RecordingTransport.contexts\n -> RecordingTransport.write_context", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_trace_service_writes_contexts_and_messages:dataflow_slice", - "span_start": 181, - "span_end": 249, - "lexical_rank": 4, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 5, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "60d7a8655fa4c53d9130ce342fc023d24ccfa16baea47ad60c91d2d49f547565", - "edge_type": "dataflow_slice", - "src_symbol_id": "1600da201da1d0150240b400e3232172354156decdd1a04e1ab1a1edcd3a7e99", - "src_qname": "test_trace_service_writes_contexts_and_messages", - "dst_symbol_id": "b8bbf341e230198caafe54727e13f2db27b7200d6fd95684fc5cf748db1a0e88", - "dst_ref": "RecordingTransport.write_context", - "resolution": "resolved", - "slice_id": "60d7a8655fa4c53d9130ce342fc023d24ccfa16baea47ad60c91d2d49f547565", - "root_symbol_id": "1600da201da1d0150240b400e3232172354156decdd1a04e1ab1a1edcd3a7e99", - "path_symbols": [ - "test_trace_service_writes_contexts_and_messages", - "RecordingTransport", - "RecordingTransport.__init__", - "RecordingTransport.contexts", - "RecordingTransport.write_context" - ], - "path_symbol_ids": [ - "1600da201da1d0150240b400e3232172354156decdd1a04e1ab1a1edcd3a7e99", - "e3d635de1f1880673b69bf73ca6a45caffa5c7fdc23d589d5e40f76b86bdcd33", - "e34d80da723a7115a7a7586b52dc8b5cfda05c581509eee0c1a0296df9a340cb", - "b8bbf341e230198caafe54727e13f2db27b7200d6fd95684fc5cf748db1a0e88" - ], - "path_edge_types": [ - "instantiates", - "writes_attr", - "reads_attr" - ], - "path_length": 5, - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_runtime.py", - "content": "test_trace_service_supports_debug_warning_and_error_levels\n -> RecordingTransport\n -> RecordingTransport.__init__\n -> RecordingTransport.contexts\n -> RecordingTransport.write_context", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_trace_service_supports_debug_warning_and_error_levels:dataflow_slice", - "span_start": 181, - "span_end": 265, - "lexical_rank": 4, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 5, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "1372a2241c7265705e5cf9dceeb5e59836fac1d679227c4279ed39e0798ddddf", - "edge_type": "dataflow_slice", - "src_symbol_id": "ede183f1c546725064e28ddab1ffdbae0d1a1258fd62a50eb556c10d10995415", - "src_qname": "test_trace_service_supports_debug_warning_and_error_levels", - "dst_symbol_id": "b8bbf341e230198caafe54727e13f2db27b7200d6fd95684fc5cf748db1a0e88", - "dst_ref": "RecordingTransport.write_context", - "resolution": "resolved", - "slice_id": "1372a2241c7265705e5cf9dceeb5e59836fac1d679227c4279ed39e0798ddddf", - "root_symbol_id": "ede183f1c546725064e28ddab1ffdbae0d1a1258fd62a50eb556c10d10995415", - "path_symbols": [ - "test_trace_service_supports_debug_warning_and_error_levels", - "RecordingTransport", - "RecordingTransport.__init__", - "RecordingTransport.contexts", - "RecordingTransport.write_context" - ], - "path_symbol_ids": [ - "ede183f1c546725064e28ddab1ffdbae0d1a1258fd62a50eb556c10d10995415", - "e3d635de1f1880673b69bf73ca6a45caffa5c7fdc23d589d5e40f76b86bdcd33", - "e34d80da723a7115a7a7586b52dc8b5cfda05c581509eee0c1a0296df9a340cb", - "b8bbf341e230198caafe54727e13f2db27b7200d6fd95684fc5cf748db1a0e88" - ], - "path_edge_types": [ - "instantiates", - "writes_attr", - "reads_attr" - ], - "path_length": 5, - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_runtime.py", - "content": "test_trace_service_supports_debug_warning_and_error_levels\n -> RecordingTransport\n -> RecordingTransport.__init__\n -> RecordingTransport.contexts\n -> test_trace_service_writes_contexts_and_messages", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_trace_service_supports_debug_warning_and_error_levels:dataflow_slice", - "span_start": 181, - "span_end": 265, - "lexical_rank": 4, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 5, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "8b6a5a738525df160600d71c15915704172de20db436ea2f84b6e039be396a2d", - "edge_type": "dataflow_slice", - "src_symbol_id": "ede183f1c546725064e28ddab1ffdbae0d1a1258fd62a50eb556c10d10995415", - "src_qname": "test_trace_service_supports_debug_warning_and_error_levels", - "dst_symbol_id": "1600da201da1d0150240b400e3232172354156decdd1a04e1ab1a1edcd3a7e99", - "dst_ref": "test_trace_service_writes_contexts_and_messages", - "resolution": "resolved", - "slice_id": "8b6a5a738525df160600d71c15915704172de20db436ea2f84b6e039be396a2d", - "root_symbol_id": "ede183f1c546725064e28ddab1ffdbae0d1a1258fd62a50eb556c10d10995415", - "path_symbols": [ - "test_trace_service_supports_debug_warning_and_error_levels", - "RecordingTransport", - "RecordingTransport.__init__", - "RecordingTransport.contexts", - "test_trace_service_writes_contexts_and_messages" - ], - "path_symbol_ids": [ - "ede183f1c546725064e28ddab1ffdbae0d1a1258fd62a50eb556c10d10995415", - "e3d635de1f1880673b69bf73ca6a45caffa5c7fdc23d589d5e40f76b86bdcd33", - "e34d80da723a7115a7a7586b52dc8b5cfda05c581509eee0c1a0296df9a340cb", - "1600da201da1d0150240b400e3232172354156decdd1a04e1ab1a1edcd3a7e99" - ], - "path_edge_types": [ - "instantiates", - "writes_attr", - "reads_attr" - ], - "path_length": 5, - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_runtime.py", - "content": "test_trace_service_supports_debug_warning_and_error_levels\n -> RecordingTransport\n -> RecordingTransport.__init__\n -> RecordingTransport.contexts\n -> test_trace_service_allows_messages_without_status", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_trace_service_supports_debug_warning_and_error_levels:dataflow_slice", - "span_start": 181, - "span_end": 293, - "lexical_rank": 4, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 5, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "f7d099f6d5746aa61a3025fd7eef791369bd3a3e5df4bc716de87e7b149ccde6", - "edge_type": "dataflow_slice", - "src_symbol_id": "ede183f1c546725064e28ddab1ffdbae0d1a1258fd62a50eb556c10d10995415", - "src_qname": "test_trace_service_supports_debug_warning_and_error_levels", - "dst_symbol_id": "7127ca85ce6447928e195e901d36f1e1f1e8205a686e567c2d1b187431f989df", - "dst_ref": "test_trace_service_allows_messages_without_status", - "resolution": "resolved", - "slice_id": "f7d099f6d5746aa61a3025fd7eef791369bd3a3e5df4bc716de87e7b149ccde6", - "root_symbol_id": "ede183f1c546725064e28ddab1ffdbae0d1a1258fd62a50eb556c10d10995415", - "path_symbols": [ - "test_trace_service_supports_debug_warning_and_error_levels", - "RecordingTransport", - "RecordingTransport.__init__", - "RecordingTransport.contexts", - "test_trace_service_allows_messages_without_status" - ], - "path_symbol_ids": [ - "ede183f1c546725064e28ddab1ffdbae0d1a1258fd62a50eb556c10d10995415", - "e3d635de1f1880673b69bf73ca6a45caffa5c7fdc23d589d5e40f76b86bdcd33", - "e34d80da723a7115a7a7586b52dc8b5cfda05c581509eee0c1a0296df9a340cb", - "7127ca85ce6447928e195e901d36f1e1f1e8205a686e567c2d1b187431f989df" - ], - "path_edge_types": [ - "instantiates", - "writes_attr", - "reads_attr" - ], - "path_length": 5, - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_runtime.py", - "content": "def test_trace_service_writes_contexts_and_messages() -> None:\n from app_runtime.tracing.service import TraceService\n\n transport = RecordingTransport()\n manager = TraceService(transport=transport)\n\n with manager.open_context(alias=\"worker\", kind=\"worker\", attrs={\"routine\": \"incoming\"}):\n manager.step(\"parse\")\n manager.info(\"started\", status=\"ok\", attrs={\"attempt\": 1})\n\n assert len(transport.contexts) == 1\n assert len(transport.messages) == 1\n assert transport.contexts[0].alias == \"worker\"\n assert transport.messages[0].step == \"parse\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_runtime.py:test_trace_service_writes_contexts_and_messages", - "span_start": 246, - "span_end": 259, - "lexical_rank": 6, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 9, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_runtime", - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_runtime.py", - "content": "def test_trace_service_supports_debug_warning_and_error_levels() -> None:\n from app_runtime.tracing.service import TraceService\n\n transport = RecordingTransport()\n manager = TraceService(transport=transport)\n\n with manager.open_context(alias=\"worker\", kind=\"worker\", attrs={\"routine\": \"incoming\"}):\n manager.step(\"validate\")\n manager.debug(\"validation details\", attrs={\"rule\": \"basic\"})\n manager.warning(\"validation warning\", status=\"degraded\", attrs={\"attempt\": 1})\n manager.error(\"integration failed\", status=\"failed\", attrs={\"integration\": \"crm\"})\n manager.exception(\"caught exception\", attrs={\"exception_type\": \"RuntimeError\"})\n\n levels = [message.level for message in transport.messages]\n assert levels == [\"DEBUG\", \"WARNING\", \"ERROR\", \"ERROR\"]", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_runtime.py:test_trace_service_supports_debug_warning_and_error_levels", - "span_start": 262, - "span_end": 276, - "lexical_rank": 6, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 10, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_runtime", - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_runtime.py", - "content": "def test_trace_service_allows_messages_without_status() -> None:\n from app_runtime.tracing.service import TraceService\n\n transport = RecordingTransport()\n manager = TraceService(transport=transport)\n\n with manager.open_context(alias=\"worker\", kind=\"worker\"):\n manager.step(\"optional-status\")\n manager.debug(\"debug without status\")\n manager.info(\"info without status\")\n manager.warning(\"warning without status\")\n manager.error(\"error without status\")\n\n assert [message.status for message in transport.messages] == [\"\", \"\", \"\", \"\"]\n assert all(message.trace_id == transport.contexts[0].trace_id for message in transport.messages)", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_runtime.py:test_trace_service_allows_messages_without_status", - "span_start": 279, - "span_end": 293, - "lexical_rank": 6, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 11, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_runtime", - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "class ScenarioWorker(Worker):\n def __init__(self, name: str, routine: object, *, interval: float = 0.05) -> None:\n self._name = name\n self._routine = routine\n self._interval = interval\n self._thread: Thread | None = None\n self._stop_requested = Event()\n self._in_flight = 0\n self._runs = 0\n self._lock = Lock()\n\n @property\n def name(self) -> str:\n return self._name\n\n @property\n def critical(self) -> bool:\n return True\n\n def start(self) -> None:\n if self._thread is not None and self._thread.is_alive():\n return\n self._stop_requested.clear()\n self._thread = Thread(target=self._loop, name=f\"{self._name}-thread\", daemon=True)\n self._thread.start()\n\n def stop(self, force: bool = False) -> None:\n self._stop_requested.set()\n\n def health(self) -> WorkerHealth:\n return WorkerHealth(name=self.name, status=\"ok\", critical=True, meta={\"runs\": self._runs})\n\n def status(self) -> WorkerStatus:\n thread_alive = self._thread is not None and self._thread.is_alive()\n with self._lock:\n in_flight = self._in_flight\n runs = self._runs\n if not thread_alive:\n state = \"stopped\"\n elif self._stop_requested.is_set():\n state = \"stopping\"\n elif in_flight > 0:\n state = \"busy\"\n else:\n state = \"idle\"\n return WorkerStatus(name=self.name, state=state, in_flight=in_flight, meta={\"runs\": runs})\n\n def _loop(self) -> None:\n while not self._stop_requested.is_set():\n with self._lock:\n self._in_flight += 1\n try:\n self._routine.run()\n with self._lock:\n self._runs += 1\n finally:\n with self._lock:\n self._in_flight -= 1\n if self._stop_requested.is_set():\n return\n sleep(self._interval)", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:ScenarioWorker", - "span_start": 50, - "span_end": 110, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 2, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "class IntervalRoutine:\n calls: list[float] = field(default_factory=list)\n _lock: Lock = field(default_factory=Lock)\n\n def run(self) -> None:\n with self._lock:\n self.calls.append(monotonic())\n\n def wait_runs(self, count: int, timeout: float) -> bool:\n deadline = monotonic() + timeout\n while monotonic() < deadline:\n with self._lock:\n if len(self.calls) >= count:\n return True\n sleep(0.01)\n return False\n\n def deltas(self) -> list[float]:\n with self._lock:\n return [self.calls[index + 1] - self.calls[index] for index in range(len(self.calls) - 1)]", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:IntervalRoutine", - "span_start": 18, - "span_end": 37, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "class BlockingRoutine:\n def __init__(self, started: Event, release: Event) -> None:\n self._started = started\n self._release = release\n\n def run(self) -> None:\n self._started.set()\n self._release.wait(timeout=5.0)", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:BlockingRoutine", - "span_start": 40, - "span_end": 47, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 1, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "def test_worker_wakes_up_with_configured_interval() -> None:\n interval = 0.15\n routine = IntervalRoutine()\n worker = ScenarioWorker(\"interval-worker\", routine, interval=interval)\n runtime = RuntimeManager()\n runtime.register_module(WorkerModule(worker))\n\n runtime.start()\n try:\n assert routine.wait_runs(count=3, timeout=2.0) is True\n finally:\n runtime.stop()\n\n deltas = routine.deltas()\n assert len(deltas) >= 2\n assert all(delta >= interval * 0.7 for delta in deltas[:2])", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:test_worker_wakes_up_with_configured_interval", - "span_start": 163, - "span_end": 178, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 7, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "def _http_call_json(\n base_url: str,\n path: str,\n *,\n method: str = \"GET\",\n headers: dict[str, str] | None = None,\n) -> tuple[int, dict[str, object]]:\n request = Request(f\"{base_url}{path}\", method=method, headers=headers or {})\n try:\n with urlopen(request, timeout=15.0) as response:\n status = response.status\n body = response.read()\n except HTTPError as error:\n status = error.code\n body = error.read()\n payload = json.loads(body.decode(\"utf-8\"))\n return status, payload", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:_http_call_json", - "span_start": 125, - "span_end": 141, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 4, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "def _build_runtime(worker: Worker, *, control_timeout: int = 1) -> tuple[RuntimeManager, str]:\n runtime = RuntimeManager()\n channel = HttpControlChannel(host=\"127.0.0.1\", port=0, timeout=control_timeout)\n runtime.control_plane.register_channel(channel)\n runtime.register_module(WorkerModule(worker))\n runtime.start()\n return runtime, f\"http://127.0.0.1:{channel.port}\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:_build_runtime", - "span_start": 154, - "span_end": 160, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 6, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "class WorkerModule(ApplicationModule):\n def __init__(self, worker: Worker) -> None:\n self._worker = worker\n\n @property\n def name(self) -> str:\n return \"business-tests\"\n\n def register(self, registry: ModuleRegistry) -> None:\n registry.add_worker(self._worker)", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:WorkerModule", - "span_start": 113, - "span_end": 122, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 3, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "llm_answer": "1. Прямые тесты:\n - tests/test_runtime.py | test_trace_service_writes_contexts_and_messages\n - Проверка записи контекстов и сообщений в TraceService.\n - tests/test_runtime.py | test_trace_service_supports_debug_warning_and_error_levels\n - Проверка поддержки различных уровней логирования (DEBUG, WARNING, ERROR).\n\n2. Косвенные или ближайшие тесты:\n - Нет известных косвенных тестов, которые напрямую касаются TraceService.\n\n3. Что именно проверяется:\n - Запись и обработка контекста и сообщений в TraceService.\n - Поддержка различных уровней логирования и запись соответствующих сообщений.\n\n4. Пробелы покрытия:\n - Прямого тестирования работы самого класса TraceService без привязки к транспорту нет.\n - Тестирование сценариев ошибок и исключений при работе с TraceService отсутствует.\n - Отсутствие проверки взаимодействий с внешними сервисами через транспорт.", - "summary": { - "router": { - "intent": "CODE_QA", - "sub_intent": "FIND_TESTS", - "confidence": null - }, - "retrieval": { - "profile": "code", - "layers_hit": [ - "C0_SOURCE_CHUNKS", - "C2_DEPENDENCY_GRAPH" - ], - "evidence_sufficient": true - }, - "llm": { - "answer_status": "answered", - "groundedness": "grounded" - } - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "FIND_TESTS", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "TraceService" - ], - "keyword_hints": [ - "TraceService" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**", - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "test_file_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "test_symbol_patterns": [ - "test_trace_service", - "TestTraceService", - "TraceService" - ], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C0_SOURCE_CHUNKS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C0_SOURCE_CHUNKS": 10 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [], - "include_globs": [ - "src", - "tests" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests" - ] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src", - "tests" - ], - "include_globs": [ - "src", - "tests" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests" - ] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src", - "tests" - ], - "include_globs": [ - "src", - "tests" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests" - ] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "TraceService", - "path_scope": [], - "include_globs": [ - "src/**", - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "Где тесты для TraceService? test_trace_service TestTraceService TraceService", - "path_scope": [], - "include_globs": [ - "src/**", - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "top_k": 6, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Где тесты для TraceService? test_trace_service TestTraceService TraceService", - "path_scope": [], - "include_globs": [ - "src/**", - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "top_k": 10, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [], - "normalized_include_globs": [ - "src", - "tests" - ], - "normalized_exclude_globs": [], - "normalized_prefer_globs": [ - "tests" - ], - "filter_stage": "post_rank", - "candidates_before_filter": 0, - "candidates_after_filter": 0 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src", - "tests" - ], - "normalized_include_globs": [ - "src", - "tests" - ], - "normalized_exclude_globs": [], - "normalized_prefer_globs": [ - "tests" - ], - "filter_stage": "post_rank", - "candidates_before_filter": 6, - "candidates_after_filter": 6 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src", - "tests" - ], - "normalized_include_globs": [ - "src", - "tests" - ], - "normalized_exclude_globs": [], - "normalized_prefer_globs": [ - "tests" - ], - "filter_stage": "post_rank", - "candidates_before_filter": 10, - "candidates_after_filter": 10 - } - ], - "fallback": { - "used": true, - "reason": "scope_relaxed_no_hits" - }, - "symbol_resolution": { - "status": "not_found", - "resolved_symbol": null, - "alternatives": [ - "TraceService" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "miss", - "hit_count": 0, - "fail_reason": "scope_relaxed_no_hits" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 6, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 10, - "fail_reason": null - } - ] - }, - "constraint_violations": [ - { - "type": "LAYER_MISSING", - "severity": "warn", - "details": { - "layer": "C1_SYMBOL_CATALOG", - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ] - }, - "suggested_fix": "Increase top_k for this layer or relax constraints for retrieval." - } - ], - "timings_ms": { - "router": 0, - "symbol_resolution": 0, - "retrieval_total": 128, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 58, - "C2_DEPENDENCY_GRAPH": 53, - "C0_SOURCE_CHUNKS": 16 - }, - "merge_rank": 0, - "prompt_build": 0, - "llm_call": 1543 - }, - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 978, - "evidence_rows": 16, - "evidence_chars": 7847 - }, - "evidence_summary": [ - { - "layer": "C2_DEPENDENCY_GRAPH", - "count": 6, - "unique_paths": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 10, - "unique_paths": 2 - } - ], - "prompt_template_id": "intent_code_qa_find_tests_ru_v2", - "system_prompt_version": "v1" - }, - "router": { - "conversation_mode": "START", - "keyword_hints": [ - "TraceService" - ], - "path_scope": [] - }, - "llm": { - "used_evidence_count": 16, - "missing_evidence_reason": null - } - }, - "run_info": { - "case_id": "plba-v2-find-tests-trace-service", - "mode": "full_chain", - "run_started_at": "2026-03-12T13:23:57", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - }, - "input_request": { - "text": "Где тесты для TraceService?", - "normalized_query": "Где тесты для TraceService?" - }, - "steps": [ - { - "step": "intent_router", - "input": { - "query": "Где тесты для TraceService?" - }, - "output": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Где тесты для TraceService?" - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "FIND_TESTS", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "TraceService" - ], - "keyword_hints": [ - "TraceService" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**", - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "test_file_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "test_symbol_patterns": [ - "test_trace_service", - "TestTraceService", - "TraceService" - ], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "timings_ms": { - "router": 0 - } - } - }, - { - "step": "retrieval", - "input": { - "query": "Где тесты для TraceService?" - }, - "output": { - "symbol_resolution": { - "status": "not_found", - "resolved_symbol": null, - "alternatives": [ - "TraceService" - ], - "confidence": 0.0 - }, - "rag_count": 16, - "rag_rows": [ - { - "path": "tests/test_runtime.py", - "content": "test_trace_service_writes_contexts_and_messages\n -> RecordingTransport\n -> RecordingTransport.__init__\n -> RecordingTransport.contexts\n -> test_trace_service_writes_contexts_and_messages", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_trace_service_writes_contexts_and_messages:dataflow_slice", - "span_start": 181, - "span_end": 256, - "lexical_rank": 4, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 5, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "1636a2f70dee79c804259dc114af6c1ab4db27099911e5f97ac97a2bcb59be8a", - "edge_type": "dataflow_slice", - "src_symbol_id": "1600da201da1d0150240b400e3232172354156decdd1a04e1ab1a1edcd3a7e99", - "src_qname": "test_trace_service_writes_contexts_and_messages", - "dst_symbol_id": "1600da201da1d0150240b400e3232172354156decdd1a04e1ab1a1edcd3a7e99", - "dst_ref": "test_trace_service_writes_contexts_and_messages", - "resolution": "resolved", - "slice_id": "1636a2f70dee79c804259dc114af6c1ab4db27099911e5f97ac97a2bcb59be8a", - "root_symbol_id": "1600da201da1d0150240b400e3232172354156decdd1a04e1ab1a1edcd3a7e99", - "path_symbols": [ - "test_trace_service_writes_contexts_and_messages", - "RecordingTransport", - "RecordingTransport.__init__", - "RecordingTransport.contexts", - "test_trace_service_writes_contexts_and_messages" - ], - "path_symbol_ids": [ - "1600da201da1d0150240b400e3232172354156decdd1a04e1ab1a1edcd3a7e99", - "e3d635de1f1880673b69bf73ca6a45caffa5c7fdc23d589d5e40f76b86bdcd33", - "e34d80da723a7115a7a7586b52dc8b5cfda05c581509eee0c1a0296df9a340cb", - "1600da201da1d0150240b400e3232172354156decdd1a04e1ab1a1edcd3a7e99" - ], - "path_edge_types": [ - "instantiates", - "writes_attr", - "reads_attr" - ], - "path_length": 5, - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_runtime.py", - "content": "test_trace_service_writes_contexts_and_messages\n -> RecordingTransport\n -> RecordingTransport.__init__\n -> RecordingTransport.contexts\n -> test_trace_service_allows_messages_without_status", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_trace_service_writes_contexts_and_messages:dataflow_slice", - "span_start": 181, - "span_end": 293, - "lexical_rank": 4, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 5, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "5db5abe56b73f884c5178647bd25ef150064a94a41fc8c052aebaa09bd7fdb3d", - "edge_type": "dataflow_slice", - "src_symbol_id": "1600da201da1d0150240b400e3232172354156decdd1a04e1ab1a1edcd3a7e99", - "src_qname": "test_trace_service_writes_contexts_and_messages", - "dst_symbol_id": "7127ca85ce6447928e195e901d36f1e1f1e8205a686e567c2d1b187431f989df", - "dst_ref": "test_trace_service_allows_messages_without_status", - "resolution": "resolved", - "slice_id": "5db5abe56b73f884c5178647bd25ef150064a94a41fc8c052aebaa09bd7fdb3d", - "root_symbol_id": "1600da201da1d0150240b400e3232172354156decdd1a04e1ab1a1edcd3a7e99", - "path_symbols": [ - "test_trace_service_writes_contexts_and_messages", - "RecordingTransport", - "RecordingTransport.__init__", - "RecordingTransport.contexts", - "test_trace_service_allows_messages_without_status" - ], - "path_symbol_ids": [ - "1600da201da1d0150240b400e3232172354156decdd1a04e1ab1a1edcd3a7e99", - "e3d635de1f1880673b69bf73ca6a45caffa5c7fdc23d589d5e40f76b86bdcd33", - "e34d80da723a7115a7a7586b52dc8b5cfda05c581509eee0c1a0296df9a340cb", - "7127ca85ce6447928e195e901d36f1e1f1e8205a686e567c2d1b187431f989df" - ], - "path_edge_types": [ - "instantiates", - "writes_attr", - "reads_attr" - ], - "path_length": 5, - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_runtime.py", - "content": "test_trace_service_writes_contexts_and_messages\n -> RecordingTransport\n -> RecordingTransport.__init__\n -> RecordingTransport.contexts\n -> RecordingTransport.write_context", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_trace_service_writes_contexts_and_messages:dataflow_slice", - "span_start": 181, - "span_end": 249, - "lexical_rank": 4, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 5, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "60d7a8655fa4c53d9130ce342fc023d24ccfa16baea47ad60c91d2d49f547565", - "edge_type": "dataflow_slice", - "src_symbol_id": "1600da201da1d0150240b400e3232172354156decdd1a04e1ab1a1edcd3a7e99", - "src_qname": "test_trace_service_writes_contexts_and_messages", - "dst_symbol_id": "b8bbf341e230198caafe54727e13f2db27b7200d6fd95684fc5cf748db1a0e88", - "dst_ref": "RecordingTransport.write_context", - "resolution": "resolved", - "slice_id": "60d7a8655fa4c53d9130ce342fc023d24ccfa16baea47ad60c91d2d49f547565", - "root_symbol_id": "1600da201da1d0150240b400e3232172354156decdd1a04e1ab1a1edcd3a7e99", - "path_symbols": [ - "test_trace_service_writes_contexts_and_messages", - "RecordingTransport", - "RecordingTransport.__init__", - "RecordingTransport.contexts", - "RecordingTransport.write_context" - ], - "path_symbol_ids": [ - "1600da201da1d0150240b400e3232172354156decdd1a04e1ab1a1edcd3a7e99", - "e3d635de1f1880673b69bf73ca6a45caffa5c7fdc23d589d5e40f76b86bdcd33", - "e34d80da723a7115a7a7586b52dc8b5cfda05c581509eee0c1a0296df9a340cb", - "b8bbf341e230198caafe54727e13f2db27b7200d6fd95684fc5cf748db1a0e88" - ], - "path_edge_types": [ - "instantiates", - "writes_attr", - "reads_attr" - ], - "path_length": 5, - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_runtime.py", - "content": "test_trace_service_supports_debug_warning_and_error_levels\n -> RecordingTransport\n -> RecordingTransport.__init__\n -> RecordingTransport.contexts\n -> RecordingTransport.write_context", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_trace_service_supports_debug_warning_and_error_levels:dataflow_slice", - "span_start": 181, - "span_end": 265, - "lexical_rank": 4, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 5, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "1372a2241c7265705e5cf9dceeb5e59836fac1d679227c4279ed39e0798ddddf", - "edge_type": "dataflow_slice", - "src_symbol_id": "ede183f1c546725064e28ddab1ffdbae0d1a1258fd62a50eb556c10d10995415", - "src_qname": "test_trace_service_supports_debug_warning_and_error_levels", - "dst_symbol_id": "b8bbf341e230198caafe54727e13f2db27b7200d6fd95684fc5cf748db1a0e88", - "dst_ref": "RecordingTransport.write_context", - "resolution": "resolved", - "slice_id": "1372a2241c7265705e5cf9dceeb5e59836fac1d679227c4279ed39e0798ddddf", - "root_symbol_id": "ede183f1c546725064e28ddab1ffdbae0d1a1258fd62a50eb556c10d10995415", - "path_symbols": [ - "test_trace_service_supports_debug_warning_and_error_levels", - "RecordingTransport", - "RecordingTransport.__init__", - "RecordingTransport.contexts", - "RecordingTransport.write_context" - ], - "path_symbol_ids": [ - "ede183f1c546725064e28ddab1ffdbae0d1a1258fd62a50eb556c10d10995415", - "e3d635de1f1880673b69bf73ca6a45caffa5c7fdc23d589d5e40f76b86bdcd33", - "e34d80da723a7115a7a7586b52dc8b5cfda05c581509eee0c1a0296df9a340cb", - "b8bbf341e230198caafe54727e13f2db27b7200d6fd95684fc5cf748db1a0e88" - ], - "path_edge_types": [ - "instantiates", - "writes_attr", - "reads_attr" - ], - "path_length": 5, - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_runtime.py", - "content": "test_trace_service_supports_debug_warning_and_error_levels\n -> RecordingTransport\n -> RecordingTransport.__init__\n -> RecordingTransport.contexts\n -> test_trace_service_writes_contexts_and_messages", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_trace_service_supports_debug_warning_and_error_levels:dataflow_slice", - "span_start": 181, - "span_end": 265, - "lexical_rank": 4, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 5, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "8b6a5a738525df160600d71c15915704172de20db436ea2f84b6e039be396a2d", - "edge_type": "dataflow_slice", - "src_symbol_id": "ede183f1c546725064e28ddab1ffdbae0d1a1258fd62a50eb556c10d10995415", - "src_qname": "test_trace_service_supports_debug_warning_and_error_levels", - "dst_symbol_id": "1600da201da1d0150240b400e3232172354156decdd1a04e1ab1a1edcd3a7e99", - "dst_ref": "test_trace_service_writes_contexts_and_messages", - "resolution": "resolved", - "slice_id": "8b6a5a738525df160600d71c15915704172de20db436ea2f84b6e039be396a2d", - "root_symbol_id": "ede183f1c546725064e28ddab1ffdbae0d1a1258fd62a50eb556c10d10995415", - "path_symbols": [ - "test_trace_service_supports_debug_warning_and_error_levels", - "RecordingTransport", - "RecordingTransport.__init__", - "RecordingTransport.contexts", - "test_trace_service_writes_contexts_and_messages" - ], - "path_symbol_ids": [ - "ede183f1c546725064e28ddab1ffdbae0d1a1258fd62a50eb556c10d10995415", - "e3d635de1f1880673b69bf73ca6a45caffa5c7fdc23d589d5e40f76b86bdcd33", - "e34d80da723a7115a7a7586b52dc8b5cfda05c581509eee0c1a0296df9a340cb", - "1600da201da1d0150240b400e3232172354156decdd1a04e1ab1a1edcd3a7e99" - ], - "path_edge_types": [ - "instantiates", - "writes_attr", - "reads_attr" - ], - "path_length": 5, - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_runtime.py", - "content": "test_trace_service_supports_debug_warning_and_error_levels\n -> RecordingTransport\n -> RecordingTransport.__init__\n -> RecordingTransport.contexts\n -> test_trace_service_allows_messages_without_status", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_trace_service_supports_debug_warning_and_error_levels:dataflow_slice", - "span_start": 181, - "span_end": 293, - "lexical_rank": 4, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 5, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "f7d099f6d5746aa61a3025fd7eef791369bd3a3e5df4bc716de87e7b149ccde6", - "edge_type": "dataflow_slice", - "src_symbol_id": "ede183f1c546725064e28ddab1ffdbae0d1a1258fd62a50eb556c10d10995415", - "src_qname": "test_trace_service_supports_debug_warning_and_error_levels", - "dst_symbol_id": "7127ca85ce6447928e195e901d36f1e1f1e8205a686e567c2d1b187431f989df", - "dst_ref": "test_trace_service_allows_messages_without_status", - "resolution": "resolved", - "slice_id": "f7d099f6d5746aa61a3025fd7eef791369bd3a3e5df4bc716de87e7b149ccde6", - "root_symbol_id": "ede183f1c546725064e28ddab1ffdbae0d1a1258fd62a50eb556c10d10995415", - "path_symbols": [ - "test_trace_service_supports_debug_warning_and_error_levels", - "RecordingTransport", - "RecordingTransport.__init__", - "RecordingTransport.contexts", - "test_trace_service_allows_messages_without_status" - ], - "path_symbol_ids": [ - "ede183f1c546725064e28ddab1ffdbae0d1a1258fd62a50eb556c10d10995415", - "e3d635de1f1880673b69bf73ca6a45caffa5c7fdc23d589d5e40f76b86bdcd33", - "e34d80da723a7115a7a7586b52dc8b5cfda05c581509eee0c1a0296df9a340cb", - "7127ca85ce6447928e195e901d36f1e1f1e8205a686e567c2d1b187431f989df" - ], - "path_edge_types": [ - "instantiates", - "writes_attr", - "reads_attr" - ], - "path_length": 5, - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_runtime.py", - "content": "def test_trace_service_writes_contexts_and_messages() -> None:\n from app_runtime.tracing.service import TraceService\n\n transport = RecordingTransport()\n manager = TraceService(transport=transport)\n\n with manager.open_context(alias=\"worker\", kind=\"worker\", attrs={\"routine\": \"incoming\"}):\n manager.step(\"parse\")\n manager.info(\"started\", status=\"ok\", attrs={\"attempt\": 1})\n\n assert len(transport.contexts) == 1\n assert len(transport.messages) == 1\n assert transport.contexts[0].alias == \"worker\"\n assert transport.messages[0].step == \"parse\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_runtime.py:test_trace_service_writes_contexts_and_messages", - "span_start": 246, - "span_end": 259, - "lexical_rank": 6, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 9, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_runtime", - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_runtime.py", - "content": "def test_trace_service_supports_debug_warning_and_error_levels() -> None:\n from app_runtime.tracing.service import TraceService\n\n transport = RecordingTransport()\n manager = TraceService(transport=transport)\n\n with manager.open_context(alias=\"worker\", kind=\"worker\", attrs={\"routine\": \"incoming\"}):\n manager.step(\"validate\")\n manager.debug(\"validation details\", attrs={\"rule\": \"basic\"})\n manager.warning(\"validation warning\", status=\"degraded\", attrs={\"attempt\": 1})\n manager.error(\"integration failed\", status=\"failed\", attrs={\"integration\": \"crm\"})\n manager.exception(\"caught exception\", attrs={\"exception_type\": \"RuntimeError\"})\n\n levels = [message.level for message in transport.messages]\n assert levels == [\"DEBUG\", \"WARNING\", \"ERROR\", \"ERROR\"]", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_runtime.py:test_trace_service_supports_debug_warning_and_error_levels", - "span_start": 262, - "span_end": 276, - "lexical_rank": 6, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 10, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_runtime", - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_runtime.py", - "content": "def test_trace_service_allows_messages_without_status() -> None:\n from app_runtime.tracing.service import TraceService\n\n transport = RecordingTransport()\n manager = TraceService(transport=transport)\n\n with manager.open_context(alias=\"worker\", kind=\"worker\"):\n manager.step(\"optional-status\")\n manager.debug(\"debug without status\")\n manager.info(\"info without status\")\n manager.warning(\"warning without status\")\n manager.error(\"error without status\")\n\n assert [message.status for message in transport.messages] == [\"\", \"\", \"\", \"\"]\n assert all(message.trace_id == transport.contexts[0].trace_id for message in transport.messages)", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_runtime.py:test_trace_service_allows_messages_without_status", - "span_start": 279, - "span_end": 293, - "lexical_rank": 6, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 11, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_runtime", - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "class ScenarioWorker(Worker):\n def __init__(self, name: str, routine: object, *, interval: float = 0.05) -> None:\n self._name = name\n self._routine = routine\n self._interval = interval\n self._thread: Thread | None = None\n self._stop_requested = Event()\n self._in_flight = 0\n self._runs = 0\n self._lock = Lock()\n\n @property\n def name(self) -> str:\n return self._name\n\n @property\n def critical(self) -> bool:\n return True\n\n def start(self) -> None:\n if self._thread is not None and self._thread.is_alive():\n return\n self._stop_requested.clear()\n self._thread = Thread(target=self._loop, name=f\"{self._name}-thread\", daemon=True)\n self._thread.start()\n\n def stop(self, force: bool = False) -> None:\n self._stop_requested.set()\n\n def health(self) -> WorkerHealth:\n return WorkerHealth(name=self.name, status=\"ok\", critical=True, meta={\"runs\": self._runs})\n\n def status(self) -> WorkerStatus:\n thread_alive = self._thread is not None and self._thread.is_alive()\n with self._lock:\n in_flight = self._in_flight\n runs = self._runs\n if not thread_alive:\n state = \"stopped\"\n elif self._stop_requested.is_set():\n state = \"stopping\"\n elif in_flight > 0:\n state = \"busy\"\n else:\n state = \"idle\"\n return WorkerStatus(name=self.name, state=state, in_flight=in_flight, meta={\"runs\": runs})\n\n def _loop(self) -> None:\n while not self._stop_requested.is_set():\n with self._lock:\n self._in_flight += 1\n try:\n self._routine.run()\n with self._lock:\n self._runs += 1\n finally:\n with self._lock:\n self._in_flight -= 1\n if self._stop_requested.is_set():\n return\n sleep(self._interval)", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:ScenarioWorker", - "span_start": 50, - "span_end": 110, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 2, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "class IntervalRoutine:\n calls: list[float] = field(default_factory=list)\n _lock: Lock = field(default_factory=Lock)\n\n def run(self) -> None:\n with self._lock:\n self.calls.append(monotonic())\n\n def wait_runs(self, count: int, timeout: float) -> bool:\n deadline = monotonic() + timeout\n while monotonic() < deadline:\n with self._lock:\n if len(self.calls) >= count:\n return True\n sleep(0.01)\n return False\n\n def deltas(self) -> list[float]:\n with self._lock:\n return [self.calls[index + 1] - self.calls[index] for index in range(len(self.calls) - 1)]", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:IntervalRoutine", - "span_start": 18, - "span_end": 37, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "class BlockingRoutine:\n def __init__(self, started: Event, release: Event) -> None:\n self._started = started\n self._release = release\n\n def run(self) -> None:\n self._started.set()\n self._release.wait(timeout=5.0)", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:BlockingRoutine", - "span_start": 40, - "span_end": 47, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 1, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "def test_worker_wakes_up_with_configured_interval() -> None:\n interval = 0.15\n routine = IntervalRoutine()\n worker = ScenarioWorker(\"interval-worker\", routine, interval=interval)\n runtime = RuntimeManager()\n runtime.register_module(WorkerModule(worker))\n\n runtime.start()\n try:\n assert routine.wait_runs(count=3, timeout=2.0) is True\n finally:\n runtime.stop()\n\n deltas = routine.deltas()\n assert len(deltas) >= 2\n assert all(delta >= interval * 0.7 for delta in deltas[:2])", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:test_worker_wakes_up_with_configured_interval", - "span_start": 163, - "span_end": 178, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 7, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "def _http_call_json(\n base_url: str,\n path: str,\n *,\n method: str = \"GET\",\n headers: dict[str, str] | None = None,\n) -> tuple[int, dict[str, object]]:\n request = Request(f\"{base_url}{path}\", method=method, headers=headers or {})\n try:\n with urlopen(request, timeout=15.0) as response:\n status = response.status\n body = response.read()\n except HTTPError as error:\n status = error.code\n body = error.read()\n payload = json.loads(body.decode(\"utf-8\"))\n return status, payload", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:_http_call_json", - "span_start": 125, - "span_end": 141, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 4, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "def _build_runtime(worker: Worker, *, control_timeout: int = 1) -> tuple[RuntimeManager, str]:\n runtime = RuntimeManager()\n channel = HttpControlChannel(host=\"127.0.0.1\", port=0, timeout=control_timeout)\n runtime.control_plane.register_channel(channel)\n runtime.register_module(WorkerModule(worker))\n runtime.start()\n return runtime, f\"http://127.0.0.1:{channel.port}\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:_build_runtime", - "span_start": 154, - "span_end": 160, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 6, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "class WorkerModule(ApplicationModule):\n def __init__(self, worker: Worker) -> None:\n self._worker = worker\n\n @property\n def name(self) -> str:\n return \"business-tests\"\n\n def register(self, registry: ModuleRegistry) -> None:\n registry.add_worker(self._worker)", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:WorkerModule", - "span_start": 113, - "span_end": 122, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 3, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ] - }, - "diagnostics": { - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C0_SOURCE_CHUNKS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C0_SOURCE_CHUNKS": 10 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [], - "include_globs": [ - "src", - "tests" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests" - ] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src", - "tests" - ], - "include_globs": [ - "src", - "tests" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests" - ] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src", - "tests" - ], - "include_globs": [ - "src", - "tests" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests" - ] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "TraceService", - "path_scope": [], - "include_globs": [ - "src/**", - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "Где тесты для TraceService? test_trace_service TestTraceService TraceService", - "path_scope": [], - "include_globs": [ - "src/**", - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "top_k": 6, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Где тесты для TraceService? test_trace_service TestTraceService TraceService", - "path_scope": [], - "include_globs": [ - "src/**", - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "top_k": 10, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [], - "normalized_include_globs": [ - "src", - "tests" - ], - "normalized_exclude_globs": [], - "normalized_prefer_globs": [ - "tests" - ], - "filter_stage": "post_rank", - "candidates_before_filter": 0, - "candidates_after_filter": 0 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src", - "tests" - ], - "normalized_include_globs": [ - "src", - "tests" - ], - "normalized_exclude_globs": [], - "normalized_prefer_globs": [ - "tests" - ], - "filter_stage": "post_rank", - "candidates_before_filter": 6, - "candidates_after_filter": 6 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src", - "tests" - ], - "normalized_include_globs": [ - "src", - "tests" - ], - "normalized_exclude_globs": [], - "normalized_prefer_globs": [ - "tests" - ], - "filter_stage": "post_rank", - "candidates_before_filter": 10, - "candidates_after_filter": 10 - } - ], - "fallback": { - "used": true, - "reason": "scope_relaxed_no_hits" - }, - "symbol_resolution": { - "status": "not_found", - "resolved_symbol": null, - "alternatives": [ - "TraceService" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "miss", - "hit_count": 0, - "fail_reason": "scope_relaxed_no_hits" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 6, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 10, - "fail_reason": null - } - ] - }, - "constraint_violations": [ - { - "type": "LAYER_MISSING", - "severity": "warn", - "details": { - "layer": "C1_SYMBOL_CATALOG", - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ] - }, - "suggested_fix": "Increase top_k for this layer or relax constraints for retrieval." - } - ], - "timings_ms": { - "symbol_resolution": 0, - "retrieval_total": 128, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 58, - "C2_DEPENDENCY_GRAPH": 53, - "C0_SOURCE_CHUNKS": 16 - }, - "merge_rank": 0 - } - } - }, - { - "step": "llm_answer", - "input": { - "query": "Где тесты для TraceService?", - "rag_count": 16 - }, - "output": { - "llm_answer": "1. Прямые тесты:\n - tests/test_runtime.py | test_trace_service_writes_contexts_and_messages\n - Проверка записи контекстов и сообщений в TraceService.\n - tests/test_runtime.py | test_trace_service_supports_debug_warning_and_error_levels\n - Проверка поддержки различных уровней логирования (DEBUG, WARNING, ERROR).\n\n2. Косвенные или ближайшие тесты:\n - Нет известных косвенных тестов, которые напрямую касаются TraceService.\n\n3. Что именно проверяется:\n - Запись и обработка контекста и сообщений в TraceService.\n - Поддержка различных уровней логирования и запись соответствующих сообщений.\n\n4. Пробелы покрытия:\n - Прямого тестирования работы самого класса TraceService без привязки к транспорту нет.\n - Тестирование сценариев ошибок и исключений при работе с TraceService отсутствует.\n - Отсутствие проверки взаимодействий с внешними сервисами через транспорт." - }, - "diagnostics": { - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 978, - "evidence_rows": 16, - "evidence_chars": 7847 - }, - "evidence_summary": [ - { - "layer": "C2_DEPENDENCY_GRAPH", - "count": 6, - "unique_paths": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 10, - "unique_paths": 2 - } - ], - "prompt_template_id": "intent_code_qa_find_tests_ru_v2", - "system_prompt_version": "v1" - }, - "timings_ms": { - "prompt_build": 0, - "llm_call": 1543 - } - } - } - ] - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_132357/full_chain_plba_code_subintents_v2_plba-v2-find-tests-trace-service.md b/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_132357/full_chain_plba_code_subintents_v2_plba-v2-find-tests-trace-service.md deleted file mode 100644 index 0fea124..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_132357/full_chain_plba_code_subintents_v2_plba-v2-find-tests-trace-service.md +++ /dev/null @@ -1,32 +0,0 @@ -# plba-v2-find-tests-trace-service - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_subintents_v2.yaml -- runner: runtime -- mode: full_chain -- passed: True - -## Query -Где тесты для TraceService? - -## Actual -{ - "intent": "CODE_QA", - "sub_intent": "FIND_TESTS", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 16, - "llm_answer": "1. Прямые тесты:\n - tests/test_runtime.py | test_trace_service_writes_contexts_and_messages\n - Проверка записи контекстов и сообщений в TraceService.\n - tests/test_runtime.py | test_trace_service_supports_debug_warning_and_error_levels\n - Проверка поддержки различных уровней логирования (DEBUG, WARNING, ERROR).\n\n2. Косвенные или ближайшие тесты:\n - Нет известных косвенных тестов, которые напрямую касаются TraceService.\n\n3. Что именно проверяется:\n - Запись и обработка контекста и сообщений в TraceService.\n - Поддержка различных уровней логирования и запись соответствующих сообщений.\n\n4. Пробелы покрытия:\n - Прямого тестирования работы самого класса TraceService без привязки к транспорту нет.\n - Тестирование сценариев ошибок и исключений при работе с TraceService отсутствует.\n - Отсутствие проверки взаимодействий с внешними сервисами через транспорт.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "TraceService" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ] -} - -## Mismatches -- none \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_132357/full_chain_plba_code_subintents_v2_plba-v2-find-tests-workflow-runtime-factory-negative.json b/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_132357/full_chain_plba_code_subintents_v2_plba-v2-find-tests-workflow-runtime-factory-negative.json deleted file mode 100644 index 9ff0f50..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_132357/full_chain_plba_code_subintents_v2_plba-v2-find-tests-workflow-runtime-factory-negative.json +++ /dev/null @@ -1,2047 +0,0 @@ -{ - "case_id": "plba-v2-find-tests-workflow-runtime-factory-negative", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_subintents_v2.yaml", - "runner": "runtime", - "mode": "full_chain", - "actual": { - "intent": "CODE_QA", - "sub_intent": "FIND_TESTS", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 16, - "llm_answer": "Прямых тестов для WorkflowRuntimeFactory в предоставленном контексте не обнаружено.\n\nКосвенные или ближайшие тесты:\n1. tests/test_business_control_actions.py | test_actions_stop_busy_worker_before_timeout:dataflow_slice\n - Проверяет поведение после остановки занятого рабочего перед таймаутом.\n2. tests/test_business_control_actions.py | test_actions_stop_busy_worker_after_timeout:dataflow_slice\n - Проверяет поведение после остановки занятого рабочего после таймаута.\n\nЧто именно проверяется:\n- Поведение рабочих процессов при остановке и проверке их состояния здоровья (\"health\").\n- Запуск и остановка рабочих процессов.\n\nКакие пробелы покрытия видны:\n- Нет подтвержденных тестов конкретно для WorkflowRuntimeFactory. Тесты находятся ближе к поведению рабочих процессов и блокирующих рутин, а не напрямую связаны с созданием или использованием WorkflowRuntimeFactory.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "WorkflowRuntimeFactory" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ] - }, - "passed": true, - "mismatches": [], - "details": { - "case_id": "plba-v2-find-tests-workflow-runtime-factory-negative", - "text": "Где тесты для WorkflowRuntimeFactory?", - "mode": "full_chain", - "run_started_at": "2026-03-12T13:23:57", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Где тесты для WorkflowRuntimeFactory?", - "symbol_resolution": { - "status": "not_found", - "resolved_symbol": null, - "alternatives": [ - "WorkflowRuntimeFactory" - ], - "confidence": 0.0 - }, - "rag_count": 16, - "rag_rows": [ - { - "path": "tests/test_business_control_actions.py", - "content": "test_actions_stop_busy_worker_before_timeout\n -> BlockingRoutine\n -> BlockingRoutine.__init__\n -> BlockingRoutine._release\n -> BlockingRoutine.run", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_actions_stop_busy_worker_before_timeout:dataflow_slice", - "span_start": 43, - "span_end": 212, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 5, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "8bd726155ba387d3579763ee84dfd2f9a90bc917da88f3b2e89416ab5c1254d6", - "edge_type": "dataflow_slice", - "src_symbol_id": "a0bb116ca9d909c93a285667ae033fbd1859b2dad7cf34fcb44816393ef6909c", - "src_qname": "test_actions_stop_busy_worker_before_timeout", - "dst_symbol_id": "d9841bdbb69706c988ae7ae6adf89928dc4fae45943f74064f5382177034ba04", - "dst_ref": "BlockingRoutine.run", - "resolution": "resolved", - "slice_id": "8bd726155ba387d3579763ee84dfd2f9a90bc917da88f3b2e89416ab5c1254d6", - "root_symbol_id": "a0bb116ca9d909c93a285667ae033fbd1859b2dad7cf34fcb44816393ef6909c", - "path_symbols": [ - "test_actions_stop_busy_worker_before_timeout", - "BlockingRoutine", - "BlockingRoutine.__init__", - "BlockingRoutine._release", - "BlockingRoutine.run" - ], - "path_symbol_ids": [ - "a0bb116ca9d909c93a285667ae033fbd1859b2dad7cf34fcb44816393ef6909c", - "a3349c5bc65e4003a4bbd6a8dbb7a54c337e12d1aed930caa701b12e520f1e67", - "486deeed3043c6db985aef258e96ddc67aa53608e67a83962fbd2471f649ddf1", - "d9841bdbb69706c988ae7ae6adf89928dc4fae45943f74064f5382177034ba04" - ], - "path_edge_types": [ - "instantiates", - "writes_attr", - "reads_attr" - ], - "path_length": 5, - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "test_worker_wakes_up_with_configured_interval\n -> ScenarioWorker\n -> ScenarioWorker.__init__\n -> ScenarioWorker._name\n -> ScenarioWorker.name", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_worker_wakes_up_with_configured_interval:dataflow_slice", - "span_start": 52, - "span_end": 166, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 5, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "2fd137f5852febe907f44d3b3e4ea430f89ccfe962ae1442a16ab9df64c8f76c", - "edge_type": "dataflow_slice", - "src_symbol_id": "65f877f78191d65e6a752e41cedc70ebc784c266804a55c1c56440336e1f0d6e", - "src_qname": "test_worker_wakes_up_with_configured_interval", - "dst_symbol_id": "da022da2c49fd9cfd09d6e6da6bbd59aaa7d28efd669ce8444e88d327ddec2fc", - "dst_ref": "ScenarioWorker.name", - "resolution": "resolved", - "slice_id": "2fd137f5852febe907f44d3b3e4ea430f89ccfe962ae1442a16ab9df64c8f76c", - "root_symbol_id": "65f877f78191d65e6a752e41cedc70ebc784c266804a55c1c56440336e1f0d6e", - "path_symbols": [ - "test_worker_wakes_up_with_configured_interval", - "ScenarioWorker", - "ScenarioWorker.__init__", - "ScenarioWorker._name", - "ScenarioWorker.name" - ], - "path_symbol_ids": [ - "65f877f78191d65e6a752e41cedc70ebc784c266804a55c1c56440336e1f0d6e", - "9a1d08a7eb1831c9f2e0db361b5207f036e477c160773ae08c0b287239785c52", - "9c20be046ba06644d1432e0f20eb223663d2b116ee7d91fdc62bc68323f2e593", - "da022da2c49fd9cfd09d6e6da6bbd59aaa7d28efd669ce8444e88d327ddec2fc" - ], - "path_edge_types": [ - "instantiates", - "writes_attr", - "reads_attr" - ], - "path_length": 5, - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "test_actions_stop_busy_worker_before_timeout\n -> BlockingRoutine\n -> BlockingRoutine.__init__\n -> BlockingRoutine._started\n -> BlockingRoutine.run", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_actions_stop_busy_worker_before_timeout:dataflow_slice", - "span_start": 42, - "span_end": 212, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 5, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "f9bcce108870e49afa8b32d4625115a10707a3b0e7473179e958e5752bf258b4", - "edge_type": "dataflow_slice", - "src_symbol_id": "a0bb116ca9d909c93a285667ae033fbd1859b2dad7cf34fcb44816393ef6909c", - "src_qname": "test_actions_stop_busy_worker_before_timeout", - "dst_symbol_id": "d9841bdbb69706c988ae7ae6adf89928dc4fae45943f74064f5382177034ba04", - "dst_ref": "BlockingRoutine.run", - "resolution": "resolved", - "slice_id": "f9bcce108870e49afa8b32d4625115a10707a3b0e7473179e958e5752bf258b4", - "root_symbol_id": "a0bb116ca9d909c93a285667ae033fbd1859b2dad7cf34fcb44816393ef6909c", - "path_symbols": [ - "test_actions_stop_busy_worker_before_timeout", - "BlockingRoutine", - "BlockingRoutine.__init__", - "BlockingRoutine._started", - "BlockingRoutine.run" - ], - "path_symbol_ids": [ - "a0bb116ca9d909c93a285667ae033fbd1859b2dad7cf34fcb44816393ef6909c", - "a3349c5bc65e4003a4bbd6a8dbb7a54c337e12d1aed930caa701b12e520f1e67", - "486deeed3043c6db985aef258e96ddc67aa53608e67a83962fbd2471f649ddf1", - "d9841bdbb69706c988ae7ae6adf89928dc4fae45943f74064f5382177034ba04" - ], - "path_edge_types": [ - "instantiates", - "writes_attr", - "reads_attr" - ], - "path_length": 5, - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "test_actions_stop_busy_worker_after_timeout\n -> BlockingRoutine\n -> BlockingRoutine.__init__\n -> BlockingRoutine._started\n -> BlockingRoutine.run", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_actions_stop_busy_worker_after_timeout:dataflow_slice", - "span_start": 42, - "span_end": 238, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 5, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "8e7db3d2a9226f1c1d9942ac6373cfcafa0d2276758ddb8a3d3c455a3d58024d", - "edge_type": "dataflow_slice", - "src_symbol_id": "66392d3222421d9ba16eda3554940b16e7d5a6f33aa08c5738d35af2e32f1e4a", - "src_qname": "test_actions_stop_busy_worker_after_timeout", - "dst_symbol_id": "d9841bdbb69706c988ae7ae6adf89928dc4fae45943f74064f5382177034ba04", - "dst_ref": "BlockingRoutine.run", - "resolution": "resolved", - "slice_id": "8e7db3d2a9226f1c1d9942ac6373cfcafa0d2276758ddb8a3d3c455a3d58024d", - "root_symbol_id": "66392d3222421d9ba16eda3554940b16e7d5a6f33aa08c5738d35af2e32f1e4a", - "path_symbols": [ - "test_actions_stop_busy_worker_after_timeout", - "BlockingRoutine", - "BlockingRoutine.__init__", - "BlockingRoutine._started", - "BlockingRoutine.run" - ], - "path_symbol_ids": [ - "66392d3222421d9ba16eda3554940b16e7d5a6f33aa08c5738d35af2e32f1e4a", - "a3349c5bc65e4003a4bbd6a8dbb7a54c337e12d1aed930caa701b12e520f1e67", - "486deeed3043c6db985aef258e96ddc67aa53608e67a83962fbd2471f649ddf1", - "d9841bdbb69706c988ae7ae6adf89928dc4fae45943f74064f5382177034ba04" - ], - "path_edge_types": [ - "instantiates", - "writes_attr", - "reads_attr" - ], - "path_length": 5, - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "test_actions_stop_busy_worker_after_timeout\n -> BlockingRoutine\n -> BlockingRoutine.__init__\n -> BlockingRoutine._release\n -> BlockingRoutine.run", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_actions_stop_busy_worker_after_timeout:dataflow_slice", - "span_start": 43, - "span_end": 238, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 5, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "b59da9da82f9dfc8a9b695a08213786385da1ae9e17561ec3a0450a574a8cb39", - "edge_type": "dataflow_slice", - "src_symbol_id": "66392d3222421d9ba16eda3554940b16e7d5a6f33aa08c5738d35af2e32f1e4a", - "src_qname": "test_actions_stop_busy_worker_after_timeout", - "dst_symbol_id": "d9841bdbb69706c988ae7ae6adf89928dc4fae45943f74064f5382177034ba04", - "dst_ref": "BlockingRoutine.run", - "resolution": "resolved", - "slice_id": "b59da9da82f9dfc8a9b695a08213786385da1ae9e17561ec3a0450a574a8cb39", - "root_symbol_id": "66392d3222421d9ba16eda3554940b16e7d5a6f33aa08c5738d35af2e32f1e4a", - "path_symbols": [ - "test_actions_stop_busy_worker_after_timeout", - "BlockingRoutine", - "BlockingRoutine.__init__", - "BlockingRoutine._release", - "BlockingRoutine.run" - ], - "path_symbol_ids": [ - "66392d3222421d9ba16eda3554940b16e7d5a6f33aa08c5738d35af2e32f1e4a", - "a3349c5bc65e4003a4bbd6a8dbb7a54c337e12d1aed930caa701b12e520f1e67", - "486deeed3043c6db985aef258e96ddc67aa53608e67a83962fbd2471f649ddf1", - "d9841bdbb69706c988ae7ae6adf89928dc4fae45943f74064f5382177034ba04" - ], - "path_edge_types": [ - "instantiates", - "writes_attr", - "reads_attr" - ], - "path_length": 5, - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "test_actions_start_stop_and_health_when_worker_is_idle\n -> ScenarioWorker\n -> ScenarioWorker.__init__\n -> ScenarioWorker._name\n -> ScenarioWorker.name", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_actions_start_stop_and_health_when_worker_is_idle:dataflow_slice", - "span_start": 52, - "span_end": 182, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 5, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "8fb3c9e775ad1cfa91eebb8b8cef367dc53c923584236122235446e0579b468e", - "edge_type": "dataflow_slice", - "src_symbol_id": "09a78d8eb31c2da14fee58da53b5da7a5065a4c23b6300748a6d44517a5284b8", - "src_qname": "test_actions_start_stop_and_health_when_worker_is_idle", - "dst_symbol_id": "da022da2c49fd9cfd09d6e6da6bbd59aaa7d28efd669ce8444e88d327ddec2fc", - "dst_ref": "ScenarioWorker.name", - "resolution": "resolved", - "slice_id": "8fb3c9e775ad1cfa91eebb8b8cef367dc53c923584236122235446e0579b468e", - "root_symbol_id": "09a78d8eb31c2da14fee58da53b5da7a5065a4c23b6300748a6d44517a5284b8", - "path_symbols": [ - "test_actions_start_stop_and_health_when_worker_is_idle", - "ScenarioWorker", - "ScenarioWorker.__init__", - "ScenarioWorker._name", - "ScenarioWorker.name" - ], - "path_symbol_ids": [ - "09a78d8eb31c2da14fee58da53b5da7a5065a4c23b6300748a6d44517a5284b8", - "9a1d08a7eb1831c9f2e0db361b5207f036e477c160773ae08c0b287239785c52", - "9c20be046ba06644d1432e0f20eb223663d2b116ee7d91fdc62bc68323f2e593", - "da022da2c49fd9cfd09d6e6da6bbd59aaa7d28efd669ce8444e88d327ddec2fc" - ], - "path_edge_types": [ - "instantiates", - "writes_attr", - "reads_attr" - ], - "path_length": 5, - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "def test_actions_start_stop_and_health_when_worker_is_idle() -> None:\n runtime, base_url = _build_runtime(ScenarioWorker(\"idle-worker\", IntervalRoutine(), interval=0.2))\n try:\n stop_status, stop_payload = _http_call_json(base_url, \"/actions/stop\", method=\"POST\")\n assert stop_status == 200\n assert isinstance(stop_payload.get(\"detail\"), dict)\n assert stop_payload[\"detail\"][\"timed_out\"] is False\n assert stop_payload[\"detail\"][\"state\"] == \"stopped\"\n\n health_stopped_status, health_stopped_payload = _http_call_json(base_url, \"/health\")\n assert health_stopped_status == 503\n assert health_stopped_payload[\"state\"] == \"stopped\"\n assert health_stopped_payload[\"status\"] == \"unhealthy\"\n\n start_status, start_payload = _http_call_json(base_url, \"/actions/start\", method=\"POST\")\n assert start_status == 200\n assert isinstance(start_payload.get(\"detail\"), dict)\n assert start_payload[\"detail\"][\"timed_out\"] is False\n assert start_payload[\"detail\"][\"state\"] in {\"idle\", \"busy\"}\n\n health_started_status, health_started_payload = _http_call_json(base_url, \"/health\")\n assert health_started_status == 200\n assert health_started_payload[\"status\"] == \"ok\"\n assert health_started_payload[\"state\"] in {\"idle\", \"busy\"}\n finally:\n runtime.stop()", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:test_actions_start_stop_and_health_when_worker_is_idle", - "span_start": 181, - "span_end": 206, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 8, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "def _poll_until_stopped(base_url: str, timeout: float = 2.0) -> bool:\n deadline = monotonic() + timeout\n while monotonic() < deadline:\n _, payload = _http_call_json(base_url, \"/actions/status\")\n if payload.get(\"detail\") == \"stopped\":\n return True\n sleep(0.05)\n return False", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:_poll_until_stopped", - "span_start": 144, - "span_end": 151, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 5, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "def test_worker_wakes_up_with_configured_interval() -> None:\n interval = 0.15\n routine = IntervalRoutine()\n worker = ScenarioWorker(\"interval-worker\", routine, interval=interval)\n runtime = RuntimeManager()\n runtime.register_module(WorkerModule(worker))\n\n runtime.start()\n try:\n assert routine.wait_runs(count=3, timeout=2.0) is True\n finally:\n runtime.stop()\n\n deltas = routine.deltas()\n assert len(deltas) >= 2\n assert all(delta >= interval * 0.7 for delta in deltas[:2])", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:test_worker_wakes_up_with_configured_interval", - "span_start": 163, - "span_end": 178, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 7, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "class BlockingRoutine:\n def __init__(self, started: Event, release: Event) -> None:\n self._started = started\n self._release = release\n\n def run(self) -> None:\n self._started.set()\n self._release.wait(timeout=5.0)", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:BlockingRoutine", - "span_start": 40, - "span_end": 47, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 1, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "class WorkerModule(ApplicationModule):\n def __init__(self, worker: Worker) -> None:\n self._worker = worker\n\n @property\n def name(self) -> str:\n return \"business-tests\"\n\n def register(self, registry: ModuleRegistry) -> None:\n registry.add_worker(self._worker)", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:WorkerModule", - "span_start": 113, - "span_end": 122, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 3, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "def _http_call_json(\n base_url: str,\n path: str,\n *,\n method: str = \"GET\",\n headers: dict[str, str] | None = None,\n) -> tuple[int, dict[str, object]]:\n request = Request(f\"{base_url}{path}\", method=method, headers=headers or {})\n try:\n with urlopen(request, timeout=15.0) as response:\n status = response.status\n body = response.read()\n except HTTPError as error:\n status = error.code\n body = error.read()\n payload = json.loads(body.decode(\"utf-8\"))\n return status, payload", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:_http_call_json", - "span_start": 125, - "span_end": 141, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 4, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "def _build_runtime(worker: Worker, *, control_timeout: int = 1) -> tuple[RuntimeManager, str]:\n runtime = RuntimeManager()\n channel = HttpControlChannel(host=\"127.0.0.1\", port=0, timeout=control_timeout)\n runtime.control_plane.register_channel(channel)\n runtime.register_module(WorkerModule(worker))\n runtime.start()\n return runtime, f\"http://127.0.0.1:{channel.port}\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:_build_runtime", - "span_start": 154, - "span_end": 160, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 6, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "class ScenarioWorker(Worker):\n def __init__(self, name: str, routine: object, *, interval: float = 0.05) -> None:\n self._name = name\n self._routine = routine\n self._interval = interval\n self._thread: Thread | None = None\n self._stop_requested = Event()\n self._in_flight = 0\n self._runs = 0\n self._lock = Lock()\n\n @property\n def name(self) -> str:\n return self._name\n\n @property\n def critical(self) -> bool:\n return True\n\n def start(self) -> None:\n if self._thread is not None and self._thread.is_alive():\n return\n self._stop_requested.clear()\n self._thread = Thread(target=self._loop, name=f\"{self._name}-thread\", daemon=True)\n self._thread.start()\n\n def stop(self, force: bool = False) -> None:\n self._stop_requested.set()\n\n def health(self) -> WorkerHealth:\n return WorkerHealth(name=self.name, status=\"ok\", critical=True, meta={\"runs\": self._runs})\n\n def status(self) -> WorkerStatus:\n thread_alive = self._thread is not None and self._thread.is_alive()\n with self._lock:\n in_flight = self._in_flight\n runs = self._runs\n if not thread_alive:\n state = \"stopped\"\n elif self._stop_requested.is_set():\n state = \"stopping\"\n elif in_flight > 0:\n state = \"busy\"\n else:\n state = \"idle\"\n return WorkerStatus(name=self.name, state=state, in_flight=in_flight, meta={\"runs\": runs})\n\n def _loop(self) -> None:\n while not self._stop_requested.is_set():\n with self._lock:\n self._in_flight += 1\n try:\n self._routine.run()\n with self._lock:\n self._runs += 1\n finally:\n with self._lock:\n self._in_flight -= 1\n if self._stop_requested.is_set():\n return\n sleep(self._interval)", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:ScenarioWorker", - "span_start": 50, - "span_end": 110, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 2, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "class IntervalRoutine:\n calls: list[float] = field(default_factory=list)\n _lock: Lock = field(default_factory=Lock)\n\n def run(self) -> None:\n with self._lock:\n self.calls.append(monotonic())\n\n def wait_runs(self, count: int, timeout: float) -> bool:\n deadline = monotonic() + timeout\n while monotonic() < deadline:\n with self._lock:\n if len(self.calls) >= count:\n return True\n sleep(0.01)\n return False\n\n def deltas(self) -> list[float]:\n with self._lock:\n return [self.calls[index + 1] - self.calls[index] for index in range(len(self.calls) - 1)]", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:IntervalRoutine", - "span_start": 18, - "span_end": 37, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "def test_actions_stop_busy_worker_before_timeout() -> None:\n started = Event()\n release = Event()\n runtime, base_url = _build_runtime(ScenarioWorker(\"busy-worker\", BlockingRoutine(started, release)))\n assert started.wait(timeout=1.0) is True\n\n def release_later() -> None:\n sleep(0.2)\n release.set()\n\n Thread(target=release_later, daemon=True).start()\n try:\n status, payload = _http_call_json(base_url, \"/actions/stop\", method=\"POST\")\n assert status == 200\n assert isinstance(payload.get(\"detail\"), dict)\n assert payload[\"detail\"][\"timed_out\"] is False\n assert payload[\"detail\"][\"state\"] == \"stopped\"\n\n health_status, health_payload = _http_call_json(base_url, \"/health\")\n assert health_status == 503\n assert health_payload[\"status\"] == \"unhealthy\"\n assert health_payload[\"state\"] == \"stopped\"\n finally:\n runtime.stop()", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:test_actions_stop_busy_worker_before_timeout", - "span_start": 209, - "span_end": 232, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 9, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "llm_answer": "Прямых тестов для WorkflowRuntimeFactory в предоставленном контексте не обнаружено.\n\nКосвенные или ближайшие тесты:\n1. tests/test_business_control_actions.py | test_actions_stop_busy_worker_before_timeout:dataflow_slice\n - Проверяет поведение после остановки занятого рабочего перед таймаутом.\n2. tests/test_business_control_actions.py | test_actions_stop_busy_worker_after_timeout:dataflow_slice\n - Проверяет поведение после остановки занятого рабочего после таймаута.\n\nЧто именно проверяется:\n- Поведение рабочих процессов при остановке и проверке их состояния здоровья (\"health\").\n- Запуск и остановка рабочих процессов.\n\nКакие пробелы покрытия видны:\n- Нет подтвержденных тестов конкретно для WorkflowRuntimeFactory. Тесты находятся ближе к поведению рабочих процессов и блокирующих рутин, а не напрямую связаны с созданием или использованием WorkflowRuntimeFactory.", - "summary": { - "router": { - "intent": "CODE_QA", - "sub_intent": "FIND_TESTS", - "confidence": null - }, - "retrieval": { - "profile": "code", - "layers_hit": [ - "C0_SOURCE_CHUNKS", - "C2_DEPENDENCY_GRAPH" - ], - "evidence_sufficient": true - }, - "llm": { - "answer_status": "answered", - "groundedness": "grounded" - } - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "FIND_TESTS", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "WorkflowRuntimeFactory" - ], - "keyword_hints": [ - "WorkflowRuntimeFactory" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**", - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "test_file_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "test_symbol_patterns": [ - "test_workflow_runtime_factory", - "TestWorkflowRuntimeFactory", - "WorkflowRuntimeFactory" - ], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C0_SOURCE_CHUNKS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C0_SOURCE_CHUNKS": 10 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [], - "include_globs": [ - "src", - "tests" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests" - ] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src", - "tests" - ], - "include_globs": [ - "src", - "tests" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests" - ] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src", - "tests" - ], - "include_globs": [ - "src", - "tests" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests" - ] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "WorkflowRuntimeFactory", - "path_scope": [], - "include_globs": [ - "src/**", - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "Где тесты для WorkflowRuntimeFactory? test_workflow_runtime_factory TestWorkflowRuntimeFactory WorkflowRuntimeFactory", - "path_scope": [], - "include_globs": [ - "src/**", - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "top_k": 6, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Где тесты для WorkflowRuntimeFactory? test_workflow_runtime_factory TestWorkflowRuntimeFactory WorkflowRuntimeFactory", - "path_scope": [], - "include_globs": [ - "src/**", - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "top_k": 10, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [], - "normalized_include_globs": [ - "src", - "tests" - ], - "normalized_exclude_globs": [], - "normalized_prefer_globs": [ - "tests" - ], - "filter_stage": "post_rank", - "candidates_before_filter": 0, - "candidates_after_filter": 0 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src", - "tests" - ], - "normalized_include_globs": [ - "src", - "tests" - ], - "normalized_exclude_globs": [], - "normalized_prefer_globs": [ - "tests" - ], - "filter_stage": "post_rank", - "candidates_before_filter": 6, - "candidates_after_filter": 6 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src", - "tests" - ], - "normalized_include_globs": [ - "src", - "tests" - ], - "normalized_exclude_globs": [], - "normalized_prefer_globs": [ - "tests" - ], - "filter_stage": "post_rank", - "candidates_before_filter": 10, - "candidates_after_filter": 10 - } - ], - "fallback": { - "used": true, - "reason": "scope_relaxed_no_hits" - }, - "symbol_resolution": { - "status": "not_found", - "resolved_symbol": null, - "alternatives": [ - "WorkflowRuntimeFactory" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "miss", - "hit_count": 0, - "fail_reason": "scope_relaxed_no_hits" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 6, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 10, - "fail_reason": null - } - ] - }, - "constraint_violations": [ - { - "type": "LAYER_MISSING", - "severity": "warn", - "details": { - "layer": "C1_SYMBOL_CATALOG", - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ] - }, - "suggested_fix": "Increase top_k for this layer or relax constraints for retrieval." - } - ], - "timings_ms": { - "router": 0, - "symbol_resolution": 0, - "retrieval_total": 91, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 39, - "C2_DEPENDENCY_GRAPH": 38, - "C0_SOURCE_CHUNKS": 12 - }, - "merge_rank": 0, - "prompt_build": 0, - "llm_call": 1637 - }, - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 998, - "evidence_rows": 16, - "evidence_chars": 8149 - }, - "evidence_summary": [ - { - "layer": "C2_DEPENDENCY_GRAPH", - "count": 6, - "unique_paths": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 10, - "unique_paths": 1 - } - ], - "prompt_template_id": "intent_code_qa_find_tests_ru_v2", - "system_prompt_version": "v1" - }, - "router": { - "conversation_mode": "START", - "keyword_hints": [ - "WorkflowRuntimeFactory" - ], - "path_scope": [] - }, - "llm": { - "used_evidence_count": 16, - "missing_evidence_reason": null - } - }, - "run_info": { - "case_id": "plba-v2-find-tests-workflow-runtime-factory-negative", - "mode": "full_chain", - "run_started_at": "2026-03-12T13:23:57", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - }, - "input_request": { - "text": "Где тесты для WorkflowRuntimeFactory?", - "normalized_query": "Где тесты для WorkflowRuntimeFactory?" - }, - "steps": [ - { - "step": "intent_router", - "input": { - "query": "Где тесты для WorkflowRuntimeFactory?" - }, - "output": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Где тесты для WorkflowRuntimeFactory?" - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "FIND_TESTS", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "WorkflowRuntimeFactory" - ], - "keyword_hints": [ - "WorkflowRuntimeFactory" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**", - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "test_file_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "test_symbol_patterns": [ - "test_workflow_runtime_factory", - "TestWorkflowRuntimeFactory", - "WorkflowRuntimeFactory" - ], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "timings_ms": { - "router": 0 - } - } - }, - { - "step": "retrieval", - "input": { - "query": "Где тесты для WorkflowRuntimeFactory?" - }, - "output": { - "symbol_resolution": { - "status": "not_found", - "resolved_symbol": null, - "alternatives": [ - "WorkflowRuntimeFactory" - ], - "confidence": 0.0 - }, - "rag_count": 16, - "rag_rows": [ - { - "path": "tests/test_business_control_actions.py", - "content": "test_actions_stop_busy_worker_before_timeout\n -> BlockingRoutine\n -> BlockingRoutine.__init__\n -> BlockingRoutine._release\n -> BlockingRoutine.run", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_actions_stop_busy_worker_before_timeout:dataflow_slice", - "span_start": 43, - "span_end": 212, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 5, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "8bd726155ba387d3579763ee84dfd2f9a90bc917da88f3b2e89416ab5c1254d6", - "edge_type": "dataflow_slice", - "src_symbol_id": "a0bb116ca9d909c93a285667ae033fbd1859b2dad7cf34fcb44816393ef6909c", - "src_qname": "test_actions_stop_busy_worker_before_timeout", - "dst_symbol_id": "d9841bdbb69706c988ae7ae6adf89928dc4fae45943f74064f5382177034ba04", - "dst_ref": "BlockingRoutine.run", - "resolution": "resolved", - "slice_id": "8bd726155ba387d3579763ee84dfd2f9a90bc917da88f3b2e89416ab5c1254d6", - "root_symbol_id": "a0bb116ca9d909c93a285667ae033fbd1859b2dad7cf34fcb44816393ef6909c", - "path_symbols": [ - "test_actions_stop_busy_worker_before_timeout", - "BlockingRoutine", - "BlockingRoutine.__init__", - "BlockingRoutine._release", - "BlockingRoutine.run" - ], - "path_symbol_ids": [ - "a0bb116ca9d909c93a285667ae033fbd1859b2dad7cf34fcb44816393ef6909c", - "a3349c5bc65e4003a4bbd6a8dbb7a54c337e12d1aed930caa701b12e520f1e67", - "486deeed3043c6db985aef258e96ddc67aa53608e67a83962fbd2471f649ddf1", - "d9841bdbb69706c988ae7ae6adf89928dc4fae45943f74064f5382177034ba04" - ], - "path_edge_types": [ - "instantiates", - "writes_attr", - "reads_attr" - ], - "path_length": 5, - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "test_worker_wakes_up_with_configured_interval\n -> ScenarioWorker\n -> ScenarioWorker.__init__\n -> ScenarioWorker._name\n -> ScenarioWorker.name", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_worker_wakes_up_with_configured_interval:dataflow_slice", - "span_start": 52, - "span_end": 166, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 5, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "2fd137f5852febe907f44d3b3e4ea430f89ccfe962ae1442a16ab9df64c8f76c", - "edge_type": "dataflow_slice", - "src_symbol_id": "65f877f78191d65e6a752e41cedc70ebc784c266804a55c1c56440336e1f0d6e", - "src_qname": "test_worker_wakes_up_with_configured_interval", - "dst_symbol_id": "da022da2c49fd9cfd09d6e6da6bbd59aaa7d28efd669ce8444e88d327ddec2fc", - "dst_ref": "ScenarioWorker.name", - "resolution": "resolved", - "slice_id": "2fd137f5852febe907f44d3b3e4ea430f89ccfe962ae1442a16ab9df64c8f76c", - "root_symbol_id": "65f877f78191d65e6a752e41cedc70ebc784c266804a55c1c56440336e1f0d6e", - "path_symbols": [ - "test_worker_wakes_up_with_configured_interval", - "ScenarioWorker", - "ScenarioWorker.__init__", - "ScenarioWorker._name", - "ScenarioWorker.name" - ], - "path_symbol_ids": [ - "65f877f78191d65e6a752e41cedc70ebc784c266804a55c1c56440336e1f0d6e", - "9a1d08a7eb1831c9f2e0db361b5207f036e477c160773ae08c0b287239785c52", - "9c20be046ba06644d1432e0f20eb223663d2b116ee7d91fdc62bc68323f2e593", - "da022da2c49fd9cfd09d6e6da6bbd59aaa7d28efd669ce8444e88d327ddec2fc" - ], - "path_edge_types": [ - "instantiates", - "writes_attr", - "reads_attr" - ], - "path_length": 5, - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "test_actions_stop_busy_worker_before_timeout\n -> BlockingRoutine\n -> BlockingRoutine.__init__\n -> BlockingRoutine._started\n -> BlockingRoutine.run", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_actions_stop_busy_worker_before_timeout:dataflow_slice", - "span_start": 42, - "span_end": 212, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 5, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "f9bcce108870e49afa8b32d4625115a10707a3b0e7473179e958e5752bf258b4", - "edge_type": "dataflow_slice", - "src_symbol_id": "a0bb116ca9d909c93a285667ae033fbd1859b2dad7cf34fcb44816393ef6909c", - "src_qname": "test_actions_stop_busy_worker_before_timeout", - "dst_symbol_id": "d9841bdbb69706c988ae7ae6adf89928dc4fae45943f74064f5382177034ba04", - "dst_ref": "BlockingRoutine.run", - "resolution": "resolved", - "slice_id": "f9bcce108870e49afa8b32d4625115a10707a3b0e7473179e958e5752bf258b4", - "root_symbol_id": "a0bb116ca9d909c93a285667ae033fbd1859b2dad7cf34fcb44816393ef6909c", - "path_symbols": [ - "test_actions_stop_busy_worker_before_timeout", - "BlockingRoutine", - "BlockingRoutine.__init__", - "BlockingRoutine._started", - "BlockingRoutine.run" - ], - "path_symbol_ids": [ - "a0bb116ca9d909c93a285667ae033fbd1859b2dad7cf34fcb44816393ef6909c", - "a3349c5bc65e4003a4bbd6a8dbb7a54c337e12d1aed930caa701b12e520f1e67", - "486deeed3043c6db985aef258e96ddc67aa53608e67a83962fbd2471f649ddf1", - "d9841bdbb69706c988ae7ae6adf89928dc4fae45943f74064f5382177034ba04" - ], - "path_edge_types": [ - "instantiates", - "writes_attr", - "reads_attr" - ], - "path_length": 5, - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "test_actions_stop_busy_worker_after_timeout\n -> BlockingRoutine\n -> BlockingRoutine.__init__\n -> BlockingRoutine._started\n -> BlockingRoutine.run", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_actions_stop_busy_worker_after_timeout:dataflow_slice", - "span_start": 42, - "span_end": 238, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 5, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "8e7db3d2a9226f1c1d9942ac6373cfcafa0d2276758ddb8a3d3c455a3d58024d", - "edge_type": "dataflow_slice", - "src_symbol_id": "66392d3222421d9ba16eda3554940b16e7d5a6f33aa08c5738d35af2e32f1e4a", - "src_qname": "test_actions_stop_busy_worker_after_timeout", - "dst_symbol_id": "d9841bdbb69706c988ae7ae6adf89928dc4fae45943f74064f5382177034ba04", - "dst_ref": "BlockingRoutine.run", - "resolution": "resolved", - "slice_id": "8e7db3d2a9226f1c1d9942ac6373cfcafa0d2276758ddb8a3d3c455a3d58024d", - "root_symbol_id": "66392d3222421d9ba16eda3554940b16e7d5a6f33aa08c5738d35af2e32f1e4a", - "path_symbols": [ - "test_actions_stop_busy_worker_after_timeout", - "BlockingRoutine", - "BlockingRoutine.__init__", - "BlockingRoutine._started", - "BlockingRoutine.run" - ], - "path_symbol_ids": [ - "66392d3222421d9ba16eda3554940b16e7d5a6f33aa08c5738d35af2e32f1e4a", - "a3349c5bc65e4003a4bbd6a8dbb7a54c337e12d1aed930caa701b12e520f1e67", - "486deeed3043c6db985aef258e96ddc67aa53608e67a83962fbd2471f649ddf1", - "d9841bdbb69706c988ae7ae6adf89928dc4fae45943f74064f5382177034ba04" - ], - "path_edge_types": [ - "instantiates", - "writes_attr", - "reads_attr" - ], - "path_length": 5, - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "test_actions_stop_busy_worker_after_timeout\n -> BlockingRoutine\n -> BlockingRoutine.__init__\n -> BlockingRoutine._release\n -> BlockingRoutine.run", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_actions_stop_busy_worker_after_timeout:dataflow_slice", - "span_start": 43, - "span_end": 238, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 5, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "b59da9da82f9dfc8a9b695a08213786385da1ae9e17561ec3a0450a574a8cb39", - "edge_type": "dataflow_slice", - "src_symbol_id": "66392d3222421d9ba16eda3554940b16e7d5a6f33aa08c5738d35af2e32f1e4a", - "src_qname": "test_actions_stop_busy_worker_after_timeout", - "dst_symbol_id": "d9841bdbb69706c988ae7ae6adf89928dc4fae45943f74064f5382177034ba04", - "dst_ref": "BlockingRoutine.run", - "resolution": "resolved", - "slice_id": "b59da9da82f9dfc8a9b695a08213786385da1ae9e17561ec3a0450a574a8cb39", - "root_symbol_id": "66392d3222421d9ba16eda3554940b16e7d5a6f33aa08c5738d35af2e32f1e4a", - "path_symbols": [ - "test_actions_stop_busy_worker_after_timeout", - "BlockingRoutine", - "BlockingRoutine.__init__", - "BlockingRoutine._release", - "BlockingRoutine.run" - ], - "path_symbol_ids": [ - "66392d3222421d9ba16eda3554940b16e7d5a6f33aa08c5738d35af2e32f1e4a", - "a3349c5bc65e4003a4bbd6a8dbb7a54c337e12d1aed930caa701b12e520f1e67", - "486deeed3043c6db985aef258e96ddc67aa53608e67a83962fbd2471f649ddf1", - "d9841bdbb69706c988ae7ae6adf89928dc4fae45943f74064f5382177034ba04" - ], - "path_edge_types": [ - "instantiates", - "writes_attr", - "reads_attr" - ], - "path_length": 5, - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "test_actions_start_stop_and_health_when_worker_is_idle\n -> ScenarioWorker\n -> ScenarioWorker.__init__\n -> ScenarioWorker._name\n -> ScenarioWorker.name", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_actions_start_stop_and_health_when_worker_is_idle:dataflow_slice", - "span_start": 52, - "span_end": 182, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 5, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "8fb3c9e775ad1cfa91eebb8b8cef367dc53c923584236122235446e0579b468e", - "edge_type": "dataflow_slice", - "src_symbol_id": "09a78d8eb31c2da14fee58da53b5da7a5065a4c23b6300748a6d44517a5284b8", - "src_qname": "test_actions_start_stop_and_health_when_worker_is_idle", - "dst_symbol_id": "da022da2c49fd9cfd09d6e6da6bbd59aaa7d28efd669ce8444e88d327ddec2fc", - "dst_ref": "ScenarioWorker.name", - "resolution": "resolved", - "slice_id": "8fb3c9e775ad1cfa91eebb8b8cef367dc53c923584236122235446e0579b468e", - "root_symbol_id": "09a78d8eb31c2da14fee58da53b5da7a5065a4c23b6300748a6d44517a5284b8", - "path_symbols": [ - "test_actions_start_stop_and_health_when_worker_is_idle", - "ScenarioWorker", - "ScenarioWorker.__init__", - "ScenarioWorker._name", - "ScenarioWorker.name" - ], - "path_symbol_ids": [ - "09a78d8eb31c2da14fee58da53b5da7a5065a4c23b6300748a6d44517a5284b8", - "9a1d08a7eb1831c9f2e0db361b5207f036e477c160773ae08c0b287239785c52", - "9c20be046ba06644d1432e0f20eb223663d2b116ee7d91fdc62bc68323f2e593", - "da022da2c49fd9cfd09d6e6da6bbd59aaa7d28efd669ce8444e88d327ddec2fc" - ], - "path_edge_types": [ - "instantiates", - "writes_attr", - "reads_attr" - ], - "path_length": 5, - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "def test_actions_start_stop_and_health_when_worker_is_idle() -> None:\n runtime, base_url = _build_runtime(ScenarioWorker(\"idle-worker\", IntervalRoutine(), interval=0.2))\n try:\n stop_status, stop_payload = _http_call_json(base_url, \"/actions/stop\", method=\"POST\")\n assert stop_status == 200\n assert isinstance(stop_payload.get(\"detail\"), dict)\n assert stop_payload[\"detail\"][\"timed_out\"] is False\n assert stop_payload[\"detail\"][\"state\"] == \"stopped\"\n\n health_stopped_status, health_stopped_payload = _http_call_json(base_url, \"/health\")\n assert health_stopped_status == 503\n assert health_stopped_payload[\"state\"] == \"stopped\"\n assert health_stopped_payload[\"status\"] == \"unhealthy\"\n\n start_status, start_payload = _http_call_json(base_url, \"/actions/start\", method=\"POST\")\n assert start_status == 200\n assert isinstance(start_payload.get(\"detail\"), dict)\n assert start_payload[\"detail\"][\"timed_out\"] is False\n assert start_payload[\"detail\"][\"state\"] in {\"idle\", \"busy\"}\n\n health_started_status, health_started_payload = _http_call_json(base_url, \"/health\")\n assert health_started_status == 200\n assert health_started_payload[\"status\"] == \"ok\"\n assert health_started_payload[\"state\"] in {\"idle\", \"busy\"}\n finally:\n runtime.stop()", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:test_actions_start_stop_and_health_when_worker_is_idle", - "span_start": 181, - "span_end": 206, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 8, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "def _poll_until_stopped(base_url: str, timeout: float = 2.0) -> bool:\n deadline = monotonic() + timeout\n while monotonic() < deadline:\n _, payload = _http_call_json(base_url, \"/actions/status\")\n if payload.get(\"detail\") == \"stopped\":\n return True\n sleep(0.05)\n return False", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:_poll_until_stopped", - "span_start": 144, - "span_end": 151, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 5, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "def test_worker_wakes_up_with_configured_interval() -> None:\n interval = 0.15\n routine = IntervalRoutine()\n worker = ScenarioWorker(\"interval-worker\", routine, interval=interval)\n runtime = RuntimeManager()\n runtime.register_module(WorkerModule(worker))\n\n runtime.start()\n try:\n assert routine.wait_runs(count=3, timeout=2.0) is True\n finally:\n runtime.stop()\n\n deltas = routine.deltas()\n assert len(deltas) >= 2\n assert all(delta >= interval * 0.7 for delta in deltas[:2])", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:test_worker_wakes_up_with_configured_interval", - "span_start": 163, - "span_end": 178, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 7, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "class BlockingRoutine:\n def __init__(self, started: Event, release: Event) -> None:\n self._started = started\n self._release = release\n\n def run(self) -> None:\n self._started.set()\n self._release.wait(timeout=5.0)", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:BlockingRoutine", - "span_start": 40, - "span_end": 47, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 1, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "class WorkerModule(ApplicationModule):\n def __init__(self, worker: Worker) -> None:\n self._worker = worker\n\n @property\n def name(self) -> str:\n return \"business-tests\"\n\n def register(self, registry: ModuleRegistry) -> None:\n registry.add_worker(self._worker)", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:WorkerModule", - "span_start": 113, - "span_end": 122, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 3, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "def _http_call_json(\n base_url: str,\n path: str,\n *,\n method: str = \"GET\",\n headers: dict[str, str] | None = None,\n) -> tuple[int, dict[str, object]]:\n request = Request(f\"{base_url}{path}\", method=method, headers=headers or {})\n try:\n with urlopen(request, timeout=15.0) as response:\n status = response.status\n body = response.read()\n except HTTPError as error:\n status = error.code\n body = error.read()\n payload = json.loads(body.decode(\"utf-8\"))\n return status, payload", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:_http_call_json", - "span_start": 125, - "span_end": 141, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 4, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "def _build_runtime(worker: Worker, *, control_timeout: int = 1) -> tuple[RuntimeManager, str]:\n runtime = RuntimeManager()\n channel = HttpControlChannel(host=\"127.0.0.1\", port=0, timeout=control_timeout)\n runtime.control_plane.register_channel(channel)\n runtime.register_module(WorkerModule(worker))\n runtime.start()\n return runtime, f\"http://127.0.0.1:{channel.port}\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:_build_runtime", - "span_start": 154, - "span_end": 160, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 6, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "class ScenarioWorker(Worker):\n def __init__(self, name: str, routine: object, *, interval: float = 0.05) -> None:\n self._name = name\n self._routine = routine\n self._interval = interval\n self._thread: Thread | None = None\n self._stop_requested = Event()\n self._in_flight = 0\n self._runs = 0\n self._lock = Lock()\n\n @property\n def name(self) -> str:\n return self._name\n\n @property\n def critical(self) -> bool:\n return True\n\n def start(self) -> None:\n if self._thread is not None and self._thread.is_alive():\n return\n self._stop_requested.clear()\n self._thread = Thread(target=self._loop, name=f\"{self._name}-thread\", daemon=True)\n self._thread.start()\n\n def stop(self, force: bool = False) -> None:\n self._stop_requested.set()\n\n def health(self) -> WorkerHealth:\n return WorkerHealth(name=self.name, status=\"ok\", critical=True, meta={\"runs\": self._runs})\n\n def status(self) -> WorkerStatus:\n thread_alive = self._thread is not None and self._thread.is_alive()\n with self._lock:\n in_flight = self._in_flight\n runs = self._runs\n if not thread_alive:\n state = \"stopped\"\n elif self._stop_requested.is_set():\n state = \"stopping\"\n elif in_flight > 0:\n state = \"busy\"\n else:\n state = \"idle\"\n return WorkerStatus(name=self.name, state=state, in_flight=in_flight, meta={\"runs\": runs})\n\n def _loop(self) -> None:\n while not self._stop_requested.is_set():\n with self._lock:\n self._in_flight += 1\n try:\n self._routine.run()\n with self._lock:\n self._runs += 1\n finally:\n with self._lock:\n self._in_flight -= 1\n if self._stop_requested.is_set():\n return\n sleep(self._interval)", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:ScenarioWorker", - "span_start": 50, - "span_end": 110, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 2, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "class IntervalRoutine:\n calls: list[float] = field(default_factory=list)\n _lock: Lock = field(default_factory=Lock)\n\n def run(self) -> None:\n with self._lock:\n self.calls.append(monotonic())\n\n def wait_runs(self, count: int, timeout: float) -> bool:\n deadline = monotonic() + timeout\n while monotonic() < deadline:\n with self._lock:\n if len(self.calls) >= count:\n return True\n sleep(0.01)\n return False\n\n def deltas(self) -> list[float]:\n with self._lock:\n return [self.calls[index + 1] - self.calls[index] for index in range(len(self.calls) - 1)]", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:IntervalRoutine", - "span_start": 18, - "span_end": 37, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "def test_actions_stop_busy_worker_before_timeout() -> None:\n started = Event()\n release = Event()\n runtime, base_url = _build_runtime(ScenarioWorker(\"busy-worker\", BlockingRoutine(started, release)))\n assert started.wait(timeout=1.0) is True\n\n def release_later() -> None:\n sleep(0.2)\n release.set()\n\n Thread(target=release_later, daemon=True).start()\n try:\n status, payload = _http_call_json(base_url, \"/actions/stop\", method=\"POST\")\n assert status == 200\n assert isinstance(payload.get(\"detail\"), dict)\n assert payload[\"detail\"][\"timed_out\"] is False\n assert payload[\"detail\"][\"state\"] == \"stopped\"\n\n health_status, health_payload = _http_call_json(base_url, \"/health\")\n assert health_status == 503\n assert health_payload[\"status\"] == \"unhealthy\"\n assert health_payload[\"state\"] == \"stopped\"\n finally:\n runtime.stop()", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:test_actions_stop_busy_worker_before_timeout", - "span_start": 209, - "span_end": 232, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 9, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ] - }, - "diagnostics": { - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C0_SOURCE_CHUNKS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C0_SOURCE_CHUNKS": 10 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [], - "include_globs": [ - "src", - "tests" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests" - ] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src", - "tests" - ], - "include_globs": [ - "src", - "tests" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests" - ] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src", - "tests" - ], - "include_globs": [ - "src", - "tests" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests" - ] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "WorkflowRuntimeFactory", - "path_scope": [], - "include_globs": [ - "src/**", - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "Где тесты для WorkflowRuntimeFactory? test_workflow_runtime_factory TestWorkflowRuntimeFactory WorkflowRuntimeFactory", - "path_scope": [], - "include_globs": [ - "src/**", - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "top_k": 6, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Где тесты для WorkflowRuntimeFactory? test_workflow_runtime_factory TestWorkflowRuntimeFactory WorkflowRuntimeFactory", - "path_scope": [], - "include_globs": [ - "src/**", - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "top_k": 10, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [], - "normalized_include_globs": [ - "src", - "tests" - ], - "normalized_exclude_globs": [], - "normalized_prefer_globs": [ - "tests" - ], - "filter_stage": "post_rank", - "candidates_before_filter": 0, - "candidates_after_filter": 0 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src", - "tests" - ], - "normalized_include_globs": [ - "src", - "tests" - ], - "normalized_exclude_globs": [], - "normalized_prefer_globs": [ - "tests" - ], - "filter_stage": "post_rank", - "candidates_before_filter": 6, - "candidates_after_filter": 6 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src", - "tests" - ], - "normalized_include_globs": [ - "src", - "tests" - ], - "normalized_exclude_globs": [], - "normalized_prefer_globs": [ - "tests" - ], - "filter_stage": "post_rank", - "candidates_before_filter": 10, - "candidates_after_filter": 10 - } - ], - "fallback": { - "used": true, - "reason": "scope_relaxed_no_hits" - }, - "symbol_resolution": { - "status": "not_found", - "resolved_symbol": null, - "alternatives": [ - "WorkflowRuntimeFactory" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "miss", - "hit_count": 0, - "fail_reason": "scope_relaxed_no_hits" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 6, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 10, - "fail_reason": null - } - ] - }, - "constraint_violations": [ - { - "type": "LAYER_MISSING", - "severity": "warn", - "details": { - "layer": "C1_SYMBOL_CATALOG", - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ] - }, - "suggested_fix": "Increase top_k for this layer or relax constraints for retrieval." - } - ], - "timings_ms": { - "symbol_resolution": 0, - "retrieval_total": 91, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 39, - "C2_DEPENDENCY_GRAPH": 38, - "C0_SOURCE_CHUNKS": 12 - }, - "merge_rank": 0 - } - } - }, - { - "step": "llm_answer", - "input": { - "query": "Где тесты для WorkflowRuntimeFactory?", - "rag_count": 16 - }, - "output": { - "llm_answer": "Прямых тестов для WorkflowRuntimeFactory в предоставленном контексте не обнаружено.\n\nКосвенные или ближайшие тесты:\n1. tests/test_business_control_actions.py | test_actions_stop_busy_worker_before_timeout:dataflow_slice\n - Проверяет поведение после остановки занятого рабочего перед таймаутом.\n2. tests/test_business_control_actions.py | test_actions_stop_busy_worker_after_timeout:dataflow_slice\n - Проверяет поведение после остановки занятого рабочего после таймаута.\n\nЧто именно проверяется:\n- Поведение рабочих процессов при остановке и проверке их состояния здоровья (\"health\").\n- Запуск и остановка рабочих процессов.\n\nКакие пробелы покрытия видны:\n- Нет подтвержденных тестов конкретно для WorkflowRuntimeFactory. Тесты находятся ближе к поведению рабочих процессов и блокирующих рутин, а не напрямую связаны с созданием или использованием WorkflowRuntimeFactory." - }, - "diagnostics": { - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 998, - "evidence_rows": 16, - "evidence_chars": 8149 - }, - "evidence_summary": [ - { - "layer": "C2_DEPENDENCY_GRAPH", - "count": 6, - "unique_paths": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 10, - "unique_paths": 1 - } - ], - "prompt_template_id": "intent_code_qa_find_tests_ru_v2", - "system_prompt_version": "v1" - }, - "timings_ms": { - "prompt_build": 0, - "llm_call": 1637 - } - } - } - ] - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_132357/full_chain_plba_code_subintents_v2_plba-v2-find-tests-workflow-runtime-factory-negative.md b/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_132357/full_chain_plba_code_subintents_v2_plba-v2-find-tests-workflow-runtime-factory-negative.md deleted file mode 100644 index 3817650..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_132357/full_chain_plba_code_subintents_v2_plba-v2-find-tests-workflow-runtime-factory-negative.md +++ /dev/null @@ -1,32 +0,0 @@ -# plba-v2-find-tests-workflow-runtime-factory-negative - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_subintents_v2.yaml -- runner: runtime -- mode: full_chain -- passed: True - -## Query -Где тесты для WorkflowRuntimeFactory? - -## Actual -{ - "intent": "CODE_QA", - "sub_intent": "FIND_TESTS", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 16, - "llm_answer": "Прямых тестов для WorkflowRuntimeFactory в предоставленном контексте не обнаружено.\n\nКосвенные или ближайшие тесты:\n1. tests/test_business_control_actions.py | test_actions_stop_busy_worker_before_timeout:dataflow_slice\n - Проверяет поведение после остановки занятого рабочего перед таймаутом.\n2. tests/test_business_control_actions.py | test_actions_stop_busy_worker_after_timeout:dataflow_slice\n - Проверяет поведение после остановки занятого рабочего после таймаута.\n\nЧто именно проверяется:\n- Поведение рабочих процессов при остановке и проверке их состояния здоровья (\"health\").\n- Запуск и остановка рабочих процессов.\n\nКакие пробелы покрытия видны:\n- Нет подтвержденных тестов конкретно для WorkflowRuntimeFactory. Тесты находятся ближе к поведению рабочих процессов и блокирующих рутин, а не напрямую связаны с созданием или использованием WorkflowRuntimeFactory.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "WorkflowRuntimeFactory" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ] -} - -## Mismatches -- none \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_132357/full_chain_plba_code_subintents_v2_plba-v2-open-file-nonexistent.json b/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_132357/full_chain_plba_code_subintents_v2_plba-v2-open-file-nonexistent.json deleted file mode 100644 index c2c7301..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_132357/full_chain_plba_code_subintents_v2_plba-v2-open-file-nonexistent.json +++ /dev/null @@ -1,454 +0,0 @@ -{ - "case_id": "plba-v2-open-file-nonexistent", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_subintents_v2.yaml", - "runner": "runtime", - "mode": "full_chain", - "actual": { - "intent": "CODE_QA", - "sub_intent": "OPEN_FILE", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 0, - "llm_answer": "1. src/app_runtime/core/missing_runtime.py\n2. Основан только на заголовке и первой строке файла:\n```\nfrom __future__ import annotations\n```\nДальнейший контент недоступен.\n3. Top-level сущности и секции недоступны для анализа.\n4. Из доступного контента видно, что файл импортирует аннотации из будущего (__future__), что может указывать на потенциальное использование современных языковых возможностей Python. Однако без дополнительного контекста невозможно определить, какие части файла могут быть важны для конкретного вопроса о интерпретации слоёв RAG.", - "answer_mode": "insufficient_evidence", - "path_scope": [ - "src/app_runtime/core/missing_runtime.py" - ], - "symbol_candidates": [], - "layers": [ - "C0_SOURCE_CHUNKS" - ] - }, - "passed": true, - "mismatches": [], - "details": { - "case_id": "plba-v2-open-file-nonexistent", - "text": "Открой файл src/app_runtime/core/missing_runtime.py", - "mode": "full_chain", - "run_started_at": "2026-03-12T13:23:57", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Открой файл src/app_runtime/core/missing_runtime.py", - "symbol_resolution": { - "status": "not_requested", - "resolved_symbol": null, - "alternatives": [], - "confidence": 0.0 - }, - "rag_count": 0, - "rag_rows": [], - "llm_answer": "1. src/app_runtime/core/missing_runtime.py\n2. Основан только на заголовке и первой строке файла:\n```\nfrom __future__ import annotations\n```\nДальнейший контент недоступен.\n3. Top-level сущности и секции недоступны для анализа.\n4. Из доступного контента видно, что файл импортирует аннотации из будущего (__future__), что может указывать на потенциальное использование современных языковых возможностей Python. Однако без дополнительного контекста невозможно определить, какие части файла могут быть важны для конкретного вопроса о интерпретации слоёв RAG.", - "summary": { - "router": { - "intent": "CODE_QA", - "sub_intent": "OPEN_FILE", - "confidence": null - }, - "retrieval": { - "profile": "code", - "layers_hit": [], - "evidence_sufficient": false - }, - "llm": { - "answer_status": "insufficient_evidence", - "groundedness": "weakly_grounded" - } - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "OPEN_FILE", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C0_SOURCE_CHUNKS" - ], - "symbol_kind_hint": "unknown", - "symbol_candidates": [], - "keyword_hints": [], - "path_hints": [ - "src/app_runtime/core/missing_runtime.py" - ], - "path_scope": [ - "src/app_runtime/core/missing_runtime.py" - ], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/app_runtime/core/missing_runtime.py" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": false, - "max_distance": 2, - "top_k": 5 - } - } - }, - "execution": { - "executed_layers": [ - "C0_SOURCE_CHUNKS" - ], - "retrieval_mode_by_layer": { - "C0_SOURCE_CHUNKS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C0_SOURCE_CHUNKS": 200 - }, - "filters_by_layer": { - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src/app_runtime/core/missing_runtime.py" - ], - "include_globs": [], - "exclude_globs": [], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": null, - "workspace_id": null, - "returned_repo_ids": [], - "returned_workspace_ids": [] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Открой файл src/app_runtime/core/missing_runtime.py", - "path_scope": [ - "src/app_runtime/core/missing_runtime.py" - ], - "include_globs": [], - "exclude_globs": [], - "prefer_globs": [], - "top_k": 200, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src/app_runtime/core/missing_runtime.py" - ], - "normalized_include_globs": [], - "normalized_exclude_globs": [], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 0, - "candidates_after_filter": 0 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "not_requested", - "resolved_symbol": null, - "alternatives": [] - }, - "layers": [ - { - "layer": "C0_SOURCE_CHUNKS", - "status": "miss", - "hit_count": 0, - "fail_reason": null - } - ] - }, - "constraint_violations": [ - { - "type": "PATH_SCOPE_NOT_SATISFIED", - "severity": "error", - "details": { - "path_scope": [ - "src/app_runtime/core/missing_runtime.py" - ], - "returned_paths": [] - }, - "suggested_fix": "Use exact path_scope retrieval and disable broad fallback for OPEN_FILE." - }, - { - "type": "LAYER_MISSING", - "severity": "warn", - "details": { - "layer": "C0_SOURCE_CHUNKS", - "requested_layers": [ - "C0_SOURCE_CHUNKS" - ] - }, - "suggested_fix": "Increase top_k for this layer or relax constraints for retrieval." - } - ], - "timings_ms": { - "router": 0, - "symbol_resolution": 0, - "retrieval_total": 14, - "retrieval_by_layer": { - "C0_SOURCE_CHUNKS": 14 - }, - "merge_rank": 0, - "prompt_build": 0, - "llm_call": 1086 - }, - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 278, - "evidence_rows": 0, - "evidence_chars": 0 - }, - "evidence_summary": [], - "prompt_template_id": "intent_code_qa_open_file_ru_v2", - "system_prompt_version": "v1" - }, - "router": { - "conversation_mode": "START", - "keyword_hints": [], - "path_scope": [ - "src/app_runtime/core/missing_runtime.py" - ] - }, - "llm": { - "used_evidence_count": 0, - "missing_evidence_reason": "empty_retrieval_context" - } - }, - "run_info": { - "case_id": "plba-v2-open-file-nonexistent", - "mode": "full_chain", - "run_started_at": "2026-03-12T13:23:57", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - }, - "input_request": { - "text": "Открой файл src/app_runtime/core/missing_runtime.py", - "normalized_query": "Открой файл src/app_runtime/core/missing_runtime.py" - }, - "steps": [ - { - "step": "intent_router", - "input": { - "query": "Открой файл src/app_runtime/core/missing_runtime.py" - }, - "output": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Открой файл src/app_runtime/core/missing_runtime.py" - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "OPEN_FILE", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C0_SOURCE_CHUNKS" - ], - "symbol_kind_hint": "unknown", - "symbol_candidates": [], - "keyword_hints": [], - "path_hints": [ - "src/app_runtime/core/missing_runtime.py" - ], - "path_scope": [ - "src/app_runtime/core/missing_runtime.py" - ], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/app_runtime/core/missing_runtime.py" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": false, - "max_distance": 2, - "top_k": 5 - } - } - }, - "timings_ms": { - "router": 0 - } - } - }, - { - "step": "retrieval", - "input": { - "query": "Открой файл src/app_runtime/core/missing_runtime.py" - }, - "output": { - "symbol_resolution": { - "status": "not_requested", - "resolved_symbol": null, - "alternatives": [], - "confidence": 0.0 - }, - "rag_count": 0, - "rag_rows": [] - }, - "diagnostics": { - "execution": { - "executed_layers": [ - "C0_SOURCE_CHUNKS" - ], - "retrieval_mode_by_layer": { - "C0_SOURCE_CHUNKS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C0_SOURCE_CHUNKS": 200 - }, - "filters_by_layer": { - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src/app_runtime/core/missing_runtime.py" - ], - "include_globs": [], - "exclude_globs": [], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": null, - "workspace_id": null, - "returned_repo_ids": [], - "returned_workspace_ids": [] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Открой файл src/app_runtime/core/missing_runtime.py", - "path_scope": [ - "src/app_runtime/core/missing_runtime.py" - ], - "include_globs": [], - "exclude_globs": [], - "prefer_globs": [], - "top_k": 200, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src/app_runtime/core/missing_runtime.py" - ], - "normalized_include_globs": [], - "normalized_exclude_globs": [], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 0, - "candidates_after_filter": 0 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "not_requested", - "resolved_symbol": null, - "alternatives": [] - }, - "layers": [ - { - "layer": "C0_SOURCE_CHUNKS", - "status": "miss", - "hit_count": 0, - "fail_reason": null - } - ] - }, - "constraint_violations": [ - { - "type": "PATH_SCOPE_NOT_SATISFIED", - "severity": "error", - "details": { - "path_scope": [ - "src/app_runtime/core/missing_runtime.py" - ], - "returned_paths": [] - }, - "suggested_fix": "Use exact path_scope retrieval and disable broad fallback for OPEN_FILE." - }, - { - "type": "LAYER_MISSING", - "severity": "warn", - "details": { - "layer": "C0_SOURCE_CHUNKS", - "requested_layers": [ - "C0_SOURCE_CHUNKS" - ] - }, - "suggested_fix": "Increase top_k for this layer or relax constraints for retrieval." - } - ], - "timings_ms": { - "symbol_resolution": 0, - "retrieval_total": 14, - "retrieval_by_layer": { - "C0_SOURCE_CHUNKS": 14 - }, - "merge_rank": 0 - } - } - }, - { - "step": "llm_answer", - "input": { - "query": "Открой файл src/app_runtime/core/missing_runtime.py", - "rag_count": 0 - }, - "output": { - "llm_answer": "1. src/app_runtime/core/missing_runtime.py\n2. Основан только на заголовке и первой строке файла:\n```\nfrom __future__ import annotations\n```\nДальнейший контент недоступен.\n3. Top-level сущности и секции недоступны для анализа.\n4. Из доступного контента видно, что файл импортирует аннотации из будущего (__future__), что может указывать на потенциальное использование современных языковых возможностей Python. Однако без дополнительного контекста невозможно определить, какие части файла могут быть важны для конкретного вопроса о интерпретации слоёв RAG." - }, - "diagnostics": { - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 278, - "evidence_rows": 0, - "evidence_chars": 0 - }, - "evidence_summary": [], - "prompt_template_id": "intent_code_qa_open_file_ru_v2", - "system_prompt_version": "v1" - }, - "timings_ms": { - "prompt_build": 0, - "llm_call": 1086 - } - } - } - ] - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_132357/full_chain_plba_code_subintents_v2_plba-v2-open-file-nonexistent.md b/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_132357/full_chain_plba_code_subintents_v2_plba-v2-open-file-nonexistent.md deleted file mode 100644 index fd7702e..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_132357/full_chain_plba_code_subintents_v2_plba-v2-open-file-nonexistent.md +++ /dev/null @@ -1,30 +0,0 @@ -# plba-v2-open-file-nonexistent - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_subintents_v2.yaml -- runner: runtime -- mode: full_chain -- passed: True - -## Query -Открой файл src/app_runtime/core/missing_runtime.py - -## Actual -{ - "intent": "CODE_QA", - "sub_intent": "OPEN_FILE", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 0, - "llm_answer": "1. src/app_runtime/core/missing_runtime.py\n2. Основан только на заголовке и первой строке файла:\n```\nfrom __future__ import annotations\n```\nДальнейший контент недоступен.\n3. Top-level сущности и секции недоступны для анализа.\n4. Из доступного контента видно, что файл импортирует аннотации из будущего (__future__), что может указывать на потенциальное использование современных языковых возможностей Python. Однако без дополнительного контекста невозможно определить, какие части файла могут быть важны для конкретного вопроса о интерпретации слоёв RAG.", - "answer_mode": "insufficient_evidence", - "path_scope": [ - "src/app_runtime/core/missing_runtime.py" - ], - "symbol_candidates": [], - "layers": [ - "C0_SOURCE_CHUNKS" - ] -} - -## Mismatches -- none \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_132357/full_chain_plba_code_subintents_v2_plba-v2-open-file-public-api.json b/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_132357/full_chain_plba_code_subintents_v2_plba-v2-open-file-public-api.json deleted file mode 100644 index 0bfc6e9..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_132357/full_chain_plba_code_subintents_v2_plba-v2-open-file-public-api.json +++ /dev/null @@ -1,492 +0,0 @@ -{ - "case_id": "plba-v2-open-file-public-api", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_subintents_v2.yaml", - "runner": "runtime", - "mode": "full_chain", - "actual": { - "intent": "CODE_QA", - "sub_intent": "OPEN_FILE", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 1, - "llm_answer": "1. src/plba/__init__.py\n2. Фрагмент файла содержит импорт различных модулей и классов, а также объявление переменной __all__, которая задает список экспортируемых объектов.\n3. Top-level сущности и секции:\n - Импорты различных модулей и классов.\n - Переменная __all__.\n4. В данном файле важны следующие части:\n - Список импортируемых классов и функций (ApplicationModule, ConfigFileLoader, ConfigProvider, и др.).\n - Переменная __all__, определяющая экспортируемые объекты.", - "answer_mode": "answered", - "path_scope": [ - "src/plba/__init__.py" - ], - "symbol_candidates": [], - "layers": [ - "C0_SOURCE_CHUNKS" - ] - }, - "passed": true, - "mismatches": [], - "details": { - "case_id": "plba-v2-open-file-public-api", - "text": "Открой файл src/plba/__init__.py", - "mode": "full_chain", - "run_started_at": "2026-03-12T13:23:57", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Открой файл src/plba/__init__.py", - "symbol_resolution": { - "status": "not_requested", - "resolved_symbol": null, - "alternatives": [], - "confidence": 0.0 - }, - "rag_count": 1, - "rag_rows": [ - { - "path": "src/plba/__init__.py", - "content": "from plba.bootstrap import create_runtime\nfrom plba.config import ConfigFileLoader, FileConfigProvider\nfrom plba.control import ControlActionSet, ControlChannel, ControlPlaneService, HttpControlChannel\nfrom plba.contracts import (\n ApplicationModule,\n ConfigProvider,\n HealthContributor,\n TraceContext,\n TraceContextRecord,\n TraceLogMessage,\n TraceTransport,\n Worker,\n WorkerHealth,\n WorkerStatus,\n)\nfrom plba.core import ConfigurationManager, RuntimeManager, ServiceContainer\nfrom plba.health import HealthRegistry\nfrom plba.logging import LogManager\nfrom plba.queue import InMemoryTaskQueue\nfrom plba.tracing import MySqlTraceTransport, NoOpTraceTransport, TraceService\nfrom plba.workflow import (\n StepResult,\n WorkflowContext,\n WorkflowDefinition,\n WorkflowEngine,\n WorkflowEngineHooks,\n WorkflowNode,\n WorkflowRuntimeFactory,\n WorkflowStep,\n)\nfrom plba.workers import WorkerSupervisor\n\n__all__ = [\n \"ApplicationModule\",\n \"ConfigFileLoader\",\n \"ConfigProvider\",\n \"ConfigurationManager\",\n \"ControlActionSet\",\n \"ControlChannel\",\n \"ControlPlaneService\",\n \"create_runtime\",\n \"FileConfigProvider\",\n \"HealthContributor\",\n \"HealthRegistry\",\n \"HttpControlChannel\",\n \"InMemoryTaskQueue\",\n \"LogManager\",\n \"MySqlTraceTransport\",\n \"NoOpTraceTransport\",\n \"RuntimeManager\",\n \"ServiceContainer\",\n \"TraceContext\",\n \"TraceContextRecord\",\n \"TraceLogMessage\",\n \"TraceService\",\n \"TraceTransport\",\n \"StepResult\",\n \"Worker\",\n \"WorkerHealth\",\n \"WorkerStatus\",\n \"WorkflowContext\",\n \"WorkflowDefinition\",\n \"WorkflowEngine\",\n \"WorkflowEngineHooks\",\n \"WorkflowNode\",\n \"WorkflowRuntimeFactory\",\n \"WorkflowStep\",\n \"WorkerSupervisor\",\n]", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/plba/__init__.py:1-69", - "span_start": 1, - "span_end": 69, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.plba.__init__", - "is_test": false, - "blob_sha": "24e755ec8c249d14fb0e675b5dbf2b71ab91afb9c849897eebfa9feb2499e19d", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "llm_answer": "1. src/plba/__init__.py\n2. Фрагмент файла содержит импорт различных модулей и классов, а также объявление переменной __all__, которая задает список экспортируемых объектов.\n3. Top-level сущности и секции:\n - Импорты различных модулей и классов.\n - Переменная __all__.\n4. В данном файле важны следующие части:\n - Список импортируемых классов и функций (ApplicationModule, ConfigFileLoader, ConfigProvider, и др.).\n - Переменная __all__, определяющая экспортируемые объекты.", - "summary": { - "router": { - "intent": "CODE_QA", - "sub_intent": "OPEN_FILE", - "confidence": null - }, - "retrieval": { - "profile": "code", - "layers_hit": [ - "C0_SOURCE_CHUNKS" - ], - "evidence_sufficient": true - }, - "llm": { - "answer_status": "answered", - "groundedness": "grounded" - } - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "OPEN_FILE", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C0_SOURCE_CHUNKS" - ], - "symbol_kind_hint": "unknown", - "symbol_candidates": [], - "keyword_hints": [], - "path_hints": [ - "src/plba/__init__.py" - ], - "path_scope": [ - "src/plba/__init__.py" - ], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/plba/__init__.py" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": false, - "max_distance": 2, - "top_k": 5 - } - } - }, - "execution": { - "executed_layers": [ - "C0_SOURCE_CHUNKS" - ], - "retrieval_mode_by_layer": { - "C0_SOURCE_CHUNKS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C0_SOURCE_CHUNKS": 200 - }, - "filters_by_layer": { - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src/plba/__init__.py" - ], - "include_globs": [], - "exclude_globs": [], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Открой файл src/plba/__init__.py", - "path_scope": [ - "src/plba/__init__.py" - ], - "include_globs": [], - "exclude_globs": [], - "prefer_globs": [], - "top_k": 200, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src/plba/__init__.py" - ], - "normalized_include_globs": [], - "normalized_exclude_globs": [], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 1, - "candidates_after_filter": 1 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "not_requested", - "resolved_symbol": null, - "alternatives": [] - }, - "layers": [ - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 1, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "router": 0, - "symbol_resolution": 0, - "retrieval_total": 17, - "retrieval_by_layer": { - "C0_SOURCE_CHUNKS": 17 - }, - "merge_rank": 0, - "prompt_build": 0, - "llm_call": 1161 - }, - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 589, - "evidence_rows": 1, - "evidence_chars": 1768 - }, - "evidence_summary": [ - { - "layer": "C0_SOURCE_CHUNKS", - "count": 1, - "unique_paths": 1 - } - ], - "prompt_template_id": "intent_code_qa_open_file_ru_v2", - "system_prompt_version": "v1" - }, - "router": { - "conversation_mode": "START", - "keyword_hints": [], - "path_scope": [ - "src/plba/__init__.py" - ] - }, - "llm": { - "used_evidence_count": 1, - "missing_evidence_reason": null - } - }, - "run_info": { - "case_id": "plba-v2-open-file-public-api", - "mode": "full_chain", - "run_started_at": "2026-03-12T13:23:57", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - }, - "input_request": { - "text": "Открой файл src/plba/__init__.py", - "normalized_query": "Открой файл src/plba/__init__.py" - }, - "steps": [ - { - "step": "intent_router", - "input": { - "query": "Открой файл src/plba/__init__.py" - }, - "output": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Открой файл src/plba/__init__.py" - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "OPEN_FILE", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C0_SOURCE_CHUNKS" - ], - "symbol_kind_hint": "unknown", - "symbol_candidates": [], - "keyword_hints": [], - "path_hints": [ - "src/plba/__init__.py" - ], - "path_scope": [ - "src/plba/__init__.py" - ], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/plba/__init__.py" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": false, - "max_distance": 2, - "top_k": 5 - } - } - }, - "timings_ms": { - "router": 0 - } - } - }, - { - "step": "retrieval", - "input": { - "query": "Открой файл src/plba/__init__.py" - }, - "output": { - "symbol_resolution": { - "status": "not_requested", - "resolved_symbol": null, - "alternatives": [], - "confidence": 0.0 - }, - "rag_count": 1, - "rag_rows": [ - { - "path": "src/plba/__init__.py", - "content": "from plba.bootstrap import create_runtime\nfrom plba.config import ConfigFileLoader, FileConfigProvider\nfrom plba.control import ControlActionSet, ControlChannel, ControlPlaneService, HttpControlChannel\nfrom plba.contracts import (\n ApplicationModule,\n ConfigProvider,\n HealthContributor,\n TraceContext,\n TraceContextRecord,\n TraceLogMessage,\n TraceTransport,\n Worker,\n WorkerHealth,\n WorkerStatus,\n)\nfrom plba.core import ConfigurationManager, RuntimeManager, ServiceContainer\nfrom plba.health import HealthRegistry\nfrom plba.logging import LogManager\nfrom plba.queue import InMemoryTaskQueue\nfrom plba.tracing import MySqlTraceTransport, NoOpTraceTransport, TraceService\nfrom plba.workflow import (\n StepResult,\n WorkflowContext,\n WorkflowDefinition,\n WorkflowEngine,\n WorkflowEngineHooks,\n WorkflowNode,\n WorkflowRuntimeFactory,\n WorkflowStep,\n)\nfrom plba.workers import WorkerSupervisor\n\n__all__ = [\n \"ApplicationModule\",\n \"ConfigFileLoader\",\n \"ConfigProvider\",\n \"ConfigurationManager\",\n \"ControlActionSet\",\n \"ControlChannel\",\n \"ControlPlaneService\",\n \"create_runtime\",\n \"FileConfigProvider\",\n \"HealthContributor\",\n \"HealthRegistry\",\n \"HttpControlChannel\",\n \"InMemoryTaskQueue\",\n \"LogManager\",\n \"MySqlTraceTransport\",\n \"NoOpTraceTransport\",\n \"RuntimeManager\",\n \"ServiceContainer\",\n \"TraceContext\",\n \"TraceContextRecord\",\n \"TraceLogMessage\",\n \"TraceService\",\n \"TraceTransport\",\n \"StepResult\",\n \"Worker\",\n \"WorkerHealth\",\n \"WorkerStatus\",\n \"WorkflowContext\",\n \"WorkflowDefinition\",\n \"WorkflowEngine\",\n \"WorkflowEngineHooks\",\n \"WorkflowNode\",\n \"WorkflowRuntimeFactory\",\n \"WorkflowStep\",\n \"WorkerSupervisor\",\n]", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/plba/__init__.py:1-69", - "span_start": 1, - "span_end": 69, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.plba.__init__", - "is_test": false, - "blob_sha": "24e755ec8c249d14fb0e675b5dbf2b71ab91afb9c849897eebfa9feb2499e19d", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ] - }, - "diagnostics": { - "execution": { - "executed_layers": [ - "C0_SOURCE_CHUNKS" - ], - "retrieval_mode_by_layer": { - "C0_SOURCE_CHUNKS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C0_SOURCE_CHUNKS": 200 - }, - "filters_by_layer": { - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src/plba/__init__.py" - ], - "include_globs": [], - "exclude_globs": [], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Открой файл src/plba/__init__.py", - "path_scope": [ - "src/plba/__init__.py" - ], - "include_globs": [], - "exclude_globs": [], - "prefer_globs": [], - "top_k": 200, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src/plba/__init__.py" - ], - "normalized_include_globs": [], - "normalized_exclude_globs": [], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 1, - "candidates_after_filter": 1 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "not_requested", - "resolved_symbol": null, - "alternatives": [] - }, - "layers": [ - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 1, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "symbol_resolution": 0, - "retrieval_total": 17, - "retrieval_by_layer": { - "C0_SOURCE_CHUNKS": 17 - }, - "merge_rank": 0 - } - } - }, - { - "step": "llm_answer", - "input": { - "query": "Открой файл src/plba/__init__.py", - "rag_count": 1 - }, - "output": { - "llm_answer": "1. src/plba/__init__.py\n2. Фрагмент файла содержит импорт различных модулей и классов, а также объявление переменной __all__, которая задает список экспортируемых объектов.\n3. Top-level сущности и секции:\n - Импорты различных модулей и классов.\n - Переменная __all__.\n4. В данном файле важны следующие части:\n - Список импортируемых классов и функций (ApplicationModule, ConfigFileLoader, ConfigProvider, и др.).\n - Переменная __all__, определяющая экспортируемые объекты." - }, - "diagnostics": { - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 589, - "evidence_rows": 1, - "evidence_chars": 1768 - }, - "evidence_summary": [ - { - "layer": "C0_SOURCE_CHUNKS", - "count": 1, - "unique_paths": 1 - } - ], - "prompt_template_id": "intent_code_qa_open_file_ru_v2", - "system_prompt_version": "v1" - }, - "timings_ms": { - "prompt_build": 0, - "llm_call": 1161 - } - } - } - ] - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_132357/full_chain_plba_code_subintents_v2_plba-v2-open-file-public-api.md b/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_132357/full_chain_plba_code_subintents_v2_plba-v2-open-file-public-api.md deleted file mode 100644 index 8cad6d8..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_132357/full_chain_plba_code_subintents_v2_plba-v2-open-file-public-api.md +++ /dev/null @@ -1,30 +0,0 @@ -# plba-v2-open-file-public-api - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_subintents_v2.yaml -- runner: runtime -- mode: full_chain -- passed: True - -## Query -Открой файл src/plba/__init__.py - -## Actual -{ - "intent": "CODE_QA", - "sub_intent": "OPEN_FILE", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 1, - "llm_answer": "1. src/plba/__init__.py\n2. Фрагмент файла содержит импорт различных модулей и классов, а также объявление переменной __all__, которая задает список экспортируемых объектов.\n3. Top-level сущности и секции:\n - Импорты различных модулей и классов.\n - Переменная __all__.\n4. В данном файле важны следующие части:\n - Список импортируемых классов и функций (ApplicationModule, ConfigFileLoader, ConfigProvider, и др.).\n - Переменная __all__, определяющая экспортируемые объекты.", - "answer_mode": "answered", - "path_scope": [ - "src/plba/__init__.py" - ], - "symbol_candidates": [], - "layers": [ - "C0_SOURCE_CHUNKS" - ] -} - -## Mismatches -- none \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_132357/full_chain_plba_code_subintents_v2_plba-v2-open-file-runtime.json b/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_132357/full_chain_plba_code_subintents_v2_plba-v2-open-file-runtime.json deleted file mode 100644 index ebcc0e1..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_132357/full_chain_plba_code_subintents_v2_plba-v2-open-file-runtime.json +++ /dev/null @@ -1,492 +0,0 @@ -{ - "case_id": "plba-v2-open-file-runtime", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_subintents_v2.yaml", - "runner": "runtime", - "mode": "full_chain", - "actual": { - "intent": "CODE_QA", - "sub_intent": "OPEN_FILE", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 1, - "llm_answer": "1. путь к файлу: src/app_runtime/core/runtime.py\n2. В доступном фрагменте показан класс RuntimeManager с его атрибутами и методом __init__. Видно объявление нескольких параметров конструктора класса и инициализация соответствующих полей.\n3. Top-level сущности и секции: класс RuntimeManager, метод __init__\n4. Важные части для вопроса пользователя:\n- Класс RuntimeManager является основным управляющим объектом runtime-системы.\n- Метод __init__ устанавливает начальные значения полей объекта и регистрирует базовые сервисы приложения. \n- Параметры конструктора определяют компоненты системы, такие как конфигурация, службы, журналы, контроль состояния и другие.", - "answer_mode": "answered", - "path_scope": [ - "src/app_runtime/core/runtime.py" - ], - "symbol_candidates": [], - "layers": [ - "C0_SOURCE_CHUNKS" - ] - }, - "passed": true, - "mismatches": [], - "details": { - "case_id": "plba-v2-open-file-runtime", - "text": "Открой файл src/app_runtime/core/runtime.py", - "mode": "full_chain", - "run_started_at": "2026-03-12T13:23:57", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Открой файл src/app_runtime/core/runtime.py", - "symbol_resolution": { - "status": "not_requested", - "resolved_symbol": null, - "alternatives": [], - "confidence": 0.0 - }, - "rag_count": 1, - "rag_rows": [ - { - "path": "src/app_runtime/core/runtime.py", - "content": "class RuntimeManager:\n ACTION_TIMEOUT_SECONDS = 10.0\n ACTION_POLL_INTERVAL_SECONDS = 0.05\n\n def __init__(\n self,\n configuration: ConfigurationManager | None = None,\n services: ServiceContainer | None = None,\n traces: TraceService | None = None,\n health: HealthRegistry | None = None,\n logs: LogManager | None = None,\n workers: WorkerSupervisor | None = None,\n control_plane: ControlPlaneService | None = None,\n ) -> None:\n self.configuration = configuration or ConfigurationManager()\n self.services = services or ServiceContainer()\n self.traces = traces or TraceService()\n self.health = health or HealthRegistry()\n self.logs = logs or LogManager()\n self.workers = workers or WorkerSupervisor()\n self.control_plane = control_plane or ControlPlaneService()\n self.registry = ModuleRegistry(self.services)\n self._started = False\n self._state = LifecycleState.IDLE\n self._core_registered = False\n self._workers_registered = False\n self._register_core_services()\n\n def register_module(self, module: ApplicationModule) -> None:\n self.registry.register_module(module.name)\n module.register(self.registry)\n\n def add_config_file(self, path: str) -> FileConfigProvider:\n provider = FileConfigProvider(path)\n self.configuration.add_provider(provider)\n return provider\n\n def start(self, *, start_control_plane: bool = True) -> None:\n if self._started:\n return\n self._state = LifecycleState.STARTING\n config = self.configuration.load()\n self.logs.apply_config(config)\n self._register_health_contributors()\n self._register_workers()\n self.workers.start()\n if start_control_plane:\n self.control_plane.start(self)\n self._started = True\n self._refresh_state()\n\n def stop(self, timeout: float = 30.0, force: bool = False, stop_control_plane: bool = True) -> None:\n if not self._started:\n return\n self._state = LifecycleState.STOPPING\n self.workers.stop(timeout=timeout, force=force)\n if stop_control_plane:\n self.control_plane.stop()\n self._started = False\n self._state = LifecycleState.STOPPED\n\n def status(self) -> dict[str, object]:\n self._refresh_state()\n return self.control_plane.snapshot(self)\n\n def current_health(self) -> HealthPayload:\n self._refresh_state()\n return self.health.payload(self._state, self.workers.healths())\n\n async def health_status(self) -> HealthPayload:\n return self.current_health()\n\n async def start_runtime(self) -> dict[str, object] | str:\n self._refresh_state()\n if self._started:\n return \"runtime already running\"\n if self._state == LifecycleState.STOPPING:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n\n self.start(start_control_plane=False)\n started = self._wait_for_state({LifecycleState.IDLE, LifecycleState.BUSY}, timeout=self.ACTION_TIMEOUT_SECONDS)\n if started:\n return self._action_detail(\"runtime started\", timed_out=False)\n return self._action_detail(\"runtime start is still in progress\", timed_out=True)\n\n async def stop_runtime(self) -> dict[str, object] | str:\n self._refresh_state()\n if not self._started:\n if self._state == LifecycleState.STOPPING:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n return \"runtime already stopped\"\n\n self._state = LifecycleState.STOPPING\n try:\n self.workers.stop(timeout=self.ACTION_TIMEOUT_SECONDS, force=False)\n except TimeoutError:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n\n self._started = False\n self._state = LifecycleState.STOPPED\n return self._action_detail(\"runtime stopped\", timed_out=False)\n\n async def runtime_status(self) -> str:\n self._refresh_state()\n return self._state.value\n\n def _register_core_services(self) -> None:\n if self._core_registered:\n return\n self.services.register(\"configuration\", self.configuration)\n self.services.register(\"traces\", self.traces)\n self.services.register(\"health\", self.health)\n self.services.register(\"logs\", self.logs)\n self.services.register(\"workers\", self.workers)\n self.services.register(\"control_plane\", self.control_plane)\n self._core_registered = True\n\n def _register_health_contributors(self) -> None:\n for contributor in self.registry.health_contributors:\n self.health.register(contributor)\n\n def _register_workers(self) -> None:\n if self._workers_registered:\n return\n for worker in self.registry.workers:\n self.workers.register(worker)\n self._workers_registered = True\n\n def _refresh_state(self) -> None:\n lifecycle = self.workers.lifecycle_state()\n\n if self._state == LifecycleState.STOPPING:\n if lifecycle == LifecycleState.STOPPED:\n self._started = False\n self._state = LifecycleState.STOPPED\n return\n\n if not self._started:\n if lifecycle == LifecycleState.STOPPED:\n self._state = LifecycleState.STOPPED\n return\n\n self._state = lifecycle\n\n def _wait_for_state(self, target_states: set[LifecycleState], *, timeout: float) -> bool:\n deadline = monotonic() + timeout\n while monotonic() < deadline:\n self._refresh_state()\n if self._state in target_states:\n return True\n sleep(self.ACTION_POLL_INTERVAL_SECONDS)\n self._refresh_state()\n return self._state in target_states\n\n def _action_detail(self, message: str, *, timed_out: bool) -> dict[str, object]:\n self._refresh_state()\n return {\n \"message\": message,\n \"state\": self._state.value,\n \"timed_out\": timed_out,\n \"workers\": self.workers.snapshot(),\n }", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/core/runtime.py:RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.core.runtime", - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "llm_answer": "1. путь к файлу: src/app_runtime/core/runtime.py\n2. В доступном фрагменте показан класс RuntimeManager с его атрибутами и методом __init__. Видно объявление нескольких параметров конструктора класса и инициализация соответствующих полей.\n3. Top-level сущности и секции: класс RuntimeManager, метод __init__\n4. Важные части для вопроса пользователя:\n- Класс RuntimeManager является основным управляющим объектом runtime-системы.\n- Метод __init__ устанавливает начальные значения полей объекта и регистрирует базовые сервисы приложения. \n- Параметры конструктора определяют компоненты системы, такие как конфигурация, службы, журналы, контроль состояния и другие.", - "summary": { - "router": { - "intent": "CODE_QA", - "sub_intent": "OPEN_FILE", - "confidence": null - }, - "retrieval": { - "profile": "code", - "layers_hit": [ - "C0_SOURCE_CHUNKS" - ], - "evidence_sufficient": true - }, - "llm": { - "answer_status": "answered", - "groundedness": "grounded" - } - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "OPEN_FILE", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C0_SOURCE_CHUNKS" - ], - "symbol_kind_hint": "unknown", - "symbol_candidates": [], - "keyword_hints": [], - "path_hints": [ - "src/app_runtime/core/runtime.py" - ], - "path_scope": [ - "src/app_runtime/core/runtime.py" - ], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/app_runtime/core/runtime.py" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": false, - "max_distance": 2, - "top_k": 5 - } - } - }, - "execution": { - "executed_layers": [ - "C0_SOURCE_CHUNKS" - ], - "retrieval_mode_by_layer": { - "C0_SOURCE_CHUNKS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C0_SOURCE_CHUNKS": 200 - }, - "filters_by_layer": { - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src/app_runtime/core/runtime.py" - ], - "include_globs": [], - "exclude_globs": [], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Открой файл src/app_runtime/core/runtime.py", - "path_scope": [ - "src/app_runtime/core/runtime.py" - ], - "include_globs": [], - "exclude_globs": [], - "prefer_globs": [], - "top_k": 200, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src/app_runtime/core/runtime.py" - ], - "normalized_include_globs": [], - "normalized_exclude_globs": [], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 1, - "candidates_after_filter": 1 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "not_requested", - "resolved_symbol": null, - "alternatives": [] - }, - "layers": [ - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 1, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "router": 1, - "symbol_resolution": 0, - "retrieval_total": 270, - "retrieval_by_layer": { - "C0_SOURCE_CHUNKS": 270 - }, - "merge_rank": 0, - "prompt_build": 0, - "llm_call": 1393 - }, - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 600, - "evidence_rows": 1, - "evidence_chars": 6265 - }, - "evidence_summary": [ - { - "layer": "C0_SOURCE_CHUNKS", - "count": 1, - "unique_paths": 1 - } - ], - "prompt_template_id": "intent_code_qa_open_file_ru_v2", - "system_prompt_version": "v1" - }, - "router": { - "conversation_mode": "START", - "keyword_hints": [], - "path_scope": [ - "src/app_runtime/core/runtime.py" - ] - }, - "llm": { - "used_evidence_count": 1, - "missing_evidence_reason": null - } - }, - "run_info": { - "case_id": "plba-v2-open-file-runtime", - "mode": "full_chain", - "run_started_at": "2026-03-12T13:23:57", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - }, - "input_request": { - "text": "Открой файл src/app_runtime/core/runtime.py", - "normalized_query": "Открой файл src/app_runtime/core/runtime.py" - }, - "steps": [ - { - "step": "intent_router", - "input": { - "query": "Открой файл src/app_runtime/core/runtime.py" - }, - "output": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Открой файл src/app_runtime/core/runtime.py" - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "OPEN_FILE", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C0_SOURCE_CHUNKS" - ], - "symbol_kind_hint": "unknown", - "symbol_candidates": [], - "keyword_hints": [], - "path_hints": [ - "src/app_runtime/core/runtime.py" - ], - "path_scope": [ - "src/app_runtime/core/runtime.py" - ], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/app_runtime/core/runtime.py" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": false, - "max_distance": 2, - "top_k": 5 - } - } - }, - "timings_ms": { - "router": 1 - } - } - }, - { - "step": "retrieval", - "input": { - "query": "Открой файл src/app_runtime/core/runtime.py" - }, - "output": { - "symbol_resolution": { - "status": "not_requested", - "resolved_symbol": null, - "alternatives": [], - "confidence": 0.0 - }, - "rag_count": 1, - "rag_rows": [ - { - "path": "src/app_runtime/core/runtime.py", - "content": "class RuntimeManager:\n ACTION_TIMEOUT_SECONDS = 10.0\n ACTION_POLL_INTERVAL_SECONDS = 0.05\n\n def __init__(\n self,\n configuration: ConfigurationManager | None = None,\n services: ServiceContainer | None = None,\n traces: TraceService | None = None,\n health: HealthRegistry | None = None,\n logs: LogManager | None = None,\n workers: WorkerSupervisor | None = None,\n control_plane: ControlPlaneService | None = None,\n ) -> None:\n self.configuration = configuration or ConfigurationManager()\n self.services = services or ServiceContainer()\n self.traces = traces or TraceService()\n self.health = health or HealthRegistry()\n self.logs = logs or LogManager()\n self.workers = workers or WorkerSupervisor()\n self.control_plane = control_plane or ControlPlaneService()\n self.registry = ModuleRegistry(self.services)\n self._started = False\n self._state = LifecycleState.IDLE\n self._core_registered = False\n self._workers_registered = False\n self._register_core_services()\n\n def register_module(self, module: ApplicationModule) -> None:\n self.registry.register_module(module.name)\n module.register(self.registry)\n\n def add_config_file(self, path: str) -> FileConfigProvider:\n provider = FileConfigProvider(path)\n self.configuration.add_provider(provider)\n return provider\n\n def start(self, *, start_control_plane: bool = True) -> None:\n if self._started:\n return\n self._state = LifecycleState.STARTING\n config = self.configuration.load()\n self.logs.apply_config(config)\n self._register_health_contributors()\n self._register_workers()\n self.workers.start()\n if start_control_plane:\n self.control_plane.start(self)\n self._started = True\n self._refresh_state()\n\n def stop(self, timeout: float = 30.0, force: bool = False, stop_control_plane: bool = True) -> None:\n if not self._started:\n return\n self._state = LifecycleState.STOPPING\n self.workers.stop(timeout=timeout, force=force)\n if stop_control_plane:\n self.control_plane.stop()\n self._started = False\n self._state = LifecycleState.STOPPED\n\n def status(self) -> dict[str, object]:\n self._refresh_state()\n return self.control_plane.snapshot(self)\n\n def current_health(self) -> HealthPayload:\n self._refresh_state()\n return self.health.payload(self._state, self.workers.healths())\n\n async def health_status(self) -> HealthPayload:\n return self.current_health()\n\n async def start_runtime(self) -> dict[str, object] | str:\n self._refresh_state()\n if self._started:\n return \"runtime already running\"\n if self._state == LifecycleState.STOPPING:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n\n self.start(start_control_plane=False)\n started = self._wait_for_state({LifecycleState.IDLE, LifecycleState.BUSY}, timeout=self.ACTION_TIMEOUT_SECONDS)\n if started:\n return self._action_detail(\"runtime started\", timed_out=False)\n return self._action_detail(\"runtime start is still in progress\", timed_out=True)\n\n async def stop_runtime(self) -> dict[str, object] | str:\n self._refresh_state()\n if not self._started:\n if self._state == LifecycleState.STOPPING:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n return \"runtime already stopped\"\n\n self._state = LifecycleState.STOPPING\n try:\n self.workers.stop(timeout=self.ACTION_TIMEOUT_SECONDS, force=False)\n except TimeoutError:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n\n self._started = False\n self._state = LifecycleState.STOPPED\n return self._action_detail(\"runtime stopped\", timed_out=False)\n\n async def runtime_status(self) -> str:\n self._refresh_state()\n return self._state.value\n\n def _register_core_services(self) -> None:\n if self._core_registered:\n return\n self.services.register(\"configuration\", self.configuration)\n self.services.register(\"traces\", self.traces)\n self.services.register(\"health\", self.health)\n self.services.register(\"logs\", self.logs)\n self.services.register(\"workers\", self.workers)\n self.services.register(\"control_plane\", self.control_plane)\n self._core_registered = True\n\n def _register_health_contributors(self) -> None:\n for contributor in self.registry.health_contributors:\n self.health.register(contributor)\n\n def _register_workers(self) -> None:\n if self._workers_registered:\n return\n for worker in self.registry.workers:\n self.workers.register(worker)\n self._workers_registered = True\n\n def _refresh_state(self) -> None:\n lifecycle = self.workers.lifecycle_state()\n\n if self._state == LifecycleState.STOPPING:\n if lifecycle == LifecycleState.STOPPED:\n self._started = False\n self._state = LifecycleState.STOPPED\n return\n\n if not self._started:\n if lifecycle == LifecycleState.STOPPED:\n self._state = LifecycleState.STOPPED\n return\n\n self._state = lifecycle\n\n def _wait_for_state(self, target_states: set[LifecycleState], *, timeout: float) -> bool:\n deadline = monotonic() + timeout\n while monotonic() < deadline:\n self._refresh_state()\n if self._state in target_states:\n return True\n sleep(self.ACTION_POLL_INTERVAL_SECONDS)\n self._refresh_state()\n return self._state in target_states\n\n def _action_detail(self, message: str, *, timed_out: bool) -> dict[str, object]:\n self._refresh_state()\n return {\n \"message\": message,\n \"state\": self._state.value,\n \"timed_out\": timed_out,\n \"workers\": self.workers.snapshot(),\n }", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/core/runtime.py:RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.core.runtime", - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ] - }, - "diagnostics": { - "execution": { - "executed_layers": [ - "C0_SOURCE_CHUNKS" - ], - "retrieval_mode_by_layer": { - "C0_SOURCE_CHUNKS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C0_SOURCE_CHUNKS": 200 - }, - "filters_by_layer": { - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src/app_runtime/core/runtime.py" - ], - "include_globs": [], - "exclude_globs": [], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Открой файл src/app_runtime/core/runtime.py", - "path_scope": [ - "src/app_runtime/core/runtime.py" - ], - "include_globs": [], - "exclude_globs": [], - "prefer_globs": [], - "top_k": 200, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src/app_runtime/core/runtime.py" - ], - "normalized_include_globs": [], - "normalized_exclude_globs": [], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 1, - "candidates_after_filter": 1 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "not_requested", - "resolved_symbol": null, - "alternatives": [] - }, - "layers": [ - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 1, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "symbol_resolution": 0, - "retrieval_total": 270, - "retrieval_by_layer": { - "C0_SOURCE_CHUNKS": 270 - }, - "merge_rank": 0 - } - } - }, - { - "step": "llm_answer", - "input": { - "query": "Открой файл src/app_runtime/core/runtime.py", - "rag_count": 1 - }, - "output": { - "llm_answer": "1. путь к файлу: src/app_runtime/core/runtime.py\n2. В доступном фрагменте показан класс RuntimeManager с его атрибутами и методом __init__. Видно объявление нескольких параметров конструктора класса и инициализация соответствующих полей.\n3. Top-level сущности и секции: класс RuntimeManager, метод __init__\n4. Важные части для вопроса пользователя:\n- Класс RuntimeManager является основным управляющим объектом runtime-системы.\n- Метод __init__ устанавливает начальные значения полей объекта и регистрирует базовые сервисы приложения. \n- Параметры конструктора определяют компоненты системы, такие как конфигурация, службы, журналы, контроль состояния и другие." - }, - "diagnostics": { - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 600, - "evidence_rows": 1, - "evidence_chars": 6265 - }, - "evidence_summary": [ - { - "layer": "C0_SOURCE_CHUNKS", - "count": 1, - "unique_paths": 1 - } - ], - "prompt_template_id": "intent_code_qa_open_file_ru_v2", - "system_prompt_version": "v1" - }, - "timings_ms": { - "prompt_build": 0, - "llm_call": 1393 - } - } - } - ] - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_132357/full_chain_plba_code_subintents_v2_plba-v2-open-file-runtime.md b/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_132357/full_chain_plba_code_subintents_v2_plba-v2-open-file-runtime.md deleted file mode 100644 index e0fd4de..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_132357/full_chain_plba_code_subintents_v2_plba-v2-open-file-runtime.md +++ /dev/null @@ -1,30 +0,0 @@ -# plba-v2-open-file-runtime - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_subintents_v2.yaml -- runner: runtime -- mode: full_chain -- passed: True - -## Query -Открой файл src/app_runtime/core/runtime.py - -## Actual -{ - "intent": "CODE_QA", - "sub_intent": "OPEN_FILE", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 1, - "llm_answer": "1. путь к файлу: src/app_runtime/core/runtime.py\n2. В доступном фрагменте показан класс RuntimeManager с его атрибутами и методом __init__. Видно объявление нескольких параметров конструктора класса и инициализация соответствующих полей.\n3. Top-level сущности и секции: класс RuntimeManager, метод __init__\n4. Важные части для вопроса пользователя:\n- Класс RuntimeManager является основным управляющим объектом runtime-системы.\n- Метод __init__ устанавливает начальные значения полей объекта и регистрирует базовые сервисы приложения. \n- Параметры конструктора определяют компоненты системы, такие как конфигурация, службы, журналы, контроль состояния и другие.", - "answer_mode": "answered", - "path_scope": [ - "src/app_runtime/core/runtime.py" - ], - "symbol_candidates": [], - "layers": [ - "C0_SOURCE_CHUNKS" - ] -} - -## Mismatches -- none \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_132357/full_chain_plba_code_subintents_v2_plba-v2-trace-flow-health-endpoint.json b/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_132357/full_chain_plba_code_subintents_v2_plba-v2-trace-flow-health-endpoint.json deleted file mode 100644 index de4bf93..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_132357/full_chain_plba_code_subintents_v2_plba-v2-trace-flow-health-endpoint.json +++ /dev/null @@ -1,3084 +0,0 @@ -{ - "case_id": "plba-v2-trace-flow-health-endpoint", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_subintents_v2.yaml", - "runner": "runtime", - "mode": "full_chain", - "actual": { - "intent": "CODE_QA", - "sub_intent": "TRACE_FLOW", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 26, - "llm_answer": "1. Точка старта — вызовы `/health` и `/actions/{action}` через `HttpControlAppFactory.create`.\n2. \n\n- 2.1. HttpControlAppFactory.create → создание экземпляра FastAPI (`app = FastAPI(...)`)\n- 2.2. Внутри FastAPI создаётся middleware для логирования времени отклика запроса (`@app.middleware(\"http\")`)\n- 2.3. Добавляются маршруты: \n - GET `/health`: вызывает функцию `health_provider`, возвращает статус через JSONResponse. \n - GET/POST `/actions/{action}`: проверяет доступное действие, регистрирует клиентский источник и выполняет действия типа «запуск» или «остановка».\n \n3. Связь между шагами подтверждается непосредственно объявлением функций внутри класса `HttpControlAppFactory` (источник: [C0_SOURCE_CHUNKS]).\n4. Неполные данные отсутствуют. Весь описанный путь следования потока вызова документирован на основе доступных источников.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "health", - "HttpControlAppFactory" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "passed": true, - "mismatches": [], - "details": { - "case_id": "plba-v2-trace-flow-health-endpoint", - "text": "Покажи как проходит запрос /health в HttpControlAppFactory", - "mode": "full_chain", - "run_started_at": "2026-03-12T13:23:57", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Покажи как проходит запрос /health в HttpControlAppFactory", - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "HttpControlAppFactory", - "alternatives": [ - "HttpControlAppFactory", - "ControlActionSet", - "HealthContributor.health", - "HealthContributor" - ], - "confidence": 0.99 - }, - "rag_count": 26, - "rag_rows": [ - { - "path": "src/app_runtime/control/http_app.py", - "content": "class HttpControlAppFactory\nHttpControlAppFactory", - "layer": "C1_SYMBOL_CATALOG", - "title": "HttpControlAppFactory", - "span_start": 15, - "span_end": 53, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "9b3502a5fb408b273223db13264349cf500de24915b6c649d9ea8970d0dfd8e0", - "qname": "HttpControlAppFactory", - "kind": "class", - "signature": "HttpControlAppFactory", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.control.http_app", - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "class ControlActionSet\nControlActionSet", - "layer": "C1_SYMBOL_CATALOG", - "title": "ControlActionSet", - "span_start": 14, - "span_end": 18, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "46eb026cb3313415ec47b82dd22f84f4d112c9d987e8b1716dcb0baa1cce8988", - "qname": "ControlActionSet", - "kind": "class", - "signature": "ControlActionSet", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.control.base", - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/contracts/health.py", - "content": "method HealthContributor.health\nhealth(self)\nReturn contributor health state.", - "layer": "C1_SYMBOL_CATALOG", - "title": "HealthContributor.health", - "span_start": 9, - "span_end": 10, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "728cff18958d8a25e2661a0f08c83d68c3bbbfa8cef212b85dc0da2b11b3dc90", - "qname": "HealthContributor.health", - "kind": "method", - "signature": "health(self)", - "parent_symbol_id": "HealthContributor", - "package_or_module": "src.app_runtime.contracts.health", - "is_test": false, - "blob_sha": "6bd92611def7131e32d4dd34a8ed85e6cf3c67722ad27797032a632cb30dc097", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/contracts/health.py", - "content": "class HealthContributor\nHealthContributor(ABC)", - "layer": "C1_SYMBOL_CATALOG", - "title": "HealthContributor", - "span_start": 7, - "span_end": 10, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "db91ae387b89a2e9d83829754f27fa18a4055b3e72d7f31789a0b8e0bf5bba0b", - "qname": "HealthContributor", - "kind": "class", - "signature": "HealthContributor(ABC)", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.contracts.health", - "is_test": false, - "blob_sha": "6bd92611def7131e32d4dd34a8ed85e6cf3c67722ad27797032a632cb30dc097", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "HttpControlAppFactory\nrole: factory\n\nResponsibilities:\n- name suffix suggests factory", - "layer": "C4_SEMANTIC_ROLES", - "title": "HttpControlAppFactory", - "span_start": 15, - "span_end": 53, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 39, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "9b3502a5fb408b273223db13264349cf500de24915b6c649d9ea8970d0dfd8e0", - "symbol_name": "HttpControlAppFactory", - "qname": "HttpControlAppFactory", - "role": "factory", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/health/registry.py", - "content": "HealthRegistry\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (2)", - "layer": "C4_SEMANTIC_ROLES", - "title": "HealthRegistry", - "span_start": 8, - "span_end": 56, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 29, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "fd3390eb0ba29c9979466b9c2117238e0da3bb829eeb4d505cb34c9c3df7a8e8", - "symbol_name": "HealthRegistry", - "qname": "HealthRegistry", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 2, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "26e6a24daa43407ba5340b74497c20153020e79f8d7828ae502aaec378dfcf75", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/types.py", - "content": "HealthPayload\nrole: model\n\nResponsibilities:\n- default model role", - "layer": "C4_SEMANTIC_ROLES", - "title": "HealthPayload", - "span_start": 7, - "span_end": 11, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 40, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "392235d63ddf752d6e419cb8528c93fe070d1bc02d3c87ba6a897baac810cf5d", - "symbol_name": "HealthPayload", - "qname": "HealthPayload", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "448a02e4a432b5ab65b246b2bd24a32a6f127b9d2091ea73b53ee3c0a2f53bb3", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/contracts/health.py", - "content": "HealthContributor\nrole: model\n\nResponsibilities:\n- default model role", - "layer": "C4_SEMANTIC_ROLES", - "title": "HealthContributor", - "span_start": 7, - "span_end": 10, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 40, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "db91ae387b89a2e9d83829754f27fa18a4055b3e72d7f31789a0b8e0bf5bba0b", - "symbol_name": "HealthContributor", - "qname": "HealthContributor", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "6bd92611def7131e32d4dd34a8ed85e6cf3c67722ad27797032a632cb30dc097", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "ControlActionSet\nrole: model\n\nResponsibilities:\n- default model role", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlActionSet", - "span_start": 14, - "span_end": 18, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 40, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "46eb026cb3313415ec47b82dd22f84f4d112c9d987e8b1716dcb0baa1cce8988", - "symbol_name": "ControlActionSet", - "qname": "ControlActionSet", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "ControlChannel\nrole: model\n\nResponsibilities:\n- default model role", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlChannel", - "span_start": 21, - "span_end": 28, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 40, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "cfcfe9a311d3a2dbdaf32ac4ccd73c0eb9a117f830591a1c0867ee97d46204ff", - "symbol_name": "ControlChannel", - "qname": "ControlChannel", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests service\n- reads and writes state attributes\n- participates in dataflow slices (5)", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlPlaneService", - "span_start": 12, - "span_end": 52, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 68, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "b13471e5916986dccffb53fab613812842965705e6b3a89ae549d30c9e91e9aa", - "symbol_name": "ControlPlaneService", - "qname": "ControlPlaneService", - "role": "pipeline_stage", - "confidence": 0.57, - "dataflow_participation": 5, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_runner.py", - "content": "UvicornThreadRunner\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (24)", - "layer": "C4_SEMANTIC_ROLES", - "title": "UvicornThreadRunner", - "span_start": 10, - "span_end": 61, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 11, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "fd55630045a02100df8877ac27d951ee08617d4598764394d48cb51fe067476a", - "symbol_name": "UvicornThreadRunner", - "qname": "UvicornThreadRunner", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 24, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "3779fdd2878b770e789a35bb2a89c9d79f13b61c26d7db1b3b683f9bb9e1623f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/health/registry.py", - "content": "HealthRegistry.__init__\n -> HealthRegistry._contributors\n -> HealthRegistry.register", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "HealthRegistry.__init__:dataflow_slice", - "span_start": 10, - "span_end": 13, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "2381dfb339d541367c3251d2a610cac9d8b3f6bd6a352e119d00a93c5ccc2b7d", - "edge_type": "dataflow_slice", - "src_symbol_id": "e8ffd58441c231de43d9e86c31eb12303d4e2bf045b2acf13d1dfe78da01f8dc", - "src_qname": "HealthRegistry.__init__", - "dst_symbol_id": "a9e1f290c346c8bb1d67af0cafeebb5bcaf29c3ed7027e33c794532743df38f2", - "dst_ref": "HealthRegistry.register", - "resolution": "resolved", - "slice_id": "2381dfb339d541367c3251d2a610cac9d8b3f6bd6a352e119d00a93c5ccc2b7d", - "root_symbol_id": "e8ffd58441c231de43d9e86c31eb12303d4e2bf045b2acf13d1dfe78da01f8dc", - "path_symbols": [ - "HealthRegistry.__init__", - "HealthRegistry._contributors", - "HealthRegistry.register" - ], - "path_symbol_ids": [ - "e8ffd58441c231de43d9e86c31eb12303d4e2bf045b2acf13d1dfe78da01f8dc", - "a9e1f290c346c8bb1d67af0cafeebb5bcaf29c3ed7027e33c794532743df38f2" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "26e6a24daa43407ba5340b74497c20153020e79f8d7828ae502aaec378dfcf75", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.start", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 20, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154", - "dst_ref": "ControlPlaneService.start", - "resolution": "resolved", - "slice_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.start" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.stop", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 25, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d", - "dst_ref": "ControlPlaneService.stop", - "resolution": "resolved", - "slice_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.stop" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._stop_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 51, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a", - "dst_ref": "ControlPlaneService._stop_async", - "resolution": "resolved", - "slice_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._stop_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/health/registry.py", - "content": "HealthRegistry.__init__\n -> HealthRegistry._contributors\n -> HealthRegistry.contributor_healths", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "HealthRegistry.__init__:dataflow_slice", - "span_start": 10, - "span_end": 16, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "d3a88a7abf16359e903e809ffc24473658fdd8198f60641fe1584fc4ac663c31", - "edge_type": "dataflow_slice", - "src_symbol_id": "e8ffd58441c231de43d9e86c31eb12303d4e2bf045b2acf13d1dfe78da01f8dc", - "src_qname": "HealthRegistry.__init__", - "dst_symbol_id": "fa7bbd8f4b64a55a5088640c30f52e84075d65f531bd7e1f6c1d7bb8d24fcbf2", - "dst_ref": "HealthRegistry.contributor_healths", - "resolution": "resolved", - "slice_id": "d3a88a7abf16359e903e809ffc24473658fdd8198f60641fe1584fc4ac663c31", - "root_symbol_id": "e8ffd58441c231de43d9e86c31eb12303d4e2bf045b2acf13d1dfe78da01f8dc", - "path_symbols": [ - "HealthRegistry.__init__", - "HealthRegistry._contributors", - "HealthRegistry.contributor_healths" - ], - "path_symbol_ids": [ - "e8ffd58441c231de43d9e86c31eb12303d4e2bf045b2acf13d1dfe78da01f8dc", - "fa7bbd8f4b64a55a5088640c30f52e84075d65f531bd7e1f6c1d7bb8d24fcbf2" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "26e6a24daa43407ba5340b74497c20153020e79f8d7828ae502aaec378dfcf75", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._start_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 47, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517", - "dst_ref": "ControlPlaneService._start_async", - "resolution": "resolved", - "slice_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._start_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.register_channel", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 17, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957", - "dst_ref": "ControlPlaneService.register_channel", - "resolution": "resolved", - "slice_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.register_channel" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "HttpControlAppFactory.create calls time.monotonic", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "HttpControlAppFactory.create:calls", - "span_start": 25, - "span_end": 25, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "3fdd0a88d10225ee74f3b84ab57e13f09f5ccc72f00e31af9ae4655411c289c0", - "edge_type": "calls", - "src_symbol_id": "4af42c2a9275d652e710a98ec48b8247236b4453a093629f8958704ff6d3cb58", - "src_qname": "HttpControlAppFactory.create", - "dst_symbol_id": null, - "dst_ref": "time.monotonic", - "resolution": "partial", - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "HttpControlAppFactory.create calls app.post", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "HttpControlAppFactory.create:calls", - "span_start": 37, - "span_end": 37, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "0e545d4b5187db7bec5ceac03071d2ad68177550c42af748fee364639e533c90", - "edge_type": "calls", - "src_symbol_id": "4af42c2a9275d652e710a98ec48b8247236b4453a093629f8958704ff6d3cb58", - "src_qname": "HttpControlAppFactory.create", - "dst_symbol_id": null, - "dst_ref": "app.post", - "resolution": "partial", - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "HttpControlAppFactory.create calls str", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "HttpControlAppFactory.create:calls", - "span_start": 27, - "span_end": 27, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "2a87c51461e31cd556508cc37fdff37b4d24c26f7f1604db30af5e8f1bda96cb", - "edge_type": "calls", - "src_symbol_id": "4af42c2a9275d652e710a98ec48b8247236b4453a093629f8958704ff6d3cb58", - "src_qname": "HttpControlAppFactory.create", - "dst_symbol_id": null, - "dst_ref": "str", - "resolution": "partial", - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "class HttpControlAppFactory:\n def create(\n self,\n health_provider: Callable[[], Awaitable[HealthPayload]],\n action_provider: Callable[[str, str], Awaitable[JSONResponse]],\n ) -> FastAPI:\n app = FastAPI(title=\"PLBA Control API\")\n\n @app.middleware(\"http\")\n async def log_api_call(request: Request, call_next): # type: ignore[no-untyped-def]\n started = time.monotonic()\n response = await call_next(request)\n response.headers[\"X-Response-Time-Ms\"] = str(int((time.monotonic() - started) * 1000))\n return response\n\n @app.get(\"/health\")\n async def health() -> JSONResponse:\n payload = await health_provider()\n status_code = 200 if payload.get(\"status\") == \"ok\" else 503\n return JSONResponse(content=payload, status_code=status_code)\n\n @app.get(\"/actions/{action}\")\n @app.post(\"/actions/{action}\")\n async def action(action: str, request: Request) -> JSONResponse:\n client_source = self._client_source(request)\n if action in {\"start\", \"stop\"}:\n LOGGER.warning(\"Control action requested: /actions/%s client=%s\", action, client_source)\n return await action_provider(action, client_source)\n\n return app\n\n def _client_source(self, request: Request) -> str:\n explicit_header = request.headers.get(\"X-Client-Source\", \"\").strip()\n if explicit_header:\n return explicit_header\n user_agent = request.headers.get(\"User-Agent\", \"\").strip()\n if user_agent:\n return f\"user-agent:{user_agent}\"\n return \"unknown\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/http_app.py:HttpControlAppFactory", - "span_start": 15, - "span_end": 53, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.http_app", - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "llm_answer": "1. Точка старта — вызовы `/health` и `/actions/{action}` через `HttpControlAppFactory.create`.\n2. \n\n- 2.1. HttpControlAppFactory.create → создание экземпляра FastAPI (`app = FastAPI(...)`)\n- 2.2. Внутри FastAPI создаётся middleware для логирования времени отклика запроса (`@app.middleware(\"http\")`)\n- 2.3. Добавляются маршруты: \n - GET `/health`: вызывает функцию `health_provider`, возвращает статус через JSONResponse. \n - GET/POST `/actions/{action}`: проверяет доступное действие, регистрирует клиентский источник и выполняет действия типа «запуск» или «остановка».\n \n3. Связь между шагами подтверждается непосредственно объявлением функций внутри класса `HttpControlAppFactory` (источник: [C0_SOURCE_CHUNKS]).\n4. Неполные данные отсутствуют. Весь описанный путь следования потока вызова документирован на основе доступных источников.", - "summary": { - "router": { - "intent": "CODE_QA", - "sub_intent": "TRACE_FLOW", - "confidence": null - }, - "retrieval": { - "profile": "code", - "layers_hit": [ - "C0_SOURCE_CHUNKS", - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS", - "C4_SEMANTIC_ROLES" - ], - "evidence_sufficient": true - }, - "llm": { - "answer_status": "answered", - "groundedness": "grounded" - } - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "TRACE_FLOW", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "symbol_kind_hint": "unknown", - "symbol_candidates": [ - "health", - "HttpControlAppFactory" - ], - "keyword_hints": [ - "health", - "HttpControlAppFactory" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C0_SOURCE_CHUNKS": "exact_path_fetch", - "C4_SEMANTIC_ROLES": "exact_path_fetch", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C3_ENTRYPOINTS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 8, - "C4_SEMANTIC_ROLES": 8, - "C2_DEPENDENCY_GRAPH": 10, - "C3_ENTRYPOINTS": 10 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C4_SEMANTIC_ROLES": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "health HttpControlAppFactory", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Покажи как проходит запрос /health в HttpControlAppFactory", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C4_SEMANTIC_ROLES", - "query": "Покажи как проходит запрос /health в HttpControlAppFactory", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "Покажи как проходит запрос /health в HttpControlAppFactory", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 10, - "ranking_profile": "code" - }, - { - "layer": "C3_ENTRYPOINTS", - "query": "Покажи как проходит запрос /health в HttpControlAppFactory", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 10, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 4, - "candidates_after_filter": 4 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 10, - "candidates_after_filter": 10 - }, - { - "layer": "C3_ENTRYPOINTS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 3, - "candidates_after_filter": 3 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "HttpControlAppFactory", - "alternatives": [ - "HttpControlAppFactory", - "ControlActionSet", - "HealthContributor.health", - "HealthContributor" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "hit", - "hit_count": 4, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C4_SEMANTIC_ROLES", - "status": "hit", - "hit_count": 8, - "fail_reason": null - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 10, - "fail_reason": null - }, - { - "layer": "C3_ENTRYPOINTS", - "status": "hit", - "hit_count": 3, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "router": 0, - "symbol_resolution": 0, - "retrieval_total": 156, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 50, - "C0_SOURCE_CHUNKS": 22, - "C4_SEMANTIC_ROLES": 17, - "C2_DEPENDENCY_GRAPH": 55, - "C3_ENTRYPOINTS": 10 - }, - "merge_rank": 40, - "prompt_build": 0, - "llm_call": 1739 - }, - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 794, - "evidence_rows": 26, - "evidence_chars": 3507 - }, - "evidence_summary": [ - { - "layer": "C1_SYMBOL_CATALOG", - "count": 4, - "unique_paths": 3 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "count": 8, - "unique_paths": 7 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "count": 10, - "unique_paths": 3 - }, - { - "layer": "C3_ENTRYPOINTS", - "count": 3, - "unique_paths": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 1, - "unique_paths": 1 - } - ], - "prompt_template_id": "intent_code_qa_trace_flow_ru_v2", - "system_prompt_version": "v1" - }, - "router": { - "conversation_mode": "START", - "keyword_hints": [ - "health", - "HttpControlAppFactory" - ], - "path_scope": [] - }, - "llm": { - "used_evidence_count": 26, - "missing_evidence_reason": null - } - }, - "run_info": { - "case_id": "plba-v2-trace-flow-health-endpoint", - "mode": "full_chain", - "run_started_at": "2026-03-12T13:23:57", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - }, - "input_request": { - "text": "Покажи как проходит запрос /health в HttpControlAppFactory", - "normalized_query": "Покажи как проходит запрос /health в HttpControlAppFactory" - }, - "steps": [ - { - "step": "intent_router", - "input": { - "query": "Покажи как проходит запрос /health в HttpControlAppFactory" - }, - "output": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Покажи как проходит запрос /health в HttpControlAppFactory" - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "TRACE_FLOW", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "symbol_kind_hint": "unknown", - "symbol_candidates": [ - "health", - "HttpControlAppFactory" - ], - "keyword_hints": [ - "health", - "HttpControlAppFactory" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "timings_ms": { - "router": 0 - } - } - }, - { - "step": "retrieval", - "input": { - "query": "Покажи как проходит запрос /health в HttpControlAppFactory" - }, - "output": { - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "HttpControlAppFactory", - "alternatives": [ - "HttpControlAppFactory", - "ControlActionSet", - "HealthContributor.health", - "HealthContributor" - ], - "confidence": 0.99 - }, - "rag_count": 26, - "rag_rows": [ - { - "path": "src/app_runtime/control/http_app.py", - "content": "class HttpControlAppFactory\nHttpControlAppFactory", - "layer": "C1_SYMBOL_CATALOG", - "title": "HttpControlAppFactory", - "span_start": 15, - "span_end": 53, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "9b3502a5fb408b273223db13264349cf500de24915b6c649d9ea8970d0dfd8e0", - "qname": "HttpControlAppFactory", - "kind": "class", - "signature": "HttpControlAppFactory", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.control.http_app", - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "class ControlActionSet\nControlActionSet", - "layer": "C1_SYMBOL_CATALOG", - "title": "ControlActionSet", - "span_start": 14, - "span_end": 18, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "46eb026cb3313415ec47b82dd22f84f4d112c9d987e8b1716dcb0baa1cce8988", - "qname": "ControlActionSet", - "kind": "class", - "signature": "ControlActionSet", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.control.base", - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/contracts/health.py", - "content": "method HealthContributor.health\nhealth(self)\nReturn contributor health state.", - "layer": "C1_SYMBOL_CATALOG", - "title": "HealthContributor.health", - "span_start": 9, - "span_end": 10, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "728cff18958d8a25e2661a0f08c83d68c3bbbfa8cef212b85dc0da2b11b3dc90", - "qname": "HealthContributor.health", - "kind": "method", - "signature": "health(self)", - "parent_symbol_id": "HealthContributor", - "package_or_module": "src.app_runtime.contracts.health", - "is_test": false, - "blob_sha": "6bd92611def7131e32d4dd34a8ed85e6cf3c67722ad27797032a632cb30dc097", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/contracts/health.py", - "content": "class HealthContributor\nHealthContributor(ABC)", - "layer": "C1_SYMBOL_CATALOG", - "title": "HealthContributor", - "span_start": 7, - "span_end": 10, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "db91ae387b89a2e9d83829754f27fa18a4055b3e72d7f31789a0b8e0bf5bba0b", - "qname": "HealthContributor", - "kind": "class", - "signature": "HealthContributor(ABC)", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.contracts.health", - "is_test": false, - "blob_sha": "6bd92611def7131e32d4dd34a8ed85e6cf3c67722ad27797032a632cb30dc097", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "HttpControlAppFactory\nrole: factory\n\nResponsibilities:\n- name suffix suggests factory", - "layer": "C4_SEMANTIC_ROLES", - "title": "HttpControlAppFactory", - "span_start": 15, - "span_end": 53, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 39, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "9b3502a5fb408b273223db13264349cf500de24915b6c649d9ea8970d0dfd8e0", - "symbol_name": "HttpControlAppFactory", - "qname": "HttpControlAppFactory", - "role": "factory", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/health/registry.py", - "content": "HealthRegistry\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (2)", - "layer": "C4_SEMANTIC_ROLES", - "title": "HealthRegistry", - "span_start": 8, - "span_end": 56, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 29, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "fd3390eb0ba29c9979466b9c2117238e0da3bb829eeb4d505cb34c9c3df7a8e8", - "symbol_name": "HealthRegistry", - "qname": "HealthRegistry", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 2, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "26e6a24daa43407ba5340b74497c20153020e79f8d7828ae502aaec378dfcf75", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/types.py", - "content": "HealthPayload\nrole: model\n\nResponsibilities:\n- default model role", - "layer": "C4_SEMANTIC_ROLES", - "title": "HealthPayload", - "span_start": 7, - "span_end": 11, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 40, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "392235d63ddf752d6e419cb8528c93fe070d1bc02d3c87ba6a897baac810cf5d", - "symbol_name": "HealthPayload", - "qname": "HealthPayload", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "448a02e4a432b5ab65b246b2bd24a32a6f127b9d2091ea73b53ee3c0a2f53bb3", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/contracts/health.py", - "content": "HealthContributor\nrole: model\n\nResponsibilities:\n- default model role", - "layer": "C4_SEMANTIC_ROLES", - "title": "HealthContributor", - "span_start": 7, - "span_end": 10, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 40, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "db91ae387b89a2e9d83829754f27fa18a4055b3e72d7f31789a0b8e0bf5bba0b", - "symbol_name": "HealthContributor", - "qname": "HealthContributor", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "6bd92611def7131e32d4dd34a8ed85e6cf3c67722ad27797032a632cb30dc097", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "ControlActionSet\nrole: model\n\nResponsibilities:\n- default model role", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlActionSet", - "span_start": 14, - "span_end": 18, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 40, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "46eb026cb3313415ec47b82dd22f84f4d112c9d987e8b1716dcb0baa1cce8988", - "symbol_name": "ControlActionSet", - "qname": "ControlActionSet", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "ControlChannel\nrole: model\n\nResponsibilities:\n- default model role", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlChannel", - "span_start": 21, - "span_end": 28, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 40, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "cfcfe9a311d3a2dbdaf32ac4ccd73c0eb9a117f830591a1c0867ee97d46204ff", - "symbol_name": "ControlChannel", - "qname": "ControlChannel", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests service\n- reads and writes state attributes\n- participates in dataflow slices (5)", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlPlaneService", - "span_start": 12, - "span_end": 52, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 68, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "b13471e5916986dccffb53fab613812842965705e6b3a89ae549d30c9e91e9aa", - "symbol_name": "ControlPlaneService", - "qname": "ControlPlaneService", - "role": "pipeline_stage", - "confidence": 0.57, - "dataflow_participation": 5, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_runner.py", - "content": "UvicornThreadRunner\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (24)", - "layer": "C4_SEMANTIC_ROLES", - "title": "UvicornThreadRunner", - "span_start": 10, - "span_end": 61, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 11, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "fd55630045a02100df8877ac27d951ee08617d4598764394d48cb51fe067476a", - "symbol_name": "UvicornThreadRunner", - "qname": "UvicornThreadRunner", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 24, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "3779fdd2878b770e789a35bb2a89c9d79f13b61c26d7db1b3b683f9bb9e1623f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/health/registry.py", - "content": "HealthRegistry.__init__\n -> HealthRegistry._contributors\n -> HealthRegistry.register", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "HealthRegistry.__init__:dataflow_slice", - "span_start": 10, - "span_end": 13, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "2381dfb339d541367c3251d2a610cac9d8b3f6bd6a352e119d00a93c5ccc2b7d", - "edge_type": "dataflow_slice", - "src_symbol_id": "e8ffd58441c231de43d9e86c31eb12303d4e2bf045b2acf13d1dfe78da01f8dc", - "src_qname": "HealthRegistry.__init__", - "dst_symbol_id": "a9e1f290c346c8bb1d67af0cafeebb5bcaf29c3ed7027e33c794532743df38f2", - "dst_ref": "HealthRegistry.register", - "resolution": "resolved", - "slice_id": "2381dfb339d541367c3251d2a610cac9d8b3f6bd6a352e119d00a93c5ccc2b7d", - "root_symbol_id": "e8ffd58441c231de43d9e86c31eb12303d4e2bf045b2acf13d1dfe78da01f8dc", - "path_symbols": [ - "HealthRegistry.__init__", - "HealthRegistry._contributors", - "HealthRegistry.register" - ], - "path_symbol_ids": [ - "e8ffd58441c231de43d9e86c31eb12303d4e2bf045b2acf13d1dfe78da01f8dc", - "a9e1f290c346c8bb1d67af0cafeebb5bcaf29c3ed7027e33c794532743df38f2" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "26e6a24daa43407ba5340b74497c20153020e79f8d7828ae502aaec378dfcf75", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.start", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 20, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154", - "dst_ref": "ControlPlaneService.start", - "resolution": "resolved", - "slice_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.start" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.stop", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 25, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d", - "dst_ref": "ControlPlaneService.stop", - "resolution": "resolved", - "slice_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.stop" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._stop_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 51, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a", - "dst_ref": "ControlPlaneService._stop_async", - "resolution": "resolved", - "slice_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._stop_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/health/registry.py", - "content": "HealthRegistry.__init__\n -> HealthRegistry._contributors\n -> HealthRegistry.contributor_healths", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "HealthRegistry.__init__:dataflow_slice", - "span_start": 10, - "span_end": 16, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "d3a88a7abf16359e903e809ffc24473658fdd8198f60641fe1584fc4ac663c31", - "edge_type": "dataflow_slice", - "src_symbol_id": "e8ffd58441c231de43d9e86c31eb12303d4e2bf045b2acf13d1dfe78da01f8dc", - "src_qname": "HealthRegistry.__init__", - "dst_symbol_id": "fa7bbd8f4b64a55a5088640c30f52e84075d65f531bd7e1f6c1d7bb8d24fcbf2", - "dst_ref": "HealthRegistry.contributor_healths", - "resolution": "resolved", - "slice_id": "d3a88a7abf16359e903e809ffc24473658fdd8198f60641fe1584fc4ac663c31", - "root_symbol_id": "e8ffd58441c231de43d9e86c31eb12303d4e2bf045b2acf13d1dfe78da01f8dc", - "path_symbols": [ - "HealthRegistry.__init__", - "HealthRegistry._contributors", - "HealthRegistry.contributor_healths" - ], - "path_symbol_ids": [ - "e8ffd58441c231de43d9e86c31eb12303d4e2bf045b2acf13d1dfe78da01f8dc", - "fa7bbd8f4b64a55a5088640c30f52e84075d65f531bd7e1f6c1d7bb8d24fcbf2" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "26e6a24daa43407ba5340b74497c20153020e79f8d7828ae502aaec378dfcf75", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._start_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 47, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517", - "dst_ref": "ControlPlaneService._start_async", - "resolution": "resolved", - "slice_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._start_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.register_channel", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 17, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957", - "dst_ref": "ControlPlaneService.register_channel", - "resolution": "resolved", - "slice_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.register_channel" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "HttpControlAppFactory.create calls time.monotonic", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "HttpControlAppFactory.create:calls", - "span_start": 25, - "span_end": 25, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "3fdd0a88d10225ee74f3b84ab57e13f09f5ccc72f00e31af9ae4655411c289c0", - "edge_type": "calls", - "src_symbol_id": "4af42c2a9275d652e710a98ec48b8247236b4453a093629f8958704ff6d3cb58", - "src_qname": "HttpControlAppFactory.create", - "dst_symbol_id": null, - "dst_ref": "time.monotonic", - "resolution": "partial", - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "HttpControlAppFactory.create calls app.post", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "HttpControlAppFactory.create:calls", - "span_start": 37, - "span_end": 37, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "0e545d4b5187db7bec5ceac03071d2ad68177550c42af748fee364639e533c90", - "edge_type": "calls", - "src_symbol_id": "4af42c2a9275d652e710a98ec48b8247236b4453a093629f8958704ff6d3cb58", - "src_qname": "HttpControlAppFactory.create", - "dst_symbol_id": null, - "dst_ref": "app.post", - "resolution": "partial", - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "HttpControlAppFactory.create calls str", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "HttpControlAppFactory.create:calls", - "span_start": 27, - "span_end": 27, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "2a87c51461e31cd556508cc37fdff37b4d24c26f7f1604db30af5e8f1bda96cb", - "edge_type": "calls", - "src_symbol_id": "4af42c2a9275d652e710a98ec48b8247236b4453a093629f8958704ff6d3cb58", - "src_qname": "HttpControlAppFactory.create", - "dst_symbol_id": null, - "dst_ref": "str", - "resolution": "partial", - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "class HttpControlAppFactory:\n def create(\n self,\n health_provider: Callable[[], Awaitable[HealthPayload]],\n action_provider: Callable[[str, str], Awaitable[JSONResponse]],\n ) -> FastAPI:\n app = FastAPI(title=\"PLBA Control API\")\n\n @app.middleware(\"http\")\n async def log_api_call(request: Request, call_next): # type: ignore[no-untyped-def]\n started = time.monotonic()\n response = await call_next(request)\n response.headers[\"X-Response-Time-Ms\"] = str(int((time.monotonic() - started) * 1000))\n return response\n\n @app.get(\"/health\")\n async def health() -> JSONResponse:\n payload = await health_provider()\n status_code = 200 if payload.get(\"status\") == \"ok\" else 503\n return JSONResponse(content=payload, status_code=status_code)\n\n @app.get(\"/actions/{action}\")\n @app.post(\"/actions/{action}\")\n async def action(action: str, request: Request) -> JSONResponse:\n client_source = self._client_source(request)\n if action in {\"start\", \"stop\"}:\n LOGGER.warning(\"Control action requested: /actions/%s client=%s\", action, client_source)\n return await action_provider(action, client_source)\n\n return app\n\n def _client_source(self, request: Request) -> str:\n explicit_header = request.headers.get(\"X-Client-Source\", \"\").strip()\n if explicit_header:\n return explicit_header\n user_agent = request.headers.get(\"User-Agent\", \"\").strip()\n if user_agent:\n return f\"user-agent:{user_agent}\"\n return \"unknown\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/http_app.py:HttpControlAppFactory", - "span_start": 15, - "span_end": 53, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.http_app", - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ] - }, - "diagnostics": { - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C0_SOURCE_CHUNKS": "exact_path_fetch", - "C4_SEMANTIC_ROLES": "exact_path_fetch", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C3_ENTRYPOINTS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 8, - "C4_SEMANTIC_ROLES": 8, - "C2_DEPENDENCY_GRAPH": 10, - "C3_ENTRYPOINTS": 10 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C4_SEMANTIC_ROLES": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "health HttpControlAppFactory", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Покажи как проходит запрос /health в HttpControlAppFactory", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C4_SEMANTIC_ROLES", - "query": "Покажи как проходит запрос /health в HttpControlAppFactory", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "Покажи как проходит запрос /health в HttpControlAppFactory", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 10, - "ranking_profile": "code" - }, - { - "layer": "C3_ENTRYPOINTS", - "query": "Покажи как проходит запрос /health в HttpControlAppFactory", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 10, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 4, - "candidates_after_filter": 4 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 10, - "candidates_after_filter": 10 - }, - { - "layer": "C3_ENTRYPOINTS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 3, - "candidates_after_filter": 3 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "HttpControlAppFactory", - "alternatives": [ - "HttpControlAppFactory", - "ControlActionSet", - "HealthContributor.health", - "HealthContributor" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "hit", - "hit_count": 4, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C4_SEMANTIC_ROLES", - "status": "hit", - "hit_count": 8, - "fail_reason": null - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 10, - "fail_reason": null - }, - { - "layer": "C3_ENTRYPOINTS", - "status": "hit", - "hit_count": 3, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "symbol_resolution": 0, - "retrieval_total": 156, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 50, - "C0_SOURCE_CHUNKS": 22, - "C4_SEMANTIC_ROLES": 17, - "C2_DEPENDENCY_GRAPH": 55, - "C3_ENTRYPOINTS": 10 - }, - "merge_rank": 40 - } - } - }, - { - "step": "llm_answer", - "input": { - "query": "Покажи как проходит запрос /health в HttpControlAppFactory", - "rag_count": 26 - }, - "output": { - "llm_answer": "1. Точка старта — вызовы `/health` и `/actions/{action}` через `HttpControlAppFactory.create`.\n2. \n\n- 2.1. HttpControlAppFactory.create → создание экземпляра FastAPI (`app = FastAPI(...)`)\n- 2.2. Внутри FastAPI создаётся middleware для логирования времени отклика запроса (`@app.middleware(\"http\")`)\n- 2.3. Добавляются маршруты: \n - GET `/health`: вызывает функцию `health_provider`, возвращает статус через JSONResponse. \n - GET/POST `/actions/{action}`: проверяет доступное действие, регистрирует клиентский источник и выполняет действия типа «запуск» или «остановка».\n \n3. Связь между шагами подтверждается непосредственно объявлением функций внутри класса `HttpControlAppFactory` (источник: [C0_SOURCE_CHUNKS]).\n4. Неполные данные отсутствуют. Весь описанный путь следования потока вызова документирован на основе доступных источников." - }, - "diagnostics": { - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 794, - "evidence_rows": 26, - "evidence_chars": 3507 - }, - "evidence_summary": [ - { - "layer": "C1_SYMBOL_CATALOG", - "count": 4, - "unique_paths": 3 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "count": 8, - "unique_paths": 7 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "count": 10, - "unique_paths": 3 - }, - { - "layer": "C3_ENTRYPOINTS", - "count": 3, - "unique_paths": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 1, - "unique_paths": 1 - } - ], - "prompt_template_id": "intent_code_qa_trace_flow_ru_v2", - "system_prompt_version": "v1" - }, - "timings_ms": { - "prompt_build": 0, - "llm_call": 1739 - } - } - } - ] - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_132357/full_chain_plba_code_subintents_v2_plba-v2-trace-flow-health-endpoint.md b/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_132357/full_chain_plba_code_subintents_v2_plba-v2-trace-flow-health-endpoint.md deleted file mode 100644 index dfef433..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_132357/full_chain_plba_code_subintents_v2_plba-v2-trace-flow-health-endpoint.md +++ /dev/null @@ -1,35 +0,0 @@ -# plba-v2-trace-flow-health-endpoint - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_subintents_v2.yaml -- runner: runtime -- mode: full_chain -- passed: True - -## Query -Покажи как проходит запрос /health в HttpControlAppFactory - -## Actual -{ - "intent": "CODE_QA", - "sub_intent": "TRACE_FLOW", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 26, - "llm_answer": "1. Точка старта — вызовы `/health` и `/actions/{action}` через `HttpControlAppFactory.create`.\n2. \n\n- 2.1. HttpControlAppFactory.create → создание экземпляра FastAPI (`app = FastAPI(...)`)\n- 2.2. Внутри FastAPI создаётся middleware для логирования времени отклика запроса (`@app.middleware(\"http\")`)\n- 2.3. Добавляются маршруты: \n - GET `/health`: вызывает функцию `health_provider`, возвращает статус через JSONResponse. \n - GET/POST `/actions/{action}`: проверяет доступное действие, регистрирует клиентский источник и выполняет действия типа «запуск» или «остановка».\n \n3. Связь между шагами подтверждается непосредственно объявлением функций внутри класса `HttpControlAppFactory` (источник: [C0_SOURCE_CHUNKS]).\n4. Неполные данные отсутствуют. Весь описанный путь следования потока вызова документирован на основе доступных источников.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "health", - "HttpControlAppFactory" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] -} - -## Mismatches -- none \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_132357/full_chain_plba_code_subintents_v2_plba-v2-trace-flow-runtime-start.json b/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_132357/full_chain_plba_code_subintents_v2_plba-v2-trace-flow-runtime-start.json deleted file mode 100644 index 17dbbd7..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_132357/full_chain_plba_code_subintents_v2_plba-v2-trace-flow-runtime-start.json +++ /dev/null @@ -1,2964 +0,0 @@ -{ - "case_id": "plba-v2-trace-flow-runtime-start", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_subintents_v2.yaml", - "runner": "runtime", - "mode": "full_chain", - "actual": { - "intent": "CODE_QA", - "sub_intent": "TRACE_FLOW", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 23, - "llm_answer": "1. Точка старта: запуск приложения, точка app.post в http_app.py.\n2. \n\n- 2.1 [C3_ENTRYPOINTS] src/app_runtime/control/http_app.py | app.post → fastapi http app.post\n- 2.2 [C2_DEPENDENCY_GRAPH] src/app_runtime/core/runtime.py | RuntimeManager.__init__:dataflow_slice → RuntimeManager.__init__\n - 2.2.1 RuntimeManager.__init__ создает экземпляр класса RuntimeManager и инициализирует его атрибуты.\n3. Связь между шагами подтверждена напрямую через зависимости графов [C2_DEPENDENCY_GRAPH].\n4. Разрыв или участок с неполными данными: отсутствует прямое подтверждение вызова RuntimeManager из http_app.py → app.post. Предполагается косвенная инициализация через настройку FastAPI приложения, но прямых доказательств этого нет в предоставленных слоях. \n\nИтог: Прямое восстановление потока выполнения от точки app.post до RuntimeManager завершено. Дальнейший путь к непосредственному вызову RuntimeManager неясен без дополнительных данных.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "RuntimeManager" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "passed": true, - "mismatches": [], - "details": { - "case_id": "plba-v2-trace-flow-runtime-start", - "text": "Покажи поток выполнения при запуске RuntimeManager", - "mode": "full_chain", - "run_started_at": "2026-03-12T13:23:57", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Покажи поток выполнения при запуске RuntimeManager", - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "RuntimeManager", - "alternatives": [ - "RuntimeManager" - ], - "confidence": 0.99 - }, - "rag_count": 23, - "rag_rows": [ - { - "path": "src/app_runtime/core/runtime.py", - "content": "class RuntimeManager\nRuntimeManager", - "layer": "C1_SYMBOL_CATALOG", - "title": "RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "7e4a9381328c5803bbc6179458612fc4e947d928aa7bf8b4b2bebb2c8592f758", - "qname": "RuntimeManager", - "kind": "class", - "signature": "RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.core.runtime", - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests manager\n- orchestrates role-like calls (4)\n- reads and writes state attributes\n- participates in dataflow slices (50)", - "layer": "C4_SEMANTIC_ROLES", - "title": "RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 43, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "7e4a9381328c5803bbc6179458612fc4e947d928aa7bf8b4b2bebb2c8592f758", - "symbol_name": "RuntimeManager", - "qname": "RuntimeManager", - "role": "pipeline_stage", - "confidence": 0.67, - "dataflow_participation": 50, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "ControlChannel\nrole: model\n\nResponsibilities:\n- default model role", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlChannel", - "span_start": 21, - "span_end": 28, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 40, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "cfcfe9a311d3a2dbdaf32ac4ccd73c0eb9a117f830591a1c0867ee97d46204ff", - "symbol_name": "ControlChannel", - "qname": "ControlChannel", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "ControlActionSet\nrole: model\n\nResponsibilities:\n- default model role", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlActionSet", - "span_start": 14, - "span_end": 18, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 40, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "46eb026cb3313415ec47b82dd22f84f4d112c9d987e8b1716dcb0baa1cce8988", - "symbol_name": "ControlActionSet", - "qname": "ControlActionSet", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests service\n- reads and writes state attributes\n- participates in dataflow slices (5)", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlPlaneService", - "span_start": 12, - "span_end": 52, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 68, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "b13471e5916986dccffb53fab613812842965705e6b3a89ae549d30c9e91e9aa", - "symbol_name": "ControlPlaneService", - "qname": "ControlPlaneService", - "role": "pipeline_stage", - "confidence": 0.57, - "dataflow_participation": 5, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_runner.py", - "content": "UvicornThreadRunner\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (24)", - "layer": "C4_SEMANTIC_ROLES", - "title": "UvicornThreadRunner", - "span_start": 10, - "span_end": 61, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 11, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "fd55630045a02100df8877ac27d951ee08617d4598764394d48cb51fe067476a", - "symbol_name": "UvicornThreadRunner", - "qname": "UvicornThreadRunner", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 24, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "3779fdd2878b770e789a35bb2a89c9d79f13b61c26d7db1b3b683f9bb9e1623f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (10)", - "layer": "C4_SEMANTIC_ROLES", - "title": "HttpControlChannel", - "span_start": 12, - "span_end": 57, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 21, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "1c9fbdc24819e5604c26ea55428a74310f03a03e1af197ed84846af61e42fdb0", - "symbol_name": "HttpControlChannel", - "qname": "HttpControlChannel", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 10, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "HttpControlAppFactory\nrole: factory\n\nResponsibilities:\n- name suffix suggests factory", - "layer": "C4_SEMANTIC_ROLES", - "title": "HttpControlAppFactory", - "span_start": 15, - "span_end": 53, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 39, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "9b3502a5fb408b273223db13264349cf500de24915b6c649d9ea8970d0dfd8e0", - "symbol_name": "HttpControlAppFactory", - "qname": "HttpControlAppFactory", - "role": "factory", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/persistence/workflow_persistence.py", - "content": "WorkflowPersistence\nrole: pipeline_stage\n\nResponsibilities:\n- orchestrates role-like calls (2)\n- reads and writes state attributes\n- participates in dataflow slices (16)", - "layer": "C4_SEMANTIC_ROLES", - "title": "WorkflowPersistence", - "span_start": 8, - "span_end": 54, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 15, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "7bd01ee45cf31f2d5c2e3e51656254860ac785d10cef9e0852cd4fba90857bae", - "symbol_name": "WorkflowPersistence", - "qname": "WorkflowPersistence", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 16, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "80e9410ddc639789b4353c2a1a757ba8d0d5b5bb6075b0b263b61551f04ae1f0", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager.add_config_file", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 32, - "span_end": 52, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "a23b8a11ebdb12708b60c96ea12a69f7f042082f1adfddd572444e246d81d167", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "57ffbd4f0d9fdf3507c2b8624312ce211f3d02fdf86a57a8ec90778d8a7b498d", - "dst_ref": "RuntimeManager.add_config_file", - "resolution": "resolved", - "slice_id": "a23b8a11ebdb12708b60c96ea12a69f7f042082f1adfddd572444e246d81d167", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager.add_config_file" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "57ffbd4f0d9fdf3507c2b8624312ce211f3d02fdf86a57a8ec90778d8a7b498d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.services\n -> RuntimeManager.__init__", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 33, - "span_end": 39, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "d43af85989222ee6d788ce418cdcb217c7ff044cfb915e3bdbd184417dc7bd61", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "dst_ref": "RuntimeManager.__init__", - "resolution": "resolved", - "slice_id": "d43af85989222ee6d788ce418cdcb217c7ff044cfb915e3bdbd184417dc7bd61", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.services", - "RuntimeManager.__init__" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.stop", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 25, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d", - "dst_ref": "ControlPlaneService.stop", - "resolution": "resolved", - "slice_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.stop" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._stop_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 51, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a", - "dst_ref": "ControlPlaneService._stop_async", - "resolution": "resolved", - "slice_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._stop_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager.start", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 32, - "span_end": 59, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "98312ace7fc62b1c7194c5aa1732b6ef736eae1668a3a120dd1ecd5ab1d64f7a", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "77a7b260193018845e4e204df094ab89cfd7c82ee4e822b3a83ad4cd945f9cb1", - "dst_ref": "RuntimeManager.start", - "resolution": "resolved", - "slice_id": "98312ace7fc62b1c7194c5aa1732b6ef736eae1668a3a120dd1ecd5ab1d64f7a", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager.start" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "77a7b260193018845e4e204df094ab89cfd7c82ee4e822b3a83ad4cd945f9cb1" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager._register_core_services", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 32, - "span_end": 127, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "3e5811f3b511fa0cabe363f5d01f2ac5fa039bc8b93f7ee108323e1f5f45a293", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "972d6057a6caac9cf31ebc1e29c6f39f71b10d4cc170dec57cf875ba458549c6", - "dst_ref": "RuntimeManager._register_core_services", - "resolution": "resolved", - "slice_id": "3e5811f3b511fa0cabe363f5d01f2ac5fa039bc8b93f7ee108323e1f5f45a293", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager._register_core_services" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "972d6057a6caac9cf31ebc1e29c6f39f71b10d4cc170dec57cf875ba458549c6" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.register_channel", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 17, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957", - "dst_ref": "ControlPlaneService.register_channel", - "resolution": "resolved", - "slice_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.register_channel" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.start", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 20, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154", - "dst_ref": "ControlPlaneService.start", - "resolution": "resolved", - "slice_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.start" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._start_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 47, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517", - "dst_ref": "ControlPlaneService._start_async", - "resolution": "resolved", - "slice_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._start_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.services\n -> RuntimeManager._register_core_services", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 33, - "span_end": 127, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "aac6f9dda73963b977083a892bee39a48eca4fbd7404787e022ecf4ebedec65d", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "972d6057a6caac9cf31ebc1e29c6f39f71b10d4cc170dec57cf875ba458549c6", - "dst_ref": "RuntimeManager._register_core_services", - "resolution": "resolved", - "slice_id": "aac6f9dda73963b977083a892bee39a48eca4fbd7404787e022ecf4ebedec65d", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.services", - "RuntimeManager._register_core_services" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "972d6057a6caac9cf31ebc1e29c6f39f71b10d4cc170dec57cf875ba458549c6" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "class RuntimeManager:\n ACTION_TIMEOUT_SECONDS = 10.0\n ACTION_POLL_INTERVAL_SECONDS = 0.05\n\n def __init__(\n self,\n configuration: ConfigurationManager | None = None,\n services: ServiceContainer | None = None,\n traces: TraceService | None = None,\n health: HealthRegistry | None = None,\n logs: LogManager | None = None,\n workers: WorkerSupervisor | None = None,\n control_plane: ControlPlaneService | None = None,\n ) -> None:\n self.configuration = configuration or ConfigurationManager()\n self.services = services or ServiceContainer()\n self.traces = traces or TraceService()\n self.health = health or HealthRegistry()\n self.logs = logs or LogManager()\n self.workers = workers or WorkerSupervisor()\n self.control_plane = control_plane or ControlPlaneService()\n self.registry = ModuleRegistry(self.services)\n self._started = False\n self._state = LifecycleState.IDLE\n self._core_registered = False\n self._workers_registered = False\n self._register_core_services()\n\n def register_module(self, module: ApplicationModule) -> None:\n self.registry.register_module(module.name)\n module.register(self.registry)\n\n def add_config_file(self, path: str) -> FileConfigProvider:\n provider = FileConfigProvider(path)\n self.configuration.add_provider(provider)\n return provider\n\n def start(self, *, start_control_plane: bool = True) -> None:\n if self._started:\n return\n self._state = LifecycleState.STARTING\n config = self.configuration.load()\n self.logs.apply_config(config)\n self._register_health_contributors()\n self._register_workers()\n self.workers.start()\n if start_control_plane:\n self.control_plane.start(self)\n self._started = True\n self._refresh_state()\n\n def stop(self, timeout: float = 30.0, force: bool = False, stop_control_plane: bool = True) -> None:\n if not self._started:\n return\n self._state = LifecycleState.STOPPING\n self.workers.stop(timeout=timeout, force=force)\n if stop_control_plane:\n self.control_plane.stop()\n self._started = False\n self._state = LifecycleState.STOPPED\n\n def status(self) -> dict[str, object]:\n self._refresh_state()\n return self.control_plane.snapshot(self)\n\n def current_health(self) -> HealthPayload:\n self._refresh_state()\n return self.health.payload(self._state, self.workers.healths())\n\n async def health_status(self) -> HealthPayload:\n return self.current_health()\n\n async def start_runtime(self) -> dict[str, object] | str:\n self._refresh_state()\n if self._started:\n return \"runtime already running\"\n if self._state == LifecycleState.STOPPING:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n\n self.start(start_control_plane=False)\n started = self._wait_for_state({LifecycleState.IDLE, LifecycleState.BUSY}, timeout=self.ACTION_TIMEOUT_SECONDS)\n if started:\n return self._action_detail(\"runtime started\", timed_out=False)\n return self._action_detail(\"runtime start is still in progress\", timed_out=True)\n\n async def stop_runtime(self) -> dict[str, object] | str:\n self._refresh_state()\n if not self._started:\n if self._state == LifecycleState.STOPPING:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n return \"runtime already stopped\"\n\n self._state = LifecycleState.STOPPING\n try:\n self.workers.stop(timeout=self.ACTION_TIMEOUT_SECONDS, force=False)\n except TimeoutError:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n\n self._started = False\n self._state = LifecycleState.STOPPED\n return self._action_detail(\"runtime stopped\", timed_out=False)\n\n async def runtime_status(self) -> str:\n self._refresh_state()\n return self._state.value\n\n def _register_core_services(self) -> None:\n if self._core_registered:\n return\n self.services.register(\"configuration\", self.configuration)\n self.services.register(\"traces\", self.traces)\n self.services.register(\"health\", self.health)\n self.services.register(\"logs\", self.logs)\n self.services.register(\"workers\", self.workers)\n self.services.register(\"control_plane\", self.control_plane)\n self._core_registered = True\n\n def _register_health_contributors(self) -> None:\n for contributor in self.registry.health_contributors:\n self.health.register(contributor)\n\n def _register_workers(self) -> None:\n if self._workers_registered:\n return\n for worker in self.registry.workers:\n self.workers.register(worker)\n self._workers_registered = True\n\n def _refresh_state(self) -> None:\n lifecycle = self.workers.lifecycle_state()\n\n if self._state == LifecycleState.STOPPING:\n if lifecycle == LifecycleState.STOPPED:\n self._started = False\n self._state = LifecycleState.STOPPED\n return\n\n if not self._started:\n if lifecycle == LifecycleState.STOPPED:\n self._state = LifecycleState.STOPPED\n return\n\n self._state = lifecycle\n\n def _wait_for_state(self, target_states: set[LifecycleState], *, timeout: float) -> bool:\n deadline = monotonic() + timeout\n while monotonic() < deadline:\n self._refresh_state()\n if self._state in target_states:\n return True\n sleep(self.ACTION_POLL_INTERVAL_SECONDS)\n self._refresh_state()\n return self._state in target_states\n\n def _action_detail(self, message: str, *, timed_out: bool) -> dict[str, object]:\n self._refresh_state()\n return {\n \"message\": message,\n \"state\": self._state.value,\n \"timed_out\": timed_out,\n \"workers\": self.workers.snapshot(),\n }", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/core/runtime.py:RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.core.runtime", - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "llm_answer": "1. Точка старта: запуск приложения, точка app.post в http_app.py.\n2. \n\n- 2.1 [C3_ENTRYPOINTS] src/app_runtime/control/http_app.py | app.post → fastapi http app.post\n- 2.2 [C2_DEPENDENCY_GRAPH] src/app_runtime/core/runtime.py | RuntimeManager.__init__:dataflow_slice → RuntimeManager.__init__\n - 2.2.1 RuntimeManager.__init__ создает экземпляр класса RuntimeManager и инициализирует его атрибуты.\n3. Связь между шагами подтверждена напрямую через зависимости графов [C2_DEPENDENCY_GRAPH].\n4. Разрыв или участок с неполными данными: отсутствует прямое подтверждение вызова RuntimeManager из http_app.py → app.post. Предполагается косвенная инициализация через настройку FastAPI приложения, но прямых доказательств этого нет в предоставленных слоях. \n\nИтог: Прямое восстановление потока выполнения от точки app.post до RuntimeManager завершено. Дальнейший путь к непосредственному вызову RuntimeManager неясен без дополнительных данных.", - "summary": { - "router": { - "intent": "CODE_QA", - "sub_intent": "TRACE_FLOW", - "confidence": null - }, - "retrieval": { - "profile": "code", - "layers_hit": [ - "C0_SOURCE_CHUNKS", - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS", - "C4_SEMANTIC_ROLES" - ], - "evidence_sufficient": true - }, - "llm": { - "answer_status": "answered", - "groundedness": "grounded" - } - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "TRACE_FLOW", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "RuntimeManager" - ], - "keyword_hints": [ - "RuntimeManager" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C0_SOURCE_CHUNKS": "exact_path_fetch", - "C4_SEMANTIC_ROLES": "exact_path_fetch", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C3_ENTRYPOINTS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 8, - "C4_SEMANTIC_ROLES": 8, - "C2_DEPENDENCY_GRAPH": 10, - "C3_ENTRYPOINTS": 10 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C4_SEMANTIC_ROLES": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Покажи поток выполнения при запуске RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C4_SEMANTIC_ROLES", - "query": "Покажи поток выполнения при запуске RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "Покажи поток выполнения при запуске RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 10, - "ranking_profile": "code" - }, - { - "layer": "C3_ENTRYPOINTS", - "query": "Покажи поток выполнения при запуске RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 10, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 1, - "candidates_after_filter": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 10, - "candidates_after_filter": 10 - }, - { - "layer": "C3_ENTRYPOINTS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 3, - "candidates_after_filter": 3 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "RuntimeManager", - "alternatives": [ - "RuntimeManager" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C4_SEMANTIC_ROLES", - "status": "hit", - "hit_count": 8, - "fail_reason": null - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 10, - "fail_reason": null - }, - { - "layer": "C3_ENTRYPOINTS", - "status": "hit", - "hit_count": 3, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "router": 0, - "symbol_resolution": 0, - "retrieval_total": 129, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 39, - "C0_SOURCE_CHUNKS": 14, - "C4_SEMANTIC_ROLES": 13, - "C2_DEPENDENCY_GRAPH": 53, - "C3_ENTRYPOINTS": 9 - }, - "merge_rank": 16, - "prompt_build": 0, - "llm_call": 1751 - }, - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 817, - "evidence_rows": 23, - "evidence_chars": 8302 - }, - "evidence_summary": [ - { - "layer": "C1_SYMBOL_CATALOG", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "count": 8, - "unique_paths": 7 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "count": 10, - "unique_paths": 2 - }, - { - "layer": "C3_ENTRYPOINTS", - "count": 3, - "unique_paths": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 1, - "unique_paths": 1 - } - ], - "prompt_template_id": "intent_code_qa_trace_flow_ru_v2", - "system_prompt_version": "v1" - }, - "router": { - "conversation_mode": "START", - "keyword_hints": [ - "RuntimeManager" - ], - "path_scope": [] - }, - "llm": { - "used_evidence_count": 23, - "missing_evidence_reason": null - } - }, - "run_info": { - "case_id": "plba-v2-trace-flow-runtime-start", - "mode": "full_chain", - "run_started_at": "2026-03-12T13:23:57", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - }, - "input_request": { - "text": "Покажи поток выполнения при запуске RuntimeManager", - "normalized_query": "Покажи поток выполнения при запуске RuntimeManager" - }, - "steps": [ - { - "step": "intent_router", - "input": { - "query": "Покажи поток выполнения при запуске RuntimeManager" - }, - "output": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Покажи поток выполнения при запуске RuntimeManager" - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "TRACE_FLOW", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "RuntimeManager" - ], - "keyword_hints": [ - "RuntimeManager" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "timings_ms": { - "router": 0 - } - } - }, - { - "step": "retrieval", - "input": { - "query": "Покажи поток выполнения при запуске RuntimeManager" - }, - "output": { - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "RuntimeManager", - "alternatives": [ - "RuntimeManager" - ], - "confidence": 0.99 - }, - "rag_count": 23, - "rag_rows": [ - { - "path": "src/app_runtime/core/runtime.py", - "content": "class RuntimeManager\nRuntimeManager", - "layer": "C1_SYMBOL_CATALOG", - "title": "RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "7e4a9381328c5803bbc6179458612fc4e947d928aa7bf8b4b2bebb2c8592f758", - "qname": "RuntimeManager", - "kind": "class", - "signature": "RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.core.runtime", - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests manager\n- orchestrates role-like calls (4)\n- reads and writes state attributes\n- participates in dataflow slices (50)", - "layer": "C4_SEMANTIC_ROLES", - "title": "RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 43, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "7e4a9381328c5803bbc6179458612fc4e947d928aa7bf8b4b2bebb2c8592f758", - "symbol_name": "RuntimeManager", - "qname": "RuntimeManager", - "role": "pipeline_stage", - "confidence": 0.67, - "dataflow_participation": 50, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "ControlChannel\nrole: model\n\nResponsibilities:\n- default model role", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlChannel", - "span_start": 21, - "span_end": 28, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 40, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "cfcfe9a311d3a2dbdaf32ac4ccd73c0eb9a117f830591a1c0867ee97d46204ff", - "symbol_name": "ControlChannel", - "qname": "ControlChannel", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "ControlActionSet\nrole: model\n\nResponsibilities:\n- default model role", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlActionSet", - "span_start": 14, - "span_end": 18, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 40, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "46eb026cb3313415ec47b82dd22f84f4d112c9d987e8b1716dcb0baa1cce8988", - "symbol_name": "ControlActionSet", - "qname": "ControlActionSet", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests service\n- reads and writes state attributes\n- participates in dataflow slices (5)", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlPlaneService", - "span_start": 12, - "span_end": 52, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 68, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "b13471e5916986dccffb53fab613812842965705e6b3a89ae549d30c9e91e9aa", - "symbol_name": "ControlPlaneService", - "qname": "ControlPlaneService", - "role": "pipeline_stage", - "confidence": 0.57, - "dataflow_participation": 5, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_runner.py", - "content": "UvicornThreadRunner\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (24)", - "layer": "C4_SEMANTIC_ROLES", - "title": "UvicornThreadRunner", - "span_start": 10, - "span_end": 61, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 11, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "fd55630045a02100df8877ac27d951ee08617d4598764394d48cb51fe067476a", - "symbol_name": "UvicornThreadRunner", - "qname": "UvicornThreadRunner", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 24, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "3779fdd2878b770e789a35bb2a89c9d79f13b61c26d7db1b3b683f9bb9e1623f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (10)", - "layer": "C4_SEMANTIC_ROLES", - "title": "HttpControlChannel", - "span_start": 12, - "span_end": 57, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 21, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "1c9fbdc24819e5604c26ea55428a74310f03a03e1af197ed84846af61e42fdb0", - "symbol_name": "HttpControlChannel", - "qname": "HttpControlChannel", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 10, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "HttpControlAppFactory\nrole: factory\n\nResponsibilities:\n- name suffix suggests factory", - "layer": "C4_SEMANTIC_ROLES", - "title": "HttpControlAppFactory", - "span_start": 15, - "span_end": 53, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 39, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "9b3502a5fb408b273223db13264349cf500de24915b6c649d9ea8970d0dfd8e0", - "symbol_name": "HttpControlAppFactory", - "qname": "HttpControlAppFactory", - "role": "factory", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/persistence/workflow_persistence.py", - "content": "WorkflowPersistence\nrole: pipeline_stage\n\nResponsibilities:\n- orchestrates role-like calls (2)\n- reads and writes state attributes\n- participates in dataflow slices (16)", - "layer": "C4_SEMANTIC_ROLES", - "title": "WorkflowPersistence", - "span_start": 8, - "span_end": 54, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 15, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "7bd01ee45cf31f2d5c2e3e51656254860ac785d10cef9e0852cd4fba90857bae", - "symbol_name": "WorkflowPersistence", - "qname": "WorkflowPersistence", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 16, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "80e9410ddc639789b4353c2a1a757ba8d0d5b5bb6075b0b263b61551f04ae1f0", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager.add_config_file", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 32, - "span_end": 52, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "a23b8a11ebdb12708b60c96ea12a69f7f042082f1adfddd572444e246d81d167", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "57ffbd4f0d9fdf3507c2b8624312ce211f3d02fdf86a57a8ec90778d8a7b498d", - "dst_ref": "RuntimeManager.add_config_file", - "resolution": "resolved", - "slice_id": "a23b8a11ebdb12708b60c96ea12a69f7f042082f1adfddd572444e246d81d167", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager.add_config_file" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "57ffbd4f0d9fdf3507c2b8624312ce211f3d02fdf86a57a8ec90778d8a7b498d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.services\n -> RuntimeManager.__init__", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 33, - "span_end": 39, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "d43af85989222ee6d788ce418cdcb217c7ff044cfb915e3bdbd184417dc7bd61", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "dst_ref": "RuntimeManager.__init__", - "resolution": "resolved", - "slice_id": "d43af85989222ee6d788ce418cdcb217c7ff044cfb915e3bdbd184417dc7bd61", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.services", - "RuntimeManager.__init__" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.stop", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 25, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d", - "dst_ref": "ControlPlaneService.stop", - "resolution": "resolved", - "slice_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.stop" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._stop_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 51, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a", - "dst_ref": "ControlPlaneService._stop_async", - "resolution": "resolved", - "slice_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._stop_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager.start", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 32, - "span_end": 59, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "98312ace7fc62b1c7194c5aa1732b6ef736eae1668a3a120dd1ecd5ab1d64f7a", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "77a7b260193018845e4e204df094ab89cfd7c82ee4e822b3a83ad4cd945f9cb1", - "dst_ref": "RuntimeManager.start", - "resolution": "resolved", - "slice_id": "98312ace7fc62b1c7194c5aa1732b6ef736eae1668a3a120dd1ecd5ab1d64f7a", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager.start" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "77a7b260193018845e4e204df094ab89cfd7c82ee4e822b3a83ad4cd945f9cb1" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager._register_core_services", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 32, - "span_end": 127, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "3e5811f3b511fa0cabe363f5d01f2ac5fa039bc8b93f7ee108323e1f5f45a293", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "972d6057a6caac9cf31ebc1e29c6f39f71b10d4cc170dec57cf875ba458549c6", - "dst_ref": "RuntimeManager._register_core_services", - "resolution": "resolved", - "slice_id": "3e5811f3b511fa0cabe363f5d01f2ac5fa039bc8b93f7ee108323e1f5f45a293", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager._register_core_services" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "972d6057a6caac9cf31ebc1e29c6f39f71b10d4cc170dec57cf875ba458549c6" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.register_channel", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 17, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957", - "dst_ref": "ControlPlaneService.register_channel", - "resolution": "resolved", - "slice_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.register_channel" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.start", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 20, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154", - "dst_ref": "ControlPlaneService.start", - "resolution": "resolved", - "slice_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.start" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._start_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 47, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517", - "dst_ref": "ControlPlaneService._start_async", - "resolution": "resolved", - "slice_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._start_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.services\n -> RuntimeManager._register_core_services", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 33, - "span_end": 127, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "aac6f9dda73963b977083a892bee39a48eca4fbd7404787e022ecf4ebedec65d", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "972d6057a6caac9cf31ebc1e29c6f39f71b10d4cc170dec57cf875ba458549c6", - "dst_ref": "RuntimeManager._register_core_services", - "resolution": "resolved", - "slice_id": "aac6f9dda73963b977083a892bee39a48eca4fbd7404787e022ecf4ebedec65d", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.services", - "RuntimeManager._register_core_services" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "972d6057a6caac9cf31ebc1e29c6f39f71b10d4cc170dec57cf875ba458549c6" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "class RuntimeManager:\n ACTION_TIMEOUT_SECONDS = 10.0\n ACTION_POLL_INTERVAL_SECONDS = 0.05\n\n def __init__(\n self,\n configuration: ConfigurationManager | None = None,\n services: ServiceContainer | None = None,\n traces: TraceService | None = None,\n health: HealthRegistry | None = None,\n logs: LogManager | None = None,\n workers: WorkerSupervisor | None = None,\n control_plane: ControlPlaneService | None = None,\n ) -> None:\n self.configuration = configuration or ConfigurationManager()\n self.services = services or ServiceContainer()\n self.traces = traces or TraceService()\n self.health = health or HealthRegistry()\n self.logs = logs or LogManager()\n self.workers = workers or WorkerSupervisor()\n self.control_plane = control_plane or ControlPlaneService()\n self.registry = ModuleRegistry(self.services)\n self._started = False\n self._state = LifecycleState.IDLE\n self._core_registered = False\n self._workers_registered = False\n self._register_core_services()\n\n def register_module(self, module: ApplicationModule) -> None:\n self.registry.register_module(module.name)\n module.register(self.registry)\n\n def add_config_file(self, path: str) -> FileConfigProvider:\n provider = FileConfigProvider(path)\n self.configuration.add_provider(provider)\n return provider\n\n def start(self, *, start_control_plane: bool = True) -> None:\n if self._started:\n return\n self._state = LifecycleState.STARTING\n config = self.configuration.load()\n self.logs.apply_config(config)\n self._register_health_contributors()\n self._register_workers()\n self.workers.start()\n if start_control_plane:\n self.control_plane.start(self)\n self._started = True\n self._refresh_state()\n\n def stop(self, timeout: float = 30.0, force: bool = False, stop_control_plane: bool = True) -> None:\n if not self._started:\n return\n self._state = LifecycleState.STOPPING\n self.workers.stop(timeout=timeout, force=force)\n if stop_control_plane:\n self.control_plane.stop()\n self._started = False\n self._state = LifecycleState.STOPPED\n\n def status(self) -> dict[str, object]:\n self._refresh_state()\n return self.control_plane.snapshot(self)\n\n def current_health(self) -> HealthPayload:\n self._refresh_state()\n return self.health.payload(self._state, self.workers.healths())\n\n async def health_status(self) -> HealthPayload:\n return self.current_health()\n\n async def start_runtime(self) -> dict[str, object] | str:\n self._refresh_state()\n if self._started:\n return \"runtime already running\"\n if self._state == LifecycleState.STOPPING:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n\n self.start(start_control_plane=False)\n started = self._wait_for_state({LifecycleState.IDLE, LifecycleState.BUSY}, timeout=self.ACTION_TIMEOUT_SECONDS)\n if started:\n return self._action_detail(\"runtime started\", timed_out=False)\n return self._action_detail(\"runtime start is still in progress\", timed_out=True)\n\n async def stop_runtime(self) -> dict[str, object] | str:\n self._refresh_state()\n if not self._started:\n if self._state == LifecycleState.STOPPING:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n return \"runtime already stopped\"\n\n self._state = LifecycleState.STOPPING\n try:\n self.workers.stop(timeout=self.ACTION_TIMEOUT_SECONDS, force=False)\n except TimeoutError:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n\n self._started = False\n self._state = LifecycleState.STOPPED\n return self._action_detail(\"runtime stopped\", timed_out=False)\n\n async def runtime_status(self) -> str:\n self._refresh_state()\n return self._state.value\n\n def _register_core_services(self) -> None:\n if self._core_registered:\n return\n self.services.register(\"configuration\", self.configuration)\n self.services.register(\"traces\", self.traces)\n self.services.register(\"health\", self.health)\n self.services.register(\"logs\", self.logs)\n self.services.register(\"workers\", self.workers)\n self.services.register(\"control_plane\", self.control_plane)\n self._core_registered = True\n\n def _register_health_contributors(self) -> None:\n for contributor in self.registry.health_contributors:\n self.health.register(contributor)\n\n def _register_workers(self) -> None:\n if self._workers_registered:\n return\n for worker in self.registry.workers:\n self.workers.register(worker)\n self._workers_registered = True\n\n def _refresh_state(self) -> None:\n lifecycle = self.workers.lifecycle_state()\n\n if self._state == LifecycleState.STOPPING:\n if lifecycle == LifecycleState.STOPPED:\n self._started = False\n self._state = LifecycleState.STOPPED\n return\n\n if not self._started:\n if lifecycle == LifecycleState.STOPPED:\n self._state = LifecycleState.STOPPED\n return\n\n self._state = lifecycle\n\n def _wait_for_state(self, target_states: set[LifecycleState], *, timeout: float) -> bool:\n deadline = monotonic() + timeout\n while monotonic() < deadline:\n self._refresh_state()\n if self._state in target_states:\n return True\n sleep(self.ACTION_POLL_INTERVAL_SECONDS)\n self._refresh_state()\n return self._state in target_states\n\n def _action_detail(self, message: str, *, timed_out: bool) -> dict[str, object]:\n self._refresh_state()\n return {\n \"message\": message,\n \"state\": self._state.value,\n \"timed_out\": timed_out,\n \"workers\": self.workers.snapshot(),\n }", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/core/runtime.py:RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.core.runtime", - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ] - }, - "diagnostics": { - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C0_SOURCE_CHUNKS": "exact_path_fetch", - "C4_SEMANTIC_ROLES": "exact_path_fetch", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C3_ENTRYPOINTS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 8, - "C4_SEMANTIC_ROLES": 8, - "C2_DEPENDENCY_GRAPH": 10, - "C3_ENTRYPOINTS": 10 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C4_SEMANTIC_ROLES": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Покажи поток выполнения при запуске RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C4_SEMANTIC_ROLES", - "query": "Покажи поток выполнения при запуске RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "Покажи поток выполнения при запуске RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 10, - "ranking_profile": "code" - }, - { - "layer": "C3_ENTRYPOINTS", - "query": "Покажи поток выполнения при запуске RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 10, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 1, - "candidates_after_filter": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 10, - "candidates_after_filter": 10 - }, - { - "layer": "C3_ENTRYPOINTS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 3, - "candidates_after_filter": 3 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "RuntimeManager", - "alternatives": [ - "RuntimeManager" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C4_SEMANTIC_ROLES", - "status": "hit", - "hit_count": 8, - "fail_reason": null - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 10, - "fail_reason": null - }, - { - "layer": "C3_ENTRYPOINTS", - "status": "hit", - "hit_count": 3, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "symbol_resolution": 0, - "retrieval_total": 129, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 39, - "C0_SOURCE_CHUNKS": 14, - "C4_SEMANTIC_ROLES": 13, - "C2_DEPENDENCY_GRAPH": 53, - "C3_ENTRYPOINTS": 9 - }, - "merge_rank": 16 - } - } - }, - { - "step": "llm_answer", - "input": { - "query": "Покажи поток выполнения при запуске RuntimeManager", - "rag_count": 23 - }, - "output": { - "llm_answer": "1. Точка старта: запуск приложения, точка app.post в http_app.py.\n2. \n\n- 2.1 [C3_ENTRYPOINTS] src/app_runtime/control/http_app.py | app.post → fastapi http app.post\n- 2.2 [C2_DEPENDENCY_GRAPH] src/app_runtime/core/runtime.py | RuntimeManager.__init__:dataflow_slice → RuntimeManager.__init__\n - 2.2.1 RuntimeManager.__init__ создает экземпляр класса RuntimeManager и инициализирует его атрибуты.\n3. Связь между шагами подтверждена напрямую через зависимости графов [C2_DEPENDENCY_GRAPH].\n4. Разрыв или участок с неполными данными: отсутствует прямое подтверждение вызова RuntimeManager из http_app.py → app.post. Предполагается косвенная инициализация через настройку FastAPI приложения, но прямых доказательств этого нет в предоставленных слоях. \n\nИтог: Прямое восстановление потока выполнения от точки app.post до RuntimeManager завершено. Дальнейший путь к непосредственному вызову RuntimeManager неясен без дополнительных данных." - }, - "diagnostics": { - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 817, - "evidence_rows": 23, - "evidence_chars": 8302 - }, - "evidence_summary": [ - { - "layer": "C1_SYMBOL_CATALOG", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "count": 8, - "unique_paths": 7 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "count": 10, - "unique_paths": 2 - }, - { - "layer": "C3_ENTRYPOINTS", - "count": 3, - "unique_paths": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 1, - "unique_paths": 1 - } - ], - "prompt_template_id": "intent_code_qa_trace_flow_ru_v2", - "system_prompt_version": "v1" - }, - "timings_ms": { - "prompt_build": 0, - "llm_call": 1751 - } - } - } - ] - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_132357/full_chain_plba_code_subintents_v2_plba-v2-trace-flow-runtime-start.md b/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_132357/full_chain_plba_code_subintents_v2_plba-v2-trace-flow-runtime-start.md deleted file mode 100644 index b55c07e..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_132357/full_chain_plba_code_subintents_v2_plba-v2-trace-flow-runtime-start.md +++ /dev/null @@ -1,34 +0,0 @@ -# plba-v2-trace-flow-runtime-start - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_subintents_v2.yaml -- runner: runtime -- mode: full_chain -- passed: True - -## Query -Покажи поток выполнения при запуске RuntimeManager - -## Actual -{ - "intent": "CODE_QA", - "sub_intent": "TRACE_FLOW", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 23, - "llm_answer": "1. Точка старта: запуск приложения, точка app.post в http_app.py.\n2. \n\n- 2.1 [C3_ENTRYPOINTS] src/app_runtime/control/http_app.py | app.post → fastapi http app.post\n- 2.2 [C2_DEPENDENCY_GRAPH] src/app_runtime/core/runtime.py | RuntimeManager.__init__:dataflow_slice → RuntimeManager.__init__\n - 2.2.1 RuntimeManager.__init__ создает экземпляр класса RuntimeManager и инициализирует его атрибуты.\n3. Связь между шагами подтверждена напрямую через зависимости графов [C2_DEPENDENCY_GRAPH].\n4. Разрыв или участок с неполными данными: отсутствует прямое подтверждение вызова RuntimeManager из http_app.py → app.post. Предполагается косвенная инициализация через настройку FastAPI приложения, но прямых доказательств этого нет в предоставленных слоях. \n\nИтог: Прямое восстановление потока выполнения от точки app.post до RuntimeManager завершено. Дальнейший путь к непосредственному вызову RuntimeManager неясен без дополнительных данных.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "RuntimeManager" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] -} - -## Mismatches -- none \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_132357/summary.md b/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_132357/summary.md deleted file mode 100644 index 812ca36..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_132357/summary.md +++ /dev/null @@ -1,80 +0,0 @@ -# pipeline_setup_v2 summary - -Passed: 18/18 - -| File | Case | Query | Expected sub-intent | Intent | Actual sub-intent | RAG layers | Pass | -|------|------|-------|---------------------|--------|-------------------|------------|------| -| full_chain_plba_code_subintents_v2.yaml | plba-v2-open-file-runtime | Открой файл src/app_runtime/core/runtime.py | OPEN_FILE | CODE_QA | OPEN_FILE | C0_SOURCE_CHUNKS:1 | ✓ | -| full_chain_plba_code_subintents_v2.yaml | plba-v2-open-file-public-api | Открой файл src/plba/__init__.py | OPEN_FILE | CODE_QA | OPEN_FILE | C0_SOURCE_CHUNKS:1 | ✓ | -| full_chain_plba_code_subintents_v2.yaml | plba-v2-explain-runtime-manager | Объясни как работает класс RuntimeManager | EXPLAIN | CODE_QA | EXPLAIN | C0_SOURCE_CHUNKS:1, C1_SYMBOL_CATALOG:1, C2_DEPENDENCY_GRAPH:6, C3_ENTRYPOINTS:3, C4_SEMANTIC_ROLES:1 | ✓ | -| full_chain_plba_code_subintents_v2.yaml | plba-v2-explain-trace-service | Объясни как работает класс TraceService | EXPLAIN | CODE_QA | EXPLAIN | C0_SOURCE_CHUNKS:3, C1_SYMBOL_CATALOG:1, C2_DEPENDENCY_GRAPH:6, C3_ENTRYPOINTS:3, C4_SEMANTIC_ROLES:1 | ✓ | -| full_chain_plba_code_subintents_v2.yaml | plba-v2-explain-create-runtime | Что делает функция create_runtime? | EXPLAIN | CODE_QA | EXPLAIN | C0_SOURCE_CHUNKS:1, C1_SYMBOL_CATALOG:1, C2_DEPENDENCY_GRAPH:6, C3_ENTRYPOINTS:3, C4_SEMANTIC_ROLES:1 | ✓ | -| full_chain_plba_code_subintents_v2.yaml | plba-v2-explain-local-http-channel | Почему в файле src/app_runtime/control/http_channel.py класс HttpControlChannel устроен так? | EXPLAIN_LOCAL | CODE_QA | EXPLAIN_LOCAL | C0_SOURCE_CHUNKS:1, C1_SYMBOL_CATALOG:1, C2_DEPENDENCY_GRAPH:4 | ✓ | -| full_chain_plba_code_subintents_v2.yaml | plba-v2-find-tests-runtime-manager | Где тесты для RuntimeManager? | FIND_TESTS | CODE_QA | FIND_TESTS | C0_SOURCE_CHUNKS:10, C2_DEPENDENCY_GRAPH:6 | ✓ | -| full_chain_plba_code_subintents_v2.yaml | plba-v2-find-tests-trace-service | Где тесты для TraceService? | FIND_TESTS | CODE_QA | FIND_TESTS | C0_SOURCE_CHUNKS:10, C2_DEPENDENCY_GRAPH:6 | ✓ | -| full_chain_plba_code_subintents_v2.yaml | plba-v2-find-tests-create-runtime | Где тесты для create_runtime? | FIND_TESTS | CODE_QA | FIND_TESTS | C0_SOURCE_CHUNKS:10, C2_DEPENDENCY_GRAPH:6 | ✓ | -| full_chain_plba_code_subintents_v2.yaml | plba-v2-find-tests-workflow-runtime-factory-negative | Где тесты для WorkflowRuntimeFactory? | FIND_TESTS | CODE_QA | FIND_TESTS | C0_SOURCE_CHUNKS:10, C2_DEPENDENCY_GRAPH:6 | ✓ | -| full_chain_plba_code_subintents_v2.yaml | plba-v2-find-entrypoints-control-plane | Найди точки входа HTTP control plane | FIND_ENTRYPOINTS | CODE_QA | FIND_ENTRYPOINTS | C0_SOURCE_CHUNKS:6, C3_ENTRYPOINTS:3 | ✓ | -| full_chain_plba_code_subintents_v2.yaml | plba-v2-find-entrypoints-health-endpoint | Где health endpoint? | FIND_ENTRYPOINTS | CODE_QA | FIND_ENTRYPOINTS | C0_SOURCE_CHUNKS:6, C3_ENTRYPOINTS:3 | ✓ | -| full_chain_plba_code_subintents_v2.yaml | plba-v2-trace-flow-runtime-start | Покажи поток выполнения при запуске RuntimeManager | TRACE_FLOW | CODE_QA | TRACE_FLOW | C0_SOURCE_CHUNKS:1, C1_SYMBOL_CATALOG:1, C2_DEPENDENCY_GRAPH:10, C3_ENTRYPOINTS:3, C4_SEMANTIC_ROLES:8 | ✓ | -| full_chain_plba_code_subintents_v2.yaml | plba-v2-trace-flow-health-endpoint | Покажи как проходит запрос /health в HttpControlAppFactory | TRACE_FLOW | CODE_QA | TRACE_FLOW | C0_SOURCE_CHUNKS:1, C1_SYMBOL_CATALOG:4, C2_DEPENDENCY_GRAPH:10, C3_ENTRYPOINTS:3, C4_SEMANTIC_ROLES:8 | ✓ | -| full_chain_plba_code_subintents_v2.yaml | plba-v2-architecture-runtime-manager | Какие компоненты участвуют в RuntimeManager? | ARCHITECTURE | CODE_QA | ARCHITECTURE | C0_SOURCE_CHUNKS:1, C1_SYMBOL_CATALOG:1, C2_DEPENDENCY_GRAPH:8, C3_ENTRYPOINTS:3, C4_SEMANTIC_ROLES:12 | ✓ | -| full_chain_plba_code_subintents_v2.yaml | plba-v2-architecture-control-plane | Какие компоненты участвуют в ControlPlaneService? | ARCHITECTURE | CODE_QA | ARCHITECTURE | C0_SOURCE_CHUNKS:1, C1_SYMBOL_CATALOG:1, C2_DEPENDENCY_GRAPH:8, C3_ENTRYPOINTS:3, C4_SEMANTIC_ROLES:12 | ✓ | -| full_chain_plba_code_subintents_v2.yaml | plba-v2-explain-nonexistent-symbol | Объясни класс RuntimeFactoryManager | EXPLAIN | CODE_QA | EXPLAIN | — | ✓ | -| full_chain_plba_code_subintents_v2.yaml | plba-v2-open-file-nonexistent | Открой файл src/app_runtime/core/missing_runtime.py | OPEN_FILE | CODE_QA | OPEN_FILE | — | ✓ | - -## LLM Answers -- **plba-v2-open-file-runtime** - Query: Открой файл src/app_runtime/core/runtime.py - > 1. путь к файлу: src/app\_runtime/core/runtime.py 2. В доступном фрагменте показан класс RuntimeManager с его атрибутами и методом \_\_init\_\_. Видно объявление нескольких параметров конструктора класса и инициализация соответствующих полей. 3. Top\-level сущности и секции: класс RuntimeManager, метод \_\_init\_\_ 4. Важные части для вопроса пользователя: \- Класс RuntimeManager является основным управляющим объектом runtime\-системы. \- Метод \_\_init\_\_ устанавливает начальные значения полей объекта и регистрирует базовые сервисы приложения. \- Параметры конструктора определяют компоненты системы, такие как конфигурация, службы, журналы, контроль состояния и другие. -- **plba-v2-open-file-public-api** - Query: Открой файл src/plba/__init__.py - > 1. src/plba/\_\_init\_\_.py 2. Фрагмент файла содержит импорт различных модулей и классов, а также объявление переменной \_\_all\_\_, которая задает список экспортируемых объектов. 3. Top\-level сущности и секции: \- Импорты различных модулей и классов. \- Переменная \_\_all\_\_. 4. В данном файле важны следующие части: \- Список импортируемых классов и функций \(ApplicationModule, ConfigFileLoader, ConfigProvider, и др.\). \- Переменная \_\_all\_\_, определяющая экспортируемые объекты. -- **plba-v2-explain-runtime-manager** - Query: Объясни как работает класс RuntimeManager - > 1. \*\*Что это и где определено\*\*: \- Класс \`RuntimeManager\` определен в файле \`src/app\_runtime/core/runtime.py\`. 2. \*\*Назначение по наблюдаемому коду\*\*: \- Судя по комментариям и контексту, класс предназначен для управления жизненным циклом приложения и координации различных сервисов и модулей. Он выступает в роли менеджера, отвечающего за инициализацию, регистрацию и управление состоянием различных компонентов системы. \- Из описания его ответственности \("manager", "orchestrates role\-like calls"\) можно предположить, что он отвечает за координацию работы других сервисов и управляет их взаимодействием через чтение и запись состояния атрибутов. 3. \*\*Подтверждённые зависимости или взаимодействия\*\*: \- В конструкторе класса явно видны зависимости от следующих классов и объектов: \- \`ConfigurationManager\` \- \`ServiceContainer\` \- \`TraceService\` \- \`HealthRegistry\` \- \`LogManager\` \-… -- **plba-v2-explain-trace-service** - Query: Объясни как работает класс TraceService - > 1. \*\*Что это и где определено.\*\* Сущность \`TraceService\` определена в файле \`src/app\_runtime/tracing/service.py\`. Это класс, наследующий от \`TraceContextFactory\`. 2. \*\*Назначение по наблюдаемому коду.\*\* Класс предназначен для управления контекстами трассировки и записи событий трассировки. Он участвует в обработке данных потока \(slice 13\), имеет роль «pipeline stage» и отвечает за создание и запись контекста трассировки \(\`create\_context\`, \`open\_context\`\), а также взаимодействие с транспортировкой контекста через \`TraceRecordWriter\`. 3. \*\*Подтверждённые зависимости или взаимодействия.\*\* \`TraceService\` зависит от класса \`TraceContextStore\` и объекта транспорта трассировки \(\`TraceTransport\`\). Метод \`create\_context\` использует метод записи контекста \`\_writer.write\_context\` для отправки данных в транспортировку. Транспортировка может быть либо реальной реализацией, либо з… -- **plba-v2-explain-create-runtime** - Query: Что делает функция create_runtime? - > 1. \*\*Что это и где определено.\*\* Сущность \`create\_runtime\` определена в файле \`src/plba/bootstrap.py\`. Это функция, принимающая параметры конфигурации и модуля приложения, и возвращающая объект класса \`RuntimeManager\`. 2. \*\*Назначение по наблюдаемому коду.\*\* Функция создаёт и инициализирует экземпляр объекта \`RuntimeManager\`, добавляя файл конфигурации и модуль приложения в его состояние. Если включено управление через HTTP, она также регистрирует канал управления. 3. \*\*Подтверждённые зависимости или взаимодействия.\*\* Функция зависит от объекта \`RuntimeManager\` и использует метод \`add\_config\_file\` для добавления файла конфигурации и метод \`register\_module\` для регистрации модуля приложения. Если включён режим управления через HTTP, используется метод \`register\_channel\` для регистрации канала управления типа \`HttpControlChannel\`. 4. \*\*Что делает по шагам, если это вид… -- **plba-v2-explain-local-http-channel** - Query: Почему в файле src/app_runtime/control/http_channel.py класс HttpControlChannel устроен так? - > Класс \`HttpControlChannel\` реализует HTTP\-интерфейс для управления другим компонентом приложения через HTTP\-запросы. \#\#\# Что делает класс: 1. \*\*Инициализация \(\`\_\_init\_\_\`\)\*\*: \- Принимает параметры \`host\`, \`port\` и \`timeout\`. \- Создаёт экземпляр \`\_runner\` класса \`UvicornThreadRunner\`, отвечающего за выполнение HTTP\-сервера с использованием uvicorn \(асинхронного веб\-фреймворка\). \- Инициализирует объект фабрики приложений \`\_factory\` типа \`HttpControlAppFactory\`, которая отвечает за создание конкретных HTTP\-приложений. \- Опционально инициализирует коллекцию действий управления \`\_actions\`. 2. \*\*Запуск \(\`start\`\)\*\*: \- Проверяет наличие конфигурации действий управления \(\_actions\). Если конфигурация отсутствует, возвращает ошибку. \- Использует фабрику \`\_factory\` для создания HTTP\-приложения, которое включает обработчики health\-запросов и action\-запросов. \- Запускает сервер с п… -- **plba-v2-find-tests-runtime-manager** - Query: Где тесты для RuntimeManager? - > 1. Прямые тесты: \- tests/test\_runtime.py \| test\_runtime\_runs\_worker\_routine\_and\_exposes\_status \- tests/test\_runtime.py \| test\_runtime\_graceful\_stop\_waits\_until\_worker\_finishes 2. Косвенные или ближайшие тесты: \- tests/test\_business\_control\_actions.py \| \_build\_runtime \- tests/test\_business\_control\_actions.py \| test\_worker\_wakes\_up\_with\_configured\_interval 3. Что именно проверяется: \- test\_runtime\_runs\_worker\_routine\_and\_exposes\_status проверяет запуск рабочего потока, регистрацию модуля и получение статуса выполнения. \- test\_runtime\_graceful\_stop\_waits\_until\_worker\_finishes проверяет корректную остановку рабочего процесса и изменение состояния runtime после остановки. \- tests/test\_business\_control\_actions.py содержит косвенные тесты через инстанцирование RuntimeManager в методах \_build\_runtime и test\_worker\_wakes\_up\_with\_configured\_interval. 4. Пробелы покрытия: \- Пря… -- **plba-v2-find-tests-trace-service** - Query: Где тесты для TraceService? - > 1. Прямые тесты: \- tests/test\_runtime.py \| test\_trace\_service\_writes\_contexts\_and\_messages \- Проверка записи контекстов и сообщений в TraceService. \- tests/test\_runtime.py \| test\_trace\_service\_supports\_debug\_warning\_and\_error\_levels \- Проверка поддержки различных уровней логирования \(DEBUG, WARNING, ERROR\). 2. Косвенные или ближайшие тесты: \- Нет известных косвенных тестов, которые напрямую касаются TraceService. 3. Что именно проверяется: \- Запись и обработка контекста и сообщений в TraceService. \- Поддержка различных уровней логирования и запись соответствующих сообщений. 4. Пробелы покрытия: \- Прямого тестирования работы самого класса TraceService без привязки к транспорту нет. \- Тестирование сценариев ошибок и исключений при работе с TraceService отсутствует. \- Отсутствие проверки взаимодействий с внешними сервисами через транспорт. -- **plba-v2-find-tests-create-runtime** - Query: Где тесты для create_runtime? - > 1. Прямые тесты: \- tests/test\_runtime.py \| test\_public\_plba\_package\_exports\_runtime\_builder\_and\_worker\_contract \- Проверка: импорты и вызов функции create\_runtime. \- Видны пробелы покрытия: отсутствуют проверки непосредственно созданного runtime. 2. Косвенные или ближайшие тесты: \- tests/test\_business\_control\_actions.py \| \_build\_runtime \- Проверка: функция \_build\_runtime использует create\_runtime в своем потоке зависимостей. 3. Что именно проверяется: \- В direct test проверяется доступность и работоспособность функции create\_runtime через её импорт и вызов. \- В indirect test проверяется использование create\_runtime внутри другой функции. 4. Пробелы покрытия: \- Прямое тестирование runtime\-сущности отсутствует. \- Нет тестирования поведения или свойств созданного runtime. -- **plba-v2-find-tests-workflow-runtime-factory-negative** - Query: Где тесты для WorkflowRuntimeFactory? - > Прямых тестов для WorkflowRuntimeFactory в предоставленном контексте не обнаружено. Косвенные или ближайшие тесты: 1. tests/test\_business\_control\_actions.py \| test\_actions\_stop\_busy\_worker\_before\_timeout:dataflow\_slice \- Проверяет поведение после остановки занятого рабочего перед таймаутом. 2. tests/test\_business\_control\_actions.py \| test\_actions\_stop\_busy\_worker\_after\_timeout:dataflow\_slice \- Проверяет поведение после остановки занятого рабочего после таймаута. Что именно проверяется: \- Поведение рабочих процессов при остановке и проверке их состояния здоровья \("health"\). \- Запуск и остановка рабочих процессов. Какие пробелы покрытия видны: \- Нет подтвержденных тестов конкретно для WorkflowRuntimeFactory. Тесты находятся ближе к поведению рабочих процессов и блокирующих рутин, а не напрямую связаны с созданием или использованием WorkflowRuntimeFactory. -- **plba-v2-find-entrypoints-control-plane** - Query: Найди точки входа HTTP control plane - > Подтверждённые точки входа: src/app\_runtime/control/http\_app.py \| fastapi http app.get \- Объявлена декоратором @app.get, что указывает на точку входа для HTTP\-запросов. src/app\_runtime/control/http\_app.py \| fastapi http app.post \- Объявлена декоратором @app.post, что указывает на точку входа для HTTP\-запросов. Возможные кандидаты: src/app\_runtime/control/http\_channel.py \| HttpControlChannel.start \- Содержит асинхронную операцию start, которая может запускать приложение, но явных признаков точки входа нет. src/app\_runtime/control/http\_channel.py \| HttpControlChannel.\_health\_response \- Реализует логику обработки health\-запроса, но сама по себе не является точкой входа. src/app\_runtime/control/http\_channel.py \| HttpControlChannel.\_action\_response \- Реализует обработку запросов к действиям, но без явного декоратора или указания на точку входа. -- **plba-v2-find-entrypoints-health-endpoint** - Query: Где health endpoint? - > \#\#\# Подтверждённые точки входа src/app\_runtime/control/http\_app.py \| app.post FastAPI HTTP app.post Описание: FastAPI маршрутизатор автоматически регистрирует маршруты при старте приложения, что делает эту точку старта подтвержденной. src/app\_runtime/control/http\_app.py \| app.get FastAPI HTTP app.get Описание: Аналогично предыдущему пункту, FastAPI маршрутизатор регистрирует маршруты при старте приложения, делая эту точку старта подтвержденной. \#\#\# Возможные кандидаты src/app\_runtime/health/registry.py \| HealthRegistry Описание: Класс HealthRegistry используется для регистрации и управления health\-конtributors. Сам по себе класс не является точкой входа, но может быть использован в контексте health\-endpoint'а. Требуется дополнительная проверка в коде использования данного класса. -- **plba-v2-trace-flow-runtime-start** - Query: Покажи поток выполнения при запуске RuntimeManager - > 1. Точка старта: запуск приложения, точка app.post в http\_app.py. 2. \- 2.1 \[C3\_ENTRYPOINTS\] src/app\_runtime/control/http\_app.py \| app.post → fastapi http app.post \- 2.2 \[C2\_DEPENDENCY\_GRAPH\] src/app\_runtime/core/runtime.py \| RuntimeManager.\_\_init\_\_:dataflow\_slice → RuntimeManager.\_\_init\_\_ \- 2.2.1 RuntimeManager.\_\_init\_\_ создает экземпляр класса RuntimeManager и инициализирует его атрибуты. 3. Связь между шагами подтверждена напрямую через зависимости графов \[C2\_DEPENDENCY\_GRAPH\]. 4. Разрыв или участок с неполными данными: отсутствует прямое подтверждение вызова RuntimeManager из http\_app.py → app.post. Предполагается косвенная инициализация через настройку FastAPI приложения, но прямых доказательств этого нет в предоставленных слоях. Итог: Прямое восстановление потока выполнения от точки app.post до RuntimeManager завершено. Дальнейший путь к непосредственному вызову… -- **plba-v2-trace-flow-health-endpoint** - Query: Покажи как проходит запрос /health в HttpControlAppFactory - > 1. Точка старта — вызовы \`/health\` и \`/actions/\{action\}\` через \`HttpControlAppFactory.create\`. 2. \- 2.1. HttpControlAppFactory.create → создание экземпляра FastAPI \(\`app = FastAPI\(...\)\`\) \- 2.2. Внутри FastAPI создаётся middleware для логирования времени отклика запроса \(\`@app.middleware\("http"\)\`\) \- 2.3. Добавляются маршруты: \- GET \`/health\`: вызывает функцию \`health\_provider\`, возвращает статус через JSONResponse. \- GET/POST \`/actions/\{action\}\`: проверяет доступное действие, регистрирует клиентский источник и выполняет действия типа «запуск» или «остановка». 3. Связь между шагами подтверждается непосредственно объявлением функций внутри класса \`HttpControlAppFactory\` \(источник: \[C0\_SOURCE\_CHUNKS\]\). 4. Неполные данные отсутствуют. Весь описанный путь следования потока вызова документирован на основе доступных источников. -- **plba-v2-architecture-runtime-manager** - Query: Какие компоненты участвуют в RuntimeManager? - > 1. \*\*Компоненты, которые подтверждены контекстом\*\*: \- RuntimeManager \- ControlActionSet \- ControlPlaneService 2. \*\*Подтверждённые связи между ними\*\*: \- RuntimeManager вызывает метод \`start\` для начала работы. \- ControlPlaneService инициализирует каналы \(\`\_channels\`\) и запускает асинхронную обработку \(\`\_start\_async\`\). 3. \*\*Границы ответственности, если они реально видны в коде\*\*: \- RuntimeManager отвечает за управление жизненным циклом runtime\-среды и координирует выполнение различных ролей \(название указывает на менеджерскую роль\). \- ControlActionSet выполняет действия модели, являясь стандартным модельным компонентом. \- ControlPlaneService управляет сервисными каналами и инициирует асинхронные процессы. 4. \*\*Что остаётся неизвестным или неполным\*\*: \- Детали взаимодействия между конкретными ролями и точная структура обмена данными через каналы в ControlPlaneService.… -- **plba-v2-architecture-control-plane** - Query: Какие компоненты участвуют в ControlPlaneService? - > 1. \*\*Компоненты, которые подтверждены контекстом\*\*: \- ControlPlaneService \- ControlActionSet 2. \*\*Подтверждённые связи между ними\*\*: \- ControlPlaneService имеет метод \`\_\_init\_\_\`, который включает инициализацию внутренних каналов \(\`\_channels\`\) и регистрацию этих каналов через метод \`\_register\_channel\`. \- Контейнер \`ControlActionSet\` указан как модель с ролью «model», что подразумевает его использование внутри \`ControlPlaneService\`. Однако конкретные детали взаимодействия между этими двумя компонентами отсутствуют в представленном контексте. 3. \*\*Границы ответственности, если они реально видны в коде\*\*: \- ControlPlaneService отвечает за управление состоянием и участие в данных срезах \(dataflow slices\). \- ControlActionSet является моделью с базовой ролью «model». 4. \*\*Что остаётся неизвестным или неполным\*\*: \- Детали взаимодействия между ControlPlaneService и ControlAct… -- **plba-v2-explain-nonexistent-symbol** - Query: Объясни класс RuntimeFactoryManager - > Класс \`RuntimeFactoryManager\` не найден ни в предоставленном контексте, ни в стандартных библиотеках Python. \*\*Итог:\*\* Сущность не обнаружена. Невозможно предоставить полное объяснение её работы на основе доступного контекста. Рекомендую проверить наличие класса в реальном проекте или документации к нему. Если он существует вне представленного окружения, необходимо предоставить дополнительный контекст для анализа. -- **plba-v2-open-file-nonexistent** - Query: Открой файл src/app_runtime/core/missing_runtime.py - > 1. src/app\_runtime/core/missing\_runtime.py 2. Основан только на заголовке и первой строке файла: \`\`\` from \_\_future\_\_ import annotations \`\`\` Дальнейший контент недоступен. 3. Top\-level сущности и секции недоступны для анализа. 4. Из доступного контента видно, что файл импортирует аннотации из будущего \(\_\_future\_\_\), что может указывать на потенциальное использование современных языковых возможностей Python. Однако без дополнительного контекста невозможно определить, какие части файла могут быть важны для конкретного вопроса о интерпретации слоёв RAG. \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_140708/full_chain_plba_code_subintents_v2_plba-v2-architecture-control-plane.json b/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_140708/full_chain_plba_code_subintents_v2_plba-v2-architecture-control-plane.json deleted file mode 100644 index 81a2821..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_140708/full_chain_plba_code_subintents_v2_plba-v2-architecture-control-plane.json +++ /dev/null @@ -1,2940 +0,0 @@ -{ - "case_id": "plba-v2-architecture-control-plane", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_subintents_v2.yaml", - "runner": "runtime", - "mode": "full_chain", - "actual": { - "intent": "CODE_QA", - "sub_intent": "ARCHITECTURE", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 25, - "llm_answer": "В подсистеме `ControlPlaneService` наблюдаются следующие компоненты и связи:\n\n1. ControlPlaneService – главный компонент службы, управляющий потоками данных и состоянием системы. Он инициализируется через метод `__init__`, создавая каналы (`_channels`) и регистрируя их с помощью метода `_register_channel`.\n \n2. ControlActionSet – модель действий управления, используемая службой для обработки команд или запросов на выполнение определённых операций. Этот компонент участвует в создании каналов и запускает асинхронную обработку.\n\nСвязи и зависимости внутри подсистемы:\n- Контейнер `ControlPlaneService` отвечает за координацию выполнения различных задач и управление каналами данных.\n- Каналы (`_channels`), создаваемые при инициализации сервиса, служат механизмами передачи данных и уведомлений между различными частями системы.\n- Запуск асинхронных задач происходит через метод `_start_async`, который активирует логику обработки поступающих запросов.\n\nГраницы ответственности явно не декларированы напрямую в коде, однако можно предположить следующее распределение обязанностей:\n- Управление жизненным циклом и состоянием сервисов;\n- Обработка входных данных и передача их по соответствующим каналам;\n- Координация взаимодействия между сервисными модулями и компонентами приложения.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "ControlPlaneService" - ], - "layers": [ - "C4_SEMANTIC_ROLES", - "C3_ENTRYPOINTS", - "C2_DEPENDENCY_GRAPH", - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS" - ] - }, - "passed": true, - "mismatches": [], - "details": { - "case_id": "plba-v2-architecture-control-plane", - "text": "Какие компоненты участвуют в ControlPlaneService?", - "mode": "full_chain", - "run_started_at": "2026-03-12T14:07:09", - "rag_session_id": "7d11da21-faa0-4cea-aede-aeabe069164c", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Какие компоненты участвуют в ControlPlaneService?", - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "ControlPlaneService", - "alternatives": [ - "ControlPlaneService" - ], - "confidence": 0.99 - }, - "rag_count": 25, - "rag_rows": [ - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests service\n- reads and writes state attributes\n- participates in dataflow slices (5)", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlPlaneService", - "span_start": 12, - "span_end": 52, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 68, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "b13471e5916986dccffb53fab613812842965705e6b3a89ae549d30c9e91e9aa", - "symbol_name": "ControlPlaneService", - "qname": "ControlPlaneService", - "role": "pipeline_stage", - "confidence": 0.57, - "dataflow_participation": 5, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "ControlActionSet\nrole: model\n\nResponsibilities:\n- default model role", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlActionSet", - "span_start": 14, - "span_end": 18, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 40, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "46eb026cb3313415ec47b82dd22f84f4d112c9d987e8b1716dcb0baa1cce8988", - "symbol_name": "ControlActionSet", - "qname": "ControlActionSet", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "ControlChannel\nrole: model\n\nResponsibilities:\n- default model role", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlChannel", - "span_start": 21, - "span_end": 28, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 40, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "cfcfe9a311d3a2dbdaf32ac4ccd73c0eb9a117f830591a1c0867ee97d46204ff", - "symbol_name": "ControlChannel", - "qname": "ControlChannel", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_runner.py", - "content": "UvicornThreadRunner\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (24)", - "layer": "C4_SEMANTIC_ROLES", - "title": "UvicornThreadRunner", - "span_start": 10, - "span_end": 61, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 11, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "fd55630045a02100df8877ac27d951ee08617d4598764394d48cb51fe067476a", - "symbol_name": "UvicornThreadRunner", - "qname": "UvicornThreadRunner", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 24, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "3779fdd2878b770e789a35bb2a89c9d79f13b61c26d7db1b3b683f9bb9e1623f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (10)", - "layer": "C4_SEMANTIC_ROLES", - "title": "HttpControlChannel", - "span_start": 12, - "span_end": 57, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 21, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "1c9fbdc24819e5604c26ea55428a74310f03a03e1af197ed84846af61e42fdb0", - "symbol_name": "HttpControlChannel", - "qname": "HttpControlChannel", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 10, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "HttpControlAppFactory\nrole: factory\n\nResponsibilities:\n- name suffix suggests factory", - "layer": "C4_SEMANTIC_ROLES", - "title": "HttpControlAppFactory", - "span_start": 15, - "span_end": 53, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 39, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "9b3502a5fb408b273223db13264349cf500de24915b6c649d9ea8970d0dfd8e0", - "symbol_name": "HttpControlAppFactory", - "qname": "HttpControlAppFactory", - "role": "factory", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/persistence/workflow_persistence.py", - "content": "WorkflowPersistence\nrole: pipeline_stage\n\nResponsibilities:\n- orchestrates role-like calls (2)\n- reads and writes state attributes\n- participates in dataflow slices (16)", - "layer": "C4_SEMANTIC_ROLES", - "title": "WorkflowPersistence", - "span_start": 8, - "span_end": 54, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 15, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "7bd01ee45cf31f2d5c2e3e51656254860ac785d10cef9e0852cd4fba90857bae", - "symbol_name": "WorkflowPersistence", - "qname": "WorkflowPersistence", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 16, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "80e9410ddc639789b4353c2a1a757ba8d0d5b5bb6075b0b263b61551f04ae1f0", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/queue/in_memory.py", - "content": "InMemoryTaskQueue\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (9)", - "layer": "C4_SEMANTIC_ROLES", - "title": "InMemoryTaskQueue", - "span_start": 9, - "span_end": 38, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 22, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "2da04cb94544a3bcbf0943a95ad4bdd8710bcafaa32a02fd0e4de2178dcf3533", - "symbol_name": "InMemoryTaskQueue", - "qname": "InMemoryTaskQueue", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 9, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "58f0cc001ccda0eee4c6bc32ed83bd05eafd6b6644f1e8b4aa9eed3103db73dc", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/config/file_loader.py", - "content": "ConfigFileLoader\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (8)", - "layer": "C4_SEMANTIC_ROLES", - "title": "ConfigFileLoader", - "span_start": 11, - "span_end": 48, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 23, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "a8474eca8b6e9dc86ae67ed68b16fa5fb639ef08739c053e7b7195489765667f", - "symbol_name": "ConfigFileLoader", - "qname": "ConfigFileLoader", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 8, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "1f19ffebde5e38e4be5a5d5a678059a0f36dedb8fb8b3e00ab395c67106a87ea", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/store.py", - "content": "TraceContextStore\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (6)", - "layer": "C4_SEMANTIC_ROLES", - "title": "TraceContextStore", - "span_start": 15, - "span_end": 52, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 25, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "b2dad4fbe16ffb11b58deba311c7739955c39d59f291b22181f33e9c8cce4059", - "symbol_name": "TraceContextStore", - "qname": "TraceContextStore", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 6, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "d369554f08fc92039c6edd5a2a1e73b23901533e8974459170bbd9347d263dc5", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workers/supervisor.py", - "content": "WorkerSupervisor\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (6)", - "layer": "C4_SEMANTIC_ROLES", - "title": "WorkerSupervisor", - "span_start": 10, - "span_end": 59, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 25, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "c17b44e8d9e97d490989b21fa67d7c346cdda8a0472e4c41fb243c8846faa124", - "symbol_name": "WorkerSupervisor", - "qname": "WorkerSupervisor", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 6, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "77609d9d5927171cce7fc3a54897c183fd63068710c6362029b700937aae5eee", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/engine/workflow_engine.py", - "content": "WorkflowEngine\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (6)", - "layer": "C4_SEMANTIC_ROLES", - "title": "WorkflowEngine", - "span_start": 10, - "span_end": 86, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 25, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "57ec0a9f11c542c78e008684a888397e8d9ef4223671acb2567e631a0cbc70b4", - "symbol_name": "WorkflowEngine", - "qname": "WorkflowEngine", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 6, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "1057136e58a325cd5ab6f4e265d15665fb6a711b7022d9fab52a1a290afa2368", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._start_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 47, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517", - "dst_ref": "ControlPlaneService._start_async", - "resolution": "resolved", - "slice_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._start_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.register_channel", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 17, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957", - "dst_ref": "ControlPlaneService.register_channel", - "resolution": "resolved", - "slice_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.register_channel" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.start", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 20, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154", - "dst_ref": "ControlPlaneService.start", - "resolution": "resolved", - "slice_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.start" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.stop", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 25, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d", - "dst_ref": "ControlPlaneService.stop", - "resolution": "resolved", - "slice_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.stop" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._stop_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 51, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a", - "dst_ref": "ControlPlaneService._stop_async", - "resolution": "resolved", - "slice_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._stop_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.start calls asyncio.run", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.start:calls", - "span_start": 22, - "span_end": 22, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "4e0b3147fb867d48d26567570c259f4052a739e3098133802d4b8bafcf03be6b", - "edge_type": "calls", - "src_symbol_id": "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154", - "src_qname": "ControlPlaneService.start", - "dst_symbol_id": null, - "dst_ref": "asyncio.run", - "resolution": "partial", - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.register_channel reads_attr ControlPlaneService._channels", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.register_channel:reads_attr", - "span_start": 17, - "span_end": 17, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "3101fdc99a7a9c5aebf18a024bc148d37b348248a6fd02b95724dff280f2908a", - "edge_type": "reads_attr", - "src_symbol_id": "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957", - "src_qname": "ControlPlaneService.register_channel", - "dst_symbol_id": null, - "dst_ref": "ControlPlaneService._channels", - "resolution": "partial", - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.start reads_attr ControlPlaneService._channels", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.start:reads_attr", - "span_start": 20, - "span_end": 20, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "9452e50ef27d47c30ee1c311c48fe73ecddbf7a6dbcf967a6345e98222d9f71a", - "edge_type": "reads_attr", - "src_symbol_id": "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154", - "src_qname": "ControlPlaneService.start", - "dst_symbol_id": null, - "dst_ref": "ControlPlaneService._channels", - "resolution": "partial", - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "class ControlPlaneService\nControlPlaneService", - "layer": "C1_SYMBOL_CATALOG", - "title": "ControlPlaneService", - "span_start": 12, - "span_end": 52, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "b13471e5916986dccffb53fab613812842965705e6b3a89ae549d30c9e91e9aa", - "qname": "ControlPlaneService", - "kind": "class", - "signature": "ControlPlaneService", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.control.service", - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "class ControlPlaneService:\n def __init__(self) -> None:\n self._channels: list[ControlChannel] = []\n\n def register_channel(self, channel: ControlChannel) -> None:\n self._channels.append(channel)\n\n def start(self, runtime: RuntimeManager) -> None:\n if not self._channels:\n return\n asyncio.run(self._start_async(runtime))\n\n def stop(self) -> None:\n if not self._channels:\n return\n asyncio.run(self._stop_async())\n\n def snapshot(self, runtime: RuntimeManager) -> dict[str, object]:\n health = runtime.current_health()\n return {\n \"runtime\": {\"state\": runtime._state.value},\n \"modules\": list(runtime.registry.modules),\n \"services\": runtime.services.snapshot(),\n \"workers\": runtime.workers.snapshot(),\n \"health\": runtime.health.snapshot(runtime.workers.healths()) | {\"status\": health[\"status\"]},\n \"config\": runtime.configuration.get(),\n }\n\n async def _start_async(self, runtime: RuntimeManager) -> None:\n actions = ControlActionSet(\n health=runtime.health_status,\n start=runtime.start_runtime,\n stop=runtime.stop_runtime,\n status=runtime.runtime_status,\n )\n for channel in self._channels:\n await channel.start(actions)\n\n async def _stop_async(self) -> None:\n for channel in reversed(self._channels):\n await channel.stop()", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/service.py:ControlPlaneService", - "span_start": 12, - "span_end": 52, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.service", - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "llm_answer": "В подсистеме `ControlPlaneService` наблюдаются следующие компоненты и связи:\n\n1. ControlPlaneService – главный компонент службы, управляющий потоками данных и состоянием системы. Он инициализируется через метод `__init__`, создавая каналы (`_channels`) и регистрируя их с помощью метода `_register_channel`.\n \n2. ControlActionSet – модель действий управления, используемая службой для обработки команд или запросов на выполнение определённых операций. Этот компонент участвует в создании каналов и запускает асинхронную обработку.\n\nСвязи и зависимости внутри подсистемы:\n- Контейнер `ControlPlaneService` отвечает за координацию выполнения различных задач и управление каналами данных.\n- Каналы (`_channels`), создаваемые при инициализации сервиса, служат механизмами передачи данных и уведомлений между различными частями системы.\n- Запуск асинхронных задач происходит через метод `_start_async`, который активирует логику обработки поступающих запросов.\n\nГраницы ответственности явно не декларированы напрямую в коде, однако можно предположить следующее распределение обязанностей:\n- Управление жизненным циклом и состоянием сервисов;\n- Обработка входных данных и передача их по соответствующим каналам;\n- Координация взаимодействия между сервисными модулями и компонентами приложения.", - "summary": { - "router": { - "intent": "CODE_QA", - "sub_intent": "ARCHITECTURE", - "confidence": null - }, - "retrieval": { - "profile": "code", - "layers_hit": [ - "C0_SOURCE_CHUNKS", - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS", - "C4_SEMANTIC_ROLES" - ], - "evidence_sufficient": true - }, - "llm": { - "answer_status": "answered", - "groundedness": "grounded" - } - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "ARCHITECTURE", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C4_SEMANTIC_ROLES", - "C3_ENTRYPOINTS", - "C2_DEPENDENCY_GRAPH", - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "ControlPlaneService" - ], - "keyword_hints": [ - "ControlPlaneService" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "execution": { - "executed_layers": [ - "C4_SEMANTIC_ROLES", - "C3_ENTRYPOINTS", - "C2_DEPENDENCY_GRAPH", - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS" - ], - "retrieval_mode_by_layer": { - "C4_SEMANTIC_ROLES": "exact_path_fetch", - "C3_ENTRYPOINTS": "exact_path_fetch", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C1_SYMBOL_CATALOG": "symbol_search", - "C0_SOURCE_CHUNKS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C4_SEMANTIC_ROLES": 12, - "C3_ENTRYPOINTS": 8, - "C2_DEPENDENCY_GRAPH": 8, - "C1_SYMBOL_CATALOG": 6, - "C0_SOURCE_CHUNKS": 4 - }, - "filters_by_layer": { - "C4_SEMANTIC_ROLES": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C1_SYMBOL_CATALOG": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C4_SEMANTIC_ROLES", - "query": "Какие компоненты участвуют в ControlPlaneService?", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 12, - "ranking_profile": "code" - }, - { - "layer": "C3_ENTRYPOINTS", - "query": "Какие компоненты участвуют в ControlPlaneService?", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "Какие компоненты участвуют в ControlPlaneService?", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C1_SYMBOL_CATALOG", - "query": "ControlPlaneService", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Какие компоненты участвуют в ControlPlaneService?", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 4, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C4_SEMANTIC_ROLES", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 12, - "candidates_after_filter": 12 - }, - { - "layer": "C3_ENTRYPOINTS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 3, - "candidates_after_filter": 3 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 1, - "candidates_after_filter": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 4, - "candidates_after_filter": 4 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "ControlPlaneService", - "alternatives": [ - "ControlPlaneService" - ] - }, - "layers": [ - { - "layer": "C4_SEMANTIC_ROLES", - "status": "hit", - "hit_count": 12, - "fail_reason": null - }, - { - "layer": "C3_ENTRYPOINTS", - "status": "hit", - "hit_count": 3, - "fail_reason": null - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 8, - "fail_reason": null - }, - { - "layer": "C1_SYMBOL_CATALOG", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 1, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "router": 0, - "symbol_resolution": 0, - "retrieval_total": 162, - "retrieval_by_layer": { - "C4_SEMANTIC_ROLES": 34, - "C3_ENTRYPOINTS": 20, - "C2_DEPENDENCY_GRAPH": 63, - "C1_SYMBOL_CATALOG": 23, - "C0_SOURCE_CHUNKS": 19 - }, - "merge_rank": 20, - "prompt_build": 0, - "llm_call": 1981 - }, - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 558, - "evidence_rows": 25, - "evidence_chars": 3723 - }, - "evidence_summary": [ - { - "layer": "C4_SEMANTIC_ROLES", - "count": 12, - "unique_paths": 11 - }, - { - "layer": "C3_ENTRYPOINTS", - "count": 3, - "unique_paths": 1 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "count": 8, - "unique_paths": 1 - }, - { - "layer": "C1_SYMBOL_CATALOG", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 1, - "unique_paths": 1 - } - ], - "prompt_template_id": "intent_code_qa_architecture_ru_v3", - "system_prompt_version": "v1" - }, - "router": { - "conversation_mode": "START", - "keyword_hints": [ - "ControlPlaneService" - ], - "path_scope": [] - }, - "llm": { - "used_evidence_count": 25, - "missing_evidence_reason": null - } - }, - "run_info": { - "case_id": "plba-v2-architecture-control-plane", - "mode": "full_chain", - "run_started_at": "2026-03-12T14:07:09", - "rag_session_id": "7d11da21-faa0-4cea-aede-aeabe069164c", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - }, - "input_request": { - "text": "Какие компоненты участвуют в ControlPlaneService?", - "normalized_query": "Какие компоненты участвуют в ControlPlaneService?" - }, - "steps": [ - { - "step": "intent_router", - "input": { - "query": "Какие компоненты участвуют в ControlPlaneService?" - }, - "output": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Какие компоненты участвуют в ControlPlaneService?" - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "ARCHITECTURE", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C4_SEMANTIC_ROLES", - "C3_ENTRYPOINTS", - "C2_DEPENDENCY_GRAPH", - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "ControlPlaneService" - ], - "keyword_hints": [ - "ControlPlaneService" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "timings_ms": { - "router": 0 - } - } - }, - { - "step": "retrieval", - "input": { - "query": "Какие компоненты участвуют в ControlPlaneService?" - }, - "output": { - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "ControlPlaneService", - "alternatives": [ - "ControlPlaneService" - ], - "confidence": 0.99 - }, - "rag_count": 25, - "rag_rows": [ - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests service\n- reads and writes state attributes\n- participates in dataflow slices (5)", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlPlaneService", - "span_start": 12, - "span_end": 52, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 68, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "b13471e5916986dccffb53fab613812842965705e6b3a89ae549d30c9e91e9aa", - "symbol_name": "ControlPlaneService", - "qname": "ControlPlaneService", - "role": "pipeline_stage", - "confidence": 0.57, - "dataflow_participation": 5, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "ControlActionSet\nrole: model\n\nResponsibilities:\n- default model role", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlActionSet", - "span_start": 14, - "span_end": 18, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 40, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "46eb026cb3313415ec47b82dd22f84f4d112c9d987e8b1716dcb0baa1cce8988", - "symbol_name": "ControlActionSet", - "qname": "ControlActionSet", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "ControlChannel\nrole: model\n\nResponsibilities:\n- default model role", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlChannel", - "span_start": 21, - "span_end": 28, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 40, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "cfcfe9a311d3a2dbdaf32ac4ccd73c0eb9a117f830591a1c0867ee97d46204ff", - "symbol_name": "ControlChannel", - "qname": "ControlChannel", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_runner.py", - "content": "UvicornThreadRunner\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (24)", - "layer": "C4_SEMANTIC_ROLES", - "title": "UvicornThreadRunner", - "span_start": 10, - "span_end": 61, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 11, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "fd55630045a02100df8877ac27d951ee08617d4598764394d48cb51fe067476a", - "symbol_name": "UvicornThreadRunner", - "qname": "UvicornThreadRunner", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 24, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "3779fdd2878b770e789a35bb2a89c9d79f13b61c26d7db1b3b683f9bb9e1623f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (10)", - "layer": "C4_SEMANTIC_ROLES", - "title": "HttpControlChannel", - "span_start": 12, - "span_end": 57, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 21, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "1c9fbdc24819e5604c26ea55428a74310f03a03e1af197ed84846af61e42fdb0", - "symbol_name": "HttpControlChannel", - "qname": "HttpControlChannel", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 10, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "HttpControlAppFactory\nrole: factory\n\nResponsibilities:\n- name suffix suggests factory", - "layer": "C4_SEMANTIC_ROLES", - "title": "HttpControlAppFactory", - "span_start": 15, - "span_end": 53, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 39, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "9b3502a5fb408b273223db13264349cf500de24915b6c649d9ea8970d0dfd8e0", - "symbol_name": "HttpControlAppFactory", - "qname": "HttpControlAppFactory", - "role": "factory", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/persistence/workflow_persistence.py", - "content": "WorkflowPersistence\nrole: pipeline_stage\n\nResponsibilities:\n- orchestrates role-like calls (2)\n- reads and writes state attributes\n- participates in dataflow slices (16)", - "layer": "C4_SEMANTIC_ROLES", - "title": "WorkflowPersistence", - "span_start": 8, - "span_end": 54, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 15, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "7bd01ee45cf31f2d5c2e3e51656254860ac785d10cef9e0852cd4fba90857bae", - "symbol_name": "WorkflowPersistence", - "qname": "WorkflowPersistence", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 16, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "80e9410ddc639789b4353c2a1a757ba8d0d5b5bb6075b0b263b61551f04ae1f0", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/queue/in_memory.py", - "content": "InMemoryTaskQueue\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (9)", - "layer": "C4_SEMANTIC_ROLES", - "title": "InMemoryTaskQueue", - "span_start": 9, - "span_end": 38, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 22, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "2da04cb94544a3bcbf0943a95ad4bdd8710bcafaa32a02fd0e4de2178dcf3533", - "symbol_name": "InMemoryTaskQueue", - "qname": "InMemoryTaskQueue", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 9, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "58f0cc001ccda0eee4c6bc32ed83bd05eafd6b6644f1e8b4aa9eed3103db73dc", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/config/file_loader.py", - "content": "ConfigFileLoader\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (8)", - "layer": "C4_SEMANTIC_ROLES", - "title": "ConfigFileLoader", - "span_start": 11, - "span_end": 48, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 23, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "a8474eca8b6e9dc86ae67ed68b16fa5fb639ef08739c053e7b7195489765667f", - "symbol_name": "ConfigFileLoader", - "qname": "ConfigFileLoader", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 8, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "1f19ffebde5e38e4be5a5d5a678059a0f36dedb8fb8b3e00ab395c67106a87ea", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/store.py", - "content": "TraceContextStore\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (6)", - "layer": "C4_SEMANTIC_ROLES", - "title": "TraceContextStore", - "span_start": 15, - "span_end": 52, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 25, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "b2dad4fbe16ffb11b58deba311c7739955c39d59f291b22181f33e9c8cce4059", - "symbol_name": "TraceContextStore", - "qname": "TraceContextStore", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 6, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "d369554f08fc92039c6edd5a2a1e73b23901533e8974459170bbd9347d263dc5", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workers/supervisor.py", - "content": "WorkerSupervisor\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (6)", - "layer": "C4_SEMANTIC_ROLES", - "title": "WorkerSupervisor", - "span_start": 10, - "span_end": 59, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 25, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "c17b44e8d9e97d490989b21fa67d7c346cdda8a0472e4c41fb243c8846faa124", - "symbol_name": "WorkerSupervisor", - "qname": "WorkerSupervisor", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 6, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "77609d9d5927171cce7fc3a54897c183fd63068710c6362029b700937aae5eee", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/engine/workflow_engine.py", - "content": "WorkflowEngine\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (6)", - "layer": "C4_SEMANTIC_ROLES", - "title": "WorkflowEngine", - "span_start": 10, - "span_end": 86, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 25, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "57ec0a9f11c542c78e008684a888397e8d9ef4223671acb2567e631a0cbc70b4", - "symbol_name": "WorkflowEngine", - "qname": "WorkflowEngine", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 6, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "1057136e58a325cd5ab6f4e265d15665fb6a711b7022d9fab52a1a290afa2368", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._start_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 47, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517", - "dst_ref": "ControlPlaneService._start_async", - "resolution": "resolved", - "slice_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._start_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.register_channel", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 17, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957", - "dst_ref": "ControlPlaneService.register_channel", - "resolution": "resolved", - "slice_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.register_channel" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.start", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 20, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154", - "dst_ref": "ControlPlaneService.start", - "resolution": "resolved", - "slice_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.start" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.stop", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 25, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d", - "dst_ref": "ControlPlaneService.stop", - "resolution": "resolved", - "slice_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.stop" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._stop_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 51, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a", - "dst_ref": "ControlPlaneService._stop_async", - "resolution": "resolved", - "slice_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._stop_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.start calls asyncio.run", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.start:calls", - "span_start": 22, - "span_end": 22, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "4e0b3147fb867d48d26567570c259f4052a739e3098133802d4b8bafcf03be6b", - "edge_type": "calls", - "src_symbol_id": "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154", - "src_qname": "ControlPlaneService.start", - "dst_symbol_id": null, - "dst_ref": "asyncio.run", - "resolution": "partial", - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.register_channel reads_attr ControlPlaneService._channels", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.register_channel:reads_attr", - "span_start": 17, - "span_end": 17, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "3101fdc99a7a9c5aebf18a024bc148d37b348248a6fd02b95724dff280f2908a", - "edge_type": "reads_attr", - "src_symbol_id": "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957", - "src_qname": "ControlPlaneService.register_channel", - "dst_symbol_id": null, - "dst_ref": "ControlPlaneService._channels", - "resolution": "partial", - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.start reads_attr ControlPlaneService._channels", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.start:reads_attr", - "span_start": 20, - "span_end": 20, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "9452e50ef27d47c30ee1c311c48fe73ecddbf7a6dbcf967a6345e98222d9f71a", - "edge_type": "reads_attr", - "src_symbol_id": "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154", - "src_qname": "ControlPlaneService.start", - "dst_symbol_id": null, - "dst_ref": "ControlPlaneService._channels", - "resolution": "partial", - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "class ControlPlaneService\nControlPlaneService", - "layer": "C1_SYMBOL_CATALOG", - "title": "ControlPlaneService", - "span_start": 12, - "span_end": 52, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "b13471e5916986dccffb53fab613812842965705e6b3a89ae549d30c9e91e9aa", - "qname": "ControlPlaneService", - "kind": "class", - "signature": "ControlPlaneService", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.control.service", - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "class ControlPlaneService:\n def __init__(self) -> None:\n self._channels: list[ControlChannel] = []\n\n def register_channel(self, channel: ControlChannel) -> None:\n self._channels.append(channel)\n\n def start(self, runtime: RuntimeManager) -> None:\n if not self._channels:\n return\n asyncio.run(self._start_async(runtime))\n\n def stop(self) -> None:\n if not self._channels:\n return\n asyncio.run(self._stop_async())\n\n def snapshot(self, runtime: RuntimeManager) -> dict[str, object]:\n health = runtime.current_health()\n return {\n \"runtime\": {\"state\": runtime._state.value},\n \"modules\": list(runtime.registry.modules),\n \"services\": runtime.services.snapshot(),\n \"workers\": runtime.workers.snapshot(),\n \"health\": runtime.health.snapshot(runtime.workers.healths()) | {\"status\": health[\"status\"]},\n \"config\": runtime.configuration.get(),\n }\n\n async def _start_async(self, runtime: RuntimeManager) -> None:\n actions = ControlActionSet(\n health=runtime.health_status,\n start=runtime.start_runtime,\n stop=runtime.stop_runtime,\n status=runtime.runtime_status,\n )\n for channel in self._channels:\n await channel.start(actions)\n\n async def _stop_async(self) -> None:\n for channel in reversed(self._channels):\n await channel.stop()", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/service.py:ControlPlaneService", - "span_start": 12, - "span_end": 52, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.service", - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ] - }, - "diagnostics": { - "execution": { - "executed_layers": [ - "C4_SEMANTIC_ROLES", - "C3_ENTRYPOINTS", - "C2_DEPENDENCY_GRAPH", - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS" - ], - "retrieval_mode_by_layer": { - "C4_SEMANTIC_ROLES": "exact_path_fetch", - "C3_ENTRYPOINTS": "exact_path_fetch", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C1_SYMBOL_CATALOG": "symbol_search", - "C0_SOURCE_CHUNKS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C4_SEMANTIC_ROLES": 12, - "C3_ENTRYPOINTS": 8, - "C2_DEPENDENCY_GRAPH": 8, - "C1_SYMBOL_CATALOG": 6, - "C0_SOURCE_CHUNKS": 4 - }, - "filters_by_layer": { - "C4_SEMANTIC_ROLES": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C1_SYMBOL_CATALOG": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C4_SEMANTIC_ROLES", - "query": "Какие компоненты участвуют в ControlPlaneService?", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 12, - "ranking_profile": "code" - }, - { - "layer": "C3_ENTRYPOINTS", - "query": "Какие компоненты участвуют в ControlPlaneService?", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "Какие компоненты участвуют в ControlPlaneService?", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C1_SYMBOL_CATALOG", - "query": "ControlPlaneService", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Какие компоненты участвуют в ControlPlaneService?", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 4, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C4_SEMANTIC_ROLES", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 12, - "candidates_after_filter": 12 - }, - { - "layer": "C3_ENTRYPOINTS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 3, - "candidates_after_filter": 3 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 1, - "candidates_after_filter": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 4, - "candidates_after_filter": 4 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "ControlPlaneService", - "alternatives": [ - "ControlPlaneService" - ] - }, - "layers": [ - { - "layer": "C4_SEMANTIC_ROLES", - "status": "hit", - "hit_count": 12, - "fail_reason": null - }, - { - "layer": "C3_ENTRYPOINTS", - "status": "hit", - "hit_count": 3, - "fail_reason": null - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 8, - "fail_reason": null - }, - { - "layer": "C1_SYMBOL_CATALOG", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 1, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "symbol_resolution": 0, - "retrieval_total": 162, - "retrieval_by_layer": { - "C4_SEMANTIC_ROLES": 34, - "C3_ENTRYPOINTS": 20, - "C2_DEPENDENCY_GRAPH": 63, - "C1_SYMBOL_CATALOG": 23, - "C0_SOURCE_CHUNKS": 19 - }, - "merge_rank": 20 - } - } - }, - { - "step": "llm_answer", - "input": { - "query": "Какие компоненты участвуют в ControlPlaneService?", - "rag_count": 25 - }, - "output": { - "llm_answer": "В подсистеме `ControlPlaneService` наблюдаются следующие компоненты и связи:\n\n1. ControlPlaneService – главный компонент службы, управляющий потоками данных и состоянием системы. Он инициализируется через метод `__init__`, создавая каналы (`_channels`) и регистрируя их с помощью метода `_register_channel`.\n \n2. ControlActionSet – модель действий управления, используемая службой для обработки команд или запросов на выполнение определённых операций. Этот компонент участвует в создании каналов и запускает асинхронную обработку.\n\nСвязи и зависимости внутри подсистемы:\n- Контейнер `ControlPlaneService` отвечает за координацию выполнения различных задач и управление каналами данных.\n- Каналы (`_channels`), создаваемые при инициализации сервиса, служат механизмами передачи данных и уведомлений между различными частями системы.\n- Запуск асинхронных задач происходит через метод `_start_async`, который активирует логику обработки поступающих запросов.\n\nГраницы ответственности явно не декларированы напрямую в коде, однако можно предположить следующее распределение обязанностей:\n- Управление жизненным циклом и состоянием сервисов;\n- Обработка входных данных и передача их по соответствующим каналам;\n- Координация взаимодействия между сервисными модулями и компонентами приложения." - }, - "diagnostics": { - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 558, - "evidence_rows": 25, - "evidence_chars": 3723 - }, - "evidence_summary": [ - { - "layer": "C4_SEMANTIC_ROLES", - "count": 12, - "unique_paths": 11 - }, - { - "layer": "C3_ENTRYPOINTS", - "count": 3, - "unique_paths": 1 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "count": 8, - "unique_paths": 1 - }, - { - "layer": "C1_SYMBOL_CATALOG", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 1, - "unique_paths": 1 - } - ], - "prompt_template_id": "intent_code_qa_architecture_ru_v3", - "system_prompt_version": "v1" - }, - "timings_ms": { - "prompt_build": 0, - "llm_call": 1981 - } - } - } - ] - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_140708/full_chain_plba_code_subintents_v2_plba-v2-architecture-control-plane.md b/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_140708/full_chain_plba_code_subintents_v2_plba-v2-architecture-control-plane.md deleted file mode 100644 index 89d198c..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_140708/full_chain_plba_code_subintents_v2_plba-v2-architecture-control-plane.md +++ /dev/null @@ -1,34 +0,0 @@ -# plba-v2-architecture-control-plane - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_subintents_v2.yaml -- runner: runtime -- mode: full_chain -- passed: True - -## Query -Какие компоненты участвуют в ControlPlaneService? - -## Actual -{ - "intent": "CODE_QA", - "sub_intent": "ARCHITECTURE", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 25, - "llm_answer": "В подсистеме `ControlPlaneService` наблюдаются следующие компоненты и связи:\n\n1. ControlPlaneService – главный компонент службы, управляющий потоками данных и состоянием системы. Он инициализируется через метод `__init__`, создавая каналы (`_channels`) и регистрируя их с помощью метода `_register_channel`.\n \n2. ControlActionSet – модель действий управления, используемая службой для обработки команд или запросов на выполнение определённых операций. Этот компонент участвует в создании каналов и запускает асинхронную обработку.\n\nСвязи и зависимости внутри подсистемы:\n- Контейнер `ControlPlaneService` отвечает за координацию выполнения различных задач и управление каналами данных.\n- Каналы (`_channels`), создаваемые при инициализации сервиса, служат механизмами передачи данных и уведомлений между различными частями системы.\n- Запуск асинхронных задач происходит через метод `_start_async`, который активирует логику обработки поступающих запросов.\n\nГраницы ответственности явно не декларированы напрямую в коде, однако можно предположить следующее распределение обязанностей:\n- Управление жизненным циклом и состоянием сервисов;\n- Обработка входных данных и передача их по соответствующим каналам;\n- Координация взаимодействия между сервисными модулями и компонентами приложения.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "ControlPlaneService" - ], - "layers": [ - "C4_SEMANTIC_ROLES", - "C3_ENTRYPOINTS", - "C2_DEPENDENCY_GRAPH", - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS" - ] -} - -## Mismatches -- none \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_140708/full_chain_plba_code_subintents_v2_plba-v2-architecture-runtime-manager.json b/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_140708/full_chain_plba_code_subintents_v2_plba-v2-architecture-runtime-manager.json deleted file mode 100644 index 6aa8829..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_140708/full_chain_plba_code_subintents_v2_plba-v2-architecture-runtime-manager.json +++ /dev/null @@ -1,3036 +0,0 @@ -{ - "case_id": "plba-v2-architecture-runtime-manager", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_subintents_v2.yaml", - "runner": "runtime", - "mode": "full_chain", - "actual": { - "intent": "CODE_QA", - "sub_intent": "ARCHITECTURE", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 25, - "llm_answer": "В подсистеме RuntimeManager участвуют следующие компоненты и устанавливаются явные связи между ними:\n\n1. RuntimeManager – центральный управляющий компонент, ответственный за координацию работы всей системы runtime. Он управляет состоянием приложения и отвечает за выполнение ключевых операций жизненного цикла, таких как инициализация конфигурации и запуск процессов.\n - Связи: чтение и запись атрибутов состояния (через конфигурационные данные и методы start).\n\n2. ControlActionSet – модель поведения или действия, выполняемые системой управления. Этот компонент играет роль дефолтного исполнителя для различных управляющих задач.\n - Связь: используется внутри RuntimeManager при выполнении действий управления.\n\n3. ControlPlaneService – сервис, обеспечивающий взаимодействие с плоскостью контроля. Его основная задача — управление каналами коммуникации и инициирование асинхронных процессов.\n - Связь: вызывается конструктором RuntimeManager через его метод `__init__`, обеспечивая начальную настройку среды выполнения.\n\nТаким образом, RuntimeManager выступает в качестве координатора всех основных операций системы runtime, взаимодействуя с внешними сервисами через ControlActionSet и другими необходимыми компонентами для корректной настройки и запуска приложения.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "RuntimeManager" - ], - "layers": [ - "C4_SEMANTIC_ROLES", - "C3_ENTRYPOINTS", - "C2_DEPENDENCY_GRAPH", - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS" - ] - }, - "passed": true, - "mismatches": [], - "details": { - "case_id": "plba-v2-architecture-runtime-manager", - "text": "Какие компоненты участвуют в RuntimeManager?", - "mode": "full_chain", - "run_started_at": "2026-03-12T14:07:09", - "rag_session_id": "7d11da21-faa0-4cea-aede-aeabe069164c", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Какие компоненты участвуют в RuntimeManager?", - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "RuntimeManager", - "alternatives": [ - "RuntimeManager" - ], - "confidence": 0.99 - }, - "rag_count": 25, - "rag_rows": [ - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests manager\n- orchestrates role-like calls (4)\n- reads and writes state attributes\n- participates in dataflow slices (50)", - "layer": "C4_SEMANTIC_ROLES", - "title": "RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 43, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "7e4a9381328c5803bbc6179458612fc4e947d928aa7bf8b4b2bebb2c8592f758", - "symbol_name": "RuntimeManager", - "qname": "RuntimeManager", - "role": "pipeline_stage", - "confidence": 0.67, - "dataflow_participation": 50, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "ControlActionSet\nrole: model\n\nResponsibilities:\n- default model role", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlActionSet", - "span_start": 14, - "span_end": 18, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 40, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "46eb026cb3313415ec47b82dd22f84f4d112c9d987e8b1716dcb0baa1cce8988", - "symbol_name": "ControlActionSet", - "qname": "ControlActionSet", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "ControlChannel\nrole: model\n\nResponsibilities:\n- default model role", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlChannel", - "span_start": 21, - "span_end": 28, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 40, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "cfcfe9a311d3a2dbdaf32ac4ccd73c0eb9a117f830591a1c0867ee97d46204ff", - "symbol_name": "ControlChannel", - "qname": "ControlChannel", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests service\n- reads and writes state attributes\n- participates in dataflow slices (5)", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlPlaneService", - "span_start": 12, - "span_end": 52, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 68, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "b13471e5916986dccffb53fab613812842965705e6b3a89ae549d30c9e91e9aa", - "symbol_name": "ControlPlaneService", - "qname": "ControlPlaneService", - "role": "pipeline_stage", - "confidence": 0.57, - "dataflow_participation": 5, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_runner.py", - "content": "UvicornThreadRunner\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (24)", - "layer": "C4_SEMANTIC_ROLES", - "title": "UvicornThreadRunner", - "span_start": 10, - "span_end": 61, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 11, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "fd55630045a02100df8877ac27d951ee08617d4598764394d48cb51fe067476a", - "symbol_name": "UvicornThreadRunner", - "qname": "UvicornThreadRunner", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 24, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "3779fdd2878b770e789a35bb2a89c9d79f13b61c26d7db1b3b683f9bb9e1623f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (10)", - "layer": "C4_SEMANTIC_ROLES", - "title": "HttpControlChannel", - "span_start": 12, - "span_end": 57, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 21, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "1c9fbdc24819e5604c26ea55428a74310f03a03e1af197ed84846af61e42fdb0", - "symbol_name": "HttpControlChannel", - "qname": "HttpControlChannel", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 10, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "HttpControlAppFactory\nrole: factory\n\nResponsibilities:\n- name suffix suggests factory", - "layer": "C4_SEMANTIC_ROLES", - "title": "HttpControlAppFactory", - "span_start": 15, - "span_end": 53, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 39, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "9b3502a5fb408b273223db13264349cf500de24915b6c649d9ea8970d0dfd8e0", - "symbol_name": "HttpControlAppFactory", - "qname": "HttpControlAppFactory", - "role": "factory", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/persistence/workflow_persistence.py", - "content": "WorkflowPersistence\nrole: pipeline_stage\n\nResponsibilities:\n- orchestrates role-like calls (2)\n- reads and writes state attributes\n- participates in dataflow slices (16)", - "layer": "C4_SEMANTIC_ROLES", - "title": "WorkflowPersistence", - "span_start": 8, - "span_end": 54, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 15, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "7bd01ee45cf31f2d5c2e3e51656254860ac785d10cef9e0852cd4fba90857bae", - "symbol_name": "WorkflowPersistence", - "qname": "WorkflowPersistence", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 16, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "80e9410ddc639789b4353c2a1a757ba8d0d5b5bb6075b0b263b61551f04ae1f0", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/queue/in_memory.py", - "content": "InMemoryTaskQueue\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (9)", - "layer": "C4_SEMANTIC_ROLES", - "title": "InMemoryTaskQueue", - "span_start": 9, - "span_end": 38, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 22, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "2da04cb94544a3bcbf0943a95ad4bdd8710bcafaa32a02fd0e4de2178dcf3533", - "symbol_name": "InMemoryTaskQueue", - "qname": "InMemoryTaskQueue", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 9, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "58f0cc001ccda0eee4c6bc32ed83bd05eafd6b6644f1e8b4aa9eed3103db73dc", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/config/file_loader.py", - "content": "ConfigFileLoader\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (8)", - "layer": "C4_SEMANTIC_ROLES", - "title": "ConfigFileLoader", - "span_start": 11, - "span_end": 48, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 23, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "a8474eca8b6e9dc86ae67ed68b16fa5fb639ef08739c053e7b7195489765667f", - "symbol_name": "ConfigFileLoader", - "qname": "ConfigFileLoader", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 8, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "1f19ffebde5e38e4be5a5d5a678059a0f36dedb8fb8b3e00ab395c67106a87ea", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/store.py", - "content": "TraceContextStore\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (6)", - "layer": "C4_SEMANTIC_ROLES", - "title": "TraceContextStore", - "span_start": 15, - "span_end": 52, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 25, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "b2dad4fbe16ffb11b58deba311c7739955c39d59f291b22181f33e9c8cce4059", - "symbol_name": "TraceContextStore", - "qname": "TraceContextStore", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 6, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "d369554f08fc92039c6edd5a2a1e73b23901533e8974459170bbd9347d263dc5", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workers/supervisor.py", - "content": "WorkerSupervisor\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (6)", - "layer": "C4_SEMANTIC_ROLES", - "title": "WorkerSupervisor", - "span_start": 10, - "span_end": 59, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 25, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "c17b44e8d9e97d490989b21fa67d7c346cdda8a0472e4c41fb243c8846faa124", - "symbol_name": "WorkerSupervisor", - "qname": "WorkerSupervisor", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 6, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "77609d9d5927171cce7fc3a54897c183fd63068710c6362029b700937aae5eee", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._start_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 47, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517", - "dst_ref": "ControlPlaneService._start_async", - "resolution": "resolved", - "slice_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._start_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager.start", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 32, - "span_end": 59, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "98312ace7fc62b1c7194c5aa1732b6ef736eae1668a3a120dd1ecd5ab1d64f7a", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "77a7b260193018845e4e204df094ab89cfd7c82ee4e822b3a83ad4cd945f9cb1", - "dst_ref": "RuntimeManager.start", - "resolution": "resolved", - "slice_id": "98312ace7fc62b1c7194c5aa1732b6ef736eae1668a3a120dd1ecd5ab1d64f7a", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager.start" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "77a7b260193018845e4e204df094ab89cfd7c82ee4e822b3a83ad4cd945f9cb1" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.start", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 20, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154", - "dst_ref": "ControlPlaneService.start", - "resolution": "resolved", - "slice_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.start" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.stop", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 25, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d", - "dst_ref": "ControlPlaneService.stop", - "resolution": "resolved", - "slice_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.stop" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._stop_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 51, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a", - "dst_ref": "ControlPlaneService._stop_async", - "resolution": "resolved", - "slice_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._stop_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager.add_config_file", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 32, - "span_end": 52, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "a23b8a11ebdb12708b60c96ea12a69f7f042082f1adfddd572444e246d81d167", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "57ffbd4f0d9fdf3507c2b8624312ce211f3d02fdf86a57a8ec90778d8a7b498d", - "dst_ref": "RuntimeManager.add_config_file", - "resolution": "resolved", - "slice_id": "a23b8a11ebdb12708b60c96ea12a69f7f042082f1adfddd572444e246d81d167", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager.add_config_file" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "57ffbd4f0d9fdf3507c2b8624312ce211f3d02fdf86a57a8ec90778d8a7b498d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.register_channel", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 17, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957", - "dst_ref": "ControlPlaneService.register_channel", - "resolution": "resolved", - "slice_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.register_channel" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager._register_core_services", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 32, - "span_end": 127, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "3e5811f3b511fa0cabe363f5d01f2ac5fa039bc8b93f7ee108323e1f5f45a293", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "972d6057a6caac9cf31ebc1e29c6f39f71b10d4cc170dec57cf875ba458549c6", - "dst_ref": "RuntimeManager._register_core_services", - "resolution": "resolved", - "slice_id": "3e5811f3b511fa0cabe363f5d01f2ac5fa039bc8b93f7ee108323e1f5f45a293", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager._register_core_services" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "972d6057a6caac9cf31ebc1e29c6f39f71b10d4cc170dec57cf875ba458549c6" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "class RuntimeManager\nRuntimeManager", - "layer": "C1_SYMBOL_CATALOG", - "title": "RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "7e4a9381328c5803bbc6179458612fc4e947d928aa7bf8b4b2bebb2c8592f758", - "qname": "RuntimeManager", - "kind": "class", - "signature": "RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.core.runtime", - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "class RuntimeManager:\n ACTION_TIMEOUT_SECONDS = 10.0\n ACTION_POLL_INTERVAL_SECONDS = 0.05\n\n def __init__(\n self,\n configuration: ConfigurationManager | None = None,\n services: ServiceContainer | None = None,\n traces: TraceService | None = None,\n health: HealthRegistry | None = None,\n logs: LogManager | None = None,\n workers: WorkerSupervisor | None = None,\n control_plane: ControlPlaneService | None = None,\n ) -> None:\n self.configuration = configuration or ConfigurationManager()\n self.services = services or ServiceContainer()\n self.traces = traces or TraceService()\n self.health = health or HealthRegistry()\n self.logs = logs or LogManager()\n self.workers = workers or WorkerSupervisor()\n self.control_plane = control_plane or ControlPlaneService()\n self.registry = ModuleRegistry(self.services)\n self._started = False\n self._state = LifecycleState.IDLE\n self._core_registered = False\n self._workers_registered = False\n self._register_core_services()\n\n def register_module(self, module: ApplicationModule) -> None:\n self.registry.register_module(module.name)\n module.register(self.registry)\n\n def add_config_file(self, path: str) -> FileConfigProvider:\n provider = FileConfigProvider(path)\n self.configuration.add_provider(provider)\n return provider\n\n def start(self, *, start_control_plane: bool = True) -> None:\n if self._started:\n return\n self._state = LifecycleState.STARTING\n config = self.configuration.load()\n self.logs.apply_config(config)\n self._register_health_contributors()\n self._register_workers()\n self.workers.start()\n if start_control_plane:\n self.control_plane.start(self)\n self._started = True\n self._refresh_state()\n\n def stop(self, timeout: float = 30.0, force: bool = False, stop_control_plane: bool = True) -> None:\n if not self._started:\n return\n self._state = LifecycleState.STOPPING\n self.workers.stop(timeout=timeout, force=force)\n if stop_control_plane:\n self.control_plane.stop()\n self._started = False\n self._state = LifecycleState.STOPPED\n\n def status(self) -> dict[str, object]:\n self._refresh_state()\n return self.control_plane.snapshot(self)\n\n def current_health(self) -> HealthPayload:\n self._refresh_state()\n return self.health.payload(self._state, self.workers.healths())\n\n async def health_status(self) -> HealthPayload:\n return self.current_health()\n\n async def start_runtime(self) -> dict[str, object] | str:\n self._refresh_state()\n if self._started:\n return \"runtime already running\"\n if self._state == LifecycleState.STOPPING:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n\n self.start(start_control_plane=False)\n started = self._wait_for_state({LifecycleState.IDLE, LifecycleState.BUSY}, timeout=self.ACTION_TIMEOUT_SECONDS)\n if started:\n return self._action_detail(\"runtime started\", timed_out=False)\n return self._action_detail(\"runtime start is still in progress\", timed_out=True)\n\n async def stop_runtime(self) -> dict[str, object] | str:\n self._refresh_state()\n if not self._started:\n if self._state == LifecycleState.STOPPING:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n return \"runtime already stopped\"\n\n self._state = LifecycleState.STOPPING\n try:\n self.workers.stop(timeout=self.ACTION_TIMEOUT_SECONDS, force=False)\n except TimeoutError:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n\n self._started = False\n self._state = LifecycleState.STOPPED\n return self._action_detail(\"runtime stopped\", timed_out=False)\n\n async def runtime_status(self) -> str:\n self._refresh_state()\n return self._state.value\n\n def _register_core_services(self) -> None:\n if self._core_registered:\n return\n self.services.register(\"configuration\", self.configuration)\n self.services.register(\"traces\", self.traces)\n self.services.register(\"health\", self.health)\n self.services.register(\"logs\", self.logs)\n self.services.register(\"workers\", self.workers)\n self.services.register(\"control_plane\", self.control_plane)\n self._core_registered = True\n\n def _register_health_contributors(self) -> None:\n for contributor in self.registry.health_contributors:\n self.health.register(contributor)\n\n def _register_workers(self) -> None:\n if self._workers_registered:\n return\n for worker in self.registry.workers:\n self.workers.register(worker)\n self._workers_registered = True\n\n def _refresh_state(self) -> None:\n lifecycle = self.workers.lifecycle_state()\n\n if self._state == LifecycleState.STOPPING:\n if lifecycle == LifecycleState.STOPPED:\n self._started = False\n self._state = LifecycleState.STOPPED\n return\n\n if not self._started:\n if lifecycle == LifecycleState.STOPPED:\n self._state = LifecycleState.STOPPED\n return\n\n self._state = lifecycle\n\n def _wait_for_state(self, target_states: set[LifecycleState], *, timeout: float) -> bool:\n deadline = monotonic() + timeout\n while monotonic() < deadline:\n self._refresh_state()\n if self._state in target_states:\n return True\n sleep(self.ACTION_POLL_INTERVAL_SECONDS)\n self._refresh_state()\n return self._state in target_states\n\n def _action_detail(self, message: str, *, timed_out: bool) -> dict[str, object]:\n self._refresh_state()\n return {\n \"message\": message,\n \"state\": self._state.value,\n \"timed_out\": timed_out,\n \"workers\": self.workers.snapshot(),\n }", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/core/runtime.py:RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.core.runtime", - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "llm_answer": "В подсистеме RuntimeManager участвуют следующие компоненты и устанавливаются явные связи между ними:\n\n1. RuntimeManager – центральный управляющий компонент, ответственный за координацию работы всей системы runtime. Он управляет состоянием приложения и отвечает за выполнение ключевых операций жизненного цикла, таких как инициализация конфигурации и запуск процессов.\n - Связи: чтение и запись атрибутов состояния (через конфигурационные данные и методы start).\n\n2. ControlActionSet – модель поведения или действия, выполняемые системой управления. Этот компонент играет роль дефолтного исполнителя для различных управляющих задач.\n - Связь: используется внутри RuntimeManager при выполнении действий управления.\n\n3. ControlPlaneService – сервис, обеспечивающий взаимодействие с плоскостью контроля. Его основная задача — управление каналами коммуникации и инициирование асинхронных процессов.\n - Связь: вызывается конструктором RuntimeManager через его метод `__init__`, обеспечивая начальную настройку среды выполнения.\n\nТаким образом, RuntimeManager выступает в качестве координатора всех основных операций системы runtime, взаимодействуя с внешними сервисами через ControlActionSet и другими необходимыми компонентами для корректной настройки и запуска приложения.", - "summary": { - "router": { - "intent": "CODE_QA", - "sub_intent": "ARCHITECTURE", - "confidence": null - }, - "retrieval": { - "profile": "code", - "layers_hit": [ - "C0_SOURCE_CHUNKS", - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS", - "C4_SEMANTIC_ROLES" - ], - "evidence_sufficient": true - }, - "llm": { - "answer_status": "answered", - "groundedness": "grounded" - } - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "ARCHITECTURE", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C4_SEMANTIC_ROLES", - "C3_ENTRYPOINTS", - "C2_DEPENDENCY_GRAPH", - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "RuntimeManager" - ], - "keyword_hints": [ - "RuntimeManager" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "execution": { - "executed_layers": [ - "C4_SEMANTIC_ROLES", - "C3_ENTRYPOINTS", - "C2_DEPENDENCY_GRAPH", - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS" - ], - "retrieval_mode_by_layer": { - "C4_SEMANTIC_ROLES": "exact_path_fetch", - "C3_ENTRYPOINTS": "exact_path_fetch", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C1_SYMBOL_CATALOG": "symbol_search", - "C0_SOURCE_CHUNKS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C4_SEMANTIC_ROLES": 12, - "C3_ENTRYPOINTS": 8, - "C2_DEPENDENCY_GRAPH": 8, - "C1_SYMBOL_CATALOG": 6, - "C0_SOURCE_CHUNKS": 4 - }, - "filters_by_layer": { - "C4_SEMANTIC_ROLES": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C1_SYMBOL_CATALOG": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C4_SEMANTIC_ROLES", - "query": "Какие компоненты участвуют в RuntimeManager?", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 12, - "ranking_profile": "code" - }, - { - "layer": "C3_ENTRYPOINTS", - "query": "Какие компоненты участвуют в RuntimeManager?", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "Какие компоненты участвуют в RuntimeManager?", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C1_SYMBOL_CATALOG", - "query": "RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Какие компоненты участвуют в RuntimeManager?", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 4, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C4_SEMANTIC_ROLES", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 12, - "candidates_after_filter": 12 - }, - { - "layer": "C3_ENTRYPOINTS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 3, - "candidates_after_filter": 3 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 1, - "candidates_after_filter": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 4, - "candidates_after_filter": 4 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "RuntimeManager", - "alternatives": [ - "RuntimeManager" - ] - }, - "layers": [ - { - "layer": "C4_SEMANTIC_ROLES", - "status": "hit", - "hit_count": 12, - "fail_reason": null - }, - { - "layer": "C3_ENTRYPOINTS", - "status": "hit", - "hit_count": 3, - "fail_reason": null - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 8, - "fail_reason": null - }, - { - "layer": "C1_SYMBOL_CATALOG", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 1, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "router": 0, - "symbol_resolution": 0, - "retrieval_total": 145, - "retrieval_by_layer": { - "C4_SEMANTIC_ROLES": 24, - "C3_ENTRYPOINTS": 17, - "C2_DEPENDENCY_GRAPH": 60, - "C1_SYMBOL_CATALOG": 24, - "C0_SOURCE_CHUNKS": 17 - }, - "merge_rank": 23, - "prompt_build": 0, - "llm_call": 1932 - }, - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 550, - "evidence_rows": 25, - "evidence_chars": 8651 - }, - "evidence_summary": [ - { - "layer": "C4_SEMANTIC_ROLES", - "count": 12, - "unique_paths": 11 - }, - { - "layer": "C3_ENTRYPOINTS", - "count": 3, - "unique_paths": 1 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "count": 8, - "unique_paths": 2 - }, - { - "layer": "C1_SYMBOL_CATALOG", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 1, - "unique_paths": 1 - } - ], - "prompt_template_id": "intent_code_qa_architecture_ru_v3", - "system_prompt_version": "v1" - }, - "router": { - "conversation_mode": "START", - "keyword_hints": [ - "RuntimeManager" - ], - "path_scope": [] - }, - "llm": { - "used_evidence_count": 25, - "missing_evidence_reason": null - } - }, - "run_info": { - "case_id": "plba-v2-architecture-runtime-manager", - "mode": "full_chain", - "run_started_at": "2026-03-12T14:07:09", - "rag_session_id": "7d11da21-faa0-4cea-aede-aeabe069164c", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - }, - "input_request": { - "text": "Какие компоненты участвуют в RuntimeManager?", - "normalized_query": "Какие компоненты участвуют в RuntimeManager?" - }, - "steps": [ - { - "step": "intent_router", - "input": { - "query": "Какие компоненты участвуют в RuntimeManager?" - }, - "output": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Какие компоненты участвуют в RuntimeManager?" - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "ARCHITECTURE", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C4_SEMANTIC_ROLES", - "C3_ENTRYPOINTS", - "C2_DEPENDENCY_GRAPH", - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "RuntimeManager" - ], - "keyword_hints": [ - "RuntimeManager" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "timings_ms": { - "router": 0 - } - } - }, - { - "step": "retrieval", - "input": { - "query": "Какие компоненты участвуют в RuntimeManager?" - }, - "output": { - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "RuntimeManager", - "alternatives": [ - "RuntimeManager" - ], - "confidence": 0.99 - }, - "rag_count": 25, - "rag_rows": [ - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests manager\n- orchestrates role-like calls (4)\n- reads and writes state attributes\n- participates in dataflow slices (50)", - "layer": "C4_SEMANTIC_ROLES", - "title": "RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 43, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "7e4a9381328c5803bbc6179458612fc4e947d928aa7bf8b4b2bebb2c8592f758", - "symbol_name": "RuntimeManager", - "qname": "RuntimeManager", - "role": "pipeline_stage", - "confidence": 0.67, - "dataflow_participation": 50, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "ControlActionSet\nrole: model\n\nResponsibilities:\n- default model role", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlActionSet", - "span_start": 14, - "span_end": 18, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 40, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "46eb026cb3313415ec47b82dd22f84f4d112c9d987e8b1716dcb0baa1cce8988", - "symbol_name": "ControlActionSet", - "qname": "ControlActionSet", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "ControlChannel\nrole: model\n\nResponsibilities:\n- default model role", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlChannel", - "span_start": 21, - "span_end": 28, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 40, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "cfcfe9a311d3a2dbdaf32ac4ccd73c0eb9a117f830591a1c0867ee97d46204ff", - "symbol_name": "ControlChannel", - "qname": "ControlChannel", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests service\n- reads and writes state attributes\n- participates in dataflow slices (5)", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlPlaneService", - "span_start": 12, - "span_end": 52, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 68, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "b13471e5916986dccffb53fab613812842965705e6b3a89ae549d30c9e91e9aa", - "symbol_name": "ControlPlaneService", - "qname": "ControlPlaneService", - "role": "pipeline_stage", - "confidence": 0.57, - "dataflow_participation": 5, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_runner.py", - "content": "UvicornThreadRunner\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (24)", - "layer": "C4_SEMANTIC_ROLES", - "title": "UvicornThreadRunner", - "span_start": 10, - "span_end": 61, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 11, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "fd55630045a02100df8877ac27d951ee08617d4598764394d48cb51fe067476a", - "symbol_name": "UvicornThreadRunner", - "qname": "UvicornThreadRunner", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 24, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "3779fdd2878b770e789a35bb2a89c9d79f13b61c26d7db1b3b683f9bb9e1623f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (10)", - "layer": "C4_SEMANTIC_ROLES", - "title": "HttpControlChannel", - "span_start": 12, - "span_end": 57, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 21, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "1c9fbdc24819e5604c26ea55428a74310f03a03e1af197ed84846af61e42fdb0", - "symbol_name": "HttpControlChannel", - "qname": "HttpControlChannel", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 10, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "HttpControlAppFactory\nrole: factory\n\nResponsibilities:\n- name suffix suggests factory", - "layer": "C4_SEMANTIC_ROLES", - "title": "HttpControlAppFactory", - "span_start": 15, - "span_end": 53, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 39, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "9b3502a5fb408b273223db13264349cf500de24915b6c649d9ea8970d0dfd8e0", - "symbol_name": "HttpControlAppFactory", - "qname": "HttpControlAppFactory", - "role": "factory", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/persistence/workflow_persistence.py", - "content": "WorkflowPersistence\nrole: pipeline_stage\n\nResponsibilities:\n- orchestrates role-like calls (2)\n- reads and writes state attributes\n- participates in dataflow slices (16)", - "layer": "C4_SEMANTIC_ROLES", - "title": "WorkflowPersistence", - "span_start": 8, - "span_end": 54, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 15, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "7bd01ee45cf31f2d5c2e3e51656254860ac785d10cef9e0852cd4fba90857bae", - "symbol_name": "WorkflowPersistence", - "qname": "WorkflowPersistence", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 16, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "80e9410ddc639789b4353c2a1a757ba8d0d5b5bb6075b0b263b61551f04ae1f0", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/queue/in_memory.py", - "content": "InMemoryTaskQueue\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (9)", - "layer": "C4_SEMANTIC_ROLES", - "title": "InMemoryTaskQueue", - "span_start": 9, - "span_end": 38, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 22, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "2da04cb94544a3bcbf0943a95ad4bdd8710bcafaa32a02fd0e4de2178dcf3533", - "symbol_name": "InMemoryTaskQueue", - "qname": "InMemoryTaskQueue", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 9, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "58f0cc001ccda0eee4c6bc32ed83bd05eafd6b6644f1e8b4aa9eed3103db73dc", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/config/file_loader.py", - "content": "ConfigFileLoader\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (8)", - "layer": "C4_SEMANTIC_ROLES", - "title": "ConfigFileLoader", - "span_start": 11, - "span_end": 48, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 23, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "a8474eca8b6e9dc86ae67ed68b16fa5fb639ef08739c053e7b7195489765667f", - "symbol_name": "ConfigFileLoader", - "qname": "ConfigFileLoader", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 8, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "1f19ffebde5e38e4be5a5d5a678059a0f36dedb8fb8b3e00ab395c67106a87ea", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/store.py", - "content": "TraceContextStore\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (6)", - "layer": "C4_SEMANTIC_ROLES", - "title": "TraceContextStore", - "span_start": 15, - "span_end": 52, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 25, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "b2dad4fbe16ffb11b58deba311c7739955c39d59f291b22181f33e9c8cce4059", - "symbol_name": "TraceContextStore", - "qname": "TraceContextStore", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 6, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "d369554f08fc92039c6edd5a2a1e73b23901533e8974459170bbd9347d263dc5", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workers/supervisor.py", - "content": "WorkerSupervisor\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (6)", - "layer": "C4_SEMANTIC_ROLES", - "title": "WorkerSupervisor", - "span_start": 10, - "span_end": 59, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 25, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "c17b44e8d9e97d490989b21fa67d7c346cdda8a0472e4c41fb243c8846faa124", - "symbol_name": "WorkerSupervisor", - "qname": "WorkerSupervisor", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 6, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "77609d9d5927171cce7fc3a54897c183fd63068710c6362029b700937aae5eee", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._start_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 47, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517", - "dst_ref": "ControlPlaneService._start_async", - "resolution": "resolved", - "slice_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._start_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager.start", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 32, - "span_end": 59, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "98312ace7fc62b1c7194c5aa1732b6ef736eae1668a3a120dd1ecd5ab1d64f7a", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "77a7b260193018845e4e204df094ab89cfd7c82ee4e822b3a83ad4cd945f9cb1", - "dst_ref": "RuntimeManager.start", - "resolution": "resolved", - "slice_id": "98312ace7fc62b1c7194c5aa1732b6ef736eae1668a3a120dd1ecd5ab1d64f7a", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager.start" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "77a7b260193018845e4e204df094ab89cfd7c82ee4e822b3a83ad4cd945f9cb1" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.start", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 20, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154", - "dst_ref": "ControlPlaneService.start", - "resolution": "resolved", - "slice_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.start" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.stop", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 25, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d", - "dst_ref": "ControlPlaneService.stop", - "resolution": "resolved", - "slice_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.stop" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._stop_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 51, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a", - "dst_ref": "ControlPlaneService._stop_async", - "resolution": "resolved", - "slice_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._stop_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager.add_config_file", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 32, - "span_end": 52, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "a23b8a11ebdb12708b60c96ea12a69f7f042082f1adfddd572444e246d81d167", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "57ffbd4f0d9fdf3507c2b8624312ce211f3d02fdf86a57a8ec90778d8a7b498d", - "dst_ref": "RuntimeManager.add_config_file", - "resolution": "resolved", - "slice_id": "a23b8a11ebdb12708b60c96ea12a69f7f042082f1adfddd572444e246d81d167", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager.add_config_file" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "57ffbd4f0d9fdf3507c2b8624312ce211f3d02fdf86a57a8ec90778d8a7b498d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.register_channel", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 17, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957", - "dst_ref": "ControlPlaneService.register_channel", - "resolution": "resolved", - "slice_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.register_channel" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager._register_core_services", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 32, - "span_end": 127, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "3e5811f3b511fa0cabe363f5d01f2ac5fa039bc8b93f7ee108323e1f5f45a293", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "972d6057a6caac9cf31ebc1e29c6f39f71b10d4cc170dec57cf875ba458549c6", - "dst_ref": "RuntimeManager._register_core_services", - "resolution": "resolved", - "slice_id": "3e5811f3b511fa0cabe363f5d01f2ac5fa039bc8b93f7ee108323e1f5f45a293", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager._register_core_services" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "972d6057a6caac9cf31ebc1e29c6f39f71b10d4cc170dec57cf875ba458549c6" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "class RuntimeManager\nRuntimeManager", - "layer": "C1_SYMBOL_CATALOG", - "title": "RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "7e4a9381328c5803bbc6179458612fc4e947d928aa7bf8b4b2bebb2c8592f758", - "qname": "RuntimeManager", - "kind": "class", - "signature": "RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.core.runtime", - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "class RuntimeManager:\n ACTION_TIMEOUT_SECONDS = 10.0\n ACTION_POLL_INTERVAL_SECONDS = 0.05\n\n def __init__(\n self,\n configuration: ConfigurationManager | None = None,\n services: ServiceContainer | None = None,\n traces: TraceService | None = None,\n health: HealthRegistry | None = None,\n logs: LogManager | None = None,\n workers: WorkerSupervisor | None = None,\n control_plane: ControlPlaneService | None = None,\n ) -> None:\n self.configuration = configuration or ConfigurationManager()\n self.services = services or ServiceContainer()\n self.traces = traces or TraceService()\n self.health = health or HealthRegistry()\n self.logs = logs or LogManager()\n self.workers = workers or WorkerSupervisor()\n self.control_plane = control_plane or ControlPlaneService()\n self.registry = ModuleRegistry(self.services)\n self._started = False\n self._state = LifecycleState.IDLE\n self._core_registered = False\n self._workers_registered = False\n self._register_core_services()\n\n def register_module(self, module: ApplicationModule) -> None:\n self.registry.register_module(module.name)\n module.register(self.registry)\n\n def add_config_file(self, path: str) -> FileConfigProvider:\n provider = FileConfigProvider(path)\n self.configuration.add_provider(provider)\n return provider\n\n def start(self, *, start_control_plane: bool = True) -> None:\n if self._started:\n return\n self._state = LifecycleState.STARTING\n config = self.configuration.load()\n self.logs.apply_config(config)\n self._register_health_contributors()\n self._register_workers()\n self.workers.start()\n if start_control_plane:\n self.control_plane.start(self)\n self._started = True\n self._refresh_state()\n\n def stop(self, timeout: float = 30.0, force: bool = False, stop_control_plane: bool = True) -> None:\n if not self._started:\n return\n self._state = LifecycleState.STOPPING\n self.workers.stop(timeout=timeout, force=force)\n if stop_control_plane:\n self.control_plane.stop()\n self._started = False\n self._state = LifecycleState.STOPPED\n\n def status(self) -> dict[str, object]:\n self._refresh_state()\n return self.control_plane.snapshot(self)\n\n def current_health(self) -> HealthPayload:\n self._refresh_state()\n return self.health.payload(self._state, self.workers.healths())\n\n async def health_status(self) -> HealthPayload:\n return self.current_health()\n\n async def start_runtime(self) -> dict[str, object] | str:\n self._refresh_state()\n if self._started:\n return \"runtime already running\"\n if self._state == LifecycleState.STOPPING:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n\n self.start(start_control_plane=False)\n started = self._wait_for_state({LifecycleState.IDLE, LifecycleState.BUSY}, timeout=self.ACTION_TIMEOUT_SECONDS)\n if started:\n return self._action_detail(\"runtime started\", timed_out=False)\n return self._action_detail(\"runtime start is still in progress\", timed_out=True)\n\n async def stop_runtime(self) -> dict[str, object] | str:\n self._refresh_state()\n if not self._started:\n if self._state == LifecycleState.STOPPING:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n return \"runtime already stopped\"\n\n self._state = LifecycleState.STOPPING\n try:\n self.workers.stop(timeout=self.ACTION_TIMEOUT_SECONDS, force=False)\n except TimeoutError:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n\n self._started = False\n self._state = LifecycleState.STOPPED\n return self._action_detail(\"runtime stopped\", timed_out=False)\n\n async def runtime_status(self) -> str:\n self._refresh_state()\n return self._state.value\n\n def _register_core_services(self) -> None:\n if self._core_registered:\n return\n self.services.register(\"configuration\", self.configuration)\n self.services.register(\"traces\", self.traces)\n self.services.register(\"health\", self.health)\n self.services.register(\"logs\", self.logs)\n self.services.register(\"workers\", self.workers)\n self.services.register(\"control_plane\", self.control_plane)\n self._core_registered = True\n\n def _register_health_contributors(self) -> None:\n for contributor in self.registry.health_contributors:\n self.health.register(contributor)\n\n def _register_workers(self) -> None:\n if self._workers_registered:\n return\n for worker in self.registry.workers:\n self.workers.register(worker)\n self._workers_registered = True\n\n def _refresh_state(self) -> None:\n lifecycle = self.workers.lifecycle_state()\n\n if self._state == LifecycleState.STOPPING:\n if lifecycle == LifecycleState.STOPPED:\n self._started = False\n self._state = LifecycleState.STOPPED\n return\n\n if not self._started:\n if lifecycle == LifecycleState.STOPPED:\n self._state = LifecycleState.STOPPED\n return\n\n self._state = lifecycle\n\n def _wait_for_state(self, target_states: set[LifecycleState], *, timeout: float) -> bool:\n deadline = monotonic() + timeout\n while monotonic() < deadline:\n self._refresh_state()\n if self._state in target_states:\n return True\n sleep(self.ACTION_POLL_INTERVAL_SECONDS)\n self._refresh_state()\n return self._state in target_states\n\n def _action_detail(self, message: str, *, timed_out: bool) -> dict[str, object]:\n self._refresh_state()\n return {\n \"message\": message,\n \"state\": self._state.value,\n \"timed_out\": timed_out,\n \"workers\": self.workers.snapshot(),\n }", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/core/runtime.py:RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.core.runtime", - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ] - }, - "diagnostics": { - "execution": { - "executed_layers": [ - "C4_SEMANTIC_ROLES", - "C3_ENTRYPOINTS", - "C2_DEPENDENCY_GRAPH", - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS" - ], - "retrieval_mode_by_layer": { - "C4_SEMANTIC_ROLES": "exact_path_fetch", - "C3_ENTRYPOINTS": "exact_path_fetch", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C1_SYMBOL_CATALOG": "symbol_search", - "C0_SOURCE_CHUNKS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C4_SEMANTIC_ROLES": 12, - "C3_ENTRYPOINTS": 8, - "C2_DEPENDENCY_GRAPH": 8, - "C1_SYMBOL_CATALOG": 6, - "C0_SOURCE_CHUNKS": 4 - }, - "filters_by_layer": { - "C4_SEMANTIC_ROLES": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C1_SYMBOL_CATALOG": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C4_SEMANTIC_ROLES", - "query": "Какие компоненты участвуют в RuntimeManager?", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 12, - "ranking_profile": "code" - }, - { - "layer": "C3_ENTRYPOINTS", - "query": "Какие компоненты участвуют в RuntimeManager?", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "Какие компоненты участвуют в RuntimeManager?", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C1_SYMBOL_CATALOG", - "query": "RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Какие компоненты участвуют в RuntimeManager?", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 4, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C4_SEMANTIC_ROLES", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 12, - "candidates_after_filter": 12 - }, - { - "layer": "C3_ENTRYPOINTS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 3, - "candidates_after_filter": 3 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 1, - "candidates_after_filter": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 4, - "candidates_after_filter": 4 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "RuntimeManager", - "alternatives": [ - "RuntimeManager" - ] - }, - "layers": [ - { - "layer": "C4_SEMANTIC_ROLES", - "status": "hit", - "hit_count": 12, - "fail_reason": null - }, - { - "layer": "C3_ENTRYPOINTS", - "status": "hit", - "hit_count": 3, - "fail_reason": null - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 8, - "fail_reason": null - }, - { - "layer": "C1_SYMBOL_CATALOG", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 1, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "symbol_resolution": 0, - "retrieval_total": 145, - "retrieval_by_layer": { - "C4_SEMANTIC_ROLES": 24, - "C3_ENTRYPOINTS": 17, - "C2_DEPENDENCY_GRAPH": 60, - "C1_SYMBOL_CATALOG": 24, - "C0_SOURCE_CHUNKS": 17 - }, - "merge_rank": 23 - } - } - }, - { - "step": "llm_answer", - "input": { - "query": "Какие компоненты участвуют в RuntimeManager?", - "rag_count": 25 - }, - "output": { - "llm_answer": "В подсистеме RuntimeManager участвуют следующие компоненты и устанавливаются явные связи между ними:\n\n1. RuntimeManager – центральный управляющий компонент, ответственный за координацию работы всей системы runtime. Он управляет состоянием приложения и отвечает за выполнение ключевых операций жизненного цикла, таких как инициализация конфигурации и запуск процессов.\n - Связи: чтение и запись атрибутов состояния (через конфигурационные данные и методы start).\n\n2. ControlActionSet – модель поведения или действия, выполняемые системой управления. Этот компонент играет роль дефолтного исполнителя для различных управляющих задач.\n - Связь: используется внутри RuntimeManager при выполнении действий управления.\n\n3. ControlPlaneService – сервис, обеспечивающий взаимодействие с плоскостью контроля. Его основная задача — управление каналами коммуникации и инициирование асинхронных процессов.\n - Связь: вызывается конструктором RuntimeManager через его метод `__init__`, обеспечивая начальную настройку среды выполнения.\n\nТаким образом, RuntimeManager выступает в качестве координатора всех основных операций системы runtime, взаимодействуя с внешними сервисами через ControlActionSet и другими необходимыми компонентами для корректной настройки и запуска приложения." - }, - "diagnostics": { - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 550, - "evidence_rows": 25, - "evidence_chars": 8651 - }, - "evidence_summary": [ - { - "layer": "C4_SEMANTIC_ROLES", - "count": 12, - "unique_paths": 11 - }, - { - "layer": "C3_ENTRYPOINTS", - "count": 3, - "unique_paths": 1 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "count": 8, - "unique_paths": 2 - }, - { - "layer": "C1_SYMBOL_CATALOG", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 1, - "unique_paths": 1 - } - ], - "prompt_template_id": "intent_code_qa_architecture_ru_v3", - "system_prompt_version": "v1" - }, - "timings_ms": { - "prompt_build": 0, - "llm_call": 1932 - } - } - } - ] - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_140708/full_chain_plba_code_subintents_v2_plba-v2-architecture-runtime-manager.md b/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_140708/full_chain_plba_code_subintents_v2_plba-v2-architecture-runtime-manager.md deleted file mode 100644 index 3e60d2e..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_140708/full_chain_plba_code_subintents_v2_plba-v2-architecture-runtime-manager.md +++ /dev/null @@ -1,34 +0,0 @@ -# plba-v2-architecture-runtime-manager - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_subintents_v2.yaml -- runner: runtime -- mode: full_chain -- passed: True - -## Query -Какие компоненты участвуют в RuntimeManager? - -## Actual -{ - "intent": "CODE_QA", - "sub_intent": "ARCHITECTURE", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 25, - "llm_answer": "В подсистеме RuntimeManager участвуют следующие компоненты и устанавливаются явные связи между ними:\n\n1. RuntimeManager – центральный управляющий компонент, ответственный за координацию работы всей системы runtime. Он управляет состоянием приложения и отвечает за выполнение ключевых операций жизненного цикла, таких как инициализация конфигурации и запуск процессов.\n - Связи: чтение и запись атрибутов состояния (через конфигурационные данные и методы start).\n\n2. ControlActionSet – модель поведения или действия, выполняемые системой управления. Этот компонент играет роль дефолтного исполнителя для различных управляющих задач.\n - Связь: используется внутри RuntimeManager при выполнении действий управления.\n\n3. ControlPlaneService – сервис, обеспечивающий взаимодействие с плоскостью контроля. Его основная задача — управление каналами коммуникации и инициирование асинхронных процессов.\n - Связь: вызывается конструктором RuntimeManager через его метод `__init__`, обеспечивая начальную настройку среды выполнения.\n\nТаким образом, RuntimeManager выступает в качестве координатора всех основных операций системы runtime, взаимодействуя с внешними сервисами через ControlActionSet и другими необходимыми компонентами для корректной настройки и запуска приложения.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "RuntimeManager" - ], - "layers": [ - "C4_SEMANTIC_ROLES", - "C3_ENTRYPOINTS", - "C2_DEPENDENCY_GRAPH", - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS" - ] -} - -## Mismatches -- none \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_140708/full_chain_plba_code_subintents_v2_plba-v2-explain-create-runtime.json b/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_140708/full_chain_plba_code_subintents_v2_plba-v2-explain-create-runtime.json deleted file mode 100644 index 3855c1e..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_140708/full_chain_plba_code_subintents_v2_plba-v2-explain-create-runtime.json +++ /dev/null @@ -1,1896 +0,0 @@ -{ - "case_id": "plba-v2-explain-create-runtime", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_subintents_v2.yaml", - "runner": "runtime", - "mode": "full_chain", - "actual": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 12, - "llm_answer": "Функция `create_runtime` находится в файле `src/plba/bootstrap.py`. Её задача – инициализировать объект типа `RuntimeManager`.\n\nРеальные шаги её работы выглядят так:\n1. Создаётся пустой экземпляр объекта `RuntimeManager`.\n2. Если передан параметр `config_path`, то вызовом метода `add_config_file` загружается конфигурационный файл.\n3. При включённой опции `enable_http_control` создаётся канал управления через HTTP (`HttpControlChannel`) и регистрируется в объекте `runtime.control_plane`.\n4. Регистрируется переданный модуль приложения при помощи вызова метода `register_module`.\n\nНа основании представленного контекста можно уверенно утверждать, что функция выполняет основные действия по настройке и регистрации конфигурации и модуля приложения в объекте менеджера выполнения задач (`RuntimeManager`). Косвенные признаки указывают на возможное использование этого объекта для координации выполнения различных компонентов системы.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "create_runtime" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "passed": true, - "mismatches": [], - "details": { - "case_id": "plba-v2-explain-create-runtime", - "text": "Что делает функция create_runtime?", - "mode": "full_chain", - "run_started_at": "2026-03-12T14:07:09", - "rag_session_id": "7d11da21-faa0-4cea-aede-aeabe069164c", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Что делает функция create_runtime?", - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "create_runtime", - "alternatives": [ - "create_runtime" - ], - "confidence": 0.99 - }, - "rag_count": 12, - "rag_rows": [ - { - "path": "src/plba/bootstrap.py", - "content": "function create_runtime\ncreate_runtime(module)", - "layer": "C1_SYMBOL_CATALOG", - "title": "create_runtime", - "span_start": 8, - "span_end": 29, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "qname": "create_runtime", - "kind": "function", - "signature": "create_runtime(module)", - "parent_symbol_id": null, - "package_or_module": "src.plba.bootstrap", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_runner.py", - "content": "UvicornThreadRunner\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (24)", - "layer": "C4_SEMANTIC_ROLES", - "title": "UvicornThreadRunner", - "span_start": 10, - "span_end": 61, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 11, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "fd55630045a02100df8877ac27d951ee08617d4598764394d48cb51fe067476a", - "symbol_name": "UvicornThreadRunner", - "qname": "UvicornThreadRunner", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 24, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "3779fdd2878b770e789a35bb2a89c9d79f13b61c26d7db1b3b683f9bb9e1623f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/bootstrap.py", - "content": "create_runtime calls runtime.add_config_file", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "create_runtime:calls", - "span_start": 19, - "span_end": 19, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "4eaeec4ac55a59d5f66fd01c4754955f8fedaf4bc3df13fa769b352c7bfaacbb", - "edge_type": "calls", - "src_symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "src_qname": "create_runtime", - "dst_symbol_id": null, - "dst_ref": "runtime.add_config_file", - "resolution": "partial", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/bootstrap.py", - "content": "create_runtime reads_attr runtime.register_module", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "create_runtime:reads_attr", - "span_start": 28, - "span_end": 28, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "45516c79ff358dbf9b650a081668df0f66d2fe989300f985a1a78be6be166f8f", - "edge_type": "reads_attr", - "src_symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "src_qname": "create_runtime", - "dst_symbol_id": null, - "dst_ref": "runtime.register_module", - "resolution": "partial", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/bootstrap.py", - "content": "create_runtime instantiates RuntimeManager", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "create_runtime:instantiates", - "span_start": 17, - "span_end": 17, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "0adba17984f850ea1608c9e734d2dd5c325cfde3a8133123aa239e44935ad18e", - "edge_type": "instantiates", - "src_symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "src_qname": "create_runtime", - "dst_symbol_id": "27158ca220022eeb5083c6addf8a50775d45f7161284fd60aac48410105f4b98", - "dst_ref": "RuntimeManager", - "resolution": "resolved", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/bootstrap.py", - "content": "create_runtime calls runtime.register_module", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "create_runtime:calls", - "span_start": 28, - "span_end": 28, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "ab6003c3441addc1ba1b81edeca009165559f652f6b2cf424e5ae61b1f617de8", - "edge_type": "calls", - "src_symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "src_qname": "create_runtime", - "dst_symbol_id": null, - "dst_ref": "runtime.register_module", - "resolution": "partial", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/bootstrap.py", - "content": "create_runtime calls runtime.control_plane.register_channel", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "create_runtime:calls", - "span_start": 21, - "span_end": 27, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "2678250030b9ce47a3b3b55fac7897ac530367edc8374ac9d5e6ecafb1e483f0", - "edge_type": "calls", - "src_symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "src_qname": "create_runtime", - "dst_symbol_id": null, - "dst_ref": "runtime.control_plane.register_channel", - "resolution": "partial", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/bootstrap.py", - "content": "create_runtime reads_attr runtime.add_config_file", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "create_runtime:reads_attr", - "span_start": 19, - "span_end": 19, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "30d4e8aae984ab84d523e80d02f1caeda52d547fa3d2aa47be8845931cabbca2", - "edge_type": "reads_attr", - "src_symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "src_qname": "create_runtime", - "dst_symbol_id": null, - "dst_ref": "runtime.add_config_file", - "resolution": "partial", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/bootstrap.py", - "content": "def create_runtime(\n module: ApplicationModule,\n *,\n config_path: str | None = None,\n enable_http_control: bool = False,\n control_host: str = \"127.0.0.1\",\n control_port: int = 8080,\n control_timeout: int = 5,\n) -> RuntimeManager:\n runtime = RuntimeManager()\n if config_path is not None:\n runtime.add_config_file(config_path)\n if enable_http_control:\n runtime.control_plane.register_channel(\n HttpControlChannel(\n host=control_host,\n port=control_port,\n timeout=control_timeout,\n )\n )\n runtime.register_module(module)\n return runtime", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/plba/bootstrap.py:create_runtime", - "span_start": 8, - "span_end": 29, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.plba.bootstrap", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "llm_answer": "Функция `create_runtime` находится в файле `src/plba/bootstrap.py`. Её задача – инициализировать объект типа `RuntimeManager`.\n\nРеальные шаги её работы выглядят так:\n1. Создаётся пустой экземпляр объекта `RuntimeManager`.\n2. Если передан параметр `config_path`, то вызовом метода `add_config_file` загружается конфигурационный файл.\n3. При включённой опции `enable_http_control` создаётся канал управления через HTTP (`HttpControlChannel`) и регистрируется в объекте `runtime.control_plane`.\n4. Регистрируется переданный модуль приложения при помощи вызова метода `register_module`.\n\nНа основании представленного контекста можно уверенно утверждать, что функция выполняет основные действия по настройке и регистрации конфигурации и модуля приложения в объекте менеджера выполнения задач (`RuntimeManager`). Косвенные признаки указывают на возможное использование этого объекта для координации выполнения различных компонентов системы.", - "summary": { - "router": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "confidence": null - }, - "retrieval": { - "profile": "code", - "layers_hit": [ - "C0_SOURCE_CHUNKS", - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS", - "C4_SEMANTIC_ROLES" - ], - "evidence_sufficient": true - }, - "llm": { - "answer_status": "answered", - "groundedness": "grounded" - } - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "symbol_kind_hint": "function", - "symbol_candidates": [ - "create_runtime" - ], - "keyword_hints": [ - "create_runtime" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C0_SOURCE_CHUNKS": "exact_path_fetch", - "C4_SEMANTIC_ROLES": "exact_path_fetch", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C3_ENTRYPOINTS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 8, - "C4_SEMANTIC_ROLES": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C3_ENTRYPOINTS": 6 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C4_SEMANTIC_ROLES": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "create_runtime", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "create_runtime", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C4_SEMANTIC_ROLES", - "query": "create_runtime", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "create_runtime", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - }, - { - "layer": "C3_ENTRYPOINTS", - "query": "create_runtime", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 1, - "candidates_after_filter": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 6, - "candidates_after_filter": 6 - }, - { - "layer": "C3_ENTRYPOINTS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 3, - "candidates_after_filter": 3 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "create_runtime", - "alternatives": [ - "create_runtime" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C4_SEMANTIC_ROLES", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 6, - "fail_reason": null - }, - { - "layer": "C3_ENTRYPOINTS", - "status": "hit", - "hit_count": 3, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "router": 0, - "symbol_resolution": 0, - "retrieval_total": 125, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 32, - "C0_SOURCE_CHUNKS": 17, - "C4_SEMANTIC_ROLES": 18, - "C2_DEPENDENCY_GRAPH": 45, - "C3_ENTRYPOINTS": 11 - }, - "merge_rank": 19, - "prompt_build": 0, - "llm_call": 1578 - }, - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 667, - "evidence_rows": 12, - "evidence_chars": 1184 - }, - "evidence_summary": [ - { - "layer": "C1_SYMBOL_CATALOG", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "count": 6, - "unique_paths": 1 - }, - { - "layer": "C3_ENTRYPOINTS", - "count": 3, - "unique_paths": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 1, - "unique_paths": 1 - } - ], - "prompt_template_id": "intent_code_qa_explain_ru_v3", - "system_prompt_version": "v1" - }, - "router": { - "conversation_mode": "START", - "keyword_hints": [ - "create_runtime" - ], - "path_scope": [] - }, - "llm": { - "used_evidence_count": 12, - "missing_evidence_reason": null - } - }, - "run_info": { - "case_id": "plba-v2-explain-create-runtime", - "mode": "full_chain", - "run_started_at": "2026-03-12T14:07:09", - "rag_session_id": "7d11da21-faa0-4cea-aede-aeabe069164c", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - }, - "input_request": { - "text": "Что делает функция create_runtime?", - "normalized_query": "Что делает функция create_runtime?" - }, - "steps": [ - { - "step": "intent_router", - "input": { - "query": "Что делает функция create_runtime?" - }, - "output": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Что делает функция create_runtime?" - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "symbol_kind_hint": "function", - "symbol_candidates": [ - "create_runtime" - ], - "keyword_hints": [ - "create_runtime" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "timings_ms": { - "router": 0 - } - } - }, - { - "step": "retrieval", - "input": { - "query": "Что делает функция create_runtime?" - }, - "output": { - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "create_runtime", - "alternatives": [ - "create_runtime" - ], - "confidence": 0.99 - }, - "rag_count": 12, - "rag_rows": [ - { - "path": "src/plba/bootstrap.py", - "content": "function create_runtime\ncreate_runtime(module)", - "layer": "C1_SYMBOL_CATALOG", - "title": "create_runtime", - "span_start": 8, - "span_end": 29, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "qname": "create_runtime", - "kind": "function", - "signature": "create_runtime(module)", - "parent_symbol_id": null, - "package_or_module": "src.plba.bootstrap", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_runner.py", - "content": "UvicornThreadRunner\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (24)", - "layer": "C4_SEMANTIC_ROLES", - "title": "UvicornThreadRunner", - "span_start": 10, - "span_end": 61, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 11, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "fd55630045a02100df8877ac27d951ee08617d4598764394d48cb51fe067476a", - "symbol_name": "UvicornThreadRunner", - "qname": "UvicornThreadRunner", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 24, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "3779fdd2878b770e789a35bb2a89c9d79f13b61c26d7db1b3b683f9bb9e1623f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/bootstrap.py", - "content": "create_runtime calls runtime.add_config_file", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "create_runtime:calls", - "span_start": 19, - "span_end": 19, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "4eaeec4ac55a59d5f66fd01c4754955f8fedaf4bc3df13fa769b352c7bfaacbb", - "edge_type": "calls", - "src_symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "src_qname": "create_runtime", - "dst_symbol_id": null, - "dst_ref": "runtime.add_config_file", - "resolution": "partial", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/bootstrap.py", - "content": "create_runtime reads_attr runtime.register_module", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "create_runtime:reads_attr", - "span_start": 28, - "span_end": 28, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "45516c79ff358dbf9b650a081668df0f66d2fe989300f985a1a78be6be166f8f", - "edge_type": "reads_attr", - "src_symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "src_qname": "create_runtime", - "dst_symbol_id": null, - "dst_ref": "runtime.register_module", - "resolution": "partial", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/bootstrap.py", - "content": "create_runtime instantiates RuntimeManager", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "create_runtime:instantiates", - "span_start": 17, - "span_end": 17, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "0adba17984f850ea1608c9e734d2dd5c325cfde3a8133123aa239e44935ad18e", - "edge_type": "instantiates", - "src_symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "src_qname": "create_runtime", - "dst_symbol_id": "27158ca220022eeb5083c6addf8a50775d45f7161284fd60aac48410105f4b98", - "dst_ref": "RuntimeManager", - "resolution": "resolved", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/bootstrap.py", - "content": "create_runtime calls runtime.register_module", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "create_runtime:calls", - "span_start": 28, - "span_end": 28, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "ab6003c3441addc1ba1b81edeca009165559f652f6b2cf424e5ae61b1f617de8", - "edge_type": "calls", - "src_symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "src_qname": "create_runtime", - "dst_symbol_id": null, - "dst_ref": "runtime.register_module", - "resolution": "partial", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/bootstrap.py", - "content": "create_runtime calls runtime.control_plane.register_channel", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "create_runtime:calls", - "span_start": 21, - "span_end": 27, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "2678250030b9ce47a3b3b55fac7897ac530367edc8374ac9d5e6ecafb1e483f0", - "edge_type": "calls", - "src_symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "src_qname": "create_runtime", - "dst_symbol_id": null, - "dst_ref": "runtime.control_plane.register_channel", - "resolution": "partial", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/bootstrap.py", - "content": "create_runtime reads_attr runtime.add_config_file", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "create_runtime:reads_attr", - "span_start": 19, - "span_end": 19, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "30d4e8aae984ab84d523e80d02f1caeda52d547fa3d2aa47be8845931cabbca2", - "edge_type": "reads_attr", - "src_symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "src_qname": "create_runtime", - "dst_symbol_id": null, - "dst_ref": "runtime.add_config_file", - "resolution": "partial", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/bootstrap.py", - "content": "def create_runtime(\n module: ApplicationModule,\n *,\n config_path: str | None = None,\n enable_http_control: bool = False,\n control_host: str = \"127.0.0.1\",\n control_port: int = 8080,\n control_timeout: int = 5,\n) -> RuntimeManager:\n runtime = RuntimeManager()\n if config_path is not None:\n runtime.add_config_file(config_path)\n if enable_http_control:\n runtime.control_plane.register_channel(\n HttpControlChannel(\n host=control_host,\n port=control_port,\n timeout=control_timeout,\n )\n )\n runtime.register_module(module)\n return runtime", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/plba/bootstrap.py:create_runtime", - "span_start": 8, - "span_end": 29, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.plba.bootstrap", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ] - }, - "diagnostics": { - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C0_SOURCE_CHUNKS": "exact_path_fetch", - "C4_SEMANTIC_ROLES": "exact_path_fetch", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C3_ENTRYPOINTS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 8, - "C4_SEMANTIC_ROLES": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C3_ENTRYPOINTS": 6 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C4_SEMANTIC_ROLES": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "create_runtime", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "create_runtime", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C4_SEMANTIC_ROLES", - "query": "create_runtime", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "create_runtime", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - }, - { - "layer": "C3_ENTRYPOINTS", - "query": "create_runtime", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 1, - "candidates_after_filter": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 6, - "candidates_after_filter": 6 - }, - { - "layer": "C3_ENTRYPOINTS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 3, - "candidates_after_filter": 3 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "create_runtime", - "alternatives": [ - "create_runtime" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C4_SEMANTIC_ROLES", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 6, - "fail_reason": null - }, - { - "layer": "C3_ENTRYPOINTS", - "status": "hit", - "hit_count": 3, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "symbol_resolution": 0, - "retrieval_total": 125, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 32, - "C0_SOURCE_CHUNKS": 17, - "C4_SEMANTIC_ROLES": 18, - "C2_DEPENDENCY_GRAPH": 45, - "C3_ENTRYPOINTS": 11 - }, - "merge_rank": 19 - } - } - }, - { - "step": "llm_answer", - "input": { - "query": "Что делает функция create_runtime?", - "rag_count": 12 - }, - "output": { - "llm_answer": "Функция `create_runtime` находится в файле `src/plba/bootstrap.py`. Её задача – инициализировать объект типа `RuntimeManager`.\n\nРеальные шаги её работы выглядят так:\n1. Создаётся пустой экземпляр объекта `RuntimeManager`.\n2. Если передан параметр `config_path`, то вызовом метода `add_config_file` загружается конфигурационный файл.\n3. При включённой опции `enable_http_control` создаётся канал управления через HTTP (`HttpControlChannel`) и регистрируется в объекте `runtime.control_plane`.\n4. Регистрируется переданный модуль приложения при помощи вызова метода `register_module`.\n\nНа основании представленного контекста можно уверенно утверждать, что функция выполняет основные действия по настройке и регистрации конфигурации и модуля приложения в объекте менеджера выполнения задач (`RuntimeManager`). Косвенные признаки указывают на возможное использование этого объекта для координации выполнения различных компонентов системы." - }, - "diagnostics": { - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 667, - "evidence_rows": 12, - "evidence_chars": 1184 - }, - "evidence_summary": [ - { - "layer": "C1_SYMBOL_CATALOG", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "count": 6, - "unique_paths": 1 - }, - { - "layer": "C3_ENTRYPOINTS", - "count": 3, - "unique_paths": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 1, - "unique_paths": 1 - } - ], - "prompt_template_id": "intent_code_qa_explain_ru_v3", - "system_prompt_version": "v1" - }, - "timings_ms": { - "prompt_build": 0, - "llm_call": 1578 - } - } - } - ] - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_140708/full_chain_plba_code_subintents_v2_plba-v2-explain-create-runtime.md b/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_140708/full_chain_plba_code_subintents_v2_plba-v2-explain-create-runtime.md deleted file mode 100644 index e21f672..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_140708/full_chain_plba_code_subintents_v2_plba-v2-explain-create-runtime.md +++ /dev/null @@ -1,34 +0,0 @@ -# plba-v2-explain-create-runtime - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_subintents_v2.yaml -- runner: runtime -- mode: full_chain -- passed: True - -## Query -Что делает функция create_runtime? - -## Actual -{ - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 12, - "llm_answer": "Функция `create_runtime` находится в файле `src/plba/bootstrap.py`. Её задача – инициализировать объект типа `RuntimeManager`.\n\nРеальные шаги её работы выглядят так:\n1. Создаётся пустой экземпляр объекта `RuntimeManager`.\n2. Если передан параметр `config_path`, то вызовом метода `add_config_file` загружается конфигурационный файл.\n3. При включённой опции `enable_http_control` создаётся канал управления через HTTP (`HttpControlChannel`) и регистрируется в объекте `runtime.control_plane`.\n4. Регистрируется переданный модуль приложения при помощи вызова метода `register_module`.\n\nНа основании представленного контекста можно уверенно утверждать, что функция выполняет основные действия по настройке и регистрации конфигурации и модуля приложения в объекте менеджера выполнения задач (`RuntimeManager`). Косвенные признаки указывают на возможное использование этого объекта для координации выполнения различных компонентов системы.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "create_runtime" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] -} - -## Mismatches -- none \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_140708/full_chain_plba_code_subintents_v2_plba-v2-explain-local-http-channel.json b/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_140708/full_chain_plba_code_subintents_v2_plba-v2-explain-local-http-channel.json deleted file mode 100644 index 35fef0d..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_140708/full_chain_plba_code_subintents_v2_plba-v2-explain-local-http-channel.json +++ /dev/null @@ -1,1333 +0,0 @@ -{ - "case_id": "plba-v2-explain-local-http-channel", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_subintents_v2.yaml", - "runner": "runtime", - "mode": "full_chain", - "actual": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN_LOCAL", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 6, - "llm_answer": "Класс `HttpControlChannel` из файла `http_channel.py` реализует механизм управления HTTP-каналами для взаимодействия с внешним миром приложения.\nЧто он делает:\n- При инициализации класса (`__init__`) создается объект `_runner`, управляющий сервером uvicorn (это веб-сервер на Python), и устанавливается таймаут соединения через параметр `timeout`.\n- Метод `start(actions)` запускает веб-приложение, передавая обработчики запросов на здоровье системы и выполнение действий (`_health_response` и `_action_response`), а также конфигурирует набор доступных команд (`actions`).\n- Метод `stop()` останавливает работу сервера.\n- Методы `_health_response` и `_action_response` возвращают ответы на запросы о состоянии системы и запросах на выполнение конкретных действий соответственно.\nВходные данные:\n- Параметры при создании объекта: строка `host`, целое число `port`, целое число `timeout`.\n- Набор действий (`actions`) передается через метод `start()`.\nВыходные данные:\n- Возвращаются асинхронно ответы на запросы состояния и выполнения действий.\n\nТаким образом, основная задача класса — предоставить интерфейс для работы с внешними клиентами через HTTP-запросы, обеспечивая возможность мониторинга состояния приложения и выполнения внешних операций.", - "answer_mode": "answered", - "path_scope": [ - "src/app_runtime/control/http_channel.py" - ], - "symbol_candidates": [ - "HttpControlChannel" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C2_DEPENDENCY_GRAPH" - ] - }, - "passed": true, - "mismatches": [], - "details": { - "case_id": "plba-v2-explain-local-http-channel", - "text": "Почему в файле src/app_runtime/control/http_channel.py класс HttpControlChannel устроен так?", - "mode": "full_chain", - "run_started_at": "2026-03-12T14:07:09", - "rag_session_id": "7d11da21-faa0-4cea-aede-aeabe069164c", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Почему в файле src/app_runtime/control/http_channel.py класс HttpControlChannel устроен так?", - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "HttpControlChannel", - "alternatives": [ - "HttpControlChannel" - ], - "confidence": 0.99 - }, - "rag_count": 6, - "rag_rows": [ - { - "path": "src/app_runtime/control/http_channel.py", - "content": "class HttpControlChannel\nHttpControlChannel(ControlChannel)", - "layer": "C1_SYMBOL_CATALOG", - "title": "HttpControlChannel", - "span_start": 12, - "span_end": 57, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "1c9fbdc24819e5604c26ea55428a74310f03a03e1af197ed84846af61e42fdb0", - "qname": "HttpControlChannel", - "kind": "class", - "signature": "HttpControlChannel(ControlChannel)", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.control.http_channel", - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel.__init__\n -> HttpControlChannel._timeout\n -> HttpControlChannel._action_response", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "HttpControlChannel.__init__:dataflow_slice", - "span_start": 14, - "span_end": 47, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "c3ef21fcae96c82c00be74b3ab827d4af2085d89cb3fa5521c19a174aad84dbb", - "edge_type": "dataflow_slice", - "src_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "src_qname": "HttpControlChannel.__init__", - "dst_symbol_id": "e64969024ccaeb34d8d91473fad07b3b3d341875846392e7a006406c7ada1954", - "dst_ref": "HttpControlChannel._action_response", - "resolution": "resolved", - "slice_id": "c3ef21fcae96c82c00be74b3ab827d4af2085d89cb3fa5521c19a174aad84dbb", - "root_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "path_symbols": [ - "HttpControlChannel.__init__", - "HttpControlChannel._timeout", - "HttpControlChannel._action_response" - ], - "path_symbol_ids": [ - "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "e64969024ccaeb34d8d91473fad07b3b3d341875846392e7a006406c7ada1954" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel.__init__\n -> HttpControlChannel._runner\n -> HttpControlChannel.start", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "HttpControlChannel.__init__:dataflow_slice", - "span_start": 15, - "span_end": 22, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "51d73913df709152258ed1b9a8c8f4eb3c575eccfe6b982aef0b28e0789a29da", - "edge_type": "dataflow_slice", - "src_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "src_qname": "HttpControlChannel.__init__", - "dst_symbol_id": "d1933f04137f52535b6525f1b93ff2cd83bfb216b480e887e791ed1714cda8e0", - "dst_ref": "HttpControlChannel.start", - "resolution": "resolved", - "slice_id": "51d73913df709152258ed1b9a8c8f4eb3c575eccfe6b982aef0b28e0789a29da", - "root_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "path_symbols": [ - "HttpControlChannel.__init__", - "HttpControlChannel._runner", - "HttpControlChannel.start" - ], - "path_symbol_ids": [ - "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "d1933f04137f52535b6525f1b93ff2cd83bfb216b480e887e791ed1714cda8e0" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel.__init__\n -> HttpControlChannel._timeout\n -> HttpControlChannel._health_response", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "HttpControlChannel.__init__:dataflow_slice", - "span_start": 14, - "span_end": 34, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "f858f5c9e575f6c4cdfe3853571b7ee21d1f628a443541d2037c3dc9d0790bef", - "edge_type": "dataflow_slice", - "src_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "src_qname": "HttpControlChannel.__init__", - "dst_symbol_id": "e84bf04e9cd2127df235b7064d05f47e19f19a89c7c82f4c247231d4e8fa426a", - "dst_ref": "HttpControlChannel._health_response", - "resolution": "resolved", - "slice_id": "f858f5c9e575f6c4cdfe3853571b7ee21d1f628a443541d2037c3dc9d0790bef", - "root_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "path_symbols": [ - "HttpControlChannel.__init__", - "HttpControlChannel._timeout", - "HttpControlChannel._health_response" - ], - "path_symbol_ids": [ - "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "e84bf04e9cd2127df235b7064d05f47e19f19a89c7c82f4c247231d4e8fa426a" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel.__init__\n -> HttpControlChannel._runner\n -> HttpControlChannel.stop", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "HttpControlChannel.__init__:dataflow_slice", - "span_start": 15, - "span_end": 25, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "0f827ef81a990258a8a74381c8564a8361afa6712dba3200592659c939adcb9d", - "edge_type": "dataflow_slice", - "src_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "src_qname": "HttpControlChannel.__init__", - "dst_symbol_id": "f29ab212620093d72be20e26c5a399624c7939a6056a728762ed3f84a250bfa3", - "dst_ref": "HttpControlChannel.stop", - "resolution": "resolved", - "slice_id": "0f827ef81a990258a8a74381c8564a8361afa6712dba3200592659c939adcb9d", - "root_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "path_symbols": [ - "HttpControlChannel.__init__", - "HttpControlChannel._runner", - "HttpControlChannel.stop" - ], - "path_symbol_ids": [ - "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "f29ab212620093d72be20e26c5a399624c7939a6056a728762ed3f84a250bfa3" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "class HttpControlChannel(ControlChannel):\n def __init__(self, host: str, port: int, timeout: int) -> None:\n self._timeout = timeout\n self._runner = UvicornThreadRunner(host, port, timeout)\n self._factory = HttpControlAppFactory()\n self._actions: ControlActionSet | None = None\n\n async def start(self, actions: ControlActionSet) -> None:\n self._actions = actions\n app = self._factory.create(self._health_response, self._action_response)\n await self._runner.start(app)\n\n async def stop(self) -> None:\n await self._runner.stop()\n\n @property\n def port(self) -> int:\n return self._runner.port\n\n async def _health_response(self) -> dict[str, object]:\n if self._actions is None:\n return {\"status\": \"unhealthy\", \"detail\": \"control actions are not configured\"}\n return await asyncio.wait_for(self._actions.health(), timeout=float(self._timeout))\n\n async def _action_response(self, action: str, _client_source: str = \"unknown\") -> JSONResponse:\n if self._actions is None:\n return JSONResponse(content={\"status\": \"error\", \"detail\": f\"{action} handler is not configured\"}, status_code=404)\n callbacks = {\n \"start\": self._actions.start,\n \"stop\": self._actions.stop,\n \"status\": self._actions.status,\n }\n callback = callbacks.get(action)\n if callback is None:\n return JSONResponse(content={\"status\": \"error\", \"detail\": f\"unsupported action: {action}\"}, status_code=404)\n action_timeout = max(float(self._timeout), 10.0) if action in {\"start\", \"stop\"} else float(self._timeout)\n try:\n detail = await asyncio.wait_for(callback(), timeout=action_timeout)\n except asyncio.TimeoutError:\n return JSONResponse(\n content={\"status\": \"accepted\", \"detail\": f\"{action} operation is still in progress\"},\n status_code=202,\n )\n except Exception as exc:\n return JSONResponse(content={\"status\": \"error\", \"detail\": str(exc)}, status_code=500)\n return JSONResponse(content={\"status\": \"ok\", \"detail\": detail or f\"{action} action accepted\"}, status_code=200)", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/http_channel.py:HttpControlChannel", - "span_start": 12, - "span_end": 57, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.http_channel", - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "llm_answer": "Класс `HttpControlChannel` из файла `http_channel.py` реализует механизм управления HTTP-каналами для взаимодействия с внешним миром приложения.\nЧто он делает:\n- При инициализации класса (`__init__`) создается объект `_runner`, управляющий сервером uvicorn (это веб-сервер на Python), и устанавливается таймаут соединения через параметр `timeout`.\n- Метод `start(actions)` запускает веб-приложение, передавая обработчики запросов на здоровье системы и выполнение действий (`_health_response` и `_action_response`), а также конфигурирует набор доступных команд (`actions`).\n- Метод `stop()` останавливает работу сервера.\n- Методы `_health_response` и `_action_response` возвращают ответы на запросы о состоянии системы и запросах на выполнение конкретных действий соответственно.\nВходные данные:\n- Параметры при создании объекта: строка `host`, целое число `port`, целое число `timeout`.\n- Набор действий (`actions`) передается через метод `start()`.\nВыходные данные:\n- Возвращаются асинхронно ответы на запросы состояния и выполнения действий.\n\nТаким образом, основная задача класса — предоставить интерфейс для работы с внешними клиентами через HTTP-запросы, обеспечивая возможность мониторинга состояния приложения и выполнения внешних операций.", - "summary": { - "router": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN_LOCAL", - "confidence": null - }, - "retrieval": { - "profile": "code", - "layers_hit": [ - "C0_SOURCE_CHUNKS", - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH" - ], - "evidence_sufficient": true - }, - "llm": { - "answer_status": "answered", - "groundedness": "grounded" - } - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN_LOCAL", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C2_DEPENDENCY_GRAPH" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "HttpControlChannel" - ], - "keyword_hints": [ - "src/app_runtime/control/http_channel.py", - "HttpControlChannel" - ], - "path_hints": [ - "src/app_runtime/control/http_channel.py" - ], - "path_scope": [ - "src/app_runtime/control/http_channel.py" - ], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C2_DEPENDENCY_GRAPH" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C0_SOURCE_CHUNKS": "exact_path_fetch", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 12, - "C2_DEPENDENCY_GRAPH": 4 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [ - "src/app_runtime/control/http_channel.py" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src/app_runtime/control/http_channel.py" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src/app_runtime/control/http_channel.py" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "HttpControlChannel", - "path_scope": [ - "src/app_runtime/control/http_channel.py" - ], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Почему в файле src/app_runtime/control/http_channel.py класс HttpControlChannel устроен так?", - "path_scope": [ - "src/app_runtime/control/http_channel.py" - ], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 12, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "Почему в файле src/app_runtime/control/http_channel.py класс HttpControlChannel устроен так?", - "path_scope": [ - "src/app_runtime/control/http_channel.py" - ], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 4, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [ - "src/app_runtime/control/http_channel.py" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 1, - "candidates_after_filter": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src/app_runtime/control/http_channel.py" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 1, - "candidates_after_filter": 1 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src/app_runtime/control/http_channel.py" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 4, - "candidates_after_filter": 4 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "HttpControlChannel", - "alternatives": [ - "HttpControlChannel" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 4, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "router": 0, - "symbol_resolution": 0, - "retrieval_total": 70, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 33, - "C0_SOURCE_CHUNKS": 18, - "C2_DEPENDENCY_GRAPH": 17 - }, - "merge_rank": 37, - "prompt_build": 0, - "llm_call": 2085 - }, - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 877, - "evidence_rows": 6, - "evidence_chars": 2660 - }, - "evidence_summary": [ - { - "layer": "C1_SYMBOL_CATALOG", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "count": 4, - "unique_paths": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 1, - "unique_paths": 1 - } - ], - "prompt_template_id": "intent_code_qa_explain_local_ru_v3", - "system_prompt_version": "v1" - }, - "router": { - "conversation_mode": "START", - "keyword_hints": [ - "src/app_runtime/control/http_channel.py", - "HttpControlChannel" - ], - "path_scope": [ - "src/app_runtime/control/http_channel.py" - ] - }, - "llm": { - "used_evidence_count": 6, - "missing_evidence_reason": null - } - }, - "run_info": { - "case_id": "plba-v2-explain-local-http-channel", - "mode": "full_chain", - "run_started_at": "2026-03-12T14:07:09", - "rag_session_id": "7d11da21-faa0-4cea-aede-aeabe069164c", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - }, - "input_request": { - "text": "Почему в файле src/app_runtime/control/http_channel.py класс HttpControlChannel устроен так?", - "normalized_query": "Почему в файле src/app_runtime/control/http_channel.py класс HttpControlChannel устроен так?" - }, - "steps": [ - { - "step": "intent_router", - "input": { - "query": "Почему в файле src/app_runtime/control/http_channel.py класс HttpControlChannel устроен так?" - }, - "output": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Почему в файле src/app_runtime/control/http_channel.py класс HttpControlChannel устроен так?" - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN_LOCAL", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C2_DEPENDENCY_GRAPH" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "HttpControlChannel" - ], - "keyword_hints": [ - "src/app_runtime/control/http_channel.py", - "HttpControlChannel" - ], - "path_hints": [ - "src/app_runtime/control/http_channel.py" - ], - "path_scope": [ - "src/app_runtime/control/http_channel.py" - ], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "timings_ms": { - "router": 0 - } - } - }, - { - "step": "retrieval", - "input": { - "query": "Почему в файле src/app_runtime/control/http_channel.py класс HttpControlChannel устроен так?" - }, - "output": { - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "HttpControlChannel", - "alternatives": [ - "HttpControlChannel" - ], - "confidence": 0.99 - }, - "rag_count": 6, - "rag_rows": [ - { - "path": "src/app_runtime/control/http_channel.py", - "content": "class HttpControlChannel\nHttpControlChannel(ControlChannel)", - "layer": "C1_SYMBOL_CATALOG", - "title": "HttpControlChannel", - "span_start": 12, - "span_end": 57, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "1c9fbdc24819e5604c26ea55428a74310f03a03e1af197ed84846af61e42fdb0", - "qname": "HttpControlChannel", - "kind": "class", - "signature": "HttpControlChannel(ControlChannel)", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.control.http_channel", - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel.__init__\n -> HttpControlChannel._timeout\n -> HttpControlChannel._action_response", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "HttpControlChannel.__init__:dataflow_slice", - "span_start": 14, - "span_end": 47, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "c3ef21fcae96c82c00be74b3ab827d4af2085d89cb3fa5521c19a174aad84dbb", - "edge_type": "dataflow_slice", - "src_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "src_qname": "HttpControlChannel.__init__", - "dst_symbol_id": "e64969024ccaeb34d8d91473fad07b3b3d341875846392e7a006406c7ada1954", - "dst_ref": "HttpControlChannel._action_response", - "resolution": "resolved", - "slice_id": "c3ef21fcae96c82c00be74b3ab827d4af2085d89cb3fa5521c19a174aad84dbb", - "root_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "path_symbols": [ - "HttpControlChannel.__init__", - "HttpControlChannel._timeout", - "HttpControlChannel._action_response" - ], - "path_symbol_ids": [ - "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "e64969024ccaeb34d8d91473fad07b3b3d341875846392e7a006406c7ada1954" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel.__init__\n -> HttpControlChannel._runner\n -> HttpControlChannel.start", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "HttpControlChannel.__init__:dataflow_slice", - "span_start": 15, - "span_end": 22, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "51d73913df709152258ed1b9a8c8f4eb3c575eccfe6b982aef0b28e0789a29da", - "edge_type": "dataflow_slice", - "src_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "src_qname": "HttpControlChannel.__init__", - "dst_symbol_id": "d1933f04137f52535b6525f1b93ff2cd83bfb216b480e887e791ed1714cda8e0", - "dst_ref": "HttpControlChannel.start", - "resolution": "resolved", - "slice_id": "51d73913df709152258ed1b9a8c8f4eb3c575eccfe6b982aef0b28e0789a29da", - "root_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "path_symbols": [ - "HttpControlChannel.__init__", - "HttpControlChannel._runner", - "HttpControlChannel.start" - ], - "path_symbol_ids": [ - "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "d1933f04137f52535b6525f1b93ff2cd83bfb216b480e887e791ed1714cda8e0" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel.__init__\n -> HttpControlChannel._timeout\n -> HttpControlChannel._health_response", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "HttpControlChannel.__init__:dataflow_slice", - "span_start": 14, - "span_end": 34, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "f858f5c9e575f6c4cdfe3853571b7ee21d1f628a443541d2037c3dc9d0790bef", - "edge_type": "dataflow_slice", - "src_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "src_qname": "HttpControlChannel.__init__", - "dst_symbol_id": "e84bf04e9cd2127df235b7064d05f47e19f19a89c7c82f4c247231d4e8fa426a", - "dst_ref": "HttpControlChannel._health_response", - "resolution": "resolved", - "slice_id": "f858f5c9e575f6c4cdfe3853571b7ee21d1f628a443541d2037c3dc9d0790bef", - "root_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "path_symbols": [ - "HttpControlChannel.__init__", - "HttpControlChannel._timeout", - "HttpControlChannel._health_response" - ], - "path_symbol_ids": [ - "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "e84bf04e9cd2127df235b7064d05f47e19f19a89c7c82f4c247231d4e8fa426a" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel.__init__\n -> HttpControlChannel._runner\n -> HttpControlChannel.stop", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "HttpControlChannel.__init__:dataflow_slice", - "span_start": 15, - "span_end": 25, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "0f827ef81a990258a8a74381c8564a8361afa6712dba3200592659c939adcb9d", - "edge_type": "dataflow_slice", - "src_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "src_qname": "HttpControlChannel.__init__", - "dst_symbol_id": "f29ab212620093d72be20e26c5a399624c7939a6056a728762ed3f84a250bfa3", - "dst_ref": "HttpControlChannel.stop", - "resolution": "resolved", - "slice_id": "0f827ef81a990258a8a74381c8564a8361afa6712dba3200592659c939adcb9d", - "root_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "path_symbols": [ - "HttpControlChannel.__init__", - "HttpControlChannel._runner", - "HttpControlChannel.stop" - ], - "path_symbol_ids": [ - "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "f29ab212620093d72be20e26c5a399624c7939a6056a728762ed3f84a250bfa3" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "class HttpControlChannel(ControlChannel):\n def __init__(self, host: str, port: int, timeout: int) -> None:\n self._timeout = timeout\n self._runner = UvicornThreadRunner(host, port, timeout)\n self._factory = HttpControlAppFactory()\n self._actions: ControlActionSet | None = None\n\n async def start(self, actions: ControlActionSet) -> None:\n self._actions = actions\n app = self._factory.create(self._health_response, self._action_response)\n await self._runner.start(app)\n\n async def stop(self) -> None:\n await self._runner.stop()\n\n @property\n def port(self) -> int:\n return self._runner.port\n\n async def _health_response(self) -> dict[str, object]:\n if self._actions is None:\n return {\"status\": \"unhealthy\", \"detail\": \"control actions are not configured\"}\n return await asyncio.wait_for(self._actions.health(), timeout=float(self._timeout))\n\n async def _action_response(self, action: str, _client_source: str = \"unknown\") -> JSONResponse:\n if self._actions is None:\n return JSONResponse(content={\"status\": \"error\", \"detail\": f\"{action} handler is not configured\"}, status_code=404)\n callbacks = {\n \"start\": self._actions.start,\n \"stop\": self._actions.stop,\n \"status\": self._actions.status,\n }\n callback = callbacks.get(action)\n if callback is None:\n return JSONResponse(content={\"status\": \"error\", \"detail\": f\"unsupported action: {action}\"}, status_code=404)\n action_timeout = max(float(self._timeout), 10.0) if action in {\"start\", \"stop\"} else float(self._timeout)\n try:\n detail = await asyncio.wait_for(callback(), timeout=action_timeout)\n except asyncio.TimeoutError:\n return JSONResponse(\n content={\"status\": \"accepted\", \"detail\": f\"{action} operation is still in progress\"},\n status_code=202,\n )\n except Exception as exc:\n return JSONResponse(content={\"status\": \"error\", \"detail\": str(exc)}, status_code=500)\n return JSONResponse(content={\"status\": \"ok\", \"detail\": detail or f\"{action} action accepted\"}, status_code=200)", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/http_channel.py:HttpControlChannel", - "span_start": 12, - "span_end": 57, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.http_channel", - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ] - }, - "diagnostics": { - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C2_DEPENDENCY_GRAPH" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C0_SOURCE_CHUNKS": "exact_path_fetch", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 12, - "C2_DEPENDENCY_GRAPH": 4 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [ - "src/app_runtime/control/http_channel.py" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src/app_runtime/control/http_channel.py" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src/app_runtime/control/http_channel.py" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "HttpControlChannel", - "path_scope": [ - "src/app_runtime/control/http_channel.py" - ], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Почему в файле src/app_runtime/control/http_channel.py класс HttpControlChannel устроен так?", - "path_scope": [ - "src/app_runtime/control/http_channel.py" - ], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 12, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "Почему в файле src/app_runtime/control/http_channel.py класс HttpControlChannel устроен так?", - "path_scope": [ - "src/app_runtime/control/http_channel.py" - ], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 4, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [ - "src/app_runtime/control/http_channel.py" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 1, - "candidates_after_filter": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src/app_runtime/control/http_channel.py" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 1, - "candidates_after_filter": 1 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src/app_runtime/control/http_channel.py" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 4, - "candidates_after_filter": 4 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "HttpControlChannel", - "alternatives": [ - "HttpControlChannel" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 4, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "symbol_resolution": 0, - "retrieval_total": 70, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 33, - "C0_SOURCE_CHUNKS": 18, - "C2_DEPENDENCY_GRAPH": 17 - }, - "merge_rank": 37 - } - } - }, - { - "step": "llm_answer", - "input": { - "query": "Почему в файле src/app_runtime/control/http_channel.py класс HttpControlChannel устроен так?", - "rag_count": 6 - }, - "output": { - "llm_answer": "Класс `HttpControlChannel` из файла `http_channel.py` реализует механизм управления HTTP-каналами для взаимодействия с внешним миром приложения.\nЧто он делает:\n- При инициализации класса (`__init__`) создается объект `_runner`, управляющий сервером uvicorn (это веб-сервер на Python), и устанавливается таймаут соединения через параметр `timeout`.\n- Метод `start(actions)` запускает веб-приложение, передавая обработчики запросов на здоровье системы и выполнение действий (`_health_response` и `_action_response`), а также конфигурирует набор доступных команд (`actions`).\n- Метод `stop()` останавливает работу сервера.\n- Методы `_health_response` и `_action_response` возвращают ответы на запросы о состоянии системы и запросах на выполнение конкретных действий соответственно.\nВходные данные:\n- Параметры при создании объекта: строка `host`, целое число `port`, целое число `timeout`.\n- Набор действий (`actions`) передается через метод `start()`.\nВыходные данные:\n- Возвращаются асинхронно ответы на запросы состояния и выполнения действий.\n\nТаким образом, основная задача класса — предоставить интерфейс для работы с внешними клиентами через HTTP-запросы, обеспечивая возможность мониторинга состояния приложения и выполнения внешних операций." - }, - "diagnostics": { - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 877, - "evidence_rows": 6, - "evidence_chars": 2660 - }, - "evidence_summary": [ - { - "layer": "C1_SYMBOL_CATALOG", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "count": 4, - "unique_paths": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 1, - "unique_paths": 1 - } - ], - "prompt_template_id": "intent_code_qa_explain_local_ru_v3", - "system_prompt_version": "v1" - }, - "timings_ms": { - "prompt_build": 0, - "llm_call": 2085 - } - } - } - ] - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_140708/full_chain_plba_code_subintents_v2_plba-v2-explain-local-http-channel.md b/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_140708/full_chain_plba_code_subintents_v2_plba-v2-explain-local-http-channel.md deleted file mode 100644 index 6690454..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_140708/full_chain_plba_code_subintents_v2_plba-v2-explain-local-http-channel.md +++ /dev/null @@ -1,34 +0,0 @@ -# plba-v2-explain-local-http-channel - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_subintents_v2.yaml -- runner: runtime -- mode: full_chain -- passed: True - -## Query -Почему в файле src/app_runtime/control/http_channel.py класс HttpControlChannel устроен так? - -## Actual -{ - "intent": "CODE_QA", - "sub_intent": "EXPLAIN_LOCAL", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 6, - "llm_answer": "Класс `HttpControlChannel` из файла `http_channel.py` реализует механизм управления HTTP-каналами для взаимодействия с внешним миром приложения.\nЧто он делает:\n- При инициализации класса (`__init__`) создается объект `_runner`, управляющий сервером uvicorn (это веб-сервер на Python), и устанавливается таймаут соединения через параметр `timeout`.\n- Метод `start(actions)` запускает веб-приложение, передавая обработчики запросов на здоровье системы и выполнение действий (`_health_response` и `_action_response`), а также конфигурирует набор доступных команд (`actions`).\n- Метод `stop()` останавливает работу сервера.\n- Методы `_health_response` и `_action_response` возвращают ответы на запросы о состоянии системы и запросах на выполнение конкретных действий соответственно.\nВходные данные:\n- Параметры при создании объекта: строка `host`, целое число `port`, целое число `timeout`.\n- Набор действий (`actions`) передается через метод `start()`.\nВыходные данные:\n- Возвращаются асинхронно ответы на запросы состояния и выполнения действий.\n\nТаким образом, основная задача класса — предоставить интерфейс для работы с внешними клиентами через HTTP-запросы, обеспечивая возможность мониторинга состояния приложения и выполнения внешних операций.", - "answer_mode": "answered", - "path_scope": [ - "src/app_runtime/control/http_channel.py" - ], - "symbol_candidates": [ - "HttpControlChannel" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C2_DEPENDENCY_GRAPH" - ] -} - -## Mismatches -- none \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_140708/full_chain_plba_code_subintents_v2_plba-v2-explain-nonexistent-symbol.json b/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_140708/full_chain_plba_code_subintents_v2_plba-v2-explain-nonexistent-symbol.json deleted file mode 100644 index 02f429f..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_140708/full_chain_plba_code_subintents_v2_plba-v2-explain-nonexistent-symbol.json +++ /dev/null @@ -1,1182 +0,0 @@ -{ - "case_id": "plba-v2-explain-nonexistent-symbol", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_subintents_v2.yaml", - "runner": "runtime", - "mode": "full_chain", - "actual": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 0, - "llm_answer": "Класс `RuntimeFactoryManager` не найден в предоставленном контексте. Учитывая, что контекста недостаточно для прямого анализа, я не могу точно подтвердить наличие этого класса или объяснить его работу на основе доступных данных.\n\nТем не менее, исходя из названия, можно сделать осторожный вывод о возможном предназначении данного класса:\n\n1. Назначение: \n Вероятно, этот класс предназначен для управления фабриками (factory) или создания экземпляров различных runtime-компонентов во время выполнения программы. Это может включать настройку и инициализацию объектов, регистрацию фабрик или управление жизненным циклом компонентов.\n\n2. Возможные функции:\n - Управление созданием и регистрацией фабрик для разных типов компонентов.\n - Предоставление интерфейса для динамического получения инстансов конкретных классов или объектов по запросу.\n - Возможное кэширование созданных экземпляров или их отслеживание через механизм регистрации.\n\nОднако без доступа к исходному коду или документации невозможно точно утверждать детали реализации и функциональность класса `RuntimeFactoryManager`.", - "answer_mode": "insufficient_evidence", - "path_scope": [], - "symbol_candidates": [ - "RuntimeFactoryManager" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "passed": true, - "mismatches": [], - "details": { - "case_id": "plba-v2-explain-nonexistent-symbol", - "text": "Объясни класс RuntimeFactoryManager", - "mode": "full_chain", - "run_started_at": "2026-03-12T14:07:09", - "rag_session_id": "7d11da21-faa0-4cea-aede-aeabe069164c", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Объясни класс RuntimeFactoryManager", - "symbol_resolution": { - "status": "not_found", - "resolved_symbol": null, - "alternatives": [ - "ControlChannel", - "ControlActionSet" - ], - "confidence": 0.0 - }, - "rag_count": 0, - "rag_rows": [], - "llm_answer": "Класс `RuntimeFactoryManager` не найден в предоставленном контексте. Учитывая, что контекста недостаточно для прямого анализа, я не могу точно подтвердить наличие этого класса или объяснить его работу на основе доступных данных.\n\nТем не менее, исходя из названия, можно сделать осторожный вывод о возможном предназначении данного класса:\n\n1. Назначение: \n Вероятно, этот класс предназначен для управления фабриками (factory) или создания экземпляров различных runtime-компонентов во время выполнения программы. Это может включать настройку и инициализацию объектов, регистрацию фабрик или управление жизненным циклом компонентов.\n\n2. Возможные функции:\n - Управление созданием и регистрацией фабрик для разных типов компонентов.\n - Предоставление интерфейса для динамического получения инстансов конкретных классов или объектов по запросу.\n - Возможное кэширование созданных экземпляров или их отслеживание через механизм регистрации.\n\nОднако без доступа к исходному коду или документации невозможно точно утверждать детали реализации и функциональность класса `RuntimeFactoryManager`.", - "summary": { - "router": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "confidence": null - }, - "retrieval": { - "profile": "code", - "layers_hit": [], - "evidence_sufficient": false - }, - "llm": { - "answer_status": "insufficient_evidence", - "groundedness": "weakly_grounded" - } - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "RuntimeFactoryManager" - ], - "keyword_hints": [ - "RuntimeFactoryManager" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C0_SOURCE_CHUNKS": "exact_path_fetch", - "C4_SEMANTIC_ROLES": "exact_path_fetch", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C3_ENTRYPOINTS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 8, - "C4_SEMANTIC_ROLES": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C3_ENTRYPOINTS": 6 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C4_SEMANTIC_ROLES": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": null, - "workspace_id": null, - "returned_repo_ids": [], - "returned_workspace_ids": [] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "RuntimeFactoryManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "RuntimeFactoryManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C4_SEMANTIC_ROLES", - "query": "RuntimeFactoryManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "RuntimeFactoryManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - }, - { - "layer": "C3_ENTRYPOINTS", - "query": "RuntimeFactoryManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 2, - "candidates_after_filter": 2 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 6, - "candidates_after_filter": 6 - }, - { - "layer": "C3_ENTRYPOINTS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 3, - "candidates_after_filter": 3 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "not_found", - "resolved_symbol": null, - "alternatives": [ - "ControlChannel", - "ControlActionSet" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "miss", - "hit_count": 0, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "miss", - "hit_count": 0, - "fail_reason": null - }, - { - "layer": "C4_SEMANTIC_ROLES", - "status": "miss", - "hit_count": 0, - "fail_reason": null - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "miss", - "hit_count": 0, - "fail_reason": null - }, - { - "layer": "C3_ENTRYPOINTS", - "status": "miss", - "hit_count": 0, - "fail_reason": null - } - ] - }, - "constraint_violations": [ - { - "type": "LAYER_MISSING", - "severity": "warn", - "details": { - "layer": "C1_SYMBOL_CATALOG", - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "suggested_fix": "Increase top_k for this layer or relax constraints for retrieval." - }, - { - "type": "LAYER_MISSING", - "severity": "warn", - "details": { - "layer": "C0_SOURCE_CHUNKS", - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "suggested_fix": "Increase top_k for this layer or relax constraints for retrieval." - }, - { - "type": "LAYER_MISSING", - "severity": "warn", - "details": { - "layer": "C4_SEMANTIC_ROLES", - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "suggested_fix": "Increase top_k for this layer or relax constraints for retrieval." - }, - { - "type": "LAYER_MISSING", - "severity": "warn", - "details": { - "layer": "C2_DEPENDENCY_GRAPH", - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "suggested_fix": "Increase top_k for this layer or relax constraints for retrieval." - }, - { - "type": "LAYER_MISSING", - "severity": "warn", - "details": { - "layer": "C3_ENTRYPOINTS", - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "suggested_fix": "Increase top_k for this layer or relax constraints for retrieval." - }, - { - "type": "SYMBOL_RESOLUTION_FAILED", - "severity": "warn", - "details": { - "status": "not_found", - "symbol_candidates": [ - "RuntimeFactoryManager" - ] - }, - "suggested_fix": "Increase symbol layer budget or improve fuzzy symbol resolution settings." - } - ], - "timings_ms": { - "router": 0, - "symbol_resolution": 0, - "retrieval_total": 133, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 32, - "C0_SOURCE_CHUNKS": 18, - "C4_SEMANTIC_ROLES": 15, - "C2_DEPENDENCY_GRAPH": 54, - "C3_ENTRYPOINTS": 11 - }, - "merge_rank": 0, - "prompt_build": 0, - "llm_call": 1703 - }, - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 320, - "evidence_rows": 0, - "evidence_chars": 0 - }, - "evidence_summary": [], - "prompt_template_id": "intent_code_qa_explain_ru_v3", - "system_prompt_version": "v1" - }, - "router": { - "conversation_mode": "START", - "keyword_hints": [ - "RuntimeFactoryManager" - ], - "path_scope": [] - }, - "llm": { - "used_evidence_count": 0, - "missing_evidence_reason": "empty_retrieval_context" - } - }, - "run_info": { - "case_id": "plba-v2-explain-nonexistent-symbol", - "mode": "full_chain", - "run_started_at": "2026-03-12T14:07:09", - "rag_session_id": "7d11da21-faa0-4cea-aede-aeabe069164c", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - }, - "input_request": { - "text": "Объясни класс RuntimeFactoryManager", - "normalized_query": "Объясни класс RuntimeFactoryManager" - }, - "steps": [ - { - "step": "intent_router", - "input": { - "query": "Объясни класс RuntimeFactoryManager" - }, - "output": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Объясни класс RuntimeFactoryManager" - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "RuntimeFactoryManager" - ], - "keyword_hints": [ - "RuntimeFactoryManager" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "timings_ms": { - "router": 0 - } - } - }, - { - "step": "retrieval", - "input": { - "query": "Объясни класс RuntimeFactoryManager" - }, - "output": { - "symbol_resolution": { - "status": "not_found", - "resolved_symbol": null, - "alternatives": [ - "ControlChannel", - "ControlActionSet" - ], - "confidence": 0.0 - }, - "rag_count": 0, - "rag_rows": [] - }, - "diagnostics": { - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C0_SOURCE_CHUNKS": "exact_path_fetch", - "C4_SEMANTIC_ROLES": "exact_path_fetch", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C3_ENTRYPOINTS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 8, - "C4_SEMANTIC_ROLES": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C3_ENTRYPOINTS": 6 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C4_SEMANTIC_ROLES": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": null, - "workspace_id": null, - "returned_repo_ids": [], - "returned_workspace_ids": [] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "RuntimeFactoryManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "RuntimeFactoryManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C4_SEMANTIC_ROLES", - "query": "RuntimeFactoryManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "RuntimeFactoryManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - }, - { - "layer": "C3_ENTRYPOINTS", - "query": "RuntimeFactoryManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 2, - "candidates_after_filter": 2 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 6, - "candidates_after_filter": 6 - }, - { - "layer": "C3_ENTRYPOINTS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 3, - "candidates_after_filter": 3 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "not_found", - "resolved_symbol": null, - "alternatives": [ - "ControlChannel", - "ControlActionSet" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "miss", - "hit_count": 0, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "miss", - "hit_count": 0, - "fail_reason": null - }, - { - "layer": "C4_SEMANTIC_ROLES", - "status": "miss", - "hit_count": 0, - "fail_reason": null - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "miss", - "hit_count": 0, - "fail_reason": null - }, - { - "layer": "C3_ENTRYPOINTS", - "status": "miss", - "hit_count": 0, - "fail_reason": null - } - ] - }, - "constraint_violations": [ - { - "type": "LAYER_MISSING", - "severity": "warn", - "details": { - "layer": "C1_SYMBOL_CATALOG", - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "suggested_fix": "Increase top_k for this layer or relax constraints for retrieval." - }, - { - "type": "LAYER_MISSING", - "severity": "warn", - "details": { - "layer": "C0_SOURCE_CHUNKS", - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "suggested_fix": "Increase top_k for this layer or relax constraints for retrieval." - }, - { - "type": "LAYER_MISSING", - "severity": "warn", - "details": { - "layer": "C4_SEMANTIC_ROLES", - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "suggested_fix": "Increase top_k for this layer or relax constraints for retrieval." - }, - { - "type": "LAYER_MISSING", - "severity": "warn", - "details": { - "layer": "C2_DEPENDENCY_GRAPH", - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "suggested_fix": "Increase top_k for this layer or relax constraints for retrieval." - }, - { - "type": "LAYER_MISSING", - "severity": "warn", - "details": { - "layer": "C3_ENTRYPOINTS", - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "suggested_fix": "Increase top_k for this layer or relax constraints for retrieval." - }, - { - "type": "SYMBOL_RESOLUTION_FAILED", - "severity": "warn", - "details": { - "status": "not_found", - "symbol_candidates": [ - "RuntimeFactoryManager" - ] - }, - "suggested_fix": "Increase symbol layer budget or improve fuzzy symbol resolution settings." - } - ], - "timings_ms": { - "symbol_resolution": 0, - "retrieval_total": 133, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 32, - "C0_SOURCE_CHUNKS": 18, - "C4_SEMANTIC_ROLES": 15, - "C2_DEPENDENCY_GRAPH": 54, - "C3_ENTRYPOINTS": 11 - }, - "merge_rank": 0 - } - } - }, - { - "step": "llm_answer", - "input": { - "query": "Объясни класс RuntimeFactoryManager", - "rag_count": 0 - }, - "output": { - "llm_answer": "Класс `RuntimeFactoryManager` не найден в предоставленном контексте. Учитывая, что контекста недостаточно для прямого анализа, я не могу точно подтвердить наличие этого класса или объяснить его работу на основе доступных данных.\n\nТем не менее, исходя из названия, можно сделать осторожный вывод о возможном предназначении данного класса:\n\n1. Назначение: \n Вероятно, этот класс предназначен для управления фабриками (factory) или создания экземпляров различных runtime-компонентов во время выполнения программы. Это может включать настройку и инициализацию объектов, регистрацию фабрик или управление жизненным циклом компонентов.\n\n2. Возможные функции:\n - Управление созданием и регистрацией фабрик для разных типов компонентов.\n - Предоставление интерфейса для динамического получения инстансов конкретных классов или объектов по запросу.\n - Возможное кэширование созданных экземпляров или их отслеживание через механизм регистрации.\n\nОднако без доступа к исходному коду или документации невозможно точно утверждать детали реализации и функциональность класса `RuntimeFactoryManager`." - }, - "diagnostics": { - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 320, - "evidence_rows": 0, - "evidence_chars": 0 - }, - "evidence_summary": [], - "prompt_template_id": "intent_code_qa_explain_ru_v3", - "system_prompt_version": "v1" - }, - "timings_ms": { - "prompt_build": 0, - "llm_call": 1703 - } - } - } - ] - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_140708/full_chain_plba_code_subintents_v2_plba-v2-explain-nonexistent-symbol.md b/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_140708/full_chain_plba_code_subintents_v2_plba-v2-explain-nonexistent-symbol.md deleted file mode 100644 index 17900c0..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_140708/full_chain_plba_code_subintents_v2_plba-v2-explain-nonexistent-symbol.md +++ /dev/null @@ -1,34 +0,0 @@ -# plba-v2-explain-nonexistent-symbol - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_subintents_v2.yaml -- runner: runtime -- mode: full_chain -- passed: True - -## Query -Объясни класс RuntimeFactoryManager - -## Actual -{ - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 0, - "llm_answer": "Класс `RuntimeFactoryManager` не найден в предоставленном контексте. Учитывая, что контекста недостаточно для прямого анализа, я не могу точно подтвердить наличие этого класса или объяснить его работу на основе доступных данных.\n\nТем не менее, исходя из названия, можно сделать осторожный вывод о возможном предназначении данного класса:\n\n1. Назначение: \n Вероятно, этот класс предназначен для управления фабриками (factory) или создания экземпляров различных runtime-компонентов во время выполнения программы. Это может включать настройку и инициализацию объектов, регистрацию фабрик или управление жизненным циклом компонентов.\n\n2. Возможные функции:\n - Управление созданием и регистрацией фабрик для разных типов компонентов.\n - Предоставление интерфейса для динамического получения инстансов конкретных классов или объектов по запросу.\n - Возможное кэширование созданных экземпляров или их отслеживание через механизм регистрации.\n\nОднако без доступа к исходному коду или документации невозможно точно утверждать детали реализации и функциональность класса `RuntimeFactoryManager`.", - "answer_mode": "insufficient_evidence", - "path_scope": [], - "symbol_candidates": [ - "RuntimeFactoryManager" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] -} - -## Mismatches -- none \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_140708/full_chain_plba_code_subintents_v2_plba-v2-explain-runtime-manager.json b/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_140708/full_chain_plba_code_subintents_v2_plba-v2-explain-runtime-manager.json deleted file mode 100644 index 57fe892..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_140708/full_chain_plba_code_subintents_v2_plba-v2-explain-runtime-manager.json +++ /dev/null @@ -1,2088 +0,0 @@ -{ - "case_id": "plba-v2-explain-runtime-manager", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_subintents_v2.yaml", - "runner": "runtime", - "mode": "full_chain", - "actual": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 12, - "llm_answer": "Класс `RuntimeManager` играет роль менеджера жизненного цикла различных компонентов в приложении, обеспечивая координацию их инициализации и управления состоянием системы.\nКлючевые особенности класса:\n1. Инициализация (`__init__()`):\n - Класс принимает ряд аргументов: конфигурацию, сервисы, систему отслеживания трассировок, реестр здоровья, логгер, супервизор рабочих процессов и сервис управления каналами.\n - Все аргументы имеют значения по умолчанию, позволяя легко создать экземпляр класса без передачи всех параметров.\n \n2. Управление состояниями:\n - Свойства `_started`, `_state`, `_core_registered`, `_workers_registered` используются для отслеживания текущего состояния системы и её модулей.\n - Метод `_register_core_services()` регистрирует основные службы приложения.\n\n3. Регистрация модулей:\n - Метод `register_module(module)` позволяет зарегистрировать дополнительные модули приложения.\nКосвенные выводы о работе класса:\n- Судя по сигнатуре метода `__init__()`, класс должен быть активно задействован при старте системы и управлять основными компонентами приложения через передаваемые параметры.\n- Однако конкретные детали того, какие действия выполняются после регистрации служб и модулей, остаются неясными, так как напрямую из предоставленного контекста это невозможно подтвердить.\n\nТаким образом, хотя можно уверенно сказать, что `RuntimeManager` управляет жизненным циклом основных сервисов и состояний приложения, более точные детали его работы требуют дополнительного анализа исходного кода.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "RuntimeManager" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "passed": true, - "mismatches": [], - "details": { - "case_id": "plba-v2-explain-runtime-manager", - "text": "Объясни как работает класс RuntimeManager", - "mode": "full_chain", - "run_started_at": "2026-03-12T14:07:09", - "rag_session_id": "7d11da21-faa0-4cea-aede-aeabe069164c", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Объясни как работает класс RuntimeManager", - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "RuntimeManager", - "alternatives": [ - "RuntimeManager" - ], - "confidence": 0.99 - }, - "rag_count": 12, - "rag_rows": [ - { - "path": "src/app_runtime/core/runtime.py", - "content": "class RuntimeManager\nRuntimeManager", - "layer": "C1_SYMBOL_CATALOG", - "title": "RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "7e4a9381328c5803bbc6179458612fc4e947d928aa7bf8b4b2bebb2c8592f758", - "qname": "RuntimeManager", - "kind": "class", - "signature": "RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.core.runtime", - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests manager\n- orchestrates role-like calls (4)\n- reads and writes state attributes\n- participates in dataflow slices (50)", - "layer": "C4_SEMANTIC_ROLES", - "title": "RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 43, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "7e4a9381328c5803bbc6179458612fc4e947d928aa7bf8b4b2bebb2c8592f758", - "symbol_name": "RuntimeManager", - "qname": "RuntimeManager", - "role": "pipeline_stage", - "confidence": 0.67, - "dataflow_participation": 50, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.stop", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 25, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d", - "dst_ref": "ControlPlaneService.stop", - "resolution": "resolved", - "slice_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.stop" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._stop_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 51, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a", - "dst_ref": "ControlPlaneService._stop_async", - "resolution": "resolved", - "slice_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._stop_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.register_channel", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 17, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957", - "dst_ref": "ControlPlaneService.register_channel", - "resolution": "resolved", - "slice_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.register_channel" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.start", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 20, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154", - "dst_ref": "ControlPlaneService.start", - "resolution": "resolved", - "slice_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.start" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._start_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 47, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517", - "dst_ref": "ControlPlaneService._start_async", - "resolution": "resolved", - "slice_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._start_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager.add_config_file", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 32, - "span_end": 52, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "a23b8a11ebdb12708b60c96ea12a69f7f042082f1adfddd572444e246d81d167", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "57ffbd4f0d9fdf3507c2b8624312ce211f3d02fdf86a57a8ec90778d8a7b498d", - "dst_ref": "RuntimeManager.add_config_file", - "resolution": "resolved", - "slice_id": "a23b8a11ebdb12708b60c96ea12a69f7f042082f1adfddd572444e246d81d167", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager.add_config_file" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "57ffbd4f0d9fdf3507c2b8624312ce211f3d02fdf86a57a8ec90778d8a7b498d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "class RuntimeManager:\n ACTION_TIMEOUT_SECONDS = 10.0\n ACTION_POLL_INTERVAL_SECONDS = 0.05\n\n def __init__(\n self,\n configuration: ConfigurationManager | None = None,\n services: ServiceContainer | None = None,\n traces: TraceService | None = None,\n health: HealthRegistry | None = None,\n logs: LogManager | None = None,\n workers: WorkerSupervisor | None = None,\n control_plane: ControlPlaneService | None = None,\n ) -> None:\n self.configuration = configuration or ConfigurationManager()\n self.services = services or ServiceContainer()\n self.traces = traces or TraceService()\n self.health = health or HealthRegistry()\n self.logs = logs or LogManager()\n self.workers = workers or WorkerSupervisor()\n self.control_plane = control_plane or ControlPlaneService()\n self.registry = ModuleRegistry(self.services)\n self._started = False\n self._state = LifecycleState.IDLE\n self._core_registered = False\n self._workers_registered = False\n self._register_core_services()\n\n def register_module(self, module: ApplicationModule) -> None:\n self.registry.register_module(module.name)\n module.register(self.registry)\n\n def add_config_file(self, path: str) -> FileConfigProvider:\n provider = FileConfigProvider(path)\n self.configuration.add_provider(provider)\n return provider\n\n def start(self, *, start_control_plane: bool = True) -> None:\n if self._started:\n return\n self._state = LifecycleState.STARTING\n config = self.configuration.load()\n self.logs.apply_config(config)\n self._register_health_contributors()\n self._register_workers()\n self.workers.start()\n if start_control_plane:\n self.control_plane.start(self)\n self._started = True\n self._refresh_state()\n\n def stop(self, timeout: float = 30.0, force: bool = False, stop_control_plane: bool = True) -> None:\n if not self._started:\n return\n self._state = LifecycleState.STOPPING\n self.workers.stop(timeout=timeout, force=force)\n if stop_control_plane:\n self.control_plane.stop()\n self._started = False\n self._state = LifecycleState.STOPPED\n\n def status(self) -> dict[str, object]:\n self._refresh_state()\n return self.control_plane.snapshot(self)\n\n def current_health(self) -> HealthPayload:\n self._refresh_state()\n return self.health.payload(self._state, self.workers.healths())\n\n async def health_status(self) -> HealthPayload:\n return self.current_health()\n\n async def start_runtime(self) -> dict[str, object] | str:\n self._refresh_state()\n if self._started:\n return \"runtime already running\"\n if self._state == LifecycleState.STOPPING:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n\n self.start(start_control_plane=False)\n started = self._wait_for_state({LifecycleState.IDLE, LifecycleState.BUSY}, timeout=self.ACTION_TIMEOUT_SECONDS)\n if started:\n return self._action_detail(\"runtime started\", timed_out=False)\n return self._action_detail(\"runtime start is still in progress\", timed_out=True)\n\n async def stop_runtime(self) -> dict[str, object] | str:\n self._refresh_state()\n if not self._started:\n if self._state == LifecycleState.STOPPING:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n return \"runtime already stopped\"\n\n self._state = LifecycleState.STOPPING\n try:\n self.workers.stop(timeout=self.ACTION_TIMEOUT_SECONDS, force=False)\n except TimeoutError:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n\n self._started = False\n self._state = LifecycleState.STOPPED\n return self._action_detail(\"runtime stopped\", timed_out=False)\n\n async def runtime_status(self) -> str:\n self._refresh_state()\n return self._state.value\n\n def _register_core_services(self) -> None:\n if self._core_registered:\n return\n self.services.register(\"configuration\", self.configuration)\n self.services.register(\"traces\", self.traces)\n self.services.register(\"health\", self.health)\n self.services.register(\"logs\", self.logs)\n self.services.register(\"workers\", self.workers)\n self.services.register(\"control_plane\", self.control_plane)\n self._core_registered = True\n\n def _register_health_contributors(self) -> None:\n for contributor in self.registry.health_contributors:\n self.health.register(contributor)\n\n def _register_workers(self) -> None:\n if self._workers_registered:\n return\n for worker in self.registry.workers:\n self.workers.register(worker)\n self._workers_registered = True\n\n def _refresh_state(self) -> None:\n lifecycle = self.workers.lifecycle_state()\n\n if self._state == LifecycleState.STOPPING:\n if lifecycle == LifecycleState.STOPPED:\n self._started = False\n self._state = LifecycleState.STOPPED\n return\n\n if not self._started:\n if lifecycle == LifecycleState.STOPPED:\n self._state = LifecycleState.STOPPED\n return\n\n self._state = lifecycle\n\n def _wait_for_state(self, target_states: set[LifecycleState], *, timeout: float) -> bool:\n deadline = monotonic() + timeout\n while monotonic() < deadline:\n self._refresh_state()\n if self._state in target_states:\n return True\n sleep(self.ACTION_POLL_INTERVAL_SECONDS)\n self._refresh_state()\n return self._state in target_states\n\n def _action_detail(self, message: str, *, timed_out: bool) -> dict[str, object]:\n self._refresh_state()\n return {\n \"message\": message,\n \"state\": self._state.value,\n \"timed_out\": timed_out,\n \"workers\": self.workers.snapshot(),\n }", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/core/runtime.py:RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.core.runtime", - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "llm_answer": "Класс `RuntimeManager` играет роль менеджера жизненного цикла различных компонентов в приложении, обеспечивая координацию их инициализации и управления состоянием системы.\nКлючевые особенности класса:\n1. Инициализация (`__init__()`):\n - Класс принимает ряд аргументов: конфигурацию, сервисы, систему отслеживания трассировок, реестр здоровья, логгер, супервизор рабочих процессов и сервис управления каналами.\n - Все аргументы имеют значения по умолчанию, позволяя легко создать экземпляр класса без передачи всех параметров.\n \n2. Управление состояниями:\n - Свойства `_started`, `_state`, `_core_registered`, `_workers_registered` используются для отслеживания текущего состояния системы и её модулей.\n - Метод `_register_core_services()` регистрирует основные службы приложения.\n\n3. Регистрация модулей:\n - Метод `register_module(module)` позволяет зарегистрировать дополнительные модули приложения.\nКосвенные выводы о работе класса:\n- Судя по сигнатуре метода `__init__()`, класс должен быть активно задействован при старте системы и управлять основными компонентами приложения через передаваемые параметры.\n- Однако конкретные детали того, какие действия выполняются после регистрации служб и модулей, остаются неясными, так как напрямую из предоставленного контекста это невозможно подтвердить.\n\nТаким образом, хотя можно уверенно сказать, что `RuntimeManager` управляет жизненным циклом основных сервисов и состояний приложения, более точные детали его работы требуют дополнительного анализа исходного кода.", - "summary": { - "router": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "confidence": null - }, - "retrieval": { - "profile": "code", - "layers_hit": [ - "C0_SOURCE_CHUNKS", - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS", - "C4_SEMANTIC_ROLES" - ], - "evidence_sufficient": true - }, - "llm": { - "answer_status": "answered", - "groundedness": "grounded" - } - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "RuntimeManager" - ], - "keyword_hints": [ - "RuntimeManager" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C0_SOURCE_CHUNKS": "exact_path_fetch", - "C4_SEMANTIC_ROLES": "exact_path_fetch", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C3_ENTRYPOINTS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 8, - "C4_SEMANTIC_ROLES": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C3_ENTRYPOINTS": 6 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C4_SEMANTIC_ROLES": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C4_SEMANTIC_ROLES", - "query": "RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - }, - { - "layer": "C3_ENTRYPOINTS", - "query": "RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 1, - "candidates_after_filter": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 6, - "candidates_after_filter": 6 - }, - { - "layer": "C3_ENTRYPOINTS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 3, - "candidates_after_filter": 3 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "RuntimeManager", - "alternatives": [ - "RuntimeManager" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C4_SEMANTIC_ROLES", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 6, - "fail_reason": null - }, - { - "layer": "C3_ENTRYPOINTS", - "status": "hit", - "hit_count": 3, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "router": 0, - "symbol_resolution": 0, - "retrieval_total": 174, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 40, - "C0_SOURCE_CHUNKS": 23, - "C4_SEMANTIC_ROLES": 18, - "C2_DEPENDENCY_GRAPH": 57, - "C3_ENTRYPOINTS": 14 - }, - "merge_rank": 23, - "prompt_build": 0, - "llm_call": 2322 - }, - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 862, - "evidence_rows": 12, - "evidence_chars": 7130 - }, - "evidence_summary": [ - { - "layer": "C1_SYMBOL_CATALOG", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "count": 6, - "unique_paths": 2 - }, - { - "layer": "C3_ENTRYPOINTS", - "count": 3, - "unique_paths": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 1, - "unique_paths": 1 - } - ], - "prompt_template_id": "intent_code_qa_explain_ru_v3", - "system_prompt_version": "v1" - }, - "router": { - "conversation_mode": "START", - "keyword_hints": [ - "RuntimeManager" - ], - "path_scope": [] - }, - "llm": { - "used_evidence_count": 12, - "missing_evidence_reason": null - } - }, - "run_info": { - "case_id": "plba-v2-explain-runtime-manager", - "mode": "full_chain", - "run_started_at": "2026-03-12T14:07:09", - "rag_session_id": "7d11da21-faa0-4cea-aede-aeabe069164c", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - }, - "input_request": { - "text": "Объясни как работает класс RuntimeManager", - "normalized_query": "Объясни как работает класс RuntimeManager" - }, - "steps": [ - { - "step": "intent_router", - "input": { - "query": "Объясни как работает класс RuntimeManager" - }, - "output": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Объясни как работает класс RuntimeManager" - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "RuntimeManager" - ], - "keyword_hints": [ - "RuntimeManager" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "timings_ms": { - "router": 0 - } - } - }, - { - "step": "retrieval", - "input": { - "query": "Объясни как работает класс RuntimeManager" - }, - "output": { - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "RuntimeManager", - "alternatives": [ - "RuntimeManager" - ], - "confidence": 0.99 - }, - "rag_count": 12, - "rag_rows": [ - { - "path": "src/app_runtime/core/runtime.py", - "content": "class RuntimeManager\nRuntimeManager", - "layer": "C1_SYMBOL_CATALOG", - "title": "RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "7e4a9381328c5803bbc6179458612fc4e947d928aa7bf8b4b2bebb2c8592f758", - "qname": "RuntimeManager", - "kind": "class", - "signature": "RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.core.runtime", - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests manager\n- orchestrates role-like calls (4)\n- reads and writes state attributes\n- participates in dataflow slices (50)", - "layer": "C4_SEMANTIC_ROLES", - "title": "RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 43, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "7e4a9381328c5803bbc6179458612fc4e947d928aa7bf8b4b2bebb2c8592f758", - "symbol_name": "RuntimeManager", - "qname": "RuntimeManager", - "role": "pipeline_stage", - "confidence": 0.67, - "dataflow_participation": 50, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.stop", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 25, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d", - "dst_ref": "ControlPlaneService.stop", - "resolution": "resolved", - "slice_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.stop" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._stop_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 51, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a", - "dst_ref": "ControlPlaneService._stop_async", - "resolution": "resolved", - "slice_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._stop_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.register_channel", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 17, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957", - "dst_ref": "ControlPlaneService.register_channel", - "resolution": "resolved", - "slice_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.register_channel" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.start", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 20, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154", - "dst_ref": "ControlPlaneService.start", - "resolution": "resolved", - "slice_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.start" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._start_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 47, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517", - "dst_ref": "ControlPlaneService._start_async", - "resolution": "resolved", - "slice_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._start_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager.add_config_file", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 32, - "span_end": 52, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "a23b8a11ebdb12708b60c96ea12a69f7f042082f1adfddd572444e246d81d167", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "57ffbd4f0d9fdf3507c2b8624312ce211f3d02fdf86a57a8ec90778d8a7b498d", - "dst_ref": "RuntimeManager.add_config_file", - "resolution": "resolved", - "slice_id": "a23b8a11ebdb12708b60c96ea12a69f7f042082f1adfddd572444e246d81d167", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager.add_config_file" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "57ffbd4f0d9fdf3507c2b8624312ce211f3d02fdf86a57a8ec90778d8a7b498d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "class RuntimeManager:\n ACTION_TIMEOUT_SECONDS = 10.0\n ACTION_POLL_INTERVAL_SECONDS = 0.05\n\n def __init__(\n self,\n configuration: ConfigurationManager | None = None,\n services: ServiceContainer | None = None,\n traces: TraceService | None = None,\n health: HealthRegistry | None = None,\n logs: LogManager | None = None,\n workers: WorkerSupervisor | None = None,\n control_plane: ControlPlaneService | None = None,\n ) -> None:\n self.configuration = configuration or ConfigurationManager()\n self.services = services or ServiceContainer()\n self.traces = traces or TraceService()\n self.health = health or HealthRegistry()\n self.logs = logs or LogManager()\n self.workers = workers or WorkerSupervisor()\n self.control_plane = control_plane or ControlPlaneService()\n self.registry = ModuleRegistry(self.services)\n self._started = False\n self._state = LifecycleState.IDLE\n self._core_registered = False\n self._workers_registered = False\n self._register_core_services()\n\n def register_module(self, module: ApplicationModule) -> None:\n self.registry.register_module(module.name)\n module.register(self.registry)\n\n def add_config_file(self, path: str) -> FileConfigProvider:\n provider = FileConfigProvider(path)\n self.configuration.add_provider(provider)\n return provider\n\n def start(self, *, start_control_plane: bool = True) -> None:\n if self._started:\n return\n self._state = LifecycleState.STARTING\n config = self.configuration.load()\n self.logs.apply_config(config)\n self._register_health_contributors()\n self._register_workers()\n self.workers.start()\n if start_control_plane:\n self.control_plane.start(self)\n self._started = True\n self._refresh_state()\n\n def stop(self, timeout: float = 30.0, force: bool = False, stop_control_plane: bool = True) -> None:\n if not self._started:\n return\n self._state = LifecycleState.STOPPING\n self.workers.stop(timeout=timeout, force=force)\n if stop_control_plane:\n self.control_plane.stop()\n self._started = False\n self._state = LifecycleState.STOPPED\n\n def status(self) -> dict[str, object]:\n self._refresh_state()\n return self.control_plane.snapshot(self)\n\n def current_health(self) -> HealthPayload:\n self._refresh_state()\n return self.health.payload(self._state, self.workers.healths())\n\n async def health_status(self) -> HealthPayload:\n return self.current_health()\n\n async def start_runtime(self) -> dict[str, object] | str:\n self._refresh_state()\n if self._started:\n return \"runtime already running\"\n if self._state == LifecycleState.STOPPING:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n\n self.start(start_control_plane=False)\n started = self._wait_for_state({LifecycleState.IDLE, LifecycleState.BUSY}, timeout=self.ACTION_TIMEOUT_SECONDS)\n if started:\n return self._action_detail(\"runtime started\", timed_out=False)\n return self._action_detail(\"runtime start is still in progress\", timed_out=True)\n\n async def stop_runtime(self) -> dict[str, object] | str:\n self._refresh_state()\n if not self._started:\n if self._state == LifecycleState.STOPPING:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n return \"runtime already stopped\"\n\n self._state = LifecycleState.STOPPING\n try:\n self.workers.stop(timeout=self.ACTION_TIMEOUT_SECONDS, force=False)\n except TimeoutError:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n\n self._started = False\n self._state = LifecycleState.STOPPED\n return self._action_detail(\"runtime stopped\", timed_out=False)\n\n async def runtime_status(self) -> str:\n self._refresh_state()\n return self._state.value\n\n def _register_core_services(self) -> None:\n if self._core_registered:\n return\n self.services.register(\"configuration\", self.configuration)\n self.services.register(\"traces\", self.traces)\n self.services.register(\"health\", self.health)\n self.services.register(\"logs\", self.logs)\n self.services.register(\"workers\", self.workers)\n self.services.register(\"control_plane\", self.control_plane)\n self._core_registered = True\n\n def _register_health_contributors(self) -> None:\n for contributor in self.registry.health_contributors:\n self.health.register(contributor)\n\n def _register_workers(self) -> None:\n if self._workers_registered:\n return\n for worker in self.registry.workers:\n self.workers.register(worker)\n self._workers_registered = True\n\n def _refresh_state(self) -> None:\n lifecycle = self.workers.lifecycle_state()\n\n if self._state == LifecycleState.STOPPING:\n if lifecycle == LifecycleState.STOPPED:\n self._started = False\n self._state = LifecycleState.STOPPED\n return\n\n if not self._started:\n if lifecycle == LifecycleState.STOPPED:\n self._state = LifecycleState.STOPPED\n return\n\n self._state = lifecycle\n\n def _wait_for_state(self, target_states: set[LifecycleState], *, timeout: float) -> bool:\n deadline = monotonic() + timeout\n while monotonic() < deadline:\n self._refresh_state()\n if self._state in target_states:\n return True\n sleep(self.ACTION_POLL_INTERVAL_SECONDS)\n self._refresh_state()\n return self._state in target_states\n\n def _action_detail(self, message: str, *, timed_out: bool) -> dict[str, object]:\n self._refresh_state()\n return {\n \"message\": message,\n \"state\": self._state.value,\n \"timed_out\": timed_out,\n \"workers\": self.workers.snapshot(),\n }", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/core/runtime.py:RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.core.runtime", - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ] - }, - "diagnostics": { - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C0_SOURCE_CHUNKS": "exact_path_fetch", - "C4_SEMANTIC_ROLES": "exact_path_fetch", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C3_ENTRYPOINTS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 8, - "C4_SEMANTIC_ROLES": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C3_ENTRYPOINTS": 6 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C4_SEMANTIC_ROLES": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C4_SEMANTIC_ROLES", - "query": "RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - }, - { - "layer": "C3_ENTRYPOINTS", - "query": "RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 1, - "candidates_after_filter": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 6, - "candidates_after_filter": 6 - }, - { - "layer": "C3_ENTRYPOINTS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 3, - "candidates_after_filter": 3 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "RuntimeManager", - "alternatives": [ - "RuntimeManager" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C4_SEMANTIC_ROLES", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 6, - "fail_reason": null - }, - { - "layer": "C3_ENTRYPOINTS", - "status": "hit", - "hit_count": 3, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "symbol_resolution": 0, - "retrieval_total": 174, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 40, - "C0_SOURCE_CHUNKS": 23, - "C4_SEMANTIC_ROLES": 18, - "C2_DEPENDENCY_GRAPH": 57, - "C3_ENTRYPOINTS": 14 - }, - "merge_rank": 23 - } - } - }, - { - "step": "llm_answer", - "input": { - "query": "Объясни как работает класс RuntimeManager", - "rag_count": 12 - }, - "output": { - "llm_answer": "Класс `RuntimeManager` играет роль менеджера жизненного цикла различных компонентов в приложении, обеспечивая координацию их инициализации и управления состоянием системы.\nКлючевые особенности класса:\n1. Инициализация (`__init__()`):\n - Класс принимает ряд аргументов: конфигурацию, сервисы, систему отслеживания трассировок, реестр здоровья, логгер, супервизор рабочих процессов и сервис управления каналами.\n - Все аргументы имеют значения по умолчанию, позволяя легко создать экземпляр класса без передачи всех параметров.\n \n2. Управление состояниями:\n - Свойства `_started`, `_state`, `_core_registered`, `_workers_registered` используются для отслеживания текущего состояния системы и её модулей.\n - Метод `_register_core_services()` регистрирует основные службы приложения.\n\n3. Регистрация модулей:\n - Метод `register_module(module)` позволяет зарегистрировать дополнительные модули приложения.\nКосвенные выводы о работе класса:\n- Судя по сигнатуре метода `__init__()`, класс должен быть активно задействован при старте системы и управлять основными компонентами приложения через передаваемые параметры.\n- Однако конкретные детали того, какие действия выполняются после регистрации служб и модулей, остаются неясными, так как напрямую из предоставленного контекста это невозможно подтвердить.\n\nТаким образом, хотя можно уверенно сказать, что `RuntimeManager` управляет жизненным циклом основных сервисов и состояний приложения, более точные детали его работы требуют дополнительного анализа исходного кода." - }, - "diagnostics": { - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 862, - "evidence_rows": 12, - "evidence_chars": 7130 - }, - "evidence_summary": [ - { - "layer": "C1_SYMBOL_CATALOG", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "count": 6, - "unique_paths": 2 - }, - { - "layer": "C3_ENTRYPOINTS", - "count": 3, - "unique_paths": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 1, - "unique_paths": 1 - } - ], - "prompt_template_id": "intent_code_qa_explain_ru_v3", - "system_prompt_version": "v1" - }, - "timings_ms": { - "prompt_build": 0, - "llm_call": 2322 - } - } - } - ] - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_140708/full_chain_plba_code_subintents_v2_plba-v2-explain-runtime-manager.md b/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_140708/full_chain_plba_code_subintents_v2_plba-v2-explain-runtime-manager.md deleted file mode 100644 index 4969102..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_140708/full_chain_plba_code_subintents_v2_plba-v2-explain-runtime-manager.md +++ /dev/null @@ -1,34 +0,0 @@ -# plba-v2-explain-runtime-manager - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_subintents_v2.yaml -- runner: runtime -- mode: full_chain -- passed: True - -## Query -Объясни как работает класс RuntimeManager - -## Actual -{ - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 12, - "llm_answer": "Класс `RuntimeManager` играет роль менеджера жизненного цикла различных компонентов в приложении, обеспечивая координацию их инициализации и управления состоянием системы.\nКлючевые особенности класса:\n1. Инициализация (`__init__()`):\n - Класс принимает ряд аргументов: конфигурацию, сервисы, систему отслеживания трассировок, реестр здоровья, логгер, супервизор рабочих процессов и сервис управления каналами.\n - Все аргументы имеют значения по умолчанию, позволяя легко создать экземпляр класса без передачи всех параметров.\n \n2. Управление состояниями:\n - Свойства `_started`, `_state`, `_core_registered`, `_workers_registered` используются для отслеживания текущего состояния системы и её модулей.\n - Метод `_register_core_services()` регистрирует основные службы приложения.\n\n3. Регистрация модулей:\n - Метод `register_module(module)` позволяет зарегистрировать дополнительные модули приложения.\nКосвенные выводы о работе класса:\n- Судя по сигнатуре метода `__init__()`, класс должен быть активно задействован при старте системы и управлять основными компонентами приложения через передаваемые параметры.\n- Однако конкретные детали того, какие действия выполняются после регистрации служб и модулей, остаются неясными, так как напрямую из предоставленного контекста это невозможно подтвердить.\n\nТаким образом, хотя можно уверенно сказать, что `RuntimeManager` управляет жизненным циклом основных сервисов и состояний приложения, более точные детали его работы требуют дополнительного анализа исходного кода.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "RuntimeManager" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] -} - -## Mismatches -- none \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_140708/full_chain_plba_code_subintents_v2_plba-v2-explain-trace-service.json b/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_140708/full_chain_plba_code_subintents_v2_plba-v2-explain-trace-service.json deleted file mode 100644 index a8c86c4..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_140708/full_chain_plba_code_subintents_v2_plba-v2-explain-trace-service.json +++ /dev/null @@ -1,2208 +0,0 @@ -{ - "case_id": "plba-v2-explain-trace-service", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_subintents_v2.yaml", - "runner": "runtime", - "mode": "full_chain", - "actual": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 14, - "llm_answer": "Класс `TraceService` представляет собой сервис для управления контекстами трассировки в приложении. Он является фабрикой контекста (`TraceContextFactory`), что указывает на его роль в создании и управлении объектами, связанными с трассировкой.\nКлючевые аспекты работы класса:\n\n1. Инициализация:\n - При инициализации создается объект записи трассировочных данных (`TraceRecordWriter`) и используется транспортная инфраструктура (`TraceTransport`). Если транспорт не указан, по умолчанию применяется заглушка (`NoOpTraceTransport()`).\n \n2. Создание контекста трассировки:\n - Метод `create_context` создает новый контекст трассировки с уникальным идентификатором, записывает его в хранилище (`store`) и отправляет запись через транспортную инфраструктуру.\n - Контекст можно создать с указанием следующих параметров:\n - `alias`: строка, идентифицирующая тип контекста;\n - `parent_id`: родительский идентификатор контекста (если этот контекст вложен);\n - `kind`: тип события (например, запрос, ответ и т.д.);\n - `attrs`: дополнительные атрибуты контекста.\n\n3. Обертка контекста:\n - С помощью декоратора контекста (`@contextmanager`) предоставляется механизм временной области видимости контекста. Внутри блока с этим декоратором вызывается метод создания контекста, возвращающий уникальный идентификатор созданного контекста.\nВозможности и ограничения:\n\n- Класс использует стандартное время UTC для маркировки событий, генерирует уникальные идентификаторы при помощи библиотеки UUID и поддерживает хранение записей в виде атрибутов словаря.\n \nОднако, исходя из представленного контекста, напрямую невозможно точно определить, какие именно транспортные механизмы используются и каким образом реализован механизм хранения контекста. Эти детали скрыты внутри методов `TraceContextStore` и `TraceTransport`, которые явно не описаны здесь.\n\nТаким образом, хотя основные функции класса понятны, детали конкретных реализаций связанных компонентов остаются неизвестными.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "TraceService" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "passed": true, - "mismatches": [], - "details": { - "case_id": "plba-v2-explain-trace-service", - "text": "Объясни как работает класс TraceService", - "mode": "full_chain", - "run_started_at": "2026-03-12T14:07:09", - "rag_session_id": "7d11da21-faa0-4cea-aede-aeabe069164c", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Объясни как работает класс TraceService", - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "TraceService", - "alternatives": [ - "TraceService" - ], - "confidence": 0.99 - }, - "rag_count": 14, - "rag_rows": [ - { - "path": "src/app_runtime/tracing/service.py", - "content": "class TraceService\nTraceService(TraceContextFactory)", - "layer": "C1_SYMBOL_CATALOG", - "title": "TraceService", - "span_start": 39, - "span_end": 166, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "c2b2b976d99f2c600000b753731b26e0a69adcb4359398b93073590c5d5d04f4", - "qname": "TraceService", - "kind": "class", - "signature": "TraceService(TraceContextFactory)", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.tracing.service", - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "TraceService\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests service\n- reads and writes state attributes\n- participates in dataflow slices (13)", - "layer": "C4_SEMANTIC_ROLES", - "title": "TraceService", - "span_start": 39, - "span_end": 166, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 60, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "c2b2b976d99f2c600000b753731b26e0a69adcb4359398b93073590c5d5d04f4", - "symbol_name": "TraceService", - "qname": "TraceService", - "role": "pipeline_stage", - "confidence": 0.57, - "dataflow_participation": 13, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "TraceService.__init__\n -> TraceService.store\n -> TraceService.create_context", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "TraceService.__init__:dataflow_slice", - "span_start": 42, - "span_end": 61, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "3b052062067a78aef3302ee1d996897e02a67d1b340397bea4f59fe147c0492a", - "edge_type": "dataflow_slice", - "src_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "src_qname": "TraceService.__init__", - "dst_symbol_id": "ff44881104b65ef50ee6fe16d367d4a81b6e7eb5c44c0963cf4543faec785d4a", - "dst_ref": "TraceService.create_context", - "resolution": "resolved", - "slice_id": "3b052062067a78aef3302ee1d996897e02a67d1b340397bea4f59fe147c0492a", - "root_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "path_symbols": [ - "TraceService.__init__", - "TraceService.store", - "TraceService.create_context" - ], - "path_symbol_ids": [ - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "ff44881104b65ef50ee6fe16d367d4a81b6e7eb5c44c0963cf4543faec785d4a" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "TraceService.__init__\n -> TraceService.store\n -> TraceService.close_context", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "TraceService.__init__:dataflow_slice", - "span_start": 42, - "span_end": 84, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "7a9353ef57c9ae5d19b3a0c6ac50fad05e6d21d31bbe1cd1cd07af6332ba6505", - "edge_type": "dataflow_slice", - "src_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "src_qname": "TraceService.__init__", - "dst_symbol_id": "01e14158dcced7e52d0c8ac84ac7b9a75225c261b6aca6a1d7da802d0994721c", - "dst_ref": "TraceService.close_context", - "resolution": "resolved", - "slice_id": "7a9353ef57c9ae5d19b3a0c6ac50fad05e6d21d31bbe1cd1cd07af6332ba6505", - "root_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "path_symbols": [ - "TraceService.__init__", - "TraceService.store", - "TraceService.close_context" - ], - "path_symbol_ids": [ - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "01e14158dcced7e52d0c8ac84ac7b9a75225c261b6aca6a1d7da802d0994721c" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "TraceService.__init__\n -> TraceService.store\n -> TraceService.open_context", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "TraceService.__init__:dataflow_slice", - "span_start": 42, - "span_end": 78, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "a6e13b9ebc4fed84586afd53ed92a4d14757e440873f572b2337d5622ee96031", - "edge_type": "dataflow_slice", - "src_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "src_qname": "TraceService.__init__", - "dst_symbol_id": "2da3d5b20a947bf63e14c103be4689b72fd837e0a82abd6c497846375d4c7426", - "dst_ref": "TraceService.open_context", - "resolution": "resolved", - "slice_id": "a6e13b9ebc4fed84586afd53ed92a4d14757e440873f572b2337d5622ee96031", - "root_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "path_symbols": [ - "TraceService.__init__", - "TraceService.store", - "TraceService.open_context" - ], - "path_symbol_ids": [ - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "2da3d5b20a947bf63e14c103be4689b72fd837e0a82abd6c497846375d4c7426" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "TraceService.__init__\n -> TraceService.transport\n -> TraceService.__init__", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "TraceService.__init__:dataflow_slice", - "span_start": 41, - "span_end": 43, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "1e923a93faa05c3c43ca9b19bd047007a8589ccce57d3cc1798ae7f9f200af98", - "edge_type": "dataflow_slice", - "src_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "src_qname": "TraceService.__init__", - "dst_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "dst_ref": "TraceService.__init__", - "resolution": "resolved", - "slice_id": "1e923a93faa05c3c43ca9b19bd047007a8589ccce57d3cc1798ae7f9f200af98", - "root_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "path_symbols": [ - "TraceService.__init__", - "TraceService.transport", - "TraceService.__init__" - ], - "path_symbol_ids": [ - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "TraceService.__init__\n -> TraceService.store\n -> TraceService.current_trace_id", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "TraceService.__init__:dataflow_slice", - "span_start": 42, - "span_end": 81, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "3ea17138634b1190bded77ddb84aa1595124f6519b246f24fc4b02bd62b5cac1", - "edge_type": "dataflow_slice", - "src_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "src_qname": "TraceService.__init__", - "dst_symbol_id": "41135180f7b3b9ab20e097e0747474e219c37dd2366ef08a7b43c1f3edb10b4c", - "dst_ref": "TraceService.current_trace_id", - "resolution": "resolved", - "slice_id": "3ea17138634b1190bded77ddb84aa1595124f6519b246f24fc4b02bd62b5cac1", - "root_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "path_symbols": [ - "TraceService.__init__", - "TraceService.store", - "TraceService.current_trace_id" - ], - "path_symbol_ids": [ - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "41135180f7b3b9ab20e097e0747474e219c37dd2366ef08a7b43c1f3edb10b4c" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "TraceService.__init__\n -> TraceService.store\n -> TraceService.step", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "TraceService.__init__:dataflow_slice", - "span_start": 42, - "span_end": 88, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "9f34c5da9b09fba99df6f6b1bde183a9aeb45111b8218a747c71590c2c9f60f2", - "edge_type": "dataflow_slice", - "src_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "src_qname": "TraceService.__init__", - "dst_symbol_id": "c44bfbc66cf747283f30088da3e011a10395031d41e77b74e523c24997f641ca", - "dst_ref": "TraceService.step", - "resolution": "resolved", - "slice_id": "9f34c5da9b09fba99df6f6b1bde183a9aeb45111b8218a747c71590c2c9f60f2", - "root_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "path_symbols": [ - "TraceService.__init__", - "TraceService.store", - "TraceService.step" - ], - "path_symbol_ids": [ - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "c44bfbc66cf747283f30088da3e011a10395031d41e77b74e523c24997f641ca" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "class TraceRecordWriter:\n def __init__(self, transport: TraceTransport) -> None:\n self._logger = logging.getLogger(__name__)\n self._transport = transport\n\n def write_context(self, record: TraceContextRecord) -> None:\n try:\n self._transport.write_context(record)\n except Exception:\n self._logger.exception(\"Trace transport failed to write context %s\", record.trace_id)\n\n def write_message(self, record: TraceLogMessage) -> None:\n try:\n self._transport.write_message(record)\n except Exception:\n self._logger.exception(\"Trace transport failed to write message for %s\", record.trace_id)", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/tracing/service.py:TraceRecordWriter", - "span_start": 21, - "span_end": 36, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.tracing.service", - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "class TraceService(TraceContextFactory):\n def __init__(self, transport: TraceTransport | None = None, store: TraceContextStore | None = None) -> None:\n self.transport = transport or NoOpTraceTransport()\n self.store = store or TraceContextStore()\n self._writer = TraceRecordWriter(self.transport)\n\n def create_context(\n self,\n *,\n alias: str,\n parent_id: str | None = None,\n kind: str | None = None,\n attrs: dict[str, Any] | None = None,\n ) -> str:\n record = TraceContextRecord(\n trace_id=uuid4().hex,\n alias=str(alias or \"\"),\n parent_id=parent_id,\n type=kind,\n event_time=utc_now(),\n attrs=dict(attrs or {}),\n )\n self.store.push(record)\n self._writer.write_context(record)\n return record.trace_id\n\n @contextmanager\n def open_context(\n self,\n *,\n alias: str,\n parent_id: str | None = None,\n kind: str | None = None,\n attrs: dict[str, Any] | None = None,\n ) -> Iterator[str]:\n trace_id = self.create_context(alias=alias, parent_id=parent_id, kind=kind, attrs=attrs)\n try:\n yield trace_id\n finally:\n self.store.pop()\n\n def current_trace_id(self) -> str | None:\n return self.store.current_trace_id()\n\n def close_context(self) -> str | None:\n previous = self.store.pop()\n return previous.record.trace_id if previous else None\n\n def step(self, name: str) -> None:\n self.store.set_step(str(name or \"\"))\n\n def info(self, message: str, *, status: str | None = None, attrs: dict[str, Any] | None = None) -> None:\n self._write_message(\"INFO\", message, status, attrs)\n\n def debug(self, message: str, *, status: str | None = None, attrs: dict[str, Any] | None = None) -> None:\n self._write_message(\"DEBUG\", message, status, attrs)\n\n def warning(self, message: str, *, status: str | None = None, attrs: dict[str, Any] | None = None) -> None:\n self._write_message(\"WARNING\", message, status, attrs)\n\n def error(self, message: str, *, status: str | None = None, attrs: dict[str, Any] | None = None) -> None:\n self._write_message(\"ERROR\", message, status, attrs)\n\n def exception(self, message: str, *, status: str = \"failed\", attrs: dict[str, Any] | None = None) -> None:\n self._write_message(\"ERROR\", message, status, attrs)\n\n def new_root(self, operation: str) -> TraceContext:\n trace_id = self.create_context(alias=operation, kind=\"operation\", attrs={\"operation\": operation})\n return TraceContext(trace_id=trace_id, span_id=trace_id, attributes={\"operation\": operation})\n\n def child_of(self, parent: TraceContext, operation: str) -> TraceContext:\n trace_id = self.create_context(\n alias=operation,\n parent_id=parent.trace_id,\n kind=\"worker\",\n attrs={\"operation\": operation},\n )\n return TraceContext(\n trace_id=trace_id,\n span_id=trace_id,\n parent_span_id=parent.span_id,\n attributes={\"operation\": operation},\n )\n\n def attach(self, metadata: dict[str, object], context: TraceContext) -> dict[str, object]:\n updated = dict(metadata)\n updated[\"trace_id\"] = context.trace_id\n updated[\"span_id\"] = context.span_id\n updated[\"parent_span_id\"] = context.parent_span_id\n return updated\n\n def resume(self, metadata: dict[str, object], operation: str) -> TraceContext:\n trace_id = str(metadata.get(\"trace_id\") or uuid4().hex)\n span_id = str(metadata.get(\"span_id\") or trace_id)\n parent_id = metadata.get(\"parent_span_id\")\n self.create_context(\n alias=operation,\n parent_id=str(parent_id) if parent_id else None,\n kind=\"worker\",\n attrs=dict(metadata),\n )\n return TraceContext(\n trace_id=trace_id,\n span_id=span_id,\n parent_span_id=str(parent_id) if parent_id else None,\n attributes={\"operation\": operation},\n )\n\n def _write_message(\n self,\n level: TraceLevel,\n message: str,\n status: str | None,\n attrs: dict[str, Any] | None,\n ) -> None:\n active = self.store.current()\n if active is None:\n raise RuntimeError(\"Trace context is not bound. Call create_context() first.\")\n record = TraceLogMessage(\n trace_id=active.record.trace_id,\n step=active.step,\n status=str(status or \"\"),\n message=str(message or \"\"),\n level=level,\n event_time=utc_now(),\n attrs=dict(attrs or {}),\n )\n self._writer.write_message(record)", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/tracing/service.py:TraceService", - "span_start": 39, - "span_end": 166, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 1, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.tracing.service", - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "class TraceManager(TraceService):\n \"\"\"Compatibility alias during the transition from ConfigManager-shaped naming.\"\"\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/tracing/service.py:TraceManager", - "span_start": 169, - "span_end": 170, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 2, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.tracing.service", - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "llm_answer": "Класс `TraceService` представляет собой сервис для управления контекстами трассировки в приложении. Он является фабрикой контекста (`TraceContextFactory`), что указывает на его роль в создании и управлении объектами, связанными с трассировкой.\nКлючевые аспекты работы класса:\n\n1. Инициализация:\n - При инициализации создается объект записи трассировочных данных (`TraceRecordWriter`) и используется транспортная инфраструктура (`TraceTransport`). Если транспорт не указан, по умолчанию применяется заглушка (`NoOpTraceTransport()`).\n \n2. Создание контекста трассировки:\n - Метод `create_context` создает новый контекст трассировки с уникальным идентификатором, записывает его в хранилище (`store`) и отправляет запись через транспортную инфраструктуру.\n - Контекст можно создать с указанием следующих параметров:\n - `alias`: строка, идентифицирующая тип контекста;\n - `parent_id`: родительский идентификатор контекста (если этот контекст вложен);\n - `kind`: тип события (например, запрос, ответ и т.д.);\n - `attrs`: дополнительные атрибуты контекста.\n\n3. Обертка контекста:\n - С помощью декоратора контекста (`@contextmanager`) предоставляется механизм временной области видимости контекста. Внутри блока с этим декоратором вызывается метод создания контекста, возвращающий уникальный идентификатор созданного контекста.\nВозможности и ограничения:\n\n- Класс использует стандартное время UTC для маркировки событий, генерирует уникальные идентификаторы при помощи библиотеки UUID и поддерживает хранение записей в виде атрибутов словаря.\n \nОднако, исходя из представленного контекста, напрямую невозможно точно определить, какие именно транспортные механизмы используются и каким образом реализован механизм хранения контекста. Эти детали скрыты внутри методов `TraceContextStore` и `TraceTransport`, которые явно не описаны здесь.\n\nТаким образом, хотя основные функции класса понятны, детали конкретных реализаций связанных компонентов остаются неизвестными.", - "summary": { - "router": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "confidence": null - }, - "retrieval": { - "profile": "code", - "layers_hit": [ - "C0_SOURCE_CHUNKS", - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS", - "C4_SEMANTIC_ROLES" - ], - "evidence_sufficient": true - }, - "llm": { - "answer_status": "answered", - "groundedness": "grounded" - } - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "TraceService" - ], - "keyword_hints": [ - "TraceService" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C0_SOURCE_CHUNKS": "exact_path_fetch", - "C4_SEMANTIC_ROLES": "exact_path_fetch", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C3_ENTRYPOINTS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 8, - "C4_SEMANTIC_ROLES": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C3_ENTRYPOINTS": 6 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C4_SEMANTIC_ROLES": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "TraceService", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "TraceService", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C4_SEMANTIC_ROLES", - "query": "TraceService", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "TraceService", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - }, - { - "layer": "C3_ENTRYPOINTS", - "query": "TraceService", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 1, - "candidates_after_filter": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 6, - "candidates_after_filter": 6 - }, - { - "layer": "C3_ENTRYPOINTS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 3, - "candidates_after_filter": 3 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "TraceService", - "alternatives": [ - "TraceService" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 3, - "fail_reason": null - }, - { - "layer": "C4_SEMANTIC_ROLES", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 6, - "fail_reason": null - }, - { - "layer": "C3_ENTRYPOINTS", - "status": "hit", - "hit_count": 3, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "router": 0, - "symbol_resolution": 0, - "retrieval_total": 143, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 48, - "C0_SOURCE_CHUNKS": 20, - "C4_SEMANTIC_ROLES": 16, - "C2_DEPENDENCY_GRAPH": 45, - "C3_ENTRYPOINTS": 11 - }, - "merge_rank": 21, - "prompt_build": 0, - "llm_call": 2992 - }, - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 999, - "evidence_rows": 14, - "evidence_chars": 6323 - }, - "evidence_summary": [ - { - "layer": "C1_SYMBOL_CATALOG", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "count": 6, - "unique_paths": 1 - }, - { - "layer": "C3_ENTRYPOINTS", - "count": 3, - "unique_paths": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 3, - "unique_paths": 1 - } - ], - "prompt_template_id": "intent_code_qa_explain_ru_v3", - "system_prompt_version": "v1" - }, - "router": { - "conversation_mode": "START", - "keyword_hints": [ - "TraceService" - ], - "path_scope": [] - }, - "llm": { - "used_evidence_count": 14, - "missing_evidence_reason": null - } - }, - "run_info": { - "case_id": "plba-v2-explain-trace-service", - "mode": "full_chain", - "run_started_at": "2026-03-12T14:07:09", - "rag_session_id": "7d11da21-faa0-4cea-aede-aeabe069164c", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - }, - "input_request": { - "text": "Объясни как работает класс TraceService", - "normalized_query": "Объясни как работает класс TraceService" - }, - "steps": [ - { - "step": "intent_router", - "input": { - "query": "Объясни как работает класс TraceService" - }, - "output": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Объясни как работает класс TraceService" - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "TraceService" - ], - "keyword_hints": [ - "TraceService" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "timings_ms": { - "router": 0 - } - } - }, - { - "step": "retrieval", - "input": { - "query": "Объясни как работает класс TraceService" - }, - "output": { - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "TraceService", - "alternatives": [ - "TraceService" - ], - "confidence": 0.99 - }, - "rag_count": 14, - "rag_rows": [ - { - "path": "src/app_runtime/tracing/service.py", - "content": "class TraceService\nTraceService(TraceContextFactory)", - "layer": "C1_SYMBOL_CATALOG", - "title": "TraceService", - "span_start": 39, - "span_end": 166, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "c2b2b976d99f2c600000b753731b26e0a69adcb4359398b93073590c5d5d04f4", - "qname": "TraceService", - "kind": "class", - "signature": "TraceService(TraceContextFactory)", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.tracing.service", - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "TraceService\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests service\n- reads and writes state attributes\n- participates in dataflow slices (13)", - "layer": "C4_SEMANTIC_ROLES", - "title": "TraceService", - "span_start": 39, - "span_end": 166, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 60, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "c2b2b976d99f2c600000b753731b26e0a69adcb4359398b93073590c5d5d04f4", - "symbol_name": "TraceService", - "qname": "TraceService", - "role": "pipeline_stage", - "confidence": 0.57, - "dataflow_participation": 13, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "TraceService.__init__\n -> TraceService.store\n -> TraceService.create_context", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "TraceService.__init__:dataflow_slice", - "span_start": 42, - "span_end": 61, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "3b052062067a78aef3302ee1d996897e02a67d1b340397bea4f59fe147c0492a", - "edge_type": "dataflow_slice", - "src_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "src_qname": "TraceService.__init__", - "dst_symbol_id": "ff44881104b65ef50ee6fe16d367d4a81b6e7eb5c44c0963cf4543faec785d4a", - "dst_ref": "TraceService.create_context", - "resolution": "resolved", - "slice_id": "3b052062067a78aef3302ee1d996897e02a67d1b340397bea4f59fe147c0492a", - "root_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "path_symbols": [ - "TraceService.__init__", - "TraceService.store", - "TraceService.create_context" - ], - "path_symbol_ids": [ - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "ff44881104b65ef50ee6fe16d367d4a81b6e7eb5c44c0963cf4543faec785d4a" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "TraceService.__init__\n -> TraceService.store\n -> TraceService.close_context", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "TraceService.__init__:dataflow_slice", - "span_start": 42, - "span_end": 84, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "7a9353ef57c9ae5d19b3a0c6ac50fad05e6d21d31bbe1cd1cd07af6332ba6505", - "edge_type": "dataflow_slice", - "src_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "src_qname": "TraceService.__init__", - "dst_symbol_id": "01e14158dcced7e52d0c8ac84ac7b9a75225c261b6aca6a1d7da802d0994721c", - "dst_ref": "TraceService.close_context", - "resolution": "resolved", - "slice_id": "7a9353ef57c9ae5d19b3a0c6ac50fad05e6d21d31bbe1cd1cd07af6332ba6505", - "root_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "path_symbols": [ - "TraceService.__init__", - "TraceService.store", - "TraceService.close_context" - ], - "path_symbol_ids": [ - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "01e14158dcced7e52d0c8ac84ac7b9a75225c261b6aca6a1d7da802d0994721c" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "TraceService.__init__\n -> TraceService.store\n -> TraceService.open_context", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "TraceService.__init__:dataflow_slice", - "span_start": 42, - "span_end": 78, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "a6e13b9ebc4fed84586afd53ed92a4d14757e440873f572b2337d5622ee96031", - "edge_type": "dataflow_slice", - "src_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "src_qname": "TraceService.__init__", - "dst_symbol_id": "2da3d5b20a947bf63e14c103be4689b72fd837e0a82abd6c497846375d4c7426", - "dst_ref": "TraceService.open_context", - "resolution": "resolved", - "slice_id": "a6e13b9ebc4fed84586afd53ed92a4d14757e440873f572b2337d5622ee96031", - "root_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "path_symbols": [ - "TraceService.__init__", - "TraceService.store", - "TraceService.open_context" - ], - "path_symbol_ids": [ - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "2da3d5b20a947bf63e14c103be4689b72fd837e0a82abd6c497846375d4c7426" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "TraceService.__init__\n -> TraceService.transport\n -> TraceService.__init__", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "TraceService.__init__:dataflow_slice", - "span_start": 41, - "span_end": 43, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "1e923a93faa05c3c43ca9b19bd047007a8589ccce57d3cc1798ae7f9f200af98", - "edge_type": "dataflow_slice", - "src_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "src_qname": "TraceService.__init__", - "dst_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "dst_ref": "TraceService.__init__", - "resolution": "resolved", - "slice_id": "1e923a93faa05c3c43ca9b19bd047007a8589ccce57d3cc1798ae7f9f200af98", - "root_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "path_symbols": [ - "TraceService.__init__", - "TraceService.transport", - "TraceService.__init__" - ], - "path_symbol_ids": [ - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "TraceService.__init__\n -> TraceService.store\n -> TraceService.current_trace_id", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "TraceService.__init__:dataflow_slice", - "span_start": 42, - "span_end": 81, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "3ea17138634b1190bded77ddb84aa1595124f6519b246f24fc4b02bd62b5cac1", - "edge_type": "dataflow_slice", - "src_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "src_qname": "TraceService.__init__", - "dst_symbol_id": "41135180f7b3b9ab20e097e0747474e219c37dd2366ef08a7b43c1f3edb10b4c", - "dst_ref": "TraceService.current_trace_id", - "resolution": "resolved", - "slice_id": "3ea17138634b1190bded77ddb84aa1595124f6519b246f24fc4b02bd62b5cac1", - "root_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "path_symbols": [ - "TraceService.__init__", - "TraceService.store", - "TraceService.current_trace_id" - ], - "path_symbol_ids": [ - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "41135180f7b3b9ab20e097e0747474e219c37dd2366ef08a7b43c1f3edb10b4c" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "TraceService.__init__\n -> TraceService.store\n -> TraceService.step", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "TraceService.__init__:dataflow_slice", - "span_start": 42, - "span_end": 88, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "9f34c5da9b09fba99df6f6b1bde183a9aeb45111b8218a747c71590c2c9f60f2", - "edge_type": "dataflow_slice", - "src_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "src_qname": "TraceService.__init__", - "dst_symbol_id": "c44bfbc66cf747283f30088da3e011a10395031d41e77b74e523c24997f641ca", - "dst_ref": "TraceService.step", - "resolution": "resolved", - "slice_id": "9f34c5da9b09fba99df6f6b1bde183a9aeb45111b8218a747c71590c2c9f60f2", - "root_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "path_symbols": [ - "TraceService.__init__", - "TraceService.store", - "TraceService.step" - ], - "path_symbol_ids": [ - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "c44bfbc66cf747283f30088da3e011a10395031d41e77b74e523c24997f641ca" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "class TraceRecordWriter:\n def __init__(self, transport: TraceTransport) -> None:\n self._logger = logging.getLogger(__name__)\n self._transport = transport\n\n def write_context(self, record: TraceContextRecord) -> None:\n try:\n self._transport.write_context(record)\n except Exception:\n self._logger.exception(\"Trace transport failed to write context %s\", record.trace_id)\n\n def write_message(self, record: TraceLogMessage) -> None:\n try:\n self._transport.write_message(record)\n except Exception:\n self._logger.exception(\"Trace transport failed to write message for %s\", record.trace_id)", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/tracing/service.py:TraceRecordWriter", - "span_start": 21, - "span_end": 36, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.tracing.service", - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "class TraceService(TraceContextFactory):\n def __init__(self, transport: TraceTransport | None = None, store: TraceContextStore | None = None) -> None:\n self.transport = transport or NoOpTraceTransport()\n self.store = store or TraceContextStore()\n self._writer = TraceRecordWriter(self.transport)\n\n def create_context(\n self,\n *,\n alias: str,\n parent_id: str | None = None,\n kind: str | None = None,\n attrs: dict[str, Any] | None = None,\n ) -> str:\n record = TraceContextRecord(\n trace_id=uuid4().hex,\n alias=str(alias or \"\"),\n parent_id=parent_id,\n type=kind,\n event_time=utc_now(),\n attrs=dict(attrs or {}),\n )\n self.store.push(record)\n self._writer.write_context(record)\n return record.trace_id\n\n @contextmanager\n def open_context(\n self,\n *,\n alias: str,\n parent_id: str | None = None,\n kind: str | None = None,\n attrs: dict[str, Any] | None = None,\n ) -> Iterator[str]:\n trace_id = self.create_context(alias=alias, parent_id=parent_id, kind=kind, attrs=attrs)\n try:\n yield trace_id\n finally:\n self.store.pop()\n\n def current_trace_id(self) -> str | None:\n return self.store.current_trace_id()\n\n def close_context(self) -> str | None:\n previous = self.store.pop()\n return previous.record.trace_id if previous else None\n\n def step(self, name: str) -> None:\n self.store.set_step(str(name or \"\"))\n\n def info(self, message: str, *, status: str | None = None, attrs: dict[str, Any] | None = None) -> None:\n self._write_message(\"INFO\", message, status, attrs)\n\n def debug(self, message: str, *, status: str | None = None, attrs: dict[str, Any] | None = None) -> None:\n self._write_message(\"DEBUG\", message, status, attrs)\n\n def warning(self, message: str, *, status: str | None = None, attrs: dict[str, Any] | None = None) -> None:\n self._write_message(\"WARNING\", message, status, attrs)\n\n def error(self, message: str, *, status: str | None = None, attrs: dict[str, Any] | None = None) -> None:\n self._write_message(\"ERROR\", message, status, attrs)\n\n def exception(self, message: str, *, status: str = \"failed\", attrs: dict[str, Any] | None = None) -> None:\n self._write_message(\"ERROR\", message, status, attrs)\n\n def new_root(self, operation: str) -> TraceContext:\n trace_id = self.create_context(alias=operation, kind=\"operation\", attrs={\"operation\": operation})\n return TraceContext(trace_id=trace_id, span_id=trace_id, attributes={\"operation\": operation})\n\n def child_of(self, parent: TraceContext, operation: str) -> TraceContext:\n trace_id = self.create_context(\n alias=operation,\n parent_id=parent.trace_id,\n kind=\"worker\",\n attrs={\"operation\": operation},\n )\n return TraceContext(\n trace_id=trace_id,\n span_id=trace_id,\n parent_span_id=parent.span_id,\n attributes={\"operation\": operation},\n )\n\n def attach(self, metadata: dict[str, object], context: TraceContext) -> dict[str, object]:\n updated = dict(metadata)\n updated[\"trace_id\"] = context.trace_id\n updated[\"span_id\"] = context.span_id\n updated[\"parent_span_id\"] = context.parent_span_id\n return updated\n\n def resume(self, metadata: dict[str, object], operation: str) -> TraceContext:\n trace_id = str(metadata.get(\"trace_id\") or uuid4().hex)\n span_id = str(metadata.get(\"span_id\") or trace_id)\n parent_id = metadata.get(\"parent_span_id\")\n self.create_context(\n alias=operation,\n parent_id=str(parent_id) if parent_id else None,\n kind=\"worker\",\n attrs=dict(metadata),\n )\n return TraceContext(\n trace_id=trace_id,\n span_id=span_id,\n parent_span_id=str(parent_id) if parent_id else None,\n attributes={\"operation\": operation},\n )\n\n def _write_message(\n self,\n level: TraceLevel,\n message: str,\n status: str | None,\n attrs: dict[str, Any] | None,\n ) -> None:\n active = self.store.current()\n if active is None:\n raise RuntimeError(\"Trace context is not bound. Call create_context() first.\")\n record = TraceLogMessage(\n trace_id=active.record.trace_id,\n step=active.step,\n status=str(status or \"\"),\n message=str(message or \"\"),\n level=level,\n event_time=utc_now(),\n attrs=dict(attrs or {}),\n )\n self._writer.write_message(record)", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/tracing/service.py:TraceService", - "span_start": 39, - "span_end": 166, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 1, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.tracing.service", - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "class TraceManager(TraceService):\n \"\"\"Compatibility alias during the transition from ConfigManager-shaped naming.\"\"\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/tracing/service.py:TraceManager", - "span_start": 169, - "span_end": 170, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 2, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.tracing.service", - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ] - }, - "diagnostics": { - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C0_SOURCE_CHUNKS": "exact_path_fetch", - "C4_SEMANTIC_ROLES": "exact_path_fetch", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C3_ENTRYPOINTS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 8, - "C4_SEMANTIC_ROLES": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C3_ENTRYPOINTS": 6 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C4_SEMANTIC_ROLES": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "TraceService", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "TraceService", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C4_SEMANTIC_ROLES", - "query": "TraceService", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "TraceService", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - }, - { - "layer": "C3_ENTRYPOINTS", - "query": "TraceService", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 1, - "candidates_after_filter": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 6, - "candidates_after_filter": 6 - }, - { - "layer": "C3_ENTRYPOINTS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 3, - "candidates_after_filter": 3 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "TraceService", - "alternatives": [ - "TraceService" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 3, - "fail_reason": null - }, - { - "layer": "C4_SEMANTIC_ROLES", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 6, - "fail_reason": null - }, - { - "layer": "C3_ENTRYPOINTS", - "status": "hit", - "hit_count": 3, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "symbol_resolution": 0, - "retrieval_total": 143, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 48, - "C0_SOURCE_CHUNKS": 20, - "C4_SEMANTIC_ROLES": 16, - "C2_DEPENDENCY_GRAPH": 45, - "C3_ENTRYPOINTS": 11 - }, - "merge_rank": 21 - } - } - }, - { - "step": "llm_answer", - "input": { - "query": "Объясни как работает класс TraceService", - "rag_count": 14 - }, - "output": { - "llm_answer": "Класс `TraceService` представляет собой сервис для управления контекстами трассировки в приложении. Он является фабрикой контекста (`TraceContextFactory`), что указывает на его роль в создании и управлении объектами, связанными с трассировкой.\nКлючевые аспекты работы класса:\n\n1. Инициализация:\n - При инициализации создается объект записи трассировочных данных (`TraceRecordWriter`) и используется транспортная инфраструктура (`TraceTransport`). Если транспорт не указан, по умолчанию применяется заглушка (`NoOpTraceTransport()`).\n \n2. Создание контекста трассировки:\n - Метод `create_context` создает новый контекст трассировки с уникальным идентификатором, записывает его в хранилище (`store`) и отправляет запись через транспортную инфраструктуру.\n - Контекст можно создать с указанием следующих параметров:\n - `alias`: строка, идентифицирующая тип контекста;\n - `parent_id`: родительский идентификатор контекста (если этот контекст вложен);\n - `kind`: тип события (например, запрос, ответ и т.д.);\n - `attrs`: дополнительные атрибуты контекста.\n\n3. Обертка контекста:\n - С помощью декоратора контекста (`@contextmanager`) предоставляется механизм временной области видимости контекста. Внутри блока с этим декоратором вызывается метод создания контекста, возвращающий уникальный идентификатор созданного контекста.\nВозможности и ограничения:\n\n- Класс использует стандартное время UTC для маркировки событий, генерирует уникальные идентификаторы при помощи библиотеки UUID и поддерживает хранение записей в виде атрибутов словаря.\n \nОднако, исходя из представленного контекста, напрямую невозможно точно определить, какие именно транспортные механизмы используются и каким образом реализован механизм хранения контекста. Эти детали скрыты внутри методов `TraceContextStore` и `TraceTransport`, которые явно не описаны здесь.\n\nТаким образом, хотя основные функции класса понятны, детали конкретных реализаций связанных компонентов остаются неизвестными." - }, - "diagnostics": { - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 999, - "evidence_rows": 14, - "evidence_chars": 6323 - }, - "evidence_summary": [ - { - "layer": "C1_SYMBOL_CATALOG", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "count": 6, - "unique_paths": 1 - }, - { - "layer": "C3_ENTRYPOINTS", - "count": 3, - "unique_paths": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 3, - "unique_paths": 1 - } - ], - "prompt_template_id": "intent_code_qa_explain_ru_v3", - "system_prompt_version": "v1" - }, - "timings_ms": { - "prompt_build": 0, - "llm_call": 2992 - } - } - } - ] - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_140708/full_chain_plba_code_subintents_v2_plba-v2-explain-trace-service.md b/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_140708/full_chain_plba_code_subintents_v2_plba-v2-explain-trace-service.md deleted file mode 100644 index e33de2c..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_140708/full_chain_plba_code_subintents_v2_plba-v2-explain-trace-service.md +++ /dev/null @@ -1,34 +0,0 @@ -# plba-v2-explain-trace-service - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_subintents_v2.yaml -- runner: runtime -- mode: full_chain -- passed: True - -## Query -Объясни как работает класс TraceService - -## Actual -{ - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 14, - "llm_answer": "Класс `TraceService` представляет собой сервис для управления контекстами трассировки в приложении. Он является фабрикой контекста (`TraceContextFactory`), что указывает на его роль в создании и управлении объектами, связанными с трассировкой.\nКлючевые аспекты работы класса:\n\n1. Инициализация:\n - При инициализации создается объект записи трассировочных данных (`TraceRecordWriter`) и используется транспортная инфраструктура (`TraceTransport`). Если транспорт не указан, по умолчанию применяется заглушка (`NoOpTraceTransport()`).\n \n2. Создание контекста трассировки:\n - Метод `create_context` создает новый контекст трассировки с уникальным идентификатором, записывает его в хранилище (`store`) и отправляет запись через транспортную инфраструктуру.\n - Контекст можно создать с указанием следующих параметров:\n - `alias`: строка, идентифицирующая тип контекста;\n - `parent_id`: родительский идентификатор контекста (если этот контекст вложен);\n - `kind`: тип события (например, запрос, ответ и т.д.);\n - `attrs`: дополнительные атрибуты контекста.\n\n3. Обертка контекста:\n - С помощью декоратора контекста (`@contextmanager`) предоставляется механизм временной области видимости контекста. Внутри блока с этим декоратором вызывается метод создания контекста, возвращающий уникальный идентификатор созданного контекста.\nВозможности и ограничения:\n\n- Класс использует стандартное время UTC для маркировки событий, генерирует уникальные идентификаторы при помощи библиотеки UUID и поддерживает хранение записей в виде атрибутов словаря.\n \nОднако, исходя из представленного контекста, напрямую невозможно точно определить, какие именно транспортные механизмы используются и каким образом реализован механизм хранения контекста. Эти детали скрыты внутри методов `TraceContextStore` и `TraceTransport`, которые явно не описаны здесь.\n\nТаким образом, хотя основные функции класса понятны, детали конкретных реализаций связанных компонентов остаются неизвестными.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "TraceService" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] -} - -## Mismatches -- none \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_140708/full_chain_plba_code_subintents_v2_plba-v2-find-entrypoints-control-plane.json b/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_140708/full_chain_plba_code_subintents_v2_plba-v2-find-entrypoints-control-plane.json deleted file mode 100644 index 57622d8..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_140708/full_chain_plba_code_subintents_v2_plba-v2-find-entrypoints-control-plane.json +++ /dev/null @@ -1,1236 +0,0 @@ -{ - "case_id": "plba-v2-find-entrypoints-control-plane", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_subintents_v2.yaml", - "runner": "runtime", - "mode": "full_chain", - "actual": { - "intent": "CODE_QA", - "sub_intent": "FIND_ENTRYPOINTS", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 9, - "llm_answer": "Подтверждённые точки входа HTTP control plane:\n\n- GET /health \n Объявлен в `src/app_runtime/control/http_app.py`. Контекст — fastapi, метод обработчика: `health`.\n\n- GET /actions/{action}, POST /actions/{action} \n Объявлены в `src/app_runtime/control/http_app.py`. Контекст — fastapi, методы обработчиков: `action`.\n\nВозможные кандидаты (полезны, но требуют дополнительного подтверждения):\n\n- HTTP метод: неизвестно, путь: `/` \n Не имеет явных маркеров маршрута, однако может быть точкой старта приложения, так как используется uvicorn thread runner для запуска fastapi application. Требуется дополнительное исследование для точной идентификации маршрутов и контекста обработки.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "HTTP", - "control", - "plane" - ], - "layers": [ - "C3_ENTRYPOINTS", - "C0_SOURCE_CHUNKS" - ] - }, - "passed": true, - "mismatches": [], - "details": { - "case_id": "plba-v2-find-entrypoints-control-plane", - "text": "Найди точки входа HTTP control plane", - "mode": "full_chain", - "run_started_at": "2026-03-12T14:07:09", - "rag_session_id": "7d11da21-faa0-4cea-aede-aeabe069164c", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Найди точки входа HTTP control plane", - "symbol_resolution": { - "status": "not_found", - "resolved_symbol": null, - "alternatives": [ - "HTTP", - "control", - "plane" - ], - "confidence": 0.0 - }, - "rag_count": 9, - "rag_rows": [ - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "class HttpControlChannel(ControlChannel):\n def __init__(self, host: str, port: int, timeout: int) -> None:\n self._timeout = timeout\n self._runner = UvicornThreadRunner(host, port, timeout)\n self._factory = HttpControlAppFactory()\n self._actions: ControlActionSet | None = None\n\n async def start(self, actions: ControlActionSet) -> None:\n self._actions = actions\n app = self._factory.create(self._health_response, self._action_response)\n await self._runner.start(app)\n\n async def stop(self) -> None:\n await self._runner.stop()\n\n @property\n def port(self) -> int:\n return self._runner.port\n\n async def _health_response(self) -> dict[str, object]:\n if self._actions is None:\n return {\"status\": \"unhealthy\", \"detail\": \"control actions are not configured\"}\n return await asyncio.wait_for(self._actions.health(), timeout=float(self._timeout))\n\n async def _action_response(self, action: str, _client_source: str = \"unknown\") -> JSONResponse:\n if self._actions is None:\n return JSONResponse(content={\"status\": \"error\", \"detail\": f\"{action} handler is not configured\"}, status_code=404)\n callbacks = {\n \"start\": self._actions.start,\n \"stop\": self._actions.stop,\n \"status\": self._actions.status,\n }\n callback = callbacks.get(action)\n if callback is None:\n return JSONResponse(content={\"status\": \"error\", \"detail\": f\"unsupported action: {action}\"}, status_code=404)\n action_timeout = max(float(self._timeout), 10.0) if action in {\"start\", \"stop\"} else float(self._timeout)\n try:\n detail = await asyncio.wait_for(callback(), timeout=action_timeout)\n except asyncio.TimeoutError:\n return JSONResponse(\n content={\"status\": \"accepted\", \"detail\": f\"{action} operation is still in progress\"},\n status_code=202,\n )\n except Exception as exc:\n return JSONResponse(content={\"status\": \"error\", \"detail\": str(exc)}, status_code=500)\n return JSONResponse(content={\"status\": \"ok\", \"detail\": detail or f\"{action} action accepted\"}, status_code=200)", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/http_channel.py:HttpControlChannel", - "span_start": 12, - "span_end": 57, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.http_channel", - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "class HttpControlAppFactory:\n def create(\n self,\n health_provider: Callable[[], Awaitable[HealthPayload]],\n action_provider: Callable[[str, str], Awaitable[JSONResponse]],\n ) -> FastAPI:\n app = FastAPI(title=\"PLBA Control API\")\n\n @app.middleware(\"http\")\n async def log_api_call(request: Request, call_next): # type: ignore[no-untyped-def]\n started = time.monotonic()\n response = await call_next(request)\n response.headers[\"X-Response-Time-Ms\"] = str(int((time.monotonic() - started) * 1000))\n return response\n\n @app.get(\"/health\")\n async def health() -> JSONResponse:\n payload = await health_provider()\n status_code = 200 if payload.get(\"status\") == \"ok\" else 503\n return JSONResponse(content=payload, status_code=status_code)\n\n @app.get(\"/actions/{action}\")\n @app.post(\"/actions/{action}\")\n async def action(action: str, request: Request) -> JSONResponse:\n client_source = self._client_source(request)\n if action in {\"start\", \"stop\"}:\n LOGGER.warning(\"Control action requested: /actions/%s client=%s\", action, client_source)\n return await action_provider(action, client_source)\n\n return app\n\n def _client_source(self, request: Request) -> str:\n explicit_header = request.headers.get(\"X-Client-Source\", \"\").strip()\n if explicit_header:\n return explicit_header\n user_agent = request.headers.get(\"User-Agent\", \"\").strip()\n if user_agent:\n return f\"user-agent:{user_agent}\"\n return \"unknown\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/http_app.py:HttpControlAppFactory", - "span_start": 15, - "span_end": 53, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.http_app", - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "class ControlActionSet:\n health: HealthHandler\n start: ActionHandler\n stop: ActionHandler\n status: ActionHandler", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/base.py:ControlActionSet", - "span_start": 14, - "span_end": 18, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.base", - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/__init__.py", - "content": "from app_runtime.control.base import ControlActionSet, ControlChannel\nfrom app_runtime.control.http_channel import HttpControlChannel\nfrom app_runtime.control.service import ControlPlaneService\n\n__all__ = [\"ControlActionSet\", \"ControlChannel\", \"ControlPlaneService\", \"HttpControlChannel\"]", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/__init__.py:1-5", - "span_start": 1, - "span_end": 5, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.app_runtime.control.__init__", - "is_test": false, - "blob_sha": "bf3c37e3369a84cc618adc0fd71c232e5eb4b871eaff743069a17e661e498316", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "class ControlChannel(ABC):\n @abstractmethod\n async def start(self, actions: ControlActionSet) -> None:\n \"\"\"Start the control channel and bind handlers.\"\"\"\n\n @abstractmethod\n async def stop(self) -> None:\n \"\"\"Stop the control channel and release resources.\"\"\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/base.py:ControlChannel", - "span_start": 21, - "span_end": 28, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 1, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.base", - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_runner.py", - "content": "class UvicornThreadRunner:\n def __init__(self, host: str, port: int, timeout: int) -> None:\n self._host = host\n self._port = port\n self._timeout = timeout\n self._server: Server | None = None\n self._thread: Thread | None = None\n self._error: BaseException | None = None\n\n async def start(self, app: FastAPI) -> None:\n if self._thread is not None and self._thread.is_alive():\n return\n self._error = None\n config = Config(app=app, host=self._host, port=self._port, log_level=\"warning\")\n self._server = Server(config)\n self._thread = Thread(target=self._serve, name=\"plba-http-control\", daemon=True)\n self._thread.start()\n await self._wait_until_started()\n\n async def stop(self) -> None:\n if self._server is None or self._thread is None:\n return\n self._server.should_exit = True\n await asyncio.to_thread(self._thread.join, self._timeout)\n self._server = None\n self._thread = None\n\n @property\n def port(self) -> int:\n if self._server is None or not getattr(self._server, \"servers\", None):\n return self._port\n socket = self._server.servers[0].sockets[0]\n return int(socket.getsockname()[1])\n\n async def _wait_until_started(self) -> None:\n if self._server is None:\n raise RuntimeError(\"Server is not initialized\")\n deadline = asyncio.get_running_loop().time() + max(float(self._timeout), 1.0)\n while not self._server.started:\n if self._error is not None:\n raise RuntimeError(\"HTTP control server failed to start\") from self._error\n if asyncio.get_running_loop().time() >= deadline:\n raise TimeoutError(\"HTTP control server startup timed out\")\n await asyncio.sleep(0.05)\n\n def _serve(self) -> None:\n if self._server is None:\n return\n try:\n asyncio.run(self._server.serve())\n except BaseException as exc: # noqa: BLE001\n self._error = exc", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/http_runner.py:UvicornThreadRunner", - "span_start": 10, - "span_end": 61, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.http_runner", - "is_test": false, - "blob_sha": "3779fdd2878b770e789a35bb2a89c9d79f13b61c26d7db1b3b683f9bb9e1623f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "llm_answer": "Подтверждённые точки входа HTTP control plane:\n\n- GET /health \n Объявлен в `src/app_runtime/control/http_app.py`. Контекст — fastapi, метод обработчика: `health`.\n\n- GET /actions/{action}, POST /actions/{action} \n Объявлены в `src/app_runtime/control/http_app.py`. Контекст — fastapi, методы обработчиков: `action`.\n\nВозможные кандидаты (полезны, но требуют дополнительного подтверждения):\n\n- HTTP метод: неизвестно, путь: `/` \n Не имеет явных маркеров маршрута, однако может быть точкой старта приложения, так как используется uvicorn thread runner для запуска fastapi application. Требуется дополнительное исследование для точной идентификации маршрутов и контекста обработки.", - "summary": { - "router": { - "intent": "CODE_QA", - "sub_intent": "FIND_ENTRYPOINTS", - "confidence": null - }, - "retrieval": { - "profile": "code", - "layers_hit": [ - "C0_SOURCE_CHUNKS", - "C3_ENTRYPOINTS" - ], - "evidence_sufficient": true - }, - "llm": { - "answer_status": "answered", - "groundedness": "grounded" - } - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "FIND_ENTRYPOINTS", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C3_ENTRYPOINTS", - "C0_SOURCE_CHUNKS" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "HTTP", - "control", - "plane" - ], - "keyword_hints": [ - "HTTP", - "control", - "plane" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "execution": { - "executed_layers": [ - "C3_ENTRYPOINTS", - "C0_SOURCE_CHUNKS" - ], - "retrieval_mode_by_layer": { - "C3_ENTRYPOINTS": "exact_path_fetch", - "C0_SOURCE_CHUNKS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C3_ENTRYPOINTS": 12, - "C0_SOURCE_CHUNKS": 6 - }, - "filters_by_layer": { - "C3_ENTRYPOINTS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C3_ENTRYPOINTS", - "query": "Найди точки входа HTTP control plane", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 12, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Найди точки входа HTTP control plane", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C3_ENTRYPOINTS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 3, - "candidates_after_filter": 3 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 6, - "candidates_after_filter": 6 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "not_found", - "resolved_symbol": null, - "alternatives": [ - "HTTP", - "control", - "plane" - ] - }, - "layers": [ - { - "layer": "C3_ENTRYPOINTS", - "status": "hit", - "hit_count": 3, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 6, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "router": 0, - "symbol_resolution": 0, - "retrieval_total": 46, - "retrieval_by_layer": { - "C3_ENTRYPOINTS": 28, - "C0_SOURCE_CHUNKS": 17 - }, - "merge_rank": 0, - "prompt_build": 0, - "llm_call": 1362 - }, - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 1139, - "evidence_rows": 9, - "evidence_chars": 6731 - }, - "evidence_summary": [ - { - "layer": "C3_ENTRYPOINTS", - "count": 3, - "unique_paths": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 6, - "unique_paths": 5 - } - ], - "prompt_template_id": "intent_code_qa_find_entrypoints_ru_v3", - "system_prompt_version": "v1" - }, - "router": { - "conversation_mode": "START", - "keyword_hints": [ - "HTTP", - "control", - "plane" - ], - "path_scope": [] - }, - "llm": { - "used_evidence_count": 9, - "missing_evidence_reason": null - } - }, - "run_info": { - "case_id": "plba-v2-find-entrypoints-control-plane", - "mode": "full_chain", - "run_started_at": "2026-03-12T14:07:09", - "rag_session_id": "7d11da21-faa0-4cea-aede-aeabe069164c", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - }, - "input_request": { - "text": "Найди точки входа HTTP control plane", - "normalized_query": "Найди точки входа HTTP control plane" - }, - "steps": [ - { - "step": "intent_router", - "input": { - "query": "Найди точки входа HTTP control plane" - }, - "output": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Найди точки входа HTTP control plane" - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "FIND_ENTRYPOINTS", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C3_ENTRYPOINTS", - "C0_SOURCE_CHUNKS" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "HTTP", - "control", - "plane" - ], - "keyword_hints": [ - "HTTP", - "control", - "plane" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "timings_ms": { - "router": 0 - } - } - }, - { - "step": "retrieval", - "input": { - "query": "Найди точки входа HTTP control plane" - }, - "output": { - "symbol_resolution": { - "status": "not_found", - "resolved_symbol": null, - "alternatives": [ - "HTTP", - "control", - "plane" - ], - "confidence": 0.0 - }, - "rag_count": 9, - "rag_rows": [ - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "class HttpControlChannel(ControlChannel):\n def __init__(self, host: str, port: int, timeout: int) -> None:\n self._timeout = timeout\n self._runner = UvicornThreadRunner(host, port, timeout)\n self._factory = HttpControlAppFactory()\n self._actions: ControlActionSet | None = None\n\n async def start(self, actions: ControlActionSet) -> None:\n self._actions = actions\n app = self._factory.create(self._health_response, self._action_response)\n await self._runner.start(app)\n\n async def stop(self) -> None:\n await self._runner.stop()\n\n @property\n def port(self) -> int:\n return self._runner.port\n\n async def _health_response(self) -> dict[str, object]:\n if self._actions is None:\n return {\"status\": \"unhealthy\", \"detail\": \"control actions are not configured\"}\n return await asyncio.wait_for(self._actions.health(), timeout=float(self._timeout))\n\n async def _action_response(self, action: str, _client_source: str = \"unknown\") -> JSONResponse:\n if self._actions is None:\n return JSONResponse(content={\"status\": \"error\", \"detail\": f\"{action} handler is not configured\"}, status_code=404)\n callbacks = {\n \"start\": self._actions.start,\n \"stop\": self._actions.stop,\n \"status\": self._actions.status,\n }\n callback = callbacks.get(action)\n if callback is None:\n return JSONResponse(content={\"status\": \"error\", \"detail\": f\"unsupported action: {action}\"}, status_code=404)\n action_timeout = max(float(self._timeout), 10.0) if action in {\"start\", \"stop\"} else float(self._timeout)\n try:\n detail = await asyncio.wait_for(callback(), timeout=action_timeout)\n except asyncio.TimeoutError:\n return JSONResponse(\n content={\"status\": \"accepted\", \"detail\": f\"{action} operation is still in progress\"},\n status_code=202,\n )\n except Exception as exc:\n return JSONResponse(content={\"status\": \"error\", \"detail\": str(exc)}, status_code=500)\n return JSONResponse(content={\"status\": \"ok\", \"detail\": detail or f\"{action} action accepted\"}, status_code=200)", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/http_channel.py:HttpControlChannel", - "span_start": 12, - "span_end": 57, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.http_channel", - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "class HttpControlAppFactory:\n def create(\n self,\n health_provider: Callable[[], Awaitable[HealthPayload]],\n action_provider: Callable[[str, str], Awaitable[JSONResponse]],\n ) -> FastAPI:\n app = FastAPI(title=\"PLBA Control API\")\n\n @app.middleware(\"http\")\n async def log_api_call(request: Request, call_next): # type: ignore[no-untyped-def]\n started = time.monotonic()\n response = await call_next(request)\n response.headers[\"X-Response-Time-Ms\"] = str(int((time.monotonic() - started) * 1000))\n return response\n\n @app.get(\"/health\")\n async def health() -> JSONResponse:\n payload = await health_provider()\n status_code = 200 if payload.get(\"status\") == \"ok\" else 503\n return JSONResponse(content=payload, status_code=status_code)\n\n @app.get(\"/actions/{action}\")\n @app.post(\"/actions/{action}\")\n async def action(action: str, request: Request) -> JSONResponse:\n client_source = self._client_source(request)\n if action in {\"start\", \"stop\"}:\n LOGGER.warning(\"Control action requested: /actions/%s client=%s\", action, client_source)\n return await action_provider(action, client_source)\n\n return app\n\n def _client_source(self, request: Request) -> str:\n explicit_header = request.headers.get(\"X-Client-Source\", \"\").strip()\n if explicit_header:\n return explicit_header\n user_agent = request.headers.get(\"User-Agent\", \"\").strip()\n if user_agent:\n return f\"user-agent:{user_agent}\"\n return \"unknown\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/http_app.py:HttpControlAppFactory", - "span_start": 15, - "span_end": 53, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.http_app", - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "class ControlActionSet:\n health: HealthHandler\n start: ActionHandler\n stop: ActionHandler\n status: ActionHandler", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/base.py:ControlActionSet", - "span_start": 14, - "span_end": 18, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.base", - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/__init__.py", - "content": "from app_runtime.control.base import ControlActionSet, ControlChannel\nfrom app_runtime.control.http_channel import HttpControlChannel\nfrom app_runtime.control.service import ControlPlaneService\n\n__all__ = [\"ControlActionSet\", \"ControlChannel\", \"ControlPlaneService\", \"HttpControlChannel\"]", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/__init__.py:1-5", - "span_start": 1, - "span_end": 5, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.app_runtime.control.__init__", - "is_test": false, - "blob_sha": "bf3c37e3369a84cc618adc0fd71c232e5eb4b871eaff743069a17e661e498316", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "class ControlChannel(ABC):\n @abstractmethod\n async def start(self, actions: ControlActionSet) -> None:\n \"\"\"Start the control channel and bind handlers.\"\"\"\n\n @abstractmethod\n async def stop(self) -> None:\n \"\"\"Stop the control channel and release resources.\"\"\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/base.py:ControlChannel", - "span_start": 21, - "span_end": 28, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 1, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.base", - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_runner.py", - "content": "class UvicornThreadRunner:\n def __init__(self, host: str, port: int, timeout: int) -> None:\n self._host = host\n self._port = port\n self._timeout = timeout\n self._server: Server | None = None\n self._thread: Thread | None = None\n self._error: BaseException | None = None\n\n async def start(self, app: FastAPI) -> None:\n if self._thread is not None and self._thread.is_alive():\n return\n self._error = None\n config = Config(app=app, host=self._host, port=self._port, log_level=\"warning\")\n self._server = Server(config)\n self._thread = Thread(target=self._serve, name=\"plba-http-control\", daemon=True)\n self._thread.start()\n await self._wait_until_started()\n\n async def stop(self) -> None:\n if self._server is None or self._thread is None:\n return\n self._server.should_exit = True\n await asyncio.to_thread(self._thread.join, self._timeout)\n self._server = None\n self._thread = None\n\n @property\n def port(self) -> int:\n if self._server is None or not getattr(self._server, \"servers\", None):\n return self._port\n socket = self._server.servers[0].sockets[0]\n return int(socket.getsockname()[1])\n\n async def _wait_until_started(self) -> None:\n if self._server is None:\n raise RuntimeError(\"Server is not initialized\")\n deadline = asyncio.get_running_loop().time() + max(float(self._timeout), 1.0)\n while not self._server.started:\n if self._error is not None:\n raise RuntimeError(\"HTTP control server failed to start\") from self._error\n if asyncio.get_running_loop().time() >= deadline:\n raise TimeoutError(\"HTTP control server startup timed out\")\n await asyncio.sleep(0.05)\n\n def _serve(self) -> None:\n if self._server is None:\n return\n try:\n asyncio.run(self._server.serve())\n except BaseException as exc: # noqa: BLE001\n self._error = exc", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/http_runner.py:UvicornThreadRunner", - "span_start": 10, - "span_end": 61, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.http_runner", - "is_test": false, - "blob_sha": "3779fdd2878b770e789a35bb2a89c9d79f13b61c26d7db1b3b683f9bb9e1623f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ] - }, - "diagnostics": { - "execution": { - "executed_layers": [ - "C3_ENTRYPOINTS", - "C0_SOURCE_CHUNKS" - ], - "retrieval_mode_by_layer": { - "C3_ENTRYPOINTS": "exact_path_fetch", - "C0_SOURCE_CHUNKS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C3_ENTRYPOINTS": 12, - "C0_SOURCE_CHUNKS": 6 - }, - "filters_by_layer": { - "C3_ENTRYPOINTS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C3_ENTRYPOINTS", - "query": "Найди точки входа HTTP control plane", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 12, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Найди точки входа HTTP control plane", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C3_ENTRYPOINTS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 3, - "candidates_after_filter": 3 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 6, - "candidates_after_filter": 6 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "not_found", - "resolved_symbol": null, - "alternatives": [ - "HTTP", - "control", - "plane" - ] - }, - "layers": [ - { - "layer": "C3_ENTRYPOINTS", - "status": "hit", - "hit_count": 3, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 6, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "symbol_resolution": 0, - "retrieval_total": 46, - "retrieval_by_layer": { - "C3_ENTRYPOINTS": 28, - "C0_SOURCE_CHUNKS": 17 - }, - "merge_rank": 0 - } - } - }, - { - "step": "llm_answer", - "input": { - "query": "Найди точки входа HTTP control plane", - "rag_count": 9 - }, - "output": { - "llm_answer": "Подтверждённые точки входа HTTP control plane:\n\n- GET /health \n Объявлен в `src/app_runtime/control/http_app.py`. Контекст — fastapi, метод обработчика: `health`.\n\n- GET /actions/{action}, POST /actions/{action} \n Объявлены в `src/app_runtime/control/http_app.py`. Контекст — fastapi, методы обработчиков: `action`.\n\nВозможные кандидаты (полезны, но требуют дополнительного подтверждения):\n\n- HTTP метод: неизвестно, путь: `/` \n Не имеет явных маркеров маршрута, однако может быть точкой старта приложения, так как используется uvicorn thread runner для запуска fastapi application. Требуется дополнительное исследование для точной идентификации маршрутов и контекста обработки." - }, - "diagnostics": { - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 1139, - "evidence_rows": 9, - "evidence_chars": 6731 - }, - "evidence_summary": [ - { - "layer": "C3_ENTRYPOINTS", - "count": 3, - "unique_paths": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 6, - "unique_paths": 5 - } - ], - "prompt_template_id": "intent_code_qa_find_entrypoints_ru_v3", - "system_prompt_version": "v1" - }, - "timings_ms": { - "prompt_build": 0, - "llm_call": 1362 - } - } - } - ] - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_140708/full_chain_plba_code_subintents_v2_plba-v2-find-entrypoints-control-plane.md b/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_140708/full_chain_plba_code_subintents_v2_plba-v2-find-entrypoints-control-plane.md deleted file mode 100644 index 40a749d..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_140708/full_chain_plba_code_subintents_v2_plba-v2-find-entrypoints-control-plane.md +++ /dev/null @@ -1,33 +0,0 @@ -# plba-v2-find-entrypoints-control-plane - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_subintents_v2.yaml -- runner: runtime -- mode: full_chain -- passed: True - -## Query -Найди точки входа HTTP control plane - -## Actual -{ - "intent": "CODE_QA", - "sub_intent": "FIND_ENTRYPOINTS", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 9, - "llm_answer": "Подтверждённые точки входа HTTP control plane:\n\n- GET /health \n Объявлен в `src/app_runtime/control/http_app.py`. Контекст — fastapi, метод обработчика: `health`.\n\n- GET /actions/{action}, POST /actions/{action} \n Объявлены в `src/app_runtime/control/http_app.py`. Контекст — fastapi, методы обработчиков: `action`.\n\nВозможные кандидаты (полезны, но требуют дополнительного подтверждения):\n\n- HTTP метод: неизвестно, путь: `/` \n Не имеет явных маркеров маршрута, однако может быть точкой старта приложения, так как используется uvicorn thread runner для запуска fastapi application. Требуется дополнительное исследование для точной идентификации маршрутов и контекста обработки.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "HTTP", - "control", - "plane" - ], - "layers": [ - "C3_ENTRYPOINTS", - "C0_SOURCE_CHUNKS" - ] -} - -## Mismatches -- none \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_140708/full_chain_plba_code_subintents_v2_plba-v2-find-entrypoints-health-endpoint.json b/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_140708/full_chain_plba_code_subintents_v2_plba-v2-find-entrypoints-health-endpoint.json deleted file mode 100644 index 0d10c71..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_140708/full_chain_plba_code_subintents_v2_plba-v2-find-entrypoints-health-endpoint.json +++ /dev/null @@ -1,1226 +0,0 @@ -{ - "case_id": "plba-v2-find-entrypoints-health-endpoint", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_subintents_v2.yaml", - "runner": "runtime", - "mode": "full_chain", - "actual": { - "intent": "CODE_QA", - "sub_intent": "FIND_ENTRYPOINTS", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 9, - "llm_answer": "Подтверждённый health-endpoint обнаружен по следующим точкам входа:\n\n- HTTP GET `/health \n Объявлен в файле `src/app_runtime/control/http_app.py`, обслуживается FastAPI.\n\nКандидаты на health-endpoint (без явных маркеров route):\n- Нет явных неподтвержденных кандидатов.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "health", - "endpoint" - ], - "layers": [ - "C3_ENTRYPOINTS", - "C0_SOURCE_CHUNKS" - ] - }, - "passed": true, - "mismatches": [], - "details": { - "case_id": "plba-v2-find-entrypoints-health-endpoint", - "text": "Где health endpoint?", - "mode": "full_chain", - "run_started_at": "2026-03-12T14:07:09", - "rag_session_id": "7d11da21-faa0-4cea-aede-aeabe069164c", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Где health endpoint?", - "symbol_resolution": { - "status": "not_found", - "resolved_symbol": null, - "alternatives": [ - "health", - "endpoint" - ], - "confidence": 0.0 - }, - "rag_count": 9, - "rag_rows": [ - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/health/registry.py", - "content": "class HealthRegistry:\n def __init__(self) -> None:\n self._contributors: list[HealthContributor] = []\n\n def register(self, contributor: HealthContributor) -> None:\n self._contributors.append(contributor)\n\n def contributor_healths(self) -> list[WorkerHealth]:\n return [contributor.health() for contributor in self._contributors]\n\n def snapshot(self, worker_healths: list[WorkerHealth]) -> dict[str, object]:\n component_healths = worker_healths + self.contributor_healths()\n return {\n \"status\": self._aggregate_status(component_healths),\n \"components\": [self._health_dict(item) for item in component_healths],\n }\n\n def payload(self, state: LifecycleState, worker_healths: list[WorkerHealth]) -> HealthPayload:\n component_healths = worker_healths + self.contributor_healths()\n if state == LifecycleState.STOPPED:\n return {\"status\": \"unhealthy\", \"detail\": \"state=stopped\", \"state\": state.value}\n if state in {LifecycleState.STARTING, LifecycleState.STOPPING}:\n return {\n \"status\": \"degraded\",\n \"detail\": f\"state={state.value}\",\n \"state\": state.value,\n \"components\": [self._health_dict(item) for item in component_healths],\n }\n return {\n \"status\": self._aggregate_status(component_healths),\n \"state\": state.value,\n \"components\": [self._health_dict(item) for item in component_healths],\n }\n\n def _aggregate_status(self, component_healths: list[WorkerHealth]) -> str:\n if any(item.status == \"unhealthy\" and item.critical for item in component_healths):\n return \"unhealthy\"\n if any(item.status in {\"degraded\", \"unhealthy\"} for item in component_healths):\n return \"degraded\"\n return \"ok\"\n\n def _health_dict(self, health: WorkerHealth) -> dict[str, object]:\n return {\n \"name\": health.name,\n \"status\": health.status,\n \"critical\": health.critical,\n \"detail\": health.detail,\n \"meta\": health.meta,\n }", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/health/registry.py:HealthRegistry", - "span_start": 8, - "span_end": 56, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.health.registry", - "is_test": false, - "blob_sha": "26e6a24daa43407ba5340b74497c20153020e79f8d7828ae502aaec378dfcf75", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/health.py", - "content": "from app_runtime.health.registry import HealthRegistry\n\n__all__ = [\"HealthRegistry\"]", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/health/__init__.py:1-3", - "span_start": 1, - "span_end": 3, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.app_runtime.health.__init__", - "is_test": false, - "blob_sha": "f7b15eed8b1f1cca8dfd467909a2612d8cb4e66e46b972ad89a0c9459ce283a0", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/contracts/health.py", - "content": "class HealthContributor(ABC):\n @abstractmethod\n def health(self) -> WorkerHealth:\n \"\"\"Return contributor health state.\"\"\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/contracts/health.py:HealthContributor", - "span_start": 7, - "span_end": 10, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.contracts.health", - "is_test": false, - "blob_sha": "6bd92611def7131e32d4dd34a8ed85e6cf3c67722ad27797032a632cb30dc097", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/health/__init__.py", - "content": "from app_runtime.health.registry import HealthRegistry\n\n__all__ = [\"HealthRegistry\"]", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/health/__init__.py:1-3", - "span_start": 1, - "span_end": 3, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.app_runtime.health.__init__", - "is_test": false, - "blob_sha": "f7b15eed8b1f1cca8dfd467909a2612d8cb4e66e46b972ad89a0c9459ce283a0", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/contracts/worker.py", - "content": "class WorkerHealth:\n name: str\n status: HealthState\n critical: bool\n detail: str | None = None\n meta: dict[str, Any] = field(default_factory=dict)", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/contracts/worker.py:WorkerHealth", - "span_start": 13, - "span_end": 18, - "lexical_rank": 6, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.contracts.worker", - "is_test": false, - "blob_sha": "e4827d32220f322d8adc3e42769da3ca0cc680db6a5eab7a11f4d8773a75304e", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/contracts/worker.py", - "content": "class Worker(ABC):\n @property\n @abstractmethod\n def name(self) -> str:\n \"\"\"Stable worker name for diagnostics.\"\"\"\n\n @property\n @abstractmethod\n def critical(self) -> bool:\n \"\"\"Whether this worker is required for healthy app operation.\"\"\"\n\n @abstractmethod\n def start(self) -> None:\n \"\"\"Start worker execution.\"\"\"\n\n @abstractmethod\n def stop(self, force: bool = False) -> None:\n \"\"\"Request graceful or immediate stop.\"\"\"\n\n @abstractmethod\n def health(self) -> WorkerHealth:\n \"\"\"Return current health state.\"\"\"\n\n @abstractmethod\n def status(self) -> WorkerStatus:\n \"\"\"Return current runtime status.\"\"\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/contracts/worker.py:Worker", - "span_start": 30, - "span_end": 55, - "lexical_rank": 6, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 2, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.contracts.worker", - "is_test": false, - "blob_sha": "e4827d32220f322d8adc3e42769da3ca0cc680db6a5eab7a11f4d8773a75304e", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "llm_answer": "Подтверждённый health-endpoint обнаружен по следующим точкам входа:\n\n- HTTP GET `/health \n Объявлен в файле `src/app_runtime/control/http_app.py`, обслуживается FastAPI.\n\nКандидаты на health-endpoint (без явных маркеров route):\n- Нет явных неподтвержденных кандидатов.", - "summary": { - "router": { - "intent": "CODE_QA", - "sub_intent": "FIND_ENTRYPOINTS", - "confidence": null - }, - "retrieval": { - "profile": "code", - "layers_hit": [ - "C0_SOURCE_CHUNKS", - "C3_ENTRYPOINTS" - ], - "evidence_sufficient": true - }, - "llm": { - "answer_status": "answered", - "groundedness": "grounded" - } - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "FIND_ENTRYPOINTS", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C3_ENTRYPOINTS", - "C0_SOURCE_CHUNKS" - ], - "symbol_kind_hint": "unknown", - "symbol_candidates": [ - "health", - "endpoint" - ], - "keyword_hints": [ - "health", - "endpoint" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "execution": { - "executed_layers": [ - "C3_ENTRYPOINTS", - "C0_SOURCE_CHUNKS" - ], - "retrieval_mode_by_layer": { - "C3_ENTRYPOINTS": "exact_path_fetch", - "C0_SOURCE_CHUNKS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C3_ENTRYPOINTS": 12, - "C0_SOURCE_CHUNKS": 6 - }, - "filters_by_layer": { - "C3_ENTRYPOINTS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C3_ENTRYPOINTS", - "query": "Где health endpoint?", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 12, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Где health endpoint?", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C3_ENTRYPOINTS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 3, - "candidates_after_filter": 3 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 6, - "candidates_after_filter": 6 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "not_found", - "resolved_symbol": null, - "alternatives": [ - "health", - "endpoint" - ] - }, - "layers": [ - { - "layer": "C3_ENTRYPOINTS", - "status": "hit", - "hit_count": 3, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 6, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "router": 0, - "symbol_resolution": 0, - "retrieval_total": 33, - "retrieval_by_layer": { - "C3_ENTRYPOINTS": 19, - "C0_SOURCE_CHUNKS": 13 - }, - "merge_rank": 0, - "prompt_build": 0, - "llm_call": 717 - }, - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 848, - "evidence_rows": 9, - "evidence_chars": 3350 - }, - "evidence_summary": [ - { - "layer": "C3_ENTRYPOINTS", - "count": 3, - "unique_paths": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 6, - "unique_paths": 5 - } - ], - "prompt_template_id": "intent_code_qa_find_entrypoints_ru_v3", - "system_prompt_version": "v1" - }, - "router": { - "conversation_mode": "START", - "keyword_hints": [ - "health", - "endpoint" - ], - "path_scope": [] - }, - "llm": { - "used_evidence_count": 9, - "missing_evidence_reason": null - } - }, - "run_info": { - "case_id": "plba-v2-find-entrypoints-health-endpoint", - "mode": "full_chain", - "run_started_at": "2026-03-12T14:07:09", - "rag_session_id": "7d11da21-faa0-4cea-aede-aeabe069164c", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - }, - "input_request": { - "text": "Где health endpoint?", - "normalized_query": "Где health endpoint?" - }, - "steps": [ - { - "step": "intent_router", - "input": { - "query": "Где health endpoint?" - }, - "output": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Где health endpoint?" - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "FIND_ENTRYPOINTS", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C3_ENTRYPOINTS", - "C0_SOURCE_CHUNKS" - ], - "symbol_kind_hint": "unknown", - "symbol_candidates": [ - "health", - "endpoint" - ], - "keyword_hints": [ - "health", - "endpoint" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "timings_ms": { - "router": 0 - } - } - }, - { - "step": "retrieval", - "input": { - "query": "Где health endpoint?" - }, - "output": { - "symbol_resolution": { - "status": "not_found", - "resolved_symbol": null, - "alternatives": [ - "health", - "endpoint" - ], - "confidence": 0.0 - }, - "rag_count": 9, - "rag_rows": [ - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/health/registry.py", - "content": "class HealthRegistry:\n def __init__(self) -> None:\n self._contributors: list[HealthContributor] = []\n\n def register(self, contributor: HealthContributor) -> None:\n self._contributors.append(contributor)\n\n def contributor_healths(self) -> list[WorkerHealth]:\n return [contributor.health() for contributor in self._contributors]\n\n def snapshot(self, worker_healths: list[WorkerHealth]) -> dict[str, object]:\n component_healths = worker_healths + self.contributor_healths()\n return {\n \"status\": self._aggregate_status(component_healths),\n \"components\": [self._health_dict(item) for item in component_healths],\n }\n\n def payload(self, state: LifecycleState, worker_healths: list[WorkerHealth]) -> HealthPayload:\n component_healths = worker_healths + self.contributor_healths()\n if state == LifecycleState.STOPPED:\n return {\"status\": \"unhealthy\", \"detail\": \"state=stopped\", \"state\": state.value}\n if state in {LifecycleState.STARTING, LifecycleState.STOPPING}:\n return {\n \"status\": \"degraded\",\n \"detail\": f\"state={state.value}\",\n \"state\": state.value,\n \"components\": [self._health_dict(item) for item in component_healths],\n }\n return {\n \"status\": self._aggregate_status(component_healths),\n \"state\": state.value,\n \"components\": [self._health_dict(item) for item in component_healths],\n }\n\n def _aggregate_status(self, component_healths: list[WorkerHealth]) -> str:\n if any(item.status == \"unhealthy\" and item.critical for item in component_healths):\n return \"unhealthy\"\n if any(item.status in {\"degraded\", \"unhealthy\"} for item in component_healths):\n return \"degraded\"\n return \"ok\"\n\n def _health_dict(self, health: WorkerHealth) -> dict[str, object]:\n return {\n \"name\": health.name,\n \"status\": health.status,\n \"critical\": health.critical,\n \"detail\": health.detail,\n \"meta\": health.meta,\n }", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/health/registry.py:HealthRegistry", - "span_start": 8, - "span_end": 56, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.health.registry", - "is_test": false, - "blob_sha": "26e6a24daa43407ba5340b74497c20153020e79f8d7828ae502aaec378dfcf75", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/health.py", - "content": "from app_runtime.health.registry import HealthRegistry\n\n__all__ = [\"HealthRegistry\"]", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/health/__init__.py:1-3", - "span_start": 1, - "span_end": 3, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.app_runtime.health.__init__", - "is_test": false, - "blob_sha": "f7b15eed8b1f1cca8dfd467909a2612d8cb4e66e46b972ad89a0c9459ce283a0", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/contracts/health.py", - "content": "class HealthContributor(ABC):\n @abstractmethod\n def health(self) -> WorkerHealth:\n \"\"\"Return contributor health state.\"\"\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/contracts/health.py:HealthContributor", - "span_start": 7, - "span_end": 10, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.contracts.health", - "is_test": false, - "blob_sha": "6bd92611def7131e32d4dd34a8ed85e6cf3c67722ad27797032a632cb30dc097", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/health/__init__.py", - "content": "from app_runtime.health.registry import HealthRegistry\n\n__all__ = [\"HealthRegistry\"]", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/health/__init__.py:1-3", - "span_start": 1, - "span_end": 3, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.app_runtime.health.__init__", - "is_test": false, - "blob_sha": "f7b15eed8b1f1cca8dfd467909a2612d8cb4e66e46b972ad89a0c9459ce283a0", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/contracts/worker.py", - "content": "class WorkerHealth:\n name: str\n status: HealthState\n critical: bool\n detail: str | None = None\n meta: dict[str, Any] = field(default_factory=dict)", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/contracts/worker.py:WorkerHealth", - "span_start": 13, - "span_end": 18, - "lexical_rank": 6, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.contracts.worker", - "is_test": false, - "blob_sha": "e4827d32220f322d8adc3e42769da3ca0cc680db6a5eab7a11f4d8773a75304e", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/contracts/worker.py", - "content": "class Worker(ABC):\n @property\n @abstractmethod\n def name(self) -> str:\n \"\"\"Stable worker name for diagnostics.\"\"\"\n\n @property\n @abstractmethod\n def critical(self) -> bool:\n \"\"\"Whether this worker is required for healthy app operation.\"\"\"\n\n @abstractmethod\n def start(self) -> None:\n \"\"\"Start worker execution.\"\"\"\n\n @abstractmethod\n def stop(self, force: bool = False) -> None:\n \"\"\"Request graceful or immediate stop.\"\"\"\n\n @abstractmethod\n def health(self) -> WorkerHealth:\n \"\"\"Return current health state.\"\"\"\n\n @abstractmethod\n def status(self) -> WorkerStatus:\n \"\"\"Return current runtime status.\"\"\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/contracts/worker.py:Worker", - "span_start": 30, - "span_end": 55, - "lexical_rank": 6, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 2, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.contracts.worker", - "is_test": false, - "blob_sha": "e4827d32220f322d8adc3e42769da3ca0cc680db6a5eab7a11f4d8773a75304e", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ] - }, - "diagnostics": { - "execution": { - "executed_layers": [ - "C3_ENTRYPOINTS", - "C0_SOURCE_CHUNKS" - ], - "retrieval_mode_by_layer": { - "C3_ENTRYPOINTS": "exact_path_fetch", - "C0_SOURCE_CHUNKS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C3_ENTRYPOINTS": 12, - "C0_SOURCE_CHUNKS": 6 - }, - "filters_by_layer": { - "C3_ENTRYPOINTS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C3_ENTRYPOINTS", - "query": "Где health endpoint?", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 12, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Где health endpoint?", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C3_ENTRYPOINTS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 3, - "candidates_after_filter": 3 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 6, - "candidates_after_filter": 6 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "not_found", - "resolved_symbol": null, - "alternatives": [ - "health", - "endpoint" - ] - }, - "layers": [ - { - "layer": "C3_ENTRYPOINTS", - "status": "hit", - "hit_count": 3, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 6, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "symbol_resolution": 0, - "retrieval_total": 33, - "retrieval_by_layer": { - "C3_ENTRYPOINTS": 19, - "C0_SOURCE_CHUNKS": 13 - }, - "merge_rank": 0 - } - } - }, - { - "step": "llm_answer", - "input": { - "query": "Где health endpoint?", - "rag_count": 9 - }, - "output": { - "llm_answer": "Подтверждённый health-endpoint обнаружен по следующим точкам входа:\n\n- HTTP GET `/health \n Объявлен в файле `src/app_runtime/control/http_app.py`, обслуживается FastAPI.\n\nКандидаты на health-endpoint (без явных маркеров route):\n- Нет явных неподтвержденных кандидатов." - }, - "diagnostics": { - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 848, - "evidence_rows": 9, - "evidence_chars": 3350 - }, - "evidence_summary": [ - { - "layer": "C3_ENTRYPOINTS", - "count": 3, - "unique_paths": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 6, - "unique_paths": 5 - } - ], - "prompt_template_id": "intent_code_qa_find_entrypoints_ru_v3", - "system_prompt_version": "v1" - }, - "timings_ms": { - "prompt_build": 0, - "llm_call": 717 - } - } - } - ] - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_140708/full_chain_plba_code_subintents_v2_plba-v2-find-entrypoints-health-endpoint.md b/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_140708/full_chain_plba_code_subintents_v2_plba-v2-find-entrypoints-health-endpoint.md deleted file mode 100644 index 3b369c8..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_140708/full_chain_plba_code_subintents_v2_plba-v2-find-entrypoints-health-endpoint.md +++ /dev/null @@ -1,32 +0,0 @@ -# plba-v2-find-entrypoints-health-endpoint - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_subintents_v2.yaml -- runner: runtime -- mode: full_chain -- passed: True - -## Query -Где health endpoint? - -## Actual -{ - "intent": "CODE_QA", - "sub_intent": "FIND_ENTRYPOINTS", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 9, - "llm_answer": "Подтверждённый health-endpoint обнаружен по следующим точкам входа:\n\n- HTTP GET `/health \n Объявлен в файле `src/app_runtime/control/http_app.py`, обслуживается FastAPI.\n\nКандидаты на health-endpoint (без явных маркеров route):\n- Нет явных неподтвержденных кандидатов.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "health", - "endpoint" - ], - "layers": [ - "C3_ENTRYPOINTS", - "C0_SOURCE_CHUNKS" - ] -} - -## Mismatches -- none \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_140708/full_chain_plba_code_subintents_v2_plba-v2-find-tests-create-runtime.json b/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_140708/full_chain_plba_code_subintents_v2_plba-v2-find-tests-create-runtime.json deleted file mode 100644 index e86badd..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_140708/full_chain_plba_code_subintents_v2_plba-v2-find-tests-create-runtime.json +++ /dev/null @@ -1,1963 +0,0 @@ -{ - "case_id": "plba-v2-find-tests-create-runtime", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_subintents_v2.yaml", - "runner": "runtime", - "mode": "full_chain", - "actual": { - "intent": "CODE_QA", - "sub_intent": "FIND_TESTS", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 16, - "llm_answer": "Прямых тестов конкретно для функции `create_runtime` в предоставленном контексте не обнаружено. Её имя не упоминается явно ни в объявлениях (C1), ни в зависимостях (C2), а также отсутствуют явные проверки поведения этой функции.\n\nОднако можно заметить косвенное упоминание о создании runtime через функцию `_build_runtime`, которая используется в тестах:\n\n- В тесте `tests/test_business_control_actions.py:_build_runtime` происходит создание runtime при помощи вызова функции `RuntimeManager()`.\n- Тесты `test_worker_wakes_up_with_configured_interval` и `test_actions_stop_busy_worker_after_timeout` используют блокирующий режим работы и взаимодействуют с worker'ами внутри runtime, но напрямую на `create_runtime` это не указывает.\n\nТаким образом, хотя тестов с прямым названием `create_runtime` нет, косвенно проверка создания runtime осуществляется через взаимодействие с её результатами в функциях `_build_runtime`.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "create_runtime" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ] - }, - "passed": true, - "mismatches": [], - "details": { - "case_id": "plba-v2-find-tests-create-runtime", - "text": "Где тесты для create_runtime?", - "mode": "full_chain", - "run_started_at": "2026-03-12T14:07:09", - "rag_session_id": "7d11da21-faa0-4cea-aede-aeabe069164c", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Где тесты для create_runtime?", - "symbol_resolution": { - "status": "not_found", - "resolved_symbol": null, - "alternatives": [ - "create_runtime" - ], - "confidence": 0.0 - }, - "rag_count": 16, - "rag_rows": [ - { - "path": "tests/test_runtime.py", - "content": "test_public_plba_package_exports_runtime_builder_and_worker_contract imports plba.create_runtime", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_public_plba_package_exports_runtime_builder_and_worker_contract:imports", - "span_start": 349, - "span_end": 349, - "lexical_rank": 6, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e93f80075cd9988737ece3cb5ec659c542132c4d383646e376917bfd0cb6ea64", - "edge_type": "imports", - "src_symbol_id": "ed06ffc5afb8a863cf7da3e40921f17abe4eec2a0770139e3380d93ccaae604a", - "src_qname": "test_public_plba_package_exports_runtime_builder_and_worker_contract", - "dst_symbol_id": null, - "dst_ref": "plba.create_runtime", - "resolution": "partial", - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_runtime.py", - "content": "test_public_plba_package_exports_runtime_builder_and_worker_contract calls create_runtime", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_public_plba_package_exports_runtime_builder_and_worker_contract:calls", - "span_start": 399, - "span_end": 399, - "lexical_rank": 6, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "039939355230de826d8bf7607f55fc59c7d932e5570ecb78994d0f13e57e8488", - "edge_type": "calls", - "src_symbol_id": "ed06ffc5afb8a863cf7da3e40921f17abe4eec2a0770139e3380d93ccaae604a", - "src_qname": "test_public_plba_package_exports_runtime_builder_and_worker_contract", - "dst_symbol_id": null, - "dst_ref": "create_runtime", - "resolution": "partial", - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "test_worker_wakes_up_with_configured_interval\n -> ScenarioWorker\n -> ScenarioWorker.__init__\n -> ScenarioWorker._name\n -> ScenarioWorker.name", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_worker_wakes_up_with_configured_interval:dataflow_slice", - "span_start": 52, - "span_end": 166, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 5, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "2fd137f5852febe907f44d3b3e4ea430f89ccfe962ae1442a16ab9df64c8f76c", - "edge_type": "dataflow_slice", - "src_symbol_id": "65f877f78191d65e6a752e41cedc70ebc784c266804a55c1c56440336e1f0d6e", - "src_qname": "test_worker_wakes_up_with_configured_interval", - "dst_symbol_id": "da022da2c49fd9cfd09d6e6da6bbd59aaa7d28efd669ce8444e88d327ddec2fc", - "dst_ref": "ScenarioWorker.name", - "resolution": "resolved", - "slice_id": "2fd137f5852febe907f44d3b3e4ea430f89ccfe962ae1442a16ab9df64c8f76c", - "root_symbol_id": "65f877f78191d65e6a752e41cedc70ebc784c266804a55c1c56440336e1f0d6e", - "path_symbols": [ - "test_worker_wakes_up_with_configured_interval", - "ScenarioWorker", - "ScenarioWorker.__init__", - "ScenarioWorker._name", - "ScenarioWorker.name" - ], - "path_symbol_ids": [ - "65f877f78191d65e6a752e41cedc70ebc784c266804a55c1c56440336e1f0d6e", - "9a1d08a7eb1831c9f2e0db361b5207f036e477c160773ae08c0b287239785c52", - "9c20be046ba06644d1432e0f20eb223663d2b116ee7d91fdc62bc68323f2e593", - "da022da2c49fd9cfd09d6e6da6bbd59aaa7d28efd669ce8444e88d327ddec2fc" - ], - "path_edge_types": [ - "instantiates", - "writes_attr", - "reads_attr" - ], - "path_length": 5, - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "test_actions_stop_busy_worker_after_timeout\n -> BlockingRoutine\n -> BlockingRoutine.__init__\n -> BlockingRoutine._started\n -> BlockingRoutine.run", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_actions_stop_busy_worker_after_timeout:dataflow_slice", - "span_start": 42, - "span_end": 238, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 5, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "8e7db3d2a9226f1c1d9942ac6373cfcafa0d2276758ddb8a3d3c455a3d58024d", - "edge_type": "dataflow_slice", - "src_symbol_id": "66392d3222421d9ba16eda3554940b16e7d5a6f33aa08c5738d35af2e32f1e4a", - "src_qname": "test_actions_stop_busy_worker_after_timeout", - "dst_symbol_id": "d9841bdbb69706c988ae7ae6adf89928dc4fae45943f74064f5382177034ba04", - "dst_ref": "BlockingRoutine.run", - "resolution": "resolved", - "slice_id": "8e7db3d2a9226f1c1d9942ac6373cfcafa0d2276758ddb8a3d3c455a3d58024d", - "root_symbol_id": "66392d3222421d9ba16eda3554940b16e7d5a6f33aa08c5738d35af2e32f1e4a", - "path_symbols": [ - "test_actions_stop_busy_worker_after_timeout", - "BlockingRoutine", - "BlockingRoutine.__init__", - "BlockingRoutine._started", - "BlockingRoutine.run" - ], - "path_symbol_ids": [ - "66392d3222421d9ba16eda3554940b16e7d5a6f33aa08c5738d35af2e32f1e4a", - "a3349c5bc65e4003a4bbd6a8dbb7a54c337e12d1aed930caa701b12e520f1e67", - "486deeed3043c6db985aef258e96ddc67aa53608e67a83962fbd2471f649ddf1", - "d9841bdbb69706c988ae7ae6adf89928dc4fae45943f74064f5382177034ba04" - ], - "path_edge_types": [ - "instantiates", - "writes_attr", - "reads_attr" - ], - "path_length": 5, - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "test_actions_stop_busy_worker_after_timeout\n -> BlockingRoutine\n -> BlockingRoutine.__init__\n -> BlockingRoutine._release\n -> BlockingRoutine.run", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_actions_stop_busy_worker_after_timeout:dataflow_slice", - "span_start": 43, - "span_end": 238, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 5, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "b59da9da82f9dfc8a9b695a08213786385da1ae9e17561ec3a0450a574a8cb39", - "edge_type": "dataflow_slice", - "src_symbol_id": "66392d3222421d9ba16eda3554940b16e7d5a6f33aa08c5738d35af2e32f1e4a", - "src_qname": "test_actions_stop_busy_worker_after_timeout", - "dst_symbol_id": "d9841bdbb69706c988ae7ae6adf89928dc4fae45943f74064f5382177034ba04", - "dst_ref": "BlockingRoutine.run", - "resolution": "resolved", - "slice_id": "b59da9da82f9dfc8a9b695a08213786385da1ae9e17561ec3a0450a574a8cb39", - "root_symbol_id": "66392d3222421d9ba16eda3554940b16e7d5a6f33aa08c5738d35af2e32f1e4a", - "path_symbols": [ - "test_actions_stop_busy_worker_after_timeout", - "BlockingRoutine", - "BlockingRoutine.__init__", - "BlockingRoutine._release", - "BlockingRoutine.run" - ], - "path_symbol_ids": [ - "66392d3222421d9ba16eda3554940b16e7d5a6f33aa08c5738d35af2e32f1e4a", - "a3349c5bc65e4003a4bbd6a8dbb7a54c337e12d1aed930caa701b12e520f1e67", - "486deeed3043c6db985aef258e96ddc67aa53608e67a83962fbd2471f649ddf1", - "d9841bdbb69706c988ae7ae6adf89928dc4fae45943f74064f5382177034ba04" - ], - "path_edge_types": [ - "instantiates", - "writes_attr", - "reads_attr" - ], - "path_length": 5, - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "test_actions_stop_busy_worker_before_timeout\n -> BlockingRoutine\n -> BlockingRoutine.__init__\n -> BlockingRoutine._started\n -> BlockingRoutine.run", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_actions_stop_busy_worker_before_timeout:dataflow_slice", - "span_start": 42, - "span_end": 212, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 5, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "f9bcce108870e49afa8b32d4625115a10707a3b0e7473179e958e5752bf258b4", - "edge_type": "dataflow_slice", - "src_symbol_id": "a0bb116ca9d909c93a285667ae033fbd1859b2dad7cf34fcb44816393ef6909c", - "src_qname": "test_actions_stop_busy_worker_before_timeout", - "dst_symbol_id": "d9841bdbb69706c988ae7ae6adf89928dc4fae45943f74064f5382177034ba04", - "dst_ref": "BlockingRoutine.run", - "resolution": "resolved", - "slice_id": "f9bcce108870e49afa8b32d4625115a10707a3b0e7473179e958e5752bf258b4", - "root_symbol_id": "a0bb116ca9d909c93a285667ae033fbd1859b2dad7cf34fcb44816393ef6909c", - "path_symbols": [ - "test_actions_stop_busy_worker_before_timeout", - "BlockingRoutine", - "BlockingRoutine.__init__", - "BlockingRoutine._started", - "BlockingRoutine.run" - ], - "path_symbol_ids": [ - "a0bb116ca9d909c93a285667ae033fbd1859b2dad7cf34fcb44816393ef6909c", - "a3349c5bc65e4003a4bbd6a8dbb7a54c337e12d1aed930caa701b12e520f1e67", - "486deeed3043c6db985aef258e96ddc67aa53608e67a83962fbd2471f649ddf1", - "d9841bdbb69706c988ae7ae6adf89928dc4fae45943f74064f5382177034ba04" - ], - "path_edge_types": [ - "instantiates", - "writes_attr", - "reads_attr" - ], - "path_length": 5, - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_runtime.py", - "content": "def test_public_plba_package_exports_runtime_builder_and_worker_contract(tmp_path) -> None:\n import plba\n from plba import ApplicationModule as PublicApplicationModule\n from plba import InMemoryTaskQueue\n from plba import Worker as PublicWorker\n from plba import WorkerHealth as PublicWorkerHealth\n from plba import WorkerStatus as PublicWorkerStatus\n from plba import create_runtime\n\n config_path = tmp_path / \"config.yml\"\n config_path.write_text(\"platform: {}\\n\", encoding=\"utf-8\")\n\n queue = InMemoryTaskQueue[int]()\n queue.put(2)\n assert queue.get(timeout=0.01) == 2\n queue.task_done()\n\n class PublicRoutine:\n def __init__(self) -> None:\n self.runs = 0\n\n def run(self) -> None:\n if self.runs == 0:\n self.runs += 1\n\n class PublicWorkerImpl(PublicWorker):\n def __init__(self, routine: PublicRoutine) -> None:\n self._inner = RoutineWorker(\"public-worker\", routine)\n\n @property\n def name(self) -> str:\n return self._inner.name\n\n @property\n def critical(self) -> bool:\n return self._inner.critical\n\n def start(self) -> None:\n self._inner.start()\n\n def stop(self, force: bool = False) -> None:\n self._inner.stop(force=force)\n\n def health(self) -> PublicWorkerHealth:\n return self._inner.health()\n\n def status(self) -> PublicWorkerStatus:\n return self._inner.status()\n\n class PublicExampleModule(PublicApplicationModule):\n @property\n def name(self) -> str:\n return \"public-example\"\n\n def register(self, registry: ModuleRegistry) -> None:\n registry.add_worker(PublicWorkerImpl(PublicRoutine()))\n\n runtime = create_runtime(PublicExampleModule(), config_path=str(config_path))\n runtime.start()\n sleep(0.2)\n assert runtime.configuration.get() == {\"platform\": {}}\n assert runtime.status()[\"workers\"][\"registered\"] == 1\n assert hasattr(plba, \"QueueWorker\") is False\n runtime.stop()", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_runtime.py:test_public_plba_package_exports_runtime_builder_and_worker_contract", - "span_start": 342, - "span_end": 405, - "lexical_rank": 6, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 13, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_runtime", - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "def _build_runtime(worker: Worker, *, control_timeout: int = 1) -> tuple[RuntimeManager, str]:\n runtime = RuntimeManager()\n channel = HttpControlChannel(host=\"127.0.0.1\", port=0, timeout=control_timeout)\n runtime.control_plane.register_channel(channel)\n runtime.register_module(WorkerModule(worker))\n runtime.start()\n return runtime, f\"http://127.0.0.1:{channel.port}\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:_build_runtime", - "span_start": 154, - "span_end": 160, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 6, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "class IntervalRoutine:\n calls: list[float] = field(default_factory=list)\n _lock: Lock = field(default_factory=Lock)\n\n def run(self) -> None:\n with self._lock:\n self.calls.append(monotonic())\n\n def wait_runs(self, count: int, timeout: float) -> bool:\n deadline = monotonic() + timeout\n while monotonic() < deadline:\n with self._lock:\n if len(self.calls) >= count:\n return True\n sleep(0.01)\n return False\n\n def deltas(self) -> list[float]:\n with self._lock:\n return [self.calls[index + 1] - self.calls[index] for index in range(len(self.calls) - 1)]", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:IntervalRoutine", - "span_start": 18, - "span_end": 37, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "class ScenarioWorker(Worker):\n def __init__(self, name: str, routine: object, *, interval: float = 0.05) -> None:\n self._name = name\n self._routine = routine\n self._interval = interval\n self._thread: Thread | None = None\n self._stop_requested = Event()\n self._in_flight = 0\n self._runs = 0\n self._lock = Lock()\n\n @property\n def name(self) -> str:\n return self._name\n\n @property\n def critical(self) -> bool:\n return True\n\n def start(self) -> None:\n if self._thread is not None and self._thread.is_alive():\n return\n self._stop_requested.clear()\n self._thread = Thread(target=self._loop, name=f\"{self._name}-thread\", daemon=True)\n self._thread.start()\n\n def stop(self, force: bool = False) -> None:\n self._stop_requested.set()\n\n def health(self) -> WorkerHealth:\n return WorkerHealth(name=self.name, status=\"ok\", critical=True, meta={\"runs\": self._runs})\n\n def status(self) -> WorkerStatus:\n thread_alive = self._thread is not None and self._thread.is_alive()\n with self._lock:\n in_flight = self._in_flight\n runs = self._runs\n if not thread_alive:\n state = \"stopped\"\n elif self._stop_requested.is_set():\n state = \"stopping\"\n elif in_flight > 0:\n state = \"busy\"\n else:\n state = \"idle\"\n return WorkerStatus(name=self.name, state=state, in_flight=in_flight, meta={\"runs\": runs})\n\n def _loop(self) -> None:\n while not self._stop_requested.is_set():\n with self._lock:\n self._in_flight += 1\n try:\n self._routine.run()\n with self._lock:\n self._runs += 1\n finally:\n with self._lock:\n self._in_flight -= 1\n if self._stop_requested.is_set():\n return\n sleep(self._interval)", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:ScenarioWorker", - "span_start": 50, - "span_end": 110, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 2, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "def _http_call_json(\n base_url: str,\n path: str,\n *,\n method: str = \"GET\",\n headers: dict[str, str] | None = None,\n) -> tuple[int, dict[str, object]]:\n request = Request(f\"{base_url}{path}\", method=method, headers=headers or {})\n try:\n with urlopen(request, timeout=15.0) as response:\n status = response.status\n body = response.read()\n except HTTPError as error:\n status = error.code\n body = error.read()\n payload = json.loads(body.decode(\"utf-8\"))\n return status, payload", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:_http_call_json", - "span_start": 125, - "span_end": 141, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 4, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "def _poll_until_stopped(base_url: str, timeout: float = 2.0) -> bool:\n deadline = monotonic() + timeout\n while monotonic() < deadline:\n _, payload = _http_call_json(base_url, \"/actions/status\")\n if payload.get(\"detail\") == \"stopped\":\n return True\n sleep(0.05)\n return False", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:_poll_until_stopped", - "span_start": 144, - "span_end": 151, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 5, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "def test_worker_wakes_up_with_configured_interval() -> None:\n interval = 0.15\n routine = IntervalRoutine()\n worker = ScenarioWorker(\"interval-worker\", routine, interval=interval)\n runtime = RuntimeManager()\n runtime.register_module(WorkerModule(worker))\n\n runtime.start()\n try:\n assert routine.wait_runs(count=3, timeout=2.0) is True\n finally:\n runtime.stop()\n\n deltas = routine.deltas()\n assert len(deltas) >= 2\n assert all(delta >= interval * 0.7 for delta in deltas[:2])", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:test_worker_wakes_up_with_configured_interval", - "span_start": 163, - "span_end": 178, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 7, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "class WorkerModule(ApplicationModule):\n def __init__(self, worker: Worker) -> None:\n self._worker = worker\n\n @property\n def name(self) -> str:\n return \"business-tests\"\n\n def register(self, registry: ModuleRegistry) -> None:\n registry.add_worker(self._worker)", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:WorkerModule", - "span_start": 113, - "span_end": 122, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 3, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "class BlockingRoutine:\n def __init__(self, started: Event, release: Event) -> None:\n self._started = started\n self._release = release\n\n def run(self) -> None:\n self._started.set()\n self._release.wait(timeout=5.0)", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:BlockingRoutine", - "span_start": 40, - "span_end": 47, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 1, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "def test_actions_start_stop_and_health_when_worker_is_idle() -> None:\n runtime, base_url = _build_runtime(ScenarioWorker(\"idle-worker\", IntervalRoutine(), interval=0.2))\n try:\n stop_status, stop_payload = _http_call_json(base_url, \"/actions/stop\", method=\"POST\")\n assert stop_status == 200\n assert isinstance(stop_payload.get(\"detail\"), dict)\n assert stop_payload[\"detail\"][\"timed_out\"] is False\n assert stop_payload[\"detail\"][\"state\"] == \"stopped\"\n\n health_stopped_status, health_stopped_payload = _http_call_json(base_url, \"/health\")\n assert health_stopped_status == 503\n assert health_stopped_payload[\"state\"] == \"stopped\"\n assert health_stopped_payload[\"status\"] == \"unhealthy\"\n\n start_status, start_payload = _http_call_json(base_url, \"/actions/start\", method=\"POST\")\n assert start_status == 200\n assert isinstance(start_payload.get(\"detail\"), dict)\n assert start_payload[\"detail\"][\"timed_out\"] is False\n assert start_payload[\"detail\"][\"state\"] in {\"idle\", \"busy\"}\n\n health_started_status, health_started_payload = _http_call_json(base_url, \"/health\")\n assert health_started_status == 200\n assert health_started_payload[\"status\"] == \"ok\"\n assert health_started_payload[\"state\"] in {\"idle\", \"busy\"}\n finally:\n runtime.stop()", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:test_actions_start_stop_and_health_when_worker_is_idle", - "span_start": 181, - "span_end": 206, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 8, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "llm_answer": "Прямых тестов конкретно для функции `create_runtime` в предоставленном контексте не обнаружено. Её имя не упоминается явно ни в объявлениях (C1), ни в зависимостях (C2), а также отсутствуют явные проверки поведения этой функции.\n\nОднако можно заметить косвенное упоминание о создании runtime через функцию `_build_runtime`, которая используется в тестах:\n\n- В тесте `tests/test_business_control_actions.py:_build_runtime` происходит создание runtime при помощи вызова функции `RuntimeManager()`.\n- Тесты `test_worker_wakes_up_with_configured_interval` и `test_actions_stop_busy_worker_after_timeout` используют блокирующий режим работы и взаимодействуют с worker'ами внутри runtime, но напрямую на `create_runtime` это не указывает.\n\nТаким образом, хотя тестов с прямым названием `create_runtime` нет, косвенно проверка создания runtime осуществляется через взаимодействие с её результатами в функциях `_build_runtime`.", - "summary": { - "router": { - "intent": "CODE_QA", - "sub_intent": "FIND_TESTS", - "confidence": null - }, - "retrieval": { - "profile": "code", - "layers_hit": [ - "C0_SOURCE_CHUNKS", - "C2_DEPENDENCY_GRAPH" - ], - "evidence_sufficient": true - }, - "llm": { - "answer_status": "answered", - "groundedness": "grounded" - } - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "FIND_TESTS", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ], - "symbol_kind_hint": "function", - "symbol_candidates": [ - "create_runtime" - ], - "keyword_hints": [ - "create_runtime" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**", - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "test_file_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "test_symbol_patterns": [ - "test_create_runtime", - "Testcreate_runtime", - "create_runtime" - ], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C0_SOURCE_CHUNKS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C0_SOURCE_CHUNKS": 10 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [], - "include_globs": [ - "src", - "tests" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests" - ] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src", - "tests" - ], - "include_globs": [ - "src", - "tests" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests" - ] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src", - "tests" - ], - "include_globs": [ - "src", - "tests" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests" - ] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "create_runtime", - "path_scope": [], - "include_globs": [ - "src/**", - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "Где тесты для create_runtime? test_create_runtime Testcreate_runtime create_runtime", - "path_scope": [], - "include_globs": [ - "src/**", - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "top_k": 6, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Где тесты для create_runtime? test_create_runtime Testcreate_runtime create_runtime", - "path_scope": [], - "include_globs": [ - "src/**", - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "top_k": 10, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [], - "normalized_include_globs": [ - "src", - "tests" - ], - "normalized_exclude_globs": [], - "normalized_prefer_globs": [ - "tests" - ], - "filter_stage": "post_rank", - "candidates_before_filter": 0, - "candidates_after_filter": 0 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src", - "tests" - ], - "normalized_include_globs": [ - "src", - "tests" - ], - "normalized_exclude_globs": [], - "normalized_prefer_globs": [ - "tests" - ], - "filter_stage": "post_rank", - "candidates_before_filter": 6, - "candidates_after_filter": 6 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src", - "tests" - ], - "normalized_include_globs": [ - "src", - "tests" - ], - "normalized_exclude_globs": [], - "normalized_prefer_globs": [ - "tests" - ], - "filter_stage": "post_rank", - "candidates_before_filter": 10, - "candidates_after_filter": 10 - } - ], - "fallback": { - "used": true, - "reason": "scope_relaxed_no_hits" - }, - "symbol_resolution": { - "status": "not_found", - "resolved_symbol": null, - "alternatives": [ - "create_runtime" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "miss", - "hit_count": 0, - "fail_reason": "scope_relaxed_no_hits" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 6, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 10, - "fail_reason": null - } - ] - }, - "constraint_violations": [ - { - "type": "LAYER_MISSING", - "severity": "warn", - "details": { - "layer": "C1_SYMBOL_CATALOG", - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ] - }, - "suggested_fix": "Increase top_k for this layer or relax constraints for retrieval." - } - ], - "timings_ms": { - "router": 0, - "symbol_resolution": 0, - "retrieval_total": 121, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 53, - "C2_DEPENDENCY_GRAPH": 48, - "C0_SOURCE_CHUNKS": 18 - }, - "merge_rank": 0, - "prompt_build": 0, - "llm_call": 1565 - }, - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 1001, - "evidence_rows": 16, - "evidence_chars": 9185 - }, - "evidence_summary": [ - { - "layer": "C2_DEPENDENCY_GRAPH", - "count": 6, - "unique_paths": 2 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 10, - "unique_paths": 2 - } - ], - "prompt_template_id": "intent_code_qa_find_tests_ru_v3", - "system_prompt_version": "v1" - }, - "router": { - "conversation_mode": "START", - "keyword_hints": [ - "create_runtime" - ], - "path_scope": [] - }, - "llm": { - "used_evidence_count": 16, - "missing_evidence_reason": null - } - }, - "run_info": { - "case_id": "plba-v2-find-tests-create-runtime", - "mode": "full_chain", - "run_started_at": "2026-03-12T14:07:09", - "rag_session_id": "7d11da21-faa0-4cea-aede-aeabe069164c", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - }, - "input_request": { - "text": "Где тесты для create_runtime?", - "normalized_query": "Где тесты для create_runtime?" - }, - "steps": [ - { - "step": "intent_router", - "input": { - "query": "Где тесты для create_runtime?" - }, - "output": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Где тесты для create_runtime?" - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "FIND_TESTS", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ], - "symbol_kind_hint": "function", - "symbol_candidates": [ - "create_runtime" - ], - "keyword_hints": [ - "create_runtime" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**", - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "test_file_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "test_symbol_patterns": [ - "test_create_runtime", - "Testcreate_runtime", - "create_runtime" - ], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "timings_ms": { - "router": 0 - } - } - }, - { - "step": "retrieval", - "input": { - "query": "Где тесты для create_runtime?" - }, - "output": { - "symbol_resolution": { - "status": "not_found", - "resolved_symbol": null, - "alternatives": [ - "create_runtime" - ], - "confidence": 0.0 - }, - "rag_count": 16, - "rag_rows": [ - { - "path": "tests/test_runtime.py", - "content": "test_public_plba_package_exports_runtime_builder_and_worker_contract imports plba.create_runtime", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_public_plba_package_exports_runtime_builder_and_worker_contract:imports", - "span_start": 349, - "span_end": 349, - "lexical_rank": 6, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e93f80075cd9988737ece3cb5ec659c542132c4d383646e376917bfd0cb6ea64", - "edge_type": "imports", - "src_symbol_id": "ed06ffc5afb8a863cf7da3e40921f17abe4eec2a0770139e3380d93ccaae604a", - "src_qname": "test_public_plba_package_exports_runtime_builder_and_worker_contract", - "dst_symbol_id": null, - "dst_ref": "plba.create_runtime", - "resolution": "partial", - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_runtime.py", - "content": "test_public_plba_package_exports_runtime_builder_and_worker_contract calls create_runtime", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_public_plba_package_exports_runtime_builder_and_worker_contract:calls", - "span_start": 399, - "span_end": 399, - "lexical_rank": 6, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "039939355230de826d8bf7607f55fc59c7d932e5570ecb78994d0f13e57e8488", - "edge_type": "calls", - "src_symbol_id": "ed06ffc5afb8a863cf7da3e40921f17abe4eec2a0770139e3380d93ccaae604a", - "src_qname": "test_public_plba_package_exports_runtime_builder_and_worker_contract", - "dst_symbol_id": null, - "dst_ref": "create_runtime", - "resolution": "partial", - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "test_worker_wakes_up_with_configured_interval\n -> ScenarioWorker\n -> ScenarioWorker.__init__\n -> ScenarioWorker._name\n -> ScenarioWorker.name", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_worker_wakes_up_with_configured_interval:dataflow_slice", - "span_start": 52, - "span_end": 166, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 5, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "2fd137f5852febe907f44d3b3e4ea430f89ccfe962ae1442a16ab9df64c8f76c", - "edge_type": "dataflow_slice", - "src_symbol_id": "65f877f78191d65e6a752e41cedc70ebc784c266804a55c1c56440336e1f0d6e", - "src_qname": "test_worker_wakes_up_with_configured_interval", - "dst_symbol_id": "da022da2c49fd9cfd09d6e6da6bbd59aaa7d28efd669ce8444e88d327ddec2fc", - "dst_ref": "ScenarioWorker.name", - "resolution": "resolved", - "slice_id": "2fd137f5852febe907f44d3b3e4ea430f89ccfe962ae1442a16ab9df64c8f76c", - "root_symbol_id": "65f877f78191d65e6a752e41cedc70ebc784c266804a55c1c56440336e1f0d6e", - "path_symbols": [ - "test_worker_wakes_up_with_configured_interval", - "ScenarioWorker", - "ScenarioWorker.__init__", - "ScenarioWorker._name", - "ScenarioWorker.name" - ], - "path_symbol_ids": [ - "65f877f78191d65e6a752e41cedc70ebc784c266804a55c1c56440336e1f0d6e", - "9a1d08a7eb1831c9f2e0db361b5207f036e477c160773ae08c0b287239785c52", - "9c20be046ba06644d1432e0f20eb223663d2b116ee7d91fdc62bc68323f2e593", - "da022da2c49fd9cfd09d6e6da6bbd59aaa7d28efd669ce8444e88d327ddec2fc" - ], - "path_edge_types": [ - "instantiates", - "writes_attr", - "reads_attr" - ], - "path_length": 5, - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "test_actions_stop_busy_worker_after_timeout\n -> BlockingRoutine\n -> BlockingRoutine.__init__\n -> BlockingRoutine._started\n -> BlockingRoutine.run", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_actions_stop_busy_worker_after_timeout:dataflow_slice", - "span_start": 42, - "span_end": 238, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 5, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "8e7db3d2a9226f1c1d9942ac6373cfcafa0d2276758ddb8a3d3c455a3d58024d", - "edge_type": "dataflow_slice", - "src_symbol_id": "66392d3222421d9ba16eda3554940b16e7d5a6f33aa08c5738d35af2e32f1e4a", - "src_qname": "test_actions_stop_busy_worker_after_timeout", - "dst_symbol_id": "d9841bdbb69706c988ae7ae6adf89928dc4fae45943f74064f5382177034ba04", - "dst_ref": "BlockingRoutine.run", - "resolution": "resolved", - "slice_id": "8e7db3d2a9226f1c1d9942ac6373cfcafa0d2276758ddb8a3d3c455a3d58024d", - "root_symbol_id": "66392d3222421d9ba16eda3554940b16e7d5a6f33aa08c5738d35af2e32f1e4a", - "path_symbols": [ - "test_actions_stop_busy_worker_after_timeout", - "BlockingRoutine", - "BlockingRoutine.__init__", - "BlockingRoutine._started", - "BlockingRoutine.run" - ], - "path_symbol_ids": [ - "66392d3222421d9ba16eda3554940b16e7d5a6f33aa08c5738d35af2e32f1e4a", - "a3349c5bc65e4003a4bbd6a8dbb7a54c337e12d1aed930caa701b12e520f1e67", - "486deeed3043c6db985aef258e96ddc67aa53608e67a83962fbd2471f649ddf1", - "d9841bdbb69706c988ae7ae6adf89928dc4fae45943f74064f5382177034ba04" - ], - "path_edge_types": [ - "instantiates", - "writes_attr", - "reads_attr" - ], - "path_length": 5, - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "test_actions_stop_busy_worker_after_timeout\n -> BlockingRoutine\n -> BlockingRoutine.__init__\n -> BlockingRoutine._release\n -> BlockingRoutine.run", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_actions_stop_busy_worker_after_timeout:dataflow_slice", - "span_start": 43, - "span_end": 238, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 5, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "b59da9da82f9dfc8a9b695a08213786385da1ae9e17561ec3a0450a574a8cb39", - "edge_type": "dataflow_slice", - "src_symbol_id": "66392d3222421d9ba16eda3554940b16e7d5a6f33aa08c5738d35af2e32f1e4a", - "src_qname": "test_actions_stop_busy_worker_after_timeout", - "dst_symbol_id": "d9841bdbb69706c988ae7ae6adf89928dc4fae45943f74064f5382177034ba04", - "dst_ref": "BlockingRoutine.run", - "resolution": "resolved", - "slice_id": "b59da9da82f9dfc8a9b695a08213786385da1ae9e17561ec3a0450a574a8cb39", - "root_symbol_id": "66392d3222421d9ba16eda3554940b16e7d5a6f33aa08c5738d35af2e32f1e4a", - "path_symbols": [ - "test_actions_stop_busy_worker_after_timeout", - "BlockingRoutine", - "BlockingRoutine.__init__", - "BlockingRoutine._release", - "BlockingRoutine.run" - ], - "path_symbol_ids": [ - "66392d3222421d9ba16eda3554940b16e7d5a6f33aa08c5738d35af2e32f1e4a", - "a3349c5bc65e4003a4bbd6a8dbb7a54c337e12d1aed930caa701b12e520f1e67", - "486deeed3043c6db985aef258e96ddc67aa53608e67a83962fbd2471f649ddf1", - "d9841bdbb69706c988ae7ae6adf89928dc4fae45943f74064f5382177034ba04" - ], - "path_edge_types": [ - "instantiates", - "writes_attr", - "reads_attr" - ], - "path_length": 5, - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "test_actions_stop_busy_worker_before_timeout\n -> BlockingRoutine\n -> BlockingRoutine.__init__\n -> BlockingRoutine._started\n -> BlockingRoutine.run", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_actions_stop_busy_worker_before_timeout:dataflow_slice", - "span_start": 42, - "span_end": 212, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 5, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "f9bcce108870e49afa8b32d4625115a10707a3b0e7473179e958e5752bf258b4", - "edge_type": "dataflow_slice", - "src_symbol_id": "a0bb116ca9d909c93a285667ae033fbd1859b2dad7cf34fcb44816393ef6909c", - "src_qname": "test_actions_stop_busy_worker_before_timeout", - "dst_symbol_id": "d9841bdbb69706c988ae7ae6adf89928dc4fae45943f74064f5382177034ba04", - "dst_ref": "BlockingRoutine.run", - "resolution": "resolved", - "slice_id": "f9bcce108870e49afa8b32d4625115a10707a3b0e7473179e958e5752bf258b4", - "root_symbol_id": "a0bb116ca9d909c93a285667ae033fbd1859b2dad7cf34fcb44816393ef6909c", - "path_symbols": [ - "test_actions_stop_busy_worker_before_timeout", - "BlockingRoutine", - "BlockingRoutine.__init__", - "BlockingRoutine._started", - "BlockingRoutine.run" - ], - "path_symbol_ids": [ - "a0bb116ca9d909c93a285667ae033fbd1859b2dad7cf34fcb44816393ef6909c", - "a3349c5bc65e4003a4bbd6a8dbb7a54c337e12d1aed930caa701b12e520f1e67", - "486deeed3043c6db985aef258e96ddc67aa53608e67a83962fbd2471f649ddf1", - "d9841bdbb69706c988ae7ae6adf89928dc4fae45943f74064f5382177034ba04" - ], - "path_edge_types": [ - "instantiates", - "writes_attr", - "reads_attr" - ], - "path_length": 5, - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_runtime.py", - "content": "def test_public_plba_package_exports_runtime_builder_and_worker_contract(tmp_path) -> None:\n import plba\n from plba import ApplicationModule as PublicApplicationModule\n from plba import InMemoryTaskQueue\n from plba import Worker as PublicWorker\n from plba import WorkerHealth as PublicWorkerHealth\n from plba import WorkerStatus as PublicWorkerStatus\n from plba import create_runtime\n\n config_path = tmp_path / \"config.yml\"\n config_path.write_text(\"platform: {}\\n\", encoding=\"utf-8\")\n\n queue = InMemoryTaskQueue[int]()\n queue.put(2)\n assert queue.get(timeout=0.01) == 2\n queue.task_done()\n\n class PublicRoutine:\n def __init__(self) -> None:\n self.runs = 0\n\n def run(self) -> None:\n if self.runs == 0:\n self.runs += 1\n\n class PublicWorkerImpl(PublicWorker):\n def __init__(self, routine: PublicRoutine) -> None:\n self._inner = RoutineWorker(\"public-worker\", routine)\n\n @property\n def name(self) -> str:\n return self._inner.name\n\n @property\n def critical(self) -> bool:\n return self._inner.critical\n\n def start(self) -> None:\n self._inner.start()\n\n def stop(self, force: bool = False) -> None:\n self._inner.stop(force=force)\n\n def health(self) -> PublicWorkerHealth:\n return self._inner.health()\n\n def status(self) -> PublicWorkerStatus:\n return self._inner.status()\n\n class PublicExampleModule(PublicApplicationModule):\n @property\n def name(self) -> str:\n return \"public-example\"\n\n def register(self, registry: ModuleRegistry) -> None:\n registry.add_worker(PublicWorkerImpl(PublicRoutine()))\n\n runtime = create_runtime(PublicExampleModule(), config_path=str(config_path))\n runtime.start()\n sleep(0.2)\n assert runtime.configuration.get() == {\"platform\": {}}\n assert runtime.status()[\"workers\"][\"registered\"] == 1\n assert hasattr(plba, \"QueueWorker\") is False\n runtime.stop()", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_runtime.py:test_public_plba_package_exports_runtime_builder_and_worker_contract", - "span_start": 342, - "span_end": 405, - "lexical_rank": 6, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 13, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_runtime", - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "def _build_runtime(worker: Worker, *, control_timeout: int = 1) -> tuple[RuntimeManager, str]:\n runtime = RuntimeManager()\n channel = HttpControlChannel(host=\"127.0.0.1\", port=0, timeout=control_timeout)\n runtime.control_plane.register_channel(channel)\n runtime.register_module(WorkerModule(worker))\n runtime.start()\n return runtime, f\"http://127.0.0.1:{channel.port}\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:_build_runtime", - "span_start": 154, - "span_end": 160, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 6, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "class IntervalRoutine:\n calls: list[float] = field(default_factory=list)\n _lock: Lock = field(default_factory=Lock)\n\n def run(self) -> None:\n with self._lock:\n self.calls.append(monotonic())\n\n def wait_runs(self, count: int, timeout: float) -> bool:\n deadline = monotonic() + timeout\n while monotonic() < deadline:\n with self._lock:\n if len(self.calls) >= count:\n return True\n sleep(0.01)\n return False\n\n def deltas(self) -> list[float]:\n with self._lock:\n return [self.calls[index + 1] - self.calls[index] for index in range(len(self.calls) - 1)]", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:IntervalRoutine", - "span_start": 18, - "span_end": 37, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "class ScenarioWorker(Worker):\n def __init__(self, name: str, routine: object, *, interval: float = 0.05) -> None:\n self._name = name\n self._routine = routine\n self._interval = interval\n self._thread: Thread | None = None\n self._stop_requested = Event()\n self._in_flight = 0\n self._runs = 0\n self._lock = Lock()\n\n @property\n def name(self) -> str:\n return self._name\n\n @property\n def critical(self) -> bool:\n return True\n\n def start(self) -> None:\n if self._thread is not None and self._thread.is_alive():\n return\n self._stop_requested.clear()\n self._thread = Thread(target=self._loop, name=f\"{self._name}-thread\", daemon=True)\n self._thread.start()\n\n def stop(self, force: bool = False) -> None:\n self._stop_requested.set()\n\n def health(self) -> WorkerHealth:\n return WorkerHealth(name=self.name, status=\"ok\", critical=True, meta={\"runs\": self._runs})\n\n def status(self) -> WorkerStatus:\n thread_alive = self._thread is not None and self._thread.is_alive()\n with self._lock:\n in_flight = self._in_flight\n runs = self._runs\n if not thread_alive:\n state = \"stopped\"\n elif self._stop_requested.is_set():\n state = \"stopping\"\n elif in_flight > 0:\n state = \"busy\"\n else:\n state = \"idle\"\n return WorkerStatus(name=self.name, state=state, in_flight=in_flight, meta={\"runs\": runs})\n\n def _loop(self) -> None:\n while not self._stop_requested.is_set():\n with self._lock:\n self._in_flight += 1\n try:\n self._routine.run()\n with self._lock:\n self._runs += 1\n finally:\n with self._lock:\n self._in_flight -= 1\n if self._stop_requested.is_set():\n return\n sleep(self._interval)", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:ScenarioWorker", - "span_start": 50, - "span_end": 110, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 2, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "def _http_call_json(\n base_url: str,\n path: str,\n *,\n method: str = \"GET\",\n headers: dict[str, str] | None = None,\n) -> tuple[int, dict[str, object]]:\n request = Request(f\"{base_url}{path}\", method=method, headers=headers or {})\n try:\n with urlopen(request, timeout=15.0) as response:\n status = response.status\n body = response.read()\n except HTTPError as error:\n status = error.code\n body = error.read()\n payload = json.loads(body.decode(\"utf-8\"))\n return status, payload", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:_http_call_json", - "span_start": 125, - "span_end": 141, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 4, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "def _poll_until_stopped(base_url: str, timeout: float = 2.0) -> bool:\n deadline = monotonic() + timeout\n while monotonic() < deadline:\n _, payload = _http_call_json(base_url, \"/actions/status\")\n if payload.get(\"detail\") == \"stopped\":\n return True\n sleep(0.05)\n return False", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:_poll_until_stopped", - "span_start": 144, - "span_end": 151, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 5, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "def test_worker_wakes_up_with_configured_interval() -> None:\n interval = 0.15\n routine = IntervalRoutine()\n worker = ScenarioWorker(\"interval-worker\", routine, interval=interval)\n runtime = RuntimeManager()\n runtime.register_module(WorkerModule(worker))\n\n runtime.start()\n try:\n assert routine.wait_runs(count=3, timeout=2.0) is True\n finally:\n runtime.stop()\n\n deltas = routine.deltas()\n assert len(deltas) >= 2\n assert all(delta >= interval * 0.7 for delta in deltas[:2])", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:test_worker_wakes_up_with_configured_interval", - "span_start": 163, - "span_end": 178, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 7, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "class WorkerModule(ApplicationModule):\n def __init__(self, worker: Worker) -> None:\n self._worker = worker\n\n @property\n def name(self) -> str:\n return \"business-tests\"\n\n def register(self, registry: ModuleRegistry) -> None:\n registry.add_worker(self._worker)", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:WorkerModule", - "span_start": 113, - "span_end": 122, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 3, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "class BlockingRoutine:\n def __init__(self, started: Event, release: Event) -> None:\n self._started = started\n self._release = release\n\n def run(self) -> None:\n self._started.set()\n self._release.wait(timeout=5.0)", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:BlockingRoutine", - "span_start": 40, - "span_end": 47, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 1, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "def test_actions_start_stop_and_health_when_worker_is_idle() -> None:\n runtime, base_url = _build_runtime(ScenarioWorker(\"idle-worker\", IntervalRoutine(), interval=0.2))\n try:\n stop_status, stop_payload = _http_call_json(base_url, \"/actions/stop\", method=\"POST\")\n assert stop_status == 200\n assert isinstance(stop_payload.get(\"detail\"), dict)\n assert stop_payload[\"detail\"][\"timed_out\"] is False\n assert stop_payload[\"detail\"][\"state\"] == \"stopped\"\n\n health_stopped_status, health_stopped_payload = _http_call_json(base_url, \"/health\")\n assert health_stopped_status == 503\n assert health_stopped_payload[\"state\"] == \"stopped\"\n assert health_stopped_payload[\"status\"] == \"unhealthy\"\n\n start_status, start_payload = _http_call_json(base_url, \"/actions/start\", method=\"POST\")\n assert start_status == 200\n assert isinstance(start_payload.get(\"detail\"), dict)\n assert start_payload[\"detail\"][\"timed_out\"] is False\n assert start_payload[\"detail\"][\"state\"] in {\"idle\", \"busy\"}\n\n health_started_status, health_started_payload = _http_call_json(base_url, \"/health\")\n assert health_started_status == 200\n assert health_started_payload[\"status\"] == \"ok\"\n assert health_started_payload[\"state\"] in {\"idle\", \"busy\"}\n finally:\n runtime.stop()", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:test_actions_start_stop_and_health_when_worker_is_idle", - "span_start": 181, - "span_end": 206, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 8, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ] - }, - "diagnostics": { - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C0_SOURCE_CHUNKS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C0_SOURCE_CHUNKS": 10 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [], - "include_globs": [ - "src", - "tests" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests" - ] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src", - "tests" - ], - "include_globs": [ - "src", - "tests" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests" - ] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src", - "tests" - ], - "include_globs": [ - "src", - "tests" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests" - ] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "create_runtime", - "path_scope": [], - "include_globs": [ - "src/**", - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "Где тесты для create_runtime? test_create_runtime Testcreate_runtime create_runtime", - "path_scope": [], - "include_globs": [ - "src/**", - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "top_k": 6, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Где тесты для create_runtime? test_create_runtime Testcreate_runtime create_runtime", - "path_scope": [], - "include_globs": [ - "src/**", - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "top_k": 10, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [], - "normalized_include_globs": [ - "src", - "tests" - ], - "normalized_exclude_globs": [], - "normalized_prefer_globs": [ - "tests" - ], - "filter_stage": "post_rank", - "candidates_before_filter": 0, - "candidates_after_filter": 0 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src", - "tests" - ], - "normalized_include_globs": [ - "src", - "tests" - ], - "normalized_exclude_globs": [], - "normalized_prefer_globs": [ - "tests" - ], - "filter_stage": "post_rank", - "candidates_before_filter": 6, - "candidates_after_filter": 6 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src", - "tests" - ], - "normalized_include_globs": [ - "src", - "tests" - ], - "normalized_exclude_globs": [], - "normalized_prefer_globs": [ - "tests" - ], - "filter_stage": "post_rank", - "candidates_before_filter": 10, - "candidates_after_filter": 10 - } - ], - "fallback": { - "used": true, - "reason": "scope_relaxed_no_hits" - }, - "symbol_resolution": { - "status": "not_found", - "resolved_symbol": null, - "alternatives": [ - "create_runtime" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "miss", - "hit_count": 0, - "fail_reason": "scope_relaxed_no_hits" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 6, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 10, - "fail_reason": null - } - ] - }, - "constraint_violations": [ - { - "type": "LAYER_MISSING", - "severity": "warn", - "details": { - "layer": "C1_SYMBOL_CATALOG", - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ] - }, - "suggested_fix": "Increase top_k for this layer or relax constraints for retrieval." - } - ], - "timings_ms": { - "symbol_resolution": 0, - "retrieval_total": 121, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 53, - "C2_DEPENDENCY_GRAPH": 48, - "C0_SOURCE_CHUNKS": 18 - }, - "merge_rank": 0 - } - } - }, - { - "step": "llm_answer", - "input": { - "query": "Где тесты для create_runtime?", - "rag_count": 16 - }, - "output": { - "llm_answer": "Прямых тестов конкретно для функции `create_runtime` в предоставленном контексте не обнаружено. Её имя не упоминается явно ни в объявлениях (C1), ни в зависимостях (C2), а также отсутствуют явные проверки поведения этой функции.\n\nОднако можно заметить косвенное упоминание о создании runtime через функцию `_build_runtime`, которая используется в тестах:\n\n- В тесте `tests/test_business_control_actions.py:_build_runtime` происходит создание runtime при помощи вызова функции `RuntimeManager()`.\n- Тесты `test_worker_wakes_up_with_configured_interval` и `test_actions_stop_busy_worker_after_timeout` используют блокирующий режим работы и взаимодействуют с worker'ами внутри runtime, но напрямую на `create_runtime` это не указывает.\n\nТаким образом, хотя тестов с прямым названием `create_runtime` нет, косвенно проверка создания runtime осуществляется через взаимодействие с её результатами в функциях `_build_runtime`." - }, - "diagnostics": { - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 1001, - "evidence_rows": 16, - "evidence_chars": 9185 - }, - "evidence_summary": [ - { - "layer": "C2_DEPENDENCY_GRAPH", - "count": 6, - "unique_paths": 2 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 10, - "unique_paths": 2 - } - ], - "prompt_template_id": "intent_code_qa_find_tests_ru_v3", - "system_prompt_version": "v1" - }, - "timings_ms": { - "prompt_build": 0, - "llm_call": 1565 - } - } - } - ] - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_140708/full_chain_plba_code_subintents_v2_plba-v2-find-tests-create-runtime.md b/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_140708/full_chain_plba_code_subintents_v2_plba-v2-find-tests-create-runtime.md deleted file mode 100644 index cf06fa1..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_140708/full_chain_plba_code_subintents_v2_plba-v2-find-tests-create-runtime.md +++ /dev/null @@ -1,32 +0,0 @@ -# plba-v2-find-tests-create-runtime - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_subintents_v2.yaml -- runner: runtime -- mode: full_chain -- passed: True - -## Query -Где тесты для create_runtime? - -## Actual -{ - "intent": "CODE_QA", - "sub_intent": "FIND_TESTS", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 16, - "llm_answer": "Прямых тестов конкретно для функции `create_runtime` в предоставленном контексте не обнаружено. Её имя не упоминается явно ни в объявлениях (C1), ни в зависимостях (C2), а также отсутствуют явные проверки поведения этой функции.\n\nОднако можно заметить косвенное упоминание о создании runtime через функцию `_build_runtime`, которая используется в тестах:\n\n- В тесте `tests/test_business_control_actions.py:_build_runtime` происходит создание runtime при помощи вызова функции `RuntimeManager()`.\n- Тесты `test_worker_wakes_up_with_configured_interval` и `test_actions_stop_busy_worker_after_timeout` используют блокирующий режим работы и взаимодействуют с worker'ами внутри runtime, но напрямую на `create_runtime` это не указывает.\n\nТаким образом, хотя тестов с прямым названием `create_runtime` нет, косвенно проверка создания runtime осуществляется через взаимодействие с её результатами в функциях `_build_runtime`.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "create_runtime" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ] -} - -## Mismatches -- none \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_140708/full_chain_plba_code_subintents_v2_plba-v2-find-tests-runtime-manager.json b/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_140708/full_chain_plba_code_subintents_v2_plba-v2-find-tests-runtime-manager.json deleted file mode 100644 index c8fb9d0..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_140708/full_chain_plba_code_subintents_v2_plba-v2-find-tests-runtime-manager.json +++ /dev/null @@ -1,1879 +0,0 @@ -{ - "case_id": "plba-v2-find-tests-runtime-manager", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_subintents_v2.yaml", - "runner": "runtime", - "mode": "full_chain", - "actual": { - "intent": "CODE_QA", - "sub_intent": "FIND_TESTS", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 16, - "llm_answer": "Прямые тесты для `RuntimeManager` находятся в следующих файлах:\n\n1. tests/test_runtime.py:\n - `test_runtime_graceful_stop_waits_until_worker_finishes`: проверяет корректность остановки менеджера при завершении работы его рабочих процессов.\n - `test_runtime_runs_worker_routine_and_exposes_status`: тестирует запуск рабочего рутины и отображение статуса выполнения.\n\nЭти тесты непосредственно используют объект `RuntimeManager`, создавая его инстанс и проверяя поведение через регистрацию модулей и выполнение операций запуска/остановки.\n\nКосвенных тестов, которые могли бы касаться `RuntimeManager`, но напрямую не создают его экземпляр, в данном контексте не обнаружено.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "RuntimeManager" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ] - }, - "passed": true, - "mismatches": [], - "details": { - "case_id": "plba-v2-find-tests-runtime-manager", - "text": "Где тесты для RuntimeManager?", - "mode": "full_chain", - "run_started_at": "2026-03-12T14:07:09", - "rag_session_id": "7d11da21-faa0-4cea-aede-aeabe069164c", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Где тесты для RuntimeManager?", - "symbol_resolution": { - "status": "not_found", - "resolved_symbol": null, - "alternatives": [ - "RuntimeManager" - ], - "confidence": 0.0 - }, - "rag_count": 16, - "rag_rows": [ - { - "path": "tests/test_runtime.py", - "content": "test_runtime_runs_worker_routine_and_exposes_status instantiates RuntimeManager", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_runtime_runs_worker_routine_and_exposes_status:instantiates", - "span_start": 209, - "span_end": 209, - "lexical_rank": 6, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "c397a308e7824ba9fe400a754c7e15e66ea6f058d7f5d3e82bb002bb78b509d2", - "edge_type": "instantiates", - "src_symbol_id": "1c767eb5ee08e84f45b18c8ed7531ec0ed73c63fb1594823569672db7b21e992", - "src_qname": "test_runtime_runs_worker_routine_and_exposes_status", - "dst_symbol_id": "aeadc039653807b0da1ca6e3cc1078ee61cfc510b28e7f9c2ec04c59da43cc8d", - "dst_ref": "RuntimeManager", - "resolution": "resolved", - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_runtime.py", - "content": "test_runtime_graceful_stop_waits_until_worker_finishes instantiates RuntimeManager", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_runtime_graceful_stop_waits_until_worker_finishes:instantiates", - "span_start": 229, - "span_end": 229, - "lexical_rank": 6, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "76b4701262ccaa0a7a41691407c4ebdb2ca74a2415d89f0a38ef0d4f608bda93", - "edge_type": "instantiates", - "src_symbol_id": "1076e788e4a03b10d7bc1313a8ad46caa170c13cc026c6e4de994af1a6ae57bf", - "src_qname": "test_runtime_graceful_stop_waits_until_worker_finishes", - "dst_symbol_id": "aeadc039653807b0da1ca6e3cc1078ee61cfc510b28e7f9c2ec04c59da43cc8d", - "dst_ref": "RuntimeManager", - "resolution": "resolved", - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "_build_runtime instantiates RuntimeManager", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "_build_runtime:instantiates", - "span_start": 155, - "span_end": 155, - "lexical_rank": 6, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "7eb254d564944bab6272757ee5ef688862bd321e6941e2495dc942e03b1c9a25", - "edge_type": "instantiates", - "src_symbol_id": "db94031d5245bf82be836a109b4584b43b8e83d37a0f318e03f6c8191896d469", - "src_qname": "_build_runtime", - "dst_symbol_id": "a1572ea8183dc0cd6ddbc74342bbde8c28cecfde37ad40b62feff09f8d103d11", - "dst_ref": "RuntimeManager", - "resolution": "resolved", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "test_worker_wakes_up_with_configured_interval instantiates RuntimeManager", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_worker_wakes_up_with_configured_interval:instantiates", - "span_start": 167, - "span_end": 167, - "lexical_rank": 6, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "189aafc4de0b79c688668f25f0c87166a127df26bd2215452014713b65ef281a", - "edge_type": "instantiates", - "src_symbol_id": "65f877f78191d65e6a752e41cedc70ebc784c266804a55c1c56440336e1f0d6e", - "src_qname": "test_worker_wakes_up_with_configured_interval", - "dst_symbol_id": "a1572ea8183dc0cd6ddbc74342bbde8c28cecfde37ad40b62feff09f8d103d11", - "dst_ref": "RuntimeManager", - "resolution": "resolved", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "test_actions_stop_busy_worker_after_timeout\n -> BlockingRoutine\n -> BlockingRoutine.__init__\n -> BlockingRoutine._started\n -> BlockingRoutine.run", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_actions_stop_busy_worker_after_timeout:dataflow_slice", - "span_start": 42, - "span_end": 238, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 5, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "8e7db3d2a9226f1c1d9942ac6373cfcafa0d2276758ddb8a3d3c455a3d58024d", - "edge_type": "dataflow_slice", - "src_symbol_id": "66392d3222421d9ba16eda3554940b16e7d5a6f33aa08c5738d35af2e32f1e4a", - "src_qname": "test_actions_stop_busy_worker_after_timeout", - "dst_symbol_id": "d9841bdbb69706c988ae7ae6adf89928dc4fae45943f74064f5382177034ba04", - "dst_ref": "BlockingRoutine.run", - "resolution": "resolved", - "slice_id": "8e7db3d2a9226f1c1d9942ac6373cfcafa0d2276758ddb8a3d3c455a3d58024d", - "root_symbol_id": "66392d3222421d9ba16eda3554940b16e7d5a6f33aa08c5738d35af2e32f1e4a", - "path_symbols": [ - "test_actions_stop_busy_worker_after_timeout", - "BlockingRoutine", - "BlockingRoutine.__init__", - "BlockingRoutine._started", - "BlockingRoutine.run" - ], - "path_symbol_ids": [ - "66392d3222421d9ba16eda3554940b16e7d5a6f33aa08c5738d35af2e32f1e4a", - "a3349c5bc65e4003a4bbd6a8dbb7a54c337e12d1aed930caa701b12e520f1e67", - "486deeed3043c6db985aef258e96ddc67aa53608e67a83962fbd2471f649ddf1", - "d9841bdbb69706c988ae7ae6adf89928dc4fae45943f74064f5382177034ba04" - ], - "path_edge_types": [ - "instantiates", - "writes_attr", - "reads_attr" - ], - "path_length": 5, - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "test_actions_stop_busy_worker_before_timeout\n -> BlockingRoutine\n -> BlockingRoutine.__init__\n -> BlockingRoutine._release\n -> BlockingRoutine.run", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_actions_stop_busy_worker_before_timeout:dataflow_slice", - "span_start": 43, - "span_end": 212, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 5, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "8bd726155ba387d3579763ee84dfd2f9a90bc917da88f3b2e89416ab5c1254d6", - "edge_type": "dataflow_slice", - "src_symbol_id": "a0bb116ca9d909c93a285667ae033fbd1859b2dad7cf34fcb44816393ef6909c", - "src_qname": "test_actions_stop_busy_worker_before_timeout", - "dst_symbol_id": "d9841bdbb69706c988ae7ae6adf89928dc4fae45943f74064f5382177034ba04", - "dst_ref": "BlockingRoutine.run", - "resolution": "resolved", - "slice_id": "8bd726155ba387d3579763ee84dfd2f9a90bc917da88f3b2e89416ab5c1254d6", - "root_symbol_id": "a0bb116ca9d909c93a285667ae033fbd1859b2dad7cf34fcb44816393ef6909c", - "path_symbols": [ - "test_actions_stop_busy_worker_before_timeout", - "BlockingRoutine", - "BlockingRoutine.__init__", - "BlockingRoutine._release", - "BlockingRoutine.run" - ], - "path_symbol_ids": [ - "a0bb116ca9d909c93a285667ae033fbd1859b2dad7cf34fcb44816393ef6909c", - "a3349c5bc65e4003a4bbd6a8dbb7a54c337e12d1aed930caa701b12e520f1e67", - "486deeed3043c6db985aef258e96ddc67aa53608e67a83962fbd2471f649ddf1", - "d9841bdbb69706c988ae7ae6adf89928dc4fae45943f74064f5382177034ba04" - ], - "path_edge_types": [ - "instantiates", - "writes_attr", - "reads_attr" - ], - "path_length": 5, - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_runtime.py", - "content": "def test_runtime_graceful_stop_waits_until_worker_finishes() -> None:\n started = Event()\n release = Event()\n runtime = RuntimeManager()\n runtime.register_module(BlockingModule(started, release))\n runtime.start()\n assert started.wait(timeout=1.0) is True\n assert runtime.status()[\"runtime\"][\"state\"] == \"busy\"\n\n stop_thread = Thread(target=runtime.stop, kwargs={\"timeout\": 1.0}, daemon=True)\n stop_thread.start()\n sleep(0.1)\n assert stop_thread.is_alive() is True\n\n release.set()\n stop_thread.join(timeout=1.0)\n assert stop_thread.is_alive() is False\n assert runtime.status()[\"runtime\"][\"state\"] == \"stopped\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_runtime.py:test_runtime_graceful_stop_waits_until_worker_finishes", - "span_start": 226, - "span_end": 243, - "lexical_rank": 6, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 8, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_runtime", - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_runtime.py", - "content": "def test_runtime_runs_worker_routine_and_exposes_status(tmp_path) -> None:\n config_path = tmp_path / \"config.yml\"\n config_path.write_text(\n \"\"\"\nplatform:\n workers: 1\nlog:\n version: 1\n disable_existing_loggers: false\n handlers:\n console:\n class: logging.StreamHandler\n root:\n level: INFO\n handlers: [console]\n\"\"\".strip(),\n encoding=\"utf-8\",\n )\n runtime = RuntimeManager()\n runtime.add_config_file(config_path)\n module = ExampleModule()\n runtime.register_module(module)\n\n runtime.start()\n sleep(0.2)\n status = runtime.status()\n runtime.stop()\n\n assert module.routine.processed == [{\"id\": 1}]\n assert status[\"modules\"] == [\"example\"]\n assert status[\"runtime\"][\"state\"] == \"idle\"\n assert status[\"health\"][\"status\"] == \"ok\"\n assert status[\"config\"] == {\"platform\": {\"workers\": 1}, \"log\": status[\"config\"][\"log\"]}", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_runtime.py:test_runtime_runs_worker_routine_and_exposes_status", - "span_start": 191, - "span_end": 223, - "lexical_rank": 6, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 7, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_runtime", - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "def _build_runtime(worker: Worker, *, control_timeout: int = 1) -> tuple[RuntimeManager, str]:\n runtime = RuntimeManager()\n channel = HttpControlChannel(host=\"127.0.0.1\", port=0, timeout=control_timeout)\n runtime.control_plane.register_channel(channel)\n runtime.register_module(WorkerModule(worker))\n runtime.start()\n return runtime, f\"http://127.0.0.1:{channel.port}\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:_build_runtime", - "span_start": 154, - "span_end": 160, - "lexical_rank": 6, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 6, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "def test_worker_wakes_up_with_configured_interval() -> None:\n interval = 0.15\n routine = IntervalRoutine()\n worker = ScenarioWorker(\"interval-worker\", routine, interval=interval)\n runtime = RuntimeManager()\n runtime.register_module(WorkerModule(worker))\n\n runtime.start()\n try:\n assert routine.wait_runs(count=3, timeout=2.0) is True\n finally:\n runtime.stop()\n\n deltas = routine.deltas()\n assert len(deltas) >= 2\n assert all(delta >= interval * 0.7 for delta in deltas[:2])", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:test_worker_wakes_up_with_configured_interval", - "span_start": 163, - "span_end": 178, - "lexical_rank": 6, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 7, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "class BlockingRoutine:\n def __init__(self, started: Event, release: Event) -> None:\n self._started = started\n self._release = release\n\n def run(self) -> None:\n self._started.set()\n self._release.wait(timeout=5.0)", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:BlockingRoutine", - "span_start": 40, - "span_end": 47, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 1, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "class ScenarioWorker(Worker):\n def __init__(self, name: str, routine: object, *, interval: float = 0.05) -> None:\n self._name = name\n self._routine = routine\n self._interval = interval\n self._thread: Thread | None = None\n self._stop_requested = Event()\n self._in_flight = 0\n self._runs = 0\n self._lock = Lock()\n\n @property\n def name(self) -> str:\n return self._name\n\n @property\n def critical(self) -> bool:\n return True\n\n def start(self) -> None:\n if self._thread is not None and self._thread.is_alive():\n return\n self._stop_requested.clear()\n self._thread = Thread(target=self._loop, name=f\"{self._name}-thread\", daemon=True)\n self._thread.start()\n\n def stop(self, force: bool = False) -> None:\n self._stop_requested.set()\n\n def health(self) -> WorkerHealth:\n return WorkerHealth(name=self.name, status=\"ok\", critical=True, meta={\"runs\": self._runs})\n\n def status(self) -> WorkerStatus:\n thread_alive = self._thread is not None and self._thread.is_alive()\n with self._lock:\n in_flight = self._in_flight\n runs = self._runs\n if not thread_alive:\n state = \"stopped\"\n elif self._stop_requested.is_set():\n state = \"stopping\"\n elif in_flight > 0:\n state = \"busy\"\n else:\n state = \"idle\"\n return WorkerStatus(name=self.name, state=state, in_flight=in_flight, meta={\"runs\": runs})\n\n def _loop(self) -> None:\n while not self._stop_requested.is_set():\n with self._lock:\n self._in_flight += 1\n try:\n self._routine.run()\n with self._lock:\n self._runs += 1\n finally:\n with self._lock:\n self._in_flight -= 1\n if self._stop_requested.is_set():\n return\n sleep(self._interval)", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:ScenarioWorker", - "span_start": 50, - "span_end": 110, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 2, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "class WorkerModule(ApplicationModule):\n def __init__(self, worker: Worker) -> None:\n self._worker = worker\n\n @property\n def name(self) -> str:\n return \"business-tests\"\n\n def register(self, registry: ModuleRegistry) -> None:\n registry.add_worker(self._worker)", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:WorkerModule", - "span_start": 113, - "span_end": 122, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 3, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "def _http_call_json(\n base_url: str,\n path: str,\n *,\n method: str = \"GET\",\n headers: dict[str, str] | None = None,\n) -> tuple[int, dict[str, object]]:\n request = Request(f\"{base_url}{path}\", method=method, headers=headers or {})\n try:\n with urlopen(request, timeout=15.0) as response:\n status = response.status\n body = response.read()\n except HTTPError as error:\n status = error.code\n body = error.read()\n payload = json.loads(body.decode(\"utf-8\"))\n return status, payload", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:_http_call_json", - "span_start": 125, - "span_end": 141, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 4, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "class IntervalRoutine:\n calls: list[float] = field(default_factory=list)\n _lock: Lock = field(default_factory=Lock)\n\n def run(self) -> None:\n with self._lock:\n self.calls.append(monotonic())\n\n def wait_runs(self, count: int, timeout: float) -> bool:\n deadline = monotonic() + timeout\n while monotonic() < deadline:\n with self._lock:\n if len(self.calls) >= count:\n return True\n sleep(0.01)\n return False\n\n def deltas(self) -> list[float]:\n with self._lock:\n return [self.calls[index + 1] - self.calls[index] for index in range(len(self.calls) - 1)]", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:IntervalRoutine", - "span_start": 18, - "span_end": 37, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "def _poll_until_stopped(base_url: str, timeout: float = 2.0) -> bool:\n deadline = monotonic() + timeout\n while monotonic() < deadline:\n _, payload = _http_call_json(base_url, \"/actions/status\")\n if payload.get(\"detail\") == \"stopped\":\n return True\n sleep(0.05)\n return False", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:_poll_until_stopped", - "span_start": 144, - "span_end": 151, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 5, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "llm_answer": "Прямые тесты для `RuntimeManager` находятся в следующих файлах:\n\n1. tests/test_runtime.py:\n - `test_runtime_graceful_stop_waits_until_worker_finishes`: проверяет корректность остановки менеджера при завершении работы его рабочих процессов.\n - `test_runtime_runs_worker_routine_and_exposes_status`: тестирует запуск рабочего рутины и отображение статуса выполнения.\n\nЭти тесты непосредственно используют объект `RuntimeManager`, создавая его инстанс и проверяя поведение через регистрацию модулей и выполнение операций запуска/остановки.\n\nКосвенных тестов, которые могли бы касаться `RuntimeManager`, но напрямую не создают его экземпляр, в данном контексте не обнаружено.", - "summary": { - "router": { - "intent": "CODE_QA", - "sub_intent": "FIND_TESTS", - "confidence": null - }, - "retrieval": { - "profile": "code", - "layers_hit": [ - "C0_SOURCE_CHUNKS", - "C2_DEPENDENCY_GRAPH" - ], - "evidence_sufficient": true - }, - "llm": { - "answer_status": "answered", - "groundedness": "grounded" - } - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "FIND_TESTS", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "RuntimeManager" - ], - "keyword_hints": [ - "RuntimeManager" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**", - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "test_file_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "test_symbol_patterns": [ - "test_runtime_manager", - "TestRuntimeManager", - "RuntimeManager" - ], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C0_SOURCE_CHUNKS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C0_SOURCE_CHUNKS": 10 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [], - "include_globs": [ - "src", - "tests" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests" - ] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src", - "tests" - ], - "include_globs": [ - "src", - "tests" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests" - ] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src", - "tests" - ], - "include_globs": [ - "src", - "tests" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests" - ] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**", - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "Где тесты для RuntimeManager? test_runtime_manager TestRuntimeManager RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**", - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "top_k": 6, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Где тесты для RuntimeManager? test_runtime_manager TestRuntimeManager RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**", - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "top_k": 10, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [], - "normalized_include_globs": [ - "src", - "tests" - ], - "normalized_exclude_globs": [], - "normalized_prefer_globs": [ - "tests" - ], - "filter_stage": "post_rank", - "candidates_before_filter": 0, - "candidates_after_filter": 0 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src", - "tests" - ], - "normalized_include_globs": [ - "src", - "tests" - ], - "normalized_exclude_globs": [], - "normalized_prefer_globs": [ - "tests" - ], - "filter_stage": "post_rank", - "candidates_before_filter": 6, - "candidates_after_filter": 6 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src", - "tests" - ], - "normalized_include_globs": [ - "src", - "tests" - ], - "normalized_exclude_globs": [], - "normalized_prefer_globs": [ - "tests" - ], - "filter_stage": "post_rank", - "candidates_before_filter": 10, - "candidates_after_filter": 10 - } - ], - "fallback": { - "used": true, - "reason": "scope_relaxed_no_hits" - }, - "symbol_resolution": { - "status": "not_found", - "resolved_symbol": null, - "alternatives": [ - "RuntimeManager" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "miss", - "hit_count": 0, - "fail_reason": "scope_relaxed_no_hits" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 6, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 10, - "fail_reason": null - } - ] - }, - "constraint_violations": [ - { - "type": "LAYER_MISSING", - "severity": "warn", - "details": { - "layer": "C1_SYMBOL_CATALOG", - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ] - }, - "suggested_fix": "Increase top_k for this layer or relax constraints for retrieval." - } - ], - "timings_ms": { - "router": 0, - "symbol_resolution": 0, - "retrieval_total": 148, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 81, - "C2_DEPENDENCY_GRAPH": 50, - "C0_SOURCE_CHUNKS": 15 - }, - "merge_rank": 0, - "prompt_build": 0, - "llm_call": 1361 - }, - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 925, - "evidence_rows": 16, - "evidence_chars": 7086 - }, - "evidence_summary": [ - { - "layer": "C2_DEPENDENCY_GRAPH", - "count": 6, - "unique_paths": 2 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 10, - "unique_paths": 2 - } - ], - "prompt_template_id": "intent_code_qa_find_tests_ru_v3", - "system_prompt_version": "v1" - }, - "router": { - "conversation_mode": "START", - "keyword_hints": [ - "RuntimeManager" - ], - "path_scope": [] - }, - "llm": { - "used_evidence_count": 16, - "missing_evidence_reason": null - } - }, - "run_info": { - "case_id": "plba-v2-find-tests-runtime-manager", - "mode": "full_chain", - "run_started_at": "2026-03-12T14:07:09", - "rag_session_id": "7d11da21-faa0-4cea-aede-aeabe069164c", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - }, - "input_request": { - "text": "Где тесты для RuntimeManager?", - "normalized_query": "Где тесты для RuntimeManager?" - }, - "steps": [ - { - "step": "intent_router", - "input": { - "query": "Где тесты для RuntimeManager?" - }, - "output": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Где тесты для RuntimeManager?" - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "FIND_TESTS", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "RuntimeManager" - ], - "keyword_hints": [ - "RuntimeManager" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**", - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "test_file_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "test_symbol_patterns": [ - "test_runtime_manager", - "TestRuntimeManager", - "RuntimeManager" - ], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "timings_ms": { - "router": 0 - } - } - }, - { - "step": "retrieval", - "input": { - "query": "Где тесты для RuntimeManager?" - }, - "output": { - "symbol_resolution": { - "status": "not_found", - "resolved_symbol": null, - "alternatives": [ - "RuntimeManager" - ], - "confidence": 0.0 - }, - "rag_count": 16, - "rag_rows": [ - { - "path": "tests/test_runtime.py", - "content": "test_runtime_runs_worker_routine_and_exposes_status instantiates RuntimeManager", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_runtime_runs_worker_routine_and_exposes_status:instantiates", - "span_start": 209, - "span_end": 209, - "lexical_rank": 6, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "c397a308e7824ba9fe400a754c7e15e66ea6f058d7f5d3e82bb002bb78b509d2", - "edge_type": "instantiates", - "src_symbol_id": "1c767eb5ee08e84f45b18c8ed7531ec0ed73c63fb1594823569672db7b21e992", - "src_qname": "test_runtime_runs_worker_routine_and_exposes_status", - "dst_symbol_id": "aeadc039653807b0da1ca6e3cc1078ee61cfc510b28e7f9c2ec04c59da43cc8d", - "dst_ref": "RuntimeManager", - "resolution": "resolved", - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_runtime.py", - "content": "test_runtime_graceful_stop_waits_until_worker_finishes instantiates RuntimeManager", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_runtime_graceful_stop_waits_until_worker_finishes:instantiates", - "span_start": 229, - "span_end": 229, - "lexical_rank": 6, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "76b4701262ccaa0a7a41691407c4ebdb2ca74a2415d89f0a38ef0d4f608bda93", - "edge_type": "instantiates", - "src_symbol_id": "1076e788e4a03b10d7bc1313a8ad46caa170c13cc026c6e4de994af1a6ae57bf", - "src_qname": "test_runtime_graceful_stop_waits_until_worker_finishes", - "dst_symbol_id": "aeadc039653807b0da1ca6e3cc1078ee61cfc510b28e7f9c2ec04c59da43cc8d", - "dst_ref": "RuntimeManager", - "resolution": "resolved", - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "_build_runtime instantiates RuntimeManager", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "_build_runtime:instantiates", - "span_start": 155, - "span_end": 155, - "lexical_rank": 6, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "7eb254d564944bab6272757ee5ef688862bd321e6941e2495dc942e03b1c9a25", - "edge_type": "instantiates", - "src_symbol_id": "db94031d5245bf82be836a109b4584b43b8e83d37a0f318e03f6c8191896d469", - "src_qname": "_build_runtime", - "dst_symbol_id": "a1572ea8183dc0cd6ddbc74342bbde8c28cecfde37ad40b62feff09f8d103d11", - "dst_ref": "RuntimeManager", - "resolution": "resolved", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "test_worker_wakes_up_with_configured_interval instantiates RuntimeManager", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_worker_wakes_up_with_configured_interval:instantiates", - "span_start": 167, - "span_end": 167, - "lexical_rank": 6, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "189aafc4de0b79c688668f25f0c87166a127df26bd2215452014713b65ef281a", - "edge_type": "instantiates", - "src_symbol_id": "65f877f78191d65e6a752e41cedc70ebc784c266804a55c1c56440336e1f0d6e", - "src_qname": "test_worker_wakes_up_with_configured_interval", - "dst_symbol_id": "a1572ea8183dc0cd6ddbc74342bbde8c28cecfde37ad40b62feff09f8d103d11", - "dst_ref": "RuntimeManager", - "resolution": "resolved", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "test_actions_stop_busy_worker_after_timeout\n -> BlockingRoutine\n -> BlockingRoutine.__init__\n -> BlockingRoutine._started\n -> BlockingRoutine.run", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_actions_stop_busy_worker_after_timeout:dataflow_slice", - "span_start": 42, - "span_end": 238, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 5, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "8e7db3d2a9226f1c1d9942ac6373cfcafa0d2276758ddb8a3d3c455a3d58024d", - "edge_type": "dataflow_slice", - "src_symbol_id": "66392d3222421d9ba16eda3554940b16e7d5a6f33aa08c5738d35af2e32f1e4a", - "src_qname": "test_actions_stop_busy_worker_after_timeout", - "dst_symbol_id": "d9841bdbb69706c988ae7ae6adf89928dc4fae45943f74064f5382177034ba04", - "dst_ref": "BlockingRoutine.run", - "resolution": "resolved", - "slice_id": "8e7db3d2a9226f1c1d9942ac6373cfcafa0d2276758ddb8a3d3c455a3d58024d", - "root_symbol_id": "66392d3222421d9ba16eda3554940b16e7d5a6f33aa08c5738d35af2e32f1e4a", - "path_symbols": [ - "test_actions_stop_busy_worker_after_timeout", - "BlockingRoutine", - "BlockingRoutine.__init__", - "BlockingRoutine._started", - "BlockingRoutine.run" - ], - "path_symbol_ids": [ - "66392d3222421d9ba16eda3554940b16e7d5a6f33aa08c5738d35af2e32f1e4a", - "a3349c5bc65e4003a4bbd6a8dbb7a54c337e12d1aed930caa701b12e520f1e67", - "486deeed3043c6db985aef258e96ddc67aa53608e67a83962fbd2471f649ddf1", - "d9841bdbb69706c988ae7ae6adf89928dc4fae45943f74064f5382177034ba04" - ], - "path_edge_types": [ - "instantiates", - "writes_attr", - "reads_attr" - ], - "path_length": 5, - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "test_actions_stop_busy_worker_before_timeout\n -> BlockingRoutine\n -> BlockingRoutine.__init__\n -> BlockingRoutine._release\n -> BlockingRoutine.run", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_actions_stop_busy_worker_before_timeout:dataflow_slice", - "span_start": 43, - "span_end": 212, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 5, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "8bd726155ba387d3579763ee84dfd2f9a90bc917da88f3b2e89416ab5c1254d6", - "edge_type": "dataflow_slice", - "src_symbol_id": "a0bb116ca9d909c93a285667ae033fbd1859b2dad7cf34fcb44816393ef6909c", - "src_qname": "test_actions_stop_busy_worker_before_timeout", - "dst_symbol_id": "d9841bdbb69706c988ae7ae6adf89928dc4fae45943f74064f5382177034ba04", - "dst_ref": "BlockingRoutine.run", - "resolution": "resolved", - "slice_id": "8bd726155ba387d3579763ee84dfd2f9a90bc917da88f3b2e89416ab5c1254d6", - "root_symbol_id": "a0bb116ca9d909c93a285667ae033fbd1859b2dad7cf34fcb44816393ef6909c", - "path_symbols": [ - "test_actions_stop_busy_worker_before_timeout", - "BlockingRoutine", - "BlockingRoutine.__init__", - "BlockingRoutine._release", - "BlockingRoutine.run" - ], - "path_symbol_ids": [ - "a0bb116ca9d909c93a285667ae033fbd1859b2dad7cf34fcb44816393ef6909c", - "a3349c5bc65e4003a4bbd6a8dbb7a54c337e12d1aed930caa701b12e520f1e67", - "486deeed3043c6db985aef258e96ddc67aa53608e67a83962fbd2471f649ddf1", - "d9841bdbb69706c988ae7ae6adf89928dc4fae45943f74064f5382177034ba04" - ], - "path_edge_types": [ - "instantiates", - "writes_attr", - "reads_attr" - ], - "path_length": 5, - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_runtime.py", - "content": "def test_runtime_graceful_stop_waits_until_worker_finishes() -> None:\n started = Event()\n release = Event()\n runtime = RuntimeManager()\n runtime.register_module(BlockingModule(started, release))\n runtime.start()\n assert started.wait(timeout=1.0) is True\n assert runtime.status()[\"runtime\"][\"state\"] == \"busy\"\n\n stop_thread = Thread(target=runtime.stop, kwargs={\"timeout\": 1.0}, daemon=True)\n stop_thread.start()\n sleep(0.1)\n assert stop_thread.is_alive() is True\n\n release.set()\n stop_thread.join(timeout=1.0)\n assert stop_thread.is_alive() is False\n assert runtime.status()[\"runtime\"][\"state\"] == \"stopped\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_runtime.py:test_runtime_graceful_stop_waits_until_worker_finishes", - "span_start": 226, - "span_end": 243, - "lexical_rank": 6, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 8, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_runtime", - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_runtime.py", - "content": "def test_runtime_runs_worker_routine_and_exposes_status(tmp_path) -> None:\n config_path = tmp_path / \"config.yml\"\n config_path.write_text(\n \"\"\"\nplatform:\n workers: 1\nlog:\n version: 1\n disable_existing_loggers: false\n handlers:\n console:\n class: logging.StreamHandler\n root:\n level: INFO\n handlers: [console]\n\"\"\".strip(),\n encoding=\"utf-8\",\n )\n runtime = RuntimeManager()\n runtime.add_config_file(config_path)\n module = ExampleModule()\n runtime.register_module(module)\n\n runtime.start()\n sleep(0.2)\n status = runtime.status()\n runtime.stop()\n\n assert module.routine.processed == [{\"id\": 1}]\n assert status[\"modules\"] == [\"example\"]\n assert status[\"runtime\"][\"state\"] == \"idle\"\n assert status[\"health\"][\"status\"] == \"ok\"\n assert status[\"config\"] == {\"platform\": {\"workers\": 1}, \"log\": status[\"config\"][\"log\"]}", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_runtime.py:test_runtime_runs_worker_routine_and_exposes_status", - "span_start": 191, - "span_end": 223, - "lexical_rank": 6, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 7, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_runtime", - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "def _build_runtime(worker: Worker, *, control_timeout: int = 1) -> tuple[RuntimeManager, str]:\n runtime = RuntimeManager()\n channel = HttpControlChannel(host=\"127.0.0.1\", port=0, timeout=control_timeout)\n runtime.control_plane.register_channel(channel)\n runtime.register_module(WorkerModule(worker))\n runtime.start()\n return runtime, f\"http://127.0.0.1:{channel.port}\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:_build_runtime", - "span_start": 154, - "span_end": 160, - "lexical_rank": 6, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 6, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "def test_worker_wakes_up_with_configured_interval() -> None:\n interval = 0.15\n routine = IntervalRoutine()\n worker = ScenarioWorker(\"interval-worker\", routine, interval=interval)\n runtime = RuntimeManager()\n runtime.register_module(WorkerModule(worker))\n\n runtime.start()\n try:\n assert routine.wait_runs(count=3, timeout=2.0) is True\n finally:\n runtime.stop()\n\n deltas = routine.deltas()\n assert len(deltas) >= 2\n assert all(delta >= interval * 0.7 for delta in deltas[:2])", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:test_worker_wakes_up_with_configured_interval", - "span_start": 163, - "span_end": 178, - "lexical_rank": 6, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 7, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "class BlockingRoutine:\n def __init__(self, started: Event, release: Event) -> None:\n self._started = started\n self._release = release\n\n def run(self) -> None:\n self._started.set()\n self._release.wait(timeout=5.0)", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:BlockingRoutine", - "span_start": 40, - "span_end": 47, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 1, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "class ScenarioWorker(Worker):\n def __init__(self, name: str, routine: object, *, interval: float = 0.05) -> None:\n self._name = name\n self._routine = routine\n self._interval = interval\n self._thread: Thread | None = None\n self._stop_requested = Event()\n self._in_flight = 0\n self._runs = 0\n self._lock = Lock()\n\n @property\n def name(self) -> str:\n return self._name\n\n @property\n def critical(self) -> bool:\n return True\n\n def start(self) -> None:\n if self._thread is not None and self._thread.is_alive():\n return\n self._stop_requested.clear()\n self._thread = Thread(target=self._loop, name=f\"{self._name}-thread\", daemon=True)\n self._thread.start()\n\n def stop(self, force: bool = False) -> None:\n self._stop_requested.set()\n\n def health(self) -> WorkerHealth:\n return WorkerHealth(name=self.name, status=\"ok\", critical=True, meta={\"runs\": self._runs})\n\n def status(self) -> WorkerStatus:\n thread_alive = self._thread is not None and self._thread.is_alive()\n with self._lock:\n in_flight = self._in_flight\n runs = self._runs\n if not thread_alive:\n state = \"stopped\"\n elif self._stop_requested.is_set():\n state = \"stopping\"\n elif in_flight > 0:\n state = \"busy\"\n else:\n state = \"idle\"\n return WorkerStatus(name=self.name, state=state, in_flight=in_flight, meta={\"runs\": runs})\n\n def _loop(self) -> None:\n while not self._stop_requested.is_set():\n with self._lock:\n self._in_flight += 1\n try:\n self._routine.run()\n with self._lock:\n self._runs += 1\n finally:\n with self._lock:\n self._in_flight -= 1\n if self._stop_requested.is_set():\n return\n sleep(self._interval)", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:ScenarioWorker", - "span_start": 50, - "span_end": 110, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 2, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "class WorkerModule(ApplicationModule):\n def __init__(self, worker: Worker) -> None:\n self._worker = worker\n\n @property\n def name(self) -> str:\n return \"business-tests\"\n\n def register(self, registry: ModuleRegistry) -> None:\n registry.add_worker(self._worker)", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:WorkerModule", - "span_start": 113, - "span_end": 122, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 3, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "def _http_call_json(\n base_url: str,\n path: str,\n *,\n method: str = \"GET\",\n headers: dict[str, str] | None = None,\n) -> tuple[int, dict[str, object]]:\n request = Request(f\"{base_url}{path}\", method=method, headers=headers or {})\n try:\n with urlopen(request, timeout=15.0) as response:\n status = response.status\n body = response.read()\n except HTTPError as error:\n status = error.code\n body = error.read()\n payload = json.loads(body.decode(\"utf-8\"))\n return status, payload", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:_http_call_json", - "span_start": 125, - "span_end": 141, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 4, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "class IntervalRoutine:\n calls: list[float] = field(default_factory=list)\n _lock: Lock = field(default_factory=Lock)\n\n def run(self) -> None:\n with self._lock:\n self.calls.append(monotonic())\n\n def wait_runs(self, count: int, timeout: float) -> bool:\n deadline = monotonic() + timeout\n while monotonic() < deadline:\n with self._lock:\n if len(self.calls) >= count:\n return True\n sleep(0.01)\n return False\n\n def deltas(self) -> list[float]:\n with self._lock:\n return [self.calls[index + 1] - self.calls[index] for index in range(len(self.calls) - 1)]", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:IntervalRoutine", - "span_start": 18, - "span_end": 37, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "def _poll_until_stopped(base_url: str, timeout: float = 2.0) -> bool:\n deadline = monotonic() + timeout\n while monotonic() < deadline:\n _, payload = _http_call_json(base_url, \"/actions/status\")\n if payload.get(\"detail\") == \"stopped\":\n return True\n sleep(0.05)\n return False", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:_poll_until_stopped", - "span_start": 144, - "span_end": 151, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 5, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ] - }, - "diagnostics": { - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C0_SOURCE_CHUNKS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C0_SOURCE_CHUNKS": 10 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [], - "include_globs": [ - "src", - "tests" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests" - ] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src", - "tests" - ], - "include_globs": [ - "src", - "tests" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests" - ] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src", - "tests" - ], - "include_globs": [ - "src", - "tests" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests" - ] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**", - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "Где тесты для RuntimeManager? test_runtime_manager TestRuntimeManager RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**", - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "top_k": 6, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Где тесты для RuntimeManager? test_runtime_manager TestRuntimeManager RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**", - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "top_k": 10, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [], - "normalized_include_globs": [ - "src", - "tests" - ], - "normalized_exclude_globs": [], - "normalized_prefer_globs": [ - "tests" - ], - "filter_stage": "post_rank", - "candidates_before_filter": 0, - "candidates_after_filter": 0 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src", - "tests" - ], - "normalized_include_globs": [ - "src", - "tests" - ], - "normalized_exclude_globs": [], - "normalized_prefer_globs": [ - "tests" - ], - "filter_stage": "post_rank", - "candidates_before_filter": 6, - "candidates_after_filter": 6 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src", - "tests" - ], - "normalized_include_globs": [ - "src", - "tests" - ], - "normalized_exclude_globs": [], - "normalized_prefer_globs": [ - "tests" - ], - "filter_stage": "post_rank", - "candidates_before_filter": 10, - "candidates_after_filter": 10 - } - ], - "fallback": { - "used": true, - "reason": "scope_relaxed_no_hits" - }, - "symbol_resolution": { - "status": "not_found", - "resolved_symbol": null, - "alternatives": [ - "RuntimeManager" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "miss", - "hit_count": 0, - "fail_reason": "scope_relaxed_no_hits" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 6, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 10, - "fail_reason": null - } - ] - }, - "constraint_violations": [ - { - "type": "LAYER_MISSING", - "severity": "warn", - "details": { - "layer": "C1_SYMBOL_CATALOG", - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ] - }, - "suggested_fix": "Increase top_k for this layer or relax constraints for retrieval." - } - ], - "timings_ms": { - "symbol_resolution": 0, - "retrieval_total": 148, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 81, - "C2_DEPENDENCY_GRAPH": 50, - "C0_SOURCE_CHUNKS": 15 - }, - "merge_rank": 0 - } - } - }, - { - "step": "llm_answer", - "input": { - "query": "Где тесты для RuntimeManager?", - "rag_count": 16 - }, - "output": { - "llm_answer": "Прямые тесты для `RuntimeManager` находятся в следующих файлах:\n\n1. tests/test_runtime.py:\n - `test_runtime_graceful_stop_waits_until_worker_finishes`: проверяет корректность остановки менеджера при завершении работы его рабочих процессов.\n - `test_runtime_runs_worker_routine_and_exposes_status`: тестирует запуск рабочего рутины и отображение статуса выполнения.\n\nЭти тесты непосредственно используют объект `RuntimeManager`, создавая его инстанс и проверяя поведение через регистрацию модулей и выполнение операций запуска/остановки.\n\nКосвенных тестов, которые могли бы касаться `RuntimeManager`, но напрямую не создают его экземпляр, в данном контексте не обнаружено." - }, - "diagnostics": { - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 925, - "evidence_rows": 16, - "evidence_chars": 7086 - }, - "evidence_summary": [ - { - "layer": "C2_DEPENDENCY_GRAPH", - "count": 6, - "unique_paths": 2 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 10, - "unique_paths": 2 - } - ], - "prompt_template_id": "intent_code_qa_find_tests_ru_v3", - "system_prompt_version": "v1" - }, - "timings_ms": { - "prompt_build": 0, - "llm_call": 1361 - } - } - } - ] - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_140708/full_chain_plba_code_subintents_v2_plba-v2-find-tests-runtime-manager.md b/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_140708/full_chain_plba_code_subintents_v2_plba-v2-find-tests-runtime-manager.md deleted file mode 100644 index b1f5657..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_140708/full_chain_plba_code_subintents_v2_plba-v2-find-tests-runtime-manager.md +++ /dev/null @@ -1,32 +0,0 @@ -# plba-v2-find-tests-runtime-manager - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_subintents_v2.yaml -- runner: runtime -- mode: full_chain -- passed: True - -## Query -Где тесты для RuntimeManager? - -## Actual -{ - "intent": "CODE_QA", - "sub_intent": "FIND_TESTS", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 16, - "llm_answer": "Прямые тесты для `RuntimeManager` находятся в следующих файлах:\n\n1. tests/test_runtime.py:\n - `test_runtime_graceful_stop_waits_until_worker_finishes`: проверяет корректность остановки менеджера при завершении работы его рабочих процессов.\n - `test_runtime_runs_worker_routine_and_exposes_status`: тестирует запуск рабочего рутины и отображение статуса выполнения.\n\nЭти тесты непосредственно используют объект `RuntimeManager`, создавая его инстанс и проверяя поведение через регистрацию модулей и выполнение операций запуска/остановки.\n\nКосвенных тестов, которые могли бы касаться `RuntimeManager`, но напрямую не создают его экземпляр, в данном контексте не обнаружено.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "RuntimeManager" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ] -} - -## Mismatches -- none \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_140708/full_chain_plba_code_subintents_v2_plba-v2-find-tests-trace-service.json b/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_140708/full_chain_plba_code_subintents_v2_plba-v2-find-tests-trace-service.json deleted file mode 100644 index 778a17b..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_140708/full_chain_plba_code_subintents_v2_plba-v2-find-tests-trace-service.json +++ /dev/null @@ -1,2047 +0,0 @@ -{ - "case_id": "plba-v2-find-tests-trace-service", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_subintents_v2.yaml", - "runner": "runtime", - "mode": "full_chain", - "actual": { - "intent": "CODE_QA", - "sub_intent": "FIND_TESTS", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 16, - "llm_answer": "Прямые тесты для `TraceService` находятся в файле `tests/test_runtime.py`.\n\nВ этих тестах:\n- `test_trace_service_writes_contexts_and_messages` проверяет корректность записи контекста и сообщений при использовании сервиса трассировки.\n- `test_trace_service_supports_debug_warning_and_error_levels` подтверждает поддержку различных уровней логирования (DEBUG, WARNING, ERROR).\n\nОба теста непосредственно обращаются к классу `TraceService`, его методам и зависят от поведения самого класса через интерфейс взаимодействия с транспортом (`RecordingTransport`).", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "TraceService" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ] - }, - "passed": true, - "mismatches": [], - "details": { - "case_id": "plba-v2-find-tests-trace-service", - "text": "Где тесты для TraceService?", - "mode": "full_chain", - "run_started_at": "2026-03-12T14:07:09", - "rag_session_id": "7d11da21-faa0-4cea-aede-aeabe069164c", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Где тесты для TraceService?", - "symbol_resolution": { - "status": "not_found", - "resolved_symbol": null, - "alternatives": [ - "TraceService" - ], - "confidence": 0.0 - }, - "rag_count": 16, - "rag_rows": [ - { - "path": "tests/test_runtime.py", - "content": "test_trace_service_writes_contexts_and_messages\n -> RecordingTransport\n -> RecordingTransport.__init__\n -> RecordingTransport.contexts\n -> test_trace_service_writes_contexts_and_messages", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_trace_service_writes_contexts_and_messages:dataflow_slice", - "span_start": 181, - "span_end": 256, - "lexical_rank": 4, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 5, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "1636a2f70dee79c804259dc114af6c1ab4db27099911e5f97ac97a2bcb59be8a", - "edge_type": "dataflow_slice", - "src_symbol_id": "1600da201da1d0150240b400e3232172354156decdd1a04e1ab1a1edcd3a7e99", - "src_qname": "test_trace_service_writes_contexts_and_messages", - "dst_symbol_id": "1600da201da1d0150240b400e3232172354156decdd1a04e1ab1a1edcd3a7e99", - "dst_ref": "test_trace_service_writes_contexts_and_messages", - "resolution": "resolved", - "slice_id": "1636a2f70dee79c804259dc114af6c1ab4db27099911e5f97ac97a2bcb59be8a", - "root_symbol_id": "1600da201da1d0150240b400e3232172354156decdd1a04e1ab1a1edcd3a7e99", - "path_symbols": [ - "test_trace_service_writes_contexts_and_messages", - "RecordingTransport", - "RecordingTransport.__init__", - "RecordingTransport.contexts", - "test_trace_service_writes_contexts_and_messages" - ], - "path_symbol_ids": [ - "1600da201da1d0150240b400e3232172354156decdd1a04e1ab1a1edcd3a7e99", - "e3d635de1f1880673b69bf73ca6a45caffa5c7fdc23d589d5e40f76b86bdcd33", - "e34d80da723a7115a7a7586b52dc8b5cfda05c581509eee0c1a0296df9a340cb", - "1600da201da1d0150240b400e3232172354156decdd1a04e1ab1a1edcd3a7e99" - ], - "path_edge_types": [ - "instantiates", - "writes_attr", - "reads_attr" - ], - "path_length": 5, - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_runtime.py", - "content": "test_trace_service_writes_contexts_and_messages\n -> RecordingTransport\n -> RecordingTransport.__init__\n -> RecordingTransport.contexts\n -> test_trace_service_allows_messages_without_status", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_trace_service_writes_contexts_and_messages:dataflow_slice", - "span_start": 181, - "span_end": 293, - "lexical_rank": 4, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 5, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "5db5abe56b73f884c5178647bd25ef150064a94a41fc8c052aebaa09bd7fdb3d", - "edge_type": "dataflow_slice", - "src_symbol_id": "1600da201da1d0150240b400e3232172354156decdd1a04e1ab1a1edcd3a7e99", - "src_qname": "test_trace_service_writes_contexts_and_messages", - "dst_symbol_id": "7127ca85ce6447928e195e901d36f1e1f1e8205a686e567c2d1b187431f989df", - "dst_ref": "test_trace_service_allows_messages_without_status", - "resolution": "resolved", - "slice_id": "5db5abe56b73f884c5178647bd25ef150064a94a41fc8c052aebaa09bd7fdb3d", - "root_symbol_id": "1600da201da1d0150240b400e3232172354156decdd1a04e1ab1a1edcd3a7e99", - "path_symbols": [ - "test_trace_service_writes_contexts_and_messages", - "RecordingTransport", - "RecordingTransport.__init__", - "RecordingTransport.contexts", - "test_trace_service_allows_messages_without_status" - ], - "path_symbol_ids": [ - "1600da201da1d0150240b400e3232172354156decdd1a04e1ab1a1edcd3a7e99", - "e3d635de1f1880673b69bf73ca6a45caffa5c7fdc23d589d5e40f76b86bdcd33", - "e34d80da723a7115a7a7586b52dc8b5cfda05c581509eee0c1a0296df9a340cb", - "7127ca85ce6447928e195e901d36f1e1f1e8205a686e567c2d1b187431f989df" - ], - "path_edge_types": [ - "instantiates", - "writes_attr", - "reads_attr" - ], - "path_length": 5, - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_runtime.py", - "content": "test_trace_service_writes_contexts_and_messages\n -> RecordingTransport\n -> RecordingTransport.__init__\n -> RecordingTransport.contexts\n -> RecordingTransport.write_context", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_trace_service_writes_contexts_and_messages:dataflow_slice", - "span_start": 181, - "span_end": 249, - "lexical_rank": 4, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 5, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "60d7a8655fa4c53d9130ce342fc023d24ccfa16baea47ad60c91d2d49f547565", - "edge_type": "dataflow_slice", - "src_symbol_id": "1600da201da1d0150240b400e3232172354156decdd1a04e1ab1a1edcd3a7e99", - "src_qname": "test_trace_service_writes_contexts_and_messages", - "dst_symbol_id": "b8bbf341e230198caafe54727e13f2db27b7200d6fd95684fc5cf748db1a0e88", - "dst_ref": "RecordingTransport.write_context", - "resolution": "resolved", - "slice_id": "60d7a8655fa4c53d9130ce342fc023d24ccfa16baea47ad60c91d2d49f547565", - "root_symbol_id": "1600da201da1d0150240b400e3232172354156decdd1a04e1ab1a1edcd3a7e99", - "path_symbols": [ - "test_trace_service_writes_contexts_and_messages", - "RecordingTransport", - "RecordingTransport.__init__", - "RecordingTransport.contexts", - "RecordingTransport.write_context" - ], - "path_symbol_ids": [ - "1600da201da1d0150240b400e3232172354156decdd1a04e1ab1a1edcd3a7e99", - "e3d635de1f1880673b69bf73ca6a45caffa5c7fdc23d589d5e40f76b86bdcd33", - "e34d80da723a7115a7a7586b52dc8b5cfda05c581509eee0c1a0296df9a340cb", - "b8bbf341e230198caafe54727e13f2db27b7200d6fd95684fc5cf748db1a0e88" - ], - "path_edge_types": [ - "instantiates", - "writes_attr", - "reads_attr" - ], - "path_length": 5, - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_runtime.py", - "content": "test_trace_service_supports_debug_warning_and_error_levels\n -> RecordingTransport\n -> RecordingTransport.__init__\n -> RecordingTransport.contexts\n -> RecordingTransport.write_context", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_trace_service_supports_debug_warning_and_error_levels:dataflow_slice", - "span_start": 181, - "span_end": 265, - "lexical_rank": 4, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 5, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "1372a2241c7265705e5cf9dceeb5e59836fac1d679227c4279ed39e0798ddddf", - "edge_type": "dataflow_slice", - "src_symbol_id": "ede183f1c546725064e28ddab1ffdbae0d1a1258fd62a50eb556c10d10995415", - "src_qname": "test_trace_service_supports_debug_warning_and_error_levels", - "dst_symbol_id": "b8bbf341e230198caafe54727e13f2db27b7200d6fd95684fc5cf748db1a0e88", - "dst_ref": "RecordingTransport.write_context", - "resolution": "resolved", - "slice_id": "1372a2241c7265705e5cf9dceeb5e59836fac1d679227c4279ed39e0798ddddf", - "root_symbol_id": "ede183f1c546725064e28ddab1ffdbae0d1a1258fd62a50eb556c10d10995415", - "path_symbols": [ - "test_trace_service_supports_debug_warning_and_error_levels", - "RecordingTransport", - "RecordingTransport.__init__", - "RecordingTransport.contexts", - "RecordingTransport.write_context" - ], - "path_symbol_ids": [ - "ede183f1c546725064e28ddab1ffdbae0d1a1258fd62a50eb556c10d10995415", - "e3d635de1f1880673b69bf73ca6a45caffa5c7fdc23d589d5e40f76b86bdcd33", - "e34d80da723a7115a7a7586b52dc8b5cfda05c581509eee0c1a0296df9a340cb", - "b8bbf341e230198caafe54727e13f2db27b7200d6fd95684fc5cf748db1a0e88" - ], - "path_edge_types": [ - "instantiates", - "writes_attr", - "reads_attr" - ], - "path_length": 5, - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_runtime.py", - "content": "test_trace_service_supports_debug_warning_and_error_levels\n -> RecordingTransport\n -> RecordingTransport.__init__\n -> RecordingTransport.contexts\n -> test_trace_service_writes_contexts_and_messages", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_trace_service_supports_debug_warning_and_error_levels:dataflow_slice", - "span_start": 181, - "span_end": 265, - "lexical_rank": 4, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 5, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "8b6a5a738525df160600d71c15915704172de20db436ea2f84b6e039be396a2d", - "edge_type": "dataflow_slice", - "src_symbol_id": "ede183f1c546725064e28ddab1ffdbae0d1a1258fd62a50eb556c10d10995415", - "src_qname": "test_trace_service_supports_debug_warning_and_error_levels", - "dst_symbol_id": "1600da201da1d0150240b400e3232172354156decdd1a04e1ab1a1edcd3a7e99", - "dst_ref": "test_trace_service_writes_contexts_and_messages", - "resolution": "resolved", - "slice_id": "8b6a5a738525df160600d71c15915704172de20db436ea2f84b6e039be396a2d", - "root_symbol_id": "ede183f1c546725064e28ddab1ffdbae0d1a1258fd62a50eb556c10d10995415", - "path_symbols": [ - "test_trace_service_supports_debug_warning_and_error_levels", - "RecordingTransport", - "RecordingTransport.__init__", - "RecordingTransport.contexts", - "test_trace_service_writes_contexts_and_messages" - ], - "path_symbol_ids": [ - "ede183f1c546725064e28ddab1ffdbae0d1a1258fd62a50eb556c10d10995415", - "e3d635de1f1880673b69bf73ca6a45caffa5c7fdc23d589d5e40f76b86bdcd33", - "e34d80da723a7115a7a7586b52dc8b5cfda05c581509eee0c1a0296df9a340cb", - "1600da201da1d0150240b400e3232172354156decdd1a04e1ab1a1edcd3a7e99" - ], - "path_edge_types": [ - "instantiates", - "writes_attr", - "reads_attr" - ], - "path_length": 5, - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_runtime.py", - "content": "test_trace_service_supports_debug_warning_and_error_levels\n -> RecordingTransport\n -> RecordingTransport.__init__\n -> RecordingTransport.contexts\n -> test_trace_service_allows_messages_without_status", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_trace_service_supports_debug_warning_and_error_levels:dataflow_slice", - "span_start": 181, - "span_end": 293, - "lexical_rank": 4, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 5, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "f7d099f6d5746aa61a3025fd7eef791369bd3a3e5df4bc716de87e7b149ccde6", - "edge_type": "dataflow_slice", - "src_symbol_id": "ede183f1c546725064e28ddab1ffdbae0d1a1258fd62a50eb556c10d10995415", - "src_qname": "test_trace_service_supports_debug_warning_and_error_levels", - "dst_symbol_id": "7127ca85ce6447928e195e901d36f1e1f1e8205a686e567c2d1b187431f989df", - "dst_ref": "test_trace_service_allows_messages_without_status", - "resolution": "resolved", - "slice_id": "f7d099f6d5746aa61a3025fd7eef791369bd3a3e5df4bc716de87e7b149ccde6", - "root_symbol_id": "ede183f1c546725064e28ddab1ffdbae0d1a1258fd62a50eb556c10d10995415", - "path_symbols": [ - "test_trace_service_supports_debug_warning_and_error_levels", - "RecordingTransport", - "RecordingTransport.__init__", - "RecordingTransport.contexts", - "test_trace_service_allows_messages_without_status" - ], - "path_symbol_ids": [ - "ede183f1c546725064e28ddab1ffdbae0d1a1258fd62a50eb556c10d10995415", - "e3d635de1f1880673b69bf73ca6a45caffa5c7fdc23d589d5e40f76b86bdcd33", - "e34d80da723a7115a7a7586b52dc8b5cfda05c581509eee0c1a0296df9a340cb", - "7127ca85ce6447928e195e901d36f1e1f1e8205a686e567c2d1b187431f989df" - ], - "path_edge_types": [ - "instantiates", - "writes_attr", - "reads_attr" - ], - "path_length": 5, - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_runtime.py", - "content": "def test_trace_service_writes_contexts_and_messages() -> None:\n from app_runtime.tracing.service import TraceService\n\n transport = RecordingTransport()\n manager = TraceService(transport=transport)\n\n with manager.open_context(alias=\"worker\", kind=\"worker\", attrs={\"routine\": \"incoming\"}):\n manager.step(\"parse\")\n manager.info(\"started\", status=\"ok\", attrs={\"attempt\": 1})\n\n assert len(transport.contexts) == 1\n assert len(transport.messages) == 1\n assert transport.contexts[0].alias == \"worker\"\n assert transport.messages[0].step == \"parse\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_runtime.py:test_trace_service_writes_contexts_and_messages", - "span_start": 246, - "span_end": 259, - "lexical_rank": 6, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 9, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_runtime", - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_runtime.py", - "content": "def test_trace_service_supports_debug_warning_and_error_levels() -> None:\n from app_runtime.tracing.service import TraceService\n\n transport = RecordingTransport()\n manager = TraceService(transport=transport)\n\n with manager.open_context(alias=\"worker\", kind=\"worker\", attrs={\"routine\": \"incoming\"}):\n manager.step(\"validate\")\n manager.debug(\"validation details\", attrs={\"rule\": \"basic\"})\n manager.warning(\"validation warning\", status=\"degraded\", attrs={\"attempt\": 1})\n manager.error(\"integration failed\", status=\"failed\", attrs={\"integration\": \"crm\"})\n manager.exception(\"caught exception\", attrs={\"exception_type\": \"RuntimeError\"})\n\n levels = [message.level for message in transport.messages]\n assert levels == [\"DEBUG\", \"WARNING\", \"ERROR\", \"ERROR\"]", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_runtime.py:test_trace_service_supports_debug_warning_and_error_levels", - "span_start": 262, - "span_end": 276, - "lexical_rank": 6, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 10, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_runtime", - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_runtime.py", - "content": "def test_trace_service_allows_messages_without_status() -> None:\n from app_runtime.tracing.service import TraceService\n\n transport = RecordingTransport()\n manager = TraceService(transport=transport)\n\n with manager.open_context(alias=\"worker\", kind=\"worker\"):\n manager.step(\"optional-status\")\n manager.debug(\"debug without status\")\n manager.info(\"info without status\")\n manager.warning(\"warning without status\")\n manager.error(\"error without status\")\n\n assert [message.status for message in transport.messages] == [\"\", \"\", \"\", \"\"]\n assert all(message.trace_id == transport.contexts[0].trace_id for message in transport.messages)", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_runtime.py:test_trace_service_allows_messages_without_status", - "span_start": 279, - "span_end": 293, - "lexical_rank": 6, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 11, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_runtime", - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "class ScenarioWorker(Worker):\n def __init__(self, name: str, routine: object, *, interval: float = 0.05) -> None:\n self._name = name\n self._routine = routine\n self._interval = interval\n self._thread: Thread | None = None\n self._stop_requested = Event()\n self._in_flight = 0\n self._runs = 0\n self._lock = Lock()\n\n @property\n def name(self) -> str:\n return self._name\n\n @property\n def critical(self) -> bool:\n return True\n\n def start(self) -> None:\n if self._thread is not None and self._thread.is_alive():\n return\n self._stop_requested.clear()\n self._thread = Thread(target=self._loop, name=f\"{self._name}-thread\", daemon=True)\n self._thread.start()\n\n def stop(self, force: bool = False) -> None:\n self._stop_requested.set()\n\n def health(self) -> WorkerHealth:\n return WorkerHealth(name=self.name, status=\"ok\", critical=True, meta={\"runs\": self._runs})\n\n def status(self) -> WorkerStatus:\n thread_alive = self._thread is not None and self._thread.is_alive()\n with self._lock:\n in_flight = self._in_flight\n runs = self._runs\n if not thread_alive:\n state = \"stopped\"\n elif self._stop_requested.is_set():\n state = \"stopping\"\n elif in_flight > 0:\n state = \"busy\"\n else:\n state = \"idle\"\n return WorkerStatus(name=self.name, state=state, in_flight=in_flight, meta={\"runs\": runs})\n\n def _loop(self) -> None:\n while not self._stop_requested.is_set():\n with self._lock:\n self._in_flight += 1\n try:\n self._routine.run()\n with self._lock:\n self._runs += 1\n finally:\n with self._lock:\n self._in_flight -= 1\n if self._stop_requested.is_set():\n return\n sleep(self._interval)", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:ScenarioWorker", - "span_start": 50, - "span_end": 110, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 2, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "class IntervalRoutine:\n calls: list[float] = field(default_factory=list)\n _lock: Lock = field(default_factory=Lock)\n\n def run(self) -> None:\n with self._lock:\n self.calls.append(monotonic())\n\n def wait_runs(self, count: int, timeout: float) -> bool:\n deadline = monotonic() + timeout\n while monotonic() < deadline:\n with self._lock:\n if len(self.calls) >= count:\n return True\n sleep(0.01)\n return False\n\n def deltas(self) -> list[float]:\n with self._lock:\n return [self.calls[index + 1] - self.calls[index] for index in range(len(self.calls) - 1)]", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:IntervalRoutine", - "span_start": 18, - "span_end": 37, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "class BlockingRoutine:\n def __init__(self, started: Event, release: Event) -> None:\n self._started = started\n self._release = release\n\n def run(self) -> None:\n self._started.set()\n self._release.wait(timeout=5.0)", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:BlockingRoutine", - "span_start": 40, - "span_end": 47, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 1, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "def test_worker_wakes_up_with_configured_interval() -> None:\n interval = 0.15\n routine = IntervalRoutine()\n worker = ScenarioWorker(\"interval-worker\", routine, interval=interval)\n runtime = RuntimeManager()\n runtime.register_module(WorkerModule(worker))\n\n runtime.start()\n try:\n assert routine.wait_runs(count=3, timeout=2.0) is True\n finally:\n runtime.stop()\n\n deltas = routine.deltas()\n assert len(deltas) >= 2\n assert all(delta >= interval * 0.7 for delta in deltas[:2])", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:test_worker_wakes_up_with_configured_interval", - "span_start": 163, - "span_end": 178, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 7, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "def _http_call_json(\n base_url: str,\n path: str,\n *,\n method: str = \"GET\",\n headers: dict[str, str] | None = None,\n) -> tuple[int, dict[str, object]]:\n request = Request(f\"{base_url}{path}\", method=method, headers=headers or {})\n try:\n with urlopen(request, timeout=15.0) as response:\n status = response.status\n body = response.read()\n except HTTPError as error:\n status = error.code\n body = error.read()\n payload = json.loads(body.decode(\"utf-8\"))\n return status, payload", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:_http_call_json", - "span_start": 125, - "span_end": 141, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 4, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "def _build_runtime(worker: Worker, *, control_timeout: int = 1) -> tuple[RuntimeManager, str]:\n runtime = RuntimeManager()\n channel = HttpControlChannel(host=\"127.0.0.1\", port=0, timeout=control_timeout)\n runtime.control_plane.register_channel(channel)\n runtime.register_module(WorkerModule(worker))\n runtime.start()\n return runtime, f\"http://127.0.0.1:{channel.port}\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:_build_runtime", - "span_start": 154, - "span_end": 160, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 6, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "class WorkerModule(ApplicationModule):\n def __init__(self, worker: Worker) -> None:\n self._worker = worker\n\n @property\n def name(self) -> str:\n return \"business-tests\"\n\n def register(self, registry: ModuleRegistry) -> None:\n registry.add_worker(self._worker)", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:WorkerModule", - "span_start": 113, - "span_end": 122, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 3, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "llm_answer": "Прямые тесты для `TraceService` находятся в файле `tests/test_runtime.py`.\n\nВ этих тестах:\n- `test_trace_service_writes_contexts_and_messages` проверяет корректность записи контекста и сообщений при использовании сервиса трассировки.\n- `test_trace_service_supports_debug_warning_and_error_levels` подтверждает поддержку различных уровней логирования (DEBUG, WARNING, ERROR).\n\nОба теста непосредственно обращаются к классу `TraceService`, его методам и зависят от поведения самого класса через интерфейс взаимодействия с транспортом (`RecordingTransport`).", - "summary": { - "router": { - "intent": "CODE_QA", - "sub_intent": "FIND_TESTS", - "confidence": null - }, - "retrieval": { - "profile": "code", - "layers_hit": [ - "C0_SOURCE_CHUNKS", - "C2_DEPENDENCY_GRAPH" - ], - "evidence_sufficient": true - }, - "llm": { - "answer_status": "answered", - "groundedness": "grounded" - } - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "FIND_TESTS", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "TraceService" - ], - "keyword_hints": [ - "TraceService" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**", - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "test_file_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "test_symbol_patterns": [ - "test_trace_service", - "TestTraceService", - "TraceService" - ], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C0_SOURCE_CHUNKS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C0_SOURCE_CHUNKS": 10 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [], - "include_globs": [ - "src", - "tests" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests" - ] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src", - "tests" - ], - "include_globs": [ - "src", - "tests" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests" - ] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src", - "tests" - ], - "include_globs": [ - "src", - "tests" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests" - ] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "TraceService", - "path_scope": [], - "include_globs": [ - "src/**", - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "Где тесты для TraceService? test_trace_service TestTraceService TraceService", - "path_scope": [], - "include_globs": [ - "src/**", - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "top_k": 6, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Где тесты для TraceService? test_trace_service TestTraceService TraceService", - "path_scope": [], - "include_globs": [ - "src/**", - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "top_k": 10, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [], - "normalized_include_globs": [ - "src", - "tests" - ], - "normalized_exclude_globs": [], - "normalized_prefer_globs": [ - "tests" - ], - "filter_stage": "post_rank", - "candidates_before_filter": 0, - "candidates_after_filter": 0 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src", - "tests" - ], - "normalized_include_globs": [ - "src", - "tests" - ], - "normalized_exclude_globs": [], - "normalized_prefer_globs": [ - "tests" - ], - "filter_stage": "post_rank", - "candidates_before_filter": 6, - "candidates_after_filter": 6 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src", - "tests" - ], - "normalized_include_globs": [ - "src", - "tests" - ], - "normalized_exclude_globs": [], - "normalized_prefer_globs": [ - "tests" - ], - "filter_stage": "post_rank", - "candidates_before_filter": 10, - "candidates_after_filter": 10 - } - ], - "fallback": { - "used": true, - "reason": "scope_relaxed_no_hits" - }, - "symbol_resolution": { - "status": "not_found", - "resolved_symbol": null, - "alternatives": [ - "TraceService" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "miss", - "hit_count": 0, - "fail_reason": "scope_relaxed_no_hits" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 6, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 10, - "fail_reason": null - } - ] - }, - "constraint_violations": [ - { - "type": "LAYER_MISSING", - "severity": "warn", - "details": { - "layer": "C1_SYMBOL_CATALOG", - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ] - }, - "suggested_fix": "Increase top_k for this layer or relax constraints for retrieval." - } - ], - "timings_ms": { - "router": 0, - "symbol_resolution": 0, - "retrieval_total": 123, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 62, - "C2_DEPENDENCY_GRAPH": 47, - "C0_SOURCE_CHUNKS": 13 - }, - "merge_rank": 0, - "prompt_build": 0, - "llm_call": 992 - }, - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 999, - "evidence_rows": 16, - "evidence_chars": 7847 - }, - "evidence_summary": [ - { - "layer": "C2_DEPENDENCY_GRAPH", - "count": 6, - "unique_paths": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 10, - "unique_paths": 2 - } - ], - "prompt_template_id": "intent_code_qa_find_tests_ru_v3", - "system_prompt_version": "v1" - }, - "router": { - "conversation_mode": "START", - "keyword_hints": [ - "TraceService" - ], - "path_scope": [] - }, - "llm": { - "used_evidence_count": 16, - "missing_evidence_reason": null - } - }, - "run_info": { - "case_id": "plba-v2-find-tests-trace-service", - "mode": "full_chain", - "run_started_at": "2026-03-12T14:07:09", - "rag_session_id": "7d11da21-faa0-4cea-aede-aeabe069164c", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - }, - "input_request": { - "text": "Где тесты для TraceService?", - "normalized_query": "Где тесты для TraceService?" - }, - "steps": [ - { - "step": "intent_router", - "input": { - "query": "Где тесты для TraceService?" - }, - "output": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Где тесты для TraceService?" - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "FIND_TESTS", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "TraceService" - ], - "keyword_hints": [ - "TraceService" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**", - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "test_file_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "test_symbol_patterns": [ - "test_trace_service", - "TestTraceService", - "TraceService" - ], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "timings_ms": { - "router": 0 - } - } - }, - { - "step": "retrieval", - "input": { - "query": "Где тесты для TraceService?" - }, - "output": { - "symbol_resolution": { - "status": "not_found", - "resolved_symbol": null, - "alternatives": [ - "TraceService" - ], - "confidence": 0.0 - }, - "rag_count": 16, - "rag_rows": [ - { - "path": "tests/test_runtime.py", - "content": "test_trace_service_writes_contexts_and_messages\n -> RecordingTransport\n -> RecordingTransport.__init__\n -> RecordingTransport.contexts\n -> test_trace_service_writes_contexts_and_messages", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_trace_service_writes_contexts_and_messages:dataflow_slice", - "span_start": 181, - "span_end": 256, - "lexical_rank": 4, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 5, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "1636a2f70dee79c804259dc114af6c1ab4db27099911e5f97ac97a2bcb59be8a", - "edge_type": "dataflow_slice", - "src_symbol_id": "1600da201da1d0150240b400e3232172354156decdd1a04e1ab1a1edcd3a7e99", - "src_qname": "test_trace_service_writes_contexts_and_messages", - "dst_symbol_id": "1600da201da1d0150240b400e3232172354156decdd1a04e1ab1a1edcd3a7e99", - "dst_ref": "test_trace_service_writes_contexts_and_messages", - "resolution": "resolved", - "slice_id": "1636a2f70dee79c804259dc114af6c1ab4db27099911e5f97ac97a2bcb59be8a", - "root_symbol_id": "1600da201da1d0150240b400e3232172354156decdd1a04e1ab1a1edcd3a7e99", - "path_symbols": [ - "test_trace_service_writes_contexts_and_messages", - "RecordingTransport", - "RecordingTransport.__init__", - "RecordingTransport.contexts", - "test_trace_service_writes_contexts_and_messages" - ], - "path_symbol_ids": [ - "1600da201da1d0150240b400e3232172354156decdd1a04e1ab1a1edcd3a7e99", - "e3d635de1f1880673b69bf73ca6a45caffa5c7fdc23d589d5e40f76b86bdcd33", - "e34d80da723a7115a7a7586b52dc8b5cfda05c581509eee0c1a0296df9a340cb", - "1600da201da1d0150240b400e3232172354156decdd1a04e1ab1a1edcd3a7e99" - ], - "path_edge_types": [ - "instantiates", - "writes_attr", - "reads_attr" - ], - "path_length": 5, - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_runtime.py", - "content": "test_trace_service_writes_contexts_and_messages\n -> RecordingTransport\n -> RecordingTransport.__init__\n -> RecordingTransport.contexts\n -> test_trace_service_allows_messages_without_status", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_trace_service_writes_contexts_and_messages:dataflow_slice", - "span_start": 181, - "span_end": 293, - "lexical_rank": 4, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 5, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "5db5abe56b73f884c5178647bd25ef150064a94a41fc8c052aebaa09bd7fdb3d", - "edge_type": "dataflow_slice", - "src_symbol_id": "1600da201da1d0150240b400e3232172354156decdd1a04e1ab1a1edcd3a7e99", - "src_qname": "test_trace_service_writes_contexts_and_messages", - "dst_symbol_id": "7127ca85ce6447928e195e901d36f1e1f1e8205a686e567c2d1b187431f989df", - "dst_ref": "test_trace_service_allows_messages_without_status", - "resolution": "resolved", - "slice_id": "5db5abe56b73f884c5178647bd25ef150064a94a41fc8c052aebaa09bd7fdb3d", - "root_symbol_id": "1600da201da1d0150240b400e3232172354156decdd1a04e1ab1a1edcd3a7e99", - "path_symbols": [ - "test_trace_service_writes_contexts_and_messages", - "RecordingTransport", - "RecordingTransport.__init__", - "RecordingTransport.contexts", - "test_trace_service_allows_messages_without_status" - ], - "path_symbol_ids": [ - "1600da201da1d0150240b400e3232172354156decdd1a04e1ab1a1edcd3a7e99", - "e3d635de1f1880673b69bf73ca6a45caffa5c7fdc23d589d5e40f76b86bdcd33", - "e34d80da723a7115a7a7586b52dc8b5cfda05c581509eee0c1a0296df9a340cb", - "7127ca85ce6447928e195e901d36f1e1f1e8205a686e567c2d1b187431f989df" - ], - "path_edge_types": [ - "instantiates", - "writes_attr", - "reads_attr" - ], - "path_length": 5, - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_runtime.py", - "content": "test_trace_service_writes_contexts_and_messages\n -> RecordingTransport\n -> RecordingTransport.__init__\n -> RecordingTransport.contexts\n -> RecordingTransport.write_context", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_trace_service_writes_contexts_and_messages:dataflow_slice", - "span_start": 181, - "span_end": 249, - "lexical_rank": 4, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 5, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "60d7a8655fa4c53d9130ce342fc023d24ccfa16baea47ad60c91d2d49f547565", - "edge_type": "dataflow_slice", - "src_symbol_id": "1600da201da1d0150240b400e3232172354156decdd1a04e1ab1a1edcd3a7e99", - "src_qname": "test_trace_service_writes_contexts_and_messages", - "dst_symbol_id": "b8bbf341e230198caafe54727e13f2db27b7200d6fd95684fc5cf748db1a0e88", - "dst_ref": "RecordingTransport.write_context", - "resolution": "resolved", - "slice_id": "60d7a8655fa4c53d9130ce342fc023d24ccfa16baea47ad60c91d2d49f547565", - "root_symbol_id": "1600da201da1d0150240b400e3232172354156decdd1a04e1ab1a1edcd3a7e99", - "path_symbols": [ - "test_trace_service_writes_contexts_and_messages", - "RecordingTransport", - "RecordingTransport.__init__", - "RecordingTransport.contexts", - "RecordingTransport.write_context" - ], - "path_symbol_ids": [ - "1600da201da1d0150240b400e3232172354156decdd1a04e1ab1a1edcd3a7e99", - "e3d635de1f1880673b69bf73ca6a45caffa5c7fdc23d589d5e40f76b86bdcd33", - "e34d80da723a7115a7a7586b52dc8b5cfda05c581509eee0c1a0296df9a340cb", - "b8bbf341e230198caafe54727e13f2db27b7200d6fd95684fc5cf748db1a0e88" - ], - "path_edge_types": [ - "instantiates", - "writes_attr", - "reads_attr" - ], - "path_length": 5, - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_runtime.py", - "content": "test_trace_service_supports_debug_warning_and_error_levels\n -> RecordingTransport\n -> RecordingTransport.__init__\n -> RecordingTransport.contexts\n -> RecordingTransport.write_context", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_trace_service_supports_debug_warning_and_error_levels:dataflow_slice", - "span_start": 181, - "span_end": 265, - "lexical_rank": 4, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 5, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "1372a2241c7265705e5cf9dceeb5e59836fac1d679227c4279ed39e0798ddddf", - "edge_type": "dataflow_slice", - "src_symbol_id": "ede183f1c546725064e28ddab1ffdbae0d1a1258fd62a50eb556c10d10995415", - "src_qname": "test_trace_service_supports_debug_warning_and_error_levels", - "dst_symbol_id": "b8bbf341e230198caafe54727e13f2db27b7200d6fd95684fc5cf748db1a0e88", - "dst_ref": "RecordingTransport.write_context", - "resolution": "resolved", - "slice_id": "1372a2241c7265705e5cf9dceeb5e59836fac1d679227c4279ed39e0798ddddf", - "root_symbol_id": "ede183f1c546725064e28ddab1ffdbae0d1a1258fd62a50eb556c10d10995415", - "path_symbols": [ - "test_trace_service_supports_debug_warning_and_error_levels", - "RecordingTransport", - "RecordingTransport.__init__", - "RecordingTransport.contexts", - "RecordingTransport.write_context" - ], - "path_symbol_ids": [ - "ede183f1c546725064e28ddab1ffdbae0d1a1258fd62a50eb556c10d10995415", - "e3d635de1f1880673b69bf73ca6a45caffa5c7fdc23d589d5e40f76b86bdcd33", - "e34d80da723a7115a7a7586b52dc8b5cfda05c581509eee0c1a0296df9a340cb", - "b8bbf341e230198caafe54727e13f2db27b7200d6fd95684fc5cf748db1a0e88" - ], - "path_edge_types": [ - "instantiates", - "writes_attr", - "reads_attr" - ], - "path_length": 5, - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_runtime.py", - "content": "test_trace_service_supports_debug_warning_and_error_levels\n -> RecordingTransport\n -> RecordingTransport.__init__\n -> RecordingTransport.contexts\n -> test_trace_service_writes_contexts_and_messages", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_trace_service_supports_debug_warning_and_error_levels:dataflow_slice", - "span_start": 181, - "span_end": 265, - "lexical_rank": 4, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 5, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "8b6a5a738525df160600d71c15915704172de20db436ea2f84b6e039be396a2d", - "edge_type": "dataflow_slice", - "src_symbol_id": "ede183f1c546725064e28ddab1ffdbae0d1a1258fd62a50eb556c10d10995415", - "src_qname": "test_trace_service_supports_debug_warning_and_error_levels", - "dst_symbol_id": "1600da201da1d0150240b400e3232172354156decdd1a04e1ab1a1edcd3a7e99", - "dst_ref": "test_trace_service_writes_contexts_and_messages", - "resolution": "resolved", - "slice_id": "8b6a5a738525df160600d71c15915704172de20db436ea2f84b6e039be396a2d", - "root_symbol_id": "ede183f1c546725064e28ddab1ffdbae0d1a1258fd62a50eb556c10d10995415", - "path_symbols": [ - "test_trace_service_supports_debug_warning_and_error_levels", - "RecordingTransport", - "RecordingTransport.__init__", - "RecordingTransport.contexts", - "test_trace_service_writes_contexts_and_messages" - ], - "path_symbol_ids": [ - "ede183f1c546725064e28ddab1ffdbae0d1a1258fd62a50eb556c10d10995415", - "e3d635de1f1880673b69bf73ca6a45caffa5c7fdc23d589d5e40f76b86bdcd33", - "e34d80da723a7115a7a7586b52dc8b5cfda05c581509eee0c1a0296df9a340cb", - "1600da201da1d0150240b400e3232172354156decdd1a04e1ab1a1edcd3a7e99" - ], - "path_edge_types": [ - "instantiates", - "writes_attr", - "reads_attr" - ], - "path_length": 5, - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_runtime.py", - "content": "test_trace_service_supports_debug_warning_and_error_levels\n -> RecordingTransport\n -> RecordingTransport.__init__\n -> RecordingTransport.contexts\n -> test_trace_service_allows_messages_without_status", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_trace_service_supports_debug_warning_and_error_levels:dataflow_slice", - "span_start": 181, - "span_end": 293, - "lexical_rank": 4, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 5, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "f7d099f6d5746aa61a3025fd7eef791369bd3a3e5df4bc716de87e7b149ccde6", - "edge_type": "dataflow_slice", - "src_symbol_id": "ede183f1c546725064e28ddab1ffdbae0d1a1258fd62a50eb556c10d10995415", - "src_qname": "test_trace_service_supports_debug_warning_and_error_levels", - "dst_symbol_id": "7127ca85ce6447928e195e901d36f1e1f1e8205a686e567c2d1b187431f989df", - "dst_ref": "test_trace_service_allows_messages_without_status", - "resolution": "resolved", - "slice_id": "f7d099f6d5746aa61a3025fd7eef791369bd3a3e5df4bc716de87e7b149ccde6", - "root_symbol_id": "ede183f1c546725064e28ddab1ffdbae0d1a1258fd62a50eb556c10d10995415", - "path_symbols": [ - "test_trace_service_supports_debug_warning_and_error_levels", - "RecordingTransport", - "RecordingTransport.__init__", - "RecordingTransport.contexts", - "test_trace_service_allows_messages_without_status" - ], - "path_symbol_ids": [ - "ede183f1c546725064e28ddab1ffdbae0d1a1258fd62a50eb556c10d10995415", - "e3d635de1f1880673b69bf73ca6a45caffa5c7fdc23d589d5e40f76b86bdcd33", - "e34d80da723a7115a7a7586b52dc8b5cfda05c581509eee0c1a0296df9a340cb", - "7127ca85ce6447928e195e901d36f1e1f1e8205a686e567c2d1b187431f989df" - ], - "path_edge_types": [ - "instantiates", - "writes_attr", - "reads_attr" - ], - "path_length": 5, - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_runtime.py", - "content": "def test_trace_service_writes_contexts_and_messages() -> None:\n from app_runtime.tracing.service import TraceService\n\n transport = RecordingTransport()\n manager = TraceService(transport=transport)\n\n with manager.open_context(alias=\"worker\", kind=\"worker\", attrs={\"routine\": \"incoming\"}):\n manager.step(\"parse\")\n manager.info(\"started\", status=\"ok\", attrs={\"attempt\": 1})\n\n assert len(transport.contexts) == 1\n assert len(transport.messages) == 1\n assert transport.contexts[0].alias == \"worker\"\n assert transport.messages[0].step == \"parse\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_runtime.py:test_trace_service_writes_contexts_and_messages", - "span_start": 246, - "span_end": 259, - "lexical_rank": 6, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 9, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_runtime", - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_runtime.py", - "content": "def test_trace_service_supports_debug_warning_and_error_levels() -> None:\n from app_runtime.tracing.service import TraceService\n\n transport = RecordingTransport()\n manager = TraceService(transport=transport)\n\n with manager.open_context(alias=\"worker\", kind=\"worker\", attrs={\"routine\": \"incoming\"}):\n manager.step(\"validate\")\n manager.debug(\"validation details\", attrs={\"rule\": \"basic\"})\n manager.warning(\"validation warning\", status=\"degraded\", attrs={\"attempt\": 1})\n manager.error(\"integration failed\", status=\"failed\", attrs={\"integration\": \"crm\"})\n manager.exception(\"caught exception\", attrs={\"exception_type\": \"RuntimeError\"})\n\n levels = [message.level for message in transport.messages]\n assert levels == [\"DEBUG\", \"WARNING\", \"ERROR\", \"ERROR\"]", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_runtime.py:test_trace_service_supports_debug_warning_and_error_levels", - "span_start": 262, - "span_end": 276, - "lexical_rank": 6, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 10, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_runtime", - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_runtime.py", - "content": "def test_trace_service_allows_messages_without_status() -> None:\n from app_runtime.tracing.service import TraceService\n\n transport = RecordingTransport()\n manager = TraceService(transport=transport)\n\n with manager.open_context(alias=\"worker\", kind=\"worker\"):\n manager.step(\"optional-status\")\n manager.debug(\"debug without status\")\n manager.info(\"info without status\")\n manager.warning(\"warning without status\")\n manager.error(\"error without status\")\n\n assert [message.status for message in transport.messages] == [\"\", \"\", \"\", \"\"]\n assert all(message.trace_id == transport.contexts[0].trace_id for message in transport.messages)", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_runtime.py:test_trace_service_allows_messages_without_status", - "span_start": 279, - "span_end": 293, - "lexical_rank": 6, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 11, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_runtime", - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "class ScenarioWorker(Worker):\n def __init__(self, name: str, routine: object, *, interval: float = 0.05) -> None:\n self._name = name\n self._routine = routine\n self._interval = interval\n self._thread: Thread | None = None\n self._stop_requested = Event()\n self._in_flight = 0\n self._runs = 0\n self._lock = Lock()\n\n @property\n def name(self) -> str:\n return self._name\n\n @property\n def critical(self) -> bool:\n return True\n\n def start(self) -> None:\n if self._thread is not None and self._thread.is_alive():\n return\n self._stop_requested.clear()\n self._thread = Thread(target=self._loop, name=f\"{self._name}-thread\", daemon=True)\n self._thread.start()\n\n def stop(self, force: bool = False) -> None:\n self._stop_requested.set()\n\n def health(self) -> WorkerHealth:\n return WorkerHealth(name=self.name, status=\"ok\", critical=True, meta={\"runs\": self._runs})\n\n def status(self) -> WorkerStatus:\n thread_alive = self._thread is not None and self._thread.is_alive()\n with self._lock:\n in_flight = self._in_flight\n runs = self._runs\n if not thread_alive:\n state = \"stopped\"\n elif self._stop_requested.is_set():\n state = \"stopping\"\n elif in_flight > 0:\n state = \"busy\"\n else:\n state = \"idle\"\n return WorkerStatus(name=self.name, state=state, in_flight=in_flight, meta={\"runs\": runs})\n\n def _loop(self) -> None:\n while not self._stop_requested.is_set():\n with self._lock:\n self._in_flight += 1\n try:\n self._routine.run()\n with self._lock:\n self._runs += 1\n finally:\n with self._lock:\n self._in_flight -= 1\n if self._stop_requested.is_set():\n return\n sleep(self._interval)", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:ScenarioWorker", - "span_start": 50, - "span_end": 110, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 2, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "class IntervalRoutine:\n calls: list[float] = field(default_factory=list)\n _lock: Lock = field(default_factory=Lock)\n\n def run(self) -> None:\n with self._lock:\n self.calls.append(monotonic())\n\n def wait_runs(self, count: int, timeout: float) -> bool:\n deadline = monotonic() + timeout\n while monotonic() < deadline:\n with self._lock:\n if len(self.calls) >= count:\n return True\n sleep(0.01)\n return False\n\n def deltas(self) -> list[float]:\n with self._lock:\n return [self.calls[index + 1] - self.calls[index] for index in range(len(self.calls) - 1)]", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:IntervalRoutine", - "span_start": 18, - "span_end": 37, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "class BlockingRoutine:\n def __init__(self, started: Event, release: Event) -> None:\n self._started = started\n self._release = release\n\n def run(self) -> None:\n self._started.set()\n self._release.wait(timeout=5.0)", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:BlockingRoutine", - "span_start": 40, - "span_end": 47, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 1, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "def test_worker_wakes_up_with_configured_interval() -> None:\n interval = 0.15\n routine = IntervalRoutine()\n worker = ScenarioWorker(\"interval-worker\", routine, interval=interval)\n runtime = RuntimeManager()\n runtime.register_module(WorkerModule(worker))\n\n runtime.start()\n try:\n assert routine.wait_runs(count=3, timeout=2.0) is True\n finally:\n runtime.stop()\n\n deltas = routine.deltas()\n assert len(deltas) >= 2\n assert all(delta >= interval * 0.7 for delta in deltas[:2])", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:test_worker_wakes_up_with_configured_interval", - "span_start": 163, - "span_end": 178, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 7, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "def _http_call_json(\n base_url: str,\n path: str,\n *,\n method: str = \"GET\",\n headers: dict[str, str] | None = None,\n) -> tuple[int, dict[str, object]]:\n request = Request(f\"{base_url}{path}\", method=method, headers=headers or {})\n try:\n with urlopen(request, timeout=15.0) as response:\n status = response.status\n body = response.read()\n except HTTPError as error:\n status = error.code\n body = error.read()\n payload = json.loads(body.decode(\"utf-8\"))\n return status, payload", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:_http_call_json", - "span_start": 125, - "span_end": 141, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 4, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "def _build_runtime(worker: Worker, *, control_timeout: int = 1) -> tuple[RuntimeManager, str]:\n runtime = RuntimeManager()\n channel = HttpControlChannel(host=\"127.0.0.1\", port=0, timeout=control_timeout)\n runtime.control_plane.register_channel(channel)\n runtime.register_module(WorkerModule(worker))\n runtime.start()\n return runtime, f\"http://127.0.0.1:{channel.port}\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:_build_runtime", - "span_start": 154, - "span_end": 160, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 6, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "class WorkerModule(ApplicationModule):\n def __init__(self, worker: Worker) -> None:\n self._worker = worker\n\n @property\n def name(self) -> str:\n return \"business-tests\"\n\n def register(self, registry: ModuleRegistry) -> None:\n registry.add_worker(self._worker)", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:WorkerModule", - "span_start": 113, - "span_end": 122, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 3, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ] - }, - "diagnostics": { - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C0_SOURCE_CHUNKS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C0_SOURCE_CHUNKS": 10 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [], - "include_globs": [ - "src", - "tests" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests" - ] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src", - "tests" - ], - "include_globs": [ - "src", - "tests" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests" - ] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src", - "tests" - ], - "include_globs": [ - "src", - "tests" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests" - ] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "TraceService", - "path_scope": [], - "include_globs": [ - "src/**", - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "Где тесты для TraceService? test_trace_service TestTraceService TraceService", - "path_scope": [], - "include_globs": [ - "src/**", - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "top_k": 6, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Где тесты для TraceService? test_trace_service TestTraceService TraceService", - "path_scope": [], - "include_globs": [ - "src/**", - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "top_k": 10, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [], - "normalized_include_globs": [ - "src", - "tests" - ], - "normalized_exclude_globs": [], - "normalized_prefer_globs": [ - "tests" - ], - "filter_stage": "post_rank", - "candidates_before_filter": 0, - "candidates_after_filter": 0 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src", - "tests" - ], - "normalized_include_globs": [ - "src", - "tests" - ], - "normalized_exclude_globs": [], - "normalized_prefer_globs": [ - "tests" - ], - "filter_stage": "post_rank", - "candidates_before_filter": 6, - "candidates_after_filter": 6 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src", - "tests" - ], - "normalized_include_globs": [ - "src", - "tests" - ], - "normalized_exclude_globs": [], - "normalized_prefer_globs": [ - "tests" - ], - "filter_stage": "post_rank", - "candidates_before_filter": 10, - "candidates_after_filter": 10 - } - ], - "fallback": { - "used": true, - "reason": "scope_relaxed_no_hits" - }, - "symbol_resolution": { - "status": "not_found", - "resolved_symbol": null, - "alternatives": [ - "TraceService" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "miss", - "hit_count": 0, - "fail_reason": "scope_relaxed_no_hits" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 6, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 10, - "fail_reason": null - } - ] - }, - "constraint_violations": [ - { - "type": "LAYER_MISSING", - "severity": "warn", - "details": { - "layer": "C1_SYMBOL_CATALOG", - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ] - }, - "suggested_fix": "Increase top_k for this layer or relax constraints for retrieval." - } - ], - "timings_ms": { - "symbol_resolution": 0, - "retrieval_total": 123, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 62, - "C2_DEPENDENCY_GRAPH": 47, - "C0_SOURCE_CHUNKS": 13 - }, - "merge_rank": 0 - } - } - }, - { - "step": "llm_answer", - "input": { - "query": "Где тесты для TraceService?", - "rag_count": 16 - }, - "output": { - "llm_answer": "Прямые тесты для `TraceService` находятся в файле `tests/test_runtime.py`.\n\nВ этих тестах:\n- `test_trace_service_writes_contexts_and_messages` проверяет корректность записи контекста и сообщений при использовании сервиса трассировки.\n- `test_trace_service_supports_debug_warning_and_error_levels` подтверждает поддержку различных уровней логирования (DEBUG, WARNING, ERROR).\n\nОба теста непосредственно обращаются к классу `TraceService`, его методам и зависят от поведения самого класса через интерфейс взаимодействия с транспортом (`RecordingTransport`)." - }, - "diagnostics": { - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 999, - "evidence_rows": 16, - "evidence_chars": 7847 - }, - "evidence_summary": [ - { - "layer": "C2_DEPENDENCY_GRAPH", - "count": 6, - "unique_paths": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 10, - "unique_paths": 2 - } - ], - "prompt_template_id": "intent_code_qa_find_tests_ru_v3", - "system_prompt_version": "v1" - }, - "timings_ms": { - "prompt_build": 0, - "llm_call": 992 - } - } - } - ] - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_140708/full_chain_plba_code_subintents_v2_plba-v2-find-tests-trace-service.md b/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_140708/full_chain_plba_code_subintents_v2_plba-v2-find-tests-trace-service.md deleted file mode 100644 index c3b6739..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_140708/full_chain_plba_code_subintents_v2_plba-v2-find-tests-trace-service.md +++ /dev/null @@ -1,32 +0,0 @@ -# plba-v2-find-tests-trace-service - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_subintents_v2.yaml -- runner: runtime -- mode: full_chain -- passed: True - -## Query -Где тесты для TraceService? - -## Actual -{ - "intent": "CODE_QA", - "sub_intent": "FIND_TESTS", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 16, - "llm_answer": "Прямые тесты для `TraceService` находятся в файле `tests/test_runtime.py`.\n\nВ этих тестах:\n- `test_trace_service_writes_contexts_and_messages` проверяет корректность записи контекста и сообщений при использовании сервиса трассировки.\n- `test_trace_service_supports_debug_warning_and_error_levels` подтверждает поддержку различных уровней логирования (DEBUG, WARNING, ERROR).\n\nОба теста непосредственно обращаются к классу `TraceService`, его методам и зависят от поведения самого класса через интерфейс взаимодействия с транспортом (`RecordingTransport`).", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "TraceService" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ] -} - -## Mismatches -- none \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_140708/full_chain_plba_code_subintents_v2_plba-v2-find-tests-workflow-runtime-factory-negative.json b/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_140708/full_chain_plba_code_subintents_v2_plba-v2-find-tests-workflow-runtime-factory-negative.json deleted file mode 100644 index d6bebb4..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_140708/full_chain_plba_code_subintents_v2_plba-v2-find-tests-workflow-runtime-factory-negative.json +++ /dev/null @@ -1,2047 +0,0 @@ -{ - "case_id": "plba-v2-find-tests-workflow-runtime-factory-negative", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_subintents_v2.yaml", - "runner": "runtime", - "mode": "full_chain", - "actual": { - "intent": "CODE_QA", - "sub_intent": "FIND_TESTS", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 16, - "llm_answer": "Прямых тестов конкретно для `WorkflowRuntimeFactory` в предоставленном контексте не обнаружено. Имя класса, его импорты или вызовы не упоминаются ни в одном из перечисленных тестов.\n\nОднако можно найти косвенно связанные тесты, которые могут проверять функционал, связанный с управлением рабочими потоками или сценариями выполнения рабочих задач (например, блокирующие рутины, сценарии работы с интервалами). Эти тесты преимущественно проверяют поведение отдельных компонентов системы управления выполнением задач, таких как запуск, остановка и мониторинг активности работников.\n\nНапример:\n- tests/test_business_control_actions.py: Тесты проверяют взаимодействие с различными действиями, связанными с состоянием и здоровьем рабочего потока (`ScenarioWorker`, `BlockingRoutine`), но напрямую не касаются `WorkflowRuntimeFactory`.\n \nЭти тесты фокусируются на проверке правильности работы различных сценариев жизненного цикла процессов, таких как старт, остановка и проверка состояния работающих потоков.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "WorkflowRuntimeFactory" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ] - }, - "passed": true, - "mismatches": [], - "details": { - "case_id": "plba-v2-find-tests-workflow-runtime-factory-negative", - "text": "Где тесты для WorkflowRuntimeFactory?", - "mode": "full_chain", - "run_started_at": "2026-03-12T14:07:09", - "rag_session_id": "7d11da21-faa0-4cea-aede-aeabe069164c", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Где тесты для WorkflowRuntimeFactory?", - "symbol_resolution": { - "status": "not_found", - "resolved_symbol": null, - "alternatives": [ - "WorkflowRuntimeFactory" - ], - "confidence": 0.0 - }, - "rag_count": 16, - "rag_rows": [ - { - "path": "tests/test_business_control_actions.py", - "content": "test_actions_stop_busy_worker_before_timeout\n -> BlockingRoutine\n -> BlockingRoutine.__init__\n -> BlockingRoutine._release\n -> BlockingRoutine.run", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_actions_stop_busy_worker_before_timeout:dataflow_slice", - "span_start": 43, - "span_end": 212, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 5, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "8bd726155ba387d3579763ee84dfd2f9a90bc917da88f3b2e89416ab5c1254d6", - "edge_type": "dataflow_slice", - "src_symbol_id": "a0bb116ca9d909c93a285667ae033fbd1859b2dad7cf34fcb44816393ef6909c", - "src_qname": "test_actions_stop_busy_worker_before_timeout", - "dst_symbol_id": "d9841bdbb69706c988ae7ae6adf89928dc4fae45943f74064f5382177034ba04", - "dst_ref": "BlockingRoutine.run", - "resolution": "resolved", - "slice_id": "8bd726155ba387d3579763ee84dfd2f9a90bc917da88f3b2e89416ab5c1254d6", - "root_symbol_id": "a0bb116ca9d909c93a285667ae033fbd1859b2dad7cf34fcb44816393ef6909c", - "path_symbols": [ - "test_actions_stop_busy_worker_before_timeout", - "BlockingRoutine", - "BlockingRoutine.__init__", - "BlockingRoutine._release", - "BlockingRoutine.run" - ], - "path_symbol_ids": [ - "a0bb116ca9d909c93a285667ae033fbd1859b2dad7cf34fcb44816393ef6909c", - "a3349c5bc65e4003a4bbd6a8dbb7a54c337e12d1aed930caa701b12e520f1e67", - "486deeed3043c6db985aef258e96ddc67aa53608e67a83962fbd2471f649ddf1", - "d9841bdbb69706c988ae7ae6adf89928dc4fae45943f74064f5382177034ba04" - ], - "path_edge_types": [ - "instantiates", - "writes_attr", - "reads_attr" - ], - "path_length": 5, - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "test_worker_wakes_up_with_configured_interval\n -> ScenarioWorker\n -> ScenarioWorker.__init__\n -> ScenarioWorker._name\n -> ScenarioWorker.name", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_worker_wakes_up_with_configured_interval:dataflow_slice", - "span_start": 52, - "span_end": 166, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 5, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "2fd137f5852febe907f44d3b3e4ea430f89ccfe962ae1442a16ab9df64c8f76c", - "edge_type": "dataflow_slice", - "src_symbol_id": "65f877f78191d65e6a752e41cedc70ebc784c266804a55c1c56440336e1f0d6e", - "src_qname": "test_worker_wakes_up_with_configured_interval", - "dst_symbol_id": "da022da2c49fd9cfd09d6e6da6bbd59aaa7d28efd669ce8444e88d327ddec2fc", - "dst_ref": "ScenarioWorker.name", - "resolution": "resolved", - "slice_id": "2fd137f5852febe907f44d3b3e4ea430f89ccfe962ae1442a16ab9df64c8f76c", - "root_symbol_id": "65f877f78191d65e6a752e41cedc70ebc784c266804a55c1c56440336e1f0d6e", - "path_symbols": [ - "test_worker_wakes_up_with_configured_interval", - "ScenarioWorker", - "ScenarioWorker.__init__", - "ScenarioWorker._name", - "ScenarioWorker.name" - ], - "path_symbol_ids": [ - "65f877f78191d65e6a752e41cedc70ebc784c266804a55c1c56440336e1f0d6e", - "9a1d08a7eb1831c9f2e0db361b5207f036e477c160773ae08c0b287239785c52", - "9c20be046ba06644d1432e0f20eb223663d2b116ee7d91fdc62bc68323f2e593", - "da022da2c49fd9cfd09d6e6da6bbd59aaa7d28efd669ce8444e88d327ddec2fc" - ], - "path_edge_types": [ - "instantiates", - "writes_attr", - "reads_attr" - ], - "path_length": 5, - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "test_actions_stop_busy_worker_before_timeout\n -> BlockingRoutine\n -> BlockingRoutine.__init__\n -> BlockingRoutine._started\n -> BlockingRoutine.run", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_actions_stop_busy_worker_before_timeout:dataflow_slice", - "span_start": 42, - "span_end": 212, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 5, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "f9bcce108870e49afa8b32d4625115a10707a3b0e7473179e958e5752bf258b4", - "edge_type": "dataflow_slice", - "src_symbol_id": "a0bb116ca9d909c93a285667ae033fbd1859b2dad7cf34fcb44816393ef6909c", - "src_qname": "test_actions_stop_busy_worker_before_timeout", - "dst_symbol_id": "d9841bdbb69706c988ae7ae6adf89928dc4fae45943f74064f5382177034ba04", - "dst_ref": "BlockingRoutine.run", - "resolution": "resolved", - "slice_id": "f9bcce108870e49afa8b32d4625115a10707a3b0e7473179e958e5752bf258b4", - "root_symbol_id": "a0bb116ca9d909c93a285667ae033fbd1859b2dad7cf34fcb44816393ef6909c", - "path_symbols": [ - "test_actions_stop_busy_worker_before_timeout", - "BlockingRoutine", - "BlockingRoutine.__init__", - "BlockingRoutine._started", - "BlockingRoutine.run" - ], - "path_symbol_ids": [ - "a0bb116ca9d909c93a285667ae033fbd1859b2dad7cf34fcb44816393ef6909c", - "a3349c5bc65e4003a4bbd6a8dbb7a54c337e12d1aed930caa701b12e520f1e67", - "486deeed3043c6db985aef258e96ddc67aa53608e67a83962fbd2471f649ddf1", - "d9841bdbb69706c988ae7ae6adf89928dc4fae45943f74064f5382177034ba04" - ], - "path_edge_types": [ - "instantiates", - "writes_attr", - "reads_attr" - ], - "path_length": 5, - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "test_actions_stop_busy_worker_after_timeout\n -> BlockingRoutine\n -> BlockingRoutine.__init__\n -> BlockingRoutine._started\n -> BlockingRoutine.run", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_actions_stop_busy_worker_after_timeout:dataflow_slice", - "span_start": 42, - "span_end": 238, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 5, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "8e7db3d2a9226f1c1d9942ac6373cfcafa0d2276758ddb8a3d3c455a3d58024d", - "edge_type": "dataflow_slice", - "src_symbol_id": "66392d3222421d9ba16eda3554940b16e7d5a6f33aa08c5738d35af2e32f1e4a", - "src_qname": "test_actions_stop_busy_worker_after_timeout", - "dst_symbol_id": "d9841bdbb69706c988ae7ae6adf89928dc4fae45943f74064f5382177034ba04", - "dst_ref": "BlockingRoutine.run", - "resolution": "resolved", - "slice_id": "8e7db3d2a9226f1c1d9942ac6373cfcafa0d2276758ddb8a3d3c455a3d58024d", - "root_symbol_id": "66392d3222421d9ba16eda3554940b16e7d5a6f33aa08c5738d35af2e32f1e4a", - "path_symbols": [ - "test_actions_stop_busy_worker_after_timeout", - "BlockingRoutine", - "BlockingRoutine.__init__", - "BlockingRoutine._started", - "BlockingRoutine.run" - ], - "path_symbol_ids": [ - "66392d3222421d9ba16eda3554940b16e7d5a6f33aa08c5738d35af2e32f1e4a", - "a3349c5bc65e4003a4bbd6a8dbb7a54c337e12d1aed930caa701b12e520f1e67", - "486deeed3043c6db985aef258e96ddc67aa53608e67a83962fbd2471f649ddf1", - "d9841bdbb69706c988ae7ae6adf89928dc4fae45943f74064f5382177034ba04" - ], - "path_edge_types": [ - "instantiates", - "writes_attr", - "reads_attr" - ], - "path_length": 5, - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "test_actions_stop_busy_worker_after_timeout\n -> BlockingRoutine\n -> BlockingRoutine.__init__\n -> BlockingRoutine._release\n -> BlockingRoutine.run", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_actions_stop_busy_worker_after_timeout:dataflow_slice", - "span_start": 43, - "span_end": 238, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 5, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "b59da9da82f9dfc8a9b695a08213786385da1ae9e17561ec3a0450a574a8cb39", - "edge_type": "dataflow_slice", - "src_symbol_id": "66392d3222421d9ba16eda3554940b16e7d5a6f33aa08c5738d35af2e32f1e4a", - "src_qname": "test_actions_stop_busy_worker_after_timeout", - "dst_symbol_id": "d9841bdbb69706c988ae7ae6adf89928dc4fae45943f74064f5382177034ba04", - "dst_ref": "BlockingRoutine.run", - "resolution": "resolved", - "slice_id": "b59da9da82f9dfc8a9b695a08213786385da1ae9e17561ec3a0450a574a8cb39", - "root_symbol_id": "66392d3222421d9ba16eda3554940b16e7d5a6f33aa08c5738d35af2e32f1e4a", - "path_symbols": [ - "test_actions_stop_busy_worker_after_timeout", - "BlockingRoutine", - "BlockingRoutine.__init__", - "BlockingRoutine._release", - "BlockingRoutine.run" - ], - "path_symbol_ids": [ - "66392d3222421d9ba16eda3554940b16e7d5a6f33aa08c5738d35af2e32f1e4a", - "a3349c5bc65e4003a4bbd6a8dbb7a54c337e12d1aed930caa701b12e520f1e67", - "486deeed3043c6db985aef258e96ddc67aa53608e67a83962fbd2471f649ddf1", - "d9841bdbb69706c988ae7ae6adf89928dc4fae45943f74064f5382177034ba04" - ], - "path_edge_types": [ - "instantiates", - "writes_attr", - "reads_attr" - ], - "path_length": 5, - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "test_actions_start_stop_and_health_when_worker_is_idle\n -> ScenarioWorker\n -> ScenarioWorker.__init__\n -> ScenarioWorker._name\n -> ScenarioWorker.name", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_actions_start_stop_and_health_when_worker_is_idle:dataflow_slice", - "span_start": 52, - "span_end": 182, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 5, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "8fb3c9e775ad1cfa91eebb8b8cef367dc53c923584236122235446e0579b468e", - "edge_type": "dataflow_slice", - "src_symbol_id": "09a78d8eb31c2da14fee58da53b5da7a5065a4c23b6300748a6d44517a5284b8", - "src_qname": "test_actions_start_stop_and_health_when_worker_is_idle", - "dst_symbol_id": "da022da2c49fd9cfd09d6e6da6bbd59aaa7d28efd669ce8444e88d327ddec2fc", - "dst_ref": "ScenarioWorker.name", - "resolution": "resolved", - "slice_id": "8fb3c9e775ad1cfa91eebb8b8cef367dc53c923584236122235446e0579b468e", - "root_symbol_id": "09a78d8eb31c2da14fee58da53b5da7a5065a4c23b6300748a6d44517a5284b8", - "path_symbols": [ - "test_actions_start_stop_and_health_when_worker_is_idle", - "ScenarioWorker", - "ScenarioWorker.__init__", - "ScenarioWorker._name", - "ScenarioWorker.name" - ], - "path_symbol_ids": [ - "09a78d8eb31c2da14fee58da53b5da7a5065a4c23b6300748a6d44517a5284b8", - "9a1d08a7eb1831c9f2e0db361b5207f036e477c160773ae08c0b287239785c52", - "9c20be046ba06644d1432e0f20eb223663d2b116ee7d91fdc62bc68323f2e593", - "da022da2c49fd9cfd09d6e6da6bbd59aaa7d28efd669ce8444e88d327ddec2fc" - ], - "path_edge_types": [ - "instantiates", - "writes_attr", - "reads_attr" - ], - "path_length": 5, - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "def test_actions_start_stop_and_health_when_worker_is_idle() -> None:\n runtime, base_url = _build_runtime(ScenarioWorker(\"idle-worker\", IntervalRoutine(), interval=0.2))\n try:\n stop_status, stop_payload = _http_call_json(base_url, \"/actions/stop\", method=\"POST\")\n assert stop_status == 200\n assert isinstance(stop_payload.get(\"detail\"), dict)\n assert stop_payload[\"detail\"][\"timed_out\"] is False\n assert stop_payload[\"detail\"][\"state\"] == \"stopped\"\n\n health_stopped_status, health_stopped_payload = _http_call_json(base_url, \"/health\")\n assert health_stopped_status == 503\n assert health_stopped_payload[\"state\"] == \"stopped\"\n assert health_stopped_payload[\"status\"] == \"unhealthy\"\n\n start_status, start_payload = _http_call_json(base_url, \"/actions/start\", method=\"POST\")\n assert start_status == 200\n assert isinstance(start_payload.get(\"detail\"), dict)\n assert start_payload[\"detail\"][\"timed_out\"] is False\n assert start_payload[\"detail\"][\"state\"] in {\"idle\", \"busy\"}\n\n health_started_status, health_started_payload = _http_call_json(base_url, \"/health\")\n assert health_started_status == 200\n assert health_started_payload[\"status\"] == \"ok\"\n assert health_started_payload[\"state\"] in {\"idle\", \"busy\"}\n finally:\n runtime.stop()", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:test_actions_start_stop_and_health_when_worker_is_idle", - "span_start": 181, - "span_end": 206, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 8, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "def _poll_until_stopped(base_url: str, timeout: float = 2.0) -> bool:\n deadline = monotonic() + timeout\n while monotonic() < deadline:\n _, payload = _http_call_json(base_url, \"/actions/status\")\n if payload.get(\"detail\") == \"stopped\":\n return True\n sleep(0.05)\n return False", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:_poll_until_stopped", - "span_start": 144, - "span_end": 151, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 5, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "def test_worker_wakes_up_with_configured_interval() -> None:\n interval = 0.15\n routine = IntervalRoutine()\n worker = ScenarioWorker(\"interval-worker\", routine, interval=interval)\n runtime = RuntimeManager()\n runtime.register_module(WorkerModule(worker))\n\n runtime.start()\n try:\n assert routine.wait_runs(count=3, timeout=2.0) is True\n finally:\n runtime.stop()\n\n deltas = routine.deltas()\n assert len(deltas) >= 2\n assert all(delta >= interval * 0.7 for delta in deltas[:2])", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:test_worker_wakes_up_with_configured_interval", - "span_start": 163, - "span_end": 178, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 7, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "class BlockingRoutine:\n def __init__(self, started: Event, release: Event) -> None:\n self._started = started\n self._release = release\n\n def run(self) -> None:\n self._started.set()\n self._release.wait(timeout=5.0)", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:BlockingRoutine", - "span_start": 40, - "span_end": 47, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 1, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "class WorkerModule(ApplicationModule):\n def __init__(self, worker: Worker) -> None:\n self._worker = worker\n\n @property\n def name(self) -> str:\n return \"business-tests\"\n\n def register(self, registry: ModuleRegistry) -> None:\n registry.add_worker(self._worker)", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:WorkerModule", - "span_start": 113, - "span_end": 122, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 3, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "def _http_call_json(\n base_url: str,\n path: str,\n *,\n method: str = \"GET\",\n headers: dict[str, str] | None = None,\n) -> tuple[int, dict[str, object]]:\n request = Request(f\"{base_url}{path}\", method=method, headers=headers or {})\n try:\n with urlopen(request, timeout=15.0) as response:\n status = response.status\n body = response.read()\n except HTTPError as error:\n status = error.code\n body = error.read()\n payload = json.loads(body.decode(\"utf-8\"))\n return status, payload", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:_http_call_json", - "span_start": 125, - "span_end": 141, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 4, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "def _build_runtime(worker: Worker, *, control_timeout: int = 1) -> tuple[RuntimeManager, str]:\n runtime = RuntimeManager()\n channel = HttpControlChannel(host=\"127.0.0.1\", port=0, timeout=control_timeout)\n runtime.control_plane.register_channel(channel)\n runtime.register_module(WorkerModule(worker))\n runtime.start()\n return runtime, f\"http://127.0.0.1:{channel.port}\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:_build_runtime", - "span_start": 154, - "span_end": 160, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 6, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "class ScenarioWorker(Worker):\n def __init__(self, name: str, routine: object, *, interval: float = 0.05) -> None:\n self._name = name\n self._routine = routine\n self._interval = interval\n self._thread: Thread | None = None\n self._stop_requested = Event()\n self._in_flight = 0\n self._runs = 0\n self._lock = Lock()\n\n @property\n def name(self) -> str:\n return self._name\n\n @property\n def critical(self) -> bool:\n return True\n\n def start(self) -> None:\n if self._thread is not None and self._thread.is_alive():\n return\n self._stop_requested.clear()\n self._thread = Thread(target=self._loop, name=f\"{self._name}-thread\", daemon=True)\n self._thread.start()\n\n def stop(self, force: bool = False) -> None:\n self._stop_requested.set()\n\n def health(self) -> WorkerHealth:\n return WorkerHealth(name=self.name, status=\"ok\", critical=True, meta={\"runs\": self._runs})\n\n def status(self) -> WorkerStatus:\n thread_alive = self._thread is not None and self._thread.is_alive()\n with self._lock:\n in_flight = self._in_flight\n runs = self._runs\n if not thread_alive:\n state = \"stopped\"\n elif self._stop_requested.is_set():\n state = \"stopping\"\n elif in_flight > 0:\n state = \"busy\"\n else:\n state = \"idle\"\n return WorkerStatus(name=self.name, state=state, in_flight=in_flight, meta={\"runs\": runs})\n\n def _loop(self) -> None:\n while not self._stop_requested.is_set():\n with self._lock:\n self._in_flight += 1\n try:\n self._routine.run()\n with self._lock:\n self._runs += 1\n finally:\n with self._lock:\n self._in_flight -= 1\n if self._stop_requested.is_set():\n return\n sleep(self._interval)", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:ScenarioWorker", - "span_start": 50, - "span_end": 110, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 2, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "class IntervalRoutine:\n calls: list[float] = field(default_factory=list)\n _lock: Lock = field(default_factory=Lock)\n\n def run(self) -> None:\n with self._lock:\n self.calls.append(monotonic())\n\n def wait_runs(self, count: int, timeout: float) -> bool:\n deadline = monotonic() + timeout\n while monotonic() < deadline:\n with self._lock:\n if len(self.calls) >= count:\n return True\n sleep(0.01)\n return False\n\n def deltas(self) -> list[float]:\n with self._lock:\n return [self.calls[index + 1] - self.calls[index] for index in range(len(self.calls) - 1)]", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:IntervalRoutine", - "span_start": 18, - "span_end": 37, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "def test_actions_stop_busy_worker_before_timeout() -> None:\n started = Event()\n release = Event()\n runtime, base_url = _build_runtime(ScenarioWorker(\"busy-worker\", BlockingRoutine(started, release)))\n assert started.wait(timeout=1.0) is True\n\n def release_later() -> None:\n sleep(0.2)\n release.set()\n\n Thread(target=release_later, daemon=True).start()\n try:\n status, payload = _http_call_json(base_url, \"/actions/stop\", method=\"POST\")\n assert status == 200\n assert isinstance(payload.get(\"detail\"), dict)\n assert payload[\"detail\"][\"timed_out\"] is False\n assert payload[\"detail\"][\"state\"] == \"stopped\"\n\n health_status, health_payload = _http_call_json(base_url, \"/health\")\n assert health_status == 503\n assert health_payload[\"status\"] == \"unhealthy\"\n assert health_payload[\"state\"] == \"stopped\"\n finally:\n runtime.stop()", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:test_actions_stop_busy_worker_before_timeout", - "span_start": 209, - "span_end": 232, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 9, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "llm_answer": "Прямых тестов конкретно для `WorkflowRuntimeFactory` в предоставленном контексте не обнаружено. Имя класса, его импорты или вызовы не упоминаются ни в одном из перечисленных тестов.\n\nОднако можно найти косвенно связанные тесты, которые могут проверять функционал, связанный с управлением рабочими потоками или сценариями выполнения рабочих задач (например, блокирующие рутины, сценарии работы с интервалами). Эти тесты преимущественно проверяют поведение отдельных компонентов системы управления выполнением задач, таких как запуск, остановка и мониторинг активности работников.\n\nНапример:\n- tests/test_business_control_actions.py: Тесты проверяют взаимодействие с различными действиями, связанными с состоянием и здоровьем рабочего потока (`ScenarioWorker`, `BlockingRoutine`), но напрямую не касаются `WorkflowRuntimeFactory`.\n \nЭти тесты фокусируются на проверке правильности работы различных сценариев жизненного цикла процессов, таких как старт, остановка и проверка состояния работающих потоков.", - "summary": { - "router": { - "intent": "CODE_QA", - "sub_intent": "FIND_TESTS", - "confidence": null - }, - "retrieval": { - "profile": "code", - "layers_hit": [ - "C0_SOURCE_CHUNKS", - "C2_DEPENDENCY_GRAPH" - ], - "evidence_sufficient": true - }, - "llm": { - "answer_status": "answered", - "groundedness": "grounded" - } - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "FIND_TESTS", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "WorkflowRuntimeFactory" - ], - "keyword_hints": [ - "WorkflowRuntimeFactory" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**", - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "test_file_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "test_symbol_patterns": [ - "test_workflow_runtime_factory", - "TestWorkflowRuntimeFactory", - "WorkflowRuntimeFactory" - ], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C0_SOURCE_CHUNKS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C0_SOURCE_CHUNKS": 10 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [], - "include_globs": [ - "src", - "tests" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests" - ] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src", - "tests" - ], - "include_globs": [ - "src", - "tests" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests" - ] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src", - "tests" - ], - "include_globs": [ - "src", - "tests" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests" - ] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "WorkflowRuntimeFactory", - "path_scope": [], - "include_globs": [ - "src/**", - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "Где тесты для WorkflowRuntimeFactory? test_workflow_runtime_factory TestWorkflowRuntimeFactory WorkflowRuntimeFactory", - "path_scope": [], - "include_globs": [ - "src/**", - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "top_k": 6, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Где тесты для WorkflowRuntimeFactory? test_workflow_runtime_factory TestWorkflowRuntimeFactory WorkflowRuntimeFactory", - "path_scope": [], - "include_globs": [ - "src/**", - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "top_k": 10, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [], - "normalized_include_globs": [ - "src", - "tests" - ], - "normalized_exclude_globs": [], - "normalized_prefer_globs": [ - "tests" - ], - "filter_stage": "post_rank", - "candidates_before_filter": 0, - "candidates_after_filter": 0 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src", - "tests" - ], - "normalized_include_globs": [ - "src", - "tests" - ], - "normalized_exclude_globs": [], - "normalized_prefer_globs": [ - "tests" - ], - "filter_stage": "post_rank", - "candidates_before_filter": 6, - "candidates_after_filter": 6 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src", - "tests" - ], - "normalized_include_globs": [ - "src", - "tests" - ], - "normalized_exclude_globs": [], - "normalized_prefer_globs": [ - "tests" - ], - "filter_stage": "post_rank", - "candidates_before_filter": 10, - "candidates_after_filter": 10 - } - ], - "fallback": { - "used": true, - "reason": "scope_relaxed_no_hits" - }, - "symbol_resolution": { - "status": "not_found", - "resolved_symbol": null, - "alternatives": [ - "WorkflowRuntimeFactory" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "miss", - "hit_count": 0, - "fail_reason": "scope_relaxed_no_hits" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 6, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 10, - "fail_reason": null - } - ] - }, - "constraint_violations": [ - { - "type": "LAYER_MISSING", - "severity": "warn", - "details": { - "layer": "C1_SYMBOL_CATALOG", - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ] - }, - "suggested_fix": "Increase top_k for this layer or relax constraints for retrieval." - } - ], - "timings_ms": { - "router": 0, - "symbol_resolution": 0, - "retrieval_total": 129, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 68, - "C2_DEPENDENCY_GRAPH": 45, - "C0_SOURCE_CHUNKS": 15 - }, - "merge_rank": 0, - "prompt_build": 0, - "llm_call": 1920 - }, - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 1019, - "evidence_rows": 16, - "evidence_chars": 8149 - }, - "evidence_summary": [ - { - "layer": "C2_DEPENDENCY_GRAPH", - "count": 6, - "unique_paths": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 10, - "unique_paths": 1 - } - ], - "prompt_template_id": "intent_code_qa_find_tests_ru_v3", - "system_prompt_version": "v1" - }, - "router": { - "conversation_mode": "START", - "keyword_hints": [ - "WorkflowRuntimeFactory" - ], - "path_scope": [] - }, - "llm": { - "used_evidence_count": 16, - "missing_evidence_reason": null - } - }, - "run_info": { - "case_id": "plba-v2-find-tests-workflow-runtime-factory-negative", - "mode": "full_chain", - "run_started_at": "2026-03-12T14:07:09", - "rag_session_id": "7d11da21-faa0-4cea-aede-aeabe069164c", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - }, - "input_request": { - "text": "Где тесты для WorkflowRuntimeFactory?", - "normalized_query": "Где тесты для WorkflowRuntimeFactory?" - }, - "steps": [ - { - "step": "intent_router", - "input": { - "query": "Где тесты для WorkflowRuntimeFactory?" - }, - "output": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Где тесты для WorkflowRuntimeFactory?" - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "FIND_TESTS", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "WorkflowRuntimeFactory" - ], - "keyword_hints": [ - "WorkflowRuntimeFactory" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**", - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "test_file_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "test_symbol_patterns": [ - "test_workflow_runtime_factory", - "TestWorkflowRuntimeFactory", - "WorkflowRuntimeFactory" - ], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "timings_ms": { - "router": 0 - } - } - }, - { - "step": "retrieval", - "input": { - "query": "Где тесты для WorkflowRuntimeFactory?" - }, - "output": { - "symbol_resolution": { - "status": "not_found", - "resolved_symbol": null, - "alternatives": [ - "WorkflowRuntimeFactory" - ], - "confidence": 0.0 - }, - "rag_count": 16, - "rag_rows": [ - { - "path": "tests/test_business_control_actions.py", - "content": "test_actions_stop_busy_worker_before_timeout\n -> BlockingRoutine\n -> BlockingRoutine.__init__\n -> BlockingRoutine._release\n -> BlockingRoutine.run", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_actions_stop_busy_worker_before_timeout:dataflow_slice", - "span_start": 43, - "span_end": 212, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 5, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "8bd726155ba387d3579763ee84dfd2f9a90bc917da88f3b2e89416ab5c1254d6", - "edge_type": "dataflow_slice", - "src_symbol_id": "a0bb116ca9d909c93a285667ae033fbd1859b2dad7cf34fcb44816393ef6909c", - "src_qname": "test_actions_stop_busy_worker_before_timeout", - "dst_symbol_id": "d9841bdbb69706c988ae7ae6adf89928dc4fae45943f74064f5382177034ba04", - "dst_ref": "BlockingRoutine.run", - "resolution": "resolved", - "slice_id": "8bd726155ba387d3579763ee84dfd2f9a90bc917da88f3b2e89416ab5c1254d6", - "root_symbol_id": "a0bb116ca9d909c93a285667ae033fbd1859b2dad7cf34fcb44816393ef6909c", - "path_symbols": [ - "test_actions_stop_busy_worker_before_timeout", - "BlockingRoutine", - "BlockingRoutine.__init__", - "BlockingRoutine._release", - "BlockingRoutine.run" - ], - "path_symbol_ids": [ - "a0bb116ca9d909c93a285667ae033fbd1859b2dad7cf34fcb44816393ef6909c", - "a3349c5bc65e4003a4bbd6a8dbb7a54c337e12d1aed930caa701b12e520f1e67", - "486deeed3043c6db985aef258e96ddc67aa53608e67a83962fbd2471f649ddf1", - "d9841bdbb69706c988ae7ae6adf89928dc4fae45943f74064f5382177034ba04" - ], - "path_edge_types": [ - "instantiates", - "writes_attr", - "reads_attr" - ], - "path_length": 5, - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "test_worker_wakes_up_with_configured_interval\n -> ScenarioWorker\n -> ScenarioWorker.__init__\n -> ScenarioWorker._name\n -> ScenarioWorker.name", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_worker_wakes_up_with_configured_interval:dataflow_slice", - "span_start": 52, - "span_end": 166, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 5, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "2fd137f5852febe907f44d3b3e4ea430f89ccfe962ae1442a16ab9df64c8f76c", - "edge_type": "dataflow_slice", - "src_symbol_id": "65f877f78191d65e6a752e41cedc70ebc784c266804a55c1c56440336e1f0d6e", - "src_qname": "test_worker_wakes_up_with_configured_interval", - "dst_symbol_id": "da022da2c49fd9cfd09d6e6da6bbd59aaa7d28efd669ce8444e88d327ddec2fc", - "dst_ref": "ScenarioWorker.name", - "resolution": "resolved", - "slice_id": "2fd137f5852febe907f44d3b3e4ea430f89ccfe962ae1442a16ab9df64c8f76c", - "root_symbol_id": "65f877f78191d65e6a752e41cedc70ebc784c266804a55c1c56440336e1f0d6e", - "path_symbols": [ - "test_worker_wakes_up_with_configured_interval", - "ScenarioWorker", - "ScenarioWorker.__init__", - "ScenarioWorker._name", - "ScenarioWorker.name" - ], - "path_symbol_ids": [ - "65f877f78191d65e6a752e41cedc70ebc784c266804a55c1c56440336e1f0d6e", - "9a1d08a7eb1831c9f2e0db361b5207f036e477c160773ae08c0b287239785c52", - "9c20be046ba06644d1432e0f20eb223663d2b116ee7d91fdc62bc68323f2e593", - "da022da2c49fd9cfd09d6e6da6bbd59aaa7d28efd669ce8444e88d327ddec2fc" - ], - "path_edge_types": [ - "instantiates", - "writes_attr", - "reads_attr" - ], - "path_length": 5, - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "test_actions_stop_busy_worker_before_timeout\n -> BlockingRoutine\n -> BlockingRoutine.__init__\n -> BlockingRoutine._started\n -> BlockingRoutine.run", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_actions_stop_busy_worker_before_timeout:dataflow_slice", - "span_start": 42, - "span_end": 212, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 5, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "f9bcce108870e49afa8b32d4625115a10707a3b0e7473179e958e5752bf258b4", - "edge_type": "dataflow_slice", - "src_symbol_id": "a0bb116ca9d909c93a285667ae033fbd1859b2dad7cf34fcb44816393ef6909c", - "src_qname": "test_actions_stop_busy_worker_before_timeout", - "dst_symbol_id": "d9841bdbb69706c988ae7ae6adf89928dc4fae45943f74064f5382177034ba04", - "dst_ref": "BlockingRoutine.run", - "resolution": "resolved", - "slice_id": "f9bcce108870e49afa8b32d4625115a10707a3b0e7473179e958e5752bf258b4", - "root_symbol_id": "a0bb116ca9d909c93a285667ae033fbd1859b2dad7cf34fcb44816393ef6909c", - "path_symbols": [ - "test_actions_stop_busy_worker_before_timeout", - "BlockingRoutine", - "BlockingRoutine.__init__", - "BlockingRoutine._started", - "BlockingRoutine.run" - ], - "path_symbol_ids": [ - "a0bb116ca9d909c93a285667ae033fbd1859b2dad7cf34fcb44816393ef6909c", - "a3349c5bc65e4003a4bbd6a8dbb7a54c337e12d1aed930caa701b12e520f1e67", - "486deeed3043c6db985aef258e96ddc67aa53608e67a83962fbd2471f649ddf1", - "d9841bdbb69706c988ae7ae6adf89928dc4fae45943f74064f5382177034ba04" - ], - "path_edge_types": [ - "instantiates", - "writes_attr", - "reads_attr" - ], - "path_length": 5, - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "test_actions_stop_busy_worker_after_timeout\n -> BlockingRoutine\n -> BlockingRoutine.__init__\n -> BlockingRoutine._started\n -> BlockingRoutine.run", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_actions_stop_busy_worker_after_timeout:dataflow_slice", - "span_start": 42, - "span_end": 238, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 5, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "8e7db3d2a9226f1c1d9942ac6373cfcafa0d2276758ddb8a3d3c455a3d58024d", - "edge_type": "dataflow_slice", - "src_symbol_id": "66392d3222421d9ba16eda3554940b16e7d5a6f33aa08c5738d35af2e32f1e4a", - "src_qname": "test_actions_stop_busy_worker_after_timeout", - "dst_symbol_id": "d9841bdbb69706c988ae7ae6adf89928dc4fae45943f74064f5382177034ba04", - "dst_ref": "BlockingRoutine.run", - "resolution": "resolved", - "slice_id": "8e7db3d2a9226f1c1d9942ac6373cfcafa0d2276758ddb8a3d3c455a3d58024d", - "root_symbol_id": "66392d3222421d9ba16eda3554940b16e7d5a6f33aa08c5738d35af2e32f1e4a", - "path_symbols": [ - "test_actions_stop_busy_worker_after_timeout", - "BlockingRoutine", - "BlockingRoutine.__init__", - "BlockingRoutine._started", - "BlockingRoutine.run" - ], - "path_symbol_ids": [ - "66392d3222421d9ba16eda3554940b16e7d5a6f33aa08c5738d35af2e32f1e4a", - "a3349c5bc65e4003a4bbd6a8dbb7a54c337e12d1aed930caa701b12e520f1e67", - "486deeed3043c6db985aef258e96ddc67aa53608e67a83962fbd2471f649ddf1", - "d9841bdbb69706c988ae7ae6adf89928dc4fae45943f74064f5382177034ba04" - ], - "path_edge_types": [ - "instantiates", - "writes_attr", - "reads_attr" - ], - "path_length": 5, - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "test_actions_stop_busy_worker_after_timeout\n -> BlockingRoutine\n -> BlockingRoutine.__init__\n -> BlockingRoutine._release\n -> BlockingRoutine.run", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_actions_stop_busy_worker_after_timeout:dataflow_slice", - "span_start": 43, - "span_end": 238, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 5, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "b59da9da82f9dfc8a9b695a08213786385da1ae9e17561ec3a0450a574a8cb39", - "edge_type": "dataflow_slice", - "src_symbol_id": "66392d3222421d9ba16eda3554940b16e7d5a6f33aa08c5738d35af2e32f1e4a", - "src_qname": "test_actions_stop_busy_worker_after_timeout", - "dst_symbol_id": "d9841bdbb69706c988ae7ae6adf89928dc4fae45943f74064f5382177034ba04", - "dst_ref": "BlockingRoutine.run", - "resolution": "resolved", - "slice_id": "b59da9da82f9dfc8a9b695a08213786385da1ae9e17561ec3a0450a574a8cb39", - "root_symbol_id": "66392d3222421d9ba16eda3554940b16e7d5a6f33aa08c5738d35af2e32f1e4a", - "path_symbols": [ - "test_actions_stop_busy_worker_after_timeout", - "BlockingRoutine", - "BlockingRoutine.__init__", - "BlockingRoutine._release", - "BlockingRoutine.run" - ], - "path_symbol_ids": [ - "66392d3222421d9ba16eda3554940b16e7d5a6f33aa08c5738d35af2e32f1e4a", - "a3349c5bc65e4003a4bbd6a8dbb7a54c337e12d1aed930caa701b12e520f1e67", - "486deeed3043c6db985aef258e96ddc67aa53608e67a83962fbd2471f649ddf1", - "d9841bdbb69706c988ae7ae6adf89928dc4fae45943f74064f5382177034ba04" - ], - "path_edge_types": [ - "instantiates", - "writes_attr", - "reads_attr" - ], - "path_length": 5, - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "test_actions_start_stop_and_health_when_worker_is_idle\n -> ScenarioWorker\n -> ScenarioWorker.__init__\n -> ScenarioWorker._name\n -> ScenarioWorker.name", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_actions_start_stop_and_health_when_worker_is_idle:dataflow_slice", - "span_start": 52, - "span_end": 182, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 5, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "8fb3c9e775ad1cfa91eebb8b8cef367dc53c923584236122235446e0579b468e", - "edge_type": "dataflow_slice", - "src_symbol_id": "09a78d8eb31c2da14fee58da53b5da7a5065a4c23b6300748a6d44517a5284b8", - "src_qname": "test_actions_start_stop_and_health_when_worker_is_idle", - "dst_symbol_id": "da022da2c49fd9cfd09d6e6da6bbd59aaa7d28efd669ce8444e88d327ddec2fc", - "dst_ref": "ScenarioWorker.name", - "resolution": "resolved", - "slice_id": "8fb3c9e775ad1cfa91eebb8b8cef367dc53c923584236122235446e0579b468e", - "root_symbol_id": "09a78d8eb31c2da14fee58da53b5da7a5065a4c23b6300748a6d44517a5284b8", - "path_symbols": [ - "test_actions_start_stop_and_health_when_worker_is_idle", - "ScenarioWorker", - "ScenarioWorker.__init__", - "ScenarioWorker._name", - "ScenarioWorker.name" - ], - "path_symbol_ids": [ - "09a78d8eb31c2da14fee58da53b5da7a5065a4c23b6300748a6d44517a5284b8", - "9a1d08a7eb1831c9f2e0db361b5207f036e477c160773ae08c0b287239785c52", - "9c20be046ba06644d1432e0f20eb223663d2b116ee7d91fdc62bc68323f2e593", - "da022da2c49fd9cfd09d6e6da6bbd59aaa7d28efd669ce8444e88d327ddec2fc" - ], - "path_edge_types": [ - "instantiates", - "writes_attr", - "reads_attr" - ], - "path_length": 5, - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "def test_actions_start_stop_and_health_when_worker_is_idle() -> None:\n runtime, base_url = _build_runtime(ScenarioWorker(\"idle-worker\", IntervalRoutine(), interval=0.2))\n try:\n stop_status, stop_payload = _http_call_json(base_url, \"/actions/stop\", method=\"POST\")\n assert stop_status == 200\n assert isinstance(stop_payload.get(\"detail\"), dict)\n assert stop_payload[\"detail\"][\"timed_out\"] is False\n assert stop_payload[\"detail\"][\"state\"] == \"stopped\"\n\n health_stopped_status, health_stopped_payload = _http_call_json(base_url, \"/health\")\n assert health_stopped_status == 503\n assert health_stopped_payload[\"state\"] == \"stopped\"\n assert health_stopped_payload[\"status\"] == \"unhealthy\"\n\n start_status, start_payload = _http_call_json(base_url, \"/actions/start\", method=\"POST\")\n assert start_status == 200\n assert isinstance(start_payload.get(\"detail\"), dict)\n assert start_payload[\"detail\"][\"timed_out\"] is False\n assert start_payload[\"detail\"][\"state\"] in {\"idle\", \"busy\"}\n\n health_started_status, health_started_payload = _http_call_json(base_url, \"/health\")\n assert health_started_status == 200\n assert health_started_payload[\"status\"] == \"ok\"\n assert health_started_payload[\"state\"] in {\"idle\", \"busy\"}\n finally:\n runtime.stop()", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:test_actions_start_stop_and_health_when_worker_is_idle", - "span_start": 181, - "span_end": 206, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 8, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "def _poll_until_stopped(base_url: str, timeout: float = 2.0) -> bool:\n deadline = monotonic() + timeout\n while monotonic() < deadline:\n _, payload = _http_call_json(base_url, \"/actions/status\")\n if payload.get(\"detail\") == \"stopped\":\n return True\n sleep(0.05)\n return False", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:_poll_until_stopped", - "span_start": 144, - "span_end": 151, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 5, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "def test_worker_wakes_up_with_configured_interval() -> None:\n interval = 0.15\n routine = IntervalRoutine()\n worker = ScenarioWorker(\"interval-worker\", routine, interval=interval)\n runtime = RuntimeManager()\n runtime.register_module(WorkerModule(worker))\n\n runtime.start()\n try:\n assert routine.wait_runs(count=3, timeout=2.0) is True\n finally:\n runtime.stop()\n\n deltas = routine.deltas()\n assert len(deltas) >= 2\n assert all(delta >= interval * 0.7 for delta in deltas[:2])", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:test_worker_wakes_up_with_configured_interval", - "span_start": 163, - "span_end": 178, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 7, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "class BlockingRoutine:\n def __init__(self, started: Event, release: Event) -> None:\n self._started = started\n self._release = release\n\n def run(self) -> None:\n self._started.set()\n self._release.wait(timeout=5.0)", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:BlockingRoutine", - "span_start": 40, - "span_end": 47, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 1, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "class WorkerModule(ApplicationModule):\n def __init__(self, worker: Worker) -> None:\n self._worker = worker\n\n @property\n def name(self) -> str:\n return \"business-tests\"\n\n def register(self, registry: ModuleRegistry) -> None:\n registry.add_worker(self._worker)", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:WorkerModule", - "span_start": 113, - "span_end": 122, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 3, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "def _http_call_json(\n base_url: str,\n path: str,\n *,\n method: str = \"GET\",\n headers: dict[str, str] | None = None,\n) -> tuple[int, dict[str, object]]:\n request = Request(f\"{base_url}{path}\", method=method, headers=headers or {})\n try:\n with urlopen(request, timeout=15.0) as response:\n status = response.status\n body = response.read()\n except HTTPError as error:\n status = error.code\n body = error.read()\n payload = json.loads(body.decode(\"utf-8\"))\n return status, payload", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:_http_call_json", - "span_start": 125, - "span_end": 141, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 4, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "def _build_runtime(worker: Worker, *, control_timeout: int = 1) -> tuple[RuntimeManager, str]:\n runtime = RuntimeManager()\n channel = HttpControlChannel(host=\"127.0.0.1\", port=0, timeout=control_timeout)\n runtime.control_plane.register_channel(channel)\n runtime.register_module(WorkerModule(worker))\n runtime.start()\n return runtime, f\"http://127.0.0.1:{channel.port}\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:_build_runtime", - "span_start": 154, - "span_end": 160, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 6, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "class ScenarioWorker(Worker):\n def __init__(self, name: str, routine: object, *, interval: float = 0.05) -> None:\n self._name = name\n self._routine = routine\n self._interval = interval\n self._thread: Thread | None = None\n self._stop_requested = Event()\n self._in_flight = 0\n self._runs = 0\n self._lock = Lock()\n\n @property\n def name(self) -> str:\n return self._name\n\n @property\n def critical(self) -> bool:\n return True\n\n def start(self) -> None:\n if self._thread is not None and self._thread.is_alive():\n return\n self._stop_requested.clear()\n self._thread = Thread(target=self._loop, name=f\"{self._name}-thread\", daemon=True)\n self._thread.start()\n\n def stop(self, force: bool = False) -> None:\n self._stop_requested.set()\n\n def health(self) -> WorkerHealth:\n return WorkerHealth(name=self.name, status=\"ok\", critical=True, meta={\"runs\": self._runs})\n\n def status(self) -> WorkerStatus:\n thread_alive = self._thread is not None and self._thread.is_alive()\n with self._lock:\n in_flight = self._in_flight\n runs = self._runs\n if not thread_alive:\n state = \"stopped\"\n elif self._stop_requested.is_set():\n state = \"stopping\"\n elif in_flight > 0:\n state = \"busy\"\n else:\n state = \"idle\"\n return WorkerStatus(name=self.name, state=state, in_flight=in_flight, meta={\"runs\": runs})\n\n def _loop(self) -> None:\n while not self._stop_requested.is_set():\n with self._lock:\n self._in_flight += 1\n try:\n self._routine.run()\n with self._lock:\n self._runs += 1\n finally:\n with self._lock:\n self._in_flight -= 1\n if self._stop_requested.is_set():\n return\n sleep(self._interval)", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:ScenarioWorker", - "span_start": 50, - "span_end": 110, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 2, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "class IntervalRoutine:\n calls: list[float] = field(default_factory=list)\n _lock: Lock = field(default_factory=Lock)\n\n def run(self) -> None:\n with self._lock:\n self.calls.append(monotonic())\n\n def wait_runs(self, count: int, timeout: float) -> bool:\n deadline = monotonic() + timeout\n while monotonic() < deadline:\n with self._lock:\n if len(self.calls) >= count:\n return True\n sleep(0.01)\n return False\n\n def deltas(self) -> list[float]:\n with self._lock:\n return [self.calls[index + 1] - self.calls[index] for index in range(len(self.calls) - 1)]", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:IntervalRoutine", - "span_start": 18, - "span_end": 37, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "def test_actions_stop_busy_worker_before_timeout() -> None:\n started = Event()\n release = Event()\n runtime, base_url = _build_runtime(ScenarioWorker(\"busy-worker\", BlockingRoutine(started, release)))\n assert started.wait(timeout=1.0) is True\n\n def release_later() -> None:\n sleep(0.2)\n release.set()\n\n Thread(target=release_later, daemon=True).start()\n try:\n status, payload = _http_call_json(base_url, \"/actions/stop\", method=\"POST\")\n assert status == 200\n assert isinstance(payload.get(\"detail\"), dict)\n assert payload[\"detail\"][\"timed_out\"] is False\n assert payload[\"detail\"][\"state\"] == \"stopped\"\n\n health_status, health_payload = _http_call_json(base_url, \"/health\")\n assert health_status == 503\n assert health_payload[\"status\"] == \"unhealthy\"\n assert health_payload[\"state\"] == \"stopped\"\n finally:\n runtime.stop()", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:test_actions_stop_busy_worker_before_timeout", - "span_start": 209, - "span_end": 232, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 9, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ] - }, - "diagnostics": { - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C0_SOURCE_CHUNKS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C0_SOURCE_CHUNKS": 10 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [], - "include_globs": [ - "src", - "tests" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests" - ] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src", - "tests" - ], - "include_globs": [ - "src", - "tests" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests" - ] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src", - "tests" - ], - "include_globs": [ - "src", - "tests" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests" - ] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "WorkflowRuntimeFactory", - "path_scope": [], - "include_globs": [ - "src/**", - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "Где тесты для WorkflowRuntimeFactory? test_workflow_runtime_factory TestWorkflowRuntimeFactory WorkflowRuntimeFactory", - "path_scope": [], - "include_globs": [ - "src/**", - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "top_k": 6, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Где тесты для WorkflowRuntimeFactory? test_workflow_runtime_factory TestWorkflowRuntimeFactory WorkflowRuntimeFactory", - "path_scope": [], - "include_globs": [ - "src/**", - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "top_k": 10, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [], - "normalized_include_globs": [ - "src", - "tests" - ], - "normalized_exclude_globs": [], - "normalized_prefer_globs": [ - "tests" - ], - "filter_stage": "post_rank", - "candidates_before_filter": 0, - "candidates_after_filter": 0 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src", - "tests" - ], - "normalized_include_globs": [ - "src", - "tests" - ], - "normalized_exclude_globs": [], - "normalized_prefer_globs": [ - "tests" - ], - "filter_stage": "post_rank", - "candidates_before_filter": 6, - "candidates_after_filter": 6 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src", - "tests" - ], - "normalized_include_globs": [ - "src", - "tests" - ], - "normalized_exclude_globs": [], - "normalized_prefer_globs": [ - "tests" - ], - "filter_stage": "post_rank", - "candidates_before_filter": 10, - "candidates_after_filter": 10 - } - ], - "fallback": { - "used": true, - "reason": "scope_relaxed_no_hits" - }, - "symbol_resolution": { - "status": "not_found", - "resolved_symbol": null, - "alternatives": [ - "WorkflowRuntimeFactory" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "miss", - "hit_count": 0, - "fail_reason": "scope_relaxed_no_hits" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 6, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 10, - "fail_reason": null - } - ] - }, - "constraint_violations": [ - { - "type": "LAYER_MISSING", - "severity": "warn", - "details": { - "layer": "C1_SYMBOL_CATALOG", - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ] - }, - "suggested_fix": "Increase top_k for this layer or relax constraints for retrieval." - } - ], - "timings_ms": { - "symbol_resolution": 0, - "retrieval_total": 129, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 68, - "C2_DEPENDENCY_GRAPH": 45, - "C0_SOURCE_CHUNKS": 15 - }, - "merge_rank": 0 - } - } - }, - { - "step": "llm_answer", - "input": { - "query": "Где тесты для WorkflowRuntimeFactory?", - "rag_count": 16 - }, - "output": { - "llm_answer": "Прямых тестов конкретно для `WorkflowRuntimeFactory` в предоставленном контексте не обнаружено. Имя класса, его импорты или вызовы не упоминаются ни в одном из перечисленных тестов.\n\nОднако можно найти косвенно связанные тесты, которые могут проверять функционал, связанный с управлением рабочими потоками или сценариями выполнения рабочих задач (например, блокирующие рутины, сценарии работы с интервалами). Эти тесты преимущественно проверяют поведение отдельных компонентов системы управления выполнением задач, таких как запуск, остановка и мониторинг активности работников.\n\nНапример:\n- tests/test_business_control_actions.py: Тесты проверяют взаимодействие с различными действиями, связанными с состоянием и здоровьем рабочего потока (`ScenarioWorker`, `BlockingRoutine`), но напрямую не касаются `WorkflowRuntimeFactory`.\n \nЭти тесты фокусируются на проверке правильности работы различных сценариев жизненного цикла процессов, таких как старт, остановка и проверка состояния работающих потоков." - }, - "diagnostics": { - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 1019, - "evidence_rows": 16, - "evidence_chars": 8149 - }, - "evidence_summary": [ - { - "layer": "C2_DEPENDENCY_GRAPH", - "count": 6, - "unique_paths": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 10, - "unique_paths": 1 - } - ], - "prompt_template_id": "intent_code_qa_find_tests_ru_v3", - "system_prompt_version": "v1" - }, - "timings_ms": { - "prompt_build": 0, - "llm_call": 1920 - } - } - } - ] - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_140708/full_chain_plba_code_subintents_v2_plba-v2-find-tests-workflow-runtime-factory-negative.md b/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_140708/full_chain_plba_code_subintents_v2_plba-v2-find-tests-workflow-runtime-factory-negative.md deleted file mode 100644 index 712bddd..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_140708/full_chain_plba_code_subintents_v2_plba-v2-find-tests-workflow-runtime-factory-negative.md +++ /dev/null @@ -1,32 +0,0 @@ -# plba-v2-find-tests-workflow-runtime-factory-negative - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_subintents_v2.yaml -- runner: runtime -- mode: full_chain -- passed: True - -## Query -Где тесты для WorkflowRuntimeFactory? - -## Actual -{ - "intent": "CODE_QA", - "sub_intent": "FIND_TESTS", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 16, - "llm_answer": "Прямых тестов конкретно для `WorkflowRuntimeFactory` в предоставленном контексте не обнаружено. Имя класса, его импорты или вызовы не упоминаются ни в одном из перечисленных тестов.\n\nОднако можно найти косвенно связанные тесты, которые могут проверять функционал, связанный с управлением рабочими потоками или сценариями выполнения рабочих задач (например, блокирующие рутины, сценарии работы с интервалами). Эти тесты преимущественно проверяют поведение отдельных компонентов системы управления выполнением задач, таких как запуск, остановка и мониторинг активности работников.\n\nНапример:\n- tests/test_business_control_actions.py: Тесты проверяют взаимодействие с различными действиями, связанными с состоянием и здоровьем рабочего потока (`ScenarioWorker`, `BlockingRoutine`), но напрямую не касаются `WorkflowRuntimeFactory`.\n \nЭти тесты фокусируются на проверке правильности работы различных сценариев жизненного цикла процессов, таких как старт, остановка и проверка состояния работающих потоков.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "WorkflowRuntimeFactory" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ] -} - -## Mismatches -- none \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_140708/full_chain_plba_code_subintents_v2_plba-v2-open-file-nonexistent.json b/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_140708/full_chain_plba_code_subintents_v2_plba-v2-open-file-nonexistent.json deleted file mode 100644 index ae6e64a..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_140708/full_chain_plba_code_subintents_v2_plba-v2-open-file-nonexistent.json +++ /dev/null @@ -1,441 +0,0 @@ -{ - "case_id": "plba-v2-open-file-nonexistent", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_subintents_v2.yaml", - "runner": "runtime", - "mode": "full_chain", - "actual": { - "intent": "CODE_QA", - "sub_intent": "OPEN_FILE", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 0, - "llm_answer": "Файл src/app_runtime/core/missing_runtime.py не найден.", - "answer_mode": "degraded", - "path_scope": [ - "src/app_runtime/core/missing_runtime.py" - ], - "symbol_candidates": [], - "layers": [ - "C0_SOURCE_CHUNKS" - ] - }, - "passed": true, - "mismatches": [], - "details": { - "case_id": "plba-v2-open-file-nonexistent", - "text": "Открой файл src/app_runtime/core/missing_runtime.py", - "mode": "full_chain", - "run_started_at": "2026-03-12T14:07:09", - "rag_session_id": "7d11da21-faa0-4cea-aede-aeabe069164c", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Открой файл src/app_runtime/core/missing_runtime.py", - "symbol_resolution": { - "status": "not_requested", - "resolved_symbol": null, - "alternatives": [], - "confidence": 0.0 - }, - "rag_count": 0, - "rag_rows": [], - "llm_answer": "Файл src/app_runtime/core/missing_runtime.py не найден.", - "summary": { - "router": { - "intent": "CODE_QA", - "sub_intent": "OPEN_FILE", - "confidence": null - }, - "retrieval": { - "profile": "code", - "layers_hit": [], - "evidence_sufficient": false - }, - "llm": { - "answer_status": "degraded", - "groundedness": "weakly_grounded" - } - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "OPEN_FILE", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C0_SOURCE_CHUNKS" - ], - "symbol_kind_hint": "unknown", - "symbol_candidates": [], - "keyword_hints": [], - "path_hints": [ - "src/app_runtime/core/missing_runtime.py" - ], - "path_scope": [ - "src/app_runtime/core/missing_runtime.py" - ], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/app_runtime/core/missing_runtime.py" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": false, - "max_distance": 2, - "top_k": 5 - } - } - }, - "execution": { - "executed_layers": [ - "C0_SOURCE_CHUNKS" - ], - "retrieval_mode_by_layer": { - "C0_SOURCE_CHUNKS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C0_SOURCE_CHUNKS": 200 - }, - "filters_by_layer": { - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src/app_runtime/core/missing_runtime.py" - ], - "include_globs": [], - "exclude_globs": [], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": null, - "workspace_id": null, - "returned_repo_ids": [], - "returned_workspace_ids": [] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Открой файл src/app_runtime/core/missing_runtime.py", - "path_scope": [ - "src/app_runtime/core/missing_runtime.py" - ], - "include_globs": [], - "exclude_globs": [], - "prefer_globs": [], - "top_k": 200, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src/app_runtime/core/missing_runtime.py" - ], - "normalized_include_globs": [], - "normalized_exclude_globs": [], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 0, - "candidates_after_filter": 0 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "not_requested", - "resolved_symbol": null, - "alternatives": [] - }, - "layers": [ - { - "layer": "C0_SOURCE_CHUNKS", - "status": "miss", - "hit_count": 0, - "fail_reason": null - } - ] - }, - "constraint_violations": [ - { - "type": "PATH_SCOPE_NOT_SATISFIED", - "severity": "error", - "details": { - "path_scope": [ - "src/app_runtime/core/missing_runtime.py" - ], - "returned_paths": [] - }, - "suggested_fix": "Use exact path_scope retrieval and disable broad fallback for OPEN_FILE." - }, - { - "type": "LAYER_MISSING", - "severity": "warn", - "details": { - "layer": "C0_SOURCE_CHUNKS", - "requested_layers": [ - "C0_SOURCE_CHUNKS" - ] - }, - "suggested_fix": "Increase top_k for this layer or relax constraints for retrieval." - } - ], - "timings_ms": { - "router": 0, - "symbol_resolution": 0, - "retrieval_total": 20, - "retrieval_by_layer": { - "C0_SOURCE_CHUNKS": 19 - }, - "merge_rank": 0, - "prompt_build": 0, - "llm_call": 0 - }, - "prompt": null, - "answer_policy": { - "short_circuit": true, - "answer_mode": "degraded", - "failure_reason": "file_not_found" - }, - "router": { - "conversation_mode": "START", - "keyword_hints": [], - "path_scope": [ - "src/app_runtime/core/missing_runtime.py" - ] - }, - "llm": { - "used_evidence_count": 0, - "missing_evidence_reason": "file_not_found" - } - }, - "run_info": { - "case_id": "plba-v2-open-file-nonexistent", - "mode": "full_chain", - "run_started_at": "2026-03-12T14:07:09", - "rag_session_id": "7d11da21-faa0-4cea-aede-aeabe069164c", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - }, - "input_request": { - "text": "Открой файл src/app_runtime/core/missing_runtime.py", - "normalized_query": "Открой файл src/app_runtime/core/missing_runtime.py" - }, - "steps": [ - { - "step": "intent_router", - "input": { - "query": "Открой файл src/app_runtime/core/missing_runtime.py" - }, - "output": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Открой файл src/app_runtime/core/missing_runtime.py" - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "OPEN_FILE", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C0_SOURCE_CHUNKS" - ], - "symbol_kind_hint": "unknown", - "symbol_candidates": [], - "keyword_hints": [], - "path_hints": [ - "src/app_runtime/core/missing_runtime.py" - ], - "path_scope": [ - "src/app_runtime/core/missing_runtime.py" - ], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/app_runtime/core/missing_runtime.py" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": false, - "max_distance": 2, - "top_k": 5 - } - } - }, - "timings_ms": { - "router": 0 - } - } - }, - { - "step": "retrieval", - "input": { - "query": "Открой файл src/app_runtime/core/missing_runtime.py" - }, - "output": { - "symbol_resolution": { - "status": "not_requested", - "resolved_symbol": null, - "alternatives": [], - "confidence": 0.0 - }, - "rag_count": 0, - "rag_rows": [] - }, - "diagnostics": { - "execution": { - "executed_layers": [ - "C0_SOURCE_CHUNKS" - ], - "retrieval_mode_by_layer": { - "C0_SOURCE_CHUNKS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C0_SOURCE_CHUNKS": 200 - }, - "filters_by_layer": { - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src/app_runtime/core/missing_runtime.py" - ], - "include_globs": [], - "exclude_globs": [], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": null, - "workspace_id": null, - "returned_repo_ids": [], - "returned_workspace_ids": [] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Открой файл src/app_runtime/core/missing_runtime.py", - "path_scope": [ - "src/app_runtime/core/missing_runtime.py" - ], - "include_globs": [], - "exclude_globs": [], - "prefer_globs": [], - "top_k": 200, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src/app_runtime/core/missing_runtime.py" - ], - "normalized_include_globs": [], - "normalized_exclude_globs": [], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 0, - "candidates_after_filter": 0 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "not_requested", - "resolved_symbol": null, - "alternatives": [] - }, - "layers": [ - { - "layer": "C0_SOURCE_CHUNKS", - "status": "miss", - "hit_count": 0, - "fail_reason": null - } - ] - }, - "constraint_violations": [ - { - "type": "PATH_SCOPE_NOT_SATISFIED", - "severity": "error", - "details": { - "path_scope": [ - "src/app_runtime/core/missing_runtime.py" - ], - "returned_paths": [] - }, - "suggested_fix": "Use exact path_scope retrieval and disable broad fallback for OPEN_FILE." - }, - { - "type": "LAYER_MISSING", - "severity": "warn", - "details": { - "layer": "C0_SOURCE_CHUNKS", - "requested_layers": [ - "C0_SOURCE_CHUNKS" - ] - }, - "suggested_fix": "Increase top_k for this layer or relax constraints for retrieval." - } - ], - "timings_ms": { - "symbol_resolution": 0, - "retrieval_total": 20, - "retrieval_by_layer": { - "C0_SOURCE_CHUNKS": 19 - }, - "merge_rank": 0 - } - } - }, - { - "step": "llm_answer", - "input": { - "query": "Открой файл src/app_runtime/core/missing_runtime.py", - "rag_count": 0 - }, - "output": { - "llm_answer": "Файл src/app_runtime/core/missing_runtime.py не найден." - }, - "diagnostics": { - "prompt": null, - "timings_ms": { - "prompt_build": 0, - "llm_call": 0 - } - } - } - ] - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_140708/full_chain_plba_code_subintents_v2_plba-v2-open-file-nonexistent.md b/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_140708/full_chain_plba_code_subintents_v2_plba-v2-open-file-nonexistent.md deleted file mode 100644 index ab3d085..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_140708/full_chain_plba_code_subintents_v2_plba-v2-open-file-nonexistent.md +++ /dev/null @@ -1,30 +0,0 @@ -# plba-v2-open-file-nonexistent - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_subintents_v2.yaml -- runner: runtime -- mode: full_chain -- passed: True - -## Query -Открой файл src/app_runtime/core/missing_runtime.py - -## Actual -{ - "intent": "CODE_QA", - "sub_intent": "OPEN_FILE", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 0, - "llm_answer": "Файл src/app_runtime/core/missing_runtime.py не найден.", - "answer_mode": "degraded", - "path_scope": [ - "src/app_runtime/core/missing_runtime.py" - ], - "symbol_candidates": [], - "layers": [ - "C0_SOURCE_CHUNKS" - ] -} - -## Mismatches -- none \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_140708/full_chain_plba_code_subintents_v2_plba-v2-open-file-public-api.json b/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_140708/full_chain_plba_code_subintents_v2_plba-v2-open-file-public-api.json deleted file mode 100644 index 93e2f19..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_140708/full_chain_plba_code_subintents_v2_plba-v2-open-file-public-api.json +++ /dev/null @@ -1,492 +0,0 @@ -{ - "case_id": "plba-v2-open-file-public-api", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_subintents_v2.yaml", - "runner": "runtime", - "mode": "full_chain", - "actual": { - "intent": "CODE_QA", - "sub_intent": "OPEN_FILE", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 1, - "llm_answer": "В файле `src/plba/__init__.py` видны импортированные модули и классы из различных подпакетов библиотеки PLBA. Файл экспортирует набор основных классов и функций, используемых для конфигурации, управления состоянием приложения, работы с очередями задач, выполнения рабочих процессов и контроля их здоровья. Ответ основан исключительно на содержимом указанного файла.", - "answer_mode": "answered", - "path_scope": [ - "src/plba/__init__.py" - ], - "symbol_candidates": [], - "layers": [ - "C0_SOURCE_CHUNKS" - ] - }, - "passed": true, - "mismatches": [], - "details": { - "case_id": "plba-v2-open-file-public-api", - "text": "Открой файл src/plba/__init__.py", - "mode": "full_chain", - "run_started_at": "2026-03-12T14:07:09", - "rag_session_id": "7d11da21-faa0-4cea-aede-aeabe069164c", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Открой файл src/plba/__init__.py", - "symbol_resolution": { - "status": "not_requested", - "resolved_symbol": null, - "alternatives": [], - "confidence": 0.0 - }, - "rag_count": 1, - "rag_rows": [ - { - "path": "src/plba/__init__.py", - "content": "from plba.bootstrap import create_runtime\nfrom plba.config import ConfigFileLoader, FileConfigProvider\nfrom plba.control import ControlActionSet, ControlChannel, ControlPlaneService, HttpControlChannel\nfrom plba.contracts import (\n ApplicationModule,\n ConfigProvider,\n HealthContributor,\n TraceContext,\n TraceContextRecord,\n TraceLogMessage,\n TraceTransport,\n Worker,\n WorkerHealth,\n WorkerStatus,\n)\nfrom plba.core import ConfigurationManager, RuntimeManager, ServiceContainer\nfrom plba.health import HealthRegistry\nfrom plba.logging import LogManager\nfrom plba.queue import InMemoryTaskQueue\nfrom plba.tracing import MySqlTraceTransport, NoOpTraceTransport, TraceService\nfrom plba.workflow import (\n StepResult,\n WorkflowContext,\n WorkflowDefinition,\n WorkflowEngine,\n WorkflowEngineHooks,\n WorkflowNode,\n WorkflowRuntimeFactory,\n WorkflowStep,\n)\nfrom plba.workers import WorkerSupervisor\n\n__all__ = [\n \"ApplicationModule\",\n \"ConfigFileLoader\",\n \"ConfigProvider\",\n \"ConfigurationManager\",\n \"ControlActionSet\",\n \"ControlChannel\",\n \"ControlPlaneService\",\n \"create_runtime\",\n \"FileConfigProvider\",\n \"HealthContributor\",\n \"HealthRegistry\",\n \"HttpControlChannel\",\n \"InMemoryTaskQueue\",\n \"LogManager\",\n \"MySqlTraceTransport\",\n \"NoOpTraceTransport\",\n \"RuntimeManager\",\n \"ServiceContainer\",\n \"TraceContext\",\n \"TraceContextRecord\",\n \"TraceLogMessage\",\n \"TraceService\",\n \"TraceTransport\",\n \"StepResult\",\n \"Worker\",\n \"WorkerHealth\",\n \"WorkerStatus\",\n \"WorkflowContext\",\n \"WorkflowDefinition\",\n \"WorkflowEngine\",\n \"WorkflowEngineHooks\",\n \"WorkflowNode\",\n \"WorkflowRuntimeFactory\",\n \"WorkflowStep\",\n \"WorkerSupervisor\",\n]", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/plba/__init__.py:1-69", - "span_start": 1, - "span_end": 69, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.plba.__init__", - "is_test": false, - "blob_sha": "24e755ec8c249d14fb0e675b5dbf2b71ab91afb9c849897eebfa9feb2499e19d", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "llm_answer": "В файле `src/plba/__init__.py` видны импортированные модули и классы из различных подпакетов библиотеки PLBA. Файл экспортирует набор основных классов и функций, используемых для конфигурации, управления состоянием приложения, работы с очередями задач, выполнения рабочих процессов и контроля их здоровья. Ответ основан исключительно на содержимом указанного файла.", - "summary": { - "router": { - "intent": "CODE_QA", - "sub_intent": "OPEN_FILE", - "confidence": null - }, - "retrieval": { - "profile": "code", - "layers_hit": [ - "C0_SOURCE_CHUNKS" - ], - "evidence_sufficient": true - }, - "llm": { - "answer_status": "answered", - "groundedness": "grounded" - } - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "OPEN_FILE", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C0_SOURCE_CHUNKS" - ], - "symbol_kind_hint": "unknown", - "symbol_candidates": [], - "keyword_hints": [], - "path_hints": [ - "src/plba/__init__.py" - ], - "path_scope": [ - "src/plba/__init__.py" - ], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/plba/__init__.py" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": false, - "max_distance": 2, - "top_k": 5 - } - } - }, - "execution": { - "executed_layers": [ - "C0_SOURCE_CHUNKS" - ], - "retrieval_mode_by_layer": { - "C0_SOURCE_CHUNKS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C0_SOURCE_CHUNKS": 200 - }, - "filters_by_layer": { - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src/plba/__init__.py" - ], - "include_globs": [], - "exclude_globs": [], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Открой файл src/plba/__init__.py", - "path_scope": [ - "src/plba/__init__.py" - ], - "include_globs": [], - "exclude_globs": [], - "prefer_globs": [], - "top_k": 200, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src/plba/__init__.py" - ], - "normalized_include_globs": [], - "normalized_exclude_globs": [], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 1, - "candidates_after_filter": 1 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "not_requested", - "resolved_symbol": null, - "alternatives": [] - }, - "layers": [ - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 1, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "router": 0, - "symbol_resolution": 0, - "retrieval_total": 39, - "retrieval_by_layer": { - "C0_SOURCE_CHUNKS": 39 - }, - "merge_rank": 0, - "prompt_build": 0, - "llm_call": 715 - }, - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 612, - "evidence_rows": 1, - "evidence_chars": 1768 - }, - "evidence_summary": [ - { - "layer": "C0_SOURCE_CHUNKS", - "count": 1, - "unique_paths": 1 - } - ], - "prompt_template_id": "intent_code_qa_open_file_ru_v3", - "system_prompt_version": "v1" - }, - "router": { - "conversation_mode": "START", - "keyword_hints": [], - "path_scope": [ - "src/plba/__init__.py" - ] - }, - "llm": { - "used_evidence_count": 1, - "missing_evidence_reason": null - } - }, - "run_info": { - "case_id": "plba-v2-open-file-public-api", - "mode": "full_chain", - "run_started_at": "2026-03-12T14:07:09", - "rag_session_id": "7d11da21-faa0-4cea-aede-aeabe069164c", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - }, - "input_request": { - "text": "Открой файл src/plba/__init__.py", - "normalized_query": "Открой файл src/plba/__init__.py" - }, - "steps": [ - { - "step": "intent_router", - "input": { - "query": "Открой файл src/plba/__init__.py" - }, - "output": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Открой файл src/plba/__init__.py" - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "OPEN_FILE", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C0_SOURCE_CHUNKS" - ], - "symbol_kind_hint": "unknown", - "symbol_candidates": [], - "keyword_hints": [], - "path_hints": [ - "src/plba/__init__.py" - ], - "path_scope": [ - "src/plba/__init__.py" - ], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/plba/__init__.py" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": false, - "max_distance": 2, - "top_k": 5 - } - } - }, - "timings_ms": { - "router": 0 - } - } - }, - { - "step": "retrieval", - "input": { - "query": "Открой файл src/plba/__init__.py" - }, - "output": { - "symbol_resolution": { - "status": "not_requested", - "resolved_symbol": null, - "alternatives": [], - "confidence": 0.0 - }, - "rag_count": 1, - "rag_rows": [ - { - "path": "src/plba/__init__.py", - "content": "from plba.bootstrap import create_runtime\nfrom plba.config import ConfigFileLoader, FileConfigProvider\nfrom plba.control import ControlActionSet, ControlChannel, ControlPlaneService, HttpControlChannel\nfrom plba.contracts import (\n ApplicationModule,\n ConfigProvider,\n HealthContributor,\n TraceContext,\n TraceContextRecord,\n TraceLogMessage,\n TraceTransport,\n Worker,\n WorkerHealth,\n WorkerStatus,\n)\nfrom plba.core import ConfigurationManager, RuntimeManager, ServiceContainer\nfrom plba.health import HealthRegistry\nfrom plba.logging import LogManager\nfrom plba.queue import InMemoryTaskQueue\nfrom plba.tracing import MySqlTraceTransport, NoOpTraceTransport, TraceService\nfrom plba.workflow import (\n StepResult,\n WorkflowContext,\n WorkflowDefinition,\n WorkflowEngine,\n WorkflowEngineHooks,\n WorkflowNode,\n WorkflowRuntimeFactory,\n WorkflowStep,\n)\nfrom plba.workers import WorkerSupervisor\n\n__all__ = [\n \"ApplicationModule\",\n \"ConfigFileLoader\",\n \"ConfigProvider\",\n \"ConfigurationManager\",\n \"ControlActionSet\",\n \"ControlChannel\",\n \"ControlPlaneService\",\n \"create_runtime\",\n \"FileConfigProvider\",\n \"HealthContributor\",\n \"HealthRegistry\",\n \"HttpControlChannel\",\n \"InMemoryTaskQueue\",\n \"LogManager\",\n \"MySqlTraceTransport\",\n \"NoOpTraceTransport\",\n \"RuntimeManager\",\n \"ServiceContainer\",\n \"TraceContext\",\n \"TraceContextRecord\",\n \"TraceLogMessage\",\n \"TraceService\",\n \"TraceTransport\",\n \"StepResult\",\n \"Worker\",\n \"WorkerHealth\",\n \"WorkerStatus\",\n \"WorkflowContext\",\n \"WorkflowDefinition\",\n \"WorkflowEngine\",\n \"WorkflowEngineHooks\",\n \"WorkflowNode\",\n \"WorkflowRuntimeFactory\",\n \"WorkflowStep\",\n \"WorkerSupervisor\",\n]", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/plba/__init__.py:1-69", - "span_start": 1, - "span_end": 69, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.plba.__init__", - "is_test": false, - "blob_sha": "24e755ec8c249d14fb0e675b5dbf2b71ab91afb9c849897eebfa9feb2499e19d", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ] - }, - "diagnostics": { - "execution": { - "executed_layers": [ - "C0_SOURCE_CHUNKS" - ], - "retrieval_mode_by_layer": { - "C0_SOURCE_CHUNKS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C0_SOURCE_CHUNKS": 200 - }, - "filters_by_layer": { - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src/plba/__init__.py" - ], - "include_globs": [], - "exclude_globs": [], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Открой файл src/plba/__init__.py", - "path_scope": [ - "src/plba/__init__.py" - ], - "include_globs": [], - "exclude_globs": [], - "prefer_globs": [], - "top_k": 200, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src/plba/__init__.py" - ], - "normalized_include_globs": [], - "normalized_exclude_globs": [], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 1, - "candidates_after_filter": 1 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "not_requested", - "resolved_symbol": null, - "alternatives": [] - }, - "layers": [ - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 1, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "symbol_resolution": 0, - "retrieval_total": 39, - "retrieval_by_layer": { - "C0_SOURCE_CHUNKS": 39 - }, - "merge_rank": 0 - } - } - }, - { - "step": "llm_answer", - "input": { - "query": "Открой файл src/plba/__init__.py", - "rag_count": 1 - }, - "output": { - "llm_answer": "В файле `src/plba/__init__.py` видны импортированные модули и классы из различных подпакетов библиотеки PLBA. Файл экспортирует набор основных классов и функций, используемых для конфигурации, управления состоянием приложения, работы с очередями задач, выполнения рабочих процессов и контроля их здоровья. Ответ основан исключительно на содержимом указанного файла." - }, - "diagnostics": { - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 612, - "evidence_rows": 1, - "evidence_chars": 1768 - }, - "evidence_summary": [ - { - "layer": "C0_SOURCE_CHUNKS", - "count": 1, - "unique_paths": 1 - } - ], - "prompt_template_id": "intent_code_qa_open_file_ru_v3", - "system_prompt_version": "v1" - }, - "timings_ms": { - "prompt_build": 0, - "llm_call": 715 - } - } - } - ] - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_140708/full_chain_plba_code_subintents_v2_plba-v2-open-file-public-api.md b/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_140708/full_chain_plba_code_subintents_v2_plba-v2-open-file-public-api.md deleted file mode 100644 index ea4e309..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_140708/full_chain_plba_code_subintents_v2_plba-v2-open-file-public-api.md +++ /dev/null @@ -1,30 +0,0 @@ -# plba-v2-open-file-public-api - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_subintents_v2.yaml -- runner: runtime -- mode: full_chain -- passed: True - -## Query -Открой файл src/plba/__init__.py - -## Actual -{ - "intent": "CODE_QA", - "sub_intent": "OPEN_FILE", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 1, - "llm_answer": "В файле `src/plba/__init__.py` видны импортированные модули и классы из различных подпакетов библиотеки PLBA. Файл экспортирует набор основных классов и функций, используемых для конфигурации, управления состоянием приложения, работы с очередями задач, выполнения рабочих процессов и контроля их здоровья. Ответ основан исключительно на содержимом указанного файла.", - "answer_mode": "answered", - "path_scope": [ - "src/plba/__init__.py" - ], - "symbol_candidates": [], - "layers": [ - "C0_SOURCE_CHUNKS" - ] -} - -## Mismatches -- none \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_140708/full_chain_plba_code_subintents_v2_plba-v2-open-file-runtime.json b/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_140708/full_chain_plba_code_subintents_v2_plba-v2-open-file-runtime.json deleted file mode 100644 index 2d8db8b..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_140708/full_chain_plba_code_subintents_v2_plba-v2-open-file-runtime.json +++ /dev/null @@ -1,492 +0,0 @@ -{ - "case_id": "plba-v2-open-file-runtime", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_subintents_v2.yaml", - "runner": "runtime", - "mode": "full_chain", - "actual": { - "intent": "CODE_QA", - "sub_intent": "OPEN_FILE", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 1, - "llm_answer": "Файл src/app_runtime/core/runtime.py содержит определение класса `RuntimeManager`. В классе инициализируются параметры конфигурации, сервисы и другие компоненты системы. Видно также метод `__init__`, принимающий различные аргументы для настройки менеджера выполнения задач. Метод `_register_core_services` упоминается, но его реализация не видна в представленном фрагменте.", - "answer_mode": "answered", - "path_scope": [ - "src/app_runtime/core/runtime.py" - ], - "symbol_candidates": [], - "layers": [ - "C0_SOURCE_CHUNKS" - ] - }, - "passed": true, - "mismatches": [], - "details": { - "case_id": "plba-v2-open-file-runtime", - "text": "Открой файл src/app_runtime/core/runtime.py", - "mode": "full_chain", - "run_started_at": "2026-03-12T14:07:09", - "rag_session_id": "7d11da21-faa0-4cea-aede-aeabe069164c", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Открой файл src/app_runtime/core/runtime.py", - "symbol_resolution": { - "status": "not_requested", - "resolved_symbol": null, - "alternatives": [], - "confidence": 0.0 - }, - "rag_count": 1, - "rag_rows": [ - { - "path": "src/app_runtime/core/runtime.py", - "content": "class RuntimeManager:\n ACTION_TIMEOUT_SECONDS = 10.0\n ACTION_POLL_INTERVAL_SECONDS = 0.05\n\n def __init__(\n self,\n configuration: ConfigurationManager | None = None,\n services: ServiceContainer | None = None,\n traces: TraceService | None = None,\n health: HealthRegistry | None = None,\n logs: LogManager | None = None,\n workers: WorkerSupervisor | None = None,\n control_plane: ControlPlaneService | None = None,\n ) -> None:\n self.configuration = configuration or ConfigurationManager()\n self.services = services or ServiceContainer()\n self.traces = traces or TraceService()\n self.health = health or HealthRegistry()\n self.logs = logs or LogManager()\n self.workers = workers or WorkerSupervisor()\n self.control_plane = control_plane or ControlPlaneService()\n self.registry = ModuleRegistry(self.services)\n self._started = False\n self._state = LifecycleState.IDLE\n self._core_registered = False\n self._workers_registered = False\n self._register_core_services()\n\n def register_module(self, module: ApplicationModule) -> None:\n self.registry.register_module(module.name)\n module.register(self.registry)\n\n def add_config_file(self, path: str) -> FileConfigProvider:\n provider = FileConfigProvider(path)\n self.configuration.add_provider(provider)\n return provider\n\n def start(self, *, start_control_plane: bool = True) -> None:\n if self._started:\n return\n self._state = LifecycleState.STARTING\n config = self.configuration.load()\n self.logs.apply_config(config)\n self._register_health_contributors()\n self._register_workers()\n self.workers.start()\n if start_control_plane:\n self.control_plane.start(self)\n self._started = True\n self._refresh_state()\n\n def stop(self, timeout: float = 30.0, force: bool = False, stop_control_plane: bool = True) -> None:\n if not self._started:\n return\n self._state = LifecycleState.STOPPING\n self.workers.stop(timeout=timeout, force=force)\n if stop_control_plane:\n self.control_plane.stop()\n self._started = False\n self._state = LifecycleState.STOPPED\n\n def status(self) -> dict[str, object]:\n self._refresh_state()\n return self.control_plane.snapshot(self)\n\n def current_health(self) -> HealthPayload:\n self._refresh_state()\n return self.health.payload(self._state, self.workers.healths())\n\n async def health_status(self) -> HealthPayload:\n return self.current_health()\n\n async def start_runtime(self) -> dict[str, object] | str:\n self._refresh_state()\n if self._started:\n return \"runtime already running\"\n if self._state == LifecycleState.STOPPING:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n\n self.start(start_control_plane=False)\n started = self._wait_for_state({LifecycleState.IDLE, LifecycleState.BUSY}, timeout=self.ACTION_TIMEOUT_SECONDS)\n if started:\n return self._action_detail(\"runtime started\", timed_out=False)\n return self._action_detail(\"runtime start is still in progress\", timed_out=True)\n\n async def stop_runtime(self) -> dict[str, object] | str:\n self._refresh_state()\n if not self._started:\n if self._state == LifecycleState.STOPPING:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n return \"runtime already stopped\"\n\n self._state = LifecycleState.STOPPING\n try:\n self.workers.stop(timeout=self.ACTION_TIMEOUT_SECONDS, force=False)\n except TimeoutError:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n\n self._started = False\n self._state = LifecycleState.STOPPED\n return self._action_detail(\"runtime stopped\", timed_out=False)\n\n async def runtime_status(self) -> str:\n self._refresh_state()\n return self._state.value\n\n def _register_core_services(self) -> None:\n if self._core_registered:\n return\n self.services.register(\"configuration\", self.configuration)\n self.services.register(\"traces\", self.traces)\n self.services.register(\"health\", self.health)\n self.services.register(\"logs\", self.logs)\n self.services.register(\"workers\", self.workers)\n self.services.register(\"control_plane\", self.control_plane)\n self._core_registered = True\n\n def _register_health_contributors(self) -> None:\n for contributor in self.registry.health_contributors:\n self.health.register(contributor)\n\n def _register_workers(self) -> None:\n if self._workers_registered:\n return\n for worker in self.registry.workers:\n self.workers.register(worker)\n self._workers_registered = True\n\n def _refresh_state(self) -> None:\n lifecycle = self.workers.lifecycle_state()\n\n if self._state == LifecycleState.STOPPING:\n if lifecycle == LifecycleState.STOPPED:\n self._started = False\n self._state = LifecycleState.STOPPED\n return\n\n if not self._started:\n if lifecycle == LifecycleState.STOPPED:\n self._state = LifecycleState.STOPPED\n return\n\n self._state = lifecycle\n\n def _wait_for_state(self, target_states: set[LifecycleState], *, timeout: float) -> bool:\n deadline = monotonic() + timeout\n while monotonic() < deadline:\n self._refresh_state()\n if self._state in target_states:\n return True\n sleep(self.ACTION_POLL_INTERVAL_SECONDS)\n self._refresh_state()\n return self._state in target_states\n\n def _action_detail(self, message: str, *, timed_out: bool) -> dict[str, object]:\n self._refresh_state()\n return {\n \"message\": message,\n \"state\": self._state.value,\n \"timed_out\": timed_out,\n \"workers\": self.workers.snapshot(),\n }", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/core/runtime.py:RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.core.runtime", - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "llm_answer": "Файл src/app_runtime/core/runtime.py содержит определение класса `RuntimeManager`. В классе инициализируются параметры конфигурации, сервисы и другие компоненты системы. Видно также метод `__init__`, принимающий различные аргументы для настройки менеджера выполнения задач. Метод `_register_core_services` упоминается, но его реализация не видна в представленном фрагменте.", - "summary": { - "router": { - "intent": "CODE_QA", - "sub_intent": "OPEN_FILE", - "confidence": null - }, - "retrieval": { - "profile": "code", - "layers_hit": [ - "C0_SOURCE_CHUNKS" - ], - "evidence_sufficient": true - }, - "llm": { - "answer_status": "answered", - "groundedness": "grounded" - } - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "OPEN_FILE", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C0_SOURCE_CHUNKS" - ], - "symbol_kind_hint": "unknown", - "symbol_candidates": [], - "keyword_hints": [], - "path_hints": [ - "src/app_runtime/core/runtime.py" - ], - "path_scope": [ - "src/app_runtime/core/runtime.py" - ], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/app_runtime/core/runtime.py" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": false, - "max_distance": 2, - "top_k": 5 - } - } - }, - "execution": { - "executed_layers": [ - "C0_SOURCE_CHUNKS" - ], - "retrieval_mode_by_layer": { - "C0_SOURCE_CHUNKS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C0_SOURCE_CHUNKS": 200 - }, - "filters_by_layer": { - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src/app_runtime/core/runtime.py" - ], - "include_globs": [], - "exclude_globs": [], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Открой файл src/app_runtime/core/runtime.py", - "path_scope": [ - "src/app_runtime/core/runtime.py" - ], - "include_globs": [], - "exclude_globs": [], - "prefer_globs": [], - "top_k": 200, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src/app_runtime/core/runtime.py" - ], - "normalized_include_globs": [], - "normalized_exclude_globs": [], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 1, - "candidates_after_filter": 1 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "not_requested", - "resolved_symbol": null, - "alternatives": [] - }, - "layers": [ - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 1, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "router": 1, - "symbol_resolution": 0, - "retrieval_total": 159, - "retrieval_by_layer": { - "C0_SOURCE_CHUNKS": 159 - }, - "merge_rank": 0, - "prompt_build": 0, - "llm_call": 1029 - }, - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 623, - "evidence_rows": 1, - "evidence_chars": 6265 - }, - "evidence_summary": [ - { - "layer": "C0_SOURCE_CHUNKS", - "count": 1, - "unique_paths": 1 - } - ], - "prompt_template_id": "intent_code_qa_open_file_ru_v3", - "system_prompt_version": "v1" - }, - "router": { - "conversation_mode": "START", - "keyword_hints": [], - "path_scope": [ - "src/app_runtime/core/runtime.py" - ] - }, - "llm": { - "used_evidence_count": 1, - "missing_evidence_reason": null - } - }, - "run_info": { - "case_id": "plba-v2-open-file-runtime", - "mode": "full_chain", - "run_started_at": "2026-03-12T14:07:09", - "rag_session_id": "7d11da21-faa0-4cea-aede-aeabe069164c", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - }, - "input_request": { - "text": "Открой файл src/app_runtime/core/runtime.py", - "normalized_query": "Открой файл src/app_runtime/core/runtime.py" - }, - "steps": [ - { - "step": "intent_router", - "input": { - "query": "Открой файл src/app_runtime/core/runtime.py" - }, - "output": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Открой файл src/app_runtime/core/runtime.py" - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "OPEN_FILE", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C0_SOURCE_CHUNKS" - ], - "symbol_kind_hint": "unknown", - "symbol_candidates": [], - "keyword_hints": [], - "path_hints": [ - "src/app_runtime/core/runtime.py" - ], - "path_scope": [ - "src/app_runtime/core/runtime.py" - ], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/app_runtime/core/runtime.py" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": false, - "max_distance": 2, - "top_k": 5 - } - } - }, - "timings_ms": { - "router": 1 - } - } - }, - { - "step": "retrieval", - "input": { - "query": "Открой файл src/app_runtime/core/runtime.py" - }, - "output": { - "symbol_resolution": { - "status": "not_requested", - "resolved_symbol": null, - "alternatives": [], - "confidence": 0.0 - }, - "rag_count": 1, - "rag_rows": [ - { - "path": "src/app_runtime/core/runtime.py", - "content": "class RuntimeManager:\n ACTION_TIMEOUT_SECONDS = 10.0\n ACTION_POLL_INTERVAL_SECONDS = 0.05\n\n def __init__(\n self,\n configuration: ConfigurationManager | None = None,\n services: ServiceContainer | None = None,\n traces: TraceService | None = None,\n health: HealthRegistry | None = None,\n logs: LogManager | None = None,\n workers: WorkerSupervisor | None = None,\n control_plane: ControlPlaneService | None = None,\n ) -> None:\n self.configuration = configuration or ConfigurationManager()\n self.services = services or ServiceContainer()\n self.traces = traces or TraceService()\n self.health = health or HealthRegistry()\n self.logs = logs or LogManager()\n self.workers = workers or WorkerSupervisor()\n self.control_plane = control_plane or ControlPlaneService()\n self.registry = ModuleRegistry(self.services)\n self._started = False\n self._state = LifecycleState.IDLE\n self._core_registered = False\n self._workers_registered = False\n self._register_core_services()\n\n def register_module(self, module: ApplicationModule) -> None:\n self.registry.register_module(module.name)\n module.register(self.registry)\n\n def add_config_file(self, path: str) -> FileConfigProvider:\n provider = FileConfigProvider(path)\n self.configuration.add_provider(provider)\n return provider\n\n def start(self, *, start_control_plane: bool = True) -> None:\n if self._started:\n return\n self._state = LifecycleState.STARTING\n config = self.configuration.load()\n self.logs.apply_config(config)\n self._register_health_contributors()\n self._register_workers()\n self.workers.start()\n if start_control_plane:\n self.control_plane.start(self)\n self._started = True\n self._refresh_state()\n\n def stop(self, timeout: float = 30.0, force: bool = False, stop_control_plane: bool = True) -> None:\n if not self._started:\n return\n self._state = LifecycleState.STOPPING\n self.workers.stop(timeout=timeout, force=force)\n if stop_control_plane:\n self.control_plane.stop()\n self._started = False\n self._state = LifecycleState.STOPPED\n\n def status(self) -> dict[str, object]:\n self._refresh_state()\n return self.control_plane.snapshot(self)\n\n def current_health(self) -> HealthPayload:\n self._refresh_state()\n return self.health.payload(self._state, self.workers.healths())\n\n async def health_status(self) -> HealthPayload:\n return self.current_health()\n\n async def start_runtime(self) -> dict[str, object] | str:\n self._refresh_state()\n if self._started:\n return \"runtime already running\"\n if self._state == LifecycleState.STOPPING:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n\n self.start(start_control_plane=False)\n started = self._wait_for_state({LifecycleState.IDLE, LifecycleState.BUSY}, timeout=self.ACTION_TIMEOUT_SECONDS)\n if started:\n return self._action_detail(\"runtime started\", timed_out=False)\n return self._action_detail(\"runtime start is still in progress\", timed_out=True)\n\n async def stop_runtime(self) -> dict[str, object] | str:\n self._refresh_state()\n if not self._started:\n if self._state == LifecycleState.STOPPING:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n return \"runtime already stopped\"\n\n self._state = LifecycleState.STOPPING\n try:\n self.workers.stop(timeout=self.ACTION_TIMEOUT_SECONDS, force=False)\n except TimeoutError:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n\n self._started = False\n self._state = LifecycleState.STOPPED\n return self._action_detail(\"runtime stopped\", timed_out=False)\n\n async def runtime_status(self) -> str:\n self._refresh_state()\n return self._state.value\n\n def _register_core_services(self) -> None:\n if self._core_registered:\n return\n self.services.register(\"configuration\", self.configuration)\n self.services.register(\"traces\", self.traces)\n self.services.register(\"health\", self.health)\n self.services.register(\"logs\", self.logs)\n self.services.register(\"workers\", self.workers)\n self.services.register(\"control_plane\", self.control_plane)\n self._core_registered = True\n\n def _register_health_contributors(self) -> None:\n for contributor in self.registry.health_contributors:\n self.health.register(contributor)\n\n def _register_workers(self) -> None:\n if self._workers_registered:\n return\n for worker in self.registry.workers:\n self.workers.register(worker)\n self._workers_registered = True\n\n def _refresh_state(self) -> None:\n lifecycle = self.workers.lifecycle_state()\n\n if self._state == LifecycleState.STOPPING:\n if lifecycle == LifecycleState.STOPPED:\n self._started = False\n self._state = LifecycleState.STOPPED\n return\n\n if not self._started:\n if lifecycle == LifecycleState.STOPPED:\n self._state = LifecycleState.STOPPED\n return\n\n self._state = lifecycle\n\n def _wait_for_state(self, target_states: set[LifecycleState], *, timeout: float) -> bool:\n deadline = monotonic() + timeout\n while monotonic() < deadline:\n self._refresh_state()\n if self._state in target_states:\n return True\n sleep(self.ACTION_POLL_INTERVAL_SECONDS)\n self._refresh_state()\n return self._state in target_states\n\n def _action_detail(self, message: str, *, timed_out: bool) -> dict[str, object]:\n self._refresh_state()\n return {\n \"message\": message,\n \"state\": self._state.value,\n \"timed_out\": timed_out,\n \"workers\": self.workers.snapshot(),\n }", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/core/runtime.py:RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.core.runtime", - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ] - }, - "diagnostics": { - "execution": { - "executed_layers": [ - "C0_SOURCE_CHUNKS" - ], - "retrieval_mode_by_layer": { - "C0_SOURCE_CHUNKS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C0_SOURCE_CHUNKS": 200 - }, - "filters_by_layer": { - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src/app_runtime/core/runtime.py" - ], - "include_globs": [], - "exclude_globs": [], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Открой файл src/app_runtime/core/runtime.py", - "path_scope": [ - "src/app_runtime/core/runtime.py" - ], - "include_globs": [], - "exclude_globs": [], - "prefer_globs": [], - "top_k": 200, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src/app_runtime/core/runtime.py" - ], - "normalized_include_globs": [], - "normalized_exclude_globs": [], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 1, - "candidates_after_filter": 1 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "not_requested", - "resolved_symbol": null, - "alternatives": [] - }, - "layers": [ - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 1, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "symbol_resolution": 0, - "retrieval_total": 159, - "retrieval_by_layer": { - "C0_SOURCE_CHUNKS": 159 - }, - "merge_rank": 0 - } - } - }, - { - "step": "llm_answer", - "input": { - "query": "Открой файл src/app_runtime/core/runtime.py", - "rag_count": 1 - }, - "output": { - "llm_answer": "Файл src/app_runtime/core/runtime.py содержит определение класса `RuntimeManager`. В классе инициализируются параметры конфигурации, сервисы и другие компоненты системы. Видно также метод `__init__`, принимающий различные аргументы для настройки менеджера выполнения задач. Метод `_register_core_services` упоминается, но его реализация не видна в представленном фрагменте." - }, - "diagnostics": { - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 623, - "evidence_rows": 1, - "evidence_chars": 6265 - }, - "evidence_summary": [ - { - "layer": "C0_SOURCE_CHUNKS", - "count": 1, - "unique_paths": 1 - } - ], - "prompt_template_id": "intent_code_qa_open_file_ru_v3", - "system_prompt_version": "v1" - }, - "timings_ms": { - "prompt_build": 0, - "llm_call": 1029 - } - } - } - ] - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_140708/full_chain_plba_code_subintents_v2_plba-v2-open-file-runtime.md b/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_140708/full_chain_plba_code_subintents_v2_plba-v2-open-file-runtime.md deleted file mode 100644 index d5865ad..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_140708/full_chain_plba_code_subintents_v2_plba-v2-open-file-runtime.md +++ /dev/null @@ -1,30 +0,0 @@ -# plba-v2-open-file-runtime - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_subintents_v2.yaml -- runner: runtime -- mode: full_chain -- passed: True - -## Query -Открой файл src/app_runtime/core/runtime.py - -## Actual -{ - "intent": "CODE_QA", - "sub_intent": "OPEN_FILE", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 1, - "llm_answer": "Файл src/app_runtime/core/runtime.py содержит определение класса `RuntimeManager`. В классе инициализируются параметры конфигурации, сервисы и другие компоненты системы. Видно также метод `__init__`, принимающий различные аргументы для настройки менеджера выполнения задач. Метод `_register_core_services` упоминается, но его реализация не видна в представленном фрагменте.", - "answer_mode": "answered", - "path_scope": [ - "src/app_runtime/core/runtime.py" - ], - "symbol_candidates": [], - "layers": [ - "C0_SOURCE_CHUNKS" - ] -} - -## Mismatches -- none \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_140708/full_chain_plba_code_subintents_v2_plba-v2-trace-flow-health-endpoint.json b/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_140708/full_chain_plba_code_subintents_v2_plba-v2-trace-flow-health-endpoint.json deleted file mode 100644 index 37db7d8..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_140708/full_chain_plba_code_subintents_v2_plba-v2-trace-flow-health-endpoint.json +++ /dev/null @@ -1,3084 +0,0 @@ -{ - "case_id": "plba-v2-trace-flow-health-endpoint", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_subintents_v2.yaml", - "runner": "runtime", - "mode": "full_chain", - "actual": { - "intent": "CODE_QA", - "sub_intent": "TRACE_FLOW", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 26, - "llm_answer": "Запрос `/health` обрабатывается следующим образом:\n\n1. В методе `create` класса `HttpControlAppFactory` создаётся экземпляр приложения FastAPI с маршрутом `/health`.\n2. Обработчик маршрута `/health` определяется через декоратор `@app.get(\"/health\")`, внутри которого вызывается функция `health_provider`, переданная при создании экземпляра фабрики.\n3. Результат вызова функции `health_provider` асинхронно преобразуется в объект типа `JSONResponse`. Статус-код ответа устанавливается на основе значения поля `\"status\"` возвращаемого объекта: \n - если `\"status\"` равно `\"ok\"`, статус-код равен 200;\n - иначе — 503.\n4. Вызываемая функция возвращает результат обработки запроса в формате JSON вместе со статусом-кодом.\n\nТаким образом, весь процесс обработки запроса `/health` ограничивается исключительно реализацией предоставленной функции `health_provider`, которая должна обеспечивать получение и возврат статуса системы.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "health", - "HttpControlAppFactory" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "passed": true, - "mismatches": [], - "details": { - "case_id": "plba-v2-trace-flow-health-endpoint", - "text": "Покажи как проходит запрос /health в HttpControlAppFactory", - "mode": "full_chain", - "run_started_at": "2026-03-12T14:07:09", - "rag_session_id": "7d11da21-faa0-4cea-aede-aeabe069164c", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Покажи как проходит запрос /health в HttpControlAppFactory", - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "HttpControlAppFactory", - "alternatives": [ - "HttpControlAppFactory", - "ControlActionSet", - "HealthContributor.health", - "HealthContributor" - ], - "confidence": 0.99 - }, - "rag_count": 26, - "rag_rows": [ - { - "path": "src/app_runtime/control/http_app.py", - "content": "class HttpControlAppFactory\nHttpControlAppFactory", - "layer": "C1_SYMBOL_CATALOG", - "title": "HttpControlAppFactory", - "span_start": 15, - "span_end": 53, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "9b3502a5fb408b273223db13264349cf500de24915b6c649d9ea8970d0dfd8e0", - "qname": "HttpControlAppFactory", - "kind": "class", - "signature": "HttpControlAppFactory", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.control.http_app", - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "class ControlActionSet\nControlActionSet", - "layer": "C1_SYMBOL_CATALOG", - "title": "ControlActionSet", - "span_start": 14, - "span_end": 18, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "46eb026cb3313415ec47b82dd22f84f4d112c9d987e8b1716dcb0baa1cce8988", - "qname": "ControlActionSet", - "kind": "class", - "signature": "ControlActionSet", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.control.base", - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/contracts/health.py", - "content": "method HealthContributor.health\nhealth(self)\nReturn contributor health state.", - "layer": "C1_SYMBOL_CATALOG", - "title": "HealthContributor.health", - "span_start": 9, - "span_end": 10, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "728cff18958d8a25e2661a0f08c83d68c3bbbfa8cef212b85dc0da2b11b3dc90", - "qname": "HealthContributor.health", - "kind": "method", - "signature": "health(self)", - "parent_symbol_id": "HealthContributor", - "package_or_module": "src.app_runtime.contracts.health", - "is_test": false, - "blob_sha": "6bd92611def7131e32d4dd34a8ed85e6cf3c67722ad27797032a632cb30dc097", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/contracts/health.py", - "content": "class HealthContributor\nHealthContributor(ABC)", - "layer": "C1_SYMBOL_CATALOG", - "title": "HealthContributor", - "span_start": 7, - "span_end": 10, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "db91ae387b89a2e9d83829754f27fa18a4055b3e72d7f31789a0b8e0bf5bba0b", - "qname": "HealthContributor", - "kind": "class", - "signature": "HealthContributor(ABC)", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.contracts.health", - "is_test": false, - "blob_sha": "6bd92611def7131e32d4dd34a8ed85e6cf3c67722ad27797032a632cb30dc097", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "HttpControlAppFactory\nrole: factory\n\nResponsibilities:\n- name suffix suggests factory", - "layer": "C4_SEMANTIC_ROLES", - "title": "HttpControlAppFactory", - "span_start": 15, - "span_end": 53, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 39, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "9b3502a5fb408b273223db13264349cf500de24915b6c649d9ea8970d0dfd8e0", - "symbol_name": "HttpControlAppFactory", - "qname": "HttpControlAppFactory", - "role": "factory", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/health/registry.py", - "content": "HealthRegistry\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (2)", - "layer": "C4_SEMANTIC_ROLES", - "title": "HealthRegistry", - "span_start": 8, - "span_end": 56, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 29, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "fd3390eb0ba29c9979466b9c2117238e0da3bb829eeb4d505cb34c9c3df7a8e8", - "symbol_name": "HealthRegistry", - "qname": "HealthRegistry", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 2, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "26e6a24daa43407ba5340b74497c20153020e79f8d7828ae502aaec378dfcf75", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/types.py", - "content": "HealthPayload\nrole: model\n\nResponsibilities:\n- default model role", - "layer": "C4_SEMANTIC_ROLES", - "title": "HealthPayload", - "span_start": 7, - "span_end": 11, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 40, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "392235d63ddf752d6e419cb8528c93fe070d1bc02d3c87ba6a897baac810cf5d", - "symbol_name": "HealthPayload", - "qname": "HealthPayload", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "448a02e4a432b5ab65b246b2bd24a32a6f127b9d2091ea73b53ee3c0a2f53bb3", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/contracts/health.py", - "content": "HealthContributor\nrole: model\n\nResponsibilities:\n- default model role", - "layer": "C4_SEMANTIC_ROLES", - "title": "HealthContributor", - "span_start": 7, - "span_end": 10, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 40, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "db91ae387b89a2e9d83829754f27fa18a4055b3e72d7f31789a0b8e0bf5bba0b", - "symbol_name": "HealthContributor", - "qname": "HealthContributor", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "6bd92611def7131e32d4dd34a8ed85e6cf3c67722ad27797032a632cb30dc097", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "ControlActionSet\nrole: model\n\nResponsibilities:\n- default model role", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlActionSet", - "span_start": 14, - "span_end": 18, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 40, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "46eb026cb3313415ec47b82dd22f84f4d112c9d987e8b1716dcb0baa1cce8988", - "symbol_name": "ControlActionSet", - "qname": "ControlActionSet", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "ControlChannel\nrole: model\n\nResponsibilities:\n- default model role", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlChannel", - "span_start": 21, - "span_end": 28, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 40, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "cfcfe9a311d3a2dbdaf32ac4ccd73c0eb9a117f830591a1c0867ee97d46204ff", - "symbol_name": "ControlChannel", - "qname": "ControlChannel", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests service\n- reads and writes state attributes\n- participates in dataflow slices (5)", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlPlaneService", - "span_start": 12, - "span_end": 52, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 68, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "b13471e5916986dccffb53fab613812842965705e6b3a89ae549d30c9e91e9aa", - "symbol_name": "ControlPlaneService", - "qname": "ControlPlaneService", - "role": "pipeline_stage", - "confidence": 0.57, - "dataflow_participation": 5, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_runner.py", - "content": "UvicornThreadRunner\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (24)", - "layer": "C4_SEMANTIC_ROLES", - "title": "UvicornThreadRunner", - "span_start": 10, - "span_end": 61, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 11, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "fd55630045a02100df8877ac27d951ee08617d4598764394d48cb51fe067476a", - "symbol_name": "UvicornThreadRunner", - "qname": "UvicornThreadRunner", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 24, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "3779fdd2878b770e789a35bb2a89c9d79f13b61c26d7db1b3b683f9bb9e1623f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/health/registry.py", - "content": "HealthRegistry.__init__\n -> HealthRegistry._contributors\n -> HealthRegistry.register", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "HealthRegistry.__init__:dataflow_slice", - "span_start": 10, - "span_end": 13, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "2381dfb339d541367c3251d2a610cac9d8b3f6bd6a352e119d00a93c5ccc2b7d", - "edge_type": "dataflow_slice", - "src_symbol_id": "e8ffd58441c231de43d9e86c31eb12303d4e2bf045b2acf13d1dfe78da01f8dc", - "src_qname": "HealthRegistry.__init__", - "dst_symbol_id": "a9e1f290c346c8bb1d67af0cafeebb5bcaf29c3ed7027e33c794532743df38f2", - "dst_ref": "HealthRegistry.register", - "resolution": "resolved", - "slice_id": "2381dfb339d541367c3251d2a610cac9d8b3f6bd6a352e119d00a93c5ccc2b7d", - "root_symbol_id": "e8ffd58441c231de43d9e86c31eb12303d4e2bf045b2acf13d1dfe78da01f8dc", - "path_symbols": [ - "HealthRegistry.__init__", - "HealthRegistry._contributors", - "HealthRegistry.register" - ], - "path_symbol_ids": [ - "e8ffd58441c231de43d9e86c31eb12303d4e2bf045b2acf13d1dfe78da01f8dc", - "a9e1f290c346c8bb1d67af0cafeebb5bcaf29c3ed7027e33c794532743df38f2" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "26e6a24daa43407ba5340b74497c20153020e79f8d7828ae502aaec378dfcf75", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.start", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 20, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154", - "dst_ref": "ControlPlaneService.start", - "resolution": "resolved", - "slice_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.start" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.stop", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 25, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d", - "dst_ref": "ControlPlaneService.stop", - "resolution": "resolved", - "slice_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.stop" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._stop_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 51, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a", - "dst_ref": "ControlPlaneService._stop_async", - "resolution": "resolved", - "slice_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._stop_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/health/registry.py", - "content": "HealthRegistry.__init__\n -> HealthRegistry._contributors\n -> HealthRegistry.contributor_healths", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "HealthRegistry.__init__:dataflow_slice", - "span_start": 10, - "span_end": 16, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "d3a88a7abf16359e903e809ffc24473658fdd8198f60641fe1584fc4ac663c31", - "edge_type": "dataflow_slice", - "src_symbol_id": "e8ffd58441c231de43d9e86c31eb12303d4e2bf045b2acf13d1dfe78da01f8dc", - "src_qname": "HealthRegistry.__init__", - "dst_symbol_id": "fa7bbd8f4b64a55a5088640c30f52e84075d65f531bd7e1f6c1d7bb8d24fcbf2", - "dst_ref": "HealthRegistry.contributor_healths", - "resolution": "resolved", - "slice_id": "d3a88a7abf16359e903e809ffc24473658fdd8198f60641fe1584fc4ac663c31", - "root_symbol_id": "e8ffd58441c231de43d9e86c31eb12303d4e2bf045b2acf13d1dfe78da01f8dc", - "path_symbols": [ - "HealthRegistry.__init__", - "HealthRegistry._contributors", - "HealthRegistry.contributor_healths" - ], - "path_symbol_ids": [ - "e8ffd58441c231de43d9e86c31eb12303d4e2bf045b2acf13d1dfe78da01f8dc", - "fa7bbd8f4b64a55a5088640c30f52e84075d65f531bd7e1f6c1d7bb8d24fcbf2" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "26e6a24daa43407ba5340b74497c20153020e79f8d7828ae502aaec378dfcf75", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._start_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 47, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517", - "dst_ref": "ControlPlaneService._start_async", - "resolution": "resolved", - "slice_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._start_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.register_channel", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 17, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957", - "dst_ref": "ControlPlaneService.register_channel", - "resolution": "resolved", - "slice_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.register_channel" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "HttpControlAppFactory.create calls time.monotonic", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "HttpControlAppFactory.create:calls", - "span_start": 25, - "span_end": 25, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "3fdd0a88d10225ee74f3b84ab57e13f09f5ccc72f00e31af9ae4655411c289c0", - "edge_type": "calls", - "src_symbol_id": "4af42c2a9275d652e710a98ec48b8247236b4453a093629f8958704ff6d3cb58", - "src_qname": "HttpControlAppFactory.create", - "dst_symbol_id": null, - "dst_ref": "time.monotonic", - "resolution": "partial", - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "HttpControlAppFactory.create calls app.post", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "HttpControlAppFactory.create:calls", - "span_start": 37, - "span_end": 37, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "0e545d4b5187db7bec5ceac03071d2ad68177550c42af748fee364639e533c90", - "edge_type": "calls", - "src_symbol_id": "4af42c2a9275d652e710a98ec48b8247236b4453a093629f8958704ff6d3cb58", - "src_qname": "HttpControlAppFactory.create", - "dst_symbol_id": null, - "dst_ref": "app.post", - "resolution": "partial", - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "HttpControlAppFactory.create calls str", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "HttpControlAppFactory.create:calls", - "span_start": 27, - "span_end": 27, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "2a87c51461e31cd556508cc37fdff37b4d24c26f7f1604db30af5e8f1bda96cb", - "edge_type": "calls", - "src_symbol_id": "4af42c2a9275d652e710a98ec48b8247236b4453a093629f8958704ff6d3cb58", - "src_qname": "HttpControlAppFactory.create", - "dst_symbol_id": null, - "dst_ref": "str", - "resolution": "partial", - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "class HttpControlAppFactory:\n def create(\n self,\n health_provider: Callable[[], Awaitable[HealthPayload]],\n action_provider: Callable[[str, str], Awaitable[JSONResponse]],\n ) -> FastAPI:\n app = FastAPI(title=\"PLBA Control API\")\n\n @app.middleware(\"http\")\n async def log_api_call(request: Request, call_next): # type: ignore[no-untyped-def]\n started = time.monotonic()\n response = await call_next(request)\n response.headers[\"X-Response-Time-Ms\"] = str(int((time.monotonic() - started) * 1000))\n return response\n\n @app.get(\"/health\")\n async def health() -> JSONResponse:\n payload = await health_provider()\n status_code = 200 if payload.get(\"status\") == \"ok\" else 503\n return JSONResponse(content=payload, status_code=status_code)\n\n @app.get(\"/actions/{action}\")\n @app.post(\"/actions/{action}\")\n async def action(action: str, request: Request) -> JSONResponse:\n client_source = self._client_source(request)\n if action in {\"start\", \"stop\"}:\n LOGGER.warning(\"Control action requested: /actions/%s client=%s\", action, client_source)\n return await action_provider(action, client_source)\n\n return app\n\n def _client_source(self, request: Request) -> str:\n explicit_header = request.headers.get(\"X-Client-Source\", \"\").strip()\n if explicit_header:\n return explicit_header\n user_agent = request.headers.get(\"User-Agent\", \"\").strip()\n if user_agent:\n return f\"user-agent:{user_agent}\"\n return \"unknown\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/http_app.py:HttpControlAppFactory", - "span_start": 15, - "span_end": 53, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.http_app", - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "llm_answer": "Запрос `/health` обрабатывается следующим образом:\n\n1. В методе `create` класса `HttpControlAppFactory` создаётся экземпляр приложения FastAPI с маршрутом `/health`.\n2. Обработчик маршрута `/health` определяется через декоратор `@app.get(\"/health\")`, внутри которого вызывается функция `health_provider`, переданная при создании экземпляра фабрики.\n3. Результат вызова функции `health_provider` асинхронно преобразуется в объект типа `JSONResponse`. Статус-код ответа устанавливается на основе значения поля `\"status\"` возвращаемого объекта: \n - если `\"status\"` равно `\"ok\"`, статус-код равен 200;\n - иначе — 503.\n4. Вызываемая функция возвращает результат обработки запроса в формате JSON вместе со статусом-кодом.\n\nТаким образом, весь процесс обработки запроса `/health` ограничивается исключительно реализацией предоставленной функции `health_provider`, которая должна обеспечивать получение и возврат статуса системы.", - "summary": { - "router": { - "intent": "CODE_QA", - "sub_intent": "TRACE_FLOW", - "confidence": null - }, - "retrieval": { - "profile": "code", - "layers_hit": [ - "C0_SOURCE_CHUNKS", - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS", - "C4_SEMANTIC_ROLES" - ], - "evidence_sufficient": true - }, - "llm": { - "answer_status": "answered", - "groundedness": "grounded" - } - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "TRACE_FLOW", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "symbol_kind_hint": "unknown", - "symbol_candidates": [ - "health", - "HttpControlAppFactory" - ], - "keyword_hints": [ - "health", - "HttpControlAppFactory" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C0_SOURCE_CHUNKS": "exact_path_fetch", - "C4_SEMANTIC_ROLES": "exact_path_fetch", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C3_ENTRYPOINTS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 8, - "C4_SEMANTIC_ROLES": 8, - "C2_DEPENDENCY_GRAPH": 10, - "C3_ENTRYPOINTS": 10 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C4_SEMANTIC_ROLES": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "health HttpControlAppFactory", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Покажи как проходит запрос /health в HttpControlAppFactory", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C4_SEMANTIC_ROLES", - "query": "Покажи как проходит запрос /health в HttpControlAppFactory", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "Покажи как проходит запрос /health в HttpControlAppFactory", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 10, - "ranking_profile": "code" - }, - { - "layer": "C3_ENTRYPOINTS", - "query": "Покажи как проходит запрос /health в HttpControlAppFactory", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 10, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 4, - "candidates_after_filter": 4 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 10, - "candidates_after_filter": 10 - }, - { - "layer": "C3_ENTRYPOINTS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 3, - "candidates_after_filter": 3 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "HttpControlAppFactory", - "alternatives": [ - "HttpControlAppFactory", - "ControlActionSet", - "HealthContributor.health", - "HealthContributor" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "hit", - "hit_count": 4, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C4_SEMANTIC_ROLES", - "status": "hit", - "hit_count": 8, - "fail_reason": null - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 10, - "fail_reason": null - }, - { - "layer": "C3_ENTRYPOINTS", - "status": "hit", - "hit_count": 3, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "router": 1, - "symbol_resolution": 0, - "retrieval_total": 178, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 62, - "C0_SOURCE_CHUNKS": 23, - "C4_SEMANTIC_ROLES": 20, - "C2_DEPENDENCY_GRAPH": 57, - "C3_ENTRYPOINTS": 15 - }, - "merge_rank": 59, - "prompt_build": 0, - "llm_call": 1646 - }, - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 794, - "evidence_rows": 26, - "evidence_chars": 3507 - }, - "evidence_summary": [ - { - "layer": "C1_SYMBOL_CATALOG", - "count": 4, - "unique_paths": 3 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "count": 8, - "unique_paths": 7 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "count": 10, - "unique_paths": 3 - }, - { - "layer": "C3_ENTRYPOINTS", - "count": 3, - "unique_paths": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 1, - "unique_paths": 1 - } - ], - "prompt_template_id": "intent_code_qa_trace_flow_ru_v3", - "system_prompt_version": "v1" - }, - "router": { - "conversation_mode": "START", - "keyword_hints": [ - "health", - "HttpControlAppFactory" - ], - "path_scope": [] - }, - "llm": { - "used_evidence_count": 26, - "missing_evidence_reason": null - } - }, - "run_info": { - "case_id": "plba-v2-trace-flow-health-endpoint", - "mode": "full_chain", - "run_started_at": "2026-03-12T14:07:09", - "rag_session_id": "7d11da21-faa0-4cea-aede-aeabe069164c", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - }, - "input_request": { - "text": "Покажи как проходит запрос /health в HttpControlAppFactory", - "normalized_query": "Покажи как проходит запрос /health в HttpControlAppFactory" - }, - "steps": [ - { - "step": "intent_router", - "input": { - "query": "Покажи как проходит запрос /health в HttpControlAppFactory" - }, - "output": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Покажи как проходит запрос /health в HttpControlAppFactory" - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "TRACE_FLOW", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "symbol_kind_hint": "unknown", - "symbol_candidates": [ - "health", - "HttpControlAppFactory" - ], - "keyword_hints": [ - "health", - "HttpControlAppFactory" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "timings_ms": { - "router": 1 - } - } - }, - { - "step": "retrieval", - "input": { - "query": "Покажи как проходит запрос /health в HttpControlAppFactory" - }, - "output": { - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "HttpControlAppFactory", - "alternatives": [ - "HttpControlAppFactory", - "ControlActionSet", - "HealthContributor.health", - "HealthContributor" - ], - "confidence": 0.99 - }, - "rag_count": 26, - "rag_rows": [ - { - "path": "src/app_runtime/control/http_app.py", - "content": "class HttpControlAppFactory\nHttpControlAppFactory", - "layer": "C1_SYMBOL_CATALOG", - "title": "HttpControlAppFactory", - "span_start": 15, - "span_end": 53, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "9b3502a5fb408b273223db13264349cf500de24915b6c649d9ea8970d0dfd8e0", - "qname": "HttpControlAppFactory", - "kind": "class", - "signature": "HttpControlAppFactory", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.control.http_app", - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "class ControlActionSet\nControlActionSet", - "layer": "C1_SYMBOL_CATALOG", - "title": "ControlActionSet", - "span_start": 14, - "span_end": 18, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "46eb026cb3313415ec47b82dd22f84f4d112c9d987e8b1716dcb0baa1cce8988", - "qname": "ControlActionSet", - "kind": "class", - "signature": "ControlActionSet", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.control.base", - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/contracts/health.py", - "content": "method HealthContributor.health\nhealth(self)\nReturn contributor health state.", - "layer": "C1_SYMBOL_CATALOG", - "title": "HealthContributor.health", - "span_start": 9, - "span_end": 10, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "728cff18958d8a25e2661a0f08c83d68c3bbbfa8cef212b85dc0da2b11b3dc90", - "qname": "HealthContributor.health", - "kind": "method", - "signature": "health(self)", - "parent_symbol_id": "HealthContributor", - "package_or_module": "src.app_runtime.contracts.health", - "is_test": false, - "blob_sha": "6bd92611def7131e32d4dd34a8ed85e6cf3c67722ad27797032a632cb30dc097", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/contracts/health.py", - "content": "class HealthContributor\nHealthContributor(ABC)", - "layer": "C1_SYMBOL_CATALOG", - "title": "HealthContributor", - "span_start": 7, - "span_end": 10, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "db91ae387b89a2e9d83829754f27fa18a4055b3e72d7f31789a0b8e0bf5bba0b", - "qname": "HealthContributor", - "kind": "class", - "signature": "HealthContributor(ABC)", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.contracts.health", - "is_test": false, - "blob_sha": "6bd92611def7131e32d4dd34a8ed85e6cf3c67722ad27797032a632cb30dc097", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "HttpControlAppFactory\nrole: factory\n\nResponsibilities:\n- name suffix suggests factory", - "layer": "C4_SEMANTIC_ROLES", - "title": "HttpControlAppFactory", - "span_start": 15, - "span_end": 53, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 39, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "9b3502a5fb408b273223db13264349cf500de24915b6c649d9ea8970d0dfd8e0", - "symbol_name": "HttpControlAppFactory", - "qname": "HttpControlAppFactory", - "role": "factory", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/health/registry.py", - "content": "HealthRegistry\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (2)", - "layer": "C4_SEMANTIC_ROLES", - "title": "HealthRegistry", - "span_start": 8, - "span_end": 56, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 29, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "fd3390eb0ba29c9979466b9c2117238e0da3bb829eeb4d505cb34c9c3df7a8e8", - "symbol_name": "HealthRegistry", - "qname": "HealthRegistry", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 2, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "26e6a24daa43407ba5340b74497c20153020e79f8d7828ae502aaec378dfcf75", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/types.py", - "content": "HealthPayload\nrole: model\n\nResponsibilities:\n- default model role", - "layer": "C4_SEMANTIC_ROLES", - "title": "HealthPayload", - "span_start": 7, - "span_end": 11, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 40, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "392235d63ddf752d6e419cb8528c93fe070d1bc02d3c87ba6a897baac810cf5d", - "symbol_name": "HealthPayload", - "qname": "HealthPayload", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "448a02e4a432b5ab65b246b2bd24a32a6f127b9d2091ea73b53ee3c0a2f53bb3", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/contracts/health.py", - "content": "HealthContributor\nrole: model\n\nResponsibilities:\n- default model role", - "layer": "C4_SEMANTIC_ROLES", - "title": "HealthContributor", - "span_start": 7, - "span_end": 10, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 40, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "db91ae387b89a2e9d83829754f27fa18a4055b3e72d7f31789a0b8e0bf5bba0b", - "symbol_name": "HealthContributor", - "qname": "HealthContributor", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "6bd92611def7131e32d4dd34a8ed85e6cf3c67722ad27797032a632cb30dc097", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "ControlActionSet\nrole: model\n\nResponsibilities:\n- default model role", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlActionSet", - "span_start": 14, - "span_end": 18, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 40, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "46eb026cb3313415ec47b82dd22f84f4d112c9d987e8b1716dcb0baa1cce8988", - "symbol_name": "ControlActionSet", - "qname": "ControlActionSet", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "ControlChannel\nrole: model\n\nResponsibilities:\n- default model role", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlChannel", - "span_start": 21, - "span_end": 28, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 40, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "cfcfe9a311d3a2dbdaf32ac4ccd73c0eb9a117f830591a1c0867ee97d46204ff", - "symbol_name": "ControlChannel", - "qname": "ControlChannel", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests service\n- reads and writes state attributes\n- participates in dataflow slices (5)", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlPlaneService", - "span_start": 12, - "span_end": 52, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 68, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "b13471e5916986dccffb53fab613812842965705e6b3a89ae549d30c9e91e9aa", - "symbol_name": "ControlPlaneService", - "qname": "ControlPlaneService", - "role": "pipeline_stage", - "confidence": 0.57, - "dataflow_participation": 5, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_runner.py", - "content": "UvicornThreadRunner\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (24)", - "layer": "C4_SEMANTIC_ROLES", - "title": "UvicornThreadRunner", - "span_start": 10, - "span_end": 61, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 11, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "fd55630045a02100df8877ac27d951ee08617d4598764394d48cb51fe067476a", - "symbol_name": "UvicornThreadRunner", - "qname": "UvicornThreadRunner", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 24, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "3779fdd2878b770e789a35bb2a89c9d79f13b61c26d7db1b3b683f9bb9e1623f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/health/registry.py", - "content": "HealthRegistry.__init__\n -> HealthRegistry._contributors\n -> HealthRegistry.register", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "HealthRegistry.__init__:dataflow_slice", - "span_start": 10, - "span_end": 13, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "2381dfb339d541367c3251d2a610cac9d8b3f6bd6a352e119d00a93c5ccc2b7d", - "edge_type": "dataflow_slice", - "src_symbol_id": "e8ffd58441c231de43d9e86c31eb12303d4e2bf045b2acf13d1dfe78da01f8dc", - "src_qname": "HealthRegistry.__init__", - "dst_symbol_id": "a9e1f290c346c8bb1d67af0cafeebb5bcaf29c3ed7027e33c794532743df38f2", - "dst_ref": "HealthRegistry.register", - "resolution": "resolved", - "slice_id": "2381dfb339d541367c3251d2a610cac9d8b3f6bd6a352e119d00a93c5ccc2b7d", - "root_symbol_id": "e8ffd58441c231de43d9e86c31eb12303d4e2bf045b2acf13d1dfe78da01f8dc", - "path_symbols": [ - "HealthRegistry.__init__", - "HealthRegistry._contributors", - "HealthRegistry.register" - ], - "path_symbol_ids": [ - "e8ffd58441c231de43d9e86c31eb12303d4e2bf045b2acf13d1dfe78da01f8dc", - "a9e1f290c346c8bb1d67af0cafeebb5bcaf29c3ed7027e33c794532743df38f2" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "26e6a24daa43407ba5340b74497c20153020e79f8d7828ae502aaec378dfcf75", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.start", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 20, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154", - "dst_ref": "ControlPlaneService.start", - "resolution": "resolved", - "slice_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.start" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.stop", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 25, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d", - "dst_ref": "ControlPlaneService.stop", - "resolution": "resolved", - "slice_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.stop" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._stop_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 51, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a", - "dst_ref": "ControlPlaneService._stop_async", - "resolution": "resolved", - "slice_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._stop_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/health/registry.py", - "content": "HealthRegistry.__init__\n -> HealthRegistry._contributors\n -> HealthRegistry.contributor_healths", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "HealthRegistry.__init__:dataflow_slice", - "span_start": 10, - "span_end": 16, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "d3a88a7abf16359e903e809ffc24473658fdd8198f60641fe1584fc4ac663c31", - "edge_type": "dataflow_slice", - "src_symbol_id": "e8ffd58441c231de43d9e86c31eb12303d4e2bf045b2acf13d1dfe78da01f8dc", - "src_qname": "HealthRegistry.__init__", - "dst_symbol_id": "fa7bbd8f4b64a55a5088640c30f52e84075d65f531bd7e1f6c1d7bb8d24fcbf2", - "dst_ref": "HealthRegistry.contributor_healths", - "resolution": "resolved", - "slice_id": "d3a88a7abf16359e903e809ffc24473658fdd8198f60641fe1584fc4ac663c31", - "root_symbol_id": "e8ffd58441c231de43d9e86c31eb12303d4e2bf045b2acf13d1dfe78da01f8dc", - "path_symbols": [ - "HealthRegistry.__init__", - "HealthRegistry._contributors", - "HealthRegistry.contributor_healths" - ], - "path_symbol_ids": [ - "e8ffd58441c231de43d9e86c31eb12303d4e2bf045b2acf13d1dfe78da01f8dc", - "fa7bbd8f4b64a55a5088640c30f52e84075d65f531bd7e1f6c1d7bb8d24fcbf2" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "26e6a24daa43407ba5340b74497c20153020e79f8d7828ae502aaec378dfcf75", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._start_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 47, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517", - "dst_ref": "ControlPlaneService._start_async", - "resolution": "resolved", - "slice_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._start_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.register_channel", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 17, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957", - "dst_ref": "ControlPlaneService.register_channel", - "resolution": "resolved", - "slice_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.register_channel" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "HttpControlAppFactory.create calls time.monotonic", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "HttpControlAppFactory.create:calls", - "span_start": 25, - "span_end": 25, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "3fdd0a88d10225ee74f3b84ab57e13f09f5ccc72f00e31af9ae4655411c289c0", - "edge_type": "calls", - "src_symbol_id": "4af42c2a9275d652e710a98ec48b8247236b4453a093629f8958704ff6d3cb58", - "src_qname": "HttpControlAppFactory.create", - "dst_symbol_id": null, - "dst_ref": "time.monotonic", - "resolution": "partial", - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "HttpControlAppFactory.create calls app.post", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "HttpControlAppFactory.create:calls", - "span_start": 37, - "span_end": 37, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "0e545d4b5187db7bec5ceac03071d2ad68177550c42af748fee364639e533c90", - "edge_type": "calls", - "src_symbol_id": "4af42c2a9275d652e710a98ec48b8247236b4453a093629f8958704ff6d3cb58", - "src_qname": "HttpControlAppFactory.create", - "dst_symbol_id": null, - "dst_ref": "app.post", - "resolution": "partial", - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "HttpControlAppFactory.create calls str", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "HttpControlAppFactory.create:calls", - "span_start": 27, - "span_end": 27, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "2a87c51461e31cd556508cc37fdff37b4d24c26f7f1604db30af5e8f1bda96cb", - "edge_type": "calls", - "src_symbol_id": "4af42c2a9275d652e710a98ec48b8247236b4453a093629f8958704ff6d3cb58", - "src_qname": "HttpControlAppFactory.create", - "dst_symbol_id": null, - "dst_ref": "str", - "resolution": "partial", - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "class HttpControlAppFactory:\n def create(\n self,\n health_provider: Callable[[], Awaitable[HealthPayload]],\n action_provider: Callable[[str, str], Awaitable[JSONResponse]],\n ) -> FastAPI:\n app = FastAPI(title=\"PLBA Control API\")\n\n @app.middleware(\"http\")\n async def log_api_call(request: Request, call_next): # type: ignore[no-untyped-def]\n started = time.monotonic()\n response = await call_next(request)\n response.headers[\"X-Response-Time-Ms\"] = str(int((time.monotonic() - started) * 1000))\n return response\n\n @app.get(\"/health\")\n async def health() -> JSONResponse:\n payload = await health_provider()\n status_code = 200 if payload.get(\"status\") == \"ok\" else 503\n return JSONResponse(content=payload, status_code=status_code)\n\n @app.get(\"/actions/{action}\")\n @app.post(\"/actions/{action}\")\n async def action(action: str, request: Request) -> JSONResponse:\n client_source = self._client_source(request)\n if action in {\"start\", \"stop\"}:\n LOGGER.warning(\"Control action requested: /actions/%s client=%s\", action, client_source)\n return await action_provider(action, client_source)\n\n return app\n\n def _client_source(self, request: Request) -> str:\n explicit_header = request.headers.get(\"X-Client-Source\", \"\").strip()\n if explicit_header:\n return explicit_header\n user_agent = request.headers.get(\"User-Agent\", \"\").strip()\n if user_agent:\n return f\"user-agent:{user_agent}\"\n return \"unknown\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/http_app.py:HttpControlAppFactory", - "span_start": 15, - "span_end": 53, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.http_app", - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ] - }, - "diagnostics": { - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C0_SOURCE_CHUNKS": "exact_path_fetch", - "C4_SEMANTIC_ROLES": "exact_path_fetch", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C3_ENTRYPOINTS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 8, - "C4_SEMANTIC_ROLES": 8, - "C2_DEPENDENCY_GRAPH": 10, - "C3_ENTRYPOINTS": 10 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C4_SEMANTIC_ROLES": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "health HttpControlAppFactory", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Покажи как проходит запрос /health в HttpControlAppFactory", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C4_SEMANTIC_ROLES", - "query": "Покажи как проходит запрос /health в HttpControlAppFactory", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "Покажи как проходит запрос /health в HttpControlAppFactory", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 10, - "ranking_profile": "code" - }, - { - "layer": "C3_ENTRYPOINTS", - "query": "Покажи как проходит запрос /health в HttpControlAppFactory", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 10, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 4, - "candidates_after_filter": 4 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 10, - "candidates_after_filter": 10 - }, - { - "layer": "C3_ENTRYPOINTS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 3, - "candidates_after_filter": 3 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "HttpControlAppFactory", - "alternatives": [ - "HttpControlAppFactory", - "ControlActionSet", - "HealthContributor.health", - "HealthContributor" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "hit", - "hit_count": 4, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C4_SEMANTIC_ROLES", - "status": "hit", - "hit_count": 8, - "fail_reason": null - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 10, - "fail_reason": null - }, - { - "layer": "C3_ENTRYPOINTS", - "status": "hit", - "hit_count": 3, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "symbol_resolution": 0, - "retrieval_total": 178, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 62, - "C0_SOURCE_CHUNKS": 23, - "C4_SEMANTIC_ROLES": 20, - "C2_DEPENDENCY_GRAPH": 57, - "C3_ENTRYPOINTS": 15 - }, - "merge_rank": 59 - } - } - }, - { - "step": "llm_answer", - "input": { - "query": "Покажи как проходит запрос /health в HttpControlAppFactory", - "rag_count": 26 - }, - "output": { - "llm_answer": "Запрос `/health` обрабатывается следующим образом:\n\n1. В методе `create` класса `HttpControlAppFactory` создаётся экземпляр приложения FastAPI с маршрутом `/health`.\n2. Обработчик маршрута `/health` определяется через декоратор `@app.get(\"/health\")`, внутри которого вызывается функция `health_provider`, переданная при создании экземпляра фабрики.\n3. Результат вызова функции `health_provider` асинхронно преобразуется в объект типа `JSONResponse`. Статус-код ответа устанавливается на основе значения поля `\"status\"` возвращаемого объекта: \n - если `\"status\"` равно `\"ok\"`, статус-код равен 200;\n - иначе — 503.\n4. Вызываемая функция возвращает результат обработки запроса в формате JSON вместе со статусом-кодом.\n\nТаким образом, весь процесс обработки запроса `/health` ограничивается исключительно реализацией предоставленной функции `health_provider`, которая должна обеспечивать получение и возврат статуса системы." - }, - "diagnostics": { - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 794, - "evidence_rows": 26, - "evidence_chars": 3507 - }, - "evidence_summary": [ - { - "layer": "C1_SYMBOL_CATALOG", - "count": 4, - "unique_paths": 3 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "count": 8, - "unique_paths": 7 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "count": 10, - "unique_paths": 3 - }, - { - "layer": "C3_ENTRYPOINTS", - "count": 3, - "unique_paths": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 1, - "unique_paths": 1 - } - ], - "prompt_template_id": "intent_code_qa_trace_flow_ru_v3", - "system_prompt_version": "v1" - }, - "timings_ms": { - "prompt_build": 0, - "llm_call": 1646 - } - } - } - ] - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_140708/full_chain_plba_code_subintents_v2_plba-v2-trace-flow-health-endpoint.md b/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_140708/full_chain_plba_code_subintents_v2_plba-v2-trace-flow-health-endpoint.md deleted file mode 100644 index a2d231f..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_140708/full_chain_plba_code_subintents_v2_plba-v2-trace-flow-health-endpoint.md +++ /dev/null @@ -1,35 +0,0 @@ -# plba-v2-trace-flow-health-endpoint - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_subintents_v2.yaml -- runner: runtime -- mode: full_chain -- passed: True - -## Query -Покажи как проходит запрос /health в HttpControlAppFactory - -## Actual -{ - "intent": "CODE_QA", - "sub_intent": "TRACE_FLOW", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 26, - "llm_answer": "Запрос `/health` обрабатывается следующим образом:\n\n1. В методе `create` класса `HttpControlAppFactory` создаётся экземпляр приложения FastAPI с маршрутом `/health`.\n2. Обработчик маршрута `/health` определяется через декоратор `@app.get(\"/health\")`, внутри которого вызывается функция `health_provider`, переданная при создании экземпляра фабрики.\n3. Результат вызова функции `health_provider` асинхронно преобразуется в объект типа `JSONResponse`. Статус-код ответа устанавливается на основе значения поля `\"status\"` возвращаемого объекта: \n - если `\"status\"` равно `\"ok\"`, статус-код равен 200;\n - иначе — 503.\n4. Вызываемая функция возвращает результат обработки запроса в формате JSON вместе со статусом-кодом.\n\nТаким образом, весь процесс обработки запроса `/health` ограничивается исключительно реализацией предоставленной функции `health_provider`, которая должна обеспечивать получение и возврат статуса системы.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "health", - "HttpControlAppFactory" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] -} - -## Mismatches -- none \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_140708/full_chain_plba_code_subintents_v2_plba-v2-trace-flow-runtime-start.json b/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_140708/full_chain_plba_code_subintents_v2_plba-v2-trace-flow-runtime-start.json deleted file mode 100644 index a76bff8..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_140708/full_chain_plba_code_subintents_v2_plba-v2-trace-flow-runtime-start.json +++ /dev/null @@ -1,2964 +0,0 @@ -{ - "case_id": "plba-v2-trace-flow-runtime-start", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_subintents_v2.yaml", - "runner": "runtime", - "mode": "full_chain", - "actual": { - "intent": "CODE_QA", - "sub_intent": "TRACE_FLOW", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 23, - "llm_answer": "При запуске объекта `RuntimeManager` происходит следующее:\n\n1. В методе `__init__` выполняется инициализация основных атрибутов класса:\n - Создаются объекты конфигурации (`configuration`), сервисов (`services`), трассировки (`traces`), мониторинга здоровья (`health`), логирования (`logs`) и управления рабочими процессами (`workers`).\n - При необходимости передаются параметры-конструкторы через аргументы метода.\n \n2. Далее вызывается приватный метод `_register_core_services`, предназначенный для регистрации базовых модулей системы, таких как регистрация модуля обработки («registry»).\n\nТаким образом, после создания экземпляра `RuntimeManager` объект конфигурируется с необходимыми сервисами и модулями, а затем начинает свою работу по управлению основными компонентами приложения. Однако сам механизм запуска методов и дальнейшей логики не показан напрямую в предоставленных артефактах.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "RuntimeManager" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "passed": true, - "mismatches": [], - "details": { - "case_id": "plba-v2-trace-flow-runtime-start", - "text": "Покажи поток выполнения при запуске RuntimeManager", - "mode": "full_chain", - "run_started_at": "2026-03-12T14:07:09", - "rag_session_id": "7d11da21-faa0-4cea-aede-aeabe069164c", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Покажи поток выполнения при запуске RuntimeManager", - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "RuntimeManager", - "alternatives": [ - "RuntimeManager" - ], - "confidence": 0.99 - }, - "rag_count": 23, - "rag_rows": [ - { - "path": "src/app_runtime/core/runtime.py", - "content": "class RuntimeManager\nRuntimeManager", - "layer": "C1_SYMBOL_CATALOG", - "title": "RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "7e4a9381328c5803bbc6179458612fc4e947d928aa7bf8b4b2bebb2c8592f758", - "qname": "RuntimeManager", - "kind": "class", - "signature": "RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.core.runtime", - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests manager\n- orchestrates role-like calls (4)\n- reads and writes state attributes\n- participates in dataflow slices (50)", - "layer": "C4_SEMANTIC_ROLES", - "title": "RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 43, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "7e4a9381328c5803bbc6179458612fc4e947d928aa7bf8b4b2bebb2c8592f758", - "symbol_name": "RuntimeManager", - "qname": "RuntimeManager", - "role": "pipeline_stage", - "confidence": 0.67, - "dataflow_participation": 50, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "ControlChannel\nrole: model\n\nResponsibilities:\n- default model role", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlChannel", - "span_start": 21, - "span_end": 28, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 40, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "cfcfe9a311d3a2dbdaf32ac4ccd73c0eb9a117f830591a1c0867ee97d46204ff", - "symbol_name": "ControlChannel", - "qname": "ControlChannel", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "ControlActionSet\nrole: model\n\nResponsibilities:\n- default model role", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlActionSet", - "span_start": 14, - "span_end": 18, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 40, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "46eb026cb3313415ec47b82dd22f84f4d112c9d987e8b1716dcb0baa1cce8988", - "symbol_name": "ControlActionSet", - "qname": "ControlActionSet", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests service\n- reads and writes state attributes\n- participates in dataflow slices (5)", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlPlaneService", - "span_start": 12, - "span_end": 52, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 68, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "b13471e5916986dccffb53fab613812842965705e6b3a89ae549d30c9e91e9aa", - "symbol_name": "ControlPlaneService", - "qname": "ControlPlaneService", - "role": "pipeline_stage", - "confidence": 0.57, - "dataflow_participation": 5, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_runner.py", - "content": "UvicornThreadRunner\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (24)", - "layer": "C4_SEMANTIC_ROLES", - "title": "UvicornThreadRunner", - "span_start": 10, - "span_end": 61, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 11, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "fd55630045a02100df8877ac27d951ee08617d4598764394d48cb51fe067476a", - "symbol_name": "UvicornThreadRunner", - "qname": "UvicornThreadRunner", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 24, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "3779fdd2878b770e789a35bb2a89c9d79f13b61c26d7db1b3b683f9bb9e1623f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (10)", - "layer": "C4_SEMANTIC_ROLES", - "title": "HttpControlChannel", - "span_start": 12, - "span_end": 57, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 21, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "1c9fbdc24819e5604c26ea55428a74310f03a03e1af197ed84846af61e42fdb0", - "symbol_name": "HttpControlChannel", - "qname": "HttpControlChannel", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 10, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "HttpControlAppFactory\nrole: factory\n\nResponsibilities:\n- name suffix suggests factory", - "layer": "C4_SEMANTIC_ROLES", - "title": "HttpControlAppFactory", - "span_start": 15, - "span_end": 53, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 39, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "9b3502a5fb408b273223db13264349cf500de24915b6c649d9ea8970d0dfd8e0", - "symbol_name": "HttpControlAppFactory", - "qname": "HttpControlAppFactory", - "role": "factory", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/persistence/workflow_persistence.py", - "content": "WorkflowPersistence\nrole: pipeline_stage\n\nResponsibilities:\n- orchestrates role-like calls (2)\n- reads and writes state attributes\n- participates in dataflow slices (16)", - "layer": "C4_SEMANTIC_ROLES", - "title": "WorkflowPersistence", - "span_start": 8, - "span_end": 54, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 15, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "7bd01ee45cf31f2d5c2e3e51656254860ac785d10cef9e0852cd4fba90857bae", - "symbol_name": "WorkflowPersistence", - "qname": "WorkflowPersistence", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 16, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "80e9410ddc639789b4353c2a1a757ba8d0d5b5bb6075b0b263b61551f04ae1f0", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager.add_config_file", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 32, - "span_end": 52, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "a23b8a11ebdb12708b60c96ea12a69f7f042082f1adfddd572444e246d81d167", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "57ffbd4f0d9fdf3507c2b8624312ce211f3d02fdf86a57a8ec90778d8a7b498d", - "dst_ref": "RuntimeManager.add_config_file", - "resolution": "resolved", - "slice_id": "a23b8a11ebdb12708b60c96ea12a69f7f042082f1adfddd572444e246d81d167", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager.add_config_file" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "57ffbd4f0d9fdf3507c2b8624312ce211f3d02fdf86a57a8ec90778d8a7b498d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.services\n -> RuntimeManager.__init__", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 33, - "span_end": 39, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "d43af85989222ee6d788ce418cdcb217c7ff044cfb915e3bdbd184417dc7bd61", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "dst_ref": "RuntimeManager.__init__", - "resolution": "resolved", - "slice_id": "d43af85989222ee6d788ce418cdcb217c7ff044cfb915e3bdbd184417dc7bd61", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.services", - "RuntimeManager.__init__" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.stop", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 25, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d", - "dst_ref": "ControlPlaneService.stop", - "resolution": "resolved", - "slice_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.stop" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._stop_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 51, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a", - "dst_ref": "ControlPlaneService._stop_async", - "resolution": "resolved", - "slice_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._stop_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager.start", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 32, - "span_end": 59, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "98312ace7fc62b1c7194c5aa1732b6ef736eae1668a3a120dd1ecd5ab1d64f7a", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "77a7b260193018845e4e204df094ab89cfd7c82ee4e822b3a83ad4cd945f9cb1", - "dst_ref": "RuntimeManager.start", - "resolution": "resolved", - "slice_id": "98312ace7fc62b1c7194c5aa1732b6ef736eae1668a3a120dd1ecd5ab1d64f7a", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager.start" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "77a7b260193018845e4e204df094ab89cfd7c82ee4e822b3a83ad4cd945f9cb1" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager._register_core_services", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 32, - "span_end": 127, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "3e5811f3b511fa0cabe363f5d01f2ac5fa039bc8b93f7ee108323e1f5f45a293", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "972d6057a6caac9cf31ebc1e29c6f39f71b10d4cc170dec57cf875ba458549c6", - "dst_ref": "RuntimeManager._register_core_services", - "resolution": "resolved", - "slice_id": "3e5811f3b511fa0cabe363f5d01f2ac5fa039bc8b93f7ee108323e1f5f45a293", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager._register_core_services" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "972d6057a6caac9cf31ebc1e29c6f39f71b10d4cc170dec57cf875ba458549c6" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.register_channel", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 17, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957", - "dst_ref": "ControlPlaneService.register_channel", - "resolution": "resolved", - "slice_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.register_channel" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.start", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 20, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154", - "dst_ref": "ControlPlaneService.start", - "resolution": "resolved", - "slice_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.start" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._start_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 47, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517", - "dst_ref": "ControlPlaneService._start_async", - "resolution": "resolved", - "slice_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._start_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.services\n -> RuntimeManager._register_core_services", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 33, - "span_end": 127, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "aac6f9dda73963b977083a892bee39a48eca4fbd7404787e022ecf4ebedec65d", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "972d6057a6caac9cf31ebc1e29c6f39f71b10d4cc170dec57cf875ba458549c6", - "dst_ref": "RuntimeManager._register_core_services", - "resolution": "resolved", - "slice_id": "aac6f9dda73963b977083a892bee39a48eca4fbd7404787e022ecf4ebedec65d", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.services", - "RuntimeManager._register_core_services" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "972d6057a6caac9cf31ebc1e29c6f39f71b10d4cc170dec57cf875ba458549c6" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "class RuntimeManager:\n ACTION_TIMEOUT_SECONDS = 10.0\n ACTION_POLL_INTERVAL_SECONDS = 0.05\n\n def __init__(\n self,\n configuration: ConfigurationManager | None = None,\n services: ServiceContainer | None = None,\n traces: TraceService | None = None,\n health: HealthRegistry | None = None,\n logs: LogManager | None = None,\n workers: WorkerSupervisor | None = None,\n control_plane: ControlPlaneService | None = None,\n ) -> None:\n self.configuration = configuration or ConfigurationManager()\n self.services = services or ServiceContainer()\n self.traces = traces or TraceService()\n self.health = health or HealthRegistry()\n self.logs = logs or LogManager()\n self.workers = workers or WorkerSupervisor()\n self.control_plane = control_plane or ControlPlaneService()\n self.registry = ModuleRegistry(self.services)\n self._started = False\n self._state = LifecycleState.IDLE\n self._core_registered = False\n self._workers_registered = False\n self._register_core_services()\n\n def register_module(self, module: ApplicationModule) -> None:\n self.registry.register_module(module.name)\n module.register(self.registry)\n\n def add_config_file(self, path: str) -> FileConfigProvider:\n provider = FileConfigProvider(path)\n self.configuration.add_provider(provider)\n return provider\n\n def start(self, *, start_control_plane: bool = True) -> None:\n if self._started:\n return\n self._state = LifecycleState.STARTING\n config = self.configuration.load()\n self.logs.apply_config(config)\n self._register_health_contributors()\n self._register_workers()\n self.workers.start()\n if start_control_plane:\n self.control_plane.start(self)\n self._started = True\n self._refresh_state()\n\n def stop(self, timeout: float = 30.0, force: bool = False, stop_control_plane: bool = True) -> None:\n if not self._started:\n return\n self._state = LifecycleState.STOPPING\n self.workers.stop(timeout=timeout, force=force)\n if stop_control_plane:\n self.control_plane.stop()\n self._started = False\n self._state = LifecycleState.STOPPED\n\n def status(self) -> dict[str, object]:\n self._refresh_state()\n return self.control_plane.snapshot(self)\n\n def current_health(self) -> HealthPayload:\n self._refresh_state()\n return self.health.payload(self._state, self.workers.healths())\n\n async def health_status(self) -> HealthPayload:\n return self.current_health()\n\n async def start_runtime(self) -> dict[str, object] | str:\n self._refresh_state()\n if self._started:\n return \"runtime already running\"\n if self._state == LifecycleState.STOPPING:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n\n self.start(start_control_plane=False)\n started = self._wait_for_state({LifecycleState.IDLE, LifecycleState.BUSY}, timeout=self.ACTION_TIMEOUT_SECONDS)\n if started:\n return self._action_detail(\"runtime started\", timed_out=False)\n return self._action_detail(\"runtime start is still in progress\", timed_out=True)\n\n async def stop_runtime(self) -> dict[str, object] | str:\n self._refresh_state()\n if not self._started:\n if self._state == LifecycleState.STOPPING:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n return \"runtime already stopped\"\n\n self._state = LifecycleState.STOPPING\n try:\n self.workers.stop(timeout=self.ACTION_TIMEOUT_SECONDS, force=False)\n except TimeoutError:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n\n self._started = False\n self._state = LifecycleState.STOPPED\n return self._action_detail(\"runtime stopped\", timed_out=False)\n\n async def runtime_status(self) -> str:\n self._refresh_state()\n return self._state.value\n\n def _register_core_services(self) -> None:\n if self._core_registered:\n return\n self.services.register(\"configuration\", self.configuration)\n self.services.register(\"traces\", self.traces)\n self.services.register(\"health\", self.health)\n self.services.register(\"logs\", self.logs)\n self.services.register(\"workers\", self.workers)\n self.services.register(\"control_plane\", self.control_plane)\n self._core_registered = True\n\n def _register_health_contributors(self) -> None:\n for contributor in self.registry.health_contributors:\n self.health.register(contributor)\n\n def _register_workers(self) -> None:\n if self._workers_registered:\n return\n for worker in self.registry.workers:\n self.workers.register(worker)\n self._workers_registered = True\n\n def _refresh_state(self) -> None:\n lifecycle = self.workers.lifecycle_state()\n\n if self._state == LifecycleState.STOPPING:\n if lifecycle == LifecycleState.STOPPED:\n self._started = False\n self._state = LifecycleState.STOPPED\n return\n\n if not self._started:\n if lifecycle == LifecycleState.STOPPED:\n self._state = LifecycleState.STOPPED\n return\n\n self._state = lifecycle\n\n def _wait_for_state(self, target_states: set[LifecycleState], *, timeout: float) -> bool:\n deadline = monotonic() + timeout\n while monotonic() < deadline:\n self._refresh_state()\n if self._state in target_states:\n return True\n sleep(self.ACTION_POLL_INTERVAL_SECONDS)\n self._refresh_state()\n return self._state in target_states\n\n def _action_detail(self, message: str, *, timed_out: bool) -> dict[str, object]:\n self._refresh_state()\n return {\n \"message\": message,\n \"state\": self._state.value,\n \"timed_out\": timed_out,\n \"workers\": self.workers.snapshot(),\n }", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/core/runtime.py:RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.core.runtime", - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "llm_answer": "При запуске объекта `RuntimeManager` происходит следующее:\n\n1. В методе `__init__` выполняется инициализация основных атрибутов класса:\n - Создаются объекты конфигурации (`configuration`), сервисов (`services`), трассировки (`traces`), мониторинга здоровья (`health`), логирования (`logs`) и управления рабочими процессами (`workers`).\n - При необходимости передаются параметры-конструкторы через аргументы метода.\n \n2. Далее вызывается приватный метод `_register_core_services`, предназначенный для регистрации базовых модулей системы, таких как регистрация модуля обработки («registry»).\n\nТаким образом, после создания экземпляра `RuntimeManager` объект конфигурируется с необходимыми сервисами и модулями, а затем начинает свою работу по управлению основными компонентами приложения. Однако сам механизм запуска методов и дальнейшей логики не показан напрямую в предоставленных артефактах.", - "summary": { - "router": { - "intent": "CODE_QA", - "sub_intent": "TRACE_FLOW", - "confidence": null - }, - "retrieval": { - "profile": "code", - "layers_hit": [ - "C0_SOURCE_CHUNKS", - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS", - "C4_SEMANTIC_ROLES" - ], - "evidence_sufficient": true - }, - "llm": { - "answer_status": "answered", - "groundedness": "grounded" - } - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "TRACE_FLOW", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "RuntimeManager" - ], - "keyword_hints": [ - "RuntimeManager" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C0_SOURCE_CHUNKS": "exact_path_fetch", - "C4_SEMANTIC_ROLES": "exact_path_fetch", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C3_ENTRYPOINTS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 8, - "C4_SEMANTIC_ROLES": 8, - "C2_DEPENDENCY_GRAPH": 10, - "C3_ENTRYPOINTS": 10 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C4_SEMANTIC_ROLES": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Покажи поток выполнения при запуске RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C4_SEMANTIC_ROLES", - "query": "Покажи поток выполнения при запуске RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "Покажи поток выполнения при запуске RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 10, - "ranking_profile": "code" - }, - { - "layer": "C3_ENTRYPOINTS", - "query": "Покажи поток выполнения при запуске RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 10, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 1, - "candidates_after_filter": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 10, - "candidates_after_filter": 10 - }, - { - "layer": "C3_ENTRYPOINTS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 3, - "candidates_after_filter": 3 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "RuntimeManager", - "alternatives": [ - "RuntimeManager" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C4_SEMANTIC_ROLES", - "status": "hit", - "hit_count": 8, - "fail_reason": null - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 10, - "fail_reason": null - }, - { - "layer": "C3_ENTRYPOINTS", - "status": "hit", - "hit_count": 3, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "router": 0, - "symbol_resolution": 0, - "retrieval_total": 168, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 49, - "C0_SOURCE_CHUNKS": 21, - "C4_SEMANTIC_ROLES": 20, - "C2_DEPENDENCY_GRAPH": 61, - "C3_ENTRYPOINTS": 15 - }, - "merge_rank": 32, - "prompt_build": 0, - "llm_call": 1485 - }, - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 816, - "evidence_rows": 23, - "evidence_chars": 8302 - }, - "evidence_summary": [ - { - "layer": "C1_SYMBOL_CATALOG", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "count": 8, - "unique_paths": 7 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "count": 10, - "unique_paths": 2 - }, - { - "layer": "C3_ENTRYPOINTS", - "count": 3, - "unique_paths": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 1, - "unique_paths": 1 - } - ], - "prompt_template_id": "intent_code_qa_trace_flow_ru_v3", - "system_prompt_version": "v1" - }, - "router": { - "conversation_mode": "START", - "keyword_hints": [ - "RuntimeManager" - ], - "path_scope": [] - }, - "llm": { - "used_evidence_count": 23, - "missing_evidence_reason": null - } - }, - "run_info": { - "case_id": "plba-v2-trace-flow-runtime-start", - "mode": "full_chain", - "run_started_at": "2026-03-12T14:07:09", - "rag_session_id": "7d11da21-faa0-4cea-aede-aeabe069164c", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - }, - "input_request": { - "text": "Покажи поток выполнения при запуске RuntimeManager", - "normalized_query": "Покажи поток выполнения при запуске RuntimeManager" - }, - "steps": [ - { - "step": "intent_router", - "input": { - "query": "Покажи поток выполнения при запуске RuntimeManager" - }, - "output": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Покажи поток выполнения при запуске RuntimeManager" - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "TRACE_FLOW", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "RuntimeManager" - ], - "keyword_hints": [ - "RuntimeManager" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "timings_ms": { - "router": 0 - } - } - }, - { - "step": "retrieval", - "input": { - "query": "Покажи поток выполнения при запуске RuntimeManager" - }, - "output": { - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "RuntimeManager", - "alternatives": [ - "RuntimeManager" - ], - "confidence": 0.99 - }, - "rag_count": 23, - "rag_rows": [ - { - "path": "src/app_runtime/core/runtime.py", - "content": "class RuntimeManager\nRuntimeManager", - "layer": "C1_SYMBOL_CATALOG", - "title": "RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "7e4a9381328c5803bbc6179458612fc4e947d928aa7bf8b4b2bebb2c8592f758", - "qname": "RuntimeManager", - "kind": "class", - "signature": "RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.core.runtime", - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests manager\n- orchestrates role-like calls (4)\n- reads and writes state attributes\n- participates in dataflow slices (50)", - "layer": "C4_SEMANTIC_ROLES", - "title": "RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 43, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "7e4a9381328c5803bbc6179458612fc4e947d928aa7bf8b4b2bebb2c8592f758", - "symbol_name": "RuntimeManager", - "qname": "RuntimeManager", - "role": "pipeline_stage", - "confidence": 0.67, - "dataflow_participation": 50, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "ControlChannel\nrole: model\n\nResponsibilities:\n- default model role", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlChannel", - "span_start": 21, - "span_end": 28, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 40, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "cfcfe9a311d3a2dbdaf32ac4ccd73c0eb9a117f830591a1c0867ee97d46204ff", - "symbol_name": "ControlChannel", - "qname": "ControlChannel", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "ControlActionSet\nrole: model\n\nResponsibilities:\n- default model role", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlActionSet", - "span_start": 14, - "span_end": 18, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 40, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "46eb026cb3313415ec47b82dd22f84f4d112c9d987e8b1716dcb0baa1cce8988", - "symbol_name": "ControlActionSet", - "qname": "ControlActionSet", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests service\n- reads and writes state attributes\n- participates in dataflow slices (5)", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlPlaneService", - "span_start": 12, - "span_end": 52, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 68, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "b13471e5916986dccffb53fab613812842965705e6b3a89ae549d30c9e91e9aa", - "symbol_name": "ControlPlaneService", - "qname": "ControlPlaneService", - "role": "pipeline_stage", - "confidence": 0.57, - "dataflow_participation": 5, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_runner.py", - "content": "UvicornThreadRunner\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (24)", - "layer": "C4_SEMANTIC_ROLES", - "title": "UvicornThreadRunner", - "span_start": 10, - "span_end": 61, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 11, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "fd55630045a02100df8877ac27d951ee08617d4598764394d48cb51fe067476a", - "symbol_name": "UvicornThreadRunner", - "qname": "UvicornThreadRunner", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 24, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "3779fdd2878b770e789a35bb2a89c9d79f13b61c26d7db1b3b683f9bb9e1623f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (10)", - "layer": "C4_SEMANTIC_ROLES", - "title": "HttpControlChannel", - "span_start": 12, - "span_end": 57, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 21, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "1c9fbdc24819e5604c26ea55428a74310f03a03e1af197ed84846af61e42fdb0", - "symbol_name": "HttpControlChannel", - "qname": "HttpControlChannel", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 10, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "HttpControlAppFactory\nrole: factory\n\nResponsibilities:\n- name suffix suggests factory", - "layer": "C4_SEMANTIC_ROLES", - "title": "HttpControlAppFactory", - "span_start": 15, - "span_end": 53, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 39, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "9b3502a5fb408b273223db13264349cf500de24915b6c649d9ea8970d0dfd8e0", - "symbol_name": "HttpControlAppFactory", - "qname": "HttpControlAppFactory", - "role": "factory", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/persistence/workflow_persistence.py", - "content": "WorkflowPersistence\nrole: pipeline_stage\n\nResponsibilities:\n- orchestrates role-like calls (2)\n- reads and writes state attributes\n- participates in dataflow slices (16)", - "layer": "C4_SEMANTIC_ROLES", - "title": "WorkflowPersistence", - "span_start": 8, - "span_end": 54, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 15, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "7bd01ee45cf31f2d5c2e3e51656254860ac785d10cef9e0852cd4fba90857bae", - "symbol_name": "WorkflowPersistence", - "qname": "WorkflowPersistence", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 16, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "80e9410ddc639789b4353c2a1a757ba8d0d5b5bb6075b0b263b61551f04ae1f0", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager.add_config_file", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 32, - "span_end": 52, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "a23b8a11ebdb12708b60c96ea12a69f7f042082f1adfddd572444e246d81d167", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "57ffbd4f0d9fdf3507c2b8624312ce211f3d02fdf86a57a8ec90778d8a7b498d", - "dst_ref": "RuntimeManager.add_config_file", - "resolution": "resolved", - "slice_id": "a23b8a11ebdb12708b60c96ea12a69f7f042082f1adfddd572444e246d81d167", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager.add_config_file" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "57ffbd4f0d9fdf3507c2b8624312ce211f3d02fdf86a57a8ec90778d8a7b498d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.services\n -> RuntimeManager.__init__", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 33, - "span_end": 39, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "d43af85989222ee6d788ce418cdcb217c7ff044cfb915e3bdbd184417dc7bd61", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "dst_ref": "RuntimeManager.__init__", - "resolution": "resolved", - "slice_id": "d43af85989222ee6d788ce418cdcb217c7ff044cfb915e3bdbd184417dc7bd61", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.services", - "RuntimeManager.__init__" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.stop", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 25, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d", - "dst_ref": "ControlPlaneService.stop", - "resolution": "resolved", - "slice_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.stop" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._stop_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 51, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a", - "dst_ref": "ControlPlaneService._stop_async", - "resolution": "resolved", - "slice_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._stop_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager.start", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 32, - "span_end": 59, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "98312ace7fc62b1c7194c5aa1732b6ef736eae1668a3a120dd1ecd5ab1d64f7a", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "77a7b260193018845e4e204df094ab89cfd7c82ee4e822b3a83ad4cd945f9cb1", - "dst_ref": "RuntimeManager.start", - "resolution": "resolved", - "slice_id": "98312ace7fc62b1c7194c5aa1732b6ef736eae1668a3a120dd1ecd5ab1d64f7a", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager.start" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "77a7b260193018845e4e204df094ab89cfd7c82ee4e822b3a83ad4cd945f9cb1" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager._register_core_services", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 32, - "span_end": 127, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "3e5811f3b511fa0cabe363f5d01f2ac5fa039bc8b93f7ee108323e1f5f45a293", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "972d6057a6caac9cf31ebc1e29c6f39f71b10d4cc170dec57cf875ba458549c6", - "dst_ref": "RuntimeManager._register_core_services", - "resolution": "resolved", - "slice_id": "3e5811f3b511fa0cabe363f5d01f2ac5fa039bc8b93f7ee108323e1f5f45a293", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager._register_core_services" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "972d6057a6caac9cf31ebc1e29c6f39f71b10d4cc170dec57cf875ba458549c6" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.register_channel", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 17, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957", - "dst_ref": "ControlPlaneService.register_channel", - "resolution": "resolved", - "slice_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.register_channel" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.start", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 20, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154", - "dst_ref": "ControlPlaneService.start", - "resolution": "resolved", - "slice_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.start" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._start_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 47, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517", - "dst_ref": "ControlPlaneService._start_async", - "resolution": "resolved", - "slice_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._start_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.services\n -> RuntimeManager._register_core_services", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 33, - "span_end": 127, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "aac6f9dda73963b977083a892bee39a48eca4fbd7404787e022ecf4ebedec65d", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "972d6057a6caac9cf31ebc1e29c6f39f71b10d4cc170dec57cf875ba458549c6", - "dst_ref": "RuntimeManager._register_core_services", - "resolution": "resolved", - "slice_id": "aac6f9dda73963b977083a892bee39a48eca4fbd7404787e022ecf4ebedec65d", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.services", - "RuntimeManager._register_core_services" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "972d6057a6caac9cf31ebc1e29c6f39f71b10d4cc170dec57cf875ba458549c6" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "class RuntimeManager:\n ACTION_TIMEOUT_SECONDS = 10.0\n ACTION_POLL_INTERVAL_SECONDS = 0.05\n\n def __init__(\n self,\n configuration: ConfigurationManager | None = None,\n services: ServiceContainer | None = None,\n traces: TraceService | None = None,\n health: HealthRegistry | None = None,\n logs: LogManager | None = None,\n workers: WorkerSupervisor | None = None,\n control_plane: ControlPlaneService | None = None,\n ) -> None:\n self.configuration = configuration or ConfigurationManager()\n self.services = services or ServiceContainer()\n self.traces = traces or TraceService()\n self.health = health or HealthRegistry()\n self.logs = logs or LogManager()\n self.workers = workers or WorkerSupervisor()\n self.control_plane = control_plane or ControlPlaneService()\n self.registry = ModuleRegistry(self.services)\n self._started = False\n self._state = LifecycleState.IDLE\n self._core_registered = False\n self._workers_registered = False\n self._register_core_services()\n\n def register_module(self, module: ApplicationModule) -> None:\n self.registry.register_module(module.name)\n module.register(self.registry)\n\n def add_config_file(self, path: str) -> FileConfigProvider:\n provider = FileConfigProvider(path)\n self.configuration.add_provider(provider)\n return provider\n\n def start(self, *, start_control_plane: bool = True) -> None:\n if self._started:\n return\n self._state = LifecycleState.STARTING\n config = self.configuration.load()\n self.logs.apply_config(config)\n self._register_health_contributors()\n self._register_workers()\n self.workers.start()\n if start_control_plane:\n self.control_plane.start(self)\n self._started = True\n self._refresh_state()\n\n def stop(self, timeout: float = 30.0, force: bool = False, stop_control_plane: bool = True) -> None:\n if not self._started:\n return\n self._state = LifecycleState.STOPPING\n self.workers.stop(timeout=timeout, force=force)\n if stop_control_plane:\n self.control_plane.stop()\n self._started = False\n self._state = LifecycleState.STOPPED\n\n def status(self) -> dict[str, object]:\n self._refresh_state()\n return self.control_plane.snapshot(self)\n\n def current_health(self) -> HealthPayload:\n self._refresh_state()\n return self.health.payload(self._state, self.workers.healths())\n\n async def health_status(self) -> HealthPayload:\n return self.current_health()\n\n async def start_runtime(self) -> dict[str, object] | str:\n self._refresh_state()\n if self._started:\n return \"runtime already running\"\n if self._state == LifecycleState.STOPPING:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n\n self.start(start_control_plane=False)\n started = self._wait_for_state({LifecycleState.IDLE, LifecycleState.BUSY}, timeout=self.ACTION_TIMEOUT_SECONDS)\n if started:\n return self._action_detail(\"runtime started\", timed_out=False)\n return self._action_detail(\"runtime start is still in progress\", timed_out=True)\n\n async def stop_runtime(self) -> dict[str, object] | str:\n self._refresh_state()\n if not self._started:\n if self._state == LifecycleState.STOPPING:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n return \"runtime already stopped\"\n\n self._state = LifecycleState.STOPPING\n try:\n self.workers.stop(timeout=self.ACTION_TIMEOUT_SECONDS, force=False)\n except TimeoutError:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n\n self._started = False\n self._state = LifecycleState.STOPPED\n return self._action_detail(\"runtime stopped\", timed_out=False)\n\n async def runtime_status(self) -> str:\n self._refresh_state()\n return self._state.value\n\n def _register_core_services(self) -> None:\n if self._core_registered:\n return\n self.services.register(\"configuration\", self.configuration)\n self.services.register(\"traces\", self.traces)\n self.services.register(\"health\", self.health)\n self.services.register(\"logs\", self.logs)\n self.services.register(\"workers\", self.workers)\n self.services.register(\"control_plane\", self.control_plane)\n self._core_registered = True\n\n def _register_health_contributors(self) -> None:\n for contributor in self.registry.health_contributors:\n self.health.register(contributor)\n\n def _register_workers(self) -> None:\n if self._workers_registered:\n return\n for worker in self.registry.workers:\n self.workers.register(worker)\n self._workers_registered = True\n\n def _refresh_state(self) -> None:\n lifecycle = self.workers.lifecycle_state()\n\n if self._state == LifecycleState.STOPPING:\n if lifecycle == LifecycleState.STOPPED:\n self._started = False\n self._state = LifecycleState.STOPPED\n return\n\n if not self._started:\n if lifecycle == LifecycleState.STOPPED:\n self._state = LifecycleState.STOPPED\n return\n\n self._state = lifecycle\n\n def _wait_for_state(self, target_states: set[LifecycleState], *, timeout: float) -> bool:\n deadline = monotonic() + timeout\n while monotonic() < deadline:\n self._refresh_state()\n if self._state in target_states:\n return True\n sleep(self.ACTION_POLL_INTERVAL_SECONDS)\n self._refresh_state()\n return self._state in target_states\n\n def _action_detail(self, message: str, *, timed_out: bool) -> dict[str, object]:\n self._refresh_state()\n return {\n \"message\": message,\n \"state\": self._state.value,\n \"timed_out\": timed_out,\n \"workers\": self.workers.snapshot(),\n }", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/core/runtime.py:RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.core.runtime", - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ] - }, - "diagnostics": { - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C0_SOURCE_CHUNKS": "exact_path_fetch", - "C4_SEMANTIC_ROLES": "exact_path_fetch", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C3_ENTRYPOINTS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 8, - "C4_SEMANTIC_ROLES": 8, - "C2_DEPENDENCY_GRAPH": 10, - "C3_ENTRYPOINTS": 10 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C4_SEMANTIC_ROLES": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Покажи поток выполнения при запуске RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C4_SEMANTIC_ROLES", - "query": "Покажи поток выполнения при запуске RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "Покажи поток выполнения при запуске RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 10, - "ranking_profile": "code" - }, - { - "layer": "C3_ENTRYPOINTS", - "query": "Покажи поток выполнения при запуске RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 10, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 1, - "candidates_after_filter": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 10, - "candidates_after_filter": 10 - }, - { - "layer": "C3_ENTRYPOINTS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 3, - "candidates_after_filter": 3 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "RuntimeManager", - "alternatives": [ - "RuntimeManager" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C4_SEMANTIC_ROLES", - "status": "hit", - "hit_count": 8, - "fail_reason": null - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 10, - "fail_reason": null - }, - { - "layer": "C3_ENTRYPOINTS", - "status": "hit", - "hit_count": 3, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "symbol_resolution": 0, - "retrieval_total": 168, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 49, - "C0_SOURCE_CHUNKS": 21, - "C4_SEMANTIC_ROLES": 20, - "C2_DEPENDENCY_GRAPH": 61, - "C3_ENTRYPOINTS": 15 - }, - "merge_rank": 32 - } - } - }, - { - "step": "llm_answer", - "input": { - "query": "Покажи поток выполнения при запуске RuntimeManager", - "rag_count": 23 - }, - "output": { - "llm_answer": "При запуске объекта `RuntimeManager` происходит следующее:\n\n1. В методе `__init__` выполняется инициализация основных атрибутов класса:\n - Создаются объекты конфигурации (`configuration`), сервисов (`services`), трассировки (`traces`), мониторинга здоровья (`health`), логирования (`logs`) и управления рабочими процессами (`workers`).\n - При необходимости передаются параметры-конструкторы через аргументы метода.\n \n2. Далее вызывается приватный метод `_register_core_services`, предназначенный для регистрации базовых модулей системы, таких как регистрация модуля обработки («registry»).\n\nТаким образом, после создания экземпляра `RuntimeManager` объект конфигурируется с необходимыми сервисами и модулями, а затем начинает свою работу по управлению основными компонентами приложения. Однако сам механизм запуска методов и дальнейшей логики не показан напрямую в предоставленных артефактах." - }, - "diagnostics": { - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 816, - "evidence_rows": 23, - "evidence_chars": 8302 - }, - "evidence_summary": [ - { - "layer": "C1_SYMBOL_CATALOG", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "count": 8, - "unique_paths": 7 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "count": 10, - "unique_paths": 2 - }, - { - "layer": "C3_ENTRYPOINTS", - "count": 3, - "unique_paths": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 1, - "unique_paths": 1 - } - ], - "prompt_template_id": "intent_code_qa_trace_flow_ru_v3", - "system_prompt_version": "v1" - }, - "timings_ms": { - "prompt_build": 0, - "llm_call": 1485 - } - } - } - ] - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_140708/full_chain_plba_code_subintents_v2_plba-v2-trace-flow-runtime-start.md b/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_140708/full_chain_plba_code_subintents_v2_plba-v2-trace-flow-runtime-start.md deleted file mode 100644 index 59256d7..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_140708/full_chain_plba_code_subintents_v2_plba-v2-trace-flow-runtime-start.md +++ /dev/null @@ -1,34 +0,0 @@ -# plba-v2-trace-flow-runtime-start - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_subintents_v2.yaml -- runner: runtime -- mode: full_chain -- passed: True - -## Query -Покажи поток выполнения при запуске RuntimeManager - -## Actual -{ - "intent": "CODE_QA", - "sub_intent": "TRACE_FLOW", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 23, - "llm_answer": "При запуске объекта `RuntimeManager` происходит следующее:\n\n1. В методе `__init__` выполняется инициализация основных атрибутов класса:\n - Создаются объекты конфигурации (`configuration`), сервисов (`services`), трассировки (`traces`), мониторинга здоровья (`health`), логирования (`logs`) и управления рабочими процессами (`workers`).\n - При необходимости передаются параметры-конструкторы через аргументы метода.\n \n2. Далее вызывается приватный метод `_register_core_services`, предназначенный для регистрации базовых модулей системы, таких как регистрация модуля обработки («registry»).\n\nТаким образом, после создания экземпляра `RuntimeManager` объект конфигурируется с необходимыми сервисами и модулями, а затем начинает свою работу по управлению основными компонентами приложения. Однако сам механизм запуска методов и дальнейшей логики не показан напрямую в предоставленных артефактах.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "RuntimeManager" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] -} - -## Mismatches -- none \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_140708/summary.md b/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_140708/summary.md deleted file mode 100644 index 8e98828..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_140708/summary.md +++ /dev/null @@ -1,80 +0,0 @@ -# pipeline_setup_v2 summary - -Passed: 18/18 - -| File | Case | Query | Expected sub-intent | Intent | Actual sub-intent | RAG layers | Pass | -|------|------|-------|---------------------|--------|-------------------|------------|------| -| full_chain_plba_code_subintents_v2.yaml | plba-v2-open-file-runtime | Открой файл src/app_runtime/core/runtime.py | OPEN_FILE | CODE_QA | OPEN_FILE | C0_SOURCE_CHUNKS:1 | ✓ | -| full_chain_plba_code_subintents_v2.yaml | plba-v2-open-file-public-api | Открой файл src/plba/__init__.py | OPEN_FILE | CODE_QA | OPEN_FILE | C0_SOURCE_CHUNKS:1 | ✓ | -| full_chain_plba_code_subintents_v2.yaml | plba-v2-explain-runtime-manager | Объясни как работает класс RuntimeManager | EXPLAIN | CODE_QA | EXPLAIN | C0_SOURCE_CHUNKS:1, C1_SYMBOL_CATALOG:1, C2_DEPENDENCY_GRAPH:6, C3_ENTRYPOINTS:3, C4_SEMANTIC_ROLES:1 | ✓ | -| full_chain_plba_code_subintents_v2.yaml | plba-v2-explain-trace-service | Объясни как работает класс TraceService | EXPLAIN | CODE_QA | EXPLAIN | C0_SOURCE_CHUNKS:3, C1_SYMBOL_CATALOG:1, C2_DEPENDENCY_GRAPH:6, C3_ENTRYPOINTS:3, C4_SEMANTIC_ROLES:1 | ✓ | -| full_chain_plba_code_subintents_v2.yaml | plba-v2-explain-create-runtime | Что делает функция create_runtime? | EXPLAIN | CODE_QA | EXPLAIN | C0_SOURCE_CHUNKS:1, C1_SYMBOL_CATALOG:1, C2_DEPENDENCY_GRAPH:6, C3_ENTRYPOINTS:3, C4_SEMANTIC_ROLES:1 | ✓ | -| full_chain_plba_code_subintents_v2.yaml | plba-v2-explain-local-http-channel | Почему в файле src/app_runtime/control/http_channel.py класс HttpControlChannel устроен так? | EXPLAIN_LOCAL | CODE_QA | EXPLAIN_LOCAL | C0_SOURCE_CHUNKS:1, C1_SYMBOL_CATALOG:1, C2_DEPENDENCY_GRAPH:4 | ✓ | -| full_chain_plba_code_subintents_v2.yaml | plba-v2-find-tests-runtime-manager | Где тесты для RuntimeManager? | FIND_TESTS | CODE_QA | FIND_TESTS | C0_SOURCE_CHUNKS:10, C2_DEPENDENCY_GRAPH:6 | ✓ | -| full_chain_plba_code_subintents_v2.yaml | plba-v2-find-tests-trace-service | Где тесты для TraceService? | FIND_TESTS | CODE_QA | FIND_TESTS | C0_SOURCE_CHUNKS:10, C2_DEPENDENCY_GRAPH:6 | ✓ | -| full_chain_plba_code_subintents_v2.yaml | plba-v2-find-tests-create-runtime | Где тесты для create_runtime? | FIND_TESTS | CODE_QA | FIND_TESTS | C0_SOURCE_CHUNKS:10, C2_DEPENDENCY_GRAPH:6 | ✓ | -| full_chain_plba_code_subintents_v2.yaml | plba-v2-find-tests-workflow-runtime-factory-negative | Где тесты для WorkflowRuntimeFactory? | FIND_TESTS | CODE_QA | FIND_TESTS | C0_SOURCE_CHUNKS:10, C2_DEPENDENCY_GRAPH:6 | ✓ | -| full_chain_plba_code_subintents_v2.yaml | plba-v2-find-entrypoints-control-plane | Найди точки входа HTTP control plane | FIND_ENTRYPOINTS | CODE_QA | FIND_ENTRYPOINTS | C0_SOURCE_CHUNKS:6, C3_ENTRYPOINTS:3 | ✓ | -| full_chain_plba_code_subintents_v2.yaml | plba-v2-find-entrypoints-health-endpoint | Где health endpoint? | FIND_ENTRYPOINTS | CODE_QA | FIND_ENTRYPOINTS | C0_SOURCE_CHUNKS:6, C3_ENTRYPOINTS:3 | ✓ | -| full_chain_plba_code_subintents_v2.yaml | plba-v2-trace-flow-runtime-start | Покажи поток выполнения при запуске RuntimeManager | TRACE_FLOW | CODE_QA | TRACE_FLOW | C0_SOURCE_CHUNKS:1, C1_SYMBOL_CATALOG:1, C2_DEPENDENCY_GRAPH:10, C3_ENTRYPOINTS:3, C4_SEMANTIC_ROLES:8 | ✓ | -| full_chain_plba_code_subintents_v2.yaml | plba-v2-trace-flow-health-endpoint | Покажи как проходит запрос /health в HttpControlAppFactory | TRACE_FLOW | CODE_QA | TRACE_FLOW | C0_SOURCE_CHUNKS:1, C1_SYMBOL_CATALOG:4, C2_DEPENDENCY_GRAPH:10, C3_ENTRYPOINTS:3, C4_SEMANTIC_ROLES:8 | ✓ | -| full_chain_plba_code_subintents_v2.yaml | plba-v2-architecture-runtime-manager | Какие компоненты участвуют в RuntimeManager? | ARCHITECTURE | CODE_QA | ARCHITECTURE | C0_SOURCE_CHUNKS:1, C1_SYMBOL_CATALOG:1, C2_DEPENDENCY_GRAPH:8, C3_ENTRYPOINTS:3, C4_SEMANTIC_ROLES:12 | ✓ | -| full_chain_plba_code_subintents_v2.yaml | plba-v2-architecture-control-plane | Какие компоненты участвуют в ControlPlaneService? | ARCHITECTURE | CODE_QA | ARCHITECTURE | C0_SOURCE_CHUNKS:1, C1_SYMBOL_CATALOG:1, C2_DEPENDENCY_GRAPH:8, C3_ENTRYPOINTS:3, C4_SEMANTIC_ROLES:12 | ✓ | -| full_chain_plba_code_subintents_v2.yaml | plba-v2-explain-nonexistent-symbol | Объясни класс RuntimeFactoryManager | EXPLAIN | CODE_QA | EXPLAIN | — | ✓ | -| full_chain_plba_code_subintents_v2.yaml | plba-v2-open-file-nonexistent | Открой файл src/app_runtime/core/missing_runtime.py | OPEN_FILE | CODE_QA | OPEN_FILE | — | ✓ | - -## LLM Answers -- **plba-v2-open-file-runtime** - Query: Открой файл src/app_runtime/core/runtime.py - > Файл src/app\_runtime/core/runtime.py содержит определение класса \`RuntimeManager\`. В классе инициализируются параметры конфигурации, сервисы и другие компоненты системы. Видно также метод \`\_\_init\_\_\`, принимающий различные аргументы для настройки менеджера выполнения задач. Метод \`\_register\_core\_services\` упоминается, но его реализация не видна в представленном фрагменте. -- **plba-v2-open-file-public-api** - Query: Открой файл src/plba/__init__.py - > В файле \`src/plba/\_\_init\_\_.py\` видны импортированные модули и классы из различных подпакетов библиотеки PLBA. Файл экспортирует набор основных классов и функций, используемых для конфигурации, управления состоянием приложения, работы с очередями задач, выполнения рабочих процессов и контроля их здоровья. Ответ основан исключительно на содержимом указанного файла. -- **plba-v2-explain-runtime-manager** - Query: Объясни как работает класс RuntimeManager - > Класс \`RuntimeManager\` играет роль менеджера жизненного цикла различных компонентов в приложении, обеспечивая координацию их инициализации и управления состоянием системы. Ключевые особенности класса: 1. Инициализация \(\`\_\_init\_\_\(\)\`\): \- Класс принимает ряд аргументов: конфигурацию, сервисы, систему отслеживания трассировок, реестр здоровья, логгер, супервизор рабочих процессов и сервис управления каналами. \- Все аргументы имеют значения по умолчанию, позволяя легко создать экземпляр класса без передачи всех параметров. 2. Управление состояниями: \- Свойства \`\_started\`, \`\_state\`, \`\_core\_registered\`, \`\_workers\_registered\` используются для отслеживания текущего состояния системы и её модулей. \- Метод \`\_register\_core\_services\(\)\` регистрирует основные службы приложения. 3. Регистрация модулей: \- Метод \`register\_module\(module\)\` позволяет зарегистрировать дополнительные модул… -- **plba-v2-explain-trace-service** - Query: Объясни как работает класс TraceService - > Класс \`TraceService\` представляет собой сервис для управления контекстами трассировки в приложении. Он является фабрикой контекста \(\`TraceContextFactory\`\), что указывает на его роль в создании и управлении объектами, связанными с трассировкой. Ключевые аспекты работы класса: 1. Инициализация: \- При инициализации создается объект записи трассировочных данных \(\`TraceRecordWriter\`\) и используется транспортная инфраструктура \(\`TraceTransport\`\). Если транспорт не указан, по умолчанию применяется заглушка \(\`NoOpTraceTransport\(\)\`\). 2. Создание контекста трассировки: \- Метод \`create\_context\` создает новый контекст трассировки с уникальным идентификатором, записывает его в хранилище \(\`store\`\) и отправляет запись через транспортную инфраструктуру. \- Контекст можно создать с указанием следующих параметров: \- \`alias\`: строка, идентифицирующая тип контекста; \- \`parent\_id\`: родите… -- **plba-v2-explain-create-runtime** - Query: Что делает функция create_runtime? - > Функция \`create\_runtime\` находится в файле \`src/plba/bootstrap.py\`. Её задача – инициализировать объект типа \`RuntimeManager\`. Реальные шаги её работы выглядят так: 1. Создаётся пустой экземпляр объекта \`RuntimeManager\`. 2. Если передан параметр \`config\_path\`, то вызовом метода \`add\_config\_file\` загружается конфигурационный файл. 3. При включённой опции \`enable\_http\_control\` создаётся канал управления через HTTP \(\`HttpControlChannel\`\) и регистрируется в объекте \`runtime.control\_plane\`. 4. Регистрируется переданный модуль приложения при помощи вызова метода \`register\_module\`. На основании представленного контекста можно уверенно утверждать, что функция выполняет основные действия по настройке и регистрации конфигурации и модуля приложения в объекте менеджера выполнения задач \(\`RuntimeManager\`\). Косвенные признаки указывают на возможное использование этого объекта для… -- **plba-v2-explain-local-http-channel** - Query: Почему в файле src/app_runtime/control/http_channel.py класс HttpControlChannel устроен так? - > Класс \`HttpControlChannel\` из файла \`http\_channel.py\` реализует механизм управления HTTP\-каналами для взаимодействия с внешним миром приложения. Что он делает: \- При инициализации класса \(\`\_\_init\_\_\`\) создается объект \`\_runner\`, управляющий сервером uvicorn \(это веб\-сервер на Python\), и устанавливается таймаут соединения через параметр \`timeout\`. \- Метод \`start\(actions\)\` запускает веб\-приложение, передавая обработчики запросов на здоровье системы и выполнение действий \(\`\_health\_response\` и \`\_action\_response\`\), а также конфигурирует набор доступных команд \(\`actions\`\). \- Метод \`stop\(\)\` останавливает работу сервера. \- Методы \`\_health\_response\` и \`\_action\_response\` возвращают ответы на запросы о состоянии системы и запросах на выполнение конкретных действий соответственно. Входные данные: \- Параметры при создании объекта: строка \`host\`, целое число \`port\`, целое число \`ti… -- **plba-v2-find-tests-runtime-manager** - Query: Где тесты для RuntimeManager? - > Прямые тесты для \`RuntimeManager\` находятся в следующих файлах: 1. tests/test\_runtime.py: \- \`test\_runtime\_graceful\_stop\_waits\_until\_worker\_finishes\`: проверяет корректность остановки менеджера при завершении работы его рабочих процессов. \- \`test\_runtime\_runs\_worker\_routine\_and\_exposes\_status\`: тестирует запуск рабочего рутины и отображение статуса выполнения. Эти тесты непосредственно используют объект \`RuntimeManager\`, создавая его инстанс и проверяя поведение через регистрацию модулей и выполнение операций запуска/остановки. Косвенных тестов, которые могли бы касаться \`RuntimeManager\`, но напрямую не создают его экземпляр, в данном контексте не обнаружено. -- **plba-v2-find-tests-trace-service** - Query: Где тесты для TraceService? - > Прямые тесты для \`TraceService\` находятся в файле \`tests/test\_runtime.py\`. В этих тестах: \- \`test\_trace\_service\_writes\_contexts\_and\_messages\` проверяет корректность записи контекста и сообщений при использовании сервиса трассировки. \- \`test\_trace\_service\_supports\_debug\_warning\_and\_error\_levels\` подтверждает поддержку различных уровней логирования \(DEBUG, WARNING, ERROR\). Оба теста непосредственно обращаются к классу \`TraceService\`, его методам и зависят от поведения самого класса через интерфейс взаимодействия с транспортом \(\`RecordingTransport\`\). -- **plba-v2-find-tests-create-runtime** - Query: Где тесты для create_runtime? - > Прямых тестов конкретно для функции \`create\_runtime\` в предоставленном контексте не обнаружено. Её имя не упоминается явно ни в объявлениях \(C1\), ни в зависимостях \(C2\), а также отсутствуют явные проверки поведения этой функции. Однако можно заметить косвенное упоминание о создании runtime через функцию \`\_build\_runtime\`, которая используется в тестах: \- В тесте \`tests/test\_business\_control\_actions.py:\_build\_runtime\` происходит создание runtime при помощи вызова функции \`RuntimeManager\(\)\`. \- Тесты \`test\_worker\_wakes\_up\_with\_configured\_interval\` и \`test\_actions\_stop\_busy\_worker\_after\_timeout\` используют блокирующий режим работы и взаимодействуют с worker'ами внутри runtime, но напрямую на \`create\_runtime\` это не указывает. Таким образом, хотя тестов с прямым названием \`create\_runtime\` нет, косвенно проверка создания runtime осуществляется через взаимодействие с её резу… -- **plba-v2-find-tests-workflow-runtime-factory-negative** - Query: Где тесты для WorkflowRuntimeFactory? - > Прямых тестов конкретно для \`WorkflowRuntimeFactory\` в предоставленном контексте не обнаружено. Имя класса, его импорты или вызовы не упоминаются ни в одном из перечисленных тестов. Однако можно найти косвенно связанные тесты, которые могут проверять функционал, связанный с управлением рабочими потоками или сценариями выполнения рабочих задач \(например, блокирующие рутины, сценарии работы с интервалами\). Эти тесты преимущественно проверяют поведение отдельных компонентов системы управления выполнением задач, таких как запуск, остановка и мониторинг активности работников. Например: \- tests/test\_business\_control\_actions.py: Тесты проверяют взаимодействие с различными действиями, связанными с состоянием и здоровьем рабочего потока \(\`ScenarioWorker\`, \`BlockingRoutine\`\), но напрямую не касаются \`WorkflowRuntimeFactory\`. Эти тесты фокусируются на проверке правильности рабо… -- **plba-v2-find-entrypoints-control-plane** - Query: Найди точки входа HTTP control plane - > Подтверждённые точки входа HTTP control plane: \- GET /health Объявлен в \`src/app\_runtime/control/http\_app.py\`. Контекст — fastapi, метод обработчика: \`health\`. \- GET /actions/\{action\}, POST /actions/\{action\} Объявлены в \`src/app\_runtime/control/http\_app.py\`. Контекст — fastapi, методы обработчиков: \`action\`. Возможные кандидаты \(полезны, но требуют дополнительного подтверждения\): \- HTTP метод: неизвестно, путь: \`/\` Не имеет явных маркеров маршрута, однако может быть точкой старта приложения, так как используется uvicorn thread runner для запуска fastapi application. Требуется дополнительное исследование для точной идентификации маршрутов и контекста обработки. -- **plba-v2-find-entrypoints-health-endpoint** - Query: Где health endpoint? - > Подтверждённый health\-endpoint обнаружен по следующим точкам входа: \- HTTP GET \`/health Объявлен в файле \`src/app\_runtime/control/http\_app.py\`, обслуживается FastAPI. Кандидаты на health\-endpoint \(без явных маркеров route\): \- Нет явных неподтвержденных кандидатов. -- **plba-v2-trace-flow-runtime-start** - Query: Покажи поток выполнения при запуске RuntimeManager - > При запуске объекта \`RuntimeManager\` происходит следующее: 1. В методе \`\_\_init\_\_\` выполняется инициализация основных атрибутов класса: \- Создаются объекты конфигурации \(\`configuration\`\), сервисов \(\`services\`\), трассировки \(\`traces\`\), мониторинга здоровья \(\`health\`\), логирования \(\`logs\`\) и управления рабочими процессами \(\`workers\`\). \- При необходимости передаются параметры\-конструкторы через аргументы метода. 2. Далее вызывается приватный метод \`\_register\_core\_services\`, предназначенный для регистрации базовых модулей системы, таких как регистрация модуля обработки \(«registry»\). Таким образом, после создания экземпляра \`RuntimeManager\` объект конфигурируется с необходимыми сервисами и модулями, а затем начинает свою работу по управлению основными компонентами приложения. Однако сам механизм запуска методов и дальнейшей логики не показан напрямую в предоставленных арте… -- **plba-v2-trace-flow-health-endpoint** - Query: Покажи как проходит запрос /health в HttpControlAppFactory - > Запрос \`/health\` обрабатывается следующим образом: 1. В методе \`create\` класса \`HttpControlAppFactory\` создаётся экземпляр приложения FastAPI с маршрутом \`/health\`. 2. Обработчик маршрута \`/health\` определяется через декоратор \`@app.get\("/health"\)\`, внутри которого вызывается функция \`health\_provider\`, переданная при создании экземпляра фабрики. 3. Результат вызова функции \`health\_provider\` асинхронно преобразуется в объект типа \`JSONResponse\`. Статус\-код ответа устанавливается на основе значения поля \`"status"\` возвращаемого объекта: \- если \`"status"\` равно \`"ok"\`, статус\-код равен 200; \- иначе — 503. 4. Вызываемая функция возвращает результат обработки запроса в формате JSON вместе со статусом\-кодом. Таким образом, весь процесс обработки запроса \`/health\` ограничивается исключительно реализацией предоставленной функции \`health\_provider\`, которая должна обеспечивать… -- **plba-v2-architecture-runtime-manager** - Query: Какие компоненты участвуют в RuntimeManager? - > В подсистеме RuntimeManager участвуют следующие компоненты и устанавливаются явные связи между ними: 1. RuntimeManager – центральный управляющий компонент, ответственный за координацию работы всей системы runtime. Он управляет состоянием приложения и отвечает за выполнение ключевых операций жизненного цикла, таких как инициализация конфигурации и запуск процессов. \- Связи: чтение и запись атрибутов состояния \(через конфигурационные данные и методы start\). 2. ControlActionSet – модель поведения или действия, выполняемые системой управления. Этот компонент играет роль дефолтного исполнителя для различных управляющих задач. \- Связь: используется внутри RuntimeManager при выполнении действий управления. 3. ControlPlaneService – сервис, обеспечивающий взаимодействие с плоскостью контроля. Его основная задача — управление каналами коммуникации и инициирование асинхронных п… -- **plba-v2-architecture-control-plane** - Query: Какие компоненты участвуют в ControlPlaneService? - > В подсистеме \`ControlPlaneService\` наблюдаются следующие компоненты и связи: 1. ControlPlaneService – главный компонент службы, управляющий потоками данных и состоянием системы. Он инициализируется через метод \`\_\_init\_\_\`, создавая каналы \(\`\_channels\`\) и регистрируя их с помощью метода \`\_register\_channel\`. 2. ControlActionSet – модель действий управления, используемая службой для обработки команд или запросов на выполнение определённых операций. Этот компонент участвует в создании каналов и запускает асинхронную обработку. Связи и зависимости внутри подсистемы: \- Контейнер \`ControlPlaneService\` отвечает за координацию выполнения различных задач и управление каналами данных. \- Каналы \(\`\_channels\`\), создаваемые при инициализации сервиса, служат механизмами передачи данных и уведомлений между различными частями системы. \- Запуск асинхронных задач происходит через метод \`… -- **plba-v2-explain-nonexistent-symbol** - Query: Объясни класс RuntimeFactoryManager - > Класс \`RuntimeFactoryManager\` не найден в предоставленном контексте. Учитывая, что контекста недостаточно для прямого анализа, я не могу точно подтвердить наличие этого класса или объяснить его работу на основе доступных данных. Тем не менее, исходя из названия, можно сделать осторожный вывод о возможном предназначении данного класса: 1. Назначение: Вероятно, этот класс предназначен для управления фабриками \(factory\) или создания экземпляров различных runtime\-компонентов во время выполнения программы. Это может включать настройку и инициализацию объектов, регистрацию фабрик или управление жизненным циклом компонентов. 2. Возможные функции: \- Управление созданием и регистрацией фабрик для разных типов компонентов. \- Предоставление интерфейса для динамического получения инстансов конкретных классов или объектов по запросу. \- Возможное кэширование созданных экземпляров… -- **plba-v2-open-file-nonexistent** - Query: Открой файл src/app_runtime/core/missing_runtime.py - > Файл src/app\_runtime/core/missing\_runtime.py не найден. \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_143636/full_chain_plba_code_subintents_v2_plba-v2-architecture-control-plane.json b/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_143636/full_chain_plba_code_subintents_v2_plba-v2-architecture-control-plane.json deleted file mode 100644 index 84d51bf..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_143636/full_chain_plba_code_subintents_v2_plba-v2-architecture-control-plane.json +++ /dev/null @@ -1,2940 +0,0 @@ -{ - "case_id": "plba-v2-architecture-control-plane", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_subintents_v2.yaml", - "runner": "runtime", - "mode": "full_chain", - "actual": { - "intent": "CODE_QA", - "sub_intent": "ARCHITECTURE", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 25, - "llm_answer": "В подсистеме `ControlPlaneService` участвуют следующие компоненты и наблюдаются явные связи между ними:\n\n1. ControlPlaneService — главный компонент, создающий и инициализирующий другие компоненты:\n - Создаёт каналы (`_channels`) для передачи данных с помощью метода `_channels`.\n - Регистрирует каналы с помощью метода `register_channel`, который передаёт управление каналу.\n \n2. Каналы (_channels) — представляют собой элементы инфраструктуры для обмена данными внутри сервиса. Каналы создаются и регистрируются в `ControlPlaneService`. \n\nСвязи компонентов выражены следующим образом:\n- Контроллер службы создает и управляет каналами данных.\n- Каналы используются службой для передачи и приёма сообщений между различными частями системы.\n\nГраницы ответственности `ControlPlaneService` можно кратко описать так:\n- Управление жизненным циклом каналов данных.\n- Чтение и запись атрибутов состояния системы.\n- Участие в передаче данных между компонентами системы через зарегистрированные каналы.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "ControlPlaneService" - ], - "layers": [ - "C4_SEMANTIC_ROLES", - "C3_ENTRYPOINTS", - "C2_DEPENDENCY_GRAPH", - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS" - ] - }, - "passed": true, - "mismatches": [], - "details": { - "case_id": "plba-v2-architecture-control-plane", - "text": "Какие компоненты участвуют в ControlPlaneService?", - "mode": "full_chain", - "run_started_at": "2026-03-12T14:36:36", - "rag_session_id": "7d11da21-faa0-4cea-aede-aeabe069164c", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Какие компоненты участвуют в ControlPlaneService?", - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "ControlPlaneService", - "alternatives": [ - "ControlPlaneService" - ], - "confidence": 0.99 - }, - "rag_count": 25, - "rag_rows": [ - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests service\n- reads and writes state attributes\n- participates in dataflow slices (5)", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlPlaneService", - "span_start": 12, - "span_end": 52, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 68, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "b13471e5916986dccffb53fab613812842965705e6b3a89ae549d30c9e91e9aa", - "symbol_name": "ControlPlaneService", - "qname": "ControlPlaneService", - "role": "pipeline_stage", - "confidence": 0.57, - "dataflow_participation": 5, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "ControlActionSet\nrole: model\n\nResponsibilities:\n- default model role", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlActionSet", - "span_start": 14, - "span_end": 18, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 40, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "46eb026cb3313415ec47b82dd22f84f4d112c9d987e8b1716dcb0baa1cce8988", - "symbol_name": "ControlActionSet", - "qname": "ControlActionSet", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "ControlChannel\nrole: model\n\nResponsibilities:\n- default model role", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlChannel", - "span_start": 21, - "span_end": 28, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 40, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "cfcfe9a311d3a2dbdaf32ac4ccd73c0eb9a117f830591a1c0867ee97d46204ff", - "symbol_name": "ControlChannel", - "qname": "ControlChannel", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_runner.py", - "content": "UvicornThreadRunner\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (24)", - "layer": "C4_SEMANTIC_ROLES", - "title": "UvicornThreadRunner", - "span_start": 10, - "span_end": 61, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 11, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "fd55630045a02100df8877ac27d951ee08617d4598764394d48cb51fe067476a", - "symbol_name": "UvicornThreadRunner", - "qname": "UvicornThreadRunner", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 24, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "3779fdd2878b770e789a35bb2a89c9d79f13b61c26d7db1b3b683f9bb9e1623f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (10)", - "layer": "C4_SEMANTIC_ROLES", - "title": "HttpControlChannel", - "span_start": 12, - "span_end": 57, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 21, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "1c9fbdc24819e5604c26ea55428a74310f03a03e1af197ed84846af61e42fdb0", - "symbol_name": "HttpControlChannel", - "qname": "HttpControlChannel", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 10, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "HttpControlAppFactory\nrole: factory\n\nResponsibilities:\n- name suffix suggests factory", - "layer": "C4_SEMANTIC_ROLES", - "title": "HttpControlAppFactory", - "span_start": 15, - "span_end": 53, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 39, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "9b3502a5fb408b273223db13264349cf500de24915b6c649d9ea8970d0dfd8e0", - "symbol_name": "HttpControlAppFactory", - "qname": "HttpControlAppFactory", - "role": "factory", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/persistence/workflow_persistence.py", - "content": "WorkflowPersistence\nrole: pipeline_stage\n\nResponsibilities:\n- orchestrates role-like calls (2)\n- reads and writes state attributes\n- participates in dataflow slices (16)", - "layer": "C4_SEMANTIC_ROLES", - "title": "WorkflowPersistence", - "span_start": 8, - "span_end": 54, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 15, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "7bd01ee45cf31f2d5c2e3e51656254860ac785d10cef9e0852cd4fba90857bae", - "symbol_name": "WorkflowPersistence", - "qname": "WorkflowPersistence", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 16, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "80e9410ddc639789b4353c2a1a757ba8d0d5b5bb6075b0b263b61551f04ae1f0", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/queue/in_memory.py", - "content": "InMemoryTaskQueue\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (9)", - "layer": "C4_SEMANTIC_ROLES", - "title": "InMemoryTaskQueue", - "span_start": 9, - "span_end": 38, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 22, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "2da04cb94544a3bcbf0943a95ad4bdd8710bcafaa32a02fd0e4de2178dcf3533", - "symbol_name": "InMemoryTaskQueue", - "qname": "InMemoryTaskQueue", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 9, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "58f0cc001ccda0eee4c6bc32ed83bd05eafd6b6644f1e8b4aa9eed3103db73dc", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/config/file_loader.py", - "content": "ConfigFileLoader\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (8)", - "layer": "C4_SEMANTIC_ROLES", - "title": "ConfigFileLoader", - "span_start": 11, - "span_end": 48, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 23, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "a8474eca8b6e9dc86ae67ed68b16fa5fb639ef08739c053e7b7195489765667f", - "symbol_name": "ConfigFileLoader", - "qname": "ConfigFileLoader", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 8, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "1f19ffebde5e38e4be5a5d5a678059a0f36dedb8fb8b3e00ab395c67106a87ea", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/store.py", - "content": "TraceContextStore\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (6)", - "layer": "C4_SEMANTIC_ROLES", - "title": "TraceContextStore", - "span_start": 15, - "span_end": 52, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 25, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "b2dad4fbe16ffb11b58deba311c7739955c39d59f291b22181f33e9c8cce4059", - "symbol_name": "TraceContextStore", - "qname": "TraceContextStore", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 6, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "d369554f08fc92039c6edd5a2a1e73b23901533e8974459170bbd9347d263dc5", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workers/supervisor.py", - "content": "WorkerSupervisor\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (6)", - "layer": "C4_SEMANTIC_ROLES", - "title": "WorkerSupervisor", - "span_start": 10, - "span_end": 59, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 25, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "c17b44e8d9e97d490989b21fa67d7c346cdda8a0472e4c41fb243c8846faa124", - "symbol_name": "WorkerSupervisor", - "qname": "WorkerSupervisor", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 6, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "77609d9d5927171cce7fc3a54897c183fd63068710c6362029b700937aae5eee", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/engine/workflow_engine.py", - "content": "WorkflowEngine\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (6)", - "layer": "C4_SEMANTIC_ROLES", - "title": "WorkflowEngine", - "span_start": 10, - "span_end": 86, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 25, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "57ec0a9f11c542c78e008684a888397e8d9ef4223671acb2567e631a0cbc70b4", - "symbol_name": "WorkflowEngine", - "qname": "WorkflowEngine", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 6, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "1057136e58a325cd5ab6f4e265d15665fb6a711b7022d9fab52a1a290afa2368", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._start_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 47, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517", - "dst_ref": "ControlPlaneService._start_async", - "resolution": "resolved", - "slice_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._start_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.register_channel", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 17, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957", - "dst_ref": "ControlPlaneService.register_channel", - "resolution": "resolved", - "slice_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.register_channel" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.start", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 20, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154", - "dst_ref": "ControlPlaneService.start", - "resolution": "resolved", - "slice_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.start" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.stop", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 25, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d", - "dst_ref": "ControlPlaneService.stop", - "resolution": "resolved", - "slice_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.stop" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._stop_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 51, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a", - "dst_ref": "ControlPlaneService._stop_async", - "resolution": "resolved", - "slice_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._stop_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.start calls asyncio.run", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.start:calls", - "span_start": 22, - "span_end": 22, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "4e0b3147fb867d48d26567570c259f4052a739e3098133802d4b8bafcf03be6b", - "edge_type": "calls", - "src_symbol_id": "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154", - "src_qname": "ControlPlaneService.start", - "dst_symbol_id": null, - "dst_ref": "asyncio.run", - "resolution": "partial", - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.register_channel reads_attr ControlPlaneService._channels", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.register_channel:reads_attr", - "span_start": 17, - "span_end": 17, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "3101fdc99a7a9c5aebf18a024bc148d37b348248a6fd02b95724dff280f2908a", - "edge_type": "reads_attr", - "src_symbol_id": "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957", - "src_qname": "ControlPlaneService.register_channel", - "dst_symbol_id": null, - "dst_ref": "ControlPlaneService._channels", - "resolution": "partial", - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.start reads_attr ControlPlaneService._channels", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.start:reads_attr", - "span_start": 20, - "span_end": 20, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "9452e50ef27d47c30ee1c311c48fe73ecddbf7a6dbcf967a6345e98222d9f71a", - "edge_type": "reads_attr", - "src_symbol_id": "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154", - "src_qname": "ControlPlaneService.start", - "dst_symbol_id": null, - "dst_ref": "ControlPlaneService._channels", - "resolution": "partial", - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "class ControlPlaneService\nControlPlaneService", - "layer": "C1_SYMBOL_CATALOG", - "title": "ControlPlaneService", - "span_start": 12, - "span_end": 52, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "b13471e5916986dccffb53fab613812842965705e6b3a89ae549d30c9e91e9aa", - "qname": "ControlPlaneService", - "kind": "class", - "signature": "ControlPlaneService", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.control.service", - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "class ControlPlaneService:\n def __init__(self) -> None:\n self._channels: list[ControlChannel] = []\n\n def register_channel(self, channel: ControlChannel) -> None:\n self._channels.append(channel)\n\n def start(self, runtime: RuntimeManager) -> None:\n if not self._channels:\n return\n asyncio.run(self._start_async(runtime))\n\n def stop(self) -> None:\n if not self._channels:\n return\n asyncio.run(self._stop_async())\n\n def snapshot(self, runtime: RuntimeManager) -> dict[str, object]:\n health = runtime.current_health()\n return {\n \"runtime\": {\"state\": runtime._state.value},\n \"modules\": list(runtime.registry.modules),\n \"services\": runtime.services.snapshot(),\n \"workers\": runtime.workers.snapshot(),\n \"health\": runtime.health.snapshot(runtime.workers.healths()) | {\"status\": health[\"status\"]},\n \"config\": runtime.configuration.get(),\n }\n\n async def _start_async(self, runtime: RuntimeManager) -> None:\n actions = ControlActionSet(\n health=runtime.health_status,\n start=runtime.start_runtime,\n stop=runtime.stop_runtime,\n status=runtime.runtime_status,\n )\n for channel in self._channels:\n await channel.start(actions)\n\n async def _stop_async(self) -> None:\n for channel in reversed(self._channels):\n await channel.stop()", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/service.py:ControlPlaneService", - "span_start": 12, - "span_end": 52, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.service", - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "llm_answer": "В подсистеме `ControlPlaneService` участвуют следующие компоненты и наблюдаются явные связи между ними:\n\n1. ControlPlaneService — главный компонент, создающий и инициализирующий другие компоненты:\n - Создаёт каналы (`_channels`) для передачи данных с помощью метода `_channels`.\n - Регистрирует каналы с помощью метода `register_channel`, который передаёт управление каналу.\n \n2. Каналы (_channels) — представляют собой элементы инфраструктуры для обмена данными внутри сервиса. Каналы создаются и регистрируются в `ControlPlaneService`. \n\nСвязи компонентов выражены следующим образом:\n- Контроллер службы создает и управляет каналами данных.\n- Каналы используются службой для передачи и приёма сообщений между различными частями системы.\n\nГраницы ответственности `ControlPlaneService` можно кратко описать так:\n- Управление жизненным циклом каналов данных.\n- Чтение и запись атрибутов состояния системы.\n- Участие в передаче данных между компонентами системы через зарегистрированные каналы.", - "summary": { - "router": { - "intent": "CODE_QA", - "sub_intent": "ARCHITECTURE", - "confidence": null - }, - "retrieval": { - "profile": "code", - "layers_hit": [ - "C0_SOURCE_CHUNKS", - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS", - "C4_SEMANTIC_ROLES" - ], - "evidence_sufficient": true - }, - "llm": { - "answer_status": "answered", - "groundedness": "grounded" - } - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "ARCHITECTURE", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C4_SEMANTIC_ROLES", - "C3_ENTRYPOINTS", - "C2_DEPENDENCY_GRAPH", - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "ControlPlaneService" - ], - "keyword_hints": [ - "ControlPlaneService" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "execution": { - "executed_layers": [ - "C4_SEMANTIC_ROLES", - "C3_ENTRYPOINTS", - "C2_DEPENDENCY_GRAPH", - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS" - ], - "retrieval_mode_by_layer": { - "C4_SEMANTIC_ROLES": "exact_path_fetch", - "C3_ENTRYPOINTS": "exact_path_fetch", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C1_SYMBOL_CATALOG": "symbol_search", - "C0_SOURCE_CHUNKS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C4_SEMANTIC_ROLES": 12, - "C3_ENTRYPOINTS": 8, - "C2_DEPENDENCY_GRAPH": 8, - "C1_SYMBOL_CATALOG": 6, - "C0_SOURCE_CHUNKS": 4 - }, - "filters_by_layer": { - "C4_SEMANTIC_ROLES": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C1_SYMBOL_CATALOG": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C4_SEMANTIC_ROLES", - "query": "Какие компоненты участвуют в ControlPlaneService?", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 12, - "ranking_profile": "code" - }, - { - "layer": "C3_ENTRYPOINTS", - "query": "Какие компоненты участвуют в ControlPlaneService?", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "Какие компоненты участвуют в ControlPlaneService?", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C1_SYMBOL_CATALOG", - "query": "ControlPlaneService", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Какие компоненты участвуют в ControlPlaneService?", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 4, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C4_SEMANTIC_ROLES", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 12, - "candidates_after_filter": 12 - }, - { - "layer": "C3_ENTRYPOINTS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 3, - "candidates_after_filter": 3 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 1, - "candidates_after_filter": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 4, - "candidates_after_filter": 4 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "ControlPlaneService", - "alternatives": [ - "ControlPlaneService" - ] - }, - "layers": [ - { - "layer": "C4_SEMANTIC_ROLES", - "status": "hit", - "hit_count": 12, - "fail_reason": null - }, - { - "layer": "C3_ENTRYPOINTS", - "status": "hit", - "hit_count": 3, - "fail_reason": null - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 8, - "fail_reason": null - }, - { - "layer": "C1_SYMBOL_CATALOG", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 1, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "router": 1, - "symbol_resolution": 0, - "retrieval_total": 147, - "retrieval_by_layer": { - "C4_SEMANTIC_ROLES": 34, - "C3_ENTRYPOINTS": 14, - "C2_DEPENDENCY_GRAPH": 57, - "C1_SYMBOL_CATALOG": 25, - "C0_SOURCE_CHUNKS": 16 - }, - "merge_rank": 21, - "prompt_build": 0, - "llm_call": 1604 - }, - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 636, - "evidence_rows": 25, - "evidence_chars": 3723 - }, - "evidence_summary": [ - { - "layer": "C4_SEMANTIC_ROLES", - "count": 12, - "unique_paths": 11 - }, - { - "layer": "C3_ENTRYPOINTS", - "count": 3, - "unique_paths": 1 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "count": 8, - "unique_paths": 1 - }, - { - "layer": "C1_SYMBOL_CATALOG", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 1, - "unique_paths": 1 - } - ], - "prompt_template_id": "intent_code_qa_architecture_ru_v4", - "system_prompt_version": "v1" - }, - "router": { - "conversation_mode": "START", - "keyword_hints": [ - "ControlPlaneService" - ], - "path_scope": [] - }, - "llm": { - "used_evidence_count": 25, - "missing_evidence_reason": null - } - }, - "run_info": { - "case_id": "plba-v2-architecture-control-plane", - "mode": "full_chain", - "run_started_at": "2026-03-12T14:36:36", - "rag_session_id": "7d11da21-faa0-4cea-aede-aeabe069164c", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - }, - "input_request": { - "text": "Какие компоненты участвуют в ControlPlaneService?", - "normalized_query": "Какие компоненты участвуют в ControlPlaneService?" - }, - "steps": [ - { - "step": "intent_router", - "input": { - "query": "Какие компоненты участвуют в ControlPlaneService?" - }, - "output": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Какие компоненты участвуют в ControlPlaneService?" - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "ARCHITECTURE", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C4_SEMANTIC_ROLES", - "C3_ENTRYPOINTS", - "C2_DEPENDENCY_GRAPH", - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "ControlPlaneService" - ], - "keyword_hints": [ - "ControlPlaneService" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "timings_ms": { - "router": 1 - } - } - }, - { - "step": "retrieval", - "input": { - "query": "Какие компоненты участвуют в ControlPlaneService?" - }, - "output": { - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "ControlPlaneService", - "alternatives": [ - "ControlPlaneService" - ], - "confidence": 0.99 - }, - "rag_count": 25, - "rag_rows": [ - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests service\n- reads and writes state attributes\n- participates in dataflow slices (5)", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlPlaneService", - "span_start": 12, - "span_end": 52, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 68, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "b13471e5916986dccffb53fab613812842965705e6b3a89ae549d30c9e91e9aa", - "symbol_name": "ControlPlaneService", - "qname": "ControlPlaneService", - "role": "pipeline_stage", - "confidence": 0.57, - "dataflow_participation": 5, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "ControlActionSet\nrole: model\n\nResponsibilities:\n- default model role", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlActionSet", - "span_start": 14, - "span_end": 18, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 40, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "46eb026cb3313415ec47b82dd22f84f4d112c9d987e8b1716dcb0baa1cce8988", - "symbol_name": "ControlActionSet", - "qname": "ControlActionSet", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "ControlChannel\nrole: model\n\nResponsibilities:\n- default model role", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlChannel", - "span_start": 21, - "span_end": 28, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 40, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "cfcfe9a311d3a2dbdaf32ac4ccd73c0eb9a117f830591a1c0867ee97d46204ff", - "symbol_name": "ControlChannel", - "qname": "ControlChannel", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_runner.py", - "content": "UvicornThreadRunner\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (24)", - "layer": "C4_SEMANTIC_ROLES", - "title": "UvicornThreadRunner", - "span_start": 10, - "span_end": 61, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 11, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "fd55630045a02100df8877ac27d951ee08617d4598764394d48cb51fe067476a", - "symbol_name": "UvicornThreadRunner", - "qname": "UvicornThreadRunner", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 24, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "3779fdd2878b770e789a35bb2a89c9d79f13b61c26d7db1b3b683f9bb9e1623f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (10)", - "layer": "C4_SEMANTIC_ROLES", - "title": "HttpControlChannel", - "span_start": 12, - "span_end": 57, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 21, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "1c9fbdc24819e5604c26ea55428a74310f03a03e1af197ed84846af61e42fdb0", - "symbol_name": "HttpControlChannel", - "qname": "HttpControlChannel", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 10, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "HttpControlAppFactory\nrole: factory\n\nResponsibilities:\n- name suffix suggests factory", - "layer": "C4_SEMANTIC_ROLES", - "title": "HttpControlAppFactory", - "span_start": 15, - "span_end": 53, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 39, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "9b3502a5fb408b273223db13264349cf500de24915b6c649d9ea8970d0dfd8e0", - "symbol_name": "HttpControlAppFactory", - "qname": "HttpControlAppFactory", - "role": "factory", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/persistence/workflow_persistence.py", - "content": "WorkflowPersistence\nrole: pipeline_stage\n\nResponsibilities:\n- orchestrates role-like calls (2)\n- reads and writes state attributes\n- participates in dataflow slices (16)", - "layer": "C4_SEMANTIC_ROLES", - "title": "WorkflowPersistence", - "span_start": 8, - "span_end": 54, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 15, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "7bd01ee45cf31f2d5c2e3e51656254860ac785d10cef9e0852cd4fba90857bae", - "symbol_name": "WorkflowPersistence", - "qname": "WorkflowPersistence", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 16, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "80e9410ddc639789b4353c2a1a757ba8d0d5b5bb6075b0b263b61551f04ae1f0", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/queue/in_memory.py", - "content": "InMemoryTaskQueue\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (9)", - "layer": "C4_SEMANTIC_ROLES", - "title": "InMemoryTaskQueue", - "span_start": 9, - "span_end": 38, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 22, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "2da04cb94544a3bcbf0943a95ad4bdd8710bcafaa32a02fd0e4de2178dcf3533", - "symbol_name": "InMemoryTaskQueue", - "qname": "InMemoryTaskQueue", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 9, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "58f0cc001ccda0eee4c6bc32ed83bd05eafd6b6644f1e8b4aa9eed3103db73dc", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/config/file_loader.py", - "content": "ConfigFileLoader\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (8)", - "layer": "C4_SEMANTIC_ROLES", - "title": "ConfigFileLoader", - "span_start": 11, - "span_end": 48, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 23, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "a8474eca8b6e9dc86ae67ed68b16fa5fb639ef08739c053e7b7195489765667f", - "symbol_name": "ConfigFileLoader", - "qname": "ConfigFileLoader", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 8, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "1f19ffebde5e38e4be5a5d5a678059a0f36dedb8fb8b3e00ab395c67106a87ea", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/store.py", - "content": "TraceContextStore\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (6)", - "layer": "C4_SEMANTIC_ROLES", - "title": "TraceContextStore", - "span_start": 15, - "span_end": 52, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 25, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "b2dad4fbe16ffb11b58deba311c7739955c39d59f291b22181f33e9c8cce4059", - "symbol_name": "TraceContextStore", - "qname": "TraceContextStore", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 6, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "d369554f08fc92039c6edd5a2a1e73b23901533e8974459170bbd9347d263dc5", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workers/supervisor.py", - "content": "WorkerSupervisor\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (6)", - "layer": "C4_SEMANTIC_ROLES", - "title": "WorkerSupervisor", - "span_start": 10, - "span_end": 59, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 25, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "c17b44e8d9e97d490989b21fa67d7c346cdda8a0472e4c41fb243c8846faa124", - "symbol_name": "WorkerSupervisor", - "qname": "WorkerSupervisor", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 6, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "77609d9d5927171cce7fc3a54897c183fd63068710c6362029b700937aae5eee", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/engine/workflow_engine.py", - "content": "WorkflowEngine\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (6)", - "layer": "C4_SEMANTIC_ROLES", - "title": "WorkflowEngine", - "span_start": 10, - "span_end": 86, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 25, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "57ec0a9f11c542c78e008684a888397e8d9ef4223671acb2567e631a0cbc70b4", - "symbol_name": "WorkflowEngine", - "qname": "WorkflowEngine", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 6, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "1057136e58a325cd5ab6f4e265d15665fb6a711b7022d9fab52a1a290afa2368", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._start_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 47, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517", - "dst_ref": "ControlPlaneService._start_async", - "resolution": "resolved", - "slice_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._start_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.register_channel", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 17, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957", - "dst_ref": "ControlPlaneService.register_channel", - "resolution": "resolved", - "slice_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.register_channel" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.start", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 20, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154", - "dst_ref": "ControlPlaneService.start", - "resolution": "resolved", - "slice_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.start" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.stop", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 25, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d", - "dst_ref": "ControlPlaneService.stop", - "resolution": "resolved", - "slice_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.stop" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._stop_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 51, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a", - "dst_ref": "ControlPlaneService._stop_async", - "resolution": "resolved", - "slice_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._stop_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.start calls asyncio.run", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.start:calls", - "span_start": 22, - "span_end": 22, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "4e0b3147fb867d48d26567570c259f4052a739e3098133802d4b8bafcf03be6b", - "edge_type": "calls", - "src_symbol_id": "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154", - "src_qname": "ControlPlaneService.start", - "dst_symbol_id": null, - "dst_ref": "asyncio.run", - "resolution": "partial", - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.register_channel reads_attr ControlPlaneService._channels", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.register_channel:reads_attr", - "span_start": 17, - "span_end": 17, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "3101fdc99a7a9c5aebf18a024bc148d37b348248a6fd02b95724dff280f2908a", - "edge_type": "reads_attr", - "src_symbol_id": "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957", - "src_qname": "ControlPlaneService.register_channel", - "dst_symbol_id": null, - "dst_ref": "ControlPlaneService._channels", - "resolution": "partial", - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.start reads_attr ControlPlaneService._channels", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.start:reads_attr", - "span_start": 20, - "span_end": 20, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "9452e50ef27d47c30ee1c311c48fe73ecddbf7a6dbcf967a6345e98222d9f71a", - "edge_type": "reads_attr", - "src_symbol_id": "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154", - "src_qname": "ControlPlaneService.start", - "dst_symbol_id": null, - "dst_ref": "ControlPlaneService._channels", - "resolution": "partial", - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "class ControlPlaneService\nControlPlaneService", - "layer": "C1_SYMBOL_CATALOG", - "title": "ControlPlaneService", - "span_start": 12, - "span_end": 52, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "b13471e5916986dccffb53fab613812842965705e6b3a89ae549d30c9e91e9aa", - "qname": "ControlPlaneService", - "kind": "class", - "signature": "ControlPlaneService", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.control.service", - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "class ControlPlaneService:\n def __init__(self) -> None:\n self._channels: list[ControlChannel] = []\n\n def register_channel(self, channel: ControlChannel) -> None:\n self._channels.append(channel)\n\n def start(self, runtime: RuntimeManager) -> None:\n if not self._channels:\n return\n asyncio.run(self._start_async(runtime))\n\n def stop(self) -> None:\n if not self._channels:\n return\n asyncio.run(self._stop_async())\n\n def snapshot(self, runtime: RuntimeManager) -> dict[str, object]:\n health = runtime.current_health()\n return {\n \"runtime\": {\"state\": runtime._state.value},\n \"modules\": list(runtime.registry.modules),\n \"services\": runtime.services.snapshot(),\n \"workers\": runtime.workers.snapshot(),\n \"health\": runtime.health.snapshot(runtime.workers.healths()) | {\"status\": health[\"status\"]},\n \"config\": runtime.configuration.get(),\n }\n\n async def _start_async(self, runtime: RuntimeManager) -> None:\n actions = ControlActionSet(\n health=runtime.health_status,\n start=runtime.start_runtime,\n stop=runtime.stop_runtime,\n status=runtime.runtime_status,\n )\n for channel in self._channels:\n await channel.start(actions)\n\n async def _stop_async(self) -> None:\n for channel in reversed(self._channels):\n await channel.stop()", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/service.py:ControlPlaneService", - "span_start": 12, - "span_end": 52, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.service", - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ] - }, - "diagnostics": { - "execution": { - "executed_layers": [ - "C4_SEMANTIC_ROLES", - "C3_ENTRYPOINTS", - "C2_DEPENDENCY_GRAPH", - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS" - ], - "retrieval_mode_by_layer": { - "C4_SEMANTIC_ROLES": "exact_path_fetch", - "C3_ENTRYPOINTS": "exact_path_fetch", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C1_SYMBOL_CATALOG": "symbol_search", - "C0_SOURCE_CHUNKS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C4_SEMANTIC_ROLES": 12, - "C3_ENTRYPOINTS": 8, - "C2_DEPENDENCY_GRAPH": 8, - "C1_SYMBOL_CATALOG": 6, - "C0_SOURCE_CHUNKS": 4 - }, - "filters_by_layer": { - "C4_SEMANTIC_ROLES": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C1_SYMBOL_CATALOG": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C4_SEMANTIC_ROLES", - "query": "Какие компоненты участвуют в ControlPlaneService?", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 12, - "ranking_profile": "code" - }, - { - "layer": "C3_ENTRYPOINTS", - "query": "Какие компоненты участвуют в ControlPlaneService?", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "Какие компоненты участвуют в ControlPlaneService?", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C1_SYMBOL_CATALOG", - "query": "ControlPlaneService", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Какие компоненты участвуют в ControlPlaneService?", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 4, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C4_SEMANTIC_ROLES", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 12, - "candidates_after_filter": 12 - }, - { - "layer": "C3_ENTRYPOINTS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 3, - "candidates_after_filter": 3 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 1, - "candidates_after_filter": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 4, - "candidates_after_filter": 4 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "ControlPlaneService", - "alternatives": [ - "ControlPlaneService" - ] - }, - "layers": [ - { - "layer": "C4_SEMANTIC_ROLES", - "status": "hit", - "hit_count": 12, - "fail_reason": null - }, - { - "layer": "C3_ENTRYPOINTS", - "status": "hit", - "hit_count": 3, - "fail_reason": null - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 8, - "fail_reason": null - }, - { - "layer": "C1_SYMBOL_CATALOG", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 1, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "symbol_resolution": 0, - "retrieval_total": 147, - "retrieval_by_layer": { - "C4_SEMANTIC_ROLES": 34, - "C3_ENTRYPOINTS": 14, - "C2_DEPENDENCY_GRAPH": 57, - "C1_SYMBOL_CATALOG": 25, - "C0_SOURCE_CHUNKS": 16 - }, - "merge_rank": 21 - } - } - }, - { - "step": "llm_answer", - "input": { - "query": "Какие компоненты участвуют в ControlPlaneService?", - "rag_count": 25 - }, - "output": { - "llm_answer": "В подсистеме `ControlPlaneService` участвуют следующие компоненты и наблюдаются явные связи между ними:\n\n1. ControlPlaneService — главный компонент, создающий и инициализирующий другие компоненты:\n - Создаёт каналы (`_channels`) для передачи данных с помощью метода `_channels`.\n - Регистрирует каналы с помощью метода `register_channel`, который передаёт управление каналу.\n \n2. Каналы (_channels) — представляют собой элементы инфраструктуры для обмена данными внутри сервиса. Каналы создаются и регистрируются в `ControlPlaneService`. \n\nСвязи компонентов выражены следующим образом:\n- Контроллер службы создает и управляет каналами данных.\n- Каналы используются службой для передачи и приёма сообщений между различными частями системы.\n\nГраницы ответственности `ControlPlaneService` можно кратко описать так:\n- Управление жизненным циклом каналов данных.\n- Чтение и запись атрибутов состояния системы.\n- Участие в передаче данных между компонентами системы через зарегистрированные каналы." - }, - "diagnostics": { - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 636, - "evidence_rows": 25, - "evidence_chars": 3723 - }, - "evidence_summary": [ - { - "layer": "C4_SEMANTIC_ROLES", - "count": 12, - "unique_paths": 11 - }, - { - "layer": "C3_ENTRYPOINTS", - "count": 3, - "unique_paths": 1 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "count": 8, - "unique_paths": 1 - }, - { - "layer": "C1_SYMBOL_CATALOG", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 1, - "unique_paths": 1 - } - ], - "prompt_template_id": "intent_code_qa_architecture_ru_v4", - "system_prompt_version": "v1" - }, - "timings_ms": { - "prompt_build": 0, - "llm_call": 1604 - } - } - } - ] - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_143636/full_chain_plba_code_subintents_v2_plba-v2-architecture-control-plane.md b/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_143636/full_chain_plba_code_subintents_v2_plba-v2-architecture-control-plane.md deleted file mode 100644 index 6606c62..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_143636/full_chain_plba_code_subintents_v2_plba-v2-architecture-control-plane.md +++ /dev/null @@ -1,34 +0,0 @@ -# plba-v2-architecture-control-plane - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_subintents_v2.yaml -- runner: runtime -- mode: full_chain -- passed: True - -## Query -Какие компоненты участвуют в ControlPlaneService? - -## Actual -{ - "intent": "CODE_QA", - "sub_intent": "ARCHITECTURE", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 25, - "llm_answer": "В подсистеме `ControlPlaneService` участвуют следующие компоненты и наблюдаются явные связи между ними:\n\n1. ControlPlaneService — главный компонент, создающий и инициализирующий другие компоненты:\n - Создаёт каналы (`_channels`) для передачи данных с помощью метода `_channels`.\n - Регистрирует каналы с помощью метода `register_channel`, который передаёт управление каналу.\n \n2. Каналы (_channels) — представляют собой элементы инфраструктуры для обмена данными внутри сервиса. Каналы создаются и регистрируются в `ControlPlaneService`. \n\nСвязи компонентов выражены следующим образом:\n- Контроллер службы создает и управляет каналами данных.\n- Каналы используются службой для передачи и приёма сообщений между различными частями системы.\n\nГраницы ответственности `ControlPlaneService` можно кратко описать так:\n- Управление жизненным циклом каналов данных.\n- Чтение и запись атрибутов состояния системы.\n- Участие в передаче данных между компонентами системы через зарегистрированные каналы.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "ControlPlaneService" - ], - "layers": [ - "C4_SEMANTIC_ROLES", - "C3_ENTRYPOINTS", - "C2_DEPENDENCY_GRAPH", - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS" - ] -} - -## Mismatches -- none \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_143636/full_chain_plba_code_subintents_v2_plba-v2-architecture-runtime-manager.json b/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_143636/full_chain_plba_code_subintents_v2_plba-v2-architecture-runtime-manager.json deleted file mode 100644 index dfae77c..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_143636/full_chain_plba_code_subintents_v2_plba-v2-architecture-runtime-manager.json +++ /dev/null @@ -1,3036 +0,0 @@ -{ - "case_id": "plba-v2-architecture-runtime-manager", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_subintents_v2.yaml", - "runner": "runtime", - "mode": "full_chain", - "actual": { - "intent": "CODE_QA", - "sub_intent": "ARCHITECTURE", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 25, - "llm_answer": "В подсистеме RuntimeManager участвуют следующие компоненты и устанавливаются явные связи между ними:\n\n1. RuntimeManager:\n - Создаёт экземпляры других компонентов и управляет их жизненным циклом.\n - Регистрирует состояние атрибутов системы и его изменения.\n - Вызывает методы для обработки различных событий и состояний внутри системы.\n \n2. ControlActionSet:\n - Получает команды от RuntimeManager и выполняет действия модели на основе этих команд.\n\nСвязи между компонентами:\n- Создает: RuntimeManager создает экземпляр ControlActionSet при своем инициализации.\n- Регистрирует: RuntimeManager отслеживает текущее состояние атрибутов системы и может регистрировать изменения состояния.\n- Передаёт данные: RuntimeManager передает команды и события в ControlActionSet для выполнения соответствующих действий.\n\nГраницы ответственности:\n- RuntimeManager отвечает за координацию работы различных компонентов и управление жизненным циклом всей runtime-подсистемы.\n- ControlActionSet реализует модель поведения приложения и исполняет необходимые операции на основе полученных команд.\n\nЭти наблюдения основаны исключительно на выявленных зависимостях вызовов и зарегистрированных точках входа в коде, а также сигнатур и ролей компонентов.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "RuntimeManager" - ], - "layers": [ - "C4_SEMANTIC_ROLES", - "C3_ENTRYPOINTS", - "C2_DEPENDENCY_GRAPH", - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS" - ] - }, - "passed": true, - "mismatches": [], - "details": { - "case_id": "plba-v2-architecture-runtime-manager", - "text": "Какие компоненты участвуют в RuntimeManager?", - "mode": "full_chain", - "run_started_at": "2026-03-12T14:36:36", - "rag_session_id": "7d11da21-faa0-4cea-aede-aeabe069164c", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Какие компоненты участвуют в RuntimeManager?", - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "RuntimeManager", - "alternatives": [ - "RuntimeManager" - ], - "confidence": 0.99 - }, - "rag_count": 25, - "rag_rows": [ - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests manager\n- orchestrates role-like calls (4)\n- reads and writes state attributes\n- participates in dataflow slices (50)", - "layer": "C4_SEMANTIC_ROLES", - "title": "RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 43, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "7e4a9381328c5803bbc6179458612fc4e947d928aa7bf8b4b2bebb2c8592f758", - "symbol_name": "RuntimeManager", - "qname": "RuntimeManager", - "role": "pipeline_stage", - "confidence": 0.67, - "dataflow_participation": 50, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "ControlActionSet\nrole: model\n\nResponsibilities:\n- default model role", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlActionSet", - "span_start": 14, - "span_end": 18, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 40, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "46eb026cb3313415ec47b82dd22f84f4d112c9d987e8b1716dcb0baa1cce8988", - "symbol_name": "ControlActionSet", - "qname": "ControlActionSet", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "ControlChannel\nrole: model\n\nResponsibilities:\n- default model role", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlChannel", - "span_start": 21, - "span_end": 28, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 40, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "cfcfe9a311d3a2dbdaf32ac4ccd73c0eb9a117f830591a1c0867ee97d46204ff", - "symbol_name": "ControlChannel", - "qname": "ControlChannel", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests service\n- reads and writes state attributes\n- participates in dataflow slices (5)", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlPlaneService", - "span_start": 12, - "span_end": 52, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 68, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "b13471e5916986dccffb53fab613812842965705e6b3a89ae549d30c9e91e9aa", - "symbol_name": "ControlPlaneService", - "qname": "ControlPlaneService", - "role": "pipeline_stage", - "confidence": 0.57, - "dataflow_participation": 5, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_runner.py", - "content": "UvicornThreadRunner\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (24)", - "layer": "C4_SEMANTIC_ROLES", - "title": "UvicornThreadRunner", - "span_start": 10, - "span_end": 61, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 11, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "fd55630045a02100df8877ac27d951ee08617d4598764394d48cb51fe067476a", - "symbol_name": "UvicornThreadRunner", - "qname": "UvicornThreadRunner", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 24, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "3779fdd2878b770e789a35bb2a89c9d79f13b61c26d7db1b3b683f9bb9e1623f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (10)", - "layer": "C4_SEMANTIC_ROLES", - "title": "HttpControlChannel", - "span_start": 12, - "span_end": 57, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 21, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "1c9fbdc24819e5604c26ea55428a74310f03a03e1af197ed84846af61e42fdb0", - "symbol_name": "HttpControlChannel", - "qname": "HttpControlChannel", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 10, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "HttpControlAppFactory\nrole: factory\n\nResponsibilities:\n- name suffix suggests factory", - "layer": "C4_SEMANTIC_ROLES", - "title": "HttpControlAppFactory", - "span_start": 15, - "span_end": 53, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 39, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "9b3502a5fb408b273223db13264349cf500de24915b6c649d9ea8970d0dfd8e0", - "symbol_name": "HttpControlAppFactory", - "qname": "HttpControlAppFactory", - "role": "factory", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/persistence/workflow_persistence.py", - "content": "WorkflowPersistence\nrole: pipeline_stage\n\nResponsibilities:\n- orchestrates role-like calls (2)\n- reads and writes state attributes\n- participates in dataflow slices (16)", - "layer": "C4_SEMANTIC_ROLES", - "title": "WorkflowPersistence", - "span_start": 8, - "span_end": 54, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 15, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "7bd01ee45cf31f2d5c2e3e51656254860ac785d10cef9e0852cd4fba90857bae", - "symbol_name": "WorkflowPersistence", - "qname": "WorkflowPersistence", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 16, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "80e9410ddc639789b4353c2a1a757ba8d0d5b5bb6075b0b263b61551f04ae1f0", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/queue/in_memory.py", - "content": "InMemoryTaskQueue\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (9)", - "layer": "C4_SEMANTIC_ROLES", - "title": "InMemoryTaskQueue", - "span_start": 9, - "span_end": 38, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 22, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "2da04cb94544a3bcbf0943a95ad4bdd8710bcafaa32a02fd0e4de2178dcf3533", - "symbol_name": "InMemoryTaskQueue", - "qname": "InMemoryTaskQueue", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 9, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "58f0cc001ccda0eee4c6bc32ed83bd05eafd6b6644f1e8b4aa9eed3103db73dc", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/config/file_loader.py", - "content": "ConfigFileLoader\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (8)", - "layer": "C4_SEMANTIC_ROLES", - "title": "ConfigFileLoader", - "span_start": 11, - "span_end": 48, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 23, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "a8474eca8b6e9dc86ae67ed68b16fa5fb639ef08739c053e7b7195489765667f", - "symbol_name": "ConfigFileLoader", - "qname": "ConfigFileLoader", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 8, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "1f19ffebde5e38e4be5a5d5a678059a0f36dedb8fb8b3e00ab395c67106a87ea", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/store.py", - "content": "TraceContextStore\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (6)", - "layer": "C4_SEMANTIC_ROLES", - "title": "TraceContextStore", - "span_start": 15, - "span_end": 52, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 25, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "b2dad4fbe16ffb11b58deba311c7739955c39d59f291b22181f33e9c8cce4059", - "symbol_name": "TraceContextStore", - "qname": "TraceContextStore", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 6, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "d369554f08fc92039c6edd5a2a1e73b23901533e8974459170bbd9347d263dc5", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workers/supervisor.py", - "content": "WorkerSupervisor\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (6)", - "layer": "C4_SEMANTIC_ROLES", - "title": "WorkerSupervisor", - "span_start": 10, - "span_end": 59, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 25, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "c17b44e8d9e97d490989b21fa67d7c346cdda8a0472e4c41fb243c8846faa124", - "symbol_name": "WorkerSupervisor", - "qname": "WorkerSupervisor", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 6, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "77609d9d5927171cce7fc3a54897c183fd63068710c6362029b700937aae5eee", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._start_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 47, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517", - "dst_ref": "ControlPlaneService._start_async", - "resolution": "resolved", - "slice_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._start_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager.start", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 32, - "span_end": 59, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "98312ace7fc62b1c7194c5aa1732b6ef736eae1668a3a120dd1ecd5ab1d64f7a", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "77a7b260193018845e4e204df094ab89cfd7c82ee4e822b3a83ad4cd945f9cb1", - "dst_ref": "RuntimeManager.start", - "resolution": "resolved", - "slice_id": "98312ace7fc62b1c7194c5aa1732b6ef736eae1668a3a120dd1ecd5ab1d64f7a", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager.start" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "77a7b260193018845e4e204df094ab89cfd7c82ee4e822b3a83ad4cd945f9cb1" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.start", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 20, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154", - "dst_ref": "ControlPlaneService.start", - "resolution": "resolved", - "slice_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.start" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.stop", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 25, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d", - "dst_ref": "ControlPlaneService.stop", - "resolution": "resolved", - "slice_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.stop" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._stop_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 51, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a", - "dst_ref": "ControlPlaneService._stop_async", - "resolution": "resolved", - "slice_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._stop_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager.add_config_file", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 32, - "span_end": 52, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "a23b8a11ebdb12708b60c96ea12a69f7f042082f1adfddd572444e246d81d167", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "57ffbd4f0d9fdf3507c2b8624312ce211f3d02fdf86a57a8ec90778d8a7b498d", - "dst_ref": "RuntimeManager.add_config_file", - "resolution": "resolved", - "slice_id": "a23b8a11ebdb12708b60c96ea12a69f7f042082f1adfddd572444e246d81d167", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager.add_config_file" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "57ffbd4f0d9fdf3507c2b8624312ce211f3d02fdf86a57a8ec90778d8a7b498d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.register_channel", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 17, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957", - "dst_ref": "ControlPlaneService.register_channel", - "resolution": "resolved", - "slice_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.register_channel" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager._register_core_services", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 32, - "span_end": 127, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "3e5811f3b511fa0cabe363f5d01f2ac5fa039bc8b93f7ee108323e1f5f45a293", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "972d6057a6caac9cf31ebc1e29c6f39f71b10d4cc170dec57cf875ba458549c6", - "dst_ref": "RuntimeManager._register_core_services", - "resolution": "resolved", - "slice_id": "3e5811f3b511fa0cabe363f5d01f2ac5fa039bc8b93f7ee108323e1f5f45a293", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager._register_core_services" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "972d6057a6caac9cf31ebc1e29c6f39f71b10d4cc170dec57cf875ba458549c6" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "class RuntimeManager\nRuntimeManager", - "layer": "C1_SYMBOL_CATALOG", - "title": "RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "7e4a9381328c5803bbc6179458612fc4e947d928aa7bf8b4b2bebb2c8592f758", - "qname": "RuntimeManager", - "kind": "class", - "signature": "RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.core.runtime", - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "class RuntimeManager:\n ACTION_TIMEOUT_SECONDS = 10.0\n ACTION_POLL_INTERVAL_SECONDS = 0.05\n\n def __init__(\n self,\n configuration: ConfigurationManager | None = None,\n services: ServiceContainer | None = None,\n traces: TraceService | None = None,\n health: HealthRegistry | None = None,\n logs: LogManager | None = None,\n workers: WorkerSupervisor | None = None,\n control_plane: ControlPlaneService | None = None,\n ) -> None:\n self.configuration = configuration or ConfigurationManager()\n self.services = services or ServiceContainer()\n self.traces = traces or TraceService()\n self.health = health or HealthRegistry()\n self.logs = logs or LogManager()\n self.workers = workers or WorkerSupervisor()\n self.control_plane = control_plane or ControlPlaneService()\n self.registry = ModuleRegistry(self.services)\n self._started = False\n self._state = LifecycleState.IDLE\n self._core_registered = False\n self._workers_registered = False\n self._register_core_services()\n\n def register_module(self, module: ApplicationModule) -> None:\n self.registry.register_module(module.name)\n module.register(self.registry)\n\n def add_config_file(self, path: str) -> FileConfigProvider:\n provider = FileConfigProvider(path)\n self.configuration.add_provider(provider)\n return provider\n\n def start(self, *, start_control_plane: bool = True) -> None:\n if self._started:\n return\n self._state = LifecycleState.STARTING\n config = self.configuration.load()\n self.logs.apply_config(config)\n self._register_health_contributors()\n self._register_workers()\n self.workers.start()\n if start_control_plane:\n self.control_plane.start(self)\n self._started = True\n self._refresh_state()\n\n def stop(self, timeout: float = 30.0, force: bool = False, stop_control_plane: bool = True) -> None:\n if not self._started:\n return\n self._state = LifecycleState.STOPPING\n self.workers.stop(timeout=timeout, force=force)\n if stop_control_plane:\n self.control_plane.stop()\n self._started = False\n self._state = LifecycleState.STOPPED\n\n def status(self) -> dict[str, object]:\n self._refresh_state()\n return self.control_plane.snapshot(self)\n\n def current_health(self) -> HealthPayload:\n self._refresh_state()\n return self.health.payload(self._state, self.workers.healths())\n\n async def health_status(self) -> HealthPayload:\n return self.current_health()\n\n async def start_runtime(self) -> dict[str, object] | str:\n self._refresh_state()\n if self._started:\n return \"runtime already running\"\n if self._state == LifecycleState.STOPPING:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n\n self.start(start_control_plane=False)\n started = self._wait_for_state({LifecycleState.IDLE, LifecycleState.BUSY}, timeout=self.ACTION_TIMEOUT_SECONDS)\n if started:\n return self._action_detail(\"runtime started\", timed_out=False)\n return self._action_detail(\"runtime start is still in progress\", timed_out=True)\n\n async def stop_runtime(self) -> dict[str, object] | str:\n self._refresh_state()\n if not self._started:\n if self._state == LifecycleState.STOPPING:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n return \"runtime already stopped\"\n\n self._state = LifecycleState.STOPPING\n try:\n self.workers.stop(timeout=self.ACTION_TIMEOUT_SECONDS, force=False)\n except TimeoutError:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n\n self._started = False\n self._state = LifecycleState.STOPPED\n return self._action_detail(\"runtime stopped\", timed_out=False)\n\n async def runtime_status(self) -> str:\n self._refresh_state()\n return self._state.value\n\n def _register_core_services(self) -> None:\n if self._core_registered:\n return\n self.services.register(\"configuration\", self.configuration)\n self.services.register(\"traces\", self.traces)\n self.services.register(\"health\", self.health)\n self.services.register(\"logs\", self.logs)\n self.services.register(\"workers\", self.workers)\n self.services.register(\"control_plane\", self.control_plane)\n self._core_registered = True\n\n def _register_health_contributors(self) -> None:\n for contributor in self.registry.health_contributors:\n self.health.register(contributor)\n\n def _register_workers(self) -> None:\n if self._workers_registered:\n return\n for worker in self.registry.workers:\n self.workers.register(worker)\n self._workers_registered = True\n\n def _refresh_state(self) -> None:\n lifecycle = self.workers.lifecycle_state()\n\n if self._state == LifecycleState.STOPPING:\n if lifecycle == LifecycleState.STOPPED:\n self._started = False\n self._state = LifecycleState.STOPPED\n return\n\n if not self._started:\n if lifecycle == LifecycleState.STOPPED:\n self._state = LifecycleState.STOPPED\n return\n\n self._state = lifecycle\n\n def _wait_for_state(self, target_states: set[LifecycleState], *, timeout: float) -> bool:\n deadline = monotonic() + timeout\n while monotonic() < deadline:\n self._refresh_state()\n if self._state in target_states:\n return True\n sleep(self.ACTION_POLL_INTERVAL_SECONDS)\n self._refresh_state()\n return self._state in target_states\n\n def _action_detail(self, message: str, *, timed_out: bool) -> dict[str, object]:\n self._refresh_state()\n return {\n \"message\": message,\n \"state\": self._state.value,\n \"timed_out\": timed_out,\n \"workers\": self.workers.snapshot(),\n }", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/core/runtime.py:RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.core.runtime", - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "llm_answer": "В подсистеме RuntimeManager участвуют следующие компоненты и устанавливаются явные связи между ними:\n\n1. RuntimeManager:\n - Создаёт экземпляры других компонентов и управляет их жизненным циклом.\n - Регистрирует состояние атрибутов системы и его изменения.\n - Вызывает методы для обработки различных событий и состояний внутри системы.\n \n2. ControlActionSet:\n - Получает команды от RuntimeManager и выполняет действия модели на основе этих команд.\n\nСвязи между компонентами:\n- Создает: RuntimeManager создает экземпляр ControlActionSet при своем инициализации.\n- Регистрирует: RuntimeManager отслеживает текущее состояние атрибутов системы и может регистрировать изменения состояния.\n- Передаёт данные: RuntimeManager передает команды и события в ControlActionSet для выполнения соответствующих действий.\n\nГраницы ответственности:\n- RuntimeManager отвечает за координацию работы различных компонентов и управление жизненным циклом всей runtime-подсистемы.\n- ControlActionSet реализует модель поведения приложения и исполняет необходимые операции на основе полученных команд.\n\nЭти наблюдения основаны исключительно на выявленных зависимостях вызовов и зарегистрированных точках входа в коде, а также сигнатур и ролей компонентов.", - "summary": { - "router": { - "intent": "CODE_QA", - "sub_intent": "ARCHITECTURE", - "confidence": null - }, - "retrieval": { - "profile": "code", - "layers_hit": [ - "C0_SOURCE_CHUNKS", - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS", - "C4_SEMANTIC_ROLES" - ], - "evidence_sufficient": true - }, - "llm": { - "answer_status": "answered", - "groundedness": "grounded" - } - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "ARCHITECTURE", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C4_SEMANTIC_ROLES", - "C3_ENTRYPOINTS", - "C2_DEPENDENCY_GRAPH", - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "RuntimeManager" - ], - "keyword_hints": [ - "RuntimeManager" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "execution": { - "executed_layers": [ - "C4_SEMANTIC_ROLES", - "C3_ENTRYPOINTS", - "C2_DEPENDENCY_GRAPH", - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS" - ], - "retrieval_mode_by_layer": { - "C4_SEMANTIC_ROLES": "exact_path_fetch", - "C3_ENTRYPOINTS": "exact_path_fetch", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C1_SYMBOL_CATALOG": "symbol_search", - "C0_SOURCE_CHUNKS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C4_SEMANTIC_ROLES": 12, - "C3_ENTRYPOINTS": 8, - "C2_DEPENDENCY_GRAPH": 8, - "C1_SYMBOL_CATALOG": 6, - "C0_SOURCE_CHUNKS": 4 - }, - "filters_by_layer": { - "C4_SEMANTIC_ROLES": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C1_SYMBOL_CATALOG": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C4_SEMANTIC_ROLES", - "query": "Какие компоненты участвуют в RuntimeManager?", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 12, - "ranking_profile": "code" - }, - { - "layer": "C3_ENTRYPOINTS", - "query": "Какие компоненты участвуют в RuntimeManager?", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "Какие компоненты участвуют в RuntimeManager?", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C1_SYMBOL_CATALOG", - "query": "RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Какие компоненты участвуют в RuntimeManager?", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 4, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C4_SEMANTIC_ROLES", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 12, - "candidates_after_filter": 12 - }, - { - "layer": "C3_ENTRYPOINTS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 3, - "candidates_after_filter": 3 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 1, - "candidates_after_filter": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 4, - "candidates_after_filter": 4 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "RuntimeManager", - "alternatives": [ - "RuntimeManager" - ] - }, - "layers": [ - { - "layer": "C4_SEMANTIC_ROLES", - "status": "hit", - "hit_count": 12, - "fail_reason": null - }, - { - "layer": "C3_ENTRYPOINTS", - "status": "hit", - "hit_count": 3, - "fail_reason": null - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 8, - "fail_reason": null - }, - { - "layer": "C1_SYMBOL_CATALOG", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 1, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "router": 1, - "symbol_resolution": 0, - "retrieval_total": 168, - "retrieval_by_layer": { - "C4_SEMANTIC_ROLES": 41, - "C3_ENTRYPOINTS": 20, - "C2_DEPENDENCY_GRAPH": 64, - "C1_SYMBOL_CATALOG": 25, - "C0_SOURCE_CHUNKS": 16 - }, - "merge_rank": 22, - "prompt_build": 0, - "llm_call": 2183 - }, - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 628, - "evidence_rows": 25, - "evidence_chars": 8651 - }, - "evidence_summary": [ - { - "layer": "C4_SEMANTIC_ROLES", - "count": 12, - "unique_paths": 11 - }, - { - "layer": "C3_ENTRYPOINTS", - "count": 3, - "unique_paths": 1 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "count": 8, - "unique_paths": 2 - }, - { - "layer": "C1_SYMBOL_CATALOG", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 1, - "unique_paths": 1 - } - ], - "prompt_template_id": "intent_code_qa_architecture_ru_v4", - "system_prompt_version": "v1" - }, - "router": { - "conversation_mode": "START", - "keyword_hints": [ - "RuntimeManager" - ], - "path_scope": [] - }, - "llm": { - "used_evidence_count": 25, - "missing_evidence_reason": null - } - }, - "run_info": { - "case_id": "plba-v2-architecture-runtime-manager", - "mode": "full_chain", - "run_started_at": "2026-03-12T14:36:36", - "rag_session_id": "7d11da21-faa0-4cea-aede-aeabe069164c", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - }, - "input_request": { - "text": "Какие компоненты участвуют в RuntimeManager?", - "normalized_query": "Какие компоненты участвуют в RuntimeManager?" - }, - "steps": [ - { - "step": "intent_router", - "input": { - "query": "Какие компоненты участвуют в RuntimeManager?" - }, - "output": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Какие компоненты участвуют в RuntimeManager?" - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "ARCHITECTURE", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C4_SEMANTIC_ROLES", - "C3_ENTRYPOINTS", - "C2_DEPENDENCY_GRAPH", - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "RuntimeManager" - ], - "keyword_hints": [ - "RuntimeManager" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "timings_ms": { - "router": 1 - } - } - }, - { - "step": "retrieval", - "input": { - "query": "Какие компоненты участвуют в RuntimeManager?" - }, - "output": { - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "RuntimeManager", - "alternatives": [ - "RuntimeManager" - ], - "confidence": 0.99 - }, - "rag_count": 25, - "rag_rows": [ - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests manager\n- orchestrates role-like calls (4)\n- reads and writes state attributes\n- participates in dataflow slices (50)", - "layer": "C4_SEMANTIC_ROLES", - "title": "RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 43, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "7e4a9381328c5803bbc6179458612fc4e947d928aa7bf8b4b2bebb2c8592f758", - "symbol_name": "RuntimeManager", - "qname": "RuntimeManager", - "role": "pipeline_stage", - "confidence": 0.67, - "dataflow_participation": 50, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "ControlActionSet\nrole: model\n\nResponsibilities:\n- default model role", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlActionSet", - "span_start": 14, - "span_end": 18, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 40, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "46eb026cb3313415ec47b82dd22f84f4d112c9d987e8b1716dcb0baa1cce8988", - "symbol_name": "ControlActionSet", - "qname": "ControlActionSet", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "ControlChannel\nrole: model\n\nResponsibilities:\n- default model role", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlChannel", - "span_start": 21, - "span_end": 28, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 40, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "cfcfe9a311d3a2dbdaf32ac4ccd73c0eb9a117f830591a1c0867ee97d46204ff", - "symbol_name": "ControlChannel", - "qname": "ControlChannel", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests service\n- reads and writes state attributes\n- participates in dataflow slices (5)", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlPlaneService", - "span_start": 12, - "span_end": 52, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 68, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "b13471e5916986dccffb53fab613812842965705e6b3a89ae549d30c9e91e9aa", - "symbol_name": "ControlPlaneService", - "qname": "ControlPlaneService", - "role": "pipeline_stage", - "confidence": 0.57, - "dataflow_participation": 5, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_runner.py", - "content": "UvicornThreadRunner\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (24)", - "layer": "C4_SEMANTIC_ROLES", - "title": "UvicornThreadRunner", - "span_start": 10, - "span_end": 61, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 11, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "fd55630045a02100df8877ac27d951ee08617d4598764394d48cb51fe067476a", - "symbol_name": "UvicornThreadRunner", - "qname": "UvicornThreadRunner", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 24, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "3779fdd2878b770e789a35bb2a89c9d79f13b61c26d7db1b3b683f9bb9e1623f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (10)", - "layer": "C4_SEMANTIC_ROLES", - "title": "HttpControlChannel", - "span_start": 12, - "span_end": 57, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 21, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "1c9fbdc24819e5604c26ea55428a74310f03a03e1af197ed84846af61e42fdb0", - "symbol_name": "HttpControlChannel", - "qname": "HttpControlChannel", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 10, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "HttpControlAppFactory\nrole: factory\n\nResponsibilities:\n- name suffix suggests factory", - "layer": "C4_SEMANTIC_ROLES", - "title": "HttpControlAppFactory", - "span_start": 15, - "span_end": 53, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 39, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "9b3502a5fb408b273223db13264349cf500de24915b6c649d9ea8970d0dfd8e0", - "symbol_name": "HttpControlAppFactory", - "qname": "HttpControlAppFactory", - "role": "factory", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/persistence/workflow_persistence.py", - "content": "WorkflowPersistence\nrole: pipeline_stage\n\nResponsibilities:\n- orchestrates role-like calls (2)\n- reads and writes state attributes\n- participates in dataflow slices (16)", - "layer": "C4_SEMANTIC_ROLES", - "title": "WorkflowPersistence", - "span_start": 8, - "span_end": 54, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 15, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "7bd01ee45cf31f2d5c2e3e51656254860ac785d10cef9e0852cd4fba90857bae", - "symbol_name": "WorkflowPersistence", - "qname": "WorkflowPersistence", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 16, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "80e9410ddc639789b4353c2a1a757ba8d0d5b5bb6075b0b263b61551f04ae1f0", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/queue/in_memory.py", - "content": "InMemoryTaskQueue\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (9)", - "layer": "C4_SEMANTIC_ROLES", - "title": "InMemoryTaskQueue", - "span_start": 9, - "span_end": 38, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 22, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "2da04cb94544a3bcbf0943a95ad4bdd8710bcafaa32a02fd0e4de2178dcf3533", - "symbol_name": "InMemoryTaskQueue", - "qname": "InMemoryTaskQueue", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 9, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "58f0cc001ccda0eee4c6bc32ed83bd05eafd6b6644f1e8b4aa9eed3103db73dc", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/config/file_loader.py", - "content": "ConfigFileLoader\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (8)", - "layer": "C4_SEMANTIC_ROLES", - "title": "ConfigFileLoader", - "span_start": 11, - "span_end": 48, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 23, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "a8474eca8b6e9dc86ae67ed68b16fa5fb639ef08739c053e7b7195489765667f", - "symbol_name": "ConfigFileLoader", - "qname": "ConfigFileLoader", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 8, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "1f19ffebde5e38e4be5a5d5a678059a0f36dedb8fb8b3e00ab395c67106a87ea", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/store.py", - "content": "TraceContextStore\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (6)", - "layer": "C4_SEMANTIC_ROLES", - "title": "TraceContextStore", - "span_start": 15, - "span_end": 52, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 25, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "b2dad4fbe16ffb11b58deba311c7739955c39d59f291b22181f33e9c8cce4059", - "symbol_name": "TraceContextStore", - "qname": "TraceContextStore", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 6, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "d369554f08fc92039c6edd5a2a1e73b23901533e8974459170bbd9347d263dc5", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workers/supervisor.py", - "content": "WorkerSupervisor\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (6)", - "layer": "C4_SEMANTIC_ROLES", - "title": "WorkerSupervisor", - "span_start": 10, - "span_end": 59, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 25, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "c17b44e8d9e97d490989b21fa67d7c346cdda8a0472e4c41fb243c8846faa124", - "symbol_name": "WorkerSupervisor", - "qname": "WorkerSupervisor", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 6, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "77609d9d5927171cce7fc3a54897c183fd63068710c6362029b700937aae5eee", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._start_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 47, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517", - "dst_ref": "ControlPlaneService._start_async", - "resolution": "resolved", - "slice_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._start_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager.start", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 32, - "span_end": 59, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "98312ace7fc62b1c7194c5aa1732b6ef736eae1668a3a120dd1ecd5ab1d64f7a", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "77a7b260193018845e4e204df094ab89cfd7c82ee4e822b3a83ad4cd945f9cb1", - "dst_ref": "RuntimeManager.start", - "resolution": "resolved", - "slice_id": "98312ace7fc62b1c7194c5aa1732b6ef736eae1668a3a120dd1ecd5ab1d64f7a", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager.start" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "77a7b260193018845e4e204df094ab89cfd7c82ee4e822b3a83ad4cd945f9cb1" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.start", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 20, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154", - "dst_ref": "ControlPlaneService.start", - "resolution": "resolved", - "slice_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.start" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.stop", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 25, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d", - "dst_ref": "ControlPlaneService.stop", - "resolution": "resolved", - "slice_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.stop" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._stop_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 51, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a", - "dst_ref": "ControlPlaneService._stop_async", - "resolution": "resolved", - "slice_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._stop_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager.add_config_file", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 32, - "span_end": 52, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "a23b8a11ebdb12708b60c96ea12a69f7f042082f1adfddd572444e246d81d167", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "57ffbd4f0d9fdf3507c2b8624312ce211f3d02fdf86a57a8ec90778d8a7b498d", - "dst_ref": "RuntimeManager.add_config_file", - "resolution": "resolved", - "slice_id": "a23b8a11ebdb12708b60c96ea12a69f7f042082f1adfddd572444e246d81d167", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager.add_config_file" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "57ffbd4f0d9fdf3507c2b8624312ce211f3d02fdf86a57a8ec90778d8a7b498d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.register_channel", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 17, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957", - "dst_ref": "ControlPlaneService.register_channel", - "resolution": "resolved", - "slice_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.register_channel" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager._register_core_services", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 32, - "span_end": 127, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "3e5811f3b511fa0cabe363f5d01f2ac5fa039bc8b93f7ee108323e1f5f45a293", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "972d6057a6caac9cf31ebc1e29c6f39f71b10d4cc170dec57cf875ba458549c6", - "dst_ref": "RuntimeManager._register_core_services", - "resolution": "resolved", - "slice_id": "3e5811f3b511fa0cabe363f5d01f2ac5fa039bc8b93f7ee108323e1f5f45a293", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager._register_core_services" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "972d6057a6caac9cf31ebc1e29c6f39f71b10d4cc170dec57cf875ba458549c6" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "class RuntimeManager\nRuntimeManager", - "layer": "C1_SYMBOL_CATALOG", - "title": "RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "7e4a9381328c5803bbc6179458612fc4e947d928aa7bf8b4b2bebb2c8592f758", - "qname": "RuntimeManager", - "kind": "class", - "signature": "RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.core.runtime", - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "class RuntimeManager:\n ACTION_TIMEOUT_SECONDS = 10.0\n ACTION_POLL_INTERVAL_SECONDS = 0.05\n\n def __init__(\n self,\n configuration: ConfigurationManager | None = None,\n services: ServiceContainer | None = None,\n traces: TraceService | None = None,\n health: HealthRegistry | None = None,\n logs: LogManager | None = None,\n workers: WorkerSupervisor | None = None,\n control_plane: ControlPlaneService | None = None,\n ) -> None:\n self.configuration = configuration or ConfigurationManager()\n self.services = services or ServiceContainer()\n self.traces = traces or TraceService()\n self.health = health or HealthRegistry()\n self.logs = logs or LogManager()\n self.workers = workers or WorkerSupervisor()\n self.control_plane = control_plane or ControlPlaneService()\n self.registry = ModuleRegistry(self.services)\n self._started = False\n self._state = LifecycleState.IDLE\n self._core_registered = False\n self._workers_registered = False\n self._register_core_services()\n\n def register_module(self, module: ApplicationModule) -> None:\n self.registry.register_module(module.name)\n module.register(self.registry)\n\n def add_config_file(self, path: str) -> FileConfigProvider:\n provider = FileConfigProvider(path)\n self.configuration.add_provider(provider)\n return provider\n\n def start(self, *, start_control_plane: bool = True) -> None:\n if self._started:\n return\n self._state = LifecycleState.STARTING\n config = self.configuration.load()\n self.logs.apply_config(config)\n self._register_health_contributors()\n self._register_workers()\n self.workers.start()\n if start_control_plane:\n self.control_plane.start(self)\n self._started = True\n self._refresh_state()\n\n def stop(self, timeout: float = 30.0, force: bool = False, stop_control_plane: bool = True) -> None:\n if not self._started:\n return\n self._state = LifecycleState.STOPPING\n self.workers.stop(timeout=timeout, force=force)\n if stop_control_plane:\n self.control_plane.stop()\n self._started = False\n self._state = LifecycleState.STOPPED\n\n def status(self) -> dict[str, object]:\n self._refresh_state()\n return self.control_plane.snapshot(self)\n\n def current_health(self) -> HealthPayload:\n self._refresh_state()\n return self.health.payload(self._state, self.workers.healths())\n\n async def health_status(self) -> HealthPayload:\n return self.current_health()\n\n async def start_runtime(self) -> dict[str, object] | str:\n self._refresh_state()\n if self._started:\n return \"runtime already running\"\n if self._state == LifecycleState.STOPPING:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n\n self.start(start_control_plane=False)\n started = self._wait_for_state({LifecycleState.IDLE, LifecycleState.BUSY}, timeout=self.ACTION_TIMEOUT_SECONDS)\n if started:\n return self._action_detail(\"runtime started\", timed_out=False)\n return self._action_detail(\"runtime start is still in progress\", timed_out=True)\n\n async def stop_runtime(self) -> dict[str, object] | str:\n self._refresh_state()\n if not self._started:\n if self._state == LifecycleState.STOPPING:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n return \"runtime already stopped\"\n\n self._state = LifecycleState.STOPPING\n try:\n self.workers.stop(timeout=self.ACTION_TIMEOUT_SECONDS, force=False)\n except TimeoutError:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n\n self._started = False\n self._state = LifecycleState.STOPPED\n return self._action_detail(\"runtime stopped\", timed_out=False)\n\n async def runtime_status(self) -> str:\n self._refresh_state()\n return self._state.value\n\n def _register_core_services(self) -> None:\n if self._core_registered:\n return\n self.services.register(\"configuration\", self.configuration)\n self.services.register(\"traces\", self.traces)\n self.services.register(\"health\", self.health)\n self.services.register(\"logs\", self.logs)\n self.services.register(\"workers\", self.workers)\n self.services.register(\"control_plane\", self.control_plane)\n self._core_registered = True\n\n def _register_health_contributors(self) -> None:\n for contributor in self.registry.health_contributors:\n self.health.register(contributor)\n\n def _register_workers(self) -> None:\n if self._workers_registered:\n return\n for worker in self.registry.workers:\n self.workers.register(worker)\n self._workers_registered = True\n\n def _refresh_state(self) -> None:\n lifecycle = self.workers.lifecycle_state()\n\n if self._state == LifecycleState.STOPPING:\n if lifecycle == LifecycleState.STOPPED:\n self._started = False\n self._state = LifecycleState.STOPPED\n return\n\n if not self._started:\n if lifecycle == LifecycleState.STOPPED:\n self._state = LifecycleState.STOPPED\n return\n\n self._state = lifecycle\n\n def _wait_for_state(self, target_states: set[LifecycleState], *, timeout: float) -> bool:\n deadline = monotonic() + timeout\n while monotonic() < deadline:\n self._refresh_state()\n if self._state in target_states:\n return True\n sleep(self.ACTION_POLL_INTERVAL_SECONDS)\n self._refresh_state()\n return self._state in target_states\n\n def _action_detail(self, message: str, *, timed_out: bool) -> dict[str, object]:\n self._refresh_state()\n return {\n \"message\": message,\n \"state\": self._state.value,\n \"timed_out\": timed_out,\n \"workers\": self.workers.snapshot(),\n }", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/core/runtime.py:RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.core.runtime", - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ] - }, - "diagnostics": { - "execution": { - "executed_layers": [ - "C4_SEMANTIC_ROLES", - "C3_ENTRYPOINTS", - "C2_DEPENDENCY_GRAPH", - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS" - ], - "retrieval_mode_by_layer": { - "C4_SEMANTIC_ROLES": "exact_path_fetch", - "C3_ENTRYPOINTS": "exact_path_fetch", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C1_SYMBOL_CATALOG": "symbol_search", - "C0_SOURCE_CHUNKS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C4_SEMANTIC_ROLES": 12, - "C3_ENTRYPOINTS": 8, - "C2_DEPENDENCY_GRAPH": 8, - "C1_SYMBOL_CATALOG": 6, - "C0_SOURCE_CHUNKS": 4 - }, - "filters_by_layer": { - "C4_SEMANTIC_ROLES": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C1_SYMBOL_CATALOG": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C4_SEMANTIC_ROLES", - "query": "Какие компоненты участвуют в RuntimeManager?", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 12, - "ranking_profile": "code" - }, - { - "layer": "C3_ENTRYPOINTS", - "query": "Какие компоненты участвуют в RuntimeManager?", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "Какие компоненты участвуют в RuntimeManager?", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C1_SYMBOL_CATALOG", - "query": "RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Какие компоненты участвуют в RuntimeManager?", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 4, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C4_SEMANTIC_ROLES", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 12, - "candidates_after_filter": 12 - }, - { - "layer": "C3_ENTRYPOINTS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 3, - "candidates_after_filter": 3 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 1, - "candidates_after_filter": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 4, - "candidates_after_filter": 4 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "RuntimeManager", - "alternatives": [ - "RuntimeManager" - ] - }, - "layers": [ - { - "layer": "C4_SEMANTIC_ROLES", - "status": "hit", - "hit_count": 12, - "fail_reason": null - }, - { - "layer": "C3_ENTRYPOINTS", - "status": "hit", - "hit_count": 3, - "fail_reason": null - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 8, - "fail_reason": null - }, - { - "layer": "C1_SYMBOL_CATALOG", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 1, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "symbol_resolution": 0, - "retrieval_total": 168, - "retrieval_by_layer": { - "C4_SEMANTIC_ROLES": 41, - "C3_ENTRYPOINTS": 20, - "C2_DEPENDENCY_GRAPH": 64, - "C1_SYMBOL_CATALOG": 25, - "C0_SOURCE_CHUNKS": 16 - }, - "merge_rank": 22 - } - } - }, - { - "step": "llm_answer", - "input": { - "query": "Какие компоненты участвуют в RuntimeManager?", - "rag_count": 25 - }, - "output": { - "llm_answer": "В подсистеме RuntimeManager участвуют следующие компоненты и устанавливаются явные связи между ними:\n\n1. RuntimeManager:\n - Создаёт экземпляры других компонентов и управляет их жизненным циклом.\n - Регистрирует состояние атрибутов системы и его изменения.\n - Вызывает методы для обработки различных событий и состояний внутри системы.\n \n2. ControlActionSet:\n - Получает команды от RuntimeManager и выполняет действия модели на основе этих команд.\n\nСвязи между компонентами:\n- Создает: RuntimeManager создает экземпляр ControlActionSet при своем инициализации.\n- Регистрирует: RuntimeManager отслеживает текущее состояние атрибутов системы и может регистрировать изменения состояния.\n- Передаёт данные: RuntimeManager передает команды и события в ControlActionSet для выполнения соответствующих действий.\n\nГраницы ответственности:\n- RuntimeManager отвечает за координацию работы различных компонентов и управление жизненным циклом всей runtime-подсистемы.\n- ControlActionSet реализует модель поведения приложения и исполняет необходимые операции на основе полученных команд.\n\nЭти наблюдения основаны исключительно на выявленных зависимостях вызовов и зарегистрированных точках входа в коде, а также сигнатур и ролей компонентов." - }, - "diagnostics": { - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 628, - "evidence_rows": 25, - "evidence_chars": 8651 - }, - "evidence_summary": [ - { - "layer": "C4_SEMANTIC_ROLES", - "count": 12, - "unique_paths": 11 - }, - { - "layer": "C3_ENTRYPOINTS", - "count": 3, - "unique_paths": 1 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "count": 8, - "unique_paths": 2 - }, - { - "layer": "C1_SYMBOL_CATALOG", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 1, - "unique_paths": 1 - } - ], - "prompt_template_id": "intent_code_qa_architecture_ru_v4", - "system_prompt_version": "v1" - }, - "timings_ms": { - "prompt_build": 0, - "llm_call": 2183 - } - } - } - ] - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_143636/full_chain_plba_code_subintents_v2_plba-v2-architecture-runtime-manager.md b/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_143636/full_chain_plba_code_subintents_v2_plba-v2-architecture-runtime-manager.md deleted file mode 100644 index 67fb0d9..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_143636/full_chain_plba_code_subintents_v2_plba-v2-architecture-runtime-manager.md +++ /dev/null @@ -1,34 +0,0 @@ -# plba-v2-architecture-runtime-manager - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_subintents_v2.yaml -- runner: runtime -- mode: full_chain -- passed: True - -## Query -Какие компоненты участвуют в RuntimeManager? - -## Actual -{ - "intent": "CODE_QA", - "sub_intent": "ARCHITECTURE", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 25, - "llm_answer": "В подсистеме RuntimeManager участвуют следующие компоненты и устанавливаются явные связи между ними:\n\n1. RuntimeManager:\n - Создаёт экземпляры других компонентов и управляет их жизненным циклом.\n - Регистрирует состояние атрибутов системы и его изменения.\n - Вызывает методы для обработки различных событий и состояний внутри системы.\n \n2. ControlActionSet:\n - Получает команды от RuntimeManager и выполняет действия модели на основе этих команд.\n\nСвязи между компонентами:\n- Создает: RuntimeManager создает экземпляр ControlActionSet при своем инициализации.\n- Регистрирует: RuntimeManager отслеживает текущее состояние атрибутов системы и может регистрировать изменения состояния.\n- Передаёт данные: RuntimeManager передает команды и события в ControlActionSet для выполнения соответствующих действий.\n\nГраницы ответственности:\n- RuntimeManager отвечает за координацию работы различных компонентов и управление жизненным циклом всей runtime-подсистемы.\n- ControlActionSet реализует модель поведения приложения и исполняет необходимые операции на основе полученных команд.\n\nЭти наблюдения основаны исключительно на выявленных зависимостях вызовов и зарегистрированных точках входа в коде, а также сигнатур и ролей компонентов.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "RuntimeManager" - ], - "layers": [ - "C4_SEMANTIC_ROLES", - "C3_ENTRYPOINTS", - "C2_DEPENDENCY_GRAPH", - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS" - ] -} - -## Mismatches -- none \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_143636/full_chain_plba_code_subintents_v2_plba-v2-explain-create-runtime.json b/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_143636/full_chain_plba_code_subintents_v2_plba-v2-explain-create-runtime.json deleted file mode 100644 index 9762172..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_143636/full_chain_plba_code_subintents_v2_plba-v2-explain-create-runtime.json +++ /dev/null @@ -1,1896 +0,0 @@ -{ - "case_id": "plba-v2-explain-create-runtime", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_subintents_v2.yaml", - "runner": "runtime", - "mode": "full_chain", - "actual": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 12, - "llm_answer": "Функция `create_runtime` находится в файле `src/plba/bootstrap.py`. Она отвечает за инициализацию и настройку основного объекта управления (`RuntimeManager`), используемого для координации различных компонентов приложения.\n\nКонкретно, эта функция выполняет следующие действия:\n\n1. Создаёт новый объект типа `RuntimeManager`.\n2. При наличии указанного пути к конфигурационному файлу добавляет этот файл в runtime при помощи вызова метода `runtime.add_config_file()`.\n3. Если указано включение HTTP-контроля, регистрирует канал управления через класс `HttpControlChannel`, указывая параметры хоста, порта и тайм-аута.\n4. Регистрирует переданный модуль приложения (`module`) в runtime посредством вызова `runtime.register_module()`.\n5. Возвращает созданный экземпляр `RuntimeManager`.\n\nТаким образом, основная цель функции – настройка базовой инфраструктуры приложения, включая загрузку конфигурации и регистрацию модуля приложения, после чего возвращая готовый объект управления, позволяющий дальше управлять работой всех компонент системы.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "create_runtime" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "passed": true, - "mismatches": [], - "details": { - "case_id": "plba-v2-explain-create-runtime", - "text": "Что делает функция create_runtime?", - "mode": "full_chain", - "run_started_at": "2026-03-12T14:36:36", - "rag_session_id": "7d11da21-faa0-4cea-aede-aeabe069164c", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Что делает функция create_runtime?", - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "create_runtime", - "alternatives": [ - "create_runtime" - ], - "confidence": 0.99 - }, - "rag_count": 12, - "rag_rows": [ - { - "path": "src/plba/bootstrap.py", - "content": "function create_runtime\ncreate_runtime(module)", - "layer": "C1_SYMBOL_CATALOG", - "title": "create_runtime", - "span_start": 8, - "span_end": 29, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "qname": "create_runtime", - "kind": "function", - "signature": "create_runtime(module)", - "parent_symbol_id": null, - "package_or_module": "src.plba.bootstrap", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_runner.py", - "content": "UvicornThreadRunner\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (24)", - "layer": "C4_SEMANTIC_ROLES", - "title": "UvicornThreadRunner", - "span_start": 10, - "span_end": 61, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 11, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "fd55630045a02100df8877ac27d951ee08617d4598764394d48cb51fe067476a", - "symbol_name": "UvicornThreadRunner", - "qname": "UvicornThreadRunner", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 24, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "3779fdd2878b770e789a35bb2a89c9d79f13b61c26d7db1b3b683f9bb9e1623f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/bootstrap.py", - "content": "create_runtime calls runtime.add_config_file", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "create_runtime:calls", - "span_start": 19, - "span_end": 19, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "4eaeec4ac55a59d5f66fd01c4754955f8fedaf4bc3df13fa769b352c7bfaacbb", - "edge_type": "calls", - "src_symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "src_qname": "create_runtime", - "dst_symbol_id": null, - "dst_ref": "runtime.add_config_file", - "resolution": "partial", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/bootstrap.py", - "content": "create_runtime reads_attr runtime.register_module", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "create_runtime:reads_attr", - "span_start": 28, - "span_end": 28, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "45516c79ff358dbf9b650a081668df0f66d2fe989300f985a1a78be6be166f8f", - "edge_type": "reads_attr", - "src_symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "src_qname": "create_runtime", - "dst_symbol_id": null, - "dst_ref": "runtime.register_module", - "resolution": "partial", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/bootstrap.py", - "content": "create_runtime instantiates RuntimeManager", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "create_runtime:instantiates", - "span_start": 17, - "span_end": 17, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "0adba17984f850ea1608c9e734d2dd5c325cfde3a8133123aa239e44935ad18e", - "edge_type": "instantiates", - "src_symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "src_qname": "create_runtime", - "dst_symbol_id": "27158ca220022eeb5083c6addf8a50775d45f7161284fd60aac48410105f4b98", - "dst_ref": "RuntimeManager", - "resolution": "resolved", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/bootstrap.py", - "content": "create_runtime calls runtime.register_module", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "create_runtime:calls", - "span_start": 28, - "span_end": 28, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "ab6003c3441addc1ba1b81edeca009165559f652f6b2cf424e5ae61b1f617de8", - "edge_type": "calls", - "src_symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "src_qname": "create_runtime", - "dst_symbol_id": null, - "dst_ref": "runtime.register_module", - "resolution": "partial", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/bootstrap.py", - "content": "create_runtime calls runtime.control_plane.register_channel", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "create_runtime:calls", - "span_start": 21, - "span_end": 27, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "2678250030b9ce47a3b3b55fac7897ac530367edc8374ac9d5e6ecafb1e483f0", - "edge_type": "calls", - "src_symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "src_qname": "create_runtime", - "dst_symbol_id": null, - "dst_ref": "runtime.control_plane.register_channel", - "resolution": "partial", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/bootstrap.py", - "content": "create_runtime reads_attr runtime.add_config_file", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "create_runtime:reads_attr", - "span_start": 19, - "span_end": 19, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "30d4e8aae984ab84d523e80d02f1caeda52d547fa3d2aa47be8845931cabbca2", - "edge_type": "reads_attr", - "src_symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "src_qname": "create_runtime", - "dst_symbol_id": null, - "dst_ref": "runtime.add_config_file", - "resolution": "partial", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/bootstrap.py", - "content": "def create_runtime(\n module: ApplicationModule,\n *,\n config_path: str | None = None,\n enable_http_control: bool = False,\n control_host: str = \"127.0.0.1\",\n control_port: int = 8080,\n control_timeout: int = 5,\n) -> RuntimeManager:\n runtime = RuntimeManager()\n if config_path is not None:\n runtime.add_config_file(config_path)\n if enable_http_control:\n runtime.control_plane.register_channel(\n HttpControlChannel(\n host=control_host,\n port=control_port,\n timeout=control_timeout,\n )\n )\n runtime.register_module(module)\n return runtime", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/plba/bootstrap.py:create_runtime", - "span_start": 8, - "span_end": 29, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.plba.bootstrap", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "llm_answer": "Функция `create_runtime` находится в файле `src/plba/bootstrap.py`. Она отвечает за инициализацию и настройку основного объекта управления (`RuntimeManager`), используемого для координации различных компонентов приложения.\n\nКонкретно, эта функция выполняет следующие действия:\n\n1. Создаёт новый объект типа `RuntimeManager`.\n2. При наличии указанного пути к конфигурационному файлу добавляет этот файл в runtime при помощи вызова метода `runtime.add_config_file()`.\n3. Если указано включение HTTP-контроля, регистрирует канал управления через класс `HttpControlChannel`, указывая параметры хоста, порта и тайм-аута.\n4. Регистрирует переданный модуль приложения (`module`) в runtime посредством вызова `runtime.register_module()`.\n5. Возвращает созданный экземпляр `RuntimeManager`.\n\nТаким образом, основная цель функции – настройка базовой инфраструктуры приложения, включая загрузку конфигурации и регистрацию модуля приложения, после чего возвращая готовый объект управления, позволяющий дальше управлять работой всех компонент системы.", - "summary": { - "router": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "confidence": null - }, - "retrieval": { - "profile": "code", - "layers_hit": [ - "C0_SOURCE_CHUNKS", - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS", - "C4_SEMANTIC_ROLES" - ], - "evidence_sufficient": true - }, - "llm": { - "answer_status": "answered", - "groundedness": "grounded" - } - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "symbol_kind_hint": "function", - "symbol_candidates": [ - "create_runtime" - ], - "keyword_hints": [ - "create_runtime" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C0_SOURCE_CHUNKS": "exact_path_fetch", - "C4_SEMANTIC_ROLES": "exact_path_fetch", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C3_ENTRYPOINTS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 8, - "C4_SEMANTIC_ROLES": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C3_ENTRYPOINTS": 6 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C4_SEMANTIC_ROLES": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "create_runtime", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "create_runtime", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C4_SEMANTIC_ROLES", - "query": "create_runtime", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "create_runtime", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - }, - { - "layer": "C3_ENTRYPOINTS", - "query": "create_runtime", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 1, - "candidates_after_filter": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 6, - "candidates_after_filter": 6 - }, - { - "layer": "C3_ENTRYPOINTS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 3, - "candidates_after_filter": 3 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "create_runtime", - "alternatives": [ - "create_runtime" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C4_SEMANTIC_ROLES", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 6, - "fail_reason": null - }, - { - "layer": "C3_ENTRYPOINTS", - "status": "hit", - "hit_count": 3, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "router": 0, - "symbol_resolution": 0, - "retrieval_total": 115, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 31, - "C0_SOURCE_CHUNKS": 14, - "C4_SEMANTIC_ROLES": 15, - "C2_DEPENDENCY_GRAPH": 43, - "C3_ENTRYPOINTS": 10 - }, - "merge_rank": 20, - "prompt_build": 0, - "llm_call": 1571 - }, - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 723, - "evidence_rows": 12, - "evidence_chars": 1184 - }, - "evidence_summary": [ - { - "layer": "C1_SYMBOL_CATALOG", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "count": 6, - "unique_paths": 1 - }, - { - "layer": "C3_ENTRYPOINTS", - "count": 3, - "unique_paths": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 1, - "unique_paths": 1 - } - ], - "prompt_template_id": "intent_code_qa_explain_ru_v4", - "system_prompt_version": "v1" - }, - "router": { - "conversation_mode": "START", - "keyword_hints": [ - "create_runtime" - ], - "path_scope": [] - }, - "llm": { - "used_evidence_count": 12, - "missing_evidence_reason": null - } - }, - "run_info": { - "case_id": "plba-v2-explain-create-runtime", - "mode": "full_chain", - "run_started_at": "2026-03-12T14:36:36", - "rag_session_id": "7d11da21-faa0-4cea-aede-aeabe069164c", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - }, - "input_request": { - "text": "Что делает функция create_runtime?", - "normalized_query": "Что делает функция create_runtime?" - }, - "steps": [ - { - "step": "intent_router", - "input": { - "query": "Что делает функция create_runtime?" - }, - "output": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Что делает функция create_runtime?" - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "symbol_kind_hint": "function", - "symbol_candidates": [ - "create_runtime" - ], - "keyword_hints": [ - "create_runtime" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "timings_ms": { - "router": 0 - } - } - }, - { - "step": "retrieval", - "input": { - "query": "Что делает функция create_runtime?" - }, - "output": { - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "create_runtime", - "alternatives": [ - "create_runtime" - ], - "confidence": 0.99 - }, - "rag_count": 12, - "rag_rows": [ - { - "path": "src/plba/bootstrap.py", - "content": "function create_runtime\ncreate_runtime(module)", - "layer": "C1_SYMBOL_CATALOG", - "title": "create_runtime", - "span_start": 8, - "span_end": 29, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "qname": "create_runtime", - "kind": "function", - "signature": "create_runtime(module)", - "parent_symbol_id": null, - "package_or_module": "src.plba.bootstrap", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_runner.py", - "content": "UvicornThreadRunner\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (24)", - "layer": "C4_SEMANTIC_ROLES", - "title": "UvicornThreadRunner", - "span_start": 10, - "span_end": 61, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 11, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "fd55630045a02100df8877ac27d951ee08617d4598764394d48cb51fe067476a", - "symbol_name": "UvicornThreadRunner", - "qname": "UvicornThreadRunner", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 24, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "3779fdd2878b770e789a35bb2a89c9d79f13b61c26d7db1b3b683f9bb9e1623f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/bootstrap.py", - "content": "create_runtime calls runtime.add_config_file", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "create_runtime:calls", - "span_start": 19, - "span_end": 19, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "4eaeec4ac55a59d5f66fd01c4754955f8fedaf4bc3df13fa769b352c7bfaacbb", - "edge_type": "calls", - "src_symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "src_qname": "create_runtime", - "dst_symbol_id": null, - "dst_ref": "runtime.add_config_file", - "resolution": "partial", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/bootstrap.py", - "content": "create_runtime reads_attr runtime.register_module", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "create_runtime:reads_attr", - "span_start": 28, - "span_end": 28, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "45516c79ff358dbf9b650a081668df0f66d2fe989300f985a1a78be6be166f8f", - "edge_type": "reads_attr", - "src_symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "src_qname": "create_runtime", - "dst_symbol_id": null, - "dst_ref": "runtime.register_module", - "resolution": "partial", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/bootstrap.py", - "content": "create_runtime instantiates RuntimeManager", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "create_runtime:instantiates", - "span_start": 17, - "span_end": 17, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "0adba17984f850ea1608c9e734d2dd5c325cfde3a8133123aa239e44935ad18e", - "edge_type": "instantiates", - "src_symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "src_qname": "create_runtime", - "dst_symbol_id": "27158ca220022eeb5083c6addf8a50775d45f7161284fd60aac48410105f4b98", - "dst_ref": "RuntimeManager", - "resolution": "resolved", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/bootstrap.py", - "content": "create_runtime calls runtime.register_module", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "create_runtime:calls", - "span_start": 28, - "span_end": 28, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "ab6003c3441addc1ba1b81edeca009165559f652f6b2cf424e5ae61b1f617de8", - "edge_type": "calls", - "src_symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "src_qname": "create_runtime", - "dst_symbol_id": null, - "dst_ref": "runtime.register_module", - "resolution": "partial", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/bootstrap.py", - "content": "create_runtime calls runtime.control_plane.register_channel", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "create_runtime:calls", - "span_start": 21, - "span_end": 27, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "2678250030b9ce47a3b3b55fac7897ac530367edc8374ac9d5e6ecafb1e483f0", - "edge_type": "calls", - "src_symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "src_qname": "create_runtime", - "dst_symbol_id": null, - "dst_ref": "runtime.control_plane.register_channel", - "resolution": "partial", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/bootstrap.py", - "content": "create_runtime reads_attr runtime.add_config_file", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "create_runtime:reads_attr", - "span_start": 19, - "span_end": 19, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "30d4e8aae984ab84d523e80d02f1caeda52d547fa3d2aa47be8845931cabbca2", - "edge_type": "reads_attr", - "src_symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "src_qname": "create_runtime", - "dst_symbol_id": null, - "dst_ref": "runtime.add_config_file", - "resolution": "partial", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/bootstrap.py", - "content": "def create_runtime(\n module: ApplicationModule,\n *,\n config_path: str | None = None,\n enable_http_control: bool = False,\n control_host: str = \"127.0.0.1\",\n control_port: int = 8080,\n control_timeout: int = 5,\n) -> RuntimeManager:\n runtime = RuntimeManager()\n if config_path is not None:\n runtime.add_config_file(config_path)\n if enable_http_control:\n runtime.control_plane.register_channel(\n HttpControlChannel(\n host=control_host,\n port=control_port,\n timeout=control_timeout,\n )\n )\n runtime.register_module(module)\n return runtime", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/plba/bootstrap.py:create_runtime", - "span_start": 8, - "span_end": 29, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.plba.bootstrap", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ] - }, - "diagnostics": { - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C0_SOURCE_CHUNKS": "exact_path_fetch", - "C4_SEMANTIC_ROLES": "exact_path_fetch", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C3_ENTRYPOINTS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 8, - "C4_SEMANTIC_ROLES": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C3_ENTRYPOINTS": 6 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C4_SEMANTIC_ROLES": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "create_runtime", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "create_runtime", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C4_SEMANTIC_ROLES", - "query": "create_runtime", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "create_runtime", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - }, - { - "layer": "C3_ENTRYPOINTS", - "query": "create_runtime", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 1, - "candidates_after_filter": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 6, - "candidates_after_filter": 6 - }, - { - "layer": "C3_ENTRYPOINTS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 3, - "candidates_after_filter": 3 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "create_runtime", - "alternatives": [ - "create_runtime" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C4_SEMANTIC_ROLES", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 6, - "fail_reason": null - }, - { - "layer": "C3_ENTRYPOINTS", - "status": "hit", - "hit_count": 3, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "symbol_resolution": 0, - "retrieval_total": 115, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 31, - "C0_SOURCE_CHUNKS": 14, - "C4_SEMANTIC_ROLES": 15, - "C2_DEPENDENCY_GRAPH": 43, - "C3_ENTRYPOINTS": 10 - }, - "merge_rank": 20 - } - } - }, - { - "step": "llm_answer", - "input": { - "query": "Что делает функция create_runtime?", - "rag_count": 12 - }, - "output": { - "llm_answer": "Функция `create_runtime` находится в файле `src/plba/bootstrap.py`. Она отвечает за инициализацию и настройку основного объекта управления (`RuntimeManager`), используемого для координации различных компонентов приложения.\n\nКонкретно, эта функция выполняет следующие действия:\n\n1. Создаёт новый объект типа `RuntimeManager`.\n2. При наличии указанного пути к конфигурационному файлу добавляет этот файл в runtime при помощи вызова метода `runtime.add_config_file()`.\n3. Если указано включение HTTP-контроля, регистрирует канал управления через класс `HttpControlChannel`, указывая параметры хоста, порта и тайм-аута.\n4. Регистрирует переданный модуль приложения (`module`) в runtime посредством вызова `runtime.register_module()`.\n5. Возвращает созданный экземпляр `RuntimeManager`.\n\nТаким образом, основная цель функции – настройка базовой инфраструктуры приложения, включая загрузку конфигурации и регистрацию модуля приложения, после чего возвращая готовый объект управления, позволяющий дальше управлять работой всех компонент системы." - }, - "diagnostics": { - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 723, - "evidence_rows": 12, - "evidence_chars": 1184 - }, - "evidence_summary": [ - { - "layer": "C1_SYMBOL_CATALOG", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "count": 6, - "unique_paths": 1 - }, - { - "layer": "C3_ENTRYPOINTS", - "count": 3, - "unique_paths": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 1, - "unique_paths": 1 - } - ], - "prompt_template_id": "intent_code_qa_explain_ru_v4", - "system_prompt_version": "v1" - }, - "timings_ms": { - "prompt_build": 0, - "llm_call": 1571 - } - } - } - ] - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_143636/full_chain_plba_code_subintents_v2_plba-v2-explain-create-runtime.md b/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_143636/full_chain_plba_code_subintents_v2_plba-v2-explain-create-runtime.md deleted file mode 100644 index a36bb33..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_143636/full_chain_plba_code_subintents_v2_plba-v2-explain-create-runtime.md +++ /dev/null @@ -1,34 +0,0 @@ -# plba-v2-explain-create-runtime - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_subintents_v2.yaml -- runner: runtime -- mode: full_chain -- passed: True - -## Query -Что делает функция create_runtime? - -## Actual -{ - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 12, - "llm_answer": "Функция `create_runtime` находится в файле `src/plba/bootstrap.py`. Она отвечает за инициализацию и настройку основного объекта управления (`RuntimeManager`), используемого для координации различных компонентов приложения.\n\nКонкретно, эта функция выполняет следующие действия:\n\n1. Создаёт новый объект типа `RuntimeManager`.\n2. При наличии указанного пути к конфигурационному файлу добавляет этот файл в runtime при помощи вызова метода `runtime.add_config_file()`.\n3. Если указано включение HTTP-контроля, регистрирует канал управления через класс `HttpControlChannel`, указывая параметры хоста, порта и тайм-аута.\n4. Регистрирует переданный модуль приложения (`module`) в runtime посредством вызова `runtime.register_module()`.\n5. Возвращает созданный экземпляр `RuntimeManager`.\n\nТаким образом, основная цель функции – настройка базовой инфраструктуры приложения, включая загрузку конфигурации и регистрацию модуля приложения, после чего возвращая готовый объект управления, позволяющий дальше управлять работой всех компонент системы.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "create_runtime" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] -} - -## Mismatches -- none \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_143636/full_chain_plba_code_subintents_v2_plba-v2-explain-local-http-channel.json b/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_143636/full_chain_plba_code_subintents_v2_plba-v2-explain-local-http-channel.json deleted file mode 100644 index 9449ee1..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_143636/full_chain_plba_code_subintents_v2_plba-v2-explain-local-http-channel.json +++ /dev/null @@ -1,1333 +0,0 @@ -{ - "case_id": "plba-v2-explain-local-http-channel", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_subintents_v2.yaml", - "runner": "runtime", - "mode": "full_chain", - "actual": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN_LOCAL", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 6, - "llm_answer": "Класс `HttpControlChannel` реализует механизм управления HTTP-каналом для взаимодействия с внешним окружением приложения.\nЧто он делает:\n- При инициализации (`__init__`) создается объект, принимающий параметры хоста, порта и тайм-аута. Он устанавливает свойства `_timeout`, создает внутренний сервер через объект `UvicornThreadRunner` и фабрику приложений `HttpControlAppFactory`.\n \n- Метод `start(actions)` запускает приложение с заданным набором действий (`ControlActionSet`), если они предоставлены. Это включает создание приложения и его запуск с помощью внутреннего сервера.\n\n- Метод `stop()` останавливает запущенное ранее приложение.\n\n- Методы `_health_response` и `_action_response` обеспечивают обработку запросов от клиентов. Первый возвращает статус здоровья канала (здорово ли приложение), второй обрабатывает запросы конкретных действий.\nКлючевые детали:\n- Тайм-аут задается явно при создании объекта и используется для ограничения времени ожидания ответов на запросы.\n- Внутренний сервер реализован через `UvicornThreadRunner`, что позволяет удобно запускать и останавливать HTTP-сервер в многопоточной среде.\n- Канал поддерживает два типа клиентских запросов: запрос статуса здоровья и запрос выполнения конкретного действия.\n\nТаким образом, класс предоставляет простой интерфейс для запуска и остановки HTTP-сервера, а также обработки запросов, связанных с управлением состоянием приложения.", - "answer_mode": "answered", - "path_scope": [ - "src/app_runtime/control/http_channel.py" - ], - "symbol_candidates": [ - "HttpControlChannel" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C2_DEPENDENCY_GRAPH" - ] - }, - "passed": true, - "mismatches": [], - "details": { - "case_id": "plba-v2-explain-local-http-channel", - "text": "Почему в файле src/app_runtime/control/http_channel.py класс HttpControlChannel устроен так?", - "mode": "full_chain", - "run_started_at": "2026-03-12T14:36:36", - "rag_session_id": "7d11da21-faa0-4cea-aede-aeabe069164c", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Почему в файле src/app_runtime/control/http_channel.py класс HttpControlChannel устроен так?", - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "HttpControlChannel", - "alternatives": [ - "HttpControlChannel" - ], - "confidence": 0.99 - }, - "rag_count": 6, - "rag_rows": [ - { - "path": "src/app_runtime/control/http_channel.py", - "content": "class HttpControlChannel\nHttpControlChannel(ControlChannel)", - "layer": "C1_SYMBOL_CATALOG", - "title": "HttpControlChannel", - "span_start": 12, - "span_end": 57, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "1c9fbdc24819e5604c26ea55428a74310f03a03e1af197ed84846af61e42fdb0", - "qname": "HttpControlChannel", - "kind": "class", - "signature": "HttpControlChannel(ControlChannel)", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.control.http_channel", - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel.__init__\n -> HttpControlChannel._timeout\n -> HttpControlChannel._action_response", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "HttpControlChannel.__init__:dataflow_slice", - "span_start": 14, - "span_end": 47, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "c3ef21fcae96c82c00be74b3ab827d4af2085d89cb3fa5521c19a174aad84dbb", - "edge_type": "dataflow_slice", - "src_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "src_qname": "HttpControlChannel.__init__", - "dst_symbol_id": "e64969024ccaeb34d8d91473fad07b3b3d341875846392e7a006406c7ada1954", - "dst_ref": "HttpControlChannel._action_response", - "resolution": "resolved", - "slice_id": "c3ef21fcae96c82c00be74b3ab827d4af2085d89cb3fa5521c19a174aad84dbb", - "root_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "path_symbols": [ - "HttpControlChannel.__init__", - "HttpControlChannel._timeout", - "HttpControlChannel._action_response" - ], - "path_symbol_ids": [ - "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "e64969024ccaeb34d8d91473fad07b3b3d341875846392e7a006406c7ada1954" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel.__init__\n -> HttpControlChannel._runner\n -> HttpControlChannel.start", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "HttpControlChannel.__init__:dataflow_slice", - "span_start": 15, - "span_end": 22, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "51d73913df709152258ed1b9a8c8f4eb3c575eccfe6b982aef0b28e0789a29da", - "edge_type": "dataflow_slice", - "src_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "src_qname": "HttpControlChannel.__init__", - "dst_symbol_id": "d1933f04137f52535b6525f1b93ff2cd83bfb216b480e887e791ed1714cda8e0", - "dst_ref": "HttpControlChannel.start", - "resolution": "resolved", - "slice_id": "51d73913df709152258ed1b9a8c8f4eb3c575eccfe6b982aef0b28e0789a29da", - "root_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "path_symbols": [ - "HttpControlChannel.__init__", - "HttpControlChannel._runner", - "HttpControlChannel.start" - ], - "path_symbol_ids": [ - "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "d1933f04137f52535b6525f1b93ff2cd83bfb216b480e887e791ed1714cda8e0" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel.__init__\n -> HttpControlChannel._timeout\n -> HttpControlChannel._health_response", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "HttpControlChannel.__init__:dataflow_slice", - "span_start": 14, - "span_end": 34, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "f858f5c9e575f6c4cdfe3853571b7ee21d1f628a443541d2037c3dc9d0790bef", - "edge_type": "dataflow_slice", - "src_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "src_qname": "HttpControlChannel.__init__", - "dst_symbol_id": "e84bf04e9cd2127df235b7064d05f47e19f19a89c7c82f4c247231d4e8fa426a", - "dst_ref": "HttpControlChannel._health_response", - "resolution": "resolved", - "slice_id": "f858f5c9e575f6c4cdfe3853571b7ee21d1f628a443541d2037c3dc9d0790bef", - "root_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "path_symbols": [ - "HttpControlChannel.__init__", - "HttpControlChannel._timeout", - "HttpControlChannel._health_response" - ], - "path_symbol_ids": [ - "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "e84bf04e9cd2127df235b7064d05f47e19f19a89c7c82f4c247231d4e8fa426a" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel.__init__\n -> HttpControlChannel._runner\n -> HttpControlChannel.stop", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "HttpControlChannel.__init__:dataflow_slice", - "span_start": 15, - "span_end": 25, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "0f827ef81a990258a8a74381c8564a8361afa6712dba3200592659c939adcb9d", - "edge_type": "dataflow_slice", - "src_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "src_qname": "HttpControlChannel.__init__", - "dst_symbol_id": "f29ab212620093d72be20e26c5a399624c7939a6056a728762ed3f84a250bfa3", - "dst_ref": "HttpControlChannel.stop", - "resolution": "resolved", - "slice_id": "0f827ef81a990258a8a74381c8564a8361afa6712dba3200592659c939adcb9d", - "root_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "path_symbols": [ - "HttpControlChannel.__init__", - "HttpControlChannel._runner", - "HttpControlChannel.stop" - ], - "path_symbol_ids": [ - "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "f29ab212620093d72be20e26c5a399624c7939a6056a728762ed3f84a250bfa3" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "class HttpControlChannel(ControlChannel):\n def __init__(self, host: str, port: int, timeout: int) -> None:\n self._timeout = timeout\n self._runner = UvicornThreadRunner(host, port, timeout)\n self._factory = HttpControlAppFactory()\n self._actions: ControlActionSet | None = None\n\n async def start(self, actions: ControlActionSet) -> None:\n self._actions = actions\n app = self._factory.create(self._health_response, self._action_response)\n await self._runner.start(app)\n\n async def stop(self) -> None:\n await self._runner.stop()\n\n @property\n def port(self) -> int:\n return self._runner.port\n\n async def _health_response(self) -> dict[str, object]:\n if self._actions is None:\n return {\"status\": \"unhealthy\", \"detail\": \"control actions are not configured\"}\n return await asyncio.wait_for(self._actions.health(), timeout=float(self._timeout))\n\n async def _action_response(self, action: str, _client_source: str = \"unknown\") -> JSONResponse:\n if self._actions is None:\n return JSONResponse(content={\"status\": \"error\", \"detail\": f\"{action} handler is not configured\"}, status_code=404)\n callbacks = {\n \"start\": self._actions.start,\n \"stop\": self._actions.stop,\n \"status\": self._actions.status,\n }\n callback = callbacks.get(action)\n if callback is None:\n return JSONResponse(content={\"status\": \"error\", \"detail\": f\"unsupported action: {action}\"}, status_code=404)\n action_timeout = max(float(self._timeout), 10.0) if action in {\"start\", \"stop\"} else float(self._timeout)\n try:\n detail = await asyncio.wait_for(callback(), timeout=action_timeout)\n except asyncio.TimeoutError:\n return JSONResponse(\n content={\"status\": \"accepted\", \"detail\": f\"{action} operation is still in progress\"},\n status_code=202,\n )\n except Exception as exc:\n return JSONResponse(content={\"status\": \"error\", \"detail\": str(exc)}, status_code=500)\n return JSONResponse(content={\"status\": \"ok\", \"detail\": detail or f\"{action} action accepted\"}, status_code=200)", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/http_channel.py:HttpControlChannel", - "span_start": 12, - "span_end": 57, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.http_channel", - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "llm_answer": "Класс `HttpControlChannel` реализует механизм управления HTTP-каналом для взаимодействия с внешним окружением приложения.\nЧто он делает:\n- При инициализации (`__init__`) создается объект, принимающий параметры хоста, порта и тайм-аута. Он устанавливает свойства `_timeout`, создает внутренний сервер через объект `UvicornThreadRunner` и фабрику приложений `HttpControlAppFactory`.\n \n- Метод `start(actions)` запускает приложение с заданным набором действий (`ControlActionSet`), если они предоставлены. Это включает создание приложения и его запуск с помощью внутреннего сервера.\n\n- Метод `stop()` останавливает запущенное ранее приложение.\n\n- Методы `_health_response` и `_action_response` обеспечивают обработку запросов от клиентов. Первый возвращает статус здоровья канала (здорово ли приложение), второй обрабатывает запросы конкретных действий.\nКлючевые детали:\n- Тайм-аут задается явно при создании объекта и используется для ограничения времени ожидания ответов на запросы.\n- Внутренний сервер реализован через `UvicornThreadRunner`, что позволяет удобно запускать и останавливать HTTP-сервер в многопоточной среде.\n- Канал поддерживает два типа клиентских запросов: запрос статуса здоровья и запрос выполнения конкретного действия.\n\nТаким образом, класс предоставляет простой интерфейс для запуска и остановки HTTP-сервера, а также обработки запросов, связанных с управлением состоянием приложения.", - "summary": { - "router": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN_LOCAL", - "confidence": null - }, - "retrieval": { - "profile": "code", - "layers_hit": [ - "C0_SOURCE_CHUNKS", - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH" - ], - "evidence_sufficient": true - }, - "llm": { - "answer_status": "answered", - "groundedness": "grounded" - } - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN_LOCAL", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C2_DEPENDENCY_GRAPH" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "HttpControlChannel" - ], - "keyword_hints": [ - "src/app_runtime/control/http_channel.py", - "HttpControlChannel" - ], - "path_hints": [ - "src/app_runtime/control/http_channel.py" - ], - "path_scope": [ - "src/app_runtime/control/http_channel.py" - ], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C2_DEPENDENCY_GRAPH" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C0_SOURCE_CHUNKS": "exact_path_fetch", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 12, - "C2_DEPENDENCY_GRAPH": 4 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [ - "src/app_runtime/control/http_channel.py" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src/app_runtime/control/http_channel.py" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src/app_runtime/control/http_channel.py" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "HttpControlChannel", - "path_scope": [ - "src/app_runtime/control/http_channel.py" - ], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Почему в файле src/app_runtime/control/http_channel.py класс HttpControlChannel устроен так?", - "path_scope": [ - "src/app_runtime/control/http_channel.py" - ], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 12, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "Почему в файле src/app_runtime/control/http_channel.py класс HttpControlChannel устроен так?", - "path_scope": [ - "src/app_runtime/control/http_channel.py" - ], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 4, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [ - "src/app_runtime/control/http_channel.py" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 1, - "candidates_after_filter": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src/app_runtime/control/http_channel.py" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 1, - "candidates_after_filter": 1 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src/app_runtime/control/http_channel.py" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 4, - "candidates_after_filter": 4 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "HttpControlChannel", - "alternatives": [ - "HttpControlChannel" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 4, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "router": 1, - "symbol_resolution": 0, - "retrieval_total": 77, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 31, - "C0_SOURCE_CHUNKS": 24, - "C2_DEPENDENCY_GRAPH": 21 - }, - "merge_rank": 28, - "prompt_build": 0, - "llm_call": 2074 - }, - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 898, - "evidence_rows": 6, - "evidence_chars": 2660 - }, - "evidence_summary": [ - { - "layer": "C1_SYMBOL_CATALOG", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "count": 4, - "unique_paths": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 1, - "unique_paths": 1 - } - ], - "prompt_template_id": "intent_code_qa_explain_local_ru_v4", - "system_prompt_version": "v1" - }, - "router": { - "conversation_mode": "START", - "keyword_hints": [ - "src/app_runtime/control/http_channel.py", - "HttpControlChannel" - ], - "path_scope": [ - "src/app_runtime/control/http_channel.py" - ] - }, - "llm": { - "used_evidence_count": 6, - "missing_evidence_reason": null - } - }, - "run_info": { - "case_id": "plba-v2-explain-local-http-channel", - "mode": "full_chain", - "run_started_at": "2026-03-12T14:36:36", - "rag_session_id": "7d11da21-faa0-4cea-aede-aeabe069164c", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - }, - "input_request": { - "text": "Почему в файле src/app_runtime/control/http_channel.py класс HttpControlChannel устроен так?", - "normalized_query": "Почему в файле src/app_runtime/control/http_channel.py класс HttpControlChannel устроен так?" - }, - "steps": [ - { - "step": "intent_router", - "input": { - "query": "Почему в файле src/app_runtime/control/http_channel.py класс HttpControlChannel устроен так?" - }, - "output": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Почему в файле src/app_runtime/control/http_channel.py класс HttpControlChannel устроен так?" - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN_LOCAL", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C2_DEPENDENCY_GRAPH" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "HttpControlChannel" - ], - "keyword_hints": [ - "src/app_runtime/control/http_channel.py", - "HttpControlChannel" - ], - "path_hints": [ - "src/app_runtime/control/http_channel.py" - ], - "path_scope": [ - "src/app_runtime/control/http_channel.py" - ], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "timings_ms": { - "router": 1 - } - } - }, - { - "step": "retrieval", - "input": { - "query": "Почему в файле src/app_runtime/control/http_channel.py класс HttpControlChannel устроен так?" - }, - "output": { - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "HttpControlChannel", - "alternatives": [ - "HttpControlChannel" - ], - "confidence": 0.99 - }, - "rag_count": 6, - "rag_rows": [ - { - "path": "src/app_runtime/control/http_channel.py", - "content": "class HttpControlChannel\nHttpControlChannel(ControlChannel)", - "layer": "C1_SYMBOL_CATALOG", - "title": "HttpControlChannel", - "span_start": 12, - "span_end": 57, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "1c9fbdc24819e5604c26ea55428a74310f03a03e1af197ed84846af61e42fdb0", - "qname": "HttpControlChannel", - "kind": "class", - "signature": "HttpControlChannel(ControlChannel)", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.control.http_channel", - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel.__init__\n -> HttpControlChannel._timeout\n -> HttpControlChannel._action_response", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "HttpControlChannel.__init__:dataflow_slice", - "span_start": 14, - "span_end": 47, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "c3ef21fcae96c82c00be74b3ab827d4af2085d89cb3fa5521c19a174aad84dbb", - "edge_type": "dataflow_slice", - "src_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "src_qname": "HttpControlChannel.__init__", - "dst_symbol_id": "e64969024ccaeb34d8d91473fad07b3b3d341875846392e7a006406c7ada1954", - "dst_ref": "HttpControlChannel._action_response", - "resolution": "resolved", - "slice_id": "c3ef21fcae96c82c00be74b3ab827d4af2085d89cb3fa5521c19a174aad84dbb", - "root_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "path_symbols": [ - "HttpControlChannel.__init__", - "HttpControlChannel._timeout", - "HttpControlChannel._action_response" - ], - "path_symbol_ids": [ - "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "e64969024ccaeb34d8d91473fad07b3b3d341875846392e7a006406c7ada1954" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel.__init__\n -> HttpControlChannel._runner\n -> HttpControlChannel.start", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "HttpControlChannel.__init__:dataflow_slice", - "span_start": 15, - "span_end": 22, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "51d73913df709152258ed1b9a8c8f4eb3c575eccfe6b982aef0b28e0789a29da", - "edge_type": "dataflow_slice", - "src_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "src_qname": "HttpControlChannel.__init__", - "dst_symbol_id": "d1933f04137f52535b6525f1b93ff2cd83bfb216b480e887e791ed1714cda8e0", - "dst_ref": "HttpControlChannel.start", - "resolution": "resolved", - "slice_id": "51d73913df709152258ed1b9a8c8f4eb3c575eccfe6b982aef0b28e0789a29da", - "root_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "path_symbols": [ - "HttpControlChannel.__init__", - "HttpControlChannel._runner", - "HttpControlChannel.start" - ], - "path_symbol_ids": [ - "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "d1933f04137f52535b6525f1b93ff2cd83bfb216b480e887e791ed1714cda8e0" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel.__init__\n -> HttpControlChannel._timeout\n -> HttpControlChannel._health_response", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "HttpControlChannel.__init__:dataflow_slice", - "span_start": 14, - "span_end": 34, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "f858f5c9e575f6c4cdfe3853571b7ee21d1f628a443541d2037c3dc9d0790bef", - "edge_type": "dataflow_slice", - "src_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "src_qname": "HttpControlChannel.__init__", - "dst_symbol_id": "e84bf04e9cd2127df235b7064d05f47e19f19a89c7c82f4c247231d4e8fa426a", - "dst_ref": "HttpControlChannel._health_response", - "resolution": "resolved", - "slice_id": "f858f5c9e575f6c4cdfe3853571b7ee21d1f628a443541d2037c3dc9d0790bef", - "root_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "path_symbols": [ - "HttpControlChannel.__init__", - "HttpControlChannel._timeout", - "HttpControlChannel._health_response" - ], - "path_symbol_ids": [ - "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "e84bf04e9cd2127df235b7064d05f47e19f19a89c7c82f4c247231d4e8fa426a" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel.__init__\n -> HttpControlChannel._runner\n -> HttpControlChannel.stop", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "HttpControlChannel.__init__:dataflow_slice", - "span_start": 15, - "span_end": 25, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "0f827ef81a990258a8a74381c8564a8361afa6712dba3200592659c939adcb9d", - "edge_type": "dataflow_slice", - "src_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "src_qname": "HttpControlChannel.__init__", - "dst_symbol_id": "f29ab212620093d72be20e26c5a399624c7939a6056a728762ed3f84a250bfa3", - "dst_ref": "HttpControlChannel.stop", - "resolution": "resolved", - "slice_id": "0f827ef81a990258a8a74381c8564a8361afa6712dba3200592659c939adcb9d", - "root_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "path_symbols": [ - "HttpControlChannel.__init__", - "HttpControlChannel._runner", - "HttpControlChannel.stop" - ], - "path_symbol_ids": [ - "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "f29ab212620093d72be20e26c5a399624c7939a6056a728762ed3f84a250bfa3" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "class HttpControlChannel(ControlChannel):\n def __init__(self, host: str, port: int, timeout: int) -> None:\n self._timeout = timeout\n self._runner = UvicornThreadRunner(host, port, timeout)\n self._factory = HttpControlAppFactory()\n self._actions: ControlActionSet | None = None\n\n async def start(self, actions: ControlActionSet) -> None:\n self._actions = actions\n app = self._factory.create(self._health_response, self._action_response)\n await self._runner.start(app)\n\n async def stop(self) -> None:\n await self._runner.stop()\n\n @property\n def port(self) -> int:\n return self._runner.port\n\n async def _health_response(self) -> dict[str, object]:\n if self._actions is None:\n return {\"status\": \"unhealthy\", \"detail\": \"control actions are not configured\"}\n return await asyncio.wait_for(self._actions.health(), timeout=float(self._timeout))\n\n async def _action_response(self, action: str, _client_source: str = \"unknown\") -> JSONResponse:\n if self._actions is None:\n return JSONResponse(content={\"status\": \"error\", \"detail\": f\"{action} handler is not configured\"}, status_code=404)\n callbacks = {\n \"start\": self._actions.start,\n \"stop\": self._actions.stop,\n \"status\": self._actions.status,\n }\n callback = callbacks.get(action)\n if callback is None:\n return JSONResponse(content={\"status\": \"error\", \"detail\": f\"unsupported action: {action}\"}, status_code=404)\n action_timeout = max(float(self._timeout), 10.0) if action in {\"start\", \"stop\"} else float(self._timeout)\n try:\n detail = await asyncio.wait_for(callback(), timeout=action_timeout)\n except asyncio.TimeoutError:\n return JSONResponse(\n content={\"status\": \"accepted\", \"detail\": f\"{action} operation is still in progress\"},\n status_code=202,\n )\n except Exception as exc:\n return JSONResponse(content={\"status\": \"error\", \"detail\": str(exc)}, status_code=500)\n return JSONResponse(content={\"status\": \"ok\", \"detail\": detail or f\"{action} action accepted\"}, status_code=200)", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/http_channel.py:HttpControlChannel", - "span_start": 12, - "span_end": 57, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.http_channel", - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ] - }, - "diagnostics": { - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C2_DEPENDENCY_GRAPH" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C0_SOURCE_CHUNKS": "exact_path_fetch", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 12, - "C2_DEPENDENCY_GRAPH": 4 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [ - "src/app_runtime/control/http_channel.py" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src/app_runtime/control/http_channel.py" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src/app_runtime/control/http_channel.py" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "HttpControlChannel", - "path_scope": [ - "src/app_runtime/control/http_channel.py" - ], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Почему в файле src/app_runtime/control/http_channel.py класс HttpControlChannel устроен так?", - "path_scope": [ - "src/app_runtime/control/http_channel.py" - ], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 12, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "Почему в файле src/app_runtime/control/http_channel.py класс HttpControlChannel устроен так?", - "path_scope": [ - "src/app_runtime/control/http_channel.py" - ], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 4, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [ - "src/app_runtime/control/http_channel.py" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 1, - "candidates_after_filter": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src/app_runtime/control/http_channel.py" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 1, - "candidates_after_filter": 1 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src/app_runtime/control/http_channel.py" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 4, - "candidates_after_filter": 4 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "HttpControlChannel", - "alternatives": [ - "HttpControlChannel" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 4, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "symbol_resolution": 0, - "retrieval_total": 77, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 31, - "C0_SOURCE_CHUNKS": 24, - "C2_DEPENDENCY_GRAPH": 21 - }, - "merge_rank": 28 - } - } - }, - { - "step": "llm_answer", - "input": { - "query": "Почему в файле src/app_runtime/control/http_channel.py класс HttpControlChannel устроен так?", - "rag_count": 6 - }, - "output": { - "llm_answer": "Класс `HttpControlChannel` реализует механизм управления HTTP-каналом для взаимодействия с внешним окружением приложения.\nЧто он делает:\n- При инициализации (`__init__`) создается объект, принимающий параметры хоста, порта и тайм-аута. Он устанавливает свойства `_timeout`, создает внутренний сервер через объект `UvicornThreadRunner` и фабрику приложений `HttpControlAppFactory`.\n \n- Метод `start(actions)` запускает приложение с заданным набором действий (`ControlActionSet`), если они предоставлены. Это включает создание приложения и его запуск с помощью внутреннего сервера.\n\n- Метод `stop()` останавливает запущенное ранее приложение.\n\n- Методы `_health_response` и `_action_response` обеспечивают обработку запросов от клиентов. Первый возвращает статус здоровья канала (здорово ли приложение), второй обрабатывает запросы конкретных действий.\nКлючевые детали:\n- Тайм-аут задается явно при создании объекта и используется для ограничения времени ожидания ответов на запросы.\n- Внутренний сервер реализован через `UvicornThreadRunner`, что позволяет удобно запускать и останавливать HTTP-сервер в многопоточной среде.\n- Канал поддерживает два типа клиентских запросов: запрос статуса здоровья и запрос выполнения конкретного действия.\n\nТаким образом, класс предоставляет простой интерфейс для запуска и остановки HTTP-сервера, а также обработки запросов, связанных с управлением состоянием приложения." - }, - "diagnostics": { - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 898, - "evidence_rows": 6, - "evidence_chars": 2660 - }, - "evidence_summary": [ - { - "layer": "C1_SYMBOL_CATALOG", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "count": 4, - "unique_paths": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 1, - "unique_paths": 1 - } - ], - "prompt_template_id": "intent_code_qa_explain_local_ru_v4", - "system_prompt_version": "v1" - }, - "timings_ms": { - "prompt_build": 0, - "llm_call": 2074 - } - } - } - ] - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_143636/full_chain_plba_code_subintents_v2_plba-v2-explain-local-http-channel.md b/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_143636/full_chain_plba_code_subintents_v2_plba-v2-explain-local-http-channel.md deleted file mode 100644 index bbc699b..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_143636/full_chain_plba_code_subintents_v2_plba-v2-explain-local-http-channel.md +++ /dev/null @@ -1,34 +0,0 @@ -# plba-v2-explain-local-http-channel - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_subintents_v2.yaml -- runner: runtime -- mode: full_chain -- passed: True - -## Query -Почему в файле src/app_runtime/control/http_channel.py класс HttpControlChannel устроен так? - -## Actual -{ - "intent": "CODE_QA", - "sub_intent": "EXPLAIN_LOCAL", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 6, - "llm_answer": "Класс `HttpControlChannel` реализует механизм управления HTTP-каналом для взаимодействия с внешним окружением приложения.\nЧто он делает:\n- При инициализации (`__init__`) создается объект, принимающий параметры хоста, порта и тайм-аута. Он устанавливает свойства `_timeout`, создает внутренний сервер через объект `UvicornThreadRunner` и фабрику приложений `HttpControlAppFactory`.\n \n- Метод `start(actions)` запускает приложение с заданным набором действий (`ControlActionSet`), если они предоставлены. Это включает создание приложения и его запуск с помощью внутреннего сервера.\n\n- Метод `stop()` останавливает запущенное ранее приложение.\n\n- Методы `_health_response` и `_action_response` обеспечивают обработку запросов от клиентов. Первый возвращает статус здоровья канала (здорово ли приложение), второй обрабатывает запросы конкретных действий.\nКлючевые детали:\n- Тайм-аут задается явно при создании объекта и используется для ограничения времени ожидания ответов на запросы.\n- Внутренний сервер реализован через `UvicornThreadRunner`, что позволяет удобно запускать и останавливать HTTP-сервер в многопоточной среде.\n- Канал поддерживает два типа клиентских запросов: запрос статуса здоровья и запрос выполнения конкретного действия.\n\nТаким образом, класс предоставляет простой интерфейс для запуска и остановки HTTP-сервера, а также обработки запросов, связанных с управлением состоянием приложения.", - "answer_mode": "answered", - "path_scope": [ - "src/app_runtime/control/http_channel.py" - ], - "symbol_candidates": [ - "HttpControlChannel" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C2_DEPENDENCY_GRAPH" - ] -} - -## Mismatches -- none \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_143636/full_chain_plba_code_subintents_v2_plba-v2-explain-nonexistent-symbol.json b/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_143636/full_chain_plba_code_subintents_v2_plba-v2-explain-nonexistent-symbol.json deleted file mode 100644 index 69d56a0..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_143636/full_chain_plba_code_subintents_v2_plba-v2-explain-nonexistent-symbol.json +++ /dev/null @@ -1,1169 +0,0 @@ -{ - "case_id": "plba-v2-explain-nonexistent-symbol", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_subintents_v2.yaml", - "runner": "runtime", - "mode": "full_chain", - "actual": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 0, - "llm_answer": "Сущность RuntimeFactoryManager не найдена в доступном коде. Близкие совпадения: ControlChannel, ControlActionSet.", - "answer_mode": "degraded", - "path_scope": [], - "symbol_candidates": [ - "RuntimeFactoryManager" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "passed": true, - "mismatches": [], - "details": { - "case_id": "plba-v2-explain-nonexistent-symbol", - "text": "Объясни класс RuntimeFactoryManager", - "mode": "full_chain", - "run_started_at": "2026-03-12T14:36:36", - "rag_session_id": "7d11da21-faa0-4cea-aede-aeabe069164c", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Объясни класс RuntimeFactoryManager", - "symbol_resolution": { - "status": "not_found", - "resolved_symbol": null, - "alternatives": [ - "ControlChannel", - "ControlActionSet" - ], - "confidence": 0.0 - }, - "rag_count": 0, - "rag_rows": [], - "llm_answer": "Сущность RuntimeFactoryManager не найдена в доступном коде. Близкие совпадения: ControlChannel, ControlActionSet.", - "summary": { - "router": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "confidence": null - }, - "retrieval": { - "profile": "code", - "layers_hit": [], - "evidence_sufficient": false - }, - "llm": { - "answer_status": "degraded", - "groundedness": "weakly_grounded" - } - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "RuntimeFactoryManager" - ], - "keyword_hints": [ - "RuntimeFactoryManager" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C0_SOURCE_CHUNKS": "exact_path_fetch", - "C4_SEMANTIC_ROLES": "exact_path_fetch", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C3_ENTRYPOINTS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 8, - "C4_SEMANTIC_ROLES": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C3_ENTRYPOINTS": 6 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C4_SEMANTIC_ROLES": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": null, - "workspace_id": null, - "returned_repo_ids": [], - "returned_workspace_ids": [] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "RuntimeFactoryManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "RuntimeFactoryManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C4_SEMANTIC_ROLES", - "query": "RuntimeFactoryManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "RuntimeFactoryManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - }, - { - "layer": "C3_ENTRYPOINTS", - "query": "RuntimeFactoryManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 2, - "candidates_after_filter": 2 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 6, - "candidates_after_filter": 6 - }, - { - "layer": "C3_ENTRYPOINTS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 3, - "candidates_after_filter": 3 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "not_found", - "resolved_symbol": null, - "alternatives": [ - "ControlChannel", - "ControlActionSet" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "miss", - "hit_count": 0, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "miss", - "hit_count": 0, - "fail_reason": null - }, - { - "layer": "C4_SEMANTIC_ROLES", - "status": "miss", - "hit_count": 0, - "fail_reason": null - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "miss", - "hit_count": 0, - "fail_reason": null - }, - { - "layer": "C3_ENTRYPOINTS", - "status": "miss", - "hit_count": 0, - "fail_reason": null - } - ] - }, - "constraint_violations": [ - { - "type": "LAYER_MISSING", - "severity": "warn", - "details": { - "layer": "C1_SYMBOL_CATALOG", - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "suggested_fix": "Increase top_k for this layer or relax constraints for retrieval." - }, - { - "type": "LAYER_MISSING", - "severity": "warn", - "details": { - "layer": "C0_SOURCE_CHUNKS", - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "suggested_fix": "Increase top_k for this layer or relax constraints for retrieval." - }, - { - "type": "LAYER_MISSING", - "severity": "warn", - "details": { - "layer": "C4_SEMANTIC_ROLES", - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "suggested_fix": "Increase top_k for this layer or relax constraints for retrieval." - }, - { - "type": "LAYER_MISSING", - "severity": "warn", - "details": { - "layer": "C2_DEPENDENCY_GRAPH", - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "suggested_fix": "Increase top_k for this layer or relax constraints for retrieval." - }, - { - "type": "LAYER_MISSING", - "severity": "warn", - "details": { - "layer": "C3_ENTRYPOINTS", - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "suggested_fix": "Increase top_k for this layer or relax constraints for retrieval." - }, - { - "type": "SYMBOL_RESOLUTION_FAILED", - "severity": "warn", - "details": { - "status": "not_found", - "symbol_candidates": [ - "RuntimeFactoryManager" - ] - }, - "suggested_fix": "Increase symbol layer budget or improve fuzzy symbol resolution settings." - } - ], - "timings_ms": { - "router": 0, - "symbol_resolution": 0, - "retrieval_total": 139, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 34, - "C0_SOURCE_CHUNKS": 18, - "C4_SEMANTIC_ROLES": 15, - "C2_DEPENDENCY_GRAPH": 57, - "C3_ENTRYPOINTS": 12 - }, - "merge_rank": 0, - "prompt_build": 0, - "llm_call": 0 - }, - "prompt": null, - "answer_policy": { - "short_circuit": true, - "answer_mode": "degraded", - "failure_reason": "symbol_not_found" - }, - "router": { - "conversation_mode": "START", - "keyword_hints": [ - "RuntimeFactoryManager" - ], - "path_scope": [] - }, - "llm": { - "used_evidence_count": 0, - "missing_evidence_reason": "symbol_not_found" - } - }, - "run_info": { - "case_id": "plba-v2-explain-nonexistent-symbol", - "mode": "full_chain", - "run_started_at": "2026-03-12T14:36:36", - "rag_session_id": "7d11da21-faa0-4cea-aede-aeabe069164c", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - }, - "input_request": { - "text": "Объясни класс RuntimeFactoryManager", - "normalized_query": "Объясни класс RuntimeFactoryManager" - }, - "steps": [ - { - "step": "intent_router", - "input": { - "query": "Объясни класс RuntimeFactoryManager" - }, - "output": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Объясни класс RuntimeFactoryManager" - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "RuntimeFactoryManager" - ], - "keyword_hints": [ - "RuntimeFactoryManager" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "timings_ms": { - "router": 0 - } - } - }, - { - "step": "retrieval", - "input": { - "query": "Объясни класс RuntimeFactoryManager" - }, - "output": { - "symbol_resolution": { - "status": "not_found", - "resolved_symbol": null, - "alternatives": [ - "ControlChannel", - "ControlActionSet" - ], - "confidence": 0.0 - }, - "rag_count": 0, - "rag_rows": [] - }, - "diagnostics": { - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C0_SOURCE_CHUNKS": "exact_path_fetch", - "C4_SEMANTIC_ROLES": "exact_path_fetch", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C3_ENTRYPOINTS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 8, - "C4_SEMANTIC_ROLES": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C3_ENTRYPOINTS": 6 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C4_SEMANTIC_ROLES": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": null, - "workspace_id": null, - "returned_repo_ids": [], - "returned_workspace_ids": [] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "RuntimeFactoryManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "RuntimeFactoryManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C4_SEMANTIC_ROLES", - "query": "RuntimeFactoryManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "RuntimeFactoryManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - }, - { - "layer": "C3_ENTRYPOINTS", - "query": "RuntimeFactoryManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 2, - "candidates_after_filter": 2 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 6, - "candidates_after_filter": 6 - }, - { - "layer": "C3_ENTRYPOINTS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 3, - "candidates_after_filter": 3 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "not_found", - "resolved_symbol": null, - "alternatives": [ - "ControlChannel", - "ControlActionSet" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "miss", - "hit_count": 0, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "miss", - "hit_count": 0, - "fail_reason": null - }, - { - "layer": "C4_SEMANTIC_ROLES", - "status": "miss", - "hit_count": 0, - "fail_reason": null - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "miss", - "hit_count": 0, - "fail_reason": null - }, - { - "layer": "C3_ENTRYPOINTS", - "status": "miss", - "hit_count": 0, - "fail_reason": null - } - ] - }, - "constraint_violations": [ - { - "type": "LAYER_MISSING", - "severity": "warn", - "details": { - "layer": "C1_SYMBOL_CATALOG", - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "suggested_fix": "Increase top_k for this layer or relax constraints for retrieval." - }, - { - "type": "LAYER_MISSING", - "severity": "warn", - "details": { - "layer": "C0_SOURCE_CHUNKS", - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "suggested_fix": "Increase top_k for this layer or relax constraints for retrieval." - }, - { - "type": "LAYER_MISSING", - "severity": "warn", - "details": { - "layer": "C4_SEMANTIC_ROLES", - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "suggested_fix": "Increase top_k for this layer or relax constraints for retrieval." - }, - { - "type": "LAYER_MISSING", - "severity": "warn", - "details": { - "layer": "C2_DEPENDENCY_GRAPH", - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "suggested_fix": "Increase top_k for this layer or relax constraints for retrieval." - }, - { - "type": "LAYER_MISSING", - "severity": "warn", - "details": { - "layer": "C3_ENTRYPOINTS", - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "suggested_fix": "Increase top_k for this layer or relax constraints for retrieval." - }, - { - "type": "SYMBOL_RESOLUTION_FAILED", - "severity": "warn", - "details": { - "status": "not_found", - "symbol_candidates": [ - "RuntimeFactoryManager" - ] - }, - "suggested_fix": "Increase symbol layer budget or improve fuzzy symbol resolution settings." - } - ], - "timings_ms": { - "symbol_resolution": 0, - "retrieval_total": 139, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 34, - "C0_SOURCE_CHUNKS": 18, - "C4_SEMANTIC_ROLES": 15, - "C2_DEPENDENCY_GRAPH": 57, - "C3_ENTRYPOINTS": 12 - }, - "merge_rank": 0 - } - } - }, - { - "step": "llm_answer", - "input": { - "query": "Объясни класс RuntimeFactoryManager", - "rag_count": 0 - }, - "output": { - "llm_answer": "Сущность RuntimeFactoryManager не найдена в доступном коде. Близкие совпадения: ControlChannel, ControlActionSet." - }, - "diagnostics": { - "prompt": null, - "timings_ms": { - "prompt_build": 0, - "llm_call": 0 - } - } - } - ] - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_143636/full_chain_plba_code_subintents_v2_plba-v2-explain-nonexistent-symbol.md b/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_143636/full_chain_plba_code_subintents_v2_plba-v2-explain-nonexistent-symbol.md deleted file mode 100644 index 56d307f..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_143636/full_chain_plba_code_subintents_v2_plba-v2-explain-nonexistent-symbol.md +++ /dev/null @@ -1,34 +0,0 @@ -# plba-v2-explain-nonexistent-symbol - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_subintents_v2.yaml -- runner: runtime -- mode: full_chain -- passed: True - -## Query -Объясни класс RuntimeFactoryManager - -## Actual -{ - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 0, - "llm_answer": "Сущность RuntimeFactoryManager не найдена в доступном коде. Близкие совпадения: ControlChannel, ControlActionSet.", - "answer_mode": "degraded", - "path_scope": [], - "symbol_candidates": [ - "RuntimeFactoryManager" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] -} - -## Mismatches -- none \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_143636/full_chain_plba_code_subintents_v2_plba-v2-explain-runtime-manager.json b/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_143636/full_chain_plba_code_subintents_v2_plba-v2-explain-runtime-manager.json deleted file mode 100644 index 2f9d1b9..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_143636/full_chain_plba_code_subintents_v2_plba-v2-explain-runtime-manager.json +++ /dev/null @@ -1,2088 +0,0 @@ -{ - "case_id": "plba-v2-explain-runtime-manager", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_subintents_v2.yaml", - "runner": "runtime", - "mode": "full_chain", - "actual": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 12, - "llm_answer": "Класс `RuntimeManager` выглядит как менеджер жизненного цикла и координатор для различных компонентов в приложении runtime. Судя по предоставленным данным, он работает как центрального управляющего элемента, координирующего действия других сервисов и модулей.\nОсновные характеристики класса:\n- Инициализация происходит через конструктор (`__init__`), которому передаются различные компоненты приложения (конфигурации, службы, регистраторы трассировок, системы здоровья, логгеры и супервайзеры рабочих процессов).\n \n- В конструкторе устанавливаются начальные значения полей и создаются внутренние структуры данных, такие как `registry`, представляющий собой модульный регистр служб.\n\n- Класс содержит два основных состояния управления:\n - `_state`: отслеживает текущее состояние жизненного цикла менеджера (например, IDLE, RUNNING).\n - `_core_registered`: флаг, указывающий, зарегистрированы ли основные сервисы.\n - `_workers_registered`: флаг, показывающий, зарегистрированы ли рабочие процессы.\n\n- Реализован метод регистрации модуля (`register_module`), позволяющий добавлять новые модули в систему.\n\nНа основании имеющихся доказательств можно предположить следующие функции:\n- Координация запуска и остановки всех зарегистрированных служб и рабочих процессов.\n- Управление жизненным циклом приложения (запуск, остановка, переход между стадиями выполнения).\n- Регистрация новых модулей и их интеграция в общую инфраструктуру.\n\nОднако точная логика поведения и детальная реализация некоторых методов (таких как `register_module`) скрыты от прямого просмотра, поэтому возможны дополнительные детали, которые не учтены здесь.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "RuntimeManager" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "passed": true, - "mismatches": [], - "details": { - "case_id": "plba-v2-explain-runtime-manager", - "text": "Объясни как работает класс RuntimeManager", - "mode": "full_chain", - "run_started_at": "2026-03-12T14:36:36", - "rag_session_id": "7d11da21-faa0-4cea-aede-aeabe069164c", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Объясни как работает класс RuntimeManager", - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "RuntimeManager", - "alternatives": [ - "RuntimeManager" - ], - "confidence": 0.99 - }, - "rag_count": 12, - "rag_rows": [ - { - "path": "src/app_runtime/core/runtime.py", - "content": "class RuntimeManager\nRuntimeManager", - "layer": "C1_SYMBOL_CATALOG", - "title": "RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "7e4a9381328c5803bbc6179458612fc4e947d928aa7bf8b4b2bebb2c8592f758", - "qname": "RuntimeManager", - "kind": "class", - "signature": "RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.core.runtime", - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests manager\n- orchestrates role-like calls (4)\n- reads and writes state attributes\n- participates in dataflow slices (50)", - "layer": "C4_SEMANTIC_ROLES", - "title": "RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 43, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "7e4a9381328c5803bbc6179458612fc4e947d928aa7bf8b4b2bebb2c8592f758", - "symbol_name": "RuntimeManager", - "qname": "RuntimeManager", - "role": "pipeline_stage", - "confidence": 0.67, - "dataflow_participation": 50, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.stop", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 25, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d", - "dst_ref": "ControlPlaneService.stop", - "resolution": "resolved", - "slice_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.stop" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._stop_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 51, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a", - "dst_ref": "ControlPlaneService._stop_async", - "resolution": "resolved", - "slice_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._stop_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.register_channel", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 17, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957", - "dst_ref": "ControlPlaneService.register_channel", - "resolution": "resolved", - "slice_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.register_channel" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.start", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 20, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154", - "dst_ref": "ControlPlaneService.start", - "resolution": "resolved", - "slice_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.start" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._start_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 47, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517", - "dst_ref": "ControlPlaneService._start_async", - "resolution": "resolved", - "slice_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._start_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager.add_config_file", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 32, - "span_end": 52, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "a23b8a11ebdb12708b60c96ea12a69f7f042082f1adfddd572444e246d81d167", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "57ffbd4f0d9fdf3507c2b8624312ce211f3d02fdf86a57a8ec90778d8a7b498d", - "dst_ref": "RuntimeManager.add_config_file", - "resolution": "resolved", - "slice_id": "a23b8a11ebdb12708b60c96ea12a69f7f042082f1adfddd572444e246d81d167", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager.add_config_file" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "57ffbd4f0d9fdf3507c2b8624312ce211f3d02fdf86a57a8ec90778d8a7b498d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "class RuntimeManager:\n ACTION_TIMEOUT_SECONDS = 10.0\n ACTION_POLL_INTERVAL_SECONDS = 0.05\n\n def __init__(\n self,\n configuration: ConfigurationManager | None = None,\n services: ServiceContainer | None = None,\n traces: TraceService | None = None,\n health: HealthRegistry | None = None,\n logs: LogManager | None = None,\n workers: WorkerSupervisor | None = None,\n control_plane: ControlPlaneService | None = None,\n ) -> None:\n self.configuration = configuration or ConfigurationManager()\n self.services = services or ServiceContainer()\n self.traces = traces or TraceService()\n self.health = health or HealthRegistry()\n self.logs = logs or LogManager()\n self.workers = workers or WorkerSupervisor()\n self.control_plane = control_plane or ControlPlaneService()\n self.registry = ModuleRegistry(self.services)\n self._started = False\n self._state = LifecycleState.IDLE\n self._core_registered = False\n self._workers_registered = False\n self._register_core_services()\n\n def register_module(self, module: ApplicationModule) -> None:\n self.registry.register_module(module.name)\n module.register(self.registry)\n\n def add_config_file(self, path: str) -> FileConfigProvider:\n provider = FileConfigProvider(path)\n self.configuration.add_provider(provider)\n return provider\n\n def start(self, *, start_control_plane: bool = True) -> None:\n if self._started:\n return\n self._state = LifecycleState.STARTING\n config = self.configuration.load()\n self.logs.apply_config(config)\n self._register_health_contributors()\n self._register_workers()\n self.workers.start()\n if start_control_plane:\n self.control_plane.start(self)\n self._started = True\n self._refresh_state()\n\n def stop(self, timeout: float = 30.0, force: bool = False, stop_control_plane: bool = True) -> None:\n if not self._started:\n return\n self._state = LifecycleState.STOPPING\n self.workers.stop(timeout=timeout, force=force)\n if stop_control_plane:\n self.control_plane.stop()\n self._started = False\n self._state = LifecycleState.STOPPED\n\n def status(self) -> dict[str, object]:\n self._refresh_state()\n return self.control_plane.snapshot(self)\n\n def current_health(self) -> HealthPayload:\n self._refresh_state()\n return self.health.payload(self._state, self.workers.healths())\n\n async def health_status(self) -> HealthPayload:\n return self.current_health()\n\n async def start_runtime(self) -> dict[str, object] | str:\n self._refresh_state()\n if self._started:\n return \"runtime already running\"\n if self._state == LifecycleState.STOPPING:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n\n self.start(start_control_plane=False)\n started = self._wait_for_state({LifecycleState.IDLE, LifecycleState.BUSY}, timeout=self.ACTION_TIMEOUT_SECONDS)\n if started:\n return self._action_detail(\"runtime started\", timed_out=False)\n return self._action_detail(\"runtime start is still in progress\", timed_out=True)\n\n async def stop_runtime(self) -> dict[str, object] | str:\n self._refresh_state()\n if not self._started:\n if self._state == LifecycleState.STOPPING:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n return \"runtime already stopped\"\n\n self._state = LifecycleState.STOPPING\n try:\n self.workers.stop(timeout=self.ACTION_TIMEOUT_SECONDS, force=False)\n except TimeoutError:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n\n self._started = False\n self._state = LifecycleState.STOPPED\n return self._action_detail(\"runtime stopped\", timed_out=False)\n\n async def runtime_status(self) -> str:\n self._refresh_state()\n return self._state.value\n\n def _register_core_services(self) -> None:\n if self._core_registered:\n return\n self.services.register(\"configuration\", self.configuration)\n self.services.register(\"traces\", self.traces)\n self.services.register(\"health\", self.health)\n self.services.register(\"logs\", self.logs)\n self.services.register(\"workers\", self.workers)\n self.services.register(\"control_plane\", self.control_plane)\n self._core_registered = True\n\n def _register_health_contributors(self) -> None:\n for contributor in self.registry.health_contributors:\n self.health.register(contributor)\n\n def _register_workers(self) -> None:\n if self._workers_registered:\n return\n for worker in self.registry.workers:\n self.workers.register(worker)\n self._workers_registered = True\n\n def _refresh_state(self) -> None:\n lifecycle = self.workers.lifecycle_state()\n\n if self._state == LifecycleState.STOPPING:\n if lifecycle == LifecycleState.STOPPED:\n self._started = False\n self._state = LifecycleState.STOPPED\n return\n\n if not self._started:\n if lifecycle == LifecycleState.STOPPED:\n self._state = LifecycleState.STOPPED\n return\n\n self._state = lifecycle\n\n def _wait_for_state(self, target_states: set[LifecycleState], *, timeout: float) -> bool:\n deadline = monotonic() + timeout\n while monotonic() < deadline:\n self._refresh_state()\n if self._state in target_states:\n return True\n sleep(self.ACTION_POLL_INTERVAL_SECONDS)\n self._refresh_state()\n return self._state in target_states\n\n def _action_detail(self, message: str, *, timed_out: bool) -> dict[str, object]:\n self._refresh_state()\n return {\n \"message\": message,\n \"state\": self._state.value,\n \"timed_out\": timed_out,\n \"workers\": self.workers.snapshot(),\n }", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/core/runtime.py:RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.core.runtime", - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "llm_answer": "Класс `RuntimeManager` выглядит как менеджер жизненного цикла и координатор для различных компонентов в приложении runtime. Судя по предоставленным данным, он работает как центрального управляющего элемента, координирующего действия других сервисов и модулей.\nОсновные характеристики класса:\n- Инициализация происходит через конструктор (`__init__`), которому передаются различные компоненты приложения (конфигурации, службы, регистраторы трассировок, системы здоровья, логгеры и супервайзеры рабочих процессов).\n \n- В конструкторе устанавливаются начальные значения полей и создаются внутренние структуры данных, такие как `registry`, представляющий собой модульный регистр служб.\n\n- Класс содержит два основных состояния управления:\n - `_state`: отслеживает текущее состояние жизненного цикла менеджера (например, IDLE, RUNNING).\n - `_core_registered`: флаг, указывающий, зарегистрированы ли основные сервисы.\n - `_workers_registered`: флаг, показывающий, зарегистрированы ли рабочие процессы.\n\n- Реализован метод регистрации модуля (`register_module`), позволяющий добавлять новые модули в систему.\n\nНа основании имеющихся доказательств можно предположить следующие функции:\n- Координация запуска и остановки всех зарегистрированных служб и рабочих процессов.\n- Управление жизненным циклом приложения (запуск, остановка, переход между стадиями выполнения).\n- Регистрация новых модулей и их интеграция в общую инфраструктуру.\n\nОднако точная логика поведения и детальная реализация некоторых методов (таких как `register_module`) скрыты от прямого просмотра, поэтому возможны дополнительные детали, которые не учтены здесь.", - "summary": { - "router": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "confidence": null - }, - "retrieval": { - "profile": "code", - "layers_hit": [ - "C0_SOURCE_CHUNKS", - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS", - "C4_SEMANTIC_ROLES" - ], - "evidence_sufficient": true - }, - "llm": { - "answer_status": "answered", - "groundedness": "grounded" - } - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "RuntimeManager" - ], - "keyword_hints": [ - "RuntimeManager" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C0_SOURCE_CHUNKS": "exact_path_fetch", - "C4_SEMANTIC_ROLES": "exact_path_fetch", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C3_ENTRYPOINTS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 8, - "C4_SEMANTIC_ROLES": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C3_ENTRYPOINTS": 6 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C4_SEMANTIC_ROLES": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C4_SEMANTIC_ROLES", - "query": "RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - }, - { - "layer": "C3_ENTRYPOINTS", - "query": "RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 1, - "candidates_after_filter": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 6, - "candidates_after_filter": 6 - }, - { - "layer": "C3_ENTRYPOINTS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 3, - "candidates_after_filter": 3 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "RuntimeManager", - "alternatives": [ - "RuntimeManager" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C4_SEMANTIC_ROLES", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 6, - "fail_reason": null - }, - { - "layer": "C3_ENTRYPOINTS", - "status": "hit", - "hit_count": 3, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "router": 0, - "symbol_resolution": 0, - "retrieval_total": 178, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 28, - "C0_SOURCE_CHUNKS": 16, - "C4_SEMANTIC_ROLES": 14, - "C2_DEPENDENCY_GRAPH": 56, - "C3_ENTRYPOINTS": 14 - }, - "merge_rank": 24, - "prompt_build": 0, - "llm_call": 2370 - }, - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 919, - "evidence_rows": 12, - "evidence_chars": 7130 - }, - "evidence_summary": [ - { - "layer": "C1_SYMBOL_CATALOG", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "count": 6, - "unique_paths": 2 - }, - { - "layer": "C3_ENTRYPOINTS", - "count": 3, - "unique_paths": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 1, - "unique_paths": 1 - } - ], - "prompt_template_id": "intent_code_qa_explain_ru_v4", - "system_prompt_version": "v1" - }, - "router": { - "conversation_mode": "START", - "keyword_hints": [ - "RuntimeManager" - ], - "path_scope": [] - }, - "llm": { - "used_evidence_count": 12, - "missing_evidence_reason": null - } - }, - "run_info": { - "case_id": "plba-v2-explain-runtime-manager", - "mode": "full_chain", - "run_started_at": "2026-03-12T14:36:36", - "rag_session_id": "7d11da21-faa0-4cea-aede-aeabe069164c", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - }, - "input_request": { - "text": "Объясни как работает класс RuntimeManager", - "normalized_query": "Объясни как работает класс RuntimeManager" - }, - "steps": [ - { - "step": "intent_router", - "input": { - "query": "Объясни как работает класс RuntimeManager" - }, - "output": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Объясни как работает класс RuntimeManager" - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "RuntimeManager" - ], - "keyword_hints": [ - "RuntimeManager" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "timings_ms": { - "router": 0 - } - } - }, - { - "step": "retrieval", - "input": { - "query": "Объясни как работает класс RuntimeManager" - }, - "output": { - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "RuntimeManager", - "alternatives": [ - "RuntimeManager" - ], - "confidence": 0.99 - }, - "rag_count": 12, - "rag_rows": [ - { - "path": "src/app_runtime/core/runtime.py", - "content": "class RuntimeManager\nRuntimeManager", - "layer": "C1_SYMBOL_CATALOG", - "title": "RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "7e4a9381328c5803bbc6179458612fc4e947d928aa7bf8b4b2bebb2c8592f758", - "qname": "RuntimeManager", - "kind": "class", - "signature": "RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.core.runtime", - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests manager\n- orchestrates role-like calls (4)\n- reads and writes state attributes\n- participates in dataflow slices (50)", - "layer": "C4_SEMANTIC_ROLES", - "title": "RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 43, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "7e4a9381328c5803bbc6179458612fc4e947d928aa7bf8b4b2bebb2c8592f758", - "symbol_name": "RuntimeManager", - "qname": "RuntimeManager", - "role": "pipeline_stage", - "confidence": 0.67, - "dataflow_participation": 50, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.stop", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 25, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d", - "dst_ref": "ControlPlaneService.stop", - "resolution": "resolved", - "slice_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.stop" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._stop_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 51, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a", - "dst_ref": "ControlPlaneService._stop_async", - "resolution": "resolved", - "slice_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._stop_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.register_channel", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 17, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957", - "dst_ref": "ControlPlaneService.register_channel", - "resolution": "resolved", - "slice_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.register_channel" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.start", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 20, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154", - "dst_ref": "ControlPlaneService.start", - "resolution": "resolved", - "slice_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.start" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._start_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 47, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517", - "dst_ref": "ControlPlaneService._start_async", - "resolution": "resolved", - "slice_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._start_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager.add_config_file", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 32, - "span_end": 52, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "a23b8a11ebdb12708b60c96ea12a69f7f042082f1adfddd572444e246d81d167", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "57ffbd4f0d9fdf3507c2b8624312ce211f3d02fdf86a57a8ec90778d8a7b498d", - "dst_ref": "RuntimeManager.add_config_file", - "resolution": "resolved", - "slice_id": "a23b8a11ebdb12708b60c96ea12a69f7f042082f1adfddd572444e246d81d167", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager.add_config_file" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "57ffbd4f0d9fdf3507c2b8624312ce211f3d02fdf86a57a8ec90778d8a7b498d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "class RuntimeManager:\n ACTION_TIMEOUT_SECONDS = 10.0\n ACTION_POLL_INTERVAL_SECONDS = 0.05\n\n def __init__(\n self,\n configuration: ConfigurationManager | None = None,\n services: ServiceContainer | None = None,\n traces: TraceService | None = None,\n health: HealthRegistry | None = None,\n logs: LogManager | None = None,\n workers: WorkerSupervisor | None = None,\n control_plane: ControlPlaneService | None = None,\n ) -> None:\n self.configuration = configuration or ConfigurationManager()\n self.services = services or ServiceContainer()\n self.traces = traces or TraceService()\n self.health = health or HealthRegistry()\n self.logs = logs or LogManager()\n self.workers = workers or WorkerSupervisor()\n self.control_plane = control_plane or ControlPlaneService()\n self.registry = ModuleRegistry(self.services)\n self._started = False\n self._state = LifecycleState.IDLE\n self._core_registered = False\n self._workers_registered = False\n self._register_core_services()\n\n def register_module(self, module: ApplicationModule) -> None:\n self.registry.register_module(module.name)\n module.register(self.registry)\n\n def add_config_file(self, path: str) -> FileConfigProvider:\n provider = FileConfigProvider(path)\n self.configuration.add_provider(provider)\n return provider\n\n def start(self, *, start_control_plane: bool = True) -> None:\n if self._started:\n return\n self._state = LifecycleState.STARTING\n config = self.configuration.load()\n self.logs.apply_config(config)\n self._register_health_contributors()\n self._register_workers()\n self.workers.start()\n if start_control_plane:\n self.control_plane.start(self)\n self._started = True\n self._refresh_state()\n\n def stop(self, timeout: float = 30.0, force: bool = False, stop_control_plane: bool = True) -> None:\n if not self._started:\n return\n self._state = LifecycleState.STOPPING\n self.workers.stop(timeout=timeout, force=force)\n if stop_control_plane:\n self.control_plane.stop()\n self._started = False\n self._state = LifecycleState.STOPPED\n\n def status(self) -> dict[str, object]:\n self._refresh_state()\n return self.control_plane.snapshot(self)\n\n def current_health(self) -> HealthPayload:\n self._refresh_state()\n return self.health.payload(self._state, self.workers.healths())\n\n async def health_status(self) -> HealthPayload:\n return self.current_health()\n\n async def start_runtime(self) -> dict[str, object] | str:\n self._refresh_state()\n if self._started:\n return \"runtime already running\"\n if self._state == LifecycleState.STOPPING:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n\n self.start(start_control_plane=False)\n started = self._wait_for_state({LifecycleState.IDLE, LifecycleState.BUSY}, timeout=self.ACTION_TIMEOUT_SECONDS)\n if started:\n return self._action_detail(\"runtime started\", timed_out=False)\n return self._action_detail(\"runtime start is still in progress\", timed_out=True)\n\n async def stop_runtime(self) -> dict[str, object] | str:\n self._refresh_state()\n if not self._started:\n if self._state == LifecycleState.STOPPING:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n return \"runtime already stopped\"\n\n self._state = LifecycleState.STOPPING\n try:\n self.workers.stop(timeout=self.ACTION_TIMEOUT_SECONDS, force=False)\n except TimeoutError:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n\n self._started = False\n self._state = LifecycleState.STOPPED\n return self._action_detail(\"runtime stopped\", timed_out=False)\n\n async def runtime_status(self) -> str:\n self._refresh_state()\n return self._state.value\n\n def _register_core_services(self) -> None:\n if self._core_registered:\n return\n self.services.register(\"configuration\", self.configuration)\n self.services.register(\"traces\", self.traces)\n self.services.register(\"health\", self.health)\n self.services.register(\"logs\", self.logs)\n self.services.register(\"workers\", self.workers)\n self.services.register(\"control_plane\", self.control_plane)\n self._core_registered = True\n\n def _register_health_contributors(self) -> None:\n for contributor in self.registry.health_contributors:\n self.health.register(contributor)\n\n def _register_workers(self) -> None:\n if self._workers_registered:\n return\n for worker in self.registry.workers:\n self.workers.register(worker)\n self._workers_registered = True\n\n def _refresh_state(self) -> None:\n lifecycle = self.workers.lifecycle_state()\n\n if self._state == LifecycleState.STOPPING:\n if lifecycle == LifecycleState.STOPPED:\n self._started = False\n self._state = LifecycleState.STOPPED\n return\n\n if not self._started:\n if lifecycle == LifecycleState.STOPPED:\n self._state = LifecycleState.STOPPED\n return\n\n self._state = lifecycle\n\n def _wait_for_state(self, target_states: set[LifecycleState], *, timeout: float) -> bool:\n deadline = monotonic() + timeout\n while monotonic() < deadline:\n self._refresh_state()\n if self._state in target_states:\n return True\n sleep(self.ACTION_POLL_INTERVAL_SECONDS)\n self._refresh_state()\n return self._state in target_states\n\n def _action_detail(self, message: str, *, timed_out: bool) -> dict[str, object]:\n self._refresh_state()\n return {\n \"message\": message,\n \"state\": self._state.value,\n \"timed_out\": timed_out,\n \"workers\": self.workers.snapshot(),\n }", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/core/runtime.py:RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.core.runtime", - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ] - }, - "diagnostics": { - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C0_SOURCE_CHUNKS": "exact_path_fetch", - "C4_SEMANTIC_ROLES": "exact_path_fetch", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C3_ENTRYPOINTS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 8, - "C4_SEMANTIC_ROLES": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C3_ENTRYPOINTS": 6 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C4_SEMANTIC_ROLES": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C4_SEMANTIC_ROLES", - "query": "RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - }, - { - "layer": "C3_ENTRYPOINTS", - "query": "RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 1, - "candidates_after_filter": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 6, - "candidates_after_filter": 6 - }, - { - "layer": "C3_ENTRYPOINTS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 3, - "candidates_after_filter": 3 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "RuntimeManager", - "alternatives": [ - "RuntimeManager" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C4_SEMANTIC_ROLES", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 6, - "fail_reason": null - }, - { - "layer": "C3_ENTRYPOINTS", - "status": "hit", - "hit_count": 3, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "symbol_resolution": 0, - "retrieval_total": 178, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 28, - "C0_SOURCE_CHUNKS": 16, - "C4_SEMANTIC_ROLES": 14, - "C2_DEPENDENCY_GRAPH": 56, - "C3_ENTRYPOINTS": 14 - }, - "merge_rank": 24 - } - } - }, - { - "step": "llm_answer", - "input": { - "query": "Объясни как работает класс RuntimeManager", - "rag_count": 12 - }, - "output": { - "llm_answer": "Класс `RuntimeManager` выглядит как менеджер жизненного цикла и координатор для различных компонентов в приложении runtime. Судя по предоставленным данным, он работает как центрального управляющего элемента, координирующего действия других сервисов и модулей.\nОсновные характеристики класса:\n- Инициализация происходит через конструктор (`__init__`), которому передаются различные компоненты приложения (конфигурации, службы, регистраторы трассировок, системы здоровья, логгеры и супервайзеры рабочих процессов).\n \n- В конструкторе устанавливаются начальные значения полей и создаются внутренние структуры данных, такие как `registry`, представляющий собой модульный регистр служб.\n\n- Класс содержит два основных состояния управления:\n - `_state`: отслеживает текущее состояние жизненного цикла менеджера (например, IDLE, RUNNING).\n - `_core_registered`: флаг, указывающий, зарегистрированы ли основные сервисы.\n - `_workers_registered`: флаг, показывающий, зарегистрированы ли рабочие процессы.\n\n- Реализован метод регистрации модуля (`register_module`), позволяющий добавлять новые модули в систему.\n\nНа основании имеющихся доказательств можно предположить следующие функции:\n- Координация запуска и остановки всех зарегистрированных служб и рабочих процессов.\n- Управление жизненным циклом приложения (запуск, остановка, переход между стадиями выполнения).\n- Регистрация новых модулей и их интеграция в общую инфраструктуру.\n\nОднако точная логика поведения и детальная реализация некоторых методов (таких как `register_module`) скрыты от прямого просмотра, поэтому возможны дополнительные детали, которые не учтены здесь." - }, - "diagnostics": { - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 919, - "evidence_rows": 12, - "evidence_chars": 7130 - }, - "evidence_summary": [ - { - "layer": "C1_SYMBOL_CATALOG", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "count": 6, - "unique_paths": 2 - }, - { - "layer": "C3_ENTRYPOINTS", - "count": 3, - "unique_paths": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 1, - "unique_paths": 1 - } - ], - "prompt_template_id": "intent_code_qa_explain_ru_v4", - "system_prompt_version": "v1" - }, - "timings_ms": { - "prompt_build": 0, - "llm_call": 2370 - } - } - } - ] - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_143636/full_chain_plba_code_subintents_v2_plba-v2-explain-runtime-manager.md b/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_143636/full_chain_plba_code_subintents_v2_plba-v2-explain-runtime-manager.md deleted file mode 100644 index 2b0f4d4..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_143636/full_chain_plba_code_subintents_v2_plba-v2-explain-runtime-manager.md +++ /dev/null @@ -1,34 +0,0 @@ -# plba-v2-explain-runtime-manager - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_subintents_v2.yaml -- runner: runtime -- mode: full_chain -- passed: True - -## Query -Объясни как работает класс RuntimeManager - -## Actual -{ - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 12, - "llm_answer": "Класс `RuntimeManager` выглядит как менеджер жизненного цикла и координатор для различных компонентов в приложении runtime. Судя по предоставленным данным, он работает как центрального управляющего элемента, координирующего действия других сервисов и модулей.\nОсновные характеристики класса:\n- Инициализация происходит через конструктор (`__init__`), которому передаются различные компоненты приложения (конфигурации, службы, регистраторы трассировок, системы здоровья, логгеры и супервайзеры рабочих процессов).\n \n- В конструкторе устанавливаются начальные значения полей и создаются внутренние структуры данных, такие как `registry`, представляющий собой модульный регистр служб.\n\n- Класс содержит два основных состояния управления:\n - `_state`: отслеживает текущее состояние жизненного цикла менеджера (например, IDLE, RUNNING).\n - `_core_registered`: флаг, указывающий, зарегистрированы ли основные сервисы.\n - `_workers_registered`: флаг, показывающий, зарегистрированы ли рабочие процессы.\n\n- Реализован метод регистрации модуля (`register_module`), позволяющий добавлять новые модули в систему.\n\nНа основании имеющихся доказательств можно предположить следующие функции:\n- Координация запуска и остановки всех зарегистрированных служб и рабочих процессов.\n- Управление жизненным циклом приложения (запуск, остановка, переход между стадиями выполнения).\n- Регистрация новых модулей и их интеграция в общую инфраструктуру.\n\nОднако точная логика поведения и детальная реализация некоторых методов (таких как `register_module`) скрыты от прямого просмотра, поэтому возможны дополнительные детали, которые не учтены здесь.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "RuntimeManager" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] -} - -## Mismatches -- none \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_143636/full_chain_plba_code_subintents_v2_plba-v2-explain-trace-service.json b/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_143636/full_chain_plba_code_subintents_v2_plba-v2-explain-trace-service.json deleted file mode 100644 index ace8c06..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_143636/full_chain_plba_code_subintents_v2_plba-v2-explain-trace-service.json +++ /dev/null @@ -1,2208 +0,0 @@ -{ - "case_id": "plba-v2-explain-trace-service", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_subintents_v2.yaml", - "runner": "runtime", - "mode": "full_chain", - "actual": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 14, - "llm_answer": "Класс `TraceService` является частью системы отслеживания трассировок в приложении и реализует функционал управления контекстами трассировки и записи событий в журнал.\nКлючевые особенности класса:\n\n1. Инициализация (`__init__()`):\n - При создании экземпляра класса указывается транспорт для отправки данных трассировки (`transport`) и хранилище контекста трассировки (`store`). Если эти параметры не указаны, используются дефолтные реализации: `NoOpTraceTransport()` и `TraceContextStore()`.\n - Создаётся объект `TraceRecordWriter`, отвечающий за запись записей о контексте и сообщений в транспорт.\n\n2. Создание нового контекста трассировки (`create_context()`):\n - Метод создаёт новый контекст трассировки, генерируя уникальный идентификатор трассировки (`trace_id`), устанавливая атрибуты, такие как имя трека (`alias`), родительский идентификатор (`parent_id`), тип события (`kind`) и дополнительные атрибуты (`attrs`).\n - Контекст сохраняется в хранилище и записывается в транспорт через объект `TraceRecordWriter`.\n \n3. Обертка для создания контекста трассировки (`open_context()`):\n - Обеспечивает временную область видимости созданного контекста трассировки внутри блока с помощью генератора контекста (`context manager`). После завершения блока созданный ранее контекст автоматически освобождается.\nПотоки взаимодействия:\n- Транспорт трассировки используется для передачи информации во внешние сервисы мониторинга или журналы.\n- Хранилище контекста сохраняет текущие состояния контекста трассировки для дальнейшего использования.\n\nТаким образом, класс служит центральным компонентом для инициализации и управления контекстами трассировки приложения, обеспечивая единый интерфейс для интеграции различных инструментов мониторинга и логирования.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "TraceService" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "passed": true, - "mismatches": [], - "details": { - "case_id": "plba-v2-explain-trace-service", - "text": "Объясни как работает класс TraceService", - "mode": "full_chain", - "run_started_at": "2026-03-12T14:36:36", - "rag_session_id": "7d11da21-faa0-4cea-aede-aeabe069164c", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Объясни как работает класс TraceService", - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "TraceService", - "alternatives": [ - "TraceService" - ], - "confidence": 0.99 - }, - "rag_count": 14, - "rag_rows": [ - { - "path": "src/app_runtime/tracing/service.py", - "content": "class TraceService\nTraceService(TraceContextFactory)", - "layer": "C1_SYMBOL_CATALOG", - "title": "TraceService", - "span_start": 39, - "span_end": 166, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "c2b2b976d99f2c600000b753731b26e0a69adcb4359398b93073590c5d5d04f4", - "qname": "TraceService", - "kind": "class", - "signature": "TraceService(TraceContextFactory)", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.tracing.service", - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "TraceService\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests service\n- reads and writes state attributes\n- participates in dataflow slices (13)", - "layer": "C4_SEMANTIC_ROLES", - "title": "TraceService", - "span_start": 39, - "span_end": 166, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 60, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "c2b2b976d99f2c600000b753731b26e0a69adcb4359398b93073590c5d5d04f4", - "symbol_name": "TraceService", - "qname": "TraceService", - "role": "pipeline_stage", - "confidence": 0.57, - "dataflow_participation": 13, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "TraceService.__init__\n -> TraceService.store\n -> TraceService.create_context", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "TraceService.__init__:dataflow_slice", - "span_start": 42, - "span_end": 61, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "3b052062067a78aef3302ee1d996897e02a67d1b340397bea4f59fe147c0492a", - "edge_type": "dataflow_slice", - "src_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "src_qname": "TraceService.__init__", - "dst_symbol_id": "ff44881104b65ef50ee6fe16d367d4a81b6e7eb5c44c0963cf4543faec785d4a", - "dst_ref": "TraceService.create_context", - "resolution": "resolved", - "slice_id": "3b052062067a78aef3302ee1d996897e02a67d1b340397bea4f59fe147c0492a", - "root_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "path_symbols": [ - "TraceService.__init__", - "TraceService.store", - "TraceService.create_context" - ], - "path_symbol_ids": [ - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "ff44881104b65ef50ee6fe16d367d4a81b6e7eb5c44c0963cf4543faec785d4a" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "TraceService.__init__\n -> TraceService.store\n -> TraceService.close_context", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "TraceService.__init__:dataflow_slice", - "span_start": 42, - "span_end": 84, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "7a9353ef57c9ae5d19b3a0c6ac50fad05e6d21d31bbe1cd1cd07af6332ba6505", - "edge_type": "dataflow_slice", - "src_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "src_qname": "TraceService.__init__", - "dst_symbol_id": "01e14158dcced7e52d0c8ac84ac7b9a75225c261b6aca6a1d7da802d0994721c", - "dst_ref": "TraceService.close_context", - "resolution": "resolved", - "slice_id": "7a9353ef57c9ae5d19b3a0c6ac50fad05e6d21d31bbe1cd1cd07af6332ba6505", - "root_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "path_symbols": [ - "TraceService.__init__", - "TraceService.store", - "TraceService.close_context" - ], - "path_symbol_ids": [ - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "01e14158dcced7e52d0c8ac84ac7b9a75225c261b6aca6a1d7da802d0994721c" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "TraceService.__init__\n -> TraceService.store\n -> TraceService.open_context", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "TraceService.__init__:dataflow_slice", - "span_start": 42, - "span_end": 78, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "a6e13b9ebc4fed84586afd53ed92a4d14757e440873f572b2337d5622ee96031", - "edge_type": "dataflow_slice", - "src_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "src_qname": "TraceService.__init__", - "dst_symbol_id": "2da3d5b20a947bf63e14c103be4689b72fd837e0a82abd6c497846375d4c7426", - "dst_ref": "TraceService.open_context", - "resolution": "resolved", - "slice_id": "a6e13b9ebc4fed84586afd53ed92a4d14757e440873f572b2337d5622ee96031", - "root_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "path_symbols": [ - "TraceService.__init__", - "TraceService.store", - "TraceService.open_context" - ], - "path_symbol_ids": [ - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "2da3d5b20a947bf63e14c103be4689b72fd837e0a82abd6c497846375d4c7426" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "TraceService.__init__\n -> TraceService.transport\n -> TraceService.__init__", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "TraceService.__init__:dataflow_slice", - "span_start": 41, - "span_end": 43, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "1e923a93faa05c3c43ca9b19bd047007a8589ccce57d3cc1798ae7f9f200af98", - "edge_type": "dataflow_slice", - "src_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "src_qname": "TraceService.__init__", - "dst_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "dst_ref": "TraceService.__init__", - "resolution": "resolved", - "slice_id": "1e923a93faa05c3c43ca9b19bd047007a8589ccce57d3cc1798ae7f9f200af98", - "root_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "path_symbols": [ - "TraceService.__init__", - "TraceService.transport", - "TraceService.__init__" - ], - "path_symbol_ids": [ - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "TraceService.__init__\n -> TraceService.store\n -> TraceService.current_trace_id", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "TraceService.__init__:dataflow_slice", - "span_start": 42, - "span_end": 81, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "3ea17138634b1190bded77ddb84aa1595124f6519b246f24fc4b02bd62b5cac1", - "edge_type": "dataflow_slice", - "src_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "src_qname": "TraceService.__init__", - "dst_symbol_id": "41135180f7b3b9ab20e097e0747474e219c37dd2366ef08a7b43c1f3edb10b4c", - "dst_ref": "TraceService.current_trace_id", - "resolution": "resolved", - "slice_id": "3ea17138634b1190bded77ddb84aa1595124f6519b246f24fc4b02bd62b5cac1", - "root_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "path_symbols": [ - "TraceService.__init__", - "TraceService.store", - "TraceService.current_trace_id" - ], - "path_symbol_ids": [ - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "41135180f7b3b9ab20e097e0747474e219c37dd2366ef08a7b43c1f3edb10b4c" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "TraceService.__init__\n -> TraceService.store\n -> TraceService.step", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "TraceService.__init__:dataflow_slice", - "span_start": 42, - "span_end": 88, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "9f34c5da9b09fba99df6f6b1bde183a9aeb45111b8218a747c71590c2c9f60f2", - "edge_type": "dataflow_slice", - "src_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "src_qname": "TraceService.__init__", - "dst_symbol_id": "c44bfbc66cf747283f30088da3e011a10395031d41e77b74e523c24997f641ca", - "dst_ref": "TraceService.step", - "resolution": "resolved", - "slice_id": "9f34c5da9b09fba99df6f6b1bde183a9aeb45111b8218a747c71590c2c9f60f2", - "root_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "path_symbols": [ - "TraceService.__init__", - "TraceService.store", - "TraceService.step" - ], - "path_symbol_ids": [ - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "c44bfbc66cf747283f30088da3e011a10395031d41e77b74e523c24997f641ca" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "class TraceRecordWriter:\n def __init__(self, transport: TraceTransport) -> None:\n self._logger = logging.getLogger(__name__)\n self._transport = transport\n\n def write_context(self, record: TraceContextRecord) -> None:\n try:\n self._transport.write_context(record)\n except Exception:\n self._logger.exception(\"Trace transport failed to write context %s\", record.trace_id)\n\n def write_message(self, record: TraceLogMessage) -> None:\n try:\n self._transport.write_message(record)\n except Exception:\n self._logger.exception(\"Trace transport failed to write message for %s\", record.trace_id)", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/tracing/service.py:TraceRecordWriter", - "span_start": 21, - "span_end": 36, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.tracing.service", - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "class TraceService(TraceContextFactory):\n def __init__(self, transport: TraceTransport | None = None, store: TraceContextStore | None = None) -> None:\n self.transport = transport or NoOpTraceTransport()\n self.store = store or TraceContextStore()\n self._writer = TraceRecordWriter(self.transport)\n\n def create_context(\n self,\n *,\n alias: str,\n parent_id: str | None = None,\n kind: str | None = None,\n attrs: dict[str, Any] | None = None,\n ) -> str:\n record = TraceContextRecord(\n trace_id=uuid4().hex,\n alias=str(alias or \"\"),\n parent_id=parent_id,\n type=kind,\n event_time=utc_now(),\n attrs=dict(attrs or {}),\n )\n self.store.push(record)\n self._writer.write_context(record)\n return record.trace_id\n\n @contextmanager\n def open_context(\n self,\n *,\n alias: str,\n parent_id: str | None = None,\n kind: str | None = None,\n attrs: dict[str, Any] | None = None,\n ) -> Iterator[str]:\n trace_id = self.create_context(alias=alias, parent_id=parent_id, kind=kind, attrs=attrs)\n try:\n yield trace_id\n finally:\n self.store.pop()\n\n def current_trace_id(self) -> str | None:\n return self.store.current_trace_id()\n\n def close_context(self) -> str | None:\n previous = self.store.pop()\n return previous.record.trace_id if previous else None\n\n def step(self, name: str) -> None:\n self.store.set_step(str(name or \"\"))\n\n def info(self, message: str, *, status: str | None = None, attrs: dict[str, Any] | None = None) -> None:\n self._write_message(\"INFO\", message, status, attrs)\n\n def debug(self, message: str, *, status: str | None = None, attrs: dict[str, Any] | None = None) -> None:\n self._write_message(\"DEBUG\", message, status, attrs)\n\n def warning(self, message: str, *, status: str | None = None, attrs: dict[str, Any] | None = None) -> None:\n self._write_message(\"WARNING\", message, status, attrs)\n\n def error(self, message: str, *, status: str | None = None, attrs: dict[str, Any] | None = None) -> None:\n self._write_message(\"ERROR\", message, status, attrs)\n\n def exception(self, message: str, *, status: str = \"failed\", attrs: dict[str, Any] | None = None) -> None:\n self._write_message(\"ERROR\", message, status, attrs)\n\n def new_root(self, operation: str) -> TraceContext:\n trace_id = self.create_context(alias=operation, kind=\"operation\", attrs={\"operation\": operation})\n return TraceContext(trace_id=trace_id, span_id=trace_id, attributes={\"operation\": operation})\n\n def child_of(self, parent: TraceContext, operation: str) -> TraceContext:\n trace_id = self.create_context(\n alias=operation,\n parent_id=parent.trace_id,\n kind=\"worker\",\n attrs={\"operation\": operation},\n )\n return TraceContext(\n trace_id=trace_id,\n span_id=trace_id,\n parent_span_id=parent.span_id,\n attributes={\"operation\": operation},\n )\n\n def attach(self, metadata: dict[str, object], context: TraceContext) -> dict[str, object]:\n updated = dict(metadata)\n updated[\"trace_id\"] = context.trace_id\n updated[\"span_id\"] = context.span_id\n updated[\"parent_span_id\"] = context.parent_span_id\n return updated\n\n def resume(self, metadata: dict[str, object], operation: str) -> TraceContext:\n trace_id = str(metadata.get(\"trace_id\") or uuid4().hex)\n span_id = str(metadata.get(\"span_id\") or trace_id)\n parent_id = metadata.get(\"parent_span_id\")\n self.create_context(\n alias=operation,\n parent_id=str(parent_id) if parent_id else None,\n kind=\"worker\",\n attrs=dict(metadata),\n )\n return TraceContext(\n trace_id=trace_id,\n span_id=span_id,\n parent_span_id=str(parent_id) if parent_id else None,\n attributes={\"operation\": operation},\n )\n\n def _write_message(\n self,\n level: TraceLevel,\n message: str,\n status: str | None,\n attrs: dict[str, Any] | None,\n ) -> None:\n active = self.store.current()\n if active is None:\n raise RuntimeError(\"Trace context is not bound. Call create_context() first.\")\n record = TraceLogMessage(\n trace_id=active.record.trace_id,\n step=active.step,\n status=str(status or \"\"),\n message=str(message or \"\"),\n level=level,\n event_time=utc_now(),\n attrs=dict(attrs or {}),\n )\n self._writer.write_message(record)", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/tracing/service.py:TraceService", - "span_start": 39, - "span_end": 166, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 1, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.tracing.service", - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "class TraceManager(TraceService):\n \"\"\"Compatibility alias during the transition from ConfigManager-shaped naming.\"\"\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/tracing/service.py:TraceManager", - "span_start": 169, - "span_end": 170, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 2, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.tracing.service", - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "llm_answer": "Класс `TraceService` является частью системы отслеживания трассировок в приложении и реализует функционал управления контекстами трассировки и записи событий в журнал.\nКлючевые особенности класса:\n\n1. Инициализация (`__init__()`):\n - При создании экземпляра класса указывается транспорт для отправки данных трассировки (`transport`) и хранилище контекста трассировки (`store`). Если эти параметры не указаны, используются дефолтные реализации: `NoOpTraceTransport()` и `TraceContextStore()`.\n - Создаётся объект `TraceRecordWriter`, отвечающий за запись записей о контексте и сообщений в транспорт.\n\n2. Создание нового контекста трассировки (`create_context()`):\n - Метод создаёт новый контекст трассировки, генерируя уникальный идентификатор трассировки (`trace_id`), устанавливая атрибуты, такие как имя трека (`alias`), родительский идентификатор (`parent_id`), тип события (`kind`) и дополнительные атрибуты (`attrs`).\n - Контекст сохраняется в хранилище и записывается в транспорт через объект `TraceRecordWriter`.\n \n3. Обертка для создания контекста трассировки (`open_context()`):\n - Обеспечивает временную область видимости созданного контекста трассировки внутри блока с помощью генератора контекста (`context manager`). После завершения блока созданный ранее контекст автоматически освобождается.\nПотоки взаимодействия:\n- Транспорт трассировки используется для передачи информации во внешние сервисы мониторинга или журналы.\n- Хранилище контекста сохраняет текущие состояния контекста трассировки для дальнейшего использования.\n\nТаким образом, класс служит центральным компонентом для инициализации и управления контекстами трассировки приложения, обеспечивая единый интерфейс для интеграции различных инструментов мониторинга и логирования.", - "summary": { - "router": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "confidence": null - }, - "retrieval": { - "profile": "code", - "layers_hit": [ - "C0_SOURCE_CHUNKS", - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS", - "C4_SEMANTIC_ROLES" - ], - "evidence_sufficient": true - }, - "llm": { - "answer_status": "answered", - "groundedness": "grounded" - } - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "TraceService" - ], - "keyword_hints": [ - "TraceService" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C0_SOURCE_CHUNKS": "exact_path_fetch", - "C4_SEMANTIC_ROLES": "exact_path_fetch", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C3_ENTRYPOINTS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 8, - "C4_SEMANTIC_ROLES": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C3_ENTRYPOINTS": 6 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C4_SEMANTIC_ROLES": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "TraceService", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "TraceService", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C4_SEMANTIC_ROLES", - "query": "TraceService", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "TraceService", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - }, - { - "layer": "C3_ENTRYPOINTS", - "query": "TraceService", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 1, - "candidates_after_filter": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 6, - "candidates_after_filter": 6 - }, - { - "layer": "C3_ENTRYPOINTS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 3, - "candidates_after_filter": 3 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "TraceService", - "alternatives": [ - "TraceService" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 3, - "fail_reason": null - }, - { - "layer": "C4_SEMANTIC_ROLES", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 6, - "fail_reason": null - }, - { - "layer": "C3_ENTRYPOINTS", - "status": "hit", - "hit_count": 3, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "router": 0, - "symbol_resolution": 0, - "retrieval_total": 118, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 35, - "C0_SOURCE_CHUNKS": 14, - "C4_SEMANTIC_ROLES": 13, - "C2_DEPENDENCY_GRAPH": 43, - "C3_ENTRYPOINTS": 10 - }, - "merge_rank": 23, - "prompt_build": 0, - "llm_call": 2601 - }, - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 1055, - "evidence_rows": 14, - "evidence_chars": 6323 - }, - "evidence_summary": [ - { - "layer": "C1_SYMBOL_CATALOG", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "count": 6, - "unique_paths": 1 - }, - { - "layer": "C3_ENTRYPOINTS", - "count": 3, - "unique_paths": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 3, - "unique_paths": 1 - } - ], - "prompt_template_id": "intent_code_qa_explain_ru_v4", - "system_prompt_version": "v1" - }, - "router": { - "conversation_mode": "START", - "keyword_hints": [ - "TraceService" - ], - "path_scope": [] - }, - "llm": { - "used_evidence_count": 14, - "missing_evidence_reason": null - } - }, - "run_info": { - "case_id": "plba-v2-explain-trace-service", - "mode": "full_chain", - "run_started_at": "2026-03-12T14:36:36", - "rag_session_id": "7d11da21-faa0-4cea-aede-aeabe069164c", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - }, - "input_request": { - "text": "Объясни как работает класс TraceService", - "normalized_query": "Объясни как работает класс TraceService" - }, - "steps": [ - { - "step": "intent_router", - "input": { - "query": "Объясни как работает класс TraceService" - }, - "output": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Объясни как работает класс TraceService" - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "TraceService" - ], - "keyword_hints": [ - "TraceService" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "timings_ms": { - "router": 0 - } - } - }, - { - "step": "retrieval", - "input": { - "query": "Объясни как работает класс TraceService" - }, - "output": { - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "TraceService", - "alternatives": [ - "TraceService" - ], - "confidence": 0.99 - }, - "rag_count": 14, - "rag_rows": [ - { - "path": "src/app_runtime/tracing/service.py", - "content": "class TraceService\nTraceService(TraceContextFactory)", - "layer": "C1_SYMBOL_CATALOG", - "title": "TraceService", - "span_start": 39, - "span_end": 166, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "c2b2b976d99f2c600000b753731b26e0a69adcb4359398b93073590c5d5d04f4", - "qname": "TraceService", - "kind": "class", - "signature": "TraceService(TraceContextFactory)", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.tracing.service", - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "TraceService\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests service\n- reads and writes state attributes\n- participates in dataflow slices (13)", - "layer": "C4_SEMANTIC_ROLES", - "title": "TraceService", - "span_start": 39, - "span_end": 166, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 60, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "c2b2b976d99f2c600000b753731b26e0a69adcb4359398b93073590c5d5d04f4", - "symbol_name": "TraceService", - "qname": "TraceService", - "role": "pipeline_stage", - "confidence": 0.57, - "dataflow_participation": 13, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "TraceService.__init__\n -> TraceService.store\n -> TraceService.create_context", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "TraceService.__init__:dataflow_slice", - "span_start": 42, - "span_end": 61, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "3b052062067a78aef3302ee1d996897e02a67d1b340397bea4f59fe147c0492a", - "edge_type": "dataflow_slice", - "src_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "src_qname": "TraceService.__init__", - "dst_symbol_id": "ff44881104b65ef50ee6fe16d367d4a81b6e7eb5c44c0963cf4543faec785d4a", - "dst_ref": "TraceService.create_context", - "resolution": "resolved", - "slice_id": "3b052062067a78aef3302ee1d996897e02a67d1b340397bea4f59fe147c0492a", - "root_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "path_symbols": [ - "TraceService.__init__", - "TraceService.store", - "TraceService.create_context" - ], - "path_symbol_ids": [ - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "ff44881104b65ef50ee6fe16d367d4a81b6e7eb5c44c0963cf4543faec785d4a" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "TraceService.__init__\n -> TraceService.store\n -> TraceService.close_context", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "TraceService.__init__:dataflow_slice", - "span_start": 42, - "span_end": 84, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "7a9353ef57c9ae5d19b3a0c6ac50fad05e6d21d31bbe1cd1cd07af6332ba6505", - "edge_type": "dataflow_slice", - "src_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "src_qname": "TraceService.__init__", - "dst_symbol_id": "01e14158dcced7e52d0c8ac84ac7b9a75225c261b6aca6a1d7da802d0994721c", - "dst_ref": "TraceService.close_context", - "resolution": "resolved", - "slice_id": "7a9353ef57c9ae5d19b3a0c6ac50fad05e6d21d31bbe1cd1cd07af6332ba6505", - "root_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "path_symbols": [ - "TraceService.__init__", - "TraceService.store", - "TraceService.close_context" - ], - "path_symbol_ids": [ - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "01e14158dcced7e52d0c8ac84ac7b9a75225c261b6aca6a1d7da802d0994721c" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "TraceService.__init__\n -> TraceService.store\n -> TraceService.open_context", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "TraceService.__init__:dataflow_slice", - "span_start": 42, - "span_end": 78, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "a6e13b9ebc4fed84586afd53ed92a4d14757e440873f572b2337d5622ee96031", - "edge_type": "dataflow_slice", - "src_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "src_qname": "TraceService.__init__", - "dst_symbol_id": "2da3d5b20a947bf63e14c103be4689b72fd837e0a82abd6c497846375d4c7426", - "dst_ref": "TraceService.open_context", - "resolution": "resolved", - "slice_id": "a6e13b9ebc4fed84586afd53ed92a4d14757e440873f572b2337d5622ee96031", - "root_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "path_symbols": [ - "TraceService.__init__", - "TraceService.store", - "TraceService.open_context" - ], - "path_symbol_ids": [ - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "2da3d5b20a947bf63e14c103be4689b72fd837e0a82abd6c497846375d4c7426" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "TraceService.__init__\n -> TraceService.transport\n -> TraceService.__init__", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "TraceService.__init__:dataflow_slice", - "span_start": 41, - "span_end": 43, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "1e923a93faa05c3c43ca9b19bd047007a8589ccce57d3cc1798ae7f9f200af98", - "edge_type": "dataflow_slice", - "src_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "src_qname": "TraceService.__init__", - "dst_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "dst_ref": "TraceService.__init__", - "resolution": "resolved", - "slice_id": "1e923a93faa05c3c43ca9b19bd047007a8589ccce57d3cc1798ae7f9f200af98", - "root_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "path_symbols": [ - "TraceService.__init__", - "TraceService.transport", - "TraceService.__init__" - ], - "path_symbol_ids": [ - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "TraceService.__init__\n -> TraceService.store\n -> TraceService.current_trace_id", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "TraceService.__init__:dataflow_slice", - "span_start": 42, - "span_end": 81, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "3ea17138634b1190bded77ddb84aa1595124f6519b246f24fc4b02bd62b5cac1", - "edge_type": "dataflow_slice", - "src_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "src_qname": "TraceService.__init__", - "dst_symbol_id": "41135180f7b3b9ab20e097e0747474e219c37dd2366ef08a7b43c1f3edb10b4c", - "dst_ref": "TraceService.current_trace_id", - "resolution": "resolved", - "slice_id": "3ea17138634b1190bded77ddb84aa1595124f6519b246f24fc4b02bd62b5cac1", - "root_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "path_symbols": [ - "TraceService.__init__", - "TraceService.store", - "TraceService.current_trace_id" - ], - "path_symbol_ids": [ - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "41135180f7b3b9ab20e097e0747474e219c37dd2366ef08a7b43c1f3edb10b4c" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "TraceService.__init__\n -> TraceService.store\n -> TraceService.step", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "TraceService.__init__:dataflow_slice", - "span_start": 42, - "span_end": 88, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "9f34c5da9b09fba99df6f6b1bde183a9aeb45111b8218a747c71590c2c9f60f2", - "edge_type": "dataflow_slice", - "src_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "src_qname": "TraceService.__init__", - "dst_symbol_id": "c44bfbc66cf747283f30088da3e011a10395031d41e77b74e523c24997f641ca", - "dst_ref": "TraceService.step", - "resolution": "resolved", - "slice_id": "9f34c5da9b09fba99df6f6b1bde183a9aeb45111b8218a747c71590c2c9f60f2", - "root_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "path_symbols": [ - "TraceService.__init__", - "TraceService.store", - "TraceService.step" - ], - "path_symbol_ids": [ - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "c44bfbc66cf747283f30088da3e011a10395031d41e77b74e523c24997f641ca" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "class TraceRecordWriter:\n def __init__(self, transport: TraceTransport) -> None:\n self._logger = logging.getLogger(__name__)\n self._transport = transport\n\n def write_context(self, record: TraceContextRecord) -> None:\n try:\n self._transport.write_context(record)\n except Exception:\n self._logger.exception(\"Trace transport failed to write context %s\", record.trace_id)\n\n def write_message(self, record: TraceLogMessage) -> None:\n try:\n self._transport.write_message(record)\n except Exception:\n self._logger.exception(\"Trace transport failed to write message for %s\", record.trace_id)", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/tracing/service.py:TraceRecordWriter", - "span_start": 21, - "span_end": 36, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.tracing.service", - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "class TraceService(TraceContextFactory):\n def __init__(self, transport: TraceTransport | None = None, store: TraceContextStore | None = None) -> None:\n self.transport = transport or NoOpTraceTransport()\n self.store = store or TraceContextStore()\n self._writer = TraceRecordWriter(self.transport)\n\n def create_context(\n self,\n *,\n alias: str,\n parent_id: str | None = None,\n kind: str | None = None,\n attrs: dict[str, Any] | None = None,\n ) -> str:\n record = TraceContextRecord(\n trace_id=uuid4().hex,\n alias=str(alias or \"\"),\n parent_id=parent_id,\n type=kind,\n event_time=utc_now(),\n attrs=dict(attrs or {}),\n )\n self.store.push(record)\n self._writer.write_context(record)\n return record.trace_id\n\n @contextmanager\n def open_context(\n self,\n *,\n alias: str,\n parent_id: str | None = None,\n kind: str | None = None,\n attrs: dict[str, Any] | None = None,\n ) -> Iterator[str]:\n trace_id = self.create_context(alias=alias, parent_id=parent_id, kind=kind, attrs=attrs)\n try:\n yield trace_id\n finally:\n self.store.pop()\n\n def current_trace_id(self) -> str | None:\n return self.store.current_trace_id()\n\n def close_context(self) -> str | None:\n previous = self.store.pop()\n return previous.record.trace_id if previous else None\n\n def step(self, name: str) -> None:\n self.store.set_step(str(name or \"\"))\n\n def info(self, message: str, *, status: str | None = None, attrs: dict[str, Any] | None = None) -> None:\n self._write_message(\"INFO\", message, status, attrs)\n\n def debug(self, message: str, *, status: str | None = None, attrs: dict[str, Any] | None = None) -> None:\n self._write_message(\"DEBUG\", message, status, attrs)\n\n def warning(self, message: str, *, status: str | None = None, attrs: dict[str, Any] | None = None) -> None:\n self._write_message(\"WARNING\", message, status, attrs)\n\n def error(self, message: str, *, status: str | None = None, attrs: dict[str, Any] | None = None) -> None:\n self._write_message(\"ERROR\", message, status, attrs)\n\n def exception(self, message: str, *, status: str = \"failed\", attrs: dict[str, Any] | None = None) -> None:\n self._write_message(\"ERROR\", message, status, attrs)\n\n def new_root(self, operation: str) -> TraceContext:\n trace_id = self.create_context(alias=operation, kind=\"operation\", attrs={\"operation\": operation})\n return TraceContext(trace_id=trace_id, span_id=trace_id, attributes={\"operation\": operation})\n\n def child_of(self, parent: TraceContext, operation: str) -> TraceContext:\n trace_id = self.create_context(\n alias=operation,\n parent_id=parent.trace_id,\n kind=\"worker\",\n attrs={\"operation\": operation},\n )\n return TraceContext(\n trace_id=trace_id,\n span_id=trace_id,\n parent_span_id=parent.span_id,\n attributes={\"operation\": operation},\n )\n\n def attach(self, metadata: dict[str, object], context: TraceContext) -> dict[str, object]:\n updated = dict(metadata)\n updated[\"trace_id\"] = context.trace_id\n updated[\"span_id\"] = context.span_id\n updated[\"parent_span_id\"] = context.parent_span_id\n return updated\n\n def resume(self, metadata: dict[str, object], operation: str) -> TraceContext:\n trace_id = str(metadata.get(\"trace_id\") or uuid4().hex)\n span_id = str(metadata.get(\"span_id\") or trace_id)\n parent_id = metadata.get(\"parent_span_id\")\n self.create_context(\n alias=operation,\n parent_id=str(parent_id) if parent_id else None,\n kind=\"worker\",\n attrs=dict(metadata),\n )\n return TraceContext(\n trace_id=trace_id,\n span_id=span_id,\n parent_span_id=str(parent_id) if parent_id else None,\n attributes={\"operation\": operation},\n )\n\n def _write_message(\n self,\n level: TraceLevel,\n message: str,\n status: str | None,\n attrs: dict[str, Any] | None,\n ) -> None:\n active = self.store.current()\n if active is None:\n raise RuntimeError(\"Trace context is not bound. Call create_context() first.\")\n record = TraceLogMessage(\n trace_id=active.record.trace_id,\n step=active.step,\n status=str(status or \"\"),\n message=str(message or \"\"),\n level=level,\n event_time=utc_now(),\n attrs=dict(attrs or {}),\n )\n self._writer.write_message(record)", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/tracing/service.py:TraceService", - "span_start": 39, - "span_end": 166, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 1, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.tracing.service", - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "class TraceManager(TraceService):\n \"\"\"Compatibility alias during the transition from ConfigManager-shaped naming.\"\"\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/tracing/service.py:TraceManager", - "span_start": 169, - "span_end": 170, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 2, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.tracing.service", - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ] - }, - "diagnostics": { - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C0_SOURCE_CHUNKS": "exact_path_fetch", - "C4_SEMANTIC_ROLES": "exact_path_fetch", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C3_ENTRYPOINTS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 8, - "C4_SEMANTIC_ROLES": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C3_ENTRYPOINTS": 6 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C4_SEMANTIC_ROLES": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "TraceService", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "TraceService", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C4_SEMANTIC_ROLES", - "query": "TraceService", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "TraceService", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - }, - { - "layer": "C3_ENTRYPOINTS", - "query": "TraceService", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 1, - "candidates_after_filter": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 6, - "candidates_after_filter": 6 - }, - { - "layer": "C3_ENTRYPOINTS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 3, - "candidates_after_filter": 3 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "TraceService", - "alternatives": [ - "TraceService" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 3, - "fail_reason": null - }, - { - "layer": "C4_SEMANTIC_ROLES", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 6, - "fail_reason": null - }, - { - "layer": "C3_ENTRYPOINTS", - "status": "hit", - "hit_count": 3, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "symbol_resolution": 0, - "retrieval_total": 118, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 35, - "C0_SOURCE_CHUNKS": 14, - "C4_SEMANTIC_ROLES": 13, - "C2_DEPENDENCY_GRAPH": 43, - "C3_ENTRYPOINTS": 10 - }, - "merge_rank": 23 - } - } - }, - { - "step": "llm_answer", - "input": { - "query": "Объясни как работает класс TraceService", - "rag_count": 14 - }, - "output": { - "llm_answer": "Класс `TraceService` является частью системы отслеживания трассировок в приложении и реализует функционал управления контекстами трассировки и записи событий в журнал.\nКлючевые особенности класса:\n\n1. Инициализация (`__init__()`):\n - При создании экземпляра класса указывается транспорт для отправки данных трассировки (`transport`) и хранилище контекста трассировки (`store`). Если эти параметры не указаны, используются дефолтные реализации: `NoOpTraceTransport()` и `TraceContextStore()`.\n - Создаётся объект `TraceRecordWriter`, отвечающий за запись записей о контексте и сообщений в транспорт.\n\n2. Создание нового контекста трассировки (`create_context()`):\n - Метод создаёт новый контекст трассировки, генерируя уникальный идентификатор трассировки (`trace_id`), устанавливая атрибуты, такие как имя трека (`alias`), родительский идентификатор (`parent_id`), тип события (`kind`) и дополнительные атрибуты (`attrs`).\n - Контекст сохраняется в хранилище и записывается в транспорт через объект `TraceRecordWriter`.\n \n3. Обертка для создания контекста трассировки (`open_context()`):\n - Обеспечивает временную область видимости созданного контекста трассировки внутри блока с помощью генератора контекста (`context manager`). После завершения блока созданный ранее контекст автоматически освобождается.\nПотоки взаимодействия:\n- Транспорт трассировки используется для передачи информации во внешние сервисы мониторинга или журналы.\n- Хранилище контекста сохраняет текущие состояния контекста трассировки для дальнейшего использования.\n\nТаким образом, класс служит центральным компонентом для инициализации и управления контекстами трассировки приложения, обеспечивая единый интерфейс для интеграции различных инструментов мониторинга и логирования." - }, - "diagnostics": { - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 1055, - "evidence_rows": 14, - "evidence_chars": 6323 - }, - "evidence_summary": [ - { - "layer": "C1_SYMBOL_CATALOG", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "count": 6, - "unique_paths": 1 - }, - { - "layer": "C3_ENTRYPOINTS", - "count": 3, - "unique_paths": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 3, - "unique_paths": 1 - } - ], - "prompt_template_id": "intent_code_qa_explain_ru_v4", - "system_prompt_version": "v1" - }, - "timings_ms": { - "prompt_build": 0, - "llm_call": 2601 - } - } - } - ] - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_143636/full_chain_plba_code_subintents_v2_plba-v2-explain-trace-service.md b/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_143636/full_chain_plba_code_subintents_v2_plba-v2-explain-trace-service.md deleted file mode 100644 index 4eea08d..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_143636/full_chain_plba_code_subintents_v2_plba-v2-explain-trace-service.md +++ /dev/null @@ -1,34 +0,0 @@ -# plba-v2-explain-trace-service - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_subintents_v2.yaml -- runner: runtime -- mode: full_chain -- passed: True - -## Query -Объясни как работает класс TraceService - -## Actual -{ - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 14, - "llm_answer": "Класс `TraceService` является частью системы отслеживания трассировок в приложении и реализует функционал управления контекстами трассировки и записи событий в журнал.\nКлючевые особенности класса:\n\n1. Инициализация (`__init__()`):\n - При создании экземпляра класса указывается транспорт для отправки данных трассировки (`transport`) и хранилище контекста трассировки (`store`). Если эти параметры не указаны, используются дефолтные реализации: `NoOpTraceTransport()` и `TraceContextStore()`.\n - Создаётся объект `TraceRecordWriter`, отвечающий за запись записей о контексте и сообщений в транспорт.\n\n2. Создание нового контекста трассировки (`create_context()`):\n - Метод создаёт новый контекст трассировки, генерируя уникальный идентификатор трассировки (`trace_id`), устанавливая атрибуты, такие как имя трека (`alias`), родительский идентификатор (`parent_id`), тип события (`kind`) и дополнительные атрибуты (`attrs`).\n - Контекст сохраняется в хранилище и записывается в транспорт через объект `TraceRecordWriter`.\n \n3. Обертка для создания контекста трассировки (`open_context()`):\n - Обеспечивает временную область видимости созданного контекста трассировки внутри блока с помощью генератора контекста (`context manager`). После завершения блока созданный ранее контекст автоматически освобождается.\nПотоки взаимодействия:\n- Транспорт трассировки используется для передачи информации во внешние сервисы мониторинга или журналы.\n- Хранилище контекста сохраняет текущие состояния контекста трассировки для дальнейшего использования.\n\nТаким образом, класс служит центральным компонентом для инициализации и управления контекстами трассировки приложения, обеспечивая единый интерфейс для интеграции различных инструментов мониторинга и логирования.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "TraceService" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] -} - -## Mismatches -- none \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_143636/full_chain_plba_code_subintents_v2_plba-v2-find-entrypoints-control-plane.json b/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_143636/full_chain_plba_code_subintents_v2_plba-v2-find-entrypoints-control-plane.json deleted file mode 100644 index 8ede8a9..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_143636/full_chain_plba_code_subintents_v2_plba-v2-find-entrypoints-control-plane.json +++ /dev/null @@ -1,1236 +0,0 @@ -{ - "case_id": "plba-v2-find-entrypoints-control-plane", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_subintents_v2.yaml", - "runner": "runtime", - "mode": "full_chain", - "actual": { - "intent": "CODE_QA", - "sub_intent": "FIND_ENTRYPOINTS", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 9, - "llm_answer": "В данном приложении обнаружены следующие подтвержденные точки входа (entrypoints) HTTP control plane:\n\n1. HTTP GET `/health \n Объявлен в файле `src/app_runtime/control/http_app.py`. Контролируется методом `health()` класса `HttpControlAppFactory`, который возвращает статус здоровья приложения.\n\n2. HTTP POST/PUT/PATCH/DELETE `/actions/{action}` и HTTP GET `/actions/{action} \n Объявлены в том же файле `src/app_runtime/control/http_app.py`. Данные маршруты обрабатываются методами `action()` и контролируются классом `HttpControlAppFactory`.\n\nВсе обнаруженные маршруты объявлены напрямую в коде через декораторы FastAPI (`@app.get`, `@app.post`), что подтверждает их реальное существование и доступность.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "HTTP", - "control", - "plane" - ], - "layers": [ - "C3_ENTRYPOINTS", - "C0_SOURCE_CHUNKS" - ] - }, - "passed": true, - "mismatches": [], - "details": { - "case_id": "plba-v2-find-entrypoints-control-plane", - "text": "Найди точки входа HTTP control plane", - "mode": "full_chain", - "run_started_at": "2026-03-12T14:36:36", - "rag_session_id": "7d11da21-faa0-4cea-aede-aeabe069164c", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Найди точки входа HTTP control plane", - "symbol_resolution": { - "status": "not_found", - "resolved_symbol": null, - "alternatives": [ - "HTTP", - "control", - "plane" - ], - "confidence": 0.0 - }, - "rag_count": 9, - "rag_rows": [ - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "class HttpControlChannel(ControlChannel):\n def __init__(self, host: str, port: int, timeout: int) -> None:\n self._timeout = timeout\n self._runner = UvicornThreadRunner(host, port, timeout)\n self._factory = HttpControlAppFactory()\n self._actions: ControlActionSet | None = None\n\n async def start(self, actions: ControlActionSet) -> None:\n self._actions = actions\n app = self._factory.create(self._health_response, self._action_response)\n await self._runner.start(app)\n\n async def stop(self) -> None:\n await self._runner.stop()\n\n @property\n def port(self) -> int:\n return self._runner.port\n\n async def _health_response(self) -> dict[str, object]:\n if self._actions is None:\n return {\"status\": \"unhealthy\", \"detail\": \"control actions are not configured\"}\n return await asyncio.wait_for(self._actions.health(), timeout=float(self._timeout))\n\n async def _action_response(self, action: str, _client_source: str = \"unknown\") -> JSONResponse:\n if self._actions is None:\n return JSONResponse(content={\"status\": \"error\", \"detail\": f\"{action} handler is not configured\"}, status_code=404)\n callbacks = {\n \"start\": self._actions.start,\n \"stop\": self._actions.stop,\n \"status\": self._actions.status,\n }\n callback = callbacks.get(action)\n if callback is None:\n return JSONResponse(content={\"status\": \"error\", \"detail\": f\"unsupported action: {action}\"}, status_code=404)\n action_timeout = max(float(self._timeout), 10.0) if action in {\"start\", \"stop\"} else float(self._timeout)\n try:\n detail = await asyncio.wait_for(callback(), timeout=action_timeout)\n except asyncio.TimeoutError:\n return JSONResponse(\n content={\"status\": \"accepted\", \"detail\": f\"{action} operation is still in progress\"},\n status_code=202,\n )\n except Exception as exc:\n return JSONResponse(content={\"status\": \"error\", \"detail\": str(exc)}, status_code=500)\n return JSONResponse(content={\"status\": \"ok\", \"detail\": detail or f\"{action} action accepted\"}, status_code=200)", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/http_channel.py:HttpControlChannel", - "span_start": 12, - "span_end": 57, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.http_channel", - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "class HttpControlAppFactory:\n def create(\n self,\n health_provider: Callable[[], Awaitable[HealthPayload]],\n action_provider: Callable[[str, str], Awaitable[JSONResponse]],\n ) -> FastAPI:\n app = FastAPI(title=\"PLBA Control API\")\n\n @app.middleware(\"http\")\n async def log_api_call(request: Request, call_next): # type: ignore[no-untyped-def]\n started = time.monotonic()\n response = await call_next(request)\n response.headers[\"X-Response-Time-Ms\"] = str(int((time.monotonic() - started) * 1000))\n return response\n\n @app.get(\"/health\")\n async def health() -> JSONResponse:\n payload = await health_provider()\n status_code = 200 if payload.get(\"status\") == \"ok\" else 503\n return JSONResponse(content=payload, status_code=status_code)\n\n @app.get(\"/actions/{action}\")\n @app.post(\"/actions/{action}\")\n async def action(action: str, request: Request) -> JSONResponse:\n client_source = self._client_source(request)\n if action in {\"start\", \"stop\"}:\n LOGGER.warning(\"Control action requested: /actions/%s client=%s\", action, client_source)\n return await action_provider(action, client_source)\n\n return app\n\n def _client_source(self, request: Request) -> str:\n explicit_header = request.headers.get(\"X-Client-Source\", \"\").strip()\n if explicit_header:\n return explicit_header\n user_agent = request.headers.get(\"User-Agent\", \"\").strip()\n if user_agent:\n return f\"user-agent:{user_agent}\"\n return \"unknown\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/http_app.py:HttpControlAppFactory", - "span_start": 15, - "span_end": 53, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.http_app", - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "class ControlActionSet:\n health: HealthHandler\n start: ActionHandler\n stop: ActionHandler\n status: ActionHandler", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/base.py:ControlActionSet", - "span_start": 14, - "span_end": 18, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.base", - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/__init__.py", - "content": "from app_runtime.control.base import ControlActionSet, ControlChannel\nfrom app_runtime.control.http_channel import HttpControlChannel\nfrom app_runtime.control.service import ControlPlaneService\n\n__all__ = [\"ControlActionSet\", \"ControlChannel\", \"ControlPlaneService\", \"HttpControlChannel\"]", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/__init__.py:1-5", - "span_start": 1, - "span_end": 5, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.app_runtime.control.__init__", - "is_test": false, - "blob_sha": "bf3c37e3369a84cc618adc0fd71c232e5eb4b871eaff743069a17e661e498316", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "class ControlChannel(ABC):\n @abstractmethod\n async def start(self, actions: ControlActionSet) -> None:\n \"\"\"Start the control channel and bind handlers.\"\"\"\n\n @abstractmethod\n async def stop(self) -> None:\n \"\"\"Stop the control channel and release resources.\"\"\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/base.py:ControlChannel", - "span_start": 21, - "span_end": 28, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 1, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.base", - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_runner.py", - "content": "class UvicornThreadRunner:\n def __init__(self, host: str, port: int, timeout: int) -> None:\n self._host = host\n self._port = port\n self._timeout = timeout\n self._server: Server | None = None\n self._thread: Thread | None = None\n self._error: BaseException | None = None\n\n async def start(self, app: FastAPI) -> None:\n if self._thread is not None and self._thread.is_alive():\n return\n self._error = None\n config = Config(app=app, host=self._host, port=self._port, log_level=\"warning\")\n self._server = Server(config)\n self._thread = Thread(target=self._serve, name=\"plba-http-control\", daemon=True)\n self._thread.start()\n await self._wait_until_started()\n\n async def stop(self) -> None:\n if self._server is None or self._thread is None:\n return\n self._server.should_exit = True\n await asyncio.to_thread(self._thread.join, self._timeout)\n self._server = None\n self._thread = None\n\n @property\n def port(self) -> int:\n if self._server is None or not getattr(self._server, \"servers\", None):\n return self._port\n socket = self._server.servers[0].sockets[0]\n return int(socket.getsockname()[1])\n\n async def _wait_until_started(self) -> None:\n if self._server is None:\n raise RuntimeError(\"Server is not initialized\")\n deadline = asyncio.get_running_loop().time() + max(float(self._timeout), 1.0)\n while not self._server.started:\n if self._error is not None:\n raise RuntimeError(\"HTTP control server failed to start\") from self._error\n if asyncio.get_running_loop().time() >= deadline:\n raise TimeoutError(\"HTTP control server startup timed out\")\n await asyncio.sleep(0.05)\n\n def _serve(self) -> None:\n if self._server is None:\n return\n try:\n asyncio.run(self._server.serve())\n except BaseException as exc: # noqa: BLE001\n self._error = exc", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/http_runner.py:UvicornThreadRunner", - "span_start": 10, - "span_end": 61, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.http_runner", - "is_test": false, - "blob_sha": "3779fdd2878b770e789a35bb2a89c9d79f13b61c26d7db1b3b683f9bb9e1623f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "llm_answer": "В данном приложении обнаружены следующие подтвержденные точки входа (entrypoints) HTTP control plane:\n\n1. HTTP GET `/health \n Объявлен в файле `src/app_runtime/control/http_app.py`. Контролируется методом `health()` класса `HttpControlAppFactory`, который возвращает статус здоровья приложения.\n\n2. HTTP POST/PUT/PATCH/DELETE `/actions/{action}` и HTTP GET `/actions/{action} \n Объявлены в том же файле `src/app_runtime/control/http_app.py`. Данные маршруты обрабатываются методами `action()` и контролируются классом `HttpControlAppFactory`.\n\nВсе обнаруженные маршруты объявлены напрямую в коде через декораторы FastAPI (`@app.get`, `@app.post`), что подтверждает их реальное существование и доступность.", - "summary": { - "router": { - "intent": "CODE_QA", - "sub_intent": "FIND_ENTRYPOINTS", - "confidence": null - }, - "retrieval": { - "profile": "code", - "layers_hit": [ - "C0_SOURCE_CHUNKS", - "C3_ENTRYPOINTS" - ], - "evidence_sufficient": true - }, - "llm": { - "answer_status": "answered", - "groundedness": "grounded" - } - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "FIND_ENTRYPOINTS", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C3_ENTRYPOINTS", - "C0_SOURCE_CHUNKS" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "HTTP", - "control", - "plane" - ], - "keyword_hints": [ - "HTTP", - "control", - "plane" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "execution": { - "executed_layers": [ - "C3_ENTRYPOINTS", - "C0_SOURCE_CHUNKS" - ], - "retrieval_mode_by_layer": { - "C3_ENTRYPOINTS": "exact_path_fetch", - "C0_SOURCE_CHUNKS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C3_ENTRYPOINTS": 12, - "C0_SOURCE_CHUNKS": 6 - }, - "filters_by_layer": { - "C3_ENTRYPOINTS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C3_ENTRYPOINTS", - "query": "Найди точки входа HTTP control plane", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 12, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Найди точки входа HTTP control plane", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C3_ENTRYPOINTS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 3, - "candidates_after_filter": 3 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 6, - "candidates_after_filter": 6 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "not_found", - "resolved_symbol": null, - "alternatives": [ - "HTTP", - "control", - "plane" - ] - }, - "layers": [ - { - "layer": "C3_ENTRYPOINTS", - "status": "hit", - "hit_count": 3, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 6, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "router": 0, - "symbol_resolution": 0, - "retrieval_total": 42, - "retrieval_by_layer": { - "C3_ENTRYPOINTS": 18, - "C0_SOURCE_CHUNKS": 24 - }, - "merge_rank": 0, - "prompt_build": 0, - "llm_call": 1368 - }, - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 1195, - "evidence_rows": 9, - "evidence_chars": 6731 - }, - "evidence_summary": [ - { - "layer": "C3_ENTRYPOINTS", - "count": 3, - "unique_paths": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 6, - "unique_paths": 5 - } - ], - "prompt_template_id": "intent_code_qa_find_entrypoints_ru_v4", - "system_prompt_version": "v1" - }, - "router": { - "conversation_mode": "START", - "keyword_hints": [ - "HTTP", - "control", - "plane" - ], - "path_scope": [] - }, - "llm": { - "used_evidence_count": 9, - "missing_evidence_reason": null - } - }, - "run_info": { - "case_id": "plba-v2-find-entrypoints-control-plane", - "mode": "full_chain", - "run_started_at": "2026-03-12T14:36:36", - "rag_session_id": "7d11da21-faa0-4cea-aede-aeabe069164c", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - }, - "input_request": { - "text": "Найди точки входа HTTP control plane", - "normalized_query": "Найди точки входа HTTP control plane" - }, - "steps": [ - { - "step": "intent_router", - "input": { - "query": "Найди точки входа HTTP control plane" - }, - "output": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Найди точки входа HTTP control plane" - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "FIND_ENTRYPOINTS", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C3_ENTRYPOINTS", - "C0_SOURCE_CHUNKS" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "HTTP", - "control", - "plane" - ], - "keyword_hints": [ - "HTTP", - "control", - "plane" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "timings_ms": { - "router": 0 - } - } - }, - { - "step": "retrieval", - "input": { - "query": "Найди точки входа HTTP control plane" - }, - "output": { - "symbol_resolution": { - "status": "not_found", - "resolved_symbol": null, - "alternatives": [ - "HTTP", - "control", - "plane" - ], - "confidence": 0.0 - }, - "rag_count": 9, - "rag_rows": [ - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "class HttpControlChannel(ControlChannel):\n def __init__(self, host: str, port: int, timeout: int) -> None:\n self._timeout = timeout\n self._runner = UvicornThreadRunner(host, port, timeout)\n self._factory = HttpControlAppFactory()\n self._actions: ControlActionSet | None = None\n\n async def start(self, actions: ControlActionSet) -> None:\n self._actions = actions\n app = self._factory.create(self._health_response, self._action_response)\n await self._runner.start(app)\n\n async def stop(self) -> None:\n await self._runner.stop()\n\n @property\n def port(self) -> int:\n return self._runner.port\n\n async def _health_response(self) -> dict[str, object]:\n if self._actions is None:\n return {\"status\": \"unhealthy\", \"detail\": \"control actions are not configured\"}\n return await asyncio.wait_for(self._actions.health(), timeout=float(self._timeout))\n\n async def _action_response(self, action: str, _client_source: str = \"unknown\") -> JSONResponse:\n if self._actions is None:\n return JSONResponse(content={\"status\": \"error\", \"detail\": f\"{action} handler is not configured\"}, status_code=404)\n callbacks = {\n \"start\": self._actions.start,\n \"stop\": self._actions.stop,\n \"status\": self._actions.status,\n }\n callback = callbacks.get(action)\n if callback is None:\n return JSONResponse(content={\"status\": \"error\", \"detail\": f\"unsupported action: {action}\"}, status_code=404)\n action_timeout = max(float(self._timeout), 10.0) if action in {\"start\", \"stop\"} else float(self._timeout)\n try:\n detail = await asyncio.wait_for(callback(), timeout=action_timeout)\n except asyncio.TimeoutError:\n return JSONResponse(\n content={\"status\": \"accepted\", \"detail\": f\"{action} operation is still in progress\"},\n status_code=202,\n )\n except Exception as exc:\n return JSONResponse(content={\"status\": \"error\", \"detail\": str(exc)}, status_code=500)\n return JSONResponse(content={\"status\": \"ok\", \"detail\": detail or f\"{action} action accepted\"}, status_code=200)", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/http_channel.py:HttpControlChannel", - "span_start": 12, - "span_end": 57, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.http_channel", - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "class HttpControlAppFactory:\n def create(\n self,\n health_provider: Callable[[], Awaitable[HealthPayload]],\n action_provider: Callable[[str, str], Awaitable[JSONResponse]],\n ) -> FastAPI:\n app = FastAPI(title=\"PLBA Control API\")\n\n @app.middleware(\"http\")\n async def log_api_call(request: Request, call_next): # type: ignore[no-untyped-def]\n started = time.monotonic()\n response = await call_next(request)\n response.headers[\"X-Response-Time-Ms\"] = str(int((time.monotonic() - started) * 1000))\n return response\n\n @app.get(\"/health\")\n async def health() -> JSONResponse:\n payload = await health_provider()\n status_code = 200 if payload.get(\"status\") == \"ok\" else 503\n return JSONResponse(content=payload, status_code=status_code)\n\n @app.get(\"/actions/{action}\")\n @app.post(\"/actions/{action}\")\n async def action(action: str, request: Request) -> JSONResponse:\n client_source = self._client_source(request)\n if action in {\"start\", \"stop\"}:\n LOGGER.warning(\"Control action requested: /actions/%s client=%s\", action, client_source)\n return await action_provider(action, client_source)\n\n return app\n\n def _client_source(self, request: Request) -> str:\n explicit_header = request.headers.get(\"X-Client-Source\", \"\").strip()\n if explicit_header:\n return explicit_header\n user_agent = request.headers.get(\"User-Agent\", \"\").strip()\n if user_agent:\n return f\"user-agent:{user_agent}\"\n return \"unknown\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/http_app.py:HttpControlAppFactory", - "span_start": 15, - "span_end": 53, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.http_app", - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "class ControlActionSet:\n health: HealthHandler\n start: ActionHandler\n stop: ActionHandler\n status: ActionHandler", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/base.py:ControlActionSet", - "span_start": 14, - "span_end": 18, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.base", - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/__init__.py", - "content": "from app_runtime.control.base import ControlActionSet, ControlChannel\nfrom app_runtime.control.http_channel import HttpControlChannel\nfrom app_runtime.control.service import ControlPlaneService\n\n__all__ = [\"ControlActionSet\", \"ControlChannel\", \"ControlPlaneService\", \"HttpControlChannel\"]", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/__init__.py:1-5", - "span_start": 1, - "span_end": 5, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.app_runtime.control.__init__", - "is_test": false, - "blob_sha": "bf3c37e3369a84cc618adc0fd71c232e5eb4b871eaff743069a17e661e498316", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "class ControlChannel(ABC):\n @abstractmethod\n async def start(self, actions: ControlActionSet) -> None:\n \"\"\"Start the control channel and bind handlers.\"\"\"\n\n @abstractmethod\n async def stop(self) -> None:\n \"\"\"Stop the control channel and release resources.\"\"\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/base.py:ControlChannel", - "span_start": 21, - "span_end": 28, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 1, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.base", - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_runner.py", - "content": "class UvicornThreadRunner:\n def __init__(self, host: str, port: int, timeout: int) -> None:\n self._host = host\n self._port = port\n self._timeout = timeout\n self._server: Server | None = None\n self._thread: Thread | None = None\n self._error: BaseException | None = None\n\n async def start(self, app: FastAPI) -> None:\n if self._thread is not None and self._thread.is_alive():\n return\n self._error = None\n config = Config(app=app, host=self._host, port=self._port, log_level=\"warning\")\n self._server = Server(config)\n self._thread = Thread(target=self._serve, name=\"plba-http-control\", daemon=True)\n self._thread.start()\n await self._wait_until_started()\n\n async def stop(self) -> None:\n if self._server is None or self._thread is None:\n return\n self._server.should_exit = True\n await asyncio.to_thread(self._thread.join, self._timeout)\n self._server = None\n self._thread = None\n\n @property\n def port(self) -> int:\n if self._server is None or not getattr(self._server, \"servers\", None):\n return self._port\n socket = self._server.servers[0].sockets[0]\n return int(socket.getsockname()[1])\n\n async def _wait_until_started(self) -> None:\n if self._server is None:\n raise RuntimeError(\"Server is not initialized\")\n deadline = asyncio.get_running_loop().time() + max(float(self._timeout), 1.0)\n while not self._server.started:\n if self._error is not None:\n raise RuntimeError(\"HTTP control server failed to start\") from self._error\n if asyncio.get_running_loop().time() >= deadline:\n raise TimeoutError(\"HTTP control server startup timed out\")\n await asyncio.sleep(0.05)\n\n def _serve(self) -> None:\n if self._server is None:\n return\n try:\n asyncio.run(self._server.serve())\n except BaseException as exc: # noqa: BLE001\n self._error = exc", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/http_runner.py:UvicornThreadRunner", - "span_start": 10, - "span_end": 61, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.http_runner", - "is_test": false, - "blob_sha": "3779fdd2878b770e789a35bb2a89c9d79f13b61c26d7db1b3b683f9bb9e1623f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ] - }, - "diagnostics": { - "execution": { - "executed_layers": [ - "C3_ENTRYPOINTS", - "C0_SOURCE_CHUNKS" - ], - "retrieval_mode_by_layer": { - "C3_ENTRYPOINTS": "exact_path_fetch", - "C0_SOURCE_CHUNKS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C3_ENTRYPOINTS": 12, - "C0_SOURCE_CHUNKS": 6 - }, - "filters_by_layer": { - "C3_ENTRYPOINTS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C3_ENTRYPOINTS", - "query": "Найди точки входа HTTP control plane", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 12, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Найди точки входа HTTP control plane", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C3_ENTRYPOINTS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 3, - "candidates_after_filter": 3 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 6, - "candidates_after_filter": 6 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "not_found", - "resolved_symbol": null, - "alternatives": [ - "HTTP", - "control", - "plane" - ] - }, - "layers": [ - { - "layer": "C3_ENTRYPOINTS", - "status": "hit", - "hit_count": 3, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 6, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "symbol_resolution": 0, - "retrieval_total": 42, - "retrieval_by_layer": { - "C3_ENTRYPOINTS": 18, - "C0_SOURCE_CHUNKS": 24 - }, - "merge_rank": 0 - } - } - }, - { - "step": "llm_answer", - "input": { - "query": "Найди точки входа HTTP control plane", - "rag_count": 9 - }, - "output": { - "llm_answer": "В данном приложении обнаружены следующие подтвержденные точки входа (entrypoints) HTTP control plane:\n\n1. HTTP GET `/health \n Объявлен в файле `src/app_runtime/control/http_app.py`. Контролируется методом `health()` класса `HttpControlAppFactory`, который возвращает статус здоровья приложения.\n\n2. HTTP POST/PUT/PATCH/DELETE `/actions/{action}` и HTTP GET `/actions/{action} \n Объявлены в том же файле `src/app_runtime/control/http_app.py`. Данные маршруты обрабатываются методами `action()` и контролируются классом `HttpControlAppFactory`.\n\nВсе обнаруженные маршруты объявлены напрямую в коде через декораторы FastAPI (`@app.get`, `@app.post`), что подтверждает их реальное существование и доступность." - }, - "diagnostics": { - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 1195, - "evidence_rows": 9, - "evidence_chars": 6731 - }, - "evidence_summary": [ - { - "layer": "C3_ENTRYPOINTS", - "count": 3, - "unique_paths": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 6, - "unique_paths": 5 - } - ], - "prompt_template_id": "intent_code_qa_find_entrypoints_ru_v4", - "system_prompt_version": "v1" - }, - "timings_ms": { - "prompt_build": 0, - "llm_call": 1368 - } - } - } - ] - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_143636/full_chain_plba_code_subintents_v2_plba-v2-find-entrypoints-control-plane.md b/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_143636/full_chain_plba_code_subintents_v2_plba-v2-find-entrypoints-control-plane.md deleted file mode 100644 index 160dc77..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_143636/full_chain_plba_code_subintents_v2_plba-v2-find-entrypoints-control-plane.md +++ /dev/null @@ -1,33 +0,0 @@ -# plba-v2-find-entrypoints-control-plane - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_subintents_v2.yaml -- runner: runtime -- mode: full_chain -- passed: True - -## Query -Найди точки входа HTTP control plane - -## Actual -{ - "intent": "CODE_QA", - "sub_intent": "FIND_ENTRYPOINTS", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 9, - "llm_answer": "В данном приложении обнаружены следующие подтвержденные точки входа (entrypoints) HTTP control plane:\n\n1. HTTP GET `/health \n Объявлен в файле `src/app_runtime/control/http_app.py`. Контролируется методом `health()` класса `HttpControlAppFactory`, который возвращает статус здоровья приложения.\n\n2. HTTP POST/PUT/PATCH/DELETE `/actions/{action}` и HTTP GET `/actions/{action} \n Объявлены в том же файле `src/app_runtime/control/http_app.py`. Данные маршруты обрабатываются методами `action()` и контролируются классом `HttpControlAppFactory`.\n\nВсе обнаруженные маршруты объявлены напрямую в коде через декораторы FastAPI (`@app.get`, `@app.post`), что подтверждает их реальное существование и доступность.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "HTTP", - "control", - "plane" - ], - "layers": [ - "C3_ENTRYPOINTS", - "C0_SOURCE_CHUNKS" - ] -} - -## Mismatches -- none \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_143636/full_chain_plba_code_subintents_v2_plba-v2-find-entrypoints-health-endpoint.json b/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_143636/full_chain_plba_code_subintents_v2_plba-v2-find-entrypoints-health-endpoint.json deleted file mode 100644 index 135d94d..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_143636/full_chain_plba_code_subintents_v2_plba-v2-find-entrypoints-health-endpoint.json +++ /dev/null @@ -1,1228 +0,0 @@ -{ - "case_id": "plba-v2-find-entrypoints-health-endpoint", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_subintents_v2.yaml", - "runner": "runtime", - "mode": "full_chain", - "actual": { - "intent": "CODE_QA", - "sub_intent": "FIND_ENTRYPOINTS", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 9, - "llm_answer": "У тебя есть две подтвержденные точки HTTP-запросов (`GET /`, `POST /`), объявленные в файле `http_app.py`. Однако конкретно маршрут `/health` нигде явно не указан.\n\nТем не менее, исходя из предоставленного контекста, у нас есть компонент класса `HealthRegistry`, ответственный за сбор и обработку данных о здоровье системы. Вероятно, реализация проверки здоровья (`health check`) реализована через этот класс, хотя прямого указания на маршрут `/health` в предоставленных фрагментах кода нет.\n\nТаким образом, возможная кандидатура на роль health-endpoint — это обращение к экземпляру класса `HealthRegistry` с запросом на получение информации о текущем состоянии компонентов системы (хотя точный URL может отличаться от `/health`).\n\nОднако стоит отметить, что без дополнительных сведений точно утверждать наличие именно маршрута `/health` нельзя. Рекомендую проверить непосредственно код вашего приложения на предмет наличия маршрутов с этим конкретным именем.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "health", - "endpoint" - ], - "layers": [ - "C3_ENTRYPOINTS", - "C0_SOURCE_CHUNKS" - ] - }, - "passed": false, - "mismatches": [ - "llm: expected answer to contain 'GET /health'" - ], - "details": { - "case_id": "plba-v2-find-entrypoints-health-endpoint", - "text": "Где health endpoint?", - "mode": "full_chain", - "run_started_at": "2026-03-12T14:36:36", - "rag_session_id": "7d11da21-faa0-4cea-aede-aeabe069164c", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Где health endpoint?", - "symbol_resolution": { - "status": "not_found", - "resolved_symbol": null, - "alternatives": [ - "health", - "endpoint" - ], - "confidence": 0.0 - }, - "rag_count": 9, - "rag_rows": [ - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/health/registry.py", - "content": "class HealthRegistry:\n def __init__(self) -> None:\n self._contributors: list[HealthContributor] = []\n\n def register(self, contributor: HealthContributor) -> None:\n self._contributors.append(contributor)\n\n def contributor_healths(self) -> list[WorkerHealth]:\n return [contributor.health() for contributor in self._contributors]\n\n def snapshot(self, worker_healths: list[WorkerHealth]) -> dict[str, object]:\n component_healths = worker_healths + self.contributor_healths()\n return {\n \"status\": self._aggregate_status(component_healths),\n \"components\": [self._health_dict(item) for item in component_healths],\n }\n\n def payload(self, state: LifecycleState, worker_healths: list[WorkerHealth]) -> HealthPayload:\n component_healths = worker_healths + self.contributor_healths()\n if state == LifecycleState.STOPPED:\n return {\"status\": \"unhealthy\", \"detail\": \"state=stopped\", \"state\": state.value}\n if state in {LifecycleState.STARTING, LifecycleState.STOPPING}:\n return {\n \"status\": \"degraded\",\n \"detail\": f\"state={state.value}\",\n \"state\": state.value,\n \"components\": [self._health_dict(item) for item in component_healths],\n }\n return {\n \"status\": self._aggregate_status(component_healths),\n \"state\": state.value,\n \"components\": [self._health_dict(item) for item in component_healths],\n }\n\n def _aggregate_status(self, component_healths: list[WorkerHealth]) -> str:\n if any(item.status == \"unhealthy\" and item.critical for item in component_healths):\n return \"unhealthy\"\n if any(item.status in {\"degraded\", \"unhealthy\"} for item in component_healths):\n return \"degraded\"\n return \"ok\"\n\n def _health_dict(self, health: WorkerHealth) -> dict[str, object]:\n return {\n \"name\": health.name,\n \"status\": health.status,\n \"critical\": health.critical,\n \"detail\": health.detail,\n \"meta\": health.meta,\n }", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/health/registry.py:HealthRegistry", - "span_start": 8, - "span_end": 56, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.health.registry", - "is_test": false, - "blob_sha": "26e6a24daa43407ba5340b74497c20153020e79f8d7828ae502aaec378dfcf75", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/health.py", - "content": "from app_runtime.health.registry import HealthRegistry\n\n__all__ = [\"HealthRegistry\"]", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/health/__init__.py:1-3", - "span_start": 1, - "span_end": 3, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.app_runtime.health.__init__", - "is_test": false, - "blob_sha": "f7b15eed8b1f1cca8dfd467909a2612d8cb4e66e46b972ad89a0c9459ce283a0", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/contracts/health.py", - "content": "class HealthContributor(ABC):\n @abstractmethod\n def health(self) -> WorkerHealth:\n \"\"\"Return contributor health state.\"\"\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/contracts/health.py:HealthContributor", - "span_start": 7, - "span_end": 10, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.contracts.health", - "is_test": false, - "blob_sha": "6bd92611def7131e32d4dd34a8ed85e6cf3c67722ad27797032a632cb30dc097", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/health/__init__.py", - "content": "from app_runtime.health.registry import HealthRegistry\n\n__all__ = [\"HealthRegistry\"]", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/health/__init__.py:1-3", - "span_start": 1, - "span_end": 3, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.app_runtime.health.__init__", - "is_test": false, - "blob_sha": "f7b15eed8b1f1cca8dfd467909a2612d8cb4e66e46b972ad89a0c9459ce283a0", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/contracts/worker.py", - "content": "class WorkerHealth:\n name: str\n status: HealthState\n critical: bool\n detail: str | None = None\n meta: dict[str, Any] = field(default_factory=dict)", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/contracts/worker.py:WorkerHealth", - "span_start": 13, - "span_end": 18, - "lexical_rank": 6, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.contracts.worker", - "is_test": false, - "blob_sha": "e4827d32220f322d8adc3e42769da3ca0cc680db6a5eab7a11f4d8773a75304e", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/contracts/worker.py", - "content": "class Worker(ABC):\n @property\n @abstractmethod\n def name(self) -> str:\n \"\"\"Stable worker name for diagnostics.\"\"\"\n\n @property\n @abstractmethod\n def critical(self) -> bool:\n \"\"\"Whether this worker is required for healthy app operation.\"\"\"\n\n @abstractmethod\n def start(self) -> None:\n \"\"\"Start worker execution.\"\"\"\n\n @abstractmethod\n def stop(self, force: bool = False) -> None:\n \"\"\"Request graceful or immediate stop.\"\"\"\n\n @abstractmethod\n def health(self) -> WorkerHealth:\n \"\"\"Return current health state.\"\"\"\n\n @abstractmethod\n def status(self) -> WorkerStatus:\n \"\"\"Return current runtime status.\"\"\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/contracts/worker.py:Worker", - "span_start": 30, - "span_end": 55, - "lexical_rank": 6, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 2, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.contracts.worker", - "is_test": false, - "blob_sha": "e4827d32220f322d8adc3e42769da3ca0cc680db6a5eab7a11f4d8773a75304e", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "llm_answer": "У тебя есть две подтвержденные точки HTTP-запросов (`GET /`, `POST /`), объявленные в файле `http_app.py`. Однако конкретно маршрут `/health` нигде явно не указан.\n\nТем не менее, исходя из предоставленного контекста, у нас есть компонент класса `HealthRegistry`, ответственный за сбор и обработку данных о здоровье системы. Вероятно, реализация проверки здоровья (`health check`) реализована через этот класс, хотя прямого указания на маршрут `/health` в предоставленных фрагментах кода нет.\n\nТаким образом, возможная кандидатура на роль health-endpoint — это обращение к экземпляру класса `HealthRegistry` с запросом на получение информации о текущем состоянии компонентов системы (хотя точный URL может отличаться от `/health`).\n\nОднако стоит отметить, что без дополнительных сведений точно утверждать наличие именно маршрута `/health` нельзя. Рекомендую проверить непосредственно код вашего приложения на предмет наличия маршрутов с этим конкретным именем.", - "summary": { - "router": { - "intent": "CODE_QA", - "sub_intent": "FIND_ENTRYPOINTS", - "confidence": null - }, - "retrieval": { - "profile": "code", - "layers_hit": [ - "C0_SOURCE_CHUNKS", - "C3_ENTRYPOINTS" - ], - "evidence_sufficient": true - }, - "llm": { - "answer_status": "answered", - "groundedness": "grounded" - } - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "FIND_ENTRYPOINTS", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C3_ENTRYPOINTS", - "C0_SOURCE_CHUNKS" - ], - "symbol_kind_hint": "unknown", - "symbol_candidates": [ - "health", - "endpoint" - ], - "keyword_hints": [ - "health", - "endpoint" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "execution": { - "executed_layers": [ - "C3_ENTRYPOINTS", - "C0_SOURCE_CHUNKS" - ], - "retrieval_mode_by_layer": { - "C3_ENTRYPOINTS": "exact_path_fetch", - "C0_SOURCE_CHUNKS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C3_ENTRYPOINTS": 12, - "C0_SOURCE_CHUNKS": 6 - }, - "filters_by_layer": { - "C3_ENTRYPOINTS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C3_ENTRYPOINTS", - "query": "Где health endpoint?", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 12, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Где health endpoint?", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C3_ENTRYPOINTS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 3, - "candidates_after_filter": 3 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 6, - "candidates_after_filter": 6 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "not_found", - "resolved_symbol": null, - "alternatives": [ - "health", - "endpoint" - ] - }, - "layers": [ - { - "layer": "C3_ENTRYPOINTS", - "status": "hit", - "hit_count": 3, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 6, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "router": 1, - "symbol_resolution": 0, - "retrieval_total": 55, - "retrieval_by_layer": { - "C3_ENTRYPOINTS": 32, - "C0_SOURCE_CHUNKS": 22 - }, - "merge_rank": 0, - "prompt_build": 0, - "llm_call": 1508 - }, - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 904, - "evidence_rows": 9, - "evidence_chars": 3350 - }, - "evidence_summary": [ - { - "layer": "C3_ENTRYPOINTS", - "count": 3, - "unique_paths": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 6, - "unique_paths": 5 - } - ], - "prompt_template_id": "intent_code_qa_find_entrypoints_ru_v4", - "system_prompt_version": "v1" - }, - "router": { - "conversation_mode": "START", - "keyword_hints": [ - "health", - "endpoint" - ], - "path_scope": [] - }, - "llm": { - "used_evidence_count": 9, - "missing_evidence_reason": null - } - }, - "run_info": { - "case_id": "plba-v2-find-entrypoints-health-endpoint", - "mode": "full_chain", - "run_started_at": "2026-03-12T14:36:36", - "rag_session_id": "7d11da21-faa0-4cea-aede-aeabe069164c", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - }, - "input_request": { - "text": "Где health endpoint?", - "normalized_query": "Где health endpoint?" - }, - "steps": [ - { - "step": "intent_router", - "input": { - "query": "Где health endpoint?" - }, - "output": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Где health endpoint?" - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "FIND_ENTRYPOINTS", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C3_ENTRYPOINTS", - "C0_SOURCE_CHUNKS" - ], - "symbol_kind_hint": "unknown", - "symbol_candidates": [ - "health", - "endpoint" - ], - "keyword_hints": [ - "health", - "endpoint" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "timings_ms": { - "router": 1 - } - } - }, - { - "step": "retrieval", - "input": { - "query": "Где health endpoint?" - }, - "output": { - "symbol_resolution": { - "status": "not_found", - "resolved_symbol": null, - "alternatives": [ - "health", - "endpoint" - ], - "confidence": 0.0 - }, - "rag_count": 9, - "rag_rows": [ - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/health/registry.py", - "content": "class HealthRegistry:\n def __init__(self) -> None:\n self._contributors: list[HealthContributor] = []\n\n def register(self, contributor: HealthContributor) -> None:\n self._contributors.append(contributor)\n\n def contributor_healths(self) -> list[WorkerHealth]:\n return [contributor.health() for contributor in self._contributors]\n\n def snapshot(self, worker_healths: list[WorkerHealth]) -> dict[str, object]:\n component_healths = worker_healths + self.contributor_healths()\n return {\n \"status\": self._aggregate_status(component_healths),\n \"components\": [self._health_dict(item) for item in component_healths],\n }\n\n def payload(self, state: LifecycleState, worker_healths: list[WorkerHealth]) -> HealthPayload:\n component_healths = worker_healths + self.contributor_healths()\n if state == LifecycleState.STOPPED:\n return {\"status\": \"unhealthy\", \"detail\": \"state=stopped\", \"state\": state.value}\n if state in {LifecycleState.STARTING, LifecycleState.STOPPING}:\n return {\n \"status\": \"degraded\",\n \"detail\": f\"state={state.value}\",\n \"state\": state.value,\n \"components\": [self._health_dict(item) for item in component_healths],\n }\n return {\n \"status\": self._aggregate_status(component_healths),\n \"state\": state.value,\n \"components\": [self._health_dict(item) for item in component_healths],\n }\n\n def _aggregate_status(self, component_healths: list[WorkerHealth]) -> str:\n if any(item.status == \"unhealthy\" and item.critical for item in component_healths):\n return \"unhealthy\"\n if any(item.status in {\"degraded\", \"unhealthy\"} for item in component_healths):\n return \"degraded\"\n return \"ok\"\n\n def _health_dict(self, health: WorkerHealth) -> dict[str, object]:\n return {\n \"name\": health.name,\n \"status\": health.status,\n \"critical\": health.critical,\n \"detail\": health.detail,\n \"meta\": health.meta,\n }", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/health/registry.py:HealthRegistry", - "span_start": 8, - "span_end": 56, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.health.registry", - "is_test": false, - "blob_sha": "26e6a24daa43407ba5340b74497c20153020e79f8d7828ae502aaec378dfcf75", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/health.py", - "content": "from app_runtime.health.registry import HealthRegistry\n\n__all__ = [\"HealthRegistry\"]", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/health/__init__.py:1-3", - "span_start": 1, - "span_end": 3, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.app_runtime.health.__init__", - "is_test": false, - "blob_sha": "f7b15eed8b1f1cca8dfd467909a2612d8cb4e66e46b972ad89a0c9459ce283a0", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/contracts/health.py", - "content": "class HealthContributor(ABC):\n @abstractmethod\n def health(self) -> WorkerHealth:\n \"\"\"Return contributor health state.\"\"\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/contracts/health.py:HealthContributor", - "span_start": 7, - "span_end": 10, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.contracts.health", - "is_test": false, - "blob_sha": "6bd92611def7131e32d4dd34a8ed85e6cf3c67722ad27797032a632cb30dc097", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/health/__init__.py", - "content": "from app_runtime.health.registry import HealthRegistry\n\n__all__ = [\"HealthRegistry\"]", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/health/__init__.py:1-3", - "span_start": 1, - "span_end": 3, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.app_runtime.health.__init__", - "is_test": false, - "blob_sha": "f7b15eed8b1f1cca8dfd467909a2612d8cb4e66e46b972ad89a0c9459ce283a0", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/contracts/worker.py", - "content": "class WorkerHealth:\n name: str\n status: HealthState\n critical: bool\n detail: str | None = None\n meta: dict[str, Any] = field(default_factory=dict)", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/contracts/worker.py:WorkerHealth", - "span_start": 13, - "span_end": 18, - "lexical_rank": 6, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.contracts.worker", - "is_test": false, - "blob_sha": "e4827d32220f322d8adc3e42769da3ca0cc680db6a5eab7a11f4d8773a75304e", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/contracts/worker.py", - "content": "class Worker(ABC):\n @property\n @abstractmethod\n def name(self) -> str:\n \"\"\"Stable worker name for diagnostics.\"\"\"\n\n @property\n @abstractmethod\n def critical(self) -> bool:\n \"\"\"Whether this worker is required for healthy app operation.\"\"\"\n\n @abstractmethod\n def start(self) -> None:\n \"\"\"Start worker execution.\"\"\"\n\n @abstractmethod\n def stop(self, force: bool = False) -> None:\n \"\"\"Request graceful or immediate stop.\"\"\"\n\n @abstractmethod\n def health(self) -> WorkerHealth:\n \"\"\"Return current health state.\"\"\"\n\n @abstractmethod\n def status(self) -> WorkerStatus:\n \"\"\"Return current runtime status.\"\"\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/contracts/worker.py:Worker", - "span_start": 30, - "span_end": 55, - "lexical_rank": 6, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 2, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.contracts.worker", - "is_test": false, - "blob_sha": "e4827d32220f322d8adc3e42769da3ca0cc680db6a5eab7a11f4d8773a75304e", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ] - }, - "diagnostics": { - "execution": { - "executed_layers": [ - "C3_ENTRYPOINTS", - "C0_SOURCE_CHUNKS" - ], - "retrieval_mode_by_layer": { - "C3_ENTRYPOINTS": "exact_path_fetch", - "C0_SOURCE_CHUNKS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C3_ENTRYPOINTS": 12, - "C0_SOURCE_CHUNKS": 6 - }, - "filters_by_layer": { - "C3_ENTRYPOINTS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C3_ENTRYPOINTS", - "query": "Где health endpoint?", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 12, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Где health endpoint?", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C3_ENTRYPOINTS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 3, - "candidates_after_filter": 3 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 6, - "candidates_after_filter": 6 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "not_found", - "resolved_symbol": null, - "alternatives": [ - "health", - "endpoint" - ] - }, - "layers": [ - { - "layer": "C3_ENTRYPOINTS", - "status": "hit", - "hit_count": 3, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 6, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "symbol_resolution": 0, - "retrieval_total": 55, - "retrieval_by_layer": { - "C3_ENTRYPOINTS": 32, - "C0_SOURCE_CHUNKS": 22 - }, - "merge_rank": 0 - } - } - }, - { - "step": "llm_answer", - "input": { - "query": "Где health endpoint?", - "rag_count": 9 - }, - "output": { - "llm_answer": "У тебя есть две подтвержденные точки HTTP-запросов (`GET /`, `POST /`), объявленные в файле `http_app.py`. Однако конкретно маршрут `/health` нигде явно не указан.\n\nТем не менее, исходя из предоставленного контекста, у нас есть компонент класса `HealthRegistry`, ответственный за сбор и обработку данных о здоровье системы. Вероятно, реализация проверки здоровья (`health check`) реализована через этот класс, хотя прямого указания на маршрут `/health` в предоставленных фрагментах кода нет.\n\nТаким образом, возможная кандидатура на роль health-endpoint — это обращение к экземпляру класса `HealthRegistry` с запросом на получение информации о текущем состоянии компонентов системы (хотя точный URL может отличаться от `/health`).\n\nОднако стоит отметить, что без дополнительных сведений точно утверждать наличие именно маршрута `/health` нельзя. Рекомендую проверить непосредственно код вашего приложения на предмет наличия маршрутов с этим конкретным именем." - }, - "diagnostics": { - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 904, - "evidence_rows": 9, - "evidence_chars": 3350 - }, - "evidence_summary": [ - { - "layer": "C3_ENTRYPOINTS", - "count": 3, - "unique_paths": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 6, - "unique_paths": 5 - } - ], - "prompt_template_id": "intent_code_qa_find_entrypoints_ru_v4", - "system_prompt_version": "v1" - }, - "timings_ms": { - "prompt_build": 0, - "llm_call": 1508 - } - } - } - ] - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_143636/full_chain_plba_code_subintents_v2_plba-v2-find-entrypoints-health-endpoint.md b/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_143636/full_chain_plba_code_subintents_v2_plba-v2-find-entrypoints-health-endpoint.md deleted file mode 100644 index d3ca5ae..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_143636/full_chain_plba_code_subintents_v2_plba-v2-find-entrypoints-health-endpoint.md +++ /dev/null @@ -1,32 +0,0 @@ -# plba-v2-find-entrypoints-health-endpoint - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_subintents_v2.yaml -- runner: runtime -- mode: full_chain -- passed: False - -## Query -Где health endpoint? - -## Actual -{ - "intent": "CODE_QA", - "sub_intent": "FIND_ENTRYPOINTS", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 9, - "llm_answer": "У тебя есть две подтвержденные точки HTTP-запросов (`GET /`, `POST /`), объявленные в файле `http_app.py`. Однако конкретно маршрут `/health` нигде явно не указан.\n\nТем не менее, исходя из предоставленного контекста, у нас есть компонент класса `HealthRegistry`, ответственный за сбор и обработку данных о здоровье системы. Вероятно, реализация проверки здоровья (`health check`) реализована через этот класс, хотя прямого указания на маршрут `/health` в предоставленных фрагментах кода нет.\n\nТаким образом, возможная кандидатура на роль health-endpoint — это обращение к экземпляру класса `HealthRegistry` с запросом на получение информации о текущем состоянии компонентов системы (хотя точный URL может отличаться от `/health`).\n\nОднако стоит отметить, что без дополнительных сведений точно утверждать наличие именно маршрута `/health` нельзя. Рекомендую проверить непосредственно код вашего приложения на предмет наличия маршрутов с этим конкретным именем.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "health", - "endpoint" - ], - "layers": [ - "C3_ENTRYPOINTS", - "C0_SOURCE_CHUNKS" - ] -} - -## Mismatches -- llm: expected answer to contain 'GET /health' \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_143636/full_chain_plba_code_subintents_v2_plba-v2-find-tests-create-runtime.json b/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_143636/full_chain_plba_code_subintents_v2_plba-v2-find-tests-create-runtime.json deleted file mode 100644 index 5f9bb4c..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_143636/full_chain_plba_code_subintents_v2_plba-v2-find-tests-create-runtime.json +++ /dev/null @@ -1,1963 +0,0 @@ -{ - "case_id": "plba-v2-find-tests-create-runtime", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_subintents_v2.yaml", - "runner": "runtime", - "mode": "full_chain", - "actual": { - "intent": "CODE_QA", - "sub_intent": "FIND_TESTS", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 16, - "llm_answer": "Прямых тестов конкретно для функции `create_runtime` в предоставленном контексте не обнаружено.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "create_runtime" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ] - }, - "passed": true, - "mismatches": [], - "details": { - "case_id": "plba-v2-find-tests-create-runtime", - "text": "Где тесты для create_runtime?", - "mode": "full_chain", - "run_started_at": "2026-03-12T14:36:36", - "rag_session_id": "7d11da21-faa0-4cea-aede-aeabe069164c", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Где тесты для create_runtime?", - "symbol_resolution": { - "status": "not_found", - "resolved_symbol": null, - "alternatives": [ - "create_runtime" - ], - "confidence": 0.0 - }, - "rag_count": 16, - "rag_rows": [ - { - "path": "tests/test_runtime.py", - "content": "test_public_plba_package_exports_runtime_builder_and_worker_contract imports plba.create_runtime", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_public_plba_package_exports_runtime_builder_and_worker_contract:imports", - "span_start": 349, - "span_end": 349, - "lexical_rank": 6, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e93f80075cd9988737ece3cb5ec659c542132c4d383646e376917bfd0cb6ea64", - "edge_type": "imports", - "src_symbol_id": "ed06ffc5afb8a863cf7da3e40921f17abe4eec2a0770139e3380d93ccaae604a", - "src_qname": "test_public_plba_package_exports_runtime_builder_and_worker_contract", - "dst_symbol_id": null, - "dst_ref": "plba.create_runtime", - "resolution": "partial", - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_runtime.py", - "content": "test_public_plba_package_exports_runtime_builder_and_worker_contract calls create_runtime", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_public_plba_package_exports_runtime_builder_and_worker_contract:calls", - "span_start": 399, - "span_end": 399, - "lexical_rank": 6, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "039939355230de826d8bf7607f55fc59c7d932e5570ecb78994d0f13e57e8488", - "edge_type": "calls", - "src_symbol_id": "ed06ffc5afb8a863cf7da3e40921f17abe4eec2a0770139e3380d93ccaae604a", - "src_qname": "test_public_plba_package_exports_runtime_builder_and_worker_contract", - "dst_symbol_id": null, - "dst_ref": "create_runtime", - "resolution": "partial", - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "test_worker_wakes_up_with_configured_interval\n -> ScenarioWorker\n -> ScenarioWorker.__init__\n -> ScenarioWorker._name\n -> ScenarioWorker.name", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_worker_wakes_up_with_configured_interval:dataflow_slice", - "span_start": 52, - "span_end": 166, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 5, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "2fd137f5852febe907f44d3b3e4ea430f89ccfe962ae1442a16ab9df64c8f76c", - "edge_type": "dataflow_slice", - "src_symbol_id": "65f877f78191d65e6a752e41cedc70ebc784c266804a55c1c56440336e1f0d6e", - "src_qname": "test_worker_wakes_up_with_configured_interval", - "dst_symbol_id": "da022da2c49fd9cfd09d6e6da6bbd59aaa7d28efd669ce8444e88d327ddec2fc", - "dst_ref": "ScenarioWorker.name", - "resolution": "resolved", - "slice_id": "2fd137f5852febe907f44d3b3e4ea430f89ccfe962ae1442a16ab9df64c8f76c", - "root_symbol_id": "65f877f78191d65e6a752e41cedc70ebc784c266804a55c1c56440336e1f0d6e", - "path_symbols": [ - "test_worker_wakes_up_with_configured_interval", - "ScenarioWorker", - "ScenarioWorker.__init__", - "ScenarioWorker._name", - "ScenarioWorker.name" - ], - "path_symbol_ids": [ - "65f877f78191d65e6a752e41cedc70ebc784c266804a55c1c56440336e1f0d6e", - "9a1d08a7eb1831c9f2e0db361b5207f036e477c160773ae08c0b287239785c52", - "9c20be046ba06644d1432e0f20eb223663d2b116ee7d91fdc62bc68323f2e593", - "da022da2c49fd9cfd09d6e6da6bbd59aaa7d28efd669ce8444e88d327ddec2fc" - ], - "path_edge_types": [ - "instantiates", - "writes_attr", - "reads_attr" - ], - "path_length": 5, - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "test_actions_stop_busy_worker_after_timeout\n -> BlockingRoutine\n -> BlockingRoutine.__init__\n -> BlockingRoutine._started\n -> BlockingRoutine.run", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_actions_stop_busy_worker_after_timeout:dataflow_slice", - "span_start": 42, - "span_end": 238, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 5, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "8e7db3d2a9226f1c1d9942ac6373cfcafa0d2276758ddb8a3d3c455a3d58024d", - "edge_type": "dataflow_slice", - "src_symbol_id": "66392d3222421d9ba16eda3554940b16e7d5a6f33aa08c5738d35af2e32f1e4a", - "src_qname": "test_actions_stop_busy_worker_after_timeout", - "dst_symbol_id": "d9841bdbb69706c988ae7ae6adf89928dc4fae45943f74064f5382177034ba04", - "dst_ref": "BlockingRoutine.run", - "resolution": "resolved", - "slice_id": "8e7db3d2a9226f1c1d9942ac6373cfcafa0d2276758ddb8a3d3c455a3d58024d", - "root_symbol_id": "66392d3222421d9ba16eda3554940b16e7d5a6f33aa08c5738d35af2e32f1e4a", - "path_symbols": [ - "test_actions_stop_busy_worker_after_timeout", - "BlockingRoutine", - "BlockingRoutine.__init__", - "BlockingRoutine._started", - "BlockingRoutine.run" - ], - "path_symbol_ids": [ - "66392d3222421d9ba16eda3554940b16e7d5a6f33aa08c5738d35af2e32f1e4a", - "a3349c5bc65e4003a4bbd6a8dbb7a54c337e12d1aed930caa701b12e520f1e67", - "486deeed3043c6db985aef258e96ddc67aa53608e67a83962fbd2471f649ddf1", - "d9841bdbb69706c988ae7ae6adf89928dc4fae45943f74064f5382177034ba04" - ], - "path_edge_types": [ - "instantiates", - "writes_attr", - "reads_attr" - ], - "path_length": 5, - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "test_actions_stop_busy_worker_after_timeout\n -> BlockingRoutine\n -> BlockingRoutine.__init__\n -> BlockingRoutine._release\n -> BlockingRoutine.run", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_actions_stop_busy_worker_after_timeout:dataflow_slice", - "span_start": 43, - "span_end": 238, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 5, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "b59da9da82f9dfc8a9b695a08213786385da1ae9e17561ec3a0450a574a8cb39", - "edge_type": "dataflow_slice", - "src_symbol_id": "66392d3222421d9ba16eda3554940b16e7d5a6f33aa08c5738d35af2e32f1e4a", - "src_qname": "test_actions_stop_busy_worker_after_timeout", - "dst_symbol_id": "d9841bdbb69706c988ae7ae6adf89928dc4fae45943f74064f5382177034ba04", - "dst_ref": "BlockingRoutine.run", - "resolution": "resolved", - "slice_id": "b59da9da82f9dfc8a9b695a08213786385da1ae9e17561ec3a0450a574a8cb39", - "root_symbol_id": "66392d3222421d9ba16eda3554940b16e7d5a6f33aa08c5738d35af2e32f1e4a", - "path_symbols": [ - "test_actions_stop_busy_worker_after_timeout", - "BlockingRoutine", - "BlockingRoutine.__init__", - "BlockingRoutine._release", - "BlockingRoutine.run" - ], - "path_symbol_ids": [ - "66392d3222421d9ba16eda3554940b16e7d5a6f33aa08c5738d35af2e32f1e4a", - "a3349c5bc65e4003a4bbd6a8dbb7a54c337e12d1aed930caa701b12e520f1e67", - "486deeed3043c6db985aef258e96ddc67aa53608e67a83962fbd2471f649ddf1", - "d9841bdbb69706c988ae7ae6adf89928dc4fae45943f74064f5382177034ba04" - ], - "path_edge_types": [ - "instantiates", - "writes_attr", - "reads_attr" - ], - "path_length": 5, - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "test_actions_stop_busy_worker_before_timeout\n -> BlockingRoutine\n -> BlockingRoutine.__init__\n -> BlockingRoutine._started\n -> BlockingRoutine.run", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_actions_stop_busy_worker_before_timeout:dataflow_slice", - "span_start": 42, - "span_end": 212, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 5, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "f9bcce108870e49afa8b32d4625115a10707a3b0e7473179e958e5752bf258b4", - "edge_type": "dataflow_slice", - "src_symbol_id": "a0bb116ca9d909c93a285667ae033fbd1859b2dad7cf34fcb44816393ef6909c", - "src_qname": "test_actions_stop_busy_worker_before_timeout", - "dst_symbol_id": "d9841bdbb69706c988ae7ae6adf89928dc4fae45943f74064f5382177034ba04", - "dst_ref": "BlockingRoutine.run", - "resolution": "resolved", - "slice_id": "f9bcce108870e49afa8b32d4625115a10707a3b0e7473179e958e5752bf258b4", - "root_symbol_id": "a0bb116ca9d909c93a285667ae033fbd1859b2dad7cf34fcb44816393ef6909c", - "path_symbols": [ - "test_actions_stop_busy_worker_before_timeout", - "BlockingRoutine", - "BlockingRoutine.__init__", - "BlockingRoutine._started", - "BlockingRoutine.run" - ], - "path_symbol_ids": [ - "a0bb116ca9d909c93a285667ae033fbd1859b2dad7cf34fcb44816393ef6909c", - "a3349c5bc65e4003a4bbd6a8dbb7a54c337e12d1aed930caa701b12e520f1e67", - "486deeed3043c6db985aef258e96ddc67aa53608e67a83962fbd2471f649ddf1", - "d9841bdbb69706c988ae7ae6adf89928dc4fae45943f74064f5382177034ba04" - ], - "path_edge_types": [ - "instantiates", - "writes_attr", - "reads_attr" - ], - "path_length": 5, - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_runtime.py", - "content": "def test_public_plba_package_exports_runtime_builder_and_worker_contract(tmp_path) -> None:\n import plba\n from plba import ApplicationModule as PublicApplicationModule\n from plba import InMemoryTaskQueue\n from plba import Worker as PublicWorker\n from plba import WorkerHealth as PublicWorkerHealth\n from plba import WorkerStatus as PublicWorkerStatus\n from plba import create_runtime\n\n config_path = tmp_path / \"config.yml\"\n config_path.write_text(\"platform: {}\\n\", encoding=\"utf-8\")\n\n queue = InMemoryTaskQueue[int]()\n queue.put(2)\n assert queue.get(timeout=0.01) == 2\n queue.task_done()\n\n class PublicRoutine:\n def __init__(self) -> None:\n self.runs = 0\n\n def run(self) -> None:\n if self.runs == 0:\n self.runs += 1\n\n class PublicWorkerImpl(PublicWorker):\n def __init__(self, routine: PublicRoutine) -> None:\n self._inner = RoutineWorker(\"public-worker\", routine)\n\n @property\n def name(self) -> str:\n return self._inner.name\n\n @property\n def critical(self) -> bool:\n return self._inner.critical\n\n def start(self) -> None:\n self._inner.start()\n\n def stop(self, force: bool = False) -> None:\n self._inner.stop(force=force)\n\n def health(self) -> PublicWorkerHealth:\n return self._inner.health()\n\n def status(self) -> PublicWorkerStatus:\n return self._inner.status()\n\n class PublicExampleModule(PublicApplicationModule):\n @property\n def name(self) -> str:\n return \"public-example\"\n\n def register(self, registry: ModuleRegistry) -> None:\n registry.add_worker(PublicWorkerImpl(PublicRoutine()))\n\n runtime = create_runtime(PublicExampleModule(), config_path=str(config_path))\n runtime.start()\n sleep(0.2)\n assert runtime.configuration.get() == {\"platform\": {}}\n assert runtime.status()[\"workers\"][\"registered\"] == 1\n assert hasattr(plba, \"QueueWorker\") is False\n runtime.stop()", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_runtime.py:test_public_plba_package_exports_runtime_builder_and_worker_contract", - "span_start": 342, - "span_end": 405, - "lexical_rank": 6, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 13, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_runtime", - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "def _build_runtime(worker: Worker, *, control_timeout: int = 1) -> tuple[RuntimeManager, str]:\n runtime = RuntimeManager()\n channel = HttpControlChannel(host=\"127.0.0.1\", port=0, timeout=control_timeout)\n runtime.control_plane.register_channel(channel)\n runtime.register_module(WorkerModule(worker))\n runtime.start()\n return runtime, f\"http://127.0.0.1:{channel.port}\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:_build_runtime", - "span_start": 154, - "span_end": 160, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 6, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "class IntervalRoutine:\n calls: list[float] = field(default_factory=list)\n _lock: Lock = field(default_factory=Lock)\n\n def run(self) -> None:\n with self._lock:\n self.calls.append(monotonic())\n\n def wait_runs(self, count: int, timeout: float) -> bool:\n deadline = monotonic() + timeout\n while monotonic() < deadline:\n with self._lock:\n if len(self.calls) >= count:\n return True\n sleep(0.01)\n return False\n\n def deltas(self) -> list[float]:\n with self._lock:\n return [self.calls[index + 1] - self.calls[index] for index in range(len(self.calls) - 1)]", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:IntervalRoutine", - "span_start": 18, - "span_end": 37, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "class ScenarioWorker(Worker):\n def __init__(self, name: str, routine: object, *, interval: float = 0.05) -> None:\n self._name = name\n self._routine = routine\n self._interval = interval\n self._thread: Thread | None = None\n self._stop_requested = Event()\n self._in_flight = 0\n self._runs = 0\n self._lock = Lock()\n\n @property\n def name(self) -> str:\n return self._name\n\n @property\n def critical(self) -> bool:\n return True\n\n def start(self) -> None:\n if self._thread is not None and self._thread.is_alive():\n return\n self._stop_requested.clear()\n self._thread = Thread(target=self._loop, name=f\"{self._name}-thread\", daemon=True)\n self._thread.start()\n\n def stop(self, force: bool = False) -> None:\n self._stop_requested.set()\n\n def health(self) -> WorkerHealth:\n return WorkerHealth(name=self.name, status=\"ok\", critical=True, meta={\"runs\": self._runs})\n\n def status(self) -> WorkerStatus:\n thread_alive = self._thread is not None and self._thread.is_alive()\n with self._lock:\n in_flight = self._in_flight\n runs = self._runs\n if not thread_alive:\n state = \"stopped\"\n elif self._stop_requested.is_set():\n state = \"stopping\"\n elif in_flight > 0:\n state = \"busy\"\n else:\n state = \"idle\"\n return WorkerStatus(name=self.name, state=state, in_flight=in_flight, meta={\"runs\": runs})\n\n def _loop(self) -> None:\n while not self._stop_requested.is_set():\n with self._lock:\n self._in_flight += 1\n try:\n self._routine.run()\n with self._lock:\n self._runs += 1\n finally:\n with self._lock:\n self._in_flight -= 1\n if self._stop_requested.is_set():\n return\n sleep(self._interval)", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:ScenarioWorker", - "span_start": 50, - "span_end": 110, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 2, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "def _http_call_json(\n base_url: str,\n path: str,\n *,\n method: str = \"GET\",\n headers: dict[str, str] | None = None,\n) -> tuple[int, dict[str, object]]:\n request = Request(f\"{base_url}{path}\", method=method, headers=headers or {})\n try:\n with urlopen(request, timeout=15.0) as response:\n status = response.status\n body = response.read()\n except HTTPError as error:\n status = error.code\n body = error.read()\n payload = json.loads(body.decode(\"utf-8\"))\n return status, payload", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:_http_call_json", - "span_start": 125, - "span_end": 141, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 4, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "def _poll_until_stopped(base_url: str, timeout: float = 2.0) -> bool:\n deadline = monotonic() + timeout\n while monotonic() < deadline:\n _, payload = _http_call_json(base_url, \"/actions/status\")\n if payload.get(\"detail\") == \"stopped\":\n return True\n sleep(0.05)\n return False", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:_poll_until_stopped", - "span_start": 144, - "span_end": 151, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 5, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "def test_worker_wakes_up_with_configured_interval() -> None:\n interval = 0.15\n routine = IntervalRoutine()\n worker = ScenarioWorker(\"interval-worker\", routine, interval=interval)\n runtime = RuntimeManager()\n runtime.register_module(WorkerModule(worker))\n\n runtime.start()\n try:\n assert routine.wait_runs(count=3, timeout=2.0) is True\n finally:\n runtime.stop()\n\n deltas = routine.deltas()\n assert len(deltas) >= 2\n assert all(delta >= interval * 0.7 for delta in deltas[:2])", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:test_worker_wakes_up_with_configured_interval", - "span_start": 163, - "span_end": 178, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 7, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "class WorkerModule(ApplicationModule):\n def __init__(self, worker: Worker) -> None:\n self._worker = worker\n\n @property\n def name(self) -> str:\n return \"business-tests\"\n\n def register(self, registry: ModuleRegistry) -> None:\n registry.add_worker(self._worker)", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:WorkerModule", - "span_start": 113, - "span_end": 122, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 3, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "class BlockingRoutine:\n def __init__(self, started: Event, release: Event) -> None:\n self._started = started\n self._release = release\n\n def run(self) -> None:\n self._started.set()\n self._release.wait(timeout=5.0)", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:BlockingRoutine", - "span_start": 40, - "span_end": 47, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 1, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "def test_actions_start_stop_and_health_when_worker_is_idle() -> None:\n runtime, base_url = _build_runtime(ScenarioWorker(\"idle-worker\", IntervalRoutine(), interval=0.2))\n try:\n stop_status, stop_payload = _http_call_json(base_url, \"/actions/stop\", method=\"POST\")\n assert stop_status == 200\n assert isinstance(stop_payload.get(\"detail\"), dict)\n assert stop_payload[\"detail\"][\"timed_out\"] is False\n assert stop_payload[\"detail\"][\"state\"] == \"stopped\"\n\n health_stopped_status, health_stopped_payload = _http_call_json(base_url, \"/health\")\n assert health_stopped_status == 503\n assert health_stopped_payload[\"state\"] == \"stopped\"\n assert health_stopped_payload[\"status\"] == \"unhealthy\"\n\n start_status, start_payload = _http_call_json(base_url, \"/actions/start\", method=\"POST\")\n assert start_status == 200\n assert isinstance(start_payload.get(\"detail\"), dict)\n assert start_payload[\"detail\"][\"timed_out\"] is False\n assert start_payload[\"detail\"][\"state\"] in {\"idle\", \"busy\"}\n\n health_started_status, health_started_payload = _http_call_json(base_url, \"/health\")\n assert health_started_status == 200\n assert health_started_payload[\"status\"] == \"ok\"\n assert health_started_payload[\"state\"] in {\"idle\", \"busy\"}\n finally:\n runtime.stop()", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:test_actions_start_stop_and_health_when_worker_is_idle", - "span_start": 181, - "span_end": 206, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 8, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "llm_answer": "Прямых тестов конкретно для функции `create_runtime` в предоставленном контексте не обнаружено.", - "summary": { - "router": { - "intent": "CODE_QA", - "sub_intent": "FIND_TESTS", - "confidence": null - }, - "retrieval": { - "profile": "code", - "layers_hit": [ - "C0_SOURCE_CHUNKS", - "C2_DEPENDENCY_GRAPH" - ], - "evidence_sufficient": true - }, - "llm": { - "answer_status": "answered", - "groundedness": "grounded" - } - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "FIND_TESTS", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ], - "symbol_kind_hint": "function", - "symbol_candidates": [ - "create_runtime" - ], - "keyword_hints": [ - "create_runtime" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**", - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "test_file_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "test_symbol_patterns": [ - "test_create_runtime", - "Testcreate_runtime", - "create_runtime" - ], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C0_SOURCE_CHUNKS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C0_SOURCE_CHUNKS": 10 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [], - "include_globs": [ - "src", - "tests" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests" - ] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src", - "tests" - ], - "include_globs": [ - "src", - "tests" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests" - ] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src", - "tests" - ], - "include_globs": [ - "src", - "tests" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests" - ] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "create_runtime", - "path_scope": [], - "include_globs": [ - "src/**", - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "Где тесты для create_runtime? test_create_runtime Testcreate_runtime create_runtime", - "path_scope": [], - "include_globs": [ - "src/**", - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "top_k": 6, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Где тесты для create_runtime? test_create_runtime Testcreate_runtime create_runtime", - "path_scope": [], - "include_globs": [ - "src/**", - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "top_k": 10, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [], - "normalized_include_globs": [ - "src", - "tests" - ], - "normalized_exclude_globs": [], - "normalized_prefer_globs": [ - "tests" - ], - "filter_stage": "post_rank", - "candidates_before_filter": 0, - "candidates_after_filter": 0 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src", - "tests" - ], - "normalized_include_globs": [ - "src", - "tests" - ], - "normalized_exclude_globs": [], - "normalized_prefer_globs": [ - "tests" - ], - "filter_stage": "post_rank", - "candidates_before_filter": 6, - "candidates_after_filter": 6 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src", - "tests" - ], - "normalized_include_globs": [ - "src", - "tests" - ], - "normalized_exclude_globs": [], - "normalized_prefer_globs": [ - "tests" - ], - "filter_stage": "post_rank", - "candidates_before_filter": 10, - "candidates_after_filter": 10 - } - ], - "fallback": { - "used": true, - "reason": "scope_relaxed_no_hits" - }, - "symbol_resolution": { - "status": "not_found", - "resolved_symbol": null, - "alternatives": [ - "create_runtime" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "miss", - "hit_count": 0, - "fail_reason": "scope_relaxed_no_hits" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 6, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 10, - "fail_reason": null - } - ] - }, - "constraint_violations": [ - { - "type": "LAYER_MISSING", - "severity": "warn", - "details": { - "layer": "C1_SYMBOL_CATALOG", - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ] - }, - "suggested_fix": "Increase top_k for this layer or relax constraints for retrieval." - } - ], - "timings_ms": { - "router": 0, - "symbol_resolution": 0, - "retrieval_total": 132, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 58, - "C2_DEPENDENCY_GRAPH": 55, - "C0_SOURCE_CHUNKS": 18 - }, - "merge_rank": 0, - "prompt_build": 0, - "llm_call": 1210 - }, - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 1022, - "evidence_rows": 16, - "evidence_chars": 9185 - }, - "evidence_summary": [ - { - "layer": "C2_DEPENDENCY_GRAPH", - "count": 6, - "unique_paths": 2 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 10, - "unique_paths": 2 - } - ], - "prompt_template_id": "intent_code_qa_find_tests_ru_v4", - "system_prompt_version": "v1" - }, - "router": { - "conversation_mode": "START", - "keyword_hints": [ - "create_runtime" - ], - "path_scope": [] - }, - "llm": { - "used_evidence_count": 16, - "missing_evidence_reason": null - } - }, - "run_info": { - "case_id": "plba-v2-find-tests-create-runtime", - "mode": "full_chain", - "run_started_at": "2026-03-12T14:36:36", - "rag_session_id": "7d11da21-faa0-4cea-aede-aeabe069164c", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - }, - "input_request": { - "text": "Где тесты для create_runtime?", - "normalized_query": "Где тесты для create_runtime?" - }, - "steps": [ - { - "step": "intent_router", - "input": { - "query": "Где тесты для create_runtime?" - }, - "output": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Где тесты для create_runtime?" - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "FIND_TESTS", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ], - "symbol_kind_hint": "function", - "symbol_candidates": [ - "create_runtime" - ], - "keyword_hints": [ - "create_runtime" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**", - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "test_file_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "test_symbol_patterns": [ - "test_create_runtime", - "Testcreate_runtime", - "create_runtime" - ], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "timings_ms": { - "router": 0 - } - } - }, - { - "step": "retrieval", - "input": { - "query": "Где тесты для create_runtime?" - }, - "output": { - "symbol_resolution": { - "status": "not_found", - "resolved_symbol": null, - "alternatives": [ - "create_runtime" - ], - "confidence": 0.0 - }, - "rag_count": 16, - "rag_rows": [ - { - "path": "tests/test_runtime.py", - "content": "test_public_plba_package_exports_runtime_builder_and_worker_contract imports plba.create_runtime", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_public_plba_package_exports_runtime_builder_and_worker_contract:imports", - "span_start": 349, - "span_end": 349, - "lexical_rank": 6, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e93f80075cd9988737ece3cb5ec659c542132c4d383646e376917bfd0cb6ea64", - "edge_type": "imports", - "src_symbol_id": "ed06ffc5afb8a863cf7da3e40921f17abe4eec2a0770139e3380d93ccaae604a", - "src_qname": "test_public_plba_package_exports_runtime_builder_and_worker_contract", - "dst_symbol_id": null, - "dst_ref": "plba.create_runtime", - "resolution": "partial", - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_runtime.py", - "content": "test_public_plba_package_exports_runtime_builder_and_worker_contract calls create_runtime", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_public_plba_package_exports_runtime_builder_and_worker_contract:calls", - "span_start": 399, - "span_end": 399, - "lexical_rank": 6, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "039939355230de826d8bf7607f55fc59c7d932e5570ecb78994d0f13e57e8488", - "edge_type": "calls", - "src_symbol_id": "ed06ffc5afb8a863cf7da3e40921f17abe4eec2a0770139e3380d93ccaae604a", - "src_qname": "test_public_plba_package_exports_runtime_builder_and_worker_contract", - "dst_symbol_id": null, - "dst_ref": "create_runtime", - "resolution": "partial", - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "test_worker_wakes_up_with_configured_interval\n -> ScenarioWorker\n -> ScenarioWorker.__init__\n -> ScenarioWorker._name\n -> ScenarioWorker.name", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_worker_wakes_up_with_configured_interval:dataflow_slice", - "span_start": 52, - "span_end": 166, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 5, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "2fd137f5852febe907f44d3b3e4ea430f89ccfe962ae1442a16ab9df64c8f76c", - "edge_type": "dataflow_slice", - "src_symbol_id": "65f877f78191d65e6a752e41cedc70ebc784c266804a55c1c56440336e1f0d6e", - "src_qname": "test_worker_wakes_up_with_configured_interval", - "dst_symbol_id": "da022da2c49fd9cfd09d6e6da6bbd59aaa7d28efd669ce8444e88d327ddec2fc", - "dst_ref": "ScenarioWorker.name", - "resolution": "resolved", - "slice_id": "2fd137f5852febe907f44d3b3e4ea430f89ccfe962ae1442a16ab9df64c8f76c", - "root_symbol_id": "65f877f78191d65e6a752e41cedc70ebc784c266804a55c1c56440336e1f0d6e", - "path_symbols": [ - "test_worker_wakes_up_with_configured_interval", - "ScenarioWorker", - "ScenarioWorker.__init__", - "ScenarioWorker._name", - "ScenarioWorker.name" - ], - "path_symbol_ids": [ - "65f877f78191d65e6a752e41cedc70ebc784c266804a55c1c56440336e1f0d6e", - "9a1d08a7eb1831c9f2e0db361b5207f036e477c160773ae08c0b287239785c52", - "9c20be046ba06644d1432e0f20eb223663d2b116ee7d91fdc62bc68323f2e593", - "da022da2c49fd9cfd09d6e6da6bbd59aaa7d28efd669ce8444e88d327ddec2fc" - ], - "path_edge_types": [ - "instantiates", - "writes_attr", - "reads_attr" - ], - "path_length": 5, - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "test_actions_stop_busy_worker_after_timeout\n -> BlockingRoutine\n -> BlockingRoutine.__init__\n -> BlockingRoutine._started\n -> BlockingRoutine.run", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_actions_stop_busy_worker_after_timeout:dataflow_slice", - "span_start": 42, - "span_end": 238, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 5, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "8e7db3d2a9226f1c1d9942ac6373cfcafa0d2276758ddb8a3d3c455a3d58024d", - "edge_type": "dataflow_slice", - "src_symbol_id": "66392d3222421d9ba16eda3554940b16e7d5a6f33aa08c5738d35af2e32f1e4a", - "src_qname": "test_actions_stop_busy_worker_after_timeout", - "dst_symbol_id": "d9841bdbb69706c988ae7ae6adf89928dc4fae45943f74064f5382177034ba04", - "dst_ref": "BlockingRoutine.run", - "resolution": "resolved", - "slice_id": "8e7db3d2a9226f1c1d9942ac6373cfcafa0d2276758ddb8a3d3c455a3d58024d", - "root_symbol_id": "66392d3222421d9ba16eda3554940b16e7d5a6f33aa08c5738d35af2e32f1e4a", - "path_symbols": [ - "test_actions_stop_busy_worker_after_timeout", - "BlockingRoutine", - "BlockingRoutine.__init__", - "BlockingRoutine._started", - "BlockingRoutine.run" - ], - "path_symbol_ids": [ - "66392d3222421d9ba16eda3554940b16e7d5a6f33aa08c5738d35af2e32f1e4a", - "a3349c5bc65e4003a4bbd6a8dbb7a54c337e12d1aed930caa701b12e520f1e67", - "486deeed3043c6db985aef258e96ddc67aa53608e67a83962fbd2471f649ddf1", - "d9841bdbb69706c988ae7ae6adf89928dc4fae45943f74064f5382177034ba04" - ], - "path_edge_types": [ - "instantiates", - "writes_attr", - "reads_attr" - ], - "path_length": 5, - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "test_actions_stop_busy_worker_after_timeout\n -> BlockingRoutine\n -> BlockingRoutine.__init__\n -> BlockingRoutine._release\n -> BlockingRoutine.run", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_actions_stop_busy_worker_after_timeout:dataflow_slice", - "span_start": 43, - "span_end": 238, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 5, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "b59da9da82f9dfc8a9b695a08213786385da1ae9e17561ec3a0450a574a8cb39", - "edge_type": "dataflow_slice", - "src_symbol_id": "66392d3222421d9ba16eda3554940b16e7d5a6f33aa08c5738d35af2e32f1e4a", - "src_qname": "test_actions_stop_busy_worker_after_timeout", - "dst_symbol_id": "d9841bdbb69706c988ae7ae6adf89928dc4fae45943f74064f5382177034ba04", - "dst_ref": "BlockingRoutine.run", - "resolution": "resolved", - "slice_id": "b59da9da82f9dfc8a9b695a08213786385da1ae9e17561ec3a0450a574a8cb39", - "root_symbol_id": "66392d3222421d9ba16eda3554940b16e7d5a6f33aa08c5738d35af2e32f1e4a", - "path_symbols": [ - "test_actions_stop_busy_worker_after_timeout", - "BlockingRoutine", - "BlockingRoutine.__init__", - "BlockingRoutine._release", - "BlockingRoutine.run" - ], - "path_symbol_ids": [ - "66392d3222421d9ba16eda3554940b16e7d5a6f33aa08c5738d35af2e32f1e4a", - "a3349c5bc65e4003a4bbd6a8dbb7a54c337e12d1aed930caa701b12e520f1e67", - "486deeed3043c6db985aef258e96ddc67aa53608e67a83962fbd2471f649ddf1", - "d9841bdbb69706c988ae7ae6adf89928dc4fae45943f74064f5382177034ba04" - ], - "path_edge_types": [ - "instantiates", - "writes_attr", - "reads_attr" - ], - "path_length": 5, - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "test_actions_stop_busy_worker_before_timeout\n -> BlockingRoutine\n -> BlockingRoutine.__init__\n -> BlockingRoutine._started\n -> BlockingRoutine.run", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_actions_stop_busy_worker_before_timeout:dataflow_slice", - "span_start": 42, - "span_end": 212, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 5, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "f9bcce108870e49afa8b32d4625115a10707a3b0e7473179e958e5752bf258b4", - "edge_type": "dataflow_slice", - "src_symbol_id": "a0bb116ca9d909c93a285667ae033fbd1859b2dad7cf34fcb44816393ef6909c", - "src_qname": "test_actions_stop_busy_worker_before_timeout", - "dst_symbol_id": "d9841bdbb69706c988ae7ae6adf89928dc4fae45943f74064f5382177034ba04", - "dst_ref": "BlockingRoutine.run", - "resolution": "resolved", - "slice_id": "f9bcce108870e49afa8b32d4625115a10707a3b0e7473179e958e5752bf258b4", - "root_symbol_id": "a0bb116ca9d909c93a285667ae033fbd1859b2dad7cf34fcb44816393ef6909c", - "path_symbols": [ - "test_actions_stop_busy_worker_before_timeout", - "BlockingRoutine", - "BlockingRoutine.__init__", - "BlockingRoutine._started", - "BlockingRoutine.run" - ], - "path_symbol_ids": [ - "a0bb116ca9d909c93a285667ae033fbd1859b2dad7cf34fcb44816393ef6909c", - "a3349c5bc65e4003a4bbd6a8dbb7a54c337e12d1aed930caa701b12e520f1e67", - "486deeed3043c6db985aef258e96ddc67aa53608e67a83962fbd2471f649ddf1", - "d9841bdbb69706c988ae7ae6adf89928dc4fae45943f74064f5382177034ba04" - ], - "path_edge_types": [ - "instantiates", - "writes_attr", - "reads_attr" - ], - "path_length": 5, - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_runtime.py", - "content": "def test_public_plba_package_exports_runtime_builder_and_worker_contract(tmp_path) -> None:\n import plba\n from plba import ApplicationModule as PublicApplicationModule\n from plba import InMemoryTaskQueue\n from plba import Worker as PublicWorker\n from plba import WorkerHealth as PublicWorkerHealth\n from plba import WorkerStatus as PublicWorkerStatus\n from plba import create_runtime\n\n config_path = tmp_path / \"config.yml\"\n config_path.write_text(\"platform: {}\\n\", encoding=\"utf-8\")\n\n queue = InMemoryTaskQueue[int]()\n queue.put(2)\n assert queue.get(timeout=0.01) == 2\n queue.task_done()\n\n class PublicRoutine:\n def __init__(self) -> None:\n self.runs = 0\n\n def run(self) -> None:\n if self.runs == 0:\n self.runs += 1\n\n class PublicWorkerImpl(PublicWorker):\n def __init__(self, routine: PublicRoutine) -> None:\n self._inner = RoutineWorker(\"public-worker\", routine)\n\n @property\n def name(self) -> str:\n return self._inner.name\n\n @property\n def critical(self) -> bool:\n return self._inner.critical\n\n def start(self) -> None:\n self._inner.start()\n\n def stop(self, force: bool = False) -> None:\n self._inner.stop(force=force)\n\n def health(self) -> PublicWorkerHealth:\n return self._inner.health()\n\n def status(self) -> PublicWorkerStatus:\n return self._inner.status()\n\n class PublicExampleModule(PublicApplicationModule):\n @property\n def name(self) -> str:\n return \"public-example\"\n\n def register(self, registry: ModuleRegistry) -> None:\n registry.add_worker(PublicWorkerImpl(PublicRoutine()))\n\n runtime = create_runtime(PublicExampleModule(), config_path=str(config_path))\n runtime.start()\n sleep(0.2)\n assert runtime.configuration.get() == {\"platform\": {}}\n assert runtime.status()[\"workers\"][\"registered\"] == 1\n assert hasattr(plba, \"QueueWorker\") is False\n runtime.stop()", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_runtime.py:test_public_plba_package_exports_runtime_builder_and_worker_contract", - "span_start": 342, - "span_end": 405, - "lexical_rank": 6, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 13, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_runtime", - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "def _build_runtime(worker: Worker, *, control_timeout: int = 1) -> tuple[RuntimeManager, str]:\n runtime = RuntimeManager()\n channel = HttpControlChannel(host=\"127.0.0.1\", port=0, timeout=control_timeout)\n runtime.control_plane.register_channel(channel)\n runtime.register_module(WorkerModule(worker))\n runtime.start()\n return runtime, f\"http://127.0.0.1:{channel.port}\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:_build_runtime", - "span_start": 154, - "span_end": 160, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 6, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "class IntervalRoutine:\n calls: list[float] = field(default_factory=list)\n _lock: Lock = field(default_factory=Lock)\n\n def run(self) -> None:\n with self._lock:\n self.calls.append(monotonic())\n\n def wait_runs(self, count: int, timeout: float) -> bool:\n deadline = monotonic() + timeout\n while monotonic() < deadline:\n with self._lock:\n if len(self.calls) >= count:\n return True\n sleep(0.01)\n return False\n\n def deltas(self) -> list[float]:\n with self._lock:\n return [self.calls[index + 1] - self.calls[index] for index in range(len(self.calls) - 1)]", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:IntervalRoutine", - "span_start": 18, - "span_end": 37, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "class ScenarioWorker(Worker):\n def __init__(self, name: str, routine: object, *, interval: float = 0.05) -> None:\n self._name = name\n self._routine = routine\n self._interval = interval\n self._thread: Thread | None = None\n self._stop_requested = Event()\n self._in_flight = 0\n self._runs = 0\n self._lock = Lock()\n\n @property\n def name(self) -> str:\n return self._name\n\n @property\n def critical(self) -> bool:\n return True\n\n def start(self) -> None:\n if self._thread is not None and self._thread.is_alive():\n return\n self._stop_requested.clear()\n self._thread = Thread(target=self._loop, name=f\"{self._name}-thread\", daemon=True)\n self._thread.start()\n\n def stop(self, force: bool = False) -> None:\n self._stop_requested.set()\n\n def health(self) -> WorkerHealth:\n return WorkerHealth(name=self.name, status=\"ok\", critical=True, meta={\"runs\": self._runs})\n\n def status(self) -> WorkerStatus:\n thread_alive = self._thread is not None and self._thread.is_alive()\n with self._lock:\n in_flight = self._in_flight\n runs = self._runs\n if not thread_alive:\n state = \"stopped\"\n elif self._stop_requested.is_set():\n state = \"stopping\"\n elif in_flight > 0:\n state = \"busy\"\n else:\n state = \"idle\"\n return WorkerStatus(name=self.name, state=state, in_flight=in_flight, meta={\"runs\": runs})\n\n def _loop(self) -> None:\n while not self._stop_requested.is_set():\n with self._lock:\n self._in_flight += 1\n try:\n self._routine.run()\n with self._lock:\n self._runs += 1\n finally:\n with self._lock:\n self._in_flight -= 1\n if self._stop_requested.is_set():\n return\n sleep(self._interval)", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:ScenarioWorker", - "span_start": 50, - "span_end": 110, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 2, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "def _http_call_json(\n base_url: str,\n path: str,\n *,\n method: str = \"GET\",\n headers: dict[str, str] | None = None,\n) -> tuple[int, dict[str, object]]:\n request = Request(f\"{base_url}{path}\", method=method, headers=headers or {})\n try:\n with urlopen(request, timeout=15.0) as response:\n status = response.status\n body = response.read()\n except HTTPError as error:\n status = error.code\n body = error.read()\n payload = json.loads(body.decode(\"utf-8\"))\n return status, payload", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:_http_call_json", - "span_start": 125, - "span_end": 141, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 4, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "def _poll_until_stopped(base_url: str, timeout: float = 2.0) -> bool:\n deadline = monotonic() + timeout\n while monotonic() < deadline:\n _, payload = _http_call_json(base_url, \"/actions/status\")\n if payload.get(\"detail\") == \"stopped\":\n return True\n sleep(0.05)\n return False", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:_poll_until_stopped", - "span_start": 144, - "span_end": 151, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 5, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "def test_worker_wakes_up_with_configured_interval() -> None:\n interval = 0.15\n routine = IntervalRoutine()\n worker = ScenarioWorker(\"interval-worker\", routine, interval=interval)\n runtime = RuntimeManager()\n runtime.register_module(WorkerModule(worker))\n\n runtime.start()\n try:\n assert routine.wait_runs(count=3, timeout=2.0) is True\n finally:\n runtime.stop()\n\n deltas = routine.deltas()\n assert len(deltas) >= 2\n assert all(delta >= interval * 0.7 for delta in deltas[:2])", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:test_worker_wakes_up_with_configured_interval", - "span_start": 163, - "span_end": 178, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 7, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "class WorkerModule(ApplicationModule):\n def __init__(self, worker: Worker) -> None:\n self._worker = worker\n\n @property\n def name(self) -> str:\n return \"business-tests\"\n\n def register(self, registry: ModuleRegistry) -> None:\n registry.add_worker(self._worker)", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:WorkerModule", - "span_start": 113, - "span_end": 122, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 3, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "class BlockingRoutine:\n def __init__(self, started: Event, release: Event) -> None:\n self._started = started\n self._release = release\n\n def run(self) -> None:\n self._started.set()\n self._release.wait(timeout=5.0)", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:BlockingRoutine", - "span_start": 40, - "span_end": 47, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 1, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "def test_actions_start_stop_and_health_when_worker_is_idle() -> None:\n runtime, base_url = _build_runtime(ScenarioWorker(\"idle-worker\", IntervalRoutine(), interval=0.2))\n try:\n stop_status, stop_payload = _http_call_json(base_url, \"/actions/stop\", method=\"POST\")\n assert stop_status == 200\n assert isinstance(stop_payload.get(\"detail\"), dict)\n assert stop_payload[\"detail\"][\"timed_out\"] is False\n assert stop_payload[\"detail\"][\"state\"] == \"stopped\"\n\n health_stopped_status, health_stopped_payload = _http_call_json(base_url, \"/health\")\n assert health_stopped_status == 503\n assert health_stopped_payload[\"state\"] == \"stopped\"\n assert health_stopped_payload[\"status\"] == \"unhealthy\"\n\n start_status, start_payload = _http_call_json(base_url, \"/actions/start\", method=\"POST\")\n assert start_status == 200\n assert isinstance(start_payload.get(\"detail\"), dict)\n assert start_payload[\"detail\"][\"timed_out\"] is False\n assert start_payload[\"detail\"][\"state\"] in {\"idle\", \"busy\"}\n\n health_started_status, health_started_payload = _http_call_json(base_url, \"/health\")\n assert health_started_status == 200\n assert health_started_payload[\"status\"] == \"ok\"\n assert health_started_payload[\"state\"] in {\"idle\", \"busy\"}\n finally:\n runtime.stop()", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:test_actions_start_stop_and_health_when_worker_is_idle", - "span_start": 181, - "span_end": 206, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 8, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ] - }, - "diagnostics": { - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C0_SOURCE_CHUNKS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C0_SOURCE_CHUNKS": 10 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [], - "include_globs": [ - "src", - "tests" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests" - ] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src", - "tests" - ], - "include_globs": [ - "src", - "tests" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests" - ] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src", - "tests" - ], - "include_globs": [ - "src", - "tests" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests" - ] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "create_runtime", - "path_scope": [], - "include_globs": [ - "src/**", - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "Где тесты для create_runtime? test_create_runtime Testcreate_runtime create_runtime", - "path_scope": [], - "include_globs": [ - "src/**", - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "top_k": 6, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Где тесты для create_runtime? test_create_runtime Testcreate_runtime create_runtime", - "path_scope": [], - "include_globs": [ - "src/**", - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "top_k": 10, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [], - "normalized_include_globs": [ - "src", - "tests" - ], - "normalized_exclude_globs": [], - "normalized_prefer_globs": [ - "tests" - ], - "filter_stage": "post_rank", - "candidates_before_filter": 0, - "candidates_after_filter": 0 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src", - "tests" - ], - "normalized_include_globs": [ - "src", - "tests" - ], - "normalized_exclude_globs": [], - "normalized_prefer_globs": [ - "tests" - ], - "filter_stage": "post_rank", - "candidates_before_filter": 6, - "candidates_after_filter": 6 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src", - "tests" - ], - "normalized_include_globs": [ - "src", - "tests" - ], - "normalized_exclude_globs": [], - "normalized_prefer_globs": [ - "tests" - ], - "filter_stage": "post_rank", - "candidates_before_filter": 10, - "candidates_after_filter": 10 - } - ], - "fallback": { - "used": true, - "reason": "scope_relaxed_no_hits" - }, - "symbol_resolution": { - "status": "not_found", - "resolved_symbol": null, - "alternatives": [ - "create_runtime" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "miss", - "hit_count": 0, - "fail_reason": "scope_relaxed_no_hits" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 6, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 10, - "fail_reason": null - } - ] - }, - "constraint_violations": [ - { - "type": "LAYER_MISSING", - "severity": "warn", - "details": { - "layer": "C1_SYMBOL_CATALOG", - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ] - }, - "suggested_fix": "Increase top_k for this layer or relax constraints for retrieval." - } - ], - "timings_ms": { - "symbol_resolution": 0, - "retrieval_total": 132, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 58, - "C2_DEPENDENCY_GRAPH": 55, - "C0_SOURCE_CHUNKS": 18 - }, - "merge_rank": 0 - } - } - }, - { - "step": "llm_answer", - "input": { - "query": "Где тесты для create_runtime?", - "rag_count": 16 - }, - "output": { - "llm_answer": "Прямых тестов конкретно для функции `create_runtime` в предоставленном контексте не обнаружено." - }, - "diagnostics": { - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 1022, - "evidence_rows": 16, - "evidence_chars": 9185 - }, - "evidence_summary": [ - { - "layer": "C2_DEPENDENCY_GRAPH", - "count": 6, - "unique_paths": 2 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 10, - "unique_paths": 2 - } - ], - "prompt_template_id": "intent_code_qa_find_tests_ru_v4", - "system_prompt_version": "v1" - }, - "timings_ms": { - "prompt_build": 0, - "llm_call": 1210 - } - } - } - ] - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_143636/full_chain_plba_code_subintents_v2_plba-v2-find-tests-create-runtime.md b/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_143636/full_chain_plba_code_subintents_v2_plba-v2-find-tests-create-runtime.md deleted file mode 100644 index 84fc128..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_143636/full_chain_plba_code_subintents_v2_plba-v2-find-tests-create-runtime.md +++ /dev/null @@ -1,32 +0,0 @@ -# plba-v2-find-tests-create-runtime - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_subintents_v2.yaml -- runner: runtime -- mode: full_chain -- passed: True - -## Query -Где тесты для create_runtime? - -## Actual -{ - "intent": "CODE_QA", - "sub_intent": "FIND_TESTS", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 16, - "llm_answer": "Прямых тестов конкретно для функции `create_runtime` в предоставленном контексте не обнаружено.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "create_runtime" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ] -} - -## Mismatches -- none \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_143636/full_chain_plba_code_subintents_v2_plba-v2-find-tests-runtime-manager.json b/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_143636/full_chain_plba_code_subintents_v2_plba-v2-find-tests-runtime-manager.json deleted file mode 100644 index 535789c..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_143636/full_chain_plba_code_subintents_v2_plba-v2-find-tests-runtime-manager.json +++ /dev/null @@ -1,1879 +0,0 @@ -{ - "case_id": "plba-v2-find-tests-runtime-manager", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_subintents_v2.yaml", - "runner": "runtime", - "mode": "full_chain", - "actual": { - "intent": "CODE_QA", - "sub_intent": "FIND_TESTS", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 16, - "llm_answer": "Прямые тесты для RuntimeManager обнаружены в следующих местах:\n\n1. tests/test_runtime.py | test_runtime_graceful_stop_waits_until_worker_finishes\n - Проверка корректного завершения работы менеджера при выполнении остановки (graceful stop).\n \n2. tests/test_runtime.py | test_runtime_runs_worker_routine_and_exposes_status\n - Тестирование запуска рабочей рутины и доступности статуса RuntimeManager после старта и остановки.\n\nЭти тесты напрямую подтверждают поведение RuntimeManager через его инстанцирование и выполнение конкретных методов. Косвенные тесты также найдены:\n\n1. tests/test_business_control_actions.py | _build_runtime\n - Инстанцирует RuntimeManager в контексте построения бизнес-контроля действий.\n \n2. tests/test_business_control_actions.py | test_worker_wakes_up_with_configured_interval\n - Опять же использует RuntimeManager внутри теста проверки пробуждения рабочего процесса с заданным интервалом.\n\nТаким образом, оба типа покрытия присутствуют — и прямое, и косвенное.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "RuntimeManager" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ] - }, - "passed": true, - "mismatches": [], - "details": { - "case_id": "plba-v2-find-tests-runtime-manager", - "text": "Где тесты для RuntimeManager?", - "mode": "full_chain", - "run_started_at": "2026-03-12T14:36:36", - "rag_session_id": "7d11da21-faa0-4cea-aede-aeabe069164c", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Где тесты для RuntimeManager?", - "symbol_resolution": { - "status": "not_found", - "resolved_symbol": null, - "alternatives": [ - "RuntimeManager" - ], - "confidence": 0.0 - }, - "rag_count": 16, - "rag_rows": [ - { - "path": "tests/test_runtime.py", - "content": "test_runtime_runs_worker_routine_and_exposes_status instantiates RuntimeManager", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_runtime_runs_worker_routine_and_exposes_status:instantiates", - "span_start": 209, - "span_end": 209, - "lexical_rank": 6, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "c397a308e7824ba9fe400a754c7e15e66ea6f058d7f5d3e82bb002bb78b509d2", - "edge_type": "instantiates", - "src_symbol_id": "1c767eb5ee08e84f45b18c8ed7531ec0ed73c63fb1594823569672db7b21e992", - "src_qname": "test_runtime_runs_worker_routine_and_exposes_status", - "dst_symbol_id": "aeadc039653807b0da1ca6e3cc1078ee61cfc510b28e7f9c2ec04c59da43cc8d", - "dst_ref": "RuntimeManager", - "resolution": "resolved", - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_runtime.py", - "content": "test_runtime_graceful_stop_waits_until_worker_finishes instantiates RuntimeManager", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_runtime_graceful_stop_waits_until_worker_finishes:instantiates", - "span_start": 229, - "span_end": 229, - "lexical_rank": 6, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "76b4701262ccaa0a7a41691407c4ebdb2ca74a2415d89f0a38ef0d4f608bda93", - "edge_type": "instantiates", - "src_symbol_id": "1076e788e4a03b10d7bc1313a8ad46caa170c13cc026c6e4de994af1a6ae57bf", - "src_qname": "test_runtime_graceful_stop_waits_until_worker_finishes", - "dst_symbol_id": "aeadc039653807b0da1ca6e3cc1078ee61cfc510b28e7f9c2ec04c59da43cc8d", - "dst_ref": "RuntimeManager", - "resolution": "resolved", - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "_build_runtime instantiates RuntimeManager", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "_build_runtime:instantiates", - "span_start": 155, - "span_end": 155, - "lexical_rank": 6, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "7eb254d564944bab6272757ee5ef688862bd321e6941e2495dc942e03b1c9a25", - "edge_type": "instantiates", - "src_symbol_id": "db94031d5245bf82be836a109b4584b43b8e83d37a0f318e03f6c8191896d469", - "src_qname": "_build_runtime", - "dst_symbol_id": "a1572ea8183dc0cd6ddbc74342bbde8c28cecfde37ad40b62feff09f8d103d11", - "dst_ref": "RuntimeManager", - "resolution": "resolved", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "test_worker_wakes_up_with_configured_interval instantiates RuntimeManager", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_worker_wakes_up_with_configured_interval:instantiates", - "span_start": 167, - "span_end": 167, - "lexical_rank": 6, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "189aafc4de0b79c688668f25f0c87166a127df26bd2215452014713b65ef281a", - "edge_type": "instantiates", - "src_symbol_id": "65f877f78191d65e6a752e41cedc70ebc784c266804a55c1c56440336e1f0d6e", - "src_qname": "test_worker_wakes_up_with_configured_interval", - "dst_symbol_id": "a1572ea8183dc0cd6ddbc74342bbde8c28cecfde37ad40b62feff09f8d103d11", - "dst_ref": "RuntimeManager", - "resolution": "resolved", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "test_actions_stop_busy_worker_after_timeout\n -> BlockingRoutine\n -> BlockingRoutine.__init__\n -> BlockingRoutine._started\n -> BlockingRoutine.run", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_actions_stop_busy_worker_after_timeout:dataflow_slice", - "span_start": 42, - "span_end": 238, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 5, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "8e7db3d2a9226f1c1d9942ac6373cfcafa0d2276758ddb8a3d3c455a3d58024d", - "edge_type": "dataflow_slice", - "src_symbol_id": "66392d3222421d9ba16eda3554940b16e7d5a6f33aa08c5738d35af2e32f1e4a", - "src_qname": "test_actions_stop_busy_worker_after_timeout", - "dst_symbol_id": "d9841bdbb69706c988ae7ae6adf89928dc4fae45943f74064f5382177034ba04", - "dst_ref": "BlockingRoutine.run", - "resolution": "resolved", - "slice_id": "8e7db3d2a9226f1c1d9942ac6373cfcafa0d2276758ddb8a3d3c455a3d58024d", - "root_symbol_id": "66392d3222421d9ba16eda3554940b16e7d5a6f33aa08c5738d35af2e32f1e4a", - "path_symbols": [ - "test_actions_stop_busy_worker_after_timeout", - "BlockingRoutine", - "BlockingRoutine.__init__", - "BlockingRoutine._started", - "BlockingRoutine.run" - ], - "path_symbol_ids": [ - "66392d3222421d9ba16eda3554940b16e7d5a6f33aa08c5738d35af2e32f1e4a", - "a3349c5bc65e4003a4bbd6a8dbb7a54c337e12d1aed930caa701b12e520f1e67", - "486deeed3043c6db985aef258e96ddc67aa53608e67a83962fbd2471f649ddf1", - "d9841bdbb69706c988ae7ae6adf89928dc4fae45943f74064f5382177034ba04" - ], - "path_edge_types": [ - "instantiates", - "writes_attr", - "reads_attr" - ], - "path_length": 5, - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "test_actions_stop_busy_worker_before_timeout\n -> BlockingRoutine\n -> BlockingRoutine.__init__\n -> BlockingRoutine._release\n -> BlockingRoutine.run", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_actions_stop_busy_worker_before_timeout:dataflow_slice", - "span_start": 43, - "span_end": 212, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 5, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "8bd726155ba387d3579763ee84dfd2f9a90bc917da88f3b2e89416ab5c1254d6", - "edge_type": "dataflow_slice", - "src_symbol_id": "a0bb116ca9d909c93a285667ae033fbd1859b2dad7cf34fcb44816393ef6909c", - "src_qname": "test_actions_stop_busy_worker_before_timeout", - "dst_symbol_id": "d9841bdbb69706c988ae7ae6adf89928dc4fae45943f74064f5382177034ba04", - "dst_ref": "BlockingRoutine.run", - "resolution": "resolved", - "slice_id": "8bd726155ba387d3579763ee84dfd2f9a90bc917da88f3b2e89416ab5c1254d6", - "root_symbol_id": "a0bb116ca9d909c93a285667ae033fbd1859b2dad7cf34fcb44816393ef6909c", - "path_symbols": [ - "test_actions_stop_busy_worker_before_timeout", - "BlockingRoutine", - "BlockingRoutine.__init__", - "BlockingRoutine._release", - "BlockingRoutine.run" - ], - "path_symbol_ids": [ - "a0bb116ca9d909c93a285667ae033fbd1859b2dad7cf34fcb44816393ef6909c", - "a3349c5bc65e4003a4bbd6a8dbb7a54c337e12d1aed930caa701b12e520f1e67", - "486deeed3043c6db985aef258e96ddc67aa53608e67a83962fbd2471f649ddf1", - "d9841bdbb69706c988ae7ae6adf89928dc4fae45943f74064f5382177034ba04" - ], - "path_edge_types": [ - "instantiates", - "writes_attr", - "reads_attr" - ], - "path_length": 5, - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_runtime.py", - "content": "def test_runtime_graceful_stop_waits_until_worker_finishes() -> None:\n started = Event()\n release = Event()\n runtime = RuntimeManager()\n runtime.register_module(BlockingModule(started, release))\n runtime.start()\n assert started.wait(timeout=1.0) is True\n assert runtime.status()[\"runtime\"][\"state\"] == \"busy\"\n\n stop_thread = Thread(target=runtime.stop, kwargs={\"timeout\": 1.0}, daemon=True)\n stop_thread.start()\n sleep(0.1)\n assert stop_thread.is_alive() is True\n\n release.set()\n stop_thread.join(timeout=1.0)\n assert stop_thread.is_alive() is False\n assert runtime.status()[\"runtime\"][\"state\"] == \"stopped\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_runtime.py:test_runtime_graceful_stop_waits_until_worker_finishes", - "span_start": 226, - "span_end": 243, - "lexical_rank": 6, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 8, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_runtime", - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_runtime.py", - "content": "def test_runtime_runs_worker_routine_and_exposes_status(tmp_path) -> None:\n config_path = tmp_path / \"config.yml\"\n config_path.write_text(\n \"\"\"\nplatform:\n workers: 1\nlog:\n version: 1\n disable_existing_loggers: false\n handlers:\n console:\n class: logging.StreamHandler\n root:\n level: INFO\n handlers: [console]\n\"\"\".strip(),\n encoding=\"utf-8\",\n )\n runtime = RuntimeManager()\n runtime.add_config_file(config_path)\n module = ExampleModule()\n runtime.register_module(module)\n\n runtime.start()\n sleep(0.2)\n status = runtime.status()\n runtime.stop()\n\n assert module.routine.processed == [{\"id\": 1}]\n assert status[\"modules\"] == [\"example\"]\n assert status[\"runtime\"][\"state\"] == \"idle\"\n assert status[\"health\"][\"status\"] == \"ok\"\n assert status[\"config\"] == {\"platform\": {\"workers\": 1}, \"log\": status[\"config\"][\"log\"]}", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_runtime.py:test_runtime_runs_worker_routine_and_exposes_status", - "span_start": 191, - "span_end": 223, - "lexical_rank": 6, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 7, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_runtime", - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "def _build_runtime(worker: Worker, *, control_timeout: int = 1) -> tuple[RuntimeManager, str]:\n runtime = RuntimeManager()\n channel = HttpControlChannel(host=\"127.0.0.1\", port=0, timeout=control_timeout)\n runtime.control_plane.register_channel(channel)\n runtime.register_module(WorkerModule(worker))\n runtime.start()\n return runtime, f\"http://127.0.0.1:{channel.port}\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:_build_runtime", - "span_start": 154, - "span_end": 160, - "lexical_rank": 6, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 6, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "def test_worker_wakes_up_with_configured_interval() -> None:\n interval = 0.15\n routine = IntervalRoutine()\n worker = ScenarioWorker(\"interval-worker\", routine, interval=interval)\n runtime = RuntimeManager()\n runtime.register_module(WorkerModule(worker))\n\n runtime.start()\n try:\n assert routine.wait_runs(count=3, timeout=2.0) is True\n finally:\n runtime.stop()\n\n deltas = routine.deltas()\n assert len(deltas) >= 2\n assert all(delta >= interval * 0.7 for delta in deltas[:2])", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:test_worker_wakes_up_with_configured_interval", - "span_start": 163, - "span_end": 178, - "lexical_rank": 6, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 7, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "class BlockingRoutine:\n def __init__(self, started: Event, release: Event) -> None:\n self._started = started\n self._release = release\n\n def run(self) -> None:\n self._started.set()\n self._release.wait(timeout=5.0)", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:BlockingRoutine", - "span_start": 40, - "span_end": 47, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 1, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "class ScenarioWorker(Worker):\n def __init__(self, name: str, routine: object, *, interval: float = 0.05) -> None:\n self._name = name\n self._routine = routine\n self._interval = interval\n self._thread: Thread | None = None\n self._stop_requested = Event()\n self._in_flight = 0\n self._runs = 0\n self._lock = Lock()\n\n @property\n def name(self) -> str:\n return self._name\n\n @property\n def critical(self) -> bool:\n return True\n\n def start(self) -> None:\n if self._thread is not None and self._thread.is_alive():\n return\n self._stop_requested.clear()\n self._thread = Thread(target=self._loop, name=f\"{self._name}-thread\", daemon=True)\n self._thread.start()\n\n def stop(self, force: bool = False) -> None:\n self._stop_requested.set()\n\n def health(self) -> WorkerHealth:\n return WorkerHealth(name=self.name, status=\"ok\", critical=True, meta={\"runs\": self._runs})\n\n def status(self) -> WorkerStatus:\n thread_alive = self._thread is not None and self._thread.is_alive()\n with self._lock:\n in_flight = self._in_flight\n runs = self._runs\n if not thread_alive:\n state = \"stopped\"\n elif self._stop_requested.is_set():\n state = \"stopping\"\n elif in_flight > 0:\n state = \"busy\"\n else:\n state = \"idle\"\n return WorkerStatus(name=self.name, state=state, in_flight=in_flight, meta={\"runs\": runs})\n\n def _loop(self) -> None:\n while not self._stop_requested.is_set():\n with self._lock:\n self._in_flight += 1\n try:\n self._routine.run()\n with self._lock:\n self._runs += 1\n finally:\n with self._lock:\n self._in_flight -= 1\n if self._stop_requested.is_set():\n return\n sleep(self._interval)", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:ScenarioWorker", - "span_start": 50, - "span_end": 110, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 2, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "class WorkerModule(ApplicationModule):\n def __init__(self, worker: Worker) -> None:\n self._worker = worker\n\n @property\n def name(self) -> str:\n return \"business-tests\"\n\n def register(self, registry: ModuleRegistry) -> None:\n registry.add_worker(self._worker)", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:WorkerModule", - "span_start": 113, - "span_end": 122, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 3, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "def _http_call_json(\n base_url: str,\n path: str,\n *,\n method: str = \"GET\",\n headers: dict[str, str] | None = None,\n) -> tuple[int, dict[str, object]]:\n request = Request(f\"{base_url}{path}\", method=method, headers=headers or {})\n try:\n with urlopen(request, timeout=15.0) as response:\n status = response.status\n body = response.read()\n except HTTPError as error:\n status = error.code\n body = error.read()\n payload = json.loads(body.decode(\"utf-8\"))\n return status, payload", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:_http_call_json", - "span_start": 125, - "span_end": 141, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 4, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "class IntervalRoutine:\n calls: list[float] = field(default_factory=list)\n _lock: Lock = field(default_factory=Lock)\n\n def run(self) -> None:\n with self._lock:\n self.calls.append(monotonic())\n\n def wait_runs(self, count: int, timeout: float) -> bool:\n deadline = monotonic() + timeout\n while monotonic() < deadline:\n with self._lock:\n if len(self.calls) >= count:\n return True\n sleep(0.01)\n return False\n\n def deltas(self) -> list[float]:\n with self._lock:\n return [self.calls[index + 1] - self.calls[index] for index in range(len(self.calls) - 1)]", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:IntervalRoutine", - "span_start": 18, - "span_end": 37, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "def _poll_until_stopped(base_url: str, timeout: float = 2.0) -> bool:\n deadline = monotonic() + timeout\n while monotonic() < deadline:\n _, payload = _http_call_json(base_url, \"/actions/status\")\n if payload.get(\"detail\") == \"stopped\":\n return True\n sleep(0.05)\n return False", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:_poll_until_stopped", - "span_start": 144, - "span_end": 151, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 5, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "llm_answer": "Прямые тесты для RuntimeManager обнаружены в следующих местах:\n\n1. tests/test_runtime.py | test_runtime_graceful_stop_waits_until_worker_finishes\n - Проверка корректного завершения работы менеджера при выполнении остановки (graceful stop).\n \n2. tests/test_runtime.py | test_runtime_runs_worker_routine_and_exposes_status\n - Тестирование запуска рабочей рутины и доступности статуса RuntimeManager после старта и остановки.\n\nЭти тесты напрямую подтверждают поведение RuntimeManager через его инстанцирование и выполнение конкретных методов. Косвенные тесты также найдены:\n\n1. tests/test_business_control_actions.py | _build_runtime\n - Инстанцирует RuntimeManager в контексте построения бизнес-контроля действий.\n \n2. tests/test_business_control_actions.py | test_worker_wakes_up_with_configured_interval\n - Опять же использует RuntimeManager внутри теста проверки пробуждения рабочего процесса с заданным интервалом.\n\nТаким образом, оба типа покрытия присутствуют — и прямое, и косвенное.", - "summary": { - "router": { - "intent": "CODE_QA", - "sub_intent": "FIND_TESTS", - "confidence": null - }, - "retrieval": { - "profile": "code", - "layers_hit": [ - "C0_SOURCE_CHUNKS", - "C2_DEPENDENCY_GRAPH" - ], - "evidence_sufficient": true - }, - "llm": { - "answer_status": "answered", - "groundedness": "grounded" - } - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "FIND_TESTS", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "RuntimeManager" - ], - "keyword_hints": [ - "RuntimeManager" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**", - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "test_file_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "test_symbol_patterns": [ - "test_runtime_manager", - "TestRuntimeManager", - "RuntimeManager" - ], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C0_SOURCE_CHUNKS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C0_SOURCE_CHUNKS": 10 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [], - "include_globs": [ - "src", - "tests" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests" - ] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src", - "tests" - ], - "include_globs": [ - "src", - "tests" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests" - ] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src", - "tests" - ], - "include_globs": [ - "src", - "tests" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests" - ] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**", - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "Где тесты для RuntimeManager? test_runtime_manager TestRuntimeManager RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**", - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "top_k": 6, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Где тесты для RuntimeManager? test_runtime_manager TestRuntimeManager RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**", - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "top_k": 10, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [], - "normalized_include_globs": [ - "src", - "tests" - ], - "normalized_exclude_globs": [], - "normalized_prefer_globs": [ - "tests" - ], - "filter_stage": "post_rank", - "candidates_before_filter": 0, - "candidates_after_filter": 0 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src", - "tests" - ], - "normalized_include_globs": [ - "src", - "tests" - ], - "normalized_exclude_globs": [], - "normalized_prefer_globs": [ - "tests" - ], - "filter_stage": "post_rank", - "candidates_before_filter": 6, - "candidates_after_filter": 6 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src", - "tests" - ], - "normalized_include_globs": [ - "src", - "tests" - ], - "normalized_exclude_globs": [], - "normalized_prefer_globs": [ - "tests" - ], - "filter_stage": "post_rank", - "candidates_before_filter": 10, - "candidates_after_filter": 10 - } - ], - "fallback": { - "used": true, - "reason": "scope_relaxed_no_hits" - }, - "symbol_resolution": { - "status": "not_found", - "resolved_symbol": null, - "alternatives": [ - "RuntimeManager" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "miss", - "hit_count": 0, - "fail_reason": "scope_relaxed_no_hits" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 6, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 10, - "fail_reason": null - } - ] - }, - "constraint_violations": [ - { - "type": "LAYER_MISSING", - "severity": "warn", - "details": { - "layer": "C1_SYMBOL_CATALOG", - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ] - }, - "suggested_fix": "Increase top_k for this layer or relax constraints for retrieval." - } - ], - "timings_ms": { - "router": 1, - "symbol_resolution": 0, - "retrieval_total": 149, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 80, - "C2_DEPENDENCY_GRAPH": 51, - "C0_SOURCE_CHUNKS": 16 - }, - "merge_rank": 0, - "prompt_build": 0, - "llm_call": 1629 - }, - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 946, - "evidence_rows": 16, - "evidence_chars": 7086 - }, - "evidence_summary": [ - { - "layer": "C2_DEPENDENCY_GRAPH", - "count": 6, - "unique_paths": 2 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 10, - "unique_paths": 2 - } - ], - "prompt_template_id": "intent_code_qa_find_tests_ru_v4", - "system_prompt_version": "v1" - }, - "router": { - "conversation_mode": "START", - "keyword_hints": [ - "RuntimeManager" - ], - "path_scope": [] - }, - "llm": { - "used_evidence_count": 16, - "missing_evidence_reason": null - } - }, - "run_info": { - "case_id": "plba-v2-find-tests-runtime-manager", - "mode": "full_chain", - "run_started_at": "2026-03-12T14:36:36", - "rag_session_id": "7d11da21-faa0-4cea-aede-aeabe069164c", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - }, - "input_request": { - "text": "Где тесты для RuntimeManager?", - "normalized_query": "Где тесты для RuntimeManager?" - }, - "steps": [ - { - "step": "intent_router", - "input": { - "query": "Где тесты для RuntimeManager?" - }, - "output": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Где тесты для RuntimeManager?" - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "FIND_TESTS", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "RuntimeManager" - ], - "keyword_hints": [ - "RuntimeManager" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**", - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "test_file_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "test_symbol_patterns": [ - "test_runtime_manager", - "TestRuntimeManager", - "RuntimeManager" - ], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "timings_ms": { - "router": 1 - } - } - }, - { - "step": "retrieval", - "input": { - "query": "Где тесты для RuntimeManager?" - }, - "output": { - "symbol_resolution": { - "status": "not_found", - "resolved_symbol": null, - "alternatives": [ - "RuntimeManager" - ], - "confidence": 0.0 - }, - "rag_count": 16, - "rag_rows": [ - { - "path": "tests/test_runtime.py", - "content": "test_runtime_runs_worker_routine_and_exposes_status instantiates RuntimeManager", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_runtime_runs_worker_routine_and_exposes_status:instantiates", - "span_start": 209, - "span_end": 209, - "lexical_rank": 6, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "c397a308e7824ba9fe400a754c7e15e66ea6f058d7f5d3e82bb002bb78b509d2", - "edge_type": "instantiates", - "src_symbol_id": "1c767eb5ee08e84f45b18c8ed7531ec0ed73c63fb1594823569672db7b21e992", - "src_qname": "test_runtime_runs_worker_routine_and_exposes_status", - "dst_symbol_id": "aeadc039653807b0da1ca6e3cc1078ee61cfc510b28e7f9c2ec04c59da43cc8d", - "dst_ref": "RuntimeManager", - "resolution": "resolved", - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_runtime.py", - "content": "test_runtime_graceful_stop_waits_until_worker_finishes instantiates RuntimeManager", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_runtime_graceful_stop_waits_until_worker_finishes:instantiates", - "span_start": 229, - "span_end": 229, - "lexical_rank": 6, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "76b4701262ccaa0a7a41691407c4ebdb2ca74a2415d89f0a38ef0d4f608bda93", - "edge_type": "instantiates", - "src_symbol_id": "1076e788e4a03b10d7bc1313a8ad46caa170c13cc026c6e4de994af1a6ae57bf", - "src_qname": "test_runtime_graceful_stop_waits_until_worker_finishes", - "dst_symbol_id": "aeadc039653807b0da1ca6e3cc1078ee61cfc510b28e7f9c2ec04c59da43cc8d", - "dst_ref": "RuntimeManager", - "resolution": "resolved", - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "_build_runtime instantiates RuntimeManager", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "_build_runtime:instantiates", - "span_start": 155, - "span_end": 155, - "lexical_rank": 6, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "7eb254d564944bab6272757ee5ef688862bd321e6941e2495dc942e03b1c9a25", - "edge_type": "instantiates", - "src_symbol_id": "db94031d5245bf82be836a109b4584b43b8e83d37a0f318e03f6c8191896d469", - "src_qname": "_build_runtime", - "dst_symbol_id": "a1572ea8183dc0cd6ddbc74342bbde8c28cecfde37ad40b62feff09f8d103d11", - "dst_ref": "RuntimeManager", - "resolution": "resolved", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "test_worker_wakes_up_with_configured_interval instantiates RuntimeManager", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_worker_wakes_up_with_configured_interval:instantiates", - "span_start": 167, - "span_end": 167, - "lexical_rank": 6, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "189aafc4de0b79c688668f25f0c87166a127df26bd2215452014713b65ef281a", - "edge_type": "instantiates", - "src_symbol_id": "65f877f78191d65e6a752e41cedc70ebc784c266804a55c1c56440336e1f0d6e", - "src_qname": "test_worker_wakes_up_with_configured_interval", - "dst_symbol_id": "a1572ea8183dc0cd6ddbc74342bbde8c28cecfde37ad40b62feff09f8d103d11", - "dst_ref": "RuntimeManager", - "resolution": "resolved", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "test_actions_stop_busy_worker_after_timeout\n -> BlockingRoutine\n -> BlockingRoutine.__init__\n -> BlockingRoutine._started\n -> BlockingRoutine.run", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_actions_stop_busy_worker_after_timeout:dataflow_slice", - "span_start": 42, - "span_end": 238, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 5, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "8e7db3d2a9226f1c1d9942ac6373cfcafa0d2276758ddb8a3d3c455a3d58024d", - "edge_type": "dataflow_slice", - "src_symbol_id": "66392d3222421d9ba16eda3554940b16e7d5a6f33aa08c5738d35af2e32f1e4a", - "src_qname": "test_actions_stop_busy_worker_after_timeout", - "dst_symbol_id": "d9841bdbb69706c988ae7ae6adf89928dc4fae45943f74064f5382177034ba04", - "dst_ref": "BlockingRoutine.run", - "resolution": "resolved", - "slice_id": "8e7db3d2a9226f1c1d9942ac6373cfcafa0d2276758ddb8a3d3c455a3d58024d", - "root_symbol_id": "66392d3222421d9ba16eda3554940b16e7d5a6f33aa08c5738d35af2e32f1e4a", - "path_symbols": [ - "test_actions_stop_busy_worker_after_timeout", - "BlockingRoutine", - "BlockingRoutine.__init__", - "BlockingRoutine._started", - "BlockingRoutine.run" - ], - "path_symbol_ids": [ - "66392d3222421d9ba16eda3554940b16e7d5a6f33aa08c5738d35af2e32f1e4a", - "a3349c5bc65e4003a4bbd6a8dbb7a54c337e12d1aed930caa701b12e520f1e67", - "486deeed3043c6db985aef258e96ddc67aa53608e67a83962fbd2471f649ddf1", - "d9841bdbb69706c988ae7ae6adf89928dc4fae45943f74064f5382177034ba04" - ], - "path_edge_types": [ - "instantiates", - "writes_attr", - "reads_attr" - ], - "path_length": 5, - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "test_actions_stop_busy_worker_before_timeout\n -> BlockingRoutine\n -> BlockingRoutine.__init__\n -> BlockingRoutine._release\n -> BlockingRoutine.run", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_actions_stop_busy_worker_before_timeout:dataflow_slice", - "span_start": 43, - "span_end": 212, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 5, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "8bd726155ba387d3579763ee84dfd2f9a90bc917da88f3b2e89416ab5c1254d6", - "edge_type": "dataflow_slice", - "src_symbol_id": "a0bb116ca9d909c93a285667ae033fbd1859b2dad7cf34fcb44816393ef6909c", - "src_qname": "test_actions_stop_busy_worker_before_timeout", - "dst_symbol_id": "d9841bdbb69706c988ae7ae6adf89928dc4fae45943f74064f5382177034ba04", - "dst_ref": "BlockingRoutine.run", - "resolution": "resolved", - "slice_id": "8bd726155ba387d3579763ee84dfd2f9a90bc917da88f3b2e89416ab5c1254d6", - "root_symbol_id": "a0bb116ca9d909c93a285667ae033fbd1859b2dad7cf34fcb44816393ef6909c", - "path_symbols": [ - "test_actions_stop_busy_worker_before_timeout", - "BlockingRoutine", - "BlockingRoutine.__init__", - "BlockingRoutine._release", - "BlockingRoutine.run" - ], - "path_symbol_ids": [ - "a0bb116ca9d909c93a285667ae033fbd1859b2dad7cf34fcb44816393ef6909c", - "a3349c5bc65e4003a4bbd6a8dbb7a54c337e12d1aed930caa701b12e520f1e67", - "486deeed3043c6db985aef258e96ddc67aa53608e67a83962fbd2471f649ddf1", - "d9841bdbb69706c988ae7ae6adf89928dc4fae45943f74064f5382177034ba04" - ], - "path_edge_types": [ - "instantiates", - "writes_attr", - "reads_attr" - ], - "path_length": 5, - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_runtime.py", - "content": "def test_runtime_graceful_stop_waits_until_worker_finishes() -> None:\n started = Event()\n release = Event()\n runtime = RuntimeManager()\n runtime.register_module(BlockingModule(started, release))\n runtime.start()\n assert started.wait(timeout=1.0) is True\n assert runtime.status()[\"runtime\"][\"state\"] == \"busy\"\n\n stop_thread = Thread(target=runtime.stop, kwargs={\"timeout\": 1.0}, daemon=True)\n stop_thread.start()\n sleep(0.1)\n assert stop_thread.is_alive() is True\n\n release.set()\n stop_thread.join(timeout=1.0)\n assert stop_thread.is_alive() is False\n assert runtime.status()[\"runtime\"][\"state\"] == \"stopped\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_runtime.py:test_runtime_graceful_stop_waits_until_worker_finishes", - "span_start": 226, - "span_end": 243, - "lexical_rank": 6, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 8, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_runtime", - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_runtime.py", - "content": "def test_runtime_runs_worker_routine_and_exposes_status(tmp_path) -> None:\n config_path = tmp_path / \"config.yml\"\n config_path.write_text(\n \"\"\"\nplatform:\n workers: 1\nlog:\n version: 1\n disable_existing_loggers: false\n handlers:\n console:\n class: logging.StreamHandler\n root:\n level: INFO\n handlers: [console]\n\"\"\".strip(),\n encoding=\"utf-8\",\n )\n runtime = RuntimeManager()\n runtime.add_config_file(config_path)\n module = ExampleModule()\n runtime.register_module(module)\n\n runtime.start()\n sleep(0.2)\n status = runtime.status()\n runtime.stop()\n\n assert module.routine.processed == [{\"id\": 1}]\n assert status[\"modules\"] == [\"example\"]\n assert status[\"runtime\"][\"state\"] == \"idle\"\n assert status[\"health\"][\"status\"] == \"ok\"\n assert status[\"config\"] == {\"platform\": {\"workers\": 1}, \"log\": status[\"config\"][\"log\"]}", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_runtime.py:test_runtime_runs_worker_routine_and_exposes_status", - "span_start": 191, - "span_end": 223, - "lexical_rank": 6, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 7, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_runtime", - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "def _build_runtime(worker: Worker, *, control_timeout: int = 1) -> tuple[RuntimeManager, str]:\n runtime = RuntimeManager()\n channel = HttpControlChannel(host=\"127.0.0.1\", port=0, timeout=control_timeout)\n runtime.control_plane.register_channel(channel)\n runtime.register_module(WorkerModule(worker))\n runtime.start()\n return runtime, f\"http://127.0.0.1:{channel.port}\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:_build_runtime", - "span_start": 154, - "span_end": 160, - "lexical_rank": 6, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 6, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "def test_worker_wakes_up_with_configured_interval() -> None:\n interval = 0.15\n routine = IntervalRoutine()\n worker = ScenarioWorker(\"interval-worker\", routine, interval=interval)\n runtime = RuntimeManager()\n runtime.register_module(WorkerModule(worker))\n\n runtime.start()\n try:\n assert routine.wait_runs(count=3, timeout=2.0) is True\n finally:\n runtime.stop()\n\n deltas = routine.deltas()\n assert len(deltas) >= 2\n assert all(delta >= interval * 0.7 for delta in deltas[:2])", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:test_worker_wakes_up_with_configured_interval", - "span_start": 163, - "span_end": 178, - "lexical_rank": 6, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 7, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "class BlockingRoutine:\n def __init__(self, started: Event, release: Event) -> None:\n self._started = started\n self._release = release\n\n def run(self) -> None:\n self._started.set()\n self._release.wait(timeout=5.0)", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:BlockingRoutine", - "span_start": 40, - "span_end": 47, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 1, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "class ScenarioWorker(Worker):\n def __init__(self, name: str, routine: object, *, interval: float = 0.05) -> None:\n self._name = name\n self._routine = routine\n self._interval = interval\n self._thread: Thread | None = None\n self._stop_requested = Event()\n self._in_flight = 0\n self._runs = 0\n self._lock = Lock()\n\n @property\n def name(self) -> str:\n return self._name\n\n @property\n def critical(self) -> bool:\n return True\n\n def start(self) -> None:\n if self._thread is not None and self._thread.is_alive():\n return\n self._stop_requested.clear()\n self._thread = Thread(target=self._loop, name=f\"{self._name}-thread\", daemon=True)\n self._thread.start()\n\n def stop(self, force: bool = False) -> None:\n self._stop_requested.set()\n\n def health(self) -> WorkerHealth:\n return WorkerHealth(name=self.name, status=\"ok\", critical=True, meta={\"runs\": self._runs})\n\n def status(self) -> WorkerStatus:\n thread_alive = self._thread is not None and self._thread.is_alive()\n with self._lock:\n in_flight = self._in_flight\n runs = self._runs\n if not thread_alive:\n state = \"stopped\"\n elif self._stop_requested.is_set():\n state = \"stopping\"\n elif in_flight > 0:\n state = \"busy\"\n else:\n state = \"idle\"\n return WorkerStatus(name=self.name, state=state, in_flight=in_flight, meta={\"runs\": runs})\n\n def _loop(self) -> None:\n while not self._stop_requested.is_set():\n with self._lock:\n self._in_flight += 1\n try:\n self._routine.run()\n with self._lock:\n self._runs += 1\n finally:\n with self._lock:\n self._in_flight -= 1\n if self._stop_requested.is_set():\n return\n sleep(self._interval)", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:ScenarioWorker", - "span_start": 50, - "span_end": 110, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 2, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "class WorkerModule(ApplicationModule):\n def __init__(self, worker: Worker) -> None:\n self._worker = worker\n\n @property\n def name(self) -> str:\n return \"business-tests\"\n\n def register(self, registry: ModuleRegistry) -> None:\n registry.add_worker(self._worker)", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:WorkerModule", - "span_start": 113, - "span_end": 122, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 3, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "def _http_call_json(\n base_url: str,\n path: str,\n *,\n method: str = \"GET\",\n headers: dict[str, str] | None = None,\n) -> tuple[int, dict[str, object]]:\n request = Request(f\"{base_url}{path}\", method=method, headers=headers or {})\n try:\n with urlopen(request, timeout=15.0) as response:\n status = response.status\n body = response.read()\n except HTTPError as error:\n status = error.code\n body = error.read()\n payload = json.loads(body.decode(\"utf-8\"))\n return status, payload", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:_http_call_json", - "span_start": 125, - "span_end": 141, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 4, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "class IntervalRoutine:\n calls: list[float] = field(default_factory=list)\n _lock: Lock = field(default_factory=Lock)\n\n def run(self) -> None:\n with self._lock:\n self.calls.append(monotonic())\n\n def wait_runs(self, count: int, timeout: float) -> bool:\n deadline = monotonic() + timeout\n while monotonic() < deadline:\n with self._lock:\n if len(self.calls) >= count:\n return True\n sleep(0.01)\n return False\n\n def deltas(self) -> list[float]:\n with self._lock:\n return [self.calls[index + 1] - self.calls[index] for index in range(len(self.calls) - 1)]", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:IntervalRoutine", - "span_start": 18, - "span_end": 37, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "def _poll_until_stopped(base_url: str, timeout: float = 2.0) -> bool:\n deadline = monotonic() + timeout\n while monotonic() < deadline:\n _, payload = _http_call_json(base_url, \"/actions/status\")\n if payload.get(\"detail\") == \"stopped\":\n return True\n sleep(0.05)\n return False", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:_poll_until_stopped", - "span_start": 144, - "span_end": 151, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 5, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ] - }, - "diagnostics": { - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C0_SOURCE_CHUNKS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C0_SOURCE_CHUNKS": 10 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [], - "include_globs": [ - "src", - "tests" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests" - ] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src", - "tests" - ], - "include_globs": [ - "src", - "tests" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests" - ] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src", - "tests" - ], - "include_globs": [ - "src", - "tests" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests" - ] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**", - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "Где тесты для RuntimeManager? test_runtime_manager TestRuntimeManager RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**", - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "top_k": 6, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Где тесты для RuntimeManager? test_runtime_manager TestRuntimeManager RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**", - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "top_k": 10, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [], - "normalized_include_globs": [ - "src", - "tests" - ], - "normalized_exclude_globs": [], - "normalized_prefer_globs": [ - "tests" - ], - "filter_stage": "post_rank", - "candidates_before_filter": 0, - "candidates_after_filter": 0 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src", - "tests" - ], - "normalized_include_globs": [ - "src", - "tests" - ], - "normalized_exclude_globs": [], - "normalized_prefer_globs": [ - "tests" - ], - "filter_stage": "post_rank", - "candidates_before_filter": 6, - "candidates_after_filter": 6 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src", - "tests" - ], - "normalized_include_globs": [ - "src", - "tests" - ], - "normalized_exclude_globs": [], - "normalized_prefer_globs": [ - "tests" - ], - "filter_stage": "post_rank", - "candidates_before_filter": 10, - "candidates_after_filter": 10 - } - ], - "fallback": { - "used": true, - "reason": "scope_relaxed_no_hits" - }, - "symbol_resolution": { - "status": "not_found", - "resolved_symbol": null, - "alternatives": [ - "RuntimeManager" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "miss", - "hit_count": 0, - "fail_reason": "scope_relaxed_no_hits" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 6, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 10, - "fail_reason": null - } - ] - }, - "constraint_violations": [ - { - "type": "LAYER_MISSING", - "severity": "warn", - "details": { - "layer": "C1_SYMBOL_CATALOG", - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ] - }, - "suggested_fix": "Increase top_k for this layer or relax constraints for retrieval." - } - ], - "timings_ms": { - "symbol_resolution": 0, - "retrieval_total": 149, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 80, - "C2_DEPENDENCY_GRAPH": 51, - "C0_SOURCE_CHUNKS": 16 - }, - "merge_rank": 0 - } - } - }, - { - "step": "llm_answer", - "input": { - "query": "Где тесты для RuntimeManager?", - "rag_count": 16 - }, - "output": { - "llm_answer": "Прямые тесты для RuntimeManager обнаружены в следующих местах:\n\n1. tests/test_runtime.py | test_runtime_graceful_stop_waits_until_worker_finishes\n - Проверка корректного завершения работы менеджера при выполнении остановки (graceful stop).\n \n2. tests/test_runtime.py | test_runtime_runs_worker_routine_and_exposes_status\n - Тестирование запуска рабочей рутины и доступности статуса RuntimeManager после старта и остановки.\n\nЭти тесты напрямую подтверждают поведение RuntimeManager через его инстанцирование и выполнение конкретных методов. Косвенные тесты также найдены:\n\n1. tests/test_business_control_actions.py | _build_runtime\n - Инстанцирует RuntimeManager в контексте построения бизнес-контроля действий.\n \n2. tests/test_business_control_actions.py | test_worker_wakes_up_with_configured_interval\n - Опять же использует RuntimeManager внутри теста проверки пробуждения рабочего процесса с заданным интервалом.\n\nТаким образом, оба типа покрытия присутствуют — и прямое, и косвенное." - }, - "diagnostics": { - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 946, - "evidence_rows": 16, - "evidence_chars": 7086 - }, - "evidence_summary": [ - { - "layer": "C2_DEPENDENCY_GRAPH", - "count": 6, - "unique_paths": 2 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 10, - "unique_paths": 2 - } - ], - "prompt_template_id": "intent_code_qa_find_tests_ru_v4", - "system_prompt_version": "v1" - }, - "timings_ms": { - "prompt_build": 0, - "llm_call": 1629 - } - } - } - ] - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_143636/full_chain_plba_code_subintents_v2_plba-v2-find-tests-runtime-manager.md b/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_143636/full_chain_plba_code_subintents_v2_plba-v2-find-tests-runtime-manager.md deleted file mode 100644 index 28efff7..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_143636/full_chain_plba_code_subintents_v2_plba-v2-find-tests-runtime-manager.md +++ /dev/null @@ -1,32 +0,0 @@ -# plba-v2-find-tests-runtime-manager - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_subintents_v2.yaml -- runner: runtime -- mode: full_chain -- passed: True - -## Query -Где тесты для RuntimeManager? - -## Actual -{ - "intent": "CODE_QA", - "sub_intent": "FIND_TESTS", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 16, - "llm_answer": "Прямые тесты для RuntimeManager обнаружены в следующих местах:\n\n1. tests/test_runtime.py | test_runtime_graceful_stop_waits_until_worker_finishes\n - Проверка корректного завершения работы менеджера при выполнении остановки (graceful stop).\n \n2. tests/test_runtime.py | test_runtime_runs_worker_routine_and_exposes_status\n - Тестирование запуска рабочей рутины и доступности статуса RuntimeManager после старта и остановки.\n\nЭти тесты напрямую подтверждают поведение RuntimeManager через его инстанцирование и выполнение конкретных методов. Косвенные тесты также найдены:\n\n1. tests/test_business_control_actions.py | _build_runtime\n - Инстанцирует RuntimeManager в контексте построения бизнес-контроля действий.\n \n2. tests/test_business_control_actions.py | test_worker_wakes_up_with_configured_interval\n - Опять же использует RuntimeManager внутри теста проверки пробуждения рабочего процесса с заданным интервалом.\n\nТаким образом, оба типа покрытия присутствуют — и прямое, и косвенное.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "RuntimeManager" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ] -} - -## Mismatches -- none \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_143636/full_chain_plba_code_subintents_v2_plba-v2-find-tests-trace-service.json b/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_143636/full_chain_plba_code_subintents_v2_plba-v2-find-tests-trace-service.json deleted file mode 100644 index 52e7b6e..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_143636/full_chain_plba_code_subintents_v2_plba-v2-find-tests-trace-service.json +++ /dev/null @@ -1,2047 +0,0 @@ -{ - "case_id": "plba-v2-find-tests-trace-service", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_subintents_v2.yaml", - "runner": "runtime", - "mode": "full_chain", - "actual": { - "intent": "CODE_QA", - "sub_intent": "FIND_TESTS", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 16, - "llm_answer": "Прямых тестов конкретно для `TraceService` в указанном контексте нет. Связь с сущностью не подтверждается именами функций, модулями или явными вызовами `TraceService`.\n\nОднако имеются косвенные тесты, которые косвенно затрагивают поведение `TraceService`, взаимодействуя через посредника (`RecordingTransport`), например:\n\n- tests/test_runtime.py: \n - Проверка записи контекстов и сообщений (метод `write_context`) при создании трассировочного сервиса.\n \nЭти тесты косвенно подтверждают корректность работы методов, связанных с `TraceService`. Тем не менее, напрямую тесты `TraceService` отсутствуют.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "TraceService" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ] - }, - "passed": true, - "mismatches": [], - "details": { - "case_id": "plba-v2-find-tests-trace-service", - "text": "Где тесты для TraceService?", - "mode": "full_chain", - "run_started_at": "2026-03-12T14:36:36", - "rag_session_id": "7d11da21-faa0-4cea-aede-aeabe069164c", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Где тесты для TraceService?", - "symbol_resolution": { - "status": "not_found", - "resolved_symbol": null, - "alternatives": [ - "TraceService" - ], - "confidence": 0.0 - }, - "rag_count": 16, - "rag_rows": [ - { - "path": "tests/test_runtime.py", - "content": "test_trace_service_writes_contexts_and_messages\n -> RecordingTransport\n -> RecordingTransport.__init__\n -> RecordingTransport.contexts\n -> test_trace_service_writes_contexts_and_messages", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_trace_service_writes_contexts_and_messages:dataflow_slice", - "span_start": 181, - "span_end": 256, - "lexical_rank": 4, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 5, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "1636a2f70dee79c804259dc114af6c1ab4db27099911e5f97ac97a2bcb59be8a", - "edge_type": "dataflow_slice", - "src_symbol_id": "1600da201da1d0150240b400e3232172354156decdd1a04e1ab1a1edcd3a7e99", - "src_qname": "test_trace_service_writes_contexts_and_messages", - "dst_symbol_id": "1600da201da1d0150240b400e3232172354156decdd1a04e1ab1a1edcd3a7e99", - "dst_ref": "test_trace_service_writes_contexts_and_messages", - "resolution": "resolved", - "slice_id": "1636a2f70dee79c804259dc114af6c1ab4db27099911e5f97ac97a2bcb59be8a", - "root_symbol_id": "1600da201da1d0150240b400e3232172354156decdd1a04e1ab1a1edcd3a7e99", - "path_symbols": [ - "test_trace_service_writes_contexts_and_messages", - "RecordingTransport", - "RecordingTransport.__init__", - "RecordingTransport.contexts", - "test_trace_service_writes_contexts_and_messages" - ], - "path_symbol_ids": [ - "1600da201da1d0150240b400e3232172354156decdd1a04e1ab1a1edcd3a7e99", - "e3d635de1f1880673b69bf73ca6a45caffa5c7fdc23d589d5e40f76b86bdcd33", - "e34d80da723a7115a7a7586b52dc8b5cfda05c581509eee0c1a0296df9a340cb", - "1600da201da1d0150240b400e3232172354156decdd1a04e1ab1a1edcd3a7e99" - ], - "path_edge_types": [ - "instantiates", - "writes_attr", - "reads_attr" - ], - "path_length": 5, - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_runtime.py", - "content": "test_trace_service_writes_contexts_and_messages\n -> RecordingTransport\n -> RecordingTransport.__init__\n -> RecordingTransport.contexts\n -> test_trace_service_allows_messages_without_status", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_trace_service_writes_contexts_and_messages:dataflow_slice", - "span_start": 181, - "span_end": 293, - "lexical_rank": 4, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 5, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "5db5abe56b73f884c5178647bd25ef150064a94a41fc8c052aebaa09bd7fdb3d", - "edge_type": "dataflow_slice", - "src_symbol_id": "1600da201da1d0150240b400e3232172354156decdd1a04e1ab1a1edcd3a7e99", - "src_qname": "test_trace_service_writes_contexts_and_messages", - "dst_symbol_id": "7127ca85ce6447928e195e901d36f1e1f1e8205a686e567c2d1b187431f989df", - "dst_ref": "test_trace_service_allows_messages_without_status", - "resolution": "resolved", - "slice_id": "5db5abe56b73f884c5178647bd25ef150064a94a41fc8c052aebaa09bd7fdb3d", - "root_symbol_id": "1600da201da1d0150240b400e3232172354156decdd1a04e1ab1a1edcd3a7e99", - "path_symbols": [ - "test_trace_service_writes_contexts_and_messages", - "RecordingTransport", - "RecordingTransport.__init__", - "RecordingTransport.contexts", - "test_trace_service_allows_messages_without_status" - ], - "path_symbol_ids": [ - "1600da201da1d0150240b400e3232172354156decdd1a04e1ab1a1edcd3a7e99", - "e3d635de1f1880673b69bf73ca6a45caffa5c7fdc23d589d5e40f76b86bdcd33", - "e34d80da723a7115a7a7586b52dc8b5cfda05c581509eee0c1a0296df9a340cb", - "7127ca85ce6447928e195e901d36f1e1f1e8205a686e567c2d1b187431f989df" - ], - "path_edge_types": [ - "instantiates", - "writes_attr", - "reads_attr" - ], - "path_length": 5, - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_runtime.py", - "content": "test_trace_service_writes_contexts_and_messages\n -> RecordingTransport\n -> RecordingTransport.__init__\n -> RecordingTransport.contexts\n -> RecordingTransport.write_context", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_trace_service_writes_contexts_and_messages:dataflow_slice", - "span_start": 181, - "span_end": 249, - "lexical_rank": 4, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 5, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "60d7a8655fa4c53d9130ce342fc023d24ccfa16baea47ad60c91d2d49f547565", - "edge_type": "dataflow_slice", - "src_symbol_id": "1600da201da1d0150240b400e3232172354156decdd1a04e1ab1a1edcd3a7e99", - "src_qname": "test_trace_service_writes_contexts_and_messages", - "dst_symbol_id": "b8bbf341e230198caafe54727e13f2db27b7200d6fd95684fc5cf748db1a0e88", - "dst_ref": "RecordingTransport.write_context", - "resolution": "resolved", - "slice_id": "60d7a8655fa4c53d9130ce342fc023d24ccfa16baea47ad60c91d2d49f547565", - "root_symbol_id": "1600da201da1d0150240b400e3232172354156decdd1a04e1ab1a1edcd3a7e99", - "path_symbols": [ - "test_trace_service_writes_contexts_and_messages", - "RecordingTransport", - "RecordingTransport.__init__", - "RecordingTransport.contexts", - "RecordingTransport.write_context" - ], - "path_symbol_ids": [ - "1600da201da1d0150240b400e3232172354156decdd1a04e1ab1a1edcd3a7e99", - "e3d635de1f1880673b69bf73ca6a45caffa5c7fdc23d589d5e40f76b86bdcd33", - "e34d80da723a7115a7a7586b52dc8b5cfda05c581509eee0c1a0296df9a340cb", - "b8bbf341e230198caafe54727e13f2db27b7200d6fd95684fc5cf748db1a0e88" - ], - "path_edge_types": [ - "instantiates", - "writes_attr", - "reads_attr" - ], - "path_length": 5, - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_runtime.py", - "content": "test_trace_service_supports_debug_warning_and_error_levels\n -> RecordingTransport\n -> RecordingTransport.__init__\n -> RecordingTransport.contexts\n -> RecordingTransport.write_context", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_trace_service_supports_debug_warning_and_error_levels:dataflow_slice", - "span_start": 181, - "span_end": 265, - "lexical_rank": 4, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 5, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "1372a2241c7265705e5cf9dceeb5e59836fac1d679227c4279ed39e0798ddddf", - "edge_type": "dataflow_slice", - "src_symbol_id": "ede183f1c546725064e28ddab1ffdbae0d1a1258fd62a50eb556c10d10995415", - "src_qname": "test_trace_service_supports_debug_warning_and_error_levels", - "dst_symbol_id": "b8bbf341e230198caafe54727e13f2db27b7200d6fd95684fc5cf748db1a0e88", - "dst_ref": "RecordingTransport.write_context", - "resolution": "resolved", - "slice_id": "1372a2241c7265705e5cf9dceeb5e59836fac1d679227c4279ed39e0798ddddf", - "root_symbol_id": "ede183f1c546725064e28ddab1ffdbae0d1a1258fd62a50eb556c10d10995415", - "path_symbols": [ - "test_trace_service_supports_debug_warning_and_error_levels", - "RecordingTransport", - "RecordingTransport.__init__", - "RecordingTransport.contexts", - "RecordingTransport.write_context" - ], - "path_symbol_ids": [ - "ede183f1c546725064e28ddab1ffdbae0d1a1258fd62a50eb556c10d10995415", - "e3d635de1f1880673b69bf73ca6a45caffa5c7fdc23d589d5e40f76b86bdcd33", - "e34d80da723a7115a7a7586b52dc8b5cfda05c581509eee0c1a0296df9a340cb", - "b8bbf341e230198caafe54727e13f2db27b7200d6fd95684fc5cf748db1a0e88" - ], - "path_edge_types": [ - "instantiates", - "writes_attr", - "reads_attr" - ], - "path_length": 5, - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_runtime.py", - "content": "test_trace_service_supports_debug_warning_and_error_levels\n -> RecordingTransport\n -> RecordingTransport.__init__\n -> RecordingTransport.contexts\n -> test_trace_service_writes_contexts_and_messages", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_trace_service_supports_debug_warning_and_error_levels:dataflow_slice", - "span_start": 181, - "span_end": 265, - "lexical_rank": 4, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 5, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "8b6a5a738525df160600d71c15915704172de20db436ea2f84b6e039be396a2d", - "edge_type": "dataflow_slice", - "src_symbol_id": "ede183f1c546725064e28ddab1ffdbae0d1a1258fd62a50eb556c10d10995415", - "src_qname": "test_trace_service_supports_debug_warning_and_error_levels", - "dst_symbol_id": "1600da201da1d0150240b400e3232172354156decdd1a04e1ab1a1edcd3a7e99", - "dst_ref": "test_trace_service_writes_contexts_and_messages", - "resolution": "resolved", - "slice_id": "8b6a5a738525df160600d71c15915704172de20db436ea2f84b6e039be396a2d", - "root_symbol_id": "ede183f1c546725064e28ddab1ffdbae0d1a1258fd62a50eb556c10d10995415", - "path_symbols": [ - "test_trace_service_supports_debug_warning_and_error_levels", - "RecordingTransport", - "RecordingTransport.__init__", - "RecordingTransport.contexts", - "test_trace_service_writes_contexts_and_messages" - ], - "path_symbol_ids": [ - "ede183f1c546725064e28ddab1ffdbae0d1a1258fd62a50eb556c10d10995415", - "e3d635de1f1880673b69bf73ca6a45caffa5c7fdc23d589d5e40f76b86bdcd33", - "e34d80da723a7115a7a7586b52dc8b5cfda05c581509eee0c1a0296df9a340cb", - "1600da201da1d0150240b400e3232172354156decdd1a04e1ab1a1edcd3a7e99" - ], - "path_edge_types": [ - "instantiates", - "writes_attr", - "reads_attr" - ], - "path_length": 5, - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_runtime.py", - "content": "test_trace_service_supports_debug_warning_and_error_levels\n -> RecordingTransport\n -> RecordingTransport.__init__\n -> RecordingTransport.contexts\n -> test_trace_service_allows_messages_without_status", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_trace_service_supports_debug_warning_and_error_levels:dataflow_slice", - "span_start": 181, - "span_end": 293, - "lexical_rank": 4, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 5, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "f7d099f6d5746aa61a3025fd7eef791369bd3a3e5df4bc716de87e7b149ccde6", - "edge_type": "dataflow_slice", - "src_symbol_id": "ede183f1c546725064e28ddab1ffdbae0d1a1258fd62a50eb556c10d10995415", - "src_qname": "test_trace_service_supports_debug_warning_and_error_levels", - "dst_symbol_id": "7127ca85ce6447928e195e901d36f1e1f1e8205a686e567c2d1b187431f989df", - "dst_ref": "test_trace_service_allows_messages_without_status", - "resolution": "resolved", - "slice_id": "f7d099f6d5746aa61a3025fd7eef791369bd3a3e5df4bc716de87e7b149ccde6", - "root_symbol_id": "ede183f1c546725064e28ddab1ffdbae0d1a1258fd62a50eb556c10d10995415", - "path_symbols": [ - "test_trace_service_supports_debug_warning_and_error_levels", - "RecordingTransport", - "RecordingTransport.__init__", - "RecordingTransport.contexts", - "test_trace_service_allows_messages_without_status" - ], - "path_symbol_ids": [ - "ede183f1c546725064e28ddab1ffdbae0d1a1258fd62a50eb556c10d10995415", - "e3d635de1f1880673b69bf73ca6a45caffa5c7fdc23d589d5e40f76b86bdcd33", - "e34d80da723a7115a7a7586b52dc8b5cfda05c581509eee0c1a0296df9a340cb", - "7127ca85ce6447928e195e901d36f1e1f1e8205a686e567c2d1b187431f989df" - ], - "path_edge_types": [ - "instantiates", - "writes_attr", - "reads_attr" - ], - "path_length": 5, - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_runtime.py", - "content": "def test_trace_service_writes_contexts_and_messages() -> None:\n from app_runtime.tracing.service import TraceService\n\n transport = RecordingTransport()\n manager = TraceService(transport=transport)\n\n with manager.open_context(alias=\"worker\", kind=\"worker\", attrs={\"routine\": \"incoming\"}):\n manager.step(\"parse\")\n manager.info(\"started\", status=\"ok\", attrs={\"attempt\": 1})\n\n assert len(transport.contexts) == 1\n assert len(transport.messages) == 1\n assert transport.contexts[0].alias == \"worker\"\n assert transport.messages[0].step == \"parse\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_runtime.py:test_trace_service_writes_contexts_and_messages", - "span_start": 246, - "span_end": 259, - "lexical_rank": 6, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 9, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_runtime", - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_runtime.py", - "content": "def test_trace_service_supports_debug_warning_and_error_levels() -> None:\n from app_runtime.tracing.service import TraceService\n\n transport = RecordingTransport()\n manager = TraceService(transport=transport)\n\n with manager.open_context(alias=\"worker\", kind=\"worker\", attrs={\"routine\": \"incoming\"}):\n manager.step(\"validate\")\n manager.debug(\"validation details\", attrs={\"rule\": \"basic\"})\n manager.warning(\"validation warning\", status=\"degraded\", attrs={\"attempt\": 1})\n manager.error(\"integration failed\", status=\"failed\", attrs={\"integration\": \"crm\"})\n manager.exception(\"caught exception\", attrs={\"exception_type\": \"RuntimeError\"})\n\n levels = [message.level for message in transport.messages]\n assert levels == [\"DEBUG\", \"WARNING\", \"ERROR\", \"ERROR\"]", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_runtime.py:test_trace_service_supports_debug_warning_and_error_levels", - "span_start": 262, - "span_end": 276, - "lexical_rank": 6, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 10, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_runtime", - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_runtime.py", - "content": "def test_trace_service_allows_messages_without_status() -> None:\n from app_runtime.tracing.service import TraceService\n\n transport = RecordingTransport()\n manager = TraceService(transport=transport)\n\n with manager.open_context(alias=\"worker\", kind=\"worker\"):\n manager.step(\"optional-status\")\n manager.debug(\"debug without status\")\n manager.info(\"info without status\")\n manager.warning(\"warning without status\")\n manager.error(\"error without status\")\n\n assert [message.status for message in transport.messages] == [\"\", \"\", \"\", \"\"]\n assert all(message.trace_id == transport.contexts[0].trace_id for message in transport.messages)", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_runtime.py:test_trace_service_allows_messages_without_status", - "span_start": 279, - "span_end": 293, - "lexical_rank": 6, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 11, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_runtime", - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "class ScenarioWorker(Worker):\n def __init__(self, name: str, routine: object, *, interval: float = 0.05) -> None:\n self._name = name\n self._routine = routine\n self._interval = interval\n self._thread: Thread | None = None\n self._stop_requested = Event()\n self._in_flight = 0\n self._runs = 0\n self._lock = Lock()\n\n @property\n def name(self) -> str:\n return self._name\n\n @property\n def critical(self) -> bool:\n return True\n\n def start(self) -> None:\n if self._thread is not None and self._thread.is_alive():\n return\n self._stop_requested.clear()\n self._thread = Thread(target=self._loop, name=f\"{self._name}-thread\", daemon=True)\n self._thread.start()\n\n def stop(self, force: bool = False) -> None:\n self._stop_requested.set()\n\n def health(self) -> WorkerHealth:\n return WorkerHealth(name=self.name, status=\"ok\", critical=True, meta={\"runs\": self._runs})\n\n def status(self) -> WorkerStatus:\n thread_alive = self._thread is not None and self._thread.is_alive()\n with self._lock:\n in_flight = self._in_flight\n runs = self._runs\n if not thread_alive:\n state = \"stopped\"\n elif self._stop_requested.is_set():\n state = \"stopping\"\n elif in_flight > 0:\n state = \"busy\"\n else:\n state = \"idle\"\n return WorkerStatus(name=self.name, state=state, in_flight=in_flight, meta={\"runs\": runs})\n\n def _loop(self) -> None:\n while not self._stop_requested.is_set():\n with self._lock:\n self._in_flight += 1\n try:\n self._routine.run()\n with self._lock:\n self._runs += 1\n finally:\n with self._lock:\n self._in_flight -= 1\n if self._stop_requested.is_set():\n return\n sleep(self._interval)", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:ScenarioWorker", - "span_start": 50, - "span_end": 110, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 2, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "class IntervalRoutine:\n calls: list[float] = field(default_factory=list)\n _lock: Lock = field(default_factory=Lock)\n\n def run(self) -> None:\n with self._lock:\n self.calls.append(monotonic())\n\n def wait_runs(self, count: int, timeout: float) -> bool:\n deadline = monotonic() + timeout\n while monotonic() < deadline:\n with self._lock:\n if len(self.calls) >= count:\n return True\n sleep(0.01)\n return False\n\n def deltas(self) -> list[float]:\n with self._lock:\n return [self.calls[index + 1] - self.calls[index] for index in range(len(self.calls) - 1)]", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:IntervalRoutine", - "span_start": 18, - "span_end": 37, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "class BlockingRoutine:\n def __init__(self, started: Event, release: Event) -> None:\n self._started = started\n self._release = release\n\n def run(self) -> None:\n self._started.set()\n self._release.wait(timeout=5.0)", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:BlockingRoutine", - "span_start": 40, - "span_end": 47, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 1, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "def test_worker_wakes_up_with_configured_interval() -> None:\n interval = 0.15\n routine = IntervalRoutine()\n worker = ScenarioWorker(\"interval-worker\", routine, interval=interval)\n runtime = RuntimeManager()\n runtime.register_module(WorkerModule(worker))\n\n runtime.start()\n try:\n assert routine.wait_runs(count=3, timeout=2.0) is True\n finally:\n runtime.stop()\n\n deltas = routine.deltas()\n assert len(deltas) >= 2\n assert all(delta >= interval * 0.7 for delta in deltas[:2])", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:test_worker_wakes_up_with_configured_interval", - "span_start": 163, - "span_end": 178, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 7, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "def _http_call_json(\n base_url: str,\n path: str,\n *,\n method: str = \"GET\",\n headers: dict[str, str] | None = None,\n) -> tuple[int, dict[str, object]]:\n request = Request(f\"{base_url}{path}\", method=method, headers=headers or {})\n try:\n with urlopen(request, timeout=15.0) as response:\n status = response.status\n body = response.read()\n except HTTPError as error:\n status = error.code\n body = error.read()\n payload = json.loads(body.decode(\"utf-8\"))\n return status, payload", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:_http_call_json", - "span_start": 125, - "span_end": 141, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 4, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "def _build_runtime(worker: Worker, *, control_timeout: int = 1) -> tuple[RuntimeManager, str]:\n runtime = RuntimeManager()\n channel = HttpControlChannel(host=\"127.0.0.1\", port=0, timeout=control_timeout)\n runtime.control_plane.register_channel(channel)\n runtime.register_module(WorkerModule(worker))\n runtime.start()\n return runtime, f\"http://127.0.0.1:{channel.port}\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:_build_runtime", - "span_start": 154, - "span_end": 160, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 6, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "class WorkerModule(ApplicationModule):\n def __init__(self, worker: Worker) -> None:\n self._worker = worker\n\n @property\n def name(self) -> str:\n return \"business-tests\"\n\n def register(self, registry: ModuleRegistry) -> None:\n registry.add_worker(self._worker)", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:WorkerModule", - "span_start": 113, - "span_end": 122, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 3, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "llm_answer": "Прямых тестов конкретно для `TraceService` в указанном контексте нет. Связь с сущностью не подтверждается именами функций, модулями или явными вызовами `TraceService`.\n\nОднако имеются косвенные тесты, которые косвенно затрагивают поведение `TraceService`, взаимодействуя через посредника (`RecordingTransport`), например:\n\n- tests/test_runtime.py: \n - Проверка записи контекстов и сообщений (метод `write_context`) при создании трассировочного сервиса.\n \nЭти тесты косвенно подтверждают корректность работы методов, связанных с `TraceService`. Тем не менее, напрямую тесты `TraceService` отсутствуют.", - "summary": { - "router": { - "intent": "CODE_QA", - "sub_intent": "FIND_TESTS", - "confidence": null - }, - "retrieval": { - "profile": "code", - "layers_hit": [ - "C0_SOURCE_CHUNKS", - "C2_DEPENDENCY_GRAPH" - ], - "evidence_sufficient": true - }, - "llm": { - "answer_status": "answered", - "groundedness": "grounded" - } - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "FIND_TESTS", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "TraceService" - ], - "keyword_hints": [ - "TraceService" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**", - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "test_file_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "test_symbol_patterns": [ - "test_trace_service", - "TestTraceService", - "TraceService" - ], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C0_SOURCE_CHUNKS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C0_SOURCE_CHUNKS": 10 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [], - "include_globs": [ - "src", - "tests" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests" - ] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src", - "tests" - ], - "include_globs": [ - "src", - "tests" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests" - ] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src", - "tests" - ], - "include_globs": [ - "src", - "tests" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests" - ] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "TraceService", - "path_scope": [], - "include_globs": [ - "src/**", - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "Где тесты для TraceService? test_trace_service TestTraceService TraceService", - "path_scope": [], - "include_globs": [ - "src/**", - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "top_k": 6, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Где тесты для TraceService? test_trace_service TestTraceService TraceService", - "path_scope": [], - "include_globs": [ - "src/**", - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "top_k": 10, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [], - "normalized_include_globs": [ - "src", - "tests" - ], - "normalized_exclude_globs": [], - "normalized_prefer_globs": [ - "tests" - ], - "filter_stage": "post_rank", - "candidates_before_filter": 0, - "candidates_after_filter": 0 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src", - "tests" - ], - "normalized_include_globs": [ - "src", - "tests" - ], - "normalized_exclude_globs": [], - "normalized_prefer_globs": [ - "tests" - ], - "filter_stage": "post_rank", - "candidates_before_filter": 6, - "candidates_after_filter": 6 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src", - "tests" - ], - "normalized_include_globs": [ - "src", - "tests" - ], - "normalized_exclude_globs": [], - "normalized_prefer_globs": [ - "tests" - ], - "filter_stage": "post_rank", - "candidates_before_filter": 10, - "candidates_after_filter": 10 - } - ], - "fallback": { - "used": true, - "reason": "scope_relaxed_no_hits" - }, - "symbol_resolution": { - "status": "not_found", - "resolved_symbol": null, - "alternatives": [ - "TraceService" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "miss", - "hit_count": 0, - "fail_reason": "scope_relaxed_no_hits" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 6, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 10, - "fail_reason": null - } - ] - }, - "constraint_violations": [ - { - "type": "LAYER_MISSING", - "severity": "warn", - "details": { - "layer": "C1_SYMBOL_CATALOG", - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ] - }, - "suggested_fix": "Increase top_k for this layer or relax constraints for retrieval." - } - ], - "timings_ms": { - "router": 1, - "symbol_resolution": 0, - "retrieval_total": 128, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 63, - "C2_DEPENDENCY_GRAPH": 49, - "C0_SOURCE_CHUNKS": 14 - }, - "merge_rank": 0, - "prompt_build": 0, - "llm_call": 1118 - }, - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 1021, - "evidence_rows": 16, - "evidence_chars": 7847 - }, - "evidence_summary": [ - { - "layer": "C2_DEPENDENCY_GRAPH", - "count": 6, - "unique_paths": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 10, - "unique_paths": 2 - } - ], - "prompt_template_id": "intent_code_qa_find_tests_ru_v4", - "system_prompt_version": "v1" - }, - "router": { - "conversation_mode": "START", - "keyword_hints": [ - "TraceService" - ], - "path_scope": [] - }, - "llm": { - "used_evidence_count": 16, - "missing_evidence_reason": null - } - }, - "run_info": { - "case_id": "plba-v2-find-tests-trace-service", - "mode": "full_chain", - "run_started_at": "2026-03-12T14:36:36", - "rag_session_id": "7d11da21-faa0-4cea-aede-aeabe069164c", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - }, - "input_request": { - "text": "Где тесты для TraceService?", - "normalized_query": "Где тесты для TraceService?" - }, - "steps": [ - { - "step": "intent_router", - "input": { - "query": "Где тесты для TraceService?" - }, - "output": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Где тесты для TraceService?" - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "FIND_TESTS", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "TraceService" - ], - "keyword_hints": [ - "TraceService" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**", - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "test_file_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "test_symbol_patterns": [ - "test_trace_service", - "TestTraceService", - "TraceService" - ], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "timings_ms": { - "router": 1 - } - } - }, - { - "step": "retrieval", - "input": { - "query": "Где тесты для TraceService?" - }, - "output": { - "symbol_resolution": { - "status": "not_found", - "resolved_symbol": null, - "alternatives": [ - "TraceService" - ], - "confidence": 0.0 - }, - "rag_count": 16, - "rag_rows": [ - { - "path": "tests/test_runtime.py", - "content": "test_trace_service_writes_contexts_and_messages\n -> RecordingTransport\n -> RecordingTransport.__init__\n -> RecordingTransport.contexts\n -> test_trace_service_writes_contexts_and_messages", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_trace_service_writes_contexts_and_messages:dataflow_slice", - "span_start": 181, - "span_end": 256, - "lexical_rank": 4, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 5, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "1636a2f70dee79c804259dc114af6c1ab4db27099911e5f97ac97a2bcb59be8a", - "edge_type": "dataflow_slice", - "src_symbol_id": "1600da201da1d0150240b400e3232172354156decdd1a04e1ab1a1edcd3a7e99", - "src_qname": "test_trace_service_writes_contexts_and_messages", - "dst_symbol_id": "1600da201da1d0150240b400e3232172354156decdd1a04e1ab1a1edcd3a7e99", - "dst_ref": "test_trace_service_writes_contexts_and_messages", - "resolution": "resolved", - "slice_id": "1636a2f70dee79c804259dc114af6c1ab4db27099911e5f97ac97a2bcb59be8a", - "root_symbol_id": "1600da201da1d0150240b400e3232172354156decdd1a04e1ab1a1edcd3a7e99", - "path_symbols": [ - "test_trace_service_writes_contexts_and_messages", - "RecordingTransport", - "RecordingTransport.__init__", - "RecordingTransport.contexts", - "test_trace_service_writes_contexts_and_messages" - ], - "path_symbol_ids": [ - "1600da201da1d0150240b400e3232172354156decdd1a04e1ab1a1edcd3a7e99", - "e3d635de1f1880673b69bf73ca6a45caffa5c7fdc23d589d5e40f76b86bdcd33", - "e34d80da723a7115a7a7586b52dc8b5cfda05c581509eee0c1a0296df9a340cb", - "1600da201da1d0150240b400e3232172354156decdd1a04e1ab1a1edcd3a7e99" - ], - "path_edge_types": [ - "instantiates", - "writes_attr", - "reads_attr" - ], - "path_length": 5, - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_runtime.py", - "content": "test_trace_service_writes_contexts_and_messages\n -> RecordingTransport\n -> RecordingTransport.__init__\n -> RecordingTransport.contexts\n -> test_trace_service_allows_messages_without_status", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_trace_service_writes_contexts_and_messages:dataflow_slice", - "span_start": 181, - "span_end": 293, - "lexical_rank": 4, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 5, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "5db5abe56b73f884c5178647bd25ef150064a94a41fc8c052aebaa09bd7fdb3d", - "edge_type": "dataflow_slice", - "src_symbol_id": "1600da201da1d0150240b400e3232172354156decdd1a04e1ab1a1edcd3a7e99", - "src_qname": "test_trace_service_writes_contexts_and_messages", - "dst_symbol_id": "7127ca85ce6447928e195e901d36f1e1f1e8205a686e567c2d1b187431f989df", - "dst_ref": "test_trace_service_allows_messages_without_status", - "resolution": "resolved", - "slice_id": "5db5abe56b73f884c5178647bd25ef150064a94a41fc8c052aebaa09bd7fdb3d", - "root_symbol_id": "1600da201da1d0150240b400e3232172354156decdd1a04e1ab1a1edcd3a7e99", - "path_symbols": [ - "test_trace_service_writes_contexts_and_messages", - "RecordingTransport", - "RecordingTransport.__init__", - "RecordingTransport.contexts", - "test_trace_service_allows_messages_without_status" - ], - "path_symbol_ids": [ - "1600da201da1d0150240b400e3232172354156decdd1a04e1ab1a1edcd3a7e99", - "e3d635de1f1880673b69bf73ca6a45caffa5c7fdc23d589d5e40f76b86bdcd33", - "e34d80da723a7115a7a7586b52dc8b5cfda05c581509eee0c1a0296df9a340cb", - "7127ca85ce6447928e195e901d36f1e1f1e8205a686e567c2d1b187431f989df" - ], - "path_edge_types": [ - "instantiates", - "writes_attr", - "reads_attr" - ], - "path_length": 5, - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_runtime.py", - "content": "test_trace_service_writes_contexts_and_messages\n -> RecordingTransport\n -> RecordingTransport.__init__\n -> RecordingTransport.contexts\n -> RecordingTransport.write_context", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_trace_service_writes_contexts_and_messages:dataflow_slice", - "span_start": 181, - "span_end": 249, - "lexical_rank": 4, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 5, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "60d7a8655fa4c53d9130ce342fc023d24ccfa16baea47ad60c91d2d49f547565", - "edge_type": "dataflow_slice", - "src_symbol_id": "1600da201da1d0150240b400e3232172354156decdd1a04e1ab1a1edcd3a7e99", - "src_qname": "test_trace_service_writes_contexts_and_messages", - "dst_symbol_id": "b8bbf341e230198caafe54727e13f2db27b7200d6fd95684fc5cf748db1a0e88", - "dst_ref": "RecordingTransport.write_context", - "resolution": "resolved", - "slice_id": "60d7a8655fa4c53d9130ce342fc023d24ccfa16baea47ad60c91d2d49f547565", - "root_symbol_id": "1600da201da1d0150240b400e3232172354156decdd1a04e1ab1a1edcd3a7e99", - "path_symbols": [ - "test_trace_service_writes_contexts_and_messages", - "RecordingTransport", - "RecordingTransport.__init__", - "RecordingTransport.contexts", - "RecordingTransport.write_context" - ], - "path_symbol_ids": [ - "1600da201da1d0150240b400e3232172354156decdd1a04e1ab1a1edcd3a7e99", - "e3d635de1f1880673b69bf73ca6a45caffa5c7fdc23d589d5e40f76b86bdcd33", - "e34d80da723a7115a7a7586b52dc8b5cfda05c581509eee0c1a0296df9a340cb", - "b8bbf341e230198caafe54727e13f2db27b7200d6fd95684fc5cf748db1a0e88" - ], - "path_edge_types": [ - "instantiates", - "writes_attr", - "reads_attr" - ], - "path_length": 5, - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_runtime.py", - "content": "test_trace_service_supports_debug_warning_and_error_levels\n -> RecordingTransport\n -> RecordingTransport.__init__\n -> RecordingTransport.contexts\n -> RecordingTransport.write_context", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_trace_service_supports_debug_warning_and_error_levels:dataflow_slice", - "span_start": 181, - "span_end": 265, - "lexical_rank": 4, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 5, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "1372a2241c7265705e5cf9dceeb5e59836fac1d679227c4279ed39e0798ddddf", - "edge_type": "dataflow_slice", - "src_symbol_id": "ede183f1c546725064e28ddab1ffdbae0d1a1258fd62a50eb556c10d10995415", - "src_qname": "test_trace_service_supports_debug_warning_and_error_levels", - "dst_symbol_id": "b8bbf341e230198caafe54727e13f2db27b7200d6fd95684fc5cf748db1a0e88", - "dst_ref": "RecordingTransport.write_context", - "resolution": "resolved", - "slice_id": "1372a2241c7265705e5cf9dceeb5e59836fac1d679227c4279ed39e0798ddddf", - "root_symbol_id": "ede183f1c546725064e28ddab1ffdbae0d1a1258fd62a50eb556c10d10995415", - "path_symbols": [ - "test_trace_service_supports_debug_warning_and_error_levels", - "RecordingTransport", - "RecordingTransport.__init__", - "RecordingTransport.contexts", - "RecordingTransport.write_context" - ], - "path_symbol_ids": [ - "ede183f1c546725064e28ddab1ffdbae0d1a1258fd62a50eb556c10d10995415", - "e3d635de1f1880673b69bf73ca6a45caffa5c7fdc23d589d5e40f76b86bdcd33", - "e34d80da723a7115a7a7586b52dc8b5cfda05c581509eee0c1a0296df9a340cb", - "b8bbf341e230198caafe54727e13f2db27b7200d6fd95684fc5cf748db1a0e88" - ], - "path_edge_types": [ - "instantiates", - "writes_attr", - "reads_attr" - ], - "path_length": 5, - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_runtime.py", - "content": "test_trace_service_supports_debug_warning_and_error_levels\n -> RecordingTransport\n -> RecordingTransport.__init__\n -> RecordingTransport.contexts\n -> test_trace_service_writes_contexts_and_messages", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_trace_service_supports_debug_warning_and_error_levels:dataflow_slice", - "span_start": 181, - "span_end": 265, - "lexical_rank": 4, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 5, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "8b6a5a738525df160600d71c15915704172de20db436ea2f84b6e039be396a2d", - "edge_type": "dataflow_slice", - "src_symbol_id": "ede183f1c546725064e28ddab1ffdbae0d1a1258fd62a50eb556c10d10995415", - "src_qname": "test_trace_service_supports_debug_warning_and_error_levels", - "dst_symbol_id": "1600da201da1d0150240b400e3232172354156decdd1a04e1ab1a1edcd3a7e99", - "dst_ref": "test_trace_service_writes_contexts_and_messages", - "resolution": "resolved", - "slice_id": "8b6a5a738525df160600d71c15915704172de20db436ea2f84b6e039be396a2d", - "root_symbol_id": "ede183f1c546725064e28ddab1ffdbae0d1a1258fd62a50eb556c10d10995415", - "path_symbols": [ - "test_trace_service_supports_debug_warning_and_error_levels", - "RecordingTransport", - "RecordingTransport.__init__", - "RecordingTransport.contexts", - "test_trace_service_writes_contexts_and_messages" - ], - "path_symbol_ids": [ - "ede183f1c546725064e28ddab1ffdbae0d1a1258fd62a50eb556c10d10995415", - "e3d635de1f1880673b69bf73ca6a45caffa5c7fdc23d589d5e40f76b86bdcd33", - "e34d80da723a7115a7a7586b52dc8b5cfda05c581509eee0c1a0296df9a340cb", - "1600da201da1d0150240b400e3232172354156decdd1a04e1ab1a1edcd3a7e99" - ], - "path_edge_types": [ - "instantiates", - "writes_attr", - "reads_attr" - ], - "path_length": 5, - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_runtime.py", - "content": "test_trace_service_supports_debug_warning_and_error_levels\n -> RecordingTransport\n -> RecordingTransport.__init__\n -> RecordingTransport.contexts\n -> test_trace_service_allows_messages_without_status", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_trace_service_supports_debug_warning_and_error_levels:dataflow_slice", - "span_start": 181, - "span_end": 293, - "lexical_rank": 4, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 5, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "f7d099f6d5746aa61a3025fd7eef791369bd3a3e5df4bc716de87e7b149ccde6", - "edge_type": "dataflow_slice", - "src_symbol_id": "ede183f1c546725064e28ddab1ffdbae0d1a1258fd62a50eb556c10d10995415", - "src_qname": "test_trace_service_supports_debug_warning_and_error_levels", - "dst_symbol_id": "7127ca85ce6447928e195e901d36f1e1f1e8205a686e567c2d1b187431f989df", - "dst_ref": "test_trace_service_allows_messages_without_status", - "resolution": "resolved", - "slice_id": "f7d099f6d5746aa61a3025fd7eef791369bd3a3e5df4bc716de87e7b149ccde6", - "root_symbol_id": "ede183f1c546725064e28ddab1ffdbae0d1a1258fd62a50eb556c10d10995415", - "path_symbols": [ - "test_trace_service_supports_debug_warning_and_error_levels", - "RecordingTransport", - "RecordingTransport.__init__", - "RecordingTransport.contexts", - "test_trace_service_allows_messages_without_status" - ], - "path_symbol_ids": [ - "ede183f1c546725064e28ddab1ffdbae0d1a1258fd62a50eb556c10d10995415", - "e3d635de1f1880673b69bf73ca6a45caffa5c7fdc23d589d5e40f76b86bdcd33", - "e34d80da723a7115a7a7586b52dc8b5cfda05c581509eee0c1a0296df9a340cb", - "7127ca85ce6447928e195e901d36f1e1f1e8205a686e567c2d1b187431f989df" - ], - "path_edge_types": [ - "instantiates", - "writes_attr", - "reads_attr" - ], - "path_length": 5, - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_runtime.py", - "content": "def test_trace_service_writes_contexts_and_messages() -> None:\n from app_runtime.tracing.service import TraceService\n\n transport = RecordingTransport()\n manager = TraceService(transport=transport)\n\n with manager.open_context(alias=\"worker\", kind=\"worker\", attrs={\"routine\": \"incoming\"}):\n manager.step(\"parse\")\n manager.info(\"started\", status=\"ok\", attrs={\"attempt\": 1})\n\n assert len(transport.contexts) == 1\n assert len(transport.messages) == 1\n assert transport.contexts[0].alias == \"worker\"\n assert transport.messages[0].step == \"parse\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_runtime.py:test_trace_service_writes_contexts_and_messages", - "span_start": 246, - "span_end": 259, - "lexical_rank": 6, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 9, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_runtime", - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_runtime.py", - "content": "def test_trace_service_supports_debug_warning_and_error_levels() -> None:\n from app_runtime.tracing.service import TraceService\n\n transport = RecordingTransport()\n manager = TraceService(transport=transport)\n\n with manager.open_context(alias=\"worker\", kind=\"worker\", attrs={\"routine\": \"incoming\"}):\n manager.step(\"validate\")\n manager.debug(\"validation details\", attrs={\"rule\": \"basic\"})\n manager.warning(\"validation warning\", status=\"degraded\", attrs={\"attempt\": 1})\n manager.error(\"integration failed\", status=\"failed\", attrs={\"integration\": \"crm\"})\n manager.exception(\"caught exception\", attrs={\"exception_type\": \"RuntimeError\"})\n\n levels = [message.level for message in transport.messages]\n assert levels == [\"DEBUG\", \"WARNING\", \"ERROR\", \"ERROR\"]", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_runtime.py:test_trace_service_supports_debug_warning_and_error_levels", - "span_start": 262, - "span_end": 276, - "lexical_rank": 6, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 10, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_runtime", - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_runtime.py", - "content": "def test_trace_service_allows_messages_without_status() -> None:\n from app_runtime.tracing.service import TraceService\n\n transport = RecordingTransport()\n manager = TraceService(transport=transport)\n\n with manager.open_context(alias=\"worker\", kind=\"worker\"):\n manager.step(\"optional-status\")\n manager.debug(\"debug without status\")\n manager.info(\"info without status\")\n manager.warning(\"warning without status\")\n manager.error(\"error without status\")\n\n assert [message.status for message in transport.messages] == [\"\", \"\", \"\", \"\"]\n assert all(message.trace_id == transport.contexts[0].trace_id for message in transport.messages)", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_runtime.py:test_trace_service_allows_messages_without_status", - "span_start": 279, - "span_end": 293, - "lexical_rank": 6, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 11, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_runtime", - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "class ScenarioWorker(Worker):\n def __init__(self, name: str, routine: object, *, interval: float = 0.05) -> None:\n self._name = name\n self._routine = routine\n self._interval = interval\n self._thread: Thread | None = None\n self._stop_requested = Event()\n self._in_flight = 0\n self._runs = 0\n self._lock = Lock()\n\n @property\n def name(self) -> str:\n return self._name\n\n @property\n def critical(self) -> bool:\n return True\n\n def start(self) -> None:\n if self._thread is not None and self._thread.is_alive():\n return\n self._stop_requested.clear()\n self._thread = Thread(target=self._loop, name=f\"{self._name}-thread\", daemon=True)\n self._thread.start()\n\n def stop(self, force: bool = False) -> None:\n self._stop_requested.set()\n\n def health(self) -> WorkerHealth:\n return WorkerHealth(name=self.name, status=\"ok\", critical=True, meta={\"runs\": self._runs})\n\n def status(self) -> WorkerStatus:\n thread_alive = self._thread is not None and self._thread.is_alive()\n with self._lock:\n in_flight = self._in_flight\n runs = self._runs\n if not thread_alive:\n state = \"stopped\"\n elif self._stop_requested.is_set():\n state = \"stopping\"\n elif in_flight > 0:\n state = \"busy\"\n else:\n state = \"idle\"\n return WorkerStatus(name=self.name, state=state, in_flight=in_flight, meta={\"runs\": runs})\n\n def _loop(self) -> None:\n while not self._stop_requested.is_set():\n with self._lock:\n self._in_flight += 1\n try:\n self._routine.run()\n with self._lock:\n self._runs += 1\n finally:\n with self._lock:\n self._in_flight -= 1\n if self._stop_requested.is_set():\n return\n sleep(self._interval)", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:ScenarioWorker", - "span_start": 50, - "span_end": 110, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 2, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "class IntervalRoutine:\n calls: list[float] = field(default_factory=list)\n _lock: Lock = field(default_factory=Lock)\n\n def run(self) -> None:\n with self._lock:\n self.calls.append(monotonic())\n\n def wait_runs(self, count: int, timeout: float) -> bool:\n deadline = monotonic() + timeout\n while monotonic() < deadline:\n with self._lock:\n if len(self.calls) >= count:\n return True\n sleep(0.01)\n return False\n\n def deltas(self) -> list[float]:\n with self._lock:\n return [self.calls[index + 1] - self.calls[index] for index in range(len(self.calls) - 1)]", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:IntervalRoutine", - "span_start": 18, - "span_end": 37, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "class BlockingRoutine:\n def __init__(self, started: Event, release: Event) -> None:\n self._started = started\n self._release = release\n\n def run(self) -> None:\n self._started.set()\n self._release.wait(timeout=5.0)", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:BlockingRoutine", - "span_start": 40, - "span_end": 47, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 1, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "def test_worker_wakes_up_with_configured_interval() -> None:\n interval = 0.15\n routine = IntervalRoutine()\n worker = ScenarioWorker(\"interval-worker\", routine, interval=interval)\n runtime = RuntimeManager()\n runtime.register_module(WorkerModule(worker))\n\n runtime.start()\n try:\n assert routine.wait_runs(count=3, timeout=2.0) is True\n finally:\n runtime.stop()\n\n deltas = routine.deltas()\n assert len(deltas) >= 2\n assert all(delta >= interval * 0.7 for delta in deltas[:2])", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:test_worker_wakes_up_with_configured_interval", - "span_start": 163, - "span_end": 178, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 7, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "def _http_call_json(\n base_url: str,\n path: str,\n *,\n method: str = \"GET\",\n headers: dict[str, str] | None = None,\n) -> tuple[int, dict[str, object]]:\n request = Request(f\"{base_url}{path}\", method=method, headers=headers or {})\n try:\n with urlopen(request, timeout=15.0) as response:\n status = response.status\n body = response.read()\n except HTTPError as error:\n status = error.code\n body = error.read()\n payload = json.loads(body.decode(\"utf-8\"))\n return status, payload", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:_http_call_json", - "span_start": 125, - "span_end": 141, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 4, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "def _build_runtime(worker: Worker, *, control_timeout: int = 1) -> tuple[RuntimeManager, str]:\n runtime = RuntimeManager()\n channel = HttpControlChannel(host=\"127.0.0.1\", port=0, timeout=control_timeout)\n runtime.control_plane.register_channel(channel)\n runtime.register_module(WorkerModule(worker))\n runtime.start()\n return runtime, f\"http://127.0.0.1:{channel.port}\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:_build_runtime", - "span_start": 154, - "span_end": 160, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 6, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "class WorkerModule(ApplicationModule):\n def __init__(self, worker: Worker) -> None:\n self._worker = worker\n\n @property\n def name(self) -> str:\n return \"business-tests\"\n\n def register(self, registry: ModuleRegistry) -> None:\n registry.add_worker(self._worker)", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:WorkerModule", - "span_start": 113, - "span_end": 122, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 3, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ] - }, - "diagnostics": { - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C0_SOURCE_CHUNKS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C0_SOURCE_CHUNKS": 10 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [], - "include_globs": [ - "src", - "tests" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests" - ] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src", - "tests" - ], - "include_globs": [ - "src", - "tests" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests" - ] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src", - "tests" - ], - "include_globs": [ - "src", - "tests" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests" - ] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "TraceService", - "path_scope": [], - "include_globs": [ - "src/**", - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "Где тесты для TraceService? test_trace_service TestTraceService TraceService", - "path_scope": [], - "include_globs": [ - "src/**", - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "top_k": 6, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Где тесты для TraceService? test_trace_service TestTraceService TraceService", - "path_scope": [], - "include_globs": [ - "src/**", - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "top_k": 10, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [], - "normalized_include_globs": [ - "src", - "tests" - ], - "normalized_exclude_globs": [], - "normalized_prefer_globs": [ - "tests" - ], - "filter_stage": "post_rank", - "candidates_before_filter": 0, - "candidates_after_filter": 0 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src", - "tests" - ], - "normalized_include_globs": [ - "src", - "tests" - ], - "normalized_exclude_globs": [], - "normalized_prefer_globs": [ - "tests" - ], - "filter_stage": "post_rank", - "candidates_before_filter": 6, - "candidates_after_filter": 6 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src", - "tests" - ], - "normalized_include_globs": [ - "src", - "tests" - ], - "normalized_exclude_globs": [], - "normalized_prefer_globs": [ - "tests" - ], - "filter_stage": "post_rank", - "candidates_before_filter": 10, - "candidates_after_filter": 10 - } - ], - "fallback": { - "used": true, - "reason": "scope_relaxed_no_hits" - }, - "symbol_resolution": { - "status": "not_found", - "resolved_symbol": null, - "alternatives": [ - "TraceService" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "miss", - "hit_count": 0, - "fail_reason": "scope_relaxed_no_hits" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 6, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 10, - "fail_reason": null - } - ] - }, - "constraint_violations": [ - { - "type": "LAYER_MISSING", - "severity": "warn", - "details": { - "layer": "C1_SYMBOL_CATALOG", - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ] - }, - "suggested_fix": "Increase top_k for this layer or relax constraints for retrieval." - } - ], - "timings_ms": { - "symbol_resolution": 0, - "retrieval_total": 128, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 63, - "C2_DEPENDENCY_GRAPH": 49, - "C0_SOURCE_CHUNKS": 14 - }, - "merge_rank": 0 - } - } - }, - { - "step": "llm_answer", - "input": { - "query": "Где тесты для TraceService?", - "rag_count": 16 - }, - "output": { - "llm_answer": "Прямых тестов конкретно для `TraceService` в указанном контексте нет. Связь с сущностью не подтверждается именами функций, модулями или явными вызовами `TraceService`.\n\nОднако имеются косвенные тесты, которые косвенно затрагивают поведение `TraceService`, взаимодействуя через посредника (`RecordingTransport`), например:\n\n- tests/test_runtime.py: \n - Проверка записи контекстов и сообщений (метод `write_context`) при создании трассировочного сервиса.\n \nЭти тесты косвенно подтверждают корректность работы методов, связанных с `TraceService`. Тем не менее, напрямую тесты `TraceService` отсутствуют." - }, - "diagnostics": { - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 1021, - "evidence_rows": 16, - "evidence_chars": 7847 - }, - "evidence_summary": [ - { - "layer": "C2_DEPENDENCY_GRAPH", - "count": 6, - "unique_paths": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 10, - "unique_paths": 2 - } - ], - "prompt_template_id": "intent_code_qa_find_tests_ru_v4", - "system_prompt_version": "v1" - }, - "timings_ms": { - "prompt_build": 0, - "llm_call": 1118 - } - } - } - ] - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_143636/full_chain_plba_code_subintents_v2_plba-v2-find-tests-trace-service.md b/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_143636/full_chain_plba_code_subintents_v2_plba-v2-find-tests-trace-service.md deleted file mode 100644 index 402aabc..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_143636/full_chain_plba_code_subintents_v2_plba-v2-find-tests-trace-service.md +++ /dev/null @@ -1,32 +0,0 @@ -# plba-v2-find-tests-trace-service - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_subintents_v2.yaml -- runner: runtime -- mode: full_chain -- passed: True - -## Query -Где тесты для TraceService? - -## Actual -{ - "intent": "CODE_QA", - "sub_intent": "FIND_TESTS", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 16, - "llm_answer": "Прямых тестов конкретно для `TraceService` в указанном контексте нет. Связь с сущностью не подтверждается именами функций, модулями или явными вызовами `TraceService`.\n\nОднако имеются косвенные тесты, которые косвенно затрагивают поведение `TraceService`, взаимодействуя через посредника (`RecordingTransport`), например:\n\n- tests/test_runtime.py: \n - Проверка записи контекстов и сообщений (метод `write_context`) при создании трассировочного сервиса.\n \nЭти тесты косвенно подтверждают корректность работы методов, связанных с `TraceService`. Тем не менее, напрямую тесты `TraceService` отсутствуют.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "TraceService" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ] -} - -## Mismatches -- none \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_143636/full_chain_plba_code_subintents_v2_plba-v2-find-tests-workflow-runtime-factory-negative.json b/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_143636/full_chain_plba_code_subintents_v2_plba-v2-find-tests-workflow-runtime-factory-negative.json deleted file mode 100644 index b60280c..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_143636/full_chain_plba_code_subintents_v2_plba-v2-find-tests-workflow-runtime-factory-negative.json +++ /dev/null @@ -1,2047 +0,0 @@ -{ - "case_id": "plba-v2-find-tests-workflow-runtime-factory-negative", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_subintents_v2.yaml", - "runner": "runtime", - "mode": "full_chain", - "actual": { - "intent": "CODE_QA", - "sub_intent": "FIND_TESTS", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 16, - "llm_answer": "Прямых тестов конкретно для `WorkflowRuntimeFactory` в предоставленном контексте не обнаружено.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "WorkflowRuntimeFactory" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ] - }, - "passed": true, - "mismatches": [], - "details": { - "case_id": "plba-v2-find-tests-workflow-runtime-factory-negative", - "text": "Где тесты для WorkflowRuntimeFactory?", - "mode": "full_chain", - "run_started_at": "2026-03-12T14:36:36", - "rag_session_id": "7d11da21-faa0-4cea-aede-aeabe069164c", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Где тесты для WorkflowRuntimeFactory?", - "symbol_resolution": { - "status": "not_found", - "resolved_symbol": null, - "alternatives": [ - "WorkflowRuntimeFactory" - ], - "confidence": 0.0 - }, - "rag_count": 16, - "rag_rows": [ - { - "path": "tests/test_business_control_actions.py", - "content": "test_actions_stop_busy_worker_before_timeout\n -> BlockingRoutine\n -> BlockingRoutine.__init__\n -> BlockingRoutine._release\n -> BlockingRoutine.run", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_actions_stop_busy_worker_before_timeout:dataflow_slice", - "span_start": 43, - "span_end": 212, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 5, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "8bd726155ba387d3579763ee84dfd2f9a90bc917da88f3b2e89416ab5c1254d6", - "edge_type": "dataflow_slice", - "src_symbol_id": "a0bb116ca9d909c93a285667ae033fbd1859b2dad7cf34fcb44816393ef6909c", - "src_qname": "test_actions_stop_busy_worker_before_timeout", - "dst_symbol_id": "d9841bdbb69706c988ae7ae6adf89928dc4fae45943f74064f5382177034ba04", - "dst_ref": "BlockingRoutine.run", - "resolution": "resolved", - "slice_id": "8bd726155ba387d3579763ee84dfd2f9a90bc917da88f3b2e89416ab5c1254d6", - "root_symbol_id": "a0bb116ca9d909c93a285667ae033fbd1859b2dad7cf34fcb44816393ef6909c", - "path_symbols": [ - "test_actions_stop_busy_worker_before_timeout", - "BlockingRoutine", - "BlockingRoutine.__init__", - "BlockingRoutine._release", - "BlockingRoutine.run" - ], - "path_symbol_ids": [ - "a0bb116ca9d909c93a285667ae033fbd1859b2dad7cf34fcb44816393ef6909c", - "a3349c5bc65e4003a4bbd6a8dbb7a54c337e12d1aed930caa701b12e520f1e67", - "486deeed3043c6db985aef258e96ddc67aa53608e67a83962fbd2471f649ddf1", - "d9841bdbb69706c988ae7ae6adf89928dc4fae45943f74064f5382177034ba04" - ], - "path_edge_types": [ - "instantiates", - "writes_attr", - "reads_attr" - ], - "path_length": 5, - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "test_worker_wakes_up_with_configured_interval\n -> ScenarioWorker\n -> ScenarioWorker.__init__\n -> ScenarioWorker._name\n -> ScenarioWorker.name", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_worker_wakes_up_with_configured_interval:dataflow_slice", - "span_start": 52, - "span_end": 166, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 5, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "2fd137f5852febe907f44d3b3e4ea430f89ccfe962ae1442a16ab9df64c8f76c", - "edge_type": "dataflow_slice", - "src_symbol_id": "65f877f78191d65e6a752e41cedc70ebc784c266804a55c1c56440336e1f0d6e", - "src_qname": "test_worker_wakes_up_with_configured_interval", - "dst_symbol_id": "da022da2c49fd9cfd09d6e6da6bbd59aaa7d28efd669ce8444e88d327ddec2fc", - "dst_ref": "ScenarioWorker.name", - "resolution": "resolved", - "slice_id": "2fd137f5852febe907f44d3b3e4ea430f89ccfe962ae1442a16ab9df64c8f76c", - "root_symbol_id": "65f877f78191d65e6a752e41cedc70ebc784c266804a55c1c56440336e1f0d6e", - "path_symbols": [ - "test_worker_wakes_up_with_configured_interval", - "ScenarioWorker", - "ScenarioWorker.__init__", - "ScenarioWorker._name", - "ScenarioWorker.name" - ], - "path_symbol_ids": [ - "65f877f78191d65e6a752e41cedc70ebc784c266804a55c1c56440336e1f0d6e", - "9a1d08a7eb1831c9f2e0db361b5207f036e477c160773ae08c0b287239785c52", - "9c20be046ba06644d1432e0f20eb223663d2b116ee7d91fdc62bc68323f2e593", - "da022da2c49fd9cfd09d6e6da6bbd59aaa7d28efd669ce8444e88d327ddec2fc" - ], - "path_edge_types": [ - "instantiates", - "writes_attr", - "reads_attr" - ], - "path_length": 5, - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "test_actions_stop_busy_worker_before_timeout\n -> BlockingRoutine\n -> BlockingRoutine.__init__\n -> BlockingRoutine._started\n -> BlockingRoutine.run", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_actions_stop_busy_worker_before_timeout:dataflow_slice", - "span_start": 42, - "span_end": 212, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 5, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "f9bcce108870e49afa8b32d4625115a10707a3b0e7473179e958e5752bf258b4", - "edge_type": "dataflow_slice", - "src_symbol_id": "a0bb116ca9d909c93a285667ae033fbd1859b2dad7cf34fcb44816393ef6909c", - "src_qname": "test_actions_stop_busy_worker_before_timeout", - "dst_symbol_id": "d9841bdbb69706c988ae7ae6adf89928dc4fae45943f74064f5382177034ba04", - "dst_ref": "BlockingRoutine.run", - "resolution": "resolved", - "slice_id": "f9bcce108870e49afa8b32d4625115a10707a3b0e7473179e958e5752bf258b4", - "root_symbol_id": "a0bb116ca9d909c93a285667ae033fbd1859b2dad7cf34fcb44816393ef6909c", - "path_symbols": [ - "test_actions_stop_busy_worker_before_timeout", - "BlockingRoutine", - "BlockingRoutine.__init__", - "BlockingRoutine._started", - "BlockingRoutine.run" - ], - "path_symbol_ids": [ - "a0bb116ca9d909c93a285667ae033fbd1859b2dad7cf34fcb44816393ef6909c", - "a3349c5bc65e4003a4bbd6a8dbb7a54c337e12d1aed930caa701b12e520f1e67", - "486deeed3043c6db985aef258e96ddc67aa53608e67a83962fbd2471f649ddf1", - "d9841bdbb69706c988ae7ae6adf89928dc4fae45943f74064f5382177034ba04" - ], - "path_edge_types": [ - "instantiates", - "writes_attr", - "reads_attr" - ], - "path_length": 5, - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "test_actions_stop_busy_worker_after_timeout\n -> BlockingRoutine\n -> BlockingRoutine.__init__\n -> BlockingRoutine._started\n -> BlockingRoutine.run", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_actions_stop_busy_worker_after_timeout:dataflow_slice", - "span_start": 42, - "span_end": 238, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 5, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "8e7db3d2a9226f1c1d9942ac6373cfcafa0d2276758ddb8a3d3c455a3d58024d", - "edge_type": "dataflow_slice", - "src_symbol_id": "66392d3222421d9ba16eda3554940b16e7d5a6f33aa08c5738d35af2e32f1e4a", - "src_qname": "test_actions_stop_busy_worker_after_timeout", - "dst_symbol_id": "d9841bdbb69706c988ae7ae6adf89928dc4fae45943f74064f5382177034ba04", - "dst_ref": "BlockingRoutine.run", - "resolution": "resolved", - "slice_id": "8e7db3d2a9226f1c1d9942ac6373cfcafa0d2276758ddb8a3d3c455a3d58024d", - "root_symbol_id": "66392d3222421d9ba16eda3554940b16e7d5a6f33aa08c5738d35af2e32f1e4a", - "path_symbols": [ - "test_actions_stop_busy_worker_after_timeout", - "BlockingRoutine", - "BlockingRoutine.__init__", - "BlockingRoutine._started", - "BlockingRoutine.run" - ], - "path_symbol_ids": [ - "66392d3222421d9ba16eda3554940b16e7d5a6f33aa08c5738d35af2e32f1e4a", - "a3349c5bc65e4003a4bbd6a8dbb7a54c337e12d1aed930caa701b12e520f1e67", - "486deeed3043c6db985aef258e96ddc67aa53608e67a83962fbd2471f649ddf1", - "d9841bdbb69706c988ae7ae6adf89928dc4fae45943f74064f5382177034ba04" - ], - "path_edge_types": [ - "instantiates", - "writes_attr", - "reads_attr" - ], - "path_length": 5, - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "test_actions_stop_busy_worker_after_timeout\n -> BlockingRoutine\n -> BlockingRoutine.__init__\n -> BlockingRoutine._release\n -> BlockingRoutine.run", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_actions_stop_busy_worker_after_timeout:dataflow_slice", - "span_start": 43, - "span_end": 238, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 5, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "b59da9da82f9dfc8a9b695a08213786385da1ae9e17561ec3a0450a574a8cb39", - "edge_type": "dataflow_slice", - "src_symbol_id": "66392d3222421d9ba16eda3554940b16e7d5a6f33aa08c5738d35af2e32f1e4a", - "src_qname": "test_actions_stop_busy_worker_after_timeout", - "dst_symbol_id": "d9841bdbb69706c988ae7ae6adf89928dc4fae45943f74064f5382177034ba04", - "dst_ref": "BlockingRoutine.run", - "resolution": "resolved", - "slice_id": "b59da9da82f9dfc8a9b695a08213786385da1ae9e17561ec3a0450a574a8cb39", - "root_symbol_id": "66392d3222421d9ba16eda3554940b16e7d5a6f33aa08c5738d35af2e32f1e4a", - "path_symbols": [ - "test_actions_stop_busy_worker_after_timeout", - "BlockingRoutine", - "BlockingRoutine.__init__", - "BlockingRoutine._release", - "BlockingRoutine.run" - ], - "path_symbol_ids": [ - "66392d3222421d9ba16eda3554940b16e7d5a6f33aa08c5738d35af2e32f1e4a", - "a3349c5bc65e4003a4bbd6a8dbb7a54c337e12d1aed930caa701b12e520f1e67", - "486deeed3043c6db985aef258e96ddc67aa53608e67a83962fbd2471f649ddf1", - "d9841bdbb69706c988ae7ae6adf89928dc4fae45943f74064f5382177034ba04" - ], - "path_edge_types": [ - "instantiates", - "writes_attr", - "reads_attr" - ], - "path_length": 5, - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "test_actions_start_stop_and_health_when_worker_is_idle\n -> ScenarioWorker\n -> ScenarioWorker.__init__\n -> ScenarioWorker._name\n -> ScenarioWorker.name", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_actions_start_stop_and_health_when_worker_is_idle:dataflow_slice", - "span_start": 52, - "span_end": 182, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 5, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "8fb3c9e775ad1cfa91eebb8b8cef367dc53c923584236122235446e0579b468e", - "edge_type": "dataflow_slice", - "src_symbol_id": "09a78d8eb31c2da14fee58da53b5da7a5065a4c23b6300748a6d44517a5284b8", - "src_qname": "test_actions_start_stop_and_health_when_worker_is_idle", - "dst_symbol_id": "da022da2c49fd9cfd09d6e6da6bbd59aaa7d28efd669ce8444e88d327ddec2fc", - "dst_ref": "ScenarioWorker.name", - "resolution": "resolved", - "slice_id": "8fb3c9e775ad1cfa91eebb8b8cef367dc53c923584236122235446e0579b468e", - "root_symbol_id": "09a78d8eb31c2da14fee58da53b5da7a5065a4c23b6300748a6d44517a5284b8", - "path_symbols": [ - "test_actions_start_stop_and_health_when_worker_is_idle", - "ScenarioWorker", - "ScenarioWorker.__init__", - "ScenarioWorker._name", - "ScenarioWorker.name" - ], - "path_symbol_ids": [ - "09a78d8eb31c2da14fee58da53b5da7a5065a4c23b6300748a6d44517a5284b8", - "9a1d08a7eb1831c9f2e0db361b5207f036e477c160773ae08c0b287239785c52", - "9c20be046ba06644d1432e0f20eb223663d2b116ee7d91fdc62bc68323f2e593", - "da022da2c49fd9cfd09d6e6da6bbd59aaa7d28efd669ce8444e88d327ddec2fc" - ], - "path_edge_types": [ - "instantiates", - "writes_attr", - "reads_attr" - ], - "path_length": 5, - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "def test_actions_start_stop_and_health_when_worker_is_idle() -> None:\n runtime, base_url = _build_runtime(ScenarioWorker(\"idle-worker\", IntervalRoutine(), interval=0.2))\n try:\n stop_status, stop_payload = _http_call_json(base_url, \"/actions/stop\", method=\"POST\")\n assert stop_status == 200\n assert isinstance(stop_payload.get(\"detail\"), dict)\n assert stop_payload[\"detail\"][\"timed_out\"] is False\n assert stop_payload[\"detail\"][\"state\"] == \"stopped\"\n\n health_stopped_status, health_stopped_payload = _http_call_json(base_url, \"/health\")\n assert health_stopped_status == 503\n assert health_stopped_payload[\"state\"] == \"stopped\"\n assert health_stopped_payload[\"status\"] == \"unhealthy\"\n\n start_status, start_payload = _http_call_json(base_url, \"/actions/start\", method=\"POST\")\n assert start_status == 200\n assert isinstance(start_payload.get(\"detail\"), dict)\n assert start_payload[\"detail\"][\"timed_out\"] is False\n assert start_payload[\"detail\"][\"state\"] in {\"idle\", \"busy\"}\n\n health_started_status, health_started_payload = _http_call_json(base_url, \"/health\")\n assert health_started_status == 200\n assert health_started_payload[\"status\"] == \"ok\"\n assert health_started_payload[\"state\"] in {\"idle\", \"busy\"}\n finally:\n runtime.stop()", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:test_actions_start_stop_and_health_when_worker_is_idle", - "span_start": 181, - "span_end": 206, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 8, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "def _poll_until_stopped(base_url: str, timeout: float = 2.0) -> bool:\n deadline = monotonic() + timeout\n while monotonic() < deadline:\n _, payload = _http_call_json(base_url, \"/actions/status\")\n if payload.get(\"detail\") == \"stopped\":\n return True\n sleep(0.05)\n return False", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:_poll_until_stopped", - "span_start": 144, - "span_end": 151, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 5, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "def test_worker_wakes_up_with_configured_interval() -> None:\n interval = 0.15\n routine = IntervalRoutine()\n worker = ScenarioWorker(\"interval-worker\", routine, interval=interval)\n runtime = RuntimeManager()\n runtime.register_module(WorkerModule(worker))\n\n runtime.start()\n try:\n assert routine.wait_runs(count=3, timeout=2.0) is True\n finally:\n runtime.stop()\n\n deltas = routine.deltas()\n assert len(deltas) >= 2\n assert all(delta >= interval * 0.7 for delta in deltas[:2])", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:test_worker_wakes_up_with_configured_interval", - "span_start": 163, - "span_end": 178, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 7, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "class BlockingRoutine:\n def __init__(self, started: Event, release: Event) -> None:\n self._started = started\n self._release = release\n\n def run(self) -> None:\n self._started.set()\n self._release.wait(timeout=5.0)", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:BlockingRoutine", - "span_start": 40, - "span_end": 47, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 1, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "class WorkerModule(ApplicationModule):\n def __init__(self, worker: Worker) -> None:\n self._worker = worker\n\n @property\n def name(self) -> str:\n return \"business-tests\"\n\n def register(self, registry: ModuleRegistry) -> None:\n registry.add_worker(self._worker)", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:WorkerModule", - "span_start": 113, - "span_end": 122, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 3, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "def _http_call_json(\n base_url: str,\n path: str,\n *,\n method: str = \"GET\",\n headers: dict[str, str] | None = None,\n) -> tuple[int, dict[str, object]]:\n request = Request(f\"{base_url}{path}\", method=method, headers=headers or {})\n try:\n with urlopen(request, timeout=15.0) as response:\n status = response.status\n body = response.read()\n except HTTPError as error:\n status = error.code\n body = error.read()\n payload = json.loads(body.decode(\"utf-8\"))\n return status, payload", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:_http_call_json", - "span_start": 125, - "span_end": 141, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 4, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "def _build_runtime(worker: Worker, *, control_timeout: int = 1) -> tuple[RuntimeManager, str]:\n runtime = RuntimeManager()\n channel = HttpControlChannel(host=\"127.0.0.1\", port=0, timeout=control_timeout)\n runtime.control_plane.register_channel(channel)\n runtime.register_module(WorkerModule(worker))\n runtime.start()\n return runtime, f\"http://127.0.0.1:{channel.port}\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:_build_runtime", - "span_start": 154, - "span_end": 160, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 6, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "class ScenarioWorker(Worker):\n def __init__(self, name: str, routine: object, *, interval: float = 0.05) -> None:\n self._name = name\n self._routine = routine\n self._interval = interval\n self._thread: Thread | None = None\n self._stop_requested = Event()\n self._in_flight = 0\n self._runs = 0\n self._lock = Lock()\n\n @property\n def name(self) -> str:\n return self._name\n\n @property\n def critical(self) -> bool:\n return True\n\n def start(self) -> None:\n if self._thread is not None and self._thread.is_alive():\n return\n self._stop_requested.clear()\n self._thread = Thread(target=self._loop, name=f\"{self._name}-thread\", daemon=True)\n self._thread.start()\n\n def stop(self, force: bool = False) -> None:\n self._stop_requested.set()\n\n def health(self) -> WorkerHealth:\n return WorkerHealth(name=self.name, status=\"ok\", critical=True, meta={\"runs\": self._runs})\n\n def status(self) -> WorkerStatus:\n thread_alive = self._thread is not None and self._thread.is_alive()\n with self._lock:\n in_flight = self._in_flight\n runs = self._runs\n if not thread_alive:\n state = \"stopped\"\n elif self._stop_requested.is_set():\n state = \"stopping\"\n elif in_flight > 0:\n state = \"busy\"\n else:\n state = \"idle\"\n return WorkerStatus(name=self.name, state=state, in_flight=in_flight, meta={\"runs\": runs})\n\n def _loop(self) -> None:\n while not self._stop_requested.is_set():\n with self._lock:\n self._in_flight += 1\n try:\n self._routine.run()\n with self._lock:\n self._runs += 1\n finally:\n with self._lock:\n self._in_flight -= 1\n if self._stop_requested.is_set():\n return\n sleep(self._interval)", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:ScenarioWorker", - "span_start": 50, - "span_end": 110, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 2, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "class IntervalRoutine:\n calls: list[float] = field(default_factory=list)\n _lock: Lock = field(default_factory=Lock)\n\n def run(self) -> None:\n with self._lock:\n self.calls.append(monotonic())\n\n def wait_runs(self, count: int, timeout: float) -> bool:\n deadline = monotonic() + timeout\n while monotonic() < deadline:\n with self._lock:\n if len(self.calls) >= count:\n return True\n sleep(0.01)\n return False\n\n def deltas(self) -> list[float]:\n with self._lock:\n return [self.calls[index + 1] - self.calls[index] for index in range(len(self.calls) - 1)]", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:IntervalRoutine", - "span_start": 18, - "span_end": 37, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "def test_actions_stop_busy_worker_before_timeout() -> None:\n started = Event()\n release = Event()\n runtime, base_url = _build_runtime(ScenarioWorker(\"busy-worker\", BlockingRoutine(started, release)))\n assert started.wait(timeout=1.0) is True\n\n def release_later() -> None:\n sleep(0.2)\n release.set()\n\n Thread(target=release_later, daemon=True).start()\n try:\n status, payload = _http_call_json(base_url, \"/actions/stop\", method=\"POST\")\n assert status == 200\n assert isinstance(payload.get(\"detail\"), dict)\n assert payload[\"detail\"][\"timed_out\"] is False\n assert payload[\"detail\"][\"state\"] == \"stopped\"\n\n health_status, health_payload = _http_call_json(base_url, \"/health\")\n assert health_status == 503\n assert health_payload[\"status\"] == \"unhealthy\"\n assert health_payload[\"state\"] == \"stopped\"\n finally:\n runtime.stop()", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:test_actions_stop_busy_worker_before_timeout", - "span_start": 209, - "span_end": 232, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 9, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "llm_answer": "Прямых тестов конкретно для `WorkflowRuntimeFactory` в предоставленном контексте не обнаружено.", - "summary": { - "router": { - "intent": "CODE_QA", - "sub_intent": "FIND_TESTS", - "confidence": null - }, - "retrieval": { - "profile": "code", - "layers_hit": [ - "C0_SOURCE_CHUNKS", - "C2_DEPENDENCY_GRAPH" - ], - "evidence_sufficient": true - }, - "llm": { - "answer_status": "answered", - "groundedness": "grounded" - } - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "FIND_TESTS", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "WorkflowRuntimeFactory" - ], - "keyword_hints": [ - "WorkflowRuntimeFactory" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**", - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "test_file_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "test_symbol_patterns": [ - "test_workflow_runtime_factory", - "TestWorkflowRuntimeFactory", - "WorkflowRuntimeFactory" - ], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C0_SOURCE_CHUNKS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C0_SOURCE_CHUNKS": 10 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [], - "include_globs": [ - "src", - "tests" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests" - ] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src", - "tests" - ], - "include_globs": [ - "src", - "tests" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests" - ] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src", - "tests" - ], - "include_globs": [ - "src", - "tests" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests" - ] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "WorkflowRuntimeFactory", - "path_scope": [], - "include_globs": [ - "src/**", - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "Где тесты для WorkflowRuntimeFactory? test_workflow_runtime_factory TestWorkflowRuntimeFactory WorkflowRuntimeFactory", - "path_scope": [], - "include_globs": [ - "src/**", - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "top_k": 6, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Где тесты для WorkflowRuntimeFactory? test_workflow_runtime_factory TestWorkflowRuntimeFactory WorkflowRuntimeFactory", - "path_scope": [], - "include_globs": [ - "src/**", - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "top_k": 10, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [], - "normalized_include_globs": [ - "src", - "tests" - ], - "normalized_exclude_globs": [], - "normalized_prefer_globs": [ - "tests" - ], - "filter_stage": "post_rank", - "candidates_before_filter": 0, - "candidates_after_filter": 0 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src", - "tests" - ], - "normalized_include_globs": [ - "src", - "tests" - ], - "normalized_exclude_globs": [], - "normalized_prefer_globs": [ - "tests" - ], - "filter_stage": "post_rank", - "candidates_before_filter": 6, - "candidates_after_filter": 6 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src", - "tests" - ], - "normalized_include_globs": [ - "src", - "tests" - ], - "normalized_exclude_globs": [], - "normalized_prefer_globs": [ - "tests" - ], - "filter_stage": "post_rank", - "candidates_before_filter": 10, - "candidates_after_filter": 10 - } - ], - "fallback": { - "used": true, - "reason": "scope_relaxed_no_hits" - }, - "symbol_resolution": { - "status": "not_found", - "resolved_symbol": null, - "alternatives": [ - "WorkflowRuntimeFactory" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "miss", - "hit_count": 0, - "fail_reason": "scope_relaxed_no_hits" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 6, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 10, - "fail_reason": null - } - ] - }, - "constraint_violations": [ - { - "type": "LAYER_MISSING", - "severity": "warn", - "details": { - "layer": "C1_SYMBOL_CATALOG", - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ] - }, - "suggested_fix": "Increase top_k for this layer or relax constraints for retrieval." - } - ], - "timings_ms": { - "router": 0, - "symbol_resolution": 0, - "retrieval_total": 100, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 44, - "C2_DEPENDENCY_GRAPH": 40, - "C0_SOURCE_CHUNKS": 15 - }, - "merge_rank": 0, - "prompt_build": 0, - "llm_call": 1178 - }, - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 1040, - "evidence_rows": 16, - "evidence_chars": 8149 - }, - "evidence_summary": [ - { - "layer": "C2_DEPENDENCY_GRAPH", - "count": 6, - "unique_paths": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 10, - "unique_paths": 1 - } - ], - "prompt_template_id": "intent_code_qa_find_tests_ru_v4", - "system_prompt_version": "v1" - }, - "router": { - "conversation_mode": "START", - "keyword_hints": [ - "WorkflowRuntimeFactory" - ], - "path_scope": [] - }, - "llm": { - "used_evidence_count": 16, - "missing_evidence_reason": null - } - }, - "run_info": { - "case_id": "plba-v2-find-tests-workflow-runtime-factory-negative", - "mode": "full_chain", - "run_started_at": "2026-03-12T14:36:36", - "rag_session_id": "7d11da21-faa0-4cea-aede-aeabe069164c", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - }, - "input_request": { - "text": "Где тесты для WorkflowRuntimeFactory?", - "normalized_query": "Где тесты для WorkflowRuntimeFactory?" - }, - "steps": [ - { - "step": "intent_router", - "input": { - "query": "Где тесты для WorkflowRuntimeFactory?" - }, - "output": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Где тесты для WorkflowRuntimeFactory?" - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "FIND_TESTS", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "WorkflowRuntimeFactory" - ], - "keyword_hints": [ - "WorkflowRuntimeFactory" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**", - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "test_file_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "test_symbol_patterns": [ - "test_workflow_runtime_factory", - "TestWorkflowRuntimeFactory", - "WorkflowRuntimeFactory" - ], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "timings_ms": { - "router": 0 - } - } - }, - { - "step": "retrieval", - "input": { - "query": "Где тесты для WorkflowRuntimeFactory?" - }, - "output": { - "symbol_resolution": { - "status": "not_found", - "resolved_symbol": null, - "alternatives": [ - "WorkflowRuntimeFactory" - ], - "confidence": 0.0 - }, - "rag_count": 16, - "rag_rows": [ - { - "path": "tests/test_business_control_actions.py", - "content": "test_actions_stop_busy_worker_before_timeout\n -> BlockingRoutine\n -> BlockingRoutine.__init__\n -> BlockingRoutine._release\n -> BlockingRoutine.run", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_actions_stop_busy_worker_before_timeout:dataflow_slice", - "span_start": 43, - "span_end": 212, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 5, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "8bd726155ba387d3579763ee84dfd2f9a90bc917da88f3b2e89416ab5c1254d6", - "edge_type": "dataflow_slice", - "src_symbol_id": "a0bb116ca9d909c93a285667ae033fbd1859b2dad7cf34fcb44816393ef6909c", - "src_qname": "test_actions_stop_busy_worker_before_timeout", - "dst_symbol_id": "d9841bdbb69706c988ae7ae6adf89928dc4fae45943f74064f5382177034ba04", - "dst_ref": "BlockingRoutine.run", - "resolution": "resolved", - "slice_id": "8bd726155ba387d3579763ee84dfd2f9a90bc917da88f3b2e89416ab5c1254d6", - "root_symbol_id": "a0bb116ca9d909c93a285667ae033fbd1859b2dad7cf34fcb44816393ef6909c", - "path_symbols": [ - "test_actions_stop_busy_worker_before_timeout", - "BlockingRoutine", - "BlockingRoutine.__init__", - "BlockingRoutine._release", - "BlockingRoutine.run" - ], - "path_symbol_ids": [ - "a0bb116ca9d909c93a285667ae033fbd1859b2dad7cf34fcb44816393ef6909c", - "a3349c5bc65e4003a4bbd6a8dbb7a54c337e12d1aed930caa701b12e520f1e67", - "486deeed3043c6db985aef258e96ddc67aa53608e67a83962fbd2471f649ddf1", - "d9841bdbb69706c988ae7ae6adf89928dc4fae45943f74064f5382177034ba04" - ], - "path_edge_types": [ - "instantiates", - "writes_attr", - "reads_attr" - ], - "path_length": 5, - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "test_worker_wakes_up_with_configured_interval\n -> ScenarioWorker\n -> ScenarioWorker.__init__\n -> ScenarioWorker._name\n -> ScenarioWorker.name", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_worker_wakes_up_with_configured_interval:dataflow_slice", - "span_start": 52, - "span_end": 166, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 5, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "2fd137f5852febe907f44d3b3e4ea430f89ccfe962ae1442a16ab9df64c8f76c", - "edge_type": "dataflow_slice", - "src_symbol_id": "65f877f78191d65e6a752e41cedc70ebc784c266804a55c1c56440336e1f0d6e", - "src_qname": "test_worker_wakes_up_with_configured_interval", - "dst_symbol_id": "da022da2c49fd9cfd09d6e6da6bbd59aaa7d28efd669ce8444e88d327ddec2fc", - "dst_ref": "ScenarioWorker.name", - "resolution": "resolved", - "slice_id": "2fd137f5852febe907f44d3b3e4ea430f89ccfe962ae1442a16ab9df64c8f76c", - "root_symbol_id": "65f877f78191d65e6a752e41cedc70ebc784c266804a55c1c56440336e1f0d6e", - "path_symbols": [ - "test_worker_wakes_up_with_configured_interval", - "ScenarioWorker", - "ScenarioWorker.__init__", - "ScenarioWorker._name", - "ScenarioWorker.name" - ], - "path_symbol_ids": [ - "65f877f78191d65e6a752e41cedc70ebc784c266804a55c1c56440336e1f0d6e", - "9a1d08a7eb1831c9f2e0db361b5207f036e477c160773ae08c0b287239785c52", - "9c20be046ba06644d1432e0f20eb223663d2b116ee7d91fdc62bc68323f2e593", - "da022da2c49fd9cfd09d6e6da6bbd59aaa7d28efd669ce8444e88d327ddec2fc" - ], - "path_edge_types": [ - "instantiates", - "writes_attr", - "reads_attr" - ], - "path_length": 5, - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "test_actions_stop_busy_worker_before_timeout\n -> BlockingRoutine\n -> BlockingRoutine.__init__\n -> BlockingRoutine._started\n -> BlockingRoutine.run", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_actions_stop_busy_worker_before_timeout:dataflow_slice", - "span_start": 42, - "span_end": 212, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 5, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "f9bcce108870e49afa8b32d4625115a10707a3b0e7473179e958e5752bf258b4", - "edge_type": "dataflow_slice", - "src_symbol_id": "a0bb116ca9d909c93a285667ae033fbd1859b2dad7cf34fcb44816393ef6909c", - "src_qname": "test_actions_stop_busy_worker_before_timeout", - "dst_symbol_id": "d9841bdbb69706c988ae7ae6adf89928dc4fae45943f74064f5382177034ba04", - "dst_ref": "BlockingRoutine.run", - "resolution": "resolved", - "slice_id": "f9bcce108870e49afa8b32d4625115a10707a3b0e7473179e958e5752bf258b4", - "root_symbol_id": "a0bb116ca9d909c93a285667ae033fbd1859b2dad7cf34fcb44816393ef6909c", - "path_symbols": [ - "test_actions_stop_busy_worker_before_timeout", - "BlockingRoutine", - "BlockingRoutine.__init__", - "BlockingRoutine._started", - "BlockingRoutine.run" - ], - "path_symbol_ids": [ - "a0bb116ca9d909c93a285667ae033fbd1859b2dad7cf34fcb44816393ef6909c", - "a3349c5bc65e4003a4bbd6a8dbb7a54c337e12d1aed930caa701b12e520f1e67", - "486deeed3043c6db985aef258e96ddc67aa53608e67a83962fbd2471f649ddf1", - "d9841bdbb69706c988ae7ae6adf89928dc4fae45943f74064f5382177034ba04" - ], - "path_edge_types": [ - "instantiates", - "writes_attr", - "reads_attr" - ], - "path_length": 5, - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "test_actions_stop_busy_worker_after_timeout\n -> BlockingRoutine\n -> BlockingRoutine.__init__\n -> BlockingRoutine._started\n -> BlockingRoutine.run", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_actions_stop_busy_worker_after_timeout:dataflow_slice", - "span_start": 42, - "span_end": 238, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 5, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "8e7db3d2a9226f1c1d9942ac6373cfcafa0d2276758ddb8a3d3c455a3d58024d", - "edge_type": "dataflow_slice", - "src_symbol_id": "66392d3222421d9ba16eda3554940b16e7d5a6f33aa08c5738d35af2e32f1e4a", - "src_qname": "test_actions_stop_busy_worker_after_timeout", - "dst_symbol_id": "d9841bdbb69706c988ae7ae6adf89928dc4fae45943f74064f5382177034ba04", - "dst_ref": "BlockingRoutine.run", - "resolution": "resolved", - "slice_id": "8e7db3d2a9226f1c1d9942ac6373cfcafa0d2276758ddb8a3d3c455a3d58024d", - "root_symbol_id": "66392d3222421d9ba16eda3554940b16e7d5a6f33aa08c5738d35af2e32f1e4a", - "path_symbols": [ - "test_actions_stop_busy_worker_after_timeout", - "BlockingRoutine", - "BlockingRoutine.__init__", - "BlockingRoutine._started", - "BlockingRoutine.run" - ], - "path_symbol_ids": [ - "66392d3222421d9ba16eda3554940b16e7d5a6f33aa08c5738d35af2e32f1e4a", - "a3349c5bc65e4003a4bbd6a8dbb7a54c337e12d1aed930caa701b12e520f1e67", - "486deeed3043c6db985aef258e96ddc67aa53608e67a83962fbd2471f649ddf1", - "d9841bdbb69706c988ae7ae6adf89928dc4fae45943f74064f5382177034ba04" - ], - "path_edge_types": [ - "instantiates", - "writes_attr", - "reads_attr" - ], - "path_length": 5, - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "test_actions_stop_busy_worker_after_timeout\n -> BlockingRoutine\n -> BlockingRoutine.__init__\n -> BlockingRoutine._release\n -> BlockingRoutine.run", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_actions_stop_busy_worker_after_timeout:dataflow_slice", - "span_start": 43, - "span_end": 238, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 5, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "b59da9da82f9dfc8a9b695a08213786385da1ae9e17561ec3a0450a574a8cb39", - "edge_type": "dataflow_slice", - "src_symbol_id": "66392d3222421d9ba16eda3554940b16e7d5a6f33aa08c5738d35af2e32f1e4a", - "src_qname": "test_actions_stop_busy_worker_after_timeout", - "dst_symbol_id": "d9841bdbb69706c988ae7ae6adf89928dc4fae45943f74064f5382177034ba04", - "dst_ref": "BlockingRoutine.run", - "resolution": "resolved", - "slice_id": "b59da9da82f9dfc8a9b695a08213786385da1ae9e17561ec3a0450a574a8cb39", - "root_symbol_id": "66392d3222421d9ba16eda3554940b16e7d5a6f33aa08c5738d35af2e32f1e4a", - "path_symbols": [ - "test_actions_stop_busy_worker_after_timeout", - "BlockingRoutine", - "BlockingRoutine.__init__", - "BlockingRoutine._release", - "BlockingRoutine.run" - ], - "path_symbol_ids": [ - "66392d3222421d9ba16eda3554940b16e7d5a6f33aa08c5738d35af2e32f1e4a", - "a3349c5bc65e4003a4bbd6a8dbb7a54c337e12d1aed930caa701b12e520f1e67", - "486deeed3043c6db985aef258e96ddc67aa53608e67a83962fbd2471f649ddf1", - "d9841bdbb69706c988ae7ae6adf89928dc4fae45943f74064f5382177034ba04" - ], - "path_edge_types": [ - "instantiates", - "writes_attr", - "reads_attr" - ], - "path_length": 5, - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "test_actions_start_stop_and_health_when_worker_is_idle\n -> ScenarioWorker\n -> ScenarioWorker.__init__\n -> ScenarioWorker._name\n -> ScenarioWorker.name", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_actions_start_stop_and_health_when_worker_is_idle:dataflow_slice", - "span_start": 52, - "span_end": 182, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 5, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "8fb3c9e775ad1cfa91eebb8b8cef367dc53c923584236122235446e0579b468e", - "edge_type": "dataflow_slice", - "src_symbol_id": "09a78d8eb31c2da14fee58da53b5da7a5065a4c23b6300748a6d44517a5284b8", - "src_qname": "test_actions_start_stop_and_health_when_worker_is_idle", - "dst_symbol_id": "da022da2c49fd9cfd09d6e6da6bbd59aaa7d28efd669ce8444e88d327ddec2fc", - "dst_ref": "ScenarioWorker.name", - "resolution": "resolved", - "slice_id": "8fb3c9e775ad1cfa91eebb8b8cef367dc53c923584236122235446e0579b468e", - "root_symbol_id": "09a78d8eb31c2da14fee58da53b5da7a5065a4c23b6300748a6d44517a5284b8", - "path_symbols": [ - "test_actions_start_stop_and_health_when_worker_is_idle", - "ScenarioWorker", - "ScenarioWorker.__init__", - "ScenarioWorker._name", - "ScenarioWorker.name" - ], - "path_symbol_ids": [ - "09a78d8eb31c2da14fee58da53b5da7a5065a4c23b6300748a6d44517a5284b8", - "9a1d08a7eb1831c9f2e0db361b5207f036e477c160773ae08c0b287239785c52", - "9c20be046ba06644d1432e0f20eb223663d2b116ee7d91fdc62bc68323f2e593", - "da022da2c49fd9cfd09d6e6da6bbd59aaa7d28efd669ce8444e88d327ddec2fc" - ], - "path_edge_types": [ - "instantiates", - "writes_attr", - "reads_attr" - ], - "path_length": 5, - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "def test_actions_start_stop_and_health_when_worker_is_idle() -> None:\n runtime, base_url = _build_runtime(ScenarioWorker(\"idle-worker\", IntervalRoutine(), interval=0.2))\n try:\n stop_status, stop_payload = _http_call_json(base_url, \"/actions/stop\", method=\"POST\")\n assert stop_status == 200\n assert isinstance(stop_payload.get(\"detail\"), dict)\n assert stop_payload[\"detail\"][\"timed_out\"] is False\n assert stop_payload[\"detail\"][\"state\"] == \"stopped\"\n\n health_stopped_status, health_stopped_payload = _http_call_json(base_url, \"/health\")\n assert health_stopped_status == 503\n assert health_stopped_payload[\"state\"] == \"stopped\"\n assert health_stopped_payload[\"status\"] == \"unhealthy\"\n\n start_status, start_payload = _http_call_json(base_url, \"/actions/start\", method=\"POST\")\n assert start_status == 200\n assert isinstance(start_payload.get(\"detail\"), dict)\n assert start_payload[\"detail\"][\"timed_out\"] is False\n assert start_payload[\"detail\"][\"state\"] in {\"idle\", \"busy\"}\n\n health_started_status, health_started_payload = _http_call_json(base_url, \"/health\")\n assert health_started_status == 200\n assert health_started_payload[\"status\"] == \"ok\"\n assert health_started_payload[\"state\"] in {\"idle\", \"busy\"}\n finally:\n runtime.stop()", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:test_actions_start_stop_and_health_when_worker_is_idle", - "span_start": 181, - "span_end": 206, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 8, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "def _poll_until_stopped(base_url: str, timeout: float = 2.0) -> bool:\n deadline = monotonic() + timeout\n while monotonic() < deadline:\n _, payload = _http_call_json(base_url, \"/actions/status\")\n if payload.get(\"detail\") == \"stopped\":\n return True\n sleep(0.05)\n return False", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:_poll_until_stopped", - "span_start": 144, - "span_end": 151, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 5, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "def test_worker_wakes_up_with_configured_interval() -> None:\n interval = 0.15\n routine = IntervalRoutine()\n worker = ScenarioWorker(\"interval-worker\", routine, interval=interval)\n runtime = RuntimeManager()\n runtime.register_module(WorkerModule(worker))\n\n runtime.start()\n try:\n assert routine.wait_runs(count=3, timeout=2.0) is True\n finally:\n runtime.stop()\n\n deltas = routine.deltas()\n assert len(deltas) >= 2\n assert all(delta >= interval * 0.7 for delta in deltas[:2])", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:test_worker_wakes_up_with_configured_interval", - "span_start": 163, - "span_end": 178, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 7, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "class BlockingRoutine:\n def __init__(self, started: Event, release: Event) -> None:\n self._started = started\n self._release = release\n\n def run(self) -> None:\n self._started.set()\n self._release.wait(timeout=5.0)", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:BlockingRoutine", - "span_start": 40, - "span_end": 47, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 1, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "class WorkerModule(ApplicationModule):\n def __init__(self, worker: Worker) -> None:\n self._worker = worker\n\n @property\n def name(self) -> str:\n return \"business-tests\"\n\n def register(self, registry: ModuleRegistry) -> None:\n registry.add_worker(self._worker)", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:WorkerModule", - "span_start": 113, - "span_end": 122, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 3, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "def _http_call_json(\n base_url: str,\n path: str,\n *,\n method: str = \"GET\",\n headers: dict[str, str] | None = None,\n) -> tuple[int, dict[str, object]]:\n request = Request(f\"{base_url}{path}\", method=method, headers=headers or {})\n try:\n with urlopen(request, timeout=15.0) as response:\n status = response.status\n body = response.read()\n except HTTPError as error:\n status = error.code\n body = error.read()\n payload = json.loads(body.decode(\"utf-8\"))\n return status, payload", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:_http_call_json", - "span_start": 125, - "span_end": 141, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 4, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "def _build_runtime(worker: Worker, *, control_timeout: int = 1) -> tuple[RuntimeManager, str]:\n runtime = RuntimeManager()\n channel = HttpControlChannel(host=\"127.0.0.1\", port=0, timeout=control_timeout)\n runtime.control_plane.register_channel(channel)\n runtime.register_module(WorkerModule(worker))\n runtime.start()\n return runtime, f\"http://127.0.0.1:{channel.port}\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:_build_runtime", - "span_start": 154, - "span_end": 160, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 6, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "class ScenarioWorker(Worker):\n def __init__(self, name: str, routine: object, *, interval: float = 0.05) -> None:\n self._name = name\n self._routine = routine\n self._interval = interval\n self._thread: Thread | None = None\n self._stop_requested = Event()\n self._in_flight = 0\n self._runs = 0\n self._lock = Lock()\n\n @property\n def name(self) -> str:\n return self._name\n\n @property\n def critical(self) -> bool:\n return True\n\n def start(self) -> None:\n if self._thread is not None and self._thread.is_alive():\n return\n self._stop_requested.clear()\n self._thread = Thread(target=self._loop, name=f\"{self._name}-thread\", daemon=True)\n self._thread.start()\n\n def stop(self, force: bool = False) -> None:\n self._stop_requested.set()\n\n def health(self) -> WorkerHealth:\n return WorkerHealth(name=self.name, status=\"ok\", critical=True, meta={\"runs\": self._runs})\n\n def status(self) -> WorkerStatus:\n thread_alive = self._thread is not None and self._thread.is_alive()\n with self._lock:\n in_flight = self._in_flight\n runs = self._runs\n if not thread_alive:\n state = \"stopped\"\n elif self._stop_requested.is_set():\n state = \"stopping\"\n elif in_flight > 0:\n state = \"busy\"\n else:\n state = \"idle\"\n return WorkerStatus(name=self.name, state=state, in_flight=in_flight, meta={\"runs\": runs})\n\n def _loop(self) -> None:\n while not self._stop_requested.is_set():\n with self._lock:\n self._in_flight += 1\n try:\n self._routine.run()\n with self._lock:\n self._runs += 1\n finally:\n with self._lock:\n self._in_flight -= 1\n if self._stop_requested.is_set():\n return\n sleep(self._interval)", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:ScenarioWorker", - "span_start": 50, - "span_end": 110, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 2, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "class IntervalRoutine:\n calls: list[float] = field(default_factory=list)\n _lock: Lock = field(default_factory=Lock)\n\n def run(self) -> None:\n with self._lock:\n self.calls.append(monotonic())\n\n def wait_runs(self, count: int, timeout: float) -> bool:\n deadline = monotonic() + timeout\n while monotonic() < deadline:\n with self._lock:\n if len(self.calls) >= count:\n return True\n sleep(0.01)\n return False\n\n def deltas(self) -> list[float]:\n with self._lock:\n return [self.calls[index + 1] - self.calls[index] for index in range(len(self.calls) - 1)]", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:IntervalRoutine", - "span_start": 18, - "span_end": 37, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "def test_actions_stop_busy_worker_before_timeout() -> None:\n started = Event()\n release = Event()\n runtime, base_url = _build_runtime(ScenarioWorker(\"busy-worker\", BlockingRoutine(started, release)))\n assert started.wait(timeout=1.0) is True\n\n def release_later() -> None:\n sleep(0.2)\n release.set()\n\n Thread(target=release_later, daemon=True).start()\n try:\n status, payload = _http_call_json(base_url, \"/actions/stop\", method=\"POST\")\n assert status == 200\n assert isinstance(payload.get(\"detail\"), dict)\n assert payload[\"detail\"][\"timed_out\"] is False\n assert payload[\"detail\"][\"state\"] == \"stopped\"\n\n health_status, health_payload = _http_call_json(base_url, \"/health\")\n assert health_status == 503\n assert health_payload[\"status\"] == \"unhealthy\"\n assert health_payload[\"state\"] == \"stopped\"\n finally:\n runtime.stop()", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:test_actions_stop_busy_worker_before_timeout", - "span_start": 209, - "span_end": 232, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 9, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ] - }, - "diagnostics": { - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C0_SOURCE_CHUNKS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C0_SOURCE_CHUNKS": 10 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [], - "include_globs": [ - "src", - "tests" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests" - ] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src", - "tests" - ], - "include_globs": [ - "src", - "tests" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests" - ] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src", - "tests" - ], - "include_globs": [ - "src", - "tests" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests" - ] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "WorkflowRuntimeFactory", - "path_scope": [], - "include_globs": [ - "src/**", - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "Где тесты для WorkflowRuntimeFactory? test_workflow_runtime_factory TestWorkflowRuntimeFactory WorkflowRuntimeFactory", - "path_scope": [], - "include_globs": [ - "src/**", - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "top_k": 6, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Где тесты для WorkflowRuntimeFactory? test_workflow_runtime_factory TestWorkflowRuntimeFactory WorkflowRuntimeFactory", - "path_scope": [], - "include_globs": [ - "src/**", - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "top_k": 10, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [], - "normalized_include_globs": [ - "src", - "tests" - ], - "normalized_exclude_globs": [], - "normalized_prefer_globs": [ - "tests" - ], - "filter_stage": "post_rank", - "candidates_before_filter": 0, - "candidates_after_filter": 0 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src", - "tests" - ], - "normalized_include_globs": [ - "src", - "tests" - ], - "normalized_exclude_globs": [], - "normalized_prefer_globs": [ - "tests" - ], - "filter_stage": "post_rank", - "candidates_before_filter": 6, - "candidates_after_filter": 6 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src", - "tests" - ], - "normalized_include_globs": [ - "src", - "tests" - ], - "normalized_exclude_globs": [], - "normalized_prefer_globs": [ - "tests" - ], - "filter_stage": "post_rank", - "candidates_before_filter": 10, - "candidates_after_filter": 10 - } - ], - "fallback": { - "used": true, - "reason": "scope_relaxed_no_hits" - }, - "symbol_resolution": { - "status": "not_found", - "resolved_symbol": null, - "alternatives": [ - "WorkflowRuntimeFactory" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "miss", - "hit_count": 0, - "fail_reason": "scope_relaxed_no_hits" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 6, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 10, - "fail_reason": null - } - ] - }, - "constraint_violations": [ - { - "type": "LAYER_MISSING", - "severity": "warn", - "details": { - "layer": "C1_SYMBOL_CATALOG", - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ] - }, - "suggested_fix": "Increase top_k for this layer or relax constraints for retrieval." - } - ], - "timings_ms": { - "symbol_resolution": 0, - "retrieval_total": 100, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 44, - "C2_DEPENDENCY_GRAPH": 40, - "C0_SOURCE_CHUNKS": 15 - }, - "merge_rank": 0 - } - } - }, - { - "step": "llm_answer", - "input": { - "query": "Где тесты для WorkflowRuntimeFactory?", - "rag_count": 16 - }, - "output": { - "llm_answer": "Прямых тестов конкретно для `WorkflowRuntimeFactory` в предоставленном контексте не обнаружено." - }, - "diagnostics": { - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 1040, - "evidence_rows": 16, - "evidence_chars": 8149 - }, - "evidence_summary": [ - { - "layer": "C2_DEPENDENCY_GRAPH", - "count": 6, - "unique_paths": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 10, - "unique_paths": 1 - } - ], - "prompt_template_id": "intent_code_qa_find_tests_ru_v4", - "system_prompt_version": "v1" - }, - "timings_ms": { - "prompt_build": 0, - "llm_call": 1178 - } - } - } - ] - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_143636/full_chain_plba_code_subintents_v2_plba-v2-find-tests-workflow-runtime-factory-negative.md b/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_143636/full_chain_plba_code_subintents_v2_plba-v2-find-tests-workflow-runtime-factory-negative.md deleted file mode 100644 index b2f5045..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_143636/full_chain_plba_code_subintents_v2_plba-v2-find-tests-workflow-runtime-factory-negative.md +++ /dev/null @@ -1,32 +0,0 @@ -# plba-v2-find-tests-workflow-runtime-factory-negative - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_subintents_v2.yaml -- runner: runtime -- mode: full_chain -- passed: True - -## Query -Где тесты для WorkflowRuntimeFactory? - -## Actual -{ - "intent": "CODE_QA", - "sub_intent": "FIND_TESTS", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 16, - "llm_answer": "Прямых тестов конкретно для `WorkflowRuntimeFactory` в предоставленном контексте не обнаружено.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "WorkflowRuntimeFactory" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ] -} - -## Mismatches -- none \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_143636/full_chain_plba_code_subintents_v2_plba-v2-open-file-nonexistent.json b/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_143636/full_chain_plba_code_subintents_v2_plba-v2-open-file-nonexistent.json deleted file mode 100644 index 14afe88..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_143636/full_chain_plba_code_subintents_v2_plba-v2-open-file-nonexistent.json +++ /dev/null @@ -1,441 +0,0 @@ -{ - "case_id": "plba-v2-open-file-nonexistent", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_subintents_v2.yaml", - "runner": "runtime", - "mode": "full_chain", - "actual": { - "intent": "CODE_QA", - "sub_intent": "OPEN_FILE", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 0, - "llm_answer": "Файл src/app_runtime/core/missing_runtime.py не найден.", - "answer_mode": "degraded", - "path_scope": [ - "src/app_runtime/core/missing_runtime.py" - ], - "symbol_candidates": [], - "layers": [ - "C0_SOURCE_CHUNKS" - ] - }, - "passed": true, - "mismatches": [], - "details": { - "case_id": "plba-v2-open-file-nonexistent", - "text": "Открой файл src/app_runtime/core/missing_runtime.py", - "mode": "full_chain", - "run_started_at": "2026-03-12T14:36:36", - "rag_session_id": "7d11da21-faa0-4cea-aede-aeabe069164c", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Открой файл src/app_runtime/core/missing_runtime.py", - "symbol_resolution": { - "status": "not_requested", - "resolved_symbol": null, - "alternatives": [], - "confidence": 0.0 - }, - "rag_count": 0, - "rag_rows": [], - "llm_answer": "Файл src/app_runtime/core/missing_runtime.py не найден.", - "summary": { - "router": { - "intent": "CODE_QA", - "sub_intent": "OPEN_FILE", - "confidence": null - }, - "retrieval": { - "profile": "code", - "layers_hit": [], - "evidence_sufficient": false - }, - "llm": { - "answer_status": "degraded", - "groundedness": "weakly_grounded" - } - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "OPEN_FILE", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C0_SOURCE_CHUNKS" - ], - "symbol_kind_hint": "unknown", - "symbol_candidates": [], - "keyword_hints": [], - "path_hints": [ - "src/app_runtime/core/missing_runtime.py" - ], - "path_scope": [ - "src/app_runtime/core/missing_runtime.py" - ], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/app_runtime/core/missing_runtime.py" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": false, - "max_distance": 2, - "top_k": 5 - } - } - }, - "execution": { - "executed_layers": [ - "C0_SOURCE_CHUNKS" - ], - "retrieval_mode_by_layer": { - "C0_SOURCE_CHUNKS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C0_SOURCE_CHUNKS": 200 - }, - "filters_by_layer": { - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src/app_runtime/core/missing_runtime.py" - ], - "include_globs": [], - "exclude_globs": [], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": null, - "workspace_id": null, - "returned_repo_ids": [], - "returned_workspace_ids": [] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Открой файл src/app_runtime/core/missing_runtime.py", - "path_scope": [ - "src/app_runtime/core/missing_runtime.py" - ], - "include_globs": [], - "exclude_globs": [], - "prefer_globs": [], - "top_k": 200, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src/app_runtime/core/missing_runtime.py" - ], - "normalized_include_globs": [], - "normalized_exclude_globs": [], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 0, - "candidates_after_filter": 0 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "not_requested", - "resolved_symbol": null, - "alternatives": [] - }, - "layers": [ - { - "layer": "C0_SOURCE_CHUNKS", - "status": "miss", - "hit_count": 0, - "fail_reason": null - } - ] - }, - "constraint_violations": [ - { - "type": "PATH_SCOPE_NOT_SATISFIED", - "severity": "error", - "details": { - "path_scope": [ - "src/app_runtime/core/missing_runtime.py" - ], - "returned_paths": [] - }, - "suggested_fix": "Use exact path_scope retrieval and disable broad fallback for OPEN_FILE." - }, - { - "type": "LAYER_MISSING", - "severity": "warn", - "details": { - "layer": "C0_SOURCE_CHUNKS", - "requested_layers": [ - "C0_SOURCE_CHUNKS" - ] - }, - "suggested_fix": "Increase top_k for this layer or relax constraints for retrieval." - } - ], - "timings_ms": { - "router": 0, - "symbol_resolution": 0, - "retrieval_total": 8, - "retrieval_by_layer": { - "C0_SOURCE_CHUNKS": 8 - }, - "merge_rank": 0, - "prompt_build": 0, - "llm_call": 0 - }, - "prompt": null, - "answer_policy": { - "short_circuit": true, - "answer_mode": "degraded", - "failure_reason": "file_not_found" - }, - "router": { - "conversation_mode": "START", - "keyword_hints": [], - "path_scope": [ - "src/app_runtime/core/missing_runtime.py" - ] - }, - "llm": { - "used_evidence_count": 0, - "missing_evidence_reason": "file_not_found" - } - }, - "run_info": { - "case_id": "plba-v2-open-file-nonexistent", - "mode": "full_chain", - "run_started_at": "2026-03-12T14:36:36", - "rag_session_id": "7d11da21-faa0-4cea-aede-aeabe069164c", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - }, - "input_request": { - "text": "Открой файл src/app_runtime/core/missing_runtime.py", - "normalized_query": "Открой файл src/app_runtime/core/missing_runtime.py" - }, - "steps": [ - { - "step": "intent_router", - "input": { - "query": "Открой файл src/app_runtime/core/missing_runtime.py" - }, - "output": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Открой файл src/app_runtime/core/missing_runtime.py" - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "OPEN_FILE", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C0_SOURCE_CHUNKS" - ], - "symbol_kind_hint": "unknown", - "symbol_candidates": [], - "keyword_hints": [], - "path_hints": [ - "src/app_runtime/core/missing_runtime.py" - ], - "path_scope": [ - "src/app_runtime/core/missing_runtime.py" - ], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/app_runtime/core/missing_runtime.py" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": false, - "max_distance": 2, - "top_k": 5 - } - } - }, - "timings_ms": { - "router": 0 - } - } - }, - { - "step": "retrieval", - "input": { - "query": "Открой файл src/app_runtime/core/missing_runtime.py" - }, - "output": { - "symbol_resolution": { - "status": "not_requested", - "resolved_symbol": null, - "alternatives": [], - "confidence": 0.0 - }, - "rag_count": 0, - "rag_rows": [] - }, - "diagnostics": { - "execution": { - "executed_layers": [ - "C0_SOURCE_CHUNKS" - ], - "retrieval_mode_by_layer": { - "C0_SOURCE_CHUNKS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C0_SOURCE_CHUNKS": 200 - }, - "filters_by_layer": { - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src/app_runtime/core/missing_runtime.py" - ], - "include_globs": [], - "exclude_globs": [], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": null, - "workspace_id": null, - "returned_repo_ids": [], - "returned_workspace_ids": [] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Открой файл src/app_runtime/core/missing_runtime.py", - "path_scope": [ - "src/app_runtime/core/missing_runtime.py" - ], - "include_globs": [], - "exclude_globs": [], - "prefer_globs": [], - "top_k": 200, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src/app_runtime/core/missing_runtime.py" - ], - "normalized_include_globs": [], - "normalized_exclude_globs": [], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 0, - "candidates_after_filter": 0 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "not_requested", - "resolved_symbol": null, - "alternatives": [] - }, - "layers": [ - { - "layer": "C0_SOURCE_CHUNKS", - "status": "miss", - "hit_count": 0, - "fail_reason": null - } - ] - }, - "constraint_violations": [ - { - "type": "PATH_SCOPE_NOT_SATISFIED", - "severity": "error", - "details": { - "path_scope": [ - "src/app_runtime/core/missing_runtime.py" - ], - "returned_paths": [] - }, - "suggested_fix": "Use exact path_scope retrieval and disable broad fallback for OPEN_FILE." - }, - { - "type": "LAYER_MISSING", - "severity": "warn", - "details": { - "layer": "C0_SOURCE_CHUNKS", - "requested_layers": [ - "C0_SOURCE_CHUNKS" - ] - }, - "suggested_fix": "Increase top_k for this layer or relax constraints for retrieval." - } - ], - "timings_ms": { - "symbol_resolution": 0, - "retrieval_total": 8, - "retrieval_by_layer": { - "C0_SOURCE_CHUNKS": 8 - }, - "merge_rank": 0 - } - } - }, - { - "step": "llm_answer", - "input": { - "query": "Открой файл src/app_runtime/core/missing_runtime.py", - "rag_count": 0 - }, - "output": { - "llm_answer": "Файл src/app_runtime/core/missing_runtime.py не найден." - }, - "diagnostics": { - "prompt": null, - "timings_ms": { - "prompt_build": 0, - "llm_call": 0 - } - } - } - ] - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_143636/full_chain_plba_code_subintents_v2_plba-v2-open-file-nonexistent.md b/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_143636/full_chain_plba_code_subintents_v2_plba-v2-open-file-nonexistent.md deleted file mode 100644 index ab3d085..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_143636/full_chain_plba_code_subintents_v2_plba-v2-open-file-nonexistent.md +++ /dev/null @@ -1,30 +0,0 @@ -# plba-v2-open-file-nonexistent - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_subintents_v2.yaml -- runner: runtime -- mode: full_chain -- passed: True - -## Query -Открой файл src/app_runtime/core/missing_runtime.py - -## Actual -{ - "intent": "CODE_QA", - "sub_intent": "OPEN_FILE", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 0, - "llm_answer": "Файл src/app_runtime/core/missing_runtime.py не найден.", - "answer_mode": "degraded", - "path_scope": [ - "src/app_runtime/core/missing_runtime.py" - ], - "symbol_candidates": [], - "layers": [ - "C0_SOURCE_CHUNKS" - ] -} - -## Mismatches -- none \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_143636/full_chain_plba_code_subintents_v2_plba-v2-open-file-public-api.json b/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_143636/full_chain_plba_code_subintents_v2_plba-v2-open-file-public-api.json deleted file mode 100644 index e3902b7..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_143636/full_chain_plba_code_subintents_v2_plba-v2-open-file-public-api.json +++ /dev/null @@ -1,492 +0,0 @@ -{ - "case_id": "plba-v2-open-file-public-api", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_subintents_v2.yaml", - "runner": "runtime", - "mode": "full_chain", - "actual": { - "intent": "CODE_QA", - "sub_intent": "OPEN_FILE", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 1, - "llm_answer": "В модуле src/plba/__init__.py видны следующие импорты и объявления:\nИмпорты:\n- plba.bootstrap.create_runtime\n- plba.config.ConfigFileLoader, FileConfigProvider\n- plba.control.ControlActionSet, ControlChannel, ControlPlaneService, HttpControlChannel\n- plba.contracts.ApplicationModule, ConfigProvider, HealthContributor, TraceContext, TraceContextRecord, TraceLogMessage, TraceTransport, Worker, WorkerHealth, WorkerStatus\n- plba.core.ConfigurationManager, RuntimeManager, ServiceContainer\n- plba.health.HealthRegistry\n- plba.logging.LogManager\n- plba.queue.InMemoryTaskQueue\n- plba.tracing.MySqlTraceTransport, NoOpTraceTransport, TraceService\n- plba.workflow.StepResult, WorkflowContext, WorkflowDefinition, WorkflowEngine, WorkflowEngineHooks, WorkflowNode, WorkflowRuntimeFactory, WorkflowStep\n- plba.workers.WorkerSupervisor\n\nОбъявления:\n- __all__\n\nТакже здесь определены несколько функций и классов из указанных модулей.", - "answer_mode": "answered", - "path_scope": [ - "src/plba/__init__.py" - ], - "symbol_candidates": [], - "layers": [ - "C0_SOURCE_CHUNKS" - ] - }, - "passed": true, - "mismatches": [], - "details": { - "case_id": "plba-v2-open-file-public-api", - "text": "Открой файл src/plba/__init__.py", - "mode": "full_chain", - "run_started_at": "2026-03-12T14:36:36", - "rag_session_id": "7d11da21-faa0-4cea-aede-aeabe069164c", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Открой файл src/plba/__init__.py", - "symbol_resolution": { - "status": "not_requested", - "resolved_symbol": null, - "alternatives": [], - "confidence": 0.0 - }, - "rag_count": 1, - "rag_rows": [ - { - "path": "src/plba/__init__.py", - "content": "from plba.bootstrap import create_runtime\nfrom plba.config import ConfigFileLoader, FileConfigProvider\nfrom plba.control import ControlActionSet, ControlChannel, ControlPlaneService, HttpControlChannel\nfrom plba.contracts import (\n ApplicationModule,\n ConfigProvider,\n HealthContributor,\n TraceContext,\n TraceContextRecord,\n TraceLogMessage,\n TraceTransport,\n Worker,\n WorkerHealth,\n WorkerStatus,\n)\nfrom plba.core import ConfigurationManager, RuntimeManager, ServiceContainer\nfrom plba.health import HealthRegistry\nfrom plba.logging import LogManager\nfrom plba.queue import InMemoryTaskQueue\nfrom plba.tracing import MySqlTraceTransport, NoOpTraceTransport, TraceService\nfrom plba.workflow import (\n StepResult,\n WorkflowContext,\n WorkflowDefinition,\n WorkflowEngine,\n WorkflowEngineHooks,\n WorkflowNode,\n WorkflowRuntimeFactory,\n WorkflowStep,\n)\nfrom plba.workers import WorkerSupervisor\n\n__all__ = [\n \"ApplicationModule\",\n \"ConfigFileLoader\",\n \"ConfigProvider\",\n \"ConfigurationManager\",\n \"ControlActionSet\",\n \"ControlChannel\",\n \"ControlPlaneService\",\n \"create_runtime\",\n \"FileConfigProvider\",\n \"HealthContributor\",\n \"HealthRegistry\",\n \"HttpControlChannel\",\n \"InMemoryTaskQueue\",\n \"LogManager\",\n \"MySqlTraceTransport\",\n \"NoOpTraceTransport\",\n \"RuntimeManager\",\n \"ServiceContainer\",\n \"TraceContext\",\n \"TraceContextRecord\",\n \"TraceLogMessage\",\n \"TraceService\",\n \"TraceTransport\",\n \"StepResult\",\n \"Worker\",\n \"WorkerHealth\",\n \"WorkerStatus\",\n \"WorkflowContext\",\n \"WorkflowDefinition\",\n \"WorkflowEngine\",\n \"WorkflowEngineHooks\",\n \"WorkflowNode\",\n \"WorkflowRuntimeFactory\",\n \"WorkflowStep\",\n \"WorkerSupervisor\",\n]", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/plba/__init__.py:1-69", - "span_start": 1, - "span_end": 69, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.plba.__init__", - "is_test": false, - "blob_sha": "24e755ec8c249d14fb0e675b5dbf2b71ab91afb9c849897eebfa9feb2499e19d", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "llm_answer": "В модуле src/plba/__init__.py видны следующие импорты и объявления:\nИмпорты:\n- plba.bootstrap.create_runtime\n- plba.config.ConfigFileLoader, FileConfigProvider\n- plba.control.ControlActionSet, ControlChannel, ControlPlaneService, HttpControlChannel\n- plba.contracts.ApplicationModule, ConfigProvider, HealthContributor, TraceContext, TraceContextRecord, TraceLogMessage, TraceTransport, Worker, WorkerHealth, WorkerStatus\n- plba.core.ConfigurationManager, RuntimeManager, ServiceContainer\n- plba.health.HealthRegistry\n- plba.logging.LogManager\n- plba.queue.InMemoryTaskQueue\n- plba.tracing.MySqlTraceTransport, NoOpTraceTransport, TraceService\n- plba.workflow.StepResult, WorkflowContext, WorkflowDefinition, WorkflowEngine, WorkflowEngineHooks, WorkflowNode, WorkflowRuntimeFactory, WorkflowStep\n- plba.workers.WorkerSupervisor\n\nОбъявления:\n- __all__\n\nТакже здесь определены несколько функций и классов из указанных модулей.", - "summary": { - "router": { - "intent": "CODE_QA", - "sub_intent": "OPEN_FILE", - "confidence": null - }, - "retrieval": { - "profile": "code", - "layers_hit": [ - "C0_SOURCE_CHUNKS" - ], - "evidence_sufficient": true - }, - "llm": { - "answer_status": "answered", - "groundedness": "grounded" - } - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "OPEN_FILE", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C0_SOURCE_CHUNKS" - ], - "symbol_kind_hint": "unknown", - "symbol_candidates": [], - "keyword_hints": [], - "path_hints": [ - "src/plba/__init__.py" - ], - "path_scope": [ - "src/plba/__init__.py" - ], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/plba/__init__.py" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": false, - "max_distance": 2, - "top_k": 5 - } - } - }, - "execution": { - "executed_layers": [ - "C0_SOURCE_CHUNKS" - ], - "retrieval_mode_by_layer": { - "C0_SOURCE_CHUNKS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C0_SOURCE_CHUNKS": 200 - }, - "filters_by_layer": { - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src/plba/__init__.py" - ], - "include_globs": [], - "exclude_globs": [], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Открой файл src/plba/__init__.py", - "path_scope": [ - "src/plba/__init__.py" - ], - "include_globs": [], - "exclude_globs": [], - "prefer_globs": [], - "top_k": 200, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src/plba/__init__.py" - ], - "normalized_include_globs": [], - "normalized_exclude_globs": [], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 1, - "candidates_after_filter": 1 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "not_requested", - "resolved_symbol": null, - "alternatives": [] - }, - "layers": [ - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 1, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "router": 0, - "symbol_resolution": 0, - "retrieval_total": 14, - "retrieval_by_layer": { - "C0_SOURCE_CHUNKS": 14 - }, - "merge_rank": 0, - "prompt_build": 0, - "llm_call": 1717 - }, - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 673, - "evidence_rows": 1, - "evidence_chars": 1768 - }, - "evidence_summary": [ - { - "layer": "C0_SOURCE_CHUNKS", - "count": 1, - "unique_paths": 1 - } - ], - "prompt_template_id": "intent_code_qa_open_file_ru_v4", - "system_prompt_version": "v1" - }, - "router": { - "conversation_mode": "START", - "keyword_hints": [], - "path_scope": [ - "src/plba/__init__.py" - ] - }, - "llm": { - "used_evidence_count": 1, - "missing_evidence_reason": null - } - }, - "run_info": { - "case_id": "plba-v2-open-file-public-api", - "mode": "full_chain", - "run_started_at": "2026-03-12T14:36:36", - "rag_session_id": "7d11da21-faa0-4cea-aede-aeabe069164c", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - }, - "input_request": { - "text": "Открой файл src/plba/__init__.py", - "normalized_query": "Открой файл src/plba/__init__.py" - }, - "steps": [ - { - "step": "intent_router", - "input": { - "query": "Открой файл src/plba/__init__.py" - }, - "output": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Открой файл src/plba/__init__.py" - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "OPEN_FILE", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C0_SOURCE_CHUNKS" - ], - "symbol_kind_hint": "unknown", - "symbol_candidates": [], - "keyword_hints": [], - "path_hints": [ - "src/plba/__init__.py" - ], - "path_scope": [ - "src/plba/__init__.py" - ], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/plba/__init__.py" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": false, - "max_distance": 2, - "top_k": 5 - } - } - }, - "timings_ms": { - "router": 0 - } - } - }, - { - "step": "retrieval", - "input": { - "query": "Открой файл src/plba/__init__.py" - }, - "output": { - "symbol_resolution": { - "status": "not_requested", - "resolved_symbol": null, - "alternatives": [], - "confidence": 0.0 - }, - "rag_count": 1, - "rag_rows": [ - { - "path": "src/plba/__init__.py", - "content": "from plba.bootstrap import create_runtime\nfrom plba.config import ConfigFileLoader, FileConfigProvider\nfrom plba.control import ControlActionSet, ControlChannel, ControlPlaneService, HttpControlChannel\nfrom plba.contracts import (\n ApplicationModule,\n ConfigProvider,\n HealthContributor,\n TraceContext,\n TraceContextRecord,\n TraceLogMessage,\n TraceTransport,\n Worker,\n WorkerHealth,\n WorkerStatus,\n)\nfrom plba.core import ConfigurationManager, RuntimeManager, ServiceContainer\nfrom plba.health import HealthRegistry\nfrom plba.logging import LogManager\nfrom plba.queue import InMemoryTaskQueue\nfrom plba.tracing import MySqlTraceTransport, NoOpTraceTransport, TraceService\nfrom plba.workflow import (\n StepResult,\n WorkflowContext,\n WorkflowDefinition,\n WorkflowEngine,\n WorkflowEngineHooks,\n WorkflowNode,\n WorkflowRuntimeFactory,\n WorkflowStep,\n)\nfrom plba.workers import WorkerSupervisor\n\n__all__ = [\n \"ApplicationModule\",\n \"ConfigFileLoader\",\n \"ConfigProvider\",\n \"ConfigurationManager\",\n \"ControlActionSet\",\n \"ControlChannel\",\n \"ControlPlaneService\",\n \"create_runtime\",\n \"FileConfigProvider\",\n \"HealthContributor\",\n \"HealthRegistry\",\n \"HttpControlChannel\",\n \"InMemoryTaskQueue\",\n \"LogManager\",\n \"MySqlTraceTransport\",\n \"NoOpTraceTransport\",\n \"RuntimeManager\",\n \"ServiceContainer\",\n \"TraceContext\",\n \"TraceContextRecord\",\n \"TraceLogMessage\",\n \"TraceService\",\n \"TraceTransport\",\n \"StepResult\",\n \"Worker\",\n \"WorkerHealth\",\n \"WorkerStatus\",\n \"WorkflowContext\",\n \"WorkflowDefinition\",\n \"WorkflowEngine\",\n \"WorkflowEngineHooks\",\n \"WorkflowNode\",\n \"WorkflowRuntimeFactory\",\n \"WorkflowStep\",\n \"WorkerSupervisor\",\n]", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/plba/__init__.py:1-69", - "span_start": 1, - "span_end": 69, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.plba.__init__", - "is_test": false, - "blob_sha": "24e755ec8c249d14fb0e675b5dbf2b71ab91afb9c849897eebfa9feb2499e19d", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ] - }, - "diagnostics": { - "execution": { - "executed_layers": [ - "C0_SOURCE_CHUNKS" - ], - "retrieval_mode_by_layer": { - "C0_SOURCE_CHUNKS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C0_SOURCE_CHUNKS": 200 - }, - "filters_by_layer": { - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src/plba/__init__.py" - ], - "include_globs": [], - "exclude_globs": [], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Открой файл src/plba/__init__.py", - "path_scope": [ - "src/plba/__init__.py" - ], - "include_globs": [], - "exclude_globs": [], - "prefer_globs": [], - "top_k": 200, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src/plba/__init__.py" - ], - "normalized_include_globs": [], - "normalized_exclude_globs": [], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 1, - "candidates_after_filter": 1 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "not_requested", - "resolved_symbol": null, - "alternatives": [] - }, - "layers": [ - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 1, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "symbol_resolution": 0, - "retrieval_total": 14, - "retrieval_by_layer": { - "C0_SOURCE_CHUNKS": 14 - }, - "merge_rank": 0 - } - } - }, - { - "step": "llm_answer", - "input": { - "query": "Открой файл src/plba/__init__.py", - "rag_count": 1 - }, - "output": { - "llm_answer": "В модуле src/plba/__init__.py видны следующие импорты и объявления:\nИмпорты:\n- plba.bootstrap.create_runtime\n- plba.config.ConfigFileLoader, FileConfigProvider\n- plba.control.ControlActionSet, ControlChannel, ControlPlaneService, HttpControlChannel\n- plba.contracts.ApplicationModule, ConfigProvider, HealthContributor, TraceContext, TraceContextRecord, TraceLogMessage, TraceTransport, Worker, WorkerHealth, WorkerStatus\n- plba.core.ConfigurationManager, RuntimeManager, ServiceContainer\n- plba.health.HealthRegistry\n- plba.logging.LogManager\n- plba.queue.InMemoryTaskQueue\n- plba.tracing.MySqlTraceTransport, NoOpTraceTransport, TraceService\n- plba.workflow.StepResult, WorkflowContext, WorkflowDefinition, WorkflowEngine, WorkflowEngineHooks, WorkflowNode, WorkflowRuntimeFactory, WorkflowStep\n- plba.workers.WorkerSupervisor\n\nОбъявления:\n- __all__\n\nТакже здесь определены несколько функций и классов из указанных модулей." - }, - "diagnostics": { - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 673, - "evidence_rows": 1, - "evidence_chars": 1768 - }, - "evidence_summary": [ - { - "layer": "C0_SOURCE_CHUNKS", - "count": 1, - "unique_paths": 1 - } - ], - "prompt_template_id": "intent_code_qa_open_file_ru_v4", - "system_prompt_version": "v1" - }, - "timings_ms": { - "prompt_build": 0, - "llm_call": 1717 - } - } - } - ] - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_143636/full_chain_plba_code_subintents_v2_plba-v2-open-file-public-api.md b/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_143636/full_chain_plba_code_subintents_v2_plba-v2-open-file-public-api.md deleted file mode 100644 index 2c1c102..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_143636/full_chain_plba_code_subintents_v2_plba-v2-open-file-public-api.md +++ /dev/null @@ -1,30 +0,0 @@ -# plba-v2-open-file-public-api - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_subintents_v2.yaml -- runner: runtime -- mode: full_chain -- passed: True - -## Query -Открой файл src/plba/__init__.py - -## Actual -{ - "intent": "CODE_QA", - "sub_intent": "OPEN_FILE", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 1, - "llm_answer": "В модуле src/plba/__init__.py видны следующие импорты и объявления:\nИмпорты:\n- plba.bootstrap.create_runtime\n- plba.config.ConfigFileLoader, FileConfigProvider\n- plba.control.ControlActionSet, ControlChannel, ControlPlaneService, HttpControlChannel\n- plba.contracts.ApplicationModule, ConfigProvider, HealthContributor, TraceContext, TraceContextRecord, TraceLogMessage, TraceTransport, Worker, WorkerHealth, WorkerStatus\n- plba.core.ConfigurationManager, RuntimeManager, ServiceContainer\n- plba.health.HealthRegistry\n- plba.logging.LogManager\n- plba.queue.InMemoryTaskQueue\n- plba.tracing.MySqlTraceTransport, NoOpTraceTransport, TraceService\n- plba.workflow.StepResult, WorkflowContext, WorkflowDefinition, WorkflowEngine, WorkflowEngineHooks, WorkflowNode, WorkflowRuntimeFactory, WorkflowStep\n- plba.workers.WorkerSupervisor\n\nОбъявления:\n- __all__\n\nТакже здесь определены несколько функций и классов из указанных модулей.", - "answer_mode": "answered", - "path_scope": [ - "src/plba/__init__.py" - ], - "symbol_candidates": [], - "layers": [ - "C0_SOURCE_CHUNKS" - ] -} - -## Mismatches -- none \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_143636/full_chain_plba_code_subintents_v2_plba-v2-open-file-runtime.json b/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_143636/full_chain_plba_code_subintents_v2_plba-v2-open-file-runtime.json deleted file mode 100644 index c00f60f..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_143636/full_chain_plba_code_subintents_v2_plba-v2-open-file-runtime.json +++ /dev/null @@ -1,492 +0,0 @@ -{ - "case_id": "plba-v2-open-file-runtime", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_subintents_v2.yaml", - "runner": "runtime", - "mode": "full_chain", - "actual": { - "intent": "CODE_QA", - "sub_intent": "OPEN_FILE", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 1, - "llm_answer": "В файле src/app_runtime/core/runtime.py определен класс RuntimeManager. Видны следующие элементы:\n- Константы: ACTION_TIMEOUT_SECONDS, ACTION_POLL_INTERVAL_SECONDS.\n- Инициализация с параметрами конфигурации, сервисов, трассировки, здоровья, логирования, супервизора рабочих процессов и службы управления плоскостью контроля.\n- Метод регистрации модуля приложения.", - "answer_mode": "answered", - "path_scope": [ - "src/app_runtime/core/runtime.py" - ], - "symbol_candidates": [], - "layers": [ - "C0_SOURCE_CHUNKS" - ] - }, - "passed": true, - "mismatches": [], - "details": { - "case_id": "plba-v2-open-file-runtime", - "text": "Открой файл src/app_runtime/core/runtime.py", - "mode": "full_chain", - "run_started_at": "2026-03-12T14:36:36", - "rag_session_id": "7d11da21-faa0-4cea-aede-aeabe069164c", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Открой файл src/app_runtime/core/runtime.py", - "symbol_resolution": { - "status": "not_requested", - "resolved_symbol": null, - "alternatives": [], - "confidence": 0.0 - }, - "rag_count": 1, - "rag_rows": [ - { - "path": "src/app_runtime/core/runtime.py", - "content": "class RuntimeManager:\n ACTION_TIMEOUT_SECONDS = 10.0\n ACTION_POLL_INTERVAL_SECONDS = 0.05\n\n def __init__(\n self,\n configuration: ConfigurationManager | None = None,\n services: ServiceContainer | None = None,\n traces: TraceService | None = None,\n health: HealthRegistry | None = None,\n logs: LogManager | None = None,\n workers: WorkerSupervisor | None = None,\n control_plane: ControlPlaneService | None = None,\n ) -> None:\n self.configuration = configuration or ConfigurationManager()\n self.services = services or ServiceContainer()\n self.traces = traces or TraceService()\n self.health = health or HealthRegistry()\n self.logs = logs or LogManager()\n self.workers = workers or WorkerSupervisor()\n self.control_plane = control_plane or ControlPlaneService()\n self.registry = ModuleRegistry(self.services)\n self._started = False\n self._state = LifecycleState.IDLE\n self._core_registered = False\n self._workers_registered = False\n self._register_core_services()\n\n def register_module(self, module: ApplicationModule) -> None:\n self.registry.register_module(module.name)\n module.register(self.registry)\n\n def add_config_file(self, path: str) -> FileConfigProvider:\n provider = FileConfigProvider(path)\n self.configuration.add_provider(provider)\n return provider\n\n def start(self, *, start_control_plane: bool = True) -> None:\n if self._started:\n return\n self._state = LifecycleState.STARTING\n config = self.configuration.load()\n self.logs.apply_config(config)\n self._register_health_contributors()\n self._register_workers()\n self.workers.start()\n if start_control_plane:\n self.control_plane.start(self)\n self._started = True\n self._refresh_state()\n\n def stop(self, timeout: float = 30.0, force: bool = False, stop_control_plane: bool = True) -> None:\n if not self._started:\n return\n self._state = LifecycleState.STOPPING\n self.workers.stop(timeout=timeout, force=force)\n if stop_control_plane:\n self.control_plane.stop()\n self._started = False\n self._state = LifecycleState.STOPPED\n\n def status(self) -> dict[str, object]:\n self._refresh_state()\n return self.control_plane.snapshot(self)\n\n def current_health(self) -> HealthPayload:\n self._refresh_state()\n return self.health.payload(self._state, self.workers.healths())\n\n async def health_status(self) -> HealthPayload:\n return self.current_health()\n\n async def start_runtime(self) -> dict[str, object] | str:\n self._refresh_state()\n if self._started:\n return \"runtime already running\"\n if self._state == LifecycleState.STOPPING:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n\n self.start(start_control_plane=False)\n started = self._wait_for_state({LifecycleState.IDLE, LifecycleState.BUSY}, timeout=self.ACTION_TIMEOUT_SECONDS)\n if started:\n return self._action_detail(\"runtime started\", timed_out=False)\n return self._action_detail(\"runtime start is still in progress\", timed_out=True)\n\n async def stop_runtime(self) -> dict[str, object] | str:\n self._refresh_state()\n if not self._started:\n if self._state == LifecycleState.STOPPING:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n return \"runtime already stopped\"\n\n self._state = LifecycleState.STOPPING\n try:\n self.workers.stop(timeout=self.ACTION_TIMEOUT_SECONDS, force=False)\n except TimeoutError:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n\n self._started = False\n self._state = LifecycleState.STOPPED\n return self._action_detail(\"runtime stopped\", timed_out=False)\n\n async def runtime_status(self) -> str:\n self._refresh_state()\n return self._state.value\n\n def _register_core_services(self) -> None:\n if self._core_registered:\n return\n self.services.register(\"configuration\", self.configuration)\n self.services.register(\"traces\", self.traces)\n self.services.register(\"health\", self.health)\n self.services.register(\"logs\", self.logs)\n self.services.register(\"workers\", self.workers)\n self.services.register(\"control_plane\", self.control_plane)\n self._core_registered = True\n\n def _register_health_contributors(self) -> None:\n for contributor in self.registry.health_contributors:\n self.health.register(contributor)\n\n def _register_workers(self) -> None:\n if self._workers_registered:\n return\n for worker in self.registry.workers:\n self.workers.register(worker)\n self._workers_registered = True\n\n def _refresh_state(self) -> None:\n lifecycle = self.workers.lifecycle_state()\n\n if self._state == LifecycleState.STOPPING:\n if lifecycle == LifecycleState.STOPPED:\n self._started = False\n self._state = LifecycleState.STOPPED\n return\n\n if not self._started:\n if lifecycle == LifecycleState.STOPPED:\n self._state = LifecycleState.STOPPED\n return\n\n self._state = lifecycle\n\n def _wait_for_state(self, target_states: set[LifecycleState], *, timeout: float) -> bool:\n deadline = monotonic() + timeout\n while monotonic() < deadline:\n self._refresh_state()\n if self._state in target_states:\n return True\n sleep(self.ACTION_POLL_INTERVAL_SECONDS)\n self._refresh_state()\n return self._state in target_states\n\n def _action_detail(self, message: str, *, timed_out: bool) -> dict[str, object]:\n self._refresh_state()\n return {\n \"message\": message,\n \"state\": self._state.value,\n \"timed_out\": timed_out,\n \"workers\": self.workers.snapshot(),\n }", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/core/runtime.py:RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.core.runtime", - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "llm_answer": "В файле src/app_runtime/core/runtime.py определен класс RuntimeManager. Видны следующие элементы:\n- Константы: ACTION_TIMEOUT_SECONDS, ACTION_POLL_INTERVAL_SECONDS.\n- Инициализация с параметрами конфигурации, сервисов, трассировки, здоровья, логирования, супервизора рабочих процессов и службы управления плоскостью контроля.\n- Метод регистрации модуля приложения.", - "summary": { - "router": { - "intent": "CODE_QA", - "sub_intent": "OPEN_FILE", - "confidence": null - }, - "retrieval": { - "profile": "code", - "layers_hit": [ - "C0_SOURCE_CHUNKS" - ], - "evidence_sufficient": true - }, - "llm": { - "answer_status": "answered", - "groundedness": "grounded" - } - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "OPEN_FILE", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C0_SOURCE_CHUNKS" - ], - "symbol_kind_hint": "unknown", - "symbol_candidates": [], - "keyword_hints": [], - "path_hints": [ - "src/app_runtime/core/runtime.py" - ], - "path_scope": [ - "src/app_runtime/core/runtime.py" - ], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/app_runtime/core/runtime.py" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": false, - "max_distance": 2, - "top_k": 5 - } - } - }, - "execution": { - "executed_layers": [ - "C0_SOURCE_CHUNKS" - ], - "retrieval_mode_by_layer": { - "C0_SOURCE_CHUNKS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C0_SOURCE_CHUNKS": 200 - }, - "filters_by_layer": { - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src/app_runtime/core/runtime.py" - ], - "include_globs": [], - "exclude_globs": [], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Открой файл src/app_runtime/core/runtime.py", - "path_scope": [ - "src/app_runtime/core/runtime.py" - ], - "include_globs": [], - "exclude_globs": [], - "prefer_globs": [], - "top_k": 200, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src/app_runtime/core/runtime.py" - ], - "normalized_include_globs": [], - "normalized_exclude_globs": [], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 1, - "candidates_after_filter": 1 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "not_requested", - "resolved_symbol": null, - "alternatives": [] - }, - "layers": [ - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 1, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "router": 1, - "symbol_resolution": 0, - "retrieval_total": 212, - "retrieval_by_layer": { - "C0_SOURCE_CHUNKS": 212 - }, - "merge_rank": 0, - "prompt_build": 0, - "llm_call": 903 - }, - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 684, - "evidence_rows": 1, - "evidence_chars": 6265 - }, - "evidence_summary": [ - { - "layer": "C0_SOURCE_CHUNKS", - "count": 1, - "unique_paths": 1 - } - ], - "prompt_template_id": "intent_code_qa_open_file_ru_v4", - "system_prompt_version": "v1" - }, - "router": { - "conversation_mode": "START", - "keyword_hints": [], - "path_scope": [ - "src/app_runtime/core/runtime.py" - ] - }, - "llm": { - "used_evidence_count": 1, - "missing_evidence_reason": null - } - }, - "run_info": { - "case_id": "plba-v2-open-file-runtime", - "mode": "full_chain", - "run_started_at": "2026-03-12T14:36:36", - "rag_session_id": "7d11da21-faa0-4cea-aede-aeabe069164c", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - }, - "input_request": { - "text": "Открой файл src/app_runtime/core/runtime.py", - "normalized_query": "Открой файл src/app_runtime/core/runtime.py" - }, - "steps": [ - { - "step": "intent_router", - "input": { - "query": "Открой файл src/app_runtime/core/runtime.py" - }, - "output": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Открой файл src/app_runtime/core/runtime.py" - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "OPEN_FILE", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C0_SOURCE_CHUNKS" - ], - "symbol_kind_hint": "unknown", - "symbol_candidates": [], - "keyword_hints": [], - "path_hints": [ - "src/app_runtime/core/runtime.py" - ], - "path_scope": [ - "src/app_runtime/core/runtime.py" - ], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/app_runtime/core/runtime.py" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": false, - "max_distance": 2, - "top_k": 5 - } - } - }, - "timings_ms": { - "router": 1 - } - } - }, - { - "step": "retrieval", - "input": { - "query": "Открой файл src/app_runtime/core/runtime.py" - }, - "output": { - "symbol_resolution": { - "status": "not_requested", - "resolved_symbol": null, - "alternatives": [], - "confidence": 0.0 - }, - "rag_count": 1, - "rag_rows": [ - { - "path": "src/app_runtime/core/runtime.py", - "content": "class RuntimeManager:\n ACTION_TIMEOUT_SECONDS = 10.0\n ACTION_POLL_INTERVAL_SECONDS = 0.05\n\n def __init__(\n self,\n configuration: ConfigurationManager | None = None,\n services: ServiceContainer | None = None,\n traces: TraceService | None = None,\n health: HealthRegistry | None = None,\n logs: LogManager | None = None,\n workers: WorkerSupervisor | None = None,\n control_plane: ControlPlaneService | None = None,\n ) -> None:\n self.configuration = configuration or ConfigurationManager()\n self.services = services or ServiceContainer()\n self.traces = traces or TraceService()\n self.health = health or HealthRegistry()\n self.logs = logs or LogManager()\n self.workers = workers or WorkerSupervisor()\n self.control_plane = control_plane or ControlPlaneService()\n self.registry = ModuleRegistry(self.services)\n self._started = False\n self._state = LifecycleState.IDLE\n self._core_registered = False\n self._workers_registered = False\n self._register_core_services()\n\n def register_module(self, module: ApplicationModule) -> None:\n self.registry.register_module(module.name)\n module.register(self.registry)\n\n def add_config_file(self, path: str) -> FileConfigProvider:\n provider = FileConfigProvider(path)\n self.configuration.add_provider(provider)\n return provider\n\n def start(self, *, start_control_plane: bool = True) -> None:\n if self._started:\n return\n self._state = LifecycleState.STARTING\n config = self.configuration.load()\n self.logs.apply_config(config)\n self._register_health_contributors()\n self._register_workers()\n self.workers.start()\n if start_control_plane:\n self.control_plane.start(self)\n self._started = True\n self._refresh_state()\n\n def stop(self, timeout: float = 30.0, force: bool = False, stop_control_plane: bool = True) -> None:\n if not self._started:\n return\n self._state = LifecycleState.STOPPING\n self.workers.stop(timeout=timeout, force=force)\n if stop_control_plane:\n self.control_plane.stop()\n self._started = False\n self._state = LifecycleState.STOPPED\n\n def status(self) -> dict[str, object]:\n self._refresh_state()\n return self.control_plane.snapshot(self)\n\n def current_health(self) -> HealthPayload:\n self._refresh_state()\n return self.health.payload(self._state, self.workers.healths())\n\n async def health_status(self) -> HealthPayload:\n return self.current_health()\n\n async def start_runtime(self) -> dict[str, object] | str:\n self._refresh_state()\n if self._started:\n return \"runtime already running\"\n if self._state == LifecycleState.STOPPING:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n\n self.start(start_control_plane=False)\n started = self._wait_for_state({LifecycleState.IDLE, LifecycleState.BUSY}, timeout=self.ACTION_TIMEOUT_SECONDS)\n if started:\n return self._action_detail(\"runtime started\", timed_out=False)\n return self._action_detail(\"runtime start is still in progress\", timed_out=True)\n\n async def stop_runtime(self) -> dict[str, object] | str:\n self._refresh_state()\n if not self._started:\n if self._state == LifecycleState.STOPPING:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n return \"runtime already stopped\"\n\n self._state = LifecycleState.STOPPING\n try:\n self.workers.stop(timeout=self.ACTION_TIMEOUT_SECONDS, force=False)\n except TimeoutError:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n\n self._started = False\n self._state = LifecycleState.STOPPED\n return self._action_detail(\"runtime stopped\", timed_out=False)\n\n async def runtime_status(self) -> str:\n self._refresh_state()\n return self._state.value\n\n def _register_core_services(self) -> None:\n if self._core_registered:\n return\n self.services.register(\"configuration\", self.configuration)\n self.services.register(\"traces\", self.traces)\n self.services.register(\"health\", self.health)\n self.services.register(\"logs\", self.logs)\n self.services.register(\"workers\", self.workers)\n self.services.register(\"control_plane\", self.control_plane)\n self._core_registered = True\n\n def _register_health_contributors(self) -> None:\n for contributor in self.registry.health_contributors:\n self.health.register(contributor)\n\n def _register_workers(self) -> None:\n if self._workers_registered:\n return\n for worker in self.registry.workers:\n self.workers.register(worker)\n self._workers_registered = True\n\n def _refresh_state(self) -> None:\n lifecycle = self.workers.lifecycle_state()\n\n if self._state == LifecycleState.STOPPING:\n if lifecycle == LifecycleState.STOPPED:\n self._started = False\n self._state = LifecycleState.STOPPED\n return\n\n if not self._started:\n if lifecycle == LifecycleState.STOPPED:\n self._state = LifecycleState.STOPPED\n return\n\n self._state = lifecycle\n\n def _wait_for_state(self, target_states: set[LifecycleState], *, timeout: float) -> bool:\n deadline = monotonic() + timeout\n while monotonic() < deadline:\n self._refresh_state()\n if self._state in target_states:\n return True\n sleep(self.ACTION_POLL_INTERVAL_SECONDS)\n self._refresh_state()\n return self._state in target_states\n\n def _action_detail(self, message: str, *, timed_out: bool) -> dict[str, object]:\n self._refresh_state()\n return {\n \"message\": message,\n \"state\": self._state.value,\n \"timed_out\": timed_out,\n \"workers\": self.workers.snapshot(),\n }", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/core/runtime.py:RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.core.runtime", - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ] - }, - "diagnostics": { - "execution": { - "executed_layers": [ - "C0_SOURCE_CHUNKS" - ], - "retrieval_mode_by_layer": { - "C0_SOURCE_CHUNKS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C0_SOURCE_CHUNKS": 200 - }, - "filters_by_layer": { - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src/app_runtime/core/runtime.py" - ], - "include_globs": [], - "exclude_globs": [], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Открой файл src/app_runtime/core/runtime.py", - "path_scope": [ - "src/app_runtime/core/runtime.py" - ], - "include_globs": [], - "exclude_globs": [], - "prefer_globs": [], - "top_k": 200, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src/app_runtime/core/runtime.py" - ], - "normalized_include_globs": [], - "normalized_exclude_globs": [], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 1, - "candidates_after_filter": 1 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "not_requested", - "resolved_symbol": null, - "alternatives": [] - }, - "layers": [ - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 1, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "symbol_resolution": 0, - "retrieval_total": 212, - "retrieval_by_layer": { - "C0_SOURCE_CHUNKS": 212 - }, - "merge_rank": 0 - } - } - }, - { - "step": "llm_answer", - "input": { - "query": "Открой файл src/app_runtime/core/runtime.py", - "rag_count": 1 - }, - "output": { - "llm_answer": "В файле src/app_runtime/core/runtime.py определен класс RuntimeManager. Видны следующие элементы:\n- Константы: ACTION_TIMEOUT_SECONDS, ACTION_POLL_INTERVAL_SECONDS.\n- Инициализация с параметрами конфигурации, сервисов, трассировки, здоровья, логирования, супервизора рабочих процессов и службы управления плоскостью контроля.\n- Метод регистрации модуля приложения." - }, - "diagnostics": { - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 684, - "evidence_rows": 1, - "evidence_chars": 6265 - }, - "evidence_summary": [ - { - "layer": "C0_SOURCE_CHUNKS", - "count": 1, - "unique_paths": 1 - } - ], - "prompt_template_id": "intent_code_qa_open_file_ru_v4", - "system_prompt_version": "v1" - }, - "timings_ms": { - "prompt_build": 0, - "llm_call": 903 - } - } - } - ] - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_143636/full_chain_plba_code_subintents_v2_plba-v2-open-file-runtime.md b/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_143636/full_chain_plba_code_subintents_v2_plba-v2-open-file-runtime.md deleted file mode 100644 index 74a0240..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_143636/full_chain_plba_code_subintents_v2_plba-v2-open-file-runtime.md +++ /dev/null @@ -1,30 +0,0 @@ -# plba-v2-open-file-runtime - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_subintents_v2.yaml -- runner: runtime -- mode: full_chain -- passed: True - -## Query -Открой файл src/app_runtime/core/runtime.py - -## Actual -{ - "intent": "CODE_QA", - "sub_intent": "OPEN_FILE", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 1, - "llm_answer": "В файле src/app_runtime/core/runtime.py определен класс RuntimeManager. Видны следующие элементы:\n- Константы: ACTION_TIMEOUT_SECONDS, ACTION_POLL_INTERVAL_SECONDS.\n- Инициализация с параметрами конфигурации, сервисов, трассировки, здоровья, логирования, супервизора рабочих процессов и службы управления плоскостью контроля.\n- Метод регистрации модуля приложения.", - "answer_mode": "answered", - "path_scope": [ - "src/app_runtime/core/runtime.py" - ], - "symbol_candidates": [], - "layers": [ - "C0_SOURCE_CHUNKS" - ] -} - -## Mismatches -- none \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_143636/full_chain_plba_code_subintents_v2_plba-v2-trace-flow-health-endpoint.json b/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_143636/full_chain_plba_code_subintents_v2_plba-v2-trace-flow-health-endpoint.json deleted file mode 100644 index 433fe10..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_143636/full_chain_plba_code_subintents_v2_plba-v2-trace-flow-health-endpoint.json +++ /dev/null @@ -1,3084 +0,0 @@ -{ - "case_id": "plba-v2-trace-flow-health-endpoint", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_subintents_v2.yaml", - "runner": "runtime", - "mode": "full_chain", - "actual": { - "intent": "CODE_QA", - "sub_intent": "TRACE_FLOW", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 26, - "llm_answer": "Когда пользователь делает запрос `/health` к приложению, созданному с помощью `HttpControlAppFactory`, происходят следующие шаги:\n\n1. Запрос поступает на уровень middleware (`log_api_call`) приложения FastAPI, где измеряется время обработки запроса.\n2. После middleware запрос обрабатывается маршрутизатором FastAPI и достигает обработчика маршрута `/health`.\n3. В обработчике `/health` вызывается предоставленный внешним компонентом callable-функции `health_provider`, которая должна вернуть объект типа `HealthPayload`.\n4. Полученный от `health_provider` объект проверяется на статус «ok». Если он соответствует этому значению, возвращается успешный ответ (статус-код 200), иначе — ошибка (статус-код 503).\n5. Ответ формируется в виде объекта `JSONResponse`, содержащего результат вызова `health_provider`. \n\nТаким образом, поток начинается с входящего HTTP-запроса, проходит через middleware для логирования времени отклика и затем направляется на конечный обработчик маршрута `/health`, после чего ответ отправляется обратно клиенту.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "health", - "HttpControlAppFactory" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "passed": true, - "mismatches": [], - "details": { - "case_id": "plba-v2-trace-flow-health-endpoint", - "text": "Покажи как проходит запрос /health в HttpControlAppFactory", - "mode": "full_chain", - "run_started_at": "2026-03-12T14:36:36", - "rag_session_id": "7d11da21-faa0-4cea-aede-aeabe069164c", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Покажи как проходит запрос /health в HttpControlAppFactory", - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "HttpControlAppFactory", - "alternatives": [ - "HttpControlAppFactory", - "ControlActionSet", - "HealthContributor.health", - "HealthContributor" - ], - "confidence": 0.99 - }, - "rag_count": 26, - "rag_rows": [ - { - "path": "src/app_runtime/control/http_app.py", - "content": "class HttpControlAppFactory\nHttpControlAppFactory", - "layer": "C1_SYMBOL_CATALOG", - "title": "HttpControlAppFactory", - "span_start": 15, - "span_end": 53, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "9b3502a5fb408b273223db13264349cf500de24915b6c649d9ea8970d0dfd8e0", - "qname": "HttpControlAppFactory", - "kind": "class", - "signature": "HttpControlAppFactory", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.control.http_app", - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "class ControlActionSet\nControlActionSet", - "layer": "C1_SYMBOL_CATALOG", - "title": "ControlActionSet", - "span_start": 14, - "span_end": 18, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "46eb026cb3313415ec47b82dd22f84f4d112c9d987e8b1716dcb0baa1cce8988", - "qname": "ControlActionSet", - "kind": "class", - "signature": "ControlActionSet", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.control.base", - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/contracts/health.py", - "content": "method HealthContributor.health\nhealth(self)\nReturn contributor health state.", - "layer": "C1_SYMBOL_CATALOG", - "title": "HealthContributor.health", - "span_start": 9, - "span_end": 10, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "728cff18958d8a25e2661a0f08c83d68c3bbbfa8cef212b85dc0da2b11b3dc90", - "qname": "HealthContributor.health", - "kind": "method", - "signature": "health(self)", - "parent_symbol_id": "HealthContributor", - "package_or_module": "src.app_runtime.contracts.health", - "is_test": false, - "blob_sha": "6bd92611def7131e32d4dd34a8ed85e6cf3c67722ad27797032a632cb30dc097", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/contracts/health.py", - "content": "class HealthContributor\nHealthContributor(ABC)", - "layer": "C1_SYMBOL_CATALOG", - "title": "HealthContributor", - "span_start": 7, - "span_end": 10, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "db91ae387b89a2e9d83829754f27fa18a4055b3e72d7f31789a0b8e0bf5bba0b", - "qname": "HealthContributor", - "kind": "class", - "signature": "HealthContributor(ABC)", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.contracts.health", - "is_test": false, - "blob_sha": "6bd92611def7131e32d4dd34a8ed85e6cf3c67722ad27797032a632cb30dc097", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "HttpControlAppFactory\nrole: factory\n\nResponsibilities:\n- name suffix suggests factory", - "layer": "C4_SEMANTIC_ROLES", - "title": "HttpControlAppFactory", - "span_start": 15, - "span_end": 53, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 39, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "9b3502a5fb408b273223db13264349cf500de24915b6c649d9ea8970d0dfd8e0", - "symbol_name": "HttpControlAppFactory", - "qname": "HttpControlAppFactory", - "role": "factory", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/health/registry.py", - "content": "HealthRegistry\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (2)", - "layer": "C4_SEMANTIC_ROLES", - "title": "HealthRegistry", - "span_start": 8, - "span_end": 56, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 29, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "fd3390eb0ba29c9979466b9c2117238e0da3bb829eeb4d505cb34c9c3df7a8e8", - "symbol_name": "HealthRegistry", - "qname": "HealthRegistry", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 2, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "26e6a24daa43407ba5340b74497c20153020e79f8d7828ae502aaec378dfcf75", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/types.py", - "content": "HealthPayload\nrole: model\n\nResponsibilities:\n- default model role", - "layer": "C4_SEMANTIC_ROLES", - "title": "HealthPayload", - "span_start": 7, - "span_end": 11, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 40, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "392235d63ddf752d6e419cb8528c93fe070d1bc02d3c87ba6a897baac810cf5d", - "symbol_name": "HealthPayload", - "qname": "HealthPayload", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "448a02e4a432b5ab65b246b2bd24a32a6f127b9d2091ea73b53ee3c0a2f53bb3", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/contracts/health.py", - "content": "HealthContributor\nrole: model\n\nResponsibilities:\n- default model role", - "layer": "C4_SEMANTIC_ROLES", - "title": "HealthContributor", - "span_start": 7, - "span_end": 10, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 40, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "db91ae387b89a2e9d83829754f27fa18a4055b3e72d7f31789a0b8e0bf5bba0b", - "symbol_name": "HealthContributor", - "qname": "HealthContributor", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "6bd92611def7131e32d4dd34a8ed85e6cf3c67722ad27797032a632cb30dc097", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "ControlActionSet\nrole: model\n\nResponsibilities:\n- default model role", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlActionSet", - "span_start": 14, - "span_end": 18, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 40, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "46eb026cb3313415ec47b82dd22f84f4d112c9d987e8b1716dcb0baa1cce8988", - "symbol_name": "ControlActionSet", - "qname": "ControlActionSet", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "ControlChannel\nrole: model\n\nResponsibilities:\n- default model role", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlChannel", - "span_start": 21, - "span_end": 28, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 40, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "cfcfe9a311d3a2dbdaf32ac4ccd73c0eb9a117f830591a1c0867ee97d46204ff", - "symbol_name": "ControlChannel", - "qname": "ControlChannel", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests service\n- reads and writes state attributes\n- participates in dataflow slices (5)", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlPlaneService", - "span_start": 12, - "span_end": 52, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 68, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "b13471e5916986dccffb53fab613812842965705e6b3a89ae549d30c9e91e9aa", - "symbol_name": "ControlPlaneService", - "qname": "ControlPlaneService", - "role": "pipeline_stage", - "confidence": 0.57, - "dataflow_participation": 5, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_runner.py", - "content": "UvicornThreadRunner\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (24)", - "layer": "C4_SEMANTIC_ROLES", - "title": "UvicornThreadRunner", - "span_start": 10, - "span_end": 61, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 11, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "fd55630045a02100df8877ac27d951ee08617d4598764394d48cb51fe067476a", - "symbol_name": "UvicornThreadRunner", - "qname": "UvicornThreadRunner", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 24, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "3779fdd2878b770e789a35bb2a89c9d79f13b61c26d7db1b3b683f9bb9e1623f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/health/registry.py", - "content": "HealthRegistry.__init__\n -> HealthRegistry._contributors\n -> HealthRegistry.register", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "HealthRegistry.__init__:dataflow_slice", - "span_start": 10, - "span_end": 13, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "2381dfb339d541367c3251d2a610cac9d8b3f6bd6a352e119d00a93c5ccc2b7d", - "edge_type": "dataflow_slice", - "src_symbol_id": "e8ffd58441c231de43d9e86c31eb12303d4e2bf045b2acf13d1dfe78da01f8dc", - "src_qname": "HealthRegistry.__init__", - "dst_symbol_id": "a9e1f290c346c8bb1d67af0cafeebb5bcaf29c3ed7027e33c794532743df38f2", - "dst_ref": "HealthRegistry.register", - "resolution": "resolved", - "slice_id": "2381dfb339d541367c3251d2a610cac9d8b3f6bd6a352e119d00a93c5ccc2b7d", - "root_symbol_id": "e8ffd58441c231de43d9e86c31eb12303d4e2bf045b2acf13d1dfe78da01f8dc", - "path_symbols": [ - "HealthRegistry.__init__", - "HealthRegistry._contributors", - "HealthRegistry.register" - ], - "path_symbol_ids": [ - "e8ffd58441c231de43d9e86c31eb12303d4e2bf045b2acf13d1dfe78da01f8dc", - "a9e1f290c346c8bb1d67af0cafeebb5bcaf29c3ed7027e33c794532743df38f2" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "26e6a24daa43407ba5340b74497c20153020e79f8d7828ae502aaec378dfcf75", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.start", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 20, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154", - "dst_ref": "ControlPlaneService.start", - "resolution": "resolved", - "slice_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.start" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.stop", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 25, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d", - "dst_ref": "ControlPlaneService.stop", - "resolution": "resolved", - "slice_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.stop" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._stop_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 51, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a", - "dst_ref": "ControlPlaneService._stop_async", - "resolution": "resolved", - "slice_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._stop_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/health/registry.py", - "content": "HealthRegistry.__init__\n -> HealthRegistry._contributors\n -> HealthRegistry.contributor_healths", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "HealthRegistry.__init__:dataflow_slice", - "span_start": 10, - "span_end": 16, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "d3a88a7abf16359e903e809ffc24473658fdd8198f60641fe1584fc4ac663c31", - "edge_type": "dataflow_slice", - "src_symbol_id": "e8ffd58441c231de43d9e86c31eb12303d4e2bf045b2acf13d1dfe78da01f8dc", - "src_qname": "HealthRegistry.__init__", - "dst_symbol_id": "fa7bbd8f4b64a55a5088640c30f52e84075d65f531bd7e1f6c1d7bb8d24fcbf2", - "dst_ref": "HealthRegistry.contributor_healths", - "resolution": "resolved", - "slice_id": "d3a88a7abf16359e903e809ffc24473658fdd8198f60641fe1584fc4ac663c31", - "root_symbol_id": "e8ffd58441c231de43d9e86c31eb12303d4e2bf045b2acf13d1dfe78da01f8dc", - "path_symbols": [ - "HealthRegistry.__init__", - "HealthRegistry._contributors", - "HealthRegistry.contributor_healths" - ], - "path_symbol_ids": [ - "e8ffd58441c231de43d9e86c31eb12303d4e2bf045b2acf13d1dfe78da01f8dc", - "fa7bbd8f4b64a55a5088640c30f52e84075d65f531bd7e1f6c1d7bb8d24fcbf2" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "26e6a24daa43407ba5340b74497c20153020e79f8d7828ae502aaec378dfcf75", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._start_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 47, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517", - "dst_ref": "ControlPlaneService._start_async", - "resolution": "resolved", - "slice_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._start_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.register_channel", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 17, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957", - "dst_ref": "ControlPlaneService.register_channel", - "resolution": "resolved", - "slice_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.register_channel" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "HttpControlAppFactory.create calls time.monotonic", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "HttpControlAppFactory.create:calls", - "span_start": 25, - "span_end": 25, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "3fdd0a88d10225ee74f3b84ab57e13f09f5ccc72f00e31af9ae4655411c289c0", - "edge_type": "calls", - "src_symbol_id": "4af42c2a9275d652e710a98ec48b8247236b4453a093629f8958704ff6d3cb58", - "src_qname": "HttpControlAppFactory.create", - "dst_symbol_id": null, - "dst_ref": "time.monotonic", - "resolution": "partial", - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "HttpControlAppFactory.create calls app.post", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "HttpControlAppFactory.create:calls", - "span_start": 37, - "span_end": 37, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "0e545d4b5187db7bec5ceac03071d2ad68177550c42af748fee364639e533c90", - "edge_type": "calls", - "src_symbol_id": "4af42c2a9275d652e710a98ec48b8247236b4453a093629f8958704ff6d3cb58", - "src_qname": "HttpControlAppFactory.create", - "dst_symbol_id": null, - "dst_ref": "app.post", - "resolution": "partial", - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "HttpControlAppFactory.create calls str", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "HttpControlAppFactory.create:calls", - "span_start": 27, - "span_end": 27, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "2a87c51461e31cd556508cc37fdff37b4d24c26f7f1604db30af5e8f1bda96cb", - "edge_type": "calls", - "src_symbol_id": "4af42c2a9275d652e710a98ec48b8247236b4453a093629f8958704ff6d3cb58", - "src_qname": "HttpControlAppFactory.create", - "dst_symbol_id": null, - "dst_ref": "str", - "resolution": "partial", - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "class HttpControlAppFactory:\n def create(\n self,\n health_provider: Callable[[], Awaitable[HealthPayload]],\n action_provider: Callable[[str, str], Awaitable[JSONResponse]],\n ) -> FastAPI:\n app = FastAPI(title=\"PLBA Control API\")\n\n @app.middleware(\"http\")\n async def log_api_call(request: Request, call_next): # type: ignore[no-untyped-def]\n started = time.monotonic()\n response = await call_next(request)\n response.headers[\"X-Response-Time-Ms\"] = str(int((time.monotonic() - started) * 1000))\n return response\n\n @app.get(\"/health\")\n async def health() -> JSONResponse:\n payload = await health_provider()\n status_code = 200 if payload.get(\"status\") == \"ok\" else 503\n return JSONResponse(content=payload, status_code=status_code)\n\n @app.get(\"/actions/{action}\")\n @app.post(\"/actions/{action}\")\n async def action(action: str, request: Request) -> JSONResponse:\n client_source = self._client_source(request)\n if action in {\"start\", \"stop\"}:\n LOGGER.warning(\"Control action requested: /actions/%s client=%s\", action, client_source)\n return await action_provider(action, client_source)\n\n return app\n\n def _client_source(self, request: Request) -> str:\n explicit_header = request.headers.get(\"X-Client-Source\", \"\").strip()\n if explicit_header:\n return explicit_header\n user_agent = request.headers.get(\"User-Agent\", \"\").strip()\n if user_agent:\n return f\"user-agent:{user_agent}\"\n return \"unknown\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/http_app.py:HttpControlAppFactory", - "span_start": 15, - "span_end": 53, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.http_app", - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "llm_answer": "Когда пользователь делает запрос `/health` к приложению, созданному с помощью `HttpControlAppFactory`, происходят следующие шаги:\n\n1. Запрос поступает на уровень middleware (`log_api_call`) приложения FastAPI, где измеряется время обработки запроса.\n2. После middleware запрос обрабатывается маршрутизатором FastAPI и достигает обработчика маршрута `/health`.\n3. В обработчике `/health` вызывается предоставленный внешним компонентом callable-функции `health_provider`, которая должна вернуть объект типа `HealthPayload`.\n4. Полученный от `health_provider` объект проверяется на статус «ok». Если он соответствует этому значению, возвращается успешный ответ (статус-код 200), иначе — ошибка (статус-код 503).\n5. Ответ формируется в виде объекта `JSONResponse`, содержащего результат вызова `health_provider`. \n\nТаким образом, поток начинается с входящего HTTP-запроса, проходит через middleware для логирования времени отклика и затем направляется на конечный обработчик маршрута `/health`, после чего ответ отправляется обратно клиенту.", - "summary": { - "router": { - "intent": "CODE_QA", - "sub_intent": "TRACE_FLOW", - "confidence": null - }, - "retrieval": { - "profile": "code", - "layers_hit": [ - "C0_SOURCE_CHUNKS", - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS", - "C4_SEMANTIC_ROLES" - ], - "evidence_sufficient": true - }, - "llm": { - "answer_status": "answered", - "groundedness": "grounded" - } - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "TRACE_FLOW", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "symbol_kind_hint": "unknown", - "symbol_candidates": [ - "health", - "HttpControlAppFactory" - ], - "keyword_hints": [ - "health", - "HttpControlAppFactory" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C0_SOURCE_CHUNKS": "exact_path_fetch", - "C4_SEMANTIC_ROLES": "exact_path_fetch", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C3_ENTRYPOINTS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 8, - "C4_SEMANTIC_ROLES": 8, - "C2_DEPENDENCY_GRAPH": 10, - "C3_ENTRYPOINTS": 10 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C4_SEMANTIC_ROLES": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "health HttpControlAppFactory", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Покажи как проходит запрос /health в HttpControlAppFactory", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C4_SEMANTIC_ROLES", - "query": "Покажи как проходит запрос /health в HttpControlAppFactory", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "Покажи как проходит запрос /health в HttpControlAppFactory", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 10, - "ranking_profile": "code" - }, - { - "layer": "C3_ENTRYPOINTS", - "query": "Покажи как проходит запрос /health в HttpControlAppFactory", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 10, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 4, - "candidates_after_filter": 4 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 10, - "candidates_after_filter": 10 - }, - { - "layer": "C3_ENTRYPOINTS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 3, - "candidates_after_filter": 3 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "HttpControlAppFactory", - "alternatives": [ - "HttpControlAppFactory", - "ControlActionSet", - "HealthContributor.health", - "HealthContributor" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "hit", - "hit_count": 4, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C4_SEMANTIC_ROLES", - "status": "hit", - "hit_count": 8, - "fail_reason": null - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 10, - "fail_reason": null - }, - { - "layer": "C3_ENTRYPOINTS", - "status": "hit", - "hit_count": 3, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "router": 0, - "symbol_resolution": 0, - "retrieval_total": 145, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 48, - "C0_SOURCE_CHUNKS": 16, - "C4_SEMANTIC_ROLES": 14, - "C2_DEPENDENCY_GRAPH": 56, - "C3_ENTRYPOINTS": 11 - }, - "merge_rank": 44, - "prompt_build": 0, - "llm_call": 1683 - }, - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 837, - "evidence_rows": 26, - "evidence_chars": 3507 - }, - "evidence_summary": [ - { - "layer": "C1_SYMBOL_CATALOG", - "count": 4, - "unique_paths": 3 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "count": 8, - "unique_paths": 7 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "count": 10, - "unique_paths": 3 - }, - { - "layer": "C3_ENTRYPOINTS", - "count": 3, - "unique_paths": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 1, - "unique_paths": 1 - } - ], - "prompt_template_id": "intent_code_qa_trace_flow_ru_v4", - "system_prompt_version": "v1" - }, - "router": { - "conversation_mode": "START", - "keyword_hints": [ - "health", - "HttpControlAppFactory" - ], - "path_scope": [] - }, - "llm": { - "used_evidence_count": 26, - "missing_evidence_reason": null - } - }, - "run_info": { - "case_id": "plba-v2-trace-flow-health-endpoint", - "mode": "full_chain", - "run_started_at": "2026-03-12T14:36:36", - "rag_session_id": "7d11da21-faa0-4cea-aede-aeabe069164c", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - }, - "input_request": { - "text": "Покажи как проходит запрос /health в HttpControlAppFactory", - "normalized_query": "Покажи как проходит запрос /health в HttpControlAppFactory" - }, - "steps": [ - { - "step": "intent_router", - "input": { - "query": "Покажи как проходит запрос /health в HttpControlAppFactory" - }, - "output": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Покажи как проходит запрос /health в HttpControlAppFactory" - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "TRACE_FLOW", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "symbol_kind_hint": "unknown", - "symbol_candidates": [ - "health", - "HttpControlAppFactory" - ], - "keyword_hints": [ - "health", - "HttpControlAppFactory" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "timings_ms": { - "router": 0 - } - } - }, - { - "step": "retrieval", - "input": { - "query": "Покажи как проходит запрос /health в HttpControlAppFactory" - }, - "output": { - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "HttpControlAppFactory", - "alternatives": [ - "HttpControlAppFactory", - "ControlActionSet", - "HealthContributor.health", - "HealthContributor" - ], - "confidence": 0.99 - }, - "rag_count": 26, - "rag_rows": [ - { - "path": "src/app_runtime/control/http_app.py", - "content": "class HttpControlAppFactory\nHttpControlAppFactory", - "layer": "C1_SYMBOL_CATALOG", - "title": "HttpControlAppFactory", - "span_start": 15, - "span_end": 53, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "9b3502a5fb408b273223db13264349cf500de24915b6c649d9ea8970d0dfd8e0", - "qname": "HttpControlAppFactory", - "kind": "class", - "signature": "HttpControlAppFactory", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.control.http_app", - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "class ControlActionSet\nControlActionSet", - "layer": "C1_SYMBOL_CATALOG", - "title": "ControlActionSet", - "span_start": 14, - "span_end": 18, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "46eb026cb3313415ec47b82dd22f84f4d112c9d987e8b1716dcb0baa1cce8988", - "qname": "ControlActionSet", - "kind": "class", - "signature": "ControlActionSet", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.control.base", - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/contracts/health.py", - "content": "method HealthContributor.health\nhealth(self)\nReturn contributor health state.", - "layer": "C1_SYMBOL_CATALOG", - "title": "HealthContributor.health", - "span_start": 9, - "span_end": 10, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "728cff18958d8a25e2661a0f08c83d68c3bbbfa8cef212b85dc0da2b11b3dc90", - "qname": "HealthContributor.health", - "kind": "method", - "signature": "health(self)", - "parent_symbol_id": "HealthContributor", - "package_or_module": "src.app_runtime.contracts.health", - "is_test": false, - "blob_sha": "6bd92611def7131e32d4dd34a8ed85e6cf3c67722ad27797032a632cb30dc097", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/contracts/health.py", - "content": "class HealthContributor\nHealthContributor(ABC)", - "layer": "C1_SYMBOL_CATALOG", - "title": "HealthContributor", - "span_start": 7, - "span_end": 10, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "db91ae387b89a2e9d83829754f27fa18a4055b3e72d7f31789a0b8e0bf5bba0b", - "qname": "HealthContributor", - "kind": "class", - "signature": "HealthContributor(ABC)", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.contracts.health", - "is_test": false, - "blob_sha": "6bd92611def7131e32d4dd34a8ed85e6cf3c67722ad27797032a632cb30dc097", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "HttpControlAppFactory\nrole: factory\n\nResponsibilities:\n- name suffix suggests factory", - "layer": "C4_SEMANTIC_ROLES", - "title": "HttpControlAppFactory", - "span_start": 15, - "span_end": 53, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 39, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "9b3502a5fb408b273223db13264349cf500de24915b6c649d9ea8970d0dfd8e0", - "symbol_name": "HttpControlAppFactory", - "qname": "HttpControlAppFactory", - "role": "factory", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/health/registry.py", - "content": "HealthRegistry\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (2)", - "layer": "C4_SEMANTIC_ROLES", - "title": "HealthRegistry", - "span_start": 8, - "span_end": 56, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 29, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "fd3390eb0ba29c9979466b9c2117238e0da3bb829eeb4d505cb34c9c3df7a8e8", - "symbol_name": "HealthRegistry", - "qname": "HealthRegistry", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 2, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "26e6a24daa43407ba5340b74497c20153020e79f8d7828ae502aaec378dfcf75", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/types.py", - "content": "HealthPayload\nrole: model\n\nResponsibilities:\n- default model role", - "layer": "C4_SEMANTIC_ROLES", - "title": "HealthPayload", - "span_start": 7, - "span_end": 11, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 40, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "392235d63ddf752d6e419cb8528c93fe070d1bc02d3c87ba6a897baac810cf5d", - "symbol_name": "HealthPayload", - "qname": "HealthPayload", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "448a02e4a432b5ab65b246b2bd24a32a6f127b9d2091ea73b53ee3c0a2f53bb3", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/contracts/health.py", - "content": "HealthContributor\nrole: model\n\nResponsibilities:\n- default model role", - "layer": "C4_SEMANTIC_ROLES", - "title": "HealthContributor", - "span_start": 7, - "span_end": 10, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 40, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "db91ae387b89a2e9d83829754f27fa18a4055b3e72d7f31789a0b8e0bf5bba0b", - "symbol_name": "HealthContributor", - "qname": "HealthContributor", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "6bd92611def7131e32d4dd34a8ed85e6cf3c67722ad27797032a632cb30dc097", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "ControlActionSet\nrole: model\n\nResponsibilities:\n- default model role", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlActionSet", - "span_start": 14, - "span_end": 18, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 40, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "46eb026cb3313415ec47b82dd22f84f4d112c9d987e8b1716dcb0baa1cce8988", - "symbol_name": "ControlActionSet", - "qname": "ControlActionSet", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "ControlChannel\nrole: model\n\nResponsibilities:\n- default model role", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlChannel", - "span_start": 21, - "span_end": 28, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 40, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "cfcfe9a311d3a2dbdaf32ac4ccd73c0eb9a117f830591a1c0867ee97d46204ff", - "symbol_name": "ControlChannel", - "qname": "ControlChannel", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests service\n- reads and writes state attributes\n- participates in dataflow slices (5)", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlPlaneService", - "span_start": 12, - "span_end": 52, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 68, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "b13471e5916986dccffb53fab613812842965705e6b3a89ae549d30c9e91e9aa", - "symbol_name": "ControlPlaneService", - "qname": "ControlPlaneService", - "role": "pipeline_stage", - "confidence": 0.57, - "dataflow_participation": 5, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_runner.py", - "content": "UvicornThreadRunner\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (24)", - "layer": "C4_SEMANTIC_ROLES", - "title": "UvicornThreadRunner", - "span_start": 10, - "span_end": 61, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 11, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "fd55630045a02100df8877ac27d951ee08617d4598764394d48cb51fe067476a", - "symbol_name": "UvicornThreadRunner", - "qname": "UvicornThreadRunner", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 24, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "3779fdd2878b770e789a35bb2a89c9d79f13b61c26d7db1b3b683f9bb9e1623f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/health/registry.py", - "content": "HealthRegistry.__init__\n -> HealthRegistry._contributors\n -> HealthRegistry.register", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "HealthRegistry.__init__:dataflow_slice", - "span_start": 10, - "span_end": 13, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "2381dfb339d541367c3251d2a610cac9d8b3f6bd6a352e119d00a93c5ccc2b7d", - "edge_type": "dataflow_slice", - "src_symbol_id": "e8ffd58441c231de43d9e86c31eb12303d4e2bf045b2acf13d1dfe78da01f8dc", - "src_qname": "HealthRegistry.__init__", - "dst_symbol_id": "a9e1f290c346c8bb1d67af0cafeebb5bcaf29c3ed7027e33c794532743df38f2", - "dst_ref": "HealthRegistry.register", - "resolution": "resolved", - "slice_id": "2381dfb339d541367c3251d2a610cac9d8b3f6bd6a352e119d00a93c5ccc2b7d", - "root_symbol_id": "e8ffd58441c231de43d9e86c31eb12303d4e2bf045b2acf13d1dfe78da01f8dc", - "path_symbols": [ - "HealthRegistry.__init__", - "HealthRegistry._contributors", - "HealthRegistry.register" - ], - "path_symbol_ids": [ - "e8ffd58441c231de43d9e86c31eb12303d4e2bf045b2acf13d1dfe78da01f8dc", - "a9e1f290c346c8bb1d67af0cafeebb5bcaf29c3ed7027e33c794532743df38f2" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "26e6a24daa43407ba5340b74497c20153020e79f8d7828ae502aaec378dfcf75", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.start", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 20, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154", - "dst_ref": "ControlPlaneService.start", - "resolution": "resolved", - "slice_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.start" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.stop", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 25, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d", - "dst_ref": "ControlPlaneService.stop", - "resolution": "resolved", - "slice_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.stop" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._stop_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 51, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a", - "dst_ref": "ControlPlaneService._stop_async", - "resolution": "resolved", - "slice_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._stop_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/health/registry.py", - "content": "HealthRegistry.__init__\n -> HealthRegistry._contributors\n -> HealthRegistry.contributor_healths", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "HealthRegistry.__init__:dataflow_slice", - "span_start": 10, - "span_end": 16, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "d3a88a7abf16359e903e809ffc24473658fdd8198f60641fe1584fc4ac663c31", - "edge_type": "dataflow_slice", - "src_symbol_id": "e8ffd58441c231de43d9e86c31eb12303d4e2bf045b2acf13d1dfe78da01f8dc", - "src_qname": "HealthRegistry.__init__", - "dst_symbol_id": "fa7bbd8f4b64a55a5088640c30f52e84075d65f531bd7e1f6c1d7bb8d24fcbf2", - "dst_ref": "HealthRegistry.contributor_healths", - "resolution": "resolved", - "slice_id": "d3a88a7abf16359e903e809ffc24473658fdd8198f60641fe1584fc4ac663c31", - "root_symbol_id": "e8ffd58441c231de43d9e86c31eb12303d4e2bf045b2acf13d1dfe78da01f8dc", - "path_symbols": [ - "HealthRegistry.__init__", - "HealthRegistry._contributors", - "HealthRegistry.contributor_healths" - ], - "path_symbol_ids": [ - "e8ffd58441c231de43d9e86c31eb12303d4e2bf045b2acf13d1dfe78da01f8dc", - "fa7bbd8f4b64a55a5088640c30f52e84075d65f531bd7e1f6c1d7bb8d24fcbf2" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "26e6a24daa43407ba5340b74497c20153020e79f8d7828ae502aaec378dfcf75", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._start_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 47, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517", - "dst_ref": "ControlPlaneService._start_async", - "resolution": "resolved", - "slice_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._start_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.register_channel", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 17, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957", - "dst_ref": "ControlPlaneService.register_channel", - "resolution": "resolved", - "slice_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.register_channel" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "HttpControlAppFactory.create calls time.monotonic", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "HttpControlAppFactory.create:calls", - "span_start": 25, - "span_end": 25, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "3fdd0a88d10225ee74f3b84ab57e13f09f5ccc72f00e31af9ae4655411c289c0", - "edge_type": "calls", - "src_symbol_id": "4af42c2a9275d652e710a98ec48b8247236b4453a093629f8958704ff6d3cb58", - "src_qname": "HttpControlAppFactory.create", - "dst_symbol_id": null, - "dst_ref": "time.monotonic", - "resolution": "partial", - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "HttpControlAppFactory.create calls app.post", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "HttpControlAppFactory.create:calls", - "span_start": 37, - "span_end": 37, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "0e545d4b5187db7bec5ceac03071d2ad68177550c42af748fee364639e533c90", - "edge_type": "calls", - "src_symbol_id": "4af42c2a9275d652e710a98ec48b8247236b4453a093629f8958704ff6d3cb58", - "src_qname": "HttpControlAppFactory.create", - "dst_symbol_id": null, - "dst_ref": "app.post", - "resolution": "partial", - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "HttpControlAppFactory.create calls str", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "HttpControlAppFactory.create:calls", - "span_start": 27, - "span_end": 27, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "2a87c51461e31cd556508cc37fdff37b4d24c26f7f1604db30af5e8f1bda96cb", - "edge_type": "calls", - "src_symbol_id": "4af42c2a9275d652e710a98ec48b8247236b4453a093629f8958704ff6d3cb58", - "src_qname": "HttpControlAppFactory.create", - "dst_symbol_id": null, - "dst_ref": "str", - "resolution": "partial", - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "class HttpControlAppFactory:\n def create(\n self,\n health_provider: Callable[[], Awaitable[HealthPayload]],\n action_provider: Callable[[str, str], Awaitable[JSONResponse]],\n ) -> FastAPI:\n app = FastAPI(title=\"PLBA Control API\")\n\n @app.middleware(\"http\")\n async def log_api_call(request: Request, call_next): # type: ignore[no-untyped-def]\n started = time.monotonic()\n response = await call_next(request)\n response.headers[\"X-Response-Time-Ms\"] = str(int((time.monotonic() - started) * 1000))\n return response\n\n @app.get(\"/health\")\n async def health() -> JSONResponse:\n payload = await health_provider()\n status_code = 200 if payload.get(\"status\") == \"ok\" else 503\n return JSONResponse(content=payload, status_code=status_code)\n\n @app.get(\"/actions/{action}\")\n @app.post(\"/actions/{action}\")\n async def action(action: str, request: Request) -> JSONResponse:\n client_source = self._client_source(request)\n if action in {\"start\", \"stop\"}:\n LOGGER.warning(\"Control action requested: /actions/%s client=%s\", action, client_source)\n return await action_provider(action, client_source)\n\n return app\n\n def _client_source(self, request: Request) -> str:\n explicit_header = request.headers.get(\"X-Client-Source\", \"\").strip()\n if explicit_header:\n return explicit_header\n user_agent = request.headers.get(\"User-Agent\", \"\").strip()\n if user_agent:\n return f\"user-agent:{user_agent}\"\n return \"unknown\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/http_app.py:HttpControlAppFactory", - "span_start": 15, - "span_end": 53, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.http_app", - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ] - }, - "diagnostics": { - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C0_SOURCE_CHUNKS": "exact_path_fetch", - "C4_SEMANTIC_ROLES": "exact_path_fetch", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C3_ENTRYPOINTS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 8, - "C4_SEMANTIC_ROLES": 8, - "C2_DEPENDENCY_GRAPH": 10, - "C3_ENTRYPOINTS": 10 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C4_SEMANTIC_ROLES": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "health HttpControlAppFactory", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Покажи как проходит запрос /health в HttpControlAppFactory", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C4_SEMANTIC_ROLES", - "query": "Покажи как проходит запрос /health в HttpControlAppFactory", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "Покажи как проходит запрос /health в HttpControlAppFactory", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 10, - "ranking_profile": "code" - }, - { - "layer": "C3_ENTRYPOINTS", - "query": "Покажи как проходит запрос /health в HttpControlAppFactory", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 10, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 4, - "candidates_after_filter": 4 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 10, - "candidates_after_filter": 10 - }, - { - "layer": "C3_ENTRYPOINTS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 3, - "candidates_after_filter": 3 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "HttpControlAppFactory", - "alternatives": [ - "HttpControlAppFactory", - "ControlActionSet", - "HealthContributor.health", - "HealthContributor" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "hit", - "hit_count": 4, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C4_SEMANTIC_ROLES", - "status": "hit", - "hit_count": 8, - "fail_reason": null - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 10, - "fail_reason": null - }, - { - "layer": "C3_ENTRYPOINTS", - "status": "hit", - "hit_count": 3, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "symbol_resolution": 0, - "retrieval_total": 145, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 48, - "C0_SOURCE_CHUNKS": 16, - "C4_SEMANTIC_ROLES": 14, - "C2_DEPENDENCY_GRAPH": 56, - "C3_ENTRYPOINTS": 11 - }, - "merge_rank": 44 - } - } - }, - { - "step": "llm_answer", - "input": { - "query": "Покажи как проходит запрос /health в HttpControlAppFactory", - "rag_count": 26 - }, - "output": { - "llm_answer": "Когда пользователь делает запрос `/health` к приложению, созданному с помощью `HttpControlAppFactory`, происходят следующие шаги:\n\n1. Запрос поступает на уровень middleware (`log_api_call`) приложения FastAPI, где измеряется время обработки запроса.\n2. После middleware запрос обрабатывается маршрутизатором FastAPI и достигает обработчика маршрута `/health`.\n3. В обработчике `/health` вызывается предоставленный внешним компонентом callable-функции `health_provider`, которая должна вернуть объект типа `HealthPayload`.\n4. Полученный от `health_provider` объект проверяется на статус «ok». Если он соответствует этому значению, возвращается успешный ответ (статус-код 200), иначе — ошибка (статус-код 503).\n5. Ответ формируется в виде объекта `JSONResponse`, содержащего результат вызова `health_provider`. \n\nТаким образом, поток начинается с входящего HTTP-запроса, проходит через middleware для логирования времени отклика и затем направляется на конечный обработчик маршрута `/health`, после чего ответ отправляется обратно клиенту." - }, - "diagnostics": { - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 837, - "evidence_rows": 26, - "evidence_chars": 3507 - }, - "evidence_summary": [ - { - "layer": "C1_SYMBOL_CATALOG", - "count": 4, - "unique_paths": 3 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "count": 8, - "unique_paths": 7 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "count": 10, - "unique_paths": 3 - }, - { - "layer": "C3_ENTRYPOINTS", - "count": 3, - "unique_paths": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 1, - "unique_paths": 1 - } - ], - "prompt_template_id": "intent_code_qa_trace_flow_ru_v4", - "system_prompt_version": "v1" - }, - "timings_ms": { - "prompt_build": 0, - "llm_call": 1683 - } - } - } - ] - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_143636/full_chain_plba_code_subintents_v2_plba-v2-trace-flow-health-endpoint.md b/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_143636/full_chain_plba_code_subintents_v2_plba-v2-trace-flow-health-endpoint.md deleted file mode 100644 index c6116b4..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_143636/full_chain_plba_code_subintents_v2_plba-v2-trace-flow-health-endpoint.md +++ /dev/null @@ -1,35 +0,0 @@ -# plba-v2-trace-flow-health-endpoint - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_subintents_v2.yaml -- runner: runtime -- mode: full_chain -- passed: True - -## Query -Покажи как проходит запрос /health в HttpControlAppFactory - -## Actual -{ - "intent": "CODE_QA", - "sub_intent": "TRACE_FLOW", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 26, - "llm_answer": "Когда пользователь делает запрос `/health` к приложению, созданному с помощью `HttpControlAppFactory`, происходят следующие шаги:\n\n1. Запрос поступает на уровень middleware (`log_api_call`) приложения FastAPI, где измеряется время обработки запроса.\n2. После middleware запрос обрабатывается маршрутизатором FastAPI и достигает обработчика маршрута `/health`.\n3. В обработчике `/health` вызывается предоставленный внешним компонентом callable-функции `health_provider`, которая должна вернуть объект типа `HealthPayload`.\n4. Полученный от `health_provider` объект проверяется на статус «ok». Если он соответствует этому значению, возвращается успешный ответ (статус-код 200), иначе — ошибка (статус-код 503).\n5. Ответ формируется в виде объекта `JSONResponse`, содержащего результат вызова `health_provider`. \n\nТаким образом, поток начинается с входящего HTTP-запроса, проходит через middleware для логирования времени отклика и затем направляется на конечный обработчик маршрута `/health`, после чего ответ отправляется обратно клиенту.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "health", - "HttpControlAppFactory" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] -} - -## Mismatches -- none \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_143636/full_chain_plba_code_subintents_v2_plba-v2-trace-flow-runtime-start.json b/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_143636/full_chain_plba_code_subintents_v2_plba-v2-trace-flow-runtime-start.json deleted file mode 100644 index 6c361e9..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_143636/full_chain_plba_code_subintents_v2_plba-v2-trace-flow-runtime-start.json +++ /dev/null @@ -1,2964 +0,0 @@ -{ - "case_id": "plba-v2-trace-flow-runtime-start", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_subintents_v2.yaml", - "runner": "runtime", - "mode": "full_chain", - "actual": { - "intent": "CODE_QA", - "sub_intent": "TRACE_FLOW", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 23, - "llm_answer": "При запуске объекта `RuntimeManager` выполняются следующие последовательные шаги:\n\n1. В конструкторе класса (`__init__`) происходит инициализация атрибутов объекта с использованием переданных параметров или дефолтных значений для конфигураций, служб, трассировки, здоровья, логирования и управления рабочими процессами.\n \n2. Метод `self._register_core_services()` регистрирует основные сервисы внутри модуля регистрации (`registry`), что подразумевает первоначальную настройку среды исполнения.\n\nТаким образом, общий поток выглядит следующим образом:\n\n```python\nИнициализация объектов и их атрибутов\nruntime_manager = RuntimeManager(config, services, traces, health, logs, workers, control_plane)\nРегистрация основных сервисов приложения\nruntime_manager._register_core_services()\n```\n\nНа текущий момент восстановить дальнейший точный поток выполнения не представляется возможным ввиду недостаточной информации о следующих шагах после вызова `_register_core_services()`.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "RuntimeManager" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "passed": true, - "mismatches": [], - "details": { - "case_id": "plba-v2-trace-flow-runtime-start", - "text": "Покажи поток выполнения при запуске RuntimeManager", - "mode": "full_chain", - "run_started_at": "2026-03-12T14:36:36", - "rag_session_id": "7d11da21-faa0-4cea-aede-aeabe069164c", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Покажи поток выполнения при запуске RuntimeManager", - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "RuntimeManager", - "alternatives": [ - "RuntimeManager" - ], - "confidence": 0.99 - }, - "rag_count": 23, - "rag_rows": [ - { - "path": "src/app_runtime/core/runtime.py", - "content": "class RuntimeManager\nRuntimeManager", - "layer": "C1_SYMBOL_CATALOG", - "title": "RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "7e4a9381328c5803bbc6179458612fc4e947d928aa7bf8b4b2bebb2c8592f758", - "qname": "RuntimeManager", - "kind": "class", - "signature": "RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.core.runtime", - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests manager\n- orchestrates role-like calls (4)\n- reads and writes state attributes\n- participates in dataflow slices (50)", - "layer": "C4_SEMANTIC_ROLES", - "title": "RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 43, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "7e4a9381328c5803bbc6179458612fc4e947d928aa7bf8b4b2bebb2c8592f758", - "symbol_name": "RuntimeManager", - "qname": "RuntimeManager", - "role": "pipeline_stage", - "confidence": 0.67, - "dataflow_participation": 50, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "ControlChannel\nrole: model\n\nResponsibilities:\n- default model role", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlChannel", - "span_start": 21, - "span_end": 28, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 40, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "cfcfe9a311d3a2dbdaf32ac4ccd73c0eb9a117f830591a1c0867ee97d46204ff", - "symbol_name": "ControlChannel", - "qname": "ControlChannel", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "ControlActionSet\nrole: model\n\nResponsibilities:\n- default model role", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlActionSet", - "span_start": 14, - "span_end": 18, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 40, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "46eb026cb3313415ec47b82dd22f84f4d112c9d987e8b1716dcb0baa1cce8988", - "symbol_name": "ControlActionSet", - "qname": "ControlActionSet", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests service\n- reads and writes state attributes\n- participates in dataflow slices (5)", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlPlaneService", - "span_start": 12, - "span_end": 52, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 68, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "b13471e5916986dccffb53fab613812842965705e6b3a89ae549d30c9e91e9aa", - "symbol_name": "ControlPlaneService", - "qname": "ControlPlaneService", - "role": "pipeline_stage", - "confidence": 0.57, - "dataflow_participation": 5, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_runner.py", - "content": "UvicornThreadRunner\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (24)", - "layer": "C4_SEMANTIC_ROLES", - "title": "UvicornThreadRunner", - "span_start": 10, - "span_end": 61, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 11, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "fd55630045a02100df8877ac27d951ee08617d4598764394d48cb51fe067476a", - "symbol_name": "UvicornThreadRunner", - "qname": "UvicornThreadRunner", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 24, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "3779fdd2878b770e789a35bb2a89c9d79f13b61c26d7db1b3b683f9bb9e1623f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (10)", - "layer": "C4_SEMANTIC_ROLES", - "title": "HttpControlChannel", - "span_start": 12, - "span_end": 57, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 21, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "1c9fbdc24819e5604c26ea55428a74310f03a03e1af197ed84846af61e42fdb0", - "symbol_name": "HttpControlChannel", - "qname": "HttpControlChannel", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 10, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "HttpControlAppFactory\nrole: factory\n\nResponsibilities:\n- name suffix suggests factory", - "layer": "C4_SEMANTIC_ROLES", - "title": "HttpControlAppFactory", - "span_start": 15, - "span_end": 53, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 39, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "9b3502a5fb408b273223db13264349cf500de24915b6c649d9ea8970d0dfd8e0", - "symbol_name": "HttpControlAppFactory", - "qname": "HttpControlAppFactory", - "role": "factory", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/persistence/workflow_persistence.py", - "content": "WorkflowPersistence\nrole: pipeline_stage\n\nResponsibilities:\n- orchestrates role-like calls (2)\n- reads and writes state attributes\n- participates in dataflow slices (16)", - "layer": "C4_SEMANTIC_ROLES", - "title": "WorkflowPersistence", - "span_start": 8, - "span_end": 54, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 15, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "7bd01ee45cf31f2d5c2e3e51656254860ac785d10cef9e0852cd4fba90857bae", - "symbol_name": "WorkflowPersistence", - "qname": "WorkflowPersistence", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 16, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "80e9410ddc639789b4353c2a1a757ba8d0d5b5bb6075b0b263b61551f04ae1f0", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager.add_config_file", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 32, - "span_end": 52, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "a23b8a11ebdb12708b60c96ea12a69f7f042082f1adfddd572444e246d81d167", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "57ffbd4f0d9fdf3507c2b8624312ce211f3d02fdf86a57a8ec90778d8a7b498d", - "dst_ref": "RuntimeManager.add_config_file", - "resolution": "resolved", - "slice_id": "a23b8a11ebdb12708b60c96ea12a69f7f042082f1adfddd572444e246d81d167", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager.add_config_file" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "57ffbd4f0d9fdf3507c2b8624312ce211f3d02fdf86a57a8ec90778d8a7b498d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.services\n -> RuntimeManager.__init__", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 33, - "span_end": 39, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "d43af85989222ee6d788ce418cdcb217c7ff044cfb915e3bdbd184417dc7bd61", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "dst_ref": "RuntimeManager.__init__", - "resolution": "resolved", - "slice_id": "d43af85989222ee6d788ce418cdcb217c7ff044cfb915e3bdbd184417dc7bd61", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.services", - "RuntimeManager.__init__" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.stop", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 25, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d", - "dst_ref": "ControlPlaneService.stop", - "resolution": "resolved", - "slice_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.stop" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._stop_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 51, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a", - "dst_ref": "ControlPlaneService._stop_async", - "resolution": "resolved", - "slice_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._stop_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager.start", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 32, - "span_end": 59, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "98312ace7fc62b1c7194c5aa1732b6ef736eae1668a3a120dd1ecd5ab1d64f7a", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "77a7b260193018845e4e204df094ab89cfd7c82ee4e822b3a83ad4cd945f9cb1", - "dst_ref": "RuntimeManager.start", - "resolution": "resolved", - "slice_id": "98312ace7fc62b1c7194c5aa1732b6ef736eae1668a3a120dd1ecd5ab1d64f7a", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager.start" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "77a7b260193018845e4e204df094ab89cfd7c82ee4e822b3a83ad4cd945f9cb1" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager._register_core_services", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 32, - "span_end": 127, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "3e5811f3b511fa0cabe363f5d01f2ac5fa039bc8b93f7ee108323e1f5f45a293", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "972d6057a6caac9cf31ebc1e29c6f39f71b10d4cc170dec57cf875ba458549c6", - "dst_ref": "RuntimeManager._register_core_services", - "resolution": "resolved", - "slice_id": "3e5811f3b511fa0cabe363f5d01f2ac5fa039bc8b93f7ee108323e1f5f45a293", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager._register_core_services" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "972d6057a6caac9cf31ebc1e29c6f39f71b10d4cc170dec57cf875ba458549c6" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.register_channel", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 17, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957", - "dst_ref": "ControlPlaneService.register_channel", - "resolution": "resolved", - "slice_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.register_channel" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.start", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 20, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154", - "dst_ref": "ControlPlaneService.start", - "resolution": "resolved", - "slice_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.start" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._start_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 47, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517", - "dst_ref": "ControlPlaneService._start_async", - "resolution": "resolved", - "slice_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._start_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.services\n -> RuntimeManager._register_core_services", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 33, - "span_end": 127, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "aac6f9dda73963b977083a892bee39a48eca4fbd7404787e022ecf4ebedec65d", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "972d6057a6caac9cf31ebc1e29c6f39f71b10d4cc170dec57cf875ba458549c6", - "dst_ref": "RuntimeManager._register_core_services", - "resolution": "resolved", - "slice_id": "aac6f9dda73963b977083a892bee39a48eca4fbd7404787e022ecf4ebedec65d", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.services", - "RuntimeManager._register_core_services" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "972d6057a6caac9cf31ebc1e29c6f39f71b10d4cc170dec57cf875ba458549c6" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "class RuntimeManager:\n ACTION_TIMEOUT_SECONDS = 10.0\n ACTION_POLL_INTERVAL_SECONDS = 0.05\n\n def __init__(\n self,\n configuration: ConfigurationManager | None = None,\n services: ServiceContainer | None = None,\n traces: TraceService | None = None,\n health: HealthRegistry | None = None,\n logs: LogManager | None = None,\n workers: WorkerSupervisor | None = None,\n control_plane: ControlPlaneService | None = None,\n ) -> None:\n self.configuration = configuration or ConfigurationManager()\n self.services = services or ServiceContainer()\n self.traces = traces or TraceService()\n self.health = health or HealthRegistry()\n self.logs = logs or LogManager()\n self.workers = workers or WorkerSupervisor()\n self.control_plane = control_plane or ControlPlaneService()\n self.registry = ModuleRegistry(self.services)\n self._started = False\n self._state = LifecycleState.IDLE\n self._core_registered = False\n self._workers_registered = False\n self._register_core_services()\n\n def register_module(self, module: ApplicationModule) -> None:\n self.registry.register_module(module.name)\n module.register(self.registry)\n\n def add_config_file(self, path: str) -> FileConfigProvider:\n provider = FileConfigProvider(path)\n self.configuration.add_provider(provider)\n return provider\n\n def start(self, *, start_control_plane: bool = True) -> None:\n if self._started:\n return\n self._state = LifecycleState.STARTING\n config = self.configuration.load()\n self.logs.apply_config(config)\n self._register_health_contributors()\n self._register_workers()\n self.workers.start()\n if start_control_plane:\n self.control_plane.start(self)\n self._started = True\n self._refresh_state()\n\n def stop(self, timeout: float = 30.0, force: bool = False, stop_control_plane: bool = True) -> None:\n if not self._started:\n return\n self._state = LifecycleState.STOPPING\n self.workers.stop(timeout=timeout, force=force)\n if stop_control_plane:\n self.control_plane.stop()\n self._started = False\n self._state = LifecycleState.STOPPED\n\n def status(self) -> dict[str, object]:\n self._refresh_state()\n return self.control_plane.snapshot(self)\n\n def current_health(self) -> HealthPayload:\n self._refresh_state()\n return self.health.payload(self._state, self.workers.healths())\n\n async def health_status(self) -> HealthPayload:\n return self.current_health()\n\n async def start_runtime(self) -> dict[str, object] | str:\n self._refresh_state()\n if self._started:\n return \"runtime already running\"\n if self._state == LifecycleState.STOPPING:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n\n self.start(start_control_plane=False)\n started = self._wait_for_state({LifecycleState.IDLE, LifecycleState.BUSY}, timeout=self.ACTION_TIMEOUT_SECONDS)\n if started:\n return self._action_detail(\"runtime started\", timed_out=False)\n return self._action_detail(\"runtime start is still in progress\", timed_out=True)\n\n async def stop_runtime(self) -> dict[str, object] | str:\n self._refresh_state()\n if not self._started:\n if self._state == LifecycleState.STOPPING:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n return \"runtime already stopped\"\n\n self._state = LifecycleState.STOPPING\n try:\n self.workers.stop(timeout=self.ACTION_TIMEOUT_SECONDS, force=False)\n except TimeoutError:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n\n self._started = False\n self._state = LifecycleState.STOPPED\n return self._action_detail(\"runtime stopped\", timed_out=False)\n\n async def runtime_status(self) -> str:\n self._refresh_state()\n return self._state.value\n\n def _register_core_services(self) -> None:\n if self._core_registered:\n return\n self.services.register(\"configuration\", self.configuration)\n self.services.register(\"traces\", self.traces)\n self.services.register(\"health\", self.health)\n self.services.register(\"logs\", self.logs)\n self.services.register(\"workers\", self.workers)\n self.services.register(\"control_plane\", self.control_plane)\n self._core_registered = True\n\n def _register_health_contributors(self) -> None:\n for contributor in self.registry.health_contributors:\n self.health.register(contributor)\n\n def _register_workers(self) -> None:\n if self._workers_registered:\n return\n for worker in self.registry.workers:\n self.workers.register(worker)\n self._workers_registered = True\n\n def _refresh_state(self) -> None:\n lifecycle = self.workers.lifecycle_state()\n\n if self._state == LifecycleState.STOPPING:\n if lifecycle == LifecycleState.STOPPED:\n self._started = False\n self._state = LifecycleState.STOPPED\n return\n\n if not self._started:\n if lifecycle == LifecycleState.STOPPED:\n self._state = LifecycleState.STOPPED\n return\n\n self._state = lifecycle\n\n def _wait_for_state(self, target_states: set[LifecycleState], *, timeout: float) -> bool:\n deadline = monotonic() + timeout\n while monotonic() < deadline:\n self._refresh_state()\n if self._state in target_states:\n return True\n sleep(self.ACTION_POLL_INTERVAL_SECONDS)\n self._refresh_state()\n return self._state in target_states\n\n def _action_detail(self, message: str, *, timed_out: bool) -> dict[str, object]:\n self._refresh_state()\n return {\n \"message\": message,\n \"state\": self._state.value,\n \"timed_out\": timed_out,\n \"workers\": self.workers.snapshot(),\n }", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/core/runtime.py:RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.core.runtime", - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "llm_answer": "При запуске объекта `RuntimeManager` выполняются следующие последовательные шаги:\n\n1. В конструкторе класса (`__init__`) происходит инициализация атрибутов объекта с использованием переданных параметров или дефолтных значений для конфигураций, служб, трассировки, здоровья, логирования и управления рабочими процессами.\n \n2. Метод `self._register_core_services()` регистрирует основные сервисы внутри модуля регистрации (`registry`), что подразумевает первоначальную настройку среды исполнения.\n\nТаким образом, общий поток выглядит следующим образом:\n\n```python\nИнициализация объектов и их атрибутов\nruntime_manager = RuntimeManager(config, services, traces, health, logs, workers, control_plane)\nРегистрация основных сервисов приложения\nruntime_manager._register_core_services()\n```\n\nНа текущий момент восстановить дальнейший точный поток выполнения не представляется возможным ввиду недостаточной информации о следующих шагах после вызова `_register_core_services()`.", - "summary": { - "router": { - "intent": "CODE_QA", - "sub_intent": "TRACE_FLOW", - "confidence": null - }, - "retrieval": { - "profile": "code", - "layers_hit": [ - "C0_SOURCE_CHUNKS", - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS", - "C4_SEMANTIC_ROLES" - ], - "evidence_sufficient": true - }, - "llm": { - "answer_status": "answered", - "groundedness": "grounded" - } - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "TRACE_FLOW", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "RuntimeManager" - ], - "keyword_hints": [ - "RuntimeManager" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C0_SOURCE_CHUNKS": "exact_path_fetch", - "C4_SEMANTIC_ROLES": "exact_path_fetch", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C3_ENTRYPOINTS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 8, - "C4_SEMANTIC_ROLES": 8, - "C2_DEPENDENCY_GRAPH": 10, - "C3_ENTRYPOINTS": 10 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C4_SEMANTIC_ROLES": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Покажи поток выполнения при запуске RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C4_SEMANTIC_ROLES", - "query": "Покажи поток выполнения при запуске RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "Покажи поток выполнения при запуске RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 10, - "ranking_profile": "code" - }, - { - "layer": "C3_ENTRYPOINTS", - "query": "Покажи поток выполнения при запуске RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 10, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 1, - "candidates_after_filter": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 10, - "candidates_after_filter": 10 - }, - { - "layer": "C3_ENTRYPOINTS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 3, - "candidates_after_filter": 3 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "RuntimeManager", - "alternatives": [ - "RuntimeManager" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C4_SEMANTIC_ROLES", - "status": "hit", - "hit_count": 8, - "fail_reason": null - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 10, - "fail_reason": null - }, - { - "layer": "C3_ENTRYPOINTS", - "status": "hit", - "hit_count": 3, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "router": 0, - "symbol_resolution": 0, - "retrieval_total": 170, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 55, - "C0_SOURCE_CHUNKS": 24, - "C4_SEMANTIC_ROLES": 19, - "C2_DEPENDENCY_GRAPH": 57, - "C3_ENTRYPOINTS": 13 - }, - "merge_rank": 23, - "prompt_build": 0, - "llm_call": 1454 - }, - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 859, - "evidence_rows": 23, - "evidence_chars": 8302 - }, - "evidence_summary": [ - { - "layer": "C1_SYMBOL_CATALOG", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "count": 8, - "unique_paths": 7 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "count": 10, - "unique_paths": 2 - }, - { - "layer": "C3_ENTRYPOINTS", - "count": 3, - "unique_paths": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 1, - "unique_paths": 1 - } - ], - "prompt_template_id": "intent_code_qa_trace_flow_ru_v4", - "system_prompt_version": "v1" - }, - "router": { - "conversation_mode": "START", - "keyword_hints": [ - "RuntimeManager" - ], - "path_scope": [] - }, - "llm": { - "used_evidence_count": 23, - "missing_evidence_reason": null - } - }, - "run_info": { - "case_id": "plba-v2-trace-flow-runtime-start", - "mode": "full_chain", - "run_started_at": "2026-03-12T14:36:36", - "rag_session_id": "7d11da21-faa0-4cea-aede-aeabe069164c", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - }, - "input_request": { - "text": "Покажи поток выполнения при запуске RuntimeManager", - "normalized_query": "Покажи поток выполнения при запуске RuntimeManager" - }, - "steps": [ - { - "step": "intent_router", - "input": { - "query": "Покажи поток выполнения при запуске RuntimeManager" - }, - "output": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Покажи поток выполнения при запуске RuntimeManager" - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "TRACE_FLOW", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "RuntimeManager" - ], - "keyword_hints": [ - "RuntimeManager" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "timings_ms": { - "router": 0 - } - } - }, - { - "step": "retrieval", - "input": { - "query": "Покажи поток выполнения при запуске RuntimeManager" - }, - "output": { - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "RuntimeManager", - "alternatives": [ - "RuntimeManager" - ], - "confidence": 0.99 - }, - "rag_count": 23, - "rag_rows": [ - { - "path": "src/app_runtime/core/runtime.py", - "content": "class RuntimeManager\nRuntimeManager", - "layer": "C1_SYMBOL_CATALOG", - "title": "RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "7e4a9381328c5803bbc6179458612fc4e947d928aa7bf8b4b2bebb2c8592f758", - "qname": "RuntimeManager", - "kind": "class", - "signature": "RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.core.runtime", - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests manager\n- orchestrates role-like calls (4)\n- reads and writes state attributes\n- participates in dataflow slices (50)", - "layer": "C4_SEMANTIC_ROLES", - "title": "RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 43, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "7e4a9381328c5803bbc6179458612fc4e947d928aa7bf8b4b2bebb2c8592f758", - "symbol_name": "RuntimeManager", - "qname": "RuntimeManager", - "role": "pipeline_stage", - "confidence": 0.67, - "dataflow_participation": 50, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "ControlChannel\nrole: model\n\nResponsibilities:\n- default model role", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlChannel", - "span_start": 21, - "span_end": 28, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 40, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "cfcfe9a311d3a2dbdaf32ac4ccd73c0eb9a117f830591a1c0867ee97d46204ff", - "symbol_name": "ControlChannel", - "qname": "ControlChannel", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "ControlActionSet\nrole: model\n\nResponsibilities:\n- default model role", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlActionSet", - "span_start": 14, - "span_end": 18, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 40, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "46eb026cb3313415ec47b82dd22f84f4d112c9d987e8b1716dcb0baa1cce8988", - "symbol_name": "ControlActionSet", - "qname": "ControlActionSet", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests service\n- reads and writes state attributes\n- participates in dataflow slices (5)", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlPlaneService", - "span_start": 12, - "span_end": 52, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 68, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "b13471e5916986dccffb53fab613812842965705e6b3a89ae549d30c9e91e9aa", - "symbol_name": "ControlPlaneService", - "qname": "ControlPlaneService", - "role": "pipeline_stage", - "confidence": 0.57, - "dataflow_participation": 5, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_runner.py", - "content": "UvicornThreadRunner\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (24)", - "layer": "C4_SEMANTIC_ROLES", - "title": "UvicornThreadRunner", - "span_start": 10, - "span_end": 61, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 11, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "fd55630045a02100df8877ac27d951ee08617d4598764394d48cb51fe067476a", - "symbol_name": "UvicornThreadRunner", - "qname": "UvicornThreadRunner", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 24, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "3779fdd2878b770e789a35bb2a89c9d79f13b61c26d7db1b3b683f9bb9e1623f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (10)", - "layer": "C4_SEMANTIC_ROLES", - "title": "HttpControlChannel", - "span_start": 12, - "span_end": 57, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 21, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "1c9fbdc24819e5604c26ea55428a74310f03a03e1af197ed84846af61e42fdb0", - "symbol_name": "HttpControlChannel", - "qname": "HttpControlChannel", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 10, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "HttpControlAppFactory\nrole: factory\n\nResponsibilities:\n- name suffix suggests factory", - "layer": "C4_SEMANTIC_ROLES", - "title": "HttpControlAppFactory", - "span_start": 15, - "span_end": 53, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 39, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "9b3502a5fb408b273223db13264349cf500de24915b6c649d9ea8970d0dfd8e0", - "symbol_name": "HttpControlAppFactory", - "qname": "HttpControlAppFactory", - "role": "factory", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/persistence/workflow_persistence.py", - "content": "WorkflowPersistence\nrole: pipeline_stage\n\nResponsibilities:\n- orchestrates role-like calls (2)\n- reads and writes state attributes\n- participates in dataflow slices (16)", - "layer": "C4_SEMANTIC_ROLES", - "title": "WorkflowPersistence", - "span_start": 8, - "span_end": 54, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 15, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "7bd01ee45cf31f2d5c2e3e51656254860ac785d10cef9e0852cd4fba90857bae", - "symbol_name": "WorkflowPersistence", - "qname": "WorkflowPersistence", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 16, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "80e9410ddc639789b4353c2a1a757ba8d0d5b5bb6075b0b263b61551f04ae1f0", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager.add_config_file", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 32, - "span_end": 52, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "a23b8a11ebdb12708b60c96ea12a69f7f042082f1adfddd572444e246d81d167", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "57ffbd4f0d9fdf3507c2b8624312ce211f3d02fdf86a57a8ec90778d8a7b498d", - "dst_ref": "RuntimeManager.add_config_file", - "resolution": "resolved", - "slice_id": "a23b8a11ebdb12708b60c96ea12a69f7f042082f1adfddd572444e246d81d167", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager.add_config_file" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "57ffbd4f0d9fdf3507c2b8624312ce211f3d02fdf86a57a8ec90778d8a7b498d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.services\n -> RuntimeManager.__init__", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 33, - "span_end": 39, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "d43af85989222ee6d788ce418cdcb217c7ff044cfb915e3bdbd184417dc7bd61", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "dst_ref": "RuntimeManager.__init__", - "resolution": "resolved", - "slice_id": "d43af85989222ee6d788ce418cdcb217c7ff044cfb915e3bdbd184417dc7bd61", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.services", - "RuntimeManager.__init__" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.stop", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 25, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d", - "dst_ref": "ControlPlaneService.stop", - "resolution": "resolved", - "slice_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.stop" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._stop_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 51, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a", - "dst_ref": "ControlPlaneService._stop_async", - "resolution": "resolved", - "slice_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._stop_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager.start", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 32, - "span_end": 59, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "98312ace7fc62b1c7194c5aa1732b6ef736eae1668a3a120dd1ecd5ab1d64f7a", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "77a7b260193018845e4e204df094ab89cfd7c82ee4e822b3a83ad4cd945f9cb1", - "dst_ref": "RuntimeManager.start", - "resolution": "resolved", - "slice_id": "98312ace7fc62b1c7194c5aa1732b6ef736eae1668a3a120dd1ecd5ab1d64f7a", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager.start" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "77a7b260193018845e4e204df094ab89cfd7c82ee4e822b3a83ad4cd945f9cb1" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager._register_core_services", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 32, - "span_end": 127, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "3e5811f3b511fa0cabe363f5d01f2ac5fa039bc8b93f7ee108323e1f5f45a293", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "972d6057a6caac9cf31ebc1e29c6f39f71b10d4cc170dec57cf875ba458549c6", - "dst_ref": "RuntimeManager._register_core_services", - "resolution": "resolved", - "slice_id": "3e5811f3b511fa0cabe363f5d01f2ac5fa039bc8b93f7ee108323e1f5f45a293", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager._register_core_services" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "972d6057a6caac9cf31ebc1e29c6f39f71b10d4cc170dec57cf875ba458549c6" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.register_channel", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 17, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957", - "dst_ref": "ControlPlaneService.register_channel", - "resolution": "resolved", - "slice_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.register_channel" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.start", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 20, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154", - "dst_ref": "ControlPlaneService.start", - "resolution": "resolved", - "slice_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.start" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._start_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 47, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517", - "dst_ref": "ControlPlaneService._start_async", - "resolution": "resolved", - "slice_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._start_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.services\n -> RuntimeManager._register_core_services", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 33, - "span_end": 127, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "aac6f9dda73963b977083a892bee39a48eca4fbd7404787e022ecf4ebedec65d", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "972d6057a6caac9cf31ebc1e29c6f39f71b10d4cc170dec57cf875ba458549c6", - "dst_ref": "RuntimeManager._register_core_services", - "resolution": "resolved", - "slice_id": "aac6f9dda73963b977083a892bee39a48eca4fbd7404787e022ecf4ebedec65d", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.services", - "RuntimeManager._register_core_services" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "972d6057a6caac9cf31ebc1e29c6f39f71b10d4cc170dec57cf875ba458549c6" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "class RuntimeManager:\n ACTION_TIMEOUT_SECONDS = 10.0\n ACTION_POLL_INTERVAL_SECONDS = 0.05\n\n def __init__(\n self,\n configuration: ConfigurationManager | None = None,\n services: ServiceContainer | None = None,\n traces: TraceService | None = None,\n health: HealthRegistry | None = None,\n logs: LogManager | None = None,\n workers: WorkerSupervisor | None = None,\n control_plane: ControlPlaneService | None = None,\n ) -> None:\n self.configuration = configuration or ConfigurationManager()\n self.services = services or ServiceContainer()\n self.traces = traces or TraceService()\n self.health = health or HealthRegistry()\n self.logs = logs or LogManager()\n self.workers = workers or WorkerSupervisor()\n self.control_plane = control_plane or ControlPlaneService()\n self.registry = ModuleRegistry(self.services)\n self._started = False\n self._state = LifecycleState.IDLE\n self._core_registered = False\n self._workers_registered = False\n self._register_core_services()\n\n def register_module(self, module: ApplicationModule) -> None:\n self.registry.register_module(module.name)\n module.register(self.registry)\n\n def add_config_file(self, path: str) -> FileConfigProvider:\n provider = FileConfigProvider(path)\n self.configuration.add_provider(provider)\n return provider\n\n def start(self, *, start_control_plane: bool = True) -> None:\n if self._started:\n return\n self._state = LifecycleState.STARTING\n config = self.configuration.load()\n self.logs.apply_config(config)\n self._register_health_contributors()\n self._register_workers()\n self.workers.start()\n if start_control_plane:\n self.control_plane.start(self)\n self._started = True\n self._refresh_state()\n\n def stop(self, timeout: float = 30.0, force: bool = False, stop_control_plane: bool = True) -> None:\n if not self._started:\n return\n self._state = LifecycleState.STOPPING\n self.workers.stop(timeout=timeout, force=force)\n if stop_control_plane:\n self.control_plane.stop()\n self._started = False\n self._state = LifecycleState.STOPPED\n\n def status(self) -> dict[str, object]:\n self._refresh_state()\n return self.control_plane.snapshot(self)\n\n def current_health(self) -> HealthPayload:\n self._refresh_state()\n return self.health.payload(self._state, self.workers.healths())\n\n async def health_status(self) -> HealthPayload:\n return self.current_health()\n\n async def start_runtime(self) -> dict[str, object] | str:\n self._refresh_state()\n if self._started:\n return \"runtime already running\"\n if self._state == LifecycleState.STOPPING:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n\n self.start(start_control_plane=False)\n started = self._wait_for_state({LifecycleState.IDLE, LifecycleState.BUSY}, timeout=self.ACTION_TIMEOUT_SECONDS)\n if started:\n return self._action_detail(\"runtime started\", timed_out=False)\n return self._action_detail(\"runtime start is still in progress\", timed_out=True)\n\n async def stop_runtime(self) -> dict[str, object] | str:\n self._refresh_state()\n if not self._started:\n if self._state == LifecycleState.STOPPING:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n return \"runtime already stopped\"\n\n self._state = LifecycleState.STOPPING\n try:\n self.workers.stop(timeout=self.ACTION_TIMEOUT_SECONDS, force=False)\n except TimeoutError:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n\n self._started = False\n self._state = LifecycleState.STOPPED\n return self._action_detail(\"runtime stopped\", timed_out=False)\n\n async def runtime_status(self) -> str:\n self._refresh_state()\n return self._state.value\n\n def _register_core_services(self) -> None:\n if self._core_registered:\n return\n self.services.register(\"configuration\", self.configuration)\n self.services.register(\"traces\", self.traces)\n self.services.register(\"health\", self.health)\n self.services.register(\"logs\", self.logs)\n self.services.register(\"workers\", self.workers)\n self.services.register(\"control_plane\", self.control_plane)\n self._core_registered = True\n\n def _register_health_contributors(self) -> None:\n for contributor in self.registry.health_contributors:\n self.health.register(contributor)\n\n def _register_workers(self) -> None:\n if self._workers_registered:\n return\n for worker in self.registry.workers:\n self.workers.register(worker)\n self._workers_registered = True\n\n def _refresh_state(self) -> None:\n lifecycle = self.workers.lifecycle_state()\n\n if self._state == LifecycleState.STOPPING:\n if lifecycle == LifecycleState.STOPPED:\n self._started = False\n self._state = LifecycleState.STOPPED\n return\n\n if not self._started:\n if lifecycle == LifecycleState.STOPPED:\n self._state = LifecycleState.STOPPED\n return\n\n self._state = lifecycle\n\n def _wait_for_state(self, target_states: set[LifecycleState], *, timeout: float) -> bool:\n deadline = monotonic() + timeout\n while monotonic() < deadline:\n self._refresh_state()\n if self._state in target_states:\n return True\n sleep(self.ACTION_POLL_INTERVAL_SECONDS)\n self._refresh_state()\n return self._state in target_states\n\n def _action_detail(self, message: str, *, timed_out: bool) -> dict[str, object]:\n self._refresh_state()\n return {\n \"message\": message,\n \"state\": self._state.value,\n \"timed_out\": timed_out,\n \"workers\": self.workers.snapshot(),\n }", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/core/runtime.py:RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.core.runtime", - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ] - }, - "diagnostics": { - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C0_SOURCE_CHUNKS": "exact_path_fetch", - "C4_SEMANTIC_ROLES": "exact_path_fetch", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C3_ENTRYPOINTS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 8, - "C4_SEMANTIC_ROLES": 8, - "C2_DEPENDENCY_GRAPH": 10, - "C3_ENTRYPOINTS": 10 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C4_SEMANTIC_ROLES": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Покажи поток выполнения при запуске RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C4_SEMANTIC_ROLES", - "query": "Покажи поток выполнения при запуске RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "Покажи поток выполнения при запуске RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 10, - "ranking_profile": "code" - }, - { - "layer": "C3_ENTRYPOINTS", - "query": "Покажи поток выполнения при запуске RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 10, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 1, - "candidates_after_filter": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 10, - "candidates_after_filter": 10 - }, - { - "layer": "C3_ENTRYPOINTS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 3, - "candidates_after_filter": 3 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "RuntimeManager", - "alternatives": [ - "RuntimeManager" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C4_SEMANTIC_ROLES", - "status": "hit", - "hit_count": 8, - "fail_reason": null - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 10, - "fail_reason": null - }, - { - "layer": "C3_ENTRYPOINTS", - "status": "hit", - "hit_count": 3, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "symbol_resolution": 0, - "retrieval_total": 170, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 55, - "C0_SOURCE_CHUNKS": 24, - "C4_SEMANTIC_ROLES": 19, - "C2_DEPENDENCY_GRAPH": 57, - "C3_ENTRYPOINTS": 13 - }, - "merge_rank": 23 - } - } - }, - { - "step": "llm_answer", - "input": { - "query": "Покажи поток выполнения при запуске RuntimeManager", - "rag_count": 23 - }, - "output": { - "llm_answer": "При запуске объекта `RuntimeManager` выполняются следующие последовательные шаги:\n\n1. В конструкторе класса (`__init__`) происходит инициализация атрибутов объекта с использованием переданных параметров или дефолтных значений для конфигураций, служб, трассировки, здоровья, логирования и управления рабочими процессами.\n \n2. Метод `self._register_core_services()` регистрирует основные сервисы внутри модуля регистрации (`registry`), что подразумевает первоначальную настройку среды исполнения.\n\nТаким образом, общий поток выглядит следующим образом:\n\n```python\nИнициализация объектов и их атрибутов\nruntime_manager = RuntimeManager(config, services, traces, health, logs, workers, control_plane)\nРегистрация основных сервисов приложения\nruntime_manager._register_core_services()\n```\n\nНа текущий момент восстановить дальнейший точный поток выполнения не представляется возможным ввиду недостаточной информации о следующих шагах после вызова `_register_core_services()`." - }, - "diagnostics": { - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 859, - "evidence_rows": 23, - "evidence_chars": 8302 - }, - "evidence_summary": [ - { - "layer": "C1_SYMBOL_CATALOG", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "count": 8, - "unique_paths": 7 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "count": 10, - "unique_paths": 2 - }, - { - "layer": "C3_ENTRYPOINTS", - "count": 3, - "unique_paths": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 1, - "unique_paths": 1 - } - ], - "prompt_template_id": "intent_code_qa_trace_flow_ru_v4", - "system_prompt_version": "v1" - }, - "timings_ms": { - "prompt_build": 0, - "llm_call": 1454 - } - } - } - ] - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_143636/full_chain_plba_code_subintents_v2_plba-v2-trace-flow-runtime-start.md b/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_143636/full_chain_plba_code_subintents_v2_plba-v2-trace-flow-runtime-start.md deleted file mode 100644 index 52cafa6..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_143636/full_chain_plba_code_subintents_v2_plba-v2-trace-flow-runtime-start.md +++ /dev/null @@ -1,34 +0,0 @@ -# plba-v2-trace-flow-runtime-start - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_subintents_v2.yaml -- runner: runtime -- mode: full_chain -- passed: True - -## Query -Покажи поток выполнения при запуске RuntimeManager - -## Actual -{ - "intent": "CODE_QA", - "sub_intent": "TRACE_FLOW", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 23, - "llm_answer": "При запуске объекта `RuntimeManager` выполняются следующие последовательные шаги:\n\n1. В конструкторе класса (`__init__`) происходит инициализация атрибутов объекта с использованием переданных параметров или дефолтных значений для конфигураций, служб, трассировки, здоровья, логирования и управления рабочими процессами.\n \n2. Метод `self._register_core_services()` регистрирует основные сервисы внутри модуля регистрации (`registry`), что подразумевает первоначальную настройку среды исполнения.\n\nТаким образом, общий поток выглядит следующим образом:\n\n```python\nИнициализация объектов и их атрибутов\nruntime_manager = RuntimeManager(config, services, traces, health, logs, workers, control_plane)\nРегистрация основных сервисов приложения\nruntime_manager._register_core_services()\n```\n\nНа текущий момент восстановить дальнейший точный поток выполнения не представляется возможным ввиду недостаточной информации о следующих шагах после вызова `_register_core_services()`.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "RuntimeManager" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] -} - -## Mismatches -- none \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_143636/summary.md b/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_143636/summary.md deleted file mode 100644 index 79b43c4..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_143636/summary.md +++ /dev/null @@ -1,83 +0,0 @@ -# pipeline_setup_v2 summary - -Passed: 17/18 - -| File | Case | Query | Expected sub-intent | Intent | Actual sub-intent | RAG layers | Pass | -|------|------|-------|---------------------|--------|-------------------|------------|------| -| full_chain_plba_code_subintents_v2.yaml | plba-v2-open-file-runtime | Открой файл src/app_runtime/core/runtime.py | OPEN_FILE | CODE_QA | OPEN_FILE | C0_SOURCE_CHUNKS:1 | ✓ | -| full_chain_plba_code_subintents_v2.yaml | plba-v2-open-file-public-api | Открой файл src/plba/__init__.py | OPEN_FILE | CODE_QA | OPEN_FILE | C0_SOURCE_CHUNKS:1 | ✓ | -| full_chain_plba_code_subintents_v2.yaml | plba-v2-explain-runtime-manager | Объясни как работает класс RuntimeManager | EXPLAIN | CODE_QA | EXPLAIN | C0_SOURCE_CHUNKS:1, C1_SYMBOL_CATALOG:1, C2_DEPENDENCY_GRAPH:6, C3_ENTRYPOINTS:3, C4_SEMANTIC_ROLES:1 | ✓ | -| full_chain_plba_code_subintents_v2.yaml | plba-v2-explain-trace-service | Объясни как работает класс TraceService | EXPLAIN | CODE_QA | EXPLAIN | C0_SOURCE_CHUNKS:3, C1_SYMBOL_CATALOG:1, C2_DEPENDENCY_GRAPH:6, C3_ENTRYPOINTS:3, C4_SEMANTIC_ROLES:1 | ✓ | -| full_chain_plba_code_subintents_v2.yaml | plba-v2-explain-create-runtime | Что делает функция create_runtime? | EXPLAIN | CODE_QA | EXPLAIN | C0_SOURCE_CHUNKS:1, C1_SYMBOL_CATALOG:1, C2_DEPENDENCY_GRAPH:6, C3_ENTRYPOINTS:3, C4_SEMANTIC_ROLES:1 | ✓ | -| full_chain_plba_code_subintents_v2.yaml | plba-v2-explain-local-http-channel | Почему в файле src/app_runtime/control/http_channel.py класс HttpControlChannel устроен так? | EXPLAIN_LOCAL | CODE_QA | EXPLAIN_LOCAL | C0_SOURCE_CHUNKS:1, C1_SYMBOL_CATALOG:1, C2_DEPENDENCY_GRAPH:4 | ✓ | -| full_chain_plba_code_subintents_v2.yaml | plba-v2-find-tests-runtime-manager | Где тесты для RuntimeManager? | FIND_TESTS | CODE_QA | FIND_TESTS | C0_SOURCE_CHUNKS:10, C2_DEPENDENCY_GRAPH:6 | ✓ | -| full_chain_plba_code_subintents_v2.yaml | plba-v2-find-tests-trace-service | Где тесты для TraceService? | FIND_TESTS | CODE_QA | FIND_TESTS | C0_SOURCE_CHUNKS:10, C2_DEPENDENCY_GRAPH:6 | ✓ | -| full_chain_plba_code_subintents_v2.yaml | plba-v2-find-tests-create-runtime | Где тесты для create_runtime? | FIND_TESTS | CODE_QA | FIND_TESTS | C0_SOURCE_CHUNKS:10, C2_DEPENDENCY_GRAPH:6 | ✓ | -| full_chain_plba_code_subintents_v2.yaml | plba-v2-find-tests-workflow-runtime-factory-negative | Где тесты для WorkflowRuntimeFactory? | FIND_TESTS | CODE_QA | FIND_TESTS | C0_SOURCE_CHUNKS:10, C2_DEPENDENCY_GRAPH:6 | ✓ | -| full_chain_plba_code_subintents_v2.yaml | plba-v2-find-entrypoints-control-plane | Найди точки входа HTTP control plane | FIND_ENTRYPOINTS | CODE_QA | FIND_ENTRYPOINTS | C0_SOURCE_CHUNKS:6, C3_ENTRYPOINTS:3 | ✓ | -| full_chain_plba_code_subintents_v2.yaml | plba-v2-find-entrypoints-health-endpoint | Где health endpoint? | FIND_ENTRYPOINTS | CODE_QA | FIND_ENTRYPOINTS | C0_SOURCE_CHUNKS:6, C3_ENTRYPOINTS:3 | ✗ | -| full_chain_plba_code_subintents_v2.yaml | plba-v2-trace-flow-runtime-start | Покажи поток выполнения при запуске RuntimeManager | TRACE_FLOW | CODE_QA | TRACE_FLOW | C0_SOURCE_CHUNKS:1, C1_SYMBOL_CATALOG:1, C2_DEPENDENCY_GRAPH:10, C3_ENTRYPOINTS:3, C4_SEMANTIC_ROLES:8 | ✓ | -| full_chain_plba_code_subintents_v2.yaml | plba-v2-trace-flow-health-endpoint | Покажи как проходит запрос /health в HttpControlAppFactory | TRACE_FLOW | CODE_QA | TRACE_FLOW | C0_SOURCE_CHUNKS:1, C1_SYMBOL_CATALOG:4, C2_DEPENDENCY_GRAPH:10, C3_ENTRYPOINTS:3, C4_SEMANTIC_ROLES:8 | ✓ | -| full_chain_plba_code_subintents_v2.yaml | plba-v2-architecture-runtime-manager | Какие компоненты участвуют в RuntimeManager? | ARCHITECTURE | CODE_QA | ARCHITECTURE | C0_SOURCE_CHUNKS:1, C1_SYMBOL_CATALOG:1, C2_DEPENDENCY_GRAPH:8, C3_ENTRYPOINTS:3, C4_SEMANTIC_ROLES:12 | ✓ | -| full_chain_plba_code_subintents_v2.yaml | plba-v2-architecture-control-plane | Какие компоненты участвуют в ControlPlaneService? | ARCHITECTURE | CODE_QA | ARCHITECTURE | C0_SOURCE_CHUNKS:1, C1_SYMBOL_CATALOG:1, C2_DEPENDENCY_GRAPH:8, C3_ENTRYPOINTS:3, C4_SEMANTIC_ROLES:12 | ✓ | -| full_chain_plba_code_subintents_v2.yaml | plba-v2-explain-nonexistent-symbol | Объясни класс RuntimeFactoryManager | EXPLAIN | CODE_QA | EXPLAIN | — | ✓ | -| full_chain_plba_code_subintents_v2.yaml | plba-v2-open-file-nonexistent | Открой файл src/app_runtime/core/missing_runtime.py | OPEN_FILE | CODE_QA | OPEN_FILE | — | ✓ | - -## Failures -- **plba-v2-find-entrypoints-health-endpoint**: llm: expected answer to contain 'GET /health' - -## LLM Answers -- **plba-v2-open-file-runtime** - Query: Открой файл src/app_runtime/core/runtime.py - > В файле src/app\_runtime/core/runtime.py определен класс RuntimeManager. Видны следующие элементы: \- Константы: ACTION\_TIMEOUT\_SECONDS, ACTION\_POLL\_INTERVAL\_SECONDS. \- Инициализация с параметрами конфигурации, сервисов, трассировки, здоровья, логирования, супервизора рабочих процессов и службы управления плоскостью контроля. \- Метод регистрации модуля приложения. -- **plba-v2-open-file-public-api** - Query: Открой файл src/plba/__init__.py - > В модуле src/plba/\_\_init\_\_.py видны следующие импорты и объявления: Импорты: \- plba.bootstrap.create\_runtime \- plba.config.ConfigFileLoader, FileConfigProvider \- plba.control.ControlActionSet, ControlChannel, ControlPlaneService, HttpControlChannel \- plba.contracts.ApplicationModule, ConfigProvider, HealthContributor, TraceContext, TraceContextRecord, TraceLogMessage, TraceTransport, Worker, WorkerHealth, WorkerStatus \- plba.core.ConfigurationManager, RuntimeManager, ServiceContainer \- plba.health.HealthRegistry \- plba.logging.LogManager \- plba.queue.InMemoryTaskQueue \- plba.tracing.MySqlTraceTransport, NoOpTraceTransport, TraceService \- plba.workflow.StepResult, WorkflowContext, WorkflowDefinition, WorkflowEngine, WorkflowEngineHooks, WorkflowNode, WorkflowRuntimeFactory, WorkflowStep \- plba.workers.WorkerSupervisor Объявления: \- \_\_all\_\_ Также здесь определены неско… -- **plba-v2-explain-runtime-manager** - Query: Объясни как работает класс RuntimeManager - > Класс \`RuntimeManager\` выглядит как менеджер жизненного цикла и координатор для различных компонентов в приложении runtime. Судя по предоставленным данным, он работает как центрального управляющего элемента, координирующего действия других сервисов и модулей. Основные характеристики класса: \- Инициализация происходит через конструктор \(\`\_\_init\_\_\`\), которому передаются различные компоненты приложения \(конфигурации, службы, регистраторы трассировок, системы здоровья, логгеры и супервайзеры рабочих процессов\). \- В конструкторе устанавливаются начальные значения полей и создаются внутренние структуры данных, такие как \`registry\`, представляющий собой модульный регистр служб. \- Класс содержит два основных состояния управления: \- \`\_state\`: отслеживает текущее состояние жизненного цикла менеджера \(например, IDLE, RUNNING\). \- \`\_core\_registered\`: флаг, указывающий, зарегистри… -- **plba-v2-explain-trace-service** - Query: Объясни как работает класс TraceService - > Класс \`TraceService\` является частью системы отслеживания трассировок в приложении и реализует функционал управления контекстами трассировки и записи событий в журнал. Ключевые особенности класса: 1. Инициализация \(\`\_\_init\_\_\(\)\`\): \- При создании экземпляра класса указывается транспорт для отправки данных трассировки \(\`transport\`\) и хранилище контекста трассировки \(\`store\`\). Если эти параметры не указаны, используются дефолтные реализации: \`NoOpTraceTransport\(\)\` и \`TraceContextStore\(\)\`. \- Создаётся объект \`TraceRecordWriter\`, отвечающий за запись записей о контексте и сообщений в транспорт. 2. Создание нового контекста трассировки \(\`create\_context\(\)\`\): \- Метод создаёт новый контекст трассировки, генерируя уникальный идентификатор трассировки \(\`trace\_id\`\), устанавливая атрибуты, такие как имя трека \(\`alias\`\), родительский идентификатор \(\`parent\_id\`\), тип события \(\`kind\`… -- **plba-v2-explain-create-runtime** - Query: Что делает функция create_runtime? - > Функция \`create\_runtime\` находится в файле \`src/plba/bootstrap.py\`. Она отвечает за инициализацию и настройку основного объекта управления \(\`RuntimeManager\`\), используемого для координации различных компонентов приложения. Конкретно, эта функция выполняет следующие действия: 1. Создаёт новый объект типа \`RuntimeManager\`. 2. При наличии указанного пути к конфигурационному файлу добавляет этот файл в runtime при помощи вызова метода \`runtime.add\_config\_file\(\)\`. 3. Если указано включение HTTP\-контроля, регистрирует канал управления через класс \`HttpControlChannel\`, указывая параметры хоста, порта и тайм\-аута. 4. Регистрирует переданный модуль приложения \(\`module\`\) в runtime посредством вызова \`runtime.register\_module\(\)\`. 5. Возвращает созданный экземпляр \`RuntimeManager\`. Таким образом, основная цель функции – настройка базовой инфраструктуры приложения, включая загрузк… -- **plba-v2-explain-local-http-channel** - Query: Почему в файле src/app_runtime/control/http_channel.py класс HttpControlChannel устроен так? - > Класс \`HttpControlChannel\` реализует механизм управления HTTP\-каналом для взаимодействия с внешним окружением приложения. Что он делает: \- При инициализации \(\`\_\_init\_\_\`\) создается объект, принимающий параметры хоста, порта и тайм\-аута. Он устанавливает свойства \`\_timeout\`, создает внутренний сервер через объект \`UvicornThreadRunner\` и фабрику приложений \`HttpControlAppFactory\`. \- Метод \`start\(actions\)\` запускает приложение с заданным набором действий \(\`ControlActionSet\`\), если они предоставлены. Это включает создание приложения и его запуск с помощью внутреннего сервера. \- Метод \`stop\(\)\` останавливает запущенное ранее приложение. \- Методы \`\_health\_response\` и \`\_action\_response\` обеспечивают обработку запросов от клиентов. Первый возвращает статус здоровья канала \(здорово ли приложение\), второй обрабатывает запросы конкретных действий. Ключевые детали: \- Тайм\-аут зада… -- **plba-v2-find-tests-runtime-manager** - Query: Где тесты для RuntimeManager? - > Прямые тесты для RuntimeManager обнаружены в следующих местах: 1. tests/test\_runtime.py \| test\_runtime\_graceful\_stop\_waits\_until\_worker\_finishes \- Проверка корректного завершения работы менеджера при выполнении остановки \(graceful stop\). 2. tests/test\_runtime.py \| test\_runtime\_runs\_worker\_routine\_and\_exposes\_status \- Тестирование запуска рабочей рутины и доступности статуса RuntimeManager после старта и остановки. Эти тесты напрямую подтверждают поведение RuntimeManager через его инстанцирование и выполнение конкретных методов. Косвенные тесты также найдены: 1. tests/test\_business\_control\_actions.py \| \_build\_runtime \- Инстанцирует RuntimeManager в контексте построения бизнес\-контроля действий. 2. tests/test\_business\_control\_actions.py \| test\_worker\_wakes\_up\_with\_configured\_interval \- Опять же использует RuntimeManager внутри теста проверки пробуждения рабочего процес… -- **plba-v2-find-tests-trace-service** - Query: Где тесты для TraceService? - > Прямых тестов конкретно для \`TraceService\` в указанном контексте нет. Связь с сущностью не подтверждается именами функций, модулями или явными вызовами \`TraceService\`. Однако имеются косвенные тесты, которые косвенно затрагивают поведение \`TraceService\`, взаимодействуя через посредника \(\`RecordingTransport\`\), например: \- tests/test\_runtime.py: \- Проверка записи контекстов и сообщений \(метод \`write\_context\`\) при создании трассировочного сервиса. Эти тесты косвенно подтверждают корректность работы методов, связанных с \`TraceService\`. Тем не менее, напрямую тесты \`TraceService\` отсутствуют. -- **plba-v2-find-tests-create-runtime** - Query: Где тесты для create_runtime? - > Прямых тестов конкретно для функции \`create\_runtime\` в предоставленном контексте не обнаружено. -- **plba-v2-find-tests-workflow-runtime-factory-negative** - Query: Где тесты для WorkflowRuntimeFactory? - > Прямых тестов конкретно для \`WorkflowRuntimeFactory\` в предоставленном контексте не обнаружено. -- **plba-v2-find-entrypoints-control-plane** - Query: Найди точки входа HTTP control plane - > В данном приложении обнаружены следующие подтвержденные точки входа \(entrypoints\) HTTP control plane: 1. HTTP GET \`/health Объявлен в файле \`src/app\_runtime/control/http\_app.py\`. Контролируется методом \`health\(\)\` класса \`HttpControlAppFactory\`, который возвращает статус здоровья приложения. 2. HTTP POST/PUT/PATCH/DELETE \`/actions/\{action\}\` и HTTP GET \`/actions/\{action\} Объявлены в том же файле \`src/app\_runtime/control/http\_app.py\`. Данные маршруты обрабатываются методами \`action\(\)\` и контролируются классом \`HttpControlAppFactory\`. Все обнаруженные маршруты объявлены напрямую в коде через декораторы FastAPI \(\`@app.get\`, \`@app.post\`\), что подтверждает их реальное существование и доступность. -- **plba-v2-find-entrypoints-health-endpoint** - Query: Где health endpoint? - > У тебя есть две подтвержденные точки HTTP\-запросов \(\`GET /\`, \`POST /\`\), объявленные в файле \`http\_app.py\`. Однако конкретно маршрут \`/health\` нигде явно не указан. Тем не менее, исходя из предоставленного контекста, у нас есть компонент класса \`HealthRegistry\`, ответственный за сбор и обработку данных о здоровье системы. Вероятно, реализация проверки здоровья \(\`health check\`\) реализована через этот класс, хотя прямого указания на маршрут \`/health\` в предоставленных фрагментах кода нет. Таким образом, возможная кандидатура на роль health\-endpoint — это обращение к экземпляру класса \`HealthRegistry\` с запросом на получение информации о текущем состоянии компонентов системы \(хотя точный URL может отличаться от \`/health\`\). Однако стоит отметить, что без дополнительных сведений точно утверждать наличие именно маршрута \`/health\` нельзя. Рекомендую проверить непосредственно… -- **plba-v2-trace-flow-runtime-start** - Query: Покажи поток выполнения при запуске RuntimeManager - > При запуске объекта \`RuntimeManager\` выполняются следующие последовательные шаги: 1. В конструкторе класса \(\`\_\_init\_\_\`\) происходит инициализация атрибутов объекта с использованием переданных параметров или дефолтных значений для конфигураций, служб, трассировки, здоровья, логирования и управления рабочими процессами. 2. Метод \`self.\_register\_core\_services\(\)\` регистрирует основные сервисы внутри модуля регистрации \(\`registry\`\), что подразумевает первоначальную настройку среды исполнения. Таким образом, общий поток выглядит следующим образом: \`\`\`python Инициализация объектов и их атрибутов runtime\_manager = RuntimeManager\(config, services, traces, health, logs, workers, control\_plane\) Регистрация основных сервисов приложения runtime\_manager.\_register\_core\_services\(\) \`\`\` На текущий момент восстановить дальнейший точный поток выполнения не представляется возможным ввиду… -- **plba-v2-trace-flow-health-endpoint** - Query: Покажи как проходит запрос /health в HttpControlAppFactory - > Когда пользователь делает запрос \`/health\` к приложению, созданному с помощью \`HttpControlAppFactory\`, происходят следующие шаги: 1. Запрос поступает на уровень middleware \(\`log\_api\_call\`\) приложения FastAPI, где измеряется время обработки запроса. 2. После middleware запрос обрабатывается маршрутизатором FastAPI и достигает обработчика маршрута \`/health\`. 3. В обработчике \`/health\` вызывается предоставленный внешним компонентом callable\-функции \`health\_provider\`, которая должна вернуть объект типа \`HealthPayload\`. 4. Полученный от \`health\_provider\` объект проверяется на статус «ok». Если он соответствует этому значению, возвращается успешный ответ \(статус\-код 200\), иначе — ошибка \(статус\-код 503\). 5. Ответ формируется в виде объекта \`JSONResponse\`, содержащего результат вызова \`health\_provider\`. Таким образом, поток начинается с входящего HTTP\-запроса, проходит чере… -- **plba-v2-architecture-runtime-manager** - Query: Какие компоненты участвуют в RuntimeManager? - > В подсистеме RuntimeManager участвуют следующие компоненты и устанавливаются явные связи между ними: 1. RuntimeManager: \- Создаёт экземпляры других компонентов и управляет их жизненным циклом. \- Регистрирует состояние атрибутов системы и его изменения. \- Вызывает методы для обработки различных событий и состояний внутри системы. 2. ControlActionSet: \- Получает команды от RuntimeManager и выполняет действия модели на основе этих команд. Связи между компонентами: \- Создает: RuntimeManager создает экземпляр ControlActionSet при своем инициализации. \- Регистрирует: RuntimeManager отслеживает текущее состояние атрибутов системы и может регистрировать изменения состояния. \- Передаёт данные: RuntimeManager передает команды и события в ControlActionSet для выполнения соответствующих действий. Границы ответственности: \- RuntimeManager отвечает за координацию работы различных… -- **plba-v2-architecture-control-plane** - Query: Какие компоненты участвуют в ControlPlaneService? - > В подсистеме \`ControlPlaneService\` участвуют следующие компоненты и наблюдаются явные связи между ними: 1. ControlPlaneService — главный компонент, создающий и инициализирующий другие компоненты: \- Создаёт каналы \(\`\_channels\`\) для передачи данных с помощью метода \`\_channels\`. \- Регистрирует каналы с помощью метода \`register\_channel\`, который передаёт управление каналу. 2. Каналы \(\_channels\) — представляют собой элементы инфраструктуры для обмена данными внутри сервиса. Каналы создаются и регистрируются в \`ControlPlaneService\`. Связи компонентов выражены следующим образом: \- Контроллер службы создает и управляет каналами данных. \- Каналы используются службой для передачи и приёма сообщений между различными частями системы. Границы ответственности \`ControlPlaneService\` можно кратко описать так: \- Управление жизненным циклом каналов данных. \- Чтение и запись атрибутов с… -- **plba-v2-explain-nonexistent-symbol** - Query: Объясни класс RuntimeFactoryManager - > Сущность RuntimeFactoryManager не найдена в доступном коде. Близкие совпадения: ControlChannel, ControlActionSet. -- **plba-v2-open-file-nonexistent** - Query: Открой файл src/app_runtime/core/missing_runtime.py - > Файл src/app\_runtime/core/missing\_runtime.py не найден. \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_143856.zip b/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_143856.zip deleted file mode 100644 index 25a4913..0000000 Binary files a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_143856.zip and /dev/null differ diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_143856/full_chain_plba_code_subintents_v2_plba-v2-architecture-control-plane.json b/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_143856/full_chain_plba_code_subintents_v2_plba-v2-architecture-control-plane.json deleted file mode 100644 index 8f9048c..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_143856/full_chain_plba_code_subintents_v2_plba-v2-architecture-control-plane.json +++ /dev/null @@ -1,2940 +0,0 @@ -{ - "case_id": "plba-v2-architecture-control-plane", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_subintents_v2.yaml", - "runner": "runtime", - "mode": "full_chain", - "actual": { - "intent": "CODE_QA", - "sub_intent": "ARCHITECTURE", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 25, - "llm_answer": "В подсистеме ControlPlaneService можно выделить следующие компоненты и связи между ними на основе доступных контекстных слоев:\nКомпоненты и связи:\n1. ControlPlaneService\n - Создаёт: `ControlPlaneService` инстанцируется при инициализации приложения (`app.post`).\n - Вызывает: метод `_channels` для регистрации каналов обработки данных, а также асинхронно запускает начальные действия (`_start_async`).\n - Читает и записывает состояние атрибутов сервиса.\n \n2. ControlActionSet\n - Используется внутри `ControlPlaneService`, роль модели указывается как \"default\".\nГраницы ответственности:\nГраница ответственности явно видна в коде следующим образом:\n- Сервис участвует в обработке данных, разделяя их на отдельные потоки (`dataflow slices`), что подтверждается методами и полями класса.\n- Регистрация каналов и управление ими выполняется непосредственно через инициализацию объекта сервиса.\n\nТаким образом, ControlPlaneService играет ключевую роль в управлении данными и потоками задач в системе, взаимодействуя с другими сервисами и компонентами через каналы передачи информации.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "ControlPlaneService" - ], - "layers": [ - "C4_SEMANTIC_ROLES", - "C3_ENTRYPOINTS", - "C2_DEPENDENCY_GRAPH", - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS" - ] - }, - "passed": true, - "mismatches": [], - "details": { - "case_id": "plba-v2-architecture-control-plane", - "text": "Какие компоненты участвуют в ControlPlaneService?", - "mode": "full_chain", - "run_started_at": "2026-03-12T14:38:57", - "rag_session_id": "7d11da21-faa0-4cea-aede-aeabe069164c", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Какие компоненты участвуют в ControlPlaneService?", - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "ControlPlaneService", - "alternatives": [ - "ControlPlaneService" - ], - "confidence": 0.99 - }, - "rag_count": 25, - "rag_rows": [ - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests service\n- reads and writes state attributes\n- participates in dataflow slices (5)", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlPlaneService", - "span_start": 12, - "span_end": 52, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 68, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "b13471e5916986dccffb53fab613812842965705e6b3a89ae549d30c9e91e9aa", - "symbol_name": "ControlPlaneService", - "qname": "ControlPlaneService", - "role": "pipeline_stage", - "confidence": 0.57, - "dataflow_participation": 5, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "ControlActionSet\nrole: model\n\nResponsibilities:\n- default model role", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlActionSet", - "span_start": 14, - "span_end": 18, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 40, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "46eb026cb3313415ec47b82dd22f84f4d112c9d987e8b1716dcb0baa1cce8988", - "symbol_name": "ControlActionSet", - "qname": "ControlActionSet", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "ControlChannel\nrole: model\n\nResponsibilities:\n- default model role", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlChannel", - "span_start": 21, - "span_end": 28, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 40, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "cfcfe9a311d3a2dbdaf32ac4ccd73c0eb9a117f830591a1c0867ee97d46204ff", - "symbol_name": "ControlChannel", - "qname": "ControlChannel", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_runner.py", - "content": "UvicornThreadRunner\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (24)", - "layer": "C4_SEMANTIC_ROLES", - "title": "UvicornThreadRunner", - "span_start": 10, - "span_end": 61, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 11, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "fd55630045a02100df8877ac27d951ee08617d4598764394d48cb51fe067476a", - "symbol_name": "UvicornThreadRunner", - "qname": "UvicornThreadRunner", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 24, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "3779fdd2878b770e789a35bb2a89c9d79f13b61c26d7db1b3b683f9bb9e1623f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (10)", - "layer": "C4_SEMANTIC_ROLES", - "title": "HttpControlChannel", - "span_start": 12, - "span_end": 57, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 21, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "1c9fbdc24819e5604c26ea55428a74310f03a03e1af197ed84846af61e42fdb0", - "symbol_name": "HttpControlChannel", - "qname": "HttpControlChannel", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 10, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "HttpControlAppFactory\nrole: factory\n\nResponsibilities:\n- name suffix suggests factory", - "layer": "C4_SEMANTIC_ROLES", - "title": "HttpControlAppFactory", - "span_start": 15, - "span_end": 53, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 39, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "9b3502a5fb408b273223db13264349cf500de24915b6c649d9ea8970d0dfd8e0", - "symbol_name": "HttpControlAppFactory", - "qname": "HttpControlAppFactory", - "role": "factory", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/persistence/workflow_persistence.py", - "content": "WorkflowPersistence\nrole: pipeline_stage\n\nResponsibilities:\n- orchestrates role-like calls (2)\n- reads and writes state attributes\n- participates in dataflow slices (16)", - "layer": "C4_SEMANTIC_ROLES", - "title": "WorkflowPersistence", - "span_start": 8, - "span_end": 54, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 15, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "7bd01ee45cf31f2d5c2e3e51656254860ac785d10cef9e0852cd4fba90857bae", - "symbol_name": "WorkflowPersistence", - "qname": "WorkflowPersistence", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 16, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "80e9410ddc639789b4353c2a1a757ba8d0d5b5bb6075b0b263b61551f04ae1f0", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/queue/in_memory.py", - "content": "InMemoryTaskQueue\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (9)", - "layer": "C4_SEMANTIC_ROLES", - "title": "InMemoryTaskQueue", - "span_start": 9, - "span_end": 38, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 22, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "2da04cb94544a3bcbf0943a95ad4bdd8710bcafaa32a02fd0e4de2178dcf3533", - "symbol_name": "InMemoryTaskQueue", - "qname": "InMemoryTaskQueue", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 9, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "58f0cc001ccda0eee4c6bc32ed83bd05eafd6b6644f1e8b4aa9eed3103db73dc", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/config/file_loader.py", - "content": "ConfigFileLoader\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (8)", - "layer": "C4_SEMANTIC_ROLES", - "title": "ConfigFileLoader", - "span_start": 11, - "span_end": 48, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 23, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "a8474eca8b6e9dc86ae67ed68b16fa5fb639ef08739c053e7b7195489765667f", - "symbol_name": "ConfigFileLoader", - "qname": "ConfigFileLoader", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 8, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "1f19ffebde5e38e4be5a5d5a678059a0f36dedb8fb8b3e00ab395c67106a87ea", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/store.py", - "content": "TraceContextStore\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (6)", - "layer": "C4_SEMANTIC_ROLES", - "title": "TraceContextStore", - "span_start": 15, - "span_end": 52, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 25, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "b2dad4fbe16ffb11b58deba311c7739955c39d59f291b22181f33e9c8cce4059", - "symbol_name": "TraceContextStore", - "qname": "TraceContextStore", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 6, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "d369554f08fc92039c6edd5a2a1e73b23901533e8974459170bbd9347d263dc5", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workers/supervisor.py", - "content": "WorkerSupervisor\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (6)", - "layer": "C4_SEMANTIC_ROLES", - "title": "WorkerSupervisor", - "span_start": 10, - "span_end": 59, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 25, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "c17b44e8d9e97d490989b21fa67d7c346cdda8a0472e4c41fb243c8846faa124", - "symbol_name": "WorkerSupervisor", - "qname": "WorkerSupervisor", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 6, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "77609d9d5927171cce7fc3a54897c183fd63068710c6362029b700937aae5eee", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/engine/workflow_engine.py", - "content": "WorkflowEngine\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (6)", - "layer": "C4_SEMANTIC_ROLES", - "title": "WorkflowEngine", - "span_start": 10, - "span_end": 86, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 25, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "57ec0a9f11c542c78e008684a888397e8d9ef4223671acb2567e631a0cbc70b4", - "symbol_name": "WorkflowEngine", - "qname": "WorkflowEngine", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 6, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "1057136e58a325cd5ab6f4e265d15665fb6a711b7022d9fab52a1a290afa2368", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._start_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 47, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517", - "dst_ref": "ControlPlaneService._start_async", - "resolution": "resolved", - "slice_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._start_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.register_channel", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 17, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957", - "dst_ref": "ControlPlaneService.register_channel", - "resolution": "resolved", - "slice_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.register_channel" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.start", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 20, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154", - "dst_ref": "ControlPlaneService.start", - "resolution": "resolved", - "slice_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.start" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.stop", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 25, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d", - "dst_ref": "ControlPlaneService.stop", - "resolution": "resolved", - "slice_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.stop" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._stop_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 51, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a", - "dst_ref": "ControlPlaneService._stop_async", - "resolution": "resolved", - "slice_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._stop_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.start calls asyncio.run", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.start:calls", - "span_start": 22, - "span_end": 22, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "4e0b3147fb867d48d26567570c259f4052a739e3098133802d4b8bafcf03be6b", - "edge_type": "calls", - "src_symbol_id": "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154", - "src_qname": "ControlPlaneService.start", - "dst_symbol_id": null, - "dst_ref": "asyncio.run", - "resolution": "partial", - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.register_channel reads_attr ControlPlaneService._channels", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.register_channel:reads_attr", - "span_start": 17, - "span_end": 17, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "3101fdc99a7a9c5aebf18a024bc148d37b348248a6fd02b95724dff280f2908a", - "edge_type": "reads_attr", - "src_symbol_id": "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957", - "src_qname": "ControlPlaneService.register_channel", - "dst_symbol_id": null, - "dst_ref": "ControlPlaneService._channels", - "resolution": "partial", - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.start reads_attr ControlPlaneService._channels", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.start:reads_attr", - "span_start": 20, - "span_end": 20, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "9452e50ef27d47c30ee1c311c48fe73ecddbf7a6dbcf967a6345e98222d9f71a", - "edge_type": "reads_attr", - "src_symbol_id": "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154", - "src_qname": "ControlPlaneService.start", - "dst_symbol_id": null, - "dst_ref": "ControlPlaneService._channels", - "resolution": "partial", - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "class ControlPlaneService\nControlPlaneService", - "layer": "C1_SYMBOL_CATALOG", - "title": "ControlPlaneService", - "span_start": 12, - "span_end": 52, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "b13471e5916986dccffb53fab613812842965705e6b3a89ae549d30c9e91e9aa", - "qname": "ControlPlaneService", - "kind": "class", - "signature": "ControlPlaneService", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.control.service", - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "class ControlPlaneService:\n def __init__(self) -> None:\n self._channels: list[ControlChannel] = []\n\n def register_channel(self, channel: ControlChannel) -> None:\n self._channels.append(channel)\n\n def start(self, runtime: RuntimeManager) -> None:\n if not self._channels:\n return\n asyncio.run(self._start_async(runtime))\n\n def stop(self) -> None:\n if not self._channels:\n return\n asyncio.run(self._stop_async())\n\n def snapshot(self, runtime: RuntimeManager) -> dict[str, object]:\n health = runtime.current_health()\n return {\n \"runtime\": {\"state\": runtime._state.value},\n \"modules\": list(runtime.registry.modules),\n \"services\": runtime.services.snapshot(),\n \"workers\": runtime.workers.snapshot(),\n \"health\": runtime.health.snapshot(runtime.workers.healths()) | {\"status\": health[\"status\"]},\n \"config\": runtime.configuration.get(),\n }\n\n async def _start_async(self, runtime: RuntimeManager) -> None:\n actions = ControlActionSet(\n health=runtime.health_status,\n start=runtime.start_runtime,\n stop=runtime.stop_runtime,\n status=runtime.runtime_status,\n )\n for channel in self._channels:\n await channel.start(actions)\n\n async def _stop_async(self) -> None:\n for channel in reversed(self._channels):\n await channel.stop()", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/service.py:ControlPlaneService", - "span_start": 12, - "span_end": 52, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.service", - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "llm_answer": "В подсистеме ControlPlaneService можно выделить следующие компоненты и связи между ними на основе доступных контекстных слоев:\nКомпоненты и связи:\n1. ControlPlaneService\n - Создаёт: `ControlPlaneService` инстанцируется при инициализации приложения (`app.post`).\n - Вызывает: метод `_channels` для регистрации каналов обработки данных, а также асинхронно запускает начальные действия (`_start_async`).\n - Читает и записывает состояние атрибутов сервиса.\n \n2. ControlActionSet\n - Используется внутри `ControlPlaneService`, роль модели указывается как \"default\".\nГраницы ответственности:\nГраница ответственности явно видна в коде следующим образом:\n- Сервис участвует в обработке данных, разделяя их на отдельные потоки (`dataflow slices`), что подтверждается методами и полями класса.\n- Регистрация каналов и управление ими выполняется непосредственно через инициализацию объекта сервиса.\n\nТаким образом, ControlPlaneService играет ключевую роль в управлении данными и потоками задач в системе, взаимодействуя с другими сервисами и компонентами через каналы передачи информации.", - "summary": { - "router": { - "intent": "CODE_QA", - "sub_intent": "ARCHITECTURE", - "confidence": null - }, - "retrieval": { - "profile": "code", - "layers_hit": [ - "C0_SOURCE_CHUNKS", - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS", - "C4_SEMANTIC_ROLES" - ], - "evidence_sufficient": true - }, - "llm": { - "answer_status": "answered", - "groundedness": "grounded" - } - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "ARCHITECTURE", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C4_SEMANTIC_ROLES", - "C3_ENTRYPOINTS", - "C2_DEPENDENCY_GRAPH", - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "ControlPlaneService" - ], - "keyword_hints": [ - "ControlPlaneService" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "execution": { - "executed_layers": [ - "C4_SEMANTIC_ROLES", - "C3_ENTRYPOINTS", - "C2_DEPENDENCY_GRAPH", - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS" - ], - "retrieval_mode_by_layer": { - "C4_SEMANTIC_ROLES": "exact_path_fetch", - "C3_ENTRYPOINTS": "exact_path_fetch", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C1_SYMBOL_CATALOG": "symbol_search", - "C0_SOURCE_CHUNKS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C4_SEMANTIC_ROLES": 12, - "C3_ENTRYPOINTS": 8, - "C2_DEPENDENCY_GRAPH": 8, - "C1_SYMBOL_CATALOG": 6, - "C0_SOURCE_CHUNKS": 4 - }, - "filters_by_layer": { - "C4_SEMANTIC_ROLES": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C1_SYMBOL_CATALOG": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C4_SEMANTIC_ROLES", - "query": "Какие компоненты участвуют в ControlPlaneService?", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 12, - "ranking_profile": "code" - }, - { - "layer": "C3_ENTRYPOINTS", - "query": "Какие компоненты участвуют в ControlPlaneService?", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "Какие компоненты участвуют в ControlPlaneService?", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C1_SYMBOL_CATALOG", - "query": "ControlPlaneService", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Какие компоненты участвуют в ControlPlaneService?", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 4, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C4_SEMANTIC_ROLES", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 12, - "candidates_after_filter": 12 - }, - { - "layer": "C3_ENTRYPOINTS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 3, - "candidates_after_filter": 3 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 1, - "candidates_after_filter": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 4, - "candidates_after_filter": 4 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "ControlPlaneService", - "alternatives": [ - "ControlPlaneService" - ] - }, - "layers": [ - { - "layer": "C4_SEMANTIC_ROLES", - "status": "hit", - "hit_count": 12, - "fail_reason": null - }, - { - "layer": "C3_ENTRYPOINTS", - "status": "hit", - "hit_count": 3, - "fail_reason": null - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 8, - "fail_reason": null - }, - { - "layer": "C1_SYMBOL_CATALOG", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 1, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "router": 0, - "symbol_resolution": 0, - "retrieval_total": 183, - "retrieval_by_layer": { - "C4_SEMANTIC_ROLES": 37, - "C3_ENTRYPOINTS": 23, - "C2_DEPENDENCY_GRAPH": 75, - "C1_SYMBOL_CATALOG": 26, - "C0_SOURCE_CHUNKS": 19 - }, - "merge_rank": 23, - "prompt_build": 0, - "llm_call": 1814 - }, - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 636, - "evidence_rows": 25, - "evidence_chars": 3723 - }, - "evidence_summary": [ - { - "layer": "C4_SEMANTIC_ROLES", - "count": 12, - "unique_paths": 11 - }, - { - "layer": "C3_ENTRYPOINTS", - "count": 3, - "unique_paths": 1 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "count": 8, - "unique_paths": 1 - }, - { - "layer": "C1_SYMBOL_CATALOG", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 1, - "unique_paths": 1 - } - ], - "prompt_template_id": "intent_code_qa_architecture_ru_v4", - "system_prompt_version": "v1" - }, - "router": { - "conversation_mode": "START", - "keyword_hints": [ - "ControlPlaneService" - ], - "path_scope": [] - }, - "llm": { - "used_evidence_count": 25, - "missing_evidence_reason": null - } - }, - "run_info": { - "case_id": "plba-v2-architecture-control-plane", - "mode": "full_chain", - "run_started_at": "2026-03-12T14:38:57", - "rag_session_id": "7d11da21-faa0-4cea-aede-aeabe069164c", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - }, - "input_request": { - "text": "Какие компоненты участвуют в ControlPlaneService?", - "normalized_query": "Какие компоненты участвуют в ControlPlaneService?" - }, - "steps": [ - { - "step": "intent_router", - "input": { - "query": "Какие компоненты участвуют в ControlPlaneService?" - }, - "output": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Какие компоненты участвуют в ControlPlaneService?" - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "ARCHITECTURE", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C4_SEMANTIC_ROLES", - "C3_ENTRYPOINTS", - "C2_DEPENDENCY_GRAPH", - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "ControlPlaneService" - ], - "keyword_hints": [ - "ControlPlaneService" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "timings_ms": { - "router": 0 - } - } - }, - { - "step": "retrieval", - "input": { - "query": "Какие компоненты участвуют в ControlPlaneService?" - }, - "output": { - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "ControlPlaneService", - "alternatives": [ - "ControlPlaneService" - ], - "confidence": 0.99 - }, - "rag_count": 25, - "rag_rows": [ - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests service\n- reads and writes state attributes\n- participates in dataflow slices (5)", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlPlaneService", - "span_start": 12, - "span_end": 52, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 68, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "b13471e5916986dccffb53fab613812842965705e6b3a89ae549d30c9e91e9aa", - "symbol_name": "ControlPlaneService", - "qname": "ControlPlaneService", - "role": "pipeline_stage", - "confidence": 0.57, - "dataflow_participation": 5, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "ControlActionSet\nrole: model\n\nResponsibilities:\n- default model role", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlActionSet", - "span_start": 14, - "span_end": 18, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 40, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "46eb026cb3313415ec47b82dd22f84f4d112c9d987e8b1716dcb0baa1cce8988", - "symbol_name": "ControlActionSet", - "qname": "ControlActionSet", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "ControlChannel\nrole: model\n\nResponsibilities:\n- default model role", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlChannel", - "span_start": 21, - "span_end": 28, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 40, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "cfcfe9a311d3a2dbdaf32ac4ccd73c0eb9a117f830591a1c0867ee97d46204ff", - "symbol_name": "ControlChannel", - "qname": "ControlChannel", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_runner.py", - "content": "UvicornThreadRunner\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (24)", - "layer": "C4_SEMANTIC_ROLES", - "title": "UvicornThreadRunner", - "span_start": 10, - "span_end": 61, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 11, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "fd55630045a02100df8877ac27d951ee08617d4598764394d48cb51fe067476a", - "symbol_name": "UvicornThreadRunner", - "qname": "UvicornThreadRunner", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 24, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "3779fdd2878b770e789a35bb2a89c9d79f13b61c26d7db1b3b683f9bb9e1623f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (10)", - "layer": "C4_SEMANTIC_ROLES", - "title": "HttpControlChannel", - "span_start": 12, - "span_end": 57, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 21, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "1c9fbdc24819e5604c26ea55428a74310f03a03e1af197ed84846af61e42fdb0", - "symbol_name": "HttpControlChannel", - "qname": "HttpControlChannel", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 10, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "HttpControlAppFactory\nrole: factory\n\nResponsibilities:\n- name suffix suggests factory", - "layer": "C4_SEMANTIC_ROLES", - "title": "HttpControlAppFactory", - "span_start": 15, - "span_end": 53, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 39, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "9b3502a5fb408b273223db13264349cf500de24915b6c649d9ea8970d0dfd8e0", - "symbol_name": "HttpControlAppFactory", - "qname": "HttpControlAppFactory", - "role": "factory", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/persistence/workflow_persistence.py", - "content": "WorkflowPersistence\nrole: pipeline_stage\n\nResponsibilities:\n- orchestrates role-like calls (2)\n- reads and writes state attributes\n- participates in dataflow slices (16)", - "layer": "C4_SEMANTIC_ROLES", - "title": "WorkflowPersistence", - "span_start": 8, - "span_end": 54, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 15, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "7bd01ee45cf31f2d5c2e3e51656254860ac785d10cef9e0852cd4fba90857bae", - "symbol_name": "WorkflowPersistence", - "qname": "WorkflowPersistence", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 16, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "80e9410ddc639789b4353c2a1a757ba8d0d5b5bb6075b0b263b61551f04ae1f0", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/queue/in_memory.py", - "content": "InMemoryTaskQueue\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (9)", - "layer": "C4_SEMANTIC_ROLES", - "title": "InMemoryTaskQueue", - "span_start": 9, - "span_end": 38, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 22, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "2da04cb94544a3bcbf0943a95ad4bdd8710bcafaa32a02fd0e4de2178dcf3533", - "symbol_name": "InMemoryTaskQueue", - "qname": "InMemoryTaskQueue", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 9, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "58f0cc001ccda0eee4c6bc32ed83bd05eafd6b6644f1e8b4aa9eed3103db73dc", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/config/file_loader.py", - "content": "ConfigFileLoader\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (8)", - "layer": "C4_SEMANTIC_ROLES", - "title": "ConfigFileLoader", - "span_start": 11, - "span_end": 48, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 23, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "a8474eca8b6e9dc86ae67ed68b16fa5fb639ef08739c053e7b7195489765667f", - "symbol_name": "ConfigFileLoader", - "qname": "ConfigFileLoader", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 8, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "1f19ffebde5e38e4be5a5d5a678059a0f36dedb8fb8b3e00ab395c67106a87ea", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/store.py", - "content": "TraceContextStore\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (6)", - "layer": "C4_SEMANTIC_ROLES", - "title": "TraceContextStore", - "span_start": 15, - "span_end": 52, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 25, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "b2dad4fbe16ffb11b58deba311c7739955c39d59f291b22181f33e9c8cce4059", - "symbol_name": "TraceContextStore", - "qname": "TraceContextStore", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 6, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "d369554f08fc92039c6edd5a2a1e73b23901533e8974459170bbd9347d263dc5", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workers/supervisor.py", - "content": "WorkerSupervisor\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (6)", - "layer": "C4_SEMANTIC_ROLES", - "title": "WorkerSupervisor", - "span_start": 10, - "span_end": 59, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 25, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "c17b44e8d9e97d490989b21fa67d7c346cdda8a0472e4c41fb243c8846faa124", - "symbol_name": "WorkerSupervisor", - "qname": "WorkerSupervisor", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 6, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "77609d9d5927171cce7fc3a54897c183fd63068710c6362029b700937aae5eee", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/engine/workflow_engine.py", - "content": "WorkflowEngine\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (6)", - "layer": "C4_SEMANTIC_ROLES", - "title": "WorkflowEngine", - "span_start": 10, - "span_end": 86, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 25, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "57ec0a9f11c542c78e008684a888397e8d9ef4223671acb2567e631a0cbc70b4", - "symbol_name": "WorkflowEngine", - "qname": "WorkflowEngine", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 6, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "1057136e58a325cd5ab6f4e265d15665fb6a711b7022d9fab52a1a290afa2368", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._start_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 47, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517", - "dst_ref": "ControlPlaneService._start_async", - "resolution": "resolved", - "slice_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._start_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.register_channel", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 17, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957", - "dst_ref": "ControlPlaneService.register_channel", - "resolution": "resolved", - "slice_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.register_channel" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.start", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 20, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154", - "dst_ref": "ControlPlaneService.start", - "resolution": "resolved", - "slice_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.start" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.stop", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 25, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d", - "dst_ref": "ControlPlaneService.stop", - "resolution": "resolved", - "slice_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.stop" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._stop_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 51, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a", - "dst_ref": "ControlPlaneService._stop_async", - "resolution": "resolved", - "slice_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._stop_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.start calls asyncio.run", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.start:calls", - "span_start": 22, - "span_end": 22, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "4e0b3147fb867d48d26567570c259f4052a739e3098133802d4b8bafcf03be6b", - "edge_type": "calls", - "src_symbol_id": "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154", - "src_qname": "ControlPlaneService.start", - "dst_symbol_id": null, - "dst_ref": "asyncio.run", - "resolution": "partial", - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.register_channel reads_attr ControlPlaneService._channels", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.register_channel:reads_attr", - "span_start": 17, - "span_end": 17, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "3101fdc99a7a9c5aebf18a024bc148d37b348248a6fd02b95724dff280f2908a", - "edge_type": "reads_attr", - "src_symbol_id": "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957", - "src_qname": "ControlPlaneService.register_channel", - "dst_symbol_id": null, - "dst_ref": "ControlPlaneService._channels", - "resolution": "partial", - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.start reads_attr ControlPlaneService._channels", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.start:reads_attr", - "span_start": 20, - "span_end": 20, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "9452e50ef27d47c30ee1c311c48fe73ecddbf7a6dbcf967a6345e98222d9f71a", - "edge_type": "reads_attr", - "src_symbol_id": "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154", - "src_qname": "ControlPlaneService.start", - "dst_symbol_id": null, - "dst_ref": "ControlPlaneService._channels", - "resolution": "partial", - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "class ControlPlaneService\nControlPlaneService", - "layer": "C1_SYMBOL_CATALOG", - "title": "ControlPlaneService", - "span_start": 12, - "span_end": 52, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "b13471e5916986dccffb53fab613812842965705e6b3a89ae549d30c9e91e9aa", - "qname": "ControlPlaneService", - "kind": "class", - "signature": "ControlPlaneService", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.control.service", - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "class ControlPlaneService:\n def __init__(self) -> None:\n self._channels: list[ControlChannel] = []\n\n def register_channel(self, channel: ControlChannel) -> None:\n self._channels.append(channel)\n\n def start(self, runtime: RuntimeManager) -> None:\n if not self._channels:\n return\n asyncio.run(self._start_async(runtime))\n\n def stop(self) -> None:\n if not self._channels:\n return\n asyncio.run(self._stop_async())\n\n def snapshot(self, runtime: RuntimeManager) -> dict[str, object]:\n health = runtime.current_health()\n return {\n \"runtime\": {\"state\": runtime._state.value},\n \"modules\": list(runtime.registry.modules),\n \"services\": runtime.services.snapshot(),\n \"workers\": runtime.workers.snapshot(),\n \"health\": runtime.health.snapshot(runtime.workers.healths()) | {\"status\": health[\"status\"]},\n \"config\": runtime.configuration.get(),\n }\n\n async def _start_async(self, runtime: RuntimeManager) -> None:\n actions = ControlActionSet(\n health=runtime.health_status,\n start=runtime.start_runtime,\n stop=runtime.stop_runtime,\n status=runtime.runtime_status,\n )\n for channel in self._channels:\n await channel.start(actions)\n\n async def _stop_async(self) -> None:\n for channel in reversed(self._channels):\n await channel.stop()", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/service.py:ControlPlaneService", - "span_start": 12, - "span_end": 52, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.service", - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ] - }, - "diagnostics": { - "execution": { - "executed_layers": [ - "C4_SEMANTIC_ROLES", - "C3_ENTRYPOINTS", - "C2_DEPENDENCY_GRAPH", - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS" - ], - "retrieval_mode_by_layer": { - "C4_SEMANTIC_ROLES": "exact_path_fetch", - "C3_ENTRYPOINTS": "exact_path_fetch", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C1_SYMBOL_CATALOG": "symbol_search", - "C0_SOURCE_CHUNKS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C4_SEMANTIC_ROLES": 12, - "C3_ENTRYPOINTS": 8, - "C2_DEPENDENCY_GRAPH": 8, - "C1_SYMBOL_CATALOG": 6, - "C0_SOURCE_CHUNKS": 4 - }, - "filters_by_layer": { - "C4_SEMANTIC_ROLES": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C1_SYMBOL_CATALOG": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C4_SEMANTIC_ROLES", - "query": "Какие компоненты участвуют в ControlPlaneService?", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 12, - "ranking_profile": "code" - }, - { - "layer": "C3_ENTRYPOINTS", - "query": "Какие компоненты участвуют в ControlPlaneService?", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "Какие компоненты участвуют в ControlPlaneService?", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C1_SYMBOL_CATALOG", - "query": "ControlPlaneService", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Какие компоненты участвуют в ControlPlaneService?", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 4, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C4_SEMANTIC_ROLES", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 12, - "candidates_after_filter": 12 - }, - { - "layer": "C3_ENTRYPOINTS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 3, - "candidates_after_filter": 3 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 1, - "candidates_after_filter": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 4, - "candidates_after_filter": 4 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "ControlPlaneService", - "alternatives": [ - "ControlPlaneService" - ] - }, - "layers": [ - { - "layer": "C4_SEMANTIC_ROLES", - "status": "hit", - "hit_count": 12, - "fail_reason": null - }, - { - "layer": "C3_ENTRYPOINTS", - "status": "hit", - "hit_count": 3, - "fail_reason": null - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 8, - "fail_reason": null - }, - { - "layer": "C1_SYMBOL_CATALOG", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 1, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "symbol_resolution": 0, - "retrieval_total": 183, - "retrieval_by_layer": { - "C4_SEMANTIC_ROLES": 37, - "C3_ENTRYPOINTS": 23, - "C2_DEPENDENCY_GRAPH": 75, - "C1_SYMBOL_CATALOG": 26, - "C0_SOURCE_CHUNKS": 19 - }, - "merge_rank": 23 - } - } - }, - { - "step": "llm_answer", - "input": { - "query": "Какие компоненты участвуют в ControlPlaneService?", - "rag_count": 25 - }, - "output": { - "llm_answer": "В подсистеме ControlPlaneService можно выделить следующие компоненты и связи между ними на основе доступных контекстных слоев:\nКомпоненты и связи:\n1. ControlPlaneService\n - Создаёт: `ControlPlaneService` инстанцируется при инициализации приложения (`app.post`).\n - Вызывает: метод `_channels` для регистрации каналов обработки данных, а также асинхронно запускает начальные действия (`_start_async`).\n - Читает и записывает состояние атрибутов сервиса.\n \n2. ControlActionSet\n - Используется внутри `ControlPlaneService`, роль модели указывается как \"default\".\nГраницы ответственности:\nГраница ответственности явно видна в коде следующим образом:\n- Сервис участвует в обработке данных, разделяя их на отдельные потоки (`dataflow slices`), что подтверждается методами и полями класса.\n- Регистрация каналов и управление ими выполняется непосредственно через инициализацию объекта сервиса.\n\nТаким образом, ControlPlaneService играет ключевую роль в управлении данными и потоками задач в системе, взаимодействуя с другими сервисами и компонентами через каналы передачи информации." - }, - "diagnostics": { - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 636, - "evidence_rows": 25, - "evidence_chars": 3723 - }, - "evidence_summary": [ - { - "layer": "C4_SEMANTIC_ROLES", - "count": 12, - "unique_paths": 11 - }, - { - "layer": "C3_ENTRYPOINTS", - "count": 3, - "unique_paths": 1 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "count": 8, - "unique_paths": 1 - }, - { - "layer": "C1_SYMBOL_CATALOG", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 1, - "unique_paths": 1 - } - ], - "prompt_template_id": "intent_code_qa_architecture_ru_v4", - "system_prompt_version": "v1" - }, - "timings_ms": { - "prompt_build": 0, - "llm_call": 1814 - } - } - } - ] - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_143856/full_chain_plba_code_subintents_v2_plba-v2-architecture-control-plane.md b/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_143856/full_chain_plba_code_subintents_v2_plba-v2-architecture-control-plane.md deleted file mode 100644 index 9e874ab..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_143856/full_chain_plba_code_subintents_v2_plba-v2-architecture-control-plane.md +++ /dev/null @@ -1,34 +0,0 @@ -# plba-v2-architecture-control-plane - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_subintents_v2.yaml -- runner: runtime -- mode: full_chain -- passed: True - -## Query -Какие компоненты участвуют в ControlPlaneService? - -## Actual -{ - "intent": "CODE_QA", - "sub_intent": "ARCHITECTURE", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 25, - "llm_answer": "В подсистеме ControlPlaneService можно выделить следующие компоненты и связи между ними на основе доступных контекстных слоев:\nКомпоненты и связи:\n1. ControlPlaneService\n - Создаёт: `ControlPlaneService` инстанцируется при инициализации приложения (`app.post`).\n - Вызывает: метод `_channels` для регистрации каналов обработки данных, а также асинхронно запускает начальные действия (`_start_async`).\n - Читает и записывает состояние атрибутов сервиса.\n \n2. ControlActionSet\n - Используется внутри `ControlPlaneService`, роль модели указывается как \"default\".\nГраницы ответственности:\nГраница ответственности явно видна в коде следующим образом:\n- Сервис участвует в обработке данных, разделяя их на отдельные потоки (`dataflow slices`), что подтверждается методами и полями класса.\n- Регистрация каналов и управление ими выполняется непосредственно через инициализацию объекта сервиса.\n\nТаким образом, ControlPlaneService играет ключевую роль в управлении данными и потоками задач в системе, взаимодействуя с другими сервисами и компонентами через каналы передачи информации.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "ControlPlaneService" - ], - "layers": [ - "C4_SEMANTIC_ROLES", - "C3_ENTRYPOINTS", - "C2_DEPENDENCY_GRAPH", - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS" - ] -} - -## Mismatches -- none \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_143856/full_chain_plba_code_subintents_v2_plba-v2-architecture-runtime-manager.json b/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_143856/full_chain_plba_code_subintents_v2_plba-v2-architecture-runtime-manager.json deleted file mode 100644 index 3389771..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_143856/full_chain_plba_code_subintents_v2_plba-v2-architecture-runtime-manager.json +++ /dev/null @@ -1,3036 +0,0 @@ -{ - "case_id": "plba-v2-architecture-runtime-manager", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_subintents_v2.yaml", - "runner": "runtime", - "mode": "full_chain", - "actual": { - "intent": "CODE_QA", - "sub_intent": "ARCHITECTURE", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 25, - "llm_answer": "В подсистеме RuntimeManager участвуют следующие компоненты и устанавливаются явные связи между ними:\n\n1. RuntimeManager — главный менеджер выполнения, создающий и запускающий рабочие потоки.\n - Создаёт экземпляр конфигурации (`configuration`).\n - Вызывает метод `start`, инициирующий выполнение основной логики.\n \n2. ControlPlaneService — сервис управления каналами и рабочими потоками.\n - Контролирует каналы передачи данных (`_channels`) и инициализирует асинхронную обработку (`_start_async`).\n\nЭти компоненты связаны следующим образом:\n- RuntimeManager управляет созданием экземпляра Configuration и вызовом метода start для запуска процессов.\n- ControlPlaneService отвечает за организацию каналов обмена данными и старт задач с использованием асинхронных механизмов.\n\nГраницы ответственности:\n- RuntimeManager выполняет диспетчеризацию и координацию рабочих потоков на уровне runtime.\n- ControlPlaneService реализует низкоуровневую инфраструктуру управления задачами и каналами данных.\n\nТаким образом, RuntimeManager работает как центрального координатора всех процессов исполнения, тогда как ControlPlaneService обеспечивает необходимую инфраструктуру и контроль над каналами взаимодействия.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "RuntimeManager" - ], - "layers": [ - "C4_SEMANTIC_ROLES", - "C3_ENTRYPOINTS", - "C2_DEPENDENCY_GRAPH", - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS" - ] - }, - "passed": true, - "mismatches": [], - "details": { - "case_id": "plba-v2-architecture-runtime-manager", - "text": "Какие компоненты участвуют в RuntimeManager?", - "mode": "full_chain", - "run_started_at": "2026-03-12T14:38:57", - "rag_session_id": "7d11da21-faa0-4cea-aede-aeabe069164c", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Какие компоненты участвуют в RuntimeManager?", - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "RuntimeManager", - "alternatives": [ - "RuntimeManager" - ], - "confidence": 0.99 - }, - "rag_count": 25, - "rag_rows": [ - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests manager\n- orchestrates role-like calls (4)\n- reads and writes state attributes\n- participates in dataflow slices (50)", - "layer": "C4_SEMANTIC_ROLES", - "title": "RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 43, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "7e4a9381328c5803bbc6179458612fc4e947d928aa7bf8b4b2bebb2c8592f758", - "symbol_name": "RuntimeManager", - "qname": "RuntimeManager", - "role": "pipeline_stage", - "confidence": 0.67, - "dataflow_participation": 50, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "ControlActionSet\nrole: model\n\nResponsibilities:\n- default model role", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlActionSet", - "span_start": 14, - "span_end": 18, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 40, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "46eb026cb3313415ec47b82dd22f84f4d112c9d987e8b1716dcb0baa1cce8988", - "symbol_name": "ControlActionSet", - "qname": "ControlActionSet", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "ControlChannel\nrole: model\n\nResponsibilities:\n- default model role", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlChannel", - "span_start": 21, - "span_end": 28, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 40, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "cfcfe9a311d3a2dbdaf32ac4ccd73c0eb9a117f830591a1c0867ee97d46204ff", - "symbol_name": "ControlChannel", - "qname": "ControlChannel", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests service\n- reads and writes state attributes\n- participates in dataflow slices (5)", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlPlaneService", - "span_start": 12, - "span_end": 52, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 68, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "b13471e5916986dccffb53fab613812842965705e6b3a89ae549d30c9e91e9aa", - "symbol_name": "ControlPlaneService", - "qname": "ControlPlaneService", - "role": "pipeline_stage", - "confidence": 0.57, - "dataflow_participation": 5, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_runner.py", - "content": "UvicornThreadRunner\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (24)", - "layer": "C4_SEMANTIC_ROLES", - "title": "UvicornThreadRunner", - "span_start": 10, - "span_end": 61, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 11, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "fd55630045a02100df8877ac27d951ee08617d4598764394d48cb51fe067476a", - "symbol_name": "UvicornThreadRunner", - "qname": "UvicornThreadRunner", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 24, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "3779fdd2878b770e789a35bb2a89c9d79f13b61c26d7db1b3b683f9bb9e1623f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (10)", - "layer": "C4_SEMANTIC_ROLES", - "title": "HttpControlChannel", - "span_start": 12, - "span_end": 57, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 21, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "1c9fbdc24819e5604c26ea55428a74310f03a03e1af197ed84846af61e42fdb0", - "symbol_name": "HttpControlChannel", - "qname": "HttpControlChannel", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 10, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "HttpControlAppFactory\nrole: factory\n\nResponsibilities:\n- name suffix suggests factory", - "layer": "C4_SEMANTIC_ROLES", - "title": "HttpControlAppFactory", - "span_start": 15, - "span_end": 53, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 39, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "9b3502a5fb408b273223db13264349cf500de24915b6c649d9ea8970d0dfd8e0", - "symbol_name": "HttpControlAppFactory", - "qname": "HttpControlAppFactory", - "role": "factory", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/persistence/workflow_persistence.py", - "content": "WorkflowPersistence\nrole: pipeline_stage\n\nResponsibilities:\n- orchestrates role-like calls (2)\n- reads and writes state attributes\n- participates in dataflow slices (16)", - "layer": "C4_SEMANTIC_ROLES", - "title": "WorkflowPersistence", - "span_start": 8, - "span_end": 54, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 15, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "7bd01ee45cf31f2d5c2e3e51656254860ac785d10cef9e0852cd4fba90857bae", - "symbol_name": "WorkflowPersistence", - "qname": "WorkflowPersistence", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 16, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "80e9410ddc639789b4353c2a1a757ba8d0d5b5bb6075b0b263b61551f04ae1f0", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/queue/in_memory.py", - "content": "InMemoryTaskQueue\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (9)", - "layer": "C4_SEMANTIC_ROLES", - "title": "InMemoryTaskQueue", - "span_start": 9, - "span_end": 38, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 22, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "2da04cb94544a3bcbf0943a95ad4bdd8710bcafaa32a02fd0e4de2178dcf3533", - "symbol_name": "InMemoryTaskQueue", - "qname": "InMemoryTaskQueue", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 9, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "58f0cc001ccda0eee4c6bc32ed83bd05eafd6b6644f1e8b4aa9eed3103db73dc", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/config/file_loader.py", - "content": "ConfigFileLoader\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (8)", - "layer": "C4_SEMANTIC_ROLES", - "title": "ConfigFileLoader", - "span_start": 11, - "span_end": 48, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 23, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "a8474eca8b6e9dc86ae67ed68b16fa5fb639ef08739c053e7b7195489765667f", - "symbol_name": "ConfigFileLoader", - "qname": "ConfigFileLoader", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 8, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "1f19ffebde5e38e4be5a5d5a678059a0f36dedb8fb8b3e00ab395c67106a87ea", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/store.py", - "content": "TraceContextStore\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (6)", - "layer": "C4_SEMANTIC_ROLES", - "title": "TraceContextStore", - "span_start": 15, - "span_end": 52, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 25, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "b2dad4fbe16ffb11b58deba311c7739955c39d59f291b22181f33e9c8cce4059", - "symbol_name": "TraceContextStore", - "qname": "TraceContextStore", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 6, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "d369554f08fc92039c6edd5a2a1e73b23901533e8974459170bbd9347d263dc5", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workers/supervisor.py", - "content": "WorkerSupervisor\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (6)", - "layer": "C4_SEMANTIC_ROLES", - "title": "WorkerSupervisor", - "span_start": 10, - "span_end": 59, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 25, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "c17b44e8d9e97d490989b21fa67d7c346cdda8a0472e4c41fb243c8846faa124", - "symbol_name": "WorkerSupervisor", - "qname": "WorkerSupervisor", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 6, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "77609d9d5927171cce7fc3a54897c183fd63068710c6362029b700937aae5eee", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._start_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 47, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517", - "dst_ref": "ControlPlaneService._start_async", - "resolution": "resolved", - "slice_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._start_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager.start", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 32, - "span_end": 59, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "98312ace7fc62b1c7194c5aa1732b6ef736eae1668a3a120dd1ecd5ab1d64f7a", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "77a7b260193018845e4e204df094ab89cfd7c82ee4e822b3a83ad4cd945f9cb1", - "dst_ref": "RuntimeManager.start", - "resolution": "resolved", - "slice_id": "98312ace7fc62b1c7194c5aa1732b6ef736eae1668a3a120dd1ecd5ab1d64f7a", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager.start" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "77a7b260193018845e4e204df094ab89cfd7c82ee4e822b3a83ad4cd945f9cb1" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.start", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 20, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154", - "dst_ref": "ControlPlaneService.start", - "resolution": "resolved", - "slice_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.start" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.stop", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 25, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d", - "dst_ref": "ControlPlaneService.stop", - "resolution": "resolved", - "slice_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.stop" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._stop_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 51, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a", - "dst_ref": "ControlPlaneService._stop_async", - "resolution": "resolved", - "slice_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._stop_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager.add_config_file", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 32, - "span_end": 52, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "a23b8a11ebdb12708b60c96ea12a69f7f042082f1adfddd572444e246d81d167", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "57ffbd4f0d9fdf3507c2b8624312ce211f3d02fdf86a57a8ec90778d8a7b498d", - "dst_ref": "RuntimeManager.add_config_file", - "resolution": "resolved", - "slice_id": "a23b8a11ebdb12708b60c96ea12a69f7f042082f1adfddd572444e246d81d167", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager.add_config_file" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "57ffbd4f0d9fdf3507c2b8624312ce211f3d02fdf86a57a8ec90778d8a7b498d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.register_channel", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 17, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957", - "dst_ref": "ControlPlaneService.register_channel", - "resolution": "resolved", - "slice_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.register_channel" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager._register_core_services", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 32, - "span_end": 127, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "3e5811f3b511fa0cabe363f5d01f2ac5fa039bc8b93f7ee108323e1f5f45a293", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "972d6057a6caac9cf31ebc1e29c6f39f71b10d4cc170dec57cf875ba458549c6", - "dst_ref": "RuntimeManager._register_core_services", - "resolution": "resolved", - "slice_id": "3e5811f3b511fa0cabe363f5d01f2ac5fa039bc8b93f7ee108323e1f5f45a293", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager._register_core_services" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "972d6057a6caac9cf31ebc1e29c6f39f71b10d4cc170dec57cf875ba458549c6" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "class RuntimeManager\nRuntimeManager", - "layer": "C1_SYMBOL_CATALOG", - "title": "RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "7e4a9381328c5803bbc6179458612fc4e947d928aa7bf8b4b2bebb2c8592f758", - "qname": "RuntimeManager", - "kind": "class", - "signature": "RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.core.runtime", - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "class RuntimeManager:\n ACTION_TIMEOUT_SECONDS = 10.0\n ACTION_POLL_INTERVAL_SECONDS = 0.05\n\n def __init__(\n self,\n configuration: ConfigurationManager | None = None,\n services: ServiceContainer | None = None,\n traces: TraceService | None = None,\n health: HealthRegistry | None = None,\n logs: LogManager | None = None,\n workers: WorkerSupervisor | None = None,\n control_plane: ControlPlaneService | None = None,\n ) -> None:\n self.configuration = configuration or ConfigurationManager()\n self.services = services or ServiceContainer()\n self.traces = traces or TraceService()\n self.health = health or HealthRegistry()\n self.logs = logs or LogManager()\n self.workers = workers or WorkerSupervisor()\n self.control_plane = control_plane or ControlPlaneService()\n self.registry = ModuleRegistry(self.services)\n self._started = False\n self._state = LifecycleState.IDLE\n self._core_registered = False\n self._workers_registered = False\n self._register_core_services()\n\n def register_module(self, module: ApplicationModule) -> None:\n self.registry.register_module(module.name)\n module.register(self.registry)\n\n def add_config_file(self, path: str) -> FileConfigProvider:\n provider = FileConfigProvider(path)\n self.configuration.add_provider(provider)\n return provider\n\n def start(self, *, start_control_plane: bool = True) -> None:\n if self._started:\n return\n self._state = LifecycleState.STARTING\n config = self.configuration.load()\n self.logs.apply_config(config)\n self._register_health_contributors()\n self._register_workers()\n self.workers.start()\n if start_control_plane:\n self.control_plane.start(self)\n self._started = True\n self._refresh_state()\n\n def stop(self, timeout: float = 30.0, force: bool = False, stop_control_plane: bool = True) -> None:\n if not self._started:\n return\n self._state = LifecycleState.STOPPING\n self.workers.stop(timeout=timeout, force=force)\n if stop_control_plane:\n self.control_plane.stop()\n self._started = False\n self._state = LifecycleState.STOPPED\n\n def status(self) -> dict[str, object]:\n self._refresh_state()\n return self.control_plane.snapshot(self)\n\n def current_health(self) -> HealthPayload:\n self._refresh_state()\n return self.health.payload(self._state, self.workers.healths())\n\n async def health_status(self) -> HealthPayload:\n return self.current_health()\n\n async def start_runtime(self) -> dict[str, object] | str:\n self._refresh_state()\n if self._started:\n return \"runtime already running\"\n if self._state == LifecycleState.STOPPING:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n\n self.start(start_control_plane=False)\n started = self._wait_for_state({LifecycleState.IDLE, LifecycleState.BUSY}, timeout=self.ACTION_TIMEOUT_SECONDS)\n if started:\n return self._action_detail(\"runtime started\", timed_out=False)\n return self._action_detail(\"runtime start is still in progress\", timed_out=True)\n\n async def stop_runtime(self) -> dict[str, object] | str:\n self._refresh_state()\n if not self._started:\n if self._state == LifecycleState.STOPPING:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n return \"runtime already stopped\"\n\n self._state = LifecycleState.STOPPING\n try:\n self.workers.stop(timeout=self.ACTION_TIMEOUT_SECONDS, force=False)\n except TimeoutError:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n\n self._started = False\n self._state = LifecycleState.STOPPED\n return self._action_detail(\"runtime stopped\", timed_out=False)\n\n async def runtime_status(self) -> str:\n self._refresh_state()\n return self._state.value\n\n def _register_core_services(self) -> None:\n if self._core_registered:\n return\n self.services.register(\"configuration\", self.configuration)\n self.services.register(\"traces\", self.traces)\n self.services.register(\"health\", self.health)\n self.services.register(\"logs\", self.logs)\n self.services.register(\"workers\", self.workers)\n self.services.register(\"control_plane\", self.control_plane)\n self._core_registered = True\n\n def _register_health_contributors(self) -> None:\n for contributor in self.registry.health_contributors:\n self.health.register(contributor)\n\n def _register_workers(self) -> None:\n if self._workers_registered:\n return\n for worker in self.registry.workers:\n self.workers.register(worker)\n self._workers_registered = True\n\n def _refresh_state(self) -> None:\n lifecycle = self.workers.lifecycle_state()\n\n if self._state == LifecycleState.STOPPING:\n if lifecycle == LifecycleState.STOPPED:\n self._started = False\n self._state = LifecycleState.STOPPED\n return\n\n if not self._started:\n if lifecycle == LifecycleState.STOPPED:\n self._state = LifecycleState.STOPPED\n return\n\n self._state = lifecycle\n\n def _wait_for_state(self, target_states: set[LifecycleState], *, timeout: float) -> bool:\n deadline = monotonic() + timeout\n while monotonic() < deadline:\n self._refresh_state()\n if self._state in target_states:\n return True\n sleep(self.ACTION_POLL_INTERVAL_SECONDS)\n self._refresh_state()\n return self._state in target_states\n\n def _action_detail(self, message: str, *, timed_out: bool) -> dict[str, object]:\n self._refresh_state()\n return {\n \"message\": message,\n \"state\": self._state.value,\n \"timed_out\": timed_out,\n \"workers\": self.workers.snapshot(),\n }", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/core/runtime.py:RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.core.runtime", - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "llm_answer": "В подсистеме RuntimeManager участвуют следующие компоненты и устанавливаются явные связи между ними:\n\n1. RuntimeManager — главный менеджер выполнения, создающий и запускающий рабочие потоки.\n - Создаёт экземпляр конфигурации (`configuration`).\n - Вызывает метод `start`, инициирующий выполнение основной логики.\n \n2. ControlPlaneService — сервис управления каналами и рабочими потоками.\n - Контролирует каналы передачи данных (`_channels`) и инициализирует асинхронную обработку (`_start_async`).\n\nЭти компоненты связаны следующим образом:\n- RuntimeManager управляет созданием экземпляра Configuration и вызовом метода start для запуска процессов.\n- ControlPlaneService отвечает за организацию каналов обмена данными и старт задач с использованием асинхронных механизмов.\n\nГраницы ответственности:\n- RuntimeManager выполняет диспетчеризацию и координацию рабочих потоков на уровне runtime.\n- ControlPlaneService реализует низкоуровневую инфраструктуру управления задачами и каналами данных.\n\nТаким образом, RuntimeManager работает как центрального координатора всех процессов исполнения, тогда как ControlPlaneService обеспечивает необходимую инфраструктуру и контроль над каналами взаимодействия.", - "summary": { - "router": { - "intent": "CODE_QA", - "sub_intent": "ARCHITECTURE", - "confidence": null - }, - "retrieval": { - "profile": "code", - "layers_hit": [ - "C0_SOURCE_CHUNKS", - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS", - "C4_SEMANTIC_ROLES" - ], - "evidence_sufficient": true - }, - "llm": { - "answer_status": "answered", - "groundedness": "grounded" - } - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "ARCHITECTURE", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C4_SEMANTIC_ROLES", - "C3_ENTRYPOINTS", - "C2_DEPENDENCY_GRAPH", - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "RuntimeManager" - ], - "keyword_hints": [ - "RuntimeManager" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "execution": { - "executed_layers": [ - "C4_SEMANTIC_ROLES", - "C3_ENTRYPOINTS", - "C2_DEPENDENCY_GRAPH", - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS" - ], - "retrieval_mode_by_layer": { - "C4_SEMANTIC_ROLES": "exact_path_fetch", - "C3_ENTRYPOINTS": "exact_path_fetch", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C1_SYMBOL_CATALOG": "symbol_search", - "C0_SOURCE_CHUNKS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C4_SEMANTIC_ROLES": 12, - "C3_ENTRYPOINTS": 8, - "C2_DEPENDENCY_GRAPH": 8, - "C1_SYMBOL_CATALOG": 6, - "C0_SOURCE_CHUNKS": 4 - }, - "filters_by_layer": { - "C4_SEMANTIC_ROLES": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C1_SYMBOL_CATALOG": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C4_SEMANTIC_ROLES", - "query": "Какие компоненты участвуют в RuntimeManager?", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 12, - "ranking_profile": "code" - }, - { - "layer": "C3_ENTRYPOINTS", - "query": "Какие компоненты участвуют в RuntimeManager?", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "Какие компоненты участвуют в RuntimeManager?", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C1_SYMBOL_CATALOG", - "query": "RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Какие компоненты участвуют в RuntimeManager?", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 4, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C4_SEMANTIC_ROLES", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 12, - "candidates_after_filter": 12 - }, - { - "layer": "C3_ENTRYPOINTS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 3, - "candidates_after_filter": 3 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 1, - "candidates_after_filter": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 4, - "candidates_after_filter": 4 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "RuntimeManager", - "alternatives": [ - "RuntimeManager" - ] - }, - "layers": [ - { - "layer": "C4_SEMANTIC_ROLES", - "status": "hit", - "hit_count": 12, - "fail_reason": null - }, - { - "layer": "C3_ENTRYPOINTS", - "status": "hit", - "hit_count": 3, - "fail_reason": null - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 8, - "fail_reason": null - }, - { - "layer": "C1_SYMBOL_CATALOG", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 1, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "router": 1, - "symbol_resolution": 0, - "retrieval_total": 181, - "retrieval_by_layer": { - "C4_SEMANTIC_ROLES": 41, - "C3_ENTRYPOINTS": 21, - "C2_DEPENDENCY_GRAPH": 74, - "C1_SYMBOL_CATALOG": 27, - "C0_SOURCE_CHUNKS": 17 - }, - "merge_rank": 25, - "prompt_build": 0, - "llm_call": 1787 - }, - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 628, - "evidence_rows": 25, - "evidence_chars": 8651 - }, - "evidence_summary": [ - { - "layer": "C4_SEMANTIC_ROLES", - "count": 12, - "unique_paths": 11 - }, - { - "layer": "C3_ENTRYPOINTS", - "count": 3, - "unique_paths": 1 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "count": 8, - "unique_paths": 2 - }, - { - "layer": "C1_SYMBOL_CATALOG", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 1, - "unique_paths": 1 - } - ], - "prompt_template_id": "intent_code_qa_architecture_ru_v4", - "system_prompt_version": "v1" - }, - "router": { - "conversation_mode": "START", - "keyword_hints": [ - "RuntimeManager" - ], - "path_scope": [] - }, - "llm": { - "used_evidence_count": 25, - "missing_evidence_reason": null - } - }, - "run_info": { - "case_id": "plba-v2-architecture-runtime-manager", - "mode": "full_chain", - "run_started_at": "2026-03-12T14:38:57", - "rag_session_id": "7d11da21-faa0-4cea-aede-aeabe069164c", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - }, - "input_request": { - "text": "Какие компоненты участвуют в RuntimeManager?", - "normalized_query": "Какие компоненты участвуют в RuntimeManager?" - }, - "steps": [ - { - "step": "intent_router", - "input": { - "query": "Какие компоненты участвуют в RuntimeManager?" - }, - "output": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Какие компоненты участвуют в RuntimeManager?" - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "ARCHITECTURE", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C4_SEMANTIC_ROLES", - "C3_ENTRYPOINTS", - "C2_DEPENDENCY_GRAPH", - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "RuntimeManager" - ], - "keyword_hints": [ - "RuntimeManager" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "timings_ms": { - "router": 1 - } - } - }, - { - "step": "retrieval", - "input": { - "query": "Какие компоненты участвуют в RuntimeManager?" - }, - "output": { - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "RuntimeManager", - "alternatives": [ - "RuntimeManager" - ], - "confidence": 0.99 - }, - "rag_count": 25, - "rag_rows": [ - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests manager\n- orchestrates role-like calls (4)\n- reads and writes state attributes\n- participates in dataflow slices (50)", - "layer": "C4_SEMANTIC_ROLES", - "title": "RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 43, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "7e4a9381328c5803bbc6179458612fc4e947d928aa7bf8b4b2bebb2c8592f758", - "symbol_name": "RuntimeManager", - "qname": "RuntimeManager", - "role": "pipeline_stage", - "confidence": 0.67, - "dataflow_participation": 50, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "ControlActionSet\nrole: model\n\nResponsibilities:\n- default model role", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlActionSet", - "span_start": 14, - "span_end": 18, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 40, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "46eb026cb3313415ec47b82dd22f84f4d112c9d987e8b1716dcb0baa1cce8988", - "symbol_name": "ControlActionSet", - "qname": "ControlActionSet", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "ControlChannel\nrole: model\n\nResponsibilities:\n- default model role", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlChannel", - "span_start": 21, - "span_end": 28, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 40, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "cfcfe9a311d3a2dbdaf32ac4ccd73c0eb9a117f830591a1c0867ee97d46204ff", - "symbol_name": "ControlChannel", - "qname": "ControlChannel", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests service\n- reads and writes state attributes\n- participates in dataflow slices (5)", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlPlaneService", - "span_start": 12, - "span_end": 52, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 68, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "b13471e5916986dccffb53fab613812842965705e6b3a89ae549d30c9e91e9aa", - "symbol_name": "ControlPlaneService", - "qname": "ControlPlaneService", - "role": "pipeline_stage", - "confidence": 0.57, - "dataflow_participation": 5, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_runner.py", - "content": "UvicornThreadRunner\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (24)", - "layer": "C4_SEMANTIC_ROLES", - "title": "UvicornThreadRunner", - "span_start": 10, - "span_end": 61, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 11, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "fd55630045a02100df8877ac27d951ee08617d4598764394d48cb51fe067476a", - "symbol_name": "UvicornThreadRunner", - "qname": "UvicornThreadRunner", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 24, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "3779fdd2878b770e789a35bb2a89c9d79f13b61c26d7db1b3b683f9bb9e1623f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (10)", - "layer": "C4_SEMANTIC_ROLES", - "title": "HttpControlChannel", - "span_start": 12, - "span_end": 57, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 21, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "1c9fbdc24819e5604c26ea55428a74310f03a03e1af197ed84846af61e42fdb0", - "symbol_name": "HttpControlChannel", - "qname": "HttpControlChannel", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 10, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "HttpControlAppFactory\nrole: factory\n\nResponsibilities:\n- name suffix suggests factory", - "layer": "C4_SEMANTIC_ROLES", - "title": "HttpControlAppFactory", - "span_start": 15, - "span_end": 53, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 39, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "9b3502a5fb408b273223db13264349cf500de24915b6c649d9ea8970d0dfd8e0", - "symbol_name": "HttpControlAppFactory", - "qname": "HttpControlAppFactory", - "role": "factory", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/persistence/workflow_persistence.py", - "content": "WorkflowPersistence\nrole: pipeline_stage\n\nResponsibilities:\n- orchestrates role-like calls (2)\n- reads and writes state attributes\n- participates in dataflow slices (16)", - "layer": "C4_SEMANTIC_ROLES", - "title": "WorkflowPersistence", - "span_start": 8, - "span_end": 54, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 15, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "7bd01ee45cf31f2d5c2e3e51656254860ac785d10cef9e0852cd4fba90857bae", - "symbol_name": "WorkflowPersistence", - "qname": "WorkflowPersistence", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 16, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "80e9410ddc639789b4353c2a1a757ba8d0d5b5bb6075b0b263b61551f04ae1f0", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/queue/in_memory.py", - "content": "InMemoryTaskQueue\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (9)", - "layer": "C4_SEMANTIC_ROLES", - "title": "InMemoryTaskQueue", - "span_start": 9, - "span_end": 38, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 22, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "2da04cb94544a3bcbf0943a95ad4bdd8710bcafaa32a02fd0e4de2178dcf3533", - "symbol_name": "InMemoryTaskQueue", - "qname": "InMemoryTaskQueue", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 9, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "58f0cc001ccda0eee4c6bc32ed83bd05eafd6b6644f1e8b4aa9eed3103db73dc", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/config/file_loader.py", - "content": "ConfigFileLoader\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (8)", - "layer": "C4_SEMANTIC_ROLES", - "title": "ConfigFileLoader", - "span_start": 11, - "span_end": 48, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 23, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "a8474eca8b6e9dc86ae67ed68b16fa5fb639ef08739c053e7b7195489765667f", - "symbol_name": "ConfigFileLoader", - "qname": "ConfigFileLoader", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 8, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "1f19ffebde5e38e4be5a5d5a678059a0f36dedb8fb8b3e00ab395c67106a87ea", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/store.py", - "content": "TraceContextStore\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (6)", - "layer": "C4_SEMANTIC_ROLES", - "title": "TraceContextStore", - "span_start": 15, - "span_end": 52, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 25, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "b2dad4fbe16ffb11b58deba311c7739955c39d59f291b22181f33e9c8cce4059", - "symbol_name": "TraceContextStore", - "qname": "TraceContextStore", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 6, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "d369554f08fc92039c6edd5a2a1e73b23901533e8974459170bbd9347d263dc5", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workers/supervisor.py", - "content": "WorkerSupervisor\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (6)", - "layer": "C4_SEMANTIC_ROLES", - "title": "WorkerSupervisor", - "span_start": 10, - "span_end": 59, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 25, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "c17b44e8d9e97d490989b21fa67d7c346cdda8a0472e4c41fb243c8846faa124", - "symbol_name": "WorkerSupervisor", - "qname": "WorkerSupervisor", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 6, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "77609d9d5927171cce7fc3a54897c183fd63068710c6362029b700937aae5eee", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._start_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 47, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517", - "dst_ref": "ControlPlaneService._start_async", - "resolution": "resolved", - "slice_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._start_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager.start", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 32, - "span_end": 59, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "98312ace7fc62b1c7194c5aa1732b6ef736eae1668a3a120dd1ecd5ab1d64f7a", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "77a7b260193018845e4e204df094ab89cfd7c82ee4e822b3a83ad4cd945f9cb1", - "dst_ref": "RuntimeManager.start", - "resolution": "resolved", - "slice_id": "98312ace7fc62b1c7194c5aa1732b6ef736eae1668a3a120dd1ecd5ab1d64f7a", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager.start" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "77a7b260193018845e4e204df094ab89cfd7c82ee4e822b3a83ad4cd945f9cb1" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.start", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 20, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154", - "dst_ref": "ControlPlaneService.start", - "resolution": "resolved", - "slice_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.start" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.stop", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 25, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d", - "dst_ref": "ControlPlaneService.stop", - "resolution": "resolved", - "slice_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.stop" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._stop_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 51, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a", - "dst_ref": "ControlPlaneService._stop_async", - "resolution": "resolved", - "slice_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._stop_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager.add_config_file", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 32, - "span_end": 52, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "a23b8a11ebdb12708b60c96ea12a69f7f042082f1adfddd572444e246d81d167", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "57ffbd4f0d9fdf3507c2b8624312ce211f3d02fdf86a57a8ec90778d8a7b498d", - "dst_ref": "RuntimeManager.add_config_file", - "resolution": "resolved", - "slice_id": "a23b8a11ebdb12708b60c96ea12a69f7f042082f1adfddd572444e246d81d167", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager.add_config_file" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "57ffbd4f0d9fdf3507c2b8624312ce211f3d02fdf86a57a8ec90778d8a7b498d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.register_channel", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 17, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957", - "dst_ref": "ControlPlaneService.register_channel", - "resolution": "resolved", - "slice_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.register_channel" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager._register_core_services", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 32, - "span_end": 127, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "3e5811f3b511fa0cabe363f5d01f2ac5fa039bc8b93f7ee108323e1f5f45a293", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "972d6057a6caac9cf31ebc1e29c6f39f71b10d4cc170dec57cf875ba458549c6", - "dst_ref": "RuntimeManager._register_core_services", - "resolution": "resolved", - "slice_id": "3e5811f3b511fa0cabe363f5d01f2ac5fa039bc8b93f7ee108323e1f5f45a293", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager._register_core_services" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "972d6057a6caac9cf31ebc1e29c6f39f71b10d4cc170dec57cf875ba458549c6" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "class RuntimeManager\nRuntimeManager", - "layer": "C1_SYMBOL_CATALOG", - "title": "RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "7e4a9381328c5803bbc6179458612fc4e947d928aa7bf8b4b2bebb2c8592f758", - "qname": "RuntimeManager", - "kind": "class", - "signature": "RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.core.runtime", - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "class RuntimeManager:\n ACTION_TIMEOUT_SECONDS = 10.0\n ACTION_POLL_INTERVAL_SECONDS = 0.05\n\n def __init__(\n self,\n configuration: ConfigurationManager | None = None,\n services: ServiceContainer | None = None,\n traces: TraceService | None = None,\n health: HealthRegistry | None = None,\n logs: LogManager | None = None,\n workers: WorkerSupervisor | None = None,\n control_plane: ControlPlaneService | None = None,\n ) -> None:\n self.configuration = configuration or ConfigurationManager()\n self.services = services or ServiceContainer()\n self.traces = traces or TraceService()\n self.health = health or HealthRegistry()\n self.logs = logs or LogManager()\n self.workers = workers or WorkerSupervisor()\n self.control_plane = control_plane or ControlPlaneService()\n self.registry = ModuleRegistry(self.services)\n self._started = False\n self._state = LifecycleState.IDLE\n self._core_registered = False\n self._workers_registered = False\n self._register_core_services()\n\n def register_module(self, module: ApplicationModule) -> None:\n self.registry.register_module(module.name)\n module.register(self.registry)\n\n def add_config_file(self, path: str) -> FileConfigProvider:\n provider = FileConfigProvider(path)\n self.configuration.add_provider(provider)\n return provider\n\n def start(self, *, start_control_plane: bool = True) -> None:\n if self._started:\n return\n self._state = LifecycleState.STARTING\n config = self.configuration.load()\n self.logs.apply_config(config)\n self._register_health_contributors()\n self._register_workers()\n self.workers.start()\n if start_control_plane:\n self.control_plane.start(self)\n self._started = True\n self._refresh_state()\n\n def stop(self, timeout: float = 30.0, force: bool = False, stop_control_plane: bool = True) -> None:\n if not self._started:\n return\n self._state = LifecycleState.STOPPING\n self.workers.stop(timeout=timeout, force=force)\n if stop_control_plane:\n self.control_plane.stop()\n self._started = False\n self._state = LifecycleState.STOPPED\n\n def status(self) -> dict[str, object]:\n self._refresh_state()\n return self.control_plane.snapshot(self)\n\n def current_health(self) -> HealthPayload:\n self._refresh_state()\n return self.health.payload(self._state, self.workers.healths())\n\n async def health_status(self) -> HealthPayload:\n return self.current_health()\n\n async def start_runtime(self) -> dict[str, object] | str:\n self._refresh_state()\n if self._started:\n return \"runtime already running\"\n if self._state == LifecycleState.STOPPING:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n\n self.start(start_control_plane=False)\n started = self._wait_for_state({LifecycleState.IDLE, LifecycleState.BUSY}, timeout=self.ACTION_TIMEOUT_SECONDS)\n if started:\n return self._action_detail(\"runtime started\", timed_out=False)\n return self._action_detail(\"runtime start is still in progress\", timed_out=True)\n\n async def stop_runtime(self) -> dict[str, object] | str:\n self._refresh_state()\n if not self._started:\n if self._state == LifecycleState.STOPPING:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n return \"runtime already stopped\"\n\n self._state = LifecycleState.STOPPING\n try:\n self.workers.stop(timeout=self.ACTION_TIMEOUT_SECONDS, force=False)\n except TimeoutError:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n\n self._started = False\n self._state = LifecycleState.STOPPED\n return self._action_detail(\"runtime stopped\", timed_out=False)\n\n async def runtime_status(self) -> str:\n self._refresh_state()\n return self._state.value\n\n def _register_core_services(self) -> None:\n if self._core_registered:\n return\n self.services.register(\"configuration\", self.configuration)\n self.services.register(\"traces\", self.traces)\n self.services.register(\"health\", self.health)\n self.services.register(\"logs\", self.logs)\n self.services.register(\"workers\", self.workers)\n self.services.register(\"control_plane\", self.control_plane)\n self._core_registered = True\n\n def _register_health_contributors(self) -> None:\n for contributor in self.registry.health_contributors:\n self.health.register(contributor)\n\n def _register_workers(self) -> None:\n if self._workers_registered:\n return\n for worker in self.registry.workers:\n self.workers.register(worker)\n self._workers_registered = True\n\n def _refresh_state(self) -> None:\n lifecycle = self.workers.lifecycle_state()\n\n if self._state == LifecycleState.STOPPING:\n if lifecycle == LifecycleState.STOPPED:\n self._started = False\n self._state = LifecycleState.STOPPED\n return\n\n if not self._started:\n if lifecycle == LifecycleState.STOPPED:\n self._state = LifecycleState.STOPPED\n return\n\n self._state = lifecycle\n\n def _wait_for_state(self, target_states: set[LifecycleState], *, timeout: float) -> bool:\n deadline = monotonic() + timeout\n while monotonic() < deadline:\n self._refresh_state()\n if self._state in target_states:\n return True\n sleep(self.ACTION_POLL_INTERVAL_SECONDS)\n self._refresh_state()\n return self._state in target_states\n\n def _action_detail(self, message: str, *, timed_out: bool) -> dict[str, object]:\n self._refresh_state()\n return {\n \"message\": message,\n \"state\": self._state.value,\n \"timed_out\": timed_out,\n \"workers\": self.workers.snapshot(),\n }", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/core/runtime.py:RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.core.runtime", - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ] - }, - "diagnostics": { - "execution": { - "executed_layers": [ - "C4_SEMANTIC_ROLES", - "C3_ENTRYPOINTS", - "C2_DEPENDENCY_GRAPH", - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS" - ], - "retrieval_mode_by_layer": { - "C4_SEMANTIC_ROLES": "exact_path_fetch", - "C3_ENTRYPOINTS": "exact_path_fetch", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C1_SYMBOL_CATALOG": "symbol_search", - "C0_SOURCE_CHUNKS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C4_SEMANTIC_ROLES": 12, - "C3_ENTRYPOINTS": 8, - "C2_DEPENDENCY_GRAPH": 8, - "C1_SYMBOL_CATALOG": 6, - "C0_SOURCE_CHUNKS": 4 - }, - "filters_by_layer": { - "C4_SEMANTIC_ROLES": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C1_SYMBOL_CATALOG": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C4_SEMANTIC_ROLES", - "query": "Какие компоненты участвуют в RuntimeManager?", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 12, - "ranking_profile": "code" - }, - { - "layer": "C3_ENTRYPOINTS", - "query": "Какие компоненты участвуют в RuntimeManager?", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "Какие компоненты участвуют в RuntimeManager?", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C1_SYMBOL_CATALOG", - "query": "RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Какие компоненты участвуют в RuntimeManager?", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 4, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C4_SEMANTIC_ROLES", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 12, - "candidates_after_filter": 12 - }, - { - "layer": "C3_ENTRYPOINTS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 3, - "candidates_after_filter": 3 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 1, - "candidates_after_filter": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 4, - "candidates_after_filter": 4 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "RuntimeManager", - "alternatives": [ - "RuntimeManager" - ] - }, - "layers": [ - { - "layer": "C4_SEMANTIC_ROLES", - "status": "hit", - "hit_count": 12, - "fail_reason": null - }, - { - "layer": "C3_ENTRYPOINTS", - "status": "hit", - "hit_count": 3, - "fail_reason": null - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 8, - "fail_reason": null - }, - { - "layer": "C1_SYMBOL_CATALOG", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 1, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "symbol_resolution": 0, - "retrieval_total": 181, - "retrieval_by_layer": { - "C4_SEMANTIC_ROLES": 41, - "C3_ENTRYPOINTS": 21, - "C2_DEPENDENCY_GRAPH": 74, - "C1_SYMBOL_CATALOG": 27, - "C0_SOURCE_CHUNKS": 17 - }, - "merge_rank": 25 - } - } - }, - { - "step": "llm_answer", - "input": { - "query": "Какие компоненты участвуют в RuntimeManager?", - "rag_count": 25 - }, - "output": { - "llm_answer": "В подсистеме RuntimeManager участвуют следующие компоненты и устанавливаются явные связи между ними:\n\n1. RuntimeManager — главный менеджер выполнения, создающий и запускающий рабочие потоки.\n - Создаёт экземпляр конфигурации (`configuration`).\n - Вызывает метод `start`, инициирующий выполнение основной логики.\n \n2. ControlPlaneService — сервис управления каналами и рабочими потоками.\n - Контролирует каналы передачи данных (`_channels`) и инициализирует асинхронную обработку (`_start_async`).\n\nЭти компоненты связаны следующим образом:\n- RuntimeManager управляет созданием экземпляра Configuration и вызовом метода start для запуска процессов.\n- ControlPlaneService отвечает за организацию каналов обмена данными и старт задач с использованием асинхронных механизмов.\n\nГраницы ответственности:\n- RuntimeManager выполняет диспетчеризацию и координацию рабочих потоков на уровне runtime.\n- ControlPlaneService реализует низкоуровневую инфраструктуру управления задачами и каналами данных.\n\nТаким образом, RuntimeManager работает как центрального координатора всех процессов исполнения, тогда как ControlPlaneService обеспечивает необходимую инфраструктуру и контроль над каналами взаимодействия." - }, - "diagnostics": { - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 628, - "evidence_rows": 25, - "evidence_chars": 8651 - }, - "evidence_summary": [ - { - "layer": "C4_SEMANTIC_ROLES", - "count": 12, - "unique_paths": 11 - }, - { - "layer": "C3_ENTRYPOINTS", - "count": 3, - "unique_paths": 1 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "count": 8, - "unique_paths": 2 - }, - { - "layer": "C1_SYMBOL_CATALOG", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 1, - "unique_paths": 1 - } - ], - "prompt_template_id": "intent_code_qa_architecture_ru_v4", - "system_prompt_version": "v1" - }, - "timings_ms": { - "prompt_build": 0, - "llm_call": 1787 - } - } - } - ] - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_143856/full_chain_plba_code_subintents_v2_plba-v2-architecture-runtime-manager.md b/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_143856/full_chain_plba_code_subintents_v2_plba-v2-architecture-runtime-manager.md deleted file mode 100644 index ad0a7a9..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_143856/full_chain_plba_code_subintents_v2_plba-v2-architecture-runtime-manager.md +++ /dev/null @@ -1,34 +0,0 @@ -# plba-v2-architecture-runtime-manager - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_subintents_v2.yaml -- runner: runtime -- mode: full_chain -- passed: True - -## Query -Какие компоненты участвуют в RuntimeManager? - -## Actual -{ - "intent": "CODE_QA", - "sub_intent": "ARCHITECTURE", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 25, - "llm_answer": "В подсистеме RuntimeManager участвуют следующие компоненты и устанавливаются явные связи между ними:\n\n1. RuntimeManager — главный менеджер выполнения, создающий и запускающий рабочие потоки.\n - Создаёт экземпляр конфигурации (`configuration`).\n - Вызывает метод `start`, инициирующий выполнение основной логики.\n \n2. ControlPlaneService — сервис управления каналами и рабочими потоками.\n - Контролирует каналы передачи данных (`_channels`) и инициализирует асинхронную обработку (`_start_async`).\n\nЭти компоненты связаны следующим образом:\n- RuntimeManager управляет созданием экземпляра Configuration и вызовом метода start для запуска процессов.\n- ControlPlaneService отвечает за организацию каналов обмена данными и старт задач с использованием асинхронных механизмов.\n\nГраницы ответственности:\n- RuntimeManager выполняет диспетчеризацию и координацию рабочих потоков на уровне runtime.\n- ControlPlaneService реализует низкоуровневую инфраструктуру управления задачами и каналами данных.\n\nТаким образом, RuntimeManager работает как центрального координатора всех процессов исполнения, тогда как ControlPlaneService обеспечивает необходимую инфраструктуру и контроль над каналами взаимодействия.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "RuntimeManager" - ], - "layers": [ - "C4_SEMANTIC_ROLES", - "C3_ENTRYPOINTS", - "C2_DEPENDENCY_GRAPH", - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS" - ] -} - -## Mismatches -- none \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_143856/full_chain_plba_code_subintents_v2_plba-v2-explain-create-runtime.json b/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_143856/full_chain_plba_code_subintents_v2_plba-v2-explain-create-runtime.json deleted file mode 100644 index 4d060a0..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_143856/full_chain_plba_code_subintents_v2_plba-v2-explain-create-runtime.json +++ /dev/null @@ -1,1896 +0,0 @@ -{ - "case_id": "plba-v2-explain-create-runtime", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_subintents_v2.yaml", - "runner": "runtime", - "mode": "full_chain", - "actual": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 12, - "llm_answer": "Функция `create_runtime` в модуле `src/plba/bootstrap.py` отвечает за инициализацию и настройку основного runtime-сервиса приложения.\n\nОна принимает следующие параметры:\n- `module`: объект типа `ApplicationModule`, необходимый для регистрации в runtime;\n- дополнительные необязательные параметры включают путь к конфигурационному файлу (`config_path`), флаг включения HTTP-контроля (`enable_http_control`) и настройки для HTTP-интерфейса управления.\n\nОсновные действия функции:\n1. Создаёт экземпляр класса `RuntimeManager`.\n2. При наличии пути к конфигурационному файлу добавляет файл конфигурации в runtime через метод `add_config_file`.\n3. Если включён HTTP-контроль, регистрирует HTTP-канал управления через класс `HttpControlChannel`.\n4. Регистрирует переданный модуль приложения через метод `register_module`.\n5. Возвращает созданный runtime-менеджер.\n\nНа основании представленного контекста нельзя точно утверждать о дальнейшей логике использования runtime-менеджера после вызова данной функции, так как соответствующий код не приведён напрямую. Однако можно осторожно предположить, что далее runtime будет использоваться для координации и обработки запросов, возможно, связанных с управлением приложением и его модулями.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "create_runtime" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "passed": true, - "mismatches": [], - "details": { - "case_id": "plba-v2-explain-create-runtime", - "text": "Что делает функция create_runtime?", - "mode": "full_chain", - "run_started_at": "2026-03-12T14:38:57", - "rag_session_id": "7d11da21-faa0-4cea-aede-aeabe069164c", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Что делает функция create_runtime?", - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "create_runtime", - "alternatives": [ - "create_runtime" - ], - "confidence": 0.99 - }, - "rag_count": 12, - "rag_rows": [ - { - "path": "src/plba/bootstrap.py", - "content": "function create_runtime\ncreate_runtime(module)", - "layer": "C1_SYMBOL_CATALOG", - "title": "create_runtime", - "span_start": 8, - "span_end": 29, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "qname": "create_runtime", - "kind": "function", - "signature": "create_runtime(module)", - "parent_symbol_id": null, - "package_or_module": "src.plba.bootstrap", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_runner.py", - "content": "UvicornThreadRunner\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (24)", - "layer": "C4_SEMANTIC_ROLES", - "title": "UvicornThreadRunner", - "span_start": 10, - "span_end": 61, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 11, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "fd55630045a02100df8877ac27d951ee08617d4598764394d48cb51fe067476a", - "symbol_name": "UvicornThreadRunner", - "qname": "UvicornThreadRunner", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 24, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "3779fdd2878b770e789a35bb2a89c9d79f13b61c26d7db1b3b683f9bb9e1623f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/bootstrap.py", - "content": "create_runtime calls runtime.add_config_file", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "create_runtime:calls", - "span_start": 19, - "span_end": 19, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "4eaeec4ac55a59d5f66fd01c4754955f8fedaf4bc3df13fa769b352c7bfaacbb", - "edge_type": "calls", - "src_symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "src_qname": "create_runtime", - "dst_symbol_id": null, - "dst_ref": "runtime.add_config_file", - "resolution": "partial", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/bootstrap.py", - "content": "create_runtime reads_attr runtime.register_module", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "create_runtime:reads_attr", - "span_start": 28, - "span_end": 28, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "45516c79ff358dbf9b650a081668df0f66d2fe989300f985a1a78be6be166f8f", - "edge_type": "reads_attr", - "src_symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "src_qname": "create_runtime", - "dst_symbol_id": null, - "dst_ref": "runtime.register_module", - "resolution": "partial", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/bootstrap.py", - "content": "create_runtime instantiates RuntimeManager", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "create_runtime:instantiates", - "span_start": 17, - "span_end": 17, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "0adba17984f850ea1608c9e734d2dd5c325cfde3a8133123aa239e44935ad18e", - "edge_type": "instantiates", - "src_symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "src_qname": "create_runtime", - "dst_symbol_id": "27158ca220022eeb5083c6addf8a50775d45f7161284fd60aac48410105f4b98", - "dst_ref": "RuntimeManager", - "resolution": "resolved", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/bootstrap.py", - "content": "create_runtime calls runtime.register_module", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "create_runtime:calls", - "span_start": 28, - "span_end": 28, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "ab6003c3441addc1ba1b81edeca009165559f652f6b2cf424e5ae61b1f617de8", - "edge_type": "calls", - "src_symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "src_qname": "create_runtime", - "dst_symbol_id": null, - "dst_ref": "runtime.register_module", - "resolution": "partial", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/bootstrap.py", - "content": "create_runtime calls runtime.control_plane.register_channel", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "create_runtime:calls", - "span_start": 21, - "span_end": 27, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "2678250030b9ce47a3b3b55fac7897ac530367edc8374ac9d5e6ecafb1e483f0", - "edge_type": "calls", - "src_symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "src_qname": "create_runtime", - "dst_symbol_id": null, - "dst_ref": "runtime.control_plane.register_channel", - "resolution": "partial", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/bootstrap.py", - "content": "create_runtime reads_attr runtime.add_config_file", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "create_runtime:reads_attr", - "span_start": 19, - "span_end": 19, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "30d4e8aae984ab84d523e80d02f1caeda52d547fa3d2aa47be8845931cabbca2", - "edge_type": "reads_attr", - "src_symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "src_qname": "create_runtime", - "dst_symbol_id": null, - "dst_ref": "runtime.add_config_file", - "resolution": "partial", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/bootstrap.py", - "content": "def create_runtime(\n module: ApplicationModule,\n *,\n config_path: str | None = None,\n enable_http_control: bool = False,\n control_host: str = \"127.0.0.1\",\n control_port: int = 8080,\n control_timeout: int = 5,\n) -> RuntimeManager:\n runtime = RuntimeManager()\n if config_path is not None:\n runtime.add_config_file(config_path)\n if enable_http_control:\n runtime.control_plane.register_channel(\n HttpControlChannel(\n host=control_host,\n port=control_port,\n timeout=control_timeout,\n )\n )\n runtime.register_module(module)\n return runtime", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/plba/bootstrap.py:create_runtime", - "span_start": 8, - "span_end": 29, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.plba.bootstrap", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "llm_answer": "Функция `create_runtime` в модуле `src/plba/bootstrap.py` отвечает за инициализацию и настройку основного runtime-сервиса приложения.\n\nОна принимает следующие параметры:\n- `module`: объект типа `ApplicationModule`, необходимый для регистрации в runtime;\n- дополнительные необязательные параметры включают путь к конфигурационному файлу (`config_path`), флаг включения HTTP-контроля (`enable_http_control`) и настройки для HTTP-интерфейса управления.\n\nОсновные действия функции:\n1. Создаёт экземпляр класса `RuntimeManager`.\n2. При наличии пути к конфигурационному файлу добавляет файл конфигурации в runtime через метод `add_config_file`.\n3. Если включён HTTP-контроль, регистрирует HTTP-канал управления через класс `HttpControlChannel`.\n4. Регистрирует переданный модуль приложения через метод `register_module`.\n5. Возвращает созданный runtime-менеджер.\n\nНа основании представленного контекста нельзя точно утверждать о дальнейшей логике использования runtime-менеджера после вызова данной функции, так как соответствующий код не приведён напрямую. Однако можно осторожно предположить, что далее runtime будет использоваться для координации и обработки запросов, возможно, связанных с управлением приложением и его модулями.", - "summary": { - "router": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "confidence": null - }, - "retrieval": { - "profile": "code", - "layers_hit": [ - "C0_SOURCE_CHUNKS", - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS", - "C4_SEMANTIC_ROLES" - ], - "evidence_sufficient": true - }, - "llm": { - "answer_status": "answered", - "groundedness": "grounded" - } - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "symbol_kind_hint": "function", - "symbol_candidates": [ - "create_runtime" - ], - "keyword_hints": [ - "create_runtime" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C0_SOURCE_CHUNKS": "exact_path_fetch", - "C4_SEMANTIC_ROLES": "exact_path_fetch", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C3_ENTRYPOINTS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 8, - "C4_SEMANTIC_ROLES": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C3_ENTRYPOINTS": 6 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C4_SEMANTIC_ROLES": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "create_runtime", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "create_runtime", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C4_SEMANTIC_ROLES", - "query": "create_runtime", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "create_runtime", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - }, - { - "layer": "C3_ENTRYPOINTS", - "query": "create_runtime", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 1, - "candidates_after_filter": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 6, - "candidates_after_filter": 6 - }, - { - "layer": "C3_ENTRYPOINTS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 3, - "candidates_after_filter": 3 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "create_runtime", - "alternatives": [ - "create_runtime" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C4_SEMANTIC_ROLES", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 6, - "fail_reason": null - }, - { - "layer": "C3_ENTRYPOINTS", - "status": "hit", - "hit_count": 3, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "router": 0, - "symbol_resolution": 0, - "retrieval_total": 130, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 39, - "C0_SOURCE_CHUNKS": 15, - "C4_SEMANTIC_ROLES": 16, - "C2_DEPENDENCY_GRAPH": 46, - "C3_ENTRYPOINTS": 12 - }, - "merge_rank": 17, - "prompt_build": 0, - "llm_call": 2051 - }, - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 723, - "evidence_rows": 12, - "evidence_chars": 1184 - }, - "evidence_summary": [ - { - "layer": "C1_SYMBOL_CATALOG", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "count": 6, - "unique_paths": 1 - }, - { - "layer": "C3_ENTRYPOINTS", - "count": 3, - "unique_paths": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 1, - "unique_paths": 1 - } - ], - "prompt_template_id": "intent_code_qa_explain_ru_v4", - "system_prompt_version": "v1" - }, - "router": { - "conversation_mode": "START", - "keyword_hints": [ - "create_runtime" - ], - "path_scope": [] - }, - "llm": { - "used_evidence_count": 12, - "missing_evidence_reason": null - } - }, - "run_info": { - "case_id": "plba-v2-explain-create-runtime", - "mode": "full_chain", - "run_started_at": "2026-03-12T14:38:57", - "rag_session_id": "7d11da21-faa0-4cea-aede-aeabe069164c", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - }, - "input_request": { - "text": "Что делает функция create_runtime?", - "normalized_query": "Что делает функция create_runtime?" - }, - "steps": [ - { - "step": "intent_router", - "input": { - "query": "Что делает функция create_runtime?" - }, - "output": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Что делает функция create_runtime?" - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "symbol_kind_hint": "function", - "symbol_candidates": [ - "create_runtime" - ], - "keyword_hints": [ - "create_runtime" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "timings_ms": { - "router": 0 - } - } - }, - { - "step": "retrieval", - "input": { - "query": "Что делает функция create_runtime?" - }, - "output": { - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "create_runtime", - "alternatives": [ - "create_runtime" - ], - "confidence": 0.99 - }, - "rag_count": 12, - "rag_rows": [ - { - "path": "src/plba/bootstrap.py", - "content": "function create_runtime\ncreate_runtime(module)", - "layer": "C1_SYMBOL_CATALOG", - "title": "create_runtime", - "span_start": 8, - "span_end": 29, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "qname": "create_runtime", - "kind": "function", - "signature": "create_runtime(module)", - "parent_symbol_id": null, - "package_or_module": "src.plba.bootstrap", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_runner.py", - "content": "UvicornThreadRunner\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (24)", - "layer": "C4_SEMANTIC_ROLES", - "title": "UvicornThreadRunner", - "span_start": 10, - "span_end": 61, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 11, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "fd55630045a02100df8877ac27d951ee08617d4598764394d48cb51fe067476a", - "symbol_name": "UvicornThreadRunner", - "qname": "UvicornThreadRunner", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 24, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "3779fdd2878b770e789a35bb2a89c9d79f13b61c26d7db1b3b683f9bb9e1623f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/bootstrap.py", - "content": "create_runtime calls runtime.add_config_file", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "create_runtime:calls", - "span_start": 19, - "span_end": 19, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "4eaeec4ac55a59d5f66fd01c4754955f8fedaf4bc3df13fa769b352c7bfaacbb", - "edge_type": "calls", - "src_symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "src_qname": "create_runtime", - "dst_symbol_id": null, - "dst_ref": "runtime.add_config_file", - "resolution": "partial", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/bootstrap.py", - "content": "create_runtime reads_attr runtime.register_module", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "create_runtime:reads_attr", - "span_start": 28, - "span_end": 28, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "45516c79ff358dbf9b650a081668df0f66d2fe989300f985a1a78be6be166f8f", - "edge_type": "reads_attr", - "src_symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "src_qname": "create_runtime", - "dst_symbol_id": null, - "dst_ref": "runtime.register_module", - "resolution": "partial", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/bootstrap.py", - "content": "create_runtime instantiates RuntimeManager", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "create_runtime:instantiates", - "span_start": 17, - "span_end": 17, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "0adba17984f850ea1608c9e734d2dd5c325cfde3a8133123aa239e44935ad18e", - "edge_type": "instantiates", - "src_symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "src_qname": "create_runtime", - "dst_symbol_id": "27158ca220022eeb5083c6addf8a50775d45f7161284fd60aac48410105f4b98", - "dst_ref": "RuntimeManager", - "resolution": "resolved", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/bootstrap.py", - "content": "create_runtime calls runtime.register_module", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "create_runtime:calls", - "span_start": 28, - "span_end": 28, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "ab6003c3441addc1ba1b81edeca009165559f652f6b2cf424e5ae61b1f617de8", - "edge_type": "calls", - "src_symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "src_qname": "create_runtime", - "dst_symbol_id": null, - "dst_ref": "runtime.register_module", - "resolution": "partial", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/bootstrap.py", - "content": "create_runtime calls runtime.control_plane.register_channel", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "create_runtime:calls", - "span_start": 21, - "span_end": 27, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "2678250030b9ce47a3b3b55fac7897ac530367edc8374ac9d5e6ecafb1e483f0", - "edge_type": "calls", - "src_symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "src_qname": "create_runtime", - "dst_symbol_id": null, - "dst_ref": "runtime.control_plane.register_channel", - "resolution": "partial", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/bootstrap.py", - "content": "create_runtime reads_attr runtime.add_config_file", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "create_runtime:reads_attr", - "span_start": 19, - "span_end": 19, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "30d4e8aae984ab84d523e80d02f1caeda52d547fa3d2aa47be8845931cabbca2", - "edge_type": "reads_attr", - "src_symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "src_qname": "create_runtime", - "dst_symbol_id": null, - "dst_ref": "runtime.add_config_file", - "resolution": "partial", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/bootstrap.py", - "content": "def create_runtime(\n module: ApplicationModule,\n *,\n config_path: str | None = None,\n enable_http_control: bool = False,\n control_host: str = \"127.0.0.1\",\n control_port: int = 8080,\n control_timeout: int = 5,\n) -> RuntimeManager:\n runtime = RuntimeManager()\n if config_path is not None:\n runtime.add_config_file(config_path)\n if enable_http_control:\n runtime.control_plane.register_channel(\n HttpControlChannel(\n host=control_host,\n port=control_port,\n timeout=control_timeout,\n )\n )\n runtime.register_module(module)\n return runtime", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/plba/bootstrap.py:create_runtime", - "span_start": 8, - "span_end": 29, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.plba.bootstrap", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ] - }, - "diagnostics": { - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C0_SOURCE_CHUNKS": "exact_path_fetch", - "C4_SEMANTIC_ROLES": "exact_path_fetch", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C3_ENTRYPOINTS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 8, - "C4_SEMANTIC_ROLES": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C3_ENTRYPOINTS": 6 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C4_SEMANTIC_ROLES": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "create_runtime", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "create_runtime", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C4_SEMANTIC_ROLES", - "query": "create_runtime", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "create_runtime", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - }, - { - "layer": "C3_ENTRYPOINTS", - "query": "create_runtime", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 1, - "candidates_after_filter": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 6, - "candidates_after_filter": 6 - }, - { - "layer": "C3_ENTRYPOINTS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 3, - "candidates_after_filter": 3 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "create_runtime", - "alternatives": [ - "create_runtime" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C4_SEMANTIC_ROLES", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 6, - "fail_reason": null - }, - { - "layer": "C3_ENTRYPOINTS", - "status": "hit", - "hit_count": 3, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "symbol_resolution": 0, - "retrieval_total": 130, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 39, - "C0_SOURCE_CHUNKS": 15, - "C4_SEMANTIC_ROLES": 16, - "C2_DEPENDENCY_GRAPH": 46, - "C3_ENTRYPOINTS": 12 - }, - "merge_rank": 17 - } - } - }, - { - "step": "llm_answer", - "input": { - "query": "Что делает функция create_runtime?", - "rag_count": 12 - }, - "output": { - "llm_answer": "Функция `create_runtime` в модуле `src/plba/bootstrap.py` отвечает за инициализацию и настройку основного runtime-сервиса приложения.\n\nОна принимает следующие параметры:\n- `module`: объект типа `ApplicationModule`, необходимый для регистрации в runtime;\n- дополнительные необязательные параметры включают путь к конфигурационному файлу (`config_path`), флаг включения HTTP-контроля (`enable_http_control`) и настройки для HTTP-интерфейса управления.\n\nОсновные действия функции:\n1. Создаёт экземпляр класса `RuntimeManager`.\n2. При наличии пути к конфигурационному файлу добавляет файл конфигурации в runtime через метод `add_config_file`.\n3. Если включён HTTP-контроль, регистрирует HTTP-канал управления через класс `HttpControlChannel`.\n4. Регистрирует переданный модуль приложения через метод `register_module`.\n5. Возвращает созданный runtime-менеджер.\n\nНа основании представленного контекста нельзя точно утверждать о дальнейшей логике использования runtime-менеджера после вызова данной функции, так как соответствующий код не приведён напрямую. Однако можно осторожно предположить, что далее runtime будет использоваться для координации и обработки запросов, возможно, связанных с управлением приложением и его модулями." - }, - "diagnostics": { - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 723, - "evidence_rows": 12, - "evidence_chars": 1184 - }, - "evidence_summary": [ - { - "layer": "C1_SYMBOL_CATALOG", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "count": 6, - "unique_paths": 1 - }, - { - "layer": "C3_ENTRYPOINTS", - "count": 3, - "unique_paths": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 1, - "unique_paths": 1 - } - ], - "prompt_template_id": "intent_code_qa_explain_ru_v4", - "system_prompt_version": "v1" - }, - "timings_ms": { - "prompt_build": 0, - "llm_call": 2051 - } - } - } - ] - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_143856/full_chain_plba_code_subintents_v2_plba-v2-explain-create-runtime.md b/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_143856/full_chain_plba_code_subintents_v2_plba-v2-explain-create-runtime.md deleted file mode 100644 index 6e4d82d..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_143856/full_chain_plba_code_subintents_v2_plba-v2-explain-create-runtime.md +++ /dev/null @@ -1,34 +0,0 @@ -# plba-v2-explain-create-runtime - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_subintents_v2.yaml -- runner: runtime -- mode: full_chain -- passed: True - -## Query -Что делает функция create_runtime? - -## Actual -{ - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 12, - "llm_answer": "Функция `create_runtime` в модуле `src/plba/bootstrap.py` отвечает за инициализацию и настройку основного runtime-сервиса приложения.\n\nОна принимает следующие параметры:\n- `module`: объект типа `ApplicationModule`, необходимый для регистрации в runtime;\n- дополнительные необязательные параметры включают путь к конфигурационному файлу (`config_path`), флаг включения HTTP-контроля (`enable_http_control`) и настройки для HTTP-интерфейса управления.\n\nОсновные действия функции:\n1. Создаёт экземпляр класса `RuntimeManager`.\n2. При наличии пути к конфигурационному файлу добавляет файл конфигурации в runtime через метод `add_config_file`.\n3. Если включён HTTP-контроль, регистрирует HTTP-канал управления через класс `HttpControlChannel`.\n4. Регистрирует переданный модуль приложения через метод `register_module`.\n5. Возвращает созданный runtime-менеджер.\n\nНа основании представленного контекста нельзя точно утверждать о дальнейшей логике использования runtime-менеджера после вызова данной функции, так как соответствующий код не приведён напрямую. Однако можно осторожно предположить, что далее runtime будет использоваться для координации и обработки запросов, возможно, связанных с управлением приложением и его модулями.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "create_runtime" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] -} - -## Mismatches -- none \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_143856/full_chain_plba_code_subintents_v2_plba-v2-explain-local-http-channel.json b/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_143856/full_chain_plba_code_subintents_v2_plba-v2-explain-local-http-channel.json deleted file mode 100644 index d1a8d79..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_143856/full_chain_plba_code_subintents_v2_plba-v2-explain-local-http-channel.json +++ /dev/null @@ -1,1333 +0,0 @@ -{ - "case_id": "plba-v2-explain-local-http-channel", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_subintents_v2.yaml", - "runner": "runtime", - "mode": "full_chain", - "actual": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN_LOCAL", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 6, - "llm_answer": "Класс `HttpControlChannel` реализует механизм управления HTTP каналом для взаимодействия с внешними клиентами или сервисами через протокол HTTP.\n\nЕго основная задача — обеспечивать старт и останов канала приема запросов, а также обработку двух типов ответов:\n\n1. Health check (`_health_response`) – возвращает статус системы (здорово ли она функционирует). Проверяет наличие настроенных действий контроля и возвращает состояние («здорова» или «нездорова») вместе с дополнительной информацией.\n \n Входные данные: \n - нет явных входных данных, кроме конфигурации каналов и настроенных действий;\n - выходные данные: словарь состояния и детализированного сообщения.\n\n2. Обработка пользовательских действий (`_action_response`) – отвечает за выполнение конкретного действия, указанного клиентом (например, изменение настроек, перезапуск сервиса).\n \n Входные данные:\n - строка с именем действия (`action`);\n - необязательное поле `_client_source`, указывающее источник запроса.\n \n Выходные данные:\n - либо успешное сообщение о выполненном действии,\n - либо ошибка, если действие не настроено или истекло время ожидания выполнения.\n\nПри инициализации класса создаются следующие компоненты:\n- `_runner`: объект, управляющий uvicorn-сервером (используется для запуска сервера);\n- `_factory`: фабрика приложений, создающая серверное приложение для обработки запросов;\n- `_actions`: набор доступных контролируемых действий.\n\nМетод `start()` запускает сервер и привязывает к нему обработчики, предоставленные пользователем при настройке системы.\nМетод `stop()` останавливает запущенный сервер.\n\nТаким образом, класс обеспечивает простую и удобную инфраструктуру для развертывания и мониторинга удалённых сервисов через HTTP-протокол.", - "answer_mode": "answered", - "path_scope": [ - "src/app_runtime/control/http_channel.py" - ], - "symbol_candidates": [ - "HttpControlChannel" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C2_DEPENDENCY_GRAPH" - ] - }, - "passed": true, - "mismatches": [], - "details": { - "case_id": "plba-v2-explain-local-http-channel", - "text": "Почему в файле src/app_runtime/control/http_channel.py класс HttpControlChannel устроен так?", - "mode": "full_chain", - "run_started_at": "2026-03-12T14:38:57", - "rag_session_id": "7d11da21-faa0-4cea-aede-aeabe069164c", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Почему в файле src/app_runtime/control/http_channel.py класс HttpControlChannel устроен так?", - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "HttpControlChannel", - "alternatives": [ - "HttpControlChannel" - ], - "confidence": 0.99 - }, - "rag_count": 6, - "rag_rows": [ - { - "path": "src/app_runtime/control/http_channel.py", - "content": "class HttpControlChannel\nHttpControlChannel(ControlChannel)", - "layer": "C1_SYMBOL_CATALOG", - "title": "HttpControlChannel", - "span_start": 12, - "span_end": 57, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "1c9fbdc24819e5604c26ea55428a74310f03a03e1af197ed84846af61e42fdb0", - "qname": "HttpControlChannel", - "kind": "class", - "signature": "HttpControlChannel(ControlChannel)", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.control.http_channel", - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel.__init__\n -> HttpControlChannel._timeout\n -> HttpControlChannel._action_response", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "HttpControlChannel.__init__:dataflow_slice", - "span_start": 14, - "span_end": 47, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "c3ef21fcae96c82c00be74b3ab827d4af2085d89cb3fa5521c19a174aad84dbb", - "edge_type": "dataflow_slice", - "src_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "src_qname": "HttpControlChannel.__init__", - "dst_symbol_id": "e64969024ccaeb34d8d91473fad07b3b3d341875846392e7a006406c7ada1954", - "dst_ref": "HttpControlChannel._action_response", - "resolution": "resolved", - "slice_id": "c3ef21fcae96c82c00be74b3ab827d4af2085d89cb3fa5521c19a174aad84dbb", - "root_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "path_symbols": [ - "HttpControlChannel.__init__", - "HttpControlChannel._timeout", - "HttpControlChannel._action_response" - ], - "path_symbol_ids": [ - "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "e64969024ccaeb34d8d91473fad07b3b3d341875846392e7a006406c7ada1954" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel.__init__\n -> HttpControlChannel._runner\n -> HttpControlChannel.start", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "HttpControlChannel.__init__:dataflow_slice", - "span_start": 15, - "span_end": 22, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "51d73913df709152258ed1b9a8c8f4eb3c575eccfe6b982aef0b28e0789a29da", - "edge_type": "dataflow_slice", - "src_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "src_qname": "HttpControlChannel.__init__", - "dst_symbol_id": "d1933f04137f52535b6525f1b93ff2cd83bfb216b480e887e791ed1714cda8e0", - "dst_ref": "HttpControlChannel.start", - "resolution": "resolved", - "slice_id": "51d73913df709152258ed1b9a8c8f4eb3c575eccfe6b982aef0b28e0789a29da", - "root_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "path_symbols": [ - "HttpControlChannel.__init__", - "HttpControlChannel._runner", - "HttpControlChannel.start" - ], - "path_symbol_ids": [ - "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "d1933f04137f52535b6525f1b93ff2cd83bfb216b480e887e791ed1714cda8e0" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel.__init__\n -> HttpControlChannel._timeout\n -> HttpControlChannel._health_response", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "HttpControlChannel.__init__:dataflow_slice", - "span_start": 14, - "span_end": 34, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "f858f5c9e575f6c4cdfe3853571b7ee21d1f628a443541d2037c3dc9d0790bef", - "edge_type": "dataflow_slice", - "src_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "src_qname": "HttpControlChannel.__init__", - "dst_symbol_id": "e84bf04e9cd2127df235b7064d05f47e19f19a89c7c82f4c247231d4e8fa426a", - "dst_ref": "HttpControlChannel._health_response", - "resolution": "resolved", - "slice_id": "f858f5c9e575f6c4cdfe3853571b7ee21d1f628a443541d2037c3dc9d0790bef", - "root_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "path_symbols": [ - "HttpControlChannel.__init__", - "HttpControlChannel._timeout", - "HttpControlChannel._health_response" - ], - "path_symbol_ids": [ - "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "e84bf04e9cd2127df235b7064d05f47e19f19a89c7c82f4c247231d4e8fa426a" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel.__init__\n -> HttpControlChannel._runner\n -> HttpControlChannel.stop", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "HttpControlChannel.__init__:dataflow_slice", - "span_start": 15, - "span_end": 25, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "0f827ef81a990258a8a74381c8564a8361afa6712dba3200592659c939adcb9d", - "edge_type": "dataflow_slice", - "src_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "src_qname": "HttpControlChannel.__init__", - "dst_symbol_id": "f29ab212620093d72be20e26c5a399624c7939a6056a728762ed3f84a250bfa3", - "dst_ref": "HttpControlChannel.stop", - "resolution": "resolved", - "slice_id": "0f827ef81a990258a8a74381c8564a8361afa6712dba3200592659c939adcb9d", - "root_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "path_symbols": [ - "HttpControlChannel.__init__", - "HttpControlChannel._runner", - "HttpControlChannel.stop" - ], - "path_symbol_ids": [ - "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "f29ab212620093d72be20e26c5a399624c7939a6056a728762ed3f84a250bfa3" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "class HttpControlChannel(ControlChannel):\n def __init__(self, host: str, port: int, timeout: int) -> None:\n self._timeout = timeout\n self._runner = UvicornThreadRunner(host, port, timeout)\n self._factory = HttpControlAppFactory()\n self._actions: ControlActionSet | None = None\n\n async def start(self, actions: ControlActionSet) -> None:\n self._actions = actions\n app = self._factory.create(self._health_response, self._action_response)\n await self._runner.start(app)\n\n async def stop(self) -> None:\n await self._runner.stop()\n\n @property\n def port(self) -> int:\n return self._runner.port\n\n async def _health_response(self) -> dict[str, object]:\n if self._actions is None:\n return {\"status\": \"unhealthy\", \"detail\": \"control actions are not configured\"}\n return await asyncio.wait_for(self._actions.health(), timeout=float(self._timeout))\n\n async def _action_response(self, action: str, _client_source: str = \"unknown\") -> JSONResponse:\n if self._actions is None:\n return JSONResponse(content={\"status\": \"error\", \"detail\": f\"{action} handler is not configured\"}, status_code=404)\n callbacks = {\n \"start\": self._actions.start,\n \"stop\": self._actions.stop,\n \"status\": self._actions.status,\n }\n callback = callbacks.get(action)\n if callback is None:\n return JSONResponse(content={\"status\": \"error\", \"detail\": f\"unsupported action: {action}\"}, status_code=404)\n action_timeout = max(float(self._timeout), 10.0) if action in {\"start\", \"stop\"} else float(self._timeout)\n try:\n detail = await asyncio.wait_for(callback(), timeout=action_timeout)\n except asyncio.TimeoutError:\n return JSONResponse(\n content={\"status\": \"accepted\", \"detail\": f\"{action} operation is still in progress\"},\n status_code=202,\n )\n except Exception as exc:\n return JSONResponse(content={\"status\": \"error\", \"detail\": str(exc)}, status_code=500)\n return JSONResponse(content={\"status\": \"ok\", \"detail\": detail or f\"{action} action accepted\"}, status_code=200)", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/http_channel.py:HttpControlChannel", - "span_start": 12, - "span_end": 57, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.http_channel", - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "llm_answer": "Класс `HttpControlChannel` реализует механизм управления HTTP каналом для взаимодействия с внешними клиентами или сервисами через протокол HTTP.\n\nЕго основная задача — обеспечивать старт и останов канала приема запросов, а также обработку двух типов ответов:\n\n1. Health check (`_health_response`) – возвращает статус системы (здорово ли она функционирует). Проверяет наличие настроенных действий контроля и возвращает состояние («здорова» или «нездорова») вместе с дополнительной информацией.\n \n Входные данные: \n - нет явных входных данных, кроме конфигурации каналов и настроенных действий;\n - выходные данные: словарь состояния и детализированного сообщения.\n\n2. Обработка пользовательских действий (`_action_response`) – отвечает за выполнение конкретного действия, указанного клиентом (например, изменение настроек, перезапуск сервиса).\n \n Входные данные:\n - строка с именем действия (`action`);\n - необязательное поле `_client_source`, указывающее источник запроса.\n \n Выходные данные:\n - либо успешное сообщение о выполненном действии,\n - либо ошибка, если действие не настроено или истекло время ожидания выполнения.\n\nПри инициализации класса создаются следующие компоненты:\n- `_runner`: объект, управляющий uvicorn-сервером (используется для запуска сервера);\n- `_factory`: фабрика приложений, создающая серверное приложение для обработки запросов;\n- `_actions`: набор доступных контролируемых действий.\n\nМетод `start()` запускает сервер и привязывает к нему обработчики, предоставленные пользователем при настройке системы.\nМетод `stop()` останавливает запущенный сервер.\n\nТаким образом, класс обеспечивает простую и удобную инфраструктуру для развертывания и мониторинга удалённых сервисов через HTTP-протокол.", - "summary": { - "router": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN_LOCAL", - "confidence": null - }, - "retrieval": { - "profile": "code", - "layers_hit": [ - "C0_SOURCE_CHUNKS", - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH" - ], - "evidence_sufficient": true - }, - "llm": { - "answer_status": "answered", - "groundedness": "grounded" - } - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN_LOCAL", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C2_DEPENDENCY_GRAPH" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "HttpControlChannel" - ], - "keyword_hints": [ - "src/app_runtime/control/http_channel.py", - "HttpControlChannel" - ], - "path_hints": [ - "src/app_runtime/control/http_channel.py" - ], - "path_scope": [ - "src/app_runtime/control/http_channel.py" - ], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C2_DEPENDENCY_GRAPH" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C0_SOURCE_CHUNKS": "exact_path_fetch", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 12, - "C2_DEPENDENCY_GRAPH": 4 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [ - "src/app_runtime/control/http_channel.py" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src/app_runtime/control/http_channel.py" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src/app_runtime/control/http_channel.py" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "HttpControlChannel", - "path_scope": [ - "src/app_runtime/control/http_channel.py" - ], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Почему в файле src/app_runtime/control/http_channel.py класс HttpControlChannel устроен так?", - "path_scope": [ - "src/app_runtime/control/http_channel.py" - ], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 12, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "Почему в файле src/app_runtime/control/http_channel.py класс HttpControlChannel устроен так?", - "path_scope": [ - "src/app_runtime/control/http_channel.py" - ], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 4, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [ - "src/app_runtime/control/http_channel.py" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 1, - "candidates_after_filter": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src/app_runtime/control/http_channel.py" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 1, - "candidates_after_filter": 1 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src/app_runtime/control/http_channel.py" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 4, - "candidates_after_filter": 4 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "HttpControlChannel", - "alternatives": [ - "HttpControlChannel" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 4, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "router": 1, - "symbol_resolution": 0, - "retrieval_total": 90, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 34, - "C0_SOURCE_CHUNKS": 25, - "C2_DEPENDENCY_GRAPH": 29 - }, - "merge_rank": 39, - "prompt_build": 0, - "llm_call": 2794 - }, - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 898, - "evidence_rows": 6, - "evidence_chars": 2660 - }, - "evidence_summary": [ - { - "layer": "C1_SYMBOL_CATALOG", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "count": 4, - "unique_paths": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 1, - "unique_paths": 1 - } - ], - "prompt_template_id": "intent_code_qa_explain_local_ru_v4", - "system_prompt_version": "v1" - }, - "router": { - "conversation_mode": "START", - "keyword_hints": [ - "src/app_runtime/control/http_channel.py", - "HttpControlChannel" - ], - "path_scope": [ - "src/app_runtime/control/http_channel.py" - ] - }, - "llm": { - "used_evidence_count": 6, - "missing_evidence_reason": null - } - }, - "run_info": { - "case_id": "plba-v2-explain-local-http-channel", - "mode": "full_chain", - "run_started_at": "2026-03-12T14:38:57", - "rag_session_id": "7d11da21-faa0-4cea-aede-aeabe069164c", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - }, - "input_request": { - "text": "Почему в файле src/app_runtime/control/http_channel.py класс HttpControlChannel устроен так?", - "normalized_query": "Почему в файле src/app_runtime/control/http_channel.py класс HttpControlChannel устроен так?" - }, - "steps": [ - { - "step": "intent_router", - "input": { - "query": "Почему в файле src/app_runtime/control/http_channel.py класс HttpControlChannel устроен так?" - }, - "output": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Почему в файле src/app_runtime/control/http_channel.py класс HttpControlChannel устроен так?" - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN_LOCAL", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C2_DEPENDENCY_GRAPH" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "HttpControlChannel" - ], - "keyword_hints": [ - "src/app_runtime/control/http_channel.py", - "HttpControlChannel" - ], - "path_hints": [ - "src/app_runtime/control/http_channel.py" - ], - "path_scope": [ - "src/app_runtime/control/http_channel.py" - ], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "timings_ms": { - "router": 1 - } - } - }, - { - "step": "retrieval", - "input": { - "query": "Почему в файле src/app_runtime/control/http_channel.py класс HttpControlChannel устроен так?" - }, - "output": { - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "HttpControlChannel", - "alternatives": [ - "HttpControlChannel" - ], - "confidence": 0.99 - }, - "rag_count": 6, - "rag_rows": [ - { - "path": "src/app_runtime/control/http_channel.py", - "content": "class HttpControlChannel\nHttpControlChannel(ControlChannel)", - "layer": "C1_SYMBOL_CATALOG", - "title": "HttpControlChannel", - "span_start": 12, - "span_end": 57, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "1c9fbdc24819e5604c26ea55428a74310f03a03e1af197ed84846af61e42fdb0", - "qname": "HttpControlChannel", - "kind": "class", - "signature": "HttpControlChannel(ControlChannel)", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.control.http_channel", - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel.__init__\n -> HttpControlChannel._timeout\n -> HttpControlChannel._action_response", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "HttpControlChannel.__init__:dataflow_slice", - "span_start": 14, - "span_end": 47, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "c3ef21fcae96c82c00be74b3ab827d4af2085d89cb3fa5521c19a174aad84dbb", - "edge_type": "dataflow_slice", - "src_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "src_qname": "HttpControlChannel.__init__", - "dst_symbol_id": "e64969024ccaeb34d8d91473fad07b3b3d341875846392e7a006406c7ada1954", - "dst_ref": "HttpControlChannel._action_response", - "resolution": "resolved", - "slice_id": "c3ef21fcae96c82c00be74b3ab827d4af2085d89cb3fa5521c19a174aad84dbb", - "root_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "path_symbols": [ - "HttpControlChannel.__init__", - "HttpControlChannel._timeout", - "HttpControlChannel._action_response" - ], - "path_symbol_ids": [ - "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "e64969024ccaeb34d8d91473fad07b3b3d341875846392e7a006406c7ada1954" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel.__init__\n -> HttpControlChannel._runner\n -> HttpControlChannel.start", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "HttpControlChannel.__init__:dataflow_slice", - "span_start": 15, - "span_end": 22, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "51d73913df709152258ed1b9a8c8f4eb3c575eccfe6b982aef0b28e0789a29da", - "edge_type": "dataflow_slice", - "src_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "src_qname": "HttpControlChannel.__init__", - "dst_symbol_id": "d1933f04137f52535b6525f1b93ff2cd83bfb216b480e887e791ed1714cda8e0", - "dst_ref": "HttpControlChannel.start", - "resolution": "resolved", - "slice_id": "51d73913df709152258ed1b9a8c8f4eb3c575eccfe6b982aef0b28e0789a29da", - "root_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "path_symbols": [ - "HttpControlChannel.__init__", - "HttpControlChannel._runner", - "HttpControlChannel.start" - ], - "path_symbol_ids": [ - "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "d1933f04137f52535b6525f1b93ff2cd83bfb216b480e887e791ed1714cda8e0" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel.__init__\n -> HttpControlChannel._timeout\n -> HttpControlChannel._health_response", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "HttpControlChannel.__init__:dataflow_slice", - "span_start": 14, - "span_end": 34, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "f858f5c9e575f6c4cdfe3853571b7ee21d1f628a443541d2037c3dc9d0790bef", - "edge_type": "dataflow_slice", - "src_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "src_qname": "HttpControlChannel.__init__", - "dst_symbol_id": "e84bf04e9cd2127df235b7064d05f47e19f19a89c7c82f4c247231d4e8fa426a", - "dst_ref": "HttpControlChannel._health_response", - "resolution": "resolved", - "slice_id": "f858f5c9e575f6c4cdfe3853571b7ee21d1f628a443541d2037c3dc9d0790bef", - "root_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "path_symbols": [ - "HttpControlChannel.__init__", - "HttpControlChannel._timeout", - "HttpControlChannel._health_response" - ], - "path_symbol_ids": [ - "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "e84bf04e9cd2127df235b7064d05f47e19f19a89c7c82f4c247231d4e8fa426a" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel.__init__\n -> HttpControlChannel._runner\n -> HttpControlChannel.stop", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "HttpControlChannel.__init__:dataflow_slice", - "span_start": 15, - "span_end": 25, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "0f827ef81a990258a8a74381c8564a8361afa6712dba3200592659c939adcb9d", - "edge_type": "dataflow_slice", - "src_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "src_qname": "HttpControlChannel.__init__", - "dst_symbol_id": "f29ab212620093d72be20e26c5a399624c7939a6056a728762ed3f84a250bfa3", - "dst_ref": "HttpControlChannel.stop", - "resolution": "resolved", - "slice_id": "0f827ef81a990258a8a74381c8564a8361afa6712dba3200592659c939adcb9d", - "root_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "path_symbols": [ - "HttpControlChannel.__init__", - "HttpControlChannel._runner", - "HttpControlChannel.stop" - ], - "path_symbol_ids": [ - "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "f29ab212620093d72be20e26c5a399624c7939a6056a728762ed3f84a250bfa3" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "class HttpControlChannel(ControlChannel):\n def __init__(self, host: str, port: int, timeout: int) -> None:\n self._timeout = timeout\n self._runner = UvicornThreadRunner(host, port, timeout)\n self._factory = HttpControlAppFactory()\n self._actions: ControlActionSet | None = None\n\n async def start(self, actions: ControlActionSet) -> None:\n self._actions = actions\n app = self._factory.create(self._health_response, self._action_response)\n await self._runner.start(app)\n\n async def stop(self) -> None:\n await self._runner.stop()\n\n @property\n def port(self) -> int:\n return self._runner.port\n\n async def _health_response(self) -> dict[str, object]:\n if self._actions is None:\n return {\"status\": \"unhealthy\", \"detail\": \"control actions are not configured\"}\n return await asyncio.wait_for(self._actions.health(), timeout=float(self._timeout))\n\n async def _action_response(self, action: str, _client_source: str = \"unknown\") -> JSONResponse:\n if self._actions is None:\n return JSONResponse(content={\"status\": \"error\", \"detail\": f\"{action} handler is not configured\"}, status_code=404)\n callbacks = {\n \"start\": self._actions.start,\n \"stop\": self._actions.stop,\n \"status\": self._actions.status,\n }\n callback = callbacks.get(action)\n if callback is None:\n return JSONResponse(content={\"status\": \"error\", \"detail\": f\"unsupported action: {action}\"}, status_code=404)\n action_timeout = max(float(self._timeout), 10.0) if action in {\"start\", \"stop\"} else float(self._timeout)\n try:\n detail = await asyncio.wait_for(callback(), timeout=action_timeout)\n except asyncio.TimeoutError:\n return JSONResponse(\n content={\"status\": \"accepted\", \"detail\": f\"{action} operation is still in progress\"},\n status_code=202,\n )\n except Exception as exc:\n return JSONResponse(content={\"status\": \"error\", \"detail\": str(exc)}, status_code=500)\n return JSONResponse(content={\"status\": \"ok\", \"detail\": detail or f\"{action} action accepted\"}, status_code=200)", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/http_channel.py:HttpControlChannel", - "span_start": 12, - "span_end": 57, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.http_channel", - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ] - }, - "diagnostics": { - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C2_DEPENDENCY_GRAPH" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C0_SOURCE_CHUNKS": "exact_path_fetch", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 12, - "C2_DEPENDENCY_GRAPH": 4 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [ - "src/app_runtime/control/http_channel.py" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src/app_runtime/control/http_channel.py" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src/app_runtime/control/http_channel.py" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "HttpControlChannel", - "path_scope": [ - "src/app_runtime/control/http_channel.py" - ], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Почему в файле src/app_runtime/control/http_channel.py класс HttpControlChannel устроен так?", - "path_scope": [ - "src/app_runtime/control/http_channel.py" - ], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 12, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "Почему в файле src/app_runtime/control/http_channel.py класс HttpControlChannel устроен так?", - "path_scope": [ - "src/app_runtime/control/http_channel.py" - ], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 4, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [ - "src/app_runtime/control/http_channel.py" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 1, - "candidates_after_filter": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src/app_runtime/control/http_channel.py" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 1, - "candidates_after_filter": 1 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src/app_runtime/control/http_channel.py" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 4, - "candidates_after_filter": 4 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "HttpControlChannel", - "alternatives": [ - "HttpControlChannel" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 4, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "symbol_resolution": 0, - "retrieval_total": 90, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 34, - "C0_SOURCE_CHUNKS": 25, - "C2_DEPENDENCY_GRAPH": 29 - }, - "merge_rank": 39 - } - } - }, - { - "step": "llm_answer", - "input": { - "query": "Почему в файле src/app_runtime/control/http_channel.py класс HttpControlChannel устроен так?", - "rag_count": 6 - }, - "output": { - "llm_answer": "Класс `HttpControlChannel` реализует механизм управления HTTP каналом для взаимодействия с внешними клиентами или сервисами через протокол HTTP.\n\nЕго основная задача — обеспечивать старт и останов канала приема запросов, а также обработку двух типов ответов:\n\n1. Health check (`_health_response`) – возвращает статус системы (здорово ли она функционирует). Проверяет наличие настроенных действий контроля и возвращает состояние («здорова» или «нездорова») вместе с дополнительной информацией.\n \n Входные данные: \n - нет явных входных данных, кроме конфигурации каналов и настроенных действий;\n - выходные данные: словарь состояния и детализированного сообщения.\n\n2. Обработка пользовательских действий (`_action_response`) – отвечает за выполнение конкретного действия, указанного клиентом (например, изменение настроек, перезапуск сервиса).\n \n Входные данные:\n - строка с именем действия (`action`);\n - необязательное поле `_client_source`, указывающее источник запроса.\n \n Выходные данные:\n - либо успешное сообщение о выполненном действии,\n - либо ошибка, если действие не настроено или истекло время ожидания выполнения.\n\nПри инициализации класса создаются следующие компоненты:\n- `_runner`: объект, управляющий uvicorn-сервером (используется для запуска сервера);\n- `_factory`: фабрика приложений, создающая серверное приложение для обработки запросов;\n- `_actions`: набор доступных контролируемых действий.\n\nМетод `start()` запускает сервер и привязывает к нему обработчики, предоставленные пользователем при настройке системы.\nМетод `stop()` останавливает запущенный сервер.\n\nТаким образом, класс обеспечивает простую и удобную инфраструктуру для развертывания и мониторинга удалённых сервисов через HTTP-протокол." - }, - "diagnostics": { - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 898, - "evidence_rows": 6, - "evidence_chars": 2660 - }, - "evidence_summary": [ - { - "layer": "C1_SYMBOL_CATALOG", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "count": 4, - "unique_paths": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 1, - "unique_paths": 1 - } - ], - "prompt_template_id": "intent_code_qa_explain_local_ru_v4", - "system_prompt_version": "v1" - }, - "timings_ms": { - "prompt_build": 0, - "llm_call": 2794 - } - } - } - ] - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_143856/full_chain_plba_code_subintents_v2_plba-v2-explain-local-http-channel.md b/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_143856/full_chain_plba_code_subintents_v2_plba-v2-explain-local-http-channel.md deleted file mode 100644 index f248caf..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_143856/full_chain_plba_code_subintents_v2_plba-v2-explain-local-http-channel.md +++ /dev/null @@ -1,34 +0,0 @@ -# plba-v2-explain-local-http-channel - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_subintents_v2.yaml -- runner: runtime -- mode: full_chain -- passed: True - -## Query -Почему в файле src/app_runtime/control/http_channel.py класс HttpControlChannel устроен так? - -## Actual -{ - "intent": "CODE_QA", - "sub_intent": "EXPLAIN_LOCAL", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 6, - "llm_answer": "Класс `HttpControlChannel` реализует механизм управления HTTP каналом для взаимодействия с внешними клиентами или сервисами через протокол HTTP.\n\nЕго основная задача — обеспечивать старт и останов канала приема запросов, а также обработку двух типов ответов:\n\n1. Health check (`_health_response`) – возвращает статус системы (здорово ли она функционирует). Проверяет наличие настроенных действий контроля и возвращает состояние («здорова» или «нездорова») вместе с дополнительной информацией.\n \n Входные данные: \n - нет явных входных данных, кроме конфигурации каналов и настроенных действий;\n - выходные данные: словарь состояния и детализированного сообщения.\n\n2. Обработка пользовательских действий (`_action_response`) – отвечает за выполнение конкретного действия, указанного клиентом (например, изменение настроек, перезапуск сервиса).\n \n Входные данные:\n - строка с именем действия (`action`);\n - необязательное поле `_client_source`, указывающее источник запроса.\n \n Выходные данные:\n - либо успешное сообщение о выполненном действии,\n - либо ошибка, если действие не настроено или истекло время ожидания выполнения.\n\nПри инициализации класса создаются следующие компоненты:\n- `_runner`: объект, управляющий uvicorn-сервером (используется для запуска сервера);\n- `_factory`: фабрика приложений, создающая серверное приложение для обработки запросов;\n- `_actions`: набор доступных контролируемых действий.\n\nМетод `start()` запускает сервер и привязывает к нему обработчики, предоставленные пользователем при настройке системы.\nМетод `stop()` останавливает запущенный сервер.\n\nТаким образом, класс обеспечивает простую и удобную инфраструктуру для развертывания и мониторинга удалённых сервисов через HTTP-протокол.", - "answer_mode": "answered", - "path_scope": [ - "src/app_runtime/control/http_channel.py" - ], - "symbol_candidates": [ - "HttpControlChannel" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C2_DEPENDENCY_GRAPH" - ] -} - -## Mismatches -- none \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_143856/full_chain_plba_code_subintents_v2_plba-v2-explain-nonexistent-symbol.json b/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_143856/full_chain_plba_code_subintents_v2_plba-v2-explain-nonexistent-symbol.json deleted file mode 100644 index fe33d48..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_143856/full_chain_plba_code_subintents_v2_plba-v2-explain-nonexistent-symbol.json +++ /dev/null @@ -1,1169 +0,0 @@ -{ - "case_id": "plba-v2-explain-nonexistent-symbol", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_subintents_v2.yaml", - "runner": "runtime", - "mode": "full_chain", - "actual": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 0, - "llm_answer": "Сущность RuntimeFactoryManager не найдена в доступном коде. Близкие совпадения: ControlChannel, ControlActionSet.", - "answer_mode": "degraded", - "path_scope": [], - "symbol_candidates": [ - "RuntimeFactoryManager" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "passed": true, - "mismatches": [], - "details": { - "case_id": "plba-v2-explain-nonexistent-symbol", - "text": "Объясни класс RuntimeFactoryManager", - "mode": "full_chain", - "run_started_at": "2026-03-12T14:38:57", - "rag_session_id": "7d11da21-faa0-4cea-aede-aeabe069164c", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Объясни класс RuntimeFactoryManager", - "symbol_resolution": { - "status": "not_found", - "resolved_symbol": null, - "alternatives": [ - "ControlChannel", - "ControlActionSet" - ], - "confidence": 0.0 - }, - "rag_count": 0, - "rag_rows": [], - "llm_answer": "Сущность RuntimeFactoryManager не найдена в доступном коде. Близкие совпадения: ControlChannel, ControlActionSet.", - "summary": { - "router": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "confidence": null - }, - "retrieval": { - "profile": "code", - "layers_hit": [], - "evidence_sufficient": false - }, - "llm": { - "answer_status": "degraded", - "groundedness": "weakly_grounded" - } - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "RuntimeFactoryManager" - ], - "keyword_hints": [ - "RuntimeFactoryManager" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C0_SOURCE_CHUNKS": "exact_path_fetch", - "C4_SEMANTIC_ROLES": "exact_path_fetch", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C3_ENTRYPOINTS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 8, - "C4_SEMANTIC_ROLES": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C3_ENTRYPOINTS": 6 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C4_SEMANTIC_ROLES": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": null, - "workspace_id": null, - "returned_repo_ids": [], - "returned_workspace_ids": [] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "RuntimeFactoryManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "RuntimeFactoryManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C4_SEMANTIC_ROLES", - "query": "RuntimeFactoryManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "RuntimeFactoryManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - }, - { - "layer": "C3_ENTRYPOINTS", - "query": "RuntimeFactoryManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 2, - "candidates_after_filter": 2 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 6, - "candidates_after_filter": 6 - }, - { - "layer": "C3_ENTRYPOINTS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 3, - "candidates_after_filter": 3 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "not_found", - "resolved_symbol": null, - "alternatives": [ - "ControlChannel", - "ControlActionSet" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "miss", - "hit_count": 0, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "miss", - "hit_count": 0, - "fail_reason": null - }, - { - "layer": "C4_SEMANTIC_ROLES", - "status": "miss", - "hit_count": 0, - "fail_reason": null - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "miss", - "hit_count": 0, - "fail_reason": null - }, - { - "layer": "C3_ENTRYPOINTS", - "status": "miss", - "hit_count": 0, - "fail_reason": null - } - ] - }, - "constraint_violations": [ - { - "type": "LAYER_MISSING", - "severity": "warn", - "details": { - "layer": "C1_SYMBOL_CATALOG", - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "suggested_fix": "Increase top_k for this layer or relax constraints for retrieval." - }, - { - "type": "LAYER_MISSING", - "severity": "warn", - "details": { - "layer": "C0_SOURCE_CHUNKS", - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "suggested_fix": "Increase top_k for this layer or relax constraints for retrieval." - }, - { - "type": "LAYER_MISSING", - "severity": "warn", - "details": { - "layer": "C4_SEMANTIC_ROLES", - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "suggested_fix": "Increase top_k for this layer or relax constraints for retrieval." - }, - { - "type": "LAYER_MISSING", - "severity": "warn", - "details": { - "layer": "C2_DEPENDENCY_GRAPH", - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "suggested_fix": "Increase top_k for this layer or relax constraints for retrieval." - }, - { - "type": "LAYER_MISSING", - "severity": "warn", - "details": { - "layer": "C3_ENTRYPOINTS", - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "suggested_fix": "Increase top_k for this layer or relax constraints for retrieval." - }, - { - "type": "SYMBOL_RESOLUTION_FAILED", - "severity": "warn", - "details": { - "status": "not_found", - "symbol_candidates": [ - "RuntimeFactoryManager" - ] - }, - "suggested_fix": "Increase symbol layer budget or improve fuzzy symbol resolution settings." - } - ], - "timings_ms": { - "router": 1, - "symbol_resolution": 0, - "retrieval_total": 179, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 53, - "C0_SOURCE_CHUNKS": 27, - "C4_SEMANTIC_ROLES": 20, - "C2_DEPENDENCY_GRAPH": 63, - "C3_ENTRYPOINTS": 13 - }, - "merge_rank": 0, - "prompt_build": 0, - "llm_call": 0 - }, - "prompt": null, - "answer_policy": { - "short_circuit": true, - "answer_mode": "degraded", - "failure_reason": "symbol_not_found" - }, - "router": { - "conversation_mode": "START", - "keyword_hints": [ - "RuntimeFactoryManager" - ], - "path_scope": [] - }, - "llm": { - "used_evidence_count": 0, - "missing_evidence_reason": "symbol_not_found" - } - }, - "run_info": { - "case_id": "plba-v2-explain-nonexistent-symbol", - "mode": "full_chain", - "run_started_at": "2026-03-12T14:38:57", - "rag_session_id": "7d11da21-faa0-4cea-aede-aeabe069164c", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - }, - "input_request": { - "text": "Объясни класс RuntimeFactoryManager", - "normalized_query": "Объясни класс RuntimeFactoryManager" - }, - "steps": [ - { - "step": "intent_router", - "input": { - "query": "Объясни класс RuntimeFactoryManager" - }, - "output": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Объясни класс RuntimeFactoryManager" - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "RuntimeFactoryManager" - ], - "keyword_hints": [ - "RuntimeFactoryManager" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "timings_ms": { - "router": 1 - } - } - }, - { - "step": "retrieval", - "input": { - "query": "Объясни класс RuntimeFactoryManager" - }, - "output": { - "symbol_resolution": { - "status": "not_found", - "resolved_symbol": null, - "alternatives": [ - "ControlChannel", - "ControlActionSet" - ], - "confidence": 0.0 - }, - "rag_count": 0, - "rag_rows": [] - }, - "diagnostics": { - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C0_SOURCE_CHUNKS": "exact_path_fetch", - "C4_SEMANTIC_ROLES": "exact_path_fetch", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C3_ENTRYPOINTS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 8, - "C4_SEMANTIC_ROLES": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C3_ENTRYPOINTS": 6 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C4_SEMANTIC_ROLES": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": null, - "workspace_id": null, - "returned_repo_ids": [], - "returned_workspace_ids": [] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "RuntimeFactoryManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "RuntimeFactoryManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C4_SEMANTIC_ROLES", - "query": "RuntimeFactoryManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "RuntimeFactoryManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - }, - { - "layer": "C3_ENTRYPOINTS", - "query": "RuntimeFactoryManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 2, - "candidates_after_filter": 2 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 6, - "candidates_after_filter": 6 - }, - { - "layer": "C3_ENTRYPOINTS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 3, - "candidates_after_filter": 3 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "not_found", - "resolved_symbol": null, - "alternatives": [ - "ControlChannel", - "ControlActionSet" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "miss", - "hit_count": 0, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "miss", - "hit_count": 0, - "fail_reason": null - }, - { - "layer": "C4_SEMANTIC_ROLES", - "status": "miss", - "hit_count": 0, - "fail_reason": null - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "miss", - "hit_count": 0, - "fail_reason": null - }, - { - "layer": "C3_ENTRYPOINTS", - "status": "miss", - "hit_count": 0, - "fail_reason": null - } - ] - }, - "constraint_violations": [ - { - "type": "LAYER_MISSING", - "severity": "warn", - "details": { - "layer": "C1_SYMBOL_CATALOG", - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "suggested_fix": "Increase top_k for this layer or relax constraints for retrieval." - }, - { - "type": "LAYER_MISSING", - "severity": "warn", - "details": { - "layer": "C0_SOURCE_CHUNKS", - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "suggested_fix": "Increase top_k for this layer or relax constraints for retrieval." - }, - { - "type": "LAYER_MISSING", - "severity": "warn", - "details": { - "layer": "C4_SEMANTIC_ROLES", - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "suggested_fix": "Increase top_k for this layer or relax constraints for retrieval." - }, - { - "type": "LAYER_MISSING", - "severity": "warn", - "details": { - "layer": "C2_DEPENDENCY_GRAPH", - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "suggested_fix": "Increase top_k for this layer or relax constraints for retrieval." - }, - { - "type": "LAYER_MISSING", - "severity": "warn", - "details": { - "layer": "C3_ENTRYPOINTS", - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "suggested_fix": "Increase top_k for this layer or relax constraints for retrieval." - }, - { - "type": "SYMBOL_RESOLUTION_FAILED", - "severity": "warn", - "details": { - "status": "not_found", - "symbol_candidates": [ - "RuntimeFactoryManager" - ] - }, - "suggested_fix": "Increase symbol layer budget or improve fuzzy symbol resolution settings." - } - ], - "timings_ms": { - "symbol_resolution": 0, - "retrieval_total": 179, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 53, - "C0_SOURCE_CHUNKS": 27, - "C4_SEMANTIC_ROLES": 20, - "C2_DEPENDENCY_GRAPH": 63, - "C3_ENTRYPOINTS": 13 - }, - "merge_rank": 0 - } - } - }, - { - "step": "llm_answer", - "input": { - "query": "Объясни класс RuntimeFactoryManager", - "rag_count": 0 - }, - "output": { - "llm_answer": "Сущность RuntimeFactoryManager не найдена в доступном коде. Близкие совпадения: ControlChannel, ControlActionSet." - }, - "diagnostics": { - "prompt": null, - "timings_ms": { - "prompt_build": 0, - "llm_call": 0 - } - } - } - ] - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_143856/full_chain_plba_code_subintents_v2_plba-v2-explain-nonexistent-symbol.md b/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_143856/full_chain_plba_code_subintents_v2_plba-v2-explain-nonexistent-symbol.md deleted file mode 100644 index 56d307f..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_143856/full_chain_plba_code_subintents_v2_plba-v2-explain-nonexistent-symbol.md +++ /dev/null @@ -1,34 +0,0 @@ -# plba-v2-explain-nonexistent-symbol - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_subintents_v2.yaml -- runner: runtime -- mode: full_chain -- passed: True - -## Query -Объясни класс RuntimeFactoryManager - -## Actual -{ - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 0, - "llm_answer": "Сущность RuntimeFactoryManager не найдена в доступном коде. Близкие совпадения: ControlChannel, ControlActionSet.", - "answer_mode": "degraded", - "path_scope": [], - "symbol_candidates": [ - "RuntimeFactoryManager" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] -} - -## Mismatches -- none \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_143856/full_chain_plba_code_subintents_v2_plba-v2-explain-runtime-manager.json b/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_143856/full_chain_plba_code_subintents_v2_plba-v2-explain-runtime-manager.json deleted file mode 100644 index 3889d62..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_143856/full_chain_plba_code_subintents_v2_plba-v2-explain-runtime-manager.json +++ /dev/null @@ -1,2088 +0,0 @@ -{ - "case_id": "plba-v2-explain-runtime-manager", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_subintents_v2.yaml", - "runner": "runtime", - "mode": "full_chain", - "actual": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 12, - "llm_answer": "Класс `RuntimeManager` является менеджером, ответственным за координацию и управление различными компонентами приложения в определённый жизненный цикл.\nКлючевые особенности класса:\n\n1. Инициализация:\n - Конструктор принимает несколько необязательных аргументов (`configuration`, `services`, `traces`, `health`, `logs`, `workers`, `control_plane`), которые по умолчанию инициализируются пустыми значениями соответствующих классов.\n \n2. Атрибуты состояния:\n - Имеет атрибуты `_started`, `_state`, `_core_registered`, `_workers_registered`, используемые для отслеживания текущего состояния системы и этапов её запуска.\n\n3. Регистрация сервисов:\n - Метод `_register_core_services()` регистрирует основные сервисы, необходимые для выполнения основных функций приложения.\n\n4. Методы регистрации модулей:\n - Методы вроде `register_module(module)` позволяют зарегистрировать дополнительные модули, расширяя функциональность runtime-системы.\n\nНесмотря на то, что непосредственно в предоставленных данных не указаны подробности вызова методов после инициализации, можно осторожно предположить, что методы могут быть вызваны позже через различные события или HTTP-запросы, учитывая наличие модуля FastAPI в графе зависимостей.\n\nТаким образом, класс `RuntimeManager` работает как центрального координатора различных компонентов приложения, обеспечивая их регистрацию, настройку и управление состоянием во время исполнения программы.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "RuntimeManager" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "passed": true, - "mismatches": [], - "details": { - "case_id": "plba-v2-explain-runtime-manager", - "text": "Объясни как работает класс RuntimeManager", - "mode": "full_chain", - "run_started_at": "2026-03-12T14:38:57", - "rag_session_id": "7d11da21-faa0-4cea-aede-aeabe069164c", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Объясни как работает класс RuntimeManager", - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "RuntimeManager", - "alternatives": [ - "RuntimeManager" - ], - "confidence": 0.99 - }, - "rag_count": 12, - "rag_rows": [ - { - "path": "src/app_runtime/core/runtime.py", - "content": "class RuntimeManager\nRuntimeManager", - "layer": "C1_SYMBOL_CATALOG", - "title": "RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "7e4a9381328c5803bbc6179458612fc4e947d928aa7bf8b4b2bebb2c8592f758", - "qname": "RuntimeManager", - "kind": "class", - "signature": "RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.core.runtime", - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests manager\n- orchestrates role-like calls (4)\n- reads and writes state attributes\n- participates in dataflow slices (50)", - "layer": "C4_SEMANTIC_ROLES", - "title": "RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 43, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "7e4a9381328c5803bbc6179458612fc4e947d928aa7bf8b4b2bebb2c8592f758", - "symbol_name": "RuntimeManager", - "qname": "RuntimeManager", - "role": "pipeline_stage", - "confidence": 0.67, - "dataflow_participation": 50, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.stop", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 25, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d", - "dst_ref": "ControlPlaneService.stop", - "resolution": "resolved", - "slice_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.stop" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._stop_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 51, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a", - "dst_ref": "ControlPlaneService._stop_async", - "resolution": "resolved", - "slice_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._stop_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.register_channel", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 17, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957", - "dst_ref": "ControlPlaneService.register_channel", - "resolution": "resolved", - "slice_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.register_channel" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.start", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 20, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154", - "dst_ref": "ControlPlaneService.start", - "resolution": "resolved", - "slice_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.start" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._start_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 47, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517", - "dst_ref": "ControlPlaneService._start_async", - "resolution": "resolved", - "slice_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._start_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager.add_config_file", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 32, - "span_end": 52, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "a23b8a11ebdb12708b60c96ea12a69f7f042082f1adfddd572444e246d81d167", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "57ffbd4f0d9fdf3507c2b8624312ce211f3d02fdf86a57a8ec90778d8a7b498d", - "dst_ref": "RuntimeManager.add_config_file", - "resolution": "resolved", - "slice_id": "a23b8a11ebdb12708b60c96ea12a69f7f042082f1adfddd572444e246d81d167", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager.add_config_file" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "57ffbd4f0d9fdf3507c2b8624312ce211f3d02fdf86a57a8ec90778d8a7b498d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "class RuntimeManager:\n ACTION_TIMEOUT_SECONDS = 10.0\n ACTION_POLL_INTERVAL_SECONDS = 0.05\n\n def __init__(\n self,\n configuration: ConfigurationManager | None = None,\n services: ServiceContainer | None = None,\n traces: TraceService | None = None,\n health: HealthRegistry | None = None,\n logs: LogManager | None = None,\n workers: WorkerSupervisor | None = None,\n control_plane: ControlPlaneService | None = None,\n ) -> None:\n self.configuration = configuration or ConfigurationManager()\n self.services = services or ServiceContainer()\n self.traces = traces or TraceService()\n self.health = health or HealthRegistry()\n self.logs = logs or LogManager()\n self.workers = workers or WorkerSupervisor()\n self.control_plane = control_plane or ControlPlaneService()\n self.registry = ModuleRegistry(self.services)\n self._started = False\n self._state = LifecycleState.IDLE\n self._core_registered = False\n self._workers_registered = False\n self._register_core_services()\n\n def register_module(self, module: ApplicationModule) -> None:\n self.registry.register_module(module.name)\n module.register(self.registry)\n\n def add_config_file(self, path: str) -> FileConfigProvider:\n provider = FileConfigProvider(path)\n self.configuration.add_provider(provider)\n return provider\n\n def start(self, *, start_control_plane: bool = True) -> None:\n if self._started:\n return\n self._state = LifecycleState.STARTING\n config = self.configuration.load()\n self.logs.apply_config(config)\n self._register_health_contributors()\n self._register_workers()\n self.workers.start()\n if start_control_plane:\n self.control_plane.start(self)\n self._started = True\n self._refresh_state()\n\n def stop(self, timeout: float = 30.0, force: bool = False, stop_control_plane: bool = True) -> None:\n if not self._started:\n return\n self._state = LifecycleState.STOPPING\n self.workers.stop(timeout=timeout, force=force)\n if stop_control_plane:\n self.control_plane.stop()\n self._started = False\n self._state = LifecycleState.STOPPED\n\n def status(self) -> dict[str, object]:\n self._refresh_state()\n return self.control_plane.snapshot(self)\n\n def current_health(self) -> HealthPayload:\n self._refresh_state()\n return self.health.payload(self._state, self.workers.healths())\n\n async def health_status(self) -> HealthPayload:\n return self.current_health()\n\n async def start_runtime(self) -> dict[str, object] | str:\n self._refresh_state()\n if self._started:\n return \"runtime already running\"\n if self._state == LifecycleState.STOPPING:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n\n self.start(start_control_plane=False)\n started = self._wait_for_state({LifecycleState.IDLE, LifecycleState.BUSY}, timeout=self.ACTION_TIMEOUT_SECONDS)\n if started:\n return self._action_detail(\"runtime started\", timed_out=False)\n return self._action_detail(\"runtime start is still in progress\", timed_out=True)\n\n async def stop_runtime(self) -> dict[str, object] | str:\n self._refresh_state()\n if not self._started:\n if self._state == LifecycleState.STOPPING:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n return \"runtime already stopped\"\n\n self._state = LifecycleState.STOPPING\n try:\n self.workers.stop(timeout=self.ACTION_TIMEOUT_SECONDS, force=False)\n except TimeoutError:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n\n self._started = False\n self._state = LifecycleState.STOPPED\n return self._action_detail(\"runtime stopped\", timed_out=False)\n\n async def runtime_status(self) -> str:\n self._refresh_state()\n return self._state.value\n\n def _register_core_services(self) -> None:\n if self._core_registered:\n return\n self.services.register(\"configuration\", self.configuration)\n self.services.register(\"traces\", self.traces)\n self.services.register(\"health\", self.health)\n self.services.register(\"logs\", self.logs)\n self.services.register(\"workers\", self.workers)\n self.services.register(\"control_plane\", self.control_plane)\n self._core_registered = True\n\n def _register_health_contributors(self) -> None:\n for contributor in self.registry.health_contributors:\n self.health.register(contributor)\n\n def _register_workers(self) -> None:\n if self._workers_registered:\n return\n for worker in self.registry.workers:\n self.workers.register(worker)\n self._workers_registered = True\n\n def _refresh_state(self) -> None:\n lifecycle = self.workers.lifecycle_state()\n\n if self._state == LifecycleState.STOPPING:\n if lifecycle == LifecycleState.STOPPED:\n self._started = False\n self._state = LifecycleState.STOPPED\n return\n\n if not self._started:\n if lifecycle == LifecycleState.STOPPED:\n self._state = LifecycleState.STOPPED\n return\n\n self._state = lifecycle\n\n def _wait_for_state(self, target_states: set[LifecycleState], *, timeout: float) -> bool:\n deadline = monotonic() + timeout\n while monotonic() < deadline:\n self._refresh_state()\n if self._state in target_states:\n return True\n sleep(self.ACTION_POLL_INTERVAL_SECONDS)\n self._refresh_state()\n return self._state in target_states\n\n def _action_detail(self, message: str, *, timed_out: bool) -> dict[str, object]:\n self._refresh_state()\n return {\n \"message\": message,\n \"state\": self._state.value,\n \"timed_out\": timed_out,\n \"workers\": self.workers.snapshot(),\n }", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/core/runtime.py:RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.core.runtime", - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "llm_answer": "Класс `RuntimeManager` является менеджером, ответственным за координацию и управление различными компонентами приложения в определённый жизненный цикл.\nКлючевые особенности класса:\n\n1. Инициализация:\n - Конструктор принимает несколько необязательных аргументов (`configuration`, `services`, `traces`, `health`, `logs`, `workers`, `control_plane`), которые по умолчанию инициализируются пустыми значениями соответствующих классов.\n \n2. Атрибуты состояния:\n - Имеет атрибуты `_started`, `_state`, `_core_registered`, `_workers_registered`, используемые для отслеживания текущего состояния системы и этапов её запуска.\n\n3. Регистрация сервисов:\n - Метод `_register_core_services()` регистрирует основные сервисы, необходимые для выполнения основных функций приложения.\n\n4. Методы регистрации модулей:\n - Методы вроде `register_module(module)` позволяют зарегистрировать дополнительные модули, расширяя функциональность runtime-системы.\n\nНесмотря на то, что непосредственно в предоставленных данных не указаны подробности вызова методов после инициализации, можно осторожно предположить, что методы могут быть вызваны позже через различные события или HTTP-запросы, учитывая наличие модуля FastAPI в графе зависимостей.\n\nТаким образом, класс `RuntimeManager` работает как центрального координатора различных компонентов приложения, обеспечивая их регистрацию, настройку и управление состоянием во время исполнения программы.", - "summary": { - "router": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "confidence": null - }, - "retrieval": { - "profile": "code", - "layers_hit": [ - "C0_SOURCE_CHUNKS", - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS", - "C4_SEMANTIC_ROLES" - ], - "evidence_sufficient": true - }, - "llm": { - "answer_status": "answered", - "groundedness": "grounded" - } - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "RuntimeManager" - ], - "keyword_hints": [ - "RuntimeManager" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C0_SOURCE_CHUNKS": "exact_path_fetch", - "C4_SEMANTIC_ROLES": "exact_path_fetch", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C3_ENTRYPOINTS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 8, - "C4_SEMANTIC_ROLES": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C3_ENTRYPOINTS": 6 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C4_SEMANTIC_ROLES": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C4_SEMANTIC_ROLES", - "query": "RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - }, - { - "layer": "C3_ENTRYPOINTS", - "query": "RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 1, - "candidates_after_filter": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 6, - "candidates_after_filter": 6 - }, - { - "layer": "C3_ENTRYPOINTS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 3, - "candidates_after_filter": 3 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "RuntimeManager", - "alternatives": [ - "RuntimeManager" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C4_SEMANTIC_ROLES", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 6, - "fail_reason": null - }, - { - "layer": "C3_ENTRYPOINTS", - "status": "hit", - "hit_count": 3, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "router": 2, - "symbol_resolution": 0, - "retrieval_total": 256, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 37, - "C0_SOURCE_CHUNKS": 29, - "C4_SEMANTIC_ROLES": 66, - "C2_DEPENDENCY_GRAPH": 79, - "C3_ENTRYPOINTS": 11 - }, - "merge_rank": 21, - "prompt_build": 0, - "llm_call": 2617 - }, - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 919, - "evidence_rows": 12, - "evidence_chars": 7130 - }, - "evidence_summary": [ - { - "layer": "C1_SYMBOL_CATALOG", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "count": 6, - "unique_paths": 2 - }, - { - "layer": "C3_ENTRYPOINTS", - "count": 3, - "unique_paths": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 1, - "unique_paths": 1 - } - ], - "prompt_template_id": "intent_code_qa_explain_ru_v4", - "system_prompt_version": "v1" - }, - "router": { - "conversation_mode": "START", - "keyword_hints": [ - "RuntimeManager" - ], - "path_scope": [] - }, - "llm": { - "used_evidence_count": 12, - "missing_evidence_reason": null - } - }, - "run_info": { - "case_id": "plba-v2-explain-runtime-manager", - "mode": "full_chain", - "run_started_at": "2026-03-12T14:38:57", - "rag_session_id": "7d11da21-faa0-4cea-aede-aeabe069164c", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - }, - "input_request": { - "text": "Объясни как работает класс RuntimeManager", - "normalized_query": "Объясни как работает класс RuntimeManager" - }, - "steps": [ - { - "step": "intent_router", - "input": { - "query": "Объясни как работает класс RuntimeManager" - }, - "output": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Объясни как работает класс RuntimeManager" - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "RuntimeManager" - ], - "keyword_hints": [ - "RuntimeManager" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "timings_ms": { - "router": 2 - } - } - }, - { - "step": "retrieval", - "input": { - "query": "Объясни как работает класс RuntimeManager" - }, - "output": { - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "RuntimeManager", - "alternatives": [ - "RuntimeManager" - ], - "confidence": 0.99 - }, - "rag_count": 12, - "rag_rows": [ - { - "path": "src/app_runtime/core/runtime.py", - "content": "class RuntimeManager\nRuntimeManager", - "layer": "C1_SYMBOL_CATALOG", - "title": "RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "7e4a9381328c5803bbc6179458612fc4e947d928aa7bf8b4b2bebb2c8592f758", - "qname": "RuntimeManager", - "kind": "class", - "signature": "RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.core.runtime", - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests manager\n- orchestrates role-like calls (4)\n- reads and writes state attributes\n- participates in dataflow slices (50)", - "layer": "C4_SEMANTIC_ROLES", - "title": "RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 43, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "7e4a9381328c5803bbc6179458612fc4e947d928aa7bf8b4b2bebb2c8592f758", - "symbol_name": "RuntimeManager", - "qname": "RuntimeManager", - "role": "pipeline_stage", - "confidence": 0.67, - "dataflow_participation": 50, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.stop", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 25, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d", - "dst_ref": "ControlPlaneService.stop", - "resolution": "resolved", - "slice_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.stop" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._stop_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 51, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a", - "dst_ref": "ControlPlaneService._stop_async", - "resolution": "resolved", - "slice_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._stop_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.register_channel", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 17, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957", - "dst_ref": "ControlPlaneService.register_channel", - "resolution": "resolved", - "slice_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.register_channel" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.start", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 20, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154", - "dst_ref": "ControlPlaneService.start", - "resolution": "resolved", - "slice_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.start" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._start_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 47, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517", - "dst_ref": "ControlPlaneService._start_async", - "resolution": "resolved", - "slice_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._start_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager.add_config_file", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 32, - "span_end": 52, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "a23b8a11ebdb12708b60c96ea12a69f7f042082f1adfddd572444e246d81d167", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "57ffbd4f0d9fdf3507c2b8624312ce211f3d02fdf86a57a8ec90778d8a7b498d", - "dst_ref": "RuntimeManager.add_config_file", - "resolution": "resolved", - "slice_id": "a23b8a11ebdb12708b60c96ea12a69f7f042082f1adfddd572444e246d81d167", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager.add_config_file" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "57ffbd4f0d9fdf3507c2b8624312ce211f3d02fdf86a57a8ec90778d8a7b498d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "class RuntimeManager:\n ACTION_TIMEOUT_SECONDS = 10.0\n ACTION_POLL_INTERVAL_SECONDS = 0.05\n\n def __init__(\n self,\n configuration: ConfigurationManager | None = None,\n services: ServiceContainer | None = None,\n traces: TraceService | None = None,\n health: HealthRegistry | None = None,\n logs: LogManager | None = None,\n workers: WorkerSupervisor | None = None,\n control_plane: ControlPlaneService | None = None,\n ) -> None:\n self.configuration = configuration or ConfigurationManager()\n self.services = services or ServiceContainer()\n self.traces = traces or TraceService()\n self.health = health or HealthRegistry()\n self.logs = logs or LogManager()\n self.workers = workers or WorkerSupervisor()\n self.control_plane = control_plane or ControlPlaneService()\n self.registry = ModuleRegistry(self.services)\n self._started = False\n self._state = LifecycleState.IDLE\n self._core_registered = False\n self._workers_registered = False\n self._register_core_services()\n\n def register_module(self, module: ApplicationModule) -> None:\n self.registry.register_module(module.name)\n module.register(self.registry)\n\n def add_config_file(self, path: str) -> FileConfigProvider:\n provider = FileConfigProvider(path)\n self.configuration.add_provider(provider)\n return provider\n\n def start(self, *, start_control_plane: bool = True) -> None:\n if self._started:\n return\n self._state = LifecycleState.STARTING\n config = self.configuration.load()\n self.logs.apply_config(config)\n self._register_health_contributors()\n self._register_workers()\n self.workers.start()\n if start_control_plane:\n self.control_plane.start(self)\n self._started = True\n self._refresh_state()\n\n def stop(self, timeout: float = 30.0, force: bool = False, stop_control_plane: bool = True) -> None:\n if not self._started:\n return\n self._state = LifecycleState.STOPPING\n self.workers.stop(timeout=timeout, force=force)\n if stop_control_plane:\n self.control_plane.stop()\n self._started = False\n self._state = LifecycleState.STOPPED\n\n def status(self) -> dict[str, object]:\n self._refresh_state()\n return self.control_plane.snapshot(self)\n\n def current_health(self) -> HealthPayload:\n self._refresh_state()\n return self.health.payload(self._state, self.workers.healths())\n\n async def health_status(self) -> HealthPayload:\n return self.current_health()\n\n async def start_runtime(self) -> dict[str, object] | str:\n self._refresh_state()\n if self._started:\n return \"runtime already running\"\n if self._state == LifecycleState.STOPPING:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n\n self.start(start_control_plane=False)\n started = self._wait_for_state({LifecycleState.IDLE, LifecycleState.BUSY}, timeout=self.ACTION_TIMEOUT_SECONDS)\n if started:\n return self._action_detail(\"runtime started\", timed_out=False)\n return self._action_detail(\"runtime start is still in progress\", timed_out=True)\n\n async def stop_runtime(self) -> dict[str, object] | str:\n self._refresh_state()\n if not self._started:\n if self._state == LifecycleState.STOPPING:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n return \"runtime already stopped\"\n\n self._state = LifecycleState.STOPPING\n try:\n self.workers.stop(timeout=self.ACTION_TIMEOUT_SECONDS, force=False)\n except TimeoutError:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n\n self._started = False\n self._state = LifecycleState.STOPPED\n return self._action_detail(\"runtime stopped\", timed_out=False)\n\n async def runtime_status(self) -> str:\n self._refresh_state()\n return self._state.value\n\n def _register_core_services(self) -> None:\n if self._core_registered:\n return\n self.services.register(\"configuration\", self.configuration)\n self.services.register(\"traces\", self.traces)\n self.services.register(\"health\", self.health)\n self.services.register(\"logs\", self.logs)\n self.services.register(\"workers\", self.workers)\n self.services.register(\"control_plane\", self.control_plane)\n self._core_registered = True\n\n def _register_health_contributors(self) -> None:\n for contributor in self.registry.health_contributors:\n self.health.register(contributor)\n\n def _register_workers(self) -> None:\n if self._workers_registered:\n return\n for worker in self.registry.workers:\n self.workers.register(worker)\n self._workers_registered = True\n\n def _refresh_state(self) -> None:\n lifecycle = self.workers.lifecycle_state()\n\n if self._state == LifecycleState.STOPPING:\n if lifecycle == LifecycleState.STOPPED:\n self._started = False\n self._state = LifecycleState.STOPPED\n return\n\n if not self._started:\n if lifecycle == LifecycleState.STOPPED:\n self._state = LifecycleState.STOPPED\n return\n\n self._state = lifecycle\n\n def _wait_for_state(self, target_states: set[LifecycleState], *, timeout: float) -> bool:\n deadline = monotonic() + timeout\n while monotonic() < deadline:\n self._refresh_state()\n if self._state in target_states:\n return True\n sleep(self.ACTION_POLL_INTERVAL_SECONDS)\n self._refresh_state()\n return self._state in target_states\n\n def _action_detail(self, message: str, *, timed_out: bool) -> dict[str, object]:\n self._refresh_state()\n return {\n \"message\": message,\n \"state\": self._state.value,\n \"timed_out\": timed_out,\n \"workers\": self.workers.snapshot(),\n }", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/core/runtime.py:RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.core.runtime", - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ] - }, - "diagnostics": { - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C0_SOURCE_CHUNKS": "exact_path_fetch", - "C4_SEMANTIC_ROLES": "exact_path_fetch", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C3_ENTRYPOINTS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 8, - "C4_SEMANTIC_ROLES": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C3_ENTRYPOINTS": 6 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C4_SEMANTIC_ROLES": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C4_SEMANTIC_ROLES", - "query": "RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - }, - { - "layer": "C3_ENTRYPOINTS", - "query": "RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 1, - "candidates_after_filter": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 6, - "candidates_after_filter": 6 - }, - { - "layer": "C3_ENTRYPOINTS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 3, - "candidates_after_filter": 3 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "RuntimeManager", - "alternatives": [ - "RuntimeManager" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C4_SEMANTIC_ROLES", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 6, - "fail_reason": null - }, - { - "layer": "C3_ENTRYPOINTS", - "status": "hit", - "hit_count": 3, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "symbol_resolution": 0, - "retrieval_total": 256, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 37, - "C0_SOURCE_CHUNKS": 29, - "C4_SEMANTIC_ROLES": 66, - "C2_DEPENDENCY_GRAPH": 79, - "C3_ENTRYPOINTS": 11 - }, - "merge_rank": 21 - } - } - }, - { - "step": "llm_answer", - "input": { - "query": "Объясни как работает класс RuntimeManager", - "rag_count": 12 - }, - "output": { - "llm_answer": "Класс `RuntimeManager` является менеджером, ответственным за координацию и управление различными компонентами приложения в определённый жизненный цикл.\nКлючевые особенности класса:\n\n1. Инициализация:\n - Конструктор принимает несколько необязательных аргументов (`configuration`, `services`, `traces`, `health`, `logs`, `workers`, `control_plane`), которые по умолчанию инициализируются пустыми значениями соответствующих классов.\n \n2. Атрибуты состояния:\n - Имеет атрибуты `_started`, `_state`, `_core_registered`, `_workers_registered`, используемые для отслеживания текущего состояния системы и этапов её запуска.\n\n3. Регистрация сервисов:\n - Метод `_register_core_services()` регистрирует основные сервисы, необходимые для выполнения основных функций приложения.\n\n4. Методы регистрации модулей:\n - Методы вроде `register_module(module)` позволяют зарегистрировать дополнительные модули, расширяя функциональность runtime-системы.\n\nНесмотря на то, что непосредственно в предоставленных данных не указаны подробности вызова методов после инициализации, можно осторожно предположить, что методы могут быть вызваны позже через различные события или HTTP-запросы, учитывая наличие модуля FastAPI в графе зависимостей.\n\nТаким образом, класс `RuntimeManager` работает как центрального координатора различных компонентов приложения, обеспечивая их регистрацию, настройку и управление состоянием во время исполнения программы." - }, - "diagnostics": { - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 919, - "evidence_rows": 12, - "evidence_chars": 7130 - }, - "evidence_summary": [ - { - "layer": "C1_SYMBOL_CATALOG", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "count": 6, - "unique_paths": 2 - }, - { - "layer": "C3_ENTRYPOINTS", - "count": 3, - "unique_paths": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 1, - "unique_paths": 1 - } - ], - "prompt_template_id": "intent_code_qa_explain_ru_v4", - "system_prompt_version": "v1" - }, - "timings_ms": { - "prompt_build": 0, - "llm_call": 2617 - } - } - } - ] - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_143856/full_chain_plba_code_subintents_v2_plba-v2-explain-runtime-manager.md b/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_143856/full_chain_plba_code_subintents_v2_plba-v2-explain-runtime-manager.md deleted file mode 100644 index 1527d12..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_143856/full_chain_plba_code_subintents_v2_plba-v2-explain-runtime-manager.md +++ /dev/null @@ -1,34 +0,0 @@ -# plba-v2-explain-runtime-manager - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_subintents_v2.yaml -- runner: runtime -- mode: full_chain -- passed: True - -## Query -Объясни как работает класс RuntimeManager - -## Actual -{ - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 12, - "llm_answer": "Класс `RuntimeManager` является менеджером, ответственным за координацию и управление различными компонентами приложения в определённый жизненный цикл.\nКлючевые особенности класса:\n\n1. Инициализация:\n - Конструктор принимает несколько необязательных аргументов (`configuration`, `services`, `traces`, `health`, `logs`, `workers`, `control_plane`), которые по умолчанию инициализируются пустыми значениями соответствующих классов.\n \n2. Атрибуты состояния:\n - Имеет атрибуты `_started`, `_state`, `_core_registered`, `_workers_registered`, используемые для отслеживания текущего состояния системы и этапов её запуска.\n\n3. Регистрация сервисов:\n - Метод `_register_core_services()` регистрирует основные сервисы, необходимые для выполнения основных функций приложения.\n\n4. Методы регистрации модулей:\n - Методы вроде `register_module(module)` позволяют зарегистрировать дополнительные модули, расширяя функциональность runtime-системы.\n\nНесмотря на то, что непосредственно в предоставленных данных не указаны подробности вызова методов после инициализации, можно осторожно предположить, что методы могут быть вызваны позже через различные события или HTTP-запросы, учитывая наличие модуля FastAPI в графе зависимостей.\n\nТаким образом, класс `RuntimeManager` работает как центрального координатора различных компонентов приложения, обеспечивая их регистрацию, настройку и управление состоянием во время исполнения программы.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "RuntimeManager" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] -} - -## Mismatches -- none \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_143856/full_chain_plba_code_subintents_v2_plba-v2-explain-trace-service.json b/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_143856/full_chain_plba_code_subintents_v2_plba-v2-explain-trace-service.json deleted file mode 100644 index 6e69a27..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_143856/full_chain_plba_code_subintents_v2_plba-v2-explain-trace-service.json +++ /dev/null @@ -1,2208 +0,0 @@ -{ - "case_id": "plba-v2-explain-trace-service", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_subintents_v2.yaml", - "runner": "runtime", - "mode": "full_chain", - "actual": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 14, - "llm_answer": "Класс `TraceService` в файле `src/app_runtime/tracing/service.py` является компонентом, ответственным за управление контекстами трассировки и взаимодействие с транспортом для записи данных о трассировке.\nКлючевые аспекты класса:\n\n1. Инициализация (`__init__()`):\n - Конструктор принимает два параметра: транспорт для записи трассировочных данных (`transport`) и хранилище контекста трассировки (`store`).\n - По умолчанию используются заглушка транспорта (`NoOpTraceTransport()`) и хранилище по умолчанию (`TraceContextStore()`).\n - Создаётся объект записи записей трассировки через `TraceRecordWriter`.\n\n2. Создание контекста трассировки (`create_context()`):\n - Метод создаёт новый контекст трассировки, используя UUID для уникального идентификатора трассировки.\n - Записывает контекст в хранилище и отправляет запись в транспорт через метод записи контекста (`write_context()`).\n - Возвращает уникальный идентификатор созданной трассировки.\n\n3. Временная область видимости контекста трассировки (`open_context()`):\n - Контекст создаётся при входе в блок, а затем автоматически удаляется после выхода из блока.\n - Используется генератор контекста для автоматического управления жизненным циклом трассировки.\nКосвенные выводы:\n- Класс предназначен для участия в конвейере обработки данных (pipeline stage), судя по аннотации ролей (`role: pipeline_stage`).\n- Предполагается участие в потоках данных (\"dataflow slices\"), хотя конкретный механизм этого не указан напрямую.\n\nЭтот компонент играет важную роль в управлении и записи информации о трассировке приложения, обеспечивая унифицированный интерфейс для создания и управления контекстами трассировок.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "TraceService" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "passed": true, - "mismatches": [], - "details": { - "case_id": "plba-v2-explain-trace-service", - "text": "Объясни как работает класс TraceService", - "mode": "full_chain", - "run_started_at": "2026-03-12T14:38:57", - "rag_session_id": "7d11da21-faa0-4cea-aede-aeabe069164c", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Объясни как работает класс TraceService", - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "TraceService", - "alternatives": [ - "TraceService" - ], - "confidence": 0.99 - }, - "rag_count": 14, - "rag_rows": [ - { - "path": "src/app_runtime/tracing/service.py", - "content": "class TraceService\nTraceService(TraceContextFactory)", - "layer": "C1_SYMBOL_CATALOG", - "title": "TraceService", - "span_start": 39, - "span_end": 166, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "c2b2b976d99f2c600000b753731b26e0a69adcb4359398b93073590c5d5d04f4", - "qname": "TraceService", - "kind": "class", - "signature": "TraceService(TraceContextFactory)", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.tracing.service", - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "TraceService\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests service\n- reads and writes state attributes\n- participates in dataflow slices (13)", - "layer": "C4_SEMANTIC_ROLES", - "title": "TraceService", - "span_start": 39, - "span_end": 166, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 60, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "c2b2b976d99f2c600000b753731b26e0a69adcb4359398b93073590c5d5d04f4", - "symbol_name": "TraceService", - "qname": "TraceService", - "role": "pipeline_stage", - "confidence": 0.57, - "dataflow_participation": 13, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "TraceService.__init__\n -> TraceService.store\n -> TraceService.create_context", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "TraceService.__init__:dataflow_slice", - "span_start": 42, - "span_end": 61, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "3b052062067a78aef3302ee1d996897e02a67d1b340397bea4f59fe147c0492a", - "edge_type": "dataflow_slice", - "src_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "src_qname": "TraceService.__init__", - "dst_symbol_id": "ff44881104b65ef50ee6fe16d367d4a81b6e7eb5c44c0963cf4543faec785d4a", - "dst_ref": "TraceService.create_context", - "resolution": "resolved", - "slice_id": "3b052062067a78aef3302ee1d996897e02a67d1b340397bea4f59fe147c0492a", - "root_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "path_symbols": [ - "TraceService.__init__", - "TraceService.store", - "TraceService.create_context" - ], - "path_symbol_ids": [ - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "ff44881104b65ef50ee6fe16d367d4a81b6e7eb5c44c0963cf4543faec785d4a" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "TraceService.__init__\n -> TraceService.store\n -> TraceService.close_context", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "TraceService.__init__:dataflow_slice", - "span_start": 42, - "span_end": 84, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "7a9353ef57c9ae5d19b3a0c6ac50fad05e6d21d31bbe1cd1cd07af6332ba6505", - "edge_type": "dataflow_slice", - "src_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "src_qname": "TraceService.__init__", - "dst_symbol_id": "01e14158dcced7e52d0c8ac84ac7b9a75225c261b6aca6a1d7da802d0994721c", - "dst_ref": "TraceService.close_context", - "resolution": "resolved", - "slice_id": "7a9353ef57c9ae5d19b3a0c6ac50fad05e6d21d31bbe1cd1cd07af6332ba6505", - "root_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "path_symbols": [ - "TraceService.__init__", - "TraceService.store", - "TraceService.close_context" - ], - "path_symbol_ids": [ - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "01e14158dcced7e52d0c8ac84ac7b9a75225c261b6aca6a1d7da802d0994721c" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "TraceService.__init__\n -> TraceService.store\n -> TraceService.open_context", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "TraceService.__init__:dataflow_slice", - "span_start": 42, - "span_end": 78, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "a6e13b9ebc4fed84586afd53ed92a4d14757e440873f572b2337d5622ee96031", - "edge_type": "dataflow_slice", - "src_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "src_qname": "TraceService.__init__", - "dst_symbol_id": "2da3d5b20a947bf63e14c103be4689b72fd837e0a82abd6c497846375d4c7426", - "dst_ref": "TraceService.open_context", - "resolution": "resolved", - "slice_id": "a6e13b9ebc4fed84586afd53ed92a4d14757e440873f572b2337d5622ee96031", - "root_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "path_symbols": [ - "TraceService.__init__", - "TraceService.store", - "TraceService.open_context" - ], - "path_symbol_ids": [ - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "2da3d5b20a947bf63e14c103be4689b72fd837e0a82abd6c497846375d4c7426" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "TraceService.__init__\n -> TraceService.transport\n -> TraceService.__init__", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "TraceService.__init__:dataflow_slice", - "span_start": 41, - "span_end": 43, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "1e923a93faa05c3c43ca9b19bd047007a8589ccce57d3cc1798ae7f9f200af98", - "edge_type": "dataflow_slice", - "src_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "src_qname": "TraceService.__init__", - "dst_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "dst_ref": "TraceService.__init__", - "resolution": "resolved", - "slice_id": "1e923a93faa05c3c43ca9b19bd047007a8589ccce57d3cc1798ae7f9f200af98", - "root_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "path_symbols": [ - "TraceService.__init__", - "TraceService.transport", - "TraceService.__init__" - ], - "path_symbol_ids": [ - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "TraceService.__init__\n -> TraceService.store\n -> TraceService.current_trace_id", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "TraceService.__init__:dataflow_slice", - "span_start": 42, - "span_end": 81, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "3ea17138634b1190bded77ddb84aa1595124f6519b246f24fc4b02bd62b5cac1", - "edge_type": "dataflow_slice", - "src_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "src_qname": "TraceService.__init__", - "dst_symbol_id": "41135180f7b3b9ab20e097e0747474e219c37dd2366ef08a7b43c1f3edb10b4c", - "dst_ref": "TraceService.current_trace_id", - "resolution": "resolved", - "slice_id": "3ea17138634b1190bded77ddb84aa1595124f6519b246f24fc4b02bd62b5cac1", - "root_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "path_symbols": [ - "TraceService.__init__", - "TraceService.store", - "TraceService.current_trace_id" - ], - "path_symbol_ids": [ - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "41135180f7b3b9ab20e097e0747474e219c37dd2366ef08a7b43c1f3edb10b4c" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "TraceService.__init__\n -> TraceService.store\n -> TraceService.step", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "TraceService.__init__:dataflow_slice", - "span_start": 42, - "span_end": 88, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "9f34c5da9b09fba99df6f6b1bde183a9aeb45111b8218a747c71590c2c9f60f2", - "edge_type": "dataflow_slice", - "src_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "src_qname": "TraceService.__init__", - "dst_symbol_id": "c44bfbc66cf747283f30088da3e011a10395031d41e77b74e523c24997f641ca", - "dst_ref": "TraceService.step", - "resolution": "resolved", - "slice_id": "9f34c5da9b09fba99df6f6b1bde183a9aeb45111b8218a747c71590c2c9f60f2", - "root_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "path_symbols": [ - "TraceService.__init__", - "TraceService.store", - "TraceService.step" - ], - "path_symbol_ids": [ - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "c44bfbc66cf747283f30088da3e011a10395031d41e77b74e523c24997f641ca" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "class TraceRecordWriter:\n def __init__(self, transport: TraceTransport) -> None:\n self._logger = logging.getLogger(__name__)\n self._transport = transport\n\n def write_context(self, record: TraceContextRecord) -> None:\n try:\n self._transport.write_context(record)\n except Exception:\n self._logger.exception(\"Trace transport failed to write context %s\", record.trace_id)\n\n def write_message(self, record: TraceLogMessage) -> None:\n try:\n self._transport.write_message(record)\n except Exception:\n self._logger.exception(\"Trace transport failed to write message for %s\", record.trace_id)", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/tracing/service.py:TraceRecordWriter", - "span_start": 21, - "span_end": 36, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.tracing.service", - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "class TraceService(TraceContextFactory):\n def __init__(self, transport: TraceTransport | None = None, store: TraceContextStore | None = None) -> None:\n self.transport = transport or NoOpTraceTransport()\n self.store = store or TraceContextStore()\n self._writer = TraceRecordWriter(self.transport)\n\n def create_context(\n self,\n *,\n alias: str,\n parent_id: str | None = None,\n kind: str | None = None,\n attrs: dict[str, Any] | None = None,\n ) -> str:\n record = TraceContextRecord(\n trace_id=uuid4().hex,\n alias=str(alias or \"\"),\n parent_id=parent_id,\n type=kind,\n event_time=utc_now(),\n attrs=dict(attrs or {}),\n )\n self.store.push(record)\n self._writer.write_context(record)\n return record.trace_id\n\n @contextmanager\n def open_context(\n self,\n *,\n alias: str,\n parent_id: str | None = None,\n kind: str | None = None,\n attrs: dict[str, Any] | None = None,\n ) -> Iterator[str]:\n trace_id = self.create_context(alias=alias, parent_id=parent_id, kind=kind, attrs=attrs)\n try:\n yield trace_id\n finally:\n self.store.pop()\n\n def current_trace_id(self) -> str | None:\n return self.store.current_trace_id()\n\n def close_context(self) -> str | None:\n previous = self.store.pop()\n return previous.record.trace_id if previous else None\n\n def step(self, name: str) -> None:\n self.store.set_step(str(name or \"\"))\n\n def info(self, message: str, *, status: str | None = None, attrs: dict[str, Any] | None = None) -> None:\n self._write_message(\"INFO\", message, status, attrs)\n\n def debug(self, message: str, *, status: str | None = None, attrs: dict[str, Any] | None = None) -> None:\n self._write_message(\"DEBUG\", message, status, attrs)\n\n def warning(self, message: str, *, status: str | None = None, attrs: dict[str, Any] | None = None) -> None:\n self._write_message(\"WARNING\", message, status, attrs)\n\n def error(self, message: str, *, status: str | None = None, attrs: dict[str, Any] | None = None) -> None:\n self._write_message(\"ERROR\", message, status, attrs)\n\n def exception(self, message: str, *, status: str = \"failed\", attrs: dict[str, Any] | None = None) -> None:\n self._write_message(\"ERROR\", message, status, attrs)\n\n def new_root(self, operation: str) -> TraceContext:\n trace_id = self.create_context(alias=operation, kind=\"operation\", attrs={\"operation\": operation})\n return TraceContext(trace_id=trace_id, span_id=trace_id, attributes={\"operation\": operation})\n\n def child_of(self, parent: TraceContext, operation: str) -> TraceContext:\n trace_id = self.create_context(\n alias=operation,\n parent_id=parent.trace_id,\n kind=\"worker\",\n attrs={\"operation\": operation},\n )\n return TraceContext(\n trace_id=trace_id,\n span_id=trace_id,\n parent_span_id=parent.span_id,\n attributes={\"operation\": operation},\n )\n\n def attach(self, metadata: dict[str, object], context: TraceContext) -> dict[str, object]:\n updated = dict(metadata)\n updated[\"trace_id\"] = context.trace_id\n updated[\"span_id\"] = context.span_id\n updated[\"parent_span_id\"] = context.parent_span_id\n return updated\n\n def resume(self, metadata: dict[str, object], operation: str) -> TraceContext:\n trace_id = str(metadata.get(\"trace_id\") or uuid4().hex)\n span_id = str(metadata.get(\"span_id\") or trace_id)\n parent_id = metadata.get(\"parent_span_id\")\n self.create_context(\n alias=operation,\n parent_id=str(parent_id) if parent_id else None,\n kind=\"worker\",\n attrs=dict(metadata),\n )\n return TraceContext(\n trace_id=trace_id,\n span_id=span_id,\n parent_span_id=str(parent_id) if parent_id else None,\n attributes={\"operation\": operation},\n )\n\n def _write_message(\n self,\n level: TraceLevel,\n message: str,\n status: str | None,\n attrs: dict[str, Any] | None,\n ) -> None:\n active = self.store.current()\n if active is None:\n raise RuntimeError(\"Trace context is not bound. Call create_context() first.\")\n record = TraceLogMessage(\n trace_id=active.record.trace_id,\n step=active.step,\n status=str(status or \"\"),\n message=str(message or \"\"),\n level=level,\n event_time=utc_now(),\n attrs=dict(attrs or {}),\n )\n self._writer.write_message(record)", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/tracing/service.py:TraceService", - "span_start": 39, - "span_end": 166, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 1, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.tracing.service", - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "class TraceManager(TraceService):\n \"\"\"Compatibility alias during the transition from ConfigManager-shaped naming.\"\"\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/tracing/service.py:TraceManager", - "span_start": 169, - "span_end": 170, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 2, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.tracing.service", - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "llm_answer": "Класс `TraceService` в файле `src/app_runtime/tracing/service.py` является компонентом, ответственным за управление контекстами трассировки и взаимодействие с транспортом для записи данных о трассировке.\nКлючевые аспекты класса:\n\n1. Инициализация (`__init__()`):\n - Конструктор принимает два параметра: транспорт для записи трассировочных данных (`transport`) и хранилище контекста трассировки (`store`).\n - По умолчанию используются заглушка транспорта (`NoOpTraceTransport()`) и хранилище по умолчанию (`TraceContextStore()`).\n - Создаётся объект записи записей трассировки через `TraceRecordWriter`.\n\n2. Создание контекста трассировки (`create_context()`):\n - Метод создаёт новый контекст трассировки, используя UUID для уникального идентификатора трассировки.\n - Записывает контекст в хранилище и отправляет запись в транспорт через метод записи контекста (`write_context()`).\n - Возвращает уникальный идентификатор созданной трассировки.\n\n3. Временная область видимости контекста трассировки (`open_context()`):\n - Контекст создаётся при входе в блок, а затем автоматически удаляется после выхода из блока.\n - Используется генератор контекста для автоматического управления жизненным циклом трассировки.\nКосвенные выводы:\n- Класс предназначен для участия в конвейере обработки данных (pipeline stage), судя по аннотации ролей (`role: pipeline_stage`).\n- Предполагается участие в потоках данных (\"dataflow slices\"), хотя конкретный механизм этого не указан напрямую.\n\nЭтот компонент играет важную роль в управлении и записи информации о трассировке приложения, обеспечивая унифицированный интерфейс для создания и управления контекстами трассировок.", - "summary": { - "router": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "confidence": null - }, - "retrieval": { - "profile": "code", - "layers_hit": [ - "C0_SOURCE_CHUNKS", - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS", - "C4_SEMANTIC_ROLES" - ], - "evidence_sufficient": true - }, - "llm": { - "answer_status": "answered", - "groundedness": "grounded" - } - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "TraceService" - ], - "keyword_hints": [ - "TraceService" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C0_SOURCE_CHUNKS": "exact_path_fetch", - "C4_SEMANTIC_ROLES": "exact_path_fetch", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C3_ENTRYPOINTS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 8, - "C4_SEMANTIC_ROLES": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C3_ENTRYPOINTS": 6 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C4_SEMANTIC_ROLES": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "TraceService", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "TraceService", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C4_SEMANTIC_ROLES", - "query": "TraceService", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "TraceService", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - }, - { - "layer": "C3_ENTRYPOINTS", - "query": "TraceService", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 1, - "candidates_after_filter": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 6, - "candidates_after_filter": 6 - }, - { - "layer": "C3_ENTRYPOINTS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 3, - "candidates_after_filter": 3 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "TraceService", - "alternatives": [ - "TraceService" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 3, - "fail_reason": null - }, - { - "layer": "C4_SEMANTIC_ROLES", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 6, - "fail_reason": null - }, - { - "layer": "C3_ENTRYPOINTS", - "status": "hit", - "hit_count": 3, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "router": 0, - "symbol_resolution": 0, - "retrieval_total": 174, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 51, - "C0_SOURCE_CHUNKS": 24, - "C4_SEMANTIC_ROLES": 21, - "C2_DEPENDENCY_GRAPH": 57, - "C3_ENTRYPOINTS": 18 - }, - "merge_rank": 34, - "prompt_build": 0, - "llm_call": 3070 - }, - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 1055, - "evidence_rows": 14, - "evidence_chars": 6323 - }, - "evidence_summary": [ - { - "layer": "C1_SYMBOL_CATALOG", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "count": 6, - "unique_paths": 1 - }, - { - "layer": "C3_ENTRYPOINTS", - "count": 3, - "unique_paths": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 3, - "unique_paths": 1 - } - ], - "prompt_template_id": "intent_code_qa_explain_ru_v4", - "system_prompt_version": "v1" - }, - "router": { - "conversation_mode": "START", - "keyword_hints": [ - "TraceService" - ], - "path_scope": [] - }, - "llm": { - "used_evidence_count": 14, - "missing_evidence_reason": null - } - }, - "run_info": { - "case_id": "plba-v2-explain-trace-service", - "mode": "full_chain", - "run_started_at": "2026-03-12T14:38:57", - "rag_session_id": "7d11da21-faa0-4cea-aede-aeabe069164c", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - }, - "input_request": { - "text": "Объясни как работает класс TraceService", - "normalized_query": "Объясни как работает класс TraceService" - }, - "steps": [ - { - "step": "intent_router", - "input": { - "query": "Объясни как работает класс TraceService" - }, - "output": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Объясни как работает класс TraceService" - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "TraceService" - ], - "keyword_hints": [ - "TraceService" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "timings_ms": { - "router": 0 - } - } - }, - { - "step": "retrieval", - "input": { - "query": "Объясни как работает класс TraceService" - }, - "output": { - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "TraceService", - "alternatives": [ - "TraceService" - ], - "confidence": 0.99 - }, - "rag_count": 14, - "rag_rows": [ - { - "path": "src/app_runtime/tracing/service.py", - "content": "class TraceService\nTraceService(TraceContextFactory)", - "layer": "C1_SYMBOL_CATALOG", - "title": "TraceService", - "span_start": 39, - "span_end": 166, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "c2b2b976d99f2c600000b753731b26e0a69adcb4359398b93073590c5d5d04f4", - "qname": "TraceService", - "kind": "class", - "signature": "TraceService(TraceContextFactory)", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.tracing.service", - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "TraceService\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests service\n- reads and writes state attributes\n- participates in dataflow slices (13)", - "layer": "C4_SEMANTIC_ROLES", - "title": "TraceService", - "span_start": 39, - "span_end": 166, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 60, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "c2b2b976d99f2c600000b753731b26e0a69adcb4359398b93073590c5d5d04f4", - "symbol_name": "TraceService", - "qname": "TraceService", - "role": "pipeline_stage", - "confidence": 0.57, - "dataflow_participation": 13, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "TraceService.__init__\n -> TraceService.store\n -> TraceService.create_context", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "TraceService.__init__:dataflow_slice", - "span_start": 42, - "span_end": 61, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "3b052062067a78aef3302ee1d996897e02a67d1b340397bea4f59fe147c0492a", - "edge_type": "dataflow_slice", - "src_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "src_qname": "TraceService.__init__", - "dst_symbol_id": "ff44881104b65ef50ee6fe16d367d4a81b6e7eb5c44c0963cf4543faec785d4a", - "dst_ref": "TraceService.create_context", - "resolution": "resolved", - "slice_id": "3b052062067a78aef3302ee1d996897e02a67d1b340397bea4f59fe147c0492a", - "root_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "path_symbols": [ - "TraceService.__init__", - "TraceService.store", - "TraceService.create_context" - ], - "path_symbol_ids": [ - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "ff44881104b65ef50ee6fe16d367d4a81b6e7eb5c44c0963cf4543faec785d4a" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "TraceService.__init__\n -> TraceService.store\n -> TraceService.close_context", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "TraceService.__init__:dataflow_slice", - "span_start": 42, - "span_end": 84, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "7a9353ef57c9ae5d19b3a0c6ac50fad05e6d21d31bbe1cd1cd07af6332ba6505", - "edge_type": "dataflow_slice", - "src_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "src_qname": "TraceService.__init__", - "dst_symbol_id": "01e14158dcced7e52d0c8ac84ac7b9a75225c261b6aca6a1d7da802d0994721c", - "dst_ref": "TraceService.close_context", - "resolution": "resolved", - "slice_id": "7a9353ef57c9ae5d19b3a0c6ac50fad05e6d21d31bbe1cd1cd07af6332ba6505", - "root_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "path_symbols": [ - "TraceService.__init__", - "TraceService.store", - "TraceService.close_context" - ], - "path_symbol_ids": [ - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "01e14158dcced7e52d0c8ac84ac7b9a75225c261b6aca6a1d7da802d0994721c" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "TraceService.__init__\n -> TraceService.store\n -> TraceService.open_context", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "TraceService.__init__:dataflow_slice", - "span_start": 42, - "span_end": 78, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "a6e13b9ebc4fed84586afd53ed92a4d14757e440873f572b2337d5622ee96031", - "edge_type": "dataflow_slice", - "src_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "src_qname": "TraceService.__init__", - "dst_symbol_id": "2da3d5b20a947bf63e14c103be4689b72fd837e0a82abd6c497846375d4c7426", - "dst_ref": "TraceService.open_context", - "resolution": "resolved", - "slice_id": "a6e13b9ebc4fed84586afd53ed92a4d14757e440873f572b2337d5622ee96031", - "root_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "path_symbols": [ - "TraceService.__init__", - "TraceService.store", - "TraceService.open_context" - ], - "path_symbol_ids": [ - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "2da3d5b20a947bf63e14c103be4689b72fd837e0a82abd6c497846375d4c7426" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "TraceService.__init__\n -> TraceService.transport\n -> TraceService.__init__", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "TraceService.__init__:dataflow_slice", - "span_start": 41, - "span_end": 43, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "1e923a93faa05c3c43ca9b19bd047007a8589ccce57d3cc1798ae7f9f200af98", - "edge_type": "dataflow_slice", - "src_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "src_qname": "TraceService.__init__", - "dst_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "dst_ref": "TraceService.__init__", - "resolution": "resolved", - "slice_id": "1e923a93faa05c3c43ca9b19bd047007a8589ccce57d3cc1798ae7f9f200af98", - "root_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "path_symbols": [ - "TraceService.__init__", - "TraceService.transport", - "TraceService.__init__" - ], - "path_symbol_ids": [ - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "TraceService.__init__\n -> TraceService.store\n -> TraceService.current_trace_id", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "TraceService.__init__:dataflow_slice", - "span_start": 42, - "span_end": 81, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "3ea17138634b1190bded77ddb84aa1595124f6519b246f24fc4b02bd62b5cac1", - "edge_type": "dataflow_slice", - "src_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "src_qname": "TraceService.__init__", - "dst_symbol_id": "41135180f7b3b9ab20e097e0747474e219c37dd2366ef08a7b43c1f3edb10b4c", - "dst_ref": "TraceService.current_trace_id", - "resolution": "resolved", - "slice_id": "3ea17138634b1190bded77ddb84aa1595124f6519b246f24fc4b02bd62b5cac1", - "root_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "path_symbols": [ - "TraceService.__init__", - "TraceService.store", - "TraceService.current_trace_id" - ], - "path_symbol_ids": [ - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "41135180f7b3b9ab20e097e0747474e219c37dd2366ef08a7b43c1f3edb10b4c" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "TraceService.__init__\n -> TraceService.store\n -> TraceService.step", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "TraceService.__init__:dataflow_slice", - "span_start": 42, - "span_end": 88, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "9f34c5da9b09fba99df6f6b1bde183a9aeb45111b8218a747c71590c2c9f60f2", - "edge_type": "dataflow_slice", - "src_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "src_qname": "TraceService.__init__", - "dst_symbol_id": "c44bfbc66cf747283f30088da3e011a10395031d41e77b74e523c24997f641ca", - "dst_ref": "TraceService.step", - "resolution": "resolved", - "slice_id": "9f34c5da9b09fba99df6f6b1bde183a9aeb45111b8218a747c71590c2c9f60f2", - "root_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "path_symbols": [ - "TraceService.__init__", - "TraceService.store", - "TraceService.step" - ], - "path_symbol_ids": [ - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "c44bfbc66cf747283f30088da3e011a10395031d41e77b74e523c24997f641ca" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "class TraceRecordWriter:\n def __init__(self, transport: TraceTransport) -> None:\n self._logger = logging.getLogger(__name__)\n self._transport = transport\n\n def write_context(self, record: TraceContextRecord) -> None:\n try:\n self._transport.write_context(record)\n except Exception:\n self._logger.exception(\"Trace transport failed to write context %s\", record.trace_id)\n\n def write_message(self, record: TraceLogMessage) -> None:\n try:\n self._transport.write_message(record)\n except Exception:\n self._logger.exception(\"Trace transport failed to write message for %s\", record.trace_id)", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/tracing/service.py:TraceRecordWriter", - "span_start": 21, - "span_end": 36, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.tracing.service", - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "class TraceService(TraceContextFactory):\n def __init__(self, transport: TraceTransport | None = None, store: TraceContextStore | None = None) -> None:\n self.transport = transport or NoOpTraceTransport()\n self.store = store or TraceContextStore()\n self._writer = TraceRecordWriter(self.transport)\n\n def create_context(\n self,\n *,\n alias: str,\n parent_id: str | None = None,\n kind: str | None = None,\n attrs: dict[str, Any] | None = None,\n ) -> str:\n record = TraceContextRecord(\n trace_id=uuid4().hex,\n alias=str(alias or \"\"),\n parent_id=parent_id,\n type=kind,\n event_time=utc_now(),\n attrs=dict(attrs or {}),\n )\n self.store.push(record)\n self._writer.write_context(record)\n return record.trace_id\n\n @contextmanager\n def open_context(\n self,\n *,\n alias: str,\n parent_id: str | None = None,\n kind: str | None = None,\n attrs: dict[str, Any] | None = None,\n ) -> Iterator[str]:\n trace_id = self.create_context(alias=alias, parent_id=parent_id, kind=kind, attrs=attrs)\n try:\n yield trace_id\n finally:\n self.store.pop()\n\n def current_trace_id(self) -> str | None:\n return self.store.current_trace_id()\n\n def close_context(self) -> str | None:\n previous = self.store.pop()\n return previous.record.trace_id if previous else None\n\n def step(self, name: str) -> None:\n self.store.set_step(str(name or \"\"))\n\n def info(self, message: str, *, status: str | None = None, attrs: dict[str, Any] | None = None) -> None:\n self._write_message(\"INFO\", message, status, attrs)\n\n def debug(self, message: str, *, status: str | None = None, attrs: dict[str, Any] | None = None) -> None:\n self._write_message(\"DEBUG\", message, status, attrs)\n\n def warning(self, message: str, *, status: str | None = None, attrs: dict[str, Any] | None = None) -> None:\n self._write_message(\"WARNING\", message, status, attrs)\n\n def error(self, message: str, *, status: str | None = None, attrs: dict[str, Any] | None = None) -> None:\n self._write_message(\"ERROR\", message, status, attrs)\n\n def exception(self, message: str, *, status: str = \"failed\", attrs: dict[str, Any] | None = None) -> None:\n self._write_message(\"ERROR\", message, status, attrs)\n\n def new_root(self, operation: str) -> TraceContext:\n trace_id = self.create_context(alias=operation, kind=\"operation\", attrs={\"operation\": operation})\n return TraceContext(trace_id=trace_id, span_id=trace_id, attributes={\"operation\": operation})\n\n def child_of(self, parent: TraceContext, operation: str) -> TraceContext:\n trace_id = self.create_context(\n alias=operation,\n parent_id=parent.trace_id,\n kind=\"worker\",\n attrs={\"operation\": operation},\n )\n return TraceContext(\n trace_id=trace_id,\n span_id=trace_id,\n parent_span_id=parent.span_id,\n attributes={\"operation\": operation},\n )\n\n def attach(self, metadata: dict[str, object], context: TraceContext) -> dict[str, object]:\n updated = dict(metadata)\n updated[\"trace_id\"] = context.trace_id\n updated[\"span_id\"] = context.span_id\n updated[\"parent_span_id\"] = context.parent_span_id\n return updated\n\n def resume(self, metadata: dict[str, object], operation: str) -> TraceContext:\n trace_id = str(metadata.get(\"trace_id\") or uuid4().hex)\n span_id = str(metadata.get(\"span_id\") or trace_id)\n parent_id = metadata.get(\"parent_span_id\")\n self.create_context(\n alias=operation,\n parent_id=str(parent_id) if parent_id else None,\n kind=\"worker\",\n attrs=dict(metadata),\n )\n return TraceContext(\n trace_id=trace_id,\n span_id=span_id,\n parent_span_id=str(parent_id) if parent_id else None,\n attributes={\"operation\": operation},\n )\n\n def _write_message(\n self,\n level: TraceLevel,\n message: str,\n status: str | None,\n attrs: dict[str, Any] | None,\n ) -> None:\n active = self.store.current()\n if active is None:\n raise RuntimeError(\"Trace context is not bound. Call create_context() first.\")\n record = TraceLogMessage(\n trace_id=active.record.trace_id,\n step=active.step,\n status=str(status or \"\"),\n message=str(message or \"\"),\n level=level,\n event_time=utc_now(),\n attrs=dict(attrs or {}),\n )\n self._writer.write_message(record)", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/tracing/service.py:TraceService", - "span_start": 39, - "span_end": 166, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 1, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.tracing.service", - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "class TraceManager(TraceService):\n \"\"\"Compatibility alias during the transition from ConfigManager-shaped naming.\"\"\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/tracing/service.py:TraceManager", - "span_start": 169, - "span_end": 170, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 2, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.tracing.service", - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ] - }, - "diagnostics": { - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C0_SOURCE_CHUNKS": "exact_path_fetch", - "C4_SEMANTIC_ROLES": "exact_path_fetch", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C3_ENTRYPOINTS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 8, - "C4_SEMANTIC_ROLES": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C3_ENTRYPOINTS": 6 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C4_SEMANTIC_ROLES": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "TraceService", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "TraceService", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C4_SEMANTIC_ROLES", - "query": "TraceService", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "TraceService", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - }, - { - "layer": "C3_ENTRYPOINTS", - "query": "TraceService", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 1, - "candidates_after_filter": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 6, - "candidates_after_filter": 6 - }, - { - "layer": "C3_ENTRYPOINTS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 3, - "candidates_after_filter": 3 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "TraceService", - "alternatives": [ - "TraceService" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 3, - "fail_reason": null - }, - { - "layer": "C4_SEMANTIC_ROLES", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 6, - "fail_reason": null - }, - { - "layer": "C3_ENTRYPOINTS", - "status": "hit", - "hit_count": 3, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "symbol_resolution": 0, - "retrieval_total": 174, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 51, - "C0_SOURCE_CHUNKS": 24, - "C4_SEMANTIC_ROLES": 21, - "C2_DEPENDENCY_GRAPH": 57, - "C3_ENTRYPOINTS": 18 - }, - "merge_rank": 34 - } - } - }, - { - "step": "llm_answer", - "input": { - "query": "Объясни как работает класс TraceService", - "rag_count": 14 - }, - "output": { - "llm_answer": "Класс `TraceService` в файле `src/app_runtime/tracing/service.py` является компонентом, ответственным за управление контекстами трассировки и взаимодействие с транспортом для записи данных о трассировке.\nКлючевые аспекты класса:\n\n1. Инициализация (`__init__()`):\n - Конструктор принимает два параметра: транспорт для записи трассировочных данных (`transport`) и хранилище контекста трассировки (`store`).\n - По умолчанию используются заглушка транспорта (`NoOpTraceTransport()`) и хранилище по умолчанию (`TraceContextStore()`).\n - Создаётся объект записи записей трассировки через `TraceRecordWriter`.\n\n2. Создание контекста трассировки (`create_context()`):\n - Метод создаёт новый контекст трассировки, используя UUID для уникального идентификатора трассировки.\n - Записывает контекст в хранилище и отправляет запись в транспорт через метод записи контекста (`write_context()`).\n - Возвращает уникальный идентификатор созданной трассировки.\n\n3. Временная область видимости контекста трассировки (`open_context()`):\n - Контекст создаётся при входе в блок, а затем автоматически удаляется после выхода из блока.\n - Используется генератор контекста для автоматического управления жизненным циклом трассировки.\nКосвенные выводы:\n- Класс предназначен для участия в конвейере обработки данных (pipeline stage), судя по аннотации ролей (`role: pipeline_stage`).\n- Предполагается участие в потоках данных (\"dataflow slices\"), хотя конкретный механизм этого не указан напрямую.\n\nЭтот компонент играет важную роль в управлении и записи информации о трассировке приложения, обеспечивая унифицированный интерфейс для создания и управления контекстами трассировок." - }, - "diagnostics": { - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 1055, - "evidence_rows": 14, - "evidence_chars": 6323 - }, - "evidence_summary": [ - { - "layer": "C1_SYMBOL_CATALOG", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "count": 6, - "unique_paths": 1 - }, - { - "layer": "C3_ENTRYPOINTS", - "count": 3, - "unique_paths": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 3, - "unique_paths": 1 - } - ], - "prompt_template_id": "intent_code_qa_explain_ru_v4", - "system_prompt_version": "v1" - }, - "timings_ms": { - "prompt_build": 0, - "llm_call": 3070 - } - } - } - ] - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_143856/full_chain_plba_code_subintents_v2_plba-v2-explain-trace-service.md b/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_143856/full_chain_plba_code_subintents_v2_plba-v2-explain-trace-service.md deleted file mode 100644 index 550216d..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_143856/full_chain_plba_code_subintents_v2_plba-v2-explain-trace-service.md +++ /dev/null @@ -1,34 +0,0 @@ -# plba-v2-explain-trace-service - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_subintents_v2.yaml -- runner: runtime -- mode: full_chain -- passed: True - -## Query -Объясни как работает класс TraceService - -## Actual -{ - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 14, - "llm_answer": "Класс `TraceService` в файле `src/app_runtime/tracing/service.py` является компонентом, ответственным за управление контекстами трассировки и взаимодействие с транспортом для записи данных о трассировке.\nКлючевые аспекты класса:\n\n1. Инициализация (`__init__()`):\n - Конструктор принимает два параметра: транспорт для записи трассировочных данных (`transport`) и хранилище контекста трассировки (`store`).\n - По умолчанию используются заглушка транспорта (`NoOpTraceTransport()`) и хранилище по умолчанию (`TraceContextStore()`).\n - Создаётся объект записи записей трассировки через `TraceRecordWriter`.\n\n2. Создание контекста трассировки (`create_context()`):\n - Метод создаёт новый контекст трассировки, используя UUID для уникального идентификатора трассировки.\n - Записывает контекст в хранилище и отправляет запись в транспорт через метод записи контекста (`write_context()`).\n - Возвращает уникальный идентификатор созданной трассировки.\n\n3. Временная область видимости контекста трассировки (`open_context()`):\n - Контекст создаётся при входе в блок, а затем автоматически удаляется после выхода из блока.\n - Используется генератор контекста для автоматического управления жизненным циклом трассировки.\nКосвенные выводы:\n- Класс предназначен для участия в конвейере обработки данных (pipeline stage), судя по аннотации ролей (`role: pipeline_stage`).\n- Предполагается участие в потоках данных (\"dataflow slices\"), хотя конкретный механизм этого не указан напрямую.\n\nЭтот компонент играет важную роль в управлении и записи информации о трассировке приложения, обеспечивая унифицированный интерфейс для создания и управления контекстами трассировок.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "TraceService" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] -} - -## Mismatches -- none \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_143856/full_chain_plba_code_subintents_v2_plba-v2-find-entrypoints-control-plane.json b/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_143856/full_chain_plba_code_subintents_v2_plba-v2-find-entrypoints-control-plane.json deleted file mode 100644 index 81a07e0..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_143856/full_chain_plba_code_subintents_v2_plba-v2-find-entrypoints-control-plane.json +++ /dev/null @@ -1,1236 +0,0 @@ -{ - "case_id": "plba-v2-find-entrypoints-control-plane", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_subintents_v2.yaml", - "runner": "runtime", - "mode": "full_chain", - "actual": { - "intent": "CODE_QA", - "sub_intent": "FIND_ENTRYPOINTS", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 9, - "llm_answer": "В системе обнаружены следующие подтвержденные точки входа HTTP control plane:\n\n1.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "HTTP", - "control", - "plane" - ], - "layers": [ - "C3_ENTRYPOINTS", - "C0_SOURCE_CHUNKS" - ] - }, - "passed": true, - "mismatches": [], - "details": { - "case_id": "plba-v2-find-entrypoints-control-plane", - "text": "Найди точки входа HTTP control plane", - "mode": "full_chain", - "run_started_at": "2026-03-12T14:38:57", - "rag_session_id": "7d11da21-faa0-4cea-aede-aeabe069164c", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Найди точки входа HTTP control plane", - "symbol_resolution": { - "status": "not_found", - "resolved_symbol": null, - "alternatives": [ - "HTTP", - "control", - "plane" - ], - "confidence": 0.0 - }, - "rag_count": 9, - "rag_rows": [ - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "class HttpControlChannel(ControlChannel):\n def __init__(self, host: str, port: int, timeout: int) -> None:\n self._timeout = timeout\n self._runner = UvicornThreadRunner(host, port, timeout)\n self._factory = HttpControlAppFactory()\n self._actions: ControlActionSet | None = None\n\n async def start(self, actions: ControlActionSet) -> None:\n self._actions = actions\n app = self._factory.create(self._health_response, self._action_response)\n await self._runner.start(app)\n\n async def stop(self) -> None:\n await self._runner.stop()\n\n @property\n def port(self) -> int:\n return self._runner.port\n\n async def _health_response(self) -> dict[str, object]:\n if self._actions is None:\n return {\"status\": \"unhealthy\", \"detail\": \"control actions are not configured\"}\n return await asyncio.wait_for(self._actions.health(), timeout=float(self._timeout))\n\n async def _action_response(self, action: str, _client_source: str = \"unknown\") -> JSONResponse:\n if self._actions is None:\n return JSONResponse(content={\"status\": \"error\", \"detail\": f\"{action} handler is not configured\"}, status_code=404)\n callbacks = {\n \"start\": self._actions.start,\n \"stop\": self._actions.stop,\n \"status\": self._actions.status,\n }\n callback = callbacks.get(action)\n if callback is None:\n return JSONResponse(content={\"status\": \"error\", \"detail\": f\"unsupported action: {action}\"}, status_code=404)\n action_timeout = max(float(self._timeout), 10.0) if action in {\"start\", \"stop\"} else float(self._timeout)\n try:\n detail = await asyncio.wait_for(callback(), timeout=action_timeout)\n except asyncio.TimeoutError:\n return JSONResponse(\n content={\"status\": \"accepted\", \"detail\": f\"{action} operation is still in progress\"},\n status_code=202,\n )\n except Exception as exc:\n return JSONResponse(content={\"status\": \"error\", \"detail\": str(exc)}, status_code=500)\n return JSONResponse(content={\"status\": \"ok\", \"detail\": detail or f\"{action} action accepted\"}, status_code=200)", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/http_channel.py:HttpControlChannel", - "span_start": 12, - "span_end": 57, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.http_channel", - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "class HttpControlAppFactory:\n def create(\n self,\n health_provider: Callable[[], Awaitable[HealthPayload]],\n action_provider: Callable[[str, str], Awaitable[JSONResponse]],\n ) -> FastAPI:\n app = FastAPI(title=\"PLBA Control API\")\n\n @app.middleware(\"http\")\n async def log_api_call(request: Request, call_next): # type: ignore[no-untyped-def]\n started = time.monotonic()\n response = await call_next(request)\n response.headers[\"X-Response-Time-Ms\"] = str(int((time.monotonic() - started) * 1000))\n return response\n\n @app.get(\"/health\")\n async def health() -> JSONResponse:\n payload = await health_provider()\n status_code = 200 if payload.get(\"status\") == \"ok\" else 503\n return JSONResponse(content=payload, status_code=status_code)\n\n @app.get(\"/actions/{action}\")\n @app.post(\"/actions/{action}\")\n async def action(action: str, request: Request) -> JSONResponse:\n client_source = self._client_source(request)\n if action in {\"start\", \"stop\"}:\n LOGGER.warning(\"Control action requested: /actions/%s client=%s\", action, client_source)\n return await action_provider(action, client_source)\n\n return app\n\n def _client_source(self, request: Request) -> str:\n explicit_header = request.headers.get(\"X-Client-Source\", \"\").strip()\n if explicit_header:\n return explicit_header\n user_agent = request.headers.get(\"User-Agent\", \"\").strip()\n if user_agent:\n return f\"user-agent:{user_agent}\"\n return \"unknown\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/http_app.py:HttpControlAppFactory", - "span_start": 15, - "span_end": 53, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.http_app", - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "class ControlActionSet:\n health: HealthHandler\n start: ActionHandler\n stop: ActionHandler\n status: ActionHandler", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/base.py:ControlActionSet", - "span_start": 14, - "span_end": 18, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.base", - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/__init__.py", - "content": "from app_runtime.control.base import ControlActionSet, ControlChannel\nfrom app_runtime.control.http_channel import HttpControlChannel\nfrom app_runtime.control.service import ControlPlaneService\n\n__all__ = [\"ControlActionSet\", \"ControlChannel\", \"ControlPlaneService\", \"HttpControlChannel\"]", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/__init__.py:1-5", - "span_start": 1, - "span_end": 5, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.app_runtime.control.__init__", - "is_test": false, - "blob_sha": "bf3c37e3369a84cc618adc0fd71c232e5eb4b871eaff743069a17e661e498316", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "class ControlChannel(ABC):\n @abstractmethod\n async def start(self, actions: ControlActionSet) -> None:\n \"\"\"Start the control channel and bind handlers.\"\"\"\n\n @abstractmethod\n async def stop(self) -> None:\n \"\"\"Stop the control channel and release resources.\"\"\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/base.py:ControlChannel", - "span_start": 21, - "span_end": 28, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 1, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.base", - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_runner.py", - "content": "class UvicornThreadRunner:\n def __init__(self, host: str, port: int, timeout: int) -> None:\n self._host = host\n self._port = port\n self._timeout = timeout\n self._server: Server | None = None\n self._thread: Thread | None = None\n self._error: BaseException | None = None\n\n async def start(self, app: FastAPI) -> None:\n if self._thread is not None and self._thread.is_alive():\n return\n self._error = None\n config = Config(app=app, host=self._host, port=self._port, log_level=\"warning\")\n self._server = Server(config)\n self._thread = Thread(target=self._serve, name=\"plba-http-control\", daemon=True)\n self._thread.start()\n await self._wait_until_started()\n\n async def stop(self) -> None:\n if self._server is None or self._thread is None:\n return\n self._server.should_exit = True\n await asyncio.to_thread(self._thread.join, self._timeout)\n self._server = None\n self._thread = None\n\n @property\n def port(self) -> int:\n if self._server is None or not getattr(self._server, \"servers\", None):\n return self._port\n socket = self._server.servers[0].sockets[0]\n return int(socket.getsockname()[1])\n\n async def _wait_until_started(self) -> None:\n if self._server is None:\n raise RuntimeError(\"Server is not initialized\")\n deadline = asyncio.get_running_loop().time() + max(float(self._timeout), 1.0)\n while not self._server.started:\n if self._error is not None:\n raise RuntimeError(\"HTTP control server failed to start\") from self._error\n if asyncio.get_running_loop().time() >= deadline:\n raise TimeoutError(\"HTTP control server startup timed out\")\n await asyncio.sleep(0.05)\n\n def _serve(self) -> None:\n if self._server is None:\n return\n try:\n asyncio.run(self._server.serve())\n except BaseException as exc: # noqa: BLE001\n self._error = exc", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/http_runner.py:UvicornThreadRunner", - "span_start": 10, - "span_end": 61, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.http_runner", - "is_test": false, - "blob_sha": "3779fdd2878b770e789a35bb2a89c9d79f13b61c26d7db1b3b683f9bb9e1623f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "llm_answer": "В системе обнаружены следующие подтвержденные точки входа HTTP control plane:\n\n1.", - "summary": { - "router": { - "intent": "CODE_QA", - "sub_intent": "FIND_ENTRYPOINTS", - "confidence": null - }, - "retrieval": { - "profile": "code", - "layers_hit": [ - "C0_SOURCE_CHUNKS", - "C3_ENTRYPOINTS" - ], - "evidence_sufficient": true - }, - "llm": { - "answer_status": "answered", - "groundedness": "grounded" - } - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "FIND_ENTRYPOINTS", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C3_ENTRYPOINTS", - "C0_SOURCE_CHUNKS" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "HTTP", - "control", - "plane" - ], - "keyword_hints": [ - "HTTP", - "control", - "plane" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "execution": { - "executed_layers": [ - "C3_ENTRYPOINTS", - "C0_SOURCE_CHUNKS" - ], - "retrieval_mode_by_layer": { - "C3_ENTRYPOINTS": "exact_path_fetch", - "C0_SOURCE_CHUNKS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C3_ENTRYPOINTS": 12, - "C0_SOURCE_CHUNKS": 6 - }, - "filters_by_layer": { - "C3_ENTRYPOINTS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C3_ENTRYPOINTS", - "query": "Найди точки входа HTTP control plane", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 12, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Найди точки входа HTTP control plane", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C3_ENTRYPOINTS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 3, - "candidates_after_filter": 3 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 6, - "candidates_after_filter": 6 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "not_found", - "resolved_symbol": null, - "alternatives": [ - "HTTP", - "control", - "plane" - ] - }, - "layers": [ - { - "layer": "C3_ENTRYPOINTS", - "status": "hit", - "hit_count": 3, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 6, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "router": 1, - "symbol_resolution": 0, - "retrieval_total": 53, - "retrieval_by_layer": { - "C3_ENTRYPOINTS": 34, - "C0_SOURCE_CHUNKS": 19 - }, - "merge_rank": 0, - "prompt_build": 0, - "llm_call": 1472 - }, - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 1195, - "evidence_rows": 9, - "evidence_chars": 6731 - }, - "evidence_summary": [ - { - "layer": "C3_ENTRYPOINTS", - "count": 3, - "unique_paths": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 6, - "unique_paths": 5 - } - ], - "prompt_template_id": "intent_code_qa_find_entrypoints_ru_v4", - "system_prompt_version": "v1" - }, - "router": { - "conversation_mode": "START", - "keyword_hints": [ - "HTTP", - "control", - "plane" - ], - "path_scope": [] - }, - "llm": { - "used_evidence_count": 9, - "missing_evidence_reason": null - } - }, - "run_info": { - "case_id": "plba-v2-find-entrypoints-control-plane", - "mode": "full_chain", - "run_started_at": "2026-03-12T14:38:57", - "rag_session_id": "7d11da21-faa0-4cea-aede-aeabe069164c", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - }, - "input_request": { - "text": "Найди точки входа HTTP control plane", - "normalized_query": "Найди точки входа HTTP control plane" - }, - "steps": [ - { - "step": "intent_router", - "input": { - "query": "Найди точки входа HTTP control plane" - }, - "output": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Найди точки входа HTTP control plane" - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "FIND_ENTRYPOINTS", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C3_ENTRYPOINTS", - "C0_SOURCE_CHUNKS" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "HTTP", - "control", - "plane" - ], - "keyword_hints": [ - "HTTP", - "control", - "plane" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "timings_ms": { - "router": 1 - } - } - }, - { - "step": "retrieval", - "input": { - "query": "Найди точки входа HTTP control plane" - }, - "output": { - "symbol_resolution": { - "status": "not_found", - "resolved_symbol": null, - "alternatives": [ - "HTTP", - "control", - "plane" - ], - "confidence": 0.0 - }, - "rag_count": 9, - "rag_rows": [ - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "class HttpControlChannel(ControlChannel):\n def __init__(self, host: str, port: int, timeout: int) -> None:\n self._timeout = timeout\n self._runner = UvicornThreadRunner(host, port, timeout)\n self._factory = HttpControlAppFactory()\n self._actions: ControlActionSet | None = None\n\n async def start(self, actions: ControlActionSet) -> None:\n self._actions = actions\n app = self._factory.create(self._health_response, self._action_response)\n await self._runner.start(app)\n\n async def stop(self) -> None:\n await self._runner.stop()\n\n @property\n def port(self) -> int:\n return self._runner.port\n\n async def _health_response(self) -> dict[str, object]:\n if self._actions is None:\n return {\"status\": \"unhealthy\", \"detail\": \"control actions are not configured\"}\n return await asyncio.wait_for(self._actions.health(), timeout=float(self._timeout))\n\n async def _action_response(self, action: str, _client_source: str = \"unknown\") -> JSONResponse:\n if self._actions is None:\n return JSONResponse(content={\"status\": \"error\", \"detail\": f\"{action} handler is not configured\"}, status_code=404)\n callbacks = {\n \"start\": self._actions.start,\n \"stop\": self._actions.stop,\n \"status\": self._actions.status,\n }\n callback = callbacks.get(action)\n if callback is None:\n return JSONResponse(content={\"status\": \"error\", \"detail\": f\"unsupported action: {action}\"}, status_code=404)\n action_timeout = max(float(self._timeout), 10.0) if action in {\"start\", \"stop\"} else float(self._timeout)\n try:\n detail = await asyncio.wait_for(callback(), timeout=action_timeout)\n except asyncio.TimeoutError:\n return JSONResponse(\n content={\"status\": \"accepted\", \"detail\": f\"{action} operation is still in progress\"},\n status_code=202,\n )\n except Exception as exc:\n return JSONResponse(content={\"status\": \"error\", \"detail\": str(exc)}, status_code=500)\n return JSONResponse(content={\"status\": \"ok\", \"detail\": detail or f\"{action} action accepted\"}, status_code=200)", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/http_channel.py:HttpControlChannel", - "span_start": 12, - "span_end": 57, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.http_channel", - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "class HttpControlAppFactory:\n def create(\n self,\n health_provider: Callable[[], Awaitable[HealthPayload]],\n action_provider: Callable[[str, str], Awaitable[JSONResponse]],\n ) -> FastAPI:\n app = FastAPI(title=\"PLBA Control API\")\n\n @app.middleware(\"http\")\n async def log_api_call(request: Request, call_next): # type: ignore[no-untyped-def]\n started = time.monotonic()\n response = await call_next(request)\n response.headers[\"X-Response-Time-Ms\"] = str(int((time.monotonic() - started) * 1000))\n return response\n\n @app.get(\"/health\")\n async def health() -> JSONResponse:\n payload = await health_provider()\n status_code = 200 if payload.get(\"status\") == \"ok\" else 503\n return JSONResponse(content=payload, status_code=status_code)\n\n @app.get(\"/actions/{action}\")\n @app.post(\"/actions/{action}\")\n async def action(action: str, request: Request) -> JSONResponse:\n client_source = self._client_source(request)\n if action in {\"start\", \"stop\"}:\n LOGGER.warning(\"Control action requested: /actions/%s client=%s\", action, client_source)\n return await action_provider(action, client_source)\n\n return app\n\n def _client_source(self, request: Request) -> str:\n explicit_header = request.headers.get(\"X-Client-Source\", \"\").strip()\n if explicit_header:\n return explicit_header\n user_agent = request.headers.get(\"User-Agent\", \"\").strip()\n if user_agent:\n return f\"user-agent:{user_agent}\"\n return \"unknown\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/http_app.py:HttpControlAppFactory", - "span_start": 15, - "span_end": 53, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.http_app", - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "class ControlActionSet:\n health: HealthHandler\n start: ActionHandler\n stop: ActionHandler\n status: ActionHandler", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/base.py:ControlActionSet", - "span_start": 14, - "span_end": 18, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.base", - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/__init__.py", - "content": "from app_runtime.control.base import ControlActionSet, ControlChannel\nfrom app_runtime.control.http_channel import HttpControlChannel\nfrom app_runtime.control.service import ControlPlaneService\n\n__all__ = [\"ControlActionSet\", \"ControlChannel\", \"ControlPlaneService\", \"HttpControlChannel\"]", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/__init__.py:1-5", - "span_start": 1, - "span_end": 5, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.app_runtime.control.__init__", - "is_test": false, - "blob_sha": "bf3c37e3369a84cc618adc0fd71c232e5eb4b871eaff743069a17e661e498316", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "class ControlChannel(ABC):\n @abstractmethod\n async def start(self, actions: ControlActionSet) -> None:\n \"\"\"Start the control channel and bind handlers.\"\"\"\n\n @abstractmethod\n async def stop(self) -> None:\n \"\"\"Stop the control channel and release resources.\"\"\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/base.py:ControlChannel", - "span_start": 21, - "span_end": 28, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 1, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.base", - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_runner.py", - "content": "class UvicornThreadRunner:\n def __init__(self, host: str, port: int, timeout: int) -> None:\n self._host = host\n self._port = port\n self._timeout = timeout\n self._server: Server | None = None\n self._thread: Thread | None = None\n self._error: BaseException | None = None\n\n async def start(self, app: FastAPI) -> None:\n if self._thread is not None and self._thread.is_alive():\n return\n self._error = None\n config = Config(app=app, host=self._host, port=self._port, log_level=\"warning\")\n self._server = Server(config)\n self._thread = Thread(target=self._serve, name=\"plba-http-control\", daemon=True)\n self._thread.start()\n await self._wait_until_started()\n\n async def stop(self) -> None:\n if self._server is None or self._thread is None:\n return\n self._server.should_exit = True\n await asyncio.to_thread(self._thread.join, self._timeout)\n self._server = None\n self._thread = None\n\n @property\n def port(self) -> int:\n if self._server is None or not getattr(self._server, \"servers\", None):\n return self._port\n socket = self._server.servers[0].sockets[0]\n return int(socket.getsockname()[1])\n\n async def _wait_until_started(self) -> None:\n if self._server is None:\n raise RuntimeError(\"Server is not initialized\")\n deadline = asyncio.get_running_loop().time() + max(float(self._timeout), 1.0)\n while not self._server.started:\n if self._error is not None:\n raise RuntimeError(\"HTTP control server failed to start\") from self._error\n if asyncio.get_running_loop().time() >= deadline:\n raise TimeoutError(\"HTTP control server startup timed out\")\n await asyncio.sleep(0.05)\n\n def _serve(self) -> None:\n if self._server is None:\n return\n try:\n asyncio.run(self._server.serve())\n except BaseException as exc: # noqa: BLE001\n self._error = exc", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/http_runner.py:UvicornThreadRunner", - "span_start": 10, - "span_end": 61, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.http_runner", - "is_test": false, - "blob_sha": "3779fdd2878b770e789a35bb2a89c9d79f13b61c26d7db1b3b683f9bb9e1623f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ] - }, - "diagnostics": { - "execution": { - "executed_layers": [ - "C3_ENTRYPOINTS", - "C0_SOURCE_CHUNKS" - ], - "retrieval_mode_by_layer": { - "C3_ENTRYPOINTS": "exact_path_fetch", - "C0_SOURCE_CHUNKS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C3_ENTRYPOINTS": 12, - "C0_SOURCE_CHUNKS": 6 - }, - "filters_by_layer": { - "C3_ENTRYPOINTS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C3_ENTRYPOINTS", - "query": "Найди точки входа HTTP control plane", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 12, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Найди точки входа HTTP control plane", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C3_ENTRYPOINTS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 3, - "candidates_after_filter": 3 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 6, - "candidates_after_filter": 6 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "not_found", - "resolved_symbol": null, - "alternatives": [ - "HTTP", - "control", - "plane" - ] - }, - "layers": [ - { - "layer": "C3_ENTRYPOINTS", - "status": "hit", - "hit_count": 3, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 6, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "symbol_resolution": 0, - "retrieval_total": 53, - "retrieval_by_layer": { - "C3_ENTRYPOINTS": 34, - "C0_SOURCE_CHUNKS": 19 - }, - "merge_rank": 0 - } - } - }, - { - "step": "llm_answer", - "input": { - "query": "Найди точки входа HTTP control plane", - "rag_count": 9 - }, - "output": { - "llm_answer": "В системе обнаружены следующие подтвержденные точки входа HTTP control plane:\n\n1." - }, - "diagnostics": { - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 1195, - "evidence_rows": 9, - "evidence_chars": 6731 - }, - "evidence_summary": [ - { - "layer": "C3_ENTRYPOINTS", - "count": 3, - "unique_paths": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 6, - "unique_paths": 5 - } - ], - "prompt_template_id": "intent_code_qa_find_entrypoints_ru_v4", - "system_prompt_version": "v1" - }, - "timings_ms": { - "prompt_build": 0, - "llm_call": 1472 - } - } - } - ] - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_143856/full_chain_plba_code_subintents_v2_plba-v2-find-entrypoints-control-plane.md b/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_143856/full_chain_plba_code_subintents_v2_plba-v2-find-entrypoints-control-plane.md deleted file mode 100644 index 3912163..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_143856/full_chain_plba_code_subintents_v2_plba-v2-find-entrypoints-control-plane.md +++ /dev/null @@ -1,33 +0,0 @@ -# plba-v2-find-entrypoints-control-plane - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_subintents_v2.yaml -- runner: runtime -- mode: full_chain -- passed: True - -## Query -Найди точки входа HTTP control plane - -## Actual -{ - "intent": "CODE_QA", - "sub_intent": "FIND_ENTRYPOINTS", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 9, - "llm_answer": "В системе обнаружены следующие подтвержденные точки входа HTTP control plane:\n\n1.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "HTTP", - "control", - "plane" - ], - "layers": [ - "C3_ENTRYPOINTS", - "C0_SOURCE_CHUNKS" - ] -} - -## Mismatches -- none \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_143856/full_chain_plba_code_subintents_v2_plba-v2-find-entrypoints-health-endpoint.json b/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_143856/full_chain_plba_code_subintents_v2_plba-v2-find-entrypoints-health-endpoint.json deleted file mode 100644 index c9f2543..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_143856/full_chain_plba_code_subintents_v2_plba-v2-find-entrypoints-health-endpoint.json +++ /dev/null @@ -1,1226 +0,0 @@ -{ - "case_id": "plba-v2-find-entrypoints-health-endpoint", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_subintents_v2.yaml", - "runner": "runtime", - "mode": "full_chain", - "actual": { - "intent": "CODE_QA", - "sub_intent": "FIND_ENTRYPOINTS", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 9, - "llm_answer": "Подтверждённые HTTP routes для health-endpoint:\n\n- GET /health \n Объявлен в `src/app_runtime/control/http_app.py`, обслуживается методом `http_app.get`.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "health", - "endpoint" - ], - "layers": [ - "C3_ENTRYPOINTS", - "C0_SOURCE_CHUNKS" - ] - }, - "passed": true, - "mismatches": [], - "details": { - "case_id": "plba-v2-find-entrypoints-health-endpoint", - "text": "Где health endpoint?", - "mode": "full_chain", - "run_started_at": "2026-03-12T14:38:57", - "rag_session_id": "7d11da21-faa0-4cea-aede-aeabe069164c", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Где health endpoint?", - "symbol_resolution": { - "status": "not_found", - "resolved_symbol": null, - "alternatives": [ - "health", - "endpoint" - ], - "confidence": 0.0 - }, - "rag_count": 9, - "rag_rows": [ - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/health/registry.py", - "content": "class HealthRegistry:\n def __init__(self) -> None:\n self._contributors: list[HealthContributor] = []\n\n def register(self, contributor: HealthContributor) -> None:\n self._contributors.append(contributor)\n\n def contributor_healths(self) -> list[WorkerHealth]:\n return [contributor.health() for contributor in self._contributors]\n\n def snapshot(self, worker_healths: list[WorkerHealth]) -> dict[str, object]:\n component_healths = worker_healths + self.contributor_healths()\n return {\n \"status\": self._aggregate_status(component_healths),\n \"components\": [self._health_dict(item) for item in component_healths],\n }\n\n def payload(self, state: LifecycleState, worker_healths: list[WorkerHealth]) -> HealthPayload:\n component_healths = worker_healths + self.contributor_healths()\n if state == LifecycleState.STOPPED:\n return {\"status\": \"unhealthy\", \"detail\": \"state=stopped\", \"state\": state.value}\n if state in {LifecycleState.STARTING, LifecycleState.STOPPING}:\n return {\n \"status\": \"degraded\",\n \"detail\": f\"state={state.value}\",\n \"state\": state.value,\n \"components\": [self._health_dict(item) for item in component_healths],\n }\n return {\n \"status\": self._aggregate_status(component_healths),\n \"state\": state.value,\n \"components\": [self._health_dict(item) for item in component_healths],\n }\n\n def _aggregate_status(self, component_healths: list[WorkerHealth]) -> str:\n if any(item.status == \"unhealthy\" and item.critical for item in component_healths):\n return \"unhealthy\"\n if any(item.status in {\"degraded\", \"unhealthy\"} for item in component_healths):\n return \"degraded\"\n return \"ok\"\n\n def _health_dict(self, health: WorkerHealth) -> dict[str, object]:\n return {\n \"name\": health.name,\n \"status\": health.status,\n \"critical\": health.critical,\n \"detail\": health.detail,\n \"meta\": health.meta,\n }", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/health/registry.py:HealthRegistry", - "span_start": 8, - "span_end": 56, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.health.registry", - "is_test": false, - "blob_sha": "26e6a24daa43407ba5340b74497c20153020e79f8d7828ae502aaec378dfcf75", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/health.py", - "content": "from app_runtime.health.registry import HealthRegistry\n\n__all__ = [\"HealthRegistry\"]", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/health/__init__.py:1-3", - "span_start": 1, - "span_end": 3, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.app_runtime.health.__init__", - "is_test": false, - "blob_sha": "f7b15eed8b1f1cca8dfd467909a2612d8cb4e66e46b972ad89a0c9459ce283a0", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/contracts/health.py", - "content": "class HealthContributor(ABC):\n @abstractmethod\n def health(self) -> WorkerHealth:\n \"\"\"Return contributor health state.\"\"\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/contracts/health.py:HealthContributor", - "span_start": 7, - "span_end": 10, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.contracts.health", - "is_test": false, - "blob_sha": "6bd92611def7131e32d4dd34a8ed85e6cf3c67722ad27797032a632cb30dc097", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/health/__init__.py", - "content": "from app_runtime.health.registry import HealthRegistry\n\n__all__ = [\"HealthRegistry\"]", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/health/__init__.py:1-3", - "span_start": 1, - "span_end": 3, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.app_runtime.health.__init__", - "is_test": false, - "blob_sha": "f7b15eed8b1f1cca8dfd467909a2612d8cb4e66e46b972ad89a0c9459ce283a0", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/contracts/worker.py", - "content": "class WorkerHealth:\n name: str\n status: HealthState\n critical: bool\n detail: str | None = None\n meta: dict[str, Any] = field(default_factory=dict)", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/contracts/worker.py:WorkerHealth", - "span_start": 13, - "span_end": 18, - "lexical_rank": 6, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.contracts.worker", - "is_test": false, - "blob_sha": "e4827d32220f322d8adc3e42769da3ca0cc680db6a5eab7a11f4d8773a75304e", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/contracts/worker.py", - "content": "class Worker(ABC):\n @property\n @abstractmethod\n def name(self) -> str:\n \"\"\"Stable worker name for diagnostics.\"\"\"\n\n @property\n @abstractmethod\n def critical(self) -> bool:\n \"\"\"Whether this worker is required for healthy app operation.\"\"\"\n\n @abstractmethod\n def start(self) -> None:\n \"\"\"Start worker execution.\"\"\"\n\n @abstractmethod\n def stop(self, force: bool = False) -> None:\n \"\"\"Request graceful or immediate stop.\"\"\"\n\n @abstractmethod\n def health(self) -> WorkerHealth:\n \"\"\"Return current health state.\"\"\"\n\n @abstractmethod\n def status(self) -> WorkerStatus:\n \"\"\"Return current runtime status.\"\"\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/contracts/worker.py:Worker", - "span_start": 30, - "span_end": 55, - "lexical_rank": 6, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 2, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.contracts.worker", - "is_test": false, - "blob_sha": "e4827d32220f322d8adc3e42769da3ca0cc680db6a5eab7a11f4d8773a75304e", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "llm_answer": "Подтверждённые HTTP routes для health-endpoint:\n\n- GET /health \n Объявлен в `src/app_runtime/control/http_app.py`, обслуживается методом `http_app.get`.", - "summary": { - "router": { - "intent": "CODE_QA", - "sub_intent": "FIND_ENTRYPOINTS", - "confidence": null - }, - "retrieval": { - "profile": "code", - "layers_hit": [ - "C0_SOURCE_CHUNKS", - "C3_ENTRYPOINTS" - ], - "evidence_sufficient": true - }, - "llm": { - "answer_status": "answered", - "groundedness": "grounded" - } - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "FIND_ENTRYPOINTS", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C3_ENTRYPOINTS", - "C0_SOURCE_CHUNKS" - ], - "symbol_kind_hint": "unknown", - "symbol_candidates": [ - "health", - "endpoint" - ], - "keyword_hints": [ - "health", - "endpoint" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "execution": { - "executed_layers": [ - "C3_ENTRYPOINTS", - "C0_SOURCE_CHUNKS" - ], - "retrieval_mode_by_layer": { - "C3_ENTRYPOINTS": "exact_path_fetch", - "C0_SOURCE_CHUNKS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C3_ENTRYPOINTS": 12, - "C0_SOURCE_CHUNKS": 6 - }, - "filters_by_layer": { - "C3_ENTRYPOINTS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C3_ENTRYPOINTS", - "query": "Где health endpoint?", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 12, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Где health endpoint?", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C3_ENTRYPOINTS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 3, - "candidates_after_filter": 3 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 6, - "candidates_after_filter": 6 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "not_found", - "resolved_symbol": null, - "alternatives": [ - "health", - "endpoint" - ] - }, - "layers": [ - { - "layer": "C3_ENTRYPOINTS", - "status": "hit", - "hit_count": 3, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 6, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "router": 0, - "symbol_resolution": 0, - "retrieval_total": 37, - "retrieval_by_layer": { - "C3_ENTRYPOINTS": 23, - "C0_SOURCE_CHUNKS": 13 - }, - "merge_rank": 0, - "prompt_build": 0, - "llm_call": 1159 - }, - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 904, - "evidence_rows": 9, - "evidence_chars": 3350 - }, - "evidence_summary": [ - { - "layer": "C3_ENTRYPOINTS", - "count": 3, - "unique_paths": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 6, - "unique_paths": 5 - } - ], - "prompt_template_id": "intent_code_qa_find_entrypoints_ru_v4", - "system_prompt_version": "v1" - }, - "router": { - "conversation_mode": "START", - "keyword_hints": [ - "health", - "endpoint" - ], - "path_scope": [] - }, - "llm": { - "used_evidence_count": 9, - "missing_evidence_reason": null - } - }, - "run_info": { - "case_id": "plba-v2-find-entrypoints-health-endpoint", - "mode": "full_chain", - "run_started_at": "2026-03-12T14:38:57", - "rag_session_id": "7d11da21-faa0-4cea-aede-aeabe069164c", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - }, - "input_request": { - "text": "Где health endpoint?", - "normalized_query": "Где health endpoint?" - }, - "steps": [ - { - "step": "intent_router", - "input": { - "query": "Где health endpoint?" - }, - "output": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Где health endpoint?" - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "FIND_ENTRYPOINTS", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C3_ENTRYPOINTS", - "C0_SOURCE_CHUNKS" - ], - "symbol_kind_hint": "unknown", - "symbol_candidates": [ - "health", - "endpoint" - ], - "keyword_hints": [ - "health", - "endpoint" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "timings_ms": { - "router": 0 - } - } - }, - { - "step": "retrieval", - "input": { - "query": "Где health endpoint?" - }, - "output": { - "symbol_resolution": { - "status": "not_found", - "resolved_symbol": null, - "alternatives": [ - "health", - "endpoint" - ], - "confidence": 0.0 - }, - "rag_count": 9, - "rag_rows": [ - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/health/registry.py", - "content": "class HealthRegistry:\n def __init__(self) -> None:\n self._contributors: list[HealthContributor] = []\n\n def register(self, contributor: HealthContributor) -> None:\n self._contributors.append(contributor)\n\n def contributor_healths(self) -> list[WorkerHealth]:\n return [contributor.health() for contributor in self._contributors]\n\n def snapshot(self, worker_healths: list[WorkerHealth]) -> dict[str, object]:\n component_healths = worker_healths + self.contributor_healths()\n return {\n \"status\": self._aggregate_status(component_healths),\n \"components\": [self._health_dict(item) for item in component_healths],\n }\n\n def payload(self, state: LifecycleState, worker_healths: list[WorkerHealth]) -> HealthPayload:\n component_healths = worker_healths + self.contributor_healths()\n if state == LifecycleState.STOPPED:\n return {\"status\": \"unhealthy\", \"detail\": \"state=stopped\", \"state\": state.value}\n if state in {LifecycleState.STARTING, LifecycleState.STOPPING}:\n return {\n \"status\": \"degraded\",\n \"detail\": f\"state={state.value}\",\n \"state\": state.value,\n \"components\": [self._health_dict(item) for item in component_healths],\n }\n return {\n \"status\": self._aggregate_status(component_healths),\n \"state\": state.value,\n \"components\": [self._health_dict(item) for item in component_healths],\n }\n\n def _aggregate_status(self, component_healths: list[WorkerHealth]) -> str:\n if any(item.status == \"unhealthy\" and item.critical for item in component_healths):\n return \"unhealthy\"\n if any(item.status in {\"degraded\", \"unhealthy\"} for item in component_healths):\n return \"degraded\"\n return \"ok\"\n\n def _health_dict(self, health: WorkerHealth) -> dict[str, object]:\n return {\n \"name\": health.name,\n \"status\": health.status,\n \"critical\": health.critical,\n \"detail\": health.detail,\n \"meta\": health.meta,\n }", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/health/registry.py:HealthRegistry", - "span_start": 8, - "span_end": 56, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.health.registry", - "is_test": false, - "blob_sha": "26e6a24daa43407ba5340b74497c20153020e79f8d7828ae502aaec378dfcf75", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/health.py", - "content": "from app_runtime.health.registry import HealthRegistry\n\n__all__ = [\"HealthRegistry\"]", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/health/__init__.py:1-3", - "span_start": 1, - "span_end": 3, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.app_runtime.health.__init__", - "is_test": false, - "blob_sha": "f7b15eed8b1f1cca8dfd467909a2612d8cb4e66e46b972ad89a0c9459ce283a0", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/contracts/health.py", - "content": "class HealthContributor(ABC):\n @abstractmethod\n def health(self) -> WorkerHealth:\n \"\"\"Return contributor health state.\"\"\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/contracts/health.py:HealthContributor", - "span_start": 7, - "span_end": 10, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.contracts.health", - "is_test": false, - "blob_sha": "6bd92611def7131e32d4dd34a8ed85e6cf3c67722ad27797032a632cb30dc097", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/health/__init__.py", - "content": "from app_runtime.health.registry import HealthRegistry\n\n__all__ = [\"HealthRegistry\"]", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/health/__init__.py:1-3", - "span_start": 1, - "span_end": 3, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.app_runtime.health.__init__", - "is_test": false, - "blob_sha": "f7b15eed8b1f1cca8dfd467909a2612d8cb4e66e46b972ad89a0c9459ce283a0", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/contracts/worker.py", - "content": "class WorkerHealth:\n name: str\n status: HealthState\n critical: bool\n detail: str | None = None\n meta: dict[str, Any] = field(default_factory=dict)", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/contracts/worker.py:WorkerHealth", - "span_start": 13, - "span_end": 18, - "lexical_rank": 6, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.contracts.worker", - "is_test": false, - "blob_sha": "e4827d32220f322d8adc3e42769da3ca0cc680db6a5eab7a11f4d8773a75304e", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/contracts/worker.py", - "content": "class Worker(ABC):\n @property\n @abstractmethod\n def name(self) -> str:\n \"\"\"Stable worker name for diagnostics.\"\"\"\n\n @property\n @abstractmethod\n def critical(self) -> bool:\n \"\"\"Whether this worker is required for healthy app operation.\"\"\"\n\n @abstractmethod\n def start(self) -> None:\n \"\"\"Start worker execution.\"\"\"\n\n @abstractmethod\n def stop(self, force: bool = False) -> None:\n \"\"\"Request graceful or immediate stop.\"\"\"\n\n @abstractmethod\n def health(self) -> WorkerHealth:\n \"\"\"Return current health state.\"\"\"\n\n @abstractmethod\n def status(self) -> WorkerStatus:\n \"\"\"Return current runtime status.\"\"\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/contracts/worker.py:Worker", - "span_start": 30, - "span_end": 55, - "lexical_rank": 6, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 2, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.contracts.worker", - "is_test": false, - "blob_sha": "e4827d32220f322d8adc3e42769da3ca0cc680db6a5eab7a11f4d8773a75304e", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ] - }, - "diagnostics": { - "execution": { - "executed_layers": [ - "C3_ENTRYPOINTS", - "C0_SOURCE_CHUNKS" - ], - "retrieval_mode_by_layer": { - "C3_ENTRYPOINTS": "exact_path_fetch", - "C0_SOURCE_CHUNKS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C3_ENTRYPOINTS": 12, - "C0_SOURCE_CHUNKS": 6 - }, - "filters_by_layer": { - "C3_ENTRYPOINTS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C3_ENTRYPOINTS", - "query": "Где health endpoint?", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 12, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Где health endpoint?", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C3_ENTRYPOINTS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 3, - "candidates_after_filter": 3 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 6, - "candidates_after_filter": 6 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "not_found", - "resolved_symbol": null, - "alternatives": [ - "health", - "endpoint" - ] - }, - "layers": [ - { - "layer": "C3_ENTRYPOINTS", - "status": "hit", - "hit_count": 3, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 6, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "symbol_resolution": 0, - "retrieval_total": 37, - "retrieval_by_layer": { - "C3_ENTRYPOINTS": 23, - "C0_SOURCE_CHUNKS": 13 - }, - "merge_rank": 0 - } - } - }, - { - "step": "llm_answer", - "input": { - "query": "Где health endpoint?", - "rag_count": 9 - }, - "output": { - "llm_answer": "Подтверждённые HTTP routes для health-endpoint:\n\n- GET /health \n Объявлен в `src/app_runtime/control/http_app.py`, обслуживается методом `http_app.get`." - }, - "diagnostics": { - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 904, - "evidence_rows": 9, - "evidence_chars": 3350 - }, - "evidence_summary": [ - { - "layer": "C3_ENTRYPOINTS", - "count": 3, - "unique_paths": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 6, - "unique_paths": 5 - } - ], - "prompt_template_id": "intent_code_qa_find_entrypoints_ru_v4", - "system_prompt_version": "v1" - }, - "timings_ms": { - "prompt_build": 0, - "llm_call": 1159 - } - } - } - ] - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_143856/full_chain_plba_code_subintents_v2_plba-v2-find-entrypoints-health-endpoint.md b/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_143856/full_chain_plba_code_subintents_v2_plba-v2-find-entrypoints-health-endpoint.md deleted file mode 100644 index 6b8cf3e..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_143856/full_chain_plba_code_subintents_v2_plba-v2-find-entrypoints-health-endpoint.md +++ /dev/null @@ -1,32 +0,0 @@ -# plba-v2-find-entrypoints-health-endpoint - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_subintents_v2.yaml -- runner: runtime -- mode: full_chain -- passed: True - -## Query -Где health endpoint? - -## Actual -{ - "intent": "CODE_QA", - "sub_intent": "FIND_ENTRYPOINTS", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 9, - "llm_answer": "Подтверждённые HTTP routes для health-endpoint:\n\n- GET /health \n Объявлен в `src/app_runtime/control/http_app.py`, обслуживается методом `http_app.get`.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "health", - "endpoint" - ], - "layers": [ - "C3_ENTRYPOINTS", - "C0_SOURCE_CHUNKS" - ] -} - -## Mismatches -- none \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_143856/full_chain_plba_code_subintents_v2_plba-v2-find-tests-create-runtime.json b/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_143856/full_chain_plba_code_subintents_v2_plba-v2-find-tests-create-runtime.json deleted file mode 100644 index a80292b..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_143856/full_chain_plba_code_subintents_v2_plba-v2-find-tests-create-runtime.json +++ /dev/null @@ -1,1963 +0,0 @@ -{ - "case_id": "plba-v2-find-tests-create-runtime", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_subintents_v2.yaml", - "runner": "runtime", - "mode": "full_chain", - "actual": { - "intent": "CODE_QA", - "sub_intent": "FIND_TESTS", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 16, - "llm_answer": "Прямых тестов конкретно для функции `create_runtime` в предоставленном контексте не обнаружено.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "create_runtime" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ] - }, - "passed": true, - "mismatches": [], - "details": { - "case_id": "plba-v2-find-tests-create-runtime", - "text": "Где тесты для create_runtime?", - "mode": "full_chain", - "run_started_at": "2026-03-12T14:38:57", - "rag_session_id": "7d11da21-faa0-4cea-aede-aeabe069164c", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Где тесты для create_runtime?", - "symbol_resolution": { - "status": "not_found", - "resolved_symbol": null, - "alternatives": [ - "create_runtime" - ], - "confidence": 0.0 - }, - "rag_count": 16, - "rag_rows": [ - { - "path": "tests/test_runtime.py", - "content": "test_public_plba_package_exports_runtime_builder_and_worker_contract imports plba.create_runtime", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_public_plba_package_exports_runtime_builder_and_worker_contract:imports", - "span_start": 349, - "span_end": 349, - "lexical_rank": 6, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e93f80075cd9988737ece3cb5ec659c542132c4d383646e376917bfd0cb6ea64", - "edge_type": "imports", - "src_symbol_id": "ed06ffc5afb8a863cf7da3e40921f17abe4eec2a0770139e3380d93ccaae604a", - "src_qname": "test_public_plba_package_exports_runtime_builder_and_worker_contract", - "dst_symbol_id": null, - "dst_ref": "plba.create_runtime", - "resolution": "partial", - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_runtime.py", - "content": "test_public_plba_package_exports_runtime_builder_and_worker_contract calls create_runtime", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_public_plba_package_exports_runtime_builder_and_worker_contract:calls", - "span_start": 399, - "span_end": 399, - "lexical_rank": 6, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "039939355230de826d8bf7607f55fc59c7d932e5570ecb78994d0f13e57e8488", - "edge_type": "calls", - "src_symbol_id": "ed06ffc5afb8a863cf7da3e40921f17abe4eec2a0770139e3380d93ccaae604a", - "src_qname": "test_public_plba_package_exports_runtime_builder_and_worker_contract", - "dst_symbol_id": null, - "dst_ref": "create_runtime", - "resolution": "partial", - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "test_worker_wakes_up_with_configured_interval\n -> ScenarioWorker\n -> ScenarioWorker.__init__\n -> ScenarioWorker._name\n -> ScenarioWorker.name", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_worker_wakes_up_with_configured_interval:dataflow_slice", - "span_start": 52, - "span_end": 166, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 5, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "2fd137f5852febe907f44d3b3e4ea430f89ccfe962ae1442a16ab9df64c8f76c", - "edge_type": "dataflow_slice", - "src_symbol_id": "65f877f78191d65e6a752e41cedc70ebc784c266804a55c1c56440336e1f0d6e", - "src_qname": "test_worker_wakes_up_with_configured_interval", - "dst_symbol_id": "da022da2c49fd9cfd09d6e6da6bbd59aaa7d28efd669ce8444e88d327ddec2fc", - "dst_ref": "ScenarioWorker.name", - "resolution": "resolved", - "slice_id": "2fd137f5852febe907f44d3b3e4ea430f89ccfe962ae1442a16ab9df64c8f76c", - "root_symbol_id": "65f877f78191d65e6a752e41cedc70ebc784c266804a55c1c56440336e1f0d6e", - "path_symbols": [ - "test_worker_wakes_up_with_configured_interval", - "ScenarioWorker", - "ScenarioWorker.__init__", - "ScenarioWorker._name", - "ScenarioWorker.name" - ], - "path_symbol_ids": [ - "65f877f78191d65e6a752e41cedc70ebc784c266804a55c1c56440336e1f0d6e", - "9a1d08a7eb1831c9f2e0db361b5207f036e477c160773ae08c0b287239785c52", - "9c20be046ba06644d1432e0f20eb223663d2b116ee7d91fdc62bc68323f2e593", - "da022da2c49fd9cfd09d6e6da6bbd59aaa7d28efd669ce8444e88d327ddec2fc" - ], - "path_edge_types": [ - "instantiates", - "writes_attr", - "reads_attr" - ], - "path_length": 5, - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "test_actions_stop_busy_worker_after_timeout\n -> BlockingRoutine\n -> BlockingRoutine.__init__\n -> BlockingRoutine._started\n -> BlockingRoutine.run", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_actions_stop_busy_worker_after_timeout:dataflow_slice", - "span_start": 42, - "span_end": 238, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 5, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "8e7db3d2a9226f1c1d9942ac6373cfcafa0d2276758ddb8a3d3c455a3d58024d", - "edge_type": "dataflow_slice", - "src_symbol_id": "66392d3222421d9ba16eda3554940b16e7d5a6f33aa08c5738d35af2e32f1e4a", - "src_qname": "test_actions_stop_busy_worker_after_timeout", - "dst_symbol_id": "d9841bdbb69706c988ae7ae6adf89928dc4fae45943f74064f5382177034ba04", - "dst_ref": "BlockingRoutine.run", - "resolution": "resolved", - "slice_id": "8e7db3d2a9226f1c1d9942ac6373cfcafa0d2276758ddb8a3d3c455a3d58024d", - "root_symbol_id": "66392d3222421d9ba16eda3554940b16e7d5a6f33aa08c5738d35af2e32f1e4a", - "path_symbols": [ - "test_actions_stop_busy_worker_after_timeout", - "BlockingRoutine", - "BlockingRoutine.__init__", - "BlockingRoutine._started", - "BlockingRoutine.run" - ], - "path_symbol_ids": [ - "66392d3222421d9ba16eda3554940b16e7d5a6f33aa08c5738d35af2e32f1e4a", - "a3349c5bc65e4003a4bbd6a8dbb7a54c337e12d1aed930caa701b12e520f1e67", - "486deeed3043c6db985aef258e96ddc67aa53608e67a83962fbd2471f649ddf1", - "d9841bdbb69706c988ae7ae6adf89928dc4fae45943f74064f5382177034ba04" - ], - "path_edge_types": [ - "instantiates", - "writes_attr", - "reads_attr" - ], - "path_length": 5, - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "test_actions_stop_busy_worker_after_timeout\n -> BlockingRoutine\n -> BlockingRoutine.__init__\n -> BlockingRoutine._release\n -> BlockingRoutine.run", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_actions_stop_busy_worker_after_timeout:dataflow_slice", - "span_start": 43, - "span_end": 238, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 5, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "b59da9da82f9dfc8a9b695a08213786385da1ae9e17561ec3a0450a574a8cb39", - "edge_type": "dataflow_slice", - "src_symbol_id": "66392d3222421d9ba16eda3554940b16e7d5a6f33aa08c5738d35af2e32f1e4a", - "src_qname": "test_actions_stop_busy_worker_after_timeout", - "dst_symbol_id": "d9841bdbb69706c988ae7ae6adf89928dc4fae45943f74064f5382177034ba04", - "dst_ref": "BlockingRoutine.run", - "resolution": "resolved", - "slice_id": "b59da9da82f9dfc8a9b695a08213786385da1ae9e17561ec3a0450a574a8cb39", - "root_symbol_id": "66392d3222421d9ba16eda3554940b16e7d5a6f33aa08c5738d35af2e32f1e4a", - "path_symbols": [ - "test_actions_stop_busy_worker_after_timeout", - "BlockingRoutine", - "BlockingRoutine.__init__", - "BlockingRoutine._release", - "BlockingRoutine.run" - ], - "path_symbol_ids": [ - "66392d3222421d9ba16eda3554940b16e7d5a6f33aa08c5738d35af2e32f1e4a", - "a3349c5bc65e4003a4bbd6a8dbb7a54c337e12d1aed930caa701b12e520f1e67", - "486deeed3043c6db985aef258e96ddc67aa53608e67a83962fbd2471f649ddf1", - "d9841bdbb69706c988ae7ae6adf89928dc4fae45943f74064f5382177034ba04" - ], - "path_edge_types": [ - "instantiates", - "writes_attr", - "reads_attr" - ], - "path_length": 5, - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "test_actions_stop_busy_worker_before_timeout\n -> BlockingRoutine\n -> BlockingRoutine.__init__\n -> BlockingRoutine._started\n -> BlockingRoutine.run", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_actions_stop_busy_worker_before_timeout:dataflow_slice", - "span_start": 42, - "span_end": 212, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 5, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "f9bcce108870e49afa8b32d4625115a10707a3b0e7473179e958e5752bf258b4", - "edge_type": "dataflow_slice", - "src_symbol_id": "a0bb116ca9d909c93a285667ae033fbd1859b2dad7cf34fcb44816393ef6909c", - "src_qname": "test_actions_stop_busy_worker_before_timeout", - "dst_symbol_id": "d9841bdbb69706c988ae7ae6adf89928dc4fae45943f74064f5382177034ba04", - "dst_ref": "BlockingRoutine.run", - "resolution": "resolved", - "slice_id": "f9bcce108870e49afa8b32d4625115a10707a3b0e7473179e958e5752bf258b4", - "root_symbol_id": "a0bb116ca9d909c93a285667ae033fbd1859b2dad7cf34fcb44816393ef6909c", - "path_symbols": [ - "test_actions_stop_busy_worker_before_timeout", - "BlockingRoutine", - "BlockingRoutine.__init__", - "BlockingRoutine._started", - "BlockingRoutine.run" - ], - "path_symbol_ids": [ - "a0bb116ca9d909c93a285667ae033fbd1859b2dad7cf34fcb44816393ef6909c", - "a3349c5bc65e4003a4bbd6a8dbb7a54c337e12d1aed930caa701b12e520f1e67", - "486deeed3043c6db985aef258e96ddc67aa53608e67a83962fbd2471f649ddf1", - "d9841bdbb69706c988ae7ae6adf89928dc4fae45943f74064f5382177034ba04" - ], - "path_edge_types": [ - "instantiates", - "writes_attr", - "reads_attr" - ], - "path_length": 5, - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_runtime.py", - "content": "def test_public_plba_package_exports_runtime_builder_and_worker_contract(tmp_path) -> None:\n import plba\n from plba import ApplicationModule as PublicApplicationModule\n from plba import InMemoryTaskQueue\n from plba import Worker as PublicWorker\n from plba import WorkerHealth as PublicWorkerHealth\n from plba import WorkerStatus as PublicWorkerStatus\n from plba import create_runtime\n\n config_path = tmp_path / \"config.yml\"\n config_path.write_text(\"platform: {}\\n\", encoding=\"utf-8\")\n\n queue = InMemoryTaskQueue[int]()\n queue.put(2)\n assert queue.get(timeout=0.01) == 2\n queue.task_done()\n\n class PublicRoutine:\n def __init__(self) -> None:\n self.runs = 0\n\n def run(self) -> None:\n if self.runs == 0:\n self.runs += 1\n\n class PublicWorkerImpl(PublicWorker):\n def __init__(self, routine: PublicRoutine) -> None:\n self._inner = RoutineWorker(\"public-worker\", routine)\n\n @property\n def name(self) -> str:\n return self._inner.name\n\n @property\n def critical(self) -> bool:\n return self._inner.critical\n\n def start(self) -> None:\n self._inner.start()\n\n def stop(self, force: bool = False) -> None:\n self._inner.stop(force=force)\n\n def health(self) -> PublicWorkerHealth:\n return self._inner.health()\n\n def status(self) -> PublicWorkerStatus:\n return self._inner.status()\n\n class PublicExampleModule(PublicApplicationModule):\n @property\n def name(self) -> str:\n return \"public-example\"\n\n def register(self, registry: ModuleRegistry) -> None:\n registry.add_worker(PublicWorkerImpl(PublicRoutine()))\n\n runtime = create_runtime(PublicExampleModule(), config_path=str(config_path))\n runtime.start()\n sleep(0.2)\n assert runtime.configuration.get() == {\"platform\": {}}\n assert runtime.status()[\"workers\"][\"registered\"] == 1\n assert hasattr(plba, \"QueueWorker\") is False\n runtime.stop()", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_runtime.py:test_public_plba_package_exports_runtime_builder_and_worker_contract", - "span_start": 342, - "span_end": 405, - "lexical_rank": 6, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 13, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_runtime", - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "def _build_runtime(worker: Worker, *, control_timeout: int = 1) -> tuple[RuntimeManager, str]:\n runtime = RuntimeManager()\n channel = HttpControlChannel(host=\"127.0.0.1\", port=0, timeout=control_timeout)\n runtime.control_plane.register_channel(channel)\n runtime.register_module(WorkerModule(worker))\n runtime.start()\n return runtime, f\"http://127.0.0.1:{channel.port}\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:_build_runtime", - "span_start": 154, - "span_end": 160, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 6, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "class IntervalRoutine:\n calls: list[float] = field(default_factory=list)\n _lock: Lock = field(default_factory=Lock)\n\n def run(self) -> None:\n with self._lock:\n self.calls.append(monotonic())\n\n def wait_runs(self, count: int, timeout: float) -> bool:\n deadline = monotonic() + timeout\n while monotonic() < deadline:\n with self._lock:\n if len(self.calls) >= count:\n return True\n sleep(0.01)\n return False\n\n def deltas(self) -> list[float]:\n with self._lock:\n return [self.calls[index + 1] - self.calls[index] for index in range(len(self.calls) - 1)]", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:IntervalRoutine", - "span_start": 18, - "span_end": 37, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "class ScenarioWorker(Worker):\n def __init__(self, name: str, routine: object, *, interval: float = 0.05) -> None:\n self._name = name\n self._routine = routine\n self._interval = interval\n self._thread: Thread | None = None\n self._stop_requested = Event()\n self._in_flight = 0\n self._runs = 0\n self._lock = Lock()\n\n @property\n def name(self) -> str:\n return self._name\n\n @property\n def critical(self) -> bool:\n return True\n\n def start(self) -> None:\n if self._thread is not None and self._thread.is_alive():\n return\n self._stop_requested.clear()\n self._thread = Thread(target=self._loop, name=f\"{self._name}-thread\", daemon=True)\n self._thread.start()\n\n def stop(self, force: bool = False) -> None:\n self._stop_requested.set()\n\n def health(self) -> WorkerHealth:\n return WorkerHealth(name=self.name, status=\"ok\", critical=True, meta={\"runs\": self._runs})\n\n def status(self) -> WorkerStatus:\n thread_alive = self._thread is not None and self._thread.is_alive()\n with self._lock:\n in_flight = self._in_flight\n runs = self._runs\n if not thread_alive:\n state = \"stopped\"\n elif self._stop_requested.is_set():\n state = \"stopping\"\n elif in_flight > 0:\n state = \"busy\"\n else:\n state = \"idle\"\n return WorkerStatus(name=self.name, state=state, in_flight=in_flight, meta={\"runs\": runs})\n\n def _loop(self) -> None:\n while not self._stop_requested.is_set():\n with self._lock:\n self._in_flight += 1\n try:\n self._routine.run()\n with self._lock:\n self._runs += 1\n finally:\n with self._lock:\n self._in_flight -= 1\n if self._stop_requested.is_set():\n return\n sleep(self._interval)", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:ScenarioWorker", - "span_start": 50, - "span_end": 110, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 2, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "def _http_call_json(\n base_url: str,\n path: str,\n *,\n method: str = \"GET\",\n headers: dict[str, str] | None = None,\n) -> tuple[int, dict[str, object]]:\n request = Request(f\"{base_url}{path}\", method=method, headers=headers or {})\n try:\n with urlopen(request, timeout=15.0) as response:\n status = response.status\n body = response.read()\n except HTTPError as error:\n status = error.code\n body = error.read()\n payload = json.loads(body.decode(\"utf-8\"))\n return status, payload", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:_http_call_json", - "span_start": 125, - "span_end": 141, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 4, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "def _poll_until_stopped(base_url: str, timeout: float = 2.0) -> bool:\n deadline = monotonic() + timeout\n while monotonic() < deadline:\n _, payload = _http_call_json(base_url, \"/actions/status\")\n if payload.get(\"detail\") == \"stopped\":\n return True\n sleep(0.05)\n return False", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:_poll_until_stopped", - "span_start": 144, - "span_end": 151, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 5, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "def test_worker_wakes_up_with_configured_interval() -> None:\n interval = 0.15\n routine = IntervalRoutine()\n worker = ScenarioWorker(\"interval-worker\", routine, interval=interval)\n runtime = RuntimeManager()\n runtime.register_module(WorkerModule(worker))\n\n runtime.start()\n try:\n assert routine.wait_runs(count=3, timeout=2.0) is True\n finally:\n runtime.stop()\n\n deltas = routine.deltas()\n assert len(deltas) >= 2\n assert all(delta >= interval * 0.7 for delta in deltas[:2])", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:test_worker_wakes_up_with_configured_interval", - "span_start": 163, - "span_end": 178, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 7, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "class WorkerModule(ApplicationModule):\n def __init__(self, worker: Worker) -> None:\n self._worker = worker\n\n @property\n def name(self) -> str:\n return \"business-tests\"\n\n def register(self, registry: ModuleRegistry) -> None:\n registry.add_worker(self._worker)", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:WorkerModule", - "span_start": 113, - "span_end": 122, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 3, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "class BlockingRoutine:\n def __init__(self, started: Event, release: Event) -> None:\n self._started = started\n self._release = release\n\n def run(self) -> None:\n self._started.set()\n self._release.wait(timeout=5.0)", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:BlockingRoutine", - "span_start": 40, - "span_end": 47, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 1, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "def test_actions_start_stop_and_health_when_worker_is_idle() -> None:\n runtime, base_url = _build_runtime(ScenarioWorker(\"idle-worker\", IntervalRoutine(), interval=0.2))\n try:\n stop_status, stop_payload = _http_call_json(base_url, \"/actions/stop\", method=\"POST\")\n assert stop_status == 200\n assert isinstance(stop_payload.get(\"detail\"), dict)\n assert stop_payload[\"detail\"][\"timed_out\"] is False\n assert stop_payload[\"detail\"][\"state\"] == \"stopped\"\n\n health_stopped_status, health_stopped_payload = _http_call_json(base_url, \"/health\")\n assert health_stopped_status == 503\n assert health_stopped_payload[\"state\"] == \"stopped\"\n assert health_stopped_payload[\"status\"] == \"unhealthy\"\n\n start_status, start_payload = _http_call_json(base_url, \"/actions/start\", method=\"POST\")\n assert start_status == 200\n assert isinstance(start_payload.get(\"detail\"), dict)\n assert start_payload[\"detail\"][\"timed_out\"] is False\n assert start_payload[\"detail\"][\"state\"] in {\"idle\", \"busy\"}\n\n health_started_status, health_started_payload = _http_call_json(base_url, \"/health\")\n assert health_started_status == 200\n assert health_started_payload[\"status\"] == \"ok\"\n assert health_started_payload[\"state\"] in {\"idle\", \"busy\"}\n finally:\n runtime.stop()", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:test_actions_start_stop_and_health_when_worker_is_idle", - "span_start": 181, - "span_end": 206, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 8, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "llm_answer": "Прямых тестов конкретно для функции `create_runtime` в предоставленном контексте не обнаружено.", - "summary": { - "router": { - "intent": "CODE_QA", - "sub_intent": "FIND_TESTS", - "confidence": null - }, - "retrieval": { - "profile": "code", - "layers_hit": [ - "C0_SOURCE_CHUNKS", - "C2_DEPENDENCY_GRAPH" - ], - "evidence_sufficient": true - }, - "llm": { - "answer_status": "answered", - "groundedness": "grounded" - } - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "FIND_TESTS", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ], - "symbol_kind_hint": "function", - "symbol_candidates": [ - "create_runtime" - ], - "keyword_hints": [ - "create_runtime" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**", - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "test_file_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "test_symbol_patterns": [ - "test_create_runtime", - "Testcreate_runtime", - "create_runtime" - ], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C0_SOURCE_CHUNKS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C0_SOURCE_CHUNKS": 10 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [], - "include_globs": [ - "src", - "tests" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests" - ] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src", - "tests" - ], - "include_globs": [ - "src", - "tests" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests" - ] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src", - "tests" - ], - "include_globs": [ - "src", - "tests" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests" - ] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "create_runtime", - "path_scope": [], - "include_globs": [ - "src/**", - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "Где тесты для create_runtime? test_create_runtime Testcreate_runtime create_runtime", - "path_scope": [], - "include_globs": [ - "src/**", - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "top_k": 6, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Где тесты для create_runtime? test_create_runtime Testcreate_runtime create_runtime", - "path_scope": [], - "include_globs": [ - "src/**", - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "top_k": 10, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [], - "normalized_include_globs": [ - "src", - "tests" - ], - "normalized_exclude_globs": [], - "normalized_prefer_globs": [ - "tests" - ], - "filter_stage": "post_rank", - "candidates_before_filter": 0, - "candidates_after_filter": 0 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src", - "tests" - ], - "normalized_include_globs": [ - "src", - "tests" - ], - "normalized_exclude_globs": [], - "normalized_prefer_globs": [ - "tests" - ], - "filter_stage": "post_rank", - "candidates_before_filter": 6, - "candidates_after_filter": 6 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src", - "tests" - ], - "normalized_include_globs": [ - "src", - "tests" - ], - "normalized_exclude_globs": [], - "normalized_prefer_globs": [ - "tests" - ], - "filter_stage": "post_rank", - "candidates_before_filter": 10, - "candidates_after_filter": 10 - } - ], - "fallback": { - "used": true, - "reason": "scope_relaxed_no_hits" - }, - "symbol_resolution": { - "status": "not_found", - "resolved_symbol": null, - "alternatives": [ - "create_runtime" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "miss", - "hit_count": 0, - "fail_reason": "scope_relaxed_no_hits" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 6, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 10, - "fail_reason": null - } - ] - }, - "constraint_violations": [ - { - "type": "LAYER_MISSING", - "severity": "warn", - "details": { - "layer": "C1_SYMBOL_CATALOG", - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ] - }, - "suggested_fix": "Increase top_k for this layer or relax constraints for retrieval." - } - ], - "timings_ms": { - "router": 1, - "symbol_resolution": 0, - "retrieval_total": 145, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 66, - "C2_DEPENDENCY_GRAPH": 60, - "C0_SOURCE_CHUNKS": 18 - }, - "merge_rank": 0, - "prompt_build": 0, - "llm_call": 1465 - }, - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 1022, - "evidence_rows": 16, - "evidence_chars": 9185 - }, - "evidence_summary": [ - { - "layer": "C2_DEPENDENCY_GRAPH", - "count": 6, - "unique_paths": 2 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 10, - "unique_paths": 2 - } - ], - "prompt_template_id": "intent_code_qa_find_tests_ru_v4", - "system_prompt_version": "v1" - }, - "router": { - "conversation_mode": "START", - "keyword_hints": [ - "create_runtime" - ], - "path_scope": [] - }, - "llm": { - "used_evidence_count": 16, - "missing_evidence_reason": null - } - }, - "run_info": { - "case_id": "plba-v2-find-tests-create-runtime", - "mode": "full_chain", - "run_started_at": "2026-03-12T14:38:57", - "rag_session_id": "7d11da21-faa0-4cea-aede-aeabe069164c", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - }, - "input_request": { - "text": "Где тесты для create_runtime?", - "normalized_query": "Где тесты для create_runtime?" - }, - "steps": [ - { - "step": "intent_router", - "input": { - "query": "Где тесты для create_runtime?" - }, - "output": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Где тесты для create_runtime?" - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "FIND_TESTS", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ], - "symbol_kind_hint": "function", - "symbol_candidates": [ - "create_runtime" - ], - "keyword_hints": [ - "create_runtime" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**", - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "test_file_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "test_symbol_patterns": [ - "test_create_runtime", - "Testcreate_runtime", - "create_runtime" - ], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "timings_ms": { - "router": 1 - } - } - }, - { - "step": "retrieval", - "input": { - "query": "Где тесты для create_runtime?" - }, - "output": { - "symbol_resolution": { - "status": "not_found", - "resolved_symbol": null, - "alternatives": [ - "create_runtime" - ], - "confidence": 0.0 - }, - "rag_count": 16, - "rag_rows": [ - { - "path": "tests/test_runtime.py", - "content": "test_public_plba_package_exports_runtime_builder_and_worker_contract imports plba.create_runtime", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_public_plba_package_exports_runtime_builder_and_worker_contract:imports", - "span_start": 349, - "span_end": 349, - "lexical_rank": 6, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e93f80075cd9988737ece3cb5ec659c542132c4d383646e376917bfd0cb6ea64", - "edge_type": "imports", - "src_symbol_id": "ed06ffc5afb8a863cf7da3e40921f17abe4eec2a0770139e3380d93ccaae604a", - "src_qname": "test_public_plba_package_exports_runtime_builder_and_worker_contract", - "dst_symbol_id": null, - "dst_ref": "plba.create_runtime", - "resolution": "partial", - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_runtime.py", - "content": "test_public_plba_package_exports_runtime_builder_and_worker_contract calls create_runtime", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_public_plba_package_exports_runtime_builder_and_worker_contract:calls", - "span_start": 399, - "span_end": 399, - "lexical_rank": 6, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "039939355230de826d8bf7607f55fc59c7d932e5570ecb78994d0f13e57e8488", - "edge_type": "calls", - "src_symbol_id": "ed06ffc5afb8a863cf7da3e40921f17abe4eec2a0770139e3380d93ccaae604a", - "src_qname": "test_public_plba_package_exports_runtime_builder_and_worker_contract", - "dst_symbol_id": null, - "dst_ref": "create_runtime", - "resolution": "partial", - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "test_worker_wakes_up_with_configured_interval\n -> ScenarioWorker\n -> ScenarioWorker.__init__\n -> ScenarioWorker._name\n -> ScenarioWorker.name", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_worker_wakes_up_with_configured_interval:dataflow_slice", - "span_start": 52, - "span_end": 166, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 5, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "2fd137f5852febe907f44d3b3e4ea430f89ccfe962ae1442a16ab9df64c8f76c", - "edge_type": "dataflow_slice", - "src_symbol_id": "65f877f78191d65e6a752e41cedc70ebc784c266804a55c1c56440336e1f0d6e", - "src_qname": "test_worker_wakes_up_with_configured_interval", - "dst_symbol_id": "da022da2c49fd9cfd09d6e6da6bbd59aaa7d28efd669ce8444e88d327ddec2fc", - "dst_ref": "ScenarioWorker.name", - "resolution": "resolved", - "slice_id": "2fd137f5852febe907f44d3b3e4ea430f89ccfe962ae1442a16ab9df64c8f76c", - "root_symbol_id": "65f877f78191d65e6a752e41cedc70ebc784c266804a55c1c56440336e1f0d6e", - "path_symbols": [ - "test_worker_wakes_up_with_configured_interval", - "ScenarioWorker", - "ScenarioWorker.__init__", - "ScenarioWorker._name", - "ScenarioWorker.name" - ], - "path_symbol_ids": [ - "65f877f78191d65e6a752e41cedc70ebc784c266804a55c1c56440336e1f0d6e", - "9a1d08a7eb1831c9f2e0db361b5207f036e477c160773ae08c0b287239785c52", - "9c20be046ba06644d1432e0f20eb223663d2b116ee7d91fdc62bc68323f2e593", - "da022da2c49fd9cfd09d6e6da6bbd59aaa7d28efd669ce8444e88d327ddec2fc" - ], - "path_edge_types": [ - "instantiates", - "writes_attr", - "reads_attr" - ], - "path_length": 5, - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "test_actions_stop_busy_worker_after_timeout\n -> BlockingRoutine\n -> BlockingRoutine.__init__\n -> BlockingRoutine._started\n -> BlockingRoutine.run", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_actions_stop_busy_worker_after_timeout:dataflow_slice", - "span_start": 42, - "span_end": 238, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 5, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "8e7db3d2a9226f1c1d9942ac6373cfcafa0d2276758ddb8a3d3c455a3d58024d", - "edge_type": "dataflow_slice", - "src_symbol_id": "66392d3222421d9ba16eda3554940b16e7d5a6f33aa08c5738d35af2e32f1e4a", - "src_qname": "test_actions_stop_busy_worker_after_timeout", - "dst_symbol_id": "d9841bdbb69706c988ae7ae6adf89928dc4fae45943f74064f5382177034ba04", - "dst_ref": "BlockingRoutine.run", - "resolution": "resolved", - "slice_id": "8e7db3d2a9226f1c1d9942ac6373cfcafa0d2276758ddb8a3d3c455a3d58024d", - "root_symbol_id": "66392d3222421d9ba16eda3554940b16e7d5a6f33aa08c5738d35af2e32f1e4a", - "path_symbols": [ - "test_actions_stop_busy_worker_after_timeout", - "BlockingRoutine", - "BlockingRoutine.__init__", - "BlockingRoutine._started", - "BlockingRoutine.run" - ], - "path_symbol_ids": [ - "66392d3222421d9ba16eda3554940b16e7d5a6f33aa08c5738d35af2e32f1e4a", - "a3349c5bc65e4003a4bbd6a8dbb7a54c337e12d1aed930caa701b12e520f1e67", - "486deeed3043c6db985aef258e96ddc67aa53608e67a83962fbd2471f649ddf1", - "d9841bdbb69706c988ae7ae6adf89928dc4fae45943f74064f5382177034ba04" - ], - "path_edge_types": [ - "instantiates", - "writes_attr", - "reads_attr" - ], - "path_length": 5, - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "test_actions_stop_busy_worker_after_timeout\n -> BlockingRoutine\n -> BlockingRoutine.__init__\n -> BlockingRoutine._release\n -> BlockingRoutine.run", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_actions_stop_busy_worker_after_timeout:dataflow_slice", - "span_start": 43, - "span_end": 238, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 5, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "b59da9da82f9dfc8a9b695a08213786385da1ae9e17561ec3a0450a574a8cb39", - "edge_type": "dataflow_slice", - "src_symbol_id": "66392d3222421d9ba16eda3554940b16e7d5a6f33aa08c5738d35af2e32f1e4a", - "src_qname": "test_actions_stop_busy_worker_after_timeout", - "dst_symbol_id": "d9841bdbb69706c988ae7ae6adf89928dc4fae45943f74064f5382177034ba04", - "dst_ref": "BlockingRoutine.run", - "resolution": "resolved", - "slice_id": "b59da9da82f9dfc8a9b695a08213786385da1ae9e17561ec3a0450a574a8cb39", - "root_symbol_id": "66392d3222421d9ba16eda3554940b16e7d5a6f33aa08c5738d35af2e32f1e4a", - "path_symbols": [ - "test_actions_stop_busy_worker_after_timeout", - "BlockingRoutine", - "BlockingRoutine.__init__", - "BlockingRoutine._release", - "BlockingRoutine.run" - ], - "path_symbol_ids": [ - "66392d3222421d9ba16eda3554940b16e7d5a6f33aa08c5738d35af2e32f1e4a", - "a3349c5bc65e4003a4bbd6a8dbb7a54c337e12d1aed930caa701b12e520f1e67", - "486deeed3043c6db985aef258e96ddc67aa53608e67a83962fbd2471f649ddf1", - "d9841bdbb69706c988ae7ae6adf89928dc4fae45943f74064f5382177034ba04" - ], - "path_edge_types": [ - "instantiates", - "writes_attr", - "reads_attr" - ], - "path_length": 5, - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "test_actions_stop_busy_worker_before_timeout\n -> BlockingRoutine\n -> BlockingRoutine.__init__\n -> BlockingRoutine._started\n -> BlockingRoutine.run", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_actions_stop_busy_worker_before_timeout:dataflow_slice", - "span_start": 42, - "span_end": 212, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 5, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "f9bcce108870e49afa8b32d4625115a10707a3b0e7473179e958e5752bf258b4", - "edge_type": "dataflow_slice", - "src_symbol_id": "a0bb116ca9d909c93a285667ae033fbd1859b2dad7cf34fcb44816393ef6909c", - "src_qname": "test_actions_stop_busy_worker_before_timeout", - "dst_symbol_id": "d9841bdbb69706c988ae7ae6adf89928dc4fae45943f74064f5382177034ba04", - "dst_ref": "BlockingRoutine.run", - "resolution": "resolved", - "slice_id": "f9bcce108870e49afa8b32d4625115a10707a3b0e7473179e958e5752bf258b4", - "root_symbol_id": "a0bb116ca9d909c93a285667ae033fbd1859b2dad7cf34fcb44816393ef6909c", - "path_symbols": [ - "test_actions_stop_busy_worker_before_timeout", - "BlockingRoutine", - "BlockingRoutine.__init__", - "BlockingRoutine._started", - "BlockingRoutine.run" - ], - "path_symbol_ids": [ - "a0bb116ca9d909c93a285667ae033fbd1859b2dad7cf34fcb44816393ef6909c", - "a3349c5bc65e4003a4bbd6a8dbb7a54c337e12d1aed930caa701b12e520f1e67", - "486deeed3043c6db985aef258e96ddc67aa53608e67a83962fbd2471f649ddf1", - "d9841bdbb69706c988ae7ae6adf89928dc4fae45943f74064f5382177034ba04" - ], - "path_edge_types": [ - "instantiates", - "writes_attr", - "reads_attr" - ], - "path_length": 5, - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_runtime.py", - "content": "def test_public_plba_package_exports_runtime_builder_and_worker_contract(tmp_path) -> None:\n import plba\n from plba import ApplicationModule as PublicApplicationModule\n from plba import InMemoryTaskQueue\n from plba import Worker as PublicWorker\n from plba import WorkerHealth as PublicWorkerHealth\n from plba import WorkerStatus as PublicWorkerStatus\n from plba import create_runtime\n\n config_path = tmp_path / \"config.yml\"\n config_path.write_text(\"platform: {}\\n\", encoding=\"utf-8\")\n\n queue = InMemoryTaskQueue[int]()\n queue.put(2)\n assert queue.get(timeout=0.01) == 2\n queue.task_done()\n\n class PublicRoutine:\n def __init__(self) -> None:\n self.runs = 0\n\n def run(self) -> None:\n if self.runs == 0:\n self.runs += 1\n\n class PublicWorkerImpl(PublicWorker):\n def __init__(self, routine: PublicRoutine) -> None:\n self._inner = RoutineWorker(\"public-worker\", routine)\n\n @property\n def name(self) -> str:\n return self._inner.name\n\n @property\n def critical(self) -> bool:\n return self._inner.critical\n\n def start(self) -> None:\n self._inner.start()\n\n def stop(self, force: bool = False) -> None:\n self._inner.stop(force=force)\n\n def health(self) -> PublicWorkerHealth:\n return self._inner.health()\n\n def status(self) -> PublicWorkerStatus:\n return self._inner.status()\n\n class PublicExampleModule(PublicApplicationModule):\n @property\n def name(self) -> str:\n return \"public-example\"\n\n def register(self, registry: ModuleRegistry) -> None:\n registry.add_worker(PublicWorkerImpl(PublicRoutine()))\n\n runtime = create_runtime(PublicExampleModule(), config_path=str(config_path))\n runtime.start()\n sleep(0.2)\n assert runtime.configuration.get() == {\"platform\": {}}\n assert runtime.status()[\"workers\"][\"registered\"] == 1\n assert hasattr(plba, \"QueueWorker\") is False\n runtime.stop()", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_runtime.py:test_public_plba_package_exports_runtime_builder_and_worker_contract", - "span_start": 342, - "span_end": 405, - "lexical_rank": 6, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 13, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_runtime", - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "def _build_runtime(worker: Worker, *, control_timeout: int = 1) -> tuple[RuntimeManager, str]:\n runtime = RuntimeManager()\n channel = HttpControlChannel(host=\"127.0.0.1\", port=0, timeout=control_timeout)\n runtime.control_plane.register_channel(channel)\n runtime.register_module(WorkerModule(worker))\n runtime.start()\n return runtime, f\"http://127.0.0.1:{channel.port}\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:_build_runtime", - "span_start": 154, - "span_end": 160, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 6, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "class IntervalRoutine:\n calls: list[float] = field(default_factory=list)\n _lock: Lock = field(default_factory=Lock)\n\n def run(self) -> None:\n with self._lock:\n self.calls.append(monotonic())\n\n def wait_runs(self, count: int, timeout: float) -> bool:\n deadline = monotonic() + timeout\n while monotonic() < deadline:\n with self._lock:\n if len(self.calls) >= count:\n return True\n sleep(0.01)\n return False\n\n def deltas(self) -> list[float]:\n with self._lock:\n return [self.calls[index + 1] - self.calls[index] for index in range(len(self.calls) - 1)]", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:IntervalRoutine", - "span_start": 18, - "span_end": 37, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "class ScenarioWorker(Worker):\n def __init__(self, name: str, routine: object, *, interval: float = 0.05) -> None:\n self._name = name\n self._routine = routine\n self._interval = interval\n self._thread: Thread | None = None\n self._stop_requested = Event()\n self._in_flight = 0\n self._runs = 0\n self._lock = Lock()\n\n @property\n def name(self) -> str:\n return self._name\n\n @property\n def critical(self) -> bool:\n return True\n\n def start(self) -> None:\n if self._thread is not None and self._thread.is_alive():\n return\n self._stop_requested.clear()\n self._thread = Thread(target=self._loop, name=f\"{self._name}-thread\", daemon=True)\n self._thread.start()\n\n def stop(self, force: bool = False) -> None:\n self._stop_requested.set()\n\n def health(self) -> WorkerHealth:\n return WorkerHealth(name=self.name, status=\"ok\", critical=True, meta={\"runs\": self._runs})\n\n def status(self) -> WorkerStatus:\n thread_alive = self._thread is not None and self._thread.is_alive()\n with self._lock:\n in_flight = self._in_flight\n runs = self._runs\n if not thread_alive:\n state = \"stopped\"\n elif self._stop_requested.is_set():\n state = \"stopping\"\n elif in_flight > 0:\n state = \"busy\"\n else:\n state = \"idle\"\n return WorkerStatus(name=self.name, state=state, in_flight=in_flight, meta={\"runs\": runs})\n\n def _loop(self) -> None:\n while not self._stop_requested.is_set():\n with self._lock:\n self._in_flight += 1\n try:\n self._routine.run()\n with self._lock:\n self._runs += 1\n finally:\n with self._lock:\n self._in_flight -= 1\n if self._stop_requested.is_set():\n return\n sleep(self._interval)", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:ScenarioWorker", - "span_start": 50, - "span_end": 110, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 2, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "def _http_call_json(\n base_url: str,\n path: str,\n *,\n method: str = \"GET\",\n headers: dict[str, str] | None = None,\n) -> tuple[int, dict[str, object]]:\n request = Request(f\"{base_url}{path}\", method=method, headers=headers or {})\n try:\n with urlopen(request, timeout=15.0) as response:\n status = response.status\n body = response.read()\n except HTTPError as error:\n status = error.code\n body = error.read()\n payload = json.loads(body.decode(\"utf-8\"))\n return status, payload", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:_http_call_json", - "span_start": 125, - "span_end": 141, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 4, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "def _poll_until_stopped(base_url: str, timeout: float = 2.0) -> bool:\n deadline = monotonic() + timeout\n while monotonic() < deadline:\n _, payload = _http_call_json(base_url, \"/actions/status\")\n if payload.get(\"detail\") == \"stopped\":\n return True\n sleep(0.05)\n return False", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:_poll_until_stopped", - "span_start": 144, - "span_end": 151, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 5, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "def test_worker_wakes_up_with_configured_interval() -> None:\n interval = 0.15\n routine = IntervalRoutine()\n worker = ScenarioWorker(\"interval-worker\", routine, interval=interval)\n runtime = RuntimeManager()\n runtime.register_module(WorkerModule(worker))\n\n runtime.start()\n try:\n assert routine.wait_runs(count=3, timeout=2.0) is True\n finally:\n runtime.stop()\n\n deltas = routine.deltas()\n assert len(deltas) >= 2\n assert all(delta >= interval * 0.7 for delta in deltas[:2])", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:test_worker_wakes_up_with_configured_interval", - "span_start": 163, - "span_end": 178, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 7, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "class WorkerModule(ApplicationModule):\n def __init__(self, worker: Worker) -> None:\n self._worker = worker\n\n @property\n def name(self) -> str:\n return \"business-tests\"\n\n def register(self, registry: ModuleRegistry) -> None:\n registry.add_worker(self._worker)", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:WorkerModule", - "span_start": 113, - "span_end": 122, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 3, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "class BlockingRoutine:\n def __init__(self, started: Event, release: Event) -> None:\n self._started = started\n self._release = release\n\n def run(self) -> None:\n self._started.set()\n self._release.wait(timeout=5.0)", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:BlockingRoutine", - "span_start": 40, - "span_end": 47, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 1, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "def test_actions_start_stop_and_health_when_worker_is_idle() -> None:\n runtime, base_url = _build_runtime(ScenarioWorker(\"idle-worker\", IntervalRoutine(), interval=0.2))\n try:\n stop_status, stop_payload = _http_call_json(base_url, \"/actions/stop\", method=\"POST\")\n assert stop_status == 200\n assert isinstance(stop_payload.get(\"detail\"), dict)\n assert stop_payload[\"detail\"][\"timed_out\"] is False\n assert stop_payload[\"detail\"][\"state\"] == \"stopped\"\n\n health_stopped_status, health_stopped_payload = _http_call_json(base_url, \"/health\")\n assert health_stopped_status == 503\n assert health_stopped_payload[\"state\"] == \"stopped\"\n assert health_stopped_payload[\"status\"] == \"unhealthy\"\n\n start_status, start_payload = _http_call_json(base_url, \"/actions/start\", method=\"POST\")\n assert start_status == 200\n assert isinstance(start_payload.get(\"detail\"), dict)\n assert start_payload[\"detail\"][\"timed_out\"] is False\n assert start_payload[\"detail\"][\"state\"] in {\"idle\", \"busy\"}\n\n health_started_status, health_started_payload = _http_call_json(base_url, \"/health\")\n assert health_started_status == 200\n assert health_started_payload[\"status\"] == \"ok\"\n assert health_started_payload[\"state\"] in {\"idle\", \"busy\"}\n finally:\n runtime.stop()", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:test_actions_start_stop_and_health_when_worker_is_idle", - "span_start": 181, - "span_end": 206, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 8, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ] - }, - "diagnostics": { - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C0_SOURCE_CHUNKS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C0_SOURCE_CHUNKS": 10 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [], - "include_globs": [ - "src", - "tests" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests" - ] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src", - "tests" - ], - "include_globs": [ - "src", - "tests" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests" - ] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src", - "tests" - ], - "include_globs": [ - "src", - "tests" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests" - ] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "create_runtime", - "path_scope": [], - "include_globs": [ - "src/**", - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "Где тесты для create_runtime? test_create_runtime Testcreate_runtime create_runtime", - "path_scope": [], - "include_globs": [ - "src/**", - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "top_k": 6, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Где тесты для create_runtime? test_create_runtime Testcreate_runtime create_runtime", - "path_scope": [], - "include_globs": [ - "src/**", - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "top_k": 10, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [], - "normalized_include_globs": [ - "src", - "tests" - ], - "normalized_exclude_globs": [], - "normalized_prefer_globs": [ - "tests" - ], - "filter_stage": "post_rank", - "candidates_before_filter": 0, - "candidates_after_filter": 0 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src", - "tests" - ], - "normalized_include_globs": [ - "src", - "tests" - ], - "normalized_exclude_globs": [], - "normalized_prefer_globs": [ - "tests" - ], - "filter_stage": "post_rank", - "candidates_before_filter": 6, - "candidates_after_filter": 6 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src", - "tests" - ], - "normalized_include_globs": [ - "src", - "tests" - ], - "normalized_exclude_globs": [], - "normalized_prefer_globs": [ - "tests" - ], - "filter_stage": "post_rank", - "candidates_before_filter": 10, - "candidates_after_filter": 10 - } - ], - "fallback": { - "used": true, - "reason": "scope_relaxed_no_hits" - }, - "symbol_resolution": { - "status": "not_found", - "resolved_symbol": null, - "alternatives": [ - "create_runtime" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "miss", - "hit_count": 0, - "fail_reason": "scope_relaxed_no_hits" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 6, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 10, - "fail_reason": null - } - ] - }, - "constraint_violations": [ - { - "type": "LAYER_MISSING", - "severity": "warn", - "details": { - "layer": "C1_SYMBOL_CATALOG", - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ] - }, - "suggested_fix": "Increase top_k for this layer or relax constraints for retrieval." - } - ], - "timings_ms": { - "symbol_resolution": 0, - "retrieval_total": 145, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 66, - "C2_DEPENDENCY_GRAPH": 60, - "C0_SOURCE_CHUNKS": 18 - }, - "merge_rank": 0 - } - } - }, - { - "step": "llm_answer", - "input": { - "query": "Где тесты для create_runtime?", - "rag_count": 16 - }, - "output": { - "llm_answer": "Прямых тестов конкретно для функции `create_runtime` в предоставленном контексте не обнаружено." - }, - "diagnostics": { - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 1022, - "evidence_rows": 16, - "evidence_chars": 9185 - }, - "evidence_summary": [ - { - "layer": "C2_DEPENDENCY_GRAPH", - "count": 6, - "unique_paths": 2 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 10, - "unique_paths": 2 - } - ], - "prompt_template_id": "intent_code_qa_find_tests_ru_v4", - "system_prompt_version": "v1" - }, - "timings_ms": { - "prompt_build": 0, - "llm_call": 1465 - } - } - } - ] - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_143856/full_chain_plba_code_subintents_v2_plba-v2-find-tests-create-runtime.md b/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_143856/full_chain_plba_code_subintents_v2_plba-v2-find-tests-create-runtime.md deleted file mode 100644 index 84fc128..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_143856/full_chain_plba_code_subintents_v2_plba-v2-find-tests-create-runtime.md +++ /dev/null @@ -1,32 +0,0 @@ -# plba-v2-find-tests-create-runtime - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_subintents_v2.yaml -- runner: runtime -- mode: full_chain -- passed: True - -## Query -Где тесты для create_runtime? - -## Actual -{ - "intent": "CODE_QA", - "sub_intent": "FIND_TESTS", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 16, - "llm_answer": "Прямых тестов конкретно для функции `create_runtime` в предоставленном контексте не обнаружено.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "create_runtime" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ] -} - -## Mismatches -- none \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_143856/full_chain_plba_code_subintents_v2_plba-v2-find-tests-runtime-manager.json b/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_143856/full_chain_plba_code_subintents_v2_plba-v2-find-tests-runtime-manager.json deleted file mode 100644 index 9ee6f7f..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_143856/full_chain_plba_code_subintents_v2_plba-v2-find-tests-runtime-manager.json +++ /dev/null @@ -1,1879 +0,0 @@ -{ - "case_id": "plba-v2-find-tests-runtime-manager", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_subintents_v2.yaml", - "runner": "runtime", - "mode": "full_chain", - "actual": { - "intent": "CODE_QA", - "sub_intent": "FIND_TESTS", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 16, - "llm_answer": "Прямые тесты для RuntimeManager находятся в следующих файлах:\n\n1. tests/test_runtime.py:\n - test_runtime_graceful_stop_waits_until_worker_finishes — проверяет корректную остановку RuntimeManager после завершения работы модуля.\n - test_runtime_runs_worker_routine_and_exposes_status — проверяет запуск рутины модуля и отображение статуса RuntimeManager.\n\nТакже косвенно связан тест:\n\n2. tests/test_business_control_actions.py:\n - _build_runtime — использует RuntimeManager при построении бизнес-контроля.\n - test_worker_wakes_up_with_configured_interval — применяет RuntimeManager для тестирования пробуждения рабочего процесса с заданной периодичностью.\n\nЭти тесты покрывают инициализацию, регистрацию модулей, управление состоянием и остановкой RuntimeManager.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "RuntimeManager" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ] - }, - "passed": true, - "mismatches": [], - "details": { - "case_id": "plba-v2-find-tests-runtime-manager", - "text": "Где тесты для RuntimeManager?", - "mode": "full_chain", - "run_started_at": "2026-03-12T14:38:57", - "rag_session_id": "7d11da21-faa0-4cea-aede-aeabe069164c", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Где тесты для RuntimeManager?", - "symbol_resolution": { - "status": "not_found", - "resolved_symbol": null, - "alternatives": [ - "RuntimeManager" - ], - "confidence": 0.0 - }, - "rag_count": 16, - "rag_rows": [ - { - "path": "tests/test_runtime.py", - "content": "test_runtime_runs_worker_routine_and_exposes_status instantiates RuntimeManager", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_runtime_runs_worker_routine_and_exposes_status:instantiates", - "span_start": 209, - "span_end": 209, - "lexical_rank": 6, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "c397a308e7824ba9fe400a754c7e15e66ea6f058d7f5d3e82bb002bb78b509d2", - "edge_type": "instantiates", - "src_symbol_id": "1c767eb5ee08e84f45b18c8ed7531ec0ed73c63fb1594823569672db7b21e992", - "src_qname": "test_runtime_runs_worker_routine_and_exposes_status", - "dst_symbol_id": "aeadc039653807b0da1ca6e3cc1078ee61cfc510b28e7f9c2ec04c59da43cc8d", - "dst_ref": "RuntimeManager", - "resolution": "resolved", - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_runtime.py", - "content": "test_runtime_graceful_stop_waits_until_worker_finishes instantiates RuntimeManager", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_runtime_graceful_stop_waits_until_worker_finishes:instantiates", - "span_start": 229, - "span_end": 229, - "lexical_rank": 6, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "76b4701262ccaa0a7a41691407c4ebdb2ca74a2415d89f0a38ef0d4f608bda93", - "edge_type": "instantiates", - "src_symbol_id": "1076e788e4a03b10d7bc1313a8ad46caa170c13cc026c6e4de994af1a6ae57bf", - "src_qname": "test_runtime_graceful_stop_waits_until_worker_finishes", - "dst_symbol_id": "aeadc039653807b0da1ca6e3cc1078ee61cfc510b28e7f9c2ec04c59da43cc8d", - "dst_ref": "RuntimeManager", - "resolution": "resolved", - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "_build_runtime instantiates RuntimeManager", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "_build_runtime:instantiates", - "span_start": 155, - "span_end": 155, - "lexical_rank": 6, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "7eb254d564944bab6272757ee5ef688862bd321e6941e2495dc942e03b1c9a25", - "edge_type": "instantiates", - "src_symbol_id": "db94031d5245bf82be836a109b4584b43b8e83d37a0f318e03f6c8191896d469", - "src_qname": "_build_runtime", - "dst_symbol_id": "a1572ea8183dc0cd6ddbc74342bbde8c28cecfde37ad40b62feff09f8d103d11", - "dst_ref": "RuntimeManager", - "resolution": "resolved", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "test_worker_wakes_up_with_configured_interval instantiates RuntimeManager", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_worker_wakes_up_with_configured_interval:instantiates", - "span_start": 167, - "span_end": 167, - "lexical_rank": 6, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "189aafc4de0b79c688668f25f0c87166a127df26bd2215452014713b65ef281a", - "edge_type": "instantiates", - "src_symbol_id": "65f877f78191d65e6a752e41cedc70ebc784c266804a55c1c56440336e1f0d6e", - "src_qname": "test_worker_wakes_up_with_configured_interval", - "dst_symbol_id": "a1572ea8183dc0cd6ddbc74342bbde8c28cecfde37ad40b62feff09f8d103d11", - "dst_ref": "RuntimeManager", - "resolution": "resolved", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "test_actions_stop_busy_worker_after_timeout\n -> BlockingRoutine\n -> BlockingRoutine.__init__\n -> BlockingRoutine._started\n -> BlockingRoutine.run", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_actions_stop_busy_worker_after_timeout:dataflow_slice", - "span_start": 42, - "span_end": 238, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 5, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "8e7db3d2a9226f1c1d9942ac6373cfcafa0d2276758ddb8a3d3c455a3d58024d", - "edge_type": "dataflow_slice", - "src_symbol_id": "66392d3222421d9ba16eda3554940b16e7d5a6f33aa08c5738d35af2e32f1e4a", - "src_qname": "test_actions_stop_busy_worker_after_timeout", - "dst_symbol_id": "d9841bdbb69706c988ae7ae6adf89928dc4fae45943f74064f5382177034ba04", - "dst_ref": "BlockingRoutine.run", - "resolution": "resolved", - "slice_id": "8e7db3d2a9226f1c1d9942ac6373cfcafa0d2276758ddb8a3d3c455a3d58024d", - "root_symbol_id": "66392d3222421d9ba16eda3554940b16e7d5a6f33aa08c5738d35af2e32f1e4a", - "path_symbols": [ - "test_actions_stop_busy_worker_after_timeout", - "BlockingRoutine", - "BlockingRoutine.__init__", - "BlockingRoutine._started", - "BlockingRoutine.run" - ], - "path_symbol_ids": [ - "66392d3222421d9ba16eda3554940b16e7d5a6f33aa08c5738d35af2e32f1e4a", - "a3349c5bc65e4003a4bbd6a8dbb7a54c337e12d1aed930caa701b12e520f1e67", - "486deeed3043c6db985aef258e96ddc67aa53608e67a83962fbd2471f649ddf1", - "d9841bdbb69706c988ae7ae6adf89928dc4fae45943f74064f5382177034ba04" - ], - "path_edge_types": [ - "instantiates", - "writes_attr", - "reads_attr" - ], - "path_length": 5, - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "test_actions_stop_busy_worker_before_timeout\n -> BlockingRoutine\n -> BlockingRoutine.__init__\n -> BlockingRoutine._release\n -> BlockingRoutine.run", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_actions_stop_busy_worker_before_timeout:dataflow_slice", - "span_start": 43, - "span_end": 212, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 5, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "8bd726155ba387d3579763ee84dfd2f9a90bc917da88f3b2e89416ab5c1254d6", - "edge_type": "dataflow_slice", - "src_symbol_id": "a0bb116ca9d909c93a285667ae033fbd1859b2dad7cf34fcb44816393ef6909c", - "src_qname": "test_actions_stop_busy_worker_before_timeout", - "dst_symbol_id": "d9841bdbb69706c988ae7ae6adf89928dc4fae45943f74064f5382177034ba04", - "dst_ref": "BlockingRoutine.run", - "resolution": "resolved", - "slice_id": "8bd726155ba387d3579763ee84dfd2f9a90bc917da88f3b2e89416ab5c1254d6", - "root_symbol_id": "a0bb116ca9d909c93a285667ae033fbd1859b2dad7cf34fcb44816393ef6909c", - "path_symbols": [ - "test_actions_stop_busy_worker_before_timeout", - "BlockingRoutine", - "BlockingRoutine.__init__", - "BlockingRoutine._release", - "BlockingRoutine.run" - ], - "path_symbol_ids": [ - "a0bb116ca9d909c93a285667ae033fbd1859b2dad7cf34fcb44816393ef6909c", - "a3349c5bc65e4003a4bbd6a8dbb7a54c337e12d1aed930caa701b12e520f1e67", - "486deeed3043c6db985aef258e96ddc67aa53608e67a83962fbd2471f649ddf1", - "d9841bdbb69706c988ae7ae6adf89928dc4fae45943f74064f5382177034ba04" - ], - "path_edge_types": [ - "instantiates", - "writes_attr", - "reads_attr" - ], - "path_length": 5, - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_runtime.py", - "content": "def test_runtime_graceful_stop_waits_until_worker_finishes() -> None:\n started = Event()\n release = Event()\n runtime = RuntimeManager()\n runtime.register_module(BlockingModule(started, release))\n runtime.start()\n assert started.wait(timeout=1.0) is True\n assert runtime.status()[\"runtime\"][\"state\"] == \"busy\"\n\n stop_thread = Thread(target=runtime.stop, kwargs={\"timeout\": 1.0}, daemon=True)\n stop_thread.start()\n sleep(0.1)\n assert stop_thread.is_alive() is True\n\n release.set()\n stop_thread.join(timeout=1.0)\n assert stop_thread.is_alive() is False\n assert runtime.status()[\"runtime\"][\"state\"] == \"stopped\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_runtime.py:test_runtime_graceful_stop_waits_until_worker_finishes", - "span_start": 226, - "span_end": 243, - "lexical_rank": 6, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 8, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_runtime", - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_runtime.py", - "content": "def test_runtime_runs_worker_routine_and_exposes_status(tmp_path) -> None:\n config_path = tmp_path / \"config.yml\"\n config_path.write_text(\n \"\"\"\nplatform:\n workers: 1\nlog:\n version: 1\n disable_existing_loggers: false\n handlers:\n console:\n class: logging.StreamHandler\n root:\n level: INFO\n handlers: [console]\n\"\"\".strip(),\n encoding=\"utf-8\",\n )\n runtime = RuntimeManager()\n runtime.add_config_file(config_path)\n module = ExampleModule()\n runtime.register_module(module)\n\n runtime.start()\n sleep(0.2)\n status = runtime.status()\n runtime.stop()\n\n assert module.routine.processed == [{\"id\": 1}]\n assert status[\"modules\"] == [\"example\"]\n assert status[\"runtime\"][\"state\"] == \"idle\"\n assert status[\"health\"][\"status\"] == \"ok\"\n assert status[\"config\"] == {\"platform\": {\"workers\": 1}, \"log\": status[\"config\"][\"log\"]}", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_runtime.py:test_runtime_runs_worker_routine_and_exposes_status", - "span_start": 191, - "span_end": 223, - "lexical_rank": 6, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 7, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_runtime", - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "def _build_runtime(worker: Worker, *, control_timeout: int = 1) -> tuple[RuntimeManager, str]:\n runtime = RuntimeManager()\n channel = HttpControlChannel(host=\"127.0.0.1\", port=0, timeout=control_timeout)\n runtime.control_plane.register_channel(channel)\n runtime.register_module(WorkerModule(worker))\n runtime.start()\n return runtime, f\"http://127.0.0.1:{channel.port}\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:_build_runtime", - "span_start": 154, - "span_end": 160, - "lexical_rank": 6, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 6, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "def test_worker_wakes_up_with_configured_interval() -> None:\n interval = 0.15\n routine = IntervalRoutine()\n worker = ScenarioWorker(\"interval-worker\", routine, interval=interval)\n runtime = RuntimeManager()\n runtime.register_module(WorkerModule(worker))\n\n runtime.start()\n try:\n assert routine.wait_runs(count=3, timeout=2.0) is True\n finally:\n runtime.stop()\n\n deltas = routine.deltas()\n assert len(deltas) >= 2\n assert all(delta >= interval * 0.7 for delta in deltas[:2])", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:test_worker_wakes_up_with_configured_interval", - "span_start": 163, - "span_end": 178, - "lexical_rank": 6, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 7, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "class BlockingRoutine:\n def __init__(self, started: Event, release: Event) -> None:\n self._started = started\n self._release = release\n\n def run(self) -> None:\n self._started.set()\n self._release.wait(timeout=5.0)", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:BlockingRoutine", - "span_start": 40, - "span_end": 47, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 1, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "class ScenarioWorker(Worker):\n def __init__(self, name: str, routine: object, *, interval: float = 0.05) -> None:\n self._name = name\n self._routine = routine\n self._interval = interval\n self._thread: Thread | None = None\n self._stop_requested = Event()\n self._in_flight = 0\n self._runs = 0\n self._lock = Lock()\n\n @property\n def name(self) -> str:\n return self._name\n\n @property\n def critical(self) -> bool:\n return True\n\n def start(self) -> None:\n if self._thread is not None and self._thread.is_alive():\n return\n self._stop_requested.clear()\n self._thread = Thread(target=self._loop, name=f\"{self._name}-thread\", daemon=True)\n self._thread.start()\n\n def stop(self, force: bool = False) -> None:\n self._stop_requested.set()\n\n def health(self) -> WorkerHealth:\n return WorkerHealth(name=self.name, status=\"ok\", critical=True, meta={\"runs\": self._runs})\n\n def status(self) -> WorkerStatus:\n thread_alive = self._thread is not None and self._thread.is_alive()\n with self._lock:\n in_flight = self._in_flight\n runs = self._runs\n if not thread_alive:\n state = \"stopped\"\n elif self._stop_requested.is_set():\n state = \"stopping\"\n elif in_flight > 0:\n state = \"busy\"\n else:\n state = \"idle\"\n return WorkerStatus(name=self.name, state=state, in_flight=in_flight, meta={\"runs\": runs})\n\n def _loop(self) -> None:\n while not self._stop_requested.is_set():\n with self._lock:\n self._in_flight += 1\n try:\n self._routine.run()\n with self._lock:\n self._runs += 1\n finally:\n with self._lock:\n self._in_flight -= 1\n if self._stop_requested.is_set():\n return\n sleep(self._interval)", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:ScenarioWorker", - "span_start": 50, - "span_end": 110, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 2, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "class WorkerModule(ApplicationModule):\n def __init__(self, worker: Worker) -> None:\n self._worker = worker\n\n @property\n def name(self) -> str:\n return \"business-tests\"\n\n def register(self, registry: ModuleRegistry) -> None:\n registry.add_worker(self._worker)", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:WorkerModule", - "span_start": 113, - "span_end": 122, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 3, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "def _http_call_json(\n base_url: str,\n path: str,\n *,\n method: str = \"GET\",\n headers: dict[str, str] | None = None,\n) -> tuple[int, dict[str, object]]:\n request = Request(f\"{base_url}{path}\", method=method, headers=headers or {})\n try:\n with urlopen(request, timeout=15.0) as response:\n status = response.status\n body = response.read()\n except HTTPError as error:\n status = error.code\n body = error.read()\n payload = json.loads(body.decode(\"utf-8\"))\n return status, payload", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:_http_call_json", - "span_start": 125, - "span_end": 141, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 4, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "class IntervalRoutine:\n calls: list[float] = field(default_factory=list)\n _lock: Lock = field(default_factory=Lock)\n\n def run(self) -> None:\n with self._lock:\n self.calls.append(monotonic())\n\n def wait_runs(self, count: int, timeout: float) -> bool:\n deadline = monotonic() + timeout\n while monotonic() < deadline:\n with self._lock:\n if len(self.calls) >= count:\n return True\n sleep(0.01)\n return False\n\n def deltas(self) -> list[float]:\n with self._lock:\n return [self.calls[index + 1] - self.calls[index] for index in range(len(self.calls) - 1)]", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:IntervalRoutine", - "span_start": 18, - "span_end": 37, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "def _poll_until_stopped(base_url: str, timeout: float = 2.0) -> bool:\n deadline = monotonic() + timeout\n while monotonic() < deadline:\n _, payload = _http_call_json(base_url, \"/actions/status\")\n if payload.get(\"detail\") == \"stopped\":\n return True\n sleep(0.05)\n return False", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:_poll_until_stopped", - "span_start": 144, - "span_end": 151, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 5, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "llm_answer": "Прямые тесты для RuntimeManager находятся в следующих файлах:\n\n1. tests/test_runtime.py:\n - test_runtime_graceful_stop_waits_until_worker_finishes — проверяет корректную остановку RuntimeManager после завершения работы модуля.\n - test_runtime_runs_worker_routine_and_exposes_status — проверяет запуск рутины модуля и отображение статуса RuntimeManager.\n\nТакже косвенно связан тест:\n\n2. tests/test_business_control_actions.py:\n - _build_runtime — использует RuntimeManager при построении бизнес-контроля.\n - test_worker_wakes_up_with_configured_interval — применяет RuntimeManager для тестирования пробуждения рабочего процесса с заданной периодичностью.\n\nЭти тесты покрывают инициализацию, регистрацию модулей, управление состоянием и остановкой RuntimeManager.", - "summary": { - "router": { - "intent": "CODE_QA", - "sub_intent": "FIND_TESTS", - "confidence": null - }, - "retrieval": { - "profile": "code", - "layers_hit": [ - "C0_SOURCE_CHUNKS", - "C2_DEPENDENCY_GRAPH" - ], - "evidence_sufficient": true - }, - "llm": { - "answer_status": "answered", - "groundedness": "grounded" - } - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "FIND_TESTS", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "RuntimeManager" - ], - "keyword_hints": [ - "RuntimeManager" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**", - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "test_file_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "test_symbol_patterns": [ - "test_runtime_manager", - "TestRuntimeManager", - "RuntimeManager" - ], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C0_SOURCE_CHUNKS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C0_SOURCE_CHUNKS": 10 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [], - "include_globs": [ - "src", - "tests" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests" - ] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src", - "tests" - ], - "include_globs": [ - "src", - "tests" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests" - ] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src", - "tests" - ], - "include_globs": [ - "src", - "tests" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests" - ] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**", - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "Где тесты для RuntimeManager? test_runtime_manager TestRuntimeManager RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**", - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "top_k": 6, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Где тесты для RuntimeManager? test_runtime_manager TestRuntimeManager RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**", - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "top_k": 10, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [], - "normalized_include_globs": [ - "src", - "tests" - ], - "normalized_exclude_globs": [], - "normalized_prefer_globs": [ - "tests" - ], - "filter_stage": "post_rank", - "candidates_before_filter": 0, - "candidates_after_filter": 0 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src", - "tests" - ], - "normalized_include_globs": [ - "src", - "tests" - ], - "normalized_exclude_globs": [], - "normalized_prefer_globs": [ - "tests" - ], - "filter_stage": "post_rank", - "candidates_before_filter": 6, - "candidates_after_filter": 6 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src", - "tests" - ], - "normalized_include_globs": [ - "src", - "tests" - ], - "normalized_exclude_globs": [], - "normalized_prefer_globs": [ - "tests" - ], - "filter_stage": "post_rank", - "candidates_before_filter": 10, - "candidates_after_filter": 10 - } - ], - "fallback": { - "used": true, - "reason": "scope_relaxed_no_hits" - }, - "symbol_resolution": { - "status": "not_found", - "resolved_symbol": null, - "alternatives": [ - "RuntimeManager" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "miss", - "hit_count": 0, - "fail_reason": "scope_relaxed_no_hits" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 6, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 10, - "fail_reason": null - } - ] - }, - "constraint_violations": [ - { - "type": "LAYER_MISSING", - "severity": "warn", - "details": { - "layer": "C1_SYMBOL_CATALOG", - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ] - }, - "suggested_fix": "Increase top_k for this layer or relax constraints for retrieval." - } - ], - "timings_ms": { - "router": 0, - "symbol_resolution": 0, - "retrieval_total": 139, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 70, - "C2_DEPENDENCY_GRAPH": 50, - "C0_SOURCE_CHUNKS": 18 - }, - "merge_rank": 0, - "prompt_build": 0, - "llm_call": 1557 - }, - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 946, - "evidence_rows": 16, - "evidence_chars": 7086 - }, - "evidence_summary": [ - { - "layer": "C2_DEPENDENCY_GRAPH", - "count": 6, - "unique_paths": 2 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 10, - "unique_paths": 2 - } - ], - "prompt_template_id": "intent_code_qa_find_tests_ru_v4", - "system_prompt_version": "v1" - }, - "router": { - "conversation_mode": "START", - "keyword_hints": [ - "RuntimeManager" - ], - "path_scope": [] - }, - "llm": { - "used_evidence_count": 16, - "missing_evidence_reason": null - } - }, - "run_info": { - "case_id": "plba-v2-find-tests-runtime-manager", - "mode": "full_chain", - "run_started_at": "2026-03-12T14:38:57", - "rag_session_id": "7d11da21-faa0-4cea-aede-aeabe069164c", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - }, - "input_request": { - "text": "Где тесты для RuntimeManager?", - "normalized_query": "Где тесты для RuntimeManager?" - }, - "steps": [ - { - "step": "intent_router", - "input": { - "query": "Где тесты для RuntimeManager?" - }, - "output": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Где тесты для RuntimeManager?" - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "FIND_TESTS", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "RuntimeManager" - ], - "keyword_hints": [ - "RuntimeManager" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**", - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "test_file_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "test_symbol_patterns": [ - "test_runtime_manager", - "TestRuntimeManager", - "RuntimeManager" - ], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "timings_ms": { - "router": 0 - } - } - }, - { - "step": "retrieval", - "input": { - "query": "Где тесты для RuntimeManager?" - }, - "output": { - "symbol_resolution": { - "status": "not_found", - "resolved_symbol": null, - "alternatives": [ - "RuntimeManager" - ], - "confidence": 0.0 - }, - "rag_count": 16, - "rag_rows": [ - { - "path": "tests/test_runtime.py", - "content": "test_runtime_runs_worker_routine_and_exposes_status instantiates RuntimeManager", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_runtime_runs_worker_routine_and_exposes_status:instantiates", - "span_start": 209, - "span_end": 209, - "lexical_rank": 6, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "c397a308e7824ba9fe400a754c7e15e66ea6f058d7f5d3e82bb002bb78b509d2", - "edge_type": "instantiates", - "src_symbol_id": "1c767eb5ee08e84f45b18c8ed7531ec0ed73c63fb1594823569672db7b21e992", - "src_qname": "test_runtime_runs_worker_routine_and_exposes_status", - "dst_symbol_id": "aeadc039653807b0da1ca6e3cc1078ee61cfc510b28e7f9c2ec04c59da43cc8d", - "dst_ref": "RuntimeManager", - "resolution": "resolved", - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_runtime.py", - "content": "test_runtime_graceful_stop_waits_until_worker_finishes instantiates RuntimeManager", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_runtime_graceful_stop_waits_until_worker_finishes:instantiates", - "span_start": 229, - "span_end": 229, - "lexical_rank": 6, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "76b4701262ccaa0a7a41691407c4ebdb2ca74a2415d89f0a38ef0d4f608bda93", - "edge_type": "instantiates", - "src_symbol_id": "1076e788e4a03b10d7bc1313a8ad46caa170c13cc026c6e4de994af1a6ae57bf", - "src_qname": "test_runtime_graceful_stop_waits_until_worker_finishes", - "dst_symbol_id": "aeadc039653807b0da1ca6e3cc1078ee61cfc510b28e7f9c2ec04c59da43cc8d", - "dst_ref": "RuntimeManager", - "resolution": "resolved", - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "_build_runtime instantiates RuntimeManager", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "_build_runtime:instantiates", - "span_start": 155, - "span_end": 155, - "lexical_rank": 6, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "7eb254d564944bab6272757ee5ef688862bd321e6941e2495dc942e03b1c9a25", - "edge_type": "instantiates", - "src_symbol_id": "db94031d5245bf82be836a109b4584b43b8e83d37a0f318e03f6c8191896d469", - "src_qname": "_build_runtime", - "dst_symbol_id": "a1572ea8183dc0cd6ddbc74342bbde8c28cecfde37ad40b62feff09f8d103d11", - "dst_ref": "RuntimeManager", - "resolution": "resolved", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "test_worker_wakes_up_with_configured_interval instantiates RuntimeManager", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_worker_wakes_up_with_configured_interval:instantiates", - "span_start": 167, - "span_end": 167, - "lexical_rank": 6, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "189aafc4de0b79c688668f25f0c87166a127df26bd2215452014713b65ef281a", - "edge_type": "instantiates", - "src_symbol_id": "65f877f78191d65e6a752e41cedc70ebc784c266804a55c1c56440336e1f0d6e", - "src_qname": "test_worker_wakes_up_with_configured_interval", - "dst_symbol_id": "a1572ea8183dc0cd6ddbc74342bbde8c28cecfde37ad40b62feff09f8d103d11", - "dst_ref": "RuntimeManager", - "resolution": "resolved", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "test_actions_stop_busy_worker_after_timeout\n -> BlockingRoutine\n -> BlockingRoutine.__init__\n -> BlockingRoutine._started\n -> BlockingRoutine.run", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_actions_stop_busy_worker_after_timeout:dataflow_slice", - "span_start": 42, - "span_end": 238, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 5, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "8e7db3d2a9226f1c1d9942ac6373cfcafa0d2276758ddb8a3d3c455a3d58024d", - "edge_type": "dataflow_slice", - "src_symbol_id": "66392d3222421d9ba16eda3554940b16e7d5a6f33aa08c5738d35af2e32f1e4a", - "src_qname": "test_actions_stop_busy_worker_after_timeout", - "dst_symbol_id": "d9841bdbb69706c988ae7ae6adf89928dc4fae45943f74064f5382177034ba04", - "dst_ref": "BlockingRoutine.run", - "resolution": "resolved", - "slice_id": "8e7db3d2a9226f1c1d9942ac6373cfcafa0d2276758ddb8a3d3c455a3d58024d", - "root_symbol_id": "66392d3222421d9ba16eda3554940b16e7d5a6f33aa08c5738d35af2e32f1e4a", - "path_symbols": [ - "test_actions_stop_busy_worker_after_timeout", - "BlockingRoutine", - "BlockingRoutine.__init__", - "BlockingRoutine._started", - "BlockingRoutine.run" - ], - "path_symbol_ids": [ - "66392d3222421d9ba16eda3554940b16e7d5a6f33aa08c5738d35af2e32f1e4a", - "a3349c5bc65e4003a4bbd6a8dbb7a54c337e12d1aed930caa701b12e520f1e67", - "486deeed3043c6db985aef258e96ddc67aa53608e67a83962fbd2471f649ddf1", - "d9841bdbb69706c988ae7ae6adf89928dc4fae45943f74064f5382177034ba04" - ], - "path_edge_types": [ - "instantiates", - "writes_attr", - "reads_attr" - ], - "path_length": 5, - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "test_actions_stop_busy_worker_before_timeout\n -> BlockingRoutine\n -> BlockingRoutine.__init__\n -> BlockingRoutine._release\n -> BlockingRoutine.run", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_actions_stop_busy_worker_before_timeout:dataflow_slice", - "span_start": 43, - "span_end": 212, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 5, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "8bd726155ba387d3579763ee84dfd2f9a90bc917da88f3b2e89416ab5c1254d6", - "edge_type": "dataflow_slice", - "src_symbol_id": "a0bb116ca9d909c93a285667ae033fbd1859b2dad7cf34fcb44816393ef6909c", - "src_qname": "test_actions_stop_busy_worker_before_timeout", - "dst_symbol_id": "d9841bdbb69706c988ae7ae6adf89928dc4fae45943f74064f5382177034ba04", - "dst_ref": "BlockingRoutine.run", - "resolution": "resolved", - "slice_id": "8bd726155ba387d3579763ee84dfd2f9a90bc917da88f3b2e89416ab5c1254d6", - "root_symbol_id": "a0bb116ca9d909c93a285667ae033fbd1859b2dad7cf34fcb44816393ef6909c", - "path_symbols": [ - "test_actions_stop_busy_worker_before_timeout", - "BlockingRoutine", - "BlockingRoutine.__init__", - "BlockingRoutine._release", - "BlockingRoutine.run" - ], - "path_symbol_ids": [ - "a0bb116ca9d909c93a285667ae033fbd1859b2dad7cf34fcb44816393ef6909c", - "a3349c5bc65e4003a4bbd6a8dbb7a54c337e12d1aed930caa701b12e520f1e67", - "486deeed3043c6db985aef258e96ddc67aa53608e67a83962fbd2471f649ddf1", - "d9841bdbb69706c988ae7ae6adf89928dc4fae45943f74064f5382177034ba04" - ], - "path_edge_types": [ - "instantiates", - "writes_attr", - "reads_attr" - ], - "path_length": 5, - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_runtime.py", - "content": "def test_runtime_graceful_stop_waits_until_worker_finishes() -> None:\n started = Event()\n release = Event()\n runtime = RuntimeManager()\n runtime.register_module(BlockingModule(started, release))\n runtime.start()\n assert started.wait(timeout=1.0) is True\n assert runtime.status()[\"runtime\"][\"state\"] == \"busy\"\n\n stop_thread = Thread(target=runtime.stop, kwargs={\"timeout\": 1.0}, daemon=True)\n stop_thread.start()\n sleep(0.1)\n assert stop_thread.is_alive() is True\n\n release.set()\n stop_thread.join(timeout=1.0)\n assert stop_thread.is_alive() is False\n assert runtime.status()[\"runtime\"][\"state\"] == \"stopped\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_runtime.py:test_runtime_graceful_stop_waits_until_worker_finishes", - "span_start": 226, - "span_end": 243, - "lexical_rank": 6, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 8, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_runtime", - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_runtime.py", - "content": "def test_runtime_runs_worker_routine_and_exposes_status(tmp_path) -> None:\n config_path = tmp_path / \"config.yml\"\n config_path.write_text(\n \"\"\"\nplatform:\n workers: 1\nlog:\n version: 1\n disable_existing_loggers: false\n handlers:\n console:\n class: logging.StreamHandler\n root:\n level: INFO\n handlers: [console]\n\"\"\".strip(),\n encoding=\"utf-8\",\n )\n runtime = RuntimeManager()\n runtime.add_config_file(config_path)\n module = ExampleModule()\n runtime.register_module(module)\n\n runtime.start()\n sleep(0.2)\n status = runtime.status()\n runtime.stop()\n\n assert module.routine.processed == [{\"id\": 1}]\n assert status[\"modules\"] == [\"example\"]\n assert status[\"runtime\"][\"state\"] == \"idle\"\n assert status[\"health\"][\"status\"] == \"ok\"\n assert status[\"config\"] == {\"platform\": {\"workers\": 1}, \"log\": status[\"config\"][\"log\"]}", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_runtime.py:test_runtime_runs_worker_routine_and_exposes_status", - "span_start": 191, - "span_end": 223, - "lexical_rank": 6, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 7, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_runtime", - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "def _build_runtime(worker: Worker, *, control_timeout: int = 1) -> tuple[RuntimeManager, str]:\n runtime = RuntimeManager()\n channel = HttpControlChannel(host=\"127.0.0.1\", port=0, timeout=control_timeout)\n runtime.control_plane.register_channel(channel)\n runtime.register_module(WorkerModule(worker))\n runtime.start()\n return runtime, f\"http://127.0.0.1:{channel.port}\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:_build_runtime", - "span_start": 154, - "span_end": 160, - "lexical_rank": 6, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 6, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "def test_worker_wakes_up_with_configured_interval() -> None:\n interval = 0.15\n routine = IntervalRoutine()\n worker = ScenarioWorker(\"interval-worker\", routine, interval=interval)\n runtime = RuntimeManager()\n runtime.register_module(WorkerModule(worker))\n\n runtime.start()\n try:\n assert routine.wait_runs(count=3, timeout=2.0) is True\n finally:\n runtime.stop()\n\n deltas = routine.deltas()\n assert len(deltas) >= 2\n assert all(delta >= interval * 0.7 for delta in deltas[:2])", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:test_worker_wakes_up_with_configured_interval", - "span_start": 163, - "span_end": 178, - "lexical_rank": 6, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 7, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "class BlockingRoutine:\n def __init__(self, started: Event, release: Event) -> None:\n self._started = started\n self._release = release\n\n def run(self) -> None:\n self._started.set()\n self._release.wait(timeout=5.0)", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:BlockingRoutine", - "span_start": 40, - "span_end": 47, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 1, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "class ScenarioWorker(Worker):\n def __init__(self, name: str, routine: object, *, interval: float = 0.05) -> None:\n self._name = name\n self._routine = routine\n self._interval = interval\n self._thread: Thread | None = None\n self._stop_requested = Event()\n self._in_flight = 0\n self._runs = 0\n self._lock = Lock()\n\n @property\n def name(self) -> str:\n return self._name\n\n @property\n def critical(self) -> bool:\n return True\n\n def start(self) -> None:\n if self._thread is not None and self._thread.is_alive():\n return\n self._stop_requested.clear()\n self._thread = Thread(target=self._loop, name=f\"{self._name}-thread\", daemon=True)\n self._thread.start()\n\n def stop(self, force: bool = False) -> None:\n self._stop_requested.set()\n\n def health(self) -> WorkerHealth:\n return WorkerHealth(name=self.name, status=\"ok\", critical=True, meta={\"runs\": self._runs})\n\n def status(self) -> WorkerStatus:\n thread_alive = self._thread is not None and self._thread.is_alive()\n with self._lock:\n in_flight = self._in_flight\n runs = self._runs\n if not thread_alive:\n state = \"stopped\"\n elif self._stop_requested.is_set():\n state = \"stopping\"\n elif in_flight > 0:\n state = \"busy\"\n else:\n state = \"idle\"\n return WorkerStatus(name=self.name, state=state, in_flight=in_flight, meta={\"runs\": runs})\n\n def _loop(self) -> None:\n while not self._stop_requested.is_set():\n with self._lock:\n self._in_flight += 1\n try:\n self._routine.run()\n with self._lock:\n self._runs += 1\n finally:\n with self._lock:\n self._in_flight -= 1\n if self._stop_requested.is_set():\n return\n sleep(self._interval)", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:ScenarioWorker", - "span_start": 50, - "span_end": 110, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 2, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "class WorkerModule(ApplicationModule):\n def __init__(self, worker: Worker) -> None:\n self._worker = worker\n\n @property\n def name(self) -> str:\n return \"business-tests\"\n\n def register(self, registry: ModuleRegistry) -> None:\n registry.add_worker(self._worker)", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:WorkerModule", - "span_start": 113, - "span_end": 122, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 3, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "def _http_call_json(\n base_url: str,\n path: str,\n *,\n method: str = \"GET\",\n headers: dict[str, str] | None = None,\n) -> tuple[int, dict[str, object]]:\n request = Request(f\"{base_url}{path}\", method=method, headers=headers or {})\n try:\n with urlopen(request, timeout=15.0) as response:\n status = response.status\n body = response.read()\n except HTTPError as error:\n status = error.code\n body = error.read()\n payload = json.loads(body.decode(\"utf-8\"))\n return status, payload", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:_http_call_json", - "span_start": 125, - "span_end": 141, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 4, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "class IntervalRoutine:\n calls: list[float] = field(default_factory=list)\n _lock: Lock = field(default_factory=Lock)\n\n def run(self) -> None:\n with self._lock:\n self.calls.append(monotonic())\n\n def wait_runs(self, count: int, timeout: float) -> bool:\n deadline = monotonic() + timeout\n while monotonic() < deadline:\n with self._lock:\n if len(self.calls) >= count:\n return True\n sleep(0.01)\n return False\n\n def deltas(self) -> list[float]:\n with self._lock:\n return [self.calls[index + 1] - self.calls[index] for index in range(len(self.calls) - 1)]", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:IntervalRoutine", - "span_start": 18, - "span_end": 37, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "def _poll_until_stopped(base_url: str, timeout: float = 2.0) -> bool:\n deadline = monotonic() + timeout\n while monotonic() < deadline:\n _, payload = _http_call_json(base_url, \"/actions/status\")\n if payload.get(\"detail\") == \"stopped\":\n return True\n sleep(0.05)\n return False", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:_poll_until_stopped", - "span_start": 144, - "span_end": 151, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 5, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ] - }, - "diagnostics": { - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C0_SOURCE_CHUNKS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C0_SOURCE_CHUNKS": 10 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [], - "include_globs": [ - "src", - "tests" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests" - ] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src", - "tests" - ], - "include_globs": [ - "src", - "tests" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests" - ] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src", - "tests" - ], - "include_globs": [ - "src", - "tests" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests" - ] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**", - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "Где тесты для RuntimeManager? test_runtime_manager TestRuntimeManager RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**", - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "top_k": 6, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Где тесты для RuntimeManager? test_runtime_manager TestRuntimeManager RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**", - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "top_k": 10, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [], - "normalized_include_globs": [ - "src", - "tests" - ], - "normalized_exclude_globs": [], - "normalized_prefer_globs": [ - "tests" - ], - "filter_stage": "post_rank", - "candidates_before_filter": 0, - "candidates_after_filter": 0 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src", - "tests" - ], - "normalized_include_globs": [ - "src", - "tests" - ], - "normalized_exclude_globs": [], - "normalized_prefer_globs": [ - "tests" - ], - "filter_stage": "post_rank", - "candidates_before_filter": 6, - "candidates_after_filter": 6 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src", - "tests" - ], - "normalized_include_globs": [ - "src", - "tests" - ], - "normalized_exclude_globs": [], - "normalized_prefer_globs": [ - "tests" - ], - "filter_stage": "post_rank", - "candidates_before_filter": 10, - "candidates_after_filter": 10 - } - ], - "fallback": { - "used": true, - "reason": "scope_relaxed_no_hits" - }, - "symbol_resolution": { - "status": "not_found", - "resolved_symbol": null, - "alternatives": [ - "RuntimeManager" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "miss", - "hit_count": 0, - "fail_reason": "scope_relaxed_no_hits" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 6, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 10, - "fail_reason": null - } - ] - }, - "constraint_violations": [ - { - "type": "LAYER_MISSING", - "severity": "warn", - "details": { - "layer": "C1_SYMBOL_CATALOG", - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ] - }, - "suggested_fix": "Increase top_k for this layer or relax constraints for retrieval." - } - ], - "timings_ms": { - "symbol_resolution": 0, - "retrieval_total": 139, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 70, - "C2_DEPENDENCY_GRAPH": 50, - "C0_SOURCE_CHUNKS": 18 - }, - "merge_rank": 0 - } - } - }, - { - "step": "llm_answer", - "input": { - "query": "Где тесты для RuntimeManager?", - "rag_count": 16 - }, - "output": { - "llm_answer": "Прямые тесты для RuntimeManager находятся в следующих файлах:\n\n1. tests/test_runtime.py:\n - test_runtime_graceful_stop_waits_until_worker_finishes — проверяет корректную остановку RuntimeManager после завершения работы модуля.\n - test_runtime_runs_worker_routine_and_exposes_status — проверяет запуск рутины модуля и отображение статуса RuntimeManager.\n\nТакже косвенно связан тест:\n\n2. tests/test_business_control_actions.py:\n - _build_runtime — использует RuntimeManager при построении бизнес-контроля.\n - test_worker_wakes_up_with_configured_interval — применяет RuntimeManager для тестирования пробуждения рабочего процесса с заданной периодичностью.\n\nЭти тесты покрывают инициализацию, регистрацию модулей, управление состоянием и остановкой RuntimeManager." - }, - "diagnostics": { - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 946, - "evidence_rows": 16, - "evidence_chars": 7086 - }, - "evidence_summary": [ - { - "layer": "C2_DEPENDENCY_GRAPH", - "count": 6, - "unique_paths": 2 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 10, - "unique_paths": 2 - } - ], - "prompt_template_id": "intent_code_qa_find_tests_ru_v4", - "system_prompt_version": "v1" - }, - "timings_ms": { - "prompt_build": 0, - "llm_call": 1557 - } - } - } - ] - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_143856/full_chain_plba_code_subintents_v2_plba-v2-find-tests-runtime-manager.md b/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_143856/full_chain_plba_code_subintents_v2_plba-v2-find-tests-runtime-manager.md deleted file mode 100644 index ebd9050..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_143856/full_chain_plba_code_subintents_v2_plba-v2-find-tests-runtime-manager.md +++ /dev/null @@ -1,32 +0,0 @@ -# plba-v2-find-tests-runtime-manager - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_subintents_v2.yaml -- runner: runtime -- mode: full_chain -- passed: True - -## Query -Где тесты для RuntimeManager? - -## Actual -{ - "intent": "CODE_QA", - "sub_intent": "FIND_TESTS", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 16, - "llm_answer": "Прямые тесты для RuntimeManager находятся в следующих файлах:\n\n1. tests/test_runtime.py:\n - test_runtime_graceful_stop_waits_until_worker_finishes — проверяет корректную остановку RuntimeManager после завершения работы модуля.\n - test_runtime_runs_worker_routine_and_exposes_status — проверяет запуск рутины модуля и отображение статуса RuntimeManager.\n\nТакже косвенно связан тест:\n\n2. tests/test_business_control_actions.py:\n - _build_runtime — использует RuntimeManager при построении бизнес-контроля.\n - test_worker_wakes_up_with_configured_interval — применяет RuntimeManager для тестирования пробуждения рабочего процесса с заданной периодичностью.\n\nЭти тесты покрывают инициализацию, регистрацию модулей, управление состоянием и остановкой RuntimeManager.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "RuntimeManager" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ] -} - -## Mismatches -- none \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_143856/full_chain_plba_code_subintents_v2_plba-v2-find-tests-trace-service.json b/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_143856/full_chain_plba_code_subintents_v2_plba-v2-find-tests-trace-service.json deleted file mode 100644 index 177991a..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_143856/full_chain_plba_code_subintents_v2_plba-v2-find-tests-trace-service.json +++ /dev/null @@ -1,2047 +0,0 @@ -{ - "case_id": "plba-v2-find-tests-trace-service", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_subintents_v2.yaml", - "runner": "runtime", - "mode": "full_chain", - "actual": { - "intent": "CODE_QA", - "sub_intent": "FIND_TESTS", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 16, - "llm_answer": "Прямых тестов конкретно для `TraceService` в данном контексте не обнаружено.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "TraceService" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ] - }, - "passed": true, - "mismatches": [], - "details": { - "case_id": "plba-v2-find-tests-trace-service", - "text": "Где тесты для TraceService?", - "mode": "full_chain", - "run_started_at": "2026-03-12T14:38:57", - "rag_session_id": "7d11da21-faa0-4cea-aede-aeabe069164c", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Где тесты для TraceService?", - "symbol_resolution": { - "status": "not_found", - "resolved_symbol": null, - "alternatives": [ - "TraceService" - ], - "confidence": 0.0 - }, - "rag_count": 16, - "rag_rows": [ - { - "path": "tests/test_runtime.py", - "content": "test_trace_service_writes_contexts_and_messages\n -> RecordingTransport\n -> RecordingTransport.__init__\n -> RecordingTransport.contexts\n -> test_trace_service_writes_contexts_and_messages", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_trace_service_writes_contexts_and_messages:dataflow_slice", - "span_start": 181, - "span_end": 256, - "lexical_rank": 4, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 5, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "1636a2f70dee79c804259dc114af6c1ab4db27099911e5f97ac97a2bcb59be8a", - "edge_type": "dataflow_slice", - "src_symbol_id": "1600da201da1d0150240b400e3232172354156decdd1a04e1ab1a1edcd3a7e99", - "src_qname": "test_trace_service_writes_contexts_and_messages", - "dst_symbol_id": "1600da201da1d0150240b400e3232172354156decdd1a04e1ab1a1edcd3a7e99", - "dst_ref": "test_trace_service_writes_contexts_and_messages", - "resolution": "resolved", - "slice_id": "1636a2f70dee79c804259dc114af6c1ab4db27099911e5f97ac97a2bcb59be8a", - "root_symbol_id": "1600da201da1d0150240b400e3232172354156decdd1a04e1ab1a1edcd3a7e99", - "path_symbols": [ - "test_trace_service_writes_contexts_and_messages", - "RecordingTransport", - "RecordingTransport.__init__", - "RecordingTransport.contexts", - "test_trace_service_writes_contexts_and_messages" - ], - "path_symbol_ids": [ - "1600da201da1d0150240b400e3232172354156decdd1a04e1ab1a1edcd3a7e99", - "e3d635de1f1880673b69bf73ca6a45caffa5c7fdc23d589d5e40f76b86bdcd33", - "e34d80da723a7115a7a7586b52dc8b5cfda05c581509eee0c1a0296df9a340cb", - "1600da201da1d0150240b400e3232172354156decdd1a04e1ab1a1edcd3a7e99" - ], - "path_edge_types": [ - "instantiates", - "writes_attr", - "reads_attr" - ], - "path_length": 5, - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_runtime.py", - "content": "test_trace_service_writes_contexts_and_messages\n -> RecordingTransport\n -> RecordingTransport.__init__\n -> RecordingTransport.contexts\n -> test_trace_service_allows_messages_without_status", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_trace_service_writes_contexts_and_messages:dataflow_slice", - "span_start": 181, - "span_end": 293, - "lexical_rank": 4, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 5, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "5db5abe56b73f884c5178647bd25ef150064a94a41fc8c052aebaa09bd7fdb3d", - "edge_type": "dataflow_slice", - "src_symbol_id": "1600da201da1d0150240b400e3232172354156decdd1a04e1ab1a1edcd3a7e99", - "src_qname": "test_trace_service_writes_contexts_and_messages", - "dst_symbol_id": "7127ca85ce6447928e195e901d36f1e1f1e8205a686e567c2d1b187431f989df", - "dst_ref": "test_trace_service_allows_messages_without_status", - "resolution": "resolved", - "slice_id": "5db5abe56b73f884c5178647bd25ef150064a94a41fc8c052aebaa09bd7fdb3d", - "root_symbol_id": "1600da201da1d0150240b400e3232172354156decdd1a04e1ab1a1edcd3a7e99", - "path_symbols": [ - "test_trace_service_writes_contexts_and_messages", - "RecordingTransport", - "RecordingTransport.__init__", - "RecordingTransport.contexts", - "test_trace_service_allows_messages_without_status" - ], - "path_symbol_ids": [ - "1600da201da1d0150240b400e3232172354156decdd1a04e1ab1a1edcd3a7e99", - "e3d635de1f1880673b69bf73ca6a45caffa5c7fdc23d589d5e40f76b86bdcd33", - "e34d80da723a7115a7a7586b52dc8b5cfda05c581509eee0c1a0296df9a340cb", - "7127ca85ce6447928e195e901d36f1e1f1e8205a686e567c2d1b187431f989df" - ], - "path_edge_types": [ - "instantiates", - "writes_attr", - "reads_attr" - ], - "path_length": 5, - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_runtime.py", - "content": "test_trace_service_writes_contexts_and_messages\n -> RecordingTransport\n -> RecordingTransport.__init__\n -> RecordingTransport.contexts\n -> RecordingTransport.write_context", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_trace_service_writes_contexts_and_messages:dataflow_slice", - "span_start": 181, - "span_end": 249, - "lexical_rank": 4, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 5, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "60d7a8655fa4c53d9130ce342fc023d24ccfa16baea47ad60c91d2d49f547565", - "edge_type": "dataflow_slice", - "src_symbol_id": "1600da201da1d0150240b400e3232172354156decdd1a04e1ab1a1edcd3a7e99", - "src_qname": "test_trace_service_writes_contexts_and_messages", - "dst_symbol_id": "b8bbf341e230198caafe54727e13f2db27b7200d6fd95684fc5cf748db1a0e88", - "dst_ref": "RecordingTransport.write_context", - "resolution": "resolved", - "slice_id": "60d7a8655fa4c53d9130ce342fc023d24ccfa16baea47ad60c91d2d49f547565", - "root_symbol_id": "1600da201da1d0150240b400e3232172354156decdd1a04e1ab1a1edcd3a7e99", - "path_symbols": [ - "test_trace_service_writes_contexts_and_messages", - "RecordingTransport", - "RecordingTransport.__init__", - "RecordingTransport.contexts", - "RecordingTransport.write_context" - ], - "path_symbol_ids": [ - "1600da201da1d0150240b400e3232172354156decdd1a04e1ab1a1edcd3a7e99", - "e3d635de1f1880673b69bf73ca6a45caffa5c7fdc23d589d5e40f76b86bdcd33", - "e34d80da723a7115a7a7586b52dc8b5cfda05c581509eee0c1a0296df9a340cb", - "b8bbf341e230198caafe54727e13f2db27b7200d6fd95684fc5cf748db1a0e88" - ], - "path_edge_types": [ - "instantiates", - "writes_attr", - "reads_attr" - ], - "path_length": 5, - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_runtime.py", - "content": "test_trace_service_supports_debug_warning_and_error_levels\n -> RecordingTransport\n -> RecordingTransport.__init__\n -> RecordingTransport.contexts\n -> RecordingTransport.write_context", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_trace_service_supports_debug_warning_and_error_levels:dataflow_slice", - "span_start": 181, - "span_end": 265, - "lexical_rank": 4, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 5, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "1372a2241c7265705e5cf9dceeb5e59836fac1d679227c4279ed39e0798ddddf", - "edge_type": "dataflow_slice", - "src_symbol_id": "ede183f1c546725064e28ddab1ffdbae0d1a1258fd62a50eb556c10d10995415", - "src_qname": "test_trace_service_supports_debug_warning_and_error_levels", - "dst_symbol_id": "b8bbf341e230198caafe54727e13f2db27b7200d6fd95684fc5cf748db1a0e88", - "dst_ref": "RecordingTransport.write_context", - "resolution": "resolved", - "slice_id": "1372a2241c7265705e5cf9dceeb5e59836fac1d679227c4279ed39e0798ddddf", - "root_symbol_id": "ede183f1c546725064e28ddab1ffdbae0d1a1258fd62a50eb556c10d10995415", - "path_symbols": [ - "test_trace_service_supports_debug_warning_and_error_levels", - "RecordingTransport", - "RecordingTransport.__init__", - "RecordingTransport.contexts", - "RecordingTransport.write_context" - ], - "path_symbol_ids": [ - "ede183f1c546725064e28ddab1ffdbae0d1a1258fd62a50eb556c10d10995415", - "e3d635de1f1880673b69bf73ca6a45caffa5c7fdc23d589d5e40f76b86bdcd33", - "e34d80da723a7115a7a7586b52dc8b5cfda05c581509eee0c1a0296df9a340cb", - "b8bbf341e230198caafe54727e13f2db27b7200d6fd95684fc5cf748db1a0e88" - ], - "path_edge_types": [ - "instantiates", - "writes_attr", - "reads_attr" - ], - "path_length": 5, - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_runtime.py", - "content": "test_trace_service_supports_debug_warning_and_error_levels\n -> RecordingTransport\n -> RecordingTransport.__init__\n -> RecordingTransport.contexts\n -> test_trace_service_writes_contexts_and_messages", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_trace_service_supports_debug_warning_and_error_levels:dataflow_slice", - "span_start": 181, - "span_end": 265, - "lexical_rank": 4, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 5, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "8b6a5a738525df160600d71c15915704172de20db436ea2f84b6e039be396a2d", - "edge_type": "dataflow_slice", - "src_symbol_id": "ede183f1c546725064e28ddab1ffdbae0d1a1258fd62a50eb556c10d10995415", - "src_qname": "test_trace_service_supports_debug_warning_and_error_levels", - "dst_symbol_id": "1600da201da1d0150240b400e3232172354156decdd1a04e1ab1a1edcd3a7e99", - "dst_ref": "test_trace_service_writes_contexts_and_messages", - "resolution": "resolved", - "slice_id": "8b6a5a738525df160600d71c15915704172de20db436ea2f84b6e039be396a2d", - "root_symbol_id": "ede183f1c546725064e28ddab1ffdbae0d1a1258fd62a50eb556c10d10995415", - "path_symbols": [ - "test_trace_service_supports_debug_warning_and_error_levels", - "RecordingTransport", - "RecordingTransport.__init__", - "RecordingTransport.contexts", - "test_trace_service_writes_contexts_and_messages" - ], - "path_symbol_ids": [ - "ede183f1c546725064e28ddab1ffdbae0d1a1258fd62a50eb556c10d10995415", - "e3d635de1f1880673b69bf73ca6a45caffa5c7fdc23d589d5e40f76b86bdcd33", - "e34d80da723a7115a7a7586b52dc8b5cfda05c581509eee0c1a0296df9a340cb", - "1600da201da1d0150240b400e3232172354156decdd1a04e1ab1a1edcd3a7e99" - ], - "path_edge_types": [ - "instantiates", - "writes_attr", - "reads_attr" - ], - "path_length": 5, - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_runtime.py", - "content": "test_trace_service_supports_debug_warning_and_error_levels\n -> RecordingTransport\n -> RecordingTransport.__init__\n -> RecordingTransport.contexts\n -> test_trace_service_allows_messages_without_status", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_trace_service_supports_debug_warning_and_error_levels:dataflow_slice", - "span_start": 181, - "span_end": 293, - "lexical_rank": 4, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 5, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "f7d099f6d5746aa61a3025fd7eef791369bd3a3e5df4bc716de87e7b149ccde6", - "edge_type": "dataflow_slice", - "src_symbol_id": "ede183f1c546725064e28ddab1ffdbae0d1a1258fd62a50eb556c10d10995415", - "src_qname": "test_trace_service_supports_debug_warning_and_error_levels", - "dst_symbol_id": "7127ca85ce6447928e195e901d36f1e1f1e8205a686e567c2d1b187431f989df", - "dst_ref": "test_trace_service_allows_messages_without_status", - "resolution": "resolved", - "slice_id": "f7d099f6d5746aa61a3025fd7eef791369bd3a3e5df4bc716de87e7b149ccde6", - "root_symbol_id": "ede183f1c546725064e28ddab1ffdbae0d1a1258fd62a50eb556c10d10995415", - "path_symbols": [ - "test_trace_service_supports_debug_warning_and_error_levels", - "RecordingTransport", - "RecordingTransport.__init__", - "RecordingTransport.contexts", - "test_trace_service_allows_messages_without_status" - ], - "path_symbol_ids": [ - "ede183f1c546725064e28ddab1ffdbae0d1a1258fd62a50eb556c10d10995415", - "e3d635de1f1880673b69bf73ca6a45caffa5c7fdc23d589d5e40f76b86bdcd33", - "e34d80da723a7115a7a7586b52dc8b5cfda05c581509eee0c1a0296df9a340cb", - "7127ca85ce6447928e195e901d36f1e1f1e8205a686e567c2d1b187431f989df" - ], - "path_edge_types": [ - "instantiates", - "writes_attr", - "reads_attr" - ], - "path_length": 5, - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_runtime.py", - "content": "def test_trace_service_writes_contexts_and_messages() -> None:\n from app_runtime.tracing.service import TraceService\n\n transport = RecordingTransport()\n manager = TraceService(transport=transport)\n\n with manager.open_context(alias=\"worker\", kind=\"worker\", attrs={\"routine\": \"incoming\"}):\n manager.step(\"parse\")\n manager.info(\"started\", status=\"ok\", attrs={\"attempt\": 1})\n\n assert len(transport.contexts) == 1\n assert len(transport.messages) == 1\n assert transport.contexts[0].alias == \"worker\"\n assert transport.messages[0].step == \"parse\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_runtime.py:test_trace_service_writes_contexts_and_messages", - "span_start": 246, - "span_end": 259, - "lexical_rank": 6, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 9, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_runtime", - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_runtime.py", - "content": "def test_trace_service_supports_debug_warning_and_error_levels() -> None:\n from app_runtime.tracing.service import TraceService\n\n transport = RecordingTransport()\n manager = TraceService(transport=transport)\n\n with manager.open_context(alias=\"worker\", kind=\"worker\", attrs={\"routine\": \"incoming\"}):\n manager.step(\"validate\")\n manager.debug(\"validation details\", attrs={\"rule\": \"basic\"})\n manager.warning(\"validation warning\", status=\"degraded\", attrs={\"attempt\": 1})\n manager.error(\"integration failed\", status=\"failed\", attrs={\"integration\": \"crm\"})\n manager.exception(\"caught exception\", attrs={\"exception_type\": \"RuntimeError\"})\n\n levels = [message.level for message in transport.messages]\n assert levels == [\"DEBUG\", \"WARNING\", \"ERROR\", \"ERROR\"]", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_runtime.py:test_trace_service_supports_debug_warning_and_error_levels", - "span_start": 262, - "span_end": 276, - "lexical_rank": 6, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 10, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_runtime", - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_runtime.py", - "content": "def test_trace_service_allows_messages_without_status() -> None:\n from app_runtime.tracing.service import TraceService\n\n transport = RecordingTransport()\n manager = TraceService(transport=transport)\n\n with manager.open_context(alias=\"worker\", kind=\"worker\"):\n manager.step(\"optional-status\")\n manager.debug(\"debug without status\")\n manager.info(\"info without status\")\n manager.warning(\"warning without status\")\n manager.error(\"error without status\")\n\n assert [message.status for message in transport.messages] == [\"\", \"\", \"\", \"\"]\n assert all(message.trace_id == transport.contexts[0].trace_id for message in transport.messages)", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_runtime.py:test_trace_service_allows_messages_without_status", - "span_start": 279, - "span_end": 293, - "lexical_rank": 6, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 11, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_runtime", - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "class ScenarioWorker(Worker):\n def __init__(self, name: str, routine: object, *, interval: float = 0.05) -> None:\n self._name = name\n self._routine = routine\n self._interval = interval\n self._thread: Thread | None = None\n self._stop_requested = Event()\n self._in_flight = 0\n self._runs = 0\n self._lock = Lock()\n\n @property\n def name(self) -> str:\n return self._name\n\n @property\n def critical(self) -> bool:\n return True\n\n def start(self) -> None:\n if self._thread is not None and self._thread.is_alive():\n return\n self._stop_requested.clear()\n self._thread = Thread(target=self._loop, name=f\"{self._name}-thread\", daemon=True)\n self._thread.start()\n\n def stop(self, force: bool = False) -> None:\n self._stop_requested.set()\n\n def health(self) -> WorkerHealth:\n return WorkerHealth(name=self.name, status=\"ok\", critical=True, meta={\"runs\": self._runs})\n\n def status(self) -> WorkerStatus:\n thread_alive = self._thread is not None and self._thread.is_alive()\n with self._lock:\n in_flight = self._in_flight\n runs = self._runs\n if not thread_alive:\n state = \"stopped\"\n elif self._stop_requested.is_set():\n state = \"stopping\"\n elif in_flight > 0:\n state = \"busy\"\n else:\n state = \"idle\"\n return WorkerStatus(name=self.name, state=state, in_flight=in_flight, meta={\"runs\": runs})\n\n def _loop(self) -> None:\n while not self._stop_requested.is_set():\n with self._lock:\n self._in_flight += 1\n try:\n self._routine.run()\n with self._lock:\n self._runs += 1\n finally:\n with self._lock:\n self._in_flight -= 1\n if self._stop_requested.is_set():\n return\n sleep(self._interval)", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:ScenarioWorker", - "span_start": 50, - "span_end": 110, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 2, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "class IntervalRoutine:\n calls: list[float] = field(default_factory=list)\n _lock: Lock = field(default_factory=Lock)\n\n def run(self) -> None:\n with self._lock:\n self.calls.append(monotonic())\n\n def wait_runs(self, count: int, timeout: float) -> bool:\n deadline = monotonic() + timeout\n while monotonic() < deadline:\n with self._lock:\n if len(self.calls) >= count:\n return True\n sleep(0.01)\n return False\n\n def deltas(self) -> list[float]:\n with self._lock:\n return [self.calls[index + 1] - self.calls[index] for index in range(len(self.calls) - 1)]", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:IntervalRoutine", - "span_start": 18, - "span_end": 37, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "class BlockingRoutine:\n def __init__(self, started: Event, release: Event) -> None:\n self._started = started\n self._release = release\n\n def run(self) -> None:\n self._started.set()\n self._release.wait(timeout=5.0)", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:BlockingRoutine", - "span_start": 40, - "span_end": 47, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 1, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "def test_worker_wakes_up_with_configured_interval() -> None:\n interval = 0.15\n routine = IntervalRoutine()\n worker = ScenarioWorker(\"interval-worker\", routine, interval=interval)\n runtime = RuntimeManager()\n runtime.register_module(WorkerModule(worker))\n\n runtime.start()\n try:\n assert routine.wait_runs(count=3, timeout=2.0) is True\n finally:\n runtime.stop()\n\n deltas = routine.deltas()\n assert len(deltas) >= 2\n assert all(delta >= interval * 0.7 for delta in deltas[:2])", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:test_worker_wakes_up_with_configured_interval", - "span_start": 163, - "span_end": 178, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 7, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "def _http_call_json(\n base_url: str,\n path: str,\n *,\n method: str = \"GET\",\n headers: dict[str, str] | None = None,\n) -> tuple[int, dict[str, object]]:\n request = Request(f\"{base_url}{path}\", method=method, headers=headers or {})\n try:\n with urlopen(request, timeout=15.0) as response:\n status = response.status\n body = response.read()\n except HTTPError as error:\n status = error.code\n body = error.read()\n payload = json.loads(body.decode(\"utf-8\"))\n return status, payload", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:_http_call_json", - "span_start": 125, - "span_end": 141, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 4, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "def _build_runtime(worker: Worker, *, control_timeout: int = 1) -> tuple[RuntimeManager, str]:\n runtime = RuntimeManager()\n channel = HttpControlChannel(host=\"127.0.0.1\", port=0, timeout=control_timeout)\n runtime.control_plane.register_channel(channel)\n runtime.register_module(WorkerModule(worker))\n runtime.start()\n return runtime, f\"http://127.0.0.1:{channel.port}\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:_build_runtime", - "span_start": 154, - "span_end": 160, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 6, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "class WorkerModule(ApplicationModule):\n def __init__(self, worker: Worker) -> None:\n self._worker = worker\n\n @property\n def name(self) -> str:\n return \"business-tests\"\n\n def register(self, registry: ModuleRegistry) -> None:\n registry.add_worker(self._worker)", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:WorkerModule", - "span_start": 113, - "span_end": 122, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 3, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "llm_answer": "Прямых тестов конкретно для `TraceService` в данном контексте не обнаружено.", - "summary": { - "router": { - "intent": "CODE_QA", - "sub_intent": "FIND_TESTS", - "confidence": null - }, - "retrieval": { - "profile": "code", - "layers_hit": [ - "C0_SOURCE_CHUNKS", - "C2_DEPENDENCY_GRAPH" - ], - "evidence_sufficient": true - }, - "llm": { - "answer_status": "answered", - "groundedness": "grounded" - } - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "FIND_TESTS", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "TraceService" - ], - "keyword_hints": [ - "TraceService" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**", - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "test_file_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "test_symbol_patterns": [ - "test_trace_service", - "TestTraceService", - "TraceService" - ], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C0_SOURCE_CHUNKS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C0_SOURCE_CHUNKS": 10 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [], - "include_globs": [ - "src", - "tests" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests" - ] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src", - "tests" - ], - "include_globs": [ - "src", - "tests" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests" - ] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src", - "tests" - ], - "include_globs": [ - "src", - "tests" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests" - ] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "TraceService", - "path_scope": [], - "include_globs": [ - "src/**", - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "Где тесты для TraceService? test_trace_service TestTraceService TraceService", - "path_scope": [], - "include_globs": [ - "src/**", - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "top_k": 6, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Где тесты для TraceService? test_trace_service TestTraceService TraceService", - "path_scope": [], - "include_globs": [ - "src/**", - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "top_k": 10, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [], - "normalized_include_globs": [ - "src", - "tests" - ], - "normalized_exclude_globs": [], - "normalized_prefer_globs": [ - "tests" - ], - "filter_stage": "post_rank", - "candidates_before_filter": 0, - "candidates_after_filter": 0 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src", - "tests" - ], - "normalized_include_globs": [ - "src", - "tests" - ], - "normalized_exclude_globs": [], - "normalized_prefer_globs": [ - "tests" - ], - "filter_stage": "post_rank", - "candidates_before_filter": 6, - "candidates_after_filter": 6 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src", - "tests" - ], - "normalized_include_globs": [ - "src", - "tests" - ], - "normalized_exclude_globs": [], - "normalized_prefer_globs": [ - "tests" - ], - "filter_stage": "post_rank", - "candidates_before_filter": 10, - "candidates_after_filter": 10 - } - ], - "fallback": { - "used": true, - "reason": "scope_relaxed_no_hits" - }, - "symbol_resolution": { - "status": "not_found", - "resolved_symbol": null, - "alternatives": [ - "TraceService" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "miss", - "hit_count": 0, - "fail_reason": "scope_relaxed_no_hits" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 6, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 10, - "fail_reason": null - } - ] - }, - "constraint_violations": [ - { - "type": "LAYER_MISSING", - "severity": "warn", - "details": { - "layer": "C1_SYMBOL_CATALOG", - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ] - }, - "suggested_fix": "Increase top_k for this layer or relax constraints for retrieval." - } - ], - "timings_ms": { - "router": 1, - "symbol_resolution": 0, - "retrieval_total": 140, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 68, - "C2_DEPENDENCY_GRAPH": 53, - "C0_SOURCE_CHUNKS": 18 - }, - "merge_rank": 0, - "prompt_build": 0, - "llm_call": 1607 - }, - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 1021, - "evidence_rows": 16, - "evidence_chars": 7847 - }, - "evidence_summary": [ - { - "layer": "C2_DEPENDENCY_GRAPH", - "count": 6, - "unique_paths": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 10, - "unique_paths": 2 - } - ], - "prompt_template_id": "intent_code_qa_find_tests_ru_v4", - "system_prompt_version": "v1" - }, - "router": { - "conversation_mode": "START", - "keyword_hints": [ - "TraceService" - ], - "path_scope": [] - }, - "llm": { - "used_evidence_count": 16, - "missing_evidence_reason": null - } - }, - "run_info": { - "case_id": "plba-v2-find-tests-trace-service", - "mode": "full_chain", - "run_started_at": "2026-03-12T14:38:57", - "rag_session_id": "7d11da21-faa0-4cea-aede-aeabe069164c", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - }, - "input_request": { - "text": "Где тесты для TraceService?", - "normalized_query": "Где тесты для TraceService?" - }, - "steps": [ - { - "step": "intent_router", - "input": { - "query": "Где тесты для TraceService?" - }, - "output": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Где тесты для TraceService?" - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "FIND_TESTS", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "TraceService" - ], - "keyword_hints": [ - "TraceService" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**", - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "test_file_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "test_symbol_patterns": [ - "test_trace_service", - "TestTraceService", - "TraceService" - ], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "timings_ms": { - "router": 1 - } - } - }, - { - "step": "retrieval", - "input": { - "query": "Где тесты для TraceService?" - }, - "output": { - "symbol_resolution": { - "status": "not_found", - "resolved_symbol": null, - "alternatives": [ - "TraceService" - ], - "confidence": 0.0 - }, - "rag_count": 16, - "rag_rows": [ - { - "path": "tests/test_runtime.py", - "content": "test_trace_service_writes_contexts_and_messages\n -> RecordingTransport\n -> RecordingTransport.__init__\n -> RecordingTransport.contexts\n -> test_trace_service_writes_contexts_and_messages", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_trace_service_writes_contexts_and_messages:dataflow_slice", - "span_start": 181, - "span_end": 256, - "lexical_rank": 4, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 5, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "1636a2f70dee79c804259dc114af6c1ab4db27099911e5f97ac97a2bcb59be8a", - "edge_type": "dataflow_slice", - "src_symbol_id": "1600da201da1d0150240b400e3232172354156decdd1a04e1ab1a1edcd3a7e99", - "src_qname": "test_trace_service_writes_contexts_and_messages", - "dst_symbol_id": "1600da201da1d0150240b400e3232172354156decdd1a04e1ab1a1edcd3a7e99", - "dst_ref": "test_trace_service_writes_contexts_and_messages", - "resolution": "resolved", - "slice_id": "1636a2f70dee79c804259dc114af6c1ab4db27099911e5f97ac97a2bcb59be8a", - "root_symbol_id": "1600da201da1d0150240b400e3232172354156decdd1a04e1ab1a1edcd3a7e99", - "path_symbols": [ - "test_trace_service_writes_contexts_and_messages", - "RecordingTransport", - "RecordingTransport.__init__", - "RecordingTransport.contexts", - "test_trace_service_writes_contexts_and_messages" - ], - "path_symbol_ids": [ - "1600da201da1d0150240b400e3232172354156decdd1a04e1ab1a1edcd3a7e99", - "e3d635de1f1880673b69bf73ca6a45caffa5c7fdc23d589d5e40f76b86bdcd33", - "e34d80da723a7115a7a7586b52dc8b5cfda05c581509eee0c1a0296df9a340cb", - "1600da201da1d0150240b400e3232172354156decdd1a04e1ab1a1edcd3a7e99" - ], - "path_edge_types": [ - "instantiates", - "writes_attr", - "reads_attr" - ], - "path_length": 5, - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_runtime.py", - "content": "test_trace_service_writes_contexts_and_messages\n -> RecordingTransport\n -> RecordingTransport.__init__\n -> RecordingTransport.contexts\n -> test_trace_service_allows_messages_without_status", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_trace_service_writes_contexts_and_messages:dataflow_slice", - "span_start": 181, - "span_end": 293, - "lexical_rank": 4, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 5, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "5db5abe56b73f884c5178647bd25ef150064a94a41fc8c052aebaa09bd7fdb3d", - "edge_type": "dataflow_slice", - "src_symbol_id": "1600da201da1d0150240b400e3232172354156decdd1a04e1ab1a1edcd3a7e99", - "src_qname": "test_trace_service_writes_contexts_and_messages", - "dst_symbol_id": "7127ca85ce6447928e195e901d36f1e1f1e8205a686e567c2d1b187431f989df", - "dst_ref": "test_trace_service_allows_messages_without_status", - "resolution": "resolved", - "slice_id": "5db5abe56b73f884c5178647bd25ef150064a94a41fc8c052aebaa09bd7fdb3d", - "root_symbol_id": "1600da201da1d0150240b400e3232172354156decdd1a04e1ab1a1edcd3a7e99", - "path_symbols": [ - "test_trace_service_writes_contexts_and_messages", - "RecordingTransport", - "RecordingTransport.__init__", - "RecordingTransport.contexts", - "test_trace_service_allows_messages_without_status" - ], - "path_symbol_ids": [ - "1600da201da1d0150240b400e3232172354156decdd1a04e1ab1a1edcd3a7e99", - "e3d635de1f1880673b69bf73ca6a45caffa5c7fdc23d589d5e40f76b86bdcd33", - "e34d80da723a7115a7a7586b52dc8b5cfda05c581509eee0c1a0296df9a340cb", - "7127ca85ce6447928e195e901d36f1e1f1e8205a686e567c2d1b187431f989df" - ], - "path_edge_types": [ - "instantiates", - "writes_attr", - "reads_attr" - ], - "path_length": 5, - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_runtime.py", - "content": "test_trace_service_writes_contexts_and_messages\n -> RecordingTransport\n -> RecordingTransport.__init__\n -> RecordingTransport.contexts\n -> RecordingTransport.write_context", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_trace_service_writes_contexts_and_messages:dataflow_slice", - "span_start": 181, - "span_end": 249, - "lexical_rank": 4, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 5, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "60d7a8655fa4c53d9130ce342fc023d24ccfa16baea47ad60c91d2d49f547565", - "edge_type": "dataflow_slice", - "src_symbol_id": "1600da201da1d0150240b400e3232172354156decdd1a04e1ab1a1edcd3a7e99", - "src_qname": "test_trace_service_writes_contexts_and_messages", - "dst_symbol_id": "b8bbf341e230198caafe54727e13f2db27b7200d6fd95684fc5cf748db1a0e88", - "dst_ref": "RecordingTransport.write_context", - "resolution": "resolved", - "slice_id": "60d7a8655fa4c53d9130ce342fc023d24ccfa16baea47ad60c91d2d49f547565", - "root_symbol_id": "1600da201da1d0150240b400e3232172354156decdd1a04e1ab1a1edcd3a7e99", - "path_symbols": [ - "test_trace_service_writes_contexts_and_messages", - "RecordingTransport", - "RecordingTransport.__init__", - "RecordingTransport.contexts", - "RecordingTransport.write_context" - ], - "path_symbol_ids": [ - "1600da201da1d0150240b400e3232172354156decdd1a04e1ab1a1edcd3a7e99", - "e3d635de1f1880673b69bf73ca6a45caffa5c7fdc23d589d5e40f76b86bdcd33", - "e34d80da723a7115a7a7586b52dc8b5cfda05c581509eee0c1a0296df9a340cb", - "b8bbf341e230198caafe54727e13f2db27b7200d6fd95684fc5cf748db1a0e88" - ], - "path_edge_types": [ - "instantiates", - "writes_attr", - "reads_attr" - ], - "path_length": 5, - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_runtime.py", - "content": "test_trace_service_supports_debug_warning_and_error_levels\n -> RecordingTransport\n -> RecordingTransport.__init__\n -> RecordingTransport.contexts\n -> RecordingTransport.write_context", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_trace_service_supports_debug_warning_and_error_levels:dataflow_slice", - "span_start": 181, - "span_end": 265, - "lexical_rank": 4, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 5, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "1372a2241c7265705e5cf9dceeb5e59836fac1d679227c4279ed39e0798ddddf", - "edge_type": "dataflow_slice", - "src_symbol_id": "ede183f1c546725064e28ddab1ffdbae0d1a1258fd62a50eb556c10d10995415", - "src_qname": "test_trace_service_supports_debug_warning_and_error_levels", - "dst_symbol_id": "b8bbf341e230198caafe54727e13f2db27b7200d6fd95684fc5cf748db1a0e88", - "dst_ref": "RecordingTransport.write_context", - "resolution": "resolved", - "slice_id": "1372a2241c7265705e5cf9dceeb5e59836fac1d679227c4279ed39e0798ddddf", - "root_symbol_id": "ede183f1c546725064e28ddab1ffdbae0d1a1258fd62a50eb556c10d10995415", - "path_symbols": [ - "test_trace_service_supports_debug_warning_and_error_levels", - "RecordingTransport", - "RecordingTransport.__init__", - "RecordingTransport.contexts", - "RecordingTransport.write_context" - ], - "path_symbol_ids": [ - "ede183f1c546725064e28ddab1ffdbae0d1a1258fd62a50eb556c10d10995415", - "e3d635de1f1880673b69bf73ca6a45caffa5c7fdc23d589d5e40f76b86bdcd33", - "e34d80da723a7115a7a7586b52dc8b5cfda05c581509eee0c1a0296df9a340cb", - "b8bbf341e230198caafe54727e13f2db27b7200d6fd95684fc5cf748db1a0e88" - ], - "path_edge_types": [ - "instantiates", - "writes_attr", - "reads_attr" - ], - "path_length": 5, - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_runtime.py", - "content": "test_trace_service_supports_debug_warning_and_error_levels\n -> RecordingTransport\n -> RecordingTransport.__init__\n -> RecordingTransport.contexts\n -> test_trace_service_writes_contexts_and_messages", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_trace_service_supports_debug_warning_and_error_levels:dataflow_slice", - "span_start": 181, - "span_end": 265, - "lexical_rank": 4, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 5, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "8b6a5a738525df160600d71c15915704172de20db436ea2f84b6e039be396a2d", - "edge_type": "dataflow_slice", - "src_symbol_id": "ede183f1c546725064e28ddab1ffdbae0d1a1258fd62a50eb556c10d10995415", - "src_qname": "test_trace_service_supports_debug_warning_and_error_levels", - "dst_symbol_id": "1600da201da1d0150240b400e3232172354156decdd1a04e1ab1a1edcd3a7e99", - "dst_ref": "test_trace_service_writes_contexts_and_messages", - "resolution": "resolved", - "slice_id": "8b6a5a738525df160600d71c15915704172de20db436ea2f84b6e039be396a2d", - "root_symbol_id": "ede183f1c546725064e28ddab1ffdbae0d1a1258fd62a50eb556c10d10995415", - "path_symbols": [ - "test_trace_service_supports_debug_warning_and_error_levels", - "RecordingTransport", - "RecordingTransport.__init__", - "RecordingTransport.contexts", - "test_trace_service_writes_contexts_and_messages" - ], - "path_symbol_ids": [ - "ede183f1c546725064e28ddab1ffdbae0d1a1258fd62a50eb556c10d10995415", - "e3d635de1f1880673b69bf73ca6a45caffa5c7fdc23d589d5e40f76b86bdcd33", - "e34d80da723a7115a7a7586b52dc8b5cfda05c581509eee0c1a0296df9a340cb", - "1600da201da1d0150240b400e3232172354156decdd1a04e1ab1a1edcd3a7e99" - ], - "path_edge_types": [ - "instantiates", - "writes_attr", - "reads_attr" - ], - "path_length": 5, - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_runtime.py", - "content": "test_trace_service_supports_debug_warning_and_error_levels\n -> RecordingTransport\n -> RecordingTransport.__init__\n -> RecordingTransport.contexts\n -> test_trace_service_allows_messages_without_status", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_trace_service_supports_debug_warning_and_error_levels:dataflow_slice", - "span_start": 181, - "span_end": 293, - "lexical_rank": 4, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 5, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "f7d099f6d5746aa61a3025fd7eef791369bd3a3e5df4bc716de87e7b149ccde6", - "edge_type": "dataflow_slice", - "src_symbol_id": "ede183f1c546725064e28ddab1ffdbae0d1a1258fd62a50eb556c10d10995415", - "src_qname": "test_trace_service_supports_debug_warning_and_error_levels", - "dst_symbol_id": "7127ca85ce6447928e195e901d36f1e1f1e8205a686e567c2d1b187431f989df", - "dst_ref": "test_trace_service_allows_messages_without_status", - "resolution": "resolved", - "slice_id": "f7d099f6d5746aa61a3025fd7eef791369bd3a3e5df4bc716de87e7b149ccde6", - "root_symbol_id": "ede183f1c546725064e28ddab1ffdbae0d1a1258fd62a50eb556c10d10995415", - "path_symbols": [ - "test_trace_service_supports_debug_warning_and_error_levels", - "RecordingTransport", - "RecordingTransport.__init__", - "RecordingTransport.contexts", - "test_trace_service_allows_messages_without_status" - ], - "path_symbol_ids": [ - "ede183f1c546725064e28ddab1ffdbae0d1a1258fd62a50eb556c10d10995415", - "e3d635de1f1880673b69bf73ca6a45caffa5c7fdc23d589d5e40f76b86bdcd33", - "e34d80da723a7115a7a7586b52dc8b5cfda05c581509eee0c1a0296df9a340cb", - "7127ca85ce6447928e195e901d36f1e1f1e8205a686e567c2d1b187431f989df" - ], - "path_edge_types": [ - "instantiates", - "writes_attr", - "reads_attr" - ], - "path_length": 5, - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_runtime.py", - "content": "def test_trace_service_writes_contexts_and_messages() -> None:\n from app_runtime.tracing.service import TraceService\n\n transport = RecordingTransport()\n manager = TraceService(transport=transport)\n\n with manager.open_context(alias=\"worker\", kind=\"worker\", attrs={\"routine\": \"incoming\"}):\n manager.step(\"parse\")\n manager.info(\"started\", status=\"ok\", attrs={\"attempt\": 1})\n\n assert len(transport.contexts) == 1\n assert len(transport.messages) == 1\n assert transport.contexts[0].alias == \"worker\"\n assert transport.messages[0].step == \"parse\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_runtime.py:test_trace_service_writes_contexts_and_messages", - "span_start": 246, - "span_end": 259, - "lexical_rank": 6, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 9, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_runtime", - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_runtime.py", - "content": "def test_trace_service_supports_debug_warning_and_error_levels() -> None:\n from app_runtime.tracing.service import TraceService\n\n transport = RecordingTransport()\n manager = TraceService(transport=transport)\n\n with manager.open_context(alias=\"worker\", kind=\"worker\", attrs={\"routine\": \"incoming\"}):\n manager.step(\"validate\")\n manager.debug(\"validation details\", attrs={\"rule\": \"basic\"})\n manager.warning(\"validation warning\", status=\"degraded\", attrs={\"attempt\": 1})\n manager.error(\"integration failed\", status=\"failed\", attrs={\"integration\": \"crm\"})\n manager.exception(\"caught exception\", attrs={\"exception_type\": \"RuntimeError\"})\n\n levels = [message.level for message in transport.messages]\n assert levels == [\"DEBUG\", \"WARNING\", \"ERROR\", \"ERROR\"]", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_runtime.py:test_trace_service_supports_debug_warning_and_error_levels", - "span_start": 262, - "span_end": 276, - "lexical_rank": 6, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 10, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_runtime", - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_runtime.py", - "content": "def test_trace_service_allows_messages_without_status() -> None:\n from app_runtime.tracing.service import TraceService\n\n transport = RecordingTransport()\n manager = TraceService(transport=transport)\n\n with manager.open_context(alias=\"worker\", kind=\"worker\"):\n manager.step(\"optional-status\")\n manager.debug(\"debug without status\")\n manager.info(\"info without status\")\n manager.warning(\"warning without status\")\n manager.error(\"error without status\")\n\n assert [message.status for message in transport.messages] == [\"\", \"\", \"\", \"\"]\n assert all(message.trace_id == transport.contexts[0].trace_id for message in transport.messages)", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_runtime.py:test_trace_service_allows_messages_without_status", - "span_start": 279, - "span_end": 293, - "lexical_rank": 6, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 11, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_runtime", - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "class ScenarioWorker(Worker):\n def __init__(self, name: str, routine: object, *, interval: float = 0.05) -> None:\n self._name = name\n self._routine = routine\n self._interval = interval\n self._thread: Thread | None = None\n self._stop_requested = Event()\n self._in_flight = 0\n self._runs = 0\n self._lock = Lock()\n\n @property\n def name(self) -> str:\n return self._name\n\n @property\n def critical(self) -> bool:\n return True\n\n def start(self) -> None:\n if self._thread is not None and self._thread.is_alive():\n return\n self._stop_requested.clear()\n self._thread = Thread(target=self._loop, name=f\"{self._name}-thread\", daemon=True)\n self._thread.start()\n\n def stop(self, force: bool = False) -> None:\n self._stop_requested.set()\n\n def health(self) -> WorkerHealth:\n return WorkerHealth(name=self.name, status=\"ok\", critical=True, meta={\"runs\": self._runs})\n\n def status(self) -> WorkerStatus:\n thread_alive = self._thread is not None and self._thread.is_alive()\n with self._lock:\n in_flight = self._in_flight\n runs = self._runs\n if not thread_alive:\n state = \"stopped\"\n elif self._stop_requested.is_set():\n state = \"stopping\"\n elif in_flight > 0:\n state = \"busy\"\n else:\n state = \"idle\"\n return WorkerStatus(name=self.name, state=state, in_flight=in_flight, meta={\"runs\": runs})\n\n def _loop(self) -> None:\n while not self._stop_requested.is_set():\n with self._lock:\n self._in_flight += 1\n try:\n self._routine.run()\n with self._lock:\n self._runs += 1\n finally:\n with self._lock:\n self._in_flight -= 1\n if self._stop_requested.is_set():\n return\n sleep(self._interval)", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:ScenarioWorker", - "span_start": 50, - "span_end": 110, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 2, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "class IntervalRoutine:\n calls: list[float] = field(default_factory=list)\n _lock: Lock = field(default_factory=Lock)\n\n def run(self) -> None:\n with self._lock:\n self.calls.append(monotonic())\n\n def wait_runs(self, count: int, timeout: float) -> bool:\n deadline = monotonic() + timeout\n while monotonic() < deadline:\n with self._lock:\n if len(self.calls) >= count:\n return True\n sleep(0.01)\n return False\n\n def deltas(self) -> list[float]:\n with self._lock:\n return [self.calls[index + 1] - self.calls[index] for index in range(len(self.calls) - 1)]", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:IntervalRoutine", - "span_start": 18, - "span_end": 37, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "class BlockingRoutine:\n def __init__(self, started: Event, release: Event) -> None:\n self._started = started\n self._release = release\n\n def run(self) -> None:\n self._started.set()\n self._release.wait(timeout=5.0)", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:BlockingRoutine", - "span_start": 40, - "span_end": 47, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 1, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "def test_worker_wakes_up_with_configured_interval() -> None:\n interval = 0.15\n routine = IntervalRoutine()\n worker = ScenarioWorker(\"interval-worker\", routine, interval=interval)\n runtime = RuntimeManager()\n runtime.register_module(WorkerModule(worker))\n\n runtime.start()\n try:\n assert routine.wait_runs(count=3, timeout=2.0) is True\n finally:\n runtime.stop()\n\n deltas = routine.deltas()\n assert len(deltas) >= 2\n assert all(delta >= interval * 0.7 for delta in deltas[:2])", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:test_worker_wakes_up_with_configured_interval", - "span_start": 163, - "span_end": 178, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 7, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "def _http_call_json(\n base_url: str,\n path: str,\n *,\n method: str = \"GET\",\n headers: dict[str, str] | None = None,\n) -> tuple[int, dict[str, object]]:\n request = Request(f\"{base_url}{path}\", method=method, headers=headers or {})\n try:\n with urlopen(request, timeout=15.0) as response:\n status = response.status\n body = response.read()\n except HTTPError as error:\n status = error.code\n body = error.read()\n payload = json.loads(body.decode(\"utf-8\"))\n return status, payload", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:_http_call_json", - "span_start": 125, - "span_end": 141, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 4, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "def _build_runtime(worker: Worker, *, control_timeout: int = 1) -> tuple[RuntimeManager, str]:\n runtime = RuntimeManager()\n channel = HttpControlChannel(host=\"127.0.0.1\", port=0, timeout=control_timeout)\n runtime.control_plane.register_channel(channel)\n runtime.register_module(WorkerModule(worker))\n runtime.start()\n return runtime, f\"http://127.0.0.1:{channel.port}\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:_build_runtime", - "span_start": 154, - "span_end": 160, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 6, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "class WorkerModule(ApplicationModule):\n def __init__(self, worker: Worker) -> None:\n self._worker = worker\n\n @property\n def name(self) -> str:\n return \"business-tests\"\n\n def register(self, registry: ModuleRegistry) -> None:\n registry.add_worker(self._worker)", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:WorkerModule", - "span_start": 113, - "span_end": 122, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 3, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ] - }, - "diagnostics": { - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C0_SOURCE_CHUNKS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C0_SOURCE_CHUNKS": 10 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [], - "include_globs": [ - "src", - "tests" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests" - ] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src", - "tests" - ], - "include_globs": [ - "src", - "tests" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests" - ] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src", - "tests" - ], - "include_globs": [ - "src", - "tests" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests" - ] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "TraceService", - "path_scope": [], - "include_globs": [ - "src/**", - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "Где тесты для TraceService? test_trace_service TestTraceService TraceService", - "path_scope": [], - "include_globs": [ - "src/**", - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "top_k": 6, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Где тесты для TraceService? test_trace_service TestTraceService TraceService", - "path_scope": [], - "include_globs": [ - "src/**", - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "top_k": 10, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [], - "normalized_include_globs": [ - "src", - "tests" - ], - "normalized_exclude_globs": [], - "normalized_prefer_globs": [ - "tests" - ], - "filter_stage": "post_rank", - "candidates_before_filter": 0, - "candidates_after_filter": 0 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src", - "tests" - ], - "normalized_include_globs": [ - "src", - "tests" - ], - "normalized_exclude_globs": [], - "normalized_prefer_globs": [ - "tests" - ], - "filter_stage": "post_rank", - "candidates_before_filter": 6, - "candidates_after_filter": 6 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src", - "tests" - ], - "normalized_include_globs": [ - "src", - "tests" - ], - "normalized_exclude_globs": [], - "normalized_prefer_globs": [ - "tests" - ], - "filter_stage": "post_rank", - "candidates_before_filter": 10, - "candidates_after_filter": 10 - } - ], - "fallback": { - "used": true, - "reason": "scope_relaxed_no_hits" - }, - "symbol_resolution": { - "status": "not_found", - "resolved_symbol": null, - "alternatives": [ - "TraceService" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "miss", - "hit_count": 0, - "fail_reason": "scope_relaxed_no_hits" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 6, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 10, - "fail_reason": null - } - ] - }, - "constraint_violations": [ - { - "type": "LAYER_MISSING", - "severity": "warn", - "details": { - "layer": "C1_SYMBOL_CATALOG", - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ] - }, - "suggested_fix": "Increase top_k for this layer or relax constraints for retrieval." - } - ], - "timings_ms": { - "symbol_resolution": 0, - "retrieval_total": 140, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 68, - "C2_DEPENDENCY_GRAPH": 53, - "C0_SOURCE_CHUNKS": 18 - }, - "merge_rank": 0 - } - } - }, - { - "step": "llm_answer", - "input": { - "query": "Где тесты для TraceService?", - "rag_count": 16 - }, - "output": { - "llm_answer": "Прямых тестов конкретно для `TraceService` в данном контексте не обнаружено." - }, - "diagnostics": { - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 1021, - "evidence_rows": 16, - "evidence_chars": 7847 - }, - "evidence_summary": [ - { - "layer": "C2_DEPENDENCY_GRAPH", - "count": 6, - "unique_paths": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 10, - "unique_paths": 2 - } - ], - "prompt_template_id": "intent_code_qa_find_tests_ru_v4", - "system_prompt_version": "v1" - }, - "timings_ms": { - "prompt_build": 0, - "llm_call": 1607 - } - } - } - ] - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_143856/full_chain_plba_code_subintents_v2_plba-v2-find-tests-trace-service.md b/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_143856/full_chain_plba_code_subintents_v2_plba-v2-find-tests-trace-service.md deleted file mode 100644 index 9d3d9dd..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_143856/full_chain_plba_code_subintents_v2_plba-v2-find-tests-trace-service.md +++ /dev/null @@ -1,32 +0,0 @@ -# plba-v2-find-tests-trace-service - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_subintents_v2.yaml -- runner: runtime -- mode: full_chain -- passed: True - -## Query -Где тесты для TraceService? - -## Actual -{ - "intent": "CODE_QA", - "sub_intent": "FIND_TESTS", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 16, - "llm_answer": "Прямых тестов конкретно для `TraceService` в данном контексте не обнаружено.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "TraceService" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ] -} - -## Mismatches -- none \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_143856/full_chain_plba_code_subintents_v2_plba-v2-find-tests-workflow-runtime-factory-negative.json b/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_143856/full_chain_plba_code_subintents_v2_plba-v2-find-tests-workflow-runtime-factory-negative.json deleted file mode 100644 index 8a52766..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_143856/full_chain_plba_code_subintents_v2_plba-v2-find-tests-workflow-runtime-factory-negative.json +++ /dev/null @@ -1,2047 +0,0 @@ -{ - "case_id": "plba-v2-find-tests-workflow-runtime-factory-negative", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_subintents_v2.yaml", - "runner": "runtime", - "mode": "full_chain", - "actual": { - "intent": "CODE_QA", - "sub_intent": "FIND_TESTS", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 16, - "llm_answer": "Прямых тестов конкретно для `WorkflowRuntimeFactory` в предоставленном контексте не обнаружено.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "WorkflowRuntimeFactory" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ] - }, - "passed": true, - "mismatches": [], - "details": { - "case_id": "plba-v2-find-tests-workflow-runtime-factory-negative", - "text": "Где тесты для WorkflowRuntimeFactory?", - "mode": "full_chain", - "run_started_at": "2026-03-12T14:38:57", - "rag_session_id": "7d11da21-faa0-4cea-aede-aeabe069164c", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Где тесты для WorkflowRuntimeFactory?", - "symbol_resolution": { - "status": "not_found", - "resolved_symbol": null, - "alternatives": [ - "WorkflowRuntimeFactory" - ], - "confidence": 0.0 - }, - "rag_count": 16, - "rag_rows": [ - { - "path": "tests/test_business_control_actions.py", - "content": "test_actions_stop_busy_worker_before_timeout\n -> BlockingRoutine\n -> BlockingRoutine.__init__\n -> BlockingRoutine._release\n -> BlockingRoutine.run", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_actions_stop_busy_worker_before_timeout:dataflow_slice", - "span_start": 43, - "span_end": 212, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 5, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "8bd726155ba387d3579763ee84dfd2f9a90bc917da88f3b2e89416ab5c1254d6", - "edge_type": "dataflow_slice", - "src_symbol_id": "a0bb116ca9d909c93a285667ae033fbd1859b2dad7cf34fcb44816393ef6909c", - "src_qname": "test_actions_stop_busy_worker_before_timeout", - "dst_symbol_id": "d9841bdbb69706c988ae7ae6adf89928dc4fae45943f74064f5382177034ba04", - "dst_ref": "BlockingRoutine.run", - "resolution": "resolved", - "slice_id": "8bd726155ba387d3579763ee84dfd2f9a90bc917da88f3b2e89416ab5c1254d6", - "root_symbol_id": "a0bb116ca9d909c93a285667ae033fbd1859b2dad7cf34fcb44816393ef6909c", - "path_symbols": [ - "test_actions_stop_busy_worker_before_timeout", - "BlockingRoutine", - "BlockingRoutine.__init__", - "BlockingRoutine._release", - "BlockingRoutine.run" - ], - "path_symbol_ids": [ - "a0bb116ca9d909c93a285667ae033fbd1859b2dad7cf34fcb44816393ef6909c", - "a3349c5bc65e4003a4bbd6a8dbb7a54c337e12d1aed930caa701b12e520f1e67", - "486deeed3043c6db985aef258e96ddc67aa53608e67a83962fbd2471f649ddf1", - "d9841bdbb69706c988ae7ae6adf89928dc4fae45943f74064f5382177034ba04" - ], - "path_edge_types": [ - "instantiates", - "writes_attr", - "reads_attr" - ], - "path_length": 5, - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "test_worker_wakes_up_with_configured_interval\n -> ScenarioWorker\n -> ScenarioWorker.__init__\n -> ScenarioWorker._name\n -> ScenarioWorker.name", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_worker_wakes_up_with_configured_interval:dataflow_slice", - "span_start": 52, - "span_end": 166, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 5, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "2fd137f5852febe907f44d3b3e4ea430f89ccfe962ae1442a16ab9df64c8f76c", - "edge_type": "dataflow_slice", - "src_symbol_id": "65f877f78191d65e6a752e41cedc70ebc784c266804a55c1c56440336e1f0d6e", - "src_qname": "test_worker_wakes_up_with_configured_interval", - "dst_symbol_id": "da022da2c49fd9cfd09d6e6da6bbd59aaa7d28efd669ce8444e88d327ddec2fc", - "dst_ref": "ScenarioWorker.name", - "resolution": "resolved", - "slice_id": "2fd137f5852febe907f44d3b3e4ea430f89ccfe962ae1442a16ab9df64c8f76c", - "root_symbol_id": "65f877f78191d65e6a752e41cedc70ebc784c266804a55c1c56440336e1f0d6e", - "path_symbols": [ - "test_worker_wakes_up_with_configured_interval", - "ScenarioWorker", - "ScenarioWorker.__init__", - "ScenarioWorker._name", - "ScenarioWorker.name" - ], - "path_symbol_ids": [ - "65f877f78191d65e6a752e41cedc70ebc784c266804a55c1c56440336e1f0d6e", - "9a1d08a7eb1831c9f2e0db361b5207f036e477c160773ae08c0b287239785c52", - "9c20be046ba06644d1432e0f20eb223663d2b116ee7d91fdc62bc68323f2e593", - "da022da2c49fd9cfd09d6e6da6bbd59aaa7d28efd669ce8444e88d327ddec2fc" - ], - "path_edge_types": [ - "instantiates", - "writes_attr", - "reads_attr" - ], - "path_length": 5, - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "test_actions_stop_busy_worker_before_timeout\n -> BlockingRoutine\n -> BlockingRoutine.__init__\n -> BlockingRoutine._started\n -> BlockingRoutine.run", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_actions_stop_busy_worker_before_timeout:dataflow_slice", - "span_start": 42, - "span_end": 212, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 5, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "f9bcce108870e49afa8b32d4625115a10707a3b0e7473179e958e5752bf258b4", - "edge_type": "dataflow_slice", - "src_symbol_id": "a0bb116ca9d909c93a285667ae033fbd1859b2dad7cf34fcb44816393ef6909c", - "src_qname": "test_actions_stop_busy_worker_before_timeout", - "dst_symbol_id": "d9841bdbb69706c988ae7ae6adf89928dc4fae45943f74064f5382177034ba04", - "dst_ref": "BlockingRoutine.run", - "resolution": "resolved", - "slice_id": "f9bcce108870e49afa8b32d4625115a10707a3b0e7473179e958e5752bf258b4", - "root_symbol_id": "a0bb116ca9d909c93a285667ae033fbd1859b2dad7cf34fcb44816393ef6909c", - "path_symbols": [ - "test_actions_stop_busy_worker_before_timeout", - "BlockingRoutine", - "BlockingRoutine.__init__", - "BlockingRoutine._started", - "BlockingRoutine.run" - ], - "path_symbol_ids": [ - "a0bb116ca9d909c93a285667ae033fbd1859b2dad7cf34fcb44816393ef6909c", - "a3349c5bc65e4003a4bbd6a8dbb7a54c337e12d1aed930caa701b12e520f1e67", - "486deeed3043c6db985aef258e96ddc67aa53608e67a83962fbd2471f649ddf1", - "d9841bdbb69706c988ae7ae6adf89928dc4fae45943f74064f5382177034ba04" - ], - "path_edge_types": [ - "instantiates", - "writes_attr", - "reads_attr" - ], - "path_length": 5, - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "test_actions_stop_busy_worker_after_timeout\n -> BlockingRoutine\n -> BlockingRoutine.__init__\n -> BlockingRoutine._started\n -> BlockingRoutine.run", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_actions_stop_busy_worker_after_timeout:dataflow_slice", - "span_start": 42, - "span_end": 238, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 5, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "8e7db3d2a9226f1c1d9942ac6373cfcafa0d2276758ddb8a3d3c455a3d58024d", - "edge_type": "dataflow_slice", - "src_symbol_id": "66392d3222421d9ba16eda3554940b16e7d5a6f33aa08c5738d35af2e32f1e4a", - "src_qname": "test_actions_stop_busy_worker_after_timeout", - "dst_symbol_id": "d9841bdbb69706c988ae7ae6adf89928dc4fae45943f74064f5382177034ba04", - "dst_ref": "BlockingRoutine.run", - "resolution": "resolved", - "slice_id": "8e7db3d2a9226f1c1d9942ac6373cfcafa0d2276758ddb8a3d3c455a3d58024d", - "root_symbol_id": "66392d3222421d9ba16eda3554940b16e7d5a6f33aa08c5738d35af2e32f1e4a", - "path_symbols": [ - "test_actions_stop_busy_worker_after_timeout", - "BlockingRoutine", - "BlockingRoutine.__init__", - "BlockingRoutine._started", - "BlockingRoutine.run" - ], - "path_symbol_ids": [ - "66392d3222421d9ba16eda3554940b16e7d5a6f33aa08c5738d35af2e32f1e4a", - "a3349c5bc65e4003a4bbd6a8dbb7a54c337e12d1aed930caa701b12e520f1e67", - "486deeed3043c6db985aef258e96ddc67aa53608e67a83962fbd2471f649ddf1", - "d9841bdbb69706c988ae7ae6adf89928dc4fae45943f74064f5382177034ba04" - ], - "path_edge_types": [ - "instantiates", - "writes_attr", - "reads_attr" - ], - "path_length": 5, - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "test_actions_stop_busy_worker_after_timeout\n -> BlockingRoutine\n -> BlockingRoutine.__init__\n -> BlockingRoutine._release\n -> BlockingRoutine.run", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_actions_stop_busy_worker_after_timeout:dataflow_slice", - "span_start": 43, - "span_end": 238, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 5, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "b59da9da82f9dfc8a9b695a08213786385da1ae9e17561ec3a0450a574a8cb39", - "edge_type": "dataflow_slice", - "src_symbol_id": "66392d3222421d9ba16eda3554940b16e7d5a6f33aa08c5738d35af2e32f1e4a", - "src_qname": "test_actions_stop_busy_worker_after_timeout", - "dst_symbol_id": "d9841bdbb69706c988ae7ae6adf89928dc4fae45943f74064f5382177034ba04", - "dst_ref": "BlockingRoutine.run", - "resolution": "resolved", - "slice_id": "b59da9da82f9dfc8a9b695a08213786385da1ae9e17561ec3a0450a574a8cb39", - "root_symbol_id": "66392d3222421d9ba16eda3554940b16e7d5a6f33aa08c5738d35af2e32f1e4a", - "path_symbols": [ - "test_actions_stop_busy_worker_after_timeout", - "BlockingRoutine", - "BlockingRoutine.__init__", - "BlockingRoutine._release", - "BlockingRoutine.run" - ], - "path_symbol_ids": [ - "66392d3222421d9ba16eda3554940b16e7d5a6f33aa08c5738d35af2e32f1e4a", - "a3349c5bc65e4003a4bbd6a8dbb7a54c337e12d1aed930caa701b12e520f1e67", - "486deeed3043c6db985aef258e96ddc67aa53608e67a83962fbd2471f649ddf1", - "d9841bdbb69706c988ae7ae6adf89928dc4fae45943f74064f5382177034ba04" - ], - "path_edge_types": [ - "instantiates", - "writes_attr", - "reads_attr" - ], - "path_length": 5, - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "test_actions_start_stop_and_health_when_worker_is_idle\n -> ScenarioWorker\n -> ScenarioWorker.__init__\n -> ScenarioWorker._name\n -> ScenarioWorker.name", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_actions_start_stop_and_health_when_worker_is_idle:dataflow_slice", - "span_start": 52, - "span_end": 182, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 5, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "8fb3c9e775ad1cfa91eebb8b8cef367dc53c923584236122235446e0579b468e", - "edge_type": "dataflow_slice", - "src_symbol_id": "09a78d8eb31c2da14fee58da53b5da7a5065a4c23b6300748a6d44517a5284b8", - "src_qname": "test_actions_start_stop_and_health_when_worker_is_idle", - "dst_symbol_id": "da022da2c49fd9cfd09d6e6da6bbd59aaa7d28efd669ce8444e88d327ddec2fc", - "dst_ref": "ScenarioWorker.name", - "resolution": "resolved", - "slice_id": "8fb3c9e775ad1cfa91eebb8b8cef367dc53c923584236122235446e0579b468e", - "root_symbol_id": "09a78d8eb31c2da14fee58da53b5da7a5065a4c23b6300748a6d44517a5284b8", - "path_symbols": [ - "test_actions_start_stop_and_health_when_worker_is_idle", - "ScenarioWorker", - "ScenarioWorker.__init__", - "ScenarioWorker._name", - "ScenarioWorker.name" - ], - "path_symbol_ids": [ - "09a78d8eb31c2da14fee58da53b5da7a5065a4c23b6300748a6d44517a5284b8", - "9a1d08a7eb1831c9f2e0db361b5207f036e477c160773ae08c0b287239785c52", - "9c20be046ba06644d1432e0f20eb223663d2b116ee7d91fdc62bc68323f2e593", - "da022da2c49fd9cfd09d6e6da6bbd59aaa7d28efd669ce8444e88d327ddec2fc" - ], - "path_edge_types": [ - "instantiates", - "writes_attr", - "reads_attr" - ], - "path_length": 5, - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "def test_actions_start_stop_and_health_when_worker_is_idle() -> None:\n runtime, base_url = _build_runtime(ScenarioWorker(\"idle-worker\", IntervalRoutine(), interval=0.2))\n try:\n stop_status, stop_payload = _http_call_json(base_url, \"/actions/stop\", method=\"POST\")\n assert stop_status == 200\n assert isinstance(stop_payload.get(\"detail\"), dict)\n assert stop_payload[\"detail\"][\"timed_out\"] is False\n assert stop_payload[\"detail\"][\"state\"] == \"stopped\"\n\n health_stopped_status, health_stopped_payload = _http_call_json(base_url, \"/health\")\n assert health_stopped_status == 503\n assert health_stopped_payload[\"state\"] == \"stopped\"\n assert health_stopped_payload[\"status\"] == \"unhealthy\"\n\n start_status, start_payload = _http_call_json(base_url, \"/actions/start\", method=\"POST\")\n assert start_status == 200\n assert isinstance(start_payload.get(\"detail\"), dict)\n assert start_payload[\"detail\"][\"timed_out\"] is False\n assert start_payload[\"detail\"][\"state\"] in {\"idle\", \"busy\"}\n\n health_started_status, health_started_payload = _http_call_json(base_url, \"/health\")\n assert health_started_status == 200\n assert health_started_payload[\"status\"] == \"ok\"\n assert health_started_payload[\"state\"] in {\"idle\", \"busy\"}\n finally:\n runtime.stop()", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:test_actions_start_stop_and_health_when_worker_is_idle", - "span_start": 181, - "span_end": 206, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 8, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "def _poll_until_stopped(base_url: str, timeout: float = 2.0) -> bool:\n deadline = monotonic() + timeout\n while monotonic() < deadline:\n _, payload = _http_call_json(base_url, \"/actions/status\")\n if payload.get(\"detail\") == \"stopped\":\n return True\n sleep(0.05)\n return False", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:_poll_until_stopped", - "span_start": 144, - "span_end": 151, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 5, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "def test_worker_wakes_up_with_configured_interval() -> None:\n interval = 0.15\n routine = IntervalRoutine()\n worker = ScenarioWorker(\"interval-worker\", routine, interval=interval)\n runtime = RuntimeManager()\n runtime.register_module(WorkerModule(worker))\n\n runtime.start()\n try:\n assert routine.wait_runs(count=3, timeout=2.0) is True\n finally:\n runtime.stop()\n\n deltas = routine.deltas()\n assert len(deltas) >= 2\n assert all(delta >= interval * 0.7 for delta in deltas[:2])", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:test_worker_wakes_up_with_configured_interval", - "span_start": 163, - "span_end": 178, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 7, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "class BlockingRoutine:\n def __init__(self, started: Event, release: Event) -> None:\n self._started = started\n self._release = release\n\n def run(self) -> None:\n self._started.set()\n self._release.wait(timeout=5.0)", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:BlockingRoutine", - "span_start": 40, - "span_end": 47, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 1, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "class WorkerModule(ApplicationModule):\n def __init__(self, worker: Worker) -> None:\n self._worker = worker\n\n @property\n def name(self) -> str:\n return \"business-tests\"\n\n def register(self, registry: ModuleRegistry) -> None:\n registry.add_worker(self._worker)", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:WorkerModule", - "span_start": 113, - "span_end": 122, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 3, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "def _http_call_json(\n base_url: str,\n path: str,\n *,\n method: str = \"GET\",\n headers: dict[str, str] | None = None,\n) -> tuple[int, dict[str, object]]:\n request = Request(f\"{base_url}{path}\", method=method, headers=headers or {})\n try:\n with urlopen(request, timeout=15.0) as response:\n status = response.status\n body = response.read()\n except HTTPError as error:\n status = error.code\n body = error.read()\n payload = json.loads(body.decode(\"utf-8\"))\n return status, payload", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:_http_call_json", - "span_start": 125, - "span_end": 141, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 4, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "def _build_runtime(worker: Worker, *, control_timeout: int = 1) -> tuple[RuntimeManager, str]:\n runtime = RuntimeManager()\n channel = HttpControlChannel(host=\"127.0.0.1\", port=0, timeout=control_timeout)\n runtime.control_plane.register_channel(channel)\n runtime.register_module(WorkerModule(worker))\n runtime.start()\n return runtime, f\"http://127.0.0.1:{channel.port}\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:_build_runtime", - "span_start": 154, - "span_end": 160, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 6, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "class ScenarioWorker(Worker):\n def __init__(self, name: str, routine: object, *, interval: float = 0.05) -> None:\n self._name = name\n self._routine = routine\n self._interval = interval\n self._thread: Thread | None = None\n self._stop_requested = Event()\n self._in_flight = 0\n self._runs = 0\n self._lock = Lock()\n\n @property\n def name(self) -> str:\n return self._name\n\n @property\n def critical(self) -> bool:\n return True\n\n def start(self) -> None:\n if self._thread is not None and self._thread.is_alive():\n return\n self._stop_requested.clear()\n self._thread = Thread(target=self._loop, name=f\"{self._name}-thread\", daemon=True)\n self._thread.start()\n\n def stop(self, force: bool = False) -> None:\n self._stop_requested.set()\n\n def health(self) -> WorkerHealth:\n return WorkerHealth(name=self.name, status=\"ok\", critical=True, meta={\"runs\": self._runs})\n\n def status(self) -> WorkerStatus:\n thread_alive = self._thread is not None and self._thread.is_alive()\n with self._lock:\n in_flight = self._in_flight\n runs = self._runs\n if not thread_alive:\n state = \"stopped\"\n elif self._stop_requested.is_set():\n state = \"stopping\"\n elif in_flight > 0:\n state = \"busy\"\n else:\n state = \"idle\"\n return WorkerStatus(name=self.name, state=state, in_flight=in_flight, meta={\"runs\": runs})\n\n def _loop(self) -> None:\n while not self._stop_requested.is_set():\n with self._lock:\n self._in_flight += 1\n try:\n self._routine.run()\n with self._lock:\n self._runs += 1\n finally:\n with self._lock:\n self._in_flight -= 1\n if self._stop_requested.is_set():\n return\n sleep(self._interval)", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:ScenarioWorker", - "span_start": 50, - "span_end": 110, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 2, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "class IntervalRoutine:\n calls: list[float] = field(default_factory=list)\n _lock: Lock = field(default_factory=Lock)\n\n def run(self) -> None:\n with self._lock:\n self.calls.append(monotonic())\n\n def wait_runs(self, count: int, timeout: float) -> bool:\n deadline = monotonic() + timeout\n while monotonic() < deadline:\n with self._lock:\n if len(self.calls) >= count:\n return True\n sleep(0.01)\n return False\n\n def deltas(self) -> list[float]:\n with self._lock:\n return [self.calls[index + 1] - self.calls[index] for index in range(len(self.calls) - 1)]", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:IntervalRoutine", - "span_start": 18, - "span_end": 37, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "def test_actions_stop_busy_worker_before_timeout() -> None:\n started = Event()\n release = Event()\n runtime, base_url = _build_runtime(ScenarioWorker(\"busy-worker\", BlockingRoutine(started, release)))\n assert started.wait(timeout=1.0) is True\n\n def release_later() -> None:\n sleep(0.2)\n release.set()\n\n Thread(target=release_later, daemon=True).start()\n try:\n status, payload = _http_call_json(base_url, \"/actions/stop\", method=\"POST\")\n assert status == 200\n assert isinstance(payload.get(\"detail\"), dict)\n assert payload[\"detail\"][\"timed_out\"] is False\n assert payload[\"detail\"][\"state\"] == \"stopped\"\n\n health_status, health_payload = _http_call_json(base_url, \"/health\")\n assert health_status == 503\n assert health_payload[\"status\"] == \"unhealthy\"\n assert health_payload[\"state\"] == \"stopped\"\n finally:\n runtime.stop()", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:test_actions_stop_busy_worker_before_timeout", - "span_start": 209, - "span_end": 232, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 9, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "llm_answer": "Прямых тестов конкретно для `WorkflowRuntimeFactory` в предоставленном контексте не обнаружено.", - "summary": { - "router": { - "intent": "CODE_QA", - "sub_intent": "FIND_TESTS", - "confidence": null - }, - "retrieval": { - "profile": "code", - "layers_hit": [ - "C0_SOURCE_CHUNKS", - "C2_DEPENDENCY_GRAPH" - ], - "evidence_sufficient": true - }, - "llm": { - "answer_status": "answered", - "groundedness": "grounded" - } - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "FIND_TESTS", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "WorkflowRuntimeFactory" - ], - "keyword_hints": [ - "WorkflowRuntimeFactory" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**", - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "test_file_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "test_symbol_patterns": [ - "test_workflow_runtime_factory", - "TestWorkflowRuntimeFactory", - "WorkflowRuntimeFactory" - ], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C0_SOURCE_CHUNKS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C0_SOURCE_CHUNKS": 10 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [], - "include_globs": [ - "src", - "tests" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests" - ] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src", - "tests" - ], - "include_globs": [ - "src", - "tests" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests" - ] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src", - "tests" - ], - "include_globs": [ - "src", - "tests" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests" - ] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "WorkflowRuntimeFactory", - "path_scope": [], - "include_globs": [ - "src/**", - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "Где тесты для WorkflowRuntimeFactory? test_workflow_runtime_factory TestWorkflowRuntimeFactory WorkflowRuntimeFactory", - "path_scope": [], - "include_globs": [ - "src/**", - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "top_k": 6, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Где тесты для WorkflowRuntimeFactory? test_workflow_runtime_factory TestWorkflowRuntimeFactory WorkflowRuntimeFactory", - "path_scope": [], - "include_globs": [ - "src/**", - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "top_k": 10, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [], - "normalized_include_globs": [ - "src", - "tests" - ], - "normalized_exclude_globs": [], - "normalized_prefer_globs": [ - "tests" - ], - "filter_stage": "post_rank", - "candidates_before_filter": 0, - "candidates_after_filter": 0 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src", - "tests" - ], - "normalized_include_globs": [ - "src", - "tests" - ], - "normalized_exclude_globs": [], - "normalized_prefer_globs": [ - "tests" - ], - "filter_stage": "post_rank", - "candidates_before_filter": 6, - "candidates_after_filter": 6 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src", - "tests" - ], - "normalized_include_globs": [ - "src", - "tests" - ], - "normalized_exclude_globs": [], - "normalized_prefer_globs": [ - "tests" - ], - "filter_stage": "post_rank", - "candidates_before_filter": 10, - "candidates_after_filter": 10 - } - ], - "fallback": { - "used": true, - "reason": "scope_relaxed_no_hits" - }, - "symbol_resolution": { - "status": "not_found", - "resolved_symbol": null, - "alternatives": [ - "WorkflowRuntimeFactory" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "miss", - "hit_count": 0, - "fail_reason": "scope_relaxed_no_hits" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 6, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 10, - "fail_reason": null - } - ] - }, - "constraint_violations": [ - { - "type": "LAYER_MISSING", - "severity": "warn", - "details": { - "layer": "C1_SYMBOL_CATALOG", - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ] - }, - "suggested_fix": "Increase top_k for this layer or relax constraints for retrieval." - } - ], - "timings_ms": { - "router": 1, - "symbol_resolution": 0, - "retrieval_total": 145, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 65, - "C2_DEPENDENCY_GRAPH": 58, - "C0_SOURCE_CHUNKS": 20 - }, - "merge_rank": 0, - "prompt_build": 0, - "llm_call": 1167 - }, - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 1040, - "evidence_rows": 16, - "evidence_chars": 8149 - }, - "evidence_summary": [ - { - "layer": "C2_DEPENDENCY_GRAPH", - "count": 6, - "unique_paths": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 10, - "unique_paths": 1 - } - ], - "prompt_template_id": "intent_code_qa_find_tests_ru_v4", - "system_prompt_version": "v1" - }, - "router": { - "conversation_mode": "START", - "keyword_hints": [ - "WorkflowRuntimeFactory" - ], - "path_scope": [] - }, - "llm": { - "used_evidence_count": 16, - "missing_evidence_reason": null - } - }, - "run_info": { - "case_id": "plba-v2-find-tests-workflow-runtime-factory-negative", - "mode": "full_chain", - "run_started_at": "2026-03-12T14:38:57", - "rag_session_id": "7d11da21-faa0-4cea-aede-aeabe069164c", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - }, - "input_request": { - "text": "Где тесты для WorkflowRuntimeFactory?", - "normalized_query": "Где тесты для WorkflowRuntimeFactory?" - }, - "steps": [ - { - "step": "intent_router", - "input": { - "query": "Где тесты для WorkflowRuntimeFactory?" - }, - "output": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Где тесты для WorkflowRuntimeFactory?" - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "FIND_TESTS", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "WorkflowRuntimeFactory" - ], - "keyword_hints": [ - "WorkflowRuntimeFactory" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**", - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "test_file_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "test_symbol_patterns": [ - "test_workflow_runtime_factory", - "TestWorkflowRuntimeFactory", - "WorkflowRuntimeFactory" - ], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "timings_ms": { - "router": 1 - } - } - }, - { - "step": "retrieval", - "input": { - "query": "Где тесты для WorkflowRuntimeFactory?" - }, - "output": { - "symbol_resolution": { - "status": "not_found", - "resolved_symbol": null, - "alternatives": [ - "WorkflowRuntimeFactory" - ], - "confidence": 0.0 - }, - "rag_count": 16, - "rag_rows": [ - { - "path": "tests/test_business_control_actions.py", - "content": "test_actions_stop_busy_worker_before_timeout\n -> BlockingRoutine\n -> BlockingRoutine.__init__\n -> BlockingRoutine._release\n -> BlockingRoutine.run", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_actions_stop_busy_worker_before_timeout:dataflow_slice", - "span_start": 43, - "span_end": 212, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 5, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "8bd726155ba387d3579763ee84dfd2f9a90bc917da88f3b2e89416ab5c1254d6", - "edge_type": "dataflow_slice", - "src_symbol_id": "a0bb116ca9d909c93a285667ae033fbd1859b2dad7cf34fcb44816393ef6909c", - "src_qname": "test_actions_stop_busy_worker_before_timeout", - "dst_symbol_id": "d9841bdbb69706c988ae7ae6adf89928dc4fae45943f74064f5382177034ba04", - "dst_ref": "BlockingRoutine.run", - "resolution": "resolved", - "slice_id": "8bd726155ba387d3579763ee84dfd2f9a90bc917da88f3b2e89416ab5c1254d6", - "root_symbol_id": "a0bb116ca9d909c93a285667ae033fbd1859b2dad7cf34fcb44816393ef6909c", - "path_symbols": [ - "test_actions_stop_busy_worker_before_timeout", - "BlockingRoutine", - "BlockingRoutine.__init__", - "BlockingRoutine._release", - "BlockingRoutine.run" - ], - "path_symbol_ids": [ - "a0bb116ca9d909c93a285667ae033fbd1859b2dad7cf34fcb44816393ef6909c", - "a3349c5bc65e4003a4bbd6a8dbb7a54c337e12d1aed930caa701b12e520f1e67", - "486deeed3043c6db985aef258e96ddc67aa53608e67a83962fbd2471f649ddf1", - "d9841bdbb69706c988ae7ae6adf89928dc4fae45943f74064f5382177034ba04" - ], - "path_edge_types": [ - "instantiates", - "writes_attr", - "reads_attr" - ], - "path_length": 5, - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "test_worker_wakes_up_with_configured_interval\n -> ScenarioWorker\n -> ScenarioWorker.__init__\n -> ScenarioWorker._name\n -> ScenarioWorker.name", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_worker_wakes_up_with_configured_interval:dataflow_slice", - "span_start": 52, - "span_end": 166, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 5, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "2fd137f5852febe907f44d3b3e4ea430f89ccfe962ae1442a16ab9df64c8f76c", - "edge_type": "dataflow_slice", - "src_symbol_id": "65f877f78191d65e6a752e41cedc70ebc784c266804a55c1c56440336e1f0d6e", - "src_qname": "test_worker_wakes_up_with_configured_interval", - "dst_symbol_id": "da022da2c49fd9cfd09d6e6da6bbd59aaa7d28efd669ce8444e88d327ddec2fc", - "dst_ref": "ScenarioWorker.name", - "resolution": "resolved", - "slice_id": "2fd137f5852febe907f44d3b3e4ea430f89ccfe962ae1442a16ab9df64c8f76c", - "root_symbol_id": "65f877f78191d65e6a752e41cedc70ebc784c266804a55c1c56440336e1f0d6e", - "path_symbols": [ - "test_worker_wakes_up_with_configured_interval", - "ScenarioWorker", - "ScenarioWorker.__init__", - "ScenarioWorker._name", - "ScenarioWorker.name" - ], - "path_symbol_ids": [ - "65f877f78191d65e6a752e41cedc70ebc784c266804a55c1c56440336e1f0d6e", - "9a1d08a7eb1831c9f2e0db361b5207f036e477c160773ae08c0b287239785c52", - "9c20be046ba06644d1432e0f20eb223663d2b116ee7d91fdc62bc68323f2e593", - "da022da2c49fd9cfd09d6e6da6bbd59aaa7d28efd669ce8444e88d327ddec2fc" - ], - "path_edge_types": [ - "instantiates", - "writes_attr", - "reads_attr" - ], - "path_length": 5, - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "test_actions_stop_busy_worker_before_timeout\n -> BlockingRoutine\n -> BlockingRoutine.__init__\n -> BlockingRoutine._started\n -> BlockingRoutine.run", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_actions_stop_busy_worker_before_timeout:dataflow_slice", - "span_start": 42, - "span_end": 212, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 5, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "f9bcce108870e49afa8b32d4625115a10707a3b0e7473179e958e5752bf258b4", - "edge_type": "dataflow_slice", - "src_symbol_id": "a0bb116ca9d909c93a285667ae033fbd1859b2dad7cf34fcb44816393ef6909c", - "src_qname": "test_actions_stop_busy_worker_before_timeout", - "dst_symbol_id": "d9841bdbb69706c988ae7ae6adf89928dc4fae45943f74064f5382177034ba04", - "dst_ref": "BlockingRoutine.run", - "resolution": "resolved", - "slice_id": "f9bcce108870e49afa8b32d4625115a10707a3b0e7473179e958e5752bf258b4", - "root_symbol_id": "a0bb116ca9d909c93a285667ae033fbd1859b2dad7cf34fcb44816393ef6909c", - "path_symbols": [ - "test_actions_stop_busy_worker_before_timeout", - "BlockingRoutine", - "BlockingRoutine.__init__", - "BlockingRoutine._started", - "BlockingRoutine.run" - ], - "path_symbol_ids": [ - "a0bb116ca9d909c93a285667ae033fbd1859b2dad7cf34fcb44816393ef6909c", - "a3349c5bc65e4003a4bbd6a8dbb7a54c337e12d1aed930caa701b12e520f1e67", - "486deeed3043c6db985aef258e96ddc67aa53608e67a83962fbd2471f649ddf1", - "d9841bdbb69706c988ae7ae6adf89928dc4fae45943f74064f5382177034ba04" - ], - "path_edge_types": [ - "instantiates", - "writes_attr", - "reads_attr" - ], - "path_length": 5, - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "test_actions_stop_busy_worker_after_timeout\n -> BlockingRoutine\n -> BlockingRoutine.__init__\n -> BlockingRoutine._started\n -> BlockingRoutine.run", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_actions_stop_busy_worker_after_timeout:dataflow_slice", - "span_start": 42, - "span_end": 238, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 5, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "8e7db3d2a9226f1c1d9942ac6373cfcafa0d2276758ddb8a3d3c455a3d58024d", - "edge_type": "dataflow_slice", - "src_symbol_id": "66392d3222421d9ba16eda3554940b16e7d5a6f33aa08c5738d35af2e32f1e4a", - "src_qname": "test_actions_stop_busy_worker_after_timeout", - "dst_symbol_id": "d9841bdbb69706c988ae7ae6adf89928dc4fae45943f74064f5382177034ba04", - "dst_ref": "BlockingRoutine.run", - "resolution": "resolved", - "slice_id": "8e7db3d2a9226f1c1d9942ac6373cfcafa0d2276758ddb8a3d3c455a3d58024d", - "root_symbol_id": "66392d3222421d9ba16eda3554940b16e7d5a6f33aa08c5738d35af2e32f1e4a", - "path_symbols": [ - "test_actions_stop_busy_worker_after_timeout", - "BlockingRoutine", - "BlockingRoutine.__init__", - "BlockingRoutine._started", - "BlockingRoutine.run" - ], - "path_symbol_ids": [ - "66392d3222421d9ba16eda3554940b16e7d5a6f33aa08c5738d35af2e32f1e4a", - "a3349c5bc65e4003a4bbd6a8dbb7a54c337e12d1aed930caa701b12e520f1e67", - "486deeed3043c6db985aef258e96ddc67aa53608e67a83962fbd2471f649ddf1", - "d9841bdbb69706c988ae7ae6adf89928dc4fae45943f74064f5382177034ba04" - ], - "path_edge_types": [ - "instantiates", - "writes_attr", - "reads_attr" - ], - "path_length": 5, - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "test_actions_stop_busy_worker_after_timeout\n -> BlockingRoutine\n -> BlockingRoutine.__init__\n -> BlockingRoutine._release\n -> BlockingRoutine.run", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_actions_stop_busy_worker_after_timeout:dataflow_slice", - "span_start": 43, - "span_end": 238, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 5, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "b59da9da82f9dfc8a9b695a08213786385da1ae9e17561ec3a0450a574a8cb39", - "edge_type": "dataflow_slice", - "src_symbol_id": "66392d3222421d9ba16eda3554940b16e7d5a6f33aa08c5738d35af2e32f1e4a", - "src_qname": "test_actions_stop_busy_worker_after_timeout", - "dst_symbol_id": "d9841bdbb69706c988ae7ae6adf89928dc4fae45943f74064f5382177034ba04", - "dst_ref": "BlockingRoutine.run", - "resolution": "resolved", - "slice_id": "b59da9da82f9dfc8a9b695a08213786385da1ae9e17561ec3a0450a574a8cb39", - "root_symbol_id": "66392d3222421d9ba16eda3554940b16e7d5a6f33aa08c5738d35af2e32f1e4a", - "path_symbols": [ - "test_actions_stop_busy_worker_after_timeout", - "BlockingRoutine", - "BlockingRoutine.__init__", - "BlockingRoutine._release", - "BlockingRoutine.run" - ], - "path_symbol_ids": [ - "66392d3222421d9ba16eda3554940b16e7d5a6f33aa08c5738d35af2e32f1e4a", - "a3349c5bc65e4003a4bbd6a8dbb7a54c337e12d1aed930caa701b12e520f1e67", - "486deeed3043c6db985aef258e96ddc67aa53608e67a83962fbd2471f649ddf1", - "d9841bdbb69706c988ae7ae6adf89928dc4fae45943f74064f5382177034ba04" - ], - "path_edge_types": [ - "instantiates", - "writes_attr", - "reads_attr" - ], - "path_length": 5, - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "test_actions_start_stop_and_health_when_worker_is_idle\n -> ScenarioWorker\n -> ScenarioWorker.__init__\n -> ScenarioWorker._name\n -> ScenarioWorker.name", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_actions_start_stop_and_health_when_worker_is_idle:dataflow_slice", - "span_start": 52, - "span_end": 182, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 5, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "8fb3c9e775ad1cfa91eebb8b8cef367dc53c923584236122235446e0579b468e", - "edge_type": "dataflow_slice", - "src_symbol_id": "09a78d8eb31c2da14fee58da53b5da7a5065a4c23b6300748a6d44517a5284b8", - "src_qname": "test_actions_start_stop_and_health_when_worker_is_idle", - "dst_symbol_id": "da022da2c49fd9cfd09d6e6da6bbd59aaa7d28efd669ce8444e88d327ddec2fc", - "dst_ref": "ScenarioWorker.name", - "resolution": "resolved", - "slice_id": "8fb3c9e775ad1cfa91eebb8b8cef367dc53c923584236122235446e0579b468e", - "root_symbol_id": "09a78d8eb31c2da14fee58da53b5da7a5065a4c23b6300748a6d44517a5284b8", - "path_symbols": [ - "test_actions_start_stop_and_health_when_worker_is_idle", - "ScenarioWorker", - "ScenarioWorker.__init__", - "ScenarioWorker._name", - "ScenarioWorker.name" - ], - "path_symbol_ids": [ - "09a78d8eb31c2da14fee58da53b5da7a5065a4c23b6300748a6d44517a5284b8", - "9a1d08a7eb1831c9f2e0db361b5207f036e477c160773ae08c0b287239785c52", - "9c20be046ba06644d1432e0f20eb223663d2b116ee7d91fdc62bc68323f2e593", - "da022da2c49fd9cfd09d6e6da6bbd59aaa7d28efd669ce8444e88d327ddec2fc" - ], - "path_edge_types": [ - "instantiates", - "writes_attr", - "reads_attr" - ], - "path_length": 5, - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "def test_actions_start_stop_and_health_when_worker_is_idle() -> None:\n runtime, base_url = _build_runtime(ScenarioWorker(\"idle-worker\", IntervalRoutine(), interval=0.2))\n try:\n stop_status, stop_payload = _http_call_json(base_url, \"/actions/stop\", method=\"POST\")\n assert stop_status == 200\n assert isinstance(stop_payload.get(\"detail\"), dict)\n assert stop_payload[\"detail\"][\"timed_out\"] is False\n assert stop_payload[\"detail\"][\"state\"] == \"stopped\"\n\n health_stopped_status, health_stopped_payload = _http_call_json(base_url, \"/health\")\n assert health_stopped_status == 503\n assert health_stopped_payload[\"state\"] == \"stopped\"\n assert health_stopped_payload[\"status\"] == \"unhealthy\"\n\n start_status, start_payload = _http_call_json(base_url, \"/actions/start\", method=\"POST\")\n assert start_status == 200\n assert isinstance(start_payload.get(\"detail\"), dict)\n assert start_payload[\"detail\"][\"timed_out\"] is False\n assert start_payload[\"detail\"][\"state\"] in {\"idle\", \"busy\"}\n\n health_started_status, health_started_payload = _http_call_json(base_url, \"/health\")\n assert health_started_status == 200\n assert health_started_payload[\"status\"] == \"ok\"\n assert health_started_payload[\"state\"] in {\"idle\", \"busy\"}\n finally:\n runtime.stop()", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:test_actions_start_stop_and_health_when_worker_is_idle", - "span_start": 181, - "span_end": 206, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 8, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "def _poll_until_stopped(base_url: str, timeout: float = 2.0) -> bool:\n deadline = monotonic() + timeout\n while monotonic() < deadline:\n _, payload = _http_call_json(base_url, \"/actions/status\")\n if payload.get(\"detail\") == \"stopped\":\n return True\n sleep(0.05)\n return False", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:_poll_until_stopped", - "span_start": 144, - "span_end": 151, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 5, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "def test_worker_wakes_up_with_configured_interval() -> None:\n interval = 0.15\n routine = IntervalRoutine()\n worker = ScenarioWorker(\"interval-worker\", routine, interval=interval)\n runtime = RuntimeManager()\n runtime.register_module(WorkerModule(worker))\n\n runtime.start()\n try:\n assert routine.wait_runs(count=3, timeout=2.0) is True\n finally:\n runtime.stop()\n\n deltas = routine.deltas()\n assert len(deltas) >= 2\n assert all(delta >= interval * 0.7 for delta in deltas[:2])", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:test_worker_wakes_up_with_configured_interval", - "span_start": 163, - "span_end": 178, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 7, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "class BlockingRoutine:\n def __init__(self, started: Event, release: Event) -> None:\n self._started = started\n self._release = release\n\n def run(self) -> None:\n self._started.set()\n self._release.wait(timeout=5.0)", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:BlockingRoutine", - "span_start": 40, - "span_end": 47, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 1, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "class WorkerModule(ApplicationModule):\n def __init__(self, worker: Worker) -> None:\n self._worker = worker\n\n @property\n def name(self) -> str:\n return \"business-tests\"\n\n def register(self, registry: ModuleRegistry) -> None:\n registry.add_worker(self._worker)", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:WorkerModule", - "span_start": 113, - "span_end": 122, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 3, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "def _http_call_json(\n base_url: str,\n path: str,\n *,\n method: str = \"GET\",\n headers: dict[str, str] | None = None,\n) -> tuple[int, dict[str, object]]:\n request = Request(f\"{base_url}{path}\", method=method, headers=headers or {})\n try:\n with urlopen(request, timeout=15.0) as response:\n status = response.status\n body = response.read()\n except HTTPError as error:\n status = error.code\n body = error.read()\n payload = json.loads(body.decode(\"utf-8\"))\n return status, payload", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:_http_call_json", - "span_start": 125, - "span_end": 141, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 4, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "def _build_runtime(worker: Worker, *, control_timeout: int = 1) -> tuple[RuntimeManager, str]:\n runtime = RuntimeManager()\n channel = HttpControlChannel(host=\"127.0.0.1\", port=0, timeout=control_timeout)\n runtime.control_plane.register_channel(channel)\n runtime.register_module(WorkerModule(worker))\n runtime.start()\n return runtime, f\"http://127.0.0.1:{channel.port}\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:_build_runtime", - "span_start": 154, - "span_end": 160, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 6, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "class ScenarioWorker(Worker):\n def __init__(self, name: str, routine: object, *, interval: float = 0.05) -> None:\n self._name = name\n self._routine = routine\n self._interval = interval\n self._thread: Thread | None = None\n self._stop_requested = Event()\n self._in_flight = 0\n self._runs = 0\n self._lock = Lock()\n\n @property\n def name(self) -> str:\n return self._name\n\n @property\n def critical(self) -> bool:\n return True\n\n def start(self) -> None:\n if self._thread is not None and self._thread.is_alive():\n return\n self._stop_requested.clear()\n self._thread = Thread(target=self._loop, name=f\"{self._name}-thread\", daemon=True)\n self._thread.start()\n\n def stop(self, force: bool = False) -> None:\n self._stop_requested.set()\n\n def health(self) -> WorkerHealth:\n return WorkerHealth(name=self.name, status=\"ok\", critical=True, meta={\"runs\": self._runs})\n\n def status(self) -> WorkerStatus:\n thread_alive = self._thread is not None and self._thread.is_alive()\n with self._lock:\n in_flight = self._in_flight\n runs = self._runs\n if not thread_alive:\n state = \"stopped\"\n elif self._stop_requested.is_set():\n state = \"stopping\"\n elif in_flight > 0:\n state = \"busy\"\n else:\n state = \"idle\"\n return WorkerStatus(name=self.name, state=state, in_flight=in_flight, meta={\"runs\": runs})\n\n def _loop(self) -> None:\n while not self._stop_requested.is_set():\n with self._lock:\n self._in_flight += 1\n try:\n self._routine.run()\n with self._lock:\n self._runs += 1\n finally:\n with self._lock:\n self._in_flight -= 1\n if self._stop_requested.is_set():\n return\n sleep(self._interval)", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:ScenarioWorker", - "span_start": 50, - "span_end": 110, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 2, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "class IntervalRoutine:\n calls: list[float] = field(default_factory=list)\n _lock: Lock = field(default_factory=Lock)\n\n def run(self) -> None:\n with self._lock:\n self.calls.append(monotonic())\n\n def wait_runs(self, count: int, timeout: float) -> bool:\n deadline = monotonic() + timeout\n while monotonic() < deadline:\n with self._lock:\n if len(self.calls) >= count:\n return True\n sleep(0.01)\n return False\n\n def deltas(self) -> list[float]:\n with self._lock:\n return [self.calls[index + 1] - self.calls[index] for index in range(len(self.calls) - 1)]", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:IntervalRoutine", - "span_start": 18, - "span_end": 37, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "def test_actions_stop_busy_worker_before_timeout() -> None:\n started = Event()\n release = Event()\n runtime, base_url = _build_runtime(ScenarioWorker(\"busy-worker\", BlockingRoutine(started, release)))\n assert started.wait(timeout=1.0) is True\n\n def release_later() -> None:\n sleep(0.2)\n release.set()\n\n Thread(target=release_later, daemon=True).start()\n try:\n status, payload = _http_call_json(base_url, \"/actions/stop\", method=\"POST\")\n assert status == 200\n assert isinstance(payload.get(\"detail\"), dict)\n assert payload[\"detail\"][\"timed_out\"] is False\n assert payload[\"detail\"][\"state\"] == \"stopped\"\n\n health_status, health_payload = _http_call_json(base_url, \"/health\")\n assert health_status == 503\n assert health_payload[\"status\"] == \"unhealthy\"\n assert health_payload[\"state\"] == \"stopped\"\n finally:\n runtime.stop()", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:test_actions_stop_busy_worker_before_timeout", - "span_start": 209, - "span_end": 232, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 9, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ] - }, - "diagnostics": { - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C0_SOURCE_CHUNKS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C0_SOURCE_CHUNKS": 10 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [], - "include_globs": [ - "src", - "tests" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests" - ] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src", - "tests" - ], - "include_globs": [ - "src", - "tests" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests" - ] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src", - "tests" - ], - "include_globs": [ - "src", - "tests" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests" - ] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "WorkflowRuntimeFactory", - "path_scope": [], - "include_globs": [ - "src/**", - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "Где тесты для WorkflowRuntimeFactory? test_workflow_runtime_factory TestWorkflowRuntimeFactory WorkflowRuntimeFactory", - "path_scope": [], - "include_globs": [ - "src/**", - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "top_k": 6, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Где тесты для WorkflowRuntimeFactory? test_workflow_runtime_factory TestWorkflowRuntimeFactory WorkflowRuntimeFactory", - "path_scope": [], - "include_globs": [ - "src/**", - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "top_k": 10, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [], - "normalized_include_globs": [ - "src", - "tests" - ], - "normalized_exclude_globs": [], - "normalized_prefer_globs": [ - "tests" - ], - "filter_stage": "post_rank", - "candidates_before_filter": 0, - "candidates_after_filter": 0 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src", - "tests" - ], - "normalized_include_globs": [ - "src", - "tests" - ], - "normalized_exclude_globs": [], - "normalized_prefer_globs": [ - "tests" - ], - "filter_stage": "post_rank", - "candidates_before_filter": 6, - "candidates_after_filter": 6 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src", - "tests" - ], - "normalized_include_globs": [ - "src", - "tests" - ], - "normalized_exclude_globs": [], - "normalized_prefer_globs": [ - "tests" - ], - "filter_stage": "post_rank", - "candidates_before_filter": 10, - "candidates_after_filter": 10 - } - ], - "fallback": { - "used": true, - "reason": "scope_relaxed_no_hits" - }, - "symbol_resolution": { - "status": "not_found", - "resolved_symbol": null, - "alternatives": [ - "WorkflowRuntimeFactory" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "miss", - "hit_count": 0, - "fail_reason": "scope_relaxed_no_hits" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 6, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 10, - "fail_reason": null - } - ] - }, - "constraint_violations": [ - { - "type": "LAYER_MISSING", - "severity": "warn", - "details": { - "layer": "C1_SYMBOL_CATALOG", - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ] - }, - "suggested_fix": "Increase top_k for this layer or relax constraints for retrieval." - } - ], - "timings_ms": { - "symbol_resolution": 0, - "retrieval_total": 145, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 65, - "C2_DEPENDENCY_GRAPH": 58, - "C0_SOURCE_CHUNKS": 20 - }, - "merge_rank": 0 - } - } - }, - { - "step": "llm_answer", - "input": { - "query": "Где тесты для WorkflowRuntimeFactory?", - "rag_count": 16 - }, - "output": { - "llm_answer": "Прямых тестов конкретно для `WorkflowRuntimeFactory` в предоставленном контексте не обнаружено." - }, - "diagnostics": { - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 1040, - "evidence_rows": 16, - "evidence_chars": 8149 - }, - "evidence_summary": [ - { - "layer": "C2_DEPENDENCY_GRAPH", - "count": 6, - "unique_paths": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 10, - "unique_paths": 1 - } - ], - "prompt_template_id": "intent_code_qa_find_tests_ru_v4", - "system_prompt_version": "v1" - }, - "timings_ms": { - "prompt_build": 0, - "llm_call": 1167 - } - } - } - ] - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_143856/full_chain_plba_code_subintents_v2_plba-v2-find-tests-workflow-runtime-factory-negative.md b/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_143856/full_chain_plba_code_subintents_v2_plba-v2-find-tests-workflow-runtime-factory-negative.md deleted file mode 100644 index b2f5045..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_143856/full_chain_plba_code_subintents_v2_plba-v2-find-tests-workflow-runtime-factory-negative.md +++ /dev/null @@ -1,32 +0,0 @@ -# plba-v2-find-tests-workflow-runtime-factory-negative - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_subintents_v2.yaml -- runner: runtime -- mode: full_chain -- passed: True - -## Query -Где тесты для WorkflowRuntimeFactory? - -## Actual -{ - "intent": "CODE_QA", - "sub_intent": "FIND_TESTS", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 16, - "llm_answer": "Прямых тестов конкретно для `WorkflowRuntimeFactory` в предоставленном контексте не обнаружено.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "WorkflowRuntimeFactory" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ] -} - -## Mismatches -- none \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_143856/full_chain_plba_code_subintents_v2_plba-v2-open-file-nonexistent.json b/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_143856/full_chain_plba_code_subintents_v2_plba-v2-open-file-nonexistent.json deleted file mode 100644 index ca6ffd0..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_143856/full_chain_plba_code_subintents_v2_plba-v2-open-file-nonexistent.json +++ /dev/null @@ -1,441 +0,0 @@ -{ - "case_id": "plba-v2-open-file-nonexistent", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_subintents_v2.yaml", - "runner": "runtime", - "mode": "full_chain", - "actual": { - "intent": "CODE_QA", - "sub_intent": "OPEN_FILE", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 0, - "llm_answer": "Файл src/app_runtime/core/missing_runtime.py не найден.", - "answer_mode": "degraded", - "path_scope": [ - "src/app_runtime/core/missing_runtime.py" - ], - "symbol_candidates": [], - "layers": [ - "C0_SOURCE_CHUNKS" - ] - }, - "passed": true, - "mismatches": [], - "details": { - "case_id": "plba-v2-open-file-nonexistent", - "text": "Открой файл src/app_runtime/core/missing_runtime.py", - "mode": "full_chain", - "run_started_at": "2026-03-12T14:38:57", - "rag_session_id": "7d11da21-faa0-4cea-aede-aeabe069164c", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Открой файл src/app_runtime/core/missing_runtime.py", - "symbol_resolution": { - "status": "not_requested", - "resolved_symbol": null, - "alternatives": [], - "confidence": 0.0 - }, - "rag_count": 0, - "rag_rows": [], - "llm_answer": "Файл src/app_runtime/core/missing_runtime.py не найден.", - "summary": { - "router": { - "intent": "CODE_QA", - "sub_intent": "OPEN_FILE", - "confidence": null - }, - "retrieval": { - "profile": "code", - "layers_hit": [], - "evidence_sufficient": false - }, - "llm": { - "answer_status": "degraded", - "groundedness": "weakly_grounded" - } - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "OPEN_FILE", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C0_SOURCE_CHUNKS" - ], - "symbol_kind_hint": "unknown", - "symbol_candidates": [], - "keyword_hints": [], - "path_hints": [ - "src/app_runtime/core/missing_runtime.py" - ], - "path_scope": [ - "src/app_runtime/core/missing_runtime.py" - ], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/app_runtime/core/missing_runtime.py" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": false, - "max_distance": 2, - "top_k": 5 - } - } - }, - "execution": { - "executed_layers": [ - "C0_SOURCE_CHUNKS" - ], - "retrieval_mode_by_layer": { - "C0_SOURCE_CHUNKS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C0_SOURCE_CHUNKS": 200 - }, - "filters_by_layer": { - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src/app_runtime/core/missing_runtime.py" - ], - "include_globs": [], - "exclude_globs": [], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": null, - "workspace_id": null, - "returned_repo_ids": [], - "returned_workspace_ids": [] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Открой файл src/app_runtime/core/missing_runtime.py", - "path_scope": [ - "src/app_runtime/core/missing_runtime.py" - ], - "include_globs": [], - "exclude_globs": [], - "prefer_globs": [], - "top_k": 200, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src/app_runtime/core/missing_runtime.py" - ], - "normalized_include_globs": [], - "normalized_exclude_globs": [], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 0, - "candidates_after_filter": 0 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "not_requested", - "resolved_symbol": null, - "alternatives": [] - }, - "layers": [ - { - "layer": "C0_SOURCE_CHUNKS", - "status": "miss", - "hit_count": 0, - "fail_reason": null - } - ] - }, - "constraint_violations": [ - { - "type": "PATH_SCOPE_NOT_SATISFIED", - "severity": "error", - "details": { - "path_scope": [ - "src/app_runtime/core/missing_runtime.py" - ], - "returned_paths": [] - }, - "suggested_fix": "Use exact path_scope retrieval and disable broad fallback for OPEN_FILE." - }, - { - "type": "LAYER_MISSING", - "severity": "warn", - "details": { - "layer": "C0_SOURCE_CHUNKS", - "requested_layers": [ - "C0_SOURCE_CHUNKS" - ] - }, - "suggested_fix": "Increase top_k for this layer or relax constraints for retrieval." - } - ], - "timings_ms": { - "router": 0, - "symbol_resolution": 0, - "retrieval_total": 11, - "retrieval_by_layer": { - "C0_SOURCE_CHUNKS": 11 - }, - "merge_rank": 0, - "prompt_build": 0, - "llm_call": 0 - }, - "prompt": null, - "answer_policy": { - "short_circuit": true, - "answer_mode": "degraded", - "failure_reason": "file_not_found" - }, - "router": { - "conversation_mode": "START", - "keyword_hints": [], - "path_scope": [ - "src/app_runtime/core/missing_runtime.py" - ] - }, - "llm": { - "used_evidence_count": 0, - "missing_evidence_reason": "file_not_found" - } - }, - "run_info": { - "case_id": "plba-v2-open-file-nonexistent", - "mode": "full_chain", - "run_started_at": "2026-03-12T14:38:57", - "rag_session_id": "7d11da21-faa0-4cea-aede-aeabe069164c", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - }, - "input_request": { - "text": "Открой файл src/app_runtime/core/missing_runtime.py", - "normalized_query": "Открой файл src/app_runtime/core/missing_runtime.py" - }, - "steps": [ - { - "step": "intent_router", - "input": { - "query": "Открой файл src/app_runtime/core/missing_runtime.py" - }, - "output": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Открой файл src/app_runtime/core/missing_runtime.py" - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "OPEN_FILE", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C0_SOURCE_CHUNKS" - ], - "symbol_kind_hint": "unknown", - "symbol_candidates": [], - "keyword_hints": [], - "path_hints": [ - "src/app_runtime/core/missing_runtime.py" - ], - "path_scope": [ - "src/app_runtime/core/missing_runtime.py" - ], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/app_runtime/core/missing_runtime.py" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": false, - "max_distance": 2, - "top_k": 5 - } - } - }, - "timings_ms": { - "router": 0 - } - } - }, - { - "step": "retrieval", - "input": { - "query": "Открой файл src/app_runtime/core/missing_runtime.py" - }, - "output": { - "symbol_resolution": { - "status": "not_requested", - "resolved_symbol": null, - "alternatives": [], - "confidence": 0.0 - }, - "rag_count": 0, - "rag_rows": [] - }, - "diagnostics": { - "execution": { - "executed_layers": [ - "C0_SOURCE_CHUNKS" - ], - "retrieval_mode_by_layer": { - "C0_SOURCE_CHUNKS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C0_SOURCE_CHUNKS": 200 - }, - "filters_by_layer": { - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src/app_runtime/core/missing_runtime.py" - ], - "include_globs": [], - "exclude_globs": [], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": null, - "workspace_id": null, - "returned_repo_ids": [], - "returned_workspace_ids": [] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Открой файл src/app_runtime/core/missing_runtime.py", - "path_scope": [ - "src/app_runtime/core/missing_runtime.py" - ], - "include_globs": [], - "exclude_globs": [], - "prefer_globs": [], - "top_k": 200, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src/app_runtime/core/missing_runtime.py" - ], - "normalized_include_globs": [], - "normalized_exclude_globs": [], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 0, - "candidates_after_filter": 0 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "not_requested", - "resolved_symbol": null, - "alternatives": [] - }, - "layers": [ - { - "layer": "C0_SOURCE_CHUNKS", - "status": "miss", - "hit_count": 0, - "fail_reason": null - } - ] - }, - "constraint_violations": [ - { - "type": "PATH_SCOPE_NOT_SATISFIED", - "severity": "error", - "details": { - "path_scope": [ - "src/app_runtime/core/missing_runtime.py" - ], - "returned_paths": [] - }, - "suggested_fix": "Use exact path_scope retrieval and disable broad fallback for OPEN_FILE." - }, - { - "type": "LAYER_MISSING", - "severity": "warn", - "details": { - "layer": "C0_SOURCE_CHUNKS", - "requested_layers": [ - "C0_SOURCE_CHUNKS" - ] - }, - "suggested_fix": "Increase top_k for this layer or relax constraints for retrieval." - } - ], - "timings_ms": { - "symbol_resolution": 0, - "retrieval_total": 11, - "retrieval_by_layer": { - "C0_SOURCE_CHUNKS": 11 - }, - "merge_rank": 0 - } - } - }, - { - "step": "llm_answer", - "input": { - "query": "Открой файл src/app_runtime/core/missing_runtime.py", - "rag_count": 0 - }, - "output": { - "llm_answer": "Файл src/app_runtime/core/missing_runtime.py не найден." - }, - "diagnostics": { - "prompt": null, - "timings_ms": { - "prompt_build": 0, - "llm_call": 0 - } - } - } - ] - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_143856/full_chain_plba_code_subintents_v2_plba-v2-open-file-nonexistent.md b/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_143856/full_chain_plba_code_subintents_v2_plba-v2-open-file-nonexistent.md deleted file mode 100644 index ab3d085..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_143856/full_chain_plba_code_subintents_v2_plba-v2-open-file-nonexistent.md +++ /dev/null @@ -1,30 +0,0 @@ -# plba-v2-open-file-nonexistent - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_subintents_v2.yaml -- runner: runtime -- mode: full_chain -- passed: True - -## Query -Открой файл src/app_runtime/core/missing_runtime.py - -## Actual -{ - "intent": "CODE_QA", - "sub_intent": "OPEN_FILE", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 0, - "llm_answer": "Файл src/app_runtime/core/missing_runtime.py не найден.", - "answer_mode": "degraded", - "path_scope": [ - "src/app_runtime/core/missing_runtime.py" - ], - "symbol_candidates": [], - "layers": [ - "C0_SOURCE_CHUNKS" - ] -} - -## Mismatches -- none \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_143856/full_chain_plba_code_subintents_v2_plba-v2-open-file-public-api.json b/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_143856/full_chain_plba_code_subintents_v2_plba-v2-open-file-public-api.json deleted file mode 100644 index 5ef153a..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_143856/full_chain_plba_code_subintents_v2_plba-v2-open-file-public-api.json +++ /dev/null @@ -1,492 +0,0 @@ -{ - "case_id": "plba-v2-open-file-public-api", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_subintents_v2.yaml", - "runner": "runtime", - "mode": "full_chain", - "actual": { - "intent": "CODE_QA", - "sub_intent": "OPEN_FILE", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 1, - "llm_answer": "В файле src/plba/__init__.py видны следующие импорты и объявления:\nИмпорты:\n- plba.bootstrap.create_runtime\n- plba.config.ConfigFileLoader, FileConfigProvider\n- plba.control.ControlActionSet, ControlChannel, ControlPlaneService, HttpControlChannel\n- plba.contracts.ApplicationModule, ConfigProvider, HealthContributor, TraceContext, TraceContextRecord, TraceLogMessage, TraceTransport, Worker, WorkerHealth, WorkerStatus\n- plba.core.ConfigurationManager, RuntimeManager, ServiceContainer\n- plba.health.HealthRegistry\n- plba.logging.LogManager\n- plba.queue.InMemoryTaskQueue\n- plba.tracing.MySqlTraceTransport, NoOpTraceTransport, TraceService\n- plba.workflow.StepResult, WorkflowContext, WorkflowDefinition, WorkflowEngine, WorkflowEngineHooks, WorkflowNode, WorkflowRuntimeFactory, WorkflowStep\n- plba.workers.WorkerSupervisor\n\nОбъявления:\n- __all__ содержит список экспортированных элементов.", - "answer_mode": "answered", - "path_scope": [ - "src/plba/__init__.py" - ], - "symbol_candidates": [], - "layers": [ - "C0_SOURCE_CHUNKS" - ] - }, - "passed": true, - "mismatches": [], - "details": { - "case_id": "plba-v2-open-file-public-api", - "text": "Открой файл src/plba/__init__.py", - "mode": "full_chain", - "run_started_at": "2026-03-12T14:38:57", - "rag_session_id": "7d11da21-faa0-4cea-aede-aeabe069164c", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Открой файл src/plba/__init__.py", - "symbol_resolution": { - "status": "not_requested", - "resolved_symbol": null, - "alternatives": [], - "confidence": 0.0 - }, - "rag_count": 1, - "rag_rows": [ - { - "path": "src/plba/__init__.py", - "content": "from plba.bootstrap import create_runtime\nfrom plba.config import ConfigFileLoader, FileConfigProvider\nfrom plba.control import ControlActionSet, ControlChannel, ControlPlaneService, HttpControlChannel\nfrom plba.contracts import (\n ApplicationModule,\n ConfigProvider,\n HealthContributor,\n TraceContext,\n TraceContextRecord,\n TraceLogMessage,\n TraceTransport,\n Worker,\n WorkerHealth,\n WorkerStatus,\n)\nfrom plba.core import ConfigurationManager, RuntimeManager, ServiceContainer\nfrom plba.health import HealthRegistry\nfrom plba.logging import LogManager\nfrom plba.queue import InMemoryTaskQueue\nfrom plba.tracing import MySqlTraceTransport, NoOpTraceTransport, TraceService\nfrom plba.workflow import (\n StepResult,\n WorkflowContext,\n WorkflowDefinition,\n WorkflowEngine,\n WorkflowEngineHooks,\n WorkflowNode,\n WorkflowRuntimeFactory,\n WorkflowStep,\n)\nfrom plba.workers import WorkerSupervisor\n\n__all__ = [\n \"ApplicationModule\",\n \"ConfigFileLoader\",\n \"ConfigProvider\",\n \"ConfigurationManager\",\n \"ControlActionSet\",\n \"ControlChannel\",\n \"ControlPlaneService\",\n \"create_runtime\",\n \"FileConfigProvider\",\n \"HealthContributor\",\n \"HealthRegistry\",\n \"HttpControlChannel\",\n \"InMemoryTaskQueue\",\n \"LogManager\",\n \"MySqlTraceTransport\",\n \"NoOpTraceTransport\",\n \"RuntimeManager\",\n \"ServiceContainer\",\n \"TraceContext\",\n \"TraceContextRecord\",\n \"TraceLogMessage\",\n \"TraceService\",\n \"TraceTransport\",\n \"StepResult\",\n \"Worker\",\n \"WorkerHealth\",\n \"WorkerStatus\",\n \"WorkflowContext\",\n \"WorkflowDefinition\",\n \"WorkflowEngine\",\n \"WorkflowEngineHooks\",\n \"WorkflowNode\",\n \"WorkflowRuntimeFactory\",\n \"WorkflowStep\",\n \"WorkerSupervisor\",\n]", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/plba/__init__.py:1-69", - "span_start": 1, - "span_end": 69, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.plba.__init__", - "is_test": false, - "blob_sha": "24e755ec8c249d14fb0e675b5dbf2b71ab91afb9c849897eebfa9feb2499e19d", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "llm_answer": "В файле src/plba/__init__.py видны следующие импорты и объявления:\nИмпорты:\n- plba.bootstrap.create_runtime\n- plba.config.ConfigFileLoader, FileConfigProvider\n- plba.control.ControlActionSet, ControlChannel, ControlPlaneService, HttpControlChannel\n- plba.contracts.ApplicationModule, ConfigProvider, HealthContributor, TraceContext, TraceContextRecord, TraceLogMessage, TraceTransport, Worker, WorkerHealth, WorkerStatus\n- plba.core.ConfigurationManager, RuntimeManager, ServiceContainer\n- plba.health.HealthRegistry\n- plba.logging.LogManager\n- plba.queue.InMemoryTaskQueue\n- plba.tracing.MySqlTraceTransport, NoOpTraceTransport, TraceService\n- plba.workflow.StepResult, WorkflowContext, WorkflowDefinition, WorkflowEngine, WorkflowEngineHooks, WorkflowNode, WorkflowRuntimeFactory, WorkflowStep\n- plba.workers.WorkerSupervisor\n\nОбъявления:\n- __all__ содержит список экспортированных элементов.", - "summary": { - "router": { - "intent": "CODE_QA", - "sub_intent": "OPEN_FILE", - "confidence": null - }, - "retrieval": { - "profile": "code", - "layers_hit": [ - "C0_SOURCE_CHUNKS" - ], - "evidence_sufficient": true - }, - "llm": { - "answer_status": "answered", - "groundedness": "grounded" - } - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "OPEN_FILE", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C0_SOURCE_CHUNKS" - ], - "symbol_kind_hint": "unknown", - "symbol_candidates": [], - "keyword_hints": [], - "path_hints": [ - "src/plba/__init__.py" - ], - "path_scope": [ - "src/plba/__init__.py" - ], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/plba/__init__.py" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": false, - "max_distance": 2, - "top_k": 5 - } - } - }, - "execution": { - "executed_layers": [ - "C0_SOURCE_CHUNKS" - ], - "retrieval_mode_by_layer": { - "C0_SOURCE_CHUNKS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C0_SOURCE_CHUNKS": 200 - }, - "filters_by_layer": { - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src/plba/__init__.py" - ], - "include_globs": [], - "exclude_globs": [], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Открой файл src/plba/__init__.py", - "path_scope": [ - "src/plba/__init__.py" - ], - "include_globs": [], - "exclude_globs": [], - "prefer_globs": [], - "top_k": 200, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src/plba/__init__.py" - ], - "normalized_include_globs": [], - "normalized_exclude_globs": [], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 1, - "candidates_after_filter": 1 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "not_requested", - "resolved_symbol": null, - "alternatives": [] - }, - "layers": [ - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 1, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "router": 0, - "symbol_resolution": 0, - "retrieval_total": 8, - "retrieval_by_layer": { - "C0_SOURCE_CHUNKS": 8 - }, - "merge_rank": 0, - "prompt_build": 0, - "llm_call": 1874 - }, - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 673, - "evidence_rows": 1, - "evidence_chars": 1768 - }, - "evidence_summary": [ - { - "layer": "C0_SOURCE_CHUNKS", - "count": 1, - "unique_paths": 1 - } - ], - "prompt_template_id": "intent_code_qa_open_file_ru_v4", - "system_prompt_version": "v1" - }, - "router": { - "conversation_mode": "START", - "keyword_hints": [], - "path_scope": [ - "src/plba/__init__.py" - ] - }, - "llm": { - "used_evidence_count": 1, - "missing_evidence_reason": null - } - }, - "run_info": { - "case_id": "plba-v2-open-file-public-api", - "mode": "full_chain", - "run_started_at": "2026-03-12T14:38:57", - "rag_session_id": "7d11da21-faa0-4cea-aede-aeabe069164c", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - }, - "input_request": { - "text": "Открой файл src/plba/__init__.py", - "normalized_query": "Открой файл src/plba/__init__.py" - }, - "steps": [ - { - "step": "intent_router", - "input": { - "query": "Открой файл src/plba/__init__.py" - }, - "output": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Открой файл src/plba/__init__.py" - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "OPEN_FILE", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C0_SOURCE_CHUNKS" - ], - "symbol_kind_hint": "unknown", - "symbol_candidates": [], - "keyword_hints": [], - "path_hints": [ - "src/plba/__init__.py" - ], - "path_scope": [ - "src/plba/__init__.py" - ], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/plba/__init__.py" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": false, - "max_distance": 2, - "top_k": 5 - } - } - }, - "timings_ms": { - "router": 0 - } - } - }, - { - "step": "retrieval", - "input": { - "query": "Открой файл src/plba/__init__.py" - }, - "output": { - "symbol_resolution": { - "status": "not_requested", - "resolved_symbol": null, - "alternatives": [], - "confidence": 0.0 - }, - "rag_count": 1, - "rag_rows": [ - { - "path": "src/plba/__init__.py", - "content": "from plba.bootstrap import create_runtime\nfrom plba.config import ConfigFileLoader, FileConfigProvider\nfrom plba.control import ControlActionSet, ControlChannel, ControlPlaneService, HttpControlChannel\nfrom plba.contracts import (\n ApplicationModule,\n ConfigProvider,\n HealthContributor,\n TraceContext,\n TraceContextRecord,\n TraceLogMessage,\n TraceTransport,\n Worker,\n WorkerHealth,\n WorkerStatus,\n)\nfrom plba.core import ConfigurationManager, RuntimeManager, ServiceContainer\nfrom plba.health import HealthRegistry\nfrom plba.logging import LogManager\nfrom plba.queue import InMemoryTaskQueue\nfrom plba.tracing import MySqlTraceTransport, NoOpTraceTransport, TraceService\nfrom plba.workflow import (\n StepResult,\n WorkflowContext,\n WorkflowDefinition,\n WorkflowEngine,\n WorkflowEngineHooks,\n WorkflowNode,\n WorkflowRuntimeFactory,\n WorkflowStep,\n)\nfrom plba.workers import WorkerSupervisor\n\n__all__ = [\n \"ApplicationModule\",\n \"ConfigFileLoader\",\n \"ConfigProvider\",\n \"ConfigurationManager\",\n \"ControlActionSet\",\n \"ControlChannel\",\n \"ControlPlaneService\",\n \"create_runtime\",\n \"FileConfigProvider\",\n \"HealthContributor\",\n \"HealthRegistry\",\n \"HttpControlChannel\",\n \"InMemoryTaskQueue\",\n \"LogManager\",\n \"MySqlTraceTransport\",\n \"NoOpTraceTransport\",\n \"RuntimeManager\",\n \"ServiceContainer\",\n \"TraceContext\",\n \"TraceContextRecord\",\n \"TraceLogMessage\",\n \"TraceService\",\n \"TraceTransport\",\n \"StepResult\",\n \"Worker\",\n \"WorkerHealth\",\n \"WorkerStatus\",\n \"WorkflowContext\",\n \"WorkflowDefinition\",\n \"WorkflowEngine\",\n \"WorkflowEngineHooks\",\n \"WorkflowNode\",\n \"WorkflowRuntimeFactory\",\n \"WorkflowStep\",\n \"WorkerSupervisor\",\n]", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/plba/__init__.py:1-69", - "span_start": 1, - "span_end": 69, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.plba.__init__", - "is_test": false, - "blob_sha": "24e755ec8c249d14fb0e675b5dbf2b71ab91afb9c849897eebfa9feb2499e19d", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ] - }, - "diagnostics": { - "execution": { - "executed_layers": [ - "C0_SOURCE_CHUNKS" - ], - "retrieval_mode_by_layer": { - "C0_SOURCE_CHUNKS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C0_SOURCE_CHUNKS": 200 - }, - "filters_by_layer": { - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src/plba/__init__.py" - ], - "include_globs": [], - "exclude_globs": [], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Открой файл src/plba/__init__.py", - "path_scope": [ - "src/plba/__init__.py" - ], - "include_globs": [], - "exclude_globs": [], - "prefer_globs": [], - "top_k": 200, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src/plba/__init__.py" - ], - "normalized_include_globs": [], - "normalized_exclude_globs": [], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 1, - "candidates_after_filter": 1 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "not_requested", - "resolved_symbol": null, - "alternatives": [] - }, - "layers": [ - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 1, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "symbol_resolution": 0, - "retrieval_total": 8, - "retrieval_by_layer": { - "C0_SOURCE_CHUNKS": 8 - }, - "merge_rank": 0 - } - } - }, - { - "step": "llm_answer", - "input": { - "query": "Открой файл src/plba/__init__.py", - "rag_count": 1 - }, - "output": { - "llm_answer": "В файле src/plba/__init__.py видны следующие импорты и объявления:\nИмпорты:\n- plba.bootstrap.create_runtime\n- plba.config.ConfigFileLoader, FileConfigProvider\n- plba.control.ControlActionSet, ControlChannel, ControlPlaneService, HttpControlChannel\n- plba.contracts.ApplicationModule, ConfigProvider, HealthContributor, TraceContext, TraceContextRecord, TraceLogMessage, TraceTransport, Worker, WorkerHealth, WorkerStatus\n- plba.core.ConfigurationManager, RuntimeManager, ServiceContainer\n- plba.health.HealthRegistry\n- plba.logging.LogManager\n- plba.queue.InMemoryTaskQueue\n- plba.tracing.MySqlTraceTransport, NoOpTraceTransport, TraceService\n- plba.workflow.StepResult, WorkflowContext, WorkflowDefinition, WorkflowEngine, WorkflowEngineHooks, WorkflowNode, WorkflowRuntimeFactory, WorkflowStep\n- plba.workers.WorkerSupervisor\n\nОбъявления:\n- __all__ содержит список экспортированных элементов." - }, - "diagnostics": { - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 673, - "evidence_rows": 1, - "evidence_chars": 1768 - }, - "evidence_summary": [ - { - "layer": "C0_SOURCE_CHUNKS", - "count": 1, - "unique_paths": 1 - } - ], - "prompt_template_id": "intent_code_qa_open_file_ru_v4", - "system_prompt_version": "v1" - }, - "timings_ms": { - "prompt_build": 0, - "llm_call": 1874 - } - } - } - ] - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_143856/full_chain_plba_code_subintents_v2_plba-v2-open-file-public-api.md b/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_143856/full_chain_plba_code_subintents_v2_plba-v2-open-file-public-api.md deleted file mode 100644 index cef8d0d..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_143856/full_chain_plba_code_subintents_v2_plba-v2-open-file-public-api.md +++ /dev/null @@ -1,30 +0,0 @@ -# plba-v2-open-file-public-api - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_subintents_v2.yaml -- runner: runtime -- mode: full_chain -- passed: True - -## Query -Открой файл src/plba/__init__.py - -## Actual -{ - "intent": "CODE_QA", - "sub_intent": "OPEN_FILE", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 1, - "llm_answer": "В файле src/plba/__init__.py видны следующие импорты и объявления:\nИмпорты:\n- plba.bootstrap.create_runtime\n- plba.config.ConfigFileLoader, FileConfigProvider\n- plba.control.ControlActionSet, ControlChannel, ControlPlaneService, HttpControlChannel\n- plba.contracts.ApplicationModule, ConfigProvider, HealthContributor, TraceContext, TraceContextRecord, TraceLogMessage, TraceTransport, Worker, WorkerHealth, WorkerStatus\n- plba.core.ConfigurationManager, RuntimeManager, ServiceContainer\n- plba.health.HealthRegistry\n- plba.logging.LogManager\n- plba.queue.InMemoryTaskQueue\n- plba.tracing.MySqlTraceTransport, NoOpTraceTransport, TraceService\n- plba.workflow.StepResult, WorkflowContext, WorkflowDefinition, WorkflowEngine, WorkflowEngineHooks, WorkflowNode, WorkflowRuntimeFactory, WorkflowStep\n- plba.workers.WorkerSupervisor\n\nОбъявления:\n- __all__ содержит список экспортированных элементов.", - "answer_mode": "answered", - "path_scope": [ - "src/plba/__init__.py" - ], - "symbol_candidates": [], - "layers": [ - "C0_SOURCE_CHUNKS" - ] -} - -## Mismatches -- none \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_143856/full_chain_plba_code_subintents_v2_plba-v2-open-file-runtime.json b/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_143856/full_chain_plba_code_subintents_v2_plba-v2-open-file-runtime.json deleted file mode 100644 index 9b1cfa3..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_143856/full_chain_plba_code_subintents_v2_plba-v2-open-file-runtime.json +++ /dev/null @@ -1,492 +0,0 @@ -{ - "case_id": "plba-v2-open-file-runtime", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_subintents_v2.yaml", - "runner": "runtime", - "mode": "full_chain", - "actual": { - "intent": "CODE_QA", - "sub_intent": "OPEN_FILE", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 1, - "llm_answer": "В файле src/app_runtime/core/runtime.py виден класс RuntimeManager с несколькими атрибутами и методами. В конструкторе инициализируются конфигурация, сервисы, службы трассировки, здоровья, логирования и супервайзеры рабочих процессов. Также присутствуют константы для тайм-аутов действий и интервала опроса.", - "answer_mode": "answered", - "path_scope": [ - "src/app_runtime/core/runtime.py" - ], - "symbol_candidates": [], - "layers": [ - "C0_SOURCE_CHUNKS" - ] - }, - "passed": true, - "mismatches": [], - "details": { - "case_id": "plba-v2-open-file-runtime", - "text": "Открой файл src/app_runtime/core/runtime.py", - "mode": "full_chain", - "run_started_at": "2026-03-12T14:38:57", - "rag_session_id": "7d11da21-faa0-4cea-aede-aeabe069164c", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Открой файл src/app_runtime/core/runtime.py", - "symbol_resolution": { - "status": "not_requested", - "resolved_symbol": null, - "alternatives": [], - "confidence": 0.0 - }, - "rag_count": 1, - "rag_rows": [ - { - "path": "src/app_runtime/core/runtime.py", - "content": "class RuntimeManager:\n ACTION_TIMEOUT_SECONDS = 10.0\n ACTION_POLL_INTERVAL_SECONDS = 0.05\n\n def __init__(\n self,\n configuration: ConfigurationManager | None = None,\n services: ServiceContainer | None = None,\n traces: TraceService | None = None,\n health: HealthRegistry | None = None,\n logs: LogManager | None = None,\n workers: WorkerSupervisor | None = None,\n control_plane: ControlPlaneService | None = None,\n ) -> None:\n self.configuration = configuration or ConfigurationManager()\n self.services = services or ServiceContainer()\n self.traces = traces or TraceService()\n self.health = health or HealthRegistry()\n self.logs = logs or LogManager()\n self.workers = workers or WorkerSupervisor()\n self.control_plane = control_plane or ControlPlaneService()\n self.registry = ModuleRegistry(self.services)\n self._started = False\n self._state = LifecycleState.IDLE\n self._core_registered = False\n self._workers_registered = False\n self._register_core_services()\n\n def register_module(self, module: ApplicationModule) -> None:\n self.registry.register_module(module.name)\n module.register(self.registry)\n\n def add_config_file(self, path: str) -> FileConfigProvider:\n provider = FileConfigProvider(path)\n self.configuration.add_provider(provider)\n return provider\n\n def start(self, *, start_control_plane: bool = True) -> None:\n if self._started:\n return\n self._state = LifecycleState.STARTING\n config = self.configuration.load()\n self.logs.apply_config(config)\n self._register_health_contributors()\n self._register_workers()\n self.workers.start()\n if start_control_plane:\n self.control_plane.start(self)\n self._started = True\n self._refresh_state()\n\n def stop(self, timeout: float = 30.0, force: bool = False, stop_control_plane: bool = True) -> None:\n if not self._started:\n return\n self._state = LifecycleState.STOPPING\n self.workers.stop(timeout=timeout, force=force)\n if stop_control_plane:\n self.control_plane.stop()\n self._started = False\n self._state = LifecycleState.STOPPED\n\n def status(self) -> dict[str, object]:\n self._refresh_state()\n return self.control_plane.snapshot(self)\n\n def current_health(self) -> HealthPayload:\n self._refresh_state()\n return self.health.payload(self._state, self.workers.healths())\n\n async def health_status(self) -> HealthPayload:\n return self.current_health()\n\n async def start_runtime(self) -> dict[str, object] | str:\n self._refresh_state()\n if self._started:\n return \"runtime already running\"\n if self._state == LifecycleState.STOPPING:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n\n self.start(start_control_plane=False)\n started = self._wait_for_state({LifecycleState.IDLE, LifecycleState.BUSY}, timeout=self.ACTION_TIMEOUT_SECONDS)\n if started:\n return self._action_detail(\"runtime started\", timed_out=False)\n return self._action_detail(\"runtime start is still in progress\", timed_out=True)\n\n async def stop_runtime(self) -> dict[str, object] | str:\n self._refresh_state()\n if not self._started:\n if self._state == LifecycleState.STOPPING:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n return \"runtime already stopped\"\n\n self._state = LifecycleState.STOPPING\n try:\n self.workers.stop(timeout=self.ACTION_TIMEOUT_SECONDS, force=False)\n except TimeoutError:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n\n self._started = False\n self._state = LifecycleState.STOPPED\n return self._action_detail(\"runtime stopped\", timed_out=False)\n\n async def runtime_status(self) -> str:\n self._refresh_state()\n return self._state.value\n\n def _register_core_services(self) -> None:\n if self._core_registered:\n return\n self.services.register(\"configuration\", self.configuration)\n self.services.register(\"traces\", self.traces)\n self.services.register(\"health\", self.health)\n self.services.register(\"logs\", self.logs)\n self.services.register(\"workers\", self.workers)\n self.services.register(\"control_plane\", self.control_plane)\n self._core_registered = True\n\n def _register_health_contributors(self) -> None:\n for contributor in self.registry.health_contributors:\n self.health.register(contributor)\n\n def _register_workers(self) -> None:\n if self._workers_registered:\n return\n for worker in self.registry.workers:\n self.workers.register(worker)\n self._workers_registered = True\n\n def _refresh_state(self) -> None:\n lifecycle = self.workers.lifecycle_state()\n\n if self._state == LifecycleState.STOPPING:\n if lifecycle == LifecycleState.STOPPED:\n self._started = False\n self._state = LifecycleState.STOPPED\n return\n\n if not self._started:\n if lifecycle == LifecycleState.STOPPED:\n self._state = LifecycleState.STOPPED\n return\n\n self._state = lifecycle\n\n def _wait_for_state(self, target_states: set[LifecycleState], *, timeout: float) -> bool:\n deadline = monotonic() + timeout\n while monotonic() < deadline:\n self._refresh_state()\n if self._state in target_states:\n return True\n sleep(self.ACTION_POLL_INTERVAL_SECONDS)\n self._refresh_state()\n return self._state in target_states\n\n def _action_detail(self, message: str, *, timed_out: bool) -> dict[str, object]:\n self._refresh_state()\n return {\n \"message\": message,\n \"state\": self._state.value,\n \"timed_out\": timed_out,\n \"workers\": self.workers.snapshot(),\n }", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/core/runtime.py:RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.core.runtime", - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "llm_answer": "В файле src/app_runtime/core/runtime.py виден класс RuntimeManager с несколькими атрибутами и методами. В конструкторе инициализируются конфигурация, сервисы, службы трассировки, здоровья, логирования и супервайзеры рабочих процессов. Также присутствуют константы для тайм-аутов действий и интервала опроса.", - "summary": { - "router": { - "intent": "CODE_QA", - "sub_intent": "OPEN_FILE", - "confidence": null - }, - "retrieval": { - "profile": "code", - "layers_hit": [ - "C0_SOURCE_CHUNKS" - ], - "evidence_sufficient": true - }, - "llm": { - "answer_status": "answered", - "groundedness": "grounded" - } - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "OPEN_FILE", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C0_SOURCE_CHUNKS" - ], - "symbol_kind_hint": "unknown", - "symbol_candidates": [], - "keyword_hints": [], - "path_hints": [ - "src/app_runtime/core/runtime.py" - ], - "path_scope": [ - "src/app_runtime/core/runtime.py" - ], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/app_runtime/core/runtime.py" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": false, - "max_distance": 2, - "top_k": 5 - } - } - }, - "execution": { - "executed_layers": [ - "C0_SOURCE_CHUNKS" - ], - "retrieval_mode_by_layer": { - "C0_SOURCE_CHUNKS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C0_SOURCE_CHUNKS": 200 - }, - "filters_by_layer": { - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src/app_runtime/core/runtime.py" - ], - "include_globs": [], - "exclude_globs": [], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Открой файл src/app_runtime/core/runtime.py", - "path_scope": [ - "src/app_runtime/core/runtime.py" - ], - "include_globs": [], - "exclude_globs": [], - "prefer_globs": [], - "top_k": 200, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src/app_runtime/core/runtime.py" - ], - "normalized_include_globs": [], - "normalized_exclude_globs": [], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 1, - "candidates_after_filter": 1 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "not_requested", - "resolved_symbol": null, - "alternatives": [] - }, - "layers": [ - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 1, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "router": 1, - "symbol_resolution": 0, - "retrieval_total": 144, - "retrieval_by_layer": { - "C0_SOURCE_CHUNKS": 144 - }, - "merge_rank": 0, - "prompt_build": 0, - "llm_call": 775 - }, - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 684, - "evidence_rows": 1, - "evidence_chars": 6265 - }, - "evidence_summary": [ - { - "layer": "C0_SOURCE_CHUNKS", - "count": 1, - "unique_paths": 1 - } - ], - "prompt_template_id": "intent_code_qa_open_file_ru_v4", - "system_prompt_version": "v1" - }, - "router": { - "conversation_mode": "START", - "keyword_hints": [], - "path_scope": [ - "src/app_runtime/core/runtime.py" - ] - }, - "llm": { - "used_evidence_count": 1, - "missing_evidence_reason": null - } - }, - "run_info": { - "case_id": "plba-v2-open-file-runtime", - "mode": "full_chain", - "run_started_at": "2026-03-12T14:38:57", - "rag_session_id": "7d11da21-faa0-4cea-aede-aeabe069164c", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - }, - "input_request": { - "text": "Открой файл src/app_runtime/core/runtime.py", - "normalized_query": "Открой файл src/app_runtime/core/runtime.py" - }, - "steps": [ - { - "step": "intent_router", - "input": { - "query": "Открой файл src/app_runtime/core/runtime.py" - }, - "output": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Открой файл src/app_runtime/core/runtime.py" - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "OPEN_FILE", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C0_SOURCE_CHUNKS" - ], - "symbol_kind_hint": "unknown", - "symbol_candidates": [], - "keyword_hints": [], - "path_hints": [ - "src/app_runtime/core/runtime.py" - ], - "path_scope": [ - "src/app_runtime/core/runtime.py" - ], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/app_runtime/core/runtime.py" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": false, - "max_distance": 2, - "top_k": 5 - } - } - }, - "timings_ms": { - "router": 1 - } - } - }, - { - "step": "retrieval", - "input": { - "query": "Открой файл src/app_runtime/core/runtime.py" - }, - "output": { - "symbol_resolution": { - "status": "not_requested", - "resolved_symbol": null, - "alternatives": [], - "confidence": 0.0 - }, - "rag_count": 1, - "rag_rows": [ - { - "path": "src/app_runtime/core/runtime.py", - "content": "class RuntimeManager:\n ACTION_TIMEOUT_SECONDS = 10.0\n ACTION_POLL_INTERVAL_SECONDS = 0.05\n\n def __init__(\n self,\n configuration: ConfigurationManager | None = None,\n services: ServiceContainer | None = None,\n traces: TraceService | None = None,\n health: HealthRegistry | None = None,\n logs: LogManager | None = None,\n workers: WorkerSupervisor | None = None,\n control_plane: ControlPlaneService | None = None,\n ) -> None:\n self.configuration = configuration or ConfigurationManager()\n self.services = services or ServiceContainer()\n self.traces = traces or TraceService()\n self.health = health or HealthRegistry()\n self.logs = logs or LogManager()\n self.workers = workers or WorkerSupervisor()\n self.control_plane = control_plane or ControlPlaneService()\n self.registry = ModuleRegistry(self.services)\n self._started = False\n self._state = LifecycleState.IDLE\n self._core_registered = False\n self._workers_registered = False\n self._register_core_services()\n\n def register_module(self, module: ApplicationModule) -> None:\n self.registry.register_module(module.name)\n module.register(self.registry)\n\n def add_config_file(self, path: str) -> FileConfigProvider:\n provider = FileConfigProvider(path)\n self.configuration.add_provider(provider)\n return provider\n\n def start(self, *, start_control_plane: bool = True) -> None:\n if self._started:\n return\n self._state = LifecycleState.STARTING\n config = self.configuration.load()\n self.logs.apply_config(config)\n self._register_health_contributors()\n self._register_workers()\n self.workers.start()\n if start_control_plane:\n self.control_plane.start(self)\n self._started = True\n self._refresh_state()\n\n def stop(self, timeout: float = 30.0, force: bool = False, stop_control_plane: bool = True) -> None:\n if not self._started:\n return\n self._state = LifecycleState.STOPPING\n self.workers.stop(timeout=timeout, force=force)\n if stop_control_plane:\n self.control_plane.stop()\n self._started = False\n self._state = LifecycleState.STOPPED\n\n def status(self) -> dict[str, object]:\n self._refresh_state()\n return self.control_plane.snapshot(self)\n\n def current_health(self) -> HealthPayload:\n self._refresh_state()\n return self.health.payload(self._state, self.workers.healths())\n\n async def health_status(self) -> HealthPayload:\n return self.current_health()\n\n async def start_runtime(self) -> dict[str, object] | str:\n self._refresh_state()\n if self._started:\n return \"runtime already running\"\n if self._state == LifecycleState.STOPPING:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n\n self.start(start_control_plane=False)\n started = self._wait_for_state({LifecycleState.IDLE, LifecycleState.BUSY}, timeout=self.ACTION_TIMEOUT_SECONDS)\n if started:\n return self._action_detail(\"runtime started\", timed_out=False)\n return self._action_detail(\"runtime start is still in progress\", timed_out=True)\n\n async def stop_runtime(self) -> dict[str, object] | str:\n self._refresh_state()\n if not self._started:\n if self._state == LifecycleState.STOPPING:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n return \"runtime already stopped\"\n\n self._state = LifecycleState.STOPPING\n try:\n self.workers.stop(timeout=self.ACTION_TIMEOUT_SECONDS, force=False)\n except TimeoutError:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n\n self._started = False\n self._state = LifecycleState.STOPPED\n return self._action_detail(\"runtime stopped\", timed_out=False)\n\n async def runtime_status(self) -> str:\n self._refresh_state()\n return self._state.value\n\n def _register_core_services(self) -> None:\n if self._core_registered:\n return\n self.services.register(\"configuration\", self.configuration)\n self.services.register(\"traces\", self.traces)\n self.services.register(\"health\", self.health)\n self.services.register(\"logs\", self.logs)\n self.services.register(\"workers\", self.workers)\n self.services.register(\"control_plane\", self.control_plane)\n self._core_registered = True\n\n def _register_health_contributors(self) -> None:\n for contributor in self.registry.health_contributors:\n self.health.register(contributor)\n\n def _register_workers(self) -> None:\n if self._workers_registered:\n return\n for worker in self.registry.workers:\n self.workers.register(worker)\n self._workers_registered = True\n\n def _refresh_state(self) -> None:\n lifecycle = self.workers.lifecycle_state()\n\n if self._state == LifecycleState.STOPPING:\n if lifecycle == LifecycleState.STOPPED:\n self._started = False\n self._state = LifecycleState.STOPPED\n return\n\n if not self._started:\n if lifecycle == LifecycleState.STOPPED:\n self._state = LifecycleState.STOPPED\n return\n\n self._state = lifecycle\n\n def _wait_for_state(self, target_states: set[LifecycleState], *, timeout: float) -> bool:\n deadline = monotonic() + timeout\n while monotonic() < deadline:\n self._refresh_state()\n if self._state in target_states:\n return True\n sleep(self.ACTION_POLL_INTERVAL_SECONDS)\n self._refresh_state()\n return self._state in target_states\n\n def _action_detail(self, message: str, *, timed_out: bool) -> dict[str, object]:\n self._refresh_state()\n return {\n \"message\": message,\n \"state\": self._state.value,\n \"timed_out\": timed_out,\n \"workers\": self.workers.snapshot(),\n }", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/core/runtime.py:RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.core.runtime", - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ] - }, - "diagnostics": { - "execution": { - "executed_layers": [ - "C0_SOURCE_CHUNKS" - ], - "retrieval_mode_by_layer": { - "C0_SOURCE_CHUNKS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C0_SOURCE_CHUNKS": 200 - }, - "filters_by_layer": { - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src/app_runtime/core/runtime.py" - ], - "include_globs": [], - "exclude_globs": [], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Открой файл src/app_runtime/core/runtime.py", - "path_scope": [ - "src/app_runtime/core/runtime.py" - ], - "include_globs": [], - "exclude_globs": [], - "prefer_globs": [], - "top_k": 200, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src/app_runtime/core/runtime.py" - ], - "normalized_include_globs": [], - "normalized_exclude_globs": [], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 1, - "candidates_after_filter": 1 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "not_requested", - "resolved_symbol": null, - "alternatives": [] - }, - "layers": [ - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 1, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "symbol_resolution": 0, - "retrieval_total": 144, - "retrieval_by_layer": { - "C0_SOURCE_CHUNKS": 144 - }, - "merge_rank": 0 - } - } - }, - { - "step": "llm_answer", - "input": { - "query": "Открой файл src/app_runtime/core/runtime.py", - "rag_count": 1 - }, - "output": { - "llm_answer": "В файле src/app_runtime/core/runtime.py виден класс RuntimeManager с несколькими атрибутами и методами. В конструкторе инициализируются конфигурация, сервисы, службы трассировки, здоровья, логирования и супервайзеры рабочих процессов. Также присутствуют константы для тайм-аутов действий и интервала опроса." - }, - "diagnostics": { - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 684, - "evidence_rows": 1, - "evidence_chars": 6265 - }, - "evidence_summary": [ - { - "layer": "C0_SOURCE_CHUNKS", - "count": 1, - "unique_paths": 1 - } - ], - "prompt_template_id": "intent_code_qa_open_file_ru_v4", - "system_prompt_version": "v1" - }, - "timings_ms": { - "prompt_build": 0, - "llm_call": 775 - } - } - } - ] - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_143856/full_chain_plba_code_subintents_v2_plba-v2-open-file-runtime.md b/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_143856/full_chain_plba_code_subintents_v2_plba-v2-open-file-runtime.md deleted file mode 100644 index ef9d834..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_143856/full_chain_plba_code_subintents_v2_plba-v2-open-file-runtime.md +++ /dev/null @@ -1,30 +0,0 @@ -# plba-v2-open-file-runtime - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_subintents_v2.yaml -- runner: runtime -- mode: full_chain -- passed: True - -## Query -Открой файл src/app_runtime/core/runtime.py - -## Actual -{ - "intent": "CODE_QA", - "sub_intent": "OPEN_FILE", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 1, - "llm_answer": "В файле src/app_runtime/core/runtime.py виден класс RuntimeManager с несколькими атрибутами и методами. В конструкторе инициализируются конфигурация, сервисы, службы трассировки, здоровья, логирования и супервайзеры рабочих процессов. Также присутствуют константы для тайм-аутов действий и интервала опроса.", - "answer_mode": "answered", - "path_scope": [ - "src/app_runtime/core/runtime.py" - ], - "symbol_candidates": [], - "layers": [ - "C0_SOURCE_CHUNKS" - ] -} - -## Mismatches -- none \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_143856/full_chain_plba_code_subintents_v2_plba-v2-trace-flow-health-endpoint.json b/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_143856/full_chain_plba_code_subintents_v2_plba-v2-trace-flow-health-endpoint.json deleted file mode 100644 index b9ff0f3..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_143856/full_chain_plba_code_subintents_v2_plba-v2-trace-flow-health-endpoint.json +++ /dev/null @@ -1,3084 +0,0 @@ -{ - "case_id": "plba-v2-trace-flow-health-endpoint", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_subintents_v2.yaml", - "runner": "runtime", - "mode": "full_chain", - "actual": { - "intent": "CODE_QA", - "sub_intent": "TRACE_FLOW", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 26, - "llm_answer": "Когда в HttpControlAppFactory обрабатывается запрос `/health`, выполняются следующие шаги:\n\n1. Создается экземпляр FastAPI с названием \"PLBA Control API\".\n2. Добавляется middleware для логирования времени обработки каждого запроса (`log_api_call`).\n3. Обрабатывается GET-запрос к `/health`.\n - Вызывается провайдер здоровья `health_provider`, который возвращает асинхронно объект типа `HealthPayload`.\n - Проверяется статус здоровья (\"ok\" или иное). В зависимости от статуса устанавливается соответствующий HTTP-код ответа (200 или 503).\n - Возвращается JSON-ответ с содержимым `HealthPayload`.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "health", - "HttpControlAppFactory" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "passed": true, - "mismatches": [], - "details": { - "case_id": "plba-v2-trace-flow-health-endpoint", - "text": "Покажи как проходит запрос /health в HttpControlAppFactory", - "mode": "full_chain", - "run_started_at": "2026-03-12T14:38:57", - "rag_session_id": "7d11da21-faa0-4cea-aede-aeabe069164c", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Покажи как проходит запрос /health в HttpControlAppFactory", - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "HttpControlAppFactory", - "alternatives": [ - "HttpControlAppFactory", - "ControlActionSet", - "HealthContributor.health", - "HealthContributor" - ], - "confidence": 0.99 - }, - "rag_count": 26, - "rag_rows": [ - { - "path": "src/app_runtime/control/http_app.py", - "content": "class HttpControlAppFactory\nHttpControlAppFactory", - "layer": "C1_SYMBOL_CATALOG", - "title": "HttpControlAppFactory", - "span_start": 15, - "span_end": 53, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "9b3502a5fb408b273223db13264349cf500de24915b6c649d9ea8970d0dfd8e0", - "qname": "HttpControlAppFactory", - "kind": "class", - "signature": "HttpControlAppFactory", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.control.http_app", - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "class ControlActionSet\nControlActionSet", - "layer": "C1_SYMBOL_CATALOG", - "title": "ControlActionSet", - "span_start": 14, - "span_end": 18, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "46eb026cb3313415ec47b82dd22f84f4d112c9d987e8b1716dcb0baa1cce8988", - "qname": "ControlActionSet", - "kind": "class", - "signature": "ControlActionSet", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.control.base", - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/contracts/health.py", - "content": "method HealthContributor.health\nhealth(self)\nReturn contributor health state.", - "layer": "C1_SYMBOL_CATALOG", - "title": "HealthContributor.health", - "span_start": 9, - "span_end": 10, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "728cff18958d8a25e2661a0f08c83d68c3bbbfa8cef212b85dc0da2b11b3dc90", - "qname": "HealthContributor.health", - "kind": "method", - "signature": "health(self)", - "parent_symbol_id": "HealthContributor", - "package_or_module": "src.app_runtime.contracts.health", - "is_test": false, - "blob_sha": "6bd92611def7131e32d4dd34a8ed85e6cf3c67722ad27797032a632cb30dc097", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/contracts/health.py", - "content": "class HealthContributor\nHealthContributor(ABC)", - "layer": "C1_SYMBOL_CATALOG", - "title": "HealthContributor", - "span_start": 7, - "span_end": 10, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "db91ae387b89a2e9d83829754f27fa18a4055b3e72d7f31789a0b8e0bf5bba0b", - "qname": "HealthContributor", - "kind": "class", - "signature": "HealthContributor(ABC)", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.contracts.health", - "is_test": false, - "blob_sha": "6bd92611def7131e32d4dd34a8ed85e6cf3c67722ad27797032a632cb30dc097", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "HttpControlAppFactory\nrole: factory\n\nResponsibilities:\n- name suffix suggests factory", - "layer": "C4_SEMANTIC_ROLES", - "title": "HttpControlAppFactory", - "span_start": 15, - "span_end": 53, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 39, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "9b3502a5fb408b273223db13264349cf500de24915b6c649d9ea8970d0dfd8e0", - "symbol_name": "HttpControlAppFactory", - "qname": "HttpControlAppFactory", - "role": "factory", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/health/registry.py", - "content": "HealthRegistry\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (2)", - "layer": "C4_SEMANTIC_ROLES", - "title": "HealthRegistry", - "span_start": 8, - "span_end": 56, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 29, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "fd3390eb0ba29c9979466b9c2117238e0da3bb829eeb4d505cb34c9c3df7a8e8", - "symbol_name": "HealthRegistry", - "qname": "HealthRegistry", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 2, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "26e6a24daa43407ba5340b74497c20153020e79f8d7828ae502aaec378dfcf75", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/types.py", - "content": "HealthPayload\nrole: model\n\nResponsibilities:\n- default model role", - "layer": "C4_SEMANTIC_ROLES", - "title": "HealthPayload", - "span_start": 7, - "span_end": 11, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 40, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "392235d63ddf752d6e419cb8528c93fe070d1bc02d3c87ba6a897baac810cf5d", - "symbol_name": "HealthPayload", - "qname": "HealthPayload", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "448a02e4a432b5ab65b246b2bd24a32a6f127b9d2091ea73b53ee3c0a2f53bb3", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/contracts/health.py", - "content": "HealthContributor\nrole: model\n\nResponsibilities:\n- default model role", - "layer": "C4_SEMANTIC_ROLES", - "title": "HealthContributor", - "span_start": 7, - "span_end": 10, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 40, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "db91ae387b89a2e9d83829754f27fa18a4055b3e72d7f31789a0b8e0bf5bba0b", - "symbol_name": "HealthContributor", - "qname": "HealthContributor", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "6bd92611def7131e32d4dd34a8ed85e6cf3c67722ad27797032a632cb30dc097", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "ControlActionSet\nrole: model\n\nResponsibilities:\n- default model role", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlActionSet", - "span_start": 14, - "span_end": 18, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 40, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "46eb026cb3313415ec47b82dd22f84f4d112c9d987e8b1716dcb0baa1cce8988", - "symbol_name": "ControlActionSet", - "qname": "ControlActionSet", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "ControlChannel\nrole: model\n\nResponsibilities:\n- default model role", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlChannel", - "span_start": 21, - "span_end": 28, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 40, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "cfcfe9a311d3a2dbdaf32ac4ccd73c0eb9a117f830591a1c0867ee97d46204ff", - "symbol_name": "ControlChannel", - "qname": "ControlChannel", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests service\n- reads and writes state attributes\n- participates in dataflow slices (5)", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlPlaneService", - "span_start": 12, - "span_end": 52, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 68, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "b13471e5916986dccffb53fab613812842965705e6b3a89ae549d30c9e91e9aa", - "symbol_name": "ControlPlaneService", - "qname": "ControlPlaneService", - "role": "pipeline_stage", - "confidence": 0.57, - "dataflow_participation": 5, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_runner.py", - "content": "UvicornThreadRunner\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (24)", - "layer": "C4_SEMANTIC_ROLES", - "title": "UvicornThreadRunner", - "span_start": 10, - "span_end": 61, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 11, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "fd55630045a02100df8877ac27d951ee08617d4598764394d48cb51fe067476a", - "symbol_name": "UvicornThreadRunner", - "qname": "UvicornThreadRunner", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 24, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "3779fdd2878b770e789a35bb2a89c9d79f13b61c26d7db1b3b683f9bb9e1623f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/health/registry.py", - "content": "HealthRegistry.__init__\n -> HealthRegistry._contributors\n -> HealthRegistry.register", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "HealthRegistry.__init__:dataflow_slice", - "span_start": 10, - "span_end": 13, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "2381dfb339d541367c3251d2a610cac9d8b3f6bd6a352e119d00a93c5ccc2b7d", - "edge_type": "dataflow_slice", - "src_symbol_id": "e8ffd58441c231de43d9e86c31eb12303d4e2bf045b2acf13d1dfe78da01f8dc", - "src_qname": "HealthRegistry.__init__", - "dst_symbol_id": "a9e1f290c346c8bb1d67af0cafeebb5bcaf29c3ed7027e33c794532743df38f2", - "dst_ref": "HealthRegistry.register", - "resolution": "resolved", - "slice_id": "2381dfb339d541367c3251d2a610cac9d8b3f6bd6a352e119d00a93c5ccc2b7d", - "root_symbol_id": "e8ffd58441c231de43d9e86c31eb12303d4e2bf045b2acf13d1dfe78da01f8dc", - "path_symbols": [ - "HealthRegistry.__init__", - "HealthRegistry._contributors", - "HealthRegistry.register" - ], - "path_symbol_ids": [ - "e8ffd58441c231de43d9e86c31eb12303d4e2bf045b2acf13d1dfe78da01f8dc", - "a9e1f290c346c8bb1d67af0cafeebb5bcaf29c3ed7027e33c794532743df38f2" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "26e6a24daa43407ba5340b74497c20153020e79f8d7828ae502aaec378dfcf75", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.start", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 20, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154", - "dst_ref": "ControlPlaneService.start", - "resolution": "resolved", - "slice_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.start" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.stop", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 25, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d", - "dst_ref": "ControlPlaneService.stop", - "resolution": "resolved", - "slice_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.stop" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._stop_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 51, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a", - "dst_ref": "ControlPlaneService._stop_async", - "resolution": "resolved", - "slice_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._stop_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/health/registry.py", - "content": "HealthRegistry.__init__\n -> HealthRegistry._contributors\n -> HealthRegistry.contributor_healths", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "HealthRegistry.__init__:dataflow_slice", - "span_start": 10, - "span_end": 16, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "d3a88a7abf16359e903e809ffc24473658fdd8198f60641fe1584fc4ac663c31", - "edge_type": "dataflow_slice", - "src_symbol_id": "e8ffd58441c231de43d9e86c31eb12303d4e2bf045b2acf13d1dfe78da01f8dc", - "src_qname": "HealthRegistry.__init__", - "dst_symbol_id": "fa7bbd8f4b64a55a5088640c30f52e84075d65f531bd7e1f6c1d7bb8d24fcbf2", - "dst_ref": "HealthRegistry.contributor_healths", - "resolution": "resolved", - "slice_id": "d3a88a7abf16359e903e809ffc24473658fdd8198f60641fe1584fc4ac663c31", - "root_symbol_id": "e8ffd58441c231de43d9e86c31eb12303d4e2bf045b2acf13d1dfe78da01f8dc", - "path_symbols": [ - "HealthRegistry.__init__", - "HealthRegistry._contributors", - "HealthRegistry.contributor_healths" - ], - "path_symbol_ids": [ - "e8ffd58441c231de43d9e86c31eb12303d4e2bf045b2acf13d1dfe78da01f8dc", - "fa7bbd8f4b64a55a5088640c30f52e84075d65f531bd7e1f6c1d7bb8d24fcbf2" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "26e6a24daa43407ba5340b74497c20153020e79f8d7828ae502aaec378dfcf75", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._start_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 47, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517", - "dst_ref": "ControlPlaneService._start_async", - "resolution": "resolved", - "slice_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._start_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.register_channel", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 17, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957", - "dst_ref": "ControlPlaneService.register_channel", - "resolution": "resolved", - "slice_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.register_channel" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "HttpControlAppFactory.create calls time.monotonic", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "HttpControlAppFactory.create:calls", - "span_start": 25, - "span_end": 25, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "3fdd0a88d10225ee74f3b84ab57e13f09f5ccc72f00e31af9ae4655411c289c0", - "edge_type": "calls", - "src_symbol_id": "4af42c2a9275d652e710a98ec48b8247236b4453a093629f8958704ff6d3cb58", - "src_qname": "HttpControlAppFactory.create", - "dst_symbol_id": null, - "dst_ref": "time.monotonic", - "resolution": "partial", - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "HttpControlAppFactory.create calls app.post", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "HttpControlAppFactory.create:calls", - "span_start": 37, - "span_end": 37, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "0e545d4b5187db7bec5ceac03071d2ad68177550c42af748fee364639e533c90", - "edge_type": "calls", - "src_symbol_id": "4af42c2a9275d652e710a98ec48b8247236b4453a093629f8958704ff6d3cb58", - "src_qname": "HttpControlAppFactory.create", - "dst_symbol_id": null, - "dst_ref": "app.post", - "resolution": "partial", - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "HttpControlAppFactory.create calls str", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "HttpControlAppFactory.create:calls", - "span_start": 27, - "span_end": 27, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "2a87c51461e31cd556508cc37fdff37b4d24c26f7f1604db30af5e8f1bda96cb", - "edge_type": "calls", - "src_symbol_id": "4af42c2a9275d652e710a98ec48b8247236b4453a093629f8958704ff6d3cb58", - "src_qname": "HttpControlAppFactory.create", - "dst_symbol_id": null, - "dst_ref": "str", - "resolution": "partial", - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "class HttpControlAppFactory:\n def create(\n self,\n health_provider: Callable[[], Awaitable[HealthPayload]],\n action_provider: Callable[[str, str], Awaitable[JSONResponse]],\n ) -> FastAPI:\n app = FastAPI(title=\"PLBA Control API\")\n\n @app.middleware(\"http\")\n async def log_api_call(request: Request, call_next): # type: ignore[no-untyped-def]\n started = time.monotonic()\n response = await call_next(request)\n response.headers[\"X-Response-Time-Ms\"] = str(int((time.monotonic() - started) * 1000))\n return response\n\n @app.get(\"/health\")\n async def health() -> JSONResponse:\n payload = await health_provider()\n status_code = 200 if payload.get(\"status\") == \"ok\" else 503\n return JSONResponse(content=payload, status_code=status_code)\n\n @app.get(\"/actions/{action}\")\n @app.post(\"/actions/{action}\")\n async def action(action: str, request: Request) -> JSONResponse:\n client_source = self._client_source(request)\n if action in {\"start\", \"stop\"}:\n LOGGER.warning(\"Control action requested: /actions/%s client=%s\", action, client_source)\n return await action_provider(action, client_source)\n\n return app\n\n def _client_source(self, request: Request) -> str:\n explicit_header = request.headers.get(\"X-Client-Source\", \"\").strip()\n if explicit_header:\n return explicit_header\n user_agent = request.headers.get(\"User-Agent\", \"\").strip()\n if user_agent:\n return f\"user-agent:{user_agent}\"\n return \"unknown\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/http_app.py:HttpControlAppFactory", - "span_start": 15, - "span_end": 53, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.http_app", - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "llm_answer": "Когда в HttpControlAppFactory обрабатывается запрос `/health`, выполняются следующие шаги:\n\n1. Создается экземпляр FastAPI с названием \"PLBA Control API\".\n2. Добавляется middleware для логирования времени обработки каждого запроса (`log_api_call`).\n3. Обрабатывается GET-запрос к `/health`.\n - Вызывается провайдер здоровья `health_provider`, который возвращает асинхронно объект типа `HealthPayload`.\n - Проверяется статус здоровья (\"ok\" или иное). В зависимости от статуса устанавливается соответствующий HTTP-код ответа (200 или 503).\n - Возвращается JSON-ответ с содержимым `HealthPayload`.", - "summary": { - "router": { - "intent": "CODE_QA", - "sub_intent": "TRACE_FLOW", - "confidence": null - }, - "retrieval": { - "profile": "code", - "layers_hit": [ - "C0_SOURCE_CHUNKS", - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS", - "C4_SEMANTIC_ROLES" - ], - "evidence_sufficient": true - }, - "llm": { - "answer_status": "answered", - "groundedness": "grounded" - } - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "TRACE_FLOW", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "symbol_kind_hint": "unknown", - "symbol_candidates": [ - "health", - "HttpControlAppFactory" - ], - "keyword_hints": [ - "health", - "HttpControlAppFactory" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C0_SOURCE_CHUNKS": "exact_path_fetch", - "C4_SEMANTIC_ROLES": "exact_path_fetch", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C3_ENTRYPOINTS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 8, - "C4_SEMANTIC_ROLES": 8, - "C2_DEPENDENCY_GRAPH": 10, - "C3_ENTRYPOINTS": 10 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C4_SEMANTIC_ROLES": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "health HttpControlAppFactory", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Покажи как проходит запрос /health в HttpControlAppFactory", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C4_SEMANTIC_ROLES", - "query": "Покажи как проходит запрос /health в HttpControlAppFactory", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "Покажи как проходит запрос /health в HttpControlAppFactory", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 10, - "ranking_profile": "code" - }, - { - "layer": "C3_ENTRYPOINTS", - "query": "Покажи как проходит запрос /health в HttpControlAppFactory", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 10, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 4, - "candidates_after_filter": 4 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 10, - "candidates_after_filter": 10 - }, - { - "layer": "C3_ENTRYPOINTS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 3, - "candidates_after_filter": 3 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "HttpControlAppFactory", - "alternatives": [ - "HttpControlAppFactory", - "ControlActionSet", - "HealthContributor.health", - "HealthContributor" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "hit", - "hit_count": 4, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C4_SEMANTIC_ROLES", - "status": "hit", - "hit_count": 8, - "fail_reason": null - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 10, - "fail_reason": null - }, - { - "layer": "C3_ENTRYPOINTS", - "status": "hit", - "hit_count": 3, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "router": 1, - "symbol_resolution": 0, - "retrieval_total": 239, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 61, - "C0_SOURCE_CHUNKS": 58, - "C4_SEMANTIC_ROLES": 35, - "C2_DEPENDENCY_GRAPH": 68, - "C3_ENTRYPOINTS": 16 - }, - "merge_rank": 49, - "prompt_build": 0, - "llm_call": 1326 - }, - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 837, - "evidence_rows": 26, - "evidence_chars": 3507 - }, - "evidence_summary": [ - { - "layer": "C1_SYMBOL_CATALOG", - "count": 4, - "unique_paths": 3 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "count": 8, - "unique_paths": 7 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "count": 10, - "unique_paths": 3 - }, - { - "layer": "C3_ENTRYPOINTS", - "count": 3, - "unique_paths": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 1, - "unique_paths": 1 - } - ], - "prompt_template_id": "intent_code_qa_trace_flow_ru_v4", - "system_prompt_version": "v1" - }, - "router": { - "conversation_mode": "START", - "keyword_hints": [ - "health", - "HttpControlAppFactory" - ], - "path_scope": [] - }, - "llm": { - "used_evidence_count": 26, - "missing_evidence_reason": null - } - }, - "run_info": { - "case_id": "plba-v2-trace-flow-health-endpoint", - "mode": "full_chain", - "run_started_at": "2026-03-12T14:38:57", - "rag_session_id": "7d11da21-faa0-4cea-aede-aeabe069164c", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - }, - "input_request": { - "text": "Покажи как проходит запрос /health в HttpControlAppFactory", - "normalized_query": "Покажи как проходит запрос /health в HttpControlAppFactory" - }, - "steps": [ - { - "step": "intent_router", - "input": { - "query": "Покажи как проходит запрос /health в HttpControlAppFactory" - }, - "output": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Покажи как проходит запрос /health в HttpControlAppFactory" - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "TRACE_FLOW", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "symbol_kind_hint": "unknown", - "symbol_candidates": [ - "health", - "HttpControlAppFactory" - ], - "keyword_hints": [ - "health", - "HttpControlAppFactory" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "timings_ms": { - "router": 1 - } - } - }, - { - "step": "retrieval", - "input": { - "query": "Покажи как проходит запрос /health в HttpControlAppFactory" - }, - "output": { - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "HttpControlAppFactory", - "alternatives": [ - "HttpControlAppFactory", - "ControlActionSet", - "HealthContributor.health", - "HealthContributor" - ], - "confidence": 0.99 - }, - "rag_count": 26, - "rag_rows": [ - { - "path": "src/app_runtime/control/http_app.py", - "content": "class HttpControlAppFactory\nHttpControlAppFactory", - "layer": "C1_SYMBOL_CATALOG", - "title": "HttpControlAppFactory", - "span_start": 15, - "span_end": 53, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "9b3502a5fb408b273223db13264349cf500de24915b6c649d9ea8970d0dfd8e0", - "qname": "HttpControlAppFactory", - "kind": "class", - "signature": "HttpControlAppFactory", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.control.http_app", - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "class ControlActionSet\nControlActionSet", - "layer": "C1_SYMBOL_CATALOG", - "title": "ControlActionSet", - "span_start": 14, - "span_end": 18, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "46eb026cb3313415ec47b82dd22f84f4d112c9d987e8b1716dcb0baa1cce8988", - "qname": "ControlActionSet", - "kind": "class", - "signature": "ControlActionSet", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.control.base", - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/contracts/health.py", - "content": "method HealthContributor.health\nhealth(self)\nReturn contributor health state.", - "layer": "C1_SYMBOL_CATALOG", - "title": "HealthContributor.health", - "span_start": 9, - "span_end": 10, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "728cff18958d8a25e2661a0f08c83d68c3bbbfa8cef212b85dc0da2b11b3dc90", - "qname": "HealthContributor.health", - "kind": "method", - "signature": "health(self)", - "parent_symbol_id": "HealthContributor", - "package_or_module": "src.app_runtime.contracts.health", - "is_test": false, - "blob_sha": "6bd92611def7131e32d4dd34a8ed85e6cf3c67722ad27797032a632cb30dc097", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/contracts/health.py", - "content": "class HealthContributor\nHealthContributor(ABC)", - "layer": "C1_SYMBOL_CATALOG", - "title": "HealthContributor", - "span_start": 7, - "span_end": 10, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "db91ae387b89a2e9d83829754f27fa18a4055b3e72d7f31789a0b8e0bf5bba0b", - "qname": "HealthContributor", - "kind": "class", - "signature": "HealthContributor(ABC)", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.contracts.health", - "is_test": false, - "blob_sha": "6bd92611def7131e32d4dd34a8ed85e6cf3c67722ad27797032a632cb30dc097", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "HttpControlAppFactory\nrole: factory\n\nResponsibilities:\n- name suffix suggests factory", - "layer": "C4_SEMANTIC_ROLES", - "title": "HttpControlAppFactory", - "span_start": 15, - "span_end": 53, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 39, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "9b3502a5fb408b273223db13264349cf500de24915b6c649d9ea8970d0dfd8e0", - "symbol_name": "HttpControlAppFactory", - "qname": "HttpControlAppFactory", - "role": "factory", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/health/registry.py", - "content": "HealthRegistry\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (2)", - "layer": "C4_SEMANTIC_ROLES", - "title": "HealthRegistry", - "span_start": 8, - "span_end": 56, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 29, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "fd3390eb0ba29c9979466b9c2117238e0da3bb829eeb4d505cb34c9c3df7a8e8", - "symbol_name": "HealthRegistry", - "qname": "HealthRegistry", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 2, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "26e6a24daa43407ba5340b74497c20153020e79f8d7828ae502aaec378dfcf75", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/types.py", - "content": "HealthPayload\nrole: model\n\nResponsibilities:\n- default model role", - "layer": "C4_SEMANTIC_ROLES", - "title": "HealthPayload", - "span_start": 7, - "span_end": 11, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 40, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "392235d63ddf752d6e419cb8528c93fe070d1bc02d3c87ba6a897baac810cf5d", - "symbol_name": "HealthPayload", - "qname": "HealthPayload", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "448a02e4a432b5ab65b246b2bd24a32a6f127b9d2091ea73b53ee3c0a2f53bb3", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/contracts/health.py", - "content": "HealthContributor\nrole: model\n\nResponsibilities:\n- default model role", - "layer": "C4_SEMANTIC_ROLES", - "title": "HealthContributor", - "span_start": 7, - "span_end": 10, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 40, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "db91ae387b89a2e9d83829754f27fa18a4055b3e72d7f31789a0b8e0bf5bba0b", - "symbol_name": "HealthContributor", - "qname": "HealthContributor", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "6bd92611def7131e32d4dd34a8ed85e6cf3c67722ad27797032a632cb30dc097", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "ControlActionSet\nrole: model\n\nResponsibilities:\n- default model role", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlActionSet", - "span_start": 14, - "span_end": 18, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 40, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "46eb026cb3313415ec47b82dd22f84f4d112c9d987e8b1716dcb0baa1cce8988", - "symbol_name": "ControlActionSet", - "qname": "ControlActionSet", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "ControlChannel\nrole: model\n\nResponsibilities:\n- default model role", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlChannel", - "span_start": 21, - "span_end": 28, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 40, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "cfcfe9a311d3a2dbdaf32ac4ccd73c0eb9a117f830591a1c0867ee97d46204ff", - "symbol_name": "ControlChannel", - "qname": "ControlChannel", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests service\n- reads and writes state attributes\n- participates in dataflow slices (5)", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlPlaneService", - "span_start": 12, - "span_end": 52, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 68, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "b13471e5916986dccffb53fab613812842965705e6b3a89ae549d30c9e91e9aa", - "symbol_name": "ControlPlaneService", - "qname": "ControlPlaneService", - "role": "pipeline_stage", - "confidence": 0.57, - "dataflow_participation": 5, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_runner.py", - "content": "UvicornThreadRunner\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (24)", - "layer": "C4_SEMANTIC_ROLES", - "title": "UvicornThreadRunner", - "span_start": 10, - "span_end": 61, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 11, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "fd55630045a02100df8877ac27d951ee08617d4598764394d48cb51fe067476a", - "symbol_name": "UvicornThreadRunner", - "qname": "UvicornThreadRunner", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 24, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "3779fdd2878b770e789a35bb2a89c9d79f13b61c26d7db1b3b683f9bb9e1623f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/health/registry.py", - "content": "HealthRegistry.__init__\n -> HealthRegistry._contributors\n -> HealthRegistry.register", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "HealthRegistry.__init__:dataflow_slice", - "span_start": 10, - "span_end": 13, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "2381dfb339d541367c3251d2a610cac9d8b3f6bd6a352e119d00a93c5ccc2b7d", - "edge_type": "dataflow_slice", - "src_symbol_id": "e8ffd58441c231de43d9e86c31eb12303d4e2bf045b2acf13d1dfe78da01f8dc", - "src_qname": "HealthRegistry.__init__", - "dst_symbol_id": "a9e1f290c346c8bb1d67af0cafeebb5bcaf29c3ed7027e33c794532743df38f2", - "dst_ref": "HealthRegistry.register", - "resolution": "resolved", - "slice_id": "2381dfb339d541367c3251d2a610cac9d8b3f6bd6a352e119d00a93c5ccc2b7d", - "root_symbol_id": "e8ffd58441c231de43d9e86c31eb12303d4e2bf045b2acf13d1dfe78da01f8dc", - "path_symbols": [ - "HealthRegistry.__init__", - "HealthRegistry._contributors", - "HealthRegistry.register" - ], - "path_symbol_ids": [ - "e8ffd58441c231de43d9e86c31eb12303d4e2bf045b2acf13d1dfe78da01f8dc", - "a9e1f290c346c8bb1d67af0cafeebb5bcaf29c3ed7027e33c794532743df38f2" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "26e6a24daa43407ba5340b74497c20153020e79f8d7828ae502aaec378dfcf75", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.start", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 20, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154", - "dst_ref": "ControlPlaneService.start", - "resolution": "resolved", - "slice_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.start" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.stop", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 25, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d", - "dst_ref": "ControlPlaneService.stop", - "resolution": "resolved", - "slice_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.stop" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._stop_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 51, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a", - "dst_ref": "ControlPlaneService._stop_async", - "resolution": "resolved", - "slice_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._stop_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/health/registry.py", - "content": "HealthRegistry.__init__\n -> HealthRegistry._contributors\n -> HealthRegistry.contributor_healths", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "HealthRegistry.__init__:dataflow_slice", - "span_start": 10, - "span_end": 16, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "d3a88a7abf16359e903e809ffc24473658fdd8198f60641fe1584fc4ac663c31", - "edge_type": "dataflow_slice", - "src_symbol_id": "e8ffd58441c231de43d9e86c31eb12303d4e2bf045b2acf13d1dfe78da01f8dc", - "src_qname": "HealthRegistry.__init__", - "dst_symbol_id": "fa7bbd8f4b64a55a5088640c30f52e84075d65f531bd7e1f6c1d7bb8d24fcbf2", - "dst_ref": "HealthRegistry.contributor_healths", - "resolution": "resolved", - "slice_id": "d3a88a7abf16359e903e809ffc24473658fdd8198f60641fe1584fc4ac663c31", - "root_symbol_id": "e8ffd58441c231de43d9e86c31eb12303d4e2bf045b2acf13d1dfe78da01f8dc", - "path_symbols": [ - "HealthRegistry.__init__", - "HealthRegistry._contributors", - "HealthRegistry.contributor_healths" - ], - "path_symbol_ids": [ - "e8ffd58441c231de43d9e86c31eb12303d4e2bf045b2acf13d1dfe78da01f8dc", - "fa7bbd8f4b64a55a5088640c30f52e84075d65f531bd7e1f6c1d7bb8d24fcbf2" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "26e6a24daa43407ba5340b74497c20153020e79f8d7828ae502aaec378dfcf75", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._start_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 47, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517", - "dst_ref": "ControlPlaneService._start_async", - "resolution": "resolved", - "slice_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._start_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.register_channel", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 17, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957", - "dst_ref": "ControlPlaneService.register_channel", - "resolution": "resolved", - "slice_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.register_channel" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "HttpControlAppFactory.create calls time.monotonic", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "HttpControlAppFactory.create:calls", - "span_start": 25, - "span_end": 25, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "3fdd0a88d10225ee74f3b84ab57e13f09f5ccc72f00e31af9ae4655411c289c0", - "edge_type": "calls", - "src_symbol_id": "4af42c2a9275d652e710a98ec48b8247236b4453a093629f8958704ff6d3cb58", - "src_qname": "HttpControlAppFactory.create", - "dst_symbol_id": null, - "dst_ref": "time.monotonic", - "resolution": "partial", - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "HttpControlAppFactory.create calls app.post", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "HttpControlAppFactory.create:calls", - "span_start": 37, - "span_end": 37, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "0e545d4b5187db7bec5ceac03071d2ad68177550c42af748fee364639e533c90", - "edge_type": "calls", - "src_symbol_id": "4af42c2a9275d652e710a98ec48b8247236b4453a093629f8958704ff6d3cb58", - "src_qname": "HttpControlAppFactory.create", - "dst_symbol_id": null, - "dst_ref": "app.post", - "resolution": "partial", - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "HttpControlAppFactory.create calls str", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "HttpControlAppFactory.create:calls", - "span_start": 27, - "span_end": 27, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "2a87c51461e31cd556508cc37fdff37b4d24c26f7f1604db30af5e8f1bda96cb", - "edge_type": "calls", - "src_symbol_id": "4af42c2a9275d652e710a98ec48b8247236b4453a093629f8958704ff6d3cb58", - "src_qname": "HttpControlAppFactory.create", - "dst_symbol_id": null, - "dst_ref": "str", - "resolution": "partial", - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "class HttpControlAppFactory:\n def create(\n self,\n health_provider: Callable[[], Awaitable[HealthPayload]],\n action_provider: Callable[[str, str], Awaitable[JSONResponse]],\n ) -> FastAPI:\n app = FastAPI(title=\"PLBA Control API\")\n\n @app.middleware(\"http\")\n async def log_api_call(request: Request, call_next): # type: ignore[no-untyped-def]\n started = time.monotonic()\n response = await call_next(request)\n response.headers[\"X-Response-Time-Ms\"] = str(int((time.monotonic() - started) * 1000))\n return response\n\n @app.get(\"/health\")\n async def health() -> JSONResponse:\n payload = await health_provider()\n status_code = 200 if payload.get(\"status\") == \"ok\" else 503\n return JSONResponse(content=payload, status_code=status_code)\n\n @app.get(\"/actions/{action}\")\n @app.post(\"/actions/{action}\")\n async def action(action: str, request: Request) -> JSONResponse:\n client_source = self._client_source(request)\n if action in {\"start\", \"stop\"}:\n LOGGER.warning(\"Control action requested: /actions/%s client=%s\", action, client_source)\n return await action_provider(action, client_source)\n\n return app\n\n def _client_source(self, request: Request) -> str:\n explicit_header = request.headers.get(\"X-Client-Source\", \"\").strip()\n if explicit_header:\n return explicit_header\n user_agent = request.headers.get(\"User-Agent\", \"\").strip()\n if user_agent:\n return f\"user-agent:{user_agent}\"\n return \"unknown\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/http_app.py:HttpControlAppFactory", - "span_start": 15, - "span_end": 53, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.http_app", - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ] - }, - "diagnostics": { - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C0_SOURCE_CHUNKS": "exact_path_fetch", - "C4_SEMANTIC_ROLES": "exact_path_fetch", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C3_ENTRYPOINTS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 8, - "C4_SEMANTIC_ROLES": 8, - "C2_DEPENDENCY_GRAPH": 10, - "C3_ENTRYPOINTS": 10 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C4_SEMANTIC_ROLES": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "health HttpControlAppFactory", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Покажи как проходит запрос /health в HttpControlAppFactory", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C4_SEMANTIC_ROLES", - "query": "Покажи как проходит запрос /health в HttpControlAppFactory", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "Покажи как проходит запрос /health в HttpControlAppFactory", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 10, - "ranking_profile": "code" - }, - { - "layer": "C3_ENTRYPOINTS", - "query": "Покажи как проходит запрос /health в HttpControlAppFactory", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 10, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 4, - "candidates_after_filter": 4 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 10, - "candidates_after_filter": 10 - }, - { - "layer": "C3_ENTRYPOINTS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 3, - "candidates_after_filter": 3 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "HttpControlAppFactory", - "alternatives": [ - "HttpControlAppFactory", - "ControlActionSet", - "HealthContributor.health", - "HealthContributor" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "hit", - "hit_count": 4, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C4_SEMANTIC_ROLES", - "status": "hit", - "hit_count": 8, - "fail_reason": null - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 10, - "fail_reason": null - }, - { - "layer": "C3_ENTRYPOINTS", - "status": "hit", - "hit_count": 3, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "symbol_resolution": 0, - "retrieval_total": 239, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 61, - "C0_SOURCE_CHUNKS": 58, - "C4_SEMANTIC_ROLES": 35, - "C2_DEPENDENCY_GRAPH": 68, - "C3_ENTRYPOINTS": 16 - }, - "merge_rank": 49 - } - } - }, - { - "step": "llm_answer", - "input": { - "query": "Покажи как проходит запрос /health в HttpControlAppFactory", - "rag_count": 26 - }, - "output": { - "llm_answer": "Когда в HttpControlAppFactory обрабатывается запрос `/health`, выполняются следующие шаги:\n\n1. Создается экземпляр FastAPI с названием \"PLBA Control API\".\n2. Добавляется middleware для логирования времени обработки каждого запроса (`log_api_call`).\n3. Обрабатывается GET-запрос к `/health`.\n - Вызывается провайдер здоровья `health_provider`, который возвращает асинхронно объект типа `HealthPayload`.\n - Проверяется статус здоровья (\"ok\" или иное). В зависимости от статуса устанавливается соответствующий HTTP-код ответа (200 или 503).\n - Возвращается JSON-ответ с содержимым `HealthPayload`." - }, - "diagnostics": { - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 837, - "evidence_rows": 26, - "evidence_chars": 3507 - }, - "evidence_summary": [ - { - "layer": "C1_SYMBOL_CATALOG", - "count": 4, - "unique_paths": 3 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "count": 8, - "unique_paths": 7 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "count": 10, - "unique_paths": 3 - }, - { - "layer": "C3_ENTRYPOINTS", - "count": 3, - "unique_paths": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 1, - "unique_paths": 1 - } - ], - "prompt_template_id": "intent_code_qa_trace_flow_ru_v4", - "system_prompt_version": "v1" - }, - "timings_ms": { - "prompt_build": 0, - "llm_call": 1326 - } - } - } - ] - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_143856/full_chain_plba_code_subintents_v2_plba-v2-trace-flow-health-endpoint.md b/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_143856/full_chain_plba_code_subintents_v2_plba-v2-trace-flow-health-endpoint.md deleted file mode 100644 index f8ae0b6..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_143856/full_chain_plba_code_subintents_v2_plba-v2-trace-flow-health-endpoint.md +++ /dev/null @@ -1,35 +0,0 @@ -# plba-v2-trace-flow-health-endpoint - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_subintents_v2.yaml -- runner: runtime -- mode: full_chain -- passed: True - -## Query -Покажи как проходит запрос /health в HttpControlAppFactory - -## Actual -{ - "intent": "CODE_QA", - "sub_intent": "TRACE_FLOW", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 26, - "llm_answer": "Когда в HttpControlAppFactory обрабатывается запрос `/health`, выполняются следующие шаги:\n\n1. Создается экземпляр FastAPI с названием \"PLBA Control API\".\n2. Добавляется middleware для логирования времени обработки каждого запроса (`log_api_call`).\n3. Обрабатывается GET-запрос к `/health`.\n - Вызывается провайдер здоровья `health_provider`, который возвращает асинхронно объект типа `HealthPayload`.\n - Проверяется статус здоровья (\"ok\" или иное). В зависимости от статуса устанавливается соответствующий HTTP-код ответа (200 или 503).\n - Возвращается JSON-ответ с содержимым `HealthPayload`.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "health", - "HttpControlAppFactory" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] -} - -## Mismatches -- none \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_143856/full_chain_plba_code_subintents_v2_plba-v2-trace-flow-runtime-start.json b/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_143856/full_chain_plba_code_subintents_v2_plba-v2-trace-flow-runtime-start.json deleted file mode 100644 index 69b3994..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_143856/full_chain_plba_code_subintents_v2_plba-v2-trace-flow-runtime-start.json +++ /dev/null @@ -1,2964 +0,0 @@ -{ - "case_id": "plba-v2-trace-flow-runtime-start", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_subintents_v2.yaml", - "runner": "runtime", - "mode": "full_chain", - "actual": { - "intent": "CODE_QA", - "sub_intent": "TRACE_FLOW", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 23, - "llm_answer": "При запуске объекта `RuntimeManager` происходит следующее:\n\n1. В конструкторе класса вызывается инициализация свойств через явные аргументы:\n - `configuration`: объект конфигурации (`ConfigurationManager`), используется значение по умолчанию, если аргумент отсутствует.\n - `services`: контейнер сервисов (`ServiceContainer`), также с возможным значением по умолчанию.\n - `traces`, `health`, `logs`, `workers`, `control_plane`: аналогичные настройки для соответствующих служб и компонентов.\n \n2. Далее выполняется регистрация модулей приложения через метод `_register_core_services()`.\n\nТаким образом, основной поток начинается с вызова конструктора класса и продолжается регистрацией внутренних компонентов и служб приложения, необходимых для последующего управления жизненным циклом runtime-среды.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "RuntimeManager" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "passed": true, - "mismatches": [], - "details": { - "case_id": "plba-v2-trace-flow-runtime-start", - "text": "Покажи поток выполнения при запуске RuntimeManager", - "mode": "full_chain", - "run_started_at": "2026-03-12T14:38:57", - "rag_session_id": "7d11da21-faa0-4cea-aede-aeabe069164c", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Покажи поток выполнения при запуске RuntimeManager", - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "RuntimeManager", - "alternatives": [ - "RuntimeManager" - ], - "confidence": 0.99 - }, - "rag_count": 23, - "rag_rows": [ - { - "path": "src/app_runtime/core/runtime.py", - "content": "class RuntimeManager\nRuntimeManager", - "layer": "C1_SYMBOL_CATALOG", - "title": "RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "7e4a9381328c5803bbc6179458612fc4e947d928aa7bf8b4b2bebb2c8592f758", - "qname": "RuntimeManager", - "kind": "class", - "signature": "RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.core.runtime", - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests manager\n- orchestrates role-like calls (4)\n- reads and writes state attributes\n- participates in dataflow slices (50)", - "layer": "C4_SEMANTIC_ROLES", - "title": "RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 43, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "7e4a9381328c5803bbc6179458612fc4e947d928aa7bf8b4b2bebb2c8592f758", - "symbol_name": "RuntimeManager", - "qname": "RuntimeManager", - "role": "pipeline_stage", - "confidence": 0.67, - "dataflow_participation": 50, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "ControlChannel\nrole: model\n\nResponsibilities:\n- default model role", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlChannel", - "span_start": 21, - "span_end": 28, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 40, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "cfcfe9a311d3a2dbdaf32ac4ccd73c0eb9a117f830591a1c0867ee97d46204ff", - "symbol_name": "ControlChannel", - "qname": "ControlChannel", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "ControlActionSet\nrole: model\n\nResponsibilities:\n- default model role", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlActionSet", - "span_start": 14, - "span_end": 18, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 40, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "46eb026cb3313415ec47b82dd22f84f4d112c9d987e8b1716dcb0baa1cce8988", - "symbol_name": "ControlActionSet", - "qname": "ControlActionSet", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests service\n- reads and writes state attributes\n- participates in dataflow slices (5)", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlPlaneService", - "span_start": 12, - "span_end": 52, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 68, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "b13471e5916986dccffb53fab613812842965705e6b3a89ae549d30c9e91e9aa", - "symbol_name": "ControlPlaneService", - "qname": "ControlPlaneService", - "role": "pipeline_stage", - "confidence": 0.57, - "dataflow_participation": 5, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_runner.py", - "content": "UvicornThreadRunner\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (24)", - "layer": "C4_SEMANTIC_ROLES", - "title": "UvicornThreadRunner", - "span_start": 10, - "span_end": 61, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 11, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "fd55630045a02100df8877ac27d951ee08617d4598764394d48cb51fe067476a", - "symbol_name": "UvicornThreadRunner", - "qname": "UvicornThreadRunner", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 24, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "3779fdd2878b770e789a35bb2a89c9d79f13b61c26d7db1b3b683f9bb9e1623f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (10)", - "layer": "C4_SEMANTIC_ROLES", - "title": "HttpControlChannel", - "span_start": 12, - "span_end": 57, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 21, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "1c9fbdc24819e5604c26ea55428a74310f03a03e1af197ed84846af61e42fdb0", - "symbol_name": "HttpControlChannel", - "qname": "HttpControlChannel", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 10, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "HttpControlAppFactory\nrole: factory\n\nResponsibilities:\n- name suffix suggests factory", - "layer": "C4_SEMANTIC_ROLES", - "title": "HttpControlAppFactory", - "span_start": 15, - "span_end": 53, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 39, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "9b3502a5fb408b273223db13264349cf500de24915b6c649d9ea8970d0dfd8e0", - "symbol_name": "HttpControlAppFactory", - "qname": "HttpControlAppFactory", - "role": "factory", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/persistence/workflow_persistence.py", - "content": "WorkflowPersistence\nrole: pipeline_stage\n\nResponsibilities:\n- orchestrates role-like calls (2)\n- reads and writes state attributes\n- participates in dataflow slices (16)", - "layer": "C4_SEMANTIC_ROLES", - "title": "WorkflowPersistence", - "span_start": 8, - "span_end": 54, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 15, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "7bd01ee45cf31f2d5c2e3e51656254860ac785d10cef9e0852cd4fba90857bae", - "symbol_name": "WorkflowPersistence", - "qname": "WorkflowPersistence", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 16, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "80e9410ddc639789b4353c2a1a757ba8d0d5b5bb6075b0b263b61551f04ae1f0", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager.add_config_file", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 32, - "span_end": 52, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "a23b8a11ebdb12708b60c96ea12a69f7f042082f1adfddd572444e246d81d167", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "57ffbd4f0d9fdf3507c2b8624312ce211f3d02fdf86a57a8ec90778d8a7b498d", - "dst_ref": "RuntimeManager.add_config_file", - "resolution": "resolved", - "slice_id": "a23b8a11ebdb12708b60c96ea12a69f7f042082f1adfddd572444e246d81d167", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager.add_config_file" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "57ffbd4f0d9fdf3507c2b8624312ce211f3d02fdf86a57a8ec90778d8a7b498d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.services\n -> RuntimeManager.__init__", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 33, - "span_end": 39, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "d43af85989222ee6d788ce418cdcb217c7ff044cfb915e3bdbd184417dc7bd61", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "dst_ref": "RuntimeManager.__init__", - "resolution": "resolved", - "slice_id": "d43af85989222ee6d788ce418cdcb217c7ff044cfb915e3bdbd184417dc7bd61", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.services", - "RuntimeManager.__init__" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.stop", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 25, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d", - "dst_ref": "ControlPlaneService.stop", - "resolution": "resolved", - "slice_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.stop" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._stop_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 51, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a", - "dst_ref": "ControlPlaneService._stop_async", - "resolution": "resolved", - "slice_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._stop_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager.start", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 32, - "span_end": 59, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "98312ace7fc62b1c7194c5aa1732b6ef736eae1668a3a120dd1ecd5ab1d64f7a", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "77a7b260193018845e4e204df094ab89cfd7c82ee4e822b3a83ad4cd945f9cb1", - "dst_ref": "RuntimeManager.start", - "resolution": "resolved", - "slice_id": "98312ace7fc62b1c7194c5aa1732b6ef736eae1668a3a120dd1ecd5ab1d64f7a", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager.start" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "77a7b260193018845e4e204df094ab89cfd7c82ee4e822b3a83ad4cd945f9cb1" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager._register_core_services", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 32, - "span_end": 127, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "3e5811f3b511fa0cabe363f5d01f2ac5fa039bc8b93f7ee108323e1f5f45a293", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "972d6057a6caac9cf31ebc1e29c6f39f71b10d4cc170dec57cf875ba458549c6", - "dst_ref": "RuntimeManager._register_core_services", - "resolution": "resolved", - "slice_id": "3e5811f3b511fa0cabe363f5d01f2ac5fa039bc8b93f7ee108323e1f5f45a293", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager._register_core_services" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "972d6057a6caac9cf31ebc1e29c6f39f71b10d4cc170dec57cf875ba458549c6" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.register_channel", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 17, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957", - "dst_ref": "ControlPlaneService.register_channel", - "resolution": "resolved", - "slice_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.register_channel" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.start", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 20, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154", - "dst_ref": "ControlPlaneService.start", - "resolution": "resolved", - "slice_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.start" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._start_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 47, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517", - "dst_ref": "ControlPlaneService._start_async", - "resolution": "resolved", - "slice_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._start_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.services\n -> RuntimeManager._register_core_services", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 33, - "span_end": 127, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "aac6f9dda73963b977083a892bee39a48eca4fbd7404787e022ecf4ebedec65d", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "972d6057a6caac9cf31ebc1e29c6f39f71b10d4cc170dec57cf875ba458549c6", - "dst_ref": "RuntimeManager._register_core_services", - "resolution": "resolved", - "slice_id": "aac6f9dda73963b977083a892bee39a48eca4fbd7404787e022ecf4ebedec65d", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.services", - "RuntimeManager._register_core_services" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "972d6057a6caac9cf31ebc1e29c6f39f71b10d4cc170dec57cf875ba458549c6" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "class RuntimeManager:\n ACTION_TIMEOUT_SECONDS = 10.0\n ACTION_POLL_INTERVAL_SECONDS = 0.05\n\n def __init__(\n self,\n configuration: ConfigurationManager | None = None,\n services: ServiceContainer | None = None,\n traces: TraceService | None = None,\n health: HealthRegistry | None = None,\n logs: LogManager | None = None,\n workers: WorkerSupervisor | None = None,\n control_plane: ControlPlaneService | None = None,\n ) -> None:\n self.configuration = configuration or ConfigurationManager()\n self.services = services or ServiceContainer()\n self.traces = traces or TraceService()\n self.health = health or HealthRegistry()\n self.logs = logs or LogManager()\n self.workers = workers or WorkerSupervisor()\n self.control_plane = control_plane or ControlPlaneService()\n self.registry = ModuleRegistry(self.services)\n self._started = False\n self._state = LifecycleState.IDLE\n self._core_registered = False\n self._workers_registered = False\n self._register_core_services()\n\n def register_module(self, module: ApplicationModule) -> None:\n self.registry.register_module(module.name)\n module.register(self.registry)\n\n def add_config_file(self, path: str) -> FileConfigProvider:\n provider = FileConfigProvider(path)\n self.configuration.add_provider(provider)\n return provider\n\n def start(self, *, start_control_plane: bool = True) -> None:\n if self._started:\n return\n self._state = LifecycleState.STARTING\n config = self.configuration.load()\n self.logs.apply_config(config)\n self._register_health_contributors()\n self._register_workers()\n self.workers.start()\n if start_control_plane:\n self.control_plane.start(self)\n self._started = True\n self._refresh_state()\n\n def stop(self, timeout: float = 30.0, force: bool = False, stop_control_plane: bool = True) -> None:\n if not self._started:\n return\n self._state = LifecycleState.STOPPING\n self.workers.stop(timeout=timeout, force=force)\n if stop_control_plane:\n self.control_plane.stop()\n self._started = False\n self._state = LifecycleState.STOPPED\n\n def status(self) -> dict[str, object]:\n self._refresh_state()\n return self.control_plane.snapshot(self)\n\n def current_health(self) -> HealthPayload:\n self._refresh_state()\n return self.health.payload(self._state, self.workers.healths())\n\n async def health_status(self) -> HealthPayload:\n return self.current_health()\n\n async def start_runtime(self) -> dict[str, object] | str:\n self._refresh_state()\n if self._started:\n return \"runtime already running\"\n if self._state == LifecycleState.STOPPING:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n\n self.start(start_control_plane=False)\n started = self._wait_for_state({LifecycleState.IDLE, LifecycleState.BUSY}, timeout=self.ACTION_TIMEOUT_SECONDS)\n if started:\n return self._action_detail(\"runtime started\", timed_out=False)\n return self._action_detail(\"runtime start is still in progress\", timed_out=True)\n\n async def stop_runtime(self) -> dict[str, object] | str:\n self._refresh_state()\n if not self._started:\n if self._state == LifecycleState.STOPPING:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n return \"runtime already stopped\"\n\n self._state = LifecycleState.STOPPING\n try:\n self.workers.stop(timeout=self.ACTION_TIMEOUT_SECONDS, force=False)\n except TimeoutError:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n\n self._started = False\n self._state = LifecycleState.STOPPED\n return self._action_detail(\"runtime stopped\", timed_out=False)\n\n async def runtime_status(self) -> str:\n self._refresh_state()\n return self._state.value\n\n def _register_core_services(self) -> None:\n if self._core_registered:\n return\n self.services.register(\"configuration\", self.configuration)\n self.services.register(\"traces\", self.traces)\n self.services.register(\"health\", self.health)\n self.services.register(\"logs\", self.logs)\n self.services.register(\"workers\", self.workers)\n self.services.register(\"control_plane\", self.control_plane)\n self._core_registered = True\n\n def _register_health_contributors(self) -> None:\n for contributor in self.registry.health_contributors:\n self.health.register(contributor)\n\n def _register_workers(self) -> None:\n if self._workers_registered:\n return\n for worker in self.registry.workers:\n self.workers.register(worker)\n self._workers_registered = True\n\n def _refresh_state(self) -> None:\n lifecycle = self.workers.lifecycle_state()\n\n if self._state == LifecycleState.STOPPING:\n if lifecycle == LifecycleState.STOPPED:\n self._started = False\n self._state = LifecycleState.STOPPED\n return\n\n if not self._started:\n if lifecycle == LifecycleState.STOPPED:\n self._state = LifecycleState.STOPPED\n return\n\n self._state = lifecycle\n\n def _wait_for_state(self, target_states: set[LifecycleState], *, timeout: float) -> bool:\n deadline = monotonic() + timeout\n while monotonic() < deadline:\n self._refresh_state()\n if self._state in target_states:\n return True\n sleep(self.ACTION_POLL_INTERVAL_SECONDS)\n self._refresh_state()\n return self._state in target_states\n\n def _action_detail(self, message: str, *, timed_out: bool) -> dict[str, object]:\n self._refresh_state()\n return {\n \"message\": message,\n \"state\": self._state.value,\n \"timed_out\": timed_out,\n \"workers\": self.workers.snapshot(),\n }", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/core/runtime.py:RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.core.runtime", - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "llm_answer": "При запуске объекта `RuntimeManager` происходит следующее:\n\n1. В конструкторе класса вызывается инициализация свойств через явные аргументы:\n - `configuration`: объект конфигурации (`ConfigurationManager`), используется значение по умолчанию, если аргумент отсутствует.\n - `services`: контейнер сервисов (`ServiceContainer`), также с возможным значением по умолчанию.\n - `traces`, `health`, `logs`, `workers`, `control_plane`: аналогичные настройки для соответствующих служб и компонентов.\n \n2. Далее выполняется регистрация модулей приложения через метод `_register_core_services()`.\n\nТаким образом, основной поток начинается с вызова конструктора класса и продолжается регистрацией внутренних компонентов и служб приложения, необходимых для последующего управления жизненным циклом runtime-среды.", - "summary": { - "router": { - "intent": "CODE_QA", - "sub_intent": "TRACE_FLOW", - "confidence": null - }, - "retrieval": { - "profile": "code", - "layers_hit": [ - "C0_SOURCE_CHUNKS", - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS", - "C4_SEMANTIC_ROLES" - ], - "evidence_sufficient": true - }, - "llm": { - "answer_status": "answered", - "groundedness": "grounded" - } - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "TRACE_FLOW", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "RuntimeManager" - ], - "keyword_hints": [ - "RuntimeManager" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C0_SOURCE_CHUNKS": "exact_path_fetch", - "C4_SEMANTIC_ROLES": "exact_path_fetch", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C3_ENTRYPOINTS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 8, - "C4_SEMANTIC_ROLES": 8, - "C2_DEPENDENCY_GRAPH": 10, - "C3_ENTRYPOINTS": 10 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C4_SEMANTIC_ROLES": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Покажи поток выполнения при запуске RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C4_SEMANTIC_ROLES", - "query": "Покажи поток выполнения при запуске RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "Покажи поток выполнения при запуске RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 10, - "ranking_profile": "code" - }, - { - "layer": "C3_ENTRYPOINTS", - "query": "Покажи поток выполнения при запуске RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 10, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 1, - "candidates_after_filter": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 10, - "candidates_after_filter": 10 - }, - { - "layer": "C3_ENTRYPOINTS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 3, - "candidates_after_filter": 3 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "RuntimeManager", - "alternatives": [ - "RuntimeManager" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C4_SEMANTIC_ROLES", - "status": "hit", - "hit_count": 8, - "fail_reason": null - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 10, - "fail_reason": null - }, - { - "layer": "C3_ENTRYPOINTS", - "status": "hit", - "hit_count": 3, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "router": 1, - "symbol_resolution": 0, - "retrieval_total": 200, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 58, - "C0_SOURCE_CHUNKS": 32, - "C4_SEMANTIC_ROLES": 28, - "C2_DEPENDENCY_GRAPH": 65, - "C3_ENTRYPOINTS": 15 - }, - "merge_rank": 27, - "prompt_build": 0, - "llm_call": 1458 - }, - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 859, - "evidence_rows": 23, - "evidence_chars": 8302 - }, - "evidence_summary": [ - { - "layer": "C1_SYMBOL_CATALOG", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "count": 8, - "unique_paths": 7 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "count": 10, - "unique_paths": 2 - }, - { - "layer": "C3_ENTRYPOINTS", - "count": 3, - "unique_paths": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 1, - "unique_paths": 1 - } - ], - "prompt_template_id": "intent_code_qa_trace_flow_ru_v4", - "system_prompt_version": "v1" - }, - "router": { - "conversation_mode": "START", - "keyword_hints": [ - "RuntimeManager" - ], - "path_scope": [] - }, - "llm": { - "used_evidence_count": 23, - "missing_evidence_reason": null - } - }, - "run_info": { - "case_id": "plba-v2-trace-flow-runtime-start", - "mode": "full_chain", - "run_started_at": "2026-03-12T14:38:57", - "rag_session_id": "7d11da21-faa0-4cea-aede-aeabe069164c", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - }, - "input_request": { - "text": "Покажи поток выполнения при запуске RuntimeManager", - "normalized_query": "Покажи поток выполнения при запуске RuntimeManager" - }, - "steps": [ - { - "step": "intent_router", - "input": { - "query": "Покажи поток выполнения при запуске RuntimeManager" - }, - "output": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Покажи поток выполнения при запуске RuntimeManager" - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "TRACE_FLOW", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "RuntimeManager" - ], - "keyword_hints": [ - "RuntimeManager" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "timings_ms": { - "router": 1 - } - } - }, - { - "step": "retrieval", - "input": { - "query": "Покажи поток выполнения при запуске RuntimeManager" - }, - "output": { - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "RuntimeManager", - "alternatives": [ - "RuntimeManager" - ], - "confidence": 0.99 - }, - "rag_count": 23, - "rag_rows": [ - { - "path": "src/app_runtime/core/runtime.py", - "content": "class RuntimeManager\nRuntimeManager", - "layer": "C1_SYMBOL_CATALOG", - "title": "RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "7e4a9381328c5803bbc6179458612fc4e947d928aa7bf8b4b2bebb2c8592f758", - "qname": "RuntimeManager", - "kind": "class", - "signature": "RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.core.runtime", - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests manager\n- orchestrates role-like calls (4)\n- reads and writes state attributes\n- participates in dataflow slices (50)", - "layer": "C4_SEMANTIC_ROLES", - "title": "RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 43, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "7e4a9381328c5803bbc6179458612fc4e947d928aa7bf8b4b2bebb2c8592f758", - "symbol_name": "RuntimeManager", - "qname": "RuntimeManager", - "role": "pipeline_stage", - "confidence": 0.67, - "dataflow_participation": 50, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "ControlChannel\nrole: model\n\nResponsibilities:\n- default model role", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlChannel", - "span_start": 21, - "span_end": 28, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 40, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "cfcfe9a311d3a2dbdaf32ac4ccd73c0eb9a117f830591a1c0867ee97d46204ff", - "symbol_name": "ControlChannel", - "qname": "ControlChannel", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "ControlActionSet\nrole: model\n\nResponsibilities:\n- default model role", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlActionSet", - "span_start": 14, - "span_end": 18, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 40, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "46eb026cb3313415ec47b82dd22f84f4d112c9d987e8b1716dcb0baa1cce8988", - "symbol_name": "ControlActionSet", - "qname": "ControlActionSet", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests service\n- reads and writes state attributes\n- participates in dataflow slices (5)", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlPlaneService", - "span_start": 12, - "span_end": 52, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 68, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "b13471e5916986dccffb53fab613812842965705e6b3a89ae549d30c9e91e9aa", - "symbol_name": "ControlPlaneService", - "qname": "ControlPlaneService", - "role": "pipeline_stage", - "confidence": 0.57, - "dataflow_participation": 5, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_runner.py", - "content": "UvicornThreadRunner\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (24)", - "layer": "C4_SEMANTIC_ROLES", - "title": "UvicornThreadRunner", - "span_start": 10, - "span_end": 61, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 11, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "fd55630045a02100df8877ac27d951ee08617d4598764394d48cb51fe067476a", - "symbol_name": "UvicornThreadRunner", - "qname": "UvicornThreadRunner", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 24, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "3779fdd2878b770e789a35bb2a89c9d79f13b61c26d7db1b3b683f9bb9e1623f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (10)", - "layer": "C4_SEMANTIC_ROLES", - "title": "HttpControlChannel", - "span_start": 12, - "span_end": 57, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 21, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "1c9fbdc24819e5604c26ea55428a74310f03a03e1af197ed84846af61e42fdb0", - "symbol_name": "HttpControlChannel", - "qname": "HttpControlChannel", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 10, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "HttpControlAppFactory\nrole: factory\n\nResponsibilities:\n- name suffix suggests factory", - "layer": "C4_SEMANTIC_ROLES", - "title": "HttpControlAppFactory", - "span_start": 15, - "span_end": 53, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 39, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "9b3502a5fb408b273223db13264349cf500de24915b6c649d9ea8970d0dfd8e0", - "symbol_name": "HttpControlAppFactory", - "qname": "HttpControlAppFactory", - "role": "factory", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/persistence/workflow_persistence.py", - "content": "WorkflowPersistence\nrole: pipeline_stage\n\nResponsibilities:\n- orchestrates role-like calls (2)\n- reads and writes state attributes\n- participates in dataflow slices (16)", - "layer": "C4_SEMANTIC_ROLES", - "title": "WorkflowPersistence", - "span_start": 8, - "span_end": 54, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 15, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "7bd01ee45cf31f2d5c2e3e51656254860ac785d10cef9e0852cd4fba90857bae", - "symbol_name": "WorkflowPersistence", - "qname": "WorkflowPersistence", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 16, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "80e9410ddc639789b4353c2a1a757ba8d0d5b5bb6075b0b263b61551f04ae1f0", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager.add_config_file", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 32, - "span_end": 52, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "a23b8a11ebdb12708b60c96ea12a69f7f042082f1adfddd572444e246d81d167", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "57ffbd4f0d9fdf3507c2b8624312ce211f3d02fdf86a57a8ec90778d8a7b498d", - "dst_ref": "RuntimeManager.add_config_file", - "resolution": "resolved", - "slice_id": "a23b8a11ebdb12708b60c96ea12a69f7f042082f1adfddd572444e246d81d167", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager.add_config_file" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "57ffbd4f0d9fdf3507c2b8624312ce211f3d02fdf86a57a8ec90778d8a7b498d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.services\n -> RuntimeManager.__init__", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 33, - "span_end": 39, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "d43af85989222ee6d788ce418cdcb217c7ff044cfb915e3bdbd184417dc7bd61", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "dst_ref": "RuntimeManager.__init__", - "resolution": "resolved", - "slice_id": "d43af85989222ee6d788ce418cdcb217c7ff044cfb915e3bdbd184417dc7bd61", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.services", - "RuntimeManager.__init__" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.stop", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 25, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d", - "dst_ref": "ControlPlaneService.stop", - "resolution": "resolved", - "slice_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.stop" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._stop_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 51, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a", - "dst_ref": "ControlPlaneService._stop_async", - "resolution": "resolved", - "slice_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._stop_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager.start", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 32, - "span_end": 59, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "98312ace7fc62b1c7194c5aa1732b6ef736eae1668a3a120dd1ecd5ab1d64f7a", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "77a7b260193018845e4e204df094ab89cfd7c82ee4e822b3a83ad4cd945f9cb1", - "dst_ref": "RuntimeManager.start", - "resolution": "resolved", - "slice_id": "98312ace7fc62b1c7194c5aa1732b6ef736eae1668a3a120dd1ecd5ab1d64f7a", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager.start" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "77a7b260193018845e4e204df094ab89cfd7c82ee4e822b3a83ad4cd945f9cb1" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager._register_core_services", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 32, - "span_end": 127, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "3e5811f3b511fa0cabe363f5d01f2ac5fa039bc8b93f7ee108323e1f5f45a293", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "972d6057a6caac9cf31ebc1e29c6f39f71b10d4cc170dec57cf875ba458549c6", - "dst_ref": "RuntimeManager._register_core_services", - "resolution": "resolved", - "slice_id": "3e5811f3b511fa0cabe363f5d01f2ac5fa039bc8b93f7ee108323e1f5f45a293", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager._register_core_services" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "972d6057a6caac9cf31ebc1e29c6f39f71b10d4cc170dec57cf875ba458549c6" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.register_channel", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 17, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957", - "dst_ref": "ControlPlaneService.register_channel", - "resolution": "resolved", - "slice_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.register_channel" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.start", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 20, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154", - "dst_ref": "ControlPlaneService.start", - "resolution": "resolved", - "slice_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.start" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._start_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 47, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517", - "dst_ref": "ControlPlaneService._start_async", - "resolution": "resolved", - "slice_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._start_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.services\n -> RuntimeManager._register_core_services", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 33, - "span_end": 127, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "aac6f9dda73963b977083a892bee39a48eca4fbd7404787e022ecf4ebedec65d", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "972d6057a6caac9cf31ebc1e29c6f39f71b10d4cc170dec57cf875ba458549c6", - "dst_ref": "RuntimeManager._register_core_services", - "resolution": "resolved", - "slice_id": "aac6f9dda73963b977083a892bee39a48eca4fbd7404787e022ecf4ebedec65d", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.services", - "RuntimeManager._register_core_services" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "972d6057a6caac9cf31ebc1e29c6f39f71b10d4cc170dec57cf875ba458549c6" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "class RuntimeManager:\n ACTION_TIMEOUT_SECONDS = 10.0\n ACTION_POLL_INTERVAL_SECONDS = 0.05\n\n def __init__(\n self,\n configuration: ConfigurationManager | None = None,\n services: ServiceContainer | None = None,\n traces: TraceService | None = None,\n health: HealthRegistry | None = None,\n logs: LogManager | None = None,\n workers: WorkerSupervisor | None = None,\n control_plane: ControlPlaneService | None = None,\n ) -> None:\n self.configuration = configuration or ConfigurationManager()\n self.services = services or ServiceContainer()\n self.traces = traces or TraceService()\n self.health = health or HealthRegistry()\n self.logs = logs or LogManager()\n self.workers = workers or WorkerSupervisor()\n self.control_plane = control_plane or ControlPlaneService()\n self.registry = ModuleRegistry(self.services)\n self._started = False\n self._state = LifecycleState.IDLE\n self._core_registered = False\n self._workers_registered = False\n self._register_core_services()\n\n def register_module(self, module: ApplicationModule) -> None:\n self.registry.register_module(module.name)\n module.register(self.registry)\n\n def add_config_file(self, path: str) -> FileConfigProvider:\n provider = FileConfigProvider(path)\n self.configuration.add_provider(provider)\n return provider\n\n def start(self, *, start_control_plane: bool = True) -> None:\n if self._started:\n return\n self._state = LifecycleState.STARTING\n config = self.configuration.load()\n self.logs.apply_config(config)\n self._register_health_contributors()\n self._register_workers()\n self.workers.start()\n if start_control_plane:\n self.control_plane.start(self)\n self._started = True\n self._refresh_state()\n\n def stop(self, timeout: float = 30.0, force: bool = False, stop_control_plane: bool = True) -> None:\n if not self._started:\n return\n self._state = LifecycleState.STOPPING\n self.workers.stop(timeout=timeout, force=force)\n if stop_control_plane:\n self.control_plane.stop()\n self._started = False\n self._state = LifecycleState.STOPPED\n\n def status(self) -> dict[str, object]:\n self._refresh_state()\n return self.control_plane.snapshot(self)\n\n def current_health(self) -> HealthPayload:\n self._refresh_state()\n return self.health.payload(self._state, self.workers.healths())\n\n async def health_status(self) -> HealthPayload:\n return self.current_health()\n\n async def start_runtime(self) -> dict[str, object] | str:\n self._refresh_state()\n if self._started:\n return \"runtime already running\"\n if self._state == LifecycleState.STOPPING:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n\n self.start(start_control_plane=False)\n started = self._wait_for_state({LifecycleState.IDLE, LifecycleState.BUSY}, timeout=self.ACTION_TIMEOUT_SECONDS)\n if started:\n return self._action_detail(\"runtime started\", timed_out=False)\n return self._action_detail(\"runtime start is still in progress\", timed_out=True)\n\n async def stop_runtime(self) -> dict[str, object] | str:\n self._refresh_state()\n if not self._started:\n if self._state == LifecycleState.STOPPING:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n return \"runtime already stopped\"\n\n self._state = LifecycleState.STOPPING\n try:\n self.workers.stop(timeout=self.ACTION_TIMEOUT_SECONDS, force=False)\n except TimeoutError:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n\n self._started = False\n self._state = LifecycleState.STOPPED\n return self._action_detail(\"runtime stopped\", timed_out=False)\n\n async def runtime_status(self) -> str:\n self._refresh_state()\n return self._state.value\n\n def _register_core_services(self) -> None:\n if self._core_registered:\n return\n self.services.register(\"configuration\", self.configuration)\n self.services.register(\"traces\", self.traces)\n self.services.register(\"health\", self.health)\n self.services.register(\"logs\", self.logs)\n self.services.register(\"workers\", self.workers)\n self.services.register(\"control_plane\", self.control_plane)\n self._core_registered = True\n\n def _register_health_contributors(self) -> None:\n for contributor in self.registry.health_contributors:\n self.health.register(contributor)\n\n def _register_workers(self) -> None:\n if self._workers_registered:\n return\n for worker in self.registry.workers:\n self.workers.register(worker)\n self._workers_registered = True\n\n def _refresh_state(self) -> None:\n lifecycle = self.workers.lifecycle_state()\n\n if self._state == LifecycleState.STOPPING:\n if lifecycle == LifecycleState.STOPPED:\n self._started = False\n self._state = LifecycleState.STOPPED\n return\n\n if not self._started:\n if lifecycle == LifecycleState.STOPPED:\n self._state = LifecycleState.STOPPED\n return\n\n self._state = lifecycle\n\n def _wait_for_state(self, target_states: set[LifecycleState], *, timeout: float) -> bool:\n deadline = monotonic() + timeout\n while monotonic() < deadline:\n self._refresh_state()\n if self._state in target_states:\n return True\n sleep(self.ACTION_POLL_INTERVAL_SECONDS)\n self._refresh_state()\n return self._state in target_states\n\n def _action_detail(self, message: str, *, timed_out: bool) -> dict[str, object]:\n self._refresh_state()\n return {\n \"message\": message,\n \"state\": self._state.value,\n \"timed_out\": timed_out,\n \"workers\": self.workers.snapshot(),\n }", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/core/runtime.py:RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.core.runtime", - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ] - }, - "diagnostics": { - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C0_SOURCE_CHUNKS": "exact_path_fetch", - "C4_SEMANTIC_ROLES": "exact_path_fetch", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C3_ENTRYPOINTS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 8, - "C4_SEMANTIC_ROLES": 8, - "C2_DEPENDENCY_GRAPH": 10, - "C3_ENTRYPOINTS": 10 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C4_SEMANTIC_ROLES": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Покажи поток выполнения при запуске RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C4_SEMANTIC_ROLES", - "query": "Покажи поток выполнения при запуске RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "Покажи поток выполнения при запуске RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 10, - "ranking_profile": "code" - }, - { - "layer": "C3_ENTRYPOINTS", - "query": "Покажи поток выполнения при запуске RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 10, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 1, - "candidates_after_filter": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 10, - "candidates_after_filter": 10 - }, - { - "layer": "C3_ENTRYPOINTS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 3, - "candidates_after_filter": 3 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "RuntimeManager", - "alternatives": [ - "RuntimeManager" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C4_SEMANTIC_ROLES", - "status": "hit", - "hit_count": 8, - "fail_reason": null - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 10, - "fail_reason": null - }, - { - "layer": "C3_ENTRYPOINTS", - "status": "hit", - "hit_count": 3, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "symbol_resolution": 0, - "retrieval_total": 200, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 58, - "C0_SOURCE_CHUNKS": 32, - "C4_SEMANTIC_ROLES": 28, - "C2_DEPENDENCY_GRAPH": 65, - "C3_ENTRYPOINTS": 15 - }, - "merge_rank": 27 - } - } - }, - { - "step": "llm_answer", - "input": { - "query": "Покажи поток выполнения при запуске RuntimeManager", - "rag_count": 23 - }, - "output": { - "llm_answer": "При запуске объекта `RuntimeManager` происходит следующее:\n\n1. В конструкторе класса вызывается инициализация свойств через явные аргументы:\n - `configuration`: объект конфигурации (`ConfigurationManager`), используется значение по умолчанию, если аргумент отсутствует.\n - `services`: контейнер сервисов (`ServiceContainer`), также с возможным значением по умолчанию.\n - `traces`, `health`, `logs`, `workers`, `control_plane`: аналогичные настройки для соответствующих служб и компонентов.\n \n2. Далее выполняется регистрация модулей приложения через метод `_register_core_services()`.\n\nТаким образом, основной поток начинается с вызова конструктора класса и продолжается регистрацией внутренних компонентов и служб приложения, необходимых для последующего управления жизненным циклом runtime-среды." - }, - "diagnostics": { - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 859, - "evidence_rows": 23, - "evidence_chars": 8302 - }, - "evidence_summary": [ - { - "layer": "C1_SYMBOL_CATALOG", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "count": 8, - "unique_paths": 7 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "count": 10, - "unique_paths": 2 - }, - { - "layer": "C3_ENTRYPOINTS", - "count": 3, - "unique_paths": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 1, - "unique_paths": 1 - } - ], - "prompt_template_id": "intent_code_qa_trace_flow_ru_v4", - "system_prompt_version": "v1" - }, - "timings_ms": { - "prompt_build": 0, - "llm_call": 1458 - } - } - } - ] - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_143856/full_chain_plba_code_subintents_v2_plba-v2-trace-flow-runtime-start.md b/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_143856/full_chain_plba_code_subintents_v2_plba-v2-trace-flow-runtime-start.md deleted file mode 100644 index 908d07b..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_143856/full_chain_plba_code_subintents_v2_plba-v2-trace-flow-runtime-start.md +++ /dev/null @@ -1,34 +0,0 @@ -# plba-v2-trace-flow-runtime-start - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_plba_code_subintents_v2.yaml -- runner: runtime -- mode: full_chain -- passed: True - -## Query -Покажи поток выполнения при запуске RuntimeManager - -## Actual -{ - "intent": "CODE_QA", - "sub_intent": "TRACE_FLOW", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 23, - "llm_answer": "При запуске объекта `RuntimeManager` происходит следующее:\n\n1. В конструкторе класса вызывается инициализация свойств через явные аргументы:\n - `configuration`: объект конфигурации (`ConfigurationManager`), используется значение по умолчанию, если аргумент отсутствует.\n - `services`: контейнер сервисов (`ServiceContainer`), также с возможным значением по умолчанию.\n - `traces`, `health`, `logs`, `workers`, `control_plane`: аналогичные настройки для соответствующих служб и компонентов.\n \n2. Далее выполняется регистрация модулей приложения через метод `_register_core_services()`.\n\nТаким образом, основной поток начинается с вызова конструктора класса и продолжается регистрацией внутренних компонентов и служб приложения, необходимых для последующего управления жизненным циклом runtime-среды.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "RuntimeManager" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] -} - -## Mismatches -- none \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_143856/summary.md b/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_143856/summary.md deleted file mode 100644 index ecbd43f..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_full_chain_subintents_v2/20260312_143856/summary.md +++ /dev/null @@ -1,80 +0,0 @@ -# pipeline_setup_v2 summary - -Passed: 18/18 - -| File | Case | Query | Expected sub-intent | Intent | Actual sub-intent | RAG layers | Pass | -|------|------|-------|---------------------|--------|-------------------|------------|------| -| full_chain_plba_code_subintents_v2.yaml | plba-v2-open-file-runtime | Открой файл src/app_runtime/core/runtime.py | OPEN_FILE | CODE_QA | OPEN_FILE | C0_SOURCE_CHUNKS:1 | ✓ | -| full_chain_plba_code_subintents_v2.yaml | plba-v2-open-file-public-api | Открой файл src/plba/__init__.py | OPEN_FILE | CODE_QA | OPEN_FILE | C0_SOURCE_CHUNKS:1 | ✓ | -| full_chain_plba_code_subintents_v2.yaml | plba-v2-explain-runtime-manager | Объясни как работает класс RuntimeManager | EXPLAIN | CODE_QA | EXPLAIN | C0_SOURCE_CHUNKS:1, C1_SYMBOL_CATALOG:1, C2_DEPENDENCY_GRAPH:6, C3_ENTRYPOINTS:3, C4_SEMANTIC_ROLES:1 | ✓ | -| full_chain_plba_code_subintents_v2.yaml | plba-v2-explain-trace-service | Объясни как работает класс TraceService | EXPLAIN | CODE_QA | EXPLAIN | C0_SOURCE_CHUNKS:3, C1_SYMBOL_CATALOG:1, C2_DEPENDENCY_GRAPH:6, C3_ENTRYPOINTS:3, C4_SEMANTIC_ROLES:1 | ✓ | -| full_chain_plba_code_subintents_v2.yaml | plba-v2-explain-create-runtime | Что делает функция create_runtime? | EXPLAIN | CODE_QA | EXPLAIN | C0_SOURCE_CHUNKS:1, C1_SYMBOL_CATALOG:1, C2_DEPENDENCY_GRAPH:6, C3_ENTRYPOINTS:3, C4_SEMANTIC_ROLES:1 | ✓ | -| full_chain_plba_code_subintents_v2.yaml | plba-v2-explain-local-http-channel | Почему в файле src/app_runtime/control/http_channel.py класс HttpControlChannel устроен так? | EXPLAIN_LOCAL | CODE_QA | EXPLAIN_LOCAL | C0_SOURCE_CHUNKS:1, C1_SYMBOL_CATALOG:1, C2_DEPENDENCY_GRAPH:4 | ✓ | -| full_chain_plba_code_subintents_v2.yaml | plba-v2-find-tests-runtime-manager | Где тесты для RuntimeManager? | FIND_TESTS | CODE_QA | FIND_TESTS | C0_SOURCE_CHUNKS:10, C2_DEPENDENCY_GRAPH:6 | ✓ | -| full_chain_plba_code_subintents_v2.yaml | plba-v2-find-tests-trace-service | Где тесты для TraceService? | FIND_TESTS | CODE_QA | FIND_TESTS | C0_SOURCE_CHUNKS:10, C2_DEPENDENCY_GRAPH:6 | ✓ | -| full_chain_plba_code_subintents_v2.yaml | plba-v2-find-tests-create-runtime | Где тесты для create_runtime? | FIND_TESTS | CODE_QA | FIND_TESTS | C0_SOURCE_CHUNKS:10, C2_DEPENDENCY_GRAPH:6 | ✓ | -| full_chain_plba_code_subintents_v2.yaml | plba-v2-find-tests-workflow-runtime-factory-negative | Где тесты для WorkflowRuntimeFactory? | FIND_TESTS | CODE_QA | FIND_TESTS | C0_SOURCE_CHUNKS:10, C2_DEPENDENCY_GRAPH:6 | ✓ | -| full_chain_plba_code_subintents_v2.yaml | plba-v2-find-entrypoints-control-plane | Найди точки входа HTTP control plane | FIND_ENTRYPOINTS | CODE_QA | FIND_ENTRYPOINTS | C0_SOURCE_CHUNKS:6, C3_ENTRYPOINTS:3 | ✓ | -| full_chain_plba_code_subintents_v2.yaml | plba-v2-find-entrypoints-health-endpoint | Где health endpoint? | FIND_ENTRYPOINTS | CODE_QA | FIND_ENTRYPOINTS | C0_SOURCE_CHUNKS:6, C3_ENTRYPOINTS:3 | ✓ | -| full_chain_plba_code_subintents_v2.yaml | plba-v2-trace-flow-runtime-start | Покажи поток выполнения при запуске RuntimeManager | TRACE_FLOW | CODE_QA | TRACE_FLOW | C0_SOURCE_CHUNKS:1, C1_SYMBOL_CATALOG:1, C2_DEPENDENCY_GRAPH:10, C3_ENTRYPOINTS:3, C4_SEMANTIC_ROLES:8 | ✓ | -| full_chain_plba_code_subintents_v2.yaml | plba-v2-trace-flow-health-endpoint | Покажи как проходит запрос /health в HttpControlAppFactory | TRACE_FLOW | CODE_QA | TRACE_FLOW | C0_SOURCE_CHUNKS:1, C1_SYMBOL_CATALOG:4, C2_DEPENDENCY_GRAPH:10, C3_ENTRYPOINTS:3, C4_SEMANTIC_ROLES:8 | ✓ | -| full_chain_plba_code_subintents_v2.yaml | plba-v2-architecture-runtime-manager | Какие компоненты участвуют в RuntimeManager? | ARCHITECTURE | CODE_QA | ARCHITECTURE | C0_SOURCE_CHUNKS:1, C1_SYMBOL_CATALOG:1, C2_DEPENDENCY_GRAPH:8, C3_ENTRYPOINTS:3, C4_SEMANTIC_ROLES:12 | ✓ | -| full_chain_plba_code_subintents_v2.yaml | plba-v2-architecture-control-plane | Какие компоненты участвуют в ControlPlaneService? | ARCHITECTURE | CODE_QA | ARCHITECTURE | C0_SOURCE_CHUNKS:1, C1_SYMBOL_CATALOG:1, C2_DEPENDENCY_GRAPH:8, C3_ENTRYPOINTS:3, C4_SEMANTIC_ROLES:12 | ✓ | -| full_chain_plba_code_subintents_v2.yaml | plba-v2-explain-nonexistent-symbol | Объясни класс RuntimeFactoryManager | EXPLAIN | CODE_QA | EXPLAIN | — | ✓ | -| full_chain_plba_code_subintents_v2.yaml | plba-v2-open-file-nonexistent | Открой файл src/app_runtime/core/missing_runtime.py | OPEN_FILE | CODE_QA | OPEN_FILE | — | ✓ | - -## LLM Answers -- **plba-v2-open-file-runtime** - Query: Открой файл src/app_runtime/core/runtime.py - > В файле src/app\_runtime/core/runtime.py виден класс RuntimeManager с несколькими атрибутами и методами. В конструкторе инициализируются конфигурация, сервисы, службы трассировки, здоровья, логирования и супервайзеры рабочих процессов. Также присутствуют константы для тайм\-аутов действий и интервала опроса. -- **plba-v2-open-file-public-api** - Query: Открой файл src/plba/__init__.py - > В файле src/plba/\_\_init\_\_.py видны следующие импорты и объявления: Импорты: \- plba.bootstrap.create\_runtime \- plba.config.ConfigFileLoader, FileConfigProvider \- plba.control.ControlActionSet, ControlChannel, ControlPlaneService, HttpControlChannel \- plba.contracts.ApplicationModule, ConfigProvider, HealthContributor, TraceContext, TraceContextRecord, TraceLogMessage, TraceTransport, Worker, WorkerHealth, WorkerStatus \- plba.core.ConfigurationManager, RuntimeManager, ServiceContainer \- plba.health.HealthRegistry \- plba.logging.LogManager \- plba.queue.InMemoryTaskQueue \- plba.tracing.MySqlTraceTransport, NoOpTraceTransport, TraceService \- plba.workflow.StepResult, WorkflowContext, WorkflowDefinition, WorkflowEngine, WorkflowEngineHooks, WorkflowNode, WorkflowRuntimeFactory, WorkflowStep \- plba.workers.WorkerSupervisor Объявления: \- \_\_all\_\_ содержит список экспортирован… -- **plba-v2-explain-runtime-manager** - Query: Объясни как работает класс RuntimeManager - > Класс \`RuntimeManager\` является менеджером, ответственным за координацию и управление различными компонентами приложения в определённый жизненный цикл. Ключевые особенности класса: 1. Инициализация: \- Конструктор принимает несколько необязательных аргументов \(\`configuration\`, \`services\`, \`traces\`, \`health\`, \`logs\`, \`workers\`, \`control\_plane\`\), которые по умолчанию инициализируются пустыми значениями соответствующих классов. 2. Атрибуты состояния: \- Имеет атрибуты \`\_started\`, \`\_state\`, \`\_core\_registered\`, \`\_workers\_registered\`, используемые для отслеживания текущего состояния системы и этапов её запуска. 3. Регистрация сервисов: \- Метод \`\_register\_core\_services\(\)\` регистрирует основные сервисы, необходимые для выполнения основных функций приложения. 4. Методы регистрации модулей: \- Методы вроде \`register\_module\(module\)\` позволяют зарегистрировать дополнительные модули… -- **plba-v2-explain-trace-service** - Query: Объясни как работает класс TraceService - > Класс \`TraceService\` в файле \`src/app\_runtime/tracing/service.py\` является компонентом, ответственным за управление контекстами трассировки и взаимодействие с транспортом для записи данных о трассировке. Ключевые аспекты класса: 1. Инициализация \(\`\_\_init\_\_\(\)\`\): \- Конструктор принимает два параметра: транспорт для записи трассировочных данных \(\`transport\`\) и хранилище контекста трассировки \(\`store\`\). \- По умолчанию используются заглушка транспорта \(\`NoOpTraceTransport\(\)\`\) и хранилище по умолчанию \(\`TraceContextStore\(\)\`\). \- Создаётся объект записи записей трассировки через \`TraceRecordWriter\`. 2. Создание контекста трассировки \(\`create\_context\(\)\`\): \- Метод создаёт новый контекст трассировки, используя UUID для уникального идентификатора трассировки. \- Записывает контекст в хранилище и отправляет запись в транспорт через метод записи контекста \(\`write\_context\(\)\`\). \- Воз… -- **plba-v2-explain-create-runtime** - Query: Что делает функция create_runtime? - > Функция \`create\_runtime\` в модуле \`src/plba/bootstrap.py\` отвечает за инициализацию и настройку основного runtime\-сервиса приложения. Она принимает следующие параметры: \- \`module\`: объект типа \`ApplicationModule\`, необходимый для регистрации в runtime; \- дополнительные необязательные параметры включают путь к конфигурационному файлу \(\`config\_path\`\), флаг включения HTTP\-контроля \(\`enable\_http\_control\`\) и настройки для HTTP\-интерфейса управления. Основные действия функции: 1. Создаёт экземпляр класса \`RuntimeManager\`. 2. При наличии пути к конфигурационному файлу добавляет файл конфигурации в runtime через метод \`add\_config\_file\`. 3. Если включён HTTP\-контроль, регистрирует HTTP\-канал управления через класс \`HttpControlChannel\`. 4. Регистрирует переданный модуль приложения через метод \`register\_module\`. 5. Возвращает созданный runtime\-менеджер. На основании представлен… -- **plba-v2-explain-local-http-channel** - Query: Почему в файле src/app_runtime/control/http_channel.py класс HttpControlChannel устроен так? - > Класс \`HttpControlChannel\` реализует механизм управления HTTP каналом для взаимодействия с внешними клиентами или сервисами через протокол HTTP. Его основная задача — обеспечивать старт и останов канала приема запросов, а также обработку двух типов ответов: 1. Health check \(\`\_health\_response\`\) – возвращает статус системы \(здорово ли она функционирует\). Проверяет наличие настроенных действий контроля и возвращает состояние \(«здорова» или «нездорова»\) вместе с дополнительной информацией. Входные данные: \- нет явных входных данных, кроме конфигурации каналов и настроенных действий; \- выходные данные: словарь состояния и детализированного сообщения. 2. Обработка пользовательских действий \(\`\_action\_response\`\) – отвечает за выполнение конкретного действия, указанного клиентом \(например, изменение настроек, перезапуск сервиса\). Входные данные: \- строка с именем действия \(\`a… -- **plba-v2-find-tests-runtime-manager** - Query: Где тесты для RuntimeManager? - > Прямые тесты для RuntimeManager находятся в следующих файлах: 1. tests/test\_runtime.py: \- test\_runtime\_graceful\_stop\_waits\_until\_worker\_finishes — проверяет корректную остановку RuntimeManager после завершения работы модуля. \- test\_runtime\_runs\_worker\_routine\_and\_exposes\_status — проверяет запуск рутины модуля и отображение статуса RuntimeManager. Также косвенно связан тест: 2. tests/test\_business\_control\_actions.py: \- \_build\_runtime — использует RuntimeManager при построении бизнес\-контроля. \- test\_worker\_wakes\_up\_with\_configured\_interval — применяет RuntimeManager для тестирования пробуждения рабочего процесса с заданной периодичностью. Эти тесты покрывают инициализацию, регистрацию модулей, управление состоянием и остановкой RuntimeManager. -- **plba-v2-find-tests-trace-service** - Query: Где тесты для TraceService? - > Прямых тестов конкретно для \`TraceService\` в данном контексте не обнаружено. -- **plba-v2-find-tests-create-runtime** - Query: Где тесты для create_runtime? - > Прямых тестов конкретно для функции \`create\_runtime\` в предоставленном контексте не обнаружено. -- **plba-v2-find-tests-workflow-runtime-factory-negative** - Query: Где тесты для WorkflowRuntimeFactory? - > Прямых тестов конкретно для \`WorkflowRuntimeFactory\` в предоставленном контексте не обнаружено. -- **plba-v2-find-entrypoints-control-plane** - Query: Найди точки входа HTTP control plane - > В системе обнаружены следующие подтвержденные точки входа HTTP control plane: 1. -- **plba-v2-find-entrypoints-health-endpoint** - Query: Где health endpoint? - > Подтверждённые HTTP routes для health\-endpoint: \- GET /health Объявлен в \`src/app\_runtime/control/http\_app.py\`, обслуживается методом \`http\_app.get\`. -- **plba-v2-trace-flow-runtime-start** - Query: Покажи поток выполнения при запуске RuntimeManager - > При запуске объекта \`RuntimeManager\` происходит следующее: 1. В конструкторе класса вызывается инициализация свойств через явные аргументы: \- \`configuration\`: объект конфигурации \(\`ConfigurationManager\`\), используется значение по умолчанию, если аргумент отсутствует. \- \`services\`: контейнер сервисов \(\`ServiceContainer\`\), также с возможным значением по умолчанию. \- \`traces\`, \`health\`, \`logs\`, \`workers\`, \`control\_plane\`: аналогичные настройки для соответствующих служб и компонентов. 2. Далее выполняется регистрация модулей приложения через метод \`\_register\_core\_services\(\)\`. Таким образом, основной поток начинается с вызова конструктора класса и продолжается регистрацией внутренних компонентов и служб приложения, необходимых для последующего управления жизненным циклом runtime\-среды. -- **plba-v2-trace-flow-health-endpoint** - Query: Покажи как проходит запрос /health в HttpControlAppFactory - > Когда в HttpControlAppFactory обрабатывается запрос \`/health\`, выполняются следующие шаги: 1. Создается экземпляр FastAPI с названием "PLBA Control API". 2. Добавляется middleware для логирования времени обработки каждого запроса \(\`log\_api\_call\`\). 3. Обрабатывается GET\-запрос к \`/health\`. \- Вызывается провайдер здоровья \`health\_provider\`, который возвращает асинхронно объект типа \`HealthPayload\`. \- Проверяется статус здоровья \("ok" или иное\). В зависимости от статуса устанавливается соответствующий HTTP\-код ответа \(200 или 503\). \- Возвращается JSON\-ответ с содержимым \`HealthPayload\`. -- **plba-v2-architecture-runtime-manager** - Query: Какие компоненты участвуют в RuntimeManager? - > В подсистеме RuntimeManager участвуют следующие компоненты и устанавливаются явные связи между ними: 1. RuntimeManager — главный менеджер выполнения, создающий и запускающий рабочие потоки. \- Создаёт экземпляр конфигурации \(\`configuration\`\). \- Вызывает метод \`start\`, инициирующий выполнение основной логики. 2. ControlPlaneService — сервис управления каналами и рабочими потоками. \- Контролирует каналы передачи данных \(\`\_channels\`\) и инициализирует асинхронную обработку \(\`\_start\_async\`\). Эти компоненты связаны следующим образом: \- RuntimeManager управляет созданием экземпляра Configuration и вызовом метода start для запуска процессов. \- ControlPlaneService отвечает за организацию каналов обмена данными и старт задач с использованием асинхронных механизмов. Границы ответственности: \- RuntimeManager выполняет диспетчеризацию и координацию рабочих потоков на уровне runtim… -- **plba-v2-architecture-control-plane** - Query: Какие компоненты участвуют в ControlPlaneService? - > В подсистеме ControlPlaneService можно выделить следующие компоненты и связи между ними на основе доступных контекстных слоев: Компоненты и связи: 1. ControlPlaneService \- Создаёт: \`ControlPlaneService\` инстанцируется при инициализации приложения \(\`app.post\`\). \- Вызывает: метод \`\_channels\` для регистрации каналов обработки данных, а также асинхронно запускает начальные действия \(\`\_start\_async\`\). \- Читает и записывает состояние атрибутов сервиса. 2. ControlActionSet \- Используется внутри \`ControlPlaneService\`, роль модели указывается как "default". Границы ответственности: Граница ответственности явно видна в коде следующим образом: \- Сервис участвует в обработке данных, разделяя их на отдельные потоки \(\`dataflow slices\`\), что подтверждается методами и полями класса. \- Регистрация каналов и управление ими выполняется непосредственно через инициализацию объекта сервиса… -- **plba-v2-explain-nonexistent-symbol** - Query: Объясни класс RuntimeFactoryManager - > Сущность RuntimeFactoryManager не найдена в доступном коде. Близкие совпадения: ControlChannel, ControlActionSet. -- **plba-v2-open-file-nonexistent** - Query: Открой файл src/app_runtime/core/missing_runtime.py - > Файл src/app\_runtime/core/missing\_runtime.py не найден. \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_router_only/20260312_084200/router_only_plba_code_retrieval_plba-explain-http-control-channel.json b/tests/pipeline_setup_v2/test_results/plba_router_only/20260312_084200/router_only_plba_code_retrieval_plba-explain-http-control-channel.json deleted file mode 100644 index 8fb2a41..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_router_only/20260312_084200/router_only_plba_code_retrieval_plba-explain-http-control-channel.json +++ /dev/null @@ -1,221 +0,0 @@ -{ - "case_id": "plba-explain-http-control-channel", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/router_only_plba_code_retrieval.yaml", - "runner": "runtime", - "mode": "router_only", - "actual": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 0, - "llm_answer": "", - "answer_mode": "partial", - "path_scope": [], - "symbol_candidates": [ - "HttpControlChannel" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "passed": true, - "mismatches": [], - "details": { - "case_id": "plba-explain-http-control-channel", - "text": "Объясни класс HttpControlChannel", - "mode": "router_only", - "run_started_at": "2026-03-12T08:42:00", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Объясни класс HttpControlChannel", - "symbol_resolution": { - "status": "pending", - "resolved_symbol": null, - "alternatives": [ - "HttpControlChannel" - ], - "confidence": 0.0 - }, - "rag_count": 0, - "rag_rows": [], - "llm_answer": null, - "summary": { - "router": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "confidence": null - }, - "retrieval": { - "profile": "code", - "layers_hit": [], - "evidence_sufficient": false - }, - "llm": { - "answer_status": "partial", - "groundedness": "not_applicable" - } - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "HttpControlChannel" - ], - "keyword_hints": [ - "HttpControlChannel" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "execution": { - "executed_layers": [], - "retrieval_mode_by_layer": {}, - "top_k_by_layer": {}, - "filters_by_layer": {}, - "repo_scope": { - "repo_id": null, - "workspace_id": null - } - }, - "retrieval": null, - "constraint_violations": [], - "timings_ms": { - "router": 0, - "symbol_resolution": 0, - "retrieval_total": 0, - "retrieval_by_layer": {}, - "merge_rank": 0, - "prompt_build": 0, - "llm_call": 0 - }, - "prompt": null, - "router": { - "conversation_mode": "START", - "keyword_hints": [ - "HttpControlChannel" - ], - "path_scope": [] - }, - "llm": { - "used_evidence_count": 0, - "missing_evidence_reason": null - } - }, - "run_info": { - "case_id": "plba-explain-http-control-channel", - "mode": "router_only", - "run_started_at": "2026-03-12T08:42:00", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - }, - "input_request": { - "text": "Объясни класс HttpControlChannel", - "normalized_query": "Объясни класс HttpControlChannel" - }, - "steps": [ - { - "step": "intent_router", - "input": { - "query": "Объясни класс HttpControlChannel" - }, - "output": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Объясни класс HttpControlChannel" - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "HttpControlChannel" - ], - "keyword_hints": [ - "HttpControlChannel" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "timings_ms": { - "router": 0 - } - } - } - ] - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_router_only/20260312_084200/router_only_plba_code_retrieval_plba-explain-http-control-channel.md b/tests/pipeline_setup_v2/test_results/plba_router_only/20260312_084200/router_only_plba_code_retrieval_plba-explain-http-control-channel.md deleted file mode 100644 index ae60689..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_router_only/20260312_084200/router_only_plba_code_retrieval_plba-explain-http-control-channel.md +++ /dev/null @@ -1,34 +0,0 @@ -# plba-explain-http-control-channel - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/router_only_plba_code_retrieval.yaml -- runner: runtime -- mode: router_only -- passed: True - -## Query -Объясни класс HttpControlChannel - -## Actual -{ - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 0, - "llm_answer": "", - "answer_mode": "partial", - "path_scope": [], - "symbol_candidates": [ - "HttpControlChannel" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] -} - -## Mismatches -- none \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_router_only/20260312_084200/router_only_plba_code_retrieval_plba-explain-runtime-manager.json b/tests/pipeline_setup_v2/test_results/plba_router_only/20260312_084200/router_only_plba_code_retrieval_plba-explain-runtime-manager.json deleted file mode 100644 index 3ba1905..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_router_only/20260312_084200/router_only_plba_code_retrieval_plba-explain-runtime-manager.json +++ /dev/null @@ -1,221 +0,0 @@ -{ - "case_id": "plba-explain-runtime-manager", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/router_only_plba_code_retrieval.yaml", - "runner": "runtime", - "mode": "router_only", - "actual": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 0, - "llm_answer": "", - "answer_mode": "partial", - "path_scope": [], - "symbol_candidates": [ - "RuntimeManager" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "passed": true, - "mismatches": [], - "details": { - "case_id": "plba-explain-runtime-manager", - "text": "Объясни как работает класс RuntimeManager", - "mode": "router_only", - "run_started_at": "2026-03-12T08:42:00", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Объясни как работает класс RuntimeManager", - "symbol_resolution": { - "status": "pending", - "resolved_symbol": null, - "alternatives": [ - "RuntimeManager" - ], - "confidence": 0.0 - }, - "rag_count": 0, - "rag_rows": [], - "llm_answer": null, - "summary": { - "router": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "confidence": null - }, - "retrieval": { - "profile": "code", - "layers_hit": [], - "evidence_sufficient": false - }, - "llm": { - "answer_status": "partial", - "groundedness": "not_applicable" - } - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "RuntimeManager" - ], - "keyword_hints": [ - "RuntimeManager" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "execution": { - "executed_layers": [], - "retrieval_mode_by_layer": {}, - "top_k_by_layer": {}, - "filters_by_layer": {}, - "repo_scope": { - "repo_id": null, - "workspace_id": null - } - }, - "retrieval": null, - "constraint_violations": [], - "timings_ms": { - "router": 0, - "symbol_resolution": 0, - "retrieval_total": 0, - "retrieval_by_layer": {}, - "merge_rank": 0, - "prompt_build": 0, - "llm_call": 0 - }, - "prompt": null, - "router": { - "conversation_mode": "START", - "keyword_hints": [ - "RuntimeManager" - ], - "path_scope": [] - }, - "llm": { - "used_evidence_count": 0, - "missing_evidence_reason": null - } - }, - "run_info": { - "case_id": "plba-explain-runtime-manager", - "mode": "router_only", - "run_started_at": "2026-03-12T08:42:00", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - }, - "input_request": { - "text": "Объясни как работает класс RuntimeManager", - "normalized_query": "Объясни как работает класс RuntimeManager" - }, - "steps": [ - { - "step": "intent_router", - "input": { - "query": "Объясни как работает класс RuntimeManager" - }, - "output": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Объясни как работает класс RuntimeManager" - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "RuntimeManager" - ], - "keyword_hints": [ - "RuntimeManager" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "timings_ms": { - "router": 0 - } - } - } - ] - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_router_only/20260312_084200/router_only_plba_code_retrieval_plba-explain-runtime-manager.md b/tests/pipeline_setup_v2/test_results/plba_router_only/20260312_084200/router_only_plba_code_retrieval_plba-explain-runtime-manager.md deleted file mode 100644 index 23226ea..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_router_only/20260312_084200/router_only_plba_code_retrieval_plba-explain-runtime-manager.md +++ /dev/null @@ -1,34 +0,0 @@ -# plba-explain-runtime-manager - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/router_only_plba_code_retrieval.yaml -- runner: runtime -- mode: router_only -- passed: True - -## Query -Объясни как работает класс RuntimeManager - -## Actual -{ - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 0, - "llm_answer": "", - "answer_mode": "partial", - "path_scope": [], - "symbol_candidates": [ - "RuntimeManager" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] -} - -## Mismatches -- none \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_router_only/20260312_084200/router_only_plba_code_retrieval_plba-explain-trace-service.json b/tests/pipeline_setup_v2/test_results/plba_router_only/20260312_084200/router_only_plba_code_retrieval_plba-explain-trace-service.json deleted file mode 100644 index 4900f8d..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_router_only/20260312_084200/router_only_plba_code_retrieval_plba-explain-trace-service.json +++ /dev/null @@ -1,221 +0,0 @@ -{ - "case_id": "plba-explain-trace-service", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/router_only_plba_code_retrieval.yaml", - "runner": "runtime", - "mode": "router_only", - "actual": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 0, - "llm_answer": "", - "answer_mode": "partial", - "path_scope": [], - "symbol_candidates": [ - "TraceService" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "passed": true, - "mismatches": [], - "details": { - "case_id": "plba-explain-trace-service", - "text": "Как работает TraceService?", - "mode": "router_only", - "run_started_at": "2026-03-12T08:42:00", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Как работает TraceService?", - "symbol_resolution": { - "status": "pending", - "resolved_symbol": null, - "alternatives": [ - "TraceService" - ], - "confidence": 0.0 - }, - "rag_count": 0, - "rag_rows": [], - "llm_answer": null, - "summary": { - "router": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "confidence": null - }, - "retrieval": { - "profile": "code", - "layers_hit": [], - "evidence_sufficient": false - }, - "llm": { - "answer_status": "partial", - "groundedness": "not_applicable" - } - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "TraceService" - ], - "keyword_hints": [ - "TraceService" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "execution": { - "executed_layers": [], - "retrieval_mode_by_layer": {}, - "top_k_by_layer": {}, - "filters_by_layer": {}, - "repo_scope": { - "repo_id": null, - "workspace_id": null - } - }, - "retrieval": null, - "constraint_violations": [], - "timings_ms": { - "router": 0, - "symbol_resolution": 0, - "retrieval_total": 0, - "retrieval_by_layer": {}, - "merge_rank": 0, - "prompt_build": 0, - "llm_call": 0 - }, - "prompt": null, - "router": { - "conversation_mode": "START", - "keyword_hints": [ - "TraceService" - ], - "path_scope": [] - }, - "llm": { - "used_evidence_count": 0, - "missing_evidence_reason": null - } - }, - "run_info": { - "case_id": "plba-explain-trace-service", - "mode": "router_only", - "run_started_at": "2026-03-12T08:42:00", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - }, - "input_request": { - "text": "Как работает TraceService?", - "normalized_query": "Как работает TraceService?" - }, - "steps": [ - { - "step": "intent_router", - "input": { - "query": "Как работает TraceService?" - }, - "output": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Как работает TraceService?" - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "TraceService" - ], - "keyword_hints": [ - "TraceService" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "timings_ms": { - "router": 0 - } - } - } - ] - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_router_only/20260312_084200/router_only_plba_code_retrieval_plba-explain-trace-service.md b/tests/pipeline_setup_v2/test_results/plba_router_only/20260312_084200/router_only_plba_code_retrieval_plba-explain-trace-service.md deleted file mode 100644 index 4004971..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_router_only/20260312_084200/router_only_plba_code_retrieval_plba-explain-trace-service.md +++ /dev/null @@ -1,34 +0,0 @@ -# plba-explain-trace-service - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/router_only_plba_code_retrieval.yaml -- runner: runtime -- mode: router_only -- passed: True - -## Query -Как работает TraceService? - -## Actual -{ - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 0, - "llm_answer": "", - "answer_mode": "partial", - "path_scope": [], - "symbol_candidates": [ - "TraceService" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] -} - -## Mismatches -- none \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_router_only/20260312_084200/router_only_plba_code_retrieval_plba-find-entrypoints-bootstrap.json b/tests/pipeline_setup_v2/test_results/plba_router_only/20260312_084200/router_only_plba_code_retrieval_plba-find-entrypoints-bootstrap.json deleted file mode 100644 index dc8821e..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_router_only/20260312_084200/router_only_plba_code_retrieval_plba-find-entrypoints-bootstrap.json +++ /dev/null @@ -1,222 +0,0 @@ -{ - "case_id": "plba-find-entrypoints-bootstrap", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/router_only_plba_code_retrieval.yaml", - "runner": "runtime", - "mode": "router_only", - "actual": { - "intent": "PROJECT_MISC", - "sub_intent": "EXPLAIN", - "graph_id": "ProjectMiscGraph", - "conversation_mode": "START", - "rag_count": 0, - "llm_answer": "", - "answer_mode": "partial", - "path_scope": [], - "symbol_candidates": [ - "create_runtime" - ], - "layers": [ - "D1_MODULE_CATALOG", - "D3_SECTION_INDEX", - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS" - ] - }, - "passed": false, - "mismatches": [ - "intent: expected CODE_QA, got PROJECT_MISC", - "sub_intent: expected FIND_ENTRYPOINTS, got EXPLAIN", - "graph_id: expected CodeQAGraph, got ProjectMiscGraph" - ], - "details": { - "case_id": "plba-find-entrypoints-bootstrap", - "text": "Где находится create_runtime?", - "mode": "router_only", - "run_started_at": "2026-03-12T08:42:00", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "PROJECT_MISC", - "graph_id": "ProjectMiscGraph", - "conversation_mode": "START", - "query": "Где находится create_runtime?", - "symbol_resolution": { - "status": "pending", - "resolved_symbol": null, - "alternatives": [ - "create_runtime" - ], - "confidence": 0.0 - }, - "rag_count": 0, - "rag_rows": [], - "llm_answer": null, - "summary": { - "router": { - "intent": "PROJECT_MISC", - "sub_intent": "EXPLAIN", - "confidence": null - }, - "retrieval": { - "profile": "code", - "layers_hit": [], - "evidence_sufficient": false - }, - "llm": { - "answer_status": "partial", - "groundedness": "not_applicable" - } - }, - "diagnostics": { - "router_plan": { - "intent": "PROJECT_MISC", - "sub_intent": "EXPLAIN", - "graph_id": "ProjectMiscGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "D1_MODULE_CATALOG", - "D3_SECTION_INDEX", - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS" - ], - "symbol_kind_hint": "function", - "symbol_candidates": [ - "create_runtime" - ], - "keyword_hints": [ - "create_runtime" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "execution": { - "executed_layers": [], - "retrieval_mode_by_layer": {}, - "top_k_by_layer": {}, - "filters_by_layer": {}, - "repo_scope": { - "repo_id": null, - "workspace_id": null - } - }, - "retrieval": null, - "constraint_violations": [], - "timings_ms": { - "router": 0, - "symbol_resolution": 0, - "retrieval_total": 0, - "retrieval_by_layer": {}, - "merge_rank": 0, - "prompt_build": 0, - "llm_call": 0 - }, - "prompt": null, - "router": { - "conversation_mode": "START", - "keyword_hints": [ - "create_runtime" - ], - "path_scope": [] - }, - "llm": { - "used_evidence_count": 0, - "missing_evidence_reason": null - } - }, - "run_info": { - "case_id": "plba-find-entrypoints-bootstrap", - "mode": "router_only", - "run_started_at": "2026-03-12T08:42:00", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "PROJECT_MISC", - "graph_id": "ProjectMiscGraph", - "conversation_mode": "START" - }, - "input_request": { - "text": "Где находится create_runtime?", - "normalized_query": "Где находится create_runtime?" - }, - "steps": [ - { - "step": "intent_router", - "input": { - "query": "Где находится create_runtime?" - }, - "output": { - "intent": "PROJECT_MISC", - "graph_id": "ProjectMiscGraph", - "conversation_mode": "START", - "query": "Где находится create_runtime?" - }, - "diagnostics": { - "router_plan": { - "intent": "PROJECT_MISC", - "sub_intent": "EXPLAIN", - "graph_id": "ProjectMiscGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "D1_MODULE_CATALOG", - "D3_SECTION_INDEX", - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS" - ], - "symbol_kind_hint": "function", - "symbol_candidates": [ - "create_runtime" - ], - "keyword_hints": [ - "create_runtime" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "timings_ms": { - "router": 0 - } - } - } - ] - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_router_only/20260312_084200/router_only_plba_code_retrieval_plba-find-entrypoints-bootstrap.md b/tests/pipeline_setup_v2/test_results/plba_router_only/20260312_084200/router_only_plba_code_retrieval_plba-find-entrypoints-bootstrap.md deleted file mode 100644 index be4e0a9..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_router_only/20260312_084200/router_only_plba_code_retrieval_plba-find-entrypoints-bootstrap.md +++ /dev/null @@ -1,35 +0,0 @@ -# plba-find-entrypoints-bootstrap - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/router_only_plba_code_retrieval.yaml -- runner: runtime -- mode: router_only -- passed: False - -## Query -Где находится create_runtime? - -## Actual -{ - "intent": "PROJECT_MISC", - "sub_intent": "EXPLAIN", - "graph_id": "ProjectMiscGraph", - "conversation_mode": "START", - "rag_count": 0, - "llm_answer": "", - "answer_mode": "partial", - "path_scope": [], - "symbol_candidates": [ - "create_runtime" - ], - "layers": [ - "D1_MODULE_CATALOG", - "D3_SECTION_INDEX", - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS" - ] -} - -## Mismatches -- intent: expected CODE_QA, got PROJECT_MISC -- sub_intent: expected FIND_ENTRYPOINTS, got EXPLAIN -- graph_id: expected CodeQAGraph, got ProjectMiscGraph \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_router_only/20260312_084200/router_only_plba_code_retrieval_plba-find-entrypoints-create-runtime.json b/tests/pipeline_setup_v2/test_results/plba_router_only/20260312_084200/router_only_plba_code_retrieval_plba-find-entrypoints-create-runtime.json deleted file mode 100644 index d54b658..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_router_only/20260312_084200/router_only_plba_code_retrieval_plba-find-entrypoints-create-runtime.json +++ /dev/null @@ -1,221 +0,0 @@ -{ - "case_id": "plba-find-entrypoints-create-runtime", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/router_only_plba_code_retrieval.yaml", - "runner": "runtime", - "mode": "router_only", - "actual": { - "intent": "PROJECT_MISC", - "sub_intent": "FIND_ENTRYPOINTS", - "graph_id": "ProjectMiscGraph", - "conversation_mode": "START", - "rag_count": 0, - "llm_answer": "", - "answer_mode": "partial", - "path_scope": [], - "symbol_candidates": [ - "runtime" - ], - "layers": [ - "D1_MODULE_CATALOG", - "D3_SECTION_INDEX", - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS" - ] - }, - "passed": false, - "mismatches": [ - "intent: expected CODE_QA, got PROJECT_MISC", - "graph_id: expected CodeQAGraph, got ProjectMiscGraph" - ], - "details": { - "case_id": "plba-find-entrypoints-create-runtime", - "text": "Какие точки входа в runtime?", - "mode": "router_only", - "run_started_at": "2026-03-12T08:42:00", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "PROJECT_MISC", - "graph_id": "ProjectMiscGraph", - "conversation_mode": "START", - "query": "Какие точки входа в runtime?", - "symbol_resolution": { - "status": "pending", - "resolved_symbol": null, - "alternatives": [ - "runtime" - ], - "confidence": 0.0 - }, - "rag_count": 0, - "rag_rows": [], - "llm_answer": null, - "summary": { - "router": { - "intent": "PROJECT_MISC", - "sub_intent": "FIND_ENTRYPOINTS", - "confidence": null - }, - "retrieval": { - "profile": "code", - "layers_hit": [], - "evidence_sufficient": false - }, - "llm": { - "answer_status": "partial", - "groundedness": "not_applicable" - } - }, - "diagnostics": { - "router_plan": { - "intent": "PROJECT_MISC", - "sub_intent": "FIND_ENTRYPOINTS", - "graph_id": "ProjectMiscGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "D1_MODULE_CATALOG", - "D3_SECTION_INDEX", - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS" - ], - "symbol_kind_hint": "unknown", - "symbol_candidates": [ - "runtime" - ], - "keyword_hints": [ - "runtime" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "execution": { - "executed_layers": [], - "retrieval_mode_by_layer": {}, - "top_k_by_layer": {}, - "filters_by_layer": {}, - "repo_scope": { - "repo_id": null, - "workspace_id": null - } - }, - "retrieval": null, - "constraint_violations": [], - "timings_ms": { - "router": 0, - "symbol_resolution": 0, - "retrieval_total": 0, - "retrieval_by_layer": {}, - "merge_rank": 0, - "prompt_build": 0, - "llm_call": 0 - }, - "prompt": null, - "router": { - "conversation_mode": "START", - "keyword_hints": [ - "runtime" - ], - "path_scope": [] - }, - "llm": { - "used_evidence_count": 0, - "missing_evidence_reason": null - } - }, - "run_info": { - "case_id": "plba-find-entrypoints-create-runtime", - "mode": "router_only", - "run_started_at": "2026-03-12T08:42:00", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "PROJECT_MISC", - "graph_id": "ProjectMiscGraph", - "conversation_mode": "START" - }, - "input_request": { - "text": "Какие точки входа в runtime?", - "normalized_query": "Какие точки входа в runtime?" - }, - "steps": [ - { - "step": "intent_router", - "input": { - "query": "Какие точки входа в runtime?" - }, - "output": { - "intent": "PROJECT_MISC", - "graph_id": "ProjectMiscGraph", - "conversation_mode": "START", - "query": "Какие точки входа в runtime?" - }, - "diagnostics": { - "router_plan": { - "intent": "PROJECT_MISC", - "sub_intent": "FIND_ENTRYPOINTS", - "graph_id": "ProjectMiscGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "D1_MODULE_CATALOG", - "D3_SECTION_INDEX", - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS" - ], - "symbol_kind_hint": "unknown", - "symbol_candidates": [ - "runtime" - ], - "keyword_hints": [ - "runtime" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "timings_ms": { - "router": 0 - } - } - } - ] - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_router_only/20260312_084200/router_only_plba_code_retrieval_plba-find-entrypoints-create-runtime.md b/tests/pipeline_setup_v2/test_results/plba_router_only/20260312_084200/router_only_plba_code_retrieval_plba-find-entrypoints-create-runtime.md deleted file mode 100644 index eafb098..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_router_only/20260312_084200/router_only_plba_code_retrieval_plba-find-entrypoints-create-runtime.md +++ /dev/null @@ -1,34 +0,0 @@ -# plba-find-entrypoints-create-runtime - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/router_only_plba_code_retrieval.yaml -- runner: runtime -- mode: router_only -- passed: False - -## Query -Какие точки входа в runtime? - -## Actual -{ - "intent": "PROJECT_MISC", - "sub_intent": "FIND_ENTRYPOINTS", - "graph_id": "ProjectMiscGraph", - "conversation_mode": "START", - "rag_count": 0, - "llm_answer": "", - "answer_mode": "partial", - "path_scope": [], - "symbol_candidates": [ - "runtime" - ], - "layers": [ - "D1_MODULE_CATALOG", - "D3_SECTION_INDEX", - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS" - ] -} - -## Mismatches -- intent: expected CODE_QA, got PROJECT_MISC -- graph_id: expected CodeQAGraph, got ProjectMiscGraph \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_router_only/20260312_084200/router_only_plba_code_retrieval_plba-find-tests-http-control-channel.json b/tests/pipeline_setup_v2/test_results/plba_router_only/20260312_084200/router_only_plba_code_retrieval_plba-find-tests-http-control-channel.json deleted file mode 100644 index dd3fcea..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_router_only/20260312_084200/router_only_plba_code_retrieval_plba-find-tests-http-control-channel.json +++ /dev/null @@ -1,241 +0,0 @@ -{ - "case_id": "plba-find-tests-http-control-channel", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/router_only_plba_code_retrieval.yaml", - "runner": "runtime", - "mode": "router_only", - "actual": { - "intent": "CODE_QA", - "sub_intent": "FIND_TESTS", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 0, - "llm_answer": "", - "answer_mode": "partial", - "path_scope": [], - "symbol_candidates": [ - "HttpControlChannel" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ] - }, - "passed": true, - "mismatches": [], - "details": { - "case_id": "plba-find-tests-http-control-channel", - "text": "Найди тесты для HttpControlChannel", - "mode": "router_only", - "run_started_at": "2026-03-12T08:42:00", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Найди тесты для HttpControlChannel", - "symbol_resolution": { - "status": "pending", - "resolved_symbol": null, - "alternatives": [ - "HttpControlChannel" - ], - "confidence": 0.0 - }, - "rag_count": 0, - "rag_rows": [], - "llm_answer": null, - "summary": { - "router": { - "intent": "CODE_QA", - "sub_intent": "FIND_TESTS", - "confidence": null - }, - "retrieval": { - "profile": "code", - "layers_hit": [], - "evidence_sufficient": false - }, - "llm": { - "answer_status": "partial", - "groundedness": "not_applicable" - } - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "FIND_TESTS", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "HttpControlChannel" - ], - "keyword_hints": [ - "HttpControlChannel" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**", - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "test_file_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "test_symbol_patterns": [ - "test_http_control_channel", - "TestHttpControlChannel", - "HttpControlChannel" - ], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "execution": { - "executed_layers": [], - "retrieval_mode_by_layer": {}, - "top_k_by_layer": {}, - "filters_by_layer": {}, - "repo_scope": { - "repo_id": null, - "workspace_id": null - } - }, - "retrieval": null, - "constraint_violations": [], - "timings_ms": { - "router": 0, - "symbol_resolution": 0, - "retrieval_total": 0, - "retrieval_by_layer": {}, - "merge_rank": 0, - "prompt_build": 0, - "llm_call": 0 - }, - "prompt": null, - "router": { - "conversation_mode": "START", - "keyword_hints": [ - "HttpControlChannel" - ], - "path_scope": [] - }, - "llm": { - "used_evidence_count": 0, - "missing_evidence_reason": null - } - }, - "run_info": { - "case_id": "plba-find-tests-http-control-channel", - "mode": "router_only", - "run_started_at": "2026-03-12T08:42:00", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - }, - "input_request": { - "text": "Найди тесты для HttpControlChannel", - "normalized_query": "Найди тесты для HttpControlChannel" - }, - "steps": [ - { - "step": "intent_router", - "input": { - "query": "Найди тесты для HttpControlChannel" - }, - "output": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Найди тесты для HttpControlChannel" - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "FIND_TESTS", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "HttpControlChannel" - ], - "keyword_hints": [ - "HttpControlChannel" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**", - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "test_file_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "test_symbol_patterns": [ - "test_http_control_channel", - "TestHttpControlChannel", - "HttpControlChannel" - ], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "timings_ms": { - "router": 0 - } - } - } - ] - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_router_only/20260312_084200/router_only_plba_code_retrieval_plba-find-tests-http-control-channel.md b/tests/pipeline_setup_v2/test_results/plba_router_only/20260312_084200/router_only_plba_code_retrieval_plba-find-tests-http-control-channel.md deleted file mode 100644 index 6408e6d..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_router_only/20260312_084200/router_only_plba_code_retrieval_plba-find-tests-http-control-channel.md +++ /dev/null @@ -1,32 +0,0 @@ -# plba-find-tests-http-control-channel - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/router_only_plba_code_retrieval.yaml -- runner: runtime -- mode: router_only -- passed: True - -## Query -Найди тесты для HttpControlChannel - -## Actual -{ - "intent": "CODE_QA", - "sub_intent": "FIND_TESTS", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 0, - "llm_answer": "", - "answer_mode": "partial", - "path_scope": [], - "symbol_candidates": [ - "HttpControlChannel" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ] -} - -## Mismatches -- none \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_router_only/20260312_084200/router_only_plba_code_retrieval_plba-find-tests-runtime-manager.json b/tests/pipeline_setup_v2/test_results/plba_router_only/20260312_084200/router_only_plba_code_retrieval_plba-find-tests-runtime-manager.json deleted file mode 100644 index 98cf4f7..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_router_only/20260312_084200/router_only_plba_code_retrieval_plba-find-tests-runtime-manager.json +++ /dev/null @@ -1,241 +0,0 @@ -{ - "case_id": "plba-find-tests-runtime-manager", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/router_only_plba_code_retrieval.yaml", - "runner": "runtime", - "mode": "router_only", - "actual": { - "intent": "CODE_QA", - "sub_intent": "FIND_TESTS", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 0, - "llm_answer": "", - "answer_mode": "partial", - "path_scope": [], - "symbol_candidates": [ - "RuntimeManager" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ] - }, - "passed": true, - "mismatches": [], - "details": { - "case_id": "plba-find-tests-runtime-manager", - "text": "Где тесты для RuntimeManager?", - "mode": "router_only", - "run_started_at": "2026-03-12T08:42:00", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Где тесты для RuntimeManager?", - "symbol_resolution": { - "status": "pending", - "resolved_symbol": null, - "alternatives": [ - "RuntimeManager" - ], - "confidence": 0.0 - }, - "rag_count": 0, - "rag_rows": [], - "llm_answer": null, - "summary": { - "router": { - "intent": "CODE_QA", - "sub_intent": "FIND_TESTS", - "confidence": null - }, - "retrieval": { - "profile": "code", - "layers_hit": [], - "evidence_sufficient": false - }, - "llm": { - "answer_status": "partial", - "groundedness": "not_applicable" - } - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "FIND_TESTS", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "RuntimeManager" - ], - "keyword_hints": [ - "RuntimeManager" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**", - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "test_file_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "test_symbol_patterns": [ - "test_runtime_manager", - "TestRuntimeManager", - "RuntimeManager" - ], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "execution": { - "executed_layers": [], - "retrieval_mode_by_layer": {}, - "top_k_by_layer": {}, - "filters_by_layer": {}, - "repo_scope": { - "repo_id": null, - "workspace_id": null - } - }, - "retrieval": null, - "constraint_violations": [], - "timings_ms": { - "router": 0, - "symbol_resolution": 0, - "retrieval_total": 0, - "retrieval_by_layer": {}, - "merge_rank": 0, - "prompt_build": 0, - "llm_call": 0 - }, - "prompt": null, - "router": { - "conversation_mode": "START", - "keyword_hints": [ - "RuntimeManager" - ], - "path_scope": [] - }, - "llm": { - "used_evidence_count": 0, - "missing_evidence_reason": null - } - }, - "run_info": { - "case_id": "plba-find-tests-runtime-manager", - "mode": "router_only", - "run_started_at": "2026-03-12T08:42:00", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - }, - "input_request": { - "text": "Где тесты для RuntimeManager?", - "normalized_query": "Где тесты для RuntimeManager?" - }, - "steps": [ - { - "step": "intent_router", - "input": { - "query": "Где тесты для RuntimeManager?" - }, - "output": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Где тесты для RuntimeManager?" - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "FIND_TESTS", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "RuntimeManager" - ], - "keyword_hints": [ - "RuntimeManager" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**", - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "test_file_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "test_symbol_patterns": [ - "test_runtime_manager", - "TestRuntimeManager", - "RuntimeManager" - ], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "timings_ms": { - "router": 0 - } - } - } - ] - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_router_only/20260312_084200/router_only_plba_code_retrieval_plba-find-tests-runtime-manager.md b/tests/pipeline_setup_v2/test_results/plba_router_only/20260312_084200/router_only_plba_code_retrieval_plba-find-tests-runtime-manager.md deleted file mode 100644 index efd5f2d..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_router_only/20260312_084200/router_only_plba_code_retrieval_plba-find-tests-runtime-manager.md +++ /dev/null @@ -1,32 +0,0 @@ -# plba-find-tests-runtime-manager - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/router_only_plba_code_retrieval.yaml -- runner: runtime -- mode: router_only -- passed: True - -## Query -Где тесты для RuntimeManager? - -## Actual -{ - "intent": "CODE_QA", - "sub_intent": "FIND_TESTS", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 0, - "llm_answer": "", - "answer_mode": "partial", - "path_scope": [], - "symbol_candidates": [ - "RuntimeManager" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ] -} - -## Mismatches -- none \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_router_only/20260312_084200/router_only_plba_code_retrieval_plba-general-qa-control-plane.json b/tests/pipeline_setup_v2/test_results/plba_router_only/20260312_084200/router_only_plba_code_retrieval_plba-general-qa-control-plane.json deleted file mode 100644 index 17ca479..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_router_only/20260312_084200/router_only_plba_code_retrieval_plba-general-qa-control-plane.json +++ /dev/null @@ -1,228 +0,0 @@ -{ - "case_id": "plba-general-qa-control-plane", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/router_only_plba_code_retrieval.yaml", - "runner": "runtime", - "mode": "router_only", - "actual": { - "intent": "PROJECT_MISC", - "sub_intent": "EXPLAIN", - "graph_id": "ProjectMiscGraph", - "conversation_mode": "START", - "rag_count": 0, - "llm_answer": "", - "answer_mode": "partial", - "path_scope": [], - "symbol_candidates": [ - "control", - "plane" - ], - "layers": [ - "D1_MODULE_CATALOG", - "D3_SECTION_INDEX", - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS" - ] - }, - "passed": false, - "mismatches": [ - "intent: expected CODE_QA, got PROJECT_MISC", - "graph_id: expected CodeQAGraph, got ProjectMiscGraph" - ], - "details": { - "case_id": "plba-general-qa-control-plane", - "text": "Как в проекте устроен control plane?", - "mode": "router_only", - "run_started_at": "2026-03-12T08:42:00", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "PROJECT_MISC", - "graph_id": "ProjectMiscGraph", - "conversation_mode": "START", - "query": "Как в проекте устроен control plane?", - "symbol_resolution": { - "status": "pending", - "resolved_symbol": null, - "alternatives": [ - "control", - "plane" - ], - "confidence": 0.0 - }, - "rag_count": 0, - "rag_rows": [], - "llm_answer": null, - "summary": { - "router": { - "intent": "PROJECT_MISC", - "sub_intent": "EXPLAIN", - "confidence": null - }, - "retrieval": { - "profile": "code", - "layers_hit": [], - "evidence_sufficient": false - }, - "llm": { - "answer_status": "partial", - "groundedness": "not_applicable" - } - }, - "diagnostics": { - "router_plan": { - "intent": "PROJECT_MISC", - "sub_intent": "EXPLAIN", - "graph_id": "ProjectMiscGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "D1_MODULE_CATALOG", - "D3_SECTION_INDEX", - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS" - ], - "symbol_kind_hint": "unknown", - "symbol_candidates": [ - "control", - "plane" - ], - "keyword_hints": [ - "control", - "plane" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "execution": { - "executed_layers": [], - "retrieval_mode_by_layer": {}, - "top_k_by_layer": {}, - "filters_by_layer": {}, - "repo_scope": { - "repo_id": null, - "workspace_id": null - } - }, - "retrieval": null, - "constraint_violations": [], - "timings_ms": { - "router": 0, - "symbol_resolution": 0, - "retrieval_total": 0, - "retrieval_by_layer": {}, - "merge_rank": 0, - "prompt_build": 0, - "llm_call": 0 - }, - "prompt": null, - "router": { - "conversation_mode": "START", - "keyword_hints": [ - "control", - "plane" - ], - "path_scope": [] - }, - "llm": { - "used_evidence_count": 0, - "missing_evidence_reason": null - } - }, - "run_info": { - "case_id": "plba-general-qa-control-plane", - "mode": "router_only", - "run_started_at": "2026-03-12T08:42:00", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "PROJECT_MISC", - "graph_id": "ProjectMiscGraph", - "conversation_mode": "START" - }, - "input_request": { - "text": "Как в проекте устроен control plane?", - "normalized_query": "Как в проекте устроен control plane?" - }, - "steps": [ - { - "step": "intent_router", - "input": { - "query": "Как в проекте устроен control plane?" - }, - "output": { - "intent": "PROJECT_MISC", - "graph_id": "ProjectMiscGraph", - "conversation_mode": "START", - "query": "Как в проекте устроен control plane?" - }, - "diagnostics": { - "router_plan": { - "intent": "PROJECT_MISC", - "sub_intent": "EXPLAIN", - "graph_id": "ProjectMiscGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "D1_MODULE_CATALOG", - "D3_SECTION_INDEX", - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS" - ], - "symbol_kind_hint": "unknown", - "symbol_candidates": [ - "control", - "plane" - ], - "keyword_hints": [ - "control", - "plane" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "timings_ms": { - "router": 0 - } - } - } - ] - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_router_only/20260312_084200/router_only_plba_code_retrieval_plba-general-qa-control-plane.md b/tests/pipeline_setup_v2/test_results/plba_router_only/20260312_084200/router_only_plba_code_retrieval_plba-general-qa-control-plane.md deleted file mode 100644 index de8e7e2..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_router_only/20260312_084200/router_only_plba_code_retrieval_plba-general-qa-control-plane.md +++ /dev/null @@ -1,35 +0,0 @@ -# plba-general-qa-control-plane - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/router_only_plba_code_retrieval.yaml -- runner: runtime -- mode: router_only -- passed: False - -## Query -Как в проекте устроен control plane? - -## Actual -{ - "intent": "PROJECT_MISC", - "sub_intent": "EXPLAIN", - "graph_id": "ProjectMiscGraph", - "conversation_mode": "START", - "rag_count": 0, - "llm_answer": "", - "answer_mode": "partial", - "path_scope": [], - "symbol_candidates": [ - "control", - "plane" - ], - "layers": [ - "D1_MODULE_CATALOG", - "D3_SECTION_INDEX", - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS" - ] -} - -## Mismatches -- intent: expected CODE_QA, got PROJECT_MISC -- graph_id: expected CodeQAGraph, got ProjectMiscGraph \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_router_only/20260312_084200/router_only_plba_code_retrieval_plba-general-qa-runtime.json b/tests/pipeline_setup_v2/test_results/plba_router_only/20260312_084200/router_only_plba_code_retrieval_plba-general-qa-runtime.json deleted file mode 100644 index 7e18b0f..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_router_only/20260312_084200/router_only_plba_code_retrieval_plba-general-qa-runtime.json +++ /dev/null @@ -1,221 +0,0 @@ -{ - "case_id": "plba-general-qa-runtime", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/router_only_plba_code_retrieval.yaml", - "runner": "runtime", - "mode": "router_only", - "actual": { - "intent": "PROJECT_MISC", - "sub_intent": "EXPLAIN", - "graph_id": "ProjectMiscGraph", - "conversation_mode": "START", - "rag_count": 0, - "llm_answer": "", - "answer_mode": "partial", - "path_scope": [], - "symbol_candidates": [ - "runtime" - ], - "layers": [ - "D1_MODULE_CATALOG", - "D3_SECTION_INDEX", - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS" - ] - }, - "passed": false, - "mismatches": [ - "intent: expected CODE_QA, got PROJECT_MISC", - "graph_id: expected CodeQAGraph, got ProjectMiscGraph" - ], - "details": { - "case_id": "plba-general-qa-runtime", - "text": "Как устроен runtime в проекте?", - "mode": "router_only", - "run_started_at": "2026-03-12T08:42:00", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "PROJECT_MISC", - "graph_id": "ProjectMiscGraph", - "conversation_mode": "START", - "query": "Как устроен runtime в проекте?", - "symbol_resolution": { - "status": "pending", - "resolved_symbol": null, - "alternatives": [ - "runtime" - ], - "confidence": 0.0 - }, - "rag_count": 0, - "rag_rows": [], - "llm_answer": null, - "summary": { - "router": { - "intent": "PROJECT_MISC", - "sub_intent": "EXPLAIN", - "confidence": null - }, - "retrieval": { - "profile": "code", - "layers_hit": [], - "evidence_sufficient": false - }, - "llm": { - "answer_status": "partial", - "groundedness": "not_applicable" - } - }, - "diagnostics": { - "router_plan": { - "intent": "PROJECT_MISC", - "sub_intent": "EXPLAIN", - "graph_id": "ProjectMiscGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "D1_MODULE_CATALOG", - "D3_SECTION_INDEX", - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS" - ], - "symbol_kind_hint": "unknown", - "symbol_candidates": [ - "runtime" - ], - "keyword_hints": [ - "runtime" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "execution": { - "executed_layers": [], - "retrieval_mode_by_layer": {}, - "top_k_by_layer": {}, - "filters_by_layer": {}, - "repo_scope": { - "repo_id": null, - "workspace_id": null - } - }, - "retrieval": null, - "constraint_violations": [], - "timings_ms": { - "router": 0, - "symbol_resolution": 0, - "retrieval_total": 0, - "retrieval_by_layer": {}, - "merge_rank": 0, - "prompt_build": 0, - "llm_call": 0 - }, - "prompt": null, - "router": { - "conversation_mode": "START", - "keyword_hints": [ - "runtime" - ], - "path_scope": [] - }, - "llm": { - "used_evidence_count": 0, - "missing_evidence_reason": null - } - }, - "run_info": { - "case_id": "plba-general-qa-runtime", - "mode": "router_only", - "run_started_at": "2026-03-12T08:42:00", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "PROJECT_MISC", - "graph_id": "ProjectMiscGraph", - "conversation_mode": "START" - }, - "input_request": { - "text": "Как устроен runtime в проекте?", - "normalized_query": "Как устроен runtime в проекте?" - }, - "steps": [ - { - "step": "intent_router", - "input": { - "query": "Как устроен runtime в проекте?" - }, - "output": { - "intent": "PROJECT_MISC", - "graph_id": "ProjectMiscGraph", - "conversation_mode": "START", - "query": "Как устроен runtime в проекте?" - }, - "diagnostics": { - "router_plan": { - "intent": "PROJECT_MISC", - "sub_intent": "EXPLAIN", - "graph_id": "ProjectMiscGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "D1_MODULE_CATALOG", - "D3_SECTION_INDEX", - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS" - ], - "symbol_kind_hint": "unknown", - "symbol_candidates": [ - "runtime" - ], - "keyword_hints": [ - "runtime" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "timings_ms": { - "router": 0 - } - } - } - ] - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_router_only/20260312_084200/router_only_plba_code_retrieval_plba-general-qa-runtime.md b/tests/pipeline_setup_v2/test_results/plba_router_only/20260312_084200/router_only_plba_code_retrieval_plba-general-qa-runtime.md deleted file mode 100644 index bcad0d8..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_router_only/20260312_084200/router_only_plba_code_retrieval_plba-general-qa-runtime.md +++ /dev/null @@ -1,34 +0,0 @@ -# plba-general-qa-runtime - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/router_only_plba_code_retrieval.yaml -- runner: runtime -- mode: router_only -- passed: False - -## Query -Как устроен runtime в проекте? - -## Actual -{ - "intent": "PROJECT_MISC", - "sub_intent": "EXPLAIN", - "graph_id": "ProjectMiscGraph", - "conversation_mode": "START", - "rag_count": 0, - "llm_answer": "", - "answer_mode": "partial", - "path_scope": [], - "symbol_candidates": [ - "runtime" - ], - "layers": [ - "D1_MODULE_CATALOG", - "D3_SECTION_INDEX", - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS" - ] -} - -## Mismatches -- intent: expected CODE_QA, got PROJECT_MISC -- graph_id: expected CodeQAGraph, got ProjectMiscGraph \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_router_only/20260312_084200/router_only_plba_code_retrieval_plba-open-http-control-channel-file.json b/tests/pipeline_setup_v2/test_results/plba_router_only/20260312_084200/router_only_plba_code_retrieval_plba-open-http-control-channel-file.json deleted file mode 100644 index 813adf2..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_router_only/20260312_084200/router_only_plba_code_retrieval_plba-open-http-control-channel-file.json +++ /dev/null @@ -1,207 +0,0 @@ -{ - "case_id": "plba-open-http-control-channel-file", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/router_only_plba_code_retrieval.yaml", - "runner": "runtime", - "mode": "router_only", - "actual": { - "intent": "CODE_QA", - "sub_intent": "OPEN_FILE", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 0, - "llm_answer": "", - "answer_mode": "partial", - "path_scope": [ - "src/app_runtime/control/http_channel.py" - ], - "symbol_candidates": [], - "layers": [ - "C0_SOURCE_CHUNKS" - ] - }, - "passed": true, - "mismatches": [], - "details": { - "case_id": "plba-open-http-control-channel-file", - "text": "Покажи файл src/app_runtime/control/http_channel.py", - "mode": "router_only", - "run_started_at": "2026-03-12T08:42:00", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Покажи файл src/app_runtime/control/http_channel.py", - "symbol_resolution": { - "status": "not_requested", - "resolved_symbol": null, - "alternatives": [], - "confidence": 0.0 - }, - "rag_count": 0, - "rag_rows": [], - "llm_answer": null, - "summary": { - "router": { - "intent": "CODE_QA", - "sub_intent": "OPEN_FILE", - "confidence": null - }, - "retrieval": { - "profile": "code", - "layers_hit": [], - "evidence_sufficient": false - }, - "llm": { - "answer_status": "partial", - "groundedness": "not_applicable" - } - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "OPEN_FILE", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C0_SOURCE_CHUNKS" - ], - "symbol_kind_hint": "unknown", - "symbol_candidates": [], - "keyword_hints": [], - "path_hints": [ - "src/app_runtime/control/http_channel.py" - ], - "path_scope": [ - "src/app_runtime/control/http_channel.py" - ], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/app_runtime/control/http_channel.py" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": false, - "max_distance": 2, - "top_k": 5 - } - } - }, - "execution": { - "executed_layers": [], - "retrieval_mode_by_layer": {}, - "top_k_by_layer": {}, - "filters_by_layer": {}, - "repo_scope": { - "repo_id": null, - "workspace_id": null - } - }, - "retrieval": null, - "constraint_violations": [], - "timings_ms": { - "router": 0, - "symbol_resolution": 0, - "retrieval_total": 0, - "retrieval_by_layer": {}, - "merge_rank": 0, - "prompt_build": 0, - "llm_call": 0 - }, - "prompt": null, - "router": { - "conversation_mode": "START", - "keyword_hints": [], - "path_scope": [ - "src/app_runtime/control/http_channel.py" - ] - }, - "llm": { - "used_evidence_count": 0, - "missing_evidence_reason": null - } - }, - "run_info": { - "case_id": "plba-open-http-control-channel-file", - "mode": "router_only", - "run_started_at": "2026-03-12T08:42:00", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - }, - "input_request": { - "text": "Покажи файл src/app_runtime/control/http_channel.py", - "normalized_query": "Покажи файл src/app_runtime/control/http_channel.py" - }, - "steps": [ - { - "step": "intent_router", - "input": { - "query": "Покажи файл src/app_runtime/control/http_channel.py" - }, - "output": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Покажи файл src/app_runtime/control/http_channel.py" - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "OPEN_FILE", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C0_SOURCE_CHUNKS" - ], - "symbol_kind_hint": "unknown", - "symbol_candidates": [], - "keyword_hints": [], - "path_hints": [ - "src/app_runtime/control/http_channel.py" - ], - "path_scope": [ - "src/app_runtime/control/http_channel.py" - ], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/app_runtime/control/http_channel.py" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": false, - "max_distance": 2, - "top_k": 5 - } - } - }, - "timings_ms": { - "router": 0 - } - } - } - ] - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_router_only/20260312_084200/router_only_plba_code_retrieval_plba-open-http-control-channel-file.md b/tests/pipeline_setup_v2/test_results/plba_router_only/20260312_084200/router_only_plba_code_retrieval_plba-open-http-control-channel-file.md deleted file mode 100644 index 9295e3d..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_router_only/20260312_084200/router_only_plba_code_retrieval_plba-open-http-control-channel-file.md +++ /dev/null @@ -1,30 +0,0 @@ -# plba-open-http-control-channel-file - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/router_only_plba_code_retrieval.yaml -- runner: runtime -- mode: router_only -- passed: True - -## Query -Покажи файл src/app_runtime/control/http_channel.py - -## Actual -{ - "intent": "CODE_QA", - "sub_intent": "OPEN_FILE", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 0, - "llm_answer": "", - "answer_mode": "partial", - "path_scope": [ - "src/app_runtime/control/http_channel.py" - ], - "symbol_candidates": [], - "layers": [ - "C0_SOURCE_CHUNKS" - ] -} - -## Mismatches -- none \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_router_only/20260312_084200/router_only_plba_code_retrieval_plba-open-runtime-manager-file.json b/tests/pipeline_setup_v2/test_results/plba_router_only/20260312_084200/router_only_plba_code_retrieval_plba-open-runtime-manager-file.json deleted file mode 100644 index b50a6b2..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_router_only/20260312_084200/router_only_plba_code_retrieval_plba-open-runtime-manager-file.json +++ /dev/null @@ -1,207 +0,0 @@ -{ - "case_id": "plba-open-runtime-manager-file", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/router_only_plba_code_retrieval.yaml", - "runner": "runtime", - "mode": "router_only", - "actual": { - "intent": "CODE_QA", - "sub_intent": "OPEN_FILE", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 0, - "llm_answer": "", - "answer_mode": "partial", - "path_scope": [ - "src/app_runtime/core/runtime.py" - ], - "symbol_candidates": [], - "layers": [ - "C0_SOURCE_CHUNKS" - ] - }, - "passed": true, - "mismatches": [], - "details": { - "case_id": "plba-open-runtime-manager-file", - "text": "Открой файл src/app_runtime/core/runtime.py", - "mode": "router_only", - "run_started_at": "2026-03-12T08:42:00", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Открой файл src/app_runtime/core/runtime.py", - "symbol_resolution": { - "status": "not_requested", - "resolved_symbol": null, - "alternatives": [], - "confidence": 0.0 - }, - "rag_count": 0, - "rag_rows": [], - "llm_answer": null, - "summary": { - "router": { - "intent": "CODE_QA", - "sub_intent": "OPEN_FILE", - "confidence": null - }, - "retrieval": { - "profile": "code", - "layers_hit": [], - "evidence_sufficient": false - }, - "llm": { - "answer_status": "partial", - "groundedness": "not_applicable" - } - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "OPEN_FILE", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C0_SOURCE_CHUNKS" - ], - "symbol_kind_hint": "unknown", - "symbol_candidates": [], - "keyword_hints": [], - "path_hints": [ - "src/app_runtime/core/runtime.py" - ], - "path_scope": [ - "src/app_runtime/core/runtime.py" - ], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/app_runtime/core/runtime.py" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": false, - "max_distance": 2, - "top_k": 5 - } - } - }, - "execution": { - "executed_layers": [], - "retrieval_mode_by_layer": {}, - "top_k_by_layer": {}, - "filters_by_layer": {}, - "repo_scope": { - "repo_id": null, - "workspace_id": null - } - }, - "retrieval": null, - "constraint_violations": [], - "timings_ms": { - "router": 1, - "symbol_resolution": 0, - "retrieval_total": 0, - "retrieval_by_layer": {}, - "merge_rank": 0, - "prompt_build": 0, - "llm_call": 0 - }, - "prompt": null, - "router": { - "conversation_mode": "START", - "keyword_hints": [], - "path_scope": [ - "src/app_runtime/core/runtime.py" - ] - }, - "llm": { - "used_evidence_count": 0, - "missing_evidence_reason": null - } - }, - "run_info": { - "case_id": "plba-open-runtime-manager-file", - "mode": "router_only", - "run_started_at": "2026-03-12T08:42:00", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - }, - "input_request": { - "text": "Открой файл src/app_runtime/core/runtime.py", - "normalized_query": "Открой файл src/app_runtime/core/runtime.py" - }, - "steps": [ - { - "step": "intent_router", - "input": { - "query": "Открой файл src/app_runtime/core/runtime.py" - }, - "output": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Открой файл src/app_runtime/core/runtime.py" - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "OPEN_FILE", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C0_SOURCE_CHUNKS" - ], - "symbol_kind_hint": "unknown", - "symbol_candidates": [], - "keyword_hints": [], - "path_hints": [ - "src/app_runtime/core/runtime.py" - ], - "path_scope": [ - "src/app_runtime/core/runtime.py" - ], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/app_runtime/core/runtime.py" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": false, - "max_distance": 2, - "top_k": 5 - } - } - }, - "timings_ms": { - "router": 1 - } - } - } - ] - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_router_only/20260312_084200/router_only_plba_code_retrieval_plba-open-runtime-manager-file.md b/tests/pipeline_setup_v2/test_results/plba_router_only/20260312_084200/router_only_plba_code_retrieval_plba-open-runtime-manager-file.md deleted file mode 100644 index 5c4114d..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_router_only/20260312_084200/router_only_plba_code_retrieval_plba-open-runtime-manager-file.md +++ /dev/null @@ -1,30 +0,0 @@ -# plba-open-runtime-manager-file - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/router_only_plba_code_retrieval.yaml -- runner: runtime -- mode: router_only -- passed: True - -## Query -Открой файл src/app_runtime/core/runtime.py - -## Actual -{ - "intent": "CODE_QA", - "sub_intent": "OPEN_FILE", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 0, - "llm_answer": "", - "answer_mode": "partial", - "path_scope": [ - "src/app_runtime/core/runtime.py" - ], - "symbol_candidates": [], - "layers": [ - "C0_SOURCE_CHUNKS" - ] -} - -## Mismatches -- none \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_router_only/20260312_084200/summary.md b/tests/pipeline_setup_v2/test_results/plba_router_only/20260312_084200/summary.md deleted file mode 100644 index 50ee39f..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_router_only/20260312_084200/summary.md +++ /dev/null @@ -1,23 +0,0 @@ -# pipeline_setup_v2 summary - -Passed: 7/11 - -| File | Case | Runner | Mode | Intent | Sub-intent | Pass | -|------|------|--------|------|--------|------------|------| -| router_only_plba_code_retrieval.yaml | plba-open-runtime-manager-file | runtime | router_only | CODE_QA | OPEN_FILE | ✓ | -| router_only_plba_code_retrieval.yaml | plba-open-http-control-channel-file | runtime | router_only | CODE_QA | OPEN_FILE | ✓ | -| router_only_plba_code_retrieval.yaml | plba-explain-runtime-manager | runtime | router_only | CODE_QA | EXPLAIN | ✓ | -| router_only_plba_code_retrieval.yaml | plba-explain-http-control-channel | runtime | router_only | CODE_QA | EXPLAIN | ✓ | -| router_only_plba_code_retrieval.yaml | plba-explain-trace-service | runtime | router_only | CODE_QA | EXPLAIN | ✓ | -| router_only_plba_code_retrieval.yaml | plba-find-tests-runtime-manager | runtime | router_only | CODE_QA | FIND_TESTS | ✓ | -| router_only_plba_code_retrieval.yaml | plba-find-tests-http-control-channel | runtime | router_only | CODE_QA | FIND_TESTS | ✓ | -| router_only_plba_code_retrieval.yaml | plba-find-entrypoints-create-runtime | runtime | router_only | PROJECT_MISC | FIND_ENTRYPOINTS | ✗ | -| router_only_plba_code_retrieval.yaml | plba-find-entrypoints-bootstrap | runtime | router_only | PROJECT_MISC | EXPLAIN | ✗ | -| router_only_plba_code_retrieval.yaml | plba-general-qa-runtime | runtime | router_only | PROJECT_MISC | EXPLAIN | ✗ | -| router_only_plba_code_retrieval.yaml | plba-general-qa-control-plane | runtime | router_only | PROJECT_MISC | EXPLAIN | ✗ | - -## Failures -- **plba-find-entrypoints-create-runtime**: intent: expected CODE_QA, got PROJECT_MISC; graph_id: expected CodeQAGraph, got ProjectMiscGraph -- **plba-find-entrypoints-bootstrap**: intent: expected CODE_QA, got PROJECT_MISC; sub_intent: expected FIND_ENTRYPOINTS, got EXPLAIN; graph_id: expected CodeQAGraph, got ProjectMiscGraph -- **plba-general-qa-runtime**: intent: expected CODE_QA, got PROJECT_MISC; graph_id: expected CodeQAGraph, got ProjectMiscGraph -- **plba-general-qa-control-plane**: intent: expected CODE_QA, got PROJECT_MISC; graph_id: expected CodeQAGraph, got ProjectMiscGraph \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_router_only/20260312_084313/router_only_plba_code_retrieval_plba-explain-http-control-channel.json b/tests/pipeline_setup_v2/test_results/plba_router_only/20260312_084313/router_only_plba_code_retrieval_plba-explain-http-control-channel.json deleted file mode 100644 index ffde555..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_router_only/20260312_084313/router_only_plba_code_retrieval_plba-explain-http-control-channel.json +++ /dev/null @@ -1,221 +0,0 @@ -{ - "case_id": "plba-explain-http-control-channel", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/router_only_plba_code_retrieval.yaml", - "runner": "runtime", - "mode": "router_only", - "actual": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 0, - "llm_answer": "", - "answer_mode": "partial", - "path_scope": [], - "symbol_candidates": [ - "HttpControlChannel" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "passed": true, - "mismatches": [], - "details": { - "case_id": "plba-explain-http-control-channel", - "text": "Объясни класс HttpControlChannel", - "mode": "router_only", - "run_started_at": "2026-03-12T08:43:13", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Объясни класс HttpControlChannel", - "symbol_resolution": { - "status": "pending", - "resolved_symbol": null, - "alternatives": [ - "HttpControlChannel" - ], - "confidence": 0.0 - }, - "rag_count": 0, - "rag_rows": [], - "llm_answer": null, - "summary": { - "router": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "confidence": null - }, - "retrieval": { - "profile": "code", - "layers_hit": [], - "evidence_sufficient": false - }, - "llm": { - "answer_status": "partial", - "groundedness": "not_applicable" - } - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "HttpControlChannel" - ], - "keyword_hints": [ - "HttpControlChannel" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "execution": { - "executed_layers": [], - "retrieval_mode_by_layer": {}, - "top_k_by_layer": {}, - "filters_by_layer": {}, - "repo_scope": { - "repo_id": null, - "workspace_id": null - } - }, - "retrieval": null, - "constraint_violations": [], - "timings_ms": { - "router": 0, - "symbol_resolution": 0, - "retrieval_total": 0, - "retrieval_by_layer": {}, - "merge_rank": 0, - "prompt_build": 0, - "llm_call": 0 - }, - "prompt": null, - "router": { - "conversation_mode": "START", - "keyword_hints": [ - "HttpControlChannel" - ], - "path_scope": [] - }, - "llm": { - "used_evidence_count": 0, - "missing_evidence_reason": null - } - }, - "run_info": { - "case_id": "plba-explain-http-control-channel", - "mode": "router_only", - "run_started_at": "2026-03-12T08:43:13", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - }, - "input_request": { - "text": "Объясни класс HttpControlChannel", - "normalized_query": "Объясни класс HttpControlChannel" - }, - "steps": [ - { - "step": "intent_router", - "input": { - "query": "Объясни класс HttpControlChannel" - }, - "output": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Объясни класс HttpControlChannel" - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "HttpControlChannel" - ], - "keyword_hints": [ - "HttpControlChannel" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "timings_ms": { - "router": 0 - } - } - } - ] - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_router_only/20260312_084313/router_only_plba_code_retrieval_plba-explain-http-control-channel.md b/tests/pipeline_setup_v2/test_results/plba_router_only/20260312_084313/router_only_plba_code_retrieval_plba-explain-http-control-channel.md deleted file mode 100644 index ae60689..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_router_only/20260312_084313/router_only_plba_code_retrieval_plba-explain-http-control-channel.md +++ /dev/null @@ -1,34 +0,0 @@ -# plba-explain-http-control-channel - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/router_only_plba_code_retrieval.yaml -- runner: runtime -- mode: router_only -- passed: True - -## Query -Объясни класс HttpControlChannel - -## Actual -{ - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 0, - "llm_answer": "", - "answer_mode": "partial", - "path_scope": [], - "symbol_candidates": [ - "HttpControlChannel" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] -} - -## Mismatches -- none \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_router_only/20260312_084313/router_only_plba_code_retrieval_plba-explain-runtime-manager.json b/tests/pipeline_setup_v2/test_results/plba_router_only/20260312_084313/router_only_plba_code_retrieval_plba-explain-runtime-manager.json deleted file mode 100644 index d49c0cb..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_router_only/20260312_084313/router_only_plba_code_retrieval_plba-explain-runtime-manager.json +++ /dev/null @@ -1,221 +0,0 @@ -{ - "case_id": "plba-explain-runtime-manager", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/router_only_plba_code_retrieval.yaml", - "runner": "runtime", - "mode": "router_only", - "actual": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 0, - "llm_answer": "", - "answer_mode": "partial", - "path_scope": [], - "symbol_candidates": [ - "RuntimeManager" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "passed": true, - "mismatches": [], - "details": { - "case_id": "plba-explain-runtime-manager", - "text": "Объясни как работает класс RuntimeManager", - "mode": "router_only", - "run_started_at": "2026-03-12T08:43:13", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Объясни как работает класс RuntimeManager", - "symbol_resolution": { - "status": "pending", - "resolved_symbol": null, - "alternatives": [ - "RuntimeManager" - ], - "confidence": 0.0 - }, - "rag_count": 0, - "rag_rows": [], - "llm_answer": null, - "summary": { - "router": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "confidence": null - }, - "retrieval": { - "profile": "code", - "layers_hit": [], - "evidence_sufficient": false - }, - "llm": { - "answer_status": "partial", - "groundedness": "not_applicable" - } - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "RuntimeManager" - ], - "keyword_hints": [ - "RuntimeManager" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "execution": { - "executed_layers": [], - "retrieval_mode_by_layer": {}, - "top_k_by_layer": {}, - "filters_by_layer": {}, - "repo_scope": { - "repo_id": null, - "workspace_id": null - } - }, - "retrieval": null, - "constraint_violations": [], - "timings_ms": { - "router": 0, - "symbol_resolution": 0, - "retrieval_total": 0, - "retrieval_by_layer": {}, - "merge_rank": 0, - "prompt_build": 0, - "llm_call": 0 - }, - "prompt": null, - "router": { - "conversation_mode": "START", - "keyword_hints": [ - "RuntimeManager" - ], - "path_scope": [] - }, - "llm": { - "used_evidence_count": 0, - "missing_evidence_reason": null - } - }, - "run_info": { - "case_id": "plba-explain-runtime-manager", - "mode": "router_only", - "run_started_at": "2026-03-12T08:43:13", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - }, - "input_request": { - "text": "Объясни как работает класс RuntimeManager", - "normalized_query": "Объясни как работает класс RuntimeManager" - }, - "steps": [ - { - "step": "intent_router", - "input": { - "query": "Объясни как работает класс RuntimeManager" - }, - "output": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Объясни как работает класс RuntimeManager" - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "RuntimeManager" - ], - "keyword_hints": [ - "RuntimeManager" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "timings_ms": { - "router": 0 - } - } - } - ] - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_router_only/20260312_084313/router_only_plba_code_retrieval_plba-explain-runtime-manager.md b/tests/pipeline_setup_v2/test_results/plba_router_only/20260312_084313/router_only_plba_code_retrieval_plba-explain-runtime-manager.md deleted file mode 100644 index 23226ea..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_router_only/20260312_084313/router_only_plba_code_retrieval_plba-explain-runtime-manager.md +++ /dev/null @@ -1,34 +0,0 @@ -# plba-explain-runtime-manager - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/router_only_plba_code_retrieval.yaml -- runner: runtime -- mode: router_only -- passed: True - -## Query -Объясни как работает класс RuntimeManager - -## Actual -{ - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 0, - "llm_answer": "", - "answer_mode": "partial", - "path_scope": [], - "symbol_candidates": [ - "RuntimeManager" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] -} - -## Mismatches -- none \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_router_only/20260312_084313/router_only_plba_code_retrieval_plba-explain-trace-service.json b/tests/pipeline_setup_v2/test_results/plba_router_only/20260312_084313/router_only_plba_code_retrieval_plba-explain-trace-service.json deleted file mode 100644 index 86a08a6..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_router_only/20260312_084313/router_only_plba_code_retrieval_plba-explain-trace-service.json +++ /dev/null @@ -1,221 +0,0 @@ -{ - "case_id": "plba-explain-trace-service", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/router_only_plba_code_retrieval.yaml", - "runner": "runtime", - "mode": "router_only", - "actual": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 0, - "llm_answer": "", - "answer_mode": "partial", - "path_scope": [], - "symbol_candidates": [ - "TraceService" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "passed": true, - "mismatches": [], - "details": { - "case_id": "plba-explain-trace-service", - "text": "Как работает TraceService?", - "mode": "router_only", - "run_started_at": "2026-03-12T08:43:13", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Как работает TraceService?", - "symbol_resolution": { - "status": "pending", - "resolved_symbol": null, - "alternatives": [ - "TraceService" - ], - "confidence": 0.0 - }, - "rag_count": 0, - "rag_rows": [], - "llm_answer": null, - "summary": { - "router": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "confidence": null - }, - "retrieval": { - "profile": "code", - "layers_hit": [], - "evidence_sufficient": false - }, - "llm": { - "answer_status": "partial", - "groundedness": "not_applicable" - } - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "TraceService" - ], - "keyword_hints": [ - "TraceService" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "execution": { - "executed_layers": [], - "retrieval_mode_by_layer": {}, - "top_k_by_layer": {}, - "filters_by_layer": {}, - "repo_scope": { - "repo_id": null, - "workspace_id": null - } - }, - "retrieval": null, - "constraint_violations": [], - "timings_ms": { - "router": 0, - "symbol_resolution": 0, - "retrieval_total": 0, - "retrieval_by_layer": {}, - "merge_rank": 0, - "prompt_build": 0, - "llm_call": 0 - }, - "prompt": null, - "router": { - "conversation_mode": "START", - "keyword_hints": [ - "TraceService" - ], - "path_scope": [] - }, - "llm": { - "used_evidence_count": 0, - "missing_evidence_reason": null - } - }, - "run_info": { - "case_id": "plba-explain-trace-service", - "mode": "router_only", - "run_started_at": "2026-03-12T08:43:13", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - }, - "input_request": { - "text": "Как работает TraceService?", - "normalized_query": "Как работает TraceService?" - }, - "steps": [ - { - "step": "intent_router", - "input": { - "query": "Как работает TraceService?" - }, - "output": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Как работает TraceService?" - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "TraceService" - ], - "keyword_hints": [ - "TraceService" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "timings_ms": { - "router": 0 - } - } - } - ] - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_router_only/20260312_084313/router_only_plba_code_retrieval_plba-explain-trace-service.md b/tests/pipeline_setup_v2/test_results/plba_router_only/20260312_084313/router_only_plba_code_retrieval_plba-explain-trace-service.md deleted file mode 100644 index 4004971..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_router_only/20260312_084313/router_only_plba_code_retrieval_plba-explain-trace-service.md +++ /dev/null @@ -1,34 +0,0 @@ -# plba-explain-trace-service - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/router_only_plba_code_retrieval.yaml -- runner: runtime -- mode: router_only -- passed: True - -## Query -Как работает TraceService? - -## Actual -{ - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 0, - "llm_answer": "", - "answer_mode": "partial", - "path_scope": [], - "symbol_candidates": [ - "TraceService" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] -} - -## Mismatches -- none \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_router_only/20260312_084313/router_only_plba_code_retrieval_plba-find-entrypoints-bootstrap.json b/tests/pipeline_setup_v2/test_results/plba_router_only/20260312_084313/router_only_plba_code_retrieval_plba-find-entrypoints-bootstrap.json deleted file mode 100644 index 7c3542b..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_router_only/20260312_084313/router_only_plba_code_retrieval_plba-find-entrypoints-bootstrap.json +++ /dev/null @@ -1,221 +0,0 @@ -{ - "case_id": "plba-find-entrypoints-bootstrap", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/router_only_plba_code_retrieval.yaml", - "runner": "runtime", - "mode": "router_only", - "actual": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 0, - "llm_answer": "", - "answer_mode": "partial", - "path_scope": [], - "symbol_candidates": [ - "create_runtime" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "passed": true, - "mismatches": [], - "details": { - "case_id": "plba-find-entrypoints-bootstrap", - "text": "Объясни функцию create_runtime", - "mode": "router_only", - "run_started_at": "2026-03-12T08:43:13", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Объясни функцию create_runtime", - "symbol_resolution": { - "status": "pending", - "resolved_symbol": null, - "alternatives": [ - "create_runtime" - ], - "confidence": 0.0 - }, - "rag_count": 0, - "rag_rows": [], - "llm_answer": null, - "summary": { - "router": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "confidence": null - }, - "retrieval": { - "profile": "code", - "layers_hit": [], - "evidence_sufficient": false - }, - "llm": { - "answer_status": "partial", - "groundedness": "not_applicable" - } - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "symbol_kind_hint": "function", - "symbol_candidates": [ - "create_runtime" - ], - "keyword_hints": [ - "create_runtime" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "execution": { - "executed_layers": [], - "retrieval_mode_by_layer": {}, - "top_k_by_layer": {}, - "filters_by_layer": {}, - "repo_scope": { - "repo_id": null, - "workspace_id": null - } - }, - "retrieval": null, - "constraint_violations": [], - "timings_ms": { - "router": 0, - "symbol_resolution": 0, - "retrieval_total": 0, - "retrieval_by_layer": {}, - "merge_rank": 0, - "prompt_build": 0, - "llm_call": 0 - }, - "prompt": null, - "router": { - "conversation_mode": "START", - "keyword_hints": [ - "create_runtime" - ], - "path_scope": [] - }, - "llm": { - "used_evidence_count": 0, - "missing_evidence_reason": null - } - }, - "run_info": { - "case_id": "plba-find-entrypoints-bootstrap", - "mode": "router_only", - "run_started_at": "2026-03-12T08:43:13", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - }, - "input_request": { - "text": "Объясни функцию create_runtime", - "normalized_query": "Объясни функцию create_runtime" - }, - "steps": [ - { - "step": "intent_router", - "input": { - "query": "Объясни функцию create_runtime" - }, - "output": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Объясни функцию create_runtime" - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "symbol_kind_hint": "function", - "symbol_candidates": [ - "create_runtime" - ], - "keyword_hints": [ - "create_runtime" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "timings_ms": { - "router": 0 - } - } - } - ] - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_router_only/20260312_084313/router_only_plba_code_retrieval_plba-find-entrypoints-bootstrap.md b/tests/pipeline_setup_v2/test_results/plba_router_only/20260312_084313/router_only_plba_code_retrieval_plba-find-entrypoints-bootstrap.md deleted file mode 100644 index 4e23988..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_router_only/20260312_084313/router_only_plba_code_retrieval_plba-find-entrypoints-bootstrap.md +++ /dev/null @@ -1,34 +0,0 @@ -# plba-find-entrypoints-bootstrap - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/router_only_plba_code_retrieval.yaml -- runner: runtime -- mode: router_only -- passed: True - -## Query -Объясни функцию create_runtime - -## Actual -{ - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 0, - "llm_answer": "", - "answer_mode": "partial", - "path_scope": [], - "symbol_candidates": [ - "create_runtime" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] -} - -## Mismatches -- none \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_router_only/20260312_084313/router_only_plba_code_retrieval_plba-find-entrypoints-create-runtime.json b/tests/pipeline_setup_v2/test_results/plba_router_only/20260312_084313/router_only_plba_code_retrieval_plba-find-entrypoints-create-runtime.json deleted file mode 100644 index 587e0b2..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_router_only/20260312_084313/router_only_plba_code_retrieval_plba-find-entrypoints-create-runtime.json +++ /dev/null @@ -1,198 +0,0 @@ -{ - "case_id": "plba-find-entrypoints-create-runtime", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/router_only_plba_code_retrieval.yaml", - "runner": "runtime", - "mode": "router_only", - "actual": { - "intent": "CODE_QA", - "sub_intent": "FIND_ENTRYPOINTS", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 0, - "llm_answer": "", - "answer_mode": "partial", - "path_scope": [], - "symbol_candidates": [], - "layers": [ - "C3_ENTRYPOINTS", - "C0_SOURCE_CHUNKS" - ] - }, - "passed": true, - "mismatches": [], - "details": { - "case_id": "plba-find-entrypoints-create-runtime", - "text": "Найди точки входа в коде", - "mode": "router_only", - "run_started_at": "2026-03-12T08:43:13", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Найди точки входа в коде", - "symbol_resolution": { - "status": "not_requested", - "resolved_symbol": null, - "alternatives": [], - "confidence": 0.0 - }, - "rag_count": 0, - "rag_rows": [], - "llm_answer": null, - "summary": { - "router": { - "intent": "CODE_QA", - "sub_intent": "FIND_ENTRYPOINTS", - "confidence": null - }, - "retrieval": { - "profile": "code", - "layers_hit": [], - "evidence_sufficient": false - }, - "llm": { - "answer_status": "partial", - "groundedness": "not_applicable" - } - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "FIND_ENTRYPOINTS", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C3_ENTRYPOINTS", - "C0_SOURCE_CHUNKS" - ], - "symbol_kind_hint": "unknown", - "symbol_candidates": [], - "keyword_hints": [], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "execution": { - "executed_layers": [], - "retrieval_mode_by_layer": {}, - "top_k_by_layer": {}, - "filters_by_layer": {}, - "repo_scope": { - "repo_id": null, - "workspace_id": null - } - }, - "retrieval": null, - "constraint_violations": [], - "timings_ms": { - "router": 0, - "symbol_resolution": 0, - "retrieval_total": 0, - "retrieval_by_layer": {}, - "merge_rank": 0, - "prompt_build": 0, - "llm_call": 0 - }, - "prompt": null, - "router": { - "conversation_mode": "START", - "keyword_hints": [], - "path_scope": [] - }, - "llm": { - "used_evidence_count": 0, - "missing_evidence_reason": null - } - }, - "run_info": { - "case_id": "plba-find-entrypoints-create-runtime", - "mode": "router_only", - "run_started_at": "2026-03-12T08:43:13", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - }, - "input_request": { - "text": "Найди точки входа в коде", - "normalized_query": "Найди точки входа в коде" - }, - "steps": [ - { - "step": "intent_router", - "input": { - "query": "Найди точки входа в коде" - }, - "output": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Найди точки входа в коде" - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "FIND_ENTRYPOINTS", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C3_ENTRYPOINTS", - "C0_SOURCE_CHUNKS" - ], - "symbol_kind_hint": "unknown", - "symbol_candidates": [], - "keyword_hints": [], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "timings_ms": { - "router": 0 - } - } - } - ] - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_router_only/20260312_084313/router_only_plba_code_retrieval_plba-find-entrypoints-create-runtime.md b/tests/pipeline_setup_v2/test_results/plba_router_only/20260312_084313/router_only_plba_code_retrieval_plba-find-entrypoints-create-runtime.md deleted file mode 100644 index 3e0cc41..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_router_only/20260312_084313/router_only_plba_code_retrieval_plba-find-entrypoints-create-runtime.md +++ /dev/null @@ -1,29 +0,0 @@ -# plba-find-entrypoints-create-runtime - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/router_only_plba_code_retrieval.yaml -- runner: runtime -- mode: router_only -- passed: True - -## Query -Найди точки входа в коде - -## Actual -{ - "intent": "CODE_QA", - "sub_intent": "FIND_ENTRYPOINTS", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 0, - "llm_answer": "", - "answer_mode": "partial", - "path_scope": [], - "symbol_candidates": [], - "layers": [ - "C3_ENTRYPOINTS", - "C0_SOURCE_CHUNKS" - ] -} - -## Mismatches -- none \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_router_only/20260312_084313/router_only_plba_code_retrieval_plba-find-tests-http-control-channel.json b/tests/pipeline_setup_v2/test_results/plba_router_only/20260312_084313/router_only_plba_code_retrieval_plba-find-tests-http-control-channel.json deleted file mode 100644 index 169ab24..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_router_only/20260312_084313/router_only_plba_code_retrieval_plba-find-tests-http-control-channel.json +++ /dev/null @@ -1,241 +0,0 @@ -{ - "case_id": "plba-find-tests-http-control-channel", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/router_only_plba_code_retrieval.yaml", - "runner": "runtime", - "mode": "router_only", - "actual": { - "intent": "CODE_QA", - "sub_intent": "FIND_TESTS", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 0, - "llm_answer": "", - "answer_mode": "partial", - "path_scope": [], - "symbol_candidates": [ - "HttpControlChannel" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ] - }, - "passed": true, - "mismatches": [], - "details": { - "case_id": "plba-find-tests-http-control-channel", - "text": "Найди тесты для HttpControlChannel", - "mode": "router_only", - "run_started_at": "2026-03-12T08:43:13", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Найди тесты для HttpControlChannel", - "symbol_resolution": { - "status": "pending", - "resolved_symbol": null, - "alternatives": [ - "HttpControlChannel" - ], - "confidence": 0.0 - }, - "rag_count": 0, - "rag_rows": [], - "llm_answer": null, - "summary": { - "router": { - "intent": "CODE_QA", - "sub_intent": "FIND_TESTS", - "confidence": null - }, - "retrieval": { - "profile": "code", - "layers_hit": [], - "evidence_sufficient": false - }, - "llm": { - "answer_status": "partial", - "groundedness": "not_applicable" - } - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "FIND_TESTS", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "HttpControlChannel" - ], - "keyword_hints": [ - "HttpControlChannel" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**", - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "test_file_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "test_symbol_patterns": [ - "test_http_control_channel", - "TestHttpControlChannel", - "HttpControlChannel" - ], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "execution": { - "executed_layers": [], - "retrieval_mode_by_layer": {}, - "top_k_by_layer": {}, - "filters_by_layer": {}, - "repo_scope": { - "repo_id": null, - "workspace_id": null - } - }, - "retrieval": null, - "constraint_violations": [], - "timings_ms": { - "router": 0, - "symbol_resolution": 0, - "retrieval_total": 0, - "retrieval_by_layer": {}, - "merge_rank": 0, - "prompt_build": 0, - "llm_call": 0 - }, - "prompt": null, - "router": { - "conversation_mode": "START", - "keyword_hints": [ - "HttpControlChannel" - ], - "path_scope": [] - }, - "llm": { - "used_evidence_count": 0, - "missing_evidence_reason": null - } - }, - "run_info": { - "case_id": "plba-find-tests-http-control-channel", - "mode": "router_only", - "run_started_at": "2026-03-12T08:43:13", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - }, - "input_request": { - "text": "Найди тесты для HttpControlChannel", - "normalized_query": "Найди тесты для HttpControlChannel" - }, - "steps": [ - { - "step": "intent_router", - "input": { - "query": "Найди тесты для HttpControlChannel" - }, - "output": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Найди тесты для HttpControlChannel" - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "FIND_TESTS", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "HttpControlChannel" - ], - "keyword_hints": [ - "HttpControlChannel" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**", - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "test_file_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "test_symbol_patterns": [ - "test_http_control_channel", - "TestHttpControlChannel", - "HttpControlChannel" - ], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "timings_ms": { - "router": 0 - } - } - } - ] - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_router_only/20260312_084313/router_only_plba_code_retrieval_plba-find-tests-http-control-channel.md b/tests/pipeline_setup_v2/test_results/plba_router_only/20260312_084313/router_only_plba_code_retrieval_plba-find-tests-http-control-channel.md deleted file mode 100644 index 6408e6d..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_router_only/20260312_084313/router_only_plba_code_retrieval_plba-find-tests-http-control-channel.md +++ /dev/null @@ -1,32 +0,0 @@ -# plba-find-tests-http-control-channel - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/router_only_plba_code_retrieval.yaml -- runner: runtime -- mode: router_only -- passed: True - -## Query -Найди тесты для HttpControlChannel - -## Actual -{ - "intent": "CODE_QA", - "sub_intent": "FIND_TESTS", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 0, - "llm_answer": "", - "answer_mode": "partial", - "path_scope": [], - "symbol_candidates": [ - "HttpControlChannel" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ] -} - -## Mismatches -- none \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_router_only/20260312_084313/router_only_plba_code_retrieval_plba-find-tests-runtime-manager.json b/tests/pipeline_setup_v2/test_results/plba_router_only/20260312_084313/router_only_plba_code_retrieval_plba-find-tests-runtime-manager.json deleted file mode 100644 index 652c5f4..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_router_only/20260312_084313/router_only_plba_code_retrieval_plba-find-tests-runtime-manager.json +++ /dev/null @@ -1,241 +0,0 @@ -{ - "case_id": "plba-find-tests-runtime-manager", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/router_only_plba_code_retrieval.yaml", - "runner": "runtime", - "mode": "router_only", - "actual": { - "intent": "CODE_QA", - "sub_intent": "FIND_TESTS", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 0, - "llm_answer": "", - "answer_mode": "partial", - "path_scope": [], - "symbol_candidates": [ - "RuntimeManager" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ] - }, - "passed": true, - "mismatches": [], - "details": { - "case_id": "plba-find-tests-runtime-manager", - "text": "Где тесты для RuntimeManager?", - "mode": "router_only", - "run_started_at": "2026-03-12T08:43:13", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Где тесты для RuntimeManager?", - "symbol_resolution": { - "status": "pending", - "resolved_symbol": null, - "alternatives": [ - "RuntimeManager" - ], - "confidence": 0.0 - }, - "rag_count": 0, - "rag_rows": [], - "llm_answer": null, - "summary": { - "router": { - "intent": "CODE_QA", - "sub_intent": "FIND_TESTS", - "confidence": null - }, - "retrieval": { - "profile": "code", - "layers_hit": [], - "evidence_sufficient": false - }, - "llm": { - "answer_status": "partial", - "groundedness": "not_applicable" - } - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "FIND_TESTS", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "RuntimeManager" - ], - "keyword_hints": [ - "RuntimeManager" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**", - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "test_file_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "test_symbol_patterns": [ - "test_runtime_manager", - "TestRuntimeManager", - "RuntimeManager" - ], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "execution": { - "executed_layers": [], - "retrieval_mode_by_layer": {}, - "top_k_by_layer": {}, - "filters_by_layer": {}, - "repo_scope": { - "repo_id": null, - "workspace_id": null - } - }, - "retrieval": null, - "constraint_violations": [], - "timings_ms": { - "router": 0, - "symbol_resolution": 0, - "retrieval_total": 0, - "retrieval_by_layer": {}, - "merge_rank": 0, - "prompt_build": 0, - "llm_call": 0 - }, - "prompt": null, - "router": { - "conversation_mode": "START", - "keyword_hints": [ - "RuntimeManager" - ], - "path_scope": [] - }, - "llm": { - "used_evidence_count": 0, - "missing_evidence_reason": null - } - }, - "run_info": { - "case_id": "plba-find-tests-runtime-manager", - "mode": "router_only", - "run_started_at": "2026-03-12T08:43:13", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - }, - "input_request": { - "text": "Где тесты для RuntimeManager?", - "normalized_query": "Где тесты для RuntimeManager?" - }, - "steps": [ - { - "step": "intent_router", - "input": { - "query": "Где тесты для RuntimeManager?" - }, - "output": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Где тесты для RuntimeManager?" - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "FIND_TESTS", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "RuntimeManager" - ], - "keyword_hints": [ - "RuntimeManager" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**", - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "test_file_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "test_symbol_patterns": [ - "test_runtime_manager", - "TestRuntimeManager", - "RuntimeManager" - ], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "timings_ms": { - "router": 0 - } - } - } - ] - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_router_only/20260312_084313/router_only_plba_code_retrieval_plba-find-tests-runtime-manager.md b/tests/pipeline_setup_v2/test_results/plba_router_only/20260312_084313/router_only_plba_code_retrieval_plba-find-tests-runtime-manager.md deleted file mode 100644 index efd5f2d..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_router_only/20260312_084313/router_only_plba_code_retrieval_plba-find-tests-runtime-manager.md +++ /dev/null @@ -1,32 +0,0 @@ -# plba-find-tests-runtime-manager - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/router_only_plba_code_retrieval.yaml -- runner: runtime -- mode: router_only -- passed: True - -## Query -Где тесты для RuntimeManager? - -## Actual -{ - "intent": "CODE_QA", - "sub_intent": "FIND_TESTS", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 0, - "llm_answer": "", - "answer_mode": "partial", - "path_scope": [], - "symbol_candidates": [ - "RuntimeManager" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ] -} - -## Mismatches -- none \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_router_only/20260312_084313/router_only_plba_code_retrieval_plba-general-qa-control-plane.json b/tests/pipeline_setup_v2/test_results/plba_router_only/20260312_084313/router_only_plba_code_retrieval_plba-general-qa-control-plane.json deleted file mode 100644 index 8287a38..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_router_only/20260312_084313/router_only_plba_code_retrieval_plba-general-qa-control-plane.json +++ /dev/null @@ -1,228 +0,0 @@ -{ - "case_id": "plba-general-qa-control-plane", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/router_only_plba_code_retrieval.yaml", - "runner": "runtime", - "mode": "router_only", - "actual": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 0, - "llm_answer": "", - "answer_mode": "partial", - "path_scope": [], - "symbol_candidates": [ - "control", - "plane" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "passed": true, - "mismatches": [], - "details": { - "case_id": "plba-general-qa-control-plane", - "text": "Объясни код control plane", - "mode": "router_only", - "run_started_at": "2026-03-12T08:43:13", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Объясни код control plane", - "symbol_resolution": { - "status": "pending", - "resolved_symbol": null, - "alternatives": [ - "control", - "plane" - ], - "confidence": 0.0 - }, - "rag_count": 0, - "rag_rows": [], - "llm_answer": null, - "summary": { - "router": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "confidence": null - }, - "retrieval": { - "profile": "code", - "layers_hit": [], - "evidence_sufficient": false - }, - "llm": { - "answer_status": "partial", - "groundedness": "not_applicable" - } - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "symbol_kind_hint": "unknown", - "symbol_candidates": [ - "control", - "plane" - ], - "keyword_hints": [ - "control", - "plane" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "execution": { - "executed_layers": [], - "retrieval_mode_by_layer": {}, - "top_k_by_layer": {}, - "filters_by_layer": {}, - "repo_scope": { - "repo_id": null, - "workspace_id": null - } - }, - "retrieval": null, - "constraint_violations": [], - "timings_ms": { - "router": 0, - "symbol_resolution": 0, - "retrieval_total": 0, - "retrieval_by_layer": {}, - "merge_rank": 0, - "prompt_build": 0, - "llm_call": 0 - }, - "prompt": null, - "router": { - "conversation_mode": "START", - "keyword_hints": [ - "control", - "plane" - ], - "path_scope": [] - }, - "llm": { - "used_evidence_count": 0, - "missing_evidence_reason": null - } - }, - "run_info": { - "case_id": "plba-general-qa-control-plane", - "mode": "router_only", - "run_started_at": "2026-03-12T08:43:13", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - }, - "input_request": { - "text": "Объясни код control plane", - "normalized_query": "Объясни код control plane" - }, - "steps": [ - { - "step": "intent_router", - "input": { - "query": "Объясни код control plane" - }, - "output": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Объясни код control plane" - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "symbol_kind_hint": "unknown", - "symbol_candidates": [ - "control", - "plane" - ], - "keyword_hints": [ - "control", - "plane" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "timings_ms": { - "router": 0 - } - } - } - ] - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_router_only/20260312_084313/router_only_plba_code_retrieval_plba-general-qa-control-plane.md b/tests/pipeline_setup_v2/test_results/plba_router_only/20260312_084313/router_only_plba_code_retrieval_plba-general-qa-control-plane.md deleted file mode 100644 index 1ed75ac..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_router_only/20260312_084313/router_only_plba_code_retrieval_plba-general-qa-control-plane.md +++ /dev/null @@ -1,35 +0,0 @@ -# plba-general-qa-control-plane - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/router_only_plba_code_retrieval.yaml -- runner: runtime -- mode: router_only -- passed: True - -## Query -Объясни код control plane - -## Actual -{ - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 0, - "llm_answer": "", - "answer_mode": "partial", - "path_scope": [], - "symbol_candidates": [ - "control", - "plane" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] -} - -## Mismatches -- none \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_router_only/20260312_084313/router_only_plba_code_retrieval_plba-general-qa-runtime.json b/tests/pipeline_setup_v2/test_results/plba_router_only/20260312_084313/router_only_plba_code_retrieval_plba-general-qa-runtime.json deleted file mode 100644 index 3d6b712..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_router_only/20260312_084313/router_only_plba_code_retrieval_plba-general-qa-runtime.json +++ /dev/null @@ -1,221 +0,0 @@ -{ - "case_id": "plba-general-qa-runtime", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/router_only_plba_code_retrieval.yaml", - "runner": "runtime", - "mode": "router_only", - "actual": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 0, - "llm_answer": "", - "answer_mode": "partial", - "path_scope": [], - "symbol_candidates": [ - "runtime" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "passed": true, - "mismatches": [], - "details": { - "case_id": "plba-general-qa-runtime", - "text": "Объясни модуль runtime", - "mode": "router_only", - "run_started_at": "2026-03-12T08:43:13", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Объясни модуль runtime", - "symbol_resolution": { - "status": "pending", - "resolved_symbol": null, - "alternatives": [ - "runtime" - ], - "confidence": 0.0 - }, - "rag_count": 0, - "rag_rows": [], - "llm_answer": null, - "summary": { - "router": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "confidence": null - }, - "retrieval": { - "profile": "code", - "layers_hit": [], - "evidence_sufficient": false - }, - "llm": { - "answer_status": "partial", - "groundedness": "not_applicable" - } - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "symbol_kind_hint": "module", - "symbol_candidates": [ - "runtime" - ], - "keyword_hints": [ - "runtime" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "execution": { - "executed_layers": [], - "retrieval_mode_by_layer": {}, - "top_k_by_layer": {}, - "filters_by_layer": {}, - "repo_scope": { - "repo_id": null, - "workspace_id": null - } - }, - "retrieval": null, - "constraint_violations": [], - "timings_ms": { - "router": 0, - "symbol_resolution": 0, - "retrieval_total": 0, - "retrieval_by_layer": {}, - "merge_rank": 0, - "prompt_build": 0, - "llm_call": 0 - }, - "prompt": null, - "router": { - "conversation_mode": "START", - "keyword_hints": [ - "runtime" - ], - "path_scope": [] - }, - "llm": { - "used_evidence_count": 0, - "missing_evidence_reason": null - } - }, - "run_info": { - "case_id": "plba-general-qa-runtime", - "mode": "router_only", - "run_started_at": "2026-03-12T08:43:13", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - }, - "input_request": { - "text": "Объясни модуль runtime", - "normalized_query": "Объясни модуль runtime" - }, - "steps": [ - { - "step": "intent_router", - "input": { - "query": "Объясни модуль runtime" - }, - "output": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Объясни модуль runtime" - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "symbol_kind_hint": "module", - "symbol_candidates": [ - "runtime" - ], - "keyword_hints": [ - "runtime" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "timings_ms": { - "router": 0 - } - } - } - ] - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_router_only/20260312_084313/router_only_plba_code_retrieval_plba-general-qa-runtime.md b/tests/pipeline_setup_v2/test_results/plba_router_only/20260312_084313/router_only_plba_code_retrieval_plba-general-qa-runtime.md deleted file mode 100644 index 89e83a3..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_router_only/20260312_084313/router_only_plba_code_retrieval_plba-general-qa-runtime.md +++ /dev/null @@ -1,34 +0,0 @@ -# plba-general-qa-runtime - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/router_only_plba_code_retrieval.yaml -- runner: runtime -- mode: router_only -- passed: True - -## Query -Объясни модуль runtime - -## Actual -{ - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 0, - "llm_answer": "", - "answer_mode": "partial", - "path_scope": [], - "symbol_candidates": [ - "runtime" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] -} - -## Mismatches -- none \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_router_only/20260312_084313/router_only_plba_code_retrieval_plba-open-http-control-channel-file.json b/tests/pipeline_setup_v2/test_results/plba_router_only/20260312_084313/router_only_plba_code_retrieval_plba-open-http-control-channel-file.json deleted file mode 100644 index f3ad9de..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_router_only/20260312_084313/router_only_plba_code_retrieval_plba-open-http-control-channel-file.json +++ /dev/null @@ -1,207 +0,0 @@ -{ - "case_id": "plba-open-http-control-channel-file", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/router_only_plba_code_retrieval.yaml", - "runner": "runtime", - "mode": "router_only", - "actual": { - "intent": "CODE_QA", - "sub_intent": "OPEN_FILE", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 0, - "llm_answer": "", - "answer_mode": "partial", - "path_scope": [ - "src/app_runtime/control/http_channel.py" - ], - "symbol_candidates": [], - "layers": [ - "C0_SOURCE_CHUNKS" - ] - }, - "passed": true, - "mismatches": [], - "details": { - "case_id": "plba-open-http-control-channel-file", - "text": "Покажи файл src/app_runtime/control/http_channel.py", - "mode": "router_only", - "run_started_at": "2026-03-12T08:43:13", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Покажи файл src/app_runtime/control/http_channel.py", - "symbol_resolution": { - "status": "not_requested", - "resolved_symbol": null, - "alternatives": [], - "confidence": 0.0 - }, - "rag_count": 0, - "rag_rows": [], - "llm_answer": null, - "summary": { - "router": { - "intent": "CODE_QA", - "sub_intent": "OPEN_FILE", - "confidence": null - }, - "retrieval": { - "profile": "code", - "layers_hit": [], - "evidence_sufficient": false - }, - "llm": { - "answer_status": "partial", - "groundedness": "not_applicable" - } - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "OPEN_FILE", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C0_SOURCE_CHUNKS" - ], - "symbol_kind_hint": "unknown", - "symbol_candidates": [], - "keyword_hints": [], - "path_hints": [ - "src/app_runtime/control/http_channel.py" - ], - "path_scope": [ - "src/app_runtime/control/http_channel.py" - ], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/app_runtime/control/http_channel.py" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": false, - "max_distance": 2, - "top_k": 5 - } - } - }, - "execution": { - "executed_layers": [], - "retrieval_mode_by_layer": {}, - "top_k_by_layer": {}, - "filters_by_layer": {}, - "repo_scope": { - "repo_id": null, - "workspace_id": null - } - }, - "retrieval": null, - "constraint_violations": [], - "timings_ms": { - "router": 0, - "symbol_resolution": 0, - "retrieval_total": 0, - "retrieval_by_layer": {}, - "merge_rank": 0, - "prompt_build": 0, - "llm_call": 0 - }, - "prompt": null, - "router": { - "conversation_mode": "START", - "keyword_hints": [], - "path_scope": [ - "src/app_runtime/control/http_channel.py" - ] - }, - "llm": { - "used_evidence_count": 0, - "missing_evidence_reason": null - } - }, - "run_info": { - "case_id": "plba-open-http-control-channel-file", - "mode": "router_only", - "run_started_at": "2026-03-12T08:43:13", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - }, - "input_request": { - "text": "Покажи файл src/app_runtime/control/http_channel.py", - "normalized_query": "Покажи файл src/app_runtime/control/http_channel.py" - }, - "steps": [ - { - "step": "intent_router", - "input": { - "query": "Покажи файл src/app_runtime/control/http_channel.py" - }, - "output": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Покажи файл src/app_runtime/control/http_channel.py" - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "OPEN_FILE", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C0_SOURCE_CHUNKS" - ], - "symbol_kind_hint": "unknown", - "symbol_candidates": [], - "keyword_hints": [], - "path_hints": [ - "src/app_runtime/control/http_channel.py" - ], - "path_scope": [ - "src/app_runtime/control/http_channel.py" - ], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/app_runtime/control/http_channel.py" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": false, - "max_distance": 2, - "top_k": 5 - } - } - }, - "timings_ms": { - "router": 0 - } - } - } - ] - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_router_only/20260312_084313/router_only_plba_code_retrieval_plba-open-http-control-channel-file.md b/tests/pipeline_setup_v2/test_results/plba_router_only/20260312_084313/router_only_plba_code_retrieval_plba-open-http-control-channel-file.md deleted file mode 100644 index 9295e3d..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_router_only/20260312_084313/router_only_plba_code_retrieval_plba-open-http-control-channel-file.md +++ /dev/null @@ -1,30 +0,0 @@ -# plba-open-http-control-channel-file - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/router_only_plba_code_retrieval.yaml -- runner: runtime -- mode: router_only -- passed: True - -## Query -Покажи файл src/app_runtime/control/http_channel.py - -## Actual -{ - "intent": "CODE_QA", - "sub_intent": "OPEN_FILE", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 0, - "llm_answer": "", - "answer_mode": "partial", - "path_scope": [ - "src/app_runtime/control/http_channel.py" - ], - "symbol_candidates": [], - "layers": [ - "C0_SOURCE_CHUNKS" - ] -} - -## Mismatches -- none \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_router_only/20260312_084313/router_only_plba_code_retrieval_plba-open-runtime-manager-file.json b/tests/pipeline_setup_v2/test_results/plba_router_only/20260312_084313/router_only_plba_code_retrieval_plba-open-runtime-manager-file.json deleted file mode 100644 index 2bd910e..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_router_only/20260312_084313/router_only_plba_code_retrieval_plba-open-runtime-manager-file.json +++ /dev/null @@ -1,207 +0,0 @@ -{ - "case_id": "plba-open-runtime-manager-file", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/router_only_plba_code_retrieval.yaml", - "runner": "runtime", - "mode": "router_only", - "actual": { - "intent": "CODE_QA", - "sub_intent": "OPEN_FILE", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 0, - "llm_answer": "", - "answer_mode": "partial", - "path_scope": [ - "src/app_runtime/core/runtime.py" - ], - "symbol_candidates": [], - "layers": [ - "C0_SOURCE_CHUNKS" - ] - }, - "passed": true, - "mismatches": [], - "details": { - "case_id": "plba-open-runtime-manager-file", - "text": "Открой файл src/app_runtime/core/runtime.py", - "mode": "router_only", - "run_started_at": "2026-03-12T08:43:13", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Открой файл src/app_runtime/core/runtime.py", - "symbol_resolution": { - "status": "not_requested", - "resolved_symbol": null, - "alternatives": [], - "confidence": 0.0 - }, - "rag_count": 0, - "rag_rows": [], - "llm_answer": null, - "summary": { - "router": { - "intent": "CODE_QA", - "sub_intent": "OPEN_FILE", - "confidence": null - }, - "retrieval": { - "profile": "code", - "layers_hit": [], - "evidence_sufficient": false - }, - "llm": { - "answer_status": "partial", - "groundedness": "not_applicable" - } - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "OPEN_FILE", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C0_SOURCE_CHUNKS" - ], - "symbol_kind_hint": "unknown", - "symbol_candidates": [], - "keyword_hints": [], - "path_hints": [ - "src/app_runtime/core/runtime.py" - ], - "path_scope": [ - "src/app_runtime/core/runtime.py" - ], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/app_runtime/core/runtime.py" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": false, - "max_distance": 2, - "top_k": 5 - } - } - }, - "execution": { - "executed_layers": [], - "retrieval_mode_by_layer": {}, - "top_k_by_layer": {}, - "filters_by_layer": {}, - "repo_scope": { - "repo_id": null, - "workspace_id": null - } - }, - "retrieval": null, - "constraint_violations": [], - "timings_ms": { - "router": 1, - "symbol_resolution": 0, - "retrieval_total": 0, - "retrieval_by_layer": {}, - "merge_rank": 0, - "prompt_build": 0, - "llm_call": 0 - }, - "prompt": null, - "router": { - "conversation_mode": "START", - "keyword_hints": [], - "path_scope": [ - "src/app_runtime/core/runtime.py" - ] - }, - "llm": { - "used_evidence_count": 0, - "missing_evidence_reason": null - } - }, - "run_info": { - "case_id": "plba-open-runtime-manager-file", - "mode": "router_only", - "run_started_at": "2026-03-12T08:43:13", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - }, - "input_request": { - "text": "Открой файл src/app_runtime/core/runtime.py", - "normalized_query": "Открой файл src/app_runtime/core/runtime.py" - }, - "steps": [ - { - "step": "intent_router", - "input": { - "query": "Открой файл src/app_runtime/core/runtime.py" - }, - "output": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Открой файл src/app_runtime/core/runtime.py" - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "OPEN_FILE", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C0_SOURCE_CHUNKS" - ], - "symbol_kind_hint": "unknown", - "symbol_candidates": [], - "keyword_hints": [], - "path_hints": [ - "src/app_runtime/core/runtime.py" - ], - "path_scope": [ - "src/app_runtime/core/runtime.py" - ], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/app_runtime/core/runtime.py" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": false, - "max_distance": 2, - "top_k": 5 - } - } - }, - "timings_ms": { - "router": 1 - } - } - } - ] - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_router_only/20260312_084313/router_only_plba_code_retrieval_plba-open-runtime-manager-file.md b/tests/pipeline_setup_v2/test_results/plba_router_only/20260312_084313/router_only_plba_code_retrieval_plba-open-runtime-manager-file.md deleted file mode 100644 index 5c4114d..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_router_only/20260312_084313/router_only_plba_code_retrieval_plba-open-runtime-manager-file.md +++ /dev/null @@ -1,30 +0,0 @@ -# plba-open-runtime-manager-file - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/router_only_plba_code_retrieval.yaml -- runner: runtime -- mode: router_only -- passed: True - -## Query -Открой файл src/app_runtime/core/runtime.py - -## Actual -{ - "intent": "CODE_QA", - "sub_intent": "OPEN_FILE", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 0, - "llm_answer": "", - "answer_mode": "partial", - "path_scope": [ - "src/app_runtime/core/runtime.py" - ], - "symbol_candidates": [], - "layers": [ - "C0_SOURCE_CHUNKS" - ] -} - -## Mismatches -- none \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_router_only/20260312_084313/summary.md b/tests/pipeline_setup_v2/test_results/plba_router_only/20260312_084313/summary.md deleted file mode 100644 index 5072b9f..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_router_only/20260312_084313/summary.md +++ /dev/null @@ -1,20 +0,0 @@ -# pipeline_setup_v2 summary - -Passed: 11/11 - - -| File | Case | Runner | Mode | Intent | Sub-intent | Pass | -| ------------------------------------ | ------------------------------------ | ------- | ----------- | ------- | ---------------- | ---- | -| router_only_plba_code_retrieval.yaml | plba-open-runtime-manager-file | runtime | router_only | CODE_QA | OPEN_FILE | ✓ | -| router_only_plba_code_retrieval.yaml | plba-open-http-control-channel-file | runtime | router_only | CODE_QA | OPEN_FILE | ✓ | -| router_only_plba_code_retrieval.yaml | plba-explain-runtime-manager | runtime | router_only | CODE_QA | EXPLAIN | ✓ | -| router_only_plba_code_retrieval.yaml | plba-explain-http-control-channel | runtime | router_only | CODE_QA | EXPLAIN | ✓ | -| router_only_plba_code_retrieval.yaml | plba-explain-trace-service | runtime | router_only | CODE_QA | EXPLAIN | ✓ | -| router_only_plba_code_retrieval.yaml | plba-find-tests-runtime-manager | runtime | router_only | CODE_QA | FIND_TESTS | ✓ | -| router_only_plba_code_retrieval.yaml | plba-find-tests-http-control-channel | runtime | router_only | CODE_QA | FIND_TESTS | ✓ | -| router_only_plba_code_retrieval.yaml | plba-find-entrypoints-create-runtime | runtime | router_only | CODE_QA | FIND_ENTRYPOINTS | ✓ | -| router_only_plba_code_retrieval.yaml | plba-find-entrypoints-bootstrap | runtime | router_only | CODE_QA | EXPLAIN | ✓ | -| router_only_plba_code_retrieval.yaml | plba-general-qa-runtime | runtime | router_only | CODE_QA | EXPLAIN | ✓ | -| router_only_plba_code_retrieval.yaml | plba-general-qa-control-plane | runtime | router_only | CODE_QA | EXPLAIN | ✓ | - - diff --git a/tests/pipeline_setup_v2/test_results/plba_router_rag/20260312_084838/router_rag_plba_code_retrieval_plba-rag-explain-control-plane.json b/tests/pipeline_setup_v2/test_results/plba_router_rag/20260312_084838/router_rag_plba_code_retrieval_plba-rag-explain-control-plane.json deleted file mode 100644 index 1f50c85..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_router_rag/20260312_084838/router_rag_plba_code_retrieval_plba-rag-explain-control-plane.json +++ /dev/null @@ -1,1165 +0,0 @@ -{ - "case_id": "plba-rag-explain-control-plane", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/router_rag_plba_code_retrieval.yaml", - "runner": "runtime", - "mode": "router_rag", - "actual": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 0, - "llm_answer": "", - "answer_mode": "partial", - "path_scope": [], - "symbol_candidates": [ - "control", - "plane" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "passed": false, - "mismatches": [ - "retrieval: expected non-empty rag, got 0 rows" - ], - "details": { - "case_id": "plba-rag-explain-control-plane", - "text": "Объясни код control plane", - "mode": "router_rag", - "run_started_at": "2026-03-12T08:48:39", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Объясни код control plane", - "symbol_resolution": { - "status": "not_found", - "resolved_symbol": null, - "alternatives": [ - "ControlChannel.start", - "ControlChannel.stop", - "ControlActionSet", - "ControlChannel" - ], - "confidence": 0.0 - }, - "rag_count": 0, - "rag_rows": [], - "llm_answer": null, - "summary": { - "router": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "confidence": null - }, - "retrieval": { - "profile": "code", - "layers_hit": [], - "evidence_sufficient": false - }, - "llm": { - "answer_status": "partial", - "groundedness": "not_applicable" - } - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "symbol_kind_hint": "unknown", - "symbol_candidates": [ - "control", - "plane" - ], - "keyword_hints": [ - "control", - "plane" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C0_SOURCE_CHUNKS": "exact_path_fetch", - "C4_SEMANTIC_ROLES": "exact_path_fetch", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C3_ENTRYPOINTS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 8, - "C4_SEMANTIC_ROLES": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C3_ENTRYPOINTS": 6 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C4_SEMANTIC_ROLES": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": null, - "workspace_id": null, - "returned_repo_ids": [], - "returned_workspace_ids": [] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "control plane", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Объясни код control plane", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C4_SEMANTIC_ROLES", - "query": "Объясни код control plane", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "Объясни код control plane", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - }, - { - "layer": "C3_ENTRYPOINTS", - "query": "Объясни код control plane", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 4, - "candidates_after_filter": 4 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 6, - "candidates_after_filter": 6 - }, - { - "layer": "C3_ENTRYPOINTS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 3, - "candidates_after_filter": 3 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "not_found", - "resolved_symbol": null, - "alternatives": [ - "ControlChannel.start", - "ControlChannel.stop", - "ControlActionSet", - "ControlChannel" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "miss", - "hit_count": 0, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "miss", - "hit_count": 0, - "fail_reason": null - }, - { - "layer": "C4_SEMANTIC_ROLES", - "status": "miss", - "hit_count": 0, - "fail_reason": null - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "miss", - "hit_count": 0, - "fail_reason": null - }, - { - "layer": "C3_ENTRYPOINTS", - "status": "miss", - "hit_count": 0, - "fail_reason": null - } - ] - }, - "constraint_violations": [ - { - "type": "LAYER_MISSING", - "severity": "warn", - "details": { - "layer": "C1_SYMBOL_CATALOG", - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "suggested_fix": "Increase top_k for this layer or relax constraints for retrieval." - }, - { - "type": "LAYER_MISSING", - "severity": "warn", - "details": { - "layer": "C0_SOURCE_CHUNKS", - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "suggested_fix": "Increase top_k for this layer or relax constraints for retrieval." - }, - { - "type": "LAYER_MISSING", - "severity": "warn", - "details": { - "layer": "C4_SEMANTIC_ROLES", - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "suggested_fix": "Increase top_k for this layer or relax constraints for retrieval." - }, - { - "type": "LAYER_MISSING", - "severity": "warn", - "details": { - "layer": "C2_DEPENDENCY_GRAPH", - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "suggested_fix": "Increase top_k for this layer or relax constraints for retrieval." - }, - { - "type": "LAYER_MISSING", - "severity": "warn", - "details": { - "layer": "C3_ENTRYPOINTS", - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "suggested_fix": "Increase top_k for this layer or relax constraints for retrieval." - }, - { - "type": "SYMBOL_RESOLUTION_FAILED", - "severity": "warn", - "details": { - "status": "not_found", - "symbol_candidates": [ - "control", - "plane" - ] - }, - "suggested_fix": "Increase symbol layer budget or improve fuzzy symbol resolution settings." - } - ], - "timings_ms": { - "router": 0, - "symbol_resolution": 0, - "retrieval_total": 109, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 22, - "C0_SOURCE_CHUNKS": 13, - "C4_SEMANTIC_ROLES": 11, - "C2_DEPENDENCY_GRAPH": 51, - "C3_ENTRYPOINTS": 9 - }, - "merge_rank": 0, - "prompt_build": 0, - "llm_call": 0 - }, - "prompt": null, - "router": { - "conversation_mode": "START", - "keyword_hints": [ - "control", - "plane" - ], - "path_scope": [] - }, - "llm": { - "used_evidence_count": 0, - "missing_evidence_reason": null - } - }, - "run_info": { - "case_id": "plba-rag-explain-control-plane", - "mode": "router_rag", - "run_started_at": "2026-03-12T08:48:39", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - }, - "input_request": { - "text": "Объясни код control plane", - "normalized_query": "Объясни код control plane" - }, - "steps": [ - { - "step": "intent_router", - "input": { - "query": "Объясни код control plane" - }, - "output": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Объясни код control plane" - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "symbol_kind_hint": "unknown", - "symbol_candidates": [ - "control", - "plane" - ], - "keyword_hints": [ - "control", - "plane" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "timings_ms": { - "router": 0 - } - } - }, - { - "step": "retrieval", - "input": { - "query": "Объясни код control plane" - }, - "output": { - "symbol_resolution": { - "status": "not_found", - "resolved_symbol": null, - "alternatives": [ - "ControlChannel.start", - "ControlChannel.stop", - "ControlActionSet", - "ControlChannel" - ], - "confidence": 0.0 - }, - "rag_count": 0, - "rag_rows": [] - }, - "diagnostics": { - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C0_SOURCE_CHUNKS": "exact_path_fetch", - "C4_SEMANTIC_ROLES": "exact_path_fetch", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C3_ENTRYPOINTS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 8, - "C4_SEMANTIC_ROLES": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C3_ENTRYPOINTS": 6 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C4_SEMANTIC_ROLES": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": null, - "workspace_id": null, - "returned_repo_ids": [], - "returned_workspace_ids": [] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "control plane", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Объясни код control plane", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C4_SEMANTIC_ROLES", - "query": "Объясни код control plane", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "Объясни код control plane", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - }, - { - "layer": "C3_ENTRYPOINTS", - "query": "Объясни код control plane", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 4, - "candidates_after_filter": 4 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 6, - "candidates_after_filter": 6 - }, - { - "layer": "C3_ENTRYPOINTS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 3, - "candidates_after_filter": 3 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "not_found", - "resolved_symbol": null, - "alternatives": [ - "ControlChannel.start", - "ControlChannel.stop", - "ControlActionSet", - "ControlChannel" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "miss", - "hit_count": 0, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "miss", - "hit_count": 0, - "fail_reason": null - }, - { - "layer": "C4_SEMANTIC_ROLES", - "status": "miss", - "hit_count": 0, - "fail_reason": null - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "miss", - "hit_count": 0, - "fail_reason": null - }, - { - "layer": "C3_ENTRYPOINTS", - "status": "miss", - "hit_count": 0, - "fail_reason": null - } - ] - }, - "constraint_violations": [ - { - "type": "LAYER_MISSING", - "severity": "warn", - "details": { - "layer": "C1_SYMBOL_CATALOG", - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "suggested_fix": "Increase top_k for this layer or relax constraints for retrieval." - }, - { - "type": "LAYER_MISSING", - "severity": "warn", - "details": { - "layer": "C0_SOURCE_CHUNKS", - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "suggested_fix": "Increase top_k for this layer or relax constraints for retrieval." - }, - { - "type": "LAYER_MISSING", - "severity": "warn", - "details": { - "layer": "C4_SEMANTIC_ROLES", - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "suggested_fix": "Increase top_k for this layer or relax constraints for retrieval." - }, - { - "type": "LAYER_MISSING", - "severity": "warn", - "details": { - "layer": "C2_DEPENDENCY_GRAPH", - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "suggested_fix": "Increase top_k for this layer or relax constraints for retrieval." - }, - { - "type": "LAYER_MISSING", - "severity": "warn", - "details": { - "layer": "C3_ENTRYPOINTS", - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "suggested_fix": "Increase top_k for this layer or relax constraints for retrieval." - }, - { - "type": "SYMBOL_RESOLUTION_FAILED", - "severity": "warn", - "details": { - "status": "not_found", - "symbol_candidates": [ - "control", - "plane" - ] - }, - "suggested_fix": "Increase symbol layer budget or improve fuzzy symbol resolution settings." - } - ], - "timings_ms": { - "symbol_resolution": 0, - "retrieval_total": 109, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 22, - "C0_SOURCE_CHUNKS": 13, - "C4_SEMANTIC_ROLES": 11, - "C2_DEPENDENCY_GRAPH": 51, - "C3_ENTRYPOINTS": 9 - }, - "merge_rank": 0 - } - } - } - ] - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_router_rag/20260312_084838/router_rag_plba_code_retrieval_plba-rag-explain-control-plane.md b/tests/pipeline_setup_v2/test_results/plba_router_rag/20260312_084838/router_rag_plba_code_retrieval_plba-rag-explain-control-plane.md deleted file mode 100644 index 9b07411..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_router_rag/20260312_084838/router_rag_plba_code_retrieval_plba-rag-explain-control-plane.md +++ /dev/null @@ -1,35 +0,0 @@ -# plba-rag-explain-control-plane - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/router_rag_plba_code_retrieval.yaml -- runner: runtime -- mode: router_rag -- passed: False - -## Query -Объясни код control plane - -## Actual -{ - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 0, - "llm_answer": "", - "answer_mode": "partial", - "path_scope": [], - "symbol_candidates": [ - "control", - "plane" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] -} - -## Mismatches -- retrieval: expected non-empty rag, got 0 rows \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_router_rag/20260312_084838/router_rag_plba_code_retrieval_plba-rag-explain-create-runtime.json b/tests/pipeline_setup_v2/test_results/plba_router_rag/20260312_084838/router_rag_plba_code_retrieval_plba-rag-explain-create-runtime.json deleted file mode 100644 index 5585e5a..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_router_rag/20260312_084838/router_rag_plba_code_retrieval_plba-rag-explain-create-runtime.json +++ /dev/null @@ -1,2285 +0,0 @@ -{ - "case_id": "plba-rag-explain-create-runtime", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/router_rag_plba_code_retrieval.yaml", - "runner": "runtime", - "mode": "router_rag", - "actual": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 19, - "llm_answer": "", - "answer_mode": "partial", - "path_scope": [], - "symbol_candidates": [ - "create_runtime" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "passed": true, - "mismatches": [], - "details": { - "case_id": "plba-rag-explain-create-runtime", - "text": "Объясни функцию create_runtime", - "mode": "router_rag", - "run_started_at": "2026-03-12T08:48:39", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Объясни функцию create_runtime", - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "create_runtime", - "alternatives": [ - "create_runtime" - ], - "confidence": 0.99 - }, - "rag_count": 19, - "rag_rows": [ - { - "path": "src/plba/bootstrap.py", - "content": "function create_runtime\ncreate_runtime(module)", - "layer": "C1_SYMBOL_CATALOG", - "title": "create_runtime", - "span_start": 8, - "span_end": 29, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "qname": "create_runtime", - "kind": "function", - "signature": "create_runtime(module)", - "parent_symbol_id": null, - "package_or_module": "src.plba.bootstrap", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_runner.py", - "content": "UvicornThreadRunner\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (24)", - "layer": "C4_SEMANTIC_ROLES", - "title": "UvicornThreadRunner", - "span_start": 10, - "span_end": 61, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 11, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "fd55630045a02100df8877ac27d951ee08617d4598764394d48cb51fe067476a", - "symbol_name": "UvicornThreadRunner", - "qname": "UvicornThreadRunner", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 24, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "3779fdd2878b770e789a35bb2a89c9d79f13b61c26d7db1b3b683f9bb9e1623f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/persistence/workflow_persistence.py", - "content": "WorkflowPersistence\nrole: pipeline_stage\n\nResponsibilities:\n- orchestrates role-like calls (2)\n- reads and writes state attributes\n- participates in dataflow slices (16)", - "layer": "C4_SEMANTIC_ROLES", - "title": "WorkflowPersistence", - "span_start": 8, - "span_end": 54, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 15, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "7bd01ee45cf31f2d5c2e3e51656254860ac785d10cef9e0852cd4fba90857bae", - "symbol_name": "WorkflowPersistence", - "qname": "WorkflowPersistence", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 16, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "80e9410ddc639789b4353c2a1a757ba8d0d5b5bb6075b0b263b61551f04ae1f0", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (10)", - "layer": "C4_SEMANTIC_ROLES", - "title": "HttpControlChannel", - "span_start": 12, - "span_end": 57, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 21, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "1c9fbdc24819e5604c26ea55428a74310f03a03e1af197ed84846af61e42fdb0", - "symbol_name": "HttpControlChannel", - "qname": "HttpControlChannel", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 10, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/queue/in_memory.py", - "content": "InMemoryTaskQueue\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (9)", - "layer": "C4_SEMANTIC_ROLES", - "title": "InMemoryTaskQueue", - "span_start": 9, - "span_end": 38, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 22, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "2da04cb94544a3bcbf0943a95ad4bdd8710bcafaa32a02fd0e4de2178dcf3533", - "symbol_name": "InMemoryTaskQueue", - "qname": "InMemoryTaskQueue", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 9, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "58f0cc001ccda0eee4c6bc32ed83bd05eafd6b6644f1e8b4aa9eed3103db73dc", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/config/file_loader.py", - "content": "ConfigFileLoader\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (8)", - "layer": "C4_SEMANTIC_ROLES", - "title": "ConfigFileLoader", - "span_start": 11, - "span_end": 48, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 23, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "a8474eca8b6e9dc86ae67ed68b16fa5fb639ef08739c053e7b7195489765667f", - "symbol_name": "ConfigFileLoader", - "qname": "ConfigFileLoader", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 8, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "1f19ffebde5e38e4be5a5d5a678059a0f36dedb8fb8b3e00ab395c67106a87ea", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workers/supervisor.py", - "content": "WorkerSupervisor\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (6)", - "layer": "C4_SEMANTIC_ROLES", - "title": "WorkerSupervisor", - "span_start": 10, - "span_end": 59, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 25, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "c17b44e8d9e97d490989b21fa67d7c346cdda8a0472e4c41fb243c8846faa124", - "symbol_name": "WorkerSupervisor", - "qname": "WorkerSupervisor", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 6, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "77609d9d5927171cce7fc3a54897c183fd63068710c6362029b700937aae5eee", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/engine/workflow_engine.py", - "content": "WorkflowEngine\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (6)", - "layer": "C4_SEMANTIC_ROLES", - "title": "WorkflowEngine", - "span_start": 10, - "span_end": 86, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 25, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "57ec0a9f11c542c78e008684a888397e8d9ef4223671acb2567e631a0cbc70b4", - "symbol_name": "WorkflowEngine", - "qname": "WorkflowEngine", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 6, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "1057136e58a325cd5ab6f4e265d15665fb6a711b7022d9fab52a1a290afa2368", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/store.py", - "content": "TraceContextStore\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (6)", - "layer": "C4_SEMANTIC_ROLES", - "title": "TraceContextStore", - "span_start": 15, - "span_end": 52, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 25, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "b2dad4fbe16ffb11b58deba311c7739955c39d59f291b22181f33e9c8cce4059", - "symbol_name": "TraceContextStore", - "qname": "TraceContextStore", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 6, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "d369554f08fc92039c6edd5a2a1e73b23901533e8974459170bbd9347d263dc5", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/bootstrap.py", - "content": "create_runtime calls runtime.add_config_file", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "create_runtime:calls", - "span_start": 19, - "span_end": 19, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "4eaeec4ac55a59d5f66fd01c4754955f8fedaf4bc3df13fa769b352c7bfaacbb", - "edge_type": "calls", - "src_symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "src_qname": "create_runtime", - "dst_symbol_id": null, - "dst_ref": "runtime.add_config_file", - "resolution": "partial", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/bootstrap.py", - "content": "create_runtime reads_attr runtime.register_module", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "create_runtime:reads_attr", - "span_start": 28, - "span_end": 28, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "45516c79ff358dbf9b650a081668df0f66d2fe989300f985a1a78be6be166f8f", - "edge_type": "reads_attr", - "src_symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "src_qname": "create_runtime", - "dst_symbol_id": null, - "dst_ref": "runtime.register_module", - "resolution": "partial", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/bootstrap.py", - "content": "create_runtime instantiates RuntimeManager", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "create_runtime:instantiates", - "span_start": 17, - "span_end": 17, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "0adba17984f850ea1608c9e734d2dd5c325cfde3a8133123aa239e44935ad18e", - "edge_type": "instantiates", - "src_symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "src_qname": "create_runtime", - "dst_symbol_id": "27158ca220022eeb5083c6addf8a50775d45f7161284fd60aac48410105f4b98", - "dst_ref": "RuntimeManager", - "resolution": "resolved", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/bootstrap.py", - "content": "create_runtime calls runtime.register_module", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "create_runtime:calls", - "span_start": 28, - "span_end": 28, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "ab6003c3441addc1ba1b81edeca009165559f652f6b2cf424e5ae61b1f617de8", - "edge_type": "calls", - "src_symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "src_qname": "create_runtime", - "dst_symbol_id": null, - "dst_ref": "runtime.register_module", - "resolution": "partial", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/bootstrap.py", - "content": "create_runtime calls runtime.control_plane.register_channel", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "create_runtime:calls", - "span_start": 21, - "span_end": 27, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "2678250030b9ce47a3b3b55fac7897ac530367edc8374ac9d5e6ecafb1e483f0", - "edge_type": "calls", - "src_symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "src_qname": "create_runtime", - "dst_symbol_id": null, - "dst_ref": "runtime.control_plane.register_channel", - "resolution": "partial", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/bootstrap.py", - "content": "create_runtime reads_attr runtime.add_config_file", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "create_runtime:reads_attr", - "span_start": 19, - "span_end": 19, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "30d4e8aae984ab84d523e80d02f1caeda52d547fa3d2aa47be8845931cabbca2", - "edge_type": "reads_attr", - "src_symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "src_qname": "create_runtime", - "dst_symbol_id": null, - "dst_ref": "runtime.add_config_file", - "resolution": "partial", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/bootstrap.py", - "content": "def create_runtime(\n module: ApplicationModule,\n *,\n config_path: str | None = None,\n enable_http_control: bool = False,\n control_host: str = \"127.0.0.1\",\n control_port: int = 8080,\n control_timeout: int = 5,\n) -> RuntimeManager:\n runtime = RuntimeManager()\n if config_path is not None:\n runtime.add_config_file(config_path)\n if enable_http_control:\n runtime.control_plane.register_channel(\n HttpControlChannel(\n host=control_host,\n port=control_port,\n timeout=control_timeout,\n )\n )\n runtime.register_module(module)\n return runtime", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/plba/bootstrap.py:create_runtime", - "span_start": 8, - "span_end": 29, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.plba.bootstrap", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "llm_answer": null, - "summary": { - "router": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "confidence": null - }, - "retrieval": { - "profile": "code", - "layers_hit": [ - "C0_SOURCE_CHUNKS", - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS", - "C4_SEMANTIC_ROLES" - ], - "evidence_sufficient": true - }, - "llm": { - "answer_status": "partial", - "groundedness": "not_applicable" - } - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "symbol_kind_hint": "function", - "symbol_candidates": [ - "create_runtime" - ], - "keyword_hints": [ - "create_runtime" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C0_SOURCE_CHUNKS": "exact_path_fetch", - "C4_SEMANTIC_ROLES": "exact_path_fetch", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C3_ENTRYPOINTS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 8, - "C4_SEMANTIC_ROLES": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C3_ENTRYPOINTS": 6 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C4_SEMANTIC_ROLES": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "create_runtime", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Объясни функцию create_runtime", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C4_SEMANTIC_ROLES", - "query": "Объясни функцию create_runtime", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "Объясни функцию create_runtime", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - }, - { - "layer": "C3_ENTRYPOINTS", - "query": "Объясни функцию create_runtime", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 1, - "candidates_after_filter": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 6, - "candidates_after_filter": 6 - }, - { - "layer": "C3_ENTRYPOINTS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 3, - "candidates_after_filter": 3 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "create_runtime", - "alternatives": [ - "create_runtime" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C4_SEMANTIC_ROLES", - "status": "hit", - "hit_count": 8, - "fail_reason": null - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 6, - "fail_reason": null - }, - { - "layer": "C3_ENTRYPOINTS", - "status": "hit", - "hit_count": 3, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "router": 0, - "symbol_resolution": 0, - "retrieval_total": 92, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 18, - "C0_SOURCE_CHUNKS": 11, - "C4_SEMANTIC_ROLES": 12, - "C2_DEPENDENCY_GRAPH": 41, - "C3_ENTRYPOINTS": 8 - }, - "merge_rank": 15, - "prompt_build": 0, - "llm_call": 0 - }, - "prompt": null, - "router": { - "conversation_mode": "START", - "keyword_hints": [ - "create_runtime" - ], - "path_scope": [] - }, - "llm": { - "used_evidence_count": 19, - "missing_evidence_reason": null - } - }, - "run_info": { - "case_id": "plba-rag-explain-create-runtime", - "mode": "router_rag", - "run_started_at": "2026-03-12T08:48:39", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - }, - "input_request": { - "text": "Объясни функцию create_runtime", - "normalized_query": "Объясни функцию create_runtime" - }, - "steps": [ - { - "step": "intent_router", - "input": { - "query": "Объясни функцию create_runtime" - }, - "output": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Объясни функцию create_runtime" - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "symbol_kind_hint": "function", - "symbol_candidates": [ - "create_runtime" - ], - "keyword_hints": [ - "create_runtime" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "timings_ms": { - "router": 0 - } - } - }, - { - "step": "retrieval", - "input": { - "query": "Объясни функцию create_runtime" - }, - "output": { - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "create_runtime", - "alternatives": [ - "create_runtime" - ], - "confidence": 0.99 - }, - "rag_count": 19, - "rag_rows": [ - { - "path": "src/plba/bootstrap.py", - "content": "function create_runtime\ncreate_runtime(module)", - "layer": "C1_SYMBOL_CATALOG", - "title": "create_runtime", - "span_start": 8, - "span_end": 29, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "qname": "create_runtime", - "kind": "function", - "signature": "create_runtime(module)", - "parent_symbol_id": null, - "package_or_module": "src.plba.bootstrap", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_runner.py", - "content": "UvicornThreadRunner\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (24)", - "layer": "C4_SEMANTIC_ROLES", - "title": "UvicornThreadRunner", - "span_start": 10, - "span_end": 61, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 11, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "fd55630045a02100df8877ac27d951ee08617d4598764394d48cb51fe067476a", - "symbol_name": "UvicornThreadRunner", - "qname": "UvicornThreadRunner", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 24, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "3779fdd2878b770e789a35bb2a89c9d79f13b61c26d7db1b3b683f9bb9e1623f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/persistence/workflow_persistence.py", - "content": "WorkflowPersistence\nrole: pipeline_stage\n\nResponsibilities:\n- orchestrates role-like calls (2)\n- reads and writes state attributes\n- participates in dataflow slices (16)", - "layer": "C4_SEMANTIC_ROLES", - "title": "WorkflowPersistence", - "span_start": 8, - "span_end": 54, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 15, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "7bd01ee45cf31f2d5c2e3e51656254860ac785d10cef9e0852cd4fba90857bae", - "symbol_name": "WorkflowPersistence", - "qname": "WorkflowPersistence", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 16, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "80e9410ddc639789b4353c2a1a757ba8d0d5b5bb6075b0b263b61551f04ae1f0", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (10)", - "layer": "C4_SEMANTIC_ROLES", - "title": "HttpControlChannel", - "span_start": 12, - "span_end": 57, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 21, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "1c9fbdc24819e5604c26ea55428a74310f03a03e1af197ed84846af61e42fdb0", - "symbol_name": "HttpControlChannel", - "qname": "HttpControlChannel", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 10, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/queue/in_memory.py", - "content": "InMemoryTaskQueue\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (9)", - "layer": "C4_SEMANTIC_ROLES", - "title": "InMemoryTaskQueue", - "span_start": 9, - "span_end": 38, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 22, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "2da04cb94544a3bcbf0943a95ad4bdd8710bcafaa32a02fd0e4de2178dcf3533", - "symbol_name": "InMemoryTaskQueue", - "qname": "InMemoryTaskQueue", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 9, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "58f0cc001ccda0eee4c6bc32ed83bd05eafd6b6644f1e8b4aa9eed3103db73dc", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/config/file_loader.py", - "content": "ConfigFileLoader\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (8)", - "layer": "C4_SEMANTIC_ROLES", - "title": "ConfigFileLoader", - "span_start": 11, - "span_end": 48, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 23, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "a8474eca8b6e9dc86ae67ed68b16fa5fb639ef08739c053e7b7195489765667f", - "symbol_name": "ConfigFileLoader", - "qname": "ConfigFileLoader", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 8, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "1f19ffebde5e38e4be5a5d5a678059a0f36dedb8fb8b3e00ab395c67106a87ea", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workers/supervisor.py", - "content": "WorkerSupervisor\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (6)", - "layer": "C4_SEMANTIC_ROLES", - "title": "WorkerSupervisor", - "span_start": 10, - "span_end": 59, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 25, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "c17b44e8d9e97d490989b21fa67d7c346cdda8a0472e4c41fb243c8846faa124", - "symbol_name": "WorkerSupervisor", - "qname": "WorkerSupervisor", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 6, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "77609d9d5927171cce7fc3a54897c183fd63068710c6362029b700937aae5eee", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/engine/workflow_engine.py", - "content": "WorkflowEngine\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (6)", - "layer": "C4_SEMANTIC_ROLES", - "title": "WorkflowEngine", - "span_start": 10, - "span_end": 86, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 25, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "57ec0a9f11c542c78e008684a888397e8d9ef4223671acb2567e631a0cbc70b4", - "symbol_name": "WorkflowEngine", - "qname": "WorkflowEngine", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 6, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "1057136e58a325cd5ab6f4e265d15665fb6a711b7022d9fab52a1a290afa2368", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/store.py", - "content": "TraceContextStore\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (6)", - "layer": "C4_SEMANTIC_ROLES", - "title": "TraceContextStore", - "span_start": 15, - "span_end": 52, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 25, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "b2dad4fbe16ffb11b58deba311c7739955c39d59f291b22181f33e9c8cce4059", - "symbol_name": "TraceContextStore", - "qname": "TraceContextStore", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 6, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "d369554f08fc92039c6edd5a2a1e73b23901533e8974459170bbd9347d263dc5", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/bootstrap.py", - "content": "create_runtime calls runtime.add_config_file", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "create_runtime:calls", - "span_start": 19, - "span_end": 19, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "4eaeec4ac55a59d5f66fd01c4754955f8fedaf4bc3df13fa769b352c7bfaacbb", - "edge_type": "calls", - "src_symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "src_qname": "create_runtime", - "dst_symbol_id": null, - "dst_ref": "runtime.add_config_file", - "resolution": "partial", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/bootstrap.py", - "content": "create_runtime reads_attr runtime.register_module", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "create_runtime:reads_attr", - "span_start": 28, - "span_end": 28, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "45516c79ff358dbf9b650a081668df0f66d2fe989300f985a1a78be6be166f8f", - "edge_type": "reads_attr", - "src_symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "src_qname": "create_runtime", - "dst_symbol_id": null, - "dst_ref": "runtime.register_module", - "resolution": "partial", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/bootstrap.py", - "content": "create_runtime instantiates RuntimeManager", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "create_runtime:instantiates", - "span_start": 17, - "span_end": 17, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "0adba17984f850ea1608c9e734d2dd5c325cfde3a8133123aa239e44935ad18e", - "edge_type": "instantiates", - "src_symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "src_qname": "create_runtime", - "dst_symbol_id": "27158ca220022eeb5083c6addf8a50775d45f7161284fd60aac48410105f4b98", - "dst_ref": "RuntimeManager", - "resolution": "resolved", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/bootstrap.py", - "content": "create_runtime calls runtime.register_module", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "create_runtime:calls", - "span_start": 28, - "span_end": 28, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "ab6003c3441addc1ba1b81edeca009165559f652f6b2cf424e5ae61b1f617de8", - "edge_type": "calls", - "src_symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "src_qname": "create_runtime", - "dst_symbol_id": null, - "dst_ref": "runtime.register_module", - "resolution": "partial", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/bootstrap.py", - "content": "create_runtime calls runtime.control_plane.register_channel", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "create_runtime:calls", - "span_start": 21, - "span_end": 27, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "2678250030b9ce47a3b3b55fac7897ac530367edc8374ac9d5e6ecafb1e483f0", - "edge_type": "calls", - "src_symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "src_qname": "create_runtime", - "dst_symbol_id": null, - "dst_ref": "runtime.control_plane.register_channel", - "resolution": "partial", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/bootstrap.py", - "content": "create_runtime reads_attr runtime.add_config_file", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "create_runtime:reads_attr", - "span_start": 19, - "span_end": 19, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "30d4e8aae984ab84d523e80d02f1caeda52d547fa3d2aa47be8845931cabbca2", - "edge_type": "reads_attr", - "src_symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "src_qname": "create_runtime", - "dst_symbol_id": null, - "dst_ref": "runtime.add_config_file", - "resolution": "partial", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/bootstrap.py", - "content": "def create_runtime(\n module: ApplicationModule,\n *,\n config_path: str | None = None,\n enable_http_control: bool = False,\n control_host: str = \"127.0.0.1\",\n control_port: int = 8080,\n control_timeout: int = 5,\n) -> RuntimeManager:\n runtime = RuntimeManager()\n if config_path is not None:\n runtime.add_config_file(config_path)\n if enable_http_control:\n runtime.control_plane.register_channel(\n HttpControlChannel(\n host=control_host,\n port=control_port,\n timeout=control_timeout,\n )\n )\n runtime.register_module(module)\n return runtime", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/plba/bootstrap.py:create_runtime", - "span_start": 8, - "span_end": 29, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.plba.bootstrap", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ] - }, - "diagnostics": { - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C0_SOURCE_CHUNKS": "exact_path_fetch", - "C4_SEMANTIC_ROLES": "exact_path_fetch", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C3_ENTRYPOINTS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 8, - "C4_SEMANTIC_ROLES": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C3_ENTRYPOINTS": 6 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C4_SEMANTIC_ROLES": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "create_runtime", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Объясни функцию create_runtime", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C4_SEMANTIC_ROLES", - "query": "Объясни функцию create_runtime", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "Объясни функцию create_runtime", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - }, - { - "layer": "C3_ENTRYPOINTS", - "query": "Объясни функцию create_runtime", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 1, - "candidates_after_filter": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 6, - "candidates_after_filter": 6 - }, - { - "layer": "C3_ENTRYPOINTS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 3, - "candidates_after_filter": 3 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "create_runtime", - "alternatives": [ - "create_runtime" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C4_SEMANTIC_ROLES", - "status": "hit", - "hit_count": 8, - "fail_reason": null - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 6, - "fail_reason": null - }, - { - "layer": "C3_ENTRYPOINTS", - "status": "hit", - "hit_count": 3, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "symbol_resolution": 0, - "retrieval_total": 92, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 18, - "C0_SOURCE_CHUNKS": 11, - "C4_SEMANTIC_ROLES": 12, - "C2_DEPENDENCY_GRAPH": 41, - "C3_ENTRYPOINTS": 8 - }, - "merge_rank": 15 - } - } - } - ] - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_router_rag/20260312_084838/router_rag_plba_code_retrieval_plba-rag-explain-create-runtime.md b/tests/pipeline_setup_v2/test_results/plba_router_rag/20260312_084838/router_rag_plba_code_retrieval_plba-rag-explain-create-runtime.md deleted file mode 100644 index 3a38698..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_router_rag/20260312_084838/router_rag_plba_code_retrieval_plba-rag-explain-create-runtime.md +++ /dev/null @@ -1,34 +0,0 @@ -# plba-rag-explain-create-runtime - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/router_rag_plba_code_retrieval.yaml -- runner: runtime -- mode: router_rag -- passed: True - -## Query -Объясни функцию create_runtime - -## Actual -{ - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 19, - "llm_answer": "", - "answer_mode": "partial", - "path_scope": [], - "symbol_candidates": [ - "create_runtime" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] -} - -## Mismatches -- none \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_router_rag/20260312_084838/router_rag_plba_code_retrieval_plba-rag-explain-http-control-channel.json b/tests/pipeline_setup_v2/test_results/plba_router_rag/20260312_084838/router_rag_plba_code_retrieval_plba-rag-explain-http-control-channel.json deleted file mode 100644 index 878f481..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_router_rag/20260312_084838/router_rag_plba_code_retrieval_plba-rag-explain-http-control-channel.json +++ /dev/null @@ -1,2477 +0,0 @@ -{ - "case_id": "plba-rag-explain-http-control-channel", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/router_rag_plba_code_retrieval.yaml", - "runner": "runtime", - "mode": "router_rag", - "actual": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 19, - "llm_answer": "", - "answer_mode": "partial", - "path_scope": [], - "symbol_candidates": [ - "HttpControlChannel" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "passed": true, - "mismatches": [], - "details": { - "case_id": "plba-rag-explain-http-control-channel", - "text": "Объясни класс HttpControlChannel", - "mode": "router_rag", - "run_started_at": "2026-03-12T08:48:39", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Объясни класс HttpControlChannel", - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "HttpControlChannel", - "alternatives": [ - "HttpControlChannel" - ], - "confidence": 0.99 - }, - "rag_count": 19, - "rag_rows": [ - { - "path": "src/app_runtime/control/http_channel.py", - "content": "class HttpControlChannel\nHttpControlChannel(ControlChannel)", - "layer": "C1_SYMBOL_CATALOG", - "title": "HttpControlChannel", - "span_start": 12, - "span_end": 57, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "1c9fbdc24819e5604c26ea55428a74310f03a03e1af197ed84846af61e42fdb0", - "qname": "HttpControlChannel", - "kind": "class", - "signature": "HttpControlChannel(ControlChannel)", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.control.http_channel", - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (10)", - "layer": "C4_SEMANTIC_ROLES", - "title": "HttpControlChannel", - "span_start": 12, - "span_end": 57, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 21, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "1c9fbdc24819e5604c26ea55428a74310f03a03e1af197ed84846af61e42fdb0", - "symbol_name": "HttpControlChannel", - "qname": "HttpControlChannel", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 10, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "ControlChannel\nrole: model\n\nResponsibilities:\n- default model role", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlChannel", - "span_start": 21, - "span_end": 28, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 40, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "cfcfe9a311d3a2dbdaf32ac4ccd73c0eb9a117f830591a1c0867ee97d46204ff", - "symbol_name": "ControlChannel", - "qname": "ControlChannel", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "ControlActionSet\nrole: model\n\nResponsibilities:\n- default model role", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlActionSet", - "span_start": 14, - "span_end": 18, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 40, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "46eb026cb3313415ec47b82dd22f84f4d112c9d987e8b1716dcb0baa1cce8988", - "symbol_name": "ControlActionSet", - "qname": "ControlActionSet", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests service\n- reads and writes state attributes\n- participates in dataflow slices (5)", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlPlaneService", - "span_start": 12, - "span_end": 52, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 68, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "b13471e5916986dccffb53fab613812842965705e6b3a89ae549d30c9e91e9aa", - "symbol_name": "ControlPlaneService", - "qname": "ControlPlaneService", - "role": "pipeline_stage", - "confidence": 0.57, - "dataflow_participation": 5, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_runner.py", - "content": "UvicornThreadRunner\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (24)", - "layer": "C4_SEMANTIC_ROLES", - "title": "UvicornThreadRunner", - "span_start": 10, - "span_end": 61, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 11, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "fd55630045a02100df8877ac27d951ee08617d4598764394d48cb51fe067476a", - "symbol_name": "UvicornThreadRunner", - "qname": "UvicornThreadRunner", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 24, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "3779fdd2878b770e789a35bb2a89c9d79f13b61c26d7db1b3b683f9bb9e1623f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "HttpControlAppFactory\nrole: factory\n\nResponsibilities:\n- name suffix suggests factory", - "layer": "C4_SEMANTIC_ROLES", - "title": "HttpControlAppFactory", - "span_start": 15, - "span_end": 53, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 39, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "9b3502a5fb408b273223db13264349cf500de24915b6c649d9ea8970d0dfd8e0", - "symbol_name": "HttpControlAppFactory", - "qname": "HttpControlAppFactory", - "role": "factory", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/persistence/workflow_persistence.py", - "content": "WorkflowPersistence\nrole: pipeline_stage\n\nResponsibilities:\n- orchestrates role-like calls (2)\n- reads and writes state attributes\n- participates in dataflow slices (16)", - "layer": "C4_SEMANTIC_ROLES", - "title": "WorkflowPersistence", - "span_start": 8, - "span_end": 54, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 15, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "7bd01ee45cf31f2d5c2e3e51656254860ac785d10cef9e0852cd4fba90857bae", - "symbol_name": "WorkflowPersistence", - "qname": "WorkflowPersistence", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 16, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "80e9410ddc639789b4353c2a1a757ba8d0d5b5bb6075b0b263b61551f04ae1f0", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/queue/in_memory.py", - "content": "InMemoryTaskQueue\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (9)", - "layer": "C4_SEMANTIC_ROLES", - "title": "InMemoryTaskQueue", - "span_start": 9, - "span_end": 38, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 22, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "2da04cb94544a3bcbf0943a95ad4bdd8710bcafaa32a02fd0e4de2178dcf3533", - "symbol_name": "InMemoryTaskQueue", - "qname": "InMemoryTaskQueue", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 9, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "58f0cc001ccda0eee4c6bc32ed83bd05eafd6b6644f1e8b4aa9eed3103db73dc", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel.__init__\n -> HttpControlChannel._runner\n -> HttpControlChannel.start", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "HttpControlChannel.__init__:dataflow_slice", - "span_start": 15, - "span_end": 22, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "51d73913df709152258ed1b9a8c8f4eb3c575eccfe6b982aef0b28e0789a29da", - "edge_type": "dataflow_slice", - "src_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "src_qname": "HttpControlChannel.__init__", - "dst_symbol_id": "d1933f04137f52535b6525f1b93ff2cd83bfb216b480e887e791ed1714cda8e0", - "dst_ref": "HttpControlChannel.start", - "resolution": "resolved", - "slice_id": "51d73913df709152258ed1b9a8c8f4eb3c575eccfe6b982aef0b28e0789a29da", - "root_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "path_symbols": [ - "HttpControlChannel.__init__", - "HttpControlChannel._runner", - "HttpControlChannel.start" - ], - "path_symbol_ids": [ - "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "d1933f04137f52535b6525f1b93ff2cd83bfb216b480e887e791ed1714cda8e0" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel.__init__\n -> HttpControlChannel._runner\n -> HttpControlChannel.port", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "HttpControlChannel.__init__:dataflow_slice", - "span_start": 15, - "span_end": 29, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "c7167bab7218bb768ad7c11bfb40d1a3096e6071dd7817bba5fd864cf8f6de13", - "edge_type": "dataflow_slice", - "src_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "src_qname": "HttpControlChannel.__init__", - "dst_symbol_id": "3632ce8227f4a31e0768f2fb021a4d1ba28e1202633aa0f2fac902295931280f", - "dst_ref": "HttpControlChannel.port", - "resolution": "resolved", - "slice_id": "c7167bab7218bb768ad7c11bfb40d1a3096e6071dd7817bba5fd864cf8f6de13", - "root_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "path_symbols": [ - "HttpControlChannel.__init__", - "HttpControlChannel._runner", - "HttpControlChannel.port" - ], - "path_symbol_ids": [ - "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "3632ce8227f4a31e0768f2fb021a4d1ba28e1202633aa0f2fac902295931280f" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel.__init__\n -> HttpControlChannel._timeout\n -> HttpControlChannel._health_response", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "HttpControlChannel.__init__:dataflow_slice", - "span_start": 14, - "span_end": 34, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "f858f5c9e575f6c4cdfe3853571b7ee21d1f628a443541d2037c3dc9d0790bef", - "edge_type": "dataflow_slice", - "src_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "src_qname": "HttpControlChannel.__init__", - "dst_symbol_id": "e84bf04e9cd2127df235b7064d05f47e19f19a89c7c82f4c247231d4e8fa426a", - "dst_ref": "HttpControlChannel._health_response", - "resolution": "resolved", - "slice_id": "f858f5c9e575f6c4cdfe3853571b7ee21d1f628a443541d2037c3dc9d0790bef", - "root_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "path_symbols": [ - "HttpControlChannel.__init__", - "HttpControlChannel._timeout", - "HttpControlChannel._health_response" - ], - "path_symbol_ids": [ - "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "e84bf04e9cd2127df235b7064d05f47e19f19a89c7c82f4c247231d4e8fa426a" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel.__init__\n -> HttpControlChannel._timeout\n -> HttpControlChannel._action_response", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "HttpControlChannel.__init__:dataflow_slice", - "span_start": 14, - "span_end": 47, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "c3ef21fcae96c82c00be74b3ab827d4af2085d89cb3fa5521c19a174aad84dbb", - "edge_type": "dataflow_slice", - "src_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "src_qname": "HttpControlChannel.__init__", - "dst_symbol_id": "e64969024ccaeb34d8d91473fad07b3b3d341875846392e7a006406c7ada1954", - "dst_ref": "HttpControlChannel._action_response", - "resolution": "resolved", - "slice_id": "c3ef21fcae96c82c00be74b3ab827d4af2085d89cb3fa5521c19a174aad84dbb", - "root_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "path_symbols": [ - "HttpControlChannel.__init__", - "HttpControlChannel._timeout", - "HttpControlChannel._action_response" - ], - "path_symbol_ids": [ - "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "e64969024ccaeb34d8d91473fad07b3b3d341875846392e7a006406c7ada1954" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel.__init__\n -> HttpControlChannel._runner\n -> HttpControlChannel.stop", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "HttpControlChannel.__init__:dataflow_slice", - "span_start": 15, - "span_end": 25, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "0f827ef81a990258a8a74381c8564a8361afa6712dba3200592659c939adcb9d", - "edge_type": "dataflow_slice", - "src_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "src_qname": "HttpControlChannel.__init__", - "dst_symbol_id": "f29ab212620093d72be20e26c5a399624c7939a6056a728762ed3f84a250bfa3", - "dst_ref": "HttpControlChannel.stop", - "resolution": "resolved", - "slice_id": "0f827ef81a990258a8a74381c8564a8361afa6712dba3200592659c939adcb9d", - "root_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "path_symbols": [ - "HttpControlChannel.__init__", - "HttpControlChannel._runner", - "HttpControlChannel.stop" - ], - "path_symbol_ids": [ - "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "f29ab212620093d72be20e26c5a399624c7939a6056a728762ed3f84a250bfa3" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel.__init__\n -> HttpControlChannel._factory\n -> HttpControlChannel.start", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "HttpControlChannel.__init__:dataflow_slice", - "span_start": 16, - "span_end": 21, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e61ec25ded7dbe380d95ce2abcbc1d7a2d2afde5aa8453866df8706dfb7d6ddb", - "edge_type": "dataflow_slice", - "src_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "src_qname": "HttpControlChannel.__init__", - "dst_symbol_id": "d1933f04137f52535b6525f1b93ff2cd83bfb216b480e887e791ed1714cda8e0", - "dst_ref": "HttpControlChannel.start", - "resolution": "resolved", - "slice_id": "e61ec25ded7dbe380d95ce2abcbc1d7a2d2afde5aa8453866df8706dfb7d6ddb", - "root_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "path_symbols": [ - "HttpControlChannel.__init__", - "HttpControlChannel._factory", - "HttpControlChannel.start" - ], - "path_symbol_ids": [ - "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "d1933f04137f52535b6525f1b93ff2cd83bfb216b480e887e791ed1714cda8e0" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "class HttpControlChannel(ControlChannel):\n def __init__(self, host: str, port: int, timeout: int) -> None:\n self._timeout = timeout\n self._runner = UvicornThreadRunner(host, port, timeout)\n self._factory = HttpControlAppFactory()\n self._actions: ControlActionSet | None = None\n\n async def start(self, actions: ControlActionSet) -> None:\n self._actions = actions\n app = self._factory.create(self._health_response, self._action_response)\n await self._runner.start(app)\n\n async def stop(self) -> None:\n await self._runner.stop()\n\n @property\n def port(self) -> int:\n return self._runner.port\n\n async def _health_response(self) -> dict[str, object]:\n if self._actions is None:\n return {\"status\": \"unhealthy\", \"detail\": \"control actions are not configured\"}\n return await asyncio.wait_for(self._actions.health(), timeout=float(self._timeout))\n\n async def _action_response(self, action: str, _client_source: str = \"unknown\") -> JSONResponse:\n if self._actions is None:\n return JSONResponse(content={\"status\": \"error\", \"detail\": f\"{action} handler is not configured\"}, status_code=404)\n callbacks = {\n \"start\": self._actions.start,\n \"stop\": self._actions.stop,\n \"status\": self._actions.status,\n }\n callback = callbacks.get(action)\n if callback is None:\n return JSONResponse(content={\"status\": \"error\", \"detail\": f\"unsupported action: {action}\"}, status_code=404)\n action_timeout = max(float(self._timeout), 10.0) if action in {\"start\", \"stop\"} else float(self._timeout)\n try:\n detail = await asyncio.wait_for(callback(), timeout=action_timeout)\n except asyncio.TimeoutError:\n return JSONResponse(\n content={\"status\": \"accepted\", \"detail\": f\"{action} operation is still in progress\"},\n status_code=202,\n )\n except Exception as exc:\n return JSONResponse(content={\"status\": \"error\", \"detail\": str(exc)}, status_code=500)\n return JSONResponse(content={\"status\": \"ok\", \"detail\": detail or f\"{action} action accepted\"}, status_code=200)", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/http_channel.py:HttpControlChannel", - "span_start": 12, - "span_end": 57, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.http_channel", - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "llm_answer": null, - "summary": { - "router": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "confidence": null - }, - "retrieval": { - "profile": "code", - "layers_hit": [ - "C0_SOURCE_CHUNKS", - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS", - "C4_SEMANTIC_ROLES" - ], - "evidence_sufficient": true - }, - "llm": { - "answer_status": "partial", - "groundedness": "not_applicable" - } - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "HttpControlChannel" - ], - "keyword_hints": [ - "HttpControlChannel" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C0_SOURCE_CHUNKS": "exact_path_fetch", - "C4_SEMANTIC_ROLES": "exact_path_fetch", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C3_ENTRYPOINTS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 8, - "C4_SEMANTIC_ROLES": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C3_ENTRYPOINTS": 6 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C4_SEMANTIC_ROLES": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "HttpControlChannel", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Объясни класс HttpControlChannel", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C4_SEMANTIC_ROLES", - "query": "Объясни класс HttpControlChannel", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "Объясни класс HttpControlChannel", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - }, - { - "layer": "C3_ENTRYPOINTS", - "query": "Объясни класс HttpControlChannel", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 1, - "candidates_after_filter": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 6, - "candidates_after_filter": 6 - }, - { - "layer": "C3_ENTRYPOINTS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 3, - "candidates_after_filter": 3 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "HttpControlChannel", - "alternatives": [ - "HttpControlChannel" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C4_SEMANTIC_ROLES", - "status": "hit", - "hit_count": 8, - "fail_reason": null - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 6, - "fail_reason": null - }, - { - "layer": "C3_ENTRYPOINTS", - "status": "hit", - "hit_count": 3, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "router": 0, - "symbol_resolution": 0, - "retrieval_total": 115, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 25, - "C0_SOURCE_CHUNKS": 13, - "C4_SEMANTIC_ROLES": 11, - "C2_DEPENDENCY_GRAPH": 54, - "C3_ENTRYPOINTS": 9 - }, - "merge_rank": 15, - "prompt_build": 0, - "llm_call": 0 - }, - "prompt": null, - "router": { - "conversation_mode": "START", - "keyword_hints": [ - "HttpControlChannel" - ], - "path_scope": [] - }, - "llm": { - "used_evidence_count": 19, - "missing_evidence_reason": null - } - }, - "run_info": { - "case_id": "plba-rag-explain-http-control-channel", - "mode": "router_rag", - "run_started_at": "2026-03-12T08:48:39", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - }, - "input_request": { - "text": "Объясни класс HttpControlChannel", - "normalized_query": "Объясни класс HttpControlChannel" - }, - "steps": [ - { - "step": "intent_router", - "input": { - "query": "Объясни класс HttpControlChannel" - }, - "output": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Объясни класс HttpControlChannel" - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "HttpControlChannel" - ], - "keyword_hints": [ - "HttpControlChannel" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "timings_ms": { - "router": 0 - } - } - }, - { - "step": "retrieval", - "input": { - "query": "Объясни класс HttpControlChannel" - }, - "output": { - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "HttpControlChannel", - "alternatives": [ - "HttpControlChannel" - ], - "confidence": 0.99 - }, - "rag_count": 19, - "rag_rows": [ - { - "path": "src/app_runtime/control/http_channel.py", - "content": "class HttpControlChannel\nHttpControlChannel(ControlChannel)", - "layer": "C1_SYMBOL_CATALOG", - "title": "HttpControlChannel", - "span_start": 12, - "span_end": 57, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "1c9fbdc24819e5604c26ea55428a74310f03a03e1af197ed84846af61e42fdb0", - "qname": "HttpControlChannel", - "kind": "class", - "signature": "HttpControlChannel(ControlChannel)", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.control.http_channel", - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (10)", - "layer": "C4_SEMANTIC_ROLES", - "title": "HttpControlChannel", - "span_start": 12, - "span_end": 57, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 21, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "1c9fbdc24819e5604c26ea55428a74310f03a03e1af197ed84846af61e42fdb0", - "symbol_name": "HttpControlChannel", - "qname": "HttpControlChannel", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 10, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "ControlChannel\nrole: model\n\nResponsibilities:\n- default model role", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlChannel", - "span_start": 21, - "span_end": 28, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 40, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "cfcfe9a311d3a2dbdaf32ac4ccd73c0eb9a117f830591a1c0867ee97d46204ff", - "symbol_name": "ControlChannel", - "qname": "ControlChannel", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "ControlActionSet\nrole: model\n\nResponsibilities:\n- default model role", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlActionSet", - "span_start": 14, - "span_end": 18, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 40, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "46eb026cb3313415ec47b82dd22f84f4d112c9d987e8b1716dcb0baa1cce8988", - "symbol_name": "ControlActionSet", - "qname": "ControlActionSet", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests service\n- reads and writes state attributes\n- participates in dataflow slices (5)", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlPlaneService", - "span_start": 12, - "span_end": 52, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 68, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "b13471e5916986dccffb53fab613812842965705e6b3a89ae549d30c9e91e9aa", - "symbol_name": "ControlPlaneService", - "qname": "ControlPlaneService", - "role": "pipeline_stage", - "confidence": 0.57, - "dataflow_participation": 5, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_runner.py", - "content": "UvicornThreadRunner\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (24)", - "layer": "C4_SEMANTIC_ROLES", - "title": "UvicornThreadRunner", - "span_start": 10, - "span_end": 61, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 11, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "fd55630045a02100df8877ac27d951ee08617d4598764394d48cb51fe067476a", - "symbol_name": "UvicornThreadRunner", - "qname": "UvicornThreadRunner", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 24, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "3779fdd2878b770e789a35bb2a89c9d79f13b61c26d7db1b3b683f9bb9e1623f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "HttpControlAppFactory\nrole: factory\n\nResponsibilities:\n- name suffix suggests factory", - "layer": "C4_SEMANTIC_ROLES", - "title": "HttpControlAppFactory", - "span_start": 15, - "span_end": 53, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 39, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "9b3502a5fb408b273223db13264349cf500de24915b6c649d9ea8970d0dfd8e0", - "symbol_name": "HttpControlAppFactory", - "qname": "HttpControlAppFactory", - "role": "factory", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/persistence/workflow_persistence.py", - "content": "WorkflowPersistence\nrole: pipeline_stage\n\nResponsibilities:\n- orchestrates role-like calls (2)\n- reads and writes state attributes\n- participates in dataflow slices (16)", - "layer": "C4_SEMANTIC_ROLES", - "title": "WorkflowPersistence", - "span_start": 8, - "span_end": 54, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 15, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "7bd01ee45cf31f2d5c2e3e51656254860ac785d10cef9e0852cd4fba90857bae", - "symbol_name": "WorkflowPersistence", - "qname": "WorkflowPersistence", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 16, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "80e9410ddc639789b4353c2a1a757ba8d0d5b5bb6075b0b263b61551f04ae1f0", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/queue/in_memory.py", - "content": "InMemoryTaskQueue\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (9)", - "layer": "C4_SEMANTIC_ROLES", - "title": "InMemoryTaskQueue", - "span_start": 9, - "span_end": 38, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 22, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "2da04cb94544a3bcbf0943a95ad4bdd8710bcafaa32a02fd0e4de2178dcf3533", - "symbol_name": "InMemoryTaskQueue", - "qname": "InMemoryTaskQueue", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 9, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "58f0cc001ccda0eee4c6bc32ed83bd05eafd6b6644f1e8b4aa9eed3103db73dc", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel.__init__\n -> HttpControlChannel._runner\n -> HttpControlChannel.start", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "HttpControlChannel.__init__:dataflow_slice", - "span_start": 15, - "span_end": 22, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "51d73913df709152258ed1b9a8c8f4eb3c575eccfe6b982aef0b28e0789a29da", - "edge_type": "dataflow_slice", - "src_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "src_qname": "HttpControlChannel.__init__", - "dst_symbol_id": "d1933f04137f52535b6525f1b93ff2cd83bfb216b480e887e791ed1714cda8e0", - "dst_ref": "HttpControlChannel.start", - "resolution": "resolved", - "slice_id": "51d73913df709152258ed1b9a8c8f4eb3c575eccfe6b982aef0b28e0789a29da", - "root_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "path_symbols": [ - "HttpControlChannel.__init__", - "HttpControlChannel._runner", - "HttpControlChannel.start" - ], - "path_symbol_ids": [ - "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "d1933f04137f52535b6525f1b93ff2cd83bfb216b480e887e791ed1714cda8e0" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel.__init__\n -> HttpControlChannel._runner\n -> HttpControlChannel.port", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "HttpControlChannel.__init__:dataflow_slice", - "span_start": 15, - "span_end": 29, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "c7167bab7218bb768ad7c11bfb40d1a3096e6071dd7817bba5fd864cf8f6de13", - "edge_type": "dataflow_slice", - "src_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "src_qname": "HttpControlChannel.__init__", - "dst_symbol_id": "3632ce8227f4a31e0768f2fb021a4d1ba28e1202633aa0f2fac902295931280f", - "dst_ref": "HttpControlChannel.port", - "resolution": "resolved", - "slice_id": "c7167bab7218bb768ad7c11bfb40d1a3096e6071dd7817bba5fd864cf8f6de13", - "root_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "path_symbols": [ - "HttpControlChannel.__init__", - "HttpControlChannel._runner", - "HttpControlChannel.port" - ], - "path_symbol_ids": [ - "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "3632ce8227f4a31e0768f2fb021a4d1ba28e1202633aa0f2fac902295931280f" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel.__init__\n -> HttpControlChannel._timeout\n -> HttpControlChannel._health_response", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "HttpControlChannel.__init__:dataflow_slice", - "span_start": 14, - "span_end": 34, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "f858f5c9e575f6c4cdfe3853571b7ee21d1f628a443541d2037c3dc9d0790bef", - "edge_type": "dataflow_slice", - "src_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "src_qname": "HttpControlChannel.__init__", - "dst_symbol_id": "e84bf04e9cd2127df235b7064d05f47e19f19a89c7c82f4c247231d4e8fa426a", - "dst_ref": "HttpControlChannel._health_response", - "resolution": "resolved", - "slice_id": "f858f5c9e575f6c4cdfe3853571b7ee21d1f628a443541d2037c3dc9d0790bef", - "root_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "path_symbols": [ - "HttpControlChannel.__init__", - "HttpControlChannel._timeout", - "HttpControlChannel._health_response" - ], - "path_symbol_ids": [ - "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "e84bf04e9cd2127df235b7064d05f47e19f19a89c7c82f4c247231d4e8fa426a" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel.__init__\n -> HttpControlChannel._timeout\n -> HttpControlChannel._action_response", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "HttpControlChannel.__init__:dataflow_slice", - "span_start": 14, - "span_end": 47, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "c3ef21fcae96c82c00be74b3ab827d4af2085d89cb3fa5521c19a174aad84dbb", - "edge_type": "dataflow_slice", - "src_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "src_qname": "HttpControlChannel.__init__", - "dst_symbol_id": "e64969024ccaeb34d8d91473fad07b3b3d341875846392e7a006406c7ada1954", - "dst_ref": "HttpControlChannel._action_response", - "resolution": "resolved", - "slice_id": "c3ef21fcae96c82c00be74b3ab827d4af2085d89cb3fa5521c19a174aad84dbb", - "root_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "path_symbols": [ - "HttpControlChannel.__init__", - "HttpControlChannel._timeout", - "HttpControlChannel._action_response" - ], - "path_symbol_ids": [ - "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "e64969024ccaeb34d8d91473fad07b3b3d341875846392e7a006406c7ada1954" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel.__init__\n -> HttpControlChannel._runner\n -> HttpControlChannel.stop", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "HttpControlChannel.__init__:dataflow_slice", - "span_start": 15, - "span_end": 25, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "0f827ef81a990258a8a74381c8564a8361afa6712dba3200592659c939adcb9d", - "edge_type": "dataflow_slice", - "src_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "src_qname": "HttpControlChannel.__init__", - "dst_symbol_id": "f29ab212620093d72be20e26c5a399624c7939a6056a728762ed3f84a250bfa3", - "dst_ref": "HttpControlChannel.stop", - "resolution": "resolved", - "slice_id": "0f827ef81a990258a8a74381c8564a8361afa6712dba3200592659c939adcb9d", - "root_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "path_symbols": [ - "HttpControlChannel.__init__", - "HttpControlChannel._runner", - "HttpControlChannel.stop" - ], - "path_symbol_ids": [ - "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "f29ab212620093d72be20e26c5a399624c7939a6056a728762ed3f84a250bfa3" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel.__init__\n -> HttpControlChannel._factory\n -> HttpControlChannel.start", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "HttpControlChannel.__init__:dataflow_slice", - "span_start": 16, - "span_end": 21, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e61ec25ded7dbe380d95ce2abcbc1d7a2d2afde5aa8453866df8706dfb7d6ddb", - "edge_type": "dataflow_slice", - "src_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "src_qname": "HttpControlChannel.__init__", - "dst_symbol_id": "d1933f04137f52535b6525f1b93ff2cd83bfb216b480e887e791ed1714cda8e0", - "dst_ref": "HttpControlChannel.start", - "resolution": "resolved", - "slice_id": "e61ec25ded7dbe380d95ce2abcbc1d7a2d2afde5aa8453866df8706dfb7d6ddb", - "root_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "path_symbols": [ - "HttpControlChannel.__init__", - "HttpControlChannel._factory", - "HttpControlChannel.start" - ], - "path_symbol_ids": [ - "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "d1933f04137f52535b6525f1b93ff2cd83bfb216b480e887e791ed1714cda8e0" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "class HttpControlChannel(ControlChannel):\n def __init__(self, host: str, port: int, timeout: int) -> None:\n self._timeout = timeout\n self._runner = UvicornThreadRunner(host, port, timeout)\n self._factory = HttpControlAppFactory()\n self._actions: ControlActionSet | None = None\n\n async def start(self, actions: ControlActionSet) -> None:\n self._actions = actions\n app = self._factory.create(self._health_response, self._action_response)\n await self._runner.start(app)\n\n async def stop(self) -> None:\n await self._runner.stop()\n\n @property\n def port(self) -> int:\n return self._runner.port\n\n async def _health_response(self) -> dict[str, object]:\n if self._actions is None:\n return {\"status\": \"unhealthy\", \"detail\": \"control actions are not configured\"}\n return await asyncio.wait_for(self._actions.health(), timeout=float(self._timeout))\n\n async def _action_response(self, action: str, _client_source: str = \"unknown\") -> JSONResponse:\n if self._actions is None:\n return JSONResponse(content={\"status\": \"error\", \"detail\": f\"{action} handler is not configured\"}, status_code=404)\n callbacks = {\n \"start\": self._actions.start,\n \"stop\": self._actions.stop,\n \"status\": self._actions.status,\n }\n callback = callbacks.get(action)\n if callback is None:\n return JSONResponse(content={\"status\": \"error\", \"detail\": f\"unsupported action: {action}\"}, status_code=404)\n action_timeout = max(float(self._timeout), 10.0) if action in {\"start\", \"stop\"} else float(self._timeout)\n try:\n detail = await asyncio.wait_for(callback(), timeout=action_timeout)\n except asyncio.TimeoutError:\n return JSONResponse(\n content={\"status\": \"accepted\", \"detail\": f\"{action} operation is still in progress\"},\n status_code=202,\n )\n except Exception as exc:\n return JSONResponse(content={\"status\": \"error\", \"detail\": str(exc)}, status_code=500)\n return JSONResponse(content={\"status\": \"ok\", \"detail\": detail or f\"{action} action accepted\"}, status_code=200)", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/http_channel.py:HttpControlChannel", - "span_start": 12, - "span_end": 57, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.http_channel", - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ] - }, - "diagnostics": { - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C0_SOURCE_CHUNKS": "exact_path_fetch", - "C4_SEMANTIC_ROLES": "exact_path_fetch", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C3_ENTRYPOINTS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 8, - "C4_SEMANTIC_ROLES": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C3_ENTRYPOINTS": 6 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C4_SEMANTIC_ROLES": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "HttpControlChannel", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Объясни класс HttpControlChannel", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C4_SEMANTIC_ROLES", - "query": "Объясни класс HttpControlChannel", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "Объясни класс HttpControlChannel", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - }, - { - "layer": "C3_ENTRYPOINTS", - "query": "Объясни класс HttpControlChannel", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 1, - "candidates_after_filter": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 6, - "candidates_after_filter": 6 - }, - { - "layer": "C3_ENTRYPOINTS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 3, - "candidates_after_filter": 3 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "HttpControlChannel", - "alternatives": [ - "HttpControlChannel" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C4_SEMANTIC_ROLES", - "status": "hit", - "hit_count": 8, - "fail_reason": null - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 6, - "fail_reason": null - }, - { - "layer": "C3_ENTRYPOINTS", - "status": "hit", - "hit_count": 3, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "symbol_resolution": 0, - "retrieval_total": 115, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 25, - "C0_SOURCE_CHUNKS": 13, - "C4_SEMANTIC_ROLES": 11, - "C2_DEPENDENCY_GRAPH": 54, - "C3_ENTRYPOINTS": 9 - }, - "merge_rank": 15 - } - } - } - ] - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_router_rag/20260312_084838/router_rag_plba_code_retrieval_plba-rag-explain-http-control-channel.md b/tests/pipeline_setup_v2/test_results/plba_router_rag/20260312_084838/router_rag_plba_code_retrieval_plba-rag-explain-http-control-channel.md deleted file mode 100644 index 7b16505..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_router_rag/20260312_084838/router_rag_plba_code_retrieval_plba-rag-explain-http-control-channel.md +++ /dev/null @@ -1,34 +0,0 @@ -# plba-rag-explain-http-control-channel - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/router_rag_plba_code_retrieval.yaml -- runner: runtime -- mode: router_rag -- passed: True - -## Query -Объясни класс HttpControlChannel - -## Actual -{ - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 19, - "llm_answer": "", - "answer_mode": "partial", - "path_scope": [], - "symbol_candidates": [ - "HttpControlChannel" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] -} - -## Mismatches -- none \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_router_rag/20260312_084838/router_rag_plba_code_retrieval_plba-rag-explain-runtime-manager.json b/tests/pipeline_setup_v2/test_results/plba_router_rag/20260312_084838/router_rag_plba_code_retrieval_plba-rag-explain-runtime-manager.json deleted file mode 100644 index 21fe959..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_router_rag/20260312_084838/router_rag_plba_code_retrieval_plba-rag-explain-runtime-manager.json +++ /dev/null @@ -1,2477 +0,0 @@ -{ - "case_id": "plba-rag-explain-runtime-manager", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/router_rag_plba_code_retrieval.yaml", - "runner": "runtime", - "mode": "router_rag", - "actual": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 19, - "llm_answer": "", - "answer_mode": "partial", - "path_scope": [], - "symbol_candidates": [ - "RuntimeManager" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "passed": true, - "mismatches": [], - "details": { - "case_id": "plba-rag-explain-runtime-manager", - "text": "Объясни как работает класс RuntimeManager", - "mode": "router_rag", - "run_started_at": "2026-03-12T08:48:39", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Объясни как работает класс RuntimeManager", - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "RuntimeManager", - "alternatives": [ - "RuntimeManager" - ], - "confidence": 0.99 - }, - "rag_count": 19, - "rag_rows": [ - { - "path": "src/app_runtime/core/runtime.py", - "content": "class RuntimeManager\nRuntimeManager", - "layer": "C1_SYMBOL_CATALOG", - "title": "RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "7e4a9381328c5803bbc6179458612fc4e947d928aa7bf8b4b2bebb2c8592f758", - "qname": "RuntimeManager", - "kind": "class", - "signature": "RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.core.runtime", - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests manager\n- orchestrates role-like calls (4)\n- reads and writes state attributes\n- participates in dataflow slices (50)", - "layer": "C4_SEMANTIC_ROLES", - "title": "RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 43, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "7e4a9381328c5803bbc6179458612fc4e947d928aa7bf8b4b2bebb2c8592f758", - "symbol_name": "RuntimeManager", - "qname": "RuntimeManager", - "role": "pipeline_stage", - "confidence": 0.67, - "dataflow_participation": 50, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "ControlChannel\nrole: model\n\nResponsibilities:\n- default model role", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlChannel", - "span_start": 21, - "span_end": 28, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 40, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "cfcfe9a311d3a2dbdaf32ac4ccd73c0eb9a117f830591a1c0867ee97d46204ff", - "symbol_name": "ControlChannel", - "qname": "ControlChannel", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "ControlActionSet\nrole: model\n\nResponsibilities:\n- default model role", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlActionSet", - "span_start": 14, - "span_end": 18, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 40, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "46eb026cb3313415ec47b82dd22f84f4d112c9d987e8b1716dcb0baa1cce8988", - "symbol_name": "ControlActionSet", - "qname": "ControlActionSet", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests service\n- reads and writes state attributes\n- participates in dataflow slices (5)", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlPlaneService", - "span_start": 12, - "span_end": 52, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 68, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "b13471e5916986dccffb53fab613812842965705e6b3a89ae549d30c9e91e9aa", - "symbol_name": "ControlPlaneService", - "qname": "ControlPlaneService", - "role": "pipeline_stage", - "confidence": 0.57, - "dataflow_participation": 5, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_runner.py", - "content": "UvicornThreadRunner\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (24)", - "layer": "C4_SEMANTIC_ROLES", - "title": "UvicornThreadRunner", - "span_start": 10, - "span_end": 61, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 11, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "fd55630045a02100df8877ac27d951ee08617d4598764394d48cb51fe067476a", - "symbol_name": "UvicornThreadRunner", - "qname": "UvicornThreadRunner", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 24, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "3779fdd2878b770e789a35bb2a89c9d79f13b61c26d7db1b3b683f9bb9e1623f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (10)", - "layer": "C4_SEMANTIC_ROLES", - "title": "HttpControlChannel", - "span_start": 12, - "span_end": 57, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 21, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "1c9fbdc24819e5604c26ea55428a74310f03a03e1af197ed84846af61e42fdb0", - "symbol_name": "HttpControlChannel", - "qname": "HttpControlChannel", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 10, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "HttpControlAppFactory\nrole: factory\n\nResponsibilities:\n- name suffix suggests factory", - "layer": "C4_SEMANTIC_ROLES", - "title": "HttpControlAppFactory", - "span_start": 15, - "span_end": 53, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 39, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "9b3502a5fb408b273223db13264349cf500de24915b6c649d9ea8970d0dfd8e0", - "symbol_name": "HttpControlAppFactory", - "qname": "HttpControlAppFactory", - "role": "factory", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/persistence/workflow_persistence.py", - "content": "WorkflowPersistence\nrole: pipeline_stage\n\nResponsibilities:\n- orchestrates role-like calls (2)\n- reads and writes state attributes\n- participates in dataflow slices (16)", - "layer": "C4_SEMANTIC_ROLES", - "title": "WorkflowPersistence", - "span_start": 8, - "span_end": 54, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 15, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "7bd01ee45cf31f2d5c2e3e51656254860ac785d10cef9e0852cd4fba90857bae", - "symbol_name": "WorkflowPersistence", - "qname": "WorkflowPersistence", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 16, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "80e9410ddc639789b4353c2a1a757ba8d0d5b5bb6075b0b263b61551f04ae1f0", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.stop", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 25, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d", - "dst_ref": "ControlPlaneService.stop", - "resolution": "resolved", - "slice_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.stop" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._stop_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 51, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a", - "dst_ref": "ControlPlaneService._stop_async", - "resolution": "resolved", - "slice_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._stop_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.register_channel", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 17, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957", - "dst_ref": "ControlPlaneService.register_channel", - "resolution": "resolved", - "slice_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.register_channel" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.start", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 20, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154", - "dst_ref": "ControlPlaneService.start", - "resolution": "resolved", - "slice_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.start" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._start_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 47, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517", - "dst_ref": "ControlPlaneService._start_async", - "resolution": "resolved", - "slice_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._start_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager.add_config_file", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 32, - "span_end": 52, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "a23b8a11ebdb12708b60c96ea12a69f7f042082f1adfddd572444e246d81d167", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "57ffbd4f0d9fdf3507c2b8624312ce211f3d02fdf86a57a8ec90778d8a7b498d", - "dst_ref": "RuntimeManager.add_config_file", - "resolution": "resolved", - "slice_id": "a23b8a11ebdb12708b60c96ea12a69f7f042082f1adfddd572444e246d81d167", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager.add_config_file" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "57ffbd4f0d9fdf3507c2b8624312ce211f3d02fdf86a57a8ec90778d8a7b498d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "class RuntimeManager:\n ACTION_TIMEOUT_SECONDS = 10.0\n ACTION_POLL_INTERVAL_SECONDS = 0.05\n\n def __init__(\n self,\n configuration: ConfigurationManager | None = None,\n services: ServiceContainer | None = None,\n traces: TraceService | None = None,\n health: HealthRegistry | None = None,\n logs: LogManager | None = None,\n workers: WorkerSupervisor | None = None,\n control_plane: ControlPlaneService | None = None,\n ) -> None:\n self.configuration = configuration or ConfigurationManager()\n self.services = services or ServiceContainer()\n self.traces = traces or TraceService()\n self.health = health or HealthRegistry()\n self.logs = logs or LogManager()\n self.workers = workers or WorkerSupervisor()\n self.control_plane = control_plane or ControlPlaneService()\n self.registry = ModuleRegistry(self.services)\n self._started = False\n self._state = LifecycleState.IDLE\n self._core_registered = False\n self._workers_registered = False\n self._register_core_services()\n\n def register_module(self, module: ApplicationModule) -> None:\n self.registry.register_module(module.name)\n module.register(self.registry)\n\n def add_config_file(self, path: str) -> FileConfigProvider:\n provider = FileConfigProvider(path)\n self.configuration.add_provider(provider)\n return provider\n\n def start(self, *, start_control_plane: bool = True) -> None:\n if self._started:\n return\n self._state = LifecycleState.STARTING\n config = self.configuration.load()\n self.logs.apply_config(config)\n self._register_health_contributors()\n self._register_workers()\n self.workers.start()\n if start_control_plane:\n self.control_plane.start(self)\n self._started = True\n self._refresh_state()\n\n def stop(self, timeout: float = 30.0, force: bool = False, stop_control_plane: bool = True) -> None:\n if not self._started:\n return\n self._state = LifecycleState.STOPPING\n self.workers.stop(timeout=timeout, force=force)\n if stop_control_plane:\n self.control_plane.stop()\n self._started = False\n self._state = LifecycleState.STOPPED\n\n def status(self) -> dict[str, object]:\n self._refresh_state()\n return self.control_plane.snapshot(self)\n\n def current_health(self) -> HealthPayload:\n self._refresh_state()\n return self.health.payload(self._state, self.workers.healths())\n\n async def health_status(self) -> HealthPayload:\n return self.current_health()\n\n async def start_runtime(self) -> dict[str, object] | str:\n self._refresh_state()\n if self._started:\n return \"runtime already running\"\n if self._state == LifecycleState.STOPPING:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n\n self.start(start_control_plane=False)\n started = self._wait_for_state({LifecycleState.IDLE, LifecycleState.BUSY}, timeout=self.ACTION_TIMEOUT_SECONDS)\n if started:\n return self._action_detail(\"runtime started\", timed_out=False)\n return self._action_detail(\"runtime start is still in progress\", timed_out=True)\n\n async def stop_runtime(self) -> dict[str, object] | str:\n self._refresh_state()\n if not self._started:\n if self._state == LifecycleState.STOPPING:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n return \"runtime already stopped\"\n\n self._state = LifecycleState.STOPPING\n try:\n self.workers.stop(timeout=self.ACTION_TIMEOUT_SECONDS, force=False)\n except TimeoutError:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n\n self._started = False\n self._state = LifecycleState.STOPPED\n return self._action_detail(\"runtime stopped\", timed_out=False)\n\n async def runtime_status(self) -> str:\n self._refresh_state()\n return self._state.value\n\n def _register_core_services(self) -> None:\n if self._core_registered:\n return\n self.services.register(\"configuration\", self.configuration)\n self.services.register(\"traces\", self.traces)\n self.services.register(\"health\", self.health)\n self.services.register(\"logs\", self.logs)\n self.services.register(\"workers\", self.workers)\n self.services.register(\"control_plane\", self.control_plane)\n self._core_registered = True\n\n def _register_health_contributors(self) -> None:\n for contributor in self.registry.health_contributors:\n self.health.register(contributor)\n\n def _register_workers(self) -> None:\n if self._workers_registered:\n return\n for worker in self.registry.workers:\n self.workers.register(worker)\n self._workers_registered = True\n\n def _refresh_state(self) -> None:\n lifecycle = self.workers.lifecycle_state()\n\n if self._state == LifecycleState.STOPPING:\n if lifecycle == LifecycleState.STOPPED:\n self._started = False\n self._state = LifecycleState.STOPPED\n return\n\n if not self._started:\n if lifecycle == LifecycleState.STOPPED:\n self._state = LifecycleState.STOPPED\n return\n\n self._state = lifecycle\n\n def _wait_for_state(self, target_states: set[LifecycleState], *, timeout: float) -> bool:\n deadline = monotonic() + timeout\n while monotonic() < deadline:\n self._refresh_state()\n if self._state in target_states:\n return True\n sleep(self.ACTION_POLL_INTERVAL_SECONDS)\n self._refresh_state()\n return self._state in target_states\n\n def _action_detail(self, message: str, *, timed_out: bool) -> dict[str, object]:\n self._refresh_state()\n return {\n \"message\": message,\n \"state\": self._state.value,\n \"timed_out\": timed_out,\n \"workers\": self.workers.snapshot(),\n }", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/core/runtime.py:RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.core.runtime", - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "llm_answer": null, - "summary": { - "router": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "confidence": null - }, - "retrieval": { - "profile": "code", - "layers_hit": [ - "C0_SOURCE_CHUNKS", - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS", - "C4_SEMANTIC_ROLES" - ], - "evidence_sufficient": true - }, - "llm": { - "answer_status": "partial", - "groundedness": "not_applicable" - } - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "RuntimeManager" - ], - "keyword_hints": [ - "RuntimeManager" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C0_SOURCE_CHUNKS": "exact_path_fetch", - "C4_SEMANTIC_ROLES": "exact_path_fetch", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C3_ENTRYPOINTS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 8, - "C4_SEMANTIC_ROLES": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C3_ENTRYPOINTS": 6 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C4_SEMANTIC_ROLES": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Объясни как работает класс RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C4_SEMANTIC_ROLES", - "query": "Объясни как работает класс RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "Объясни как работает класс RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - }, - { - "layer": "C3_ENTRYPOINTS", - "query": "Объясни как работает класс RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 1, - "candidates_after_filter": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 6, - "candidates_after_filter": 6 - }, - { - "layer": "C3_ENTRYPOINTS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 3, - "candidates_after_filter": 3 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "RuntimeManager", - "alternatives": [ - "RuntimeManager" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C4_SEMANTIC_ROLES", - "status": "hit", - "hit_count": 8, - "fail_reason": null - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 6, - "fail_reason": null - }, - { - "layer": "C3_ENTRYPOINTS", - "status": "hit", - "hit_count": 3, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "router": 0, - "symbol_resolution": 0, - "retrieval_total": 226, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 39, - "C0_SOURCE_CHUNKS": 15, - "C4_SEMANTIC_ROLES": 14, - "C2_DEPENDENCY_GRAPH": 59, - "C3_ENTRYPOINTS": 9 - }, - "merge_rank": 18, - "prompt_build": 0, - "llm_call": 0 - }, - "prompt": null, - "router": { - "conversation_mode": "START", - "keyword_hints": [ - "RuntimeManager" - ], - "path_scope": [] - }, - "llm": { - "used_evidence_count": 19, - "missing_evidence_reason": null - } - }, - "run_info": { - "case_id": "plba-rag-explain-runtime-manager", - "mode": "router_rag", - "run_started_at": "2026-03-12T08:48:39", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - }, - "input_request": { - "text": "Объясни как работает класс RuntimeManager", - "normalized_query": "Объясни как работает класс RuntimeManager" - }, - "steps": [ - { - "step": "intent_router", - "input": { - "query": "Объясни как работает класс RuntimeManager" - }, - "output": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Объясни как работает класс RuntimeManager" - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "RuntimeManager" - ], - "keyword_hints": [ - "RuntimeManager" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "timings_ms": { - "router": 0 - } - } - }, - { - "step": "retrieval", - "input": { - "query": "Объясни как работает класс RuntimeManager" - }, - "output": { - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "RuntimeManager", - "alternatives": [ - "RuntimeManager" - ], - "confidence": 0.99 - }, - "rag_count": 19, - "rag_rows": [ - { - "path": "src/app_runtime/core/runtime.py", - "content": "class RuntimeManager\nRuntimeManager", - "layer": "C1_SYMBOL_CATALOG", - "title": "RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "7e4a9381328c5803bbc6179458612fc4e947d928aa7bf8b4b2bebb2c8592f758", - "qname": "RuntimeManager", - "kind": "class", - "signature": "RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.core.runtime", - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests manager\n- orchestrates role-like calls (4)\n- reads and writes state attributes\n- participates in dataflow slices (50)", - "layer": "C4_SEMANTIC_ROLES", - "title": "RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 43, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "7e4a9381328c5803bbc6179458612fc4e947d928aa7bf8b4b2bebb2c8592f758", - "symbol_name": "RuntimeManager", - "qname": "RuntimeManager", - "role": "pipeline_stage", - "confidence": 0.67, - "dataflow_participation": 50, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "ControlChannel\nrole: model\n\nResponsibilities:\n- default model role", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlChannel", - "span_start": 21, - "span_end": 28, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 40, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "cfcfe9a311d3a2dbdaf32ac4ccd73c0eb9a117f830591a1c0867ee97d46204ff", - "symbol_name": "ControlChannel", - "qname": "ControlChannel", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "ControlActionSet\nrole: model\n\nResponsibilities:\n- default model role", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlActionSet", - "span_start": 14, - "span_end": 18, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 40, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "46eb026cb3313415ec47b82dd22f84f4d112c9d987e8b1716dcb0baa1cce8988", - "symbol_name": "ControlActionSet", - "qname": "ControlActionSet", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests service\n- reads and writes state attributes\n- participates in dataflow slices (5)", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlPlaneService", - "span_start": 12, - "span_end": 52, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 68, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "b13471e5916986dccffb53fab613812842965705e6b3a89ae549d30c9e91e9aa", - "symbol_name": "ControlPlaneService", - "qname": "ControlPlaneService", - "role": "pipeline_stage", - "confidence": 0.57, - "dataflow_participation": 5, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_runner.py", - "content": "UvicornThreadRunner\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (24)", - "layer": "C4_SEMANTIC_ROLES", - "title": "UvicornThreadRunner", - "span_start": 10, - "span_end": 61, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 11, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "fd55630045a02100df8877ac27d951ee08617d4598764394d48cb51fe067476a", - "symbol_name": "UvicornThreadRunner", - "qname": "UvicornThreadRunner", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 24, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "3779fdd2878b770e789a35bb2a89c9d79f13b61c26d7db1b3b683f9bb9e1623f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (10)", - "layer": "C4_SEMANTIC_ROLES", - "title": "HttpControlChannel", - "span_start": 12, - "span_end": 57, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 21, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "1c9fbdc24819e5604c26ea55428a74310f03a03e1af197ed84846af61e42fdb0", - "symbol_name": "HttpControlChannel", - "qname": "HttpControlChannel", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 10, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "HttpControlAppFactory\nrole: factory\n\nResponsibilities:\n- name suffix suggests factory", - "layer": "C4_SEMANTIC_ROLES", - "title": "HttpControlAppFactory", - "span_start": 15, - "span_end": 53, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 39, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "9b3502a5fb408b273223db13264349cf500de24915b6c649d9ea8970d0dfd8e0", - "symbol_name": "HttpControlAppFactory", - "qname": "HttpControlAppFactory", - "role": "factory", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/persistence/workflow_persistence.py", - "content": "WorkflowPersistence\nrole: pipeline_stage\n\nResponsibilities:\n- orchestrates role-like calls (2)\n- reads and writes state attributes\n- participates in dataflow slices (16)", - "layer": "C4_SEMANTIC_ROLES", - "title": "WorkflowPersistence", - "span_start": 8, - "span_end": 54, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 15, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "7bd01ee45cf31f2d5c2e3e51656254860ac785d10cef9e0852cd4fba90857bae", - "symbol_name": "WorkflowPersistence", - "qname": "WorkflowPersistence", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 16, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "80e9410ddc639789b4353c2a1a757ba8d0d5b5bb6075b0b263b61551f04ae1f0", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.stop", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 25, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d", - "dst_ref": "ControlPlaneService.stop", - "resolution": "resolved", - "slice_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.stop" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._stop_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 51, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a", - "dst_ref": "ControlPlaneService._stop_async", - "resolution": "resolved", - "slice_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._stop_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.register_channel", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 17, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957", - "dst_ref": "ControlPlaneService.register_channel", - "resolution": "resolved", - "slice_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.register_channel" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.start", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 20, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154", - "dst_ref": "ControlPlaneService.start", - "resolution": "resolved", - "slice_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.start" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._start_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 47, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517", - "dst_ref": "ControlPlaneService._start_async", - "resolution": "resolved", - "slice_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._start_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager.add_config_file", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 32, - "span_end": 52, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "a23b8a11ebdb12708b60c96ea12a69f7f042082f1adfddd572444e246d81d167", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "57ffbd4f0d9fdf3507c2b8624312ce211f3d02fdf86a57a8ec90778d8a7b498d", - "dst_ref": "RuntimeManager.add_config_file", - "resolution": "resolved", - "slice_id": "a23b8a11ebdb12708b60c96ea12a69f7f042082f1adfddd572444e246d81d167", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager.add_config_file" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "57ffbd4f0d9fdf3507c2b8624312ce211f3d02fdf86a57a8ec90778d8a7b498d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "class RuntimeManager:\n ACTION_TIMEOUT_SECONDS = 10.0\n ACTION_POLL_INTERVAL_SECONDS = 0.05\n\n def __init__(\n self,\n configuration: ConfigurationManager | None = None,\n services: ServiceContainer | None = None,\n traces: TraceService | None = None,\n health: HealthRegistry | None = None,\n logs: LogManager | None = None,\n workers: WorkerSupervisor | None = None,\n control_plane: ControlPlaneService | None = None,\n ) -> None:\n self.configuration = configuration or ConfigurationManager()\n self.services = services or ServiceContainer()\n self.traces = traces or TraceService()\n self.health = health or HealthRegistry()\n self.logs = logs or LogManager()\n self.workers = workers or WorkerSupervisor()\n self.control_plane = control_plane or ControlPlaneService()\n self.registry = ModuleRegistry(self.services)\n self._started = False\n self._state = LifecycleState.IDLE\n self._core_registered = False\n self._workers_registered = False\n self._register_core_services()\n\n def register_module(self, module: ApplicationModule) -> None:\n self.registry.register_module(module.name)\n module.register(self.registry)\n\n def add_config_file(self, path: str) -> FileConfigProvider:\n provider = FileConfigProvider(path)\n self.configuration.add_provider(provider)\n return provider\n\n def start(self, *, start_control_plane: bool = True) -> None:\n if self._started:\n return\n self._state = LifecycleState.STARTING\n config = self.configuration.load()\n self.logs.apply_config(config)\n self._register_health_contributors()\n self._register_workers()\n self.workers.start()\n if start_control_plane:\n self.control_plane.start(self)\n self._started = True\n self._refresh_state()\n\n def stop(self, timeout: float = 30.0, force: bool = False, stop_control_plane: bool = True) -> None:\n if not self._started:\n return\n self._state = LifecycleState.STOPPING\n self.workers.stop(timeout=timeout, force=force)\n if stop_control_plane:\n self.control_plane.stop()\n self._started = False\n self._state = LifecycleState.STOPPED\n\n def status(self) -> dict[str, object]:\n self._refresh_state()\n return self.control_plane.snapshot(self)\n\n def current_health(self) -> HealthPayload:\n self._refresh_state()\n return self.health.payload(self._state, self.workers.healths())\n\n async def health_status(self) -> HealthPayload:\n return self.current_health()\n\n async def start_runtime(self) -> dict[str, object] | str:\n self._refresh_state()\n if self._started:\n return \"runtime already running\"\n if self._state == LifecycleState.STOPPING:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n\n self.start(start_control_plane=False)\n started = self._wait_for_state({LifecycleState.IDLE, LifecycleState.BUSY}, timeout=self.ACTION_TIMEOUT_SECONDS)\n if started:\n return self._action_detail(\"runtime started\", timed_out=False)\n return self._action_detail(\"runtime start is still in progress\", timed_out=True)\n\n async def stop_runtime(self) -> dict[str, object] | str:\n self._refresh_state()\n if not self._started:\n if self._state == LifecycleState.STOPPING:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n return \"runtime already stopped\"\n\n self._state = LifecycleState.STOPPING\n try:\n self.workers.stop(timeout=self.ACTION_TIMEOUT_SECONDS, force=False)\n except TimeoutError:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n\n self._started = False\n self._state = LifecycleState.STOPPED\n return self._action_detail(\"runtime stopped\", timed_out=False)\n\n async def runtime_status(self) -> str:\n self._refresh_state()\n return self._state.value\n\n def _register_core_services(self) -> None:\n if self._core_registered:\n return\n self.services.register(\"configuration\", self.configuration)\n self.services.register(\"traces\", self.traces)\n self.services.register(\"health\", self.health)\n self.services.register(\"logs\", self.logs)\n self.services.register(\"workers\", self.workers)\n self.services.register(\"control_plane\", self.control_plane)\n self._core_registered = True\n\n def _register_health_contributors(self) -> None:\n for contributor in self.registry.health_contributors:\n self.health.register(contributor)\n\n def _register_workers(self) -> None:\n if self._workers_registered:\n return\n for worker in self.registry.workers:\n self.workers.register(worker)\n self._workers_registered = True\n\n def _refresh_state(self) -> None:\n lifecycle = self.workers.lifecycle_state()\n\n if self._state == LifecycleState.STOPPING:\n if lifecycle == LifecycleState.STOPPED:\n self._started = False\n self._state = LifecycleState.STOPPED\n return\n\n if not self._started:\n if lifecycle == LifecycleState.STOPPED:\n self._state = LifecycleState.STOPPED\n return\n\n self._state = lifecycle\n\n def _wait_for_state(self, target_states: set[LifecycleState], *, timeout: float) -> bool:\n deadline = monotonic() + timeout\n while monotonic() < deadline:\n self._refresh_state()\n if self._state in target_states:\n return True\n sleep(self.ACTION_POLL_INTERVAL_SECONDS)\n self._refresh_state()\n return self._state in target_states\n\n def _action_detail(self, message: str, *, timed_out: bool) -> dict[str, object]:\n self._refresh_state()\n return {\n \"message\": message,\n \"state\": self._state.value,\n \"timed_out\": timed_out,\n \"workers\": self.workers.snapshot(),\n }", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/core/runtime.py:RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.core.runtime", - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ] - }, - "diagnostics": { - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C0_SOURCE_CHUNKS": "exact_path_fetch", - "C4_SEMANTIC_ROLES": "exact_path_fetch", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C3_ENTRYPOINTS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 8, - "C4_SEMANTIC_ROLES": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C3_ENTRYPOINTS": 6 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C4_SEMANTIC_ROLES": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Объясни как работает класс RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C4_SEMANTIC_ROLES", - "query": "Объясни как работает класс RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "Объясни как работает класс RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - }, - { - "layer": "C3_ENTRYPOINTS", - "query": "Объясни как работает класс RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 1, - "candidates_after_filter": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 6, - "candidates_after_filter": 6 - }, - { - "layer": "C3_ENTRYPOINTS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 3, - "candidates_after_filter": 3 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "RuntimeManager", - "alternatives": [ - "RuntimeManager" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C4_SEMANTIC_ROLES", - "status": "hit", - "hit_count": 8, - "fail_reason": null - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 6, - "fail_reason": null - }, - { - "layer": "C3_ENTRYPOINTS", - "status": "hit", - "hit_count": 3, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "symbol_resolution": 0, - "retrieval_total": 226, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 39, - "C0_SOURCE_CHUNKS": 15, - "C4_SEMANTIC_ROLES": 14, - "C2_DEPENDENCY_GRAPH": 59, - "C3_ENTRYPOINTS": 9 - }, - "merge_rank": 18 - } - } - } - ] - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_router_rag/20260312_084838/router_rag_plba_code_retrieval_plba-rag-explain-runtime-manager.md b/tests/pipeline_setup_v2/test_results/plba_router_rag/20260312_084838/router_rag_plba_code_retrieval_plba-rag-explain-runtime-manager.md deleted file mode 100644 index fd2e3dc..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_router_rag/20260312_084838/router_rag_plba_code_retrieval_plba-rag-explain-runtime-manager.md +++ /dev/null @@ -1,34 +0,0 @@ -# plba-rag-explain-runtime-manager - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/router_rag_plba_code_retrieval.yaml -- runner: runtime -- mode: router_rag -- passed: True - -## Query -Объясни как работает класс RuntimeManager - -## Actual -{ - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 19, - "llm_answer": "", - "answer_mode": "partial", - "path_scope": [], - "symbol_candidates": [ - "RuntimeManager" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] -} - -## Mismatches -- none \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_router_rag/20260312_084838/router_rag_plba_code_retrieval_plba-rag-explain-runtime-module.json b/tests/pipeline_setup_v2/test_results/plba_router_rag/20260312_084838/router_rag_plba_code_retrieval_plba-rag-explain-runtime-module.json deleted file mode 100644 index 6e2402c..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_router_rag/20260312_084838/router_rag_plba_code_retrieval_plba-rag-explain-runtime-module.json +++ /dev/null @@ -1,1137 +0,0 @@ -{ - "case_id": "plba-rag-explain-runtime-module", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/router_rag_plba_code_retrieval.yaml", - "runner": "runtime", - "mode": "router_rag", - "actual": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 0, - "llm_answer": "", - "answer_mode": "partial", - "path_scope": [], - "symbol_candidates": [ - "runtime" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "passed": false, - "mismatches": [ - "retrieval: expected non-empty rag, got 0 rows" - ], - "details": { - "case_id": "plba-rag-explain-runtime-module", - "text": "Объясни модуль runtime", - "mode": "router_rag", - "run_started_at": "2026-03-12T08:48:39", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Объясни модуль runtime", - "symbol_resolution": { - "status": "not_found", - "resolved_symbol": null, - "alternatives": [ - "runtime" - ], - "confidence": 0.0 - }, - "rag_count": 0, - "rag_rows": [], - "llm_answer": null, - "summary": { - "router": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "confidence": null - }, - "retrieval": { - "profile": "code", - "layers_hit": [], - "evidence_sufficient": false - }, - "llm": { - "answer_status": "partial", - "groundedness": "not_applicable" - } - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "symbol_kind_hint": "module", - "symbol_candidates": [ - "runtime" - ], - "keyword_hints": [ - "runtime" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C0_SOURCE_CHUNKS": "exact_path_fetch", - "C4_SEMANTIC_ROLES": "exact_path_fetch", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C3_ENTRYPOINTS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 8, - "C4_SEMANTIC_ROLES": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C3_ENTRYPOINTS": 6 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C4_SEMANTIC_ROLES": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": null, - "workspace_id": null, - "returned_repo_ids": [], - "returned_workspace_ids": [] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "runtime", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Объясни модуль runtime", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C4_SEMANTIC_ROLES", - "query": "Объясни модуль runtime", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "Объясни модуль runtime", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - }, - { - "layer": "C3_ENTRYPOINTS", - "query": "Объясни модуль runtime", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 0, - "candidates_after_filter": 0 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 6, - "candidates_after_filter": 6 - }, - { - "layer": "C3_ENTRYPOINTS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 3, - "candidates_after_filter": 3 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "not_found", - "resolved_symbol": null, - "alternatives": [ - "runtime" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "miss", - "hit_count": 0, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "miss", - "hit_count": 0, - "fail_reason": null - }, - { - "layer": "C4_SEMANTIC_ROLES", - "status": "miss", - "hit_count": 0, - "fail_reason": null - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "miss", - "hit_count": 0, - "fail_reason": null - }, - { - "layer": "C3_ENTRYPOINTS", - "status": "miss", - "hit_count": 0, - "fail_reason": null - } - ] - }, - "constraint_violations": [ - { - "type": "LAYER_MISSING", - "severity": "warn", - "details": { - "layer": "C1_SYMBOL_CATALOG", - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "suggested_fix": "Increase top_k for this layer or relax constraints for retrieval." - }, - { - "type": "LAYER_MISSING", - "severity": "warn", - "details": { - "layer": "C0_SOURCE_CHUNKS", - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "suggested_fix": "Increase top_k for this layer or relax constraints for retrieval." - }, - { - "type": "LAYER_MISSING", - "severity": "warn", - "details": { - "layer": "C4_SEMANTIC_ROLES", - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "suggested_fix": "Increase top_k for this layer or relax constraints for retrieval." - }, - { - "type": "LAYER_MISSING", - "severity": "warn", - "details": { - "layer": "C2_DEPENDENCY_GRAPH", - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "suggested_fix": "Increase top_k for this layer or relax constraints for retrieval." - }, - { - "type": "LAYER_MISSING", - "severity": "warn", - "details": { - "layer": "C3_ENTRYPOINTS", - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "suggested_fix": "Increase top_k for this layer or relax constraints for retrieval." - }, - { - "type": "SYMBOL_RESOLUTION_FAILED", - "severity": "warn", - "details": { - "status": "not_found", - "symbol_candidates": [ - "runtime" - ] - }, - "suggested_fix": "Increase symbol layer budget or improve fuzzy symbol resolution settings." - } - ], - "timings_ms": { - "router": 0, - "symbol_resolution": 0, - "retrieval_total": 87, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 18, - "C0_SOURCE_CHUNKS": 9, - "C4_SEMANTIC_ROLES": 12, - "C2_DEPENDENCY_GRAPH": 38, - "C3_ENTRYPOINTS": 8 - }, - "merge_rank": 0, - "prompt_build": 0, - "llm_call": 0 - }, - "prompt": null, - "router": { - "conversation_mode": "START", - "keyword_hints": [ - "runtime" - ], - "path_scope": [] - }, - "llm": { - "used_evidence_count": 0, - "missing_evidence_reason": null - } - }, - "run_info": { - "case_id": "plba-rag-explain-runtime-module", - "mode": "router_rag", - "run_started_at": "2026-03-12T08:48:39", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - }, - "input_request": { - "text": "Объясни модуль runtime", - "normalized_query": "Объясни модуль runtime" - }, - "steps": [ - { - "step": "intent_router", - "input": { - "query": "Объясни модуль runtime" - }, - "output": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Объясни модуль runtime" - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "symbol_kind_hint": "module", - "symbol_candidates": [ - "runtime" - ], - "keyword_hints": [ - "runtime" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "timings_ms": { - "router": 0 - } - } - }, - { - "step": "retrieval", - "input": { - "query": "Объясни модуль runtime" - }, - "output": { - "symbol_resolution": { - "status": "not_found", - "resolved_symbol": null, - "alternatives": [ - "runtime" - ], - "confidence": 0.0 - }, - "rag_count": 0, - "rag_rows": [] - }, - "diagnostics": { - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C0_SOURCE_CHUNKS": "exact_path_fetch", - "C4_SEMANTIC_ROLES": "exact_path_fetch", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C3_ENTRYPOINTS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 8, - "C4_SEMANTIC_ROLES": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C3_ENTRYPOINTS": 6 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C4_SEMANTIC_ROLES": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": null, - "workspace_id": null, - "returned_repo_ids": [], - "returned_workspace_ids": [] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "runtime", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Объясни модуль runtime", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C4_SEMANTIC_ROLES", - "query": "Объясни модуль runtime", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "Объясни модуль runtime", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - }, - { - "layer": "C3_ENTRYPOINTS", - "query": "Объясни модуль runtime", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 0, - "candidates_after_filter": 0 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 6, - "candidates_after_filter": 6 - }, - { - "layer": "C3_ENTRYPOINTS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 3, - "candidates_after_filter": 3 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "not_found", - "resolved_symbol": null, - "alternatives": [ - "runtime" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "miss", - "hit_count": 0, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "miss", - "hit_count": 0, - "fail_reason": null - }, - { - "layer": "C4_SEMANTIC_ROLES", - "status": "miss", - "hit_count": 0, - "fail_reason": null - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "miss", - "hit_count": 0, - "fail_reason": null - }, - { - "layer": "C3_ENTRYPOINTS", - "status": "miss", - "hit_count": 0, - "fail_reason": null - } - ] - }, - "constraint_violations": [ - { - "type": "LAYER_MISSING", - "severity": "warn", - "details": { - "layer": "C1_SYMBOL_CATALOG", - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "suggested_fix": "Increase top_k for this layer or relax constraints for retrieval." - }, - { - "type": "LAYER_MISSING", - "severity": "warn", - "details": { - "layer": "C0_SOURCE_CHUNKS", - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "suggested_fix": "Increase top_k for this layer or relax constraints for retrieval." - }, - { - "type": "LAYER_MISSING", - "severity": "warn", - "details": { - "layer": "C4_SEMANTIC_ROLES", - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "suggested_fix": "Increase top_k for this layer or relax constraints for retrieval." - }, - { - "type": "LAYER_MISSING", - "severity": "warn", - "details": { - "layer": "C2_DEPENDENCY_GRAPH", - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "suggested_fix": "Increase top_k for this layer or relax constraints for retrieval." - }, - { - "type": "LAYER_MISSING", - "severity": "warn", - "details": { - "layer": "C3_ENTRYPOINTS", - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "suggested_fix": "Increase top_k for this layer or relax constraints for retrieval." - }, - { - "type": "SYMBOL_RESOLUTION_FAILED", - "severity": "warn", - "details": { - "status": "not_found", - "symbol_candidates": [ - "runtime" - ] - }, - "suggested_fix": "Increase symbol layer budget or improve fuzzy symbol resolution settings." - } - ], - "timings_ms": { - "symbol_resolution": 0, - "retrieval_total": 87, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 18, - "C0_SOURCE_CHUNKS": 9, - "C4_SEMANTIC_ROLES": 12, - "C2_DEPENDENCY_GRAPH": 38, - "C3_ENTRYPOINTS": 8 - }, - "merge_rank": 0 - } - } - } - ] - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_router_rag/20260312_084838/router_rag_plba_code_retrieval_plba-rag-explain-runtime-module.md b/tests/pipeline_setup_v2/test_results/plba_router_rag/20260312_084838/router_rag_plba_code_retrieval_plba-rag-explain-runtime-module.md deleted file mode 100644 index a20986f..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_router_rag/20260312_084838/router_rag_plba_code_retrieval_plba-rag-explain-runtime-module.md +++ /dev/null @@ -1,34 +0,0 @@ -# plba-rag-explain-runtime-module - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/router_rag_plba_code_retrieval.yaml -- runner: runtime -- mode: router_rag -- passed: False - -## Query -Объясни модуль runtime - -## Actual -{ - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 0, - "llm_answer": "", - "answer_mode": "partial", - "path_scope": [], - "symbol_candidates": [ - "runtime" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] -} - -## Mismatches -- retrieval: expected non-empty rag, got 0 rows \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_router_rag/20260312_084838/router_rag_plba_code_retrieval_plba-rag-explain-trace-service.json b/tests/pipeline_setup_v2/test_results/plba_router_rag/20260312_084838/router_rag_plba_code_retrieval_plba-rag-explain-trace-service.json deleted file mode 100644 index 6ccd825..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_router_rag/20260312_084838/router_rag_plba_code_retrieval_plba-rag-explain-trace-service.json +++ /dev/null @@ -1,2597 +0,0 @@ -{ - "case_id": "plba-rag-explain-trace-service", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/router_rag_plba_code_retrieval.yaml", - "runner": "runtime", - "mode": "router_rag", - "actual": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 21, - "llm_answer": "", - "answer_mode": "partial", - "path_scope": [], - "symbol_candidates": [ - "TraceService" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "passed": true, - "mismatches": [], - "details": { - "case_id": "plba-rag-explain-trace-service", - "text": "Как работает TraceService?", - "mode": "router_rag", - "run_started_at": "2026-03-12T08:48:39", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Как работает TraceService?", - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "TraceService", - "alternatives": [ - "TraceService" - ], - "confidence": 0.99 - }, - "rag_count": 21, - "rag_rows": [ - { - "path": "src/app_runtime/tracing/service.py", - "content": "class TraceService\nTraceService(TraceContextFactory)", - "layer": "C1_SYMBOL_CATALOG", - "title": "TraceService", - "span_start": 39, - "span_end": 166, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "c2b2b976d99f2c600000b753731b26e0a69adcb4359398b93073590c5d5d04f4", - "qname": "TraceService", - "kind": "class", - "signature": "TraceService(TraceContextFactory)", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.tracing.service", - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "TraceService\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests service\n- reads and writes state attributes\n- participates in dataflow slices (13)", - "layer": "C4_SEMANTIC_ROLES", - "title": "TraceService", - "span_start": 39, - "span_end": 166, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 60, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "c2b2b976d99f2c600000b753731b26e0a69adcb4359398b93073590c5d5d04f4", - "symbol_name": "TraceService", - "qname": "TraceService", - "role": "pipeline_stage", - "confidence": 0.57, - "dataflow_participation": 13, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_runner.py", - "content": "UvicornThreadRunner\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (24)", - "layer": "C4_SEMANTIC_ROLES", - "title": "UvicornThreadRunner", - "span_start": 10, - "span_end": 61, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 11, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "fd55630045a02100df8877ac27d951ee08617d4598764394d48cb51fe067476a", - "symbol_name": "UvicornThreadRunner", - "qname": "UvicornThreadRunner", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 24, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "3779fdd2878b770e789a35bb2a89c9d79f13b61c26d7db1b3b683f9bb9e1623f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/persistence/workflow_persistence.py", - "content": "WorkflowPersistence\nrole: pipeline_stage\n\nResponsibilities:\n- orchestrates role-like calls (2)\n- reads and writes state attributes\n- participates in dataflow slices (16)", - "layer": "C4_SEMANTIC_ROLES", - "title": "WorkflowPersistence", - "span_start": 8, - "span_end": 54, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 15, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "7bd01ee45cf31f2d5c2e3e51656254860ac785d10cef9e0852cd4fba90857bae", - "symbol_name": "WorkflowPersistence", - "qname": "WorkflowPersistence", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 16, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "80e9410ddc639789b4353c2a1a757ba8d0d5b5bb6075b0b263b61551f04ae1f0", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (10)", - "layer": "C4_SEMANTIC_ROLES", - "title": "HttpControlChannel", - "span_start": 12, - "span_end": 57, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 21, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "1c9fbdc24819e5604c26ea55428a74310f03a03e1af197ed84846af61e42fdb0", - "symbol_name": "HttpControlChannel", - "qname": "HttpControlChannel", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 10, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/queue/in_memory.py", - "content": "InMemoryTaskQueue\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (9)", - "layer": "C4_SEMANTIC_ROLES", - "title": "InMemoryTaskQueue", - "span_start": 9, - "span_end": 38, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 22, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "2da04cb94544a3bcbf0943a95ad4bdd8710bcafaa32a02fd0e4de2178dcf3533", - "symbol_name": "InMemoryTaskQueue", - "qname": "InMemoryTaskQueue", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 9, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "58f0cc001ccda0eee4c6bc32ed83bd05eafd6b6644f1e8b4aa9eed3103db73dc", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/config/file_loader.py", - "content": "ConfigFileLoader\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (8)", - "layer": "C4_SEMANTIC_ROLES", - "title": "ConfigFileLoader", - "span_start": 11, - "span_end": 48, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 23, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "a8474eca8b6e9dc86ae67ed68b16fa5fb639ef08739c053e7b7195489765667f", - "symbol_name": "ConfigFileLoader", - "qname": "ConfigFileLoader", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 8, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "1f19ffebde5e38e4be5a5d5a678059a0f36dedb8fb8b3e00ab395c67106a87ea", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/store.py", - "content": "TraceContextStore\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (6)", - "layer": "C4_SEMANTIC_ROLES", - "title": "TraceContextStore", - "span_start": 15, - "span_end": 52, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 25, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "b2dad4fbe16ffb11b58deba311c7739955c39d59f291b22181f33e9c8cce4059", - "symbol_name": "TraceContextStore", - "qname": "TraceContextStore", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 6, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "d369554f08fc92039c6edd5a2a1e73b23901533e8974459170bbd9347d263dc5", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workers/supervisor.py", - "content": "WorkerSupervisor\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (6)", - "layer": "C4_SEMANTIC_ROLES", - "title": "WorkerSupervisor", - "span_start": 10, - "span_end": 59, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 25, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "c17b44e8d9e97d490989b21fa67d7c346cdda8a0472e4c41fb243c8846faa124", - "symbol_name": "WorkerSupervisor", - "qname": "WorkerSupervisor", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 6, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "77609d9d5927171cce7fc3a54897c183fd63068710c6362029b700937aae5eee", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "TraceService.__init__\n -> TraceService.store\n -> TraceService.create_context", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "TraceService.__init__:dataflow_slice", - "span_start": 42, - "span_end": 61, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "3b052062067a78aef3302ee1d996897e02a67d1b340397bea4f59fe147c0492a", - "edge_type": "dataflow_slice", - "src_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "src_qname": "TraceService.__init__", - "dst_symbol_id": "ff44881104b65ef50ee6fe16d367d4a81b6e7eb5c44c0963cf4543faec785d4a", - "dst_ref": "TraceService.create_context", - "resolution": "resolved", - "slice_id": "3b052062067a78aef3302ee1d996897e02a67d1b340397bea4f59fe147c0492a", - "root_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "path_symbols": [ - "TraceService.__init__", - "TraceService.store", - "TraceService.create_context" - ], - "path_symbol_ids": [ - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "ff44881104b65ef50ee6fe16d367d4a81b6e7eb5c44c0963cf4543faec785d4a" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "TraceService.__init__\n -> TraceService.store\n -> TraceService.close_context", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "TraceService.__init__:dataflow_slice", - "span_start": 42, - "span_end": 84, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "7a9353ef57c9ae5d19b3a0c6ac50fad05e6d21d31bbe1cd1cd07af6332ba6505", - "edge_type": "dataflow_slice", - "src_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "src_qname": "TraceService.__init__", - "dst_symbol_id": "01e14158dcced7e52d0c8ac84ac7b9a75225c261b6aca6a1d7da802d0994721c", - "dst_ref": "TraceService.close_context", - "resolution": "resolved", - "slice_id": "7a9353ef57c9ae5d19b3a0c6ac50fad05e6d21d31bbe1cd1cd07af6332ba6505", - "root_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "path_symbols": [ - "TraceService.__init__", - "TraceService.store", - "TraceService.close_context" - ], - "path_symbol_ids": [ - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "01e14158dcced7e52d0c8ac84ac7b9a75225c261b6aca6a1d7da802d0994721c" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "TraceService.__init__\n -> TraceService.store\n -> TraceService.open_context", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "TraceService.__init__:dataflow_slice", - "span_start": 42, - "span_end": 78, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "a6e13b9ebc4fed84586afd53ed92a4d14757e440873f572b2337d5622ee96031", - "edge_type": "dataflow_slice", - "src_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "src_qname": "TraceService.__init__", - "dst_symbol_id": "2da3d5b20a947bf63e14c103be4689b72fd837e0a82abd6c497846375d4c7426", - "dst_ref": "TraceService.open_context", - "resolution": "resolved", - "slice_id": "a6e13b9ebc4fed84586afd53ed92a4d14757e440873f572b2337d5622ee96031", - "root_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "path_symbols": [ - "TraceService.__init__", - "TraceService.store", - "TraceService.open_context" - ], - "path_symbol_ids": [ - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "2da3d5b20a947bf63e14c103be4689b72fd837e0a82abd6c497846375d4c7426" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "TraceService.__init__\n -> TraceService.transport\n -> TraceService.__init__", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "TraceService.__init__:dataflow_slice", - "span_start": 41, - "span_end": 43, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "1e923a93faa05c3c43ca9b19bd047007a8589ccce57d3cc1798ae7f9f200af98", - "edge_type": "dataflow_slice", - "src_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "src_qname": "TraceService.__init__", - "dst_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "dst_ref": "TraceService.__init__", - "resolution": "resolved", - "slice_id": "1e923a93faa05c3c43ca9b19bd047007a8589ccce57d3cc1798ae7f9f200af98", - "root_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "path_symbols": [ - "TraceService.__init__", - "TraceService.transport", - "TraceService.__init__" - ], - "path_symbol_ids": [ - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "TraceService.__init__\n -> TraceService.store\n -> TraceService.current_trace_id", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "TraceService.__init__:dataflow_slice", - "span_start": 42, - "span_end": 81, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "3ea17138634b1190bded77ddb84aa1595124f6519b246f24fc4b02bd62b5cac1", - "edge_type": "dataflow_slice", - "src_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "src_qname": "TraceService.__init__", - "dst_symbol_id": "41135180f7b3b9ab20e097e0747474e219c37dd2366ef08a7b43c1f3edb10b4c", - "dst_ref": "TraceService.current_trace_id", - "resolution": "resolved", - "slice_id": "3ea17138634b1190bded77ddb84aa1595124f6519b246f24fc4b02bd62b5cac1", - "root_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "path_symbols": [ - "TraceService.__init__", - "TraceService.store", - "TraceService.current_trace_id" - ], - "path_symbol_ids": [ - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "41135180f7b3b9ab20e097e0747474e219c37dd2366ef08a7b43c1f3edb10b4c" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "TraceService.__init__\n -> TraceService.store\n -> TraceService.step", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "TraceService.__init__:dataflow_slice", - "span_start": 42, - "span_end": 88, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "9f34c5da9b09fba99df6f6b1bde183a9aeb45111b8218a747c71590c2c9f60f2", - "edge_type": "dataflow_slice", - "src_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "src_qname": "TraceService.__init__", - "dst_symbol_id": "c44bfbc66cf747283f30088da3e011a10395031d41e77b74e523c24997f641ca", - "dst_ref": "TraceService.step", - "resolution": "resolved", - "slice_id": "9f34c5da9b09fba99df6f6b1bde183a9aeb45111b8218a747c71590c2c9f60f2", - "root_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "path_symbols": [ - "TraceService.__init__", - "TraceService.store", - "TraceService.step" - ], - "path_symbol_ids": [ - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "c44bfbc66cf747283f30088da3e011a10395031d41e77b74e523c24997f641ca" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "class TraceRecordWriter:\n def __init__(self, transport: TraceTransport) -> None:\n self._logger = logging.getLogger(__name__)\n self._transport = transport\n\n def write_context(self, record: TraceContextRecord) -> None:\n try:\n self._transport.write_context(record)\n except Exception:\n self._logger.exception(\"Trace transport failed to write context %s\", record.trace_id)\n\n def write_message(self, record: TraceLogMessage) -> None:\n try:\n self._transport.write_message(record)\n except Exception:\n self._logger.exception(\"Trace transport failed to write message for %s\", record.trace_id)", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/tracing/service.py:TraceRecordWriter", - "span_start": 21, - "span_end": 36, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.tracing.service", - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "class TraceService(TraceContextFactory):\n def __init__(self, transport: TraceTransport | None = None, store: TraceContextStore | None = None) -> None:\n self.transport = transport or NoOpTraceTransport()\n self.store = store or TraceContextStore()\n self._writer = TraceRecordWriter(self.transport)\n\n def create_context(\n self,\n *,\n alias: str,\n parent_id: str | None = None,\n kind: str | None = None,\n attrs: dict[str, Any] | None = None,\n ) -> str:\n record = TraceContextRecord(\n trace_id=uuid4().hex,\n alias=str(alias or \"\"),\n parent_id=parent_id,\n type=kind,\n event_time=utc_now(),\n attrs=dict(attrs or {}),\n )\n self.store.push(record)\n self._writer.write_context(record)\n return record.trace_id\n\n @contextmanager\n def open_context(\n self,\n *,\n alias: str,\n parent_id: str | None = None,\n kind: str | None = None,\n attrs: dict[str, Any] | None = None,\n ) -> Iterator[str]:\n trace_id = self.create_context(alias=alias, parent_id=parent_id, kind=kind, attrs=attrs)\n try:\n yield trace_id\n finally:\n self.store.pop()\n\n def current_trace_id(self) -> str | None:\n return self.store.current_trace_id()\n\n def close_context(self) -> str | None:\n previous = self.store.pop()\n return previous.record.trace_id if previous else None\n\n def step(self, name: str) -> None:\n self.store.set_step(str(name or \"\"))\n\n def info(self, message: str, *, status: str | None = None, attrs: dict[str, Any] | None = None) -> None:\n self._write_message(\"INFO\", message, status, attrs)\n\n def debug(self, message: str, *, status: str | None = None, attrs: dict[str, Any] | None = None) -> None:\n self._write_message(\"DEBUG\", message, status, attrs)\n\n def warning(self, message: str, *, status: str | None = None, attrs: dict[str, Any] | None = None) -> None:\n self._write_message(\"WARNING\", message, status, attrs)\n\n def error(self, message: str, *, status: str | None = None, attrs: dict[str, Any] | None = None) -> None:\n self._write_message(\"ERROR\", message, status, attrs)\n\n def exception(self, message: str, *, status: str = \"failed\", attrs: dict[str, Any] | None = None) -> None:\n self._write_message(\"ERROR\", message, status, attrs)\n\n def new_root(self, operation: str) -> TraceContext:\n trace_id = self.create_context(alias=operation, kind=\"operation\", attrs={\"operation\": operation})\n return TraceContext(trace_id=trace_id, span_id=trace_id, attributes={\"operation\": operation})\n\n def child_of(self, parent: TraceContext, operation: str) -> TraceContext:\n trace_id = self.create_context(\n alias=operation,\n parent_id=parent.trace_id,\n kind=\"worker\",\n attrs={\"operation\": operation},\n )\n return TraceContext(\n trace_id=trace_id,\n span_id=trace_id,\n parent_span_id=parent.span_id,\n attributes={\"operation\": operation},\n )\n\n def attach(self, metadata: dict[str, object], context: TraceContext) -> dict[str, object]:\n updated = dict(metadata)\n updated[\"trace_id\"] = context.trace_id\n updated[\"span_id\"] = context.span_id\n updated[\"parent_span_id\"] = context.parent_span_id\n return updated\n\n def resume(self, metadata: dict[str, object], operation: str) -> TraceContext:\n trace_id = str(metadata.get(\"trace_id\") or uuid4().hex)\n span_id = str(metadata.get(\"span_id\") or trace_id)\n parent_id = metadata.get(\"parent_span_id\")\n self.create_context(\n alias=operation,\n parent_id=str(parent_id) if parent_id else None,\n kind=\"worker\",\n attrs=dict(metadata),\n )\n return TraceContext(\n trace_id=trace_id,\n span_id=span_id,\n parent_span_id=str(parent_id) if parent_id else None,\n attributes={\"operation\": operation},\n )\n\n def _write_message(\n self,\n level: TraceLevel,\n message: str,\n status: str | None,\n attrs: dict[str, Any] | None,\n ) -> None:\n active = self.store.current()\n if active is None:\n raise RuntimeError(\"Trace context is not bound. Call create_context() first.\")\n record = TraceLogMessage(\n trace_id=active.record.trace_id,\n step=active.step,\n status=str(status or \"\"),\n message=str(message or \"\"),\n level=level,\n event_time=utc_now(),\n attrs=dict(attrs or {}),\n )\n self._writer.write_message(record)", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/tracing/service.py:TraceService", - "span_start": 39, - "span_end": 166, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 1, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.tracing.service", - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "class TraceManager(TraceService):\n \"\"\"Compatibility alias during the transition from ConfigManager-shaped naming.\"\"\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/tracing/service.py:TraceManager", - "span_start": 169, - "span_end": 170, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 2, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.tracing.service", - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "llm_answer": null, - "summary": { - "router": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "confidence": null - }, - "retrieval": { - "profile": "code", - "layers_hit": [ - "C0_SOURCE_CHUNKS", - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS", - "C4_SEMANTIC_ROLES" - ], - "evidence_sufficient": true - }, - "llm": { - "answer_status": "partial", - "groundedness": "not_applicable" - } - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "TraceService" - ], - "keyword_hints": [ - "TraceService" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C0_SOURCE_CHUNKS": "exact_path_fetch", - "C4_SEMANTIC_ROLES": "exact_path_fetch", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C3_ENTRYPOINTS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 8, - "C4_SEMANTIC_ROLES": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C3_ENTRYPOINTS": 6 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C4_SEMANTIC_ROLES": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "TraceService", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Как работает TraceService?", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C4_SEMANTIC_ROLES", - "query": "Как работает TraceService?", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "Как работает TraceService?", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - }, - { - "layer": "C3_ENTRYPOINTS", - "query": "Как работает TraceService?", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 1, - "candidates_after_filter": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 6, - "candidates_after_filter": 6 - }, - { - "layer": "C3_ENTRYPOINTS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 3, - "candidates_after_filter": 3 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "TraceService", - "alternatives": [ - "TraceService" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 3, - "fail_reason": null - }, - { - "layer": "C4_SEMANTIC_ROLES", - "status": "hit", - "hit_count": 8, - "fail_reason": null - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 6, - "fail_reason": null - }, - { - "layer": "C3_ENTRYPOINTS", - "status": "hit", - "hit_count": 3, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "router": 0, - "symbol_resolution": 0, - "retrieval_total": 123, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 38, - "C0_SOURCE_CHUNKS": 15, - "C4_SEMANTIC_ROLES": 13, - "C2_DEPENDENCY_GRAPH": 46, - "C3_ENTRYPOINTS": 8 - }, - "merge_rank": 17, - "prompt_build": 0, - "llm_call": 0 - }, - "prompt": null, - "router": { - "conversation_mode": "START", - "keyword_hints": [ - "TraceService" - ], - "path_scope": [] - }, - "llm": { - "used_evidence_count": 21, - "missing_evidence_reason": null - } - }, - "run_info": { - "case_id": "plba-rag-explain-trace-service", - "mode": "router_rag", - "run_started_at": "2026-03-12T08:48:39", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - }, - "input_request": { - "text": "Как работает TraceService?", - "normalized_query": "Как работает TraceService?" - }, - "steps": [ - { - "step": "intent_router", - "input": { - "query": "Как работает TraceService?" - }, - "output": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Как работает TraceService?" - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "TraceService" - ], - "keyword_hints": [ - "TraceService" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "timings_ms": { - "router": 0 - } - } - }, - { - "step": "retrieval", - "input": { - "query": "Как работает TraceService?" - }, - "output": { - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "TraceService", - "alternatives": [ - "TraceService" - ], - "confidence": 0.99 - }, - "rag_count": 21, - "rag_rows": [ - { - "path": "src/app_runtime/tracing/service.py", - "content": "class TraceService\nTraceService(TraceContextFactory)", - "layer": "C1_SYMBOL_CATALOG", - "title": "TraceService", - "span_start": 39, - "span_end": 166, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "c2b2b976d99f2c600000b753731b26e0a69adcb4359398b93073590c5d5d04f4", - "qname": "TraceService", - "kind": "class", - "signature": "TraceService(TraceContextFactory)", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.tracing.service", - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "TraceService\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests service\n- reads and writes state attributes\n- participates in dataflow slices (13)", - "layer": "C4_SEMANTIC_ROLES", - "title": "TraceService", - "span_start": 39, - "span_end": 166, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 60, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "c2b2b976d99f2c600000b753731b26e0a69adcb4359398b93073590c5d5d04f4", - "symbol_name": "TraceService", - "qname": "TraceService", - "role": "pipeline_stage", - "confidence": 0.57, - "dataflow_participation": 13, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_runner.py", - "content": "UvicornThreadRunner\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (24)", - "layer": "C4_SEMANTIC_ROLES", - "title": "UvicornThreadRunner", - "span_start": 10, - "span_end": 61, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 11, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "fd55630045a02100df8877ac27d951ee08617d4598764394d48cb51fe067476a", - "symbol_name": "UvicornThreadRunner", - "qname": "UvicornThreadRunner", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 24, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "3779fdd2878b770e789a35bb2a89c9d79f13b61c26d7db1b3b683f9bb9e1623f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/persistence/workflow_persistence.py", - "content": "WorkflowPersistence\nrole: pipeline_stage\n\nResponsibilities:\n- orchestrates role-like calls (2)\n- reads and writes state attributes\n- participates in dataflow slices (16)", - "layer": "C4_SEMANTIC_ROLES", - "title": "WorkflowPersistence", - "span_start": 8, - "span_end": 54, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 15, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "7bd01ee45cf31f2d5c2e3e51656254860ac785d10cef9e0852cd4fba90857bae", - "symbol_name": "WorkflowPersistence", - "qname": "WorkflowPersistence", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 16, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "80e9410ddc639789b4353c2a1a757ba8d0d5b5bb6075b0b263b61551f04ae1f0", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (10)", - "layer": "C4_SEMANTIC_ROLES", - "title": "HttpControlChannel", - "span_start": 12, - "span_end": 57, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 21, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "1c9fbdc24819e5604c26ea55428a74310f03a03e1af197ed84846af61e42fdb0", - "symbol_name": "HttpControlChannel", - "qname": "HttpControlChannel", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 10, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/queue/in_memory.py", - "content": "InMemoryTaskQueue\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (9)", - "layer": "C4_SEMANTIC_ROLES", - "title": "InMemoryTaskQueue", - "span_start": 9, - "span_end": 38, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 22, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "2da04cb94544a3bcbf0943a95ad4bdd8710bcafaa32a02fd0e4de2178dcf3533", - "symbol_name": "InMemoryTaskQueue", - "qname": "InMemoryTaskQueue", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 9, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "58f0cc001ccda0eee4c6bc32ed83bd05eafd6b6644f1e8b4aa9eed3103db73dc", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/config/file_loader.py", - "content": "ConfigFileLoader\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (8)", - "layer": "C4_SEMANTIC_ROLES", - "title": "ConfigFileLoader", - "span_start": 11, - "span_end": 48, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 23, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "a8474eca8b6e9dc86ae67ed68b16fa5fb639ef08739c053e7b7195489765667f", - "symbol_name": "ConfigFileLoader", - "qname": "ConfigFileLoader", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 8, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "1f19ffebde5e38e4be5a5d5a678059a0f36dedb8fb8b3e00ab395c67106a87ea", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/store.py", - "content": "TraceContextStore\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (6)", - "layer": "C4_SEMANTIC_ROLES", - "title": "TraceContextStore", - "span_start": 15, - "span_end": 52, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 25, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "b2dad4fbe16ffb11b58deba311c7739955c39d59f291b22181f33e9c8cce4059", - "symbol_name": "TraceContextStore", - "qname": "TraceContextStore", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 6, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "d369554f08fc92039c6edd5a2a1e73b23901533e8974459170bbd9347d263dc5", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workers/supervisor.py", - "content": "WorkerSupervisor\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (6)", - "layer": "C4_SEMANTIC_ROLES", - "title": "WorkerSupervisor", - "span_start": 10, - "span_end": 59, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 25, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "c17b44e8d9e97d490989b21fa67d7c346cdda8a0472e4c41fb243c8846faa124", - "symbol_name": "WorkerSupervisor", - "qname": "WorkerSupervisor", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 6, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "77609d9d5927171cce7fc3a54897c183fd63068710c6362029b700937aae5eee", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "TraceService.__init__\n -> TraceService.store\n -> TraceService.create_context", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "TraceService.__init__:dataflow_slice", - "span_start": 42, - "span_end": 61, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "3b052062067a78aef3302ee1d996897e02a67d1b340397bea4f59fe147c0492a", - "edge_type": "dataflow_slice", - "src_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "src_qname": "TraceService.__init__", - "dst_symbol_id": "ff44881104b65ef50ee6fe16d367d4a81b6e7eb5c44c0963cf4543faec785d4a", - "dst_ref": "TraceService.create_context", - "resolution": "resolved", - "slice_id": "3b052062067a78aef3302ee1d996897e02a67d1b340397bea4f59fe147c0492a", - "root_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "path_symbols": [ - "TraceService.__init__", - "TraceService.store", - "TraceService.create_context" - ], - "path_symbol_ids": [ - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "ff44881104b65ef50ee6fe16d367d4a81b6e7eb5c44c0963cf4543faec785d4a" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "TraceService.__init__\n -> TraceService.store\n -> TraceService.close_context", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "TraceService.__init__:dataflow_slice", - "span_start": 42, - "span_end": 84, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "7a9353ef57c9ae5d19b3a0c6ac50fad05e6d21d31bbe1cd1cd07af6332ba6505", - "edge_type": "dataflow_slice", - "src_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "src_qname": "TraceService.__init__", - "dst_symbol_id": "01e14158dcced7e52d0c8ac84ac7b9a75225c261b6aca6a1d7da802d0994721c", - "dst_ref": "TraceService.close_context", - "resolution": "resolved", - "slice_id": "7a9353ef57c9ae5d19b3a0c6ac50fad05e6d21d31bbe1cd1cd07af6332ba6505", - "root_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "path_symbols": [ - "TraceService.__init__", - "TraceService.store", - "TraceService.close_context" - ], - "path_symbol_ids": [ - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "01e14158dcced7e52d0c8ac84ac7b9a75225c261b6aca6a1d7da802d0994721c" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "TraceService.__init__\n -> TraceService.store\n -> TraceService.open_context", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "TraceService.__init__:dataflow_slice", - "span_start": 42, - "span_end": 78, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "a6e13b9ebc4fed84586afd53ed92a4d14757e440873f572b2337d5622ee96031", - "edge_type": "dataflow_slice", - "src_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "src_qname": "TraceService.__init__", - "dst_symbol_id": "2da3d5b20a947bf63e14c103be4689b72fd837e0a82abd6c497846375d4c7426", - "dst_ref": "TraceService.open_context", - "resolution": "resolved", - "slice_id": "a6e13b9ebc4fed84586afd53ed92a4d14757e440873f572b2337d5622ee96031", - "root_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "path_symbols": [ - "TraceService.__init__", - "TraceService.store", - "TraceService.open_context" - ], - "path_symbol_ids": [ - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "2da3d5b20a947bf63e14c103be4689b72fd837e0a82abd6c497846375d4c7426" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "TraceService.__init__\n -> TraceService.transport\n -> TraceService.__init__", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "TraceService.__init__:dataflow_slice", - "span_start": 41, - "span_end": 43, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "1e923a93faa05c3c43ca9b19bd047007a8589ccce57d3cc1798ae7f9f200af98", - "edge_type": "dataflow_slice", - "src_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "src_qname": "TraceService.__init__", - "dst_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "dst_ref": "TraceService.__init__", - "resolution": "resolved", - "slice_id": "1e923a93faa05c3c43ca9b19bd047007a8589ccce57d3cc1798ae7f9f200af98", - "root_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "path_symbols": [ - "TraceService.__init__", - "TraceService.transport", - "TraceService.__init__" - ], - "path_symbol_ids": [ - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "TraceService.__init__\n -> TraceService.store\n -> TraceService.current_trace_id", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "TraceService.__init__:dataflow_slice", - "span_start": 42, - "span_end": 81, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "3ea17138634b1190bded77ddb84aa1595124f6519b246f24fc4b02bd62b5cac1", - "edge_type": "dataflow_slice", - "src_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "src_qname": "TraceService.__init__", - "dst_symbol_id": "41135180f7b3b9ab20e097e0747474e219c37dd2366ef08a7b43c1f3edb10b4c", - "dst_ref": "TraceService.current_trace_id", - "resolution": "resolved", - "slice_id": "3ea17138634b1190bded77ddb84aa1595124f6519b246f24fc4b02bd62b5cac1", - "root_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "path_symbols": [ - "TraceService.__init__", - "TraceService.store", - "TraceService.current_trace_id" - ], - "path_symbol_ids": [ - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "41135180f7b3b9ab20e097e0747474e219c37dd2366ef08a7b43c1f3edb10b4c" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "TraceService.__init__\n -> TraceService.store\n -> TraceService.step", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "TraceService.__init__:dataflow_slice", - "span_start": 42, - "span_end": 88, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "9f34c5da9b09fba99df6f6b1bde183a9aeb45111b8218a747c71590c2c9f60f2", - "edge_type": "dataflow_slice", - "src_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "src_qname": "TraceService.__init__", - "dst_symbol_id": "c44bfbc66cf747283f30088da3e011a10395031d41e77b74e523c24997f641ca", - "dst_ref": "TraceService.step", - "resolution": "resolved", - "slice_id": "9f34c5da9b09fba99df6f6b1bde183a9aeb45111b8218a747c71590c2c9f60f2", - "root_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "path_symbols": [ - "TraceService.__init__", - "TraceService.store", - "TraceService.step" - ], - "path_symbol_ids": [ - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "c44bfbc66cf747283f30088da3e011a10395031d41e77b74e523c24997f641ca" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "class TraceRecordWriter:\n def __init__(self, transport: TraceTransport) -> None:\n self._logger = logging.getLogger(__name__)\n self._transport = transport\n\n def write_context(self, record: TraceContextRecord) -> None:\n try:\n self._transport.write_context(record)\n except Exception:\n self._logger.exception(\"Trace transport failed to write context %s\", record.trace_id)\n\n def write_message(self, record: TraceLogMessage) -> None:\n try:\n self._transport.write_message(record)\n except Exception:\n self._logger.exception(\"Trace transport failed to write message for %s\", record.trace_id)", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/tracing/service.py:TraceRecordWriter", - "span_start": 21, - "span_end": 36, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.tracing.service", - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "class TraceService(TraceContextFactory):\n def __init__(self, transport: TraceTransport | None = None, store: TraceContextStore | None = None) -> None:\n self.transport = transport or NoOpTraceTransport()\n self.store = store or TraceContextStore()\n self._writer = TraceRecordWriter(self.transport)\n\n def create_context(\n self,\n *,\n alias: str,\n parent_id: str | None = None,\n kind: str | None = None,\n attrs: dict[str, Any] | None = None,\n ) -> str:\n record = TraceContextRecord(\n trace_id=uuid4().hex,\n alias=str(alias or \"\"),\n parent_id=parent_id,\n type=kind,\n event_time=utc_now(),\n attrs=dict(attrs or {}),\n )\n self.store.push(record)\n self._writer.write_context(record)\n return record.trace_id\n\n @contextmanager\n def open_context(\n self,\n *,\n alias: str,\n parent_id: str | None = None,\n kind: str | None = None,\n attrs: dict[str, Any] | None = None,\n ) -> Iterator[str]:\n trace_id = self.create_context(alias=alias, parent_id=parent_id, kind=kind, attrs=attrs)\n try:\n yield trace_id\n finally:\n self.store.pop()\n\n def current_trace_id(self) -> str | None:\n return self.store.current_trace_id()\n\n def close_context(self) -> str | None:\n previous = self.store.pop()\n return previous.record.trace_id if previous else None\n\n def step(self, name: str) -> None:\n self.store.set_step(str(name or \"\"))\n\n def info(self, message: str, *, status: str | None = None, attrs: dict[str, Any] | None = None) -> None:\n self._write_message(\"INFO\", message, status, attrs)\n\n def debug(self, message: str, *, status: str | None = None, attrs: dict[str, Any] | None = None) -> None:\n self._write_message(\"DEBUG\", message, status, attrs)\n\n def warning(self, message: str, *, status: str | None = None, attrs: dict[str, Any] | None = None) -> None:\n self._write_message(\"WARNING\", message, status, attrs)\n\n def error(self, message: str, *, status: str | None = None, attrs: dict[str, Any] | None = None) -> None:\n self._write_message(\"ERROR\", message, status, attrs)\n\n def exception(self, message: str, *, status: str = \"failed\", attrs: dict[str, Any] | None = None) -> None:\n self._write_message(\"ERROR\", message, status, attrs)\n\n def new_root(self, operation: str) -> TraceContext:\n trace_id = self.create_context(alias=operation, kind=\"operation\", attrs={\"operation\": operation})\n return TraceContext(trace_id=trace_id, span_id=trace_id, attributes={\"operation\": operation})\n\n def child_of(self, parent: TraceContext, operation: str) -> TraceContext:\n trace_id = self.create_context(\n alias=operation,\n parent_id=parent.trace_id,\n kind=\"worker\",\n attrs={\"operation\": operation},\n )\n return TraceContext(\n trace_id=trace_id,\n span_id=trace_id,\n parent_span_id=parent.span_id,\n attributes={\"operation\": operation},\n )\n\n def attach(self, metadata: dict[str, object], context: TraceContext) -> dict[str, object]:\n updated = dict(metadata)\n updated[\"trace_id\"] = context.trace_id\n updated[\"span_id\"] = context.span_id\n updated[\"parent_span_id\"] = context.parent_span_id\n return updated\n\n def resume(self, metadata: dict[str, object], operation: str) -> TraceContext:\n trace_id = str(metadata.get(\"trace_id\") or uuid4().hex)\n span_id = str(metadata.get(\"span_id\") or trace_id)\n parent_id = metadata.get(\"parent_span_id\")\n self.create_context(\n alias=operation,\n parent_id=str(parent_id) if parent_id else None,\n kind=\"worker\",\n attrs=dict(metadata),\n )\n return TraceContext(\n trace_id=trace_id,\n span_id=span_id,\n parent_span_id=str(parent_id) if parent_id else None,\n attributes={\"operation\": operation},\n )\n\n def _write_message(\n self,\n level: TraceLevel,\n message: str,\n status: str | None,\n attrs: dict[str, Any] | None,\n ) -> None:\n active = self.store.current()\n if active is None:\n raise RuntimeError(\"Trace context is not bound. Call create_context() first.\")\n record = TraceLogMessage(\n trace_id=active.record.trace_id,\n step=active.step,\n status=str(status or \"\"),\n message=str(message or \"\"),\n level=level,\n event_time=utc_now(),\n attrs=dict(attrs or {}),\n )\n self._writer.write_message(record)", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/tracing/service.py:TraceService", - "span_start": 39, - "span_end": 166, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 1, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.tracing.service", - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "class TraceManager(TraceService):\n \"\"\"Compatibility alias during the transition from ConfigManager-shaped naming.\"\"\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/tracing/service.py:TraceManager", - "span_start": 169, - "span_end": 170, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 2, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.tracing.service", - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ] - }, - "diagnostics": { - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C0_SOURCE_CHUNKS": "exact_path_fetch", - "C4_SEMANTIC_ROLES": "exact_path_fetch", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C3_ENTRYPOINTS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 8, - "C4_SEMANTIC_ROLES": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C3_ENTRYPOINTS": 6 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C4_SEMANTIC_ROLES": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "TraceService", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Как работает TraceService?", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C4_SEMANTIC_ROLES", - "query": "Как работает TraceService?", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "Как работает TraceService?", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - }, - { - "layer": "C3_ENTRYPOINTS", - "query": "Как работает TraceService?", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 1, - "candidates_after_filter": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 6, - "candidates_after_filter": 6 - }, - { - "layer": "C3_ENTRYPOINTS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 3, - "candidates_after_filter": 3 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "TraceService", - "alternatives": [ - "TraceService" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 3, - "fail_reason": null - }, - { - "layer": "C4_SEMANTIC_ROLES", - "status": "hit", - "hit_count": 8, - "fail_reason": null - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 6, - "fail_reason": null - }, - { - "layer": "C3_ENTRYPOINTS", - "status": "hit", - "hit_count": 3, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "symbol_resolution": 0, - "retrieval_total": 123, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 38, - "C0_SOURCE_CHUNKS": 15, - "C4_SEMANTIC_ROLES": 13, - "C2_DEPENDENCY_GRAPH": 46, - "C3_ENTRYPOINTS": 8 - }, - "merge_rank": 17 - } - } - } - ] - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_router_rag/20260312_084838/router_rag_plba_code_retrieval_plba-rag-explain-trace-service.md b/tests/pipeline_setup_v2/test_results/plba_router_rag/20260312_084838/router_rag_plba_code_retrieval_plba-rag-explain-trace-service.md deleted file mode 100644 index 7e7f53f..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_router_rag/20260312_084838/router_rag_plba_code_retrieval_plba-rag-explain-trace-service.md +++ /dev/null @@ -1,34 +0,0 @@ -# plba-rag-explain-trace-service - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/router_rag_plba_code_retrieval.yaml -- runner: runtime -- mode: router_rag -- passed: True - -## Query -Как работает TraceService? - -## Actual -{ - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 21, - "llm_answer": "", - "answer_mode": "partial", - "path_scope": [], - "symbol_candidates": [ - "TraceService" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] -} - -## Mismatches -- none \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_router_rag/20260312_084838/router_rag_plba_code_retrieval_plba-rag-find-entrypoints.json b/tests/pipeline_setup_v2/test_results/plba_router_rag/20260312_084838/router_rag_plba_code_retrieval_plba-rag-find-entrypoints.json deleted file mode 100644 index d1c4a7f..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_router_rag/20260312_084838/router_rag_plba_code_retrieval_plba-rag-find-entrypoints.json +++ /dev/null @@ -1,1139 +0,0 @@ -{ - "case_id": "plba-rag-find-entrypoints", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/router_rag_plba_code_retrieval.yaml", - "runner": "runtime", - "mode": "router_rag", - "actual": { - "intent": "CODE_QA", - "sub_intent": "FIND_ENTRYPOINTS", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 9, - "llm_answer": "", - "answer_mode": "partial", - "path_scope": [], - "symbol_candidates": [], - "layers": [ - "C3_ENTRYPOINTS", - "C0_SOURCE_CHUNKS" - ] - }, - "passed": true, - "mismatches": [], - "details": { - "case_id": "plba-rag-find-entrypoints", - "text": "Найди точки входа в коде", - "mode": "router_rag", - "run_started_at": "2026-03-12T08:48:39", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Найди точки входа в коде", - "symbol_resolution": { - "status": "not_requested", - "resolved_symbol": null, - "alternatives": [], - "confidence": 0.0 - }, - "rag_count": 9, - "rag_rows": [ - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/contracts/result.py", - "content": "class StepResult:\n transition: str = \"success\"\n updates: dict[str, Any] = field(default_factory=dict)\n status: str = \"completed\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/workflow/contracts/result.py:StepResult", - "span_start": 8, - "span_end": 11, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.workflow.contracts.result", - "is_test": false, - "blob_sha": "6e57dbfe22873f097f11228a26cffa415440a43b68a737b220906461cd86c353", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/config/__init__.py", - "content": "from app_runtime.config.file_loader import ConfigFileLoader\nfrom app_runtime.config.providers import FileConfigProvider\n\n__all__ = [\"ConfigFileLoader\", \"FileConfigProvider\"]", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/config/__init__.py:1-4", - "span_start": 1, - "span_end": 4, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.app_runtime.config.__init__", - "is_test": false, - "blob_sha": "612918029820a2a983330ec92256142b55b9de4bdf3399ece18e2a02dbad9729", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/__init__.py", - "content": "__all__: list[str] = []", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/__init__.py:1-1", - "span_start": 1, - "span_end": 1, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.app_runtime.__init__", - "is_test": false, - "blob_sha": "8eea9df4f6d7b38ca0e39ccc27b04700e3d08dbeec8046d613d22706d19985fa", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/config/file_loader.py", - "content": "class ConfigFileLoader:\n def __init__(self, path: str | Path) -> None:\n self.path = Path(path)\n self.config: Any = None\n self.last_valid_config: Any = None\n self._last_seen_hash: str | None = None\n\n def read_text(self) -> str:\n return self.path.read_text(encoding=\"utf-8\")\n\n def parse(self, data: str) -> Any:\n suffix = self.path.suffix.lower()\n if suffix in {\".yml\", \".yaml\"}:\n return yaml.safe_load(data)\n return json.loads(data)\n\n def load_sync(self) -> Any:\n data = self.read_text()\n parsed = self.parse(data)\n self.config = parsed\n self.last_valid_config = parsed\n self._last_seen_hash = self._calculate_hash(data)\n return parsed\n\n def load_if_changed(self) -> tuple[bool, Any]:\n data = self.read_text()\n current_hash = self._calculate_hash(data)\n if current_hash == self._last_seen_hash:\n return False, self.config\n parsed = self.parse(data)\n self.config = parsed\n self.last_valid_config = parsed\n self._last_seen_hash = current_hash\n return True, parsed\n\n @staticmethod\n def _calculate_hash(data: str) -> str:\n return hashlib.sha256(data.encode(\"utf-8\")).hexdigest()", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/config/file_loader.py:ConfigFileLoader", - "span_start": 11, - "span_end": 48, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.config.file_loader", - "is_test": false, - "blob_sha": "1f19ffebde5e38e4be5a5d5a678059a0f36dedb8fb8b3e00ab395c67106a87ea", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/config/providers.py", - "content": "class FileConfigProvider(ConfigProvider):\n def __init__(self, path: str | Path) -> None:\n self._loader = ConfigFileLoader(path)\n\n @property\n def loader(self) -> ConfigFileLoader:\n return self._loader\n\n def load(self) -> dict[str, Any]:\n config = self._loader.load_sync()\n if not isinstance(config, dict):\n raise TypeError(\"Config root must be a mapping\")\n return dict(config)", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/config/providers.py:FileConfigProvider", - "span_start": 10, - "span_end": 22, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.config.providers", - "is_test": false, - "blob_sha": "8c53ca0122d6df6c5763bca15e99434bb4daebd5a618b8fc927e9ae90b022e64", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "class ControlActionSet:\n health: HealthHandler\n start: ActionHandler\n stop: ActionHandler\n status: ActionHandler", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/base.py:ControlActionSet", - "span_start": 14, - "span_end": 18, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.base", - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "llm_answer": null, - "summary": { - "router": { - "intent": "CODE_QA", - "sub_intent": "FIND_ENTRYPOINTS", - "confidence": null - }, - "retrieval": { - "profile": "code", - "layers_hit": [ - "C0_SOURCE_CHUNKS", - "C3_ENTRYPOINTS" - ], - "evidence_sufficient": true - }, - "llm": { - "answer_status": "partial", - "groundedness": "not_applicable" - } - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "FIND_ENTRYPOINTS", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C3_ENTRYPOINTS", - "C0_SOURCE_CHUNKS" - ], - "symbol_kind_hint": "unknown", - "symbol_candidates": [], - "keyword_hints": [], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "execution": { - "executed_layers": [ - "C3_ENTRYPOINTS", - "C0_SOURCE_CHUNKS" - ], - "retrieval_mode_by_layer": { - "C3_ENTRYPOINTS": "exact_path_fetch", - "C0_SOURCE_CHUNKS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C3_ENTRYPOINTS": 12, - "C0_SOURCE_CHUNKS": 6 - }, - "filters_by_layer": { - "C3_ENTRYPOINTS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C3_ENTRYPOINTS", - "query": "Найди точки входа в коде", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 12, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Найди точки входа в коде", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C3_ENTRYPOINTS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 3, - "candidates_after_filter": 3 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 6, - "candidates_after_filter": 6 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "not_requested", - "resolved_symbol": null, - "alternatives": [] - }, - "layers": [ - { - "layer": "C3_ENTRYPOINTS", - "status": "hit", - "hit_count": 3, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 6, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "router": 0, - "symbol_resolution": 0, - "retrieval_total": 18, - "retrieval_by_layer": { - "C3_ENTRYPOINTS": 8, - "C0_SOURCE_CHUNKS": 9 - }, - "merge_rank": 0, - "prompt_build": 0, - "llm_call": 0 - }, - "prompt": null, - "router": { - "conversation_mode": "START", - "keyword_hints": [], - "path_scope": [] - }, - "llm": { - "used_evidence_count": 9, - "missing_evidence_reason": null - } - }, - "run_info": { - "case_id": "plba-rag-find-entrypoints", - "mode": "router_rag", - "run_started_at": "2026-03-12T08:48:39", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - }, - "input_request": { - "text": "Найди точки входа в коде", - "normalized_query": "Найди точки входа в коде" - }, - "steps": [ - { - "step": "intent_router", - "input": { - "query": "Найди точки входа в коде" - }, - "output": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Найди точки входа в коде" - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "FIND_ENTRYPOINTS", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C3_ENTRYPOINTS", - "C0_SOURCE_CHUNKS" - ], - "symbol_kind_hint": "unknown", - "symbol_candidates": [], - "keyword_hints": [], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "timings_ms": { - "router": 0 - } - } - }, - { - "step": "retrieval", - "input": { - "query": "Найди точки входа в коде" - }, - "output": { - "symbol_resolution": { - "status": "not_requested", - "resolved_symbol": null, - "alternatives": [], - "confidence": 0.0 - }, - "rag_count": 9, - "rag_rows": [ - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/contracts/result.py", - "content": "class StepResult:\n transition: str = \"success\"\n updates: dict[str, Any] = field(default_factory=dict)\n status: str = \"completed\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/workflow/contracts/result.py:StepResult", - "span_start": 8, - "span_end": 11, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.workflow.contracts.result", - "is_test": false, - "blob_sha": "6e57dbfe22873f097f11228a26cffa415440a43b68a737b220906461cd86c353", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/config/__init__.py", - "content": "from app_runtime.config.file_loader import ConfigFileLoader\nfrom app_runtime.config.providers import FileConfigProvider\n\n__all__ = [\"ConfigFileLoader\", \"FileConfigProvider\"]", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/config/__init__.py:1-4", - "span_start": 1, - "span_end": 4, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.app_runtime.config.__init__", - "is_test": false, - "blob_sha": "612918029820a2a983330ec92256142b55b9de4bdf3399ece18e2a02dbad9729", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/__init__.py", - "content": "__all__: list[str] = []", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/__init__.py:1-1", - "span_start": 1, - "span_end": 1, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.app_runtime.__init__", - "is_test": false, - "blob_sha": "8eea9df4f6d7b38ca0e39ccc27b04700e3d08dbeec8046d613d22706d19985fa", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/config/file_loader.py", - "content": "class ConfigFileLoader:\n def __init__(self, path: str | Path) -> None:\n self.path = Path(path)\n self.config: Any = None\n self.last_valid_config: Any = None\n self._last_seen_hash: str | None = None\n\n def read_text(self) -> str:\n return self.path.read_text(encoding=\"utf-8\")\n\n def parse(self, data: str) -> Any:\n suffix = self.path.suffix.lower()\n if suffix in {\".yml\", \".yaml\"}:\n return yaml.safe_load(data)\n return json.loads(data)\n\n def load_sync(self) -> Any:\n data = self.read_text()\n parsed = self.parse(data)\n self.config = parsed\n self.last_valid_config = parsed\n self._last_seen_hash = self._calculate_hash(data)\n return parsed\n\n def load_if_changed(self) -> tuple[bool, Any]:\n data = self.read_text()\n current_hash = self._calculate_hash(data)\n if current_hash == self._last_seen_hash:\n return False, self.config\n parsed = self.parse(data)\n self.config = parsed\n self.last_valid_config = parsed\n self._last_seen_hash = current_hash\n return True, parsed\n\n @staticmethod\n def _calculate_hash(data: str) -> str:\n return hashlib.sha256(data.encode(\"utf-8\")).hexdigest()", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/config/file_loader.py:ConfigFileLoader", - "span_start": 11, - "span_end": 48, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.config.file_loader", - "is_test": false, - "blob_sha": "1f19ffebde5e38e4be5a5d5a678059a0f36dedb8fb8b3e00ab395c67106a87ea", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/config/providers.py", - "content": "class FileConfigProvider(ConfigProvider):\n def __init__(self, path: str | Path) -> None:\n self._loader = ConfigFileLoader(path)\n\n @property\n def loader(self) -> ConfigFileLoader:\n return self._loader\n\n def load(self) -> dict[str, Any]:\n config = self._loader.load_sync()\n if not isinstance(config, dict):\n raise TypeError(\"Config root must be a mapping\")\n return dict(config)", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/config/providers.py:FileConfigProvider", - "span_start": 10, - "span_end": 22, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.config.providers", - "is_test": false, - "blob_sha": "8c53ca0122d6df6c5763bca15e99434bb4daebd5a618b8fc927e9ae90b022e64", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "class ControlActionSet:\n health: HealthHandler\n start: ActionHandler\n stop: ActionHandler\n status: ActionHandler", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/base.py:ControlActionSet", - "span_start": 14, - "span_end": 18, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.base", - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ] - }, - "diagnostics": { - "execution": { - "executed_layers": [ - "C3_ENTRYPOINTS", - "C0_SOURCE_CHUNKS" - ], - "retrieval_mode_by_layer": { - "C3_ENTRYPOINTS": "exact_path_fetch", - "C0_SOURCE_CHUNKS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C3_ENTRYPOINTS": 12, - "C0_SOURCE_CHUNKS": 6 - }, - "filters_by_layer": { - "C3_ENTRYPOINTS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C3_ENTRYPOINTS", - "query": "Найди точки входа в коде", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 12, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Найди точки входа в коде", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C3_ENTRYPOINTS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 3, - "candidates_after_filter": 3 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 6, - "candidates_after_filter": 6 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "not_requested", - "resolved_symbol": null, - "alternatives": [] - }, - "layers": [ - { - "layer": "C3_ENTRYPOINTS", - "status": "hit", - "hit_count": 3, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 6, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "symbol_resolution": 0, - "retrieval_total": 18, - "retrieval_by_layer": { - "C3_ENTRYPOINTS": 8, - "C0_SOURCE_CHUNKS": 9 - }, - "merge_rank": 0 - } - } - } - ] - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_router_rag/20260312_084838/router_rag_plba_code_retrieval_plba-rag-find-entrypoints.md b/tests/pipeline_setup_v2/test_results/plba_router_rag/20260312_084838/router_rag_plba_code_retrieval_plba-rag-find-entrypoints.md deleted file mode 100644 index fa2a4bb..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_router_rag/20260312_084838/router_rag_plba_code_retrieval_plba-rag-find-entrypoints.md +++ /dev/null @@ -1,29 +0,0 @@ -# plba-rag-find-entrypoints - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/router_rag_plba_code_retrieval.yaml -- runner: runtime -- mode: router_rag -- passed: True - -## Query -Найди точки входа в коде - -## Actual -{ - "intent": "CODE_QA", - "sub_intent": "FIND_ENTRYPOINTS", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 9, - "llm_answer": "", - "answer_mode": "partial", - "path_scope": [], - "symbol_candidates": [], - "layers": [ - "C3_ENTRYPOINTS", - "C0_SOURCE_CHUNKS" - ] -} - -## Mismatches -- none \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_router_rag/20260312_084838/router_rag_plba_code_retrieval_plba-rag-find-tests-http-control-channel.json b/tests/pipeline_setup_v2/test_results/plba_router_rag/20260312_084838/router_rag_plba_code_retrieval_plba-rag-find-tests-http-control-channel.json deleted file mode 100644 index d208bbe..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_router_rag/20260312_084838/router_rag_plba_code_retrieval_plba-rag-find-tests-http-control-channel.json +++ /dev/null @@ -1,1738 +0,0 @@ -{ - "case_id": "plba-rag-find-tests-http-control-channel", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/router_rag_plba_code_retrieval.yaml", - "runner": "runtime", - "mode": "router_rag", - "actual": { - "intent": "CODE_QA", - "sub_intent": "FIND_TESTS", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 16, - "llm_answer": "", - "answer_mode": "partial", - "path_scope": [], - "symbol_candidates": [ - "HttpControlChannel" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ] - }, - "passed": true, - "mismatches": [], - "details": { - "case_id": "plba-rag-find-tests-http-control-channel", - "text": "Найди тесты для HttpControlChannel", - "mode": "router_rag", - "run_started_at": "2026-03-12T08:48:39", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Найди тесты для HttpControlChannel", - "symbol_resolution": { - "status": "not_found", - "resolved_symbol": null, - "alternatives": [ - "HttpControlChannel" - ], - "confidence": 0.0 - }, - "rag_count": 16, - "rag_rows": [ - { - "path": "tests/test_runtime.py", - "content": "test_http_control_channel_exposes_health_and_actions reads_attr asyncio.run", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_http_control_channel_exposes_health_and_actions:reads_attr", - "span_start": 339, - "span_end": 339, - "lexical_rank": 4, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "8cc58b96c744ee7cf7d1a8ad7bb92a891a43107869065c004a1a3ce0dd490a6b", - "edge_type": "reads_attr", - "src_symbol_id": "a5f91bbdc86d497cf0b20a6c10caf97bee5148eae96d13c175399533be193291", - "src_qname": "test_http_control_channel_exposes_health_and_actions", - "dst_symbol_id": null, - "dst_ref": "asyncio.run", - "resolution": "partial", - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_runtime.py", - "content": "test_http_control_channel_exposes_health_and_actions calls channel.start", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_http_control_channel_exposes_health_and_actions:calls", - "span_start": 318, - "span_end": 325, - "lexical_rank": 4, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "3f96da44a1e918ac0c2bf7a4a847deced1acc5dfe285d888e8f5d1f6c1716c04", - "edge_type": "calls", - "src_symbol_id": "a5f91bbdc86d497cf0b20a6c10caf97bee5148eae96d13c175399533be193291", - "src_qname": "test_http_control_channel_exposes_health_and_actions", - "dst_symbol_id": null, - "dst_ref": "channel.start", - "resolution": "partial", - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_runtime.py", - "content": "test_http_control_channel_exposes_health_and_actions calls asyncio.run", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_http_control_channel_exposes_health_and_actions:calls", - "span_start": 339, - "span_end": 339, - "lexical_rank": 4, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "91fb36608973c49de1ebe925be4cfbf215788cbb472a85de8c749572fbc1348e", - "edge_type": "calls", - "src_symbol_id": "a5f91bbdc86d497cf0b20a6c10caf97bee5148eae96d13c175399533be193291", - "src_qname": "test_http_control_channel_exposes_health_and_actions", - "dst_symbol_id": null, - "dst_ref": "asyncio.run", - "resolution": "partial", - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_runtime.py", - "content": "test_http_control_channel_exposes_health_and_actions instantiates HttpControlChannel", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_http_control_channel_exposes_health_and_actions:instantiates", - "span_start": 317, - "span_end": 317, - "lexical_rank": 4, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "da9945affedec9dad344f9fede71b834f44c79992678439b144d0a10bcf52efa", - "edge_type": "instantiates", - "src_symbol_id": "a5f91bbdc86d497cf0b20a6c10caf97bee5148eae96d13c175399533be193291", - "src_qname": "test_http_control_channel_exposes_health_and_actions", - "dst_symbol_id": null, - "dst_ref": "HttpControlChannel", - "resolution": "partial", - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_runtime.py", - "content": "test_http_control_channel_exposes_health_and_actions calls scenario", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_http_control_channel_exposes_health_and_actions:calls", - "span_start": 339, - "span_end": 339, - "lexical_rank": 4, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "4820478ea2620cc3f71ba0143219550671279e5e0d642bd7fb2458259a9cf4fd", - "edge_type": "calls", - "src_symbol_id": "a5f91bbdc86d497cf0b20a6c10caf97bee5148eae96d13c175399533be193291", - "src_qname": "test_http_control_channel_exposes_health_and_actions", - "dst_symbol_id": null, - "dst_ref": "scenario", - "resolution": "partial", - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_runtime.py", - "content": "test_http_control_channel_exposes_health_and_actions calls channel._action_response", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_http_control_channel_exposes_health_and_actions:calls", - "span_start": 327, - "span_end": 327, - "lexical_rank": 4, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "1a5f8d1e30343961f5e934d1fd6c5f464d27dbd09ad89b9f3240d78f5cdea464", - "edge_type": "calls", - "src_symbol_id": "a5f91bbdc86d497cf0b20a6c10caf97bee5148eae96d13c175399533be193291", - "src_qname": "test_http_control_channel_exposes_health_and_actions", - "dst_symbol_id": null, - "dst_ref": "channel._action_response", - "resolution": "partial", - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "def _build_runtime(worker: Worker, *, control_timeout: int = 1) -> tuple[RuntimeManager, str]:\n runtime = RuntimeManager()\n channel = HttpControlChannel(host=\"127.0.0.1\", port=0, timeout=control_timeout)\n runtime.control_plane.register_channel(channel)\n runtime.register_module(WorkerModule(worker))\n runtime.start()\n return runtime, f\"http://127.0.0.1:{channel.port}\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:_build_runtime", - "span_start": 154, - "span_end": 160, - "lexical_rank": 5, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 6, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "def test_actions_start_stop_and_health_when_worker_is_idle() -> None:\n runtime, base_url = _build_runtime(ScenarioWorker(\"idle-worker\", IntervalRoutine(), interval=0.2))\n try:\n stop_status, stop_payload = _http_call_json(base_url, \"/actions/stop\", method=\"POST\")\n assert stop_status == 200\n assert isinstance(stop_payload.get(\"detail\"), dict)\n assert stop_payload[\"detail\"][\"timed_out\"] is False\n assert stop_payload[\"detail\"][\"state\"] == \"stopped\"\n\n health_stopped_status, health_stopped_payload = _http_call_json(base_url, \"/health\")\n assert health_stopped_status == 503\n assert health_stopped_payload[\"state\"] == \"stopped\"\n assert health_stopped_payload[\"status\"] == \"unhealthy\"\n\n start_status, start_payload = _http_call_json(base_url, \"/actions/start\", method=\"POST\")\n assert start_status == 200\n assert isinstance(start_payload.get(\"detail\"), dict)\n assert start_payload[\"detail\"][\"timed_out\"] is False\n assert start_payload[\"detail\"][\"state\"] in {\"idle\", \"busy\"}\n\n health_started_status, health_started_payload = _http_call_json(base_url, \"/health\")\n assert health_started_status == 200\n assert health_started_payload[\"status\"] == \"ok\"\n assert health_started_payload[\"state\"] in {\"idle\", \"busy\"}\n finally:\n runtime.stop()", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:test_actions_start_stop_and_health_when_worker_is_idle", - "span_start": 181, - "span_end": 206, - "lexical_rank": 5, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 8, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "class WorkerModule(ApplicationModule):\n def __init__(self, worker: Worker) -> None:\n self._worker = worker\n\n @property\n def name(self) -> str:\n return \"business-tests\"\n\n def register(self, registry: ModuleRegistry) -> None:\n registry.add_worker(self._worker)", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:WorkerModule", - "span_start": 113, - "span_end": 122, - "lexical_rank": 5, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 3, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "def _poll_until_stopped(base_url: str, timeout: float = 2.0) -> bool:\n deadline = monotonic() + timeout\n while monotonic() < deadline:\n _, payload = _http_call_json(base_url, \"/actions/status\")\n if payload.get(\"detail\") == \"stopped\":\n return True\n sleep(0.05)\n return False", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:_poll_until_stopped", - "span_start": 144, - "span_end": 151, - "lexical_rank": 5, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 5, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "class IntervalRoutine:\n calls: list[float] = field(default_factory=list)\n _lock: Lock = field(default_factory=Lock)\n\n def run(self) -> None:\n with self._lock:\n self.calls.append(monotonic())\n\n def wait_runs(self, count: int, timeout: float) -> bool:\n deadline = monotonic() + timeout\n while monotonic() < deadline:\n with self._lock:\n if len(self.calls) >= count:\n return True\n sleep(0.01)\n return False\n\n def deltas(self) -> list[float]:\n with self._lock:\n return [self.calls[index + 1] - self.calls[index] for index in range(len(self.calls) - 1)]", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:IntervalRoutine", - "span_start": 18, - "span_end": 37, - "lexical_rank": 5, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "def test_worker_wakes_up_with_configured_interval() -> None:\n interval = 0.15\n routine = IntervalRoutine()\n worker = ScenarioWorker(\"interval-worker\", routine, interval=interval)\n runtime = RuntimeManager()\n runtime.register_module(WorkerModule(worker))\n\n runtime.start()\n try:\n assert routine.wait_runs(count=3, timeout=2.0) is True\n finally:\n runtime.stop()\n\n deltas = routine.deltas()\n assert len(deltas) >= 2\n assert all(delta >= interval * 0.7 for delta in deltas[:2])", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:test_worker_wakes_up_with_configured_interval", - "span_start": 163, - "span_end": 178, - "lexical_rank": 5, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 7, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "class BlockingRoutine:\n def __init__(self, started: Event, release: Event) -> None:\n self._started = started\n self._release = release\n\n def run(self) -> None:\n self._started.set()\n self._release.wait(timeout=5.0)", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:BlockingRoutine", - "span_start": 40, - "span_end": 47, - "lexical_rank": 5, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 1, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "class ScenarioWorker(Worker):\n def __init__(self, name: str, routine: object, *, interval: float = 0.05) -> None:\n self._name = name\n self._routine = routine\n self._interval = interval\n self._thread: Thread | None = None\n self._stop_requested = Event()\n self._in_flight = 0\n self._runs = 0\n self._lock = Lock()\n\n @property\n def name(self) -> str:\n return self._name\n\n @property\n def critical(self) -> bool:\n return True\n\n def start(self) -> None:\n if self._thread is not None and self._thread.is_alive():\n return\n self._stop_requested.clear()\n self._thread = Thread(target=self._loop, name=f\"{self._name}-thread\", daemon=True)\n self._thread.start()\n\n def stop(self, force: bool = False) -> None:\n self._stop_requested.set()\n\n def health(self) -> WorkerHealth:\n return WorkerHealth(name=self.name, status=\"ok\", critical=True, meta={\"runs\": self._runs})\n\n def status(self) -> WorkerStatus:\n thread_alive = self._thread is not None and self._thread.is_alive()\n with self._lock:\n in_flight = self._in_flight\n runs = self._runs\n if not thread_alive:\n state = \"stopped\"\n elif self._stop_requested.is_set():\n state = \"stopping\"\n elif in_flight > 0:\n state = \"busy\"\n else:\n state = \"idle\"\n return WorkerStatus(name=self.name, state=state, in_flight=in_flight, meta={\"runs\": runs})\n\n def _loop(self) -> None:\n while not self._stop_requested.is_set():\n with self._lock:\n self._in_flight += 1\n try:\n self._routine.run()\n with self._lock:\n self._runs += 1\n finally:\n with self._lock:\n self._in_flight -= 1\n if self._stop_requested.is_set():\n return\n sleep(self._interval)", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:ScenarioWorker", - "span_start": 50, - "span_end": 110, - "lexical_rank": 5, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 2, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "def _http_call_json(\n base_url: str,\n path: str,\n *,\n method: str = \"GET\",\n headers: dict[str, str] | None = None,\n) -> tuple[int, dict[str, object]]:\n request = Request(f\"{base_url}{path}\", method=method, headers=headers or {})\n try:\n with urlopen(request, timeout=15.0) as response:\n status = response.status\n body = response.read()\n except HTTPError as error:\n status = error.code\n body = error.read()\n payload = json.loads(body.decode(\"utf-8\"))\n return status, payload", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:_http_call_json", - "span_start": 125, - "span_end": 141, - "lexical_rank": 5, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 4, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "def test_actions_stop_busy_worker_before_timeout() -> None:\n started = Event()\n release = Event()\n runtime, base_url = _build_runtime(ScenarioWorker(\"busy-worker\", BlockingRoutine(started, release)))\n assert started.wait(timeout=1.0) is True\n\n def release_later() -> None:\n sleep(0.2)\n release.set()\n\n Thread(target=release_later, daemon=True).start()\n try:\n status, payload = _http_call_json(base_url, \"/actions/stop\", method=\"POST\")\n assert status == 200\n assert isinstance(payload.get(\"detail\"), dict)\n assert payload[\"detail\"][\"timed_out\"] is False\n assert payload[\"detail\"][\"state\"] == \"stopped\"\n\n health_status, health_payload = _http_call_json(base_url, \"/health\")\n assert health_status == 503\n assert health_payload[\"status\"] == \"unhealthy\"\n assert health_payload[\"state\"] == \"stopped\"\n finally:\n runtime.stop()", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:test_actions_stop_busy_worker_before_timeout", - "span_start": 209, - "span_end": 232, - "lexical_rank": 5, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 9, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "llm_answer": null, - "summary": { - "router": { - "intent": "CODE_QA", - "sub_intent": "FIND_TESTS", - "confidence": null - }, - "retrieval": { - "profile": "code", - "layers_hit": [ - "C0_SOURCE_CHUNKS", - "C2_DEPENDENCY_GRAPH" - ], - "evidence_sufficient": true - }, - "llm": { - "answer_status": "partial", - "groundedness": "not_applicable" - } - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "FIND_TESTS", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "HttpControlChannel" - ], - "keyword_hints": [ - "HttpControlChannel" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**", - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "test_file_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "test_symbol_patterns": [ - "test_http_control_channel", - "TestHttpControlChannel", - "HttpControlChannel" - ], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C0_SOURCE_CHUNKS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C0_SOURCE_CHUNKS": 10 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [], - "include_globs": [ - "src", - "tests" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests" - ] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src", - "tests" - ], - "include_globs": [ - "src", - "tests" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests" - ] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src", - "tests" - ], - "include_globs": [ - "src", - "tests" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests" - ] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "HttpControlChannel", - "path_scope": [], - "include_globs": [ - "src/**", - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "Найди тесты для HttpControlChannel test_http_control_channel TestHttpControlChannel HttpControlChannel", - "path_scope": [], - "include_globs": [ - "src/**", - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "top_k": 6, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Найди тесты для HttpControlChannel test_http_control_channel TestHttpControlChannel HttpControlChannel", - "path_scope": [], - "include_globs": [ - "src/**", - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "top_k": 10, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [], - "normalized_include_globs": [ - "src", - "tests" - ], - "normalized_exclude_globs": [], - "normalized_prefer_globs": [ - "tests" - ], - "filter_stage": "post_rank", - "candidates_before_filter": 0, - "candidates_after_filter": 0 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src", - "tests" - ], - "normalized_include_globs": [ - "src", - "tests" - ], - "normalized_exclude_globs": [], - "normalized_prefer_globs": [ - "tests" - ], - "filter_stage": "post_rank", - "candidates_before_filter": 6, - "candidates_after_filter": 6 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src", - "tests" - ], - "normalized_include_globs": [ - "src", - "tests" - ], - "normalized_exclude_globs": [], - "normalized_prefer_globs": [ - "tests" - ], - "filter_stage": "post_rank", - "candidates_before_filter": 10, - "candidates_after_filter": 10 - } - ], - "fallback": { - "used": true, - "reason": "scope_relaxed_no_hits" - }, - "symbol_resolution": { - "status": "not_found", - "resolved_symbol": null, - "alternatives": [ - "HttpControlChannel" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "miss", - "hit_count": 0, - "fail_reason": "scope_relaxed_no_hits" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 6, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 10, - "fail_reason": null - } - ] - }, - "constraint_violations": [ - { - "type": "LAYER_MISSING", - "severity": "warn", - "details": { - "layer": "C1_SYMBOL_CATALOG", - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ] - }, - "suggested_fix": "Increase top_k for this layer or relax constraints for retrieval." - } - ], - "timings_ms": { - "router": 0, - "symbol_resolution": 0, - "retrieval_total": 94, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 36, - "C2_DEPENDENCY_GRAPH": 44, - "C0_SOURCE_CHUNKS": 13 - }, - "merge_rank": 0, - "prompt_build": 0, - "llm_call": 0 - }, - "prompt": null, - "router": { - "conversation_mode": "START", - "keyword_hints": [ - "HttpControlChannel" - ], - "path_scope": [] - }, - "llm": { - "used_evidence_count": 16, - "missing_evidence_reason": null - } - }, - "run_info": { - "case_id": "plba-rag-find-tests-http-control-channel", - "mode": "router_rag", - "run_started_at": "2026-03-12T08:48:39", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - }, - "input_request": { - "text": "Найди тесты для HttpControlChannel", - "normalized_query": "Найди тесты для HttpControlChannel" - }, - "steps": [ - { - "step": "intent_router", - "input": { - "query": "Найди тесты для HttpControlChannel" - }, - "output": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Найди тесты для HttpControlChannel" - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "FIND_TESTS", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "HttpControlChannel" - ], - "keyword_hints": [ - "HttpControlChannel" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**", - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "test_file_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "test_symbol_patterns": [ - "test_http_control_channel", - "TestHttpControlChannel", - "HttpControlChannel" - ], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "timings_ms": { - "router": 0 - } - } - }, - { - "step": "retrieval", - "input": { - "query": "Найди тесты для HttpControlChannel" - }, - "output": { - "symbol_resolution": { - "status": "not_found", - "resolved_symbol": null, - "alternatives": [ - "HttpControlChannel" - ], - "confidence": 0.0 - }, - "rag_count": 16, - "rag_rows": [ - { - "path": "tests/test_runtime.py", - "content": "test_http_control_channel_exposes_health_and_actions reads_attr asyncio.run", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_http_control_channel_exposes_health_and_actions:reads_attr", - "span_start": 339, - "span_end": 339, - "lexical_rank": 4, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "8cc58b96c744ee7cf7d1a8ad7bb92a891a43107869065c004a1a3ce0dd490a6b", - "edge_type": "reads_attr", - "src_symbol_id": "a5f91bbdc86d497cf0b20a6c10caf97bee5148eae96d13c175399533be193291", - "src_qname": "test_http_control_channel_exposes_health_and_actions", - "dst_symbol_id": null, - "dst_ref": "asyncio.run", - "resolution": "partial", - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_runtime.py", - "content": "test_http_control_channel_exposes_health_and_actions calls channel.start", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_http_control_channel_exposes_health_and_actions:calls", - "span_start": 318, - "span_end": 325, - "lexical_rank": 4, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "3f96da44a1e918ac0c2bf7a4a847deced1acc5dfe285d888e8f5d1f6c1716c04", - "edge_type": "calls", - "src_symbol_id": "a5f91bbdc86d497cf0b20a6c10caf97bee5148eae96d13c175399533be193291", - "src_qname": "test_http_control_channel_exposes_health_and_actions", - "dst_symbol_id": null, - "dst_ref": "channel.start", - "resolution": "partial", - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_runtime.py", - "content": "test_http_control_channel_exposes_health_and_actions calls asyncio.run", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_http_control_channel_exposes_health_and_actions:calls", - "span_start": 339, - "span_end": 339, - "lexical_rank": 4, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "91fb36608973c49de1ebe925be4cfbf215788cbb472a85de8c749572fbc1348e", - "edge_type": "calls", - "src_symbol_id": "a5f91bbdc86d497cf0b20a6c10caf97bee5148eae96d13c175399533be193291", - "src_qname": "test_http_control_channel_exposes_health_and_actions", - "dst_symbol_id": null, - "dst_ref": "asyncio.run", - "resolution": "partial", - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_runtime.py", - "content": "test_http_control_channel_exposes_health_and_actions instantiates HttpControlChannel", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_http_control_channel_exposes_health_and_actions:instantiates", - "span_start": 317, - "span_end": 317, - "lexical_rank": 4, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "da9945affedec9dad344f9fede71b834f44c79992678439b144d0a10bcf52efa", - "edge_type": "instantiates", - "src_symbol_id": "a5f91bbdc86d497cf0b20a6c10caf97bee5148eae96d13c175399533be193291", - "src_qname": "test_http_control_channel_exposes_health_and_actions", - "dst_symbol_id": null, - "dst_ref": "HttpControlChannel", - "resolution": "partial", - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_runtime.py", - "content": "test_http_control_channel_exposes_health_and_actions calls scenario", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_http_control_channel_exposes_health_and_actions:calls", - "span_start": 339, - "span_end": 339, - "lexical_rank": 4, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "4820478ea2620cc3f71ba0143219550671279e5e0d642bd7fb2458259a9cf4fd", - "edge_type": "calls", - "src_symbol_id": "a5f91bbdc86d497cf0b20a6c10caf97bee5148eae96d13c175399533be193291", - "src_qname": "test_http_control_channel_exposes_health_and_actions", - "dst_symbol_id": null, - "dst_ref": "scenario", - "resolution": "partial", - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_runtime.py", - "content": "test_http_control_channel_exposes_health_and_actions calls channel._action_response", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_http_control_channel_exposes_health_and_actions:calls", - "span_start": 327, - "span_end": 327, - "lexical_rank": 4, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "1a5f8d1e30343961f5e934d1fd6c5f464d27dbd09ad89b9f3240d78f5cdea464", - "edge_type": "calls", - "src_symbol_id": "a5f91bbdc86d497cf0b20a6c10caf97bee5148eae96d13c175399533be193291", - "src_qname": "test_http_control_channel_exposes_health_and_actions", - "dst_symbol_id": null, - "dst_ref": "channel._action_response", - "resolution": "partial", - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "def _build_runtime(worker: Worker, *, control_timeout: int = 1) -> tuple[RuntimeManager, str]:\n runtime = RuntimeManager()\n channel = HttpControlChannel(host=\"127.0.0.1\", port=0, timeout=control_timeout)\n runtime.control_plane.register_channel(channel)\n runtime.register_module(WorkerModule(worker))\n runtime.start()\n return runtime, f\"http://127.0.0.1:{channel.port}\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:_build_runtime", - "span_start": 154, - "span_end": 160, - "lexical_rank": 5, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 6, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "def test_actions_start_stop_and_health_when_worker_is_idle() -> None:\n runtime, base_url = _build_runtime(ScenarioWorker(\"idle-worker\", IntervalRoutine(), interval=0.2))\n try:\n stop_status, stop_payload = _http_call_json(base_url, \"/actions/stop\", method=\"POST\")\n assert stop_status == 200\n assert isinstance(stop_payload.get(\"detail\"), dict)\n assert stop_payload[\"detail\"][\"timed_out\"] is False\n assert stop_payload[\"detail\"][\"state\"] == \"stopped\"\n\n health_stopped_status, health_stopped_payload = _http_call_json(base_url, \"/health\")\n assert health_stopped_status == 503\n assert health_stopped_payload[\"state\"] == \"stopped\"\n assert health_stopped_payload[\"status\"] == \"unhealthy\"\n\n start_status, start_payload = _http_call_json(base_url, \"/actions/start\", method=\"POST\")\n assert start_status == 200\n assert isinstance(start_payload.get(\"detail\"), dict)\n assert start_payload[\"detail\"][\"timed_out\"] is False\n assert start_payload[\"detail\"][\"state\"] in {\"idle\", \"busy\"}\n\n health_started_status, health_started_payload = _http_call_json(base_url, \"/health\")\n assert health_started_status == 200\n assert health_started_payload[\"status\"] == \"ok\"\n assert health_started_payload[\"state\"] in {\"idle\", \"busy\"}\n finally:\n runtime.stop()", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:test_actions_start_stop_and_health_when_worker_is_idle", - "span_start": 181, - "span_end": 206, - "lexical_rank": 5, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 8, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "class WorkerModule(ApplicationModule):\n def __init__(self, worker: Worker) -> None:\n self._worker = worker\n\n @property\n def name(self) -> str:\n return \"business-tests\"\n\n def register(self, registry: ModuleRegistry) -> None:\n registry.add_worker(self._worker)", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:WorkerModule", - "span_start": 113, - "span_end": 122, - "lexical_rank": 5, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 3, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "def _poll_until_stopped(base_url: str, timeout: float = 2.0) -> bool:\n deadline = monotonic() + timeout\n while monotonic() < deadline:\n _, payload = _http_call_json(base_url, \"/actions/status\")\n if payload.get(\"detail\") == \"stopped\":\n return True\n sleep(0.05)\n return False", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:_poll_until_stopped", - "span_start": 144, - "span_end": 151, - "lexical_rank": 5, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 5, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "class IntervalRoutine:\n calls: list[float] = field(default_factory=list)\n _lock: Lock = field(default_factory=Lock)\n\n def run(self) -> None:\n with self._lock:\n self.calls.append(monotonic())\n\n def wait_runs(self, count: int, timeout: float) -> bool:\n deadline = monotonic() + timeout\n while monotonic() < deadline:\n with self._lock:\n if len(self.calls) >= count:\n return True\n sleep(0.01)\n return False\n\n def deltas(self) -> list[float]:\n with self._lock:\n return [self.calls[index + 1] - self.calls[index] for index in range(len(self.calls) - 1)]", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:IntervalRoutine", - "span_start": 18, - "span_end": 37, - "lexical_rank": 5, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "def test_worker_wakes_up_with_configured_interval() -> None:\n interval = 0.15\n routine = IntervalRoutine()\n worker = ScenarioWorker(\"interval-worker\", routine, interval=interval)\n runtime = RuntimeManager()\n runtime.register_module(WorkerModule(worker))\n\n runtime.start()\n try:\n assert routine.wait_runs(count=3, timeout=2.0) is True\n finally:\n runtime.stop()\n\n deltas = routine.deltas()\n assert len(deltas) >= 2\n assert all(delta >= interval * 0.7 for delta in deltas[:2])", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:test_worker_wakes_up_with_configured_interval", - "span_start": 163, - "span_end": 178, - "lexical_rank": 5, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 7, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "class BlockingRoutine:\n def __init__(self, started: Event, release: Event) -> None:\n self._started = started\n self._release = release\n\n def run(self) -> None:\n self._started.set()\n self._release.wait(timeout=5.0)", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:BlockingRoutine", - "span_start": 40, - "span_end": 47, - "lexical_rank": 5, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 1, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "class ScenarioWorker(Worker):\n def __init__(self, name: str, routine: object, *, interval: float = 0.05) -> None:\n self._name = name\n self._routine = routine\n self._interval = interval\n self._thread: Thread | None = None\n self._stop_requested = Event()\n self._in_flight = 0\n self._runs = 0\n self._lock = Lock()\n\n @property\n def name(self) -> str:\n return self._name\n\n @property\n def critical(self) -> bool:\n return True\n\n def start(self) -> None:\n if self._thread is not None and self._thread.is_alive():\n return\n self._stop_requested.clear()\n self._thread = Thread(target=self._loop, name=f\"{self._name}-thread\", daemon=True)\n self._thread.start()\n\n def stop(self, force: bool = False) -> None:\n self._stop_requested.set()\n\n def health(self) -> WorkerHealth:\n return WorkerHealth(name=self.name, status=\"ok\", critical=True, meta={\"runs\": self._runs})\n\n def status(self) -> WorkerStatus:\n thread_alive = self._thread is not None and self._thread.is_alive()\n with self._lock:\n in_flight = self._in_flight\n runs = self._runs\n if not thread_alive:\n state = \"stopped\"\n elif self._stop_requested.is_set():\n state = \"stopping\"\n elif in_flight > 0:\n state = \"busy\"\n else:\n state = \"idle\"\n return WorkerStatus(name=self.name, state=state, in_flight=in_flight, meta={\"runs\": runs})\n\n def _loop(self) -> None:\n while not self._stop_requested.is_set():\n with self._lock:\n self._in_flight += 1\n try:\n self._routine.run()\n with self._lock:\n self._runs += 1\n finally:\n with self._lock:\n self._in_flight -= 1\n if self._stop_requested.is_set():\n return\n sleep(self._interval)", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:ScenarioWorker", - "span_start": 50, - "span_end": 110, - "lexical_rank": 5, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 2, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "def _http_call_json(\n base_url: str,\n path: str,\n *,\n method: str = \"GET\",\n headers: dict[str, str] | None = None,\n) -> tuple[int, dict[str, object]]:\n request = Request(f\"{base_url}{path}\", method=method, headers=headers or {})\n try:\n with urlopen(request, timeout=15.0) as response:\n status = response.status\n body = response.read()\n except HTTPError as error:\n status = error.code\n body = error.read()\n payload = json.loads(body.decode(\"utf-8\"))\n return status, payload", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:_http_call_json", - "span_start": 125, - "span_end": 141, - "lexical_rank": 5, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 4, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "def test_actions_stop_busy_worker_before_timeout() -> None:\n started = Event()\n release = Event()\n runtime, base_url = _build_runtime(ScenarioWorker(\"busy-worker\", BlockingRoutine(started, release)))\n assert started.wait(timeout=1.0) is True\n\n def release_later() -> None:\n sleep(0.2)\n release.set()\n\n Thread(target=release_later, daemon=True).start()\n try:\n status, payload = _http_call_json(base_url, \"/actions/stop\", method=\"POST\")\n assert status == 200\n assert isinstance(payload.get(\"detail\"), dict)\n assert payload[\"detail\"][\"timed_out\"] is False\n assert payload[\"detail\"][\"state\"] == \"stopped\"\n\n health_status, health_payload = _http_call_json(base_url, \"/health\")\n assert health_status == 503\n assert health_payload[\"status\"] == \"unhealthy\"\n assert health_payload[\"state\"] == \"stopped\"\n finally:\n runtime.stop()", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:test_actions_stop_busy_worker_before_timeout", - "span_start": 209, - "span_end": 232, - "lexical_rank": 5, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 9, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ] - }, - "diagnostics": { - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C0_SOURCE_CHUNKS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C0_SOURCE_CHUNKS": 10 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [], - "include_globs": [ - "src", - "tests" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests" - ] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src", - "tests" - ], - "include_globs": [ - "src", - "tests" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests" - ] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src", - "tests" - ], - "include_globs": [ - "src", - "tests" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests" - ] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "HttpControlChannel", - "path_scope": [], - "include_globs": [ - "src/**", - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "Найди тесты для HttpControlChannel test_http_control_channel TestHttpControlChannel HttpControlChannel", - "path_scope": [], - "include_globs": [ - "src/**", - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "top_k": 6, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Найди тесты для HttpControlChannel test_http_control_channel TestHttpControlChannel HttpControlChannel", - "path_scope": [], - "include_globs": [ - "src/**", - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "top_k": 10, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [], - "normalized_include_globs": [ - "src", - "tests" - ], - "normalized_exclude_globs": [], - "normalized_prefer_globs": [ - "tests" - ], - "filter_stage": "post_rank", - "candidates_before_filter": 0, - "candidates_after_filter": 0 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src", - "tests" - ], - "normalized_include_globs": [ - "src", - "tests" - ], - "normalized_exclude_globs": [], - "normalized_prefer_globs": [ - "tests" - ], - "filter_stage": "post_rank", - "candidates_before_filter": 6, - "candidates_after_filter": 6 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src", - "tests" - ], - "normalized_include_globs": [ - "src", - "tests" - ], - "normalized_exclude_globs": [], - "normalized_prefer_globs": [ - "tests" - ], - "filter_stage": "post_rank", - "candidates_before_filter": 10, - "candidates_after_filter": 10 - } - ], - "fallback": { - "used": true, - "reason": "scope_relaxed_no_hits" - }, - "symbol_resolution": { - "status": "not_found", - "resolved_symbol": null, - "alternatives": [ - "HttpControlChannel" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "miss", - "hit_count": 0, - "fail_reason": "scope_relaxed_no_hits" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 6, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 10, - "fail_reason": null - } - ] - }, - "constraint_violations": [ - { - "type": "LAYER_MISSING", - "severity": "warn", - "details": { - "layer": "C1_SYMBOL_CATALOG", - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ] - }, - "suggested_fix": "Increase top_k for this layer or relax constraints for retrieval." - } - ], - "timings_ms": { - "symbol_resolution": 0, - "retrieval_total": 94, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 36, - "C2_DEPENDENCY_GRAPH": 44, - "C0_SOURCE_CHUNKS": 13 - }, - "merge_rank": 0 - } - } - } - ] - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_router_rag/20260312_084838/router_rag_plba_code_retrieval_plba-rag-find-tests-http-control-channel.md b/tests/pipeline_setup_v2/test_results/plba_router_rag/20260312_084838/router_rag_plba_code_retrieval_plba-rag-find-tests-http-control-channel.md deleted file mode 100644 index 0d90aff..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_router_rag/20260312_084838/router_rag_plba_code_retrieval_plba-rag-find-tests-http-control-channel.md +++ /dev/null @@ -1,32 +0,0 @@ -# plba-rag-find-tests-http-control-channel - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/router_rag_plba_code_retrieval.yaml -- runner: runtime -- mode: router_rag -- passed: True - -## Query -Найди тесты для HttpControlChannel - -## Actual -{ - "intent": "CODE_QA", - "sub_intent": "FIND_TESTS", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 16, - "llm_answer": "", - "answer_mode": "partial", - "path_scope": [], - "symbol_candidates": [ - "HttpControlChannel" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ] -} - -## Mismatches -- none \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_router_rag/20260312_084838/router_rag_plba_code_retrieval_plba-rag-find-tests-runtime-manager.json b/tests/pipeline_setup_v2/test_results/plba_router_rag/20260312_084838/router_rag_plba_code_retrieval_plba-rag-find-tests-runtime-manager.json deleted file mode 100644 index 0a990e5..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_router_rag/20260312_084838/router_rag_plba_code_retrieval_plba-rag-find-tests-runtime-manager.json +++ /dev/null @@ -1,1822 +0,0 @@ -{ - "case_id": "plba-rag-find-tests-runtime-manager", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/router_rag_plba_code_retrieval.yaml", - "runner": "runtime", - "mode": "router_rag", - "actual": { - "intent": "CODE_QA", - "sub_intent": "FIND_TESTS", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 16, - "llm_answer": "", - "answer_mode": "partial", - "path_scope": [], - "symbol_candidates": [ - "RuntimeManager" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ] - }, - "passed": true, - "mismatches": [], - "details": { - "case_id": "plba-rag-find-tests-runtime-manager", - "text": "Где тесты для RuntimeManager?", - "mode": "router_rag", - "run_started_at": "2026-03-12T08:48:39", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Где тесты для RuntimeManager?", - "symbol_resolution": { - "status": "not_found", - "resolved_symbol": null, - "alternatives": [ - "RuntimeManager" - ], - "confidence": 0.0 - }, - "rag_count": 16, - "rag_rows": [ - { - "path": "tests/test_runtime.py", - "content": "test_runtime_runs_worker_routine_and_exposes_status instantiates RuntimeManager", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_runtime_runs_worker_routine_and_exposes_status:instantiates", - "span_start": 209, - "span_end": 209, - "lexical_rank": 6, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "c397a308e7824ba9fe400a754c7e15e66ea6f058d7f5d3e82bb002bb78b509d2", - "edge_type": "instantiates", - "src_symbol_id": "1c767eb5ee08e84f45b18c8ed7531ec0ed73c63fb1594823569672db7b21e992", - "src_qname": "test_runtime_runs_worker_routine_and_exposes_status", - "dst_symbol_id": "aeadc039653807b0da1ca6e3cc1078ee61cfc510b28e7f9c2ec04c59da43cc8d", - "dst_ref": "RuntimeManager", - "resolution": "resolved", - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_runtime.py", - "content": "test_runtime_graceful_stop_waits_until_worker_finishes instantiates RuntimeManager", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_runtime_graceful_stop_waits_until_worker_finishes:instantiates", - "span_start": 229, - "span_end": 229, - "lexical_rank": 6, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "76b4701262ccaa0a7a41691407c4ebdb2ca74a2415d89f0a38ef0d4f608bda93", - "edge_type": "instantiates", - "src_symbol_id": "1076e788e4a03b10d7bc1313a8ad46caa170c13cc026c6e4de994af1a6ae57bf", - "src_qname": "test_runtime_graceful_stop_waits_until_worker_finishes", - "dst_symbol_id": "aeadc039653807b0da1ca6e3cc1078ee61cfc510b28e7f9c2ec04c59da43cc8d", - "dst_ref": "RuntimeManager", - "resolution": "resolved", - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "_build_runtime instantiates RuntimeManager", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "_build_runtime:instantiates", - "span_start": 155, - "span_end": 155, - "lexical_rank": 6, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "7eb254d564944bab6272757ee5ef688862bd321e6941e2495dc942e03b1c9a25", - "edge_type": "instantiates", - "src_symbol_id": "db94031d5245bf82be836a109b4584b43b8e83d37a0f318e03f6c8191896d469", - "src_qname": "_build_runtime", - "dst_symbol_id": "a1572ea8183dc0cd6ddbc74342bbde8c28cecfde37ad40b62feff09f8d103d11", - "dst_ref": "RuntimeManager", - "resolution": "resolved", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "test_worker_wakes_up_with_configured_interval instantiates RuntimeManager", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_worker_wakes_up_with_configured_interval:instantiates", - "span_start": 167, - "span_end": 167, - "lexical_rank": 6, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "189aafc4de0b79c688668f25f0c87166a127df26bd2215452014713b65ef281a", - "edge_type": "instantiates", - "src_symbol_id": "65f877f78191d65e6a752e41cedc70ebc784c266804a55c1c56440336e1f0d6e", - "src_qname": "test_worker_wakes_up_with_configured_interval", - "dst_symbol_id": "a1572ea8183dc0cd6ddbc74342bbde8c28cecfde37ad40b62feff09f8d103d11", - "dst_ref": "RuntimeManager", - "resolution": "resolved", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "test_actions_stop_busy_worker_after_timeout\n -> BlockingRoutine\n -> BlockingRoutine.__init__\n -> BlockingRoutine._started\n -> BlockingRoutine.run", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_actions_stop_busy_worker_after_timeout:dataflow_slice", - "span_start": 42, - "span_end": 238, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 5, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "8e7db3d2a9226f1c1d9942ac6373cfcafa0d2276758ddb8a3d3c455a3d58024d", - "edge_type": "dataflow_slice", - "src_symbol_id": "66392d3222421d9ba16eda3554940b16e7d5a6f33aa08c5738d35af2e32f1e4a", - "src_qname": "test_actions_stop_busy_worker_after_timeout", - "dst_symbol_id": "d9841bdbb69706c988ae7ae6adf89928dc4fae45943f74064f5382177034ba04", - "dst_ref": "BlockingRoutine.run", - "resolution": "resolved", - "slice_id": "8e7db3d2a9226f1c1d9942ac6373cfcafa0d2276758ddb8a3d3c455a3d58024d", - "root_symbol_id": "66392d3222421d9ba16eda3554940b16e7d5a6f33aa08c5738d35af2e32f1e4a", - "path_symbols": [ - "test_actions_stop_busy_worker_after_timeout", - "BlockingRoutine", - "BlockingRoutine.__init__", - "BlockingRoutine._started", - "BlockingRoutine.run" - ], - "path_symbol_ids": [ - "66392d3222421d9ba16eda3554940b16e7d5a6f33aa08c5738d35af2e32f1e4a", - "a3349c5bc65e4003a4bbd6a8dbb7a54c337e12d1aed930caa701b12e520f1e67", - "486deeed3043c6db985aef258e96ddc67aa53608e67a83962fbd2471f649ddf1", - "d9841bdbb69706c988ae7ae6adf89928dc4fae45943f74064f5382177034ba04" - ], - "path_edge_types": [ - "instantiates", - "writes_attr", - "reads_attr" - ], - "path_length": 5, - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "test_actions_stop_busy_worker_before_timeout\n -> BlockingRoutine\n -> BlockingRoutine.__init__\n -> BlockingRoutine._release\n -> BlockingRoutine.run", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_actions_stop_busy_worker_before_timeout:dataflow_slice", - "span_start": 43, - "span_end": 212, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 5, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "8bd726155ba387d3579763ee84dfd2f9a90bc917da88f3b2e89416ab5c1254d6", - "edge_type": "dataflow_slice", - "src_symbol_id": "a0bb116ca9d909c93a285667ae033fbd1859b2dad7cf34fcb44816393ef6909c", - "src_qname": "test_actions_stop_busy_worker_before_timeout", - "dst_symbol_id": "d9841bdbb69706c988ae7ae6adf89928dc4fae45943f74064f5382177034ba04", - "dst_ref": "BlockingRoutine.run", - "resolution": "resolved", - "slice_id": "8bd726155ba387d3579763ee84dfd2f9a90bc917da88f3b2e89416ab5c1254d6", - "root_symbol_id": "a0bb116ca9d909c93a285667ae033fbd1859b2dad7cf34fcb44816393ef6909c", - "path_symbols": [ - "test_actions_stop_busy_worker_before_timeout", - "BlockingRoutine", - "BlockingRoutine.__init__", - "BlockingRoutine._release", - "BlockingRoutine.run" - ], - "path_symbol_ids": [ - "a0bb116ca9d909c93a285667ae033fbd1859b2dad7cf34fcb44816393ef6909c", - "a3349c5bc65e4003a4bbd6a8dbb7a54c337e12d1aed930caa701b12e520f1e67", - "486deeed3043c6db985aef258e96ddc67aa53608e67a83962fbd2471f649ddf1", - "d9841bdbb69706c988ae7ae6adf89928dc4fae45943f74064f5382177034ba04" - ], - "path_edge_types": [ - "instantiates", - "writes_attr", - "reads_attr" - ], - "path_length": 5, - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_runtime.py", - "content": "def test_runtime_graceful_stop_waits_until_worker_finishes() -> None:\n started = Event()\n release = Event()\n runtime = RuntimeManager()\n runtime.register_module(BlockingModule(started, release))\n runtime.start()\n assert started.wait(timeout=1.0) is True\n assert runtime.status()[\"runtime\"][\"state\"] == \"busy\"\n\n stop_thread = Thread(target=runtime.stop, kwargs={\"timeout\": 1.0}, daemon=True)\n stop_thread.start()\n sleep(0.1)\n assert stop_thread.is_alive() is True\n\n release.set()\n stop_thread.join(timeout=1.0)\n assert stop_thread.is_alive() is False\n assert runtime.status()[\"runtime\"][\"state\"] == \"stopped\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_runtime.py:test_runtime_graceful_stop_waits_until_worker_finishes", - "span_start": 226, - "span_end": 243, - "lexical_rank": 6, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 8, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_runtime", - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_runtime.py", - "content": "def test_runtime_runs_worker_routine_and_exposes_status(tmp_path) -> None:\n config_path = tmp_path / \"config.yml\"\n config_path.write_text(\n \"\"\"\nplatform:\n workers: 1\nlog:\n version: 1\n disable_existing_loggers: false\n handlers:\n console:\n class: logging.StreamHandler\n root:\n level: INFO\n handlers: [console]\n\"\"\".strip(),\n encoding=\"utf-8\",\n )\n runtime = RuntimeManager()\n runtime.add_config_file(config_path)\n module = ExampleModule()\n runtime.register_module(module)\n\n runtime.start()\n sleep(0.2)\n status = runtime.status()\n runtime.stop()\n\n assert module.routine.processed == [{\"id\": 1}]\n assert status[\"modules\"] == [\"example\"]\n assert status[\"runtime\"][\"state\"] == \"idle\"\n assert status[\"health\"][\"status\"] == \"ok\"\n assert status[\"config\"] == {\"platform\": {\"workers\": 1}, \"log\": status[\"config\"][\"log\"]}", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_runtime.py:test_runtime_runs_worker_routine_and_exposes_status", - "span_start": 191, - "span_end": 223, - "lexical_rank": 6, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 7, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_runtime", - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "def _build_runtime(worker: Worker, *, control_timeout: int = 1) -> tuple[RuntimeManager, str]:\n runtime = RuntimeManager()\n channel = HttpControlChannel(host=\"127.0.0.1\", port=0, timeout=control_timeout)\n runtime.control_plane.register_channel(channel)\n runtime.register_module(WorkerModule(worker))\n runtime.start()\n return runtime, f\"http://127.0.0.1:{channel.port}\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:_build_runtime", - "span_start": 154, - "span_end": 160, - "lexical_rank": 6, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 6, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "def test_worker_wakes_up_with_configured_interval() -> None:\n interval = 0.15\n routine = IntervalRoutine()\n worker = ScenarioWorker(\"interval-worker\", routine, interval=interval)\n runtime = RuntimeManager()\n runtime.register_module(WorkerModule(worker))\n\n runtime.start()\n try:\n assert routine.wait_runs(count=3, timeout=2.0) is True\n finally:\n runtime.stop()\n\n deltas = routine.deltas()\n assert len(deltas) >= 2\n assert all(delta >= interval * 0.7 for delta in deltas[:2])", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:test_worker_wakes_up_with_configured_interval", - "span_start": 163, - "span_end": 178, - "lexical_rank": 6, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 7, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "class BlockingRoutine:\n def __init__(self, started: Event, release: Event) -> None:\n self._started = started\n self._release = release\n\n def run(self) -> None:\n self._started.set()\n self._release.wait(timeout=5.0)", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:BlockingRoutine", - "span_start": 40, - "span_end": 47, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 1, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "class ScenarioWorker(Worker):\n def __init__(self, name: str, routine: object, *, interval: float = 0.05) -> None:\n self._name = name\n self._routine = routine\n self._interval = interval\n self._thread: Thread | None = None\n self._stop_requested = Event()\n self._in_flight = 0\n self._runs = 0\n self._lock = Lock()\n\n @property\n def name(self) -> str:\n return self._name\n\n @property\n def critical(self) -> bool:\n return True\n\n def start(self) -> None:\n if self._thread is not None and self._thread.is_alive():\n return\n self._stop_requested.clear()\n self._thread = Thread(target=self._loop, name=f\"{self._name}-thread\", daemon=True)\n self._thread.start()\n\n def stop(self, force: bool = False) -> None:\n self._stop_requested.set()\n\n def health(self) -> WorkerHealth:\n return WorkerHealth(name=self.name, status=\"ok\", critical=True, meta={\"runs\": self._runs})\n\n def status(self) -> WorkerStatus:\n thread_alive = self._thread is not None and self._thread.is_alive()\n with self._lock:\n in_flight = self._in_flight\n runs = self._runs\n if not thread_alive:\n state = \"stopped\"\n elif self._stop_requested.is_set():\n state = \"stopping\"\n elif in_flight > 0:\n state = \"busy\"\n else:\n state = \"idle\"\n return WorkerStatus(name=self.name, state=state, in_flight=in_flight, meta={\"runs\": runs})\n\n def _loop(self) -> None:\n while not self._stop_requested.is_set():\n with self._lock:\n self._in_flight += 1\n try:\n self._routine.run()\n with self._lock:\n self._runs += 1\n finally:\n with self._lock:\n self._in_flight -= 1\n if self._stop_requested.is_set():\n return\n sleep(self._interval)", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:ScenarioWorker", - "span_start": 50, - "span_end": 110, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 2, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "class WorkerModule(ApplicationModule):\n def __init__(self, worker: Worker) -> None:\n self._worker = worker\n\n @property\n def name(self) -> str:\n return \"business-tests\"\n\n def register(self, registry: ModuleRegistry) -> None:\n registry.add_worker(self._worker)", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:WorkerModule", - "span_start": 113, - "span_end": 122, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 3, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "def _http_call_json(\n base_url: str,\n path: str,\n *,\n method: str = \"GET\",\n headers: dict[str, str] | None = None,\n) -> tuple[int, dict[str, object]]:\n request = Request(f\"{base_url}{path}\", method=method, headers=headers or {})\n try:\n with urlopen(request, timeout=15.0) as response:\n status = response.status\n body = response.read()\n except HTTPError as error:\n status = error.code\n body = error.read()\n payload = json.loads(body.decode(\"utf-8\"))\n return status, payload", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:_http_call_json", - "span_start": 125, - "span_end": 141, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 4, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "class IntervalRoutine:\n calls: list[float] = field(default_factory=list)\n _lock: Lock = field(default_factory=Lock)\n\n def run(self) -> None:\n with self._lock:\n self.calls.append(monotonic())\n\n def wait_runs(self, count: int, timeout: float) -> bool:\n deadline = monotonic() + timeout\n while monotonic() < deadline:\n with self._lock:\n if len(self.calls) >= count:\n return True\n sleep(0.01)\n return False\n\n def deltas(self) -> list[float]:\n with self._lock:\n return [self.calls[index + 1] - self.calls[index] for index in range(len(self.calls) - 1)]", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:IntervalRoutine", - "span_start": 18, - "span_end": 37, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "def _poll_until_stopped(base_url: str, timeout: float = 2.0) -> bool:\n deadline = monotonic() + timeout\n while monotonic() < deadline:\n _, payload = _http_call_json(base_url, \"/actions/status\")\n if payload.get(\"detail\") == \"stopped\":\n return True\n sleep(0.05)\n return False", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:_poll_until_stopped", - "span_start": 144, - "span_end": 151, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 5, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "llm_answer": null, - "summary": { - "router": { - "intent": "CODE_QA", - "sub_intent": "FIND_TESTS", - "confidence": null - }, - "retrieval": { - "profile": "code", - "layers_hit": [ - "C0_SOURCE_CHUNKS", - "C2_DEPENDENCY_GRAPH" - ], - "evidence_sufficient": true - }, - "llm": { - "answer_status": "partial", - "groundedness": "not_applicable" - } - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "FIND_TESTS", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "RuntimeManager" - ], - "keyword_hints": [ - "RuntimeManager" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**", - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "test_file_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "test_symbol_patterns": [ - "test_runtime_manager", - "TestRuntimeManager", - "RuntimeManager" - ], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C0_SOURCE_CHUNKS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C0_SOURCE_CHUNKS": 10 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [], - "include_globs": [ - "src", - "tests" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests" - ] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src", - "tests" - ], - "include_globs": [ - "src", - "tests" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests" - ] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src", - "tests" - ], - "include_globs": [ - "src", - "tests" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests" - ] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**", - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "Где тесты для RuntimeManager? test_runtime_manager TestRuntimeManager RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**", - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "top_k": 6, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Где тесты для RuntimeManager? test_runtime_manager TestRuntimeManager RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**", - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "top_k": 10, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [], - "normalized_include_globs": [ - "src", - "tests" - ], - "normalized_exclude_globs": [], - "normalized_prefer_globs": [ - "tests" - ], - "filter_stage": "post_rank", - "candidates_before_filter": 0, - "candidates_after_filter": 0 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src", - "tests" - ], - "normalized_include_globs": [ - "src", - "tests" - ], - "normalized_exclude_globs": [], - "normalized_prefer_globs": [ - "tests" - ], - "filter_stage": "post_rank", - "candidates_before_filter": 6, - "candidates_after_filter": 6 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src", - "tests" - ], - "normalized_include_globs": [ - "src", - "tests" - ], - "normalized_exclude_globs": [], - "normalized_prefer_globs": [ - "tests" - ], - "filter_stage": "post_rank", - "candidates_before_filter": 10, - "candidates_after_filter": 10 - } - ], - "fallback": { - "used": true, - "reason": "scope_relaxed_no_hits" - }, - "symbol_resolution": { - "status": "not_found", - "resolved_symbol": null, - "alternatives": [ - "RuntimeManager" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "miss", - "hit_count": 0, - "fail_reason": "scope_relaxed_no_hits" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 6, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 10, - "fail_reason": null - } - ] - }, - "constraint_violations": [ - { - "type": "LAYER_MISSING", - "severity": "warn", - "details": { - "layer": "C1_SYMBOL_CATALOG", - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ] - }, - "suggested_fix": "Increase top_k for this layer or relax constraints for retrieval." - } - ], - "timings_ms": { - "router": 0, - "symbol_resolution": 0, - "retrieval_total": 106, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 36, - "C2_DEPENDENCY_GRAPH": 48, - "C0_SOURCE_CHUNKS": 21 - }, - "merge_rank": 0, - "prompt_build": 0, - "llm_call": 0 - }, - "prompt": null, - "router": { - "conversation_mode": "START", - "keyword_hints": [ - "RuntimeManager" - ], - "path_scope": [] - }, - "llm": { - "used_evidence_count": 16, - "missing_evidence_reason": null - } - }, - "run_info": { - "case_id": "plba-rag-find-tests-runtime-manager", - "mode": "router_rag", - "run_started_at": "2026-03-12T08:48:39", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - }, - "input_request": { - "text": "Где тесты для RuntimeManager?", - "normalized_query": "Где тесты для RuntimeManager?" - }, - "steps": [ - { - "step": "intent_router", - "input": { - "query": "Где тесты для RuntimeManager?" - }, - "output": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Где тесты для RuntimeManager?" - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "FIND_TESTS", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "RuntimeManager" - ], - "keyword_hints": [ - "RuntimeManager" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**", - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "test_file_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "test_symbol_patterns": [ - "test_runtime_manager", - "TestRuntimeManager", - "RuntimeManager" - ], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "timings_ms": { - "router": 0 - } - } - }, - { - "step": "retrieval", - "input": { - "query": "Где тесты для RuntimeManager?" - }, - "output": { - "symbol_resolution": { - "status": "not_found", - "resolved_symbol": null, - "alternatives": [ - "RuntimeManager" - ], - "confidence": 0.0 - }, - "rag_count": 16, - "rag_rows": [ - { - "path": "tests/test_runtime.py", - "content": "test_runtime_runs_worker_routine_and_exposes_status instantiates RuntimeManager", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_runtime_runs_worker_routine_and_exposes_status:instantiates", - "span_start": 209, - "span_end": 209, - "lexical_rank": 6, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "c397a308e7824ba9fe400a754c7e15e66ea6f058d7f5d3e82bb002bb78b509d2", - "edge_type": "instantiates", - "src_symbol_id": "1c767eb5ee08e84f45b18c8ed7531ec0ed73c63fb1594823569672db7b21e992", - "src_qname": "test_runtime_runs_worker_routine_and_exposes_status", - "dst_symbol_id": "aeadc039653807b0da1ca6e3cc1078ee61cfc510b28e7f9c2ec04c59da43cc8d", - "dst_ref": "RuntimeManager", - "resolution": "resolved", - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_runtime.py", - "content": "test_runtime_graceful_stop_waits_until_worker_finishes instantiates RuntimeManager", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_runtime_graceful_stop_waits_until_worker_finishes:instantiates", - "span_start": 229, - "span_end": 229, - "lexical_rank": 6, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "76b4701262ccaa0a7a41691407c4ebdb2ca74a2415d89f0a38ef0d4f608bda93", - "edge_type": "instantiates", - "src_symbol_id": "1076e788e4a03b10d7bc1313a8ad46caa170c13cc026c6e4de994af1a6ae57bf", - "src_qname": "test_runtime_graceful_stop_waits_until_worker_finishes", - "dst_symbol_id": "aeadc039653807b0da1ca6e3cc1078ee61cfc510b28e7f9c2ec04c59da43cc8d", - "dst_ref": "RuntimeManager", - "resolution": "resolved", - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "_build_runtime instantiates RuntimeManager", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "_build_runtime:instantiates", - "span_start": 155, - "span_end": 155, - "lexical_rank": 6, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "7eb254d564944bab6272757ee5ef688862bd321e6941e2495dc942e03b1c9a25", - "edge_type": "instantiates", - "src_symbol_id": "db94031d5245bf82be836a109b4584b43b8e83d37a0f318e03f6c8191896d469", - "src_qname": "_build_runtime", - "dst_symbol_id": "a1572ea8183dc0cd6ddbc74342bbde8c28cecfde37ad40b62feff09f8d103d11", - "dst_ref": "RuntimeManager", - "resolution": "resolved", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "test_worker_wakes_up_with_configured_interval instantiates RuntimeManager", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_worker_wakes_up_with_configured_interval:instantiates", - "span_start": 167, - "span_end": 167, - "lexical_rank": 6, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "189aafc4de0b79c688668f25f0c87166a127df26bd2215452014713b65ef281a", - "edge_type": "instantiates", - "src_symbol_id": "65f877f78191d65e6a752e41cedc70ebc784c266804a55c1c56440336e1f0d6e", - "src_qname": "test_worker_wakes_up_with_configured_interval", - "dst_symbol_id": "a1572ea8183dc0cd6ddbc74342bbde8c28cecfde37ad40b62feff09f8d103d11", - "dst_ref": "RuntimeManager", - "resolution": "resolved", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "test_actions_stop_busy_worker_after_timeout\n -> BlockingRoutine\n -> BlockingRoutine.__init__\n -> BlockingRoutine._started\n -> BlockingRoutine.run", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_actions_stop_busy_worker_after_timeout:dataflow_slice", - "span_start": 42, - "span_end": 238, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 5, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "8e7db3d2a9226f1c1d9942ac6373cfcafa0d2276758ddb8a3d3c455a3d58024d", - "edge_type": "dataflow_slice", - "src_symbol_id": "66392d3222421d9ba16eda3554940b16e7d5a6f33aa08c5738d35af2e32f1e4a", - "src_qname": "test_actions_stop_busy_worker_after_timeout", - "dst_symbol_id": "d9841bdbb69706c988ae7ae6adf89928dc4fae45943f74064f5382177034ba04", - "dst_ref": "BlockingRoutine.run", - "resolution": "resolved", - "slice_id": "8e7db3d2a9226f1c1d9942ac6373cfcafa0d2276758ddb8a3d3c455a3d58024d", - "root_symbol_id": "66392d3222421d9ba16eda3554940b16e7d5a6f33aa08c5738d35af2e32f1e4a", - "path_symbols": [ - "test_actions_stop_busy_worker_after_timeout", - "BlockingRoutine", - "BlockingRoutine.__init__", - "BlockingRoutine._started", - "BlockingRoutine.run" - ], - "path_symbol_ids": [ - "66392d3222421d9ba16eda3554940b16e7d5a6f33aa08c5738d35af2e32f1e4a", - "a3349c5bc65e4003a4bbd6a8dbb7a54c337e12d1aed930caa701b12e520f1e67", - "486deeed3043c6db985aef258e96ddc67aa53608e67a83962fbd2471f649ddf1", - "d9841bdbb69706c988ae7ae6adf89928dc4fae45943f74064f5382177034ba04" - ], - "path_edge_types": [ - "instantiates", - "writes_attr", - "reads_attr" - ], - "path_length": 5, - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "test_actions_stop_busy_worker_before_timeout\n -> BlockingRoutine\n -> BlockingRoutine.__init__\n -> BlockingRoutine._release\n -> BlockingRoutine.run", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_actions_stop_busy_worker_before_timeout:dataflow_slice", - "span_start": 43, - "span_end": 212, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 5, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "8bd726155ba387d3579763ee84dfd2f9a90bc917da88f3b2e89416ab5c1254d6", - "edge_type": "dataflow_slice", - "src_symbol_id": "a0bb116ca9d909c93a285667ae033fbd1859b2dad7cf34fcb44816393ef6909c", - "src_qname": "test_actions_stop_busy_worker_before_timeout", - "dst_symbol_id": "d9841bdbb69706c988ae7ae6adf89928dc4fae45943f74064f5382177034ba04", - "dst_ref": "BlockingRoutine.run", - "resolution": "resolved", - "slice_id": "8bd726155ba387d3579763ee84dfd2f9a90bc917da88f3b2e89416ab5c1254d6", - "root_symbol_id": "a0bb116ca9d909c93a285667ae033fbd1859b2dad7cf34fcb44816393ef6909c", - "path_symbols": [ - "test_actions_stop_busy_worker_before_timeout", - "BlockingRoutine", - "BlockingRoutine.__init__", - "BlockingRoutine._release", - "BlockingRoutine.run" - ], - "path_symbol_ids": [ - "a0bb116ca9d909c93a285667ae033fbd1859b2dad7cf34fcb44816393ef6909c", - "a3349c5bc65e4003a4bbd6a8dbb7a54c337e12d1aed930caa701b12e520f1e67", - "486deeed3043c6db985aef258e96ddc67aa53608e67a83962fbd2471f649ddf1", - "d9841bdbb69706c988ae7ae6adf89928dc4fae45943f74064f5382177034ba04" - ], - "path_edge_types": [ - "instantiates", - "writes_attr", - "reads_attr" - ], - "path_length": 5, - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_runtime.py", - "content": "def test_runtime_graceful_stop_waits_until_worker_finishes() -> None:\n started = Event()\n release = Event()\n runtime = RuntimeManager()\n runtime.register_module(BlockingModule(started, release))\n runtime.start()\n assert started.wait(timeout=1.0) is True\n assert runtime.status()[\"runtime\"][\"state\"] == \"busy\"\n\n stop_thread = Thread(target=runtime.stop, kwargs={\"timeout\": 1.0}, daemon=True)\n stop_thread.start()\n sleep(0.1)\n assert stop_thread.is_alive() is True\n\n release.set()\n stop_thread.join(timeout=1.0)\n assert stop_thread.is_alive() is False\n assert runtime.status()[\"runtime\"][\"state\"] == \"stopped\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_runtime.py:test_runtime_graceful_stop_waits_until_worker_finishes", - "span_start": 226, - "span_end": 243, - "lexical_rank": 6, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 8, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_runtime", - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_runtime.py", - "content": "def test_runtime_runs_worker_routine_and_exposes_status(tmp_path) -> None:\n config_path = tmp_path / \"config.yml\"\n config_path.write_text(\n \"\"\"\nplatform:\n workers: 1\nlog:\n version: 1\n disable_existing_loggers: false\n handlers:\n console:\n class: logging.StreamHandler\n root:\n level: INFO\n handlers: [console]\n\"\"\".strip(),\n encoding=\"utf-8\",\n )\n runtime = RuntimeManager()\n runtime.add_config_file(config_path)\n module = ExampleModule()\n runtime.register_module(module)\n\n runtime.start()\n sleep(0.2)\n status = runtime.status()\n runtime.stop()\n\n assert module.routine.processed == [{\"id\": 1}]\n assert status[\"modules\"] == [\"example\"]\n assert status[\"runtime\"][\"state\"] == \"idle\"\n assert status[\"health\"][\"status\"] == \"ok\"\n assert status[\"config\"] == {\"platform\": {\"workers\": 1}, \"log\": status[\"config\"][\"log\"]}", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_runtime.py:test_runtime_runs_worker_routine_and_exposes_status", - "span_start": 191, - "span_end": 223, - "lexical_rank": 6, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 7, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_runtime", - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "def _build_runtime(worker: Worker, *, control_timeout: int = 1) -> tuple[RuntimeManager, str]:\n runtime = RuntimeManager()\n channel = HttpControlChannel(host=\"127.0.0.1\", port=0, timeout=control_timeout)\n runtime.control_plane.register_channel(channel)\n runtime.register_module(WorkerModule(worker))\n runtime.start()\n return runtime, f\"http://127.0.0.1:{channel.port}\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:_build_runtime", - "span_start": 154, - "span_end": 160, - "lexical_rank": 6, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 6, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "def test_worker_wakes_up_with_configured_interval() -> None:\n interval = 0.15\n routine = IntervalRoutine()\n worker = ScenarioWorker(\"interval-worker\", routine, interval=interval)\n runtime = RuntimeManager()\n runtime.register_module(WorkerModule(worker))\n\n runtime.start()\n try:\n assert routine.wait_runs(count=3, timeout=2.0) is True\n finally:\n runtime.stop()\n\n deltas = routine.deltas()\n assert len(deltas) >= 2\n assert all(delta >= interval * 0.7 for delta in deltas[:2])", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:test_worker_wakes_up_with_configured_interval", - "span_start": 163, - "span_end": 178, - "lexical_rank": 6, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 7, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "class BlockingRoutine:\n def __init__(self, started: Event, release: Event) -> None:\n self._started = started\n self._release = release\n\n def run(self) -> None:\n self._started.set()\n self._release.wait(timeout=5.0)", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:BlockingRoutine", - "span_start": 40, - "span_end": 47, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 1, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "class ScenarioWorker(Worker):\n def __init__(self, name: str, routine: object, *, interval: float = 0.05) -> None:\n self._name = name\n self._routine = routine\n self._interval = interval\n self._thread: Thread | None = None\n self._stop_requested = Event()\n self._in_flight = 0\n self._runs = 0\n self._lock = Lock()\n\n @property\n def name(self) -> str:\n return self._name\n\n @property\n def critical(self) -> bool:\n return True\n\n def start(self) -> None:\n if self._thread is not None and self._thread.is_alive():\n return\n self._stop_requested.clear()\n self._thread = Thread(target=self._loop, name=f\"{self._name}-thread\", daemon=True)\n self._thread.start()\n\n def stop(self, force: bool = False) -> None:\n self._stop_requested.set()\n\n def health(self) -> WorkerHealth:\n return WorkerHealth(name=self.name, status=\"ok\", critical=True, meta={\"runs\": self._runs})\n\n def status(self) -> WorkerStatus:\n thread_alive = self._thread is not None and self._thread.is_alive()\n with self._lock:\n in_flight = self._in_flight\n runs = self._runs\n if not thread_alive:\n state = \"stopped\"\n elif self._stop_requested.is_set():\n state = \"stopping\"\n elif in_flight > 0:\n state = \"busy\"\n else:\n state = \"idle\"\n return WorkerStatus(name=self.name, state=state, in_flight=in_flight, meta={\"runs\": runs})\n\n def _loop(self) -> None:\n while not self._stop_requested.is_set():\n with self._lock:\n self._in_flight += 1\n try:\n self._routine.run()\n with self._lock:\n self._runs += 1\n finally:\n with self._lock:\n self._in_flight -= 1\n if self._stop_requested.is_set():\n return\n sleep(self._interval)", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:ScenarioWorker", - "span_start": 50, - "span_end": 110, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 2, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "class WorkerModule(ApplicationModule):\n def __init__(self, worker: Worker) -> None:\n self._worker = worker\n\n @property\n def name(self) -> str:\n return \"business-tests\"\n\n def register(self, registry: ModuleRegistry) -> None:\n registry.add_worker(self._worker)", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:WorkerModule", - "span_start": 113, - "span_end": 122, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 3, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "def _http_call_json(\n base_url: str,\n path: str,\n *,\n method: str = \"GET\",\n headers: dict[str, str] | None = None,\n) -> tuple[int, dict[str, object]]:\n request = Request(f\"{base_url}{path}\", method=method, headers=headers or {})\n try:\n with urlopen(request, timeout=15.0) as response:\n status = response.status\n body = response.read()\n except HTTPError as error:\n status = error.code\n body = error.read()\n payload = json.loads(body.decode(\"utf-8\"))\n return status, payload", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:_http_call_json", - "span_start": 125, - "span_end": 141, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 4, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "class IntervalRoutine:\n calls: list[float] = field(default_factory=list)\n _lock: Lock = field(default_factory=Lock)\n\n def run(self) -> None:\n with self._lock:\n self.calls.append(monotonic())\n\n def wait_runs(self, count: int, timeout: float) -> bool:\n deadline = monotonic() + timeout\n while monotonic() < deadline:\n with self._lock:\n if len(self.calls) >= count:\n return True\n sleep(0.01)\n return False\n\n def deltas(self) -> list[float]:\n with self._lock:\n return [self.calls[index + 1] - self.calls[index] for index in range(len(self.calls) - 1)]", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:IntervalRoutine", - "span_start": 18, - "span_end": 37, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "def _poll_until_stopped(base_url: str, timeout: float = 2.0) -> bool:\n deadline = monotonic() + timeout\n while monotonic() < deadline:\n _, payload = _http_call_json(base_url, \"/actions/status\")\n if payload.get(\"detail\") == \"stopped\":\n return True\n sleep(0.05)\n return False", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:_poll_until_stopped", - "span_start": 144, - "span_end": 151, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 5, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ] - }, - "diagnostics": { - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C0_SOURCE_CHUNKS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C0_SOURCE_CHUNKS": 10 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [], - "include_globs": [ - "src", - "tests" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests" - ] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src", - "tests" - ], - "include_globs": [ - "src", - "tests" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests" - ] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src", - "tests" - ], - "include_globs": [ - "src", - "tests" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests" - ] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**", - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "Где тесты для RuntimeManager? test_runtime_manager TestRuntimeManager RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**", - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "top_k": 6, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Где тесты для RuntimeManager? test_runtime_manager TestRuntimeManager RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**", - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "top_k": 10, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [], - "normalized_include_globs": [ - "src", - "tests" - ], - "normalized_exclude_globs": [], - "normalized_prefer_globs": [ - "tests" - ], - "filter_stage": "post_rank", - "candidates_before_filter": 0, - "candidates_after_filter": 0 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src", - "tests" - ], - "normalized_include_globs": [ - "src", - "tests" - ], - "normalized_exclude_globs": [], - "normalized_prefer_globs": [ - "tests" - ], - "filter_stage": "post_rank", - "candidates_before_filter": 6, - "candidates_after_filter": 6 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src", - "tests" - ], - "normalized_include_globs": [ - "src", - "tests" - ], - "normalized_exclude_globs": [], - "normalized_prefer_globs": [ - "tests" - ], - "filter_stage": "post_rank", - "candidates_before_filter": 10, - "candidates_after_filter": 10 - } - ], - "fallback": { - "used": true, - "reason": "scope_relaxed_no_hits" - }, - "symbol_resolution": { - "status": "not_found", - "resolved_symbol": null, - "alternatives": [ - "RuntimeManager" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "miss", - "hit_count": 0, - "fail_reason": "scope_relaxed_no_hits" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 6, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 10, - "fail_reason": null - } - ] - }, - "constraint_violations": [ - { - "type": "LAYER_MISSING", - "severity": "warn", - "details": { - "layer": "C1_SYMBOL_CATALOG", - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ] - }, - "suggested_fix": "Increase top_k for this layer or relax constraints for retrieval." - } - ], - "timings_ms": { - "symbol_resolution": 0, - "retrieval_total": 106, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 36, - "C2_DEPENDENCY_GRAPH": 48, - "C0_SOURCE_CHUNKS": 21 - }, - "merge_rank": 0 - } - } - } - ] - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_router_rag/20260312_084838/router_rag_plba_code_retrieval_plba-rag-find-tests-runtime-manager.md b/tests/pipeline_setup_v2/test_results/plba_router_rag/20260312_084838/router_rag_plba_code_retrieval_plba-rag-find-tests-runtime-manager.md deleted file mode 100644 index 0e95f34..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_router_rag/20260312_084838/router_rag_plba_code_retrieval_plba-rag-find-tests-runtime-manager.md +++ /dev/null @@ -1,32 +0,0 @@ -# plba-rag-find-tests-runtime-manager - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/router_rag_plba_code_retrieval.yaml -- runner: runtime -- mode: router_rag -- passed: True - -## Query -Где тесты для RuntimeManager? - -## Actual -{ - "intent": "CODE_QA", - "sub_intent": "FIND_TESTS", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 16, - "llm_answer": "", - "answer_mode": "partial", - "path_scope": [], - "symbol_candidates": [ - "RuntimeManager" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ] -} - -## Mismatches -- none \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_router_rag/20260312_084838/router_rag_plba_code_retrieval_plba-rag-open-http-control-channel-file.json b/tests/pipeline_setup_v2/test_results/plba_router_rag/20260312_084838/router_rag_plba_code_retrieval_plba-rag-open-http-control-channel-file.json deleted file mode 100644 index 3a71fd9..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_router_rag/20260312_084838/router_rag_plba_code_retrieval_plba-rag-open-http-control-channel-file.json +++ /dev/null @@ -1,445 +0,0 @@ -{ - "case_id": "plba-rag-open-http-control-channel-file", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/router_rag_plba_code_retrieval.yaml", - "runner": "runtime", - "mode": "router_rag", - "actual": { - "intent": "CODE_QA", - "sub_intent": "OPEN_FILE", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 1, - "llm_answer": "", - "answer_mode": "partial", - "path_scope": [ - "src/app_runtime/control/http_channel.py" - ], - "symbol_candidates": [], - "layers": [ - "C0_SOURCE_CHUNKS" - ] - }, - "passed": true, - "mismatches": [], - "details": { - "case_id": "plba-rag-open-http-control-channel-file", - "text": "Покажи файл src/app_runtime/control/http_channel.py", - "mode": "router_rag", - "run_started_at": "2026-03-12T08:48:39", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Покажи файл src/app_runtime/control/http_channel.py", - "symbol_resolution": { - "status": "not_requested", - "resolved_symbol": null, - "alternatives": [], - "confidence": 0.0 - }, - "rag_count": 1, - "rag_rows": [ - { - "path": "src/app_runtime/control/http_channel.py", - "content": "class HttpControlChannel(ControlChannel):\n def __init__(self, host: str, port: int, timeout: int) -> None:\n self._timeout = timeout\n self._runner = UvicornThreadRunner(host, port, timeout)\n self._factory = HttpControlAppFactory()\n self._actions: ControlActionSet | None = None\n\n async def start(self, actions: ControlActionSet) -> None:\n self._actions = actions\n app = self._factory.create(self._health_response, self._action_response)\n await self._runner.start(app)\n\n async def stop(self) -> None:\n await self._runner.stop()\n\n @property\n def port(self) -> int:\n return self._runner.port\n\n async def _health_response(self) -> dict[str, object]:\n if self._actions is None:\n return {\"status\": \"unhealthy\", \"detail\": \"control actions are not configured\"}\n return await asyncio.wait_for(self._actions.health(), timeout=float(self._timeout))\n\n async def _action_response(self, action: str, _client_source: str = \"unknown\") -> JSONResponse:\n if self._actions is None:\n return JSONResponse(content={\"status\": \"error\", \"detail\": f\"{action} handler is not configured\"}, status_code=404)\n callbacks = {\n \"start\": self._actions.start,\n \"stop\": self._actions.stop,\n \"status\": self._actions.status,\n }\n callback = callbacks.get(action)\n if callback is None:\n return JSONResponse(content={\"status\": \"error\", \"detail\": f\"unsupported action: {action}\"}, status_code=404)\n action_timeout = max(float(self._timeout), 10.0) if action in {\"start\", \"stop\"} else float(self._timeout)\n try:\n detail = await asyncio.wait_for(callback(), timeout=action_timeout)\n except asyncio.TimeoutError:\n return JSONResponse(\n content={\"status\": \"accepted\", \"detail\": f\"{action} operation is still in progress\"},\n status_code=202,\n )\n except Exception as exc:\n return JSONResponse(content={\"status\": \"error\", \"detail\": str(exc)}, status_code=500)\n return JSONResponse(content={\"status\": \"ok\", \"detail\": detail or f\"{action} action accepted\"}, status_code=200)", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/http_channel.py:HttpControlChannel", - "span_start": 12, - "span_end": 57, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.http_channel", - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "llm_answer": null, - "summary": { - "router": { - "intent": "CODE_QA", - "sub_intent": "OPEN_FILE", - "confidence": null - }, - "retrieval": { - "profile": "code", - "layers_hit": [ - "C0_SOURCE_CHUNKS" - ], - "evidence_sufficient": true - }, - "llm": { - "answer_status": "partial", - "groundedness": "not_applicable" - } - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "OPEN_FILE", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C0_SOURCE_CHUNKS" - ], - "symbol_kind_hint": "unknown", - "symbol_candidates": [], - "keyword_hints": [], - "path_hints": [ - "src/app_runtime/control/http_channel.py" - ], - "path_scope": [ - "src/app_runtime/control/http_channel.py" - ], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/app_runtime/control/http_channel.py" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": false, - "max_distance": 2, - "top_k": 5 - } - } - }, - "execution": { - "executed_layers": [ - "C0_SOURCE_CHUNKS" - ], - "retrieval_mode_by_layer": { - "C0_SOURCE_CHUNKS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C0_SOURCE_CHUNKS": 200 - }, - "filters_by_layer": { - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src/app_runtime/control/http_channel.py" - ], - "include_globs": [], - "exclude_globs": [], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Покажи файл src/app_runtime/control/http_channel.py", - "path_scope": [ - "src/app_runtime/control/http_channel.py" - ], - "include_globs": [], - "exclude_globs": [], - "prefer_globs": [], - "top_k": 200, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src/app_runtime/control/http_channel.py" - ], - "normalized_include_globs": [], - "normalized_exclude_globs": [], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 1, - "candidates_after_filter": 1 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "not_requested", - "resolved_symbol": null, - "alternatives": [] - }, - "layers": [ - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 1, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "router": 0, - "symbol_resolution": 0, - "retrieval_total": 9, - "retrieval_by_layer": { - "C0_SOURCE_CHUNKS": 9 - }, - "merge_rank": 0, - "prompt_build": 0, - "llm_call": 0 - }, - "prompt": null, - "router": { - "conversation_mode": "START", - "keyword_hints": [], - "path_scope": [ - "src/app_runtime/control/http_channel.py" - ] - }, - "llm": { - "used_evidence_count": 1, - "missing_evidence_reason": null - } - }, - "run_info": { - "case_id": "plba-rag-open-http-control-channel-file", - "mode": "router_rag", - "run_started_at": "2026-03-12T08:48:39", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - }, - "input_request": { - "text": "Покажи файл src/app_runtime/control/http_channel.py", - "normalized_query": "Покажи файл src/app_runtime/control/http_channel.py" - }, - "steps": [ - { - "step": "intent_router", - "input": { - "query": "Покажи файл src/app_runtime/control/http_channel.py" - }, - "output": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Покажи файл src/app_runtime/control/http_channel.py" - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "OPEN_FILE", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C0_SOURCE_CHUNKS" - ], - "symbol_kind_hint": "unknown", - "symbol_candidates": [], - "keyword_hints": [], - "path_hints": [ - "src/app_runtime/control/http_channel.py" - ], - "path_scope": [ - "src/app_runtime/control/http_channel.py" - ], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/app_runtime/control/http_channel.py" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": false, - "max_distance": 2, - "top_k": 5 - } - } - }, - "timings_ms": { - "router": 0 - } - } - }, - { - "step": "retrieval", - "input": { - "query": "Покажи файл src/app_runtime/control/http_channel.py" - }, - "output": { - "symbol_resolution": { - "status": "not_requested", - "resolved_symbol": null, - "alternatives": [], - "confidence": 0.0 - }, - "rag_count": 1, - "rag_rows": [ - { - "path": "src/app_runtime/control/http_channel.py", - "content": "class HttpControlChannel(ControlChannel):\n def __init__(self, host: str, port: int, timeout: int) -> None:\n self._timeout = timeout\n self._runner = UvicornThreadRunner(host, port, timeout)\n self._factory = HttpControlAppFactory()\n self._actions: ControlActionSet | None = None\n\n async def start(self, actions: ControlActionSet) -> None:\n self._actions = actions\n app = self._factory.create(self._health_response, self._action_response)\n await self._runner.start(app)\n\n async def stop(self) -> None:\n await self._runner.stop()\n\n @property\n def port(self) -> int:\n return self._runner.port\n\n async def _health_response(self) -> dict[str, object]:\n if self._actions is None:\n return {\"status\": \"unhealthy\", \"detail\": \"control actions are not configured\"}\n return await asyncio.wait_for(self._actions.health(), timeout=float(self._timeout))\n\n async def _action_response(self, action: str, _client_source: str = \"unknown\") -> JSONResponse:\n if self._actions is None:\n return JSONResponse(content={\"status\": \"error\", \"detail\": f\"{action} handler is not configured\"}, status_code=404)\n callbacks = {\n \"start\": self._actions.start,\n \"stop\": self._actions.stop,\n \"status\": self._actions.status,\n }\n callback = callbacks.get(action)\n if callback is None:\n return JSONResponse(content={\"status\": \"error\", \"detail\": f\"unsupported action: {action}\"}, status_code=404)\n action_timeout = max(float(self._timeout), 10.0) if action in {\"start\", \"stop\"} else float(self._timeout)\n try:\n detail = await asyncio.wait_for(callback(), timeout=action_timeout)\n except asyncio.TimeoutError:\n return JSONResponse(\n content={\"status\": \"accepted\", \"detail\": f\"{action} operation is still in progress\"},\n status_code=202,\n )\n except Exception as exc:\n return JSONResponse(content={\"status\": \"error\", \"detail\": str(exc)}, status_code=500)\n return JSONResponse(content={\"status\": \"ok\", \"detail\": detail or f\"{action} action accepted\"}, status_code=200)", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/http_channel.py:HttpControlChannel", - "span_start": 12, - "span_end": 57, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.http_channel", - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ] - }, - "diagnostics": { - "execution": { - "executed_layers": [ - "C0_SOURCE_CHUNKS" - ], - "retrieval_mode_by_layer": { - "C0_SOURCE_CHUNKS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C0_SOURCE_CHUNKS": 200 - }, - "filters_by_layer": { - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src/app_runtime/control/http_channel.py" - ], - "include_globs": [], - "exclude_globs": [], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Покажи файл src/app_runtime/control/http_channel.py", - "path_scope": [ - "src/app_runtime/control/http_channel.py" - ], - "include_globs": [], - "exclude_globs": [], - "prefer_globs": [], - "top_k": 200, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src/app_runtime/control/http_channel.py" - ], - "normalized_include_globs": [], - "normalized_exclude_globs": [], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 1, - "candidates_after_filter": 1 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "not_requested", - "resolved_symbol": null, - "alternatives": [] - }, - "layers": [ - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 1, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "symbol_resolution": 0, - "retrieval_total": 9, - "retrieval_by_layer": { - "C0_SOURCE_CHUNKS": 9 - }, - "merge_rank": 0 - } - } - } - ] - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_router_rag/20260312_084838/router_rag_plba_code_retrieval_plba-rag-open-http-control-channel-file.md b/tests/pipeline_setup_v2/test_results/plba_router_rag/20260312_084838/router_rag_plba_code_retrieval_plba-rag-open-http-control-channel-file.md deleted file mode 100644 index ceac477..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_router_rag/20260312_084838/router_rag_plba_code_retrieval_plba-rag-open-http-control-channel-file.md +++ /dev/null @@ -1,30 +0,0 @@ -# plba-rag-open-http-control-channel-file - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/router_rag_plba_code_retrieval.yaml -- runner: runtime -- mode: router_rag -- passed: True - -## Query -Покажи файл src/app_runtime/control/http_channel.py - -## Actual -{ - "intent": "CODE_QA", - "sub_intent": "OPEN_FILE", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 1, - "llm_answer": "", - "answer_mode": "partial", - "path_scope": [ - "src/app_runtime/control/http_channel.py" - ], - "symbol_candidates": [], - "layers": [ - "C0_SOURCE_CHUNKS" - ] -} - -## Mismatches -- none \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_router_rag/20260312_084838/router_rag_plba_code_retrieval_plba-rag-open-runtime-manager-file.json b/tests/pipeline_setup_v2/test_results/plba_router_rag/20260312_084838/router_rag_plba_code_retrieval_plba-rag-open-runtime-manager-file.json deleted file mode 100644 index c38fc7f..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_router_rag/20260312_084838/router_rag_plba_code_retrieval_plba-rag-open-runtime-manager-file.json +++ /dev/null @@ -1,445 +0,0 @@ -{ - "case_id": "plba-rag-open-runtime-manager-file", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/router_rag_plba_code_retrieval.yaml", - "runner": "runtime", - "mode": "router_rag", - "actual": { - "intent": "CODE_QA", - "sub_intent": "OPEN_FILE", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 1, - "llm_answer": "", - "answer_mode": "partial", - "path_scope": [ - "src/app_runtime/core/runtime.py" - ], - "symbol_candidates": [], - "layers": [ - "C0_SOURCE_CHUNKS" - ] - }, - "passed": true, - "mismatches": [], - "details": { - "case_id": "plba-rag-open-runtime-manager-file", - "text": "Открой файл src/app_runtime/core/runtime.py", - "mode": "router_rag", - "run_started_at": "2026-03-12T08:48:39", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Открой файл src/app_runtime/core/runtime.py", - "symbol_resolution": { - "status": "not_requested", - "resolved_symbol": null, - "alternatives": [], - "confidence": 0.0 - }, - "rag_count": 1, - "rag_rows": [ - { - "path": "src/app_runtime/core/runtime.py", - "content": "class RuntimeManager:\n ACTION_TIMEOUT_SECONDS = 10.0\n ACTION_POLL_INTERVAL_SECONDS = 0.05\n\n def __init__(\n self,\n configuration: ConfigurationManager | None = None,\n services: ServiceContainer | None = None,\n traces: TraceService | None = None,\n health: HealthRegistry | None = None,\n logs: LogManager | None = None,\n workers: WorkerSupervisor | None = None,\n control_plane: ControlPlaneService | None = None,\n ) -> None:\n self.configuration = configuration or ConfigurationManager()\n self.services = services or ServiceContainer()\n self.traces = traces or TraceService()\n self.health = health or HealthRegistry()\n self.logs = logs or LogManager()\n self.workers = workers or WorkerSupervisor()\n self.control_plane = control_plane or ControlPlaneService()\n self.registry = ModuleRegistry(self.services)\n self._started = False\n self._state = LifecycleState.IDLE\n self._core_registered = False\n self._workers_registered = False\n self._register_core_services()\n\n def register_module(self, module: ApplicationModule) -> None:\n self.registry.register_module(module.name)\n module.register(self.registry)\n\n def add_config_file(self, path: str) -> FileConfigProvider:\n provider = FileConfigProvider(path)\n self.configuration.add_provider(provider)\n return provider\n\n def start(self, *, start_control_plane: bool = True) -> None:\n if self._started:\n return\n self._state = LifecycleState.STARTING\n config = self.configuration.load()\n self.logs.apply_config(config)\n self._register_health_contributors()\n self._register_workers()\n self.workers.start()\n if start_control_plane:\n self.control_plane.start(self)\n self._started = True\n self._refresh_state()\n\n def stop(self, timeout: float = 30.0, force: bool = False, stop_control_plane: bool = True) -> None:\n if not self._started:\n return\n self._state = LifecycleState.STOPPING\n self.workers.stop(timeout=timeout, force=force)\n if stop_control_plane:\n self.control_plane.stop()\n self._started = False\n self._state = LifecycleState.STOPPED\n\n def status(self) -> dict[str, object]:\n self._refresh_state()\n return self.control_plane.snapshot(self)\n\n def current_health(self) -> HealthPayload:\n self._refresh_state()\n return self.health.payload(self._state, self.workers.healths())\n\n async def health_status(self) -> HealthPayload:\n return self.current_health()\n\n async def start_runtime(self) -> dict[str, object] | str:\n self._refresh_state()\n if self._started:\n return \"runtime already running\"\n if self._state == LifecycleState.STOPPING:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n\n self.start(start_control_plane=False)\n started = self._wait_for_state({LifecycleState.IDLE, LifecycleState.BUSY}, timeout=self.ACTION_TIMEOUT_SECONDS)\n if started:\n return self._action_detail(\"runtime started\", timed_out=False)\n return self._action_detail(\"runtime start is still in progress\", timed_out=True)\n\n async def stop_runtime(self) -> dict[str, object] | str:\n self._refresh_state()\n if not self._started:\n if self._state == LifecycleState.STOPPING:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n return \"runtime already stopped\"\n\n self._state = LifecycleState.STOPPING\n try:\n self.workers.stop(timeout=self.ACTION_TIMEOUT_SECONDS, force=False)\n except TimeoutError:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n\n self._started = False\n self._state = LifecycleState.STOPPED\n return self._action_detail(\"runtime stopped\", timed_out=False)\n\n async def runtime_status(self) -> str:\n self._refresh_state()\n return self._state.value\n\n def _register_core_services(self) -> None:\n if self._core_registered:\n return\n self.services.register(\"configuration\", self.configuration)\n self.services.register(\"traces\", self.traces)\n self.services.register(\"health\", self.health)\n self.services.register(\"logs\", self.logs)\n self.services.register(\"workers\", self.workers)\n self.services.register(\"control_plane\", self.control_plane)\n self._core_registered = True\n\n def _register_health_contributors(self) -> None:\n for contributor in self.registry.health_contributors:\n self.health.register(contributor)\n\n def _register_workers(self) -> None:\n if self._workers_registered:\n return\n for worker in self.registry.workers:\n self.workers.register(worker)\n self._workers_registered = True\n\n def _refresh_state(self) -> None:\n lifecycle = self.workers.lifecycle_state()\n\n if self._state == LifecycleState.STOPPING:\n if lifecycle == LifecycleState.STOPPED:\n self._started = False\n self._state = LifecycleState.STOPPED\n return\n\n if not self._started:\n if lifecycle == LifecycleState.STOPPED:\n self._state = LifecycleState.STOPPED\n return\n\n self._state = lifecycle\n\n def _wait_for_state(self, target_states: set[LifecycleState], *, timeout: float) -> bool:\n deadline = monotonic() + timeout\n while monotonic() < deadline:\n self._refresh_state()\n if self._state in target_states:\n return True\n sleep(self.ACTION_POLL_INTERVAL_SECONDS)\n self._refresh_state()\n return self._state in target_states\n\n def _action_detail(self, message: str, *, timed_out: bool) -> dict[str, object]:\n self._refresh_state()\n return {\n \"message\": message,\n \"state\": self._state.value,\n \"timed_out\": timed_out,\n \"workers\": self.workers.snapshot(),\n }", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/core/runtime.py:RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.core.runtime", - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "llm_answer": null, - "summary": { - "router": { - "intent": "CODE_QA", - "sub_intent": "OPEN_FILE", - "confidence": null - }, - "retrieval": { - "profile": "code", - "layers_hit": [ - "C0_SOURCE_CHUNKS" - ], - "evidence_sufficient": true - }, - "llm": { - "answer_status": "partial", - "groundedness": "not_applicable" - } - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "OPEN_FILE", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C0_SOURCE_CHUNKS" - ], - "symbol_kind_hint": "unknown", - "symbol_candidates": [], - "keyword_hints": [], - "path_hints": [ - "src/app_runtime/core/runtime.py" - ], - "path_scope": [ - "src/app_runtime/core/runtime.py" - ], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/app_runtime/core/runtime.py" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": false, - "max_distance": 2, - "top_k": 5 - } - } - }, - "execution": { - "executed_layers": [ - "C0_SOURCE_CHUNKS" - ], - "retrieval_mode_by_layer": { - "C0_SOURCE_CHUNKS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C0_SOURCE_CHUNKS": 200 - }, - "filters_by_layer": { - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src/app_runtime/core/runtime.py" - ], - "include_globs": [], - "exclude_globs": [], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Открой файл src/app_runtime/core/runtime.py", - "path_scope": [ - "src/app_runtime/core/runtime.py" - ], - "include_globs": [], - "exclude_globs": [], - "prefer_globs": [], - "top_k": 200, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src/app_runtime/core/runtime.py" - ], - "normalized_include_globs": [], - "normalized_exclude_globs": [], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 1, - "candidates_after_filter": 1 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "not_requested", - "resolved_symbol": null, - "alternatives": [] - }, - "layers": [ - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 1, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "router": 0, - "symbol_resolution": 0, - "retrieval_total": 210, - "retrieval_by_layer": { - "C0_SOURCE_CHUNKS": 210 - }, - "merge_rank": 0, - "prompt_build": 0, - "llm_call": 0 - }, - "prompt": null, - "router": { - "conversation_mode": "START", - "keyword_hints": [], - "path_scope": [ - "src/app_runtime/core/runtime.py" - ] - }, - "llm": { - "used_evidence_count": 1, - "missing_evidence_reason": null - } - }, - "run_info": { - "case_id": "plba-rag-open-runtime-manager-file", - "mode": "router_rag", - "run_started_at": "2026-03-12T08:48:39", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - }, - "input_request": { - "text": "Открой файл src/app_runtime/core/runtime.py", - "normalized_query": "Открой файл src/app_runtime/core/runtime.py" - }, - "steps": [ - { - "step": "intent_router", - "input": { - "query": "Открой файл src/app_runtime/core/runtime.py" - }, - "output": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Открой файл src/app_runtime/core/runtime.py" - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "OPEN_FILE", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C0_SOURCE_CHUNKS" - ], - "symbol_kind_hint": "unknown", - "symbol_candidates": [], - "keyword_hints": [], - "path_hints": [ - "src/app_runtime/core/runtime.py" - ], - "path_scope": [ - "src/app_runtime/core/runtime.py" - ], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/app_runtime/core/runtime.py" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": false, - "max_distance": 2, - "top_k": 5 - } - } - }, - "timings_ms": { - "router": 0 - } - } - }, - { - "step": "retrieval", - "input": { - "query": "Открой файл src/app_runtime/core/runtime.py" - }, - "output": { - "symbol_resolution": { - "status": "not_requested", - "resolved_symbol": null, - "alternatives": [], - "confidence": 0.0 - }, - "rag_count": 1, - "rag_rows": [ - { - "path": "src/app_runtime/core/runtime.py", - "content": "class RuntimeManager:\n ACTION_TIMEOUT_SECONDS = 10.0\n ACTION_POLL_INTERVAL_SECONDS = 0.05\n\n def __init__(\n self,\n configuration: ConfigurationManager | None = None,\n services: ServiceContainer | None = None,\n traces: TraceService | None = None,\n health: HealthRegistry | None = None,\n logs: LogManager | None = None,\n workers: WorkerSupervisor | None = None,\n control_plane: ControlPlaneService | None = None,\n ) -> None:\n self.configuration = configuration or ConfigurationManager()\n self.services = services or ServiceContainer()\n self.traces = traces or TraceService()\n self.health = health or HealthRegistry()\n self.logs = logs or LogManager()\n self.workers = workers or WorkerSupervisor()\n self.control_plane = control_plane or ControlPlaneService()\n self.registry = ModuleRegistry(self.services)\n self._started = False\n self._state = LifecycleState.IDLE\n self._core_registered = False\n self._workers_registered = False\n self._register_core_services()\n\n def register_module(self, module: ApplicationModule) -> None:\n self.registry.register_module(module.name)\n module.register(self.registry)\n\n def add_config_file(self, path: str) -> FileConfigProvider:\n provider = FileConfigProvider(path)\n self.configuration.add_provider(provider)\n return provider\n\n def start(self, *, start_control_plane: bool = True) -> None:\n if self._started:\n return\n self._state = LifecycleState.STARTING\n config = self.configuration.load()\n self.logs.apply_config(config)\n self._register_health_contributors()\n self._register_workers()\n self.workers.start()\n if start_control_plane:\n self.control_plane.start(self)\n self._started = True\n self._refresh_state()\n\n def stop(self, timeout: float = 30.0, force: bool = False, stop_control_plane: bool = True) -> None:\n if not self._started:\n return\n self._state = LifecycleState.STOPPING\n self.workers.stop(timeout=timeout, force=force)\n if stop_control_plane:\n self.control_plane.stop()\n self._started = False\n self._state = LifecycleState.STOPPED\n\n def status(self) -> dict[str, object]:\n self._refresh_state()\n return self.control_plane.snapshot(self)\n\n def current_health(self) -> HealthPayload:\n self._refresh_state()\n return self.health.payload(self._state, self.workers.healths())\n\n async def health_status(self) -> HealthPayload:\n return self.current_health()\n\n async def start_runtime(self) -> dict[str, object] | str:\n self._refresh_state()\n if self._started:\n return \"runtime already running\"\n if self._state == LifecycleState.STOPPING:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n\n self.start(start_control_plane=False)\n started = self._wait_for_state({LifecycleState.IDLE, LifecycleState.BUSY}, timeout=self.ACTION_TIMEOUT_SECONDS)\n if started:\n return self._action_detail(\"runtime started\", timed_out=False)\n return self._action_detail(\"runtime start is still in progress\", timed_out=True)\n\n async def stop_runtime(self) -> dict[str, object] | str:\n self._refresh_state()\n if not self._started:\n if self._state == LifecycleState.STOPPING:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n return \"runtime already stopped\"\n\n self._state = LifecycleState.STOPPING\n try:\n self.workers.stop(timeout=self.ACTION_TIMEOUT_SECONDS, force=False)\n except TimeoutError:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n\n self._started = False\n self._state = LifecycleState.STOPPED\n return self._action_detail(\"runtime stopped\", timed_out=False)\n\n async def runtime_status(self) -> str:\n self._refresh_state()\n return self._state.value\n\n def _register_core_services(self) -> None:\n if self._core_registered:\n return\n self.services.register(\"configuration\", self.configuration)\n self.services.register(\"traces\", self.traces)\n self.services.register(\"health\", self.health)\n self.services.register(\"logs\", self.logs)\n self.services.register(\"workers\", self.workers)\n self.services.register(\"control_plane\", self.control_plane)\n self._core_registered = True\n\n def _register_health_contributors(self) -> None:\n for contributor in self.registry.health_contributors:\n self.health.register(contributor)\n\n def _register_workers(self) -> None:\n if self._workers_registered:\n return\n for worker in self.registry.workers:\n self.workers.register(worker)\n self._workers_registered = True\n\n def _refresh_state(self) -> None:\n lifecycle = self.workers.lifecycle_state()\n\n if self._state == LifecycleState.STOPPING:\n if lifecycle == LifecycleState.STOPPED:\n self._started = False\n self._state = LifecycleState.STOPPED\n return\n\n if not self._started:\n if lifecycle == LifecycleState.STOPPED:\n self._state = LifecycleState.STOPPED\n return\n\n self._state = lifecycle\n\n def _wait_for_state(self, target_states: set[LifecycleState], *, timeout: float) -> bool:\n deadline = monotonic() + timeout\n while monotonic() < deadline:\n self._refresh_state()\n if self._state in target_states:\n return True\n sleep(self.ACTION_POLL_INTERVAL_SECONDS)\n self._refresh_state()\n return self._state in target_states\n\n def _action_detail(self, message: str, *, timed_out: bool) -> dict[str, object]:\n self._refresh_state()\n return {\n \"message\": message,\n \"state\": self._state.value,\n \"timed_out\": timed_out,\n \"workers\": self.workers.snapshot(),\n }", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/core/runtime.py:RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.core.runtime", - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ] - }, - "diagnostics": { - "execution": { - "executed_layers": [ - "C0_SOURCE_CHUNKS" - ], - "retrieval_mode_by_layer": { - "C0_SOURCE_CHUNKS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C0_SOURCE_CHUNKS": 200 - }, - "filters_by_layer": { - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src/app_runtime/core/runtime.py" - ], - "include_globs": [], - "exclude_globs": [], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Открой файл src/app_runtime/core/runtime.py", - "path_scope": [ - "src/app_runtime/core/runtime.py" - ], - "include_globs": [], - "exclude_globs": [], - "prefer_globs": [], - "top_k": 200, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src/app_runtime/core/runtime.py" - ], - "normalized_include_globs": [], - "normalized_exclude_globs": [], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 1, - "candidates_after_filter": 1 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "not_requested", - "resolved_symbol": null, - "alternatives": [] - }, - "layers": [ - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 1, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "symbol_resolution": 0, - "retrieval_total": 210, - "retrieval_by_layer": { - "C0_SOURCE_CHUNKS": 210 - }, - "merge_rank": 0 - } - } - } - ] - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_router_rag/20260312_084838/router_rag_plba_code_retrieval_plba-rag-open-runtime-manager-file.md b/tests/pipeline_setup_v2/test_results/plba_router_rag/20260312_084838/router_rag_plba_code_retrieval_plba-rag-open-runtime-manager-file.md deleted file mode 100644 index fc55328..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_router_rag/20260312_084838/router_rag_plba_code_retrieval_plba-rag-open-runtime-manager-file.md +++ /dev/null @@ -1,30 +0,0 @@ -# plba-rag-open-runtime-manager-file - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/router_rag_plba_code_retrieval.yaml -- runner: runtime -- mode: router_rag -- passed: True - -## Query -Открой файл src/app_runtime/core/runtime.py - -## Actual -{ - "intent": "CODE_QA", - "sub_intent": "OPEN_FILE", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 1, - "llm_answer": "", - "answer_mode": "partial", - "path_scope": [ - "src/app_runtime/core/runtime.py" - ], - "symbol_candidates": [], - "layers": [ - "C0_SOURCE_CHUNKS" - ] -} - -## Mismatches -- none \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_router_rag/20260312_084838/summary.md b/tests/pipeline_setup_v2/test_results/plba_router_rag/20260312_084838/summary.md deleted file mode 100644 index 4b0aab5..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_router_rag/20260312_084838/summary.md +++ /dev/null @@ -1,21 +0,0 @@ -# pipeline_setup_v2 summary - -Passed: 9/11 - -| File | Case | Runner | Mode | Intent | Sub-intent | Pass | -|------|------|--------|------|--------|------------|------| -| router_rag_plba_code_retrieval.yaml | plba-rag-open-runtime-manager-file | runtime | router_rag | CODE_QA | OPEN_FILE | ✓ | -| router_rag_plba_code_retrieval.yaml | plba-rag-open-http-control-channel-file | runtime | router_rag | CODE_QA | OPEN_FILE | ✓ | -| router_rag_plba_code_retrieval.yaml | plba-rag-explain-runtime-manager | runtime | router_rag | CODE_QA | EXPLAIN | ✓ | -| router_rag_plba_code_retrieval.yaml | plba-rag-explain-http-control-channel | runtime | router_rag | CODE_QA | EXPLAIN | ✓ | -| router_rag_plba_code_retrieval.yaml | plba-rag-explain-trace-service | runtime | router_rag | CODE_QA | EXPLAIN | ✓ | -| router_rag_plba_code_retrieval.yaml | plba-rag-find-tests-runtime-manager | runtime | router_rag | CODE_QA | FIND_TESTS | ✓ | -| router_rag_plba_code_retrieval.yaml | plba-rag-find-tests-http-control-channel | runtime | router_rag | CODE_QA | FIND_TESTS | ✓ | -| router_rag_plba_code_retrieval.yaml | plba-rag-find-entrypoints | runtime | router_rag | CODE_QA | FIND_ENTRYPOINTS | ✓ | -| router_rag_plba_code_retrieval.yaml | plba-rag-explain-create-runtime | runtime | router_rag | CODE_QA | EXPLAIN | ✓ | -| router_rag_plba_code_retrieval.yaml | plba-rag-explain-runtime-module | runtime | router_rag | CODE_QA | EXPLAIN | ✗ | -| router_rag_plba_code_retrieval.yaml | plba-rag-explain-control-plane | runtime | router_rag | CODE_QA | EXPLAIN | ✗ | - -## Failures -- **plba-rag-explain-runtime-module**: retrieval: expected non-empty rag, got 0 rows -- **plba-rag-explain-control-plane**: retrieval: expected non-empty rag, got 0 rows \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_router_rag/20260312_085312/router_rag_plba_code_retrieval_plba-rag-explain-control-plane-service.json b/tests/pipeline_setup_v2/test_results/plba_router_rag/20260312_085312/router_rag_plba_code_retrieval_plba-rag-explain-control-plane-service.json deleted file mode 100644 index 25dbfb1..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_router_rag/20260312_085312/router_rag_plba_code_retrieval_plba-rag-explain-control-plane-service.json +++ /dev/null @@ -1,2445 +0,0 @@ -{ - "case_id": "plba-rag-explain-control-plane-service", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/router_rag_plba_code_retrieval.yaml", - "runner": "runtime", - "mode": "router_rag", - "actual": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 19, - "llm_answer": "", - "answer_mode": "partial", - "path_scope": [], - "symbol_candidates": [ - "ControlPlaneService" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "passed": true, - "mismatches": [], - "details": { - "case_id": "plba-rag-explain-control-plane-service", - "text": "Объясни класс ControlPlaneService", - "mode": "router_rag", - "run_started_at": "2026-03-12T08:53:12", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Объясни класс ControlPlaneService", - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "ControlPlaneService", - "alternatives": [ - "ControlPlaneService" - ], - "confidence": 0.99 - }, - "rag_count": 19, - "rag_rows": [ - { - "path": "src/app_runtime/control/service.py", - "content": "class ControlPlaneService\nControlPlaneService", - "layer": "C1_SYMBOL_CATALOG", - "title": "ControlPlaneService", - "span_start": 12, - "span_end": 52, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "b13471e5916986dccffb53fab613812842965705e6b3a89ae549d30c9e91e9aa", - "qname": "ControlPlaneService", - "kind": "class", - "signature": "ControlPlaneService", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.control.service", - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests service\n- reads and writes state attributes\n- participates in dataflow slices (5)", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlPlaneService", - "span_start": 12, - "span_end": 52, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 68, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "b13471e5916986dccffb53fab613812842965705e6b3a89ae549d30c9e91e9aa", - "symbol_name": "ControlPlaneService", - "qname": "ControlPlaneService", - "role": "pipeline_stage", - "confidence": 0.57, - "dataflow_participation": 5, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "ControlChannel\nrole: model\n\nResponsibilities:\n- default model role", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlChannel", - "span_start": 21, - "span_end": 28, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 40, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "cfcfe9a311d3a2dbdaf32ac4ccd73c0eb9a117f830591a1c0867ee97d46204ff", - "symbol_name": "ControlChannel", - "qname": "ControlChannel", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "ControlActionSet\nrole: model\n\nResponsibilities:\n- default model role", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlActionSet", - "span_start": 14, - "span_end": 18, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 40, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "46eb026cb3313415ec47b82dd22f84f4d112c9d987e8b1716dcb0baa1cce8988", - "symbol_name": "ControlActionSet", - "qname": "ControlActionSet", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_runner.py", - "content": "UvicornThreadRunner\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (24)", - "layer": "C4_SEMANTIC_ROLES", - "title": "UvicornThreadRunner", - "span_start": 10, - "span_end": 61, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 11, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "fd55630045a02100df8877ac27d951ee08617d4598764394d48cb51fe067476a", - "symbol_name": "UvicornThreadRunner", - "qname": "UvicornThreadRunner", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 24, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "3779fdd2878b770e789a35bb2a89c9d79f13b61c26d7db1b3b683f9bb9e1623f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (10)", - "layer": "C4_SEMANTIC_ROLES", - "title": "HttpControlChannel", - "span_start": 12, - "span_end": 57, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 21, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "1c9fbdc24819e5604c26ea55428a74310f03a03e1af197ed84846af61e42fdb0", - "symbol_name": "HttpControlChannel", - "qname": "HttpControlChannel", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 10, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "HttpControlAppFactory\nrole: factory\n\nResponsibilities:\n- name suffix suggests factory", - "layer": "C4_SEMANTIC_ROLES", - "title": "HttpControlAppFactory", - "span_start": 15, - "span_end": 53, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 39, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "9b3502a5fb408b273223db13264349cf500de24915b6c649d9ea8970d0dfd8e0", - "symbol_name": "HttpControlAppFactory", - "qname": "HttpControlAppFactory", - "role": "factory", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/persistence/workflow_persistence.py", - "content": "WorkflowPersistence\nrole: pipeline_stage\n\nResponsibilities:\n- orchestrates role-like calls (2)\n- reads and writes state attributes\n- participates in dataflow slices (16)", - "layer": "C4_SEMANTIC_ROLES", - "title": "WorkflowPersistence", - "span_start": 8, - "span_end": 54, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 15, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "7bd01ee45cf31f2d5c2e3e51656254860ac785d10cef9e0852cd4fba90857bae", - "symbol_name": "WorkflowPersistence", - "qname": "WorkflowPersistence", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 16, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "80e9410ddc639789b4353c2a1a757ba8d0d5b5bb6075b0b263b61551f04ae1f0", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/queue/in_memory.py", - "content": "InMemoryTaskQueue\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (9)", - "layer": "C4_SEMANTIC_ROLES", - "title": "InMemoryTaskQueue", - "span_start": 9, - "span_end": 38, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 22, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "2da04cb94544a3bcbf0943a95ad4bdd8710bcafaa32a02fd0e4de2178dcf3533", - "symbol_name": "InMemoryTaskQueue", - "qname": "InMemoryTaskQueue", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 9, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "58f0cc001ccda0eee4c6bc32ed83bd05eafd6b6644f1e8b4aa9eed3103db73dc", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.stop", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 25, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d", - "dst_ref": "ControlPlaneService.stop", - "resolution": "resolved", - "slice_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.stop" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._stop_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 51, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a", - "dst_ref": "ControlPlaneService._stop_async", - "resolution": "resolved", - "slice_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._stop_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.register_channel", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 17, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957", - "dst_ref": "ControlPlaneService.register_channel", - "resolution": "resolved", - "slice_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.register_channel" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.start", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 20, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154", - "dst_ref": "ControlPlaneService.start", - "resolution": "resolved", - "slice_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.start" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._start_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 47, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517", - "dst_ref": "ControlPlaneService._start_async", - "resolution": "resolved", - "slice_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._start_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.register_channel reads_attr self._channels.append", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.register_channel:reads_attr", - "span_start": 17, - "span_end": 17, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "1ee5925deffdc38ba15b88bf7c89e5fcd1a78f493fe30f2deb827d714a1b18e8", - "edge_type": "reads_attr", - "src_symbol_id": "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957", - "src_qname": "ControlPlaneService.register_channel", - "dst_symbol_id": null, - "dst_ref": "self._channels.append", - "resolution": "partial", - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "class ControlPlaneService:\n def __init__(self) -> None:\n self._channels: list[ControlChannel] = []\n\n def register_channel(self, channel: ControlChannel) -> None:\n self._channels.append(channel)\n\n def start(self, runtime: RuntimeManager) -> None:\n if not self._channels:\n return\n asyncio.run(self._start_async(runtime))\n\n def stop(self) -> None:\n if not self._channels:\n return\n asyncio.run(self._stop_async())\n\n def snapshot(self, runtime: RuntimeManager) -> dict[str, object]:\n health = runtime.current_health()\n return {\n \"runtime\": {\"state\": runtime._state.value},\n \"modules\": list(runtime.registry.modules),\n \"services\": runtime.services.snapshot(),\n \"workers\": runtime.workers.snapshot(),\n \"health\": runtime.health.snapshot(runtime.workers.healths()) | {\"status\": health[\"status\"]},\n \"config\": runtime.configuration.get(),\n }\n\n async def _start_async(self, runtime: RuntimeManager) -> None:\n actions = ControlActionSet(\n health=runtime.health_status,\n start=runtime.start_runtime,\n stop=runtime.stop_runtime,\n status=runtime.runtime_status,\n )\n for channel in self._channels:\n await channel.start(actions)\n\n async def _stop_async(self) -> None:\n for channel in reversed(self._channels):\n await channel.stop()", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/service.py:ControlPlaneService", - "span_start": 12, - "span_end": 52, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.service", - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "llm_answer": null, - "summary": { - "router": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "confidence": null - }, - "retrieval": { - "profile": "code", - "layers_hit": [ - "C0_SOURCE_CHUNKS", - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS", - "C4_SEMANTIC_ROLES" - ], - "evidence_sufficient": true - }, - "llm": { - "answer_status": "partial", - "groundedness": "not_applicable" - } - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "ControlPlaneService" - ], - "keyword_hints": [ - "ControlPlaneService" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C0_SOURCE_CHUNKS": "exact_path_fetch", - "C4_SEMANTIC_ROLES": "exact_path_fetch", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C3_ENTRYPOINTS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 8, - "C4_SEMANTIC_ROLES": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C3_ENTRYPOINTS": 6 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C4_SEMANTIC_ROLES": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "ControlPlaneService", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Объясни класс ControlPlaneService", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C4_SEMANTIC_ROLES", - "query": "Объясни класс ControlPlaneService", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "Объясни класс ControlPlaneService", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - }, - { - "layer": "C3_ENTRYPOINTS", - "query": "Объясни класс ControlPlaneService", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 1, - "candidates_after_filter": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 6, - "candidates_after_filter": 6 - }, - { - "layer": "C3_ENTRYPOINTS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 3, - "candidates_after_filter": 3 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "ControlPlaneService", - "alternatives": [ - "ControlPlaneService" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C4_SEMANTIC_ROLES", - "status": "hit", - "hit_count": 8, - "fail_reason": null - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 6, - "fail_reason": null - }, - { - "layer": "C3_ENTRYPOINTS", - "status": "hit", - "hit_count": 3, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "router": 0, - "symbol_resolution": 0, - "retrieval_total": 103, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 21, - "C0_SOURCE_CHUNKS": 12, - "C4_SEMANTIC_ROLES": 10, - "C2_DEPENDENCY_GRAPH": 50, - "C3_ENTRYPOINTS": 8 - }, - "merge_rank": 15, - "prompt_build": 0, - "llm_call": 0 - }, - "prompt": null, - "router": { - "conversation_mode": "START", - "keyword_hints": [ - "ControlPlaneService" - ], - "path_scope": [] - }, - "llm": { - "used_evidence_count": 19, - "missing_evidence_reason": null - } - }, - "run_info": { - "case_id": "plba-rag-explain-control-plane-service", - "mode": "router_rag", - "run_started_at": "2026-03-12T08:53:12", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - }, - "input_request": { - "text": "Объясни класс ControlPlaneService", - "normalized_query": "Объясни класс ControlPlaneService" - }, - "steps": [ - { - "step": "intent_router", - "input": { - "query": "Объясни класс ControlPlaneService" - }, - "output": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Объясни класс ControlPlaneService" - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "ControlPlaneService" - ], - "keyword_hints": [ - "ControlPlaneService" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "timings_ms": { - "router": 0 - } - } - }, - { - "step": "retrieval", - "input": { - "query": "Объясни класс ControlPlaneService" - }, - "output": { - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "ControlPlaneService", - "alternatives": [ - "ControlPlaneService" - ], - "confidence": 0.99 - }, - "rag_count": 19, - "rag_rows": [ - { - "path": "src/app_runtime/control/service.py", - "content": "class ControlPlaneService\nControlPlaneService", - "layer": "C1_SYMBOL_CATALOG", - "title": "ControlPlaneService", - "span_start": 12, - "span_end": 52, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "b13471e5916986dccffb53fab613812842965705e6b3a89ae549d30c9e91e9aa", - "qname": "ControlPlaneService", - "kind": "class", - "signature": "ControlPlaneService", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.control.service", - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests service\n- reads and writes state attributes\n- participates in dataflow slices (5)", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlPlaneService", - "span_start": 12, - "span_end": 52, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 68, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "b13471e5916986dccffb53fab613812842965705e6b3a89ae549d30c9e91e9aa", - "symbol_name": "ControlPlaneService", - "qname": "ControlPlaneService", - "role": "pipeline_stage", - "confidence": 0.57, - "dataflow_participation": 5, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "ControlChannel\nrole: model\n\nResponsibilities:\n- default model role", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlChannel", - "span_start": 21, - "span_end": 28, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 40, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "cfcfe9a311d3a2dbdaf32ac4ccd73c0eb9a117f830591a1c0867ee97d46204ff", - "symbol_name": "ControlChannel", - "qname": "ControlChannel", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "ControlActionSet\nrole: model\n\nResponsibilities:\n- default model role", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlActionSet", - "span_start": 14, - "span_end": 18, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 40, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "46eb026cb3313415ec47b82dd22f84f4d112c9d987e8b1716dcb0baa1cce8988", - "symbol_name": "ControlActionSet", - "qname": "ControlActionSet", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_runner.py", - "content": "UvicornThreadRunner\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (24)", - "layer": "C4_SEMANTIC_ROLES", - "title": "UvicornThreadRunner", - "span_start": 10, - "span_end": 61, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 11, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "fd55630045a02100df8877ac27d951ee08617d4598764394d48cb51fe067476a", - "symbol_name": "UvicornThreadRunner", - "qname": "UvicornThreadRunner", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 24, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "3779fdd2878b770e789a35bb2a89c9d79f13b61c26d7db1b3b683f9bb9e1623f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (10)", - "layer": "C4_SEMANTIC_ROLES", - "title": "HttpControlChannel", - "span_start": 12, - "span_end": 57, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 21, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "1c9fbdc24819e5604c26ea55428a74310f03a03e1af197ed84846af61e42fdb0", - "symbol_name": "HttpControlChannel", - "qname": "HttpControlChannel", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 10, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "HttpControlAppFactory\nrole: factory\n\nResponsibilities:\n- name suffix suggests factory", - "layer": "C4_SEMANTIC_ROLES", - "title": "HttpControlAppFactory", - "span_start": 15, - "span_end": 53, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 39, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "9b3502a5fb408b273223db13264349cf500de24915b6c649d9ea8970d0dfd8e0", - "symbol_name": "HttpControlAppFactory", - "qname": "HttpControlAppFactory", - "role": "factory", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/persistence/workflow_persistence.py", - "content": "WorkflowPersistence\nrole: pipeline_stage\n\nResponsibilities:\n- orchestrates role-like calls (2)\n- reads and writes state attributes\n- participates in dataflow slices (16)", - "layer": "C4_SEMANTIC_ROLES", - "title": "WorkflowPersistence", - "span_start": 8, - "span_end": 54, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 15, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "7bd01ee45cf31f2d5c2e3e51656254860ac785d10cef9e0852cd4fba90857bae", - "symbol_name": "WorkflowPersistence", - "qname": "WorkflowPersistence", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 16, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "80e9410ddc639789b4353c2a1a757ba8d0d5b5bb6075b0b263b61551f04ae1f0", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/queue/in_memory.py", - "content": "InMemoryTaskQueue\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (9)", - "layer": "C4_SEMANTIC_ROLES", - "title": "InMemoryTaskQueue", - "span_start": 9, - "span_end": 38, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 22, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "2da04cb94544a3bcbf0943a95ad4bdd8710bcafaa32a02fd0e4de2178dcf3533", - "symbol_name": "InMemoryTaskQueue", - "qname": "InMemoryTaskQueue", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 9, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "58f0cc001ccda0eee4c6bc32ed83bd05eafd6b6644f1e8b4aa9eed3103db73dc", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.stop", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 25, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d", - "dst_ref": "ControlPlaneService.stop", - "resolution": "resolved", - "slice_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.stop" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._stop_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 51, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a", - "dst_ref": "ControlPlaneService._stop_async", - "resolution": "resolved", - "slice_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._stop_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.register_channel", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 17, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957", - "dst_ref": "ControlPlaneService.register_channel", - "resolution": "resolved", - "slice_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.register_channel" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.start", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 20, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154", - "dst_ref": "ControlPlaneService.start", - "resolution": "resolved", - "slice_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.start" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._start_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 47, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517", - "dst_ref": "ControlPlaneService._start_async", - "resolution": "resolved", - "slice_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._start_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.register_channel reads_attr self._channels.append", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.register_channel:reads_attr", - "span_start": 17, - "span_end": 17, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "1ee5925deffdc38ba15b88bf7c89e5fcd1a78f493fe30f2deb827d714a1b18e8", - "edge_type": "reads_attr", - "src_symbol_id": "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957", - "src_qname": "ControlPlaneService.register_channel", - "dst_symbol_id": null, - "dst_ref": "self._channels.append", - "resolution": "partial", - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "class ControlPlaneService:\n def __init__(self) -> None:\n self._channels: list[ControlChannel] = []\n\n def register_channel(self, channel: ControlChannel) -> None:\n self._channels.append(channel)\n\n def start(self, runtime: RuntimeManager) -> None:\n if not self._channels:\n return\n asyncio.run(self._start_async(runtime))\n\n def stop(self) -> None:\n if not self._channels:\n return\n asyncio.run(self._stop_async())\n\n def snapshot(self, runtime: RuntimeManager) -> dict[str, object]:\n health = runtime.current_health()\n return {\n \"runtime\": {\"state\": runtime._state.value},\n \"modules\": list(runtime.registry.modules),\n \"services\": runtime.services.snapshot(),\n \"workers\": runtime.workers.snapshot(),\n \"health\": runtime.health.snapshot(runtime.workers.healths()) | {\"status\": health[\"status\"]},\n \"config\": runtime.configuration.get(),\n }\n\n async def _start_async(self, runtime: RuntimeManager) -> None:\n actions = ControlActionSet(\n health=runtime.health_status,\n start=runtime.start_runtime,\n stop=runtime.stop_runtime,\n status=runtime.runtime_status,\n )\n for channel in self._channels:\n await channel.start(actions)\n\n async def _stop_async(self) -> None:\n for channel in reversed(self._channels):\n await channel.stop()", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/service.py:ControlPlaneService", - "span_start": 12, - "span_end": 52, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.service", - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ] - }, - "diagnostics": { - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C0_SOURCE_CHUNKS": "exact_path_fetch", - "C4_SEMANTIC_ROLES": "exact_path_fetch", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C3_ENTRYPOINTS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 8, - "C4_SEMANTIC_ROLES": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C3_ENTRYPOINTS": 6 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C4_SEMANTIC_ROLES": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "ControlPlaneService", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Объясни класс ControlPlaneService", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C4_SEMANTIC_ROLES", - "query": "Объясни класс ControlPlaneService", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "Объясни класс ControlPlaneService", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - }, - { - "layer": "C3_ENTRYPOINTS", - "query": "Объясни класс ControlPlaneService", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 1, - "candidates_after_filter": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 6, - "candidates_after_filter": 6 - }, - { - "layer": "C3_ENTRYPOINTS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 3, - "candidates_after_filter": 3 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "ControlPlaneService", - "alternatives": [ - "ControlPlaneService" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C4_SEMANTIC_ROLES", - "status": "hit", - "hit_count": 8, - "fail_reason": null - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 6, - "fail_reason": null - }, - { - "layer": "C3_ENTRYPOINTS", - "status": "hit", - "hit_count": 3, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "symbol_resolution": 0, - "retrieval_total": 103, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 21, - "C0_SOURCE_CHUNKS": 12, - "C4_SEMANTIC_ROLES": 10, - "C2_DEPENDENCY_GRAPH": 50, - "C3_ENTRYPOINTS": 8 - }, - "merge_rank": 15 - } - } - } - ] - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_router_rag/20260312_085312/router_rag_plba_code_retrieval_plba-rag-explain-control-plane-service.md b/tests/pipeline_setup_v2/test_results/plba_router_rag/20260312_085312/router_rag_plba_code_retrieval_plba-rag-explain-control-plane-service.md deleted file mode 100644 index e02505f..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_router_rag/20260312_085312/router_rag_plba_code_retrieval_plba-rag-explain-control-plane-service.md +++ /dev/null @@ -1,38 +0,0 @@ -# plba-rag-explain-control-plane-service - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/router_rag_plba_code_retrieval.yaml -- runner: runtime -- mode: router_rag -- passed: True - -## Query - -Объясни класс ControlPlaneService - -## Actual - -{ - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 19, - "llm_answer": "", - "answer_mode": "partial", - "path_scope": [], - "symbol_candidates": [ - "ControlPlaneService" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] -} - -## Mismatches - -- none - diff --git a/tests/pipeline_setup_v2/test_results/plba_router_rag/20260312_085312/router_rag_plba_code_retrieval_plba-rag-explain-create-runtime.json b/tests/pipeline_setup_v2/test_results/plba_router_rag/20260312_085312/router_rag_plba_code_retrieval_plba-rag-explain-create-runtime.json deleted file mode 100644 index 27c7d31..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_router_rag/20260312_085312/router_rag_plba_code_retrieval_plba-rag-explain-create-runtime.json +++ /dev/null @@ -1,2285 +0,0 @@ -{ - "case_id": "plba-rag-explain-create-runtime", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/router_rag_plba_code_retrieval.yaml", - "runner": "runtime", - "mode": "router_rag", - "actual": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 19, - "llm_answer": "", - "answer_mode": "partial", - "path_scope": [], - "symbol_candidates": [ - "create_runtime" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "passed": true, - "mismatches": [], - "details": { - "case_id": "plba-rag-explain-create-runtime", - "text": "Объясни функцию create_runtime", - "mode": "router_rag", - "run_started_at": "2026-03-12T08:53:12", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Объясни функцию create_runtime", - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "create_runtime", - "alternatives": [ - "create_runtime" - ], - "confidence": 0.99 - }, - "rag_count": 19, - "rag_rows": [ - { - "path": "src/plba/bootstrap.py", - "content": "function create_runtime\ncreate_runtime(module)", - "layer": "C1_SYMBOL_CATALOG", - "title": "create_runtime", - "span_start": 8, - "span_end": 29, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "qname": "create_runtime", - "kind": "function", - "signature": "create_runtime(module)", - "parent_symbol_id": null, - "package_or_module": "src.plba.bootstrap", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_runner.py", - "content": "UvicornThreadRunner\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (24)", - "layer": "C4_SEMANTIC_ROLES", - "title": "UvicornThreadRunner", - "span_start": 10, - "span_end": 61, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 11, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "fd55630045a02100df8877ac27d951ee08617d4598764394d48cb51fe067476a", - "symbol_name": "UvicornThreadRunner", - "qname": "UvicornThreadRunner", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 24, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "3779fdd2878b770e789a35bb2a89c9d79f13b61c26d7db1b3b683f9bb9e1623f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/persistence/workflow_persistence.py", - "content": "WorkflowPersistence\nrole: pipeline_stage\n\nResponsibilities:\n- orchestrates role-like calls (2)\n- reads and writes state attributes\n- participates in dataflow slices (16)", - "layer": "C4_SEMANTIC_ROLES", - "title": "WorkflowPersistence", - "span_start": 8, - "span_end": 54, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 15, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "7bd01ee45cf31f2d5c2e3e51656254860ac785d10cef9e0852cd4fba90857bae", - "symbol_name": "WorkflowPersistence", - "qname": "WorkflowPersistence", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 16, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "80e9410ddc639789b4353c2a1a757ba8d0d5b5bb6075b0b263b61551f04ae1f0", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (10)", - "layer": "C4_SEMANTIC_ROLES", - "title": "HttpControlChannel", - "span_start": 12, - "span_end": 57, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 21, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "1c9fbdc24819e5604c26ea55428a74310f03a03e1af197ed84846af61e42fdb0", - "symbol_name": "HttpControlChannel", - "qname": "HttpControlChannel", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 10, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/queue/in_memory.py", - "content": "InMemoryTaskQueue\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (9)", - "layer": "C4_SEMANTIC_ROLES", - "title": "InMemoryTaskQueue", - "span_start": 9, - "span_end": 38, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 22, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "2da04cb94544a3bcbf0943a95ad4bdd8710bcafaa32a02fd0e4de2178dcf3533", - "symbol_name": "InMemoryTaskQueue", - "qname": "InMemoryTaskQueue", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 9, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "58f0cc001ccda0eee4c6bc32ed83bd05eafd6b6644f1e8b4aa9eed3103db73dc", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/config/file_loader.py", - "content": "ConfigFileLoader\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (8)", - "layer": "C4_SEMANTIC_ROLES", - "title": "ConfigFileLoader", - "span_start": 11, - "span_end": 48, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 23, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "a8474eca8b6e9dc86ae67ed68b16fa5fb639ef08739c053e7b7195489765667f", - "symbol_name": "ConfigFileLoader", - "qname": "ConfigFileLoader", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 8, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "1f19ffebde5e38e4be5a5d5a678059a0f36dedb8fb8b3e00ab395c67106a87ea", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workers/supervisor.py", - "content": "WorkerSupervisor\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (6)", - "layer": "C4_SEMANTIC_ROLES", - "title": "WorkerSupervisor", - "span_start": 10, - "span_end": 59, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 25, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "c17b44e8d9e97d490989b21fa67d7c346cdda8a0472e4c41fb243c8846faa124", - "symbol_name": "WorkerSupervisor", - "qname": "WorkerSupervisor", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 6, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "77609d9d5927171cce7fc3a54897c183fd63068710c6362029b700937aae5eee", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/engine/workflow_engine.py", - "content": "WorkflowEngine\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (6)", - "layer": "C4_SEMANTIC_ROLES", - "title": "WorkflowEngine", - "span_start": 10, - "span_end": 86, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 25, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "57ec0a9f11c542c78e008684a888397e8d9ef4223671acb2567e631a0cbc70b4", - "symbol_name": "WorkflowEngine", - "qname": "WorkflowEngine", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 6, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "1057136e58a325cd5ab6f4e265d15665fb6a711b7022d9fab52a1a290afa2368", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/store.py", - "content": "TraceContextStore\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (6)", - "layer": "C4_SEMANTIC_ROLES", - "title": "TraceContextStore", - "span_start": 15, - "span_end": 52, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 25, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "b2dad4fbe16ffb11b58deba311c7739955c39d59f291b22181f33e9c8cce4059", - "symbol_name": "TraceContextStore", - "qname": "TraceContextStore", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 6, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "d369554f08fc92039c6edd5a2a1e73b23901533e8974459170bbd9347d263dc5", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/bootstrap.py", - "content": "create_runtime calls runtime.add_config_file", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "create_runtime:calls", - "span_start": 19, - "span_end": 19, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "4eaeec4ac55a59d5f66fd01c4754955f8fedaf4bc3df13fa769b352c7bfaacbb", - "edge_type": "calls", - "src_symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "src_qname": "create_runtime", - "dst_symbol_id": null, - "dst_ref": "runtime.add_config_file", - "resolution": "partial", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/bootstrap.py", - "content": "create_runtime reads_attr runtime.register_module", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "create_runtime:reads_attr", - "span_start": 28, - "span_end": 28, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "45516c79ff358dbf9b650a081668df0f66d2fe989300f985a1a78be6be166f8f", - "edge_type": "reads_attr", - "src_symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "src_qname": "create_runtime", - "dst_symbol_id": null, - "dst_ref": "runtime.register_module", - "resolution": "partial", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/bootstrap.py", - "content": "create_runtime instantiates RuntimeManager", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "create_runtime:instantiates", - "span_start": 17, - "span_end": 17, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "0adba17984f850ea1608c9e734d2dd5c325cfde3a8133123aa239e44935ad18e", - "edge_type": "instantiates", - "src_symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "src_qname": "create_runtime", - "dst_symbol_id": "27158ca220022eeb5083c6addf8a50775d45f7161284fd60aac48410105f4b98", - "dst_ref": "RuntimeManager", - "resolution": "resolved", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/bootstrap.py", - "content": "create_runtime calls runtime.register_module", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "create_runtime:calls", - "span_start": 28, - "span_end": 28, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "ab6003c3441addc1ba1b81edeca009165559f652f6b2cf424e5ae61b1f617de8", - "edge_type": "calls", - "src_symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "src_qname": "create_runtime", - "dst_symbol_id": null, - "dst_ref": "runtime.register_module", - "resolution": "partial", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/bootstrap.py", - "content": "create_runtime calls runtime.control_plane.register_channel", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "create_runtime:calls", - "span_start": 21, - "span_end": 27, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "2678250030b9ce47a3b3b55fac7897ac530367edc8374ac9d5e6ecafb1e483f0", - "edge_type": "calls", - "src_symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "src_qname": "create_runtime", - "dst_symbol_id": null, - "dst_ref": "runtime.control_plane.register_channel", - "resolution": "partial", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/bootstrap.py", - "content": "create_runtime reads_attr runtime.add_config_file", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "create_runtime:reads_attr", - "span_start": 19, - "span_end": 19, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "30d4e8aae984ab84d523e80d02f1caeda52d547fa3d2aa47be8845931cabbca2", - "edge_type": "reads_attr", - "src_symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "src_qname": "create_runtime", - "dst_symbol_id": null, - "dst_ref": "runtime.add_config_file", - "resolution": "partial", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/bootstrap.py", - "content": "def create_runtime(\n module: ApplicationModule,\n *,\n config_path: str | None = None,\n enable_http_control: bool = False,\n control_host: str = \"127.0.0.1\",\n control_port: int = 8080,\n control_timeout: int = 5,\n) -> RuntimeManager:\n runtime = RuntimeManager()\n if config_path is not None:\n runtime.add_config_file(config_path)\n if enable_http_control:\n runtime.control_plane.register_channel(\n HttpControlChannel(\n host=control_host,\n port=control_port,\n timeout=control_timeout,\n )\n )\n runtime.register_module(module)\n return runtime", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/plba/bootstrap.py:create_runtime", - "span_start": 8, - "span_end": 29, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.plba.bootstrap", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "llm_answer": null, - "summary": { - "router": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "confidence": null - }, - "retrieval": { - "profile": "code", - "layers_hit": [ - "C0_SOURCE_CHUNKS", - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS", - "C4_SEMANTIC_ROLES" - ], - "evidence_sufficient": true - }, - "llm": { - "answer_status": "partial", - "groundedness": "not_applicable" - } - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "symbol_kind_hint": "function", - "symbol_candidates": [ - "create_runtime" - ], - "keyword_hints": [ - "create_runtime" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C0_SOURCE_CHUNKS": "exact_path_fetch", - "C4_SEMANTIC_ROLES": "exact_path_fetch", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C3_ENTRYPOINTS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 8, - "C4_SEMANTIC_ROLES": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C3_ENTRYPOINTS": 6 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C4_SEMANTIC_ROLES": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "create_runtime", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Объясни функцию create_runtime", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C4_SEMANTIC_ROLES", - "query": "Объясни функцию create_runtime", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "Объясни функцию create_runtime", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - }, - { - "layer": "C3_ENTRYPOINTS", - "query": "Объясни функцию create_runtime", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 1, - "candidates_after_filter": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 6, - "candidates_after_filter": 6 - }, - { - "layer": "C3_ENTRYPOINTS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 3, - "candidates_after_filter": 3 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "create_runtime", - "alternatives": [ - "create_runtime" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C4_SEMANTIC_ROLES", - "status": "hit", - "hit_count": 8, - "fail_reason": null - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 6, - "fail_reason": null - }, - { - "layer": "C3_ENTRYPOINTS", - "status": "hit", - "hit_count": 3, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "router": 0, - "symbol_resolution": 0, - "retrieval_total": 91, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 17, - "C0_SOURCE_CHUNKS": 12, - "C4_SEMANTIC_ROLES": 11, - "C2_DEPENDENCY_GRAPH": 41, - "C3_ENTRYPOINTS": 8 - }, - "merge_rank": 13, - "prompt_build": 0, - "llm_call": 0 - }, - "prompt": null, - "router": { - "conversation_mode": "START", - "keyword_hints": [ - "create_runtime" - ], - "path_scope": [] - }, - "llm": { - "used_evidence_count": 19, - "missing_evidence_reason": null - } - }, - "run_info": { - "case_id": "plba-rag-explain-create-runtime", - "mode": "router_rag", - "run_started_at": "2026-03-12T08:53:12", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - }, - "input_request": { - "text": "Объясни функцию create_runtime", - "normalized_query": "Объясни функцию create_runtime" - }, - "steps": [ - { - "step": "intent_router", - "input": { - "query": "Объясни функцию create_runtime" - }, - "output": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Объясни функцию create_runtime" - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "symbol_kind_hint": "function", - "symbol_candidates": [ - "create_runtime" - ], - "keyword_hints": [ - "create_runtime" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "timings_ms": { - "router": 0 - } - } - }, - { - "step": "retrieval", - "input": { - "query": "Объясни функцию create_runtime" - }, - "output": { - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "create_runtime", - "alternatives": [ - "create_runtime" - ], - "confidence": 0.99 - }, - "rag_count": 19, - "rag_rows": [ - { - "path": "src/plba/bootstrap.py", - "content": "function create_runtime\ncreate_runtime(module)", - "layer": "C1_SYMBOL_CATALOG", - "title": "create_runtime", - "span_start": 8, - "span_end": 29, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "qname": "create_runtime", - "kind": "function", - "signature": "create_runtime(module)", - "parent_symbol_id": null, - "package_or_module": "src.plba.bootstrap", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_runner.py", - "content": "UvicornThreadRunner\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (24)", - "layer": "C4_SEMANTIC_ROLES", - "title": "UvicornThreadRunner", - "span_start": 10, - "span_end": 61, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 11, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "fd55630045a02100df8877ac27d951ee08617d4598764394d48cb51fe067476a", - "symbol_name": "UvicornThreadRunner", - "qname": "UvicornThreadRunner", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 24, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "3779fdd2878b770e789a35bb2a89c9d79f13b61c26d7db1b3b683f9bb9e1623f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/persistence/workflow_persistence.py", - "content": "WorkflowPersistence\nrole: pipeline_stage\n\nResponsibilities:\n- orchestrates role-like calls (2)\n- reads and writes state attributes\n- participates in dataflow slices (16)", - "layer": "C4_SEMANTIC_ROLES", - "title": "WorkflowPersistence", - "span_start": 8, - "span_end": 54, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 15, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "7bd01ee45cf31f2d5c2e3e51656254860ac785d10cef9e0852cd4fba90857bae", - "symbol_name": "WorkflowPersistence", - "qname": "WorkflowPersistence", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 16, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "80e9410ddc639789b4353c2a1a757ba8d0d5b5bb6075b0b263b61551f04ae1f0", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (10)", - "layer": "C4_SEMANTIC_ROLES", - "title": "HttpControlChannel", - "span_start": 12, - "span_end": 57, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 21, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "1c9fbdc24819e5604c26ea55428a74310f03a03e1af197ed84846af61e42fdb0", - "symbol_name": "HttpControlChannel", - "qname": "HttpControlChannel", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 10, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/queue/in_memory.py", - "content": "InMemoryTaskQueue\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (9)", - "layer": "C4_SEMANTIC_ROLES", - "title": "InMemoryTaskQueue", - "span_start": 9, - "span_end": 38, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 22, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "2da04cb94544a3bcbf0943a95ad4bdd8710bcafaa32a02fd0e4de2178dcf3533", - "symbol_name": "InMemoryTaskQueue", - "qname": "InMemoryTaskQueue", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 9, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "58f0cc001ccda0eee4c6bc32ed83bd05eafd6b6644f1e8b4aa9eed3103db73dc", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/config/file_loader.py", - "content": "ConfigFileLoader\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (8)", - "layer": "C4_SEMANTIC_ROLES", - "title": "ConfigFileLoader", - "span_start": 11, - "span_end": 48, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 23, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "a8474eca8b6e9dc86ae67ed68b16fa5fb639ef08739c053e7b7195489765667f", - "symbol_name": "ConfigFileLoader", - "qname": "ConfigFileLoader", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 8, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "1f19ffebde5e38e4be5a5d5a678059a0f36dedb8fb8b3e00ab395c67106a87ea", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workers/supervisor.py", - "content": "WorkerSupervisor\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (6)", - "layer": "C4_SEMANTIC_ROLES", - "title": "WorkerSupervisor", - "span_start": 10, - "span_end": 59, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 25, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "c17b44e8d9e97d490989b21fa67d7c346cdda8a0472e4c41fb243c8846faa124", - "symbol_name": "WorkerSupervisor", - "qname": "WorkerSupervisor", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 6, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "77609d9d5927171cce7fc3a54897c183fd63068710c6362029b700937aae5eee", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/engine/workflow_engine.py", - "content": "WorkflowEngine\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (6)", - "layer": "C4_SEMANTIC_ROLES", - "title": "WorkflowEngine", - "span_start": 10, - "span_end": 86, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 25, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "57ec0a9f11c542c78e008684a888397e8d9ef4223671acb2567e631a0cbc70b4", - "symbol_name": "WorkflowEngine", - "qname": "WorkflowEngine", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 6, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "1057136e58a325cd5ab6f4e265d15665fb6a711b7022d9fab52a1a290afa2368", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/store.py", - "content": "TraceContextStore\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (6)", - "layer": "C4_SEMANTIC_ROLES", - "title": "TraceContextStore", - "span_start": 15, - "span_end": 52, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 25, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "b2dad4fbe16ffb11b58deba311c7739955c39d59f291b22181f33e9c8cce4059", - "symbol_name": "TraceContextStore", - "qname": "TraceContextStore", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 6, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "d369554f08fc92039c6edd5a2a1e73b23901533e8974459170bbd9347d263dc5", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/bootstrap.py", - "content": "create_runtime calls runtime.add_config_file", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "create_runtime:calls", - "span_start": 19, - "span_end": 19, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "4eaeec4ac55a59d5f66fd01c4754955f8fedaf4bc3df13fa769b352c7bfaacbb", - "edge_type": "calls", - "src_symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "src_qname": "create_runtime", - "dst_symbol_id": null, - "dst_ref": "runtime.add_config_file", - "resolution": "partial", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/bootstrap.py", - "content": "create_runtime reads_attr runtime.register_module", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "create_runtime:reads_attr", - "span_start": 28, - "span_end": 28, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "45516c79ff358dbf9b650a081668df0f66d2fe989300f985a1a78be6be166f8f", - "edge_type": "reads_attr", - "src_symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "src_qname": "create_runtime", - "dst_symbol_id": null, - "dst_ref": "runtime.register_module", - "resolution": "partial", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/bootstrap.py", - "content": "create_runtime instantiates RuntimeManager", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "create_runtime:instantiates", - "span_start": 17, - "span_end": 17, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "0adba17984f850ea1608c9e734d2dd5c325cfde3a8133123aa239e44935ad18e", - "edge_type": "instantiates", - "src_symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "src_qname": "create_runtime", - "dst_symbol_id": "27158ca220022eeb5083c6addf8a50775d45f7161284fd60aac48410105f4b98", - "dst_ref": "RuntimeManager", - "resolution": "resolved", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/bootstrap.py", - "content": "create_runtime calls runtime.register_module", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "create_runtime:calls", - "span_start": 28, - "span_end": 28, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "ab6003c3441addc1ba1b81edeca009165559f652f6b2cf424e5ae61b1f617de8", - "edge_type": "calls", - "src_symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "src_qname": "create_runtime", - "dst_symbol_id": null, - "dst_ref": "runtime.register_module", - "resolution": "partial", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/bootstrap.py", - "content": "create_runtime calls runtime.control_plane.register_channel", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "create_runtime:calls", - "span_start": 21, - "span_end": 27, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "2678250030b9ce47a3b3b55fac7897ac530367edc8374ac9d5e6ecafb1e483f0", - "edge_type": "calls", - "src_symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "src_qname": "create_runtime", - "dst_symbol_id": null, - "dst_ref": "runtime.control_plane.register_channel", - "resolution": "partial", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/bootstrap.py", - "content": "create_runtime reads_attr runtime.add_config_file", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "create_runtime:reads_attr", - "span_start": 19, - "span_end": 19, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "30d4e8aae984ab84d523e80d02f1caeda52d547fa3d2aa47be8845931cabbca2", - "edge_type": "reads_attr", - "src_symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "src_qname": "create_runtime", - "dst_symbol_id": null, - "dst_ref": "runtime.add_config_file", - "resolution": "partial", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/bootstrap.py", - "content": "def create_runtime(\n module: ApplicationModule,\n *,\n config_path: str | None = None,\n enable_http_control: bool = False,\n control_host: str = \"127.0.0.1\",\n control_port: int = 8080,\n control_timeout: int = 5,\n) -> RuntimeManager:\n runtime = RuntimeManager()\n if config_path is not None:\n runtime.add_config_file(config_path)\n if enable_http_control:\n runtime.control_plane.register_channel(\n HttpControlChannel(\n host=control_host,\n port=control_port,\n timeout=control_timeout,\n )\n )\n runtime.register_module(module)\n return runtime", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/plba/bootstrap.py:create_runtime", - "span_start": 8, - "span_end": 29, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.plba.bootstrap", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ] - }, - "diagnostics": { - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C0_SOURCE_CHUNKS": "exact_path_fetch", - "C4_SEMANTIC_ROLES": "exact_path_fetch", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C3_ENTRYPOINTS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 8, - "C4_SEMANTIC_ROLES": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C3_ENTRYPOINTS": 6 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C4_SEMANTIC_ROLES": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "create_runtime", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Объясни функцию create_runtime", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C4_SEMANTIC_ROLES", - "query": "Объясни функцию create_runtime", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "Объясни функцию create_runtime", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - }, - { - "layer": "C3_ENTRYPOINTS", - "query": "Объясни функцию create_runtime", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 1, - "candidates_after_filter": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 6, - "candidates_after_filter": 6 - }, - { - "layer": "C3_ENTRYPOINTS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 3, - "candidates_after_filter": 3 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "create_runtime", - "alternatives": [ - "create_runtime" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C4_SEMANTIC_ROLES", - "status": "hit", - "hit_count": 8, - "fail_reason": null - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 6, - "fail_reason": null - }, - { - "layer": "C3_ENTRYPOINTS", - "status": "hit", - "hit_count": 3, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "symbol_resolution": 0, - "retrieval_total": 91, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 17, - "C0_SOURCE_CHUNKS": 12, - "C4_SEMANTIC_ROLES": 11, - "C2_DEPENDENCY_GRAPH": 41, - "C3_ENTRYPOINTS": 8 - }, - "merge_rank": 13 - } - } - } - ] - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_router_rag/20260312_085312/router_rag_plba_code_retrieval_plba-rag-explain-create-runtime.md b/tests/pipeline_setup_v2/test_results/plba_router_rag/20260312_085312/router_rag_plba_code_retrieval_plba-rag-explain-create-runtime.md deleted file mode 100644 index 3a38698..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_router_rag/20260312_085312/router_rag_plba_code_retrieval_plba-rag-explain-create-runtime.md +++ /dev/null @@ -1,34 +0,0 @@ -# plba-rag-explain-create-runtime - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/router_rag_plba_code_retrieval.yaml -- runner: runtime -- mode: router_rag -- passed: True - -## Query -Объясни функцию create_runtime - -## Actual -{ - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 19, - "llm_answer": "", - "answer_mode": "partial", - "path_scope": [], - "symbol_candidates": [ - "create_runtime" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] -} - -## Mismatches -- none \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_router_rag/20260312_085312/router_rag_plba_code_retrieval_plba-rag-explain-http-control-channel.json b/tests/pipeline_setup_v2/test_results/plba_router_rag/20260312_085312/router_rag_plba_code_retrieval_plba-rag-explain-http-control-channel.json deleted file mode 100644 index ba62517..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_router_rag/20260312_085312/router_rag_plba_code_retrieval_plba-rag-explain-http-control-channel.json +++ /dev/null @@ -1,2477 +0,0 @@ -{ - "case_id": "plba-rag-explain-http-control-channel", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/router_rag_plba_code_retrieval.yaml", - "runner": "runtime", - "mode": "router_rag", - "actual": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 19, - "llm_answer": "", - "answer_mode": "partial", - "path_scope": [], - "symbol_candidates": [ - "HttpControlChannel" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "passed": true, - "mismatches": [], - "details": { - "case_id": "plba-rag-explain-http-control-channel", - "text": "Объясни класс HttpControlChannel", - "mode": "router_rag", - "run_started_at": "2026-03-12T08:53:12", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Объясни класс HttpControlChannel", - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "HttpControlChannel", - "alternatives": [ - "HttpControlChannel" - ], - "confidence": 0.99 - }, - "rag_count": 19, - "rag_rows": [ - { - "path": "src/app_runtime/control/http_channel.py", - "content": "class HttpControlChannel\nHttpControlChannel(ControlChannel)", - "layer": "C1_SYMBOL_CATALOG", - "title": "HttpControlChannel", - "span_start": 12, - "span_end": 57, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "1c9fbdc24819e5604c26ea55428a74310f03a03e1af197ed84846af61e42fdb0", - "qname": "HttpControlChannel", - "kind": "class", - "signature": "HttpControlChannel(ControlChannel)", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.control.http_channel", - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (10)", - "layer": "C4_SEMANTIC_ROLES", - "title": "HttpControlChannel", - "span_start": 12, - "span_end": 57, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 21, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "1c9fbdc24819e5604c26ea55428a74310f03a03e1af197ed84846af61e42fdb0", - "symbol_name": "HttpControlChannel", - "qname": "HttpControlChannel", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 10, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "ControlChannel\nrole: model\n\nResponsibilities:\n- default model role", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlChannel", - "span_start": 21, - "span_end": 28, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 40, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "cfcfe9a311d3a2dbdaf32ac4ccd73c0eb9a117f830591a1c0867ee97d46204ff", - "symbol_name": "ControlChannel", - "qname": "ControlChannel", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "ControlActionSet\nrole: model\n\nResponsibilities:\n- default model role", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlActionSet", - "span_start": 14, - "span_end": 18, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 40, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "46eb026cb3313415ec47b82dd22f84f4d112c9d987e8b1716dcb0baa1cce8988", - "symbol_name": "ControlActionSet", - "qname": "ControlActionSet", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests service\n- reads and writes state attributes\n- participates in dataflow slices (5)", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlPlaneService", - "span_start": 12, - "span_end": 52, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 68, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "b13471e5916986dccffb53fab613812842965705e6b3a89ae549d30c9e91e9aa", - "symbol_name": "ControlPlaneService", - "qname": "ControlPlaneService", - "role": "pipeline_stage", - "confidence": 0.57, - "dataflow_participation": 5, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_runner.py", - "content": "UvicornThreadRunner\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (24)", - "layer": "C4_SEMANTIC_ROLES", - "title": "UvicornThreadRunner", - "span_start": 10, - "span_end": 61, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 11, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "fd55630045a02100df8877ac27d951ee08617d4598764394d48cb51fe067476a", - "symbol_name": "UvicornThreadRunner", - "qname": "UvicornThreadRunner", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 24, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "3779fdd2878b770e789a35bb2a89c9d79f13b61c26d7db1b3b683f9bb9e1623f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "HttpControlAppFactory\nrole: factory\n\nResponsibilities:\n- name suffix suggests factory", - "layer": "C4_SEMANTIC_ROLES", - "title": "HttpControlAppFactory", - "span_start": 15, - "span_end": 53, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 39, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "9b3502a5fb408b273223db13264349cf500de24915b6c649d9ea8970d0dfd8e0", - "symbol_name": "HttpControlAppFactory", - "qname": "HttpControlAppFactory", - "role": "factory", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/persistence/workflow_persistence.py", - "content": "WorkflowPersistence\nrole: pipeline_stage\n\nResponsibilities:\n- orchestrates role-like calls (2)\n- reads and writes state attributes\n- participates in dataflow slices (16)", - "layer": "C4_SEMANTIC_ROLES", - "title": "WorkflowPersistence", - "span_start": 8, - "span_end": 54, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 15, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "7bd01ee45cf31f2d5c2e3e51656254860ac785d10cef9e0852cd4fba90857bae", - "symbol_name": "WorkflowPersistence", - "qname": "WorkflowPersistence", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 16, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "80e9410ddc639789b4353c2a1a757ba8d0d5b5bb6075b0b263b61551f04ae1f0", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/queue/in_memory.py", - "content": "InMemoryTaskQueue\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (9)", - "layer": "C4_SEMANTIC_ROLES", - "title": "InMemoryTaskQueue", - "span_start": 9, - "span_end": 38, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 22, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "2da04cb94544a3bcbf0943a95ad4bdd8710bcafaa32a02fd0e4de2178dcf3533", - "symbol_name": "InMemoryTaskQueue", - "qname": "InMemoryTaskQueue", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 9, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "58f0cc001ccda0eee4c6bc32ed83bd05eafd6b6644f1e8b4aa9eed3103db73dc", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel.__init__\n -> HttpControlChannel._runner\n -> HttpControlChannel.start", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "HttpControlChannel.__init__:dataflow_slice", - "span_start": 15, - "span_end": 22, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "51d73913df709152258ed1b9a8c8f4eb3c575eccfe6b982aef0b28e0789a29da", - "edge_type": "dataflow_slice", - "src_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "src_qname": "HttpControlChannel.__init__", - "dst_symbol_id": "d1933f04137f52535b6525f1b93ff2cd83bfb216b480e887e791ed1714cda8e0", - "dst_ref": "HttpControlChannel.start", - "resolution": "resolved", - "slice_id": "51d73913df709152258ed1b9a8c8f4eb3c575eccfe6b982aef0b28e0789a29da", - "root_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "path_symbols": [ - "HttpControlChannel.__init__", - "HttpControlChannel._runner", - "HttpControlChannel.start" - ], - "path_symbol_ids": [ - "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "d1933f04137f52535b6525f1b93ff2cd83bfb216b480e887e791ed1714cda8e0" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel.__init__\n -> HttpControlChannel._runner\n -> HttpControlChannel.port", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "HttpControlChannel.__init__:dataflow_slice", - "span_start": 15, - "span_end": 29, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "c7167bab7218bb768ad7c11bfb40d1a3096e6071dd7817bba5fd864cf8f6de13", - "edge_type": "dataflow_slice", - "src_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "src_qname": "HttpControlChannel.__init__", - "dst_symbol_id": "3632ce8227f4a31e0768f2fb021a4d1ba28e1202633aa0f2fac902295931280f", - "dst_ref": "HttpControlChannel.port", - "resolution": "resolved", - "slice_id": "c7167bab7218bb768ad7c11bfb40d1a3096e6071dd7817bba5fd864cf8f6de13", - "root_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "path_symbols": [ - "HttpControlChannel.__init__", - "HttpControlChannel._runner", - "HttpControlChannel.port" - ], - "path_symbol_ids": [ - "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "3632ce8227f4a31e0768f2fb021a4d1ba28e1202633aa0f2fac902295931280f" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel.__init__\n -> HttpControlChannel._timeout\n -> HttpControlChannel._health_response", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "HttpControlChannel.__init__:dataflow_slice", - "span_start": 14, - "span_end": 34, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "f858f5c9e575f6c4cdfe3853571b7ee21d1f628a443541d2037c3dc9d0790bef", - "edge_type": "dataflow_slice", - "src_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "src_qname": "HttpControlChannel.__init__", - "dst_symbol_id": "e84bf04e9cd2127df235b7064d05f47e19f19a89c7c82f4c247231d4e8fa426a", - "dst_ref": "HttpControlChannel._health_response", - "resolution": "resolved", - "slice_id": "f858f5c9e575f6c4cdfe3853571b7ee21d1f628a443541d2037c3dc9d0790bef", - "root_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "path_symbols": [ - "HttpControlChannel.__init__", - "HttpControlChannel._timeout", - "HttpControlChannel._health_response" - ], - "path_symbol_ids": [ - "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "e84bf04e9cd2127df235b7064d05f47e19f19a89c7c82f4c247231d4e8fa426a" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel.__init__\n -> HttpControlChannel._timeout\n -> HttpControlChannel._action_response", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "HttpControlChannel.__init__:dataflow_slice", - "span_start": 14, - "span_end": 47, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "c3ef21fcae96c82c00be74b3ab827d4af2085d89cb3fa5521c19a174aad84dbb", - "edge_type": "dataflow_slice", - "src_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "src_qname": "HttpControlChannel.__init__", - "dst_symbol_id": "e64969024ccaeb34d8d91473fad07b3b3d341875846392e7a006406c7ada1954", - "dst_ref": "HttpControlChannel._action_response", - "resolution": "resolved", - "slice_id": "c3ef21fcae96c82c00be74b3ab827d4af2085d89cb3fa5521c19a174aad84dbb", - "root_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "path_symbols": [ - "HttpControlChannel.__init__", - "HttpControlChannel._timeout", - "HttpControlChannel._action_response" - ], - "path_symbol_ids": [ - "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "e64969024ccaeb34d8d91473fad07b3b3d341875846392e7a006406c7ada1954" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel.__init__\n -> HttpControlChannel._runner\n -> HttpControlChannel.stop", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "HttpControlChannel.__init__:dataflow_slice", - "span_start": 15, - "span_end": 25, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "0f827ef81a990258a8a74381c8564a8361afa6712dba3200592659c939adcb9d", - "edge_type": "dataflow_slice", - "src_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "src_qname": "HttpControlChannel.__init__", - "dst_symbol_id": "f29ab212620093d72be20e26c5a399624c7939a6056a728762ed3f84a250bfa3", - "dst_ref": "HttpControlChannel.stop", - "resolution": "resolved", - "slice_id": "0f827ef81a990258a8a74381c8564a8361afa6712dba3200592659c939adcb9d", - "root_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "path_symbols": [ - "HttpControlChannel.__init__", - "HttpControlChannel._runner", - "HttpControlChannel.stop" - ], - "path_symbol_ids": [ - "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "f29ab212620093d72be20e26c5a399624c7939a6056a728762ed3f84a250bfa3" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel.__init__\n -> HttpControlChannel._factory\n -> HttpControlChannel.start", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "HttpControlChannel.__init__:dataflow_slice", - "span_start": 16, - "span_end": 21, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e61ec25ded7dbe380d95ce2abcbc1d7a2d2afde5aa8453866df8706dfb7d6ddb", - "edge_type": "dataflow_slice", - "src_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "src_qname": "HttpControlChannel.__init__", - "dst_symbol_id": "d1933f04137f52535b6525f1b93ff2cd83bfb216b480e887e791ed1714cda8e0", - "dst_ref": "HttpControlChannel.start", - "resolution": "resolved", - "slice_id": "e61ec25ded7dbe380d95ce2abcbc1d7a2d2afde5aa8453866df8706dfb7d6ddb", - "root_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "path_symbols": [ - "HttpControlChannel.__init__", - "HttpControlChannel._factory", - "HttpControlChannel.start" - ], - "path_symbol_ids": [ - "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "d1933f04137f52535b6525f1b93ff2cd83bfb216b480e887e791ed1714cda8e0" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "class HttpControlChannel(ControlChannel):\n def __init__(self, host: str, port: int, timeout: int) -> None:\n self._timeout = timeout\n self._runner = UvicornThreadRunner(host, port, timeout)\n self._factory = HttpControlAppFactory()\n self._actions: ControlActionSet | None = None\n\n async def start(self, actions: ControlActionSet) -> None:\n self._actions = actions\n app = self._factory.create(self._health_response, self._action_response)\n await self._runner.start(app)\n\n async def stop(self) -> None:\n await self._runner.stop()\n\n @property\n def port(self) -> int:\n return self._runner.port\n\n async def _health_response(self) -> dict[str, object]:\n if self._actions is None:\n return {\"status\": \"unhealthy\", \"detail\": \"control actions are not configured\"}\n return await asyncio.wait_for(self._actions.health(), timeout=float(self._timeout))\n\n async def _action_response(self, action: str, _client_source: str = \"unknown\") -> JSONResponse:\n if self._actions is None:\n return JSONResponse(content={\"status\": \"error\", \"detail\": f\"{action} handler is not configured\"}, status_code=404)\n callbacks = {\n \"start\": self._actions.start,\n \"stop\": self._actions.stop,\n \"status\": self._actions.status,\n }\n callback = callbacks.get(action)\n if callback is None:\n return JSONResponse(content={\"status\": \"error\", \"detail\": f\"unsupported action: {action}\"}, status_code=404)\n action_timeout = max(float(self._timeout), 10.0) if action in {\"start\", \"stop\"} else float(self._timeout)\n try:\n detail = await asyncio.wait_for(callback(), timeout=action_timeout)\n except asyncio.TimeoutError:\n return JSONResponse(\n content={\"status\": \"accepted\", \"detail\": f\"{action} operation is still in progress\"},\n status_code=202,\n )\n except Exception as exc:\n return JSONResponse(content={\"status\": \"error\", \"detail\": str(exc)}, status_code=500)\n return JSONResponse(content={\"status\": \"ok\", \"detail\": detail or f\"{action} action accepted\"}, status_code=200)", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/http_channel.py:HttpControlChannel", - "span_start": 12, - "span_end": 57, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.http_channel", - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "llm_answer": null, - "summary": { - "router": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "confidence": null - }, - "retrieval": { - "profile": "code", - "layers_hit": [ - "C0_SOURCE_CHUNKS", - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS", - "C4_SEMANTIC_ROLES" - ], - "evidence_sufficient": true - }, - "llm": { - "answer_status": "partial", - "groundedness": "not_applicable" - } - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "HttpControlChannel" - ], - "keyword_hints": [ - "HttpControlChannel" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C0_SOURCE_CHUNKS": "exact_path_fetch", - "C4_SEMANTIC_ROLES": "exact_path_fetch", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C3_ENTRYPOINTS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 8, - "C4_SEMANTIC_ROLES": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C3_ENTRYPOINTS": 6 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C4_SEMANTIC_ROLES": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "HttpControlChannel", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Объясни класс HttpControlChannel", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C4_SEMANTIC_ROLES", - "query": "Объясни класс HttpControlChannel", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "Объясни класс HttpControlChannel", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - }, - { - "layer": "C3_ENTRYPOINTS", - "query": "Объясни класс HttpControlChannel", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 1, - "candidates_after_filter": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 6, - "candidates_after_filter": 6 - }, - { - "layer": "C3_ENTRYPOINTS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 3, - "candidates_after_filter": 3 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "HttpControlChannel", - "alternatives": [ - "HttpControlChannel" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C4_SEMANTIC_ROLES", - "status": "hit", - "hit_count": 8, - "fail_reason": null - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 6, - "fail_reason": null - }, - { - "layer": "C3_ENTRYPOINTS", - "status": "hit", - "hit_count": 3, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "router": 0, - "symbol_resolution": 0, - "retrieval_total": 103, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 21, - "C0_SOURCE_CHUNKS": 12, - "C4_SEMANTIC_ROLES": 10, - "C2_DEPENDENCY_GRAPH": 50, - "C3_ENTRYPOINTS": 9 - }, - "merge_rank": 16, - "prompt_build": 0, - "llm_call": 0 - }, - "prompt": null, - "router": { - "conversation_mode": "START", - "keyword_hints": [ - "HttpControlChannel" - ], - "path_scope": [] - }, - "llm": { - "used_evidence_count": 19, - "missing_evidence_reason": null - } - }, - "run_info": { - "case_id": "plba-rag-explain-http-control-channel", - "mode": "router_rag", - "run_started_at": "2026-03-12T08:53:12", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - }, - "input_request": { - "text": "Объясни класс HttpControlChannel", - "normalized_query": "Объясни класс HttpControlChannel" - }, - "steps": [ - { - "step": "intent_router", - "input": { - "query": "Объясни класс HttpControlChannel" - }, - "output": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Объясни класс HttpControlChannel" - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "HttpControlChannel" - ], - "keyword_hints": [ - "HttpControlChannel" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "timings_ms": { - "router": 0 - } - } - }, - { - "step": "retrieval", - "input": { - "query": "Объясни класс HttpControlChannel" - }, - "output": { - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "HttpControlChannel", - "alternatives": [ - "HttpControlChannel" - ], - "confidence": 0.99 - }, - "rag_count": 19, - "rag_rows": [ - { - "path": "src/app_runtime/control/http_channel.py", - "content": "class HttpControlChannel\nHttpControlChannel(ControlChannel)", - "layer": "C1_SYMBOL_CATALOG", - "title": "HttpControlChannel", - "span_start": 12, - "span_end": 57, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "1c9fbdc24819e5604c26ea55428a74310f03a03e1af197ed84846af61e42fdb0", - "qname": "HttpControlChannel", - "kind": "class", - "signature": "HttpControlChannel(ControlChannel)", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.control.http_channel", - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (10)", - "layer": "C4_SEMANTIC_ROLES", - "title": "HttpControlChannel", - "span_start": 12, - "span_end": 57, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 21, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "1c9fbdc24819e5604c26ea55428a74310f03a03e1af197ed84846af61e42fdb0", - "symbol_name": "HttpControlChannel", - "qname": "HttpControlChannel", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 10, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "ControlChannel\nrole: model\n\nResponsibilities:\n- default model role", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlChannel", - "span_start": 21, - "span_end": 28, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 40, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "cfcfe9a311d3a2dbdaf32ac4ccd73c0eb9a117f830591a1c0867ee97d46204ff", - "symbol_name": "ControlChannel", - "qname": "ControlChannel", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "ControlActionSet\nrole: model\n\nResponsibilities:\n- default model role", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlActionSet", - "span_start": 14, - "span_end": 18, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 40, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "46eb026cb3313415ec47b82dd22f84f4d112c9d987e8b1716dcb0baa1cce8988", - "symbol_name": "ControlActionSet", - "qname": "ControlActionSet", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests service\n- reads and writes state attributes\n- participates in dataflow slices (5)", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlPlaneService", - "span_start": 12, - "span_end": 52, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 68, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "b13471e5916986dccffb53fab613812842965705e6b3a89ae549d30c9e91e9aa", - "symbol_name": "ControlPlaneService", - "qname": "ControlPlaneService", - "role": "pipeline_stage", - "confidence": 0.57, - "dataflow_participation": 5, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_runner.py", - "content": "UvicornThreadRunner\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (24)", - "layer": "C4_SEMANTIC_ROLES", - "title": "UvicornThreadRunner", - "span_start": 10, - "span_end": 61, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 11, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "fd55630045a02100df8877ac27d951ee08617d4598764394d48cb51fe067476a", - "symbol_name": "UvicornThreadRunner", - "qname": "UvicornThreadRunner", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 24, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "3779fdd2878b770e789a35bb2a89c9d79f13b61c26d7db1b3b683f9bb9e1623f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "HttpControlAppFactory\nrole: factory\n\nResponsibilities:\n- name suffix suggests factory", - "layer": "C4_SEMANTIC_ROLES", - "title": "HttpControlAppFactory", - "span_start": 15, - "span_end": 53, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 39, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "9b3502a5fb408b273223db13264349cf500de24915b6c649d9ea8970d0dfd8e0", - "symbol_name": "HttpControlAppFactory", - "qname": "HttpControlAppFactory", - "role": "factory", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/persistence/workflow_persistence.py", - "content": "WorkflowPersistence\nrole: pipeline_stage\n\nResponsibilities:\n- orchestrates role-like calls (2)\n- reads and writes state attributes\n- participates in dataflow slices (16)", - "layer": "C4_SEMANTIC_ROLES", - "title": "WorkflowPersistence", - "span_start": 8, - "span_end": 54, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 15, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "7bd01ee45cf31f2d5c2e3e51656254860ac785d10cef9e0852cd4fba90857bae", - "symbol_name": "WorkflowPersistence", - "qname": "WorkflowPersistence", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 16, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "80e9410ddc639789b4353c2a1a757ba8d0d5b5bb6075b0b263b61551f04ae1f0", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/queue/in_memory.py", - "content": "InMemoryTaskQueue\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (9)", - "layer": "C4_SEMANTIC_ROLES", - "title": "InMemoryTaskQueue", - "span_start": 9, - "span_end": 38, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 22, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "2da04cb94544a3bcbf0943a95ad4bdd8710bcafaa32a02fd0e4de2178dcf3533", - "symbol_name": "InMemoryTaskQueue", - "qname": "InMemoryTaskQueue", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 9, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "58f0cc001ccda0eee4c6bc32ed83bd05eafd6b6644f1e8b4aa9eed3103db73dc", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel.__init__\n -> HttpControlChannel._runner\n -> HttpControlChannel.start", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "HttpControlChannel.__init__:dataflow_slice", - "span_start": 15, - "span_end": 22, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "51d73913df709152258ed1b9a8c8f4eb3c575eccfe6b982aef0b28e0789a29da", - "edge_type": "dataflow_slice", - "src_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "src_qname": "HttpControlChannel.__init__", - "dst_symbol_id": "d1933f04137f52535b6525f1b93ff2cd83bfb216b480e887e791ed1714cda8e0", - "dst_ref": "HttpControlChannel.start", - "resolution": "resolved", - "slice_id": "51d73913df709152258ed1b9a8c8f4eb3c575eccfe6b982aef0b28e0789a29da", - "root_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "path_symbols": [ - "HttpControlChannel.__init__", - "HttpControlChannel._runner", - "HttpControlChannel.start" - ], - "path_symbol_ids": [ - "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "d1933f04137f52535b6525f1b93ff2cd83bfb216b480e887e791ed1714cda8e0" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel.__init__\n -> HttpControlChannel._runner\n -> HttpControlChannel.port", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "HttpControlChannel.__init__:dataflow_slice", - "span_start": 15, - "span_end": 29, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "c7167bab7218bb768ad7c11bfb40d1a3096e6071dd7817bba5fd864cf8f6de13", - "edge_type": "dataflow_slice", - "src_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "src_qname": "HttpControlChannel.__init__", - "dst_symbol_id": "3632ce8227f4a31e0768f2fb021a4d1ba28e1202633aa0f2fac902295931280f", - "dst_ref": "HttpControlChannel.port", - "resolution": "resolved", - "slice_id": "c7167bab7218bb768ad7c11bfb40d1a3096e6071dd7817bba5fd864cf8f6de13", - "root_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "path_symbols": [ - "HttpControlChannel.__init__", - "HttpControlChannel._runner", - "HttpControlChannel.port" - ], - "path_symbol_ids": [ - "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "3632ce8227f4a31e0768f2fb021a4d1ba28e1202633aa0f2fac902295931280f" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel.__init__\n -> HttpControlChannel._timeout\n -> HttpControlChannel._health_response", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "HttpControlChannel.__init__:dataflow_slice", - "span_start": 14, - "span_end": 34, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "f858f5c9e575f6c4cdfe3853571b7ee21d1f628a443541d2037c3dc9d0790bef", - "edge_type": "dataflow_slice", - "src_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "src_qname": "HttpControlChannel.__init__", - "dst_symbol_id": "e84bf04e9cd2127df235b7064d05f47e19f19a89c7c82f4c247231d4e8fa426a", - "dst_ref": "HttpControlChannel._health_response", - "resolution": "resolved", - "slice_id": "f858f5c9e575f6c4cdfe3853571b7ee21d1f628a443541d2037c3dc9d0790bef", - "root_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "path_symbols": [ - "HttpControlChannel.__init__", - "HttpControlChannel._timeout", - "HttpControlChannel._health_response" - ], - "path_symbol_ids": [ - "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "e84bf04e9cd2127df235b7064d05f47e19f19a89c7c82f4c247231d4e8fa426a" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel.__init__\n -> HttpControlChannel._timeout\n -> HttpControlChannel._action_response", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "HttpControlChannel.__init__:dataflow_slice", - "span_start": 14, - "span_end": 47, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "c3ef21fcae96c82c00be74b3ab827d4af2085d89cb3fa5521c19a174aad84dbb", - "edge_type": "dataflow_slice", - "src_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "src_qname": "HttpControlChannel.__init__", - "dst_symbol_id": "e64969024ccaeb34d8d91473fad07b3b3d341875846392e7a006406c7ada1954", - "dst_ref": "HttpControlChannel._action_response", - "resolution": "resolved", - "slice_id": "c3ef21fcae96c82c00be74b3ab827d4af2085d89cb3fa5521c19a174aad84dbb", - "root_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "path_symbols": [ - "HttpControlChannel.__init__", - "HttpControlChannel._timeout", - "HttpControlChannel._action_response" - ], - "path_symbol_ids": [ - "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "e64969024ccaeb34d8d91473fad07b3b3d341875846392e7a006406c7ada1954" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel.__init__\n -> HttpControlChannel._runner\n -> HttpControlChannel.stop", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "HttpControlChannel.__init__:dataflow_slice", - "span_start": 15, - "span_end": 25, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "0f827ef81a990258a8a74381c8564a8361afa6712dba3200592659c939adcb9d", - "edge_type": "dataflow_slice", - "src_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "src_qname": "HttpControlChannel.__init__", - "dst_symbol_id": "f29ab212620093d72be20e26c5a399624c7939a6056a728762ed3f84a250bfa3", - "dst_ref": "HttpControlChannel.stop", - "resolution": "resolved", - "slice_id": "0f827ef81a990258a8a74381c8564a8361afa6712dba3200592659c939adcb9d", - "root_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "path_symbols": [ - "HttpControlChannel.__init__", - "HttpControlChannel._runner", - "HttpControlChannel.stop" - ], - "path_symbol_ids": [ - "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "f29ab212620093d72be20e26c5a399624c7939a6056a728762ed3f84a250bfa3" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel.__init__\n -> HttpControlChannel._factory\n -> HttpControlChannel.start", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "HttpControlChannel.__init__:dataflow_slice", - "span_start": 16, - "span_end": 21, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e61ec25ded7dbe380d95ce2abcbc1d7a2d2afde5aa8453866df8706dfb7d6ddb", - "edge_type": "dataflow_slice", - "src_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "src_qname": "HttpControlChannel.__init__", - "dst_symbol_id": "d1933f04137f52535b6525f1b93ff2cd83bfb216b480e887e791ed1714cda8e0", - "dst_ref": "HttpControlChannel.start", - "resolution": "resolved", - "slice_id": "e61ec25ded7dbe380d95ce2abcbc1d7a2d2afde5aa8453866df8706dfb7d6ddb", - "root_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "path_symbols": [ - "HttpControlChannel.__init__", - "HttpControlChannel._factory", - "HttpControlChannel.start" - ], - "path_symbol_ids": [ - "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "d1933f04137f52535b6525f1b93ff2cd83bfb216b480e887e791ed1714cda8e0" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "class HttpControlChannel(ControlChannel):\n def __init__(self, host: str, port: int, timeout: int) -> None:\n self._timeout = timeout\n self._runner = UvicornThreadRunner(host, port, timeout)\n self._factory = HttpControlAppFactory()\n self._actions: ControlActionSet | None = None\n\n async def start(self, actions: ControlActionSet) -> None:\n self._actions = actions\n app = self._factory.create(self._health_response, self._action_response)\n await self._runner.start(app)\n\n async def stop(self) -> None:\n await self._runner.stop()\n\n @property\n def port(self) -> int:\n return self._runner.port\n\n async def _health_response(self) -> dict[str, object]:\n if self._actions is None:\n return {\"status\": \"unhealthy\", \"detail\": \"control actions are not configured\"}\n return await asyncio.wait_for(self._actions.health(), timeout=float(self._timeout))\n\n async def _action_response(self, action: str, _client_source: str = \"unknown\") -> JSONResponse:\n if self._actions is None:\n return JSONResponse(content={\"status\": \"error\", \"detail\": f\"{action} handler is not configured\"}, status_code=404)\n callbacks = {\n \"start\": self._actions.start,\n \"stop\": self._actions.stop,\n \"status\": self._actions.status,\n }\n callback = callbacks.get(action)\n if callback is None:\n return JSONResponse(content={\"status\": \"error\", \"detail\": f\"unsupported action: {action}\"}, status_code=404)\n action_timeout = max(float(self._timeout), 10.0) if action in {\"start\", \"stop\"} else float(self._timeout)\n try:\n detail = await asyncio.wait_for(callback(), timeout=action_timeout)\n except asyncio.TimeoutError:\n return JSONResponse(\n content={\"status\": \"accepted\", \"detail\": f\"{action} operation is still in progress\"},\n status_code=202,\n )\n except Exception as exc:\n return JSONResponse(content={\"status\": \"error\", \"detail\": str(exc)}, status_code=500)\n return JSONResponse(content={\"status\": \"ok\", \"detail\": detail or f\"{action} action accepted\"}, status_code=200)", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/http_channel.py:HttpControlChannel", - "span_start": 12, - "span_end": 57, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.http_channel", - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ] - }, - "diagnostics": { - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C0_SOURCE_CHUNKS": "exact_path_fetch", - "C4_SEMANTIC_ROLES": "exact_path_fetch", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C3_ENTRYPOINTS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 8, - "C4_SEMANTIC_ROLES": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C3_ENTRYPOINTS": 6 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C4_SEMANTIC_ROLES": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "HttpControlChannel", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Объясни класс HttpControlChannel", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C4_SEMANTIC_ROLES", - "query": "Объясни класс HttpControlChannel", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "Объясни класс HttpControlChannel", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - }, - { - "layer": "C3_ENTRYPOINTS", - "query": "Объясни класс HttpControlChannel", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 1, - "candidates_after_filter": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 6, - "candidates_after_filter": 6 - }, - { - "layer": "C3_ENTRYPOINTS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 3, - "candidates_after_filter": 3 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "HttpControlChannel", - "alternatives": [ - "HttpControlChannel" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C4_SEMANTIC_ROLES", - "status": "hit", - "hit_count": 8, - "fail_reason": null - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 6, - "fail_reason": null - }, - { - "layer": "C3_ENTRYPOINTS", - "status": "hit", - "hit_count": 3, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "symbol_resolution": 0, - "retrieval_total": 103, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 21, - "C0_SOURCE_CHUNKS": 12, - "C4_SEMANTIC_ROLES": 10, - "C2_DEPENDENCY_GRAPH": 50, - "C3_ENTRYPOINTS": 9 - }, - "merge_rank": 16 - } - } - } - ] - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_router_rag/20260312_085312/router_rag_plba_code_retrieval_plba-rag-explain-http-control-channel.md b/tests/pipeline_setup_v2/test_results/plba_router_rag/20260312_085312/router_rag_plba_code_retrieval_plba-rag-explain-http-control-channel.md deleted file mode 100644 index 7b16505..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_router_rag/20260312_085312/router_rag_plba_code_retrieval_plba-rag-explain-http-control-channel.md +++ /dev/null @@ -1,34 +0,0 @@ -# plba-rag-explain-http-control-channel - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/router_rag_plba_code_retrieval.yaml -- runner: runtime -- mode: router_rag -- passed: True - -## Query -Объясни класс HttpControlChannel - -## Actual -{ - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 19, - "llm_answer": "", - "answer_mode": "partial", - "path_scope": [], - "symbol_candidates": [ - "HttpControlChannel" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] -} - -## Mismatches -- none \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_router_rag/20260312_085312/router_rag_plba_code_retrieval_plba-rag-explain-runtime-manager.json b/tests/pipeline_setup_v2/test_results/plba_router_rag/20260312_085312/router_rag_plba_code_retrieval_plba-rag-explain-runtime-manager.json deleted file mode 100644 index 9a98077..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_router_rag/20260312_085312/router_rag_plba_code_retrieval_plba-rag-explain-runtime-manager.json +++ /dev/null @@ -1,2477 +0,0 @@ -{ - "case_id": "plba-rag-explain-runtime-manager", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/router_rag_plba_code_retrieval.yaml", - "runner": "runtime", - "mode": "router_rag", - "actual": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 19, - "llm_answer": "", - "answer_mode": "partial", - "path_scope": [], - "symbol_candidates": [ - "RuntimeManager" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "passed": true, - "mismatches": [], - "details": { - "case_id": "plba-rag-explain-runtime-manager", - "text": "Объясни как работает класс RuntimeManager", - "mode": "router_rag", - "run_started_at": "2026-03-12T08:53:12", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Объясни как работает класс RuntimeManager", - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "RuntimeManager", - "alternatives": [ - "RuntimeManager" - ], - "confidence": 0.99 - }, - "rag_count": 19, - "rag_rows": [ - { - "path": "src/app_runtime/core/runtime.py", - "content": "class RuntimeManager\nRuntimeManager", - "layer": "C1_SYMBOL_CATALOG", - "title": "RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "7e4a9381328c5803bbc6179458612fc4e947d928aa7bf8b4b2bebb2c8592f758", - "qname": "RuntimeManager", - "kind": "class", - "signature": "RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.core.runtime", - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests manager\n- orchestrates role-like calls (4)\n- reads and writes state attributes\n- participates in dataflow slices (50)", - "layer": "C4_SEMANTIC_ROLES", - "title": "RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 43, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "7e4a9381328c5803bbc6179458612fc4e947d928aa7bf8b4b2bebb2c8592f758", - "symbol_name": "RuntimeManager", - "qname": "RuntimeManager", - "role": "pipeline_stage", - "confidence": 0.67, - "dataflow_participation": 50, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "ControlChannel\nrole: model\n\nResponsibilities:\n- default model role", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlChannel", - "span_start": 21, - "span_end": 28, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 40, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "cfcfe9a311d3a2dbdaf32ac4ccd73c0eb9a117f830591a1c0867ee97d46204ff", - "symbol_name": "ControlChannel", - "qname": "ControlChannel", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "ControlActionSet\nrole: model\n\nResponsibilities:\n- default model role", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlActionSet", - "span_start": 14, - "span_end": 18, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 40, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "46eb026cb3313415ec47b82dd22f84f4d112c9d987e8b1716dcb0baa1cce8988", - "symbol_name": "ControlActionSet", - "qname": "ControlActionSet", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests service\n- reads and writes state attributes\n- participates in dataflow slices (5)", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlPlaneService", - "span_start": 12, - "span_end": 52, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 68, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "b13471e5916986dccffb53fab613812842965705e6b3a89ae549d30c9e91e9aa", - "symbol_name": "ControlPlaneService", - "qname": "ControlPlaneService", - "role": "pipeline_stage", - "confidence": 0.57, - "dataflow_participation": 5, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_runner.py", - "content": "UvicornThreadRunner\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (24)", - "layer": "C4_SEMANTIC_ROLES", - "title": "UvicornThreadRunner", - "span_start": 10, - "span_end": 61, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 11, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "fd55630045a02100df8877ac27d951ee08617d4598764394d48cb51fe067476a", - "symbol_name": "UvicornThreadRunner", - "qname": "UvicornThreadRunner", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 24, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "3779fdd2878b770e789a35bb2a89c9d79f13b61c26d7db1b3b683f9bb9e1623f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (10)", - "layer": "C4_SEMANTIC_ROLES", - "title": "HttpControlChannel", - "span_start": 12, - "span_end": 57, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 21, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "1c9fbdc24819e5604c26ea55428a74310f03a03e1af197ed84846af61e42fdb0", - "symbol_name": "HttpControlChannel", - "qname": "HttpControlChannel", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 10, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "HttpControlAppFactory\nrole: factory\n\nResponsibilities:\n- name suffix suggests factory", - "layer": "C4_SEMANTIC_ROLES", - "title": "HttpControlAppFactory", - "span_start": 15, - "span_end": 53, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 39, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "9b3502a5fb408b273223db13264349cf500de24915b6c649d9ea8970d0dfd8e0", - "symbol_name": "HttpControlAppFactory", - "qname": "HttpControlAppFactory", - "role": "factory", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/persistence/workflow_persistence.py", - "content": "WorkflowPersistence\nrole: pipeline_stage\n\nResponsibilities:\n- orchestrates role-like calls (2)\n- reads and writes state attributes\n- participates in dataflow slices (16)", - "layer": "C4_SEMANTIC_ROLES", - "title": "WorkflowPersistence", - "span_start": 8, - "span_end": 54, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 15, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "7bd01ee45cf31f2d5c2e3e51656254860ac785d10cef9e0852cd4fba90857bae", - "symbol_name": "WorkflowPersistence", - "qname": "WorkflowPersistence", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 16, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "80e9410ddc639789b4353c2a1a757ba8d0d5b5bb6075b0b263b61551f04ae1f0", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.stop", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 25, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d", - "dst_ref": "ControlPlaneService.stop", - "resolution": "resolved", - "slice_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.stop" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._stop_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 51, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a", - "dst_ref": "ControlPlaneService._stop_async", - "resolution": "resolved", - "slice_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._stop_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.register_channel", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 17, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957", - "dst_ref": "ControlPlaneService.register_channel", - "resolution": "resolved", - "slice_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.register_channel" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.start", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 20, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154", - "dst_ref": "ControlPlaneService.start", - "resolution": "resolved", - "slice_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.start" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._start_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 47, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517", - "dst_ref": "ControlPlaneService._start_async", - "resolution": "resolved", - "slice_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._start_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager.add_config_file", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 32, - "span_end": 52, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "a23b8a11ebdb12708b60c96ea12a69f7f042082f1adfddd572444e246d81d167", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "57ffbd4f0d9fdf3507c2b8624312ce211f3d02fdf86a57a8ec90778d8a7b498d", - "dst_ref": "RuntimeManager.add_config_file", - "resolution": "resolved", - "slice_id": "a23b8a11ebdb12708b60c96ea12a69f7f042082f1adfddd572444e246d81d167", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager.add_config_file" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "57ffbd4f0d9fdf3507c2b8624312ce211f3d02fdf86a57a8ec90778d8a7b498d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "class RuntimeManager:\n ACTION_TIMEOUT_SECONDS = 10.0\n ACTION_POLL_INTERVAL_SECONDS = 0.05\n\n def __init__(\n self,\n configuration: ConfigurationManager | None = None,\n services: ServiceContainer | None = None,\n traces: TraceService | None = None,\n health: HealthRegistry | None = None,\n logs: LogManager | None = None,\n workers: WorkerSupervisor | None = None,\n control_plane: ControlPlaneService | None = None,\n ) -> None:\n self.configuration = configuration or ConfigurationManager()\n self.services = services or ServiceContainer()\n self.traces = traces or TraceService()\n self.health = health or HealthRegistry()\n self.logs = logs or LogManager()\n self.workers = workers or WorkerSupervisor()\n self.control_plane = control_plane or ControlPlaneService()\n self.registry = ModuleRegistry(self.services)\n self._started = False\n self._state = LifecycleState.IDLE\n self._core_registered = False\n self._workers_registered = False\n self._register_core_services()\n\n def register_module(self, module: ApplicationModule) -> None:\n self.registry.register_module(module.name)\n module.register(self.registry)\n\n def add_config_file(self, path: str) -> FileConfigProvider:\n provider = FileConfigProvider(path)\n self.configuration.add_provider(provider)\n return provider\n\n def start(self, *, start_control_plane: bool = True) -> None:\n if self._started:\n return\n self._state = LifecycleState.STARTING\n config = self.configuration.load()\n self.logs.apply_config(config)\n self._register_health_contributors()\n self._register_workers()\n self.workers.start()\n if start_control_plane:\n self.control_plane.start(self)\n self._started = True\n self._refresh_state()\n\n def stop(self, timeout: float = 30.0, force: bool = False, stop_control_plane: bool = True) -> None:\n if not self._started:\n return\n self._state = LifecycleState.STOPPING\n self.workers.stop(timeout=timeout, force=force)\n if stop_control_plane:\n self.control_plane.stop()\n self._started = False\n self._state = LifecycleState.STOPPED\n\n def status(self) -> dict[str, object]:\n self._refresh_state()\n return self.control_plane.snapshot(self)\n\n def current_health(self) -> HealthPayload:\n self._refresh_state()\n return self.health.payload(self._state, self.workers.healths())\n\n async def health_status(self) -> HealthPayload:\n return self.current_health()\n\n async def start_runtime(self) -> dict[str, object] | str:\n self._refresh_state()\n if self._started:\n return \"runtime already running\"\n if self._state == LifecycleState.STOPPING:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n\n self.start(start_control_plane=False)\n started = self._wait_for_state({LifecycleState.IDLE, LifecycleState.BUSY}, timeout=self.ACTION_TIMEOUT_SECONDS)\n if started:\n return self._action_detail(\"runtime started\", timed_out=False)\n return self._action_detail(\"runtime start is still in progress\", timed_out=True)\n\n async def stop_runtime(self) -> dict[str, object] | str:\n self._refresh_state()\n if not self._started:\n if self._state == LifecycleState.STOPPING:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n return \"runtime already stopped\"\n\n self._state = LifecycleState.STOPPING\n try:\n self.workers.stop(timeout=self.ACTION_TIMEOUT_SECONDS, force=False)\n except TimeoutError:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n\n self._started = False\n self._state = LifecycleState.STOPPED\n return self._action_detail(\"runtime stopped\", timed_out=False)\n\n async def runtime_status(self) -> str:\n self._refresh_state()\n return self._state.value\n\n def _register_core_services(self) -> None:\n if self._core_registered:\n return\n self.services.register(\"configuration\", self.configuration)\n self.services.register(\"traces\", self.traces)\n self.services.register(\"health\", self.health)\n self.services.register(\"logs\", self.logs)\n self.services.register(\"workers\", self.workers)\n self.services.register(\"control_plane\", self.control_plane)\n self._core_registered = True\n\n def _register_health_contributors(self) -> None:\n for contributor in self.registry.health_contributors:\n self.health.register(contributor)\n\n def _register_workers(self) -> None:\n if self._workers_registered:\n return\n for worker in self.registry.workers:\n self.workers.register(worker)\n self._workers_registered = True\n\n def _refresh_state(self) -> None:\n lifecycle = self.workers.lifecycle_state()\n\n if self._state == LifecycleState.STOPPING:\n if lifecycle == LifecycleState.STOPPED:\n self._started = False\n self._state = LifecycleState.STOPPED\n return\n\n if not self._started:\n if lifecycle == LifecycleState.STOPPED:\n self._state = LifecycleState.STOPPED\n return\n\n self._state = lifecycle\n\n def _wait_for_state(self, target_states: set[LifecycleState], *, timeout: float) -> bool:\n deadline = monotonic() + timeout\n while monotonic() < deadline:\n self._refresh_state()\n if self._state in target_states:\n return True\n sleep(self.ACTION_POLL_INTERVAL_SECONDS)\n self._refresh_state()\n return self._state in target_states\n\n def _action_detail(self, message: str, *, timed_out: bool) -> dict[str, object]:\n self._refresh_state()\n return {\n \"message\": message,\n \"state\": self._state.value,\n \"timed_out\": timed_out,\n \"workers\": self.workers.snapshot(),\n }", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/core/runtime.py:RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.core.runtime", - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "llm_answer": null, - "summary": { - "router": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "confidence": null - }, - "retrieval": { - "profile": "code", - "layers_hit": [ - "C0_SOURCE_CHUNKS", - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS", - "C4_SEMANTIC_ROLES" - ], - "evidence_sufficient": true - }, - "llm": { - "answer_status": "partial", - "groundedness": "not_applicable" - } - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "RuntimeManager" - ], - "keyword_hints": [ - "RuntimeManager" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C0_SOURCE_CHUNKS": "exact_path_fetch", - "C4_SEMANTIC_ROLES": "exact_path_fetch", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C3_ENTRYPOINTS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 8, - "C4_SEMANTIC_ROLES": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C3_ENTRYPOINTS": 6 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C4_SEMANTIC_ROLES": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Объясни как работает класс RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C4_SEMANTIC_ROLES", - "query": "Объясни как работает класс RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "Объясни как работает класс RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - }, - { - "layer": "C3_ENTRYPOINTS", - "query": "Объясни как работает класс RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 1, - "candidates_after_filter": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 6, - "candidates_after_filter": 6 - }, - { - "layer": "C3_ENTRYPOINTS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 3, - "candidates_after_filter": 3 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "RuntimeManager", - "alternatives": [ - "RuntimeManager" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C4_SEMANTIC_ROLES", - "status": "hit", - "hit_count": 8, - "fail_reason": null - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 6, - "fail_reason": null - }, - { - "layer": "C3_ENTRYPOINTS", - "status": "hit", - "hit_count": 3, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "router": 0, - "symbol_resolution": 0, - "retrieval_total": 121, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 23, - "C0_SOURCE_CHUNKS": 12, - "C4_SEMANTIC_ROLES": 11, - "C2_DEPENDENCY_GRAPH": 51, - "C3_ENTRYPOINTS": 11 - }, - "merge_rank": 15, - "prompt_build": 0, - "llm_call": 0 - }, - "prompt": null, - "router": { - "conversation_mode": "START", - "keyword_hints": [ - "RuntimeManager" - ], - "path_scope": [] - }, - "llm": { - "used_evidence_count": 19, - "missing_evidence_reason": null - } - }, - "run_info": { - "case_id": "plba-rag-explain-runtime-manager", - "mode": "router_rag", - "run_started_at": "2026-03-12T08:53:12", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - }, - "input_request": { - "text": "Объясни как работает класс RuntimeManager", - "normalized_query": "Объясни как работает класс RuntimeManager" - }, - "steps": [ - { - "step": "intent_router", - "input": { - "query": "Объясни как работает класс RuntimeManager" - }, - "output": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Объясни как работает класс RuntimeManager" - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "RuntimeManager" - ], - "keyword_hints": [ - "RuntimeManager" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "timings_ms": { - "router": 0 - } - } - }, - { - "step": "retrieval", - "input": { - "query": "Объясни как работает класс RuntimeManager" - }, - "output": { - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "RuntimeManager", - "alternatives": [ - "RuntimeManager" - ], - "confidence": 0.99 - }, - "rag_count": 19, - "rag_rows": [ - { - "path": "src/app_runtime/core/runtime.py", - "content": "class RuntimeManager\nRuntimeManager", - "layer": "C1_SYMBOL_CATALOG", - "title": "RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "7e4a9381328c5803bbc6179458612fc4e947d928aa7bf8b4b2bebb2c8592f758", - "qname": "RuntimeManager", - "kind": "class", - "signature": "RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.core.runtime", - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests manager\n- orchestrates role-like calls (4)\n- reads and writes state attributes\n- participates in dataflow slices (50)", - "layer": "C4_SEMANTIC_ROLES", - "title": "RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 43, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "7e4a9381328c5803bbc6179458612fc4e947d928aa7bf8b4b2bebb2c8592f758", - "symbol_name": "RuntimeManager", - "qname": "RuntimeManager", - "role": "pipeline_stage", - "confidence": 0.67, - "dataflow_participation": 50, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "ControlChannel\nrole: model\n\nResponsibilities:\n- default model role", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlChannel", - "span_start": 21, - "span_end": 28, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 40, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "cfcfe9a311d3a2dbdaf32ac4ccd73c0eb9a117f830591a1c0867ee97d46204ff", - "symbol_name": "ControlChannel", - "qname": "ControlChannel", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "ControlActionSet\nrole: model\n\nResponsibilities:\n- default model role", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlActionSet", - "span_start": 14, - "span_end": 18, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 40, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "46eb026cb3313415ec47b82dd22f84f4d112c9d987e8b1716dcb0baa1cce8988", - "symbol_name": "ControlActionSet", - "qname": "ControlActionSet", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests service\n- reads and writes state attributes\n- participates in dataflow slices (5)", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlPlaneService", - "span_start": 12, - "span_end": 52, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 68, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "b13471e5916986dccffb53fab613812842965705e6b3a89ae549d30c9e91e9aa", - "symbol_name": "ControlPlaneService", - "qname": "ControlPlaneService", - "role": "pipeline_stage", - "confidence": 0.57, - "dataflow_participation": 5, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_runner.py", - "content": "UvicornThreadRunner\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (24)", - "layer": "C4_SEMANTIC_ROLES", - "title": "UvicornThreadRunner", - "span_start": 10, - "span_end": 61, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 11, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "fd55630045a02100df8877ac27d951ee08617d4598764394d48cb51fe067476a", - "symbol_name": "UvicornThreadRunner", - "qname": "UvicornThreadRunner", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 24, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "3779fdd2878b770e789a35bb2a89c9d79f13b61c26d7db1b3b683f9bb9e1623f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (10)", - "layer": "C4_SEMANTIC_ROLES", - "title": "HttpControlChannel", - "span_start": 12, - "span_end": 57, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 21, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "1c9fbdc24819e5604c26ea55428a74310f03a03e1af197ed84846af61e42fdb0", - "symbol_name": "HttpControlChannel", - "qname": "HttpControlChannel", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 10, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "HttpControlAppFactory\nrole: factory\n\nResponsibilities:\n- name suffix suggests factory", - "layer": "C4_SEMANTIC_ROLES", - "title": "HttpControlAppFactory", - "span_start": 15, - "span_end": 53, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 39, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "9b3502a5fb408b273223db13264349cf500de24915b6c649d9ea8970d0dfd8e0", - "symbol_name": "HttpControlAppFactory", - "qname": "HttpControlAppFactory", - "role": "factory", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/persistence/workflow_persistence.py", - "content": "WorkflowPersistence\nrole: pipeline_stage\n\nResponsibilities:\n- orchestrates role-like calls (2)\n- reads and writes state attributes\n- participates in dataflow slices (16)", - "layer": "C4_SEMANTIC_ROLES", - "title": "WorkflowPersistence", - "span_start": 8, - "span_end": 54, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 15, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "7bd01ee45cf31f2d5c2e3e51656254860ac785d10cef9e0852cd4fba90857bae", - "symbol_name": "WorkflowPersistence", - "qname": "WorkflowPersistence", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 16, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "80e9410ddc639789b4353c2a1a757ba8d0d5b5bb6075b0b263b61551f04ae1f0", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.stop", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 25, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d", - "dst_ref": "ControlPlaneService.stop", - "resolution": "resolved", - "slice_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.stop" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._stop_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 51, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a", - "dst_ref": "ControlPlaneService._stop_async", - "resolution": "resolved", - "slice_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._stop_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.register_channel", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 17, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957", - "dst_ref": "ControlPlaneService.register_channel", - "resolution": "resolved", - "slice_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.register_channel" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.start", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 20, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154", - "dst_ref": "ControlPlaneService.start", - "resolution": "resolved", - "slice_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.start" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._start_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 47, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517", - "dst_ref": "ControlPlaneService._start_async", - "resolution": "resolved", - "slice_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._start_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager.add_config_file", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 32, - "span_end": 52, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "a23b8a11ebdb12708b60c96ea12a69f7f042082f1adfddd572444e246d81d167", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "57ffbd4f0d9fdf3507c2b8624312ce211f3d02fdf86a57a8ec90778d8a7b498d", - "dst_ref": "RuntimeManager.add_config_file", - "resolution": "resolved", - "slice_id": "a23b8a11ebdb12708b60c96ea12a69f7f042082f1adfddd572444e246d81d167", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager.add_config_file" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "57ffbd4f0d9fdf3507c2b8624312ce211f3d02fdf86a57a8ec90778d8a7b498d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "class RuntimeManager:\n ACTION_TIMEOUT_SECONDS = 10.0\n ACTION_POLL_INTERVAL_SECONDS = 0.05\n\n def __init__(\n self,\n configuration: ConfigurationManager | None = None,\n services: ServiceContainer | None = None,\n traces: TraceService | None = None,\n health: HealthRegistry | None = None,\n logs: LogManager | None = None,\n workers: WorkerSupervisor | None = None,\n control_plane: ControlPlaneService | None = None,\n ) -> None:\n self.configuration = configuration or ConfigurationManager()\n self.services = services or ServiceContainer()\n self.traces = traces or TraceService()\n self.health = health or HealthRegistry()\n self.logs = logs or LogManager()\n self.workers = workers or WorkerSupervisor()\n self.control_plane = control_plane or ControlPlaneService()\n self.registry = ModuleRegistry(self.services)\n self._started = False\n self._state = LifecycleState.IDLE\n self._core_registered = False\n self._workers_registered = False\n self._register_core_services()\n\n def register_module(self, module: ApplicationModule) -> None:\n self.registry.register_module(module.name)\n module.register(self.registry)\n\n def add_config_file(self, path: str) -> FileConfigProvider:\n provider = FileConfigProvider(path)\n self.configuration.add_provider(provider)\n return provider\n\n def start(self, *, start_control_plane: bool = True) -> None:\n if self._started:\n return\n self._state = LifecycleState.STARTING\n config = self.configuration.load()\n self.logs.apply_config(config)\n self._register_health_contributors()\n self._register_workers()\n self.workers.start()\n if start_control_plane:\n self.control_plane.start(self)\n self._started = True\n self._refresh_state()\n\n def stop(self, timeout: float = 30.0, force: bool = False, stop_control_plane: bool = True) -> None:\n if not self._started:\n return\n self._state = LifecycleState.STOPPING\n self.workers.stop(timeout=timeout, force=force)\n if stop_control_plane:\n self.control_plane.stop()\n self._started = False\n self._state = LifecycleState.STOPPED\n\n def status(self) -> dict[str, object]:\n self._refresh_state()\n return self.control_plane.snapshot(self)\n\n def current_health(self) -> HealthPayload:\n self._refresh_state()\n return self.health.payload(self._state, self.workers.healths())\n\n async def health_status(self) -> HealthPayload:\n return self.current_health()\n\n async def start_runtime(self) -> dict[str, object] | str:\n self._refresh_state()\n if self._started:\n return \"runtime already running\"\n if self._state == LifecycleState.STOPPING:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n\n self.start(start_control_plane=False)\n started = self._wait_for_state({LifecycleState.IDLE, LifecycleState.BUSY}, timeout=self.ACTION_TIMEOUT_SECONDS)\n if started:\n return self._action_detail(\"runtime started\", timed_out=False)\n return self._action_detail(\"runtime start is still in progress\", timed_out=True)\n\n async def stop_runtime(self) -> dict[str, object] | str:\n self._refresh_state()\n if not self._started:\n if self._state == LifecycleState.STOPPING:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n return \"runtime already stopped\"\n\n self._state = LifecycleState.STOPPING\n try:\n self.workers.stop(timeout=self.ACTION_TIMEOUT_SECONDS, force=False)\n except TimeoutError:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n\n self._started = False\n self._state = LifecycleState.STOPPED\n return self._action_detail(\"runtime stopped\", timed_out=False)\n\n async def runtime_status(self) -> str:\n self._refresh_state()\n return self._state.value\n\n def _register_core_services(self) -> None:\n if self._core_registered:\n return\n self.services.register(\"configuration\", self.configuration)\n self.services.register(\"traces\", self.traces)\n self.services.register(\"health\", self.health)\n self.services.register(\"logs\", self.logs)\n self.services.register(\"workers\", self.workers)\n self.services.register(\"control_plane\", self.control_plane)\n self._core_registered = True\n\n def _register_health_contributors(self) -> None:\n for contributor in self.registry.health_contributors:\n self.health.register(contributor)\n\n def _register_workers(self) -> None:\n if self._workers_registered:\n return\n for worker in self.registry.workers:\n self.workers.register(worker)\n self._workers_registered = True\n\n def _refresh_state(self) -> None:\n lifecycle = self.workers.lifecycle_state()\n\n if self._state == LifecycleState.STOPPING:\n if lifecycle == LifecycleState.STOPPED:\n self._started = False\n self._state = LifecycleState.STOPPED\n return\n\n if not self._started:\n if lifecycle == LifecycleState.STOPPED:\n self._state = LifecycleState.STOPPED\n return\n\n self._state = lifecycle\n\n def _wait_for_state(self, target_states: set[LifecycleState], *, timeout: float) -> bool:\n deadline = monotonic() + timeout\n while monotonic() < deadline:\n self._refresh_state()\n if self._state in target_states:\n return True\n sleep(self.ACTION_POLL_INTERVAL_SECONDS)\n self._refresh_state()\n return self._state in target_states\n\n def _action_detail(self, message: str, *, timed_out: bool) -> dict[str, object]:\n self._refresh_state()\n return {\n \"message\": message,\n \"state\": self._state.value,\n \"timed_out\": timed_out,\n \"workers\": self.workers.snapshot(),\n }", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/core/runtime.py:RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.core.runtime", - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ] - }, - "diagnostics": { - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C0_SOURCE_CHUNKS": "exact_path_fetch", - "C4_SEMANTIC_ROLES": "exact_path_fetch", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C3_ENTRYPOINTS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 8, - "C4_SEMANTIC_ROLES": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C3_ENTRYPOINTS": 6 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C4_SEMANTIC_ROLES": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Объясни как работает класс RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C4_SEMANTIC_ROLES", - "query": "Объясни как работает класс RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "Объясни как работает класс RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - }, - { - "layer": "C3_ENTRYPOINTS", - "query": "Объясни как работает класс RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 1, - "candidates_after_filter": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 6, - "candidates_after_filter": 6 - }, - { - "layer": "C3_ENTRYPOINTS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 3, - "candidates_after_filter": 3 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "RuntimeManager", - "alternatives": [ - "RuntimeManager" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C4_SEMANTIC_ROLES", - "status": "hit", - "hit_count": 8, - "fail_reason": null - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 6, - "fail_reason": null - }, - { - "layer": "C3_ENTRYPOINTS", - "status": "hit", - "hit_count": 3, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "symbol_resolution": 0, - "retrieval_total": 121, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 23, - "C0_SOURCE_CHUNKS": 12, - "C4_SEMANTIC_ROLES": 11, - "C2_DEPENDENCY_GRAPH": 51, - "C3_ENTRYPOINTS": 11 - }, - "merge_rank": 15 - } - } - } - ] - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_router_rag/20260312_085312/router_rag_plba_code_retrieval_plba-rag-explain-runtime-manager.md b/tests/pipeline_setup_v2/test_results/plba_router_rag/20260312_085312/router_rag_plba_code_retrieval_plba-rag-explain-runtime-manager.md deleted file mode 100644 index fd2e3dc..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_router_rag/20260312_085312/router_rag_plba_code_retrieval_plba-rag-explain-runtime-manager.md +++ /dev/null @@ -1,34 +0,0 @@ -# plba-rag-explain-runtime-manager - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/router_rag_plba_code_retrieval.yaml -- runner: runtime -- mode: router_rag -- passed: True - -## Query -Объясни как работает класс RuntimeManager - -## Actual -{ - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 19, - "llm_answer": "", - "answer_mode": "partial", - "path_scope": [], - "symbol_candidates": [ - "RuntimeManager" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] -} - -## Mismatches -- none \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_router_rag/20260312_085312/router_rag_plba_code_retrieval_plba-rag-explain-trace-service.json b/tests/pipeline_setup_v2/test_results/plba_router_rag/20260312_085312/router_rag_plba_code_retrieval_plba-rag-explain-trace-service.json deleted file mode 100644 index f26fbd7..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_router_rag/20260312_085312/router_rag_plba_code_retrieval_plba-rag-explain-trace-service.json +++ /dev/null @@ -1,2597 +0,0 @@ -{ - "case_id": "plba-rag-explain-trace-service", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/router_rag_plba_code_retrieval.yaml", - "runner": "runtime", - "mode": "router_rag", - "actual": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 21, - "llm_answer": "", - "answer_mode": "partial", - "path_scope": [], - "symbol_candidates": [ - "TraceService" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "passed": true, - "mismatches": [], - "details": { - "case_id": "plba-rag-explain-trace-service", - "text": "Как работает TraceService?", - "mode": "router_rag", - "run_started_at": "2026-03-12T08:53:12", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Как работает TraceService?", - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "TraceService", - "alternatives": [ - "TraceService" - ], - "confidence": 0.99 - }, - "rag_count": 21, - "rag_rows": [ - { - "path": "src/app_runtime/tracing/service.py", - "content": "class TraceService\nTraceService(TraceContextFactory)", - "layer": "C1_SYMBOL_CATALOG", - "title": "TraceService", - "span_start": 39, - "span_end": 166, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "c2b2b976d99f2c600000b753731b26e0a69adcb4359398b93073590c5d5d04f4", - "qname": "TraceService", - "kind": "class", - "signature": "TraceService(TraceContextFactory)", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.tracing.service", - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "TraceService\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests service\n- reads and writes state attributes\n- participates in dataflow slices (13)", - "layer": "C4_SEMANTIC_ROLES", - "title": "TraceService", - "span_start": 39, - "span_end": 166, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 60, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "c2b2b976d99f2c600000b753731b26e0a69adcb4359398b93073590c5d5d04f4", - "symbol_name": "TraceService", - "qname": "TraceService", - "role": "pipeline_stage", - "confidence": 0.57, - "dataflow_participation": 13, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_runner.py", - "content": "UvicornThreadRunner\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (24)", - "layer": "C4_SEMANTIC_ROLES", - "title": "UvicornThreadRunner", - "span_start": 10, - "span_end": 61, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 11, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "fd55630045a02100df8877ac27d951ee08617d4598764394d48cb51fe067476a", - "symbol_name": "UvicornThreadRunner", - "qname": "UvicornThreadRunner", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 24, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "3779fdd2878b770e789a35bb2a89c9d79f13b61c26d7db1b3b683f9bb9e1623f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/persistence/workflow_persistence.py", - "content": "WorkflowPersistence\nrole: pipeline_stage\n\nResponsibilities:\n- orchestrates role-like calls (2)\n- reads and writes state attributes\n- participates in dataflow slices (16)", - "layer": "C4_SEMANTIC_ROLES", - "title": "WorkflowPersistence", - "span_start": 8, - "span_end": 54, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 15, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "7bd01ee45cf31f2d5c2e3e51656254860ac785d10cef9e0852cd4fba90857bae", - "symbol_name": "WorkflowPersistence", - "qname": "WorkflowPersistence", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 16, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "80e9410ddc639789b4353c2a1a757ba8d0d5b5bb6075b0b263b61551f04ae1f0", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (10)", - "layer": "C4_SEMANTIC_ROLES", - "title": "HttpControlChannel", - "span_start": 12, - "span_end": 57, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 21, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "1c9fbdc24819e5604c26ea55428a74310f03a03e1af197ed84846af61e42fdb0", - "symbol_name": "HttpControlChannel", - "qname": "HttpControlChannel", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 10, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/queue/in_memory.py", - "content": "InMemoryTaskQueue\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (9)", - "layer": "C4_SEMANTIC_ROLES", - "title": "InMemoryTaskQueue", - "span_start": 9, - "span_end": 38, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 22, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "2da04cb94544a3bcbf0943a95ad4bdd8710bcafaa32a02fd0e4de2178dcf3533", - "symbol_name": "InMemoryTaskQueue", - "qname": "InMemoryTaskQueue", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 9, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "58f0cc001ccda0eee4c6bc32ed83bd05eafd6b6644f1e8b4aa9eed3103db73dc", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/config/file_loader.py", - "content": "ConfigFileLoader\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (8)", - "layer": "C4_SEMANTIC_ROLES", - "title": "ConfigFileLoader", - "span_start": 11, - "span_end": 48, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 23, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "a8474eca8b6e9dc86ae67ed68b16fa5fb639ef08739c053e7b7195489765667f", - "symbol_name": "ConfigFileLoader", - "qname": "ConfigFileLoader", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 8, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "1f19ffebde5e38e4be5a5d5a678059a0f36dedb8fb8b3e00ab395c67106a87ea", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/store.py", - "content": "TraceContextStore\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (6)", - "layer": "C4_SEMANTIC_ROLES", - "title": "TraceContextStore", - "span_start": 15, - "span_end": 52, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 25, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "b2dad4fbe16ffb11b58deba311c7739955c39d59f291b22181f33e9c8cce4059", - "symbol_name": "TraceContextStore", - "qname": "TraceContextStore", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 6, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "d369554f08fc92039c6edd5a2a1e73b23901533e8974459170bbd9347d263dc5", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workers/supervisor.py", - "content": "WorkerSupervisor\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (6)", - "layer": "C4_SEMANTIC_ROLES", - "title": "WorkerSupervisor", - "span_start": 10, - "span_end": 59, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 25, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "c17b44e8d9e97d490989b21fa67d7c346cdda8a0472e4c41fb243c8846faa124", - "symbol_name": "WorkerSupervisor", - "qname": "WorkerSupervisor", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 6, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "77609d9d5927171cce7fc3a54897c183fd63068710c6362029b700937aae5eee", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "TraceService.__init__\n -> TraceService.store\n -> TraceService.create_context", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "TraceService.__init__:dataflow_slice", - "span_start": 42, - "span_end": 61, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "3b052062067a78aef3302ee1d996897e02a67d1b340397bea4f59fe147c0492a", - "edge_type": "dataflow_slice", - "src_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "src_qname": "TraceService.__init__", - "dst_symbol_id": "ff44881104b65ef50ee6fe16d367d4a81b6e7eb5c44c0963cf4543faec785d4a", - "dst_ref": "TraceService.create_context", - "resolution": "resolved", - "slice_id": "3b052062067a78aef3302ee1d996897e02a67d1b340397bea4f59fe147c0492a", - "root_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "path_symbols": [ - "TraceService.__init__", - "TraceService.store", - "TraceService.create_context" - ], - "path_symbol_ids": [ - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "ff44881104b65ef50ee6fe16d367d4a81b6e7eb5c44c0963cf4543faec785d4a" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "TraceService.__init__\n -> TraceService.store\n -> TraceService.close_context", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "TraceService.__init__:dataflow_slice", - "span_start": 42, - "span_end": 84, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "7a9353ef57c9ae5d19b3a0c6ac50fad05e6d21d31bbe1cd1cd07af6332ba6505", - "edge_type": "dataflow_slice", - "src_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "src_qname": "TraceService.__init__", - "dst_symbol_id": "01e14158dcced7e52d0c8ac84ac7b9a75225c261b6aca6a1d7da802d0994721c", - "dst_ref": "TraceService.close_context", - "resolution": "resolved", - "slice_id": "7a9353ef57c9ae5d19b3a0c6ac50fad05e6d21d31bbe1cd1cd07af6332ba6505", - "root_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "path_symbols": [ - "TraceService.__init__", - "TraceService.store", - "TraceService.close_context" - ], - "path_symbol_ids": [ - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "01e14158dcced7e52d0c8ac84ac7b9a75225c261b6aca6a1d7da802d0994721c" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "TraceService.__init__\n -> TraceService.store\n -> TraceService.open_context", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "TraceService.__init__:dataflow_slice", - "span_start": 42, - "span_end": 78, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "a6e13b9ebc4fed84586afd53ed92a4d14757e440873f572b2337d5622ee96031", - "edge_type": "dataflow_slice", - "src_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "src_qname": "TraceService.__init__", - "dst_symbol_id": "2da3d5b20a947bf63e14c103be4689b72fd837e0a82abd6c497846375d4c7426", - "dst_ref": "TraceService.open_context", - "resolution": "resolved", - "slice_id": "a6e13b9ebc4fed84586afd53ed92a4d14757e440873f572b2337d5622ee96031", - "root_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "path_symbols": [ - "TraceService.__init__", - "TraceService.store", - "TraceService.open_context" - ], - "path_symbol_ids": [ - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "2da3d5b20a947bf63e14c103be4689b72fd837e0a82abd6c497846375d4c7426" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "TraceService.__init__\n -> TraceService.transport\n -> TraceService.__init__", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "TraceService.__init__:dataflow_slice", - "span_start": 41, - "span_end": 43, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "1e923a93faa05c3c43ca9b19bd047007a8589ccce57d3cc1798ae7f9f200af98", - "edge_type": "dataflow_slice", - "src_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "src_qname": "TraceService.__init__", - "dst_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "dst_ref": "TraceService.__init__", - "resolution": "resolved", - "slice_id": "1e923a93faa05c3c43ca9b19bd047007a8589ccce57d3cc1798ae7f9f200af98", - "root_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "path_symbols": [ - "TraceService.__init__", - "TraceService.transport", - "TraceService.__init__" - ], - "path_symbol_ids": [ - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "TraceService.__init__\n -> TraceService.store\n -> TraceService.current_trace_id", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "TraceService.__init__:dataflow_slice", - "span_start": 42, - "span_end": 81, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "3ea17138634b1190bded77ddb84aa1595124f6519b246f24fc4b02bd62b5cac1", - "edge_type": "dataflow_slice", - "src_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "src_qname": "TraceService.__init__", - "dst_symbol_id": "41135180f7b3b9ab20e097e0747474e219c37dd2366ef08a7b43c1f3edb10b4c", - "dst_ref": "TraceService.current_trace_id", - "resolution": "resolved", - "slice_id": "3ea17138634b1190bded77ddb84aa1595124f6519b246f24fc4b02bd62b5cac1", - "root_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "path_symbols": [ - "TraceService.__init__", - "TraceService.store", - "TraceService.current_trace_id" - ], - "path_symbol_ids": [ - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "41135180f7b3b9ab20e097e0747474e219c37dd2366ef08a7b43c1f3edb10b4c" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "TraceService.__init__\n -> TraceService.store\n -> TraceService.step", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "TraceService.__init__:dataflow_slice", - "span_start": 42, - "span_end": 88, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "9f34c5da9b09fba99df6f6b1bde183a9aeb45111b8218a747c71590c2c9f60f2", - "edge_type": "dataflow_slice", - "src_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "src_qname": "TraceService.__init__", - "dst_symbol_id": "c44bfbc66cf747283f30088da3e011a10395031d41e77b74e523c24997f641ca", - "dst_ref": "TraceService.step", - "resolution": "resolved", - "slice_id": "9f34c5da9b09fba99df6f6b1bde183a9aeb45111b8218a747c71590c2c9f60f2", - "root_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "path_symbols": [ - "TraceService.__init__", - "TraceService.store", - "TraceService.step" - ], - "path_symbol_ids": [ - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "c44bfbc66cf747283f30088da3e011a10395031d41e77b74e523c24997f641ca" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "class TraceRecordWriter:\n def __init__(self, transport: TraceTransport) -> None:\n self._logger = logging.getLogger(__name__)\n self._transport = transport\n\n def write_context(self, record: TraceContextRecord) -> None:\n try:\n self._transport.write_context(record)\n except Exception:\n self._logger.exception(\"Trace transport failed to write context %s\", record.trace_id)\n\n def write_message(self, record: TraceLogMessage) -> None:\n try:\n self._transport.write_message(record)\n except Exception:\n self._logger.exception(\"Trace transport failed to write message for %s\", record.trace_id)", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/tracing/service.py:TraceRecordWriter", - "span_start": 21, - "span_end": 36, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.tracing.service", - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "class TraceService(TraceContextFactory):\n def __init__(self, transport: TraceTransport | None = None, store: TraceContextStore | None = None) -> None:\n self.transport = transport or NoOpTraceTransport()\n self.store = store or TraceContextStore()\n self._writer = TraceRecordWriter(self.transport)\n\n def create_context(\n self,\n *,\n alias: str,\n parent_id: str | None = None,\n kind: str | None = None,\n attrs: dict[str, Any] | None = None,\n ) -> str:\n record = TraceContextRecord(\n trace_id=uuid4().hex,\n alias=str(alias or \"\"),\n parent_id=parent_id,\n type=kind,\n event_time=utc_now(),\n attrs=dict(attrs or {}),\n )\n self.store.push(record)\n self._writer.write_context(record)\n return record.trace_id\n\n @contextmanager\n def open_context(\n self,\n *,\n alias: str,\n parent_id: str | None = None,\n kind: str | None = None,\n attrs: dict[str, Any] | None = None,\n ) -> Iterator[str]:\n trace_id = self.create_context(alias=alias, parent_id=parent_id, kind=kind, attrs=attrs)\n try:\n yield trace_id\n finally:\n self.store.pop()\n\n def current_trace_id(self) -> str | None:\n return self.store.current_trace_id()\n\n def close_context(self) -> str | None:\n previous = self.store.pop()\n return previous.record.trace_id if previous else None\n\n def step(self, name: str) -> None:\n self.store.set_step(str(name or \"\"))\n\n def info(self, message: str, *, status: str | None = None, attrs: dict[str, Any] | None = None) -> None:\n self._write_message(\"INFO\", message, status, attrs)\n\n def debug(self, message: str, *, status: str | None = None, attrs: dict[str, Any] | None = None) -> None:\n self._write_message(\"DEBUG\", message, status, attrs)\n\n def warning(self, message: str, *, status: str | None = None, attrs: dict[str, Any] | None = None) -> None:\n self._write_message(\"WARNING\", message, status, attrs)\n\n def error(self, message: str, *, status: str | None = None, attrs: dict[str, Any] | None = None) -> None:\n self._write_message(\"ERROR\", message, status, attrs)\n\n def exception(self, message: str, *, status: str = \"failed\", attrs: dict[str, Any] | None = None) -> None:\n self._write_message(\"ERROR\", message, status, attrs)\n\n def new_root(self, operation: str) -> TraceContext:\n trace_id = self.create_context(alias=operation, kind=\"operation\", attrs={\"operation\": operation})\n return TraceContext(trace_id=trace_id, span_id=trace_id, attributes={\"operation\": operation})\n\n def child_of(self, parent: TraceContext, operation: str) -> TraceContext:\n trace_id = self.create_context(\n alias=operation,\n parent_id=parent.trace_id,\n kind=\"worker\",\n attrs={\"operation\": operation},\n )\n return TraceContext(\n trace_id=trace_id,\n span_id=trace_id,\n parent_span_id=parent.span_id,\n attributes={\"operation\": operation},\n )\n\n def attach(self, metadata: dict[str, object], context: TraceContext) -> dict[str, object]:\n updated = dict(metadata)\n updated[\"trace_id\"] = context.trace_id\n updated[\"span_id\"] = context.span_id\n updated[\"parent_span_id\"] = context.parent_span_id\n return updated\n\n def resume(self, metadata: dict[str, object], operation: str) -> TraceContext:\n trace_id = str(metadata.get(\"trace_id\") or uuid4().hex)\n span_id = str(metadata.get(\"span_id\") or trace_id)\n parent_id = metadata.get(\"parent_span_id\")\n self.create_context(\n alias=operation,\n parent_id=str(parent_id) if parent_id else None,\n kind=\"worker\",\n attrs=dict(metadata),\n )\n return TraceContext(\n trace_id=trace_id,\n span_id=span_id,\n parent_span_id=str(parent_id) if parent_id else None,\n attributes={\"operation\": operation},\n )\n\n def _write_message(\n self,\n level: TraceLevel,\n message: str,\n status: str | None,\n attrs: dict[str, Any] | None,\n ) -> None:\n active = self.store.current()\n if active is None:\n raise RuntimeError(\"Trace context is not bound. Call create_context() first.\")\n record = TraceLogMessage(\n trace_id=active.record.trace_id,\n step=active.step,\n status=str(status or \"\"),\n message=str(message or \"\"),\n level=level,\n event_time=utc_now(),\n attrs=dict(attrs or {}),\n )\n self._writer.write_message(record)", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/tracing/service.py:TraceService", - "span_start": 39, - "span_end": 166, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 1, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.tracing.service", - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "class TraceManager(TraceService):\n \"\"\"Compatibility alias during the transition from ConfigManager-shaped naming.\"\"\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/tracing/service.py:TraceManager", - "span_start": 169, - "span_end": 170, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 2, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.tracing.service", - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "llm_answer": null, - "summary": { - "router": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "confidence": null - }, - "retrieval": { - "profile": "code", - "layers_hit": [ - "C0_SOURCE_CHUNKS", - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS", - "C4_SEMANTIC_ROLES" - ], - "evidence_sufficient": true - }, - "llm": { - "answer_status": "partial", - "groundedness": "not_applicable" - } - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "TraceService" - ], - "keyword_hints": [ - "TraceService" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C0_SOURCE_CHUNKS": "exact_path_fetch", - "C4_SEMANTIC_ROLES": "exact_path_fetch", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C3_ENTRYPOINTS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 8, - "C4_SEMANTIC_ROLES": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C3_ENTRYPOINTS": 6 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C4_SEMANTIC_ROLES": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "TraceService", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Как работает TraceService?", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C4_SEMANTIC_ROLES", - "query": "Как работает TraceService?", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "Как работает TraceService?", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - }, - { - "layer": "C3_ENTRYPOINTS", - "query": "Как работает TraceService?", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 1, - "candidates_after_filter": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 6, - "candidates_after_filter": 6 - }, - { - "layer": "C3_ENTRYPOINTS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 3, - "candidates_after_filter": 3 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "TraceService", - "alternatives": [ - "TraceService" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 3, - "fail_reason": null - }, - { - "layer": "C4_SEMANTIC_ROLES", - "status": "hit", - "hit_count": 8, - "fail_reason": null - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 6, - "fail_reason": null - }, - { - "layer": "C3_ENTRYPOINTS", - "status": "hit", - "hit_count": 3, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "router": 0, - "symbol_resolution": 0, - "retrieval_total": 89, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 18, - "C0_SOURCE_CHUNKS": 11, - "C4_SEMANTIC_ROLES": 10, - "C2_DEPENDENCY_GRAPH": 41, - "C3_ENTRYPOINTS": 8 - }, - "merge_rank": 15, - "prompt_build": 0, - "llm_call": 0 - }, - "prompt": null, - "router": { - "conversation_mode": "START", - "keyword_hints": [ - "TraceService" - ], - "path_scope": [] - }, - "llm": { - "used_evidence_count": 21, - "missing_evidence_reason": null - } - }, - "run_info": { - "case_id": "plba-rag-explain-trace-service", - "mode": "router_rag", - "run_started_at": "2026-03-12T08:53:12", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - }, - "input_request": { - "text": "Как работает TraceService?", - "normalized_query": "Как работает TraceService?" - }, - "steps": [ - { - "step": "intent_router", - "input": { - "query": "Как работает TraceService?" - }, - "output": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Как работает TraceService?" - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "TraceService" - ], - "keyword_hints": [ - "TraceService" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "timings_ms": { - "router": 0 - } - } - }, - { - "step": "retrieval", - "input": { - "query": "Как работает TraceService?" - }, - "output": { - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "TraceService", - "alternatives": [ - "TraceService" - ], - "confidence": 0.99 - }, - "rag_count": 21, - "rag_rows": [ - { - "path": "src/app_runtime/tracing/service.py", - "content": "class TraceService\nTraceService(TraceContextFactory)", - "layer": "C1_SYMBOL_CATALOG", - "title": "TraceService", - "span_start": 39, - "span_end": 166, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "c2b2b976d99f2c600000b753731b26e0a69adcb4359398b93073590c5d5d04f4", - "qname": "TraceService", - "kind": "class", - "signature": "TraceService(TraceContextFactory)", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.tracing.service", - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "TraceService\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests service\n- reads and writes state attributes\n- participates in dataflow slices (13)", - "layer": "C4_SEMANTIC_ROLES", - "title": "TraceService", - "span_start": 39, - "span_end": 166, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 60, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "c2b2b976d99f2c600000b753731b26e0a69adcb4359398b93073590c5d5d04f4", - "symbol_name": "TraceService", - "qname": "TraceService", - "role": "pipeline_stage", - "confidence": 0.57, - "dataflow_participation": 13, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_runner.py", - "content": "UvicornThreadRunner\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (24)", - "layer": "C4_SEMANTIC_ROLES", - "title": "UvicornThreadRunner", - "span_start": 10, - "span_end": 61, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 11, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "fd55630045a02100df8877ac27d951ee08617d4598764394d48cb51fe067476a", - "symbol_name": "UvicornThreadRunner", - "qname": "UvicornThreadRunner", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 24, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "3779fdd2878b770e789a35bb2a89c9d79f13b61c26d7db1b3b683f9bb9e1623f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/persistence/workflow_persistence.py", - "content": "WorkflowPersistence\nrole: pipeline_stage\n\nResponsibilities:\n- orchestrates role-like calls (2)\n- reads and writes state attributes\n- participates in dataflow slices (16)", - "layer": "C4_SEMANTIC_ROLES", - "title": "WorkflowPersistence", - "span_start": 8, - "span_end": 54, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 15, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "7bd01ee45cf31f2d5c2e3e51656254860ac785d10cef9e0852cd4fba90857bae", - "symbol_name": "WorkflowPersistence", - "qname": "WorkflowPersistence", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 16, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "80e9410ddc639789b4353c2a1a757ba8d0d5b5bb6075b0b263b61551f04ae1f0", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (10)", - "layer": "C4_SEMANTIC_ROLES", - "title": "HttpControlChannel", - "span_start": 12, - "span_end": 57, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 21, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "1c9fbdc24819e5604c26ea55428a74310f03a03e1af197ed84846af61e42fdb0", - "symbol_name": "HttpControlChannel", - "qname": "HttpControlChannel", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 10, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/queue/in_memory.py", - "content": "InMemoryTaskQueue\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (9)", - "layer": "C4_SEMANTIC_ROLES", - "title": "InMemoryTaskQueue", - "span_start": 9, - "span_end": 38, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 22, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "2da04cb94544a3bcbf0943a95ad4bdd8710bcafaa32a02fd0e4de2178dcf3533", - "symbol_name": "InMemoryTaskQueue", - "qname": "InMemoryTaskQueue", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 9, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "58f0cc001ccda0eee4c6bc32ed83bd05eafd6b6644f1e8b4aa9eed3103db73dc", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/config/file_loader.py", - "content": "ConfigFileLoader\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (8)", - "layer": "C4_SEMANTIC_ROLES", - "title": "ConfigFileLoader", - "span_start": 11, - "span_end": 48, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 23, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "a8474eca8b6e9dc86ae67ed68b16fa5fb639ef08739c053e7b7195489765667f", - "symbol_name": "ConfigFileLoader", - "qname": "ConfigFileLoader", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 8, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "1f19ffebde5e38e4be5a5d5a678059a0f36dedb8fb8b3e00ab395c67106a87ea", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/store.py", - "content": "TraceContextStore\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (6)", - "layer": "C4_SEMANTIC_ROLES", - "title": "TraceContextStore", - "span_start": 15, - "span_end": 52, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 25, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "b2dad4fbe16ffb11b58deba311c7739955c39d59f291b22181f33e9c8cce4059", - "symbol_name": "TraceContextStore", - "qname": "TraceContextStore", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 6, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "d369554f08fc92039c6edd5a2a1e73b23901533e8974459170bbd9347d263dc5", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workers/supervisor.py", - "content": "WorkerSupervisor\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (6)", - "layer": "C4_SEMANTIC_ROLES", - "title": "WorkerSupervisor", - "span_start": 10, - "span_end": 59, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 25, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "c17b44e8d9e97d490989b21fa67d7c346cdda8a0472e4c41fb243c8846faa124", - "symbol_name": "WorkerSupervisor", - "qname": "WorkerSupervisor", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 6, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "77609d9d5927171cce7fc3a54897c183fd63068710c6362029b700937aae5eee", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "TraceService.__init__\n -> TraceService.store\n -> TraceService.create_context", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "TraceService.__init__:dataflow_slice", - "span_start": 42, - "span_end": 61, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "3b052062067a78aef3302ee1d996897e02a67d1b340397bea4f59fe147c0492a", - "edge_type": "dataflow_slice", - "src_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "src_qname": "TraceService.__init__", - "dst_symbol_id": "ff44881104b65ef50ee6fe16d367d4a81b6e7eb5c44c0963cf4543faec785d4a", - "dst_ref": "TraceService.create_context", - "resolution": "resolved", - "slice_id": "3b052062067a78aef3302ee1d996897e02a67d1b340397bea4f59fe147c0492a", - "root_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "path_symbols": [ - "TraceService.__init__", - "TraceService.store", - "TraceService.create_context" - ], - "path_symbol_ids": [ - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "ff44881104b65ef50ee6fe16d367d4a81b6e7eb5c44c0963cf4543faec785d4a" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "TraceService.__init__\n -> TraceService.store\n -> TraceService.close_context", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "TraceService.__init__:dataflow_slice", - "span_start": 42, - "span_end": 84, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "7a9353ef57c9ae5d19b3a0c6ac50fad05e6d21d31bbe1cd1cd07af6332ba6505", - "edge_type": "dataflow_slice", - "src_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "src_qname": "TraceService.__init__", - "dst_symbol_id": "01e14158dcced7e52d0c8ac84ac7b9a75225c261b6aca6a1d7da802d0994721c", - "dst_ref": "TraceService.close_context", - "resolution": "resolved", - "slice_id": "7a9353ef57c9ae5d19b3a0c6ac50fad05e6d21d31bbe1cd1cd07af6332ba6505", - "root_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "path_symbols": [ - "TraceService.__init__", - "TraceService.store", - "TraceService.close_context" - ], - "path_symbol_ids": [ - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "01e14158dcced7e52d0c8ac84ac7b9a75225c261b6aca6a1d7da802d0994721c" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "TraceService.__init__\n -> TraceService.store\n -> TraceService.open_context", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "TraceService.__init__:dataflow_slice", - "span_start": 42, - "span_end": 78, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "a6e13b9ebc4fed84586afd53ed92a4d14757e440873f572b2337d5622ee96031", - "edge_type": "dataflow_slice", - "src_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "src_qname": "TraceService.__init__", - "dst_symbol_id": "2da3d5b20a947bf63e14c103be4689b72fd837e0a82abd6c497846375d4c7426", - "dst_ref": "TraceService.open_context", - "resolution": "resolved", - "slice_id": "a6e13b9ebc4fed84586afd53ed92a4d14757e440873f572b2337d5622ee96031", - "root_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "path_symbols": [ - "TraceService.__init__", - "TraceService.store", - "TraceService.open_context" - ], - "path_symbol_ids": [ - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "2da3d5b20a947bf63e14c103be4689b72fd837e0a82abd6c497846375d4c7426" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "TraceService.__init__\n -> TraceService.transport\n -> TraceService.__init__", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "TraceService.__init__:dataflow_slice", - "span_start": 41, - "span_end": 43, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "1e923a93faa05c3c43ca9b19bd047007a8589ccce57d3cc1798ae7f9f200af98", - "edge_type": "dataflow_slice", - "src_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "src_qname": "TraceService.__init__", - "dst_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "dst_ref": "TraceService.__init__", - "resolution": "resolved", - "slice_id": "1e923a93faa05c3c43ca9b19bd047007a8589ccce57d3cc1798ae7f9f200af98", - "root_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "path_symbols": [ - "TraceService.__init__", - "TraceService.transport", - "TraceService.__init__" - ], - "path_symbol_ids": [ - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "TraceService.__init__\n -> TraceService.store\n -> TraceService.current_trace_id", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "TraceService.__init__:dataflow_slice", - "span_start": 42, - "span_end": 81, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "3ea17138634b1190bded77ddb84aa1595124f6519b246f24fc4b02bd62b5cac1", - "edge_type": "dataflow_slice", - "src_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "src_qname": "TraceService.__init__", - "dst_symbol_id": "41135180f7b3b9ab20e097e0747474e219c37dd2366ef08a7b43c1f3edb10b4c", - "dst_ref": "TraceService.current_trace_id", - "resolution": "resolved", - "slice_id": "3ea17138634b1190bded77ddb84aa1595124f6519b246f24fc4b02bd62b5cac1", - "root_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "path_symbols": [ - "TraceService.__init__", - "TraceService.store", - "TraceService.current_trace_id" - ], - "path_symbol_ids": [ - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "41135180f7b3b9ab20e097e0747474e219c37dd2366ef08a7b43c1f3edb10b4c" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "TraceService.__init__\n -> TraceService.store\n -> TraceService.step", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "TraceService.__init__:dataflow_slice", - "span_start": 42, - "span_end": 88, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "9f34c5da9b09fba99df6f6b1bde183a9aeb45111b8218a747c71590c2c9f60f2", - "edge_type": "dataflow_slice", - "src_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "src_qname": "TraceService.__init__", - "dst_symbol_id": "c44bfbc66cf747283f30088da3e011a10395031d41e77b74e523c24997f641ca", - "dst_ref": "TraceService.step", - "resolution": "resolved", - "slice_id": "9f34c5da9b09fba99df6f6b1bde183a9aeb45111b8218a747c71590c2c9f60f2", - "root_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "path_symbols": [ - "TraceService.__init__", - "TraceService.store", - "TraceService.step" - ], - "path_symbol_ids": [ - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "c44bfbc66cf747283f30088da3e011a10395031d41e77b74e523c24997f641ca" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "class TraceRecordWriter:\n def __init__(self, transport: TraceTransport) -> None:\n self._logger = logging.getLogger(__name__)\n self._transport = transport\n\n def write_context(self, record: TraceContextRecord) -> None:\n try:\n self._transport.write_context(record)\n except Exception:\n self._logger.exception(\"Trace transport failed to write context %s\", record.trace_id)\n\n def write_message(self, record: TraceLogMessage) -> None:\n try:\n self._transport.write_message(record)\n except Exception:\n self._logger.exception(\"Trace transport failed to write message for %s\", record.trace_id)", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/tracing/service.py:TraceRecordWriter", - "span_start": 21, - "span_end": 36, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.tracing.service", - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "class TraceService(TraceContextFactory):\n def __init__(self, transport: TraceTransport | None = None, store: TraceContextStore | None = None) -> None:\n self.transport = transport or NoOpTraceTransport()\n self.store = store or TraceContextStore()\n self._writer = TraceRecordWriter(self.transport)\n\n def create_context(\n self,\n *,\n alias: str,\n parent_id: str | None = None,\n kind: str | None = None,\n attrs: dict[str, Any] | None = None,\n ) -> str:\n record = TraceContextRecord(\n trace_id=uuid4().hex,\n alias=str(alias or \"\"),\n parent_id=parent_id,\n type=kind,\n event_time=utc_now(),\n attrs=dict(attrs or {}),\n )\n self.store.push(record)\n self._writer.write_context(record)\n return record.trace_id\n\n @contextmanager\n def open_context(\n self,\n *,\n alias: str,\n parent_id: str | None = None,\n kind: str | None = None,\n attrs: dict[str, Any] | None = None,\n ) -> Iterator[str]:\n trace_id = self.create_context(alias=alias, parent_id=parent_id, kind=kind, attrs=attrs)\n try:\n yield trace_id\n finally:\n self.store.pop()\n\n def current_trace_id(self) -> str | None:\n return self.store.current_trace_id()\n\n def close_context(self) -> str | None:\n previous = self.store.pop()\n return previous.record.trace_id if previous else None\n\n def step(self, name: str) -> None:\n self.store.set_step(str(name or \"\"))\n\n def info(self, message: str, *, status: str | None = None, attrs: dict[str, Any] | None = None) -> None:\n self._write_message(\"INFO\", message, status, attrs)\n\n def debug(self, message: str, *, status: str | None = None, attrs: dict[str, Any] | None = None) -> None:\n self._write_message(\"DEBUG\", message, status, attrs)\n\n def warning(self, message: str, *, status: str | None = None, attrs: dict[str, Any] | None = None) -> None:\n self._write_message(\"WARNING\", message, status, attrs)\n\n def error(self, message: str, *, status: str | None = None, attrs: dict[str, Any] | None = None) -> None:\n self._write_message(\"ERROR\", message, status, attrs)\n\n def exception(self, message: str, *, status: str = \"failed\", attrs: dict[str, Any] | None = None) -> None:\n self._write_message(\"ERROR\", message, status, attrs)\n\n def new_root(self, operation: str) -> TraceContext:\n trace_id = self.create_context(alias=operation, kind=\"operation\", attrs={\"operation\": operation})\n return TraceContext(trace_id=trace_id, span_id=trace_id, attributes={\"operation\": operation})\n\n def child_of(self, parent: TraceContext, operation: str) -> TraceContext:\n trace_id = self.create_context(\n alias=operation,\n parent_id=parent.trace_id,\n kind=\"worker\",\n attrs={\"operation\": operation},\n )\n return TraceContext(\n trace_id=trace_id,\n span_id=trace_id,\n parent_span_id=parent.span_id,\n attributes={\"operation\": operation},\n )\n\n def attach(self, metadata: dict[str, object], context: TraceContext) -> dict[str, object]:\n updated = dict(metadata)\n updated[\"trace_id\"] = context.trace_id\n updated[\"span_id\"] = context.span_id\n updated[\"parent_span_id\"] = context.parent_span_id\n return updated\n\n def resume(self, metadata: dict[str, object], operation: str) -> TraceContext:\n trace_id = str(metadata.get(\"trace_id\") or uuid4().hex)\n span_id = str(metadata.get(\"span_id\") or trace_id)\n parent_id = metadata.get(\"parent_span_id\")\n self.create_context(\n alias=operation,\n parent_id=str(parent_id) if parent_id else None,\n kind=\"worker\",\n attrs=dict(metadata),\n )\n return TraceContext(\n trace_id=trace_id,\n span_id=span_id,\n parent_span_id=str(parent_id) if parent_id else None,\n attributes={\"operation\": operation},\n )\n\n def _write_message(\n self,\n level: TraceLevel,\n message: str,\n status: str | None,\n attrs: dict[str, Any] | None,\n ) -> None:\n active = self.store.current()\n if active is None:\n raise RuntimeError(\"Trace context is not bound. Call create_context() first.\")\n record = TraceLogMessage(\n trace_id=active.record.trace_id,\n step=active.step,\n status=str(status or \"\"),\n message=str(message or \"\"),\n level=level,\n event_time=utc_now(),\n attrs=dict(attrs or {}),\n )\n self._writer.write_message(record)", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/tracing/service.py:TraceService", - "span_start": 39, - "span_end": 166, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 1, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.tracing.service", - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "class TraceManager(TraceService):\n \"\"\"Compatibility alias during the transition from ConfigManager-shaped naming.\"\"\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/tracing/service.py:TraceManager", - "span_start": 169, - "span_end": 170, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 2, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.tracing.service", - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ] - }, - "diagnostics": { - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C0_SOURCE_CHUNKS": "exact_path_fetch", - "C4_SEMANTIC_ROLES": "exact_path_fetch", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C3_ENTRYPOINTS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 8, - "C4_SEMANTIC_ROLES": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C3_ENTRYPOINTS": 6 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C4_SEMANTIC_ROLES": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "TraceService", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Как работает TraceService?", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C4_SEMANTIC_ROLES", - "query": "Как работает TraceService?", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "Как работает TraceService?", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - }, - { - "layer": "C3_ENTRYPOINTS", - "query": "Как работает TraceService?", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 1, - "candidates_after_filter": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 6, - "candidates_after_filter": 6 - }, - { - "layer": "C3_ENTRYPOINTS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 3, - "candidates_after_filter": 3 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "TraceService", - "alternatives": [ - "TraceService" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 3, - "fail_reason": null - }, - { - "layer": "C4_SEMANTIC_ROLES", - "status": "hit", - "hit_count": 8, - "fail_reason": null - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 6, - "fail_reason": null - }, - { - "layer": "C3_ENTRYPOINTS", - "status": "hit", - "hit_count": 3, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "symbol_resolution": 0, - "retrieval_total": 89, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 18, - "C0_SOURCE_CHUNKS": 11, - "C4_SEMANTIC_ROLES": 10, - "C2_DEPENDENCY_GRAPH": 41, - "C3_ENTRYPOINTS": 8 - }, - "merge_rank": 15 - } - } - } - ] - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_router_rag/20260312_085312/router_rag_plba_code_retrieval_plba-rag-explain-trace-service.md b/tests/pipeline_setup_v2/test_results/plba_router_rag/20260312_085312/router_rag_plba_code_retrieval_plba-rag-explain-trace-service.md deleted file mode 100644 index 7e7f53f..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_router_rag/20260312_085312/router_rag_plba_code_retrieval_plba-rag-explain-trace-service.md +++ /dev/null @@ -1,34 +0,0 @@ -# plba-rag-explain-trace-service - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/router_rag_plba_code_retrieval.yaml -- runner: runtime -- mode: router_rag -- passed: True - -## Query -Как работает TraceService? - -## Actual -{ - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 21, - "llm_answer": "", - "answer_mode": "partial", - "path_scope": [], - "symbol_candidates": [ - "TraceService" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] -} - -## Mismatches -- none \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_router_rag/20260312_085312/router_rag_plba_code_retrieval_plba-rag-explain-workflow-engine.json b/tests/pipeline_setup_v2/test_results/plba_router_rag/20260312_085312/router_rag_plba_code_retrieval_plba-rag-explain-workflow-engine.json deleted file mode 100644 index 4c38fb6..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_router_rag/20260312_085312/router_rag_plba_code_retrieval_plba-rag-explain-workflow-engine.json +++ /dev/null @@ -1,2547 +0,0 @@ -{ - "case_id": "plba-rag-explain-workflow-engine", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/router_rag_plba_code_retrieval.yaml", - "runner": "runtime", - "mode": "router_rag", - "actual": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 20, - "llm_answer": "", - "answer_mode": "partial", - "path_scope": [], - "symbol_candidates": [ - "WorkflowEngine" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "passed": true, - "mismatches": [], - "details": { - "case_id": "plba-rag-explain-workflow-engine", - "text": "Объясни класс WorkflowEngine", - "mode": "router_rag", - "run_started_at": "2026-03-12T08:53:12", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Объясни класс WorkflowEngine", - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "WorkflowEngine", - "alternatives": [ - "WorkflowEngine", - "WorkflowEngineHooks" - ], - "confidence": 0.99 - }, - "rag_count": 20, - "rag_rows": [ - { - "path": "src/app_runtime/workflow/engine/workflow_engine.py", - "content": "class WorkflowEngine\nWorkflowEngine", - "layer": "C1_SYMBOL_CATALOG", - "title": "WorkflowEngine", - "span_start": 10, - "span_end": 86, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "57ec0a9f11c542c78e008684a888397e8d9ef4223671acb2567e631a0cbc70b4", - "qname": "WorkflowEngine", - "kind": "class", - "signature": "WorkflowEngine", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.workflow.engine.workflow_engine", - "is_test": false, - "blob_sha": "1057136e58a325cd5ab6f4e265d15665fb6a711b7022d9fab52a1a290afa2368", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/engine/hooks.py", - "content": "class WorkflowEngineHooks\nWorkflowEngineHooks", - "layer": "C1_SYMBOL_CATALOG", - "title": "WorkflowEngineHooks", - "span_start": 6, - "span_end": 14, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "914123ed510540061e116100fc87bba4195595ba696f8bfde2fd77ac6a5cd7e4", - "qname": "WorkflowEngineHooks", - "kind": "class", - "signature": "WorkflowEngineHooks", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.workflow.engine.hooks", - "is_test": false, - "blob_sha": "4b11672b0a9af1ae04bfce9d8e1f96572997d3e65e68108d7c797b88fa5fa47a", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/engine/workflow_engine.py", - "content": "WorkflowEngine\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (6)", - "layer": "C4_SEMANTIC_ROLES", - "title": "WorkflowEngine", - "span_start": 10, - "span_end": 86, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 25, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "57ec0a9f11c542c78e008684a888397e8d9ef4223671acb2567e631a0cbc70b4", - "symbol_name": "WorkflowEngine", - "qname": "WorkflowEngine", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 6, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "1057136e58a325cd5ab6f4e265d15665fb6a711b7022d9fab52a1a290afa2368", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/engine/hooks.py", - "content": "WorkflowEngineHooks\nrole: model\n\nResponsibilities:\n- default model role", - "layer": "C4_SEMANTIC_ROLES", - "title": "WorkflowEngineHooks", - "span_start": 6, - "span_end": 14, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 40, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "914123ed510540061e116100fc87bba4195595ba696f8bfde2fd77ac6a5cd7e4", - "symbol_name": "WorkflowEngineHooks", - "qname": "WorkflowEngineHooks", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "4b11672b0a9af1ae04bfce9d8e1f96572997d3e65e68108d7c797b88fa5fa47a", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/engine/transition_resolver.py", - "content": "TransitionResolver\nrole: model\n\nResponsibilities:\n- default model role", - "layer": "C4_SEMANTIC_ROLES", - "title": "TransitionResolver", - "span_start": 7, - "span_end": 9, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 40, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "d1979f0b23d354338debf7771373226833d57c1e7830ce66ca0b82cdf209b958", - "symbol_name": "TransitionResolver", - "qname": "TransitionResolver", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "2c518f4c77fb5dcc2970b88f55a7b121d05959578fb0d196af92ff5193574838", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_runner.py", - "content": "UvicornThreadRunner\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (24)", - "layer": "C4_SEMANTIC_ROLES", - "title": "UvicornThreadRunner", - "span_start": 10, - "span_end": 61, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 11, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "fd55630045a02100df8877ac27d951ee08617d4598764394d48cb51fe067476a", - "symbol_name": "UvicornThreadRunner", - "qname": "UvicornThreadRunner", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 24, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "3779fdd2878b770e789a35bb2a89c9d79f13b61c26d7db1b3b683f9bb9e1623f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/persistence/workflow_persistence.py", - "content": "WorkflowPersistence\nrole: pipeline_stage\n\nResponsibilities:\n- orchestrates role-like calls (2)\n- reads and writes state attributes\n- participates in dataflow slices (16)", - "layer": "C4_SEMANTIC_ROLES", - "title": "WorkflowPersistence", - "span_start": 8, - "span_end": 54, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 15, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "7bd01ee45cf31f2d5c2e3e51656254860ac785d10cef9e0852cd4fba90857bae", - "symbol_name": "WorkflowPersistence", - "qname": "WorkflowPersistence", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 16, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "80e9410ddc639789b4353c2a1a757ba8d0d5b5bb6075b0b263b61551f04ae1f0", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (10)", - "layer": "C4_SEMANTIC_ROLES", - "title": "HttpControlChannel", - "span_start": 12, - "span_end": 57, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 21, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "1c9fbdc24819e5604c26ea55428a74310f03a03e1af197ed84846af61e42fdb0", - "symbol_name": "HttpControlChannel", - "qname": "HttpControlChannel", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 10, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/queue/in_memory.py", - "content": "InMemoryTaskQueue\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (9)", - "layer": "C4_SEMANTIC_ROLES", - "title": "InMemoryTaskQueue", - "span_start": 9, - "span_end": 38, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 22, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "2da04cb94544a3bcbf0943a95ad4bdd8710bcafaa32a02fd0e4de2178dcf3533", - "symbol_name": "InMemoryTaskQueue", - "qname": "InMemoryTaskQueue", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 9, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "58f0cc001ccda0eee4c6bc32ed83bd05eafd6b6644f1e8b4aa9eed3103db73dc", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/config/file_loader.py", - "content": "ConfigFileLoader\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (8)", - "layer": "C4_SEMANTIC_ROLES", - "title": "ConfigFileLoader", - "span_start": 11, - "span_end": 48, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 23, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "a8474eca8b6e9dc86ae67ed68b16fa5fb639ef08739c053e7b7195489765667f", - "symbol_name": "ConfigFileLoader", - "qname": "ConfigFileLoader", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 8, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "1f19ffebde5e38e4be5a5d5a678059a0f36dedb8fb8b3e00ab395c67106a87ea", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/engine/workflow_engine.py", - "content": "WorkflowEngine.__init__\n -> WorkflowEngine._transition_resolver\n -> WorkflowEngine.run", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "WorkflowEngine.__init__:dataflow_slice", - "span_start": 14, - "span_end": 63, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "3abf07e5c245e0fe59785ba2d569c2ee56018715fc7f625a044ddaf6201f903d", - "edge_type": "dataflow_slice", - "src_symbol_id": "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "src_qname": "WorkflowEngine.__init__", - "dst_symbol_id": "a12cad0f5b238287e02f6d8d156cc764351d8c83246930487fa09d5ce6f2ace8", - "dst_ref": "WorkflowEngine.run", - "resolution": "resolved", - "slice_id": "3abf07e5c245e0fe59785ba2d569c2ee56018715fc7f625a044ddaf6201f903d", - "root_symbol_id": "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "path_symbols": [ - "WorkflowEngine.__init__", - "WorkflowEngine._transition_resolver", - "WorkflowEngine.run" - ], - "path_symbol_ids": [ - "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "a12cad0f5b238287e02f6d8d156cc764351d8c83246930487fa09d5ce6f2ace8" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "1057136e58a325cd5ab6f4e265d15665fb6a711b7022d9fab52a1a290afa2368", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/engine/workflow_engine.py", - "content": "WorkflowEngine.__init__\n -> WorkflowEngine._hooks\n -> WorkflowEngine.run", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "WorkflowEngine.__init__:dataflow_slice", - "span_start": 16, - "span_end": 34, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "d73db644b69c1eb35afd6eae9d6ac8674e49e30e9bcf9c020f9fdbfe754851b2", - "edge_type": "dataflow_slice", - "src_symbol_id": "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "src_qname": "WorkflowEngine.__init__", - "dst_symbol_id": "a12cad0f5b238287e02f6d8d156cc764351d8c83246930487fa09d5ce6f2ace8", - "dst_ref": "WorkflowEngine.run", - "resolution": "resolved", - "slice_id": "d73db644b69c1eb35afd6eae9d6ac8674e49e30e9bcf9c020f9fdbfe754851b2", - "root_symbol_id": "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "path_symbols": [ - "WorkflowEngine.__init__", - "WorkflowEngine._hooks", - "WorkflowEngine.run" - ], - "path_symbol_ids": [ - "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "a12cad0f5b238287e02f6d8d156cc764351d8c83246930487fa09d5ce6f2ace8" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "1057136e58a325cd5ab6f4e265d15665fb6a711b7022d9fab52a1a290afa2368", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/engine/workflow_engine.py", - "content": "WorkflowEngine.__init__\n -> WorkflowEngine._workflow\n -> WorkflowEngine.run", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "WorkflowEngine.__init__:dataflow_slice", - "span_start": 12, - "span_end": 29, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "b45ef3c54669b4910a8aed3a565804f275424a24007bc7e3c953389521f80249", - "edge_type": "dataflow_slice", - "src_symbol_id": "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "src_qname": "WorkflowEngine.__init__", - "dst_symbol_id": "a12cad0f5b238287e02f6d8d156cc764351d8c83246930487fa09d5ce6f2ace8", - "dst_ref": "WorkflowEngine.run", - "resolution": "resolved", - "slice_id": "b45ef3c54669b4910a8aed3a565804f275424a24007bc7e3c953389521f80249", - "root_symbol_id": "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "path_symbols": [ - "WorkflowEngine.__init__", - "WorkflowEngine._workflow", - "WorkflowEngine.run" - ], - "path_symbol_ids": [ - "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "a12cad0f5b238287e02f6d8d156cc764351d8c83246930487fa09d5ce6f2ace8" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "1057136e58a325cd5ab6f4e265d15665fb6a711b7022d9fab52a1a290afa2368", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/engine/workflow_engine.py", - "content": "WorkflowEngine.__init__\n -> WorkflowEngine._persistence\n -> WorkflowEngine.run", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "WorkflowEngine.__init__:dataflow_slice", - "span_start": 13, - "span_end": 20, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "8101338770016324ce05d61daa9935a444c75e6c94a0fae4275d5b50fcbcc70b", - "edge_type": "dataflow_slice", - "src_symbol_id": "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "src_qname": "WorkflowEngine.__init__", - "dst_symbol_id": "a12cad0f5b238287e02f6d8d156cc764351d8c83246930487fa09d5ce6f2ace8", - "dst_ref": "WorkflowEngine.run", - "resolution": "resolved", - "slice_id": "8101338770016324ce05d61daa9935a444c75e6c94a0fae4275d5b50fcbcc70b", - "root_symbol_id": "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "path_symbols": [ - "WorkflowEngine.__init__", - "WorkflowEngine._persistence", - "WorkflowEngine.run" - ], - "path_symbol_ids": [ - "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "a12cad0f5b238287e02f6d8d156cc764351d8c83246930487fa09d5ce6f2ace8" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "1057136e58a325cd5ab6f4e265d15665fb6a711b7022d9fab52a1a290afa2368", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/engine/workflow_engine.py", - "content": "WorkflowEngine.__init__\n -> WorkflowEngine._traces\n -> WorkflowEngine.run", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "WorkflowEngine.__init__:dataflow_slice", - "span_start": 15, - "span_end": 27, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "5006266616d534d721648391565e2ac0c9e7e9d9f8df00c17fba8989afb533a5", - "edge_type": "dataflow_slice", - "src_symbol_id": "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "src_qname": "WorkflowEngine.__init__", - "dst_symbol_id": "a12cad0f5b238287e02f6d8d156cc764351d8c83246930487fa09d5ce6f2ace8", - "dst_ref": "WorkflowEngine.run", - "resolution": "resolved", - "slice_id": "5006266616d534d721648391565e2ac0c9e7e9d9f8df00c17fba8989afb533a5", - "root_symbol_id": "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "path_symbols": [ - "WorkflowEngine.__init__", - "WorkflowEngine._traces", - "WorkflowEngine.run" - ], - "path_symbol_ids": [ - "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "a12cad0f5b238287e02f6d8d156cc764351d8c83246930487fa09d5ce6f2ace8" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "1057136e58a325cd5ab6f4e265d15665fb6a711b7022d9fab52a1a290afa2368", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/engine/workflow_engine.py", - "content": "WorkflowEngine.__init__\n -> WorkflowEngine._logger\n -> WorkflowEngine.run", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "WorkflowEngine.__init__:dataflow_slice", - "span_start": 17, - "span_end": 85, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "2f9927abb24794adb056b94bfb5d8538a5cbafb160da2079f52fca97fd694a2b", - "edge_type": "dataflow_slice", - "src_symbol_id": "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "src_qname": "WorkflowEngine.__init__", - "dst_symbol_id": "a12cad0f5b238287e02f6d8d156cc764351d8c83246930487fa09d5ce6f2ace8", - "dst_ref": "WorkflowEngine.run", - "resolution": "resolved", - "slice_id": "2f9927abb24794adb056b94bfb5d8538a5cbafb160da2079f52fca97fd694a2b", - "root_symbol_id": "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "path_symbols": [ - "WorkflowEngine.__init__", - "WorkflowEngine._logger", - "WorkflowEngine.run" - ], - "path_symbol_ids": [ - "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "a12cad0f5b238287e02f6d8d156cc764351d8c83246930487fa09d5ce6f2ace8" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "1057136e58a325cd5ab6f4e265d15665fb6a711b7022d9fab52a1a290afa2368", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/engine/workflow_engine.py", - "content": "class WorkflowEngine:\n def __init__(self, workflow, persistence, *, traces, hooks: WorkflowEngineHooks | None = None) -> None:\n self._workflow = workflow\n self._persistence = persistence\n self._transition_resolver = TransitionResolver()\n self._traces = traces\n self._hooks = hooks or WorkflowEngineHooks()\n self._logger = logging.getLogger(__name__)\n\n def run(self, context: WorkflowContext) -> dict[str, object]:\n run_id = self._persistence.start_run(\n self._workflow.definition.name,\n self._workflow.definition.start_at,\n context.snapshot(),\n )\n context.state.setdefault(\"runtime\", {})\n context.state[\"runtime\"][\"workflow_run_id\"] = run_id\n self._traces.step(\"workflow\")\n self._traces.info(\"Workflow started.\", status=\"started\", attrs={\"workflow_run_id\": run_id})\n current_name = self._workflow.definition.start_at\n while current_name is not None:\n node = self._workflow.definition.nodes[current_name]\n context.state[\"runtime\"][\"current_node\"] = current_name\n self._logger.info(\"Workflow run %s: step '%s' started.\", run_id, current_name)\n self._hooks.on_step_started(context, current_name)\n self._persistence.start_step(run_id, current_name, context.snapshot())\n self._traces.step(current_name)\n self._traces.debug(\n f\"Step '{current_name}' started.\",\n status=\"started\",\n attrs={\"workflow_run_id\": run_id, \"node\": current_name},\n )\n try:\n result = node.step.run(context)\n except Exception as error:\n self._persistence.fail_step(run_id, current_name, context.snapshot(), error)\n self._persistence.fail_run(run_id, context.snapshot())\n self._traces.error(\n f\"Step '{current_name}' failed: {error}\",\n status=\"failed\",\n attrs={\"exception_type\": type(error).__name__},\n )\n self._logger.exception(\"Workflow run %s: step '%s' failed.\", run_id, current_name)\n self._hooks.on_step_failed(context, current_name)\n raise\n context.state.update(result.updates)\n self._persistence.complete_step(\n run_id,\n current_name,\n result.status,\n result.transition,\n context.snapshot(),\n )\n next_node = self._transition_resolver.resolve(node, result)\n self._traces.debug(\n f\"Step '{current_name}' completed with transition '{result.transition}'.\",\n status=result.status,\n attrs={\n \"workflow_run_id\": run_id,\n \"from_node\": current_name,\n \"transition\": result.transition,\n \"to_node\": next_node,\n },\n )\n self._logger.info(\n \"Workflow run %s: step '%s' completed with transition '%s'.\",\n run_id,\n current_name,\n result.transition,\n )\n self._hooks.on_step_finished(context, current_name)\n current_name = next_node\n self._persistence.complete_run(run_id, context.snapshot())\n self._traces.step(\"workflow\")\n self._traces.info(\"Workflow completed.\", status=\"completed\", attrs={\"workflow_run_id\": run_id})\n self._logger.info(\"Workflow run %s completed.\", run_id)\n return {\"run_id\": run_id, \"status\": \"completed\", \"context\": context.snapshot()}", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/workflow/engine/workflow_engine.py:WorkflowEngine", - "span_start": 10, - "span_end": 86, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.workflow.engine.workflow_engine", - "is_test": false, - "blob_sha": "1057136e58a325cd5ab6f4e265d15665fb6a711b7022d9fab52a1a290afa2368", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "llm_answer": null, - "summary": { - "router": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "confidence": null - }, - "retrieval": { - "profile": "code", - "layers_hit": [ - "C0_SOURCE_CHUNKS", - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS", - "C4_SEMANTIC_ROLES" - ], - "evidence_sufficient": true - }, - "llm": { - "answer_status": "partial", - "groundedness": "not_applicable" - } - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "WorkflowEngine" - ], - "keyword_hints": [ - "WorkflowEngine" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C0_SOURCE_CHUNKS": "exact_path_fetch", - "C4_SEMANTIC_ROLES": "exact_path_fetch", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C3_ENTRYPOINTS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 8, - "C4_SEMANTIC_ROLES": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C3_ENTRYPOINTS": 6 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C4_SEMANTIC_ROLES": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "WorkflowEngine", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Объясни класс WorkflowEngine", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C4_SEMANTIC_ROLES", - "query": "Объясни класс WorkflowEngine", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "Объясни класс WorkflowEngine", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - }, - { - "layer": "C3_ENTRYPOINTS", - "query": "Объясни класс WorkflowEngine", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 2, - "candidates_after_filter": 2 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 6, - "candidates_after_filter": 6 - }, - { - "layer": "C3_ENTRYPOINTS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 3, - "candidates_after_filter": 3 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "WorkflowEngine", - "alternatives": [ - "WorkflowEngine", - "WorkflowEngineHooks" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "hit", - "hit_count": 2, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C4_SEMANTIC_ROLES", - "status": "hit", - "hit_count": 8, - "fail_reason": null - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 6, - "fail_reason": null - }, - { - "layer": "C3_ENTRYPOINTS", - "status": "hit", - "hit_count": 3, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "router": 0, - "symbol_resolution": 0, - "retrieval_total": 89, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 17, - "C0_SOURCE_CHUNKS": 10, - "C4_SEMANTIC_ROLES": 10, - "C2_DEPENDENCY_GRAPH": 42, - "C3_ENTRYPOINTS": 7 - }, - "merge_rank": 22, - "prompt_build": 0, - "llm_call": 0 - }, - "prompt": null, - "router": { - "conversation_mode": "START", - "keyword_hints": [ - "WorkflowEngine" - ], - "path_scope": [] - }, - "llm": { - "used_evidence_count": 20, - "missing_evidence_reason": null - } - }, - "run_info": { - "case_id": "plba-rag-explain-workflow-engine", - "mode": "router_rag", - "run_started_at": "2026-03-12T08:53:12", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - }, - "input_request": { - "text": "Объясни класс WorkflowEngine", - "normalized_query": "Объясни класс WorkflowEngine" - }, - "steps": [ - { - "step": "intent_router", - "input": { - "query": "Объясни класс WorkflowEngine" - }, - "output": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Объясни класс WorkflowEngine" - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "WorkflowEngine" - ], - "keyword_hints": [ - "WorkflowEngine" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "timings_ms": { - "router": 0 - } - } - }, - { - "step": "retrieval", - "input": { - "query": "Объясни класс WorkflowEngine" - }, - "output": { - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "WorkflowEngine", - "alternatives": [ - "WorkflowEngine", - "WorkflowEngineHooks" - ], - "confidence": 0.99 - }, - "rag_count": 20, - "rag_rows": [ - { - "path": "src/app_runtime/workflow/engine/workflow_engine.py", - "content": "class WorkflowEngine\nWorkflowEngine", - "layer": "C1_SYMBOL_CATALOG", - "title": "WorkflowEngine", - "span_start": 10, - "span_end": 86, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "57ec0a9f11c542c78e008684a888397e8d9ef4223671acb2567e631a0cbc70b4", - "qname": "WorkflowEngine", - "kind": "class", - "signature": "WorkflowEngine", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.workflow.engine.workflow_engine", - "is_test": false, - "blob_sha": "1057136e58a325cd5ab6f4e265d15665fb6a711b7022d9fab52a1a290afa2368", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/engine/hooks.py", - "content": "class WorkflowEngineHooks\nWorkflowEngineHooks", - "layer": "C1_SYMBOL_CATALOG", - "title": "WorkflowEngineHooks", - "span_start": 6, - "span_end": 14, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "914123ed510540061e116100fc87bba4195595ba696f8bfde2fd77ac6a5cd7e4", - "qname": "WorkflowEngineHooks", - "kind": "class", - "signature": "WorkflowEngineHooks", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.workflow.engine.hooks", - "is_test": false, - "blob_sha": "4b11672b0a9af1ae04bfce9d8e1f96572997d3e65e68108d7c797b88fa5fa47a", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/engine/workflow_engine.py", - "content": "WorkflowEngine\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (6)", - "layer": "C4_SEMANTIC_ROLES", - "title": "WorkflowEngine", - "span_start": 10, - "span_end": 86, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 25, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "57ec0a9f11c542c78e008684a888397e8d9ef4223671acb2567e631a0cbc70b4", - "symbol_name": "WorkflowEngine", - "qname": "WorkflowEngine", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 6, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "1057136e58a325cd5ab6f4e265d15665fb6a711b7022d9fab52a1a290afa2368", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/engine/hooks.py", - "content": "WorkflowEngineHooks\nrole: model\n\nResponsibilities:\n- default model role", - "layer": "C4_SEMANTIC_ROLES", - "title": "WorkflowEngineHooks", - "span_start": 6, - "span_end": 14, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 40, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "914123ed510540061e116100fc87bba4195595ba696f8bfde2fd77ac6a5cd7e4", - "symbol_name": "WorkflowEngineHooks", - "qname": "WorkflowEngineHooks", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "4b11672b0a9af1ae04bfce9d8e1f96572997d3e65e68108d7c797b88fa5fa47a", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/engine/transition_resolver.py", - "content": "TransitionResolver\nrole: model\n\nResponsibilities:\n- default model role", - "layer": "C4_SEMANTIC_ROLES", - "title": "TransitionResolver", - "span_start": 7, - "span_end": 9, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 40, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "d1979f0b23d354338debf7771373226833d57c1e7830ce66ca0b82cdf209b958", - "symbol_name": "TransitionResolver", - "qname": "TransitionResolver", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "2c518f4c77fb5dcc2970b88f55a7b121d05959578fb0d196af92ff5193574838", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_runner.py", - "content": "UvicornThreadRunner\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (24)", - "layer": "C4_SEMANTIC_ROLES", - "title": "UvicornThreadRunner", - "span_start": 10, - "span_end": 61, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 11, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "fd55630045a02100df8877ac27d951ee08617d4598764394d48cb51fe067476a", - "symbol_name": "UvicornThreadRunner", - "qname": "UvicornThreadRunner", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 24, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "3779fdd2878b770e789a35bb2a89c9d79f13b61c26d7db1b3b683f9bb9e1623f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/persistence/workflow_persistence.py", - "content": "WorkflowPersistence\nrole: pipeline_stage\n\nResponsibilities:\n- orchestrates role-like calls (2)\n- reads and writes state attributes\n- participates in dataflow slices (16)", - "layer": "C4_SEMANTIC_ROLES", - "title": "WorkflowPersistence", - "span_start": 8, - "span_end": 54, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 15, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "7bd01ee45cf31f2d5c2e3e51656254860ac785d10cef9e0852cd4fba90857bae", - "symbol_name": "WorkflowPersistence", - "qname": "WorkflowPersistence", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 16, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "80e9410ddc639789b4353c2a1a757ba8d0d5b5bb6075b0b263b61551f04ae1f0", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (10)", - "layer": "C4_SEMANTIC_ROLES", - "title": "HttpControlChannel", - "span_start": 12, - "span_end": 57, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 21, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "1c9fbdc24819e5604c26ea55428a74310f03a03e1af197ed84846af61e42fdb0", - "symbol_name": "HttpControlChannel", - "qname": "HttpControlChannel", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 10, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/queue/in_memory.py", - "content": "InMemoryTaskQueue\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (9)", - "layer": "C4_SEMANTIC_ROLES", - "title": "InMemoryTaskQueue", - "span_start": 9, - "span_end": 38, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 22, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "2da04cb94544a3bcbf0943a95ad4bdd8710bcafaa32a02fd0e4de2178dcf3533", - "symbol_name": "InMemoryTaskQueue", - "qname": "InMemoryTaskQueue", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 9, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "58f0cc001ccda0eee4c6bc32ed83bd05eafd6b6644f1e8b4aa9eed3103db73dc", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/config/file_loader.py", - "content": "ConfigFileLoader\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (8)", - "layer": "C4_SEMANTIC_ROLES", - "title": "ConfigFileLoader", - "span_start": 11, - "span_end": 48, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 23, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "a8474eca8b6e9dc86ae67ed68b16fa5fb639ef08739c053e7b7195489765667f", - "symbol_name": "ConfigFileLoader", - "qname": "ConfigFileLoader", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 8, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "1f19ffebde5e38e4be5a5d5a678059a0f36dedb8fb8b3e00ab395c67106a87ea", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/engine/workflow_engine.py", - "content": "WorkflowEngine.__init__\n -> WorkflowEngine._transition_resolver\n -> WorkflowEngine.run", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "WorkflowEngine.__init__:dataflow_slice", - "span_start": 14, - "span_end": 63, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "3abf07e5c245e0fe59785ba2d569c2ee56018715fc7f625a044ddaf6201f903d", - "edge_type": "dataflow_slice", - "src_symbol_id": "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "src_qname": "WorkflowEngine.__init__", - "dst_symbol_id": "a12cad0f5b238287e02f6d8d156cc764351d8c83246930487fa09d5ce6f2ace8", - "dst_ref": "WorkflowEngine.run", - "resolution": "resolved", - "slice_id": "3abf07e5c245e0fe59785ba2d569c2ee56018715fc7f625a044ddaf6201f903d", - "root_symbol_id": "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "path_symbols": [ - "WorkflowEngine.__init__", - "WorkflowEngine._transition_resolver", - "WorkflowEngine.run" - ], - "path_symbol_ids": [ - "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "a12cad0f5b238287e02f6d8d156cc764351d8c83246930487fa09d5ce6f2ace8" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "1057136e58a325cd5ab6f4e265d15665fb6a711b7022d9fab52a1a290afa2368", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/engine/workflow_engine.py", - "content": "WorkflowEngine.__init__\n -> WorkflowEngine._hooks\n -> WorkflowEngine.run", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "WorkflowEngine.__init__:dataflow_slice", - "span_start": 16, - "span_end": 34, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "d73db644b69c1eb35afd6eae9d6ac8674e49e30e9bcf9c020f9fdbfe754851b2", - "edge_type": "dataflow_slice", - "src_symbol_id": "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "src_qname": "WorkflowEngine.__init__", - "dst_symbol_id": "a12cad0f5b238287e02f6d8d156cc764351d8c83246930487fa09d5ce6f2ace8", - "dst_ref": "WorkflowEngine.run", - "resolution": "resolved", - "slice_id": "d73db644b69c1eb35afd6eae9d6ac8674e49e30e9bcf9c020f9fdbfe754851b2", - "root_symbol_id": "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "path_symbols": [ - "WorkflowEngine.__init__", - "WorkflowEngine._hooks", - "WorkflowEngine.run" - ], - "path_symbol_ids": [ - "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "a12cad0f5b238287e02f6d8d156cc764351d8c83246930487fa09d5ce6f2ace8" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "1057136e58a325cd5ab6f4e265d15665fb6a711b7022d9fab52a1a290afa2368", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/engine/workflow_engine.py", - "content": "WorkflowEngine.__init__\n -> WorkflowEngine._workflow\n -> WorkflowEngine.run", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "WorkflowEngine.__init__:dataflow_slice", - "span_start": 12, - "span_end": 29, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "b45ef3c54669b4910a8aed3a565804f275424a24007bc7e3c953389521f80249", - "edge_type": "dataflow_slice", - "src_symbol_id": "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "src_qname": "WorkflowEngine.__init__", - "dst_symbol_id": "a12cad0f5b238287e02f6d8d156cc764351d8c83246930487fa09d5ce6f2ace8", - "dst_ref": "WorkflowEngine.run", - "resolution": "resolved", - "slice_id": "b45ef3c54669b4910a8aed3a565804f275424a24007bc7e3c953389521f80249", - "root_symbol_id": "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "path_symbols": [ - "WorkflowEngine.__init__", - "WorkflowEngine._workflow", - "WorkflowEngine.run" - ], - "path_symbol_ids": [ - "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "a12cad0f5b238287e02f6d8d156cc764351d8c83246930487fa09d5ce6f2ace8" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "1057136e58a325cd5ab6f4e265d15665fb6a711b7022d9fab52a1a290afa2368", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/engine/workflow_engine.py", - "content": "WorkflowEngine.__init__\n -> WorkflowEngine._persistence\n -> WorkflowEngine.run", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "WorkflowEngine.__init__:dataflow_slice", - "span_start": 13, - "span_end": 20, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "8101338770016324ce05d61daa9935a444c75e6c94a0fae4275d5b50fcbcc70b", - "edge_type": "dataflow_slice", - "src_symbol_id": "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "src_qname": "WorkflowEngine.__init__", - "dst_symbol_id": "a12cad0f5b238287e02f6d8d156cc764351d8c83246930487fa09d5ce6f2ace8", - "dst_ref": "WorkflowEngine.run", - "resolution": "resolved", - "slice_id": "8101338770016324ce05d61daa9935a444c75e6c94a0fae4275d5b50fcbcc70b", - "root_symbol_id": "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "path_symbols": [ - "WorkflowEngine.__init__", - "WorkflowEngine._persistence", - "WorkflowEngine.run" - ], - "path_symbol_ids": [ - "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "a12cad0f5b238287e02f6d8d156cc764351d8c83246930487fa09d5ce6f2ace8" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "1057136e58a325cd5ab6f4e265d15665fb6a711b7022d9fab52a1a290afa2368", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/engine/workflow_engine.py", - "content": "WorkflowEngine.__init__\n -> WorkflowEngine._traces\n -> WorkflowEngine.run", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "WorkflowEngine.__init__:dataflow_slice", - "span_start": 15, - "span_end": 27, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "5006266616d534d721648391565e2ac0c9e7e9d9f8df00c17fba8989afb533a5", - "edge_type": "dataflow_slice", - "src_symbol_id": "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "src_qname": "WorkflowEngine.__init__", - "dst_symbol_id": "a12cad0f5b238287e02f6d8d156cc764351d8c83246930487fa09d5ce6f2ace8", - "dst_ref": "WorkflowEngine.run", - "resolution": "resolved", - "slice_id": "5006266616d534d721648391565e2ac0c9e7e9d9f8df00c17fba8989afb533a5", - "root_symbol_id": "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "path_symbols": [ - "WorkflowEngine.__init__", - "WorkflowEngine._traces", - "WorkflowEngine.run" - ], - "path_symbol_ids": [ - "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "a12cad0f5b238287e02f6d8d156cc764351d8c83246930487fa09d5ce6f2ace8" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "1057136e58a325cd5ab6f4e265d15665fb6a711b7022d9fab52a1a290afa2368", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/engine/workflow_engine.py", - "content": "WorkflowEngine.__init__\n -> WorkflowEngine._logger\n -> WorkflowEngine.run", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "WorkflowEngine.__init__:dataflow_slice", - "span_start": 17, - "span_end": 85, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "2f9927abb24794adb056b94bfb5d8538a5cbafb160da2079f52fca97fd694a2b", - "edge_type": "dataflow_slice", - "src_symbol_id": "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "src_qname": "WorkflowEngine.__init__", - "dst_symbol_id": "a12cad0f5b238287e02f6d8d156cc764351d8c83246930487fa09d5ce6f2ace8", - "dst_ref": "WorkflowEngine.run", - "resolution": "resolved", - "slice_id": "2f9927abb24794adb056b94bfb5d8538a5cbafb160da2079f52fca97fd694a2b", - "root_symbol_id": "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "path_symbols": [ - "WorkflowEngine.__init__", - "WorkflowEngine._logger", - "WorkflowEngine.run" - ], - "path_symbol_ids": [ - "41d117301feff3d6ba65af470b97a598ed548912942f094dc11a0706948550bd", - "a12cad0f5b238287e02f6d8d156cc764351d8c83246930487fa09d5ce6f2ace8" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "1057136e58a325cd5ab6f4e265d15665fb6a711b7022d9fab52a1a290afa2368", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/engine/workflow_engine.py", - "content": "class WorkflowEngine:\n def __init__(self, workflow, persistence, *, traces, hooks: WorkflowEngineHooks | None = None) -> None:\n self._workflow = workflow\n self._persistence = persistence\n self._transition_resolver = TransitionResolver()\n self._traces = traces\n self._hooks = hooks or WorkflowEngineHooks()\n self._logger = logging.getLogger(__name__)\n\n def run(self, context: WorkflowContext) -> dict[str, object]:\n run_id = self._persistence.start_run(\n self._workflow.definition.name,\n self._workflow.definition.start_at,\n context.snapshot(),\n )\n context.state.setdefault(\"runtime\", {})\n context.state[\"runtime\"][\"workflow_run_id\"] = run_id\n self._traces.step(\"workflow\")\n self._traces.info(\"Workflow started.\", status=\"started\", attrs={\"workflow_run_id\": run_id})\n current_name = self._workflow.definition.start_at\n while current_name is not None:\n node = self._workflow.definition.nodes[current_name]\n context.state[\"runtime\"][\"current_node\"] = current_name\n self._logger.info(\"Workflow run %s: step '%s' started.\", run_id, current_name)\n self._hooks.on_step_started(context, current_name)\n self._persistence.start_step(run_id, current_name, context.snapshot())\n self._traces.step(current_name)\n self._traces.debug(\n f\"Step '{current_name}' started.\",\n status=\"started\",\n attrs={\"workflow_run_id\": run_id, \"node\": current_name},\n )\n try:\n result = node.step.run(context)\n except Exception as error:\n self._persistence.fail_step(run_id, current_name, context.snapshot(), error)\n self._persistence.fail_run(run_id, context.snapshot())\n self._traces.error(\n f\"Step '{current_name}' failed: {error}\",\n status=\"failed\",\n attrs={\"exception_type\": type(error).__name__},\n )\n self._logger.exception(\"Workflow run %s: step '%s' failed.\", run_id, current_name)\n self._hooks.on_step_failed(context, current_name)\n raise\n context.state.update(result.updates)\n self._persistence.complete_step(\n run_id,\n current_name,\n result.status,\n result.transition,\n context.snapshot(),\n )\n next_node = self._transition_resolver.resolve(node, result)\n self._traces.debug(\n f\"Step '{current_name}' completed with transition '{result.transition}'.\",\n status=result.status,\n attrs={\n \"workflow_run_id\": run_id,\n \"from_node\": current_name,\n \"transition\": result.transition,\n \"to_node\": next_node,\n },\n )\n self._logger.info(\n \"Workflow run %s: step '%s' completed with transition '%s'.\",\n run_id,\n current_name,\n result.transition,\n )\n self._hooks.on_step_finished(context, current_name)\n current_name = next_node\n self._persistence.complete_run(run_id, context.snapshot())\n self._traces.step(\"workflow\")\n self._traces.info(\"Workflow completed.\", status=\"completed\", attrs={\"workflow_run_id\": run_id})\n self._logger.info(\"Workflow run %s completed.\", run_id)\n return {\"run_id\": run_id, \"status\": \"completed\", \"context\": context.snapshot()}", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/workflow/engine/workflow_engine.py:WorkflowEngine", - "span_start": 10, - "span_end": 86, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.workflow.engine.workflow_engine", - "is_test": false, - "blob_sha": "1057136e58a325cd5ab6f4e265d15665fb6a711b7022d9fab52a1a290afa2368", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ] - }, - "diagnostics": { - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C0_SOURCE_CHUNKS": "exact_path_fetch", - "C4_SEMANTIC_ROLES": "exact_path_fetch", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C3_ENTRYPOINTS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 8, - "C4_SEMANTIC_ROLES": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C3_ENTRYPOINTS": 6 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C4_SEMANTIC_ROLES": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "WorkflowEngine", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Объясни класс WorkflowEngine", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C4_SEMANTIC_ROLES", - "query": "Объясни класс WorkflowEngine", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "Объясни класс WorkflowEngine", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - }, - { - "layer": "C3_ENTRYPOINTS", - "query": "Объясни класс WorkflowEngine", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 2, - "candidates_after_filter": 2 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 6, - "candidates_after_filter": 6 - }, - { - "layer": "C3_ENTRYPOINTS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 3, - "candidates_after_filter": 3 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "WorkflowEngine", - "alternatives": [ - "WorkflowEngine", - "WorkflowEngineHooks" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "hit", - "hit_count": 2, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C4_SEMANTIC_ROLES", - "status": "hit", - "hit_count": 8, - "fail_reason": null - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 6, - "fail_reason": null - }, - { - "layer": "C3_ENTRYPOINTS", - "status": "hit", - "hit_count": 3, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "symbol_resolution": 0, - "retrieval_total": 89, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 17, - "C0_SOURCE_CHUNKS": 10, - "C4_SEMANTIC_ROLES": 10, - "C2_DEPENDENCY_GRAPH": 42, - "C3_ENTRYPOINTS": 7 - }, - "merge_rank": 22 - } - } - } - ] - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_router_rag/20260312_085312/router_rag_plba_code_retrieval_plba-rag-explain-workflow-engine.md b/tests/pipeline_setup_v2/test_results/plba_router_rag/20260312_085312/router_rag_plba_code_retrieval_plba-rag-explain-workflow-engine.md deleted file mode 100644 index 9c7003f..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_router_rag/20260312_085312/router_rag_plba_code_retrieval_plba-rag-explain-workflow-engine.md +++ /dev/null @@ -1,34 +0,0 @@ -# plba-rag-explain-workflow-engine - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/router_rag_plba_code_retrieval.yaml -- runner: runtime -- mode: router_rag -- passed: True - -## Query -Объясни класс WorkflowEngine - -## Actual -{ - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 20, - "llm_answer": "", - "answer_mode": "partial", - "path_scope": [], - "symbol_candidates": [ - "WorkflowEngine" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] -} - -## Mismatches -- none \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_router_rag/20260312_085312/router_rag_plba_code_retrieval_plba-rag-find-entrypoints.json b/tests/pipeline_setup_v2/test_results/plba_router_rag/20260312_085312/router_rag_plba_code_retrieval_plba-rag-find-entrypoints.json deleted file mode 100644 index d9546af..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_router_rag/20260312_085312/router_rag_plba_code_retrieval_plba-rag-find-entrypoints.json +++ /dev/null @@ -1,1139 +0,0 @@ -{ - "case_id": "plba-rag-find-entrypoints", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/router_rag_plba_code_retrieval.yaml", - "runner": "runtime", - "mode": "router_rag", - "actual": { - "intent": "CODE_QA", - "sub_intent": "FIND_ENTRYPOINTS", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 9, - "llm_answer": "", - "answer_mode": "partial", - "path_scope": [], - "symbol_candidates": [], - "layers": [ - "C3_ENTRYPOINTS", - "C0_SOURCE_CHUNKS" - ] - }, - "passed": true, - "mismatches": [], - "details": { - "case_id": "plba-rag-find-entrypoints", - "text": "Найди точки входа в коде", - "mode": "router_rag", - "run_started_at": "2026-03-12T08:53:12", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Найди точки входа в коде", - "symbol_resolution": { - "status": "not_requested", - "resolved_symbol": null, - "alternatives": [], - "confidence": 0.0 - }, - "rag_count": 9, - "rag_rows": [ - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/contracts/result.py", - "content": "class StepResult:\n transition: str = \"success\"\n updates: dict[str, Any] = field(default_factory=dict)\n status: str = \"completed\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/workflow/contracts/result.py:StepResult", - "span_start": 8, - "span_end": 11, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.workflow.contracts.result", - "is_test": false, - "blob_sha": "6e57dbfe22873f097f11228a26cffa415440a43b68a737b220906461cd86c353", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/config/__init__.py", - "content": "from app_runtime.config.file_loader import ConfigFileLoader\nfrom app_runtime.config.providers import FileConfigProvider\n\n__all__ = [\"ConfigFileLoader\", \"FileConfigProvider\"]", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/config/__init__.py:1-4", - "span_start": 1, - "span_end": 4, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.app_runtime.config.__init__", - "is_test": false, - "blob_sha": "612918029820a2a983330ec92256142b55b9de4bdf3399ece18e2a02dbad9729", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/__init__.py", - "content": "__all__: list[str] = []", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/__init__.py:1-1", - "span_start": 1, - "span_end": 1, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.app_runtime.__init__", - "is_test": false, - "blob_sha": "8eea9df4f6d7b38ca0e39ccc27b04700e3d08dbeec8046d613d22706d19985fa", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/config/file_loader.py", - "content": "class ConfigFileLoader:\n def __init__(self, path: str | Path) -> None:\n self.path = Path(path)\n self.config: Any = None\n self.last_valid_config: Any = None\n self._last_seen_hash: str | None = None\n\n def read_text(self) -> str:\n return self.path.read_text(encoding=\"utf-8\")\n\n def parse(self, data: str) -> Any:\n suffix = self.path.suffix.lower()\n if suffix in {\".yml\", \".yaml\"}:\n return yaml.safe_load(data)\n return json.loads(data)\n\n def load_sync(self) -> Any:\n data = self.read_text()\n parsed = self.parse(data)\n self.config = parsed\n self.last_valid_config = parsed\n self._last_seen_hash = self._calculate_hash(data)\n return parsed\n\n def load_if_changed(self) -> tuple[bool, Any]:\n data = self.read_text()\n current_hash = self._calculate_hash(data)\n if current_hash == self._last_seen_hash:\n return False, self.config\n parsed = self.parse(data)\n self.config = parsed\n self.last_valid_config = parsed\n self._last_seen_hash = current_hash\n return True, parsed\n\n @staticmethod\n def _calculate_hash(data: str) -> str:\n return hashlib.sha256(data.encode(\"utf-8\")).hexdigest()", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/config/file_loader.py:ConfigFileLoader", - "span_start": 11, - "span_end": 48, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.config.file_loader", - "is_test": false, - "blob_sha": "1f19ffebde5e38e4be5a5d5a678059a0f36dedb8fb8b3e00ab395c67106a87ea", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/config/providers.py", - "content": "class FileConfigProvider(ConfigProvider):\n def __init__(self, path: str | Path) -> None:\n self._loader = ConfigFileLoader(path)\n\n @property\n def loader(self) -> ConfigFileLoader:\n return self._loader\n\n def load(self) -> dict[str, Any]:\n config = self._loader.load_sync()\n if not isinstance(config, dict):\n raise TypeError(\"Config root must be a mapping\")\n return dict(config)", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/config/providers.py:FileConfigProvider", - "span_start": 10, - "span_end": 22, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.config.providers", - "is_test": false, - "blob_sha": "8c53ca0122d6df6c5763bca15e99434bb4daebd5a618b8fc927e9ae90b022e64", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "class ControlActionSet:\n health: HealthHandler\n start: ActionHandler\n stop: ActionHandler\n status: ActionHandler", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/base.py:ControlActionSet", - "span_start": 14, - "span_end": 18, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.base", - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "llm_answer": null, - "summary": { - "router": { - "intent": "CODE_QA", - "sub_intent": "FIND_ENTRYPOINTS", - "confidence": null - }, - "retrieval": { - "profile": "code", - "layers_hit": [ - "C0_SOURCE_CHUNKS", - "C3_ENTRYPOINTS" - ], - "evidence_sufficient": true - }, - "llm": { - "answer_status": "partial", - "groundedness": "not_applicable" - } - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "FIND_ENTRYPOINTS", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C3_ENTRYPOINTS", - "C0_SOURCE_CHUNKS" - ], - "symbol_kind_hint": "unknown", - "symbol_candidates": [], - "keyword_hints": [], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "execution": { - "executed_layers": [ - "C3_ENTRYPOINTS", - "C0_SOURCE_CHUNKS" - ], - "retrieval_mode_by_layer": { - "C3_ENTRYPOINTS": "exact_path_fetch", - "C0_SOURCE_CHUNKS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C3_ENTRYPOINTS": 12, - "C0_SOURCE_CHUNKS": 6 - }, - "filters_by_layer": { - "C3_ENTRYPOINTS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C3_ENTRYPOINTS", - "query": "Найди точки входа в коде", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 12, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Найди точки входа в коде", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C3_ENTRYPOINTS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 3, - "candidates_after_filter": 3 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 6, - "candidates_after_filter": 6 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "not_requested", - "resolved_symbol": null, - "alternatives": [] - }, - "layers": [ - { - "layer": "C3_ENTRYPOINTS", - "status": "hit", - "hit_count": 3, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 6, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "router": 0, - "symbol_resolution": 0, - "retrieval_total": 18, - "retrieval_by_layer": { - "C3_ENTRYPOINTS": 8, - "C0_SOURCE_CHUNKS": 10 - }, - "merge_rank": 0, - "prompt_build": 0, - "llm_call": 0 - }, - "prompt": null, - "router": { - "conversation_mode": "START", - "keyword_hints": [], - "path_scope": [] - }, - "llm": { - "used_evidence_count": 9, - "missing_evidence_reason": null - } - }, - "run_info": { - "case_id": "plba-rag-find-entrypoints", - "mode": "router_rag", - "run_started_at": "2026-03-12T08:53:12", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - }, - "input_request": { - "text": "Найди точки входа в коде", - "normalized_query": "Найди точки входа в коде" - }, - "steps": [ - { - "step": "intent_router", - "input": { - "query": "Найди точки входа в коде" - }, - "output": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Найди точки входа в коде" - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "FIND_ENTRYPOINTS", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C3_ENTRYPOINTS", - "C0_SOURCE_CHUNKS" - ], - "symbol_kind_hint": "unknown", - "symbol_candidates": [], - "keyword_hints": [], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "timings_ms": { - "router": 0 - } - } - }, - { - "step": "retrieval", - "input": { - "query": "Найди точки входа в коде" - }, - "output": { - "symbol_resolution": { - "status": "not_requested", - "resolved_symbol": null, - "alternatives": [], - "confidence": 0.0 - }, - "rag_count": 9, - "rag_rows": [ - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/contracts/result.py", - "content": "class StepResult:\n transition: str = \"success\"\n updates: dict[str, Any] = field(default_factory=dict)\n status: str = \"completed\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/workflow/contracts/result.py:StepResult", - "span_start": 8, - "span_end": 11, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.workflow.contracts.result", - "is_test": false, - "blob_sha": "6e57dbfe22873f097f11228a26cffa415440a43b68a737b220906461cd86c353", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/config/__init__.py", - "content": "from app_runtime.config.file_loader import ConfigFileLoader\nfrom app_runtime.config.providers import FileConfigProvider\n\n__all__ = [\"ConfigFileLoader\", \"FileConfigProvider\"]", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/config/__init__.py:1-4", - "span_start": 1, - "span_end": 4, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.app_runtime.config.__init__", - "is_test": false, - "blob_sha": "612918029820a2a983330ec92256142b55b9de4bdf3399ece18e2a02dbad9729", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/__init__.py", - "content": "__all__: list[str] = []", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/__init__.py:1-1", - "span_start": 1, - "span_end": 1, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.app_runtime.__init__", - "is_test": false, - "blob_sha": "8eea9df4f6d7b38ca0e39ccc27b04700e3d08dbeec8046d613d22706d19985fa", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/config/file_loader.py", - "content": "class ConfigFileLoader:\n def __init__(self, path: str | Path) -> None:\n self.path = Path(path)\n self.config: Any = None\n self.last_valid_config: Any = None\n self._last_seen_hash: str | None = None\n\n def read_text(self) -> str:\n return self.path.read_text(encoding=\"utf-8\")\n\n def parse(self, data: str) -> Any:\n suffix = self.path.suffix.lower()\n if suffix in {\".yml\", \".yaml\"}:\n return yaml.safe_load(data)\n return json.loads(data)\n\n def load_sync(self) -> Any:\n data = self.read_text()\n parsed = self.parse(data)\n self.config = parsed\n self.last_valid_config = parsed\n self._last_seen_hash = self._calculate_hash(data)\n return parsed\n\n def load_if_changed(self) -> tuple[bool, Any]:\n data = self.read_text()\n current_hash = self._calculate_hash(data)\n if current_hash == self._last_seen_hash:\n return False, self.config\n parsed = self.parse(data)\n self.config = parsed\n self.last_valid_config = parsed\n self._last_seen_hash = current_hash\n return True, parsed\n\n @staticmethod\n def _calculate_hash(data: str) -> str:\n return hashlib.sha256(data.encode(\"utf-8\")).hexdigest()", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/config/file_loader.py:ConfigFileLoader", - "span_start": 11, - "span_end": 48, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.config.file_loader", - "is_test": false, - "blob_sha": "1f19ffebde5e38e4be5a5d5a678059a0f36dedb8fb8b3e00ab395c67106a87ea", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/config/providers.py", - "content": "class FileConfigProvider(ConfigProvider):\n def __init__(self, path: str | Path) -> None:\n self._loader = ConfigFileLoader(path)\n\n @property\n def loader(self) -> ConfigFileLoader:\n return self._loader\n\n def load(self) -> dict[str, Any]:\n config = self._loader.load_sync()\n if not isinstance(config, dict):\n raise TypeError(\"Config root must be a mapping\")\n return dict(config)", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/config/providers.py:FileConfigProvider", - "span_start": 10, - "span_end": 22, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.config.providers", - "is_test": false, - "blob_sha": "8c53ca0122d6df6c5763bca15e99434bb4daebd5a618b8fc927e9ae90b022e64", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "class ControlActionSet:\n health: HealthHandler\n start: ActionHandler\n stop: ActionHandler\n status: ActionHandler", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/base.py:ControlActionSet", - "span_start": 14, - "span_end": 18, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.base", - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ] - }, - "diagnostics": { - "execution": { - "executed_layers": [ - "C3_ENTRYPOINTS", - "C0_SOURCE_CHUNKS" - ], - "retrieval_mode_by_layer": { - "C3_ENTRYPOINTS": "exact_path_fetch", - "C0_SOURCE_CHUNKS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C3_ENTRYPOINTS": 12, - "C0_SOURCE_CHUNKS": 6 - }, - "filters_by_layer": { - "C3_ENTRYPOINTS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C3_ENTRYPOINTS", - "query": "Найди точки входа в коде", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 12, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Найди точки входа в коде", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C3_ENTRYPOINTS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 3, - "candidates_after_filter": 3 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 6, - "candidates_after_filter": 6 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "not_requested", - "resolved_symbol": null, - "alternatives": [] - }, - "layers": [ - { - "layer": "C3_ENTRYPOINTS", - "status": "hit", - "hit_count": 3, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 6, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "symbol_resolution": 0, - "retrieval_total": 18, - "retrieval_by_layer": { - "C3_ENTRYPOINTS": 8, - "C0_SOURCE_CHUNKS": 10 - }, - "merge_rank": 0 - } - } - } - ] - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_router_rag/20260312_085312/router_rag_plba_code_retrieval_plba-rag-find-entrypoints.md b/tests/pipeline_setup_v2/test_results/plba_router_rag/20260312_085312/router_rag_plba_code_retrieval_plba-rag-find-entrypoints.md deleted file mode 100644 index fa2a4bb..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_router_rag/20260312_085312/router_rag_plba_code_retrieval_plba-rag-find-entrypoints.md +++ /dev/null @@ -1,29 +0,0 @@ -# plba-rag-find-entrypoints - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/router_rag_plba_code_retrieval.yaml -- runner: runtime -- mode: router_rag -- passed: True - -## Query -Найди точки входа в коде - -## Actual -{ - "intent": "CODE_QA", - "sub_intent": "FIND_ENTRYPOINTS", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 9, - "llm_answer": "", - "answer_mode": "partial", - "path_scope": [], - "symbol_candidates": [], - "layers": [ - "C3_ENTRYPOINTS", - "C0_SOURCE_CHUNKS" - ] -} - -## Mismatches -- none \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_router_rag/20260312_085312/router_rag_plba_code_retrieval_plba-rag-find-tests-http-control-channel.json b/tests/pipeline_setup_v2/test_results/plba_router_rag/20260312_085312/router_rag_plba_code_retrieval_plba-rag-find-tests-http-control-channel.json deleted file mode 100644 index 0054a69..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_router_rag/20260312_085312/router_rag_plba_code_retrieval_plba-rag-find-tests-http-control-channel.json +++ /dev/null @@ -1,1738 +0,0 @@ -{ - "case_id": "plba-rag-find-tests-http-control-channel", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/router_rag_plba_code_retrieval.yaml", - "runner": "runtime", - "mode": "router_rag", - "actual": { - "intent": "CODE_QA", - "sub_intent": "FIND_TESTS", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 16, - "llm_answer": "", - "answer_mode": "partial", - "path_scope": [], - "symbol_candidates": [ - "HttpControlChannel" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ] - }, - "passed": true, - "mismatches": [], - "details": { - "case_id": "plba-rag-find-tests-http-control-channel", - "text": "Найди тесты для HttpControlChannel", - "mode": "router_rag", - "run_started_at": "2026-03-12T08:53:12", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Найди тесты для HttpControlChannel", - "symbol_resolution": { - "status": "not_found", - "resolved_symbol": null, - "alternatives": [ - "HttpControlChannel" - ], - "confidence": 0.0 - }, - "rag_count": 16, - "rag_rows": [ - { - "path": "tests/test_runtime.py", - "content": "test_http_control_channel_exposes_health_and_actions reads_attr asyncio.run", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_http_control_channel_exposes_health_and_actions:reads_attr", - "span_start": 339, - "span_end": 339, - "lexical_rank": 4, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "8cc58b96c744ee7cf7d1a8ad7bb92a891a43107869065c004a1a3ce0dd490a6b", - "edge_type": "reads_attr", - "src_symbol_id": "a5f91bbdc86d497cf0b20a6c10caf97bee5148eae96d13c175399533be193291", - "src_qname": "test_http_control_channel_exposes_health_and_actions", - "dst_symbol_id": null, - "dst_ref": "asyncio.run", - "resolution": "partial", - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_runtime.py", - "content": "test_http_control_channel_exposes_health_and_actions calls channel.start", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_http_control_channel_exposes_health_and_actions:calls", - "span_start": 318, - "span_end": 325, - "lexical_rank": 4, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "3f96da44a1e918ac0c2bf7a4a847deced1acc5dfe285d888e8f5d1f6c1716c04", - "edge_type": "calls", - "src_symbol_id": "a5f91bbdc86d497cf0b20a6c10caf97bee5148eae96d13c175399533be193291", - "src_qname": "test_http_control_channel_exposes_health_and_actions", - "dst_symbol_id": null, - "dst_ref": "channel.start", - "resolution": "partial", - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_runtime.py", - "content": "test_http_control_channel_exposes_health_and_actions calls asyncio.run", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_http_control_channel_exposes_health_and_actions:calls", - "span_start": 339, - "span_end": 339, - "lexical_rank": 4, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "91fb36608973c49de1ebe925be4cfbf215788cbb472a85de8c749572fbc1348e", - "edge_type": "calls", - "src_symbol_id": "a5f91bbdc86d497cf0b20a6c10caf97bee5148eae96d13c175399533be193291", - "src_qname": "test_http_control_channel_exposes_health_and_actions", - "dst_symbol_id": null, - "dst_ref": "asyncio.run", - "resolution": "partial", - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_runtime.py", - "content": "test_http_control_channel_exposes_health_and_actions instantiates HttpControlChannel", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_http_control_channel_exposes_health_and_actions:instantiates", - "span_start": 317, - "span_end": 317, - "lexical_rank": 4, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "da9945affedec9dad344f9fede71b834f44c79992678439b144d0a10bcf52efa", - "edge_type": "instantiates", - "src_symbol_id": "a5f91bbdc86d497cf0b20a6c10caf97bee5148eae96d13c175399533be193291", - "src_qname": "test_http_control_channel_exposes_health_and_actions", - "dst_symbol_id": null, - "dst_ref": "HttpControlChannel", - "resolution": "partial", - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_runtime.py", - "content": "test_http_control_channel_exposes_health_and_actions calls scenario", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_http_control_channel_exposes_health_and_actions:calls", - "span_start": 339, - "span_end": 339, - "lexical_rank": 4, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "4820478ea2620cc3f71ba0143219550671279e5e0d642bd7fb2458259a9cf4fd", - "edge_type": "calls", - "src_symbol_id": "a5f91bbdc86d497cf0b20a6c10caf97bee5148eae96d13c175399533be193291", - "src_qname": "test_http_control_channel_exposes_health_and_actions", - "dst_symbol_id": null, - "dst_ref": "scenario", - "resolution": "partial", - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_runtime.py", - "content": "test_http_control_channel_exposes_health_and_actions calls channel._action_response", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_http_control_channel_exposes_health_and_actions:calls", - "span_start": 327, - "span_end": 327, - "lexical_rank": 4, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "1a5f8d1e30343961f5e934d1fd6c5f464d27dbd09ad89b9f3240d78f5cdea464", - "edge_type": "calls", - "src_symbol_id": "a5f91bbdc86d497cf0b20a6c10caf97bee5148eae96d13c175399533be193291", - "src_qname": "test_http_control_channel_exposes_health_and_actions", - "dst_symbol_id": null, - "dst_ref": "channel._action_response", - "resolution": "partial", - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "def _build_runtime(worker: Worker, *, control_timeout: int = 1) -> tuple[RuntimeManager, str]:\n runtime = RuntimeManager()\n channel = HttpControlChannel(host=\"127.0.0.1\", port=0, timeout=control_timeout)\n runtime.control_plane.register_channel(channel)\n runtime.register_module(WorkerModule(worker))\n runtime.start()\n return runtime, f\"http://127.0.0.1:{channel.port}\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:_build_runtime", - "span_start": 154, - "span_end": 160, - "lexical_rank": 5, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 6, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "def test_actions_start_stop_and_health_when_worker_is_idle() -> None:\n runtime, base_url = _build_runtime(ScenarioWorker(\"idle-worker\", IntervalRoutine(), interval=0.2))\n try:\n stop_status, stop_payload = _http_call_json(base_url, \"/actions/stop\", method=\"POST\")\n assert stop_status == 200\n assert isinstance(stop_payload.get(\"detail\"), dict)\n assert stop_payload[\"detail\"][\"timed_out\"] is False\n assert stop_payload[\"detail\"][\"state\"] == \"stopped\"\n\n health_stopped_status, health_stopped_payload = _http_call_json(base_url, \"/health\")\n assert health_stopped_status == 503\n assert health_stopped_payload[\"state\"] == \"stopped\"\n assert health_stopped_payload[\"status\"] == \"unhealthy\"\n\n start_status, start_payload = _http_call_json(base_url, \"/actions/start\", method=\"POST\")\n assert start_status == 200\n assert isinstance(start_payload.get(\"detail\"), dict)\n assert start_payload[\"detail\"][\"timed_out\"] is False\n assert start_payload[\"detail\"][\"state\"] in {\"idle\", \"busy\"}\n\n health_started_status, health_started_payload = _http_call_json(base_url, \"/health\")\n assert health_started_status == 200\n assert health_started_payload[\"status\"] == \"ok\"\n assert health_started_payload[\"state\"] in {\"idle\", \"busy\"}\n finally:\n runtime.stop()", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:test_actions_start_stop_and_health_when_worker_is_idle", - "span_start": 181, - "span_end": 206, - "lexical_rank": 5, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 8, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "class WorkerModule(ApplicationModule):\n def __init__(self, worker: Worker) -> None:\n self._worker = worker\n\n @property\n def name(self) -> str:\n return \"business-tests\"\n\n def register(self, registry: ModuleRegistry) -> None:\n registry.add_worker(self._worker)", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:WorkerModule", - "span_start": 113, - "span_end": 122, - "lexical_rank": 5, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 3, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "def _poll_until_stopped(base_url: str, timeout: float = 2.0) -> bool:\n deadline = monotonic() + timeout\n while monotonic() < deadline:\n _, payload = _http_call_json(base_url, \"/actions/status\")\n if payload.get(\"detail\") == \"stopped\":\n return True\n sleep(0.05)\n return False", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:_poll_until_stopped", - "span_start": 144, - "span_end": 151, - "lexical_rank": 5, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 5, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "class IntervalRoutine:\n calls: list[float] = field(default_factory=list)\n _lock: Lock = field(default_factory=Lock)\n\n def run(self) -> None:\n with self._lock:\n self.calls.append(monotonic())\n\n def wait_runs(self, count: int, timeout: float) -> bool:\n deadline = monotonic() + timeout\n while monotonic() < deadline:\n with self._lock:\n if len(self.calls) >= count:\n return True\n sleep(0.01)\n return False\n\n def deltas(self) -> list[float]:\n with self._lock:\n return [self.calls[index + 1] - self.calls[index] for index in range(len(self.calls) - 1)]", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:IntervalRoutine", - "span_start": 18, - "span_end": 37, - "lexical_rank": 5, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "def test_worker_wakes_up_with_configured_interval() -> None:\n interval = 0.15\n routine = IntervalRoutine()\n worker = ScenarioWorker(\"interval-worker\", routine, interval=interval)\n runtime = RuntimeManager()\n runtime.register_module(WorkerModule(worker))\n\n runtime.start()\n try:\n assert routine.wait_runs(count=3, timeout=2.0) is True\n finally:\n runtime.stop()\n\n deltas = routine.deltas()\n assert len(deltas) >= 2\n assert all(delta >= interval * 0.7 for delta in deltas[:2])", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:test_worker_wakes_up_with_configured_interval", - "span_start": 163, - "span_end": 178, - "lexical_rank": 5, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 7, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "class BlockingRoutine:\n def __init__(self, started: Event, release: Event) -> None:\n self._started = started\n self._release = release\n\n def run(self) -> None:\n self._started.set()\n self._release.wait(timeout=5.0)", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:BlockingRoutine", - "span_start": 40, - "span_end": 47, - "lexical_rank": 5, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 1, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "class ScenarioWorker(Worker):\n def __init__(self, name: str, routine: object, *, interval: float = 0.05) -> None:\n self._name = name\n self._routine = routine\n self._interval = interval\n self._thread: Thread | None = None\n self._stop_requested = Event()\n self._in_flight = 0\n self._runs = 0\n self._lock = Lock()\n\n @property\n def name(self) -> str:\n return self._name\n\n @property\n def critical(self) -> bool:\n return True\n\n def start(self) -> None:\n if self._thread is not None and self._thread.is_alive():\n return\n self._stop_requested.clear()\n self._thread = Thread(target=self._loop, name=f\"{self._name}-thread\", daemon=True)\n self._thread.start()\n\n def stop(self, force: bool = False) -> None:\n self._stop_requested.set()\n\n def health(self) -> WorkerHealth:\n return WorkerHealth(name=self.name, status=\"ok\", critical=True, meta={\"runs\": self._runs})\n\n def status(self) -> WorkerStatus:\n thread_alive = self._thread is not None and self._thread.is_alive()\n with self._lock:\n in_flight = self._in_flight\n runs = self._runs\n if not thread_alive:\n state = \"stopped\"\n elif self._stop_requested.is_set():\n state = \"stopping\"\n elif in_flight > 0:\n state = \"busy\"\n else:\n state = \"idle\"\n return WorkerStatus(name=self.name, state=state, in_flight=in_flight, meta={\"runs\": runs})\n\n def _loop(self) -> None:\n while not self._stop_requested.is_set():\n with self._lock:\n self._in_flight += 1\n try:\n self._routine.run()\n with self._lock:\n self._runs += 1\n finally:\n with self._lock:\n self._in_flight -= 1\n if self._stop_requested.is_set():\n return\n sleep(self._interval)", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:ScenarioWorker", - "span_start": 50, - "span_end": 110, - "lexical_rank": 5, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 2, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "def _http_call_json(\n base_url: str,\n path: str,\n *,\n method: str = \"GET\",\n headers: dict[str, str] | None = None,\n) -> tuple[int, dict[str, object]]:\n request = Request(f\"{base_url}{path}\", method=method, headers=headers or {})\n try:\n with urlopen(request, timeout=15.0) as response:\n status = response.status\n body = response.read()\n except HTTPError as error:\n status = error.code\n body = error.read()\n payload = json.loads(body.decode(\"utf-8\"))\n return status, payload", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:_http_call_json", - "span_start": 125, - "span_end": 141, - "lexical_rank": 5, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 4, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "def test_actions_stop_busy_worker_before_timeout() -> None:\n started = Event()\n release = Event()\n runtime, base_url = _build_runtime(ScenarioWorker(\"busy-worker\", BlockingRoutine(started, release)))\n assert started.wait(timeout=1.0) is True\n\n def release_later() -> None:\n sleep(0.2)\n release.set()\n\n Thread(target=release_later, daemon=True).start()\n try:\n status, payload = _http_call_json(base_url, \"/actions/stop\", method=\"POST\")\n assert status == 200\n assert isinstance(payload.get(\"detail\"), dict)\n assert payload[\"detail\"][\"timed_out\"] is False\n assert payload[\"detail\"][\"state\"] == \"stopped\"\n\n health_status, health_payload = _http_call_json(base_url, \"/health\")\n assert health_status == 503\n assert health_payload[\"status\"] == \"unhealthy\"\n assert health_payload[\"state\"] == \"stopped\"\n finally:\n runtime.stop()", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:test_actions_stop_busy_worker_before_timeout", - "span_start": 209, - "span_end": 232, - "lexical_rank": 5, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 9, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "llm_answer": null, - "summary": { - "router": { - "intent": "CODE_QA", - "sub_intent": "FIND_TESTS", - "confidence": null - }, - "retrieval": { - "profile": "code", - "layers_hit": [ - "C0_SOURCE_CHUNKS", - "C2_DEPENDENCY_GRAPH" - ], - "evidence_sufficient": true - }, - "llm": { - "answer_status": "partial", - "groundedness": "not_applicable" - } - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "FIND_TESTS", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "HttpControlChannel" - ], - "keyword_hints": [ - "HttpControlChannel" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**", - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "test_file_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "test_symbol_patterns": [ - "test_http_control_channel", - "TestHttpControlChannel", - "HttpControlChannel" - ], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C0_SOURCE_CHUNKS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C0_SOURCE_CHUNKS": 10 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [], - "include_globs": [ - "src", - "tests" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests" - ] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src", - "tests" - ], - "include_globs": [ - "src", - "tests" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests" - ] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src", - "tests" - ], - "include_globs": [ - "src", - "tests" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests" - ] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "HttpControlChannel", - "path_scope": [], - "include_globs": [ - "src/**", - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "Найди тесты для HttpControlChannel test_http_control_channel TestHttpControlChannel HttpControlChannel", - "path_scope": [], - "include_globs": [ - "src/**", - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "top_k": 6, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Найди тесты для HttpControlChannel test_http_control_channel TestHttpControlChannel HttpControlChannel", - "path_scope": [], - "include_globs": [ - "src/**", - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "top_k": 10, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [], - "normalized_include_globs": [ - "src", - "tests" - ], - "normalized_exclude_globs": [], - "normalized_prefer_globs": [ - "tests" - ], - "filter_stage": "post_rank", - "candidates_before_filter": 0, - "candidates_after_filter": 0 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src", - "tests" - ], - "normalized_include_globs": [ - "src", - "tests" - ], - "normalized_exclude_globs": [], - "normalized_prefer_globs": [ - "tests" - ], - "filter_stage": "post_rank", - "candidates_before_filter": 6, - "candidates_after_filter": 6 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src", - "tests" - ], - "normalized_include_globs": [ - "src", - "tests" - ], - "normalized_exclude_globs": [], - "normalized_prefer_globs": [ - "tests" - ], - "filter_stage": "post_rank", - "candidates_before_filter": 10, - "candidates_after_filter": 10 - } - ], - "fallback": { - "used": true, - "reason": "scope_relaxed_no_hits" - }, - "symbol_resolution": { - "status": "not_found", - "resolved_symbol": null, - "alternatives": [ - "HttpControlChannel" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "miss", - "hit_count": 0, - "fail_reason": "scope_relaxed_no_hits" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 6, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 10, - "fail_reason": null - } - ] - }, - "constraint_violations": [ - { - "type": "LAYER_MISSING", - "severity": "warn", - "details": { - "layer": "C1_SYMBOL_CATALOG", - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ] - }, - "suggested_fix": "Increase top_k for this layer or relax constraints for retrieval." - } - ], - "timings_ms": { - "router": 0, - "symbol_resolution": 0, - "retrieval_total": 92, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 33, - "C2_DEPENDENCY_GRAPH": 46, - "C0_SOURCE_CHUNKS": 12 - }, - "merge_rank": 0, - "prompt_build": 0, - "llm_call": 0 - }, - "prompt": null, - "router": { - "conversation_mode": "START", - "keyword_hints": [ - "HttpControlChannel" - ], - "path_scope": [] - }, - "llm": { - "used_evidence_count": 16, - "missing_evidence_reason": null - } - }, - "run_info": { - "case_id": "plba-rag-find-tests-http-control-channel", - "mode": "router_rag", - "run_started_at": "2026-03-12T08:53:12", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - }, - "input_request": { - "text": "Найди тесты для HttpControlChannel", - "normalized_query": "Найди тесты для HttpControlChannel" - }, - "steps": [ - { - "step": "intent_router", - "input": { - "query": "Найди тесты для HttpControlChannel" - }, - "output": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Найди тесты для HttpControlChannel" - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "FIND_TESTS", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "HttpControlChannel" - ], - "keyword_hints": [ - "HttpControlChannel" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**", - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "test_file_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "test_symbol_patterns": [ - "test_http_control_channel", - "TestHttpControlChannel", - "HttpControlChannel" - ], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "timings_ms": { - "router": 0 - } - } - }, - { - "step": "retrieval", - "input": { - "query": "Найди тесты для HttpControlChannel" - }, - "output": { - "symbol_resolution": { - "status": "not_found", - "resolved_symbol": null, - "alternatives": [ - "HttpControlChannel" - ], - "confidence": 0.0 - }, - "rag_count": 16, - "rag_rows": [ - { - "path": "tests/test_runtime.py", - "content": "test_http_control_channel_exposes_health_and_actions reads_attr asyncio.run", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_http_control_channel_exposes_health_and_actions:reads_attr", - "span_start": 339, - "span_end": 339, - "lexical_rank": 4, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "8cc58b96c744ee7cf7d1a8ad7bb92a891a43107869065c004a1a3ce0dd490a6b", - "edge_type": "reads_attr", - "src_symbol_id": "a5f91bbdc86d497cf0b20a6c10caf97bee5148eae96d13c175399533be193291", - "src_qname": "test_http_control_channel_exposes_health_and_actions", - "dst_symbol_id": null, - "dst_ref": "asyncio.run", - "resolution": "partial", - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_runtime.py", - "content": "test_http_control_channel_exposes_health_and_actions calls channel.start", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_http_control_channel_exposes_health_and_actions:calls", - "span_start": 318, - "span_end": 325, - "lexical_rank": 4, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "3f96da44a1e918ac0c2bf7a4a847deced1acc5dfe285d888e8f5d1f6c1716c04", - "edge_type": "calls", - "src_symbol_id": "a5f91bbdc86d497cf0b20a6c10caf97bee5148eae96d13c175399533be193291", - "src_qname": "test_http_control_channel_exposes_health_and_actions", - "dst_symbol_id": null, - "dst_ref": "channel.start", - "resolution": "partial", - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_runtime.py", - "content": "test_http_control_channel_exposes_health_and_actions calls asyncio.run", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_http_control_channel_exposes_health_and_actions:calls", - "span_start": 339, - "span_end": 339, - "lexical_rank": 4, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "91fb36608973c49de1ebe925be4cfbf215788cbb472a85de8c749572fbc1348e", - "edge_type": "calls", - "src_symbol_id": "a5f91bbdc86d497cf0b20a6c10caf97bee5148eae96d13c175399533be193291", - "src_qname": "test_http_control_channel_exposes_health_and_actions", - "dst_symbol_id": null, - "dst_ref": "asyncio.run", - "resolution": "partial", - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_runtime.py", - "content": "test_http_control_channel_exposes_health_and_actions instantiates HttpControlChannel", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_http_control_channel_exposes_health_and_actions:instantiates", - "span_start": 317, - "span_end": 317, - "lexical_rank": 4, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "da9945affedec9dad344f9fede71b834f44c79992678439b144d0a10bcf52efa", - "edge_type": "instantiates", - "src_symbol_id": "a5f91bbdc86d497cf0b20a6c10caf97bee5148eae96d13c175399533be193291", - "src_qname": "test_http_control_channel_exposes_health_and_actions", - "dst_symbol_id": null, - "dst_ref": "HttpControlChannel", - "resolution": "partial", - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_runtime.py", - "content": "test_http_control_channel_exposes_health_and_actions calls scenario", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_http_control_channel_exposes_health_and_actions:calls", - "span_start": 339, - "span_end": 339, - "lexical_rank": 4, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "4820478ea2620cc3f71ba0143219550671279e5e0d642bd7fb2458259a9cf4fd", - "edge_type": "calls", - "src_symbol_id": "a5f91bbdc86d497cf0b20a6c10caf97bee5148eae96d13c175399533be193291", - "src_qname": "test_http_control_channel_exposes_health_and_actions", - "dst_symbol_id": null, - "dst_ref": "scenario", - "resolution": "partial", - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_runtime.py", - "content": "test_http_control_channel_exposes_health_and_actions calls channel._action_response", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_http_control_channel_exposes_health_and_actions:calls", - "span_start": 327, - "span_end": 327, - "lexical_rank": 4, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "1a5f8d1e30343961f5e934d1fd6c5f464d27dbd09ad89b9f3240d78f5cdea464", - "edge_type": "calls", - "src_symbol_id": "a5f91bbdc86d497cf0b20a6c10caf97bee5148eae96d13c175399533be193291", - "src_qname": "test_http_control_channel_exposes_health_and_actions", - "dst_symbol_id": null, - "dst_ref": "channel._action_response", - "resolution": "partial", - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "def _build_runtime(worker: Worker, *, control_timeout: int = 1) -> tuple[RuntimeManager, str]:\n runtime = RuntimeManager()\n channel = HttpControlChannel(host=\"127.0.0.1\", port=0, timeout=control_timeout)\n runtime.control_plane.register_channel(channel)\n runtime.register_module(WorkerModule(worker))\n runtime.start()\n return runtime, f\"http://127.0.0.1:{channel.port}\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:_build_runtime", - "span_start": 154, - "span_end": 160, - "lexical_rank": 5, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 6, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "def test_actions_start_stop_and_health_when_worker_is_idle() -> None:\n runtime, base_url = _build_runtime(ScenarioWorker(\"idle-worker\", IntervalRoutine(), interval=0.2))\n try:\n stop_status, stop_payload = _http_call_json(base_url, \"/actions/stop\", method=\"POST\")\n assert stop_status == 200\n assert isinstance(stop_payload.get(\"detail\"), dict)\n assert stop_payload[\"detail\"][\"timed_out\"] is False\n assert stop_payload[\"detail\"][\"state\"] == \"stopped\"\n\n health_stopped_status, health_stopped_payload = _http_call_json(base_url, \"/health\")\n assert health_stopped_status == 503\n assert health_stopped_payload[\"state\"] == \"stopped\"\n assert health_stopped_payload[\"status\"] == \"unhealthy\"\n\n start_status, start_payload = _http_call_json(base_url, \"/actions/start\", method=\"POST\")\n assert start_status == 200\n assert isinstance(start_payload.get(\"detail\"), dict)\n assert start_payload[\"detail\"][\"timed_out\"] is False\n assert start_payload[\"detail\"][\"state\"] in {\"idle\", \"busy\"}\n\n health_started_status, health_started_payload = _http_call_json(base_url, \"/health\")\n assert health_started_status == 200\n assert health_started_payload[\"status\"] == \"ok\"\n assert health_started_payload[\"state\"] in {\"idle\", \"busy\"}\n finally:\n runtime.stop()", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:test_actions_start_stop_and_health_when_worker_is_idle", - "span_start": 181, - "span_end": 206, - "lexical_rank": 5, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 8, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "class WorkerModule(ApplicationModule):\n def __init__(self, worker: Worker) -> None:\n self._worker = worker\n\n @property\n def name(self) -> str:\n return \"business-tests\"\n\n def register(self, registry: ModuleRegistry) -> None:\n registry.add_worker(self._worker)", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:WorkerModule", - "span_start": 113, - "span_end": 122, - "lexical_rank": 5, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 3, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "def _poll_until_stopped(base_url: str, timeout: float = 2.0) -> bool:\n deadline = monotonic() + timeout\n while monotonic() < deadline:\n _, payload = _http_call_json(base_url, \"/actions/status\")\n if payload.get(\"detail\") == \"stopped\":\n return True\n sleep(0.05)\n return False", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:_poll_until_stopped", - "span_start": 144, - "span_end": 151, - "lexical_rank": 5, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 5, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "class IntervalRoutine:\n calls: list[float] = field(default_factory=list)\n _lock: Lock = field(default_factory=Lock)\n\n def run(self) -> None:\n with self._lock:\n self.calls.append(monotonic())\n\n def wait_runs(self, count: int, timeout: float) -> bool:\n deadline = monotonic() + timeout\n while monotonic() < deadline:\n with self._lock:\n if len(self.calls) >= count:\n return True\n sleep(0.01)\n return False\n\n def deltas(self) -> list[float]:\n with self._lock:\n return [self.calls[index + 1] - self.calls[index] for index in range(len(self.calls) - 1)]", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:IntervalRoutine", - "span_start": 18, - "span_end": 37, - "lexical_rank": 5, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "def test_worker_wakes_up_with_configured_interval() -> None:\n interval = 0.15\n routine = IntervalRoutine()\n worker = ScenarioWorker(\"interval-worker\", routine, interval=interval)\n runtime = RuntimeManager()\n runtime.register_module(WorkerModule(worker))\n\n runtime.start()\n try:\n assert routine.wait_runs(count=3, timeout=2.0) is True\n finally:\n runtime.stop()\n\n deltas = routine.deltas()\n assert len(deltas) >= 2\n assert all(delta >= interval * 0.7 for delta in deltas[:2])", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:test_worker_wakes_up_with_configured_interval", - "span_start": 163, - "span_end": 178, - "lexical_rank": 5, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 7, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "class BlockingRoutine:\n def __init__(self, started: Event, release: Event) -> None:\n self._started = started\n self._release = release\n\n def run(self) -> None:\n self._started.set()\n self._release.wait(timeout=5.0)", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:BlockingRoutine", - "span_start": 40, - "span_end": 47, - "lexical_rank": 5, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 1, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "class ScenarioWorker(Worker):\n def __init__(self, name: str, routine: object, *, interval: float = 0.05) -> None:\n self._name = name\n self._routine = routine\n self._interval = interval\n self._thread: Thread | None = None\n self._stop_requested = Event()\n self._in_flight = 0\n self._runs = 0\n self._lock = Lock()\n\n @property\n def name(self) -> str:\n return self._name\n\n @property\n def critical(self) -> bool:\n return True\n\n def start(self) -> None:\n if self._thread is not None and self._thread.is_alive():\n return\n self._stop_requested.clear()\n self._thread = Thread(target=self._loop, name=f\"{self._name}-thread\", daemon=True)\n self._thread.start()\n\n def stop(self, force: bool = False) -> None:\n self._stop_requested.set()\n\n def health(self) -> WorkerHealth:\n return WorkerHealth(name=self.name, status=\"ok\", critical=True, meta={\"runs\": self._runs})\n\n def status(self) -> WorkerStatus:\n thread_alive = self._thread is not None and self._thread.is_alive()\n with self._lock:\n in_flight = self._in_flight\n runs = self._runs\n if not thread_alive:\n state = \"stopped\"\n elif self._stop_requested.is_set():\n state = \"stopping\"\n elif in_flight > 0:\n state = \"busy\"\n else:\n state = \"idle\"\n return WorkerStatus(name=self.name, state=state, in_flight=in_flight, meta={\"runs\": runs})\n\n def _loop(self) -> None:\n while not self._stop_requested.is_set():\n with self._lock:\n self._in_flight += 1\n try:\n self._routine.run()\n with self._lock:\n self._runs += 1\n finally:\n with self._lock:\n self._in_flight -= 1\n if self._stop_requested.is_set():\n return\n sleep(self._interval)", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:ScenarioWorker", - "span_start": 50, - "span_end": 110, - "lexical_rank": 5, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 2, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "def _http_call_json(\n base_url: str,\n path: str,\n *,\n method: str = \"GET\",\n headers: dict[str, str] | None = None,\n) -> tuple[int, dict[str, object]]:\n request = Request(f\"{base_url}{path}\", method=method, headers=headers or {})\n try:\n with urlopen(request, timeout=15.0) as response:\n status = response.status\n body = response.read()\n except HTTPError as error:\n status = error.code\n body = error.read()\n payload = json.loads(body.decode(\"utf-8\"))\n return status, payload", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:_http_call_json", - "span_start": 125, - "span_end": 141, - "lexical_rank": 5, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 4, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "def test_actions_stop_busy_worker_before_timeout() -> None:\n started = Event()\n release = Event()\n runtime, base_url = _build_runtime(ScenarioWorker(\"busy-worker\", BlockingRoutine(started, release)))\n assert started.wait(timeout=1.0) is True\n\n def release_later() -> None:\n sleep(0.2)\n release.set()\n\n Thread(target=release_later, daemon=True).start()\n try:\n status, payload = _http_call_json(base_url, \"/actions/stop\", method=\"POST\")\n assert status == 200\n assert isinstance(payload.get(\"detail\"), dict)\n assert payload[\"detail\"][\"timed_out\"] is False\n assert payload[\"detail\"][\"state\"] == \"stopped\"\n\n health_status, health_payload = _http_call_json(base_url, \"/health\")\n assert health_status == 503\n assert health_payload[\"status\"] == \"unhealthy\"\n assert health_payload[\"state\"] == \"stopped\"\n finally:\n runtime.stop()", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:test_actions_stop_busy_worker_before_timeout", - "span_start": 209, - "span_end": 232, - "lexical_rank": 5, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 9, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ] - }, - "diagnostics": { - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C0_SOURCE_CHUNKS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C0_SOURCE_CHUNKS": 10 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [], - "include_globs": [ - "src", - "tests" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests" - ] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src", - "tests" - ], - "include_globs": [ - "src", - "tests" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests" - ] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src", - "tests" - ], - "include_globs": [ - "src", - "tests" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests" - ] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "HttpControlChannel", - "path_scope": [], - "include_globs": [ - "src/**", - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "Найди тесты для HttpControlChannel test_http_control_channel TestHttpControlChannel HttpControlChannel", - "path_scope": [], - "include_globs": [ - "src/**", - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "top_k": 6, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Найди тесты для HttpControlChannel test_http_control_channel TestHttpControlChannel HttpControlChannel", - "path_scope": [], - "include_globs": [ - "src/**", - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "top_k": 10, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [], - "normalized_include_globs": [ - "src", - "tests" - ], - "normalized_exclude_globs": [], - "normalized_prefer_globs": [ - "tests" - ], - "filter_stage": "post_rank", - "candidates_before_filter": 0, - "candidates_after_filter": 0 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src", - "tests" - ], - "normalized_include_globs": [ - "src", - "tests" - ], - "normalized_exclude_globs": [], - "normalized_prefer_globs": [ - "tests" - ], - "filter_stage": "post_rank", - "candidates_before_filter": 6, - "candidates_after_filter": 6 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src", - "tests" - ], - "normalized_include_globs": [ - "src", - "tests" - ], - "normalized_exclude_globs": [], - "normalized_prefer_globs": [ - "tests" - ], - "filter_stage": "post_rank", - "candidates_before_filter": 10, - "candidates_after_filter": 10 - } - ], - "fallback": { - "used": true, - "reason": "scope_relaxed_no_hits" - }, - "symbol_resolution": { - "status": "not_found", - "resolved_symbol": null, - "alternatives": [ - "HttpControlChannel" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "miss", - "hit_count": 0, - "fail_reason": "scope_relaxed_no_hits" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 6, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 10, - "fail_reason": null - } - ] - }, - "constraint_violations": [ - { - "type": "LAYER_MISSING", - "severity": "warn", - "details": { - "layer": "C1_SYMBOL_CATALOG", - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ] - }, - "suggested_fix": "Increase top_k for this layer or relax constraints for retrieval." - } - ], - "timings_ms": { - "symbol_resolution": 0, - "retrieval_total": 92, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 33, - "C2_DEPENDENCY_GRAPH": 46, - "C0_SOURCE_CHUNKS": 12 - }, - "merge_rank": 0 - } - } - } - ] - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_router_rag/20260312_085312/router_rag_plba_code_retrieval_plba-rag-find-tests-http-control-channel.md b/tests/pipeline_setup_v2/test_results/plba_router_rag/20260312_085312/router_rag_plba_code_retrieval_plba-rag-find-tests-http-control-channel.md deleted file mode 100644 index 0d90aff..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_router_rag/20260312_085312/router_rag_plba_code_retrieval_plba-rag-find-tests-http-control-channel.md +++ /dev/null @@ -1,32 +0,0 @@ -# plba-rag-find-tests-http-control-channel - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/router_rag_plba_code_retrieval.yaml -- runner: runtime -- mode: router_rag -- passed: True - -## Query -Найди тесты для HttpControlChannel - -## Actual -{ - "intent": "CODE_QA", - "sub_intent": "FIND_TESTS", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 16, - "llm_answer": "", - "answer_mode": "partial", - "path_scope": [], - "symbol_candidates": [ - "HttpControlChannel" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ] -} - -## Mismatches -- none \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_router_rag/20260312_085312/router_rag_plba_code_retrieval_plba-rag-find-tests-runtime-manager.json b/tests/pipeline_setup_v2/test_results/plba_router_rag/20260312_085312/router_rag_plba_code_retrieval_plba-rag-find-tests-runtime-manager.json deleted file mode 100644 index 8417303..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_router_rag/20260312_085312/router_rag_plba_code_retrieval_plba-rag-find-tests-runtime-manager.json +++ /dev/null @@ -1,1822 +0,0 @@ -{ - "case_id": "plba-rag-find-tests-runtime-manager", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/router_rag_plba_code_retrieval.yaml", - "runner": "runtime", - "mode": "router_rag", - "actual": { - "intent": "CODE_QA", - "sub_intent": "FIND_TESTS", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 16, - "llm_answer": "", - "answer_mode": "partial", - "path_scope": [], - "symbol_candidates": [ - "RuntimeManager" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ] - }, - "passed": true, - "mismatches": [], - "details": { - "case_id": "plba-rag-find-tests-runtime-manager", - "text": "Где тесты для RuntimeManager?", - "mode": "router_rag", - "run_started_at": "2026-03-12T08:53:12", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Где тесты для RuntimeManager?", - "symbol_resolution": { - "status": "not_found", - "resolved_symbol": null, - "alternatives": [ - "RuntimeManager" - ], - "confidence": 0.0 - }, - "rag_count": 16, - "rag_rows": [ - { - "path": "tests/test_runtime.py", - "content": "test_runtime_runs_worker_routine_and_exposes_status instantiates RuntimeManager", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_runtime_runs_worker_routine_and_exposes_status:instantiates", - "span_start": 209, - "span_end": 209, - "lexical_rank": 6, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "c397a308e7824ba9fe400a754c7e15e66ea6f058d7f5d3e82bb002bb78b509d2", - "edge_type": "instantiates", - "src_symbol_id": "1c767eb5ee08e84f45b18c8ed7531ec0ed73c63fb1594823569672db7b21e992", - "src_qname": "test_runtime_runs_worker_routine_and_exposes_status", - "dst_symbol_id": "aeadc039653807b0da1ca6e3cc1078ee61cfc510b28e7f9c2ec04c59da43cc8d", - "dst_ref": "RuntimeManager", - "resolution": "resolved", - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_runtime.py", - "content": "test_runtime_graceful_stop_waits_until_worker_finishes instantiates RuntimeManager", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_runtime_graceful_stop_waits_until_worker_finishes:instantiates", - "span_start": 229, - "span_end": 229, - "lexical_rank": 6, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "76b4701262ccaa0a7a41691407c4ebdb2ca74a2415d89f0a38ef0d4f608bda93", - "edge_type": "instantiates", - "src_symbol_id": "1076e788e4a03b10d7bc1313a8ad46caa170c13cc026c6e4de994af1a6ae57bf", - "src_qname": "test_runtime_graceful_stop_waits_until_worker_finishes", - "dst_symbol_id": "aeadc039653807b0da1ca6e3cc1078ee61cfc510b28e7f9c2ec04c59da43cc8d", - "dst_ref": "RuntimeManager", - "resolution": "resolved", - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "_build_runtime instantiates RuntimeManager", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "_build_runtime:instantiates", - "span_start": 155, - "span_end": 155, - "lexical_rank": 6, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "7eb254d564944bab6272757ee5ef688862bd321e6941e2495dc942e03b1c9a25", - "edge_type": "instantiates", - "src_symbol_id": "db94031d5245bf82be836a109b4584b43b8e83d37a0f318e03f6c8191896d469", - "src_qname": "_build_runtime", - "dst_symbol_id": "a1572ea8183dc0cd6ddbc74342bbde8c28cecfde37ad40b62feff09f8d103d11", - "dst_ref": "RuntimeManager", - "resolution": "resolved", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "test_worker_wakes_up_with_configured_interval instantiates RuntimeManager", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_worker_wakes_up_with_configured_interval:instantiates", - "span_start": 167, - "span_end": 167, - "lexical_rank": 6, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "189aafc4de0b79c688668f25f0c87166a127df26bd2215452014713b65ef281a", - "edge_type": "instantiates", - "src_symbol_id": "65f877f78191d65e6a752e41cedc70ebc784c266804a55c1c56440336e1f0d6e", - "src_qname": "test_worker_wakes_up_with_configured_interval", - "dst_symbol_id": "a1572ea8183dc0cd6ddbc74342bbde8c28cecfde37ad40b62feff09f8d103d11", - "dst_ref": "RuntimeManager", - "resolution": "resolved", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "test_actions_stop_busy_worker_after_timeout\n -> BlockingRoutine\n -> BlockingRoutine.__init__\n -> BlockingRoutine._started\n -> BlockingRoutine.run", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_actions_stop_busy_worker_after_timeout:dataflow_slice", - "span_start": 42, - "span_end": 238, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 5, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "8e7db3d2a9226f1c1d9942ac6373cfcafa0d2276758ddb8a3d3c455a3d58024d", - "edge_type": "dataflow_slice", - "src_symbol_id": "66392d3222421d9ba16eda3554940b16e7d5a6f33aa08c5738d35af2e32f1e4a", - "src_qname": "test_actions_stop_busy_worker_after_timeout", - "dst_symbol_id": "d9841bdbb69706c988ae7ae6adf89928dc4fae45943f74064f5382177034ba04", - "dst_ref": "BlockingRoutine.run", - "resolution": "resolved", - "slice_id": "8e7db3d2a9226f1c1d9942ac6373cfcafa0d2276758ddb8a3d3c455a3d58024d", - "root_symbol_id": "66392d3222421d9ba16eda3554940b16e7d5a6f33aa08c5738d35af2e32f1e4a", - "path_symbols": [ - "test_actions_stop_busy_worker_after_timeout", - "BlockingRoutine", - "BlockingRoutine.__init__", - "BlockingRoutine._started", - "BlockingRoutine.run" - ], - "path_symbol_ids": [ - "66392d3222421d9ba16eda3554940b16e7d5a6f33aa08c5738d35af2e32f1e4a", - "a3349c5bc65e4003a4bbd6a8dbb7a54c337e12d1aed930caa701b12e520f1e67", - "486deeed3043c6db985aef258e96ddc67aa53608e67a83962fbd2471f649ddf1", - "d9841bdbb69706c988ae7ae6adf89928dc4fae45943f74064f5382177034ba04" - ], - "path_edge_types": [ - "instantiates", - "writes_attr", - "reads_attr" - ], - "path_length": 5, - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "test_actions_stop_busy_worker_before_timeout\n -> BlockingRoutine\n -> BlockingRoutine.__init__\n -> BlockingRoutine._release\n -> BlockingRoutine.run", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_actions_stop_busy_worker_before_timeout:dataflow_slice", - "span_start": 43, - "span_end": 212, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 5, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "8bd726155ba387d3579763ee84dfd2f9a90bc917da88f3b2e89416ab5c1254d6", - "edge_type": "dataflow_slice", - "src_symbol_id": "a0bb116ca9d909c93a285667ae033fbd1859b2dad7cf34fcb44816393ef6909c", - "src_qname": "test_actions_stop_busy_worker_before_timeout", - "dst_symbol_id": "d9841bdbb69706c988ae7ae6adf89928dc4fae45943f74064f5382177034ba04", - "dst_ref": "BlockingRoutine.run", - "resolution": "resolved", - "slice_id": "8bd726155ba387d3579763ee84dfd2f9a90bc917da88f3b2e89416ab5c1254d6", - "root_symbol_id": "a0bb116ca9d909c93a285667ae033fbd1859b2dad7cf34fcb44816393ef6909c", - "path_symbols": [ - "test_actions_stop_busy_worker_before_timeout", - "BlockingRoutine", - "BlockingRoutine.__init__", - "BlockingRoutine._release", - "BlockingRoutine.run" - ], - "path_symbol_ids": [ - "a0bb116ca9d909c93a285667ae033fbd1859b2dad7cf34fcb44816393ef6909c", - "a3349c5bc65e4003a4bbd6a8dbb7a54c337e12d1aed930caa701b12e520f1e67", - "486deeed3043c6db985aef258e96ddc67aa53608e67a83962fbd2471f649ddf1", - "d9841bdbb69706c988ae7ae6adf89928dc4fae45943f74064f5382177034ba04" - ], - "path_edge_types": [ - "instantiates", - "writes_attr", - "reads_attr" - ], - "path_length": 5, - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_runtime.py", - "content": "def test_runtime_graceful_stop_waits_until_worker_finishes() -> None:\n started = Event()\n release = Event()\n runtime = RuntimeManager()\n runtime.register_module(BlockingModule(started, release))\n runtime.start()\n assert started.wait(timeout=1.0) is True\n assert runtime.status()[\"runtime\"][\"state\"] == \"busy\"\n\n stop_thread = Thread(target=runtime.stop, kwargs={\"timeout\": 1.0}, daemon=True)\n stop_thread.start()\n sleep(0.1)\n assert stop_thread.is_alive() is True\n\n release.set()\n stop_thread.join(timeout=1.0)\n assert stop_thread.is_alive() is False\n assert runtime.status()[\"runtime\"][\"state\"] == \"stopped\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_runtime.py:test_runtime_graceful_stop_waits_until_worker_finishes", - "span_start": 226, - "span_end": 243, - "lexical_rank": 6, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 8, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_runtime", - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_runtime.py", - "content": "def test_runtime_runs_worker_routine_and_exposes_status(tmp_path) -> None:\n config_path = tmp_path / \"config.yml\"\n config_path.write_text(\n \"\"\"\nplatform:\n workers: 1\nlog:\n version: 1\n disable_existing_loggers: false\n handlers:\n console:\n class: logging.StreamHandler\n root:\n level: INFO\n handlers: [console]\n\"\"\".strip(),\n encoding=\"utf-8\",\n )\n runtime = RuntimeManager()\n runtime.add_config_file(config_path)\n module = ExampleModule()\n runtime.register_module(module)\n\n runtime.start()\n sleep(0.2)\n status = runtime.status()\n runtime.stop()\n\n assert module.routine.processed == [{\"id\": 1}]\n assert status[\"modules\"] == [\"example\"]\n assert status[\"runtime\"][\"state\"] == \"idle\"\n assert status[\"health\"][\"status\"] == \"ok\"\n assert status[\"config\"] == {\"platform\": {\"workers\": 1}, \"log\": status[\"config\"][\"log\"]}", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_runtime.py:test_runtime_runs_worker_routine_and_exposes_status", - "span_start": 191, - "span_end": 223, - "lexical_rank": 6, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 7, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_runtime", - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "def _build_runtime(worker: Worker, *, control_timeout: int = 1) -> tuple[RuntimeManager, str]:\n runtime = RuntimeManager()\n channel = HttpControlChannel(host=\"127.0.0.1\", port=0, timeout=control_timeout)\n runtime.control_plane.register_channel(channel)\n runtime.register_module(WorkerModule(worker))\n runtime.start()\n return runtime, f\"http://127.0.0.1:{channel.port}\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:_build_runtime", - "span_start": 154, - "span_end": 160, - "lexical_rank": 6, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 6, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "def test_worker_wakes_up_with_configured_interval() -> None:\n interval = 0.15\n routine = IntervalRoutine()\n worker = ScenarioWorker(\"interval-worker\", routine, interval=interval)\n runtime = RuntimeManager()\n runtime.register_module(WorkerModule(worker))\n\n runtime.start()\n try:\n assert routine.wait_runs(count=3, timeout=2.0) is True\n finally:\n runtime.stop()\n\n deltas = routine.deltas()\n assert len(deltas) >= 2\n assert all(delta >= interval * 0.7 for delta in deltas[:2])", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:test_worker_wakes_up_with_configured_interval", - "span_start": 163, - "span_end": 178, - "lexical_rank": 6, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 7, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "class BlockingRoutine:\n def __init__(self, started: Event, release: Event) -> None:\n self._started = started\n self._release = release\n\n def run(self) -> None:\n self._started.set()\n self._release.wait(timeout=5.0)", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:BlockingRoutine", - "span_start": 40, - "span_end": 47, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 1, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "class ScenarioWorker(Worker):\n def __init__(self, name: str, routine: object, *, interval: float = 0.05) -> None:\n self._name = name\n self._routine = routine\n self._interval = interval\n self._thread: Thread | None = None\n self._stop_requested = Event()\n self._in_flight = 0\n self._runs = 0\n self._lock = Lock()\n\n @property\n def name(self) -> str:\n return self._name\n\n @property\n def critical(self) -> bool:\n return True\n\n def start(self) -> None:\n if self._thread is not None and self._thread.is_alive():\n return\n self._stop_requested.clear()\n self._thread = Thread(target=self._loop, name=f\"{self._name}-thread\", daemon=True)\n self._thread.start()\n\n def stop(self, force: bool = False) -> None:\n self._stop_requested.set()\n\n def health(self) -> WorkerHealth:\n return WorkerHealth(name=self.name, status=\"ok\", critical=True, meta={\"runs\": self._runs})\n\n def status(self) -> WorkerStatus:\n thread_alive = self._thread is not None and self._thread.is_alive()\n with self._lock:\n in_flight = self._in_flight\n runs = self._runs\n if not thread_alive:\n state = \"stopped\"\n elif self._stop_requested.is_set():\n state = \"stopping\"\n elif in_flight > 0:\n state = \"busy\"\n else:\n state = \"idle\"\n return WorkerStatus(name=self.name, state=state, in_flight=in_flight, meta={\"runs\": runs})\n\n def _loop(self) -> None:\n while not self._stop_requested.is_set():\n with self._lock:\n self._in_flight += 1\n try:\n self._routine.run()\n with self._lock:\n self._runs += 1\n finally:\n with self._lock:\n self._in_flight -= 1\n if self._stop_requested.is_set():\n return\n sleep(self._interval)", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:ScenarioWorker", - "span_start": 50, - "span_end": 110, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 2, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "class WorkerModule(ApplicationModule):\n def __init__(self, worker: Worker) -> None:\n self._worker = worker\n\n @property\n def name(self) -> str:\n return \"business-tests\"\n\n def register(self, registry: ModuleRegistry) -> None:\n registry.add_worker(self._worker)", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:WorkerModule", - "span_start": 113, - "span_end": 122, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 3, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "def _http_call_json(\n base_url: str,\n path: str,\n *,\n method: str = \"GET\",\n headers: dict[str, str] | None = None,\n) -> tuple[int, dict[str, object]]:\n request = Request(f\"{base_url}{path}\", method=method, headers=headers or {})\n try:\n with urlopen(request, timeout=15.0) as response:\n status = response.status\n body = response.read()\n except HTTPError as error:\n status = error.code\n body = error.read()\n payload = json.loads(body.decode(\"utf-8\"))\n return status, payload", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:_http_call_json", - "span_start": 125, - "span_end": 141, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 4, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "class IntervalRoutine:\n calls: list[float] = field(default_factory=list)\n _lock: Lock = field(default_factory=Lock)\n\n def run(self) -> None:\n with self._lock:\n self.calls.append(monotonic())\n\n def wait_runs(self, count: int, timeout: float) -> bool:\n deadline = monotonic() + timeout\n while monotonic() < deadline:\n with self._lock:\n if len(self.calls) >= count:\n return True\n sleep(0.01)\n return False\n\n def deltas(self) -> list[float]:\n with self._lock:\n return [self.calls[index + 1] - self.calls[index] for index in range(len(self.calls) - 1)]", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:IntervalRoutine", - "span_start": 18, - "span_end": 37, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "def _poll_until_stopped(base_url: str, timeout: float = 2.0) -> bool:\n deadline = monotonic() + timeout\n while monotonic() < deadline:\n _, payload = _http_call_json(base_url, \"/actions/status\")\n if payload.get(\"detail\") == \"stopped\":\n return True\n sleep(0.05)\n return False", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:_poll_until_stopped", - "span_start": 144, - "span_end": 151, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 5, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "llm_answer": null, - "summary": { - "router": { - "intent": "CODE_QA", - "sub_intent": "FIND_TESTS", - "confidence": null - }, - "retrieval": { - "profile": "code", - "layers_hit": [ - "C0_SOURCE_CHUNKS", - "C2_DEPENDENCY_GRAPH" - ], - "evidence_sufficient": true - }, - "llm": { - "answer_status": "partial", - "groundedness": "not_applicable" - } - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "FIND_TESTS", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "RuntimeManager" - ], - "keyword_hints": [ - "RuntimeManager" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**", - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "test_file_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "test_symbol_patterns": [ - "test_runtime_manager", - "TestRuntimeManager", - "RuntimeManager" - ], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C0_SOURCE_CHUNKS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C0_SOURCE_CHUNKS": 10 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [], - "include_globs": [ - "src", - "tests" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests" - ] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src", - "tests" - ], - "include_globs": [ - "src", - "tests" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests" - ] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src", - "tests" - ], - "include_globs": [ - "src", - "tests" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests" - ] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**", - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "Где тесты для RuntimeManager? test_runtime_manager TestRuntimeManager RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**", - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "top_k": 6, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Где тесты для RuntimeManager? test_runtime_manager TestRuntimeManager RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**", - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "top_k": 10, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [], - "normalized_include_globs": [ - "src", - "tests" - ], - "normalized_exclude_globs": [], - "normalized_prefer_globs": [ - "tests" - ], - "filter_stage": "post_rank", - "candidates_before_filter": 0, - "candidates_after_filter": 0 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src", - "tests" - ], - "normalized_include_globs": [ - "src", - "tests" - ], - "normalized_exclude_globs": [], - "normalized_prefer_globs": [ - "tests" - ], - "filter_stage": "post_rank", - "candidates_before_filter": 6, - "candidates_after_filter": 6 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src", - "tests" - ], - "normalized_include_globs": [ - "src", - "tests" - ], - "normalized_exclude_globs": [], - "normalized_prefer_globs": [ - "tests" - ], - "filter_stage": "post_rank", - "candidates_before_filter": 10, - "candidates_after_filter": 10 - } - ], - "fallback": { - "used": true, - "reason": "scope_relaxed_no_hits" - }, - "symbol_resolution": { - "status": "not_found", - "resolved_symbol": null, - "alternatives": [ - "RuntimeManager" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "miss", - "hit_count": 0, - "fail_reason": "scope_relaxed_no_hits" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 6, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 10, - "fail_reason": null - } - ] - }, - "constraint_violations": [ - { - "type": "LAYER_MISSING", - "severity": "warn", - "details": { - "layer": "C1_SYMBOL_CATALOG", - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ] - }, - "suggested_fix": "Increase top_k for this layer or relax constraints for retrieval." - } - ], - "timings_ms": { - "router": 0, - "symbol_resolution": 0, - "retrieval_total": 91, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 35, - "C2_DEPENDENCY_GRAPH": 43, - "C0_SOURCE_CHUNKS": 12 - }, - "merge_rank": 0, - "prompt_build": 0, - "llm_call": 0 - }, - "prompt": null, - "router": { - "conversation_mode": "START", - "keyword_hints": [ - "RuntimeManager" - ], - "path_scope": [] - }, - "llm": { - "used_evidence_count": 16, - "missing_evidence_reason": null - } - }, - "run_info": { - "case_id": "plba-rag-find-tests-runtime-manager", - "mode": "router_rag", - "run_started_at": "2026-03-12T08:53:12", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - }, - "input_request": { - "text": "Где тесты для RuntimeManager?", - "normalized_query": "Где тесты для RuntimeManager?" - }, - "steps": [ - { - "step": "intent_router", - "input": { - "query": "Где тесты для RuntimeManager?" - }, - "output": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Где тесты для RuntimeManager?" - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "FIND_TESTS", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "RuntimeManager" - ], - "keyword_hints": [ - "RuntimeManager" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**", - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "test_file_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "test_symbol_patterns": [ - "test_runtime_manager", - "TestRuntimeManager", - "RuntimeManager" - ], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "timings_ms": { - "router": 0 - } - } - }, - { - "step": "retrieval", - "input": { - "query": "Где тесты для RuntimeManager?" - }, - "output": { - "symbol_resolution": { - "status": "not_found", - "resolved_symbol": null, - "alternatives": [ - "RuntimeManager" - ], - "confidence": 0.0 - }, - "rag_count": 16, - "rag_rows": [ - { - "path": "tests/test_runtime.py", - "content": "test_runtime_runs_worker_routine_and_exposes_status instantiates RuntimeManager", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_runtime_runs_worker_routine_and_exposes_status:instantiates", - "span_start": 209, - "span_end": 209, - "lexical_rank": 6, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "c397a308e7824ba9fe400a754c7e15e66ea6f058d7f5d3e82bb002bb78b509d2", - "edge_type": "instantiates", - "src_symbol_id": "1c767eb5ee08e84f45b18c8ed7531ec0ed73c63fb1594823569672db7b21e992", - "src_qname": "test_runtime_runs_worker_routine_and_exposes_status", - "dst_symbol_id": "aeadc039653807b0da1ca6e3cc1078ee61cfc510b28e7f9c2ec04c59da43cc8d", - "dst_ref": "RuntimeManager", - "resolution": "resolved", - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_runtime.py", - "content": "test_runtime_graceful_stop_waits_until_worker_finishes instantiates RuntimeManager", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_runtime_graceful_stop_waits_until_worker_finishes:instantiates", - "span_start": 229, - "span_end": 229, - "lexical_rank": 6, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "76b4701262ccaa0a7a41691407c4ebdb2ca74a2415d89f0a38ef0d4f608bda93", - "edge_type": "instantiates", - "src_symbol_id": "1076e788e4a03b10d7bc1313a8ad46caa170c13cc026c6e4de994af1a6ae57bf", - "src_qname": "test_runtime_graceful_stop_waits_until_worker_finishes", - "dst_symbol_id": "aeadc039653807b0da1ca6e3cc1078ee61cfc510b28e7f9c2ec04c59da43cc8d", - "dst_ref": "RuntimeManager", - "resolution": "resolved", - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "_build_runtime instantiates RuntimeManager", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "_build_runtime:instantiates", - "span_start": 155, - "span_end": 155, - "lexical_rank": 6, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "7eb254d564944bab6272757ee5ef688862bd321e6941e2495dc942e03b1c9a25", - "edge_type": "instantiates", - "src_symbol_id": "db94031d5245bf82be836a109b4584b43b8e83d37a0f318e03f6c8191896d469", - "src_qname": "_build_runtime", - "dst_symbol_id": "a1572ea8183dc0cd6ddbc74342bbde8c28cecfde37ad40b62feff09f8d103d11", - "dst_ref": "RuntimeManager", - "resolution": "resolved", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "test_worker_wakes_up_with_configured_interval instantiates RuntimeManager", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_worker_wakes_up_with_configured_interval:instantiates", - "span_start": 167, - "span_end": 167, - "lexical_rank": 6, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "189aafc4de0b79c688668f25f0c87166a127df26bd2215452014713b65ef281a", - "edge_type": "instantiates", - "src_symbol_id": "65f877f78191d65e6a752e41cedc70ebc784c266804a55c1c56440336e1f0d6e", - "src_qname": "test_worker_wakes_up_with_configured_interval", - "dst_symbol_id": "a1572ea8183dc0cd6ddbc74342bbde8c28cecfde37ad40b62feff09f8d103d11", - "dst_ref": "RuntimeManager", - "resolution": "resolved", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "test_actions_stop_busy_worker_after_timeout\n -> BlockingRoutine\n -> BlockingRoutine.__init__\n -> BlockingRoutine._started\n -> BlockingRoutine.run", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_actions_stop_busy_worker_after_timeout:dataflow_slice", - "span_start": 42, - "span_end": 238, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 5, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "8e7db3d2a9226f1c1d9942ac6373cfcafa0d2276758ddb8a3d3c455a3d58024d", - "edge_type": "dataflow_slice", - "src_symbol_id": "66392d3222421d9ba16eda3554940b16e7d5a6f33aa08c5738d35af2e32f1e4a", - "src_qname": "test_actions_stop_busy_worker_after_timeout", - "dst_symbol_id": "d9841bdbb69706c988ae7ae6adf89928dc4fae45943f74064f5382177034ba04", - "dst_ref": "BlockingRoutine.run", - "resolution": "resolved", - "slice_id": "8e7db3d2a9226f1c1d9942ac6373cfcafa0d2276758ddb8a3d3c455a3d58024d", - "root_symbol_id": "66392d3222421d9ba16eda3554940b16e7d5a6f33aa08c5738d35af2e32f1e4a", - "path_symbols": [ - "test_actions_stop_busy_worker_after_timeout", - "BlockingRoutine", - "BlockingRoutine.__init__", - "BlockingRoutine._started", - "BlockingRoutine.run" - ], - "path_symbol_ids": [ - "66392d3222421d9ba16eda3554940b16e7d5a6f33aa08c5738d35af2e32f1e4a", - "a3349c5bc65e4003a4bbd6a8dbb7a54c337e12d1aed930caa701b12e520f1e67", - "486deeed3043c6db985aef258e96ddc67aa53608e67a83962fbd2471f649ddf1", - "d9841bdbb69706c988ae7ae6adf89928dc4fae45943f74064f5382177034ba04" - ], - "path_edge_types": [ - "instantiates", - "writes_attr", - "reads_attr" - ], - "path_length": 5, - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "test_actions_stop_busy_worker_before_timeout\n -> BlockingRoutine\n -> BlockingRoutine.__init__\n -> BlockingRoutine._release\n -> BlockingRoutine.run", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "test_actions_stop_busy_worker_before_timeout:dataflow_slice", - "span_start": 43, - "span_end": 212, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 5, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "8bd726155ba387d3579763ee84dfd2f9a90bc917da88f3b2e89416ab5c1254d6", - "edge_type": "dataflow_slice", - "src_symbol_id": "a0bb116ca9d909c93a285667ae033fbd1859b2dad7cf34fcb44816393ef6909c", - "src_qname": "test_actions_stop_busy_worker_before_timeout", - "dst_symbol_id": "d9841bdbb69706c988ae7ae6adf89928dc4fae45943f74064f5382177034ba04", - "dst_ref": "BlockingRoutine.run", - "resolution": "resolved", - "slice_id": "8bd726155ba387d3579763ee84dfd2f9a90bc917da88f3b2e89416ab5c1254d6", - "root_symbol_id": "a0bb116ca9d909c93a285667ae033fbd1859b2dad7cf34fcb44816393ef6909c", - "path_symbols": [ - "test_actions_stop_busy_worker_before_timeout", - "BlockingRoutine", - "BlockingRoutine.__init__", - "BlockingRoutine._release", - "BlockingRoutine.run" - ], - "path_symbol_ids": [ - "a0bb116ca9d909c93a285667ae033fbd1859b2dad7cf34fcb44816393ef6909c", - "a3349c5bc65e4003a4bbd6a8dbb7a54c337e12d1aed930caa701b12e520f1e67", - "486deeed3043c6db985aef258e96ddc67aa53608e67a83962fbd2471f649ddf1", - "d9841bdbb69706c988ae7ae6adf89928dc4fae45943f74064f5382177034ba04" - ], - "path_edge_types": [ - "instantiates", - "writes_attr", - "reads_attr" - ], - "path_length": 5, - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_runtime.py", - "content": "def test_runtime_graceful_stop_waits_until_worker_finishes() -> None:\n started = Event()\n release = Event()\n runtime = RuntimeManager()\n runtime.register_module(BlockingModule(started, release))\n runtime.start()\n assert started.wait(timeout=1.0) is True\n assert runtime.status()[\"runtime\"][\"state\"] == \"busy\"\n\n stop_thread = Thread(target=runtime.stop, kwargs={\"timeout\": 1.0}, daemon=True)\n stop_thread.start()\n sleep(0.1)\n assert stop_thread.is_alive() is True\n\n release.set()\n stop_thread.join(timeout=1.0)\n assert stop_thread.is_alive() is False\n assert runtime.status()[\"runtime\"][\"state\"] == \"stopped\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_runtime.py:test_runtime_graceful_stop_waits_until_worker_finishes", - "span_start": 226, - "span_end": 243, - "lexical_rank": 6, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 8, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_runtime", - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_runtime.py", - "content": "def test_runtime_runs_worker_routine_and_exposes_status(tmp_path) -> None:\n config_path = tmp_path / \"config.yml\"\n config_path.write_text(\n \"\"\"\nplatform:\n workers: 1\nlog:\n version: 1\n disable_existing_loggers: false\n handlers:\n console:\n class: logging.StreamHandler\n root:\n level: INFO\n handlers: [console]\n\"\"\".strip(),\n encoding=\"utf-8\",\n )\n runtime = RuntimeManager()\n runtime.add_config_file(config_path)\n module = ExampleModule()\n runtime.register_module(module)\n\n runtime.start()\n sleep(0.2)\n status = runtime.status()\n runtime.stop()\n\n assert module.routine.processed == [{\"id\": 1}]\n assert status[\"modules\"] == [\"example\"]\n assert status[\"runtime\"][\"state\"] == \"idle\"\n assert status[\"health\"][\"status\"] == \"ok\"\n assert status[\"config\"] == {\"platform\": {\"workers\": 1}, \"log\": status[\"config\"][\"log\"]}", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_runtime.py:test_runtime_runs_worker_routine_and_exposes_status", - "span_start": 191, - "span_end": 223, - "lexical_rank": 6, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 7, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_runtime", - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "def _build_runtime(worker: Worker, *, control_timeout: int = 1) -> tuple[RuntimeManager, str]:\n runtime = RuntimeManager()\n channel = HttpControlChannel(host=\"127.0.0.1\", port=0, timeout=control_timeout)\n runtime.control_plane.register_channel(channel)\n runtime.register_module(WorkerModule(worker))\n runtime.start()\n return runtime, f\"http://127.0.0.1:{channel.port}\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:_build_runtime", - "span_start": 154, - "span_end": 160, - "lexical_rank": 6, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 6, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "def test_worker_wakes_up_with_configured_interval() -> None:\n interval = 0.15\n routine = IntervalRoutine()\n worker = ScenarioWorker(\"interval-worker\", routine, interval=interval)\n runtime = RuntimeManager()\n runtime.register_module(WorkerModule(worker))\n\n runtime.start()\n try:\n assert routine.wait_runs(count=3, timeout=2.0) is True\n finally:\n runtime.stop()\n\n deltas = routine.deltas()\n assert len(deltas) >= 2\n assert all(delta >= interval * 0.7 for delta in deltas[:2])", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:test_worker_wakes_up_with_configured_interval", - "span_start": 163, - "span_end": 178, - "lexical_rank": 6, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 7, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "class BlockingRoutine:\n def __init__(self, started: Event, release: Event) -> None:\n self._started = started\n self._release = release\n\n def run(self) -> None:\n self._started.set()\n self._release.wait(timeout=5.0)", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:BlockingRoutine", - "span_start": 40, - "span_end": 47, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 1, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "class ScenarioWorker(Worker):\n def __init__(self, name: str, routine: object, *, interval: float = 0.05) -> None:\n self._name = name\n self._routine = routine\n self._interval = interval\n self._thread: Thread | None = None\n self._stop_requested = Event()\n self._in_flight = 0\n self._runs = 0\n self._lock = Lock()\n\n @property\n def name(self) -> str:\n return self._name\n\n @property\n def critical(self) -> bool:\n return True\n\n def start(self) -> None:\n if self._thread is not None and self._thread.is_alive():\n return\n self._stop_requested.clear()\n self._thread = Thread(target=self._loop, name=f\"{self._name}-thread\", daemon=True)\n self._thread.start()\n\n def stop(self, force: bool = False) -> None:\n self._stop_requested.set()\n\n def health(self) -> WorkerHealth:\n return WorkerHealth(name=self.name, status=\"ok\", critical=True, meta={\"runs\": self._runs})\n\n def status(self) -> WorkerStatus:\n thread_alive = self._thread is not None and self._thread.is_alive()\n with self._lock:\n in_flight = self._in_flight\n runs = self._runs\n if not thread_alive:\n state = \"stopped\"\n elif self._stop_requested.is_set():\n state = \"stopping\"\n elif in_flight > 0:\n state = \"busy\"\n else:\n state = \"idle\"\n return WorkerStatus(name=self.name, state=state, in_flight=in_flight, meta={\"runs\": runs})\n\n def _loop(self) -> None:\n while not self._stop_requested.is_set():\n with self._lock:\n self._in_flight += 1\n try:\n self._routine.run()\n with self._lock:\n self._runs += 1\n finally:\n with self._lock:\n self._in_flight -= 1\n if self._stop_requested.is_set():\n return\n sleep(self._interval)", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:ScenarioWorker", - "span_start": 50, - "span_end": 110, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 2, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "class WorkerModule(ApplicationModule):\n def __init__(self, worker: Worker) -> None:\n self._worker = worker\n\n @property\n def name(self) -> str:\n return \"business-tests\"\n\n def register(self, registry: ModuleRegistry) -> None:\n registry.add_worker(self._worker)", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:WorkerModule", - "span_start": 113, - "span_end": 122, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 3, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "def _http_call_json(\n base_url: str,\n path: str,\n *,\n method: str = \"GET\",\n headers: dict[str, str] | None = None,\n) -> tuple[int, dict[str, object]]:\n request = Request(f\"{base_url}{path}\", method=method, headers=headers or {})\n try:\n with urlopen(request, timeout=15.0) as response:\n status = response.status\n body = response.read()\n except HTTPError as error:\n status = error.code\n body = error.read()\n payload = json.loads(body.decode(\"utf-8\"))\n return status, payload", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:_http_call_json", - "span_start": 125, - "span_end": 141, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 4, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "class IntervalRoutine:\n calls: list[float] = field(default_factory=list)\n _lock: Lock = field(default_factory=Lock)\n\n def run(self) -> None:\n with self._lock:\n self.calls.append(monotonic())\n\n def wait_runs(self, count: int, timeout: float) -> bool:\n deadline = monotonic() + timeout\n while monotonic() < deadline:\n with self._lock:\n if len(self.calls) >= count:\n return True\n sleep(0.01)\n return False\n\n def deltas(self) -> list[float]:\n with self._lock:\n return [self.calls[index + 1] - self.calls[index] for index in range(len(self.calls) - 1)]", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:IntervalRoutine", - "span_start": 18, - "span_end": 37, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "def _poll_until_stopped(base_url: str, timeout: float = 2.0) -> bool:\n deadline = monotonic() + timeout\n while monotonic() < deadline:\n _, payload = _http_call_json(base_url, \"/actions/status\")\n if payload.get(\"detail\") == \"stopped\":\n return True\n sleep(0.05)\n return False", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:_poll_until_stopped", - "span_start": 144, - "span_end": 151, - "lexical_rank": 100, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 5, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ] - }, - "diagnostics": { - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C0_SOURCE_CHUNKS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C0_SOURCE_CHUNKS": 10 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [], - "include_globs": [ - "src", - "tests" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests" - ] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src", - "tests" - ], - "include_globs": [ - "src", - "tests" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests" - ] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src", - "tests" - ], - "include_globs": [ - "src", - "tests" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests" - ] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**", - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "Где тесты для RuntimeManager? test_runtime_manager TestRuntimeManager RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**", - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "top_k": 6, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Где тесты для RuntimeManager? test_runtime_manager TestRuntimeManager RuntimeManager", - "path_scope": [], - "include_globs": [ - "src/**", - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "top_k": 10, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [], - "normalized_include_globs": [ - "src", - "tests" - ], - "normalized_exclude_globs": [], - "normalized_prefer_globs": [ - "tests" - ], - "filter_stage": "post_rank", - "candidates_before_filter": 0, - "candidates_after_filter": 0 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src", - "tests" - ], - "normalized_include_globs": [ - "src", - "tests" - ], - "normalized_exclude_globs": [], - "normalized_prefer_globs": [ - "tests" - ], - "filter_stage": "post_rank", - "candidates_before_filter": 6, - "candidates_after_filter": 6 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src", - "tests" - ], - "normalized_include_globs": [ - "src", - "tests" - ], - "normalized_exclude_globs": [], - "normalized_prefer_globs": [ - "tests" - ], - "filter_stage": "post_rank", - "candidates_before_filter": 10, - "candidates_after_filter": 10 - } - ], - "fallback": { - "used": true, - "reason": "scope_relaxed_no_hits" - }, - "symbol_resolution": { - "status": "not_found", - "resolved_symbol": null, - "alternatives": [ - "RuntimeManager" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "miss", - "hit_count": 0, - "fail_reason": "scope_relaxed_no_hits" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 6, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 10, - "fail_reason": null - } - ] - }, - "constraint_violations": [ - { - "type": "LAYER_MISSING", - "severity": "warn", - "details": { - "layer": "C1_SYMBOL_CATALOG", - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ] - }, - "suggested_fix": "Increase top_k for this layer or relax constraints for retrieval." - } - ], - "timings_ms": { - "symbol_resolution": 0, - "retrieval_total": 91, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 35, - "C2_DEPENDENCY_GRAPH": 43, - "C0_SOURCE_CHUNKS": 12 - }, - "merge_rank": 0 - } - } - } - ] - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_router_rag/20260312_085312/router_rag_plba_code_retrieval_plba-rag-find-tests-runtime-manager.md b/tests/pipeline_setup_v2/test_results/plba_router_rag/20260312_085312/router_rag_plba_code_retrieval_plba-rag-find-tests-runtime-manager.md deleted file mode 100644 index 0e95f34..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_router_rag/20260312_085312/router_rag_plba_code_retrieval_plba-rag-find-tests-runtime-manager.md +++ /dev/null @@ -1,32 +0,0 @@ -# plba-rag-find-tests-runtime-manager - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/router_rag_plba_code_retrieval.yaml -- runner: runtime -- mode: router_rag -- passed: True - -## Query -Где тесты для RuntimeManager? - -## Actual -{ - "intent": "CODE_QA", - "sub_intent": "FIND_TESTS", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 16, - "llm_answer": "", - "answer_mode": "partial", - "path_scope": [], - "symbol_candidates": [ - "RuntimeManager" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ] -} - -## Mismatches -- none \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_router_rag/20260312_085312/router_rag_plba_code_retrieval_plba-rag-open-http-control-channel-file.json b/tests/pipeline_setup_v2/test_results/plba_router_rag/20260312_085312/router_rag_plba_code_retrieval_plba-rag-open-http-control-channel-file.json deleted file mode 100644 index f331fb6..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_router_rag/20260312_085312/router_rag_plba_code_retrieval_plba-rag-open-http-control-channel-file.json +++ /dev/null @@ -1,445 +0,0 @@ -{ - "case_id": "plba-rag-open-http-control-channel-file", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/router_rag_plba_code_retrieval.yaml", - "runner": "runtime", - "mode": "router_rag", - "actual": { - "intent": "CODE_QA", - "sub_intent": "OPEN_FILE", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 1, - "llm_answer": "", - "answer_mode": "partial", - "path_scope": [ - "src/app_runtime/control/http_channel.py" - ], - "symbol_candidates": [], - "layers": [ - "C0_SOURCE_CHUNKS" - ] - }, - "passed": true, - "mismatches": [], - "details": { - "case_id": "plba-rag-open-http-control-channel-file", - "text": "Покажи файл src/app_runtime/control/http_channel.py", - "mode": "router_rag", - "run_started_at": "2026-03-12T08:53:12", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Покажи файл src/app_runtime/control/http_channel.py", - "symbol_resolution": { - "status": "not_requested", - "resolved_symbol": null, - "alternatives": [], - "confidence": 0.0 - }, - "rag_count": 1, - "rag_rows": [ - { - "path": "src/app_runtime/control/http_channel.py", - "content": "class HttpControlChannel(ControlChannel):\n def __init__(self, host: str, port: int, timeout: int) -> None:\n self._timeout = timeout\n self._runner = UvicornThreadRunner(host, port, timeout)\n self._factory = HttpControlAppFactory()\n self._actions: ControlActionSet | None = None\n\n async def start(self, actions: ControlActionSet) -> None:\n self._actions = actions\n app = self._factory.create(self._health_response, self._action_response)\n await self._runner.start(app)\n\n async def stop(self) -> None:\n await self._runner.stop()\n\n @property\n def port(self) -> int:\n return self._runner.port\n\n async def _health_response(self) -> dict[str, object]:\n if self._actions is None:\n return {\"status\": \"unhealthy\", \"detail\": \"control actions are not configured\"}\n return await asyncio.wait_for(self._actions.health(), timeout=float(self._timeout))\n\n async def _action_response(self, action: str, _client_source: str = \"unknown\") -> JSONResponse:\n if self._actions is None:\n return JSONResponse(content={\"status\": \"error\", \"detail\": f\"{action} handler is not configured\"}, status_code=404)\n callbacks = {\n \"start\": self._actions.start,\n \"stop\": self._actions.stop,\n \"status\": self._actions.status,\n }\n callback = callbacks.get(action)\n if callback is None:\n return JSONResponse(content={\"status\": \"error\", \"detail\": f\"unsupported action: {action}\"}, status_code=404)\n action_timeout = max(float(self._timeout), 10.0) if action in {\"start\", \"stop\"} else float(self._timeout)\n try:\n detail = await asyncio.wait_for(callback(), timeout=action_timeout)\n except asyncio.TimeoutError:\n return JSONResponse(\n content={\"status\": \"accepted\", \"detail\": f\"{action} operation is still in progress\"},\n status_code=202,\n )\n except Exception as exc:\n return JSONResponse(content={\"status\": \"error\", \"detail\": str(exc)}, status_code=500)\n return JSONResponse(content={\"status\": \"ok\", \"detail\": detail or f\"{action} action accepted\"}, status_code=200)", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/http_channel.py:HttpControlChannel", - "span_start": 12, - "span_end": 57, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.http_channel", - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "llm_answer": null, - "summary": { - "router": { - "intent": "CODE_QA", - "sub_intent": "OPEN_FILE", - "confidence": null - }, - "retrieval": { - "profile": "code", - "layers_hit": [ - "C0_SOURCE_CHUNKS" - ], - "evidence_sufficient": true - }, - "llm": { - "answer_status": "partial", - "groundedness": "not_applicable" - } - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "OPEN_FILE", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C0_SOURCE_CHUNKS" - ], - "symbol_kind_hint": "unknown", - "symbol_candidates": [], - "keyword_hints": [], - "path_hints": [ - "src/app_runtime/control/http_channel.py" - ], - "path_scope": [ - "src/app_runtime/control/http_channel.py" - ], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/app_runtime/control/http_channel.py" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": false, - "max_distance": 2, - "top_k": 5 - } - } - }, - "execution": { - "executed_layers": [ - "C0_SOURCE_CHUNKS" - ], - "retrieval_mode_by_layer": { - "C0_SOURCE_CHUNKS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C0_SOURCE_CHUNKS": 200 - }, - "filters_by_layer": { - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src/app_runtime/control/http_channel.py" - ], - "include_globs": [], - "exclude_globs": [], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Покажи файл src/app_runtime/control/http_channel.py", - "path_scope": [ - "src/app_runtime/control/http_channel.py" - ], - "include_globs": [], - "exclude_globs": [], - "prefer_globs": [], - "top_k": 200, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src/app_runtime/control/http_channel.py" - ], - "normalized_include_globs": [], - "normalized_exclude_globs": [], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 1, - "candidates_after_filter": 1 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "not_requested", - "resolved_symbol": null, - "alternatives": [] - }, - "layers": [ - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 1, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "router": 0, - "symbol_resolution": 0, - "retrieval_total": 11, - "retrieval_by_layer": { - "C0_SOURCE_CHUNKS": 11 - }, - "merge_rank": 0, - "prompt_build": 0, - "llm_call": 0 - }, - "prompt": null, - "router": { - "conversation_mode": "START", - "keyword_hints": [], - "path_scope": [ - "src/app_runtime/control/http_channel.py" - ] - }, - "llm": { - "used_evidence_count": 1, - "missing_evidence_reason": null - } - }, - "run_info": { - "case_id": "plba-rag-open-http-control-channel-file", - "mode": "router_rag", - "run_started_at": "2026-03-12T08:53:12", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - }, - "input_request": { - "text": "Покажи файл src/app_runtime/control/http_channel.py", - "normalized_query": "Покажи файл src/app_runtime/control/http_channel.py" - }, - "steps": [ - { - "step": "intent_router", - "input": { - "query": "Покажи файл src/app_runtime/control/http_channel.py" - }, - "output": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Покажи файл src/app_runtime/control/http_channel.py" - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "OPEN_FILE", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C0_SOURCE_CHUNKS" - ], - "symbol_kind_hint": "unknown", - "symbol_candidates": [], - "keyword_hints": [], - "path_hints": [ - "src/app_runtime/control/http_channel.py" - ], - "path_scope": [ - "src/app_runtime/control/http_channel.py" - ], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/app_runtime/control/http_channel.py" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": false, - "max_distance": 2, - "top_k": 5 - } - } - }, - "timings_ms": { - "router": 0 - } - } - }, - { - "step": "retrieval", - "input": { - "query": "Покажи файл src/app_runtime/control/http_channel.py" - }, - "output": { - "symbol_resolution": { - "status": "not_requested", - "resolved_symbol": null, - "alternatives": [], - "confidence": 0.0 - }, - "rag_count": 1, - "rag_rows": [ - { - "path": "src/app_runtime/control/http_channel.py", - "content": "class HttpControlChannel(ControlChannel):\n def __init__(self, host: str, port: int, timeout: int) -> None:\n self._timeout = timeout\n self._runner = UvicornThreadRunner(host, port, timeout)\n self._factory = HttpControlAppFactory()\n self._actions: ControlActionSet | None = None\n\n async def start(self, actions: ControlActionSet) -> None:\n self._actions = actions\n app = self._factory.create(self._health_response, self._action_response)\n await self._runner.start(app)\n\n async def stop(self) -> None:\n await self._runner.stop()\n\n @property\n def port(self) -> int:\n return self._runner.port\n\n async def _health_response(self) -> dict[str, object]:\n if self._actions is None:\n return {\"status\": \"unhealthy\", \"detail\": \"control actions are not configured\"}\n return await asyncio.wait_for(self._actions.health(), timeout=float(self._timeout))\n\n async def _action_response(self, action: str, _client_source: str = \"unknown\") -> JSONResponse:\n if self._actions is None:\n return JSONResponse(content={\"status\": \"error\", \"detail\": f\"{action} handler is not configured\"}, status_code=404)\n callbacks = {\n \"start\": self._actions.start,\n \"stop\": self._actions.stop,\n \"status\": self._actions.status,\n }\n callback = callbacks.get(action)\n if callback is None:\n return JSONResponse(content={\"status\": \"error\", \"detail\": f\"unsupported action: {action}\"}, status_code=404)\n action_timeout = max(float(self._timeout), 10.0) if action in {\"start\", \"stop\"} else float(self._timeout)\n try:\n detail = await asyncio.wait_for(callback(), timeout=action_timeout)\n except asyncio.TimeoutError:\n return JSONResponse(\n content={\"status\": \"accepted\", \"detail\": f\"{action} operation is still in progress\"},\n status_code=202,\n )\n except Exception as exc:\n return JSONResponse(content={\"status\": \"error\", \"detail\": str(exc)}, status_code=500)\n return JSONResponse(content={\"status\": \"ok\", \"detail\": detail or f\"{action} action accepted\"}, status_code=200)", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/http_channel.py:HttpControlChannel", - "span_start": 12, - "span_end": 57, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.http_channel", - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ] - }, - "diagnostics": { - "execution": { - "executed_layers": [ - "C0_SOURCE_CHUNKS" - ], - "retrieval_mode_by_layer": { - "C0_SOURCE_CHUNKS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C0_SOURCE_CHUNKS": 200 - }, - "filters_by_layer": { - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src/app_runtime/control/http_channel.py" - ], - "include_globs": [], - "exclude_globs": [], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Покажи файл src/app_runtime/control/http_channel.py", - "path_scope": [ - "src/app_runtime/control/http_channel.py" - ], - "include_globs": [], - "exclude_globs": [], - "prefer_globs": [], - "top_k": 200, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src/app_runtime/control/http_channel.py" - ], - "normalized_include_globs": [], - "normalized_exclude_globs": [], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 1, - "candidates_after_filter": 1 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "not_requested", - "resolved_symbol": null, - "alternatives": [] - }, - "layers": [ - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 1, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "symbol_resolution": 0, - "retrieval_total": 11, - "retrieval_by_layer": { - "C0_SOURCE_CHUNKS": 11 - }, - "merge_rank": 0 - } - } - } - ] - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_router_rag/20260312_085312/router_rag_plba_code_retrieval_plba-rag-open-http-control-channel-file.md b/tests/pipeline_setup_v2/test_results/plba_router_rag/20260312_085312/router_rag_plba_code_retrieval_plba-rag-open-http-control-channel-file.md deleted file mode 100644 index ceac477..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_router_rag/20260312_085312/router_rag_plba_code_retrieval_plba-rag-open-http-control-channel-file.md +++ /dev/null @@ -1,30 +0,0 @@ -# plba-rag-open-http-control-channel-file - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/router_rag_plba_code_retrieval.yaml -- runner: runtime -- mode: router_rag -- passed: True - -## Query -Покажи файл src/app_runtime/control/http_channel.py - -## Actual -{ - "intent": "CODE_QA", - "sub_intent": "OPEN_FILE", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 1, - "llm_answer": "", - "answer_mode": "partial", - "path_scope": [ - "src/app_runtime/control/http_channel.py" - ], - "symbol_candidates": [], - "layers": [ - "C0_SOURCE_CHUNKS" - ] -} - -## Mismatches -- none \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_router_rag/20260312_085312/router_rag_plba_code_retrieval_plba-rag-open-runtime-manager-file.json b/tests/pipeline_setup_v2/test_results/plba_router_rag/20260312_085312/router_rag_plba_code_retrieval_plba-rag-open-runtime-manager-file.json deleted file mode 100644 index de0ce6e..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_router_rag/20260312_085312/router_rag_plba_code_retrieval_plba-rag-open-runtime-manager-file.json +++ /dev/null @@ -1,445 +0,0 @@ -{ - "case_id": "plba-rag-open-runtime-manager-file", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/router_rag_plba_code_retrieval.yaml", - "runner": "runtime", - "mode": "router_rag", - "actual": { - "intent": "CODE_QA", - "sub_intent": "OPEN_FILE", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 1, - "llm_answer": "", - "answer_mode": "partial", - "path_scope": [ - "src/app_runtime/core/runtime.py" - ], - "symbol_candidates": [], - "layers": [ - "C0_SOURCE_CHUNKS" - ] - }, - "passed": true, - "mismatches": [], - "details": { - "case_id": "plba-rag-open-runtime-manager-file", - "text": "Открой файл src/app_runtime/core/runtime.py", - "mode": "router_rag", - "run_started_at": "2026-03-12T08:53:12", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Открой файл src/app_runtime/core/runtime.py", - "symbol_resolution": { - "status": "not_requested", - "resolved_symbol": null, - "alternatives": [], - "confidence": 0.0 - }, - "rag_count": 1, - "rag_rows": [ - { - "path": "src/app_runtime/core/runtime.py", - "content": "class RuntimeManager:\n ACTION_TIMEOUT_SECONDS = 10.0\n ACTION_POLL_INTERVAL_SECONDS = 0.05\n\n def __init__(\n self,\n configuration: ConfigurationManager | None = None,\n services: ServiceContainer | None = None,\n traces: TraceService | None = None,\n health: HealthRegistry | None = None,\n logs: LogManager | None = None,\n workers: WorkerSupervisor | None = None,\n control_plane: ControlPlaneService | None = None,\n ) -> None:\n self.configuration = configuration or ConfigurationManager()\n self.services = services or ServiceContainer()\n self.traces = traces or TraceService()\n self.health = health or HealthRegistry()\n self.logs = logs or LogManager()\n self.workers = workers or WorkerSupervisor()\n self.control_plane = control_plane or ControlPlaneService()\n self.registry = ModuleRegistry(self.services)\n self._started = False\n self._state = LifecycleState.IDLE\n self._core_registered = False\n self._workers_registered = False\n self._register_core_services()\n\n def register_module(self, module: ApplicationModule) -> None:\n self.registry.register_module(module.name)\n module.register(self.registry)\n\n def add_config_file(self, path: str) -> FileConfigProvider:\n provider = FileConfigProvider(path)\n self.configuration.add_provider(provider)\n return provider\n\n def start(self, *, start_control_plane: bool = True) -> None:\n if self._started:\n return\n self._state = LifecycleState.STARTING\n config = self.configuration.load()\n self.logs.apply_config(config)\n self._register_health_contributors()\n self._register_workers()\n self.workers.start()\n if start_control_plane:\n self.control_plane.start(self)\n self._started = True\n self._refresh_state()\n\n def stop(self, timeout: float = 30.0, force: bool = False, stop_control_plane: bool = True) -> None:\n if not self._started:\n return\n self._state = LifecycleState.STOPPING\n self.workers.stop(timeout=timeout, force=force)\n if stop_control_plane:\n self.control_plane.stop()\n self._started = False\n self._state = LifecycleState.STOPPED\n\n def status(self) -> dict[str, object]:\n self._refresh_state()\n return self.control_plane.snapshot(self)\n\n def current_health(self) -> HealthPayload:\n self._refresh_state()\n return self.health.payload(self._state, self.workers.healths())\n\n async def health_status(self) -> HealthPayload:\n return self.current_health()\n\n async def start_runtime(self) -> dict[str, object] | str:\n self._refresh_state()\n if self._started:\n return \"runtime already running\"\n if self._state == LifecycleState.STOPPING:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n\n self.start(start_control_plane=False)\n started = self._wait_for_state({LifecycleState.IDLE, LifecycleState.BUSY}, timeout=self.ACTION_TIMEOUT_SECONDS)\n if started:\n return self._action_detail(\"runtime started\", timed_out=False)\n return self._action_detail(\"runtime start is still in progress\", timed_out=True)\n\n async def stop_runtime(self) -> dict[str, object] | str:\n self._refresh_state()\n if not self._started:\n if self._state == LifecycleState.STOPPING:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n return \"runtime already stopped\"\n\n self._state = LifecycleState.STOPPING\n try:\n self.workers.stop(timeout=self.ACTION_TIMEOUT_SECONDS, force=False)\n except TimeoutError:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n\n self._started = False\n self._state = LifecycleState.STOPPED\n return self._action_detail(\"runtime stopped\", timed_out=False)\n\n async def runtime_status(self) -> str:\n self._refresh_state()\n return self._state.value\n\n def _register_core_services(self) -> None:\n if self._core_registered:\n return\n self.services.register(\"configuration\", self.configuration)\n self.services.register(\"traces\", self.traces)\n self.services.register(\"health\", self.health)\n self.services.register(\"logs\", self.logs)\n self.services.register(\"workers\", self.workers)\n self.services.register(\"control_plane\", self.control_plane)\n self._core_registered = True\n\n def _register_health_contributors(self) -> None:\n for contributor in self.registry.health_contributors:\n self.health.register(contributor)\n\n def _register_workers(self) -> None:\n if self._workers_registered:\n return\n for worker in self.registry.workers:\n self.workers.register(worker)\n self._workers_registered = True\n\n def _refresh_state(self) -> None:\n lifecycle = self.workers.lifecycle_state()\n\n if self._state == LifecycleState.STOPPING:\n if lifecycle == LifecycleState.STOPPED:\n self._started = False\n self._state = LifecycleState.STOPPED\n return\n\n if not self._started:\n if lifecycle == LifecycleState.STOPPED:\n self._state = LifecycleState.STOPPED\n return\n\n self._state = lifecycle\n\n def _wait_for_state(self, target_states: set[LifecycleState], *, timeout: float) -> bool:\n deadline = monotonic() + timeout\n while monotonic() < deadline:\n self._refresh_state()\n if self._state in target_states:\n return True\n sleep(self.ACTION_POLL_INTERVAL_SECONDS)\n self._refresh_state()\n return self._state in target_states\n\n def _action_detail(self, message: str, *, timed_out: bool) -> dict[str, object]:\n self._refresh_state()\n return {\n \"message\": message,\n \"state\": self._state.value,\n \"timed_out\": timed_out,\n \"workers\": self.workers.snapshot(),\n }", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/core/runtime.py:RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.core.runtime", - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "llm_answer": null, - "summary": { - "router": { - "intent": "CODE_QA", - "sub_intent": "OPEN_FILE", - "confidence": null - }, - "retrieval": { - "profile": "code", - "layers_hit": [ - "C0_SOURCE_CHUNKS" - ], - "evidence_sufficient": true - }, - "llm": { - "answer_status": "partial", - "groundedness": "not_applicable" - } - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "OPEN_FILE", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C0_SOURCE_CHUNKS" - ], - "symbol_kind_hint": "unknown", - "symbol_candidates": [], - "keyword_hints": [], - "path_hints": [ - "src/app_runtime/core/runtime.py" - ], - "path_scope": [ - "src/app_runtime/core/runtime.py" - ], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/app_runtime/core/runtime.py" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": false, - "max_distance": 2, - "top_k": 5 - } - } - }, - "execution": { - "executed_layers": [ - "C0_SOURCE_CHUNKS" - ], - "retrieval_mode_by_layer": { - "C0_SOURCE_CHUNKS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C0_SOURCE_CHUNKS": 200 - }, - "filters_by_layer": { - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src/app_runtime/core/runtime.py" - ], - "include_globs": [], - "exclude_globs": [], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Открой файл src/app_runtime/core/runtime.py", - "path_scope": [ - "src/app_runtime/core/runtime.py" - ], - "include_globs": [], - "exclude_globs": [], - "prefer_globs": [], - "top_k": 200, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src/app_runtime/core/runtime.py" - ], - "normalized_include_globs": [], - "normalized_exclude_globs": [], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 1, - "candidates_after_filter": 1 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "not_requested", - "resolved_symbol": null, - "alternatives": [] - }, - "layers": [ - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 1, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "router": 0, - "symbol_resolution": 0, - "retrieval_total": 111, - "retrieval_by_layer": { - "C0_SOURCE_CHUNKS": 111 - }, - "merge_rank": 0, - "prompt_build": 0, - "llm_call": 0 - }, - "prompt": null, - "router": { - "conversation_mode": "START", - "keyword_hints": [], - "path_scope": [ - "src/app_runtime/core/runtime.py" - ] - }, - "llm": { - "used_evidence_count": 1, - "missing_evidence_reason": null - } - }, - "run_info": { - "case_id": "plba-rag-open-runtime-manager-file", - "mode": "router_rag", - "run_started_at": "2026-03-12T08:53:12", - "rag_session_id": "1431c0c3-5e6a-41f2-9c58-3d06b9c39749", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - }, - "input_request": { - "text": "Открой файл src/app_runtime/core/runtime.py", - "normalized_query": "Открой файл src/app_runtime/core/runtime.py" - }, - "steps": [ - { - "step": "intent_router", - "input": { - "query": "Открой файл src/app_runtime/core/runtime.py" - }, - "output": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Открой файл src/app_runtime/core/runtime.py" - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "OPEN_FILE", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C0_SOURCE_CHUNKS" - ], - "symbol_kind_hint": "unknown", - "symbol_candidates": [], - "keyword_hints": [], - "path_hints": [ - "src/app_runtime/core/runtime.py" - ], - "path_scope": [ - "src/app_runtime/core/runtime.py" - ], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/app_runtime/core/runtime.py" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": false, - "max_distance": 2, - "top_k": 5 - } - } - }, - "timings_ms": { - "router": 0 - } - } - }, - { - "step": "retrieval", - "input": { - "query": "Открой файл src/app_runtime/core/runtime.py" - }, - "output": { - "symbol_resolution": { - "status": "not_requested", - "resolved_symbol": null, - "alternatives": [], - "confidence": 0.0 - }, - "rag_count": 1, - "rag_rows": [ - { - "path": "src/app_runtime/core/runtime.py", - "content": "class RuntimeManager:\n ACTION_TIMEOUT_SECONDS = 10.0\n ACTION_POLL_INTERVAL_SECONDS = 0.05\n\n def __init__(\n self,\n configuration: ConfigurationManager | None = None,\n services: ServiceContainer | None = None,\n traces: TraceService | None = None,\n health: HealthRegistry | None = None,\n logs: LogManager | None = None,\n workers: WorkerSupervisor | None = None,\n control_plane: ControlPlaneService | None = None,\n ) -> None:\n self.configuration = configuration or ConfigurationManager()\n self.services = services or ServiceContainer()\n self.traces = traces or TraceService()\n self.health = health or HealthRegistry()\n self.logs = logs or LogManager()\n self.workers = workers or WorkerSupervisor()\n self.control_plane = control_plane or ControlPlaneService()\n self.registry = ModuleRegistry(self.services)\n self._started = False\n self._state = LifecycleState.IDLE\n self._core_registered = False\n self._workers_registered = False\n self._register_core_services()\n\n def register_module(self, module: ApplicationModule) -> None:\n self.registry.register_module(module.name)\n module.register(self.registry)\n\n def add_config_file(self, path: str) -> FileConfigProvider:\n provider = FileConfigProvider(path)\n self.configuration.add_provider(provider)\n return provider\n\n def start(self, *, start_control_plane: bool = True) -> None:\n if self._started:\n return\n self._state = LifecycleState.STARTING\n config = self.configuration.load()\n self.logs.apply_config(config)\n self._register_health_contributors()\n self._register_workers()\n self.workers.start()\n if start_control_plane:\n self.control_plane.start(self)\n self._started = True\n self._refresh_state()\n\n def stop(self, timeout: float = 30.0, force: bool = False, stop_control_plane: bool = True) -> None:\n if not self._started:\n return\n self._state = LifecycleState.STOPPING\n self.workers.stop(timeout=timeout, force=force)\n if stop_control_plane:\n self.control_plane.stop()\n self._started = False\n self._state = LifecycleState.STOPPED\n\n def status(self) -> dict[str, object]:\n self._refresh_state()\n return self.control_plane.snapshot(self)\n\n def current_health(self) -> HealthPayload:\n self._refresh_state()\n return self.health.payload(self._state, self.workers.healths())\n\n async def health_status(self) -> HealthPayload:\n return self.current_health()\n\n async def start_runtime(self) -> dict[str, object] | str:\n self._refresh_state()\n if self._started:\n return \"runtime already running\"\n if self._state == LifecycleState.STOPPING:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n\n self.start(start_control_plane=False)\n started = self._wait_for_state({LifecycleState.IDLE, LifecycleState.BUSY}, timeout=self.ACTION_TIMEOUT_SECONDS)\n if started:\n return self._action_detail(\"runtime started\", timed_out=False)\n return self._action_detail(\"runtime start is still in progress\", timed_out=True)\n\n async def stop_runtime(self) -> dict[str, object] | str:\n self._refresh_state()\n if not self._started:\n if self._state == LifecycleState.STOPPING:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n return \"runtime already stopped\"\n\n self._state = LifecycleState.STOPPING\n try:\n self.workers.stop(timeout=self.ACTION_TIMEOUT_SECONDS, force=False)\n except TimeoutError:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n\n self._started = False\n self._state = LifecycleState.STOPPED\n return self._action_detail(\"runtime stopped\", timed_out=False)\n\n async def runtime_status(self) -> str:\n self._refresh_state()\n return self._state.value\n\n def _register_core_services(self) -> None:\n if self._core_registered:\n return\n self.services.register(\"configuration\", self.configuration)\n self.services.register(\"traces\", self.traces)\n self.services.register(\"health\", self.health)\n self.services.register(\"logs\", self.logs)\n self.services.register(\"workers\", self.workers)\n self.services.register(\"control_plane\", self.control_plane)\n self._core_registered = True\n\n def _register_health_contributors(self) -> None:\n for contributor in self.registry.health_contributors:\n self.health.register(contributor)\n\n def _register_workers(self) -> None:\n if self._workers_registered:\n return\n for worker in self.registry.workers:\n self.workers.register(worker)\n self._workers_registered = True\n\n def _refresh_state(self) -> None:\n lifecycle = self.workers.lifecycle_state()\n\n if self._state == LifecycleState.STOPPING:\n if lifecycle == LifecycleState.STOPPED:\n self._started = False\n self._state = LifecycleState.STOPPED\n return\n\n if not self._started:\n if lifecycle == LifecycleState.STOPPED:\n self._state = LifecycleState.STOPPED\n return\n\n self._state = lifecycle\n\n def _wait_for_state(self, target_states: set[LifecycleState], *, timeout: float) -> bool:\n deadline = monotonic() + timeout\n while monotonic() < deadline:\n self._refresh_state()\n if self._state in target_states:\n return True\n sleep(self.ACTION_POLL_INTERVAL_SECONDS)\n self._refresh_state()\n return self._state in target_states\n\n def _action_detail(self, message: str, *, timed_out: bool) -> dict[str, object]:\n self._refresh_state()\n return {\n \"message\": message,\n \"state\": self._state.value,\n \"timed_out\": timed_out,\n \"workers\": self.workers.snapshot(),\n }", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/core/runtime.py:RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.core.runtime", - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ] - }, - "diagnostics": { - "execution": { - "executed_layers": [ - "C0_SOURCE_CHUNKS" - ], - "retrieval_mode_by_layer": { - "C0_SOURCE_CHUNKS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C0_SOURCE_CHUNKS": 200 - }, - "filters_by_layer": { - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src/app_runtime/core/runtime.py" - ], - "include_globs": [], - "exclude_globs": [], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "plba", - "workspace_id": "None", - "returned_repo_ids": [ - "plba" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Открой файл src/app_runtime/core/runtime.py", - "path_scope": [ - "src/app_runtime/core/runtime.py" - ], - "include_globs": [], - "exclude_globs": [], - "prefer_globs": [], - "top_k": 200, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src/app_runtime/core/runtime.py" - ], - "normalized_include_globs": [], - "normalized_exclude_globs": [], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 1, - "candidates_after_filter": 1 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "not_requested", - "resolved_symbol": null, - "alternatives": [] - }, - "layers": [ - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 1, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "symbol_resolution": 0, - "retrieval_total": 111, - "retrieval_by_layer": { - "C0_SOURCE_CHUNKS": 111 - }, - "merge_rank": 0 - } - } - } - ] - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_router_rag/20260312_085312/router_rag_plba_code_retrieval_plba-rag-open-runtime-manager-file.md b/tests/pipeline_setup_v2/test_results/plba_router_rag/20260312_085312/router_rag_plba_code_retrieval_plba-rag-open-runtime-manager-file.md deleted file mode 100644 index fc55328..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_router_rag/20260312_085312/router_rag_plba_code_retrieval_plba-rag-open-runtime-manager-file.md +++ /dev/null @@ -1,30 +0,0 @@ -# plba-rag-open-runtime-manager-file - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/router_rag_plba_code_retrieval.yaml -- runner: runtime -- mode: router_rag -- passed: True - -## Query -Открой файл src/app_runtime/core/runtime.py - -## Actual -{ - "intent": "CODE_QA", - "sub_intent": "OPEN_FILE", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 1, - "llm_answer": "", - "answer_mode": "partial", - "path_scope": [ - "src/app_runtime/core/runtime.py" - ], - "symbol_candidates": [], - "layers": [ - "C0_SOURCE_CHUNKS" - ] -} - -## Mismatches -- none \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/plba_router_rag/20260312_085312/summary.md b/tests/pipeline_setup_v2/test_results/plba_router_rag/20260312_085312/summary.md deleted file mode 100644 index 1d5d392..0000000 --- a/tests/pipeline_setup_v2/test_results/plba_router_rag/20260312_085312/summary.md +++ /dev/null @@ -1,17 +0,0 @@ -# pipeline_setup_v2 summary - -Passed: 11/11 - -| File | Case | Runner | Mode | Intent | Sub-intent | Pass | -|------|------|--------|------|--------|------------|------| -| router_rag_plba_code_retrieval.yaml | plba-rag-open-runtime-manager-file | runtime | router_rag | CODE_QA | OPEN_FILE | ✓ | -| router_rag_plba_code_retrieval.yaml | plba-rag-open-http-control-channel-file | runtime | router_rag | CODE_QA | OPEN_FILE | ✓ | -| router_rag_plba_code_retrieval.yaml | plba-rag-explain-runtime-manager | runtime | router_rag | CODE_QA | EXPLAIN | ✓ | -| router_rag_plba_code_retrieval.yaml | plba-rag-explain-http-control-channel | runtime | router_rag | CODE_QA | EXPLAIN | ✓ | -| router_rag_plba_code_retrieval.yaml | plba-rag-explain-trace-service | runtime | router_rag | CODE_QA | EXPLAIN | ✓ | -| router_rag_plba_code_retrieval.yaml | plba-rag-find-tests-runtime-manager | runtime | router_rag | CODE_QA | FIND_TESTS | ✓ | -| router_rag_plba_code_retrieval.yaml | plba-rag-find-tests-http-control-channel | runtime | router_rag | CODE_QA | FIND_TESTS | ✓ | -| router_rag_plba_code_retrieval.yaml | plba-rag-find-entrypoints | runtime | router_rag | CODE_QA | FIND_ENTRYPOINTS | ✓ | -| router_rag_plba_code_retrieval.yaml | plba-rag-explain-create-runtime | runtime | router_rag | CODE_QA | EXPLAIN | ✓ | -| router_rag_plba_code_retrieval.yaml | plba-rag-explain-control-plane-service | runtime | router_rag | CODE_QA | EXPLAIN | ✓ | -| router_rag_plba_code_retrieval.yaml | plba-rag-explain-workflow-engine | runtime | router_rag | CODE_QA | EXPLAIN | ✓ | \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/router_only_smoke/20260312_082745/full_chain_smoke_full_chain_explain_order_service.json b/tests/pipeline_setup_v2/test_results/router_only_smoke/20260312_082745/full_chain_smoke_full_chain_explain_order_service.json deleted file mode 100644 index 315a147..0000000 --- a/tests/pipeline_setup_v2/test_results/router_only_smoke/20260312_082745/full_chain_smoke_full_chain_explain_order_service.json +++ /dev/null @@ -1,2198 +0,0 @@ -{ - "case_id": "full_chain_explain_order_service", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_smoke.yaml", - "runner": "runtime", - "mode": "full_chain", - "actual": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 15, - "llm_answer": "## Архитектура и Поведение `OrderService`\n\n### Описание\n\n`OrderService` является основным компонентом сервиса заказа в приложении. Он отвечает за управление жизненным циклом заказов и взаимодействие с другими сущностями приложения через интерфейс репозитория (`OrderRepository`).\n\n### Ключевые компоненты и их роль\n\n1. **OrderService**\n - **Роль**: Сервисный компонент, который управляет основными операциями заказа.\n - **Ответственность**:\n - Чтение и запись состояния атрибутов заказа.\n - Участие в данных потоков (dataflow slices).\n \n2. **Order**\n - Представляет заказ как объект с состоянием и атрибутами.\n\n3. **OrderRepository**\n - Репозиторий для хранения и управления данными о заказе.\n - Обеспечивает доступ к данным о заказах из базы данных или другого хранилища.\n\n### Поток данных и логика работы\n\n#### Инициализация OrderService\n\nПри создании экземпляра класса `OrderService`, выполняется следующая последовательность действий:\n\n```python\ndef __init__(self):\n self._repo = OrderRepository() # Инициализируем репозиторий заказов\n```\n\nТаким образом, создается экземпляр репозитория заказов, который будет использоваться при выполнении операций над заказами.\n\n#### Основные операции\n\n##### Получение существующего заказа\n\nМетод `get_order` позволяет получить информацию о существующем заказе из репозитория:\n\n```python\ndef get_order(self, order_id):\n return self._repo.find_by_id(order_id) # Вызываем метод репозитория для поиска заказа по идентификатору\n```\n\n##### Создание нового заказа\n\nМетод `create_order` создает новый заказ и сохраняет его в репозитории:\n\n```python\ndef create_order(self, new_order_data):\n order = Order(**new_order_data) # Создаем новый заказ на основе переданных данных\n self._repo.save(order) # Сохраняем заказ в репозитории\n```\n\n### Итоговое описание поведения\n\n`OrderService` предоставляет сервисы для взаимодействия с заказами. При инициализации создается репозиторий заказов, который используется для чтения и записи информации о заказах. Основной функционал включает получение существующих заказов и создание новых заказов. Эти действия реализуются методами `get_order` и `create_order`.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "OrderService" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "passed": true, - "mismatches": [], - "details": { - "case_id": "full_chain_explain_order_service", - "text": "Как работает OrderService?", - "mode": "full_chain", - "run_started_at": "2026-03-12T08:27:46", - "rag_session_id": "223298d3-6e55-405d-933a-3c14ec38cb1f", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Как работает OrderService?", - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "OrderService", - "alternatives": [ - "OrderService" - ], - "confidence": 0.99 - }, - "rag_count": 15, - "rag_rows": [ - { - "path": "src/order_app/services/order_service.py", - "content": "class OrderService\nOrderService", - "layer": "C1_SYMBOL_CATALOG", - "title": "OrderService", - "span_start": 7, - "span_end": 16, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "42b4f9dfe7edcf06b3ad38543ad457eb56b88834f0d114cb6e18872b7306e62c", - "qname": "OrderService", - "kind": "class", - "signature": "OrderService", - "parent_symbol_id": null, - "package_or_module": "src.order_app.services.order_service", - "is_test": false, - "blob_sha": "ae64718f6a024640edf9c936f72e5954897442af3840f7429a2d514128ce2447", - "repo_id": "code_qa_repo_full_chain", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/order_app/services/order_service.py", - "content": "OrderService\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests service\n- reads and writes state attributes\n- participates in dataflow slices (2)", - "layer": "C4_SEMANTIC_ROLES", - "title": "OrderService", - "span_start": 7, - "span_end": 16, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 71, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "42b4f9dfe7edcf06b3ad38543ad457eb56b88834f0d114cb6e18872b7306e62c", - "symbol_name": "OrderService", - "qname": "OrderService", - "role": "pipeline_stage", - "confidence": 0.57, - "dataflow_participation": 2, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "ae64718f6a024640edf9c936f72e5954897442af3840f7429a2d514128ce2447", - "repo_id": "code_qa_repo_full_chain", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/order_app/domain/order.py", - "content": "Order\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes", - "layer": "C4_SEMANTIC_ROLES", - "title": "Order", - "span_start": 6, - "span_end": 11, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 31, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "b60768ee227c0dc0caca658c2eafcbad554f462e363734f5c4f597dd4d413f5c", - "symbol_name": "Order", - "qname": "Order", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "f2a88a24ade1930ed3e1bedf66ea7e9ef825f10fe4ee830a233fb7911ef32626", - "repo_id": "code_qa_repo_full_chain", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/order_app/repositories/order_repository.py", - "content": "OrderRepository\nrole: repository\n\nResponsibilities:\n- name suffix suggests repository", - "layer": "C4_SEMANTIC_ROLES", - "title": "OrderRepository", - "span_start": 6, - "span_end": 14, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 36, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "4ff9dd82d0e928179af4cc55bcab5b1082be515832a6c92978b54779539c4a48", - "symbol_name": "OrderRepository", - "qname": "OrderRepository", - "role": "repository", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "a9a07d097b3a075dc55ede70766180dff42f2165ac73c791ad024f46db27b9f2", - "repo_id": "code_qa_repo_full_chain", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/order_app/services/order_service.py", - "content": "OrderService.__init__\n -> OrderService._repo\n -> OrderService.get_order", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "OrderService.__init__:dataflow_slice", - "span_start": 9, - "span_end": 16, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "9f06b4fc5cc95467d5dc324689b15228600bc31ee0a53dae49f9aab490ec4ee3", - "edge_type": "dataflow_slice", - "src_symbol_id": "0ea1a03958593fe152e67e8c49837b3a7a69a6d0a65fa04e97ad7a2209655b4e", - "src_qname": "OrderService.__init__", - "dst_symbol_id": "2b0346b72716cf0289a80089ca36ae37ec9c0ae387850f5ca4b5e79d2f6e500e", - "dst_ref": "OrderService.get_order", - "resolution": "resolved", - "slice_id": "9f06b4fc5cc95467d5dc324689b15228600bc31ee0a53dae49f9aab490ec4ee3", - "root_symbol_id": "0ea1a03958593fe152e67e8c49837b3a7a69a6d0a65fa04e97ad7a2209655b4e", - "path_symbols": [ - "OrderService.__init__", - "OrderService._repo", - "OrderService.get_order" - ], - "path_symbol_ids": [ - "0ea1a03958593fe152e67e8c49837b3a7a69a6d0a65fa04e97ad7a2209655b4e", - "2b0346b72716cf0289a80089ca36ae37ec9c0ae387850f5ca4b5e79d2f6e500e" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "ae64718f6a024640edf9c936f72e5954897442af3840f7429a2d514128ce2447", - "repo_id": "code_qa_repo_full_chain", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/order_app/services/order_service.py", - "content": "OrderService.__init__\n -> OrderService._repo\n -> OrderService.create_order", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "OrderService.__init__:dataflow_slice", - "span_start": 9, - "span_end": 13, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "7f1d6f7110575a74f1a7153db3a16f80ee81e0c9d56aee502dbe58cf6017e0c8", - "edge_type": "dataflow_slice", - "src_symbol_id": "0ea1a03958593fe152e67e8c49837b3a7a69a6d0a65fa04e97ad7a2209655b4e", - "src_qname": "OrderService.__init__", - "dst_symbol_id": "830ecc3aea935f4787cde49b096954d26c88d3b0a050003c7b1e77287d18ed49", - "dst_ref": "OrderService.create_order", - "resolution": "resolved", - "slice_id": "7f1d6f7110575a74f1a7153db3a16f80ee81e0c9d56aee502dbe58cf6017e0c8", - "root_symbol_id": "0ea1a03958593fe152e67e8c49837b3a7a69a6d0a65fa04e97ad7a2209655b4e", - "path_symbols": [ - "OrderService.__init__", - "OrderService._repo", - "OrderService.create_order" - ], - "path_symbol_ids": [ - "0ea1a03958593fe152e67e8c49837b3a7a69a6d0a65fa04e97ad7a2209655b4e", - "830ecc3aea935f4787cde49b096954d26c88d3b0a050003c7b1e77287d18ed49" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "ae64718f6a024640edf9c936f72e5954897442af3840f7429a2d514128ce2447", - "repo_id": "code_qa_repo_full_chain", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/order_app/services/order_service.py", - "content": "OrderService.create_order reads_attr self._repo.save", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "OrderService.create_order:reads_attr", - "span_start": 13, - "span_end": 13, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "f1d9cdc1eab33373c59ca0937d86a02dcd46ae18d8f9ecd8bfa016fee792814c", - "edge_type": "reads_attr", - "src_symbol_id": "830ecc3aea935f4787cde49b096954d26c88d3b0a050003c7b1e77287d18ed49", - "src_qname": "OrderService.create_order", - "dst_symbol_id": null, - "dst_ref": "self._repo.save", - "resolution": "partial", - "is_test": false, - "blob_sha": "ae64718f6a024640edf9c936f72e5954897442af3840f7429a2d514128ce2447", - "repo_id": "code_qa_repo_full_chain", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/order_app/services/order_service.py", - "content": "OrderService.__init__ writes_attr OrderService._repo", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "OrderService.__init__:writes_attr", - "span_start": 9, - "span_end": 9, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "ea0ac983d364893b1215f560c86734bab4962cad622ac417bd3ecf205626b664", - "edge_type": "writes_attr", - "src_symbol_id": "0ea1a03958593fe152e67e8c49837b3a7a69a6d0a65fa04e97ad7a2209655b4e", - "src_qname": "OrderService.__init__", - "dst_symbol_id": null, - "dst_ref": "OrderService._repo", - "resolution": "partial", - "is_test": false, - "blob_sha": "ae64718f6a024640edf9c936f72e5954897442af3840f7429a2d514128ce2447", - "repo_id": "code_qa_repo_full_chain", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/order_app/services/order_service.py", - "content": "OrderService.create_order calls self._repo.save", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "OrderService.create_order:calls", - "span_start": 13, - "span_end": 13, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "9726557100771150a85f999afcf652ab89ca7d79db13143ebf989fb90de7b24a", - "edge_type": "calls", - "src_symbol_id": "830ecc3aea935f4787cde49b096954d26c88d3b0a050003c7b1e77287d18ed49", - "src_qname": "OrderService.create_order", - "dst_symbol_id": null, - "dst_ref": "self._repo.save", - "resolution": "partial", - "is_test": false, - "blob_sha": "ae64718f6a024640edf9c936f72e5954897442af3840f7429a2d514128ce2447", - "repo_id": "code_qa_repo_full_chain", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/order_app/services/order_service.py", - "content": "OrderService.create_order reads_attr OrderService._repo", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "OrderService.create_order:reads_attr", - "span_start": 13, - "span_end": 13, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "3f0e571901e31de616f7e560e20cc7cdd85f7350060bb59e6dfc56d431197a0e", - "edge_type": "reads_attr", - "src_symbol_id": "830ecc3aea935f4787cde49b096954d26c88d3b0a050003c7b1e77287d18ed49", - "src_qname": "OrderService.create_order", - "dst_symbol_id": null, - "dst_ref": "OrderService._repo", - "resolution": "partial", - "is_test": false, - "blob_sha": "ae64718f6a024640edf9c936f72e5954897442af3840f7429a2d514128ce2447", - "repo_id": "code_qa_repo_full_chain", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/order_app/api/orders.py", - "content": "create_app.get_order\n -> jsonify", - "layer": "C3_ENTRYPOINTS", - "title": "create_app.get_order:execution_trace", - "span_start": 3, - "span_end": 28, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 2, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "edge_id": "a1a3ed8655ca7992651e6a480d2a9b8b1a6081ed4fafc6b218a6b9db03d3f829", - "edge_type": "execution_trace", - "src_symbol_id": "087d884b60e3cd267f285f861c866b84768a56e07e693e71c460a67aa099eb65", - "src_qname": "create_app.get_order", - "dst_symbol_id": "66d26c57dd7a75745acf1cd3e825f74cc312bafc7fc90619b1a6d25fcde57efd", - "dst_ref": "jsonify", - "resolution": "resolved", - "trace_id": "a1a3ed8655ca7992651e6a480d2a9b8b1a6081ed4fafc6b218a6b9db03d3f829", - "entry_id": "0c15b2acb96e575fc73553b943025314dd58c6f6dcb969b698e6a704a1c0e69d", - "entry_symbol_id": "087d884b60e3cd267f285f861c866b84768a56e07e693e71c460a67aa099eb65", - "path_symbols": [ - "create_app.get_order", - "jsonify" - ], - "path_symbol_ids": [ - "087d884b60e3cd267f285f861c866b84768a56e07e693e71c460a67aa099eb65", - "66d26c57dd7a75745acf1cd3e825f74cc312bafc7fc90619b1a6d25fcde57efd" - ], - "path_length": 2, - "is_test": false, - "blob_sha": "02fcc02cabba2c3659fb06047892e602e773619ea0be8c96d048701035b950a7", - "repo_id": "code_qa_repo_full_chain", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/order_app/api/orders.py", - "content": "create_app.create_order\n -> jsonify", - "layer": "C3_ENTRYPOINTS", - "title": "create_app.create_order:execution_trace", - "span_start": 3, - "span_end": 21, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 2, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "edge_id": "95a9ec7cfc456854d50b78db55737a140085fe398414f9166494cb4eddfa6ef5", - "edge_type": "execution_trace", - "src_symbol_id": "9b7d3951f6099cb9c6eca7c8fce1caf659b82ef5f67e6dc8e26c6277af011473", - "src_qname": "create_app.create_order", - "dst_symbol_id": "66d26c57dd7a75745acf1cd3e825f74cc312bafc7fc90619b1a6d25fcde57efd", - "dst_ref": "jsonify", - "resolution": "resolved", - "trace_id": "95a9ec7cfc456854d50b78db55737a140085fe398414f9166494cb4eddfa6ef5", - "entry_id": "0212a881f45888e5b6467d0731b8d5dd04500b5f0679dcff450e5891ea14e20f", - "entry_symbol_id": "9b7d3951f6099cb9c6eca7c8fce1caf659b82ef5f67e6dc8e26c6277af011473", - "path_symbols": [ - "create_app.create_order", - "jsonify" - ], - "path_symbol_ids": [ - "9b7d3951f6099cb9c6eca7c8fce1caf659b82ef5f67e6dc8e26c6277af011473", - "66d26c57dd7a75745acf1cd3e825f74cc312bafc7fc90619b1a6d25fcde57efd" - ], - "path_length": 2, - "is_test": false, - "blob_sha": "02fcc02cabba2c3659fb06047892e602e773619ea0be8c96d048701035b950a7", - "repo_id": "code_qa_repo_full_chain", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/order_app/api/orders.py", - "content": "fastapi http app.route", - "layer": "C3_ENTRYPOINTS", - "title": "app.route", - "span_start": 15, - "span_end": 21, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "0212a881f45888e5b6467d0731b8d5dd04500b5f0679dcff450e5891ea14e20f", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.route", - "handler_symbol_id": "9b7d3951f6099cb9c6eca7c8fce1caf659b82ef5f67e6dc8e26c6277af011473", - "is_test": false, - "lang_payload": { - "methods": [] - }, - "artifact_type": null, - "blob_sha": "02fcc02cabba2c3659fb06047892e602e773619ea0be8c96d048701035b950a7", - "repo_id": "code_qa_repo_full_chain", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/order_app/api/orders.py", - "content": "fastapi http app.route", - "layer": "C3_ENTRYPOINTS", - "title": "app.route", - "span_start": 24, - "span_end": 28, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "864ea5b326fb62dc34d91b9968f4e3f85e457b0a586ec8c30bf36a5893373d52", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.route", - "handler_symbol_id": "087d884b60e3cd267f285f861c866b84768a56e07e693e71c460a67aa099eb65", - "is_test": false, - "lang_payload": { - "methods": [] - }, - "artifact_type": null, - "blob_sha": "02fcc02cabba2c3659fb06047892e602e773619ea0be8c96d048701035b950a7", - "repo_id": "code_qa_repo_full_chain", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/order_app/services/order_service.py", - "content": "class OrderService:\n def __init__(self, repository: OrderRepository) -> None:\n self._repo = repository\n\n def create_order(self, product_id: str | None = None, quantity: int = 1) -> Order:\n order = Order(product_id=product_id or \"\", quantity=quantity)\n return self._repo.save(order)\n\n def get_order(self, order_id: str) -> Order | None:\n return self._repo.find_by_id(order_id)", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/order_app/services/order_service.py:OrderService", - "span_start": 7, - "span_end": 16, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.order_app.services.order_service", - "is_test": false, - "blob_sha": "ae64718f6a024640edf9c936f72e5954897442af3840f7429a2d514128ce2447", - "repo_id": "code_qa_repo_full_chain", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "llm_answer": "## Архитектура и Поведение `OrderService`\n\n### Описание\n\n`OrderService` является основным компонентом сервиса заказа в приложении. Он отвечает за управление жизненным циклом заказов и взаимодействие с другими сущностями приложения через интерфейс репозитория (`OrderRepository`).\n\n### Ключевые компоненты и их роль\n\n1. **OrderService**\n - **Роль**: Сервисный компонент, который управляет основными операциями заказа.\n - **Ответственность**:\n - Чтение и запись состояния атрибутов заказа.\n - Участие в данных потоков (dataflow slices).\n \n2. **Order**\n - Представляет заказ как объект с состоянием и атрибутами.\n\n3. **OrderRepository**\n - Репозиторий для хранения и управления данными о заказе.\n - Обеспечивает доступ к данным о заказах из базы данных или другого хранилища.\n\n### Поток данных и логика работы\n\n#### Инициализация OrderService\n\nПри создании экземпляра класса `OrderService`, выполняется следующая последовательность действий:\n\n```python\ndef __init__(self):\n self._repo = OrderRepository() # Инициализируем репозиторий заказов\n```\n\nТаким образом, создается экземпляр репозитория заказов, который будет использоваться при выполнении операций над заказами.\n\n#### Основные операции\n\n##### Получение существующего заказа\n\nМетод `get_order` позволяет получить информацию о существующем заказе из репозитория:\n\n```python\ndef get_order(self, order_id):\n return self._repo.find_by_id(order_id) # Вызываем метод репозитория для поиска заказа по идентификатору\n```\n\n##### Создание нового заказа\n\nМетод `create_order` создает новый заказ и сохраняет его в репозитории:\n\n```python\ndef create_order(self, new_order_data):\n order = Order(**new_order_data) # Создаем новый заказ на основе переданных данных\n self._repo.save(order) # Сохраняем заказ в репозитории\n```\n\n### Итоговое описание поведения\n\n`OrderService` предоставляет сервисы для взаимодействия с заказами. При инициализации создается репозиторий заказов, который используется для чтения и записи информации о заказах. Основной функционал включает получение существующих заказов и создание новых заказов. Эти действия реализуются методами `get_order` и `create_order`.", - "summary": { - "router": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "confidence": null - }, - "retrieval": { - "profile": "code", - "layers_hit": [ - "C0_SOURCE_CHUNKS", - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS", - "C4_SEMANTIC_ROLES" - ], - "evidence_sufficient": true - }, - "llm": { - "answer_status": "answered", - "groundedness": "grounded" - } - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "OrderService" - ], - "keyword_hints": [ - "OrderService" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C0_SOURCE_CHUNKS": "exact_path_fetch", - "C4_SEMANTIC_ROLES": "exact_path_fetch", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C3_ENTRYPOINTS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 8, - "C4_SEMANTIC_ROLES": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C3_ENTRYPOINTS": 6 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C4_SEMANTIC_ROLES": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "code_qa_repo_full_chain", - "workspace_id": "None", - "returned_repo_ids": [ - "code_qa_repo_full_chain" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "OrderService", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Как работает OrderService?", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C4_SEMANTIC_ROLES", - "query": "Как работает OrderService?", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "Как работает OrderService?", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - }, - { - "layer": "C3_ENTRYPOINTS", - "query": "Как работает OrderService?", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 1, - "candidates_after_filter": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 3, - "candidates_after_filter": 3 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 6, - "candidates_after_filter": 6 - }, - { - "layer": "C3_ENTRYPOINTS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 6, - "candidates_after_filter": 6 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "OrderService", - "alternatives": [ - "OrderService" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C4_SEMANTIC_ROLES", - "status": "hit", - "hit_count": 3, - "fail_reason": null - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 6, - "fail_reason": null - }, - { - "layer": "C3_ENTRYPOINTS", - "status": "hit", - "hit_count": 4, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "router": 1, - "symbol_resolution": 0, - "retrieval_total": 55, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 10, - "C0_SOURCE_CHUNKS": 9, - "C4_SEMANTIC_ROLES": 9, - "C2_DEPENDENCY_GRAPH": 10, - "C3_ENTRYPOINTS": 7 - }, - "merge_rank": 13, - "prompt_build": 0, - "llm_call": 5268 - }, - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 304, - "evidence_rows": 15, - "evidence_chars": 1228 - }, - "evidence_summary": [ - { - "layer": "C1_SYMBOL_CATALOG", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "count": 3, - "unique_paths": 3 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "count": 6, - "unique_paths": 1 - }, - { - "layer": "C3_ENTRYPOINTS", - "count": 4, - "unique_paths": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 1, - "unique_paths": 1 - } - ], - "prompt_template_id": "intent_code_qa_v1", - "system_prompt_version": "v1" - }, - "router": { - "conversation_mode": "START", - "keyword_hints": [ - "OrderService" - ], - "path_scope": [] - }, - "llm": { - "used_evidence_count": 15, - "missing_evidence_reason": null - } - }, - "run_info": { - "case_id": "full_chain_explain_order_service", - "mode": "full_chain", - "run_started_at": "2026-03-12T08:27:46", - "rag_session_id": "223298d3-6e55-405d-933a-3c14ec38cb1f", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - }, - "input_request": { - "text": "Как работает OrderService?", - "normalized_query": "Как работает OrderService?" - }, - "steps": [ - { - "step": "intent_router", - "input": { - "query": "Как работает OrderService?" - }, - "output": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Как работает OrderService?" - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "OrderService" - ], - "keyword_hints": [ - "OrderService" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "timings_ms": { - "router": 1 - } - } - }, - { - "step": "retrieval", - "input": { - "query": "Как работает OrderService?" - }, - "output": { - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "OrderService", - "alternatives": [ - "OrderService" - ], - "confidence": 0.99 - }, - "rag_count": 15, - "rag_rows": [ - { - "path": "src/order_app/services/order_service.py", - "content": "class OrderService\nOrderService", - "layer": "C1_SYMBOL_CATALOG", - "title": "OrderService", - "span_start": 7, - "span_end": 16, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "42b4f9dfe7edcf06b3ad38543ad457eb56b88834f0d114cb6e18872b7306e62c", - "qname": "OrderService", - "kind": "class", - "signature": "OrderService", - "parent_symbol_id": null, - "package_or_module": "src.order_app.services.order_service", - "is_test": false, - "blob_sha": "ae64718f6a024640edf9c936f72e5954897442af3840f7429a2d514128ce2447", - "repo_id": "code_qa_repo_full_chain", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/order_app/services/order_service.py", - "content": "OrderService\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests service\n- reads and writes state attributes\n- participates in dataflow slices (2)", - "layer": "C4_SEMANTIC_ROLES", - "title": "OrderService", - "span_start": 7, - "span_end": 16, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 71, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "42b4f9dfe7edcf06b3ad38543ad457eb56b88834f0d114cb6e18872b7306e62c", - "symbol_name": "OrderService", - "qname": "OrderService", - "role": "pipeline_stage", - "confidence": 0.57, - "dataflow_participation": 2, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "ae64718f6a024640edf9c936f72e5954897442af3840f7429a2d514128ce2447", - "repo_id": "code_qa_repo_full_chain", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/order_app/domain/order.py", - "content": "Order\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes", - "layer": "C4_SEMANTIC_ROLES", - "title": "Order", - "span_start": 6, - "span_end": 11, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 31, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "b60768ee227c0dc0caca658c2eafcbad554f462e363734f5c4f597dd4d413f5c", - "symbol_name": "Order", - "qname": "Order", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "f2a88a24ade1930ed3e1bedf66ea7e9ef825f10fe4ee830a233fb7911ef32626", - "repo_id": "code_qa_repo_full_chain", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/order_app/repositories/order_repository.py", - "content": "OrderRepository\nrole: repository\n\nResponsibilities:\n- name suffix suggests repository", - "layer": "C4_SEMANTIC_ROLES", - "title": "OrderRepository", - "span_start": 6, - "span_end": 14, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 36, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "4ff9dd82d0e928179af4cc55bcab5b1082be515832a6c92978b54779539c4a48", - "symbol_name": "OrderRepository", - "qname": "OrderRepository", - "role": "repository", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "a9a07d097b3a075dc55ede70766180dff42f2165ac73c791ad024f46db27b9f2", - "repo_id": "code_qa_repo_full_chain", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/order_app/services/order_service.py", - "content": "OrderService.__init__\n -> OrderService._repo\n -> OrderService.get_order", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "OrderService.__init__:dataflow_slice", - "span_start": 9, - "span_end": 16, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "9f06b4fc5cc95467d5dc324689b15228600bc31ee0a53dae49f9aab490ec4ee3", - "edge_type": "dataflow_slice", - "src_symbol_id": "0ea1a03958593fe152e67e8c49837b3a7a69a6d0a65fa04e97ad7a2209655b4e", - "src_qname": "OrderService.__init__", - "dst_symbol_id": "2b0346b72716cf0289a80089ca36ae37ec9c0ae387850f5ca4b5e79d2f6e500e", - "dst_ref": "OrderService.get_order", - "resolution": "resolved", - "slice_id": "9f06b4fc5cc95467d5dc324689b15228600bc31ee0a53dae49f9aab490ec4ee3", - "root_symbol_id": "0ea1a03958593fe152e67e8c49837b3a7a69a6d0a65fa04e97ad7a2209655b4e", - "path_symbols": [ - "OrderService.__init__", - "OrderService._repo", - "OrderService.get_order" - ], - "path_symbol_ids": [ - "0ea1a03958593fe152e67e8c49837b3a7a69a6d0a65fa04e97ad7a2209655b4e", - "2b0346b72716cf0289a80089ca36ae37ec9c0ae387850f5ca4b5e79d2f6e500e" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "ae64718f6a024640edf9c936f72e5954897442af3840f7429a2d514128ce2447", - "repo_id": "code_qa_repo_full_chain", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/order_app/services/order_service.py", - "content": "OrderService.__init__\n -> OrderService._repo\n -> OrderService.create_order", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "OrderService.__init__:dataflow_slice", - "span_start": 9, - "span_end": 13, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "7f1d6f7110575a74f1a7153db3a16f80ee81e0c9d56aee502dbe58cf6017e0c8", - "edge_type": "dataflow_slice", - "src_symbol_id": "0ea1a03958593fe152e67e8c49837b3a7a69a6d0a65fa04e97ad7a2209655b4e", - "src_qname": "OrderService.__init__", - "dst_symbol_id": "830ecc3aea935f4787cde49b096954d26c88d3b0a050003c7b1e77287d18ed49", - "dst_ref": "OrderService.create_order", - "resolution": "resolved", - "slice_id": "7f1d6f7110575a74f1a7153db3a16f80ee81e0c9d56aee502dbe58cf6017e0c8", - "root_symbol_id": "0ea1a03958593fe152e67e8c49837b3a7a69a6d0a65fa04e97ad7a2209655b4e", - "path_symbols": [ - "OrderService.__init__", - "OrderService._repo", - "OrderService.create_order" - ], - "path_symbol_ids": [ - "0ea1a03958593fe152e67e8c49837b3a7a69a6d0a65fa04e97ad7a2209655b4e", - "830ecc3aea935f4787cde49b096954d26c88d3b0a050003c7b1e77287d18ed49" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "ae64718f6a024640edf9c936f72e5954897442af3840f7429a2d514128ce2447", - "repo_id": "code_qa_repo_full_chain", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/order_app/services/order_service.py", - "content": "OrderService.create_order reads_attr self._repo.save", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "OrderService.create_order:reads_attr", - "span_start": 13, - "span_end": 13, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "f1d9cdc1eab33373c59ca0937d86a02dcd46ae18d8f9ecd8bfa016fee792814c", - "edge_type": "reads_attr", - "src_symbol_id": "830ecc3aea935f4787cde49b096954d26c88d3b0a050003c7b1e77287d18ed49", - "src_qname": "OrderService.create_order", - "dst_symbol_id": null, - "dst_ref": "self._repo.save", - "resolution": "partial", - "is_test": false, - "blob_sha": "ae64718f6a024640edf9c936f72e5954897442af3840f7429a2d514128ce2447", - "repo_id": "code_qa_repo_full_chain", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/order_app/services/order_service.py", - "content": "OrderService.__init__ writes_attr OrderService._repo", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "OrderService.__init__:writes_attr", - "span_start": 9, - "span_end": 9, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "ea0ac983d364893b1215f560c86734bab4962cad622ac417bd3ecf205626b664", - "edge_type": "writes_attr", - "src_symbol_id": "0ea1a03958593fe152e67e8c49837b3a7a69a6d0a65fa04e97ad7a2209655b4e", - "src_qname": "OrderService.__init__", - "dst_symbol_id": null, - "dst_ref": "OrderService._repo", - "resolution": "partial", - "is_test": false, - "blob_sha": "ae64718f6a024640edf9c936f72e5954897442af3840f7429a2d514128ce2447", - "repo_id": "code_qa_repo_full_chain", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/order_app/services/order_service.py", - "content": "OrderService.create_order calls self._repo.save", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "OrderService.create_order:calls", - "span_start": 13, - "span_end": 13, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "9726557100771150a85f999afcf652ab89ca7d79db13143ebf989fb90de7b24a", - "edge_type": "calls", - "src_symbol_id": "830ecc3aea935f4787cde49b096954d26c88d3b0a050003c7b1e77287d18ed49", - "src_qname": "OrderService.create_order", - "dst_symbol_id": null, - "dst_ref": "self._repo.save", - "resolution": "partial", - "is_test": false, - "blob_sha": "ae64718f6a024640edf9c936f72e5954897442af3840f7429a2d514128ce2447", - "repo_id": "code_qa_repo_full_chain", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/order_app/services/order_service.py", - "content": "OrderService.create_order reads_attr OrderService._repo", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "OrderService.create_order:reads_attr", - "span_start": 13, - "span_end": 13, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "3f0e571901e31de616f7e560e20cc7cdd85f7350060bb59e6dfc56d431197a0e", - "edge_type": "reads_attr", - "src_symbol_id": "830ecc3aea935f4787cde49b096954d26c88d3b0a050003c7b1e77287d18ed49", - "src_qname": "OrderService.create_order", - "dst_symbol_id": null, - "dst_ref": "OrderService._repo", - "resolution": "partial", - "is_test": false, - "blob_sha": "ae64718f6a024640edf9c936f72e5954897442af3840f7429a2d514128ce2447", - "repo_id": "code_qa_repo_full_chain", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/order_app/api/orders.py", - "content": "create_app.get_order\n -> jsonify", - "layer": "C3_ENTRYPOINTS", - "title": "create_app.get_order:execution_trace", - "span_start": 3, - "span_end": 28, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 2, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "edge_id": "a1a3ed8655ca7992651e6a480d2a9b8b1a6081ed4fafc6b218a6b9db03d3f829", - "edge_type": "execution_trace", - "src_symbol_id": "087d884b60e3cd267f285f861c866b84768a56e07e693e71c460a67aa099eb65", - "src_qname": "create_app.get_order", - "dst_symbol_id": "66d26c57dd7a75745acf1cd3e825f74cc312bafc7fc90619b1a6d25fcde57efd", - "dst_ref": "jsonify", - "resolution": "resolved", - "trace_id": "a1a3ed8655ca7992651e6a480d2a9b8b1a6081ed4fafc6b218a6b9db03d3f829", - "entry_id": "0c15b2acb96e575fc73553b943025314dd58c6f6dcb969b698e6a704a1c0e69d", - "entry_symbol_id": "087d884b60e3cd267f285f861c866b84768a56e07e693e71c460a67aa099eb65", - "path_symbols": [ - "create_app.get_order", - "jsonify" - ], - "path_symbol_ids": [ - "087d884b60e3cd267f285f861c866b84768a56e07e693e71c460a67aa099eb65", - "66d26c57dd7a75745acf1cd3e825f74cc312bafc7fc90619b1a6d25fcde57efd" - ], - "path_length": 2, - "is_test": false, - "blob_sha": "02fcc02cabba2c3659fb06047892e602e773619ea0be8c96d048701035b950a7", - "repo_id": "code_qa_repo_full_chain", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/order_app/api/orders.py", - "content": "create_app.create_order\n -> jsonify", - "layer": "C3_ENTRYPOINTS", - "title": "create_app.create_order:execution_trace", - "span_start": 3, - "span_end": 21, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 2, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "edge_id": "95a9ec7cfc456854d50b78db55737a140085fe398414f9166494cb4eddfa6ef5", - "edge_type": "execution_trace", - "src_symbol_id": "9b7d3951f6099cb9c6eca7c8fce1caf659b82ef5f67e6dc8e26c6277af011473", - "src_qname": "create_app.create_order", - "dst_symbol_id": "66d26c57dd7a75745acf1cd3e825f74cc312bafc7fc90619b1a6d25fcde57efd", - "dst_ref": "jsonify", - "resolution": "resolved", - "trace_id": "95a9ec7cfc456854d50b78db55737a140085fe398414f9166494cb4eddfa6ef5", - "entry_id": "0212a881f45888e5b6467d0731b8d5dd04500b5f0679dcff450e5891ea14e20f", - "entry_symbol_id": "9b7d3951f6099cb9c6eca7c8fce1caf659b82ef5f67e6dc8e26c6277af011473", - "path_symbols": [ - "create_app.create_order", - "jsonify" - ], - "path_symbol_ids": [ - "9b7d3951f6099cb9c6eca7c8fce1caf659b82ef5f67e6dc8e26c6277af011473", - "66d26c57dd7a75745acf1cd3e825f74cc312bafc7fc90619b1a6d25fcde57efd" - ], - "path_length": 2, - "is_test": false, - "blob_sha": "02fcc02cabba2c3659fb06047892e602e773619ea0be8c96d048701035b950a7", - "repo_id": "code_qa_repo_full_chain", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/order_app/api/orders.py", - "content": "fastapi http app.route", - "layer": "C3_ENTRYPOINTS", - "title": "app.route", - "span_start": 15, - "span_end": 21, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "0212a881f45888e5b6467d0731b8d5dd04500b5f0679dcff450e5891ea14e20f", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.route", - "handler_symbol_id": "9b7d3951f6099cb9c6eca7c8fce1caf659b82ef5f67e6dc8e26c6277af011473", - "is_test": false, - "lang_payload": { - "methods": [] - }, - "artifact_type": null, - "blob_sha": "02fcc02cabba2c3659fb06047892e602e773619ea0be8c96d048701035b950a7", - "repo_id": "code_qa_repo_full_chain", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/order_app/api/orders.py", - "content": "fastapi http app.route", - "layer": "C3_ENTRYPOINTS", - "title": "app.route", - "span_start": 24, - "span_end": 28, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "864ea5b326fb62dc34d91b9968f4e3f85e457b0a586ec8c30bf36a5893373d52", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.route", - "handler_symbol_id": "087d884b60e3cd267f285f861c866b84768a56e07e693e71c460a67aa099eb65", - "is_test": false, - "lang_payload": { - "methods": [] - }, - "artifact_type": null, - "blob_sha": "02fcc02cabba2c3659fb06047892e602e773619ea0be8c96d048701035b950a7", - "repo_id": "code_qa_repo_full_chain", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/order_app/services/order_service.py", - "content": "class OrderService:\n def __init__(self, repository: OrderRepository) -> None:\n self._repo = repository\n\n def create_order(self, product_id: str | None = None, quantity: int = 1) -> Order:\n order = Order(product_id=product_id or \"\", quantity=quantity)\n return self._repo.save(order)\n\n def get_order(self, order_id: str) -> Order | None:\n return self._repo.find_by_id(order_id)", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/order_app/services/order_service.py:OrderService", - "span_start": 7, - "span_end": 16, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.order_app.services.order_service", - "is_test": false, - "blob_sha": "ae64718f6a024640edf9c936f72e5954897442af3840f7429a2d514128ce2447", - "repo_id": "code_qa_repo_full_chain", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ] - }, - "diagnostics": { - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C0_SOURCE_CHUNKS": "exact_path_fetch", - "C4_SEMANTIC_ROLES": "exact_path_fetch", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C3_ENTRYPOINTS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 8, - "C4_SEMANTIC_ROLES": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C3_ENTRYPOINTS": 6 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C4_SEMANTIC_ROLES": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "code_qa_repo_full_chain", - "workspace_id": "None", - "returned_repo_ids": [ - "code_qa_repo_full_chain" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "OrderService", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Как работает OrderService?", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C4_SEMANTIC_ROLES", - "query": "Как работает OrderService?", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "Как работает OrderService?", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - }, - { - "layer": "C3_ENTRYPOINTS", - "query": "Как работает OrderService?", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 1, - "candidates_after_filter": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 3, - "candidates_after_filter": 3 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 6, - "candidates_after_filter": 6 - }, - { - "layer": "C3_ENTRYPOINTS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 6, - "candidates_after_filter": 6 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "OrderService", - "alternatives": [ - "OrderService" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C4_SEMANTIC_ROLES", - "status": "hit", - "hit_count": 3, - "fail_reason": null - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 6, - "fail_reason": null - }, - { - "layer": "C3_ENTRYPOINTS", - "status": "hit", - "hit_count": 4, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "symbol_resolution": 0, - "retrieval_total": 55, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 10, - "C0_SOURCE_CHUNKS": 9, - "C4_SEMANTIC_ROLES": 9, - "C2_DEPENDENCY_GRAPH": 10, - "C3_ENTRYPOINTS": 7 - }, - "merge_rank": 13 - } - } - }, - { - "step": "llm_answer", - "input": { - "query": "Как работает OrderService?", - "rag_count": 15 - }, - "output": { - "llm_answer": "## Архитектура и Поведение `OrderService`\n\n### Описание\n\n`OrderService` является основным компонентом сервиса заказа в приложении. Он отвечает за управление жизненным циклом заказов и взаимодействие с другими сущностями приложения через интерфейс репозитория (`OrderRepository`).\n\n### Ключевые компоненты и их роль\n\n1. **OrderService**\n - **Роль**: Сервисный компонент, который управляет основными операциями заказа.\n - **Ответственность**:\n - Чтение и запись состояния атрибутов заказа.\n - Участие в данных потоков (dataflow slices).\n \n2. **Order**\n - Представляет заказ как объект с состоянием и атрибутами.\n\n3. **OrderRepository**\n - Репозиторий для хранения и управления данными о заказе.\n - Обеспечивает доступ к данным о заказах из базы данных или другого хранилища.\n\n### Поток данных и логика работы\n\n#### Инициализация OrderService\n\nПри создании экземпляра класса `OrderService`, выполняется следующая последовательность действий:\n\n```python\ndef __init__(self):\n self._repo = OrderRepository() # Инициализируем репозиторий заказов\n```\n\nТаким образом, создается экземпляр репозитория заказов, который будет использоваться при выполнении операций над заказами.\n\n#### Основные операции\n\n##### Получение существующего заказа\n\nМетод `get_order` позволяет получить информацию о существующем заказе из репозитория:\n\n```python\ndef get_order(self, order_id):\n return self._repo.find_by_id(order_id) # Вызываем метод репозитория для поиска заказа по идентификатору\n```\n\n##### Создание нового заказа\n\nМетод `create_order` создает новый заказ и сохраняет его в репозитории:\n\n```python\ndef create_order(self, new_order_data):\n order = Order(**new_order_data) # Создаем новый заказ на основе переданных данных\n self._repo.save(order) # Сохраняем заказ в репозитории\n```\n\n### Итоговое описание поведения\n\n`OrderService` предоставляет сервисы для взаимодействия с заказами. При инициализации создается репозиторий заказов, который используется для чтения и записи информации о заказах. Основной функционал включает получение существующих заказов и создание новых заказов. Эти действия реализуются методами `get_order` и `create_order`." - }, - "diagnostics": { - "prompt": { - "prompt_stats": { - "tokens_in_estimate": 304, - "evidence_rows": 15, - "evidence_chars": 1228 - }, - "evidence_summary": [ - { - "layer": "C1_SYMBOL_CATALOG", - "count": 1, - "unique_paths": 1 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "count": 3, - "unique_paths": 3 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "count": 6, - "unique_paths": 1 - }, - { - "layer": "C3_ENTRYPOINTS", - "count": 4, - "unique_paths": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "count": 1, - "unique_paths": 1 - } - ], - "prompt_template_id": "intent_code_qa_v1", - "system_prompt_version": "v1" - }, - "timings_ms": { - "prompt_build": 0, - "llm_call": 5268 - } - } - } - ] - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/router_only_smoke/20260312_082745/full_chain_smoke_full_chain_explain_order_service.md b/tests/pipeline_setup_v2/test_results/router_only_smoke/20260312_082745/full_chain_smoke_full_chain_explain_order_service.md deleted file mode 100644 index d714aae..0000000 --- a/tests/pipeline_setup_v2/test_results/router_only_smoke/20260312_082745/full_chain_smoke_full_chain_explain_order_service.md +++ /dev/null @@ -1,34 +0,0 @@ -# full_chain_explain_order_service - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_smoke.yaml -- runner: runtime -- mode: full_chain -- passed: True - -## Query -Как работает OrderService? - -## Actual -{ - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 15, - "llm_answer": "## Архитектура и Поведение `OrderService`\n\n### Описание\n\n`OrderService` является основным компонентом сервиса заказа в приложении. Он отвечает за управление жизненным циклом заказов и взаимодействие с другими сущностями приложения через интерфейс репозитория (`OrderRepository`).\n\n### Ключевые компоненты и их роль\n\n1. **OrderService**\n - **Роль**: Сервисный компонент, который управляет основными операциями заказа.\n - **Ответственность**:\n - Чтение и запись состояния атрибутов заказа.\n - Участие в данных потоков (dataflow slices).\n \n2. **Order**\n - Представляет заказ как объект с состоянием и атрибутами.\n\n3. **OrderRepository**\n - Репозиторий для хранения и управления данными о заказе.\n - Обеспечивает доступ к данным о заказах из базы данных или другого хранилища.\n\n### Поток данных и логика работы\n\n#### Инициализация OrderService\n\nПри создании экземпляра класса `OrderService`, выполняется следующая последовательность действий:\n\n```python\ndef __init__(self):\n self._repo = OrderRepository() # Инициализируем репозиторий заказов\n```\n\nТаким образом, создается экземпляр репозитория заказов, который будет использоваться при выполнении операций над заказами.\n\n#### Основные операции\n\n##### Получение существующего заказа\n\nМетод `get_order` позволяет получить информацию о существующем заказе из репозитория:\n\n```python\ndef get_order(self, order_id):\n return self._repo.find_by_id(order_id) # Вызываем метод репозитория для поиска заказа по идентификатору\n```\n\n##### Создание нового заказа\n\nМетод `create_order` создает новый заказ и сохраняет его в репозитории:\n\n```python\ndef create_order(self, new_order_data):\n order = Order(**new_order_data) # Создаем новый заказ на основе переданных данных\n self._repo.save(order) # Сохраняем заказ в репозитории\n```\n\n### Итоговое описание поведения\n\n`OrderService` предоставляет сервисы для взаимодействия с заказами. При инициализации создается репозиторий заказов, который используется для чтения и записи информации о заказах. Основной функционал включает получение существующих заказов и создание новых заказов. Эти действия реализуются методами `get_order` и `create_order`.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "OrderService" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] -} - -## Mismatches -- none \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/router_only_smoke/20260312_082745/router_only_smoke_router_only_docs_question.json b/tests/pipeline_setup_v2/test_results/router_only_smoke/20260312_082745/router_only_smoke_router_only_docs_question.json deleted file mode 100644 index 6480133..0000000 --- a/tests/pipeline_setup_v2/test_results/router_only_smoke/20260312_082745/router_only_smoke_router_only_docs_question.json +++ /dev/null @@ -1,228 +0,0 @@ -{ - "case_id": "router_only_docs_question", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/router_only_smoke.yaml", - "runner": "runtime", - "mode": "router_only", - "actual": { - "intent": "DOCS_QA", - "sub_intent": "EXPLAIN", - "graph_id": "DocsQAGraph", - "conversation_mode": "START", - "rag_count": 0, - "llm_answer": "", - "answer_mode": "partial", - "path_scope": [], - "symbol_candidates": [], - "layers": [ - "D1_MODULE_CATALOG", - "D2_FACT_INDEX", - "D3_SECTION_INDEX", - "D4_POLICY_INDEX" - ] - }, - "passed": true, - "mismatches": [], - "details": { - "case_id": "router_only_docs_question", - "text": "Что сказано в README?", - "mode": "router_only", - "run_started_at": "2026-03-12T08:27:46", - "rag_session_id": null, - "expected_intent": "DOCS_QA", - "actual_intent": "DOCS_QA", - "graph_id": "DocsQAGraph", - "conversation_mode": "START", - "query": "Что сказано в README?", - "symbol_resolution": { - "status": "not_requested", - "resolved_symbol": null, - "alternatives": [], - "confidence": 0.0 - }, - "rag_count": 0, - "rag_rows": [], - "llm_answer": null, - "summary": { - "router": { - "intent": "DOCS_QA", - "sub_intent": "EXPLAIN", - "confidence": null - }, - "retrieval": { - "profile": "docs", - "layers_hit": [], - "evidence_sufficient": false - }, - "llm": { - "answer_status": "partial", - "groundedness": "not_applicable" - } - }, - "diagnostics": { - "router_plan": { - "intent": "DOCS_QA", - "sub_intent": "EXPLAIN", - "graph_id": "DocsQAGraph", - "retrieval_profile": "docs", - "conversation_mode": "START", - "layers": [ - "D1_MODULE_CATALOG", - "D2_FACT_INDEX", - "D3_SECTION_INDEX", - "D4_POLICY_INDEX" - ], - "symbol_kind_hint": "unknown", - "symbol_candidates": [], - "keyword_hints": [ - "README" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [ - "README*", - "docs/**", - "**/*.md", - "README" - ], - "retrieval_constraints": { - "include_globs": [ - "docs/**", - "README*", - "**/*.md" - ], - "exclude_globs": [ - ".venv/**", - "node_modules/**", - "**/*.bin", - "**/*.png", - "**/*.jpg" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "execution": { - "executed_layers": [], - "retrieval_mode_by_layer": {}, - "top_k_by_layer": {}, - "filters_by_layer": {}, - "repo_scope": { - "repo_id": null, - "workspace_id": null - } - }, - "retrieval": null, - "constraint_violations": [], - "timings_ms": { - "router": 0, - "symbol_resolution": 0, - "retrieval_total": 0, - "retrieval_by_layer": {}, - "merge_rank": 0, - "prompt_build": 0, - "llm_call": 0 - }, - "prompt": null, - "router": { - "conversation_mode": "START", - "keyword_hints": [ - "README" - ], - "path_scope": [] - }, - "llm": { - "used_evidence_count": 0, - "missing_evidence_reason": null - } - }, - "run_info": { - "case_id": "router_only_docs_question", - "mode": "router_only", - "run_started_at": "2026-03-12T08:27:46", - "rag_session_id": null, - "expected_intent": "DOCS_QA", - "actual_intent": "DOCS_QA", - "graph_id": "DocsQAGraph", - "conversation_mode": "START" - }, - "input_request": { - "text": "Что сказано в README?", - "normalized_query": "Что сказано в README?" - }, - "steps": [ - { - "step": "intent_router", - "input": { - "query": "Что сказано в README?" - }, - "output": { - "intent": "DOCS_QA", - "graph_id": "DocsQAGraph", - "conversation_mode": "START", - "query": "Что сказано в README?" - }, - "diagnostics": { - "router_plan": { - "intent": "DOCS_QA", - "sub_intent": "EXPLAIN", - "graph_id": "DocsQAGraph", - "retrieval_profile": "docs", - "conversation_mode": "START", - "layers": [ - "D1_MODULE_CATALOG", - "D2_FACT_INDEX", - "D3_SECTION_INDEX", - "D4_POLICY_INDEX" - ], - "symbol_kind_hint": "unknown", - "symbol_candidates": [], - "keyword_hints": [ - "README" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [ - "README*", - "docs/**", - "**/*.md", - "README" - ], - "retrieval_constraints": { - "include_globs": [ - "docs/**", - "README*", - "**/*.md" - ], - "exclude_globs": [ - ".venv/**", - "node_modules/**", - "**/*.bin", - "**/*.png", - "**/*.jpg" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "timings_ms": { - "router": 0 - } - } - } - ] - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/router_only_smoke/20260312_082745/router_only_smoke_router_only_docs_question.md b/tests/pipeline_setup_v2/test_results/router_only_smoke/20260312_082745/router_only_smoke_router_only_docs_question.md deleted file mode 100644 index 253c7d9..0000000 --- a/tests/pipeline_setup_v2/test_results/router_only_smoke/20260312_082745/router_only_smoke_router_only_docs_question.md +++ /dev/null @@ -1,31 +0,0 @@ -# router_only_docs_question - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/router_only_smoke.yaml -- runner: runtime -- mode: router_only -- passed: True - -## Query -Что сказано в README? - -## Actual -{ - "intent": "DOCS_QA", - "sub_intent": "EXPLAIN", - "graph_id": "DocsQAGraph", - "conversation_mode": "START", - "rag_count": 0, - "llm_answer": "", - "answer_mode": "partial", - "path_scope": [], - "symbol_candidates": [], - "layers": [ - "D1_MODULE_CATALOG", - "D2_FACT_INDEX", - "D3_SECTION_INDEX", - "D4_POLICY_INDEX" - ] -} - -## Mismatches -- none \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/router_only_smoke/20260312_082745/router_only_smoke_router_only_open_fixture_main.json b/tests/pipeline_setup_v2/test_results/router_only_smoke/20260312_082745/router_only_smoke_router_only_open_fixture_main.json deleted file mode 100644 index 08e121f..0000000 --- a/tests/pipeline_setup_v2/test_results/router_only_smoke/20260312_082745/router_only_smoke_router_only_open_fixture_main.json +++ /dev/null @@ -1,207 +0,0 @@ -{ - "case_id": "router_only_open_fixture_main", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/router_only_smoke.yaml", - "runner": "runtime", - "mode": "router_only", - "actual": { - "intent": "CODE_QA", - "sub_intent": "OPEN_FILE", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 0, - "llm_answer": "", - "answer_mode": "partial", - "path_scope": [ - "main.py" - ], - "symbol_candidates": [], - "layers": [ - "C0_SOURCE_CHUNKS" - ] - }, - "passed": true, - "mismatches": [], - "details": { - "case_id": "router_only_open_fixture_main", - "text": "Открой файл main.py", - "mode": "router_only", - "run_started_at": "2026-03-12T08:27:46", - "rag_session_id": null, - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Открой файл main.py", - "symbol_resolution": { - "status": "not_requested", - "resolved_symbol": null, - "alternatives": [], - "confidence": 0.0 - }, - "rag_count": 0, - "rag_rows": [], - "llm_answer": null, - "summary": { - "router": { - "intent": "CODE_QA", - "sub_intent": "OPEN_FILE", - "confidence": null - }, - "retrieval": { - "profile": "code", - "layers_hit": [], - "evidence_sufficient": false - }, - "llm": { - "answer_status": "partial", - "groundedness": "not_applicable" - } - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "OPEN_FILE", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C0_SOURCE_CHUNKS" - ], - "symbol_kind_hint": "unknown", - "symbol_candidates": [], - "keyword_hints": [], - "path_hints": [ - "main.py" - ], - "path_scope": [ - "main.py" - ], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "main.py" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": false, - "max_distance": 2, - "top_k": 5 - } - } - }, - "execution": { - "executed_layers": [], - "retrieval_mode_by_layer": {}, - "top_k_by_layer": {}, - "filters_by_layer": {}, - "repo_scope": { - "repo_id": null, - "workspace_id": null - } - }, - "retrieval": null, - "constraint_violations": [], - "timings_ms": { - "router": 0, - "symbol_resolution": 0, - "retrieval_total": 0, - "retrieval_by_layer": {}, - "merge_rank": 0, - "prompt_build": 0, - "llm_call": 0 - }, - "prompt": null, - "router": { - "conversation_mode": "START", - "keyword_hints": [], - "path_scope": [ - "main.py" - ] - }, - "llm": { - "used_evidence_count": 0, - "missing_evidence_reason": null - } - }, - "run_info": { - "case_id": "router_only_open_fixture_main", - "mode": "router_only", - "run_started_at": "2026-03-12T08:27:46", - "rag_session_id": null, - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - }, - "input_request": { - "text": "Открой файл main.py", - "normalized_query": "Открой файл main.py" - }, - "steps": [ - { - "step": "intent_router", - "input": { - "query": "Открой файл main.py" - }, - "output": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Открой файл main.py" - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "OPEN_FILE", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C0_SOURCE_CHUNKS" - ], - "symbol_kind_hint": "unknown", - "symbol_candidates": [], - "keyword_hints": [], - "path_hints": [ - "main.py" - ], - "path_scope": [ - "main.py" - ], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "main.py" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": false, - "max_distance": 2, - "top_k": 5 - } - } - }, - "timings_ms": { - "router": 0 - } - } - } - ] - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/router_only_smoke/20260312_082745/router_only_smoke_router_only_open_fixture_main.md b/tests/pipeline_setup_v2/test_results/router_only_smoke/20260312_082745/router_only_smoke_router_only_open_fixture_main.md deleted file mode 100644 index 658643b..0000000 --- a/tests/pipeline_setup_v2/test_results/router_only_smoke/20260312_082745/router_only_smoke_router_only_open_fixture_main.md +++ /dev/null @@ -1,30 +0,0 @@ -# router_only_open_fixture_main - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/router_only_smoke.yaml -- runner: runtime -- mode: router_only -- passed: True - -## Query -Открой файл main.py - -## Actual -{ - "intent": "CODE_QA", - "sub_intent": "OPEN_FILE", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 0, - "llm_answer": "", - "answer_mode": "partial", - "path_scope": [ - "main.py" - ], - "symbol_candidates": [], - "layers": [ - "C0_SOURCE_CHUNKS" - ] -} - -## Mismatches -- none \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/router_only_smoke/20260312_082745/router_rag_smoke_router_rag_explain_order.json b/tests/pipeline_setup_v2/test_results/router_only_smoke/20260312_082745/router_rag_smoke_router_rag_explain_order.json deleted file mode 100644 index 31ae3e9..0000000 --- a/tests/pipeline_setup_v2/test_results/router_only_smoke/20260312_082745/router_rag_smoke_router_rag_explain_order.json +++ /dev/null @@ -1,2111 +0,0 @@ -{ - "case_id": "router_rag_explain_order", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/router_rag_smoke.yaml", - "runner": "runtime", - "mode": "router_rag", - "actual": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 15, - "llm_answer": "", - "answer_mode": "partial", - "path_scope": [], - "symbol_candidates": [ - "Order" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "passed": true, - "mismatches": [], - "details": { - "case_id": "router_rag_explain_order", - "text": "Объясни класс Order", - "mode": "router_rag", - "run_started_at": "2026-03-12T08:27:46", - "rag_session_id": "c224dbc0-132c-4fd7-a106-3684df6455e1", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Объясни класс Order", - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "Order", - "alternatives": [ - "Order" - ], - "confidence": 0.99 - }, - "rag_count": 15, - "rag_rows": [ - { - "path": "src/order_app/domain/order.py", - "content": "class Order\nOrder", - "layer": "C1_SYMBOL_CATALOG", - "title": "Order", - "span_start": 6, - "span_end": 11, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "b60768ee227c0dc0caca658c2eafcbad554f462e363734f5c4f597dd4d413f5c", - "qname": "Order", - "kind": "class", - "signature": "Order", - "parent_symbol_id": null, - "package_or_module": "src.order_app.domain.order", - "is_test": false, - "blob_sha": "f2a88a24ade1930ed3e1bedf66ea7e9ef825f10fe4ee830a233fb7911ef32626", - "repo_id": "code_qa_repo_runtime", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/order_app/domain/order.py", - "content": "Order\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes", - "layer": "C4_SEMANTIC_ROLES", - "title": "Order", - "span_start": 6, - "span_end": 11, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 31, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "b60768ee227c0dc0caca658c2eafcbad554f462e363734f5c4f597dd4d413f5c", - "symbol_name": "Order", - "qname": "Order", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "f2a88a24ade1930ed3e1bedf66ea7e9ef825f10fe4ee830a233fb7911ef32626", - "repo_id": "code_qa_repo_runtime", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/order_app/repositories/order_repository.py", - "content": "OrderRepository\nrole: repository\n\nResponsibilities:\n- name suffix suggests repository", - "layer": "C4_SEMANTIC_ROLES", - "title": "OrderRepository", - "span_start": 6, - "span_end": 14, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 36, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "4ff9dd82d0e928179af4cc55bcab5b1082be515832a6c92978b54779539c4a48", - "symbol_name": "OrderRepository", - "qname": "OrderRepository", - "role": "repository", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "a9a07d097b3a075dc55ede70766180dff42f2165ac73c791ad024f46db27b9f2", - "repo_id": "code_qa_repo_runtime", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/order_app/services/order_service.py", - "content": "OrderService\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests service\n- reads and writes state attributes\n- participates in dataflow slices (2)", - "layer": "C4_SEMANTIC_ROLES", - "title": "OrderService", - "span_start": 7, - "span_end": 16, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 71, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "42b4f9dfe7edcf06b3ad38543ad457eb56b88834f0d114cb6e18872b7306e62c", - "symbol_name": "OrderService", - "qname": "OrderService", - "role": "pipeline_stage", - "confidence": 0.57, - "dataflow_participation": 2, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "ae64718f6a024640edf9c936f72e5954897442af3840f7429a2d514128ce2447", - "repo_id": "code_qa_repo_runtime", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/order_app/services/order_service.py", - "content": "OrderService.__init__\n -> OrderService._repo\n -> OrderService.get_order", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "OrderService.__init__:dataflow_slice", - "span_start": 9, - "span_end": 16, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "9f06b4fc5cc95467d5dc324689b15228600bc31ee0a53dae49f9aab490ec4ee3", - "edge_type": "dataflow_slice", - "src_symbol_id": "0ea1a03958593fe152e67e8c49837b3a7a69a6d0a65fa04e97ad7a2209655b4e", - "src_qname": "OrderService.__init__", - "dst_symbol_id": "2b0346b72716cf0289a80089ca36ae37ec9c0ae387850f5ca4b5e79d2f6e500e", - "dst_ref": "OrderService.get_order", - "resolution": "resolved", - "slice_id": "9f06b4fc5cc95467d5dc324689b15228600bc31ee0a53dae49f9aab490ec4ee3", - "root_symbol_id": "0ea1a03958593fe152e67e8c49837b3a7a69a6d0a65fa04e97ad7a2209655b4e", - "path_symbols": [ - "OrderService.__init__", - "OrderService._repo", - "OrderService.get_order" - ], - "path_symbol_ids": [ - "0ea1a03958593fe152e67e8c49837b3a7a69a6d0a65fa04e97ad7a2209655b4e", - "2b0346b72716cf0289a80089ca36ae37ec9c0ae387850f5ca4b5e79d2f6e500e" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "ae64718f6a024640edf9c936f72e5954897442af3840f7429a2d514128ce2447", - "repo_id": "code_qa_repo_runtime", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/order_app/services/order_service.py", - "content": "OrderService.__init__\n -> OrderService._repo\n -> OrderService.create_order", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "OrderService.__init__:dataflow_slice", - "span_start": 9, - "span_end": 13, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "7f1d6f7110575a74f1a7153db3a16f80ee81e0c9d56aee502dbe58cf6017e0c8", - "edge_type": "dataflow_slice", - "src_symbol_id": "0ea1a03958593fe152e67e8c49837b3a7a69a6d0a65fa04e97ad7a2209655b4e", - "src_qname": "OrderService.__init__", - "dst_symbol_id": "830ecc3aea935f4787cde49b096954d26c88d3b0a050003c7b1e77287d18ed49", - "dst_ref": "OrderService.create_order", - "resolution": "resolved", - "slice_id": "7f1d6f7110575a74f1a7153db3a16f80ee81e0c9d56aee502dbe58cf6017e0c8", - "root_symbol_id": "0ea1a03958593fe152e67e8c49837b3a7a69a6d0a65fa04e97ad7a2209655b4e", - "path_symbols": [ - "OrderService.__init__", - "OrderService._repo", - "OrderService.create_order" - ], - "path_symbol_ids": [ - "0ea1a03958593fe152e67e8c49837b3a7a69a6d0a65fa04e97ad7a2209655b4e", - "830ecc3aea935f4787cde49b096954d26c88d3b0a050003c7b1e77287d18ed49" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "ae64718f6a024640edf9c936f72e5954897442af3840f7429a2d514128ce2447", - "repo_id": "code_qa_repo_runtime", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/order_app/domain/order.py", - "content": "Order.__init__ calls str", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "Order.__init__:calls", - "span_start": 8, - "span_end": 8, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "afa121e7984a7d20f5ab88ea5251ae74b3d1823a684c2faaa62a08d4c2a070c0", - "edge_type": "calls", - "src_symbol_id": "86fda5e23a666d7f72ef79ded051a2c767aff487ef3183a14eae2006dab0f285", - "src_qname": "Order.__init__", - "dst_symbol_id": null, - "dst_ref": "str", - "resolution": "partial", - "is_test": false, - "blob_sha": "f2a88a24ade1930ed3e1bedf66ea7e9ef825f10fe4ee830a233fb7911ef32626", - "repo_id": "code_qa_repo_runtime", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/order_app/domain/order.py", - "content": "Order.__init__ writes_attr Order.product_id", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "Order.__init__:writes_attr", - "span_start": 9, - "span_end": 9, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "8589c20fc4c9066bec24edf3fd01207d13e64a786ff56ebd19fbaeddf696fd0c", - "edge_type": "writes_attr", - "src_symbol_id": "86fda5e23a666d7f72ef79ded051a2c767aff487ef3183a14eae2006dab0f285", - "src_qname": "Order.__init__", - "dst_symbol_id": null, - "dst_ref": "Order.product_id", - "resolution": "partial", - "is_test": false, - "blob_sha": "f2a88a24ade1930ed3e1bedf66ea7e9ef825f10fe4ee830a233fb7911ef32626", - "repo_id": "code_qa_repo_runtime", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/order_app/domain/order.py", - "content": "Order.__init__ writes_attr Order.status", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "Order.__init__:writes_attr", - "span_start": 11, - "span_end": 11, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "1500e4d8e532efafd8fe01ee033ddceffc80ff013ef6353dba9c90f527aaaf0f", - "edge_type": "writes_attr", - "src_symbol_id": "86fda5e23a666d7f72ef79ded051a2c767aff487ef3183a14eae2006dab0f285", - "src_qname": "Order.__init__", - "dst_symbol_id": null, - "dst_ref": "Order.status", - "resolution": "partial", - "is_test": false, - "blob_sha": "f2a88a24ade1930ed3e1bedf66ea7e9ef825f10fe4ee830a233fb7911ef32626", - "repo_id": "code_qa_repo_runtime", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/order_app/domain/order.py", - "content": "Order.__init__ writes_attr Order.id", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "Order.__init__:writes_attr", - "span_start": 8, - "span_end": 8, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "89b59cc43b6c2346674a947ae3ca4bc117b44361e03adc41f6d124cdfd8a6620", - "edge_type": "writes_attr", - "src_symbol_id": "86fda5e23a666d7f72ef79ded051a2c767aff487ef3183a14eae2006dab0f285", - "src_qname": "Order.__init__", - "dst_symbol_id": null, - "dst_ref": "Order.id", - "resolution": "partial", - "is_test": false, - "blob_sha": "f2a88a24ade1930ed3e1bedf66ea7e9ef825f10fe4ee830a233fb7911ef32626", - "repo_id": "code_qa_repo_runtime", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/order_app/api/orders.py", - "content": "create_app.get_order\n -> jsonify", - "layer": "C3_ENTRYPOINTS", - "title": "create_app.get_order:execution_trace", - "span_start": 3, - "span_end": 28, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 2, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "edge_id": "a1a3ed8655ca7992651e6a480d2a9b8b1a6081ed4fafc6b218a6b9db03d3f829", - "edge_type": "execution_trace", - "src_symbol_id": "087d884b60e3cd267f285f861c866b84768a56e07e693e71c460a67aa099eb65", - "src_qname": "create_app.get_order", - "dst_symbol_id": "66d26c57dd7a75745acf1cd3e825f74cc312bafc7fc90619b1a6d25fcde57efd", - "dst_ref": "jsonify", - "resolution": "resolved", - "trace_id": "a1a3ed8655ca7992651e6a480d2a9b8b1a6081ed4fafc6b218a6b9db03d3f829", - "entry_id": "0c15b2acb96e575fc73553b943025314dd58c6f6dcb969b698e6a704a1c0e69d", - "entry_symbol_id": "087d884b60e3cd267f285f861c866b84768a56e07e693e71c460a67aa099eb65", - "path_symbols": [ - "create_app.get_order", - "jsonify" - ], - "path_symbol_ids": [ - "087d884b60e3cd267f285f861c866b84768a56e07e693e71c460a67aa099eb65", - "66d26c57dd7a75745acf1cd3e825f74cc312bafc7fc90619b1a6d25fcde57efd" - ], - "path_length": 2, - "is_test": false, - "blob_sha": "02fcc02cabba2c3659fb06047892e602e773619ea0be8c96d048701035b950a7", - "repo_id": "code_qa_repo_runtime", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/order_app/api/orders.py", - "content": "create_app.create_order\n -> jsonify", - "layer": "C3_ENTRYPOINTS", - "title": "create_app.create_order:execution_trace", - "span_start": 3, - "span_end": 21, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 2, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "edge_id": "95a9ec7cfc456854d50b78db55737a140085fe398414f9166494cb4eddfa6ef5", - "edge_type": "execution_trace", - "src_symbol_id": "9b7d3951f6099cb9c6eca7c8fce1caf659b82ef5f67e6dc8e26c6277af011473", - "src_qname": "create_app.create_order", - "dst_symbol_id": "66d26c57dd7a75745acf1cd3e825f74cc312bafc7fc90619b1a6d25fcde57efd", - "dst_ref": "jsonify", - "resolution": "resolved", - "trace_id": "95a9ec7cfc456854d50b78db55737a140085fe398414f9166494cb4eddfa6ef5", - "entry_id": "0212a881f45888e5b6467d0731b8d5dd04500b5f0679dcff450e5891ea14e20f", - "entry_symbol_id": "9b7d3951f6099cb9c6eca7c8fce1caf659b82ef5f67e6dc8e26c6277af011473", - "path_symbols": [ - "create_app.create_order", - "jsonify" - ], - "path_symbol_ids": [ - "9b7d3951f6099cb9c6eca7c8fce1caf659b82ef5f67e6dc8e26c6277af011473", - "66d26c57dd7a75745acf1cd3e825f74cc312bafc7fc90619b1a6d25fcde57efd" - ], - "path_length": 2, - "is_test": false, - "blob_sha": "02fcc02cabba2c3659fb06047892e602e773619ea0be8c96d048701035b950a7", - "repo_id": "code_qa_repo_runtime", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/order_app/api/orders.py", - "content": "fastapi http app.route", - "layer": "C3_ENTRYPOINTS", - "title": "app.route", - "span_start": 15, - "span_end": 21, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "0212a881f45888e5b6467d0731b8d5dd04500b5f0679dcff450e5891ea14e20f", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.route", - "handler_symbol_id": "9b7d3951f6099cb9c6eca7c8fce1caf659b82ef5f67e6dc8e26c6277af011473", - "is_test": false, - "lang_payload": { - "methods": [] - }, - "artifact_type": null, - "blob_sha": "02fcc02cabba2c3659fb06047892e602e773619ea0be8c96d048701035b950a7", - "repo_id": "code_qa_repo_runtime", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/order_app/api/orders.py", - "content": "fastapi http app.route", - "layer": "C3_ENTRYPOINTS", - "title": "app.route", - "span_start": 24, - "span_end": 28, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "864ea5b326fb62dc34d91b9968f4e3f85e457b0a586ec8c30bf36a5893373d52", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.route", - "handler_symbol_id": "087d884b60e3cd267f285f861c866b84768a56e07e693e71c460a67aa099eb65", - "is_test": false, - "lang_payload": { - "methods": [] - }, - "artifact_type": null, - "blob_sha": "02fcc02cabba2c3659fb06047892e602e773619ea0be8c96d048701035b950a7", - "repo_id": "code_qa_repo_runtime", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/order_app/domain/order.py", - "content": "class Order:\n def __init__(self, product_id: str = \"\", quantity: int = 1) -> None:\n self.id = str(uuid.uuid4())\n self.product_id = product_id\n self.quantity = quantity\n self.status = \"pending\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/order_app/domain/order.py:Order", - "span_start": 6, - "span_end": 11, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.order_app.domain.order", - "is_test": false, - "blob_sha": "f2a88a24ade1930ed3e1bedf66ea7e9ef825f10fe4ee830a233fb7911ef32626", - "repo_id": "code_qa_repo_runtime", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "llm_answer": null, - "summary": { - "router": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "confidence": null - }, - "retrieval": { - "profile": "code", - "layers_hit": [ - "C0_SOURCE_CHUNKS", - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS", - "C4_SEMANTIC_ROLES" - ], - "evidence_sufficient": true - }, - "llm": { - "answer_status": "partial", - "groundedness": "not_applicable" - } - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "Order" - ], - "keyword_hints": [ - "Order" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C0_SOURCE_CHUNKS": "exact_path_fetch", - "C4_SEMANTIC_ROLES": "exact_path_fetch", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C3_ENTRYPOINTS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 8, - "C4_SEMANTIC_ROLES": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C3_ENTRYPOINTS": 6 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C4_SEMANTIC_ROLES": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "code_qa_repo_runtime", - "workspace_id": "None", - "returned_repo_ids": [ - "code_qa_repo_runtime" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "Order", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Объясни класс Order", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C4_SEMANTIC_ROLES", - "query": "Объясни класс Order", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "Объясни класс Order", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - }, - { - "layer": "C3_ENTRYPOINTS", - "query": "Объясни класс Order", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 1, - "candidates_after_filter": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 3, - "candidates_after_filter": 3 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 6, - "candidates_after_filter": 6 - }, - { - "layer": "C3_ENTRYPOINTS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 6, - "candidates_after_filter": 6 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "Order", - "alternatives": [ - "Order" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C4_SEMANTIC_ROLES", - "status": "hit", - "hit_count": 3, - "fail_reason": null - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 6, - "fail_reason": null - }, - { - "layer": "C3_ENTRYPOINTS", - "status": "hit", - "hit_count": 4, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "router": 0, - "symbol_resolution": 0, - "retrieval_total": 44, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 7, - "C0_SOURCE_CHUNKS": 8, - "C4_SEMANTIC_ROLES": 7, - "C2_DEPENDENCY_GRAPH": 7, - "C3_ENTRYPOINTS": 6 - }, - "merge_rank": 12, - "prompt_build": 0, - "llm_call": 0 - }, - "prompt": null, - "router": { - "conversation_mode": "START", - "keyword_hints": [ - "Order" - ], - "path_scope": [] - }, - "llm": { - "used_evidence_count": 15, - "missing_evidence_reason": null - } - }, - "run_info": { - "case_id": "router_rag_explain_order", - "mode": "router_rag", - "run_started_at": "2026-03-12T08:27:46", - "rag_session_id": "c224dbc0-132c-4fd7-a106-3684df6455e1", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - }, - "input_request": { - "text": "Объясни класс Order", - "normalized_query": "Объясни класс Order" - }, - "steps": [ - { - "step": "intent_router", - "input": { - "query": "Объясни класс Order" - }, - "output": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Объясни класс Order" - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "symbol_kind_hint": "class", - "symbol_candidates": [ - "Order" - ], - "keyword_hints": [ - "Order" - ], - "path_hints": [], - "path_scope": [], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - } - }, - "timings_ms": { - "router": 0 - } - } - }, - { - "step": "retrieval", - "input": { - "query": "Объясни класс Order" - }, - "output": { - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "Order", - "alternatives": [ - "Order" - ], - "confidence": 0.99 - }, - "rag_count": 15, - "rag_rows": [ - { - "path": "src/order_app/domain/order.py", - "content": "class Order\nOrder", - "layer": "C1_SYMBOL_CATALOG", - "title": "Order", - "span_start": 6, - "span_end": 11, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "b60768ee227c0dc0caca658c2eafcbad554f462e363734f5c4f597dd4d413f5c", - "qname": "Order", - "kind": "class", - "signature": "Order", - "parent_symbol_id": null, - "package_or_module": "src.order_app.domain.order", - "is_test": false, - "blob_sha": "f2a88a24ade1930ed3e1bedf66ea7e9ef825f10fe4ee830a233fb7911ef32626", - "repo_id": "code_qa_repo_runtime", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/order_app/domain/order.py", - "content": "Order\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes", - "layer": "C4_SEMANTIC_ROLES", - "title": "Order", - "span_start": 6, - "span_end": 11, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 31, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "b60768ee227c0dc0caca658c2eafcbad554f462e363734f5c4f597dd4d413f5c", - "symbol_name": "Order", - "qname": "Order", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "f2a88a24ade1930ed3e1bedf66ea7e9ef825f10fe4ee830a233fb7911ef32626", - "repo_id": "code_qa_repo_runtime", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/order_app/repositories/order_repository.py", - "content": "OrderRepository\nrole: repository\n\nResponsibilities:\n- name suffix suggests repository", - "layer": "C4_SEMANTIC_ROLES", - "title": "OrderRepository", - "span_start": 6, - "span_end": 14, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 36, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "4ff9dd82d0e928179af4cc55bcab5b1082be515832a6c92978b54779539c4a48", - "symbol_name": "OrderRepository", - "qname": "OrderRepository", - "role": "repository", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "a9a07d097b3a075dc55ede70766180dff42f2165ac73c791ad024f46db27b9f2", - "repo_id": "code_qa_repo_runtime", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/order_app/services/order_service.py", - "content": "OrderService\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests service\n- reads and writes state attributes\n- participates in dataflow slices (2)", - "layer": "C4_SEMANTIC_ROLES", - "title": "OrderService", - "span_start": 7, - "span_end": 16, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 71, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "42b4f9dfe7edcf06b3ad38543ad457eb56b88834f0d114cb6e18872b7306e62c", - "symbol_name": "OrderService", - "qname": "OrderService", - "role": "pipeline_stage", - "confidence": 0.57, - "dataflow_participation": 2, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "ae64718f6a024640edf9c936f72e5954897442af3840f7429a2d514128ce2447", - "repo_id": "code_qa_repo_runtime", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/order_app/services/order_service.py", - "content": "OrderService.__init__\n -> OrderService._repo\n -> OrderService.get_order", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "OrderService.__init__:dataflow_slice", - "span_start": 9, - "span_end": 16, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "9f06b4fc5cc95467d5dc324689b15228600bc31ee0a53dae49f9aab490ec4ee3", - "edge_type": "dataflow_slice", - "src_symbol_id": "0ea1a03958593fe152e67e8c49837b3a7a69a6d0a65fa04e97ad7a2209655b4e", - "src_qname": "OrderService.__init__", - "dst_symbol_id": "2b0346b72716cf0289a80089ca36ae37ec9c0ae387850f5ca4b5e79d2f6e500e", - "dst_ref": "OrderService.get_order", - "resolution": "resolved", - "slice_id": "9f06b4fc5cc95467d5dc324689b15228600bc31ee0a53dae49f9aab490ec4ee3", - "root_symbol_id": "0ea1a03958593fe152e67e8c49837b3a7a69a6d0a65fa04e97ad7a2209655b4e", - "path_symbols": [ - "OrderService.__init__", - "OrderService._repo", - "OrderService.get_order" - ], - "path_symbol_ids": [ - "0ea1a03958593fe152e67e8c49837b3a7a69a6d0a65fa04e97ad7a2209655b4e", - "2b0346b72716cf0289a80089ca36ae37ec9c0ae387850f5ca4b5e79d2f6e500e" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "ae64718f6a024640edf9c936f72e5954897442af3840f7429a2d514128ce2447", - "repo_id": "code_qa_repo_runtime", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/order_app/services/order_service.py", - "content": "OrderService.__init__\n -> OrderService._repo\n -> OrderService.create_order", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "OrderService.__init__:dataflow_slice", - "span_start": 9, - "span_end": 13, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "7f1d6f7110575a74f1a7153db3a16f80ee81e0c9d56aee502dbe58cf6017e0c8", - "edge_type": "dataflow_slice", - "src_symbol_id": "0ea1a03958593fe152e67e8c49837b3a7a69a6d0a65fa04e97ad7a2209655b4e", - "src_qname": "OrderService.__init__", - "dst_symbol_id": "830ecc3aea935f4787cde49b096954d26c88d3b0a050003c7b1e77287d18ed49", - "dst_ref": "OrderService.create_order", - "resolution": "resolved", - "slice_id": "7f1d6f7110575a74f1a7153db3a16f80ee81e0c9d56aee502dbe58cf6017e0c8", - "root_symbol_id": "0ea1a03958593fe152e67e8c49837b3a7a69a6d0a65fa04e97ad7a2209655b4e", - "path_symbols": [ - "OrderService.__init__", - "OrderService._repo", - "OrderService.create_order" - ], - "path_symbol_ids": [ - "0ea1a03958593fe152e67e8c49837b3a7a69a6d0a65fa04e97ad7a2209655b4e", - "830ecc3aea935f4787cde49b096954d26c88d3b0a050003c7b1e77287d18ed49" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "ae64718f6a024640edf9c936f72e5954897442af3840f7429a2d514128ce2447", - "repo_id": "code_qa_repo_runtime", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/order_app/domain/order.py", - "content": "Order.__init__ calls str", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "Order.__init__:calls", - "span_start": 8, - "span_end": 8, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "afa121e7984a7d20f5ab88ea5251ae74b3d1823a684c2faaa62a08d4c2a070c0", - "edge_type": "calls", - "src_symbol_id": "86fda5e23a666d7f72ef79ded051a2c767aff487ef3183a14eae2006dab0f285", - "src_qname": "Order.__init__", - "dst_symbol_id": null, - "dst_ref": "str", - "resolution": "partial", - "is_test": false, - "blob_sha": "f2a88a24ade1930ed3e1bedf66ea7e9ef825f10fe4ee830a233fb7911ef32626", - "repo_id": "code_qa_repo_runtime", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/order_app/domain/order.py", - "content": "Order.__init__ writes_attr Order.product_id", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "Order.__init__:writes_attr", - "span_start": 9, - "span_end": 9, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "8589c20fc4c9066bec24edf3fd01207d13e64a786ff56ebd19fbaeddf696fd0c", - "edge_type": "writes_attr", - "src_symbol_id": "86fda5e23a666d7f72ef79ded051a2c767aff487ef3183a14eae2006dab0f285", - "src_qname": "Order.__init__", - "dst_symbol_id": null, - "dst_ref": "Order.product_id", - "resolution": "partial", - "is_test": false, - "blob_sha": "f2a88a24ade1930ed3e1bedf66ea7e9ef825f10fe4ee830a233fb7911ef32626", - "repo_id": "code_qa_repo_runtime", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/order_app/domain/order.py", - "content": "Order.__init__ writes_attr Order.status", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "Order.__init__:writes_attr", - "span_start": 11, - "span_end": 11, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "1500e4d8e532efafd8fe01ee033ddceffc80ff013ef6353dba9c90f527aaaf0f", - "edge_type": "writes_attr", - "src_symbol_id": "86fda5e23a666d7f72ef79ded051a2c767aff487ef3183a14eae2006dab0f285", - "src_qname": "Order.__init__", - "dst_symbol_id": null, - "dst_ref": "Order.status", - "resolution": "partial", - "is_test": false, - "blob_sha": "f2a88a24ade1930ed3e1bedf66ea7e9ef825f10fe4ee830a233fb7911ef32626", - "repo_id": "code_qa_repo_runtime", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/order_app/domain/order.py", - "content": "Order.__init__ writes_attr Order.id", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "Order.__init__:writes_attr", - "span_start": 8, - "span_end": 8, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "89b59cc43b6c2346674a947ae3ca4bc117b44361e03adc41f6d124cdfd8a6620", - "edge_type": "writes_attr", - "src_symbol_id": "86fda5e23a666d7f72ef79ded051a2c767aff487ef3183a14eae2006dab0f285", - "src_qname": "Order.__init__", - "dst_symbol_id": null, - "dst_ref": "Order.id", - "resolution": "partial", - "is_test": false, - "blob_sha": "f2a88a24ade1930ed3e1bedf66ea7e9ef825f10fe4ee830a233fb7911ef32626", - "repo_id": "code_qa_repo_runtime", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/order_app/api/orders.py", - "content": "create_app.get_order\n -> jsonify", - "layer": "C3_ENTRYPOINTS", - "title": "create_app.get_order:execution_trace", - "span_start": 3, - "span_end": 28, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 2, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "edge_id": "a1a3ed8655ca7992651e6a480d2a9b8b1a6081ed4fafc6b218a6b9db03d3f829", - "edge_type": "execution_trace", - "src_symbol_id": "087d884b60e3cd267f285f861c866b84768a56e07e693e71c460a67aa099eb65", - "src_qname": "create_app.get_order", - "dst_symbol_id": "66d26c57dd7a75745acf1cd3e825f74cc312bafc7fc90619b1a6d25fcde57efd", - "dst_ref": "jsonify", - "resolution": "resolved", - "trace_id": "a1a3ed8655ca7992651e6a480d2a9b8b1a6081ed4fafc6b218a6b9db03d3f829", - "entry_id": "0c15b2acb96e575fc73553b943025314dd58c6f6dcb969b698e6a704a1c0e69d", - "entry_symbol_id": "087d884b60e3cd267f285f861c866b84768a56e07e693e71c460a67aa099eb65", - "path_symbols": [ - "create_app.get_order", - "jsonify" - ], - "path_symbol_ids": [ - "087d884b60e3cd267f285f861c866b84768a56e07e693e71c460a67aa099eb65", - "66d26c57dd7a75745acf1cd3e825f74cc312bafc7fc90619b1a6d25fcde57efd" - ], - "path_length": 2, - "is_test": false, - "blob_sha": "02fcc02cabba2c3659fb06047892e602e773619ea0be8c96d048701035b950a7", - "repo_id": "code_qa_repo_runtime", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/order_app/api/orders.py", - "content": "create_app.create_order\n -> jsonify", - "layer": "C3_ENTRYPOINTS", - "title": "create_app.create_order:execution_trace", - "span_start": 3, - "span_end": 21, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 2, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "edge_id": "95a9ec7cfc456854d50b78db55737a140085fe398414f9166494cb4eddfa6ef5", - "edge_type": "execution_trace", - "src_symbol_id": "9b7d3951f6099cb9c6eca7c8fce1caf659b82ef5f67e6dc8e26c6277af011473", - "src_qname": "create_app.create_order", - "dst_symbol_id": "66d26c57dd7a75745acf1cd3e825f74cc312bafc7fc90619b1a6d25fcde57efd", - "dst_ref": "jsonify", - "resolution": "resolved", - "trace_id": "95a9ec7cfc456854d50b78db55737a140085fe398414f9166494cb4eddfa6ef5", - "entry_id": "0212a881f45888e5b6467d0731b8d5dd04500b5f0679dcff450e5891ea14e20f", - "entry_symbol_id": "9b7d3951f6099cb9c6eca7c8fce1caf659b82ef5f67e6dc8e26c6277af011473", - "path_symbols": [ - "create_app.create_order", - "jsonify" - ], - "path_symbol_ids": [ - "9b7d3951f6099cb9c6eca7c8fce1caf659b82ef5f67e6dc8e26c6277af011473", - "66d26c57dd7a75745acf1cd3e825f74cc312bafc7fc90619b1a6d25fcde57efd" - ], - "path_length": 2, - "is_test": false, - "blob_sha": "02fcc02cabba2c3659fb06047892e602e773619ea0be8c96d048701035b950a7", - "repo_id": "code_qa_repo_runtime", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/order_app/api/orders.py", - "content": "fastapi http app.route", - "layer": "C3_ENTRYPOINTS", - "title": "app.route", - "span_start": 15, - "span_end": 21, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "0212a881f45888e5b6467d0731b8d5dd04500b5f0679dcff450e5891ea14e20f", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.route", - "handler_symbol_id": "9b7d3951f6099cb9c6eca7c8fce1caf659b82ef5f67e6dc8e26c6277af011473", - "is_test": false, - "lang_payload": { - "methods": [] - }, - "artifact_type": null, - "blob_sha": "02fcc02cabba2c3659fb06047892e602e773619ea0be8c96d048701035b950a7", - "repo_id": "code_qa_repo_runtime", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/order_app/api/orders.py", - "content": "fastapi http app.route", - "layer": "C3_ENTRYPOINTS", - "title": "app.route", - "span_start": 24, - "span_end": 28, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "864ea5b326fb62dc34d91b9968f4e3f85e457b0a586ec8c30bf36a5893373d52", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.route", - "handler_symbol_id": "087d884b60e3cd267f285f861c866b84768a56e07e693e71c460a67aa099eb65", - "is_test": false, - "lang_payload": { - "methods": [] - }, - "artifact_type": null, - "blob_sha": "02fcc02cabba2c3659fb06047892e602e773619ea0be8c96d048701035b950a7", - "repo_id": "code_qa_repo_runtime", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/order_app/domain/order.py", - "content": "class Order:\n def __init__(self, product_id: str = \"\", quantity: int = 1) -> None:\n self.id = str(uuid.uuid4())\n self.product_id = product_id\n self.quantity = quantity\n self.status = \"pending\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/order_app/domain/order.py:Order", - "span_start": 6, - "span_end": 11, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.order_app.domain.order", - "is_test": false, - "blob_sha": "f2a88a24ade1930ed3e1bedf66ea7e9ef825f10fe4ee830a233fb7911ef32626", - "repo_id": "code_qa_repo_runtime", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ] - }, - "diagnostics": { - "execution": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "symbol_search", - "C0_SOURCE_CHUNKS": "exact_path_fetch", - "C4_SEMANTIC_ROLES": "exact_path_fetch", - "C2_DEPENDENCY_GRAPH": "exact_path_fetch", - "C3_ENTRYPOINTS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 8, - "C4_SEMANTIC_ROLES": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C3_ENTRYPOINTS": 6 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C4_SEMANTIC_ROLES": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [ - "src" - ], - "include_globs": [ - "src" - ], - "exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "code_qa_repo_runtime", - "workspace_id": "None", - "returned_repo_ids": [ - "code_qa_repo_runtime" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C1_SYMBOL_CATALOG", - "query": "Order", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Объясни класс Order", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C4_SEMANTIC_ROLES", - "query": "Объясни класс Order", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 8, - "ranking_profile": "code" - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "query": "Объясни класс Order", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - }, - { - "layer": "C3_ENTRYPOINTS", - "query": "Объясни класс Order", - "path_scope": [], - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "top_k": 6, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C1_SYMBOL_CATALOG", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 1, - "candidates_after_filter": 1 - }, - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 8, - "candidates_after_filter": 8 - }, - { - "layer": "C4_SEMANTIC_ROLES", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 3, - "candidates_after_filter": 3 - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 6, - "candidates_after_filter": 6 - }, - { - "layer": "C3_ENTRYPOINTS", - "effective_path_scope": [ - "src" - ], - "normalized_include_globs": [ - "src" - ], - "normalized_exclude_globs": [ - "tests/", - "test/", - "__tests__/", - "mocks/", - "fixtures/", - "stubs/", - "tests" - ], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 6, - "candidates_after_filter": 6 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "Order", - "alternatives": [ - "Order" - ] - }, - "layers": [ - { - "layer": "C1_SYMBOL_CATALOG", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 1, - "fail_reason": null - }, - { - "layer": "C4_SEMANTIC_ROLES", - "status": "hit", - "hit_count": 3, - "fail_reason": null - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "status": "hit", - "hit_count": 6, - "fail_reason": null - }, - { - "layer": "C3_ENTRYPOINTS", - "status": "hit", - "hit_count": 4, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "symbol_resolution": 0, - "retrieval_total": 44, - "retrieval_by_layer": { - "C1_SYMBOL_CATALOG": 7, - "C0_SOURCE_CHUNKS": 8, - "C4_SEMANTIC_ROLES": 7, - "C2_DEPENDENCY_GRAPH": 7, - "C3_ENTRYPOINTS": 6 - }, - "merge_rank": 12 - } - } - } - ] - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/router_only_smoke/20260312_082745/router_rag_smoke_router_rag_explain_order.md b/tests/pipeline_setup_v2/test_results/router_only_smoke/20260312_082745/router_rag_smoke_router_rag_explain_order.md deleted file mode 100644 index 2d340ed..0000000 --- a/tests/pipeline_setup_v2/test_results/router_only_smoke/20260312_082745/router_rag_smoke_router_rag_explain_order.md +++ /dev/null @@ -1,34 +0,0 @@ -# router_rag_explain_order - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/router_rag_smoke.yaml -- runner: runtime -- mode: router_rag -- passed: True - -## Query -Объясни класс Order - -## Actual -{ - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 15, - "llm_answer": "", - "answer_mode": "partial", - "path_scope": [], - "symbol_candidates": [ - "Order" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] -} - -## Mismatches -- none \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/router_only_smoke/20260312_082745/router_rag_smoke_router_rag_open_fixture_main.json b/tests/pipeline_setup_v2/test_results/router_only_smoke/20260312_082745/router_rag_smoke_router_rag_open_fixture_main.json deleted file mode 100644 index d8970fd..0000000 --- a/tests/pipeline_setup_v2/test_results/router_only_smoke/20260312_082745/router_rag_smoke_router_rag_open_fixture_main.json +++ /dev/null @@ -1,445 +0,0 @@ -{ - "case_id": "router_rag_open_fixture_main", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/router_rag_smoke.yaml", - "runner": "runtime", - "mode": "router_rag", - "actual": { - "intent": "CODE_QA", - "sub_intent": "OPEN_FILE", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 1, - "llm_answer": "", - "answer_mode": "partial", - "path_scope": [ - "main.py" - ], - "symbol_candidates": [], - "layers": [ - "C0_SOURCE_CHUNKS" - ] - }, - "passed": true, - "mismatches": [], - "details": { - "case_id": "router_rag_open_fixture_main", - "text": "Открой файл main.py", - "mode": "router_rag", - "run_started_at": "2026-03-12T08:27:46", - "rag_session_id": "c224dbc0-132c-4fd7-a106-3684df6455e1", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Открой файл main.py", - "symbol_resolution": { - "status": "not_requested", - "resolved_symbol": null, - "alternatives": [], - "confidence": 0.0 - }, - "rag_count": 1, - "rag_rows": [ - { - "path": "main.py", - "content": "\"\"\"Entrypoint: runs the orders API. Uses src layout (package order_app under src/).\"\"\"\n\nimport sys\nfrom pathlib import Path\n\n# Add src to path so \"order_app\" is importable from repo root\n_root = Path(__file__).resolve().parent\n_src = _root / \"src\"\nif str(_src) not in sys.path:\n sys.path.insert(0, str(_src))\n\nfrom order_app.api.orders import create_app\n\napp = create_app()\n\nif __name__ == \"__main__\":\n app.run(host=\"0.0.0.0\", port=8000)", - "layer": "C0_SOURCE_CHUNKS", - "title": "main.py:1-17", - "span_start": 1, - "span_end": 17, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "main", - "is_test": false, - "blob_sha": "978551aab97fa4171d023ff0c96439cb8961da8cfb5a1b8123b33c8e32518db5", - "repo_id": "code_qa_repo_runtime", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "llm_answer": null, - "summary": { - "router": { - "intent": "CODE_QA", - "sub_intent": "OPEN_FILE", - "confidence": null - }, - "retrieval": { - "profile": "code", - "layers_hit": [ - "C0_SOURCE_CHUNKS" - ], - "evidence_sufficient": true - }, - "llm": { - "answer_status": "partial", - "groundedness": "not_applicable" - } - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "OPEN_FILE", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C0_SOURCE_CHUNKS" - ], - "symbol_kind_hint": "unknown", - "symbol_candidates": [], - "keyword_hints": [], - "path_hints": [ - "main.py" - ], - "path_scope": [ - "main.py" - ], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "main.py" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": false, - "max_distance": 2, - "top_k": 5 - } - } - }, - "execution": { - "executed_layers": [ - "C0_SOURCE_CHUNKS" - ], - "retrieval_mode_by_layer": { - "C0_SOURCE_CHUNKS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C0_SOURCE_CHUNKS": 200 - }, - "filters_by_layer": { - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "main.py" - ], - "include_globs": [], - "exclude_globs": [], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "code_qa_repo_runtime", - "workspace_id": "None", - "returned_repo_ids": [ - "code_qa_repo_runtime" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Открой файл main.py", - "path_scope": [ - "main.py" - ], - "include_globs": [], - "exclude_globs": [], - "prefer_globs": [], - "top_k": 200, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "main.py" - ], - "normalized_include_globs": [], - "normalized_exclude_globs": [], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 1, - "candidates_after_filter": 1 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "not_requested", - "resolved_symbol": null, - "alternatives": [] - }, - "layers": [ - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 1, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "router": 0, - "symbol_resolution": 0, - "retrieval_total": 6, - "retrieval_by_layer": { - "C0_SOURCE_CHUNKS": 6 - }, - "merge_rank": 0, - "prompt_build": 0, - "llm_call": 0 - }, - "prompt": null, - "router": { - "conversation_mode": "START", - "keyword_hints": [], - "path_scope": [ - "main.py" - ] - }, - "llm": { - "used_evidence_count": 1, - "missing_evidence_reason": null - } - }, - "run_info": { - "case_id": "router_rag_open_fixture_main", - "mode": "router_rag", - "run_started_at": "2026-03-12T08:27:46", - "rag_session_id": "c224dbc0-132c-4fd7-a106-3684df6455e1", - "expected_intent": "CODE_QA", - "actual_intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - }, - "input_request": { - "text": "Открой файл main.py", - "normalized_query": "Открой файл main.py" - }, - "steps": [ - { - "step": "intent_router", - "input": { - "query": "Открой файл main.py" - }, - "output": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query": "Открой файл main.py" - }, - "diagnostics": { - "router_plan": { - "intent": "CODE_QA", - "sub_intent": "OPEN_FILE", - "graph_id": "CodeQAGraph", - "retrieval_profile": "code", - "conversation_mode": "START", - "layers": [ - "C0_SOURCE_CHUNKS" - ], - "symbol_kind_hint": "unknown", - "symbol_candidates": [], - "keyword_hints": [], - "path_hints": [ - "main.py" - ], - "path_scope": [ - "main.py" - ], - "doc_scope_hints": [], - "retrieval_constraints": { - "include_globs": [ - "main.py" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": false, - "max_distance": 2, - "top_k": 5 - } - } - }, - "timings_ms": { - "router": 0 - } - } - }, - { - "step": "retrieval", - "input": { - "query": "Открой файл main.py" - }, - "output": { - "symbol_resolution": { - "status": "not_requested", - "resolved_symbol": null, - "alternatives": [], - "confidence": 0.0 - }, - "rag_count": 1, - "rag_rows": [ - { - "path": "main.py", - "content": "\"\"\"Entrypoint: runs the orders API. Uses src layout (package order_app under src/).\"\"\"\n\nimport sys\nfrom pathlib import Path\n\n# Add src to path so \"order_app\" is importable from repo root\n_root = Path(__file__).resolve().parent\n_src = _root / \"src\"\nif str(_src) not in sys.path:\n sys.path.insert(0, str(_src))\n\nfrom order_app.api.orders import create_app\n\napp = create_app()\n\nif __name__ == \"__main__\":\n app.run(host=\"0.0.0.0\", port=8000)", - "layer": "C0_SOURCE_CHUNKS", - "title": "main.py:1-17", - "span_start": 1, - "span_end": 17, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "main", - "is_test": false, - "blob_sha": "978551aab97fa4171d023ff0c96439cb8961da8cfb5a1b8123b33c8e32518db5", - "repo_id": "code_qa_repo_runtime", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ] - }, - "diagnostics": { - "execution": { - "executed_layers": [ - "C0_SOURCE_CHUNKS" - ], - "retrieval_mode_by_layer": { - "C0_SOURCE_CHUNKS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C0_SOURCE_CHUNKS": 200 - }, - "filters_by_layer": { - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "main.py" - ], - "include_globs": [], - "exclude_globs": [], - "prefer_globs": [] - } - }, - "repo_scope": { - "repo_id": "code_qa_repo_runtime", - "workspace_id": "None", - "returned_repo_ids": [ - "code_qa_repo_runtime" - ], - "returned_workspace_ids": [ - "None" - ] - } - }, - "retrieval": { - "requests": [ - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Открой файл main.py", - "path_scope": [ - "main.py" - ], - "include_globs": [], - "exclude_globs": [], - "prefer_globs": [], - "top_k": 200, - "ranking_profile": "code" - } - ], - "applied": [ - { - "layer": "C0_SOURCE_CHUNKS", - "effective_path_scope": [ - "main.py" - ], - "normalized_include_globs": [], - "normalized_exclude_globs": [], - "normalized_prefer_globs": [], - "filter_stage": "pre_rank", - "candidates_before_filter": 1, - "candidates_after_filter": 1 - } - ], - "fallback": { - "used": false, - "reason": null - }, - "symbol_resolution": { - "status": "not_requested", - "resolved_symbol": null, - "alternatives": [] - }, - "layers": [ - { - "layer": "C0_SOURCE_CHUNKS", - "status": "hit", - "hit_count": 1, - "fail_reason": null - } - ] - }, - "constraint_violations": [], - "timings_ms": { - "symbol_resolution": 0, - "retrieval_total": 6, - "retrieval_by_layer": { - "C0_SOURCE_CHUNKS": 6 - }, - "merge_rank": 0 - } - } - } - ] - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/router_only_smoke/20260312_082745/router_rag_smoke_router_rag_open_fixture_main.md b/tests/pipeline_setup_v2/test_results/router_only_smoke/20260312_082745/router_rag_smoke_router_rag_open_fixture_main.md deleted file mode 100644 index b6d2d46..0000000 --- a/tests/pipeline_setup_v2/test_results/router_only_smoke/20260312_082745/router_rag_smoke_router_rag_open_fixture_main.md +++ /dev/null @@ -1,30 +0,0 @@ -# router_rag_open_fixture_main - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_02_pipeline/router_rag_smoke.yaml -- runner: runtime -- mode: router_rag -- passed: True - -## Query -Открой файл main.py - -## Actual -{ - "intent": "CODE_QA", - "sub_intent": "OPEN_FILE", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 1, - "llm_answer": "", - "answer_mode": "partial", - "path_scope": [ - "main.py" - ], - "symbol_candidates": [], - "layers": [ - "C0_SOURCE_CHUNKS" - ] -} - -## Mismatches -- none \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/router_only_smoke/20260312_082745/summary.md b/tests/pipeline_setup_v2/test_results/router_only_smoke/20260312_082745/summary.md deleted file mode 100644 index f1075a9..0000000 --- a/tests/pipeline_setup_v2/test_results/router_only_smoke/20260312_082745/summary.md +++ /dev/null @@ -1,14 +0,0 @@ -# pipeline_setup_v2 summary - -Passed: 5/5 - - -| File | Case | Runner | Mode | Intent | Sub-intent | Pass | -| ---------------------- | -------------------------------- | ------- | ----------- | ------- | ---------- | ---- | -| full_chain_smoke.yaml | full_chain_explain_order_service | runtime | full_chain | CODE_QA | EXPLAIN | ✓ | -| router_only_smoke.yaml | router_only_open_fixture_main | runtime | router_only | CODE_QA | OPEN_FILE | ✓ | -| router_only_smoke.yaml | router_only_docs_question | runtime | router_only | DOCS_QA | EXPLAIN | ✓ | -| router_rag_smoke.yaml | router_rag_open_fixture_main | runtime | router_rag | CODE_QA | OPEN_FILE | ✓ | -| router_rag_smoke.yaml | router_rag_explain_order | runtime | router_rag | CODE_QA | EXPLAIN | ✓ | - - diff --git a/tests/pipeline_setup_v2/test_results/suite_01_smoke/20260312_082358/code_qa_eval_explain_order_positive.json b/tests/pipeline_setup_v2/test_results/suite_01_smoke/20260312_082358/code_qa_eval_explain_order_positive.json deleted file mode 100644 index 620f7e5..0000000 --- a/tests/pipeline_setup_v2/test_results/suite_01_smoke/20260312_082358/code_qa_eval_explain_order_positive.json +++ /dev/null @@ -1,58 +0,0 @@ -{ - "case_id": "explain_order_positive", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_01_synthetic/code_qa_eval.yaml", - "runner": "code_qa_eval", - "mode": "router_rag", - "actual": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 15, - "llm_answer": "", - "answer_mode": "normal", - "path_scope": [], - "symbol_candidates": [ - "Order" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "passed": true, - "mismatches": [], - "details": { - "case_id": "explain_order_positive", - "query": "Объясни класс Order", - "rag_session_id": "44202d36-4a5a-4f4e-956c-a40debbd5e5d", - "actual": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 15, - "llm_answer": "", - "answer_mode": "normal", - "path_scope": [], - "symbol_candidates": [ - "Order" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "timings_ms": { - "router": 0, - "retrieval_total": 58, - "symbol_resolution": 0 - } - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/suite_01_smoke/20260312_082358/code_qa_eval_explain_order_positive.md b/tests/pipeline_setup_v2/test_results/suite_01_smoke/20260312_082358/code_qa_eval_explain_order_positive.md deleted file mode 100644 index 26e4c92..0000000 --- a/tests/pipeline_setup_v2/test_results/suite_01_smoke/20260312_082358/code_qa_eval_explain_order_positive.md +++ /dev/null @@ -1,34 +0,0 @@ -# explain_order_positive - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_01_synthetic/code_qa_eval.yaml -- runner: code_qa_eval -- mode: router_rag -- passed: True - -## Query -Объясни класс Order - -## Actual -{ - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 15, - "llm_answer": "", - "answer_mode": "normal", - "path_scope": [], - "symbol_candidates": [ - "Order" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] -} - -## Mismatches -- none \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/suite_01_smoke/20260312_082358/code_qa_eval_explain_order_service_positive.json b/tests/pipeline_setup_v2/test_results/suite_01_smoke/20260312_082358/code_qa_eval_explain_order_service_positive.json deleted file mode 100644 index 69ec576..0000000 --- a/tests/pipeline_setup_v2/test_results/suite_01_smoke/20260312_082358/code_qa_eval_explain_order_service_positive.json +++ /dev/null @@ -1,58 +0,0 @@ -{ - "case_id": "explain_order_service_positive", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_01_synthetic/code_qa_eval.yaml", - "runner": "code_qa_eval", - "mode": "router_rag", - "actual": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 15, - "llm_answer": "", - "answer_mode": "normal", - "path_scope": [], - "symbol_candidates": [ - "OrderService" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "passed": true, - "mismatches": [], - "details": { - "case_id": "explain_order_service_positive", - "query": "Как работает OrderService?", - "rag_session_id": "44202d36-4a5a-4f4e-956c-a40debbd5e5d", - "actual": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 15, - "llm_answer": "", - "answer_mode": "normal", - "path_scope": [], - "symbol_candidates": [ - "OrderService" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "timings_ms": { - "router": 0, - "retrieval_total": 49, - "symbol_resolution": 0 - } - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/suite_01_smoke/20260312_082358/code_qa_eval_explain_order_service_positive.md b/tests/pipeline_setup_v2/test_results/suite_01_smoke/20260312_082358/code_qa_eval_explain_order_service_positive.md deleted file mode 100644 index 2c6a184..0000000 --- a/tests/pipeline_setup_v2/test_results/suite_01_smoke/20260312_082358/code_qa_eval_explain_order_service_positive.md +++ /dev/null @@ -1,34 +0,0 @@ -# explain_order_service_positive - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_01_synthetic/code_qa_eval.yaml -- runner: code_qa_eval -- mode: router_rag -- passed: True - -## Query -Как работает OrderService? - -## Actual -{ - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 15, - "llm_answer": "", - "answer_mode": "normal", - "path_scope": [], - "symbol_candidates": [ - "OrderService" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] -} - -## Mismatches -- none \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/suite_01_smoke/20260312_082358/code_qa_eval_find_entrypoints_positive.json b/tests/pipeline_setup_v2/test_results/suite_01_smoke/20260312_082358/code_qa_eval_find_entrypoints_positive.json deleted file mode 100644 index f7e2c1d..0000000 --- a/tests/pipeline_setup_v2/test_results/suite_01_smoke/20260312_082358/code_qa_eval_find_entrypoints_positive.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "case_id": "find_entrypoints_positive", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_01_synthetic/code_qa_eval.yaml", - "runner": "code_qa_eval", - "mode": "router_rag", - "actual": { - "intent": "PROJECT_MISC", - "sub_intent": "FIND_ENTRYPOINTS", - "graph_id": "ProjectMiscGraph", - "conversation_mode": "START", - "rag_count": 8, - "llm_answer": "", - "answer_mode": "degraded", - "path_scope": [], - "symbol_candidates": [], - "layers": [ - "D1_MODULE_CATALOG", - "D3_SECTION_INDEX", - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS" - ] - }, - "passed": false, - "mismatches": [ - "intent: expected CODE_QA, got PROJECT_MISC", - "answer_mode: expected normal, got degraded" - ], - "details": { - "case_id": "find_entrypoints_positive", - "query": "Какие точки входа в приложение?", - "rag_session_id": "44202d36-4a5a-4f4e-956c-a40debbd5e5d", - "actual": { - "intent": "PROJECT_MISC", - "sub_intent": "FIND_ENTRYPOINTS", - "graph_id": "ProjectMiscGraph", - "conversation_mode": "START", - "rag_count": 8, - "llm_answer": "", - "answer_mode": "degraded", - "path_scope": [], - "symbol_candidates": [], - "layers": [ - "D1_MODULE_CATALOG", - "D3_SECTION_INDEX", - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS" - ] - }, - "timings_ms": { - "router": 0, - "retrieval_total": 51, - "symbol_resolution": 0 - } - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/suite_01_smoke/20260312_082358/code_qa_eval_find_entrypoints_positive.md b/tests/pipeline_setup_v2/test_results/suite_01_smoke/20260312_082358/code_qa_eval_find_entrypoints_positive.md deleted file mode 100644 index 6a9c4b8..0000000 --- a/tests/pipeline_setup_v2/test_results/suite_01_smoke/20260312_082358/code_qa_eval_find_entrypoints_positive.md +++ /dev/null @@ -1,32 +0,0 @@ -# find_entrypoints_positive - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_01_synthetic/code_qa_eval.yaml -- runner: code_qa_eval -- mode: router_rag -- passed: False - -## Query -Какие точки входа в приложение? - -## Actual -{ - "intent": "PROJECT_MISC", - "sub_intent": "FIND_ENTRYPOINTS", - "graph_id": "ProjectMiscGraph", - "conversation_mode": "START", - "rag_count": 8, - "llm_answer": "", - "answer_mode": "degraded", - "path_scope": [], - "symbol_candidates": [], - "layers": [ - "D1_MODULE_CATALOG", - "D3_SECTION_INDEX", - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS" - ] -} - -## Mismatches -- intent: expected CODE_QA, got PROJECT_MISC -- answer_mode: expected normal, got degraded \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/suite_01_smoke/20260312_082358/code_qa_eval_find_tests_positive.json b/tests/pipeline_setup_v2/test_results/suite_01_smoke/20260312_082358/code_qa_eval_find_tests_positive.json deleted file mode 100644 index bfc236d..0000000 --- a/tests/pipeline_setup_v2/test_results/suite_01_smoke/20260312_082358/code_qa_eval_find_tests_positive.json +++ /dev/null @@ -1,54 +0,0 @@ -{ - "case_id": "find_tests_positive", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_01_synthetic/code_qa_eval.yaml", - "runner": "code_qa_eval", - "mode": "router_rag", - "actual": { - "intent": "CODE_QA", - "sub_intent": "FIND_TESTS", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 8, - "llm_answer": "", - "answer_mode": "normal", - "path_scope": [], - "symbol_candidates": [ - "OrderService" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ] - }, - "passed": true, - "mismatches": [], - "details": { - "case_id": "find_tests_positive", - "query": "Где тесты для OrderService?", - "rag_session_id": "44202d36-4a5a-4f4e-956c-a40debbd5e5d", - "actual": { - "intent": "CODE_QA", - "sub_intent": "FIND_TESTS", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 8, - "llm_answer": "", - "answer_mode": "normal", - "path_scope": [], - "symbol_candidates": [ - "OrderService" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ] - }, - "timings_ms": { - "router": 0, - "retrieval_total": 35, - "symbol_resolution": 0 - } - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/suite_01_smoke/20260312_082358/code_qa_eval_find_tests_positive.md b/tests/pipeline_setup_v2/test_results/suite_01_smoke/20260312_082358/code_qa_eval_find_tests_positive.md deleted file mode 100644 index a0dde14..0000000 --- a/tests/pipeline_setup_v2/test_results/suite_01_smoke/20260312_082358/code_qa_eval_find_tests_positive.md +++ /dev/null @@ -1,32 +0,0 @@ -# find_tests_positive - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_01_synthetic/code_qa_eval.yaml -- runner: code_qa_eval -- mode: router_rag -- passed: True - -## Query -Где тесты для OrderService? - -## Actual -{ - "intent": "CODE_QA", - "sub_intent": "FIND_TESTS", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 8, - "llm_answer": "", - "answer_mode": "normal", - "path_scope": [], - "symbol_candidates": [ - "OrderService" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ] -} - -## Mismatches -- none \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/suite_01_smoke/20260312_082358/code_qa_eval_general_qa_positive.json b/tests/pipeline_setup_v2/test_results/suite_01_smoke/20260312_082358/code_qa_eval_general_qa_positive.json deleted file mode 100644 index 1aecab1..0000000 --- a/tests/pipeline_setup_v2/test_results/suite_01_smoke/20260312_082358/code_qa_eval_general_qa_positive.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "case_id": "general_qa_positive", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_01_synthetic/code_qa_eval.yaml", - "runner": "code_qa_eval", - "mode": "router_rag", - "actual": { - "intent": "PROJECT_MISC", - "sub_intent": "EXPLAIN", - "graph_id": "ProjectMiscGraph", - "conversation_mode": "START", - "rag_count": 8, - "llm_answer": "", - "answer_mode": "normal", - "path_scope": [], - "symbol_candidates": [], - "layers": [ - "D1_MODULE_CATALOG", - "D3_SECTION_INDEX", - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS" - ] - }, - "passed": false, - "mismatches": [ - "intent: expected CODE_QA, got PROJECT_MISC", - "sub_intent: expected GENERAL_QA, got EXPLAIN" - ], - "details": { - "case_id": "general_qa_positive", - "query": "Что делает этот проект?", - "rag_session_id": "44202d36-4a5a-4f4e-956c-a40debbd5e5d", - "actual": { - "intent": "PROJECT_MISC", - "sub_intent": "EXPLAIN", - "graph_id": "ProjectMiscGraph", - "conversation_mode": "START", - "rag_count": 8, - "llm_answer": "", - "answer_mode": "normal", - "path_scope": [], - "symbol_candidates": [], - "layers": [ - "D1_MODULE_CATALOG", - "D3_SECTION_INDEX", - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS" - ] - }, - "timings_ms": { - "router": 0, - "retrieval_total": 53, - "symbol_resolution": 0 - } - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/suite_01_smoke/20260312_082358/code_qa_eval_general_qa_positive.md b/tests/pipeline_setup_v2/test_results/suite_01_smoke/20260312_082358/code_qa_eval_general_qa_positive.md deleted file mode 100644 index b98d2dc..0000000 --- a/tests/pipeline_setup_v2/test_results/suite_01_smoke/20260312_082358/code_qa_eval_general_qa_positive.md +++ /dev/null @@ -1,32 +0,0 @@ -# general_qa_positive - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_01_synthetic/code_qa_eval.yaml -- runner: code_qa_eval -- mode: router_rag -- passed: False - -## Query -Что делает этот проект? - -## Actual -{ - "intent": "PROJECT_MISC", - "sub_intent": "EXPLAIN", - "graph_id": "ProjectMiscGraph", - "conversation_mode": "START", - "rag_count": 8, - "llm_answer": "", - "answer_mode": "normal", - "path_scope": [], - "symbol_candidates": [], - "layers": [ - "D1_MODULE_CATALOG", - "D3_SECTION_INDEX", - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS" - ] -} - -## Mismatches -- intent: expected CODE_QA, got PROJECT_MISC -- sub_intent: expected GENERAL_QA, got EXPLAIN \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/suite_01_smoke/20260312_082358/code_qa_eval_open_file_api_positive.json b/tests/pipeline_setup_v2/test_results/suite_01_smoke/20260312_082358/code_qa_eval_open_file_api_positive.json deleted file mode 100644 index f7a362c..0000000 --- a/tests/pipeline_setup_v2/test_results/suite_01_smoke/20260312_082358/code_qa_eval_open_file_api_positive.json +++ /dev/null @@ -1,50 +0,0 @@ -{ - "case_id": "open_file_api_positive", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_01_synthetic/code_qa_eval.yaml", - "runner": "code_qa_eval", - "mode": "router_rag", - "actual": { - "intent": "CODE_QA", - "sub_intent": "OPEN_FILE", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 1, - "llm_answer": "", - "answer_mode": "normal", - "path_scope": [ - "src/order_app/api/orders.py" - ], - "symbol_candidates": [], - "layers": [ - "C0_SOURCE_CHUNKS" - ] - }, - "passed": true, - "mismatches": [], - "details": { - "case_id": "open_file_api_positive", - "query": "Покажи src/order_app/api/orders.py", - "rag_session_id": "44202d36-4a5a-4f4e-956c-a40debbd5e5d", - "actual": { - "intent": "CODE_QA", - "sub_intent": "OPEN_FILE", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 1, - "llm_answer": "", - "answer_mode": "normal", - "path_scope": [ - "src/order_app/api/orders.py" - ], - "symbol_candidates": [], - "layers": [ - "C0_SOURCE_CHUNKS" - ] - }, - "timings_ms": { - "router": 0, - "retrieval_total": 6, - "symbol_resolution": 0 - } - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/suite_01_smoke/20260312_082358/code_qa_eval_open_file_api_positive.md b/tests/pipeline_setup_v2/test_results/suite_01_smoke/20260312_082358/code_qa_eval_open_file_api_positive.md deleted file mode 100644 index 1085ed6..0000000 --- a/tests/pipeline_setup_v2/test_results/suite_01_smoke/20260312_082358/code_qa_eval_open_file_api_positive.md +++ /dev/null @@ -1,30 +0,0 @@ -# open_file_api_positive - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_01_synthetic/code_qa_eval.yaml -- runner: code_qa_eval -- mode: router_rag -- passed: True - -## Query -Покажи src/order_app/api/orders.py - -## Actual -{ - "intent": "CODE_QA", - "sub_intent": "OPEN_FILE", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 1, - "llm_answer": "", - "answer_mode": "normal", - "path_scope": [ - "src/order_app/api/orders.py" - ], - "symbol_candidates": [], - "layers": [ - "C0_SOURCE_CHUNKS" - ] -} - -## Mismatches -- none \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/suite_01_smoke/20260312_082358/code_qa_eval_open_file_main_positive.json b/tests/pipeline_setup_v2/test_results/suite_01_smoke/20260312_082358/code_qa_eval_open_file_main_positive.json deleted file mode 100644 index 75a115c..0000000 --- a/tests/pipeline_setup_v2/test_results/suite_01_smoke/20260312_082358/code_qa_eval_open_file_main_positive.json +++ /dev/null @@ -1,50 +0,0 @@ -{ - "case_id": "open_file_main_positive", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_01_synthetic/code_qa_eval.yaml", - "runner": "code_qa_eval", - "mode": "router_rag", - "actual": { - "intent": "CODE_QA", - "sub_intent": "OPEN_FILE", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 1, - "llm_answer": "", - "answer_mode": "normal", - "path_scope": [ - "main.py" - ], - "symbol_candidates": [], - "layers": [ - "C0_SOURCE_CHUNKS" - ] - }, - "passed": true, - "mismatches": [], - "details": { - "case_id": "open_file_main_positive", - "query": "Открой файл main.py", - "rag_session_id": "44202d36-4a5a-4f4e-956c-a40debbd5e5d", - "actual": { - "intent": "CODE_QA", - "sub_intent": "OPEN_FILE", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 1, - "llm_answer": "", - "answer_mode": "normal", - "path_scope": [ - "main.py" - ], - "symbol_candidates": [], - "layers": [ - "C0_SOURCE_CHUNKS" - ] - }, - "timings_ms": { - "router": 0, - "retrieval_total": 7, - "symbol_resolution": 0 - } - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/suite_01_smoke/20260312_082358/code_qa_eval_open_file_main_positive.md b/tests/pipeline_setup_v2/test_results/suite_01_smoke/20260312_082358/code_qa_eval_open_file_main_positive.md deleted file mode 100644 index d487c4e..0000000 --- a/tests/pipeline_setup_v2/test_results/suite_01_smoke/20260312_082358/code_qa_eval_open_file_main_positive.md +++ /dev/null @@ -1,30 +0,0 @@ -# open_file_main_positive - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v2/cases/suite_01_synthetic/code_qa_eval.yaml -- runner: code_qa_eval -- mode: router_rag -- passed: True - -## Query -Открой файл main.py - -## Actual -{ - "intent": "CODE_QA", - "sub_intent": "OPEN_FILE", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 1, - "llm_answer": "", - "answer_mode": "normal", - "path_scope": [ - "main.py" - ], - "symbol_candidates": [], - "layers": [ - "C0_SOURCE_CHUNKS" - ] -} - -## Mismatches -- none \ No newline at end of file diff --git a/tests/pipeline_setup_v2/test_results/suite_01_smoke/20260312_082358/summary.md b/tests/pipeline_setup_v2/test_results/suite_01_smoke/20260312_082358/summary.md deleted file mode 100644 index f9cad4f..0000000 --- a/tests/pipeline_setup_v2/test_results/suite_01_smoke/20260312_082358/summary.md +++ /dev/null @@ -1,17 +0,0 @@ -# pipeline_setup_v2 summary - -Passed: 5/7 - -| File | Case | Runner | Mode | Intent | Sub-intent | Pass | -|------|------|--------|------|--------|------------|------| -| code_qa_eval.yaml | open_file_main_positive | code_qa_eval | router_rag | CODE_QA | OPEN_FILE | ✓ | -| code_qa_eval.yaml | open_file_api_positive | code_qa_eval | router_rag | CODE_QA | OPEN_FILE | ✓ | -| code_qa_eval.yaml | explain_order_positive | code_qa_eval | router_rag | CODE_QA | EXPLAIN | ✓ | -| code_qa_eval.yaml | explain_order_service_positive | code_qa_eval | router_rag | CODE_QA | EXPLAIN | ✓ | -| code_qa_eval.yaml | find_tests_positive | code_qa_eval | router_rag | CODE_QA | FIND_TESTS | ✓ | -| code_qa_eval.yaml | find_entrypoints_positive | code_qa_eval | router_rag | PROJECT_MISC | FIND_ENTRYPOINTS | ✗ | -| code_qa_eval.yaml | general_qa_positive | code_qa_eval | router_rag | PROJECT_MISC | EXPLAIN | ✗ | - -## Failures -- **find_entrypoints_positive**: intent: expected CODE_QA, got PROJECT_MISC; answer_mode: expected normal, got degraded -- **general_qa_positive**: intent: expected CODE_QA, got PROJECT_MISC; sub_intent: expected GENERAL_QA, got EXPLAIN \ No newline at end of file diff --git a/tests/pipeline_setup_v3/README.md b/tests/pipeline_setup_v3/README.md index 5bc92b9..c050a6d 100644 --- a/tests/pipeline_setup_v3/README.md +++ b/tests/pipeline_setup_v3/README.md @@ -21,7 +21,7 @@ It uses agent components directly: ```bash PYTHONPATH=. python -m tests.pipeline_setup_v3.run \ - --cases-dir tests/pipeline_setup_v2/cases/suite_02_pipeline/full_chain_smoke.yaml \ + --cases-dir tests/pipeline_setup_v3/cases/suite_02_pipeline/full_chain_smoke.yaml \ --run-name smoke_v3 ``` diff --git a/tests/pipeline_setup_v3/cases/suite_01_synthetic/code_qa_eval.yaml b/tests/pipeline_setup_v3/cases/suite_01_synthetic/code_qa_eval.yaml index 0afe259..d2c6de1 100644 --- a/tests/pipeline_setup_v3/cases/suite_01_synthetic/code_qa_eval.yaml +++ b/tests/pipeline_setup_v3/cases/suite_01_synthetic/code_qa_eval.yaml @@ -2,7 +2,7 @@ defaults: runner: code_qa_eval mode: router_rag input: - repo_path: "../../../pipeline_setup/suite_01_synthetic/fixtures/code_qa_repo" + repo_path: "../../fixtures/code_qa_repo" project_id: code_qa_repo cases: diff --git a/tests/pipeline_setup_v3/cases/suite_02_pipeline/full_chain_smoke.yaml b/tests/pipeline_setup_v3/cases/suite_02_pipeline/full_chain_smoke.yaml index ee1b4b9..dd5906c 100644 --- a/tests/pipeline_setup_v3/cases/suite_02_pipeline/full_chain_smoke.yaml +++ b/tests/pipeline_setup_v3/cases/suite_02_pipeline/full_chain_smoke.yaml @@ -2,7 +2,7 @@ defaults: runner: runtime mode: full_chain input: - repo_path: "../../../pipeline_setup/suite_01_synthetic/fixtures/code_qa_repo" + repo_path: "../../fixtures/code_qa_repo" project_id: code_qa_repo_full_chain cases: diff --git a/tests/pipeline_setup_v3/cases/suite_02_pipeline/router_rag_smoke.yaml b/tests/pipeline_setup_v3/cases/suite_02_pipeline/router_rag_smoke.yaml index 48796f5..0561e61 100644 --- a/tests/pipeline_setup_v3/cases/suite_02_pipeline/router_rag_smoke.yaml +++ b/tests/pipeline_setup_v3/cases/suite_02_pipeline/router_rag_smoke.yaml @@ -2,7 +2,7 @@ defaults: runner: runtime mode: router_rag input: - repo_path: "../../../pipeline_setup/suite_01_synthetic/fixtures/code_qa_repo" + repo_path: "../../fixtures/code_qa_repo" project_id: code_qa_repo_runtime cases: diff --git a/tests/pipeline_setup_v3/cases/suite_03_docs/full_chain_docs_intents_v1.yaml b/tests/pipeline_setup_v3/cases/suite_03_docs/full_chain_docs_intents_v1.yaml new file mode 100644 index 0000000..32e7766 --- /dev/null +++ b/tests/pipeline_setup_v3/cases/suite_03_docs/full_chain_docs_intents_v1.yaml @@ -0,0 +1,275 @@ +defaults: + runner: runtime + mode: full_chain + input: + rag_session_id: "fb7e0690-e737-44ca-acc6-e38a0687a5ee" + +cases: + # DOCUMENTATION_EXPLAIN + - id: docs-v1-explain-system-flow-telegram-loop + query: "Объясни как работает цикл отправки уведомлений в Telegram" + expected: + router: + intent: DOCUMENTATION_EXPLAIN + sub_intent: SYSTEM_FLOW_EXPLAIN + graph_id: DocsQAGraph + conversation_mode: START + retrieval: + non_empty: true + doc_scope_contains: ["logic.telegram_notification_loop"] + layers_include: ["D1_DOCUMENT_CATALOG", "D4_WORKFLOW_INDEX", "D5_RELATION_GRAPH"] + llm: + non_empty: true + contains_all: ["TelegramNotifyWorker", "интервал"] + answer_mode: answered + + - id: docs-v1-explain-component-control-channel + query: "Объясни как устроен компонент TelegramControlChannel" + expected: + router: + intent: DOCUMENTATION_EXPLAIN + sub_intent: COMPONENT_EXPLAIN + graph_id: DocsQAGraph + conversation_mode: START + retrieval: + non_empty: true + entity_candidates_contain: ["TelegramControlChannel"] + layers_include: ["D1_DOCUMENT_CATALOG", "D2_FACT_INDEX", "D5_RELATION_GRAPH"] + llm: + non_empty: true + contains_all: ["control plane", "/health"] + answer_mode: answered + + - id: docs-v1-explain-api-health-endpoint + query: "Объясни что делает API метод /health" + expected: + router: + intent: DOCUMENTATION_EXPLAIN + sub_intent: API_METHOD_EXPLAIN + graph_id: DocsQAGraph + conversation_mode: START + retrieval: + non_empty: true + doc_scope_contains: ["api.health_endpoint"] + layers_include: ["D1_DOCUMENT_CATALOG", "D2_FACT_INDEX", "D4_WORKFLOW_INDEX", "D0_DOC_CHUNKS"] + llm: + non_empty: true + contains_all: ["HTTP 200", "HTTP 503"] + answer_mode: answered + + - id: docs-v1-explain-entity-runtime-health + query: "Что такое сущность runtime health?" + expected: + router: + intent: DOCUMENTATION_EXPLAIN + sub_intent: ENTITY_EXPLAIN + graph_id: DocsQAGraph + conversation_mode: START + retrieval: + non_empty: true + entity_candidates_contain: ["WorkerHealth", "WorkerStatus"] + doc_scope_contains: ["domain.runtime_health"] + layers_include: ["D1_DOCUMENT_CATALOG", "D3_ENTITY_CATALOG", "D5_RELATION_GRAPH"] + llm: + non_empty: true + contains_all: ["наблюдаемости", "telegram_notify"] + answer_mode: answered + + # DISCOVERY folded into DOCUMENTATION_EXPLAIN + - id: docs-v1-discovery-find-documents-telegram-api + query: "Найди документацию по Telegram API и control plane" + expected: + router: + intent: DOCUMENTATION_EXPLAIN + sub_intent: RELATED_DOCS_EXPLAIN + graph_id: DocsQAGraph + conversation_mode: START + retrieval: + non_empty: true + layers_include: ["D1_DOCUMENT_CATALOG", "D2_FACT_INDEX"] + llm: + non_empty: true + contains_all: ["/health", "/send"] + answer_mode: answered + + - id: docs-v1-discovery-find-by-entity-telegramnotifyworker + query: "Какие документы связаны с сущностью TelegramNotifyWorker?" + expected: + router: + intent: DOCUMENTATION_EXPLAIN + sub_intent: RELATED_DOCS_EXPLAIN + graph_id: DocsQAGraph + conversation_mode: START + retrieval: + non_empty: true + entity_candidates_contain: ["TelegramNotifyWorker"] + layers_include: ["D5_RELATION_GRAPH", "D1_DOCUMENT_CATALOG"] + llm: + non_empty: true + contains_all: ["logic.telegram_notification_loop", "api.health_endpoint"] + answer_mode: answered + + - id: docs-v1-discovery-find-by-topic-health + query: "Где в документации описан health runtime?" + expected: + router: + intent: DOCUMENTATION_EXPLAIN + sub_intent: RELATED_DOCS_EXPLAIN + graph_id: DocsQAGraph + conversation_mode: START + retrieval: + non_empty: true + layers_include: ["D5_RELATION_GRAPH", "D1_DOCUMENT_CATALOG"] + llm: + non_empty: true + contains_all: ["api.health_endpoint", "domain.runtime_health"] + answer_mode: answered + + # NAVIGATION folded into DOCUMENTATION_EXPLAIN + - id: docs-v1-navigation-related-docs-health-endpoint + query: "Какие документы связаны с endpoint /health?" + expected: + router: + intent: DOCUMENTATION_EXPLAIN + sub_intent: RELATED_DOCS_EXPLAIN + graph_id: DocsQAGraph + conversation_mode: START + retrieval: + non_empty: true + doc_scope_contains: ["api.health_endpoint"] + layers_include: ["D5_RELATION_GRAPH", "D1_DOCUMENT_CATALOG"] + llm: + non_empty: true + contains_all: ["architecture.telegram_notify_app", "domain.runtime_health"] + answer_mode: answered + + - id: docs-v1-navigation-parent-child-architecture + query: "Покажи навигацию от overview архитектуры к дочерним документам" + expected: + router: + intent: DOCUMENTATION_EXPLAIN + sub_intent: RELATED_DOCS_EXPLAIN + graph_id: DocsQAGraph + conversation_mode: START + retrieval: + non_empty: true + doc_scope_contains: ["architecture.telegram_notify_app"] + layers_include: ["D5_RELATION_GRAPH", "D1_DOCUMENT_CATALOG"] + llm: + non_empty: true + contains_all: ["api.health_endpoint", "logic.telegram_notification_loop"] + answer_mode: answered + + - id: docs-v1-navigation-workflow-send-message + query: "По каким документам идти, чтобы понять сценарий ручной отправки сообщения?" + expected: + router: + intent: DOCUMENTATION_EXPLAIN + sub_intent: RELATED_DOCS_EXPLAIN + graph_id: DocsQAGraph + conversation_mode: START + retrieval: + non_empty: true + layers_include: ["D5_RELATION_GRAPH", "D1_DOCUMENT_CATALOG"] + llm: + non_empty: true + contains_all: ["api.send_message_endpoint", "logic.telegram_notification_loop"] + answer_mode: answered + + # OPENAPI_GENERATION + - id: docs-v1-openapi-method-health-endpoint + query: "Сгенерируй OpenAPI для метода /health по документации" + expected: + router: + intent: OPENAPI_GENERATION + sub_intent: OPENAPI_METHOD_GENERATE + graph_id: DocsQAGraph + conversation_mode: START + retrieval: + non_empty: true + filters_contain: + doc_type: api_method + doc_scope_contains: ["api.health_endpoint"] + layers_include: ["D1_DOCUMENT_CATALOG", "D2_FACT_INDEX", "D0_DOC_CHUNKS"] + llm: + non_empty: true + contains_all: ["paths:", "/health", "get:"] + answer_mode: structured_spec + + - id: docs-v1-openapi-fragment-send-request + query: "Сгенерируй request schema для endpoint /send по документации" + expected: + router: + intent: OPENAPI_GENERATION + sub_intent: OPENAPI_FRAGMENT_GENERATE + graph_id: DocsQAGraph + conversation_mode: START + retrieval: + non_empty: true + filters_contain: + doc_type: api_method + doc_scope_contains: ["api.send_message_endpoint"] + layers_include: ["D1_DOCUMENT_CATALOG", "D2_FACT_INDEX", "D0_DOC_CHUNKS"] + llm: + non_empty: true + contains_all: ["message", "type:", "string"] + answer_mode: structured_spec + + - id: docs-v1-openapi-fragment-control-actions-response + query: "Собери response schema для /actions/{action} по документации" + expected: + router: + intent: OPENAPI_GENERATION + sub_intent: OPENAPI_FRAGMENT_GENERATE + graph_id: DocsQAGraph + conversation_mode: START + retrieval: + non_empty: true + filters_contain: + doc_type: api_method + doc_scope_contains: ["api.control_actions_endpoint"] + layers_include: ["D1_DOCUMENT_CATALOG", "D2_FACT_INDEX", "D0_DOC_CHUNKS"] + llm: + non_empty: true + contains_all: ["status", "detail"] + answer_mode: structured_spec + + # NEGATIVE / NOT FOUND + - id: docs-v1-discovery-find-by-entity-nonexistent + query: "Какие документы связаны с сущностью PaymentTransaction?" + expected: + router: + intent: DOCUMENTATION_EXPLAIN + sub_intent: RELATED_DOCS_EXPLAIN + graph_id: DocsQAGraph + conversation_mode: START + retrieval: + non_empty: false + entity_candidates_contain: ["PaymentTransaction"] + layers_include: ["D3_ENTITY_CATALOG", "D1_DOCUMENT_CATALOG", "D5_RELATION_GRAPH"] + llm: + non_empty: true + contains_all: ["не найдена"] + excludes: ["вероятно", "исходя из названия"] + pipeline: + answer_mode: degraded + + - id: docs-v1-openapi-method-nonexistent + query: "Сгенерируй OpenAPI для endpoint /orders по документации" + expected: + router: + intent: OPENAPI_GENERATION + sub_intent: OPENAPI_METHOD_GENERATE + graph_id: DocsQAGraph + conversation_mode: START + retrieval: + non_empty: false + filters_contain: + doc_type: api_method + layers_include: ["D1_DOCUMENT_CATALOG", "D2_FACT_INDEX", "D0_DOC_CHUNKS"] + llm: + non_empty: true + contains_all: ["не найден"] + excludes: ["paths:", "/orders", "post:"] + pipeline: + answer_mode: degraded diff --git a/tests/pipeline_setup_v3/cases/suite_03_docs/full_chain_docs_intents_v2.yaml b/tests/pipeline_setup_v3/cases/suite_03_docs/full_chain_docs_intents_v2.yaml new file mode 100644 index 0000000..5c77977 --- /dev/null +++ b/tests/pipeline_setup_v3/cases/suite_03_docs/full_chain_docs_intents_v2.yaml @@ -0,0 +1,271 @@ +defaults: + runner: runtime + mode: full_chain + input: + rag_session_id: "fb7e0690-e737-44ca-acc6-e38a0687a5ee" + +cases: + # ============================================================ + # DOCUMENTATION_EXPLAIN / SYSTEM_FLOW_EXPLAIN + # ============================================================ + - id: docs-v2-system-flow-telegram-loop + query: "Объясни как работает цикл отправки уведомлений в Telegram" + expected: + router: + intent: DOCUMENTATION_EXPLAIN + sub_intent: SYSTEM_FLOW_EXPLAIN + graph_id: DocsQAGraph + conversation_mode: START + retrieval: + non_empty: true + doc_scope_contains: ["logic.telegram_notification_loop"] + layers_include: ["D1_DOCUMENT_CATALOG", "D4_WORKFLOW_INDEX", "D5_RELATION_GRAPH", "D0_DOC_CHUNKS"] + llm: + non_empty: true + contains_any: ["TelegramNotifyWorker", "интервал", "degraded"] + answer_mode: answered + + - id: docs-v2-system-flow-health-check + query: "Как происходит получение health состояния runtime?" + expected: + router: + intent: DOCUMENTATION_EXPLAIN + sub_intent: SYSTEM_FLOW_EXPLAIN + graph_id: DocsQAGraph + conversation_mode: START + retrieval: + non_empty: true + doc_scope_contains: ["api.health_endpoint", "domain.runtime_health"] + layers_include: ["D1_DOCUMENT_CATALOG", "D4_WORKFLOW_INDEX", "D5_RELATION_GRAPH", "D0_DOC_CHUNKS"] + llm: + non_empty: true + contains_any: ["/health", "HTTP 200", "HTTP 503", "payload"] + answer_mode: answered + + # ============================================================ + # DOCUMENTATION_EXPLAIN / COMPONENT_EXPLAIN + # ============================================================ + - id: docs-v2-component-control-channel + query: "Объясни как работает компонент TelegramControlChannel" + expected: + router: + intent: DOCUMENTATION_EXPLAIN + sub_intent: COMPONENT_EXPLAIN + graph_id: DocsQAGraph + conversation_mode: START + retrieval: + non_empty: true + entity_candidates_contain: ["TelegramControlChannel"] + layers_include: ["D1_DOCUMENT_CATALOG", "D2_FACT_INDEX", "D5_RELATION_GRAPH", "D0_DOC_CHUNKS"] + llm: + non_empty: true + contains_any: ["/health", "/actions/{action}", "/send"] + answer_mode: answered + + - id: docs-v2-component-runtime-manager + query: "Какую роль в системе играет RuntimeManager?" + expected: + router: + intent: DOCUMENTATION_EXPLAIN + sub_intent: COMPONENT_EXPLAIN + graph_id: DocsQAGraph + conversation_mode: START + retrieval: + non_empty: true + entity_candidates_contain: ["RuntimeManager"] + layers_include: ["D1_DOCUMENT_CATALOG", "D2_FACT_INDEX", "D5_RELATION_GRAPH", "D0_DOC_CHUNKS"] + llm: + non_empty: true + contains_any: ["runtime", "регистр", "TelegramNotifyModule"] + answer_mode: answered + + # ============================================================ + # DOCUMENTATION_EXPLAIN / API_METHOD_EXPLAIN + # ============================================================ + - id: docs-v2-api-health-endpoint + query: "Объясни что делает endpoint /health" + expected: + router: + intent: DOCUMENTATION_EXPLAIN + sub_intent: API_METHOD_EXPLAIN + graph_id: DocsQAGraph + conversation_mode: START + retrieval: + non_empty: true + doc_scope_contains: ["api.health_endpoint"] + layers_include: ["D1_DOCUMENT_CATALOG", "D2_FACT_INDEX", "D4_WORKFLOW_INDEX", "D0_DOC_CHUNKS"] + llm: + non_empty: true + contains_any: ["HTTP 200", "HTTP 503", "payload", "components"] + answer_mode: answered + + - id: docs-v2-api-send-endpoint + query: "Как работает endpoint /send?" + expected: + router: + intent: DOCUMENTATION_EXPLAIN + sub_intent: API_METHOD_EXPLAIN + graph_id: DocsQAGraph + conversation_mode: START + retrieval: + non_empty: true + doc_scope_contains: ["api.send_message_endpoint"] + layers_include: ["D1_DOCUMENT_CATALOG", "D2_FACT_INDEX", "D4_WORKFLOW_INDEX", "D0_DOC_CHUNKS"] + llm: + non_empty: true + contains_any: ["message", "HTTP 400", "HTTP 500", "TelegramSendService"] + answer_mode: answered + + # ============================================================ + # DOCUMENTATION_EXPLAIN / ENTITY_EXPLAIN + # ============================================================ + - id: docs-v2-entity-runtime-health + query: "Что такое runtime health?" + expected: + router: + intent: DOCUMENTATION_EXPLAIN + sub_intent: ENTITY_EXPLAIN + graph_id: DocsQAGraph + conversation_mode: START + retrieval: + non_empty: true + doc_scope_contains: ["domain.runtime_health"] + layers_include: ["D3_ENTITY_CATALOG", "D1_DOCUMENT_CATALOG", "D5_RELATION_GRAPH", "D0_DOC_CHUNKS"] + llm: + non_empty: true + contains_any: ["наблюдаемости", "WorkerHealth", "WorkerStatus", "telegram_notify"] + answer_mode: answered + + - id: docs-v2-entity-worker-status + query: "Объясни сущность WorkerStatus" + expected: + router: + intent: DOCUMENTATION_EXPLAIN + sub_intent: ENTITY_EXPLAIN + graph_id: DocsQAGraph + conversation_mode: START + retrieval: + non_empty: true + entity_candidates_contain: ["WorkerStatus"] + layers_include: ["D3_ENTITY_CATALOG", "D1_DOCUMENT_CATALOG", "D5_RELATION_GRAPH", "D0_DOC_CHUNKS"] + llm: + non_empty: true + contains_any: ["ok", "degraded", "unhealthy"] + answer_mode: answered + + # ============================================================ + # DOCUMENTATION_EXPLAIN / RELATED_DOCS_EXPLAIN + # ============================================================ + - id: docs-v2-related-docs-health + query: "Какие документы связаны с endpoint /health?" + expected: + router: + intent: DOCUMENTATION_EXPLAIN + sub_intent: RELATED_DOCS_EXPLAIN + graph_id: DocsQAGraph + conversation_mode: START + retrieval: + non_empty: true + doc_scope_contains: ["api.health_endpoint"] + layers_include: ["D5_RELATION_GRAPH", "D1_DOCUMENT_CATALOG", "D0_DOC_CHUNKS"] + llm: + non_empty: true + contains_any: ["domain.runtime_health", "architecture.telegram_notify_app"] + answer_mode: answered + + - id: docs-v2-related-docs-architecture-overview + query: "Какие дочерние документы есть у overview архитектуры сервиса?" + expected: + router: + intent: DOCUMENTATION_EXPLAIN + sub_intent: RELATED_DOCS_EXPLAIN + graph_id: DocsQAGraph + conversation_mode: START + retrieval: + non_empty: true + doc_scope_contains: ["architecture.telegram_notify_app"] + layers_include: ["D5_RELATION_GRAPH", "D1_DOCUMENT_CATALOG", "D0_DOC_CHUNKS"] + llm: + non_empty: true + contains_any: ["api.health_endpoint", "api.send_message_endpoint", "logic.telegram_notification_loop"] + answer_mode: answered + + # ============================================================ + # OPENAPI_GENERATION / OPENAPI_METHOD_GENERATE + # ============================================================ + - id: docs-v2-openapi-health + query: "Сгенерируй OpenAPI для endpoint /health по документации" + expected: + router: + intent: OPENAPI_GENERATION + sub_intent: OPENAPI_METHOD_GENERATE + graph_id: DocsQAGraph + conversation_mode: START + retrieval: + non_empty: true + doc_scope_contains: ["api.health_endpoint"] + layers_include: ["D1_DOCUMENT_CATALOG", "D2_FACT_INDEX", "D0_DOC_CHUNKS"] + llm: + non_empty: true + contains_any: ["paths:", "/health", "get:"] + answer_mode: structured_spec + + # ============================================================ + # OPENAPI_GENERATION / OPENAPI_FRAGMENT_GENERATE + # ============================================================ + - id: docs-v2-openapi-fragment-send-request + query: "Сгенерируй request schema для endpoint /send" + expected: + router: + intent: OPENAPI_GENERATION + sub_intent: OPENAPI_FRAGMENT_GENERATE + graph_id: DocsQAGraph + conversation_mode: START + retrieval: + non_empty: true + doc_scope_contains: ["api.send_message_endpoint"] + layers_include: ["D1_DOCUMENT_CATALOG", "D2_FACT_INDEX", "D0_DOC_CHUNKS"] + llm: + non_empty: true + contains_any: ["message", "string"] + answer_mode: structured_spec + + # ============================================================ + # GENERAL_QA / GENERIC_QA + # ============================================================ + - id: docs-v2-general-overview + query: "Что вообще описано в документации по этому сервису?" + expected: + router: + intent: GENERAL_QA + sub_intent: GENERIC_QA + graph_id: DocsQAGraph + conversation_mode: START + retrieval: + non_empty: true + layers_include: ["D1_DOCUMENT_CATALOG", "D0_DOC_CHUNKS"] + llm: + non_empty: true + contains_any: ["архитектура", "API", "worker", "runtime"] + answer_mode: answered + + # ============================================================ + # NEGATIVE / DEGRADED + # ============================================================ + - id: docs-v2-negative-missing-entity + query: "Что такое сущность PaymentTransaction?" + expected: + router: + intent: DOCUMENTATION_EXPLAIN + sub_intent: ENTITY_EXPLAIN + graph_id: DocsQAGraph + conversation_mode: START + retrieval: + non_empty: false + entity_candidates_contain: ["PaymentTransaction"] + layers_include: ["D3_ENTITY_CATALOG", "D1_DOCUMENT_CATALOG", "D5_RELATION_GRAPH", "D0_DOC_CHUNKS"] + llm: + non_empty: true + contains_any: ["не найдена", "нет в документации"] + pipeline: + answer_mode: degraded \ No newline at end of file diff --git a/tests/pipeline_setup_v3/cases/suite_03_docs/full_chain_docs_intents_v3-3x.yaml b/tests/pipeline_setup_v3/cases/suite_03_docs/full_chain_docs_intents_v3-3x.yaml new file mode 100644 index 0000000..5657895 --- /dev/null +++ b/tests/pipeline_setup_v3/cases/suite_03_docs/full_chain_docs_intents_v3-3x.yaml @@ -0,0 +1,220 @@ +# full_chain_docs_intents_v3.yaml + +defaults: + runner: runtime + mode: pre_llm + input: + rag_session_id: "fb7e0690-e737-44ca-acc6-e38a0687a5ee" + +cases: + +# ============================================================ +# SYSTEM FLOW (расширено) +# ============================================================ + +- id: v3-system-flow-telegram-loop-1 + query: "Объясни цикл отправки уведомлений" + expected: + router: + intent: DOCUMENTATION_EXPLAIN + sub_intent: SYSTEM_FLOW_EXPLAIN + +- id: v3-system-flow-telegram-loop-2 + query: "Как работает процесс отправки уведомлений в Telegram?" + expected: + router: + intent: DOCUMENTATION_EXPLAIN + sub_intent: SYSTEM_FLOW_EXPLAIN + +- id: v3-system-flow-telegram-loop-3 + query: "Опиши workflow Telegram уведомлений" + expected: + router: + intent: DOCUMENTATION_EXPLAIN + sub_intent: SYSTEM_FLOW_EXPLAIN + +- id: v3-system-flow-health-1 + query: "Как работает health check runtime?" + expected: + router: + sub_intent: SYSTEM_FLOW_EXPLAIN + +- id: v3-system-flow-health-2 + query: "Как происходит проверка состояния runtime?" + expected: + router: + sub_intent: SYSTEM_FLOW_EXPLAIN + +# ============================================================ +# COMPONENT (расширено) +# ============================================================ + +- id: v3-component-runtime-manager-1 + query: "Что делает RuntimeManager?" + expected: + router: + sub_intent: COMPONENT_EXPLAIN + +- id: v3-component-runtime-manager-2 + query: "Как устроен RuntimeManager?" + expected: + router: + sub_intent: COMPONENT_EXPLAIN + +- id: v3-component-runtime-manager-3 + query: "Опиши компонент RuntimeManager" + expected: + router: + sub_intent: COMPONENT_EXPLAIN + +- id: v3-component-control-channel-1 + query: "Как работает TelegramControlChannel?" + expected: + router: + sub_intent: COMPONENT_EXPLAIN + +- id: v3-component-control-channel-2 + query: "Роль TelegramControlChannel в системе" + expected: + router: + sub_intent: COMPONENT_EXPLAIN + +# ============================================================ +# API (расширено) +# ============================================================ + +- id: v3-api-health-1 + query: "Что делает /health?" + expected: + router: + sub_intent: API_METHOD_EXPLAIN + +- id: v3-api-health-2 + query: "Как работает health endpoint?" + expected: + router: + sub_intent: API_METHOD_EXPLAIN + +- id: v3-api-health-3 + query: "Опиши endpoint health" + expected: + router: + sub_intent: API_METHOD_EXPLAIN + +- id: v3-api-send-1 + query: "Что делает /send?" + expected: + router: + sub_intent: API_METHOD_EXPLAIN + +- id: v3-api-send-2 + query: "Как работает send endpoint?" + expected: + router: + sub_intent: API_METHOD_EXPLAIN + +- id: v3-api-send-3 + query: "Опиши endpoint отправки сообщений" + expected: + router: + sub_intent: API_METHOD_EXPLAIN + +# ============================================================ +# ENTITY (расширено) +# ============================================================ + +- id: v3-entity-runtime-health-1 + query: "Что такое runtime health?" + expected: + router: + sub_intent: ENTITY_EXPLAIN + +- id: v3-entity-runtime-health-2 + query: "Объясни runtime health" + expected: + router: + sub_intent: ENTITY_EXPLAIN + +- id: v3-entity-worker-status-1 + query: "Что такое WorkerStatus?" + expected: + router: + sub_intent: ENTITY_EXPLAIN + +- id: v3-entity-worker-status-2 + query: "Опиши статус воркера" + expected: + router: + sub_intent: ENTITY_EXPLAIN + +# ============================================================ +# RELATED DOCS (расширено) +# ============================================================ + +- id: v3-related-health-1 + query: "Что связано с /health?" + expected: + router: + sub_intent: RELATED_DOCS_EXPLAIN + +- id: v3-related-health-2 + query: "Какие документы относятся к health endpoint?" + expected: + router: + sub_intent: RELATED_DOCS_EXPLAIN + +- id: v3-related-send-1 + query: "Какие документы связаны с /send?" + expected: + router: + sub_intent: RELATED_DOCS_EXPLAIN + +- id: v3-related-architecture-1 + query: "Какие документы связаны с архитектурой?" + expected: + router: + sub_intent: RELATED_DOCS_EXPLAIN + +# ============================================================ +# GENERAL (расширено) +# ============================================================ + +- id: v3-general-1 + query: "Что есть в документации?" + expected: + router: + sub_intent: GENERIC_QA + +- id: v3-general-2 + query: "Какая структура документации?" + expected: + router: + sub_intent: GENERIC_QA + +- id: v3-general-3 + query: "С чего начать читать документацию?" + expected: + router: + sub_intent: GENERIC_QA + +# ============================================================ +# NEGATIVE (расширено) +# ============================================================ + +- id: v3-negative-1 + query: "Что такое PaymentTransaction?" + expected: + router: + sub_intent: ENTITY_EXPLAIN + +- id: v3-negative-2 + query: "Объясни сущность UnknownEntity" + expected: + router: + sub_intent: ENTITY_EXPLAIN + +- id: v3-negative-3 + query: "Что делает endpoint /unknown?" + expected: + router: + sub_intent: API_METHOD_EXPLAIN \ No newline at end of file diff --git a/tests/pipeline_setup_v3/cases/suite_03_docs/full_chain_docs_intents_v4-llm.yaml b/tests/pipeline_setup_v3/cases/suite_03_docs/full_chain_docs_intents_v4-llm.yaml new file mode 100644 index 0000000..0eb7b7a --- /dev/null +++ b/tests/pipeline_setup_v3/cases/suite_03_docs/full_chain_docs_intents_v4-llm.yaml @@ -0,0 +1,79 @@ +# full_chain_docs_intents_v4.yaml + +defaults: + runner: runtime + mode: full_chain + input: + rag_session_id: "fb7e0690-e737-44ca-acc6-e38a0687a5ee" + +cases: + +# SYSTEM FLOW +- id: v4-system-flow + query: "Объясни как работает цикл отправки уведомлений" + expected: + router: + sub_intent: SYSTEM_FLOW_EXPLAIN + +# COMPONENT +- id: v4-component + query: "Как работает RuntimeManager?" + expected: + router: + sub_intent: COMPONENT_EXPLAIN + +# API +- id: v4-api + query: "Что делает endpoint /health?" + expected: + router: + sub_intent: API_METHOD_EXPLAIN + +# ENTITY +- id: v4-entity + query: "Что такое runtime health?" + expected: + router: + sub_intent: ENTITY_EXPLAIN + +# RELATED DOCS +- id: v4-related + query: "Какие документы связаны с endpoint /health?" + expected: + router: + sub_intent: RELATED_DOCS_EXPLAIN + +# OPENAPI METHOD +- id: v4-openapi-method + query: "Сгенерируй OpenAPI для endpoint /health" + expected: + router: + intent: OPENAPI_GENERATION + +# OPENAPI FRAGMENT +- id: v4-openapi-fragment + query: "Сгенерируй request schema для endpoint /send" + expected: + router: + sub_intent: OPENAPI_FRAGMENT_GENERATE + +# GENERAL +- id: v4-general + query: "Что описано в документации?" + expected: + router: + sub_intent: GENERIC_QA + +# NEGATIVE +- id: v4-negative + query: "Что такое PaymentTransaction?" + expected: + router: + sub_intent: ENTITY_EXPLAIN + +# EDGE MIXED +- id: v4-mixed + query: "Как работает /send и какие есть связанные документы?" + expected: + router: + intent: DOCUMENTATION_EXPLAIN \ No newline at end of file diff --git a/tests/pipeline_setup_v3/cli/index_repo.py b/tests/pipeline_setup_v3/cli/index_repo.py index 53f7923..d199347 100644 --- a/tests/pipeline_setup_v3/cli/index_repo.py +++ b/tests/pipeline_setup_v3/cli/index_repo.py @@ -10,12 +10,23 @@ _src = _agent_root / "src" if _src.exists() and str(_src) not in sys.path: sys.path.insert(0, str(_src)) +from app.modules.rag.persistence.repository import RagRepository +from tests.pipeline_setup_v3.shared.env_loader import load_pipeline_setup_env +from tests.pipeline_setup_v3.shared.rag_indexer import RagSessionIndexer + def main() -> int: - argv = ["reindex", *sys.argv[1:]] - from tests.pipeline_setup.suite_02_pipeline.pipeline_intent_rag.cli import main as cli_main + import argparse - return cli_main(argv) + parser = argparse.ArgumentParser(description="Index a repo for pipeline_setup_v3") + parser.add_argument("--repo-path", required=True, help="Repository path to index") + parser.add_argument("--project-id", default=None, help="Optional project id override") + ns = parser.parse_args(sys.argv[1:]) + + load_pipeline_setup_env(start_dir=Path(__file__).resolve().parents[1]) + repo_path = Path(str(ns.repo_path)).expanduser().resolve() + RagSessionIndexer(RagRepository()).index_repo(repo_path, project_id=ns.project_id) + return 0 if __name__ == "__main__": diff --git a/tests/pipeline_setup_v3/core/artifacts.py b/tests/pipeline_setup_v3/core/artifacts.py index 7ace880..2feaf59 100644 --- a/tests/pipeline_setup_v3/core/artifacts.py +++ b/tests/pipeline_setup_v3/core/artifacts.py @@ -15,18 +15,9 @@ class ArtifactWriter: def write_case(self, result: V3CaseResult) -> None: stem = f"{result.case.source_file.stem}_{result.case.case_id}" - payload = { - "case_id": result.case.case_id, - "source_file": result.case.source_file.as_posix(), - "runner": result.case.runner, - "mode": result.case.mode, - "query": result.case.query, - "actual": result.actual, - "passed": result.passed, - "mismatches": result.mismatches, - "details": result.details, - } + payload = self._json_payload(result) (self.run_dir / f"{stem}.json").write_text(json.dumps(payload, ensure_ascii=False, indent=2), encoding="utf-8") + diagnostics = self._diagnostics_without_prompt(result.details) lines = [ f"# {result.case.case_id}", "", @@ -41,17 +32,161 @@ class ArtifactWriter: "## Actual", json.dumps(result.actual, ensure_ascii=False, indent=2), "", - "## Steps", - json.dumps(result.details.get("steps") or [], ensure_ascii=False, indent=2), + "## Pipeline Steps", + *self._md_steps(result), "", "## Diagnostics", - json.dumps(result.details.get("diagnostics") or {}, ensure_ascii=False, indent=2), + json.dumps(diagnostics, ensure_ascii=False, indent=2), + "", + *self._llm_request_section(result.details), "", "## Mismatches", *([f"- {item}" for item in result.mismatches] or ["- none"]), ] (self.run_dir / f"{stem}.md").write_text("\n".join(lines), encoding="utf-8") + def _json_payload(self, result: V3CaseResult) -> dict: + return { + "meta": { + "case_id": result.case.case_id, + "source_file": result.case.source_file.as_posix(), + "runner": result.case.runner, + "mode": result.case.mode, + "passed": result.passed, + "mismatches": result.mismatches, + "actual": result.actual, + }, + "pipeline_steps": list(result.details.get("pipeline_steps") or []), + } + + def _md_steps(self, result: V3CaseResult) -> list[str]: + steps = list(result.details.get("pipeline_steps") or []) + if not steps: + return ["- none"] + lines: list[str] = [] + for item in steps: + step = str(item.get("step") or "").strip() or "unknown" + status = str(item.get("status") or "").strip() + lines.append(f"### {step}") + if status: + lines.append(f"- status: {status}") + timings = item.get("timings_ms") or {} + if timings: + lines.append(f"- timings_ms: {json.dumps(timings, ensure_ascii=False)}") + lines.append("```json") + lines.append(json.dumps({"input": item.get("input") or {}, "output": item.get("output") or {}}, ensure_ascii=False, indent=2)) + lines.append("```") + lines.append("") + return lines[:-1] if lines and not lines[-1] else lines + + def _diagnostics_without_prompt(self, details: dict) -> dict: + diagnostics = dict(details.get("diagnostics") or {}) + diagnostics.pop("prompt", None) + return diagnostics + + def _llm_request_section(self, details: dict) -> list[str]: + llm_request = dict(details.get("llm_request") or {}) + if not llm_request: + llm_request = dict((details.get("diagnostics") or {}).get("prompt") or {}) + if not llm_request: + return [] + lines = [ + "## LLM Request", + f"- prompt_name: {llm_request.get('prompt_name') or '—'}", + f"- log_context: {llm_request.get('log_context') or '—'}", + ] + prompt_stats = dict(llm_request.get("prompt_stats") or {}) + if prompt_stats: + lines.extend( + [ + "", + "### Prompt Stats", + "```json", + json.dumps(prompt_stats, ensure_ascii=False, indent=2), + "```", + ] + ) + system_prompt = str(llm_request.get("system_prompt") or "").strip() + user_prompt = str(llm_request.get("user_prompt") or "").strip() + lines.extend( + [ + "", + "### System Prompt", + "```text", + system_prompt or "—", + "```", + "", + "### User Prompt", + *self._render_user_prompt(user_prompt), + ] + ) + return lines + + def _render_user_prompt(self, user_prompt: str) -> list[str]: + payload = self._parse_json(user_prompt) + if payload is None: + return ["```text", user_prompt or "—", "```"] + lines = ["```json", json.dumps(payload, ensure_ascii=False, indent=2), "```"] + lines.extend(self._prompt_overview(payload)) + return lines + + def _prompt_overview(self, payload: dict) -> list[str]: + lines = ["", "### User Prompt Overview"] + for key in ("question", "intent", "sub_intent"): + value = payload.get(key) + if value is not None: + lines.append(f"- {key}: {value}") + lines.extend(self._prompt_collection_line("documents", payload.get("documents"))) + lines.extend(self._prompt_collection_line("facts", payload.get("facts"))) + lines.extend(self._prompt_collection_line("relations", payload.get("relations"))) + api_contract = payload.get("api_contract") + if isinstance(api_contract, dict): + lines.append("- api_contract:") + lines.extend(self._api_contract_lines(api_contract)) + return lines + + def _prompt_collection_line(self, name: str, value) -> list[str]: + items = value if isinstance(value, list) else [] + if not items: + return [f"- {name}: 0"] + samples: list[str] = [] + for item in items[:3]: + if not isinstance(item, dict): + continue + sample = str( + item.get("title") + or item.get("content") + or item.get("path") + or item.get("doc_id") + or item.get("id") + or "" + ).strip() + if sample: + samples.append(" ".join(sample.split())) + suffix = f" | samples: {', '.join(samples)}" if samples else "" + return [f"- {name}: {len(items)}{suffix}"] + + def _api_contract_lines(self, api_contract: dict) -> list[str]: + lines: list[str] = [] + path = str(api_contract.get("path") or "").strip() or "—" + method = str(api_contract.get("method") or "").strip() or "—" + request_schema = api_contract.get("request_schema") + response_schema = api_contract.get("response_schema") + lines.append(f" path: {path}") + lines.append(f" method: {method}") + lines.append(f" has_request_schema: {bool(request_schema)}") + lines.append(f" has_response_schema: {bool(response_schema)}") + return lines + + def _parse_json(self, text: str) -> dict | None: + if not text.strip(): + return None + try: + payload = json.loads(text) + except json.JSONDecodeError: + return None + return payload if isinstance(payload, dict) else None + def write_summary(self, results: list[V3CaseResult]) -> Path: path = self.run_dir / "summary.md" path.write_text(SummaryComposer().compose(results), encoding="utf-8") diff --git a/tests/pipeline_setup_v3/core/case_loader.py b/tests/pipeline_setup_v3/core/case_loader.py index 17a1398..a349ee0 100644 --- a/tests/pipeline_setup_v3/core/case_loader.py +++ b/tests/pipeline_setup_v3/core/case_loader.py @@ -94,15 +94,21 @@ class CaseDirectoryLoader: else None ), path_scope_contains=tuple(str(item) for item in retrieval.get("path_scope_contains") or []), + doc_scope_contains=tuple(str(item) for item in retrieval.get("doc_scope_contains") or []), symbol_candidates_contain=tuple(str(item) for item in retrieval.get("symbol_candidates_contain") or []), + entity_candidates_contain=tuple(str(item) for item in retrieval.get("entity_candidates_contain") or []), layers_include=tuple(str(item) for item in retrieval.get("layers_include") or []), + filters_contain={str(k): str(v) for k, v in dict(retrieval.get("filters_contain") or {}).items()}, ), llm=LlmExpectation( non_empty=llm.get("non_empty"), contains_all=tuple(str(item) for item in llm.get("contains_all") or []), excludes=tuple(str(item) for item in llm.get("excludes") or []), + answer_mode=str(llm.get("answer_mode") or "").strip() or None, + ), + pipeline=PipelineExpectation( + answer_mode=str(pipeline.get("answer_mode") or llm.get("answer_mode") or "").strip() or None ), - pipeline=PipelineExpectation(answer_mode=str(pipeline.get("answer_mode") or "").strip() or None), ) def _normalize_runner(self, value: str) -> str: diff --git a/tests/pipeline_setup_v3/core/models.py b/tests/pipeline_setup_v3/core/models.py index e2e5cf8..5ecb506 100644 --- a/tests/pipeline_setup_v3/core/models.py +++ b/tests/pipeline_setup_v3/core/models.py @@ -30,8 +30,11 @@ class RetrievalExpectation: min_rows: int | None = None direct_symbol_test_hits_max: int | None = None path_scope_contains: tuple[str, ...] = () + doc_scope_contains: tuple[str, ...] = () symbol_candidates_contain: tuple[str, ...] = () + entity_candidates_contain: tuple[str, ...] = () layers_include: tuple[str, ...] = () + filters_contain: dict[str, str] = field(default_factory=dict) @dataclass(slots=True, frozen=True) @@ -39,6 +42,7 @@ class LlmExpectation: non_empty: bool | None = None contains_all: tuple[str, ...] = () excludes: tuple[str, ...] = () + answer_mode: str | None = None @dataclass(slots=True, frozen=True) diff --git a/tests/pipeline_setup_v3/core/runner.py b/tests/pipeline_setup_v3/core/runner.py index cc6a511..a5cdd7a 100644 --- a/tests/pipeline_setup_v3/core/runner.py +++ b/tests/pipeline_setup_v3/core/runner.py @@ -11,8 +11,18 @@ from tests.pipeline_setup_v3.core.validators import CaseValidator class V3Runner: - def __init__(self, cases_dir: Path, results_dir: Path, run_name: str) -> None: + def __init__( + self, + cases_dir: Path, + results_dir: Path, + run_name: str, + *, + pipeline_mode: str = "full", + router_llm_mode: str = "deterministic", + ) -> None: self._cases_dir = cases_dir + self._pipeline_mode = pipeline_mode + self._router_llm_mode = router_llm_mode self._validator = CaseValidator() self._sessions = RagSessionProvider() self._agent_runtime = None @@ -48,5 +58,8 @@ class V3Runner: if self._agent_runtime is None: from tests.pipeline_setup_v3.runtime.agent_runtime_adapter import AgentRuntimeAdapter - self._agent_runtime = AgentRuntimeAdapter() + self._agent_runtime = AgentRuntimeAdapter( + pipeline_mode=self._pipeline_mode, + router_llm_mode=self._router_llm_mode, + ) return self._agent_runtime diff --git a/tests/pipeline_setup_v3/core/session_provider.py b/tests/pipeline_setup_v3/core/session_provider.py index fa99b27..5b3c72b 100644 --- a/tests/pipeline_setup_v3/core/session_provider.py +++ b/tests/pipeline_setup_v3/core/session_provider.py @@ -25,7 +25,7 @@ class RagSessionProvider: def _build_indexer(self): from app.modules.rag.persistence.repository import RagRepository - from tests.pipeline_setup.utils.rag_indexer import RagSessionIndexer + from tests.pipeline_setup_v3.shared.rag_indexer import RagSessionIndexer if self._repository is None: self._repository = RagRepository() diff --git a/tests/pipeline_setup_v3/core/validators.py b/tests/pipeline_setup_v3/core/validators.py index e8d91c4..82d69be 100644 --- a/tests/pipeline_setup_v3/core/validators.py +++ b/tests/pipeline_setup_v3/core/validators.py @@ -39,14 +39,26 @@ class CaseValidator: for path in retrieval.path_scope_contains: if not any(path in item for item in actual.get("path_scope") or ()): mismatches.append(f"path_scope should contain '{path}', got {list(actual.get('path_scope') or ())}") + for path in retrieval.doc_scope_contains: + if not any(path in item for item in actual.get("doc_scope") or ()): + mismatches.append(f"doc_scope should contain '{path}', got {list(actual.get('doc_scope') or ())}") for symbol in retrieval.symbol_candidates_contain: if symbol not in (actual.get("symbol_candidates") or ()): mismatches.append(f"symbol_candidates should contain '{symbol}', got {list(actual.get('symbol_candidates') or ())}") + for entity in retrieval.entity_candidates_contain: + if entity not in (actual.get("entity_candidates") or ()): + mismatches.append(f"entity_candidates should contain '{entity}', got {list(actual.get('entity_candidates') or ())}") for layer in retrieval.layers_include: if layer not in (actual.get("layers") or ()): mismatches.append(f"layers should include '{layer}', got {list(actual.get('layers') or ())}") + for key, value in retrieval.filters_contain.items(): + actual_filters = dict(actual.get("filters") or {}) + if str(actual_filters.get(key) or "") != value: + mismatches.append(f"filters[{key}] should be '{value}', got '{actual_filters.get(key)}'") def _check_llm(self, case: V3Case, actual: dict, mismatches: list[str]) -> None: + if str(actual.get("pipeline_mode") or "") == "pre_llm_only": + return llm = case.expectations.llm answer = str(actual.get("llm_answer") or "").strip() if llm.non_empty and not answer: diff --git a/tests/pipeline_setup/suite_01_synthetic/fixtures/code_qa_repo/main.py b/tests/pipeline_setup_v3/fixtures/code_qa_repo/main.py similarity index 100% rename from tests/pipeline_setup/suite_01_synthetic/fixtures/code_qa_repo/main.py rename to tests/pipeline_setup_v3/fixtures/code_qa_repo/main.py diff --git a/tests/pipeline_setup/suite_01_synthetic/fixtures/code_qa_repo/src/order_app/__init__.py b/tests/pipeline_setup_v3/fixtures/code_qa_repo/src/order_app/__init__.py similarity index 100% rename from tests/pipeline_setup/suite_01_synthetic/fixtures/code_qa_repo/src/order_app/__init__.py rename to tests/pipeline_setup_v3/fixtures/code_qa_repo/src/order_app/__init__.py diff --git a/tests/pipeline_setup/suite_01_synthetic/fixtures/code_qa_repo/src/order_app/api/__init__.py b/tests/pipeline_setup_v3/fixtures/code_qa_repo/src/order_app/api/__init__.py similarity index 100% rename from tests/pipeline_setup/suite_01_synthetic/fixtures/code_qa_repo/src/order_app/api/__init__.py rename to tests/pipeline_setup_v3/fixtures/code_qa_repo/src/order_app/api/__init__.py diff --git a/tests/pipeline_setup/suite_01_synthetic/fixtures/code_qa_repo/src/order_app/api/orders.py b/tests/pipeline_setup_v3/fixtures/code_qa_repo/src/order_app/api/orders.py similarity index 100% rename from tests/pipeline_setup/suite_01_synthetic/fixtures/code_qa_repo/src/order_app/api/orders.py rename to tests/pipeline_setup_v3/fixtures/code_qa_repo/src/order_app/api/orders.py diff --git a/tests/pipeline_setup/suite_01_synthetic/fixtures/code_qa_repo/src/order_app/domain/__init__.py b/tests/pipeline_setup_v3/fixtures/code_qa_repo/src/order_app/domain/__init__.py similarity index 100% rename from tests/pipeline_setup/suite_01_synthetic/fixtures/code_qa_repo/src/order_app/domain/__init__.py rename to tests/pipeline_setup_v3/fixtures/code_qa_repo/src/order_app/domain/__init__.py diff --git a/tests/pipeline_setup/suite_01_synthetic/fixtures/code_qa_repo/src/order_app/domain/order.py b/tests/pipeline_setup_v3/fixtures/code_qa_repo/src/order_app/domain/order.py similarity index 100% rename from tests/pipeline_setup/suite_01_synthetic/fixtures/code_qa_repo/src/order_app/domain/order.py rename to tests/pipeline_setup_v3/fixtures/code_qa_repo/src/order_app/domain/order.py diff --git a/tests/pipeline_setup/suite_01_synthetic/fixtures/code_qa_repo/src/order_app/repositories/__init__.py b/tests/pipeline_setup_v3/fixtures/code_qa_repo/src/order_app/repositories/__init__.py similarity index 100% rename from tests/pipeline_setup/suite_01_synthetic/fixtures/code_qa_repo/src/order_app/repositories/__init__.py rename to tests/pipeline_setup_v3/fixtures/code_qa_repo/src/order_app/repositories/__init__.py diff --git a/tests/pipeline_setup/suite_01_synthetic/fixtures/code_qa_repo/src/order_app/repositories/order_repository.py b/tests/pipeline_setup_v3/fixtures/code_qa_repo/src/order_app/repositories/order_repository.py similarity index 100% rename from tests/pipeline_setup/suite_01_synthetic/fixtures/code_qa_repo/src/order_app/repositories/order_repository.py rename to tests/pipeline_setup_v3/fixtures/code_qa_repo/src/order_app/repositories/order_repository.py diff --git a/tests/pipeline_setup/suite_01_synthetic/fixtures/code_qa_repo/src/order_app/services/__init__.py b/tests/pipeline_setup_v3/fixtures/code_qa_repo/src/order_app/services/__init__.py similarity index 100% rename from tests/pipeline_setup/suite_01_synthetic/fixtures/code_qa_repo/src/order_app/services/__init__.py rename to tests/pipeline_setup_v3/fixtures/code_qa_repo/src/order_app/services/__init__.py diff --git a/tests/pipeline_setup/suite_01_synthetic/fixtures/code_qa_repo/src/order_app/services/order_service.py b/tests/pipeline_setup_v3/fixtures/code_qa_repo/src/order_app/services/order_service.py similarity index 100% rename from tests/pipeline_setup/suite_01_synthetic/fixtures/code_qa_repo/src/order_app/services/order_service.py rename to tests/pipeline_setup_v3/fixtures/code_qa_repo/src/order_app/services/order_service.py diff --git a/tests/pipeline_setup/suite_01_synthetic/fixtures/code_qa_repo/src/order_app/utils/__init__.py b/tests/pipeline_setup_v3/fixtures/code_qa_repo/src/order_app/utils/__init__.py similarity index 100% rename from tests/pipeline_setup/suite_01_synthetic/fixtures/code_qa_repo/src/order_app/utils/__init__.py rename to tests/pipeline_setup_v3/fixtures/code_qa_repo/src/order_app/utils/__init__.py diff --git a/tests/pipeline_setup/suite_01_synthetic/fixtures/code_qa_repo/src/order_app/utils/helpers.py b/tests/pipeline_setup_v3/fixtures/code_qa_repo/src/order_app/utils/helpers.py similarity index 100% rename from tests/pipeline_setup/suite_01_synthetic/fixtures/code_qa_repo/src/order_app/utils/helpers.py rename to tests/pipeline_setup_v3/fixtures/code_qa_repo/src/order_app/utils/helpers.py diff --git a/tests/pipeline_setup/suite_01_synthetic/fixtures/code_qa_repo/tests/test_order_service.py b/tests/pipeline_setup_v3/fixtures/code_qa_repo/tests/test_order_service.py similarity index 100% rename from tests/pipeline_setup/suite_01_synthetic/fixtures/code_qa_repo/tests/test_order_service.py rename to tests/pipeline_setup_v3/fixtures/code_qa_repo/tests/test_order_service.py diff --git a/tests/pipeline_setup_v3/run.py b/tests/pipeline_setup_v3/run.py index 31b9353..8e64e27 100644 --- a/tests/pipeline_setup_v3/run.py +++ b/tests/pipeline_setup_v3/run.py @@ -11,7 +11,7 @@ _src = _agent_root / "src" if _src.exists() and str(_src) not in sys.path: sys.path.insert(0, str(_src)) -from tests.pipeline_setup.env_loader import load_pipeline_setup_env +from tests.pipeline_setup_v3.shared.env_loader import load_pipeline_setup_env from tests.pipeline_setup_v3.core.runner import V3Runner @@ -20,13 +20,26 @@ def main(argv: list[str] | None = None) -> int: parser.add_argument("--cases-dir", required=True, help="Directory or file with YAML case files") parser.add_argument("--run-name", default="manual_run", help="Output directory prefix") parser.add_argument("--results-dir", default=None, help="Override results root directory") + parser.add_argument("--pipeline-mode", default="full", choices=["full", "pre_llm_only"], help="Pipeline execution mode") + parser.add_argument( + "--router-llm-mode", + default="deterministic", + choices=["deterministic", "llm_disambiguation"], + help="Intent router mode: deterministic only or deterministic with optional LLM disambiguation", + ) ns = parser.parse_args(argv) cases_dir = Path(str(ns.cases_dir)).expanduser().resolve() results_dir = Path(str(ns.results_dir)).expanduser().resolve() if ns.results_dir else Path(__file__).resolve().parent / "test_results" - load_pipeline_setup_env(start_dir=_agent_root / "tests" / "pipeline_setup") + load_pipeline_setup_env(start_dir=Path(__file__).resolve().parent) - runner = V3Runner(cases_dir=cases_dir, results_dir=results_dir, run_name=str(ns.run_name).strip() or "manual_run") + runner = V3Runner( + cases_dir=cases_dir, + results_dir=results_dir, + run_name=str(ns.run_name).strip() or "manual_run", + pipeline_mode=str(ns.pipeline_mode).strip() or "full", + router_llm_mode=str(ns.router_llm_mode).strip() or "deterministic", + ) print(f"Cases dir: {cases_dir}") print(f"Run dir: {runner.run_dir}") results, summary_path = runner.run() diff --git a/tests/pipeline_setup_v3/runtime/agent_runtime_adapter.py b/tests/pipeline_setup_v3/runtime/agent_runtime_adapter.py index 703abc2..f635f66 100644 --- a/tests/pipeline_setup_v3/runtime/agent_runtime_adapter.py +++ b/tests/pipeline_setup_v3/runtime/agent_runtime_adapter.py @@ -4,6 +4,7 @@ import math from app.modules.agent.runtime import ( AgentRuntimeExecutor, + DocsQAPipelineRunner, RuntimeRepoContextFactory, RuntimeRetrievalAdapter, ) @@ -11,6 +12,7 @@ from app.modules.agent.llm import AgentLlmService from app.modules.agent.llm.prompt_loader import PromptLoader from app.modules.agent.runtime.steps.context import build_retrieval_request, build_retrieval_result from app.modules.agent.intent_router_v2 import ConversationState, IntentRouterV2 +from app.modules.agent.intent_router_v2.factory import GigaChatIntentRouterFactory from app.modules.shared.gigachat.client import GigaChatClient from app.modules.shared.gigachat.settings import GigaChatSettings from app.modules.shared.gigachat.token_provider import GigaChatTokenProvider @@ -18,13 +20,17 @@ from tests.pipeline_setup_v3.core.models import ExecutionPayload, V3Case class AgentRuntimeAdapter: - def __init__(self) -> None: - self._router = IntentRouterV2() + def __init__(self, *, pipeline_mode: str = "full", router_llm_mode: str = "deterministic") -> None: + self._pipeline_mode = pipeline_mode + self._router_llm_mode = router_llm_mode + self._router = self._build_router() self._repo_context_factory = RuntimeRepoContextFactory() self._retrieval = RuntimeRetrievalAdapter() self._executor: AgentRuntimeExecutor | None = None def execute(self, case: V3Case, rag_session_id: str | None) -> ExecutionPayload: + if self._is_docs_calibration_case(case): + return self._execute_docs_case(case, rag_session_id) if case.mode == "router_only": return self._run_router_only(case) if not rag_session_id: @@ -35,6 +41,25 @@ class AgentRuntimeAdapter: return self._run_full_chain(case, rag_session_id) raise ValueError(f"Unsupported mode: {case.mode}") + def _execute_docs_case(self, case: V3Case, rag_session_id: str | None) -> ExecutionPayload: + route = self._route(case.query) + if route.intent == "CODE_QA": + return self._stubbed_code_payload(case, route) + if case.mode == "router_only": + actual = self._actual_from_route(route) + actual["code_intents_stubbed"] = True + details = { + "query": case.query, + "router_result": route.model_dump(mode="json"), + "rag_rows": [], + "diagnostics": {"code_intents_stubbed": True}, + "pipeline_steps": _router_only_steps(case.query, route), + } + return ExecutionPayload(actual=actual, details=details) + if not rag_session_id: + raise ValueError(f"Case '{case.case_id}' requires rag_session_id or repo_path") + return self._run_docs_chain(case, rag_session_id) + def _run_router_only(self, case: V3Case) -> ExecutionPayload: route = self._route(case.query) actual = self._actual_from_route(route) @@ -42,6 +67,7 @@ class AgentRuntimeAdapter: "query": case.query, "router_result": route.model_dump(mode="json"), "rag_rows": [], + "pipeline_steps": _router_only_steps(case.query, route), } return ExecutionPayload(actual=actual, details=details) @@ -66,6 +92,14 @@ class AgentRuntimeAdapter: "retrieval_result": retrieval_result.model_dump(mode="json"), "rag_rows": raw_rows, "symbol_resolution": symbol_resolution, + "pipeline_steps": _router_rag_steps( + query=case.query, + route=route.model_dump(mode="json"), + retrieval_request=request.model_dump(mode="json"), + retrieval_result=retrieval_result.model_dump(mode="json"), + rag_rows=raw_rows, + symbol_resolution=symbol_resolution, + ), } return ExecutionPayload(actual=actual, details=details) @@ -92,12 +126,23 @@ class AgentRuntimeAdapter: "validation": result.validation.model_dump(mode="json"), "token_usage": _token_usage(result), "steps": list(result.runtime_trace), + "pipeline_steps": _full_chain_steps( + query=case.query, + route=route.model_dump(mode="json") if route else {}, + retrieval_request=request.model_dump(mode="json") if request else {}, + runtime_trace=list(result.runtime_trace), + ), } return ExecutionPayload(actual=actual, details=details) def _route(self, query: str): return self._router.route(query, ConversationState(), self._repo_context_factory.build()) + def _build_router(self) -> IntentRouterV2: + if self._router_llm_mode == "llm_disambiguation": + return GigaChatIntentRouterFactory().build() + return IntentRouterV2() + def _retrieve_rows(self, rag_session_id: str, request) -> list[dict]: if request.sub_intent == "OPEN_FILE" and request.path_scope: return self._retrieval.retrieve_exact_files( @@ -162,6 +207,154 @@ class AgentRuntimeAdapter: self._executor = AgentRuntimeExecutor(_build_llm()) return self._executor + def _docs_runner_instance(self) -> DocsQAPipelineRunner: + return DocsQAPipelineRunner( + router=self._router, + retrieval_adapter=self._retrieval, + repo_context=self._repo_context_factory.build(), + llm=None if self._pipeline_mode == "pre_llm_only" else _build_llm(), + ) + + def _run_docs_chain(self, case: V3Case, rag_session_id: str) -> ExecutionPayload: + result = self._docs_runner_instance().run(case.query, rag_session_id, mode=self._pipeline_mode) + actual = self._actual_from_docs_result(result) + details = { + "query": case.query, + "router_result": result.router_result.model_dump(mode="json"), + "retrieval_request": result.retrieval_request.model_dump(mode="json"), + "diagnostics": result.diagnostics.model_dump(mode="json"), + "llm_request": dict(result.llm_request or {}), + "rag_rows": list(result.raw_rows), + "pipeline_steps": [ + _input_step(case.query), + { + "step": "router", + "input": {"query": case.query}, + "output": { + "intent": result.router_result.intent, + "sub_intent": result.router_result.query_plan.sub_intent, + "graph_id": result.router_result.graph_id, + "conversation_mode": result.router_result.conversation_mode, + }, + }, + { + "step": "docs_pipeline", + "input": {"query": case.query}, + "output": { + "answer_mode": result.answer_mode, + "prompt_name": result.prompt_name, + "llm_request": { + "prompt_name": result.llm_request.get("prompt_name"), + "log_context": result.llm_request.get("log_context"), + "prompt_stats": dict(result.llm_request.get("prompt_stats") or {}), + }, + "degraded_reason": result.degraded_reason, + }, + }, + ], + } + return ExecutionPayload(actual=actual, details=details) + + def _actual_from_docs_result(self, result) -> dict: + route = result.router_result + request = result.retrieval_request + diagnostics = result.diagnostics + entity_candidates = tuple(diagnostics.query_entity_candidates or self._docs_entity_candidates(result.raw_rows)) + doc_scope = tuple(diagnostics.doc_ids or self._docs_scope(result.raw_rows)) + return { + "intent": route.intent, + "sub_intent": route.query_plan.sub_intent, + "graph_id": route.graph_id, + "conversation_mode": route.conversation_mode, + "rag_count": len(result.raw_rows), + "llm_answer": result.answer, + "answer_mode": _docs_answer_status(result.answer_mode, self._pipeline_mode), + "path_scope": tuple(getattr(request, "path_scope", []) or []), + "doc_scope": doc_scope, + "entity_candidates": entity_candidates, + "symbol_candidates": (), + "layers": tuple(request.requested_layers or []), + "filters": { + "doc_type": getattr(request.retrieval_spec.filters, "doc_type", None), + }, + "pipeline_mode": self._pipeline_mode, + "gate_decision": diagnostics.gate_decision, + "prompt_used": result.prompt_name, + "llm_mode": diagnostics.llm_mode, + "degraded_reason": result.degraded_reason or None, + "code_intents_stubbed": True, + } + + def _stubbed_code_payload(self, case: V3Case, route) -> ExecutionPayload: + actual = { + "intent": route.intent, + "sub_intent": route.query_plan.sub_intent, + "graph_id": route.graph_id, + "conversation_mode": route.conversation_mode, + "rag_count": 0, + "llm_answer": "", + "answer_mode": "stubbed", + "status": "stubbed", + "reason": "code intents are temporarily disabled during docs pipeline calibration", + "layers": (), + "symbol_candidates": (), + "code_intents_stubbed": True, + } + details = { + "query": case.query, + "router_result": route.model_dump(mode="json"), + "rag_rows": [], + "diagnostics": { + "code_intents_stubbed": True, + "degraded_reason": "code_intent_stubbed", + }, + "pipeline_steps": [ + _input_step(case.query), + { + "step": "router", + "input": {"query": case.query}, + "output": { + "intent": route.intent, + "sub_intent": route.query_plan.sub_intent, + "graph_id": route.graph_id, + "conversation_mode": route.conversation_mode, + }, + }, + { + "step": "code_stub", + "input": {"query": case.query}, + "output": { + "status": "stubbed", + "reason": "code intents are temporarily disabled during docs pipeline calibration", + }, + }, + ], + } + return ExecutionPayload(actual=actual, details=details) + + def _is_docs_calibration_case(self, case: V3Case) -> bool: + return "suite_03_docs" in case.source_file.as_posix() + + def _docs_scope(self, rows: list[dict]) -> list[str]: + values: list[str] = [] + for row in rows: + metadata = dict(row.get("metadata") or {}) + for candidate in (metadata.get("document_id"), metadata.get("doc_id")): + value = str(candidate or "").strip() + if value and value not in values: + values.append(value) + return values + + def _docs_entity_candidates(self, rows: list[dict]) -> list[str]: + values: list[str] = [] + for row in rows: + if str(row.get("layer") or "") != "D3_ENTITY_CATALOG": + continue + title = str(row.get("title") or "").strip() + if title and title not in values: + values.append(title) + return values + def _build_llm() -> AgentLlmService: settings = GigaChatSettings.from_env() @@ -175,6 +368,16 @@ def _answer_status(answer_mode: str, llm_used: bool) -> str: return answer_mode +def _docs_answer_status(answer_mode: str, pipeline_mode: str) -> str: + if pipeline_mode != "pre_llm_only": + return answer_mode + if answer_mode == "ready": + return "answered" + if answer_mode == "ready_partial": + return "structured_spec" + return answer_mode + + def _token_usage(result) -> dict: draft = result.draft_answer if draft is None: @@ -185,3 +388,108 @@ def _token_usage(result) -> dict: "prompt_name": draft.prompt_name, "tokens_in_estimate": tokens_in_estimate, } + + +def _router_only_steps(query: str, route) -> list[dict]: + route_dump = route.model_dump(mode="json") + return [ + _input_step(query), + { + "step": "router", + "input": {"query": query}, + "output": { + "intent": route_dump.get("intent"), + "sub_intent": dict(route_dump.get("query_plan") or {}).get("sub_intent"), + "graph_id": route_dump.get("graph_id"), + "conversation_mode": route_dump.get("conversation_mode"), + }, + }, + ] + + +def _router_rag_steps( + *, + query: str, + route: dict, + retrieval_request: dict, + retrieval_result: dict, + rag_rows: list[dict], + symbol_resolution: dict, +) -> list[dict]: + return [ + _input_step(query), + { + "step": "router", + "input": {"query": query}, + "output": { + "intent": route.get("intent"), + "sub_intent": dict(route.get("query_plan") or {}).get("sub_intent"), + "graph_id": route.get("graph_id"), + "conversation_mode": route.get("conversation_mode"), + }, + }, + { + "step": "retrieval_planning", + "input": { + "query": query, + "router_result": { + "intent": route.get("intent"), + "sub_intent": dict(route.get("query_plan") or {}).get("sub_intent"), + "graph_id": route.get("graph_id"), + }, + }, + "output": retrieval_request, + }, + { + "step": "retrieval", + "input": retrieval_request, + "output": { + "rag_count": len(rag_rows), + "retrieval_result": retrieval_result, + "symbol_resolution": symbol_resolution, + }, + }, + ] + + +def _full_chain_steps(*, query: str, route: dict, retrieval_request: dict, runtime_trace: list[dict]) -> list[dict]: + steps = [_input_step(query)] + for raw_step in runtime_trace: + step = dict(raw_step) + name = str(step.get("step") or "").strip() + if name == "router": + step.setdefault("input", {"query": query}) + if name == "retrieval": + steps.append( + { + "step": "retrieval_planning", + "input": { + "query": query, + "router_result": { + "intent": route.get("intent"), + "sub_intent": dict(route.get("query_plan") or {}).get("sub_intent"), + "graph_id": route.get("graph_id"), + }, + }, + "output": retrieval_request, + } + ) + step.setdefault("input", retrieval_request) + steps.append( + { + "step": name, + "status": step.get("status"), + "timings_ms": step.get("timings_ms") or {}, + "input": step.get("input") or {}, + "output": step.get("output") or {}, + } + ) + return steps + + +def _input_step(query: str) -> dict: + return { + "step": "input_query", + "input": {"query": query}, + "output": {"query": query}, + } diff --git a/tests/pipeline_setup_v3/shared/__init__.py b/tests/pipeline_setup_v3/shared/__init__.py new file mode 100644 index 0000000..c072946 --- /dev/null +++ b/tests/pipeline_setup_v3/shared/__init__.py @@ -0,0 +1 @@ +"""Shared helpers for pipeline_setup_v3.""" diff --git a/tests/pipeline_setup/env_loader.py b/tests/pipeline_setup_v3/shared/env_loader.py similarity index 70% rename from tests/pipeline_setup/env_loader.py rename to tests/pipeline_setup_v3/shared/env_loader.py index 88e56c1..cc289f9 100644 --- a/tests/pipeline_setup/env_loader.py +++ b/tests/pipeline_setup_v3/shared/env_loader.py @@ -9,19 +9,18 @@ from app.modules.shared.env_loader import load_workspace_env def load_pipeline_setup_env(start_dir: str | Path | None = None) -> list[Path]: base = Path(start_dir or Path.cwd()).resolve() loaded = load_workspace_env(start_dir=base) - pipeline_root = _find_pipeline_setup_root(base) - env_path = pipeline_root / ".env" + env_path = _find_v3_root(base) / ".env" if env_path.is_file(): _apply_env_file(env_path) loaded.append(env_path) return loaded -def _find_pipeline_setup_root(base: Path) -> Path: +def _find_v3_root(base: Path) -> Path: for directory in (base, *base.parents): - if directory.name == "pipeline_setup" and (directory / "__init__.py").is_file(): + if directory.name == "pipeline_setup_v3" and (directory / "__init__.py").is_file(): return directory - raise RuntimeError(f"Unable to locate tests/pipeline_setup root from: {base}") + raise RuntimeError(f"Unable to locate tests/pipeline_setup_v3 root from: {base}") def _apply_env_file(path: Path) -> None: @@ -31,9 +30,8 @@ def _apply_env_file(path: Path) -> None: continue key, raw_value = line.split("=", 1) name = key.removeprefix("export ").strip() - if not name: - continue - os.environ[name] = _normalize_value(raw_value.strip()) + if name: + os.environ[name] = _normalize_value(raw_value.strip()) def _normalize_value(value: str) -> str: diff --git a/tests/pipeline_setup/utils/rag_indexer/indexer.py b/tests/pipeline_setup_v3/shared/rag_indexer.py similarity index 98% rename from tests/pipeline_setup/utils/rag_indexer/indexer.py rename to tests/pipeline_setup_v3/shared/rag_indexer.py index deef62d..f1f4712 100644 --- a/tests/pipeline_setup/utils/rag_indexer/indexer.py +++ b/tests/pipeline_setup_v3/shared/rag_indexer.py @@ -34,6 +34,8 @@ class LocalRepoFileCollector: def _should_skip(self, path: Path) -> bool: rel_parts = path.relative_to(self._root).parts + if not rel_parts or rel_parts[0] != "docs": + return True if any(part in self._SKIP_DIRS for part in rel_parts): return True if any(part.startswith(".") for part in rel_parts): diff --git a/tests/pipeline_setup_v3/test_results/docs_pre_llm_v3/20260326_120832/full_chain_docs_intents_v2_docs-v2-api-health-endpoint.json b/tests/pipeline_setup_v3/test_results/docs_pre_llm_v3/20260326_120832/full_chain_docs_intents_v2_docs-v2-api-health-endpoint.json new file mode 100644 index 0000000..f6f6945 --- /dev/null +++ b/tests/pipeline_setup_v3/test_results/docs_pre_llm_v3/20260326_120832/full_chain_docs_intents_v2_docs-v2-api-health-endpoint.json @@ -0,0 +1,83 @@ +{ + "meta": { + "case_id": "docs-v2-api-health-endpoint", + "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_03_docs/full_chain_docs_intents_v2.yaml", + "runner": "agent_runtime", + "mode": "full_chain", + "passed": true, + "mismatches": [], + "actual": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "API_METHOD_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START", + "rag_count": 2, + "llm_answer": "", + "answer_mode": "answered", + "path_scope": [], + "doc_scope": [ + "api.health_endpoint" + ], + "entity_candidates": [], + "symbol_candidates": [], + "layers": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D4_WORKFLOW_INDEX", + "D0_DOC_CHUNKS" + ], + "filters": { + "doc_type": "api_method" + }, + "pipeline_mode": "pre_llm_only", + "gate_decision": "allow", + "prompt_used": "docs_explain_answer", + "llm_mode": "prose", + "degraded_reason": null, + "code_intents_stubbed": true + } + }, + "pipeline_steps": [ + { + "step": "input_query", + "input": { + "query": "Объясни что делает endpoint /health" + }, + "output": { + "query": "Объясни что делает endpoint /health" + } + }, + { + "step": "router", + "input": { + "query": "Объясни что делает endpoint /health" + }, + "output": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "API_METHOD_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START" + } + }, + { + "step": "docs_pipeline", + "input": { + "query": "Объясни что делает endpoint /health" + }, + "output": { + "answer_mode": "ready", + "prompt_name": "docs_explain_answer", + "llm_request": { + "prompt_name": "docs_explain_answer", + "log_context": "graph.project_qa.docs.answer", + "prompt_stats": { + "system_chars": 393, + "user_chars": 2265, + "tokens_in_estimate": 665 + } + }, + "degraded_reason": "" + } + } + ] +} \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/docs_pre_llm_v3/20260326_120832/full_chain_docs_intents_v2_docs-v2-api-health-endpoint.md b/tests/pipeline_setup_v3/test_results/docs_pre_llm_v3/20260326_120832/full_chain_docs_intents_v2_docs-v2-api-health-endpoint.md new file mode 100644 index 0000000..fde796a --- /dev/null +++ b/tests/pipeline_setup_v3/test_results/docs_pre_llm_v3/20260326_120832/full_chain_docs_intents_v2_docs-v2-api-health-endpoint.md @@ -0,0 +1,368 @@ +# docs-v2-api-health-endpoint + +- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_03_docs/full_chain_docs_intents_v2.yaml +- runner: agent_runtime +- mode: full_chain +- passed: True + +## Query +Объясни что делает endpoint /health + +## Actual +{ + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "API_METHOD_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START", + "rag_count": 2, + "llm_answer": "", + "answer_mode": "answered", + "path_scope": [], + "doc_scope": [ + "api.health_endpoint" + ], + "entity_candidates": [], + "symbol_candidates": [], + "layers": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D4_WORKFLOW_INDEX", + "D0_DOC_CHUNKS" + ], + "filters": { + "doc_type": "api_method" + }, + "pipeline_mode": "pre_llm_only", + "gate_decision": "allow", + "prompt_used": "docs_explain_answer", + "llm_mode": "prose", + "degraded_reason": null, + "code_intents_stubbed": true +} + +## Pipeline Steps +### input_query +```json +{ + "input": { + "query": "Объясни что делает endpoint /health" + }, + "output": { + "query": "Объясни что делает endpoint /health" + } +} +``` + +### router +```json +{ + "input": { + "query": "Объясни что делает endpoint /health" + }, + "output": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "API_METHOD_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START" + } +} +``` + +### docs_pipeline +```json +{ + "input": { + "query": "Объясни что делает endpoint /health" + }, + "output": { + "answer_mode": "ready", + "prompt_name": "docs_explain_answer", + "llm_request": { + "prompt_name": "docs_explain_answer", + "log_context": "graph.project_qa.docs.answer", + "prompt_stats": { + "system_chars": 393, + "user_chars": 2265, + "tokens_in_estimate": 665 + } + }, + "degraded_reason": "" + } +} +``` + +## Diagnostics +{ + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "API_METHOD_EXPLAIN", + "layers_used": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D4_WORKFLOW_INDEX", + "D0_DOC_CHUNKS" + ], + "documents_found": 1, + "facts_found": 0, + "relations_found": 0, + "openapi_fields_extracted": 0, + "missing_required_fields": [], + "openapi_status": { + "has_path": false, + "has_method": false, + "has_request": false, + "has_response": false + }, + "prompt_used": "docs_explain_answer", + "llm_mode": "prose", + "output_valid": true, + "matched_intent_source": "deterministic", + "matched_anchor_type": "endpoint", + "matched_anchor_value": "/health", + "exact_anchor_match": true, + "docs_layers_requested": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D4_WORKFLOW_INDEX", + "D0_DOC_CHUNKS" + ], + "docs_layers_with_hits": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D4_WORKFLOW_INDEX", + "D0_DOC_CHUNKS" + ], + "planned_layers": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D4_WORKFLOW_INDEX", + "D0_DOC_CHUNKS" + ], + "executed_layers": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D4_WORKFLOW_INDEX", + "D0_DOC_CHUNKS" + ], + "non_empty_layers": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D4_WORKFLOW_INDEX", + "D0_DOC_CHUNKS" + ], + "layer_diagnostics": { + "D1_DOCUMENT_CATALOG": { + "hits": 6, + "top_ids": [ + "api.send_message_endpoint", + "api.control_actions_endpoint", + "api.health_endpoint", + "domain.runtime_health", + "architecture.telegram_notify_app" + ] + }, + "D2_FACT_INDEX": { + "hits": 8, + "top_ids": [ + "f85d982c272a2ee6baeadc433221a20e684cd8ef01cb4788d6f76d05ca56d6d0", + "b8e44c3adb74aaa6c91ae8815fa091289e58dd3990a3a1b63e850c62075aea75", + "b6bfad59b3bf00f199b5ef90c1208af19664de700413e7354468a93a4abaaa2f", + "a8a325e0815b3a2a870ba2825f3afb3f41056b4c091df4c3bb3418ffd20891dd", + "bafb867ffed41c9db637df98d6cd5f6722d7747bbebc6c03e6f0d0caf3b7f9f3" + ] + }, + "D4_WORKFLOW_INDEX": { + "hits": 3, + "top_ids": [ + "api.control_actions_endpoint", + "api.health_endpoint", + "api.send_message_endpoint" + ] + }, + "D0_DOC_CHUNKS": { + "hits": 6, + "top_ids": [ + "api.control_actions_endpoint" + ] + } + }, + "query_entity_candidates": [], + "resolved_entity_candidates": [], + "query_anchor_candidates": [ + "/health" + ], + "resolved_anchor_candidates": [ + "api.health_endpoint", + "docs/documentation/api/health-endpoint.md" + ], + "anchor_candidates": [], + "selected_anchor": null, + "anchor_selection_reason": "", + "anchor_match_type": "", + "doc_ids": [ + "api.health_endpoint" + ], + "doc_paths": [ + "docs/documentation/api/health-endpoint.md" + ], + "doc_titles": [ + "HTTP API /health", + "Scenario" + ], + "relation_hits_count": 0, + "relation_targets": [], + "fallback_doc_hits_count": 1, + "fallback_used": false, + "fact_hits": 0, + "entity_hits": 0, + "evidence_summary": { + "documents": 1, + "facts": 0, + "relations": 0, + "chunks": 0, + "entity_hits": 0, + "openapi_signals": { + "path_found": false, + "method_found": false, + "request_schema": false, + "response_schema": false, + "status_codes": false, + "payload_description": false + } + }, + "gate_decision": "allow", + "gate_decision_reason": "evidence_sufficient", + "gate_missing_requirements": [], + "gate_satisfied_requirements": [ + "retrieval_non_empty", + "exact_anchor_match" + ], + "openapi_evidence": { + "path_found": false, + "method_found": false, + "request_schema": false, + "response_schema": false, + "status_codes": false, + "payload_description": false + }, + "requested_fragment_type": null, + "fragment_evidence_found": [], + "fragment_missing_requirements": [], + "answer_mode": "ready", + "degrade_reason": null, + "degraded_reason": null, + "code_intents_stubbed": false +} + +## LLM Request +- prompt_name: docs_explain_answer +- log_context: graph.project_qa.docs.answer + +### Prompt Stats +```json +{ + "system_chars": 393, + "user_chars": 2265, + "tokens_in_estimate": 665 +} +``` + +### System Prompt +```text +Ты объясняешь документацию системы. + +На вход приходит JSON с полями: +- question +- intent +- sub_intent +- documents +- facts +- relations + +Правила: +- Используй только предоставленные факты +- Не додумывай +- Если данных недостаточно, скажи это явно +- Объясняй структурировано + +Формат ответа: +1. Краткое описание +2. Основные элементы +3. Как это работает +4. Связи с другими частями системы (если есть) +``` + +### User Prompt +```json +{ + "question": "Объясни что делает endpoint /health", + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "API_METHOD_EXPLAIN", + "documents": [ + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/api/health-endpoint.md", + "title": "HTTP API /health", + "content": "Endpoint `/health` возвращает агрегированный health payload runtime. Если общий статус равен `ok`, API отвечает с HTTP 200; для состояний деградации или неготовности возвращается HTTP 503 с тем же payload. Endpoint служит основной точкой внешней проверки состояния приложения.", + "metadata": { + "name": "health_endpoint", + "tags": [ + "api", + "health", + "control-plane" + ], + "type": "api_method", + "layer": "application", + "links": [ + { + "type": "part_of", + "target": "architecture.telegram_notify_app" + }, + { + "type": "depends_on", + "target": "domain.runtime_health" + } + ], + "owner": null, + "title": "HTTP API /health", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "architecture.telegram_notify_app", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "8b5a533a8076e2e9d36995eee29aeade260080bdca2ec8e21fe28f08574b983f", + "children": [], + "doc_kind": "misc", + "entities": [ + "TelegramControlChannel", + "TelegramNotifyWorker", + "RuntimeManager", + "WorkerHealth" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "api.health_endpoint", + "source_path": "docs/documentation/api/health-endpoint.md", + "summary_text": "Endpoint `/health` возвращает агрегированный health payload runtime. Если общий статус равен `ok`, API отвечает с HTTP 200; для состояний деградации или неготовности возвращается HTTP 503 с тем же payload. Endpoint служит основной точкой внешней проверки состояния приложения.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + } + ], + "facts": [], + "relations": [] +} +``` + +### User Prompt Overview +- question: Объясни что делает endpoint /health +- intent: DOCUMENTATION_EXPLAIN +- sub_intent: API_METHOD_EXPLAIN +- documents: 1 | samples: HTTP API /health +- facts: 0 +- relations: 0 + +## Mismatches +- none \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/docs_pre_llm_v3/20260326_120832/full_chain_docs_intents_v2_docs-v2-api-send-endpoint.json b/tests/pipeline_setup_v3/test_results/docs_pre_llm_v3/20260326_120832/full_chain_docs_intents_v2_docs-v2-api-send-endpoint.json new file mode 100644 index 0000000..b8a61ad --- /dev/null +++ b/tests/pipeline_setup_v3/test_results/docs_pre_llm_v3/20260326_120832/full_chain_docs_intents_v2_docs-v2-api-send-endpoint.json @@ -0,0 +1,83 @@ +{ + "meta": { + "case_id": "docs-v2-api-send-endpoint", + "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_03_docs/full_chain_docs_intents_v2.yaml", + "runner": "agent_runtime", + "mode": "full_chain", + "passed": true, + "mismatches": [], + "actual": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "API_METHOD_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START", + "rag_count": 2, + "llm_answer": "", + "answer_mode": "answered", + "path_scope": [], + "doc_scope": [ + "api.send_message_endpoint" + ], + "entity_candidates": [], + "symbol_candidates": [], + "layers": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D4_WORKFLOW_INDEX", + "D0_DOC_CHUNKS" + ], + "filters": { + "doc_type": "api_method" + }, + "pipeline_mode": "pre_llm_only", + "gate_decision": "allow", + "prompt_used": "docs_explain_answer", + "llm_mode": "prose", + "degraded_reason": null, + "code_intents_stubbed": true + } + }, + "pipeline_steps": [ + { + "step": "input_query", + "input": { + "query": "Как работает endpoint /send?" + }, + "output": { + "query": "Как работает endpoint /send?" + } + }, + { + "step": "router", + "input": { + "query": "Как работает endpoint /send?" + }, + "output": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "API_METHOD_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START" + } + }, + { + "step": "docs_pipeline", + "input": { + "query": "Как работает endpoint /send?" + }, + "output": { + "answer_mode": "ready", + "prompt_name": "docs_explain_answer", + "llm_request": { + "prompt_name": "docs_explain_answer", + "log_context": "graph.project_qa.docs.answer", + "prompt_stats": { + "system_chars": 393, + "user_chars": 2309, + "tokens_in_estimate": 676 + } + }, + "degraded_reason": "" + } + } + ] +} \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/docs_pre_llm_v3/20260326_120832/full_chain_docs_intents_v2_docs-v2-api-send-endpoint.md b/tests/pipeline_setup_v3/test_results/docs_pre_llm_v3/20260326_120832/full_chain_docs_intents_v2_docs-v2-api-send-endpoint.md new file mode 100644 index 0000000..e66bcfa --- /dev/null +++ b/tests/pipeline_setup_v3/test_results/docs_pre_llm_v3/20260326_120832/full_chain_docs_intents_v2_docs-v2-api-send-endpoint.md @@ -0,0 +1,367 @@ +# docs-v2-api-send-endpoint + +- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_03_docs/full_chain_docs_intents_v2.yaml +- runner: agent_runtime +- mode: full_chain +- passed: True + +## Query +Как работает endpoint /send? + +## Actual +{ + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "API_METHOD_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START", + "rag_count": 2, + "llm_answer": "", + "answer_mode": "answered", + "path_scope": [], + "doc_scope": [ + "api.send_message_endpoint" + ], + "entity_candidates": [], + "symbol_candidates": [], + "layers": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D4_WORKFLOW_INDEX", + "D0_DOC_CHUNKS" + ], + "filters": { + "doc_type": "api_method" + }, + "pipeline_mode": "pre_llm_only", + "gate_decision": "allow", + "prompt_used": "docs_explain_answer", + "llm_mode": "prose", + "degraded_reason": null, + "code_intents_stubbed": true +} + +## Pipeline Steps +### input_query +```json +{ + "input": { + "query": "Как работает endpoint /send?" + }, + "output": { + "query": "Как работает endpoint /send?" + } +} +``` + +### router +```json +{ + "input": { + "query": "Как работает endpoint /send?" + }, + "output": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "API_METHOD_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START" + } +} +``` + +### docs_pipeline +```json +{ + "input": { + "query": "Как работает endpoint /send?" + }, + "output": { + "answer_mode": "ready", + "prompt_name": "docs_explain_answer", + "llm_request": { + "prompt_name": "docs_explain_answer", + "log_context": "graph.project_qa.docs.answer", + "prompt_stats": { + "system_chars": 393, + "user_chars": 2309, + "tokens_in_estimate": 676 + } + }, + "degraded_reason": "" + } +} +``` + +## Diagnostics +{ + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "API_METHOD_EXPLAIN", + "layers_used": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D4_WORKFLOW_INDEX", + "D0_DOC_CHUNKS" + ], + "documents_found": 1, + "facts_found": 0, + "relations_found": 0, + "openapi_fields_extracted": 0, + "missing_required_fields": [], + "openapi_status": { + "has_path": false, + "has_method": false, + "has_request": false, + "has_response": false + }, + "prompt_used": "docs_explain_answer", + "llm_mode": "prose", + "output_valid": true, + "matched_intent_source": "deterministic", + "matched_anchor_type": "endpoint", + "matched_anchor_value": "/send", + "exact_anchor_match": true, + "docs_layers_requested": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D4_WORKFLOW_INDEX", + "D0_DOC_CHUNKS" + ], + "docs_layers_with_hits": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D4_WORKFLOW_INDEX", + "D0_DOC_CHUNKS" + ], + "planned_layers": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D4_WORKFLOW_INDEX", + "D0_DOC_CHUNKS" + ], + "executed_layers": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D4_WORKFLOW_INDEX", + "D0_DOC_CHUNKS" + ], + "non_empty_layers": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D4_WORKFLOW_INDEX", + "D0_DOC_CHUNKS" + ], + "layer_diagnostics": { + "D1_DOCUMENT_CATALOG": { + "hits": 6, + "top_ids": [ + "api.send_message_endpoint", + "api.control_actions_endpoint", + "api.health_endpoint", + "architecture.telegram_notify_app", + "docs/README.md" + ] + }, + "D2_FACT_INDEX": { + "hits": 8, + "top_ids": [ + "f85d982c272a2ee6baeadc433221a20e684cd8ef01cb4788d6f76d05ca56d6d0", + "b8e44c3adb74aaa6c91ae8815fa091289e58dd3990a3a1b63e850c62075aea75", + "bafb867ffed41c9db637df98d6cd5f6722d7747bbebc6c03e6f0d0caf3b7f9f3", + "54bbcbac242f1c85ec3280236ed5841998a8a3a548ff16cbf0b5acafbff469e3", + "b6bfad59b3bf00f199b5ef90c1208af19664de700413e7354468a93a4abaaa2f" + ] + }, + "D4_WORKFLOW_INDEX": { + "hits": 3, + "top_ids": [ + "api.control_actions_endpoint", + "api.health_endpoint", + "api.send_message_endpoint" + ] + }, + "D0_DOC_CHUNKS": { + "hits": 6, + "top_ids": [ + "api.control_actions_endpoint" + ] + } + }, + "query_entity_candidates": [], + "resolved_entity_candidates": [], + "query_anchor_candidates": [ + "/send" + ], + "resolved_anchor_candidates": [ + "api.send_message_endpoint", + "docs/documentation/api/send-message-endpoint.md" + ], + "anchor_candidates": [], + "selected_anchor": null, + "anchor_selection_reason": "", + "anchor_match_type": "", + "doc_ids": [ + "api.send_message_endpoint" + ], + "doc_paths": [ + "docs/documentation/api/send-message-endpoint.md" + ], + "doc_titles": [ + "HTTP API /send", + "Scenario" + ], + "relation_hits_count": 0, + "relation_targets": [], + "fallback_doc_hits_count": 1, + "fallback_used": false, + "fact_hits": 0, + "entity_hits": 0, + "evidence_summary": { + "documents": 1, + "facts": 0, + "relations": 0, + "chunks": 0, + "entity_hits": 0, + "openapi_signals": { + "path_found": false, + "method_found": false, + "request_schema": false, + "response_schema": false, + "status_codes": false, + "payload_description": false + } + }, + "gate_decision": "allow", + "gate_decision_reason": "evidence_sufficient", + "gate_missing_requirements": [], + "gate_satisfied_requirements": [ + "retrieval_non_empty", + "exact_anchor_match" + ], + "openapi_evidence": { + "path_found": false, + "method_found": false, + "request_schema": false, + "response_schema": false, + "status_codes": false, + "payload_description": false + }, + "requested_fragment_type": null, + "fragment_evidence_found": [], + "fragment_missing_requirements": [], + "answer_mode": "ready", + "degrade_reason": null, + "degraded_reason": null, + "code_intents_stubbed": false +} + +## LLM Request +- prompt_name: docs_explain_answer +- log_context: graph.project_qa.docs.answer + +### Prompt Stats +```json +{ + "system_chars": 393, + "user_chars": 2309, + "tokens_in_estimate": 676 +} +``` + +### System Prompt +```text +Ты объясняешь документацию системы. + +На вход приходит JSON с полями: +- question +- intent +- sub_intent +- documents +- facts +- relations + +Правила: +- Используй только предоставленные факты +- Не додумывай +- Если данных недостаточно, скажи это явно +- Объясняй структурировано + +Формат ответа: +1. Краткое описание +2. Основные элементы +3. Как это работает +4. Связи с другими частями системы (если есть) +``` + +### User Prompt +```json +{ + "question": "Как работает endpoint /send?", + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "API_METHOD_EXPLAIN", + "documents": [ + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/api/send-message-endpoint.md", + "title": "HTTP API /send", + "content": "Endpoint `/send` выполняет ручную отправку сообщения в Telegram через `TelegramSendService`. Он используется для операторской проверки доставки и для отправки уведомлений вне периодического worker loop. Endpoint работает поверх тех же credentials и того же delivery path, что и фоновая отправка.", + "metadata": { + "name": "send_message_endpoint", + "tags": [ + "api", + "telegram", + "manual-send" + ], + "type": "api_method", + "layer": "application", + "links": [ + { + "type": "part_of", + "target": "architecture.telegram_notify_app" + }, + { + "type": "depends_on", + "target": "logic.telegram_notification_loop" + } + ], + "owner": null, + "title": "HTTP API /send", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "architecture.telegram_notify_app", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "5fbf2e33510b0676a3a53b957a4569bd3c2c31fb7719546602c573421ccaa32d", + "children": [], + "doc_kind": "misc", + "entities": [ + "TelegramControlAppFactory", + "TelegramSendService", + "TelegramNotifyWorker" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "api.send_message_endpoint", + "source_path": "docs/documentation/api/send-message-endpoint.md", + "summary_text": "Endpoint `/send` выполняет ручную отправку сообщения в Telegram через `TelegramSendService`. Он используется для операторской проверки доставки и для отправки уведомлений вне периодического worker loop. Endpoint работает поверх тех же credentials и того же delivery path, что и фоновая отправка.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + } + ], + "facts": [], + "relations": [] +} +``` + +### User Prompt Overview +- question: Как работает endpoint /send? +- intent: DOCUMENTATION_EXPLAIN +- sub_intent: API_METHOD_EXPLAIN +- documents: 1 | samples: HTTP API /send +- facts: 0 +- relations: 0 + +## Mismatches +- none \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/docs_pre_llm_v3/20260326_120832/full_chain_docs_intents_v2_docs-v2-component-control-channel.json b/tests/pipeline_setup_v3/test_results/docs_pre_llm_v3/20260326_120832/full_chain_docs_intents_v2_docs-v2-component-control-channel.json new file mode 100644 index 0000000..ed28f4a --- /dev/null +++ b/tests/pipeline_setup_v3/test_results/docs_pre_llm_v3/20260326_120832/full_chain_docs_intents_v2_docs-v2-component-control-channel.json @@ -0,0 +1,92 @@ +{ + "meta": { + "case_id": "docs-v2-component-control-channel", + "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_03_docs/full_chain_docs_intents_v2.yaml", + "runner": "agent_runtime", + "mode": "full_chain", + "passed": true, + "mismatches": [], + "actual": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "COMPONENT_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START", + "rag_count": 20, + "llm_answer": "", + "answer_mode": "answered", + "path_scope": [], + "doc_scope": [ + "api.control_actions_endpoint", + "api.actions_endpoint", + "architecture.telegram_notify_app", + "architecture.telegram_notify_app_overview", + "docs/README.md", + "domain.runtime_health", + "logic.telegram_notification_loop", + "api.send_message_endpoint" + ], + "entity_candidates": [ + "TelegramControlChannel" + ], + "symbol_candidates": [], + "layers": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "filters": { + "doc_type": null + }, + "pipeline_mode": "pre_llm_only", + "gate_decision": "allow", + "prompt_used": "docs_explain_answer", + "llm_mode": "prose", + "degraded_reason": null, + "code_intents_stubbed": true + } + }, + "pipeline_steps": [ + { + "step": "input_query", + "input": { + "query": "Объясни как работает компонент TelegramControlChannel" + }, + "output": { + "query": "Объясни как работает компонент TelegramControlChannel" + } + }, + { + "step": "router", + "input": { + "query": "Объясни как работает компонент TelegramControlChannel" + }, + "output": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "COMPONENT_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START" + } + }, + { + "step": "docs_pipeline", + "input": { + "query": "Объясни как работает компонент TelegramControlChannel" + }, + "output": { + "answer_mode": "ready", + "prompt_name": "docs_explain_answer", + "llm_request": { + "prompt_name": "docs_explain_answer", + "log_context": "graph.project_qa.docs.answer", + "prompt_stats": { + "system_chars": 393, + "user_chars": 21517, + "tokens_in_estimate": 5478 + } + }, + "degraded_reason": "" + } + } + ] +} \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/docs_pre_llm_v3/20260326_120832/full_chain_docs_intents_v2_docs-v2-component-control-channel.md b/tests/pipeline_setup_v3/test_results/docs_pre_llm_v3/20260326_120832/full_chain_docs_intents_v2_docs-v2-component-control-channel.md new file mode 100644 index 0000000..e29385b --- /dev/null +++ b/tests/pipeline_setup_v3/test_results/docs_pre_llm_v3/20260326_120832/full_chain_docs_intents_v2_docs-v2-component-control-channel.md @@ -0,0 +1,900 @@ +# docs-v2-component-control-channel + +- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_03_docs/full_chain_docs_intents_v2.yaml +- runner: agent_runtime +- mode: full_chain +- passed: True + +## Query +Объясни как работает компонент TelegramControlChannel + +## Actual +{ + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "COMPONENT_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START", + "rag_count": 20, + "llm_answer": "", + "answer_mode": "answered", + "path_scope": [], + "doc_scope": [ + "api.control_actions_endpoint", + "api.actions_endpoint", + "architecture.telegram_notify_app", + "architecture.telegram_notify_app_overview", + "docs/README.md", + "domain.runtime_health", + "logic.telegram_notification_loop", + "api.send_message_endpoint" + ], + "entity_candidates": [ + "TelegramControlChannel" + ], + "symbol_candidates": [], + "layers": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "filters": { + "doc_type": null + }, + "pipeline_mode": "pre_llm_only", + "gate_decision": "allow", + "prompt_used": "docs_explain_answer", + "llm_mode": "prose", + "degraded_reason": null, + "code_intents_stubbed": true +} + +## Pipeline Steps +### input_query +```json +{ + "input": { + "query": "Объясни как работает компонент TelegramControlChannel" + }, + "output": { + "query": "Объясни как работает компонент TelegramControlChannel" + } +} +``` + +### router +```json +{ + "input": { + "query": "Объясни как работает компонент TelegramControlChannel" + }, + "output": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "COMPONENT_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START" + } +} +``` + +### docs_pipeline +```json +{ + "input": { + "query": "Объясни как работает компонент TelegramControlChannel" + }, + "output": { + "answer_mode": "ready", + "prompt_name": "docs_explain_answer", + "llm_request": { + "prompt_name": "docs_explain_answer", + "log_context": "graph.project_qa.docs.answer", + "prompt_stats": { + "system_chars": 393, + "user_chars": 21517, + "tokens_in_estimate": 5478 + } + }, + "degraded_reason": "" + } +} +``` + +## Diagnostics +{ + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "COMPONENT_EXPLAIN", + "layers_used": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "documents_found": 6, + "facts_found": 2, + "relations_found": 6, + "openapi_fields_extracted": 0, + "missing_required_fields": [], + "openapi_status": { + "has_path": false, + "has_method": false, + "has_request": false, + "has_response": false + }, + "prompt_used": "docs_explain_answer", + "llm_mode": "prose", + "output_valid": true, + "matched_intent_source": "deterministic", + "matched_anchor_type": "component", + "matched_anchor_value": "TelegramControlChannel", + "exact_anchor_match": false, + "docs_layers_requested": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "docs_layers_with_hits": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "planned_layers": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "executed_layers": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "non_empty_layers": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "layer_diagnostics": { + "D1_DOCUMENT_CATALOG": { + "hits": 6, + "top_ids": [ + "api.control_actions_endpoint", + "architecture.telegram_notify_app", + "docs/README.md", + "domain.runtime_health", + "logic.telegram_notification_loop" + ] + }, + "D2_FACT_INDEX": { + "hits": 8, + "top_ids": [ + "b480201013a7e5231146f665773ebc54af37c28135f407c6b758304c74561645", + "b8e44c3adb74aaa6c91ae8815fa091289e58dd3990a3a1b63e850c62075aea75", + "bafb867ffed41c9db637df98d6cd5f6722d7747bbebc6c03e6f0d0caf3b7f9f3", + "54bbcbac242f1c85ec3280236ed5841998a8a3a548ff16cbf0b5acafbff469e3", + "b6bfad59b3bf00f199b5ef90c1208af19664de700413e7354468a93a4abaaa2f" + ] + }, + "D5_RELATION_GRAPH": { + "hits": 6, + "top_ids": [ + "afec31fd062e392dcd9699a92c7ab61fd4b1273c1a2b16702b23d55d8d0c47ac", + "711fb2edb82dd222deaba3c91768b18cbbd453009235823282813c6e867dc2c1", + "eec79f7a02b804337e791ef231784862ae26e0599eb20224790e9d4f085fa9c0", + "5f4909bde905cd3d294ad307074a05e4ae4deefcafe6272cd2d0436e73acb8dd", + "ae34fe4b3cd2b47632b13b1e32303e842b57948aa21160abe8d9b478995e1d74" + ] + }, + "D0_DOC_CHUNKS": { + "hits": 6, + "top_ids": [ + "api.control_actions_endpoint" + ] + } + }, + "query_entity_candidates": [ + "TelegramControlChannel" + ], + "resolved_entity_candidates": [], + "query_anchor_candidates": [ + "TelegramControlChannel" + ], + "resolved_anchor_candidates": [ + "api.control_actions_endpoint", + "docs/documentation/api/control-actions-endpoint.md", + "architecture.telegram_notify_app", + "docs/documentation/architecture/telegram-notify-app-overview.md", + "docs/README.md", + "domain.runtime_health", + "docs/documentation/domain/runtime-health-entity.md", + "logic.telegram_notification_loop", + "docs/documentation/logic/telegram-notification-loop.md", + "api.send_message_endpoint", + "docs/documentation/api/send-message-endpoint.md" + ], + "anchor_candidates": [], + "selected_anchor": null, + "anchor_selection_reason": "", + "anchor_match_type": "", + "doc_ids": [ + "api.control_actions_endpoint", + "api.actions_endpoint", + "architecture.telegram_notify_app", + "architecture.telegram_notify_app_overview", + "docs/README.md", + "domain.runtime_health", + "logic.telegram_notification_loop", + "api.send_message_endpoint" + ], + "doc_paths": [ + "docs/documentation/api/control-actions-endpoint.md", + "docs/documentation/architecture/telegram-notify-app-overview.md", + "docs/README.md", + "docs/documentation/domain/runtime-health-entity.md", + "docs/documentation/logic/telegram-notification-loop.md", + "docs/documentation/api/send-message-endpoint.md" + ], + "doc_titles": [ + "HTTP API /actions/{action}", + "Архитектура Telegram Notify App", + "Readme", + "Сущность runtime health", + "Цикл отправки уведомлений в Telegram", + "HTTP API /send", + "api.control_actions_endpoint:workflow_step", + "api.control_actions_endpoint:mentions_entity", + "api.control_actions_endpoint:parent", + "api.control_actions_endpoint:related_api", + "api.control_actions_endpoint:related_logic", + "api.control_actions_endpoint:part_of", + "architecture.telegram_notify_app:child", + "architecture.telegram_notify_app:related_api", + "api.control_actions_endpoint:Функциональные требования", + "api.control_actions_endpoint:Нефункциональные требования", + "api.control_actions_endpoint:Сценарий", + "api.control_actions_endpoint:Summary", + "api.control_actions_endpoint:Описание", + "api.control_actions_endpoint:Входные параметры" + ], + "relation_hits_count": 6, + "relation_targets": [ + "api.control_actions_endpoint:parent", + "api.control_actions_endpoint:related_api", + "api.control_actions_endpoint:related_logic", + "api.control_actions_endpoint:part_of", + "architecture.telegram_notify_app:child", + "architecture.telegram_notify_app:related_api" + ], + "fallback_doc_hits_count": 12, + "fallback_used": false, + "fact_hits": 2, + "entity_hits": 0, + "evidence_summary": { + "documents": 6, + "facts": 2, + "relations": 6, + "chunks": 6, + "entity_hits": 0, + "openapi_signals": { + "path_found": false, + "method_found": false, + "request_schema": false, + "response_schema": false, + "status_codes": false, + "payload_description": false + } + }, + "gate_decision": "allow", + "gate_decision_reason": "evidence_sufficient", + "gate_missing_requirements": [], + "gate_satisfied_requirements": [ + "retrieval_non_empty" + ], + "openapi_evidence": { + "path_found": false, + "method_found": false, + "request_schema": false, + "response_schema": false, + "status_codes": false, + "payload_description": false + }, + "requested_fragment_type": null, + "fragment_evidence_found": [], + "fragment_missing_requirements": [], + "answer_mode": "ready", + "degrade_reason": null, + "degraded_reason": null, + "code_intents_stubbed": false +} + +## LLM Request +- prompt_name: docs_explain_answer +- log_context: graph.project_qa.docs.answer + +### Prompt Stats +```json +{ + "system_chars": 393, + "user_chars": 21517, + "tokens_in_estimate": 5478 +} +``` + +### System Prompt +```text +Ты объясняешь документацию системы. + +На вход приходит JSON с полями: +- question +- intent +- sub_intent +- documents +- facts +- relations + +Правила: +- Используй только предоставленные факты +- Не додумывай +- Если данных недостаточно, скажи это явно +- Объясняй структурировано + +Формат ответа: +1. Краткое описание +2. Основные элементы +3. Как это работает +4. Связи с другими частями системы (если есть) +``` + +### User Prompt +```json +{ + "question": "Объясни как работает компонент TelegramControlChannel", + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "COMPONENT_EXPLAIN", + "documents": [ + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "HTTP API /actions/{action}", + "content": "Endpoint `/actions/{action}` управляет control actions runtime и поддерживает `start`, `stop` и `status`. Для долгих операций `start` и `stop` допускается ответ HTTP 202, если действие еще выполняется. Endpoint используется для operator-driven управления жизненным циклом worker'а через HTTP API.", + "metadata": { + "name": "control_actions_endpoint", + "tags": [ + "api", + "control-plane", + "lifecycle" + ], + "type": "api_method", + "layer": "application", + "links": [ + { + "type": "part_of", + "target": "architecture.telegram_notify_app" + }, + { + "type": "related_api", + "target": "api.health_endpoint" + }, + { + "type": "related_logic", + "target": "logic.telegram_notification_loop" + } + ], + "owner": null, + "title": "HTTP API /actions/{action}", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "architecture.telegram_notify_app", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "children": [], + "doc_kind": "misc", + "entities": [ + "TelegramControlChannel", + "ControlActionSet", + "JSONResponse" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "api.control_actions_endpoint", + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "summary_text": "Endpoint `/actions/{action}` управляет control actions runtime и поддерживает `start`, `stop` и `status`. Для долгих операций `start` и `stop` допускается ответ HTTP 202, если действие еще выполняется. Endpoint используется для operator-driven управления жизненным циклом worker'а через HTTP API.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/architecture/telegram-notify-app-overview.md", + "title": "Архитектура Telegram Notify App", + "content": "`test_echo_app` — сервис на базе PLBA runtime, который поднимает HTTP control plane и запускает фоновый воркер для периодической отправки уведомлений в Telegram. Приложение использует YAML-конфиг для runtime-настроек и переменные окружения для Telegram credentials. Основной контур системы состоит из runtime manager, control channel, send service и worker loop.", + "metadata": { + "name": "telegram_notify_app_overview", + "tags": [ + "architecture", + "telegram", + "plba", + "runtime" + ], + "type": "architecture_overview", + "layer": "system", + "links": [ + { + "type": "related_api", + "target": "api.health_endpoint" + }, + { + "type": "related_api", + "target": "api.control_actions_endpoint" + }, + { + "type": "related_api", + "target": "api.send_message_endpoint" + }, + { + "type": "depends_on", + "target": "logic.telegram_notification_loop" + }, + { + "type": "depends_on", + "target": "domain.runtime_health" + } + ], + "owner": null, + "title": "Архитектура Telegram Notify App", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "docs_root", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "8b1cc9f823e55bddbc825466d10a0fdb4ca4354ac02d91f9e2aef7b7d2ec8256", + "children": [ + "api.health_endpoint", + "api.control_actions_endpoint", + "api.send_message_endpoint", + "logic.telegram_notification_loop", + "domain.runtime_health" + ], + "doc_kind": "spec", + "entities": [ + "TelegramNotifyModule", + "TelegramNotifyWorker", + "TelegramControlChannel", + "TelegramSendService", + "RuntimeManager" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "architecture.telegram_notify_app", + "source_path": "docs/documentation/architecture/telegram-notify-app-overview.md", + "summary_text": "`test_echo_app` — сервис на базе PLBA runtime, который поднимает HTTP control plane и запускает фоновый воркер для периодической отправки уведомлений в Telegram. Приложение использует YAML-конфиг для runtime-настроек и переменные окружения для Telegram credentials. Основной контур системы состоит из runtime manager, control channel, send service и worker loop.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/README.md", + "title": "Readme", + "content": "Readme", + "metadata": { + "name": "", + "tags": [], + "type": "", + "layer": "", + "links": [], + "owner": null, + "title": "Readme", + "doc_id": null, + "module": "", + "parent": null, + "status": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "81d952f1a6ea85b76f75e0e57f33b8fa4b2bf3cb7db11b91b90171aeedd655a6", + "children": [], + "doc_kind": "readme", + "entities": [], + "updated_at": null, + "doc_version": null, + "document_id": "docs/README.md", + "source_path": "docs/README.md", + "summary_text": "", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/domain/runtime-health-entity.md", + "title": "Сущность runtime health", + "content": "`runtime health` — доменная модель наблюдаемости сервиса, которая описывает общее состояние runtime и состояние отдельных компонентов. Для `test_echo_app` главным объектом наблюдения является компонент `telegram_notify`, у которого важны статус, время старта и количество успешных отправок. Эта модель используется для внешнего health-monitoring и внутренней диагностики.", + "metadata": { + "name": "runtime_health", + "tags": [ + "domain", + "health", + "observability" + ], + "type": "domain_entity", + "layer": "domain", + "links": [ + { + "type": "part_of", + "target": "architecture.telegram_notify_app" + }, + { + "type": "used_by", + "target": "api.health_endpoint" + }, + { + "type": "related_logic", + "target": "logic.telegram_notification_loop" + } + ], + "owner": null, + "title": "Сущность runtime health", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "architecture.telegram_notify_app", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "37d4dcf470ea3de95d59e44786006e369a3ea11bf5dbf4c88877696e9183ee87", + "children": [], + "doc_kind": "misc", + "entities": [ + "WorkerHealth", + "WorkerStatus", + "TelegramNotifyWorker" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "domain.runtime_health", + "source_path": "docs/documentation/domain/runtime-health-entity.md", + "summary_text": "`runtime health` — доменная модель наблюдаемости сервиса, которая описывает общее состояние runtime и состояние отдельных компонентов. Для `test_echo_app` главным объектом наблюдения является компонент `telegram_notify`, у которого важны статус, время старта и количество успешных отправок. Эта модель используется для внешнего health-monitoring и внутренней диагностики.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/logic/telegram-notification-loop.md", + "title": "Цикл отправки уведомлений в Telegram", + "content": "`TelegramNotifyWorker` после старта runtime запускает отдельный поток, сразу делает первую попытку отправки сообщения и затем повторяет отправку через заданный интервал. При ошибках доставки или отсутствии credentials worker не останавливает сервис, а переводит собственное состояние в `degraded`. Этот workflow определяет основной полезный цикл приложения.", + "metadata": { + "name": "telegram_notification_loop", + "tags": [ + "logic", + "telegram", + "worker", + "scheduling" + ], + "type": "logic_block", + "layer": "application", + "links": [ + { + "type": "part_of", + "target": "architecture.telegram_notify_app" + }, + { + "type": "related_api", + "target": "api.send_message_endpoint" + }, + { + "type": "related_api", + "target": "api.control_actions_endpoint" + }, + { + "type": "related_api", + "target": "api.health_endpoint" + } + ], + "owner": null, + "title": "Цикл отправки уведомлений в Telegram", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "architecture.telegram_notify_app", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "0f62f9b4dab261ca4ca34575ff5d84411a22c90b780c52eda388782b94f08470", + "children": [], + "doc_kind": "misc", + "entities": [ + "TelegramNotifyWorker", + "TelegramSendService", + "WorkerHealth", + "WorkerStatus" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "logic.telegram_notification_loop", + "source_path": "docs/documentation/logic/telegram-notification-loop.md", + "summary_text": "`TelegramNotifyWorker` после старта runtime запускает отдельный поток, сразу делает первую попытку отправки сообщения и затем повторяет отправку через заданный интервал. При ошибках доставки или отсутствии credentials worker не останавливает сервис, а переводит собственное состояние в `degraded`. Этот workflow определяет основной полезный цикл приложения.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/api/send-message-endpoint.md", + "title": "HTTP API /send", + "content": "Endpoint `/send` выполняет ручную отправку сообщения в Telegram через `TelegramSendService`. Он используется для операторской проверки доставки и для отправки уведомлений вне периодического worker loop. Endpoint работает поверх тех же credentials и того же delivery path, что и фоновая отправка.", + "metadata": { + "name": "send_message_endpoint", + "tags": [ + "api", + "telegram", + "manual-send" + ], + "type": "api_method", + "layer": "application", + "links": [ + { + "type": "part_of", + "target": "architecture.telegram_notify_app" + }, + { + "type": "depends_on", + "target": "logic.telegram_notification_loop" + } + ], + "owner": null, + "title": "HTTP API /send", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "architecture.telegram_notify_app", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "5fbf2e33510b0676a3a53b957a4569bd3c2c31fb7719546602c573421ccaa32d", + "children": [], + "doc_kind": "misc", + "entities": [ + "TelegramControlAppFactory", + "TelegramSendService", + "TelegramNotifyWorker" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "api.send_message_endpoint", + "source_path": "docs/documentation/api/send-message-endpoint.md", + "summary_text": "Endpoint `/send` выполняет ручную отправку сообщения в Telegram через `TelegramSendService`. Он используется для операторской проверки доставки и для отправки уведомлений вне периодического worker loop. Endpoint работает поверх тех же credentials и того же delivery path, что и фоновая отправка.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + } + ], + "facts": [ + { + "layer": "D2_FACT_INDEX", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "api.control_actions_endpoint:workflow_step", + "content": "api.control_actions_endpoint workflow_step HTTP control plane запущен.", + "metadata": { + "tags": [], + "owner": null, + "anchor": "Сценарий", + "doc_id": null, + "object": "HTTP control plane запущен.", + "fact_id": "b480201013a7e5231146f665773ebc54af37c28135f407c6b758304c74561645", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "predicate": "workflow_step", + "object_ref": null, + "subject_id": "api.control_actions_endpoint", + "doc_version": null, + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D2_FACT_INDEX", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "api.control_actions_endpoint:mentions_entity", + "content": "api.control_actions_endpoint mentions_entity ControlActionSet", + "metadata": { + "tags": [], + "owner": null, + "anchor": "frontmatter.entities", + "doc_id": null, + "object": "ControlActionSet", + "fact_id": "bafb867ffed41c9db637df98d6cd5f6722d7747bbebc6c03e6f0d0caf3b7f9f3", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "predicate": "mentions_entity", + "object_ref": null, + "subject_id": "api.control_actions_endpoint", + "doc_version": null, + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + } + ], + "relations": [ + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "api.control_actions_endpoint:parent", + "content": "api.control_actions_endpoint parent architecture.telegram_notify_app", + "metadata": { + "owner": null, + "anchor": "frontmatter.parent", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "source_id": "api.control_actions_endpoint", + "target_id": "architecture.telegram_notify_app", + "doc_version": null, + "relation_id": "afec31fd062e392dcd9699a92c7ab61fd4b1273c1a2b16702b23d55d8d0c47ac", + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "parent", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "api.control_actions_endpoint:related_api", + "content": "api.control_actions_endpoint related_api api.health_endpoint", + "metadata": { + "owner": null, + "anchor": "frontmatter.links", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "source_id": "api.control_actions_endpoint", + "target_id": "api.health_endpoint", + "doc_version": null, + "relation_id": "711fb2edb82dd222deaba3c91768b18cbbd453009235823282813c6e867dc2c1", + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "related_api", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "api.control_actions_endpoint:related_logic", + "content": "api.control_actions_endpoint related_logic logic.telegram_notification_loop", + "metadata": { + "owner": null, + "anchor": "frontmatter.links", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "source_id": "api.control_actions_endpoint", + "target_id": "logic.telegram_notification_loop", + "doc_version": null, + "relation_id": "eec79f7a02b804337e791ef231784862ae26e0599eb20224790e9d4f085fa9c0", + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "related_logic", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "api.control_actions_endpoint:part_of", + "content": "api.control_actions_endpoint part_of architecture.telegram_notify_app", + "metadata": { + "owner": null, + "anchor": "frontmatter.links", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "source_id": "api.control_actions_endpoint", + "target_id": "architecture.telegram_notify_app", + "doc_version": null, + "relation_id": "5f4909bde905cd3d294ad307074a05e4ae4deefcafe6272cd2d0436e73acb8dd", + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "part_of", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/architecture/telegram-notify-app-overview.md", + "title": "architecture.telegram_notify_app:child", + "content": "architecture.telegram_notify_app child api.control_actions_endpoint", + "metadata": { + "owner": null, + "anchor": "frontmatter.children", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "8b1cc9f823e55bddbc825466d10a0fdb4ca4354ac02d91f9e2aef7b7d2ec8256", + "source_id": "architecture.telegram_notify_app", + "target_id": "api.control_actions_endpoint", + "doc_version": null, + "relation_id": "ae34fe4b3cd2b47632b13b1e32303e842b57948aa21160abe8d9b478995e1d74", + "source_path": "docs/documentation/architecture/telegram-notify-app-overview.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "child", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/architecture/telegram-notify-app-overview.md", + "title": "architecture.telegram_notify_app:related_api", + "content": "architecture.telegram_notify_app related_api api.control_actions_endpoint", + "metadata": { + "owner": null, + "anchor": "frontmatter.links", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "8b1cc9f823e55bddbc825466d10a0fdb4ca4354ac02d91f9e2aef7b7d2ec8256", + "source_id": "architecture.telegram_notify_app", + "target_id": "api.control_actions_endpoint", + "doc_version": null, + "relation_id": "02530527e6e1d1e23316c9d25d0b30658d6c70063eb6e1d732d55c5ba29c9795", + "source_path": "docs/documentation/architecture/telegram-notify-app-overview.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "related_api", + "staleness_score": null, + "system_component": null + } + } + ] +} +``` + +### User Prompt Overview +- question: Объясни как работает компонент TelegramControlChannel +- intent: DOCUMENTATION_EXPLAIN +- sub_intent: COMPONENT_EXPLAIN +- documents: 6 | samples: HTTP API /actions/{action}, Архитектура Telegram Notify App, Readme +- facts: 2 | samples: api.control_actions_endpoint:workflow_step, api.control_actions_endpoint:mentions_entity +- relations: 6 | samples: api.control_actions_endpoint:parent, api.control_actions_endpoint:related_api, api.control_actions_endpoint:related_logic + +## Mismatches +- none \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/docs_pre_llm_v3/20260326_120832/full_chain_docs_intents_v2_docs-v2-component-runtime-manager.json b/tests/pipeline_setup_v3/test_results/docs_pre_llm_v3/20260326_120832/full_chain_docs_intents_v2_docs-v2-component-runtime-manager.json new file mode 100644 index 0000000..aaca026 --- /dev/null +++ b/tests/pipeline_setup_v3/test_results/docs_pre_llm_v3/20260326_120832/full_chain_docs_intents_v2_docs-v2-component-runtime-manager.json @@ -0,0 +1,92 @@ +{ + "meta": { + "case_id": "docs-v2-component-runtime-manager", + "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_03_docs/full_chain_docs_intents_v2.yaml", + "runner": "agent_runtime", + "mode": "full_chain", + "passed": true, + "mismatches": [], + "actual": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "COMPONENT_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START", + "rag_count": 20, + "llm_answer": "", + "answer_mode": "answered", + "path_scope": [], + "doc_scope": [ + "api.control_actions_endpoint", + "api.actions_endpoint", + "architecture.telegram_notify_app", + "architecture.telegram_notify_app_overview", + "docs/README.md", + "domain.runtime_health", + "logic.telegram_notification_loop", + "api.send_message_endpoint" + ], + "entity_candidates": [ + "RuntimeManager" + ], + "symbol_candidates": [], + "layers": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "filters": { + "doc_type": null + }, + "pipeline_mode": "pre_llm_only", + "gate_decision": "allow", + "prompt_used": "docs_explain_answer", + "llm_mode": "prose", + "degraded_reason": null, + "code_intents_stubbed": true + } + }, + "pipeline_steps": [ + { + "step": "input_query", + "input": { + "query": "Какую роль в системе играет RuntimeManager?" + }, + "output": { + "query": "Какую роль в системе играет RuntimeManager?" + } + }, + { + "step": "router", + "input": { + "query": "Какую роль в системе играет RuntimeManager?" + }, + "output": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "COMPONENT_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START" + } + }, + { + "step": "docs_pipeline", + "input": { + "query": "Какую роль в системе играет RuntimeManager?" + }, + "output": { + "answer_mode": "ready", + "prompt_name": "docs_explain_answer", + "llm_request": { + "prompt_name": "docs_explain_answer", + "log_context": "graph.project_qa.docs.answer", + "prompt_stats": { + "system_chars": 393, + "user_chars": 21507, + "tokens_in_estimate": 5475 + } + }, + "degraded_reason": "" + } + } + ] +} \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/docs_pre_llm_v3/20260326_120832/full_chain_docs_intents_v2_docs-v2-component-runtime-manager.md b/tests/pipeline_setup_v3/test_results/docs_pre_llm_v3/20260326_120832/full_chain_docs_intents_v2_docs-v2-component-runtime-manager.md new file mode 100644 index 0000000..20ea7af --- /dev/null +++ b/tests/pipeline_setup_v3/test_results/docs_pre_llm_v3/20260326_120832/full_chain_docs_intents_v2_docs-v2-component-runtime-manager.md @@ -0,0 +1,900 @@ +# docs-v2-component-runtime-manager + +- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_03_docs/full_chain_docs_intents_v2.yaml +- runner: agent_runtime +- mode: full_chain +- passed: True + +## Query +Какую роль в системе играет RuntimeManager? + +## Actual +{ + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "COMPONENT_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START", + "rag_count": 20, + "llm_answer": "", + "answer_mode": "answered", + "path_scope": [], + "doc_scope": [ + "api.control_actions_endpoint", + "api.actions_endpoint", + "architecture.telegram_notify_app", + "architecture.telegram_notify_app_overview", + "docs/README.md", + "domain.runtime_health", + "logic.telegram_notification_loop", + "api.send_message_endpoint" + ], + "entity_candidates": [ + "RuntimeManager" + ], + "symbol_candidates": [], + "layers": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "filters": { + "doc_type": null + }, + "pipeline_mode": "pre_llm_only", + "gate_decision": "allow", + "prompt_used": "docs_explain_answer", + "llm_mode": "prose", + "degraded_reason": null, + "code_intents_stubbed": true +} + +## Pipeline Steps +### input_query +```json +{ + "input": { + "query": "Какую роль в системе играет RuntimeManager?" + }, + "output": { + "query": "Какую роль в системе играет RuntimeManager?" + } +} +``` + +### router +```json +{ + "input": { + "query": "Какую роль в системе играет RuntimeManager?" + }, + "output": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "COMPONENT_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START" + } +} +``` + +### docs_pipeline +```json +{ + "input": { + "query": "Какую роль в системе играет RuntimeManager?" + }, + "output": { + "answer_mode": "ready", + "prompt_name": "docs_explain_answer", + "llm_request": { + "prompt_name": "docs_explain_answer", + "log_context": "graph.project_qa.docs.answer", + "prompt_stats": { + "system_chars": 393, + "user_chars": 21507, + "tokens_in_estimate": 5475 + } + }, + "degraded_reason": "" + } +} +``` + +## Diagnostics +{ + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "COMPONENT_EXPLAIN", + "layers_used": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "documents_found": 6, + "facts_found": 2, + "relations_found": 6, + "openapi_fields_extracted": 0, + "missing_required_fields": [], + "openapi_status": { + "has_path": false, + "has_method": false, + "has_request": false, + "has_response": false + }, + "prompt_used": "docs_explain_answer", + "llm_mode": "prose", + "output_valid": true, + "matched_intent_source": "deterministic", + "matched_anchor_type": "none", + "matched_anchor_value": null, + "exact_anchor_match": false, + "docs_layers_requested": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "docs_layers_with_hits": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "planned_layers": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "executed_layers": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "non_empty_layers": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "layer_diagnostics": { + "D1_DOCUMENT_CATALOG": { + "hits": 6, + "top_ids": [ + "api.control_actions_endpoint", + "architecture.telegram_notify_app", + "docs/README.md", + "domain.runtime_health", + "logic.telegram_notification_loop" + ] + }, + "D2_FACT_INDEX": { + "hits": 8, + "top_ids": [ + "b480201013a7e5231146f665773ebc54af37c28135f407c6b758304c74561645", + "b8e44c3adb74aaa6c91ae8815fa091289e58dd3990a3a1b63e850c62075aea75", + "bafb867ffed41c9db637df98d6cd5f6722d7747bbebc6c03e6f0d0caf3b7f9f3", + "54bbcbac242f1c85ec3280236ed5841998a8a3a548ff16cbf0b5acafbff469e3", + "b6bfad59b3bf00f199b5ef90c1208af19664de700413e7354468a93a4abaaa2f" + ] + }, + "D5_RELATION_GRAPH": { + "hits": 6, + "top_ids": [ + "afec31fd062e392dcd9699a92c7ab61fd4b1273c1a2b16702b23d55d8d0c47ac", + "711fb2edb82dd222deaba3c91768b18cbbd453009235823282813c6e867dc2c1", + "eec79f7a02b804337e791ef231784862ae26e0599eb20224790e9d4f085fa9c0", + "5f4909bde905cd3d294ad307074a05e4ae4deefcafe6272cd2d0436e73acb8dd", + "ae34fe4b3cd2b47632b13b1e32303e842b57948aa21160abe8d9b478995e1d74" + ] + }, + "D0_DOC_CHUNKS": { + "hits": 6, + "top_ids": [ + "api.control_actions_endpoint" + ] + } + }, + "query_entity_candidates": [ + "RuntimeManager" + ], + "resolved_entity_candidates": [], + "query_anchor_candidates": [ + "RuntimeManager" + ], + "resolved_anchor_candidates": [ + "api.control_actions_endpoint", + "docs/documentation/api/control-actions-endpoint.md", + "architecture.telegram_notify_app", + "docs/documentation/architecture/telegram-notify-app-overview.md", + "docs/README.md", + "domain.runtime_health", + "docs/documentation/domain/runtime-health-entity.md", + "logic.telegram_notification_loop", + "docs/documentation/logic/telegram-notification-loop.md", + "api.send_message_endpoint", + "docs/documentation/api/send-message-endpoint.md" + ], + "anchor_candidates": [], + "selected_anchor": null, + "anchor_selection_reason": "", + "anchor_match_type": "", + "doc_ids": [ + "api.control_actions_endpoint", + "api.actions_endpoint", + "architecture.telegram_notify_app", + "architecture.telegram_notify_app_overview", + "docs/README.md", + "domain.runtime_health", + "logic.telegram_notification_loop", + "api.send_message_endpoint" + ], + "doc_paths": [ + "docs/documentation/api/control-actions-endpoint.md", + "docs/documentation/architecture/telegram-notify-app-overview.md", + "docs/README.md", + "docs/documentation/domain/runtime-health-entity.md", + "docs/documentation/logic/telegram-notification-loop.md", + "docs/documentation/api/send-message-endpoint.md" + ], + "doc_titles": [ + "HTTP API /actions/{action}", + "Архитектура Telegram Notify App", + "Readme", + "Сущность runtime health", + "Цикл отправки уведомлений в Telegram", + "HTTP API /send", + "api.control_actions_endpoint:workflow_step", + "api.control_actions_endpoint:mentions_entity", + "api.control_actions_endpoint:parent", + "api.control_actions_endpoint:related_api", + "api.control_actions_endpoint:related_logic", + "api.control_actions_endpoint:part_of", + "architecture.telegram_notify_app:child", + "architecture.telegram_notify_app:related_api", + "api.control_actions_endpoint:Функциональные требования", + "api.control_actions_endpoint:Нефункциональные требования", + "api.control_actions_endpoint:Сценарий", + "api.control_actions_endpoint:Summary", + "api.control_actions_endpoint:Описание", + "api.control_actions_endpoint:Входные параметры" + ], + "relation_hits_count": 6, + "relation_targets": [ + "api.control_actions_endpoint:parent", + "api.control_actions_endpoint:related_api", + "api.control_actions_endpoint:related_logic", + "api.control_actions_endpoint:part_of", + "architecture.telegram_notify_app:child", + "architecture.telegram_notify_app:related_api" + ], + "fallback_doc_hits_count": 12, + "fallback_used": false, + "fact_hits": 2, + "entity_hits": 0, + "evidence_summary": { + "documents": 6, + "facts": 2, + "relations": 6, + "chunks": 6, + "entity_hits": 0, + "openapi_signals": { + "path_found": false, + "method_found": false, + "request_schema": false, + "response_schema": false, + "status_codes": false, + "payload_description": false + } + }, + "gate_decision": "allow", + "gate_decision_reason": "evidence_sufficient", + "gate_missing_requirements": [], + "gate_satisfied_requirements": [ + "retrieval_non_empty" + ], + "openapi_evidence": { + "path_found": false, + "method_found": false, + "request_schema": false, + "response_schema": false, + "status_codes": false, + "payload_description": false + }, + "requested_fragment_type": null, + "fragment_evidence_found": [], + "fragment_missing_requirements": [], + "answer_mode": "ready", + "degrade_reason": null, + "degraded_reason": null, + "code_intents_stubbed": false +} + +## LLM Request +- prompt_name: docs_explain_answer +- log_context: graph.project_qa.docs.answer + +### Prompt Stats +```json +{ + "system_chars": 393, + "user_chars": 21507, + "tokens_in_estimate": 5475 +} +``` + +### System Prompt +```text +Ты объясняешь документацию системы. + +На вход приходит JSON с полями: +- question +- intent +- sub_intent +- documents +- facts +- relations + +Правила: +- Используй только предоставленные факты +- Не додумывай +- Если данных недостаточно, скажи это явно +- Объясняй структурировано + +Формат ответа: +1. Краткое описание +2. Основные элементы +3. Как это работает +4. Связи с другими частями системы (если есть) +``` + +### User Prompt +```json +{ + "question": "Какую роль в системе играет RuntimeManager?", + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "COMPONENT_EXPLAIN", + "documents": [ + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "HTTP API /actions/{action}", + "content": "Endpoint `/actions/{action}` управляет control actions runtime и поддерживает `start`, `stop` и `status`. Для долгих операций `start` и `stop` допускается ответ HTTP 202, если действие еще выполняется. Endpoint используется для operator-driven управления жизненным циклом worker'а через HTTP API.", + "metadata": { + "name": "control_actions_endpoint", + "tags": [ + "api", + "control-plane", + "lifecycle" + ], + "type": "api_method", + "layer": "application", + "links": [ + { + "type": "part_of", + "target": "architecture.telegram_notify_app" + }, + { + "type": "related_api", + "target": "api.health_endpoint" + }, + { + "type": "related_logic", + "target": "logic.telegram_notification_loop" + } + ], + "owner": null, + "title": "HTTP API /actions/{action}", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "architecture.telegram_notify_app", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "children": [], + "doc_kind": "misc", + "entities": [ + "TelegramControlChannel", + "ControlActionSet", + "JSONResponse" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "api.control_actions_endpoint", + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "summary_text": "Endpoint `/actions/{action}` управляет control actions runtime и поддерживает `start`, `stop` и `status`. Для долгих операций `start` и `stop` допускается ответ HTTP 202, если действие еще выполняется. Endpoint используется для operator-driven управления жизненным циклом worker'а через HTTP API.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/architecture/telegram-notify-app-overview.md", + "title": "Архитектура Telegram Notify App", + "content": "`test_echo_app` — сервис на базе PLBA runtime, который поднимает HTTP control plane и запускает фоновый воркер для периодической отправки уведомлений в Telegram. Приложение использует YAML-конфиг для runtime-настроек и переменные окружения для Telegram credentials. Основной контур системы состоит из runtime manager, control channel, send service и worker loop.", + "metadata": { + "name": "telegram_notify_app_overview", + "tags": [ + "architecture", + "telegram", + "plba", + "runtime" + ], + "type": "architecture_overview", + "layer": "system", + "links": [ + { + "type": "related_api", + "target": "api.health_endpoint" + }, + { + "type": "related_api", + "target": "api.control_actions_endpoint" + }, + { + "type": "related_api", + "target": "api.send_message_endpoint" + }, + { + "type": "depends_on", + "target": "logic.telegram_notification_loop" + }, + { + "type": "depends_on", + "target": "domain.runtime_health" + } + ], + "owner": null, + "title": "Архитектура Telegram Notify App", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "docs_root", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "8b1cc9f823e55bddbc825466d10a0fdb4ca4354ac02d91f9e2aef7b7d2ec8256", + "children": [ + "api.health_endpoint", + "api.control_actions_endpoint", + "api.send_message_endpoint", + "logic.telegram_notification_loop", + "domain.runtime_health" + ], + "doc_kind": "spec", + "entities": [ + "TelegramNotifyModule", + "TelegramNotifyWorker", + "TelegramControlChannel", + "TelegramSendService", + "RuntimeManager" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "architecture.telegram_notify_app", + "source_path": "docs/documentation/architecture/telegram-notify-app-overview.md", + "summary_text": "`test_echo_app` — сервис на базе PLBA runtime, который поднимает HTTP control plane и запускает фоновый воркер для периодической отправки уведомлений в Telegram. Приложение использует YAML-конфиг для runtime-настроек и переменные окружения для Telegram credentials. Основной контур системы состоит из runtime manager, control channel, send service и worker loop.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/README.md", + "title": "Readme", + "content": "Readme", + "metadata": { + "name": "", + "tags": [], + "type": "", + "layer": "", + "links": [], + "owner": null, + "title": "Readme", + "doc_id": null, + "module": "", + "parent": null, + "status": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "81d952f1a6ea85b76f75e0e57f33b8fa4b2bf3cb7db11b91b90171aeedd655a6", + "children": [], + "doc_kind": "readme", + "entities": [], + "updated_at": null, + "doc_version": null, + "document_id": "docs/README.md", + "source_path": "docs/README.md", + "summary_text": "", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/domain/runtime-health-entity.md", + "title": "Сущность runtime health", + "content": "`runtime health` — доменная модель наблюдаемости сервиса, которая описывает общее состояние runtime и состояние отдельных компонентов. Для `test_echo_app` главным объектом наблюдения является компонент `telegram_notify`, у которого важны статус, время старта и количество успешных отправок. Эта модель используется для внешнего health-monitoring и внутренней диагностики.", + "metadata": { + "name": "runtime_health", + "tags": [ + "domain", + "health", + "observability" + ], + "type": "domain_entity", + "layer": "domain", + "links": [ + { + "type": "part_of", + "target": "architecture.telegram_notify_app" + }, + { + "type": "used_by", + "target": "api.health_endpoint" + }, + { + "type": "related_logic", + "target": "logic.telegram_notification_loop" + } + ], + "owner": null, + "title": "Сущность runtime health", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "architecture.telegram_notify_app", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "37d4dcf470ea3de95d59e44786006e369a3ea11bf5dbf4c88877696e9183ee87", + "children": [], + "doc_kind": "misc", + "entities": [ + "WorkerHealth", + "WorkerStatus", + "TelegramNotifyWorker" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "domain.runtime_health", + "source_path": "docs/documentation/domain/runtime-health-entity.md", + "summary_text": "`runtime health` — доменная модель наблюдаемости сервиса, которая описывает общее состояние runtime и состояние отдельных компонентов. Для `test_echo_app` главным объектом наблюдения является компонент `telegram_notify`, у которого важны статус, время старта и количество успешных отправок. Эта модель используется для внешнего health-monitoring и внутренней диагностики.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/logic/telegram-notification-loop.md", + "title": "Цикл отправки уведомлений в Telegram", + "content": "`TelegramNotifyWorker` после старта runtime запускает отдельный поток, сразу делает первую попытку отправки сообщения и затем повторяет отправку через заданный интервал. При ошибках доставки или отсутствии credentials worker не останавливает сервис, а переводит собственное состояние в `degraded`. Этот workflow определяет основной полезный цикл приложения.", + "metadata": { + "name": "telegram_notification_loop", + "tags": [ + "logic", + "telegram", + "worker", + "scheduling" + ], + "type": "logic_block", + "layer": "application", + "links": [ + { + "type": "part_of", + "target": "architecture.telegram_notify_app" + }, + { + "type": "related_api", + "target": "api.send_message_endpoint" + }, + { + "type": "related_api", + "target": "api.control_actions_endpoint" + }, + { + "type": "related_api", + "target": "api.health_endpoint" + } + ], + "owner": null, + "title": "Цикл отправки уведомлений в Telegram", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "architecture.telegram_notify_app", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "0f62f9b4dab261ca4ca34575ff5d84411a22c90b780c52eda388782b94f08470", + "children": [], + "doc_kind": "misc", + "entities": [ + "TelegramNotifyWorker", + "TelegramSendService", + "WorkerHealth", + "WorkerStatus" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "logic.telegram_notification_loop", + "source_path": "docs/documentation/logic/telegram-notification-loop.md", + "summary_text": "`TelegramNotifyWorker` после старта runtime запускает отдельный поток, сразу делает первую попытку отправки сообщения и затем повторяет отправку через заданный интервал. При ошибках доставки или отсутствии credentials worker не останавливает сервис, а переводит собственное состояние в `degraded`. Этот workflow определяет основной полезный цикл приложения.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/api/send-message-endpoint.md", + "title": "HTTP API /send", + "content": "Endpoint `/send` выполняет ручную отправку сообщения в Telegram через `TelegramSendService`. Он используется для операторской проверки доставки и для отправки уведомлений вне периодического worker loop. Endpoint работает поверх тех же credentials и того же delivery path, что и фоновая отправка.", + "metadata": { + "name": "send_message_endpoint", + "tags": [ + "api", + "telegram", + "manual-send" + ], + "type": "api_method", + "layer": "application", + "links": [ + { + "type": "part_of", + "target": "architecture.telegram_notify_app" + }, + { + "type": "depends_on", + "target": "logic.telegram_notification_loop" + } + ], + "owner": null, + "title": "HTTP API /send", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "architecture.telegram_notify_app", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "5fbf2e33510b0676a3a53b957a4569bd3c2c31fb7719546602c573421ccaa32d", + "children": [], + "doc_kind": "misc", + "entities": [ + "TelegramControlAppFactory", + "TelegramSendService", + "TelegramNotifyWorker" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "api.send_message_endpoint", + "source_path": "docs/documentation/api/send-message-endpoint.md", + "summary_text": "Endpoint `/send` выполняет ручную отправку сообщения в Telegram через `TelegramSendService`. Он используется для операторской проверки доставки и для отправки уведомлений вне периодического worker loop. Endpoint работает поверх тех же credentials и того же delivery path, что и фоновая отправка.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + } + ], + "facts": [ + { + "layer": "D2_FACT_INDEX", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "api.control_actions_endpoint:workflow_step", + "content": "api.control_actions_endpoint workflow_step HTTP control plane запущен.", + "metadata": { + "tags": [], + "owner": null, + "anchor": "Сценарий", + "doc_id": null, + "object": "HTTP control plane запущен.", + "fact_id": "b480201013a7e5231146f665773ebc54af37c28135f407c6b758304c74561645", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "predicate": "workflow_step", + "object_ref": null, + "subject_id": "api.control_actions_endpoint", + "doc_version": null, + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D2_FACT_INDEX", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "api.control_actions_endpoint:mentions_entity", + "content": "api.control_actions_endpoint mentions_entity ControlActionSet", + "metadata": { + "tags": [], + "owner": null, + "anchor": "frontmatter.entities", + "doc_id": null, + "object": "ControlActionSet", + "fact_id": "bafb867ffed41c9db637df98d6cd5f6722d7747bbebc6c03e6f0d0caf3b7f9f3", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "predicate": "mentions_entity", + "object_ref": null, + "subject_id": "api.control_actions_endpoint", + "doc_version": null, + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + } + ], + "relations": [ + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "api.control_actions_endpoint:parent", + "content": "api.control_actions_endpoint parent architecture.telegram_notify_app", + "metadata": { + "owner": null, + "anchor": "frontmatter.parent", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "source_id": "api.control_actions_endpoint", + "target_id": "architecture.telegram_notify_app", + "doc_version": null, + "relation_id": "afec31fd062e392dcd9699a92c7ab61fd4b1273c1a2b16702b23d55d8d0c47ac", + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "parent", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "api.control_actions_endpoint:related_api", + "content": "api.control_actions_endpoint related_api api.health_endpoint", + "metadata": { + "owner": null, + "anchor": "frontmatter.links", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "source_id": "api.control_actions_endpoint", + "target_id": "api.health_endpoint", + "doc_version": null, + "relation_id": "711fb2edb82dd222deaba3c91768b18cbbd453009235823282813c6e867dc2c1", + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "related_api", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "api.control_actions_endpoint:related_logic", + "content": "api.control_actions_endpoint related_logic logic.telegram_notification_loop", + "metadata": { + "owner": null, + "anchor": "frontmatter.links", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "source_id": "api.control_actions_endpoint", + "target_id": "logic.telegram_notification_loop", + "doc_version": null, + "relation_id": "eec79f7a02b804337e791ef231784862ae26e0599eb20224790e9d4f085fa9c0", + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "related_logic", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "api.control_actions_endpoint:part_of", + "content": "api.control_actions_endpoint part_of architecture.telegram_notify_app", + "metadata": { + "owner": null, + "anchor": "frontmatter.links", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "source_id": "api.control_actions_endpoint", + "target_id": "architecture.telegram_notify_app", + "doc_version": null, + "relation_id": "5f4909bde905cd3d294ad307074a05e4ae4deefcafe6272cd2d0436e73acb8dd", + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "part_of", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/architecture/telegram-notify-app-overview.md", + "title": "architecture.telegram_notify_app:child", + "content": "architecture.telegram_notify_app child api.control_actions_endpoint", + "metadata": { + "owner": null, + "anchor": "frontmatter.children", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "8b1cc9f823e55bddbc825466d10a0fdb4ca4354ac02d91f9e2aef7b7d2ec8256", + "source_id": "architecture.telegram_notify_app", + "target_id": "api.control_actions_endpoint", + "doc_version": null, + "relation_id": "ae34fe4b3cd2b47632b13b1e32303e842b57948aa21160abe8d9b478995e1d74", + "source_path": "docs/documentation/architecture/telegram-notify-app-overview.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "child", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/architecture/telegram-notify-app-overview.md", + "title": "architecture.telegram_notify_app:related_api", + "content": "architecture.telegram_notify_app related_api api.control_actions_endpoint", + "metadata": { + "owner": null, + "anchor": "frontmatter.links", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "8b1cc9f823e55bddbc825466d10a0fdb4ca4354ac02d91f9e2aef7b7d2ec8256", + "source_id": "architecture.telegram_notify_app", + "target_id": "api.control_actions_endpoint", + "doc_version": null, + "relation_id": "02530527e6e1d1e23316c9d25d0b30658d6c70063eb6e1d732d55c5ba29c9795", + "source_path": "docs/documentation/architecture/telegram-notify-app-overview.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "related_api", + "staleness_score": null, + "system_component": null + } + } + ] +} +``` + +### User Prompt Overview +- question: Какую роль в системе играет RuntimeManager? +- intent: DOCUMENTATION_EXPLAIN +- sub_intent: COMPONENT_EXPLAIN +- documents: 6 | samples: HTTP API /actions/{action}, Архитектура Telegram Notify App, Readme +- facts: 2 | samples: api.control_actions_endpoint:workflow_step, api.control_actions_endpoint:mentions_entity +- relations: 6 | samples: api.control_actions_endpoint:parent, api.control_actions_endpoint:related_api, api.control_actions_endpoint:related_logic + +## Mismatches +- none \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/docs_pre_llm_v3/20260326_120832/full_chain_docs_intents_v2_docs-v2-entity-runtime-health.json b/tests/pipeline_setup_v3/test_results/docs_pre_llm_v3/20260326_120832/full_chain_docs_intents_v2_docs-v2-entity-runtime-health.json new file mode 100644 index 0000000..ed93b21 --- /dev/null +++ b/tests/pipeline_setup_v3/test_results/docs_pre_llm_v3/20260326_120832/full_chain_docs_intents_v2_docs-v2-entity-runtime-health.json @@ -0,0 +1,92 @@ +{ + "meta": { + "case_id": "docs-v2-entity-runtime-health", + "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_03_docs/full_chain_docs_intents_v2.yaml", + "runner": "agent_runtime", + "mode": "full_chain", + "passed": true, + "mismatches": [], + "actual": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "ENTITY_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START", + "rag_count": 26, + "llm_answer": "", + "answer_mode": "answered", + "path_scope": [], + "doc_scope": [ + "api.health_endpoint", + "architecture.telegram_notify_app", + "architecture.telegram_notify_app_overview", + "domain.runtime_health", + "logic.telegram_notification_loop", + "api.control_actions_endpoint", + "api.actions_endpoint", + "api.send_message_endpoint" + ], + "entity_candidates": [ + "runtime health" + ], + "symbol_candidates": [], + "layers": [ + "D3_ENTITY_CATALOG", + "D1_DOCUMENT_CATALOG", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "filters": { + "doc_type": null + }, + "pipeline_mode": "pre_llm_only", + "gate_decision": "allow", + "prompt_used": "docs_explain_answer", + "llm_mode": "prose", + "degraded_reason": null, + "code_intents_stubbed": true + } + }, + "pipeline_steps": [ + { + "step": "input_query", + "input": { + "query": "Что такое runtime health?" + }, + "output": { + "query": "Что такое runtime health?" + } + }, + { + "step": "router", + "input": { + "query": "Что такое runtime health?" + }, + "output": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "ENTITY_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START" + } + }, + { + "step": "docs_pipeline", + "input": { + "query": "Что такое runtime health?" + }, + "output": { + "answer_mode": "ready", + "prompt_name": "docs_explain_answer", + "llm_request": { + "prompt_name": "docs_explain_answer", + "log_context": "graph.project_qa.docs.answer", + "prompt_stats": { + "system_chars": 393, + "user_chars": 20267, + "tokens_in_estimate": 5165 + } + }, + "degraded_reason": "" + } + } + ] +} \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/docs_pre_llm_v3/20260326_120832/full_chain_docs_intents_v2_docs-v2-entity-runtime-health.md b/tests/pipeline_setup_v3/test_results/docs_pre_llm_v3/20260326_120832/full_chain_docs_intents_v2_docs-v2-entity-runtime-health.md new file mode 100644 index 0000000..8c3c956 --- /dev/null +++ b/tests/pipeline_setup_v3/test_results/docs_pre_llm_v3/20260326_120832/full_chain_docs_intents_v2_docs-v2-entity-runtime-health.md @@ -0,0 +1,865 @@ +# docs-v2-entity-runtime-health + +- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_03_docs/full_chain_docs_intents_v2.yaml +- runner: agent_runtime +- mode: full_chain +- passed: True + +## Query +Что такое runtime health? + +## Actual +{ + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "ENTITY_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START", + "rag_count": 26, + "llm_answer": "", + "answer_mode": "answered", + "path_scope": [], + "doc_scope": [ + "api.health_endpoint", + "architecture.telegram_notify_app", + "architecture.telegram_notify_app_overview", + "domain.runtime_health", + "logic.telegram_notification_loop", + "api.control_actions_endpoint", + "api.actions_endpoint", + "api.send_message_endpoint" + ], + "entity_candidates": [ + "runtime health" + ], + "symbol_candidates": [], + "layers": [ + "D3_ENTITY_CATALOG", + "D1_DOCUMENT_CATALOG", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "filters": { + "doc_type": null + }, + "pipeline_mode": "pre_llm_only", + "gate_decision": "allow", + "prompt_used": "docs_explain_answer", + "llm_mode": "prose", + "degraded_reason": null, + "code_intents_stubbed": true +} + +## Pipeline Steps +### input_query +```json +{ + "input": { + "query": "Что такое runtime health?" + }, + "output": { + "query": "Что такое runtime health?" + } +} +``` + +### router +```json +{ + "input": { + "query": "Что такое runtime health?" + }, + "output": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "ENTITY_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START" + } +} +``` + +### docs_pipeline +```json +{ + "input": { + "query": "Что такое runtime health?" + }, + "output": { + "answer_mode": "ready", + "prompt_name": "docs_explain_answer", + "llm_request": { + "prompt_name": "docs_explain_answer", + "log_context": "graph.project_qa.docs.answer", + "prompt_stats": { + "system_chars": 393, + "user_chars": 20267, + "tokens_in_estimate": 5165 + } + }, + "degraded_reason": "" + } +} +``` + +## Diagnostics +{ + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "ENTITY_EXPLAIN", + "layers_used": [ + "D3_ENTITY_CATALOG", + "D1_DOCUMENT_CATALOG", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "documents_found": 6, + "facts_found": 0, + "relations_found": 6, + "openapi_fields_extracted": 0, + "missing_required_fields": [], + "openapi_status": { + "has_path": false, + "has_method": false, + "has_request": false, + "has_response": false + }, + "prompt_used": "docs_explain_answer", + "llm_mode": "prose", + "output_valid": true, + "matched_intent_source": "deterministic", + "matched_anchor_type": "none", + "matched_anchor_value": null, + "exact_anchor_match": false, + "docs_layers_requested": [ + "D3_ENTITY_CATALOG", + "D1_DOCUMENT_CATALOG", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "docs_layers_with_hits": [ + "D3_ENTITY_CATALOG", + "D1_DOCUMENT_CATALOG", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "planned_layers": [ + "D3_ENTITY_CATALOG", + "D1_DOCUMENT_CATALOG", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "executed_layers": [ + "D3_ENTITY_CATALOG", + "D1_DOCUMENT_CATALOG", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "non_empty_layers": [ + "D3_ENTITY_CATALOG", + "D1_DOCUMENT_CATALOG", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "layer_diagnostics": { + "D3_ENTITY_CATALOG": { + "hits": 8, + "top_ids": [ + "api.health_endpoint", + "architecture.telegram_notify_app", + "domain.runtime_health" + ] + }, + "D1_DOCUMENT_CATALOG": { + "hits": 6, + "top_ids": [ + "domain.runtime_health", + "api.health_endpoint", + "logic.telegram_notification_loop", + "api.control_actions_endpoint", + "architecture.telegram_notify_app" + ] + }, + "D5_RELATION_GRAPH": { + "hits": 6, + "top_ids": [ + "79bdb0a74713df6064008179ca8c5c186dc23e4e1c5e2c9607b0bdddeba50f93", + "af2a4f7c1b677b908410ba720915405e10dbd0870e30a3c6e3aa2468550ddf0e", + "77f5d358ab85b3d92018b6b51da7c39773148dfd346686e8832a45370c841160", + "c718b1939621233295ccaf6e8203e7fd94f3dd1bfb88f10c51bc5e33d53a24aa", + "616f5cbf25da83cb51d8d0741a7fc351620c9ca2c6513fa2094b4aa476f0912a" + ] + }, + "D0_DOC_CHUNKS": { + "hits": 6, + "top_ids": [ + "api.health_endpoint" + ] + } + }, + "query_entity_candidates": [ + "runtime health" + ], + "resolved_entity_candidates": [], + "query_anchor_candidates": [], + "resolved_anchor_candidates": [ + "api.health_endpoint", + "docs/documentation/api/health-endpoint.md", + "architecture.telegram_notify_app", + "docs/documentation/architecture/telegram-notify-app-overview.md", + "domain.runtime_health", + "docs/documentation/domain/runtime-health-entity.md", + "logic.telegram_notification_loop", + "docs/documentation/logic/telegram-notification-loop.md", + "api.control_actions_endpoint", + "docs/documentation/api/control-actions-endpoint.md", + "api.send_message_endpoint", + "docs/documentation/api/send-message-endpoint.md" + ], + "anchor_candidates": [], + "selected_anchor": null, + "anchor_selection_reason": "", + "anchor_match_type": "", + "doc_ids": [ + "api.health_endpoint", + "architecture.telegram_notify_app", + "architecture.telegram_notify_app_overview", + "domain.runtime_health", + "logic.telegram_notification_loop", + "api.control_actions_endpoint", + "api.actions_endpoint", + "api.send_message_endpoint" + ], + "doc_paths": [ + "docs/documentation/api/health-endpoint.md", + "docs/documentation/architecture/telegram-notify-app-overview.md", + "docs/documentation/domain/runtime-health-entity.md", + "docs/documentation/logic/telegram-notification-loop.md", + "docs/documentation/api/control-actions-endpoint.md", + "docs/documentation/api/send-message-endpoint.md" + ], + "doc_titles": [ + "RuntimeManager", + "WorkerStatus", + "TelegramNotifyWorker", + "TelegramControlChannel", + "WorkerHealth", + "Сущность runtime health", + "HTTP API /health", + "Цикл отправки уведомлений в Telegram", + "HTTP API /actions/{action}", + "Архитектура Telegram Notify App", + "HTTP API /send", + "domain.runtime_health:parent", + "domain.runtime_health:part_of", + "api.health_endpoint:depends_on", + "api.health_endpoint:parent", + "api.health_endpoint:part_of", + "domain.runtime_health:used_by", + "api.health_endpoint:Сценарий", + "api.health_endpoint:Нефункциональные требования", + "api.health_endpoint:Summary", + "api.health_endpoint:Описание", + "api.health_endpoint:Функциональные требования", + "api.health_endpoint:Входные параметры" + ], + "relation_hits_count": 6, + "relation_targets": [ + "domain.runtime_health:parent", + "domain.runtime_health:part_of", + "api.health_endpoint:depends_on", + "api.health_endpoint:parent", + "api.health_endpoint:part_of", + "domain.runtime_health:used_by" + ], + "fallback_doc_hits_count": 12, + "fallback_used": false, + "fact_hits": 0, + "entity_hits": 0, + "evidence_summary": { + "documents": 6, + "facts": 0, + "relations": 6, + "chunks": 6, + "entity_hits": 0, + "openapi_signals": { + "path_found": false, + "method_found": false, + "request_schema": false, + "response_schema": false, + "status_codes": false, + "payload_description": false + } + }, + "gate_decision": "allow", + "gate_decision_reason": "evidence_sufficient", + "gate_missing_requirements": [], + "gate_satisfied_requirements": [ + "retrieval_non_empty" + ], + "openapi_evidence": { + "path_found": false, + "method_found": false, + "request_schema": false, + "response_schema": false, + "status_codes": false, + "payload_description": false + }, + "requested_fragment_type": null, + "fragment_evidence_found": [], + "fragment_missing_requirements": [], + "answer_mode": "ready", + "degrade_reason": null, + "degraded_reason": null, + "code_intents_stubbed": false +} + +## LLM Request +- prompt_name: docs_explain_answer +- log_context: graph.project_qa.docs.answer + +### Prompt Stats +```json +{ + "system_chars": 393, + "user_chars": 20267, + "tokens_in_estimate": 5165 +} +``` + +### System Prompt +```text +Ты объясняешь документацию системы. + +На вход приходит JSON с полями: +- question +- intent +- sub_intent +- documents +- facts +- relations + +Правила: +- Используй только предоставленные факты +- Не додумывай +- Если данных недостаточно, скажи это явно +- Объясняй структурировано + +Формат ответа: +1. Краткое описание +2. Основные элементы +3. Как это работает +4. Связи с другими частями системы (если есть) +``` + +### User Prompt +```json +{ + "question": "Что такое runtime health?", + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "ENTITY_EXPLAIN", + "documents": [ + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/domain/runtime-health-entity.md", + "title": "Сущность runtime health", + "content": "`runtime health` — доменная модель наблюдаемости сервиса, которая описывает общее состояние runtime и состояние отдельных компонентов. Для `test_echo_app` главным объектом наблюдения является компонент `telegram_notify`, у которого важны статус, время старта и количество успешных отправок. Эта модель используется для внешнего health-monitoring и внутренней диагностики.", + "metadata": { + "name": "runtime_health", + "tags": [ + "domain", + "health", + "observability" + ], + "type": "domain_entity", + "layer": "domain", + "links": [ + { + "type": "part_of", + "target": "architecture.telegram_notify_app" + }, + { + "type": "used_by", + "target": "api.health_endpoint" + }, + { + "type": "related_logic", + "target": "logic.telegram_notification_loop" + } + ], + "owner": null, + "title": "Сущность runtime health", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "architecture.telegram_notify_app", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "37d4dcf470ea3de95d59e44786006e369a3ea11bf5dbf4c88877696e9183ee87", + "children": [], + "doc_kind": "misc", + "entities": [ + "WorkerHealth", + "WorkerStatus", + "TelegramNotifyWorker" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "domain.runtime_health", + "source_path": "docs/documentation/domain/runtime-health-entity.md", + "summary_text": "`runtime health` — доменная модель наблюдаемости сервиса, которая описывает общее состояние runtime и состояние отдельных компонентов. Для `test_echo_app` главным объектом наблюдения является компонент `telegram_notify`, у которого важны статус, время старта и количество успешных отправок. Эта модель используется для внешнего health-monitoring и внутренней диагностики.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/api/health-endpoint.md", + "title": "HTTP API /health", + "content": "Endpoint `/health` возвращает агрегированный health payload runtime. Если общий статус равен `ok`, API отвечает с HTTP 200; для состояний деградации или неготовности возвращается HTTP 503 с тем же payload. Endpoint служит основной точкой внешней проверки состояния приложения.", + "metadata": { + "name": "health_endpoint", + "tags": [ + "api", + "health", + "control-plane" + ], + "type": "api_method", + "layer": "application", + "links": [ + { + "type": "part_of", + "target": "architecture.telegram_notify_app" + }, + { + "type": "depends_on", + "target": "domain.runtime_health" + } + ], + "owner": null, + "title": "HTTP API /health", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "architecture.telegram_notify_app", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "8b5a533a8076e2e9d36995eee29aeade260080bdca2ec8e21fe28f08574b983f", + "children": [], + "doc_kind": "misc", + "entities": [ + "TelegramControlChannel", + "TelegramNotifyWorker", + "RuntimeManager", + "WorkerHealth" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "api.health_endpoint", + "source_path": "docs/documentation/api/health-endpoint.md", + "summary_text": "Endpoint `/health` возвращает агрегированный health payload runtime. Если общий статус равен `ok`, API отвечает с HTTP 200; для состояний деградации или неготовности возвращается HTTP 503 с тем же payload. Endpoint служит основной точкой внешней проверки состояния приложения.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/logic/telegram-notification-loop.md", + "title": "Цикл отправки уведомлений в Telegram", + "content": "`TelegramNotifyWorker` после старта runtime запускает отдельный поток, сразу делает первую попытку отправки сообщения и затем повторяет отправку через заданный интервал. При ошибках доставки или отсутствии credentials worker не останавливает сервис, а переводит собственное состояние в `degraded`. Этот workflow определяет основной полезный цикл приложения.", + "metadata": { + "name": "telegram_notification_loop", + "tags": [ + "logic", + "telegram", + "worker", + "scheduling" + ], + "type": "logic_block", + "layer": "application", + "links": [ + { + "type": "part_of", + "target": "architecture.telegram_notify_app" + }, + { + "type": "related_api", + "target": "api.send_message_endpoint" + }, + { + "type": "related_api", + "target": "api.control_actions_endpoint" + }, + { + "type": "related_api", + "target": "api.health_endpoint" + } + ], + "owner": null, + "title": "Цикл отправки уведомлений в Telegram", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "architecture.telegram_notify_app", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "0f62f9b4dab261ca4ca34575ff5d84411a22c90b780c52eda388782b94f08470", + "children": [], + "doc_kind": "misc", + "entities": [ + "TelegramNotifyWorker", + "TelegramSendService", + "WorkerHealth", + "WorkerStatus" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "logic.telegram_notification_loop", + "source_path": "docs/documentation/logic/telegram-notification-loop.md", + "summary_text": "`TelegramNotifyWorker` после старта runtime запускает отдельный поток, сразу делает первую попытку отправки сообщения и затем повторяет отправку через заданный интервал. При ошибках доставки или отсутствии credentials worker не останавливает сервис, а переводит собственное состояние в `degraded`. Этот workflow определяет основной полезный цикл приложения.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "HTTP API /actions/{action}", + "content": "Endpoint `/actions/{action}` управляет control actions runtime и поддерживает `start`, `stop` и `status`. Для долгих операций `start` и `stop` допускается ответ HTTP 202, если действие еще выполняется. Endpoint используется для operator-driven управления жизненным циклом worker'а через HTTP API.", + "metadata": { + "name": "control_actions_endpoint", + "tags": [ + "api", + "control-plane", + "lifecycle" + ], + "type": "api_method", + "layer": "application", + "links": [ + { + "type": "part_of", + "target": "architecture.telegram_notify_app" + }, + { + "type": "related_api", + "target": "api.health_endpoint" + }, + { + "type": "related_logic", + "target": "logic.telegram_notification_loop" + } + ], + "owner": null, + "title": "HTTP API /actions/{action}", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "architecture.telegram_notify_app", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "children": [], + "doc_kind": "misc", + "entities": [ + "TelegramControlChannel", + "ControlActionSet", + "JSONResponse" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "api.control_actions_endpoint", + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "summary_text": "Endpoint `/actions/{action}` управляет control actions runtime и поддерживает `start`, `stop` и `status`. Для долгих операций `start` и `stop` допускается ответ HTTP 202, если действие еще выполняется. Endpoint используется для operator-driven управления жизненным циклом worker'а через HTTP API.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/architecture/telegram-notify-app-overview.md", + "title": "Архитектура Telegram Notify App", + "content": "`test_echo_app` — сервис на базе PLBA runtime, который поднимает HTTP control plane и запускает фоновый воркер для периодической отправки уведомлений в Telegram. Приложение использует YAML-конфиг для runtime-настроек и переменные окружения для Telegram credentials. Основной контур системы состоит из runtime manager, control channel, send service и worker loop.", + "metadata": { + "name": "telegram_notify_app_overview", + "tags": [ + "architecture", + "telegram", + "plba", + "runtime" + ], + "type": "architecture_overview", + "layer": "system", + "links": [ + { + "type": "related_api", + "target": "api.health_endpoint" + }, + { + "type": "related_api", + "target": "api.control_actions_endpoint" + }, + { + "type": "related_api", + "target": "api.send_message_endpoint" + }, + { + "type": "depends_on", + "target": "logic.telegram_notification_loop" + }, + { + "type": "depends_on", + "target": "domain.runtime_health" + } + ], + "owner": null, + "title": "Архитектура Telegram Notify App", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "docs_root", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "8b1cc9f823e55bddbc825466d10a0fdb4ca4354ac02d91f9e2aef7b7d2ec8256", + "children": [ + "api.health_endpoint", + "api.control_actions_endpoint", + "api.send_message_endpoint", + "logic.telegram_notification_loop", + "domain.runtime_health" + ], + "doc_kind": "spec", + "entities": [ + "TelegramNotifyModule", + "TelegramNotifyWorker", + "TelegramControlChannel", + "TelegramSendService", + "RuntimeManager" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "architecture.telegram_notify_app", + "source_path": "docs/documentation/architecture/telegram-notify-app-overview.md", + "summary_text": "`test_echo_app` — сервис на базе PLBA runtime, который поднимает HTTP control plane и запускает фоновый воркер для периодической отправки уведомлений в Telegram. Приложение использует YAML-конфиг для runtime-настроек и переменные окружения для Telegram credentials. Основной контур системы состоит из runtime manager, control channel, send service и worker loop.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/api/send-message-endpoint.md", + "title": "HTTP API /send", + "content": "Endpoint `/send` выполняет ручную отправку сообщения в Telegram через `TelegramSendService`. Он используется для операторской проверки доставки и для отправки уведомлений вне периодического worker loop. Endpoint работает поверх тех же credentials и того же delivery path, что и фоновая отправка.", + "metadata": { + "name": "send_message_endpoint", + "tags": [ + "api", + "telegram", + "manual-send" + ], + "type": "api_method", + "layer": "application", + "links": [ + { + "type": "part_of", + "target": "architecture.telegram_notify_app" + }, + { + "type": "depends_on", + "target": "logic.telegram_notification_loop" + } + ], + "owner": null, + "title": "HTTP API /send", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "architecture.telegram_notify_app", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "5fbf2e33510b0676a3a53b957a4569bd3c2c31fb7719546602c573421ccaa32d", + "children": [], + "doc_kind": "misc", + "entities": [ + "TelegramControlAppFactory", + "TelegramSendService", + "TelegramNotifyWorker" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "api.send_message_endpoint", + "source_path": "docs/documentation/api/send-message-endpoint.md", + "summary_text": "Endpoint `/send` выполняет ручную отправку сообщения в Telegram через `TelegramSendService`. Он используется для операторской проверки доставки и для отправки уведомлений вне периодического worker loop. Endpoint работает поверх тех же credentials и того же delivery path, что и фоновая отправка.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + } + ], + "facts": [], + "relations": [ + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/domain/runtime-health-entity.md", + "title": "domain.runtime_health:parent", + "content": "domain.runtime_health parent architecture.telegram_notify_app", + "metadata": { + "owner": null, + "anchor": "frontmatter.parent", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "37d4dcf470ea3de95d59e44786006e369a3ea11bf5dbf4c88877696e9183ee87", + "source_id": "domain.runtime_health", + "target_id": "architecture.telegram_notify_app", + "doc_version": null, + "relation_id": "79bdb0a74713df6064008179ca8c5c186dc23e4e1c5e2c9607b0bdddeba50f93", + "source_path": "docs/documentation/domain/runtime-health-entity.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "parent", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/domain/runtime-health-entity.md", + "title": "domain.runtime_health:part_of", + "content": "domain.runtime_health part_of architecture.telegram_notify_app", + "metadata": { + "owner": null, + "anchor": "frontmatter.links", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "37d4dcf470ea3de95d59e44786006e369a3ea11bf5dbf4c88877696e9183ee87", + "source_id": "domain.runtime_health", + "target_id": "architecture.telegram_notify_app", + "doc_version": null, + "relation_id": "af2a4f7c1b677b908410ba720915405e10dbd0870e30a3c6e3aa2468550ddf0e", + "source_path": "docs/documentation/domain/runtime-health-entity.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "part_of", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/api/health-endpoint.md", + "title": "api.health_endpoint:depends_on", + "content": "api.health_endpoint depends_on domain.runtime_health", + "metadata": { + "owner": null, + "anchor": "frontmatter.links", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "8b5a533a8076e2e9d36995eee29aeade260080bdca2ec8e21fe28f08574b983f", + "source_id": "api.health_endpoint", + "target_id": "domain.runtime_health", + "doc_version": null, + "relation_id": "77f5d358ab85b3d92018b6b51da7c39773148dfd346686e8832a45370c841160", + "source_path": "docs/documentation/api/health-endpoint.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "depends_on", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/api/health-endpoint.md", + "title": "api.health_endpoint:parent", + "content": "api.health_endpoint parent architecture.telegram_notify_app", + "metadata": { + "owner": null, + "anchor": "frontmatter.parent", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "8b5a533a8076e2e9d36995eee29aeade260080bdca2ec8e21fe28f08574b983f", + "source_id": "api.health_endpoint", + "target_id": "architecture.telegram_notify_app", + "doc_version": null, + "relation_id": "c718b1939621233295ccaf6e8203e7fd94f3dd1bfb88f10c51bc5e33d53a24aa", + "source_path": "docs/documentation/api/health-endpoint.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "parent", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/api/health-endpoint.md", + "title": "api.health_endpoint:part_of", + "content": "api.health_endpoint part_of architecture.telegram_notify_app", + "metadata": { + "owner": null, + "anchor": "frontmatter.links", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "8b5a533a8076e2e9d36995eee29aeade260080bdca2ec8e21fe28f08574b983f", + "source_id": "api.health_endpoint", + "target_id": "architecture.telegram_notify_app", + "doc_version": null, + "relation_id": "616f5cbf25da83cb51d8d0741a7fc351620c9ca2c6513fa2094b4aa476f0912a", + "source_path": "docs/documentation/api/health-endpoint.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "part_of", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/domain/runtime-health-entity.md", + "title": "domain.runtime_health:used_by", + "content": "domain.runtime_health used_by api.health_endpoint", + "metadata": { + "owner": null, + "anchor": "frontmatter.links", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "37d4dcf470ea3de95d59e44786006e369a3ea11bf5dbf4c88877696e9183ee87", + "source_id": "domain.runtime_health", + "target_id": "api.health_endpoint", + "doc_version": null, + "relation_id": "801650f8bcbfbfbefd35c14447bfef7b3c3827313db790efa7faf47db860f8c4", + "source_path": "docs/documentation/domain/runtime-health-entity.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "used_by", + "staleness_score": null, + "system_component": null + } + } + ] +} +``` + +### User Prompt Overview +- question: Что такое runtime health? +- intent: DOCUMENTATION_EXPLAIN +- sub_intent: ENTITY_EXPLAIN +- documents: 6 | samples: Сущность runtime health, HTTP API /health, Цикл отправки уведомлений в Telegram +- facts: 0 +- relations: 6 | samples: domain.runtime_health:parent, domain.runtime_health:part_of, api.health_endpoint:depends_on + +## Mismatches +- none \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/docs_pre_llm_v3/20260326_120832/full_chain_docs_intents_v2_docs-v2-entity-worker-status.json b/tests/pipeline_setup_v3/test_results/docs_pre_llm_v3/20260326_120832/full_chain_docs_intents_v2_docs-v2-entity-worker-status.json new file mode 100644 index 0000000..1b6b641 --- /dev/null +++ b/tests/pipeline_setup_v3/test_results/docs_pre_llm_v3/20260326_120832/full_chain_docs_intents_v2_docs-v2-entity-worker-status.json @@ -0,0 +1,86 @@ +{ + "meta": { + "case_id": "docs-v2-entity-worker-status", + "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_03_docs/full_chain_docs_intents_v2.yaml", + "runner": "agent_runtime", + "mode": "full_chain", + "passed": true, + "mismatches": [], + "actual": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "ENTITY_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START", + "rag_count": 4, + "llm_answer": "", + "answer_mode": "answered", + "path_scope": [], + "doc_scope": [ + "domain.runtime_health", + "logic.telegram_notification_loop" + ], + "entity_candidates": [ + "WorkerStatus" + ], + "symbol_candidates": [], + "layers": [ + "D3_ENTITY_CATALOG", + "D1_DOCUMENT_CATALOG", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "filters": { + "doc_type": null + }, + "pipeline_mode": "pre_llm_only", + "gate_decision": "allow", + "prompt_used": "docs_explain_answer", + "llm_mode": "prose", + "degraded_reason": null, + "code_intents_stubbed": true + } + }, + "pipeline_steps": [ + { + "step": "input_query", + "input": { + "query": "Объясни сущность WorkerStatus" + }, + "output": { + "query": "Объясни сущность WorkerStatus" + } + }, + { + "step": "router", + "input": { + "query": "Объясни сущность WorkerStatus" + }, + "output": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "ENTITY_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START" + } + }, + { + "step": "docs_pipeline", + "input": { + "query": "Объясни сущность WorkerStatus" + }, + "output": { + "answer_mode": "ready", + "prompt_name": "docs_explain_answer", + "llm_request": { + "prompt_name": "docs_explain_answer", + "log_context": "graph.project_qa.docs.answer", + "prompt_stats": { + "system_chars": 393, + "user_chars": 2555, + "tokens_in_estimate": 737 + } + }, + "degraded_reason": "" + } + } + ] +} \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/docs_pre_llm_v3/20260326_120832/full_chain_docs_intents_v2_docs-v2-entity-worker-status.md b/tests/pipeline_setup_v3/test_results/docs_pre_llm_v3/20260326_120832/full_chain_docs_intents_v2_docs-v2-entity-worker-status.md new file mode 100644 index 0000000..9119415 --- /dev/null +++ b/tests/pipeline_setup_v3/test_results/docs_pre_llm_v3/20260326_120832/full_chain_docs_intents_v2_docs-v2-entity-worker-status.md @@ -0,0 +1,384 @@ +# docs-v2-entity-worker-status + +- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_03_docs/full_chain_docs_intents_v2.yaml +- runner: agent_runtime +- mode: full_chain +- passed: True + +## Query +Объясни сущность WorkerStatus + +## Actual +{ + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "ENTITY_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START", + "rag_count": 4, + "llm_answer": "", + "answer_mode": "answered", + "path_scope": [], + "doc_scope": [ + "domain.runtime_health", + "logic.telegram_notification_loop" + ], + "entity_candidates": [ + "WorkerStatus" + ], + "symbol_candidates": [], + "layers": [ + "D3_ENTITY_CATALOG", + "D1_DOCUMENT_CATALOG", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "filters": { + "doc_type": null + }, + "pipeline_mode": "pre_llm_only", + "gate_decision": "allow", + "prompt_used": "docs_explain_answer", + "llm_mode": "prose", + "degraded_reason": null, + "code_intents_stubbed": true +} + +## Pipeline Steps +### input_query +```json +{ + "input": { + "query": "Объясни сущность WorkerStatus" + }, + "output": { + "query": "Объясни сущность WorkerStatus" + } +} +``` + +### router +```json +{ + "input": { + "query": "Объясни сущность WorkerStatus" + }, + "output": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "ENTITY_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START" + } +} +``` + +### docs_pipeline +```json +{ + "input": { + "query": "Объясни сущность WorkerStatus" + }, + "output": { + "answer_mode": "ready", + "prompt_name": "docs_explain_answer", + "llm_request": { + "prompt_name": "docs_explain_answer", + "log_context": "graph.project_qa.docs.answer", + "prompt_stats": { + "system_chars": 393, + "user_chars": 2555, + "tokens_in_estimate": 737 + } + }, + "degraded_reason": "" + } +} +``` + +## Diagnostics +{ + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "ENTITY_EXPLAIN", + "layers_used": [ + "D3_ENTITY_CATALOG", + "D1_DOCUMENT_CATALOG", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "documents_found": 1, + "facts_found": 0, + "relations_found": 0, + "openapi_fields_extracted": 0, + "missing_required_fields": [], + "openapi_status": { + "has_path": false, + "has_method": false, + "has_request": false, + "has_response": false + }, + "prompt_used": "docs_explain_answer", + "llm_mode": "prose", + "output_valid": true, + "matched_intent_source": "deterministic", + "matched_anchor_type": "entity", + "matched_anchor_value": "WorkerStatus", + "exact_anchor_match": true, + "docs_layers_requested": [ + "D3_ENTITY_CATALOG", + "D1_DOCUMENT_CATALOG", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "docs_layers_with_hits": [ + "D3_ENTITY_CATALOG", + "D1_DOCUMENT_CATALOG", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "planned_layers": [ + "D3_ENTITY_CATALOG", + "D1_DOCUMENT_CATALOG", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "executed_layers": [ + "D3_ENTITY_CATALOG", + "D1_DOCUMENT_CATALOG", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "non_empty_layers": [ + "D3_ENTITY_CATALOG", + "D1_DOCUMENT_CATALOG", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "layer_diagnostics": { + "D3_ENTITY_CATALOG": { + "hits": 8, + "top_ids": [ + "domain.runtime_health", + "logic.telegram_notification_loop", + "api.control_actions_endpoint", + "api.health_endpoint" + ] + }, + "D1_DOCUMENT_CATALOG": { + "hits": 6, + "top_ids": [ + "docs/README.md", + "api.control_actions_endpoint", + "api.health_endpoint", + "api.send_message_endpoint", + "architecture.telegram_notify_app" + ] + }, + "D5_RELATION_GRAPH": { + "hits": 6, + "top_ids": [ + "5f4909bde905cd3d294ad307074a05e4ae4deefcafe6272cd2d0436e73acb8dd", + "711fb2edb82dd222deaba3c91768b18cbbd453009235823282813c6e867dc2c1", + "eec79f7a02b804337e791ef231784862ae26e0599eb20224790e9d4f085fa9c0", + "c718b1939621233295ccaf6e8203e7fd94f3dd1bfb88f10c51bc5e33d53a24aa", + "616f5cbf25da83cb51d8d0741a7fc351620c9ca2c6513fa2094b4aa476f0912a" + ] + }, + "D0_DOC_CHUNKS": { + "hits": 6, + "top_ids": [ + "logic.telegram_notification_loop", + "docs/README.md", + "api.control_actions_endpoint" + ] + } + }, + "query_entity_candidates": [ + "WorkerStatus" + ], + "resolved_entity_candidates": [], + "query_anchor_candidates": [ + "WorkerStatus" + ], + "resolved_anchor_candidates": [ + "domain.runtime_health", + "docs/documentation/domain/runtime-health-entity.md", + "logic.telegram_notification_loop", + "docs/documentation/logic/telegram-notification-loop.md" + ], + "anchor_candidates": [], + "selected_anchor": null, + "anchor_selection_reason": "", + "anchor_match_type": "", + "doc_ids": [ + "domain.runtime_health", + "logic.telegram_notification_loop" + ], + "doc_paths": [ + "docs/documentation/domain/runtime-health-entity.md", + "docs/documentation/logic/telegram-notification-loop.md" + ], + "doc_titles": [ + "WorkerStatus", + "logic.telegram_notification_loop:Details", + "Сущность runtime health" + ], + "relation_hits_count": 0, + "relation_targets": [], + "fallback_doc_hits_count": 2, + "fallback_used": false, + "fact_hits": 0, + "entity_hits": 0, + "evidence_summary": { + "documents": 1, + "facts": 0, + "relations": 0, + "chunks": 1, + "entity_hits": 0, + "openapi_signals": { + "path_found": false, + "method_found": false, + "request_schema": false, + "response_schema": false, + "status_codes": false, + "payload_description": false + } + }, + "gate_decision": "allow", + "gate_decision_reason": "evidence_sufficient", + "gate_missing_requirements": [], + "gate_satisfied_requirements": [ + "retrieval_non_empty", + "exact_anchor_match" + ], + "openapi_evidence": { + "path_found": false, + "method_found": false, + "request_schema": false, + "response_schema": false, + "status_codes": false, + "payload_description": false + }, + "requested_fragment_type": null, + "fragment_evidence_found": [], + "fragment_missing_requirements": [], + "answer_mode": "ready", + "degrade_reason": null, + "degraded_reason": null, + "code_intents_stubbed": false +} + +## LLM Request +- prompt_name: docs_explain_answer +- log_context: graph.project_qa.docs.answer + +### Prompt Stats +```json +{ + "system_chars": 393, + "user_chars": 2555, + "tokens_in_estimate": 737 +} +``` + +### System Prompt +```text +Ты объясняешь документацию системы. + +На вход приходит JSON с полями: +- question +- intent +- sub_intent +- documents +- facts +- relations + +Правила: +- Используй только предоставленные факты +- Не додумывай +- Если данных недостаточно, скажи это явно +- Объясняй структурировано + +Формат ответа: +1. Краткое описание +2. Основные элементы +3. Как это работает +4. Связи с другими частями системы (если есть) +``` + +### User Prompt +```json +{ + "question": "Объясни сущность WorkerStatus", + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "ENTITY_EXPLAIN", + "documents": [ + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/domain/runtime-health-entity.md", + "title": "Сущность runtime health", + "content": "`runtime health` — доменная модель наблюдаемости сервиса, которая описывает общее состояние runtime и состояние отдельных компонентов. Для `test_echo_app` главным объектом наблюдения является компонент `telegram_notify`, у которого важны статус, время старта и количество успешных отправок. Эта модель используется для внешнего health-monitoring и внутренней диагностики.", + "metadata": { + "name": "runtime_health", + "tags": [ + "domain", + "health", + "observability" + ], + "type": "domain_entity", + "layer": "domain", + "links": [ + { + "type": "part_of", + "target": "architecture.telegram_notify_app" + }, + { + "type": "used_by", + "target": "api.health_endpoint" + }, + { + "type": "related_logic", + "target": "logic.telegram_notification_loop" + } + ], + "owner": null, + "title": "Сущность runtime health", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "architecture.telegram_notify_app", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "37d4dcf470ea3de95d59e44786006e369a3ea11bf5dbf4c88877696e9183ee87", + "children": [], + "doc_kind": "misc", + "entities": [ + "WorkerHealth", + "WorkerStatus", + "TelegramNotifyWorker" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "domain.runtime_health", + "source_path": "docs/documentation/domain/runtime-health-entity.md", + "summary_text": "`runtime health` — доменная модель наблюдаемости сервиса, которая описывает общее состояние runtime и состояние отдельных компонентов. Для `test_echo_app` главным объектом наблюдения является компонент `telegram_notify`, у которого важны статус, время старта и количество успешных отправок. Эта модель используется для внешнего health-monitoring и внутренней диагностики.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + } + ], + "facts": [], + "relations": [] +} +``` + +### User Prompt Overview +- question: Объясни сущность WorkerStatus +- intent: DOCUMENTATION_EXPLAIN +- sub_intent: ENTITY_EXPLAIN +- documents: 1 | samples: Сущность runtime health +- facts: 0 +- relations: 0 + +## Mismatches +- none \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/docs_pre_llm_v3/20260326_120832/full_chain_docs_intents_v2_docs-v2-general-overview.json b/tests/pipeline_setup_v3/test_results/docs_pre_llm_v3/20260326_120832/full_chain_docs_intents_v2_docs-v2-general-overview.json new file mode 100644 index 0000000..33bd171 --- /dev/null +++ b/tests/pipeline_setup_v3/test_results/docs_pre_llm_v3/20260326_120832/full_chain_docs_intents_v2_docs-v2-general-overview.json @@ -0,0 +1,85 @@ +{ + "meta": { + "case_id": "docs-v2-general-overview", + "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_03_docs/full_chain_docs_intents_v2.yaml", + "runner": "agent_runtime", + "mode": "full_chain", + "passed": true, + "mismatches": [], + "actual": { + "intent": "GENERAL_QA", + "sub_intent": "GENERIC_QA", + "graph_id": "DocsQAGraph", + "conversation_mode": "START", + "rag_count": 12, + "llm_answer": "", + "answer_mode": "answered", + "path_scope": [], + "doc_scope": [ + "docs/README.md", + "api.control_actions_endpoint", + "api.actions_endpoint", + "api.health_endpoint", + "api.send_message_endpoint" + ], + "entity_candidates": [], + "symbol_candidates": [], + "layers": [ + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "filters": { + "doc_type": null + }, + "pipeline_mode": "pre_llm_only", + "gate_decision": "allow", + "prompt_used": "docs_general_answer", + "llm_mode": "prose", + "degraded_reason": null, + "code_intents_stubbed": true + } + }, + "pipeline_steps": [ + { + "step": "input_query", + "input": { + "query": "Что вообще описано в документации по этому сервису?" + }, + "output": { + "query": "Что вообще описано в документации по этому сервису?" + } + }, + { + "step": "router", + "input": { + "query": "Что вообще описано в документации по этому сервису?" + }, + "output": { + "intent": "GENERAL_QA", + "sub_intent": "GENERIC_QA", + "graph_id": "DocsQAGraph", + "conversation_mode": "START" + } + }, + { + "step": "docs_pipeline", + "input": { + "query": "Что вообще описано в документации по этому сервису?" + }, + "output": { + "answer_mode": "ready", + "prompt_name": "docs_general_answer", + "llm_request": { + "prompt_name": "docs_general_answer", + "log_context": "graph.project_qa.docs.answer", + "prompt_stats": { + "system_chars": 345, + "user_chars": 7589, + "tokens_in_estimate": 1984 + } + }, + "degraded_reason": "" + } + } + ] +} \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/docs_pre_llm_v3/20260326_120832/full_chain_docs_intents_v2_docs-v2-general-overview.md b/tests/pipeline_setup_v3/test_results/docs_pre_llm_v3/20260326_120832/full_chain_docs_intents_v2_docs-v2-general-overview.md new file mode 100644 index 0000000..b43e87a --- /dev/null +++ b/tests/pipeline_setup_v3/test_results/docs_pre_llm_v3/20260326_120832/full_chain_docs_intents_v2_docs-v2-general-overview.md @@ -0,0 +1,493 @@ +# docs-v2-general-overview + +- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_03_docs/full_chain_docs_intents_v2.yaml +- runner: agent_runtime +- mode: full_chain +- passed: True + +## Query +Что вообще описано в документации по этому сервису? + +## Actual +{ + "intent": "GENERAL_QA", + "sub_intent": "GENERIC_QA", + "graph_id": "DocsQAGraph", + "conversation_mode": "START", + "rag_count": 12, + "llm_answer": "", + "answer_mode": "answered", + "path_scope": [], + "doc_scope": [ + "docs/README.md", + "api.control_actions_endpoint", + "api.actions_endpoint", + "api.health_endpoint", + "api.send_message_endpoint" + ], + "entity_candidates": [], + "symbol_candidates": [], + "layers": [ + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "filters": { + "doc_type": null + }, + "pipeline_mode": "pre_llm_only", + "gate_decision": "allow", + "prompt_used": "docs_general_answer", + "llm_mode": "prose", + "degraded_reason": null, + "code_intents_stubbed": true +} + +## Pipeline Steps +### input_query +```json +{ + "input": { + "query": "Что вообще описано в документации по этому сервису?" + }, + "output": { + "query": "Что вообще описано в документации по этому сервису?" + } +} +``` + +### router +```json +{ + "input": { + "query": "Что вообще описано в документации по этому сервису?" + }, + "output": { + "intent": "GENERAL_QA", + "sub_intent": "GENERIC_QA", + "graph_id": "DocsQAGraph", + "conversation_mode": "START" + } +} +``` + +### docs_pipeline +```json +{ + "input": { + "query": "Что вообще описано в документации по этому сервису?" + }, + "output": { + "answer_mode": "ready", + "prompt_name": "docs_general_answer", + "llm_request": { + "prompt_name": "docs_general_answer", + "log_context": "graph.project_qa.docs.answer", + "prompt_stats": { + "system_chars": 345, + "user_chars": 7589, + "tokens_in_estimate": 1984 + } + }, + "degraded_reason": "" + } +} +``` + +## Diagnostics +{ + "intent": "GENERAL_QA", + "sub_intent": "GENERIC_QA", + "layers_used": [ + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "documents_found": 4, + "facts_found": 0, + "relations_found": 0, + "openapi_fields_extracted": 0, + "missing_required_fields": [], + "openapi_status": { + "has_path": false, + "has_method": false, + "has_request": false, + "has_response": false + }, + "prompt_used": "docs_general_answer", + "llm_mode": "prose", + "output_valid": true, + "matched_intent_source": "deterministic", + "matched_anchor_type": "none", + "matched_anchor_value": null, + "exact_anchor_match": false, + "docs_layers_requested": [ + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "docs_layers_with_hits": [ + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "planned_layers": [ + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "executed_layers": [ + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "non_empty_layers": [ + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "layer_diagnostics": { + "D1_DOCUMENT_CATALOG": { + "hits": 4, + "top_ids": [ + "docs/README.md", + "api.control_actions_endpoint", + "api.health_endpoint", + "api.send_message_endpoint" + ] + }, + "D0_DOC_CHUNKS": { + "hits": 8, + "top_ids": [ + "docs/README.md", + "api.control_actions_endpoint" + ] + } + }, + "query_entity_candidates": [], + "resolved_entity_candidates": [], + "query_anchor_candidates": [], + "resolved_anchor_candidates": [ + "docs/README.md", + "api.control_actions_endpoint", + "docs/documentation/api/control-actions-endpoint.md", + "api.health_endpoint", + "docs/documentation/api/health-endpoint.md", + "api.send_message_endpoint", + "docs/documentation/api/send-message-endpoint.md" + ], + "anchor_candidates": [], + "selected_anchor": null, + "anchor_selection_reason": "", + "anchor_match_type": "", + "doc_ids": [ + "docs/README.md", + "api.control_actions_endpoint", + "api.actions_endpoint", + "api.health_endpoint", + "api.send_message_endpoint" + ], + "doc_paths": [ + "docs/README.md", + "docs/documentation/api/control-actions-endpoint.md", + "docs/documentation/api/health-endpoint.md", + "docs/documentation/api/send-message-endpoint.md" + ], + "doc_titles": [ + "Readme", + "HTTP API /actions/{action}", + "HTTP API /health", + "HTTP API /send", + "docs/README.md:Структура", + "docs/README.md:Навигация", + "docs/README.md:Правила и шаблоны", + "api.control_actions_endpoint:Summary", + "api.control_actions_endpoint:Описание", + "api.control_actions_endpoint:Сценарий", + "api.control_actions_endpoint:Функциональные требования", + "docs/README.md:Project Docs" + ], + "relation_hits_count": 0, + "relation_targets": [], + "fallback_doc_hits_count": 12, + "fallback_used": false, + "fact_hits": 0, + "entity_hits": 0, + "evidence_summary": { + "documents": 4, + "facts": 0, + "relations": 0, + "chunks": 8, + "entity_hits": 0, + "openapi_signals": { + "path_found": false, + "method_found": false, + "request_schema": false, + "response_schema": false, + "status_codes": false, + "payload_description": false + } + }, + "gate_decision": "allow", + "gate_decision_reason": "evidence_sufficient", + "gate_missing_requirements": [], + "gate_satisfied_requirements": [ + "retrieval_non_empty" + ], + "openapi_evidence": { + "path_found": false, + "method_found": false, + "request_schema": false, + "response_schema": false, + "status_codes": false, + "payload_description": false + }, + "requested_fragment_type": null, + "fragment_evidence_found": [], + "fragment_missing_requirements": [], + "answer_mode": "ready", + "degrade_reason": null, + "degraded_reason": null, + "code_intents_stubbed": false +} + +## LLM Request +- prompt_name: docs_general_answer +- log_context: graph.project_qa.docs.answer + +### Prompt Stats +```json +{ + "system_chars": 345, + "user_chars": 7589, + "tokens_in_estimate": 1984 +} +``` + +### System Prompt +```text +Ты отвечаешь на общий вопрос по документации проекта. + +На вход приходит JSON с полями: +- question +- intent +- sub_intent +- documents +- facts +- relations + +Правила: +- Используй только предоставленные документы и факты +- Не додумывай отсутствующие детали +- Если данных недостаточно, скажи это прямо +- Дай короткий понятный ответ без лишней структуры +``` + +### User Prompt +```json +{ + "question": "Что вообще описано в документации по этому сервису?", + "intent": "GENERAL_QA", + "sub_intent": "GENERIC_QA", + "documents": [ + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/README.md", + "title": "Readme", + "content": "Readme", + "metadata": { + "name": "", + "tags": [], + "type": "", + "layer": "", + "links": [], + "owner": null, + "title": "Readme", + "doc_id": null, + "module": "", + "parent": null, + "status": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "81d952f1a6ea85b76f75e0e57f33b8fa4b2bf3cb7db11b91b90171aeedd655a6", + "children": [], + "doc_kind": "readme", + "entities": [], + "updated_at": null, + "doc_version": null, + "document_id": "docs/README.md", + "source_path": "docs/README.md", + "summary_text": "", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "HTTP API /actions/{action}", + "content": "Endpoint `/actions/{action}` управляет control actions runtime и поддерживает `start`, `stop` и `status`. Для долгих операций `start` и `stop` допускается ответ HTTP 202, если действие еще выполняется. Endpoint используется для operator-driven управления жизненным циклом worker'а через HTTP API.", + "metadata": { + "name": "control_actions_endpoint", + "tags": [ + "api", + "control-plane", + "lifecycle" + ], + "type": "api_method", + "layer": "application", + "links": [ + { + "type": "part_of", + "target": "architecture.telegram_notify_app" + }, + { + "type": "related_api", + "target": "api.health_endpoint" + }, + { + "type": "related_logic", + "target": "logic.telegram_notification_loop" + } + ], + "owner": null, + "title": "HTTP API /actions/{action}", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "architecture.telegram_notify_app", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "children": [], + "doc_kind": "misc", + "entities": [ + "TelegramControlChannel", + "ControlActionSet", + "JSONResponse" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "api.control_actions_endpoint", + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "summary_text": "Endpoint `/actions/{action}` управляет control actions runtime и поддерживает `start`, `stop` и `status`. Для долгих операций `start` и `stop` допускается ответ HTTP 202, если действие еще выполняется. Endpoint используется для operator-driven управления жизненным циклом worker'а через HTTP API.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/api/health-endpoint.md", + "title": "HTTP API /health", + "content": "Endpoint `/health` возвращает агрегированный health payload runtime. Если общий статус равен `ok`, API отвечает с HTTP 200; для состояний деградации или неготовности возвращается HTTP 503 с тем же payload. Endpoint служит основной точкой внешней проверки состояния приложения.", + "metadata": { + "name": "health_endpoint", + "tags": [ + "api", + "health", + "control-plane" + ], + "type": "api_method", + "layer": "application", + "links": [ + { + "type": "part_of", + "target": "architecture.telegram_notify_app" + }, + { + "type": "depends_on", + "target": "domain.runtime_health" + } + ], + "owner": null, + "title": "HTTP API /health", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "architecture.telegram_notify_app", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "8b5a533a8076e2e9d36995eee29aeade260080bdca2ec8e21fe28f08574b983f", + "children": [], + "doc_kind": "misc", + "entities": [ + "TelegramControlChannel", + "TelegramNotifyWorker", + "RuntimeManager", + "WorkerHealth" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "api.health_endpoint", + "source_path": "docs/documentation/api/health-endpoint.md", + "summary_text": "Endpoint `/health` возвращает агрегированный health payload runtime. Если общий статус равен `ok`, API отвечает с HTTP 200; для состояний деградации или неготовности возвращается HTTP 503 с тем же payload. Endpoint служит основной точкой внешней проверки состояния приложения.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/api/send-message-endpoint.md", + "title": "HTTP API /send", + "content": "Endpoint `/send` выполняет ручную отправку сообщения в Telegram через `TelegramSendService`. Он используется для операторской проверки доставки и для отправки уведомлений вне периодического worker loop. Endpoint работает поверх тех же credentials и того же delivery path, что и фоновая отправка.", + "metadata": { + "name": "send_message_endpoint", + "tags": [ + "api", + "telegram", + "manual-send" + ], + "type": "api_method", + "layer": "application", + "links": [ + { + "type": "part_of", + "target": "architecture.telegram_notify_app" + }, + { + "type": "depends_on", + "target": "logic.telegram_notification_loop" + } + ], + "owner": null, + "title": "HTTP API /send", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "architecture.telegram_notify_app", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "5fbf2e33510b0676a3a53b957a4569bd3c2c31fb7719546602c573421ccaa32d", + "children": [], + "doc_kind": "misc", + "entities": [ + "TelegramControlAppFactory", + "TelegramSendService", + "TelegramNotifyWorker" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "api.send_message_endpoint", + "source_path": "docs/documentation/api/send-message-endpoint.md", + "summary_text": "Endpoint `/send` выполняет ручную отправку сообщения в Telegram через `TelegramSendService`. Он используется для операторской проверки доставки и для отправки уведомлений вне периодического worker loop. Endpoint работает поверх тех же credentials и того же delivery path, что и фоновая отправка.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + } + ], + "facts": [], + "relations": [] +} +``` + +### User Prompt Overview +- question: Что вообще описано в документации по этому сервису? +- intent: GENERAL_QA +- sub_intent: GENERIC_QA +- documents: 4 | samples: Readme, HTTP API /actions/{action}, HTTP API /health +- facts: 0 +- relations: 0 + +## Mismatches +- none \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/docs_pre_llm_v3/20260326_120832/full_chain_docs_intents_v2_docs-v2-negative-missing-entity.json b/tests/pipeline_setup_v3/test_results/docs_pre_llm_v3/20260326_120832/full_chain_docs_intents_v2_docs-v2-negative-missing-entity.json new file mode 100644 index 0000000..0ae090c --- /dev/null +++ b/tests/pipeline_setup_v3/test_results/docs_pre_llm_v3/20260326_120832/full_chain_docs_intents_v2_docs-v2-negative-missing-entity.json @@ -0,0 +1,83 @@ +{ + "meta": { + "case_id": "docs-v2-negative-missing-entity", + "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_03_docs/full_chain_docs_intents_v2.yaml", + "runner": "agent_runtime", + "mode": "full_chain", + "passed": true, + "mismatches": [], + "actual": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "ENTITY_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START", + "rag_count": 0, + "llm_answer": "", + "answer_mode": "degraded", + "path_scope": [], + "doc_scope": [], + "entity_candidates": [ + "PaymentTransaction" + ], + "symbol_candidates": [], + "layers": [ + "D3_ENTITY_CATALOG", + "D1_DOCUMENT_CATALOG", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "filters": { + "doc_type": null + }, + "pipeline_mode": "pre_llm_only", + "gate_decision": "reject", + "prompt_used": "docs_explain_answer", + "llm_mode": "prose", + "degraded_reason": "not_found_exact_anchor", + "code_intents_stubbed": true + } + }, + "pipeline_steps": [ + { + "step": "input_query", + "input": { + "query": "Что такое сущность PaymentTransaction?" + }, + "output": { + "query": "Что такое сущность PaymentTransaction?" + } + }, + { + "step": "router", + "input": { + "query": "Что такое сущность PaymentTransaction?" + }, + "output": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "ENTITY_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START" + } + }, + { + "step": "docs_pipeline", + "input": { + "query": "Что такое сущность PaymentTransaction?" + }, + "output": { + "answer_mode": "degraded", + "prompt_name": "docs_explain_answer", + "llm_request": { + "prompt_name": "docs_explain_answer", + "log_context": "graph.project_qa.docs.answer", + "prompt_stats": { + "system_chars": 393, + "user_chars": 182, + "tokens_in_estimate": 144 + } + }, + "degraded_reason": "not_found_exact_anchor" + } + } + ] +} \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/docs_pre_llm_v3/20260326_120832/full_chain_docs_intents_v2_docs-v2-negative-missing-entity.md b/tests/pipeline_setup_v3/test_results/docs_pre_llm_v3/20260326_120832/full_chain_docs_intents_v2_docs-v2-negative-missing-entity.md new file mode 100644 index 0000000..e91b05c --- /dev/null +++ b/tests/pipeline_setup_v3/test_results/docs_pre_llm_v3/20260326_120832/full_chain_docs_intents_v2_docs-v2-negative-missing-entity.md @@ -0,0 +1,307 @@ +# docs-v2-negative-missing-entity + +- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_03_docs/full_chain_docs_intents_v2.yaml +- runner: agent_runtime +- mode: full_chain +- passed: True + +## Query +Что такое сущность PaymentTransaction? + +## Actual +{ + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "ENTITY_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START", + "rag_count": 0, + "llm_answer": "", + "answer_mode": "degraded", + "path_scope": [], + "doc_scope": [], + "entity_candidates": [ + "PaymentTransaction" + ], + "symbol_candidates": [], + "layers": [ + "D3_ENTITY_CATALOG", + "D1_DOCUMENT_CATALOG", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "filters": { + "doc_type": null + }, + "pipeline_mode": "pre_llm_only", + "gate_decision": "reject", + "prompt_used": "docs_explain_answer", + "llm_mode": "prose", + "degraded_reason": "not_found_exact_anchor", + "code_intents_stubbed": true +} + +## Pipeline Steps +### input_query +```json +{ + "input": { + "query": "Что такое сущность PaymentTransaction?" + }, + "output": { + "query": "Что такое сущность PaymentTransaction?" + } +} +``` + +### router +```json +{ + "input": { + "query": "Что такое сущность PaymentTransaction?" + }, + "output": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "ENTITY_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START" + } +} +``` + +### docs_pipeline +```json +{ + "input": { + "query": "Что такое сущность PaymentTransaction?" + }, + "output": { + "answer_mode": "degraded", + "prompt_name": "docs_explain_answer", + "llm_request": { + "prompt_name": "docs_explain_answer", + "log_context": "graph.project_qa.docs.answer", + "prompt_stats": { + "system_chars": 393, + "user_chars": 182, + "tokens_in_estimate": 144 + } + }, + "degraded_reason": "not_found_exact_anchor" + } +} +``` + +## Diagnostics +{ + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "ENTITY_EXPLAIN", + "layers_used": [ + "D3_ENTITY_CATALOG", + "D1_DOCUMENT_CATALOG", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "documents_found": 0, + "facts_found": 0, + "relations_found": 0, + "openapi_fields_extracted": 0, + "missing_required_fields": [], + "openapi_status": { + "has_path": false, + "has_method": false, + "has_request": false, + "has_response": false + }, + "prompt_used": "docs_explain_answer", + "llm_mode": "prose", + "output_valid": false, + "matched_intent_source": "deterministic", + "matched_anchor_type": "entity", + "matched_anchor_value": "PaymentTransaction", + "exact_anchor_match": false, + "docs_layers_requested": [ + "D3_ENTITY_CATALOG", + "D1_DOCUMENT_CATALOG", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "docs_layers_with_hits": [ + "D3_ENTITY_CATALOG", + "D1_DOCUMENT_CATALOG", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "planned_layers": [ + "D3_ENTITY_CATALOG", + "D1_DOCUMENT_CATALOG", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "executed_layers": [ + "D3_ENTITY_CATALOG", + "D1_DOCUMENT_CATALOG", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "non_empty_layers": [ + "D3_ENTITY_CATALOG", + "D1_DOCUMENT_CATALOG", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "layer_diagnostics": { + "D3_ENTITY_CATALOG": { + "hits": 8, + "top_ids": [ + "api.control_actions_endpoint", + "api.health_endpoint" + ] + }, + "D1_DOCUMENT_CATALOG": { + "hits": 6, + "top_ids": [ + "docs/README.md", + "api.control_actions_endpoint", + "api.health_endpoint", + "api.send_message_endpoint", + "architecture.telegram_notify_app" + ] + }, + "D5_RELATION_GRAPH": { + "hits": 6, + "top_ids": [ + "5f4909bde905cd3d294ad307074a05e4ae4deefcafe6272cd2d0436e73acb8dd", + "711fb2edb82dd222deaba3c91768b18cbbd453009235823282813c6e867dc2c1", + "eec79f7a02b804337e791ef231784862ae26e0599eb20224790e9d4f085fa9c0", + "c718b1939621233295ccaf6e8203e7fd94f3dd1bfb88f10c51bc5e33d53a24aa", + "616f5cbf25da83cb51d8d0741a7fc351620c9ca2c6513fa2094b4aa476f0912a" + ] + }, + "D0_DOC_CHUNKS": { + "hits": 6, + "top_ids": [ + "docs/README.md", + "api.control_actions_endpoint" + ] + } + }, + "query_entity_candidates": [ + "PaymentTransaction" + ], + "resolved_entity_candidates": [], + "query_anchor_candidates": [ + "PaymentTransaction" + ], + "resolved_anchor_candidates": [], + "anchor_candidates": [], + "selected_anchor": null, + "anchor_selection_reason": "", + "anchor_match_type": "", + "doc_ids": [], + "doc_paths": [], + "doc_titles": [], + "relation_hits_count": 0, + "relation_targets": [], + "fallback_doc_hits_count": 0, + "fallback_used": false, + "fact_hits": 0, + "entity_hits": 0, + "evidence_summary": { + "documents": 0, + "facts": 0, + "relations": 0, + "chunks": 0, + "entity_hits": 0, + "openapi_signals": { + "path_found": false, + "method_found": false, + "request_schema": false, + "response_schema": false, + "status_codes": false, + "payload_description": false + } + }, + "gate_decision": "reject", + "gate_decision_reason": "not_found_exact_anchor", + "gate_missing_requirements": [ + "retrieval_non_empty", + "exact_anchor_match" + ], + "gate_satisfied_requirements": [], + "openapi_evidence": { + "path_found": false, + "method_found": false, + "request_schema": false, + "response_schema": false, + "status_codes": false, + "payload_description": false + }, + "requested_fragment_type": null, + "fragment_evidence_found": [], + "fragment_missing_requirements": [], + "answer_mode": "degraded", + "degrade_reason": "not_found_exact_anchor", + "degraded_reason": "not_found_exact_anchor", + "code_intents_stubbed": false +} + +## LLM Request +- prompt_name: docs_explain_answer +- log_context: graph.project_qa.docs.answer + +### Prompt Stats +```json +{ + "system_chars": 393, + "user_chars": 182, + "tokens_in_estimate": 144 +} +``` + +### System Prompt +```text +Ты объясняешь документацию системы. + +На вход приходит JSON с полями: +- question +- intent +- sub_intent +- documents +- facts +- relations + +Правила: +- Используй только предоставленные факты +- Не додумывай +- Если данных недостаточно, скажи это явно +- Объясняй структурировано + +Формат ответа: +1. Краткое описание +2. Основные элементы +3. Как это работает +4. Связи с другими частями системы (если есть) +``` + +### User Prompt +```json +{ + "question": "Что такое сущность PaymentTransaction?", + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "ENTITY_EXPLAIN", + "documents": [], + "facts": [], + "relations": [] +} +``` + +### User Prompt Overview +- question: Что такое сущность PaymentTransaction? +- intent: DOCUMENTATION_EXPLAIN +- sub_intent: ENTITY_EXPLAIN +- documents: 0 +- facts: 0 +- relations: 0 + +## Mismatches +- none \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/docs_pre_llm_v3/20260326_120832/full_chain_docs_intents_v2_docs-v2-openapi-fragment-send-request.json b/tests/pipeline_setup_v3/test_results/docs_pre_llm_v3/20260326_120832/full_chain_docs_intents_v2_docs-v2-openapi-fragment-send-request.json new file mode 100644 index 0000000..7439c5a --- /dev/null +++ b/tests/pipeline_setup_v3/test_results/docs_pre_llm_v3/20260326_120832/full_chain_docs_intents_v2_docs-v2-openapi-fragment-send-request.json @@ -0,0 +1,82 @@ +{ + "meta": { + "case_id": "docs-v2-openapi-fragment-send-request", + "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_03_docs/full_chain_docs_intents_v2.yaml", + "runner": "agent_runtime", + "mode": "full_chain", + "passed": true, + "mismatches": [], + "actual": { + "intent": "OPENAPI_GENERATION", + "sub_intent": "OPENAPI_FRAGMENT_GENERATE", + "graph_id": "DocsQAGraph", + "conversation_mode": "START", + "rag_count": 1, + "llm_answer": "", + "answer_mode": "structured_spec", + "path_scope": [], + "doc_scope": [ + "api.send_message_endpoint" + ], + "entity_candidates": [], + "symbol_candidates": [], + "layers": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D0_DOC_CHUNKS" + ], + "filters": { + "doc_type": "api_method" + }, + "pipeline_mode": "pre_llm_only", + "gate_decision": "partial", + "prompt_used": "docs_openapi_fragment_answer", + "llm_mode": "yaml", + "degraded_reason": "fragment_payload_only", + "code_intents_stubbed": true + } + }, + "pipeline_steps": [ + { + "step": "input_query", + "input": { + "query": "Сгенерируй request schema для endpoint /send" + }, + "output": { + "query": "Сгенерируй request schema для endpoint /send" + } + }, + { + "step": "router", + "input": { + "query": "Сгенерируй request schema для endpoint /send" + }, + "output": { + "intent": "OPENAPI_GENERATION", + "sub_intent": "OPENAPI_FRAGMENT_GENERATE", + "graph_id": "DocsQAGraph", + "conversation_mode": "START" + } + }, + { + "step": "docs_pipeline", + "input": { + "query": "Сгенерируй request schema для endpoint /send" + }, + "output": { + "answer_mode": "ready_partial", + "prompt_name": "docs_openapi_fragment_answer", + "llm_request": { + "prompt_name": "docs_openapi_fragment_answer", + "log_context": "graph.project_qa.docs.openapi", + "prompt_stats": { + "system_chars": 319, + "user_chars": 2748, + "tokens_in_estimate": 767 + } + }, + "degraded_reason": "fragment_payload_only" + } + } + ] +} \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/docs_pre_llm_v3/20260326_120832/full_chain_docs_intents_v2_docs-v2-openapi-fragment-send-request.md b/tests/pipeline_setup_v3/test_results/docs_pre_llm_v3/20260326_120832/full_chain_docs_intents_v2_docs-v2-openapi-fragment-send-request.md new file mode 100644 index 0000000..11cfed0 --- /dev/null +++ b/tests/pipeline_setup_v3/test_results/docs_pre_llm_v3/20260326_120832/full_chain_docs_intents_v2_docs-v2-openapi-fragment-send-request.md @@ -0,0 +1,383 @@ +# docs-v2-openapi-fragment-send-request + +- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_03_docs/full_chain_docs_intents_v2.yaml +- runner: agent_runtime +- mode: full_chain +- passed: True + +## Query +Сгенерируй request schema для endpoint /send + +## Actual +{ + "intent": "OPENAPI_GENERATION", + "sub_intent": "OPENAPI_FRAGMENT_GENERATE", + "graph_id": "DocsQAGraph", + "conversation_mode": "START", + "rag_count": 1, + "llm_answer": "", + "answer_mode": "structured_spec", + "path_scope": [], + "doc_scope": [ + "api.send_message_endpoint" + ], + "entity_candidates": [], + "symbol_candidates": [], + "layers": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D0_DOC_CHUNKS" + ], + "filters": { + "doc_type": "api_method" + }, + "pipeline_mode": "pre_llm_only", + "gate_decision": "partial", + "prompt_used": "docs_openapi_fragment_answer", + "llm_mode": "yaml", + "degraded_reason": "fragment_payload_only", + "code_intents_stubbed": true +} + +## Pipeline Steps +### input_query +```json +{ + "input": { + "query": "Сгенерируй request schema для endpoint /send" + }, + "output": { + "query": "Сгенерируй request schema для endpoint /send" + } +} +``` + +### router +```json +{ + "input": { + "query": "Сгенерируй request schema для endpoint /send" + }, + "output": { + "intent": "OPENAPI_GENERATION", + "sub_intent": "OPENAPI_FRAGMENT_GENERATE", + "graph_id": "DocsQAGraph", + "conversation_mode": "START" + } +} +``` + +### docs_pipeline +```json +{ + "input": { + "query": "Сгенерируй request schema для endpoint /send" + }, + "output": { + "answer_mode": "ready_partial", + "prompt_name": "docs_openapi_fragment_answer", + "llm_request": { + "prompt_name": "docs_openapi_fragment_answer", + "log_context": "graph.project_qa.docs.openapi", + "prompt_stats": { + "system_chars": 319, + "user_chars": 2748, + "tokens_in_estimate": 767 + } + }, + "degraded_reason": "fragment_payload_only" + } +} +``` + +## Diagnostics +{ + "intent": "OPENAPI_GENERATION", + "sub_intent": "OPENAPI_FRAGMENT_GENERATE", + "layers_used": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D0_DOC_CHUNKS" + ], + "documents_found": 1, + "facts_found": 0, + "relations_found": 0, + "openapi_fields_extracted": 0, + "missing_required_fields": [ + "method", + "schema_fragment" + ], + "openapi_status": { + "has_path": true, + "has_method": false, + "has_request": false, + "has_response": false + }, + "prompt_used": "docs_openapi_fragment_answer", + "llm_mode": "yaml", + "output_valid": true, + "matched_intent_source": "deterministic", + "matched_anchor_type": "endpoint", + "matched_anchor_value": "/send", + "exact_anchor_match": true, + "docs_layers_requested": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D0_DOC_CHUNKS" + ], + "docs_layers_with_hits": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D0_DOC_CHUNKS" + ], + "planned_layers": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D0_DOC_CHUNKS" + ], + "executed_layers": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D0_DOC_CHUNKS" + ], + "non_empty_layers": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D0_DOC_CHUNKS" + ], + "layer_diagnostics": { + "D1_DOCUMENT_CATALOG": { + "hits": 7, + "top_ids": [ + "api.send_message_endpoint", + "api.control_actions_endpoint", + "api.health_endpoint", + "architecture.telegram_notify_app", + "docs/README.md" + ] + }, + "D2_FACT_INDEX": { + "hits": 8, + "top_ids": [ + "f85d982c272a2ee6baeadc433221a20e684cd8ef01cb4788d6f76d05ca56d6d0", + "b8e44c3adb74aaa6c91ae8815fa091289e58dd3990a3a1b63e850c62075aea75", + "bafb867ffed41c9db637df98d6cd5f6722d7747bbebc6c03e6f0d0caf3b7f9f3", + "54bbcbac242f1c85ec3280236ed5841998a8a3a548ff16cbf0b5acafbff469e3", + "b6bfad59b3bf00f199b5ef90c1208af19664de700413e7354468a93a4abaaa2f" + ] + }, + "D0_DOC_CHUNKS": { + "hits": 6, + "top_ids": [ + "api.control_actions_endpoint" + ] + } + }, + "query_entity_candidates": [], + "resolved_entity_candidates": [], + "query_anchor_candidates": [ + "/send" + ], + "resolved_anchor_candidates": [ + "api.send_message_endpoint", + "docs/documentation/api/send-message-endpoint.md" + ], + "anchor_candidates": [], + "selected_anchor": null, + "anchor_selection_reason": "", + "anchor_match_type": "", + "doc_ids": [ + "api.send_message_endpoint" + ], + "doc_paths": [ + "docs/documentation/api/send-message-endpoint.md" + ], + "doc_titles": [ + "HTTP API /send" + ], + "relation_hits_count": 0, + "relation_targets": [], + "fallback_doc_hits_count": 1, + "fallback_used": false, + "fact_hits": 0, + "entity_hits": 0, + "evidence_summary": { + "documents": 1, + "facts": 0, + "relations": 0, + "chunks": 0, + "entity_hits": 0, + "openapi_signals": { + "path_found": true, + "method_found": false, + "request_schema": false, + "response_schema": false, + "status_codes": false, + "payload_description": true + } + }, + "gate_decision": "partial", + "gate_decision_reason": "fragment_payload_only", + "gate_missing_requirements": [ + "http_method_found", + "contract_fields_found", + "status_codes_found" + ], + "gate_satisfied_requirements": [ + "retrieval_non_empty", + "exact_anchor_match", + "path_found", + "payload_description_found", + "api_method_filter" + ], + "openapi_evidence": { + "path_found": true, + "method_found": false, + "request_schema": false, + "response_schema": false, + "status_codes": false, + "payload_description": true + }, + "requested_fragment_type": "request_schema", + "fragment_evidence_found": [ + "path", + "payload_description" + ], + "fragment_missing_requirements": [], + "answer_mode": "ready_partial", + "degrade_reason": "fragment_payload_only", + "degraded_reason": "fragment_payload_only", + "code_intents_stubbed": false +} + +## LLM Request +- prompt_name: docs_openapi_fragment_answer +- log_context: graph.project_qa.docs.openapi + +### Prompt Stats +```json +{ + "system_chars": 319, + "user_chars": 2748, + "tokens_in_estimate": 767 +} +``` + +### System Prompt +```text +Ты генерируешь часть OpenAPI schema по документации API. + +На вход приходит JSON с полями: +- question +- intent +- sub_intent +- documents +- facts +- relations +- api_contract + +Правила: +- Только schema +- Без полного OpenAPI документа +- Используй только данные из payload +- Не придумывай поля +- Верни ТОЛЬКО YAML без пояснений +``` + +### User Prompt +```json +{ + "question": "Сгенерируй request schema для endpoint /send", + "intent": "OPENAPI_GENERATION", + "sub_intent": "OPENAPI_FRAGMENT_GENERATE", + "documents": [ + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/api/send-message-endpoint.md", + "title": "HTTP API /send", + "content": "Endpoint `/send` выполняет ручную отправку сообщения в Telegram через `TelegramSendService`. Он используется для операторской проверки доставки и для отправки уведомлений вне периодического worker loop. Endpoint работает поверх тех же credentials и того же delivery path, что и фоновая отправка.", + "metadata": { + "name": "send_message_endpoint", + "tags": [ + "api", + "telegram", + "manual-send" + ], + "type": "api_method", + "layer": "application", + "links": [ + { + "type": "part_of", + "target": "architecture.telegram_notify_app" + }, + { + "type": "depends_on", + "target": "logic.telegram_notification_loop" + } + ], + "owner": null, + "title": "HTTP API /send", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "architecture.telegram_notify_app", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "5fbf2e33510b0676a3a53b957a4569bd3c2c31fb7719546602c573421ccaa32d", + "children": [], + "doc_kind": "misc", + "entities": [ + "TelegramControlAppFactory", + "TelegramSendService", + "TelegramNotifyWorker" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "api.send_message_endpoint", + "source_path": "docs/documentation/api/send-message-endpoint.md", + "summary_text": "Endpoint `/send` выполняет ручную отправку сообщения в Telegram через `TelegramSendService`. Он используется для операторской проверки доставки и для отправки уведомлений вне периодического worker loop. Endpoint работает поверх тех же credentials и того же delivery path, что и фоновая отправка.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + } + ], + "facts": [], + "relations": [], + "api_contract": { + "path": "/send", + "method": "", + "request_schema": null, + "response_schema": null, + "diagnostics": { + "has_path": true, + "has_method": false, + "has_request": false, + "has_response": false, + "status_codes_found": false, + "payload_description_found": true, + "missing_required_fields": [ + "method", + "schema_fragment" + ] + } + } +} +``` + +### User Prompt Overview +- question: Сгенерируй request schema для endpoint /send +- intent: OPENAPI_GENERATION +- sub_intent: OPENAPI_FRAGMENT_GENERATE +- documents: 1 | samples: HTTP API /send +- facts: 0 +- relations: 0 +- api_contract: + path: /send + method: — + has_request_schema: False + has_response_schema: False + +## Mismatches +- none \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/docs_pre_llm_v3/20260326_120832/full_chain_docs_intents_v2_docs-v2-openapi-health.json b/tests/pipeline_setup_v3/test_results/docs_pre_llm_v3/20260326_120832/full_chain_docs_intents_v2_docs-v2-openapi-health.json new file mode 100644 index 0000000..215c1bb --- /dev/null +++ b/tests/pipeline_setup_v3/test_results/docs_pre_llm_v3/20260326_120832/full_chain_docs_intents_v2_docs-v2-openapi-health.json @@ -0,0 +1,84 @@ +{ + "meta": { + "case_id": "docs-v2-openapi-health", + "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_03_docs/full_chain_docs_intents_v2.yaml", + "runner": "agent_runtime", + "mode": "full_chain", + "passed": true, + "mismatches": [], + "actual": { + "intent": "OPENAPI_GENERATION", + "sub_intent": "OPENAPI_METHOD_GENERATE", + "graph_id": "DocsQAGraph", + "conversation_mode": "START", + "rag_count": 1, + "llm_answer": "", + "answer_mode": "structured_spec", + "path_scope": [], + "doc_scope": [ + "api.health_endpoint" + ], + "entity_candidates": [ + "OpenAPI" + ], + "symbol_candidates": [], + "layers": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D0_DOC_CHUNKS" + ], + "filters": { + "doc_type": "api_method" + }, + "pipeline_mode": "pre_llm_only", + "gate_decision": "partial", + "prompt_used": "docs_openapi_answer", + "llm_mode": "yaml", + "degraded_reason": "answered_with_gaps", + "code_intents_stubbed": true + } + }, + "pipeline_steps": [ + { + "step": "input_query", + "input": { + "query": "Сгенерируй OpenAPI для endpoint /health по документации" + }, + "output": { + "query": "Сгенерируй OpenAPI для endpoint /health по документации" + } + }, + { + "step": "router", + "input": { + "query": "Сгенерируй OpenAPI для endpoint /health по документации" + }, + "output": { + "intent": "OPENAPI_GENERATION", + "sub_intent": "OPENAPI_METHOD_GENERATE", + "graph_id": "DocsQAGraph", + "conversation_mode": "START" + } + }, + { + "step": "docs_pipeline", + "input": { + "query": "Сгенерируй OpenAPI для endpoint /health по документации" + }, + "output": { + "answer_mode": "ready_partial", + "prompt_name": "docs_openapi_answer", + "llm_request": { + "prompt_name": "docs_openapi_answer", + "log_context": "graph.project_qa.docs.openapi", + "prompt_stats": { + "system_chars": 399, + "user_chars": 2733, + "tokens_in_estimate": 783 + } + }, + "degraded_reason": "answered_with_gaps" + } + } + ] +} \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/docs_pre_llm_v3/20260326_120832/full_chain_docs_intents_v2_docs-v2-openapi-health.md b/tests/pipeline_setup_v3/test_results/docs_pre_llm_v3/20260326_120832/full_chain_docs_intents_v2_docs-v2-openapi-health.md new file mode 100644 index 0000000..82731e1 --- /dev/null +++ b/tests/pipeline_setup_v3/test_results/docs_pre_llm_v3/20260326_120832/full_chain_docs_intents_v2_docs-v2-openapi-health.md @@ -0,0 +1,395 @@ +# docs-v2-openapi-health + +- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_03_docs/full_chain_docs_intents_v2.yaml +- runner: agent_runtime +- mode: full_chain +- passed: True + +## Query +Сгенерируй OpenAPI для endpoint /health по документации + +## Actual +{ + "intent": "OPENAPI_GENERATION", + "sub_intent": "OPENAPI_METHOD_GENERATE", + "graph_id": "DocsQAGraph", + "conversation_mode": "START", + "rag_count": 1, + "llm_answer": "", + "answer_mode": "structured_spec", + "path_scope": [], + "doc_scope": [ + "api.health_endpoint" + ], + "entity_candidates": [ + "OpenAPI" + ], + "symbol_candidates": [], + "layers": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D0_DOC_CHUNKS" + ], + "filters": { + "doc_type": "api_method" + }, + "pipeline_mode": "pre_llm_only", + "gate_decision": "partial", + "prompt_used": "docs_openapi_answer", + "llm_mode": "yaml", + "degraded_reason": "answered_with_gaps", + "code_intents_stubbed": true +} + +## Pipeline Steps +### input_query +```json +{ + "input": { + "query": "Сгенерируй OpenAPI для endpoint /health по документации" + }, + "output": { + "query": "Сгенерируй OpenAPI для endpoint /health по документации" + } +} +``` + +### router +```json +{ + "input": { + "query": "Сгенерируй OpenAPI для endpoint /health по документации" + }, + "output": { + "intent": "OPENAPI_GENERATION", + "sub_intent": "OPENAPI_METHOD_GENERATE", + "graph_id": "DocsQAGraph", + "conversation_mode": "START" + } +} +``` + +### docs_pipeline +```json +{ + "input": { + "query": "Сгенерируй OpenAPI для endpoint /health по документации" + }, + "output": { + "answer_mode": "ready_partial", + "prompt_name": "docs_openapi_answer", + "llm_request": { + "prompt_name": "docs_openapi_answer", + "log_context": "graph.project_qa.docs.openapi", + "prompt_stats": { + "system_chars": 399, + "user_chars": 2733, + "tokens_in_estimate": 783 + } + }, + "degraded_reason": "answered_with_gaps" + } +} +``` + +## Diagnostics +{ + "intent": "OPENAPI_GENERATION", + "sub_intent": "OPENAPI_METHOD_GENERATE", + "layers_used": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D0_DOC_CHUNKS" + ], + "documents_found": 1, + "facts_found": 0, + "relations_found": 0, + "openapi_fields_extracted": 0, + "missing_required_fields": [ + "method", + "request_schema", + "response_schema" + ], + "openapi_status": { + "has_path": true, + "has_method": false, + "has_request": false, + "has_response": false + }, + "prompt_used": "docs_openapi_answer", + "llm_mode": "yaml", + "output_valid": true, + "matched_intent_source": "deterministic", + "matched_anchor_type": "endpoint", + "matched_anchor_value": "/health", + "exact_anchor_match": true, + "docs_layers_requested": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D0_DOC_CHUNKS" + ], + "docs_layers_with_hits": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D0_DOC_CHUNKS" + ], + "planned_layers": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D0_DOC_CHUNKS" + ], + "executed_layers": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D0_DOC_CHUNKS" + ], + "non_empty_layers": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D0_DOC_CHUNKS" + ], + "layer_diagnostics": { + "D1_DOCUMENT_CATALOG": { + "hits": 7, + "top_ids": [ + "api.send_message_endpoint", + "api.control_actions_endpoint", + "api.health_endpoint", + "domain.runtime_health", + "architecture.telegram_notify_app" + ] + }, + "D2_FACT_INDEX": { + "hits": 8, + "top_ids": [ + "f85d982c272a2ee6baeadc433221a20e684cd8ef01cb4788d6f76d05ca56d6d0", + "b8e44c3adb74aaa6c91ae8815fa091289e58dd3990a3a1b63e850c62075aea75", + "b6bfad59b3bf00f199b5ef90c1208af19664de700413e7354468a93a4abaaa2f", + "a8a325e0815b3a2a870ba2825f3afb3f41056b4c091df4c3bb3418ffd20891dd", + "bafb867ffed41c9db637df98d6cd5f6722d7747bbebc6c03e6f0d0caf3b7f9f3" + ] + }, + "D0_DOC_CHUNKS": { + "hits": 6, + "top_ids": [ + "api.control_actions_endpoint" + ] + } + }, + "query_entity_candidates": [ + "OpenAPI" + ], + "resolved_entity_candidates": [], + "query_anchor_candidates": [ + "/health", + "OpenAPI" + ], + "resolved_anchor_candidates": [ + "api.health_endpoint", + "docs/documentation/api/health-endpoint.md" + ], + "anchor_candidates": [], + "selected_anchor": null, + "anchor_selection_reason": "", + "anchor_match_type": "", + "doc_ids": [ + "api.health_endpoint" + ], + "doc_paths": [ + "docs/documentation/api/health-endpoint.md" + ], + "doc_titles": [ + "HTTP API /health" + ], + "relation_hits_count": 0, + "relation_targets": [], + "fallback_doc_hits_count": 1, + "fallback_used": false, + "fact_hits": 0, + "entity_hits": 0, + "evidence_summary": { + "documents": 1, + "facts": 0, + "relations": 0, + "chunks": 0, + "entity_hits": 0, + "openapi_signals": { + "path_found": true, + "method_found": false, + "request_schema": false, + "response_schema": false, + "status_codes": true, + "payload_description": true + } + }, + "gate_decision": "partial", + "gate_decision_reason": "answered_with_gaps", + "gate_missing_requirements": [ + "http_method_found", + "contract_fields_found" + ], + "gate_satisfied_requirements": [ + "retrieval_non_empty", + "exact_anchor_match", + "path_found", + "status_codes_found", + "payload_description_found", + "api_method_filter" + ], + "openapi_evidence": { + "path_found": true, + "method_found": false, + "request_schema": false, + "response_schema": false, + "status_codes": true, + "payload_description": true + }, + "requested_fragment_type": null, + "fragment_evidence_found": [], + "fragment_missing_requirements": [], + "answer_mode": "ready_partial", + "degrade_reason": "answered_with_gaps", + "degraded_reason": "answered_with_gaps", + "code_intents_stubbed": false +} + +## LLM Request +- prompt_name: docs_openapi_answer +- log_context: graph.project_qa.docs.openapi + +### Prompt Stats +```json +{ + "system_chars": 399, + "user_chars": 2733, + "tokens_in_estimate": 783 +} +``` + +### System Prompt +```text +Ты генерируешь OpenAPI спецификацию по документации API. + +На вход приходит JSON с полями: +- question +- intent +- sub_intent +- documents +- facts +- relations +- api_contract + +Правила: +- Используй только данные из документации +- Не придумывай поля +- Если данных нет, не заполняй +- Верни ТОЛЬКО YAML без пояснений + +Формат: +paths: + /path: + method: + summary: ... + requestBody: + responses: +``` + +### User Prompt +```json +{ + "question": "Сгенерируй OpenAPI для endpoint /health по документации", + "intent": "OPENAPI_GENERATION", + "sub_intent": "OPENAPI_METHOD_GENERATE", + "documents": [ + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/api/health-endpoint.md", + "title": "HTTP API /health", + "content": "Endpoint `/health` возвращает агрегированный health payload runtime. Если общий статус равен `ok`, API отвечает с HTTP 200; для состояний деградации или неготовности возвращается HTTP 503 с тем же payload. Endpoint служит основной точкой внешней проверки состояния приложения.", + "metadata": { + "name": "health_endpoint", + "tags": [ + "api", + "health", + "control-plane" + ], + "type": "api_method", + "layer": "application", + "links": [ + { + "type": "part_of", + "target": "architecture.telegram_notify_app" + }, + { + "type": "depends_on", + "target": "domain.runtime_health" + } + ], + "owner": null, + "title": "HTTP API /health", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "architecture.telegram_notify_app", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "8b5a533a8076e2e9d36995eee29aeade260080bdca2ec8e21fe28f08574b983f", + "children": [], + "doc_kind": "misc", + "entities": [ + "TelegramControlChannel", + "TelegramNotifyWorker", + "RuntimeManager", + "WorkerHealth" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "api.health_endpoint", + "source_path": "docs/documentation/api/health-endpoint.md", + "summary_text": "Endpoint `/health` возвращает агрегированный health payload runtime. Если общий статус равен `ok`, API отвечает с HTTP 200; для состояний деградации или неготовности возвращается HTTP 503 с тем же payload. Endpoint служит основной точкой внешней проверки состояния приложения.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + } + ], + "facts": [], + "relations": [], + "api_contract": { + "path": "/health", + "method": "", + "request_schema": null, + "response_schema": null, + "diagnostics": { + "has_path": true, + "has_method": false, + "has_request": false, + "has_response": false, + "status_codes_found": true, + "payload_description_found": true, + "missing_required_fields": [ + "method", + "request_schema", + "response_schema" + ] + } + } +} +``` + +### User Prompt Overview +- question: Сгенерируй OpenAPI для endpoint /health по документации +- intent: OPENAPI_GENERATION +- sub_intent: OPENAPI_METHOD_GENERATE +- documents: 1 | samples: HTTP API /health +- facts: 0 +- relations: 0 +- api_contract: + path: /health + method: — + has_request_schema: False + has_response_schema: False + +## Mismatches +- none \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/docs_pre_llm_v3/20260326_120832/full_chain_docs_intents_v2_docs-v2-related-docs-architecture-overview.json b/tests/pipeline_setup_v3/test_results/docs_pre_llm_v3/20260326_120832/full_chain_docs_intents_v2_docs-v2-related-docs-architecture-overview.json new file mode 100644 index 0000000..0211259 --- /dev/null +++ b/tests/pipeline_setup_v3/test_results/docs_pre_llm_v3/20260326_120832/full_chain_docs_intents_v2_docs-v2-related-docs-architecture-overview.json @@ -0,0 +1,83 @@ +{ + "meta": { + "case_id": "docs-v2-related-docs-architecture-overview", + "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_03_docs/full_chain_docs_intents_v2.yaml", + "runner": "agent_runtime", + "mode": "full_chain", + "passed": true, + "mismatches": [], + "actual": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "RELATED_DOCS_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START", + "rag_count": 5, + "llm_answer": "", + "answer_mode": "answered", + "path_scope": [], + "doc_scope": [ + "architecture.telegram_notify_app_overview", + "architecture.telegram_notify_app" + ], + "entity_candidates": [], + "symbol_candidates": [], + "layers": [ + "D5_RELATION_GRAPH", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "filters": { + "doc_type": null + }, + "pipeline_mode": "pre_llm_only", + "gate_decision": "allow", + "prompt_used": "docs_explain_answer", + "llm_mode": "graph_summary", + "degraded_reason": null, + "code_intents_stubbed": true + } + }, + "pipeline_steps": [ + { + "step": "input_query", + "input": { + "query": "Какие дочерние документы есть у overview архитектуры сервиса?" + }, + "output": { + "query": "Какие дочерние документы есть у overview архитектуры сервиса?" + } + }, + { + "step": "router", + "input": { + "query": "Какие дочерние документы есть у overview архитектуры сервиса?" + }, + "output": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "RELATED_DOCS_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START" + } + }, + { + "step": "docs_pipeline", + "input": { + "query": "Какие дочерние документы есть у overview архитектуры сервиса?" + }, + "output": { + "answer_mode": "ready", + "prompt_name": "docs_explain_answer", + "llm_request": { + "prompt_name": "docs_explain_answer", + "log_context": "graph.project_qa.docs.answer", + "prompt_stats": { + "system_chars": 393, + "user_chars": 3236, + "tokens_in_estimate": 908 + } + }, + "degraded_reason": "" + } + } + ] +} \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/docs_pre_llm_v3/20260326_120832/full_chain_docs_intents_v2_docs-v2-related-docs-architecture-overview.md b/tests/pipeline_setup_v3/test_results/docs_pre_llm_v3/20260326_120832/full_chain_docs_intents_v2_docs-v2-related-docs-architecture-overview.md new file mode 100644 index 0000000..4825cc7 --- /dev/null +++ b/tests/pipeline_setup_v3/test_results/docs_pre_llm_v3/20260326_120832/full_chain_docs_intents_v2_docs-v2-related-docs-architecture-overview.md @@ -0,0 +1,372 @@ +# docs-v2-related-docs-architecture-overview + +- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_03_docs/full_chain_docs_intents_v2.yaml +- runner: agent_runtime +- mode: full_chain +- passed: True + +## Query +Какие дочерние документы есть у overview архитектуры сервиса? + +## Actual +{ + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "RELATED_DOCS_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START", + "rag_count": 5, + "llm_answer": "", + "answer_mode": "answered", + "path_scope": [], + "doc_scope": [ + "architecture.telegram_notify_app_overview", + "architecture.telegram_notify_app" + ], + "entity_candidates": [], + "symbol_candidates": [], + "layers": [ + "D5_RELATION_GRAPH", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "filters": { + "doc_type": null + }, + "pipeline_mode": "pre_llm_only", + "gate_decision": "allow", + "prompt_used": "docs_explain_answer", + "llm_mode": "graph_summary", + "degraded_reason": null, + "code_intents_stubbed": true +} + +## Pipeline Steps +### input_query +```json +{ + "input": { + "query": "Какие дочерние документы есть у overview архитектуры сервиса?" + }, + "output": { + "query": "Какие дочерние документы есть у overview архитектуры сервиса?" + } +} +``` + +### router +```json +{ + "input": { + "query": "Какие дочерние документы есть у overview архитектуры сервиса?" + }, + "output": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "RELATED_DOCS_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START" + } +} +``` + +### docs_pipeline +```json +{ + "input": { + "query": "Какие дочерние документы есть у overview архитектуры сервиса?" + }, + "output": { + "answer_mode": "ready", + "prompt_name": "docs_explain_answer", + "llm_request": { + "prompt_name": "docs_explain_answer", + "log_context": "graph.project_qa.docs.answer", + "prompt_stats": { + "system_chars": 393, + "user_chars": 3236, + "tokens_in_estimate": 908 + } + }, + "degraded_reason": "" + } +} +``` + +## Diagnostics +{ + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "RELATED_DOCS_EXPLAIN", + "layers_used": [ + "D5_RELATION_GRAPH", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "documents_found": 0, + "facts_found": 0, + "relations_found": 3, + "openapi_fields_extracted": 0, + "missing_required_fields": [], + "openapi_status": { + "has_path": false, + "has_method": false, + "has_request": false, + "has_response": false + }, + "prompt_used": "docs_explain_answer", + "llm_mode": "graph_summary", + "output_valid": true, + "matched_intent_source": "deterministic", + "matched_anchor_type": "workflow", + "matched_anchor_value": "архитектуры", + "exact_anchor_match": false, + "docs_layers_requested": [ + "D5_RELATION_GRAPH", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "docs_layers_with_hits": [ + "D5_RELATION_GRAPH" + ], + "planned_layers": [ + "D5_RELATION_GRAPH", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "executed_layers": [ + "D5_RELATION_GRAPH" + ], + "non_empty_layers": [ + "D5_RELATION_GRAPH" + ], + "layer_diagnostics": { + "D5_RELATION_GRAPH": { + "hits": 8, + "top_ids": [ + "305bab0c6567d93a2b453a9d70b676f9ecd8de083ef36f5cf3398747c25ebf94", + "7bd0428d23e9b20f7d65202cc269e45b3d1e7aed7b5df4a35581fd88677be29b", + "0eb7f73fcda8556439e06f5eeb5ce064ae32b6cd3129353f5b1b4eb3db626d88", + "ae34fe4b3cd2b47632b13b1e32303e842b57948aa21160abe8d9b478995e1d74", + "145ccbb861a8fb621286ec9c888ce69677168d35c7871c70537e888ce3a5b910" + ] + }, + "D1_DOCUMENT_CATALOG": { + "hits": 0, + "top_ids": [], + "skipped": true, + "reason": "relation_primary_sufficient" + }, + "D0_DOC_CHUNKS": { + "hits": 2, + "top_ids": [ + "architecture.telegram_notify_app" + ] + } + }, + "query_entity_candidates": [], + "resolved_entity_candidates": [], + "query_anchor_candidates": [], + "resolved_anchor_candidates": [ + "docs/documentation/architecture/telegram-notify-app-overview.md", + "architecture.telegram_notify_app" + ], + "anchor_candidates": [ + "architecture.telegram_notify_app_overview", + "architecture.telegram_notify_app" + ], + "selected_anchor": "architecture.telegram_notify_app_overview", + "anchor_selection_reason": "relation_neighbor", + "anchor_match_type": "semantic_fallback", + "doc_ids": [ + "architecture.telegram_notify_app_overview", + "architecture.telegram_notify_app" + ], + "doc_paths": [ + "docs/documentation/architecture/telegram-notify-app-overview.md" + ], + "doc_titles": [ + "architecture.telegram_notify_app:child", + "architecture.telegram_notify_app:related_api", + "architecture.telegram_notify_app:parent", + "architecture.telegram_notify_app:Summary", + "architecture.telegram_notify_app:Details" + ], + "relation_hits_count": 3, + "relation_targets": [ + "architecture.telegram_notify_app:child", + "architecture.telegram_notify_app:related_api", + "architecture.telegram_notify_app:parent" + ], + "fallback_doc_hits_count": 2, + "fallback_used": true, + "fact_hits": 0, + "entity_hits": 0, + "evidence_summary": { + "documents": 0, + "facts": 0, + "relations": 3, + "chunks": 2, + "entity_hits": 0, + "openapi_signals": { + "path_found": false, + "method_found": false, + "request_schema": false, + "response_schema": false, + "status_codes": false, + "payload_description": false + } + }, + "gate_decision": "allow", + "gate_decision_reason": "relation_evidence_available", + "gate_missing_requirements": [], + "gate_satisfied_requirements": [ + "retrieval_non_empty" + ], + "openapi_evidence": { + "path_found": false, + "method_found": false, + "request_schema": false, + "response_schema": false, + "status_codes": false, + "payload_description": false + }, + "requested_fragment_type": null, + "fragment_evidence_found": [], + "fragment_missing_requirements": [], + "answer_mode": "ready", + "degrade_reason": null, + "degraded_reason": null, + "code_intents_stubbed": false +} + +## LLM Request +- prompt_name: docs_explain_answer +- log_context: graph.project_qa.docs.answer + +### Prompt Stats +```json +{ + "system_chars": 393, + "user_chars": 3236, + "tokens_in_estimate": 908 +} +``` + +### System Prompt +```text +Ты объясняешь документацию системы. + +На вход приходит JSON с полями: +- question +- intent +- sub_intent +- documents +- facts +- relations + +Правила: +- Используй только предоставленные факты +- Не додумывай +- Если данных недостаточно, скажи это явно +- Объясняй структурировано + +Формат ответа: +1. Краткое описание +2. Основные элементы +3. Как это работает +4. Связи с другими частями системы (если есть) +``` + +### User Prompt +```json +{ + "question": "Какие дочерние документы есть у overview архитектуры сервиса?", + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "RELATED_DOCS_EXPLAIN", + "documents": [], + "facts": [], + "relations": [ + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/architecture/telegram-notify-app-overview.md", + "title": "architecture.telegram_notify_app:child", + "content": "architecture.telegram_notify_app child api.send_message_endpoint", + "metadata": { + "owner": null, + "anchor": "frontmatter.children", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "8b1cc9f823e55bddbc825466d10a0fdb4ca4354ac02d91f9e2aef7b7d2ec8256", + "source_id": "architecture.telegram_notify_app", + "target_id": "api.send_message_endpoint", + "doc_version": null, + "relation_id": "305bab0c6567d93a2b453a9d70b676f9ecd8de083ef36f5cf3398747c25ebf94", + "source_path": "docs/documentation/architecture/telegram-notify-app-overview.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "child", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/architecture/telegram-notify-app-overview.md", + "title": "architecture.telegram_notify_app:related_api", + "content": "architecture.telegram_notify_app related_api api.health_endpoint", + "metadata": { + "owner": null, + "anchor": "frontmatter.links", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "8b1cc9f823e55bddbc825466d10a0fdb4ca4354ac02d91f9e2aef7b7d2ec8256", + "source_id": "architecture.telegram_notify_app", + "target_id": "api.health_endpoint", + "doc_version": null, + "relation_id": "7bd0428d23e9b20f7d65202cc269e45b3d1e7aed7b5df4a35581fd88677be29b", + "source_path": "docs/documentation/architecture/telegram-notify-app-overview.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "related_api", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/architecture/telegram-notify-app-overview.md", + "title": "architecture.telegram_notify_app:parent", + "content": "architecture.telegram_notify_app parent docs_root", + "metadata": { + "owner": null, + "anchor": "frontmatter.parent", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "8b1cc9f823e55bddbc825466d10a0fdb4ca4354ac02d91f9e2aef7b7d2ec8256", + "source_id": "architecture.telegram_notify_app", + "target_id": "docs_root", + "doc_version": null, + "relation_id": "e01922b36e3cc60d9349f89e43fcd4a92c6a01394b0028d6b6d56801b258645d", + "source_path": "docs/documentation/architecture/telegram-notify-app-overview.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "parent", + "staleness_score": null, + "system_component": null + } + } + ] +} +``` + +### User Prompt Overview +- question: Какие дочерние документы есть у overview архитектуры сервиса? +- intent: DOCUMENTATION_EXPLAIN +- sub_intent: RELATED_DOCS_EXPLAIN +- documents: 0 +- facts: 0 +- relations: 3 | samples: architecture.telegram_notify_app:child, architecture.telegram_notify_app:related_api, architecture.telegram_notify_app:parent + +## Mismatches +- none \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/docs_pre_llm_v3/20260326_120832/full_chain_docs_intents_v2_docs-v2-related-docs-health.json b/tests/pipeline_setup_v3/test_results/docs_pre_llm_v3/20260326_120832/full_chain_docs_intents_v2_docs-v2-related-docs-health.json new file mode 100644 index 0000000..a52804b --- /dev/null +++ b/tests/pipeline_setup_v3/test_results/docs_pre_llm_v3/20260326_120832/full_chain_docs_intents_v2_docs-v2-related-docs-health.json @@ -0,0 +1,84 @@ +{ + "meta": { + "case_id": "docs-v2-related-docs-health", + "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_03_docs/full_chain_docs_intents_v2.yaml", + "runner": "agent_runtime", + "mode": "full_chain", + "passed": true, + "mismatches": [], + "actual": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "RELATED_DOCS_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START", + "rag_count": 14, + "llm_answer": "", + "answer_mode": "answered", + "path_scope": [], + "doc_scope": [ + "api.health_endpoint", + "api.control_actions_endpoint", + "api.send_message_endpoint" + ], + "entity_candidates": [], + "symbol_candidates": [], + "layers": [ + "D5_RELATION_GRAPH", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "filters": { + "doc_type": null + }, + "pipeline_mode": "pre_llm_only", + "gate_decision": "allow", + "prompt_used": "docs_explain_answer", + "llm_mode": "graph_summary", + "degraded_reason": null, + "code_intents_stubbed": true + } + }, + "pipeline_steps": [ + { + "step": "input_query", + "input": { + "query": "Какие документы связаны с endpoint /health?" + }, + "output": { + "query": "Какие документы связаны с endpoint /health?" + } + }, + { + "step": "router", + "input": { + "query": "Какие документы связаны с endpoint /health?" + }, + "output": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "RELATED_DOCS_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START" + } + }, + { + "step": "docs_pipeline", + "input": { + "query": "Какие документы связаны с endpoint /health?" + }, + "output": { + "answer_mode": "ready", + "prompt_name": "docs_explain_answer", + "llm_request": { + "prompt_name": "docs_explain_answer", + "log_context": "graph.project_qa.docs.answer", + "prompt_stats": { + "system_chars": 393, + "user_chars": 7998, + "tokens_in_estimate": 2098 + } + }, + "degraded_reason": "" + } + } + ] +} \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/docs_pre_llm_v3/20260326_120832/full_chain_docs_intents_v2_docs-v2-related-docs-health.md b/tests/pipeline_setup_v3/test_results/docs_pre_llm_v3/20260326_120832/full_chain_docs_intents_v2_docs-v2-related-docs-health.md new file mode 100644 index 0000000..c35043e --- /dev/null +++ b/tests/pipeline_setup_v3/test_results/docs_pre_llm_v3/20260326_120832/full_chain_docs_intents_v2_docs-v2-related-docs-health.md @@ -0,0 +1,516 @@ +# docs-v2-related-docs-health + +- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_03_docs/full_chain_docs_intents_v2.yaml +- runner: agent_runtime +- mode: full_chain +- passed: True + +## Query +Какие документы связаны с endpoint /health? + +## Actual +{ + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "RELATED_DOCS_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START", + "rag_count": 14, + "llm_answer": "", + "answer_mode": "answered", + "path_scope": [], + "doc_scope": [ + "api.health_endpoint", + "api.control_actions_endpoint", + "api.send_message_endpoint" + ], + "entity_candidates": [], + "symbol_candidates": [], + "layers": [ + "D5_RELATION_GRAPH", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "filters": { + "doc_type": null + }, + "pipeline_mode": "pre_llm_only", + "gate_decision": "allow", + "prompt_used": "docs_explain_answer", + "llm_mode": "graph_summary", + "degraded_reason": null, + "code_intents_stubbed": true +} + +## Pipeline Steps +### input_query +```json +{ + "input": { + "query": "Какие документы связаны с endpoint /health?" + }, + "output": { + "query": "Какие документы связаны с endpoint /health?" + } +} +``` + +### router +```json +{ + "input": { + "query": "Какие документы связаны с endpoint /health?" + }, + "output": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "RELATED_DOCS_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START" + } +} +``` + +### docs_pipeline +```json +{ + "input": { + "query": "Какие документы связаны с endpoint /health?" + }, + "output": { + "answer_mode": "ready", + "prompt_name": "docs_explain_answer", + "llm_request": { + "prompt_name": "docs_explain_answer", + "log_context": "graph.project_qa.docs.answer", + "prompt_stats": { + "system_chars": 393, + "user_chars": 7998, + "tokens_in_estimate": 2098 + } + }, + "degraded_reason": "" + } +} +``` + +## Diagnostics +{ + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "RELATED_DOCS_EXPLAIN", + "layers_used": [ + "D5_RELATION_GRAPH", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "documents_found": 0, + "facts_found": 0, + "relations_found": 8, + "openapi_fields_extracted": 0, + "missing_required_fields": [], + "openapi_status": { + "has_path": false, + "has_method": false, + "has_request": false, + "has_response": false + }, + "prompt_used": "docs_explain_answer", + "llm_mode": "graph_summary", + "output_valid": true, + "matched_intent_source": "deterministic", + "matched_anchor_type": "endpoint", + "matched_anchor_value": "/health", + "exact_anchor_match": false, + "docs_layers_requested": [ + "D5_RELATION_GRAPH", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "docs_layers_with_hits": [ + "D5_RELATION_GRAPH" + ], + "planned_layers": [ + "D5_RELATION_GRAPH", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "executed_layers": [ + "D5_RELATION_GRAPH" + ], + "non_empty_layers": [ + "D5_RELATION_GRAPH" + ], + "layer_diagnostics": { + "D5_RELATION_GRAPH": { + "hits": 8, + "top_ids": [ + "5f4909bde905cd3d294ad307074a05e4ae4deefcafe6272cd2d0436e73acb8dd", + "711fb2edb82dd222deaba3c91768b18cbbd453009235823282813c6e867dc2c1", + "eec79f7a02b804337e791ef231784862ae26e0599eb20224790e9d4f085fa9c0", + "c718b1939621233295ccaf6e8203e7fd94f3dd1bfb88f10c51bc5e33d53a24aa", + "616f5cbf25da83cb51d8d0741a7fc351620c9ca2c6513fa2094b4aa476f0912a" + ] + }, + "D1_DOCUMENT_CATALOG": { + "hits": 0, + "top_ids": [], + "skipped": true, + "reason": "relation_primary_sufficient" + }, + "D0_DOC_CHUNKS": { + "hits": 6, + "top_ids": [ + "api.control_actions_endpoint" + ] + } + }, + "query_entity_candidates": [], + "resolved_entity_candidates": [], + "query_anchor_candidates": [ + "/health" + ], + "resolved_anchor_candidates": [ + "docs/documentation/api/control-actions-endpoint.md", + "docs/documentation/api/health-endpoint.md", + "docs/documentation/api/send-message-endpoint.md", + "api.control_actions_endpoint" + ], + "anchor_candidates": [ + "api.health_endpoint", + "api.control_actions_endpoint", + "api.send_message_endpoint" + ], + "selected_anchor": "api.health_endpoint", + "anchor_selection_reason": "doc_id matches requested endpoint slug", + "anchor_match_type": "exact_path", + "doc_ids": [ + "api.health_endpoint", + "api.control_actions_endpoint", + "api.send_message_endpoint" + ], + "doc_paths": [ + "docs/documentation/api/control-actions-endpoint.md", + "docs/documentation/api/health-endpoint.md", + "docs/documentation/api/send-message-endpoint.md" + ], + "doc_titles": [ + "api.control_actions_endpoint:part_of", + "api.control_actions_endpoint:related_api", + "api.control_actions_endpoint:related_logic", + "api.health_endpoint:parent", + "api.health_endpoint:part_of", + "api.health_endpoint:depends_on", + "api.send_message_endpoint:parent", + "api.control_actions_endpoint:parent", + "api.control_actions_endpoint:Summary", + "api.control_actions_endpoint:Описание", + "api.control_actions_endpoint:Сценарий", + "api.control_actions_endpoint:Функциональные требования", + "api.control_actions_endpoint:Нефункциональные требования", + "api.control_actions_endpoint:Входные параметры" + ], + "relation_hits_count": 8, + "relation_targets": [ + "api.control_actions_endpoint:part_of", + "api.control_actions_endpoint:related_api", + "api.control_actions_endpoint:related_logic", + "api.health_endpoint:parent", + "api.health_endpoint:part_of", + "api.health_endpoint:depends_on", + "api.send_message_endpoint:parent", + "api.control_actions_endpoint:parent" + ], + "fallback_doc_hits_count": 6, + "fallback_used": true, + "fact_hits": 0, + "entity_hits": 0, + "evidence_summary": { + "documents": 0, + "facts": 0, + "relations": 8, + "chunks": 6, + "entity_hits": 0, + "openapi_signals": { + "path_found": false, + "method_found": false, + "request_schema": false, + "response_schema": false, + "status_codes": false, + "payload_description": false + } + }, + "gate_decision": "allow", + "gate_decision_reason": "relation_evidence_available", + "gate_missing_requirements": [], + "gate_satisfied_requirements": [ + "retrieval_non_empty", + "exact_anchor_match" + ], + "openapi_evidence": { + "path_found": false, + "method_found": false, + "request_schema": false, + "response_schema": false, + "status_codes": false, + "payload_description": false + }, + "requested_fragment_type": null, + "fragment_evidence_found": [], + "fragment_missing_requirements": [], + "answer_mode": "ready", + "degrade_reason": null, + "degraded_reason": null, + "code_intents_stubbed": false +} + +## LLM Request +- prompt_name: docs_explain_answer +- log_context: graph.project_qa.docs.answer + +### Prompt Stats +```json +{ + "system_chars": 393, + "user_chars": 7998, + "tokens_in_estimate": 2098 +} +``` + +### System Prompt +```text +Ты объясняешь документацию системы. + +На вход приходит JSON с полями: +- question +- intent +- sub_intent +- documents +- facts +- relations + +Правила: +- Используй только предоставленные факты +- Не додумывай +- Если данных недостаточно, скажи это явно +- Объясняй структурировано + +Формат ответа: +1. Краткое описание +2. Основные элементы +3. Как это работает +4. Связи с другими частями системы (если есть) +``` + +### User Prompt +```json +{ + "question": "Какие документы связаны с endpoint /health?", + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "RELATED_DOCS_EXPLAIN", + "documents": [], + "facts": [], + "relations": [ + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "api.control_actions_endpoint:part_of", + "content": "api.control_actions_endpoint part_of architecture.telegram_notify_app", + "metadata": { + "owner": null, + "anchor": "frontmatter.links", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "source_id": "api.control_actions_endpoint", + "target_id": "architecture.telegram_notify_app", + "doc_version": null, + "relation_id": "5f4909bde905cd3d294ad307074a05e4ae4deefcafe6272cd2d0436e73acb8dd", + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "part_of", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "api.control_actions_endpoint:related_api", + "content": "api.control_actions_endpoint related_api api.health_endpoint", + "metadata": { + "owner": null, + "anchor": "frontmatter.links", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "source_id": "api.control_actions_endpoint", + "target_id": "api.health_endpoint", + "doc_version": null, + "relation_id": "711fb2edb82dd222deaba3c91768b18cbbd453009235823282813c6e867dc2c1", + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "related_api", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "api.control_actions_endpoint:related_logic", + "content": "api.control_actions_endpoint related_logic logic.telegram_notification_loop", + "metadata": { + "owner": null, + "anchor": "frontmatter.links", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "source_id": "api.control_actions_endpoint", + "target_id": "logic.telegram_notification_loop", + "doc_version": null, + "relation_id": "eec79f7a02b804337e791ef231784862ae26e0599eb20224790e9d4f085fa9c0", + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "related_logic", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/api/health-endpoint.md", + "title": "api.health_endpoint:parent", + "content": "api.health_endpoint parent architecture.telegram_notify_app", + "metadata": { + "owner": null, + "anchor": "frontmatter.parent", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "8b5a533a8076e2e9d36995eee29aeade260080bdca2ec8e21fe28f08574b983f", + "source_id": "api.health_endpoint", + "target_id": "architecture.telegram_notify_app", + "doc_version": null, + "relation_id": "c718b1939621233295ccaf6e8203e7fd94f3dd1bfb88f10c51bc5e33d53a24aa", + "source_path": "docs/documentation/api/health-endpoint.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "parent", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/api/health-endpoint.md", + "title": "api.health_endpoint:part_of", + "content": "api.health_endpoint part_of architecture.telegram_notify_app", + "metadata": { + "owner": null, + "anchor": "frontmatter.links", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "8b5a533a8076e2e9d36995eee29aeade260080bdca2ec8e21fe28f08574b983f", + "source_id": "api.health_endpoint", + "target_id": "architecture.telegram_notify_app", + "doc_version": null, + "relation_id": "616f5cbf25da83cb51d8d0741a7fc351620c9ca2c6513fa2094b4aa476f0912a", + "source_path": "docs/documentation/api/health-endpoint.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "part_of", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/api/health-endpoint.md", + "title": "api.health_endpoint:depends_on", + "content": "api.health_endpoint depends_on domain.runtime_health", + "metadata": { + "owner": null, + "anchor": "frontmatter.links", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "8b5a533a8076e2e9d36995eee29aeade260080bdca2ec8e21fe28f08574b983f", + "source_id": "api.health_endpoint", + "target_id": "domain.runtime_health", + "doc_version": null, + "relation_id": "77f5d358ab85b3d92018b6b51da7c39773148dfd346686e8832a45370c841160", + "source_path": "docs/documentation/api/health-endpoint.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "depends_on", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/api/send-message-endpoint.md", + "title": "api.send_message_endpoint:parent", + "content": "api.send_message_endpoint parent architecture.telegram_notify_app", + "metadata": { + "owner": null, + "anchor": "frontmatter.parent", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "5fbf2e33510b0676a3a53b957a4569bd3c2c31fb7719546602c573421ccaa32d", + "source_id": "api.send_message_endpoint", + "target_id": "architecture.telegram_notify_app", + "doc_version": null, + "relation_id": "33eb0aa97f06d0afcaa4c230b5f5b73fa2fbfa5861ea9367b6c92f8a6fe0c054", + "source_path": "docs/documentation/api/send-message-endpoint.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "parent", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "api.control_actions_endpoint:parent", + "content": "api.control_actions_endpoint parent architecture.telegram_notify_app", + "metadata": { + "owner": null, + "anchor": "frontmatter.parent", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "source_id": "api.control_actions_endpoint", + "target_id": "architecture.telegram_notify_app", + "doc_version": null, + "relation_id": "afec31fd062e392dcd9699a92c7ab61fd4b1273c1a2b16702b23d55d8d0c47ac", + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "parent", + "staleness_score": null, + "system_component": null + } + } + ] +} +``` + +### User Prompt Overview +- question: Какие документы связаны с endpoint /health? +- intent: DOCUMENTATION_EXPLAIN +- sub_intent: RELATED_DOCS_EXPLAIN +- documents: 0 +- facts: 0 +- relations: 8 | samples: api.control_actions_endpoint:part_of, api.control_actions_endpoint:related_api, api.control_actions_endpoint:related_logic + +## Mismatches +- none \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/docs_pre_llm_v3/20260326_120832/full_chain_docs_intents_v2_docs-v2-system-flow-health-check.json b/tests/pipeline_setup_v3/test_results/docs_pre_llm_v3/20260326_120832/full_chain_docs_intents_v2_docs-v2-system-flow-health-check.json new file mode 100644 index 0000000..978a889 --- /dev/null +++ b/tests/pipeline_setup_v3/test_results/docs_pre_llm_v3/20260326_120832/full_chain_docs_intents_v2_docs-v2-system-flow-health-check.json @@ -0,0 +1,90 @@ +{ + "meta": { + "case_id": "docs-v2-system-flow-health-check", + "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_03_docs/full_chain_docs_intents_v2.yaml", + "runner": "agent_runtime", + "mode": "full_chain", + "passed": true, + "mismatches": [], + "actual": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "SYSTEM_FLOW_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START", + "rag_count": 23, + "llm_answer": "", + "answer_mode": "answered", + "path_scope": [], + "doc_scope": [ + "domain.runtime_health", + "api.health_endpoint", + "logic.telegram_notification_loop", + "api.control_actions_endpoint", + "api.actions_endpoint", + "architecture.telegram_notify_app", + "architecture.telegram_notify_app_overview", + "api.send_message_endpoint" + ], + "entity_candidates": [], + "symbol_candidates": [], + "layers": [ + "D1_DOCUMENT_CATALOG", + "D4_WORKFLOW_INDEX", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "filters": { + "doc_type": null + }, + "pipeline_mode": "pre_llm_only", + "gate_decision": "allow", + "prompt_used": "docs_explain_answer", + "llm_mode": "prose", + "degraded_reason": null, + "code_intents_stubbed": true + } + }, + "pipeline_steps": [ + { + "step": "input_query", + "input": { + "query": "Как происходит получение health состояния runtime?" + }, + "output": { + "query": "Как происходит получение health состояния runtime?" + } + }, + { + "step": "router", + "input": { + "query": "Как происходит получение health состояния runtime?" + }, + "output": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "SYSTEM_FLOW_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START" + } + }, + { + "step": "docs_pipeline", + "input": { + "query": "Как происходит получение health состояния runtime?" + }, + "output": { + "answer_mode": "ready", + "prompt_name": "docs_explain_answer", + "llm_request": { + "prompt_name": "docs_explain_answer", + "log_context": "graph.project_qa.docs.answer", + "prompt_stats": { + "system_chars": 393, + "user_chars": 22272, + "tokens_in_estimate": 5667 + } + }, + "degraded_reason": "" + } + } + ] +} \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/docs_pre_llm_v3/20260326_120832/full_chain_docs_intents_v2_docs-v2-system-flow-health-check.md b/tests/pipeline_setup_v3/test_results/docs_pre_llm_v3/20260326_120832/full_chain_docs_intents_v2_docs-v2-system-flow-health-check.md new file mode 100644 index 0000000..86f6990 --- /dev/null +++ b/tests/pipeline_setup_v3/test_results/docs_pre_llm_v3/20260326_120832/full_chain_docs_intents_v2_docs-v2-system-flow-health-check.md @@ -0,0 +1,909 @@ +# docs-v2-system-flow-health-check + +- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_03_docs/full_chain_docs_intents_v2.yaml +- runner: agent_runtime +- mode: full_chain +- passed: True + +## Query +Как происходит получение health состояния runtime? + +## Actual +{ + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "SYSTEM_FLOW_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START", + "rag_count": 23, + "llm_answer": "", + "answer_mode": "answered", + "path_scope": [], + "doc_scope": [ + "domain.runtime_health", + "api.health_endpoint", + "logic.telegram_notification_loop", + "api.control_actions_endpoint", + "api.actions_endpoint", + "architecture.telegram_notify_app", + "architecture.telegram_notify_app_overview", + "api.send_message_endpoint" + ], + "entity_candidates": [], + "symbol_candidates": [], + "layers": [ + "D1_DOCUMENT_CATALOG", + "D4_WORKFLOW_INDEX", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "filters": { + "doc_type": null + }, + "pipeline_mode": "pre_llm_only", + "gate_decision": "allow", + "prompt_used": "docs_explain_answer", + "llm_mode": "prose", + "degraded_reason": null, + "code_intents_stubbed": true +} + +## Pipeline Steps +### input_query +```json +{ + "input": { + "query": "Как происходит получение health состояния runtime?" + }, + "output": { + "query": "Как происходит получение health состояния runtime?" + } +} +``` + +### router +```json +{ + "input": { + "query": "Как происходит получение health состояния runtime?" + }, + "output": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "SYSTEM_FLOW_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START" + } +} +``` + +### docs_pipeline +```json +{ + "input": { + "query": "Как происходит получение health состояния runtime?" + }, + "output": { + "answer_mode": "ready", + "prompt_name": "docs_explain_answer", + "llm_request": { + "prompt_name": "docs_explain_answer", + "log_context": "graph.project_qa.docs.answer", + "prompt_stats": { + "system_chars": 393, + "user_chars": 22272, + "tokens_in_estimate": 5667 + } + }, + "degraded_reason": "" + } +} +``` + +## Diagnostics +{ + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "SYSTEM_FLOW_EXPLAIN", + "layers_used": [ + "D1_DOCUMENT_CATALOG", + "D4_WORKFLOW_INDEX", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "documents_found": 6, + "facts_found": 0, + "relations_found": 8, + "openapi_fields_extracted": 0, + "missing_required_fields": [], + "openapi_status": { + "has_path": false, + "has_method": false, + "has_request": false, + "has_response": false + }, + "prompt_used": "docs_explain_answer", + "llm_mode": "prose", + "output_valid": true, + "matched_intent_source": "deterministic", + "matched_anchor_type": "none", + "matched_anchor_value": null, + "exact_anchor_match": false, + "docs_layers_requested": [ + "D1_DOCUMENT_CATALOG", + "D4_WORKFLOW_INDEX", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "docs_layers_with_hits": [ + "D1_DOCUMENT_CATALOG", + "D4_WORKFLOW_INDEX", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "planned_layers": [ + "D1_DOCUMENT_CATALOG", + "D4_WORKFLOW_INDEX", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "executed_layers": [ + "D1_DOCUMENT_CATALOG", + "D4_WORKFLOW_INDEX", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "non_empty_layers": [ + "D1_DOCUMENT_CATALOG", + "D4_WORKFLOW_INDEX", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "layer_diagnostics": { + "D1_DOCUMENT_CATALOG": { + "hits": 6, + "top_ids": [ + "domain.runtime_health", + "api.health_endpoint", + "logic.telegram_notification_loop", + "api.control_actions_endpoint", + "architecture.telegram_notify_app" + ] + }, + "D4_WORKFLOW_INDEX": { + "hits": 3, + "top_ids": [ + "api.health_endpoint", + "api.control_actions_endpoint", + "api.send_message_endpoint" + ] + }, + "D5_RELATION_GRAPH": { + "hits": 8, + "top_ids": [ + "801650f8bcbfbfbefd35c14447bfef7b3c3827313db790efa7faf47db860f8c4", + "8595d7b82fecdb7ef579fa8961cda6799bb21970061e5bc221d4dd7a3d53fd04", + "af2a4f7c1b677b908410ba720915405e10dbd0870e30a3c6e3aa2468550ddf0e", + "c718b1939621233295ccaf6e8203e7fd94f3dd1bfb88f10c51bc5e33d53a24aa", + "616f5cbf25da83cb51d8d0741a7fc351620c9ca2c6513fa2094b4aa476f0912a" + ] + }, + "D0_DOC_CHUNKS": { + "hits": 6, + "top_ids": [ + "api.health_endpoint" + ] + } + }, + "query_entity_candidates": [], + "resolved_entity_candidates": [], + "query_anchor_candidates": [], + "resolved_anchor_candidates": [ + "domain.runtime_health", + "docs/documentation/domain/runtime-health-entity.md", + "api.health_endpoint", + "docs/documentation/api/health-endpoint.md", + "logic.telegram_notification_loop", + "docs/documentation/logic/telegram-notification-loop.md", + "api.control_actions_endpoint", + "docs/documentation/api/control-actions-endpoint.md", + "architecture.telegram_notify_app", + "docs/documentation/architecture/telegram-notify-app-overview.md", + "api.send_message_endpoint", + "docs/documentation/api/send-message-endpoint.md" + ], + "anchor_candidates": [], + "selected_anchor": null, + "anchor_selection_reason": "", + "anchor_match_type": "", + "doc_ids": [ + "domain.runtime_health", + "api.health_endpoint", + "logic.telegram_notification_loop", + "api.control_actions_endpoint", + "api.actions_endpoint", + "architecture.telegram_notify_app", + "architecture.telegram_notify_app_overview", + "api.send_message_endpoint" + ], + "doc_paths": [ + "docs/documentation/domain/runtime-health-entity.md", + "docs/documentation/api/health-endpoint.md", + "docs/documentation/logic/telegram-notification-loop.md", + "docs/documentation/api/control-actions-endpoint.md", + "docs/documentation/architecture/telegram-notify-app-overview.md", + "docs/documentation/api/send-message-endpoint.md" + ], + "doc_titles": [ + "Сущность runtime health", + "HTTP API /health", + "Цикл отправки уведомлений в Telegram", + "HTTP API /actions/{action}", + "Архитектура Telegram Notify App", + "HTTP API /send", + "Scenario", + "domain.runtime_health:used_by", + "domain.runtime_health:related_logic", + "domain.runtime_health:part_of", + "api.health_endpoint:parent", + "api.health_endpoint:part_of", + "api.health_endpoint:depends_on", + "domain.runtime_health:parent", + "api.control_actions_endpoint:related_api", + "api.health_endpoint:Сценарий", + "api.health_endpoint:Нефункциональные требования", + "api.health_endpoint:Summary", + "api.health_endpoint:Описание", + "api.health_endpoint:Функциональные требования", + "api.health_endpoint:Входные параметры" + ], + "relation_hits_count": 8, + "relation_targets": [ + "domain.runtime_health:used_by", + "domain.runtime_health:related_logic", + "domain.runtime_health:part_of", + "api.health_endpoint:parent", + "api.health_endpoint:part_of", + "api.health_endpoint:depends_on", + "domain.runtime_health:parent", + "api.control_actions_endpoint:related_api" + ], + "fallback_doc_hits_count": 12, + "fallback_used": false, + "fact_hits": 0, + "entity_hits": 0, + "evidence_summary": { + "documents": 6, + "facts": 0, + "relations": 8, + "chunks": 6, + "entity_hits": 0, + "openapi_signals": { + "path_found": false, + "method_found": false, + "request_schema": false, + "response_schema": false, + "status_codes": false, + "payload_description": false + } + }, + "gate_decision": "allow", + "gate_decision_reason": "evidence_sufficient", + "gate_missing_requirements": [], + "gate_satisfied_requirements": [ + "retrieval_non_empty" + ], + "openapi_evidence": { + "path_found": false, + "method_found": false, + "request_schema": false, + "response_schema": false, + "status_codes": false, + "payload_description": false + }, + "requested_fragment_type": null, + "fragment_evidence_found": [], + "fragment_missing_requirements": [], + "answer_mode": "ready", + "degrade_reason": null, + "degraded_reason": null, + "code_intents_stubbed": false +} + +## LLM Request +- prompt_name: docs_explain_answer +- log_context: graph.project_qa.docs.answer + +### Prompt Stats +```json +{ + "system_chars": 393, + "user_chars": 22272, + "tokens_in_estimate": 5667 +} +``` + +### System Prompt +```text +Ты объясняешь документацию системы. + +На вход приходит JSON с полями: +- question +- intent +- sub_intent +- documents +- facts +- relations + +Правила: +- Используй только предоставленные факты +- Не додумывай +- Если данных недостаточно, скажи это явно +- Объясняй структурировано + +Формат ответа: +1. Краткое описание +2. Основные элементы +3. Как это работает +4. Связи с другими частями системы (если есть) +``` + +### User Prompt +```json +{ + "question": "Как происходит получение health состояния runtime?", + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "SYSTEM_FLOW_EXPLAIN", + "documents": [ + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/domain/runtime-health-entity.md", + "title": "Сущность runtime health", + "content": "`runtime health` — доменная модель наблюдаемости сервиса, которая описывает общее состояние runtime и состояние отдельных компонентов. Для `test_echo_app` главным объектом наблюдения является компонент `telegram_notify`, у которого важны статус, время старта и количество успешных отправок. Эта модель используется для внешнего health-monitoring и внутренней диагностики.", + "metadata": { + "name": "runtime_health", + "tags": [ + "domain", + "health", + "observability" + ], + "type": "domain_entity", + "layer": "domain", + "links": [ + { + "type": "part_of", + "target": "architecture.telegram_notify_app" + }, + { + "type": "used_by", + "target": "api.health_endpoint" + }, + { + "type": "related_logic", + "target": "logic.telegram_notification_loop" + } + ], + "owner": null, + "title": "Сущность runtime health", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "architecture.telegram_notify_app", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "37d4dcf470ea3de95d59e44786006e369a3ea11bf5dbf4c88877696e9183ee87", + "children": [], + "doc_kind": "misc", + "entities": [ + "WorkerHealth", + "WorkerStatus", + "TelegramNotifyWorker" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "domain.runtime_health", + "source_path": "docs/documentation/domain/runtime-health-entity.md", + "summary_text": "`runtime health` — доменная модель наблюдаемости сервиса, которая описывает общее состояние runtime и состояние отдельных компонентов. Для `test_echo_app` главным объектом наблюдения является компонент `telegram_notify`, у которого важны статус, время старта и количество успешных отправок. Эта модель используется для внешнего health-monitoring и внутренней диагностики.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/api/health-endpoint.md", + "title": "HTTP API /health", + "content": "Endpoint `/health` возвращает агрегированный health payload runtime. Если общий статус равен `ok`, API отвечает с HTTP 200; для состояний деградации или неготовности возвращается HTTP 503 с тем же payload. Endpoint служит основной точкой внешней проверки состояния приложения.", + "metadata": { + "name": "health_endpoint", + "tags": [ + "api", + "health", + "control-plane" + ], + "type": "api_method", + "layer": "application", + "links": [ + { + "type": "part_of", + "target": "architecture.telegram_notify_app" + }, + { + "type": "depends_on", + "target": "domain.runtime_health" + } + ], + "owner": null, + "title": "HTTP API /health", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "architecture.telegram_notify_app", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "8b5a533a8076e2e9d36995eee29aeade260080bdca2ec8e21fe28f08574b983f", + "children": [], + "doc_kind": "misc", + "entities": [ + "TelegramControlChannel", + "TelegramNotifyWorker", + "RuntimeManager", + "WorkerHealth" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "api.health_endpoint", + "source_path": "docs/documentation/api/health-endpoint.md", + "summary_text": "Endpoint `/health` возвращает агрегированный health payload runtime. Если общий статус равен `ok`, API отвечает с HTTP 200; для состояний деградации или неготовности возвращается HTTP 503 с тем же payload. Endpoint служит основной точкой внешней проверки состояния приложения.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/logic/telegram-notification-loop.md", + "title": "Цикл отправки уведомлений в Telegram", + "content": "`TelegramNotifyWorker` после старта runtime запускает отдельный поток, сразу делает первую попытку отправки сообщения и затем повторяет отправку через заданный интервал. При ошибках доставки или отсутствии credentials worker не останавливает сервис, а переводит собственное состояние в `degraded`. Этот workflow определяет основной полезный цикл приложения.", + "metadata": { + "name": "telegram_notification_loop", + "tags": [ + "logic", + "telegram", + "worker", + "scheduling" + ], + "type": "logic_block", + "layer": "application", + "links": [ + { + "type": "part_of", + "target": "architecture.telegram_notify_app" + }, + { + "type": "related_api", + "target": "api.send_message_endpoint" + }, + { + "type": "related_api", + "target": "api.control_actions_endpoint" + }, + { + "type": "related_api", + "target": "api.health_endpoint" + } + ], + "owner": null, + "title": "Цикл отправки уведомлений в Telegram", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "architecture.telegram_notify_app", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "0f62f9b4dab261ca4ca34575ff5d84411a22c90b780c52eda388782b94f08470", + "children": [], + "doc_kind": "misc", + "entities": [ + "TelegramNotifyWorker", + "TelegramSendService", + "WorkerHealth", + "WorkerStatus" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "logic.telegram_notification_loop", + "source_path": "docs/documentation/logic/telegram-notification-loop.md", + "summary_text": "`TelegramNotifyWorker` после старта runtime запускает отдельный поток, сразу делает первую попытку отправки сообщения и затем повторяет отправку через заданный интервал. При ошибках доставки или отсутствии credentials worker не останавливает сервис, а переводит собственное состояние в `degraded`. Этот workflow определяет основной полезный цикл приложения.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "HTTP API /actions/{action}", + "content": "Endpoint `/actions/{action}` управляет control actions runtime и поддерживает `start`, `stop` и `status`. Для долгих операций `start` и `stop` допускается ответ HTTP 202, если действие еще выполняется. Endpoint используется для operator-driven управления жизненным циклом worker'а через HTTP API.", + "metadata": { + "name": "control_actions_endpoint", + "tags": [ + "api", + "control-plane", + "lifecycle" + ], + "type": "api_method", + "layer": "application", + "links": [ + { + "type": "part_of", + "target": "architecture.telegram_notify_app" + }, + { + "type": "related_api", + "target": "api.health_endpoint" + }, + { + "type": "related_logic", + "target": "logic.telegram_notification_loop" + } + ], + "owner": null, + "title": "HTTP API /actions/{action}", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "architecture.telegram_notify_app", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "children": [], + "doc_kind": "misc", + "entities": [ + "TelegramControlChannel", + "ControlActionSet", + "JSONResponse" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "api.control_actions_endpoint", + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "summary_text": "Endpoint `/actions/{action}` управляет control actions runtime и поддерживает `start`, `stop` и `status`. Для долгих операций `start` и `stop` допускается ответ HTTP 202, если действие еще выполняется. Endpoint используется для operator-driven управления жизненным циклом worker'а через HTTP API.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/architecture/telegram-notify-app-overview.md", + "title": "Архитектура Telegram Notify App", + "content": "`test_echo_app` — сервис на базе PLBA runtime, который поднимает HTTP control plane и запускает фоновый воркер для периодической отправки уведомлений в Telegram. Приложение использует YAML-конфиг для runtime-настроек и переменные окружения для Telegram credentials. Основной контур системы состоит из runtime manager, control channel, send service и worker loop.", + "metadata": { + "name": "telegram_notify_app_overview", + "tags": [ + "architecture", + "telegram", + "plba", + "runtime" + ], + "type": "architecture_overview", + "layer": "system", + "links": [ + { + "type": "related_api", + "target": "api.health_endpoint" + }, + { + "type": "related_api", + "target": "api.control_actions_endpoint" + }, + { + "type": "related_api", + "target": "api.send_message_endpoint" + }, + { + "type": "depends_on", + "target": "logic.telegram_notification_loop" + }, + { + "type": "depends_on", + "target": "domain.runtime_health" + } + ], + "owner": null, + "title": "Архитектура Telegram Notify App", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "docs_root", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "8b1cc9f823e55bddbc825466d10a0fdb4ca4354ac02d91f9e2aef7b7d2ec8256", + "children": [ + "api.health_endpoint", + "api.control_actions_endpoint", + "api.send_message_endpoint", + "logic.telegram_notification_loop", + "domain.runtime_health" + ], + "doc_kind": "spec", + "entities": [ + "TelegramNotifyModule", + "TelegramNotifyWorker", + "TelegramControlChannel", + "TelegramSendService", + "RuntimeManager" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "architecture.telegram_notify_app", + "source_path": "docs/documentation/architecture/telegram-notify-app-overview.md", + "summary_text": "`test_echo_app` — сервис на базе PLBA runtime, который поднимает HTTP control plane и запускает фоновый воркер для периодической отправки уведомлений в Telegram. Приложение использует YAML-конфиг для runtime-настроек и переменные окружения для Telegram credentials. Основной контур системы состоит из runtime manager, control channel, send service и worker loop.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/api/send-message-endpoint.md", + "title": "HTTP API /send", + "content": "Endpoint `/send` выполняет ручную отправку сообщения в Telegram через `TelegramSendService`. Он используется для операторской проверки доставки и для отправки уведомлений вне периодического worker loop. Endpoint работает поверх тех же credentials и того же delivery path, что и фоновая отправка.", + "metadata": { + "name": "send_message_endpoint", + "tags": [ + "api", + "telegram", + "manual-send" + ], + "type": "api_method", + "layer": "application", + "links": [ + { + "type": "part_of", + "target": "architecture.telegram_notify_app" + }, + { + "type": "depends_on", + "target": "logic.telegram_notification_loop" + } + ], + "owner": null, + "title": "HTTP API /send", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "architecture.telegram_notify_app", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "5fbf2e33510b0676a3a53b957a4569bd3c2c31fb7719546602c573421ccaa32d", + "children": [], + "doc_kind": "misc", + "entities": [ + "TelegramControlAppFactory", + "TelegramSendService", + "TelegramNotifyWorker" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "api.send_message_endpoint", + "source_path": "docs/documentation/api/send-message-endpoint.md", + "summary_text": "Endpoint `/send` выполняет ручную отправку сообщения в Telegram через `TelegramSendService`. Он используется для операторской проверки доставки и для отправки уведомлений вне периодического worker loop. Endpoint работает поверх тех же credentials и того же delivery path, что и фоновая отправка.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + } + ], + "facts": [], + "relations": [ + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/domain/runtime-health-entity.md", + "title": "domain.runtime_health:used_by", + "content": "domain.runtime_health used_by api.health_endpoint", + "metadata": { + "owner": null, + "anchor": "frontmatter.links", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "37d4dcf470ea3de95d59e44786006e369a3ea11bf5dbf4c88877696e9183ee87", + "source_id": "domain.runtime_health", + "target_id": "api.health_endpoint", + "doc_version": null, + "relation_id": "801650f8bcbfbfbefd35c14447bfef7b3c3827313db790efa7faf47db860f8c4", + "source_path": "docs/documentation/domain/runtime-health-entity.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "used_by", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/domain/runtime-health-entity.md", + "title": "domain.runtime_health:related_logic", + "content": "domain.runtime_health related_logic logic.telegram_notification_loop", + "metadata": { + "owner": null, + "anchor": "frontmatter.links", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "37d4dcf470ea3de95d59e44786006e369a3ea11bf5dbf4c88877696e9183ee87", + "source_id": "domain.runtime_health", + "target_id": "logic.telegram_notification_loop", + "doc_version": null, + "relation_id": "8595d7b82fecdb7ef579fa8961cda6799bb21970061e5bc221d4dd7a3d53fd04", + "source_path": "docs/documentation/domain/runtime-health-entity.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "related_logic", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/domain/runtime-health-entity.md", + "title": "domain.runtime_health:part_of", + "content": "domain.runtime_health part_of architecture.telegram_notify_app", + "metadata": { + "owner": null, + "anchor": "frontmatter.links", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "37d4dcf470ea3de95d59e44786006e369a3ea11bf5dbf4c88877696e9183ee87", + "source_id": "domain.runtime_health", + "target_id": "architecture.telegram_notify_app", + "doc_version": null, + "relation_id": "af2a4f7c1b677b908410ba720915405e10dbd0870e30a3c6e3aa2468550ddf0e", + "source_path": "docs/documentation/domain/runtime-health-entity.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "part_of", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/api/health-endpoint.md", + "title": "api.health_endpoint:parent", + "content": "api.health_endpoint parent architecture.telegram_notify_app", + "metadata": { + "owner": null, + "anchor": "frontmatter.parent", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "8b5a533a8076e2e9d36995eee29aeade260080bdca2ec8e21fe28f08574b983f", + "source_id": "api.health_endpoint", + "target_id": "architecture.telegram_notify_app", + "doc_version": null, + "relation_id": "c718b1939621233295ccaf6e8203e7fd94f3dd1bfb88f10c51bc5e33d53a24aa", + "source_path": "docs/documentation/api/health-endpoint.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "parent", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/api/health-endpoint.md", + "title": "api.health_endpoint:part_of", + "content": "api.health_endpoint part_of architecture.telegram_notify_app", + "metadata": { + "owner": null, + "anchor": "frontmatter.links", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "8b5a533a8076e2e9d36995eee29aeade260080bdca2ec8e21fe28f08574b983f", + "source_id": "api.health_endpoint", + "target_id": "architecture.telegram_notify_app", + "doc_version": null, + "relation_id": "616f5cbf25da83cb51d8d0741a7fc351620c9ca2c6513fa2094b4aa476f0912a", + "source_path": "docs/documentation/api/health-endpoint.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "part_of", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/api/health-endpoint.md", + "title": "api.health_endpoint:depends_on", + "content": "api.health_endpoint depends_on domain.runtime_health", + "metadata": { + "owner": null, + "anchor": "frontmatter.links", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "8b5a533a8076e2e9d36995eee29aeade260080bdca2ec8e21fe28f08574b983f", + "source_id": "api.health_endpoint", + "target_id": "domain.runtime_health", + "doc_version": null, + "relation_id": "77f5d358ab85b3d92018b6b51da7c39773148dfd346686e8832a45370c841160", + "source_path": "docs/documentation/api/health-endpoint.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "depends_on", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/domain/runtime-health-entity.md", + "title": "domain.runtime_health:parent", + "content": "domain.runtime_health parent architecture.telegram_notify_app", + "metadata": { + "owner": null, + "anchor": "frontmatter.parent", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "37d4dcf470ea3de95d59e44786006e369a3ea11bf5dbf4c88877696e9183ee87", + "source_id": "domain.runtime_health", + "target_id": "architecture.telegram_notify_app", + "doc_version": null, + "relation_id": "79bdb0a74713df6064008179ca8c5c186dc23e4e1c5e2c9607b0bdddeba50f93", + "source_path": "docs/documentation/domain/runtime-health-entity.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "parent", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "api.control_actions_endpoint:related_api", + "content": "api.control_actions_endpoint related_api api.health_endpoint", + "metadata": { + "owner": null, + "anchor": "frontmatter.links", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "source_id": "api.control_actions_endpoint", + "target_id": "api.health_endpoint", + "doc_version": null, + "relation_id": "711fb2edb82dd222deaba3c91768b18cbbd453009235823282813c6e867dc2c1", + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "related_api", + "staleness_score": null, + "system_component": null + } + } + ] +} +``` + +### User Prompt Overview +- question: Как происходит получение health состояния runtime? +- intent: DOCUMENTATION_EXPLAIN +- sub_intent: SYSTEM_FLOW_EXPLAIN +- documents: 6 | samples: Сущность runtime health, HTTP API /health, Цикл отправки уведомлений в Telegram +- facts: 0 +- relations: 8 | samples: domain.runtime_health:used_by, domain.runtime_health:related_logic, domain.runtime_health:part_of + +## Mismatches +- none \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/docs_pre_llm_v3/20260326_120832/full_chain_docs_intents_v2_docs-v2-system-flow-telegram-loop.json b/tests/pipeline_setup_v3/test_results/docs_pre_llm_v3/20260326_120832/full_chain_docs_intents_v2_docs-v2-system-flow-telegram-loop.json new file mode 100644 index 0000000..ba645ce --- /dev/null +++ b/tests/pipeline_setup_v3/test_results/docs_pre_llm_v3/20260326_120832/full_chain_docs_intents_v2_docs-v2-system-flow-telegram-loop.json @@ -0,0 +1,91 @@ +{ + "meta": { + "case_id": "docs-v2-system-flow-telegram-loop", + "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_03_docs/full_chain_docs_intents_v2.yaml", + "runner": "agent_runtime", + "mode": "full_chain", + "passed": true, + "mismatches": [], + "actual": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "SYSTEM_FLOW_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START", + "rag_count": 18, + "llm_answer": "", + "answer_mode": "answered", + "path_scope": [], + "doc_scope": [ + "architecture.telegram_notify_app", + "architecture.telegram_notify_app_overview", + "logic.telegram_notification_loop", + "api.send_message_endpoint", + "domain.runtime_health", + "api.health_endpoint", + "api.control_actions_endpoint", + "api.actions_endpoint", + "docs/README.md" + ], + "entity_candidates": [], + "symbol_candidates": [], + "layers": [ + "D1_DOCUMENT_CATALOG", + "D4_WORKFLOW_INDEX", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "filters": { + "doc_type": null + }, + "pipeline_mode": "pre_llm_only", + "gate_decision": "allow", + "prompt_used": "docs_explain_answer", + "llm_mode": "prose", + "degraded_reason": null, + "code_intents_stubbed": true + } + }, + "pipeline_steps": [ + { + "step": "input_query", + "input": { + "query": "Объясни как работает цикл отправки уведомлений в Telegram" + }, + "output": { + "query": "Объясни как работает цикл отправки уведомлений в Telegram" + } + }, + { + "step": "router", + "input": { + "query": "Объясни как работает цикл отправки уведомлений в Telegram" + }, + "output": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "SYSTEM_FLOW_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START" + } + }, + { + "step": "docs_pipeline", + "input": { + "query": "Объясни как работает цикл отправки уведомлений в Telegram" + }, + "output": { + "answer_mode": "ready", + "prompt_name": "docs_explain_answer", + "llm_request": { + "prompt_name": "docs_explain_answer", + "log_context": "graph.project_qa.docs.answer", + "prompt_stats": { + "system_chars": 393, + "user_chars": 17592, + "tokens_in_estimate": 4497 + } + }, + "degraded_reason": "" + } + } + ] +} \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/docs_pre_llm_v3/20260326_120832/full_chain_docs_intents_v2_docs-v2-system-flow-telegram-loop.md b/tests/pipeline_setup_v3/test_results/docs_pre_llm_v3/20260326_120832/full_chain_docs_intents_v2_docs-v2-system-flow-telegram-loop.md new file mode 100644 index 0000000..94883a4 --- /dev/null +++ b/tests/pipeline_setup_v3/test_results/docs_pre_llm_v3/20260326_120832/full_chain_docs_intents_v2_docs-v2-system-flow-telegram-loop.md @@ -0,0 +1,785 @@ +# docs-v2-system-flow-telegram-loop + +- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_03_docs/full_chain_docs_intents_v2.yaml +- runner: agent_runtime +- mode: full_chain +- passed: True + +## Query +Объясни как работает цикл отправки уведомлений в Telegram + +## Actual +{ + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "SYSTEM_FLOW_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START", + "rag_count": 18, + "llm_answer": "", + "answer_mode": "answered", + "path_scope": [], + "doc_scope": [ + "architecture.telegram_notify_app", + "architecture.telegram_notify_app_overview", + "logic.telegram_notification_loop", + "api.send_message_endpoint", + "domain.runtime_health", + "api.health_endpoint", + "api.control_actions_endpoint", + "api.actions_endpoint", + "docs/README.md" + ], + "entity_candidates": [], + "symbol_candidates": [], + "layers": [ + "D1_DOCUMENT_CATALOG", + "D4_WORKFLOW_INDEX", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "filters": { + "doc_type": null + }, + "pipeline_mode": "pre_llm_only", + "gate_decision": "allow", + "prompt_used": "docs_explain_answer", + "llm_mode": "prose", + "degraded_reason": null, + "code_intents_stubbed": true +} + +## Pipeline Steps +### input_query +```json +{ + "input": { + "query": "Объясни как работает цикл отправки уведомлений в Telegram" + }, + "output": { + "query": "Объясни как работает цикл отправки уведомлений в Telegram" + } +} +``` + +### router +```json +{ + "input": { + "query": "Объясни как работает цикл отправки уведомлений в Telegram" + }, + "output": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "SYSTEM_FLOW_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START" + } +} +``` + +### docs_pipeline +```json +{ + "input": { + "query": "Объясни как работает цикл отправки уведомлений в Telegram" + }, + "output": { + "answer_mode": "ready", + "prompt_name": "docs_explain_answer", + "llm_request": { + "prompt_name": "docs_explain_answer", + "log_context": "graph.project_qa.docs.answer", + "prompt_stats": { + "system_chars": 393, + "user_chars": 17592, + "tokens_in_estimate": 4497 + } + }, + "degraded_reason": "" + } +} +``` + +## Diagnostics +{ + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "SYSTEM_FLOW_EXPLAIN", + "layers_used": [ + "D1_DOCUMENT_CATALOG", + "D4_WORKFLOW_INDEX", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "documents_found": 6, + "facts_found": 0, + "relations_found": 3, + "openapi_fields_extracted": 0, + "missing_required_fields": [], + "openapi_status": { + "has_path": false, + "has_method": false, + "has_request": false, + "has_response": false + }, + "prompt_used": "docs_explain_answer", + "llm_mode": "prose", + "output_valid": true, + "matched_intent_source": "deterministic", + "matched_anchor_type": "none", + "matched_anchor_value": null, + "exact_anchor_match": false, + "docs_layers_requested": [ + "D1_DOCUMENT_CATALOG", + "D4_WORKFLOW_INDEX", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "docs_layers_with_hits": [ + "D1_DOCUMENT_CATALOG", + "D4_WORKFLOW_INDEX", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "planned_layers": [ + "D1_DOCUMENT_CATALOG", + "D4_WORKFLOW_INDEX", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "executed_layers": [ + "D1_DOCUMENT_CATALOG", + "D4_WORKFLOW_INDEX", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "non_empty_layers": [ + "D1_DOCUMENT_CATALOG", + "D4_WORKFLOW_INDEX", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "layer_diagnostics": { + "D1_DOCUMENT_CATALOG": { + "hits": 6, + "top_ids": [ + "architecture.telegram_notify_app", + "logic.telegram_notification_loop", + "api.send_message_endpoint", + "domain.runtime_health", + "api.health_endpoint" + ] + }, + "D4_WORKFLOW_INDEX": { + "hits": 3, + "top_ids": [ + "api.control_actions_endpoint", + "api.health_endpoint", + "api.send_message_endpoint" + ] + }, + "D5_RELATION_GRAPH": { + "hits": 8, + "top_ids": [ + "305bab0c6567d93a2b453a9d70b676f9ecd8de083ef36f5cf3398747c25ebf94", + "7bd0428d23e9b20f7d65202cc269e45b3d1e7aed7b5df4a35581fd88677be29b", + "0eb7f73fcda8556439e06f5eeb5ce064ae32b6cd3129353f5b1b4eb3db626d88", + "ae34fe4b3cd2b47632b13b1e32303e842b57948aa21160abe8d9b478995e1d74", + "145ccbb861a8fb621286ec9c888ce69677168d35c7871c70537e888ce3a5b910" + ] + }, + "D0_DOC_CHUNKS": { + "hits": 6, + "top_ids": [ + "logic.telegram_notification_loop", + "architecture.telegram_notify_app", + "docs/README.md" + ] + } + }, + "query_entity_candidates": [], + "resolved_entity_candidates": [], + "query_anchor_candidates": [], + "resolved_anchor_candidates": [ + "architecture.telegram_notify_app", + "docs/documentation/architecture/telegram-notify-app-overview.md", + "logic.telegram_notification_loop", + "docs/documentation/logic/telegram-notification-loop.md", + "api.send_message_endpoint", + "docs/documentation/api/send-message-endpoint.md", + "domain.runtime_health", + "docs/documentation/domain/runtime-health-entity.md", + "api.health_endpoint", + "docs/documentation/api/health-endpoint.md", + "api.control_actions_endpoint", + "docs/documentation/api/control-actions-endpoint.md", + "docs/README.md" + ], + "anchor_candidates": [], + "selected_anchor": null, + "anchor_selection_reason": "", + "anchor_match_type": "", + "doc_ids": [ + "architecture.telegram_notify_app", + "architecture.telegram_notify_app_overview", + "logic.telegram_notification_loop", + "api.send_message_endpoint", + "domain.runtime_health", + "api.health_endpoint", + "api.control_actions_endpoint", + "api.actions_endpoint", + "docs/README.md" + ], + "doc_paths": [ + "docs/documentation/architecture/telegram-notify-app-overview.md", + "docs/documentation/logic/telegram-notification-loop.md", + "docs/documentation/api/send-message-endpoint.md", + "docs/documentation/domain/runtime-health-entity.md", + "docs/documentation/api/health-endpoint.md", + "docs/documentation/api/control-actions-endpoint.md", + "docs/README.md" + ], + "doc_titles": [ + "Архитектура Telegram Notify App", + "Цикл отправки уведомлений в Telegram", + "HTTP API /send", + "Сущность runtime health", + "HTTP API /health", + "HTTP API /actions/{action}", + "Scenario", + "architecture.telegram_notify_app:child", + "architecture.telegram_notify_app:related_api", + "architecture.telegram_notify_app:parent", + "logic.telegram_notification_loop:Summary", + "logic.telegram_notification_loop:Details", + "architecture.telegram_notify_app:Summary", + "architecture.telegram_notify_app:Details", + "docs/README.md:Навигация", + "api.health_endpoint:Функциональные требования" + ], + "relation_hits_count": 3, + "relation_targets": [ + "architecture.telegram_notify_app:child", + "architecture.telegram_notify_app:related_api", + "architecture.telegram_notify_app:parent" + ], + "fallback_doc_hits_count": 12, + "fallback_used": false, + "fact_hits": 0, + "entity_hits": 0, + "evidence_summary": { + "documents": 6, + "facts": 0, + "relations": 3, + "chunks": 6, + "entity_hits": 0, + "openapi_signals": { + "path_found": false, + "method_found": false, + "request_schema": false, + "response_schema": false, + "status_codes": false, + "payload_description": false + } + }, + "gate_decision": "allow", + "gate_decision_reason": "evidence_sufficient", + "gate_missing_requirements": [], + "gate_satisfied_requirements": [ + "retrieval_non_empty" + ], + "openapi_evidence": { + "path_found": false, + "method_found": false, + "request_schema": false, + "response_schema": false, + "status_codes": false, + "payload_description": false + }, + "requested_fragment_type": null, + "fragment_evidence_found": [], + "fragment_missing_requirements": [], + "answer_mode": "ready", + "degrade_reason": null, + "degraded_reason": null, + "code_intents_stubbed": false +} + +## LLM Request +- prompt_name: docs_explain_answer +- log_context: graph.project_qa.docs.answer + +### Prompt Stats +```json +{ + "system_chars": 393, + "user_chars": 17592, + "tokens_in_estimate": 4497 +} +``` + +### System Prompt +```text +Ты объясняешь документацию системы. + +На вход приходит JSON с полями: +- question +- intent +- sub_intent +- documents +- facts +- relations + +Правила: +- Используй только предоставленные факты +- Не додумывай +- Если данных недостаточно, скажи это явно +- Объясняй структурировано + +Формат ответа: +1. Краткое описание +2. Основные элементы +3. Как это работает +4. Связи с другими частями системы (если есть) +``` + +### User Prompt +```json +{ + "question": "Объясни как работает цикл отправки уведомлений в Telegram", + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "SYSTEM_FLOW_EXPLAIN", + "documents": [ + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/architecture/telegram-notify-app-overview.md", + "title": "Архитектура Telegram Notify App", + "content": "`test_echo_app` — сервис на базе PLBA runtime, который поднимает HTTP control plane и запускает фоновый воркер для периодической отправки уведомлений в Telegram. Приложение использует YAML-конфиг для runtime-настроек и переменные окружения для Telegram credentials. Основной контур системы состоит из runtime manager, control channel, send service и worker loop.", + "metadata": { + "name": "telegram_notify_app_overview", + "tags": [ + "architecture", + "telegram", + "plba", + "runtime" + ], + "type": "architecture_overview", + "layer": "system", + "links": [ + { + "type": "related_api", + "target": "api.health_endpoint" + }, + { + "type": "related_api", + "target": "api.control_actions_endpoint" + }, + { + "type": "related_api", + "target": "api.send_message_endpoint" + }, + { + "type": "depends_on", + "target": "logic.telegram_notification_loop" + }, + { + "type": "depends_on", + "target": "domain.runtime_health" + } + ], + "owner": null, + "title": "Архитектура Telegram Notify App", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "docs_root", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "8b1cc9f823e55bddbc825466d10a0fdb4ca4354ac02d91f9e2aef7b7d2ec8256", + "children": [ + "api.health_endpoint", + "api.control_actions_endpoint", + "api.send_message_endpoint", + "logic.telegram_notification_loop", + "domain.runtime_health" + ], + "doc_kind": "spec", + "entities": [ + "TelegramNotifyModule", + "TelegramNotifyWorker", + "TelegramControlChannel", + "TelegramSendService", + "RuntimeManager" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "architecture.telegram_notify_app", + "source_path": "docs/documentation/architecture/telegram-notify-app-overview.md", + "summary_text": "`test_echo_app` — сервис на базе PLBA runtime, который поднимает HTTP control plane и запускает фоновый воркер для периодической отправки уведомлений в Telegram. Приложение использует YAML-конфиг для runtime-настроек и переменные окружения для Telegram credentials. Основной контур системы состоит из runtime manager, control channel, send service и worker loop.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/logic/telegram-notification-loop.md", + "title": "Цикл отправки уведомлений в Telegram", + "content": "`TelegramNotifyWorker` после старта runtime запускает отдельный поток, сразу делает первую попытку отправки сообщения и затем повторяет отправку через заданный интервал. При ошибках доставки или отсутствии credentials worker не останавливает сервис, а переводит собственное состояние в `degraded`. Этот workflow определяет основной полезный цикл приложения.", + "metadata": { + "name": "telegram_notification_loop", + "tags": [ + "logic", + "telegram", + "worker", + "scheduling" + ], + "type": "logic_block", + "layer": "application", + "links": [ + { + "type": "part_of", + "target": "architecture.telegram_notify_app" + }, + { + "type": "related_api", + "target": "api.send_message_endpoint" + }, + { + "type": "related_api", + "target": "api.control_actions_endpoint" + }, + { + "type": "related_api", + "target": "api.health_endpoint" + } + ], + "owner": null, + "title": "Цикл отправки уведомлений в Telegram", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "architecture.telegram_notify_app", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "0f62f9b4dab261ca4ca34575ff5d84411a22c90b780c52eda388782b94f08470", + "children": [], + "doc_kind": "misc", + "entities": [ + "TelegramNotifyWorker", + "TelegramSendService", + "WorkerHealth", + "WorkerStatus" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "logic.telegram_notification_loop", + "source_path": "docs/documentation/logic/telegram-notification-loop.md", + "summary_text": "`TelegramNotifyWorker` после старта runtime запускает отдельный поток, сразу делает первую попытку отправки сообщения и затем повторяет отправку через заданный интервал. При ошибках доставки или отсутствии credentials worker не останавливает сервис, а переводит собственное состояние в `degraded`. Этот workflow определяет основной полезный цикл приложения.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/api/send-message-endpoint.md", + "title": "HTTP API /send", + "content": "Endpoint `/send` выполняет ручную отправку сообщения в Telegram через `TelegramSendService`. Он используется для операторской проверки доставки и для отправки уведомлений вне периодического worker loop. Endpoint работает поверх тех же credentials и того же delivery path, что и фоновая отправка.", + "metadata": { + "name": "send_message_endpoint", + "tags": [ + "api", + "telegram", + "manual-send" + ], + "type": "api_method", + "layer": "application", + "links": [ + { + "type": "part_of", + "target": "architecture.telegram_notify_app" + }, + { + "type": "depends_on", + "target": "logic.telegram_notification_loop" + } + ], + "owner": null, + "title": "HTTP API /send", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "architecture.telegram_notify_app", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "5fbf2e33510b0676a3a53b957a4569bd3c2c31fb7719546602c573421ccaa32d", + "children": [], + "doc_kind": "misc", + "entities": [ + "TelegramControlAppFactory", + "TelegramSendService", + "TelegramNotifyWorker" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "api.send_message_endpoint", + "source_path": "docs/documentation/api/send-message-endpoint.md", + "summary_text": "Endpoint `/send` выполняет ручную отправку сообщения в Telegram через `TelegramSendService`. Он используется для операторской проверки доставки и для отправки уведомлений вне периодического worker loop. Endpoint работает поверх тех же credentials и того же delivery path, что и фоновая отправка.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/domain/runtime-health-entity.md", + "title": "Сущность runtime health", + "content": "`runtime health` — доменная модель наблюдаемости сервиса, которая описывает общее состояние runtime и состояние отдельных компонентов. Для `test_echo_app` главным объектом наблюдения является компонент `telegram_notify`, у которого важны статус, время старта и количество успешных отправок. Эта модель используется для внешнего health-monitoring и внутренней диагностики.", + "metadata": { + "name": "runtime_health", + "tags": [ + "domain", + "health", + "observability" + ], + "type": "domain_entity", + "layer": "domain", + "links": [ + { + "type": "part_of", + "target": "architecture.telegram_notify_app" + }, + { + "type": "used_by", + "target": "api.health_endpoint" + }, + { + "type": "related_logic", + "target": "logic.telegram_notification_loop" + } + ], + "owner": null, + "title": "Сущность runtime health", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "architecture.telegram_notify_app", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "37d4dcf470ea3de95d59e44786006e369a3ea11bf5dbf4c88877696e9183ee87", + "children": [], + "doc_kind": "misc", + "entities": [ + "WorkerHealth", + "WorkerStatus", + "TelegramNotifyWorker" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "domain.runtime_health", + "source_path": "docs/documentation/domain/runtime-health-entity.md", + "summary_text": "`runtime health` — доменная модель наблюдаемости сервиса, которая описывает общее состояние runtime и состояние отдельных компонентов. Для `test_echo_app` главным объектом наблюдения является компонент `telegram_notify`, у которого важны статус, время старта и количество успешных отправок. Эта модель используется для внешнего health-monitoring и внутренней диагностики.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/api/health-endpoint.md", + "title": "HTTP API /health", + "content": "Endpoint `/health` возвращает агрегированный health payload runtime. Если общий статус равен `ok`, API отвечает с HTTP 200; для состояний деградации или неготовности возвращается HTTP 503 с тем же payload. Endpoint служит основной точкой внешней проверки состояния приложения.", + "metadata": { + "name": "health_endpoint", + "tags": [ + "api", + "health", + "control-plane" + ], + "type": "api_method", + "layer": "application", + "links": [ + { + "type": "part_of", + "target": "architecture.telegram_notify_app" + }, + { + "type": "depends_on", + "target": "domain.runtime_health" + } + ], + "owner": null, + "title": "HTTP API /health", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "architecture.telegram_notify_app", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "8b5a533a8076e2e9d36995eee29aeade260080bdca2ec8e21fe28f08574b983f", + "children": [], + "doc_kind": "misc", + "entities": [ + "TelegramControlChannel", + "TelegramNotifyWorker", + "RuntimeManager", + "WorkerHealth" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "api.health_endpoint", + "source_path": "docs/documentation/api/health-endpoint.md", + "summary_text": "Endpoint `/health` возвращает агрегированный health payload runtime. Если общий статус равен `ok`, API отвечает с HTTP 200; для состояний деградации или неготовности возвращается HTTP 503 с тем же payload. Endpoint служит основной точкой внешней проверки состояния приложения.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "HTTP API /actions/{action}", + "content": "Endpoint `/actions/{action}` управляет control actions runtime и поддерживает `start`, `stop` и `status`. Для долгих операций `start` и `stop` допускается ответ HTTP 202, если действие еще выполняется. Endpoint используется для operator-driven управления жизненным циклом worker'а через HTTP API.", + "metadata": { + "name": "control_actions_endpoint", + "tags": [ + "api", + "control-plane", + "lifecycle" + ], + "type": "api_method", + "layer": "application", + "links": [ + { + "type": "part_of", + "target": "architecture.telegram_notify_app" + }, + { + "type": "related_api", + "target": "api.health_endpoint" + }, + { + "type": "related_logic", + "target": "logic.telegram_notification_loop" + } + ], + "owner": null, + "title": "HTTP API /actions/{action}", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "architecture.telegram_notify_app", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "children": [], + "doc_kind": "misc", + "entities": [ + "TelegramControlChannel", + "ControlActionSet", + "JSONResponse" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "api.control_actions_endpoint", + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "summary_text": "Endpoint `/actions/{action}` управляет control actions runtime и поддерживает `start`, `stop` и `status`. Для долгих операций `start` и `stop` допускается ответ HTTP 202, если действие еще выполняется. Endpoint используется для operator-driven управления жизненным циклом worker'а через HTTP API.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + } + ], + "facts": [], + "relations": [ + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/architecture/telegram-notify-app-overview.md", + "title": "architecture.telegram_notify_app:child", + "content": "architecture.telegram_notify_app child api.send_message_endpoint", + "metadata": { + "owner": null, + "anchor": "frontmatter.children", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "8b1cc9f823e55bddbc825466d10a0fdb4ca4354ac02d91f9e2aef7b7d2ec8256", + "source_id": "architecture.telegram_notify_app", + "target_id": "api.send_message_endpoint", + "doc_version": null, + "relation_id": "305bab0c6567d93a2b453a9d70b676f9ecd8de083ef36f5cf3398747c25ebf94", + "source_path": "docs/documentation/architecture/telegram-notify-app-overview.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "child", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/architecture/telegram-notify-app-overview.md", + "title": "architecture.telegram_notify_app:related_api", + "content": "architecture.telegram_notify_app related_api api.health_endpoint", + "metadata": { + "owner": null, + "anchor": "frontmatter.links", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "8b1cc9f823e55bddbc825466d10a0fdb4ca4354ac02d91f9e2aef7b7d2ec8256", + "source_id": "architecture.telegram_notify_app", + "target_id": "api.health_endpoint", + "doc_version": null, + "relation_id": "7bd0428d23e9b20f7d65202cc269e45b3d1e7aed7b5df4a35581fd88677be29b", + "source_path": "docs/documentation/architecture/telegram-notify-app-overview.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "related_api", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/architecture/telegram-notify-app-overview.md", + "title": "architecture.telegram_notify_app:parent", + "content": "architecture.telegram_notify_app parent docs_root", + "metadata": { + "owner": null, + "anchor": "frontmatter.parent", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "8b1cc9f823e55bddbc825466d10a0fdb4ca4354ac02d91f9e2aef7b7d2ec8256", + "source_id": "architecture.telegram_notify_app", + "target_id": "docs_root", + "doc_version": null, + "relation_id": "e01922b36e3cc60d9349f89e43fcd4a92c6a01394b0028d6b6d56801b258645d", + "source_path": "docs/documentation/architecture/telegram-notify-app-overview.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "parent", + "staleness_score": null, + "system_component": null + } + } + ] +} +``` + +### User Prompt Overview +- question: Объясни как работает цикл отправки уведомлений в Telegram +- intent: DOCUMENTATION_EXPLAIN +- sub_intent: SYSTEM_FLOW_EXPLAIN +- documents: 6 | samples: Архитектура Telegram Notify App, Цикл отправки уведомлений в Telegram, HTTP API /send +- facts: 0 +- relations: 3 | samples: architecture.telegram_notify_app:child, architecture.telegram_notify_app:related_api, architecture.telegram_notify_app:parent + +## Mismatches +- none \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/docs_pre_llm_v3/20260326_120832/summary.md b/tests/pipeline_setup_v3/test_results/docs_pre_llm_v3/20260326_120832/summary.md new file mode 100644 index 0000000..2a2d7c7 --- /dev/null +++ b/tests/pipeline_setup_v3/test_results/docs_pre_llm_v3/20260326_120832/summary.md @@ -0,0 +1,20 @@ +# pipeline_setup_v3 summary + +Passed: 14/14 + +| File | Case | Mode | Query | Actual sub-intent | RAG layers | Tokens | Pass | +|------|------|------|-------|-------------------|------------|--------|------| +| full_chain_docs_intents_v2.yaml | docs-v2-system-flow-telegram-loop | full_chain | Объясни как работает цикл отправки уведомлений в Telegram | SYSTEM_FLOW_EXPLAIN | D0_DOC_CHUNKS:6, D1_DOCUMENT_CATALOG:6, D4_WORKFLOW_INDEX:3, D5_RELATION_GRAPH:3 | 4497 | ✓ | +| full_chain_docs_intents_v2.yaml | docs-v2-system-flow-health-check | full_chain | Как происходит получение health состояния runtime? | SYSTEM_FLOW_EXPLAIN | D0_DOC_CHUNKS:6, D1_DOCUMENT_CATALOG:6, D4_WORKFLOW_INDEX:3, D5_RELATION_GRAPH:8 | 5667 | ✓ | +| full_chain_docs_intents_v2.yaml | docs-v2-component-control-channel | full_chain | Объясни как работает компонент TelegramControlChannel | COMPONENT_EXPLAIN | D0_DOC_CHUNKS:6, D1_DOCUMENT_CATALOG:6, D2_FACT_INDEX:2, D5_RELATION_GRAPH:6 | 5478 | ✓ | +| full_chain_docs_intents_v2.yaml | docs-v2-component-runtime-manager | full_chain | Какую роль в системе играет RuntimeManager? | COMPONENT_EXPLAIN | D0_DOC_CHUNKS:6, D1_DOCUMENT_CATALOG:6, D2_FACT_INDEX:2, D5_RELATION_GRAPH:6 | 5475 | ✓ | +| full_chain_docs_intents_v2.yaml | docs-v2-api-health-endpoint | full_chain | Объясни что делает endpoint /health | API_METHOD_EXPLAIN | D1_DOCUMENT_CATALOG:1, D4_WORKFLOW_INDEX:1 | 665 | ✓ | +| full_chain_docs_intents_v2.yaml | docs-v2-api-send-endpoint | full_chain | Как работает endpoint /send? | API_METHOD_EXPLAIN | D1_DOCUMENT_CATALOG:1, D4_WORKFLOW_INDEX:1 | 676 | ✓ | +| full_chain_docs_intents_v2.yaml | docs-v2-entity-runtime-health | full_chain | Что такое runtime health? | ENTITY_EXPLAIN | D0_DOC_CHUNKS:6, D1_DOCUMENT_CATALOG:6, D3_ENTITY_CATALOG:8, D5_RELATION_GRAPH:6 | 5165 | ✓ | +| full_chain_docs_intents_v2.yaml | docs-v2-entity-worker-status | full_chain | Объясни сущность WorkerStatus | ENTITY_EXPLAIN | D0_DOC_CHUNKS:1, D1_DOCUMENT_CATALOG:1, D3_ENTITY_CATALOG:2 | 737 | ✓ | +| full_chain_docs_intents_v2.yaml | docs-v2-related-docs-health | full_chain | Какие документы связаны с endpoint /health? | RELATED_DOCS_EXPLAIN | D0_DOC_CHUNKS:6, D5_RELATION_GRAPH:8 | 2098 | ✓ | +| full_chain_docs_intents_v2.yaml | docs-v2-related-docs-architecture-overview | full_chain | Какие дочерние документы есть у overview архитектуры сервиса? | RELATED_DOCS_EXPLAIN | D0_DOC_CHUNKS:2, D5_RELATION_GRAPH:3 | 908 | ✓ | +| full_chain_docs_intents_v2.yaml | docs-v2-openapi-health | full_chain | Сгенерируй OpenAPI для endpoint /health по документации | OPENAPI_METHOD_GENERATE | D1_DOCUMENT_CATALOG:1 | 783 | ✓ | +| full_chain_docs_intents_v2.yaml | docs-v2-openapi-fragment-send-request | full_chain | Сгенерируй request schema для endpoint /send | OPENAPI_FRAGMENT_GENERATE | D1_DOCUMENT_CATALOG:1 | 767 | ✓ | +| full_chain_docs_intents_v2.yaml | docs-v2-general-overview | full_chain | Что вообще описано в документации по этому сервису? | GENERIC_QA | D0_DOC_CHUNKS:8, D1_DOCUMENT_CATALOG:4 | 1984 | ✓ | +| full_chain_docs_intents_v2.yaml | docs-v2-negative-missing-entity | full_chain | Что такое сущность PaymentTransaction? | ENTITY_EXPLAIN | — | 144 | ✓ | \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/docs_pre_llm_v3/20260326_121025/full_chain_docs_intents_v3-3x_v3-api-health-1.json b/tests/pipeline_setup_v3/test_results/docs_pre_llm_v3/20260326_121025/full_chain_docs_intents_v3-3x_v3-api-health-1.json new file mode 100644 index 0000000..b674a0e --- /dev/null +++ b/tests/pipeline_setup_v3/test_results/docs_pre_llm_v3/20260326_121025/full_chain_docs_intents_v3-3x_v3-api-health-1.json @@ -0,0 +1,83 @@ +{ + "meta": { + "case_id": "v3-api-health-1", + "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_03_docs/full_chain_docs_intents_v3-3x.yaml", + "runner": "agent_runtime", + "mode": "pre_llm", + "passed": true, + "mismatches": [], + "actual": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "API_METHOD_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START", + "rag_count": 10, + "llm_answer": "", + "answer_mode": "answered", + "path_scope": [], + "doc_scope": [ + "api.health_endpoint" + ], + "entity_candidates": [], + "symbol_candidates": [], + "layers": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D4_WORKFLOW_INDEX", + "D0_DOC_CHUNKS" + ], + "filters": { + "doc_type": "api_method" + }, + "pipeline_mode": "pre_llm_only", + "gate_decision": "allow", + "prompt_used": "docs_explain_answer", + "llm_mode": "prose", + "degraded_reason": null, + "code_intents_stubbed": true + } + }, + "pipeline_steps": [ + { + "step": "input_query", + "input": { + "query": "Что делает /health?" + }, + "output": { + "query": "Что делает /health?" + } + }, + { + "step": "router", + "input": { + "query": "Что делает /health?" + }, + "output": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "API_METHOD_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START" + } + }, + { + "step": "docs_pipeline", + "input": { + "query": "Что делает /health?" + }, + "output": { + "answer_mode": "ready", + "prompt_name": "docs_explain_answer", + "llm_request": { + "prompt_name": "docs_explain_answer", + "log_context": "graph.project_qa.docs.answer", + "prompt_stats": { + "system_chars": 393, + "user_chars": 4201, + "tokens_in_estimate": 1149 + } + }, + "degraded_reason": "" + } + } + ] +} \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/docs_pre_llm_v3/20260326_121025/full_chain_docs_intents_v3-3x_v3-api-health-1.md b/tests/pipeline_setup_v3/test_results/docs_pre_llm_v3/20260326_121025/full_chain_docs_intents_v3-3x_v3-api-health-1.md new file mode 100644 index 0000000..c41cdc2 --- /dev/null +++ b/tests/pipeline_setup_v3/test_results/docs_pre_llm_v3/20260326_121025/full_chain_docs_intents_v3-3x_v3-api-health-1.md @@ -0,0 +1,429 @@ +# v3-api-health-1 + +- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_03_docs/full_chain_docs_intents_v3-3x.yaml +- runner: agent_runtime +- mode: pre_llm +- passed: True + +## Query +Что делает /health? + +## Actual +{ + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "API_METHOD_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START", + "rag_count": 10, + "llm_answer": "", + "answer_mode": "answered", + "path_scope": [], + "doc_scope": [ + "api.health_endpoint" + ], + "entity_candidates": [], + "symbol_candidates": [], + "layers": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D4_WORKFLOW_INDEX", + "D0_DOC_CHUNKS" + ], + "filters": { + "doc_type": "api_method" + }, + "pipeline_mode": "pre_llm_only", + "gate_decision": "allow", + "prompt_used": "docs_explain_answer", + "llm_mode": "prose", + "degraded_reason": null, + "code_intents_stubbed": true +} + +## Pipeline Steps +### input_query +```json +{ + "input": { + "query": "Что делает /health?" + }, + "output": { + "query": "Что делает /health?" + } +} +``` + +### router +```json +{ + "input": { + "query": "Что делает /health?" + }, + "output": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "API_METHOD_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START" + } +} +``` + +### docs_pipeline +```json +{ + "input": { + "query": "Что делает /health?" + }, + "output": { + "answer_mode": "ready", + "prompt_name": "docs_explain_answer", + "llm_request": { + "prompt_name": "docs_explain_answer", + "log_context": "graph.project_qa.docs.answer", + "prompt_stats": { + "system_chars": 393, + "user_chars": 4201, + "tokens_in_estimate": 1149 + } + }, + "degraded_reason": "" + } +} +``` + +## Diagnostics +{ + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "API_METHOD_EXPLAIN", + "layers_used": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D4_WORKFLOW_INDEX", + "D0_DOC_CHUNKS" + ], + "documents_found": 1, + "facts_found": 2, + "relations_found": 0, + "openapi_fields_extracted": 0, + "missing_required_fields": [], + "openapi_status": { + "has_path": false, + "has_method": false, + "has_request": false, + "has_response": false + }, + "prompt_used": "docs_explain_answer", + "llm_mode": "prose", + "output_valid": true, + "matched_intent_source": "deterministic", + "matched_anchor_type": "endpoint", + "matched_anchor_value": "/health", + "exact_anchor_match": true, + "docs_layers_requested": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D4_WORKFLOW_INDEX", + "D0_DOC_CHUNKS" + ], + "docs_layers_with_hits": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D4_WORKFLOW_INDEX", + "D0_DOC_CHUNKS" + ], + "planned_layers": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D4_WORKFLOW_INDEX", + "D0_DOC_CHUNKS" + ], + "executed_layers": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D4_WORKFLOW_INDEX", + "D0_DOC_CHUNKS" + ], + "non_empty_layers": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D4_WORKFLOW_INDEX", + "D0_DOC_CHUNKS" + ], + "layer_diagnostics": { + "D1_DOCUMENT_CATALOG": { + "hits": 6, + "top_ids": [ + "domain.runtime_health", + "api.health_endpoint", + "docs/README.md", + "architecture.telegram_notify_app", + "logic.telegram_notification_loop" + ] + }, + "D2_FACT_INDEX": { + "hits": 8, + "top_ids": [ + "1cff54331a52b7a92946e7afabe7e45d7e3ec693b59546f9666e494396593bc3", + "0d923b02d15cef527d51740b7a09378a7dc74fb58db27cd059a8658ad11601a5", + "3d3b6fcc21144cb68657be099291db0ae36d61d32d6d72fd5b7c3cb81f379877", + "0b70cbff38a527cecfb53d3f72d573e9da1826cc75bd4cb92357e1de10988204", + "ce6d44c30418b0b171433a144f78d4bbf53b7a060d9b7cd42b9feecc8ca3044e" + ] + }, + "D4_WORKFLOW_INDEX": { + "hits": 3, + "top_ids": [ + "api.health_endpoint", + "api.control_actions_endpoint", + "api.send_message_endpoint" + ] + }, + "D0_DOC_CHUNKS": { + "hits": 6, + "top_ids": [ + "api.health_endpoint" + ] + } + }, + "query_entity_candidates": [], + "resolved_entity_candidates": [], + "query_anchor_candidates": [ + "/health" + ], + "resolved_anchor_candidates": [ + "api.health_endpoint", + "docs/documentation/api/health-endpoint.md" + ], + "anchor_candidates": [], + "selected_anchor": null, + "anchor_selection_reason": "", + "anchor_match_type": "", + "doc_ids": [ + "api.health_endpoint" + ], + "doc_paths": [ + "docs/documentation/api/health-endpoint.md" + ], + "doc_titles": [ + "HTTP API /health", + "Scenario", + "api.health_endpoint:Сценарий", + "api.health_endpoint:workflow_step", + "api.health_endpoint:mentions_entity", + "api.health_endpoint:Нефункциональные требования", + "api.health_endpoint:Summary", + "api.health_endpoint:Описание", + "api.health_endpoint:Функциональные требования", + "api.health_endpoint:Входные параметры" + ], + "relation_hits_count": 0, + "relation_targets": [], + "fallback_doc_hits_count": 7, + "fallback_used": false, + "fact_hits": 2, + "entity_hits": 0, + "evidence_summary": { + "documents": 1, + "facts": 2, + "relations": 0, + "chunks": 6, + "entity_hits": 0, + "openapi_signals": { + "path_found": false, + "method_found": false, + "request_schema": false, + "response_schema": false, + "status_codes": false, + "payload_description": false + } + }, + "gate_decision": "allow", + "gate_decision_reason": "evidence_sufficient", + "gate_missing_requirements": [], + "gate_satisfied_requirements": [ + "retrieval_non_empty", + "exact_anchor_match" + ], + "openapi_evidence": { + "path_found": false, + "method_found": false, + "request_schema": false, + "response_schema": false, + "status_codes": false, + "payload_description": false + }, + "requested_fragment_type": null, + "fragment_evidence_found": [], + "fragment_missing_requirements": [], + "answer_mode": "ready", + "degrade_reason": null, + "degraded_reason": null, + "code_intents_stubbed": false +} + +## LLM Request +- prompt_name: docs_explain_answer +- log_context: graph.project_qa.docs.answer + +### Prompt Stats +```json +{ + "system_chars": 393, + "user_chars": 4201, + "tokens_in_estimate": 1149 +} +``` + +### System Prompt +```text +Ты объясняешь документацию системы. + +На вход приходит JSON с полями: +- question +- intent +- sub_intent +- documents +- facts +- relations + +Правила: +- Используй только предоставленные факты +- Не додумывай +- Если данных недостаточно, скажи это явно +- Объясняй структурировано + +Формат ответа: +1. Краткое описание +2. Основные элементы +3. Как это работает +4. Связи с другими частями системы (если есть) +``` + +### User Prompt +```json +{ + "question": "Что делает /health?", + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "API_METHOD_EXPLAIN", + "documents": [ + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/api/health-endpoint.md", + "title": "HTTP API /health", + "content": "Endpoint `/health` возвращает агрегированный health payload runtime. Если общий статус равен `ok`, API отвечает с HTTP 200; для состояний деградации или неготовности возвращается HTTP 503 с тем же payload. Endpoint служит основной точкой внешней проверки состояния приложения.", + "metadata": { + "name": "health_endpoint", + "tags": [ + "api", + "health", + "control-plane" + ], + "type": "api_method", + "layer": "application", + "links": [ + { + "type": "part_of", + "target": "architecture.telegram_notify_app" + }, + { + "type": "depends_on", + "target": "domain.runtime_health" + } + ], + "owner": null, + "title": "HTTP API /health", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "architecture.telegram_notify_app", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "8b5a533a8076e2e9d36995eee29aeade260080bdca2ec8e21fe28f08574b983f", + "children": [], + "doc_kind": "misc", + "entities": [ + "TelegramControlChannel", + "TelegramNotifyWorker", + "RuntimeManager", + "WorkerHealth" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "api.health_endpoint", + "source_path": "docs/documentation/api/health-endpoint.md", + "summary_text": "Endpoint `/health` возвращает агрегированный health payload runtime. Если общий статус равен `ok`, API отвечает с HTTP 200; для состояний деградации или неготовности возвращается HTTP 503 с тем же payload. Endpoint служит основной точкой внешней проверки состояния приложения.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + } + ], + "facts": [ + { + "layer": "D2_FACT_INDEX", + "path": "docs/documentation/api/health-endpoint.md", + "title": "api.health_endpoint:workflow_step", + "content": "api.health_endpoint workflow_step Предусловия:**", + "metadata": { + "tags": [], + "owner": null, + "anchor": "Сценарий", + "doc_id": null, + "object": "Предусловия:**", + "fact_id": "1cff54331a52b7a92946e7afabe7e45d7e3ec693b59546f9666e494396593bc3", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "8b5a533a8076e2e9d36995eee29aeade260080bdca2ec8e21fe28f08574b983f", + "predicate": "workflow_step", + "object_ref": null, + "subject_id": "api.health_endpoint", + "doc_version": null, + "source_path": "docs/documentation/api/health-endpoint.md", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D2_FACT_INDEX", + "path": "docs/documentation/api/health-endpoint.md", + "title": "api.health_endpoint:mentions_entity", + "content": "api.health_endpoint mentions_entity TelegramControlChannel", + "metadata": { + "tags": [], + "owner": null, + "anchor": "frontmatter.entities", + "doc_id": null, + "object": "TelegramControlChannel", + "fact_id": "3d3b6fcc21144cb68657be099291db0ae36d61d32d6d72fd5b7c3cb81f379877", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "8b5a533a8076e2e9d36995eee29aeade260080bdca2ec8e21fe28f08574b983f", + "predicate": "mentions_entity", + "object_ref": null, + "subject_id": "api.health_endpoint", + "doc_version": null, + "source_path": "docs/documentation/api/health-endpoint.md", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + } + ], + "relations": [] +} +``` + +### User Prompt Overview +- question: Что делает /health? +- intent: DOCUMENTATION_EXPLAIN +- sub_intent: API_METHOD_EXPLAIN +- documents: 1 | samples: HTTP API /health +- facts: 2 | samples: api.health_endpoint:workflow_step, api.health_endpoint:mentions_entity +- relations: 0 + +## Mismatches +- none \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/docs_pre_llm_v3/20260326_121025/full_chain_docs_intents_v3-3x_v3-api-health-2.json b/tests/pipeline_setup_v3/test_results/docs_pre_llm_v3/20260326_121025/full_chain_docs_intents_v3-3x_v3-api-health-2.json new file mode 100644 index 0000000..60e1ea7 --- /dev/null +++ b/tests/pipeline_setup_v3/test_results/docs_pre_llm_v3/20260326_121025/full_chain_docs_intents_v3-3x_v3-api-health-2.json @@ -0,0 +1,90 @@ +{ + "meta": { + "case_id": "v3-api-health-2", + "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_03_docs/full_chain_docs_intents_v3-3x.yaml", + "runner": "agent_runtime", + "mode": "pre_llm", + "passed": true, + "mismatches": [], + "actual": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "API_METHOD_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START", + "rag_count": 17, + "llm_answer": "", + "answer_mode": "answered", + "path_scope": [], + "doc_scope": [ + "api.send_message_endpoint", + "api.control_actions_endpoint", + "api.actions_endpoint", + "api.health_endpoint", + "domain.runtime_health", + "architecture.telegram_notify_app", + "architecture.telegram_notify_app_overview", + "logic.telegram_notification_loop" + ], + "entity_candidates": [], + "symbol_candidates": [], + "layers": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D4_WORKFLOW_INDEX", + "D0_DOC_CHUNKS" + ], + "filters": { + "doc_type": "api_method" + }, + "pipeline_mode": "pre_llm_only", + "gate_decision": "allow", + "prompt_used": "docs_explain_answer", + "llm_mode": "prose", + "degraded_reason": null, + "code_intents_stubbed": true + } + }, + "pipeline_steps": [ + { + "step": "input_query", + "input": { + "query": "Как работает health endpoint?" + }, + "output": { + "query": "Как работает health endpoint?" + } + }, + { + "step": "router", + "input": { + "query": "Как работает health endpoint?" + }, + "output": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "API_METHOD_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START" + } + }, + { + "step": "docs_pipeline", + "input": { + "query": "Как работает health endpoint?" + }, + "output": { + "answer_mode": "ready", + "prompt_name": "docs_explain_answer", + "llm_request": { + "prompt_name": "docs_explain_answer", + "log_context": "graph.project_qa.docs.answer", + "prompt_stats": { + "system_chars": 393, + "user_chars": 16622, + "tokens_in_estimate": 4254 + } + }, + "degraded_reason": "" + } + } + ] +} \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/docs_pre_llm_v3/20260326_121025/full_chain_docs_intents_v3-3x_v3-api-health-2.md b/tests/pipeline_setup_v3/test_results/docs_pre_llm_v3/20260326_121025/full_chain_docs_intents_v3-3x_v3-api-health-2.md new file mode 100644 index 0000000..e70ceb1 --- /dev/null +++ b/tests/pipeline_setup_v3/test_results/docs_pre_llm_v3/20260326_121025/full_chain_docs_intents_v3-3x_v3-api-health-2.md @@ -0,0 +1,754 @@ +# v3-api-health-2 + +- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_03_docs/full_chain_docs_intents_v3-3x.yaml +- runner: agent_runtime +- mode: pre_llm +- passed: True + +## Query +Как работает health endpoint? + +## Actual +{ + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "API_METHOD_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START", + "rag_count": 17, + "llm_answer": "", + "answer_mode": "answered", + "path_scope": [], + "doc_scope": [ + "api.send_message_endpoint", + "api.control_actions_endpoint", + "api.actions_endpoint", + "api.health_endpoint", + "domain.runtime_health", + "architecture.telegram_notify_app", + "architecture.telegram_notify_app_overview", + "logic.telegram_notification_loop" + ], + "entity_candidates": [], + "symbol_candidates": [], + "layers": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D4_WORKFLOW_INDEX", + "D0_DOC_CHUNKS" + ], + "filters": { + "doc_type": "api_method" + }, + "pipeline_mode": "pre_llm_only", + "gate_decision": "allow", + "prompt_used": "docs_explain_answer", + "llm_mode": "prose", + "degraded_reason": null, + "code_intents_stubbed": true +} + +## Pipeline Steps +### input_query +```json +{ + "input": { + "query": "Как работает health endpoint?" + }, + "output": { + "query": "Как работает health endpoint?" + } +} +``` + +### router +```json +{ + "input": { + "query": "Как работает health endpoint?" + }, + "output": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "API_METHOD_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START" + } +} +``` + +### docs_pipeline +```json +{ + "input": { + "query": "Как работает health endpoint?" + }, + "output": { + "answer_mode": "ready", + "prompt_name": "docs_explain_answer", + "llm_request": { + "prompt_name": "docs_explain_answer", + "log_context": "graph.project_qa.docs.answer", + "prompt_stats": { + "system_chars": 393, + "user_chars": 16622, + "tokens_in_estimate": 4254 + } + }, + "degraded_reason": "" + } +} +``` + +## Diagnostics +{ + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "API_METHOD_EXPLAIN", + "layers_used": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D4_WORKFLOW_INDEX", + "D0_DOC_CHUNKS" + ], + "documents_found": 6, + "facts_found": 2, + "relations_found": 0, + "openapi_fields_extracted": 0, + "missing_required_fields": [], + "openapi_status": { + "has_path": false, + "has_method": false, + "has_request": false, + "has_response": false + }, + "prompt_used": "docs_explain_answer", + "llm_mode": "prose", + "output_valid": true, + "matched_intent_source": "deterministic", + "matched_anchor_type": "topic", + "matched_anchor_value": null, + "exact_anchor_match": false, + "docs_layers_requested": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D4_WORKFLOW_INDEX", + "D0_DOC_CHUNKS" + ], + "docs_layers_with_hits": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D4_WORKFLOW_INDEX", + "D0_DOC_CHUNKS" + ], + "planned_layers": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D4_WORKFLOW_INDEX", + "D0_DOC_CHUNKS" + ], + "executed_layers": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D4_WORKFLOW_INDEX", + "D0_DOC_CHUNKS" + ], + "non_empty_layers": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D4_WORKFLOW_INDEX", + "D0_DOC_CHUNKS" + ], + "layer_diagnostics": { + "D1_DOCUMENT_CATALOG": { + "hits": 6, + "top_ids": [ + "api.send_message_endpoint", + "api.control_actions_endpoint", + "api.health_endpoint", + "domain.runtime_health", + "architecture.telegram_notify_app" + ] + }, + "D2_FACT_INDEX": { + "hits": 8, + "top_ids": [ + "f85d982c272a2ee6baeadc433221a20e684cd8ef01cb4788d6f76d05ca56d6d0", + "b8e44c3adb74aaa6c91ae8815fa091289e58dd3990a3a1b63e850c62075aea75", + "b6bfad59b3bf00f199b5ef90c1208af19664de700413e7354468a93a4abaaa2f", + "a8a325e0815b3a2a870ba2825f3afb3f41056b4c091df4c3bb3418ffd20891dd", + "bafb867ffed41c9db637df98d6cd5f6722d7747bbebc6c03e6f0d0caf3b7f9f3" + ] + }, + "D4_WORKFLOW_INDEX": { + "hits": 3, + "top_ids": [ + "api.control_actions_endpoint", + "api.health_endpoint", + "api.send_message_endpoint" + ] + }, + "D0_DOC_CHUNKS": { + "hits": 6, + "top_ids": [ + "api.control_actions_endpoint" + ] + } + }, + "query_entity_candidates": [], + "resolved_entity_candidates": [], + "query_anchor_candidates": [], + "resolved_anchor_candidates": [ + "api.send_message_endpoint", + "docs/documentation/api/send-message-endpoint.md", + "api.control_actions_endpoint", + "docs/documentation/api/control-actions-endpoint.md", + "api.health_endpoint", + "docs/documentation/api/health-endpoint.md", + "domain.runtime_health", + "docs/documentation/domain/runtime-health-entity.md", + "architecture.telegram_notify_app", + "docs/documentation/architecture/telegram-notify-app-overview.md", + "logic.telegram_notification_loop", + "docs/documentation/logic/telegram-notification-loop.md" + ], + "anchor_candidates": [], + "selected_anchor": null, + "anchor_selection_reason": "", + "anchor_match_type": "", + "doc_ids": [ + "api.send_message_endpoint", + "api.control_actions_endpoint", + "api.actions_endpoint", + "api.health_endpoint", + "domain.runtime_health", + "architecture.telegram_notify_app", + "architecture.telegram_notify_app_overview", + "logic.telegram_notification_loop" + ], + "doc_paths": [ + "docs/documentation/api/send-message-endpoint.md", + "docs/documentation/api/control-actions-endpoint.md", + "docs/documentation/api/health-endpoint.md", + "docs/documentation/domain/runtime-health-entity.md", + "docs/documentation/architecture/telegram-notify-app-overview.md", + "docs/documentation/logic/telegram-notification-loop.md" + ], + "doc_titles": [ + "HTTP API /send", + "HTTP API /actions/{action}", + "HTTP API /health", + "Сущность runtime health", + "Архитектура Telegram Notify App", + "Цикл отправки уведомлений в Telegram", + "api.control_actions_endpoint:workflow_step", + "api.control_actions_endpoint:mentions_entity", + "Scenario", + "api.control_actions_endpoint:Функциональные требования", + "api.control_actions_endpoint:Нефункциональные требования", + "api.control_actions_endpoint:Сценарий", + "api.control_actions_endpoint:Summary", + "api.control_actions_endpoint:Описание", + "api.control_actions_endpoint:Входные параметры" + ], + "relation_hits_count": 0, + "relation_targets": [], + "fallback_doc_hits_count": 12, + "fallback_used": false, + "fact_hits": 2, + "entity_hits": 0, + "evidence_summary": { + "documents": 6, + "facts": 2, + "relations": 0, + "chunks": 6, + "entity_hits": 0, + "openapi_signals": { + "path_found": false, + "method_found": false, + "request_schema": false, + "response_schema": false, + "status_codes": false, + "payload_description": false + } + }, + "gate_decision": "allow", + "gate_decision_reason": "evidence_sufficient", + "gate_missing_requirements": [], + "gate_satisfied_requirements": [ + "retrieval_non_empty" + ], + "openapi_evidence": { + "path_found": false, + "method_found": false, + "request_schema": false, + "response_schema": false, + "status_codes": false, + "payload_description": false + }, + "requested_fragment_type": null, + "fragment_evidence_found": [], + "fragment_missing_requirements": [], + "answer_mode": "ready", + "degrade_reason": null, + "degraded_reason": null, + "code_intents_stubbed": false +} + +## LLM Request +- prompt_name: docs_explain_answer +- log_context: graph.project_qa.docs.answer + +### Prompt Stats +```json +{ + "system_chars": 393, + "user_chars": 16622, + "tokens_in_estimate": 4254 +} +``` + +### System Prompt +```text +Ты объясняешь документацию системы. + +На вход приходит JSON с полями: +- question +- intent +- sub_intent +- documents +- facts +- relations + +Правила: +- Используй только предоставленные факты +- Не додумывай +- Если данных недостаточно, скажи это явно +- Объясняй структурировано + +Формат ответа: +1. Краткое описание +2. Основные элементы +3. Как это работает +4. Связи с другими частями системы (если есть) +``` + +### User Prompt +```json +{ + "question": "Как работает health endpoint?", + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "API_METHOD_EXPLAIN", + "documents": [ + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/api/send-message-endpoint.md", + "title": "HTTP API /send", + "content": "Endpoint `/send` выполняет ручную отправку сообщения в Telegram через `TelegramSendService`. Он используется для операторской проверки доставки и для отправки уведомлений вне периодического worker loop. Endpoint работает поверх тех же credentials и того же delivery path, что и фоновая отправка.", + "metadata": { + "name": "send_message_endpoint", + "tags": [ + "api", + "telegram", + "manual-send" + ], + "type": "api_method", + "layer": "application", + "links": [ + { + "type": "part_of", + "target": "architecture.telegram_notify_app" + }, + { + "type": "depends_on", + "target": "logic.telegram_notification_loop" + } + ], + "owner": null, + "title": "HTTP API /send", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "architecture.telegram_notify_app", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "5fbf2e33510b0676a3a53b957a4569bd3c2c31fb7719546602c573421ccaa32d", + "children": [], + "doc_kind": "misc", + "entities": [ + "TelegramControlAppFactory", + "TelegramSendService", + "TelegramNotifyWorker" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "api.send_message_endpoint", + "source_path": "docs/documentation/api/send-message-endpoint.md", + "summary_text": "Endpoint `/send` выполняет ручную отправку сообщения в Telegram через `TelegramSendService`. Он используется для операторской проверки доставки и для отправки уведомлений вне периодического worker loop. Endpoint работает поверх тех же credentials и того же delivery path, что и фоновая отправка.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "HTTP API /actions/{action}", + "content": "Endpoint `/actions/{action}` управляет control actions runtime и поддерживает `start`, `stop` и `status`. Для долгих операций `start` и `stop` допускается ответ HTTP 202, если действие еще выполняется. Endpoint используется для operator-driven управления жизненным циклом worker'а через HTTP API.", + "metadata": { + "name": "control_actions_endpoint", + "tags": [ + "api", + "control-plane", + "lifecycle" + ], + "type": "api_method", + "layer": "application", + "links": [ + { + "type": "part_of", + "target": "architecture.telegram_notify_app" + }, + { + "type": "related_api", + "target": "api.health_endpoint" + }, + { + "type": "related_logic", + "target": "logic.telegram_notification_loop" + } + ], + "owner": null, + "title": "HTTP API /actions/{action}", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "architecture.telegram_notify_app", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "children": [], + "doc_kind": "misc", + "entities": [ + "TelegramControlChannel", + "ControlActionSet", + "JSONResponse" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "api.control_actions_endpoint", + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "summary_text": "Endpoint `/actions/{action}` управляет control actions runtime и поддерживает `start`, `stop` и `status`. Для долгих операций `start` и `stop` допускается ответ HTTP 202, если действие еще выполняется. Endpoint используется для operator-driven управления жизненным циклом worker'а через HTTP API.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/api/health-endpoint.md", + "title": "HTTP API /health", + "content": "Endpoint `/health` возвращает агрегированный health payload runtime. Если общий статус равен `ok`, API отвечает с HTTP 200; для состояний деградации или неготовности возвращается HTTP 503 с тем же payload. Endpoint служит основной точкой внешней проверки состояния приложения.", + "metadata": { + "name": "health_endpoint", + "tags": [ + "api", + "health", + "control-plane" + ], + "type": "api_method", + "layer": "application", + "links": [ + { + "type": "part_of", + "target": "architecture.telegram_notify_app" + }, + { + "type": "depends_on", + "target": "domain.runtime_health" + } + ], + "owner": null, + "title": "HTTP API /health", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "architecture.telegram_notify_app", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "8b5a533a8076e2e9d36995eee29aeade260080bdca2ec8e21fe28f08574b983f", + "children": [], + "doc_kind": "misc", + "entities": [ + "TelegramControlChannel", + "TelegramNotifyWorker", + "RuntimeManager", + "WorkerHealth" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "api.health_endpoint", + "source_path": "docs/documentation/api/health-endpoint.md", + "summary_text": "Endpoint `/health` возвращает агрегированный health payload runtime. Если общий статус равен `ok`, API отвечает с HTTP 200; для состояний деградации или неготовности возвращается HTTP 503 с тем же payload. Endpoint служит основной точкой внешней проверки состояния приложения.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/domain/runtime-health-entity.md", + "title": "Сущность runtime health", + "content": "`runtime health` — доменная модель наблюдаемости сервиса, которая описывает общее состояние runtime и состояние отдельных компонентов. Для `test_echo_app` главным объектом наблюдения является компонент `telegram_notify`, у которого важны статус, время старта и количество успешных отправок. Эта модель используется для внешнего health-monitoring и внутренней диагностики.", + "metadata": { + "name": "runtime_health", + "tags": [ + "domain", + "health", + "observability" + ], + "type": "domain_entity", + "layer": "domain", + "links": [ + { + "type": "part_of", + "target": "architecture.telegram_notify_app" + }, + { + "type": "used_by", + "target": "api.health_endpoint" + }, + { + "type": "related_logic", + "target": "logic.telegram_notification_loop" + } + ], + "owner": null, + "title": "Сущность runtime health", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "architecture.telegram_notify_app", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "37d4dcf470ea3de95d59e44786006e369a3ea11bf5dbf4c88877696e9183ee87", + "children": [], + "doc_kind": "misc", + "entities": [ + "WorkerHealth", + "WorkerStatus", + "TelegramNotifyWorker" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "domain.runtime_health", + "source_path": "docs/documentation/domain/runtime-health-entity.md", + "summary_text": "`runtime health` — доменная модель наблюдаемости сервиса, которая описывает общее состояние runtime и состояние отдельных компонентов. Для `test_echo_app` главным объектом наблюдения является компонент `telegram_notify`, у которого важны статус, время старта и количество успешных отправок. Эта модель используется для внешнего health-monitoring и внутренней диагностики.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/architecture/telegram-notify-app-overview.md", + "title": "Архитектура Telegram Notify App", + "content": "`test_echo_app` — сервис на базе PLBA runtime, который поднимает HTTP control plane и запускает фоновый воркер для периодической отправки уведомлений в Telegram. Приложение использует YAML-конфиг для runtime-настроек и переменные окружения для Telegram credentials. Основной контур системы состоит из runtime manager, control channel, send service и worker loop.", + "metadata": { + "name": "telegram_notify_app_overview", + "tags": [ + "architecture", + "telegram", + "plba", + "runtime" + ], + "type": "architecture_overview", + "layer": "system", + "links": [ + { + "type": "related_api", + "target": "api.health_endpoint" + }, + { + "type": "related_api", + "target": "api.control_actions_endpoint" + }, + { + "type": "related_api", + "target": "api.send_message_endpoint" + }, + { + "type": "depends_on", + "target": "logic.telegram_notification_loop" + }, + { + "type": "depends_on", + "target": "domain.runtime_health" + } + ], + "owner": null, + "title": "Архитектура Telegram Notify App", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "docs_root", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "8b1cc9f823e55bddbc825466d10a0fdb4ca4354ac02d91f9e2aef7b7d2ec8256", + "children": [ + "api.health_endpoint", + "api.control_actions_endpoint", + "api.send_message_endpoint", + "logic.telegram_notification_loop", + "domain.runtime_health" + ], + "doc_kind": "spec", + "entities": [ + "TelegramNotifyModule", + "TelegramNotifyWorker", + "TelegramControlChannel", + "TelegramSendService", + "RuntimeManager" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "architecture.telegram_notify_app", + "source_path": "docs/documentation/architecture/telegram-notify-app-overview.md", + "summary_text": "`test_echo_app` — сервис на базе PLBA runtime, который поднимает HTTP control plane и запускает фоновый воркер для периодической отправки уведомлений в Telegram. Приложение использует YAML-конфиг для runtime-настроек и переменные окружения для Telegram credentials. Основной контур системы состоит из runtime manager, control channel, send service и worker loop.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/logic/telegram-notification-loop.md", + "title": "Цикл отправки уведомлений в Telegram", + "content": "`TelegramNotifyWorker` после старта runtime запускает отдельный поток, сразу делает первую попытку отправки сообщения и затем повторяет отправку через заданный интервал. При ошибках доставки или отсутствии credentials worker не останавливает сервис, а переводит собственное состояние в `degraded`. Этот workflow определяет основной полезный цикл приложения.", + "metadata": { + "name": "telegram_notification_loop", + "tags": [ + "logic", + "telegram", + "worker", + "scheduling" + ], + "type": "logic_block", + "layer": "application", + "links": [ + { + "type": "part_of", + "target": "architecture.telegram_notify_app" + }, + { + "type": "related_api", + "target": "api.send_message_endpoint" + }, + { + "type": "related_api", + "target": "api.control_actions_endpoint" + }, + { + "type": "related_api", + "target": "api.health_endpoint" + } + ], + "owner": null, + "title": "Цикл отправки уведомлений в Telegram", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "architecture.telegram_notify_app", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "0f62f9b4dab261ca4ca34575ff5d84411a22c90b780c52eda388782b94f08470", + "children": [], + "doc_kind": "misc", + "entities": [ + "TelegramNotifyWorker", + "TelegramSendService", + "WorkerHealth", + "WorkerStatus" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "logic.telegram_notification_loop", + "source_path": "docs/documentation/logic/telegram-notification-loop.md", + "summary_text": "`TelegramNotifyWorker` после старта runtime запускает отдельный поток, сразу делает первую попытку отправки сообщения и затем повторяет отправку через заданный интервал. При ошибках доставки или отсутствии credentials worker не останавливает сервис, а переводит собственное состояние в `degraded`. Этот workflow определяет основной полезный цикл приложения.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + } + ], + "facts": [ + { + "layer": "D2_FACT_INDEX", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "api.control_actions_endpoint:workflow_step", + "content": "api.control_actions_endpoint workflow_step Название:** Выполнение control action runtime", + "metadata": { + "tags": [], + "owner": null, + "anchor": "Сценарий", + "doc_id": null, + "object": "Название:** Выполнение control action runtime", + "fact_id": "f85d982c272a2ee6baeadc433221a20e684cd8ef01cb4788d6f76d05ca56d6d0", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "predicate": "workflow_step", + "object_ref": null, + "subject_id": "api.control_actions_endpoint", + "doc_version": null, + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D2_FACT_INDEX", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "api.control_actions_endpoint:mentions_entity", + "content": "api.control_actions_endpoint mentions_entity JSONResponse", + "metadata": { + "tags": [], + "owner": null, + "anchor": "frontmatter.entities", + "doc_id": null, + "object": "JSONResponse", + "fact_id": "b6bfad59b3bf00f199b5ef90c1208af19664de700413e7354468a93a4abaaa2f", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "predicate": "mentions_entity", + "object_ref": null, + "subject_id": "api.control_actions_endpoint", + "doc_version": null, + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + } + ], + "relations": [] +} +``` + +### User Prompt Overview +- question: Как работает health endpoint? +- intent: DOCUMENTATION_EXPLAIN +- sub_intent: API_METHOD_EXPLAIN +- documents: 6 | samples: HTTP API /send, HTTP API /actions/{action}, HTTP API /health +- facts: 2 | samples: api.control_actions_endpoint:workflow_step, api.control_actions_endpoint:mentions_entity +- relations: 0 + +## Mismatches +- none \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/docs_pre_llm_v3/20260326_121025/full_chain_docs_intents_v3-3x_v3-api-health-3.json b/tests/pipeline_setup_v3/test_results/docs_pre_llm_v3/20260326_121025/full_chain_docs_intents_v3-3x_v3-api-health-3.json new file mode 100644 index 0000000..629070e --- /dev/null +++ b/tests/pipeline_setup_v3/test_results/docs_pre_llm_v3/20260326_121025/full_chain_docs_intents_v3-3x_v3-api-health-3.json @@ -0,0 +1,90 @@ +{ + "meta": { + "case_id": "v3-api-health-3", + "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_03_docs/full_chain_docs_intents_v3-3x.yaml", + "runner": "agent_runtime", + "mode": "pre_llm", + "passed": true, + "mismatches": [], + "actual": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "API_METHOD_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START", + "rag_count": 17, + "llm_answer": "", + "answer_mode": "answered", + "path_scope": [], + "doc_scope": [ + "api.send_message_endpoint", + "api.control_actions_endpoint", + "api.actions_endpoint", + "api.health_endpoint", + "domain.runtime_health", + "architecture.telegram_notify_app", + "architecture.telegram_notify_app_overview", + "logic.telegram_notification_loop" + ], + "entity_candidates": [], + "symbol_candidates": [], + "layers": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D4_WORKFLOW_INDEX", + "D0_DOC_CHUNKS" + ], + "filters": { + "doc_type": "api_method" + }, + "pipeline_mode": "pre_llm_only", + "gate_decision": "allow", + "prompt_used": "docs_explain_answer", + "llm_mode": "prose", + "degraded_reason": null, + "code_intents_stubbed": true + } + }, + "pipeline_steps": [ + { + "step": "input_query", + "input": { + "query": "Опиши endpoint health" + }, + "output": { + "query": "Опиши endpoint health" + } + }, + { + "step": "router", + "input": { + "query": "Опиши endpoint health" + }, + "output": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "API_METHOD_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START" + } + }, + { + "step": "docs_pipeline", + "input": { + "query": "Опиши endpoint health" + }, + "output": { + "answer_mode": "ready", + "prompt_name": "docs_explain_answer", + "llm_request": { + "prompt_name": "docs_explain_answer", + "log_context": "graph.project_qa.docs.answer", + "prompt_stats": { + "system_chars": 393, + "user_chars": 16614, + "tokens_in_estimate": 4252 + } + }, + "degraded_reason": "" + } + } + ] +} \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/docs_pre_llm_v3/20260326_121025/full_chain_docs_intents_v3-3x_v3-api-health-3.md b/tests/pipeline_setup_v3/test_results/docs_pre_llm_v3/20260326_121025/full_chain_docs_intents_v3-3x_v3-api-health-3.md new file mode 100644 index 0000000..46e7478 --- /dev/null +++ b/tests/pipeline_setup_v3/test_results/docs_pre_llm_v3/20260326_121025/full_chain_docs_intents_v3-3x_v3-api-health-3.md @@ -0,0 +1,754 @@ +# v3-api-health-3 + +- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_03_docs/full_chain_docs_intents_v3-3x.yaml +- runner: agent_runtime +- mode: pre_llm +- passed: True + +## Query +Опиши endpoint health + +## Actual +{ + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "API_METHOD_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START", + "rag_count": 17, + "llm_answer": "", + "answer_mode": "answered", + "path_scope": [], + "doc_scope": [ + "api.send_message_endpoint", + "api.control_actions_endpoint", + "api.actions_endpoint", + "api.health_endpoint", + "domain.runtime_health", + "architecture.telegram_notify_app", + "architecture.telegram_notify_app_overview", + "logic.telegram_notification_loop" + ], + "entity_candidates": [], + "symbol_candidates": [], + "layers": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D4_WORKFLOW_INDEX", + "D0_DOC_CHUNKS" + ], + "filters": { + "doc_type": "api_method" + }, + "pipeline_mode": "pre_llm_only", + "gate_decision": "allow", + "prompt_used": "docs_explain_answer", + "llm_mode": "prose", + "degraded_reason": null, + "code_intents_stubbed": true +} + +## Pipeline Steps +### input_query +```json +{ + "input": { + "query": "Опиши endpoint health" + }, + "output": { + "query": "Опиши endpoint health" + } +} +``` + +### router +```json +{ + "input": { + "query": "Опиши endpoint health" + }, + "output": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "API_METHOD_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START" + } +} +``` + +### docs_pipeline +```json +{ + "input": { + "query": "Опиши endpoint health" + }, + "output": { + "answer_mode": "ready", + "prompt_name": "docs_explain_answer", + "llm_request": { + "prompt_name": "docs_explain_answer", + "log_context": "graph.project_qa.docs.answer", + "prompt_stats": { + "system_chars": 393, + "user_chars": 16614, + "tokens_in_estimate": 4252 + } + }, + "degraded_reason": "" + } +} +``` + +## Diagnostics +{ + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "API_METHOD_EXPLAIN", + "layers_used": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D4_WORKFLOW_INDEX", + "D0_DOC_CHUNKS" + ], + "documents_found": 6, + "facts_found": 2, + "relations_found": 0, + "openapi_fields_extracted": 0, + "missing_required_fields": [], + "openapi_status": { + "has_path": false, + "has_method": false, + "has_request": false, + "has_response": false + }, + "prompt_used": "docs_explain_answer", + "llm_mode": "prose", + "output_valid": true, + "matched_intent_source": "deterministic", + "matched_anchor_type": "topic", + "matched_anchor_value": null, + "exact_anchor_match": false, + "docs_layers_requested": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D4_WORKFLOW_INDEX", + "D0_DOC_CHUNKS" + ], + "docs_layers_with_hits": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D4_WORKFLOW_INDEX", + "D0_DOC_CHUNKS" + ], + "planned_layers": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D4_WORKFLOW_INDEX", + "D0_DOC_CHUNKS" + ], + "executed_layers": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D4_WORKFLOW_INDEX", + "D0_DOC_CHUNKS" + ], + "non_empty_layers": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D4_WORKFLOW_INDEX", + "D0_DOC_CHUNKS" + ], + "layer_diagnostics": { + "D1_DOCUMENT_CATALOG": { + "hits": 6, + "top_ids": [ + "api.send_message_endpoint", + "api.control_actions_endpoint", + "api.health_endpoint", + "domain.runtime_health", + "architecture.telegram_notify_app" + ] + }, + "D2_FACT_INDEX": { + "hits": 8, + "top_ids": [ + "f85d982c272a2ee6baeadc433221a20e684cd8ef01cb4788d6f76d05ca56d6d0", + "b8e44c3adb74aaa6c91ae8815fa091289e58dd3990a3a1b63e850c62075aea75", + "b6bfad59b3bf00f199b5ef90c1208af19664de700413e7354468a93a4abaaa2f", + "a8a325e0815b3a2a870ba2825f3afb3f41056b4c091df4c3bb3418ffd20891dd", + "bafb867ffed41c9db637df98d6cd5f6722d7747bbebc6c03e6f0d0caf3b7f9f3" + ] + }, + "D4_WORKFLOW_INDEX": { + "hits": 3, + "top_ids": [ + "api.control_actions_endpoint", + "api.health_endpoint", + "api.send_message_endpoint" + ] + }, + "D0_DOC_CHUNKS": { + "hits": 6, + "top_ids": [ + "api.control_actions_endpoint" + ] + } + }, + "query_entity_candidates": [], + "resolved_entity_candidates": [], + "query_anchor_candidates": [], + "resolved_anchor_candidates": [ + "api.send_message_endpoint", + "docs/documentation/api/send-message-endpoint.md", + "api.control_actions_endpoint", + "docs/documentation/api/control-actions-endpoint.md", + "api.health_endpoint", + "docs/documentation/api/health-endpoint.md", + "domain.runtime_health", + "docs/documentation/domain/runtime-health-entity.md", + "architecture.telegram_notify_app", + "docs/documentation/architecture/telegram-notify-app-overview.md", + "logic.telegram_notification_loop", + "docs/documentation/logic/telegram-notification-loop.md" + ], + "anchor_candidates": [], + "selected_anchor": null, + "anchor_selection_reason": "", + "anchor_match_type": "", + "doc_ids": [ + "api.send_message_endpoint", + "api.control_actions_endpoint", + "api.actions_endpoint", + "api.health_endpoint", + "domain.runtime_health", + "architecture.telegram_notify_app", + "architecture.telegram_notify_app_overview", + "logic.telegram_notification_loop" + ], + "doc_paths": [ + "docs/documentation/api/send-message-endpoint.md", + "docs/documentation/api/control-actions-endpoint.md", + "docs/documentation/api/health-endpoint.md", + "docs/documentation/domain/runtime-health-entity.md", + "docs/documentation/architecture/telegram-notify-app-overview.md", + "docs/documentation/logic/telegram-notification-loop.md" + ], + "doc_titles": [ + "HTTP API /send", + "HTTP API /actions/{action}", + "HTTP API /health", + "Сущность runtime health", + "Архитектура Telegram Notify App", + "Цикл отправки уведомлений в Telegram", + "api.control_actions_endpoint:workflow_step", + "api.control_actions_endpoint:mentions_entity", + "Scenario", + "api.control_actions_endpoint:Функциональные требования", + "api.control_actions_endpoint:Нефункциональные требования", + "api.control_actions_endpoint:Сценарий", + "api.control_actions_endpoint:Summary", + "api.control_actions_endpoint:Описание", + "api.control_actions_endpoint:Входные параметры" + ], + "relation_hits_count": 0, + "relation_targets": [], + "fallback_doc_hits_count": 12, + "fallback_used": false, + "fact_hits": 2, + "entity_hits": 0, + "evidence_summary": { + "documents": 6, + "facts": 2, + "relations": 0, + "chunks": 6, + "entity_hits": 0, + "openapi_signals": { + "path_found": false, + "method_found": false, + "request_schema": false, + "response_schema": false, + "status_codes": false, + "payload_description": false + } + }, + "gate_decision": "allow", + "gate_decision_reason": "evidence_sufficient", + "gate_missing_requirements": [], + "gate_satisfied_requirements": [ + "retrieval_non_empty" + ], + "openapi_evidence": { + "path_found": false, + "method_found": false, + "request_schema": false, + "response_schema": false, + "status_codes": false, + "payload_description": false + }, + "requested_fragment_type": null, + "fragment_evidence_found": [], + "fragment_missing_requirements": [], + "answer_mode": "ready", + "degrade_reason": null, + "degraded_reason": null, + "code_intents_stubbed": false +} + +## LLM Request +- prompt_name: docs_explain_answer +- log_context: graph.project_qa.docs.answer + +### Prompt Stats +```json +{ + "system_chars": 393, + "user_chars": 16614, + "tokens_in_estimate": 4252 +} +``` + +### System Prompt +```text +Ты объясняешь документацию системы. + +На вход приходит JSON с полями: +- question +- intent +- sub_intent +- documents +- facts +- relations + +Правила: +- Используй только предоставленные факты +- Не додумывай +- Если данных недостаточно, скажи это явно +- Объясняй структурировано + +Формат ответа: +1. Краткое описание +2. Основные элементы +3. Как это работает +4. Связи с другими частями системы (если есть) +``` + +### User Prompt +```json +{ + "question": "Опиши endpoint health", + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "API_METHOD_EXPLAIN", + "documents": [ + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/api/send-message-endpoint.md", + "title": "HTTP API /send", + "content": "Endpoint `/send` выполняет ручную отправку сообщения в Telegram через `TelegramSendService`. Он используется для операторской проверки доставки и для отправки уведомлений вне периодического worker loop. Endpoint работает поверх тех же credentials и того же delivery path, что и фоновая отправка.", + "metadata": { + "name": "send_message_endpoint", + "tags": [ + "api", + "telegram", + "manual-send" + ], + "type": "api_method", + "layer": "application", + "links": [ + { + "type": "part_of", + "target": "architecture.telegram_notify_app" + }, + { + "type": "depends_on", + "target": "logic.telegram_notification_loop" + } + ], + "owner": null, + "title": "HTTP API /send", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "architecture.telegram_notify_app", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "5fbf2e33510b0676a3a53b957a4569bd3c2c31fb7719546602c573421ccaa32d", + "children": [], + "doc_kind": "misc", + "entities": [ + "TelegramControlAppFactory", + "TelegramSendService", + "TelegramNotifyWorker" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "api.send_message_endpoint", + "source_path": "docs/documentation/api/send-message-endpoint.md", + "summary_text": "Endpoint `/send` выполняет ручную отправку сообщения в Telegram через `TelegramSendService`. Он используется для операторской проверки доставки и для отправки уведомлений вне периодического worker loop. Endpoint работает поверх тех же credentials и того же delivery path, что и фоновая отправка.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "HTTP API /actions/{action}", + "content": "Endpoint `/actions/{action}` управляет control actions runtime и поддерживает `start`, `stop` и `status`. Для долгих операций `start` и `stop` допускается ответ HTTP 202, если действие еще выполняется. Endpoint используется для operator-driven управления жизненным циклом worker'а через HTTP API.", + "metadata": { + "name": "control_actions_endpoint", + "tags": [ + "api", + "control-plane", + "lifecycle" + ], + "type": "api_method", + "layer": "application", + "links": [ + { + "type": "part_of", + "target": "architecture.telegram_notify_app" + }, + { + "type": "related_api", + "target": "api.health_endpoint" + }, + { + "type": "related_logic", + "target": "logic.telegram_notification_loop" + } + ], + "owner": null, + "title": "HTTP API /actions/{action}", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "architecture.telegram_notify_app", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "children": [], + "doc_kind": "misc", + "entities": [ + "TelegramControlChannel", + "ControlActionSet", + "JSONResponse" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "api.control_actions_endpoint", + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "summary_text": "Endpoint `/actions/{action}` управляет control actions runtime и поддерживает `start`, `stop` и `status`. Для долгих операций `start` и `stop` допускается ответ HTTP 202, если действие еще выполняется. Endpoint используется для operator-driven управления жизненным циклом worker'а через HTTP API.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/api/health-endpoint.md", + "title": "HTTP API /health", + "content": "Endpoint `/health` возвращает агрегированный health payload runtime. Если общий статус равен `ok`, API отвечает с HTTP 200; для состояний деградации или неготовности возвращается HTTP 503 с тем же payload. Endpoint служит основной точкой внешней проверки состояния приложения.", + "metadata": { + "name": "health_endpoint", + "tags": [ + "api", + "health", + "control-plane" + ], + "type": "api_method", + "layer": "application", + "links": [ + { + "type": "part_of", + "target": "architecture.telegram_notify_app" + }, + { + "type": "depends_on", + "target": "domain.runtime_health" + } + ], + "owner": null, + "title": "HTTP API /health", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "architecture.telegram_notify_app", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "8b5a533a8076e2e9d36995eee29aeade260080bdca2ec8e21fe28f08574b983f", + "children": [], + "doc_kind": "misc", + "entities": [ + "TelegramControlChannel", + "TelegramNotifyWorker", + "RuntimeManager", + "WorkerHealth" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "api.health_endpoint", + "source_path": "docs/documentation/api/health-endpoint.md", + "summary_text": "Endpoint `/health` возвращает агрегированный health payload runtime. Если общий статус равен `ok`, API отвечает с HTTP 200; для состояний деградации или неготовности возвращается HTTP 503 с тем же payload. Endpoint служит основной точкой внешней проверки состояния приложения.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/domain/runtime-health-entity.md", + "title": "Сущность runtime health", + "content": "`runtime health` — доменная модель наблюдаемости сервиса, которая описывает общее состояние runtime и состояние отдельных компонентов. Для `test_echo_app` главным объектом наблюдения является компонент `telegram_notify`, у которого важны статус, время старта и количество успешных отправок. Эта модель используется для внешнего health-monitoring и внутренней диагностики.", + "metadata": { + "name": "runtime_health", + "tags": [ + "domain", + "health", + "observability" + ], + "type": "domain_entity", + "layer": "domain", + "links": [ + { + "type": "part_of", + "target": "architecture.telegram_notify_app" + }, + { + "type": "used_by", + "target": "api.health_endpoint" + }, + { + "type": "related_logic", + "target": "logic.telegram_notification_loop" + } + ], + "owner": null, + "title": "Сущность runtime health", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "architecture.telegram_notify_app", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "37d4dcf470ea3de95d59e44786006e369a3ea11bf5dbf4c88877696e9183ee87", + "children": [], + "doc_kind": "misc", + "entities": [ + "WorkerHealth", + "WorkerStatus", + "TelegramNotifyWorker" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "domain.runtime_health", + "source_path": "docs/documentation/domain/runtime-health-entity.md", + "summary_text": "`runtime health` — доменная модель наблюдаемости сервиса, которая описывает общее состояние runtime и состояние отдельных компонентов. Для `test_echo_app` главным объектом наблюдения является компонент `telegram_notify`, у которого важны статус, время старта и количество успешных отправок. Эта модель используется для внешнего health-monitoring и внутренней диагностики.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/architecture/telegram-notify-app-overview.md", + "title": "Архитектура Telegram Notify App", + "content": "`test_echo_app` — сервис на базе PLBA runtime, который поднимает HTTP control plane и запускает фоновый воркер для периодической отправки уведомлений в Telegram. Приложение использует YAML-конфиг для runtime-настроек и переменные окружения для Telegram credentials. Основной контур системы состоит из runtime manager, control channel, send service и worker loop.", + "metadata": { + "name": "telegram_notify_app_overview", + "tags": [ + "architecture", + "telegram", + "plba", + "runtime" + ], + "type": "architecture_overview", + "layer": "system", + "links": [ + { + "type": "related_api", + "target": "api.health_endpoint" + }, + { + "type": "related_api", + "target": "api.control_actions_endpoint" + }, + { + "type": "related_api", + "target": "api.send_message_endpoint" + }, + { + "type": "depends_on", + "target": "logic.telegram_notification_loop" + }, + { + "type": "depends_on", + "target": "domain.runtime_health" + } + ], + "owner": null, + "title": "Архитектура Telegram Notify App", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "docs_root", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "8b1cc9f823e55bddbc825466d10a0fdb4ca4354ac02d91f9e2aef7b7d2ec8256", + "children": [ + "api.health_endpoint", + "api.control_actions_endpoint", + "api.send_message_endpoint", + "logic.telegram_notification_loop", + "domain.runtime_health" + ], + "doc_kind": "spec", + "entities": [ + "TelegramNotifyModule", + "TelegramNotifyWorker", + "TelegramControlChannel", + "TelegramSendService", + "RuntimeManager" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "architecture.telegram_notify_app", + "source_path": "docs/documentation/architecture/telegram-notify-app-overview.md", + "summary_text": "`test_echo_app` — сервис на базе PLBA runtime, который поднимает HTTP control plane и запускает фоновый воркер для периодической отправки уведомлений в Telegram. Приложение использует YAML-конфиг для runtime-настроек и переменные окружения для Telegram credentials. Основной контур системы состоит из runtime manager, control channel, send service и worker loop.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/logic/telegram-notification-loop.md", + "title": "Цикл отправки уведомлений в Telegram", + "content": "`TelegramNotifyWorker` после старта runtime запускает отдельный поток, сразу делает первую попытку отправки сообщения и затем повторяет отправку через заданный интервал. При ошибках доставки или отсутствии credentials worker не останавливает сервис, а переводит собственное состояние в `degraded`. Этот workflow определяет основной полезный цикл приложения.", + "metadata": { + "name": "telegram_notification_loop", + "tags": [ + "logic", + "telegram", + "worker", + "scheduling" + ], + "type": "logic_block", + "layer": "application", + "links": [ + { + "type": "part_of", + "target": "architecture.telegram_notify_app" + }, + { + "type": "related_api", + "target": "api.send_message_endpoint" + }, + { + "type": "related_api", + "target": "api.control_actions_endpoint" + }, + { + "type": "related_api", + "target": "api.health_endpoint" + } + ], + "owner": null, + "title": "Цикл отправки уведомлений в Telegram", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "architecture.telegram_notify_app", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "0f62f9b4dab261ca4ca34575ff5d84411a22c90b780c52eda388782b94f08470", + "children": [], + "doc_kind": "misc", + "entities": [ + "TelegramNotifyWorker", + "TelegramSendService", + "WorkerHealth", + "WorkerStatus" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "logic.telegram_notification_loop", + "source_path": "docs/documentation/logic/telegram-notification-loop.md", + "summary_text": "`TelegramNotifyWorker` после старта runtime запускает отдельный поток, сразу делает первую попытку отправки сообщения и затем повторяет отправку через заданный интервал. При ошибках доставки или отсутствии credentials worker не останавливает сервис, а переводит собственное состояние в `degraded`. Этот workflow определяет основной полезный цикл приложения.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + } + ], + "facts": [ + { + "layer": "D2_FACT_INDEX", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "api.control_actions_endpoint:workflow_step", + "content": "api.control_actions_endpoint workflow_step Название:** Выполнение control action runtime", + "metadata": { + "tags": [], + "owner": null, + "anchor": "Сценарий", + "doc_id": null, + "object": "Название:** Выполнение control action runtime", + "fact_id": "f85d982c272a2ee6baeadc433221a20e684cd8ef01cb4788d6f76d05ca56d6d0", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "predicate": "workflow_step", + "object_ref": null, + "subject_id": "api.control_actions_endpoint", + "doc_version": null, + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D2_FACT_INDEX", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "api.control_actions_endpoint:mentions_entity", + "content": "api.control_actions_endpoint mentions_entity JSONResponse", + "metadata": { + "tags": [], + "owner": null, + "anchor": "frontmatter.entities", + "doc_id": null, + "object": "JSONResponse", + "fact_id": "b6bfad59b3bf00f199b5ef90c1208af19664de700413e7354468a93a4abaaa2f", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "predicate": "mentions_entity", + "object_ref": null, + "subject_id": "api.control_actions_endpoint", + "doc_version": null, + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + } + ], + "relations": [] +} +``` + +### User Prompt Overview +- question: Опиши endpoint health +- intent: DOCUMENTATION_EXPLAIN +- sub_intent: API_METHOD_EXPLAIN +- documents: 6 | samples: HTTP API /send, HTTP API /actions/{action}, HTTP API /health +- facts: 2 | samples: api.control_actions_endpoint:workflow_step, api.control_actions_endpoint:mentions_entity +- relations: 0 + +## Mismatches +- none \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/docs_pre_llm_v3/20260326_121025/full_chain_docs_intents_v3-3x_v3-api-send-1.json b/tests/pipeline_setup_v3/test_results/docs_pre_llm_v3/20260326_121025/full_chain_docs_intents_v3-3x_v3-api-send-1.json new file mode 100644 index 0000000..0b3a55b --- /dev/null +++ b/tests/pipeline_setup_v3/test_results/docs_pre_llm_v3/20260326_121025/full_chain_docs_intents_v3-3x_v3-api-send-1.json @@ -0,0 +1,83 @@ +{ + "meta": { + "case_id": "v3-api-send-1", + "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_03_docs/full_chain_docs_intents_v3-3x.yaml", + "runner": "agent_runtime", + "mode": "pre_llm", + "passed": true, + "mismatches": [], + "actual": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "API_METHOD_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START", + "rag_count": 10, + "llm_answer": "", + "answer_mode": "answered", + "path_scope": [], + "doc_scope": [ + "api.send_message_endpoint" + ], + "entity_candidates": [], + "symbol_candidates": [], + "layers": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D4_WORKFLOW_INDEX", + "D0_DOC_CHUNKS" + ], + "filters": { + "doc_type": "api_method" + }, + "pipeline_mode": "pre_llm_only", + "gate_decision": "allow", + "prompt_used": "docs_explain_answer", + "llm_mode": "prose", + "degraded_reason": null, + "code_intents_stubbed": true + } + }, + "pipeline_steps": [ + { + "step": "input_query", + "input": { + "query": "Что делает /send?" + }, + "output": { + "query": "Что делает /send?" + } + }, + { + "step": "router", + "input": { + "query": "Что делает /send?" + }, + "output": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "API_METHOD_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START" + } + }, + { + "step": "docs_pipeline", + "input": { + "query": "Что делает /send?" + }, + "output": { + "answer_mode": "ready", + "prompt_name": "docs_explain_answer", + "llm_request": { + "prompt_name": "docs_explain_answer", + "log_context": "graph.project_qa.docs.answer", + "prompt_stats": { + "system_chars": 393, + "user_chars": 4384, + "tokens_in_estimate": 1195 + } + }, + "degraded_reason": "" + } + } + ] +} \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/docs_pre_llm_v3/20260326_121025/full_chain_docs_intents_v3-3x_v3-api-send-1.md b/tests/pipeline_setup_v3/test_results/docs_pre_llm_v3/20260326_121025/full_chain_docs_intents_v3-3x_v3-api-send-1.md new file mode 100644 index 0000000..2ffaca9 --- /dev/null +++ b/tests/pipeline_setup_v3/test_results/docs_pre_llm_v3/20260326_121025/full_chain_docs_intents_v3-3x_v3-api-send-1.md @@ -0,0 +1,428 @@ +# v3-api-send-1 + +- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_03_docs/full_chain_docs_intents_v3-3x.yaml +- runner: agent_runtime +- mode: pre_llm +- passed: True + +## Query +Что делает /send? + +## Actual +{ + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "API_METHOD_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START", + "rag_count": 10, + "llm_answer": "", + "answer_mode": "answered", + "path_scope": [], + "doc_scope": [ + "api.send_message_endpoint" + ], + "entity_candidates": [], + "symbol_candidates": [], + "layers": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D4_WORKFLOW_INDEX", + "D0_DOC_CHUNKS" + ], + "filters": { + "doc_type": "api_method" + }, + "pipeline_mode": "pre_llm_only", + "gate_decision": "allow", + "prompt_used": "docs_explain_answer", + "llm_mode": "prose", + "degraded_reason": null, + "code_intents_stubbed": true +} + +## Pipeline Steps +### input_query +```json +{ + "input": { + "query": "Что делает /send?" + }, + "output": { + "query": "Что делает /send?" + } +} +``` + +### router +```json +{ + "input": { + "query": "Что делает /send?" + }, + "output": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "API_METHOD_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START" + } +} +``` + +### docs_pipeline +```json +{ + "input": { + "query": "Что делает /send?" + }, + "output": { + "answer_mode": "ready", + "prompt_name": "docs_explain_answer", + "llm_request": { + "prompt_name": "docs_explain_answer", + "log_context": "graph.project_qa.docs.answer", + "prompt_stats": { + "system_chars": 393, + "user_chars": 4384, + "tokens_in_estimate": 1195 + } + }, + "degraded_reason": "" + } +} +``` + +## Diagnostics +{ + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "API_METHOD_EXPLAIN", + "layers_used": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D4_WORKFLOW_INDEX", + "D0_DOC_CHUNKS" + ], + "documents_found": 1, + "facts_found": 2, + "relations_found": 0, + "openapi_fields_extracted": 0, + "missing_required_fields": [], + "openapi_status": { + "has_path": false, + "has_method": false, + "has_request": false, + "has_response": false + }, + "prompt_used": "docs_explain_answer", + "llm_mode": "prose", + "output_valid": true, + "matched_intent_source": "deterministic", + "matched_anchor_type": "endpoint", + "matched_anchor_value": "/send", + "exact_anchor_match": true, + "docs_layers_requested": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D4_WORKFLOW_INDEX", + "D0_DOC_CHUNKS" + ], + "docs_layers_with_hits": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D4_WORKFLOW_INDEX", + "D0_DOC_CHUNKS" + ], + "planned_layers": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D4_WORKFLOW_INDEX", + "D0_DOC_CHUNKS" + ], + "executed_layers": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D4_WORKFLOW_INDEX", + "D0_DOC_CHUNKS" + ], + "non_empty_layers": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D4_WORKFLOW_INDEX", + "D0_DOC_CHUNKS" + ], + "layer_diagnostics": { + "D1_DOCUMENT_CATALOG": { + "hits": 6, + "top_ids": [ + "api.send_message_endpoint", + "architecture.telegram_notify_app", + "api.control_actions_endpoint", + "api.health_endpoint", + "docs/README.md" + ] + }, + "D2_FACT_INDEX": { + "hits": 8, + "top_ids": [ + "6bf0a662808009874a108d0c97f7cca7fc4ff7a3a3d66e0947b31bf813cfdf4d", + "dc979c31d511a14d3af89f5f5c493fcfc0c9f2090dc16fb20ff874f4b3566221", + "149c4e0d3d34b3faba055b1495d54818fadc882af633da70035b82190c1bd327", + "480d85819e9298d4078f8a3bd6cfccb9c0fe2a03695b87f65f82f9aa8e2097b0", + "7aefee9ff6110088aad1891da66fc9085eb3f77d832605a3da565deecb96e850" + ] + }, + "D4_WORKFLOW_INDEX": { + "hits": 3, + "top_ids": [ + "api.send_message_endpoint", + "api.control_actions_endpoint", + "api.health_endpoint" + ] + }, + "D0_DOC_CHUNKS": { + "hits": 6, + "top_ids": [ + "api.send_message_endpoint" + ] + } + }, + "query_entity_candidates": [], + "resolved_entity_candidates": [], + "query_anchor_candidates": [ + "/send" + ], + "resolved_anchor_candidates": [ + "api.send_message_endpoint", + "docs/documentation/api/send-message-endpoint.md" + ], + "anchor_candidates": [], + "selected_anchor": null, + "anchor_selection_reason": "", + "anchor_match_type": "", + "doc_ids": [ + "api.send_message_endpoint" + ], + "doc_paths": [ + "docs/documentation/api/send-message-endpoint.md" + ], + "doc_titles": [ + "HTTP API /send", + "Scenario", + "api.send_message_endpoint:Сценарий", + "api.send_message_endpoint:workflow_step", + "api.send_message_endpoint:mentions_entity", + "api.send_message_endpoint:Нефункциональные требования", + "api.send_message_endpoint:Summary", + "api.send_message_endpoint:Описание", + "api.send_message_endpoint:Функциональные требования", + "api.send_message_endpoint:Входные параметры" + ], + "relation_hits_count": 0, + "relation_targets": [], + "fallback_doc_hits_count": 7, + "fallback_used": false, + "fact_hits": 2, + "entity_hits": 0, + "evidence_summary": { + "documents": 1, + "facts": 2, + "relations": 0, + "chunks": 6, + "entity_hits": 0, + "openapi_signals": { + "path_found": false, + "method_found": false, + "request_schema": false, + "response_schema": false, + "status_codes": false, + "payload_description": false + } + }, + "gate_decision": "allow", + "gate_decision_reason": "evidence_sufficient", + "gate_missing_requirements": [], + "gate_satisfied_requirements": [ + "retrieval_non_empty", + "exact_anchor_match" + ], + "openapi_evidence": { + "path_found": false, + "method_found": false, + "request_schema": false, + "response_schema": false, + "status_codes": false, + "payload_description": false + }, + "requested_fragment_type": null, + "fragment_evidence_found": [], + "fragment_missing_requirements": [], + "answer_mode": "ready", + "degrade_reason": null, + "degraded_reason": null, + "code_intents_stubbed": false +} + +## LLM Request +- prompt_name: docs_explain_answer +- log_context: graph.project_qa.docs.answer + +### Prompt Stats +```json +{ + "system_chars": 393, + "user_chars": 4384, + "tokens_in_estimate": 1195 +} +``` + +### System Prompt +```text +Ты объясняешь документацию системы. + +На вход приходит JSON с полями: +- question +- intent +- sub_intent +- documents +- facts +- relations + +Правила: +- Используй только предоставленные факты +- Не додумывай +- Если данных недостаточно, скажи это явно +- Объясняй структурировано + +Формат ответа: +1. Краткое описание +2. Основные элементы +3. Как это работает +4. Связи с другими частями системы (если есть) +``` + +### User Prompt +```json +{ + "question": "Что делает /send?", + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "API_METHOD_EXPLAIN", + "documents": [ + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/api/send-message-endpoint.md", + "title": "HTTP API /send", + "content": "Endpoint `/send` выполняет ручную отправку сообщения в Telegram через `TelegramSendService`. Он используется для операторской проверки доставки и для отправки уведомлений вне периодического worker loop. Endpoint работает поверх тех же credentials и того же delivery path, что и фоновая отправка.", + "metadata": { + "name": "send_message_endpoint", + "tags": [ + "api", + "telegram", + "manual-send" + ], + "type": "api_method", + "layer": "application", + "links": [ + { + "type": "part_of", + "target": "architecture.telegram_notify_app" + }, + { + "type": "depends_on", + "target": "logic.telegram_notification_loop" + } + ], + "owner": null, + "title": "HTTP API /send", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "architecture.telegram_notify_app", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "5fbf2e33510b0676a3a53b957a4569bd3c2c31fb7719546602c573421ccaa32d", + "children": [], + "doc_kind": "misc", + "entities": [ + "TelegramControlAppFactory", + "TelegramSendService", + "TelegramNotifyWorker" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "api.send_message_endpoint", + "source_path": "docs/documentation/api/send-message-endpoint.md", + "summary_text": "Endpoint `/send` выполняет ручную отправку сообщения в Telegram через `TelegramSendService`. Он используется для операторской проверки доставки и для отправки уведомлений вне периодического worker loop. Endpoint работает поверх тех же credentials и того же delivery path, что и фоновая отправка.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + } + ], + "facts": [ + { + "layer": "D2_FACT_INDEX", + "path": "docs/documentation/api/send-message-endpoint.md", + "title": "api.send_message_endpoint:workflow_step", + "content": "api.send_message_endpoint workflow_step Telegram credentials доступны в переменных окружения.", + "metadata": { + "tags": [], + "owner": null, + "anchor": "Сценарий", + "doc_id": null, + "object": "Telegram credentials доступны в переменных окружения.", + "fact_id": "6bf0a662808009874a108d0c97f7cca7fc4ff7a3a3d66e0947b31bf813cfdf4d", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "5fbf2e33510b0676a3a53b957a4569bd3c2c31fb7719546602c573421ccaa32d", + "predicate": "workflow_step", + "object_ref": null, + "subject_id": "api.send_message_endpoint", + "doc_version": null, + "source_path": "docs/documentation/api/send-message-endpoint.md", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D2_FACT_INDEX", + "path": "docs/documentation/api/send-message-endpoint.md", + "title": "api.send_message_endpoint:mentions_entity", + "content": "api.send_message_endpoint mentions_entity TelegramNotifyWorker", + "metadata": { + "tags": [], + "owner": null, + "anchor": "frontmatter.entities", + "doc_id": null, + "object": "TelegramNotifyWorker", + "fact_id": "149c4e0d3d34b3faba055b1495d54818fadc882af633da70035b82190c1bd327", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "5fbf2e33510b0676a3a53b957a4569bd3c2c31fb7719546602c573421ccaa32d", + "predicate": "mentions_entity", + "object_ref": null, + "subject_id": "api.send_message_endpoint", + "doc_version": null, + "source_path": "docs/documentation/api/send-message-endpoint.md", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + } + ], + "relations": [] +} +``` + +### User Prompt Overview +- question: Что делает /send? +- intent: DOCUMENTATION_EXPLAIN +- sub_intent: API_METHOD_EXPLAIN +- documents: 1 | samples: HTTP API /send +- facts: 2 | samples: api.send_message_endpoint:workflow_step, api.send_message_endpoint:mentions_entity +- relations: 0 + +## Mismatches +- none \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/docs_pre_llm_v3/20260326_121025/full_chain_docs_intents_v3-3x_v3-api-send-2.json b/tests/pipeline_setup_v3/test_results/docs_pre_llm_v3/20260326_121025/full_chain_docs_intents_v3-3x_v3-api-send-2.json new file mode 100644 index 0000000..bc6fd29 --- /dev/null +++ b/tests/pipeline_setup_v3/test_results/docs_pre_llm_v3/20260326_121025/full_chain_docs_intents_v3-3x_v3-api-send-2.json @@ -0,0 +1,90 @@ +{ + "meta": { + "case_id": "v3-api-send-2", + "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_03_docs/full_chain_docs_intents_v3-3x.yaml", + "runner": "agent_runtime", + "mode": "pre_llm", + "passed": true, + "mismatches": [], + "actual": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "API_METHOD_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START", + "rag_count": 17, + "llm_answer": "", + "answer_mode": "answered", + "path_scope": [], + "doc_scope": [ + "api.send_message_endpoint", + "api.control_actions_endpoint", + "api.actions_endpoint", + "api.health_endpoint", + "architecture.telegram_notify_app", + "architecture.telegram_notify_app_overview", + "docs/README.md", + "domain.runtime_health" + ], + "entity_candidates": [], + "symbol_candidates": [], + "layers": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D4_WORKFLOW_INDEX", + "D0_DOC_CHUNKS" + ], + "filters": { + "doc_type": "api_method" + }, + "pipeline_mode": "pre_llm_only", + "gate_decision": "allow", + "prompt_used": "docs_explain_answer", + "llm_mode": "prose", + "degraded_reason": null, + "code_intents_stubbed": true + } + }, + "pipeline_steps": [ + { + "step": "input_query", + "input": { + "query": "Как работает send endpoint?" + }, + "output": { + "query": "Как работает send endpoint?" + } + }, + { + "step": "router", + "input": { + "query": "Как работает send endpoint?" + }, + "output": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "API_METHOD_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START" + } + }, + { + "step": "docs_pipeline", + "input": { + "query": "Как работает send endpoint?" + }, + "output": { + "answer_mode": "ready", + "prompt_name": "docs_explain_answer", + "llm_request": { + "prompt_name": "docs_explain_answer", + "log_context": "graph.project_qa.docs.answer", + "prompt_stats": { + "system_chars": 393, + "user_chars": 14988, + "tokens_in_estimate": 3846 + } + }, + "degraded_reason": "" + } + } + ] +} \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/docs_pre_llm_v3/20260326_121025/full_chain_docs_intents_v3-3x_v3-api-send-2.md b/tests/pipeline_setup_v3/test_results/docs_pre_llm_v3/20260326_121025/full_chain_docs_intents_v3-3x_v3-api-send-2.md new file mode 100644 index 0000000..511691d --- /dev/null +++ b/tests/pipeline_setup_v3/test_results/docs_pre_llm_v3/20260326_121025/full_chain_docs_intents_v3-3x_v3-api-send-2.md @@ -0,0 +1,726 @@ +# v3-api-send-2 + +- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_03_docs/full_chain_docs_intents_v3-3x.yaml +- runner: agent_runtime +- mode: pre_llm +- passed: True + +## Query +Как работает send endpoint? + +## Actual +{ + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "API_METHOD_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START", + "rag_count": 17, + "llm_answer": "", + "answer_mode": "answered", + "path_scope": [], + "doc_scope": [ + "api.send_message_endpoint", + "api.control_actions_endpoint", + "api.actions_endpoint", + "api.health_endpoint", + "architecture.telegram_notify_app", + "architecture.telegram_notify_app_overview", + "docs/README.md", + "domain.runtime_health" + ], + "entity_candidates": [], + "symbol_candidates": [], + "layers": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D4_WORKFLOW_INDEX", + "D0_DOC_CHUNKS" + ], + "filters": { + "doc_type": "api_method" + }, + "pipeline_mode": "pre_llm_only", + "gate_decision": "allow", + "prompt_used": "docs_explain_answer", + "llm_mode": "prose", + "degraded_reason": null, + "code_intents_stubbed": true +} + +## Pipeline Steps +### input_query +```json +{ + "input": { + "query": "Как работает send endpoint?" + }, + "output": { + "query": "Как работает send endpoint?" + } +} +``` + +### router +```json +{ + "input": { + "query": "Как работает send endpoint?" + }, + "output": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "API_METHOD_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START" + } +} +``` + +### docs_pipeline +```json +{ + "input": { + "query": "Как работает send endpoint?" + }, + "output": { + "answer_mode": "ready", + "prompt_name": "docs_explain_answer", + "llm_request": { + "prompt_name": "docs_explain_answer", + "log_context": "graph.project_qa.docs.answer", + "prompt_stats": { + "system_chars": 393, + "user_chars": 14988, + "tokens_in_estimate": 3846 + } + }, + "degraded_reason": "" + } +} +``` + +## Diagnostics +{ + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "API_METHOD_EXPLAIN", + "layers_used": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D4_WORKFLOW_INDEX", + "D0_DOC_CHUNKS" + ], + "documents_found": 6, + "facts_found": 2, + "relations_found": 0, + "openapi_fields_extracted": 0, + "missing_required_fields": [], + "openapi_status": { + "has_path": false, + "has_method": false, + "has_request": false, + "has_response": false + }, + "prompt_used": "docs_explain_answer", + "llm_mode": "prose", + "output_valid": true, + "matched_intent_source": "deterministic", + "matched_anchor_type": "topic", + "matched_anchor_value": null, + "exact_anchor_match": false, + "docs_layers_requested": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D4_WORKFLOW_INDEX", + "D0_DOC_CHUNKS" + ], + "docs_layers_with_hits": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D4_WORKFLOW_INDEX", + "D0_DOC_CHUNKS" + ], + "planned_layers": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D4_WORKFLOW_INDEX", + "D0_DOC_CHUNKS" + ], + "executed_layers": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D4_WORKFLOW_INDEX", + "D0_DOC_CHUNKS" + ], + "non_empty_layers": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D4_WORKFLOW_INDEX", + "D0_DOC_CHUNKS" + ], + "layer_diagnostics": { + "D1_DOCUMENT_CATALOG": { + "hits": 6, + "top_ids": [ + "api.send_message_endpoint", + "api.control_actions_endpoint", + "api.health_endpoint", + "architecture.telegram_notify_app", + "docs/README.md" + ] + }, + "D2_FACT_INDEX": { + "hits": 8, + "top_ids": [ + "f85d982c272a2ee6baeadc433221a20e684cd8ef01cb4788d6f76d05ca56d6d0", + "b8e44c3adb74aaa6c91ae8815fa091289e58dd3990a3a1b63e850c62075aea75", + "bafb867ffed41c9db637df98d6cd5f6722d7747bbebc6c03e6f0d0caf3b7f9f3", + "54bbcbac242f1c85ec3280236ed5841998a8a3a548ff16cbf0b5acafbff469e3", + "b6bfad59b3bf00f199b5ef90c1208af19664de700413e7354468a93a4abaaa2f" + ] + }, + "D4_WORKFLOW_INDEX": { + "hits": 3, + "top_ids": [ + "api.control_actions_endpoint", + "api.health_endpoint", + "api.send_message_endpoint" + ] + }, + "D0_DOC_CHUNKS": { + "hits": 6, + "top_ids": [ + "api.control_actions_endpoint" + ] + } + }, + "query_entity_candidates": [], + "resolved_entity_candidates": [], + "query_anchor_candidates": [], + "resolved_anchor_candidates": [ + "api.send_message_endpoint", + "docs/documentation/api/send-message-endpoint.md", + "api.control_actions_endpoint", + "docs/documentation/api/control-actions-endpoint.md", + "api.health_endpoint", + "docs/documentation/api/health-endpoint.md", + "architecture.telegram_notify_app", + "docs/documentation/architecture/telegram-notify-app-overview.md", + "docs/README.md", + "domain.runtime_health", + "docs/documentation/domain/runtime-health-entity.md" + ], + "anchor_candidates": [], + "selected_anchor": null, + "anchor_selection_reason": "", + "anchor_match_type": "", + "doc_ids": [ + "api.send_message_endpoint", + "api.control_actions_endpoint", + "api.actions_endpoint", + "api.health_endpoint", + "architecture.telegram_notify_app", + "architecture.telegram_notify_app_overview", + "docs/README.md", + "domain.runtime_health" + ], + "doc_paths": [ + "docs/documentation/api/send-message-endpoint.md", + "docs/documentation/api/control-actions-endpoint.md", + "docs/documentation/api/health-endpoint.md", + "docs/documentation/architecture/telegram-notify-app-overview.md", + "docs/README.md", + "docs/documentation/domain/runtime-health-entity.md" + ], + "doc_titles": [ + "HTTP API /send", + "HTTP API /actions/{action}", + "HTTP API /health", + "Архитектура Telegram Notify App", + "Readme", + "Сущность runtime health", + "api.control_actions_endpoint:workflow_step", + "api.control_actions_endpoint:mentions_entity", + "Scenario", + "api.control_actions_endpoint:Функциональные требования", + "api.control_actions_endpoint:Нефункциональные требования", + "api.control_actions_endpoint:Сценарий", + "api.control_actions_endpoint:Summary", + "api.control_actions_endpoint:Описание", + "api.control_actions_endpoint:Входные параметры" + ], + "relation_hits_count": 0, + "relation_targets": [], + "fallback_doc_hits_count": 12, + "fallback_used": false, + "fact_hits": 2, + "entity_hits": 0, + "evidence_summary": { + "documents": 6, + "facts": 2, + "relations": 0, + "chunks": 6, + "entity_hits": 0, + "openapi_signals": { + "path_found": false, + "method_found": false, + "request_schema": false, + "response_schema": false, + "status_codes": false, + "payload_description": false + } + }, + "gate_decision": "allow", + "gate_decision_reason": "evidence_sufficient", + "gate_missing_requirements": [], + "gate_satisfied_requirements": [ + "retrieval_non_empty" + ], + "openapi_evidence": { + "path_found": false, + "method_found": false, + "request_schema": false, + "response_schema": false, + "status_codes": false, + "payload_description": false + }, + "requested_fragment_type": null, + "fragment_evidence_found": [], + "fragment_missing_requirements": [], + "answer_mode": "ready", + "degrade_reason": null, + "degraded_reason": null, + "code_intents_stubbed": false +} + +## LLM Request +- prompt_name: docs_explain_answer +- log_context: graph.project_qa.docs.answer + +### Prompt Stats +```json +{ + "system_chars": 393, + "user_chars": 14988, + "tokens_in_estimate": 3846 +} +``` + +### System Prompt +```text +Ты объясняешь документацию системы. + +На вход приходит JSON с полями: +- question +- intent +- sub_intent +- documents +- facts +- relations + +Правила: +- Используй только предоставленные факты +- Не додумывай +- Если данных недостаточно, скажи это явно +- Объясняй структурировано + +Формат ответа: +1. Краткое описание +2. Основные элементы +3. Как это работает +4. Связи с другими частями системы (если есть) +``` + +### User Prompt +```json +{ + "question": "Как работает send endpoint?", + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "API_METHOD_EXPLAIN", + "documents": [ + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/api/send-message-endpoint.md", + "title": "HTTP API /send", + "content": "Endpoint `/send` выполняет ручную отправку сообщения в Telegram через `TelegramSendService`. Он используется для операторской проверки доставки и для отправки уведомлений вне периодического worker loop. Endpoint работает поверх тех же credentials и того же delivery path, что и фоновая отправка.", + "metadata": { + "name": "send_message_endpoint", + "tags": [ + "api", + "telegram", + "manual-send" + ], + "type": "api_method", + "layer": "application", + "links": [ + { + "type": "part_of", + "target": "architecture.telegram_notify_app" + }, + { + "type": "depends_on", + "target": "logic.telegram_notification_loop" + } + ], + "owner": null, + "title": "HTTP API /send", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "architecture.telegram_notify_app", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "5fbf2e33510b0676a3a53b957a4569bd3c2c31fb7719546602c573421ccaa32d", + "children": [], + "doc_kind": "misc", + "entities": [ + "TelegramControlAppFactory", + "TelegramSendService", + "TelegramNotifyWorker" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "api.send_message_endpoint", + "source_path": "docs/documentation/api/send-message-endpoint.md", + "summary_text": "Endpoint `/send` выполняет ручную отправку сообщения в Telegram через `TelegramSendService`. Он используется для операторской проверки доставки и для отправки уведомлений вне периодического worker loop. Endpoint работает поверх тех же credentials и того же delivery path, что и фоновая отправка.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "HTTP API /actions/{action}", + "content": "Endpoint `/actions/{action}` управляет control actions runtime и поддерживает `start`, `stop` и `status`. Для долгих операций `start` и `stop` допускается ответ HTTP 202, если действие еще выполняется. Endpoint используется для operator-driven управления жизненным циклом worker'а через HTTP API.", + "metadata": { + "name": "control_actions_endpoint", + "tags": [ + "api", + "control-plane", + "lifecycle" + ], + "type": "api_method", + "layer": "application", + "links": [ + { + "type": "part_of", + "target": "architecture.telegram_notify_app" + }, + { + "type": "related_api", + "target": "api.health_endpoint" + }, + { + "type": "related_logic", + "target": "logic.telegram_notification_loop" + } + ], + "owner": null, + "title": "HTTP API /actions/{action}", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "architecture.telegram_notify_app", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "children": [], + "doc_kind": "misc", + "entities": [ + "TelegramControlChannel", + "ControlActionSet", + "JSONResponse" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "api.control_actions_endpoint", + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "summary_text": "Endpoint `/actions/{action}` управляет control actions runtime и поддерживает `start`, `stop` и `status`. Для долгих операций `start` и `stop` допускается ответ HTTP 202, если действие еще выполняется. Endpoint используется для operator-driven управления жизненным циклом worker'а через HTTP API.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/api/health-endpoint.md", + "title": "HTTP API /health", + "content": "Endpoint `/health` возвращает агрегированный health payload runtime. Если общий статус равен `ok`, API отвечает с HTTP 200; для состояний деградации или неготовности возвращается HTTP 503 с тем же payload. Endpoint служит основной точкой внешней проверки состояния приложения.", + "metadata": { + "name": "health_endpoint", + "tags": [ + "api", + "health", + "control-plane" + ], + "type": "api_method", + "layer": "application", + "links": [ + { + "type": "part_of", + "target": "architecture.telegram_notify_app" + }, + { + "type": "depends_on", + "target": "domain.runtime_health" + } + ], + "owner": null, + "title": "HTTP API /health", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "architecture.telegram_notify_app", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "8b5a533a8076e2e9d36995eee29aeade260080bdca2ec8e21fe28f08574b983f", + "children": [], + "doc_kind": "misc", + "entities": [ + "TelegramControlChannel", + "TelegramNotifyWorker", + "RuntimeManager", + "WorkerHealth" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "api.health_endpoint", + "source_path": "docs/documentation/api/health-endpoint.md", + "summary_text": "Endpoint `/health` возвращает агрегированный health payload runtime. Если общий статус равен `ok`, API отвечает с HTTP 200; для состояний деградации или неготовности возвращается HTTP 503 с тем же payload. Endpoint служит основной точкой внешней проверки состояния приложения.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/architecture/telegram-notify-app-overview.md", + "title": "Архитектура Telegram Notify App", + "content": "`test_echo_app` — сервис на базе PLBA runtime, который поднимает HTTP control plane и запускает фоновый воркер для периодической отправки уведомлений в Telegram. Приложение использует YAML-конфиг для runtime-настроек и переменные окружения для Telegram credentials. Основной контур системы состоит из runtime manager, control channel, send service и worker loop.", + "metadata": { + "name": "telegram_notify_app_overview", + "tags": [ + "architecture", + "telegram", + "plba", + "runtime" + ], + "type": "architecture_overview", + "layer": "system", + "links": [ + { + "type": "related_api", + "target": "api.health_endpoint" + }, + { + "type": "related_api", + "target": "api.control_actions_endpoint" + }, + { + "type": "related_api", + "target": "api.send_message_endpoint" + }, + { + "type": "depends_on", + "target": "logic.telegram_notification_loop" + }, + { + "type": "depends_on", + "target": "domain.runtime_health" + } + ], + "owner": null, + "title": "Архитектура Telegram Notify App", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "docs_root", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "8b1cc9f823e55bddbc825466d10a0fdb4ca4354ac02d91f9e2aef7b7d2ec8256", + "children": [ + "api.health_endpoint", + "api.control_actions_endpoint", + "api.send_message_endpoint", + "logic.telegram_notification_loop", + "domain.runtime_health" + ], + "doc_kind": "spec", + "entities": [ + "TelegramNotifyModule", + "TelegramNotifyWorker", + "TelegramControlChannel", + "TelegramSendService", + "RuntimeManager" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "architecture.telegram_notify_app", + "source_path": "docs/documentation/architecture/telegram-notify-app-overview.md", + "summary_text": "`test_echo_app` — сервис на базе PLBA runtime, который поднимает HTTP control plane и запускает фоновый воркер для периодической отправки уведомлений в Telegram. Приложение использует YAML-конфиг для runtime-настроек и переменные окружения для Telegram credentials. Основной контур системы состоит из runtime manager, control channel, send service и worker loop.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/README.md", + "title": "Readme", + "content": "Readme", + "metadata": { + "name": "", + "tags": [], + "type": "", + "layer": "", + "links": [], + "owner": null, + "title": "Readme", + "doc_id": null, + "module": "", + "parent": null, + "status": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "81d952f1a6ea85b76f75e0e57f33b8fa4b2bf3cb7db11b91b90171aeedd655a6", + "children": [], + "doc_kind": "readme", + "entities": [], + "updated_at": null, + "doc_version": null, + "document_id": "docs/README.md", + "source_path": "docs/README.md", + "summary_text": "", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/domain/runtime-health-entity.md", + "title": "Сущность runtime health", + "content": "`runtime health` — доменная модель наблюдаемости сервиса, которая описывает общее состояние runtime и состояние отдельных компонентов. Для `test_echo_app` главным объектом наблюдения является компонент `telegram_notify`, у которого важны статус, время старта и количество успешных отправок. Эта модель используется для внешнего health-monitoring и внутренней диагностики.", + "metadata": { + "name": "runtime_health", + "tags": [ + "domain", + "health", + "observability" + ], + "type": "domain_entity", + "layer": "domain", + "links": [ + { + "type": "part_of", + "target": "architecture.telegram_notify_app" + }, + { + "type": "used_by", + "target": "api.health_endpoint" + }, + { + "type": "related_logic", + "target": "logic.telegram_notification_loop" + } + ], + "owner": null, + "title": "Сущность runtime health", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "architecture.telegram_notify_app", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "37d4dcf470ea3de95d59e44786006e369a3ea11bf5dbf4c88877696e9183ee87", + "children": [], + "doc_kind": "misc", + "entities": [ + "WorkerHealth", + "WorkerStatus", + "TelegramNotifyWorker" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "domain.runtime_health", + "source_path": "docs/documentation/domain/runtime-health-entity.md", + "summary_text": "`runtime health` — доменная модель наблюдаемости сервиса, которая описывает общее состояние runtime и состояние отдельных компонентов. Для `test_echo_app` главным объектом наблюдения является компонент `telegram_notify`, у которого важны статус, время старта и количество успешных отправок. Эта модель используется для внешнего health-monitoring и внутренней диагностики.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + } + ], + "facts": [ + { + "layer": "D2_FACT_INDEX", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "api.control_actions_endpoint:workflow_step", + "content": "api.control_actions_endpoint workflow_step Название:** Выполнение control action runtime", + "metadata": { + "tags": [], + "owner": null, + "anchor": "Сценарий", + "doc_id": null, + "object": "Название:** Выполнение control action runtime", + "fact_id": "f85d982c272a2ee6baeadc433221a20e684cd8ef01cb4788d6f76d05ca56d6d0", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "predicate": "workflow_step", + "object_ref": null, + "subject_id": "api.control_actions_endpoint", + "doc_version": null, + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D2_FACT_INDEX", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "api.control_actions_endpoint:mentions_entity", + "content": "api.control_actions_endpoint mentions_entity ControlActionSet", + "metadata": { + "tags": [], + "owner": null, + "anchor": "frontmatter.entities", + "doc_id": null, + "object": "ControlActionSet", + "fact_id": "bafb867ffed41c9db637df98d6cd5f6722d7747bbebc6c03e6f0d0caf3b7f9f3", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "predicate": "mentions_entity", + "object_ref": null, + "subject_id": "api.control_actions_endpoint", + "doc_version": null, + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + } + ], + "relations": [] +} +``` + +### User Prompt Overview +- question: Как работает send endpoint? +- intent: DOCUMENTATION_EXPLAIN +- sub_intent: API_METHOD_EXPLAIN +- documents: 6 | samples: HTTP API /send, HTTP API /actions/{action}, HTTP API /health +- facts: 2 | samples: api.control_actions_endpoint:workflow_step, api.control_actions_endpoint:mentions_entity +- relations: 0 + +## Mismatches +- none \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/docs_pre_llm_v3/20260326_121025/full_chain_docs_intents_v3-3x_v3-api-send-3.json b/tests/pipeline_setup_v3/test_results/docs_pre_llm_v3/20260326_121025/full_chain_docs_intents_v3-3x_v3-api-send-3.json new file mode 100644 index 0000000..129b701 --- /dev/null +++ b/tests/pipeline_setup_v3/test_results/docs_pre_llm_v3/20260326_121025/full_chain_docs_intents_v3-3x_v3-api-send-3.json @@ -0,0 +1,90 @@ +{ + "meta": { + "case_id": "v3-api-send-3", + "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_03_docs/full_chain_docs_intents_v3-3x.yaml", + "runner": "agent_runtime", + "mode": "pre_llm", + "passed": true, + "mismatches": [], + "actual": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "API_METHOD_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START", + "rag_count": 17, + "llm_answer": "", + "answer_mode": "answered", + "path_scope": [], + "doc_scope": [ + "api.send_message_endpoint", + "api.control_actions_endpoint", + "api.actions_endpoint", + "api.health_endpoint", + "docs/README.md", + "architecture.telegram_notify_app", + "architecture.telegram_notify_app_overview", + "domain.runtime_health" + ], + "entity_candidates": [], + "symbol_candidates": [], + "layers": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D4_WORKFLOW_INDEX", + "D0_DOC_CHUNKS" + ], + "filters": { + "doc_type": "api_method" + }, + "pipeline_mode": "pre_llm_only", + "gate_decision": "allow", + "prompt_used": "docs_explain_answer", + "llm_mode": "prose", + "degraded_reason": null, + "code_intents_stubbed": true + } + }, + "pipeline_steps": [ + { + "step": "input_query", + "input": { + "query": "Опиши endpoint отправки сообщений" + }, + "output": { + "query": "Опиши endpoint отправки сообщений" + } + }, + { + "step": "router", + "input": { + "query": "Опиши endpoint отправки сообщений" + }, + "output": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "API_METHOD_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START" + } + }, + { + "step": "docs_pipeline", + "input": { + "query": "Опиши endpoint отправки сообщений" + }, + "output": { + "answer_mode": "ready", + "prompt_name": "docs_explain_answer", + "llm_request": { + "prompt_name": "docs_explain_answer", + "log_context": "graph.project_qa.docs.answer", + "prompt_stats": { + "system_chars": 393, + "user_chars": 14994, + "tokens_in_estimate": 3847 + } + }, + "degraded_reason": "" + } + } + ] +} \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/docs_pre_llm_v3/20260326_121025/full_chain_docs_intents_v3-3x_v3-api-send-3.md b/tests/pipeline_setup_v3/test_results/docs_pre_llm_v3/20260326_121025/full_chain_docs_intents_v3-3x_v3-api-send-3.md new file mode 100644 index 0000000..db5278d --- /dev/null +++ b/tests/pipeline_setup_v3/test_results/docs_pre_llm_v3/20260326_121025/full_chain_docs_intents_v3-3x_v3-api-send-3.md @@ -0,0 +1,726 @@ +# v3-api-send-3 + +- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_03_docs/full_chain_docs_intents_v3-3x.yaml +- runner: agent_runtime +- mode: pre_llm +- passed: True + +## Query +Опиши endpoint отправки сообщений + +## Actual +{ + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "API_METHOD_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START", + "rag_count": 17, + "llm_answer": "", + "answer_mode": "answered", + "path_scope": [], + "doc_scope": [ + "api.send_message_endpoint", + "api.control_actions_endpoint", + "api.actions_endpoint", + "api.health_endpoint", + "docs/README.md", + "architecture.telegram_notify_app", + "architecture.telegram_notify_app_overview", + "domain.runtime_health" + ], + "entity_candidates": [], + "symbol_candidates": [], + "layers": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D4_WORKFLOW_INDEX", + "D0_DOC_CHUNKS" + ], + "filters": { + "doc_type": "api_method" + }, + "pipeline_mode": "pre_llm_only", + "gate_decision": "allow", + "prompt_used": "docs_explain_answer", + "llm_mode": "prose", + "degraded_reason": null, + "code_intents_stubbed": true +} + +## Pipeline Steps +### input_query +```json +{ + "input": { + "query": "Опиши endpoint отправки сообщений" + }, + "output": { + "query": "Опиши endpoint отправки сообщений" + } +} +``` + +### router +```json +{ + "input": { + "query": "Опиши endpoint отправки сообщений" + }, + "output": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "API_METHOD_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START" + } +} +``` + +### docs_pipeline +```json +{ + "input": { + "query": "Опиши endpoint отправки сообщений" + }, + "output": { + "answer_mode": "ready", + "prompt_name": "docs_explain_answer", + "llm_request": { + "prompt_name": "docs_explain_answer", + "log_context": "graph.project_qa.docs.answer", + "prompt_stats": { + "system_chars": 393, + "user_chars": 14994, + "tokens_in_estimate": 3847 + } + }, + "degraded_reason": "" + } +} +``` + +## Diagnostics +{ + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "API_METHOD_EXPLAIN", + "layers_used": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D4_WORKFLOW_INDEX", + "D0_DOC_CHUNKS" + ], + "documents_found": 6, + "facts_found": 2, + "relations_found": 0, + "openapi_fields_extracted": 0, + "missing_required_fields": [], + "openapi_status": { + "has_path": false, + "has_method": false, + "has_request": false, + "has_response": false + }, + "prompt_used": "docs_explain_answer", + "llm_mode": "prose", + "output_valid": true, + "matched_intent_source": "deterministic", + "matched_anchor_type": "topic", + "matched_anchor_value": null, + "exact_anchor_match": false, + "docs_layers_requested": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D4_WORKFLOW_INDEX", + "D0_DOC_CHUNKS" + ], + "docs_layers_with_hits": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D4_WORKFLOW_INDEX", + "D0_DOC_CHUNKS" + ], + "planned_layers": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D4_WORKFLOW_INDEX", + "D0_DOC_CHUNKS" + ], + "executed_layers": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D4_WORKFLOW_INDEX", + "D0_DOC_CHUNKS" + ], + "non_empty_layers": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D4_WORKFLOW_INDEX", + "D0_DOC_CHUNKS" + ], + "layer_diagnostics": { + "D1_DOCUMENT_CATALOG": { + "hits": 6, + "top_ids": [ + "api.send_message_endpoint", + "api.control_actions_endpoint", + "api.health_endpoint", + "docs/README.md", + "architecture.telegram_notify_app" + ] + }, + "D2_FACT_INDEX": { + "hits": 8, + "top_ids": [ + "f85d982c272a2ee6baeadc433221a20e684cd8ef01cb4788d6f76d05ca56d6d0", + "b8e44c3adb74aaa6c91ae8815fa091289e58dd3990a3a1b63e850c62075aea75", + "bafb867ffed41c9db637df98d6cd5f6722d7747bbebc6c03e6f0d0caf3b7f9f3", + "54bbcbac242f1c85ec3280236ed5841998a8a3a548ff16cbf0b5acafbff469e3", + "b6bfad59b3bf00f199b5ef90c1208af19664de700413e7354468a93a4abaaa2f" + ] + }, + "D4_WORKFLOW_INDEX": { + "hits": 3, + "top_ids": [ + "api.control_actions_endpoint", + "api.health_endpoint", + "api.send_message_endpoint" + ] + }, + "D0_DOC_CHUNKS": { + "hits": 6, + "top_ids": [ + "api.control_actions_endpoint" + ] + } + }, + "query_entity_candidates": [], + "resolved_entity_candidates": [], + "query_anchor_candidates": [], + "resolved_anchor_candidates": [ + "api.send_message_endpoint", + "docs/documentation/api/send-message-endpoint.md", + "api.control_actions_endpoint", + "docs/documentation/api/control-actions-endpoint.md", + "api.health_endpoint", + "docs/documentation/api/health-endpoint.md", + "docs/README.md", + "architecture.telegram_notify_app", + "docs/documentation/architecture/telegram-notify-app-overview.md", + "domain.runtime_health", + "docs/documentation/domain/runtime-health-entity.md" + ], + "anchor_candidates": [], + "selected_anchor": null, + "anchor_selection_reason": "", + "anchor_match_type": "", + "doc_ids": [ + "api.send_message_endpoint", + "api.control_actions_endpoint", + "api.actions_endpoint", + "api.health_endpoint", + "docs/README.md", + "architecture.telegram_notify_app", + "architecture.telegram_notify_app_overview", + "domain.runtime_health" + ], + "doc_paths": [ + "docs/documentation/api/send-message-endpoint.md", + "docs/documentation/api/control-actions-endpoint.md", + "docs/documentation/api/health-endpoint.md", + "docs/README.md", + "docs/documentation/architecture/telegram-notify-app-overview.md", + "docs/documentation/domain/runtime-health-entity.md" + ], + "doc_titles": [ + "HTTP API /send", + "HTTP API /actions/{action}", + "HTTP API /health", + "Readme", + "Архитектура Telegram Notify App", + "Сущность runtime health", + "api.control_actions_endpoint:workflow_step", + "api.control_actions_endpoint:mentions_entity", + "Scenario", + "api.control_actions_endpoint:Функциональные требования", + "api.control_actions_endpoint:Нефункциональные требования", + "api.control_actions_endpoint:Сценарий", + "api.control_actions_endpoint:Summary", + "api.control_actions_endpoint:Описание", + "api.control_actions_endpoint:Входные параметры" + ], + "relation_hits_count": 0, + "relation_targets": [], + "fallback_doc_hits_count": 12, + "fallback_used": false, + "fact_hits": 2, + "entity_hits": 0, + "evidence_summary": { + "documents": 6, + "facts": 2, + "relations": 0, + "chunks": 6, + "entity_hits": 0, + "openapi_signals": { + "path_found": false, + "method_found": false, + "request_schema": false, + "response_schema": false, + "status_codes": false, + "payload_description": false + } + }, + "gate_decision": "allow", + "gate_decision_reason": "evidence_sufficient", + "gate_missing_requirements": [], + "gate_satisfied_requirements": [ + "retrieval_non_empty" + ], + "openapi_evidence": { + "path_found": false, + "method_found": false, + "request_schema": false, + "response_schema": false, + "status_codes": false, + "payload_description": false + }, + "requested_fragment_type": null, + "fragment_evidence_found": [], + "fragment_missing_requirements": [], + "answer_mode": "ready", + "degrade_reason": null, + "degraded_reason": null, + "code_intents_stubbed": false +} + +## LLM Request +- prompt_name: docs_explain_answer +- log_context: graph.project_qa.docs.answer + +### Prompt Stats +```json +{ + "system_chars": 393, + "user_chars": 14994, + "tokens_in_estimate": 3847 +} +``` + +### System Prompt +```text +Ты объясняешь документацию системы. + +На вход приходит JSON с полями: +- question +- intent +- sub_intent +- documents +- facts +- relations + +Правила: +- Используй только предоставленные факты +- Не додумывай +- Если данных недостаточно, скажи это явно +- Объясняй структурировано + +Формат ответа: +1. Краткое описание +2. Основные элементы +3. Как это работает +4. Связи с другими частями системы (если есть) +``` + +### User Prompt +```json +{ + "question": "Опиши endpoint отправки сообщений", + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "API_METHOD_EXPLAIN", + "documents": [ + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/api/send-message-endpoint.md", + "title": "HTTP API /send", + "content": "Endpoint `/send` выполняет ручную отправку сообщения в Telegram через `TelegramSendService`. Он используется для операторской проверки доставки и для отправки уведомлений вне периодического worker loop. Endpoint работает поверх тех же credentials и того же delivery path, что и фоновая отправка.", + "metadata": { + "name": "send_message_endpoint", + "tags": [ + "api", + "telegram", + "manual-send" + ], + "type": "api_method", + "layer": "application", + "links": [ + { + "type": "part_of", + "target": "architecture.telegram_notify_app" + }, + { + "type": "depends_on", + "target": "logic.telegram_notification_loop" + } + ], + "owner": null, + "title": "HTTP API /send", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "architecture.telegram_notify_app", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "5fbf2e33510b0676a3a53b957a4569bd3c2c31fb7719546602c573421ccaa32d", + "children": [], + "doc_kind": "misc", + "entities": [ + "TelegramControlAppFactory", + "TelegramSendService", + "TelegramNotifyWorker" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "api.send_message_endpoint", + "source_path": "docs/documentation/api/send-message-endpoint.md", + "summary_text": "Endpoint `/send` выполняет ручную отправку сообщения в Telegram через `TelegramSendService`. Он используется для операторской проверки доставки и для отправки уведомлений вне периодического worker loop. Endpoint работает поверх тех же credentials и того же delivery path, что и фоновая отправка.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "HTTP API /actions/{action}", + "content": "Endpoint `/actions/{action}` управляет control actions runtime и поддерживает `start`, `stop` и `status`. Для долгих операций `start` и `stop` допускается ответ HTTP 202, если действие еще выполняется. Endpoint используется для operator-driven управления жизненным циклом worker'а через HTTP API.", + "metadata": { + "name": "control_actions_endpoint", + "tags": [ + "api", + "control-plane", + "lifecycle" + ], + "type": "api_method", + "layer": "application", + "links": [ + { + "type": "part_of", + "target": "architecture.telegram_notify_app" + }, + { + "type": "related_api", + "target": "api.health_endpoint" + }, + { + "type": "related_logic", + "target": "logic.telegram_notification_loop" + } + ], + "owner": null, + "title": "HTTP API /actions/{action}", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "architecture.telegram_notify_app", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "children": [], + "doc_kind": "misc", + "entities": [ + "TelegramControlChannel", + "ControlActionSet", + "JSONResponse" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "api.control_actions_endpoint", + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "summary_text": "Endpoint `/actions/{action}` управляет control actions runtime и поддерживает `start`, `stop` и `status`. Для долгих операций `start` и `stop` допускается ответ HTTP 202, если действие еще выполняется. Endpoint используется для operator-driven управления жизненным циклом worker'а через HTTP API.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/api/health-endpoint.md", + "title": "HTTP API /health", + "content": "Endpoint `/health` возвращает агрегированный health payload runtime. Если общий статус равен `ok`, API отвечает с HTTP 200; для состояний деградации или неготовности возвращается HTTP 503 с тем же payload. Endpoint служит основной точкой внешней проверки состояния приложения.", + "metadata": { + "name": "health_endpoint", + "tags": [ + "api", + "health", + "control-plane" + ], + "type": "api_method", + "layer": "application", + "links": [ + { + "type": "part_of", + "target": "architecture.telegram_notify_app" + }, + { + "type": "depends_on", + "target": "domain.runtime_health" + } + ], + "owner": null, + "title": "HTTP API /health", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "architecture.telegram_notify_app", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "8b5a533a8076e2e9d36995eee29aeade260080bdca2ec8e21fe28f08574b983f", + "children": [], + "doc_kind": "misc", + "entities": [ + "TelegramControlChannel", + "TelegramNotifyWorker", + "RuntimeManager", + "WorkerHealth" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "api.health_endpoint", + "source_path": "docs/documentation/api/health-endpoint.md", + "summary_text": "Endpoint `/health` возвращает агрегированный health payload runtime. Если общий статус равен `ok`, API отвечает с HTTP 200; для состояний деградации или неготовности возвращается HTTP 503 с тем же payload. Endpoint служит основной точкой внешней проверки состояния приложения.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/README.md", + "title": "Readme", + "content": "Readme", + "metadata": { + "name": "", + "tags": [], + "type": "", + "layer": "", + "links": [], + "owner": null, + "title": "Readme", + "doc_id": null, + "module": "", + "parent": null, + "status": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "81d952f1a6ea85b76f75e0e57f33b8fa4b2bf3cb7db11b91b90171aeedd655a6", + "children": [], + "doc_kind": "readme", + "entities": [], + "updated_at": null, + "doc_version": null, + "document_id": "docs/README.md", + "source_path": "docs/README.md", + "summary_text": "", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/architecture/telegram-notify-app-overview.md", + "title": "Архитектура Telegram Notify App", + "content": "`test_echo_app` — сервис на базе PLBA runtime, который поднимает HTTP control plane и запускает фоновый воркер для периодической отправки уведомлений в Telegram. Приложение использует YAML-конфиг для runtime-настроек и переменные окружения для Telegram credentials. Основной контур системы состоит из runtime manager, control channel, send service и worker loop.", + "metadata": { + "name": "telegram_notify_app_overview", + "tags": [ + "architecture", + "telegram", + "plba", + "runtime" + ], + "type": "architecture_overview", + "layer": "system", + "links": [ + { + "type": "related_api", + "target": "api.health_endpoint" + }, + { + "type": "related_api", + "target": "api.control_actions_endpoint" + }, + { + "type": "related_api", + "target": "api.send_message_endpoint" + }, + { + "type": "depends_on", + "target": "logic.telegram_notification_loop" + }, + { + "type": "depends_on", + "target": "domain.runtime_health" + } + ], + "owner": null, + "title": "Архитектура Telegram Notify App", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "docs_root", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "8b1cc9f823e55bddbc825466d10a0fdb4ca4354ac02d91f9e2aef7b7d2ec8256", + "children": [ + "api.health_endpoint", + "api.control_actions_endpoint", + "api.send_message_endpoint", + "logic.telegram_notification_loop", + "domain.runtime_health" + ], + "doc_kind": "spec", + "entities": [ + "TelegramNotifyModule", + "TelegramNotifyWorker", + "TelegramControlChannel", + "TelegramSendService", + "RuntimeManager" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "architecture.telegram_notify_app", + "source_path": "docs/documentation/architecture/telegram-notify-app-overview.md", + "summary_text": "`test_echo_app` — сервис на базе PLBA runtime, который поднимает HTTP control plane и запускает фоновый воркер для периодической отправки уведомлений в Telegram. Приложение использует YAML-конфиг для runtime-настроек и переменные окружения для Telegram credentials. Основной контур системы состоит из runtime manager, control channel, send service и worker loop.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/domain/runtime-health-entity.md", + "title": "Сущность runtime health", + "content": "`runtime health` — доменная модель наблюдаемости сервиса, которая описывает общее состояние runtime и состояние отдельных компонентов. Для `test_echo_app` главным объектом наблюдения является компонент `telegram_notify`, у которого важны статус, время старта и количество успешных отправок. Эта модель используется для внешнего health-monitoring и внутренней диагностики.", + "metadata": { + "name": "runtime_health", + "tags": [ + "domain", + "health", + "observability" + ], + "type": "domain_entity", + "layer": "domain", + "links": [ + { + "type": "part_of", + "target": "architecture.telegram_notify_app" + }, + { + "type": "used_by", + "target": "api.health_endpoint" + }, + { + "type": "related_logic", + "target": "logic.telegram_notification_loop" + } + ], + "owner": null, + "title": "Сущность runtime health", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "architecture.telegram_notify_app", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "37d4dcf470ea3de95d59e44786006e369a3ea11bf5dbf4c88877696e9183ee87", + "children": [], + "doc_kind": "misc", + "entities": [ + "WorkerHealth", + "WorkerStatus", + "TelegramNotifyWorker" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "domain.runtime_health", + "source_path": "docs/documentation/domain/runtime-health-entity.md", + "summary_text": "`runtime health` — доменная модель наблюдаемости сервиса, которая описывает общее состояние runtime и состояние отдельных компонентов. Для `test_echo_app` главным объектом наблюдения является компонент `telegram_notify`, у которого важны статус, время старта и количество успешных отправок. Эта модель используется для внешнего health-monitoring и внутренней диагностики.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + } + ], + "facts": [ + { + "layer": "D2_FACT_INDEX", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "api.control_actions_endpoint:workflow_step", + "content": "api.control_actions_endpoint workflow_step Название:** Выполнение control action runtime", + "metadata": { + "tags": [], + "owner": null, + "anchor": "Сценарий", + "doc_id": null, + "object": "Название:** Выполнение control action runtime", + "fact_id": "f85d982c272a2ee6baeadc433221a20e684cd8ef01cb4788d6f76d05ca56d6d0", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "predicate": "workflow_step", + "object_ref": null, + "subject_id": "api.control_actions_endpoint", + "doc_version": null, + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D2_FACT_INDEX", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "api.control_actions_endpoint:mentions_entity", + "content": "api.control_actions_endpoint mentions_entity ControlActionSet", + "metadata": { + "tags": [], + "owner": null, + "anchor": "frontmatter.entities", + "doc_id": null, + "object": "ControlActionSet", + "fact_id": "bafb867ffed41c9db637df98d6cd5f6722d7747bbebc6c03e6f0d0caf3b7f9f3", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "predicate": "mentions_entity", + "object_ref": null, + "subject_id": "api.control_actions_endpoint", + "doc_version": null, + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + } + ], + "relations": [] +} +``` + +### User Prompt Overview +- question: Опиши endpoint отправки сообщений +- intent: DOCUMENTATION_EXPLAIN +- sub_intent: API_METHOD_EXPLAIN +- documents: 6 | samples: HTTP API /send, HTTP API /actions/{action}, HTTP API /health +- facts: 2 | samples: api.control_actions_endpoint:workflow_step, api.control_actions_endpoint:mentions_entity +- relations: 0 + +## Mismatches +- none \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/docs_pre_llm_v3/20260326_121025/full_chain_docs_intents_v3-3x_v3-component-control-channel-1.json b/tests/pipeline_setup_v3/test_results/docs_pre_llm_v3/20260326_121025/full_chain_docs_intents_v3-3x_v3-component-control-channel-1.json new file mode 100644 index 0000000..1f90f92 --- /dev/null +++ b/tests/pipeline_setup_v3/test_results/docs_pre_llm_v3/20260326_121025/full_chain_docs_intents_v3-3x_v3-component-control-channel-1.json @@ -0,0 +1,92 @@ +{ + "meta": { + "case_id": "v3-component-control-channel-1", + "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_03_docs/full_chain_docs_intents_v3-3x.yaml", + "runner": "agent_runtime", + "mode": "pre_llm", + "passed": true, + "mismatches": [], + "actual": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "COMPONENT_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START", + "rag_count": 20, + "llm_answer": "", + "answer_mode": "answered", + "path_scope": [], + "doc_scope": [ + "api.control_actions_endpoint", + "api.actions_endpoint", + "architecture.telegram_notify_app", + "architecture.telegram_notify_app_overview", + "docs/README.md", + "domain.runtime_health", + "logic.telegram_notification_loop", + "api.send_message_endpoint" + ], + "entity_candidates": [ + "TelegramControlChannel" + ], + "symbol_candidates": [], + "layers": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "filters": { + "doc_type": null + }, + "pipeline_mode": "pre_llm_only", + "gate_decision": "allow", + "prompt_used": "docs_explain_answer", + "llm_mode": "prose", + "degraded_reason": null, + "code_intents_stubbed": true + } + }, + "pipeline_steps": [ + { + "step": "input_query", + "input": { + "query": "Как работает TelegramControlChannel?" + }, + "output": { + "query": "Как работает TelegramControlChannel?" + } + }, + { + "step": "router", + "input": { + "query": "Как работает TelegramControlChannel?" + }, + "output": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "COMPONENT_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START" + } + }, + { + "step": "docs_pipeline", + "input": { + "query": "Как работает TelegramControlChannel?" + }, + "output": { + "answer_mode": "ready", + "prompt_name": "docs_explain_answer", + "llm_request": { + "prompt_name": "docs_explain_answer", + "log_context": "graph.project_qa.docs.answer", + "prompt_stats": { + "system_chars": 393, + "user_chars": 21500, + "tokens_in_estimate": 5474 + } + }, + "degraded_reason": "" + } + } + ] +} \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/docs_pre_llm_v3/20260326_121025/full_chain_docs_intents_v3-3x_v3-component-control-channel-1.md b/tests/pipeline_setup_v3/test_results/docs_pre_llm_v3/20260326_121025/full_chain_docs_intents_v3-3x_v3-component-control-channel-1.md new file mode 100644 index 0000000..e54bf62 --- /dev/null +++ b/tests/pipeline_setup_v3/test_results/docs_pre_llm_v3/20260326_121025/full_chain_docs_intents_v3-3x_v3-component-control-channel-1.md @@ -0,0 +1,900 @@ +# v3-component-control-channel-1 + +- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_03_docs/full_chain_docs_intents_v3-3x.yaml +- runner: agent_runtime +- mode: pre_llm +- passed: True + +## Query +Как работает TelegramControlChannel? + +## Actual +{ + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "COMPONENT_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START", + "rag_count": 20, + "llm_answer": "", + "answer_mode": "answered", + "path_scope": [], + "doc_scope": [ + "api.control_actions_endpoint", + "api.actions_endpoint", + "architecture.telegram_notify_app", + "architecture.telegram_notify_app_overview", + "docs/README.md", + "domain.runtime_health", + "logic.telegram_notification_loop", + "api.send_message_endpoint" + ], + "entity_candidates": [ + "TelegramControlChannel" + ], + "symbol_candidates": [], + "layers": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "filters": { + "doc_type": null + }, + "pipeline_mode": "pre_llm_only", + "gate_decision": "allow", + "prompt_used": "docs_explain_answer", + "llm_mode": "prose", + "degraded_reason": null, + "code_intents_stubbed": true +} + +## Pipeline Steps +### input_query +```json +{ + "input": { + "query": "Как работает TelegramControlChannel?" + }, + "output": { + "query": "Как работает TelegramControlChannel?" + } +} +``` + +### router +```json +{ + "input": { + "query": "Как работает TelegramControlChannel?" + }, + "output": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "COMPONENT_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START" + } +} +``` + +### docs_pipeline +```json +{ + "input": { + "query": "Как работает TelegramControlChannel?" + }, + "output": { + "answer_mode": "ready", + "prompt_name": "docs_explain_answer", + "llm_request": { + "prompt_name": "docs_explain_answer", + "log_context": "graph.project_qa.docs.answer", + "prompt_stats": { + "system_chars": 393, + "user_chars": 21500, + "tokens_in_estimate": 5474 + } + }, + "degraded_reason": "" + } +} +``` + +## Diagnostics +{ + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "COMPONENT_EXPLAIN", + "layers_used": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "documents_found": 6, + "facts_found": 2, + "relations_found": 6, + "openapi_fields_extracted": 0, + "missing_required_fields": [], + "openapi_status": { + "has_path": false, + "has_method": false, + "has_request": false, + "has_response": false + }, + "prompt_used": "docs_explain_answer", + "llm_mode": "prose", + "output_valid": true, + "matched_intent_source": "deterministic", + "matched_anchor_type": "none", + "matched_anchor_value": null, + "exact_anchor_match": false, + "docs_layers_requested": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "docs_layers_with_hits": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "planned_layers": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "executed_layers": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "non_empty_layers": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "layer_diagnostics": { + "D1_DOCUMENT_CATALOG": { + "hits": 6, + "top_ids": [ + "api.control_actions_endpoint", + "architecture.telegram_notify_app", + "docs/README.md", + "domain.runtime_health", + "logic.telegram_notification_loop" + ] + }, + "D2_FACT_INDEX": { + "hits": 8, + "top_ids": [ + "b480201013a7e5231146f665773ebc54af37c28135f407c6b758304c74561645", + "b8e44c3adb74aaa6c91ae8815fa091289e58dd3990a3a1b63e850c62075aea75", + "bafb867ffed41c9db637df98d6cd5f6722d7747bbebc6c03e6f0d0caf3b7f9f3", + "54bbcbac242f1c85ec3280236ed5841998a8a3a548ff16cbf0b5acafbff469e3", + "b6bfad59b3bf00f199b5ef90c1208af19664de700413e7354468a93a4abaaa2f" + ] + }, + "D5_RELATION_GRAPH": { + "hits": 6, + "top_ids": [ + "afec31fd062e392dcd9699a92c7ab61fd4b1273c1a2b16702b23d55d8d0c47ac", + "711fb2edb82dd222deaba3c91768b18cbbd453009235823282813c6e867dc2c1", + "eec79f7a02b804337e791ef231784862ae26e0599eb20224790e9d4f085fa9c0", + "5f4909bde905cd3d294ad307074a05e4ae4deefcafe6272cd2d0436e73acb8dd", + "ae34fe4b3cd2b47632b13b1e32303e842b57948aa21160abe8d9b478995e1d74" + ] + }, + "D0_DOC_CHUNKS": { + "hits": 6, + "top_ids": [ + "api.control_actions_endpoint" + ] + } + }, + "query_entity_candidates": [ + "TelegramControlChannel" + ], + "resolved_entity_candidates": [], + "query_anchor_candidates": [ + "TelegramControlChannel" + ], + "resolved_anchor_candidates": [ + "api.control_actions_endpoint", + "docs/documentation/api/control-actions-endpoint.md", + "architecture.telegram_notify_app", + "docs/documentation/architecture/telegram-notify-app-overview.md", + "docs/README.md", + "domain.runtime_health", + "docs/documentation/domain/runtime-health-entity.md", + "logic.telegram_notification_loop", + "docs/documentation/logic/telegram-notification-loop.md", + "api.send_message_endpoint", + "docs/documentation/api/send-message-endpoint.md" + ], + "anchor_candidates": [], + "selected_anchor": null, + "anchor_selection_reason": "", + "anchor_match_type": "", + "doc_ids": [ + "api.control_actions_endpoint", + "api.actions_endpoint", + "architecture.telegram_notify_app", + "architecture.telegram_notify_app_overview", + "docs/README.md", + "domain.runtime_health", + "logic.telegram_notification_loop", + "api.send_message_endpoint" + ], + "doc_paths": [ + "docs/documentation/api/control-actions-endpoint.md", + "docs/documentation/architecture/telegram-notify-app-overview.md", + "docs/README.md", + "docs/documentation/domain/runtime-health-entity.md", + "docs/documentation/logic/telegram-notification-loop.md", + "docs/documentation/api/send-message-endpoint.md" + ], + "doc_titles": [ + "HTTP API /actions/{action}", + "Архитектура Telegram Notify App", + "Readme", + "Сущность runtime health", + "Цикл отправки уведомлений в Telegram", + "HTTP API /send", + "api.control_actions_endpoint:workflow_step", + "api.control_actions_endpoint:mentions_entity", + "api.control_actions_endpoint:parent", + "api.control_actions_endpoint:related_api", + "api.control_actions_endpoint:related_logic", + "api.control_actions_endpoint:part_of", + "architecture.telegram_notify_app:child", + "architecture.telegram_notify_app:related_api", + "api.control_actions_endpoint:Функциональные требования", + "api.control_actions_endpoint:Нефункциональные требования", + "api.control_actions_endpoint:Сценарий", + "api.control_actions_endpoint:Summary", + "api.control_actions_endpoint:Описание", + "api.control_actions_endpoint:Входные параметры" + ], + "relation_hits_count": 6, + "relation_targets": [ + "api.control_actions_endpoint:parent", + "api.control_actions_endpoint:related_api", + "api.control_actions_endpoint:related_logic", + "api.control_actions_endpoint:part_of", + "architecture.telegram_notify_app:child", + "architecture.telegram_notify_app:related_api" + ], + "fallback_doc_hits_count": 12, + "fallback_used": false, + "fact_hits": 2, + "entity_hits": 0, + "evidence_summary": { + "documents": 6, + "facts": 2, + "relations": 6, + "chunks": 6, + "entity_hits": 0, + "openapi_signals": { + "path_found": false, + "method_found": false, + "request_schema": false, + "response_schema": false, + "status_codes": false, + "payload_description": false + } + }, + "gate_decision": "allow", + "gate_decision_reason": "evidence_sufficient", + "gate_missing_requirements": [], + "gate_satisfied_requirements": [ + "retrieval_non_empty" + ], + "openapi_evidence": { + "path_found": false, + "method_found": false, + "request_schema": false, + "response_schema": false, + "status_codes": false, + "payload_description": false + }, + "requested_fragment_type": null, + "fragment_evidence_found": [], + "fragment_missing_requirements": [], + "answer_mode": "ready", + "degrade_reason": null, + "degraded_reason": null, + "code_intents_stubbed": false +} + +## LLM Request +- prompt_name: docs_explain_answer +- log_context: graph.project_qa.docs.answer + +### Prompt Stats +```json +{ + "system_chars": 393, + "user_chars": 21500, + "tokens_in_estimate": 5474 +} +``` + +### System Prompt +```text +Ты объясняешь документацию системы. + +На вход приходит JSON с полями: +- question +- intent +- sub_intent +- documents +- facts +- relations + +Правила: +- Используй только предоставленные факты +- Не додумывай +- Если данных недостаточно, скажи это явно +- Объясняй структурировано + +Формат ответа: +1. Краткое описание +2. Основные элементы +3. Как это работает +4. Связи с другими частями системы (если есть) +``` + +### User Prompt +```json +{ + "question": "Как работает TelegramControlChannel?", + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "COMPONENT_EXPLAIN", + "documents": [ + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "HTTP API /actions/{action}", + "content": "Endpoint `/actions/{action}` управляет control actions runtime и поддерживает `start`, `stop` и `status`. Для долгих операций `start` и `stop` допускается ответ HTTP 202, если действие еще выполняется. Endpoint используется для operator-driven управления жизненным циклом worker'а через HTTP API.", + "metadata": { + "name": "control_actions_endpoint", + "tags": [ + "api", + "control-plane", + "lifecycle" + ], + "type": "api_method", + "layer": "application", + "links": [ + { + "type": "part_of", + "target": "architecture.telegram_notify_app" + }, + { + "type": "related_api", + "target": "api.health_endpoint" + }, + { + "type": "related_logic", + "target": "logic.telegram_notification_loop" + } + ], + "owner": null, + "title": "HTTP API /actions/{action}", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "architecture.telegram_notify_app", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "children": [], + "doc_kind": "misc", + "entities": [ + "TelegramControlChannel", + "ControlActionSet", + "JSONResponse" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "api.control_actions_endpoint", + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "summary_text": "Endpoint `/actions/{action}` управляет control actions runtime и поддерживает `start`, `stop` и `status`. Для долгих операций `start` и `stop` допускается ответ HTTP 202, если действие еще выполняется. Endpoint используется для operator-driven управления жизненным циклом worker'а через HTTP API.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/architecture/telegram-notify-app-overview.md", + "title": "Архитектура Telegram Notify App", + "content": "`test_echo_app` — сервис на базе PLBA runtime, который поднимает HTTP control plane и запускает фоновый воркер для периодической отправки уведомлений в Telegram. Приложение использует YAML-конфиг для runtime-настроек и переменные окружения для Telegram credentials. Основной контур системы состоит из runtime manager, control channel, send service и worker loop.", + "metadata": { + "name": "telegram_notify_app_overview", + "tags": [ + "architecture", + "telegram", + "plba", + "runtime" + ], + "type": "architecture_overview", + "layer": "system", + "links": [ + { + "type": "related_api", + "target": "api.health_endpoint" + }, + { + "type": "related_api", + "target": "api.control_actions_endpoint" + }, + { + "type": "related_api", + "target": "api.send_message_endpoint" + }, + { + "type": "depends_on", + "target": "logic.telegram_notification_loop" + }, + { + "type": "depends_on", + "target": "domain.runtime_health" + } + ], + "owner": null, + "title": "Архитектура Telegram Notify App", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "docs_root", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "8b1cc9f823e55bddbc825466d10a0fdb4ca4354ac02d91f9e2aef7b7d2ec8256", + "children": [ + "api.health_endpoint", + "api.control_actions_endpoint", + "api.send_message_endpoint", + "logic.telegram_notification_loop", + "domain.runtime_health" + ], + "doc_kind": "spec", + "entities": [ + "TelegramNotifyModule", + "TelegramNotifyWorker", + "TelegramControlChannel", + "TelegramSendService", + "RuntimeManager" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "architecture.telegram_notify_app", + "source_path": "docs/documentation/architecture/telegram-notify-app-overview.md", + "summary_text": "`test_echo_app` — сервис на базе PLBA runtime, который поднимает HTTP control plane и запускает фоновый воркер для периодической отправки уведомлений в Telegram. Приложение использует YAML-конфиг для runtime-настроек и переменные окружения для Telegram credentials. Основной контур системы состоит из runtime manager, control channel, send service и worker loop.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/README.md", + "title": "Readme", + "content": "Readme", + "metadata": { + "name": "", + "tags": [], + "type": "", + "layer": "", + "links": [], + "owner": null, + "title": "Readme", + "doc_id": null, + "module": "", + "parent": null, + "status": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "81d952f1a6ea85b76f75e0e57f33b8fa4b2bf3cb7db11b91b90171aeedd655a6", + "children": [], + "doc_kind": "readme", + "entities": [], + "updated_at": null, + "doc_version": null, + "document_id": "docs/README.md", + "source_path": "docs/README.md", + "summary_text": "", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/domain/runtime-health-entity.md", + "title": "Сущность runtime health", + "content": "`runtime health` — доменная модель наблюдаемости сервиса, которая описывает общее состояние runtime и состояние отдельных компонентов. Для `test_echo_app` главным объектом наблюдения является компонент `telegram_notify`, у которого важны статус, время старта и количество успешных отправок. Эта модель используется для внешнего health-monitoring и внутренней диагностики.", + "metadata": { + "name": "runtime_health", + "tags": [ + "domain", + "health", + "observability" + ], + "type": "domain_entity", + "layer": "domain", + "links": [ + { + "type": "part_of", + "target": "architecture.telegram_notify_app" + }, + { + "type": "used_by", + "target": "api.health_endpoint" + }, + { + "type": "related_logic", + "target": "logic.telegram_notification_loop" + } + ], + "owner": null, + "title": "Сущность runtime health", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "architecture.telegram_notify_app", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "37d4dcf470ea3de95d59e44786006e369a3ea11bf5dbf4c88877696e9183ee87", + "children": [], + "doc_kind": "misc", + "entities": [ + "WorkerHealth", + "WorkerStatus", + "TelegramNotifyWorker" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "domain.runtime_health", + "source_path": "docs/documentation/domain/runtime-health-entity.md", + "summary_text": "`runtime health` — доменная модель наблюдаемости сервиса, которая описывает общее состояние runtime и состояние отдельных компонентов. Для `test_echo_app` главным объектом наблюдения является компонент `telegram_notify`, у которого важны статус, время старта и количество успешных отправок. Эта модель используется для внешнего health-monitoring и внутренней диагностики.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/logic/telegram-notification-loop.md", + "title": "Цикл отправки уведомлений в Telegram", + "content": "`TelegramNotifyWorker` после старта runtime запускает отдельный поток, сразу делает первую попытку отправки сообщения и затем повторяет отправку через заданный интервал. При ошибках доставки или отсутствии credentials worker не останавливает сервис, а переводит собственное состояние в `degraded`. Этот workflow определяет основной полезный цикл приложения.", + "metadata": { + "name": "telegram_notification_loop", + "tags": [ + "logic", + "telegram", + "worker", + "scheduling" + ], + "type": "logic_block", + "layer": "application", + "links": [ + { + "type": "part_of", + "target": "architecture.telegram_notify_app" + }, + { + "type": "related_api", + "target": "api.send_message_endpoint" + }, + { + "type": "related_api", + "target": "api.control_actions_endpoint" + }, + { + "type": "related_api", + "target": "api.health_endpoint" + } + ], + "owner": null, + "title": "Цикл отправки уведомлений в Telegram", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "architecture.telegram_notify_app", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "0f62f9b4dab261ca4ca34575ff5d84411a22c90b780c52eda388782b94f08470", + "children": [], + "doc_kind": "misc", + "entities": [ + "TelegramNotifyWorker", + "TelegramSendService", + "WorkerHealth", + "WorkerStatus" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "logic.telegram_notification_loop", + "source_path": "docs/documentation/logic/telegram-notification-loop.md", + "summary_text": "`TelegramNotifyWorker` после старта runtime запускает отдельный поток, сразу делает первую попытку отправки сообщения и затем повторяет отправку через заданный интервал. При ошибках доставки или отсутствии credentials worker не останавливает сервис, а переводит собственное состояние в `degraded`. Этот workflow определяет основной полезный цикл приложения.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/api/send-message-endpoint.md", + "title": "HTTP API /send", + "content": "Endpoint `/send` выполняет ручную отправку сообщения в Telegram через `TelegramSendService`. Он используется для операторской проверки доставки и для отправки уведомлений вне периодического worker loop. Endpoint работает поверх тех же credentials и того же delivery path, что и фоновая отправка.", + "metadata": { + "name": "send_message_endpoint", + "tags": [ + "api", + "telegram", + "manual-send" + ], + "type": "api_method", + "layer": "application", + "links": [ + { + "type": "part_of", + "target": "architecture.telegram_notify_app" + }, + { + "type": "depends_on", + "target": "logic.telegram_notification_loop" + } + ], + "owner": null, + "title": "HTTP API /send", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "architecture.telegram_notify_app", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "5fbf2e33510b0676a3a53b957a4569bd3c2c31fb7719546602c573421ccaa32d", + "children": [], + "doc_kind": "misc", + "entities": [ + "TelegramControlAppFactory", + "TelegramSendService", + "TelegramNotifyWorker" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "api.send_message_endpoint", + "source_path": "docs/documentation/api/send-message-endpoint.md", + "summary_text": "Endpoint `/send` выполняет ручную отправку сообщения в Telegram через `TelegramSendService`. Он используется для операторской проверки доставки и для отправки уведомлений вне периодического worker loop. Endpoint работает поверх тех же credentials и того же delivery path, что и фоновая отправка.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + } + ], + "facts": [ + { + "layer": "D2_FACT_INDEX", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "api.control_actions_endpoint:workflow_step", + "content": "api.control_actions_endpoint workflow_step HTTP control plane запущен.", + "metadata": { + "tags": [], + "owner": null, + "anchor": "Сценарий", + "doc_id": null, + "object": "HTTP control plane запущен.", + "fact_id": "b480201013a7e5231146f665773ebc54af37c28135f407c6b758304c74561645", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "predicate": "workflow_step", + "object_ref": null, + "subject_id": "api.control_actions_endpoint", + "doc_version": null, + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D2_FACT_INDEX", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "api.control_actions_endpoint:mentions_entity", + "content": "api.control_actions_endpoint mentions_entity ControlActionSet", + "metadata": { + "tags": [], + "owner": null, + "anchor": "frontmatter.entities", + "doc_id": null, + "object": "ControlActionSet", + "fact_id": "bafb867ffed41c9db637df98d6cd5f6722d7747bbebc6c03e6f0d0caf3b7f9f3", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "predicate": "mentions_entity", + "object_ref": null, + "subject_id": "api.control_actions_endpoint", + "doc_version": null, + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + } + ], + "relations": [ + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "api.control_actions_endpoint:parent", + "content": "api.control_actions_endpoint parent architecture.telegram_notify_app", + "metadata": { + "owner": null, + "anchor": "frontmatter.parent", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "source_id": "api.control_actions_endpoint", + "target_id": "architecture.telegram_notify_app", + "doc_version": null, + "relation_id": "afec31fd062e392dcd9699a92c7ab61fd4b1273c1a2b16702b23d55d8d0c47ac", + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "parent", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "api.control_actions_endpoint:related_api", + "content": "api.control_actions_endpoint related_api api.health_endpoint", + "metadata": { + "owner": null, + "anchor": "frontmatter.links", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "source_id": "api.control_actions_endpoint", + "target_id": "api.health_endpoint", + "doc_version": null, + "relation_id": "711fb2edb82dd222deaba3c91768b18cbbd453009235823282813c6e867dc2c1", + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "related_api", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "api.control_actions_endpoint:related_logic", + "content": "api.control_actions_endpoint related_logic logic.telegram_notification_loop", + "metadata": { + "owner": null, + "anchor": "frontmatter.links", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "source_id": "api.control_actions_endpoint", + "target_id": "logic.telegram_notification_loop", + "doc_version": null, + "relation_id": "eec79f7a02b804337e791ef231784862ae26e0599eb20224790e9d4f085fa9c0", + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "related_logic", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "api.control_actions_endpoint:part_of", + "content": "api.control_actions_endpoint part_of architecture.telegram_notify_app", + "metadata": { + "owner": null, + "anchor": "frontmatter.links", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "source_id": "api.control_actions_endpoint", + "target_id": "architecture.telegram_notify_app", + "doc_version": null, + "relation_id": "5f4909bde905cd3d294ad307074a05e4ae4deefcafe6272cd2d0436e73acb8dd", + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "part_of", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/architecture/telegram-notify-app-overview.md", + "title": "architecture.telegram_notify_app:child", + "content": "architecture.telegram_notify_app child api.control_actions_endpoint", + "metadata": { + "owner": null, + "anchor": "frontmatter.children", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "8b1cc9f823e55bddbc825466d10a0fdb4ca4354ac02d91f9e2aef7b7d2ec8256", + "source_id": "architecture.telegram_notify_app", + "target_id": "api.control_actions_endpoint", + "doc_version": null, + "relation_id": "ae34fe4b3cd2b47632b13b1e32303e842b57948aa21160abe8d9b478995e1d74", + "source_path": "docs/documentation/architecture/telegram-notify-app-overview.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "child", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/architecture/telegram-notify-app-overview.md", + "title": "architecture.telegram_notify_app:related_api", + "content": "architecture.telegram_notify_app related_api api.control_actions_endpoint", + "metadata": { + "owner": null, + "anchor": "frontmatter.links", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "8b1cc9f823e55bddbc825466d10a0fdb4ca4354ac02d91f9e2aef7b7d2ec8256", + "source_id": "architecture.telegram_notify_app", + "target_id": "api.control_actions_endpoint", + "doc_version": null, + "relation_id": "02530527e6e1d1e23316c9d25d0b30658d6c70063eb6e1d732d55c5ba29c9795", + "source_path": "docs/documentation/architecture/telegram-notify-app-overview.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "related_api", + "staleness_score": null, + "system_component": null + } + } + ] +} +``` + +### User Prompt Overview +- question: Как работает TelegramControlChannel? +- intent: DOCUMENTATION_EXPLAIN +- sub_intent: COMPONENT_EXPLAIN +- documents: 6 | samples: HTTP API /actions/{action}, Архитектура Telegram Notify App, Readme +- facts: 2 | samples: api.control_actions_endpoint:workflow_step, api.control_actions_endpoint:mentions_entity +- relations: 6 | samples: api.control_actions_endpoint:parent, api.control_actions_endpoint:related_api, api.control_actions_endpoint:related_logic + +## Mismatches +- none \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/docs_pre_llm_v3/20260326_121025/full_chain_docs_intents_v3-3x_v3-component-control-channel-2.json b/tests/pipeline_setup_v3/test_results/docs_pre_llm_v3/20260326_121025/full_chain_docs_intents_v3-3x_v3-component-control-channel-2.json new file mode 100644 index 0000000..ed2c7ad --- /dev/null +++ b/tests/pipeline_setup_v3/test_results/docs_pre_llm_v3/20260326_121025/full_chain_docs_intents_v3-3x_v3-component-control-channel-2.json @@ -0,0 +1,92 @@ +{ + "meta": { + "case_id": "v3-component-control-channel-2", + "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_03_docs/full_chain_docs_intents_v3-3x.yaml", + "runner": "agent_runtime", + "mode": "pre_llm", + "passed": true, + "mismatches": [], + "actual": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "COMPONENT_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START", + "rag_count": 20, + "llm_answer": "", + "answer_mode": "answered", + "path_scope": [], + "doc_scope": [ + "api.control_actions_endpoint", + "api.actions_endpoint", + "architecture.telegram_notify_app", + "architecture.telegram_notify_app_overview", + "docs/README.md", + "domain.runtime_health", + "logic.telegram_notification_loop", + "api.send_message_endpoint" + ], + "entity_candidates": [ + "TelegramControlChannel" + ], + "symbol_candidates": [], + "layers": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "filters": { + "doc_type": null + }, + "pipeline_mode": "pre_llm_only", + "gate_decision": "allow", + "prompt_used": "docs_explain_answer", + "llm_mode": "prose", + "degraded_reason": null, + "code_intents_stubbed": true + } + }, + "pipeline_steps": [ + { + "step": "input_query", + "input": { + "query": "Роль TelegramControlChannel в системе" + }, + "output": { + "query": "Роль TelegramControlChannel в системе" + } + }, + { + "step": "router", + "input": { + "query": "Роль TelegramControlChannel в системе" + }, + "output": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "COMPONENT_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START" + } + }, + { + "step": "docs_pipeline", + "input": { + "query": "Роль TelegramControlChannel в системе" + }, + "output": { + "answer_mode": "ready", + "prompt_name": "docs_explain_answer", + "llm_request": { + "prompt_name": "docs_explain_answer", + "log_context": "graph.project_qa.docs.answer", + "prompt_stats": { + "system_chars": 393, + "user_chars": 21501, + "tokens_in_estimate": 5474 + } + }, + "degraded_reason": "" + } + } + ] +} \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/docs_pre_llm_v3/20260326_121025/full_chain_docs_intents_v3-3x_v3-component-control-channel-2.md b/tests/pipeline_setup_v3/test_results/docs_pre_llm_v3/20260326_121025/full_chain_docs_intents_v3-3x_v3-component-control-channel-2.md new file mode 100644 index 0000000..4de09eb --- /dev/null +++ b/tests/pipeline_setup_v3/test_results/docs_pre_llm_v3/20260326_121025/full_chain_docs_intents_v3-3x_v3-component-control-channel-2.md @@ -0,0 +1,900 @@ +# v3-component-control-channel-2 + +- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_03_docs/full_chain_docs_intents_v3-3x.yaml +- runner: agent_runtime +- mode: pre_llm +- passed: True + +## Query +Роль TelegramControlChannel в системе + +## Actual +{ + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "COMPONENT_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START", + "rag_count": 20, + "llm_answer": "", + "answer_mode": "answered", + "path_scope": [], + "doc_scope": [ + "api.control_actions_endpoint", + "api.actions_endpoint", + "architecture.telegram_notify_app", + "architecture.telegram_notify_app_overview", + "docs/README.md", + "domain.runtime_health", + "logic.telegram_notification_loop", + "api.send_message_endpoint" + ], + "entity_candidates": [ + "TelegramControlChannel" + ], + "symbol_candidates": [], + "layers": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "filters": { + "doc_type": null + }, + "pipeline_mode": "pre_llm_only", + "gate_decision": "allow", + "prompt_used": "docs_explain_answer", + "llm_mode": "prose", + "degraded_reason": null, + "code_intents_stubbed": true +} + +## Pipeline Steps +### input_query +```json +{ + "input": { + "query": "Роль TelegramControlChannel в системе" + }, + "output": { + "query": "Роль TelegramControlChannel в системе" + } +} +``` + +### router +```json +{ + "input": { + "query": "Роль TelegramControlChannel в системе" + }, + "output": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "COMPONENT_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START" + } +} +``` + +### docs_pipeline +```json +{ + "input": { + "query": "Роль TelegramControlChannel в системе" + }, + "output": { + "answer_mode": "ready", + "prompt_name": "docs_explain_answer", + "llm_request": { + "prompt_name": "docs_explain_answer", + "log_context": "graph.project_qa.docs.answer", + "prompt_stats": { + "system_chars": 393, + "user_chars": 21501, + "tokens_in_estimate": 5474 + } + }, + "degraded_reason": "" + } +} +``` + +## Diagnostics +{ + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "COMPONENT_EXPLAIN", + "layers_used": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "documents_found": 6, + "facts_found": 2, + "relations_found": 6, + "openapi_fields_extracted": 0, + "missing_required_fields": [], + "openapi_status": { + "has_path": false, + "has_method": false, + "has_request": false, + "has_response": false + }, + "prompt_used": "docs_explain_answer", + "llm_mode": "prose", + "output_valid": true, + "matched_intent_source": "deterministic", + "matched_anchor_type": "none", + "matched_anchor_value": null, + "exact_anchor_match": false, + "docs_layers_requested": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "docs_layers_with_hits": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "planned_layers": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "executed_layers": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "non_empty_layers": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "layer_diagnostics": { + "D1_DOCUMENT_CATALOG": { + "hits": 6, + "top_ids": [ + "api.control_actions_endpoint", + "architecture.telegram_notify_app", + "docs/README.md", + "domain.runtime_health", + "logic.telegram_notification_loop" + ] + }, + "D2_FACT_INDEX": { + "hits": 8, + "top_ids": [ + "b480201013a7e5231146f665773ebc54af37c28135f407c6b758304c74561645", + "b8e44c3adb74aaa6c91ae8815fa091289e58dd3990a3a1b63e850c62075aea75", + "bafb867ffed41c9db637df98d6cd5f6722d7747bbebc6c03e6f0d0caf3b7f9f3", + "54bbcbac242f1c85ec3280236ed5841998a8a3a548ff16cbf0b5acafbff469e3", + "b6bfad59b3bf00f199b5ef90c1208af19664de700413e7354468a93a4abaaa2f" + ] + }, + "D5_RELATION_GRAPH": { + "hits": 6, + "top_ids": [ + "afec31fd062e392dcd9699a92c7ab61fd4b1273c1a2b16702b23d55d8d0c47ac", + "711fb2edb82dd222deaba3c91768b18cbbd453009235823282813c6e867dc2c1", + "eec79f7a02b804337e791ef231784862ae26e0599eb20224790e9d4f085fa9c0", + "5f4909bde905cd3d294ad307074a05e4ae4deefcafe6272cd2d0436e73acb8dd", + "ae34fe4b3cd2b47632b13b1e32303e842b57948aa21160abe8d9b478995e1d74" + ] + }, + "D0_DOC_CHUNKS": { + "hits": 6, + "top_ids": [ + "api.control_actions_endpoint" + ] + } + }, + "query_entity_candidates": [ + "TelegramControlChannel" + ], + "resolved_entity_candidates": [], + "query_anchor_candidates": [ + "TelegramControlChannel" + ], + "resolved_anchor_candidates": [ + "api.control_actions_endpoint", + "docs/documentation/api/control-actions-endpoint.md", + "architecture.telegram_notify_app", + "docs/documentation/architecture/telegram-notify-app-overview.md", + "docs/README.md", + "domain.runtime_health", + "docs/documentation/domain/runtime-health-entity.md", + "logic.telegram_notification_loop", + "docs/documentation/logic/telegram-notification-loop.md", + "api.send_message_endpoint", + "docs/documentation/api/send-message-endpoint.md" + ], + "anchor_candidates": [], + "selected_anchor": null, + "anchor_selection_reason": "", + "anchor_match_type": "", + "doc_ids": [ + "api.control_actions_endpoint", + "api.actions_endpoint", + "architecture.telegram_notify_app", + "architecture.telegram_notify_app_overview", + "docs/README.md", + "domain.runtime_health", + "logic.telegram_notification_loop", + "api.send_message_endpoint" + ], + "doc_paths": [ + "docs/documentation/api/control-actions-endpoint.md", + "docs/documentation/architecture/telegram-notify-app-overview.md", + "docs/README.md", + "docs/documentation/domain/runtime-health-entity.md", + "docs/documentation/logic/telegram-notification-loop.md", + "docs/documentation/api/send-message-endpoint.md" + ], + "doc_titles": [ + "HTTP API /actions/{action}", + "Архитектура Telegram Notify App", + "Readme", + "Сущность runtime health", + "Цикл отправки уведомлений в Telegram", + "HTTP API /send", + "api.control_actions_endpoint:workflow_step", + "api.control_actions_endpoint:mentions_entity", + "api.control_actions_endpoint:parent", + "api.control_actions_endpoint:related_api", + "api.control_actions_endpoint:related_logic", + "api.control_actions_endpoint:part_of", + "architecture.telegram_notify_app:child", + "architecture.telegram_notify_app:related_api", + "api.control_actions_endpoint:Функциональные требования", + "api.control_actions_endpoint:Нефункциональные требования", + "api.control_actions_endpoint:Сценарий", + "api.control_actions_endpoint:Summary", + "api.control_actions_endpoint:Описание", + "api.control_actions_endpoint:Входные параметры" + ], + "relation_hits_count": 6, + "relation_targets": [ + "api.control_actions_endpoint:parent", + "api.control_actions_endpoint:related_api", + "api.control_actions_endpoint:related_logic", + "api.control_actions_endpoint:part_of", + "architecture.telegram_notify_app:child", + "architecture.telegram_notify_app:related_api" + ], + "fallback_doc_hits_count": 12, + "fallback_used": false, + "fact_hits": 2, + "entity_hits": 0, + "evidence_summary": { + "documents": 6, + "facts": 2, + "relations": 6, + "chunks": 6, + "entity_hits": 0, + "openapi_signals": { + "path_found": false, + "method_found": false, + "request_schema": false, + "response_schema": false, + "status_codes": false, + "payload_description": false + } + }, + "gate_decision": "allow", + "gate_decision_reason": "evidence_sufficient", + "gate_missing_requirements": [], + "gate_satisfied_requirements": [ + "retrieval_non_empty" + ], + "openapi_evidence": { + "path_found": false, + "method_found": false, + "request_schema": false, + "response_schema": false, + "status_codes": false, + "payload_description": false + }, + "requested_fragment_type": null, + "fragment_evidence_found": [], + "fragment_missing_requirements": [], + "answer_mode": "ready", + "degrade_reason": null, + "degraded_reason": null, + "code_intents_stubbed": false +} + +## LLM Request +- prompt_name: docs_explain_answer +- log_context: graph.project_qa.docs.answer + +### Prompt Stats +```json +{ + "system_chars": 393, + "user_chars": 21501, + "tokens_in_estimate": 5474 +} +``` + +### System Prompt +```text +Ты объясняешь документацию системы. + +На вход приходит JSON с полями: +- question +- intent +- sub_intent +- documents +- facts +- relations + +Правила: +- Используй только предоставленные факты +- Не додумывай +- Если данных недостаточно, скажи это явно +- Объясняй структурировано + +Формат ответа: +1. Краткое описание +2. Основные элементы +3. Как это работает +4. Связи с другими частями системы (если есть) +``` + +### User Prompt +```json +{ + "question": "Роль TelegramControlChannel в системе", + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "COMPONENT_EXPLAIN", + "documents": [ + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "HTTP API /actions/{action}", + "content": "Endpoint `/actions/{action}` управляет control actions runtime и поддерживает `start`, `stop` и `status`. Для долгих операций `start` и `stop` допускается ответ HTTP 202, если действие еще выполняется. Endpoint используется для operator-driven управления жизненным циклом worker'а через HTTP API.", + "metadata": { + "name": "control_actions_endpoint", + "tags": [ + "api", + "control-plane", + "lifecycle" + ], + "type": "api_method", + "layer": "application", + "links": [ + { + "type": "part_of", + "target": "architecture.telegram_notify_app" + }, + { + "type": "related_api", + "target": "api.health_endpoint" + }, + { + "type": "related_logic", + "target": "logic.telegram_notification_loop" + } + ], + "owner": null, + "title": "HTTP API /actions/{action}", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "architecture.telegram_notify_app", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "children": [], + "doc_kind": "misc", + "entities": [ + "TelegramControlChannel", + "ControlActionSet", + "JSONResponse" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "api.control_actions_endpoint", + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "summary_text": "Endpoint `/actions/{action}` управляет control actions runtime и поддерживает `start`, `stop` и `status`. Для долгих операций `start` и `stop` допускается ответ HTTP 202, если действие еще выполняется. Endpoint используется для operator-driven управления жизненным циклом worker'а через HTTP API.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/architecture/telegram-notify-app-overview.md", + "title": "Архитектура Telegram Notify App", + "content": "`test_echo_app` — сервис на базе PLBA runtime, который поднимает HTTP control plane и запускает фоновый воркер для периодической отправки уведомлений в Telegram. Приложение использует YAML-конфиг для runtime-настроек и переменные окружения для Telegram credentials. Основной контур системы состоит из runtime manager, control channel, send service и worker loop.", + "metadata": { + "name": "telegram_notify_app_overview", + "tags": [ + "architecture", + "telegram", + "plba", + "runtime" + ], + "type": "architecture_overview", + "layer": "system", + "links": [ + { + "type": "related_api", + "target": "api.health_endpoint" + }, + { + "type": "related_api", + "target": "api.control_actions_endpoint" + }, + { + "type": "related_api", + "target": "api.send_message_endpoint" + }, + { + "type": "depends_on", + "target": "logic.telegram_notification_loop" + }, + { + "type": "depends_on", + "target": "domain.runtime_health" + } + ], + "owner": null, + "title": "Архитектура Telegram Notify App", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "docs_root", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "8b1cc9f823e55bddbc825466d10a0fdb4ca4354ac02d91f9e2aef7b7d2ec8256", + "children": [ + "api.health_endpoint", + "api.control_actions_endpoint", + "api.send_message_endpoint", + "logic.telegram_notification_loop", + "domain.runtime_health" + ], + "doc_kind": "spec", + "entities": [ + "TelegramNotifyModule", + "TelegramNotifyWorker", + "TelegramControlChannel", + "TelegramSendService", + "RuntimeManager" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "architecture.telegram_notify_app", + "source_path": "docs/documentation/architecture/telegram-notify-app-overview.md", + "summary_text": "`test_echo_app` — сервис на базе PLBA runtime, который поднимает HTTP control plane и запускает фоновый воркер для периодической отправки уведомлений в Telegram. Приложение использует YAML-конфиг для runtime-настроек и переменные окружения для Telegram credentials. Основной контур системы состоит из runtime manager, control channel, send service и worker loop.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/README.md", + "title": "Readme", + "content": "Readme", + "metadata": { + "name": "", + "tags": [], + "type": "", + "layer": "", + "links": [], + "owner": null, + "title": "Readme", + "doc_id": null, + "module": "", + "parent": null, + "status": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "81d952f1a6ea85b76f75e0e57f33b8fa4b2bf3cb7db11b91b90171aeedd655a6", + "children": [], + "doc_kind": "readme", + "entities": [], + "updated_at": null, + "doc_version": null, + "document_id": "docs/README.md", + "source_path": "docs/README.md", + "summary_text": "", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/domain/runtime-health-entity.md", + "title": "Сущность runtime health", + "content": "`runtime health` — доменная модель наблюдаемости сервиса, которая описывает общее состояние runtime и состояние отдельных компонентов. Для `test_echo_app` главным объектом наблюдения является компонент `telegram_notify`, у которого важны статус, время старта и количество успешных отправок. Эта модель используется для внешнего health-monitoring и внутренней диагностики.", + "metadata": { + "name": "runtime_health", + "tags": [ + "domain", + "health", + "observability" + ], + "type": "domain_entity", + "layer": "domain", + "links": [ + { + "type": "part_of", + "target": "architecture.telegram_notify_app" + }, + { + "type": "used_by", + "target": "api.health_endpoint" + }, + { + "type": "related_logic", + "target": "logic.telegram_notification_loop" + } + ], + "owner": null, + "title": "Сущность runtime health", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "architecture.telegram_notify_app", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "37d4dcf470ea3de95d59e44786006e369a3ea11bf5dbf4c88877696e9183ee87", + "children": [], + "doc_kind": "misc", + "entities": [ + "WorkerHealth", + "WorkerStatus", + "TelegramNotifyWorker" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "domain.runtime_health", + "source_path": "docs/documentation/domain/runtime-health-entity.md", + "summary_text": "`runtime health` — доменная модель наблюдаемости сервиса, которая описывает общее состояние runtime и состояние отдельных компонентов. Для `test_echo_app` главным объектом наблюдения является компонент `telegram_notify`, у которого важны статус, время старта и количество успешных отправок. Эта модель используется для внешнего health-monitoring и внутренней диагностики.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/logic/telegram-notification-loop.md", + "title": "Цикл отправки уведомлений в Telegram", + "content": "`TelegramNotifyWorker` после старта runtime запускает отдельный поток, сразу делает первую попытку отправки сообщения и затем повторяет отправку через заданный интервал. При ошибках доставки или отсутствии credentials worker не останавливает сервис, а переводит собственное состояние в `degraded`. Этот workflow определяет основной полезный цикл приложения.", + "metadata": { + "name": "telegram_notification_loop", + "tags": [ + "logic", + "telegram", + "worker", + "scheduling" + ], + "type": "logic_block", + "layer": "application", + "links": [ + { + "type": "part_of", + "target": "architecture.telegram_notify_app" + }, + { + "type": "related_api", + "target": "api.send_message_endpoint" + }, + { + "type": "related_api", + "target": "api.control_actions_endpoint" + }, + { + "type": "related_api", + "target": "api.health_endpoint" + } + ], + "owner": null, + "title": "Цикл отправки уведомлений в Telegram", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "architecture.telegram_notify_app", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "0f62f9b4dab261ca4ca34575ff5d84411a22c90b780c52eda388782b94f08470", + "children": [], + "doc_kind": "misc", + "entities": [ + "TelegramNotifyWorker", + "TelegramSendService", + "WorkerHealth", + "WorkerStatus" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "logic.telegram_notification_loop", + "source_path": "docs/documentation/logic/telegram-notification-loop.md", + "summary_text": "`TelegramNotifyWorker` после старта runtime запускает отдельный поток, сразу делает первую попытку отправки сообщения и затем повторяет отправку через заданный интервал. При ошибках доставки или отсутствии credentials worker не останавливает сервис, а переводит собственное состояние в `degraded`. Этот workflow определяет основной полезный цикл приложения.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/api/send-message-endpoint.md", + "title": "HTTP API /send", + "content": "Endpoint `/send` выполняет ручную отправку сообщения в Telegram через `TelegramSendService`. Он используется для операторской проверки доставки и для отправки уведомлений вне периодического worker loop. Endpoint работает поверх тех же credentials и того же delivery path, что и фоновая отправка.", + "metadata": { + "name": "send_message_endpoint", + "tags": [ + "api", + "telegram", + "manual-send" + ], + "type": "api_method", + "layer": "application", + "links": [ + { + "type": "part_of", + "target": "architecture.telegram_notify_app" + }, + { + "type": "depends_on", + "target": "logic.telegram_notification_loop" + } + ], + "owner": null, + "title": "HTTP API /send", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "architecture.telegram_notify_app", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "5fbf2e33510b0676a3a53b957a4569bd3c2c31fb7719546602c573421ccaa32d", + "children": [], + "doc_kind": "misc", + "entities": [ + "TelegramControlAppFactory", + "TelegramSendService", + "TelegramNotifyWorker" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "api.send_message_endpoint", + "source_path": "docs/documentation/api/send-message-endpoint.md", + "summary_text": "Endpoint `/send` выполняет ручную отправку сообщения в Telegram через `TelegramSendService`. Он используется для операторской проверки доставки и для отправки уведомлений вне периодического worker loop. Endpoint работает поверх тех же credentials и того же delivery path, что и фоновая отправка.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + } + ], + "facts": [ + { + "layer": "D2_FACT_INDEX", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "api.control_actions_endpoint:workflow_step", + "content": "api.control_actions_endpoint workflow_step HTTP control plane запущен.", + "metadata": { + "tags": [], + "owner": null, + "anchor": "Сценарий", + "doc_id": null, + "object": "HTTP control plane запущен.", + "fact_id": "b480201013a7e5231146f665773ebc54af37c28135f407c6b758304c74561645", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "predicate": "workflow_step", + "object_ref": null, + "subject_id": "api.control_actions_endpoint", + "doc_version": null, + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D2_FACT_INDEX", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "api.control_actions_endpoint:mentions_entity", + "content": "api.control_actions_endpoint mentions_entity ControlActionSet", + "metadata": { + "tags": [], + "owner": null, + "anchor": "frontmatter.entities", + "doc_id": null, + "object": "ControlActionSet", + "fact_id": "bafb867ffed41c9db637df98d6cd5f6722d7747bbebc6c03e6f0d0caf3b7f9f3", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "predicate": "mentions_entity", + "object_ref": null, + "subject_id": "api.control_actions_endpoint", + "doc_version": null, + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + } + ], + "relations": [ + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "api.control_actions_endpoint:parent", + "content": "api.control_actions_endpoint parent architecture.telegram_notify_app", + "metadata": { + "owner": null, + "anchor": "frontmatter.parent", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "source_id": "api.control_actions_endpoint", + "target_id": "architecture.telegram_notify_app", + "doc_version": null, + "relation_id": "afec31fd062e392dcd9699a92c7ab61fd4b1273c1a2b16702b23d55d8d0c47ac", + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "parent", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "api.control_actions_endpoint:related_api", + "content": "api.control_actions_endpoint related_api api.health_endpoint", + "metadata": { + "owner": null, + "anchor": "frontmatter.links", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "source_id": "api.control_actions_endpoint", + "target_id": "api.health_endpoint", + "doc_version": null, + "relation_id": "711fb2edb82dd222deaba3c91768b18cbbd453009235823282813c6e867dc2c1", + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "related_api", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "api.control_actions_endpoint:related_logic", + "content": "api.control_actions_endpoint related_logic logic.telegram_notification_loop", + "metadata": { + "owner": null, + "anchor": "frontmatter.links", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "source_id": "api.control_actions_endpoint", + "target_id": "logic.telegram_notification_loop", + "doc_version": null, + "relation_id": "eec79f7a02b804337e791ef231784862ae26e0599eb20224790e9d4f085fa9c0", + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "related_logic", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "api.control_actions_endpoint:part_of", + "content": "api.control_actions_endpoint part_of architecture.telegram_notify_app", + "metadata": { + "owner": null, + "anchor": "frontmatter.links", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "source_id": "api.control_actions_endpoint", + "target_id": "architecture.telegram_notify_app", + "doc_version": null, + "relation_id": "5f4909bde905cd3d294ad307074a05e4ae4deefcafe6272cd2d0436e73acb8dd", + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "part_of", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/architecture/telegram-notify-app-overview.md", + "title": "architecture.telegram_notify_app:child", + "content": "architecture.telegram_notify_app child api.control_actions_endpoint", + "metadata": { + "owner": null, + "anchor": "frontmatter.children", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "8b1cc9f823e55bddbc825466d10a0fdb4ca4354ac02d91f9e2aef7b7d2ec8256", + "source_id": "architecture.telegram_notify_app", + "target_id": "api.control_actions_endpoint", + "doc_version": null, + "relation_id": "ae34fe4b3cd2b47632b13b1e32303e842b57948aa21160abe8d9b478995e1d74", + "source_path": "docs/documentation/architecture/telegram-notify-app-overview.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "child", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/architecture/telegram-notify-app-overview.md", + "title": "architecture.telegram_notify_app:related_api", + "content": "architecture.telegram_notify_app related_api api.control_actions_endpoint", + "metadata": { + "owner": null, + "anchor": "frontmatter.links", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "8b1cc9f823e55bddbc825466d10a0fdb4ca4354ac02d91f9e2aef7b7d2ec8256", + "source_id": "architecture.telegram_notify_app", + "target_id": "api.control_actions_endpoint", + "doc_version": null, + "relation_id": "02530527e6e1d1e23316c9d25d0b30658d6c70063eb6e1d732d55c5ba29c9795", + "source_path": "docs/documentation/architecture/telegram-notify-app-overview.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "related_api", + "staleness_score": null, + "system_component": null + } + } + ] +} +``` + +### User Prompt Overview +- question: Роль TelegramControlChannel в системе +- intent: DOCUMENTATION_EXPLAIN +- sub_intent: COMPONENT_EXPLAIN +- documents: 6 | samples: HTTP API /actions/{action}, Архитектура Telegram Notify App, Readme +- facts: 2 | samples: api.control_actions_endpoint:workflow_step, api.control_actions_endpoint:mentions_entity +- relations: 6 | samples: api.control_actions_endpoint:parent, api.control_actions_endpoint:related_api, api.control_actions_endpoint:related_logic + +## Mismatches +- none \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/docs_pre_llm_v3/20260326_121025/full_chain_docs_intents_v3-3x_v3-component-runtime-manager-1.json b/tests/pipeline_setup_v3/test_results/docs_pre_llm_v3/20260326_121025/full_chain_docs_intents_v3-3x_v3-component-runtime-manager-1.json new file mode 100644 index 0000000..9bb41f2 --- /dev/null +++ b/tests/pipeline_setup_v3/test_results/docs_pre_llm_v3/20260326_121025/full_chain_docs_intents_v3-3x_v3-component-runtime-manager-1.json @@ -0,0 +1,92 @@ +{ + "meta": { + "case_id": "v3-component-runtime-manager-1", + "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_03_docs/full_chain_docs_intents_v3-3x.yaml", + "runner": "agent_runtime", + "mode": "pre_llm", + "passed": true, + "mismatches": [], + "actual": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "COMPONENT_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START", + "rag_count": 20, + "llm_answer": "", + "answer_mode": "answered", + "path_scope": [], + "doc_scope": [ + "api.control_actions_endpoint", + "api.actions_endpoint", + "architecture.telegram_notify_app", + "architecture.telegram_notify_app_overview", + "docs/README.md", + "domain.runtime_health", + "logic.telegram_notification_loop", + "api.send_message_endpoint" + ], + "entity_candidates": [ + "RuntimeManager" + ], + "symbol_candidates": [], + "layers": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "filters": { + "doc_type": null + }, + "pipeline_mode": "pre_llm_only", + "gate_decision": "allow", + "prompt_used": "docs_explain_answer", + "llm_mode": "prose", + "degraded_reason": null, + "code_intents_stubbed": true + } + }, + "pipeline_steps": [ + { + "step": "input_query", + "input": { + "query": "Что делает RuntimeManager?" + }, + "output": { + "query": "Что делает RuntimeManager?" + } + }, + { + "step": "router", + "input": { + "query": "Что делает RuntimeManager?" + }, + "output": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "COMPONENT_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START" + } + }, + { + "step": "docs_pipeline", + "input": { + "query": "Что делает RuntimeManager?" + }, + "output": { + "answer_mode": "ready", + "prompt_name": "docs_explain_answer", + "llm_request": { + "prompt_name": "docs_explain_answer", + "log_context": "graph.project_qa.docs.answer", + "prompt_stats": { + "system_chars": 393, + "user_chars": 21490, + "tokens_in_estimate": 5471 + } + }, + "degraded_reason": "" + } + } + ] +} \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/docs_pre_llm_v3/20260326_121025/full_chain_docs_intents_v3-3x_v3-component-runtime-manager-1.md b/tests/pipeline_setup_v3/test_results/docs_pre_llm_v3/20260326_121025/full_chain_docs_intents_v3-3x_v3-component-runtime-manager-1.md new file mode 100644 index 0000000..e6df2cd --- /dev/null +++ b/tests/pipeline_setup_v3/test_results/docs_pre_llm_v3/20260326_121025/full_chain_docs_intents_v3-3x_v3-component-runtime-manager-1.md @@ -0,0 +1,900 @@ +# v3-component-runtime-manager-1 + +- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_03_docs/full_chain_docs_intents_v3-3x.yaml +- runner: agent_runtime +- mode: pre_llm +- passed: True + +## Query +Что делает RuntimeManager? + +## Actual +{ + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "COMPONENT_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START", + "rag_count": 20, + "llm_answer": "", + "answer_mode": "answered", + "path_scope": [], + "doc_scope": [ + "api.control_actions_endpoint", + "api.actions_endpoint", + "architecture.telegram_notify_app", + "architecture.telegram_notify_app_overview", + "docs/README.md", + "domain.runtime_health", + "logic.telegram_notification_loop", + "api.send_message_endpoint" + ], + "entity_candidates": [ + "RuntimeManager" + ], + "symbol_candidates": [], + "layers": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "filters": { + "doc_type": null + }, + "pipeline_mode": "pre_llm_only", + "gate_decision": "allow", + "prompt_used": "docs_explain_answer", + "llm_mode": "prose", + "degraded_reason": null, + "code_intents_stubbed": true +} + +## Pipeline Steps +### input_query +```json +{ + "input": { + "query": "Что делает RuntimeManager?" + }, + "output": { + "query": "Что делает RuntimeManager?" + } +} +``` + +### router +```json +{ + "input": { + "query": "Что делает RuntimeManager?" + }, + "output": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "COMPONENT_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START" + } +} +``` + +### docs_pipeline +```json +{ + "input": { + "query": "Что делает RuntimeManager?" + }, + "output": { + "answer_mode": "ready", + "prompt_name": "docs_explain_answer", + "llm_request": { + "prompt_name": "docs_explain_answer", + "log_context": "graph.project_qa.docs.answer", + "prompt_stats": { + "system_chars": 393, + "user_chars": 21490, + "tokens_in_estimate": 5471 + } + }, + "degraded_reason": "" + } +} +``` + +## Diagnostics +{ + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "COMPONENT_EXPLAIN", + "layers_used": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "documents_found": 6, + "facts_found": 2, + "relations_found": 6, + "openapi_fields_extracted": 0, + "missing_required_fields": [], + "openapi_status": { + "has_path": false, + "has_method": false, + "has_request": false, + "has_response": false + }, + "prompt_used": "docs_explain_answer", + "llm_mode": "prose", + "output_valid": true, + "matched_intent_source": "deterministic", + "matched_anchor_type": "none", + "matched_anchor_value": null, + "exact_anchor_match": false, + "docs_layers_requested": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "docs_layers_with_hits": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "planned_layers": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "executed_layers": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "non_empty_layers": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "layer_diagnostics": { + "D1_DOCUMENT_CATALOG": { + "hits": 6, + "top_ids": [ + "api.control_actions_endpoint", + "architecture.telegram_notify_app", + "docs/README.md", + "domain.runtime_health", + "logic.telegram_notification_loop" + ] + }, + "D2_FACT_INDEX": { + "hits": 8, + "top_ids": [ + "b480201013a7e5231146f665773ebc54af37c28135f407c6b758304c74561645", + "b8e44c3adb74aaa6c91ae8815fa091289e58dd3990a3a1b63e850c62075aea75", + "bafb867ffed41c9db637df98d6cd5f6722d7747bbebc6c03e6f0d0caf3b7f9f3", + "54bbcbac242f1c85ec3280236ed5841998a8a3a548ff16cbf0b5acafbff469e3", + "b6bfad59b3bf00f199b5ef90c1208af19664de700413e7354468a93a4abaaa2f" + ] + }, + "D5_RELATION_GRAPH": { + "hits": 6, + "top_ids": [ + "afec31fd062e392dcd9699a92c7ab61fd4b1273c1a2b16702b23d55d8d0c47ac", + "711fb2edb82dd222deaba3c91768b18cbbd453009235823282813c6e867dc2c1", + "eec79f7a02b804337e791ef231784862ae26e0599eb20224790e9d4f085fa9c0", + "5f4909bde905cd3d294ad307074a05e4ae4deefcafe6272cd2d0436e73acb8dd", + "ae34fe4b3cd2b47632b13b1e32303e842b57948aa21160abe8d9b478995e1d74" + ] + }, + "D0_DOC_CHUNKS": { + "hits": 6, + "top_ids": [ + "api.control_actions_endpoint" + ] + } + }, + "query_entity_candidates": [ + "RuntimeManager" + ], + "resolved_entity_candidates": [], + "query_anchor_candidates": [ + "RuntimeManager" + ], + "resolved_anchor_candidates": [ + "api.control_actions_endpoint", + "docs/documentation/api/control-actions-endpoint.md", + "architecture.telegram_notify_app", + "docs/documentation/architecture/telegram-notify-app-overview.md", + "docs/README.md", + "domain.runtime_health", + "docs/documentation/domain/runtime-health-entity.md", + "logic.telegram_notification_loop", + "docs/documentation/logic/telegram-notification-loop.md", + "api.send_message_endpoint", + "docs/documentation/api/send-message-endpoint.md" + ], + "anchor_candidates": [], + "selected_anchor": null, + "anchor_selection_reason": "", + "anchor_match_type": "", + "doc_ids": [ + "api.control_actions_endpoint", + "api.actions_endpoint", + "architecture.telegram_notify_app", + "architecture.telegram_notify_app_overview", + "docs/README.md", + "domain.runtime_health", + "logic.telegram_notification_loop", + "api.send_message_endpoint" + ], + "doc_paths": [ + "docs/documentation/api/control-actions-endpoint.md", + "docs/documentation/architecture/telegram-notify-app-overview.md", + "docs/README.md", + "docs/documentation/domain/runtime-health-entity.md", + "docs/documentation/logic/telegram-notification-loop.md", + "docs/documentation/api/send-message-endpoint.md" + ], + "doc_titles": [ + "HTTP API /actions/{action}", + "Архитектура Telegram Notify App", + "Readme", + "Сущность runtime health", + "Цикл отправки уведомлений в Telegram", + "HTTP API /send", + "api.control_actions_endpoint:workflow_step", + "api.control_actions_endpoint:mentions_entity", + "api.control_actions_endpoint:parent", + "api.control_actions_endpoint:related_api", + "api.control_actions_endpoint:related_logic", + "api.control_actions_endpoint:part_of", + "architecture.telegram_notify_app:child", + "architecture.telegram_notify_app:related_api", + "api.control_actions_endpoint:Функциональные требования", + "api.control_actions_endpoint:Нефункциональные требования", + "api.control_actions_endpoint:Сценарий", + "api.control_actions_endpoint:Summary", + "api.control_actions_endpoint:Описание", + "api.control_actions_endpoint:Входные параметры" + ], + "relation_hits_count": 6, + "relation_targets": [ + "api.control_actions_endpoint:parent", + "api.control_actions_endpoint:related_api", + "api.control_actions_endpoint:related_logic", + "api.control_actions_endpoint:part_of", + "architecture.telegram_notify_app:child", + "architecture.telegram_notify_app:related_api" + ], + "fallback_doc_hits_count": 12, + "fallback_used": false, + "fact_hits": 2, + "entity_hits": 0, + "evidence_summary": { + "documents": 6, + "facts": 2, + "relations": 6, + "chunks": 6, + "entity_hits": 0, + "openapi_signals": { + "path_found": false, + "method_found": false, + "request_schema": false, + "response_schema": false, + "status_codes": false, + "payload_description": false + } + }, + "gate_decision": "allow", + "gate_decision_reason": "evidence_sufficient", + "gate_missing_requirements": [], + "gate_satisfied_requirements": [ + "retrieval_non_empty" + ], + "openapi_evidence": { + "path_found": false, + "method_found": false, + "request_schema": false, + "response_schema": false, + "status_codes": false, + "payload_description": false + }, + "requested_fragment_type": null, + "fragment_evidence_found": [], + "fragment_missing_requirements": [], + "answer_mode": "ready", + "degrade_reason": null, + "degraded_reason": null, + "code_intents_stubbed": false +} + +## LLM Request +- prompt_name: docs_explain_answer +- log_context: graph.project_qa.docs.answer + +### Prompt Stats +```json +{ + "system_chars": 393, + "user_chars": 21490, + "tokens_in_estimate": 5471 +} +``` + +### System Prompt +```text +Ты объясняешь документацию системы. + +На вход приходит JSON с полями: +- question +- intent +- sub_intent +- documents +- facts +- relations + +Правила: +- Используй только предоставленные факты +- Не додумывай +- Если данных недостаточно, скажи это явно +- Объясняй структурировано + +Формат ответа: +1. Краткое описание +2. Основные элементы +3. Как это работает +4. Связи с другими частями системы (если есть) +``` + +### User Prompt +```json +{ + "question": "Что делает RuntimeManager?", + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "COMPONENT_EXPLAIN", + "documents": [ + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "HTTP API /actions/{action}", + "content": "Endpoint `/actions/{action}` управляет control actions runtime и поддерживает `start`, `stop` и `status`. Для долгих операций `start` и `stop` допускается ответ HTTP 202, если действие еще выполняется. Endpoint используется для operator-driven управления жизненным циклом worker'а через HTTP API.", + "metadata": { + "name": "control_actions_endpoint", + "tags": [ + "api", + "control-plane", + "lifecycle" + ], + "type": "api_method", + "layer": "application", + "links": [ + { + "type": "part_of", + "target": "architecture.telegram_notify_app" + }, + { + "type": "related_api", + "target": "api.health_endpoint" + }, + { + "type": "related_logic", + "target": "logic.telegram_notification_loop" + } + ], + "owner": null, + "title": "HTTP API /actions/{action}", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "architecture.telegram_notify_app", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "children": [], + "doc_kind": "misc", + "entities": [ + "TelegramControlChannel", + "ControlActionSet", + "JSONResponse" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "api.control_actions_endpoint", + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "summary_text": "Endpoint `/actions/{action}` управляет control actions runtime и поддерживает `start`, `stop` и `status`. Для долгих операций `start` и `stop` допускается ответ HTTP 202, если действие еще выполняется. Endpoint используется для operator-driven управления жизненным циклом worker'а через HTTP API.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/architecture/telegram-notify-app-overview.md", + "title": "Архитектура Telegram Notify App", + "content": "`test_echo_app` — сервис на базе PLBA runtime, который поднимает HTTP control plane и запускает фоновый воркер для периодической отправки уведомлений в Telegram. Приложение использует YAML-конфиг для runtime-настроек и переменные окружения для Telegram credentials. Основной контур системы состоит из runtime manager, control channel, send service и worker loop.", + "metadata": { + "name": "telegram_notify_app_overview", + "tags": [ + "architecture", + "telegram", + "plba", + "runtime" + ], + "type": "architecture_overview", + "layer": "system", + "links": [ + { + "type": "related_api", + "target": "api.health_endpoint" + }, + { + "type": "related_api", + "target": "api.control_actions_endpoint" + }, + { + "type": "related_api", + "target": "api.send_message_endpoint" + }, + { + "type": "depends_on", + "target": "logic.telegram_notification_loop" + }, + { + "type": "depends_on", + "target": "domain.runtime_health" + } + ], + "owner": null, + "title": "Архитектура Telegram Notify App", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "docs_root", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "8b1cc9f823e55bddbc825466d10a0fdb4ca4354ac02d91f9e2aef7b7d2ec8256", + "children": [ + "api.health_endpoint", + "api.control_actions_endpoint", + "api.send_message_endpoint", + "logic.telegram_notification_loop", + "domain.runtime_health" + ], + "doc_kind": "spec", + "entities": [ + "TelegramNotifyModule", + "TelegramNotifyWorker", + "TelegramControlChannel", + "TelegramSendService", + "RuntimeManager" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "architecture.telegram_notify_app", + "source_path": "docs/documentation/architecture/telegram-notify-app-overview.md", + "summary_text": "`test_echo_app` — сервис на базе PLBA runtime, который поднимает HTTP control plane и запускает фоновый воркер для периодической отправки уведомлений в Telegram. Приложение использует YAML-конфиг для runtime-настроек и переменные окружения для Telegram credentials. Основной контур системы состоит из runtime manager, control channel, send service и worker loop.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/README.md", + "title": "Readme", + "content": "Readme", + "metadata": { + "name": "", + "tags": [], + "type": "", + "layer": "", + "links": [], + "owner": null, + "title": "Readme", + "doc_id": null, + "module": "", + "parent": null, + "status": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "81d952f1a6ea85b76f75e0e57f33b8fa4b2bf3cb7db11b91b90171aeedd655a6", + "children": [], + "doc_kind": "readme", + "entities": [], + "updated_at": null, + "doc_version": null, + "document_id": "docs/README.md", + "source_path": "docs/README.md", + "summary_text": "", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/domain/runtime-health-entity.md", + "title": "Сущность runtime health", + "content": "`runtime health` — доменная модель наблюдаемости сервиса, которая описывает общее состояние runtime и состояние отдельных компонентов. Для `test_echo_app` главным объектом наблюдения является компонент `telegram_notify`, у которого важны статус, время старта и количество успешных отправок. Эта модель используется для внешнего health-monitoring и внутренней диагностики.", + "metadata": { + "name": "runtime_health", + "tags": [ + "domain", + "health", + "observability" + ], + "type": "domain_entity", + "layer": "domain", + "links": [ + { + "type": "part_of", + "target": "architecture.telegram_notify_app" + }, + { + "type": "used_by", + "target": "api.health_endpoint" + }, + { + "type": "related_logic", + "target": "logic.telegram_notification_loop" + } + ], + "owner": null, + "title": "Сущность runtime health", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "architecture.telegram_notify_app", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "37d4dcf470ea3de95d59e44786006e369a3ea11bf5dbf4c88877696e9183ee87", + "children": [], + "doc_kind": "misc", + "entities": [ + "WorkerHealth", + "WorkerStatus", + "TelegramNotifyWorker" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "domain.runtime_health", + "source_path": "docs/documentation/domain/runtime-health-entity.md", + "summary_text": "`runtime health` — доменная модель наблюдаемости сервиса, которая описывает общее состояние runtime и состояние отдельных компонентов. Для `test_echo_app` главным объектом наблюдения является компонент `telegram_notify`, у которого важны статус, время старта и количество успешных отправок. Эта модель используется для внешнего health-monitoring и внутренней диагностики.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/logic/telegram-notification-loop.md", + "title": "Цикл отправки уведомлений в Telegram", + "content": "`TelegramNotifyWorker` после старта runtime запускает отдельный поток, сразу делает первую попытку отправки сообщения и затем повторяет отправку через заданный интервал. При ошибках доставки или отсутствии credentials worker не останавливает сервис, а переводит собственное состояние в `degraded`. Этот workflow определяет основной полезный цикл приложения.", + "metadata": { + "name": "telegram_notification_loop", + "tags": [ + "logic", + "telegram", + "worker", + "scheduling" + ], + "type": "logic_block", + "layer": "application", + "links": [ + { + "type": "part_of", + "target": "architecture.telegram_notify_app" + }, + { + "type": "related_api", + "target": "api.send_message_endpoint" + }, + { + "type": "related_api", + "target": "api.control_actions_endpoint" + }, + { + "type": "related_api", + "target": "api.health_endpoint" + } + ], + "owner": null, + "title": "Цикл отправки уведомлений в Telegram", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "architecture.telegram_notify_app", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "0f62f9b4dab261ca4ca34575ff5d84411a22c90b780c52eda388782b94f08470", + "children": [], + "doc_kind": "misc", + "entities": [ + "TelegramNotifyWorker", + "TelegramSendService", + "WorkerHealth", + "WorkerStatus" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "logic.telegram_notification_loop", + "source_path": "docs/documentation/logic/telegram-notification-loop.md", + "summary_text": "`TelegramNotifyWorker` после старта runtime запускает отдельный поток, сразу делает первую попытку отправки сообщения и затем повторяет отправку через заданный интервал. При ошибках доставки или отсутствии credentials worker не останавливает сервис, а переводит собственное состояние в `degraded`. Этот workflow определяет основной полезный цикл приложения.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/api/send-message-endpoint.md", + "title": "HTTP API /send", + "content": "Endpoint `/send` выполняет ручную отправку сообщения в Telegram через `TelegramSendService`. Он используется для операторской проверки доставки и для отправки уведомлений вне периодического worker loop. Endpoint работает поверх тех же credentials и того же delivery path, что и фоновая отправка.", + "metadata": { + "name": "send_message_endpoint", + "tags": [ + "api", + "telegram", + "manual-send" + ], + "type": "api_method", + "layer": "application", + "links": [ + { + "type": "part_of", + "target": "architecture.telegram_notify_app" + }, + { + "type": "depends_on", + "target": "logic.telegram_notification_loop" + } + ], + "owner": null, + "title": "HTTP API /send", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "architecture.telegram_notify_app", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "5fbf2e33510b0676a3a53b957a4569bd3c2c31fb7719546602c573421ccaa32d", + "children": [], + "doc_kind": "misc", + "entities": [ + "TelegramControlAppFactory", + "TelegramSendService", + "TelegramNotifyWorker" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "api.send_message_endpoint", + "source_path": "docs/documentation/api/send-message-endpoint.md", + "summary_text": "Endpoint `/send` выполняет ручную отправку сообщения в Telegram через `TelegramSendService`. Он используется для операторской проверки доставки и для отправки уведомлений вне периодического worker loop. Endpoint работает поверх тех же credentials и того же delivery path, что и фоновая отправка.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + } + ], + "facts": [ + { + "layer": "D2_FACT_INDEX", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "api.control_actions_endpoint:workflow_step", + "content": "api.control_actions_endpoint workflow_step HTTP control plane запущен.", + "metadata": { + "tags": [], + "owner": null, + "anchor": "Сценарий", + "doc_id": null, + "object": "HTTP control plane запущен.", + "fact_id": "b480201013a7e5231146f665773ebc54af37c28135f407c6b758304c74561645", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "predicate": "workflow_step", + "object_ref": null, + "subject_id": "api.control_actions_endpoint", + "doc_version": null, + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D2_FACT_INDEX", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "api.control_actions_endpoint:mentions_entity", + "content": "api.control_actions_endpoint mentions_entity ControlActionSet", + "metadata": { + "tags": [], + "owner": null, + "anchor": "frontmatter.entities", + "doc_id": null, + "object": "ControlActionSet", + "fact_id": "bafb867ffed41c9db637df98d6cd5f6722d7747bbebc6c03e6f0d0caf3b7f9f3", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "predicate": "mentions_entity", + "object_ref": null, + "subject_id": "api.control_actions_endpoint", + "doc_version": null, + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + } + ], + "relations": [ + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "api.control_actions_endpoint:parent", + "content": "api.control_actions_endpoint parent architecture.telegram_notify_app", + "metadata": { + "owner": null, + "anchor": "frontmatter.parent", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "source_id": "api.control_actions_endpoint", + "target_id": "architecture.telegram_notify_app", + "doc_version": null, + "relation_id": "afec31fd062e392dcd9699a92c7ab61fd4b1273c1a2b16702b23d55d8d0c47ac", + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "parent", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "api.control_actions_endpoint:related_api", + "content": "api.control_actions_endpoint related_api api.health_endpoint", + "metadata": { + "owner": null, + "anchor": "frontmatter.links", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "source_id": "api.control_actions_endpoint", + "target_id": "api.health_endpoint", + "doc_version": null, + "relation_id": "711fb2edb82dd222deaba3c91768b18cbbd453009235823282813c6e867dc2c1", + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "related_api", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "api.control_actions_endpoint:related_logic", + "content": "api.control_actions_endpoint related_logic logic.telegram_notification_loop", + "metadata": { + "owner": null, + "anchor": "frontmatter.links", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "source_id": "api.control_actions_endpoint", + "target_id": "logic.telegram_notification_loop", + "doc_version": null, + "relation_id": "eec79f7a02b804337e791ef231784862ae26e0599eb20224790e9d4f085fa9c0", + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "related_logic", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "api.control_actions_endpoint:part_of", + "content": "api.control_actions_endpoint part_of architecture.telegram_notify_app", + "metadata": { + "owner": null, + "anchor": "frontmatter.links", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "source_id": "api.control_actions_endpoint", + "target_id": "architecture.telegram_notify_app", + "doc_version": null, + "relation_id": "5f4909bde905cd3d294ad307074a05e4ae4deefcafe6272cd2d0436e73acb8dd", + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "part_of", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/architecture/telegram-notify-app-overview.md", + "title": "architecture.telegram_notify_app:child", + "content": "architecture.telegram_notify_app child api.control_actions_endpoint", + "metadata": { + "owner": null, + "anchor": "frontmatter.children", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "8b1cc9f823e55bddbc825466d10a0fdb4ca4354ac02d91f9e2aef7b7d2ec8256", + "source_id": "architecture.telegram_notify_app", + "target_id": "api.control_actions_endpoint", + "doc_version": null, + "relation_id": "ae34fe4b3cd2b47632b13b1e32303e842b57948aa21160abe8d9b478995e1d74", + "source_path": "docs/documentation/architecture/telegram-notify-app-overview.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "child", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/architecture/telegram-notify-app-overview.md", + "title": "architecture.telegram_notify_app:related_api", + "content": "architecture.telegram_notify_app related_api api.control_actions_endpoint", + "metadata": { + "owner": null, + "anchor": "frontmatter.links", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "8b1cc9f823e55bddbc825466d10a0fdb4ca4354ac02d91f9e2aef7b7d2ec8256", + "source_id": "architecture.telegram_notify_app", + "target_id": "api.control_actions_endpoint", + "doc_version": null, + "relation_id": "02530527e6e1d1e23316c9d25d0b30658d6c70063eb6e1d732d55c5ba29c9795", + "source_path": "docs/documentation/architecture/telegram-notify-app-overview.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "related_api", + "staleness_score": null, + "system_component": null + } + } + ] +} +``` + +### User Prompt Overview +- question: Что делает RuntimeManager? +- intent: DOCUMENTATION_EXPLAIN +- sub_intent: COMPONENT_EXPLAIN +- documents: 6 | samples: HTTP API /actions/{action}, Архитектура Telegram Notify App, Readme +- facts: 2 | samples: api.control_actions_endpoint:workflow_step, api.control_actions_endpoint:mentions_entity +- relations: 6 | samples: api.control_actions_endpoint:parent, api.control_actions_endpoint:related_api, api.control_actions_endpoint:related_logic + +## Mismatches +- none \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/docs_pre_llm_v3/20260326_121025/full_chain_docs_intents_v3-3x_v3-component-runtime-manager-2.json b/tests/pipeline_setup_v3/test_results/docs_pre_llm_v3/20260326_121025/full_chain_docs_intents_v3-3x_v3-component-runtime-manager-2.json new file mode 100644 index 0000000..06f11d9 --- /dev/null +++ b/tests/pipeline_setup_v3/test_results/docs_pre_llm_v3/20260326_121025/full_chain_docs_intents_v3-3x_v3-component-runtime-manager-2.json @@ -0,0 +1,92 @@ +{ + "meta": { + "case_id": "v3-component-runtime-manager-2", + "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_03_docs/full_chain_docs_intents_v3-3x.yaml", + "runner": "agent_runtime", + "mode": "pre_llm", + "passed": true, + "mismatches": [], + "actual": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "COMPONENT_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START", + "rag_count": 20, + "llm_answer": "", + "answer_mode": "answered", + "path_scope": [], + "doc_scope": [ + "api.control_actions_endpoint", + "api.actions_endpoint", + "architecture.telegram_notify_app", + "architecture.telegram_notify_app_overview", + "docs/README.md", + "domain.runtime_health", + "logic.telegram_notification_loop", + "api.send_message_endpoint" + ], + "entity_candidates": [ + "RuntimeManager" + ], + "symbol_candidates": [], + "layers": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "filters": { + "doc_type": null + }, + "pipeline_mode": "pre_llm_only", + "gate_decision": "allow", + "prompt_used": "docs_explain_answer", + "llm_mode": "prose", + "degraded_reason": null, + "code_intents_stubbed": true + } + }, + "pipeline_steps": [ + { + "step": "input_query", + "input": { + "query": "Как устроен RuntimeManager?" + }, + "output": { + "query": "Как устроен RuntimeManager?" + } + }, + { + "step": "router", + "input": { + "query": "Как устроен RuntimeManager?" + }, + "output": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "COMPONENT_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START" + } + }, + { + "step": "docs_pipeline", + "input": { + "query": "Как устроен RuntimeManager?" + }, + "output": { + "answer_mode": "ready", + "prompt_name": "docs_explain_answer", + "llm_request": { + "prompt_name": "docs_explain_answer", + "log_context": "graph.project_qa.docs.answer", + "prompt_stats": { + "system_chars": 393, + "user_chars": 21491, + "tokens_in_estimate": 5471 + } + }, + "degraded_reason": "" + } + } + ] +} \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/docs_pre_llm_v3/20260326_121025/full_chain_docs_intents_v3-3x_v3-component-runtime-manager-2.md b/tests/pipeline_setup_v3/test_results/docs_pre_llm_v3/20260326_121025/full_chain_docs_intents_v3-3x_v3-component-runtime-manager-2.md new file mode 100644 index 0000000..a63e1e7 --- /dev/null +++ b/tests/pipeline_setup_v3/test_results/docs_pre_llm_v3/20260326_121025/full_chain_docs_intents_v3-3x_v3-component-runtime-manager-2.md @@ -0,0 +1,900 @@ +# v3-component-runtime-manager-2 + +- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_03_docs/full_chain_docs_intents_v3-3x.yaml +- runner: agent_runtime +- mode: pre_llm +- passed: True + +## Query +Как устроен RuntimeManager? + +## Actual +{ + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "COMPONENT_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START", + "rag_count": 20, + "llm_answer": "", + "answer_mode": "answered", + "path_scope": [], + "doc_scope": [ + "api.control_actions_endpoint", + "api.actions_endpoint", + "architecture.telegram_notify_app", + "architecture.telegram_notify_app_overview", + "docs/README.md", + "domain.runtime_health", + "logic.telegram_notification_loop", + "api.send_message_endpoint" + ], + "entity_candidates": [ + "RuntimeManager" + ], + "symbol_candidates": [], + "layers": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "filters": { + "doc_type": null + }, + "pipeline_mode": "pre_llm_only", + "gate_decision": "allow", + "prompt_used": "docs_explain_answer", + "llm_mode": "prose", + "degraded_reason": null, + "code_intents_stubbed": true +} + +## Pipeline Steps +### input_query +```json +{ + "input": { + "query": "Как устроен RuntimeManager?" + }, + "output": { + "query": "Как устроен RuntimeManager?" + } +} +``` + +### router +```json +{ + "input": { + "query": "Как устроен RuntimeManager?" + }, + "output": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "COMPONENT_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START" + } +} +``` + +### docs_pipeline +```json +{ + "input": { + "query": "Как устроен RuntimeManager?" + }, + "output": { + "answer_mode": "ready", + "prompt_name": "docs_explain_answer", + "llm_request": { + "prompt_name": "docs_explain_answer", + "log_context": "graph.project_qa.docs.answer", + "prompt_stats": { + "system_chars": 393, + "user_chars": 21491, + "tokens_in_estimate": 5471 + } + }, + "degraded_reason": "" + } +} +``` + +## Diagnostics +{ + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "COMPONENT_EXPLAIN", + "layers_used": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "documents_found": 6, + "facts_found": 2, + "relations_found": 6, + "openapi_fields_extracted": 0, + "missing_required_fields": [], + "openapi_status": { + "has_path": false, + "has_method": false, + "has_request": false, + "has_response": false + }, + "prompt_used": "docs_explain_answer", + "llm_mode": "prose", + "output_valid": true, + "matched_intent_source": "deterministic", + "matched_anchor_type": "none", + "matched_anchor_value": null, + "exact_anchor_match": false, + "docs_layers_requested": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "docs_layers_with_hits": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "planned_layers": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "executed_layers": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "non_empty_layers": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "layer_diagnostics": { + "D1_DOCUMENT_CATALOG": { + "hits": 6, + "top_ids": [ + "api.control_actions_endpoint", + "architecture.telegram_notify_app", + "docs/README.md", + "domain.runtime_health", + "logic.telegram_notification_loop" + ] + }, + "D2_FACT_INDEX": { + "hits": 8, + "top_ids": [ + "b480201013a7e5231146f665773ebc54af37c28135f407c6b758304c74561645", + "b8e44c3adb74aaa6c91ae8815fa091289e58dd3990a3a1b63e850c62075aea75", + "bafb867ffed41c9db637df98d6cd5f6722d7747bbebc6c03e6f0d0caf3b7f9f3", + "54bbcbac242f1c85ec3280236ed5841998a8a3a548ff16cbf0b5acafbff469e3", + "b6bfad59b3bf00f199b5ef90c1208af19664de700413e7354468a93a4abaaa2f" + ] + }, + "D5_RELATION_GRAPH": { + "hits": 6, + "top_ids": [ + "afec31fd062e392dcd9699a92c7ab61fd4b1273c1a2b16702b23d55d8d0c47ac", + "711fb2edb82dd222deaba3c91768b18cbbd453009235823282813c6e867dc2c1", + "eec79f7a02b804337e791ef231784862ae26e0599eb20224790e9d4f085fa9c0", + "5f4909bde905cd3d294ad307074a05e4ae4deefcafe6272cd2d0436e73acb8dd", + "ae34fe4b3cd2b47632b13b1e32303e842b57948aa21160abe8d9b478995e1d74" + ] + }, + "D0_DOC_CHUNKS": { + "hits": 6, + "top_ids": [ + "api.control_actions_endpoint" + ] + } + }, + "query_entity_candidates": [ + "RuntimeManager" + ], + "resolved_entity_candidates": [], + "query_anchor_candidates": [ + "RuntimeManager" + ], + "resolved_anchor_candidates": [ + "api.control_actions_endpoint", + "docs/documentation/api/control-actions-endpoint.md", + "architecture.telegram_notify_app", + "docs/documentation/architecture/telegram-notify-app-overview.md", + "docs/README.md", + "domain.runtime_health", + "docs/documentation/domain/runtime-health-entity.md", + "logic.telegram_notification_loop", + "docs/documentation/logic/telegram-notification-loop.md", + "api.send_message_endpoint", + "docs/documentation/api/send-message-endpoint.md" + ], + "anchor_candidates": [], + "selected_anchor": null, + "anchor_selection_reason": "", + "anchor_match_type": "", + "doc_ids": [ + "api.control_actions_endpoint", + "api.actions_endpoint", + "architecture.telegram_notify_app", + "architecture.telegram_notify_app_overview", + "docs/README.md", + "domain.runtime_health", + "logic.telegram_notification_loop", + "api.send_message_endpoint" + ], + "doc_paths": [ + "docs/documentation/api/control-actions-endpoint.md", + "docs/documentation/architecture/telegram-notify-app-overview.md", + "docs/README.md", + "docs/documentation/domain/runtime-health-entity.md", + "docs/documentation/logic/telegram-notification-loop.md", + "docs/documentation/api/send-message-endpoint.md" + ], + "doc_titles": [ + "HTTP API /actions/{action}", + "Архитектура Telegram Notify App", + "Readme", + "Сущность runtime health", + "Цикл отправки уведомлений в Telegram", + "HTTP API /send", + "api.control_actions_endpoint:workflow_step", + "api.control_actions_endpoint:mentions_entity", + "api.control_actions_endpoint:parent", + "api.control_actions_endpoint:related_api", + "api.control_actions_endpoint:related_logic", + "api.control_actions_endpoint:part_of", + "architecture.telegram_notify_app:child", + "architecture.telegram_notify_app:related_api", + "api.control_actions_endpoint:Функциональные требования", + "api.control_actions_endpoint:Нефункциональные требования", + "api.control_actions_endpoint:Сценарий", + "api.control_actions_endpoint:Summary", + "api.control_actions_endpoint:Описание", + "api.control_actions_endpoint:Входные параметры" + ], + "relation_hits_count": 6, + "relation_targets": [ + "api.control_actions_endpoint:parent", + "api.control_actions_endpoint:related_api", + "api.control_actions_endpoint:related_logic", + "api.control_actions_endpoint:part_of", + "architecture.telegram_notify_app:child", + "architecture.telegram_notify_app:related_api" + ], + "fallback_doc_hits_count": 12, + "fallback_used": false, + "fact_hits": 2, + "entity_hits": 0, + "evidence_summary": { + "documents": 6, + "facts": 2, + "relations": 6, + "chunks": 6, + "entity_hits": 0, + "openapi_signals": { + "path_found": false, + "method_found": false, + "request_schema": false, + "response_schema": false, + "status_codes": false, + "payload_description": false + } + }, + "gate_decision": "allow", + "gate_decision_reason": "evidence_sufficient", + "gate_missing_requirements": [], + "gate_satisfied_requirements": [ + "retrieval_non_empty" + ], + "openapi_evidence": { + "path_found": false, + "method_found": false, + "request_schema": false, + "response_schema": false, + "status_codes": false, + "payload_description": false + }, + "requested_fragment_type": null, + "fragment_evidence_found": [], + "fragment_missing_requirements": [], + "answer_mode": "ready", + "degrade_reason": null, + "degraded_reason": null, + "code_intents_stubbed": false +} + +## LLM Request +- prompt_name: docs_explain_answer +- log_context: graph.project_qa.docs.answer + +### Prompt Stats +```json +{ + "system_chars": 393, + "user_chars": 21491, + "tokens_in_estimate": 5471 +} +``` + +### System Prompt +```text +Ты объясняешь документацию системы. + +На вход приходит JSON с полями: +- question +- intent +- sub_intent +- documents +- facts +- relations + +Правила: +- Используй только предоставленные факты +- Не додумывай +- Если данных недостаточно, скажи это явно +- Объясняй структурировано + +Формат ответа: +1. Краткое описание +2. Основные элементы +3. Как это работает +4. Связи с другими частями системы (если есть) +``` + +### User Prompt +```json +{ + "question": "Как устроен RuntimeManager?", + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "COMPONENT_EXPLAIN", + "documents": [ + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "HTTP API /actions/{action}", + "content": "Endpoint `/actions/{action}` управляет control actions runtime и поддерживает `start`, `stop` и `status`. Для долгих операций `start` и `stop` допускается ответ HTTP 202, если действие еще выполняется. Endpoint используется для operator-driven управления жизненным циклом worker'а через HTTP API.", + "metadata": { + "name": "control_actions_endpoint", + "tags": [ + "api", + "control-plane", + "lifecycle" + ], + "type": "api_method", + "layer": "application", + "links": [ + { + "type": "part_of", + "target": "architecture.telegram_notify_app" + }, + { + "type": "related_api", + "target": "api.health_endpoint" + }, + { + "type": "related_logic", + "target": "logic.telegram_notification_loop" + } + ], + "owner": null, + "title": "HTTP API /actions/{action}", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "architecture.telegram_notify_app", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "children": [], + "doc_kind": "misc", + "entities": [ + "TelegramControlChannel", + "ControlActionSet", + "JSONResponse" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "api.control_actions_endpoint", + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "summary_text": "Endpoint `/actions/{action}` управляет control actions runtime и поддерживает `start`, `stop` и `status`. Для долгих операций `start` и `stop` допускается ответ HTTP 202, если действие еще выполняется. Endpoint используется для operator-driven управления жизненным циклом worker'а через HTTP API.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/architecture/telegram-notify-app-overview.md", + "title": "Архитектура Telegram Notify App", + "content": "`test_echo_app` — сервис на базе PLBA runtime, который поднимает HTTP control plane и запускает фоновый воркер для периодической отправки уведомлений в Telegram. Приложение использует YAML-конфиг для runtime-настроек и переменные окружения для Telegram credentials. Основной контур системы состоит из runtime manager, control channel, send service и worker loop.", + "metadata": { + "name": "telegram_notify_app_overview", + "tags": [ + "architecture", + "telegram", + "plba", + "runtime" + ], + "type": "architecture_overview", + "layer": "system", + "links": [ + { + "type": "related_api", + "target": "api.health_endpoint" + }, + { + "type": "related_api", + "target": "api.control_actions_endpoint" + }, + { + "type": "related_api", + "target": "api.send_message_endpoint" + }, + { + "type": "depends_on", + "target": "logic.telegram_notification_loop" + }, + { + "type": "depends_on", + "target": "domain.runtime_health" + } + ], + "owner": null, + "title": "Архитектура Telegram Notify App", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "docs_root", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "8b1cc9f823e55bddbc825466d10a0fdb4ca4354ac02d91f9e2aef7b7d2ec8256", + "children": [ + "api.health_endpoint", + "api.control_actions_endpoint", + "api.send_message_endpoint", + "logic.telegram_notification_loop", + "domain.runtime_health" + ], + "doc_kind": "spec", + "entities": [ + "TelegramNotifyModule", + "TelegramNotifyWorker", + "TelegramControlChannel", + "TelegramSendService", + "RuntimeManager" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "architecture.telegram_notify_app", + "source_path": "docs/documentation/architecture/telegram-notify-app-overview.md", + "summary_text": "`test_echo_app` — сервис на базе PLBA runtime, который поднимает HTTP control plane и запускает фоновый воркер для периодической отправки уведомлений в Telegram. Приложение использует YAML-конфиг для runtime-настроек и переменные окружения для Telegram credentials. Основной контур системы состоит из runtime manager, control channel, send service и worker loop.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/README.md", + "title": "Readme", + "content": "Readme", + "metadata": { + "name": "", + "tags": [], + "type": "", + "layer": "", + "links": [], + "owner": null, + "title": "Readme", + "doc_id": null, + "module": "", + "parent": null, + "status": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "81d952f1a6ea85b76f75e0e57f33b8fa4b2bf3cb7db11b91b90171aeedd655a6", + "children": [], + "doc_kind": "readme", + "entities": [], + "updated_at": null, + "doc_version": null, + "document_id": "docs/README.md", + "source_path": "docs/README.md", + "summary_text": "", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/domain/runtime-health-entity.md", + "title": "Сущность runtime health", + "content": "`runtime health` — доменная модель наблюдаемости сервиса, которая описывает общее состояние runtime и состояние отдельных компонентов. Для `test_echo_app` главным объектом наблюдения является компонент `telegram_notify`, у которого важны статус, время старта и количество успешных отправок. Эта модель используется для внешнего health-monitoring и внутренней диагностики.", + "metadata": { + "name": "runtime_health", + "tags": [ + "domain", + "health", + "observability" + ], + "type": "domain_entity", + "layer": "domain", + "links": [ + { + "type": "part_of", + "target": "architecture.telegram_notify_app" + }, + { + "type": "used_by", + "target": "api.health_endpoint" + }, + { + "type": "related_logic", + "target": "logic.telegram_notification_loop" + } + ], + "owner": null, + "title": "Сущность runtime health", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "architecture.telegram_notify_app", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "37d4dcf470ea3de95d59e44786006e369a3ea11bf5dbf4c88877696e9183ee87", + "children": [], + "doc_kind": "misc", + "entities": [ + "WorkerHealth", + "WorkerStatus", + "TelegramNotifyWorker" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "domain.runtime_health", + "source_path": "docs/documentation/domain/runtime-health-entity.md", + "summary_text": "`runtime health` — доменная модель наблюдаемости сервиса, которая описывает общее состояние runtime и состояние отдельных компонентов. Для `test_echo_app` главным объектом наблюдения является компонент `telegram_notify`, у которого важны статус, время старта и количество успешных отправок. Эта модель используется для внешнего health-monitoring и внутренней диагностики.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/logic/telegram-notification-loop.md", + "title": "Цикл отправки уведомлений в Telegram", + "content": "`TelegramNotifyWorker` после старта runtime запускает отдельный поток, сразу делает первую попытку отправки сообщения и затем повторяет отправку через заданный интервал. При ошибках доставки или отсутствии credentials worker не останавливает сервис, а переводит собственное состояние в `degraded`. Этот workflow определяет основной полезный цикл приложения.", + "metadata": { + "name": "telegram_notification_loop", + "tags": [ + "logic", + "telegram", + "worker", + "scheduling" + ], + "type": "logic_block", + "layer": "application", + "links": [ + { + "type": "part_of", + "target": "architecture.telegram_notify_app" + }, + { + "type": "related_api", + "target": "api.send_message_endpoint" + }, + { + "type": "related_api", + "target": "api.control_actions_endpoint" + }, + { + "type": "related_api", + "target": "api.health_endpoint" + } + ], + "owner": null, + "title": "Цикл отправки уведомлений в Telegram", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "architecture.telegram_notify_app", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "0f62f9b4dab261ca4ca34575ff5d84411a22c90b780c52eda388782b94f08470", + "children": [], + "doc_kind": "misc", + "entities": [ + "TelegramNotifyWorker", + "TelegramSendService", + "WorkerHealth", + "WorkerStatus" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "logic.telegram_notification_loop", + "source_path": "docs/documentation/logic/telegram-notification-loop.md", + "summary_text": "`TelegramNotifyWorker` после старта runtime запускает отдельный поток, сразу делает первую попытку отправки сообщения и затем повторяет отправку через заданный интервал. При ошибках доставки или отсутствии credentials worker не останавливает сервис, а переводит собственное состояние в `degraded`. Этот workflow определяет основной полезный цикл приложения.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/api/send-message-endpoint.md", + "title": "HTTP API /send", + "content": "Endpoint `/send` выполняет ручную отправку сообщения в Telegram через `TelegramSendService`. Он используется для операторской проверки доставки и для отправки уведомлений вне периодического worker loop. Endpoint работает поверх тех же credentials и того же delivery path, что и фоновая отправка.", + "metadata": { + "name": "send_message_endpoint", + "tags": [ + "api", + "telegram", + "manual-send" + ], + "type": "api_method", + "layer": "application", + "links": [ + { + "type": "part_of", + "target": "architecture.telegram_notify_app" + }, + { + "type": "depends_on", + "target": "logic.telegram_notification_loop" + } + ], + "owner": null, + "title": "HTTP API /send", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "architecture.telegram_notify_app", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "5fbf2e33510b0676a3a53b957a4569bd3c2c31fb7719546602c573421ccaa32d", + "children": [], + "doc_kind": "misc", + "entities": [ + "TelegramControlAppFactory", + "TelegramSendService", + "TelegramNotifyWorker" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "api.send_message_endpoint", + "source_path": "docs/documentation/api/send-message-endpoint.md", + "summary_text": "Endpoint `/send` выполняет ручную отправку сообщения в Telegram через `TelegramSendService`. Он используется для операторской проверки доставки и для отправки уведомлений вне периодического worker loop. Endpoint работает поверх тех же credentials и того же delivery path, что и фоновая отправка.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + } + ], + "facts": [ + { + "layer": "D2_FACT_INDEX", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "api.control_actions_endpoint:workflow_step", + "content": "api.control_actions_endpoint workflow_step HTTP control plane запущен.", + "metadata": { + "tags": [], + "owner": null, + "anchor": "Сценарий", + "doc_id": null, + "object": "HTTP control plane запущен.", + "fact_id": "b480201013a7e5231146f665773ebc54af37c28135f407c6b758304c74561645", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "predicate": "workflow_step", + "object_ref": null, + "subject_id": "api.control_actions_endpoint", + "doc_version": null, + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D2_FACT_INDEX", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "api.control_actions_endpoint:mentions_entity", + "content": "api.control_actions_endpoint mentions_entity ControlActionSet", + "metadata": { + "tags": [], + "owner": null, + "anchor": "frontmatter.entities", + "doc_id": null, + "object": "ControlActionSet", + "fact_id": "bafb867ffed41c9db637df98d6cd5f6722d7747bbebc6c03e6f0d0caf3b7f9f3", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "predicate": "mentions_entity", + "object_ref": null, + "subject_id": "api.control_actions_endpoint", + "doc_version": null, + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + } + ], + "relations": [ + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "api.control_actions_endpoint:parent", + "content": "api.control_actions_endpoint parent architecture.telegram_notify_app", + "metadata": { + "owner": null, + "anchor": "frontmatter.parent", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "source_id": "api.control_actions_endpoint", + "target_id": "architecture.telegram_notify_app", + "doc_version": null, + "relation_id": "afec31fd062e392dcd9699a92c7ab61fd4b1273c1a2b16702b23d55d8d0c47ac", + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "parent", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "api.control_actions_endpoint:related_api", + "content": "api.control_actions_endpoint related_api api.health_endpoint", + "metadata": { + "owner": null, + "anchor": "frontmatter.links", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "source_id": "api.control_actions_endpoint", + "target_id": "api.health_endpoint", + "doc_version": null, + "relation_id": "711fb2edb82dd222deaba3c91768b18cbbd453009235823282813c6e867dc2c1", + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "related_api", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "api.control_actions_endpoint:related_logic", + "content": "api.control_actions_endpoint related_logic logic.telegram_notification_loop", + "metadata": { + "owner": null, + "anchor": "frontmatter.links", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "source_id": "api.control_actions_endpoint", + "target_id": "logic.telegram_notification_loop", + "doc_version": null, + "relation_id": "eec79f7a02b804337e791ef231784862ae26e0599eb20224790e9d4f085fa9c0", + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "related_logic", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "api.control_actions_endpoint:part_of", + "content": "api.control_actions_endpoint part_of architecture.telegram_notify_app", + "metadata": { + "owner": null, + "anchor": "frontmatter.links", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "source_id": "api.control_actions_endpoint", + "target_id": "architecture.telegram_notify_app", + "doc_version": null, + "relation_id": "5f4909bde905cd3d294ad307074a05e4ae4deefcafe6272cd2d0436e73acb8dd", + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "part_of", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/architecture/telegram-notify-app-overview.md", + "title": "architecture.telegram_notify_app:child", + "content": "architecture.telegram_notify_app child api.control_actions_endpoint", + "metadata": { + "owner": null, + "anchor": "frontmatter.children", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "8b1cc9f823e55bddbc825466d10a0fdb4ca4354ac02d91f9e2aef7b7d2ec8256", + "source_id": "architecture.telegram_notify_app", + "target_id": "api.control_actions_endpoint", + "doc_version": null, + "relation_id": "ae34fe4b3cd2b47632b13b1e32303e842b57948aa21160abe8d9b478995e1d74", + "source_path": "docs/documentation/architecture/telegram-notify-app-overview.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "child", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/architecture/telegram-notify-app-overview.md", + "title": "architecture.telegram_notify_app:related_api", + "content": "architecture.telegram_notify_app related_api api.control_actions_endpoint", + "metadata": { + "owner": null, + "anchor": "frontmatter.links", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "8b1cc9f823e55bddbc825466d10a0fdb4ca4354ac02d91f9e2aef7b7d2ec8256", + "source_id": "architecture.telegram_notify_app", + "target_id": "api.control_actions_endpoint", + "doc_version": null, + "relation_id": "02530527e6e1d1e23316c9d25d0b30658d6c70063eb6e1d732d55c5ba29c9795", + "source_path": "docs/documentation/architecture/telegram-notify-app-overview.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "related_api", + "staleness_score": null, + "system_component": null + } + } + ] +} +``` + +### User Prompt Overview +- question: Как устроен RuntimeManager? +- intent: DOCUMENTATION_EXPLAIN +- sub_intent: COMPONENT_EXPLAIN +- documents: 6 | samples: HTTP API /actions/{action}, Архитектура Telegram Notify App, Readme +- facts: 2 | samples: api.control_actions_endpoint:workflow_step, api.control_actions_endpoint:mentions_entity +- relations: 6 | samples: api.control_actions_endpoint:parent, api.control_actions_endpoint:related_api, api.control_actions_endpoint:related_logic + +## Mismatches +- none \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/docs_pre_llm_v3/20260326_121025/full_chain_docs_intents_v3-3x_v3-component-runtime-manager-3.json b/tests/pipeline_setup_v3/test_results/docs_pre_llm_v3/20260326_121025/full_chain_docs_intents_v3-3x_v3-component-runtime-manager-3.json new file mode 100644 index 0000000..ee18af7 --- /dev/null +++ b/tests/pipeline_setup_v3/test_results/docs_pre_llm_v3/20260326_121025/full_chain_docs_intents_v3-3x_v3-component-runtime-manager-3.json @@ -0,0 +1,92 @@ +{ + "meta": { + "case_id": "v3-component-runtime-manager-3", + "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_03_docs/full_chain_docs_intents_v3-3x.yaml", + "runner": "agent_runtime", + "mode": "pre_llm", + "passed": true, + "mismatches": [], + "actual": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "COMPONENT_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START", + "rag_count": 20, + "llm_answer": "", + "answer_mode": "answered", + "path_scope": [], + "doc_scope": [ + "api.control_actions_endpoint", + "api.actions_endpoint", + "architecture.telegram_notify_app", + "architecture.telegram_notify_app_overview", + "docs/README.md", + "domain.runtime_health", + "logic.telegram_notification_loop", + "api.send_message_endpoint" + ], + "entity_candidates": [ + "RuntimeManager" + ], + "symbol_candidates": [], + "layers": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "filters": { + "doc_type": null + }, + "pipeline_mode": "pre_llm_only", + "gate_decision": "allow", + "prompt_used": "docs_explain_answer", + "llm_mode": "prose", + "degraded_reason": null, + "code_intents_stubbed": true + } + }, + "pipeline_steps": [ + { + "step": "input_query", + "input": { + "query": "Опиши компонент RuntimeManager" + }, + "output": { + "query": "Опиши компонент RuntimeManager" + } + }, + { + "step": "router", + "input": { + "query": "Опиши компонент RuntimeManager" + }, + "output": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "COMPONENT_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START" + } + }, + { + "step": "docs_pipeline", + "input": { + "query": "Опиши компонент RuntimeManager" + }, + "output": { + "answer_mode": "ready", + "prompt_name": "docs_explain_answer", + "llm_request": { + "prompt_name": "docs_explain_answer", + "log_context": "graph.project_qa.docs.answer", + "prompt_stats": { + "system_chars": 393, + "user_chars": 21494, + "tokens_in_estimate": 5472 + } + }, + "degraded_reason": "" + } + } + ] +} \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/docs_pre_llm_v3/20260326_121025/full_chain_docs_intents_v3-3x_v3-component-runtime-manager-3.md b/tests/pipeline_setup_v3/test_results/docs_pre_llm_v3/20260326_121025/full_chain_docs_intents_v3-3x_v3-component-runtime-manager-3.md new file mode 100644 index 0000000..f4ab3e8 --- /dev/null +++ b/tests/pipeline_setup_v3/test_results/docs_pre_llm_v3/20260326_121025/full_chain_docs_intents_v3-3x_v3-component-runtime-manager-3.md @@ -0,0 +1,900 @@ +# v3-component-runtime-manager-3 + +- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_03_docs/full_chain_docs_intents_v3-3x.yaml +- runner: agent_runtime +- mode: pre_llm +- passed: True + +## Query +Опиши компонент RuntimeManager + +## Actual +{ + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "COMPONENT_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START", + "rag_count": 20, + "llm_answer": "", + "answer_mode": "answered", + "path_scope": [], + "doc_scope": [ + "api.control_actions_endpoint", + "api.actions_endpoint", + "architecture.telegram_notify_app", + "architecture.telegram_notify_app_overview", + "docs/README.md", + "domain.runtime_health", + "logic.telegram_notification_loop", + "api.send_message_endpoint" + ], + "entity_candidates": [ + "RuntimeManager" + ], + "symbol_candidates": [], + "layers": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "filters": { + "doc_type": null + }, + "pipeline_mode": "pre_llm_only", + "gate_decision": "allow", + "prompt_used": "docs_explain_answer", + "llm_mode": "prose", + "degraded_reason": null, + "code_intents_stubbed": true +} + +## Pipeline Steps +### input_query +```json +{ + "input": { + "query": "Опиши компонент RuntimeManager" + }, + "output": { + "query": "Опиши компонент RuntimeManager" + } +} +``` + +### router +```json +{ + "input": { + "query": "Опиши компонент RuntimeManager" + }, + "output": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "COMPONENT_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START" + } +} +``` + +### docs_pipeline +```json +{ + "input": { + "query": "Опиши компонент RuntimeManager" + }, + "output": { + "answer_mode": "ready", + "prompt_name": "docs_explain_answer", + "llm_request": { + "prompt_name": "docs_explain_answer", + "log_context": "graph.project_qa.docs.answer", + "prompt_stats": { + "system_chars": 393, + "user_chars": 21494, + "tokens_in_estimate": 5472 + } + }, + "degraded_reason": "" + } +} +``` + +## Diagnostics +{ + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "COMPONENT_EXPLAIN", + "layers_used": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "documents_found": 6, + "facts_found": 2, + "relations_found": 6, + "openapi_fields_extracted": 0, + "missing_required_fields": [], + "openapi_status": { + "has_path": false, + "has_method": false, + "has_request": false, + "has_response": false + }, + "prompt_used": "docs_explain_answer", + "llm_mode": "prose", + "output_valid": true, + "matched_intent_source": "deterministic", + "matched_anchor_type": "component", + "matched_anchor_value": "RuntimeManager", + "exact_anchor_match": false, + "docs_layers_requested": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "docs_layers_with_hits": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "planned_layers": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "executed_layers": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "non_empty_layers": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "layer_diagnostics": { + "D1_DOCUMENT_CATALOG": { + "hits": 6, + "top_ids": [ + "api.control_actions_endpoint", + "architecture.telegram_notify_app", + "docs/README.md", + "domain.runtime_health", + "logic.telegram_notification_loop" + ] + }, + "D2_FACT_INDEX": { + "hits": 8, + "top_ids": [ + "b480201013a7e5231146f665773ebc54af37c28135f407c6b758304c74561645", + "b8e44c3adb74aaa6c91ae8815fa091289e58dd3990a3a1b63e850c62075aea75", + "bafb867ffed41c9db637df98d6cd5f6722d7747bbebc6c03e6f0d0caf3b7f9f3", + "54bbcbac242f1c85ec3280236ed5841998a8a3a548ff16cbf0b5acafbff469e3", + "b6bfad59b3bf00f199b5ef90c1208af19664de700413e7354468a93a4abaaa2f" + ] + }, + "D5_RELATION_GRAPH": { + "hits": 6, + "top_ids": [ + "afec31fd062e392dcd9699a92c7ab61fd4b1273c1a2b16702b23d55d8d0c47ac", + "711fb2edb82dd222deaba3c91768b18cbbd453009235823282813c6e867dc2c1", + "eec79f7a02b804337e791ef231784862ae26e0599eb20224790e9d4f085fa9c0", + "5f4909bde905cd3d294ad307074a05e4ae4deefcafe6272cd2d0436e73acb8dd", + "ae34fe4b3cd2b47632b13b1e32303e842b57948aa21160abe8d9b478995e1d74" + ] + }, + "D0_DOC_CHUNKS": { + "hits": 6, + "top_ids": [ + "api.control_actions_endpoint" + ] + } + }, + "query_entity_candidates": [ + "RuntimeManager" + ], + "resolved_entity_candidates": [], + "query_anchor_candidates": [ + "RuntimeManager" + ], + "resolved_anchor_candidates": [ + "api.control_actions_endpoint", + "docs/documentation/api/control-actions-endpoint.md", + "architecture.telegram_notify_app", + "docs/documentation/architecture/telegram-notify-app-overview.md", + "docs/README.md", + "domain.runtime_health", + "docs/documentation/domain/runtime-health-entity.md", + "logic.telegram_notification_loop", + "docs/documentation/logic/telegram-notification-loop.md", + "api.send_message_endpoint", + "docs/documentation/api/send-message-endpoint.md" + ], + "anchor_candidates": [], + "selected_anchor": null, + "anchor_selection_reason": "", + "anchor_match_type": "", + "doc_ids": [ + "api.control_actions_endpoint", + "api.actions_endpoint", + "architecture.telegram_notify_app", + "architecture.telegram_notify_app_overview", + "docs/README.md", + "domain.runtime_health", + "logic.telegram_notification_loop", + "api.send_message_endpoint" + ], + "doc_paths": [ + "docs/documentation/api/control-actions-endpoint.md", + "docs/documentation/architecture/telegram-notify-app-overview.md", + "docs/README.md", + "docs/documentation/domain/runtime-health-entity.md", + "docs/documentation/logic/telegram-notification-loop.md", + "docs/documentation/api/send-message-endpoint.md" + ], + "doc_titles": [ + "HTTP API /actions/{action}", + "Архитектура Telegram Notify App", + "Readme", + "Сущность runtime health", + "Цикл отправки уведомлений в Telegram", + "HTTP API /send", + "api.control_actions_endpoint:workflow_step", + "api.control_actions_endpoint:mentions_entity", + "api.control_actions_endpoint:parent", + "api.control_actions_endpoint:related_api", + "api.control_actions_endpoint:related_logic", + "api.control_actions_endpoint:part_of", + "architecture.telegram_notify_app:child", + "architecture.telegram_notify_app:related_api", + "api.control_actions_endpoint:Функциональные требования", + "api.control_actions_endpoint:Нефункциональные требования", + "api.control_actions_endpoint:Сценарий", + "api.control_actions_endpoint:Summary", + "api.control_actions_endpoint:Описание", + "api.control_actions_endpoint:Входные параметры" + ], + "relation_hits_count": 6, + "relation_targets": [ + "api.control_actions_endpoint:parent", + "api.control_actions_endpoint:related_api", + "api.control_actions_endpoint:related_logic", + "api.control_actions_endpoint:part_of", + "architecture.telegram_notify_app:child", + "architecture.telegram_notify_app:related_api" + ], + "fallback_doc_hits_count": 12, + "fallback_used": false, + "fact_hits": 2, + "entity_hits": 0, + "evidence_summary": { + "documents": 6, + "facts": 2, + "relations": 6, + "chunks": 6, + "entity_hits": 0, + "openapi_signals": { + "path_found": false, + "method_found": false, + "request_schema": false, + "response_schema": false, + "status_codes": false, + "payload_description": false + } + }, + "gate_decision": "allow", + "gate_decision_reason": "evidence_sufficient", + "gate_missing_requirements": [], + "gate_satisfied_requirements": [ + "retrieval_non_empty" + ], + "openapi_evidence": { + "path_found": false, + "method_found": false, + "request_schema": false, + "response_schema": false, + "status_codes": false, + "payload_description": false + }, + "requested_fragment_type": null, + "fragment_evidence_found": [], + "fragment_missing_requirements": [], + "answer_mode": "ready", + "degrade_reason": null, + "degraded_reason": null, + "code_intents_stubbed": false +} + +## LLM Request +- prompt_name: docs_explain_answer +- log_context: graph.project_qa.docs.answer + +### Prompt Stats +```json +{ + "system_chars": 393, + "user_chars": 21494, + "tokens_in_estimate": 5472 +} +``` + +### System Prompt +```text +Ты объясняешь документацию системы. + +На вход приходит JSON с полями: +- question +- intent +- sub_intent +- documents +- facts +- relations + +Правила: +- Используй только предоставленные факты +- Не додумывай +- Если данных недостаточно, скажи это явно +- Объясняй структурировано + +Формат ответа: +1. Краткое описание +2. Основные элементы +3. Как это работает +4. Связи с другими частями системы (если есть) +``` + +### User Prompt +```json +{ + "question": "Опиши компонент RuntimeManager", + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "COMPONENT_EXPLAIN", + "documents": [ + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "HTTP API /actions/{action}", + "content": "Endpoint `/actions/{action}` управляет control actions runtime и поддерживает `start`, `stop` и `status`. Для долгих операций `start` и `stop` допускается ответ HTTP 202, если действие еще выполняется. Endpoint используется для operator-driven управления жизненным циклом worker'а через HTTP API.", + "metadata": { + "name": "control_actions_endpoint", + "tags": [ + "api", + "control-plane", + "lifecycle" + ], + "type": "api_method", + "layer": "application", + "links": [ + { + "type": "part_of", + "target": "architecture.telegram_notify_app" + }, + { + "type": "related_api", + "target": "api.health_endpoint" + }, + { + "type": "related_logic", + "target": "logic.telegram_notification_loop" + } + ], + "owner": null, + "title": "HTTP API /actions/{action}", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "architecture.telegram_notify_app", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "children": [], + "doc_kind": "misc", + "entities": [ + "TelegramControlChannel", + "ControlActionSet", + "JSONResponse" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "api.control_actions_endpoint", + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "summary_text": "Endpoint `/actions/{action}` управляет control actions runtime и поддерживает `start`, `stop` и `status`. Для долгих операций `start` и `stop` допускается ответ HTTP 202, если действие еще выполняется. Endpoint используется для operator-driven управления жизненным циклом worker'а через HTTP API.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/architecture/telegram-notify-app-overview.md", + "title": "Архитектура Telegram Notify App", + "content": "`test_echo_app` — сервис на базе PLBA runtime, который поднимает HTTP control plane и запускает фоновый воркер для периодической отправки уведомлений в Telegram. Приложение использует YAML-конфиг для runtime-настроек и переменные окружения для Telegram credentials. Основной контур системы состоит из runtime manager, control channel, send service и worker loop.", + "metadata": { + "name": "telegram_notify_app_overview", + "tags": [ + "architecture", + "telegram", + "plba", + "runtime" + ], + "type": "architecture_overview", + "layer": "system", + "links": [ + { + "type": "related_api", + "target": "api.health_endpoint" + }, + { + "type": "related_api", + "target": "api.control_actions_endpoint" + }, + { + "type": "related_api", + "target": "api.send_message_endpoint" + }, + { + "type": "depends_on", + "target": "logic.telegram_notification_loop" + }, + { + "type": "depends_on", + "target": "domain.runtime_health" + } + ], + "owner": null, + "title": "Архитектура Telegram Notify App", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "docs_root", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "8b1cc9f823e55bddbc825466d10a0fdb4ca4354ac02d91f9e2aef7b7d2ec8256", + "children": [ + "api.health_endpoint", + "api.control_actions_endpoint", + "api.send_message_endpoint", + "logic.telegram_notification_loop", + "domain.runtime_health" + ], + "doc_kind": "spec", + "entities": [ + "TelegramNotifyModule", + "TelegramNotifyWorker", + "TelegramControlChannel", + "TelegramSendService", + "RuntimeManager" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "architecture.telegram_notify_app", + "source_path": "docs/documentation/architecture/telegram-notify-app-overview.md", + "summary_text": "`test_echo_app` — сервис на базе PLBA runtime, который поднимает HTTP control plane и запускает фоновый воркер для периодической отправки уведомлений в Telegram. Приложение использует YAML-конфиг для runtime-настроек и переменные окружения для Telegram credentials. Основной контур системы состоит из runtime manager, control channel, send service и worker loop.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/README.md", + "title": "Readme", + "content": "Readme", + "metadata": { + "name": "", + "tags": [], + "type": "", + "layer": "", + "links": [], + "owner": null, + "title": "Readme", + "doc_id": null, + "module": "", + "parent": null, + "status": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "81d952f1a6ea85b76f75e0e57f33b8fa4b2bf3cb7db11b91b90171aeedd655a6", + "children": [], + "doc_kind": "readme", + "entities": [], + "updated_at": null, + "doc_version": null, + "document_id": "docs/README.md", + "source_path": "docs/README.md", + "summary_text": "", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/domain/runtime-health-entity.md", + "title": "Сущность runtime health", + "content": "`runtime health` — доменная модель наблюдаемости сервиса, которая описывает общее состояние runtime и состояние отдельных компонентов. Для `test_echo_app` главным объектом наблюдения является компонент `telegram_notify`, у которого важны статус, время старта и количество успешных отправок. Эта модель используется для внешнего health-monitoring и внутренней диагностики.", + "metadata": { + "name": "runtime_health", + "tags": [ + "domain", + "health", + "observability" + ], + "type": "domain_entity", + "layer": "domain", + "links": [ + { + "type": "part_of", + "target": "architecture.telegram_notify_app" + }, + { + "type": "used_by", + "target": "api.health_endpoint" + }, + { + "type": "related_logic", + "target": "logic.telegram_notification_loop" + } + ], + "owner": null, + "title": "Сущность runtime health", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "architecture.telegram_notify_app", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "37d4dcf470ea3de95d59e44786006e369a3ea11bf5dbf4c88877696e9183ee87", + "children": [], + "doc_kind": "misc", + "entities": [ + "WorkerHealth", + "WorkerStatus", + "TelegramNotifyWorker" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "domain.runtime_health", + "source_path": "docs/documentation/domain/runtime-health-entity.md", + "summary_text": "`runtime health` — доменная модель наблюдаемости сервиса, которая описывает общее состояние runtime и состояние отдельных компонентов. Для `test_echo_app` главным объектом наблюдения является компонент `telegram_notify`, у которого важны статус, время старта и количество успешных отправок. Эта модель используется для внешнего health-monitoring и внутренней диагностики.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/logic/telegram-notification-loop.md", + "title": "Цикл отправки уведомлений в Telegram", + "content": "`TelegramNotifyWorker` после старта runtime запускает отдельный поток, сразу делает первую попытку отправки сообщения и затем повторяет отправку через заданный интервал. При ошибках доставки или отсутствии credentials worker не останавливает сервис, а переводит собственное состояние в `degraded`. Этот workflow определяет основной полезный цикл приложения.", + "metadata": { + "name": "telegram_notification_loop", + "tags": [ + "logic", + "telegram", + "worker", + "scheduling" + ], + "type": "logic_block", + "layer": "application", + "links": [ + { + "type": "part_of", + "target": "architecture.telegram_notify_app" + }, + { + "type": "related_api", + "target": "api.send_message_endpoint" + }, + { + "type": "related_api", + "target": "api.control_actions_endpoint" + }, + { + "type": "related_api", + "target": "api.health_endpoint" + } + ], + "owner": null, + "title": "Цикл отправки уведомлений в Telegram", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "architecture.telegram_notify_app", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "0f62f9b4dab261ca4ca34575ff5d84411a22c90b780c52eda388782b94f08470", + "children": [], + "doc_kind": "misc", + "entities": [ + "TelegramNotifyWorker", + "TelegramSendService", + "WorkerHealth", + "WorkerStatus" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "logic.telegram_notification_loop", + "source_path": "docs/documentation/logic/telegram-notification-loop.md", + "summary_text": "`TelegramNotifyWorker` после старта runtime запускает отдельный поток, сразу делает первую попытку отправки сообщения и затем повторяет отправку через заданный интервал. При ошибках доставки или отсутствии credentials worker не останавливает сервис, а переводит собственное состояние в `degraded`. Этот workflow определяет основной полезный цикл приложения.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/api/send-message-endpoint.md", + "title": "HTTP API /send", + "content": "Endpoint `/send` выполняет ручную отправку сообщения в Telegram через `TelegramSendService`. Он используется для операторской проверки доставки и для отправки уведомлений вне периодического worker loop. Endpoint работает поверх тех же credentials и того же delivery path, что и фоновая отправка.", + "metadata": { + "name": "send_message_endpoint", + "tags": [ + "api", + "telegram", + "manual-send" + ], + "type": "api_method", + "layer": "application", + "links": [ + { + "type": "part_of", + "target": "architecture.telegram_notify_app" + }, + { + "type": "depends_on", + "target": "logic.telegram_notification_loop" + } + ], + "owner": null, + "title": "HTTP API /send", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "architecture.telegram_notify_app", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "5fbf2e33510b0676a3a53b957a4569bd3c2c31fb7719546602c573421ccaa32d", + "children": [], + "doc_kind": "misc", + "entities": [ + "TelegramControlAppFactory", + "TelegramSendService", + "TelegramNotifyWorker" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "api.send_message_endpoint", + "source_path": "docs/documentation/api/send-message-endpoint.md", + "summary_text": "Endpoint `/send` выполняет ручную отправку сообщения в Telegram через `TelegramSendService`. Он используется для операторской проверки доставки и для отправки уведомлений вне периодического worker loop. Endpoint работает поверх тех же credentials и того же delivery path, что и фоновая отправка.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + } + ], + "facts": [ + { + "layer": "D2_FACT_INDEX", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "api.control_actions_endpoint:workflow_step", + "content": "api.control_actions_endpoint workflow_step HTTP control plane запущен.", + "metadata": { + "tags": [], + "owner": null, + "anchor": "Сценарий", + "doc_id": null, + "object": "HTTP control plane запущен.", + "fact_id": "b480201013a7e5231146f665773ebc54af37c28135f407c6b758304c74561645", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "predicate": "workflow_step", + "object_ref": null, + "subject_id": "api.control_actions_endpoint", + "doc_version": null, + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D2_FACT_INDEX", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "api.control_actions_endpoint:mentions_entity", + "content": "api.control_actions_endpoint mentions_entity ControlActionSet", + "metadata": { + "tags": [], + "owner": null, + "anchor": "frontmatter.entities", + "doc_id": null, + "object": "ControlActionSet", + "fact_id": "bafb867ffed41c9db637df98d6cd5f6722d7747bbebc6c03e6f0d0caf3b7f9f3", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "predicate": "mentions_entity", + "object_ref": null, + "subject_id": "api.control_actions_endpoint", + "doc_version": null, + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + } + ], + "relations": [ + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "api.control_actions_endpoint:parent", + "content": "api.control_actions_endpoint parent architecture.telegram_notify_app", + "metadata": { + "owner": null, + "anchor": "frontmatter.parent", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "source_id": "api.control_actions_endpoint", + "target_id": "architecture.telegram_notify_app", + "doc_version": null, + "relation_id": "afec31fd062e392dcd9699a92c7ab61fd4b1273c1a2b16702b23d55d8d0c47ac", + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "parent", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "api.control_actions_endpoint:related_api", + "content": "api.control_actions_endpoint related_api api.health_endpoint", + "metadata": { + "owner": null, + "anchor": "frontmatter.links", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "source_id": "api.control_actions_endpoint", + "target_id": "api.health_endpoint", + "doc_version": null, + "relation_id": "711fb2edb82dd222deaba3c91768b18cbbd453009235823282813c6e867dc2c1", + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "related_api", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "api.control_actions_endpoint:related_logic", + "content": "api.control_actions_endpoint related_logic logic.telegram_notification_loop", + "metadata": { + "owner": null, + "anchor": "frontmatter.links", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "source_id": "api.control_actions_endpoint", + "target_id": "logic.telegram_notification_loop", + "doc_version": null, + "relation_id": "eec79f7a02b804337e791ef231784862ae26e0599eb20224790e9d4f085fa9c0", + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "related_logic", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "api.control_actions_endpoint:part_of", + "content": "api.control_actions_endpoint part_of architecture.telegram_notify_app", + "metadata": { + "owner": null, + "anchor": "frontmatter.links", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "source_id": "api.control_actions_endpoint", + "target_id": "architecture.telegram_notify_app", + "doc_version": null, + "relation_id": "5f4909bde905cd3d294ad307074a05e4ae4deefcafe6272cd2d0436e73acb8dd", + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "part_of", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/architecture/telegram-notify-app-overview.md", + "title": "architecture.telegram_notify_app:child", + "content": "architecture.telegram_notify_app child api.control_actions_endpoint", + "metadata": { + "owner": null, + "anchor": "frontmatter.children", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "8b1cc9f823e55bddbc825466d10a0fdb4ca4354ac02d91f9e2aef7b7d2ec8256", + "source_id": "architecture.telegram_notify_app", + "target_id": "api.control_actions_endpoint", + "doc_version": null, + "relation_id": "ae34fe4b3cd2b47632b13b1e32303e842b57948aa21160abe8d9b478995e1d74", + "source_path": "docs/documentation/architecture/telegram-notify-app-overview.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "child", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/architecture/telegram-notify-app-overview.md", + "title": "architecture.telegram_notify_app:related_api", + "content": "architecture.telegram_notify_app related_api api.control_actions_endpoint", + "metadata": { + "owner": null, + "anchor": "frontmatter.links", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "8b1cc9f823e55bddbc825466d10a0fdb4ca4354ac02d91f9e2aef7b7d2ec8256", + "source_id": "architecture.telegram_notify_app", + "target_id": "api.control_actions_endpoint", + "doc_version": null, + "relation_id": "02530527e6e1d1e23316c9d25d0b30658d6c70063eb6e1d732d55c5ba29c9795", + "source_path": "docs/documentation/architecture/telegram-notify-app-overview.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "related_api", + "staleness_score": null, + "system_component": null + } + } + ] +} +``` + +### User Prompt Overview +- question: Опиши компонент RuntimeManager +- intent: DOCUMENTATION_EXPLAIN +- sub_intent: COMPONENT_EXPLAIN +- documents: 6 | samples: HTTP API /actions/{action}, Архитектура Telegram Notify App, Readme +- facts: 2 | samples: api.control_actions_endpoint:workflow_step, api.control_actions_endpoint:mentions_entity +- relations: 6 | samples: api.control_actions_endpoint:parent, api.control_actions_endpoint:related_api, api.control_actions_endpoint:related_logic + +## Mismatches +- none \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/docs_pre_llm_v3/20260326_121025/full_chain_docs_intents_v3-3x_v3-entity-runtime-health-1.json b/tests/pipeline_setup_v3/test_results/docs_pre_llm_v3/20260326_121025/full_chain_docs_intents_v3-3x_v3-entity-runtime-health-1.json new file mode 100644 index 0000000..0e3f50c --- /dev/null +++ b/tests/pipeline_setup_v3/test_results/docs_pre_llm_v3/20260326_121025/full_chain_docs_intents_v3-3x_v3-entity-runtime-health-1.json @@ -0,0 +1,92 @@ +{ + "meta": { + "case_id": "v3-entity-runtime-health-1", + "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_03_docs/full_chain_docs_intents_v3-3x.yaml", + "runner": "agent_runtime", + "mode": "pre_llm", + "passed": true, + "mismatches": [], + "actual": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "ENTITY_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START", + "rag_count": 26, + "llm_answer": "", + "answer_mode": "answered", + "path_scope": [], + "doc_scope": [ + "api.health_endpoint", + "architecture.telegram_notify_app", + "architecture.telegram_notify_app_overview", + "domain.runtime_health", + "logic.telegram_notification_loop", + "api.control_actions_endpoint", + "api.actions_endpoint", + "api.send_message_endpoint" + ], + "entity_candidates": [ + "runtime health" + ], + "symbol_candidates": [], + "layers": [ + "D3_ENTITY_CATALOG", + "D1_DOCUMENT_CATALOG", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "filters": { + "doc_type": null + }, + "pipeline_mode": "pre_llm_only", + "gate_decision": "allow", + "prompt_used": "docs_explain_answer", + "llm_mode": "prose", + "degraded_reason": null, + "code_intents_stubbed": true + } + }, + "pipeline_steps": [ + { + "step": "input_query", + "input": { + "query": "Что такое runtime health?" + }, + "output": { + "query": "Что такое runtime health?" + } + }, + { + "step": "router", + "input": { + "query": "Что такое runtime health?" + }, + "output": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "ENTITY_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START" + } + }, + { + "step": "docs_pipeline", + "input": { + "query": "Что такое runtime health?" + }, + "output": { + "answer_mode": "ready", + "prompt_name": "docs_explain_answer", + "llm_request": { + "prompt_name": "docs_explain_answer", + "log_context": "graph.project_qa.docs.answer", + "prompt_stats": { + "system_chars": 393, + "user_chars": 20267, + "tokens_in_estimate": 5165 + } + }, + "degraded_reason": "" + } + } + ] +} \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/docs_pre_llm_v3/20260326_121025/full_chain_docs_intents_v3-3x_v3-entity-runtime-health-1.md b/tests/pipeline_setup_v3/test_results/docs_pre_llm_v3/20260326_121025/full_chain_docs_intents_v3-3x_v3-entity-runtime-health-1.md new file mode 100644 index 0000000..e5fbb9e --- /dev/null +++ b/tests/pipeline_setup_v3/test_results/docs_pre_llm_v3/20260326_121025/full_chain_docs_intents_v3-3x_v3-entity-runtime-health-1.md @@ -0,0 +1,865 @@ +# v3-entity-runtime-health-1 + +- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_03_docs/full_chain_docs_intents_v3-3x.yaml +- runner: agent_runtime +- mode: pre_llm +- passed: True + +## Query +Что такое runtime health? + +## Actual +{ + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "ENTITY_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START", + "rag_count": 26, + "llm_answer": "", + "answer_mode": "answered", + "path_scope": [], + "doc_scope": [ + "api.health_endpoint", + "architecture.telegram_notify_app", + "architecture.telegram_notify_app_overview", + "domain.runtime_health", + "logic.telegram_notification_loop", + "api.control_actions_endpoint", + "api.actions_endpoint", + "api.send_message_endpoint" + ], + "entity_candidates": [ + "runtime health" + ], + "symbol_candidates": [], + "layers": [ + "D3_ENTITY_CATALOG", + "D1_DOCUMENT_CATALOG", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "filters": { + "doc_type": null + }, + "pipeline_mode": "pre_llm_only", + "gate_decision": "allow", + "prompt_used": "docs_explain_answer", + "llm_mode": "prose", + "degraded_reason": null, + "code_intents_stubbed": true +} + +## Pipeline Steps +### input_query +```json +{ + "input": { + "query": "Что такое runtime health?" + }, + "output": { + "query": "Что такое runtime health?" + } +} +``` + +### router +```json +{ + "input": { + "query": "Что такое runtime health?" + }, + "output": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "ENTITY_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START" + } +} +``` + +### docs_pipeline +```json +{ + "input": { + "query": "Что такое runtime health?" + }, + "output": { + "answer_mode": "ready", + "prompt_name": "docs_explain_answer", + "llm_request": { + "prompt_name": "docs_explain_answer", + "log_context": "graph.project_qa.docs.answer", + "prompt_stats": { + "system_chars": 393, + "user_chars": 20267, + "tokens_in_estimate": 5165 + } + }, + "degraded_reason": "" + } +} +``` + +## Diagnostics +{ + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "ENTITY_EXPLAIN", + "layers_used": [ + "D3_ENTITY_CATALOG", + "D1_DOCUMENT_CATALOG", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "documents_found": 6, + "facts_found": 0, + "relations_found": 6, + "openapi_fields_extracted": 0, + "missing_required_fields": [], + "openapi_status": { + "has_path": false, + "has_method": false, + "has_request": false, + "has_response": false + }, + "prompt_used": "docs_explain_answer", + "llm_mode": "prose", + "output_valid": true, + "matched_intent_source": "deterministic", + "matched_anchor_type": "none", + "matched_anchor_value": null, + "exact_anchor_match": false, + "docs_layers_requested": [ + "D3_ENTITY_CATALOG", + "D1_DOCUMENT_CATALOG", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "docs_layers_with_hits": [ + "D3_ENTITY_CATALOG", + "D1_DOCUMENT_CATALOG", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "planned_layers": [ + "D3_ENTITY_CATALOG", + "D1_DOCUMENT_CATALOG", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "executed_layers": [ + "D3_ENTITY_CATALOG", + "D1_DOCUMENT_CATALOG", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "non_empty_layers": [ + "D3_ENTITY_CATALOG", + "D1_DOCUMENT_CATALOG", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "layer_diagnostics": { + "D3_ENTITY_CATALOG": { + "hits": 8, + "top_ids": [ + "api.health_endpoint", + "architecture.telegram_notify_app", + "domain.runtime_health" + ] + }, + "D1_DOCUMENT_CATALOG": { + "hits": 6, + "top_ids": [ + "domain.runtime_health", + "api.health_endpoint", + "logic.telegram_notification_loop", + "api.control_actions_endpoint", + "architecture.telegram_notify_app" + ] + }, + "D5_RELATION_GRAPH": { + "hits": 6, + "top_ids": [ + "79bdb0a74713df6064008179ca8c5c186dc23e4e1c5e2c9607b0bdddeba50f93", + "af2a4f7c1b677b908410ba720915405e10dbd0870e30a3c6e3aa2468550ddf0e", + "77f5d358ab85b3d92018b6b51da7c39773148dfd346686e8832a45370c841160", + "c718b1939621233295ccaf6e8203e7fd94f3dd1bfb88f10c51bc5e33d53a24aa", + "616f5cbf25da83cb51d8d0741a7fc351620c9ca2c6513fa2094b4aa476f0912a" + ] + }, + "D0_DOC_CHUNKS": { + "hits": 6, + "top_ids": [ + "api.health_endpoint" + ] + } + }, + "query_entity_candidates": [ + "runtime health" + ], + "resolved_entity_candidates": [], + "query_anchor_candidates": [], + "resolved_anchor_candidates": [ + "api.health_endpoint", + "docs/documentation/api/health-endpoint.md", + "architecture.telegram_notify_app", + "docs/documentation/architecture/telegram-notify-app-overview.md", + "domain.runtime_health", + "docs/documentation/domain/runtime-health-entity.md", + "logic.telegram_notification_loop", + "docs/documentation/logic/telegram-notification-loop.md", + "api.control_actions_endpoint", + "docs/documentation/api/control-actions-endpoint.md", + "api.send_message_endpoint", + "docs/documentation/api/send-message-endpoint.md" + ], + "anchor_candidates": [], + "selected_anchor": null, + "anchor_selection_reason": "", + "anchor_match_type": "", + "doc_ids": [ + "api.health_endpoint", + "architecture.telegram_notify_app", + "architecture.telegram_notify_app_overview", + "domain.runtime_health", + "logic.telegram_notification_loop", + "api.control_actions_endpoint", + "api.actions_endpoint", + "api.send_message_endpoint" + ], + "doc_paths": [ + "docs/documentation/api/health-endpoint.md", + "docs/documentation/architecture/telegram-notify-app-overview.md", + "docs/documentation/domain/runtime-health-entity.md", + "docs/documentation/logic/telegram-notification-loop.md", + "docs/documentation/api/control-actions-endpoint.md", + "docs/documentation/api/send-message-endpoint.md" + ], + "doc_titles": [ + "RuntimeManager", + "WorkerStatus", + "TelegramNotifyWorker", + "TelegramControlChannel", + "WorkerHealth", + "Сущность runtime health", + "HTTP API /health", + "Цикл отправки уведомлений в Telegram", + "HTTP API /actions/{action}", + "Архитектура Telegram Notify App", + "HTTP API /send", + "domain.runtime_health:parent", + "domain.runtime_health:part_of", + "api.health_endpoint:depends_on", + "api.health_endpoint:parent", + "api.health_endpoint:part_of", + "domain.runtime_health:used_by", + "api.health_endpoint:Сценарий", + "api.health_endpoint:Нефункциональные требования", + "api.health_endpoint:Summary", + "api.health_endpoint:Описание", + "api.health_endpoint:Функциональные требования", + "api.health_endpoint:Входные параметры" + ], + "relation_hits_count": 6, + "relation_targets": [ + "domain.runtime_health:parent", + "domain.runtime_health:part_of", + "api.health_endpoint:depends_on", + "api.health_endpoint:parent", + "api.health_endpoint:part_of", + "domain.runtime_health:used_by" + ], + "fallback_doc_hits_count": 12, + "fallback_used": false, + "fact_hits": 0, + "entity_hits": 0, + "evidence_summary": { + "documents": 6, + "facts": 0, + "relations": 6, + "chunks": 6, + "entity_hits": 0, + "openapi_signals": { + "path_found": false, + "method_found": false, + "request_schema": false, + "response_schema": false, + "status_codes": false, + "payload_description": false + } + }, + "gate_decision": "allow", + "gate_decision_reason": "evidence_sufficient", + "gate_missing_requirements": [], + "gate_satisfied_requirements": [ + "retrieval_non_empty" + ], + "openapi_evidence": { + "path_found": false, + "method_found": false, + "request_schema": false, + "response_schema": false, + "status_codes": false, + "payload_description": false + }, + "requested_fragment_type": null, + "fragment_evidence_found": [], + "fragment_missing_requirements": [], + "answer_mode": "ready", + "degrade_reason": null, + "degraded_reason": null, + "code_intents_stubbed": false +} + +## LLM Request +- prompt_name: docs_explain_answer +- log_context: graph.project_qa.docs.answer + +### Prompt Stats +```json +{ + "system_chars": 393, + "user_chars": 20267, + "tokens_in_estimate": 5165 +} +``` + +### System Prompt +```text +Ты объясняешь документацию системы. + +На вход приходит JSON с полями: +- question +- intent +- sub_intent +- documents +- facts +- relations + +Правила: +- Используй только предоставленные факты +- Не додумывай +- Если данных недостаточно, скажи это явно +- Объясняй структурировано + +Формат ответа: +1. Краткое описание +2. Основные элементы +3. Как это работает +4. Связи с другими частями системы (если есть) +``` + +### User Prompt +```json +{ + "question": "Что такое runtime health?", + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "ENTITY_EXPLAIN", + "documents": [ + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/domain/runtime-health-entity.md", + "title": "Сущность runtime health", + "content": "`runtime health` — доменная модель наблюдаемости сервиса, которая описывает общее состояние runtime и состояние отдельных компонентов. Для `test_echo_app` главным объектом наблюдения является компонент `telegram_notify`, у которого важны статус, время старта и количество успешных отправок. Эта модель используется для внешнего health-monitoring и внутренней диагностики.", + "metadata": { + "name": "runtime_health", + "tags": [ + "domain", + "health", + "observability" + ], + "type": "domain_entity", + "layer": "domain", + "links": [ + { + "type": "part_of", + "target": "architecture.telegram_notify_app" + }, + { + "type": "used_by", + "target": "api.health_endpoint" + }, + { + "type": "related_logic", + "target": "logic.telegram_notification_loop" + } + ], + "owner": null, + "title": "Сущность runtime health", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "architecture.telegram_notify_app", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "37d4dcf470ea3de95d59e44786006e369a3ea11bf5dbf4c88877696e9183ee87", + "children": [], + "doc_kind": "misc", + "entities": [ + "WorkerHealth", + "WorkerStatus", + "TelegramNotifyWorker" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "domain.runtime_health", + "source_path": "docs/documentation/domain/runtime-health-entity.md", + "summary_text": "`runtime health` — доменная модель наблюдаемости сервиса, которая описывает общее состояние runtime и состояние отдельных компонентов. Для `test_echo_app` главным объектом наблюдения является компонент `telegram_notify`, у которого важны статус, время старта и количество успешных отправок. Эта модель используется для внешнего health-monitoring и внутренней диагностики.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/api/health-endpoint.md", + "title": "HTTP API /health", + "content": "Endpoint `/health` возвращает агрегированный health payload runtime. Если общий статус равен `ok`, API отвечает с HTTP 200; для состояний деградации или неготовности возвращается HTTP 503 с тем же payload. Endpoint служит основной точкой внешней проверки состояния приложения.", + "metadata": { + "name": "health_endpoint", + "tags": [ + "api", + "health", + "control-plane" + ], + "type": "api_method", + "layer": "application", + "links": [ + { + "type": "part_of", + "target": "architecture.telegram_notify_app" + }, + { + "type": "depends_on", + "target": "domain.runtime_health" + } + ], + "owner": null, + "title": "HTTP API /health", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "architecture.telegram_notify_app", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "8b5a533a8076e2e9d36995eee29aeade260080bdca2ec8e21fe28f08574b983f", + "children": [], + "doc_kind": "misc", + "entities": [ + "TelegramControlChannel", + "TelegramNotifyWorker", + "RuntimeManager", + "WorkerHealth" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "api.health_endpoint", + "source_path": "docs/documentation/api/health-endpoint.md", + "summary_text": "Endpoint `/health` возвращает агрегированный health payload runtime. Если общий статус равен `ok`, API отвечает с HTTP 200; для состояний деградации или неготовности возвращается HTTP 503 с тем же payload. Endpoint служит основной точкой внешней проверки состояния приложения.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/logic/telegram-notification-loop.md", + "title": "Цикл отправки уведомлений в Telegram", + "content": "`TelegramNotifyWorker` после старта runtime запускает отдельный поток, сразу делает первую попытку отправки сообщения и затем повторяет отправку через заданный интервал. При ошибках доставки или отсутствии credentials worker не останавливает сервис, а переводит собственное состояние в `degraded`. Этот workflow определяет основной полезный цикл приложения.", + "metadata": { + "name": "telegram_notification_loop", + "tags": [ + "logic", + "telegram", + "worker", + "scheduling" + ], + "type": "logic_block", + "layer": "application", + "links": [ + { + "type": "part_of", + "target": "architecture.telegram_notify_app" + }, + { + "type": "related_api", + "target": "api.send_message_endpoint" + }, + { + "type": "related_api", + "target": "api.control_actions_endpoint" + }, + { + "type": "related_api", + "target": "api.health_endpoint" + } + ], + "owner": null, + "title": "Цикл отправки уведомлений в Telegram", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "architecture.telegram_notify_app", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "0f62f9b4dab261ca4ca34575ff5d84411a22c90b780c52eda388782b94f08470", + "children": [], + "doc_kind": "misc", + "entities": [ + "TelegramNotifyWorker", + "TelegramSendService", + "WorkerHealth", + "WorkerStatus" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "logic.telegram_notification_loop", + "source_path": "docs/documentation/logic/telegram-notification-loop.md", + "summary_text": "`TelegramNotifyWorker` после старта runtime запускает отдельный поток, сразу делает первую попытку отправки сообщения и затем повторяет отправку через заданный интервал. При ошибках доставки или отсутствии credentials worker не останавливает сервис, а переводит собственное состояние в `degraded`. Этот workflow определяет основной полезный цикл приложения.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "HTTP API /actions/{action}", + "content": "Endpoint `/actions/{action}` управляет control actions runtime и поддерживает `start`, `stop` и `status`. Для долгих операций `start` и `stop` допускается ответ HTTP 202, если действие еще выполняется. Endpoint используется для operator-driven управления жизненным циклом worker'а через HTTP API.", + "metadata": { + "name": "control_actions_endpoint", + "tags": [ + "api", + "control-plane", + "lifecycle" + ], + "type": "api_method", + "layer": "application", + "links": [ + { + "type": "part_of", + "target": "architecture.telegram_notify_app" + }, + { + "type": "related_api", + "target": "api.health_endpoint" + }, + { + "type": "related_logic", + "target": "logic.telegram_notification_loop" + } + ], + "owner": null, + "title": "HTTP API /actions/{action}", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "architecture.telegram_notify_app", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "children": [], + "doc_kind": "misc", + "entities": [ + "TelegramControlChannel", + "ControlActionSet", + "JSONResponse" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "api.control_actions_endpoint", + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "summary_text": "Endpoint `/actions/{action}` управляет control actions runtime и поддерживает `start`, `stop` и `status`. Для долгих операций `start` и `stop` допускается ответ HTTP 202, если действие еще выполняется. Endpoint используется для operator-driven управления жизненным циклом worker'а через HTTP API.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/architecture/telegram-notify-app-overview.md", + "title": "Архитектура Telegram Notify App", + "content": "`test_echo_app` — сервис на базе PLBA runtime, который поднимает HTTP control plane и запускает фоновый воркер для периодической отправки уведомлений в Telegram. Приложение использует YAML-конфиг для runtime-настроек и переменные окружения для Telegram credentials. Основной контур системы состоит из runtime manager, control channel, send service и worker loop.", + "metadata": { + "name": "telegram_notify_app_overview", + "tags": [ + "architecture", + "telegram", + "plba", + "runtime" + ], + "type": "architecture_overview", + "layer": "system", + "links": [ + { + "type": "related_api", + "target": "api.health_endpoint" + }, + { + "type": "related_api", + "target": "api.control_actions_endpoint" + }, + { + "type": "related_api", + "target": "api.send_message_endpoint" + }, + { + "type": "depends_on", + "target": "logic.telegram_notification_loop" + }, + { + "type": "depends_on", + "target": "domain.runtime_health" + } + ], + "owner": null, + "title": "Архитектура Telegram Notify App", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "docs_root", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "8b1cc9f823e55bddbc825466d10a0fdb4ca4354ac02d91f9e2aef7b7d2ec8256", + "children": [ + "api.health_endpoint", + "api.control_actions_endpoint", + "api.send_message_endpoint", + "logic.telegram_notification_loop", + "domain.runtime_health" + ], + "doc_kind": "spec", + "entities": [ + "TelegramNotifyModule", + "TelegramNotifyWorker", + "TelegramControlChannel", + "TelegramSendService", + "RuntimeManager" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "architecture.telegram_notify_app", + "source_path": "docs/documentation/architecture/telegram-notify-app-overview.md", + "summary_text": "`test_echo_app` — сервис на базе PLBA runtime, который поднимает HTTP control plane и запускает фоновый воркер для периодической отправки уведомлений в Telegram. Приложение использует YAML-конфиг для runtime-настроек и переменные окружения для Telegram credentials. Основной контур системы состоит из runtime manager, control channel, send service и worker loop.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/api/send-message-endpoint.md", + "title": "HTTP API /send", + "content": "Endpoint `/send` выполняет ручную отправку сообщения в Telegram через `TelegramSendService`. Он используется для операторской проверки доставки и для отправки уведомлений вне периодического worker loop. Endpoint работает поверх тех же credentials и того же delivery path, что и фоновая отправка.", + "metadata": { + "name": "send_message_endpoint", + "tags": [ + "api", + "telegram", + "manual-send" + ], + "type": "api_method", + "layer": "application", + "links": [ + { + "type": "part_of", + "target": "architecture.telegram_notify_app" + }, + { + "type": "depends_on", + "target": "logic.telegram_notification_loop" + } + ], + "owner": null, + "title": "HTTP API /send", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "architecture.telegram_notify_app", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "5fbf2e33510b0676a3a53b957a4569bd3c2c31fb7719546602c573421ccaa32d", + "children": [], + "doc_kind": "misc", + "entities": [ + "TelegramControlAppFactory", + "TelegramSendService", + "TelegramNotifyWorker" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "api.send_message_endpoint", + "source_path": "docs/documentation/api/send-message-endpoint.md", + "summary_text": "Endpoint `/send` выполняет ручную отправку сообщения в Telegram через `TelegramSendService`. Он используется для операторской проверки доставки и для отправки уведомлений вне периодического worker loop. Endpoint работает поверх тех же credentials и того же delivery path, что и фоновая отправка.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + } + ], + "facts": [], + "relations": [ + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/domain/runtime-health-entity.md", + "title": "domain.runtime_health:parent", + "content": "domain.runtime_health parent architecture.telegram_notify_app", + "metadata": { + "owner": null, + "anchor": "frontmatter.parent", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "37d4dcf470ea3de95d59e44786006e369a3ea11bf5dbf4c88877696e9183ee87", + "source_id": "domain.runtime_health", + "target_id": "architecture.telegram_notify_app", + "doc_version": null, + "relation_id": "79bdb0a74713df6064008179ca8c5c186dc23e4e1c5e2c9607b0bdddeba50f93", + "source_path": "docs/documentation/domain/runtime-health-entity.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "parent", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/domain/runtime-health-entity.md", + "title": "domain.runtime_health:part_of", + "content": "domain.runtime_health part_of architecture.telegram_notify_app", + "metadata": { + "owner": null, + "anchor": "frontmatter.links", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "37d4dcf470ea3de95d59e44786006e369a3ea11bf5dbf4c88877696e9183ee87", + "source_id": "domain.runtime_health", + "target_id": "architecture.telegram_notify_app", + "doc_version": null, + "relation_id": "af2a4f7c1b677b908410ba720915405e10dbd0870e30a3c6e3aa2468550ddf0e", + "source_path": "docs/documentation/domain/runtime-health-entity.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "part_of", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/api/health-endpoint.md", + "title": "api.health_endpoint:depends_on", + "content": "api.health_endpoint depends_on domain.runtime_health", + "metadata": { + "owner": null, + "anchor": "frontmatter.links", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "8b5a533a8076e2e9d36995eee29aeade260080bdca2ec8e21fe28f08574b983f", + "source_id": "api.health_endpoint", + "target_id": "domain.runtime_health", + "doc_version": null, + "relation_id": "77f5d358ab85b3d92018b6b51da7c39773148dfd346686e8832a45370c841160", + "source_path": "docs/documentation/api/health-endpoint.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "depends_on", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/api/health-endpoint.md", + "title": "api.health_endpoint:parent", + "content": "api.health_endpoint parent architecture.telegram_notify_app", + "metadata": { + "owner": null, + "anchor": "frontmatter.parent", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "8b5a533a8076e2e9d36995eee29aeade260080bdca2ec8e21fe28f08574b983f", + "source_id": "api.health_endpoint", + "target_id": "architecture.telegram_notify_app", + "doc_version": null, + "relation_id": "c718b1939621233295ccaf6e8203e7fd94f3dd1bfb88f10c51bc5e33d53a24aa", + "source_path": "docs/documentation/api/health-endpoint.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "parent", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/api/health-endpoint.md", + "title": "api.health_endpoint:part_of", + "content": "api.health_endpoint part_of architecture.telegram_notify_app", + "metadata": { + "owner": null, + "anchor": "frontmatter.links", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "8b5a533a8076e2e9d36995eee29aeade260080bdca2ec8e21fe28f08574b983f", + "source_id": "api.health_endpoint", + "target_id": "architecture.telegram_notify_app", + "doc_version": null, + "relation_id": "616f5cbf25da83cb51d8d0741a7fc351620c9ca2c6513fa2094b4aa476f0912a", + "source_path": "docs/documentation/api/health-endpoint.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "part_of", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/domain/runtime-health-entity.md", + "title": "domain.runtime_health:used_by", + "content": "domain.runtime_health used_by api.health_endpoint", + "metadata": { + "owner": null, + "anchor": "frontmatter.links", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "37d4dcf470ea3de95d59e44786006e369a3ea11bf5dbf4c88877696e9183ee87", + "source_id": "domain.runtime_health", + "target_id": "api.health_endpoint", + "doc_version": null, + "relation_id": "801650f8bcbfbfbefd35c14447bfef7b3c3827313db790efa7faf47db860f8c4", + "source_path": "docs/documentation/domain/runtime-health-entity.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "used_by", + "staleness_score": null, + "system_component": null + } + } + ] +} +``` + +### User Prompt Overview +- question: Что такое runtime health? +- intent: DOCUMENTATION_EXPLAIN +- sub_intent: ENTITY_EXPLAIN +- documents: 6 | samples: Сущность runtime health, HTTP API /health, Цикл отправки уведомлений в Telegram +- facts: 0 +- relations: 6 | samples: domain.runtime_health:parent, domain.runtime_health:part_of, api.health_endpoint:depends_on + +## Mismatches +- none \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/docs_pre_llm_v3/20260326_121025/full_chain_docs_intents_v3-3x_v3-entity-runtime-health-2.json b/tests/pipeline_setup_v3/test_results/docs_pre_llm_v3/20260326_121025/full_chain_docs_intents_v3-3x_v3-entity-runtime-health-2.json new file mode 100644 index 0000000..78f1b47 --- /dev/null +++ b/tests/pipeline_setup_v3/test_results/docs_pre_llm_v3/20260326_121025/full_chain_docs_intents_v3-3x_v3-entity-runtime-health-2.json @@ -0,0 +1,89 @@ +{ + "meta": { + "case_id": "v3-entity-runtime-health-2", + "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_03_docs/full_chain_docs_intents_v3-3x.yaml", + "runner": "agent_runtime", + "mode": "pre_llm", + "passed": false, + "mismatches": [ + "sub_intent: expected ENTITY_EXPLAIN, got GENERIC_QA" + ], + "actual": { + "intent": "GENERAL_QA", + "sub_intent": "GENERIC_QA", + "graph_id": "DocsQAGraph", + "conversation_mode": "START", + "rag_count": 12, + "llm_answer": "", + "answer_mode": "answered", + "path_scope": [], + "doc_scope": [ + "domain.runtime_health", + "api.health_endpoint", + "logic.telegram_notification_loop", + "api.control_actions_endpoint", + "api.actions_endpoint" + ], + "entity_candidates": [ + "runtime health" + ], + "symbol_candidates": [], + "layers": [ + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "filters": { + "doc_type": null + }, + "pipeline_mode": "pre_llm_only", + "gate_decision": "allow", + "prompt_used": "docs_general_answer", + "llm_mode": "prose", + "degraded_reason": null, + "code_intents_stubbed": true + } + }, + "pipeline_steps": [ + { + "step": "input_query", + "input": { + "query": "Объясни runtime health" + }, + "output": { + "query": "Объясни runtime health" + } + }, + { + "step": "router", + "input": { + "query": "Объясни runtime health" + }, + "output": { + "intent": "GENERAL_QA", + "sub_intent": "GENERIC_QA", + "graph_id": "DocsQAGraph", + "conversation_mode": "START" + } + }, + { + "step": "docs_pipeline", + "input": { + "query": "Объясни runtime health" + }, + "output": { + "answer_mode": "ready", + "prompt_name": "docs_general_answer", + "llm_request": { + "prompt_name": "docs_general_answer", + "log_context": "graph.project_qa.docs.answer", + "prompt_stats": { + "system_chars": 345, + "user_chars": 9449, + "tokens_in_estimate": 2449 + } + }, + "degraded_reason": "" + } + } + ] +} \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/docs_pre_llm_v3/20260326_121025/full_chain_docs_intents_v3-3x_v3-entity-runtime-health-2.md b/tests/pipeline_setup_v3/test_results/docs_pre_llm_v3/20260326_121025/full_chain_docs_intents_v3-3x_v3-entity-runtime-health-2.md new file mode 100644 index 0000000..a9093b9 --- /dev/null +++ b/tests/pipeline_setup_v3/test_results/docs_pre_llm_v3/20260326_121025/full_chain_docs_intents_v3-3x_v3-entity-runtime-health-2.md @@ -0,0 +1,528 @@ +# v3-entity-runtime-health-2 + +- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_03_docs/full_chain_docs_intents_v3-3x.yaml +- runner: agent_runtime +- mode: pre_llm +- passed: False + +## Query +Объясни runtime health + +## Actual +{ + "intent": "GENERAL_QA", + "sub_intent": "GENERIC_QA", + "graph_id": "DocsQAGraph", + "conversation_mode": "START", + "rag_count": 12, + "llm_answer": "", + "answer_mode": "answered", + "path_scope": [], + "doc_scope": [ + "domain.runtime_health", + "api.health_endpoint", + "logic.telegram_notification_loop", + "api.control_actions_endpoint", + "api.actions_endpoint" + ], + "entity_candidates": [ + "runtime health" + ], + "symbol_candidates": [], + "layers": [ + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "filters": { + "doc_type": null + }, + "pipeline_mode": "pre_llm_only", + "gate_decision": "allow", + "prompt_used": "docs_general_answer", + "llm_mode": "prose", + "degraded_reason": null, + "code_intents_stubbed": true +} + +## Pipeline Steps +### input_query +```json +{ + "input": { + "query": "Объясни runtime health" + }, + "output": { + "query": "Объясни runtime health" + } +} +``` + +### router +```json +{ + "input": { + "query": "Объясни runtime health" + }, + "output": { + "intent": "GENERAL_QA", + "sub_intent": "GENERIC_QA", + "graph_id": "DocsQAGraph", + "conversation_mode": "START" + } +} +``` + +### docs_pipeline +```json +{ + "input": { + "query": "Объясни runtime health" + }, + "output": { + "answer_mode": "ready", + "prompt_name": "docs_general_answer", + "llm_request": { + "prompt_name": "docs_general_answer", + "log_context": "graph.project_qa.docs.answer", + "prompt_stats": { + "system_chars": 345, + "user_chars": 9449, + "tokens_in_estimate": 2449 + } + }, + "degraded_reason": "" + } +} +``` + +## Diagnostics +{ + "intent": "GENERAL_QA", + "sub_intent": "GENERIC_QA", + "layers_used": [ + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "documents_found": 4, + "facts_found": 0, + "relations_found": 0, + "openapi_fields_extracted": 0, + "missing_required_fields": [], + "openapi_status": { + "has_path": false, + "has_method": false, + "has_request": false, + "has_response": false + }, + "prompt_used": "docs_general_answer", + "llm_mode": "prose", + "output_valid": true, + "matched_intent_source": "deterministic", + "matched_anchor_type": "none", + "matched_anchor_value": null, + "exact_anchor_match": false, + "docs_layers_requested": [ + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "docs_layers_with_hits": [ + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "planned_layers": [ + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "executed_layers": [ + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "non_empty_layers": [ + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "layer_diagnostics": { + "D1_DOCUMENT_CATALOG": { + "hits": 4, + "top_ids": [ + "domain.runtime_health", + "api.health_endpoint", + "logic.telegram_notification_loop", + "api.control_actions_endpoint" + ] + }, + "D0_DOC_CHUNKS": { + "hits": 8, + "top_ids": [ + "api.health_endpoint" + ] + } + }, + "query_entity_candidates": [ + "runtime health" + ], + "resolved_entity_candidates": [], + "query_anchor_candidates": [], + "resolved_anchor_candidates": [ + "domain.runtime_health", + "docs/documentation/domain/runtime-health-entity.md", + "api.health_endpoint", + "docs/documentation/api/health-endpoint.md", + "logic.telegram_notification_loop", + "docs/documentation/logic/telegram-notification-loop.md", + "api.control_actions_endpoint", + "docs/documentation/api/control-actions-endpoint.md" + ], + "anchor_candidates": [], + "selected_anchor": null, + "anchor_selection_reason": "", + "anchor_match_type": "", + "doc_ids": [ + "domain.runtime_health", + "api.health_endpoint", + "logic.telegram_notification_loop", + "api.control_actions_endpoint", + "api.actions_endpoint" + ], + "doc_paths": [ + "docs/documentation/domain/runtime-health-entity.md", + "docs/documentation/api/health-endpoint.md", + "docs/documentation/logic/telegram-notification-loop.md", + "docs/documentation/api/control-actions-endpoint.md" + ], + "doc_titles": [ + "Сущность runtime health", + "HTTP API /health", + "Цикл отправки уведомлений в Telegram", + "HTTP API /actions/{action}", + "api.health_endpoint:Функциональные требования", + "api.health_endpoint:Выходные параметры", + "api.health_endpoint:Описание", + "api.health_endpoint:Сценарий", + "api.health_endpoint:Нефункциональные требования", + "api.health_endpoint:Входные параметры", + "api.health_endpoint:Summary", + "api.health_endpoint:Пример ответа" + ], + "relation_hits_count": 0, + "relation_targets": [], + "fallback_doc_hits_count": 12, + "fallback_used": false, + "fact_hits": 0, + "entity_hits": 0, + "evidence_summary": { + "documents": 4, + "facts": 0, + "relations": 0, + "chunks": 8, + "entity_hits": 0, + "openapi_signals": { + "path_found": false, + "method_found": false, + "request_schema": false, + "response_schema": false, + "status_codes": false, + "payload_description": false + } + }, + "gate_decision": "allow", + "gate_decision_reason": "evidence_sufficient", + "gate_missing_requirements": [], + "gate_satisfied_requirements": [ + "retrieval_non_empty" + ], + "openapi_evidence": { + "path_found": false, + "method_found": false, + "request_schema": false, + "response_schema": false, + "status_codes": false, + "payload_description": false + }, + "requested_fragment_type": null, + "fragment_evidence_found": [], + "fragment_missing_requirements": [], + "answer_mode": "ready", + "degrade_reason": null, + "degraded_reason": null, + "code_intents_stubbed": false +} + +## LLM Request +- prompt_name: docs_general_answer +- log_context: graph.project_qa.docs.answer + +### Prompt Stats +```json +{ + "system_chars": 345, + "user_chars": 9449, + "tokens_in_estimate": 2449 +} +``` + +### System Prompt +```text +Ты отвечаешь на общий вопрос по документации проекта. + +На вход приходит JSON с полями: +- question +- intent +- sub_intent +- documents +- facts +- relations + +Правила: +- Используй только предоставленные документы и факты +- Не додумывай отсутствующие детали +- Если данных недостаточно, скажи это прямо +- Дай короткий понятный ответ без лишней структуры +``` + +### User Prompt +```json +{ + "question": "Объясни runtime health", + "intent": "GENERAL_QA", + "sub_intent": "GENERIC_QA", + "documents": [ + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/domain/runtime-health-entity.md", + "title": "Сущность runtime health", + "content": "`runtime health` — доменная модель наблюдаемости сервиса, которая описывает общее состояние runtime и состояние отдельных компонентов. Для `test_echo_app` главным объектом наблюдения является компонент `telegram_notify`, у которого важны статус, время старта и количество успешных отправок. Эта модель используется для внешнего health-monitoring и внутренней диагностики.", + "metadata": { + "name": "runtime_health", + "tags": [ + "domain", + "health", + "observability" + ], + "type": "domain_entity", + "layer": "domain", + "links": [ + { + "type": "part_of", + "target": "architecture.telegram_notify_app" + }, + { + "type": "used_by", + "target": "api.health_endpoint" + }, + { + "type": "related_logic", + "target": "logic.telegram_notification_loop" + } + ], + "owner": null, + "title": "Сущность runtime health", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "architecture.telegram_notify_app", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "37d4dcf470ea3de95d59e44786006e369a3ea11bf5dbf4c88877696e9183ee87", + "children": [], + "doc_kind": "misc", + "entities": [ + "WorkerHealth", + "WorkerStatus", + "TelegramNotifyWorker" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "domain.runtime_health", + "source_path": "docs/documentation/domain/runtime-health-entity.md", + "summary_text": "`runtime health` — доменная модель наблюдаемости сервиса, которая описывает общее состояние runtime и состояние отдельных компонентов. Для `test_echo_app` главным объектом наблюдения является компонент `telegram_notify`, у которого важны статус, время старта и количество успешных отправок. Эта модель используется для внешнего health-monitoring и внутренней диагностики.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/api/health-endpoint.md", + "title": "HTTP API /health", + "content": "Endpoint `/health` возвращает агрегированный health payload runtime. Если общий статус равен `ok`, API отвечает с HTTP 200; для состояний деградации или неготовности возвращается HTTP 503 с тем же payload. Endpoint служит основной точкой внешней проверки состояния приложения.", + "metadata": { + "name": "health_endpoint", + "tags": [ + "api", + "health", + "control-plane" + ], + "type": "api_method", + "layer": "application", + "links": [ + { + "type": "part_of", + "target": "architecture.telegram_notify_app" + }, + { + "type": "depends_on", + "target": "domain.runtime_health" + } + ], + "owner": null, + "title": "HTTP API /health", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "architecture.telegram_notify_app", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "8b5a533a8076e2e9d36995eee29aeade260080bdca2ec8e21fe28f08574b983f", + "children": [], + "doc_kind": "misc", + "entities": [ + "TelegramControlChannel", + "TelegramNotifyWorker", + "RuntimeManager", + "WorkerHealth" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "api.health_endpoint", + "source_path": "docs/documentation/api/health-endpoint.md", + "summary_text": "Endpoint `/health` возвращает агрегированный health payload runtime. Если общий статус равен `ok`, API отвечает с HTTP 200; для состояний деградации или неготовности возвращается HTTP 503 с тем же payload. Endpoint служит основной точкой внешней проверки состояния приложения.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/logic/telegram-notification-loop.md", + "title": "Цикл отправки уведомлений в Telegram", + "content": "`TelegramNotifyWorker` после старта runtime запускает отдельный поток, сразу делает первую попытку отправки сообщения и затем повторяет отправку через заданный интервал. При ошибках доставки или отсутствии credentials worker не останавливает сервис, а переводит собственное состояние в `degraded`. Этот workflow определяет основной полезный цикл приложения.", + "metadata": { + "name": "telegram_notification_loop", + "tags": [ + "logic", + "telegram", + "worker", + "scheduling" + ], + "type": "logic_block", + "layer": "application", + "links": [ + { + "type": "part_of", + "target": "architecture.telegram_notify_app" + }, + { + "type": "related_api", + "target": "api.send_message_endpoint" + }, + { + "type": "related_api", + "target": "api.control_actions_endpoint" + }, + { + "type": "related_api", + "target": "api.health_endpoint" + } + ], + "owner": null, + "title": "Цикл отправки уведомлений в Telegram", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "architecture.telegram_notify_app", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "0f62f9b4dab261ca4ca34575ff5d84411a22c90b780c52eda388782b94f08470", + "children": [], + "doc_kind": "misc", + "entities": [ + "TelegramNotifyWorker", + "TelegramSendService", + "WorkerHealth", + "WorkerStatus" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "logic.telegram_notification_loop", + "source_path": "docs/documentation/logic/telegram-notification-loop.md", + "summary_text": "`TelegramNotifyWorker` после старта runtime запускает отдельный поток, сразу делает первую попытку отправки сообщения и затем повторяет отправку через заданный интервал. При ошибках доставки или отсутствии credentials worker не останавливает сервис, а переводит собственное состояние в `degraded`. Этот workflow определяет основной полезный цикл приложения.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "HTTP API /actions/{action}", + "content": "Endpoint `/actions/{action}` управляет control actions runtime и поддерживает `start`, `stop` и `status`. Для долгих операций `start` и `stop` допускается ответ HTTP 202, если действие еще выполняется. Endpoint используется для operator-driven управления жизненным циклом worker'а через HTTP API.", + "metadata": { + "name": "control_actions_endpoint", + "tags": [ + "api", + "control-plane", + "lifecycle" + ], + "type": "api_method", + "layer": "application", + "links": [ + { + "type": "part_of", + "target": "architecture.telegram_notify_app" + }, + { + "type": "related_api", + "target": "api.health_endpoint" + }, + { + "type": "related_logic", + "target": "logic.telegram_notification_loop" + } + ], + "owner": null, + "title": "HTTP API /actions/{action}", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "architecture.telegram_notify_app", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "children": [], + "doc_kind": "misc", + "entities": [ + "TelegramControlChannel", + "ControlActionSet", + "JSONResponse" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "api.control_actions_endpoint", + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "summary_text": "Endpoint `/actions/{action}` управляет control actions runtime и поддерживает `start`, `stop` и `status`. Для долгих операций `start` и `stop` допускается ответ HTTP 202, если действие еще выполняется. Endpoint используется для operator-driven управления жизненным циклом worker'а через HTTP API.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + } + ], + "facts": [], + "relations": [] +} +``` + +### User Prompt Overview +- question: Объясни runtime health +- intent: GENERAL_QA +- sub_intent: GENERIC_QA +- documents: 4 | samples: Сущность runtime health, HTTP API /health, Цикл отправки уведомлений в Telegram +- facts: 0 +- relations: 0 + +## Mismatches +- sub_intent: expected ENTITY_EXPLAIN, got GENERIC_QA \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/docs_pre_llm_v3/20260326_121025/full_chain_docs_intents_v3-3x_v3-entity-worker-status-1.json b/tests/pipeline_setup_v3/test_results/docs_pre_llm_v3/20260326_121025/full_chain_docs_intents_v3-3x_v3-entity-worker-status-1.json new file mode 100644 index 0000000..286122e --- /dev/null +++ b/tests/pipeline_setup_v3/test_results/docs_pre_llm_v3/20260326_121025/full_chain_docs_intents_v3-3x_v3-entity-worker-status-1.json @@ -0,0 +1,93 @@ +{ + "meta": { + "case_id": "v3-entity-worker-status-1", + "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_03_docs/full_chain_docs_intents_v3-3x.yaml", + "runner": "agent_runtime", + "mode": "pre_llm", + "passed": true, + "mismatches": [], + "actual": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "ENTITY_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START", + "rag_count": 26, + "llm_answer": "", + "answer_mode": "answered", + "path_scope": [], + "doc_scope": [ + "domain.runtime_health", + "logic.telegram_notification_loop", + "api.control_actions_endpoint", + "api.health_endpoint", + "api.send_message_endpoint", + "docs/README.md", + "api.actions_endpoint", + "architecture.telegram_notify_app", + "architecture.telegram_notify_app_overview" + ], + "entity_candidates": [ + "WorkerStatus" + ], + "symbol_candidates": [], + "layers": [ + "D3_ENTITY_CATALOG", + "D1_DOCUMENT_CATALOG", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "filters": { + "doc_type": null + }, + "pipeline_mode": "pre_llm_only", + "gate_decision": "allow", + "prompt_used": "docs_explain_answer", + "llm_mode": "prose", + "degraded_reason": null, + "code_intents_stubbed": true + } + }, + "pipeline_steps": [ + { + "step": "input_query", + "input": { + "query": "Что такое WorkerStatus?" + }, + "output": { + "query": "Что такое WorkerStatus?" + } + }, + { + "step": "router", + "input": { + "query": "Что такое WorkerStatus?" + }, + "output": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "ENTITY_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START" + } + }, + { + "step": "docs_pipeline", + "input": { + "query": "Что такое WorkerStatus?" + }, + "output": { + "answer_mode": "ready", + "prompt_name": "docs_explain_answer", + "llm_request": { + "prompt_name": "docs_explain_answer", + "log_context": "graph.project_qa.docs.answer", + "prompt_stats": { + "system_chars": 393, + "user_chars": 18776, + "tokens_in_estimate": 4793 + } + }, + "degraded_reason": "" + } + } + ] +} \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/docs_pre_llm_v3/20260326_121025/full_chain_docs_intents_v3-3x_v3-entity-worker-status-1.md b/tests/pipeline_setup_v3/test_results/docs_pre_llm_v3/20260326_121025/full_chain_docs_intents_v3-3x_v3-entity-worker-status-1.md new file mode 100644 index 0000000..1ca7af5 --- /dev/null +++ b/tests/pipeline_setup_v3/test_results/docs_pre_llm_v3/20260326_121025/full_chain_docs_intents_v3-3x_v3-entity-worker-status-1.md @@ -0,0 +1,849 @@ +# v3-entity-worker-status-1 + +- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_03_docs/full_chain_docs_intents_v3-3x.yaml +- runner: agent_runtime +- mode: pre_llm +- passed: True + +## Query +Что такое WorkerStatus? + +## Actual +{ + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "ENTITY_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START", + "rag_count": 26, + "llm_answer": "", + "answer_mode": "answered", + "path_scope": [], + "doc_scope": [ + "domain.runtime_health", + "logic.telegram_notification_loop", + "api.control_actions_endpoint", + "api.health_endpoint", + "api.send_message_endpoint", + "docs/README.md", + "api.actions_endpoint", + "architecture.telegram_notify_app", + "architecture.telegram_notify_app_overview" + ], + "entity_candidates": [ + "WorkerStatus" + ], + "symbol_candidates": [], + "layers": [ + "D3_ENTITY_CATALOG", + "D1_DOCUMENT_CATALOG", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "filters": { + "doc_type": null + }, + "pipeline_mode": "pre_llm_only", + "gate_decision": "allow", + "prompt_used": "docs_explain_answer", + "llm_mode": "prose", + "degraded_reason": null, + "code_intents_stubbed": true +} + +## Pipeline Steps +### input_query +```json +{ + "input": { + "query": "Что такое WorkerStatus?" + }, + "output": { + "query": "Что такое WorkerStatus?" + } +} +``` + +### router +```json +{ + "input": { + "query": "Что такое WorkerStatus?" + }, + "output": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "ENTITY_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START" + } +} +``` + +### docs_pipeline +```json +{ + "input": { + "query": "Что такое WorkerStatus?" + }, + "output": { + "answer_mode": "ready", + "prompt_name": "docs_explain_answer", + "llm_request": { + "prompt_name": "docs_explain_answer", + "log_context": "graph.project_qa.docs.answer", + "prompt_stats": { + "system_chars": 393, + "user_chars": 18776, + "tokens_in_estimate": 4793 + } + }, + "degraded_reason": "" + } +} +``` + +## Diagnostics +{ + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "ENTITY_EXPLAIN", + "layers_used": [ + "D3_ENTITY_CATALOG", + "D1_DOCUMENT_CATALOG", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "documents_found": 6, + "facts_found": 0, + "relations_found": 6, + "openapi_fields_extracted": 0, + "missing_required_fields": [], + "openapi_status": { + "has_path": false, + "has_method": false, + "has_request": false, + "has_response": false + }, + "prompt_used": "docs_explain_answer", + "llm_mode": "prose", + "output_valid": true, + "matched_intent_source": "deterministic", + "matched_anchor_type": "none", + "matched_anchor_value": null, + "exact_anchor_match": false, + "docs_layers_requested": [ + "D3_ENTITY_CATALOG", + "D1_DOCUMENT_CATALOG", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "docs_layers_with_hits": [ + "D3_ENTITY_CATALOG", + "D1_DOCUMENT_CATALOG", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "planned_layers": [ + "D3_ENTITY_CATALOG", + "D1_DOCUMENT_CATALOG", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "executed_layers": [ + "D3_ENTITY_CATALOG", + "D1_DOCUMENT_CATALOG", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "non_empty_layers": [ + "D3_ENTITY_CATALOG", + "D1_DOCUMENT_CATALOG", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "layer_diagnostics": { + "D3_ENTITY_CATALOG": { + "hits": 8, + "top_ids": [ + "domain.runtime_health", + "logic.telegram_notification_loop", + "api.control_actions_endpoint", + "api.health_endpoint" + ] + }, + "D1_DOCUMENT_CATALOG": { + "hits": 6, + "top_ids": [ + "docs/README.md", + "api.control_actions_endpoint", + "api.health_endpoint", + "api.send_message_endpoint", + "architecture.telegram_notify_app" + ] + }, + "D5_RELATION_GRAPH": { + "hits": 6, + "top_ids": [ + "5f4909bde905cd3d294ad307074a05e4ae4deefcafe6272cd2d0436e73acb8dd", + "711fb2edb82dd222deaba3c91768b18cbbd453009235823282813c6e867dc2c1", + "eec79f7a02b804337e791ef231784862ae26e0599eb20224790e9d4f085fa9c0", + "c718b1939621233295ccaf6e8203e7fd94f3dd1bfb88f10c51bc5e33d53a24aa", + "616f5cbf25da83cb51d8d0741a7fc351620c9ca2c6513fa2094b4aa476f0912a" + ] + }, + "D0_DOC_CHUNKS": { + "hits": 6, + "top_ids": [ + "logic.telegram_notification_loop", + "docs/README.md", + "api.control_actions_endpoint" + ] + } + }, + "query_entity_candidates": [ + "WorkerStatus" + ], + "resolved_entity_candidates": [], + "query_anchor_candidates": [ + "WorkerStatus" + ], + "resolved_anchor_candidates": [ + "domain.runtime_health", + "docs/documentation/domain/runtime-health-entity.md", + "logic.telegram_notification_loop", + "docs/documentation/logic/telegram-notification-loop.md", + "api.control_actions_endpoint", + "docs/documentation/api/control-actions-endpoint.md", + "api.health_endpoint", + "docs/documentation/api/health-endpoint.md", + "api.send_message_endpoint", + "docs/documentation/api/send-message-endpoint.md", + "docs/README.md", + "architecture.telegram_notify_app", + "docs/documentation/architecture/telegram-notify-app-overview.md" + ], + "anchor_candidates": [], + "selected_anchor": null, + "anchor_selection_reason": "", + "anchor_match_type": "", + "doc_ids": [ + "domain.runtime_health", + "logic.telegram_notification_loop", + "api.control_actions_endpoint", + "api.health_endpoint", + "api.send_message_endpoint", + "docs/README.md", + "api.actions_endpoint", + "architecture.telegram_notify_app", + "architecture.telegram_notify_app_overview" + ], + "doc_paths": [ + "docs/documentation/domain/runtime-health-entity.md", + "docs/documentation/logic/telegram-notification-loop.md", + "docs/documentation/api/control-actions-endpoint.md", + "docs/documentation/api/health-endpoint.md", + "docs/documentation/api/send-message-endpoint.md", + "docs/README.md", + "docs/documentation/architecture/telegram-notify-app-overview.md" + ], + "doc_titles": [ + "WorkerStatus", + "JSONResponse", + "TelegramNotifyWorker", + "RuntimeManager", + "WorkerHealth", + "TelegramControlAppFactory", + "TelegramControlChannel", + "Readme", + "HTTP API /actions/{action}", + "HTTP API /health", + "HTTP API /send", + "Архитектура Telegram Notify App", + "Сущность runtime health", + "api.control_actions_endpoint:part_of", + "api.control_actions_endpoint:related_api", + "api.control_actions_endpoint:related_logic", + "api.health_endpoint:parent", + "api.health_endpoint:part_of", + "api.control_actions_endpoint:parent", + "logic.telegram_notification_loop:Details", + "docs/README.md:Навигация", + "docs/README.md:Правила и шаблоны", + "api.control_actions_endpoint:Summary", + "api.control_actions_endpoint:Описание", + "docs/README.md:Структура" + ], + "relation_hits_count": 6, + "relation_targets": [ + "api.control_actions_endpoint:part_of", + "api.control_actions_endpoint:related_api", + "api.control_actions_endpoint:related_logic", + "api.health_endpoint:parent", + "api.health_endpoint:part_of", + "api.control_actions_endpoint:parent" + ], + "fallback_doc_hits_count": 12, + "fallback_used": false, + "fact_hits": 0, + "entity_hits": 0, + "evidence_summary": { + "documents": 6, + "facts": 0, + "relations": 6, + "chunks": 6, + "entity_hits": 0, + "openapi_signals": { + "path_found": false, + "method_found": false, + "request_schema": false, + "response_schema": false, + "status_codes": false, + "payload_description": false + } + }, + "gate_decision": "allow", + "gate_decision_reason": "evidence_sufficient", + "gate_missing_requirements": [], + "gate_satisfied_requirements": [ + "retrieval_non_empty" + ], + "openapi_evidence": { + "path_found": false, + "method_found": false, + "request_schema": false, + "response_schema": false, + "status_codes": false, + "payload_description": false + }, + "requested_fragment_type": null, + "fragment_evidence_found": [], + "fragment_missing_requirements": [], + "answer_mode": "ready", + "degrade_reason": null, + "degraded_reason": null, + "code_intents_stubbed": false +} + +## LLM Request +- prompt_name: docs_explain_answer +- log_context: graph.project_qa.docs.answer + +### Prompt Stats +```json +{ + "system_chars": 393, + "user_chars": 18776, + "tokens_in_estimate": 4793 +} +``` + +### System Prompt +```text +Ты объясняешь документацию системы. + +На вход приходит JSON с полями: +- question +- intent +- sub_intent +- documents +- facts +- relations + +Правила: +- Используй только предоставленные факты +- Не додумывай +- Если данных недостаточно, скажи это явно +- Объясняй структурировано + +Формат ответа: +1. Краткое описание +2. Основные элементы +3. Как это работает +4. Связи с другими частями системы (если есть) +``` + +### User Prompt +```json +{ + "question": "Что такое WorkerStatus?", + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "ENTITY_EXPLAIN", + "documents": [ + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/README.md", + "title": "Readme", + "content": "Readme", + "metadata": { + "name": "", + "tags": [], + "type": "", + "layer": "", + "links": [], + "owner": null, + "title": "Readme", + "doc_id": null, + "module": "", + "parent": null, + "status": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "81d952f1a6ea85b76f75e0e57f33b8fa4b2bf3cb7db11b91b90171aeedd655a6", + "children": [], + "doc_kind": "readme", + "entities": [], + "updated_at": null, + "doc_version": null, + "document_id": "docs/README.md", + "source_path": "docs/README.md", + "summary_text": "", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "HTTP API /actions/{action}", + "content": "Endpoint `/actions/{action}` управляет control actions runtime и поддерживает `start`, `stop` и `status`. Для долгих операций `start` и `stop` допускается ответ HTTP 202, если действие еще выполняется. Endpoint используется для operator-driven управления жизненным циклом worker'а через HTTP API.", + "metadata": { + "name": "control_actions_endpoint", + "tags": [ + "api", + "control-plane", + "lifecycle" + ], + "type": "api_method", + "layer": "application", + "links": [ + { + "type": "part_of", + "target": "architecture.telegram_notify_app" + }, + { + "type": "related_api", + "target": "api.health_endpoint" + }, + { + "type": "related_logic", + "target": "logic.telegram_notification_loop" + } + ], + "owner": null, + "title": "HTTP API /actions/{action}", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "architecture.telegram_notify_app", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "children": [], + "doc_kind": "misc", + "entities": [ + "TelegramControlChannel", + "ControlActionSet", + "JSONResponse" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "api.control_actions_endpoint", + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "summary_text": "Endpoint `/actions/{action}` управляет control actions runtime и поддерживает `start`, `stop` и `status`. Для долгих операций `start` и `stop` допускается ответ HTTP 202, если действие еще выполняется. Endpoint используется для operator-driven управления жизненным циклом worker'а через HTTP API.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/api/health-endpoint.md", + "title": "HTTP API /health", + "content": "Endpoint `/health` возвращает агрегированный health payload runtime. Если общий статус равен `ok`, API отвечает с HTTP 200; для состояний деградации или неготовности возвращается HTTP 503 с тем же payload. Endpoint служит основной точкой внешней проверки состояния приложения.", + "metadata": { + "name": "health_endpoint", + "tags": [ + "api", + "health", + "control-plane" + ], + "type": "api_method", + "layer": "application", + "links": [ + { + "type": "part_of", + "target": "architecture.telegram_notify_app" + }, + { + "type": "depends_on", + "target": "domain.runtime_health" + } + ], + "owner": null, + "title": "HTTP API /health", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "architecture.telegram_notify_app", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "8b5a533a8076e2e9d36995eee29aeade260080bdca2ec8e21fe28f08574b983f", + "children": [], + "doc_kind": "misc", + "entities": [ + "TelegramControlChannel", + "TelegramNotifyWorker", + "RuntimeManager", + "WorkerHealth" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "api.health_endpoint", + "source_path": "docs/documentation/api/health-endpoint.md", + "summary_text": "Endpoint `/health` возвращает агрегированный health payload runtime. Если общий статус равен `ok`, API отвечает с HTTP 200; для состояний деградации или неготовности возвращается HTTP 503 с тем же payload. Endpoint служит основной точкой внешней проверки состояния приложения.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/api/send-message-endpoint.md", + "title": "HTTP API /send", + "content": "Endpoint `/send` выполняет ручную отправку сообщения в Telegram через `TelegramSendService`. Он используется для операторской проверки доставки и для отправки уведомлений вне периодического worker loop. Endpoint работает поверх тех же credentials и того же delivery path, что и фоновая отправка.", + "metadata": { + "name": "send_message_endpoint", + "tags": [ + "api", + "telegram", + "manual-send" + ], + "type": "api_method", + "layer": "application", + "links": [ + { + "type": "part_of", + "target": "architecture.telegram_notify_app" + }, + { + "type": "depends_on", + "target": "logic.telegram_notification_loop" + } + ], + "owner": null, + "title": "HTTP API /send", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "architecture.telegram_notify_app", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "5fbf2e33510b0676a3a53b957a4569bd3c2c31fb7719546602c573421ccaa32d", + "children": [], + "doc_kind": "misc", + "entities": [ + "TelegramControlAppFactory", + "TelegramSendService", + "TelegramNotifyWorker" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "api.send_message_endpoint", + "source_path": "docs/documentation/api/send-message-endpoint.md", + "summary_text": "Endpoint `/send` выполняет ручную отправку сообщения в Telegram через `TelegramSendService`. Он используется для операторской проверки доставки и для отправки уведомлений вне периодического worker loop. Endpoint работает поверх тех же credentials и того же delivery path, что и фоновая отправка.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/architecture/telegram-notify-app-overview.md", + "title": "Архитектура Telegram Notify App", + "content": "`test_echo_app` — сервис на базе PLBA runtime, который поднимает HTTP control plane и запускает фоновый воркер для периодической отправки уведомлений в Telegram. Приложение использует YAML-конфиг для runtime-настроек и переменные окружения для Telegram credentials. Основной контур системы состоит из runtime manager, control channel, send service и worker loop.", + "metadata": { + "name": "telegram_notify_app_overview", + "tags": [ + "architecture", + "telegram", + "plba", + "runtime" + ], + "type": "architecture_overview", + "layer": "system", + "links": [ + { + "type": "related_api", + "target": "api.health_endpoint" + }, + { + "type": "related_api", + "target": "api.control_actions_endpoint" + }, + { + "type": "related_api", + "target": "api.send_message_endpoint" + }, + { + "type": "depends_on", + "target": "logic.telegram_notification_loop" + }, + { + "type": "depends_on", + "target": "domain.runtime_health" + } + ], + "owner": null, + "title": "Архитектура Telegram Notify App", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "docs_root", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "8b1cc9f823e55bddbc825466d10a0fdb4ca4354ac02d91f9e2aef7b7d2ec8256", + "children": [ + "api.health_endpoint", + "api.control_actions_endpoint", + "api.send_message_endpoint", + "logic.telegram_notification_loop", + "domain.runtime_health" + ], + "doc_kind": "spec", + "entities": [ + "TelegramNotifyModule", + "TelegramNotifyWorker", + "TelegramControlChannel", + "TelegramSendService", + "RuntimeManager" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "architecture.telegram_notify_app", + "source_path": "docs/documentation/architecture/telegram-notify-app-overview.md", + "summary_text": "`test_echo_app` — сервис на базе PLBA runtime, который поднимает HTTP control plane и запускает фоновый воркер для периодической отправки уведомлений в Telegram. Приложение использует YAML-конфиг для runtime-настроек и переменные окружения для Telegram credentials. Основной контур системы состоит из runtime manager, control channel, send service и worker loop.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/domain/runtime-health-entity.md", + "title": "Сущность runtime health", + "content": "`runtime health` — доменная модель наблюдаемости сервиса, которая описывает общее состояние runtime и состояние отдельных компонентов. Для `test_echo_app` главным объектом наблюдения является компонент `telegram_notify`, у которого важны статус, время старта и количество успешных отправок. Эта модель используется для внешнего health-monitoring и внутренней диагностики.", + "metadata": { + "name": "runtime_health", + "tags": [ + "domain", + "health", + "observability" + ], + "type": "domain_entity", + "layer": "domain", + "links": [ + { + "type": "part_of", + "target": "architecture.telegram_notify_app" + }, + { + "type": "used_by", + "target": "api.health_endpoint" + }, + { + "type": "related_logic", + "target": "logic.telegram_notification_loop" + } + ], + "owner": null, + "title": "Сущность runtime health", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "architecture.telegram_notify_app", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "37d4dcf470ea3de95d59e44786006e369a3ea11bf5dbf4c88877696e9183ee87", + "children": [], + "doc_kind": "misc", + "entities": [ + "WorkerHealth", + "WorkerStatus", + "TelegramNotifyWorker" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "domain.runtime_health", + "source_path": "docs/documentation/domain/runtime-health-entity.md", + "summary_text": "`runtime health` — доменная модель наблюдаемости сервиса, которая описывает общее состояние runtime и состояние отдельных компонентов. Для `test_echo_app` главным объектом наблюдения является компонент `telegram_notify`, у которого важны статус, время старта и количество успешных отправок. Эта модель используется для внешнего health-monitoring и внутренней диагностики.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + } + ], + "facts": [], + "relations": [ + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "api.control_actions_endpoint:part_of", + "content": "api.control_actions_endpoint part_of architecture.telegram_notify_app", + "metadata": { + "owner": null, + "anchor": "frontmatter.links", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "source_id": "api.control_actions_endpoint", + "target_id": "architecture.telegram_notify_app", + "doc_version": null, + "relation_id": "5f4909bde905cd3d294ad307074a05e4ae4deefcafe6272cd2d0436e73acb8dd", + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "part_of", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "api.control_actions_endpoint:related_api", + "content": "api.control_actions_endpoint related_api api.health_endpoint", + "metadata": { + "owner": null, + "anchor": "frontmatter.links", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "source_id": "api.control_actions_endpoint", + "target_id": "api.health_endpoint", + "doc_version": null, + "relation_id": "711fb2edb82dd222deaba3c91768b18cbbd453009235823282813c6e867dc2c1", + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "related_api", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "api.control_actions_endpoint:related_logic", + "content": "api.control_actions_endpoint related_logic logic.telegram_notification_loop", + "metadata": { + "owner": null, + "anchor": "frontmatter.links", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "source_id": "api.control_actions_endpoint", + "target_id": "logic.telegram_notification_loop", + "doc_version": null, + "relation_id": "eec79f7a02b804337e791ef231784862ae26e0599eb20224790e9d4f085fa9c0", + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "related_logic", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/api/health-endpoint.md", + "title": "api.health_endpoint:parent", + "content": "api.health_endpoint parent architecture.telegram_notify_app", + "metadata": { + "owner": null, + "anchor": "frontmatter.parent", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "8b5a533a8076e2e9d36995eee29aeade260080bdca2ec8e21fe28f08574b983f", + "source_id": "api.health_endpoint", + "target_id": "architecture.telegram_notify_app", + "doc_version": null, + "relation_id": "c718b1939621233295ccaf6e8203e7fd94f3dd1bfb88f10c51bc5e33d53a24aa", + "source_path": "docs/documentation/api/health-endpoint.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "parent", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/api/health-endpoint.md", + "title": "api.health_endpoint:part_of", + "content": "api.health_endpoint part_of architecture.telegram_notify_app", + "metadata": { + "owner": null, + "anchor": "frontmatter.links", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "8b5a533a8076e2e9d36995eee29aeade260080bdca2ec8e21fe28f08574b983f", + "source_id": "api.health_endpoint", + "target_id": "architecture.telegram_notify_app", + "doc_version": null, + "relation_id": "616f5cbf25da83cb51d8d0741a7fc351620c9ca2c6513fa2094b4aa476f0912a", + "source_path": "docs/documentation/api/health-endpoint.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "part_of", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "api.control_actions_endpoint:parent", + "content": "api.control_actions_endpoint parent architecture.telegram_notify_app", + "metadata": { + "owner": null, + "anchor": "frontmatter.parent", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "source_id": "api.control_actions_endpoint", + "target_id": "architecture.telegram_notify_app", + "doc_version": null, + "relation_id": "afec31fd062e392dcd9699a92c7ab61fd4b1273c1a2b16702b23d55d8d0c47ac", + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "parent", + "staleness_score": null, + "system_component": null + } + } + ] +} +``` + +### User Prompt Overview +- question: Что такое WorkerStatus? +- intent: DOCUMENTATION_EXPLAIN +- sub_intent: ENTITY_EXPLAIN +- documents: 6 | samples: Readme, HTTP API /actions/{action}, HTTP API /health +- facts: 0 +- relations: 6 | samples: api.control_actions_endpoint:part_of, api.control_actions_endpoint:related_api, api.control_actions_endpoint:related_logic + +## Mismatches +- none \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/docs_pre_llm_v3/20260326_121025/full_chain_docs_intents_v3-3x_v3-entity-worker-status-2.json b/tests/pipeline_setup_v3/test_results/docs_pre_llm_v3/20260326_121025/full_chain_docs_intents_v3-3x_v3-entity-worker-status-2.json new file mode 100644 index 0000000..a649001 --- /dev/null +++ b/tests/pipeline_setup_v3/test_results/docs_pre_llm_v3/20260326_121025/full_chain_docs_intents_v3-3x_v3-entity-worker-status-2.json @@ -0,0 +1,87 @@ +{ + "meta": { + "case_id": "v3-entity-worker-status-2", + "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_03_docs/full_chain_docs_intents_v3-3x.yaml", + "runner": "agent_runtime", + "mode": "pre_llm", + "passed": false, + "mismatches": [ + "sub_intent: expected ENTITY_EXPLAIN, got GENERIC_QA" + ], + "actual": { + "intent": "GENERAL_QA", + "sub_intent": "GENERIC_QA", + "graph_id": "DocsQAGraph", + "conversation_mode": "START", + "rag_count": 12, + "llm_answer": "", + "answer_mode": "answered", + "path_scope": [], + "doc_scope": [ + "docs/README.md", + "api.control_actions_endpoint", + "api.actions_endpoint", + "api.health_endpoint", + "api.send_message_endpoint" + ], + "entity_candidates": [], + "symbol_candidates": [], + "layers": [ + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "filters": { + "doc_type": null + }, + "pipeline_mode": "pre_llm_only", + "gate_decision": "allow", + "prompt_used": "docs_general_answer", + "llm_mode": "prose", + "degraded_reason": null, + "code_intents_stubbed": true + } + }, + "pipeline_steps": [ + { + "step": "input_query", + "input": { + "query": "Опиши статус воркера" + }, + "output": { + "query": "Опиши статус воркера" + } + }, + { + "step": "router", + "input": { + "query": "Опиши статус воркера" + }, + "output": { + "intent": "GENERAL_QA", + "sub_intent": "GENERIC_QA", + "graph_id": "DocsQAGraph", + "conversation_mode": "START" + } + }, + { + "step": "docs_pipeline", + "input": { + "query": "Опиши статус воркера" + }, + "output": { + "answer_mode": "ready", + "prompt_name": "docs_general_answer", + "llm_request": { + "prompt_name": "docs_general_answer", + "log_context": "graph.project_qa.docs.answer", + "prompt_stats": { + "system_chars": 345, + "user_chars": 7558, + "tokens_in_estimate": 1976 + } + }, + "degraded_reason": "" + } + } + ] +} \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/docs_pre_llm_v3/20260326_121025/full_chain_docs_intents_v3-3x_v3-entity-worker-status-2.md b/tests/pipeline_setup_v3/test_results/docs_pre_llm_v3/20260326_121025/full_chain_docs_intents_v3-3x_v3-entity-worker-status-2.md new file mode 100644 index 0000000..5b1d2be --- /dev/null +++ b/tests/pipeline_setup_v3/test_results/docs_pre_llm_v3/20260326_121025/full_chain_docs_intents_v3-3x_v3-entity-worker-status-2.md @@ -0,0 +1,493 @@ +# v3-entity-worker-status-2 + +- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_03_docs/full_chain_docs_intents_v3-3x.yaml +- runner: agent_runtime +- mode: pre_llm +- passed: False + +## Query +Опиши статус воркера + +## Actual +{ + "intent": "GENERAL_QA", + "sub_intent": "GENERIC_QA", + "graph_id": "DocsQAGraph", + "conversation_mode": "START", + "rag_count": 12, + "llm_answer": "", + "answer_mode": "answered", + "path_scope": [], + "doc_scope": [ + "docs/README.md", + "api.control_actions_endpoint", + "api.actions_endpoint", + "api.health_endpoint", + "api.send_message_endpoint" + ], + "entity_candidates": [], + "symbol_candidates": [], + "layers": [ + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "filters": { + "doc_type": null + }, + "pipeline_mode": "pre_llm_only", + "gate_decision": "allow", + "prompt_used": "docs_general_answer", + "llm_mode": "prose", + "degraded_reason": null, + "code_intents_stubbed": true +} + +## Pipeline Steps +### input_query +```json +{ + "input": { + "query": "Опиши статус воркера" + }, + "output": { + "query": "Опиши статус воркера" + } +} +``` + +### router +```json +{ + "input": { + "query": "Опиши статус воркера" + }, + "output": { + "intent": "GENERAL_QA", + "sub_intent": "GENERIC_QA", + "graph_id": "DocsQAGraph", + "conversation_mode": "START" + } +} +``` + +### docs_pipeline +```json +{ + "input": { + "query": "Опиши статус воркера" + }, + "output": { + "answer_mode": "ready", + "prompt_name": "docs_general_answer", + "llm_request": { + "prompt_name": "docs_general_answer", + "log_context": "graph.project_qa.docs.answer", + "prompt_stats": { + "system_chars": 345, + "user_chars": 7558, + "tokens_in_estimate": 1976 + } + }, + "degraded_reason": "" + } +} +``` + +## Diagnostics +{ + "intent": "GENERAL_QA", + "sub_intent": "GENERIC_QA", + "layers_used": [ + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "documents_found": 4, + "facts_found": 0, + "relations_found": 0, + "openapi_fields_extracted": 0, + "missing_required_fields": [], + "openapi_status": { + "has_path": false, + "has_method": false, + "has_request": false, + "has_response": false + }, + "prompt_used": "docs_general_answer", + "llm_mode": "prose", + "output_valid": true, + "matched_intent_source": "deterministic", + "matched_anchor_type": "none", + "matched_anchor_value": null, + "exact_anchor_match": false, + "docs_layers_requested": [ + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "docs_layers_with_hits": [ + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "planned_layers": [ + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "executed_layers": [ + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "non_empty_layers": [ + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "layer_diagnostics": { + "D1_DOCUMENT_CATALOG": { + "hits": 4, + "top_ids": [ + "docs/README.md", + "api.control_actions_endpoint", + "api.health_endpoint", + "api.send_message_endpoint" + ] + }, + "D0_DOC_CHUNKS": { + "hits": 8, + "top_ids": [ + "docs/README.md", + "api.control_actions_endpoint" + ] + } + }, + "query_entity_candidates": [], + "resolved_entity_candidates": [], + "query_anchor_candidates": [], + "resolved_anchor_candidates": [ + "docs/README.md", + "api.control_actions_endpoint", + "docs/documentation/api/control-actions-endpoint.md", + "api.health_endpoint", + "docs/documentation/api/health-endpoint.md", + "api.send_message_endpoint", + "docs/documentation/api/send-message-endpoint.md" + ], + "anchor_candidates": [], + "selected_anchor": null, + "anchor_selection_reason": "", + "anchor_match_type": "", + "doc_ids": [ + "docs/README.md", + "api.control_actions_endpoint", + "api.actions_endpoint", + "api.health_endpoint", + "api.send_message_endpoint" + ], + "doc_paths": [ + "docs/README.md", + "docs/documentation/api/control-actions-endpoint.md", + "docs/documentation/api/health-endpoint.md", + "docs/documentation/api/send-message-endpoint.md" + ], + "doc_titles": [ + "Readme", + "HTTP API /actions/{action}", + "HTTP API /health", + "HTTP API /send", + "docs/README.md:Структура", + "docs/README.md:Навигация", + "docs/README.md:Правила и шаблоны", + "api.control_actions_endpoint:Summary", + "api.control_actions_endpoint:Описание", + "api.control_actions_endpoint:Сценарий", + "api.control_actions_endpoint:Функциональные требования", + "docs/README.md:Project Docs" + ], + "relation_hits_count": 0, + "relation_targets": [], + "fallback_doc_hits_count": 12, + "fallback_used": false, + "fact_hits": 0, + "entity_hits": 0, + "evidence_summary": { + "documents": 4, + "facts": 0, + "relations": 0, + "chunks": 8, + "entity_hits": 0, + "openapi_signals": { + "path_found": false, + "method_found": false, + "request_schema": false, + "response_schema": false, + "status_codes": false, + "payload_description": false + } + }, + "gate_decision": "allow", + "gate_decision_reason": "evidence_sufficient", + "gate_missing_requirements": [], + "gate_satisfied_requirements": [ + "retrieval_non_empty" + ], + "openapi_evidence": { + "path_found": false, + "method_found": false, + "request_schema": false, + "response_schema": false, + "status_codes": false, + "payload_description": false + }, + "requested_fragment_type": null, + "fragment_evidence_found": [], + "fragment_missing_requirements": [], + "answer_mode": "ready", + "degrade_reason": null, + "degraded_reason": null, + "code_intents_stubbed": false +} + +## LLM Request +- prompt_name: docs_general_answer +- log_context: graph.project_qa.docs.answer + +### Prompt Stats +```json +{ + "system_chars": 345, + "user_chars": 7558, + "tokens_in_estimate": 1976 +} +``` + +### System Prompt +```text +Ты отвечаешь на общий вопрос по документации проекта. + +На вход приходит JSON с полями: +- question +- intent +- sub_intent +- documents +- facts +- relations + +Правила: +- Используй только предоставленные документы и факты +- Не додумывай отсутствующие детали +- Если данных недостаточно, скажи это прямо +- Дай короткий понятный ответ без лишней структуры +``` + +### User Prompt +```json +{ + "question": "Опиши статус воркера", + "intent": "GENERAL_QA", + "sub_intent": "GENERIC_QA", + "documents": [ + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/README.md", + "title": "Readme", + "content": "Readme", + "metadata": { + "name": "", + "tags": [], + "type": "", + "layer": "", + "links": [], + "owner": null, + "title": "Readme", + "doc_id": null, + "module": "", + "parent": null, + "status": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "81d952f1a6ea85b76f75e0e57f33b8fa4b2bf3cb7db11b91b90171aeedd655a6", + "children": [], + "doc_kind": "readme", + "entities": [], + "updated_at": null, + "doc_version": null, + "document_id": "docs/README.md", + "source_path": "docs/README.md", + "summary_text": "", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "HTTP API /actions/{action}", + "content": "Endpoint `/actions/{action}` управляет control actions runtime и поддерживает `start`, `stop` и `status`. Для долгих операций `start` и `stop` допускается ответ HTTP 202, если действие еще выполняется. Endpoint используется для operator-driven управления жизненным циклом worker'а через HTTP API.", + "metadata": { + "name": "control_actions_endpoint", + "tags": [ + "api", + "control-plane", + "lifecycle" + ], + "type": "api_method", + "layer": "application", + "links": [ + { + "type": "part_of", + "target": "architecture.telegram_notify_app" + }, + { + "type": "related_api", + "target": "api.health_endpoint" + }, + { + "type": "related_logic", + "target": "logic.telegram_notification_loop" + } + ], + "owner": null, + "title": "HTTP API /actions/{action}", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "architecture.telegram_notify_app", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "children": [], + "doc_kind": "misc", + "entities": [ + "TelegramControlChannel", + "ControlActionSet", + "JSONResponse" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "api.control_actions_endpoint", + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "summary_text": "Endpoint `/actions/{action}` управляет control actions runtime и поддерживает `start`, `stop` и `status`. Для долгих операций `start` и `stop` допускается ответ HTTP 202, если действие еще выполняется. Endpoint используется для operator-driven управления жизненным циклом worker'а через HTTP API.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/api/health-endpoint.md", + "title": "HTTP API /health", + "content": "Endpoint `/health` возвращает агрегированный health payload runtime. Если общий статус равен `ok`, API отвечает с HTTP 200; для состояний деградации или неготовности возвращается HTTP 503 с тем же payload. Endpoint служит основной точкой внешней проверки состояния приложения.", + "metadata": { + "name": "health_endpoint", + "tags": [ + "api", + "health", + "control-plane" + ], + "type": "api_method", + "layer": "application", + "links": [ + { + "type": "part_of", + "target": "architecture.telegram_notify_app" + }, + { + "type": "depends_on", + "target": "domain.runtime_health" + } + ], + "owner": null, + "title": "HTTP API /health", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "architecture.telegram_notify_app", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "8b5a533a8076e2e9d36995eee29aeade260080bdca2ec8e21fe28f08574b983f", + "children": [], + "doc_kind": "misc", + "entities": [ + "TelegramControlChannel", + "TelegramNotifyWorker", + "RuntimeManager", + "WorkerHealth" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "api.health_endpoint", + "source_path": "docs/documentation/api/health-endpoint.md", + "summary_text": "Endpoint `/health` возвращает агрегированный health payload runtime. Если общий статус равен `ok`, API отвечает с HTTP 200; для состояний деградации или неготовности возвращается HTTP 503 с тем же payload. Endpoint служит основной точкой внешней проверки состояния приложения.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/api/send-message-endpoint.md", + "title": "HTTP API /send", + "content": "Endpoint `/send` выполняет ручную отправку сообщения в Telegram через `TelegramSendService`. Он используется для операторской проверки доставки и для отправки уведомлений вне периодического worker loop. Endpoint работает поверх тех же credentials и того же delivery path, что и фоновая отправка.", + "metadata": { + "name": "send_message_endpoint", + "tags": [ + "api", + "telegram", + "manual-send" + ], + "type": "api_method", + "layer": "application", + "links": [ + { + "type": "part_of", + "target": "architecture.telegram_notify_app" + }, + { + "type": "depends_on", + "target": "logic.telegram_notification_loop" + } + ], + "owner": null, + "title": "HTTP API /send", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "architecture.telegram_notify_app", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "5fbf2e33510b0676a3a53b957a4569bd3c2c31fb7719546602c573421ccaa32d", + "children": [], + "doc_kind": "misc", + "entities": [ + "TelegramControlAppFactory", + "TelegramSendService", + "TelegramNotifyWorker" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "api.send_message_endpoint", + "source_path": "docs/documentation/api/send-message-endpoint.md", + "summary_text": "Endpoint `/send` выполняет ручную отправку сообщения в Telegram через `TelegramSendService`. Он используется для операторской проверки доставки и для отправки уведомлений вне периодического worker loop. Endpoint работает поверх тех же credentials и того же delivery path, что и фоновая отправка.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + } + ], + "facts": [], + "relations": [] +} +``` + +### User Prompt Overview +- question: Опиши статус воркера +- intent: GENERAL_QA +- sub_intent: GENERIC_QA +- documents: 4 | samples: Readme, HTTP API /actions/{action}, HTTP API /health +- facts: 0 +- relations: 0 + +## Mismatches +- sub_intent: expected ENTITY_EXPLAIN, got GENERIC_QA \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/docs_pre_llm_v3/20260326_121025/full_chain_docs_intents_v3-3x_v3-general-1.json b/tests/pipeline_setup_v3/test_results/docs_pre_llm_v3/20260326_121025/full_chain_docs_intents_v3-3x_v3-general-1.json new file mode 100644 index 0000000..66ae014 --- /dev/null +++ b/tests/pipeline_setup_v3/test_results/docs_pre_llm_v3/20260326_121025/full_chain_docs_intents_v3-3x_v3-general-1.json @@ -0,0 +1,92 @@ +{ + "meta": { + "case_id": "v3-general-1", + "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_03_docs/full_chain_docs_intents_v3-3x.yaml", + "runner": "agent_runtime", + "mode": "pre_llm", + "passed": false, + "mismatches": [ + "sub_intent: expected GENERIC_QA, got COMPONENT_EXPLAIN" + ], + "actual": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "COMPONENT_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START", + "rag_count": 19, + "llm_answer": "", + "answer_mode": "answered", + "path_scope": [], + "doc_scope": [ + "docs/README.md", + "api.control_actions_endpoint", + "api.actions_endpoint", + "api.health_endpoint", + "api.send_message_endpoint", + "architecture.telegram_notify_app", + "architecture.telegram_notify_app_overview", + "domain.runtime_health" + ], + "entity_candidates": [], + "symbol_candidates": [], + "layers": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "filters": { + "doc_type": null + }, + "pipeline_mode": "pre_llm_only", + "gate_decision": "allow", + "prompt_used": "docs_explain_answer", + "llm_mode": "prose", + "degraded_reason": null, + "code_intents_stubbed": true + } + }, + "pipeline_steps": [ + { + "step": "input_query", + "input": { + "query": "Что есть в документации?" + }, + "output": { + "query": "Что есть в документации?" + } + }, + { + "step": "router", + "input": { + "query": "Что есть в документации?" + }, + "output": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "COMPONENT_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START" + } + }, + { + "step": "docs_pipeline", + "input": { + "query": "Что есть в документации?" + }, + "output": { + "answer_mode": "ready", + "prompt_name": "docs_explain_answer", + "llm_request": { + "prompt_name": "docs_explain_answer", + "log_context": "graph.project_qa.docs.answer", + "prompt_stats": { + "system_chars": 393, + "user_chars": 19762, + "tokens_in_estimate": 5039 + } + }, + "degraded_reason": "" + } + } + ] +} \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/docs_pre_llm_v3/20260326_121025/full_chain_docs_intents_v3-3x_v3-general-1.md b/tests/pipeline_setup_v3/test_results/docs_pre_llm_v3/20260326_121025/full_chain_docs_intents_v3-3x_v3-general-1.md new file mode 100644 index 0000000..392eda0 --- /dev/null +++ b/tests/pipeline_setup_v3/test_results/docs_pre_llm_v3/20260326_121025/full_chain_docs_intents_v3-3x_v3-general-1.md @@ -0,0 +1,859 @@ +# v3-general-1 + +- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_03_docs/full_chain_docs_intents_v3-3x.yaml +- runner: agent_runtime +- mode: pre_llm +- passed: False + +## Query +Что есть в документации? + +## Actual +{ + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "COMPONENT_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START", + "rag_count": 19, + "llm_answer": "", + "answer_mode": "answered", + "path_scope": [], + "doc_scope": [ + "docs/README.md", + "api.control_actions_endpoint", + "api.actions_endpoint", + "api.health_endpoint", + "api.send_message_endpoint", + "architecture.telegram_notify_app", + "architecture.telegram_notify_app_overview", + "domain.runtime_health" + ], + "entity_candidates": [], + "symbol_candidates": [], + "layers": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "filters": { + "doc_type": null + }, + "pipeline_mode": "pre_llm_only", + "gate_decision": "allow", + "prompt_used": "docs_explain_answer", + "llm_mode": "prose", + "degraded_reason": null, + "code_intents_stubbed": true +} + +## Pipeline Steps +### input_query +```json +{ + "input": { + "query": "Что есть в документации?" + }, + "output": { + "query": "Что есть в документации?" + } +} +``` + +### router +```json +{ + "input": { + "query": "Что есть в документации?" + }, + "output": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "COMPONENT_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START" + } +} +``` + +### docs_pipeline +```json +{ + "input": { + "query": "Что есть в документации?" + }, + "output": { + "answer_mode": "ready", + "prompt_name": "docs_explain_answer", + "llm_request": { + "prompt_name": "docs_explain_answer", + "log_context": "graph.project_qa.docs.answer", + "prompt_stats": { + "system_chars": 393, + "user_chars": 19762, + "tokens_in_estimate": 5039 + } + }, + "degraded_reason": "" + } +} +``` + +## Diagnostics +{ + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "COMPONENT_EXPLAIN", + "layers_used": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "documents_found": 6, + "facts_found": 1, + "relations_found": 6, + "openapi_fields_extracted": 0, + "missing_required_fields": [], + "openapi_status": { + "has_path": false, + "has_method": false, + "has_request": false, + "has_response": false + }, + "prompt_used": "docs_explain_answer", + "llm_mode": "prose", + "output_valid": true, + "matched_intent_source": "deterministic", + "matched_anchor_type": "none", + "matched_anchor_value": null, + "exact_anchor_match": false, + "docs_layers_requested": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "docs_layers_with_hits": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "planned_layers": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "executed_layers": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "non_empty_layers": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "layer_diagnostics": { + "D1_DOCUMENT_CATALOG": { + "hits": 6, + "top_ids": [ + "docs/README.md", + "api.control_actions_endpoint", + "api.health_endpoint", + "api.send_message_endpoint", + "architecture.telegram_notify_app" + ] + }, + "D2_FACT_INDEX": { + "hits": 8, + "top_ids": [ + "2f539384881f5f776bf4cef22c00669e53e0fd0761b3d62fa53593254a272f5a", + "5a27c821aa4efea9f2a7c883b57d1f53ec3af31348abd220bc09f47fbca73e93", + "0102eac8e4f8b452b0351a4aa8dca63e4774beadac71eba483708d7a90ff1cc0", + "43fc2c29bf6f353fa55f1b8a05c903dbd1a0e8067b026b9455043669ceca37d9", + "a31bbca2eb31ffb6655bcec7ff07b8cf2b6c7416610cf58dfc1e0c737df12fe1" + ] + }, + "D5_RELATION_GRAPH": { + "hits": 6, + "top_ids": [ + "5f4909bde905cd3d294ad307074a05e4ae4deefcafe6272cd2d0436e73acb8dd", + "711fb2edb82dd222deaba3c91768b18cbbd453009235823282813c6e867dc2c1", + "eec79f7a02b804337e791ef231784862ae26e0599eb20224790e9d4f085fa9c0", + "c718b1939621233295ccaf6e8203e7fd94f3dd1bfb88f10c51bc5e33d53a24aa", + "616f5cbf25da83cb51d8d0741a7fc351620c9ca2c6513fa2094b4aa476f0912a" + ] + }, + "D0_DOC_CHUNKS": { + "hits": 6, + "top_ids": [ + "docs/README.md", + "api.control_actions_endpoint" + ] + } + }, + "query_entity_candidates": [], + "resolved_entity_candidates": [], + "query_anchor_candidates": [], + "resolved_anchor_candidates": [ + "docs/README.md", + "api.control_actions_endpoint", + "docs/documentation/api/control-actions-endpoint.md", + "api.health_endpoint", + "docs/documentation/api/health-endpoint.md", + "api.send_message_endpoint", + "docs/documentation/api/send-message-endpoint.md", + "architecture.telegram_notify_app", + "docs/documentation/architecture/telegram-notify-app-overview.md", + "domain.runtime_health", + "docs/documentation/domain/runtime-health-entity.md" + ], + "anchor_candidates": [], + "selected_anchor": null, + "anchor_selection_reason": "", + "anchor_match_type": "", + "doc_ids": [ + "docs/README.md", + "api.control_actions_endpoint", + "api.actions_endpoint", + "api.health_endpoint", + "api.send_message_endpoint", + "architecture.telegram_notify_app", + "architecture.telegram_notify_app_overview", + "domain.runtime_health" + ], + "doc_paths": [ + "docs/README.md", + "docs/documentation/api/control-actions-endpoint.md", + "docs/documentation/api/health-endpoint.md", + "docs/documentation/api/send-message-endpoint.md", + "docs/documentation/architecture/telegram-notify-app-overview.md", + "docs/documentation/domain/runtime-health-entity.md" + ], + "doc_titles": [ + "Readme", + "HTTP API /actions/{action}", + "HTTP API /health", + "HTTP API /send", + "Архитектура Telegram Notify App", + "Сущность runtime health", + "docs/README.md:doc_list_item", + "api.control_actions_endpoint:part_of", + "api.control_actions_endpoint:related_api", + "api.control_actions_endpoint:related_logic", + "api.health_endpoint:parent", + "api.health_endpoint:part_of", + "api.control_actions_endpoint:parent", + "docs/README.md:Структура", + "docs/README.md:Навигация", + "docs/README.md:Правила и шаблоны", + "api.control_actions_endpoint:Summary", + "api.control_actions_endpoint:Описание", + "docs/README.md:Project Docs" + ], + "relation_hits_count": 6, + "relation_targets": [ + "api.control_actions_endpoint:part_of", + "api.control_actions_endpoint:related_api", + "api.control_actions_endpoint:related_logic", + "api.health_endpoint:parent", + "api.health_endpoint:part_of", + "api.control_actions_endpoint:parent" + ], + "fallback_doc_hits_count": 12, + "fallback_used": false, + "fact_hits": 1, + "entity_hits": 0, + "evidence_summary": { + "documents": 6, + "facts": 1, + "relations": 6, + "chunks": 6, + "entity_hits": 0, + "openapi_signals": { + "path_found": false, + "method_found": false, + "request_schema": false, + "response_schema": false, + "status_codes": false, + "payload_description": false + } + }, + "gate_decision": "allow", + "gate_decision_reason": "evidence_sufficient", + "gate_missing_requirements": [], + "gate_satisfied_requirements": [ + "retrieval_non_empty" + ], + "openapi_evidence": { + "path_found": false, + "method_found": false, + "request_schema": false, + "response_schema": false, + "status_codes": false, + "payload_description": false + }, + "requested_fragment_type": null, + "fragment_evidence_found": [], + "fragment_missing_requirements": [], + "answer_mode": "ready", + "degrade_reason": null, + "degraded_reason": null, + "code_intents_stubbed": false +} + +## LLM Request +- prompt_name: docs_explain_answer +- log_context: graph.project_qa.docs.answer + +### Prompt Stats +```json +{ + "system_chars": 393, + "user_chars": 19762, + "tokens_in_estimate": 5039 +} +``` + +### System Prompt +```text +Ты объясняешь документацию системы. + +На вход приходит JSON с полями: +- question +- intent +- sub_intent +- documents +- facts +- relations + +Правила: +- Используй только предоставленные факты +- Не додумывай +- Если данных недостаточно, скажи это явно +- Объясняй структурировано + +Формат ответа: +1. Краткое описание +2. Основные элементы +3. Как это работает +4. Связи с другими частями системы (если есть) +``` + +### User Prompt +```json +{ + "question": "Что есть в документации?", + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "COMPONENT_EXPLAIN", + "documents": [ + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/README.md", + "title": "Readme", + "content": "Readme", + "metadata": { + "name": "", + "tags": [], + "type": "", + "layer": "", + "links": [], + "owner": null, + "title": "Readme", + "doc_id": null, + "module": "", + "parent": null, + "status": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "81d952f1a6ea85b76f75e0e57f33b8fa4b2bf3cb7db11b91b90171aeedd655a6", + "children": [], + "doc_kind": "readme", + "entities": [], + "updated_at": null, + "doc_version": null, + "document_id": "docs/README.md", + "source_path": "docs/README.md", + "summary_text": "", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "HTTP API /actions/{action}", + "content": "Endpoint `/actions/{action}` управляет control actions runtime и поддерживает `start`, `stop` и `status`. Для долгих операций `start` и `stop` допускается ответ HTTP 202, если действие еще выполняется. Endpoint используется для operator-driven управления жизненным циклом worker'а через HTTP API.", + "metadata": { + "name": "control_actions_endpoint", + "tags": [ + "api", + "control-plane", + "lifecycle" + ], + "type": "api_method", + "layer": "application", + "links": [ + { + "type": "part_of", + "target": "architecture.telegram_notify_app" + }, + { + "type": "related_api", + "target": "api.health_endpoint" + }, + { + "type": "related_logic", + "target": "logic.telegram_notification_loop" + } + ], + "owner": null, + "title": "HTTP API /actions/{action}", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "architecture.telegram_notify_app", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "children": [], + "doc_kind": "misc", + "entities": [ + "TelegramControlChannel", + "ControlActionSet", + "JSONResponse" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "api.control_actions_endpoint", + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "summary_text": "Endpoint `/actions/{action}` управляет control actions runtime и поддерживает `start`, `stop` и `status`. Для долгих операций `start` и `stop` допускается ответ HTTP 202, если действие еще выполняется. Endpoint используется для operator-driven управления жизненным циклом worker'а через HTTP API.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/api/health-endpoint.md", + "title": "HTTP API /health", + "content": "Endpoint `/health` возвращает агрегированный health payload runtime. Если общий статус равен `ok`, API отвечает с HTTP 200; для состояний деградации или неготовности возвращается HTTP 503 с тем же payload. Endpoint служит основной точкой внешней проверки состояния приложения.", + "metadata": { + "name": "health_endpoint", + "tags": [ + "api", + "health", + "control-plane" + ], + "type": "api_method", + "layer": "application", + "links": [ + { + "type": "part_of", + "target": "architecture.telegram_notify_app" + }, + { + "type": "depends_on", + "target": "domain.runtime_health" + } + ], + "owner": null, + "title": "HTTP API /health", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "architecture.telegram_notify_app", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "8b5a533a8076e2e9d36995eee29aeade260080bdca2ec8e21fe28f08574b983f", + "children": [], + "doc_kind": "misc", + "entities": [ + "TelegramControlChannel", + "TelegramNotifyWorker", + "RuntimeManager", + "WorkerHealth" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "api.health_endpoint", + "source_path": "docs/documentation/api/health-endpoint.md", + "summary_text": "Endpoint `/health` возвращает агрегированный health payload runtime. Если общий статус равен `ok`, API отвечает с HTTP 200; для состояний деградации или неготовности возвращается HTTP 503 с тем же payload. Endpoint служит основной точкой внешней проверки состояния приложения.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/api/send-message-endpoint.md", + "title": "HTTP API /send", + "content": "Endpoint `/send` выполняет ручную отправку сообщения в Telegram через `TelegramSendService`. Он используется для операторской проверки доставки и для отправки уведомлений вне периодического worker loop. Endpoint работает поверх тех же credentials и того же delivery path, что и фоновая отправка.", + "metadata": { + "name": "send_message_endpoint", + "tags": [ + "api", + "telegram", + "manual-send" + ], + "type": "api_method", + "layer": "application", + "links": [ + { + "type": "part_of", + "target": "architecture.telegram_notify_app" + }, + { + "type": "depends_on", + "target": "logic.telegram_notification_loop" + } + ], + "owner": null, + "title": "HTTP API /send", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "architecture.telegram_notify_app", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "5fbf2e33510b0676a3a53b957a4569bd3c2c31fb7719546602c573421ccaa32d", + "children": [], + "doc_kind": "misc", + "entities": [ + "TelegramControlAppFactory", + "TelegramSendService", + "TelegramNotifyWorker" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "api.send_message_endpoint", + "source_path": "docs/documentation/api/send-message-endpoint.md", + "summary_text": "Endpoint `/send` выполняет ручную отправку сообщения в Telegram через `TelegramSendService`. Он используется для операторской проверки доставки и для отправки уведомлений вне периодического worker loop. Endpoint работает поверх тех же credentials и того же delivery path, что и фоновая отправка.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/architecture/telegram-notify-app-overview.md", + "title": "Архитектура Telegram Notify App", + "content": "`test_echo_app` — сервис на базе PLBA runtime, который поднимает HTTP control plane и запускает фоновый воркер для периодической отправки уведомлений в Telegram. Приложение использует YAML-конфиг для runtime-настроек и переменные окружения для Telegram credentials. Основной контур системы состоит из runtime manager, control channel, send service и worker loop.", + "metadata": { + "name": "telegram_notify_app_overview", + "tags": [ + "architecture", + "telegram", + "plba", + "runtime" + ], + "type": "architecture_overview", + "layer": "system", + "links": [ + { + "type": "related_api", + "target": "api.health_endpoint" + }, + { + "type": "related_api", + "target": "api.control_actions_endpoint" + }, + { + "type": "related_api", + "target": "api.send_message_endpoint" + }, + { + "type": "depends_on", + "target": "logic.telegram_notification_loop" + }, + { + "type": "depends_on", + "target": "domain.runtime_health" + } + ], + "owner": null, + "title": "Архитектура Telegram Notify App", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "docs_root", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "8b1cc9f823e55bddbc825466d10a0fdb4ca4354ac02d91f9e2aef7b7d2ec8256", + "children": [ + "api.health_endpoint", + "api.control_actions_endpoint", + "api.send_message_endpoint", + "logic.telegram_notification_loop", + "domain.runtime_health" + ], + "doc_kind": "spec", + "entities": [ + "TelegramNotifyModule", + "TelegramNotifyWorker", + "TelegramControlChannel", + "TelegramSendService", + "RuntimeManager" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "architecture.telegram_notify_app", + "source_path": "docs/documentation/architecture/telegram-notify-app-overview.md", + "summary_text": "`test_echo_app` — сервис на базе PLBA runtime, который поднимает HTTP control plane и запускает фоновый воркер для периодической отправки уведомлений в Telegram. Приложение использует YAML-конфиг для runtime-настроек и переменные окружения для Telegram credentials. Основной контур системы состоит из runtime manager, control channel, send service и worker loop.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/domain/runtime-health-entity.md", + "title": "Сущность runtime health", + "content": "`runtime health` — доменная модель наблюдаемости сервиса, которая описывает общее состояние runtime и состояние отдельных компонентов. Для `test_echo_app` главным объектом наблюдения является компонент `telegram_notify`, у которого важны статус, время старта и количество успешных отправок. Эта модель используется для внешнего health-monitoring и внутренней диагностики.", + "metadata": { + "name": "runtime_health", + "tags": [ + "domain", + "health", + "observability" + ], + "type": "domain_entity", + "layer": "domain", + "links": [ + { + "type": "part_of", + "target": "architecture.telegram_notify_app" + }, + { + "type": "used_by", + "target": "api.health_endpoint" + }, + { + "type": "related_logic", + "target": "logic.telegram_notification_loop" + } + ], + "owner": null, + "title": "Сущность runtime health", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "architecture.telegram_notify_app", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "37d4dcf470ea3de95d59e44786006e369a3ea11bf5dbf4c88877696e9183ee87", + "children": [], + "doc_kind": "misc", + "entities": [ + "WorkerHealth", + "WorkerStatus", + "TelegramNotifyWorker" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "domain.runtime_health", + "source_path": "docs/documentation/domain/runtime-health-entity.md", + "summary_text": "`runtime health` — доменная модель наблюдаемости сервиса, которая описывает общее состояние runtime и состояние отдельных компонентов. Для `test_echo_app` главным объектом наблюдения является компонент `telegram_notify`, у которого важны статус, время старта и количество успешных отправок. Эта модель используется для внешнего health-monitoring и внутренней диагностики.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + } + ], + "facts": [ + { + "layer": "D2_FACT_INDEX", + "path": "docs/README.md", + "title": "docs/README.md:doc_list_item", + "content": "docs/README.md doc_list_item `documentation/api/` — документация HTTP API control plane.", + "metadata": { + "tags": [], + "owner": null, + "anchor": "Структура", + "doc_id": null, + "object": "`documentation/api/` — документация HTTP API control plane.", + "fact_id": "2f539384881f5f776bf4cef22c00669e53e0fd0761b3d62fa53593254a272f5a", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "81d952f1a6ea85b76f75e0e57f33b8fa4b2bf3cb7db11b91b90171aeedd655a6", + "predicate": "doc_list_item", + "object_ref": null, + "subject_id": "docs/README.md", + "doc_version": null, + "source_path": "docs/README.md", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + } + ], + "relations": [ + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "api.control_actions_endpoint:part_of", + "content": "api.control_actions_endpoint part_of architecture.telegram_notify_app", + "metadata": { + "owner": null, + "anchor": "frontmatter.links", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "source_id": "api.control_actions_endpoint", + "target_id": "architecture.telegram_notify_app", + "doc_version": null, + "relation_id": "5f4909bde905cd3d294ad307074a05e4ae4deefcafe6272cd2d0436e73acb8dd", + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "part_of", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "api.control_actions_endpoint:related_api", + "content": "api.control_actions_endpoint related_api api.health_endpoint", + "metadata": { + "owner": null, + "anchor": "frontmatter.links", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "source_id": "api.control_actions_endpoint", + "target_id": "api.health_endpoint", + "doc_version": null, + "relation_id": "711fb2edb82dd222deaba3c91768b18cbbd453009235823282813c6e867dc2c1", + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "related_api", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "api.control_actions_endpoint:related_logic", + "content": "api.control_actions_endpoint related_logic logic.telegram_notification_loop", + "metadata": { + "owner": null, + "anchor": "frontmatter.links", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "source_id": "api.control_actions_endpoint", + "target_id": "logic.telegram_notification_loop", + "doc_version": null, + "relation_id": "eec79f7a02b804337e791ef231784862ae26e0599eb20224790e9d4f085fa9c0", + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "related_logic", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/api/health-endpoint.md", + "title": "api.health_endpoint:parent", + "content": "api.health_endpoint parent architecture.telegram_notify_app", + "metadata": { + "owner": null, + "anchor": "frontmatter.parent", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "8b5a533a8076e2e9d36995eee29aeade260080bdca2ec8e21fe28f08574b983f", + "source_id": "api.health_endpoint", + "target_id": "architecture.telegram_notify_app", + "doc_version": null, + "relation_id": "c718b1939621233295ccaf6e8203e7fd94f3dd1bfb88f10c51bc5e33d53a24aa", + "source_path": "docs/documentation/api/health-endpoint.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "parent", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/api/health-endpoint.md", + "title": "api.health_endpoint:part_of", + "content": "api.health_endpoint part_of architecture.telegram_notify_app", + "metadata": { + "owner": null, + "anchor": "frontmatter.links", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "8b5a533a8076e2e9d36995eee29aeade260080bdca2ec8e21fe28f08574b983f", + "source_id": "api.health_endpoint", + "target_id": "architecture.telegram_notify_app", + "doc_version": null, + "relation_id": "616f5cbf25da83cb51d8d0741a7fc351620c9ca2c6513fa2094b4aa476f0912a", + "source_path": "docs/documentation/api/health-endpoint.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "part_of", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "api.control_actions_endpoint:parent", + "content": "api.control_actions_endpoint parent architecture.telegram_notify_app", + "metadata": { + "owner": null, + "anchor": "frontmatter.parent", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "source_id": "api.control_actions_endpoint", + "target_id": "architecture.telegram_notify_app", + "doc_version": null, + "relation_id": "afec31fd062e392dcd9699a92c7ab61fd4b1273c1a2b16702b23d55d8d0c47ac", + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "parent", + "staleness_score": null, + "system_component": null + } + } + ] +} +``` + +### User Prompt Overview +- question: Что есть в документации? +- intent: DOCUMENTATION_EXPLAIN +- sub_intent: COMPONENT_EXPLAIN +- documents: 6 | samples: Readme, HTTP API /actions/{action}, HTTP API /health +- facts: 1 | samples: docs/README.md:doc_list_item +- relations: 6 | samples: api.control_actions_endpoint:part_of, api.control_actions_endpoint:related_api, api.control_actions_endpoint:related_logic + +## Mismatches +- sub_intent: expected GENERIC_QA, got COMPONENT_EXPLAIN \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/docs_pre_llm_v3/20260326_121025/full_chain_docs_intents_v3-3x_v3-general-2.json b/tests/pipeline_setup_v3/test_results/docs_pre_llm_v3/20260326_121025/full_chain_docs_intents_v3-3x_v3-general-2.json new file mode 100644 index 0000000..fdcb83c --- /dev/null +++ b/tests/pipeline_setup_v3/test_results/docs_pre_llm_v3/20260326_121025/full_chain_docs_intents_v3-3x_v3-general-2.json @@ -0,0 +1,92 @@ +{ + "meta": { + "case_id": "v3-general-2", + "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_03_docs/full_chain_docs_intents_v3-3x.yaml", + "runner": "agent_runtime", + "mode": "pre_llm", + "passed": false, + "mismatches": [ + "sub_intent: expected GENERIC_QA, got COMPONENT_EXPLAIN" + ], + "actual": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "COMPONENT_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START", + "rag_count": 19, + "llm_answer": "", + "answer_mode": "answered", + "path_scope": [], + "doc_scope": [ + "docs/README.md", + "api.control_actions_endpoint", + "api.actions_endpoint", + "api.health_endpoint", + "api.send_message_endpoint", + "architecture.telegram_notify_app", + "architecture.telegram_notify_app_overview", + "domain.runtime_health" + ], + "entity_candidates": [], + "symbol_candidates": [], + "layers": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "filters": { + "doc_type": null + }, + "pipeline_mode": "pre_llm_only", + "gate_decision": "allow", + "prompt_used": "docs_explain_answer", + "llm_mode": "prose", + "degraded_reason": null, + "code_intents_stubbed": true + } + }, + "pipeline_steps": [ + { + "step": "input_query", + "input": { + "query": "Какая структура документации?" + }, + "output": { + "query": "Какая структура документации?" + } + }, + { + "step": "router", + "input": { + "query": "Какая структура документации?" + }, + "output": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "COMPONENT_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START" + } + }, + { + "step": "docs_pipeline", + "input": { + "query": "Какая структура документации?" + }, + "output": { + "answer_mode": "ready", + "prompt_name": "docs_explain_answer", + "llm_request": { + "prompt_name": "docs_explain_answer", + "log_context": "graph.project_qa.docs.answer", + "prompt_stats": { + "system_chars": 393, + "user_chars": 19767, + "tokens_in_estimate": 5040 + } + }, + "degraded_reason": "" + } + } + ] +} \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/docs_pre_llm_v3/20260326_121025/full_chain_docs_intents_v3-3x_v3-general-2.md b/tests/pipeline_setup_v3/test_results/docs_pre_llm_v3/20260326_121025/full_chain_docs_intents_v3-3x_v3-general-2.md new file mode 100644 index 0000000..7e701ad --- /dev/null +++ b/tests/pipeline_setup_v3/test_results/docs_pre_llm_v3/20260326_121025/full_chain_docs_intents_v3-3x_v3-general-2.md @@ -0,0 +1,859 @@ +# v3-general-2 + +- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_03_docs/full_chain_docs_intents_v3-3x.yaml +- runner: agent_runtime +- mode: pre_llm +- passed: False + +## Query +Какая структура документации? + +## Actual +{ + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "COMPONENT_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START", + "rag_count": 19, + "llm_answer": "", + "answer_mode": "answered", + "path_scope": [], + "doc_scope": [ + "docs/README.md", + "api.control_actions_endpoint", + "api.actions_endpoint", + "api.health_endpoint", + "api.send_message_endpoint", + "architecture.telegram_notify_app", + "architecture.telegram_notify_app_overview", + "domain.runtime_health" + ], + "entity_candidates": [], + "symbol_candidates": [], + "layers": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "filters": { + "doc_type": null + }, + "pipeline_mode": "pre_llm_only", + "gate_decision": "allow", + "prompt_used": "docs_explain_answer", + "llm_mode": "prose", + "degraded_reason": null, + "code_intents_stubbed": true +} + +## Pipeline Steps +### input_query +```json +{ + "input": { + "query": "Какая структура документации?" + }, + "output": { + "query": "Какая структура документации?" + } +} +``` + +### router +```json +{ + "input": { + "query": "Какая структура документации?" + }, + "output": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "COMPONENT_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START" + } +} +``` + +### docs_pipeline +```json +{ + "input": { + "query": "Какая структура документации?" + }, + "output": { + "answer_mode": "ready", + "prompt_name": "docs_explain_answer", + "llm_request": { + "prompt_name": "docs_explain_answer", + "log_context": "graph.project_qa.docs.answer", + "prompt_stats": { + "system_chars": 393, + "user_chars": 19767, + "tokens_in_estimate": 5040 + } + }, + "degraded_reason": "" + } +} +``` + +## Diagnostics +{ + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "COMPONENT_EXPLAIN", + "layers_used": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "documents_found": 6, + "facts_found": 1, + "relations_found": 6, + "openapi_fields_extracted": 0, + "missing_required_fields": [], + "openapi_status": { + "has_path": false, + "has_method": false, + "has_request": false, + "has_response": false + }, + "prompt_used": "docs_explain_answer", + "llm_mode": "prose", + "output_valid": true, + "matched_intent_source": "deterministic", + "matched_anchor_type": "none", + "matched_anchor_value": null, + "exact_anchor_match": false, + "docs_layers_requested": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "docs_layers_with_hits": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "planned_layers": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "executed_layers": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "non_empty_layers": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "layer_diagnostics": { + "D1_DOCUMENT_CATALOG": { + "hits": 6, + "top_ids": [ + "docs/README.md", + "api.control_actions_endpoint", + "api.health_endpoint", + "api.send_message_endpoint", + "architecture.telegram_notify_app" + ] + }, + "D2_FACT_INDEX": { + "hits": 8, + "top_ids": [ + "2f539384881f5f776bf4cef22c00669e53e0fd0761b3d62fa53593254a272f5a", + "5a27c821aa4efea9f2a7c883b57d1f53ec3af31348abd220bc09f47fbca73e93", + "0102eac8e4f8b452b0351a4aa8dca63e4774beadac71eba483708d7a90ff1cc0", + "43fc2c29bf6f353fa55f1b8a05c903dbd1a0e8067b026b9455043669ceca37d9", + "a31bbca2eb31ffb6655bcec7ff07b8cf2b6c7416610cf58dfc1e0c737df12fe1" + ] + }, + "D5_RELATION_GRAPH": { + "hits": 6, + "top_ids": [ + "5f4909bde905cd3d294ad307074a05e4ae4deefcafe6272cd2d0436e73acb8dd", + "711fb2edb82dd222deaba3c91768b18cbbd453009235823282813c6e867dc2c1", + "eec79f7a02b804337e791ef231784862ae26e0599eb20224790e9d4f085fa9c0", + "c718b1939621233295ccaf6e8203e7fd94f3dd1bfb88f10c51bc5e33d53a24aa", + "616f5cbf25da83cb51d8d0741a7fc351620c9ca2c6513fa2094b4aa476f0912a" + ] + }, + "D0_DOC_CHUNKS": { + "hits": 6, + "top_ids": [ + "docs/README.md", + "api.control_actions_endpoint" + ] + } + }, + "query_entity_candidates": [], + "resolved_entity_candidates": [], + "query_anchor_candidates": [], + "resolved_anchor_candidates": [ + "docs/README.md", + "api.control_actions_endpoint", + "docs/documentation/api/control-actions-endpoint.md", + "api.health_endpoint", + "docs/documentation/api/health-endpoint.md", + "api.send_message_endpoint", + "docs/documentation/api/send-message-endpoint.md", + "architecture.telegram_notify_app", + "docs/documentation/architecture/telegram-notify-app-overview.md", + "domain.runtime_health", + "docs/documentation/domain/runtime-health-entity.md" + ], + "anchor_candidates": [], + "selected_anchor": null, + "anchor_selection_reason": "", + "anchor_match_type": "", + "doc_ids": [ + "docs/README.md", + "api.control_actions_endpoint", + "api.actions_endpoint", + "api.health_endpoint", + "api.send_message_endpoint", + "architecture.telegram_notify_app", + "architecture.telegram_notify_app_overview", + "domain.runtime_health" + ], + "doc_paths": [ + "docs/README.md", + "docs/documentation/api/control-actions-endpoint.md", + "docs/documentation/api/health-endpoint.md", + "docs/documentation/api/send-message-endpoint.md", + "docs/documentation/architecture/telegram-notify-app-overview.md", + "docs/documentation/domain/runtime-health-entity.md" + ], + "doc_titles": [ + "Readme", + "HTTP API /actions/{action}", + "HTTP API /health", + "HTTP API /send", + "Архитектура Telegram Notify App", + "Сущность runtime health", + "docs/README.md:doc_list_item", + "api.control_actions_endpoint:part_of", + "api.control_actions_endpoint:related_api", + "api.control_actions_endpoint:related_logic", + "api.health_endpoint:parent", + "api.health_endpoint:part_of", + "api.control_actions_endpoint:parent", + "docs/README.md:Структура", + "docs/README.md:Навигация", + "docs/README.md:Правила и шаблоны", + "api.control_actions_endpoint:Summary", + "api.control_actions_endpoint:Описание", + "docs/README.md:Project Docs" + ], + "relation_hits_count": 6, + "relation_targets": [ + "api.control_actions_endpoint:part_of", + "api.control_actions_endpoint:related_api", + "api.control_actions_endpoint:related_logic", + "api.health_endpoint:parent", + "api.health_endpoint:part_of", + "api.control_actions_endpoint:parent" + ], + "fallback_doc_hits_count": 12, + "fallback_used": false, + "fact_hits": 1, + "entity_hits": 0, + "evidence_summary": { + "documents": 6, + "facts": 1, + "relations": 6, + "chunks": 6, + "entity_hits": 0, + "openapi_signals": { + "path_found": false, + "method_found": false, + "request_schema": false, + "response_schema": false, + "status_codes": false, + "payload_description": false + } + }, + "gate_decision": "allow", + "gate_decision_reason": "evidence_sufficient", + "gate_missing_requirements": [], + "gate_satisfied_requirements": [ + "retrieval_non_empty" + ], + "openapi_evidence": { + "path_found": false, + "method_found": false, + "request_schema": false, + "response_schema": false, + "status_codes": false, + "payload_description": false + }, + "requested_fragment_type": null, + "fragment_evidence_found": [], + "fragment_missing_requirements": [], + "answer_mode": "ready", + "degrade_reason": null, + "degraded_reason": null, + "code_intents_stubbed": false +} + +## LLM Request +- prompt_name: docs_explain_answer +- log_context: graph.project_qa.docs.answer + +### Prompt Stats +```json +{ + "system_chars": 393, + "user_chars": 19767, + "tokens_in_estimate": 5040 +} +``` + +### System Prompt +```text +Ты объясняешь документацию системы. + +На вход приходит JSON с полями: +- question +- intent +- sub_intent +- documents +- facts +- relations + +Правила: +- Используй только предоставленные факты +- Не додумывай +- Если данных недостаточно, скажи это явно +- Объясняй структурировано + +Формат ответа: +1. Краткое описание +2. Основные элементы +3. Как это работает +4. Связи с другими частями системы (если есть) +``` + +### User Prompt +```json +{ + "question": "Какая структура документации?", + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "COMPONENT_EXPLAIN", + "documents": [ + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/README.md", + "title": "Readme", + "content": "Readme", + "metadata": { + "name": "", + "tags": [], + "type": "", + "layer": "", + "links": [], + "owner": null, + "title": "Readme", + "doc_id": null, + "module": "", + "parent": null, + "status": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "81d952f1a6ea85b76f75e0e57f33b8fa4b2bf3cb7db11b91b90171aeedd655a6", + "children": [], + "doc_kind": "readme", + "entities": [], + "updated_at": null, + "doc_version": null, + "document_id": "docs/README.md", + "source_path": "docs/README.md", + "summary_text": "", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "HTTP API /actions/{action}", + "content": "Endpoint `/actions/{action}` управляет control actions runtime и поддерживает `start`, `stop` и `status`. Для долгих операций `start` и `stop` допускается ответ HTTP 202, если действие еще выполняется. Endpoint используется для operator-driven управления жизненным циклом worker'а через HTTP API.", + "metadata": { + "name": "control_actions_endpoint", + "tags": [ + "api", + "control-plane", + "lifecycle" + ], + "type": "api_method", + "layer": "application", + "links": [ + { + "type": "part_of", + "target": "architecture.telegram_notify_app" + }, + { + "type": "related_api", + "target": "api.health_endpoint" + }, + { + "type": "related_logic", + "target": "logic.telegram_notification_loop" + } + ], + "owner": null, + "title": "HTTP API /actions/{action}", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "architecture.telegram_notify_app", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "children": [], + "doc_kind": "misc", + "entities": [ + "TelegramControlChannel", + "ControlActionSet", + "JSONResponse" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "api.control_actions_endpoint", + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "summary_text": "Endpoint `/actions/{action}` управляет control actions runtime и поддерживает `start`, `stop` и `status`. Для долгих операций `start` и `stop` допускается ответ HTTP 202, если действие еще выполняется. Endpoint используется для operator-driven управления жизненным циклом worker'а через HTTP API.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/api/health-endpoint.md", + "title": "HTTP API /health", + "content": "Endpoint `/health` возвращает агрегированный health payload runtime. Если общий статус равен `ok`, API отвечает с HTTP 200; для состояний деградации или неготовности возвращается HTTP 503 с тем же payload. Endpoint служит основной точкой внешней проверки состояния приложения.", + "metadata": { + "name": "health_endpoint", + "tags": [ + "api", + "health", + "control-plane" + ], + "type": "api_method", + "layer": "application", + "links": [ + { + "type": "part_of", + "target": "architecture.telegram_notify_app" + }, + { + "type": "depends_on", + "target": "domain.runtime_health" + } + ], + "owner": null, + "title": "HTTP API /health", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "architecture.telegram_notify_app", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "8b5a533a8076e2e9d36995eee29aeade260080bdca2ec8e21fe28f08574b983f", + "children": [], + "doc_kind": "misc", + "entities": [ + "TelegramControlChannel", + "TelegramNotifyWorker", + "RuntimeManager", + "WorkerHealth" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "api.health_endpoint", + "source_path": "docs/documentation/api/health-endpoint.md", + "summary_text": "Endpoint `/health` возвращает агрегированный health payload runtime. Если общий статус равен `ok`, API отвечает с HTTP 200; для состояний деградации или неготовности возвращается HTTP 503 с тем же payload. Endpoint служит основной точкой внешней проверки состояния приложения.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/api/send-message-endpoint.md", + "title": "HTTP API /send", + "content": "Endpoint `/send` выполняет ручную отправку сообщения в Telegram через `TelegramSendService`. Он используется для операторской проверки доставки и для отправки уведомлений вне периодического worker loop. Endpoint работает поверх тех же credentials и того же delivery path, что и фоновая отправка.", + "metadata": { + "name": "send_message_endpoint", + "tags": [ + "api", + "telegram", + "manual-send" + ], + "type": "api_method", + "layer": "application", + "links": [ + { + "type": "part_of", + "target": "architecture.telegram_notify_app" + }, + { + "type": "depends_on", + "target": "logic.telegram_notification_loop" + } + ], + "owner": null, + "title": "HTTP API /send", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "architecture.telegram_notify_app", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "5fbf2e33510b0676a3a53b957a4569bd3c2c31fb7719546602c573421ccaa32d", + "children": [], + "doc_kind": "misc", + "entities": [ + "TelegramControlAppFactory", + "TelegramSendService", + "TelegramNotifyWorker" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "api.send_message_endpoint", + "source_path": "docs/documentation/api/send-message-endpoint.md", + "summary_text": "Endpoint `/send` выполняет ручную отправку сообщения в Telegram через `TelegramSendService`. Он используется для операторской проверки доставки и для отправки уведомлений вне периодического worker loop. Endpoint работает поверх тех же credentials и того же delivery path, что и фоновая отправка.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/architecture/telegram-notify-app-overview.md", + "title": "Архитектура Telegram Notify App", + "content": "`test_echo_app` — сервис на базе PLBA runtime, который поднимает HTTP control plane и запускает фоновый воркер для периодической отправки уведомлений в Telegram. Приложение использует YAML-конфиг для runtime-настроек и переменные окружения для Telegram credentials. Основной контур системы состоит из runtime manager, control channel, send service и worker loop.", + "metadata": { + "name": "telegram_notify_app_overview", + "tags": [ + "architecture", + "telegram", + "plba", + "runtime" + ], + "type": "architecture_overview", + "layer": "system", + "links": [ + { + "type": "related_api", + "target": "api.health_endpoint" + }, + { + "type": "related_api", + "target": "api.control_actions_endpoint" + }, + { + "type": "related_api", + "target": "api.send_message_endpoint" + }, + { + "type": "depends_on", + "target": "logic.telegram_notification_loop" + }, + { + "type": "depends_on", + "target": "domain.runtime_health" + } + ], + "owner": null, + "title": "Архитектура Telegram Notify App", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "docs_root", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "8b1cc9f823e55bddbc825466d10a0fdb4ca4354ac02d91f9e2aef7b7d2ec8256", + "children": [ + "api.health_endpoint", + "api.control_actions_endpoint", + "api.send_message_endpoint", + "logic.telegram_notification_loop", + "domain.runtime_health" + ], + "doc_kind": "spec", + "entities": [ + "TelegramNotifyModule", + "TelegramNotifyWorker", + "TelegramControlChannel", + "TelegramSendService", + "RuntimeManager" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "architecture.telegram_notify_app", + "source_path": "docs/documentation/architecture/telegram-notify-app-overview.md", + "summary_text": "`test_echo_app` — сервис на базе PLBA runtime, который поднимает HTTP control plane и запускает фоновый воркер для периодической отправки уведомлений в Telegram. Приложение использует YAML-конфиг для runtime-настроек и переменные окружения для Telegram credentials. Основной контур системы состоит из runtime manager, control channel, send service и worker loop.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/domain/runtime-health-entity.md", + "title": "Сущность runtime health", + "content": "`runtime health` — доменная модель наблюдаемости сервиса, которая описывает общее состояние runtime и состояние отдельных компонентов. Для `test_echo_app` главным объектом наблюдения является компонент `telegram_notify`, у которого важны статус, время старта и количество успешных отправок. Эта модель используется для внешнего health-monitoring и внутренней диагностики.", + "metadata": { + "name": "runtime_health", + "tags": [ + "domain", + "health", + "observability" + ], + "type": "domain_entity", + "layer": "domain", + "links": [ + { + "type": "part_of", + "target": "architecture.telegram_notify_app" + }, + { + "type": "used_by", + "target": "api.health_endpoint" + }, + { + "type": "related_logic", + "target": "logic.telegram_notification_loop" + } + ], + "owner": null, + "title": "Сущность runtime health", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "architecture.telegram_notify_app", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "37d4dcf470ea3de95d59e44786006e369a3ea11bf5dbf4c88877696e9183ee87", + "children": [], + "doc_kind": "misc", + "entities": [ + "WorkerHealth", + "WorkerStatus", + "TelegramNotifyWorker" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "domain.runtime_health", + "source_path": "docs/documentation/domain/runtime-health-entity.md", + "summary_text": "`runtime health` — доменная модель наблюдаемости сервиса, которая описывает общее состояние runtime и состояние отдельных компонентов. Для `test_echo_app` главным объектом наблюдения является компонент `telegram_notify`, у которого важны статус, время старта и количество успешных отправок. Эта модель используется для внешнего health-monitoring и внутренней диагностики.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + } + ], + "facts": [ + { + "layer": "D2_FACT_INDEX", + "path": "docs/README.md", + "title": "docs/README.md:doc_list_item", + "content": "docs/README.md doc_list_item `documentation/api/` — документация HTTP API control plane.", + "metadata": { + "tags": [], + "owner": null, + "anchor": "Структура", + "doc_id": null, + "object": "`documentation/api/` — документация HTTP API control plane.", + "fact_id": "2f539384881f5f776bf4cef22c00669e53e0fd0761b3d62fa53593254a272f5a", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "81d952f1a6ea85b76f75e0e57f33b8fa4b2bf3cb7db11b91b90171aeedd655a6", + "predicate": "doc_list_item", + "object_ref": null, + "subject_id": "docs/README.md", + "doc_version": null, + "source_path": "docs/README.md", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + } + ], + "relations": [ + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "api.control_actions_endpoint:part_of", + "content": "api.control_actions_endpoint part_of architecture.telegram_notify_app", + "metadata": { + "owner": null, + "anchor": "frontmatter.links", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "source_id": "api.control_actions_endpoint", + "target_id": "architecture.telegram_notify_app", + "doc_version": null, + "relation_id": "5f4909bde905cd3d294ad307074a05e4ae4deefcafe6272cd2d0436e73acb8dd", + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "part_of", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "api.control_actions_endpoint:related_api", + "content": "api.control_actions_endpoint related_api api.health_endpoint", + "metadata": { + "owner": null, + "anchor": "frontmatter.links", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "source_id": "api.control_actions_endpoint", + "target_id": "api.health_endpoint", + "doc_version": null, + "relation_id": "711fb2edb82dd222deaba3c91768b18cbbd453009235823282813c6e867dc2c1", + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "related_api", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "api.control_actions_endpoint:related_logic", + "content": "api.control_actions_endpoint related_logic logic.telegram_notification_loop", + "metadata": { + "owner": null, + "anchor": "frontmatter.links", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "source_id": "api.control_actions_endpoint", + "target_id": "logic.telegram_notification_loop", + "doc_version": null, + "relation_id": "eec79f7a02b804337e791ef231784862ae26e0599eb20224790e9d4f085fa9c0", + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "related_logic", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/api/health-endpoint.md", + "title": "api.health_endpoint:parent", + "content": "api.health_endpoint parent architecture.telegram_notify_app", + "metadata": { + "owner": null, + "anchor": "frontmatter.parent", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "8b5a533a8076e2e9d36995eee29aeade260080bdca2ec8e21fe28f08574b983f", + "source_id": "api.health_endpoint", + "target_id": "architecture.telegram_notify_app", + "doc_version": null, + "relation_id": "c718b1939621233295ccaf6e8203e7fd94f3dd1bfb88f10c51bc5e33d53a24aa", + "source_path": "docs/documentation/api/health-endpoint.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "parent", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/api/health-endpoint.md", + "title": "api.health_endpoint:part_of", + "content": "api.health_endpoint part_of architecture.telegram_notify_app", + "metadata": { + "owner": null, + "anchor": "frontmatter.links", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "8b5a533a8076e2e9d36995eee29aeade260080bdca2ec8e21fe28f08574b983f", + "source_id": "api.health_endpoint", + "target_id": "architecture.telegram_notify_app", + "doc_version": null, + "relation_id": "616f5cbf25da83cb51d8d0741a7fc351620c9ca2c6513fa2094b4aa476f0912a", + "source_path": "docs/documentation/api/health-endpoint.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "part_of", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "api.control_actions_endpoint:parent", + "content": "api.control_actions_endpoint parent architecture.telegram_notify_app", + "metadata": { + "owner": null, + "anchor": "frontmatter.parent", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "source_id": "api.control_actions_endpoint", + "target_id": "architecture.telegram_notify_app", + "doc_version": null, + "relation_id": "afec31fd062e392dcd9699a92c7ab61fd4b1273c1a2b16702b23d55d8d0c47ac", + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "parent", + "staleness_score": null, + "system_component": null + } + } + ] +} +``` + +### User Prompt Overview +- question: Какая структура документации? +- intent: DOCUMENTATION_EXPLAIN +- sub_intent: COMPONENT_EXPLAIN +- documents: 6 | samples: Readme, HTTP API /actions/{action}, HTTP API /health +- facts: 1 | samples: docs/README.md:doc_list_item +- relations: 6 | samples: api.control_actions_endpoint:part_of, api.control_actions_endpoint:related_api, api.control_actions_endpoint:related_logic + +## Mismatches +- sub_intent: expected GENERIC_QA, got COMPONENT_EXPLAIN \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/docs_pre_llm_v3/20260326_121025/full_chain_docs_intents_v3-3x_v3-general-3.json b/tests/pipeline_setup_v3/test_results/docs_pre_llm_v3/20260326_121025/full_chain_docs_intents_v3-3x_v3-general-3.json new file mode 100644 index 0000000..a50c0d2 --- /dev/null +++ b/tests/pipeline_setup_v3/test_results/docs_pre_llm_v3/20260326_121025/full_chain_docs_intents_v3-3x_v3-general-3.json @@ -0,0 +1,85 @@ +{ + "meta": { + "case_id": "v3-general-3", + "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_03_docs/full_chain_docs_intents_v3-3x.yaml", + "runner": "agent_runtime", + "mode": "pre_llm", + "passed": true, + "mismatches": [], + "actual": { + "intent": "GENERAL_QA", + "sub_intent": "GENERIC_QA", + "graph_id": "DocsQAGraph", + "conversation_mode": "START", + "rag_count": 12, + "llm_answer": "", + "answer_mode": "answered", + "path_scope": [], + "doc_scope": [ + "docs/README.md", + "api.control_actions_endpoint", + "api.actions_endpoint", + "api.health_endpoint", + "api.send_message_endpoint" + ], + "entity_candidates": [], + "symbol_candidates": [], + "layers": [ + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "filters": { + "doc_type": null + }, + "pipeline_mode": "pre_llm_only", + "gate_decision": "allow", + "prompt_used": "docs_general_answer", + "llm_mode": "prose", + "degraded_reason": null, + "code_intents_stubbed": true + } + }, + "pipeline_steps": [ + { + "step": "input_query", + "input": { + "query": "С чего начать читать документацию?" + }, + "output": { + "query": "С чего начать читать документацию?" + } + }, + { + "step": "router", + "input": { + "query": "С чего начать читать документацию?" + }, + "output": { + "intent": "GENERAL_QA", + "sub_intent": "GENERIC_QA", + "graph_id": "DocsQAGraph", + "conversation_mode": "START" + } + }, + { + "step": "docs_pipeline", + "input": { + "query": "С чего начать читать документацию?" + }, + "output": { + "answer_mode": "ready", + "prompt_name": "docs_general_answer", + "llm_request": { + "prompt_name": "docs_general_answer", + "log_context": "graph.project_qa.docs.answer", + "prompt_stats": { + "system_chars": 345, + "user_chars": 7572, + "tokens_in_estimate": 1980 + } + }, + "degraded_reason": "" + } + } + ] +} \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/docs_pre_llm_v3/20260326_121025/full_chain_docs_intents_v3-3x_v3-general-3.md b/tests/pipeline_setup_v3/test_results/docs_pre_llm_v3/20260326_121025/full_chain_docs_intents_v3-3x_v3-general-3.md new file mode 100644 index 0000000..0be7a19 --- /dev/null +++ b/tests/pipeline_setup_v3/test_results/docs_pre_llm_v3/20260326_121025/full_chain_docs_intents_v3-3x_v3-general-3.md @@ -0,0 +1,493 @@ +# v3-general-3 + +- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_03_docs/full_chain_docs_intents_v3-3x.yaml +- runner: agent_runtime +- mode: pre_llm +- passed: True + +## Query +С чего начать читать документацию? + +## Actual +{ + "intent": "GENERAL_QA", + "sub_intent": "GENERIC_QA", + "graph_id": "DocsQAGraph", + "conversation_mode": "START", + "rag_count": 12, + "llm_answer": "", + "answer_mode": "answered", + "path_scope": [], + "doc_scope": [ + "docs/README.md", + "api.control_actions_endpoint", + "api.actions_endpoint", + "api.health_endpoint", + "api.send_message_endpoint" + ], + "entity_candidates": [], + "symbol_candidates": [], + "layers": [ + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "filters": { + "doc_type": null + }, + "pipeline_mode": "pre_llm_only", + "gate_decision": "allow", + "prompt_used": "docs_general_answer", + "llm_mode": "prose", + "degraded_reason": null, + "code_intents_stubbed": true +} + +## Pipeline Steps +### input_query +```json +{ + "input": { + "query": "С чего начать читать документацию?" + }, + "output": { + "query": "С чего начать читать документацию?" + } +} +``` + +### router +```json +{ + "input": { + "query": "С чего начать читать документацию?" + }, + "output": { + "intent": "GENERAL_QA", + "sub_intent": "GENERIC_QA", + "graph_id": "DocsQAGraph", + "conversation_mode": "START" + } +} +``` + +### docs_pipeline +```json +{ + "input": { + "query": "С чего начать читать документацию?" + }, + "output": { + "answer_mode": "ready", + "prompt_name": "docs_general_answer", + "llm_request": { + "prompt_name": "docs_general_answer", + "log_context": "graph.project_qa.docs.answer", + "prompt_stats": { + "system_chars": 345, + "user_chars": 7572, + "tokens_in_estimate": 1980 + } + }, + "degraded_reason": "" + } +} +``` + +## Diagnostics +{ + "intent": "GENERAL_QA", + "sub_intent": "GENERIC_QA", + "layers_used": [ + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "documents_found": 4, + "facts_found": 0, + "relations_found": 0, + "openapi_fields_extracted": 0, + "missing_required_fields": [], + "openapi_status": { + "has_path": false, + "has_method": false, + "has_request": false, + "has_response": false + }, + "prompt_used": "docs_general_answer", + "llm_mode": "prose", + "output_valid": true, + "matched_intent_source": "deterministic", + "matched_anchor_type": "none", + "matched_anchor_value": null, + "exact_anchor_match": false, + "docs_layers_requested": [ + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "docs_layers_with_hits": [ + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "planned_layers": [ + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "executed_layers": [ + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "non_empty_layers": [ + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "layer_diagnostics": { + "D1_DOCUMENT_CATALOG": { + "hits": 4, + "top_ids": [ + "docs/README.md", + "api.control_actions_endpoint", + "api.health_endpoint", + "api.send_message_endpoint" + ] + }, + "D0_DOC_CHUNKS": { + "hits": 8, + "top_ids": [ + "docs/README.md", + "api.control_actions_endpoint" + ] + } + }, + "query_entity_candidates": [], + "resolved_entity_candidates": [], + "query_anchor_candidates": [], + "resolved_anchor_candidates": [ + "docs/README.md", + "api.control_actions_endpoint", + "docs/documentation/api/control-actions-endpoint.md", + "api.health_endpoint", + "docs/documentation/api/health-endpoint.md", + "api.send_message_endpoint", + "docs/documentation/api/send-message-endpoint.md" + ], + "anchor_candidates": [], + "selected_anchor": null, + "anchor_selection_reason": "", + "anchor_match_type": "", + "doc_ids": [ + "docs/README.md", + "api.control_actions_endpoint", + "api.actions_endpoint", + "api.health_endpoint", + "api.send_message_endpoint" + ], + "doc_paths": [ + "docs/README.md", + "docs/documentation/api/control-actions-endpoint.md", + "docs/documentation/api/health-endpoint.md", + "docs/documentation/api/send-message-endpoint.md" + ], + "doc_titles": [ + "Readme", + "HTTP API /actions/{action}", + "HTTP API /health", + "HTTP API /send", + "docs/README.md:Структура", + "docs/README.md:Навигация", + "docs/README.md:Правила и шаблоны", + "api.control_actions_endpoint:Summary", + "api.control_actions_endpoint:Описание", + "api.control_actions_endpoint:Сценарий", + "api.control_actions_endpoint:Функциональные требования", + "docs/README.md:Project Docs" + ], + "relation_hits_count": 0, + "relation_targets": [], + "fallback_doc_hits_count": 12, + "fallback_used": false, + "fact_hits": 0, + "entity_hits": 0, + "evidence_summary": { + "documents": 4, + "facts": 0, + "relations": 0, + "chunks": 8, + "entity_hits": 0, + "openapi_signals": { + "path_found": false, + "method_found": false, + "request_schema": false, + "response_schema": false, + "status_codes": false, + "payload_description": false + } + }, + "gate_decision": "allow", + "gate_decision_reason": "evidence_sufficient", + "gate_missing_requirements": [], + "gate_satisfied_requirements": [ + "retrieval_non_empty" + ], + "openapi_evidence": { + "path_found": false, + "method_found": false, + "request_schema": false, + "response_schema": false, + "status_codes": false, + "payload_description": false + }, + "requested_fragment_type": null, + "fragment_evidence_found": [], + "fragment_missing_requirements": [], + "answer_mode": "ready", + "degrade_reason": null, + "degraded_reason": null, + "code_intents_stubbed": false +} + +## LLM Request +- prompt_name: docs_general_answer +- log_context: graph.project_qa.docs.answer + +### Prompt Stats +```json +{ + "system_chars": 345, + "user_chars": 7572, + "tokens_in_estimate": 1980 +} +``` + +### System Prompt +```text +Ты отвечаешь на общий вопрос по документации проекта. + +На вход приходит JSON с полями: +- question +- intent +- sub_intent +- documents +- facts +- relations + +Правила: +- Используй только предоставленные документы и факты +- Не додумывай отсутствующие детали +- Если данных недостаточно, скажи это прямо +- Дай короткий понятный ответ без лишней структуры +``` + +### User Prompt +```json +{ + "question": "С чего начать читать документацию?", + "intent": "GENERAL_QA", + "sub_intent": "GENERIC_QA", + "documents": [ + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/README.md", + "title": "Readme", + "content": "Readme", + "metadata": { + "name": "", + "tags": [], + "type": "", + "layer": "", + "links": [], + "owner": null, + "title": "Readme", + "doc_id": null, + "module": "", + "parent": null, + "status": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "81d952f1a6ea85b76f75e0e57f33b8fa4b2bf3cb7db11b91b90171aeedd655a6", + "children": [], + "doc_kind": "readme", + "entities": [], + "updated_at": null, + "doc_version": null, + "document_id": "docs/README.md", + "source_path": "docs/README.md", + "summary_text": "", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "HTTP API /actions/{action}", + "content": "Endpoint `/actions/{action}` управляет control actions runtime и поддерживает `start`, `stop` и `status`. Для долгих операций `start` и `stop` допускается ответ HTTP 202, если действие еще выполняется. Endpoint используется для operator-driven управления жизненным циклом worker'а через HTTP API.", + "metadata": { + "name": "control_actions_endpoint", + "tags": [ + "api", + "control-plane", + "lifecycle" + ], + "type": "api_method", + "layer": "application", + "links": [ + { + "type": "part_of", + "target": "architecture.telegram_notify_app" + }, + { + "type": "related_api", + "target": "api.health_endpoint" + }, + { + "type": "related_logic", + "target": "logic.telegram_notification_loop" + } + ], + "owner": null, + "title": "HTTP API /actions/{action}", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "architecture.telegram_notify_app", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "children": [], + "doc_kind": "misc", + "entities": [ + "TelegramControlChannel", + "ControlActionSet", + "JSONResponse" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "api.control_actions_endpoint", + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "summary_text": "Endpoint `/actions/{action}` управляет control actions runtime и поддерживает `start`, `stop` и `status`. Для долгих операций `start` и `stop` допускается ответ HTTP 202, если действие еще выполняется. Endpoint используется для operator-driven управления жизненным циклом worker'а через HTTP API.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/api/health-endpoint.md", + "title": "HTTP API /health", + "content": "Endpoint `/health` возвращает агрегированный health payload runtime. Если общий статус равен `ok`, API отвечает с HTTP 200; для состояний деградации или неготовности возвращается HTTP 503 с тем же payload. Endpoint служит основной точкой внешней проверки состояния приложения.", + "metadata": { + "name": "health_endpoint", + "tags": [ + "api", + "health", + "control-plane" + ], + "type": "api_method", + "layer": "application", + "links": [ + { + "type": "part_of", + "target": "architecture.telegram_notify_app" + }, + { + "type": "depends_on", + "target": "domain.runtime_health" + } + ], + "owner": null, + "title": "HTTP API /health", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "architecture.telegram_notify_app", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "8b5a533a8076e2e9d36995eee29aeade260080bdca2ec8e21fe28f08574b983f", + "children": [], + "doc_kind": "misc", + "entities": [ + "TelegramControlChannel", + "TelegramNotifyWorker", + "RuntimeManager", + "WorkerHealth" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "api.health_endpoint", + "source_path": "docs/documentation/api/health-endpoint.md", + "summary_text": "Endpoint `/health` возвращает агрегированный health payload runtime. Если общий статус равен `ok`, API отвечает с HTTP 200; для состояний деградации или неготовности возвращается HTTP 503 с тем же payload. Endpoint служит основной точкой внешней проверки состояния приложения.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/api/send-message-endpoint.md", + "title": "HTTP API /send", + "content": "Endpoint `/send` выполняет ручную отправку сообщения в Telegram через `TelegramSendService`. Он используется для операторской проверки доставки и для отправки уведомлений вне периодического worker loop. Endpoint работает поверх тех же credentials и того же delivery path, что и фоновая отправка.", + "metadata": { + "name": "send_message_endpoint", + "tags": [ + "api", + "telegram", + "manual-send" + ], + "type": "api_method", + "layer": "application", + "links": [ + { + "type": "part_of", + "target": "architecture.telegram_notify_app" + }, + { + "type": "depends_on", + "target": "logic.telegram_notification_loop" + } + ], + "owner": null, + "title": "HTTP API /send", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "architecture.telegram_notify_app", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "5fbf2e33510b0676a3a53b957a4569bd3c2c31fb7719546602c573421ccaa32d", + "children": [], + "doc_kind": "misc", + "entities": [ + "TelegramControlAppFactory", + "TelegramSendService", + "TelegramNotifyWorker" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "api.send_message_endpoint", + "source_path": "docs/documentation/api/send-message-endpoint.md", + "summary_text": "Endpoint `/send` выполняет ручную отправку сообщения в Telegram через `TelegramSendService`. Он используется для операторской проверки доставки и для отправки уведомлений вне периодического worker loop. Endpoint работает поверх тех же credentials и того же delivery path, что и фоновая отправка.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + } + ], + "facts": [], + "relations": [] +} +``` + +### User Prompt Overview +- question: С чего начать читать документацию? +- intent: GENERAL_QA +- sub_intent: GENERIC_QA +- documents: 4 | samples: Readme, HTTP API /actions/{action}, HTTP API /health +- facts: 0 +- relations: 0 + +## Mismatches +- none \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/docs_pre_llm_v3/20260326_121025/full_chain_docs_intents_v3-3x_v3-negative-1.json b/tests/pipeline_setup_v3/test_results/docs_pre_llm_v3/20260326_121025/full_chain_docs_intents_v3-3x_v3-negative-1.json new file mode 100644 index 0000000..76e9b2e --- /dev/null +++ b/tests/pipeline_setup_v3/test_results/docs_pre_llm_v3/20260326_121025/full_chain_docs_intents_v3-3x_v3-negative-1.json @@ -0,0 +1,92 @@ +{ + "meta": { + "case_id": "v3-negative-1", + "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_03_docs/full_chain_docs_intents_v3-3x.yaml", + "runner": "agent_runtime", + "mode": "pre_llm", + "passed": true, + "mismatches": [], + "actual": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "ENTITY_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START", + "rag_count": 26, + "llm_answer": "", + "answer_mode": "answered", + "path_scope": [], + "doc_scope": [ + "api.control_actions_endpoint", + "api.health_endpoint", + "api.send_message_endpoint", + "docs/README.md", + "api.actions_endpoint", + "architecture.telegram_notify_app", + "architecture.telegram_notify_app_overview", + "domain.runtime_health" + ], + "entity_candidates": [ + "PaymentTransaction" + ], + "symbol_candidates": [], + "layers": [ + "D3_ENTITY_CATALOG", + "D1_DOCUMENT_CATALOG", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "filters": { + "doc_type": null + }, + "pipeline_mode": "pre_llm_only", + "gate_decision": "allow", + "prompt_used": "docs_explain_answer", + "llm_mode": "prose", + "degraded_reason": null, + "code_intents_stubbed": true + } + }, + "pipeline_steps": [ + { + "step": "input_query", + "input": { + "query": "Что такое PaymentTransaction?" + }, + "output": { + "query": "Что такое PaymentTransaction?" + } + }, + { + "step": "router", + "input": { + "query": "Что такое PaymentTransaction?" + }, + "output": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "ENTITY_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START" + } + }, + { + "step": "docs_pipeline", + "input": { + "query": "Что такое PaymentTransaction?" + }, + "output": { + "answer_mode": "ready", + "prompt_name": "docs_explain_answer", + "llm_request": { + "prompt_name": "docs_explain_answer", + "log_context": "graph.project_qa.docs.answer", + "prompt_stats": { + "system_chars": 393, + "user_chars": 18782, + "tokens_in_estimate": 4794 + } + }, + "degraded_reason": "" + } + } + ] +} \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/docs_pre_llm_v3/20260326_121025/full_chain_docs_intents_v3-3x_v3-negative-1.md b/tests/pipeline_setup_v3/test_results/docs_pre_llm_v3/20260326_121025/full_chain_docs_intents_v3-3x_v3-negative-1.md new file mode 100644 index 0000000..1c0740d --- /dev/null +++ b/tests/pipeline_setup_v3/test_results/docs_pre_llm_v3/20260326_121025/full_chain_docs_intents_v3-3x_v3-negative-1.md @@ -0,0 +1,841 @@ +# v3-negative-1 + +- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_03_docs/full_chain_docs_intents_v3-3x.yaml +- runner: agent_runtime +- mode: pre_llm +- passed: True + +## Query +Что такое PaymentTransaction? + +## Actual +{ + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "ENTITY_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START", + "rag_count": 26, + "llm_answer": "", + "answer_mode": "answered", + "path_scope": [], + "doc_scope": [ + "api.control_actions_endpoint", + "api.health_endpoint", + "api.send_message_endpoint", + "docs/README.md", + "api.actions_endpoint", + "architecture.telegram_notify_app", + "architecture.telegram_notify_app_overview", + "domain.runtime_health" + ], + "entity_candidates": [ + "PaymentTransaction" + ], + "symbol_candidates": [], + "layers": [ + "D3_ENTITY_CATALOG", + "D1_DOCUMENT_CATALOG", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "filters": { + "doc_type": null + }, + "pipeline_mode": "pre_llm_only", + "gate_decision": "allow", + "prompt_used": "docs_explain_answer", + "llm_mode": "prose", + "degraded_reason": null, + "code_intents_stubbed": true +} + +## Pipeline Steps +### input_query +```json +{ + "input": { + "query": "Что такое PaymentTransaction?" + }, + "output": { + "query": "Что такое PaymentTransaction?" + } +} +``` + +### router +```json +{ + "input": { + "query": "Что такое PaymentTransaction?" + }, + "output": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "ENTITY_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START" + } +} +``` + +### docs_pipeline +```json +{ + "input": { + "query": "Что такое PaymentTransaction?" + }, + "output": { + "answer_mode": "ready", + "prompt_name": "docs_explain_answer", + "llm_request": { + "prompt_name": "docs_explain_answer", + "log_context": "graph.project_qa.docs.answer", + "prompt_stats": { + "system_chars": 393, + "user_chars": 18782, + "tokens_in_estimate": 4794 + } + }, + "degraded_reason": "" + } +} +``` + +## Diagnostics +{ + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "ENTITY_EXPLAIN", + "layers_used": [ + "D3_ENTITY_CATALOG", + "D1_DOCUMENT_CATALOG", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "documents_found": 6, + "facts_found": 0, + "relations_found": 6, + "openapi_fields_extracted": 0, + "missing_required_fields": [], + "openapi_status": { + "has_path": false, + "has_method": false, + "has_request": false, + "has_response": false + }, + "prompt_used": "docs_explain_answer", + "llm_mode": "prose", + "output_valid": true, + "matched_intent_source": "deterministic", + "matched_anchor_type": "none", + "matched_anchor_value": null, + "exact_anchor_match": false, + "docs_layers_requested": [ + "D3_ENTITY_CATALOG", + "D1_DOCUMENT_CATALOG", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "docs_layers_with_hits": [ + "D3_ENTITY_CATALOG", + "D1_DOCUMENT_CATALOG", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "planned_layers": [ + "D3_ENTITY_CATALOG", + "D1_DOCUMENT_CATALOG", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "executed_layers": [ + "D3_ENTITY_CATALOG", + "D1_DOCUMENT_CATALOG", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "non_empty_layers": [ + "D3_ENTITY_CATALOG", + "D1_DOCUMENT_CATALOG", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "layer_diagnostics": { + "D3_ENTITY_CATALOG": { + "hits": 8, + "top_ids": [ + "api.control_actions_endpoint", + "api.health_endpoint" + ] + }, + "D1_DOCUMENT_CATALOG": { + "hits": 6, + "top_ids": [ + "docs/README.md", + "api.control_actions_endpoint", + "api.health_endpoint", + "api.send_message_endpoint", + "architecture.telegram_notify_app" + ] + }, + "D5_RELATION_GRAPH": { + "hits": 6, + "top_ids": [ + "5f4909bde905cd3d294ad307074a05e4ae4deefcafe6272cd2d0436e73acb8dd", + "711fb2edb82dd222deaba3c91768b18cbbd453009235823282813c6e867dc2c1", + "eec79f7a02b804337e791ef231784862ae26e0599eb20224790e9d4f085fa9c0", + "c718b1939621233295ccaf6e8203e7fd94f3dd1bfb88f10c51bc5e33d53a24aa", + "616f5cbf25da83cb51d8d0741a7fc351620c9ca2c6513fa2094b4aa476f0912a" + ] + }, + "D0_DOC_CHUNKS": { + "hits": 6, + "top_ids": [ + "docs/README.md", + "api.control_actions_endpoint" + ] + } + }, + "query_entity_candidates": [ + "PaymentTransaction" + ], + "resolved_entity_candidates": [], + "query_anchor_candidates": [ + "PaymentTransaction" + ], + "resolved_anchor_candidates": [ + "api.control_actions_endpoint", + "docs/documentation/api/control-actions-endpoint.md", + "api.health_endpoint", + "docs/documentation/api/health-endpoint.md", + "api.send_message_endpoint", + "docs/documentation/api/send-message-endpoint.md", + "docs/README.md", + "architecture.telegram_notify_app", + "docs/documentation/architecture/telegram-notify-app-overview.md", + "domain.runtime_health", + "docs/documentation/domain/runtime-health-entity.md" + ], + "anchor_candidates": [], + "selected_anchor": null, + "anchor_selection_reason": "", + "anchor_match_type": "", + "doc_ids": [ + "api.control_actions_endpoint", + "api.health_endpoint", + "api.send_message_endpoint", + "docs/README.md", + "api.actions_endpoint", + "architecture.telegram_notify_app", + "architecture.telegram_notify_app_overview", + "domain.runtime_health" + ], + "doc_paths": [ + "docs/documentation/api/control-actions-endpoint.md", + "docs/documentation/api/health-endpoint.md", + "docs/documentation/api/send-message-endpoint.md", + "docs/README.md", + "docs/documentation/architecture/telegram-notify-app-overview.md", + "docs/documentation/domain/runtime-health-entity.md" + ], + "doc_titles": [ + "ControlActionSet", + "JSONResponse", + "TelegramControlChannel", + "TelegramNotifyWorker", + "RuntimeManager", + "WorkerHealth", + "TelegramControlAppFactory", + "Readme", + "HTTP API /actions/{action}", + "HTTP API /health", + "HTTP API /send", + "Архитектура Telegram Notify App", + "Сущность runtime health", + "api.control_actions_endpoint:part_of", + "api.control_actions_endpoint:related_api", + "api.control_actions_endpoint:related_logic", + "api.health_endpoint:parent", + "api.health_endpoint:part_of", + "api.control_actions_endpoint:parent", + "docs/README.md:Структура", + "docs/README.md:Навигация", + "docs/README.md:Правила и шаблоны", + "api.control_actions_endpoint:Summary", + "api.control_actions_endpoint:Описание", + "docs/README.md:Project Docs" + ], + "relation_hits_count": 6, + "relation_targets": [ + "api.control_actions_endpoint:part_of", + "api.control_actions_endpoint:related_api", + "api.control_actions_endpoint:related_logic", + "api.health_endpoint:parent", + "api.health_endpoint:part_of", + "api.control_actions_endpoint:parent" + ], + "fallback_doc_hits_count": 12, + "fallback_used": false, + "fact_hits": 0, + "entity_hits": 0, + "evidence_summary": { + "documents": 6, + "facts": 0, + "relations": 6, + "chunks": 6, + "entity_hits": 0, + "openapi_signals": { + "path_found": false, + "method_found": false, + "request_schema": false, + "response_schema": false, + "status_codes": false, + "payload_description": false + } + }, + "gate_decision": "allow", + "gate_decision_reason": "evidence_sufficient", + "gate_missing_requirements": [], + "gate_satisfied_requirements": [ + "retrieval_non_empty" + ], + "openapi_evidence": { + "path_found": false, + "method_found": false, + "request_schema": false, + "response_schema": false, + "status_codes": false, + "payload_description": false + }, + "requested_fragment_type": null, + "fragment_evidence_found": [], + "fragment_missing_requirements": [], + "answer_mode": "ready", + "degrade_reason": null, + "degraded_reason": null, + "code_intents_stubbed": false +} + +## LLM Request +- prompt_name: docs_explain_answer +- log_context: graph.project_qa.docs.answer + +### Prompt Stats +```json +{ + "system_chars": 393, + "user_chars": 18782, + "tokens_in_estimate": 4794 +} +``` + +### System Prompt +```text +Ты объясняешь документацию системы. + +На вход приходит JSON с полями: +- question +- intent +- sub_intent +- documents +- facts +- relations + +Правила: +- Используй только предоставленные факты +- Не додумывай +- Если данных недостаточно, скажи это явно +- Объясняй структурировано + +Формат ответа: +1. Краткое описание +2. Основные элементы +3. Как это работает +4. Связи с другими частями системы (если есть) +``` + +### User Prompt +```json +{ + "question": "Что такое PaymentTransaction?", + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "ENTITY_EXPLAIN", + "documents": [ + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/README.md", + "title": "Readme", + "content": "Readme", + "metadata": { + "name": "", + "tags": [], + "type": "", + "layer": "", + "links": [], + "owner": null, + "title": "Readme", + "doc_id": null, + "module": "", + "parent": null, + "status": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "81d952f1a6ea85b76f75e0e57f33b8fa4b2bf3cb7db11b91b90171aeedd655a6", + "children": [], + "doc_kind": "readme", + "entities": [], + "updated_at": null, + "doc_version": null, + "document_id": "docs/README.md", + "source_path": "docs/README.md", + "summary_text": "", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "HTTP API /actions/{action}", + "content": "Endpoint `/actions/{action}` управляет control actions runtime и поддерживает `start`, `stop` и `status`. Для долгих операций `start` и `stop` допускается ответ HTTP 202, если действие еще выполняется. Endpoint используется для operator-driven управления жизненным циклом worker'а через HTTP API.", + "metadata": { + "name": "control_actions_endpoint", + "tags": [ + "api", + "control-plane", + "lifecycle" + ], + "type": "api_method", + "layer": "application", + "links": [ + { + "type": "part_of", + "target": "architecture.telegram_notify_app" + }, + { + "type": "related_api", + "target": "api.health_endpoint" + }, + { + "type": "related_logic", + "target": "logic.telegram_notification_loop" + } + ], + "owner": null, + "title": "HTTP API /actions/{action}", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "architecture.telegram_notify_app", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "children": [], + "doc_kind": "misc", + "entities": [ + "TelegramControlChannel", + "ControlActionSet", + "JSONResponse" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "api.control_actions_endpoint", + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "summary_text": "Endpoint `/actions/{action}` управляет control actions runtime и поддерживает `start`, `stop` и `status`. Для долгих операций `start` и `stop` допускается ответ HTTP 202, если действие еще выполняется. Endpoint используется для operator-driven управления жизненным циклом worker'а через HTTP API.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/api/health-endpoint.md", + "title": "HTTP API /health", + "content": "Endpoint `/health` возвращает агрегированный health payload runtime. Если общий статус равен `ok`, API отвечает с HTTP 200; для состояний деградации или неготовности возвращается HTTP 503 с тем же payload. Endpoint служит основной точкой внешней проверки состояния приложения.", + "metadata": { + "name": "health_endpoint", + "tags": [ + "api", + "health", + "control-plane" + ], + "type": "api_method", + "layer": "application", + "links": [ + { + "type": "part_of", + "target": "architecture.telegram_notify_app" + }, + { + "type": "depends_on", + "target": "domain.runtime_health" + } + ], + "owner": null, + "title": "HTTP API /health", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "architecture.telegram_notify_app", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "8b5a533a8076e2e9d36995eee29aeade260080bdca2ec8e21fe28f08574b983f", + "children": [], + "doc_kind": "misc", + "entities": [ + "TelegramControlChannel", + "TelegramNotifyWorker", + "RuntimeManager", + "WorkerHealth" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "api.health_endpoint", + "source_path": "docs/documentation/api/health-endpoint.md", + "summary_text": "Endpoint `/health` возвращает агрегированный health payload runtime. Если общий статус равен `ok`, API отвечает с HTTP 200; для состояний деградации или неготовности возвращается HTTP 503 с тем же payload. Endpoint служит основной точкой внешней проверки состояния приложения.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/api/send-message-endpoint.md", + "title": "HTTP API /send", + "content": "Endpoint `/send` выполняет ручную отправку сообщения в Telegram через `TelegramSendService`. Он используется для операторской проверки доставки и для отправки уведомлений вне периодического worker loop. Endpoint работает поверх тех же credentials и того же delivery path, что и фоновая отправка.", + "metadata": { + "name": "send_message_endpoint", + "tags": [ + "api", + "telegram", + "manual-send" + ], + "type": "api_method", + "layer": "application", + "links": [ + { + "type": "part_of", + "target": "architecture.telegram_notify_app" + }, + { + "type": "depends_on", + "target": "logic.telegram_notification_loop" + } + ], + "owner": null, + "title": "HTTP API /send", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "architecture.telegram_notify_app", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "5fbf2e33510b0676a3a53b957a4569bd3c2c31fb7719546602c573421ccaa32d", + "children": [], + "doc_kind": "misc", + "entities": [ + "TelegramControlAppFactory", + "TelegramSendService", + "TelegramNotifyWorker" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "api.send_message_endpoint", + "source_path": "docs/documentation/api/send-message-endpoint.md", + "summary_text": "Endpoint `/send` выполняет ручную отправку сообщения в Telegram через `TelegramSendService`. Он используется для операторской проверки доставки и для отправки уведомлений вне периодического worker loop. Endpoint работает поверх тех же credentials и того же delivery path, что и фоновая отправка.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/architecture/telegram-notify-app-overview.md", + "title": "Архитектура Telegram Notify App", + "content": "`test_echo_app` — сервис на базе PLBA runtime, который поднимает HTTP control plane и запускает фоновый воркер для периодической отправки уведомлений в Telegram. Приложение использует YAML-конфиг для runtime-настроек и переменные окружения для Telegram credentials. Основной контур системы состоит из runtime manager, control channel, send service и worker loop.", + "metadata": { + "name": "telegram_notify_app_overview", + "tags": [ + "architecture", + "telegram", + "plba", + "runtime" + ], + "type": "architecture_overview", + "layer": "system", + "links": [ + { + "type": "related_api", + "target": "api.health_endpoint" + }, + { + "type": "related_api", + "target": "api.control_actions_endpoint" + }, + { + "type": "related_api", + "target": "api.send_message_endpoint" + }, + { + "type": "depends_on", + "target": "logic.telegram_notification_loop" + }, + { + "type": "depends_on", + "target": "domain.runtime_health" + } + ], + "owner": null, + "title": "Архитектура Telegram Notify App", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "docs_root", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "8b1cc9f823e55bddbc825466d10a0fdb4ca4354ac02d91f9e2aef7b7d2ec8256", + "children": [ + "api.health_endpoint", + "api.control_actions_endpoint", + "api.send_message_endpoint", + "logic.telegram_notification_loop", + "domain.runtime_health" + ], + "doc_kind": "spec", + "entities": [ + "TelegramNotifyModule", + "TelegramNotifyWorker", + "TelegramControlChannel", + "TelegramSendService", + "RuntimeManager" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "architecture.telegram_notify_app", + "source_path": "docs/documentation/architecture/telegram-notify-app-overview.md", + "summary_text": "`test_echo_app` — сервис на базе PLBA runtime, который поднимает HTTP control plane и запускает фоновый воркер для периодической отправки уведомлений в Telegram. Приложение использует YAML-конфиг для runtime-настроек и переменные окружения для Telegram credentials. Основной контур системы состоит из runtime manager, control channel, send service и worker loop.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/domain/runtime-health-entity.md", + "title": "Сущность runtime health", + "content": "`runtime health` — доменная модель наблюдаемости сервиса, которая описывает общее состояние runtime и состояние отдельных компонентов. Для `test_echo_app` главным объектом наблюдения является компонент `telegram_notify`, у которого важны статус, время старта и количество успешных отправок. Эта модель используется для внешнего health-monitoring и внутренней диагностики.", + "metadata": { + "name": "runtime_health", + "tags": [ + "domain", + "health", + "observability" + ], + "type": "domain_entity", + "layer": "domain", + "links": [ + { + "type": "part_of", + "target": "architecture.telegram_notify_app" + }, + { + "type": "used_by", + "target": "api.health_endpoint" + }, + { + "type": "related_logic", + "target": "logic.telegram_notification_loop" + } + ], + "owner": null, + "title": "Сущность runtime health", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "architecture.telegram_notify_app", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "37d4dcf470ea3de95d59e44786006e369a3ea11bf5dbf4c88877696e9183ee87", + "children": [], + "doc_kind": "misc", + "entities": [ + "WorkerHealth", + "WorkerStatus", + "TelegramNotifyWorker" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "domain.runtime_health", + "source_path": "docs/documentation/domain/runtime-health-entity.md", + "summary_text": "`runtime health` — доменная модель наблюдаемости сервиса, которая описывает общее состояние runtime и состояние отдельных компонентов. Для `test_echo_app` главным объектом наблюдения является компонент `telegram_notify`, у которого важны статус, время старта и количество успешных отправок. Эта модель используется для внешнего health-monitoring и внутренней диагностики.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + } + ], + "facts": [], + "relations": [ + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "api.control_actions_endpoint:part_of", + "content": "api.control_actions_endpoint part_of architecture.telegram_notify_app", + "metadata": { + "owner": null, + "anchor": "frontmatter.links", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "source_id": "api.control_actions_endpoint", + "target_id": "architecture.telegram_notify_app", + "doc_version": null, + "relation_id": "5f4909bde905cd3d294ad307074a05e4ae4deefcafe6272cd2d0436e73acb8dd", + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "part_of", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "api.control_actions_endpoint:related_api", + "content": "api.control_actions_endpoint related_api api.health_endpoint", + "metadata": { + "owner": null, + "anchor": "frontmatter.links", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "source_id": "api.control_actions_endpoint", + "target_id": "api.health_endpoint", + "doc_version": null, + "relation_id": "711fb2edb82dd222deaba3c91768b18cbbd453009235823282813c6e867dc2c1", + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "related_api", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "api.control_actions_endpoint:related_logic", + "content": "api.control_actions_endpoint related_logic logic.telegram_notification_loop", + "metadata": { + "owner": null, + "anchor": "frontmatter.links", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "source_id": "api.control_actions_endpoint", + "target_id": "logic.telegram_notification_loop", + "doc_version": null, + "relation_id": "eec79f7a02b804337e791ef231784862ae26e0599eb20224790e9d4f085fa9c0", + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "related_logic", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/api/health-endpoint.md", + "title": "api.health_endpoint:parent", + "content": "api.health_endpoint parent architecture.telegram_notify_app", + "metadata": { + "owner": null, + "anchor": "frontmatter.parent", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "8b5a533a8076e2e9d36995eee29aeade260080bdca2ec8e21fe28f08574b983f", + "source_id": "api.health_endpoint", + "target_id": "architecture.telegram_notify_app", + "doc_version": null, + "relation_id": "c718b1939621233295ccaf6e8203e7fd94f3dd1bfb88f10c51bc5e33d53a24aa", + "source_path": "docs/documentation/api/health-endpoint.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "parent", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/api/health-endpoint.md", + "title": "api.health_endpoint:part_of", + "content": "api.health_endpoint part_of architecture.telegram_notify_app", + "metadata": { + "owner": null, + "anchor": "frontmatter.links", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "8b5a533a8076e2e9d36995eee29aeade260080bdca2ec8e21fe28f08574b983f", + "source_id": "api.health_endpoint", + "target_id": "architecture.telegram_notify_app", + "doc_version": null, + "relation_id": "616f5cbf25da83cb51d8d0741a7fc351620c9ca2c6513fa2094b4aa476f0912a", + "source_path": "docs/documentation/api/health-endpoint.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "part_of", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "api.control_actions_endpoint:parent", + "content": "api.control_actions_endpoint parent architecture.telegram_notify_app", + "metadata": { + "owner": null, + "anchor": "frontmatter.parent", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "source_id": "api.control_actions_endpoint", + "target_id": "architecture.telegram_notify_app", + "doc_version": null, + "relation_id": "afec31fd062e392dcd9699a92c7ab61fd4b1273c1a2b16702b23d55d8d0c47ac", + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "parent", + "staleness_score": null, + "system_component": null + } + } + ] +} +``` + +### User Prompt Overview +- question: Что такое PaymentTransaction? +- intent: DOCUMENTATION_EXPLAIN +- sub_intent: ENTITY_EXPLAIN +- documents: 6 | samples: Readme, HTTP API /actions/{action}, HTTP API /health +- facts: 0 +- relations: 6 | samples: api.control_actions_endpoint:part_of, api.control_actions_endpoint:related_api, api.control_actions_endpoint:related_logic + +## Mismatches +- none \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/docs_pre_llm_v3/20260326_121025/full_chain_docs_intents_v3-3x_v3-negative-2.json b/tests/pipeline_setup_v3/test_results/docs_pre_llm_v3/20260326_121025/full_chain_docs_intents_v3-3x_v3-negative-2.json new file mode 100644 index 0000000..215ddd2 --- /dev/null +++ b/tests/pipeline_setup_v3/test_results/docs_pre_llm_v3/20260326_121025/full_chain_docs_intents_v3-3x_v3-negative-2.json @@ -0,0 +1,83 @@ +{ + "meta": { + "case_id": "v3-negative-2", + "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_03_docs/full_chain_docs_intents_v3-3x.yaml", + "runner": "agent_runtime", + "mode": "pre_llm", + "passed": true, + "mismatches": [], + "actual": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "ENTITY_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START", + "rag_count": 0, + "llm_answer": "", + "answer_mode": "degraded", + "path_scope": [], + "doc_scope": [], + "entity_candidates": [ + "UnknownEntity" + ], + "symbol_candidates": [], + "layers": [ + "D3_ENTITY_CATALOG", + "D1_DOCUMENT_CATALOG", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "filters": { + "doc_type": null + }, + "pipeline_mode": "pre_llm_only", + "gate_decision": "reject", + "prompt_used": "docs_explain_answer", + "llm_mode": "prose", + "degraded_reason": "not_found_exact_anchor", + "code_intents_stubbed": true + } + }, + "pipeline_steps": [ + { + "step": "input_query", + "input": { + "query": "Объясни сущность UnknownEntity" + }, + "output": { + "query": "Объясни сущность UnknownEntity" + } + }, + { + "step": "router", + "input": { + "query": "Объясни сущность UnknownEntity" + }, + "output": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "ENTITY_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START" + } + }, + { + "step": "docs_pipeline", + "input": { + "query": "Объясни сущность UnknownEntity" + }, + "output": { + "answer_mode": "degraded", + "prompt_name": "docs_explain_answer", + "llm_request": { + "prompt_name": "docs_explain_answer", + "log_context": "graph.project_qa.docs.answer", + "prompt_stats": { + "system_chars": 393, + "user_chars": 174, + "tokens_in_estimate": 142 + } + }, + "degraded_reason": "not_found_exact_anchor" + } + } + ] +} \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/docs_pre_llm_v3/20260326_121025/full_chain_docs_intents_v3-3x_v3-negative-2.md b/tests/pipeline_setup_v3/test_results/docs_pre_llm_v3/20260326_121025/full_chain_docs_intents_v3-3x_v3-negative-2.md new file mode 100644 index 0000000..4a127d7 --- /dev/null +++ b/tests/pipeline_setup_v3/test_results/docs_pre_llm_v3/20260326_121025/full_chain_docs_intents_v3-3x_v3-negative-2.md @@ -0,0 +1,307 @@ +# v3-negative-2 + +- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_03_docs/full_chain_docs_intents_v3-3x.yaml +- runner: agent_runtime +- mode: pre_llm +- passed: True + +## Query +Объясни сущность UnknownEntity + +## Actual +{ + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "ENTITY_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START", + "rag_count": 0, + "llm_answer": "", + "answer_mode": "degraded", + "path_scope": [], + "doc_scope": [], + "entity_candidates": [ + "UnknownEntity" + ], + "symbol_candidates": [], + "layers": [ + "D3_ENTITY_CATALOG", + "D1_DOCUMENT_CATALOG", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "filters": { + "doc_type": null + }, + "pipeline_mode": "pre_llm_only", + "gate_decision": "reject", + "prompt_used": "docs_explain_answer", + "llm_mode": "prose", + "degraded_reason": "not_found_exact_anchor", + "code_intents_stubbed": true +} + +## Pipeline Steps +### input_query +```json +{ + "input": { + "query": "Объясни сущность UnknownEntity" + }, + "output": { + "query": "Объясни сущность UnknownEntity" + } +} +``` + +### router +```json +{ + "input": { + "query": "Объясни сущность UnknownEntity" + }, + "output": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "ENTITY_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START" + } +} +``` + +### docs_pipeline +```json +{ + "input": { + "query": "Объясни сущность UnknownEntity" + }, + "output": { + "answer_mode": "degraded", + "prompt_name": "docs_explain_answer", + "llm_request": { + "prompt_name": "docs_explain_answer", + "log_context": "graph.project_qa.docs.answer", + "prompt_stats": { + "system_chars": 393, + "user_chars": 174, + "tokens_in_estimate": 142 + } + }, + "degraded_reason": "not_found_exact_anchor" + } +} +``` + +## Diagnostics +{ + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "ENTITY_EXPLAIN", + "layers_used": [ + "D3_ENTITY_CATALOG", + "D1_DOCUMENT_CATALOG", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "documents_found": 0, + "facts_found": 0, + "relations_found": 0, + "openapi_fields_extracted": 0, + "missing_required_fields": [], + "openapi_status": { + "has_path": false, + "has_method": false, + "has_request": false, + "has_response": false + }, + "prompt_used": "docs_explain_answer", + "llm_mode": "prose", + "output_valid": false, + "matched_intent_source": "deterministic", + "matched_anchor_type": "entity", + "matched_anchor_value": "UnknownEntity", + "exact_anchor_match": false, + "docs_layers_requested": [ + "D3_ENTITY_CATALOG", + "D1_DOCUMENT_CATALOG", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "docs_layers_with_hits": [ + "D3_ENTITY_CATALOG", + "D1_DOCUMENT_CATALOG", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "planned_layers": [ + "D3_ENTITY_CATALOG", + "D1_DOCUMENT_CATALOG", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "executed_layers": [ + "D3_ENTITY_CATALOG", + "D1_DOCUMENT_CATALOG", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "non_empty_layers": [ + "D3_ENTITY_CATALOG", + "D1_DOCUMENT_CATALOG", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "layer_diagnostics": { + "D3_ENTITY_CATALOG": { + "hits": 8, + "top_ids": [ + "api.control_actions_endpoint", + "api.health_endpoint" + ] + }, + "D1_DOCUMENT_CATALOG": { + "hits": 6, + "top_ids": [ + "docs/README.md", + "api.control_actions_endpoint", + "api.health_endpoint", + "api.send_message_endpoint", + "architecture.telegram_notify_app" + ] + }, + "D5_RELATION_GRAPH": { + "hits": 6, + "top_ids": [ + "5f4909bde905cd3d294ad307074a05e4ae4deefcafe6272cd2d0436e73acb8dd", + "711fb2edb82dd222deaba3c91768b18cbbd453009235823282813c6e867dc2c1", + "eec79f7a02b804337e791ef231784862ae26e0599eb20224790e9d4f085fa9c0", + "c718b1939621233295ccaf6e8203e7fd94f3dd1bfb88f10c51bc5e33d53a24aa", + "616f5cbf25da83cb51d8d0741a7fc351620c9ca2c6513fa2094b4aa476f0912a" + ] + }, + "D0_DOC_CHUNKS": { + "hits": 6, + "top_ids": [ + "docs/README.md", + "api.control_actions_endpoint" + ] + } + }, + "query_entity_candidates": [ + "UnknownEntity" + ], + "resolved_entity_candidates": [], + "query_anchor_candidates": [ + "UnknownEntity" + ], + "resolved_anchor_candidates": [], + "anchor_candidates": [], + "selected_anchor": null, + "anchor_selection_reason": "", + "anchor_match_type": "", + "doc_ids": [], + "doc_paths": [], + "doc_titles": [], + "relation_hits_count": 0, + "relation_targets": [], + "fallback_doc_hits_count": 0, + "fallback_used": false, + "fact_hits": 0, + "entity_hits": 0, + "evidence_summary": { + "documents": 0, + "facts": 0, + "relations": 0, + "chunks": 0, + "entity_hits": 0, + "openapi_signals": { + "path_found": false, + "method_found": false, + "request_schema": false, + "response_schema": false, + "status_codes": false, + "payload_description": false + } + }, + "gate_decision": "reject", + "gate_decision_reason": "not_found_exact_anchor", + "gate_missing_requirements": [ + "retrieval_non_empty", + "exact_anchor_match" + ], + "gate_satisfied_requirements": [], + "openapi_evidence": { + "path_found": false, + "method_found": false, + "request_schema": false, + "response_schema": false, + "status_codes": false, + "payload_description": false + }, + "requested_fragment_type": null, + "fragment_evidence_found": [], + "fragment_missing_requirements": [], + "answer_mode": "degraded", + "degrade_reason": "not_found_exact_anchor", + "degraded_reason": "not_found_exact_anchor", + "code_intents_stubbed": false +} + +## LLM Request +- prompt_name: docs_explain_answer +- log_context: graph.project_qa.docs.answer + +### Prompt Stats +```json +{ + "system_chars": 393, + "user_chars": 174, + "tokens_in_estimate": 142 +} +``` + +### System Prompt +```text +Ты объясняешь документацию системы. + +На вход приходит JSON с полями: +- question +- intent +- sub_intent +- documents +- facts +- relations + +Правила: +- Используй только предоставленные факты +- Не додумывай +- Если данных недостаточно, скажи это явно +- Объясняй структурировано + +Формат ответа: +1. Краткое описание +2. Основные элементы +3. Как это работает +4. Связи с другими частями системы (если есть) +``` + +### User Prompt +```json +{ + "question": "Объясни сущность UnknownEntity", + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "ENTITY_EXPLAIN", + "documents": [], + "facts": [], + "relations": [] +} +``` + +### User Prompt Overview +- question: Объясни сущность UnknownEntity +- intent: DOCUMENTATION_EXPLAIN +- sub_intent: ENTITY_EXPLAIN +- documents: 0 +- facts: 0 +- relations: 0 + +## Mismatches +- none \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/docs_pre_llm_v3/20260326_121025/full_chain_docs_intents_v3-3x_v3-negative-3.json b/tests/pipeline_setup_v3/test_results/docs_pre_llm_v3/20260326_121025/full_chain_docs_intents_v3-3x_v3-negative-3.json new file mode 100644 index 0000000..e9871ad --- /dev/null +++ b/tests/pipeline_setup_v3/test_results/docs_pre_llm_v3/20260326_121025/full_chain_docs_intents_v3-3x_v3-negative-3.json @@ -0,0 +1,81 @@ +{ + "meta": { + "case_id": "v3-negative-3", + "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_03_docs/full_chain_docs_intents_v3-3x.yaml", + "runner": "agent_runtime", + "mode": "pre_llm", + "passed": true, + "mismatches": [], + "actual": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "API_METHOD_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START", + "rag_count": 0, + "llm_answer": "", + "answer_mode": "degraded", + "path_scope": [], + "doc_scope": [], + "entity_candidates": [], + "symbol_candidates": [], + "layers": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D4_WORKFLOW_INDEX", + "D0_DOC_CHUNKS" + ], + "filters": { + "doc_type": "api_method" + }, + "pipeline_mode": "pre_llm_only", + "gate_decision": "reject", + "prompt_used": "docs_explain_answer", + "llm_mode": "prose", + "degraded_reason": "not_found_exact_anchor", + "code_intents_stubbed": true + } + }, + "pipeline_steps": [ + { + "step": "input_query", + "input": { + "query": "Что делает endpoint /unknown?" + }, + "output": { + "query": "Что делает endpoint /unknown?" + } + }, + { + "step": "router", + "input": { + "query": "Что делает endpoint /unknown?" + }, + "output": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "API_METHOD_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START" + } + }, + { + "step": "docs_pipeline", + "input": { + "query": "Что делает endpoint /unknown?" + }, + "output": { + "answer_mode": "degraded", + "prompt_name": "docs_explain_answer", + "llm_request": { + "prompt_name": "docs_explain_answer", + "log_context": "graph.project_qa.docs.answer", + "prompt_stats": { + "system_chars": 393, + "user_chars": 177, + "tokens_in_estimate": 143 + } + }, + "degraded_reason": "not_found_exact_anchor" + } + } + ] +} \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/docs_pre_llm_v3/20260326_121025/full_chain_docs_intents_v3-3x_v3-negative-3.md b/tests/pipeline_setup_v3/test_results/docs_pre_llm_v3/20260326_121025/full_chain_docs_intents_v3-3x_v3-negative-3.md new file mode 100644 index 0000000..ef0e013 --- /dev/null +++ b/tests/pipeline_setup_v3/test_results/docs_pre_llm_v3/20260326_121025/full_chain_docs_intents_v3-3x_v3-negative-3.md @@ -0,0 +1,303 @@ +# v3-negative-3 + +- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_03_docs/full_chain_docs_intents_v3-3x.yaml +- runner: agent_runtime +- mode: pre_llm +- passed: True + +## Query +Что делает endpoint /unknown? + +## Actual +{ + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "API_METHOD_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START", + "rag_count": 0, + "llm_answer": "", + "answer_mode": "degraded", + "path_scope": [], + "doc_scope": [], + "entity_candidates": [], + "symbol_candidates": [], + "layers": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D4_WORKFLOW_INDEX", + "D0_DOC_CHUNKS" + ], + "filters": { + "doc_type": "api_method" + }, + "pipeline_mode": "pre_llm_only", + "gate_decision": "reject", + "prompt_used": "docs_explain_answer", + "llm_mode": "prose", + "degraded_reason": "not_found_exact_anchor", + "code_intents_stubbed": true +} + +## Pipeline Steps +### input_query +```json +{ + "input": { + "query": "Что делает endpoint /unknown?" + }, + "output": { + "query": "Что делает endpoint /unknown?" + } +} +``` + +### router +```json +{ + "input": { + "query": "Что делает endpoint /unknown?" + }, + "output": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "API_METHOD_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START" + } +} +``` + +### docs_pipeline +```json +{ + "input": { + "query": "Что делает endpoint /unknown?" + }, + "output": { + "answer_mode": "degraded", + "prompt_name": "docs_explain_answer", + "llm_request": { + "prompt_name": "docs_explain_answer", + "log_context": "graph.project_qa.docs.answer", + "prompt_stats": { + "system_chars": 393, + "user_chars": 177, + "tokens_in_estimate": 143 + } + }, + "degraded_reason": "not_found_exact_anchor" + } +} +``` + +## Diagnostics +{ + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "API_METHOD_EXPLAIN", + "layers_used": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D4_WORKFLOW_INDEX", + "D0_DOC_CHUNKS" + ], + "documents_found": 0, + "facts_found": 0, + "relations_found": 0, + "openapi_fields_extracted": 0, + "missing_required_fields": [], + "openapi_status": { + "has_path": false, + "has_method": false, + "has_request": false, + "has_response": false + }, + "prompt_used": "docs_explain_answer", + "llm_mode": "prose", + "output_valid": false, + "matched_intent_source": "deterministic", + "matched_anchor_type": "endpoint", + "matched_anchor_value": "/unknown", + "exact_anchor_match": false, + "docs_layers_requested": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D4_WORKFLOW_INDEX", + "D0_DOC_CHUNKS" + ], + "docs_layers_with_hits": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D4_WORKFLOW_INDEX", + "D0_DOC_CHUNKS" + ], + "planned_layers": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D4_WORKFLOW_INDEX", + "D0_DOC_CHUNKS" + ], + "executed_layers": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D4_WORKFLOW_INDEX", + "D0_DOC_CHUNKS" + ], + "non_empty_layers": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D4_WORKFLOW_INDEX", + "D0_DOC_CHUNKS" + ], + "layer_diagnostics": { + "D1_DOCUMENT_CATALOG": { + "hits": 6, + "top_ids": [ + "api.send_message_endpoint", + "api.control_actions_endpoint", + "api.health_endpoint", + "docs/README.md", + "architecture.telegram_notify_app" + ] + }, + "D2_FACT_INDEX": { + "hits": 8, + "top_ids": [ + "f85d982c272a2ee6baeadc433221a20e684cd8ef01cb4788d6f76d05ca56d6d0", + "b8e44c3adb74aaa6c91ae8815fa091289e58dd3990a3a1b63e850c62075aea75", + "bafb867ffed41c9db637df98d6cd5f6722d7747bbebc6c03e6f0d0caf3b7f9f3", + "54bbcbac242f1c85ec3280236ed5841998a8a3a548ff16cbf0b5acafbff469e3", + "b6bfad59b3bf00f199b5ef90c1208af19664de700413e7354468a93a4abaaa2f" + ] + }, + "D4_WORKFLOW_INDEX": { + "hits": 3, + "top_ids": [ + "api.control_actions_endpoint", + "api.health_endpoint", + "api.send_message_endpoint" + ] + }, + "D0_DOC_CHUNKS": { + "hits": 6, + "top_ids": [ + "api.control_actions_endpoint" + ] + } + }, + "query_entity_candidates": [], + "resolved_entity_candidates": [], + "query_anchor_candidates": [ + "/unknown" + ], + "resolved_anchor_candidates": [], + "anchor_candidates": [], + "selected_anchor": null, + "anchor_selection_reason": "", + "anchor_match_type": "", + "doc_ids": [], + "doc_paths": [], + "doc_titles": [], + "relation_hits_count": 0, + "relation_targets": [], + "fallback_doc_hits_count": 0, + "fallback_used": false, + "fact_hits": 0, + "entity_hits": 0, + "evidence_summary": { + "documents": 0, + "facts": 0, + "relations": 0, + "chunks": 0, + "entity_hits": 0, + "openapi_signals": { + "path_found": false, + "method_found": false, + "request_schema": false, + "response_schema": false, + "status_codes": false, + "payload_description": false + } + }, + "gate_decision": "reject", + "gate_decision_reason": "not_found_exact_anchor", + "gate_missing_requirements": [ + "retrieval_non_empty", + "exact_anchor_match" + ], + "gate_satisfied_requirements": [], + "openapi_evidence": { + "path_found": false, + "method_found": false, + "request_schema": false, + "response_schema": false, + "status_codes": false, + "payload_description": false + }, + "requested_fragment_type": null, + "fragment_evidence_found": [], + "fragment_missing_requirements": [], + "answer_mode": "degraded", + "degrade_reason": "not_found_exact_anchor", + "degraded_reason": "not_found_exact_anchor", + "code_intents_stubbed": false +} + +## LLM Request +- prompt_name: docs_explain_answer +- log_context: graph.project_qa.docs.answer + +### Prompt Stats +```json +{ + "system_chars": 393, + "user_chars": 177, + "tokens_in_estimate": 143 +} +``` + +### System Prompt +```text +Ты объясняешь документацию системы. + +На вход приходит JSON с полями: +- question +- intent +- sub_intent +- documents +- facts +- relations + +Правила: +- Используй только предоставленные факты +- Не додумывай +- Если данных недостаточно, скажи это явно +- Объясняй структурировано + +Формат ответа: +1. Краткое описание +2. Основные элементы +3. Как это работает +4. Связи с другими частями системы (если есть) +``` + +### User Prompt +```json +{ + "question": "Что делает endpoint /unknown?", + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "API_METHOD_EXPLAIN", + "documents": [], + "facts": [], + "relations": [] +} +``` + +### User Prompt Overview +- question: Что делает endpoint /unknown? +- intent: DOCUMENTATION_EXPLAIN +- sub_intent: API_METHOD_EXPLAIN +- documents: 0 +- facts: 0 +- relations: 0 + +## Mismatches +- none \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/docs_pre_llm_v3/20260326_121025/full_chain_docs_intents_v3-3x_v3-related-architecture-1.json b/tests/pipeline_setup_v3/test_results/docs_pre_llm_v3/20260326_121025/full_chain_docs_intents_v3-3x_v3-related-architecture-1.json new file mode 100644 index 0000000..9069b9d --- /dev/null +++ b/tests/pipeline_setup_v3/test_results/docs_pre_llm_v3/20260326_121025/full_chain_docs_intents_v3-3x_v3-related-architecture-1.json @@ -0,0 +1,84 @@ +{ + "meta": { + "case_id": "v3-related-architecture-1", + "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_03_docs/full_chain_docs_intents_v3-3x.yaml", + "runner": "agent_runtime", + "mode": "pre_llm", + "passed": true, + "mismatches": [], + "actual": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "RELATED_DOCS_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START", + "rag_count": 14, + "llm_answer": "", + "answer_mode": "answered", + "path_scope": [], + "doc_scope": [ + "api.control_actions_endpoint", + "api.health_endpoint", + "api.send_message_endpoint" + ], + "entity_candidates": [], + "symbol_candidates": [], + "layers": [ + "D5_RELATION_GRAPH", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "filters": { + "doc_type": null + }, + "pipeline_mode": "pre_llm_only", + "gate_decision": "allow", + "prompt_used": "docs_explain_answer", + "llm_mode": "graph_summary", + "degraded_reason": null, + "code_intents_stubbed": true + } + }, + "pipeline_steps": [ + { + "step": "input_query", + "input": { + "query": "Какие документы связаны с архитектурой?" + }, + "output": { + "query": "Какие документы связаны с архитектурой?" + } + }, + { + "step": "router", + "input": { + "query": "Какие документы связаны с архитектурой?" + }, + "output": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "RELATED_DOCS_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START" + } + }, + { + "step": "docs_pipeline", + "input": { + "query": "Какие документы связаны с архитектурой?" + }, + "output": { + "answer_mode": "ready", + "prompt_name": "docs_explain_answer", + "llm_request": { + "prompt_name": "docs_explain_answer", + "log_context": "graph.project_qa.docs.answer", + "prompt_stats": { + "system_chars": 393, + "user_chars": 7994, + "tokens_in_estimate": 2097 + } + }, + "degraded_reason": "" + } + } + ] +} \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/docs_pre_llm_v3/20260326_121025/full_chain_docs_intents_v3-3x_v3-related-architecture-1.md b/tests/pipeline_setup_v3/test_results/docs_pre_llm_v3/20260326_121025/full_chain_docs_intents_v3-3x_v3-related-architecture-1.md new file mode 100644 index 0000000..ef5b057 --- /dev/null +++ b/tests/pipeline_setup_v3/test_results/docs_pre_llm_v3/20260326_121025/full_chain_docs_intents_v3-3x_v3-related-architecture-1.md @@ -0,0 +1,513 @@ +# v3-related-architecture-1 + +- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_03_docs/full_chain_docs_intents_v3-3x.yaml +- runner: agent_runtime +- mode: pre_llm +- passed: True + +## Query +Какие документы связаны с архитектурой? + +## Actual +{ + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "RELATED_DOCS_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START", + "rag_count": 14, + "llm_answer": "", + "answer_mode": "answered", + "path_scope": [], + "doc_scope": [ + "api.control_actions_endpoint", + "api.health_endpoint", + "api.send_message_endpoint" + ], + "entity_candidates": [], + "symbol_candidates": [], + "layers": [ + "D5_RELATION_GRAPH", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "filters": { + "doc_type": null + }, + "pipeline_mode": "pre_llm_only", + "gate_decision": "allow", + "prompt_used": "docs_explain_answer", + "llm_mode": "graph_summary", + "degraded_reason": null, + "code_intents_stubbed": true +} + +## Pipeline Steps +### input_query +```json +{ + "input": { + "query": "Какие документы связаны с архитектурой?" + }, + "output": { + "query": "Какие документы связаны с архитектурой?" + } +} +``` + +### router +```json +{ + "input": { + "query": "Какие документы связаны с архитектурой?" + }, + "output": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "RELATED_DOCS_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START" + } +} +``` + +### docs_pipeline +```json +{ + "input": { + "query": "Какие документы связаны с архитектурой?" + }, + "output": { + "answer_mode": "ready", + "prompt_name": "docs_explain_answer", + "llm_request": { + "prompt_name": "docs_explain_answer", + "log_context": "graph.project_qa.docs.answer", + "prompt_stats": { + "system_chars": 393, + "user_chars": 7994, + "tokens_in_estimate": 2097 + } + }, + "degraded_reason": "" + } +} +``` + +## Diagnostics +{ + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "RELATED_DOCS_EXPLAIN", + "layers_used": [ + "D5_RELATION_GRAPH", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "documents_found": 0, + "facts_found": 0, + "relations_found": 8, + "openapi_fields_extracted": 0, + "missing_required_fields": [], + "openapi_status": { + "has_path": false, + "has_method": false, + "has_request": false, + "has_response": false + }, + "prompt_used": "docs_explain_answer", + "llm_mode": "graph_summary", + "output_valid": true, + "matched_intent_source": "deterministic", + "matched_anchor_type": "none", + "matched_anchor_value": null, + "exact_anchor_match": false, + "docs_layers_requested": [ + "D5_RELATION_GRAPH", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "docs_layers_with_hits": [ + "D5_RELATION_GRAPH" + ], + "planned_layers": [ + "D5_RELATION_GRAPH", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "executed_layers": [ + "D5_RELATION_GRAPH" + ], + "non_empty_layers": [ + "D5_RELATION_GRAPH" + ], + "layer_diagnostics": { + "D5_RELATION_GRAPH": { + "hits": 8, + "top_ids": [ + "5f4909bde905cd3d294ad307074a05e4ae4deefcafe6272cd2d0436e73acb8dd", + "711fb2edb82dd222deaba3c91768b18cbbd453009235823282813c6e867dc2c1", + "eec79f7a02b804337e791ef231784862ae26e0599eb20224790e9d4f085fa9c0", + "c718b1939621233295ccaf6e8203e7fd94f3dd1bfb88f10c51bc5e33d53a24aa", + "616f5cbf25da83cb51d8d0741a7fc351620c9ca2c6513fa2094b4aa476f0912a" + ] + }, + "D1_DOCUMENT_CATALOG": { + "hits": 0, + "top_ids": [], + "skipped": true, + "reason": "relation_primary_sufficient" + }, + "D0_DOC_CHUNKS": { + "hits": 6, + "top_ids": [ + "api.control_actions_endpoint" + ] + } + }, + "query_entity_candidates": [], + "resolved_entity_candidates": [], + "query_anchor_candidates": [], + "resolved_anchor_candidates": [ + "docs/documentation/api/control-actions-endpoint.md", + "docs/documentation/api/health-endpoint.md", + "docs/documentation/api/send-message-endpoint.md", + "api.control_actions_endpoint" + ], + "anchor_candidates": [ + "api.control_actions_endpoint", + "api.health_endpoint", + "api.send_message_endpoint" + ], + "selected_anchor": "api.control_actions_endpoint", + "anchor_selection_reason": "relation_neighbor", + "anchor_match_type": "semantic_fallback", + "doc_ids": [ + "api.control_actions_endpoint", + "api.health_endpoint", + "api.send_message_endpoint" + ], + "doc_paths": [ + "docs/documentation/api/control-actions-endpoint.md", + "docs/documentation/api/health-endpoint.md", + "docs/documentation/api/send-message-endpoint.md" + ], + "doc_titles": [ + "api.control_actions_endpoint:part_of", + "api.control_actions_endpoint:related_api", + "api.control_actions_endpoint:related_logic", + "api.health_endpoint:parent", + "api.health_endpoint:part_of", + "api.health_endpoint:depends_on", + "api.send_message_endpoint:parent", + "api.control_actions_endpoint:parent", + "api.control_actions_endpoint:Summary", + "api.control_actions_endpoint:Описание", + "api.control_actions_endpoint:Сценарий", + "api.control_actions_endpoint:Функциональные требования", + "api.control_actions_endpoint:Нефункциональные требования", + "api.control_actions_endpoint:Входные параметры" + ], + "relation_hits_count": 8, + "relation_targets": [ + "api.control_actions_endpoint:part_of", + "api.control_actions_endpoint:related_api", + "api.control_actions_endpoint:related_logic", + "api.health_endpoint:parent", + "api.health_endpoint:part_of", + "api.health_endpoint:depends_on", + "api.send_message_endpoint:parent", + "api.control_actions_endpoint:parent" + ], + "fallback_doc_hits_count": 6, + "fallback_used": true, + "fact_hits": 0, + "entity_hits": 0, + "evidence_summary": { + "documents": 0, + "facts": 0, + "relations": 8, + "chunks": 6, + "entity_hits": 0, + "openapi_signals": { + "path_found": false, + "method_found": false, + "request_schema": false, + "response_schema": false, + "status_codes": false, + "payload_description": false + } + }, + "gate_decision": "allow", + "gate_decision_reason": "relation_evidence_available", + "gate_missing_requirements": [], + "gate_satisfied_requirements": [ + "retrieval_non_empty" + ], + "openapi_evidence": { + "path_found": false, + "method_found": false, + "request_schema": false, + "response_schema": false, + "status_codes": false, + "payload_description": false + }, + "requested_fragment_type": null, + "fragment_evidence_found": [], + "fragment_missing_requirements": [], + "answer_mode": "ready", + "degrade_reason": null, + "degraded_reason": null, + "code_intents_stubbed": false +} + +## LLM Request +- prompt_name: docs_explain_answer +- log_context: graph.project_qa.docs.answer + +### Prompt Stats +```json +{ + "system_chars": 393, + "user_chars": 7994, + "tokens_in_estimate": 2097 +} +``` + +### System Prompt +```text +Ты объясняешь документацию системы. + +На вход приходит JSON с полями: +- question +- intent +- sub_intent +- documents +- facts +- relations + +Правила: +- Используй только предоставленные факты +- Не додумывай +- Если данных недостаточно, скажи это явно +- Объясняй структурировано + +Формат ответа: +1. Краткое описание +2. Основные элементы +3. Как это работает +4. Связи с другими частями системы (если есть) +``` + +### User Prompt +```json +{ + "question": "Какие документы связаны с архитектурой?", + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "RELATED_DOCS_EXPLAIN", + "documents": [], + "facts": [], + "relations": [ + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "api.control_actions_endpoint:part_of", + "content": "api.control_actions_endpoint part_of architecture.telegram_notify_app", + "metadata": { + "owner": null, + "anchor": "frontmatter.links", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "source_id": "api.control_actions_endpoint", + "target_id": "architecture.telegram_notify_app", + "doc_version": null, + "relation_id": "5f4909bde905cd3d294ad307074a05e4ae4deefcafe6272cd2d0436e73acb8dd", + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "part_of", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "api.control_actions_endpoint:related_api", + "content": "api.control_actions_endpoint related_api api.health_endpoint", + "metadata": { + "owner": null, + "anchor": "frontmatter.links", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "source_id": "api.control_actions_endpoint", + "target_id": "api.health_endpoint", + "doc_version": null, + "relation_id": "711fb2edb82dd222deaba3c91768b18cbbd453009235823282813c6e867dc2c1", + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "related_api", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "api.control_actions_endpoint:related_logic", + "content": "api.control_actions_endpoint related_logic logic.telegram_notification_loop", + "metadata": { + "owner": null, + "anchor": "frontmatter.links", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "source_id": "api.control_actions_endpoint", + "target_id": "logic.telegram_notification_loop", + "doc_version": null, + "relation_id": "eec79f7a02b804337e791ef231784862ae26e0599eb20224790e9d4f085fa9c0", + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "related_logic", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/api/health-endpoint.md", + "title": "api.health_endpoint:parent", + "content": "api.health_endpoint parent architecture.telegram_notify_app", + "metadata": { + "owner": null, + "anchor": "frontmatter.parent", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "8b5a533a8076e2e9d36995eee29aeade260080bdca2ec8e21fe28f08574b983f", + "source_id": "api.health_endpoint", + "target_id": "architecture.telegram_notify_app", + "doc_version": null, + "relation_id": "c718b1939621233295ccaf6e8203e7fd94f3dd1bfb88f10c51bc5e33d53a24aa", + "source_path": "docs/documentation/api/health-endpoint.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "parent", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/api/health-endpoint.md", + "title": "api.health_endpoint:part_of", + "content": "api.health_endpoint part_of architecture.telegram_notify_app", + "metadata": { + "owner": null, + "anchor": "frontmatter.links", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "8b5a533a8076e2e9d36995eee29aeade260080bdca2ec8e21fe28f08574b983f", + "source_id": "api.health_endpoint", + "target_id": "architecture.telegram_notify_app", + "doc_version": null, + "relation_id": "616f5cbf25da83cb51d8d0741a7fc351620c9ca2c6513fa2094b4aa476f0912a", + "source_path": "docs/documentation/api/health-endpoint.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "part_of", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/api/health-endpoint.md", + "title": "api.health_endpoint:depends_on", + "content": "api.health_endpoint depends_on domain.runtime_health", + "metadata": { + "owner": null, + "anchor": "frontmatter.links", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "8b5a533a8076e2e9d36995eee29aeade260080bdca2ec8e21fe28f08574b983f", + "source_id": "api.health_endpoint", + "target_id": "domain.runtime_health", + "doc_version": null, + "relation_id": "77f5d358ab85b3d92018b6b51da7c39773148dfd346686e8832a45370c841160", + "source_path": "docs/documentation/api/health-endpoint.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "depends_on", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/api/send-message-endpoint.md", + "title": "api.send_message_endpoint:parent", + "content": "api.send_message_endpoint parent architecture.telegram_notify_app", + "metadata": { + "owner": null, + "anchor": "frontmatter.parent", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "5fbf2e33510b0676a3a53b957a4569bd3c2c31fb7719546602c573421ccaa32d", + "source_id": "api.send_message_endpoint", + "target_id": "architecture.telegram_notify_app", + "doc_version": null, + "relation_id": "33eb0aa97f06d0afcaa4c230b5f5b73fa2fbfa5861ea9367b6c92f8a6fe0c054", + "source_path": "docs/documentation/api/send-message-endpoint.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "parent", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "api.control_actions_endpoint:parent", + "content": "api.control_actions_endpoint parent architecture.telegram_notify_app", + "metadata": { + "owner": null, + "anchor": "frontmatter.parent", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "source_id": "api.control_actions_endpoint", + "target_id": "architecture.telegram_notify_app", + "doc_version": null, + "relation_id": "afec31fd062e392dcd9699a92c7ab61fd4b1273c1a2b16702b23d55d8d0c47ac", + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "parent", + "staleness_score": null, + "system_component": null + } + } + ] +} +``` + +### User Prompt Overview +- question: Какие документы связаны с архитектурой? +- intent: DOCUMENTATION_EXPLAIN +- sub_intent: RELATED_DOCS_EXPLAIN +- documents: 0 +- facts: 0 +- relations: 8 | samples: api.control_actions_endpoint:part_of, api.control_actions_endpoint:related_api, api.control_actions_endpoint:related_logic + +## Mismatches +- none \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/docs_pre_llm_v3/20260326_121025/full_chain_docs_intents_v3-3x_v3-related-health-1.json b/tests/pipeline_setup_v3/test_results/docs_pre_llm_v3/20260326_121025/full_chain_docs_intents_v3-3x_v3-related-health-1.json new file mode 100644 index 0000000..1faf371 --- /dev/null +++ b/tests/pipeline_setup_v3/test_results/docs_pre_llm_v3/20260326_121025/full_chain_docs_intents_v3-3x_v3-related-health-1.json @@ -0,0 +1,84 @@ +{ + "meta": { + "case_id": "v3-related-health-1", + "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_03_docs/full_chain_docs_intents_v3-3x.yaml", + "runner": "agent_runtime", + "mode": "pre_llm", + "passed": true, + "mismatches": [], + "actual": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "RELATED_DOCS_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START", + "rag_count": 14, + "llm_answer": "", + "answer_mode": "answered", + "path_scope": [], + "doc_scope": [ + "api.health_endpoint", + "domain.runtime_health", + "api.control_actions_endpoint" + ], + "entity_candidates": [], + "symbol_candidates": [], + "layers": [ + "D5_RELATION_GRAPH", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "filters": { + "doc_type": null + }, + "pipeline_mode": "pre_llm_only", + "gate_decision": "allow", + "prompt_used": "docs_explain_answer", + "llm_mode": "graph_summary", + "degraded_reason": null, + "code_intents_stubbed": true + } + }, + "pipeline_steps": [ + { + "step": "input_query", + "input": { + "query": "Что связано с /health?" + }, + "output": { + "query": "Что связано с /health?" + } + }, + { + "step": "router", + "input": { + "query": "Что связано с /health?" + }, + "output": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "RELATED_DOCS_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START" + } + }, + { + "step": "docs_pipeline", + "input": { + "query": "Что связано с /health?" + }, + "output": { + "answer_mode": "ready", + "prompt_name": "docs_explain_answer", + "llm_request": { + "prompt_name": "docs_explain_answer", + "log_context": "graph.project_qa.docs.answer", + "prompt_stats": { + "system_chars": 393, + "user_chars": 7884, + "tokens_in_estimate": 2070 + } + }, + "degraded_reason": "" + } + } + ] +} \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/docs_pre_llm_v3/20260326_121025/full_chain_docs_intents_v3-3x_v3-related-health-1.md b/tests/pipeline_setup_v3/test_results/docs_pre_llm_v3/20260326_121025/full_chain_docs_intents_v3-3x_v3-related-health-1.md new file mode 100644 index 0000000..5ccb24d --- /dev/null +++ b/tests/pipeline_setup_v3/test_results/docs_pre_llm_v3/20260326_121025/full_chain_docs_intents_v3-3x_v3-related-health-1.md @@ -0,0 +1,516 @@ +# v3-related-health-1 + +- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_03_docs/full_chain_docs_intents_v3-3x.yaml +- runner: agent_runtime +- mode: pre_llm +- passed: True + +## Query +Что связано с /health? + +## Actual +{ + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "RELATED_DOCS_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START", + "rag_count": 14, + "llm_answer": "", + "answer_mode": "answered", + "path_scope": [], + "doc_scope": [ + "api.health_endpoint", + "domain.runtime_health", + "api.control_actions_endpoint" + ], + "entity_candidates": [], + "symbol_candidates": [], + "layers": [ + "D5_RELATION_GRAPH", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "filters": { + "doc_type": null + }, + "pipeline_mode": "pre_llm_only", + "gate_decision": "allow", + "prompt_used": "docs_explain_answer", + "llm_mode": "graph_summary", + "degraded_reason": null, + "code_intents_stubbed": true +} + +## Pipeline Steps +### input_query +```json +{ + "input": { + "query": "Что связано с /health?" + }, + "output": { + "query": "Что связано с /health?" + } +} +``` + +### router +```json +{ + "input": { + "query": "Что связано с /health?" + }, + "output": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "RELATED_DOCS_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START" + } +} +``` + +### docs_pipeline +```json +{ + "input": { + "query": "Что связано с /health?" + }, + "output": { + "answer_mode": "ready", + "prompt_name": "docs_explain_answer", + "llm_request": { + "prompt_name": "docs_explain_answer", + "log_context": "graph.project_qa.docs.answer", + "prompt_stats": { + "system_chars": 393, + "user_chars": 7884, + "tokens_in_estimate": 2070 + } + }, + "degraded_reason": "" + } +} +``` + +## Diagnostics +{ + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "RELATED_DOCS_EXPLAIN", + "layers_used": [ + "D5_RELATION_GRAPH", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "documents_found": 0, + "facts_found": 0, + "relations_found": 8, + "openapi_fields_extracted": 0, + "missing_required_fields": [], + "openapi_status": { + "has_path": false, + "has_method": false, + "has_request": false, + "has_response": false + }, + "prompt_used": "docs_explain_answer", + "llm_mode": "graph_summary", + "output_valid": true, + "matched_intent_source": "deterministic", + "matched_anchor_type": "endpoint", + "matched_anchor_value": "/health", + "exact_anchor_match": false, + "docs_layers_requested": [ + "D5_RELATION_GRAPH", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "docs_layers_with_hits": [ + "D5_RELATION_GRAPH" + ], + "planned_layers": [ + "D5_RELATION_GRAPH", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "executed_layers": [ + "D5_RELATION_GRAPH" + ], + "non_empty_layers": [ + "D5_RELATION_GRAPH" + ], + "layer_diagnostics": { + "D5_RELATION_GRAPH": { + "hits": 8, + "top_ids": [ + "801650f8bcbfbfbefd35c14447bfef7b3c3827313db790efa7faf47db860f8c4", + "8595d7b82fecdb7ef579fa8961cda6799bb21970061e5bc221d4dd7a3d53fd04", + "af2a4f7c1b677b908410ba720915405e10dbd0870e30a3c6e3aa2468550ddf0e", + "c718b1939621233295ccaf6e8203e7fd94f3dd1bfb88f10c51bc5e33d53a24aa", + "616f5cbf25da83cb51d8d0741a7fc351620c9ca2c6513fa2094b4aa476f0912a" + ] + }, + "D1_DOCUMENT_CATALOG": { + "hits": 0, + "top_ids": [], + "skipped": true, + "reason": "relation_primary_sufficient" + }, + "D0_DOC_CHUNKS": { + "hits": 6, + "top_ids": [ + "api.control_actions_endpoint" + ] + } + }, + "query_entity_candidates": [], + "resolved_entity_candidates": [], + "query_anchor_candidates": [ + "/health" + ], + "resolved_anchor_candidates": [ + "docs/documentation/domain/runtime-health-entity.md", + "docs/documentation/api/health-endpoint.md", + "docs/documentation/api/control-actions-endpoint.md", + "api.control_actions_endpoint" + ], + "anchor_candidates": [ + "api.health_endpoint", + "domain.runtime_health", + "api.control_actions_endpoint" + ], + "selected_anchor": "api.health_endpoint", + "anchor_selection_reason": "doc_id matches requested endpoint slug", + "anchor_match_type": "exact_path", + "doc_ids": [ + "api.health_endpoint", + "domain.runtime_health", + "api.control_actions_endpoint" + ], + "doc_paths": [ + "docs/documentation/domain/runtime-health-entity.md", + "docs/documentation/api/health-endpoint.md", + "docs/documentation/api/control-actions-endpoint.md" + ], + "doc_titles": [ + "domain.runtime_health:used_by", + "domain.runtime_health:related_logic", + "domain.runtime_health:part_of", + "api.health_endpoint:parent", + "api.health_endpoint:part_of", + "api.health_endpoint:depends_on", + "domain.runtime_health:parent", + "api.control_actions_endpoint:related_api", + "api.control_actions_endpoint:Summary", + "api.control_actions_endpoint:Описание", + "api.control_actions_endpoint:Сценарий", + "api.control_actions_endpoint:Функциональные требования", + "api.control_actions_endpoint:Нефункциональные требования", + "api.control_actions_endpoint:Входные параметры" + ], + "relation_hits_count": 8, + "relation_targets": [ + "domain.runtime_health:used_by", + "domain.runtime_health:related_logic", + "domain.runtime_health:part_of", + "api.health_endpoint:parent", + "api.health_endpoint:part_of", + "api.health_endpoint:depends_on", + "domain.runtime_health:parent", + "api.control_actions_endpoint:related_api" + ], + "fallback_doc_hits_count": 6, + "fallback_used": true, + "fact_hits": 0, + "entity_hits": 0, + "evidence_summary": { + "documents": 0, + "facts": 0, + "relations": 8, + "chunks": 6, + "entity_hits": 0, + "openapi_signals": { + "path_found": false, + "method_found": false, + "request_schema": false, + "response_schema": false, + "status_codes": false, + "payload_description": false + } + }, + "gate_decision": "allow", + "gate_decision_reason": "relation_evidence_available", + "gate_missing_requirements": [], + "gate_satisfied_requirements": [ + "retrieval_non_empty", + "exact_anchor_match" + ], + "openapi_evidence": { + "path_found": false, + "method_found": false, + "request_schema": false, + "response_schema": false, + "status_codes": false, + "payload_description": false + }, + "requested_fragment_type": null, + "fragment_evidence_found": [], + "fragment_missing_requirements": [], + "answer_mode": "ready", + "degrade_reason": null, + "degraded_reason": null, + "code_intents_stubbed": false +} + +## LLM Request +- prompt_name: docs_explain_answer +- log_context: graph.project_qa.docs.answer + +### Prompt Stats +```json +{ + "system_chars": 393, + "user_chars": 7884, + "tokens_in_estimate": 2070 +} +``` + +### System Prompt +```text +Ты объясняешь документацию системы. + +На вход приходит JSON с полями: +- question +- intent +- sub_intent +- documents +- facts +- relations + +Правила: +- Используй только предоставленные факты +- Не додумывай +- Если данных недостаточно, скажи это явно +- Объясняй структурировано + +Формат ответа: +1. Краткое описание +2. Основные элементы +3. Как это работает +4. Связи с другими частями системы (если есть) +``` + +### User Prompt +```json +{ + "question": "Что связано с /health?", + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "RELATED_DOCS_EXPLAIN", + "documents": [], + "facts": [], + "relations": [ + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/domain/runtime-health-entity.md", + "title": "domain.runtime_health:used_by", + "content": "domain.runtime_health used_by api.health_endpoint", + "metadata": { + "owner": null, + "anchor": "frontmatter.links", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "37d4dcf470ea3de95d59e44786006e369a3ea11bf5dbf4c88877696e9183ee87", + "source_id": "domain.runtime_health", + "target_id": "api.health_endpoint", + "doc_version": null, + "relation_id": "801650f8bcbfbfbefd35c14447bfef7b3c3827313db790efa7faf47db860f8c4", + "source_path": "docs/documentation/domain/runtime-health-entity.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "used_by", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/domain/runtime-health-entity.md", + "title": "domain.runtime_health:related_logic", + "content": "domain.runtime_health related_logic logic.telegram_notification_loop", + "metadata": { + "owner": null, + "anchor": "frontmatter.links", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "37d4dcf470ea3de95d59e44786006e369a3ea11bf5dbf4c88877696e9183ee87", + "source_id": "domain.runtime_health", + "target_id": "logic.telegram_notification_loop", + "doc_version": null, + "relation_id": "8595d7b82fecdb7ef579fa8961cda6799bb21970061e5bc221d4dd7a3d53fd04", + "source_path": "docs/documentation/domain/runtime-health-entity.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "related_logic", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/domain/runtime-health-entity.md", + "title": "domain.runtime_health:part_of", + "content": "domain.runtime_health part_of architecture.telegram_notify_app", + "metadata": { + "owner": null, + "anchor": "frontmatter.links", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "37d4dcf470ea3de95d59e44786006e369a3ea11bf5dbf4c88877696e9183ee87", + "source_id": "domain.runtime_health", + "target_id": "architecture.telegram_notify_app", + "doc_version": null, + "relation_id": "af2a4f7c1b677b908410ba720915405e10dbd0870e30a3c6e3aa2468550ddf0e", + "source_path": "docs/documentation/domain/runtime-health-entity.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "part_of", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/api/health-endpoint.md", + "title": "api.health_endpoint:parent", + "content": "api.health_endpoint parent architecture.telegram_notify_app", + "metadata": { + "owner": null, + "anchor": "frontmatter.parent", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "8b5a533a8076e2e9d36995eee29aeade260080bdca2ec8e21fe28f08574b983f", + "source_id": "api.health_endpoint", + "target_id": "architecture.telegram_notify_app", + "doc_version": null, + "relation_id": "c718b1939621233295ccaf6e8203e7fd94f3dd1bfb88f10c51bc5e33d53a24aa", + "source_path": "docs/documentation/api/health-endpoint.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "parent", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/api/health-endpoint.md", + "title": "api.health_endpoint:part_of", + "content": "api.health_endpoint part_of architecture.telegram_notify_app", + "metadata": { + "owner": null, + "anchor": "frontmatter.links", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "8b5a533a8076e2e9d36995eee29aeade260080bdca2ec8e21fe28f08574b983f", + "source_id": "api.health_endpoint", + "target_id": "architecture.telegram_notify_app", + "doc_version": null, + "relation_id": "616f5cbf25da83cb51d8d0741a7fc351620c9ca2c6513fa2094b4aa476f0912a", + "source_path": "docs/documentation/api/health-endpoint.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "part_of", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/api/health-endpoint.md", + "title": "api.health_endpoint:depends_on", + "content": "api.health_endpoint depends_on domain.runtime_health", + "metadata": { + "owner": null, + "anchor": "frontmatter.links", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "8b5a533a8076e2e9d36995eee29aeade260080bdca2ec8e21fe28f08574b983f", + "source_id": "api.health_endpoint", + "target_id": "domain.runtime_health", + "doc_version": null, + "relation_id": "77f5d358ab85b3d92018b6b51da7c39773148dfd346686e8832a45370c841160", + "source_path": "docs/documentation/api/health-endpoint.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "depends_on", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/domain/runtime-health-entity.md", + "title": "domain.runtime_health:parent", + "content": "domain.runtime_health parent architecture.telegram_notify_app", + "metadata": { + "owner": null, + "anchor": "frontmatter.parent", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "37d4dcf470ea3de95d59e44786006e369a3ea11bf5dbf4c88877696e9183ee87", + "source_id": "domain.runtime_health", + "target_id": "architecture.telegram_notify_app", + "doc_version": null, + "relation_id": "79bdb0a74713df6064008179ca8c5c186dc23e4e1c5e2c9607b0bdddeba50f93", + "source_path": "docs/documentation/domain/runtime-health-entity.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "parent", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "api.control_actions_endpoint:related_api", + "content": "api.control_actions_endpoint related_api api.health_endpoint", + "metadata": { + "owner": null, + "anchor": "frontmatter.links", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "source_id": "api.control_actions_endpoint", + "target_id": "api.health_endpoint", + "doc_version": null, + "relation_id": "711fb2edb82dd222deaba3c91768b18cbbd453009235823282813c6e867dc2c1", + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "related_api", + "staleness_score": null, + "system_component": null + } + } + ] +} +``` + +### User Prompt Overview +- question: Что связано с /health? +- intent: DOCUMENTATION_EXPLAIN +- sub_intent: RELATED_DOCS_EXPLAIN +- documents: 0 +- facts: 0 +- relations: 8 | samples: domain.runtime_health:used_by, domain.runtime_health:related_logic, domain.runtime_health:part_of + +## Mismatches +- none \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/docs_pre_llm_v3/20260326_121025/full_chain_docs_intents_v3-3x_v3-related-health-2.json b/tests/pipeline_setup_v3/test_results/docs_pre_llm_v3/20260326_121025/full_chain_docs_intents_v3-3x_v3-related-health-2.json new file mode 100644 index 0000000..1115fd3 --- /dev/null +++ b/tests/pipeline_setup_v3/test_results/docs_pre_llm_v3/20260326_121025/full_chain_docs_intents_v3-3x_v3-related-health-2.json @@ -0,0 +1,84 @@ +{ + "meta": { + "case_id": "v3-related-health-2", + "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_03_docs/full_chain_docs_intents_v3-3x.yaml", + "runner": "agent_runtime", + "mode": "pre_llm", + "passed": true, + "mismatches": [], + "actual": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "RELATED_DOCS_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START", + "rag_count": 14, + "llm_answer": "", + "answer_mode": "answered", + "path_scope": [], + "doc_scope": [ + "api.control_actions_endpoint", + "api.health_endpoint", + "api.send_message_endpoint" + ], + "entity_candidates": [], + "symbol_candidates": [], + "layers": [ + "D5_RELATION_GRAPH", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "filters": { + "doc_type": null + }, + "pipeline_mode": "pre_llm_only", + "gate_decision": "allow", + "prompt_used": "docs_explain_answer", + "llm_mode": "graph_summary", + "degraded_reason": null, + "code_intents_stubbed": true + } + }, + "pipeline_steps": [ + { + "step": "input_query", + "input": { + "query": "Какие документы относятся к health endpoint?" + }, + "output": { + "query": "Какие документы относятся к health endpoint?" + } + }, + { + "step": "router", + "input": { + "query": "Какие документы относятся к health endpoint?" + }, + "output": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "RELATED_DOCS_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START" + } + }, + { + "step": "docs_pipeline", + "input": { + "query": "Какие документы относятся к health endpoint?" + }, + "output": { + "answer_mode": "ready", + "prompt_name": "docs_explain_answer", + "llm_request": { + "prompt_name": "docs_explain_answer", + "log_context": "graph.project_qa.docs.answer", + "prompt_stats": { + "system_chars": 393, + "user_chars": 7999, + "tokens_in_estimate": 2098 + } + }, + "degraded_reason": "" + } + } + ] +} \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/docs_pre_llm_v3/20260326_121025/full_chain_docs_intents_v3-3x_v3-related-health-2.md b/tests/pipeline_setup_v3/test_results/docs_pre_llm_v3/20260326_121025/full_chain_docs_intents_v3-3x_v3-related-health-2.md new file mode 100644 index 0000000..d4f15d9 --- /dev/null +++ b/tests/pipeline_setup_v3/test_results/docs_pre_llm_v3/20260326_121025/full_chain_docs_intents_v3-3x_v3-related-health-2.md @@ -0,0 +1,513 @@ +# v3-related-health-2 + +- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_03_docs/full_chain_docs_intents_v3-3x.yaml +- runner: agent_runtime +- mode: pre_llm +- passed: True + +## Query +Какие документы относятся к health endpoint? + +## Actual +{ + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "RELATED_DOCS_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START", + "rag_count": 14, + "llm_answer": "", + "answer_mode": "answered", + "path_scope": [], + "doc_scope": [ + "api.control_actions_endpoint", + "api.health_endpoint", + "api.send_message_endpoint" + ], + "entity_candidates": [], + "symbol_candidates": [], + "layers": [ + "D5_RELATION_GRAPH", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "filters": { + "doc_type": null + }, + "pipeline_mode": "pre_llm_only", + "gate_decision": "allow", + "prompt_used": "docs_explain_answer", + "llm_mode": "graph_summary", + "degraded_reason": null, + "code_intents_stubbed": true +} + +## Pipeline Steps +### input_query +```json +{ + "input": { + "query": "Какие документы относятся к health endpoint?" + }, + "output": { + "query": "Какие документы относятся к health endpoint?" + } +} +``` + +### router +```json +{ + "input": { + "query": "Какие документы относятся к health endpoint?" + }, + "output": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "RELATED_DOCS_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START" + } +} +``` + +### docs_pipeline +```json +{ + "input": { + "query": "Какие документы относятся к health endpoint?" + }, + "output": { + "answer_mode": "ready", + "prompt_name": "docs_explain_answer", + "llm_request": { + "prompt_name": "docs_explain_answer", + "log_context": "graph.project_qa.docs.answer", + "prompt_stats": { + "system_chars": 393, + "user_chars": 7999, + "tokens_in_estimate": 2098 + } + }, + "degraded_reason": "" + } +} +``` + +## Diagnostics +{ + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "RELATED_DOCS_EXPLAIN", + "layers_used": [ + "D5_RELATION_GRAPH", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "documents_found": 0, + "facts_found": 0, + "relations_found": 8, + "openapi_fields_extracted": 0, + "missing_required_fields": [], + "openapi_status": { + "has_path": false, + "has_method": false, + "has_request": false, + "has_response": false + }, + "prompt_used": "docs_explain_answer", + "llm_mode": "graph_summary", + "output_valid": true, + "matched_intent_source": "deterministic", + "matched_anchor_type": "topic", + "matched_anchor_value": null, + "exact_anchor_match": false, + "docs_layers_requested": [ + "D5_RELATION_GRAPH", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "docs_layers_with_hits": [ + "D5_RELATION_GRAPH" + ], + "planned_layers": [ + "D5_RELATION_GRAPH", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "executed_layers": [ + "D5_RELATION_GRAPH" + ], + "non_empty_layers": [ + "D5_RELATION_GRAPH" + ], + "layer_diagnostics": { + "D5_RELATION_GRAPH": { + "hits": 8, + "top_ids": [ + "5f4909bde905cd3d294ad307074a05e4ae4deefcafe6272cd2d0436e73acb8dd", + "711fb2edb82dd222deaba3c91768b18cbbd453009235823282813c6e867dc2c1", + "eec79f7a02b804337e791ef231784862ae26e0599eb20224790e9d4f085fa9c0", + "c718b1939621233295ccaf6e8203e7fd94f3dd1bfb88f10c51bc5e33d53a24aa", + "616f5cbf25da83cb51d8d0741a7fc351620c9ca2c6513fa2094b4aa476f0912a" + ] + }, + "D1_DOCUMENT_CATALOG": { + "hits": 0, + "top_ids": [], + "skipped": true, + "reason": "relation_primary_sufficient" + }, + "D0_DOC_CHUNKS": { + "hits": 6, + "top_ids": [ + "api.control_actions_endpoint" + ] + } + }, + "query_entity_candidates": [], + "resolved_entity_candidates": [], + "query_anchor_candidates": [], + "resolved_anchor_candidates": [ + "docs/documentation/api/control-actions-endpoint.md", + "docs/documentation/api/health-endpoint.md", + "docs/documentation/api/send-message-endpoint.md", + "api.control_actions_endpoint" + ], + "anchor_candidates": [ + "api.control_actions_endpoint", + "api.health_endpoint", + "api.send_message_endpoint" + ], + "selected_anchor": "api.control_actions_endpoint", + "anchor_selection_reason": "relation_neighbor", + "anchor_match_type": "semantic_fallback", + "doc_ids": [ + "api.control_actions_endpoint", + "api.health_endpoint", + "api.send_message_endpoint" + ], + "doc_paths": [ + "docs/documentation/api/control-actions-endpoint.md", + "docs/documentation/api/health-endpoint.md", + "docs/documentation/api/send-message-endpoint.md" + ], + "doc_titles": [ + "api.control_actions_endpoint:part_of", + "api.control_actions_endpoint:related_api", + "api.control_actions_endpoint:related_logic", + "api.health_endpoint:parent", + "api.health_endpoint:part_of", + "api.health_endpoint:depends_on", + "api.send_message_endpoint:parent", + "api.control_actions_endpoint:parent", + "api.control_actions_endpoint:Summary", + "api.control_actions_endpoint:Описание", + "api.control_actions_endpoint:Сценарий", + "api.control_actions_endpoint:Функциональные требования", + "api.control_actions_endpoint:Нефункциональные требования", + "api.control_actions_endpoint:Входные параметры" + ], + "relation_hits_count": 8, + "relation_targets": [ + "api.control_actions_endpoint:part_of", + "api.control_actions_endpoint:related_api", + "api.control_actions_endpoint:related_logic", + "api.health_endpoint:parent", + "api.health_endpoint:part_of", + "api.health_endpoint:depends_on", + "api.send_message_endpoint:parent", + "api.control_actions_endpoint:parent" + ], + "fallback_doc_hits_count": 6, + "fallback_used": true, + "fact_hits": 0, + "entity_hits": 0, + "evidence_summary": { + "documents": 0, + "facts": 0, + "relations": 8, + "chunks": 6, + "entity_hits": 0, + "openapi_signals": { + "path_found": false, + "method_found": false, + "request_schema": false, + "response_schema": false, + "status_codes": false, + "payload_description": false + } + }, + "gate_decision": "allow", + "gate_decision_reason": "relation_evidence_available", + "gate_missing_requirements": [], + "gate_satisfied_requirements": [ + "retrieval_non_empty" + ], + "openapi_evidence": { + "path_found": false, + "method_found": false, + "request_schema": false, + "response_schema": false, + "status_codes": false, + "payload_description": false + }, + "requested_fragment_type": null, + "fragment_evidence_found": [], + "fragment_missing_requirements": [], + "answer_mode": "ready", + "degrade_reason": null, + "degraded_reason": null, + "code_intents_stubbed": false +} + +## LLM Request +- prompt_name: docs_explain_answer +- log_context: graph.project_qa.docs.answer + +### Prompt Stats +```json +{ + "system_chars": 393, + "user_chars": 7999, + "tokens_in_estimate": 2098 +} +``` + +### System Prompt +```text +Ты объясняешь документацию системы. + +На вход приходит JSON с полями: +- question +- intent +- sub_intent +- documents +- facts +- relations + +Правила: +- Используй только предоставленные факты +- Не додумывай +- Если данных недостаточно, скажи это явно +- Объясняй структурировано + +Формат ответа: +1. Краткое описание +2. Основные элементы +3. Как это работает +4. Связи с другими частями системы (если есть) +``` + +### User Prompt +```json +{ + "question": "Какие документы относятся к health endpoint?", + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "RELATED_DOCS_EXPLAIN", + "documents": [], + "facts": [], + "relations": [ + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "api.control_actions_endpoint:part_of", + "content": "api.control_actions_endpoint part_of architecture.telegram_notify_app", + "metadata": { + "owner": null, + "anchor": "frontmatter.links", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "source_id": "api.control_actions_endpoint", + "target_id": "architecture.telegram_notify_app", + "doc_version": null, + "relation_id": "5f4909bde905cd3d294ad307074a05e4ae4deefcafe6272cd2d0436e73acb8dd", + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "part_of", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "api.control_actions_endpoint:related_api", + "content": "api.control_actions_endpoint related_api api.health_endpoint", + "metadata": { + "owner": null, + "anchor": "frontmatter.links", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "source_id": "api.control_actions_endpoint", + "target_id": "api.health_endpoint", + "doc_version": null, + "relation_id": "711fb2edb82dd222deaba3c91768b18cbbd453009235823282813c6e867dc2c1", + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "related_api", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "api.control_actions_endpoint:related_logic", + "content": "api.control_actions_endpoint related_logic logic.telegram_notification_loop", + "metadata": { + "owner": null, + "anchor": "frontmatter.links", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "source_id": "api.control_actions_endpoint", + "target_id": "logic.telegram_notification_loop", + "doc_version": null, + "relation_id": "eec79f7a02b804337e791ef231784862ae26e0599eb20224790e9d4f085fa9c0", + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "related_logic", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/api/health-endpoint.md", + "title": "api.health_endpoint:parent", + "content": "api.health_endpoint parent architecture.telegram_notify_app", + "metadata": { + "owner": null, + "anchor": "frontmatter.parent", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "8b5a533a8076e2e9d36995eee29aeade260080bdca2ec8e21fe28f08574b983f", + "source_id": "api.health_endpoint", + "target_id": "architecture.telegram_notify_app", + "doc_version": null, + "relation_id": "c718b1939621233295ccaf6e8203e7fd94f3dd1bfb88f10c51bc5e33d53a24aa", + "source_path": "docs/documentation/api/health-endpoint.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "parent", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/api/health-endpoint.md", + "title": "api.health_endpoint:part_of", + "content": "api.health_endpoint part_of architecture.telegram_notify_app", + "metadata": { + "owner": null, + "anchor": "frontmatter.links", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "8b5a533a8076e2e9d36995eee29aeade260080bdca2ec8e21fe28f08574b983f", + "source_id": "api.health_endpoint", + "target_id": "architecture.telegram_notify_app", + "doc_version": null, + "relation_id": "616f5cbf25da83cb51d8d0741a7fc351620c9ca2c6513fa2094b4aa476f0912a", + "source_path": "docs/documentation/api/health-endpoint.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "part_of", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/api/health-endpoint.md", + "title": "api.health_endpoint:depends_on", + "content": "api.health_endpoint depends_on domain.runtime_health", + "metadata": { + "owner": null, + "anchor": "frontmatter.links", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "8b5a533a8076e2e9d36995eee29aeade260080bdca2ec8e21fe28f08574b983f", + "source_id": "api.health_endpoint", + "target_id": "domain.runtime_health", + "doc_version": null, + "relation_id": "77f5d358ab85b3d92018b6b51da7c39773148dfd346686e8832a45370c841160", + "source_path": "docs/documentation/api/health-endpoint.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "depends_on", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/api/send-message-endpoint.md", + "title": "api.send_message_endpoint:parent", + "content": "api.send_message_endpoint parent architecture.telegram_notify_app", + "metadata": { + "owner": null, + "anchor": "frontmatter.parent", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "5fbf2e33510b0676a3a53b957a4569bd3c2c31fb7719546602c573421ccaa32d", + "source_id": "api.send_message_endpoint", + "target_id": "architecture.telegram_notify_app", + "doc_version": null, + "relation_id": "33eb0aa97f06d0afcaa4c230b5f5b73fa2fbfa5861ea9367b6c92f8a6fe0c054", + "source_path": "docs/documentation/api/send-message-endpoint.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "parent", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "api.control_actions_endpoint:parent", + "content": "api.control_actions_endpoint parent architecture.telegram_notify_app", + "metadata": { + "owner": null, + "anchor": "frontmatter.parent", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "source_id": "api.control_actions_endpoint", + "target_id": "architecture.telegram_notify_app", + "doc_version": null, + "relation_id": "afec31fd062e392dcd9699a92c7ab61fd4b1273c1a2b16702b23d55d8d0c47ac", + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "parent", + "staleness_score": null, + "system_component": null + } + } + ] +} +``` + +### User Prompt Overview +- question: Какие документы относятся к health endpoint? +- intent: DOCUMENTATION_EXPLAIN +- sub_intent: RELATED_DOCS_EXPLAIN +- documents: 0 +- facts: 0 +- relations: 8 | samples: api.control_actions_endpoint:part_of, api.control_actions_endpoint:related_api, api.control_actions_endpoint:related_logic + +## Mismatches +- none \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/docs_pre_llm_v3/20260326_121025/full_chain_docs_intents_v3-3x_v3-related-send-1.json b/tests/pipeline_setup_v3/test_results/docs_pre_llm_v3/20260326_121025/full_chain_docs_intents_v3-3x_v3-related-send-1.json new file mode 100644 index 0000000..c9caa6a --- /dev/null +++ b/tests/pipeline_setup_v3/test_results/docs_pre_llm_v3/20260326_121025/full_chain_docs_intents_v3-3x_v3-related-send-1.json @@ -0,0 +1,85 @@ +{ + "meta": { + "case_id": "v3-related-send-1", + "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_03_docs/full_chain_docs_intents_v3-3x.yaml", + "runner": "agent_runtime", + "mode": "pre_llm", + "passed": true, + "mismatches": [], + "actual": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "RELATED_DOCS_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START", + "rag_count": 14, + "llm_answer": "", + "answer_mode": "answered", + "path_scope": [], + "doc_scope": [ + "api.send_message_endpoint", + "architecture.telegram_notify_app_overview", + "logic.telegram_notification_loop", + "api.health_endpoint" + ], + "entity_candidates": [], + "symbol_candidates": [], + "layers": [ + "D5_RELATION_GRAPH", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "filters": { + "doc_type": null + }, + "pipeline_mode": "pre_llm_only", + "gate_decision": "allow", + "prompt_used": "docs_explain_answer", + "llm_mode": "graph_summary", + "degraded_reason": null, + "code_intents_stubbed": true + } + }, + "pipeline_steps": [ + { + "step": "input_query", + "input": { + "query": "Какие документы связаны с /send?" + }, + "output": { + "query": "Какие документы связаны с /send?" + } + }, + { + "step": "router", + "input": { + "query": "Какие документы связаны с /send?" + }, + "output": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "RELATED_DOCS_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START" + } + }, + { + "step": "docs_pipeline", + "input": { + "query": "Какие документы связаны с /send?" + }, + "output": { + "answer_mode": "ready", + "prompt_name": "docs_explain_answer", + "llm_request": { + "prompt_name": "docs_explain_answer", + "log_context": "graph.project_qa.docs.answer", + "prompt_stats": { + "system_chars": 393, + "user_chars": 8086, + "tokens_in_estimate": 2120 + } + }, + "degraded_reason": "" + } + } + ] +} \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/docs_pre_llm_v3/20260326_121025/full_chain_docs_intents_v3-3x_v3-related-send-1.md b/tests/pipeline_setup_v3/test_results/docs_pre_llm_v3/20260326_121025/full_chain_docs_intents_v3-3x_v3-related-send-1.md new file mode 100644 index 0000000..8df42cc --- /dev/null +++ b/tests/pipeline_setup_v3/test_results/docs_pre_llm_v3/20260326_121025/full_chain_docs_intents_v3-3x_v3-related-send-1.md @@ -0,0 +1,521 @@ +# v3-related-send-1 + +- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_03_docs/full_chain_docs_intents_v3-3x.yaml +- runner: agent_runtime +- mode: pre_llm +- passed: True + +## Query +Какие документы связаны с /send? + +## Actual +{ + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "RELATED_DOCS_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START", + "rag_count": 14, + "llm_answer": "", + "answer_mode": "answered", + "path_scope": [], + "doc_scope": [ + "api.send_message_endpoint", + "architecture.telegram_notify_app_overview", + "logic.telegram_notification_loop", + "api.health_endpoint" + ], + "entity_candidates": [], + "symbol_candidates": [], + "layers": [ + "D5_RELATION_GRAPH", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "filters": { + "doc_type": null + }, + "pipeline_mode": "pre_llm_only", + "gate_decision": "allow", + "prompt_used": "docs_explain_answer", + "llm_mode": "graph_summary", + "degraded_reason": null, + "code_intents_stubbed": true +} + +## Pipeline Steps +### input_query +```json +{ + "input": { + "query": "Какие документы связаны с /send?" + }, + "output": { + "query": "Какие документы связаны с /send?" + } +} +``` + +### router +```json +{ + "input": { + "query": "Какие документы связаны с /send?" + }, + "output": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "RELATED_DOCS_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START" + } +} +``` + +### docs_pipeline +```json +{ + "input": { + "query": "Какие документы связаны с /send?" + }, + "output": { + "answer_mode": "ready", + "prompt_name": "docs_explain_answer", + "llm_request": { + "prompt_name": "docs_explain_answer", + "log_context": "graph.project_qa.docs.answer", + "prompt_stats": { + "system_chars": 393, + "user_chars": 8086, + "tokens_in_estimate": 2120 + } + }, + "degraded_reason": "" + } +} +``` + +## Diagnostics +{ + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "RELATED_DOCS_EXPLAIN", + "layers_used": [ + "D5_RELATION_GRAPH", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "documents_found": 0, + "facts_found": 0, + "relations_found": 8, + "openapi_fields_extracted": 0, + "missing_required_fields": [], + "openapi_status": { + "has_path": false, + "has_method": false, + "has_request": false, + "has_response": false + }, + "prompt_used": "docs_explain_answer", + "llm_mode": "graph_summary", + "output_valid": true, + "matched_intent_source": "deterministic", + "matched_anchor_type": "endpoint", + "matched_anchor_value": "/send", + "exact_anchor_match": false, + "docs_layers_requested": [ + "D5_RELATION_GRAPH", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "docs_layers_with_hits": [ + "D5_RELATION_GRAPH" + ], + "planned_layers": [ + "D5_RELATION_GRAPH", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "executed_layers": [ + "D5_RELATION_GRAPH" + ], + "non_empty_layers": [ + "D5_RELATION_GRAPH" + ], + "layer_diagnostics": { + "D5_RELATION_GRAPH": { + "hits": 8, + "top_ids": [ + "33eb0aa97f06d0afcaa4c230b5f5b73fa2fbfa5861ea9367b6c92f8a6fe0c054", + "53dbf99d1ed72fb30e988fa7080e6ec3d0028d2a1e896e4e818f2492cc161bf5", + "a5c452b6685216d12fc857cd5b10a19b347655b1f1fd9f59d64fd413e93e36a5", + "d3d3ce25ca6434582c9bbb8f94ab89c7a2a497f46f1124f7e335c217281d42d9", + "305bab0c6567d93a2b453a9d70b676f9ecd8de083ef36f5cf3398747c25ebf94" + ] + }, + "D1_DOCUMENT_CATALOG": { + "hits": 0, + "top_ids": [], + "skipped": true, + "reason": "relation_primary_sufficient" + }, + "D0_DOC_CHUNKS": { + "hits": 6, + "top_ids": [ + "api.health_endpoint" + ] + } + }, + "query_entity_candidates": [], + "resolved_entity_candidates": [], + "query_anchor_candidates": [ + "/send" + ], + "resolved_anchor_candidates": [ + "docs/documentation/api/send-message-endpoint.md", + "docs/documentation/architecture/telegram-notify-app-overview.md", + "docs/documentation/logic/telegram-notification-loop.md", + "docs/documentation/api/health-endpoint.md", + "api.health_endpoint" + ], + "anchor_candidates": [ + "api.send_message_endpoint", + "api.health_endpoint", + "architecture.telegram_notify_app_overview", + "logic.telegram_notification_loop" + ], + "selected_anchor": "api.send_message_endpoint", + "anchor_selection_reason": "doc_id matches requested endpoint slug", + "anchor_match_type": "exact_path", + "doc_ids": [ + "api.send_message_endpoint", + "architecture.telegram_notify_app_overview", + "logic.telegram_notification_loop", + "api.health_endpoint" + ], + "doc_paths": [ + "docs/documentation/api/send-message-endpoint.md", + "docs/documentation/architecture/telegram-notify-app-overview.md", + "docs/documentation/logic/telegram-notification-loop.md", + "docs/documentation/api/health-endpoint.md" + ], + "doc_titles": [ + "api.send_message_endpoint:parent", + "api.send_message_endpoint:depends_on", + "api.send_message_endpoint:part_of", + "architecture.telegram_notify_app:related_api", + "architecture.telegram_notify_app:child", + "logic.telegram_notification_loop:related_api", + "api.health_endpoint:depends_on", + "api.health_endpoint:part_of", + "api.health_endpoint:Summary", + "api.health_endpoint:Описание", + "api.health_endpoint:Сценарий", + "api.health_endpoint:Функциональные требования", + "api.health_endpoint:Нефункциональные требования", + "api.health_endpoint:Входные параметры" + ], + "relation_hits_count": 8, + "relation_targets": [ + "api.send_message_endpoint:parent", + "api.send_message_endpoint:depends_on", + "api.send_message_endpoint:part_of", + "architecture.telegram_notify_app:related_api", + "architecture.telegram_notify_app:child", + "logic.telegram_notification_loop:related_api", + "api.health_endpoint:depends_on", + "api.health_endpoint:part_of" + ], + "fallback_doc_hits_count": 6, + "fallback_used": true, + "fact_hits": 0, + "entity_hits": 0, + "evidence_summary": { + "documents": 0, + "facts": 0, + "relations": 8, + "chunks": 6, + "entity_hits": 0, + "openapi_signals": { + "path_found": false, + "method_found": false, + "request_schema": false, + "response_schema": false, + "status_codes": false, + "payload_description": false + } + }, + "gate_decision": "allow", + "gate_decision_reason": "relation_evidence_available", + "gate_missing_requirements": [], + "gate_satisfied_requirements": [ + "retrieval_non_empty", + "exact_anchor_match" + ], + "openapi_evidence": { + "path_found": false, + "method_found": false, + "request_schema": false, + "response_schema": false, + "status_codes": false, + "payload_description": false + }, + "requested_fragment_type": null, + "fragment_evidence_found": [], + "fragment_missing_requirements": [], + "answer_mode": "ready", + "degrade_reason": null, + "degraded_reason": null, + "code_intents_stubbed": false +} + +## LLM Request +- prompt_name: docs_explain_answer +- log_context: graph.project_qa.docs.answer + +### Prompt Stats +```json +{ + "system_chars": 393, + "user_chars": 8086, + "tokens_in_estimate": 2120 +} +``` + +### System Prompt +```text +Ты объясняешь документацию системы. + +На вход приходит JSON с полями: +- question +- intent +- sub_intent +- documents +- facts +- relations + +Правила: +- Используй только предоставленные факты +- Не додумывай +- Если данных недостаточно, скажи это явно +- Объясняй структурировано + +Формат ответа: +1. Краткое описание +2. Основные элементы +3. Как это работает +4. Связи с другими частями системы (если есть) +``` + +### User Prompt +```json +{ + "question": "Какие документы связаны с /send?", + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "RELATED_DOCS_EXPLAIN", + "documents": [], + "facts": [], + "relations": [ + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/api/send-message-endpoint.md", + "title": "api.send_message_endpoint:parent", + "content": "api.send_message_endpoint parent architecture.telegram_notify_app", + "metadata": { + "owner": null, + "anchor": "frontmatter.parent", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "5fbf2e33510b0676a3a53b957a4569bd3c2c31fb7719546602c573421ccaa32d", + "source_id": "api.send_message_endpoint", + "target_id": "architecture.telegram_notify_app", + "doc_version": null, + "relation_id": "33eb0aa97f06d0afcaa4c230b5f5b73fa2fbfa5861ea9367b6c92f8a6fe0c054", + "source_path": "docs/documentation/api/send-message-endpoint.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "parent", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/api/send-message-endpoint.md", + "title": "api.send_message_endpoint:depends_on", + "content": "api.send_message_endpoint depends_on logic.telegram_notification_loop", + "metadata": { + "owner": null, + "anchor": "frontmatter.links", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "5fbf2e33510b0676a3a53b957a4569bd3c2c31fb7719546602c573421ccaa32d", + "source_id": "api.send_message_endpoint", + "target_id": "logic.telegram_notification_loop", + "doc_version": null, + "relation_id": "53dbf99d1ed72fb30e988fa7080e6ec3d0028d2a1e896e4e818f2492cc161bf5", + "source_path": "docs/documentation/api/send-message-endpoint.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "depends_on", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/api/send-message-endpoint.md", + "title": "api.send_message_endpoint:part_of", + "content": "api.send_message_endpoint part_of architecture.telegram_notify_app", + "metadata": { + "owner": null, + "anchor": "frontmatter.links", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "5fbf2e33510b0676a3a53b957a4569bd3c2c31fb7719546602c573421ccaa32d", + "source_id": "api.send_message_endpoint", + "target_id": "architecture.telegram_notify_app", + "doc_version": null, + "relation_id": "a5c452b6685216d12fc857cd5b10a19b347655b1f1fd9f59d64fd413e93e36a5", + "source_path": "docs/documentation/api/send-message-endpoint.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "part_of", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/architecture/telegram-notify-app-overview.md", + "title": "architecture.telegram_notify_app:related_api", + "content": "architecture.telegram_notify_app related_api api.send_message_endpoint", + "metadata": { + "owner": null, + "anchor": "frontmatter.links", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "8b1cc9f823e55bddbc825466d10a0fdb4ca4354ac02d91f9e2aef7b7d2ec8256", + "source_id": "architecture.telegram_notify_app", + "target_id": "api.send_message_endpoint", + "doc_version": null, + "relation_id": "d3d3ce25ca6434582c9bbb8f94ab89c7a2a497f46f1124f7e335c217281d42d9", + "source_path": "docs/documentation/architecture/telegram-notify-app-overview.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "related_api", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/architecture/telegram-notify-app-overview.md", + "title": "architecture.telegram_notify_app:child", + "content": "architecture.telegram_notify_app child api.send_message_endpoint", + "metadata": { + "owner": null, + "anchor": "frontmatter.children", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "8b1cc9f823e55bddbc825466d10a0fdb4ca4354ac02d91f9e2aef7b7d2ec8256", + "source_id": "architecture.telegram_notify_app", + "target_id": "api.send_message_endpoint", + "doc_version": null, + "relation_id": "305bab0c6567d93a2b453a9d70b676f9ecd8de083ef36f5cf3398747c25ebf94", + "source_path": "docs/documentation/architecture/telegram-notify-app-overview.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "child", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/logic/telegram-notification-loop.md", + "title": "logic.telegram_notification_loop:related_api", + "content": "logic.telegram_notification_loop related_api api.send_message_endpoint", + "metadata": { + "owner": null, + "anchor": "frontmatter.links", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "0f62f9b4dab261ca4ca34575ff5d84411a22c90b780c52eda388782b94f08470", + "source_id": "logic.telegram_notification_loop", + "target_id": "api.send_message_endpoint", + "doc_version": null, + "relation_id": "6b692f308b472d540c199a26362f4ec8d35e1e6859c1141518e0d6667148e981", + "source_path": "docs/documentation/logic/telegram-notification-loop.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "related_api", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/api/health-endpoint.md", + "title": "api.health_endpoint:depends_on", + "content": "api.health_endpoint depends_on domain.runtime_health", + "metadata": { + "owner": null, + "anchor": "frontmatter.links", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "8b5a533a8076e2e9d36995eee29aeade260080bdca2ec8e21fe28f08574b983f", + "source_id": "api.health_endpoint", + "target_id": "domain.runtime_health", + "doc_version": null, + "relation_id": "77f5d358ab85b3d92018b6b51da7c39773148dfd346686e8832a45370c841160", + "source_path": "docs/documentation/api/health-endpoint.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "depends_on", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/api/health-endpoint.md", + "title": "api.health_endpoint:part_of", + "content": "api.health_endpoint part_of architecture.telegram_notify_app", + "metadata": { + "owner": null, + "anchor": "frontmatter.links", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "8b5a533a8076e2e9d36995eee29aeade260080bdca2ec8e21fe28f08574b983f", + "source_id": "api.health_endpoint", + "target_id": "architecture.telegram_notify_app", + "doc_version": null, + "relation_id": "616f5cbf25da83cb51d8d0741a7fc351620c9ca2c6513fa2094b4aa476f0912a", + "source_path": "docs/documentation/api/health-endpoint.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "part_of", + "staleness_score": null, + "system_component": null + } + } + ] +} +``` + +### User Prompt Overview +- question: Какие документы связаны с /send? +- intent: DOCUMENTATION_EXPLAIN +- sub_intent: RELATED_DOCS_EXPLAIN +- documents: 0 +- facts: 0 +- relations: 8 | samples: api.send_message_endpoint:parent, api.send_message_endpoint:depends_on, api.send_message_endpoint:part_of + +## Mismatches +- none \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/docs_pre_llm_v3/20260326_121025/full_chain_docs_intents_v3-3x_v3-system-flow-health-1.json b/tests/pipeline_setup_v3/test_results/docs_pre_llm_v3/20260326_121025/full_chain_docs_intents_v3-3x_v3-system-flow-health-1.json new file mode 100644 index 0000000..d19fe0e --- /dev/null +++ b/tests/pipeline_setup_v3/test_results/docs_pre_llm_v3/20260326_121025/full_chain_docs_intents_v3-3x_v3-system-flow-health-1.json @@ -0,0 +1,87 @@ +{ + "meta": { + "case_id": "v3-system-flow-health-1", + "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_03_docs/full_chain_docs_intents_v3-3x.yaml", + "runner": "agent_runtime", + "mode": "pre_llm", + "passed": false, + "mismatches": [ + "sub_intent: expected SYSTEM_FLOW_EXPLAIN, got GENERIC_QA" + ], + "actual": { + "intent": "GENERAL_QA", + "sub_intent": "GENERIC_QA", + "graph_id": "DocsQAGraph", + "conversation_mode": "START", + "rag_count": 12, + "llm_answer": "", + "answer_mode": "answered", + "path_scope": [], + "doc_scope": [ + "domain.runtime_health", + "api.health_endpoint", + "logic.telegram_notification_loop", + "api.control_actions_endpoint", + "api.actions_endpoint" + ], + "entity_candidates": [], + "symbol_candidates": [], + "layers": [ + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "filters": { + "doc_type": null + }, + "pipeline_mode": "pre_llm_only", + "gate_decision": "allow", + "prompt_used": "docs_general_answer", + "llm_mode": "prose", + "degraded_reason": null, + "code_intents_stubbed": true + } + }, + "pipeline_steps": [ + { + "step": "input_query", + "input": { + "query": "Как работает health check runtime?" + }, + "output": { + "query": "Как работает health check runtime?" + } + }, + { + "step": "router", + "input": { + "query": "Как работает health check runtime?" + }, + "output": { + "intent": "GENERAL_QA", + "sub_intent": "GENERIC_QA", + "graph_id": "DocsQAGraph", + "conversation_mode": "START" + } + }, + { + "step": "docs_pipeline", + "input": { + "query": "Как работает health check runtime?" + }, + "output": { + "answer_mode": "ready", + "prompt_name": "docs_general_answer", + "llm_request": { + "prompt_name": "docs_general_answer", + "log_context": "graph.project_qa.docs.answer", + "prompt_stats": { + "system_chars": 345, + "user_chars": 9461, + "tokens_in_estimate": 2452 + } + }, + "degraded_reason": "" + } + } + ] +} \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/docs_pre_llm_v3/20260326_121025/full_chain_docs_intents_v3-3x_v3-system-flow-health-1.md b/tests/pipeline_setup_v3/test_results/docs_pre_llm_v3/20260326_121025/full_chain_docs_intents_v3-3x_v3-system-flow-health-1.md new file mode 100644 index 0000000..dbcff9f --- /dev/null +++ b/tests/pipeline_setup_v3/test_results/docs_pre_llm_v3/20260326_121025/full_chain_docs_intents_v3-3x_v3-system-flow-health-1.md @@ -0,0 +1,524 @@ +# v3-system-flow-health-1 + +- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_03_docs/full_chain_docs_intents_v3-3x.yaml +- runner: agent_runtime +- mode: pre_llm +- passed: False + +## Query +Как работает health check runtime? + +## Actual +{ + "intent": "GENERAL_QA", + "sub_intent": "GENERIC_QA", + "graph_id": "DocsQAGraph", + "conversation_mode": "START", + "rag_count": 12, + "llm_answer": "", + "answer_mode": "answered", + "path_scope": [], + "doc_scope": [ + "domain.runtime_health", + "api.health_endpoint", + "logic.telegram_notification_loop", + "api.control_actions_endpoint", + "api.actions_endpoint" + ], + "entity_candidates": [], + "symbol_candidates": [], + "layers": [ + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "filters": { + "doc_type": null + }, + "pipeline_mode": "pre_llm_only", + "gate_decision": "allow", + "prompt_used": "docs_general_answer", + "llm_mode": "prose", + "degraded_reason": null, + "code_intents_stubbed": true +} + +## Pipeline Steps +### input_query +```json +{ + "input": { + "query": "Как работает health check runtime?" + }, + "output": { + "query": "Как работает health check runtime?" + } +} +``` + +### router +```json +{ + "input": { + "query": "Как работает health check runtime?" + }, + "output": { + "intent": "GENERAL_QA", + "sub_intent": "GENERIC_QA", + "graph_id": "DocsQAGraph", + "conversation_mode": "START" + } +} +``` + +### docs_pipeline +```json +{ + "input": { + "query": "Как работает health check runtime?" + }, + "output": { + "answer_mode": "ready", + "prompt_name": "docs_general_answer", + "llm_request": { + "prompt_name": "docs_general_answer", + "log_context": "graph.project_qa.docs.answer", + "prompt_stats": { + "system_chars": 345, + "user_chars": 9461, + "tokens_in_estimate": 2452 + } + }, + "degraded_reason": "" + } +} +``` + +## Diagnostics +{ + "intent": "GENERAL_QA", + "sub_intent": "GENERIC_QA", + "layers_used": [ + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "documents_found": 4, + "facts_found": 0, + "relations_found": 0, + "openapi_fields_extracted": 0, + "missing_required_fields": [], + "openapi_status": { + "has_path": false, + "has_method": false, + "has_request": false, + "has_response": false + }, + "prompt_used": "docs_general_answer", + "llm_mode": "prose", + "output_valid": true, + "matched_intent_source": "deterministic", + "matched_anchor_type": "none", + "matched_anchor_value": null, + "exact_anchor_match": false, + "docs_layers_requested": [ + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "docs_layers_with_hits": [ + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "planned_layers": [ + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "executed_layers": [ + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "non_empty_layers": [ + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "layer_diagnostics": { + "D1_DOCUMENT_CATALOG": { + "hits": 4, + "top_ids": [ + "domain.runtime_health", + "api.health_endpoint", + "logic.telegram_notification_loop", + "api.control_actions_endpoint" + ] + }, + "D0_DOC_CHUNKS": { + "hits": 8, + "top_ids": [ + "api.health_endpoint" + ] + } + }, + "query_entity_candidates": [], + "resolved_entity_candidates": [], + "query_anchor_candidates": [], + "resolved_anchor_candidates": [ + "domain.runtime_health", + "docs/documentation/domain/runtime-health-entity.md", + "api.health_endpoint", + "docs/documentation/api/health-endpoint.md", + "logic.telegram_notification_loop", + "docs/documentation/logic/telegram-notification-loop.md", + "api.control_actions_endpoint", + "docs/documentation/api/control-actions-endpoint.md" + ], + "anchor_candidates": [], + "selected_anchor": null, + "anchor_selection_reason": "", + "anchor_match_type": "", + "doc_ids": [ + "domain.runtime_health", + "api.health_endpoint", + "logic.telegram_notification_loop", + "api.control_actions_endpoint", + "api.actions_endpoint" + ], + "doc_paths": [ + "docs/documentation/domain/runtime-health-entity.md", + "docs/documentation/api/health-endpoint.md", + "docs/documentation/logic/telegram-notification-loop.md", + "docs/documentation/api/control-actions-endpoint.md" + ], + "doc_titles": [ + "Сущность runtime health", + "HTTP API /health", + "Цикл отправки уведомлений в Telegram", + "HTTP API /actions/{action}", + "api.health_endpoint:Функциональные требования", + "api.health_endpoint:Выходные параметры", + "api.health_endpoint:Описание", + "api.health_endpoint:Сценарий", + "api.health_endpoint:Нефункциональные требования", + "api.health_endpoint:Входные параметры", + "api.health_endpoint:Summary", + "api.health_endpoint:Пример ответа" + ], + "relation_hits_count": 0, + "relation_targets": [], + "fallback_doc_hits_count": 12, + "fallback_used": false, + "fact_hits": 0, + "entity_hits": 0, + "evidence_summary": { + "documents": 4, + "facts": 0, + "relations": 0, + "chunks": 8, + "entity_hits": 0, + "openapi_signals": { + "path_found": false, + "method_found": false, + "request_schema": false, + "response_schema": false, + "status_codes": false, + "payload_description": false + } + }, + "gate_decision": "allow", + "gate_decision_reason": "evidence_sufficient", + "gate_missing_requirements": [], + "gate_satisfied_requirements": [ + "retrieval_non_empty" + ], + "openapi_evidence": { + "path_found": false, + "method_found": false, + "request_schema": false, + "response_schema": false, + "status_codes": false, + "payload_description": false + }, + "requested_fragment_type": null, + "fragment_evidence_found": [], + "fragment_missing_requirements": [], + "answer_mode": "ready", + "degrade_reason": null, + "degraded_reason": null, + "code_intents_stubbed": false +} + +## LLM Request +- prompt_name: docs_general_answer +- log_context: graph.project_qa.docs.answer + +### Prompt Stats +```json +{ + "system_chars": 345, + "user_chars": 9461, + "tokens_in_estimate": 2452 +} +``` + +### System Prompt +```text +Ты отвечаешь на общий вопрос по документации проекта. + +На вход приходит JSON с полями: +- question +- intent +- sub_intent +- documents +- facts +- relations + +Правила: +- Используй только предоставленные документы и факты +- Не додумывай отсутствующие детали +- Если данных недостаточно, скажи это прямо +- Дай короткий понятный ответ без лишней структуры +``` + +### User Prompt +```json +{ + "question": "Как работает health check runtime?", + "intent": "GENERAL_QA", + "sub_intent": "GENERIC_QA", + "documents": [ + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/domain/runtime-health-entity.md", + "title": "Сущность runtime health", + "content": "`runtime health` — доменная модель наблюдаемости сервиса, которая описывает общее состояние runtime и состояние отдельных компонентов. Для `test_echo_app` главным объектом наблюдения является компонент `telegram_notify`, у которого важны статус, время старта и количество успешных отправок. Эта модель используется для внешнего health-monitoring и внутренней диагностики.", + "metadata": { + "name": "runtime_health", + "tags": [ + "domain", + "health", + "observability" + ], + "type": "domain_entity", + "layer": "domain", + "links": [ + { + "type": "part_of", + "target": "architecture.telegram_notify_app" + }, + { + "type": "used_by", + "target": "api.health_endpoint" + }, + { + "type": "related_logic", + "target": "logic.telegram_notification_loop" + } + ], + "owner": null, + "title": "Сущность runtime health", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "architecture.telegram_notify_app", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "37d4dcf470ea3de95d59e44786006e369a3ea11bf5dbf4c88877696e9183ee87", + "children": [], + "doc_kind": "misc", + "entities": [ + "WorkerHealth", + "WorkerStatus", + "TelegramNotifyWorker" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "domain.runtime_health", + "source_path": "docs/documentation/domain/runtime-health-entity.md", + "summary_text": "`runtime health` — доменная модель наблюдаемости сервиса, которая описывает общее состояние runtime и состояние отдельных компонентов. Для `test_echo_app` главным объектом наблюдения является компонент `telegram_notify`, у которого важны статус, время старта и количество успешных отправок. Эта модель используется для внешнего health-monitoring и внутренней диагностики.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/api/health-endpoint.md", + "title": "HTTP API /health", + "content": "Endpoint `/health` возвращает агрегированный health payload runtime. Если общий статус равен `ok`, API отвечает с HTTP 200; для состояний деградации или неготовности возвращается HTTP 503 с тем же payload. Endpoint служит основной точкой внешней проверки состояния приложения.", + "metadata": { + "name": "health_endpoint", + "tags": [ + "api", + "health", + "control-plane" + ], + "type": "api_method", + "layer": "application", + "links": [ + { + "type": "part_of", + "target": "architecture.telegram_notify_app" + }, + { + "type": "depends_on", + "target": "domain.runtime_health" + } + ], + "owner": null, + "title": "HTTP API /health", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "architecture.telegram_notify_app", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "8b5a533a8076e2e9d36995eee29aeade260080bdca2ec8e21fe28f08574b983f", + "children": [], + "doc_kind": "misc", + "entities": [ + "TelegramControlChannel", + "TelegramNotifyWorker", + "RuntimeManager", + "WorkerHealth" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "api.health_endpoint", + "source_path": "docs/documentation/api/health-endpoint.md", + "summary_text": "Endpoint `/health` возвращает агрегированный health payload runtime. Если общий статус равен `ok`, API отвечает с HTTP 200; для состояний деградации или неготовности возвращается HTTP 503 с тем же payload. Endpoint служит основной точкой внешней проверки состояния приложения.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/logic/telegram-notification-loop.md", + "title": "Цикл отправки уведомлений в Telegram", + "content": "`TelegramNotifyWorker` после старта runtime запускает отдельный поток, сразу делает первую попытку отправки сообщения и затем повторяет отправку через заданный интервал. При ошибках доставки или отсутствии credentials worker не останавливает сервис, а переводит собственное состояние в `degraded`. Этот workflow определяет основной полезный цикл приложения.", + "metadata": { + "name": "telegram_notification_loop", + "tags": [ + "logic", + "telegram", + "worker", + "scheduling" + ], + "type": "logic_block", + "layer": "application", + "links": [ + { + "type": "part_of", + "target": "architecture.telegram_notify_app" + }, + { + "type": "related_api", + "target": "api.send_message_endpoint" + }, + { + "type": "related_api", + "target": "api.control_actions_endpoint" + }, + { + "type": "related_api", + "target": "api.health_endpoint" + } + ], + "owner": null, + "title": "Цикл отправки уведомлений в Telegram", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "architecture.telegram_notify_app", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "0f62f9b4dab261ca4ca34575ff5d84411a22c90b780c52eda388782b94f08470", + "children": [], + "doc_kind": "misc", + "entities": [ + "TelegramNotifyWorker", + "TelegramSendService", + "WorkerHealth", + "WorkerStatus" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "logic.telegram_notification_loop", + "source_path": "docs/documentation/logic/telegram-notification-loop.md", + "summary_text": "`TelegramNotifyWorker` после старта runtime запускает отдельный поток, сразу делает первую попытку отправки сообщения и затем повторяет отправку через заданный интервал. При ошибках доставки или отсутствии credentials worker не останавливает сервис, а переводит собственное состояние в `degraded`. Этот workflow определяет основной полезный цикл приложения.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "HTTP API /actions/{action}", + "content": "Endpoint `/actions/{action}` управляет control actions runtime и поддерживает `start`, `stop` и `status`. Для долгих операций `start` и `stop` допускается ответ HTTP 202, если действие еще выполняется. Endpoint используется для operator-driven управления жизненным циклом worker'а через HTTP API.", + "metadata": { + "name": "control_actions_endpoint", + "tags": [ + "api", + "control-plane", + "lifecycle" + ], + "type": "api_method", + "layer": "application", + "links": [ + { + "type": "part_of", + "target": "architecture.telegram_notify_app" + }, + { + "type": "related_api", + "target": "api.health_endpoint" + }, + { + "type": "related_logic", + "target": "logic.telegram_notification_loop" + } + ], + "owner": null, + "title": "HTTP API /actions/{action}", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "architecture.telegram_notify_app", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "children": [], + "doc_kind": "misc", + "entities": [ + "TelegramControlChannel", + "ControlActionSet", + "JSONResponse" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "api.control_actions_endpoint", + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "summary_text": "Endpoint `/actions/{action}` управляет control actions runtime и поддерживает `start`, `stop` и `status`. Для долгих операций `start` и `stop` допускается ответ HTTP 202, если действие еще выполняется. Endpoint используется для operator-driven управления жизненным циклом worker'а через HTTP API.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + } + ], + "facts": [], + "relations": [] +} +``` + +### User Prompt Overview +- question: Как работает health check runtime? +- intent: GENERAL_QA +- sub_intent: GENERIC_QA +- documents: 4 | samples: Сущность runtime health, HTTP API /health, Цикл отправки уведомлений в Telegram +- facts: 0 +- relations: 0 + +## Mismatches +- sub_intent: expected SYSTEM_FLOW_EXPLAIN, got GENERIC_QA \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/docs_pre_llm_v3/20260326_121025/full_chain_docs_intents_v3-3x_v3-system-flow-health-2.json b/tests/pipeline_setup_v3/test_results/docs_pre_llm_v3/20260326_121025/full_chain_docs_intents_v3-3x_v3-system-flow-health-2.json new file mode 100644 index 0000000..b0563b8 --- /dev/null +++ b/tests/pipeline_setup_v3/test_results/docs_pre_llm_v3/20260326_121025/full_chain_docs_intents_v3-3x_v3-system-flow-health-2.json @@ -0,0 +1,91 @@ +{ + "meta": { + "case_id": "v3-system-flow-health-2", + "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_03_docs/full_chain_docs_intents_v3-3x.yaml", + "runner": "agent_runtime", + "mode": "pre_llm", + "passed": true, + "mismatches": [], + "actual": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "SYSTEM_FLOW_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START", + "rag_count": 23, + "llm_answer": "", + "answer_mode": "answered", + "path_scope": [], + "doc_scope": [ + "domain.runtime_health", + "logic.telegram_notification_loop", + "api.health_endpoint", + "api.control_actions_endpoint", + "api.actions_endpoint", + "architecture.telegram_notify_app", + "architecture.telegram_notify_app_overview", + "api.send_message_endpoint", + "docs/README.md" + ], + "entity_candidates": [], + "symbol_candidates": [], + "layers": [ + "D1_DOCUMENT_CATALOG", + "D4_WORKFLOW_INDEX", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "filters": { + "doc_type": null + }, + "pipeline_mode": "pre_llm_only", + "gate_decision": "allow", + "prompt_used": "docs_explain_answer", + "llm_mode": "prose", + "degraded_reason": null, + "code_intents_stubbed": true + } + }, + "pipeline_steps": [ + { + "step": "input_query", + "input": { + "query": "Как происходит проверка состояния runtime?" + }, + "output": { + "query": "Как происходит проверка состояния runtime?" + } + }, + { + "step": "router", + "input": { + "query": "Как происходит проверка состояния runtime?" + }, + "output": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "SYSTEM_FLOW_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START" + } + }, + { + "step": "docs_pipeline", + "input": { + "query": "Как происходит проверка состояния runtime?" + }, + "output": { + "answer_mode": "ready", + "prompt_name": "docs_explain_answer", + "llm_request": { + "prompt_name": "docs_explain_answer", + "log_context": "graph.project_qa.docs.answer", + "prompt_stats": { + "system_chars": 393, + "user_chars": 22363, + "tokens_in_estimate": 5689 + } + }, + "degraded_reason": "" + } + } + ] +} \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/docs_pre_llm_v3/20260326_121025/full_chain_docs_intents_v3-3x_v3-system-flow-health-2.md b/tests/pipeline_setup_v3/test_results/docs_pre_llm_v3/20260326_121025/full_chain_docs_intents_v3-3x_v3-system-flow-health-2.md new file mode 100644 index 0000000..4a84f98 --- /dev/null +++ b/tests/pipeline_setup_v3/test_results/docs_pre_llm_v3/20260326_121025/full_chain_docs_intents_v3-3x_v3-system-flow-health-2.md @@ -0,0 +1,915 @@ +# v3-system-flow-health-2 + +- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_03_docs/full_chain_docs_intents_v3-3x.yaml +- runner: agent_runtime +- mode: pre_llm +- passed: True + +## Query +Как происходит проверка состояния runtime? + +## Actual +{ + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "SYSTEM_FLOW_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START", + "rag_count": 23, + "llm_answer": "", + "answer_mode": "answered", + "path_scope": [], + "doc_scope": [ + "domain.runtime_health", + "logic.telegram_notification_loop", + "api.health_endpoint", + "api.control_actions_endpoint", + "api.actions_endpoint", + "architecture.telegram_notify_app", + "architecture.telegram_notify_app_overview", + "api.send_message_endpoint", + "docs/README.md" + ], + "entity_candidates": [], + "symbol_candidates": [], + "layers": [ + "D1_DOCUMENT_CATALOG", + "D4_WORKFLOW_INDEX", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "filters": { + "doc_type": null + }, + "pipeline_mode": "pre_llm_only", + "gate_decision": "allow", + "prompt_used": "docs_explain_answer", + "llm_mode": "prose", + "degraded_reason": null, + "code_intents_stubbed": true +} + +## Pipeline Steps +### input_query +```json +{ + "input": { + "query": "Как происходит проверка состояния runtime?" + }, + "output": { + "query": "Как происходит проверка состояния runtime?" + } +} +``` + +### router +```json +{ + "input": { + "query": "Как происходит проверка состояния runtime?" + }, + "output": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "SYSTEM_FLOW_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START" + } +} +``` + +### docs_pipeline +```json +{ + "input": { + "query": "Как происходит проверка состояния runtime?" + }, + "output": { + "answer_mode": "ready", + "prompt_name": "docs_explain_answer", + "llm_request": { + "prompt_name": "docs_explain_answer", + "log_context": "graph.project_qa.docs.answer", + "prompt_stats": { + "system_chars": 393, + "user_chars": 22363, + "tokens_in_estimate": 5689 + } + }, + "degraded_reason": "" + } +} +``` + +## Diagnostics +{ + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "SYSTEM_FLOW_EXPLAIN", + "layers_used": [ + "D1_DOCUMENT_CATALOG", + "D4_WORKFLOW_INDEX", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "documents_found": 6, + "facts_found": 0, + "relations_found": 8, + "openapi_fields_extracted": 0, + "missing_required_fields": [], + "openapi_status": { + "has_path": false, + "has_method": false, + "has_request": false, + "has_response": false + }, + "prompt_used": "docs_explain_answer", + "llm_mode": "prose", + "output_valid": true, + "matched_intent_source": "deterministic", + "matched_anchor_type": "none", + "matched_anchor_value": null, + "exact_anchor_match": false, + "docs_layers_requested": [ + "D1_DOCUMENT_CATALOG", + "D4_WORKFLOW_INDEX", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "docs_layers_with_hits": [ + "D1_DOCUMENT_CATALOG", + "D4_WORKFLOW_INDEX", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "planned_layers": [ + "D1_DOCUMENT_CATALOG", + "D4_WORKFLOW_INDEX", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "executed_layers": [ + "D1_DOCUMENT_CATALOG", + "D4_WORKFLOW_INDEX", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "non_empty_layers": [ + "D1_DOCUMENT_CATALOG", + "D4_WORKFLOW_INDEX", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "layer_diagnostics": { + "D1_DOCUMENT_CATALOG": { + "hits": 6, + "top_ids": [ + "domain.runtime_health", + "logic.telegram_notification_loop", + "api.health_endpoint", + "api.control_actions_endpoint", + "architecture.telegram_notify_app" + ] + }, + "D4_WORKFLOW_INDEX": { + "hits": 3, + "top_ids": [ + "api.health_endpoint", + "api.control_actions_endpoint", + "api.send_message_endpoint" + ] + }, + "D5_RELATION_GRAPH": { + "hits": 8, + "top_ids": [ + "8595d7b82fecdb7ef579fa8961cda6799bb21970061e5bc221d4dd7a3d53fd04", + "801650f8bcbfbfbefd35c14447bfef7b3c3827313db790efa7faf47db860f8c4", + "af2a4f7c1b677b908410ba720915405e10dbd0870e30a3c6e3aa2468550ddf0e", + "79bdb0a74713df6064008179ca8c5c186dc23e4e1c5e2c9607b0bdddeba50f93", + "77f5d358ab85b3d92018b6b51da7c39773148dfd346686e8832a45370c841160" + ] + }, + "D0_DOC_CHUNKS": { + "hits": 6, + "top_ids": [ + "domain.runtime_health", + "docs/README.md", + "api.control_actions_endpoint" + ] + } + }, + "query_entity_candidates": [], + "resolved_entity_candidates": [], + "query_anchor_candidates": [], + "resolved_anchor_candidates": [ + "domain.runtime_health", + "docs/documentation/domain/runtime-health-entity.md", + "logic.telegram_notification_loop", + "docs/documentation/logic/telegram-notification-loop.md", + "api.health_endpoint", + "docs/documentation/api/health-endpoint.md", + "api.control_actions_endpoint", + "docs/documentation/api/control-actions-endpoint.md", + "architecture.telegram_notify_app", + "docs/documentation/architecture/telegram-notify-app-overview.md", + "api.send_message_endpoint", + "docs/documentation/api/send-message-endpoint.md", + "docs/README.md" + ], + "anchor_candidates": [], + "selected_anchor": null, + "anchor_selection_reason": "", + "anchor_match_type": "", + "doc_ids": [ + "domain.runtime_health", + "logic.telegram_notification_loop", + "api.health_endpoint", + "api.control_actions_endpoint", + "api.actions_endpoint", + "architecture.telegram_notify_app", + "architecture.telegram_notify_app_overview", + "api.send_message_endpoint", + "docs/README.md" + ], + "doc_paths": [ + "docs/documentation/domain/runtime-health-entity.md", + "docs/documentation/logic/telegram-notification-loop.md", + "docs/documentation/api/health-endpoint.md", + "docs/documentation/api/control-actions-endpoint.md", + "docs/documentation/architecture/telegram-notify-app-overview.md", + "docs/documentation/api/send-message-endpoint.md", + "docs/README.md" + ], + "doc_titles": [ + "Сущность runtime health", + "Цикл отправки уведомлений в Telegram", + "HTTP API /health", + "HTTP API /actions/{action}", + "Архитектура Telegram Notify App", + "HTTP API /send", + "Scenario", + "domain.runtime_health:related_logic", + "domain.runtime_health:used_by", + "domain.runtime_health:part_of", + "domain.runtime_health:parent", + "api.health_endpoint:depends_on", + "architecture.telegram_notify_app:child", + "architecture.telegram_notify_app:depends_on", + "api.health_endpoint:part_of", + "domain.runtime_health:Details", + "domain.runtime_health:Summary", + "docs/README.md:Навигация", + "api.control_actions_endpoint:Summary", + "api.control_actions_endpoint:Описание", + "api.control_actions_endpoint:Сценарий" + ], + "relation_hits_count": 8, + "relation_targets": [ + "domain.runtime_health:related_logic", + "domain.runtime_health:used_by", + "domain.runtime_health:part_of", + "domain.runtime_health:parent", + "api.health_endpoint:depends_on", + "architecture.telegram_notify_app:child", + "architecture.telegram_notify_app:depends_on", + "api.health_endpoint:part_of" + ], + "fallback_doc_hits_count": 12, + "fallback_used": false, + "fact_hits": 0, + "entity_hits": 0, + "evidence_summary": { + "documents": 6, + "facts": 0, + "relations": 8, + "chunks": 6, + "entity_hits": 0, + "openapi_signals": { + "path_found": false, + "method_found": false, + "request_schema": false, + "response_schema": false, + "status_codes": false, + "payload_description": false + } + }, + "gate_decision": "allow", + "gate_decision_reason": "evidence_sufficient", + "gate_missing_requirements": [], + "gate_satisfied_requirements": [ + "retrieval_non_empty" + ], + "openapi_evidence": { + "path_found": false, + "method_found": false, + "request_schema": false, + "response_schema": false, + "status_codes": false, + "payload_description": false + }, + "requested_fragment_type": null, + "fragment_evidence_found": [], + "fragment_missing_requirements": [], + "answer_mode": "ready", + "degrade_reason": null, + "degraded_reason": null, + "code_intents_stubbed": false +} + +## LLM Request +- prompt_name: docs_explain_answer +- log_context: graph.project_qa.docs.answer + +### Prompt Stats +```json +{ + "system_chars": 393, + "user_chars": 22363, + "tokens_in_estimate": 5689 +} +``` + +### System Prompt +```text +Ты объясняешь документацию системы. + +На вход приходит JSON с полями: +- question +- intent +- sub_intent +- documents +- facts +- relations + +Правила: +- Используй только предоставленные факты +- Не додумывай +- Если данных недостаточно, скажи это явно +- Объясняй структурировано + +Формат ответа: +1. Краткое описание +2. Основные элементы +3. Как это работает +4. Связи с другими частями системы (если есть) +``` + +### User Prompt +```json +{ + "question": "Как происходит проверка состояния runtime?", + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "SYSTEM_FLOW_EXPLAIN", + "documents": [ + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/domain/runtime-health-entity.md", + "title": "Сущность runtime health", + "content": "`runtime health` — доменная модель наблюдаемости сервиса, которая описывает общее состояние runtime и состояние отдельных компонентов. Для `test_echo_app` главным объектом наблюдения является компонент `telegram_notify`, у которого важны статус, время старта и количество успешных отправок. Эта модель используется для внешнего health-monitoring и внутренней диагностики.", + "metadata": { + "name": "runtime_health", + "tags": [ + "domain", + "health", + "observability" + ], + "type": "domain_entity", + "layer": "domain", + "links": [ + { + "type": "part_of", + "target": "architecture.telegram_notify_app" + }, + { + "type": "used_by", + "target": "api.health_endpoint" + }, + { + "type": "related_logic", + "target": "logic.telegram_notification_loop" + } + ], + "owner": null, + "title": "Сущность runtime health", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "architecture.telegram_notify_app", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "37d4dcf470ea3de95d59e44786006e369a3ea11bf5dbf4c88877696e9183ee87", + "children": [], + "doc_kind": "misc", + "entities": [ + "WorkerHealth", + "WorkerStatus", + "TelegramNotifyWorker" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "domain.runtime_health", + "source_path": "docs/documentation/domain/runtime-health-entity.md", + "summary_text": "`runtime health` — доменная модель наблюдаемости сервиса, которая описывает общее состояние runtime и состояние отдельных компонентов. Для `test_echo_app` главным объектом наблюдения является компонент `telegram_notify`, у которого важны статус, время старта и количество успешных отправок. Эта модель используется для внешнего health-monitoring и внутренней диагностики.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/logic/telegram-notification-loop.md", + "title": "Цикл отправки уведомлений в Telegram", + "content": "`TelegramNotifyWorker` после старта runtime запускает отдельный поток, сразу делает первую попытку отправки сообщения и затем повторяет отправку через заданный интервал. При ошибках доставки или отсутствии credentials worker не останавливает сервис, а переводит собственное состояние в `degraded`. Этот workflow определяет основной полезный цикл приложения.", + "metadata": { + "name": "telegram_notification_loop", + "tags": [ + "logic", + "telegram", + "worker", + "scheduling" + ], + "type": "logic_block", + "layer": "application", + "links": [ + { + "type": "part_of", + "target": "architecture.telegram_notify_app" + }, + { + "type": "related_api", + "target": "api.send_message_endpoint" + }, + { + "type": "related_api", + "target": "api.control_actions_endpoint" + }, + { + "type": "related_api", + "target": "api.health_endpoint" + } + ], + "owner": null, + "title": "Цикл отправки уведомлений в Telegram", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "architecture.telegram_notify_app", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "0f62f9b4dab261ca4ca34575ff5d84411a22c90b780c52eda388782b94f08470", + "children": [], + "doc_kind": "misc", + "entities": [ + "TelegramNotifyWorker", + "TelegramSendService", + "WorkerHealth", + "WorkerStatus" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "logic.telegram_notification_loop", + "source_path": "docs/documentation/logic/telegram-notification-loop.md", + "summary_text": "`TelegramNotifyWorker` после старта runtime запускает отдельный поток, сразу делает первую попытку отправки сообщения и затем повторяет отправку через заданный интервал. При ошибках доставки или отсутствии credentials worker не останавливает сервис, а переводит собственное состояние в `degraded`. Этот workflow определяет основной полезный цикл приложения.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/api/health-endpoint.md", + "title": "HTTP API /health", + "content": "Endpoint `/health` возвращает агрегированный health payload runtime. Если общий статус равен `ok`, API отвечает с HTTP 200; для состояний деградации или неготовности возвращается HTTP 503 с тем же payload. Endpoint служит основной точкой внешней проверки состояния приложения.", + "metadata": { + "name": "health_endpoint", + "tags": [ + "api", + "health", + "control-plane" + ], + "type": "api_method", + "layer": "application", + "links": [ + { + "type": "part_of", + "target": "architecture.telegram_notify_app" + }, + { + "type": "depends_on", + "target": "domain.runtime_health" + } + ], + "owner": null, + "title": "HTTP API /health", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "architecture.telegram_notify_app", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "8b5a533a8076e2e9d36995eee29aeade260080bdca2ec8e21fe28f08574b983f", + "children": [], + "doc_kind": "misc", + "entities": [ + "TelegramControlChannel", + "TelegramNotifyWorker", + "RuntimeManager", + "WorkerHealth" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "api.health_endpoint", + "source_path": "docs/documentation/api/health-endpoint.md", + "summary_text": "Endpoint `/health` возвращает агрегированный health payload runtime. Если общий статус равен `ok`, API отвечает с HTTP 200; для состояний деградации или неготовности возвращается HTTP 503 с тем же payload. Endpoint служит основной точкой внешней проверки состояния приложения.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "HTTP API /actions/{action}", + "content": "Endpoint `/actions/{action}` управляет control actions runtime и поддерживает `start`, `stop` и `status`. Для долгих операций `start` и `stop` допускается ответ HTTP 202, если действие еще выполняется. Endpoint используется для operator-driven управления жизненным циклом worker'а через HTTP API.", + "metadata": { + "name": "control_actions_endpoint", + "tags": [ + "api", + "control-plane", + "lifecycle" + ], + "type": "api_method", + "layer": "application", + "links": [ + { + "type": "part_of", + "target": "architecture.telegram_notify_app" + }, + { + "type": "related_api", + "target": "api.health_endpoint" + }, + { + "type": "related_logic", + "target": "logic.telegram_notification_loop" + } + ], + "owner": null, + "title": "HTTP API /actions/{action}", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "architecture.telegram_notify_app", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "children": [], + "doc_kind": "misc", + "entities": [ + "TelegramControlChannel", + "ControlActionSet", + "JSONResponse" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "api.control_actions_endpoint", + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "summary_text": "Endpoint `/actions/{action}` управляет control actions runtime и поддерживает `start`, `stop` и `status`. Для долгих операций `start` и `stop` допускается ответ HTTP 202, если действие еще выполняется. Endpoint используется для operator-driven управления жизненным циклом worker'а через HTTP API.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/architecture/telegram-notify-app-overview.md", + "title": "Архитектура Telegram Notify App", + "content": "`test_echo_app` — сервис на базе PLBA runtime, который поднимает HTTP control plane и запускает фоновый воркер для периодической отправки уведомлений в Telegram. Приложение использует YAML-конфиг для runtime-настроек и переменные окружения для Telegram credentials. Основной контур системы состоит из runtime manager, control channel, send service и worker loop.", + "metadata": { + "name": "telegram_notify_app_overview", + "tags": [ + "architecture", + "telegram", + "plba", + "runtime" + ], + "type": "architecture_overview", + "layer": "system", + "links": [ + { + "type": "related_api", + "target": "api.health_endpoint" + }, + { + "type": "related_api", + "target": "api.control_actions_endpoint" + }, + { + "type": "related_api", + "target": "api.send_message_endpoint" + }, + { + "type": "depends_on", + "target": "logic.telegram_notification_loop" + }, + { + "type": "depends_on", + "target": "domain.runtime_health" + } + ], + "owner": null, + "title": "Архитектура Telegram Notify App", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "docs_root", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "8b1cc9f823e55bddbc825466d10a0fdb4ca4354ac02d91f9e2aef7b7d2ec8256", + "children": [ + "api.health_endpoint", + "api.control_actions_endpoint", + "api.send_message_endpoint", + "logic.telegram_notification_loop", + "domain.runtime_health" + ], + "doc_kind": "spec", + "entities": [ + "TelegramNotifyModule", + "TelegramNotifyWorker", + "TelegramControlChannel", + "TelegramSendService", + "RuntimeManager" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "architecture.telegram_notify_app", + "source_path": "docs/documentation/architecture/telegram-notify-app-overview.md", + "summary_text": "`test_echo_app` — сервис на базе PLBA runtime, который поднимает HTTP control plane и запускает фоновый воркер для периодической отправки уведомлений в Telegram. Приложение использует YAML-конфиг для runtime-настроек и переменные окружения для Telegram credentials. Основной контур системы состоит из runtime manager, control channel, send service и worker loop.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/api/send-message-endpoint.md", + "title": "HTTP API /send", + "content": "Endpoint `/send` выполняет ручную отправку сообщения в Telegram через `TelegramSendService`. Он используется для операторской проверки доставки и для отправки уведомлений вне периодического worker loop. Endpoint работает поверх тех же credentials и того же delivery path, что и фоновая отправка.", + "metadata": { + "name": "send_message_endpoint", + "tags": [ + "api", + "telegram", + "manual-send" + ], + "type": "api_method", + "layer": "application", + "links": [ + { + "type": "part_of", + "target": "architecture.telegram_notify_app" + }, + { + "type": "depends_on", + "target": "logic.telegram_notification_loop" + } + ], + "owner": null, + "title": "HTTP API /send", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "architecture.telegram_notify_app", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "5fbf2e33510b0676a3a53b957a4569bd3c2c31fb7719546602c573421ccaa32d", + "children": [], + "doc_kind": "misc", + "entities": [ + "TelegramControlAppFactory", + "TelegramSendService", + "TelegramNotifyWorker" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "api.send_message_endpoint", + "source_path": "docs/documentation/api/send-message-endpoint.md", + "summary_text": "Endpoint `/send` выполняет ручную отправку сообщения в Telegram через `TelegramSendService`. Он используется для операторской проверки доставки и для отправки уведомлений вне периодического worker loop. Endpoint работает поверх тех же credentials и того же delivery path, что и фоновая отправка.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + } + ], + "facts": [], + "relations": [ + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/domain/runtime-health-entity.md", + "title": "domain.runtime_health:related_logic", + "content": "domain.runtime_health related_logic logic.telegram_notification_loop", + "metadata": { + "owner": null, + "anchor": "frontmatter.links", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "37d4dcf470ea3de95d59e44786006e369a3ea11bf5dbf4c88877696e9183ee87", + "source_id": "domain.runtime_health", + "target_id": "logic.telegram_notification_loop", + "doc_version": null, + "relation_id": "8595d7b82fecdb7ef579fa8961cda6799bb21970061e5bc221d4dd7a3d53fd04", + "source_path": "docs/documentation/domain/runtime-health-entity.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "related_logic", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/domain/runtime-health-entity.md", + "title": "domain.runtime_health:used_by", + "content": "domain.runtime_health used_by api.health_endpoint", + "metadata": { + "owner": null, + "anchor": "frontmatter.links", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "37d4dcf470ea3de95d59e44786006e369a3ea11bf5dbf4c88877696e9183ee87", + "source_id": "domain.runtime_health", + "target_id": "api.health_endpoint", + "doc_version": null, + "relation_id": "801650f8bcbfbfbefd35c14447bfef7b3c3827313db790efa7faf47db860f8c4", + "source_path": "docs/documentation/domain/runtime-health-entity.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "used_by", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/domain/runtime-health-entity.md", + "title": "domain.runtime_health:part_of", + "content": "domain.runtime_health part_of architecture.telegram_notify_app", + "metadata": { + "owner": null, + "anchor": "frontmatter.links", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "37d4dcf470ea3de95d59e44786006e369a3ea11bf5dbf4c88877696e9183ee87", + "source_id": "domain.runtime_health", + "target_id": "architecture.telegram_notify_app", + "doc_version": null, + "relation_id": "af2a4f7c1b677b908410ba720915405e10dbd0870e30a3c6e3aa2468550ddf0e", + "source_path": "docs/documentation/domain/runtime-health-entity.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "part_of", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/domain/runtime-health-entity.md", + "title": "domain.runtime_health:parent", + "content": "domain.runtime_health parent architecture.telegram_notify_app", + "metadata": { + "owner": null, + "anchor": "frontmatter.parent", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "37d4dcf470ea3de95d59e44786006e369a3ea11bf5dbf4c88877696e9183ee87", + "source_id": "domain.runtime_health", + "target_id": "architecture.telegram_notify_app", + "doc_version": null, + "relation_id": "79bdb0a74713df6064008179ca8c5c186dc23e4e1c5e2c9607b0bdddeba50f93", + "source_path": "docs/documentation/domain/runtime-health-entity.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "parent", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/api/health-endpoint.md", + "title": "api.health_endpoint:depends_on", + "content": "api.health_endpoint depends_on domain.runtime_health", + "metadata": { + "owner": null, + "anchor": "frontmatter.links", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "8b5a533a8076e2e9d36995eee29aeade260080bdca2ec8e21fe28f08574b983f", + "source_id": "api.health_endpoint", + "target_id": "domain.runtime_health", + "doc_version": null, + "relation_id": "77f5d358ab85b3d92018b6b51da7c39773148dfd346686e8832a45370c841160", + "source_path": "docs/documentation/api/health-endpoint.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "depends_on", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/architecture/telegram-notify-app-overview.md", + "title": "architecture.telegram_notify_app:child", + "content": "architecture.telegram_notify_app child domain.runtime_health", + "metadata": { + "owner": null, + "anchor": "frontmatter.children", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "8b1cc9f823e55bddbc825466d10a0fdb4ca4354ac02d91f9e2aef7b7d2ec8256", + "source_id": "architecture.telegram_notify_app", + "target_id": "domain.runtime_health", + "doc_version": null, + "relation_id": "4e0bbeb8e97e25091a30412d8631b1d9f6bb58b5694d8b7cc632af69a9262ea8", + "source_path": "docs/documentation/architecture/telegram-notify-app-overview.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "child", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/architecture/telegram-notify-app-overview.md", + "title": "architecture.telegram_notify_app:depends_on", + "content": "architecture.telegram_notify_app depends_on domain.runtime_health", + "metadata": { + "owner": null, + "anchor": "frontmatter.links", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "8b1cc9f823e55bddbc825466d10a0fdb4ca4354ac02d91f9e2aef7b7d2ec8256", + "source_id": "architecture.telegram_notify_app", + "target_id": "domain.runtime_health", + "doc_version": null, + "relation_id": "228d9012df1811fd2ef79178ff79c3cbc85271cf2755b15a627ea320e8f442a5", + "source_path": "docs/documentation/architecture/telegram-notify-app-overview.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "depends_on", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/api/health-endpoint.md", + "title": "api.health_endpoint:part_of", + "content": "api.health_endpoint part_of architecture.telegram_notify_app", + "metadata": { + "owner": null, + "anchor": "frontmatter.links", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "8b5a533a8076e2e9d36995eee29aeade260080bdca2ec8e21fe28f08574b983f", + "source_id": "api.health_endpoint", + "target_id": "architecture.telegram_notify_app", + "doc_version": null, + "relation_id": "616f5cbf25da83cb51d8d0741a7fc351620c9ca2c6513fa2094b4aa476f0912a", + "source_path": "docs/documentation/api/health-endpoint.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "part_of", + "staleness_score": null, + "system_component": null + } + } + ] +} +``` + +### User Prompt Overview +- question: Как происходит проверка состояния runtime? +- intent: DOCUMENTATION_EXPLAIN +- sub_intent: SYSTEM_FLOW_EXPLAIN +- documents: 6 | samples: Сущность runtime health, Цикл отправки уведомлений в Telegram, HTTP API /health +- facts: 0 +- relations: 8 | samples: domain.runtime_health:related_logic, domain.runtime_health:used_by, domain.runtime_health:part_of + +## Mismatches +- none \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/docs_pre_llm_v3/20260326_121025/full_chain_docs_intents_v3-3x_v3-system-flow-telegram-loop-1.json b/tests/pipeline_setup_v3/test_results/docs_pre_llm_v3/20260326_121025/full_chain_docs_intents_v3-3x_v3-system-flow-telegram-loop-1.json new file mode 100644 index 0000000..697439d --- /dev/null +++ b/tests/pipeline_setup_v3/test_results/docs_pre_llm_v3/20260326_121025/full_chain_docs_intents_v3-3x_v3-system-flow-telegram-loop-1.json @@ -0,0 +1,90 @@ +{ + "meta": { + "case_id": "v3-system-flow-telegram-loop-1", + "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_03_docs/full_chain_docs_intents_v3-3x.yaml", + "runner": "agent_runtime", + "mode": "pre_llm", + "passed": true, + "mismatches": [], + "actual": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "SYSTEM_FLOW_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START", + "rag_count": 23, + "llm_answer": "", + "answer_mode": "answered", + "path_scope": [], + "doc_scope": [ + "docs/README.md", + "api.control_actions_endpoint", + "api.actions_endpoint", + "api.health_endpoint", + "api.send_message_endpoint", + "architecture.telegram_notify_app", + "architecture.telegram_notify_app_overview", + "domain.runtime_health" + ], + "entity_candidates": [], + "symbol_candidates": [], + "layers": [ + "D1_DOCUMENT_CATALOG", + "D4_WORKFLOW_INDEX", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "filters": { + "doc_type": null + }, + "pipeline_mode": "pre_llm_only", + "gate_decision": "allow", + "prompt_used": "docs_explain_answer", + "llm_mode": "prose", + "degraded_reason": null, + "code_intents_stubbed": true + } + }, + "pipeline_steps": [ + { + "step": "input_query", + "input": { + "query": "Объясни цикл отправки уведомлений" + }, + "output": { + "query": "Объясни цикл отправки уведомлений" + } + }, + { + "step": "router", + "input": { + "query": "Объясни цикл отправки уведомлений" + }, + "output": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "SYSTEM_FLOW_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START" + } + }, + { + "step": "docs_pipeline", + "input": { + "query": "Объясни цикл отправки уведомлений" + }, + "output": { + "answer_mode": "ready", + "prompt_name": "docs_explain_answer", + "llm_request": { + "prompt_name": "docs_explain_answer", + "log_context": "graph.project_qa.docs.answer", + "prompt_stats": { + "system_chars": 393, + "user_chars": 20708, + "tokens_in_estimate": 5276 + } + }, + "degraded_reason": "" + } + } + ] +} \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/docs_pre_llm_v3/20260326_121025/full_chain_docs_intents_v3-3x_v3-system-flow-telegram-loop-1.md b/tests/pipeline_setup_v3/test_results/docs_pre_llm_v3/20260326_121025/full_chain_docs_intents_v3-3x_v3-system-flow-telegram-loop-1.md new file mode 100644 index 0000000..afc4a41 --- /dev/null +++ b/tests/pipeline_setup_v3/test_results/docs_pre_llm_v3/20260326_121025/full_chain_docs_intents_v3-3x_v3-system-flow-telegram-loop-1.md @@ -0,0 +1,882 @@ +# v3-system-flow-telegram-loop-1 + +- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_03_docs/full_chain_docs_intents_v3-3x.yaml +- runner: agent_runtime +- mode: pre_llm +- passed: True + +## Query +Объясни цикл отправки уведомлений + +## Actual +{ + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "SYSTEM_FLOW_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START", + "rag_count": 23, + "llm_answer": "", + "answer_mode": "answered", + "path_scope": [], + "doc_scope": [ + "docs/README.md", + "api.control_actions_endpoint", + "api.actions_endpoint", + "api.health_endpoint", + "api.send_message_endpoint", + "architecture.telegram_notify_app", + "architecture.telegram_notify_app_overview", + "domain.runtime_health" + ], + "entity_candidates": [], + "symbol_candidates": [], + "layers": [ + "D1_DOCUMENT_CATALOG", + "D4_WORKFLOW_INDEX", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "filters": { + "doc_type": null + }, + "pipeline_mode": "pre_llm_only", + "gate_decision": "allow", + "prompt_used": "docs_explain_answer", + "llm_mode": "prose", + "degraded_reason": null, + "code_intents_stubbed": true +} + +## Pipeline Steps +### input_query +```json +{ + "input": { + "query": "Объясни цикл отправки уведомлений" + }, + "output": { + "query": "Объясни цикл отправки уведомлений" + } +} +``` + +### router +```json +{ + "input": { + "query": "Объясни цикл отправки уведомлений" + }, + "output": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "SYSTEM_FLOW_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START" + } +} +``` + +### docs_pipeline +```json +{ + "input": { + "query": "Объясни цикл отправки уведомлений" + }, + "output": { + "answer_mode": "ready", + "prompt_name": "docs_explain_answer", + "llm_request": { + "prompt_name": "docs_explain_answer", + "log_context": "graph.project_qa.docs.answer", + "prompt_stats": { + "system_chars": 393, + "user_chars": 20708, + "tokens_in_estimate": 5276 + } + }, + "degraded_reason": "" + } +} +``` + +## Diagnostics +{ + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "SYSTEM_FLOW_EXPLAIN", + "layers_used": [ + "D1_DOCUMENT_CATALOG", + "D4_WORKFLOW_INDEX", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "documents_found": 6, + "facts_found": 0, + "relations_found": 8, + "openapi_fields_extracted": 0, + "missing_required_fields": [], + "openapi_status": { + "has_path": false, + "has_method": false, + "has_request": false, + "has_response": false + }, + "prompt_used": "docs_explain_answer", + "llm_mode": "prose", + "output_valid": true, + "matched_intent_source": "deterministic", + "matched_anchor_type": "none", + "matched_anchor_value": null, + "exact_anchor_match": false, + "docs_layers_requested": [ + "D1_DOCUMENT_CATALOG", + "D4_WORKFLOW_INDEX", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "docs_layers_with_hits": [ + "D1_DOCUMENT_CATALOG", + "D4_WORKFLOW_INDEX", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "planned_layers": [ + "D1_DOCUMENT_CATALOG", + "D4_WORKFLOW_INDEX", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "executed_layers": [ + "D1_DOCUMENT_CATALOG", + "D4_WORKFLOW_INDEX", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "non_empty_layers": [ + "D1_DOCUMENT_CATALOG", + "D4_WORKFLOW_INDEX", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "layer_diagnostics": { + "D1_DOCUMENT_CATALOG": { + "hits": 6, + "top_ids": [ + "docs/README.md", + "api.control_actions_endpoint", + "api.health_endpoint", + "api.send_message_endpoint", + "architecture.telegram_notify_app" + ] + }, + "D4_WORKFLOW_INDEX": { + "hits": 3, + "top_ids": [ + "api.control_actions_endpoint", + "api.health_endpoint", + "api.send_message_endpoint" + ] + }, + "D5_RELATION_GRAPH": { + "hits": 8, + "top_ids": [ + "5f4909bde905cd3d294ad307074a05e4ae4deefcafe6272cd2d0436e73acb8dd", + "711fb2edb82dd222deaba3c91768b18cbbd453009235823282813c6e867dc2c1", + "eec79f7a02b804337e791ef231784862ae26e0599eb20224790e9d4f085fa9c0", + "c718b1939621233295ccaf6e8203e7fd94f3dd1bfb88f10c51bc5e33d53a24aa", + "616f5cbf25da83cb51d8d0741a7fc351620c9ca2c6513fa2094b4aa476f0912a" + ] + }, + "D0_DOC_CHUNKS": { + "hits": 6, + "top_ids": [ + "docs/README.md", + "api.control_actions_endpoint" + ] + } + }, + "query_entity_candidates": [], + "resolved_entity_candidates": [], + "query_anchor_candidates": [], + "resolved_anchor_candidates": [ + "docs/README.md", + "api.control_actions_endpoint", + "docs/documentation/api/control-actions-endpoint.md", + "api.health_endpoint", + "docs/documentation/api/health-endpoint.md", + "api.send_message_endpoint", + "docs/documentation/api/send-message-endpoint.md", + "architecture.telegram_notify_app", + "docs/documentation/architecture/telegram-notify-app-overview.md", + "domain.runtime_health", + "docs/documentation/domain/runtime-health-entity.md" + ], + "anchor_candidates": [], + "selected_anchor": null, + "anchor_selection_reason": "", + "anchor_match_type": "", + "doc_ids": [ + "docs/README.md", + "api.control_actions_endpoint", + "api.actions_endpoint", + "api.health_endpoint", + "api.send_message_endpoint", + "architecture.telegram_notify_app", + "architecture.telegram_notify_app_overview", + "domain.runtime_health" + ], + "doc_paths": [ + "docs/README.md", + "docs/documentation/api/control-actions-endpoint.md", + "docs/documentation/api/health-endpoint.md", + "docs/documentation/api/send-message-endpoint.md", + "docs/documentation/architecture/telegram-notify-app-overview.md", + "docs/documentation/domain/runtime-health-entity.md" + ], + "doc_titles": [ + "Readme", + "HTTP API /actions/{action}", + "HTTP API /health", + "HTTP API /send", + "Архитектура Telegram Notify App", + "Сущность runtime health", + "Scenario", + "api.control_actions_endpoint:part_of", + "api.control_actions_endpoint:related_api", + "api.control_actions_endpoint:related_logic", + "api.health_endpoint:parent", + "api.health_endpoint:part_of", + "api.health_endpoint:depends_on", + "api.send_message_endpoint:parent", + "api.control_actions_endpoint:parent", + "docs/README.md:Структура", + "docs/README.md:Навигация", + "docs/README.md:Правила и шаблоны", + "api.control_actions_endpoint:Summary", + "api.control_actions_endpoint:Описание", + "docs/README.md:Project Docs" + ], + "relation_hits_count": 8, + "relation_targets": [ + "api.control_actions_endpoint:part_of", + "api.control_actions_endpoint:related_api", + "api.control_actions_endpoint:related_logic", + "api.health_endpoint:parent", + "api.health_endpoint:part_of", + "api.health_endpoint:depends_on", + "api.send_message_endpoint:parent", + "api.control_actions_endpoint:parent" + ], + "fallback_doc_hits_count": 12, + "fallback_used": false, + "fact_hits": 0, + "entity_hits": 0, + "evidence_summary": { + "documents": 6, + "facts": 0, + "relations": 8, + "chunks": 6, + "entity_hits": 0, + "openapi_signals": { + "path_found": false, + "method_found": false, + "request_schema": false, + "response_schema": false, + "status_codes": false, + "payload_description": false + } + }, + "gate_decision": "allow", + "gate_decision_reason": "evidence_sufficient", + "gate_missing_requirements": [], + "gate_satisfied_requirements": [ + "retrieval_non_empty" + ], + "openapi_evidence": { + "path_found": false, + "method_found": false, + "request_schema": false, + "response_schema": false, + "status_codes": false, + "payload_description": false + }, + "requested_fragment_type": null, + "fragment_evidence_found": [], + "fragment_missing_requirements": [], + "answer_mode": "ready", + "degrade_reason": null, + "degraded_reason": null, + "code_intents_stubbed": false +} + +## LLM Request +- prompt_name: docs_explain_answer +- log_context: graph.project_qa.docs.answer + +### Prompt Stats +```json +{ + "system_chars": 393, + "user_chars": 20708, + "tokens_in_estimate": 5276 +} +``` + +### System Prompt +```text +Ты объясняешь документацию системы. + +На вход приходит JSON с полями: +- question +- intent +- sub_intent +- documents +- facts +- relations + +Правила: +- Используй только предоставленные факты +- Не додумывай +- Если данных недостаточно, скажи это явно +- Объясняй структурировано + +Формат ответа: +1. Краткое описание +2. Основные элементы +3. Как это работает +4. Связи с другими частями системы (если есть) +``` + +### User Prompt +```json +{ + "question": "Объясни цикл отправки уведомлений", + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "SYSTEM_FLOW_EXPLAIN", + "documents": [ + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/README.md", + "title": "Readme", + "content": "Readme", + "metadata": { + "name": "", + "tags": [], + "type": "", + "layer": "", + "links": [], + "owner": null, + "title": "Readme", + "doc_id": null, + "module": "", + "parent": null, + "status": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "81d952f1a6ea85b76f75e0e57f33b8fa4b2bf3cb7db11b91b90171aeedd655a6", + "children": [], + "doc_kind": "readme", + "entities": [], + "updated_at": null, + "doc_version": null, + "document_id": "docs/README.md", + "source_path": "docs/README.md", + "summary_text": "", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "HTTP API /actions/{action}", + "content": "Endpoint `/actions/{action}` управляет control actions runtime и поддерживает `start`, `stop` и `status`. Для долгих операций `start` и `stop` допускается ответ HTTP 202, если действие еще выполняется. Endpoint используется для operator-driven управления жизненным циклом worker'а через HTTP API.", + "metadata": { + "name": "control_actions_endpoint", + "tags": [ + "api", + "control-plane", + "lifecycle" + ], + "type": "api_method", + "layer": "application", + "links": [ + { + "type": "part_of", + "target": "architecture.telegram_notify_app" + }, + { + "type": "related_api", + "target": "api.health_endpoint" + }, + { + "type": "related_logic", + "target": "logic.telegram_notification_loop" + } + ], + "owner": null, + "title": "HTTP API /actions/{action}", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "architecture.telegram_notify_app", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "children": [], + "doc_kind": "misc", + "entities": [ + "TelegramControlChannel", + "ControlActionSet", + "JSONResponse" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "api.control_actions_endpoint", + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "summary_text": "Endpoint `/actions/{action}` управляет control actions runtime и поддерживает `start`, `stop` и `status`. Для долгих операций `start` и `stop` допускается ответ HTTP 202, если действие еще выполняется. Endpoint используется для operator-driven управления жизненным циклом worker'а через HTTP API.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/api/health-endpoint.md", + "title": "HTTP API /health", + "content": "Endpoint `/health` возвращает агрегированный health payload runtime. Если общий статус равен `ok`, API отвечает с HTTP 200; для состояний деградации или неготовности возвращается HTTP 503 с тем же payload. Endpoint служит основной точкой внешней проверки состояния приложения.", + "metadata": { + "name": "health_endpoint", + "tags": [ + "api", + "health", + "control-plane" + ], + "type": "api_method", + "layer": "application", + "links": [ + { + "type": "part_of", + "target": "architecture.telegram_notify_app" + }, + { + "type": "depends_on", + "target": "domain.runtime_health" + } + ], + "owner": null, + "title": "HTTP API /health", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "architecture.telegram_notify_app", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "8b5a533a8076e2e9d36995eee29aeade260080bdca2ec8e21fe28f08574b983f", + "children": [], + "doc_kind": "misc", + "entities": [ + "TelegramControlChannel", + "TelegramNotifyWorker", + "RuntimeManager", + "WorkerHealth" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "api.health_endpoint", + "source_path": "docs/documentation/api/health-endpoint.md", + "summary_text": "Endpoint `/health` возвращает агрегированный health payload runtime. Если общий статус равен `ok`, API отвечает с HTTP 200; для состояний деградации или неготовности возвращается HTTP 503 с тем же payload. Endpoint служит основной точкой внешней проверки состояния приложения.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/api/send-message-endpoint.md", + "title": "HTTP API /send", + "content": "Endpoint `/send` выполняет ручную отправку сообщения в Telegram через `TelegramSendService`. Он используется для операторской проверки доставки и для отправки уведомлений вне периодического worker loop. Endpoint работает поверх тех же credentials и того же delivery path, что и фоновая отправка.", + "metadata": { + "name": "send_message_endpoint", + "tags": [ + "api", + "telegram", + "manual-send" + ], + "type": "api_method", + "layer": "application", + "links": [ + { + "type": "part_of", + "target": "architecture.telegram_notify_app" + }, + { + "type": "depends_on", + "target": "logic.telegram_notification_loop" + } + ], + "owner": null, + "title": "HTTP API /send", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "architecture.telegram_notify_app", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "5fbf2e33510b0676a3a53b957a4569bd3c2c31fb7719546602c573421ccaa32d", + "children": [], + "doc_kind": "misc", + "entities": [ + "TelegramControlAppFactory", + "TelegramSendService", + "TelegramNotifyWorker" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "api.send_message_endpoint", + "source_path": "docs/documentation/api/send-message-endpoint.md", + "summary_text": "Endpoint `/send` выполняет ручную отправку сообщения в Telegram через `TelegramSendService`. Он используется для операторской проверки доставки и для отправки уведомлений вне периодического worker loop. Endpoint работает поверх тех же credentials и того же delivery path, что и фоновая отправка.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/architecture/telegram-notify-app-overview.md", + "title": "Архитектура Telegram Notify App", + "content": "`test_echo_app` — сервис на базе PLBA runtime, который поднимает HTTP control plane и запускает фоновый воркер для периодической отправки уведомлений в Telegram. Приложение использует YAML-конфиг для runtime-настроек и переменные окружения для Telegram credentials. Основной контур системы состоит из runtime manager, control channel, send service и worker loop.", + "metadata": { + "name": "telegram_notify_app_overview", + "tags": [ + "architecture", + "telegram", + "plba", + "runtime" + ], + "type": "architecture_overview", + "layer": "system", + "links": [ + { + "type": "related_api", + "target": "api.health_endpoint" + }, + { + "type": "related_api", + "target": "api.control_actions_endpoint" + }, + { + "type": "related_api", + "target": "api.send_message_endpoint" + }, + { + "type": "depends_on", + "target": "logic.telegram_notification_loop" + }, + { + "type": "depends_on", + "target": "domain.runtime_health" + } + ], + "owner": null, + "title": "Архитектура Telegram Notify App", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "docs_root", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "8b1cc9f823e55bddbc825466d10a0fdb4ca4354ac02d91f9e2aef7b7d2ec8256", + "children": [ + "api.health_endpoint", + "api.control_actions_endpoint", + "api.send_message_endpoint", + "logic.telegram_notification_loop", + "domain.runtime_health" + ], + "doc_kind": "spec", + "entities": [ + "TelegramNotifyModule", + "TelegramNotifyWorker", + "TelegramControlChannel", + "TelegramSendService", + "RuntimeManager" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "architecture.telegram_notify_app", + "source_path": "docs/documentation/architecture/telegram-notify-app-overview.md", + "summary_text": "`test_echo_app` — сервис на базе PLBA runtime, который поднимает HTTP control plane и запускает фоновый воркер для периодической отправки уведомлений в Telegram. Приложение использует YAML-конфиг для runtime-настроек и переменные окружения для Telegram credentials. Основной контур системы состоит из runtime manager, control channel, send service и worker loop.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/domain/runtime-health-entity.md", + "title": "Сущность runtime health", + "content": "`runtime health` — доменная модель наблюдаемости сервиса, которая описывает общее состояние runtime и состояние отдельных компонентов. Для `test_echo_app` главным объектом наблюдения является компонент `telegram_notify`, у которого важны статус, время старта и количество успешных отправок. Эта модель используется для внешнего health-monitoring и внутренней диагностики.", + "metadata": { + "name": "runtime_health", + "tags": [ + "domain", + "health", + "observability" + ], + "type": "domain_entity", + "layer": "domain", + "links": [ + { + "type": "part_of", + "target": "architecture.telegram_notify_app" + }, + { + "type": "used_by", + "target": "api.health_endpoint" + }, + { + "type": "related_logic", + "target": "logic.telegram_notification_loop" + } + ], + "owner": null, + "title": "Сущность runtime health", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "architecture.telegram_notify_app", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "37d4dcf470ea3de95d59e44786006e369a3ea11bf5dbf4c88877696e9183ee87", + "children": [], + "doc_kind": "misc", + "entities": [ + "WorkerHealth", + "WorkerStatus", + "TelegramNotifyWorker" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "domain.runtime_health", + "source_path": "docs/documentation/domain/runtime-health-entity.md", + "summary_text": "`runtime health` — доменная модель наблюдаемости сервиса, которая описывает общее состояние runtime и состояние отдельных компонентов. Для `test_echo_app` главным объектом наблюдения является компонент `telegram_notify`, у которого важны статус, время старта и количество успешных отправок. Эта модель используется для внешнего health-monitoring и внутренней диагностики.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + } + ], + "facts": [], + "relations": [ + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "api.control_actions_endpoint:part_of", + "content": "api.control_actions_endpoint part_of architecture.telegram_notify_app", + "metadata": { + "owner": null, + "anchor": "frontmatter.links", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "source_id": "api.control_actions_endpoint", + "target_id": "architecture.telegram_notify_app", + "doc_version": null, + "relation_id": "5f4909bde905cd3d294ad307074a05e4ae4deefcafe6272cd2d0436e73acb8dd", + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "part_of", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "api.control_actions_endpoint:related_api", + "content": "api.control_actions_endpoint related_api api.health_endpoint", + "metadata": { + "owner": null, + "anchor": "frontmatter.links", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "source_id": "api.control_actions_endpoint", + "target_id": "api.health_endpoint", + "doc_version": null, + "relation_id": "711fb2edb82dd222deaba3c91768b18cbbd453009235823282813c6e867dc2c1", + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "related_api", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "api.control_actions_endpoint:related_logic", + "content": "api.control_actions_endpoint related_logic logic.telegram_notification_loop", + "metadata": { + "owner": null, + "anchor": "frontmatter.links", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "source_id": "api.control_actions_endpoint", + "target_id": "logic.telegram_notification_loop", + "doc_version": null, + "relation_id": "eec79f7a02b804337e791ef231784862ae26e0599eb20224790e9d4f085fa9c0", + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "related_logic", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/api/health-endpoint.md", + "title": "api.health_endpoint:parent", + "content": "api.health_endpoint parent architecture.telegram_notify_app", + "metadata": { + "owner": null, + "anchor": "frontmatter.parent", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "8b5a533a8076e2e9d36995eee29aeade260080bdca2ec8e21fe28f08574b983f", + "source_id": "api.health_endpoint", + "target_id": "architecture.telegram_notify_app", + "doc_version": null, + "relation_id": "c718b1939621233295ccaf6e8203e7fd94f3dd1bfb88f10c51bc5e33d53a24aa", + "source_path": "docs/documentation/api/health-endpoint.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "parent", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/api/health-endpoint.md", + "title": "api.health_endpoint:part_of", + "content": "api.health_endpoint part_of architecture.telegram_notify_app", + "metadata": { + "owner": null, + "anchor": "frontmatter.links", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "8b5a533a8076e2e9d36995eee29aeade260080bdca2ec8e21fe28f08574b983f", + "source_id": "api.health_endpoint", + "target_id": "architecture.telegram_notify_app", + "doc_version": null, + "relation_id": "616f5cbf25da83cb51d8d0741a7fc351620c9ca2c6513fa2094b4aa476f0912a", + "source_path": "docs/documentation/api/health-endpoint.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "part_of", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/api/health-endpoint.md", + "title": "api.health_endpoint:depends_on", + "content": "api.health_endpoint depends_on domain.runtime_health", + "metadata": { + "owner": null, + "anchor": "frontmatter.links", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "8b5a533a8076e2e9d36995eee29aeade260080bdca2ec8e21fe28f08574b983f", + "source_id": "api.health_endpoint", + "target_id": "domain.runtime_health", + "doc_version": null, + "relation_id": "77f5d358ab85b3d92018b6b51da7c39773148dfd346686e8832a45370c841160", + "source_path": "docs/documentation/api/health-endpoint.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "depends_on", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/api/send-message-endpoint.md", + "title": "api.send_message_endpoint:parent", + "content": "api.send_message_endpoint parent architecture.telegram_notify_app", + "metadata": { + "owner": null, + "anchor": "frontmatter.parent", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "5fbf2e33510b0676a3a53b957a4569bd3c2c31fb7719546602c573421ccaa32d", + "source_id": "api.send_message_endpoint", + "target_id": "architecture.telegram_notify_app", + "doc_version": null, + "relation_id": "33eb0aa97f06d0afcaa4c230b5f5b73fa2fbfa5861ea9367b6c92f8a6fe0c054", + "source_path": "docs/documentation/api/send-message-endpoint.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "parent", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "api.control_actions_endpoint:parent", + "content": "api.control_actions_endpoint parent architecture.telegram_notify_app", + "metadata": { + "owner": null, + "anchor": "frontmatter.parent", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "source_id": "api.control_actions_endpoint", + "target_id": "architecture.telegram_notify_app", + "doc_version": null, + "relation_id": "afec31fd062e392dcd9699a92c7ab61fd4b1273c1a2b16702b23d55d8d0c47ac", + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "parent", + "staleness_score": null, + "system_component": null + } + } + ] +} +``` + +### User Prompt Overview +- question: Объясни цикл отправки уведомлений +- intent: DOCUMENTATION_EXPLAIN +- sub_intent: SYSTEM_FLOW_EXPLAIN +- documents: 6 | samples: Readme, HTTP API /actions/{action}, HTTP API /health +- facts: 0 +- relations: 8 | samples: api.control_actions_endpoint:part_of, api.control_actions_endpoint:related_api, api.control_actions_endpoint:related_logic + +## Mismatches +- none \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/docs_pre_llm_v3/20260326_121025/full_chain_docs_intents_v3-3x_v3-system-flow-telegram-loop-2.json b/tests/pipeline_setup_v3/test_results/docs_pre_llm_v3/20260326_121025/full_chain_docs_intents_v3-3x_v3-system-flow-telegram-loop-2.json new file mode 100644 index 0000000..ba9c70c --- /dev/null +++ b/tests/pipeline_setup_v3/test_results/docs_pre_llm_v3/20260326_121025/full_chain_docs_intents_v3-3x_v3-system-flow-telegram-loop-2.json @@ -0,0 +1,91 @@ +{ + "meta": { + "case_id": "v3-system-flow-telegram-loop-2", + "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_03_docs/full_chain_docs_intents_v3-3x.yaml", + "runner": "agent_runtime", + "mode": "pre_llm", + "passed": true, + "mismatches": [], + "actual": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "SYSTEM_FLOW_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START", + "rag_count": 18, + "llm_answer": "", + "answer_mode": "answered", + "path_scope": [], + "doc_scope": [ + "architecture.telegram_notify_app", + "architecture.telegram_notify_app_overview", + "logic.telegram_notification_loop", + "api.send_message_endpoint", + "domain.runtime_health", + "api.health_endpoint", + "api.control_actions_endpoint", + "api.actions_endpoint", + "docs/README.md" + ], + "entity_candidates": [], + "symbol_candidates": [], + "layers": [ + "D1_DOCUMENT_CATALOG", + "D4_WORKFLOW_INDEX", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "filters": { + "doc_type": null + }, + "pipeline_mode": "pre_llm_only", + "gate_decision": "allow", + "prompt_used": "docs_explain_answer", + "llm_mode": "prose", + "degraded_reason": null, + "code_intents_stubbed": true + } + }, + "pipeline_steps": [ + { + "step": "input_query", + "input": { + "query": "Как работает процесс отправки уведомлений в Telegram?" + }, + "output": { + "query": "Как работает процесс отправки уведомлений в Telegram?" + } + }, + { + "step": "router", + "input": { + "query": "Как работает процесс отправки уведомлений в Telegram?" + }, + "output": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "SYSTEM_FLOW_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START" + } + }, + { + "step": "docs_pipeline", + "input": { + "query": "Как работает процесс отправки уведомлений в Telegram?" + }, + "output": { + "answer_mode": "ready", + "prompt_name": "docs_explain_answer", + "llm_request": { + "prompt_name": "docs_explain_answer", + "log_context": "graph.project_qa.docs.answer", + "prompt_stats": { + "system_chars": 393, + "user_chars": 17588, + "tokens_in_estimate": 4496 + } + }, + "degraded_reason": "" + } + } + ] +} \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/docs_pre_llm_v3/20260326_121025/full_chain_docs_intents_v3-3x_v3-system-flow-telegram-loop-2.md b/tests/pipeline_setup_v3/test_results/docs_pre_llm_v3/20260326_121025/full_chain_docs_intents_v3-3x_v3-system-flow-telegram-loop-2.md new file mode 100644 index 0000000..63fd540 --- /dev/null +++ b/tests/pipeline_setup_v3/test_results/docs_pre_llm_v3/20260326_121025/full_chain_docs_intents_v3-3x_v3-system-flow-telegram-loop-2.md @@ -0,0 +1,785 @@ +# v3-system-flow-telegram-loop-2 + +- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_03_docs/full_chain_docs_intents_v3-3x.yaml +- runner: agent_runtime +- mode: pre_llm +- passed: True + +## Query +Как работает процесс отправки уведомлений в Telegram? + +## Actual +{ + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "SYSTEM_FLOW_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START", + "rag_count": 18, + "llm_answer": "", + "answer_mode": "answered", + "path_scope": [], + "doc_scope": [ + "architecture.telegram_notify_app", + "architecture.telegram_notify_app_overview", + "logic.telegram_notification_loop", + "api.send_message_endpoint", + "domain.runtime_health", + "api.health_endpoint", + "api.control_actions_endpoint", + "api.actions_endpoint", + "docs/README.md" + ], + "entity_candidates": [], + "symbol_candidates": [], + "layers": [ + "D1_DOCUMENT_CATALOG", + "D4_WORKFLOW_INDEX", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "filters": { + "doc_type": null + }, + "pipeline_mode": "pre_llm_only", + "gate_decision": "allow", + "prompt_used": "docs_explain_answer", + "llm_mode": "prose", + "degraded_reason": null, + "code_intents_stubbed": true +} + +## Pipeline Steps +### input_query +```json +{ + "input": { + "query": "Как работает процесс отправки уведомлений в Telegram?" + }, + "output": { + "query": "Как работает процесс отправки уведомлений в Telegram?" + } +} +``` + +### router +```json +{ + "input": { + "query": "Как работает процесс отправки уведомлений в Telegram?" + }, + "output": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "SYSTEM_FLOW_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START" + } +} +``` + +### docs_pipeline +```json +{ + "input": { + "query": "Как работает процесс отправки уведомлений в Telegram?" + }, + "output": { + "answer_mode": "ready", + "prompt_name": "docs_explain_answer", + "llm_request": { + "prompt_name": "docs_explain_answer", + "log_context": "graph.project_qa.docs.answer", + "prompt_stats": { + "system_chars": 393, + "user_chars": 17588, + "tokens_in_estimate": 4496 + } + }, + "degraded_reason": "" + } +} +``` + +## Diagnostics +{ + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "SYSTEM_FLOW_EXPLAIN", + "layers_used": [ + "D1_DOCUMENT_CATALOG", + "D4_WORKFLOW_INDEX", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "documents_found": 6, + "facts_found": 0, + "relations_found": 3, + "openapi_fields_extracted": 0, + "missing_required_fields": [], + "openapi_status": { + "has_path": false, + "has_method": false, + "has_request": false, + "has_response": false + }, + "prompt_used": "docs_explain_answer", + "llm_mode": "prose", + "output_valid": true, + "matched_intent_source": "deterministic", + "matched_anchor_type": "workflow", + "matched_anchor_value": "отправки", + "exact_anchor_match": false, + "docs_layers_requested": [ + "D1_DOCUMENT_CATALOG", + "D4_WORKFLOW_INDEX", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "docs_layers_with_hits": [ + "D1_DOCUMENT_CATALOG", + "D4_WORKFLOW_INDEX", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "planned_layers": [ + "D1_DOCUMENT_CATALOG", + "D4_WORKFLOW_INDEX", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "executed_layers": [ + "D1_DOCUMENT_CATALOG", + "D4_WORKFLOW_INDEX", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "non_empty_layers": [ + "D1_DOCUMENT_CATALOG", + "D4_WORKFLOW_INDEX", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "layer_diagnostics": { + "D1_DOCUMENT_CATALOG": { + "hits": 6, + "top_ids": [ + "architecture.telegram_notify_app", + "logic.telegram_notification_loop", + "api.send_message_endpoint", + "domain.runtime_health", + "api.health_endpoint" + ] + }, + "D4_WORKFLOW_INDEX": { + "hits": 3, + "top_ids": [ + "api.control_actions_endpoint", + "api.health_endpoint", + "api.send_message_endpoint" + ] + }, + "D5_RELATION_GRAPH": { + "hits": 8, + "top_ids": [ + "305bab0c6567d93a2b453a9d70b676f9ecd8de083ef36f5cf3398747c25ebf94", + "7bd0428d23e9b20f7d65202cc269e45b3d1e7aed7b5df4a35581fd88677be29b", + "0eb7f73fcda8556439e06f5eeb5ce064ae32b6cd3129353f5b1b4eb3db626d88", + "ae34fe4b3cd2b47632b13b1e32303e842b57948aa21160abe8d9b478995e1d74", + "145ccbb861a8fb621286ec9c888ce69677168d35c7871c70537e888ce3a5b910" + ] + }, + "D0_DOC_CHUNKS": { + "hits": 6, + "top_ids": [ + "logic.telegram_notification_loop", + "architecture.telegram_notify_app", + "docs/README.md" + ] + } + }, + "query_entity_candidates": [], + "resolved_entity_candidates": [], + "query_anchor_candidates": [], + "resolved_anchor_candidates": [ + "architecture.telegram_notify_app", + "docs/documentation/architecture/telegram-notify-app-overview.md", + "logic.telegram_notification_loop", + "docs/documentation/logic/telegram-notification-loop.md", + "api.send_message_endpoint", + "docs/documentation/api/send-message-endpoint.md", + "domain.runtime_health", + "docs/documentation/domain/runtime-health-entity.md", + "api.health_endpoint", + "docs/documentation/api/health-endpoint.md", + "api.control_actions_endpoint", + "docs/documentation/api/control-actions-endpoint.md", + "docs/README.md" + ], + "anchor_candidates": [], + "selected_anchor": null, + "anchor_selection_reason": "", + "anchor_match_type": "", + "doc_ids": [ + "architecture.telegram_notify_app", + "architecture.telegram_notify_app_overview", + "logic.telegram_notification_loop", + "api.send_message_endpoint", + "domain.runtime_health", + "api.health_endpoint", + "api.control_actions_endpoint", + "api.actions_endpoint", + "docs/README.md" + ], + "doc_paths": [ + "docs/documentation/architecture/telegram-notify-app-overview.md", + "docs/documentation/logic/telegram-notification-loop.md", + "docs/documentation/api/send-message-endpoint.md", + "docs/documentation/domain/runtime-health-entity.md", + "docs/documentation/api/health-endpoint.md", + "docs/documentation/api/control-actions-endpoint.md", + "docs/README.md" + ], + "doc_titles": [ + "Архитектура Telegram Notify App", + "Цикл отправки уведомлений в Telegram", + "HTTP API /send", + "Сущность runtime health", + "HTTP API /health", + "HTTP API /actions/{action}", + "Scenario", + "architecture.telegram_notify_app:child", + "architecture.telegram_notify_app:related_api", + "architecture.telegram_notify_app:parent", + "logic.telegram_notification_loop:Summary", + "logic.telegram_notification_loop:Details", + "architecture.telegram_notify_app:Summary", + "architecture.telegram_notify_app:Details", + "docs/README.md:Навигация", + "api.health_endpoint:Функциональные требования" + ], + "relation_hits_count": 3, + "relation_targets": [ + "architecture.telegram_notify_app:child", + "architecture.telegram_notify_app:related_api", + "architecture.telegram_notify_app:parent" + ], + "fallback_doc_hits_count": 12, + "fallback_used": false, + "fact_hits": 0, + "entity_hits": 0, + "evidence_summary": { + "documents": 6, + "facts": 0, + "relations": 3, + "chunks": 6, + "entity_hits": 0, + "openapi_signals": { + "path_found": false, + "method_found": false, + "request_schema": false, + "response_schema": false, + "status_codes": false, + "payload_description": false + } + }, + "gate_decision": "allow", + "gate_decision_reason": "evidence_sufficient", + "gate_missing_requirements": [], + "gate_satisfied_requirements": [ + "retrieval_non_empty" + ], + "openapi_evidence": { + "path_found": false, + "method_found": false, + "request_schema": false, + "response_schema": false, + "status_codes": false, + "payload_description": false + }, + "requested_fragment_type": null, + "fragment_evidence_found": [], + "fragment_missing_requirements": [], + "answer_mode": "ready", + "degrade_reason": null, + "degraded_reason": null, + "code_intents_stubbed": false +} + +## LLM Request +- prompt_name: docs_explain_answer +- log_context: graph.project_qa.docs.answer + +### Prompt Stats +```json +{ + "system_chars": 393, + "user_chars": 17588, + "tokens_in_estimate": 4496 +} +``` + +### System Prompt +```text +Ты объясняешь документацию системы. + +На вход приходит JSON с полями: +- question +- intent +- sub_intent +- documents +- facts +- relations + +Правила: +- Используй только предоставленные факты +- Не додумывай +- Если данных недостаточно, скажи это явно +- Объясняй структурировано + +Формат ответа: +1. Краткое описание +2. Основные элементы +3. Как это работает +4. Связи с другими частями системы (если есть) +``` + +### User Prompt +```json +{ + "question": "Как работает процесс отправки уведомлений в Telegram?", + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "SYSTEM_FLOW_EXPLAIN", + "documents": [ + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/architecture/telegram-notify-app-overview.md", + "title": "Архитектура Telegram Notify App", + "content": "`test_echo_app` — сервис на базе PLBA runtime, который поднимает HTTP control plane и запускает фоновый воркер для периодической отправки уведомлений в Telegram. Приложение использует YAML-конфиг для runtime-настроек и переменные окружения для Telegram credentials. Основной контур системы состоит из runtime manager, control channel, send service и worker loop.", + "metadata": { + "name": "telegram_notify_app_overview", + "tags": [ + "architecture", + "telegram", + "plba", + "runtime" + ], + "type": "architecture_overview", + "layer": "system", + "links": [ + { + "type": "related_api", + "target": "api.health_endpoint" + }, + { + "type": "related_api", + "target": "api.control_actions_endpoint" + }, + { + "type": "related_api", + "target": "api.send_message_endpoint" + }, + { + "type": "depends_on", + "target": "logic.telegram_notification_loop" + }, + { + "type": "depends_on", + "target": "domain.runtime_health" + } + ], + "owner": null, + "title": "Архитектура Telegram Notify App", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "docs_root", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "8b1cc9f823e55bddbc825466d10a0fdb4ca4354ac02d91f9e2aef7b7d2ec8256", + "children": [ + "api.health_endpoint", + "api.control_actions_endpoint", + "api.send_message_endpoint", + "logic.telegram_notification_loop", + "domain.runtime_health" + ], + "doc_kind": "spec", + "entities": [ + "TelegramNotifyModule", + "TelegramNotifyWorker", + "TelegramControlChannel", + "TelegramSendService", + "RuntimeManager" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "architecture.telegram_notify_app", + "source_path": "docs/documentation/architecture/telegram-notify-app-overview.md", + "summary_text": "`test_echo_app` — сервис на базе PLBA runtime, который поднимает HTTP control plane и запускает фоновый воркер для периодической отправки уведомлений в Telegram. Приложение использует YAML-конфиг для runtime-настроек и переменные окружения для Telegram credentials. Основной контур системы состоит из runtime manager, control channel, send service и worker loop.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/logic/telegram-notification-loop.md", + "title": "Цикл отправки уведомлений в Telegram", + "content": "`TelegramNotifyWorker` после старта runtime запускает отдельный поток, сразу делает первую попытку отправки сообщения и затем повторяет отправку через заданный интервал. При ошибках доставки или отсутствии credentials worker не останавливает сервис, а переводит собственное состояние в `degraded`. Этот workflow определяет основной полезный цикл приложения.", + "metadata": { + "name": "telegram_notification_loop", + "tags": [ + "logic", + "telegram", + "worker", + "scheduling" + ], + "type": "logic_block", + "layer": "application", + "links": [ + { + "type": "part_of", + "target": "architecture.telegram_notify_app" + }, + { + "type": "related_api", + "target": "api.send_message_endpoint" + }, + { + "type": "related_api", + "target": "api.control_actions_endpoint" + }, + { + "type": "related_api", + "target": "api.health_endpoint" + } + ], + "owner": null, + "title": "Цикл отправки уведомлений в Telegram", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "architecture.telegram_notify_app", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "0f62f9b4dab261ca4ca34575ff5d84411a22c90b780c52eda388782b94f08470", + "children": [], + "doc_kind": "misc", + "entities": [ + "TelegramNotifyWorker", + "TelegramSendService", + "WorkerHealth", + "WorkerStatus" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "logic.telegram_notification_loop", + "source_path": "docs/documentation/logic/telegram-notification-loop.md", + "summary_text": "`TelegramNotifyWorker` после старта runtime запускает отдельный поток, сразу делает первую попытку отправки сообщения и затем повторяет отправку через заданный интервал. При ошибках доставки или отсутствии credentials worker не останавливает сервис, а переводит собственное состояние в `degraded`. Этот workflow определяет основной полезный цикл приложения.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/api/send-message-endpoint.md", + "title": "HTTP API /send", + "content": "Endpoint `/send` выполняет ручную отправку сообщения в Telegram через `TelegramSendService`. Он используется для операторской проверки доставки и для отправки уведомлений вне периодического worker loop. Endpoint работает поверх тех же credentials и того же delivery path, что и фоновая отправка.", + "metadata": { + "name": "send_message_endpoint", + "tags": [ + "api", + "telegram", + "manual-send" + ], + "type": "api_method", + "layer": "application", + "links": [ + { + "type": "part_of", + "target": "architecture.telegram_notify_app" + }, + { + "type": "depends_on", + "target": "logic.telegram_notification_loop" + } + ], + "owner": null, + "title": "HTTP API /send", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "architecture.telegram_notify_app", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "5fbf2e33510b0676a3a53b957a4569bd3c2c31fb7719546602c573421ccaa32d", + "children": [], + "doc_kind": "misc", + "entities": [ + "TelegramControlAppFactory", + "TelegramSendService", + "TelegramNotifyWorker" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "api.send_message_endpoint", + "source_path": "docs/documentation/api/send-message-endpoint.md", + "summary_text": "Endpoint `/send` выполняет ручную отправку сообщения в Telegram через `TelegramSendService`. Он используется для операторской проверки доставки и для отправки уведомлений вне периодического worker loop. Endpoint работает поверх тех же credentials и того же delivery path, что и фоновая отправка.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/domain/runtime-health-entity.md", + "title": "Сущность runtime health", + "content": "`runtime health` — доменная модель наблюдаемости сервиса, которая описывает общее состояние runtime и состояние отдельных компонентов. Для `test_echo_app` главным объектом наблюдения является компонент `telegram_notify`, у которого важны статус, время старта и количество успешных отправок. Эта модель используется для внешнего health-monitoring и внутренней диагностики.", + "metadata": { + "name": "runtime_health", + "tags": [ + "domain", + "health", + "observability" + ], + "type": "domain_entity", + "layer": "domain", + "links": [ + { + "type": "part_of", + "target": "architecture.telegram_notify_app" + }, + { + "type": "used_by", + "target": "api.health_endpoint" + }, + { + "type": "related_logic", + "target": "logic.telegram_notification_loop" + } + ], + "owner": null, + "title": "Сущность runtime health", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "architecture.telegram_notify_app", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "37d4dcf470ea3de95d59e44786006e369a3ea11bf5dbf4c88877696e9183ee87", + "children": [], + "doc_kind": "misc", + "entities": [ + "WorkerHealth", + "WorkerStatus", + "TelegramNotifyWorker" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "domain.runtime_health", + "source_path": "docs/documentation/domain/runtime-health-entity.md", + "summary_text": "`runtime health` — доменная модель наблюдаемости сервиса, которая описывает общее состояние runtime и состояние отдельных компонентов. Для `test_echo_app` главным объектом наблюдения является компонент `telegram_notify`, у которого важны статус, время старта и количество успешных отправок. Эта модель используется для внешнего health-monitoring и внутренней диагностики.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/api/health-endpoint.md", + "title": "HTTP API /health", + "content": "Endpoint `/health` возвращает агрегированный health payload runtime. Если общий статус равен `ok`, API отвечает с HTTP 200; для состояний деградации или неготовности возвращается HTTP 503 с тем же payload. Endpoint служит основной точкой внешней проверки состояния приложения.", + "metadata": { + "name": "health_endpoint", + "tags": [ + "api", + "health", + "control-plane" + ], + "type": "api_method", + "layer": "application", + "links": [ + { + "type": "part_of", + "target": "architecture.telegram_notify_app" + }, + { + "type": "depends_on", + "target": "domain.runtime_health" + } + ], + "owner": null, + "title": "HTTP API /health", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "architecture.telegram_notify_app", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "8b5a533a8076e2e9d36995eee29aeade260080bdca2ec8e21fe28f08574b983f", + "children": [], + "doc_kind": "misc", + "entities": [ + "TelegramControlChannel", + "TelegramNotifyWorker", + "RuntimeManager", + "WorkerHealth" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "api.health_endpoint", + "source_path": "docs/documentation/api/health-endpoint.md", + "summary_text": "Endpoint `/health` возвращает агрегированный health payload runtime. Если общий статус равен `ok`, API отвечает с HTTP 200; для состояний деградации или неготовности возвращается HTTP 503 с тем же payload. Endpoint служит основной точкой внешней проверки состояния приложения.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "HTTP API /actions/{action}", + "content": "Endpoint `/actions/{action}` управляет control actions runtime и поддерживает `start`, `stop` и `status`. Для долгих операций `start` и `stop` допускается ответ HTTP 202, если действие еще выполняется. Endpoint используется для operator-driven управления жизненным циклом worker'а через HTTP API.", + "metadata": { + "name": "control_actions_endpoint", + "tags": [ + "api", + "control-plane", + "lifecycle" + ], + "type": "api_method", + "layer": "application", + "links": [ + { + "type": "part_of", + "target": "architecture.telegram_notify_app" + }, + { + "type": "related_api", + "target": "api.health_endpoint" + }, + { + "type": "related_logic", + "target": "logic.telegram_notification_loop" + } + ], + "owner": null, + "title": "HTTP API /actions/{action}", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "architecture.telegram_notify_app", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "children": [], + "doc_kind": "misc", + "entities": [ + "TelegramControlChannel", + "ControlActionSet", + "JSONResponse" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "api.control_actions_endpoint", + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "summary_text": "Endpoint `/actions/{action}` управляет control actions runtime и поддерживает `start`, `stop` и `status`. Для долгих операций `start` и `stop` допускается ответ HTTP 202, если действие еще выполняется. Endpoint используется для operator-driven управления жизненным циклом worker'а через HTTP API.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + } + ], + "facts": [], + "relations": [ + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/architecture/telegram-notify-app-overview.md", + "title": "architecture.telegram_notify_app:child", + "content": "architecture.telegram_notify_app child api.send_message_endpoint", + "metadata": { + "owner": null, + "anchor": "frontmatter.children", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "8b1cc9f823e55bddbc825466d10a0fdb4ca4354ac02d91f9e2aef7b7d2ec8256", + "source_id": "architecture.telegram_notify_app", + "target_id": "api.send_message_endpoint", + "doc_version": null, + "relation_id": "305bab0c6567d93a2b453a9d70b676f9ecd8de083ef36f5cf3398747c25ebf94", + "source_path": "docs/documentation/architecture/telegram-notify-app-overview.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "child", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/architecture/telegram-notify-app-overview.md", + "title": "architecture.telegram_notify_app:related_api", + "content": "architecture.telegram_notify_app related_api api.health_endpoint", + "metadata": { + "owner": null, + "anchor": "frontmatter.links", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "8b1cc9f823e55bddbc825466d10a0fdb4ca4354ac02d91f9e2aef7b7d2ec8256", + "source_id": "architecture.telegram_notify_app", + "target_id": "api.health_endpoint", + "doc_version": null, + "relation_id": "7bd0428d23e9b20f7d65202cc269e45b3d1e7aed7b5df4a35581fd88677be29b", + "source_path": "docs/documentation/architecture/telegram-notify-app-overview.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "related_api", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/architecture/telegram-notify-app-overview.md", + "title": "architecture.telegram_notify_app:parent", + "content": "architecture.telegram_notify_app parent docs_root", + "metadata": { + "owner": null, + "anchor": "frontmatter.parent", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "8b1cc9f823e55bddbc825466d10a0fdb4ca4354ac02d91f9e2aef7b7d2ec8256", + "source_id": "architecture.telegram_notify_app", + "target_id": "docs_root", + "doc_version": null, + "relation_id": "e01922b36e3cc60d9349f89e43fcd4a92c6a01394b0028d6b6d56801b258645d", + "source_path": "docs/documentation/architecture/telegram-notify-app-overview.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "parent", + "staleness_score": null, + "system_component": null + } + } + ] +} +``` + +### User Prompt Overview +- question: Как работает процесс отправки уведомлений в Telegram? +- intent: DOCUMENTATION_EXPLAIN +- sub_intent: SYSTEM_FLOW_EXPLAIN +- documents: 6 | samples: Архитектура Telegram Notify App, Цикл отправки уведомлений в Telegram, HTTP API /send +- facts: 0 +- relations: 3 | samples: architecture.telegram_notify_app:child, architecture.telegram_notify_app:related_api, architecture.telegram_notify_app:parent + +## Mismatches +- none \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/docs_pre_llm_v3/20260326_121025/full_chain_docs_intents_v3-3x_v3-system-flow-telegram-loop-3.json b/tests/pipeline_setup_v3/test_results/docs_pre_llm_v3/20260326_121025/full_chain_docs_intents_v3-3x_v3-system-flow-telegram-loop-3.json new file mode 100644 index 0000000..f17e612 --- /dev/null +++ b/tests/pipeline_setup_v3/test_results/docs_pre_llm_v3/20260326_121025/full_chain_docs_intents_v3-3x_v3-system-flow-telegram-loop-3.json @@ -0,0 +1,91 @@ +{ + "meta": { + "case_id": "v3-system-flow-telegram-loop-3", + "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_03_docs/full_chain_docs_intents_v3-3x.yaml", + "runner": "agent_runtime", + "mode": "pre_llm", + "passed": true, + "mismatches": [], + "actual": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "SYSTEM_FLOW_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START", + "rag_count": 18, + "llm_answer": "", + "answer_mode": "answered", + "path_scope": [], + "doc_scope": [ + "architecture.telegram_notify_app", + "architecture.telegram_notify_app_overview", + "logic.telegram_notification_loop", + "api.send_message_endpoint", + "domain.runtime_health", + "api.health_endpoint", + "api.control_actions_endpoint", + "api.actions_endpoint", + "docs/README.md" + ], + "entity_candidates": [], + "symbol_candidates": [], + "layers": [ + "D1_DOCUMENT_CATALOG", + "D4_WORKFLOW_INDEX", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "filters": { + "doc_type": null + }, + "pipeline_mode": "pre_llm_only", + "gate_decision": "allow", + "prompt_used": "docs_explain_answer", + "llm_mode": "prose", + "degraded_reason": null, + "code_intents_stubbed": true + } + }, + "pipeline_steps": [ + { + "step": "input_query", + "input": { + "query": "Опиши workflow Telegram уведомлений" + }, + "output": { + "query": "Опиши workflow Telegram уведомлений" + } + }, + { + "step": "router", + "input": { + "query": "Опиши workflow Telegram уведомлений" + }, + "output": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "SYSTEM_FLOW_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START" + } + }, + { + "step": "docs_pipeline", + "input": { + "query": "Опиши workflow Telegram уведомлений" + }, + "output": { + "answer_mode": "ready", + "prompt_name": "docs_explain_answer", + "llm_request": { + "prompt_name": "docs_explain_answer", + "log_context": "graph.project_qa.docs.answer", + "prompt_stats": { + "system_chars": 393, + "user_chars": 17570, + "tokens_in_estimate": 4491 + } + }, + "degraded_reason": "" + } + } + ] +} \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/docs_pre_llm_v3/20260326_121025/full_chain_docs_intents_v3-3x_v3-system-flow-telegram-loop-3.md b/tests/pipeline_setup_v3/test_results/docs_pre_llm_v3/20260326_121025/full_chain_docs_intents_v3-3x_v3-system-flow-telegram-loop-3.md new file mode 100644 index 0000000..c5b8233 --- /dev/null +++ b/tests/pipeline_setup_v3/test_results/docs_pre_llm_v3/20260326_121025/full_chain_docs_intents_v3-3x_v3-system-flow-telegram-loop-3.md @@ -0,0 +1,785 @@ +# v3-system-flow-telegram-loop-3 + +- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_03_docs/full_chain_docs_intents_v3-3x.yaml +- runner: agent_runtime +- mode: pre_llm +- passed: True + +## Query +Опиши workflow Telegram уведомлений + +## Actual +{ + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "SYSTEM_FLOW_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START", + "rag_count": 18, + "llm_answer": "", + "answer_mode": "answered", + "path_scope": [], + "doc_scope": [ + "architecture.telegram_notify_app", + "architecture.telegram_notify_app_overview", + "logic.telegram_notification_loop", + "api.send_message_endpoint", + "domain.runtime_health", + "api.health_endpoint", + "api.control_actions_endpoint", + "api.actions_endpoint", + "docs/README.md" + ], + "entity_candidates": [], + "symbol_candidates": [], + "layers": [ + "D1_DOCUMENT_CATALOG", + "D4_WORKFLOW_INDEX", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "filters": { + "doc_type": null + }, + "pipeline_mode": "pre_llm_only", + "gate_decision": "allow", + "prompt_used": "docs_explain_answer", + "llm_mode": "prose", + "degraded_reason": null, + "code_intents_stubbed": true +} + +## Pipeline Steps +### input_query +```json +{ + "input": { + "query": "Опиши workflow Telegram уведомлений" + }, + "output": { + "query": "Опиши workflow Telegram уведомлений" + } +} +``` + +### router +```json +{ + "input": { + "query": "Опиши workflow Telegram уведомлений" + }, + "output": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "SYSTEM_FLOW_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START" + } +} +``` + +### docs_pipeline +```json +{ + "input": { + "query": "Опиши workflow Telegram уведомлений" + }, + "output": { + "answer_mode": "ready", + "prompt_name": "docs_explain_answer", + "llm_request": { + "prompt_name": "docs_explain_answer", + "log_context": "graph.project_qa.docs.answer", + "prompt_stats": { + "system_chars": 393, + "user_chars": 17570, + "tokens_in_estimate": 4491 + } + }, + "degraded_reason": "" + } +} +``` + +## Diagnostics +{ + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "SYSTEM_FLOW_EXPLAIN", + "layers_used": [ + "D1_DOCUMENT_CATALOG", + "D4_WORKFLOW_INDEX", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "documents_found": 6, + "facts_found": 0, + "relations_found": 3, + "openapi_fields_extracted": 0, + "missing_required_fields": [], + "openapi_status": { + "has_path": false, + "has_method": false, + "has_request": false, + "has_response": false + }, + "prompt_used": "docs_explain_answer", + "llm_mode": "prose", + "output_valid": true, + "matched_intent_source": "deterministic", + "matched_anchor_type": "workflow", + "matched_anchor_value": "Telegram", + "exact_anchor_match": false, + "docs_layers_requested": [ + "D1_DOCUMENT_CATALOG", + "D4_WORKFLOW_INDEX", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "docs_layers_with_hits": [ + "D1_DOCUMENT_CATALOG", + "D4_WORKFLOW_INDEX", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "planned_layers": [ + "D1_DOCUMENT_CATALOG", + "D4_WORKFLOW_INDEX", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "executed_layers": [ + "D1_DOCUMENT_CATALOG", + "D4_WORKFLOW_INDEX", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "non_empty_layers": [ + "D1_DOCUMENT_CATALOG", + "D4_WORKFLOW_INDEX", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "layer_diagnostics": { + "D1_DOCUMENT_CATALOG": { + "hits": 6, + "top_ids": [ + "architecture.telegram_notify_app", + "logic.telegram_notification_loop", + "api.send_message_endpoint", + "domain.runtime_health", + "api.health_endpoint" + ] + }, + "D4_WORKFLOW_INDEX": { + "hits": 3, + "top_ids": [ + "api.control_actions_endpoint", + "api.health_endpoint", + "api.send_message_endpoint" + ] + }, + "D5_RELATION_GRAPH": { + "hits": 8, + "top_ids": [ + "305bab0c6567d93a2b453a9d70b676f9ecd8de083ef36f5cf3398747c25ebf94", + "7bd0428d23e9b20f7d65202cc269e45b3d1e7aed7b5df4a35581fd88677be29b", + "0eb7f73fcda8556439e06f5eeb5ce064ae32b6cd3129353f5b1b4eb3db626d88", + "ae34fe4b3cd2b47632b13b1e32303e842b57948aa21160abe8d9b478995e1d74", + "145ccbb861a8fb621286ec9c888ce69677168d35c7871c70537e888ce3a5b910" + ] + }, + "D0_DOC_CHUNKS": { + "hits": 6, + "top_ids": [ + "logic.telegram_notification_loop", + "architecture.telegram_notify_app", + "docs/README.md" + ] + } + }, + "query_entity_candidates": [], + "resolved_entity_candidates": [], + "query_anchor_candidates": [], + "resolved_anchor_candidates": [ + "architecture.telegram_notify_app", + "docs/documentation/architecture/telegram-notify-app-overview.md", + "logic.telegram_notification_loop", + "docs/documentation/logic/telegram-notification-loop.md", + "api.send_message_endpoint", + "docs/documentation/api/send-message-endpoint.md", + "domain.runtime_health", + "docs/documentation/domain/runtime-health-entity.md", + "api.health_endpoint", + "docs/documentation/api/health-endpoint.md", + "api.control_actions_endpoint", + "docs/documentation/api/control-actions-endpoint.md", + "docs/README.md" + ], + "anchor_candidates": [], + "selected_anchor": null, + "anchor_selection_reason": "", + "anchor_match_type": "", + "doc_ids": [ + "architecture.telegram_notify_app", + "architecture.telegram_notify_app_overview", + "logic.telegram_notification_loop", + "api.send_message_endpoint", + "domain.runtime_health", + "api.health_endpoint", + "api.control_actions_endpoint", + "api.actions_endpoint", + "docs/README.md" + ], + "doc_paths": [ + "docs/documentation/architecture/telegram-notify-app-overview.md", + "docs/documentation/logic/telegram-notification-loop.md", + "docs/documentation/api/send-message-endpoint.md", + "docs/documentation/domain/runtime-health-entity.md", + "docs/documentation/api/health-endpoint.md", + "docs/documentation/api/control-actions-endpoint.md", + "docs/README.md" + ], + "doc_titles": [ + "Архитектура Telegram Notify App", + "Цикл отправки уведомлений в Telegram", + "HTTP API /send", + "Сущность runtime health", + "HTTP API /health", + "HTTP API /actions/{action}", + "Scenario", + "architecture.telegram_notify_app:child", + "architecture.telegram_notify_app:related_api", + "architecture.telegram_notify_app:parent", + "logic.telegram_notification_loop:Summary", + "logic.telegram_notification_loop:Details", + "architecture.telegram_notify_app:Summary", + "architecture.telegram_notify_app:Details", + "docs/README.md:Навигация", + "api.health_endpoint:Сценарий" + ], + "relation_hits_count": 3, + "relation_targets": [ + "architecture.telegram_notify_app:child", + "architecture.telegram_notify_app:related_api", + "architecture.telegram_notify_app:parent" + ], + "fallback_doc_hits_count": 12, + "fallback_used": false, + "fact_hits": 0, + "entity_hits": 0, + "evidence_summary": { + "documents": 6, + "facts": 0, + "relations": 3, + "chunks": 6, + "entity_hits": 0, + "openapi_signals": { + "path_found": false, + "method_found": false, + "request_schema": false, + "response_schema": false, + "status_codes": false, + "payload_description": false + } + }, + "gate_decision": "allow", + "gate_decision_reason": "evidence_sufficient", + "gate_missing_requirements": [], + "gate_satisfied_requirements": [ + "retrieval_non_empty" + ], + "openapi_evidence": { + "path_found": false, + "method_found": false, + "request_schema": false, + "response_schema": false, + "status_codes": false, + "payload_description": false + }, + "requested_fragment_type": null, + "fragment_evidence_found": [], + "fragment_missing_requirements": [], + "answer_mode": "ready", + "degrade_reason": null, + "degraded_reason": null, + "code_intents_stubbed": false +} + +## LLM Request +- prompt_name: docs_explain_answer +- log_context: graph.project_qa.docs.answer + +### Prompt Stats +```json +{ + "system_chars": 393, + "user_chars": 17570, + "tokens_in_estimate": 4491 +} +``` + +### System Prompt +```text +Ты объясняешь документацию системы. + +На вход приходит JSON с полями: +- question +- intent +- sub_intent +- documents +- facts +- relations + +Правила: +- Используй только предоставленные факты +- Не додумывай +- Если данных недостаточно, скажи это явно +- Объясняй структурировано + +Формат ответа: +1. Краткое описание +2. Основные элементы +3. Как это работает +4. Связи с другими частями системы (если есть) +``` + +### User Prompt +```json +{ + "question": "Опиши workflow Telegram уведомлений", + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "SYSTEM_FLOW_EXPLAIN", + "documents": [ + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/architecture/telegram-notify-app-overview.md", + "title": "Архитектура Telegram Notify App", + "content": "`test_echo_app` — сервис на базе PLBA runtime, который поднимает HTTP control plane и запускает фоновый воркер для периодической отправки уведомлений в Telegram. Приложение использует YAML-конфиг для runtime-настроек и переменные окружения для Telegram credentials. Основной контур системы состоит из runtime manager, control channel, send service и worker loop.", + "metadata": { + "name": "telegram_notify_app_overview", + "tags": [ + "architecture", + "telegram", + "plba", + "runtime" + ], + "type": "architecture_overview", + "layer": "system", + "links": [ + { + "type": "related_api", + "target": "api.health_endpoint" + }, + { + "type": "related_api", + "target": "api.control_actions_endpoint" + }, + { + "type": "related_api", + "target": "api.send_message_endpoint" + }, + { + "type": "depends_on", + "target": "logic.telegram_notification_loop" + }, + { + "type": "depends_on", + "target": "domain.runtime_health" + } + ], + "owner": null, + "title": "Архитектура Telegram Notify App", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "docs_root", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "8b1cc9f823e55bddbc825466d10a0fdb4ca4354ac02d91f9e2aef7b7d2ec8256", + "children": [ + "api.health_endpoint", + "api.control_actions_endpoint", + "api.send_message_endpoint", + "logic.telegram_notification_loop", + "domain.runtime_health" + ], + "doc_kind": "spec", + "entities": [ + "TelegramNotifyModule", + "TelegramNotifyWorker", + "TelegramControlChannel", + "TelegramSendService", + "RuntimeManager" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "architecture.telegram_notify_app", + "source_path": "docs/documentation/architecture/telegram-notify-app-overview.md", + "summary_text": "`test_echo_app` — сервис на базе PLBA runtime, который поднимает HTTP control plane и запускает фоновый воркер для периодической отправки уведомлений в Telegram. Приложение использует YAML-конфиг для runtime-настроек и переменные окружения для Telegram credentials. Основной контур системы состоит из runtime manager, control channel, send service и worker loop.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/logic/telegram-notification-loop.md", + "title": "Цикл отправки уведомлений в Telegram", + "content": "`TelegramNotifyWorker` после старта runtime запускает отдельный поток, сразу делает первую попытку отправки сообщения и затем повторяет отправку через заданный интервал. При ошибках доставки или отсутствии credentials worker не останавливает сервис, а переводит собственное состояние в `degraded`. Этот workflow определяет основной полезный цикл приложения.", + "metadata": { + "name": "telegram_notification_loop", + "tags": [ + "logic", + "telegram", + "worker", + "scheduling" + ], + "type": "logic_block", + "layer": "application", + "links": [ + { + "type": "part_of", + "target": "architecture.telegram_notify_app" + }, + { + "type": "related_api", + "target": "api.send_message_endpoint" + }, + { + "type": "related_api", + "target": "api.control_actions_endpoint" + }, + { + "type": "related_api", + "target": "api.health_endpoint" + } + ], + "owner": null, + "title": "Цикл отправки уведомлений в Telegram", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "architecture.telegram_notify_app", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "0f62f9b4dab261ca4ca34575ff5d84411a22c90b780c52eda388782b94f08470", + "children": [], + "doc_kind": "misc", + "entities": [ + "TelegramNotifyWorker", + "TelegramSendService", + "WorkerHealth", + "WorkerStatus" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "logic.telegram_notification_loop", + "source_path": "docs/documentation/logic/telegram-notification-loop.md", + "summary_text": "`TelegramNotifyWorker` после старта runtime запускает отдельный поток, сразу делает первую попытку отправки сообщения и затем повторяет отправку через заданный интервал. При ошибках доставки или отсутствии credentials worker не останавливает сервис, а переводит собственное состояние в `degraded`. Этот workflow определяет основной полезный цикл приложения.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/api/send-message-endpoint.md", + "title": "HTTP API /send", + "content": "Endpoint `/send` выполняет ручную отправку сообщения в Telegram через `TelegramSendService`. Он используется для операторской проверки доставки и для отправки уведомлений вне периодического worker loop. Endpoint работает поверх тех же credentials и того же delivery path, что и фоновая отправка.", + "metadata": { + "name": "send_message_endpoint", + "tags": [ + "api", + "telegram", + "manual-send" + ], + "type": "api_method", + "layer": "application", + "links": [ + { + "type": "part_of", + "target": "architecture.telegram_notify_app" + }, + { + "type": "depends_on", + "target": "logic.telegram_notification_loop" + } + ], + "owner": null, + "title": "HTTP API /send", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "architecture.telegram_notify_app", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "5fbf2e33510b0676a3a53b957a4569bd3c2c31fb7719546602c573421ccaa32d", + "children": [], + "doc_kind": "misc", + "entities": [ + "TelegramControlAppFactory", + "TelegramSendService", + "TelegramNotifyWorker" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "api.send_message_endpoint", + "source_path": "docs/documentation/api/send-message-endpoint.md", + "summary_text": "Endpoint `/send` выполняет ручную отправку сообщения в Telegram через `TelegramSendService`. Он используется для операторской проверки доставки и для отправки уведомлений вне периодического worker loop. Endpoint работает поверх тех же credentials и того же delivery path, что и фоновая отправка.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/domain/runtime-health-entity.md", + "title": "Сущность runtime health", + "content": "`runtime health` — доменная модель наблюдаемости сервиса, которая описывает общее состояние runtime и состояние отдельных компонентов. Для `test_echo_app` главным объектом наблюдения является компонент `telegram_notify`, у которого важны статус, время старта и количество успешных отправок. Эта модель используется для внешнего health-monitoring и внутренней диагностики.", + "metadata": { + "name": "runtime_health", + "tags": [ + "domain", + "health", + "observability" + ], + "type": "domain_entity", + "layer": "domain", + "links": [ + { + "type": "part_of", + "target": "architecture.telegram_notify_app" + }, + { + "type": "used_by", + "target": "api.health_endpoint" + }, + { + "type": "related_logic", + "target": "logic.telegram_notification_loop" + } + ], + "owner": null, + "title": "Сущность runtime health", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "architecture.telegram_notify_app", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "37d4dcf470ea3de95d59e44786006e369a3ea11bf5dbf4c88877696e9183ee87", + "children": [], + "doc_kind": "misc", + "entities": [ + "WorkerHealth", + "WorkerStatus", + "TelegramNotifyWorker" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "domain.runtime_health", + "source_path": "docs/documentation/domain/runtime-health-entity.md", + "summary_text": "`runtime health` — доменная модель наблюдаемости сервиса, которая описывает общее состояние runtime и состояние отдельных компонентов. Для `test_echo_app` главным объектом наблюдения является компонент `telegram_notify`, у которого важны статус, время старта и количество успешных отправок. Эта модель используется для внешнего health-monitoring и внутренней диагностики.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/api/health-endpoint.md", + "title": "HTTP API /health", + "content": "Endpoint `/health` возвращает агрегированный health payload runtime. Если общий статус равен `ok`, API отвечает с HTTP 200; для состояний деградации или неготовности возвращается HTTP 503 с тем же payload. Endpoint служит основной точкой внешней проверки состояния приложения.", + "metadata": { + "name": "health_endpoint", + "tags": [ + "api", + "health", + "control-plane" + ], + "type": "api_method", + "layer": "application", + "links": [ + { + "type": "part_of", + "target": "architecture.telegram_notify_app" + }, + { + "type": "depends_on", + "target": "domain.runtime_health" + } + ], + "owner": null, + "title": "HTTP API /health", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "architecture.telegram_notify_app", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "8b5a533a8076e2e9d36995eee29aeade260080bdca2ec8e21fe28f08574b983f", + "children": [], + "doc_kind": "misc", + "entities": [ + "TelegramControlChannel", + "TelegramNotifyWorker", + "RuntimeManager", + "WorkerHealth" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "api.health_endpoint", + "source_path": "docs/documentation/api/health-endpoint.md", + "summary_text": "Endpoint `/health` возвращает агрегированный health payload runtime. Если общий статус равен `ok`, API отвечает с HTTP 200; для состояний деградации или неготовности возвращается HTTP 503 с тем же payload. Endpoint служит основной точкой внешней проверки состояния приложения.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "HTTP API /actions/{action}", + "content": "Endpoint `/actions/{action}` управляет control actions runtime и поддерживает `start`, `stop` и `status`. Для долгих операций `start` и `stop` допускается ответ HTTP 202, если действие еще выполняется. Endpoint используется для operator-driven управления жизненным циклом worker'а через HTTP API.", + "metadata": { + "name": "control_actions_endpoint", + "tags": [ + "api", + "control-plane", + "lifecycle" + ], + "type": "api_method", + "layer": "application", + "links": [ + { + "type": "part_of", + "target": "architecture.telegram_notify_app" + }, + { + "type": "related_api", + "target": "api.health_endpoint" + }, + { + "type": "related_logic", + "target": "logic.telegram_notification_loop" + } + ], + "owner": null, + "title": "HTTP API /actions/{action}", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "architecture.telegram_notify_app", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "children": [], + "doc_kind": "misc", + "entities": [ + "TelegramControlChannel", + "ControlActionSet", + "JSONResponse" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "api.control_actions_endpoint", + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "summary_text": "Endpoint `/actions/{action}` управляет control actions runtime и поддерживает `start`, `stop` и `status`. Для долгих операций `start` и `stop` допускается ответ HTTP 202, если действие еще выполняется. Endpoint используется для operator-driven управления жизненным циклом worker'а через HTTP API.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + } + ], + "facts": [], + "relations": [ + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/architecture/telegram-notify-app-overview.md", + "title": "architecture.telegram_notify_app:child", + "content": "architecture.telegram_notify_app child api.send_message_endpoint", + "metadata": { + "owner": null, + "anchor": "frontmatter.children", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "8b1cc9f823e55bddbc825466d10a0fdb4ca4354ac02d91f9e2aef7b7d2ec8256", + "source_id": "architecture.telegram_notify_app", + "target_id": "api.send_message_endpoint", + "doc_version": null, + "relation_id": "305bab0c6567d93a2b453a9d70b676f9ecd8de083ef36f5cf3398747c25ebf94", + "source_path": "docs/documentation/architecture/telegram-notify-app-overview.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "child", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/architecture/telegram-notify-app-overview.md", + "title": "architecture.telegram_notify_app:related_api", + "content": "architecture.telegram_notify_app related_api api.health_endpoint", + "metadata": { + "owner": null, + "anchor": "frontmatter.links", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "8b1cc9f823e55bddbc825466d10a0fdb4ca4354ac02d91f9e2aef7b7d2ec8256", + "source_id": "architecture.telegram_notify_app", + "target_id": "api.health_endpoint", + "doc_version": null, + "relation_id": "7bd0428d23e9b20f7d65202cc269e45b3d1e7aed7b5df4a35581fd88677be29b", + "source_path": "docs/documentation/architecture/telegram-notify-app-overview.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "related_api", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/architecture/telegram-notify-app-overview.md", + "title": "architecture.telegram_notify_app:parent", + "content": "architecture.telegram_notify_app parent docs_root", + "metadata": { + "owner": null, + "anchor": "frontmatter.parent", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "8b1cc9f823e55bddbc825466d10a0fdb4ca4354ac02d91f9e2aef7b7d2ec8256", + "source_id": "architecture.telegram_notify_app", + "target_id": "docs_root", + "doc_version": null, + "relation_id": "e01922b36e3cc60d9349f89e43fcd4a92c6a01394b0028d6b6d56801b258645d", + "source_path": "docs/documentation/architecture/telegram-notify-app-overview.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "parent", + "staleness_score": null, + "system_component": null + } + } + ] +} +``` + +### User Prompt Overview +- question: Опиши workflow Telegram уведомлений +- intent: DOCUMENTATION_EXPLAIN +- sub_intent: SYSTEM_FLOW_EXPLAIN +- documents: 6 | samples: Архитектура Telegram Notify App, Цикл отправки уведомлений в Telegram, HTTP API /send +- facts: 0 +- relations: 3 | samples: architecture.telegram_notify_app:child, architecture.telegram_notify_app:related_api, architecture.telegram_notify_app:parent + +## Mismatches +- none \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/docs_pre_llm_v3/20260326_121025/summary.md b/tests/pipeline_setup_v3/test_results/docs_pre_llm_v3/20260326_121025/summary.md new file mode 100644 index 0000000..8c06d1e --- /dev/null +++ b/tests/pipeline_setup_v3/test_results/docs_pre_llm_v3/20260326_121025/summary.md @@ -0,0 +1,43 @@ +# pipeline_setup_v3 summary + +Passed: 25/30 + +| File | Case | Mode | Query | Actual sub-intent | RAG layers | Tokens | Pass | +|------|------|------|-------|-------------------|------------|--------|------| +| full_chain_docs_intents_v3-3x.yaml | v3-system-flow-telegram-loop-1 | pre_llm | Объясни цикл отправки уведомлений | SYSTEM_FLOW_EXPLAIN | D0_DOC_CHUNKS:6, D1_DOCUMENT_CATALOG:6, D4_WORKFLOW_INDEX:3, D5_RELATION_GRAPH:8 | 5276 | ✓ | +| full_chain_docs_intents_v3-3x.yaml | v3-system-flow-telegram-loop-2 | pre_llm | Как работает процесс отправки уведомлений в Telegram? | SYSTEM_FLOW_EXPLAIN | D0_DOC_CHUNKS:6, D1_DOCUMENT_CATALOG:6, D4_WORKFLOW_INDEX:3, D5_RELATION_GRAPH:3 | 4496 | ✓ | +| full_chain_docs_intents_v3-3x.yaml | v3-system-flow-telegram-loop-3 | pre_llm | Опиши workflow Telegram уведомлений | SYSTEM_FLOW_EXPLAIN | D0_DOC_CHUNKS:6, D1_DOCUMENT_CATALOG:6, D4_WORKFLOW_INDEX:3, D5_RELATION_GRAPH:3 | 4491 | ✓ | +| full_chain_docs_intents_v3-3x.yaml | v3-system-flow-health-1 | pre_llm | Как работает health check runtime? | GENERIC_QA | D0_DOC_CHUNKS:8, D1_DOCUMENT_CATALOG:4 | 2452 | ✗ | +| full_chain_docs_intents_v3-3x.yaml | v3-system-flow-health-2 | pre_llm | Как происходит проверка состояния runtime? | SYSTEM_FLOW_EXPLAIN | D0_DOC_CHUNKS:6, D1_DOCUMENT_CATALOG:6, D4_WORKFLOW_INDEX:3, D5_RELATION_GRAPH:8 | 5689 | ✓ | +| full_chain_docs_intents_v3-3x.yaml | v3-component-runtime-manager-1 | pre_llm | Что делает RuntimeManager? | COMPONENT_EXPLAIN | D0_DOC_CHUNKS:6, D1_DOCUMENT_CATALOG:6, D2_FACT_INDEX:2, D5_RELATION_GRAPH:6 | 5471 | ✓ | +| full_chain_docs_intents_v3-3x.yaml | v3-component-runtime-manager-2 | pre_llm | Как устроен RuntimeManager? | COMPONENT_EXPLAIN | D0_DOC_CHUNKS:6, D1_DOCUMENT_CATALOG:6, D2_FACT_INDEX:2, D5_RELATION_GRAPH:6 | 5471 | ✓ | +| full_chain_docs_intents_v3-3x.yaml | v3-component-runtime-manager-3 | pre_llm | Опиши компонент RuntimeManager | COMPONENT_EXPLAIN | D0_DOC_CHUNKS:6, D1_DOCUMENT_CATALOG:6, D2_FACT_INDEX:2, D5_RELATION_GRAPH:6 | 5472 | ✓ | +| full_chain_docs_intents_v3-3x.yaml | v3-component-control-channel-1 | pre_llm | Как работает TelegramControlChannel? | COMPONENT_EXPLAIN | D0_DOC_CHUNKS:6, D1_DOCUMENT_CATALOG:6, D2_FACT_INDEX:2, D5_RELATION_GRAPH:6 | 5474 | ✓ | +| full_chain_docs_intents_v3-3x.yaml | v3-component-control-channel-2 | pre_llm | Роль TelegramControlChannel в системе | COMPONENT_EXPLAIN | D0_DOC_CHUNKS:6, D1_DOCUMENT_CATALOG:6, D2_FACT_INDEX:2, D5_RELATION_GRAPH:6 | 5474 | ✓ | +| full_chain_docs_intents_v3-3x.yaml | v3-api-health-1 | pre_llm | Что делает /health? | API_METHOD_EXPLAIN | D0_DOC_CHUNKS:6, D1_DOCUMENT_CATALOG:1, D2_FACT_INDEX:2, D4_WORKFLOW_INDEX:1 | 1149 | ✓ | +| full_chain_docs_intents_v3-3x.yaml | v3-api-health-2 | pre_llm | Как работает health endpoint? | API_METHOD_EXPLAIN | D0_DOC_CHUNKS:6, D1_DOCUMENT_CATALOG:6, D2_FACT_INDEX:2, D4_WORKFLOW_INDEX:3 | 4254 | ✓ | +| full_chain_docs_intents_v3-3x.yaml | v3-api-health-3 | pre_llm | Опиши endpoint health | API_METHOD_EXPLAIN | D0_DOC_CHUNKS:6, D1_DOCUMENT_CATALOG:6, D2_FACT_INDEX:2, D4_WORKFLOW_INDEX:3 | 4252 | ✓ | +| full_chain_docs_intents_v3-3x.yaml | v3-api-send-1 | pre_llm | Что делает /send? | API_METHOD_EXPLAIN | D0_DOC_CHUNKS:6, D1_DOCUMENT_CATALOG:1, D2_FACT_INDEX:2, D4_WORKFLOW_INDEX:1 | 1195 | ✓ | +| full_chain_docs_intents_v3-3x.yaml | v3-api-send-2 | pre_llm | Как работает send endpoint? | API_METHOD_EXPLAIN | D0_DOC_CHUNKS:6, D1_DOCUMENT_CATALOG:6, D2_FACT_INDEX:2, D4_WORKFLOW_INDEX:3 | 3846 | ✓ | +| full_chain_docs_intents_v3-3x.yaml | v3-api-send-3 | pre_llm | Опиши endpoint отправки сообщений | API_METHOD_EXPLAIN | D0_DOC_CHUNKS:6, D1_DOCUMENT_CATALOG:6, D2_FACT_INDEX:2, D4_WORKFLOW_INDEX:3 | 3847 | ✓ | +| full_chain_docs_intents_v3-3x.yaml | v3-entity-runtime-health-1 | pre_llm | Что такое runtime health? | ENTITY_EXPLAIN | D0_DOC_CHUNKS:6, D1_DOCUMENT_CATALOG:6, D3_ENTITY_CATALOG:8, D5_RELATION_GRAPH:6 | 5165 | ✓ | +| full_chain_docs_intents_v3-3x.yaml | v3-entity-runtime-health-2 | pre_llm | Объясни runtime health | GENERIC_QA | D0_DOC_CHUNKS:8, D1_DOCUMENT_CATALOG:4 | 2449 | ✗ | +| full_chain_docs_intents_v3-3x.yaml | v3-entity-worker-status-1 | pre_llm | Что такое WorkerStatus? | ENTITY_EXPLAIN | D0_DOC_CHUNKS:6, D1_DOCUMENT_CATALOG:6, D3_ENTITY_CATALOG:8, D5_RELATION_GRAPH:6 | 4793 | ✓ | +| full_chain_docs_intents_v3-3x.yaml | v3-entity-worker-status-2 | pre_llm | Опиши статус воркера | GENERIC_QA | D0_DOC_CHUNKS:8, D1_DOCUMENT_CATALOG:4 | 1976 | ✗ | +| full_chain_docs_intents_v3-3x.yaml | v3-related-health-1 | pre_llm | Что связано с /health? | RELATED_DOCS_EXPLAIN | D0_DOC_CHUNKS:6, D5_RELATION_GRAPH:8 | 2070 | ✓ | +| full_chain_docs_intents_v3-3x.yaml | v3-related-health-2 | pre_llm | Какие документы относятся к health endpoint? | RELATED_DOCS_EXPLAIN | D0_DOC_CHUNKS:6, D5_RELATION_GRAPH:8 | 2098 | ✓ | +| full_chain_docs_intents_v3-3x.yaml | v3-related-send-1 | pre_llm | Какие документы связаны с /send? | RELATED_DOCS_EXPLAIN | D0_DOC_CHUNKS:6, D5_RELATION_GRAPH:8 | 2120 | ✓ | +| full_chain_docs_intents_v3-3x.yaml | v3-related-architecture-1 | pre_llm | Какие документы связаны с архитектурой? | RELATED_DOCS_EXPLAIN | D0_DOC_CHUNKS:6, D5_RELATION_GRAPH:8 | 2097 | ✓ | +| full_chain_docs_intents_v3-3x.yaml | v3-general-1 | pre_llm | Что есть в документации? | COMPONENT_EXPLAIN | D0_DOC_CHUNKS:6, D1_DOCUMENT_CATALOG:6, D2_FACT_INDEX:1, D5_RELATION_GRAPH:6 | 5039 | ✗ | +| full_chain_docs_intents_v3-3x.yaml | v3-general-2 | pre_llm | Какая структура документации? | COMPONENT_EXPLAIN | D0_DOC_CHUNKS:6, D1_DOCUMENT_CATALOG:6, D2_FACT_INDEX:1, D5_RELATION_GRAPH:6 | 5040 | ✗ | +| full_chain_docs_intents_v3-3x.yaml | v3-general-3 | pre_llm | С чего начать читать документацию? | GENERIC_QA | D0_DOC_CHUNKS:8, D1_DOCUMENT_CATALOG:4 | 1980 | ✓ | +| full_chain_docs_intents_v3-3x.yaml | v3-negative-1 | pre_llm | Что такое PaymentTransaction? | ENTITY_EXPLAIN | D0_DOC_CHUNKS:6, D1_DOCUMENT_CATALOG:6, D3_ENTITY_CATALOG:8, D5_RELATION_GRAPH:6 | 4794 | ✓ | +| full_chain_docs_intents_v3-3x.yaml | v3-negative-2 | pre_llm | Объясни сущность UnknownEntity | ENTITY_EXPLAIN | — | 142 | ✓ | +| full_chain_docs_intents_v3-3x.yaml | v3-negative-3 | pre_llm | Что делает endpoint /unknown? | API_METHOD_EXPLAIN | — | 143 | ✓ | + +## Failures +- **v3-system-flow-health-1**: sub_intent: expected SYSTEM_FLOW_EXPLAIN, got GENERIC_QA +- **v3-entity-runtime-health-2**: sub_intent: expected ENTITY_EXPLAIN, got GENERIC_QA +- **v3-entity-worker-status-2**: sub_intent: expected ENTITY_EXPLAIN, got GENERIC_QA +- **v3-general-1**: sub_intent: expected GENERIC_QA, got COMPONENT_EXPLAIN +- **v3-general-2**: sub_intent: expected GENERIC_QA, got COMPONENT_EXPLAIN \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/docs_router_deterministic/20260326_125615/full_chain_docs_intents_v3-3x_v3-api-health-1.json b/tests/pipeline_setup_v3/test_results/docs_router_deterministic/20260326_125615/full_chain_docs_intents_v3-3x_v3-api-health-1.json new file mode 100644 index 0000000..b674a0e --- /dev/null +++ b/tests/pipeline_setup_v3/test_results/docs_router_deterministic/20260326_125615/full_chain_docs_intents_v3-3x_v3-api-health-1.json @@ -0,0 +1,83 @@ +{ + "meta": { + "case_id": "v3-api-health-1", + "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_03_docs/full_chain_docs_intents_v3-3x.yaml", + "runner": "agent_runtime", + "mode": "pre_llm", + "passed": true, + "mismatches": [], + "actual": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "API_METHOD_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START", + "rag_count": 10, + "llm_answer": "", + "answer_mode": "answered", + "path_scope": [], + "doc_scope": [ + "api.health_endpoint" + ], + "entity_candidates": [], + "symbol_candidates": [], + "layers": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D4_WORKFLOW_INDEX", + "D0_DOC_CHUNKS" + ], + "filters": { + "doc_type": "api_method" + }, + "pipeline_mode": "pre_llm_only", + "gate_decision": "allow", + "prompt_used": "docs_explain_answer", + "llm_mode": "prose", + "degraded_reason": null, + "code_intents_stubbed": true + } + }, + "pipeline_steps": [ + { + "step": "input_query", + "input": { + "query": "Что делает /health?" + }, + "output": { + "query": "Что делает /health?" + } + }, + { + "step": "router", + "input": { + "query": "Что делает /health?" + }, + "output": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "API_METHOD_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START" + } + }, + { + "step": "docs_pipeline", + "input": { + "query": "Что делает /health?" + }, + "output": { + "answer_mode": "ready", + "prompt_name": "docs_explain_answer", + "llm_request": { + "prompt_name": "docs_explain_answer", + "log_context": "graph.project_qa.docs.answer", + "prompt_stats": { + "system_chars": 393, + "user_chars": 4201, + "tokens_in_estimate": 1149 + } + }, + "degraded_reason": "" + } + } + ] +} \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/docs_router_deterministic/20260326_125615/full_chain_docs_intents_v3-3x_v3-api-health-1.md b/tests/pipeline_setup_v3/test_results/docs_router_deterministic/20260326_125615/full_chain_docs_intents_v3-3x_v3-api-health-1.md new file mode 100644 index 0000000..c41cdc2 --- /dev/null +++ b/tests/pipeline_setup_v3/test_results/docs_router_deterministic/20260326_125615/full_chain_docs_intents_v3-3x_v3-api-health-1.md @@ -0,0 +1,429 @@ +# v3-api-health-1 + +- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_03_docs/full_chain_docs_intents_v3-3x.yaml +- runner: agent_runtime +- mode: pre_llm +- passed: True + +## Query +Что делает /health? + +## Actual +{ + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "API_METHOD_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START", + "rag_count": 10, + "llm_answer": "", + "answer_mode": "answered", + "path_scope": [], + "doc_scope": [ + "api.health_endpoint" + ], + "entity_candidates": [], + "symbol_candidates": [], + "layers": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D4_WORKFLOW_INDEX", + "D0_DOC_CHUNKS" + ], + "filters": { + "doc_type": "api_method" + }, + "pipeline_mode": "pre_llm_only", + "gate_decision": "allow", + "prompt_used": "docs_explain_answer", + "llm_mode": "prose", + "degraded_reason": null, + "code_intents_stubbed": true +} + +## Pipeline Steps +### input_query +```json +{ + "input": { + "query": "Что делает /health?" + }, + "output": { + "query": "Что делает /health?" + } +} +``` + +### router +```json +{ + "input": { + "query": "Что делает /health?" + }, + "output": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "API_METHOD_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START" + } +} +``` + +### docs_pipeline +```json +{ + "input": { + "query": "Что делает /health?" + }, + "output": { + "answer_mode": "ready", + "prompt_name": "docs_explain_answer", + "llm_request": { + "prompt_name": "docs_explain_answer", + "log_context": "graph.project_qa.docs.answer", + "prompt_stats": { + "system_chars": 393, + "user_chars": 4201, + "tokens_in_estimate": 1149 + } + }, + "degraded_reason": "" + } +} +``` + +## Diagnostics +{ + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "API_METHOD_EXPLAIN", + "layers_used": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D4_WORKFLOW_INDEX", + "D0_DOC_CHUNKS" + ], + "documents_found": 1, + "facts_found": 2, + "relations_found": 0, + "openapi_fields_extracted": 0, + "missing_required_fields": [], + "openapi_status": { + "has_path": false, + "has_method": false, + "has_request": false, + "has_response": false + }, + "prompt_used": "docs_explain_answer", + "llm_mode": "prose", + "output_valid": true, + "matched_intent_source": "deterministic", + "matched_anchor_type": "endpoint", + "matched_anchor_value": "/health", + "exact_anchor_match": true, + "docs_layers_requested": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D4_WORKFLOW_INDEX", + "D0_DOC_CHUNKS" + ], + "docs_layers_with_hits": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D4_WORKFLOW_INDEX", + "D0_DOC_CHUNKS" + ], + "planned_layers": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D4_WORKFLOW_INDEX", + "D0_DOC_CHUNKS" + ], + "executed_layers": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D4_WORKFLOW_INDEX", + "D0_DOC_CHUNKS" + ], + "non_empty_layers": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D4_WORKFLOW_INDEX", + "D0_DOC_CHUNKS" + ], + "layer_diagnostics": { + "D1_DOCUMENT_CATALOG": { + "hits": 6, + "top_ids": [ + "domain.runtime_health", + "api.health_endpoint", + "docs/README.md", + "architecture.telegram_notify_app", + "logic.telegram_notification_loop" + ] + }, + "D2_FACT_INDEX": { + "hits": 8, + "top_ids": [ + "1cff54331a52b7a92946e7afabe7e45d7e3ec693b59546f9666e494396593bc3", + "0d923b02d15cef527d51740b7a09378a7dc74fb58db27cd059a8658ad11601a5", + "3d3b6fcc21144cb68657be099291db0ae36d61d32d6d72fd5b7c3cb81f379877", + "0b70cbff38a527cecfb53d3f72d573e9da1826cc75bd4cb92357e1de10988204", + "ce6d44c30418b0b171433a144f78d4bbf53b7a060d9b7cd42b9feecc8ca3044e" + ] + }, + "D4_WORKFLOW_INDEX": { + "hits": 3, + "top_ids": [ + "api.health_endpoint", + "api.control_actions_endpoint", + "api.send_message_endpoint" + ] + }, + "D0_DOC_CHUNKS": { + "hits": 6, + "top_ids": [ + "api.health_endpoint" + ] + } + }, + "query_entity_candidates": [], + "resolved_entity_candidates": [], + "query_anchor_candidates": [ + "/health" + ], + "resolved_anchor_candidates": [ + "api.health_endpoint", + "docs/documentation/api/health-endpoint.md" + ], + "anchor_candidates": [], + "selected_anchor": null, + "anchor_selection_reason": "", + "anchor_match_type": "", + "doc_ids": [ + "api.health_endpoint" + ], + "doc_paths": [ + "docs/documentation/api/health-endpoint.md" + ], + "doc_titles": [ + "HTTP API /health", + "Scenario", + "api.health_endpoint:Сценарий", + "api.health_endpoint:workflow_step", + "api.health_endpoint:mentions_entity", + "api.health_endpoint:Нефункциональные требования", + "api.health_endpoint:Summary", + "api.health_endpoint:Описание", + "api.health_endpoint:Функциональные требования", + "api.health_endpoint:Входные параметры" + ], + "relation_hits_count": 0, + "relation_targets": [], + "fallback_doc_hits_count": 7, + "fallback_used": false, + "fact_hits": 2, + "entity_hits": 0, + "evidence_summary": { + "documents": 1, + "facts": 2, + "relations": 0, + "chunks": 6, + "entity_hits": 0, + "openapi_signals": { + "path_found": false, + "method_found": false, + "request_schema": false, + "response_schema": false, + "status_codes": false, + "payload_description": false + } + }, + "gate_decision": "allow", + "gate_decision_reason": "evidence_sufficient", + "gate_missing_requirements": [], + "gate_satisfied_requirements": [ + "retrieval_non_empty", + "exact_anchor_match" + ], + "openapi_evidence": { + "path_found": false, + "method_found": false, + "request_schema": false, + "response_schema": false, + "status_codes": false, + "payload_description": false + }, + "requested_fragment_type": null, + "fragment_evidence_found": [], + "fragment_missing_requirements": [], + "answer_mode": "ready", + "degrade_reason": null, + "degraded_reason": null, + "code_intents_stubbed": false +} + +## LLM Request +- prompt_name: docs_explain_answer +- log_context: graph.project_qa.docs.answer + +### Prompt Stats +```json +{ + "system_chars": 393, + "user_chars": 4201, + "tokens_in_estimate": 1149 +} +``` + +### System Prompt +```text +Ты объясняешь документацию системы. + +На вход приходит JSON с полями: +- question +- intent +- sub_intent +- documents +- facts +- relations + +Правила: +- Используй только предоставленные факты +- Не додумывай +- Если данных недостаточно, скажи это явно +- Объясняй структурировано + +Формат ответа: +1. Краткое описание +2. Основные элементы +3. Как это работает +4. Связи с другими частями системы (если есть) +``` + +### User Prompt +```json +{ + "question": "Что делает /health?", + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "API_METHOD_EXPLAIN", + "documents": [ + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/api/health-endpoint.md", + "title": "HTTP API /health", + "content": "Endpoint `/health` возвращает агрегированный health payload runtime. Если общий статус равен `ok`, API отвечает с HTTP 200; для состояний деградации или неготовности возвращается HTTP 503 с тем же payload. Endpoint служит основной точкой внешней проверки состояния приложения.", + "metadata": { + "name": "health_endpoint", + "tags": [ + "api", + "health", + "control-plane" + ], + "type": "api_method", + "layer": "application", + "links": [ + { + "type": "part_of", + "target": "architecture.telegram_notify_app" + }, + { + "type": "depends_on", + "target": "domain.runtime_health" + } + ], + "owner": null, + "title": "HTTP API /health", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "architecture.telegram_notify_app", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "8b5a533a8076e2e9d36995eee29aeade260080bdca2ec8e21fe28f08574b983f", + "children": [], + "doc_kind": "misc", + "entities": [ + "TelegramControlChannel", + "TelegramNotifyWorker", + "RuntimeManager", + "WorkerHealth" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "api.health_endpoint", + "source_path": "docs/documentation/api/health-endpoint.md", + "summary_text": "Endpoint `/health` возвращает агрегированный health payload runtime. Если общий статус равен `ok`, API отвечает с HTTP 200; для состояний деградации или неготовности возвращается HTTP 503 с тем же payload. Endpoint служит основной точкой внешней проверки состояния приложения.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + } + ], + "facts": [ + { + "layer": "D2_FACT_INDEX", + "path": "docs/documentation/api/health-endpoint.md", + "title": "api.health_endpoint:workflow_step", + "content": "api.health_endpoint workflow_step Предусловия:**", + "metadata": { + "tags": [], + "owner": null, + "anchor": "Сценарий", + "doc_id": null, + "object": "Предусловия:**", + "fact_id": "1cff54331a52b7a92946e7afabe7e45d7e3ec693b59546f9666e494396593bc3", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "8b5a533a8076e2e9d36995eee29aeade260080bdca2ec8e21fe28f08574b983f", + "predicate": "workflow_step", + "object_ref": null, + "subject_id": "api.health_endpoint", + "doc_version": null, + "source_path": "docs/documentation/api/health-endpoint.md", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D2_FACT_INDEX", + "path": "docs/documentation/api/health-endpoint.md", + "title": "api.health_endpoint:mentions_entity", + "content": "api.health_endpoint mentions_entity TelegramControlChannel", + "metadata": { + "tags": [], + "owner": null, + "anchor": "frontmatter.entities", + "doc_id": null, + "object": "TelegramControlChannel", + "fact_id": "3d3b6fcc21144cb68657be099291db0ae36d61d32d6d72fd5b7c3cb81f379877", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "8b5a533a8076e2e9d36995eee29aeade260080bdca2ec8e21fe28f08574b983f", + "predicate": "mentions_entity", + "object_ref": null, + "subject_id": "api.health_endpoint", + "doc_version": null, + "source_path": "docs/documentation/api/health-endpoint.md", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + } + ], + "relations": [] +} +``` + +### User Prompt Overview +- question: Что делает /health? +- intent: DOCUMENTATION_EXPLAIN +- sub_intent: API_METHOD_EXPLAIN +- documents: 1 | samples: HTTP API /health +- facts: 2 | samples: api.health_endpoint:workflow_step, api.health_endpoint:mentions_entity +- relations: 0 + +## Mismatches +- none \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/docs_router_deterministic/20260326_125615/full_chain_docs_intents_v3-3x_v3-api-health-2.json b/tests/pipeline_setup_v3/test_results/docs_router_deterministic/20260326_125615/full_chain_docs_intents_v3-3x_v3-api-health-2.json new file mode 100644 index 0000000..60e1ea7 --- /dev/null +++ b/tests/pipeline_setup_v3/test_results/docs_router_deterministic/20260326_125615/full_chain_docs_intents_v3-3x_v3-api-health-2.json @@ -0,0 +1,90 @@ +{ + "meta": { + "case_id": "v3-api-health-2", + "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_03_docs/full_chain_docs_intents_v3-3x.yaml", + "runner": "agent_runtime", + "mode": "pre_llm", + "passed": true, + "mismatches": [], + "actual": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "API_METHOD_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START", + "rag_count": 17, + "llm_answer": "", + "answer_mode": "answered", + "path_scope": [], + "doc_scope": [ + "api.send_message_endpoint", + "api.control_actions_endpoint", + "api.actions_endpoint", + "api.health_endpoint", + "domain.runtime_health", + "architecture.telegram_notify_app", + "architecture.telegram_notify_app_overview", + "logic.telegram_notification_loop" + ], + "entity_candidates": [], + "symbol_candidates": [], + "layers": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D4_WORKFLOW_INDEX", + "D0_DOC_CHUNKS" + ], + "filters": { + "doc_type": "api_method" + }, + "pipeline_mode": "pre_llm_only", + "gate_decision": "allow", + "prompt_used": "docs_explain_answer", + "llm_mode": "prose", + "degraded_reason": null, + "code_intents_stubbed": true + } + }, + "pipeline_steps": [ + { + "step": "input_query", + "input": { + "query": "Как работает health endpoint?" + }, + "output": { + "query": "Как работает health endpoint?" + } + }, + { + "step": "router", + "input": { + "query": "Как работает health endpoint?" + }, + "output": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "API_METHOD_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START" + } + }, + { + "step": "docs_pipeline", + "input": { + "query": "Как работает health endpoint?" + }, + "output": { + "answer_mode": "ready", + "prompt_name": "docs_explain_answer", + "llm_request": { + "prompt_name": "docs_explain_answer", + "log_context": "graph.project_qa.docs.answer", + "prompt_stats": { + "system_chars": 393, + "user_chars": 16622, + "tokens_in_estimate": 4254 + } + }, + "degraded_reason": "" + } + } + ] +} \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/docs_router_deterministic/20260326_125615/full_chain_docs_intents_v3-3x_v3-api-health-2.md b/tests/pipeline_setup_v3/test_results/docs_router_deterministic/20260326_125615/full_chain_docs_intents_v3-3x_v3-api-health-2.md new file mode 100644 index 0000000..e70ceb1 --- /dev/null +++ b/tests/pipeline_setup_v3/test_results/docs_router_deterministic/20260326_125615/full_chain_docs_intents_v3-3x_v3-api-health-2.md @@ -0,0 +1,754 @@ +# v3-api-health-2 + +- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_03_docs/full_chain_docs_intents_v3-3x.yaml +- runner: agent_runtime +- mode: pre_llm +- passed: True + +## Query +Как работает health endpoint? + +## Actual +{ + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "API_METHOD_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START", + "rag_count": 17, + "llm_answer": "", + "answer_mode": "answered", + "path_scope": [], + "doc_scope": [ + "api.send_message_endpoint", + "api.control_actions_endpoint", + "api.actions_endpoint", + "api.health_endpoint", + "domain.runtime_health", + "architecture.telegram_notify_app", + "architecture.telegram_notify_app_overview", + "logic.telegram_notification_loop" + ], + "entity_candidates": [], + "symbol_candidates": [], + "layers": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D4_WORKFLOW_INDEX", + "D0_DOC_CHUNKS" + ], + "filters": { + "doc_type": "api_method" + }, + "pipeline_mode": "pre_llm_only", + "gate_decision": "allow", + "prompt_used": "docs_explain_answer", + "llm_mode": "prose", + "degraded_reason": null, + "code_intents_stubbed": true +} + +## Pipeline Steps +### input_query +```json +{ + "input": { + "query": "Как работает health endpoint?" + }, + "output": { + "query": "Как работает health endpoint?" + } +} +``` + +### router +```json +{ + "input": { + "query": "Как работает health endpoint?" + }, + "output": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "API_METHOD_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START" + } +} +``` + +### docs_pipeline +```json +{ + "input": { + "query": "Как работает health endpoint?" + }, + "output": { + "answer_mode": "ready", + "prompt_name": "docs_explain_answer", + "llm_request": { + "prompt_name": "docs_explain_answer", + "log_context": "graph.project_qa.docs.answer", + "prompt_stats": { + "system_chars": 393, + "user_chars": 16622, + "tokens_in_estimate": 4254 + } + }, + "degraded_reason": "" + } +} +``` + +## Diagnostics +{ + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "API_METHOD_EXPLAIN", + "layers_used": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D4_WORKFLOW_INDEX", + "D0_DOC_CHUNKS" + ], + "documents_found": 6, + "facts_found": 2, + "relations_found": 0, + "openapi_fields_extracted": 0, + "missing_required_fields": [], + "openapi_status": { + "has_path": false, + "has_method": false, + "has_request": false, + "has_response": false + }, + "prompt_used": "docs_explain_answer", + "llm_mode": "prose", + "output_valid": true, + "matched_intent_source": "deterministic", + "matched_anchor_type": "topic", + "matched_anchor_value": null, + "exact_anchor_match": false, + "docs_layers_requested": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D4_WORKFLOW_INDEX", + "D0_DOC_CHUNKS" + ], + "docs_layers_with_hits": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D4_WORKFLOW_INDEX", + "D0_DOC_CHUNKS" + ], + "planned_layers": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D4_WORKFLOW_INDEX", + "D0_DOC_CHUNKS" + ], + "executed_layers": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D4_WORKFLOW_INDEX", + "D0_DOC_CHUNKS" + ], + "non_empty_layers": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D4_WORKFLOW_INDEX", + "D0_DOC_CHUNKS" + ], + "layer_diagnostics": { + "D1_DOCUMENT_CATALOG": { + "hits": 6, + "top_ids": [ + "api.send_message_endpoint", + "api.control_actions_endpoint", + "api.health_endpoint", + "domain.runtime_health", + "architecture.telegram_notify_app" + ] + }, + "D2_FACT_INDEX": { + "hits": 8, + "top_ids": [ + "f85d982c272a2ee6baeadc433221a20e684cd8ef01cb4788d6f76d05ca56d6d0", + "b8e44c3adb74aaa6c91ae8815fa091289e58dd3990a3a1b63e850c62075aea75", + "b6bfad59b3bf00f199b5ef90c1208af19664de700413e7354468a93a4abaaa2f", + "a8a325e0815b3a2a870ba2825f3afb3f41056b4c091df4c3bb3418ffd20891dd", + "bafb867ffed41c9db637df98d6cd5f6722d7747bbebc6c03e6f0d0caf3b7f9f3" + ] + }, + "D4_WORKFLOW_INDEX": { + "hits": 3, + "top_ids": [ + "api.control_actions_endpoint", + "api.health_endpoint", + "api.send_message_endpoint" + ] + }, + "D0_DOC_CHUNKS": { + "hits": 6, + "top_ids": [ + "api.control_actions_endpoint" + ] + } + }, + "query_entity_candidates": [], + "resolved_entity_candidates": [], + "query_anchor_candidates": [], + "resolved_anchor_candidates": [ + "api.send_message_endpoint", + "docs/documentation/api/send-message-endpoint.md", + "api.control_actions_endpoint", + "docs/documentation/api/control-actions-endpoint.md", + "api.health_endpoint", + "docs/documentation/api/health-endpoint.md", + "domain.runtime_health", + "docs/documentation/domain/runtime-health-entity.md", + "architecture.telegram_notify_app", + "docs/documentation/architecture/telegram-notify-app-overview.md", + "logic.telegram_notification_loop", + "docs/documentation/logic/telegram-notification-loop.md" + ], + "anchor_candidates": [], + "selected_anchor": null, + "anchor_selection_reason": "", + "anchor_match_type": "", + "doc_ids": [ + "api.send_message_endpoint", + "api.control_actions_endpoint", + "api.actions_endpoint", + "api.health_endpoint", + "domain.runtime_health", + "architecture.telegram_notify_app", + "architecture.telegram_notify_app_overview", + "logic.telegram_notification_loop" + ], + "doc_paths": [ + "docs/documentation/api/send-message-endpoint.md", + "docs/documentation/api/control-actions-endpoint.md", + "docs/documentation/api/health-endpoint.md", + "docs/documentation/domain/runtime-health-entity.md", + "docs/documentation/architecture/telegram-notify-app-overview.md", + "docs/documentation/logic/telegram-notification-loop.md" + ], + "doc_titles": [ + "HTTP API /send", + "HTTP API /actions/{action}", + "HTTP API /health", + "Сущность runtime health", + "Архитектура Telegram Notify App", + "Цикл отправки уведомлений в Telegram", + "api.control_actions_endpoint:workflow_step", + "api.control_actions_endpoint:mentions_entity", + "Scenario", + "api.control_actions_endpoint:Функциональные требования", + "api.control_actions_endpoint:Нефункциональные требования", + "api.control_actions_endpoint:Сценарий", + "api.control_actions_endpoint:Summary", + "api.control_actions_endpoint:Описание", + "api.control_actions_endpoint:Входные параметры" + ], + "relation_hits_count": 0, + "relation_targets": [], + "fallback_doc_hits_count": 12, + "fallback_used": false, + "fact_hits": 2, + "entity_hits": 0, + "evidence_summary": { + "documents": 6, + "facts": 2, + "relations": 0, + "chunks": 6, + "entity_hits": 0, + "openapi_signals": { + "path_found": false, + "method_found": false, + "request_schema": false, + "response_schema": false, + "status_codes": false, + "payload_description": false + } + }, + "gate_decision": "allow", + "gate_decision_reason": "evidence_sufficient", + "gate_missing_requirements": [], + "gate_satisfied_requirements": [ + "retrieval_non_empty" + ], + "openapi_evidence": { + "path_found": false, + "method_found": false, + "request_schema": false, + "response_schema": false, + "status_codes": false, + "payload_description": false + }, + "requested_fragment_type": null, + "fragment_evidence_found": [], + "fragment_missing_requirements": [], + "answer_mode": "ready", + "degrade_reason": null, + "degraded_reason": null, + "code_intents_stubbed": false +} + +## LLM Request +- prompt_name: docs_explain_answer +- log_context: graph.project_qa.docs.answer + +### Prompt Stats +```json +{ + "system_chars": 393, + "user_chars": 16622, + "tokens_in_estimate": 4254 +} +``` + +### System Prompt +```text +Ты объясняешь документацию системы. + +На вход приходит JSON с полями: +- question +- intent +- sub_intent +- documents +- facts +- relations + +Правила: +- Используй только предоставленные факты +- Не додумывай +- Если данных недостаточно, скажи это явно +- Объясняй структурировано + +Формат ответа: +1. Краткое описание +2. Основные элементы +3. Как это работает +4. Связи с другими частями системы (если есть) +``` + +### User Prompt +```json +{ + "question": "Как работает health endpoint?", + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "API_METHOD_EXPLAIN", + "documents": [ + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/api/send-message-endpoint.md", + "title": "HTTP API /send", + "content": "Endpoint `/send` выполняет ручную отправку сообщения в Telegram через `TelegramSendService`. Он используется для операторской проверки доставки и для отправки уведомлений вне периодического worker loop. Endpoint работает поверх тех же credentials и того же delivery path, что и фоновая отправка.", + "metadata": { + "name": "send_message_endpoint", + "tags": [ + "api", + "telegram", + "manual-send" + ], + "type": "api_method", + "layer": "application", + "links": [ + { + "type": "part_of", + "target": "architecture.telegram_notify_app" + }, + { + "type": "depends_on", + "target": "logic.telegram_notification_loop" + } + ], + "owner": null, + "title": "HTTP API /send", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "architecture.telegram_notify_app", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "5fbf2e33510b0676a3a53b957a4569bd3c2c31fb7719546602c573421ccaa32d", + "children": [], + "doc_kind": "misc", + "entities": [ + "TelegramControlAppFactory", + "TelegramSendService", + "TelegramNotifyWorker" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "api.send_message_endpoint", + "source_path": "docs/documentation/api/send-message-endpoint.md", + "summary_text": "Endpoint `/send` выполняет ручную отправку сообщения в Telegram через `TelegramSendService`. Он используется для операторской проверки доставки и для отправки уведомлений вне периодического worker loop. Endpoint работает поверх тех же credentials и того же delivery path, что и фоновая отправка.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "HTTP API /actions/{action}", + "content": "Endpoint `/actions/{action}` управляет control actions runtime и поддерживает `start`, `stop` и `status`. Для долгих операций `start` и `stop` допускается ответ HTTP 202, если действие еще выполняется. Endpoint используется для operator-driven управления жизненным циклом worker'а через HTTP API.", + "metadata": { + "name": "control_actions_endpoint", + "tags": [ + "api", + "control-plane", + "lifecycle" + ], + "type": "api_method", + "layer": "application", + "links": [ + { + "type": "part_of", + "target": "architecture.telegram_notify_app" + }, + { + "type": "related_api", + "target": "api.health_endpoint" + }, + { + "type": "related_logic", + "target": "logic.telegram_notification_loop" + } + ], + "owner": null, + "title": "HTTP API /actions/{action}", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "architecture.telegram_notify_app", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "children": [], + "doc_kind": "misc", + "entities": [ + "TelegramControlChannel", + "ControlActionSet", + "JSONResponse" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "api.control_actions_endpoint", + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "summary_text": "Endpoint `/actions/{action}` управляет control actions runtime и поддерживает `start`, `stop` и `status`. Для долгих операций `start` и `stop` допускается ответ HTTP 202, если действие еще выполняется. Endpoint используется для operator-driven управления жизненным циклом worker'а через HTTP API.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/api/health-endpoint.md", + "title": "HTTP API /health", + "content": "Endpoint `/health` возвращает агрегированный health payload runtime. Если общий статус равен `ok`, API отвечает с HTTP 200; для состояний деградации или неготовности возвращается HTTP 503 с тем же payload. Endpoint служит основной точкой внешней проверки состояния приложения.", + "metadata": { + "name": "health_endpoint", + "tags": [ + "api", + "health", + "control-plane" + ], + "type": "api_method", + "layer": "application", + "links": [ + { + "type": "part_of", + "target": "architecture.telegram_notify_app" + }, + { + "type": "depends_on", + "target": "domain.runtime_health" + } + ], + "owner": null, + "title": "HTTP API /health", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "architecture.telegram_notify_app", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "8b5a533a8076e2e9d36995eee29aeade260080bdca2ec8e21fe28f08574b983f", + "children": [], + "doc_kind": "misc", + "entities": [ + "TelegramControlChannel", + "TelegramNotifyWorker", + "RuntimeManager", + "WorkerHealth" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "api.health_endpoint", + "source_path": "docs/documentation/api/health-endpoint.md", + "summary_text": "Endpoint `/health` возвращает агрегированный health payload runtime. Если общий статус равен `ok`, API отвечает с HTTP 200; для состояний деградации или неготовности возвращается HTTP 503 с тем же payload. Endpoint служит основной точкой внешней проверки состояния приложения.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/domain/runtime-health-entity.md", + "title": "Сущность runtime health", + "content": "`runtime health` — доменная модель наблюдаемости сервиса, которая описывает общее состояние runtime и состояние отдельных компонентов. Для `test_echo_app` главным объектом наблюдения является компонент `telegram_notify`, у которого важны статус, время старта и количество успешных отправок. Эта модель используется для внешнего health-monitoring и внутренней диагностики.", + "metadata": { + "name": "runtime_health", + "tags": [ + "domain", + "health", + "observability" + ], + "type": "domain_entity", + "layer": "domain", + "links": [ + { + "type": "part_of", + "target": "architecture.telegram_notify_app" + }, + { + "type": "used_by", + "target": "api.health_endpoint" + }, + { + "type": "related_logic", + "target": "logic.telegram_notification_loop" + } + ], + "owner": null, + "title": "Сущность runtime health", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "architecture.telegram_notify_app", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "37d4dcf470ea3de95d59e44786006e369a3ea11bf5dbf4c88877696e9183ee87", + "children": [], + "doc_kind": "misc", + "entities": [ + "WorkerHealth", + "WorkerStatus", + "TelegramNotifyWorker" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "domain.runtime_health", + "source_path": "docs/documentation/domain/runtime-health-entity.md", + "summary_text": "`runtime health` — доменная модель наблюдаемости сервиса, которая описывает общее состояние runtime и состояние отдельных компонентов. Для `test_echo_app` главным объектом наблюдения является компонент `telegram_notify`, у которого важны статус, время старта и количество успешных отправок. Эта модель используется для внешнего health-monitoring и внутренней диагностики.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/architecture/telegram-notify-app-overview.md", + "title": "Архитектура Telegram Notify App", + "content": "`test_echo_app` — сервис на базе PLBA runtime, который поднимает HTTP control plane и запускает фоновый воркер для периодической отправки уведомлений в Telegram. Приложение использует YAML-конфиг для runtime-настроек и переменные окружения для Telegram credentials. Основной контур системы состоит из runtime manager, control channel, send service и worker loop.", + "metadata": { + "name": "telegram_notify_app_overview", + "tags": [ + "architecture", + "telegram", + "plba", + "runtime" + ], + "type": "architecture_overview", + "layer": "system", + "links": [ + { + "type": "related_api", + "target": "api.health_endpoint" + }, + { + "type": "related_api", + "target": "api.control_actions_endpoint" + }, + { + "type": "related_api", + "target": "api.send_message_endpoint" + }, + { + "type": "depends_on", + "target": "logic.telegram_notification_loop" + }, + { + "type": "depends_on", + "target": "domain.runtime_health" + } + ], + "owner": null, + "title": "Архитектура Telegram Notify App", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "docs_root", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "8b1cc9f823e55bddbc825466d10a0fdb4ca4354ac02d91f9e2aef7b7d2ec8256", + "children": [ + "api.health_endpoint", + "api.control_actions_endpoint", + "api.send_message_endpoint", + "logic.telegram_notification_loop", + "domain.runtime_health" + ], + "doc_kind": "spec", + "entities": [ + "TelegramNotifyModule", + "TelegramNotifyWorker", + "TelegramControlChannel", + "TelegramSendService", + "RuntimeManager" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "architecture.telegram_notify_app", + "source_path": "docs/documentation/architecture/telegram-notify-app-overview.md", + "summary_text": "`test_echo_app` — сервис на базе PLBA runtime, который поднимает HTTP control plane и запускает фоновый воркер для периодической отправки уведомлений в Telegram. Приложение использует YAML-конфиг для runtime-настроек и переменные окружения для Telegram credentials. Основной контур системы состоит из runtime manager, control channel, send service и worker loop.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/logic/telegram-notification-loop.md", + "title": "Цикл отправки уведомлений в Telegram", + "content": "`TelegramNotifyWorker` после старта runtime запускает отдельный поток, сразу делает первую попытку отправки сообщения и затем повторяет отправку через заданный интервал. При ошибках доставки или отсутствии credentials worker не останавливает сервис, а переводит собственное состояние в `degraded`. Этот workflow определяет основной полезный цикл приложения.", + "metadata": { + "name": "telegram_notification_loop", + "tags": [ + "logic", + "telegram", + "worker", + "scheduling" + ], + "type": "logic_block", + "layer": "application", + "links": [ + { + "type": "part_of", + "target": "architecture.telegram_notify_app" + }, + { + "type": "related_api", + "target": "api.send_message_endpoint" + }, + { + "type": "related_api", + "target": "api.control_actions_endpoint" + }, + { + "type": "related_api", + "target": "api.health_endpoint" + } + ], + "owner": null, + "title": "Цикл отправки уведомлений в Telegram", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "architecture.telegram_notify_app", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "0f62f9b4dab261ca4ca34575ff5d84411a22c90b780c52eda388782b94f08470", + "children": [], + "doc_kind": "misc", + "entities": [ + "TelegramNotifyWorker", + "TelegramSendService", + "WorkerHealth", + "WorkerStatus" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "logic.telegram_notification_loop", + "source_path": "docs/documentation/logic/telegram-notification-loop.md", + "summary_text": "`TelegramNotifyWorker` после старта runtime запускает отдельный поток, сразу делает первую попытку отправки сообщения и затем повторяет отправку через заданный интервал. При ошибках доставки или отсутствии credentials worker не останавливает сервис, а переводит собственное состояние в `degraded`. Этот workflow определяет основной полезный цикл приложения.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + } + ], + "facts": [ + { + "layer": "D2_FACT_INDEX", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "api.control_actions_endpoint:workflow_step", + "content": "api.control_actions_endpoint workflow_step Название:** Выполнение control action runtime", + "metadata": { + "tags": [], + "owner": null, + "anchor": "Сценарий", + "doc_id": null, + "object": "Название:** Выполнение control action runtime", + "fact_id": "f85d982c272a2ee6baeadc433221a20e684cd8ef01cb4788d6f76d05ca56d6d0", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "predicate": "workflow_step", + "object_ref": null, + "subject_id": "api.control_actions_endpoint", + "doc_version": null, + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D2_FACT_INDEX", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "api.control_actions_endpoint:mentions_entity", + "content": "api.control_actions_endpoint mentions_entity JSONResponse", + "metadata": { + "tags": [], + "owner": null, + "anchor": "frontmatter.entities", + "doc_id": null, + "object": "JSONResponse", + "fact_id": "b6bfad59b3bf00f199b5ef90c1208af19664de700413e7354468a93a4abaaa2f", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "predicate": "mentions_entity", + "object_ref": null, + "subject_id": "api.control_actions_endpoint", + "doc_version": null, + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + } + ], + "relations": [] +} +``` + +### User Prompt Overview +- question: Как работает health endpoint? +- intent: DOCUMENTATION_EXPLAIN +- sub_intent: API_METHOD_EXPLAIN +- documents: 6 | samples: HTTP API /send, HTTP API /actions/{action}, HTTP API /health +- facts: 2 | samples: api.control_actions_endpoint:workflow_step, api.control_actions_endpoint:mentions_entity +- relations: 0 + +## Mismatches +- none \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/docs_router_deterministic/20260326_125615/full_chain_docs_intents_v3-3x_v3-api-health-3.json b/tests/pipeline_setup_v3/test_results/docs_router_deterministic/20260326_125615/full_chain_docs_intents_v3-3x_v3-api-health-3.json new file mode 100644 index 0000000..629070e --- /dev/null +++ b/tests/pipeline_setup_v3/test_results/docs_router_deterministic/20260326_125615/full_chain_docs_intents_v3-3x_v3-api-health-3.json @@ -0,0 +1,90 @@ +{ + "meta": { + "case_id": "v3-api-health-3", + "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_03_docs/full_chain_docs_intents_v3-3x.yaml", + "runner": "agent_runtime", + "mode": "pre_llm", + "passed": true, + "mismatches": [], + "actual": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "API_METHOD_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START", + "rag_count": 17, + "llm_answer": "", + "answer_mode": "answered", + "path_scope": [], + "doc_scope": [ + "api.send_message_endpoint", + "api.control_actions_endpoint", + "api.actions_endpoint", + "api.health_endpoint", + "domain.runtime_health", + "architecture.telegram_notify_app", + "architecture.telegram_notify_app_overview", + "logic.telegram_notification_loop" + ], + "entity_candidates": [], + "symbol_candidates": [], + "layers": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D4_WORKFLOW_INDEX", + "D0_DOC_CHUNKS" + ], + "filters": { + "doc_type": "api_method" + }, + "pipeline_mode": "pre_llm_only", + "gate_decision": "allow", + "prompt_used": "docs_explain_answer", + "llm_mode": "prose", + "degraded_reason": null, + "code_intents_stubbed": true + } + }, + "pipeline_steps": [ + { + "step": "input_query", + "input": { + "query": "Опиши endpoint health" + }, + "output": { + "query": "Опиши endpoint health" + } + }, + { + "step": "router", + "input": { + "query": "Опиши endpoint health" + }, + "output": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "API_METHOD_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START" + } + }, + { + "step": "docs_pipeline", + "input": { + "query": "Опиши endpoint health" + }, + "output": { + "answer_mode": "ready", + "prompt_name": "docs_explain_answer", + "llm_request": { + "prompt_name": "docs_explain_answer", + "log_context": "graph.project_qa.docs.answer", + "prompt_stats": { + "system_chars": 393, + "user_chars": 16614, + "tokens_in_estimate": 4252 + } + }, + "degraded_reason": "" + } + } + ] +} \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/docs_router_deterministic/20260326_125615/full_chain_docs_intents_v3-3x_v3-api-health-3.md b/tests/pipeline_setup_v3/test_results/docs_router_deterministic/20260326_125615/full_chain_docs_intents_v3-3x_v3-api-health-3.md new file mode 100644 index 0000000..46e7478 --- /dev/null +++ b/tests/pipeline_setup_v3/test_results/docs_router_deterministic/20260326_125615/full_chain_docs_intents_v3-3x_v3-api-health-3.md @@ -0,0 +1,754 @@ +# v3-api-health-3 + +- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_03_docs/full_chain_docs_intents_v3-3x.yaml +- runner: agent_runtime +- mode: pre_llm +- passed: True + +## Query +Опиши endpoint health + +## Actual +{ + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "API_METHOD_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START", + "rag_count": 17, + "llm_answer": "", + "answer_mode": "answered", + "path_scope": [], + "doc_scope": [ + "api.send_message_endpoint", + "api.control_actions_endpoint", + "api.actions_endpoint", + "api.health_endpoint", + "domain.runtime_health", + "architecture.telegram_notify_app", + "architecture.telegram_notify_app_overview", + "logic.telegram_notification_loop" + ], + "entity_candidates": [], + "symbol_candidates": [], + "layers": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D4_WORKFLOW_INDEX", + "D0_DOC_CHUNKS" + ], + "filters": { + "doc_type": "api_method" + }, + "pipeline_mode": "pre_llm_only", + "gate_decision": "allow", + "prompt_used": "docs_explain_answer", + "llm_mode": "prose", + "degraded_reason": null, + "code_intents_stubbed": true +} + +## Pipeline Steps +### input_query +```json +{ + "input": { + "query": "Опиши endpoint health" + }, + "output": { + "query": "Опиши endpoint health" + } +} +``` + +### router +```json +{ + "input": { + "query": "Опиши endpoint health" + }, + "output": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "API_METHOD_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START" + } +} +``` + +### docs_pipeline +```json +{ + "input": { + "query": "Опиши endpoint health" + }, + "output": { + "answer_mode": "ready", + "prompt_name": "docs_explain_answer", + "llm_request": { + "prompt_name": "docs_explain_answer", + "log_context": "graph.project_qa.docs.answer", + "prompt_stats": { + "system_chars": 393, + "user_chars": 16614, + "tokens_in_estimate": 4252 + } + }, + "degraded_reason": "" + } +} +``` + +## Diagnostics +{ + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "API_METHOD_EXPLAIN", + "layers_used": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D4_WORKFLOW_INDEX", + "D0_DOC_CHUNKS" + ], + "documents_found": 6, + "facts_found": 2, + "relations_found": 0, + "openapi_fields_extracted": 0, + "missing_required_fields": [], + "openapi_status": { + "has_path": false, + "has_method": false, + "has_request": false, + "has_response": false + }, + "prompt_used": "docs_explain_answer", + "llm_mode": "prose", + "output_valid": true, + "matched_intent_source": "deterministic", + "matched_anchor_type": "topic", + "matched_anchor_value": null, + "exact_anchor_match": false, + "docs_layers_requested": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D4_WORKFLOW_INDEX", + "D0_DOC_CHUNKS" + ], + "docs_layers_with_hits": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D4_WORKFLOW_INDEX", + "D0_DOC_CHUNKS" + ], + "planned_layers": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D4_WORKFLOW_INDEX", + "D0_DOC_CHUNKS" + ], + "executed_layers": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D4_WORKFLOW_INDEX", + "D0_DOC_CHUNKS" + ], + "non_empty_layers": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D4_WORKFLOW_INDEX", + "D0_DOC_CHUNKS" + ], + "layer_diagnostics": { + "D1_DOCUMENT_CATALOG": { + "hits": 6, + "top_ids": [ + "api.send_message_endpoint", + "api.control_actions_endpoint", + "api.health_endpoint", + "domain.runtime_health", + "architecture.telegram_notify_app" + ] + }, + "D2_FACT_INDEX": { + "hits": 8, + "top_ids": [ + "f85d982c272a2ee6baeadc433221a20e684cd8ef01cb4788d6f76d05ca56d6d0", + "b8e44c3adb74aaa6c91ae8815fa091289e58dd3990a3a1b63e850c62075aea75", + "b6bfad59b3bf00f199b5ef90c1208af19664de700413e7354468a93a4abaaa2f", + "a8a325e0815b3a2a870ba2825f3afb3f41056b4c091df4c3bb3418ffd20891dd", + "bafb867ffed41c9db637df98d6cd5f6722d7747bbebc6c03e6f0d0caf3b7f9f3" + ] + }, + "D4_WORKFLOW_INDEX": { + "hits": 3, + "top_ids": [ + "api.control_actions_endpoint", + "api.health_endpoint", + "api.send_message_endpoint" + ] + }, + "D0_DOC_CHUNKS": { + "hits": 6, + "top_ids": [ + "api.control_actions_endpoint" + ] + } + }, + "query_entity_candidates": [], + "resolved_entity_candidates": [], + "query_anchor_candidates": [], + "resolved_anchor_candidates": [ + "api.send_message_endpoint", + "docs/documentation/api/send-message-endpoint.md", + "api.control_actions_endpoint", + "docs/documentation/api/control-actions-endpoint.md", + "api.health_endpoint", + "docs/documentation/api/health-endpoint.md", + "domain.runtime_health", + "docs/documentation/domain/runtime-health-entity.md", + "architecture.telegram_notify_app", + "docs/documentation/architecture/telegram-notify-app-overview.md", + "logic.telegram_notification_loop", + "docs/documentation/logic/telegram-notification-loop.md" + ], + "anchor_candidates": [], + "selected_anchor": null, + "anchor_selection_reason": "", + "anchor_match_type": "", + "doc_ids": [ + "api.send_message_endpoint", + "api.control_actions_endpoint", + "api.actions_endpoint", + "api.health_endpoint", + "domain.runtime_health", + "architecture.telegram_notify_app", + "architecture.telegram_notify_app_overview", + "logic.telegram_notification_loop" + ], + "doc_paths": [ + "docs/documentation/api/send-message-endpoint.md", + "docs/documentation/api/control-actions-endpoint.md", + "docs/documentation/api/health-endpoint.md", + "docs/documentation/domain/runtime-health-entity.md", + "docs/documentation/architecture/telegram-notify-app-overview.md", + "docs/documentation/logic/telegram-notification-loop.md" + ], + "doc_titles": [ + "HTTP API /send", + "HTTP API /actions/{action}", + "HTTP API /health", + "Сущность runtime health", + "Архитектура Telegram Notify App", + "Цикл отправки уведомлений в Telegram", + "api.control_actions_endpoint:workflow_step", + "api.control_actions_endpoint:mentions_entity", + "Scenario", + "api.control_actions_endpoint:Функциональные требования", + "api.control_actions_endpoint:Нефункциональные требования", + "api.control_actions_endpoint:Сценарий", + "api.control_actions_endpoint:Summary", + "api.control_actions_endpoint:Описание", + "api.control_actions_endpoint:Входные параметры" + ], + "relation_hits_count": 0, + "relation_targets": [], + "fallback_doc_hits_count": 12, + "fallback_used": false, + "fact_hits": 2, + "entity_hits": 0, + "evidence_summary": { + "documents": 6, + "facts": 2, + "relations": 0, + "chunks": 6, + "entity_hits": 0, + "openapi_signals": { + "path_found": false, + "method_found": false, + "request_schema": false, + "response_schema": false, + "status_codes": false, + "payload_description": false + } + }, + "gate_decision": "allow", + "gate_decision_reason": "evidence_sufficient", + "gate_missing_requirements": [], + "gate_satisfied_requirements": [ + "retrieval_non_empty" + ], + "openapi_evidence": { + "path_found": false, + "method_found": false, + "request_schema": false, + "response_schema": false, + "status_codes": false, + "payload_description": false + }, + "requested_fragment_type": null, + "fragment_evidence_found": [], + "fragment_missing_requirements": [], + "answer_mode": "ready", + "degrade_reason": null, + "degraded_reason": null, + "code_intents_stubbed": false +} + +## LLM Request +- prompt_name: docs_explain_answer +- log_context: graph.project_qa.docs.answer + +### Prompt Stats +```json +{ + "system_chars": 393, + "user_chars": 16614, + "tokens_in_estimate": 4252 +} +``` + +### System Prompt +```text +Ты объясняешь документацию системы. + +На вход приходит JSON с полями: +- question +- intent +- sub_intent +- documents +- facts +- relations + +Правила: +- Используй только предоставленные факты +- Не додумывай +- Если данных недостаточно, скажи это явно +- Объясняй структурировано + +Формат ответа: +1. Краткое описание +2. Основные элементы +3. Как это работает +4. Связи с другими частями системы (если есть) +``` + +### User Prompt +```json +{ + "question": "Опиши endpoint health", + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "API_METHOD_EXPLAIN", + "documents": [ + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/api/send-message-endpoint.md", + "title": "HTTP API /send", + "content": "Endpoint `/send` выполняет ручную отправку сообщения в Telegram через `TelegramSendService`. Он используется для операторской проверки доставки и для отправки уведомлений вне периодического worker loop. Endpoint работает поверх тех же credentials и того же delivery path, что и фоновая отправка.", + "metadata": { + "name": "send_message_endpoint", + "tags": [ + "api", + "telegram", + "manual-send" + ], + "type": "api_method", + "layer": "application", + "links": [ + { + "type": "part_of", + "target": "architecture.telegram_notify_app" + }, + { + "type": "depends_on", + "target": "logic.telegram_notification_loop" + } + ], + "owner": null, + "title": "HTTP API /send", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "architecture.telegram_notify_app", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "5fbf2e33510b0676a3a53b957a4569bd3c2c31fb7719546602c573421ccaa32d", + "children": [], + "doc_kind": "misc", + "entities": [ + "TelegramControlAppFactory", + "TelegramSendService", + "TelegramNotifyWorker" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "api.send_message_endpoint", + "source_path": "docs/documentation/api/send-message-endpoint.md", + "summary_text": "Endpoint `/send` выполняет ручную отправку сообщения в Telegram через `TelegramSendService`. Он используется для операторской проверки доставки и для отправки уведомлений вне периодического worker loop. Endpoint работает поверх тех же credentials и того же delivery path, что и фоновая отправка.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "HTTP API /actions/{action}", + "content": "Endpoint `/actions/{action}` управляет control actions runtime и поддерживает `start`, `stop` и `status`. Для долгих операций `start` и `stop` допускается ответ HTTP 202, если действие еще выполняется. Endpoint используется для operator-driven управления жизненным циклом worker'а через HTTP API.", + "metadata": { + "name": "control_actions_endpoint", + "tags": [ + "api", + "control-plane", + "lifecycle" + ], + "type": "api_method", + "layer": "application", + "links": [ + { + "type": "part_of", + "target": "architecture.telegram_notify_app" + }, + { + "type": "related_api", + "target": "api.health_endpoint" + }, + { + "type": "related_logic", + "target": "logic.telegram_notification_loop" + } + ], + "owner": null, + "title": "HTTP API /actions/{action}", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "architecture.telegram_notify_app", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "children": [], + "doc_kind": "misc", + "entities": [ + "TelegramControlChannel", + "ControlActionSet", + "JSONResponse" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "api.control_actions_endpoint", + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "summary_text": "Endpoint `/actions/{action}` управляет control actions runtime и поддерживает `start`, `stop` и `status`. Для долгих операций `start` и `stop` допускается ответ HTTP 202, если действие еще выполняется. Endpoint используется для operator-driven управления жизненным циклом worker'а через HTTP API.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/api/health-endpoint.md", + "title": "HTTP API /health", + "content": "Endpoint `/health` возвращает агрегированный health payload runtime. Если общий статус равен `ok`, API отвечает с HTTP 200; для состояний деградации или неготовности возвращается HTTP 503 с тем же payload. Endpoint служит основной точкой внешней проверки состояния приложения.", + "metadata": { + "name": "health_endpoint", + "tags": [ + "api", + "health", + "control-plane" + ], + "type": "api_method", + "layer": "application", + "links": [ + { + "type": "part_of", + "target": "architecture.telegram_notify_app" + }, + { + "type": "depends_on", + "target": "domain.runtime_health" + } + ], + "owner": null, + "title": "HTTP API /health", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "architecture.telegram_notify_app", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "8b5a533a8076e2e9d36995eee29aeade260080bdca2ec8e21fe28f08574b983f", + "children": [], + "doc_kind": "misc", + "entities": [ + "TelegramControlChannel", + "TelegramNotifyWorker", + "RuntimeManager", + "WorkerHealth" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "api.health_endpoint", + "source_path": "docs/documentation/api/health-endpoint.md", + "summary_text": "Endpoint `/health` возвращает агрегированный health payload runtime. Если общий статус равен `ok`, API отвечает с HTTP 200; для состояний деградации или неготовности возвращается HTTP 503 с тем же payload. Endpoint служит основной точкой внешней проверки состояния приложения.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/domain/runtime-health-entity.md", + "title": "Сущность runtime health", + "content": "`runtime health` — доменная модель наблюдаемости сервиса, которая описывает общее состояние runtime и состояние отдельных компонентов. Для `test_echo_app` главным объектом наблюдения является компонент `telegram_notify`, у которого важны статус, время старта и количество успешных отправок. Эта модель используется для внешнего health-monitoring и внутренней диагностики.", + "metadata": { + "name": "runtime_health", + "tags": [ + "domain", + "health", + "observability" + ], + "type": "domain_entity", + "layer": "domain", + "links": [ + { + "type": "part_of", + "target": "architecture.telegram_notify_app" + }, + { + "type": "used_by", + "target": "api.health_endpoint" + }, + { + "type": "related_logic", + "target": "logic.telegram_notification_loop" + } + ], + "owner": null, + "title": "Сущность runtime health", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "architecture.telegram_notify_app", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "37d4dcf470ea3de95d59e44786006e369a3ea11bf5dbf4c88877696e9183ee87", + "children": [], + "doc_kind": "misc", + "entities": [ + "WorkerHealth", + "WorkerStatus", + "TelegramNotifyWorker" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "domain.runtime_health", + "source_path": "docs/documentation/domain/runtime-health-entity.md", + "summary_text": "`runtime health` — доменная модель наблюдаемости сервиса, которая описывает общее состояние runtime и состояние отдельных компонентов. Для `test_echo_app` главным объектом наблюдения является компонент `telegram_notify`, у которого важны статус, время старта и количество успешных отправок. Эта модель используется для внешнего health-monitoring и внутренней диагностики.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/architecture/telegram-notify-app-overview.md", + "title": "Архитектура Telegram Notify App", + "content": "`test_echo_app` — сервис на базе PLBA runtime, который поднимает HTTP control plane и запускает фоновый воркер для периодической отправки уведомлений в Telegram. Приложение использует YAML-конфиг для runtime-настроек и переменные окружения для Telegram credentials. Основной контур системы состоит из runtime manager, control channel, send service и worker loop.", + "metadata": { + "name": "telegram_notify_app_overview", + "tags": [ + "architecture", + "telegram", + "plba", + "runtime" + ], + "type": "architecture_overview", + "layer": "system", + "links": [ + { + "type": "related_api", + "target": "api.health_endpoint" + }, + { + "type": "related_api", + "target": "api.control_actions_endpoint" + }, + { + "type": "related_api", + "target": "api.send_message_endpoint" + }, + { + "type": "depends_on", + "target": "logic.telegram_notification_loop" + }, + { + "type": "depends_on", + "target": "domain.runtime_health" + } + ], + "owner": null, + "title": "Архитектура Telegram Notify App", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "docs_root", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "8b1cc9f823e55bddbc825466d10a0fdb4ca4354ac02d91f9e2aef7b7d2ec8256", + "children": [ + "api.health_endpoint", + "api.control_actions_endpoint", + "api.send_message_endpoint", + "logic.telegram_notification_loop", + "domain.runtime_health" + ], + "doc_kind": "spec", + "entities": [ + "TelegramNotifyModule", + "TelegramNotifyWorker", + "TelegramControlChannel", + "TelegramSendService", + "RuntimeManager" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "architecture.telegram_notify_app", + "source_path": "docs/documentation/architecture/telegram-notify-app-overview.md", + "summary_text": "`test_echo_app` — сервис на базе PLBA runtime, который поднимает HTTP control plane и запускает фоновый воркер для периодической отправки уведомлений в Telegram. Приложение использует YAML-конфиг для runtime-настроек и переменные окружения для Telegram credentials. Основной контур системы состоит из runtime manager, control channel, send service и worker loop.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/logic/telegram-notification-loop.md", + "title": "Цикл отправки уведомлений в Telegram", + "content": "`TelegramNotifyWorker` после старта runtime запускает отдельный поток, сразу делает первую попытку отправки сообщения и затем повторяет отправку через заданный интервал. При ошибках доставки или отсутствии credentials worker не останавливает сервис, а переводит собственное состояние в `degraded`. Этот workflow определяет основной полезный цикл приложения.", + "metadata": { + "name": "telegram_notification_loop", + "tags": [ + "logic", + "telegram", + "worker", + "scheduling" + ], + "type": "logic_block", + "layer": "application", + "links": [ + { + "type": "part_of", + "target": "architecture.telegram_notify_app" + }, + { + "type": "related_api", + "target": "api.send_message_endpoint" + }, + { + "type": "related_api", + "target": "api.control_actions_endpoint" + }, + { + "type": "related_api", + "target": "api.health_endpoint" + } + ], + "owner": null, + "title": "Цикл отправки уведомлений в Telegram", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "architecture.telegram_notify_app", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "0f62f9b4dab261ca4ca34575ff5d84411a22c90b780c52eda388782b94f08470", + "children": [], + "doc_kind": "misc", + "entities": [ + "TelegramNotifyWorker", + "TelegramSendService", + "WorkerHealth", + "WorkerStatus" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "logic.telegram_notification_loop", + "source_path": "docs/documentation/logic/telegram-notification-loop.md", + "summary_text": "`TelegramNotifyWorker` после старта runtime запускает отдельный поток, сразу делает первую попытку отправки сообщения и затем повторяет отправку через заданный интервал. При ошибках доставки или отсутствии credentials worker не останавливает сервис, а переводит собственное состояние в `degraded`. Этот workflow определяет основной полезный цикл приложения.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + } + ], + "facts": [ + { + "layer": "D2_FACT_INDEX", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "api.control_actions_endpoint:workflow_step", + "content": "api.control_actions_endpoint workflow_step Название:** Выполнение control action runtime", + "metadata": { + "tags": [], + "owner": null, + "anchor": "Сценарий", + "doc_id": null, + "object": "Название:** Выполнение control action runtime", + "fact_id": "f85d982c272a2ee6baeadc433221a20e684cd8ef01cb4788d6f76d05ca56d6d0", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "predicate": "workflow_step", + "object_ref": null, + "subject_id": "api.control_actions_endpoint", + "doc_version": null, + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D2_FACT_INDEX", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "api.control_actions_endpoint:mentions_entity", + "content": "api.control_actions_endpoint mentions_entity JSONResponse", + "metadata": { + "tags": [], + "owner": null, + "anchor": "frontmatter.entities", + "doc_id": null, + "object": "JSONResponse", + "fact_id": "b6bfad59b3bf00f199b5ef90c1208af19664de700413e7354468a93a4abaaa2f", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "predicate": "mentions_entity", + "object_ref": null, + "subject_id": "api.control_actions_endpoint", + "doc_version": null, + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + } + ], + "relations": [] +} +``` + +### User Prompt Overview +- question: Опиши endpoint health +- intent: DOCUMENTATION_EXPLAIN +- sub_intent: API_METHOD_EXPLAIN +- documents: 6 | samples: HTTP API /send, HTTP API /actions/{action}, HTTP API /health +- facts: 2 | samples: api.control_actions_endpoint:workflow_step, api.control_actions_endpoint:mentions_entity +- relations: 0 + +## Mismatches +- none \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/docs_router_deterministic/20260326_125615/full_chain_docs_intents_v3-3x_v3-api-send-1.json b/tests/pipeline_setup_v3/test_results/docs_router_deterministic/20260326_125615/full_chain_docs_intents_v3-3x_v3-api-send-1.json new file mode 100644 index 0000000..0b3a55b --- /dev/null +++ b/tests/pipeline_setup_v3/test_results/docs_router_deterministic/20260326_125615/full_chain_docs_intents_v3-3x_v3-api-send-1.json @@ -0,0 +1,83 @@ +{ + "meta": { + "case_id": "v3-api-send-1", + "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_03_docs/full_chain_docs_intents_v3-3x.yaml", + "runner": "agent_runtime", + "mode": "pre_llm", + "passed": true, + "mismatches": [], + "actual": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "API_METHOD_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START", + "rag_count": 10, + "llm_answer": "", + "answer_mode": "answered", + "path_scope": [], + "doc_scope": [ + "api.send_message_endpoint" + ], + "entity_candidates": [], + "symbol_candidates": [], + "layers": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D4_WORKFLOW_INDEX", + "D0_DOC_CHUNKS" + ], + "filters": { + "doc_type": "api_method" + }, + "pipeline_mode": "pre_llm_only", + "gate_decision": "allow", + "prompt_used": "docs_explain_answer", + "llm_mode": "prose", + "degraded_reason": null, + "code_intents_stubbed": true + } + }, + "pipeline_steps": [ + { + "step": "input_query", + "input": { + "query": "Что делает /send?" + }, + "output": { + "query": "Что делает /send?" + } + }, + { + "step": "router", + "input": { + "query": "Что делает /send?" + }, + "output": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "API_METHOD_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START" + } + }, + { + "step": "docs_pipeline", + "input": { + "query": "Что делает /send?" + }, + "output": { + "answer_mode": "ready", + "prompt_name": "docs_explain_answer", + "llm_request": { + "prompt_name": "docs_explain_answer", + "log_context": "graph.project_qa.docs.answer", + "prompt_stats": { + "system_chars": 393, + "user_chars": 4384, + "tokens_in_estimate": 1195 + } + }, + "degraded_reason": "" + } + } + ] +} \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/docs_router_deterministic/20260326_125615/full_chain_docs_intents_v3-3x_v3-api-send-1.md b/tests/pipeline_setup_v3/test_results/docs_router_deterministic/20260326_125615/full_chain_docs_intents_v3-3x_v3-api-send-1.md new file mode 100644 index 0000000..2ffaca9 --- /dev/null +++ b/tests/pipeline_setup_v3/test_results/docs_router_deterministic/20260326_125615/full_chain_docs_intents_v3-3x_v3-api-send-1.md @@ -0,0 +1,428 @@ +# v3-api-send-1 + +- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_03_docs/full_chain_docs_intents_v3-3x.yaml +- runner: agent_runtime +- mode: pre_llm +- passed: True + +## Query +Что делает /send? + +## Actual +{ + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "API_METHOD_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START", + "rag_count": 10, + "llm_answer": "", + "answer_mode": "answered", + "path_scope": [], + "doc_scope": [ + "api.send_message_endpoint" + ], + "entity_candidates": [], + "symbol_candidates": [], + "layers": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D4_WORKFLOW_INDEX", + "D0_DOC_CHUNKS" + ], + "filters": { + "doc_type": "api_method" + }, + "pipeline_mode": "pre_llm_only", + "gate_decision": "allow", + "prompt_used": "docs_explain_answer", + "llm_mode": "prose", + "degraded_reason": null, + "code_intents_stubbed": true +} + +## Pipeline Steps +### input_query +```json +{ + "input": { + "query": "Что делает /send?" + }, + "output": { + "query": "Что делает /send?" + } +} +``` + +### router +```json +{ + "input": { + "query": "Что делает /send?" + }, + "output": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "API_METHOD_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START" + } +} +``` + +### docs_pipeline +```json +{ + "input": { + "query": "Что делает /send?" + }, + "output": { + "answer_mode": "ready", + "prompt_name": "docs_explain_answer", + "llm_request": { + "prompt_name": "docs_explain_answer", + "log_context": "graph.project_qa.docs.answer", + "prompt_stats": { + "system_chars": 393, + "user_chars": 4384, + "tokens_in_estimate": 1195 + } + }, + "degraded_reason": "" + } +} +``` + +## Diagnostics +{ + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "API_METHOD_EXPLAIN", + "layers_used": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D4_WORKFLOW_INDEX", + "D0_DOC_CHUNKS" + ], + "documents_found": 1, + "facts_found": 2, + "relations_found": 0, + "openapi_fields_extracted": 0, + "missing_required_fields": [], + "openapi_status": { + "has_path": false, + "has_method": false, + "has_request": false, + "has_response": false + }, + "prompt_used": "docs_explain_answer", + "llm_mode": "prose", + "output_valid": true, + "matched_intent_source": "deterministic", + "matched_anchor_type": "endpoint", + "matched_anchor_value": "/send", + "exact_anchor_match": true, + "docs_layers_requested": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D4_WORKFLOW_INDEX", + "D0_DOC_CHUNKS" + ], + "docs_layers_with_hits": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D4_WORKFLOW_INDEX", + "D0_DOC_CHUNKS" + ], + "planned_layers": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D4_WORKFLOW_INDEX", + "D0_DOC_CHUNKS" + ], + "executed_layers": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D4_WORKFLOW_INDEX", + "D0_DOC_CHUNKS" + ], + "non_empty_layers": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D4_WORKFLOW_INDEX", + "D0_DOC_CHUNKS" + ], + "layer_diagnostics": { + "D1_DOCUMENT_CATALOG": { + "hits": 6, + "top_ids": [ + "api.send_message_endpoint", + "architecture.telegram_notify_app", + "api.control_actions_endpoint", + "api.health_endpoint", + "docs/README.md" + ] + }, + "D2_FACT_INDEX": { + "hits": 8, + "top_ids": [ + "6bf0a662808009874a108d0c97f7cca7fc4ff7a3a3d66e0947b31bf813cfdf4d", + "dc979c31d511a14d3af89f5f5c493fcfc0c9f2090dc16fb20ff874f4b3566221", + "149c4e0d3d34b3faba055b1495d54818fadc882af633da70035b82190c1bd327", + "480d85819e9298d4078f8a3bd6cfccb9c0fe2a03695b87f65f82f9aa8e2097b0", + "7aefee9ff6110088aad1891da66fc9085eb3f77d832605a3da565deecb96e850" + ] + }, + "D4_WORKFLOW_INDEX": { + "hits": 3, + "top_ids": [ + "api.send_message_endpoint", + "api.control_actions_endpoint", + "api.health_endpoint" + ] + }, + "D0_DOC_CHUNKS": { + "hits": 6, + "top_ids": [ + "api.send_message_endpoint" + ] + } + }, + "query_entity_candidates": [], + "resolved_entity_candidates": [], + "query_anchor_candidates": [ + "/send" + ], + "resolved_anchor_candidates": [ + "api.send_message_endpoint", + "docs/documentation/api/send-message-endpoint.md" + ], + "anchor_candidates": [], + "selected_anchor": null, + "anchor_selection_reason": "", + "anchor_match_type": "", + "doc_ids": [ + "api.send_message_endpoint" + ], + "doc_paths": [ + "docs/documentation/api/send-message-endpoint.md" + ], + "doc_titles": [ + "HTTP API /send", + "Scenario", + "api.send_message_endpoint:Сценарий", + "api.send_message_endpoint:workflow_step", + "api.send_message_endpoint:mentions_entity", + "api.send_message_endpoint:Нефункциональные требования", + "api.send_message_endpoint:Summary", + "api.send_message_endpoint:Описание", + "api.send_message_endpoint:Функциональные требования", + "api.send_message_endpoint:Входные параметры" + ], + "relation_hits_count": 0, + "relation_targets": [], + "fallback_doc_hits_count": 7, + "fallback_used": false, + "fact_hits": 2, + "entity_hits": 0, + "evidence_summary": { + "documents": 1, + "facts": 2, + "relations": 0, + "chunks": 6, + "entity_hits": 0, + "openapi_signals": { + "path_found": false, + "method_found": false, + "request_schema": false, + "response_schema": false, + "status_codes": false, + "payload_description": false + } + }, + "gate_decision": "allow", + "gate_decision_reason": "evidence_sufficient", + "gate_missing_requirements": [], + "gate_satisfied_requirements": [ + "retrieval_non_empty", + "exact_anchor_match" + ], + "openapi_evidence": { + "path_found": false, + "method_found": false, + "request_schema": false, + "response_schema": false, + "status_codes": false, + "payload_description": false + }, + "requested_fragment_type": null, + "fragment_evidence_found": [], + "fragment_missing_requirements": [], + "answer_mode": "ready", + "degrade_reason": null, + "degraded_reason": null, + "code_intents_stubbed": false +} + +## LLM Request +- prompt_name: docs_explain_answer +- log_context: graph.project_qa.docs.answer + +### Prompt Stats +```json +{ + "system_chars": 393, + "user_chars": 4384, + "tokens_in_estimate": 1195 +} +``` + +### System Prompt +```text +Ты объясняешь документацию системы. + +На вход приходит JSON с полями: +- question +- intent +- sub_intent +- documents +- facts +- relations + +Правила: +- Используй только предоставленные факты +- Не додумывай +- Если данных недостаточно, скажи это явно +- Объясняй структурировано + +Формат ответа: +1. Краткое описание +2. Основные элементы +3. Как это работает +4. Связи с другими частями системы (если есть) +``` + +### User Prompt +```json +{ + "question": "Что делает /send?", + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "API_METHOD_EXPLAIN", + "documents": [ + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/api/send-message-endpoint.md", + "title": "HTTP API /send", + "content": "Endpoint `/send` выполняет ручную отправку сообщения в Telegram через `TelegramSendService`. Он используется для операторской проверки доставки и для отправки уведомлений вне периодического worker loop. Endpoint работает поверх тех же credentials и того же delivery path, что и фоновая отправка.", + "metadata": { + "name": "send_message_endpoint", + "tags": [ + "api", + "telegram", + "manual-send" + ], + "type": "api_method", + "layer": "application", + "links": [ + { + "type": "part_of", + "target": "architecture.telegram_notify_app" + }, + { + "type": "depends_on", + "target": "logic.telegram_notification_loop" + } + ], + "owner": null, + "title": "HTTP API /send", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "architecture.telegram_notify_app", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "5fbf2e33510b0676a3a53b957a4569bd3c2c31fb7719546602c573421ccaa32d", + "children": [], + "doc_kind": "misc", + "entities": [ + "TelegramControlAppFactory", + "TelegramSendService", + "TelegramNotifyWorker" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "api.send_message_endpoint", + "source_path": "docs/documentation/api/send-message-endpoint.md", + "summary_text": "Endpoint `/send` выполняет ручную отправку сообщения в Telegram через `TelegramSendService`. Он используется для операторской проверки доставки и для отправки уведомлений вне периодического worker loop. Endpoint работает поверх тех же credentials и того же delivery path, что и фоновая отправка.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + } + ], + "facts": [ + { + "layer": "D2_FACT_INDEX", + "path": "docs/documentation/api/send-message-endpoint.md", + "title": "api.send_message_endpoint:workflow_step", + "content": "api.send_message_endpoint workflow_step Telegram credentials доступны в переменных окружения.", + "metadata": { + "tags": [], + "owner": null, + "anchor": "Сценарий", + "doc_id": null, + "object": "Telegram credentials доступны в переменных окружения.", + "fact_id": "6bf0a662808009874a108d0c97f7cca7fc4ff7a3a3d66e0947b31bf813cfdf4d", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "5fbf2e33510b0676a3a53b957a4569bd3c2c31fb7719546602c573421ccaa32d", + "predicate": "workflow_step", + "object_ref": null, + "subject_id": "api.send_message_endpoint", + "doc_version": null, + "source_path": "docs/documentation/api/send-message-endpoint.md", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D2_FACT_INDEX", + "path": "docs/documentation/api/send-message-endpoint.md", + "title": "api.send_message_endpoint:mentions_entity", + "content": "api.send_message_endpoint mentions_entity TelegramNotifyWorker", + "metadata": { + "tags": [], + "owner": null, + "anchor": "frontmatter.entities", + "doc_id": null, + "object": "TelegramNotifyWorker", + "fact_id": "149c4e0d3d34b3faba055b1495d54818fadc882af633da70035b82190c1bd327", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "5fbf2e33510b0676a3a53b957a4569bd3c2c31fb7719546602c573421ccaa32d", + "predicate": "mentions_entity", + "object_ref": null, + "subject_id": "api.send_message_endpoint", + "doc_version": null, + "source_path": "docs/documentation/api/send-message-endpoint.md", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + } + ], + "relations": [] +} +``` + +### User Prompt Overview +- question: Что делает /send? +- intent: DOCUMENTATION_EXPLAIN +- sub_intent: API_METHOD_EXPLAIN +- documents: 1 | samples: HTTP API /send +- facts: 2 | samples: api.send_message_endpoint:workflow_step, api.send_message_endpoint:mentions_entity +- relations: 0 + +## Mismatches +- none \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/docs_router_deterministic/20260326_125615/full_chain_docs_intents_v3-3x_v3-api-send-2.json b/tests/pipeline_setup_v3/test_results/docs_router_deterministic/20260326_125615/full_chain_docs_intents_v3-3x_v3-api-send-2.json new file mode 100644 index 0000000..bc6fd29 --- /dev/null +++ b/tests/pipeline_setup_v3/test_results/docs_router_deterministic/20260326_125615/full_chain_docs_intents_v3-3x_v3-api-send-2.json @@ -0,0 +1,90 @@ +{ + "meta": { + "case_id": "v3-api-send-2", + "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_03_docs/full_chain_docs_intents_v3-3x.yaml", + "runner": "agent_runtime", + "mode": "pre_llm", + "passed": true, + "mismatches": [], + "actual": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "API_METHOD_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START", + "rag_count": 17, + "llm_answer": "", + "answer_mode": "answered", + "path_scope": [], + "doc_scope": [ + "api.send_message_endpoint", + "api.control_actions_endpoint", + "api.actions_endpoint", + "api.health_endpoint", + "architecture.telegram_notify_app", + "architecture.telegram_notify_app_overview", + "docs/README.md", + "domain.runtime_health" + ], + "entity_candidates": [], + "symbol_candidates": [], + "layers": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D4_WORKFLOW_INDEX", + "D0_DOC_CHUNKS" + ], + "filters": { + "doc_type": "api_method" + }, + "pipeline_mode": "pre_llm_only", + "gate_decision": "allow", + "prompt_used": "docs_explain_answer", + "llm_mode": "prose", + "degraded_reason": null, + "code_intents_stubbed": true + } + }, + "pipeline_steps": [ + { + "step": "input_query", + "input": { + "query": "Как работает send endpoint?" + }, + "output": { + "query": "Как работает send endpoint?" + } + }, + { + "step": "router", + "input": { + "query": "Как работает send endpoint?" + }, + "output": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "API_METHOD_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START" + } + }, + { + "step": "docs_pipeline", + "input": { + "query": "Как работает send endpoint?" + }, + "output": { + "answer_mode": "ready", + "prompt_name": "docs_explain_answer", + "llm_request": { + "prompt_name": "docs_explain_answer", + "log_context": "graph.project_qa.docs.answer", + "prompt_stats": { + "system_chars": 393, + "user_chars": 14988, + "tokens_in_estimate": 3846 + } + }, + "degraded_reason": "" + } + } + ] +} \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/docs_router_deterministic/20260326_125615/full_chain_docs_intents_v3-3x_v3-api-send-2.md b/tests/pipeline_setup_v3/test_results/docs_router_deterministic/20260326_125615/full_chain_docs_intents_v3-3x_v3-api-send-2.md new file mode 100644 index 0000000..511691d --- /dev/null +++ b/tests/pipeline_setup_v3/test_results/docs_router_deterministic/20260326_125615/full_chain_docs_intents_v3-3x_v3-api-send-2.md @@ -0,0 +1,726 @@ +# v3-api-send-2 + +- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_03_docs/full_chain_docs_intents_v3-3x.yaml +- runner: agent_runtime +- mode: pre_llm +- passed: True + +## Query +Как работает send endpoint? + +## Actual +{ + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "API_METHOD_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START", + "rag_count": 17, + "llm_answer": "", + "answer_mode": "answered", + "path_scope": [], + "doc_scope": [ + "api.send_message_endpoint", + "api.control_actions_endpoint", + "api.actions_endpoint", + "api.health_endpoint", + "architecture.telegram_notify_app", + "architecture.telegram_notify_app_overview", + "docs/README.md", + "domain.runtime_health" + ], + "entity_candidates": [], + "symbol_candidates": [], + "layers": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D4_WORKFLOW_INDEX", + "D0_DOC_CHUNKS" + ], + "filters": { + "doc_type": "api_method" + }, + "pipeline_mode": "pre_llm_only", + "gate_decision": "allow", + "prompt_used": "docs_explain_answer", + "llm_mode": "prose", + "degraded_reason": null, + "code_intents_stubbed": true +} + +## Pipeline Steps +### input_query +```json +{ + "input": { + "query": "Как работает send endpoint?" + }, + "output": { + "query": "Как работает send endpoint?" + } +} +``` + +### router +```json +{ + "input": { + "query": "Как работает send endpoint?" + }, + "output": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "API_METHOD_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START" + } +} +``` + +### docs_pipeline +```json +{ + "input": { + "query": "Как работает send endpoint?" + }, + "output": { + "answer_mode": "ready", + "prompt_name": "docs_explain_answer", + "llm_request": { + "prompt_name": "docs_explain_answer", + "log_context": "graph.project_qa.docs.answer", + "prompt_stats": { + "system_chars": 393, + "user_chars": 14988, + "tokens_in_estimate": 3846 + } + }, + "degraded_reason": "" + } +} +``` + +## Diagnostics +{ + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "API_METHOD_EXPLAIN", + "layers_used": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D4_WORKFLOW_INDEX", + "D0_DOC_CHUNKS" + ], + "documents_found": 6, + "facts_found": 2, + "relations_found": 0, + "openapi_fields_extracted": 0, + "missing_required_fields": [], + "openapi_status": { + "has_path": false, + "has_method": false, + "has_request": false, + "has_response": false + }, + "prompt_used": "docs_explain_answer", + "llm_mode": "prose", + "output_valid": true, + "matched_intent_source": "deterministic", + "matched_anchor_type": "topic", + "matched_anchor_value": null, + "exact_anchor_match": false, + "docs_layers_requested": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D4_WORKFLOW_INDEX", + "D0_DOC_CHUNKS" + ], + "docs_layers_with_hits": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D4_WORKFLOW_INDEX", + "D0_DOC_CHUNKS" + ], + "planned_layers": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D4_WORKFLOW_INDEX", + "D0_DOC_CHUNKS" + ], + "executed_layers": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D4_WORKFLOW_INDEX", + "D0_DOC_CHUNKS" + ], + "non_empty_layers": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D4_WORKFLOW_INDEX", + "D0_DOC_CHUNKS" + ], + "layer_diagnostics": { + "D1_DOCUMENT_CATALOG": { + "hits": 6, + "top_ids": [ + "api.send_message_endpoint", + "api.control_actions_endpoint", + "api.health_endpoint", + "architecture.telegram_notify_app", + "docs/README.md" + ] + }, + "D2_FACT_INDEX": { + "hits": 8, + "top_ids": [ + "f85d982c272a2ee6baeadc433221a20e684cd8ef01cb4788d6f76d05ca56d6d0", + "b8e44c3adb74aaa6c91ae8815fa091289e58dd3990a3a1b63e850c62075aea75", + "bafb867ffed41c9db637df98d6cd5f6722d7747bbebc6c03e6f0d0caf3b7f9f3", + "54bbcbac242f1c85ec3280236ed5841998a8a3a548ff16cbf0b5acafbff469e3", + "b6bfad59b3bf00f199b5ef90c1208af19664de700413e7354468a93a4abaaa2f" + ] + }, + "D4_WORKFLOW_INDEX": { + "hits": 3, + "top_ids": [ + "api.control_actions_endpoint", + "api.health_endpoint", + "api.send_message_endpoint" + ] + }, + "D0_DOC_CHUNKS": { + "hits": 6, + "top_ids": [ + "api.control_actions_endpoint" + ] + } + }, + "query_entity_candidates": [], + "resolved_entity_candidates": [], + "query_anchor_candidates": [], + "resolved_anchor_candidates": [ + "api.send_message_endpoint", + "docs/documentation/api/send-message-endpoint.md", + "api.control_actions_endpoint", + "docs/documentation/api/control-actions-endpoint.md", + "api.health_endpoint", + "docs/documentation/api/health-endpoint.md", + "architecture.telegram_notify_app", + "docs/documentation/architecture/telegram-notify-app-overview.md", + "docs/README.md", + "domain.runtime_health", + "docs/documentation/domain/runtime-health-entity.md" + ], + "anchor_candidates": [], + "selected_anchor": null, + "anchor_selection_reason": "", + "anchor_match_type": "", + "doc_ids": [ + "api.send_message_endpoint", + "api.control_actions_endpoint", + "api.actions_endpoint", + "api.health_endpoint", + "architecture.telegram_notify_app", + "architecture.telegram_notify_app_overview", + "docs/README.md", + "domain.runtime_health" + ], + "doc_paths": [ + "docs/documentation/api/send-message-endpoint.md", + "docs/documentation/api/control-actions-endpoint.md", + "docs/documentation/api/health-endpoint.md", + "docs/documentation/architecture/telegram-notify-app-overview.md", + "docs/README.md", + "docs/documentation/domain/runtime-health-entity.md" + ], + "doc_titles": [ + "HTTP API /send", + "HTTP API /actions/{action}", + "HTTP API /health", + "Архитектура Telegram Notify App", + "Readme", + "Сущность runtime health", + "api.control_actions_endpoint:workflow_step", + "api.control_actions_endpoint:mentions_entity", + "Scenario", + "api.control_actions_endpoint:Функциональные требования", + "api.control_actions_endpoint:Нефункциональные требования", + "api.control_actions_endpoint:Сценарий", + "api.control_actions_endpoint:Summary", + "api.control_actions_endpoint:Описание", + "api.control_actions_endpoint:Входные параметры" + ], + "relation_hits_count": 0, + "relation_targets": [], + "fallback_doc_hits_count": 12, + "fallback_used": false, + "fact_hits": 2, + "entity_hits": 0, + "evidence_summary": { + "documents": 6, + "facts": 2, + "relations": 0, + "chunks": 6, + "entity_hits": 0, + "openapi_signals": { + "path_found": false, + "method_found": false, + "request_schema": false, + "response_schema": false, + "status_codes": false, + "payload_description": false + } + }, + "gate_decision": "allow", + "gate_decision_reason": "evidence_sufficient", + "gate_missing_requirements": [], + "gate_satisfied_requirements": [ + "retrieval_non_empty" + ], + "openapi_evidence": { + "path_found": false, + "method_found": false, + "request_schema": false, + "response_schema": false, + "status_codes": false, + "payload_description": false + }, + "requested_fragment_type": null, + "fragment_evidence_found": [], + "fragment_missing_requirements": [], + "answer_mode": "ready", + "degrade_reason": null, + "degraded_reason": null, + "code_intents_stubbed": false +} + +## LLM Request +- prompt_name: docs_explain_answer +- log_context: graph.project_qa.docs.answer + +### Prompt Stats +```json +{ + "system_chars": 393, + "user_chars": 14988, + "tokens_in_estimate": 3846 +} +``` + +### System Prompt +```text +Ты объясняешь документацию системы. + +На вход приходит JSON с полями: +- question +- intent +- sub_intent +- documents +- facts +- relations + +Правила: +- Используй только предоставленные факты +- Не додумывай +- Если данных недостаточно, скажи это явно +- Объясняй структурировано + +Формат ответа: +1. Краткое описание +2. Основные элементы +3. Как это работает +4. Связи с другими частями системы (если есть) +``` + +### User Prompt +```json +{ + "question": "Как работает send endpoint?", + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "API_METHOD_EXPLAIN", + "documents": [ + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/api/send-message-endpoint.md", + "title": "HTTP API /send", + "content": "Endpoint `/send` выполняет ручную отправку сообщения в Telegram через `TelegramSendService`. Он используется для операторской проверки доставки и для отправки уведомлений вне периодического worker loop. Endpoint работает поверх тех же credentials и того же delivery path, что и фоновая отправка.", + "metadata": { + "name": "send_message_endpoint", + "tags": [ + "api", + "telegram", + "manual-send" + ], + "type": "api_method", + "layer": "application", + "links": [ + { + "type": "part_of", + "target": "architecture.telegram_notify_app" + }, + { + "type": "depends_on", + "target": "logic.telegram_notification_loop" + } + ], + "owner": null, + "title": "HTTP API /send", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "architecture.telegram_notify_app", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "5fbf2e33510b0676a3a53b957a4569bd3c2c31fb7719546602c573421ccaa32d", + "children": [], + "doc_kind": "misc", + "entities": [ + "TelegramControlAppFactory", + "TelegramSendService", + "TelegramNotifyWorker" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "api.send_message_endpoint", + "source_path": "docs/documentation/api/send-message-endpoint.md", + "summary_text": "Endpoint `/send` выполняет ручную отправку сообщения в Telegram через `TelegramSendService`. Он используется для операторской проверки доставки и для отправки уведомлений вне периодического worker loop. Endpoint работает поверх тех же credentials и того же delivery path, что и фоновая отправка.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "HTTP API /actions/{action}", + "content": "Endpoint `/actions/{action}` управляет control actions runtime и поддерживает `start`, `stop` и `status`. Для долгих операций `start` и `stop` допускается ответ HTTP 202, если действие еще выполняется. Endpoint используется для operator-driven управления жизненным циклом worker'а через HTTP API.", + "metadata": { + "name": "control_actions_endpoint", + "tags": [ + "api", + "control-plane", + "lifecycle" + ], + "type": "api_method", + "layer": "application", + "links": [ + { + "type": "part_of", + "target": "architecture.telegram_notify_app" + }, + { + "type": "related_api", + "target": "api.health_endpoint" + }, + { + "type": "related_logic", + "target": "logic.telegram_notification_loop" + } + ], + "owner": null, + "title": "HTTP API /actions/{action}", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "architecture.telegram_notify_app", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "children": [], + "doc_kind": "misc", + "entities": [ + "TelegramControlChannel", + "ControlActionSet", + "JSONResponse" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "api.control_actions_endpoint", + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "summary_text": "Endpoint `/actions/{action}` управляет control actions runtime и поддерживает `start`, `stop` и `status`. Для долгих операций `start` и `stop` допускается ответ HTTP 202, если действие еще выполняется. Endpoint используется для operator-driven управления жизненным циклом worker'а через HTTP API.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/api/health-endpoint.md", + "title": "HTTP API /health", + "content": "Endpoint `/health` возвращает агрегированный health payload runtime. Если общий статус равен `ok`, API отвечает с HTTP 200; для состояний деградации или неготовности возвращается HTTP 503 с тем же payload. Endpoint служит основной точкой внешней проверки состояния приложения.", + "metadata": { + "name": "health_endpoint", + "tags": [ + "api", + "health", + "control-plane" + ], + "type": "api_method", + "layer": "application", + "links": [ + { + "type": "part_of", + "target": "architecture.telegram_notify_app" + }, + { + "type": "depends_on", + "target": "domain.runtime_health" + } + ], + "owner": null, + "title": "HTTP API /health", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "architecture.telegram_notify_app", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "8b5a533a8076e2e9d36995eee29aeade260080bdca2ec8e21fe28f08574b983f", + "children": [], + "doc_kind": "misc", + "entities": [ + "TelegramControlChannel", + "TelegramNotifyWorker", + "RuntimeManager", + "WorkerHealth" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "api.health_endpoint", + "source_path": "docs/documentation/api/health-endpoint.md", + "summary_text": "Endpoint `/health` возвращает агрегированный health payload runtime. Если общий статус равен `ok`, API отвечает с HTTP 200; для состояний деградации или неготовности возвращается HTTP 503 с тем же payload. Endpoint служит основной точкой внешней проверки состояния приложения.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/architecture/telegram-notify-app-overview.md", + "title": "Архитектура Telegram Notify App", + "content": "`test_echo_app` — сервис на базе PLBA runtime, который поднимает HTTP control plane и запускает фоновый воркер для периодической отправки уведомлений в Telegram. Приложение использует YAML-конфиг для runtime-настроек и переменные окружения для Telegram credentials. Основной контур системы состоит из runtime manager, control channel, send service и worker loop.", + "metadata": { + "name": "telegram_notify_app_overview", + "tags": [ + "architecture", + "telegram", + "plba", + "runtime" + ], + "type": "architecture_overview", + "layer": "system", + "links": [ + { + "type": "related_api", + "target": "api.health_endpoint" + }, + { + "type": "related_api", + "target": "api.control_actions_endpoint" + }, + { + "type": "related_api", + "target": "api.send_message_endpoint" + }, + { + "type": "depends_on", + "target": "logic.telegram_notification_loop" + }, + { + "type": "depends_on", + "target": "domain.runtime_health" + } + ], + "owner": null, + "title": "Архитектура Telegram Notify App", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "docs_root", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "8b1cc9f823e55bddbc825466d10a0fdb4ca4354ac02d91f9e2aef7b7d2ec8256", + "children": [ + "api.health_endpoint", + "api.control_actions_endpoint", + "api.send_message_endpoint", + "logic.telegram_notification_loop", + "domain.runtime_health" + ], + "doc_kind": "spec", + "entities": [ + "TelegramNotifyModule", + "TelegramNotifyWorker", + "TelegramControlChannel", + "TelegramSendService", + "RuntimeManager" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "architecture.telegram_notify_app", + "source_path": "docs/documentation/architecture/telegram-notify-app-overview.md", + "summary_text": "`test_echo_app` — сервис на базе PLBA runtime, который поднимает HTTP control plane и запускает фоновый воркер для периодической отправки уведомлений в Telegram. Приложение использует YAML-конфиг для runtime-настроек и переменные окружения для Telegram credentials. Основной контур системы состоит из runtime manager, control channel, send service и worker loop.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/README.md", + "title": "Readme", + "content": "Readme", + "metadata": { + "name": "", + "tags": [], + "type": "", + "layer": "", + "links": [], + "owner": null, + "title": "Readme", + "doc_id": null, + "module": "", + "parent": null, + "status": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "81d952f1a6ea85b76f75e0e57f33b8fa4b2bf3cb7db11b91b90171aeedd655a6", + "children": [], + "doc_kind": "readme", + "entities": [], + "updated_at": null, + "doc_version": null, + "document_id": "docs/README.md", + "source_path": "docs/README.md", + "summary_text": "", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/domain/runtime-health-entity.md", + "title": "Сущность runtime health", + "content": "`runtime health` — доменная модель наблюдаемости сервиса, которая описывает общее состояние runtime и состояние отдельных компонентов. Для `test_echo_app` главным объектом наблюдения является компонент `telegram_notify`, у которого важны статус, время старта и количество успешных отправок. Эта модель используется для внешнего health-monitoring и внутренней диагностики.", + "metadata": { + "name": "runtime_health", + "tags": [ + "domain", + "health", + "observability" + ], + "type": "domain_entity", + "layer": "domain", + "links": [ + { + "type": "part_of", + "target": "architecture.telegram_notify_app" + }, + { + "type": "used_by", + "target": "api.health_endpoint" + }, + { + "type": "related_logic", + "target": "logic.telegram_notification_loop" + } + ], + "owner": null, + "title": "Сущность runtime health", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "architecture.telegram_notify_app", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "37d4dcf470ea3de95d59e44786006e369a3ea11bf5dbf4c88877696e9183ee87", + "children": [], + "doc_kind": "misc", + "entities": [ + "WorkerHealth", + "WorkerStatus", + "TelegramNotifyWorker" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "domain.runtime_health", + "source_path": "docs/documentation/domain/runtime-health-entity.md", + "summary_text": "`runtime health` — доменная модель наблюдаемости сервиса, которая описывает общее состояние runtime и состояние отдельных компонентов. Для `test_echo_app` главным объектом наблюдения является компонент `telegram_notify`, у которого важны статус, время старта и количество успешных отправок. Эта модель используется для внешнего health-monitoring и внутренней диагностики.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + } + ], + "facts": [ + { + "layer": "D2_FACT_INDEX", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "api.control_actions_endpoint:workflow_step", + "content": "api.control_actions_endpoint workflow_step Название:** Выполнение control action runtime", + "metadata": { + "tags": [], + "owner": null, + "anchor": "Сценарий", + "doc_id": null, + "object": "Название:** Выполнение control action runtime", + "fact_id": "f85d982c272a2ee6baeadc433221a20e684cd8ef01cb4788d6f76d05ca56d6d0", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "predicate": "workflow_step", + "object_ref": null, + "subject_id": "api.control_actions_endpoint", + "doc_version": null, + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D2_FACT_INDEX", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "api.control_actions_endpoint:mentions_entity", + "content": "api.control_actions_endpoint mentions_entity ControlActionSet", + "metadata": { + "tags": [], + "owner": null, + "anchor": "frontmatter.entities", + "doc_id": null, + "object": "ControlActionSet", + "fact_id": "bafb867ffed41c9db637df98d6cd5f6722d7747bbebc6c03e6f0d0caf3b7f9f3", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "predicate": "mentions_entity", + "object_ref": null, + "subject_id": "api.control_actions_endpoint", + "doc_version": null, + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + } + ], + "relations": [] +} +``` + +### User Prompt Overview +- question: Как работает send endpoint? +- intent: DOCUMENTATION_EXPLAIN +- sub_intent: API_METHOD_EXPLAIN +- documents: 6 | samples: HTTP API /send, HTTP API /actions/{action}, HTTP API /health +- facts: 2 | samples: api.control_actions_endpoint:workflow_step, api.control_actions_endpoint:mentions_entity +- relations: 0 + +## Mismatches +- none \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/docs_router_deterministic/20260326_125615/full_chain_docs_intents_v3-3x_v3-api-send-3.json b/tests/pipeline_setup_v3/test_results/docs_router_deterministic/20260326_125615/full_chain_docs_intents_v3-3x_v3-api-send-3.json new file mode 100644 index 0000000..129b701 --- /dev/null +++ b/tests/pipeline_setup_v3/test_results/docs_router_deterministic/20260326_125615/full_chain_docs_intents_v3-3x_v3-api-send-3.json @@ -0,0 +1,90 @@ +{ + "meta": { + "case_id": "v3-api-send-3", + "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_03_docs/full_chain_docs_intents_v3-3x.yaml", + "runner": "agent_runtime", + "mode": "pre_llm", + "passed": true, + "mismatches": [], + "actual": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "API_METHOD_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START", + "rag_count": 17, + "llm_answer": "", + "answer_mode": "answered", + "path_scope": [], + "doc_scope": [ + "api.send_message_endpoint", + "api.control_actions_endpoint", + "api.actions_endpoint", + "api.health_endpoint", + "docs/README.md", + "architecture.telegram_notify_app", + "architecture.telegram_notify_app_overview", + "domain.runtime_health" + ], + "entity_candidates": [], + "symbol_candidates": [], + "layers": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D4_WORKFLOW_INDEX", + "D0_DOC_CHUNKS" + ], + "filters": { + "doc_type": "api_method" + }, + "pipeline_mode": "pre_llm_only", + "gate_decision": "allow", + "prompt_used": "docs_explain_answer", + "llm_mode": "prose", + "degraded_reason": null, + "code_intents_stubbed": true + } + }, + "pipeline_steps": [ + { + "step": "input_query", + "input": { + "query": "Опиши endpoint отправки сообщений" + }, + "output": { + "query": "Опиши endpoint отправки сообщений" + } + }, + { + "step": "router", + "input": { + "query": "Опиши endpoint отправки сообщений" + }, + "output": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "API_METHOD_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START" + } + }, + { + "step": "docs_pipeline", + "input": { + "query": "Опиши endpoint отправки сообщений" + }, + "output": { + "answer_mode": "ready", + "prompt_name": "docs_explain_answer", + "llm_request": { + "prompt_name": "docs_explain_answer", + "log_context": "graph.project_qa.docs.answer", + "prompt_stats": { + "system_chars": 393, + "user_chars": 14994, + "tokens_in_estimate": 3847 + } + }, + "degraded_reason": "" + } + } + ] +} \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/docs_router_deterministic/20260326_125615/full_chain_docs_intents_v3-3x_v3-api-send-3.md b/tests/pipeline_setup_v3/test_results/docs_router_deterministic/20260326_125615/full_chain_docs_intents_v3-3x_v3-api-send-3.md new file mode 100644 index 0000000..db5278d --- /dev/null +++ b/tests/pipeline_setup_v3/test_results/docs_router_deterministic/20260326_125615/full_chain_docs_intents_v3-3x_v3-api-send-3.md @@ -0,0 +1,726 @@ +# v3-api-send-3 + +- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_03_docs/full_chain_docs_intents_v3-3x.yaml +- runner: agent_runtime +- mode: pre_llm +- passed: True + +## Query +Опиши endpoint отправки сообщений + +## Actual +{ + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "API_METHOD_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START", + "rag_count": 17, + "llm_answer": "", + "answer_mode": "answered", + "path_scope": [], + "doc_scope": [ + "api.send_message_endpoint", + "api.control_actions_endpoint", + "api.actions_endpoint", + "api.health_endpoint", + "docs/README.md", + "architecture.telegram_notify_app", + "architecture.telegram_notify_app_overview", + "domain.runtime_health" + ], + "entity_candidates": [], + "symbol_candidates": [], + "layers": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D4_WORKFLOW_INDEX", + "D0_DOC_CHUNKS" + ], + "filters": { + "doc_type": "api_method" + }, + "pipeline_mode": "pre_llm_only", + "gate_decision": "allow", + "prompt_used": "docs_explain_answer", + "llm_mode": "prose", + "degraded_reason": null, + "code_intents_stubbed": true +} + +## Pipeline Steps +### input_query +```json +{ + "input": { + "query": "Опиши endpoint отправки сообщений" + }, + "output": { + "query": "Опиши endpoint отправки сообщений" + } +} +``` + +### router +```json +{ + "input": { + "query": "Опиши endpoint отправки сообщений" + }, + "output": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "API_METHOD_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START" + } +} +``` + +### docs_pipeline +```json +{ + "input": { + "query": "Опиши endpoint отправки сообщений" + }, + "output": { + "answer_mode": "ready", + "prompt_name": "docs_explain_answer", + "llm_request": { + "prompt_name": "docs_explain_answer", + "log_context": "graph.project_qa.docs.answer", + "prompt_stats": { + "system_chars": 393, + "user_chars": 14994, + "tokens_in_estimate": 3847 + } + }, + "degraded_reason": "" + } +} +``` + +## Diagnostics +{ + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "API_METHOD_EXPLAIN", + "layers_used": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D4_WORKFLOW_INDEX", + "D0_DOC_CHUNKS" + ], + "documents_found": 6, + "facts_found": 2, + "relations_found": 0, + "openapi_fields_extracted": 0, + "missing_required_fields": [], + "openapi_status": { + "has_path": false, + "has_method": false, + "has_request": false, + "has_response": false + }, + "prompt_used": "docs_explain_answer", + "llm_mode": "prose", + "output_valid": true, + "matched_intent_source": "deterministic", + "matched_anchor_type": "topic", + "matched_anchor_value": null, + "exact_anchor_match": false, + "docs_layers_requested": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D4_WORKFLOW_INDEX", + "D0_DOC_CHUNKS" + ], + "docs_layers_with_hits": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D4_WORKFLOW_INDEX", + "D0_DOC_CHUNKS" + ], + "planned_layers": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D4_WORKFLOW_INDEX", + "D0_DOC_CHUNKS" + ], + "executed_layers": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D4_WORKFLOW_INDEX", + "D0_DOC_CHUNKS" + ], + "non_empty_layers": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D4_WORKFLOW_INDEX", + "D0_DOC_CHUNKS" + ], + "layer_diagnostics": { + "D1_DOCUMENT_CATALOG": { + "hits": 6, + "top_ids": [ + "api.send_message_endpoint", + "api.control_actions_endpoint", + "api.health_endpoint", + "docs/README.md", + "architecture.telegram_notify_app" + ] + }, + "D2_FACT_INDEX": { + "hits": 8, + "top_ids": [ + "f85d982c272a2ee6baeadc433221a20e684cd8ef01cb4788d6f76d05ca56d6d0", + "b8e44c3adb74aaa6c91ae8815fa091289e58dd3990a3a1b63e850c62075aea75", + "bafb867ffed41c9db637df98d6cd5f6722d7747bbebc6c03e6f0d0caf3b7f9f3", + "54bbcbac242f1c85ec3280236ed5841998a8a3a548ff16cbf0b5acafbff469e3", + "b6bfad59b3bf00f199b5ef90c1208af19664de700413e7354468a93a4abaaa2f" + ] + }, + "D4_WORKFLOW_INDEX": { + "hits": 3, + "top_ids": [ + "api.control_actions_endpoint", + "api.health_endpoint", + "api.send_message_endpoint" + ] + }, + "D0_DOC_CHUNKS": { + "hits": 6, + "top_ids": [ + "api.control_actions_endpoint" + ] + } + }, + "query_entity_candidates": [], + "resolved_entity_candidates": [], + "query_anchor_candidates": [], + "resolved_anchor_candidates": [ + "api.send_message_endpoint", + "docs/documentation/api/send-message-endpoint.md", + "api.control_actions_endpoint", + "docs/documentation/api/control-actions-endpoint.md", + "api.health_endpoint", + "docs/documentation/api/health-endpoint.md", + "docs/README.md", + "architecture.telegram_notify_app", + "docs/documentation/architecture/telegram-notify-app-overview.md", + "domain.runtime_health", + "docs/documentation/domain/runtime-health-entity.md" + ], + "anchor_candidates": [], + "selected_anchor": null, + "anchor_selection_reason": "", + "anchor_match_type": "", + "doc_ids": [ + "api.send_message_endpoint", + "api.control_actions_endpoint", + "api.actions_endpoint", + "api.health_endpoint", + "docs/README.md", + "architecture.telegram_notify_app", + "architecture.telegram_notify_app_overview", + "domain.runtime_health" + ], + "doc_paths": [ + "docs/documentation/api/send-message-endpoint.md", + "docs/documentation/api/control-actions-endpoint.md", + "docs/documentation/api/health-endpoint.md", + "docs/README.md", + "docs/documentation/architecture/telegram-notify-app-overview.md", + "docs/documentation/domain/runtime-health-entity.md" + ], + "doc_titles": [ + "HTTP API /send", + "HTTP API /actions/{action}", + "HTTP API /health", + "Readme", + "Архитектура Telegram Notify App", + "Сущность runtime health", + "api.control_actions_endpoint:workflow_step", + "api.control_actions_endpoint:mentions_entity", + "Scenario", + "api.control_actions_endpoint:Функциональные требования", + "api.control_actions_endpoint:Нефункциональные требования", + "api.control_actions_endpoint:Сценарий", + "api.control_actions_endpoint:Summary", + "api.control_actions_endpoint:Описание", + "api.control_actions_endpoint:Входные параметры" + ], + "relation_hits_count": 0, + "relation_targets": [], + "fallback_doc_hits_count": 12, + "fallback_used": false, + "fact_hits": 2, + "entity_hits": 0, + "evidence_summary": { + "documents": 6, + "facts": 2, + "relations": 0, + "chunks": 6, + "entity_hits": 0, + "openapi_signals": { + "path_found": false, + "method_found": false, + "request_schema": false, + "response_schema": false, + "status_codes": false, + "payload_description": false + } + }, + "gate_decision": "allow", + "gate_decision_reason": "evidence_sufficient", + "gate_missing_requirements": [], + "gate_satisfied_requirements": [ + "retrieval_non_empty" + ], + "openapi_evidence": { + "path_found": false, + "method_found": false, + "request_schema": false, + "response_schema": false, + "status_codes": false, + "payload_description": false + }, + "requested_fragment_type": null, + "fragment_evidence_found": [], + "fragment_missing_requirements": [], + "answer_mode": "ready", + "degrade_reason": null, + "degraded_reason": null, + "code_intents_stubbed": false +} + +## LLM Request +- prompt_name: docs_explain_answer +- log_context: graph.project_qa.docs.answer + +### Prompt Stats +```json +{ + "system_chars": 393, + "user_chars": 14994, + "tokens_in_estimate": 3847 +} +``` + +### System Prompt +```text +Ты объясняешь документацию системы. + +На вход приходит JSON с полями: +- question +- intent +- sub_intent +- documents +- facts +- relations + +Правила: +- Используй только предоставленные факты +- Не додумывай +- Если данных недостаточно, скажи это явно +- Объясняй структурировано + +Формат ответа: +1. Краткое описание +2. Основные элементы +3. Как это работает +4. Связи с другими частями системы (если есть) +``` + +### User Prompt +```json +{ + "question": "Опиши endpoint отправки сообщений", + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "API_METHOD_EXPLAIN", + "documents": [ + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/api/send-message-endpoint.md", + "title": "HTTP API /send", + "content": "Endpoint `/send` выполняет ручную отправку сообщения в Telegram через `TelegramSendService`. Он используется для операторской проверки доставки и для отправки уведомлений вне периодического worker loop. Endpoint работает поверх тех же credentials и того же delivery path, что и фоновая отправка.", + "metadata": { + "name": "send_message_endpoint", + "tags": [ + "api", + "telegram", + "manual-send" + ], + "type": "api_method", + "layer": "application", + "links": [ + { + "type": "part_of", + "target": "architecture.telegram_notify_app" + }, + { + "type": "depends_on", + "target": "logic.telegram_notification_loop" + } + ], + "owner": null, + "title": "HTTP API /send", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "architecture.telegram_notify_app", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "5fbf2e33510b0676a3a53b957a4569bd3c2c31fb7719546602c573421ccaa32d", + "children": [], + "doc_kind": "misc", + "entities": [ + "TelegramControlAppFactory", + "TelegramSendService", + "TelegramNotifyWorker" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "api.send_message_endpoint", + "source_path": "docs/documentation/api/send-message-endpoint.md", + "summary_text": "Endpoint `/send` выполняет ручную отправку сообщения в Telegram через `TelegramSendService`. Он используется для операторской проверки доставки и для отправки уведомлений вне периодического worker loop. Endpoint работает поверх тех же credentials и того же delivery path, что и фоновая отправка.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "HTTP API /actions/{action}", + "content": "Endpoint `/actions/{action}` управляет control actions runtime и поддерживает `start`, `stop` и `status`. Для долгих операций `start` и `stop` допускается ответ HTTP 202, если действие еще выполняется. Endpoint используется для operator-driven управления жизненным циклом worker'а через HTTP API.", + "metadata": { + "name": "control_actions_endpoint", + "tags": [ + "api", + "control-plane", + "lifecycle" + ], + "type": "api_method", + "layer": "application", + "links": [ + { + "type": "part_of", + "target": "architecture.telegram_notify_app" + }, + { + "type": "related_api", + "target": "api.health_endpoint" + }, + { + "type": "related_logic", + "target": "logic.telegram_notification_loop" + } + ], + "owner": null, + "title": "HTTP API /actions/{action}", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "architecture.telegram_notify_app", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "children": [], + "doc_kind": "misc", + "entities": [ + "TelegramControlChannel", + "ControlActionSet", + "JSONResponse" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "api.control_actions_endpoint", + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "summary_text": "Endpoint `/actions/{action}` управляет control actions runtime и поддерживает `start`, `stop` и `status`. Для долгих операций `start` и `stop` допускается ответ HTTP 202, если действие еще выполняется. Endpoint используется для operator-driven управления жизненным циклом worker'а через HTTP API.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/api/health-endpoint.md", + "title": "HTTP API /health", + "content": "Endpoint `/health` возвращает агрегированный health payload runtime. Если общий статус равен `ok`, API отвечает с HTTP 200; для состояний деградации или неготовности возвращается HTTP 503 с тем же payload. Endpoint служит основной точкой внешней проверки состояния приложения.", + "metadata": { + "name": "health_endpoint", + "tags": [ + "api", + "health", + "control-plane" + ], + "type": "api_method", + "layer": "application", + "links": [ + { + "type": "part_of", + "target": "architecture.telegram_notify_app" + }, + { + "type": "depends_on", + "target": "domain.runtime_health" + } + ], + "owner": null, + "title": "HTTP API /health", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "architecture.telegram_notify_app", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "8b5a533a8076e2e9d36995eee29aeade260080bdca2ec8e21fe28f08574b983f", + "children": [], + "doc_kind": "misc", + "entities": [ + "TelegramControlChannel", + "TelegramNotifyWorker", + "RuntimeManager", + "WorkerHealth" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "api.health_endpoint", + "source_path": "docs/documentation/api/health-endpoint.md", + "summary_text": "Endpoint `/health` возвращает агрегированный health payload runtime. Если общий статус равен `ok`, API отвечает с HTTP 200; для состояний деградации или неготовности возвращается HTTP 503 с тем же payload. Endpoint служит основной точкой внешней проверки состояния приложения.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/README.md", + "title": "Readme", + "content": "Readme", + "metadata": { + "name": "", + "tags": [], + "type": "", + "layer": "", + "links": [], + "owner": null, + "title": "Readme", + "doc_id": null, + "module": "", + "parent": null, + "status": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "81d952f1a6ea85b76f75e0e57f33b8fa4b2bf3cb7db11b91b90171aeedd655a6", + "children": [], + "doc_kind": "readme", + "entities": [], + "updated_at": null, + "doc_version": null, + "document_id": "docs/README.md", + "source_path": "docs/README.md", + "summary_text": "", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/architecture/telegram-notify-app-overview.md", + "title": "Архитектура Telegram Notify App", + "content": "`test_echo_app` — сервис на базе PLBA runtime, который поднимает HTTP control plane и запускает фоновый воркер для периодической отправки уведомлений в Telegram. Приложение использует YAML-конфиг для runtime-настроек и переменные окружения для Telegram credentials. Основной контур системы состоит из runtime manager, control channel, send service и worker loop.", + "metadata": { + "name": "telegram_notify_app_overview", + "tags": [ + "architecture", + "telegram", + "plba", + "runtime" + ], + "type": "architecture_overview", + "layer": "system", + "links": [ + { + "type": "related_api", + "target": "api.health_endpoint" + }, + { + "type": "related_api", + "target": "api.control_actions_endpoint" + }, + { + "type": "related_api", + "target": "api.send_message_endpoint" + }, + { + "type": "depends_on", + "target": "logic.telegram_notification_loop" + }, + { + "type": "depends_on", + "target": "domain.runtime_health" + } + ], + "owner": null, + "title": "Архитектура Telegram Notify App", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "docs_root", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "8b1cc9f823e55bddbc825466d10a0fdb4ca4354ac02d91f9e2aef7b7d2ec8256", + "children": [ + "api.health_endpoint", + "api.control_actions_endpoint", + "api.send_message_endpoint", + "logic.telegram_notification_loop", + "domain.runtime_health" + ], + "doc_kind": "spec", + "entities": [ + "TelegramNotifyModule", + "TelegramNotifyWorker", + "TelegramControlChannel", + "TelegramSendService", + "RuntimeManager" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "architecture.telegram_notify_app", + "source_path": "docs/documentation/architecture/telegram-notify-app-overview.md", + "summary_text": "`test_echo_app` — сервис на базе PLBA runtime, который поднимает HTTP control plane и запускает фоновый воркер для периодической отправки уведомлений в Telegram. Приложение использует YAML-конфиг для runtime-настроек и переменные окружения для Telegram credentials. Основной контур системы состоит из runtime manager, control channel, send service и worker loop.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/domain/runtime-health-entity.md", + "title": "Сущность runtime health", + "content": "`runtime health` — доменная модель наблюдаемости сервиса, которая описывает общее состояние runtime и состояние отдельных компонентов. Для `test_echo_app` главным объектом наблюдения является компонент `telegram_notify`, у которого важны статус, время старта и количество успешных отправок. Эта модель используется для внешнего health-monitoring и внутренней диагностики.", + "metadata": { + "name": "runtime_health", + "tags": [ + "domain", + "health", + "observability" + ], + "type": "domain_entity", + "layer": "domain", + "links": [ + { + "type": "part_of", + "target": "architecture.telegram_notify_app" + }, + { + "type": "used_by", + "target": "api.health_endpoint" + }, + { + "type": "related_logic", + "target": "logic.telegram_notification_loop" + } + ], + "owner": null, + "title": "Сущность runtime health", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "architecture.telegram_notify_app", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "37d4dcf470ea3de95d59e44786006e369a3ea11bf5dbf4c88877696e9183ee87", + "children": [], + "doc_kind": "misc", + "entities": [ + "WorkerHealth", + "WorkerStatus", + "TelegramNotifyWorker" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "domain.runtime_health", + "source_path": "docs/documentation/domain/runtime-health-entity.md", + "summary_text": "`runtime health` — доменная модель наблюдаемости сервиса, которая описывает общее состояние runtime и состояние отдельных компонентов. Для `test_echo_app` главным объектом наблюдения является компонент `telegram_notify`, у которого важны статус, время старта и количество успешных отправок. Эта модель используется для внешнего health-monitoring и внутренней диагностики.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + } + ], + "facts": [ + { + "layer": "D2_FACT_INDEX", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "api.control_actions_endpoint:workflow_step", + "content": "api.control_actions_endpoint workflow_step Название:** Выполнение control action runtime", + "metadata": { + "tags": [], + "owner": null, + "anchor": "Сценарий", + "doc_id": null, + "object": "Название:** Выполнение control action runtime", + "fact_id": "f85d982c272a2ee6baeadc433221a20e684cd8ef01cb4788d6f76d05ca56d6d0", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "predicate": "workflow_step", + "object_ref": null, + "subject_id": "api.control_actions_endpoint", + "doc_version": null, + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D2_FACT_INDEX", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "api.control_actions_endpoint:mentions_entity", + "content": "api.control_actions_endpoint mentions_entity ControlActionSet", + "metadata": { + "tags": [], + "owner": null, + "anchor": "frontmatter.entities", + "doc_id": null, + "object": "ControlActionSet", + "fact_id": "bafb867ffed41c9db637df98d6cd5f6722d7747bbebc6c03e6f0d0caf3b7f9f3", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "predicate": "mentions_entity", + "object_ref": null, + "subject_id": "api.control_actions_endpoint", + "doc_version": null, + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + } + ], + "relations": [] +} +``` + +### User Prompt Overview +- question: Опиши endpoint отправки сообщений +- intent: DOCUMENTATION_EXPLAIN +- sub_intent: API_METHOD_EXPLAIN +- documents: 6 | samples: HTTP API /send, HTTP API /actions/{action}, HTTP API /health +- facts: 2 | samples: api.control_actions_endpoint:workflow_step, api.control_actions_endpoint:mentions_entity +- relations: 0 + +## Mismatches +- none \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/docs_router_deterministic/20260326_125615/full_chain_docs_intents_v3-3x_v3-component-control-channel-1.json b/tests/pipeline_setup_v3/test_results/docs_router_deterministic/20260326_125615/full_chain_docs_intents_v3-3x_v3-component-control-channel-1.json new file mode 100644 index 0000000..1f90f92 --- /dev/null +++ b/tests/pipeline_setup_v3/test_results/docs_router_deterministic/20260326_125615/full_chain_docs_intents_v3-3x_v3-component-control-channel-1.json @@ -0,0 +1,92 @@ +{ + "meta": { + "case_id": "v3-component-control-channel-1", + "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_03_docs/full_chain_docs_intents_v3-3x.yaml", + "runner": "agent_runtime", + "mode": "pre_llm", + "passed": true, + "mismatches": [], + "actual": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "COMPONENT_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START", + "rag_count": 20, + "llm_answer": "", + "answer_mode": "answered", + "path_scope": [], + "doc_scope": [ + "api.control_actions_endpoint", + "api.actions_endpoint", + "architecture.telegram_notify_app", + "architecture.telegram_notify_app_overview", + "docs/README.md", + "domain.runtime_health", + "logic.telegram_notification_loop", + "api.send_message_endpoint" + ], + "entity_candidates": [ + "TelegramControlChannel" + ], + "symbol_candidates": [], + "layers": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "filters": { + "doc_type": null + }, + "pipeline_mode": "pre_llm_only", + "gate_decision": "allow", + "prompt_used": "docs_explain_answer", + "llm_mode": "prose", + "degraded_reason": null, + "code_intents_stubbed": true + } + }, + "pipeline_steps": [ + { + "step": "input_query", + "input": { + "query": "Как работает TelegramControlChannel?" + }, + "output": { + "query": "Как работает TelegramControlChannel?" + } + }, + { + "step": "router", + "input": { + "query": "Как работает TelegramControlChannel?" + }, + "output": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "COMPONENT_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START" + } + }, + { + "step": "docs_pipeline", + "input": { + "query": "Как работает TelegramControlChannel?" + }, + "output": { + "answer_mode": "ready", + "prompt_name": "docs_explain_answer", + "llm_request": { + "prompt_name": "docs_explain_answer", + "log_context": "graph.project_qa.docs.answer", + "prompt_stats": { + "system_chars": 393, + "user_chars": 21500, + "tokens_in_estimate": 5474 + } + }, + "degraded_reason": "" + } + } + ] +} \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/docs_router_deterministic/20260326_125615/full_chain_docs_intents_v3-3x_v3-component-control-channel-1.md b/tests/pipeline_setup_v3/test_results/docs_router_deterministic/20260326_125615/full_chain_docs_intents_v3-3x_v3-component-control-channel-1.md new file mode 100644 index 0000000..e54bf62 --- /dev/null +++ b/tests/pipeline_setup_v3/test_results/docs_router_deterministic/20260326_125615/full_chain_docs_intents_v3-3x_v3-component-control-channel-1.md @@ -0,0 +1,900 @@ +# v3-component-control-channel-1 + +- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_03_docs/full_chain_docs_intents_v3-3x.yaml +- runner: agent_runtime +- mode: pre_llm +- passed: True + +## Query +Как работает TelegramControlChannel? + +## Actual +{ + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "COMPONENT_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START", + "rag_count": 20, + "llm_answer": "", + "answer_mode": "answered", + "path_scope": [], + "doc_scope": [ + "api.control_actions_endpoint", + "api.actions_endpoint", + "architecture.telegram_notify_app", + "architecture.telegram_notify_app_overview", + "docs/README.md", + "domain.runtime_health", + "logic.telegram_notification_loop", + "api.send_message_endpoint" + ], + "entity_candidates": [ + "TelegramControlChannel" + ], + "symbol_candidates": [], + "layers": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "filters": { + "doc_type": null + }, + "pipeline_mode": "pre_llm_only", + "gate_decision": "allow", + "prompt_used": "docs_explain_answer", + "llm_mode": "prose", + "degraded_reason": null, + "code_intents_stubbed": true +} + +## Pipeline Steps +### input_query +```json +{ + "input": { + "query": "Как работает TelegramControlChannel?" + }, + "output": { + "query": "Как работает TelegramControlChannel?" + } +} +``` + +### router +```json +{ + "input": { + "query": "Как работает TelegramControlChannel?" + }, + "output": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "COMPONENT_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START" + } +} +``` + +### docs_pipeline +```json +{ + "input": { + "query": "Как работает TelegramControlChannel?" + }, + "output": { + "answer_mode": "ready", + "prompt_name": "docs_explain_answer", + "llm_request": { + "prompt_name": "docs_explain_answer", + "log_context": "graph.project_qa.docs.answer", + "prompt_stats": { + "system_chars": 393, + "user_chars": 21500, + "tokens_in_estimate": 5474 + } + }, + "degraded_reason": "" + } +} +``` + +## Diagnostics +{ + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "COMPONENT_EXPLAIN", + "layers_used": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "documents_found": 6, + "facts_found": 2, + "relations_found": 6, + "openapi_fields_extracted": 0, + "missing_required_fields": [], + "openapi_status": { + "has_path": false, + "has_method": false, + "has_request": false, + "has_response": false + }, + "prompt_used": "docs_explain_answer", + "llm_mode": "prose", + "output_valid": true, + "matched_intent_source": "deterministic", + "matched_anchor_type": "none", + "matched_anchor_value": null, + "exact_anchor_match": false, + "docs_layers_requested": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "docs_layers_with_hits": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "planned_layers": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "executed_layers": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "non_empty_layers": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "layer_diagnostics": { + "D1_DOCUMENT_CATALOG": { + "hits": 6, + "top_ids": [ + "api.control_actions_endpoint", + "architecture.telegram_notify_app", + "docs/README.md", + "domain.runtime_health", + "logic.telegram_notification_loop" + ] + }, + "D2_FACT_INDEX": { + "hits": 8, + "top_ids": [ + "b480201013a7e5231146f665773ebc54af37c28135f407c6b758304c74561645", + "b8e44c3adb74aaa6c91ae8815fa091289e58dd3990a3a1b63e850c62075aea75", + "bafb867ffed41c9db637df98d6cd5f6722d7747bbebc6c03e6f0d0caf3b7f9f3", + "54bbcbac242f1c85ec3280236ed5841998a8a3a548ff16cbf0b5acafbff469e3", + "b6bfad59b3bf00f199b5ef90c1208af19664de700413e7354468a93a4abaaa2f" + ] + }, + "D5_RELATION_GRAPH": { + "hits": 6, + "top_ids": [ + "afec31fd062e392dcd9699a92c7ab61fd4b1273c1a2b16702b23d55d8d0c47ac", + "711fb2edb82dd222deaba3c91768b18cbbd453009235823282813c6e867dc2c1", + "eec79f7a02b804337e791ef231784862ae26e0599eb20224790e9d4f085fa9c0", + "5f4909bde905cd3d294ad307074a05e4ae4deefcafe6272cd2d0436e73acb8dd", + "ae34fe4b3cd2b47632b13b1e32303e842b57948aa21160abe8d9b478995e1d74" + ] + }, + "D0_DOC_CHUNKS": { + "hits": 6, + "top_ids": [ + "api.control_actions_endpoint" + ] + } + }, + "query_entity_candidates": [ + "TelegramControlChannel" + ], + "resolved_entity_candidates": [], + "query_anchor_candidates": [ + "TelegramControlChannel" + ], + "resolved_anchor_candidates": [ + "api.control_actions_endpoint", + "docs/documentation/api/control-actions-endpoint.md", + "architecture.telegram_notify_app", + "docs/documentation/architecture/telegram-notify-app-overview.md", + "docs/README.md", + "domain.runtime_health", + "docs/documentation/domain/runtime-health-entity.md", + "logic.telegram_notification_loop", + "docs/documentation/logic/telegram-notification-loop.md", + "api.send_message_endpoint", + "docs/documentation/api/send-message-endpoint.md" + ], + "anchor_candidates": [], + "selected_anchor": null, + "anchor_selection_reason": "", + "anchor_match_type": "", + "doc_ids": [ + "api.control_actions_endpoint", + "api.actions_endpoint", + "architecture.telegram_notify_app", + "architecture.telegram_notify_app_overview", + "docs/README.md", + "domain.runtime_health", + "logic.telegram_notification_loop", + "api.send_message_endpoint" + ], + "doc_paths": [ + "docs/documentation/api/control-actions-endpoint.md", + "docs/documentation/architecture/telegram-notify-app-overview.md", + "docs/README.md", + "docs/documentation/domain/runtime-health-entity.md", + "docs/documentation/logic/telegram-notification-loop.md", + "docs/documentation/api/send-message-endpoint.md" + ], + "doc_titles": [ + "HTTP API /actions/{action}", + "Архитектура Telegram Notify App", + "Readme", + "Сущность runtime health", + "Цикл отправки уведомлений в Telegram", + "HTTP API /send", + "api.control_actions_endpoint:workflow_step", + "api.control_actions_endpoint:mentions_entity", + "api.control_actions_endpoint:parent", + "api.control_actions_endpoint:related_api", + "api.control_actions_endpoint:related_logic", + "api.control_actions_endpoint:part_of", + "architecture.telegram_notify_app:child", + "architecture.telegram_notify_app:related_api", + "api.control_actions_endpoint:Функциональные требования", + "api.control_actions_endpoint:Нефункциональные требования", + "api.control_actions_endpoint:Сценарий", + "api.control_actions_endpoint:Summary", + "api.control_actions_endpoint:Описание", + "api.control_actions_endpoint:Входные параметры" + ], + "relation_hits_count": 6, + "relation_targets": [ + "api.control_actions_endpoint:parent", + "api.control_actions_endpoint:related_api", + "api.control_actions_endpoint:related_logic", + "api.control_actions_endpoint:part_of", + "architecture.telegram_notify_app:child", + "architecture.telegram_notify_app:related_api" + ], + "fallback_doc_hits_count": 12, + "fallback_used": false, + "fact_hits": 2, + "entity_hits": 0, + "evidence_summary": { + "documents": 6, + "facts": 2, + "relations": 6, + "chunks": 6, + "entity_hits": 0, + "openapi_signals": { + "path_found": false, + "method_found": false, + "request_schema": false, + "response_schema": false, + "status_codes": false, + "payload_description": false + } + }, + "gate_decision": "allow", + "gate_decision_reason": "evidence_sufficient", + "gate_missing_requirements": [], + "gate_satisfied_requirements": [ + "retrieval_non_empty" + ], + "openapi_evidence": { + "path_found": false, + "method_found": false, + "request_schema": false, + "response_schema": false, + "status_codes": false, + "payload_description": false + }, + "requested_fragment_type": null, + "fragment_evidence_found": [], + "fragment_missing_requirements": [], + "answer_mode": "ready", + "degrade_reason": null, + "degraded_reason": null, + "code_intents_stubbed": false +} + +## LLM Request +- prompt_name: docs_explain_answer +- log_context: graph.project_qa.docs.answer + +### Prompt Stats +```json +{ + "system_chars": 393, + "user_chars": 21500, + "tokens_in_estimate": 5474 +} +``` + +### System Prompt +```text +Ты объясняешь документацию системы. + +На вход приходит JSON с полями: +- question +- intent +- sub_intent +- documents +- facts +- relations + +Правила: +- Используй только предоставленные факты +- Не додумывай +- Если данных недостаточно, скажи это явно +- Объясняй структурировано + +Формат ответа: +1. Краткое описание +2. Основные элементы +3. Как это работает +4. Связи с другими частями системы (если есть) +``` + +### User Prompt +```json +{ + "question": "Как работает TelegramControlChannel?", + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "COMPONENT_EXPLAIN", + "documents": [ + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "HTTP API /actions/{action}", + "content": "Endpoint `/actions/{action}` управляет control actions runtime и поддерживает `start`, `stop` и `status`. Для долгих операций `start` и `stop` допускается ответ HTTP 202, если действие еще выполняется. Endpoint используется для operator-driven управления жизненным циклом worker'а через HTTP API.", + "metadata": { + "name": "control_actions_endpoint", + "tags": [ + "api", + "control-plane", + "lifecycle" + ], + "type": "api_method", + "layer": "application", + "links": [ + { + "type": "part_of", + "target": "architecture.telegram_notify_app" + }, + { + "type": "related_api", + "target": "api.health_endpoint" + }, + { + "type": "related_logic", + "target": "logic.telegram_notification_loop" + } + ], + "owner": null, + "title": "HTTP API /actions/{action}", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "architecture.telegram_notify_app", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "children": [], + "doc_kind": "misc", + "entities": [ + "TelegramControlChannel", + "ControlActionSet", + "JSONResponse" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "api.control_actions_endpoint", + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "summary_text": "Endpoint `/actions/{action}` управляет control actions runtime и поддерживает `start`, `stop` и `status`. Для долгих операций `start` и `stop` допускается ответ HTTP 202, если действие еще выполняется. Endpoint используется для operator-driven управления жизненным циклом worker'а через HTTP API.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/architecture/telegram-notify-app-overview.md", + "title": "Архитектура Telegram Notify App", + "content": "`test_echo_app` — сервис на базе PLBA runtime, который поднимает HTTP control plane и запускает фоновый воркер для периодической отправки уведомлений в Telegram. Приложение использует YAML-конфиг для runtime-настроек и переменные окружения для Telegram credentials. Основной контур системы состоит из runtime manager, control channel, send service и worker loop.", + "metadata": { + "name": "telegram_notify_app_overview", + "tags": [ + "architecture", + "telegram", + "plba", + "runtime" + ], + "type": "architecture_overview", + "layer": "system", + "links": [ + { + "type": "related_api", + "target": "api.health_endpoint" + }, + { + "type": "related_api", + "target": "api.control_actions_endpoint" + }, + { + "type": "related_api", + "target": "api.send_message_endpoint" + }, + { + "type": "depends_on", + "target": "logic.telegram_notification_loop" + }, + { + "type": "depends_on", + "target": "domain.runtime_health" + } + ], + "owner": null, + "title": "Архитектура Telegram Notify App", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "docs_root", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "8b1cc9f823e55bddbc825466d10a0fdb4ca4354ac02d91f9e2aef7b7d2ec8256", + "children": [ + "api.health_endpoint", + "api.control_actions_endpoint", + "api.send_message_endpoint", + "logic.telegram_notification_loop", + "domain.runtime_health" + ], + "doc_kind": "spec", + "entities": [ + "TelegramNotifyModule", + "TelegramNotifyWorker", + "TelegramControlChannel", + "TelegramSendService", + "RuntimeManager" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "architecture.telegram_notify_app", + "source_path": "docs/documentation/architecture/telegram-notify-app-overview.md", + "summary_text": "`test_echo_app` — сервис на базе PLBA runtime, который поднимает HTTP control plane и запускает фоновый воркер для периодической отправки уведомлений в Telegram. Приложение использует YAML-конфиг для runtime-настроек и переменные окружения для Telegram credentials. Основной контур системы состоит из runtime manager, control channel, send service и worker loop.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/README.md", + "title": "Readme", + "content": "Readme", + "metadata": { + "name": "", + "tags": [], + "type": "", + "layer": "", + "links": [], + "owner": null, + "title": "Readme", + "doc_id": null, + "module": "", + "parent": null, + "status": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "81d952f1a6ea85b76f75e0e57f33b8fa4b2bf3cb7db11b91b90171aeedd655a6", + "children": [], + "doc_kind": "readme", + "entities": [], + "updated_at": null, + "doc_version": null, + "document_id": "docs/README.md", + "source_path": "docs/README.md", + "summary_text": "", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/domain/runtime-health-entity.md", + "title": "Сущность runtime health", + "content": "`runtime health` — доменная модель наблюдаемости сервиса, которая описывает общее состояние runtime и состояние отдельных компонентов. Для `test_echo_app` главным объектом наблюдения является компонент `telegram_notify`, у которого важны статус, время старта и количество успешных отправок. Эта модель используется для внешнего health-monitoring и внутренней диагностики.", + "metadata": { + "name": "runtime_health", + "tags": [ + "domain", + "health", + "observability" + ], + "type": "domain_entity", + "layer": "domain", + "links": [ + { + "type": "part_of", + "target": "architecture.telegram_notify_app" + }, + { + "type": "used_by", + "target": "api.health_endpoint" + }, + { + "type": "related_logic", + "target": "logic.telegram_notification_loop" + } + ], + "owner": null, + "title": "Сущность runtime health", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "architecture.telegram_notify_app", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "37d4dcf470ea3de95d59e44786006e369a3ea11bf5dbf4c88877696e9183ee87", + "children": [], + "doc_kind": "misc", + "entities": [ + "WorkerHealth", + "WorkerStatus", + "TelegramNotifyWorker" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "domain.runtime_health", + "source_path": "docs/documentation/domain/runtime-health-entity.md", + "summary_text": "`runtime health` — доменная модель наблюдаемости сервиса, которая описывает общее состояние runtime и состояние отдельных компонентов. Для `test_echo_app` главным объектом наблюдения является компонент `telegram_notify`, у которого важны статус, время старта и количество успешных отправок. Эта модель используется для внешнего health-monitoring и внутренней диагностики.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/logic/telegram-notification-loop.md", + "title": "Цикл отправки уведомлений в Telegram", + "content": "`TelegramNotifyWorker` после старта runtime запускает отдельный поток, сразу делает первую попытку отправки сообщения и затем повторяет отправку через заданный интервал. При ошибках доставки или отсутствии credentials worker не останавливает сервис, а переводит собственное состояние в `degraded`. Этот workflow определяет основной полезный цикл приложения.", + "metadata": { + "name": "telegram_notification_loop", + "tags": [ + "logic", + "telegram", + "worker", + "scheduling" + ], + "type": "logic_block", + "layer": "application", + "links": [ + { + "type": "part_of", + "target": "architecture.telegram_notify_app" + }, + { + "type": "related_api", + "target": "api.send_message_endpoint" + }, + { + "type": "related_api", + "target": "api.control_actions_endpoint" + }, + { + "type": "related_api", + "target": "api.health_endpoint" + } + ], + "owner": null, + "title": "Цикл отправки уведомлений в Telegram", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "architecture.telegram_notify_app", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "0f62f9b4dab261ca4ca34575ff5d84411a22c90b780c52eda388782b94f08470", + "children": [], + "doc_kind": "misc", + "entities": [ + "TelegramNotifyWorker", + "TelegramSendService", + "WorkerHealth", + "WorkerStatus" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "logic.telegram_notification_loop", + "source_path": "docs/documentation/logic/telegram-notification-loop.md", + "summary_text": "`TelegramNotifyWorker` после старта runtime запускает отдельный поток, сразу делает первую попытку отправки сообщения и затем повторяет отправку через заданный интервал. При ошибках доставки или отсутствии credentials worker не останавливает сервис, а переводит собственное состояние в `degraded`. Этот workflow определяет основной полезный цикл приложения.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/api/send-message-endpoint.md", + "title": "HTTP API /send", + "content": "Endpoint `/send` выполняет ручную отправку сообщения в Telegram через `TelegramSendService`. Он используется для операторской проверки доставки и для отправки уведомлений вне периодического worker loop. Endpoint работает поверх тех же credentials и того же delivery path, что и фоновая отправка.", + "metadata": { + "name": "send_message_endpoint", + "tags": [ + "api", + "telegram", + "manual-send" + ], + "type": "api_method", + "layer": "application", + "links": [ + { + "type": "part_of", + "target": "architecture.telegram_notify_app" + }, + { + "type": "depends_on", + "target": "logic.telegram_notification_loop" + } + ], + "owner": null, + "title": "HTTP API /send", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "architecture.telegram_notify_app", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "5fbf2e33510b0676a3a53b957a4569bd3c2c31fb7719546602c573421ccaa32d", + "children": [], + "doc_kind": "misc", + "entities": [ + "TelegramControlAppFactory", + "TelegramSendService", + "TelegramNotifyWorker" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "api.send_message_endpoint", + "source_path": "docs/documentation/api/send-message-endpoint.md", + "summary_text": "Endpoint `/send` выполняет ручную отправку сообщения в Telegram через `TelegramSendService`. Он используется для операторской проверки доставки и для отправки уведомлений вне периодического worker loop. Endpoint работает поверх тех же credentials и того же delivery path, что и фоновая отправка.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + } + ], + "facts": [ + { + "layer": "D2_FACT_INDEX", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "api.control_actions_endpoint:workflow_step", + "content": "api.control_actions_endpoint workflow_step HTTP control plane запущен.", + "metadata": { + "tags": [], + "owner": null, + "anchor": "Сценарий", + "doc_id": null, + "object": "HTTP control plane запущен.", + "fact_id": "b480201013a7e5231146f665773ebc54af37c28135f407c6b758304c74561645", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "predicate": "workflow_step", + "object_ref": null, + "subject_id": "api.control_actions_endpoint", + "doc_version": null, + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D2_FACT_INDEX", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "api.control_actions_endpoint:mentions_entity", + "content": "api.control_actions_endpoint mentions_entity ControlActionSet", + "metadata": { + "tags": [], + "owner": null, + "anchor": "frontmatter.entities", + "doc_id": null, + "object": "ControlActionSet", + "fact_id": "bafb867ffed41c9db637df98d6cd5f6722d7747bbebc6c03e6f0d0caf3b7f9f3", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "predicate": "mentions_entity", + "object_ref": null, + "subject_id": "api.control_actions_endpoint", + "doc_version": null, + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + } + ], + "relations": [ + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "api.control_actions_endpoint:parent", + "content": "api.control_actions_endpoint parent architecture.telegram_notify_app", + "metadata": { + "owner": null, + "anchor": "frontmatter.parent", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "source_id": "api.control_actions_endpoint", + "target_id": "architecture.telegram_notify_app", + "doc_version": null, + "relation_id": "afec31fd062e392dcd9699a92c7ab61fd4b1273c1a2b16702b23d55d8d0c47ac", + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "parent", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "api.control_actions_endpoint:related_api", + "content": "api.control_actions_endpoint related_api api.health_endpoint", + "metadata": { + "owner": null, + "anchor": "frontmatter.links", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "source_id": "api.control_actions_endpoint", + "target_id": "api.health_endpoint", + "doc_version": null, + "relation_id": "711fb2edb82dd222deaba3c91768b18cbbd453009235823282813c6e867dc2c1", + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "related_api", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "api.control_actions_endpoint:related_logic", + "content": "api.control_actions_endpoint related_logic logic.telegram_notification_loop", + "metadata": { + "owner": null, + "anchor": "frontmatter.links", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "source_id": "api.control_actions_endpoint", + "target_id": "logic.telegram_notification_loop", + "doc_version": null, + "relation_id": "eec79f7a02b804337e791ef231784862ae26e0599eb20224790e9d4f085fa9c0", + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "related_logic", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "api.control_actions_endpoint:part_of", + "content": "api.control_actions_endpoint part_of architecture.telegram_notify_app", + "metadata": { + "owner": null, + "anchor": "frontmatter.links", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "source_id": "api.control_actions_endpoint", + "target_id": "architecture.telegram_notify_app", + "doc_version": null, + "relation_id": "5f4909bde905cd3d294ad307074a05e4ae4deefcafe6272cd2d0436e73acb8dd", + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "part_of", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/architecture/telegram-notify-app-overview.md", + "title": "architecture.telegram_notify_app:child", + "content": "architecture.telegram_notify_app child api.control_actions_endpoint", + "metadata": { + "owner": null, + "anchor": "frontmatter.children", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "8b1cc9f823e55bddbc825466d10a0fdb4ca4354ac02d91f9e2aef7b7d2ec8256", + "source_id": "architecture.telegram_notify_app", + "target_id": "api.control_actions_endpoint", + "doc_version": null, + "relation_id": "ae34fe4b3cd2b47632b13b1e32303e842b57948aa21160abe8d9b478995e1d74", + "source_path": "docs/documentation/architecture/telegram-notify-app-overview.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "child", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/architecture/telegram-notify-app-overview.md", + "title": "architecture.telegram_notify_app:related_api", + "content": "architecture.telegram_notify_app related_api api.control_actions_endpoint", + "metadata": { + "owner": null, + "anchor": "frontmatter.links", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "8b1cc9f823e55bddbc825466d10a0fdb4ca4354ac02d91f9e2aef7b7d2ec8256", + "source_id": "architecture.telegram_notify_app", + "target_id": "api.control_actions_endpoint", + "doc_version": null, + "relation_id": "02530527e6e1d1e23316c9d25d0b30658d6c70063eb6e1d732d55c5ba29c9795", + "source_path": "docs/documentation/architecture/telegram-notify-app-overview.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "related_api", + "staleness_score": null, + "system_component": null + } + } + ] +} +``` + +### User Prompt Overview +- question: Как работает TelegramControlChannel? +- intent: DOCUMENTATION_EXPLAIN +- sub_intent: COMPONENT_EXPLAIN +- documents: 6 | samples: HTTP API /actions/{action}, Архитектура Telegram Notify App, Readme +- facts: 2 | samples: api.control_actions_endpoint:workflow_step, api.control_actions_endpoint:mentions_entity +- relations: 6 | samples: api.control_actions_endpoint:parent, api.control_actions_endpoint:related_api, api.control_actions_endpoint:related_logic + +## Mismatches +- none \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/docs_router_deterministic/20260326_125615/full_chain_docs_intents_v3-3x_v3-component-control-channel-2.json b/tests/pipeline_setup_v3/test_results/docs_router_deterministic/20260326_125615/full_chain_docs_intents_v3-3x_v3-component-control-channel-2.json new file mode 100644 index 0000000..ed2c7ad --- /dev/null +++ b/tests/pipeline_setup_v3/test_results/docs_router_deterministic/20260326_125615/full_chain_docs_intents_v3-3x_v3-component-control-channel-2.json @@ -0,0 +1,92 @@ +{ + "meta": { + "case_id": "v3-component-control-channel-2", + "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_03_docs/full_chain_docs_intents_v3-3x.yaml", + "runner": "agent_runtime", + "mode": "pre_llm", + "passed": true, + "mismatches": [], + "actual": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "COMPONENT_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START", + "rag_count": 20, + "llm_answer": "", + "answer_mode": "answered", + "path_scope": [], + "doc_scope": [ + "api.control_actions_endpoint", + "api.actions_endpoint", + "architecture.telegram_notify_app", + "architecture.telegram_notify_app_overview", + "docs/README.md", + "domain.runtime_health", + "logic.telegram_notification_loop", + "api.send_message_endpoint" + ], + "entity_candidates": [ + "TelegramControlChannel" + ], + "symbol_candidates": [], + "layers": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "filters": { + "doc_type": null + }, + "pipeline_mode": "pre_llm_only", + "gate_decision": "allow", + "prompt_used": "docs_explain_answer", + "llm_mode": "prose", + "degraded_reason": null, + "code_intents_stubbed": true + } + }, + "pipeline_steps": [ + { + "step": "input_query", + "input": { + "query": "Роль TelegramControlChannel в системе" + }, + "output": { + "query": "Роль TelegramControlChannel в системе" + } + }, + { + "step": "router", + "input": { + "query": "Роль TelegramControlChannel в системе" + }, + "output": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "COMPONENT_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START" + } + }, + { + "step": "docs_pipeline", + "input": { + "query": "Роль TelegramControlChannel в системе" + }, + "output": { + "answer_mode": "ready", + "prompt_name": "docs_explain_answer", + "llm_request": { + "prompt_name": "docs_explain_answer", + "log_context": "graph.project_qa.docs.answer", + "prompt_stats": { + "system_chars": 393, + "user_chars": 21501, + "tokens_in_estimate": 5474 + } + }, + "degraded_reason": "" + } + } + ] +} \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/docs_router_deterministic/20260326_125615/full_chain_docs_intents_v3-3x_v3-component-control-channel-2.md b/tests/pipeline_setup_v3/test_results/docs_router_deterministic/20260326_125615/full_chain_docs_intents_v3-3x_v3-component-control-channel-2.md new file mode 100644 index 0000000..4de09eb --- /dev/null +++ b/tests/pipeline_setup_v3/test_results/docs_router_deterministic/20260326_125615/full_chain_docs_intents_v3-3x_v3-component-control-channel-2.md @@ -0,0 +1,900 @@ +# v3-component-control-channel-2 + +- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_03_docs/full_chain_docs_intents_v3-3x.yaml +- runner: agent_runtime +- mode: pre_llm +- passed: True + +## Query +Роль TelegramControlChannel в системе + +## Actual +{ + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "COMPONENT_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START", + "rag_count": 20, + "llm_answer": "", + "answer_mode": "answered", + "path_scope": [], + "doc_scope": [ + "api.control_actions_endpoint", + "api.actions_endpoint", + "architecture.telegram_notify_app", + "architecture.telegram_notify_app_overview", + "docs/README.md", + "domain.runtime_health", + "logic.telegram_notification_loop", + "api.send_message_endpoint" + ], + "entity_candidates": [ + "TelegramControlChannel" + ], + "symbol_candidates": [], + "layers": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "filters": { + "doc_type": null + }, + "pipeline_mode": "pre_llm_only", + "gate_decision": "allow", + "prompt_used": "docs_explain_answer", + "llm_mode": "prose", + "degraded_reason": null, + "code_intents_stubbed": true +} + +## Pipeline Steps +### input_query +```json +{ + "input": { + "query": "Роль TelegramControlChannel в системе" + }, + "output": { + "query": "Роль TelegramControlChannel в системе" + } +} +``` + +### router +```json +{ + "input": { + "query": "Роль TelegramControlChannel в системе" + }, + "output": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "COMPONENT_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START" + } +} +``` + +### docs_pipeline +```json +{ + "input": { + "query": "Роль TelegramControlChannel в системе" + }, + "output": { + "answer_mode": "ready", + "prompt_name": "docs_explain_answer", + "llm_request": { + "prompt_name": "docs_explain_answer", + "log_context": "graph.project_qa.docs.answer", + "prompt_stats": { + "system_chars": 393, + "user_chars": 21501, + "tokens_in_estimate": 5474 + } + }, + "degraded_reason": "" + } +} +``` + +## Diagnostics +{ + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "COMPONENT_EXPLAIN", + "layers_used": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "documents_found": 6, + "facts_found": 2, + "relations_found": 6, + "openapi_fields_extracted": 0, + "missing_required_fields": [], + "openapi_status": { + "has_path": false, + "has_method": false, + "has_request": false, + "has_response": false + }, + "prompt_used": "docs_explain_answer", + "llm_mode": "prose", + "output_valid": true, + "matched_intent_source": "deterministic", + "matched_anchor_type": "none", + "matched_anchor_value": null, + "exact_anchor_match": false, + "docs_layers_requested": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "docs_layers_with_hits": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "planned_layers": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "executed_layers": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "non_empty_layers": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "layer_diagnostics": { + "D1_DOCUMENT_CATALOG": { + "hits": 6, + "top_ids": [ + "api.control_actions_endpoint", + "architecture.telegram_notify_app", + "docs/README.md", + "domain.runtime_health", + "logic.telegram_notification_loop" + ] + }, + "D2_FACT_INDEX": { + "hits": 8, + "top_ids": [ + "b480201013a7e5231146f665773ebc54af37c28135f407c6b758304c74561645", + "b8e44c3adb74aaa6c91ae8815fa091289e58dd3990a3a1b63e850c62075aea75", + "bafb867ffed41c9db637df98d6cd5f6722d7747bbebc6c03e6f0d0caf3b7f9f3", + "54bbcbac242f1c85ec3280236ed5841998a8a3a548ff16cbf0b5acafbff469e3", + "b6bfad59b3bf00f199b5ef90c1208af19664de700413e7354468a93a4abaaa2f" + ] + }, + "D5_RELATION_GRAPH": { + "hits": 6, + "top_ids": [ + "afec31fd062e392dcd9699a92c7ab61fd4b1273c1a2b16702b23d55d8d0c47ac", + "711fb2edb82dd222deaba3c91768b18cbbd453009235823282813c6e867dc2c1", + "eec79f7a02b804337e791ef231784862ae26e0599eb20224790e9d4f085fa9c0", + "5f4909bde905cd3d294ad307074a05e4ae4deefcafe6272cd2d0436e73acb8dd", + "ae34fe4b3cd2b47632b13b1e32303e842b57948aa21160abe8d9b478995e1d74" + ] + }, + "D0_DOC_CHUNKS": { + "hits": 6, + "top_ids": [ + "api.control_actions_endpoint" + ] + } + }, + "query_entity_candidates": [ + "TelegramControlChannel" + ], + "resolved_entity_candidates": [], + "query_anchor_candidates": [ + "TelegramControlChannel" + ], + "resolved_anchor_candidates": [ + "api.control_actions_endpoint", + "docs/documentation/api/control-actions-endpoint.md", + "architecture.telegram_notify_app", + "docs/documentation/architecture/telegram-notify-app-overview.md", + "docs/README.md", + "domain.runtime_health", + "docs/documentation/domain/runtime-health-entity.md", + "logic.telegram_notification_loop", + "docs/documentation/logic/telegram-notification-loop.md", + "api.send_message_endpoint", + "docs/documentation/api/send-message-endpoint.md" + ], + "anchor_candidates": [], + "selected_anchor": null, + "anchor_selection_reason": "", + "anchor_match_type": "", + "doc_ids": [ + "api.control_actions_endpoint", + "api.actions_endpoint", + "architecture.telegram_notify_app", + "architecture.telegram_notify_app_overview", + "docs/README.md", + "domain.runtime_health", + "logic.telegram_notification_loop", + "api.send_message_endpoint" + ], + "doc_paths": [ + "docs/documentation/api/control-actions-endpoint.md", + "docs/documentation/architecture/telegram-notify-app-overview.md", + "docs/README.md", + "docs/documentation/domain/runtime-health-entity.md", + "docs/documentation/logic/telegram-notification-loop.md", + "docs/documentation/api/send-message-endpoint.md" + ], + "doc_titles": [ + "HTTP API /actions/{action}", + "Архитектура Telegram Notify App", + "Readme", + "Сущность runtime health", + "Цикл отправки уведомлений в Telegram", + "HTTP API /send", + "api.control_actions_endpoint:workflow_step", + "api.control_actions_endpoint:mentions_entity", + "api.control_actions_endpoint:parent", + "api.control_actions_endpoint:related_api", + "api.control_actions_endpoint:related_logic", + "api.control_actions_endpoint:part_of", + "architecture.telegram_notify_app:child", + "architecture.telegram_notify_app:related_api", + "api.control_actions_endpoint:Функциональные требования", + "api.control_actions_endpoint:Нефункциональные требования", + "api.control_actions_endpoint:Сценарий", + "api.control_actions_endpoint:Summary", + "api.control_actions_endpoint:Описание", + "api.control_actions_endpoint:Входные параметры" + ], + "relation_hits_count": 6, + "relation_targets": [ + "api.control_actions_endpoint:parent", + "api.control_actions_endpoint:related_api", + "api.control_actions_endpoint:related_logic", + "api.control_actions_endpoint:part_of", + "architecture.telegram_notify_app:child", + "architecture.telegram_notify_app:related_api" + ], + "fallback_doc_hits_count": 12, + "fallback_used": false, + "fact_hits": 2, + "entity_hits": 0, + "evidence_summary": { + "documents": 6, + "facts": 2, + "relations": 6, + "chunks": 6, + "entity_hits": 0, + "openapi_signals": { + "path_found": false, + "method_found": false, + "request_schema": false, + "response_schema": false, + "status_codes": false, + "payload_description": false + } + }, + "gate_decision": "allow", + "gate_decision_reason": "evidence_sufficient", + "gate_missing_requirements": [], + "gate_satisfied_requirements": [ + "retrieval_non_empty" + ], + "openapi_evidence": { + "path_found": false, + "method_found": false, + "request_schema": false, + "response_schema": false, + "status_codes": false, + "payload_description": false + }, + "requested_fragment_type": null, + "fragment_evidence_found": [], + "fragment_missing_requirements": [], + "answer_mode": "ready", + "degrade_reason": null, + "degraded_reason": null, + "code_intents_stubbed": false +} + +## LLM Request +- prompt_name: docs_explain_answer +- log_context: graph.project_qa.docs.answer + +### Prompt Stats +```json +{ + "system_chars": 393, + "user_chars": 21501, + "tokens_in_estimate": 5474 +} +``` + +### System Prompt +```text +Ты объясняешь документацию системы. + +На вход приходит JSON с полями: +- question +- intent +- sub_intent +- documents +- facts +- relations + +Правила: +- Используй только предоставленные факты +- Не додумывай +- Если данных недостаточно, скажи это явно +- Объясняй структурировано + +Формат ответа: +1. Краткое описание +2. Основные элементы +3. Как это работает +4. Связи с другими частями системы (если есть) +``` + +### User Prompt +```json +{ + "question": "Роль TelegramControlChannel в системе", + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "COMPONENT_EXPLAIN", + "documents": [ + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "HTTP API /actions/{action}", + "content": "Endpoint `/actions/{action}` управляет control actions runtime и поддерживает `start`, `stop` и `status`. Для долгих операций `start` и `stop` допускается ответ HTTP 202, если действие еще выполняется. Endpoint используется для operator-driven управления жизненным циклом worker'а через HTTP API.", + "metadata": { + "name": "control_actions_endpoint", + "tags": [ + "api", + "control-plane", + "lifecycle" + ], + "type": "api_method", + "layer": "application", + "links": [ + { + "type": "part_of", + "target": "architecture.telegram_notify_app" + }, + { + "type": "related_api", + "target": "api.health_endpoint" + }, + { + "type": "related_logic", + "target": "logic.telegram_notification_loop" + } + ], + "owner": null, + "title": "HTTP API /actions/{action}", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "architecture.telegram_notify_app", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "children": [], + "doc_kind": "misc", + "entities": [ + "TelegramControlChannel", + "ControlActionSet", + "JSONResponse" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "api.control_actions_endpoint", + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "summary_text": "Endpoint `/actions/{action}` управляет control actions runtime и поддерживает `start`, `stop` и `status`. Для долгих операций `start` и `stop` допускается ответ HTTP 202, если действие еще выполняется. Endpoint используется для operator-driven управления жизненным циклом worker'а через HTTP API.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/architecture/telegram-notify-app-overview.md", + "title": "Архитектура Telegram Notify App", + "content": "`test_echo_app` — сервис на базе PLBA runtime, который поднимает HTTP control plane и запускает фоновый воркер для периодической отправки уведомлений в Telegram. Приложение использует YAML-конфиг для runtime-настроек и переменные окружения для Telegram credentials. Основной контур системы состоит из runtime manager, control channel, send service и worker loop.", + "metadata": { + "name": "telegram_notify_app_overview", + "tags": [ + "architecture", + "telegram", + "plba", + "runtime" + ], + "type": "architecture_overview", + "layer": "system", + "links": [ + { + "type": "related_api", + "target": "api.health_endpoint" + }, + { + "type": "related_api", + "target": "api.control_actions_endpoint" + }, + { + "type": "related_api", + "target": "api.send_message_endpoint" + }, + { + "type": "depends_on", + "target": "logic.telegram_notification_loop" + }, + { + "type": "depends_on", + "target": "domain.runtime_health" + } + ], + "owner": null, + "title": "Архитектура Telegram Notify App", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "docs_root", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "8b1cc9f823e55bddbc825466d10a0fdb4ca4354ac02d91f9e2aef7b7d2ec8256", + "children": [ + "api.health_endpoint", + "api.control_actions_endpoint", + "api.send_message_endpoint", + "logic.telegram_notification_loop", + "domain.runtime_health" + ], + "doc_kind": "spec", + "entities": [ + "TelegramNotifyModule", + "TelegramNotifyWorker", + "TelegramControlChannel", + "TelegramSendService", + "RuntimeManager" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "architecture.telegram_notify_app", + "source_path": "docs/documentation/architecture/telegram-notify-app-overview.md", + "summary_text": "`test_echo_app` — сервис на базе PLBA runtime, который поднимает HTTP control plane и запускает фоновый воркер для периодической отправки уведомлений в Telegram. Приложение использует YAML-конфиг для runtime-настроек и переменные окружения для Telegram credentials. Основной контур системы состоит из runtime manager, control channel, send service и worker loop.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/README.md", + "title": "Readme", + "content": "Readme", + "metadata": { + "name": "", + "tags": [], + "type": "", + "layer": "", + "links": [], + "owner": null, + "title": "Readme", + "doc_id": null, + "module": "", + "parent": null, + "status": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "81d952f1a6ea85b76f75e0e57f33b8fa4b2bf3cb7db11b91b90171aeedd655a6", + "children": [], + "doc_kind": "readme", + "entities": [], + "updated_at": null, + "doc_version": null, + "document_id": "docs/README.md", + "source_path": "docs/README.md", + "summary_text": "", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/domain/runtime-health-entity.md", + "title": "Сущность runtime health", + "content": "`runtime health` — доменная модель наблюдаемости сервиса, которая описывает общее состояние runtime и состояние отдельных компонентов. Для `test_echo_app` главным объектом наблюдения является компонент `telegram_notify`, у которого важны статус, время старта и количество успешных отправок. Эта модель используется для внешнего health-monitoring и внутренней диагностики.", + "metadata": { + "name": "runtime_health", + "tags": [ + "domain", + "health", + "observability" + ], + "type": "domain_entity", + "layer": "domain", + "links": [ + { + "type": "part_of", + "target": "architecture.telegram_notify_app" + }, + { + "type": "used_by", + "target": "api.health_endpoint" + }, + { + "type": "related_logic", + "target": "logic.telegram_notification_loop" + } + ], + "owner": null, + "title": "Сущность runtime health", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "architecture.telegram_notify_app", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "37d4dcf470ea3de95d59e44786006e369a3ea11bf5dbf4c88877696e9183ee87", + "children": [], + "doc_kind": "misc", + "entities": [ + "WorkerHealth", + "WorkerStatus", + "TelegramNotifyWorker" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "domain.runtime_health", + "source_path": "docs/documentation/domain/runtime-health-entity.md", + "summary_text": "`runtime health` — доменная модель наблюдаемости сервиса, которая описывает общее состояние runtime и состояние отдельных компонентов. Для `test_echo_app` главным объектом наблюдения является компонент `telegram_notify`, у которого важны статус, время старта и количество успешных отправок. Эта модель используется для внешнего health-monitoring и внутренней диагностики.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/logic/telegram-notification-loop.md", + "title": "Цикл отправки уведомлений в Telegram", + "content": "`TelegramNotifyWorker` после старта runtime запускает отдельный поток, сразу делает первую попытку отправки сообщения и затем повторяет отправку через заданный интервал. При ошибках доставки или отсутствии credentials worker не останавливает сервис, а переводит собственное состояние в `degraded`. Этот workflow определяет основной полезный цикл приложения.", + "metadata": { + "name": "telegram_notification_loop", + "tags": [ + "logic", + "telegram", + "worker", + "scheduling" + ], + "type": "logic_block", + "layer": "application", + "links": [ + { + "type": "part_of", + "target": "architecture.telegram_notify_app" + }, + { + "type": "related_api", + "target": "api.send_message_endpoint" + }, + { + "type": "related_api", + "target": "api.control_actions_endpoint" + }, + { + "type": "related_api", + "target": "api.health_endpoint" + } + ], + "owner": null, + "title": "Цикл отправки уведомлений в Telegram", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "architecture.telegram_notify_app", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "0f62f9b4dab261ca4ca34575ff5d84411a22c90b780c52eda388782b94f08470", + "children": [], + "doc_kind": "misc", + "entities": [ + "TelegramNotifyWorker", + "TelegramSendService", + "WorkerHealth", + "WorkerStatus" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "logic.telegram_notification_loop", + "source_path": "docs/documentation/logic/telegram-notification-loop.md", + "summary_text": "`TelegramNotifyWorker` после старта runtime запускает отдельный поток, сразу делает первую попытку отправки сообщения и затем повторяет отправку через заданный интервал. При ошибках доставки или отсутствии credentials worker не останавливает сервис, а переводит собственное состояние в `degraded`. Этот workflow определяет основной полезный цикл приложения.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/api/send-message-endpoint.md", + "title": "HTTP API /send", + "content": "Endpoint `/send` выполняет ручную отправку сообщения в Telegram через `TelegramSendService`. Он используется для операторской проверки доставки и для отправки уведомлений вне периодического worker loop. Endpoint работает поверх тех же credentials и того же delivery path, что и фоновая отправка.", + "metadata": { + "name": "send_message_endpoint", + "tags": [ + "api", + "telegram", + "manual-send" + ], + "type": "api_method", + "layer": "application", + "links": [ + { + "type": "part_of", + "target": "architecture.telegram_notify_app" + }, + { + "type": "depends_on", + "target": "logic.telegram_notification_loop" + } + ], + "owner": null, + "title": "HTTP API /send", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "architecture.telegram_notify_app", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "5fbf2e33510b0676a3a53b957a4569bd3c2c31fb7719546602c573421ccaa32d", + "children": [], + "doc_kind": "misc", + "entities": [ + "TelegramControlAppFactory", + "TelegramSendService", + "TelegramNotifyWorker" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "api.send_message_endpoint", + "source_path": "docs/documentation/api/send-message-endpoint.md", + "summary_text": "Endpoint `/send` выполняет ручную отправку сообщения в Telegram через `TelegramSendService`. Он используется для операторской проверки доставки и для отправки уведомлений вне периодического worker loop. Endpoint работает поверх тех же credentials и того же delivery path, что и фоновая отправка.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + } + ], + "facts": [ + { + "layer": "D2_FACT_INDEX", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "api.control_actions_endpoint:workflow_step", + "content": "api.control_actions_endpoint workflow_step HTTP control plane запущен.", + "metadata": { + "tags": [], + "owner": null, + "anchor": "Сценарий", + "doc_id": null, + "object": "HTTP control plane запущен.", + "fact_id": "b480201013a7e5231146f665773ebc54af37c28135f407c6b758304c74561645", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "predicate": "workflow_step", + "object_ref": null, + "subject_id": "api.control_actions_endpoint", + "doc_version": null, + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D2_FACT_INDEX", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "api.control_actions_endpoint:mentions_entity", + "content": "api.control_actions_endpoint mentions_entity ControlActionSet", + "metadata": { + "tags": [], + "owner": null, + "anchor": "frontmatter.entities", + "doc_id": null, + "object": "ControlActionSet", + "fact_id": "bafb867ffed41c9db637df98d6cd5f6722d7747bbebc6c03e6f0d0caf3b7f9f3", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "predicate": "mentions_entity", + "object_ref": null, + "subject_id": "api.control_actions_endpoint", + "doc_version": null, + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + } + ], + "relations": [ + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "api.control_actions_endpoint:parent", + "content": "api.control_actions_endpoint parent architecture.telegram_notify_app", + "metadata": { + "owner": null, + "anchor": "frontmatter.parent", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "source_id": "api.control_actions_endpoint", + "target_id": "architecture.telegram_notify_app", + "doc_version": null, + "relation_id": "afec31fd062e392dcd9699a92c7ab61fd4b1273c1a2b16702b23d55d8d0c47ac", + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "parent", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "api.control_actions_endpoint:related_api", + "content": "api.control_actions_endpoint related_api api.health_endpoint", + "metadata": { + "owner": null, + "anchor": "frontmatter.links", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "source_id": "api.control_actions_endpoint", + "target_id": "api.health_endpoint", + "doc_version": null, + "relation_id": "711fb2edb82dd222deaba3c91768b18cbbd453009235823282813c6e867dc2c1", + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "related_api", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "api.control_actions_endpoint:related_logic", + "content": "api.control_actions_endpoint related_logic logic.telegram_notification_loop", + "metadata": { + "owner": null, + "anchor": "frontmatter.links", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "source_id": "api.control_actions_endpoint", + "target_id": "logic.telegram_notification_loop", + "doc_version": null, + "relation_id": "eec79f7a02b804337e791ef231784862ae26e0599eb20224790e9d4f085fa9c0", + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "related_logic", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "api.control_actions_endpoint:part_of", + "content": "api.control_actions_endpoint part_of architecture.telegram_notify_app", + "metadata": { + "owner": null, + "anchor": "frontmatter.links", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "source_id": "api.control_actions_endpoint", + "target_id": "architecture.telegram_notify_app", + "doc_version": null, + "relation_id": "5f4909bde905cd3d294ad307074a05e4ae4deefcafe6272cd2d0436e73acb8dd", + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "part_of", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/architecture/telegram-notify-app-overview.md", + "title": "architecture.telegram_notify_app:child", + "content": "architecture.telegram_notify_app child api.control_actions_endpoint", + "metadata": { + "owner": null, + "anchor": "frontmatter.children", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "8b1cc9f823e55bddbc825466d10a0fdb4ca4354ac02d91f9e2aef7b7d2ec8256", + "source_id": "architecture.telegram_notify_app", + "target_id": "api.control_actions_endpoint", + "doc_version": null, + "relation_id": "ae34fe4b3cd2b47632b13b1e32303e842b57948aa21160abe8d9b478995e1d74", + "source_path": "docs/documentation/architecture/telegram-notify-app-overview.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "child", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/architecture/telegram-notify-app-overview.md", + "title": "architecture.telegram_notify_app:related_api", + "content": "architecture.telegram_notify_app related_api api.control_actions_endpoint", + "metadata": { + "owner": null, + "anchor": "frontmatter.links", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "8b1cc9f823e55bddbc825466d10a0fdb4ca4354ac02d91f9e2aef7b7d2ec8256", + "source_id": "architecture.telegram_notify_app", + "target_id": "api.control_actions_endpoint", + "doc_version": null, + "relation_id": "02530527e6e1d1e23316c9d25d0b30658d6c70063eb6e1d732d55c5ba29c9795", + "source_path": "docs/documentation/architecture/telegram-notify-app-overview.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "related_api", + "staleness_score": null, + "system_component": null + } + } + ] +} +``` + +### User Prompt Overview +- question: Роль TelegramControlChannel в системе +- intent: DOCUMENTATION_EXPLAIN +- sub_intent: COMPONENT_EXPLAIN +- documents: 6 | samples: HTTP API /actions/{action}, Архитектура Telegram Notify App, Readme +- facts: 2 | samples: api.control_actions_endpoint:workflow_step, api.control_actions_endpoint:mentions_entity +- relations: 6 | samples: api.control_actions_endpoint:parent, api.control_actions_endpoint:related_api, api.control_actions_endpoint:related_logic + +## Mismatches +- none \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/docs_router_deterministic/20260326_125615/full_chain_docs_intents_v3-3x_v3-component-runtime-manager-1.json b/tests/pipeline_setup_v3/test_results/docs_router_deterministic/20260326_125615/full_chain_docs_intents_v3-3x_v3-component-runtime-manager-1.json new file mode 100644 index 0000000..9bb41f2 --- /dev/null +++ b/tests/pipeline_setup_v3/test_results/docs_router_deterministic/20260326_125615/full_chain_docs_intents_v3-3x_v3-component-runtime-manager-1.json @@ -0,0 +1,92 @@ +{ + "meta": { + "case_id": "v3-component-runtime-manager-1", + "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_03_docs/full_chain_docs_intents_v3-3x.yaml", + "runner": "agent_runtime", + "mode": "pre_llm", + "passed": true, + "mismatches": [], + "actual": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "COMPONENT_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START", + "rag_count": 20, + "llm_answer": "", + "answer_mode": "answered", + "path_scope": [], + "doc_scope": [ + "api.control_actions_endpoint", + "api.actions_endpoint", + "architecture.telegram_notify_app", + "architecture.telegram_notify_app_overview", + "docs/README.md", + "domain.runtime_health", + "logic.telegram_notification_loop", + "api.send_message_endpoint" + ], + "entity_candidates": [ + "RuntimeManager" + ], + "symbol_candidates": [], + "layers": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "filters": { + "doc_type": null + }, + "pipeline_mode": "pre_llm_only", + "gate_decision": "allow", + "prompt_used": "docs_explain_answer", + "llm_mode": "prose", + "degraded_reason": null, + "code_intents_stubbed": true + } + }, + "pipeline_steps": [ + { + "step": "input_query", + "input": { + "query": "Что делает RuntimeManager?" + }, + "output": { + "query": "Что делает RuntimeManager?" + } + }, + { + "step": "router", + "input": { + "query": "Что делает RuntimeManager?" + }, + "output": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "COMPONENT_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START" + } + }, + { + "step": "docs_pipeline", + "input": { + "query": "Что делает RuntimeManager?" + }, + "output": { + "answer_mode": "ready", + "prompt_name": "docs_explain_answer", + "llm_request": { + "prompt_name": "docs_explain_answer", + "log_context": "graph.project_qa.docs.answer", + "prompt_stats": { + "system_chars": 393, + "user_chars": 21490, + "tokens_in_estimate": 5471 + } + }, + "degraded_reason": "" + } + } + ] +} \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/docs_router_deterministic/20260326_125615/full_chain_docs_intents_v3-3x_v3-component-runtime-manager-1.md b/tests/pipeline_setup_v3/test_results/docs_router_deterministic/20260326_125615/full_chain_docs_intents_v3-3x_v3-component-runtime-manager-1.md new file mode 100644 index 0000000..e6df2cd --- /dev/null +++ b/tests/pipeline_setup_v3/test_results/docs_router_deterministic/20260326_125615/full_chain_docs_intents_v3-3x_v3-component-runtime-manager-1.md @@ -0,0 +1,900 @@ +# v3-component-runtime-manager-1 + +- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_03_docs/full_chain_docs_intents_v3-3x.yaml +- runner: agent_runtime +- mode: pre_llm +- passed: True + +## Query +Что делает RuntimeManager? + +## Actual +{ + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "COMPONENT_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START", + "rag_count": 20, + "llm_answer": "", + "answer_mode": "answered", + "path_scope": [], + "doc_scope": [ + "api.control_actions_endpoint", + "api.actions_endpoint", + "architecture.telegram_notify_app", + "architecture.telegram_notify_app_overview", + "docs/README.md", + "domain.runtime_health", + "logic.telegram_notification_loop", + "api.send_message_endpoint" + ], + "entity_candidates": [ + "RuntimeManager" + ], + "symbol_candidates": [], + "layers": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "filters": { + "doc_type": null + }, + "pipeline_mode": "pre_llm_only", + "gate_decision": "allow", + "prompt_used": "docs_explain_answer", + "llm_mode": "prose", + "degraded_reason": null, + "code_intents_stubbed": true +} + +## Pipeline Steps +### input_query +```json +{ + "input": { + "query": "Что делает RuntimeManager?" + }, + "output": { + "query": "Что делает RuntimeManager?" + } +} +``` + +### router +```json +{ + "input": { + "query": "Что делает RuntimeManager?" + }, + "output": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "COMPONENT_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START" + } +} +``` + +### docs_pipeline +```json +{ + "input": { + "query": "Что делает RuntimeManager?" + }, + "output": { + "answer_mode": "ready", + "prompt_name": "docs_explain_answer", + "llm_request": { + "prompt_name": "docs_explain_answer", + "log_context": "graph.project_qa.docs.answer", + "prompt_stats": { + "system_chars": 393, + "user_chars": 21490, + "tokens_in_estimate": 5471 + } + }, + "degraded_reason": "" + } +} +``` + +## Diagnostics +{ + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "COMPONENT_EXPLAIN", + "layers_used": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "documents_found": 6, + "facts_found": 2, + "relations_found": 6, + "openapi_fields_extracted": 0, + "missing_required_fields": [], + "openapi_status": { + "has_path": false, + "has_method": false, + "has_request": false, + "has_response": false + }, + "prompt_used": "docs_explain_answer", + "llm_mode": "prose", + "output_valid": true, + "matched_intent_source": "deterministic", + "matched_anchor_type": "none", + "matched_anchor_value": null, + "exact_anchor_match": false, + "docs_layers_requested": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "docs_layers_with_hits": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "planned_layers": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "executed_layers": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "non_empty_layers": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "layer_diagnostics": { + "D1_DOCUMENT_CATALOG": { + "hits": 6, + "top_ids": [ + "api.control_actions_endpoint", + "architecture.telegram_notify_app", + "docs/README.md", + "domain.runtime_health", + "logic.telegram_notification_loop" + ] + }, + "D2_FACT_INDEX": { + "hits": 8, + "top_ids": [ + "b480201013a7e5231146f665773ebc54af37c28135f407c6b758304c74561645", + "b8e44c3adb74aaa6c91ae8815fa091289e58dd3990a3a1b63e850c62075aea75", + "bafb867ffed41c9db637df98d6cd5f6722d7747bbebc6c03e6f0d0caf3b7f9f3", + "54bbcbac242f1c85ec3280236ed5841998a8a3a548ff16cbf0b5acafbff469e3", + "b6bfad59b3bf00f199b5ef90c1208af19664de700413e7354468a93a4abaaa2f" + ] + }, + "D5_RELATION_GRAPH": { + "hits": 6, + "top_ids": [ + "afec31fd062e392dcd9699a92c7ab61fd4b1273c1a2b16702b23d55d8d0c47ac", + "711fb2edb82dd222deaba3c91768b18cbbd453009235823282813c6e867dc2c1", + "eec79f7a02b804337e791ef231784862ae26e0599eb20224790e9d4f085fa9c0", + "5f4909bde905cd3d294ad307074a05e4ae4deefcafe6272cd2d0436e73acb8dd", + "ae34fe4b3cd2b47632b13b1e32303e842b57948aa21160abe8d9b478995e1d74" + ] + }, + "D0_DOC_CHUNKS": { + "hits": 6, + "top_ids": [ + "api.control_actions_endpoint" + ] + } + }, + "query_entity_candidates": [ + "RuntimeManager" + ], + "resolved_entity_candidates": [], + "query_anchor_candidates": [ + "RuntimeManager" + ], + "resolved_anchor_candidates": [ + "api.control_actions_endpoint", + "docs/documentation/api/control-actions-endpoint.md", + "architecture.telegram_notify_app", + "docs/documentation/architecture/telegram-notify-app-overview.md", + "docs/README.md", + "domain.runtime_health", + "docs/documentation/domain/runtime-health-entity.md", + "logic.telegram_notification_loop", + "docs/documentation/logic/telegram-notification-loop.md", + "api.send_message_endpoint", + "docs/documentation/api/send-message-endpoint.md" + ], + "anchor_candidates": [], + "selected_anchor": null, + "anchor_selection_reason": "", + "anchor_match_type": "", + "doc_ids": [ + "api.control_actions_endpoint", + "api.actions_endpoint", + "architecture.telegram_notify_app", + "architecture.telegram_notify_app_overview", + "docs/README.md", + "domain.runtime_health", + "logic.telegram_notification_loop", + "api.send_message_endpoint" + ], + "doc_paths": [ + "docs/documentation/api/control-actions-endpoint.md", + "docs/documentation/architecture/telegram-notify-app-overview.md", + "docs/README.md", + "docs/documentation/domain/runtime-health-entity.md", + "docs/documentation/logic/telegram-notification-loop.md", + "docs/documentation/api/send-message-endpoint.md" + ], + "doc_titles": [ + "HTTP API /actions/{action}", + "Архитектура Telegram Notify App", + "Readme", + "Сущность runtime health", + "Цикл отправки уведомлений в Telegram", + "HTTP API /send", + "api.control_actions_endpoint:workflow_step", + "api.control_actions_endpoint:mentions_entity", + "api.control_actions_endpoint:parent", + "api.control_actions_endpoint:related_api", + "api.control_actions_endpoint:related_logic", + "api.control_actions_endpoint:part_of", + "architecture.telegram_notify_app:child", + "architecture.telegram_notify_app:related_api", + "api.control_actions_endpoint:Функциональные требования", + "api.control_actions_endpoint:Нефункциональные требования", + "api.control_actions_endpoint:Сценарий", + "api.control_actions_endpoint:Summary", + "api.control_actions_endpoint:Описание", + "api.control_actions_endpoint:Входные параметры" + ], + "relation_hits_count": 6, + "relation_targets": [ + "api.control_actions_endpoint:parent", + "api.control_actions_endpoint:related_api", + "api.control_actions_endpoint:related_logic", + "api.control_actions_endpoint:part_of", + "architecture.telegram_notify_app:child", + "architecture.telegram_notify_app:related_api" + ], + "fallback_doc_hits_count": 12, + "fallback_used": false, + "fact_hits": 2, + "entity_hits": 0, + "evidence_summary": { + "documents": 6, + "facts": 2, + "relations": 6, + "chunks": 6, + "entity_hits": 0, + "openapi_signals": { + "path_found": false, + "method_found": false, + "request_schema": false, + "response_schema": false, + "status_codes": false, + "payload_description": false + } + }, + "gate_decision": "allow", + "gate_decision_reason": "evidence_sufficient", + "gate_missing_requirements": [], + "gate_satisfied_requirements": [ + "retrieval_non_empty" + ], + "openapi_evidence": { + "path_found": false, + "method_found": false, + "request_schema": false, + "response_schema": false, + "status_codes": false, + "payload_description": false + }, + "requested_fragment_type": null, + "fragment_evidence_found": [], + "fragment_missing_requirements": [], + "answer_mode": "ready", + "degrade_reason": null, + "degraded_reason": null, + "code_intents_stubbed": false +} + +## LLM Request +- prompt_name: docs_explain_answer +- log_context: graph.project_qa.docs.answer + +### Prompt Stats +```json +{ + "system_chars": 393, + "user_chars": 21490, + "tokens_in_estimate": 5471 +} +``` + +### System Prompt +```text +Ты объясняешь документацию системы. + +На вход приходит JSON с полями: +- question +- intent +- sub_intent +- documents +- facts +- relations + +Правила: +- Используй только предоставленные факты +- Не додумывай +- Если данных недостаточно, скажи это явно +- Объясняй структурировано + +Формат ответа: +1. Краткое описание +2. Основные элементы +3. Как это работает +4. Связи с другими частями системы (если есть) +``` + +### User Prompt +```json +{ + "question": "Что делает RuntimeManager?", + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "COMPONENT_EXPLAIN", + "documents": [ + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "HTTP API /actions/{action}", + "content": "Endpoint `/actions/{action}` управляет control actions runtime и поддерживает `start`, `stop` и `status`. Для долгих операций `start` и `stop` допускается ответ HTTP 202, если действие еще выполняется. Endpoint используется для operator-driven управления жизненным циклом worker'а через HTTP API.", + "metadata": { + "name": "control_actions_endpoint", + "tags": [ + "api", + "control-plane", + "lifecycle" + ], + "type": "api_method", + "layer": "application", + "links": [ + { + "type": "part_of", + "target": "architecture.telegram_notify_app" + }, + { + "type": "related_api", + "target": "api.health_endpoint" + }, + { + "type": "related_logic", + "target": "logic.telegram_notification_loop" + } + ], + "owner": null, + "title": "HTTP API /actions/{action}", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "architecture.telegram_notify_app", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "children": [], + "doc_kind": "misc", + "entities": [ + "TelegramControlChannel", + "ControlActionSet", + "JSONResponse" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "api.control_actions_endpoint", + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "summary_text": "Endpoint `/actions/{action}` управляет control actions runtime и поддерживает `start`, `stop` и `status`. Для долгих операций `start` и `stop` допускается ответ HTTP 202, если действие еще выполняется. Endpoint используется для operator-driven управления жизненным циклом worker'а через HTTP API.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/architecture/telegram-notify-app-overview.md", + "title": "Архитектура Telegram Notify App", + "content": "`test_echo_app` — сервис на базе PLBA runtime, который поднимает HTTP control plane и запускает фоновый воркер для периодической отправки уведомлений в Telegram. Приложение использует YAML-конфиг для runtime-настроек и переменные окружения для Telegram credentials. Основной контур системы состоит из runtime manager, control channel, send service и worker loop.", + "metadata": { + "name": "telegram_notify_app_overview", + "tags": [ + "architecture", + "telegram", + "plba", + "runtime" + ], + "type": "architecture_overview", + "layer": "system", + "links": [ + { + "type": "related_api", + "target": "api.health_endpoint" + }, + { + "type": "related_api", + "target": "api.control_actions_endpoint" + }, + { + "type": "related_api", + "target": "api.send_message_endpoint" + }, + { + "type": "depends_on", + "target": "logic.telegram_notification_loop" + }, + { + "type": "depends_on", + "target": "domain.runtime_health" + } + ], + "owner": null, + "title": "Архитектура Telegram Notify App", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "docs_root", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "8b1cc9f823e55bddbc825466d10a0fdb4ca4354ac02d91f9e2aef7b7d2ec8256", + "children": [ + "api.health_endpoint", + "api.control_actions_endpoint", + "api.send_message_endpoint", + "logic.telegram_notification_loop", + "domain.runtime_health" + ], + "doc_kind": "spec", + "entities": [ + "TelegramNotifyModule", + "TelegramNotifyWorker", + "TelegramControlChannel", + "TelegramSendService", + "RuntimeManager" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "architecture.telegram_notify_app", + "source_path": "docs/documentation/architecture/telegram-notify-app-overview.md", + "summary_text": "`test_echo_app` — сервис на базе PLBA runtime, который поднимает HTTP control plane и запускает фоновый воркер для периодической отправки уведомлений в Telegram. Приложение использует YAML-конфиг для runtime-настроек и переменные окружения для Telegram credentials. Основной контур системы состоит из runtime manager, control channel, send service и worker loop.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/README.md", + "title": "Readme", + "content": "Readme", + "metadata": { + "name": "", + "tags": [], + "type": "", + "layer": "", + "links": [], + "owner": null, + "title": "Readme", + "doc_id": null, + "module": "", + "parent": null, + "status": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "81d952f1a6ea85b76f75e0e57f33b8fa4b2bf3cb7db11b91b90171aeedd655a6", + "children": [], + "doc_kind": "readme", + "entities": [], + "updated_at": null, + "doc_version": null, + "document_id": "docs/README.md", + "source_path": "docs/README.md", + "summary_text": "", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/domain/runtime-health-entity.md", + "title": "Сущность runtime health", + "content": "`runtime health` — доменная модель наблюдаемости сервиса, которая описывает общее состояние runtime и состояние отдельных компонентов. Для `test_echo_app` главным объектом наблюдения является компонент `telegram_notify`, у которого важны статус, время старта и количество успешных отправок. Эта модель используется для внешнего health-monitoring и внутренней диагностики.", + "metadata": { + "name": "runtime_health", + "tags": [ + "domain", + "health", + "observability" + ], + "type": "domain_entity", + "layer": "domain", + "links": [ + { + "type": "part_of", + "target": "architecture.telegram_notify_app" + }, + { + "type": "used_by", + "target": "api.health_endpoint" + }, + { + "type": "related_logic", + "target": "logic.telegram_notification_loop" + } + ], + "owner": null, + "title": "Сущность runtime health", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "architecture.telegram_notify_app", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "37d4dcf470ea3de95d59e44786006e369a3ea11bf5dbf4c88877696e9183ee87", + "children": [], + "doc_kind": "misc", + "entities": [ + "WorkerHealth", + "WorkerStatus", + "TelegramNotifyWorker" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "domain.runtime_health", + "source_path": "docs/documentation/domain/runtime-health-entity.md", + "summary_text": "`runtime health` — доменная модель наблюдаемости сервиса, которая описывает общее состояние runtime и состояние отдельных компонентов. Для `test_echo_app` главным объектом наблюдения является компонент `telegram_notify`, у которого важны статус, время старта и количество успешных отправок. Эта модель используется для внешнего health-monitoring и внутренней диагностики.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/logic/telegram-notification-loop.md", + "title": "Цикл отправки уведомлений в Telegram", + "content": "`TelegramNotifyWorker` после старта runtime запускает отдельный поток, сразу делает первую попытку отправки сообщения и затем повторяет отправку через заданный интервал. При ошибках доставки или отсутствии credentials worker не останавливает сервис, а переводит собственное состояние в `degraded`. Этот workflow определяет основной полезный цикл приложения.", + "metadata": { + "name": "telegram_notification_loop", + "tags": [ + "logic", + "telegram", + "worker", + "scheduling" + ], + "type": "logic_block", + "layer": "application", + "links": [ + { + "type": "part_of", + "target": "architecture.telegram_notify_app" + }, + { + "type": "related_api", + "target": "api.send_message_endpoint" + }, + { + "type": "related_api", + "target": "api.control_actions_endpoint" + }, + { + "type": "related_api", + "target": "api.health_endpoint" + } + ], + "owner": null, + "title": "Цикл отправки уведомлений в Telegram", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "architecture.telegram_notify_app", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "0f62f9b4dab261ca4ca34575ff5d84411a22c90b780c52eda388782b94f08470", + "children": [], + "doc_kind": "misc", + "entities": [ + "TelegramNotifyWorker", + "TelegramSendService", + "WorkerHealth", + "WorkerStatus" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "logic.telegram_notification_loop", + "source_path": "docs/documentation/logic/telegram-notification-loop.md", + "summary_text": "`TelegramNotifyWorker` после старта runtime запускает отдельный поток, сразу делает первую попытку отправки сообщения и затем повторяет отправку через заданный интервал. При ошибках доставки или отсутствии credentials worker не останавливает сервис, а переводит собственное состояние в `degraded`. Этот workflow определяет основной полезный цикл приложения.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/api/send-message-endpoint.md", + "title": "HTTP API /send", + "content": "Endpoint `/send` выполняет ручную отправку сообщения в Telegram через `TelegramSendService`. Он используется для операторской проверки доставки и для отправки уведомлений вне периодического worker loop. Endpoint работает поверх тех же credentials и того же delivery path, что и фоновая отправка.", + "metadata": { + "name": "send_message_endpoint", + "tags": [ + "api", + "telegram", + "manual-send" + ], + "type": "api_method", + "layer": "application", + "links": [ + { + "type": "part_of", + "target": "architecture.telegram_notify_app" + }, + { + "type": "depends_on", + "target": "logic.telegram_notification_loop" + } + ], + "owner": null, + "title": "HTTP API /send", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "architecture.telegram_notify_app", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "5fbf2e33510b0676a3a53b957a4569bd3c2c31fb7719546602c573421ccaa32d", + "children": [], + "doc_kind": "misc", + "entities": [ + "TelegramControlAppFactory", + "TelegramSendService", + "TelegramNotifyWorker" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "api.send_message_endpoint", + "source_path": "docs/documentation/api/send-message-endpoint.md", + "summary_text": "Endpoint `/send` выполняет ручную отправку сообщения в Telegram через `TelegramSendService`. Он используется для операторской проверки доставки и для отправки уведомлений вне периодического worker loop. Endpoint работает поверх тех же credentials и того же delivery path, что и фоновая отправка.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + } + ], + "facts": [ + { + "layer": "D2_FACT_INDEX", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "api.control_actions_endpoint:workflow_step", + "content": "api.control_actions_endpoint workflow_step HTTP control plane запущен.", + "metadata": { + "tags": [], + "owner": null, + "anchor": "Сценарий", + "doc_id": null, + "object": "HTTP control plane запущен.", + "fact_id": "b480201013a7e5231146f665773ebc54af37c28135f407c6b758304c74561645", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "predicate": "workflow_step", + "object_ref": null, + "subject_id": "api.control_actions_endpoint", + "doc_version": null, + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D2_FACT_INDEX", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "api.control_actions_endpoint:mentions_entity", + "content": "api.control_actions_endpoint mentions_entity ControlActionSet", + "metadata": { + "tags": [], + "owner": null, + "anchor": "frontmatter.entities", + "doc_id": null, + "object": "ControlActionSet", + "fact_id": "bafb867ffed41c9db637df98d6cd5f6722d7747bbebc6c03e6f0d0caf3b7f9f3", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "predicate": "mentions_entity", + "object_ref": null, + "subject_id": "api.control_actions_endpoint", + "doc_version": null, + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + } + ], + "relations": [ + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "api.control_actions_endpoint:parent", + "content": "api.control_actions_endpoint parent architecture.telegram_notify_app", + "metadata": { + "owner": null, + "anchor": "frontmatter.parent", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "source_id": "api.control_actions_endpoint", + "target_id": "architecture.telegram_notify_app", + "doc_version": null, + "relation_id": "afec31fd062e392dcd9699a92c7ab61fd4b1273c1a2b16702b23d55d8d0c47ac", + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "parent", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "api.control_actions_endpoint:related_api", + "content": "api.control_actions_endpoint related_api api.health_endpoint", + "metadata": { + "owner": null, + "anchor": "frontmatter.links", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "source_id": "api.control_actions_endpoint", + "target_id": "api.health_endpoint", + "doc_version": null, + "relation_id": "711fb2edb82dd222deaba3c91768b18cbbd453009235823282813c6e867dc2c1", + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "related_api", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "api.control_actions_endpoint:related_logic", + "content": "api.control_actions_endpoint related_logic logic.telegram_notification_loop", + "metadata": { + "owner": null, + "anchor": "frontmatter.links", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "source_id": "api.control_actions_endpoint", + "target_id": "logic.telegram_notification_loop", + "doc_version": null, + "relation_id": "eec79f7a02b804337e791ef231784862ae26e0599eb20224790e9d4f085fa9c0", + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "related_logic", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "api.control_actions_endpoint:part_of", + "content": "api.control_actions_endpoint part_of architecture.telegram_notify_app", + "metadata": { + "owner": null, + "anchor": "frontmatter.links", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "source_id": "api.control_actions_endpoint", + "target_id": "architecture.telegram_notify_app", + "doc_version": null, + "relation_id": "5f4909bde905cd3d294ad307074a05e4ae4deefcafe6272cd2d0436e73acb8dd", + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "part_of", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/architecture/telegram-notify-app-overview.md", + "title": "architecture.telegram_notify_app:child", + "content": "architecture.telegram_notify_app child api.control_actions_endpoint", + "metadata": { + "owner": null, + "anchor": "frontmatter.children", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "8b1cc9f823e55bddbc825466d10a0fdb4ca4354ac02d91f9e2aef7b7d2ec8256", + "source_id": "architecture.telegram_notify_app", + "target_id": "api.control_actions_endpoint", + "doc_version": null, + "relation_id": "ae34fe4b3cd2b47632b13b1e32303e842b57948aa21160abe8d9b478995e1d74", + "source_path": "docs/documentation/architecture/telegram-notify-app-overview.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "child", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/architecture/telegram-notify-app-overview.md", + "title": "architecture.telegram_notify_app:related_api", + "content": "architecture.telegram_notify_app related_api api.control_actions_endpoint", + "metadata": { + "owner": null, + "anchor": "frontmatter.links", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "8b1cc9f823e55bddbc825466d10a0fdb4ca4354ac02d91f9e2aef7b7d2ec8256", + "source_id": "architecture.telegram_notify_app", + "target_id": "api.control_actions_endpoint", + "doc_version": null, + "relation_id": "02530527e6e1d1e23316c9d25d0b30658d6c70063eb6e1d732d55c5ba29c9795", + "source_path": "docs/documentation/architecture/telegram-notify-app-overview.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "related_api", + "staleness_score": null, + "system_component": null + } + } + ] +} +``` + +### User Prompt Overview +- question: Что делает RuntimeManager? +- intent: DOCUMENTATION_EXPLAIN +- sub_intent: COMPONENT_EXPLAIN +- documents: 6 | samples: HTTP API /actions/{action}, Архитектура Telegram Notify App, Readme +- facts: 2 | samples: api.control_actions_endpoint:workflow_step, api.control_actions_endpoint:mentions_entity +- relations: 6 | samples: api.control_actions_endpoint:parent, api.control_actions_endpoint:related_api, api.control_actions_endpoint:related_logic + +## Mismatches +- none \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/docs_router_deterministic/20260326_125615/full_chain_docs_intents_v3-3x_v3-component-runtime-manager-2.json b/tests/pipeline_setup_v3/test_results/docs_router_deterministic/20260326_125615/full_chain_docs_intents_v3-3x_v3-component-runtime-manager-2.json new file mode 100644 index 0000000..06f11d9 --- /dev/null +++ b/tests/pipeline_setup_v3/test_results/docs_router_deterministic/20260326_125615/full_chain_docs_intents_v3-3x_v3-component-runtime-manager-2.json @@ -0,0 +1,92 @@ +{ + "meta": { + "case_id": "v3-component-runtime-manager-2", + "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_03_docs/full_chain_docs_intents_v3-3x.yaml", + "runner": "agent_runtime", + "mode": "pre_llm", + "passed": true, + "mismatches": [], + "actual": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "COMPONENT_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START", + "rag_count": 20, + "llm_answer": "", + "answer_mode": "answered", + "path_scope": [], + "doc_scope": [ + "api.control_actions_endpoint", + "api.actions_endpoint", + "architecture.telegram_notify_app", + "architecture.telegram_notify_app_overview", + "docs/README.md", + "domain.runtime_health", + "logic.telegram_notification_loop", + "api.send_message_endpoint" + ], + "entity_candidates": [ + "RuntimeManager" + ], + "symbol_candidates": [], + "layers": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "filters": { + "doc_type": null + }, + "pipeline_mode": "pre_llm_only", + "gate_decision": "allow", + "prompt_used": "docs_explain_answer", + "llm_mode": "prose", + "degraded_reason": null, + "code_intents_stubbed": true + } + }, + "pipeline_steps": [ + { + "step": "input_query", + "input": { + "query": "Как устроен RuntimeManager?" + }, + "output": { + "query": "Как устроен RuntimeManager?" + } + }, + { + "step": "router", + "input": { + "query": "Как устроен RuntimeManager?" + }, + "output": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "COMPONENT_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START" + } + }, + { + "step": "docs_pipeline", + "input": { + "query": "Как устроен RuntimeManager?" + }, + "output": { + "answer_mode": "ready", + "prompt_name": "docs_explain_answer", + "llm_request": { + "prompt_name": "docs_explain_answer", + "log_context": "graph.project_qa.docs.answer", + "prompt_stats": { + "system_chars": 393, + "user_chars": 21491, + "tokens_in_estimate": 5471 + } + }, + "degraded_reason": "" + } + } + ] +} \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/docs_router_deterministic/20260326_125615/full_chain_docs_intents_v3-3x_v3-component-runtime-manager-2.md b/tests/pipeline_setup_v3/test_results/docs_router_deterministic/20260326_125615/full_chain_docs_intents_v3-3x_v3-component-runtime-manager-2.md new file mode 100644 index 0000000..a63e1e7 --- /dev/null +++ b/tests/pipeline_setup_v3/test_results/docs_router_deterministic/20260326_125615/full_chain_docs_intents_v3-3x_v3-component-runtime-manager-2.md @@ -0,0 +1,900 @@ +# v3-component-runtime-manager-2 + +- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_03_docs/full_chain_docs_intents_v3-3x.yaml +- runner: agent_runtime +- mode: pre_llm +- passed: True + +## Query +Как устроен RuntimeManager? + +## Actual +{ + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "COMPONENT_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START", + "rag_count": 20, + "llm_answer": "", + "answer_mode": "answered", + "path_scope": [], + "doc_scope": [ + "api.control_actions_endpoint", + "api.actions_endpoint", + "architecture.telegram_notify_app", + "architecture.telegram_notify_app_overview", + "docs/README.md", + "domain.runtime_health", + "logic.telegram_notification_loop", + "api.send_message_endpoint" + ], + "entity_candidates": [ + "RuntimeManager" + ], + "symbol_candidates": [], + "layers": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "filters": { + "doc_type": null + }, + "pipeline_mode": "pre_llm_only", + "gate_decision": "allow", + "prompt_used": "docs_explain_answer", + "llm_mode": "prose", + "degraded_reason": null, + "code_intents_stubbed": true +} + +## Pipeline Steps +### input_query +```json +{ + "input": { + "query": "Как устроен RuntimeManager?" + }, + "output": { + "query": "Как устроен RuntimeManager?" + } +} +``` + +### router +```json +{ + "input": { + "query": "Как устроен RuntimeManager?" + }, + "output": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "COMPONENT_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START" + } +} +``` + +### docs_pipeline +```json +{ + "input": { + "query": "Как устроен RuntimeManager?" + }, + "output": { + "answer_mode": "ready", + "prompt_name": "docs_explain_answer", + "llm_request": { + "prompt_name": "docs_explain_answer", + "log_context": "graph.project_qa.docs.answer", + "prompt_stats": { + "system_chars": 393, + "user_chars": 21491, + "tokens_in_estimate": 5471 + } + }, + "degraded_reason": "" + } +} +``` + +## Diagnostics +{ + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "COMPONENT_EXPLAIN", + "layers_used": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "documents_found": 6, + "facts_found": 2, + "relations_found": 6, + "openapi_fields_extracted": 0, + "missing_required_fields": [], + "openapi_status": { + "has_path": false, + "has_method": false, + "has_request": false, + "has_response": false + }, + "prompt_used": "docs_explain_answer", + "llm_mode": "prose", + "output_valid": true, + "matched_intent_source": "deterministic", + "matched_anchor_type": "none", + "matched_anchor_value": null, + "exact_anchor_match": false, + "docs_layers_requested": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "docs_layers_with_hits": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "planned_layers": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "executed_layers": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "non_empty_layers": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "layer_diagnostics": { + "D1_DOCUMENT_CATALOG": { + "hits": 6, + "top_ids": [ + "api.control_actions_endpoint", + "architecture.telegram_notify_app", + "docs/README.md", + "domain.runtime_health", + "logic.telegram_notification_loop" + ] + }, + "D2_FACT_INDEX": { + "hits": 8, + "top_ids": [ + "b480201013a7e5231146f665773ebc54af37c28135f407c6b758304c74561645", + "b8e44c3adb74aaa6c91ae8815fa091289e58dd3990a3a1b63e850c62075aea75", + "bafb867ffed41c9db637df98d6cd5f6722d7747bbebc6c03e6f0d0caf3b7f9f3", + "54bbcbac242f1c85ec3280236ed5841998a8a3a548ff16cbf0b5acafbff469e3", + "b6bfad59b3bf00f199b5ef90c1208af19664de700413e7354468a93a4abaaa2f" + ] + }, + "D5_RELATION_GRAPH": { + "hits": 6, + "top_ids": [ + "afec31fd062e392dcd9699a92c7ab61fd4b1273c1a2b16702b23d55d8d0c47ac", + "711fb2edb82dd222deaba3c91768b18cbbd453009235823282813c6e867dc2c1", + "eec79f7a02b804337e791ef231784862ae26e0599eb20224790e9d4f085fa9c0", + "5f4909bde905cd3d294ad307074a05e4ae4deefcafe6272cd2d0436e73acb8dd", + "ae34fe4b3cd2b47632b13b1e32303e842b57948aa21160abe8d9b478995e1d74" + ] + }, + "D0_DOC_CHUNKS": { + "hits": 6, + "top_ids": [ + "api.control_actions_endpoint" + ] + } + }, + "query_entity_candidates": [ + "RuntimeManager" + ], + "resolved_entity_candidates": [], + "query_anchor_candidates": [ + "RuntimeManager" + ], + "resolved_anchor_candidates": [ + "api.control_actions_endpoint", + "docs/documentation/api/control-actions-endpoint.md", + "architecture.telegram_notify_app", + "docs/documentation/architecture/telegram-notify-app-overview.md", + "docs/README.md", + "domain.runtime_health", + "docs/documentation/domain/runtime-health-entity.md", + "logic.telegram_notification_loop", + "docs/documentation/logic/telegram-notification-loop.md", + "api.send_message_endpoint", + "docs/documentation/api/send-message-endpoint.md" + ], + "anchor_candidates": [], + "selected_anchor": null, + "anchor_selection_reason": "", + "anchor_match_type": "", + "doc_ids": [ + "api.control_actions_endpoint", + "api.actions_endpoint", + "architecture.telegram_notify_app", + "architecture.telegram_notify_app_overview", + "docs/README.md", + "domain.runtime_health", + "logic.telegram_notification_loop", + "api.send_message_endpoint" + ], + "doc_paths": [ + "docs/documentation/api/control-actions-endpoint.md", + "docs/documentation/architecture/telegram-notify-app-overview.md", + "docs/README.md", + "docs/documentation/domain/runtime-health-entity.md", + "docs/documentation/logic/telegram-notification-loop.md", + "docs/documentation/api/send-message-endpoint.md" + ], + "doc_titles": [ + "HTTP API /actions/{action}", + "Архитектура Telegram Notify App", + "Readme", + "Сущность runtime health", + "Цикл отправки уведомлений в Telegram", + "HTTP API /send", + "api.control_actions_endpoint:workflow_step", + "api.control_actions_endpoint:mentions_entity", + "api.control_actions_endpoint:parent", + "api.control_actions_endpoint:related_api", + "api.control_actions_endpoint:related_logic", + "api.control_actions_endpoint:part_of", + "architecture.telegram_notify_app:child", + "architecture.telegram_notify_app:related_api", + "api.control_actions_endpoint:Функциональные требования", + "api.control_actions_endpoint:Нефункциональные требования", + "api.control_actions_endpoint:Сценарий", + "api.control_actions_endpoint:Summary", + "api.control_actions_endpoint:Описание", + "api.control_actions_endpoint:Входные параметры" + ], + "relation_hits_count": 6, + "relation_targets": [ + "api.control_actions_endpoint:parent", + "api.control_actions_endpoint:related_api", + "api.control_actions_endpoint:related_logic", + "api.control_actions_endpoint:part_of", + "architecture.telegram_notify_app:child", + "architecture.telegram_notify_app:related_api" + ], + "fallback_doc_hits_count": 12, + "fallback_used": false, + "fact_hits": 2, + "entity_hits": 0, + "evidence_summary": { + "documents": 6, + "facts": 2, + "relations": 6, + "chunks": 6, + "entity_hits": 0, + "openapi_signals": { + "path_found": false, + "method_found": false, + "request_schema": false, + "response_schema": false, + "status_codes": false, + "payload_description": false + } + }, + "gate_decision": "allow", + "gate_decision_reason": "evidence_sufficient", + "gate_missing_requirements": [], + "gate_satisfied_requirements": [ + "retrieval_non_empty" + ], + "openapi_evidence": { + "path_found": false, + "method_found": false, + "request_schema": false, + "response_schema": false, + "status_codes": false, + "payload_description": false + }, + "requested_fragment_type": null, + "fragment_evidence_found": [], + "fragment_missing_requirements": [], + "answer_mode": "ready", + "degrade_reason": null, + "degraded_reason": null, + "code_intents_stubbed": false +} + +## LLM Request +- prompt_name: docs_explain_answer +- log_context: graph.project_qa.docs.answer + +### Prompt Stats +```json +{ + "system_chars": 393, + "user_chars": 21491, + "tokens_in_estimate": 5471 +} +``` + +### System Prompt +```text +Ты объясняешь документацию системы. + +На вход приходит JSON с полями: +- question +- intent +- sub_intent +- documents +- facts +- relations + +Правила: +- Используй только предоставленные факты +- Не додумывай +- Если данных недостаточно, скажи это явно +- Объясняй структурировано + +Формат ответа: +1. Краткое описание +2. Основные элементы +3. Как это работает +4. Связи с другими частями системы (если есть) +``` + +### User Prompt +```json +{ + "question": "Как устроен RuntimeManager?", + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "COMPONENT_EXPLAIN", + "documents": [ + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "HTTP API /actions/{action}", + "content": "Endpoint `/actions/{action}` управляет control actions runtime и поддерживает `start`, `stop` и `status`. Для долгих операций `start` и `stop` допускается ответ HTTP 202, если действие еще выполняется. Endpoint используется для operator-driven управления жизненным циклом worker'а через HTTP API.", + "metadata": { + "name": "control_actions_endpoint", + "tags": [ + "api", + "control-plane", + "lifecycle" + ], + "type": "api_method", + "layer": "application", + "links": [ + { + "type": "part_of", + "target": "architecture.telegram_notify_app" + }, + { + "type": "related_api", + "target": "api.health_endpoint" + }, + { + "type": "related_logic", + "target": "logic.telegram_notification_loop" + } + ], + "owner": null, + "title": "HTTP API /actions/{action}", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "architecture.telegram_notify_app", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "children": [], + "doc_kind": "misc", + "entities": [ + "TelegramControlChannel", + "ControlActionSet", + "JSONResponse" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "api.control_actions_endpoint", + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "summary_text": "Endpoint `/actions/{action}` управляет control actions runtime и поддерживает `start`, `stop` и `status`. Для долгих операций `start` и `stop` допускается ответ HTTP 202, если действие еще выполняется. Endpoint используется для operator-driven управления жизненным циклом worker'а через HTTP API.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/architecture/telegram-notify-app-overview.md", + "title": "Архитектура Telegram Notify App", + "content": "`test_echo_app` — сервис на базе PLBA runtime, который поднимает HTTP control plane и запускает фоновый воркер для периодической отправки уведомлений в Telegram. Приложение использует YAML-конфиг для runtime-настроек и переменные окружения для Telegram credentials. Основной контур системы состоит из runtime manager, control channel, send service и worker loop.", + "metadata": { + "name": "telegram_notify_app_overview", + "tags": [ + "architecture", + "telegram", + "plba", + "runtime" + ], + "type": "architecture_overview", + "layer": "system", + "links": [ + { + "type": "related_api", + "target": "api.health_endpoint" + }, + { + "type": "related_api", + "target": "api.control_actions_endpoint" + }, + { + "type": "related_api", + "target": "api.send_message_endpoint" + }, + { + "type": "depends_on", + "target": "logic.telegram_notification_loop" + }, + { + "type": "depends_on", + "target": "domain.runtime_health" + } + ], + "owner": null, + "title": "Архитектура Telegram Notify App", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "docs_root", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "8b1cc9f823e55bddbc825466d10a0fdb4ca4354ac02d91f9e2aef7b7d2ec8256", + "children": [ + "api.health_endpoint", + "api.control_actions_endpoint", + "api.send_message_endpoint", + "logic.telegram_notification_loop", + "domain.runtime_health" + ], + "doc_kind": "spec", + "entities": [ + "TelegramNotifyModule", + "TelegramNotifyWorker", + "TelegramControlChannel", + "TelegramSendService", + "RuntimeManager" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "architecture.telegram_notify_app", + "source_path": "docs/documentation/architecture/telegram-notify-app-overview.md", + "summary_text": "`test_echo_app` — сервис на базе PLBA runtime, который поднимает HTTP control plane и запускает фоновый воркер для периодической отправки уведомлений в Telegram. Приложение использует YAML-конфиг для runtime-настроек и переменные окружения для Telegram credentials. Основной контур системы состоит из runtime manager, control channel, send service и worker loop.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/README.md", + "title": "Readme", + "content": "Readme", + "metadata": { + "name": "", + "tags": [], + "type": "", + "layer": "", + "links": [], + "owner": null, + "title": "Readme", + "doc_id": null, + "module": "", + "parent": null, + "status": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "81d952f1a6ea85b76f75e0e57f33b8fa4b2bf3cb7db11b91b90171aeedd655a6", + "children": [], + "doc_kind": "readme", + "entities": [], + "updated_at": null, + "doc_version": null, + "document_id": "docs/README.md", + "source_path": "docs/README.md", + "summary_text": "", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/domain/runtime-health-entity.md", + "title": "Сущность runtime health", + "content": "`runtime health` — доменная модель наблюдаемости сервиса, которая описывает общее состояние runtime и состояние отдельных компонентов. Для `test_echo_app` главным объектом наблюдения является компонент `telegram_notify`, у которого важны статус, время старта и количество успешных отправок. Эта модель используется для внешнего health-monitoring и внутренней диагностики.", + "metadata": { + "name": "runtime_health", + "tags": [ + "domain", + "health", + "observability" + ], + "type": "domain_entity", + "layer": "domain", + "links": [ + { + "type": "part_of", + "target": "architecture.telegram_notify_app" + }, + { + "type": "used_by", + "target": "api.health_endpoint" + }, + { + "type": "related_logic", + "target": "logic.telegram_notification_loop" + } + ], + "owner": null, + "title": "Сущность runtime health", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "architecture.telegram_notify_app", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "37d4dcf470ea3de95d59e44786006e369a3ea11bf5dbf4c88877696e9183ee87", + "children": [], + "doc_kind": "misc", + "entities": [ + "WorkerHealth", + "WorkerStatus", + "TelegramNotifyWorker" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "domain.runtime_health", + "source_path": "docs/documentation/domain/runtime-health-entity.md", + "summary_text": "`runtime health` — доменная модель наблюдаемости сервиса, которая описывает общее состояние runtime и состояние отдельных компонентов. Для `test_echo_app` главным объектом наблюдения является компонент `telegram_notify`, у которого важны статус, время старта и количество успешных отправок. Эта модель используется для внешнего health-monitoring и внутренней диагностики.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/logic/telegram-notification-loop.md", + "title": "Цикл отправки уведомлений в Telegram", + "content": "`TelegramNotifyWorker` после старта runtime запускает отдельный поток, сразу делает первую попытку отправки сообщения и затем повторяет отправку через заданный интервал. При ошибках доставки или отсутствии credentials worker не останавливает сервис, а переводит собственное состояние в `degraded`. Этот workflow определяет основной полезный цикл приложения.", + "metadata": { + "name": "telegram_notification_loop", + "tags": [ + "logic", + "telegram", + "worker", + "scheduling" + ], + "type": "logic_block", + "layer": "application", + "links": [ + { + "type": "part_of", + "target": "architecture.telegram_notify_app" + }, + { + "type": "related_api", + "target": "api.send_message_endpoint" + }, + { + "type": "related_api", + "target": "api.control_actions_endpoint" + }, + { + "type": "related_api", + "target": "api.health_endpoint" + } + ], + "owner": null, + "title": "Цикл отправки уведомлений в Telegram", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "architecture.telegram_notify_app", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "0f62f9b4dab261ca4ca34575ff5d84411a22c90b780c52eda388782b94f08470", + "children": [], + "doc_kind": "misc", + "entities": [ + "TelegramNotifyWorker", + "TelegramSendService", + "WorkerHealth", + "WorkerStatus" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "logic.telegram_notification_loop", + "source_path": "docs/documentation/logic/telegram-notification-loop.md", + "summary_text": "`TelegramNotifyWorker` после старта runtime запускает отдельный поток, сразу делает первую попытку отправки сообщения и затем повторяет отправку через заданный интервал. При ошибках доставки или отсутствии credentials worker не останавливает сервис, а переводит собственное состояние в `degraded`. Этот workflow определяет основной полезный цикл приложения.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/api/send-message-endpoint.md", + "title": "HTTP API /send", + "content": "Endpoint `/send` выполняет ручную отправку сообщения в Telegram через `TelegramSendService`. Он используется для операторской проверки доставки и для отправки уведомлений вне периодического worker loop. Endpoint работает поверх тех же credentials и того же delivery path, что и фоновая отправка.", + "metadata": { + "name": "send_message_endpoint", + "tags": [ + "api", + "telegram", + "manual-send" + ], + "type": "api_method", + "layer": "application", + "links": [ + { + "type": "part_of", + "target": "architecture.telegram_notify_app" + }, + { + "type": "depends_on", + "target": "logic.telegram_notification_loop" + } + ], + "owner": null, + "title": "HTTP API /send", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "architecture.telegram_notify_app", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "5fbf2e33510b0676a3a53b957a4569bd3c2c31fb7719546602c573421ccaa32d", + "children": [], + "doc_kind": "misc", + "entities": [ + "TelegramControlAppFactory", + "TelegramSendService", + "TelegramNotifyWorker" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "api.send_message_endpoint", + "source_path": "docs/documentation/api/send-message-endpoint.md", + "summary_text": "Endpoint `/send` выполняет ручную отправку сообщения в Telegram через `TelegramSendService`. Он используется для операторской проверки доставки и для отправки уведомлений вне периодического worker loop. Endpoint работает поверх тех же credentials и того же delivery path, что и фоновая отправка.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + } + ], + "facts": [ + { + "layer": "D2_FACT_INDEX", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "api.control_actions_endpoint:workflow_step", + "content": "api.control_actions_endpoint workflow_step HTTP control plane запущен.", + "metadata": { + "tags": [], + "owner": null, + "anchor": "Сценарий", + "doc_id": null, + "object": "HTTP control plane запущен.", + "fact_id": "b480201013a7e5231146f665773ebc54af37c28135f407c6b758304c74561645", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "predicate": "workflow_step", + "object_ref": null, + "subject_id": "api.control_actions_endpoint", + "doc_version": null, + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D2_FACT_INDEX", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "api.control_actions_endpoint:mentions_entity", + "content": "api.control_actions_endpoint mentions_entity ControlActionSet", + "metadata": { + "tags": [], + "owner": null, + "anchor": "frontmatter.entities", + "doc_id": null, + "object": "ControlActionSet", + "fact_id": "bafb867ffed41c9db637df98d6cd5f6722d7747bbebc6c03e6f0d0caf3b7f9f3", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "predicate": "mentions_entity", + "object_ref": null, + "subject_id": "api.control_actions_endpoint", + "doc_version": null, + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + } + ], + "relations": [ + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "api.control_actions_endpoint:parent", + "content": "api.control_actions_endpoint parent architecture.telegram_notify_app", + "metadata": { + "owner": null, + "anchor": "frontmatter.parent", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "source_id": "api.control_actions_endpoint", + "target_id": "architecture.telegram_notify_app", + "doc_version": null, + "relation_id": "afec31fd062e392dcd9699a92c7ab61fd4b1273c1a2b16702b23d55d8d0c47ac", + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "parent", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "api.control_actions_endpoint:related_api", + "content": "api.control_actions_endpoint related_api api.health_endpoint", + "metadata": { + "owner": null, + "anchor": "frontmatter.links", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "source_id": "api.control_actions_endpoint", + "target_id": "api.health_endpoint", + "doc_version": null, + "relation_id": "711fb2edb82dd222deaba3c91768b18cbbd453009235823282813c6e867dc2c1", + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "related_api", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "api.control_actions_endpoint:related_logic", + "content": "api.control_actions_endpoint related_logic logic.telegram_notification_loop", + "metadata": { + "owner": null, + "anchor": "frontmatter.links", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "source_id": "api.control_actions_endpoint", + "target_id": "logic.telegram_notification_loop", + "doc_version": null, + "relation_id": "eec79f7a02b804337e791ef231784862ae26e0599eb20224790e9d4f085fa9c0", + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "related_logic", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "api.control_actions_endpoint:part_of", + "content": "api.control_actions_endpoint part_of architecture.telegram_notify_app", + "metadata": { + "owner": null, + "anchor": "frontmatter.links", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "source_id": "api.control_actions_endpoint", + "target_id": "architecture.telegram_notify_app", + "doc_version": null, + "relation_id": "5f4909bde905cd3d294ad307074a05e4ae4deefcafe6272cd2d0436e73acb8dd", + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "part_of", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/architecture/telegram-notify-app-overview.md", + "title": "architecture.telegram_notify_app:child", + "content": "architecture.telegram_notify_app child api.control_actions_endpoint", + "metadata": { + "owner": null, + "anchor": "frontmatter.children", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "8b1cc9f823e55bddbc825466d10a0fdb4ca4354ac02d91f9e2aef7b7d2ec8256", + "source_id": "architecture.telegram_notify_app", + "target_id": "api.control_actions_endpoint", + "doc_version": null, + "relation_id": "ae34fe4b3cd2b47632b13b1e32303e842b57948aa21160abe8d9b478995e1d74", + "source_path": "docs/documentation/architecture/telegram-notify-app-overview.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "child", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/architecture/telegram-notify-app-overview.md", + "title": "architecture.telegram_notify_app:related_api", + "content": "architecture.telegram_notify_app related_api api.control_actions_endpoint", + "metadata": { + "owner": null, + "anchor": "frontmatter.links", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "8b1cc9f823e55bddbc825466d10a0fdb4ca4354ac02d91f9e2aef7b7d2ec8256", + "source_id": "architecture.telegram_notify_app", + "target_id": "api.control_actions_endpoint", + "doc_version": null, + "relation_id": "02530527e6e1d1e23316c9d25d0b30658d6c70063eb6e1d732d55c5ba29c9795", + "source_path": "docs/documentation/architecture/telegram-notify-app-overview.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "related_api", + "staleness_score": null, + "system_component": null + } + } + ] +} +``` + +### User Prompt Overview +- question: Как устроен RuntimeManager? +- intent: DOCUMENTATION_EXPLAIN +- sub_intent: COMPONENT_EXPLAIN +- documents: 6 | samples: HTTP API /actions/{action}, Архитектура Telegram Notify App, Readme +- facts: 2 | samples: api.control_actions_endpoint:workflow_step, api.control_actions_endpoint:mentions_entity +- relations: 6 | samples: api.control_actions_endpoint:parent, api.control_actions_endpoint:related_api, api.control_actions_endpoint:related_logic + +## Mismatches +- none \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/docs_router_deterministic/20260326_125615/full_chain_docs_intents_v3-3x_v3-component-runtime-manager-3.json b/tests/pipeline_setup_v3/test_results/docs_router_deterministic/20260326_125615/full_chain_docs_intents_v3-3x_v3-component-runtime-manager-3.json new file mode 100644 index 0000000..ee18af7 --- /dev/null +++ b/tests/pipeline_setup_v3/test_results/docs_router_deterministic/20260326_125615/full_chain_docs_intents_v3-3x_v3-component-runtime-manager-3.json @@ -0,0 +1,92 @@ +{ + "meta": { + "case_id": "v3-component-runtime-manager-3", + "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_03_docs/full_chain_docs_intents_v3-3x.yaml", + "runner": "agent_runtime", + "mode": "pre_llm", + "passed": true, + "mismatches": [], + "actual": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "COMPONENT_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START", + "rag_count": 20, + "llm_answer": "", + "answer_mode": "answered", + "path_scope": [], + "doc_scope": [ + "api.control_actions_endpoint", + "api.actions_endpoint", + "architecture.telegram_notify_app", + "architecture.telegram_notify_app_overview", + "docs/README.md", + "domain.runtime_health", + "logic.telegram_notification_loop", + "api.send_message_endpoint" + ], + "entity_candidates": [ + "RuntimeManager" + ], + "symbol_candidates": [], + "layers": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "filters": { + "doc_type": null + }, + "pipeline_mode": "pre_llm_only", + "gate_decision": "allow", + "prompt_used": "docs_explain_answer", + "llm_mode": "prose", + "degraded_reason": null, + "code_intents_stubbed": true + } + }, + "pipeline_steps": [ + { + "step": "input_query", + "input": { + "query": "Опиши компонент RuntimeManager" + }, + "output": { + "query": "Опиши компонент RuntimeManager" + } + }, + { + "step": "router", + "input": { + "query": "Опиши компонент RuntimeManager" + }, + "output": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "COMPONENT_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START" + } + }, + { + "step": "docs_pipeline", + "input": { + "query": "Опиши компонент RuntimeManager" + }, + "output": { + "answer_mode": "ready", + "prompt_name": "docs_explain_answer", + "llm_request": { + "prompt_name": "docs_explain_answer", + "log_context": "graph.project_qa.docs.answer", + "prompt_stats": { + "system_chars": 393, + "user_chars": 21494, + "tokens_in_estimate": 5472 + } + }, + "degraded_reason": "" + } + } + ] +} \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/docs_router_deterministic/20260326_125615/full_chain_docs_intents_v3-3x_v3-component-runtime-manager-3.md b/tests/pipeline_setup_v3/test_results/docs_router_deterministic/20260326_125615/full_chain_docs_intents_v3-3x_v3-component-runtime-manager-3.md new file mode 100644 index 0000000..f4ab3e8 --- /dev/null +++ b/tests/pipeline_setup_v3/test_results/docs_router_deterministic/20260326_125615/full_chain_docs_intents_v3-3x_v3-component-runtime-manager-3.md @@ -0,0 +1,900 @@ +# v3-component-runtime-manager-3 + +- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_03_docs/full_chain_docs_intents_v3-3x.yaml +- runner: agent_runtime +- mode: pre_llm +- passed: True + +## Query +Опиши компонент RuntimeManager + +## Actual +{ + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "COMPONENT_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START", + "rag_count": 20, + "llm_answer": "", + "answer_mode": "answered", + "path_scope": [], + "doc_scope": [ + "api.control_actions_endpoint", + "api.actions_endpoint", + "architecture.telegram_notify_app", + "architecture.telegram_notify_app_overview", + "docs/README.md", + "domain.runtime_health", + "logic.telegram_notification_loop", + "api.send_message_endpoint" + ], + "entity_candidates": [ + "RuntimeManager" + ], + "symbol_candidates": [], + "layers": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "filters": { + "doc_type": null + }, + "pipeline_mode": "pre_llm_only", + "gate_decision": "allow", + "prompt_used": "docs_explain_answer", + "llm_mode": "prose", + "degraded_reason": null, + "code_intents_stubbed": true +} + +## Pipeline Steps +### input_query +```json +{ + "input": { + "query": "Опиши компонент RuntimeManager" + }, + "output": { + "query": "Опиши компонент RuntimeManager" + } +} +``` + +### router +```json +{ + "input": { + "query": "Опиши компонент RuntimeManager" + }, + "output": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "COMPONENT_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START" + } +} +``` + +### docs_pipeline +```json +{ + "input": { + "query": "Опиши компонент RuntimeManager" + }, + "output": { + "answer_mode": "ready", + "prompt_name": "docs_explain_answer", + "llm_request": { + "prompt_name": "docs_explain_answer", + "log_context": "graph.project_qa.docs.answer", + "prompt_stats": { + "system_chars": 393, + "user_chars": 21494, + "tokens_in_estimate": 5472 + } + }, + "degraded_reason": "" + } +} +``` + +## Diagnostics +{ + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "COMPONENT_EXPLAIN", + "layers_used": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "documents_found": 6, + "facts_found": 2, + "relations_found": 6, + "openapi_fields_extracted": 0, + "missing_required_fields": [], + "openapi_status": { + "has_path": false, + "has_method": false, + "has_request": false, + "has_response": false + }, + "prompt_used": "docs_explain_answer", + "llm_mode": "prose", + "output_valid": true, + "matched_intent_source": "deterministic", + "matched_anchor_type": "component", + "matched_anchor_value": "RuntimeManager", + "exact_anchor_match": false, + "docs_layers_requested": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "docs_layers_with_hits": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "planned_layers": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "executed_layers": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "non_empty_layers": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "layer_diagnostics": { + "D1_DOCUMENT_CATALOG": { + "hits": 6, + "top_ids": [ + "api.control_actions_endpoint", + "architecture.telegram_notify_app", + "docs/README.md", + "domain.runtime_health", + "logic.telegram_notification_loop" + ] + }, + "D2_FACT_INDEX": { + "hits": 8, + "top_ids": [ + "b480201013a7e5231146f665773ebc54af37c28135f407c6b758304c74561645", + "b8e44c3adb74aaa6c91ae8815fa091289e58dd3990a3a1b63e850c62075aea75", + "bafb867ffed41c9db637df98d6cd5f6722d7747bbebc6c03e6f0d0caf3b7f9f3", + "54bbcbac242f1c85ec3280236ed5841998a8a3a548ff16cbf0b5acafbff469e3", + "b6bfad59b3bf00f199b5ef90c1208af19664de700413e7354468a93a4abaaa2f" + ] + }, + "D5_RELATION_GRAPH": { + "hits": 6, + "top_ids": [ + "afec31fd062e392dcd9699a92c7ab61fd4b1273c1a2b16702b23d55d8d0c47ac", + "711fb2edb82dd222deaba3c91768b18cbbd453009235823282813c6e867dc2c1", + "eec79f7a02b804337e791ef231784862ae26e0599eb20224790e9d4f085fa9c0", + "5f4909bde905cd3d294ad307074a05e4ae4deefcafe6272cd2d0436e73acb8dd", + "ae34fe4b3cd2b47632b13b1e32303e842b57948aa21160abe8d9b478995e1d74" + ] + }, + "D0_DOC_CHUNKS": { + "hits": 6, + "top_ids": [ + "api.control_actions_endpoint" + ] + } + }, + "query_entity_candidates": [ + "RuntimeManager" + ], + "resolved_entity_candidates": [], + "query_anchor_candidates": [ + "RuntimeManager" + ], + "resolved_anchor_candidates": [ + "api.control_actions_endpoint", + "docs/documentation/api/control-actions-endpoint.md", + "architecture.telegram_notify_app", + "docs/documentation/architecture/telegram-notify-app-overview.md", + "docs/README.md", + "domain.runtime_health", + "docs/documentation/domain/runtime-health-entity.md", + "logic.telegram_notification_loop", + "docs/documentation/logic/telegram-notification-loop.md", + "api.send_message_endpoint", + "docs/documentation/api/send-message-endpoint.md" + ], + "anchor_candidates": [], + "selected_anchor": null, + "anchor_selection_reason": "", + "anchor_match_type": "", + "doc_ids": [ + "api.control_actions_endpoint", + "api.actions_endpoint", + "architecture.telegram_notify_app", + "architecture.telegram_notify_app_overview", + "docs/README.md", + "domain.runtime_health", + "logic.telegram_notification_loop", + "api.send_message_endpoint" + ], + "doc_paths": [ + "docs/documentation/api/control-actions-endpoint.md", + "docs/documentation/architecture/telegram-notify-app-overview.md", + "docs/README.md", + "docs/documentation/domain/runtime-health-entity.md", + "docs/documentation/logic/telegram-notification-loop.md", + "docs/documentation/api/send-message-endpoint.md" + ], + "doc_titles": [ + "HTTP API /actions/{action}", + "Архитектура Telegram Notify App", + "Readme", + "Сущность runtime health", + "Цикл отправки уведомлений в Telegram", + "HTTP API /send", + "api.control_actions_endpoint:workflow_step", + "api.control_actions_endpoint:mentions_entity", + "api.control_actions_endpoint:parent", + "api.control_actions_endpoint:related_api", + "api.control_actions_endpoint:related_logic", + "api.control_actions_endpoint:part_of", + "architecture.telegram_notify_app:child", + "architecture.telegram_notify_app:related_api", + "api.control_actions_endpoint:Функциональные требования", + "api.control_actions_endpoint:Нефункциональные требования", + "api.control_actions_endpoint:Сценарий", + "api.control_actions_endpoint:Summary", + "api.control_actions_endpoint:Описание", + "api.control_actions_endpoint:Входные параметры" + ], + "relation_hits_count": 6, + "relation_targets": [ + "api.control_actions_endpoint:parent", + "api.control_actions_endpoint:related_api", + "api.control_actions_endpoint:related_logic", + "api.control_actions_endpoint:part_of", + "architecture.telegram_notify_app:child", + "architecture.telegram_notify_app:related_api" + ], + "fallback_doc_hits_count": 12, + "fallback_used": false, + "fact_hits": 2, + "entity_hits": 0, + "evidence_summary": { + "documents": 6, + "facts": 2, + "relations": 6, + "chunks": 6, + "entity_hits": 0, + "openapi_signals": { + "path_found": false, + "method_found": false, + "request_schema": false, + "response_schema": false, + "status_codes": false, + "payload_description": false + } + }, + "gate_decision": "allow", + "gate_decision_reason": "evidence_sufficient", + "gate_missing_requirements": [], + "gate_satisfied_requirements": [ + "retrieval_non_empty" + ], + "openapi_evidence": { + "path_found": false, + "method_found": false, + "request_schema": false, + "response_schema": false, + "status_codes": false, + "payload_description": false + }, + "requested_fragment_type": null, + "fragment_evidence_found": [], + "fragment_missing_requirements": [], + "answer_mode": "ready", + "degrade_reason": null, + "degraded_reason": null, + "code_intents_stubbed": false +} + +## LLM Request +- prompt_name: docs_explain_answer +- log_context: graph.project_qa.docs.answer + +### Prompt Stats +```json +{ + "system_chars": 393, + "user_chars": 21494, + "tokens_in_estimate": 5472 +} +``` + +### System Prompt +```text +Ты объясняешь документацию системы. + +На вход приходит JSON с полями: +- question +- intent +- sub_intent +- documents +- facts +- relations + +Правила: +- Используй только предоставленные факты +- Не додумывай +- Если данных недостаточно, скажи это явно +- Объясняй структурировано + +Формат ответа: +1. Краткое описание +2. Основные элементы +3. Как это работает +4. Связи с другими частями системы (если есть) +``` + +### User Prompt +```json +{ + "question": "Опиши компонент RuntimeManager", + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "COMPONENT_EXPLAIN", + "documents": [ + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "HTTP API /actions/{action}", + "content": "Endpoint `/actions/{action}` управляет control actions runtime и поддерживает `start`, `stop` и `status`. Для долгих операций `start` и `stop` допускается ответ HTTP 202, если действие еще выполняется. Endpoint используется для operator-driven управления жизненным циклом worker'а через HTTP API.", + "metadata": { + "name": "control_actions_endpoint", + "tags": [ + "api", + "control-plane", + "lifecycle" + ], + "type": "api_method", + "layer": "application", + "links": [ + { + "type": "part_of", + "target": "architecture.telegram_notify_app" + }, + { + "type": "related_api", + "target": "api.health_endpoint" + }, + { + "type": "related_logic", + "target": "logic.telegram_notification_loop" + } + ], + "owner": null, + "title": "HTTP API /actions/{action}", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "architecture.telegram_notify_app", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "children": [], + "doc_kind": "misc", + "entities": [ + "TelegramControlChannel", + "ControlActionSet", + "JSONResponse" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "api.control_actions_endpoint", + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "summary_text": "Endpoint `/actions/{action}` управляет control actions runtime и поддерживает `start`, `stop` и `status`. Для долгих операций `start` и `stop` допускается ответ HTTP 202, если действие еще выполняется. Endpoint используется для operator-driven управления жизненным циклом worker'а через HTTP API.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/architecture/telegram-notify-app-overview.md", + "title": "Архитектура Telegram Notify App", + "content": "`test_echo_app` — сервис на базе PLBA runtime, который поднимает HTTP control plane и запускает фоновый воркер для периодической отправки уведомлений в Telegram. Приложение использует YAML-конфиг для runtime-настроек и переменные окружения для Telegram credentials. Основной контур системы состоит из runtime manager, control channel, send service и worker loop.", + "metadata": { + "name": "telegram_notify_app_overview", + "tags": [ + "architecture", + "telegram", + "plba", + "runtime" + ], + "type": "architecture_overview", + "layer": "system", + "links": [ + { + "type": "related_api", + "target": "api.health_endpoint" + }, + { + "type": "related_api", + "target": "api.control_actions_endpoint" + }, + { + "type": "related_api", + "target": "api.send_message_endpoint" + }, + { + "type": "depends_on", + "target": "logic.telegram_notification_loop" + }, + { + "type": "depends_on", + "target": "domain.runtime_health" + } + ], + "owner": null, + "title": "Архитектура Telegram Notify App", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "docs_root", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "8b1cc9f823e55bddbc825466d10a0fdb4ca4354ac02d91f9e2aef7b7d2ec8256", + "children": [ + "api.health_endpoint", + "api.control_actions_endpoint", + "api.send_message_endpoint", + "logic.telegram_notification_loop", + "domain.runtime_health" + ], + "doc_kind": "spec", + "entities": [ + "TelegramNotifyModule", + "TelegramNotifyWorker", + "TelegramControlChannel", + "TelegramSendService", + "RuntimeManager" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "architecture.telegram_notify_app", + "source_path": "docs/documentation/architecture/telegram-notify-app-overview.md", + "summary_text": "`test_echo_app` — сервис на базе PLBA runtime, который поднимает HTTP control plane и запускает фоновый воркер для периодической отправки уведомлений в Telegram. Приложение использует YAML-конфиг для runtime-настроек и переменные окружения для Telegram credentials. Основной контур системы состоит из runtime manager, control channel, send service и worker loop.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/README.md", + "title": "Readme", + "content": "Readme", + "metadata": { + "name": "", + "tags": [], + "type": "", + "layer": "", + "links": [], + "owner": null, + "title": "Readme", + "doc_id": null, + "module": "", + "parent": null, + "status": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "81d952f1a6ea85b76f75e0e57f33b8fa4b2bf3cb7db11b91b90171aeedd655a6", + "children": [], + "doc_kind": "readme", + "entities": [], + "updated_at": null, + "doc_version": null, + "document_id": "docs/README.md", + "source_path": "docs/README.md", + "summary_text": "", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/domain/runtime-health-entity.md", + "title": "Сущность runtime health", + "content": "`runtime health` — доменная модель наблюдаемости сервиса, которая описывает общее состояние runtime и состояние отдельных компонентов. Для `test_echo_app` главным объектом наблюдения является компонент `telegram_notify`, у которого важны статус, время старта и количество успешных отправок. Эта модель используется для внешнего health-monitoring и внутренней диагностики.", + "metadata": { + "name": "runtime_health", + "tags": [ + "domain", + "health", + "observability" + ], + "type": "domain_entity", + "layer": "domain", + "links": [ + { + "type": "part_of", + "target": "architecture.telegram_notify_app" + }, + { + "type": "used_by", + "target": "api.health_endpoint" + }, + { + "type": "related_logic", + "target": "logic.telegram_notification_loop" + } + ], + "owner": null, + "title": "Сущность runtime health", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "architecture.telegram_notify_app", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "37d4dcf470ea3de95d59e44786006e369a3ea11bf5dbf4c88877696e9183ee87", + "children": [], + "doc_kind": "misc", + "entities": [ + "WorkerHealth", + "WorkerStatus", + "TelegramNotifyWorker" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "domain.runtime_health", + "source_path": "docs/documentation/domain/runtime-health-entity.md", + "summary_text": "`runtime health` — доменная модель наблюдаемости сервиса, которая описывает общее состояние runtime и состояние отдельных компонентов. Для `test_echo_app` главным объектом наблюдения является компонент `telegram_notify`, у которого важны статус, время старта и количество успешных отправок. Эта модель используется для внешнего health-monitoring и внутренней диагностики.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/logic/telegram-notification-loop.md", + "title": "Цикл отправки уведомлений в Telegram", + "content": "`TelegramNotifyWorker` после старта runtime запускает отдельный поток, сразу делает первую попытку отправки сообщения и затем повторяет отправку через заданный интервал. При ошибках доставки или отсутствии credentials worker не останавливает сервис, а переводит собственное состояние в `degraded`. Этот workflow определяет основной полезный цикл приложения.", + "metadata": { + "name": "telegram_notification_loop", + "tags": [ + "logic", + "telegram", + "worker", + "scheduling" + ], + "type": "logic_block", + "layer": "application", + "links": [ + { + "type": "part_of", + "target": "architecture.telegram_notify_app" + }, + { + "type": "related_api", + "target": "api.send_message_endpoint" + }, + { + "type": "related_api", + "target": "api.control_actions_endpoint" + }, + { + "type": "related_api", + "target": "api.health_endpoint" + } + ], + "owner": null, + "title": "Цикл отправки уведомлений в Telegram", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "architecture.telegram_notify_app", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "0f62f9b4dab261ca4ca34575ff5d84411a22c90b780c52eda388782b94f08470", + "children": [], + "doc_kind": "misc", + "entities": [ + "TelegramNotifyWorker", + "TelegramSendService", + "WorkerHealth", + "WorkerStatus" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "logic.telegram_notification_loop", + "source_path": "docs/documentation/logic/telegram-notification-loop.md", + "summary_text": "`TelegramNotifyWorker` после старта runtime запускает отдельный поток, сразу делает первую попытку отправки сообщения и затем повторяет отправку через заданный интервал. При ошибках доставки или отсутствии credentials worker не останавливает сервис, а переводит собственное состояние в `degraded`. Этот workflow определяет основной полезный цикл приложения.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/api/send-message-endpoint.md", + "title": "HTTP API /send", + "content": "Endpoint `/send` выполняет ручную отправку сообщения в Telegram через `TelegramSendService`. Он используется для операторской проверки доставки и для отправки уведомлений вне периодического worker loop. Endpoint работает поверх тех же credentials и того же delivery path, что и фоновая отправка.", + "metadata": { + "name": "send_message_endpoint", + "tags": [ + "api", + "telegram", + "manual-send" + ], + "type": "api_method", + "layer": "application", + "links": [ + { + "type": "part_of", + "target": "architecture.telegram_notify_app" + }, + { + "type": "depends_on", + "target": "logic.telegram_notification_loop" + } + ], + "owner": null, + "title": "HTTP API /send", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "architecture.telegram_notify_app", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "5fbf2e33510b0676a3a53b957a4569bd3c2c31fb7719546602c573421ccaa32d", + "children": [], + "doc_kind": "misc", + "entities": [ + "TelegramControlAppFactory", + "TelegramSendService", + "TelegramNotifyWorker" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "api.send_message_endpoint", + "source_path": "docs/documentation/api/send-message-endpoint.md", + "summary_text": "Endpoint `/send` выполняет ручную отправку сообщения в Telegram через `TelegramSendService`. Он используется для операторской проверки доставки и для отправки уведомлений вне периодического worker loop. Endpoint работает поверх тех же credentials и того же delivery path, что и фоновая отправка.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + } + ], + "facts": [ + { + "layer": "D2_FACT_INDEX", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "api.control_actions_endpoint:workflow_step", + "content": "api.control_actions_endpoint workflow_step HTTP control plane запущен.", + "metadata": { + "tags": [], + "owner": null, + "anchor": "Сценарий", + "doc_id": null, + "object": "HTTP control plane запущен.", + "fact_id": "b480201013a7e5231146f665773ebc54af37c28135f407c6b758304c74561645", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "predicate": "workflow_step", + "object_ref": null, + "subject_id": "api.control_actions_endpoint", + "doc_version": null, + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D2_FACT_INDEX", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "api.control_actions_endpoint:mentions_entity", + "content": "api.control_actions_endpoint mentions_entity ControlActionSet", + "metadata": { + "tags": [], + "owner": null, + "anchor": "frontmatter.entities", + "doc_id": null, + "object": "ControlActionSet", + "fact_id": "bafb867ffed41c9db637df98d6cd5f6722d7747bbebc6c03e6f0d0caf3b7f9f3", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "predicate": "mentions_entity", + "object_ref": null, + "subject_id": "api.control_actions_endpoint", + "doc_version": null, + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + } + ], + "relations": [ + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "api.control_actions_endpoint:parent", + "content": "api.control_actions_endpoint parent architecture.telegram_notify_app", + "metadata": { + "owner": null, + "anchor": "frontmatter.parent", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "source_id": "api.control_actions_endpoint", + "target_id": "architecture.telegram_notify_app", + "doc_version": null, + "relation_id": "afec31fd062e392dcd9699a92c7ab61fd4b1273c1a2b16702b23d55d8d0c47ac", + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "parent", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "api.control_actions_endpoint:related_api", + "content": "api.control_actions_endpoint related_api api.health_endpoint", + "metadata": { + "owner": null, + "anchor": "frontmatter.links", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "source_id": "api.control_actions_endpoint", + "target_id": "api.health_endpoint", + "doc_version": null, + "relation_id": "711fb2edb82dd222deaba3c91768b18cbbd453009235823282813c6e867dc2c1", + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "related_api", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "api.control_actions_endpoint:related_logic", + "content": "api.control_actions_endpoint related_logic logic.telegram_notification_loop", + "metadata": { + "owner": null, + "anchor": "frontmatter.links", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "source_id": "api.control_actions_endpoint", + "target_id": "logic.telegram_notification_loop", + "doc_version": null, + "relation_id": "eec79f7a02b804337e791ef231784862ae26e0599eb20224790e9d4f085fa9c0", + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "related_logic", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "api.control_actions_endpoint:part_of", + "content": "api.control_actions_endpoint part_of architecture.telegram_notify_app", + "metadata": { + "owner": null, + "anchor": "frontmatter.links", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "source_id": "api.control_actions_endpoint", + "target_id": "architecture.telegram_notify_app", + "doc_version": null, + "relation_id": "5f4909bde905cd3d294ad307074a05e4ae4deefcafe6272cd2d0436e73acb8dd", + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "part_of", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/architecture/telegram-notify-app-overview.md", + "title": "architecture.telegram_notify_app:child", + "content": "architecture.telegram_notify_app child api.control_actions_endpoint", + "metadata": { + "owner": null, + "anchor": "frontmatter.children", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "8b1cc9f823e55bddbc825466d10a0fdb4ca4354ac02d91f9e2aef7b7d2ec8256", + "source_id": "architecture.telegram_notify_app", + "target_id": "api.control_actions_endpoint", + "doc_version": null, + "relation_id": "ae34fe4b3cd2b47632b13b1e32303e842b57948aa21160abe8d9b478995e1d74", + "source_path": "docs/documentation/architecture/telegram-notify-app-overview.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "child", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/architecture/telegram-notify-app-overview.md", + "title": "architecture.telegram_notify_app:related_api", + "content": "architecture.telegram_notify_app related_api api.control_actions_endpoint", + "metadata": { + "owner": null, + "anchor": "frontmatter.links", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "8b1cc9f823e55bddbc825466d10a0fdb4ca4354ac02d91f9e2aef7b7d2ec8256", + "source_id": "architecture.telegram_notify_app", + "target_id": "api.control_actions_endpoint", + "doc_version": null, + "relation_id": "02530527e6e1d1e23316c9d25d0b30658d6c70063eb6e1d732d55c5ba29c9795", + "source_path": "docs/documentation/architecture/telegram-notify-app-overview.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "related_api", + "staleness_score": null, + "system_component": null + } + } + ] +} +``` + +### User Prompt Overview +- question: Опиши компонент RuntimeManager +- intent: DOCUMENTATION_EXPLAIN +- sub_intent: COMPONENT_EXPLAIN +- documents: 6 | samples: HTTP API /actions/{action}, Архитектура Telegram Notify App, Readme +- facts: 2 | samples: api.control_actions_endpoint:workflow_step, api.control_actions_endpoint:mentions_entity +- relations: 6 | samples: api.control_actions_endpoint:parent, api.control_actions_endpoint:related_api, api.control_actions_endpoint:related_logic + +## Mismatches +- none \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/docs_router_deterministic/20260326_125615/full_chain_docs_intents_v3-3x_v3-entity-runtime-health-1.json b/tests/pipeline_setup_v3/test_results/docs_router_deterministic/20260326_125615/full_chain_docs_intents_v3-3x_v3-entity-runtime-health-1.json new file mode 100644 index 0000000..0e3f50c --- /dev/null +++ b/tests/pipeline_setup_v3/test_results/docs_router_deterministic/20260326_125615/full_chain_docs_intents_v3-3x_v3-entity-runtime-health-1.json @@ -0,0 +1,92 @@ +{ + "meta": { + "case_id": "v3-entity-runtime-health-1", + "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_03_docs/full_chain_docs_intents_v3-3x.yaml", + "runner": "agent_runtime", + "mode": "pre_llm", + "passed": true, + "mismatches": [], + "actual": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "ENTITY_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START", + "rag_count": 26, + "llm_answer": "", + "answer_mode": "answered", + "path_scope": [], + "doc_scope": [ + "api.health_endpoint", + "architecture.telegram_notify_app", + "architecture.telegram_notify_app_overview", + "domain.runtime_health", + "logic.telegram_notification_loop", + "api.control_actions_endpoint", + "api.actions_endpoint", + "api.send_message_endpoint" + ], + "entity_candidates": [ + "runtime health" + ], + "symbol_candidates": [], + "layers": [ + "D3_ENTITY_CATALOG", + "D1_DOCUMENT_CATALOG", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "filters": { + "doc_type": null + }, + "pipeline_mode": "pre_llm_only", + "gate_decision": "allow", + "prompt_used": "docs_explain_answer", + "llm_mode": "prose", + "degraded_reason": null, + "code_intents_stubbed": true + } + }, + "pipeline_steps": [ + { + "step": "input_query", + "input": { + "query": "Что такое runtime health?" + }, + "output": { + "query": "Что такое runtime health?" + } + }, + { + "step": "router", + "input": { + "query": "Что такое runtime health?" + }, + "output": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "ENTITY_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START" + } + }, + { + "step": "docs_pipeline", + "input": { + "query": "Что такое runtime health?" + }, + "output": { + "answer_mode": "ready", + "prompt_name": "docs_explain_answer", + "llm_request": { + "prompt_name": "docs_explain_answer", + "log_context": "graph.project_qa.docs.answer", + "prompt_stats": { + "system_chars": 393, + "user_chars": 20267, + "tokens_in_estimate": 5165 + } + }, + "degraded_reason": "" + } + } + ] +} \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/docs_router_deterministic/20260326_125615/full_chain_docs_intents_v3-3x_v3-entity-runtime-health-1.md b/tests/pipeline_setup_v3/test_results/docs_router_deterministic/20260326_125615/full_chain_docs_intents_v3-3x_v3-entity-runtime-health-1.md new file mode 100644 index 0000000..e5fbb9e --- /dev/null +++ b/tests/pipeline_setup_v3/test_results/docs_router_deterministic/20260326_125615/full_chain_docs_intents_v3-3x_v3-entity-runtime-health-1.md @@ -0,0 +1,865 @@ +# v3-entity-runtime-health-1 + +- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_03_docs/full_chain_docs_intents_v3-3x.yaml +- runner: agent_runtime +- mode: pre_llm +- passed: True + +## Query +Что такое runtime health? + +## Actual +{ + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "ENTITY_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START", + "rag_count": 26, + "llm_answer": "", + "answer_mode": "answered", + "path_scope": [], + "doc_scope": [ + "api.health_endpoint", + "architecture.telegram_notify_app", + "architecture.telegram_notify_app_overview", + "domain.runtime_health", + "logic.telegram_notification_loop", + "api.control_actions_endpoint", + "api.actions_endpoint", + "api.send_message_endpoint" + ], + "entity_candidates": [ + "runtime health" + ], + "symbol_candidates": [], + "layers": [ + "D3_ENTITY_CATALOG", + "D1_DOCUMENT_CATALOG", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "filters": { + "doc_type": null + }, + "pipeline_mode": "pre_llm_only", + "gate_decision": "allow", + "prompt_used": "docs_explain_answer", + "llm_mode": "prose", + "degraded_reason": null, + "code_intents_stubbed": true +} + +## Pipeline Steps +### input_query +```json +{ + "input": { + "query": "Что такое runtime health?" + }, + "output": { + "query": "Что такое runtime health?" + } +} +``` + +### router +```json +{ + "input": { + "query": "Что такое runtime health?" + }, + "output": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "ENTITY_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START" + } +} +``` + +### docs_pipeline +```json +{ + "input": { + "query": "Что такое runtime health?" + }, + "output": { + "answer_mode": "ready", + "prompt_name": "docs_explain_answer", + "llm_request": { + "prompt_name": "docs_explain_answer", + "log_context": "graph.project_qa.docs.answer", + "prompt_stats": { + "system_chars": 393, + "user_chars": 20267, + "tokens_in_estimate": 5165 + } + }, + "degraded_reason": "" + } +} +``` + +## Diagnostics +{ + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "ENTITY_EXPLAIN", + "layers_used": [ + "D3_ENTITY_CATALOG", + "D1_DOCUMENT_CATALOG", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "documents_found": 6, + "facts_found": 0, + "relations_found": 6, + "openapi_fields_extracted": 0, + "missing_required_fields": [], + "openapi_status": { + "has_path": false, + "has_method": false, + "has_request": false, + "has_response": false + }, + "prompt_used": "docs_explain_answer", + "llm_mode": "prose", + "output_valid": true, + "matched_intent_source": "deterministic", + "matched_anchor_type": "none", + "matched_anchor_value": null, + "exact_anchor_match": false, + "docs_layers_requested": [ + "D3_ENTITY_CATALOG", + "D1_DOCUMENT_CATALOG", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "docs_layers_with_hits": [ + "D3_ENTITY_CATALOG", + "D1_DOCUMENT_CATALOG", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "planned_layers": [ + "D3_ENTITY_CATALOG", + "D1_DOCUMENT_CATALOG", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "executed_layers": [ + "D3_ENTITY_CATALOG", + "D1_DOCUMENT_CATALOG", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "non_empty_layers": [ + "D3_ENTITY_CATALOG", + "D1_DOCUMENT_CATALOG", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "layer_diagnostics": { + "D3_ENTITY_CATALOG": { + "hits": 8, + "top_ids": [ + "api.health_endpoint", + "architecture.telegram_notify_app", + "domain.runtime_health" + ] + }, + "D1_DOCUMENT_CATALOG": { + "hits": 6, + "top_ids": [ + "domain.runtime_health", + "api.health_endpoint", + "logic.telegram_notification_loop", + "api.control_actions_endpoint", + "architecture.telegram_notify_app" + ] + }, + "D5_RELATION_GRAPH": { + "hits": 6, + "top_ids": [ + "79bdb0a74713df6064008179ca8c5c186dc23e4e1c5e2c9607b0bdddeba50f93", + "af2a4f7c1b677b908410ba720915405e10dbd0870e30a3c6e3aa2468550ddf0e", + "77f5d358ab85b3d92018b6b51da7c39773148dfd346686e8832a45370c841160", + "c718b1939621233295ccaf6e8203e7fd94f3dd1bfb88f10c51bc5e33d53a24aa", + "616f5cbf25da83cb51d8d0741a7fc351620c9ca2c6513fa2094b4aa476f0912a" + ] + }, + "D0_DOC_CHUNKS": { + "hits": 6, + "top_ids": [ + "api.health_endpoint" + ] + } + }, + "query_entity_candidates": [ + "runtime health" + ], + "resolved_entity_candidates": [], + "query_anchor_candidates": [], + "resolved_anchor_candidates": [ + "api.health_endpoint", + "docs/documentation/api/health-endpoint.md", + "architecture.telegram_notify_app", + "docs/documentation/architecture/telegram-notify-app-overview.md", + "domain.runtime_health", + "docs/documentation/domain/runtime-health-entity.md", + "logic.telegram_notification_loop", + "docs/documentation/logic/telegram-notification-loop.md", + "api.control_actions_endpoint", + "docs/documentation/api/control-actions-endpoint.md", + "api.send_message_endpoint", + "docs/documentation/api/send-message-endpoint.md" + ], + "anchor_candidates": [], + "selected_anchor": null, + "anchor_selection_reason": "", + "anchor_match_type": "", + "doc_ids": [ + "api.health_endpoint", + "architecture.telegram_notify_app", + "architecture.telegram_notify_app_overview", + "domain.runtime_health", + "logic.telegram_notification_loop", + "api.control_actions_endpoint", + "api.actions_endpoint", + "api.send_message_endpoint" + ], + "doc_paths": [ + "docs/documentation/api/health-endpoint.md", + "docs/documentation/architecture/telegram-notify-app-overview.md", + "docs/documentation/domain/runtime-health-entity.md", + "docs/documentation/logic/telegram-notification-loop.md", + "docs/documentation/api/control-actions-endpoint.md", + "docs/documentation/api/send-message-endpoint.md" + ], + "doc_titles": [ + "RuntimeManager", + "WorkerStatus", + "TelegramNotifyWorker", + "TelegramControlChannel", + "WorkerHealth", + "Сущность runtime health", + "HTTP API /health", + "Цикл отправки уведомлений в Telegram", + "HTTP API /actions/{action}", + "Архитектура Telegram Notify App", + "HTTP API /send", + "domain.runtime_health:parent", + "domain.runtime_health:part_of", + "api.health_endpoint:depends_on", + "api.health_endpoint:parent", + "api.health_endpoint:part_of", + "domain.runtime_health:used_by", + "api.health_endpoint:Сценарий", + "api.health_endpoint:Нефункциональные требования", + "api.health_endpoint:Summary", + "api.health_endpoint:Описание", + "api.health_endpoint:Функциональные требования", + "api.health_endpoint:Входные параметры" + ], + "relation_hits_count": 6, + "relation_targets": [ + "domain.runtime_health:parent", + "domain.runtime_health:part_of", + "api.health_endpoint:depends_on", + "api.health_endpoint:parent", + "api.health_endpoint:part_of", + "domain.runtime_health:used_by" + ], + "fallback_doc_hits_count": 12, + "fallback_used": false, + "fact_hits": 0, + "entity_hits": 0, + "evidence_summary": { + "documents": 6, + "facts": 0, + "relations": 6, + "chunks": 6, + "entity_hits": 0, + "openapi_signals": { + "path_found": false, + "method_found": false, + "request_schema": false, + "response_schema": false, + "status_codes": false, + "payload_description": false + } + }, + "gate_decision": "allow", + "gate_decision_reason": "evidence_sufficient", + "gate_missing_requirements": [], + "gate_satisfied_requirements": [ + "retrieval_non_empty" + ], + "openapi_evidence": { + "path_found": false, + "method_found": false, + "request_schema": false, + "response_schema": false, + "status_codes": false, + "payload_description": false + }, + "requested_fragment_type": null, + "fragment_evidence_found": [], + "fragment_missing_requirements": [], + "answer_mode": "ready", + "degrade_reason": null, + "degraded_reason": null, + "code_intents_stubbed": false +} + +## LLM Request +- prompt_name: docs_explain_answer +- log_context: graph.project_qa.docs.answer + +### Prompt Stats +```json +{ + "system_chars": 393, + "user_chars": 20267, + "tokens_in_estimate": 5165 +} +``` + +### System Prompt +```text +Ты объясняешь документацию системы. + +На вход приходит JSON с полями: +- question +- intent +- sub_intent +- documents +- facts +- relations + +Правила: +- Используй только предоставленные факты +- Не додумывай +- Если данных недостаточно, скажи это явно +- Объясняй структурировано + +Формат ответа: +1. Краткое описание +2. Основные элементы +3. Как это работает +4. Связи с другими частями системы (если есть) +``` + +### User Prompt +```json +{ + "question": "Что такое runtime health?", + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "ENTITY_EXPLAIN", + "documents": [ + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/domain/runtime-health-entity.md", + "title": "Сущность runtime health", + "content": "`runtime health` — доменная модель наблюдаемости сервиса, которая описывает общее состояние runtime и состояние отдельных компонентов. Для `test_echo_app` главным объектом наблюдения является компонент `telegram_notify`, у которого важны статус, время старта и количество успешных отправок. Эта модель используется для внешнего health-monitoring и внутренней диагностики.", + "metadata": { + "name": "runtime_health", + "tags": [ + "domain", + "health", + "observability" + ], + "type": "domain_entity", + "layer": "domain", + "links": [ + { + "type": "part_of", + "target": "architecture.telegram_notify_app" + }, + { + "type": "used_by", + "target": "api.health_endpoint" + }, + { + "type": "related_logic", + "target": "logic.telegram_notification_loop" + } + ], + "owner": null, + "title": "Сущность runtime health", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "architecture.telegram_notify_app", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "37d4dcf470ea3de95d59e44786006e369a3ea11bf5dbf4c88877696e9183ee87", + "children": [], + "doc_kind": "misc", + "entities": [ + "WorkerHealth", + "WorkerStatus", + "TelegramNotifyWorker" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "domain.runtime_health", + "source_path": "docs/documentation/domain/runtime-health-entity.md", + "summary_text": "`runtime health` — доменная модель наблюдаемости сервиса, которая описывает общее состояние runtime и состояние отдельных компонентов. Для `test_echo_app` главным объектом наблюдения является компонент `telegram_notify`, у которого важны статус, время старта и количество успешных отправок. Эта модель используется для внешнего health-monitoring и внутренней диагностики.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/api/health-endpoint.md", + "title": "HTTP API /health", + "content": "Endpoint `/health` возвращает агрегированный health payload runtime. Если общий статус равен `ok`, API отвечает с HTTP 200; для состояний деградации или неготовности возвращается HTTP 503 с тем же payload. Endpoint служит основной точкой внешней проверки состояния приложения.", + "metadata": { + "name": "health_endpoint", + "tags": [ + "api", + "health", + "control-plane" + ], + "type": "api_method", + "layer": "application", + "links": [ + { + "type": "part_of", + "target": "architecture.telegram_notify_app" + }, + { + "type": "depends_on", + "target": "domain.runtime_health" + } + ], + "owner": null, + "title": "HTTP API /health", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "architecture.telegram_notify_app", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "8b5a533a8076e2e9d36995eee29aeade260080bdca2ec8e21fe28f08574b983f", + "children": [], + "doc_kind": "misc", + "entities": [ + "TelegramControlChannel", + "TelegramNotifyWorker", + "RuntimeManager", + "WorkerHealth" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "api.health_endpoint", + "source_path": "docs/documentation/api/health-endpoint.md", + "summary_text": "Endpoint `/health` возвращает агрегированный health payload runtime. Если общий статус равен `ok`, API отвечает с HTTP 200; для состояний деградации или неготовности возвращается HTTP 503 с тем же payload. Endpoint служит основной точкой внешней проверки состояния приложения.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/logic/telegram-notification-loop.md", + "title": "Цикл отправки уведомлений в Telegram", + "content": "`TelegramNotifyWorker` после старта runtime запускает отдельный поток, сразу делает первую попытку отправки сообщения и затем повторяет отправку через заданный интервал. При ошибках доставки или отсутствии credentials worker не останавливает сервис, а переводит собственное состояние в `degraded`. Этот workflow определяет основной полезный цикл приложения.", + "metadata": { + "name": "telegram_notification_loop", + "tags": [ + "logic", + "telegram", + "worker", + "scheduling" + ], + "type": "logic_block", + "layer": "application", + "links": [ + { + "type": "part_of", + "target": "architecture.telegram_notify_app" + }, + { + "type": "related_api", + "target": "api.send_message_endpoint" + }, + { + "type": "related_api", + "target": "api.control_actions_endpoint" + }, + { + "type": "related_api", + "target": "api.health_endpoint" + } + ], + "owner": null, + "title": "Цикл отправки уведомлений в Telegram", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "architecture.telegram_notify_app", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "0f62f9b4dab261ca4ca34575ff5d84411a22c90b780c52eda388782b94f08470", + "children": [], + "doc_kind": "misc", + "entities": [ + "TelegramNotifyWorker", + "TelegramSendService", + "WorkerHealth", + "WorkerStatus" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "logic.telegram_notification_loop", + "source_path": "docs/documentation/logic/telegram-notification-loop.md", + "summary_text": "`TelegramNotifyWorker` после старта runtime запускает отдельный поток, сразу делает первую попытку отправки сообщения и затем повторяет отправку через заданный интервал. При ошибках доставки или отсутствии credentials worker не останавливает сервис, а переводит собственное состояние в `degraded`. Этот workflow определяет основной полезный цикл приложения.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "HTTP API /actions/{action}", + "content": "Endpoint `/actions/{action}` управляет control actions runtime и поддерживает `start`, `stop` и `status`. Для долгих операций `start` и `stop` допускается ответ HTTP 202, если действие еще выполняется. Endpoint используется для operator-driven управления жизненным циклом worker'а через HTTP API.", + "metadata": { + "name": "control_actions_endpoint", + "tags": [ + "api", + "control-plane", + "lifecycle" + ], + "type": "api_method", + "layer": "application", + "links": [ + { + "type": "part_of", + "target": "architecture.telegram_notify_app" + }, + { + "type": "related_api", + "target": "api.health_endpoint" + }, + { + "type": "related_logic", + "target": "logic.telegram_notification_loop" + } + ], + "owner": null, + "title": "HTTP API /actions/{action}", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "architecture.telegram_notify_app", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "children": [], + "doc_kind": "misc", + "entities": [ + "TelegramControlChannel", + "ControlActionSet", + "JSONResponse" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "api.control_actions_endpoint", + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "summary_text": "Endpoint `/actions/{action}` управляет control actions runtime и поддерживает `start`, `stop` и `status`. Для долгих операций `start` и `stop` допускается ответ HTTP 202, если действие еще выполняется. Endpoint используется для operator-driven управления жизненным циклом worker'а через HTTP API.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/architecture/telegram-notify-app-overview.md", + "title": "Архитектура Telegram Notify App", + "content": "`test_echo_app` — сервис на базе PLBA runtime, который поднимает HTTP control plane и запускает фоновый воркер для периодической отправки уведомлений в Telegram. Приложение использует YAML-конфиг для runtime-настроек и переменные окружения для Telegram credentials. Основной контур системы состоит из runtime manager, control channel, send service и worker loop.", + "metadata": { + "name": "telegram_notify_app_overview", + "tags": [ + "architecture", + "telegram", + "plba", + "runtime" + ], + "type": "architecture_overview", + "layer": "system", + "links": [ + { + "type": "related_api", + "target": "api.health_endpoint" + }, + { + "type": "related_api", + "target": "api.control_actions_endpoint" + }, + { + "type": "related_api", + "target": "api.send_message_endpoint" + }, + { + "type": "depends_on", + "target": "logic.telegram_notification_loop" + }, + { + "type": "depends_on", + "target": "domain.runtime_health" + } + ], + "owner": null, + "title": "Архитектура Telegram Notify App", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "docs_root", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "8b1cc9f823e55bddbc825466d10a0fdb4ca4354ac02d91f9e2aef7b7d2ec8256", + "children": [ + "api.health_endpoint", + "api.control_actions_endpoint", + "api.send_message_endpoint", + "logic.telegram_notification_loop", + "domain.runtime_health" + ], + "doc_kind": "spec", + "entities": [ + "TelegramNotifyModule", + "TelegramNotifyWorker", + "TelegramControlChannel", + "TelegramSendService", + "RuntimeManager" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "architecture.telegram_notify_app", + "source_path": "docs/documentation/architecture/telegram-notify-app-overview.md", + "summary_text": "`test_echo_app` — сервис на базе PLBA runtime, который поднимает HTTP control plane и запускает фоновый воркер для периодической отправки уведомлений в Telegram. Приложение использует YAML-конфиг для runtime-настроек и переменные окружения для Telegram credentials. Основной контур системы состоит из runtime manager, control channel, send service и worker loop.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/api/send-message-endpoint.md", + "title": "HTTP API /send", + "content": "Endpoint `/send` выполняет ручную отправку сообщения в Telegram через `TelegramSendService`. Он используется для операторской проверки доставки и для отправки уведомлений вне периодического worker loop. Endpoint работает поверх тех же credentials и того же delivery path, что и фоновая отправка.", + "metadata": { + "name": "send_message_endpoint", + "tags": [ + "api", + "telegram", + "manual-send" + ], + "type": "api_method", + "layer": "application", + "links": [ + { + "type": "part_of", + "target": "architecture.telegram_notify_app" + }, + { + "type": "depends_on", + "target": "logic.telegram_notification_loop" + } + ], + "owner": null, + "title": "HTTP API /send", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "architecture.telegram_notify_app", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "5fbf2e33510b0676a3a53b957a4569bd3c2c31fb7719546602c573421ccaa32d", + "children": [], + "doc_kind": "misc", + "entities": [ + "TelegramControlAppFactory", + "TelegramSendService", + "TelegramNotifyWorker" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "api.send_message_endpoint", + "source_path": "docs/documentation/api/send-message-endpoint.md", + "summary_text": "Endpoint `/send` выполняет ручную отправку сообщения в Telegram через `TelegramSendService`. Он используется для операторской проверки доставки и для отправки уведомлений вне периодического worker loop. Endpoint работает поверх тех же credentials и того же delivery path, что и фоновая отправка.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + } + ], + "facts": [], + "relations": [ + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/domain/runtime-health-entity.md", + "title": "domain.runtime_health:parent", + "content": "domain.runtime_health parent architecture.telegram_notify_app", + "metadata": { + "owner": null, + "anchor": "frontmatter.parent", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "37d4dcf470ea3de95d59e44786006e369a3ea11bf5dbf4c88877696e9183ee87", + "source_id": "domain.runtime_health", + "target_id": "architecture.telegram_notify_app", + "doc_version": null, + "relation_id": "79bdb0a74713df6064008179ca8c5c186dc23e4e1c5e2c9607b0bdddeba50f93", + "source_path": "docs/documentation/domain/runtime-health-entity.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "parent", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/domain/runtime-health-entity.md", + "title": "domain.runtime_health:part_of", + "content": "domain.runtime_health part_of architecture.telegram_notify_app", + "metadata": { + "owner": null, + "anchor": "frontmatter.links", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "37d4dcf470ea3de95d59e44786006e369a3ea11bf5dbf4c88877696e9183ee87", + "source_id": "domain.runtime_health", + "target_id": "architecture.telegram_notify_app", + "doc_version": null, + "relation_id": "af2a4f7c1b677b908410ba720915405e10dbd0870e30a3c6e3aa2468550ddf0e", + "source_path": "docs/documentation/domain/runtime-health-entity.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "part_of", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/api/health-endpoint.md", + "title": "api.health_endpoint:depends_on", + "content": "api.health_endpoint depends_on domain.runtime_health", + "metadata": { + "owner": null, + "anchor": "frontmatter.links", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "8b5a533a8076e2e9d36995eee29aeade260080bdca2ec8e21fe28f08574b983f", + "source_id": "api.health_endpoint", + "target_id": "domain.runtime_health", + "doc_version": null, + "relation_id": "77f5d358ab85b3d92018b6b51da7c39773148dfd346686e8832a45370c841160", + "source_path": "docs/documentation/api/health-endpoint.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "depends_on", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/api/health-endpoint.md", + "title": "api.health_endpoint:parent", + "content": "api.health_endpoint parent architecture.telegram_notify_app", + "metadata": { + "owner": null, + "anchor": "frontmatter.parent", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "8b5a533a8076e2e9d36995eee29aeade260080bdca2ec8e21fe28f08574b983f", + "source_id": "api.health_endpoint", + "target_id": "architecture.telegram_notify_app", + "doc_version": null, + "relation_id": "c718b1939621233295ccaf6e8203e7fd94f3dd1bfb88f10c51bc5e33d53a24aa", + "source_path": "docs/documentation/api/health-endpoint.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "parent", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/api/health-endpoint.md", + "title": "api.health_endpoint:part_of", + "content": "api.health_endpoint part_of architecture.telegram_notify_app", + "metadata": { + "owner": null, + "anchor": "frontmatter.links", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "8b5a533a8076e2e9d36995eee29aeade260080bdca2ec8e21fe28f08574b983f", + "source_id": "api.health_endpoint", + "target_id": "architecture.telegram_notify_app", + "doc_version": null, + "relation_id": "616f5cbf25da83cb51d8d0741a7fc351620c9ca2c6513fa2094b4aa476f0912a", + "source_path": "docs/documentation/api/health-endpoint.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "part_of", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/domain/runtime-health-entity.md", + "title": "domain.runtime_health:used_by", + "content": "domain.runtime_health used_by api.health_endpoint", + "metadata": { + "owner": null, + "anchor": "frontmatter.links", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "37d4dcf470ea3de95d59e44786006e369a3ea11bf5dbf4c88877696e9183ee87", + "source_id": "domain.runtime_health", + "target_id": "api.health_endpoint", + "doc_version": null, + "relation_id": "801650f8bcbfbfbefd35c14447bfef7b3c3827313db790efa7faf47db860f8c4", + "source_path": "docs/documentation/domain/runtime-health-entity.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "used_by", + "staleness_score": null, + "system_component": null + } + } + ] +} +``` + +### User Prompt Overview +- question: Что такое runtime health? +- intent: DOCUMENTATION_EXPLAIN +- sub_intent: ENTITY_EXPLAIN +- documents: 6 | samples: Сущность runtime health, HTTP API /health, Цикл отправки уведомлений в Telegram +- facts: 0 +- relations: 6 | samples: domain.runtime_health:parent, domain.runtime_health:part_of, api.health_endpoint:depends_on + +## Mismatches +- none \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/docs_router_deterministic/20260326_125615/full_chain_docs_intents_v3-3x_v3-entity-runtime-health-2.json b/tests/pipeline_setup_v3/test_results/docs_router_deterministic/20260326_125615/full_chain_docs_intents_v3-3x_v3-entity-runtime-health-2.json new file mode 100644 index 0000000..78f1b47 --- /dev/null +++ b/tests/pipeline_setup_v3/test_results/docs_router_deterministic/20260326_125615/full_chain_docs_intents_v3-3x_v3-entity-runtime-health-2.json @@ -0,0 +1,89 @@ +{ + "meta": { + "case_id": "v3-entity-runtime-health-2", + "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_03_docs/full_chain_docs_intents_v3-3x.yaml", + "runner": "agent_runtime", + "mode": "pre_llm", + "passed": false, + "mismatches": [ + "sub_intent: expected ENTITY_EXPLAIN, got GENERIC_QA" + ], + "actual": { + "intent": "GENERAL_QA", + "sub_intent": "GENERIC_QA", + "graph_id": "DocsQAGraph", + "conversation_mode": "START", + "rag_count": 12, + "llm_answer": "", + "answer_mode": "answered", + "path_scope": [], + "doc_scope": [ + "domain.runtime_health", + "api.health_endpoint", + "logic.telegram_notification_loop", + "api.control_actions_endpoint", + "api.actions_endpoint" + ], + "entity_candidates": [ + "runtime health" + ], + "symbol_candidates": [], + "layers": [ + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "filters": { + "doc_type": null + }, + "pipeline_mode": "pre_llm_only", + "gate_decision": "allow", + "prompt_used": "docs_general_answer", + "llm_mode": "prose", + "degraded_reason": null, + "code_intents_stubbed": true + } + }, + "pipeline_steps": [ + { + "step": "input_query", + "input": { + "query": "Объясни runtime health" + }, + "output": { + "query": "Объясни runtime health" + } + }, + { + "step": "router", + "input": { + "query": "Объясни runtime health" + }, + "output": { + "intent": "GENERAL_QA", + "sub_intent": "GENERIC_QA", + "graph_id": "DocsQAGraph", + "conversation_mode": "START" + } + }, + { + "step": "docs_pipeline", + "input": { + "query": "Объясни runtime health" + }, + "output": { + "answer_mode": "ready", + "prompt_name": "docs_general_answer", + "llm_request": { + "prompt_name": "docs_general_answer", + "log_context": "graph.project_qa.docs.answer", + "prompt_stats": { + "system_chars": 345, + "user_chars": 9449, + "tokens_in_estimate": 2449 + } + }, + "degraded_reason": "" + } + } + ] +} \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/docs_router_deterministic/20260326_125615/full_chain_docs_intents_v3-3x_v3-entity-runtime-health-2.md b/tests/pipeline_setup_v3/test_results/docs_router_deterministic/20260326_125615/full_chain_docs_intents_v3-3x_v3-entity-runtime-health-2.md new file mode 100644 index 0000000..a9093b9 --- /dev/null +++ b/tests/pipeline_setup_v3/test_results/docs_router_deterministic/20260326_125615/full_chain_docs_intents_v3-3x_v3-entity-runtime-health-2.md @@ -0,0 +1,528 @@ +# v3-entity-runtime-health-2 + +- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_03_docs/full_chain_docs_intents_v3-3x.yaml +- runner: agent_runtime +- mode: pre_llm +- passed: False + +## Query +Объясни runtime health + +## Actual +{ + "intent": "GENERAL_QA", + "sub_intent": "GENERIC_QA", + "graph_id": "DocsQAGraph", + "conversation_mode": "START", + "rag_count": 12, + "llm_answer": "", + "answer_mode": "answered", + "path_scope": [], + "doc_scope": [ + "domain.runtime_health", + "api.health_endpoint", + "logic.telegram_notification_loop", + "api.control_actions_endpoint", + "api.actions_endpoint" + ], + "entity_candidates": [ + "runtime health" + ], + "symbol_candidates": [], + "layers": [ + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "filters": { + "doc_type": null + }, + "pipeline_mode": "pre_llm_only", + "gate_decision": "allow", + "prompt_used": "docs_general_answer", + "llm_mode": "prose", + "degraded_reason": null, + "code_intents_stubbed": true +} + +## Pipeline Steps +### input_query +```json +{ + "input": { + "query": "Объясни runtime health" + }, + "output": { + "query": "Объясни runtime health" + } +} +``` + +### router +```json +{ + "input": { + "query": "Объясни runtime health" + }, + "output": { + "intent": "GENERAL_QA", + "sub_intent": "GENERIC_QA", + "graph_id": "DocsQAGraph", + "conversation_mode": "START" + } +} +``` + +### docs_pipeline +```json +{ + "input": { + "query": "Объясни runtime health" + }, + "output": { + "answer_mode": "ready", + "prompt_name": "docs_general_answer", + "llm_request": { + "prompt_name": "docs_general_answer", + "log_context": "graph.project_qa.docs.answer", + "prompt_stats": { + "system_chars": 345, + "user_chars": 9449, + "tokens_in_estimate": 2449 + } + }, + "degraded_reason": "" + } +} +``` + +## Diagnostics +{ + "intent": "GENERAL_QA", + "sub_intent": "GENERIC_QA", + "layers_used": [ + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "documents_found": 4, + "facts_found": 0, + "relations_found": 0, + "openapi_fields_extracted": 0, + "missing_required_fields": [], + "openapi_status": { + "has_path": false, + "has_method": false, + "has_request": false, + "has_response": false + }, + "prompt_used": "docs_general_answer", + "llm_mode": "prose", + "output_valid": true, + "matched_intent_source": "deterministic", + "matched_anchor_type": "none", + "matched_anchor_value": null, + "exact_anchor_match": false, + "docs_layers_requested": [ + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "docs_layers_with_hits": [ + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "planned_layers": [ + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "executed_layers": [ + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "non_empty_layers": [ + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "layer_diagnostics": { + "D1_DOCUMENT_CATALOG": { + "hits": 4, + "top_ids": [ + "domain.runtime_health", + "api.health_endpoint", + "logic.telegram_notification_loop", + "api.control_actions_endpoint" + ] + }, + "D0_DOC_CHUNKS": { + "hits": 8, + "top_ids": [ + "api.health_endpoint" + ] + } + }, + "query_entity_candidates": [ + "runtime health" + ], + "resolved_entity_candidates": [], + "query_anchor_candidates": [], + "resolved_anchor_candidates": [ + "domain.runtime_health", + "docs/documentation/domain/runtime-health-entity.md", + "api.health_endpoint", + "docs/documentation/api/health-endpoint.md", + "logic.telegram_notification_loop", + "docs/documentation/logic/telegram-notification-loop.md", + "api.control_actions_endpoint", + "docs/documentation/api/control-actions-endpoint.md" + ], + "anchor_candidates": [], + "selected_anchor": null, + "anchor_selection_reason": "", + "anchor_match_type": "", + "doc_ids": [ + "domain.runtime_health", + "api.health_endpoint", + "logic.telegram_notification_loop", + "api.control_actions_endpoint", + "api.actions_endpoint" + ], + "doc_paths": [ + "docs/documentation/domain/runtime-health-entity.md", + "docs/documentation/api/health-endpoint.md", + "docs/documentation/logic/telegram-notification-loop.md", + "docs/documentation/api/control-actions-endpoint.md" + ], + "doc_titles": [ + "Сущность runtime health", + "HTTP API /health", + "Цикл отправки уведомлений в Telegram", + "HTTP API /actions/{action}", + "api.health_endpoint:Функциональные требования", + "api.health_endpoint:Выходные параметры", + "api.health_endpoint:Описание", + "api.health_endpoint:Сценарий", + "api.health_endpoint:Нефункциональные требования", + "api.health_endpoint:Входные параметры", + "api.health_endpoint:Summary", + "api.health_endpoint:Пример ответа" + ], + "relation_hits_count": 0, + "relation_targets": [], + "fallback_doc_hits_count": 12, + "fallback_used": false, + "fact_hits": 0, + "entity_hits": 0, + "evidence_summary": { + "documents": 4, + "facts": 0, + "relations": 0, + "chunks": 8, + "entity_hits": 0, + "openapi_signals": { + "path_found": false, + "method_found": false, + "request_schema": false, + "response_schema": false, + "status_codes": false, + "payload_description": false + } + }, + "gate_decision": "allow", + "gate_decision_reason": "evidence_sufficient", + "gate_missing_requirements": [], + "gate_satisfied_requirements": [ + "retrieval_non_empty" + ], + "openapi_evidence": { + "path_found": false, + "method_found": false, + "request_schema": false, + "response_schema": false, + "status_codes": false, + "payload_description": false + }, + "requested_fragment_type": null, + "fragment_evidence_found": [], + "fragment_missing_requirements": [], + "answer_mode": "ready", + "degrade_reason": null, + "degraded_reason": null, + "code_intents_stubbed": false +} + +## LLM Request +- prompt_name: docs_general_answer +- log_context: graph.project_qa.docs.answer + +### Prompt Stats +```json +{ + "system_chars": 345, + "user_chars": 9449, + "tokens_in_estimate": 2449 +} +``` + +### System Prompt +```text +Ты отвечаешь на общий вопрос по документации проекта. + +На вход приходит JSON с полями: +- question +- intent +- sub_intent +- documents +- facts +- relations + +Правила: +- Используй только предоставленные документы и факты +- Не додумывай отсутствующие детали +- Если данных недостаточно, скажи это прямо +- Дай короткий понятный ответ без лишней структуры +``` + +### User Prompt +```json +{ + "question": "Объясни runtime health", + "intent": "GENERAL_QA", + "sub_intent": "GENERIC_QA", + "documents": [ + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/domain/runtime-health-entity.md", + "title": "Сущность runtime health", + "content": "`runtime health` — доменная модель наблюдаемости сервиса, которая описывает общее состояние runtime и состояние отдельных компонентов. Для `test_echo_app` главным объектом наблюдения является компонент `telegram_notify`, у которого важны статус, время старта и количество успешных отправок. Эта модель используется для внешнего health-monitoring и внутренней диагностики.", + "metadata": { + "name": "runtime_health", + "tags": [ + "domain", + "health", + "observability" + ], + "type": "domain_entity", + "layer": "domain", + "links": [ + { + "type": "part_of", + "target": "architecture.telegram_notify_app" + }, + { + "type": "used_by", + "target": "api.health_endpoint" + }, + { + "type": "related_logic", + "target": "logic.telegram_notification_loop" + } + ], + "owner": null, + "title": "Сущность runtime health", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "architecture.telegram_notify_app", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "37d4dcf470ea3de95d59e44786006e369a3ea11bf5dbf4c88877696e9183ee87", + "children": [], + "doc_kind": "misc", + "entities": [ + "WorkerHealth", + "WorkerStatus", + "TelegramNotifyWorker" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "domain.runtime_health", + "source_path": "docs/documentation/domain/runtime-health-entity.md", + "summary_text": "`runtime health` — доменная модель наблюдаемости сервиса, которая описывает общее состояние runtime и состояние отдельных компонентов. Для `test_echo_app` главным объектом наблюдения является компонент `telegram_notify`, у которого важны статус, время старта и количество успешных отправок. Эта модель используется для внешнего health-monitoring и внутренней диагностики.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/api/health-endpoint.md", + "title": "HTTP API /health", + "content": "Endpoint `/health` возвращает агрегированный health payload runtime. Если общий статус равен `ok`, API отвечает с HTTP 200; для состояний деградации или неготовности возвращается HTTP 503 с тем же payload. Endpoint служит основной точкой внешней проверки состояния приложения.", + "metadata": { + "name": "health_endpoint", + "tags": [ + "api", + "health", + "control-plane" + ], + "type": "api_method", + "layer": "application", + "links": [ + { + "type": "part_of", + "target": "architecture.telegram_notify_app" + }, + { + "type": "depends_on", + "target": "domain.runtime_health" + } + ], + "owner": null, + "title": "HTTP API /health", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "architecture.telegram_notify_app", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "8b5a533a8076e2e9d36995eee29aeade260080bdca2ec8e21fe28f08574b983f", + "children": [], + "doc_kind": "misc", + "entities": [ + "TelegramControlChannel", + "TelegramNotifyWorker", + "RuntimeManager", + "WorkerHealth" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "api.health_endpoint", + "source_path": "docs/documentation/api/health-endpoint.md", + "summary_text": "Endpoint `/health` возвращает агрегированный health payload runtime. Если общий статус равен `ok`, API отвечает с HTTP 200; для состояний деградации или неготовности возвращается HTTP 503 с тем же payload. Endpoint служит основной точкой внешней проверки состояния приложения.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/logic/telegram-notification-loop.md", + "title": "Цикл отправки уведомлений в Telegram", + "content": "`TelegramNotifyWorker` после старта runtime запускает отдельный поток, сразу делает первую попытку отправки сообщения и затем повторяет отправку через заданный интервал. При ошибках доставки или отсутствии credentials worker не останавливает сервис, а переводит собственное состояние в `degraded`. Этот workflow определяет основной полезный цикл приложения.", + "metadata": { + "name": "telegram_notification_loop", + "tags": [ + "logic", + "telegram", + "worker", + "scheduling" + ], + "type": "logic_block", + "layer": "application", + "links": [ + { + "type": "part_of", + "target": "architecture.telegram_notify_app" + }, + { + "type": "related_api", + "target": "api.send_message_endpoint" + }, + { + "type": "related_api", + "target": "api.control_actions_endpoint" + }, + { + "type": "related_api", + "target": "api.health_endpoint" + } + ], + "owner": null, + "title": "Цикл отправки уведомлений в Telegram", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "architecture.telegram_notify_app", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "0f62f9b4dab261ca4ca34575ff5d84411a22c90b780c52eda388782b94f08470", + "children": [], + "doc_kind": "misc", + "entities": [ + "TelegramNotifyWorker", + "TelegramSendService", + "WorkerHealth", + "WorkerStatus" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "logic.telegram_notification_loop", + "source_path": "docs/documentation/logic/telegram-notification-loop.md", + "summary_text": "`TelegramNotifyWorker` после старта runtime запускает отдельный поток, сразу делает первую попытку отправки сообщения и затем повторяет отправку через заданный интервал. При ошибках доставки или отсутствии credentials worker не останавливает сервис, а переводит собственное состояние в `degraded`. Этот workflow определяет основной полезный цикл приложения.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "HTTP API /actions/{action}", + "content": "Endpoint `/actions/{action}` управляет control actions runtime и поддерживает `start`, `stop` и `status`. Для долгих операций `start` и `stop` допускается ответ HTTP 202, если действие еще выполняется. Endpoint используется для operator-driven управления жизненным циклом worker'а через HTTP API.", + "metadata": { + "name": "control_actions_endpoint", + "tags": [ + "api", + "control-plane", + "lifecycle" + ], + "type": "api_method", + "layer": "application", + "links": [ + { + "type": "part_of", + "target": "architecture.telegram_notify_app" + }, + { + "type": "related_api", + "target": "api.health_endpoint" + }, + { + "type": "related_logic", + "target": "logic.telegram_notification_loop" + } + ], + "owner": null, + "title": "HTTP API /actions/{action}", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "architecture.telegram_notify_app", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "children": [], + "doc_kind": "misc", + "entities": [ + "TelegramControlChannel", + "ControlActionSet", + "JSONResponse" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "api.control_actions_endpoint", + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "summary_text": "Endpoint `/actions/{action}` управляет control actions runtime и поддерживает `start`, `stop` и `status`. Для долгих операций `start` и `stop` допускается ответ HTTP 202, если действие еще выполняется. Endpoint используется для operator-driven управления жизненным циклом worker'а через HTTP API.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + } + ], + "facts": [], + "relations": [] +} +``` + +### User Prompt Overview +- question: Объясни runtime health +- intent: GENERAL_QA +- sub_intent: GENERIC_QA +- documents: 4 | samples: Сущность runtime health, HTTP API /health, Цикл отправки уведомлений в Telegram +- facts: 0 +- relations: 0 + +## Mismatches +- sub_intent: expected ENTITY_EXPLAIN, got GENERIC_QA \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/docs_router_deterministic/20260326_125615/full_chain_docs_intents_v3-3x_v3-entity-worker-status-1.json b/tests/pipeline_setup_v3/test_results/docs_router_deterministic/20260326_125615/full_chain_docs_intents_v3-3x_v3-entity-worker-status-1.json new file mode 100644 index 0000000..286122e --- /dev/null +++ b/tests/pipeline_setup_v3/test_results/docs_router_deterministic/20260326_125615/full_chain_docs_intents_v3-3x_v3-entity-worker-status-1.json @@ -0,0 +1,93 @@ +{ + "meta": { + "case_id": "v3-entity-worker-status-1", + "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_03_docs/full_chain_docs_intents_v3-3x.yaml", + "runner": "agent_runtime", + "mode": "pre_llm", + "passed": true, + "mismatches": [], + "actual": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "ENTITY_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START", + "rag_count": 26, + "llm_answer": "", + "answer_mode": "answered", + "path_scope": [], + "doc_scope": [ + "domain.runtime_health", + "logic.telegram_notification_loop", + "api.control_actions_endpoint", + "api.health_endpoint", + "api.send_message_endpoint", + "docs/README.md", + "api.actions_endpoint", + "architecture.telegram_notify_app", + "architecture.telegram_notify_app_overview" + ], + "entity_candidates": [ + "WorkerStatus" + ], + "symbol_candidates": [], + "layers": [ + "D3_ENTITY_CATALOG", + "D1_DOCUMENT_CATALOG", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "filters": { + "doc_type": null + }, + "pipeline_mode": "pre_llm_only", + "gate_decision": "allow", + "prompt_used": "docs_explain_answer", + "llm_mode": "prose", + "degraded_reason": null, + "code_intents_stubbed": true + } + }, + "pipeline_steps": [ + { + "step": "input_query", + "input": { + "query": "Что такое WorkerStatus?" + }, + "output": { + "query": "Что такое WorkerStatus?" + } + }, + { + "step": "router", + "input": { + "query": "Что такое WorkerStatus?" + }, + "output": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "ENTITY_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START" + } + }, + { + "step": "docs_pipeline", + "input": { + "query": "Что такое WorkerStatus?" + }, + "output": { + "answer_mode": "ready", + "prompt_name": "docs_explain_answer", + "llm_request": { + "prompt_name": "docs_explain_answer", + "log_context": "graph.project_qa.docs.answer", + "prompt_stats": { + "system_chars": 393, + "user_chars": 18776, + "tokens_in_estimate": 4793 + } + }, + "degraded_reason": "" + } + } + ] +} \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/docs_router_deterministic/20260326_125615/full_chain_docs_intents_v3-3x_v3-entity-worker-status-1.md b/tests/pipeline_setup_v3/test_results/docs_router_deterministic/20260326_125615/full_chain_docs_intents_v3-3x_v3-entity-worker-status-1.md new file mode 100644 index 0000000..1ca7af5 --- /dev/null +++ b/tests/pipeline_setup_v3/test_results/docs_router_deterministic/20260326_125615/full_chain_docs_intents_v3-3x_v3-entity-worker-status-1.md @@ -0,0 +1,849 @@ +# v3-entity-worker-status-1 + +- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_03_docs/full_chain_docs_intents_v3-3x.yaml +- runner: agent_runtime +- mode: pre_llm +- passed: True + +## Query +Что такое WorkerStatus? + +## Actual +{ + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "ENTITY_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START", + "rag_count": 26, + "llm_answer": "", + "answer_mode": "answered", + "path_scope": [], + "doc_scope": [ + "domain.runtime_health", + "logic.telegram_notification_loop", + "api.control_actions_endpoint", + "api.health_endpoint", + "api.send_message_endpoint", + "docs/README.md", + "api.actions_endpoint", + "architecture.telegram_notify_app", + "architecture.telegram_notify_app_overview" + ], + "entity_candidates": [ + "WorkerStatus" + ], + "symbol_candidates": [], + "layers": [ + "D3_ENTITY_CATALOG", + "D1_DOCUMENT_CATALOG", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "filters": { + "doc_type": null + }, + "pipeline_mode": "pre_llm_only", + "gate_decision": "allow", + "prompt_used": "docs_explain_answer", + "llm_mode": "prose", + "degraded_reason": null, + "code_intents_stubbed": true +} + +## Pipeline Steps +### input_query +```json +{ + "input": { + "query": "Что такое WorkerStatus?" + }, + "output": { + "query": "Что такое WorkerStatus?" + } +} +``` + +### router +```json +{ + "input": { + "query": "Что такое WorkerStatus?" + }, + "output": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "ENTITY_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START" + } +} +``` + +### docs_pipeline +```json +{ + "input": { + "query": "Что такое WorkerStatus?" + }, + "output": { + "answer_mode": "ready", + "prompt_name": "docs_explain_answer", + "llm_request": { + "prompt_name": "docs_explain_answer", + "log_context": "graph.project_qa.docs.answer", + "prompt_stats": { + "system_chars": 393, + "user_chars": 18776, + "tokens_in_estimate": 4793 + } + }, + "degraded_reason": "" + } +} +``` + +## Diagnostics +{ + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "ENTITY_EXPLAIN", + "layers_used": [ + "D3_ENTITY_CATALOG", + "D1_DOCUMENT_CATALOG", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "documents_found": 6, + "facts_found": 0, + "relations_found": 6, + "openapi_fields_extracted": 0, + "missing_required_fields": [], + "openapi_status": { + "has_path": false, + "has_method": false, + "has_request": false, + "has_response": false + }, + "prompt_used": "docs_explain_answer", + "llm_mode": "prose", + "output_valid": true, + "matched_intent_source": "deterministic", + "matched_anchor_type": "none", + "matched_anchor_value": null, + "exact_anchor_match": false, + "docs_layers_requested": [ + "D3_ENTITY_CATALOG", + "D1_DOCUMENT_CATALOG", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "docs_layers_with_hits": [ + "D3_ENTITY_CATALOG", + "D1_DOCUMENT_CATALOG", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "planned_layers": [ + "D3_ENTITY_CATALOG", + "D1_DOCUMENT_CATALOG", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "executed_layers": [ + "D3_ENTITY_CATALOG", + "D1_DOCUMENT_CATALOG", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "non_empty_layers": [ + "D3_ENTITY_CATALOG", + "D1_DOCUMENT_CATALOG", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "layer_diagnostics": { + "D3_ENTITY_CATALOG": { + "hits": 8, + "top_ids": [ + "domain.runtime_health", + "logic.telegram_notification_loop", + "api.control_actions_endpoint", + "api.health_endpoint" + ] + }, + "D1_DOCUMENT_CATALOG": { + "hits": 6, + "top_ids": [ + "docs/README.md", + "api.control_actions_endpoint", + "api.health_endpoint", + "api.send_message_endpoint", + "architecture.telegram_notify_app" + ] + }, + "D5_RELATION_GRAPH": { + "hits": 6, + "top_ids": [ + "5f4909bde905cd3d294ad307074a05e4ae4deefcafe6272cd2d0436e73acb8dd", + "711fb2edb82dd222deaba3c91768b18cbbd453009235823282813c6e867dc2c1", + "eec79f7a02b804337e791ef231784862ae26e0599eb20224790e9d4f085fa9c0", + "c718b1939621233295ccaf6e8203e7fd94f3dd1bfb88f10c51bc5e33d53a24aa", + "616f5cbf25da83cb51d8d0741a7fc351620c9ca2c6513fa2094b4aa476f0912a" + ] + }, + "D0_DOC_CHUNKS": { + "hits": 6, + "top_ids": [ + "logic.telegram_notification_loop", + "docs/README.md", + "api.control_actions_endpoint" + ] + } + }, + "query_entity_candidates": [ + "WorkerStatus" + ], + "resolved_entity_candidates": [], + "query_anchor_candidates": [ + "WorkerStatus" + ], + "resolved_anchor_candidates": [ + "domain.runtime_health", + "docs/documentation/domain/runtime-health-entity.md", + "logic.telegram_notification_loop", + "docs/documentation/logic/telegram-notification-loop.md", + "api.control_actions_endpoint", + "docs/documentation/api/control-actions-endpoint.md", + "api.health_endpoint", + "docs/documentation/api/health-endpoint.md", + "api.send_message_endpoint", + "docs/documentation/api/send-message-endpoint.md", + "docs/README.md", + "architecture.telegram_notify_app", + "docs/documentation/architecture/telegram-notify-app-overview.md" + ], + "anchor_candidates": [], + "selected_anchor": null, + "anchor_selection_reason": "", + "anchor_match_type": "", + "doc_ids": [ + "domain.runtime_health", + "logic.telegram_notification_loop", + "api.control_actions_endpoint", + "api.health_endpoint", + "api.send_message_endpoint", + "docs/README.md", + "api.actions_endpoint", + "architecture.telegram_notify_app", + "architecture.telegram_notify_app_overview" + ], + "doc_paths": [ + "docs/documentation/domain/runtime-health-entity.md", + "docs/documentation/logic/telegram-notification-loop.md", + "docs/documentation/api/control-actions-endpoint.md", + "docs/documentation/api/health-endpoint.md", + "docs/documentation/api/send-message-endpoint.md", + "docs/README.md", + "docs/documentation/architecture/telegram-notify-app-overview.md" + ], + "doc_titles": [ + "WorkerStatus", + "JSONResponse", + "TelegramNotifyWorker", + "RuntimeManager", + "WorkerHealth", + "TelegramControlAppFactory", + "TelegramControlChannel", + "Readme", + "HTTP API /actions/{action}", + "HTTP API /health", + "HTTP API /send", + "Архитектура Telegram Notify App", + "Сущность runtime health", + "api.control_actions_endpoint:part_of", + "api.control_actions_endpoint:related_api", + "api.control_actions_endpoint:related_logic", + "api.health_endpoint:parent", + "api.health_endpoint:part_of", + "api.control_actions_endpoint:parent", + "logic.telegram_notification_loop:Details", + "docs/README.md:Навигация", + "docs/README.md:Правила и шаблоны", + "api.control_actions_endpoint:Summary", + "api.control_actions_endpoint:Описание", + "docs/README.md:Структура" + ], + "relation_hits_count": 6, + "relation_targets": [ + "api.control_actions_endpoint:part_of", + "api.control_actions_endpoint:related_api", + "api.control_actions_endpoint:related_logic", + "api.health_endpoint:parent", + "api.health_endpoint:part_of", + "api.control_actions_endpoint:parent" + ], + "fallback_doc_hits_count": 12, + "fallback_used": false, + "fact_hits": 0, + "entity_hits": 0, + "evidence_summary": { + "documents": 6, + "facts": 0, + "relations": 6, + "chunks": 6, + "entity_hits": 0, + "openapi_signals": { + "path_found": false, + "method_found": false, + "request_schema": false, + "response_schema": false, + "status_codes": false, + "payload_description": false + } + }, + "gate_decision": "allow", + "gate_decision_reason": "evidence_sufficient", + "gate_missing_requirements": [], + "gate_satisfied_requirements": [ + "retrieval_non_empty" + ], + "openapi_evidence": { + "path_found": false, + "method_found": false, + "request_schema": false, + "response_schema": false, + "status_codes": false, + "payload_description": false + }, + "requested_fragment_type": null, + "fragment_evidence_found": [], + "fragment_missing_requirements": [], + "answer_mode": "ready", + "degrade_reason": null, + "degraded_reason": null, + "code_intents_stubbed": false +} + +## LLM Request +- prompt_name: docs_explain_answer +- log_context: graph.project_qa.docs.answer + +### Prompt Stats +```json +{ + "system_chars": 393, + "user_chars": 18776, + "tokens_in_estimate": 4793 +} +``` + +### System Prompt +```text +Ты объясняешь документацию системы. + +На вход приходит JSON с полями: +- question +- intent +- sub_intent +- documents +- facts +- relations + +Правила: +- Используй только предоставленные факты +- Не додумывай +- Если данных недостаточно, скажи это явно +- Объясняй структурировано + +Формат ответа: +1. Краткое описание +2. Основные элементы +3. Как это работает +4. Связи с другими частями системы (если есть) +``` + +### User Prompt +```json +{ + "question": "Что такое WorkerStatus?", + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "ENTITY_EXPLAIN", + "documents": [ + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/README.md", + "title": "Readme", + "content": "Readme", + "metadata": { + "name": "", + "tags": [], + "type": "", + "layer": "", + "links": [], + "owner": null, + "title": "Readme", + "doc_id": null, + "module": "", + "parent": null, + "status": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "81d952f1a6ea85b76f75e0e57f33b8fa4b2bf3cb7db11b91b90171aeedd655a6", + "children": [], + "doc_kind": "readme", + "entities": [], + "updated_at": null, + "doc_version": null, + "document_id": "docs/README.md", + "source_path": "docs/README.md", + "summary_text": "", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "HTTP API /actions/{action}", + "content": "Endpoint `/actions/{action}` управляет control actions runtime и поддерживает `start`, `stop` и `status`. Для долгих операций `start` и `stop` допускается ответ HTTP 202, если действие еще выполняется. Endpoint используется для operator-driven управления жизненным циклом worker'а через HTTP API.", + "metadata": { + "name": "control_actions_endpoint", + "tags": [ + "api", + "control-plane", + "lifecycle" + ], + "type": "api_method", + "layer": "application", + "links": [ + { + "type": "part_of", + "target": "architecture.telegram_notify_app" + }, + { + "type": "related_api", + "target": "api.health_endpoint" + }, + { + "type": "related_logic", + "target": "logic.telegram_notification_loop" + } + ], + "owner": null, + "title": "HTTP API /actions/{action}", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "architecture.telegram_notify_app", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "children": [], + "doc_kind": "misc", + "entities": [ + "TelegramControlChannel", + "ControlActionSet", + "JSONResponse" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "api.control_actions_endpoint", + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "summary_text": "Endpoint `/actions/{action}` управляет control actions runtime и поддерживает `start`, `stop` и `status`. Для долгих операций `start` и `stop` допускается ответ HTTP 202, если действие еще выполняется. Endpoint используется для operator-driven управления жизненным циклом worker'а через HTTP API.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/api/health-endpoint.md", + "title": "HTTP API /health", + "content": "Endpoint `/health` возвращает агрегированный health payload runtime. Если общий статус равен `ok`, API отвечает с HTTP 200; для состояний деградации или неготовности возвращается HTTP 503 с тем же payload. Endpoint служит основной точкой внешней проверки состояния приложения.", + "metadata": { + "name": "health_endpoint", + "tags": [ + "api", + "health", + "control-plane" + ], + "type": "api_method", + "layer": "application", + "links": [ + { + "type": "part_of", + "target": "architecture.telegram_notify_app" + }, + { + "type": "depends_on", + "target": "domain.runtime_health" + } + ], + "owner": null, + "title": "HTTP API /health", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "architecture.telegram_notify_app", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "8b5a533a8076e2e9d36995eee29aeade260080bdca2ec8e21fe28f08574b983f", + "children": [], + "doc_kind": "misc", + "entities": [ + "TelegramControlChannel", + "TelegramNotifyWorker", + "RuntimeManager", + "WorkerHealth" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "api.health_endpoint", + "source_path": "docs/documentation/api/health-endpoint.md", + "summary_text": "Endpoint `/health` возвращает агрегированный health payload runtime. Если общий статус равен `ok`, API отвечает с HTTP 200; для состояний деградации или неготовности возвращается HTTP 503 с тем же payload. Endpoint служит основной точкой внешней проверки состояния приложения.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/api/send-message-endpoint.md", + "title": "HTTP API /send", + "content": "Endpoint `/send` выполняет ручную отправку сообщения в Telegram через `TelegramSendService`. Он используется для операторской проверки доставки и для отправки уведомлений вне периодического worker loop. Endpoint работает поверх тех же credentials и того же delivery path, что и фоновая отправка.", + "metadata": { + "name": "send_message_endpoint", + "tags": [ + "api", + "telegram", + "manual-send" + ], + "type": "api_method", + "layer": "application", + "links": [ + { + "type": "part_of", + "target": "architecture.telegram_notify_app" + }, + { + "type": "depends_on", + "target": "logic.telegram_notification_loop" + } + ], + "owner": null, + "title": "HTTP API /send", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "architecture.telegram_notify_app", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "5fbf2e33510b0676a3a53b957a4569bd3c2c31fb7719546602c573421ccaa32d", + "children": [], + "doc_kind": "misc", + "entities": [ + "TelegramControlAppFactory", + "TelegramSendService", + "TelegramNotifyWorker" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "api.send_message_endpoint", + "source_path": "docs/documentation/api/send-message-endpoint.md", + "summary_text": "Endpoint `/send` выполняет ручную отправку сообщения в Telegram через `TelegramSendService`. Он используется для операторской проверки доставки и для отправки уведомлений вне периодического worker loop. Endpoint работает поверх тех же credentials и того же delivery path, что и фоновая отправка.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/architecture/telegram-notify-app-overview.md", + "title": "Архитектура Telegram Notify App", + "content": "`test_echo_app` — сервис на базе PLBA runtime, который поднимает HTTP control plane и запускает фоновый воркер для периодической отправки уведомлений в Telegram. Приложение использует YAML-конфиг для runtime-настроек и переменные окружения для Telegram credentials. Основной контур системы состоит из runtime manager, control channel, send service и worker loop.", + "metadata": { + "name": "telegram_notify_app_overview", + "tags": [ + "architecture", + "telegram", + "plba", + "runtime" + ], + "type": "architecture_overview", + "layer": "system", + "links": [ + { + "type": "related_api", + "target": "api.health_endpoint" + }, + { + "type": "related_api", + "target": "api.control_actions_endpoint" + }, + { + "type": "related_api", + "target": "api.send_message_endpoint" + }, + { + "type": "depends_on", + "target": "logic.telegram_notification_loop" + }, + { + "type": "depends_on", + "target": "domain.runtime_health" + } + ], + "owner": null, + "title": "Архитектура Telegram Notify App", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "docs_root", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "8b1cc9f823e55bddbc825466d10a0fdb4ca4354ac02d91f9e2aef7b7d2ec8256", + "children": [ + "api.health_endpoint", + "api.control_actions_endpoint", + "api.send_message_endpoint", + "logic.telegram_notification_loop", + "domain.runtime_health" + ], + "doc_kind": "spec", + "entities": [ + "TelegramNotifyModule", + "TelegramNotifyWorker", + "TelegramControlChannel", + "TelegramSendService", + "RuntimeManager" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "architecture.telegram_notify_app", + "source_path": "docs/documentation/architecture/telegram-notify-app-overview.md", + "summary_text": "`test_echo_app` — сервис на базе PLBA runtime, который поднимает HTTP control plane и запускает фоновый воркер для периодической отправки уведомлений в Telegram. Приложение использует YAML-конфиг для runtime-настроек и переменные окружения для Telegram credentials. Основной контур системы состоит из runtime manager, control channel, send service и worker loop.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/domain/runtime-health-entity.md", + "title": "Сущность runtime health", + "content": "`runtime health` — доменная модель наблюдаемости сервиса, которая описывает общее состояние runtime и состояние отдельных компонентов. Для `test_echo_app` главным объектом наблюдения является компонент `telegram_notify`, у которого важны статус, время старта и количество успешных отправок. Эта модель используется для внешнего health-monitoring и внутренней диагностики.", + "metadata": { + "name": "runtime_health", + "tags": [ + "domain", + "health", + "observability" + ], + "type": "domain_entity", + "layer": "domain", + "links": [ + { + "type": "part_of", + "target": "architecture.telegram_notify_app" + }, + { + "type": "used_by", + "target": "api.health_endpoint" + }, + { + "type": "related_logic", + "target": "logic.telegram_notification_loop" + } + ], + "owner": null, + "title": "Сущность runtime health", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "architecture.telegram_notify_app", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "37d4dcf470ea3de95d59e44786006e369a3ea11bf5dbf4c88877696e9183ee87", + "children": [], + "doc_kind": "misc", + "entities": [ + "WorkerHealth", + "WorkerStatus", + "TelegramNotifyWorker" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "domain.runtime_health", + "source_path": "docs/documentation/domain/runtime-health-entity.md", + "summary_text": "`runtime health` — доменная модель наблюдаемости сервиса, которая описывает общее состояние runtime и состояние отдельных компонентов. Для `test_echo_app` главным объектом наблюдения является компонент `telegram_notify`, у которого важны статус, время старта и количество успешных отправок. Эта модель используется для внешнего health-monitoring и внутренней диагностики.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + } + ], + "facts": [], + "relations": [ + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "api.control_actions_endpoint:part_of", + "content": "api.control_actions_endpoint part_of architecture.telegram_notify_app", + "metadata": { + "owner": null, + "anchor": "frontmatter.links", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "source_id": "api.control_actions_endpoint", + "target_id": "architecture.telegram_notify_app", + "doc_version": null, + "relation_id": "5f4909bde905cd3d294ad307074a05e4ae4deefcafe6272cd2d0436e73acb8dd", + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "part_of", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "api.control_actions_endpoint:related_api", + "content": "api.control_actions_endpoint related_api api.health_endpoint", + "metadata": { + "owner": null, + "anchor": "frontmatter.links", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "source_id": "api.control_actions_endpoint", + "target_id": "api.health_endpoint", + "doc_version": null, + "relation_id": "711fb2edb82dd222deaba3c91768b18cbbd453009235823282813c6e867dc2c1", + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "related_api", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "api.control_actions_endpoint:related_logic", + "content": "api.control_actions_endpoint related_logic logic.telegram_notification_loop", + "metadata": { + "owner": null, + "anchor": "frontmatter.links", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "source_id": "api.control_actions_endpoint", + "target_id": "logic.telegram_notification_loop", + "doc_version": null, + "relation_id": "eec79f7a02b804337e791ef231784862ae26e0599eb20224790e9d4f085fa9c0", + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "related_logic", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/api/health-endpoint.md", + "title": "api.health_endpoint:parent", + "content": "api.health_endpoint parent architecture.telegram_notify_app", + "metadata": { + "owner": null, + "anchor": "frontmatter.parent", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "8b5a533a8076e2e9d36995eee29aeade260080bdca2ec8e21fe28f08574b983f", + "source_id": "api.health_endpoint", + "target_id": "architecture.telegram_notify_app", + "doc_version": null, + "relation_id": "c718b1939621233295ccaf6e8203e7fd94f3dd1bfb88f10c51bc5e33d53a24aa", + "source_path": "docs/documentation/api/health-endpoint.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "parent", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/api/health-endpoint.md", + "title": "api.health_endpoint:part_of", + "content": "api.health_endpoint part_of architecture.telegram_notify_app", + "metadata": { + "owner": null, + "anchor": "frontmatter.links", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "8b5a533a8076e2e9d36995eee29aeade260080bdca2ec8e21fe28f08574b983f", + "source_id": "api.health_endpoint", + "target_id": "architecture.telegram_notify_app", + "doc_version": null, + "relation_id": "616f5cbf25da83cb51d8d0741a7fc351620c9ca2c6513fa2094b4aa476f0912a", + "source_path": "docs/documentation/api/health-endpoint.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "part_of", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "api.control_actions_endpoint:parent", + "content": "api.control_actions_endpoint parent architecture.telegram_notify_app", + "metadata": { + "owner": null, + "anchor": "frontmatter.parent", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "source_id": "api.control_actions_endpoint", + "target_id": "architecture.telegram_notify_app", + "doc_version": null, + "relation_id": "afec31fd062e392dcd9699a92c7ab61fd4b1273c1a2b16702b23d55d8d0c47ac", + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "parent", + "staleness_score": null, + "system_component": null + } + } + ] +} +``` + +### User Prompt Overview +- question: Что такое WorkerStatus? +- intent: DOCUMENTATION_EXPLAIN +- sub_intent: ENTITY_EXPLAIN +- documents: 6 | samples: Readme, HTTP API /actions/{action}, HTTP API /health +- facts: 0 +- relations: 6 | samples: api.control_actions_endpoint:part_of, api.control_actions_endpoint:related_api, api.control_actions_endpoint:related_logic + +## Mismatches +- none \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/docs_router_deterministic/20260326_125615/full_chain_docs_intents_v3-3x_v3-entity-worker-status-2.json b/tests/pipeline_setup_v3/test_results/docs_router_deterministic/20260326_125615/full_chain_docs_intents_v3-3x_v3-entity-worker-status-2.json new file mode 100644 index 0000000..a649001 --- /dev/null +++ b/tests/pipeline_setup_v3/test_results/docs_router_deterministic/20260326_125615/full_chain_docs_intents_v3-3x_v3-entity-worker-status-2.json @@ -0,0 +1,87 @@ +{ + "meta": { + "case_id": "v3-entity-worker-status-2", + "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_03_docs/full_chain_docs_intents_v3-3x.yaml", + "runner": "agent_runtime", + "mode": "pre_llm", + "passed": false, + "mismatches": [ + "sub_intent: expected ENTITY_EXPLAIN, got GENERIC_QA" + ], + "actual": { + "intent": "GENERAL_QA", + "sub_intent": "GENERIC_QA", + "graph_id": "DocsQAGraph", + "conversation_mode": "START", + "rag_count": 12, + "llm_answer": "", + "answer_mode": "answered", + "path_scope": [], + "doc_scope": [ + "docs/README.md", + "api.control_actions_endpoint", + "api.actions_endpoint", + "api.health_endpoint", + "api.send_message_endpoint" + ], + "entity_candidates": [], + "symbol_candidates": [], + "layers": [ + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "filters": { + "doc_type": null + }, + "pipeline_mode": "pre_llm_only", + "gate_decision": "allow", + "prompt_used": "docs_general_answer", + "llm_mode": "prose", + "degraded_reason": null, + "code_intents_stubbed": true + } + }, + "pipeline_steps": [ + { + "step": "input_query", + "input": { + "query": "Опиши статус воркера" + }, + "output": { + "query": "Опиши статус воркера" + } + }, + { + "step": "router", + "input": { + "query": "Опиши статус воркера" + }, + "output": { + "intent": "GENERAL_QA", + "sub_intent": "GENERIC_QA", + "graph_id": "DocsQAGraph", + "conversation_mode": "START" + } + }, + { + "step": "docs_pipeline", + "input": { + "query": "Опиши статус воркера" + }, + "output": { + "answer_mode": "ready", + "prompt_name": "docs_general_answer", + "llm_request": { + "prompt_name": "docs_general_answer", + "log_context": "graph.project_qa.docs.answer", + "prompt_stats": { + "system_chars": 345, + "user_chars": 7558, + "tokens_in_estimate": 1976 + } + }, + "degraded_reason": "" + } + } + ] +} \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/docs_router_deterministic/20260326_125615/full_chain_docs_intents_v3-3x_v3-entity-worker-status-2.md b/tests/pipeline_setup_v3/test_results/docs_router_deterministic/20260326_125615/full_chain_docs_intents_v3-3x_v3-entity-worker-status-2.md new file mode 100644 index 0000000..5b1d2be --- /dev/null +++ b/tests/pipeline_setup_v3/test_results/docs_router_deterministic/20260326_125615/full_chain_docs_intents_v3-3x_v3-entity-worker-status-2.md @@ -0,0 +1,493 @@ +# v3-entity-worker-status-2 + +- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_03_docs/full_chain_docs_intents_v3-3x.yaml +- runner: agent_runtime +- mode: pre_llm +- passed: False + +## Query +Опиши статус воркера + +## Actual +{ + "intent": "GENERAL_QA", + "sub_intent": "GENERIC_QA", + "graph_id": "DocsQAGraph", + "conversation_mode": "START", + "rag_count": 12, + "llm_answer": "", + "answer_mode": "answered", + "path_scope": [], + "doc_scope": [ + "docs/README.md", + "api.control_actions_endpoint", + "api.actions_endpoint", + "api.health_endpoint", + "api.send_message_endpoint" + ], + "entity_candidates": [], + "symbol_candidates": [], + "layers": [ + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "filters": { + "doc_type": null + }, + "pipeline_mode": "pre_llm_only", + "gate_decision": "allow", + "prompt_used": "docs_general_answer", + "llm_mode": "prose", + "degraded_reason": null, + "code_intents_stubbed": true +} + +## Pipeline Steps +### input_query +```json +{ + "input": { + "query": "Опиши статус воркера" + }, + "output": { + "query": "Опиши статус воркера" + } +} +``` + +### router +```json +{ + "input": { + "query": "Опиши статус воркера" + }, + "output": { + "intent": "GENERAL_QA", + "sub_intent": "GENERIC_QA", + "graph_id": "DocsQAGraph", + "conversation_mode": "START" + } +} +``` + +### docs_pipeline +```json +{ + "input": { + "query": "Опиши статус воркера" + }, + "output": { + "answer_mode": "ready", + "prompt_name": "docs_general_answer", + "llm_request": { + "prompt_name": "docs_general_answer", + "log_context": "graph.project_qa.docs.answer", + "prompt_stats": { + "system_chars": 345, + "user_chars": 7558, + "tokens_in_estimate": 1976 + } + }, + "degraded_reason": "" + } +} +``` + +## Diagnostics +{ + "intent": "GENERAL_QA", + "sub_intent": "GENERIC_QA", + "layers_used": [ + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "documents_found": 4, + "facts_found": 0, + "relations_found": 0, + "openapi_fields_extracted": 0, + "missing_required_fields": [], + "openapi_status": { + "has_path": false, + "has_method": false, + "has_request": false, + "has_response": false + }, + "prompt_used": "docs_general_answer", + "llm_mode": "prose", + "output_valid": true, + "matched_intent_source": "deterministic", + "matched_anchor_type": "none", + "matched_anchor_value": null, + "exact_anchor_match": false, + "docs_layers_requested": [ + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "docs_layers_with_hits": [ + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "planned_layers": [ + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "executed_layers": [ + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "non_empty_layers": [ + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "layer_diagnostics": { + "D1_DOCUMENT_CATALOG": { + "hits": 4, + "top_ids": [ + "docs/README.md", + "api.control_actions_endpoint", + "api.health_endpoint", + "api.send_message_endpoint" + ] + }, + "D0_DOC_CHUNKS": { + "hits": 8, + "top_ids": [ + "docs/README.md", + "api.control_actions_endpoint" + ] + } + }, + "query_entity_candidates": [], + "resolved_entity_candidates": [], + "query_anchor_candidates": [], + "resolved_anchor_candidates": [ + "docs/README.md", + "api.control_actions_endpoint", + "docs/documentation/api/control-actions-endpoint.md", + "api.health_endpoint", + "docs/documentation/api/health-endpoint.md", + "api.send_message_endpoint", + "docs/documentation/api/send-message-endpoint.md" + ], + "anchor_candidates": [], + "selected_anchor": null, + "anchor_selection_reason": "", + "anchor_match_type": "", + "doc_ids": [ + "docs/README.md", + "api.control_actions_endpoint", + "api.actions_endpoint", + "api.health_endpoint", + "api.send_message_endpoint" + ], + "doc_paths": [ + "docs/README.md", + "docs/documentation/api/control-actions-endpoint.md", + "docs/documentation/api/health-endpoint.md", + "docs/documentation/api/send-message-endpoint.md" + ], + "doc_titles": [ + "Readme", + "HTTP API /actions/{action}", + "HTTP API /health", + "HTTP API /send", + "docs/README.md:Структура", + "docs/README.md:Навигация", + "docs/README.md:Правила и шаблоны", + "api.control_actions_endpoint:Summary", + "api.control_actions_endpoint:Описание", + "api.control_actions_endpoint:Сценарий", + "api.control_actions_endpoint:Функциональные требования", + "docs/README.md:Project Docs" + ], + "relation_hits_count": 0, + "relation_targets": [], + "fallback_doc_hits_count": 12, + "fallback_used": false, + "fact_hits": 0, + "entity_hits": 0, + "evidence_summary": { + "documents": 4, + "facts": 0, + "relations": 0, + "chunks": 8, + "entity_hits": 0, + "openapi_signals": { + "path_found": false, + "method_found": false, + "request_schema": false, + "response_schema": false, + "status_codes": false, + "payload_description": false + } + }, + "gate_decision": "allow", + "gate_decision_reason": "evidence_sufficient", + "gate_missing_requirements": [], + "gate_satisfied_requirements": [ + "retrieval_non_empty" + ], + "openapi_evidence": { + "path_found": false, + "method_found": false, + "request_schema": false, + "response_schema": false, + "status_codes": false, + "payload_description": false + }, + "requested_fragment_type": null, + "fragment_evidence_found": [], + "fragment_missing_requirements": [], + "answer_mode": "ready", + "degrade_reason": null, + "degraded_reason": null, + "code_intents_stubbed": false +} + +## LLM Request +- prompt_name: docs_general_answer +- log_context: graph.project_qa.docs.answer + +### Prompt Stats +```json +{ + "system_chars": 345, + "user_chars": 7558, + "tokens_in_estimate": 1976 +} +``` + +### System Prompt +```text +Ты отвечаешь на общий вопрос по документации проекта. + +На вход приходит JSON с полями: +- question +- intent +- sub_intent +- documents +- facts +- relations + +Правила: +- Используй только предоставленные документы и факты +- Не додумывай отсутствующие детали +- Если данных недостаточно, скажи это прямо +- Дай короткий понятный ответ без лишней структуры +``` + +### User Prompt +```json +{ + "question": "Опиши статус воркера", + "intent": "GENERAL_QA", + "sub_intent": "GENERIC_QA", + "documents": [ + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/README.md", + "title": "Readme", + "content": "Readme", + "metadata": { + "name": "", + "tags": [], + "type": "", + "layer": "", + "links": [], + "owner": null, + "title": "Readme", + "doc_id": null, + "module": "", + "parent": null, + "status": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "81d952f1a6ea85b76f75e0e57f33b8fa4b2bf3cb7db11b91b90171aeedd655a6", + "children": [], + "doc_kind": "readme", + "entities": [], + "updated_at": null, + "doc_version": null, + "document_id": "docs/README.md", + "source_path": "docs/README.md", + "summary_text": "", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "HTTP API /actions/{action}", + "content": "Endpoint `/actions/{action}` управляет control actions runtime и поддерживает `start`, `stop` и `status`. Для долгих операций `start` и `stop` допускается ответ HTTP 202, если действие еще выполняется. Endpoint используется для operator-driven управления жизненным циклом worker'а через HTTP API.", + "metadata": { + "name": "control_actions_endpoint", + "tags": [ + "api", + "control-plane", + "lifecycle" + ], + "type": "api_method", + "layer": "application", + "links": [ + { + "type": "part_of", + "target": "architecture.telegram_notify_app" + }, + { + "type": "related_api", + "target": "api.health_endpoint" + }, + { + "type": "related_logic", + "target": "logic.telegram_notification_loop" + } + ], + "owner": null, + "title": "HTTP API /actions/{action}", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "architecture.telegram_notify_app", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "children": [], + "doc_kind": "misc", + "entities": [ + "TelegramControlChannel", + "ControlActionSet", + "JSONResponse" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "api.control_actions_endpoint", + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "summary_text": "Endpoint `/actions/{action}` управляет control actions runtime и поддерживает `start`, `stop` и `status`. Для долгих операций `start` и `stop` допускается ответ HTTP 202, если действие еще выполняется. Endpoint используется для operator-driven управления жизненным циклом worker'а через HTTP API.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/api/health-endpoint.md", + "title": "HTTP API /health", + "content": "Endpoint `/health` возвращает агрегированный health payload runtime. Если общий статус равен `ok`, API отвечает с HTTP 200; для состояний деградации или неготовности возвращается HTTP 503 с тем же payload. Endpoint служит основной точкой внешней проверки состояния приложения.", + "metadata": { + "name": "health_endpoint", + "tags": [ + "api", + "health", + "control-plane" + ], + "type": "api_method", + "layer": "application", + "links": [ + { + "type": "part_of", + "target": "architecture.telegram_notify_app" + }, + { + "type": "depends_on", + "target": "domain.runtime_health" + } + ], + "owner": null, + "title": "HTTP API /health", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "architecture.telegram_notify_app", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "8b5a533a8076e2e9d36995eee29aeade260080bdca2ec8e21fe28f08574b983f", + "children": [], + "doc_kind": "misc", + "entities": [ + "TelegramControlChannel", + "TelegramNotifyWorker", + "RuntimeManager", + "WorkerHealth" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "api.health_endpoint", + "source_path": "docs/documentation/api/health-endpoint.md", + "summary_text": "Endpoint `/health` возвращает агрегированный health payload runtime. Если общий статус равен `ok`, API отвечает с HTTP 200; для состояний деградации или неготовности возвращается HTTP 503 с тем же payload. Endpoint служит основной точкой внешней проверки состояния приложения.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/api/send-message-endpoint.md", + "title": "HTTP API /send", + "content": "Endpoint `/send` выполняет ручную отправку сообщения в Telegram через `TelegramSendService`. Он используется для операторской проверки доставки и для отправки уведомлений вне периодического worker loop. Endpoint работает поверх тех же credentials и того же delivery path, что и фоновая отправка.", + "metadata": { + "name": "send_message_endpoint", + "tags": [ + "api", + "telegram", + "manual-send" + ], + "type": "api_method", + "layer": "application", + "links": [ + { + "type": "part_of", + "target": "architecture.telegram_notify_app" + }, + { + "type": "depends_on", + "target": "logic.telegram_notification_loop" + } + ], + "owner": null, + "title": "HTTP API /send", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "architecture.telegram_notify_app", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "5fbf2e33510b0676a3a53b957a4569bd3c2c31fb7719546602c573421ccaa32d", + "children": [], + "doc_kind": "misc", + "entities": [ + "TelegramControlAppFactory", + "TelegramSendService", + "TelegramNotifyWorker" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "api.send_message_endpoint", + "source_path": "docs/documentation/api/send-message-endpoint.md", + "summary_text": "Endpoint `/send` выполняет ручную отправку сообщения в Telegram через `TelegramSendService`. Он используется для операторской проверки доставки и для отправки уведомлений вне периодического worker loop. Endpoint работает поверх тех же credentials и того же delivery path, что и фоновая отправка.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + } + ], + "facts": [], + "relations": [] +} +``` + +### User Prompt Overview +- question: Опиши статус воркера +- intent: GENERAL_QA +- sub_intent: GENERIC_QA +- documents: 4 | samples: Readme, HTTP API /actions/{action}, HTTP API /health +- facts: 0 +- relations: 0 + +## Mismatches +- sub_intent: expected ENTITY_EXPLAIN, got GENERIC_QA \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/docs_router_deterministic/20260326_125615/full_chain_docs_intents_v3-3x_v3-general-1.json b/tests/pipeline_setup_v3/test_results/docs_router_deterministic/20260326_125615/full_chain_docs_intents_v3-3x_v3-general-1.json new file mode 100644 index 0000000..c3fb8e7 --- /dev/null +++ b/tests/pipeline_setup_v3/test_results/docs_router_deterministic/20260326_125615/full_chain_docs_intents_v3-3x_v3-general-1.json @@ -0,0 +1,90 @@ +{ + "meta": { + "case_id": "v3-general-1", + "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_03_docs/full_chain_docs_intents_v3-3x.yaml", + "runner": "agent_runtime", + "mode": "pre_llm", + "passed": true, + "mismatches": [], + "actual": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "GENERIC_QA", + "graph_id": "DocsQAGraph", + "conversation_mode": "START", + "rag_count": 19, + "llm_answer": "", + "answer_mode": "answered", + "path_scope": [], + "doc_scope": [ + "docs/README.md", + "api.control_actions_endpoint", + "api.actions_endpoint", + "api.health_endpoint", + "api.send_message_endpoint", + "architecture.telegram_notify_app", + "architecture.telegram_notify_app_overview", + "domain.runtime_health" + ], + "entity_candidates": [], + "symbol_candidates": [], + "layers": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "filters": { + "doc_type": null + }, + "pipeline_mode": "pre_llm_only", + "gate_decision": "allow", + "prompt_used": "docs_explain_answer", + "llm_mode": "prose", + "degraded_reason": null, + "code_intents_stubbed": true + } + }, + "pipeline_steps": [ + { + "step": "input_query", + "input": { + "query": "Что есть в документации?" + }, + "output": { + "query": "Что есть в документации?" + } + }, + { + "step": "router", + "input": { + "query": "Что есть в документации?" + }, + "output": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "GENERIC_QA", + "graph_id": "DocsQAGraph", + "conversation_mode": "START" + } + }, + { + "step": "docs_pipeline", + "input": { + "query": "Что есть в документации?" + }, + "output": { + "answer_mode": "ready", + "prompt_name": "docs_explain_answer", + "llm_request": { + "prompt_name": "docs_explain_answer", + "log_context": "graph.project_qa.docs.answer", + "prompt_stats": { + "system_chars": 393, + "user_chars": 19755, + "tokens_in_estimate": 5037 + } + }, + "degraded_reason": "" + } + } + ] +} \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/docs_router_deterministic/20260326_125615/full_chain_docs_intents_v3-3x_v3-general-1.md b/tests/pipeline_setup_v3/test_results/docs_router_deterministic/20260326_125615/full_chain_docs_intents_v3-3x_v3-general-1.md new file mode 100644 index 0000000..94b9cfb --- /dev/null +++ b/tests/pipeline_setup_v3/test_results/docs_router_deterministic/20260326_125615/full_chain_docs_intents_v3-3x_v3-general-1.md @@ -0,0 +1,859 @@ +# v3-general-1 + +- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_03_docs/full_chain_docs_intents_v3-3x.yaml +- runner: agent_runtime +- mode: pre_llm +- passed: True + +## Query +Что есть в документации? + +## Actual +{ + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "GENERIC_QA", + "graph_id": "DocsQAGraph", + "conversation_mode": "START", + "rag_count": 19, + "llm_answer": "", + "answer_mode": "answered", + "path_scope": [], + "doc_scope": [ + "docs/README.md", + "api.control_actions_endpoint", + "api.actions_endpoint", + "api.health_endpoint", + "api.send_message_endpoint", + "architecture.telegram_notify_app", + "architecture.telegram_notify_app_overview", + "domain.runtime_health" + ], + "entity_candidates": [], + "symbol_candidates": [], + "layers": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "filters": { + "doc_type": null + }, + "pipeline_mode": "pre_llm_only", + "gate_decision": "allow", + "prompt_used": "docs_explain_answer", + "llm_mode": "prose", + "degraded_reason": null, + "code_intents_stubbed": true +} + +## Pipeline Steps +### input_query +```json +{ + "input": { + "query": "Что есть в документации?" + }, + "output": { + "query": "Что есть в документации?" + } +} +``` + +### router +```json +{ + "input": { + "query": "Что есть в документации?" + }, + "output": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "GENERIC_QA", + "graph_id": "DocsQAGraph", + "conversation_mode": "START" + } +} +``` + +### docs_pipeline +```json +{ + "input": { + "query": "Что есть в документации?" + }, + "output": { + "answer_mode": "ready", + "prompt_name": "docs_explain_answer", + "llm_request": { + "prompt_name": "docs_explain_answer", + "log_context": "graph.project_qa.docs.answer", + "prompt_stats": { + "system_chars": 393, + "user_chars": 19755, + "tokens_in_estimate": 5037 + } + }, + "degraded_reason": "" + } +} +``` + +## Diagnostics +{ + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "GENERIC_QA", + "layers_used": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "documents_found": 6, + "facts_found": 1, + "relations_found": 6, + "openapi_fields_extracted": 0, + "missing_required_fields": [], + "openapi_status": { + "has_path": false, + "has_method": false, + "has_request": false, + "has_response": false + }, + "prompt_used": "docs_explain_answer", + "llm_mode": "prose", + "output_valid": true, + "matched_intent_source": "deterministic", + "matched_anchor_type": "none", + "matched_anchor_value": null, + "exact_anchor_match": false, + "docs_layers_requested": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "docs_layers_with_hits": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "planned_layers": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "executed_layers": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "non_empty_layers": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "layer_diagnostics": { + "D1_DOCUMENT_CATALOG": { + "hits": 6, + "top_ids": [ + "docs/README.md", + "api.control_actions_endpoint", + "api.health_endpoint", + "api.send_message_endpoint", + "architecture.telegram_notify_app" + ] + }, + "D2_FACT_INDEX": { + "hits": 8, + "top_ids": [ + "2f539384881f5f776bf4cef22c00669e53e0fd0761b3d62fa53593254a272f5a", + "5a27c821aa4efea9f2a7c883b57d1f53ec3af31348abd220bc09f47fbca73e93", + "0102eac8e4f8b452b0351a4aa8dca63e4774beadac71eba483708d7a90ff1cc0", + "43fc2c29bf6f353fa55f1b8a05c903dbd1a0e8067b026b9455043669ceca37d9", + "a31bbca2eb31ffb6655bcec7ff07b8cf2b6c7416610cf58dfc1e0c737df12fe1" + ] + }, + "D5_RELATION_GRAPH": { + "hits": 6, + "top_ids": [ + "5f4909bde905cd3d294ad307074a05e4ae4deefcafe6272cd2d0436e73acb8dd", + "711fb2edb82dd222deaba3c91768b18cbbd453009235823282813c6e867dc2c1", + "eec79f7a02b804337e791ef231784862ae26e0599eb20224790e9d4f085fa9c0", + "c718b1939621233295ccaf6e8203e7fd94f3dd1bfb88f10c51bc5e33d53a24aa", + "616f5cbf25da83cb51d8d0741a7fc351620c9ca2c6513fa2094b4aa476f0912a" + ] + }, + "D0_DOC_CHUNKS": { + "hits": 6, + "top_ids": [ + "docs/README.md", + "api.control_actions_endpoint" + ] + } + }, + "query_entity_candidates": [], + "resolved_entity_candidates": [], + "query_anchor_candidates": [], + "resolved_anchor_candidates": [ + "docs/README.md", + "api.control_actions_endpoint", + "docs/documentation/api/control-actions-endpoint.md", + "api.health_endpoint", + "docs/documentation/api/health-endpoint.md", + "api.send_message_endpoint", + "docs/documentation/api/send-message-endpoint.md", + "architecture.telegram_notify_app", + "docs/documentation/architecture/telegram-notify-app-overview.md", + "domain.runtime_health", + "docs/documentation/domain/runtime-health-entity.md" + ], + "anchor_candidates": [], + "selected_anchor": null, + "anchor_selection_reason": "", + "anchor_match_type": "", + "doc_ids": [ + "docs/README.md", + "api.control_actions_endpoint", + "api.actions_endpoint", + "api.health_endpoint", + "api.send_message_endpoint", + "architecture.telegram_notify_app", + "architecture.telegram_notify_app_overview", + "domain.runtime_health" + ], + "doc_paths": [ + "docs/README.md", + "docs/documentation/api/control-actions-endpoint.md", + "docs/documentation/api/health-endpoint.md", + "docs/documentation/api/send-message-endpoint.md", + "docs/documentation/architecture/telegram-notify-app-overview.md", + "docs/documentation/domain/runtime-health-entity.md" + ], + "doc_titles": [ + "Readme", + "HTTP API /actions/{action}", + "HTTP API /health", + "HTTP API /send", + "Архитектура Telegram Notify App", + "Сущность runtime health", + "docs/README.md:doc_list_item", + "api.control_actions_endpoint:part_of", + "api.control_actions_endpoint:related_api", + "api.control_actions_endpoint:related_logic", + "api.health_endpoint:parent", + "api.health_endpoint:part_of", + "api.control_actions_endpoint:parent", + "docs/README.md:Структура", + "docs/README.md:Навигация", + "docs/README.md:Правила и шаблоны", + "api.control_actions_endpoint:Summary", + "api.control_actions_endpoint:Описание", + "docs/README.md:Project Docs" + ], + "relation_hits_count": 6, + "relation_targets": [ + "api.control_actions_endpoint:part_of", + "api.control_actions_endpoint:related_api", + "api.control_actions_endpoint:related_logic", + "api.health_endpoint:parent", + "api.health_endpoint:part_of", + "api.control_actions_endpoint:parent" + ], + "fallback_doc_hits_count": 12, + "fallback_used": false, + "fact_hits": 1, + "entity_hits": 0, + "evidence_summary": { + "documents": 6, + "facts": 1, + "relations": 6, + "chunks": 6, + "entity_hits": 0, + "openapi_signals": { + "path_found": false, + "method_found": false, + "request_schema": false, + "response_schema": false, + "status_codes": false, + "payload_description": false + } + }, + "gate_decision": "allow", + "gate_decision_reason": "evidence_sufficient", + "gate_missing_requirements": [], + "gate_satisfied_requirements": [ + "retrieval_non_empty" + ], + "openapi_evidence": { + "path_found": false, + "method_found": false, + "request_schema": false, + "response_schema": false, + "status_codes": false, + "payload_description": false + }, + "requested_fragment_type": null, + "fragment_evidence_found": [], + "fragment_missing_requirements": [], + "answer_mode": "ready", + "degrade_reason": null, + "degraded_reason": null, + "code_intents_stubbed": false +} + +## LLM Request +- prompt_name: docs_explain_answer +- log_context: graph.project_qa.docs.answer + +### Prompt Stats +```json +{ + "system_chars": 393, + "user_chars": 19755, + "tokens_in_estimate": 5037 +} +``` + +### System Prompt +```text +Ты объясняешь документацию системы. + +На вход приходит JSON с полями: +- question +- intent +- sub_intent +- documents +- facts +- relations + +Правила: +- Используй только предоставленные факты +- Не додумывай +- Если данных недостаточно, скажи это явно +- Объясняй структурировано + +Формат ответа: +1. Краткое описание +2. Основные элементы +3. Как это работает +4. Связи с другими частями системы (если есть) +``` + +### User Prompt +```json +{ + "question": "Что есть в документации?", + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "GENERIC_QA", + "documents": [ + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/README.md", + "title": "Readme", + "content": "Readme", + "metadata": { + "name": "", + "tags": [], + "type": "", + "layer": "", + "links": [], + "owner": null, + "title": "Readme", + "doc_id": null, + "module": "", + "parent": null, + "status": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "81d952f1a6ea85b76f75e0e57f33b8fa4b2bf3cb7db11b91b90171aeedd655a6", + "children": [], + "doc_kind": "readme", + "entities": [], + "updated_at": null, + "doc_version": null, + "document_id": "docs/README.md", + "source_path": "docs/README.md", + "summary_text": "", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "HTTP API /actions/{action}", + "content": "Endpoint `/actions/{action}` управляет control actions runtime и поддерживает `start`, `stop` и `status`. Для долгих операций `start` и `stop` допускается ответ HTTP 202, если действие еще выполняется. Endpoint используется для operator-driven управления жизненным циклом worker'а через HTTP API.", + "metadata": { + "name": "control_actions_endpoint", + "tags": [ + "api", + "control-plane", + "lifecycle" + ], + "type": "api_method", + "layer": "application", + "links": [ + { + "type": "part_of", + "target": "architecture.telegram_notify_app" + }, + { + "type": "related_api", + "target": "api.health_endpoint" + }, + { + "type": "related_logic", + "target": "logic.telegram_notification_loop" + } + ], + "owner": null, + "title": "HTTP API /actions/{action}", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "architecture.telegram_notify_app", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "children": [], + "doc_kind": "misc", + "entities": [ + "TelegramControlChannel", + "ControlActionSet", + "JSONResponse" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "api.control_actions_endpoint", + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "summary_text": "Endpoint `/actions/{action}` управляет control actions runtime и поддерживает `start`, `stop` и `status`. Для долгих операций `start` и `stop` допускается ответ HTTP 202, если действие еще выполняется. Endpoint используется для operator-driven управления жизненным циклом worker'а через HTTP API.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/api/health-endpoint.md", + "title": "HTTP API /health", + "content": "Endpoint `/health` возвращает агрегированный health payload runtime. Если общий статус равен `ok`, API отвечает с HTTP 200; для состояний деградации или неготовности возвращается HTTP 503 с тем же payload. Endpoint служит основной точкой внешней проверки состояния приложения.", + "metadata": { + "name": "health_endpoint", + "tags": [ + "api", + "health", + "control-plane" + ], + "type": "api_method", + "layer": "application", + "links": [ + { + "type": "part_of", + "target": "architecture.telegram_notify_app" + }, + { + "type": "depends_on", + "target": "domain.runtime_health" + } + ], + "owner": null, + "title": "HTTP API /health", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "architecture.telegram_notify_app", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "8b5a533a8076e2e9d36995eee29aeade260080bdca2ec8e21fe28f08574b983f", + "children": [], + "doc_kind": "misc", + "entities": [ + "TelegramControlChannel", + "TelegramNotifyWorker", + "RuntimeManager", + "WorkerHealth" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "api.health_endpoint", + "source_path": "docs/documentation/api/health-endpoint.md", + "summary_text": "Endpoint `/health` возвращает агрегированный health payload runtime. Если общий статус равен `ok`, API отвечает с HTTP 200; для состояний деградации или неготовности возвращается HTTP 503 с тем же payload. Endpoint служит основной точкой внешней проверки состояния приложения.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/api/send-message-endpoint.md", + "title": "HTTP API /send", + "content": "Endpoint `/send` выполняет ручную отправку сообщения в Telegram через `TelegramSendService`. Он используется для операторской проверки доставки и для отправки уведомлений вне периодического worker loop. Endpoint работает поверх тех же credentials и того же delivery path, что и фоновая отправка.", + "metadata": { + "name": "send_message_endpoint", + "tags": [ + "api", + "telegram", + "manual-send" + ], + "type": "api_method", + "layer": "application", + "links": [ + { + "type": "part_of", + "target": "architecture.telegram_notify_app" + }, + { + "type": "depends_on", + "target": "logic.telegram_notification_loop" + } + ], + "owner": null, + "title": "HTTP API /send", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "architecture.telegram_notify_app", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "5fbf2e33510b0676a3a53b957a4569bd3c2c31fb7719546602c573421ccaa32d", + "children": [], + "doc_kind": "misc", + "entities": [ + "TelegramControlAppFactory", + "TelegramSendService", + "TelegramNotifyWorker" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "api.send_message_endpoint", + "source_path": "docs/documentation/api/send-message-endpoint.md", + "summary_text": "Endpoint `/send` выполняет ручную отправку сообщения в Telegram через `TelegramSendService`. Он используется для операторской проверки доставки и для отправки уведомлений вне периодического worker loop. Endpoint работает поверх тех же credentials и того же delivery path, что и фоновая отправка.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/architecture/telegram-notify-app-overview.md", + "title": "Архитектура Telegram Notify App", + "content": "`test_echo_app` — сервис на базе PLBA runtime, который поднимает HTTP control plane и запускает фоновый воркер для периодической отправки уведомлений в Telegram. Приложение использует YAML-конфиг для runtime-настроек и переменные окружения для Telegram credentials. Основной контур системы состоит из runtime manager, control channel, send service и worker loop.", + "metadata": { + "name": "telegram_notify_app_overview", + "tags": [ + "architecture", + "telegram", + "plba", + "runtime" + ], + "type": "architecture_overview", + "layer": "system", + "links": [ + { + "type": "related_api", + "target": "api.health_endpoint" + }, + { + "type": "related_api", + "target": "api.control_actions_endpoint" + }, + { + "type": "related_api", + "target": "api.send_message_endpoint" + }, + { + "type": "depends_on", + "target": "logic.telegram_notification_loop" + }, + { + "type": "depends_on", + "target": "domain.runtime_health" + } + ], + "owner": null, + "title": "Архитектура Telegram Notify App", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "docs_root", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "8b1cc9f823e55bddbc825466d10a0fdb4ca4354ac02d91f9e2aef7b7d2ec8256", + "children": [ + "api.health_endpoint", + "api.control_actions_endpoint", + "api.send_message_endpoint", + "logic.telegram_notification_loop", + "domain.runtime_health" + ], + "doc_kind": "spec", + "entities": [ + "TelegramNotifyModule", + "TelegramNotifyWorker", + "TelegramControlChannel", + "TelegramSendService", + "RuntimeManager" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "architecture.telegram_notify_app", + "source_path": "docs/documentation/architecture/telegram-notify-app-overview.md", + "summary_text": "`test_echo_app` — сервис на базе PLBA runtime, который поднимает HTTP control plane и запускает фоновый воркер для периодической отправки уведомлений в Telegram. Приложение использует YAML-конфиг для runtime-настроек и переменные окружения для Telegram credentials. Основной контур системы состоит из runtime manager, control channel, send service и worker loop.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/domain/runtime-health-entity.md", + "title": "Сущность runtime health", + "content": "`runtime health` — доменная модель наблюдаемости сервиса, которая описывает общее состояние runtime и состояние отдельных компонентов. Для `test_echo_app` главным объектом наблюдения является компонент `telegram_notify`, у которого важны статус, время старта и количество успешных отправок. Эта модель используется для внешнего health-monitoring и внутренней диагностики.", + "metadata": { + "name": "runtime_health", + "tags": [ + "domain", + "health", + "observability" + ], + "type": "domain_entity", + "layer": "domain", + "links": [ + { + "type": "part_of", + "target": "architecture.telegram_notify_app" + }, + { + "type": "used_by", + "target": "api.health_endpoint" + }, + { + "type": "related_logic", + "target": "logic.telegram_notification_loop" + } + ], + "owner": null, + "title": "Сущность runtime health", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "architecture.telegram_notify_app", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "37d4dcf470ea3de95d59e44786006e369a3ea11bf5dbf4c88877696e9183ee87", + "children": [], + "doc_kind": "misc", + "entities": [ + "WorkerHealth", + "WorkerStatus", + "TelegramNotifyWorker" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "domain.runtime_health", + "source_path": "docs/documentation/domain/runtime-health-entity.md", + "summary_text": "`runtime health` — доменная модель наблюдаемости сервиса, которая описывает общее состояние runtime и состояние отдельных компонентов. Для `test_echo_app` главным объектом наблюдения является компонент `telegram_notify`, у которого важны статус, время старта и количество успешных отправок. Эта модель используется для внешнего health-monitoring и внутренней диагностики.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + } + ], + "facts": [ + { + "layer": "D2_FACT_INDEX", + "path": "docs/README.md", + "title": "docs/README.md:doc_list_item", + "content": "docs/README.md doc_list_item `documentation/api/` — документация HTTP API control plane.", + "metadata": { + "tags": [], + "owner": null, + "anchor": "Структура", + "doc_id": null, + "object": "`documentation/api/` — документация HTTP API control plane.", + "fact_id": "2f539384881f5f776bf4cef22c00669e53e0fd0761b3d62fa53593254a272f5a", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "81d952f1a6ea85b76f75e0e57f33b8fa4b2bf3cb7db11b91b90171aeedd655a6", + "predicate": "doc_list_item", + "object_ref": null, + "subject_id": "docs/README.md", + "doc_version": null, + "source_path": "docs/README.md", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + } + ], + "relations": [ + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "api.control_actions_endpoint:part_of", + "content": "api.control_actions_endpoint part_of architecture.telegram_notify_app", + "metadata": { + "owner": null, + "anchor": "frontmatter.links", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "source_id": "api.control_actions_endpoint", + "target_id": "architecture.telegram_notify_app", + "doc_version": null, + "relation_id": "5f4909bde905cd3d294ad307074a05e4ae4deefcafe6272cd2d0436e73acb8dd", + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "part_of", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "api.control_actions_endpoint:related_api", + "content": "api.control_actions_endpoint related_api api.health_endpoint", + "metadata": { + "owner": null, + "anchor": "frontmatter.links", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "source_id": "api.control_actions_endpoint", + "target_id": "api.health_endpoint", + "doc_version": null, + "relation_id": "711fb2edb82dd222deaba3c91768b18cbbd453009235823282813c6e867dc2c1", + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "related_api", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "api.control_actions_endpoint:related_logic", + "content": "api.control_actions_endpoint related_logic logic.telegram_notification_loop", + "metadata": { + "owner": null, + "anchor": "frontmatter.links", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "source_id": "api.control_actions_endpoint", + "target_id": "logic.telegram_notification_loop", + "doc_version": null, + "relation_id": "eec79f7a02b804337e791ef231784862ae26e0599eb20224790e9d4f085fa9c0", + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "related_logic", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/api/health-endpoint.md", + "title": "api.health_endpoint:parent", + "content": "api.health_endpoint parent architecture.telegram_notify_app", + "metadata": { + "owner": null, + "anchor": "frontmatter.parent", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "8b5a533a8076e2e9d36995eee29aeade260080bdca2ec8e21fe28f08574b983f", + "source_id": "api.health_endpoint", + "target_id": "architecture.telegram_notify_app", + "doc_version": null, + "relation_id": "c718b1939621233295ccaf6e8203e7fd94f3dd1bfb88f10c51bc5e33d53a24aa", + "source_path": "docs/documentation/api/health-endpoint.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "parent", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/api/health-endpoint.md", + "title": "api.health_endpoint:part_of", + "content": "api.health_endpoint part_of architecture.telegram_notify_app", + "metadata": { + "owner": null, + "anchor": "frontmatter.links", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "8b5a533a8076e2e9d36995eee29aeade260080bdca2ec8e21fe28f08574b983f", + "source_id": "api.health_endpoint", + "target_id": "architecture.telegram_notify_app", + "doc_version": null, + "relation_id": "616f5cbf25da83cb51d8d0741a7fc351620c9ca2c6513fa2094b4aa476f0912a", + "source_path": "docs/documentation/api/health-endpoint.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "part_of", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "api.control_actions_endpoint:parent", + "content": "api.control_actions_endpoint parent architecture.telegram_notify_app", + "metadata": { + "owner": null, + "anchor": "frontmatter.parent", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "source_id": "api.control_actions_endpoint", + "target_id": "architecture.telegram_notify_app", + "doc_version": null, + "relation_id": "afec31fd062e392dcd9699a92c7ab61fd4b1273c1a2b16702b23d55d8d0c47ac", + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "parent", + "staleness_score": null, + "system_component": null + } + } + ] +} +``` + +### User Prompt Overview +- question: Что есть в документации? +- intent: DOCUMENTATION_EXPLAIN +- sub_intent: GENERIC_QA +- documents: 6 | samples: Readme, HTTP API /actions/{action}, HTTP API /health +- facts: 1 | samples: docs/README.md:doc_list_item +- relations: 6 | samples: api.control_actions_endpoint:part_of, api.control_actions_endpoint:related_api, api.control_actions_endpoint:related_logic + +## Mismatches +- none \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/docs_router_deterministic/20260326_125615/full_chain_docs_intents_v3-3x_v3-general-2.json b/tests/pipeline_setup_v3/test_results/docs_router_deterministic/20260326_125615/full_chain_docs_intents_v3-3x_v3-general-2.json new file mode 100644 index 0000000..507422d --- /dev/null +++ b/tests/pipeline_setup_v3/test_results/docs_router_deterministic/20260326_125615/full_chain_docs_intents_v3-3x_v3-general-2.json @@ -0,0 +1,85 @@ +{ + "meta": { + "case_id": "v3-general-2", + "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_03_docs/full_chain_docs_intents_v3-3x.yaml", + "runner": "agent_runtime", + "mode": "pre_llm", + "passed": true, + "mismatches": [], + "actual": { + "intent": "GENERAL_QA", + "sub_intent": "GENERIC_QA", + "graph_id": "DocsQAGraph", + "conversation_mode": "START", + "rag_count": 12, + "llm_answer": "", + "answer_mode": "answered", + "path_scope": [], + "doc_scope": [ + "docs/README.md", + "api.control_actions_endpoint", + "api.actions_endpoint", + "api.health_endpoint", + "api.send_message_endpoint" + ], + "entity_candidates": [], + "symbol_candidates": [], + "layers": [ + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "filters": { + "doc_type": null + }, + "pipeline_mode": "pre_llm_only", + "gate_decision": "allow", + "prompt_used": "docs_general_answer", + "llm_mode": "prose", + "degraded_reason": null, + "code_intents_stubbed": true + } + }, + "pipeline_steps": [ + { + "step": "input_query", + "input": { + "query": "Какая структура документации?" + }, + "output": { + "query": "Какая структура документации?" + } + }, + { + "step": "router", + "input": { + "query": "Какая структура документации?" + }, + "output": { + "intent": "GENERAL_QA", + "sub_intent": "GENERIC_QA", + "graph_id": "DocsQAGraph", + "conversation_mode": "START" + } + }, + { + "step": "docs_pipeline", + "input": { + "query": "Какая структура документации?" + }, + "output": { + "answer_mode": "ready", + "prompt_name": "docs_general_answer", + "llm_request": { + "prompt_name": "docs_general_answer", + "log_context": "graph.project_qa.docs.answer", + "prompt_stats": { + "system_chars": 345, + "user_chars": 7567, + "tokens_in_estimate": 1978 + } + }, + "degraded_reason": "" + } + } + ] +} \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/docs_router_deterministic/20260326_125615/full_chain_docs_intents_v3-3x_v3-general-2.md b/tests/pipeline_setup_v3/test_results/docs_router_deterministic/20260326_125615/full_chain_docs_intents_v3-3x_v3-general-2.md new file mode 100644 index 0000000..6dbd33d --- /dev/null +++ b/tests/pipeline_setup_v3/test_results/docs_router_deterministic/20260326_125615/full_chain_docs_intents_v3-3x_v3-general-2.md @@ -0,0 +1,493 @@ +# v3-general-2 + +- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_03_docs/full_chain_docs_intents_v3-3x.yaml +- runner: agent_runtime +- mode: pre_llm +- passed: True + +## Query +Какая структура документации? + +## Actual +{ + "intent": "GENERAL_QA", + "sub_intent": "GENERIC_QA", + "graph_id": "DocsQAGraph", + "conversation_mode": "START", + "rag_count": 12, + "llm_answer": "", + "answer_mode": "answered", + "path_scope": [], + "doc_scope": [ + "docs/README.md", + "api.control_actions_endpoint", + "api.actions_endpoint", + "api.health_endpoint", + "api.send_message_endpoint" + ], + "entity_candidates": [], + "symbol_candidates": [], + "layers": [ + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "filters": { + "doc_type": null + }, + "pipeline_mode": "pre_llm_only", + "gate_decision": "allow", + "prompt_used": "docs_general_answer", + "llm_mode": "prose", + "degraded_reason": null, + "code_intents_stubbed": true +} + +## Pipeline Steps +### input_query +```json +{ + "input": { + "query": "Какая структура документации?" + }, + "output": { + "query": "Какая структура документации?" + } +} +``` + +### router +```json +{ + "input": { + "query": "Какая структура документации?" + }, + "output": { + "intent": "GENERAL_QA", + "sub_intent": "GENERIC_QA", + "graph_id": "DocsQAGraph", + "conversation_mode": "START" + } +} +``` + +### docs_pipeline +```json +{ + "input": { + "query": "Какая структура документации?" + }, + "output": { + "answer_mode": "ready", + "prompt_name": "docs_general_answer", + "llm_request": { + "prompt_name": "docs_general_answer", + "log_context": "graph.project_qa.docs.answer", + "prompt_stats": { + "system_chars": 345, + "user_chars": 7567, + "tokens_in_estimate": 1978 + } + }, + "degraded_reason": "" + } +} +``` + +## Diagnostics +{ + "intent": "GENERAL_QA", + "sub_intent": "GENERIC_QA", + "layers_used": [ + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "documents_found": 4, + "facts_found": 0, + "relations_found": 0, + "openapi_fields_extracted": 0, + "missing_required_fields": [], + "openapi_status": { + "has_path": false, + "has_method": false, + "has_request": false, + "has_response": false + }, + "prompt_used": "docs_general_answer", + "llm_mode": "prose", + "output_valid": true, + "matched_intent_source": "deterministic", + "matched_anchor_type": "none", + "matched_anchor_value": null, + "exact_anchor_match": false, + "docs_layers_requested": [ + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "docs_layers_with_hits": [ + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "planned_layers": [ + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "executed_layers": [ + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "non_empty_layers": [ + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "layer_diagnostics": { + "D1_DOCUMENT_CATALOG": { + "hits": 4, + "top_ids": [ + "docs/README.md", + "api.control_actions_endpoint", + "api.health_endpoint", + "api.send_message_endpoint" + ] + }, + "D0_DOC_CHUNKS": { + "hits": 8, + "top_ids": [ + "docs/README.md", + "api.control_actions_endpoint" + ] + } + }, + "query_entity_candidates": [], + "resolved_entity_candidates": [], + "query_anchor_candidates": [], + "resolved_anchor_candidates": [ + "docs/README.md", + "api.control_actions_endpoint", + "docs/documentation/api/control-actions-endpoint.md", + "api.health_endpoint", + "docs/documentation/api/health-endpoint.md", + "api.send_message_endpoint", + "docs/documentation/api/send-message-endpoint.md" + ], + "anchor_candidates": [], + "selected_anchor": null, + "anchor_selection_reason": "", + "anchor_match_type": "", + "doc_ids": [ + "docs/README.md", + "api.control_actions_endpoint", + "api.actions_endpoint", + "api.health_endpoint", + "api.send_message_endpoint" + ], + "doc_paths": [ + "docs/README.md", + "docs/documentation/api/control-actions-endpoint.md", + "docs/documentation/api/health-endpoint.md", + "docs/documentation/api/send-message-endpoint.md" + ], + "doc_titles": [ + "Readme", + "HTTP API /actions/{action}", + "HTTP API /health", + "HTTP API /send", + "docs/README.md:Структура", + "docs/README.md:Навигация", + "docs/README.md:Правила и шаблоны", + "api.control_actions_endpoint:Summary", + "api.control_actions_endpoint:Описание", + "api.control_actions_endpoint:Сценарий", + "api.control_actions_endpoint:Функциональные требования", + "docs/README.md:Project Docs" + ], + "relation_hits_count": 0, + "relation_targets": [], + "fallback_doc_hits_count": 12, + "fallback_used": false, + "fact_hits": 0, + "entity_hits": 0, + "evidence_summary": { + "documents": 4, + "facts": 0, + "relations": 0, + "chunks": 8, + "entity_hits": 0, + "openapi_signals": { + "path_found": false, + "method_found": false, + "request_schema": false, + "response_schema": false, + "status_codes": false, + "payload_description": false + } + }, + "gate_decision": "allow", + "gate_decision_reason": "evidence_sufficient", + "gate_missing_requirements": [], + "gate_satisfied_requirements": [ + "retrieval_non_empty" + ], + "openapi_evidence": { + "path_found": false, + "method_found": false, + "request_schema": false, + "response_schema": false, + "status_codes": false, + "payload_description": false + }, + "requested_fragment_type": null, + "fragment_evidence_found": [], + "fragment_missing_requirements": [], + "answer_mode": "ready", + "degrade_reason": null, + "degraded_reason": null, + "code_intents_stubbed": false +} + +## LLM Request +- prompt_name: docs_general_answer +- log_context: graph.project_qa.docs.answer + +### Prompt Stats +```json +{ + "system_chars": 345, + "user_chars": 7567, + "tokens_in_estimate": 1978 +} +``` + +### System Prompt +```text +Ты отвечаешь на общий вопрос по документации проекта. + +На вход приходит JSON с полями: +- question +- intent +- sub_intent +- documents +- facts +- relations + +Правила: +- Используй только предоставленные документы и факты +- Не додумывай отсутствующие детали +- Если данных недостаточно, скажи это прямо +- Дай короткий понятный ответ без лишней структуры +``` + +### User Prompt +```json +{ + "question": "Какая структура документации?", + "intent": "GENERAL_QA", + "sub_intent": "GENERIC_QA", + "documents": [ + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/README.md", + "title": "Readme", + "content": "Readme", + "metadata": { + "name": "", + "tags": [], + "type": "", + "layer": "", + "links": [], + "owner": null, + "title": "Readme", + "doc_id": null, + "module": "", + "parent": null, + "status": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "81d952f1a6ea85b76f75e0e57f33b8fa4b2bf3cb7db11b91b90171aeedd655a6", + "children": [], + "doc_kind": "readme", + "entities": [], + "updated_at": null, + "doc_version": null, + "document_id": "docs/README.md", + "source_path": "docs/README.md", + "summary_text": "", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "HTTP API /actions/{action}", + "content": "Endpoint `/actions/{action}` управляет control actions runtime и поддерживает `start`, `stop` и `status`. Для долгих операций `start` и `stop` допускается ответ HTTP 202, если действие еще выполняется. Endpoint используется для operator-driven управления жизненным циклом worker'а через HTTP API.", + "metadata": { + "name": "control_actions_endpoint", + "tags": [ + "api", + "control-plane", + "lifecycle" + ], + "type": "api_method", + "layer": "application", + "links": [ + { + "type": "part_of", + "target": "architecture.telegram_notify_app" + }, + { + "type": "related_api", + "target": "api.health_endpoint" + }, + { + "type": "related_logic", + "target": "logic.telegram_notification_loop" + } + ], + "owner": null, + "title": "HTTP API /actions/{action}", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "architecture.telegram_notify_app", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "children": [], + "doc_kind": "misc", + "entities": [ + "TelegramControlChannel", + "ControlActionSet", + "JSONResponse" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "api.control_actions_endpoint", + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "summary_text": "Endpoint `/actions/{action}` управляет control actions runtime и поддерживает `start`, `stop` и `status`. Для долгих операций `start` и `stop` допускается ответ HTTP 202, если действие еще выполняется. Endpoint используется для operator-driven управления жизненным циклом worker'а через HTTP API.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/api/health-endpoint.md", + "title": "HTTP API /health", + "content": "Endpoint `/health` возвращает агрегированный health payload runtime. Если общий статус равен `ok`, API отвечает с HTTP 200; для состояний деградации или неготовности возвращается HTTP 503 с тем же payload. Endpoint служит основной точкой внешней проверки состояния приложения.", + "metadata": { + "name": "health_endpoint", + "tags": [ + "api", + "health", + "control-plane" + ], + "type": "api_method", + "layer": "application", + "links": [ + { + "type": "part_of", + "target": "architecture.telegram_notify_app" + }, + { + "type": "depends_on", + "target": "domain.runtime_health" + } + ], + "owner": null, + "title": "HTTP API /health", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "architecture.telegram_notify_app", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "8b5a533a8076e2e9d36995eee29aeade260080bdca2ec8e21fe28f08574b983f", + "children": [], + "doc_kind": "misc", + "entities": [ + "TelegramControlChannel", + "TelegramNotifyWorker", + "RuntimeManager", + "WorkerHealth" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "api.health_endpoint", + "source_path": "docs/documentation/api/health-endpoint.md", + "summary_text": "Endpoint `/health` возвращает агрегированный health payload runtime. Если общий статус равен `ok`, API отвечает с HTTP 200; для состояний деградации или неготовности возвращается HTTP 503 с тем же payload. Endpoint служит основной точкой внешней проверки состояния приложения.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/api/send-message-endpoint.md", + "title": "HTTP API /send", + "content": "Endpoint `/send` выполняет ручную отправку сообщения в Telegram через `TelegramSendService`. Он используется для операторской проверки доставки и для отправки уведомлений вне периодического worker loop. Endpoint работает поверх тех же credentials и того же delivery path, что и фоновая отправка.", + "metadata": { + "name": "send_message_endpoint", + "tags": [ + "api", + "telegram", + "manual-send" + ], + "type": "api_method", + "layer": "application", + "links": [ + { + "type": "part_of", + "target": "architecture.telegram_notify_app" + }, + { + "type": "depends_on", + "target": "logic.telegram_notification_loop" + } + ], + "owner": null, + "title": "HTTP API /send", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "architecture.telegram_notify_app", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "5fbf2e33510b0676a3a53b957a4569bd3c2c31fb7719546602c573421ccaa32d", + "children": [], + "doc_kind": "misc", + "entities": [ + "TelegramControlAppFactory", + "TelegramSendService", + "TelegramNotifyWorker" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "api.send_message_endpoint", + "source_path": "docs/documentation/api/send-message-endpoint.md", + "summary_text": "Endpoint `/send` выполняет ручную отправку сообщения в Telegram через `TelegramSendService`. Он используется для операторской проверки доставки и для отправки уведомлений вне периодического worker loop. Endpoint работает поверх тех же credentials и того же delivery path, что и фоновая отправка.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + } + ], + "facts": [], + "relations": [] +} +``` + +### User Prompt Overview +- question: Какая структура документации? +- intent: GENERAL_QA +- sub_intent: GENERIC_QA +- documents: 4 | samples: Readme, HTTP API /actions/{action}, HTTP API /health +- facts: 0 +- relations: 0 + +## Mismatches +- none \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/docs_router_deterministic/20260326_125615/full_chain_docs_intents_v3-3x_v3-general-3.json b/tests/pipeline_setup_v3/test_results/docs_router_deterministic/20260326_125615/full_chain_docs_intents_v3-3x_v3-general-3.json new file mode 100644 index 0000000..a50c0d2 --- /dev/null +++ b/tests/pipeline_setup_v3/test_results/docs_router_deterministic/20260326_125615/full_chain_docs_intents_v3-3x_v3-general-3.json @@ -0,0 +1,85 @@ +{ + "meta": { + "case_id": "v3-general-3", + "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_03_docs/full_chain_docs_intents_v3-3x.yaml", + "runner": "agent_runtime", + "mode": "pre_llm", + "passed": true, + "mismatches": [], + "actual": { + "intent": "GENERAL_QA", + "sub_intent": "GENERIC_QA", + "graph_id": "DocsQAGraph", + "conversation_mode": "START", + "rag_count": 12, + "llm_answer": "", + "answer_mode": "answered", + "path_scope": [], + "doc_scope": [ + "docs/README.md", + "api.control_actions_endpoint", + "api.actions_endpoint", + "api.health_endpoint", + "api.send_message_endpoint" + ], + "entity_candidates": [], + "symbol_candidates": [], + "layers": [ + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "filters": { + "doc_type": null + }, + "pipeline_mode": "pre_llm_only", + "gate_decision": "allow", + "prompt_used": "docs_general_answer", + "llm_mode": "prose", + "degraded_reason": null, + "code_intents_stubbed": true + } + }, + "pipeline_steps": [ + { + "step": "input_query", + "input": { + "query": "С чего начать читать документацию?" + }, + "output": { + "query": "С чего начать читать документацию?" + } + }, + { + "step": "router", + "input": { + "query": "С чего начать читать документацию?" + }, + "output": { + "intent": "GENERAL_QA", + "sub_intent": "GENERIC_QA", + "graph_id": "DocsQAGraph", + "conversation_mode": "START" + } + }, + { + "step": "docs_pipeline", + "input": { + "query": "С чего начать читать документацию?" + }, + "output": { + "answer_mode": "ready", + "prompt_name": "docs_general_answer", + "llm_request": { + "prompt_name": "docs_general_answer", + "log_context": "graph.project_qa.docs.answer", + "prompt_stats": { + "system_chars": 345, + "user_chars": 7572, + "tokens_in_estimate": 1980 + } + }, + "degraded_reason": "" + } + } + ] +} \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/docs_router_deterministic/20260326_125615/full_chain_docs_intents_v3-3x_v3-general-3.md b/tests/pipeline_setup_v3/test_results/docs_router_deterministic/20260326_125615/full_chain_docs_intents_v3-3x_v3-general-3.md new file mode 100644 index 0000000..0be7a19 --- /dev/null +++ b/tests/pipeline_setup_v3/test_results/docs_router_deterministic/20260326_125615/full_chain_docs_intents_v3-3x_v3-general-3.md @@ -0,0 +1,493 @@ +# v3-general-3 + +- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_03_docs/full_chain_docs_intents_v3-3x.yaml +- runner: agent_runtime +- mode: pre_llm +- passed: True + +## Query +С чего начать читать документацию? + +## Actual +{ + "intent": "GENERAL_QA", + "sub_intent": "GENERIC_QA", + "graph_id": "DocsQAGraph", + "conversation_mode": "START", + "rag_count": 12, + "llm_answer": "", + "answer_mode": "answered", + "path_scope": [], + "doc_scope": [ + "docs/README.md", + "api.control_actions_endpoint", + "api.actions_endpoint", + "api.health_endpoint", + "api.send_message_endpoint" + ], + "entity_candidates": [], + "symbol_candidates": [], + "layers": [ + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "filters": { + "doc_type": null + }, + "pipeline_mode": "pre_llm_only", + "gate_decision": "allow", + "prompt_used": "docs_general_answer", + "llm_mode": "prose", + "degraded_reason": null, + "code_intents_stubbed": true +} + +## Pipeline Steps +### input_query +```json +{ + "input": { + "query": "С чего начать читать документацию?" + }, + "output": { + "query": "С чего начать читать документацию?" + } +} +``` + +### router +```json +{ + "input": { + "query": "С чего начать читать документацию?" + }, + "output": { + "intent": "GENERAL_QA", + "sub_intent": "GENERIC_QA", + "graph_id": "DocsQAGraph", + "conversation_mode": "START" + } +} +``` + +### docs_pipeline +```json +{ + "input": { + "query": "С чего начать читать документацию?" + }, + "output": { + "answer_mode": "ready", + "prompt_name": "docs_general_answer", + "llm_request": { + "prompt_name": "docs_general_answer", + "log_context": "graph.project_qa.docs.answer", + "prompt_stats": { + "system_chars": 345, + "user_chars": 7572, + "tokens_in_estimate": 1980 + } + }, + "degraded_reason": "" + } +} +``` + +## Diagnostics +{ + "intent": "GENERAL_QA", + "sub_intent": "GENERIC_QA", + "layers_used": [ + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "documents_found": 4, + "facts_found": 0, + "relations_found": 0, + "openapi_fields_extracted": 0, + "missing_required_fields": [], + "openapi_status": { + "has_path": false, + "has_method": false, + "has_request": false, + "has_response": false + }, + "prompt_used": "docs_general_answer", + "llm_mode": "prose", + "output_valid": true, + "matched_intent_source": "deterministic", + "matched_anchor_type": "none", + "matched_anchor_value": null, + "exact_anchor_match": false, + "docs_layers_requested": [ + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "docs_layers_with_hits": [ + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "planned_layers": [ + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "executed_layers": [ + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "non_empty_layers": [ + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "layer_diagnostics": { + "D1_DOCUMENT_CATALOG": { + "hits": 4, + "top_ids": [ + "docs/README.md", + "api.control_actions_endpoint", + "api.health_endpoint", + "api.send_message_endpoint" + ] + }, + "D0_DOC_CHUNKS": { + "hits": 8, + "top_ids": [ + "docs/README.md", + "api.control_actions_endpoint" + ] + } + }, + "query_entity_candidates": [], + "resolved_entity_candidates": [], + "query_anchor_candidates": [], + "resolved_anchor_candidates": [ + "docs/README.md", + "api.control_actions_endpoint", + "docs/documentation/api/control-actions-endpoint.md", + "api.health_endpoint", + "docs/documentation/api/health-endpoint.md", + "api.send_message_endpoint", + "docs/documentation/api/send-message-endpoint.md" + ], + "anchor_candidates": [], + "selected_anchor": null, + "anchor_selection_reason": "", + "anchor_match_type": "", + "doc_ids": [ + "docs/README.md", + "api.control_actions_endpoint", + "api.actions_endpoint", + "api.health_endpoint", + "api.send_message_endpoint" + ], + "doc_paths": [ + "docs/README.md", + "docs/documentation/api/control-actions-endpoint.md", + "docs/documentation/api/health-endpoint.md", + "docs/documentation/api/send-message-endpoint.md" + ], + "doc_titles": [ + "Readme", + "HTTP API /actions/{action}", + "HTTP API /health", + "HTTP API /send", + "docs/README.md:Структура", + "docs/README.md:Навигация", + "docs/README.md:Правила и шаблоны", + "api.control_actions_endpoint:Summary", + "api.control_actions_endpoint:Описание", + "api.control_actions_endpoint:Сценарий", + "api.control_actions_endpoint:Функциональные требования", + "docs/README.md:Project Docs" + ], + "relation_hits_count": 0, + "relation_targets": [], + "fallback_doc_hits_count": 12, + "fallback_used": false, + "fact_hits": 0, + "entity_hits": 0, + "evidence_summary": { + "documents": 4, + "facts": 0, + "relations": 0, + "chunks": 8, + "entity_hits": 0, + "openapi_signals": { + "path_found": false, + "method_found": false, + "request_schema": false, + "response_schema": false, + "status_codes": false, + "payload_description": false + } + }, + "gate_decision": "allow", + "gate_decision_reason": "evidence_sufficient", + "gate_missing_requirements": [], + "gate_satisfied_requirements": [ + "retrieval_non_empty" + ], + "openapi_evidence": { + "path_found": false, + "method_found": false, + "request_schema": false, + "response_schema": false, + "status_codes": false, + "payload_description": false + }, + "requested_fragment_type": null, + "fragment_evidence_found": [], + "fragment_missing_requirements": [], + "answer_mode": "ready", + "degrade_reason": null, + "degraded_reason": null, + "code_intents_stubbed": false +} + +## LLM Request +- prompt_name: docs_general_answer +- log_context: graph.project_qa.docs.answer + +### Prompt Stats +```json +{ + "system_chars": 345, + "user_chars": 7572, + "tokens_in_estimate": 1980 +} +``` + +### System Prompt +```text +Ты отвечаешь на общий вопрос по документации проекта. + +На вход приходит JSON с полями: +- question +- intent +- sub_intent +- documents +- facts +- relations + +Правила: +- Используй только предоставленные документы и факты +- Не додумывай отсутствующие детали +- Если данных недостаточно, скажи это прямо +- Дай короткий понятный ответ без лишней структуры +``` + +### User Prompt +```json +{ + "question": "С чего начать читать документацию?", + "intent": "GENERAL_QA", + "sub_intent": "GENERIC_QA", + "documents": [ + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/README.md", + "title": "Readme", + "content": "Readme", + "metadata": { + "name": "", + "tags": [], + "type": "", + "layer": "", + "links": [], + "owner": null, + "title": "Readme", + "doc_id": null, + "module": "", + "parent": null, + "status": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "81d952f1a6ea85b76f75e0e57f33b8fa4b2bf3cb7db11b91b90171aeedd655a6", + "children": [], + "doc_kind": "readme", + "entities": [], + "updated_at": null, + "doc_version": null, + "document_id": "docs/README.md", + "source_path": "docs/README.md", + "summary_text": "", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "HTTP API /actions/{action}", + "content": "Endpoint `/actions/{action}` управляет control actions runtime и поддерживает `start`, `stop` и `status`. Для долгих операций `start` и `stop` допускается ответ HTTP 202, если действие еще выполняется. Endpoint используется для operator-driven управления жизненным циклом worker'а через HTTP API.", + "metadata": { + "name": "control_actions_endpoint", + "tags": [ + "api", + "control-plane", + "lifecycle" + ], + "type": "api_method", + "layer": "application", + "links": [ + { + "type": "part_of", + "target": "architecture.telegram_notify_app" + }, + { + "type": "related_api", + "target": "api.health_endpoint" + }, + { + "type": "related_logic", + "target": "logic.telegram_notification_loop" + } + ], + "owner": null, + "title": "HTTP API /actions/{action}", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "architecture.telegram_notify_app", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "children": [], + "doc_kind": "misc", + "entities": [ + "TelegramControlChannel", + "ControlActionSet", + "JSONResponse" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "api.control_actions_endpoint", + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "summary_text": "Endpoint `/actions/{action}` управляет control actions runtime и поддерживает `start`, `stop` и `status`. Для долгих операций `start` и `stop` допускается ответ HTTP 202, если действие еще выполняется. Endpoint используется для operator-driven управления жизненным циклом worker'а через HTTP API.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/api/health-endpoint.md", + "title": "HTTP API /health", + "content": "Endpoint `/health` возвращает агрегированный health payload runtime. Если общий статус равен `ok`, API отвечает с HTTP 200; для состояний деградации или неготовности возвращается HTTP 503 с тем же payload. Endpoint служит основной точкой внешней проверки состояния приложения.", + "metadata": { + "name": "health_endpoint", + "tags": [ + "api", + "health", + "control-plane" + ], + "type": "api_method", + "layer": "application", + "links": [ + { + "type": "part_of", + "target": "architecture.telegram_notify_app" + }, + { + "type": "depends_on", + "target": "domain.runtime_health" + } + ], + "owner": null, + "title": "HTTP API /health", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "architecture.telegram_notify_app", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "8b5a533a8076e2e9d36995eee29aeade260080bdca2ec8e21fe28f08574b983f", + "children": [], + "doc_kind": "misc", + "entities": [ + "TelegramControlChannel", + "TelegramNotifyWorker", + "RuntimeManager", + "WorkerHealth" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "api.health_endpoint", + "source_path": "docs/documentation/api/health-endpoint.md", + "summary_text": "Endpoint `/health` возвращает агрегированный health payload runtime. Если общий статус равен `ok`, API отвечает с HTTP 200; для состояний деградации или неготовности возвращается HTTP 503 с тем же payload. Endpoint служит основной точкой внешней проверки состояния приложения.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/api/send-message-endpoint.md", + "title": "HTTP API /send", + "content": "Endpoint `/send` выполняет ручную отправку сообщения в Telegram через `TelegramSendService`. Он используется для операторской проверки доставки и для отправки уведомлений вне периодического worker loop. Endpoint работает поверх тех же credentials и того же delivery path, что и фоновая отправка.", + "metadata": { + "name": "send_message_endpoint", + "tags": [ + "api", + "telegram", + "manual-send" + ], + "type": "api_method", + "layer": "application", + "links": [ + { + "type": "part_of", + "target": "architecture.telegram_notify_app" + }, + { + "type": "depends_on", + "target": "logic.telegram_notification_loop" + } + ], + "owner": null, + "title": "HTTP API /send", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "architecture.telegram_notify_app", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "5fbf2e33510b0676a3a53b957a4569bd3c2c31fb7719546602c573421ccaa32d", + "children": [], + "doc_kind": "misc", + "entities": [ + "TelegramControlAppFactory", + "TelegramSendService", + "TelegramNotifyWorker" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "api.send_message_endpoint", + "source_path": "docs/documentation/api/send-message-endpoint.md", + "summary_text": "Endpoint `/send` выполняет ручную отправку сообщения в Telegram через `TelegramSendService`. Он используется для операторской проверки доставки и для отправки уведомлений вне периодического worker loop. Endpoint работает поверх тех же credentials и того же delivery path, что и фоновая отправка.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + } + ], + "facts": [], + "relations": [] +} +``` + +### User Prompt Overview +- question: С чего начать читать документацию? +- intent: GENERAL_QA +- sub_intent: GENERIC_QA +- documents: 4 | samples: Readme, HTTP API /actions/{action}, HTTP API /health +- facts: 0 +- relations: 0 + +## Mismatches +- none \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/docs_router_deterministic/20260326_125615/full_chain_docs_intents_v3-3x_v3-negative-1.json b/tests/pipeline_setup_v3/test_results/docs_router_deterministic/20260326_125615/full_chain_docs_intents_v3-3x_v3-negative-1.json new file mode 100644 index 0000000..76e9b2e --- /dev/null +++ b/tests/pipeline_setup_v3/test_results/docs_router_deterministic/20260326_125615/full_chain_docs_intents_v3-3x_v3-negative-1.json @@ -0,0 +1,92 @@ +{ + "meta": { + "case_id": "v3-negative-1", + "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_03_docs/full_chain_docs_intents_v3-3x.yaml", + "runner": "agent_runtime", + "mode": "pre_llm", + "passed": true, + "mismatches": [], + "actual": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "ENTITY_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START", + "rag_count": 26, + "llm_answer": "", + "answer_mode": "answered", + "path_scope": [], + "doc_scope": [ + "api.control_actions_endpoint", + "api.health_endpoint", + "api.send_message_endpoint", + "docs/README.md", + "api.actions_endpoint", + "architecture.telegram_notify_app", + "architecture.telegram_notify_app_overview", + "domain.runtime_health" + ], + "entity_candidates": [ + "PaymentTransaction" + ], + "symbol_candidates": [], + "layers": [ + "D3_ENTITY_CATALOG", + "D1_DOCUMENT_CATALOG", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "filters": { + "doc_type": null + }, + "pipeline_mode": "pre_llm_only", + "gate_decision": "allow", + "prompt_used": "docs_explain_answer", + "llm_mode": "prose", + "degraded_reason": null, + "code_intents_stubbed": true + } + }, + "pipeline_steps": [ + { + "step": "input_query", + "input": { + "query": "Что такое PaymentTransaction?" + }, + "output": { + "query": "Что такое PaymentTransaction?" + } + }, + { + "step": "router", + "input": { + "query": "Что такое PaymentTransaction?" + }, + "output": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "ENTITY_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START" + } + }, + { + "step": "docs_pipeline", + "input": { + "query": "Что такое PaymentTransaction?" + }, + "output": { + "answer_mode": "ready", + "prompt_name": "docs_explain_answer", + "llm_request": { + "prompt_name": "docs_explain_answer", + "log_context": "graph.project_qa.docs.answer", + "prompt_stats": { + "system_chars": 393, + "user_chars": 18782, + "tokens_in_estimate": 4794 + } + }, + "degraded_reason": "" + } + } + ] +} \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/docs_router_deterministic/20260326_125615/full_chain_docs_intents_v3-3x_v3-negative-1.md b/tests/pipeline_setup_v3/test_results/docs_router_deterministic/20260326_125615/full_chain_docs_intents_v3-3x_v3-negative-1.md new file mode 100644 index 0000000..1c0740d --- /dev/null +++ b/tests/pipeline_setup_v3/test_results/docs_router_deterministic/20260326_125615/full_chain_docs_intents_v3-3x_v3-negative-1.md @@ -0,0 +1,841 @@ +# v3-negative-1 + +- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_03_docs/full_chain_docs_intents_v3-3x.yaml +- runner: agent_runtime +- mode: pre_llm +- passed: True + +## Query +Что такое PaymentTransaction? + +## Actual +{ + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "ENTITY_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START", + "rag_count": 26, + "llm_answer": "", + "answer_mode": "answered", + "path_scope": [], + "doc_scope": [ + "api.control_actions_endpoint", + "api.health_endpoint", + "api.send_message_endpoint", + "docs/README.md", + "api.actions_endpoint", + "architecture.telegram_notify_app", + "architecture.telegram_notify_app_overview", + "domain.runtime_health" + ], + "entity_candidates": [ + "PaymentTransaction" + ], + "symbol_candidates": [], + "layers": [ + "D3_ENTITY_CATALOG", + "D1_DOCUMENT_CATALOG", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "filters": { + "doc_type": null + }, + "pipeline_mode": "pre_llm_only", + "gate_decision": "allow", + "prompt_used": "docs_explain_answer", + "llm_mode": "prose", + "degraded_reason": null, + "code_intents_stubbed": true +} + +## Pipeline Steps +### input_query +```json +{ + "input": { + "query": "Что такое PaymentTransaction?" + }, + "output": { + "query": "Что такое PaymentTransaction?" + } +} +``` + +### router +```json +{ + "input": { + "query": "Что такое PaymentTransaction?" + }, + "output": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "ENTITY_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START" + } +} +``` + +### docs_pipeline +```json +{ + "input": { + "query": "Что такое PaymentTransaction?" + }, + "output": { + "answer_mode": "ready", + "prompt_name": "docs_explain_answer", + "llm_request": { + "prompt_name": "docs_explain_answer", + "log_context": "graph.project_qa.docs.answer", + "prompt_stats": { + "system_chars": 393, + "user_chars": 18782, + "tokens_in_estimate": 4794 + } + }, + "degraded_reason": "" + } +} +``` + +## Diagnostics +{ + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "ENTITY_EXPLAIN", + "layers_used": [ + "D3_ENTITY_CATALOG", + "D1_DOCUMENT_CATALOG", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "documents_found": 6, + "facts_found": 0, + "relations_found": 6, + "openapi_fields_extracted": 0, + "missing_required_fields": [], + "openapi_status": { + "has_path": false, + "has_method": false, + "has_request": false, + "has_response": false + }, + "prompt_used": "docs_explain_answer", + "llm_mode": "prose", + "output_valid": true, + "matched_intent_source": "deterministic", + "matched_anchor_type": "none", + "matched_anchor_value": null, + "exact_anchor_match": false, + "docs_layers_requested": [ + "D3_ENTITY_CATALOG", + "D1_DOCUMENT_CATALOG", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "docs_layers_with_hits": [ + "D3_ENTITY_CATALOG", + "D1_DOCUMENT_CATALOG", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "planned_layers": [ + "D3_ENTITY_CATALOG", + "D1_DOCUMENT_CATALOG", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "executed_layers": [ + "D3_ENTITY_CATALOG", + "D1_DOCUMENT_CATALOG", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "non_empty_layers": [ + "D3_ENTITY_CATALOG", + "D1_DOCUMENT_CATALOG", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "layer_diagnostics": { + "D3_ENTITY_CATALOG": { + "hits": 8, + "top_ids": [ + "api.control_actions_endpoint", + "api.health_endpoint" + ] + }, + "D1_DOCUMENT_CATALOG": { + "hits": 6, + "top_ids": [ + "docs/README.md", + "api.control_actions_endpoint", + "api.health_endpoint", + "api.send_message_endpoint", + "architecture.telegram_notify_app" + ] + }, + "D5_RELATION_GRAPH": { + "hits": 6, + "top_ids": [ + "5f4909bde905cd3d294ad307074a05e4ae4deefcafe6272cd2d0436e73acb8dd", + "711fb2edb82dd222deaba3c91768b18cbbd453009235823282813c6e867dc2c1", + "eec79f7a02b804337e791ef231784862ae26e0599eb20224790e9d4f085fa9c0", + "c718b1939621233295ccaf6e8203e7fd94f3dd1bfb88f10c51bc5e33d53a24aa", + "616f5cbf25da83cb51d8d0741a7fc351620c9ca2c6513fa2094b4aa476f0912a" + ] + }, + "D0_DOC_CHUNKS": { + "hits": 6, + "top_ids": [ + "docs/README.md", + "api.control_actions_endpoint" + ] + } + }, + "query_entity_candidates": [ + "PaymentTransaction" + ], + "resolved_entity_candidates": [], + "query_anchor_candidates": [ + "PaymentTransaction" + ], + "resolved_anchor_candidates": [ + "api.control_actions_endpoint", + "docs/documentation/api/control-actions-endpoint.md", + "api.health_endpoint", + "docs/documentation/api/health-endpoint.md", + "api.send_message_endpoint", + "docs/documentation/api/send-message-endpoint.md", + "docs/README.md", + "architecture.telegram_notify_app", + "docs/documentation/architecture/telegram-notify-app-overview.md", + "domain.runtime_health", + "docs/documentation/domain/runtime-health-entity.md" + ], + "anchor_candidates": [], + "selected_anchor": null, + "anchor_selection_reason": "", + "anchor_match_type": "", + "doc_ids": [ + "api.control_actions_endpoint", + "api.health_endpoint", + "api.send_message_endpoint", + "docs/README.md", + "api.actions_endpoint", + "architecture.telegram_notify_app", + "architecture.telegram_notify_app_overview", + "domain.runtime_health" + ], + "doc_paths": [ + "docs/documentation/api/control-actions-endpoint.md", + "docs/documentation/api/health-endpoint.md", + "docs/documentation/api/send-message-endpoint.md", + "docs/README.md", + "docs/documentation/architecture/telegram-notify-app-overview.md", + "docs/documentation/domain/runtime-health-entity.md" + ], + "doc_titles": [ + "ControlActionSet", + "JSONResponse", + "TelegramControlChannel", + "TelegramNotifyWorker", + "RuntimeManager", + "WorkerHealth", + "TelegramControlAppFactory", + "Readme", + "HTTP API /actions/{action}", + "HTTP API /health", + "HTTP API /send", + "Архитектура Telegram Notify App", + "Сущность runtime health", + "api.control_actions_endpoint:part_of", + "api.control_actions_endpoint:related_api", + "api.control_actions_endpoint:related_logic", + "api.health_endpoint:parent", + "api.health_endpoint:part_of", + "api.control_actions_endpoint:parent", + "docs/README.md:Структура", + "docs/README.md:Навигация", + "docs/README.md:Правила и шаблоны", + "api.control_actions_endpoint:Summary", + "api.control_actions_endpoint:Описание", + "docs/README.md:Project Docs" + ], + "relation_hits_count": 6, + "relation_targets": [ + "api.control_actions_endpoint:part_of", + "api.control_actions_endpoint:related_api", + "api.control_actions_endpoint:related_logic", + "api.health_endpoint:parent", + "api.health_endpoint:part_of", + "api.control_actions_endpoint:parent" + ], + "fallback_doc_hits_count": 12, + "fallback_used": false, + "fact_hits": 0, + "entity_hits": 0, + "evidence_summary": { + "documents": 6, + "facts": 0, + "relations": 6, + "chunks": 6, + "entity_hits": 0, + "openapi_signals": { + "path_found": false, + "method_found": false, + "request_schema": false, + "response_schema": false, + "status_codes": false, + "payload_description": false + } + }, + "gate_decision": "allow", + "gate_decision_reason": "evidence_sufficient", + "gate_missing_requirements": [], + "gate_satisfied_requirements": [ + "retrieval_non_empty" + ], + "openapi_evidence": { + "path_found": false, + "method_found": false, + "request_schema": false, + "response_schema": false, + "status_codes": false, + "payload_description": false + }, + "requested_fragment_type": null, + "fragment_evidence_found": [], + "fragment_missing_requirements": [], + "answer_mode": "ready", + "degrade_reason": null, + "degraded_reason": null, + "code_intents_stubbed": false +} + +## LLM Request +- prompt_name: docs_explain_answer +- log_context: graph.project_qa.docs.answer + +### Prompt Stats +```json +{ + "system_chars": 393, + "user_chars": 18782, + "tokens_in_estimate": 4794 +} +``` + +### System Prompt +```text +Ты объясняешь документацию системы. + +На вход приходит JSON с полями: +- question +- intent +- sub_intent +- documents +- facts +- relations + +Правила: +- Используй только предоставленные факты +- Не додумывай +- Если данных недостаточно, скажи это явно +- Объясняй структурировано + +Формат ответа: +1. Краткое описание +2. Основные элементы +3. Как это работает +4. Связи с другими частями системы (если есть) +``` + +### User Prompt +```json +{ + "question": "Что такое PaymentTransaction?", + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "ENTITY_EXPLAIN", + "documents": [ + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/README.md", + "title": "Readme", + "content": "Readme", + "metadata": { + "name": "", + "tags": [], + "type": "", + "layer": "", + "links": [], + "owner": null, + "title": "Readme", + "doc_id": null, + "module": "", + "parent": null, + "status": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "81d952f1a6ea85b76f75e0e57f33b8fa4b2bf3cb7db11b91b90171aeedd655a6", + "children": [], + "doc_kind": "readme", + "entities": [], + "updated_at": null, + "doc_version": null, + "document_id": "docs/README.md", + "source_path": "docs/README.md", + "summary_text": "", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "HTTP API /actions/{action}", + "content": "Endpoint `/actions/{action}` управляет control actions runtime и поддерживает `start`, `stop` и `status`. Для долгих операций `start` и `stop` допускается ответ HTTP 202, если действие еще выполняется. Endpoint используется для operator-driven управления жизненным циклом worker'а через HTTP API.", + "metadata": { + "name": "control_actions_endpoint", + "tags": [ + "api", + "control-plane", + "lifecycle" + ], + "type": "api_method", + "layer": "application", + "links": [ + { + "type": "part_of", + "target": "architecture.telegram_notify_app" + }, + { + "type": "related_api", + "target": "api.health_endpoint" + }, + { + "type": "related_logic", + "target": "logic.telegram_notification_loop" + } + ], + "owner": null, + "title": "HTTP API /actions/{action}", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "architecture.telegram_notify_app", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "children": [], + "doc_kind": "misc", + "entities": [ + "TelegramControlChannel", + "ControlActionSet", + "JSONResponse" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "api.control_actions_endpoint", + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "summary_text": "Endpoint `/actions/{action}` управляет control actions runtime и поддерживает `start`, `stop` и `status`. Для долгих операций `start` и `stop` допускается ответ HTTP 202, если действие еще выполняется. Endpoint используется для operator-driven управления жизненным циклом worker'а через HTTP API.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/api/health-endpoint.md", + "title": "HTTP API /health", + "content": "Endpoint `/health` возвращает агрегированный health payload runtime. Если общий статус равен `ok`, API отвечает с HTTP 200; для состояний деградации или неготовности возвращается HTTP 503 с тем же payload. Endpoint служит основной точкой внешней проверки состояния приложения.", + "metadata": { + "name": "health_endpoint", + "tags": [ + "api", + "health", + "control-plane" + ], + "type": "api_method", + "layer": "application", + "links": [ + { + "type": "part_of", + "target": "architecture.telegram_notify_app" + }, + { + "type": "depends_on", + "target": "domain.runtime_health" + } + ], + "owner": null, + "title": "HTTP API /health", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "architecture.telegram_notify_app", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "8b5a533a8076e2e9d36995eee29aeade260080bdca2ec8e21fe28f08574b983f", + "children": [], + "doc_kind": "misc", + "entities": [ + "TelegramControlChannel", + "TelegramNotifyWorker", + "RuntimeManager", + "WorkerHealth" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "api.health_endpoint", + "source_path": "docs/documentation/api/health-endpoint.md", + "summary_text": "Endpoint `/health` возвращает агрегированный health payload runtime. Если общий статус равен `ok`, API отвечает с HTTP 200; для состояний деградации или неготовности возвращается HTTP 503 с тем же payload. Endpoint служит основной точкой внешней проверки состояния приложения.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/api/send-message-endpoint.md", + "title": "HTTP API /send", + "content": "Endpoint `/send` выполняет ручную отправку сообщения в Telegram через `TelegramSendService`. Он используется для операторской проверки доставки и для отправки уведомлений вне периодического worker loop. Endpoint работает поверх тех же credentials и того же delivery path, что и фоновая отправка.", + "metadata": { + "name": "send_message_endpoint", + "tags": [ + "api", + "telegram", + "manual-send" + ], + "type": "api_method", + "layer": "application", + "links": [ + { + "type": "part_of", + "target": "architecture.telegram_notify_app" + }, + { + "type": "depends_on", + "target": "logic.telegram_notification_loop" + } + ], + "owner": null, + "title": "HTTP API /send", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "architecture.telegram_notify_app", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "5fbf2e33510b0676a3a53b957a4569bd3c2c31fb7719546602c573421ccaa32d", + "children": [], + "doc_kind": "misc", + "entities": [ + "TelegramControlAppFactory", + "TelegramSendService", + "TelegramNotifyWorker" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "api.send_message_endpoint", + "source_path": "docs/documentation/api/send-message-endpoint.md", + "summary_text": "Endpoint `/send` выполняет ручную отправку сообщения в Telegram через `TelegramSendService`. Он используется для операторской проверки доставки и для отправки уведомлений вне периодического worker loop. Endpoint работает поверх тех же credentials и того же delivery path, что и фоновая отправка.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/architecture/telegram-notify-app-overview.md", + "title": "Архитектура Telegram Notify App", + "content": "`test_echo_app` — сервис на базе PLBA runtime, который поднимает HTTP control plane и запускает фоновый воркер для периодической отправки уведомлений в Telegram. Приложение использует YAML-конфиг для runtime-настроек и переменные окружения для Telegram credentials. Основной контур системы состоит из runtime manager, control channel, send service и worker loop.", + "metadata": { + "name": "telegram_notify_app_overview", + "tags": [ + "architecture", + "telegram", + "plba", + "runtime" + ], + "type": "architecture_overview", + "layer": "system", + "links": [ + { + "type": "related_api", + "target": "api.health_endpoint" + }, + { + "type": "related_api", + "target": "api.control_actions_endpoint" + }, + { + "type": "related_api", + "target": "api.send_message_endpoint" + }, + { + "type": "depends_on", + "target": "logic.telegram_notification_loop" + }, + { + "type": "depends_on", + "target": "domain.runtime_health" + } + ], + "owner": null, + "title": "Архитектура Telegram Notify App", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "docs_root", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "8b1cc9f823e55bddbc825466d10a0fdb4ca4354ac02d91f9e2aef7b7d2ec8256", + "children": [ + "api.health_endpoint", + "api.control_actions_endpoint", + "api.send_message_endpoint", + "logic.telegram_notification_loop", + "domain.runtime_health" + ], + "doc_kind": "spec", + "entities": [ + "TelegramNotifyModule", + "TelegramNotifyWorker", + "TelegramControlChannel", + "TelegramSendService", + "RuntimeManager" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "architecture.telegram_notify_app", + "source_path": "docs/documentation/architecture/telegram-notify-app-overview.md", + "summary_text": "`test_echo_app` — сервис на базе PLBA runtime, который поднимает HTTP control plane и запускает фоновый воркер для периодической отправки уведомлений в Telegram. Приложение использует YAML-конфиг для runtime-настроек и переменные окружения для Telegram credentials. Основной контур системы состоит из runtime manager, control channel, send service и worker loop.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/domain/runtime-health-entity.md", + "title": "Сущность runtime health", + "content": "`runtime health` — доменная модель наблюдаемости сервиса, которая описывает общее состояние runtime и состояние отдельных компонентов. Для `test_echo_app` главным объектом наблюдения является компонент `telegram_notify`, у которого важны статус, время старта и количество успешных отправок. Эта модель используется для внешнего health-monitoring и внутренней диагностики.", + "metadata": { + "name": "runtime_health", + "tags": [ + "domain", + "health", + "observability" + ], + "type": "domain_entity", + "layer": "domain", + "links": [ + { + "type": "part_of", + "target": "architecture.telegram_notify_app" + }, + { + "type": "used_by", + "target": "api.health_endpoint" + }, + { + "type": "related_logic", + "target": "logic.telegram_notification_loop" + } + ], + "owner": null, + "title": "Сущность runtime health", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "architecture.telegram_notify_app", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "37d4dcf470ea3de95d59e44786006e369a3ea11bf5dbf4c88877696e9183ee87", + "children": [], + "doc_kind": "misc", + "entities": [ + "WorkerHealth", + "WorkerStatus", + "TelegramNotifyWorker" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "domain.runtime_health", + "source_path": "docs/documentation/domain/runtime-health-entity.md", + "summary_text": "`runtime health` — доменная модель наблюдаемости сервиса, которая описывает общее состояние runtime и состояние отдельных компонентов. Для `test_echo_app` главным объектом наблюдения является компонент `telegram_notify`, у которого важны статус, время старта и количество успешных отправок. Эта модель используется для внешнего health-monitoring и внутренней диагностики.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + } + ], + "facts": [], + "relations": [ + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "api.control_actions_endpoint:part_of", + "content": "api.control_actions_endpoint part_of architecture.telegram_notify_app", + "metadata": { + "owner": null, + "anchor": "frontmatter.links", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "source_id": "api.control_actions_endpoint", + "target_id": "architecture.telegram_notify_app", + "doc_version": null, + "relation_id": "5f4909bde905cd3d294ad307074a05e4ae4deefcafe6272cd2d0436e73acb8dd", + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "part_of", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "api.control_actions_endpoint:related_api", + "content": "api.control_actions_endpoint related_api api.health_endpoint", + "metadata": { + "owner": null, + "anchor": "frontmatter.links", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "source_id": "api.control_actions_endpoint", + "target_id": "api.health_endpoint", + "doc_version": null, + "relation_id": "711fb2edb82dd222deaba3c91768b18cbbd453009235823282813c6e867dc2c1", + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "related_api", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "api.control_actions_endpoint:related_logic", + "content": "api.control_actions_endpoint related_logic logic.telegram_notification_loop", + "metadata": { + "owner": null, + "anchor": "frontmatter.links", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "source_id": "api.control_actions_endpoint", + "target_id": "logic.telegram_notification_loop", + "doc_version": null, + "relation_id": "eec79f7a02b804337e791ef231784862ae26e0599eb20224790e9d4f085fa9c0", + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "related_logic", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/api/health-endpoint.md", + "title": "api.health_endpoint:parent", + "content": "api.health_endpoint parent architecture.telegram_notify_app", + "metadata": { + "owner": null, + "anchor": "frontmatter.parent", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "8b5a533a8076e2e9d36995eee29aeade260080bdca2ec8e21fe28f08574b983f", + "source_id": "api.health_endpoint", + "target_id": "architecture.telegram_notify_app", + "doc_version": null, + "relation_id": "c718b1939621233295ccaf6e8203e7fd94f3dd1bfb88f10c51bc5e33d53a24aa", + "source_path": "docs/documentation/api/health-endpoint.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "parent", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/api/health-endpoint.md", + "title": "api.health_endpoint:part_of", + "content": "api.health_endpoint part_of architecture.telegram_notify_app", + "metadata": { + "owner": null, + "anchor": "frontmatter.links", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "8b5a533a8076e2e9d36995eee29aeade260080bdca2ec8e21fe28f08574b983f", + "source_id": "api.health_endpoint", + "target_id": "architecture.telegram_notify_app", + "doc_version": null, + "relation_id": "616f5cbf25da83cb51d8d0741a7fc351620c9ca2c6513fa2094b4aa476f0912a", + "source_path": "docs/documentation/api/health-endpoint.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "part_of", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "api.control_actions_endpoint:parent", + "content": "api.control_actions_endpoint parent architecture.telegram_notify_app", + "metadata": { + "owner": null, + "anchor": "frontmatter.parent", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "source_id": "api.control_actions_endpoint", + "target_id": "architecture.telegram_notify_app", + "doc_version": null, + "relation_id": "afec31fd062e392dcd9699a92c7ab61fd4b1273c1a2b16702b23d55d8d0c47ac", + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "parent", + "staleness_score": null, + "system_component": null + } + } + ] +} +``` + +### User Prompt Overview +- question: Что такое PaymentTransaction? +- intent: DOCUMENTATION_EXPLAIN +- sub_intent: ENTITY_EXPLAIN +- documents: 6 | samples: Readme, HTTP API /actions/{action}, HTTP API /health +- facts: 0 +- relations: 6 | samples: api.control_actions_endpoint:part_of, api.control_actions_endpoint:related_api, api.control_actions_endpoint:related_logic + +## Mismatches +- none \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/docs_router_deterministic/20260326_125615/full_chain_docs_intents_v3-3x_v3-negative-2.json b/tests/pipeline_setup_v3/test_results/docs_router_deterministic/20260326_125615/full_chain_docs_intents_v3-3x_v3-negative-2.json new file mode 100644 index 0000000..215ddd2 --- /dev/null +++ b/tests/pipeline_setup_v3/test_results/docs_router_deterministic/20260326_125615/full_chain_docs_intents_v3-3x_v3-negative-2.json @@ -0,0 +1,83 @@ +{ + "meta": { + "case_id": "v3-negative-2", + "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_03_docs/full_chain_docs_intents_v3-3x.yaml", + "runner": "agent_runtime", + "mode": "pre_llm", + "passed": true, + "mismatches": [], + "actual": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "ENTITY_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START", + "rag_count": 0, + "llm_answer": "", + "answer_mode": "degraded", + "path_scope": [], + "doc_scope": [], + "entity_candidates": [ + "UnknownEntity" + ], + "symbol_candidates": [], + "layers": [ + "D3_ENTITY_CATALOG", + "D1_DOCUMENT_CATALOG", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "filters": { + "doc_type": null + }, + "pipeline_mode": "pre_llm_only", + "gate_decision": "reject", + "prompt_used": "docs_explain_answer", + "llm_mode": "prose", + "degraded_reason": "not_found_exact_anchor", + "code_intents_stubbed": true + } + }, + "pipeline_steps": [ + { + "step": "input_query", + "input": { + "query": "Объясни сущность UnknownEntity" + }, + "output": { + "query": "Объясни сущность UnknownEntity" + } + }, + { + "step": "router", + "input": { + "query": "Объясни сущность UnknownEntity" + }, + "output": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "ENTITY_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START" + } + }, + { + "step": "docs_pipeline", + "input": { + "query": "Объясни сущность UnknownEntity" + }, + "output": { + "answer_mode": "degraded", + "prompt_name": "docs_explain_answer", + "llm_request": { + "prompt_name": "docs_explain_answer", + "log_context": "graph.project_qa.docs.answer", + "prompt_stats": { + "system_chars": 393, + "user_chars": 174, + "tokens_in_estimate": 142 + } + }, + "degraded_reason": "not_found_exact_anchor" + } + } + ] +} \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/docs_router_deterministic/20260326_125615/full_chain_docs_intents_v3-3x_v3-negative-2.md b/tests/pipeline_setup_v3/test_results/docs_router_deterministic/20260326_125615/full_chain_docs_intents_v3-3x_v3-negative-2.md new file mode 100644 index 0000000..4a127d7 --- /dev/null +++ b/tests/pipeline_setup_v3/test_results/docs_router_deterministic/20260326_125615/full_chain_docs_intents_v3-3x_v3-negative-2.md @@ -0,0 +1,307 @@ +# v3-negative-2 + +- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_03_docs/full_chain_docs_intents_v3-3x.yaml +- runner: agent_runtime +- mode: pre_llm +- passed: True + +## Query +Объясни сущность UnknownEntity + +## Actual +{ + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "ENTITY_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START", + "rag_count": 0, + "llm_answer": "", + "answer_mode": "degraded", + "path_scope": [], + "doc_scope": [], + "entity_candidates": [ + "UnknownEntity" + ], + "symbol_candidates": [], + "layers": [ + "D3_ENTITY_CATALOG", + "D1_DOCUMENT_CATALOG", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "filters": { + "doc_type": null + }, + "pipeline_mode": "pre_llm_only", + "gate_decision": "reject", + "prompt_used": "docs_explain_answer", + "llm_mode": "prose", + "degraded_reason": "not_found_exact_anchor", + "code_intents_stubbed": true +} + +## Pipeline Steps +### input_query +```json +{ + "input": { + "query": "Объясни сущность UnknownEntity" + }, + "output": { + "query": "Объясни сущность UnknownEntity" + } +} +``` + +### router +```json +{ + "input": { + "query": "Объясни сущность UnknownEntity" + }, + "output": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "ENTITY_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START" + } +} +``` + +### docs_pipeline +```json +{ + "input": { + "query": "Объясни сущность UnknownEntity" + }, + "output": { + "answer_mode": "degraded", + "prompt_name": "docs_explain_answer", + "llm_request": { + "prompt_name": "docs_explain_answer", + "log_context": "graph.project_qa.docs.answer", + "prompt_stats": { + "system_chars": 393, + "user_chars": 174, + "tokens_in_estimate": 142 + } + }, + "degraded_reason": "not_found_exact_anchor" + } +} +``` + +## Diagnostics +{ + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "ENTITY_EXPLAIN", + "layers_used": [ + "D3_ENTITY_CATALOG", + "D1_DOCUMENT_CATALOG", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "documents_found": 0, + "facts_found": 0, + "relations_found": 0, + "openapi_fields_extracted": 0, + "missing_required_fields": [], + "openapi_status": { + "has_path": false, + "has_method": false, + "has_request": false, + "has_response": false + }, + "prompt_used": "docs_explain_answer", + "llm_mode": "prose", + "output_valid": false, + "matched_intent_source": "deterministic", + "matched_anchor_type": "entity", + "matched_anchor_value": "UnknownEntity", + "exact_anchor_match": false, + "docs_layers_requested": [ + "D3_ENTITY_CATALOG", + "D1_DOCUMENT_CATALOG", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "docs_layers_with_hits": [ + "D3_ENTITY_CATALOG", + "D1_DOCUMENT_CATALOG", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "planned_layers": [ + "D3_ENTITY_CATALOG", + "D1_DOCUMENT_CATALOG", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "executed_layers": [ + "D3_ENTITY_CATALOG", + "D1_DOCUMENT_CATALOG", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "non_empty_layers": [ + "D3_ENTITY_CATALOG", + "D1_DOCUMENT_CATALOG", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "layer_diagnostics": { + "D3_ENTITY_CATALOG": { + "hits": 8, + "top_ids": [ + "api.control_actions_endpoint", + "api.health_endpoint" + ] + }, + "D1_DOCUMENT_CATALOG": { + "hits": 6, + "top_ids": [ + "docs/README.md", + "api.control_actions_endpoint", + "api.health_endpoint", + "api.send_message_endpoint", + "architecture.telegram_notify_app" + ] + }, + "D5_RELATION_GRAPH": { + "hits": 6, + "top_ids": [ + "5f4909bde905cd3d294ad307074a05e4ae4deefcafe6272cd2d0436e73acb8dd", + "711fb2edb82dd222deaba3c91768b18cbbd453009235823282813c6e867dc2c1", + "eec79f7a02b804337e791ef231784862ae26e0599eb20224790e9d4f085fa9c0", + "c718b1939621233295ccaf6e8203e7fd94f3dd1bfb88f10c51bc5e33d53a24aa", + "616f5cbf25da83cb51d8d0741a7fc351620c9ca2c6513fa2094b4aa476f0912a" + ] + }, + "D0_DOC_CHUNKS": { + "hits": 6, + "top_ids": [ + "docs/README.md", + "api.control_actions_endpoint" + ] + } + }, + "query_entity_candidates": [ + "UnknownEntity" + ], + "resolved_entity_candidates": [], + "query_anchor_candidates": [ + "UnknownEntity" + ], + "resolved_anchor_candidates": [], + "anchor_candidates": [], + "selected_anchor": null, + "anchor_selection_reason": "", + "anchor_match_type": "", + "doc_ids": [], + "doc_paths": [], + "doc_titles": [], + "relation_hits_count": 0, + "relation_targets": [], + "fallback_doc_hits_count": 0, + "fallback_used": false, + "fact_hits": 0, + "entity_hits": 0, + "evidence_summary": { + "documents": 0, + "facts": 0, + "relations": 0, + "chunks": 0, + "entity_hits": 0, + "openapi_signals": { + "path_found": false, + "method_found": false, + "request_schema": false, + "response_schema": false, + "status_codes": false, + "payload_description": false + } + }, + "gate_decision": "reject", + "gate_decision_reason": "not_found_exact_anchor", + "gate_missing_requirements": [ + "retrieval_non_empty", + "exact_anchor_match" + ], + "gate_satisfied_requirements": [], + "openapi_evidence": { + "path_found": false, + "method_found": false, + "request_schema": false, + "response_schema": false, + "status_codes": false, + "payload_description": false + }, + "requested_fragment_type": null, + "fragment_evidence_found": [], + "fragment_missing_requirements": [], + "answer_mode": "degraded", + "degrade_reason": "not_found_exact_anchor", + "degraded_reason": "not_found_exact_anchor", + "code_intents_stubbed": false +} + +## LLM Request +- prompt_name: docs_explain_answer +- log_context: graph.project_qa.docs.answer + +### Prompt Stats +```json +{ + "system_chars": 393, + "user_chars": 174, + "tokens_in_estimate": 142 +} +``` + +### System Prompt +```text +Ты объясняешь документацию системы. + +На вход приходит JSON с полями: +- question +- intent +- sub_intent +- documents +- facts +- relations + +Правила: +- Используй только предоставленные факты +- Не додумывай +- Если данных недостаточно, скажи это явно +- Объясняй структурировано + +Формат ответа: +1. Краткое описание +2. Основные элементы +3. Как это работает +4. Связи с другими частями системы (если есть) +``` + +### User Prompt +```json +{ + "question": "Объясни сущность UnknownEntity", + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "ENTITY_EXPLAIN", + "documents": [], + "facts": [], + "relations": [] +} +``` + +### User Prompt Overview +- question: Объясни сущность UnknownEntity +- intent: DOCUMENTATION_EXPLAIN +- sub_intent: ENTITY_EXPLAIN +- documents: 0 +- facts: 0 +- relations: 0 + +## Mismatches +- none \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/docs_router_deterministic/20260326_125615/full_chain_docs_intents_v3-3x_v3-negative-3.json b/tests/pipeline_setup_v3/test_results/docs_router_deterministic/20260326_125615/full_chain_docs_intents_v3-3x_v3-negative-3.json new file mode 100644 index 0000000..e9871ad --- /dev/null +++ b/tests/pipeline_setup_v3/test_results/docs_router_deterministic/20260326_125615/full_chain_docs_intents_v3-3x_v3-negative-3.json @@ -0,0 +1,81 @@ +{ + "meta": { + "case_id": "v3-negative-3", + "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_03_docs/full_chain_docs_intents_v3-3x.yaml", + "runner": "agent_runtime", + "mode": "pre_llm", + "passed": true, + "mismatches": [], + "actual": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "API_METHOD_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START", + "rag_count": 0, + "llm_answer": "", + "answer_mode": "degraded", + "path_scope": [], + "doc_scope": [], + "entity_candidates": [], + "symbol_candidates": [], + "layers": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D4_WORKFLOW_INDEX", + "D0_DOC_CHUNKS" + ], + "filters": { + "doc_type": "api_method" + }, + "pipeline_mode": "pre_llm_only", + "gate_decision": "reject", + "prompt_used": "docs_explain_answer", + "llm_mode": "prose", + "degraded_reason": "not_found_exact_anchor", + "code_intents_stubbed": true + } + }, + "pipeline_steps": [ + { + "step": "input_query", + "input": { + "query": "Что делает endpoint /unknown?" + }, + "output": { + "query": "Что делает endpoint /unknown?" + } + }, + { + "step": "router", + "input": { + "query": "Что делает endpoint /unknown?" + }, + "output": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "API_METHOD_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START" + } + }, + { + "step": "docs_pipeline", + "input": { + "query": "Что делает endpoint /unknown?" + }, + "output": { + "answer_mode": "degraded", + "prompt_name": "docs_explain_answer", + "llm_request": { + "prompt_name": "docs_explain_answer", + "log_context": "graph.project_qa.docs.answer", + "prompt_stats": { + "system_chars": 393, + "user_chars": 177, + "tokens_in_estimate": 143 + } + }, + "degraded_reason": "not_found_exact_anchor" + } + } + ] +} \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/docs_router_deterministic/20260326_125615/full_chain_docs_intents_v3-3x_v3-negative-3.md b/tests/pipeline_setup_v3/test_results/docs_router_deterministic/20260326_125615/full_chain_docs_intents_v3-3x_v3-negative-3.md new file mode 100644 index 0000000..ef0e013 --- /dev/null +++ b/tests/pipeline_setup_v3/test_results/docs_router_deterministic/20260326_125615/full_chain_docs_intents_v3-3x_v3-negative-3.md @@ -0,0 +1,303 @@ +# v3-negative-3 + +- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_03_docs/full_chain_docs_intents_v3-3x.yaml +- runner: agent_runtime +- mode: pre_llm +- passed: True + +## Query +Что делает endpoint /unknown? + +## Actual +{ + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "API_METHOD_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START", + "rag_count": 0, + "llm_answer": "", + "answer_mode": "degraded", + "path_scope": [], + "doc_scope": [], + "entity_candidates": [], + "symbol_candidates": [], + "layers": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D4_WORKFLOW_INDEX", + "D0_DOC_CHUNKS" + ], + "filters": { + "doc_type": "api_method" + }, + "pipeline_mode": "pre_llm_only", + "gate_decision": "reject", + "prompt_used": "docs_explain_answer", + "llm_mode": "prose", + "degraded_reason": "not_found_exact_anchor", + "code_intents_stubbed": true +} + +## Pipeline Steps +### input_query +```json +{ + "input": { + "query": "Что делает endpoint /unknown?" + }, + "output": { + "query": "Что делает endpoint /unknown?" + } +} +``` + +### router +```json +{ + "input": { + "query": "Что делает endpoint /unknown?" + }, + "output": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "API_METHOD_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START" + } +} +``` + +### docs_pipeline +```json +{ + "input": { + "query": "Что делает endpoint /unknown?" + }, + "output": { + "answer_mode": "degraded", + "prompt_name": "docs_explain_answer", + "llm_request": { + "prompt_name": "docs_explain_answer", + "log_context": "graph.project_qa.docs.answer", + "prompt_stats": { + "system_chars": 393, + "user_chars": 177, + "tokens_in_estimate": 143 + } + }, + "degraded_reason": "not_found_exact_anchor" + } +} +``` + +## Diagnostics +{ + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "API_METHOD_EXPLAIN", + "layers_used": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D4_WORKFLOW_INDEX", + "D0_DOC_CHUNKS" + ], + "documents_found": 0, + "facts_found": 0, + "relations_found": 0, + "openapi_fields_extracted": 0, + "missing_required_fields": [], + "openapi_status": { + "has_path": false, + "has_method": false, + "has_request": false, + "has_response": false + }, + "prompt_used": "docs_explain_answer", + "llm_mode": "prose", + "output_valid": false, + "matched_intent_source": "deterministic", + "matched_anchor_type": "endpoint", + "matched_anchor_value": "/unknown", + "exact_anchor_match": false, + "docs_layers_requested": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D4_WORKFLOW_INDEX", + "D0_DOC_CHUNKS" + ], + "docs_layers_with_hits": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D4_WORKFLOW_INDEX", + "D0_DOC_CHUNKS" + ], + "planned_layers": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D4_WORKFLOW_INDEX", + "D0_DOC_CHUNKS" + ], + "executed_layers": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D4_WORKFLOW_INDEX", + "D0_DOC_CHUNKS" + ], + "non_empty_layers": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D4_WORKFLOW_INDEX", + "D0_DOC_CHUNKS" + ], + "layer_diagnostics": { + "D1_DOCUMENT_CATALOG": { + "hits": 6, + "top_ids": [ + "api.send_message_endpoint", + "api.control_actions_endpoint", + "api.health_endpoint", + "docs/README.md", + "architecture.telegram_notify_app" + ] + }, + "D2_FACT_INDEX": { + "hits": 8, + "top_ids": [ + "f85d982c272a2ee6baeadc433221a20e684cd8ef01cb4788d6f76d05ca56d6d0", + "b8e44c3adb74aaa6c91ae8815fa091289e58dd3990a3a1b63e850c62075aea75", + "bafb867ffed41c9db637df98d6cd5f6722d7747bbebc6c03e6f0d0caf3b7f9f3", + "54bbcbac242f1c85ec3280236ed5841998a8a3a548ff16cbf0b5acafbff469e3", + "b6bfad59b3bf00f199b5ef90c1208af19664de700413e7354468a93a4abaaa2f" + ] + }, + "D4_WORKFLOW_INDEX": { + "hits": 3, + "top_ids": [ + "api.control_actions_endpoint", + "api.health_endpoint", + "api.send_message_endpoint" + ] + }, + "D0_DOC_CHUNKS": { + "hits": 6, + "top_ids": [ + "api.control_actions_endpoint" + ] + } + }, + "query_entity_candidates": [], + "resolved_entity_candidates": [], + "query_anchor_candidates": [ + "/unknown" + ], + "resolved_anchor_candidates": [], + "anchor_candidates": [], + "selected_anchor": null, + "anchor_selection_reason": "", + "anchor_match_type": "", + "doc_ids": [], + "doc_paths": [], + "doc_titles": [], + "relation_hits_count": 0, + "relation_targets": [], + "fallback_doc_hits_count": 0, + "fallback_used": false, + "fact_hits": 0, + "entity_hits": 0, + "evidence_summary": { + "documents": 0, + "facts": 0, + "relations": 0, + "chunks": 0, + "entity_hits": 0, + "openapi_signals": { + "path_found": false, + "method_found": false, + "request_schema": false, + "response_schema": false, + "status_codes": false, + "payload_description": false + } + }, + "gate_decision": "reject", + "gate_decision_reason": "not_found_exact_anchor", + "gate_missing_requirements": [ + "retrieval_non_empty", + "exact_anchor_match" + ], + "gate_satisfied_requirements": [], + "openapi_evidence": { + "path_found": false, + "method_found": false, + "request_schema": false, + "response_schema": false, + "status_codes": false, + "payload_description": false + }, + "requested_fragment_type": null, + "fragment_evidence_found": [], + "fragment_missing_requirements": [], + "answer_mode": "degraded", + "degrade_reason": "not_found_exact_anchor", + "degraded_reason": "not_found_exact_anchor", + "code_intents_stubbed": false +} + +## LLM Request +- prompt_name: docs_explain_answer +- log_context: graph.project_qa.docs.answer + +### Prompt Stats +```json +{ + "system_chars": 393, + "user_chars": 177, + "tokens_in_estimate": 143 +} +``` + +### System Prompt +```text +Ты объясняешь документацию системы. + +На вход приходит JSON с полями: +- question +- intent +- sub_intent +- documents +- facts +- relations + +Правила: +- Используй только предоставленные факты +- Не додумывай +- Если данных недостаточно, скажи это явно +- Объясняй структурировано + +Формат ответа: +1. Краткое описание +2. Основные элементы +3. Как это работает +4. Связи с другими частями системы (если есть) +``` + +### User Prompt +```json +{ + "question": "Что делает endpoint /unknown?", + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "API_METHOD_EXPLAIN", + "documents": [], + "facts": [], + "relations": [] +} +``` + +### User Prompt Overview +- question: Что делает endpoint /unknown? +- intent: DOCUMENTATION_EXPLAIN +- sub_intent: API_METHOD_EXPLAIN +- documents: 0 +- facts: 0 +- relations: 0 + +## Mismatches +- none \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/docs_router_deterministic/20260326_125615/full_chain_docs_intents_v3-3x_v3-related-architecture-1.json b/tests/pipeline_setup_v3/test_results/docs_router_deterministic/20260326_125615/full_chain_docs_intents_v3-3x_v3-related-architecture-1.json new file mode 100644 index 0000000..9069b9d --- /dev/null +++ b/tests/pipeline_setup_v3/test_results/docs_router_deterministic/20260326_125615/full_chain_docs_intents_v3-3x_v3-related-architecture-1.json @@ -0,0 +1,84 @@ +{ + "meta": { + "case_id": "v3-related-architecture-1", + "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_03_docs/full_chain_docs_intents_v3-3x.yaml", + "runner": "agent_runtime", + "mode": "pre_llm", + "passed": true, + "mismatches": [], + "actual": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "RELATED_DOCS_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START", + "rag_count": 14, + "llm_answer": "", + "answer_mode": "answered", + "path_scope": [], + "doc_scope": [ + "api.control_actions_endpoint", + "api.health_endpoint", + "api.send_message_endpoint" + ], + "entity_candidates": [], + "symbol_candidates": [], + "layers": [ + "D5_RELATION_GRAPH", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "filters": { + "doc_type": null + }, + "pipeline_mode": "pre_llm_only", + "gate_decision": "allow", + "prompt_used": "docs_explain_answer", + "llm_mode": "graph_summary", + "degraded_reason": null, + "code_intents_stubbed": true + } + }, + "pipeline_steps": [ + { + "step": "input_query", + "input": { + "query": "Какие документы связаны с архитектурой?" + }, + "output": { + "query": "Какие документы связаны с архитектурой?" + } + }, + { + "step": "router", + "input": { + "query": "Какие документы связаны с архитектурой?" + }, + "output": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "RELATED_DOCS_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START" + } + }, + { + "step": "docs_pipeline", + "input": { + "query": "Какие документы связаны с архитектурой?" + }, + "output": { + "answer_mode": "ready", + "prompt_name": "docs_explain_answer", + "llm_request": { + "prompt_name": "docs_explain_answer", + "log_context": "graph.project_qa.docs.answer", + "prompt_stats": { + "system_chars": 393, + "user_chars": 7994, + "tokens_in_estimate": 2097 + } + }, + "degraded_reason": "" + } + } + ] +} \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/docs_router_deterministic/20260326_125615/full_chain_docs_intents_v3-3x_v3-related-architecture-1.md b/tests/pipeline_setup_v3/test_results/docs_router_deterministic/20260326_125615/full_chain_docs_intents_v3-3x_v3-related-architecture-1.md new file mode 100644 index 0000000..ef5b057 --- /dev/null +++ b/tests/pipeline_setup_v3/test_results/docs_router_deterministic/20260326_125615/full_chain_docs_intents_v3-3x_v3-related-architecture-1.md @@ -0,0 +1,513 @@ +# v3-related-architecture-1 + +- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_03_docs/full_chain_docs_intents_v3-3x.yaml +- runner: agent_runtime +- mode: pre_llm +- passed: True + +## Query +Какие документы связаны с архитектурой? + +## Actual +{ + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "RELATED_DOCS_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START", + "rag_count": 14, + "llm_answer": "", + "answer_mode": "answered", + "path_scope": [], + "doc_scope": [ + "api.control_actions_endpoint", + "api.health_endpoint", + "api.send_message_endpoint" + ], + "entity_candidates": [], + "symbol_candidates": [], + "layers": [ + "D5_RELATION_GRAPH", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "filters": { + "doc_type": null + }, + "pipeline_mode": "pre_llm_only", + "gate_decision": "allow", + "prompt_used": "docs_explain_answer", + "llm_mode": "graph_summary", + "degraded_reason": null, + "code_intents_stubbed": true +} + +## Pipeline Steps +### input_query +```json +{ + "input": { + "query": "Какие документы связаны с архитектурой?" + }, + "output": { + "query": "Какие документы связаны с архитектурой?" + } +} +``` + +### router +```json +{ + "input": { + "query": "Какие документы связаны с архитектурой?" + }, + "output": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "RELATED_DOCS_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START" + } +} +``` + +### docs_pipeline +```json +{ + "input": { + "query": "Какие документы связаны с архитектурой?" + }, + "output": { + "answer_mode": "ready", + "prompt_name": "docs_explain_answer", + "llm_request": { + "prompt_name": "docs_explain_answer", + "log_context": "graph.project_qa.docs.answer", + "prompt_stats": { + "system_chars": 393, + "user_chars": 7994, + "tokens_in_estimate": 2097 + } + }, + "degraded_reason": "" + } +} +``` + +## Diagnostics +{ + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "RELATED_DOCS_EXPLAIN", + "layers_used": [ + "D5_RELATION_GRAPH", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "documents_found": 0, + "facts_found": 0, + "relations_found": 8, + "openapi_fields_extracted": 0, + "missing_required_fields": [], + "openapi_status": { + "has_path": false, + "has_method": false, + "has_request": false, + "has_response": false + }, + "prompt_used": "docs_explain_answer", + "llm_mode": "graph_summary", + "output_valid": true, + "matched_intent_source": "deterministic", + "matched_anchor_type": "none", + "matched_anchor_value": null, + "exact_anchor_match": false, + "docs_layers_requested": [ + "D5_RELATION_GRAPH", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "docs_layers_with_hits": [ + "D5_RELATION_GRAPH" + ], + "planned_layers": [ + "D5_RELATION_GRAPH", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "executed_layers": [ + "D5_RELATION_GRAPH" + ], + "non_empty_layers": [ + "D5_RELATION_GRAPH" + ], + "layer_diagnostics": { + "D5_RELATION_GRAPH": { + "hits": 8, + "top_ids": [ + "5f4909bde905cd3d294ad307074a05e4ae4deefcafe6272cd2d0436e73acb8dd", + "711fb2edb82dd222deaba3c91768b18cbbd453009235823282813c6e867dc2c1", + "eec79f7a02b804337e791ef231784862ae26e0599eb20224790e9d4f085fa9c0", + "c718b1939621233295ccaf6e8203e7fd94f3dd1bfb88f10c51bc5e33d53a24aa", + "616f5cbf25da83cb51d8d0741a7fc351620c9ca2c6513fa2094b4aa476f0912a" + ] + }, + "D1_DOCUMENT_CATALOG": { + "hits": 0, + "top_ids": [], + "skipped": true, + "reason": "relation_primary_sufficient" + }, + "D0_DOC_CHUNKS": { + "hits": 6, + "top_ids": [ + "api.control_actions_endpoint" + ] + } + }, + "query_entity_candidates": [], + "resolved_entity_candidates": [], + "query_anchor_candidates": [], + "resolved_anchor_candidates": [ + "docs/documentation/api/control-actions-endpoint.md", + "docs/documentation/api/health-endpoint.md", + "docs/documentation/api/send-message-endpoint.md", + "api.control_actions_endpoint" + ], + "anchor_candidates": [ + "api.control_actions_endpoint", + "api.health_endpoint", + "api.send_message_endpoint" + ], + "selected_anchor": "api.control_actions_endpoint", + "anchor_selection_reason": "relation_neighbor", + "anchor_match_type": "semantic_fallback", + "doc_ids": [ + "api.control_actions_endpoint", + "api.health_endpoint", + "api.send_message_endpoint" + ], + "doc_paths": [ + "docs/documentation/api/control-actions-endpoint.md", + "docs/documentation/api/health-endpoint.md", + "docs/documentation/api/send-message-endpoint.md" + ], + "doc_titles": [ + "api.control_actions_endpoint:part_of", + "api.control_actions_endpoint:related_api", + "api.control_actions_endpoint:related_logic", + "api.health_endpoint:parent", + "api.health_endpoint:part_of", + "api.health_endpoint:depends_on", + "api.send_message_endpoint:parent", + "api.control_actions_endpoint:parent", + "api.control_actions_endpoint:Summary", + "api.control_actions_endpoint:Описание", + "api.control_actions_endpoint:Сценарий", + "api.control_actions_endpoint:Функциональные требования", + "api.control_actions_endpoint:Нефункциональные требования", + "api.control_actions_endpoint:Входные параметры" + ], + "relation_hits_count": 8, + "relation_targets": [ + "api.control_actions_endpoint:part_of", + "api.control_actions_endpoint:related_api", + "api.control_actions_endpoint:related_logic", + "api.health_endpoint:parent", + "api.health_endpoint:part_of", + "api.health_endpoint:depends_on", + "api.send_message_endpoint:parent", + "api.control_actions_endpoint:parent" + ], + "fallback_doc_hits_count": 6, + "fallback_used": true, + "fact_hits": 0, + "entity_hits": 0, + "evidence_summary": { + "documents": 0, + "facts": 0, + "relations": 8, + "chunks": 6, + "entity_hits": 0, + "openapi_signals": { + "path_found": false, + "method_found": false, + "request_schema": false, + "response_schema": false, + "status_codes": false, + "payload_description": false + } + }, + "gate_decision": "allow", + "gate_decision_reason": "relation_evidence_available", + "gate_missing_requirements": [], + "gate_satisfied_requirements": [ + "retrieval_non_empty" + ], + "openapi_evidence": { + "path_found": false, + "method_found": false, + "request_schema": false, + "response_schema": false, + "status_codes": false, + "payload_description": false + }, + "requested_fragment_type": null, + "fragment_evidence_found": [], + "fragment_missing_requirements": [], + "answer_mode": "ready", + "degrade_reason": null, + "degraded_reason": null, + "code_intents_stubbed": false +} + +## LLM Request +- prompt_name: docs_explain_answer +- log_context: graph.project_qa.docs.answer + +### Prompt Stats +```json +{ + "system_chars": 393, + "user_chars": 7994, + "tokens_in_estimate": 2097 +} +``` + +### System Prompt +```text +Ты объясняешь документацию системы. + +На вход приходит JSON с полями: +- question +- intent +- sub_intent +- documents +- facts +- relations + +Правила: +- Используй только предоставленные факты +- Не додумывай +- Если данных недостаточно, скажи это явно +- Объясняй структурировано + +Формат ответа: +1. Краткое описание +2. Основные элементы +3. Как это работает +4. Связи с другими частями системы (если есть) +``` + +### User Prompt +```json +{ + "question": "Какие документы связаны с архитектурой?", + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "RELATED_DOCS_EXPLAIN", + "documents": [], + "facts": [], + "relations": [ + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "api.control_actions_endpoint:part_of", + "content": "api.control_actions_endpoint part_of architecture.telegram_notify_app", + "metadata": { + "owner": null, + "anchor": "frontmatter.links", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "source_id": "api.control_actions_endpoint", + "target_id": "architecture.telegram_notify_app", + "doc_version": null, + "relation_id": "5f4909bde905cd3d294ad307074a05e4ae4deefcafe6272cd2d0436e73acb8dd", + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "part_of", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "api.control_actions_endpoint:related_api", + "content": "api.control_actions_endpoint related_api api.health_endpoint", + "metadata": { + "owner": null, + "anchor": "frontmatter.links", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "source_id": "api.control_actions_endpoint", + "target_id": "api.health_endpoint", + "doc_version": null, + "relation_id": "711fb2edb82dd222deaba3c91768b18cbbd453009235823282813c6e867dc2c1", + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "related_api", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "api.control_actions_endpoint:related_logic", + "content": "api.control_actions_endpoint related_logic logic.telegram_notification_loop", + "metadata": { + "owner": null, + "anchor": "frontmatter.links", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "source_id": "api.control_actions_endpoint", + "target_id": "logic.telegram_notification_loop", + "doc_version": null, + "relation_id": "eec79f7a02b804337e791ef231784862ae26e0599eb20224790e9d4f085fa9c0", + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "related_logic", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/api/health-endpoint.md", + "title": "api.health_endpoint:parent", + "content": "api.health_endpoint parent architecture.telegram_notify_app", + "metadata": { + "owner": null, + "anchor": "frontmatter.parent", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "8b5a533a8076e2e9d36995eee29aeade260080bdca2ec8e21fe28f08574b983f", + "source_id": "api.health_endpoint", + "target_id": "architecture.telegram_notify_app", + "doc_version": null, + "relation_id": "c718b1939621233295ccaf6e8203e7fd94f3dd1bfb88f10c51bc5e33d53a24aa", + "source_path": "docs/documentation/api/health-endpoint.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "parent", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/api/health-endpoint.md", + "title": "api.health_endpoint:part_of", + "content": "api.health_endpoint part_of architecture.telegram_notify_app", + "metadata": { + "owner": null, + "anchor": "frontmatter.links", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "8b5a533a8076e2e9d36995eee29aeade260080bdca2ec8e21fe28f08574b983f", + "source_id": "api.health_endpoint", + "target_id": "architecture.telegram_notify_app", + "doc_version": null, + "relation_id": "616f5cbf25da83cb51d8d0741a7fc351620c9ca2c6513fa2094b4aa476f0912a", + "source_path": "docs/documentation/api/health-endpoint.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "part_of", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/api/health-endpoint.md", + "title": "api.health_endpoint:depends_on", + "content": "api.health_endpoint depends_on domain.runtime_health", + "metadata": { + "owner": null, + "anchor": "frontmatter.links", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "8b5a533a8076e2e9d36995eee29aeade260080bdca2ec8e21fe28f08574b983f", + "source_id": "api.health_endpoint", + "target_id": "domain.runtime_health", + "doc_version": null, + "relation_id": "77f5d358ab85b3d92018b6b51da7c39773148dfd346686e8832a45370c841160", + "source_path": "docs/documentation/api/health-endpoint.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "depends_on", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/api/send-message-endpoint.md", + "title": "api.send_message_endpoint:parent", + "content": "api.send_message_endpoint parent architecture.telegram_notify_app", + "metadata": { + "owner": null, + "anchor": "frontmatter.parent", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "5fbf2e33510b0676a3a53b957a4569bd3c2c31fb7719546602c573421ccaa32d", + "source_id": "api.send_message_endpoint", + "target_id": "architecture.telegram_notify_app", + "doc_version": null, + "relation_id": "33eb0aa97f06d0afcaa4c230b5f5b73fa2fbfa5861ea9367b6c92f8a6fe0c054", + "source_path": "docs/documentation/api/send-message-endpoint.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "parent", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "api.control_actions_endpoint:parent", + "content": "api.control_actions_endpoint parent architecture.telegram_notify_app", + "metadata": { + "owner": null, + "anchor": "frontmatter.parent", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "source_id": "api.control_actions_endpoint", + "target_id": "architecture.telegram_notify_app", + "doc_version": null, + "relation_id": "afec31fd062e392dcd9699a92c7ab61fd4b1273c1a2b16702b23d55d8d0c47ac", + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "parent", + "staleness_score": null, + "system_component": null + } + } + ] +} +``` + +### User Prompt Overview +- question: Какие документы связаны с архитектурой? +- intent: DOCUMENTATION_EXPLAIN +- sub_intent: RELATED_DOCS_EXPLAIN +- documents: 0 +- facts: 0 +- relations: 8 | samples: api.control_actions_endpoint:part_of, api.control_actions_endpoint:related_api, api.control_actions_endpoint:related_logic + +## Mismatches +- none \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/docs_router_deterministic/20260326_125615/full_chain_docs_intents_v3-3x_v3-related-health-1.json b/tests/pipeline_setup_v3/test_results/docs_router_deterministic/20260326_125615/full_chain_docs_intents_v3-3x_v3-related-health-1.json new file mode 100644 index 0000000..1faf371 --- /dev/null +++ b/tests/pipeline_setup_v3/test_results/docs_router_deterministic/20260326_125615/full_chain_docs_intents_v3-3x_v3-related-health-1.json @@ -0,0 +1,84 @@ +{ + "meta": { + "case_id": "v3-related-health-1", + "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_03_docs/full_chain_docs_intents_v3-3x.yaml", + "runner": "agent_runtime", + "mode": "pre_llm", + "passed": true, + "mismatches": [], + "actual": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "RELATED_DOCS_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START", + "rag_count": 14, + "llm_answer": "", + "answer_mode": "answered", + "path_scope": [], + "doc_scope": [ + "api.health_endpoint", + "domain.runtime_health", + "api.control_actions_endpoint" + ], + "entity_candidates": [], + "symbol_candidates": [], + "layers": [ + "D5_RELATION_GRAPH", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "filters": { + "doc_type": null + }, + "pipeline_mode": "pre_llm_only", + "gate_decision": "allow", + "prompt_used": "docs_explain_answer", + "llm_mode": "graph_summary", + "degraded_reason": null, + "code_intents_stubbed": true + } + }, + "pipeline_steps": [ + { + "step": "input_query", + "input": { + "query": "Что связано с /health?" + }, + "output": { + "query": "Что связано с /health?" + } + }, + { + "step": "router", + "input": { + "query": "Что связано с /health?" + }, + "output": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "RELATED_DOCS_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START" + } + }, + { + "step": "docs_pipeline", + "input": { + "query": "Что связано с /health?" + }, + "output": { + "answer_mode": "ready", + "prompt_name": "docs_explain_answer", + "llm_request": { + "prompt_name": "docs_explain_answer", + "log_context": "graph.project_qa.docs.answer", + "prompt_stats": { + "system_chars": 393, + "user_chars": 7884, + "tokens_in_estimate": 2070 + } + }, + "degraded_reason": "" + } + } + ] +} \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/docs_router_deterministic/20260326_125615/full_chain_docs_intents_v3-3x_v3-related-health-1.md b/tests/pipeline_setup_v3/test_results/docs_router_deterministic/20260326_125615/full_chain_docs_intents_v3-3x_v3-related-health-1.md new file mode 100644 index 0000000..5ccb24d --- /dev/null +++ b/tests/pipeline_setup_v3/test_results/docs_router_deterministic/20260326_125615/full_chain_docs_intents_v3-3x_v3-related-health-1.md @@ -0,0 +1,516 @@ +# v3-related-health-1 + +- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_03_docs/full_chain_docs_intents_v3-3x.yaml +- runner: agent_runtime +- mode: pre_llm +- passed: True + +## Query +Что связано с /health? + +## Actual +{ + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "RELATED_DOCS_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START", + "rag_count": 14, + "llm_answer": "", + "answer_mode": "answered", + "path_scope": [], + "doc_scope": [ + "api.health_endpoint", + "domain.runtime_health", + "api.control_actions_endpoint" + ], + "entity_candidates": [], + "symbol_candidates": [], + "layers": [ + "D5_RELATION_GRAPH", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "filters": { + "doc_type": null + }, + "pipeline_mode": "pre_llm_only", + "gate_decision": "allow", + "prompt_used": "docs_explain_answer", + "llm_mode": "graph_summary", + "degraded_reason": null, + "code_intents_stubbed": true +} + +## Pipeline Steps +### input_query +```json +{ + "input": { + "query": "Что связано с /health?" + }, + "output": { + "query": "Что связано с /health?" + } +} +``` + +### router +```json +{ + "input": { + "query": "Что связано с /health?" + }, + "output": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "RELATED_DOCS_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START" + } +} +``` + +### docs_pipeline +```json +{ + "input": { + "query": "Что связано с /health?" + }, + "output": { + "answer_mode": "ready", + "prompt_name": "docs_explain_answer", + "llm_request": { + "prompt_name": "docs_explain_answer", + "log_context": "graph.project_qa.docs.answer", + "prompt_stats": { + "system_chars": 393, + "user_chars": 7884, + "tokens_in_estimate": 2070 + } + }, + "degraded_reason": "" + } +} +``` + +## Diagnostics +{ + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "RELATED_DOCS_EXPLAIN", + "layers_used": [ + "D5_RELATION_GRAPH", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "documents_found": 0, + "facts_found": 0, + "relations_found": 8, + "openapi_fields_extracted": 0, + "missing_required_fields": [], + "openapi_status": { + "has_path": false, + "has_method": false, + "has_request": false, + "has_response": false + }, + "prompt_used": "docs_explain_answer", + "llm_mode": "graph_summary", + "output_valid": true, + "matched_intent_source": "deterministic", + "matched_anchor_type": "endpoint", + "matched_anchor_value": "/health", + "exact_anchor_match": false, + "docs_layers_requested": [ + "D5_RELATION_GRAPH", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "docs_layers_with_hits": [ + "D5_RELATION_GRAPH" + ], + "planned_layers": [ + "D5_RELATION_GRAPH", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "executed_layers": [ + "D5_RELATION_GRAPH" + ], + "non_empty_layers": [ + "D5_RELATION_GRAPH" + ], + "layer_diagnostics": { + "D5_RELATION_GRAPH": { + "hits": 8, + "top_ids": [ + "801650f8bcbfbfbefd35c14447bfef7b3c3827313db790efa7faf47db860f8c4", + "8595d7b82fecdb7ef579fa8961cda6799bb21970061e5bc221d4dd7a3d53fd04", + "af2a4f7c1b677b908410ba720915405e10dbd0870e30a3c6e3aa2468550ddf0e", + "c718b1939621233295ccaf6e8203e7fd94f3dd1bfb88f10c51bc5e33d53a24aa", + "616f5cbf25da83cb51d8d0741a7fc351620c9ca2c6513fa2094b4aa476f0912a" + ] + }, + "D1_DOCUMENT_CATALOG": { + "hits": 0, + "top_ids": [], + "skipped": true, + "reason": "relation_primary_sufficient" + }, + "D0_DOC_CHUNKS": { + "hits": 6, + "top_ids": [ + "api.control_actions_endpoint" + ] + } + }, + "query_entity_candidates": [], + "resolved_entity_candidates": [], + "query_anchor_candidates": [ + "/health" + ], + "resolved_anchor_candidates": [ + "docs/documentation/domain/runtime-health-entity.md", + "docs/documentation/api/health-endpoint.md", + "docs/documentation/api/control-actions-endpoint.md", + "api.control_actions_endpoint" + ], + "anchor_candidates": [ + "api.health_endpoint", + "domain.runtime_health", + "api.control_actions_endpoint" + ], + "selected_anchor": "api.health_endpoint", + "anchor_selection_reason": "doc_id matches requested endpoint slug", + "anchor_match_type": "exact_path", + "doc_ids": [ + "api.health_endpoint", + "domain.runtime_health", + "api.control_actions_endpoint" + ], + "doc_paths": [ + "docs/documentation/domain/runtime-health-entity.md", + "docs/documentation/api/health-endpoint.md", + "docs/documentation/api/control-actions-endpoint.md" + ], + "doc_titles": [ + "domain.runtime_health:used_by", + "domain.runtime_health:related_logic", + "domain.runtime_health:part_of", + "api.health_endpoint:parent", + "api.health_endpoint:part_of", + "api.health_endpoint:depends_on", + "domain.runtime_health:parent", + "api.control_actions_endpoint:related_api", + "api.control_actions_endpoint:Summary", + "api.control_actions_endpoint:Описание", + "api.control_actions_endpoint:Сценарий", + "api.control_actions_endpoint:Функциональные требования", + "api.control_actions_endpoint:Нефункциональные требования", + "api.control_actions_endpoint:Входные параметры" + ], + "relation_hits_count": 8, + "relation_targets": [ + "domain.runtime_health:used_by", + "domain.runtime_health:related_logic", + "domain.runtime_health:part_of", + "api.health_endpoint:parent", + "api.health_endpoint:part_of", + "api.health_endpoint:depends_on", + "domain.runtime_health:parent", + "api.control_actions_endpoint:related_api" + ], + "fallback_doc_hits_count": 6, + "fallback_used": true, + "fact_hits": 0, + "entity_hits": 0, + "evidence_summary": { + "documents": 0, + "facts": 0, + "relations": 8, + "chunks": 6, + "entity_hits": 0, + "openapi_signals": { + "path_found": false, + "method_found": false, + "request_schema": false, + "response_schema": false, + "status_codes": false, + "payload_description": false + } + }, + "gate_decision": "allow", + "gate_decision_reason": "relation_evidence_available", + "gate_missing_requirements": [], + "gate_satisfied_requirements": [ + "retrieval_non_empty", + "exact_anchor_match" + ], + "openapi_evidence": { + "path_found": false, + "method_found": false, + "request_schema": false, + "response_schema": false, + "status_codes": false, + "payload_description": false + }, + "requested_fragment_type": null, + "fragment_evidence_found": [], + "fragment_missing_requirements": [], + "answer_mode": "ready", + "degrade_reason": null, + "degraded_reason": null, + "code_intents_stubbed": false +} + +## LLM Request +- prompt_name: docs_explain_answer +- log_context: graph.project_qa.docs.answer + +### Prompt Stats +```json +{ + "system_chars": 393, + "user_chars": 7884, + "tokens_in_estimate": 2070 +} +``` + +### System Prompt +```text +Ты объясняешь документацию системы. + +На вход приходит JSON с полями: +- question +- intent +- sub_intent +- documents +- facts +- relations + +Правила: +- Используй только предоставленные факты +- Не додумывай +- Если данных недостаточно, скажи это явно +- Объясняй структурировано + +Формат ответа: +1. Краткое описание +2. Основные элементы +3. Как это работает +4. Связи с другими частями системы (если есть) +``` + +### User Prompt +```json +{ + "question": "Что связано с /health?", + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "RELATED_DOCS_EXPLAIN", + "documents": [], + "facts": [], + "relations": [ + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/domain/runtime-health-entity.md", + "title": "domain.runtime_health:used_by", + "content": "domain.runtime_health used_by api.health_endpoint", + "metadata": { + "owner": null, + "anchor": "frontmatter.links", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "37d4dcf470ea3de95d59e44786006e369a3ea11bf5dbf4c88877696e9183ee87", + "source_id": "domain.runtime_health", + "target_id": "api.health_endpoint", + "doc_version": null, + "relation_id": "801650f8bcbfbfbefd35c14447bfef7b3c3827313db790efa7faf47db860f8c4", + "source_path": "docs/documentation/domain/runtime-health-entity.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "used_by", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/domain/runtime-health-entity.md", + "title": "domain.runtime_health:related_logic", + "content": "domain.runtime_health related_logic logic.telegram_notification_loop", + "metadata": { + "owner": null, + "anchor": "frontmatter.links", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "37d4dcf470ea3de95d59e44786006e369a3ea11bf5dbf4c88877696e9183ee87", + "source_id": "domain.runtime_health", + "target_id": "logic.telegram_notification_loop", + "doc_version": null, + "relation_id": "8595d7b82fecdb7ef579fa8961cda6799bb21970061e5bc221d4dd7a3d53fd04", + "source_path": "docs/documentation/domain/runtime-health-entity.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "related_logic", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/domain/runtime-health-entity.md", + "title": "domain.runtime_health:part_of", + "content": "domain.runtime_health part_of architecture.telegram_notify_app", + "metadata": { + "owner": null, + "anchor": "frontmatter.links", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "37d4dcf470ea3de95d59e44786006e369a3ea11bf5dbf4c88877696e9183ee87", + "source_id": "domain.runtime_health", + "target_id": "architecture.telegram_notify_app", + "doc_version": null, + "relation_id": "af2a4f7c1b677b908410ba720915405e10dbd0870e30a3c6e3aa2468550ddf0e", + "source_path": "docs/documentation/domain/runtime-health-entity.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "part_of", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/api/health-endpoint.md", + "title": "api.health_endpoint:parent", + "content": "api.health_endpoint parent architecture.telegram_notify_app", + "metadata": { + "owner": null, + "anchor": "frontmatter.parent", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "8b5a533a8076e2e9d36995eee29aeade260080bdca2ec8e21fe28f08574b983f", + "source_id": "api.health_endpoint", + "target_id": "architecture.telegram_notify_app", + "doc_version": null, + "relation_id": "c718b1939621233295ccaf6e8203e7fd94f3dd1bfb88f10c51bc5e33d53a24aa", + "source_path": "docs/documentation/api/health-endpoint.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "parent", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/api/health-endpoint.md", + "title": "api.health_endpoint:part_of", + "content": "api.health_endpoint part_of architecture.telegram_notify_app", + "metadata": { + "owner": null, + "anchor": "frontmatter.links", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "8b5a533a8076e2e9d36995eee29aeade260080bdca2ec8e21fe28f08574b983f", + "source_id": "api.health_endpoint", + "target_id": "architecture.telegram_notify_app", + "doc_version": null, + "relation_id": "616f5cbf25da83cb51d8d0741a7fc351620c9ca2c6513fa2094b4aa476f0912a", + "source_path": "docs/documentation/api/health-endpoint.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "part_of", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/api/health-endpoint.md", + "title": "api.health_endpoint:depends_on", + "content": "api.health_endpoint depends_on domain.runtime_health", + "metadata": { + "owner": null, + "anchor": "frontmatter.links", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "8b5a533a8076e2e9d36995eee29aeade260080bdca2ec8e21fe28f08574b983f", + "source_id": "api.health_endpoint", + "target_id": "domain.runtime_health", + "doc_version": null, + "relation_id": "77f5d358ab85b3d92018b6b51da7c39773148dfd346686e8832a45370c841160", + "source_path": "docs/documentation/api/health-endpoint.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "depends_on", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/domain/runtime-health-entity.md", + "title": "domain.runtime_health:parent", + "content": "domain.runtime_health parent architecture.telegram_notify_app", + "metadata": { + "owner": null, + "anchor": "frontmatter.parent", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "37d4dcf470ea3de95d59e44786006e369a3ea11bf5dbf4c88877696e9183ee87", + "source_id": "domain.runtime_health", + "target_id": "architecture.telegram_notify_app", + "doc_version": null, + "relation_id": "79bdb0a74713df6064008179ca8c5c186dc23e4e1c5e2c9607b0bdddeba50f93", + "source_path": "docs/documentation/domain/runtime-health-entity.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "parent", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "api.control_actions_endpoint:related_api", + "content": "api.control_actions_endpoint related_api api.health_endpoint", + "metadata": { + "owner": null, + "anchor": "frontmatter.links", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "source_id": "api.control_actions_endpoint", + "target_id": "api.health_endpoint", + "doc_version": null, + "relation_id": "711fb2edb82dd222deaba3c91768b18cbbd453009235823282813c6e867dc2c1", + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "related_api", + "staleness_score": null, + "system_component": null + } + } + ] +} +``` + +### User Prompt Overview +- question: Что связано с /health? +- intent: DOCUMENTATION_EXPLAIN +- sub_intent: RELATED_DOCS_EXPLAIN +- documents: 0 +- facts: 0 +- relations: 8 | samples: domain.runtime_health:used_by, domain.runtime_health:related_logic, domain.runtime_health:part_of + +## Mismatches +- none \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/docs_router_deterministic/20260326_125615/full_chain_docs_intents_v3-3x_v3-related-health-2.json b/tests/pipeline_setup_v3/test_results/docs_router_deterministic/20260326_125615/full_chain_docs_intents_v3-3x_v3-related-health-2.json new file mode 100644 index 0000000..1115fd3 --- /dev/null +++ b/tests/pipeline_setup_v3/test_results/docs_router_deterministic/20260326_125615/full_chain_docs_intents_v3-3x_v3-related-health-2.json @@ -0,0 +1,84 @@ +{ + "meta": { + "case_id": "v3-related-health-2", + "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_03_docs/full_chain_docs_intents_v3-3x.yaml", + "runner": "agent_runtime", + "mode": "pre_llm", + "passed": true, + "mismatches": [], + "actual": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "RELATED_DOCS_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START", + "rag_count": 14, + "llm_answer": "", + "answer_mode": "answered", + "path_scope": [], + "doc_scope": [ + "api.control_actions_endpoint", + "api.health_endpoint", + "api.send_message_endpoint" + ], + "entity_candidates": [], + "symbol_candidates": [], + "layers": [ + "D5_RELATION_GRAPH", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "filters": { + "doc_type": null + }, + "pipeline_mode": "pre_llm_only", + "gate_decision": "allow", + "prompt_used": "docs_explain_answer", + "llm_mode": "graph_summary", + "degraded_reason": null, + "code_intents_stubbed": true + } + }, + "pipeline_steps": [ + { + "step": "input_query", + "input": { + "query": "Какие документы относятся к health endpoint?" + }, + "output": { + "query": "Какие документы относятся к health endpoint?" + } + }, + { + "step": "router", + "input": { + "query": "Какие документы относятся к health endpoint?" + }, + "output": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "RELATED_DOCS_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START" + } + }, + { + "step": "docs_pipeline", + "input": { + "query": "Какие документы относятся к health endpoint?" + }, + "output": { + "answer_mode": "ready", + "prompt_name": "docs_explain_answer", + "llm_request": { + "prompt_name": "docs_explain_answer", + "log_context": "graph.project_qa.docs.answer", + "prompt_stats": { + "system_chars": 393, + "user_chars": 7999, + "tokens_in_estimate": 2098 + } + }, + "degraded_reason": "" + } + } + ] +} \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/docs_router_deterministic/20260326_125615/full_chain_docs_intents_v3-3x_v3-related-health-2.md b/tests/pipeline_setup_v3/test_results/docs_router_deterministic/20260326_125615/full_chain_docs_intents_v3-3x_v3-related-health-2.md new file mode 100644 index 0000000..d4f15d9 --- /dev/null +++ b/tests/pipeline_setup_v3/test_results/docs_router_deterministic/20260326_125615/full_chain_docs_intents_v3-3x_v3-related-health-2.md @@ -0,0 +1,513 @@ +# v3-related-health-2 + +- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_03_docs/full_chain_docs_intents_v3-3x.yaml +- runner: agent_runtime +- mode: pre_llm +- passed: True + +## Query +Какие документы относятся к health endpoint? + +## Actual +{ + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "RELATED_DOCS_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START", + "rag_count": 14, + "llm_answer": "", + "answer_mode": "answered", + "path_scope": [], + "doc_scope": [ + "api.control_actions_endpoint", + "api.health_endpoint", + "api.send_message_endpoint" + ], + "entity_candidates": [], + "symbol_candidates": [], + "layers": [ + "D5_RELATION_GRAPH", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "filters": { + "doc_type": null + }, + "pipeline_mode": "pre_llm_only", + "gate_decision": "allow", + "prompt_used": "docs_explain_answer", + "llm_mode": "graph_summary", + "degraded_reason": null, + "code_intents_stubbed": true +} + +## Pipeline Steps +### input_query +```json +{ + "input": { + "query": "Какие документы относятся к health endpoint?" + }, + "output": { + "query": "Какие документы относятся к health endpoint?" + } +} +``` + +### router +```json +{ + "input": { + "query": "Какие документы относятся к health endpoint?" + }, + "output": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "RELATED_DOCS_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START" + } +} +``` + +### docs_pipeline +```json +{ + "input": { + "query": "Какие документы относятся к health endpoint?" + }, + "output": { + "answer_mode": "ready", + "prompt_name": "docs_explain_answer", + "llm_request": { + "prompt_name": "docs_explain_answer", + "log_context": "graph.project_qa.docs.answer", + "prompt_stats": { + "system_chars": 393, + "user_chars": 7999, + "tokens_in_estimate": 2098 + } + }, + "degraded_reason": "" + } +} +``` + +## Diagnostics +{ + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "RELATED_DOCS_EXPLAIN", + "layers_used": [ + "D5_RELATION_GRAPH", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "documents_found": 0, + "facts_found": 0, + "relations_found": 8, + "openapi_fields_extracted": 0, + "missing_required_fields": [], + "openapi_status": { + "has_path": false, + "has_method": false, + "has_request": false, + "has_response": false + }, + "prompt_used": "docs_explain_answer", + "llm_mode": "graph_summary", + "output_valid": true, + "matched_intent_source": "deterministic", + "matched_anchor_type": "topic", + "matched_anchor_value": null, + "exact_anchor_match": false, + "docs_layers_requested": [ + "D5_RELATION_GRAPH", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "docs_layers_with_hits": [ + "D5_RELATION_GRAPH" + ], + "planned_layers": [ + "D5_RELATION_GRAPH", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "executed_layers": [ + "D5_RELATION_GRAPH" + ], + "non_empty_layers": [ + "D5_RELATION_GRAPH" + ], + "layer_diagnostics": { + "D5_RELATION_GRAPH": { + "hits": 8, + "top_ids": [ + "5f4909bde905cd3d294ad307074a05e4ae4deefcafe6272cd2d0436e73acb8dd", + "711fb2edb82dd222deaba3c91768b18cbbd453009235823282813c6e867dc2c1", + "eec79f7a02b804337e791ef231784862ae26e0599eb20224790e9d4f085fa9c0", + "c718b1939621233295ccaf6e8203e7fd94f3dd1bfb88f10c51bc5e33d53a24aa", + "616f5cbf25da83cb51d8d0741a7fc351620c9ca2c6513fa2094b4aa476f0912a" + ] + }, + "D1_DOCUMENT_CATALOG": { + "hits": 0, + "top_ids": [], + "skipped": true, + "reason": "relation_primary_sufficient" + }, + "D0_DOC_CHUNKS": { + "hits": 6, + "top_ids": [ + "api.control_actions_endpoint" + ] + } + }, + "query_entity_candidates": [], + "resolved_entity_candidates": [], + "query_anchor_candidates": [], + "resolved_anchor_candidates": [ + "docs/documentation/api/control-actions-endpoint.md", + "docs/documentation/api/health-endpoint.md", + "docs/documentation/api/send-message-endpoint.md", + "api.control_actions_endpoint" + ], + "anchor_candidates": [ + "api.control_actions_endpoint", + "api.health_endpoint", + "api.send_message_endpoint" + ], + "selected_anchor": "api.control_actions_endpoint", + "anchor_selection_reason": "relation_neighbor", + "anchor_match_type": "semantic_fallback", + "doc_ids": [ + "api.control_actions_endpoint", + "api.health_endpoint", + "api.send_message_endpoint" + ], + "doc_paths": [ + "docs/documentation/api/control-actions-endpoint.md", + "docs/documentation/api/health-endpoint.md", + "docs/documentation/api/send-message-endpoint.md" + ], + "doc_titles": [ + "api.control_actions_endpoint:part_of", + "api.control_actions_endpoint:related_api", + "api.control_actions_endpoint:related_logic", + "api.health_endpoint:parent", + "api.health_endpoint:part_of", + "api.health_endpoint:depends_on", + "api.send_message_endpoint:parent", + "api.control_actions_endpoint:parent", + "api.control_actions_endpoint:Summary", + "api.control_actions_endpoint:Описание", + "api.control_actions_endpoint:Сценарий", + "api.control_actions_endpoint:Функциональные требования", + "api.control_actions_endpoint:Нефункциональные требования", + "api.control_actions_endpoint:Входные параметры" + ], + "relation_hits_count": 8, + "relation_targets": [ + "api.control_actions_endpoint:part_of", + "api.control_actions_endpoint:related_api", + "api.control_actions_endpoint:related_logic", + "api.health_endpoint:parent", + "api.health_endpoint:part_of", + "api.health_endpoint:depends_on", + "api.send_message_endpoint:parent", + "api.control_actions_endpoint:parent" + ], + "fallback_doc_hits_count": 6, + "fallback_used": true, + "fact_hits": 0, + "entity_hits": 0, + "evidence_summary": { + "documents": 0, + "facts": 0, + "relations": 8, + "chunks": 6, + "entity_hits": 0, + "openapi_signals": { + "path_found": false, + "method_found": false, + "request_schema": false, + "response_schema": false, + "status_codes": false, + "payload_description": false + } + }, + "gate_decision": "allow", + "gate_decision_reason": "relation_evidence_available", + "gate_missing_requirements": [], + "gate_satisfied_requirements": [ + "retrieval_non_empty" + ], + "openapi_evidence": { + "path_found": false, + "method_found": false, + "request_schema": false, + "response_schema": false, + "status_codes": false, + "payload_description": false + }, + "requested_fragment_type": null, + "fragment_evidence_found": [], + "fragment_missing_requirements": [], + "answer_mode": "ready", + "degrade_reason": null, + "degraded_reason": null, + "code_intents_stubbed": false +} + +## LLM Request +- prompt_name: docs_explain_answer +- log_context: graph.project_qa.docs.answer + +### Prompt Stats +```json +{ + "system_chars": 393, + "user_chars": 7999, + "tokens_in_estimate": 2098 +} +``` + +### System Prompt +```text +Ты объясняешь документацию системы. + +На вход приходит JSON с полями: +- question +- intent +- sub_intent +- documents +- facts +- relations + +Правила: +- Используй только предоставленные факты +- Не додумывай +- Если данных недостаточно, скажи это явно +- Объясняй структурировано + +Формат ответа: +1. Краткое описание +2. Основные элементы +3. Как это работает +4. Связи с другими частями системы (если есть) +``` + +### User Prompt +```json +{ + "question": "Какие документы относятся к health endpoint?", + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "RELATED_DOCS_EXPLAIN", + "documents": [], + "facts": [], + "relations": [ + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "api.control_actions_endpoint:part_of", + "content": "api.control_actions_endpoint part_of architecture.telegram_notify_app", + "metadata": { + "owner": null, + "anchor": "frontmatter.links", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "source_id": "api.control_actions_endpoint", + "target_id": "architecture.telegram_notify_app", + "doc_version": null, + "relation_id": "5f4909bde905cd3d294ad307074a05e4ae4deefcafe6272cd2d0436e73acb8dd", + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "part_of", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "api.control_actions_endpoint:related_api", + "content": "api.control_actions_endpoint related_api api.health_endpoint", + "metadata": { + "owner": null, + "anchor": "frontmatter.links", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "source_id": "api.control_actions_endpoint", + "target_id": "api.health_endpoint", + "doc_version": null, + "relation_id": "711fb2edb82dd222deaba3c91768b18cbbd453009235823282813c6e867dc2c1", + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "related_api", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "api.control_actions_endpoint:related_logic", + "content": "api.control_actions_endpoint related_logic logic.telegram_notification_loop", + "metadata": { + "owner": null, + "anchor": "frontmatter.links", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "source_id": "api.control_actions_endpoint", + "target_id": "logic.telegram_notification_loop", + "doc_version": null, + "relation_id": "eec79f7a02b804337e791ef231784862ae26e0599eb20224790e9d4f085fa9c0", + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "related_logic", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/api/health-endpoint.md", + "title": "api.health_endpoint:parent", + "content": "api.health_endpoint parent architecture.telegram_notify_app", + "metadata": { + "owner": null, + "anchor": "frontmatter.parent", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "8b5a533a8076e2e9d36995eee29aeade260080bdca2ec8e21fe28f08574b983f", + "source_id": "api.health_endpoint", + "target_id": "architecture.telegram_notify_app", + "doc_version": null, + "relation_id": "c718b1939621233295ccaf6e8203e7fd94f3dd1bfb88f10c51bc5e33d53a24aa", + "source_path": "docs/documentation/api/health-endpoint.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "parent", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/api/health-endpoint.md", + "title": "api.health_endpoint:part_of", + "content": "api.health_endpoint part_of architecture.telegram_notify_app", + "metadata": { + "owner": null, + "anchor": "frontmatter.links", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "8b5a533a8076e2e9d36995eee29aeade260080bdca2ec8e21fe28f08574b983f", + "source_id": "api.health_endpoint", + "target_id": "architecture.telegram_notify_app", + "doc_version": null, + "relation_id": "616f5cbf25da83cb51d8d0741a7fc351620c9ca2c6513fa2094b4aa476f0912a", + "source_path": "docs/documentation/api/health-endpoint.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "part_of", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/api/health-endpoint.md", + "title": "api.health_endpoint:depends_on", + "content": "api.health_endpoint depends_on domain.runtime_health", + "metadata": { + "owner": null, + "anchor": "frontmatter.links", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "8b5a533a8076e2e9d36995eee29aeade260080bdca2ec8e21fe28f08574b983f", + "source_id": "api.health_endpoint", + "target_id": "domain.runtime_health", + "doc_version": null, + "relation_id": "77f5d358ab85b3d92018b6b51da7c39773148dfd346686e8832a45370c841160", + "source_path": "docs/documentation/api/health-endpoint.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "depends_on", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/api/send-message-endpoint.md", + "title": "api.send_message_endpoint:parent", + "content": "api.send_message_endpoint parent architecture.telegram_notify_app", + "metadata": { + "owner": null, + "anchor": "frontmatter.parent", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "5fbf2e33510b0676a3a53b957a4569bd3c2c31fb7719546602c573421ccaa32d", + "source_id": "api.send_message_endpoint", + "target_id": "architecture.telegram_notify_app", + "doc_version": null, + "relation_id": "33eb0aa97f06d0afcaa4c230b5f5b73fa2fbfa5861ea9367b6c92f8a6fe0c054", + "source_path": "docs/documentation/api/send-message-endpoint.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "parent", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "api.control_actions_endpoint:parent", + "content": "api.control_actions_endpoint parent architecture.telegram_notify_app", + "metadata": { + "owner": null, + "anchor": "frontmatter.parent", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "source_id": "api.control_actions_endpoint", + "target_id": "architecture.telegram_notify_app", + "doc_version": null, + "relation_id": "afec31fd062e392dcd9699a92c7ab61fd4b1273c1a2b16702b23d55d8d0c47ac", + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "parent", + "staleness_score": null, + "system_component": null + } + } + ] +} +``` + +### User Prompt Overview +- question: Какие документы относятся к health endpoint? +- intent: DOCUMENTATION_EXPLAIN +- sub_intent: RELATED_DOCS_EXPLAIN +- documents: 0 +- facts: 0 +- relations: 8 | samples: api.control_actions_endpoint:part_of, api.control_actions_endpoint:related_api, api.control_actions_endpoint:related_logic + +## Mismatches +- none \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/docs_router_deterministic/20260326_125615/full_chain_docs_intents_v3-3x_v3-related-send-1.json b/tests/pipeline_setup_v3/test_results/docs_router_deterministic/20260326_125615/full_chain_docs_intents_v3-3x_v3-related-send-1.json new file mode 100644 index 0000000..c9caa6a --- /dev/null +++ b/tests/pipeline_setup_v3/test_results/docs_router_deterministic/20260326_125615/full_chain_docs_intents_v3-3x_v3-related-send-1.json @@ -0,0 +1,85 @@ +{ + "meta": { + "case_id": "v3-related-send-1", + "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_03_docs/full_chain_docs_intents_v3-3x.yaml", + "runner": "agent_runtime", + "mode": "pre_llm", + "passed": true, + "mismatches": [], + "actual": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "RELATED_DOCS_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START", + "rag_count": 14, + "llm_answer": "", + "answer_mode": "answered", + "path_scope": [], + "doc_scope": [ + "api.send_message_endpoint", + "architecture.telegram_notify_app_overview", + "logic.telegram_notification_loop", + "api.health_endpoint" + ], + "entity_candidates": [], + "symbol_candidates": [], + "layers": [ + "D5_RELATION_GRAPH", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "filters": { + "doc_type": null + }, + "pipeline_mode": "pre_llm_only", + "gate_decision": "allow", + "prompt_used": "docs_explain_answer", + "llm_mode": "graph_summary", + "degraded_reason": null, + "code_intents_stubbed": true + } + }, + "pipeline_steps": [ + { + "step": "input_query", + "input": { + "query": "Какие документы связаны с /send?" + }, + "output": { + "query": "Какие документы связаны с /send?" + } + }, + { + "step": "router", + "input": { + "query": "Какие документы связаны с /send?" + }, + "output": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "RELATED_DOCS_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START" + } + }, + { + "step": "docs_pipeline", + "input": { + "query": "Какие документы связаны с /send?" + }, + "output": { + "answer_mode": "ready", + "prompt_name": "docs_explain_answer", + "llm_request": { + "prompt_name": "docs_explain_answer", + "log_context": "graph.project_qa.docs.answer", + "prompt_stats": { + "system_chars": 393, + "user_chars": 8086, + "tokens_in_estimate": 2120 + } + }, + "degraded_reason": "" + } + } + ] +} \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/docs_router_deterministic/20260326_125615/full_chain_docs_intents_v3-3x_v3-related-send-1.md b/tests/pipeline_setup_v3/test_results/docs_router_deterministic/20260326_125615/full_chain_docs_intents_v3-3x_v3-related-send-1.md new file mode 100644 index 0000000..8df42cc --- /dev/null +++ b/tests/pipeline_setup_v3/test_results/docs_router_deterministic/20260326_125615/full_chain_docs_intents_v3-3x_v3-related-send-1.md @@ -0,0 +1,521 @@ +# v3-related-send-1 + +- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_03_docs/full_chain_docs_intents_v3-3x.yaml +- runner: agent_runtime +- mode: pre_llm +- passed: True + +## Query +Какие документы связаны с /send? + +## Actual +{ + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "RELATED_DOCS_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START", + "rag_count": 14, + "llm_answer": "", + "answer_mode": "answered", + "path_scope": [], + "doc_scope": [ + "api.send_message_endpoint", + "architecture.telegram_notify_app_overview", + "logic.telegram_notification_loop", + "api.health_endpoint" + ], + "entity_candidates": [], + "symbol_candidates": [], + "layers": [ + "D5_RELATION_GRAPH", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "filters": { + "doc_type": null + }, + "pipeline_mode": "pre_llm_only", + "gate_decision": "allow", + "prompt_used": "docs_explain_answer", + "llm_mode": "graph_summary", + "degraded_reason": null, + "code_intents_stubbed": true +} + +## Pipeline Steps +### input_query +```json +{ + "input": { + "query": "Какие документы связаны с /send?" + }, + "output": { + "query": "Какие документы связаны с /send?" + } +} +``` + +### router +```json +{ + "input": { + "query": "Какие документы связаны с /send?" + }, + "output": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "RELATED_DOCS_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START" + } +} +``` + +### docs_pipeline +```json +{ + "input": { + "query": "Какие документы связаны с /send?" + }, + "output": { + "answer_mode": "ready", + "prompt_name": "docs_explain_answer", + "llm_request": { + "prompt_name": "docs_explain_answer", + "log_context": "graph.project_qa.docs.answer", + "prompt_stats": { + "system_chars": 393, + "user_chars": 8086, + "tokens_in_estimate": 2120 + } + }, + "degraded_reason": "" + } +} +``` + +## Diagnostics +{ + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "RELATED_DOCS_EXPLAIN", + "layers_used": [ + "D5_RELATION_GRAPH", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "documents_found": 0, + "facts_found": 0, + "relations_found": 8, + "openapi_fields_extracted": 0, + "missing_required_fields": [], + "openapi_status": { + "has_path": false, + "has_method": false, + "has_request": false, + "has_response": false + }, + "prompt_used": "docs_explain_answer", + "llm_mode": "graph_summary", + "output_valid": true, + "matched_intent_source": "deterministic", + "matched_anchor_type": "endpoint", + "matched_anchor_value": "/send", + "exact_anchor_match": false, + "docs_layers_requested": [ + "D5_RELATION_GRAPH", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "docs_layers_with_hits": [ + "D5_RELATION_GRAPH" + ], + "planned_layers": [ + "D5_RELATION_GRAPH", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "executed_layers": [ + "D5_RELATION_GRAPH" + ], + "non_empty_layers": [ + "D5_RELATION_GRAPH" + ], + "layer_diagnostics": { + "D5_RELATION_GRAPH": { + "hits": 8, + "top_ids": [ + "33eb0aa97f06d0afcaa4c230b5f5b73fa2fbfa5861ea9367b6c92f8a6fe0c054", + "53dbf99d1ed72fb30e988fa7080e6ec3d0028d2a1e896e4e818f2492cc161bf5", + "a5c452b6685216d12fc857cd5b10a19b347655b1f1fd9f59d64fd413e93e36a5", + "d3d3ce25ca6434582c9bbb8f94ab89c7a2a497f46f1124f7e335c217281d42d9", + "305bab0c6567d93a2b453a9d70b676f9ecd8de083ef36f5cf3398747c25ebf94" + ] + }, + "D1_DOCUMENT_CATALOG": { + "hits": 0, + "top_ids": [], + "skipped": true, + "reason": "relation_primary_sufficient" + }, + "D0_DOC_CHUNKS": { + "hits": 6, + "top_ids": [ + "api.health_endpoint" + ] + } + }, + "query_entity_candidates": [], + "resolved_entity_candidates": [], + "query_anchor_candidates": [ + "/send" + ], + "resolved_anchor_candidates": [ + "docs/documentation/api/send-message-endpoint.md", + "docs/documentation/architecture/telegram-notify-app-overview.md", + "docs/documentation/logic/telegram-notification-loop.md", + "docs/documentation/api/health-endpoint.md", + "api.health_endpoint" + ], + "anchor_candidates": [ + "api.send_message_endpoint", + "api.health_endpoint", + "architecture.telegram_notify_app_overview", + "logic.telegram_notification_loop" + ], + "selected_anchor": "api.send_message_endpoint", + "anchor_selection_reason": "doc_id matches requested endpoint slug", + "anchor_match_type": "exact_path", + "doc_ids": [ + "api.send_message_endpoint", + "architecture.telegram_notify_app_overview", + "logic.telegram_notification_loop", + "api.health_endpoint" + ], + "doc_paths": [ + "docs/documentation/api/send-message-endpoint.md", + "docs/documentation/architecture/telegram-notify-app-overview.md", + "docs/documentation/logic/telegram-notification-loop.md", + "docs/documentation/api/health-endpoint.md" + ], + "doc_titles": [ + "api.send_message_endpoint:parent", + "api.send_message_endpoint:depends_on", + "api.send_message_endpoint:part_of", + "architecture.telegram_notify_app:related_api", + "architecture.telegram_notify_app:child", + "logic.telegram_notification_loop:related_api", + "api.health_endpoint:depends_on", + "api.health_endpoint:part_of", + "api.health_endpoint:Summary", + "api.health_endpoint:Описание", + "api.health_endpoint:Сценарий", + "api.health_endpoint:Функциональные требования", + "api.health_endpoint:Нефункциональные требования", + "api.health_endpoint:Входные параметры" + ], + "relation_hits_count": 8, + "relation_targets": [ + "api.send_message_endpoint:parent", + "api.send_message_endpoint:depends_on", + "api.send_message_endpoint:part_of", + "architecture.telegram_notify_app:related_api", + "architecture.telegram_notify_app:child", + "logic.telegram_notification_loop:related_api", + "api.health_endpoint:depends_on", + "api.health_endpoint:part_of" + ], + "fallback_doc_hits_count": 6, + "fallback_used": true, + "fact_hits": 0, + "entity_hits": 0, + "evidence_summary": { + "documents": 0, + "facts": 0, + "relations": 8, + "chunks": 6, + "entity_hits": 0, + "openapi_signals": { + "path_found": false, + "method_found": false, + "request_schema": false, + "response_schema": false, + "status_codes": false, + "payload_description": false + } + }, + "gate_decision": "allow", + "gate_decision_reason": "relation_evidence_available", + "gate_missing_requirements": [], + "gate_satisfied_requirements": [ + "retrieval_non_empty", + "exact_anchor_match" + ], + "openapi_evidence": { + "path_found": false, + "method_found": false, + "request_schema": false, + "response_schema": false, + "status_codes": false, + "payload_description": false + }, + "requested_fragment_type": null, + "fragment_evidence_found": [], + "fragment_missing_requirements": [], + "answer_mode": "ready", + "degrade_reason": null, + "degraded_reason": null, + "code_intents_stubbed": false +} + +## LLM Request +- prompt_name: docs_explain_answer +- log_context: graph.project_qa.docs.answer + +### Prompt Stats +```json +{ + "system_chars": 393, + "user_chars": 8086, + "tokens_in_estimate": 2120 +} +``` + +### System Prompt +```text +Ты объясняешь документацию системы. + +На вход приходит JSON с полями: +- question +- intent +- sub_intent +- documents +- facts +- relations + +Правила: +- Используй только предоставленные факты +- Не додумывай +- Если данных недостаточно, скажи это явно +- Объясняй структурировано + +Формат ответа: +1. Краткое описание +2. Основные элементы +3. Как это работает +4. Связи с другими частями системы (если есть) +``` + +### User Prompt +```json +{ + "question": "Какие документы связаны с /send?", + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "RELATED_DOCS_EXPLAIN", + "documents": [], + "facts": [], + "relations": [ + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/api/send-message-endpoint.md", + "title": "api.send_message_endpoint:parent", + "content": "api.send_message_endpoint parent architecture.telegram_notify_app", + "metadata": { + "owner": null, + "anchor": "frontmatter.parent", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "5fbf2e33510b0676a3a53b957a4569bd3c2c31fb7719546602c573421ccaa32d", + "source_id": "api.send_message_endpoint", + "target_id": "architecture.telegram_notify_app", + "doc_version": null, + "relation_id": "33eb0aa97f06d0afcaa4c230b5f5b73fa2fbfa5861ea9367b6c92f8a6fe0c054", + "source_path": "docs/documentation/api/send-message-endpoint.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "parent", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/api/send-message-endpoint.md", + "title": "api.send_message_endpoint:depends_on", + "content": "api.send_message_endpoint depends_on logic.telegram_notification_loop", + "metadata": { + "owner": null, + "anchor": "frontmatter.links", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "5fbf2e33510b0676a3a53b957a4569bd3c2c31fb7719546602c573421ccaa32d", + "source_id": "api.send_message_endpoint", + "target_id": "logic.telegram_notification_loop", + "doc_version": null, + "relation_id": "53dbf99d1ed72fb30e988fa7080e6ec3d0028d2a1e896e4e818f2492cc161bf5", + "source_path": "docs/documentation/api/send-message-endpoint.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "depends_on", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/api/send-message-endpoint.md", + "title": "api.send_message_endpoint:part_of", + "content": "api.send_message_endpoint part_of architecture.telegram_notify_app", + "metadata": { + "owner": null, + "anchor": "frontmatter.links", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "5fbf2e33510b0676a3a53b957a4569bd3c2c31fb7719546602c573421ccaa32d", + "source_id": "api.send_message_endpoint", + "target_id": "architecture.telegram_notify_app", + "doc_version": null, + "relation_id": "a5c452b6685216d12fc857cd5b10a19b347655b1f1fd9f59d64fd413e93e36a5", + "source_path": "docs/documentation/api/send-message-endpoint.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "part_of", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/architecture/telegram-notify-app-overview.md", + "title": "architecture.telegram_notify_app:related_api", + "content": "architecture.telegram_notify_app related_api api.send_message_endpoint", + "metadata": { + "owner": null, + "anchor": "frontmatter.links", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "8b1cc9f823e55bddbc825466d10a0fdb4ca4354ac02d91f9e2aef7b7d2ec8256", + "source_id": "architecture.telegram_notify_app", + "target_id": "api.send_message_endpoint", + "doc_version": null, + "relation_id": "d3d3ce25ca6434582c9bbb8f94ab89c7a2a497f46f1124f7e335c217281d42d9", + "source_path": "docs/documentation/architecture/telegram-notify-app-overview.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "related_api", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/architecture/telegram-notify-app-overview.md", + "title": "architecture.telegram_notify_app:child", + "content": "architecture.telegram_notify_app child api.send_message_endpoint", + "metadata": { + "owner": null, + "anchor": "frontmatter.children", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "8b1cc9f823e55bddbc825466d10a0fdb4ca4354ac02d91f9e2aef7b7d2ec8256", + "source_id": "architecture.telegram_notify_app", + "target_id": "api.send_message_endpoint", + "doc_version": null, + "relation_id": "305bab0c6567d93a2b453a9d70b676f9ecd8de083ef36f5cf3398747c25ebf94", + "source_path": "docs/documentation/architecture/telegram-notify-app-overview.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "child", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/logic/telegram-notification-loop.md", + "title": "logic.telegram_notification_loop:related_api", + "content": "logic.telegram_notification_loop related_api api.send_message_endpoint", + "metadata": { + "owner": null, + "anchor": "frontmatter.links", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "0f62f9b4dab261ca4ca34575ff5d84411a22c90b780c52eda388782b94f08470", + "source_id": "logic.telegram_notification_loop", + "target_id": "api.send_message_endpoint", + "doc_version": null, + "relation_id": "6b692f308b472d540c199a26362f4ec8d35e1e6859c1141518e0d6667148e981", + "source_path": "docs/documentation/logic/telegram-notification-loop.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "related_api", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/api/health-endpoint.md", + "title": "api.health_endpoint:depends_on", + "content": "api.health_endpoint depends_on domain.runtime_health", + "metadata": { + "owner": null, + "anchor": "frontmatter.links", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "8b5a533a8076e2e9d36995eee29aeade260080bdca2ec8e21fe28f08574b983f", + "source_id": "api.health_endpoint", + "target_id": "domain.runtime_health", + "doc_version": null, + "relation_id": "77f5d358ab85b3d92018b6b51da7c39773148dfd346686e8832a45370c841160", + "source_path": "docs/documentation/api/health-endpoint.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "depends_on", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/api/health-endpoint.md", + "title": "api.health_endpoint:part_of", + "content": "api.health_endpoint part_of architecture.telegram_notify_app", + "metadata": { + "owner": null, + "anchor": "frontmatter.links", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "8b5a533a8076e2e9d36995eee29aeade260080bdca2ec8e21fe28f08574b983f", + "source_id": "api.health_endpoint", + "target_id": "architecture.telegram_notify_app", + "doc_version": null, + "relation_id": "616f5cbf25da83cb51d8d0741a7fc351620c9ca2c6513fa2094b4aa476f0912a", + "source_path": "docs/documentation/api/health-endpoint.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "part_of", + "staleness_score": null, + "system_component": null + } + } + ] +} +``` + +### User Prompt Overview +- question: Какие документы связаны с /send? +- intent: DOCUMENTATION_EXPLAIN +- sub_intent: RELATED_DOCS_EXPLAIN +- documents: 0 +- facts: 0 +- relations: 8 | samples: api.send_message_endpoint:parent, api.send_message_endpoint:depends_on, api.send_message_endpoint:part_of + +## Mismatches +- none \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/docs_router_deterministic/20260326_125615/full_chain_docs_intents_v3-3x_v3-system-flow-health-1.json b/tests/pipeline_setup_v3/test_results/docs_router_deterministic/20260326_125615/full_chain_docs_intents_v3-3x_v3-system-flow-health-1.json new file mode 100644 index 0000000..d19fe0e --- /dev/null +++ b/tests/pipeline_setup_v3/test_results/docs_router_deterministic/20260326_125615/full_chain_docs_intents_v3-3x_v3-system-flow-health-1.json @@ -0,0 +1,87 @@ +{ + "meta": { + "case_id": "v3-system-flow-health-1", + "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_03_docs/full_chain_docs_intents_v3-3x.yaml", + "runner": "agent_runtime", + "mode": "pre_llm", + "passed": false, + "mismatches": [ + "sub_intent: expected SYSTEM_FLOW_EXPLAIN, got GENERIC_QA" + ], + "actual": { + "intent": "GENERAL_QA", + "sub_intent": "GENERIC_QA", + "graph_id": "DocsQAGraph", + "conversation_mode": "START", + "rag_count": 12, + "llm_answer": "", + "answer_mode": "answered", + "path_scope": [], + "doc_scope": [ + "domain.runtime_health", + "api.health_endpoint", + "logic.telegram_notification_loop", + "api.control_actions_endpoint", + "api.actions_endpoint" + ], + "entity_candidates": [], + "symbol_candidates": [], + "layers": [ + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "filters": { + "doc_type": null + }, + "pipeline_mode": "pre_llm_only", + "gate_decision": "allow", + "prompt_used": "docs_general_answer", + "llm_mode": "prose", + "degraded_reason": null, + "code_intents_stubbed": true + } + }, + "pipeline_steps": [ + { + "step": "input_query", + "input": { + "query": "Как работает health check runtime?" + }, + "output": { + "query": "Как работает health check runtime?" + } + }, + { + "step": "router", + "input": { + "query": "Как работает health check runtime?" + }, + "output": { + "intent": "GENERAL_QA", + "sub_intent": "GENERIC_QA", + "graph_id": "DocsQAGraph", + "conversation_mode": "START" + } + }, + { + "step": "docs_pipeline", + "input": { + "query": "Как работает health check runtime?" + }, + "output": { + "answer_mode": "ready", + "prompt_name": "docs_general_answer", + "llm_request": { + "prompt_name": "docs_general_answer", + "log_context": "graph.project_qa.docs.answer", + "prompt_stats": { + "system_chars": 345, + "user_chars": 9461, + "tokens_in_estimate": 2452 + } + }, + "degraded_reason": "" + } + } + ] +} \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/docs_router_deterministic/20260326_125615/full_chain_docs_intents_v3-3x_v3-system-flow-health-1.md b/tests/pipeline_setup_v3/test_results/docs_router_deterministic/20260326_125615/full_chain_docs_intents_v3-3x_v3-system-flow-health-1.md new file mode 100644 index 0000000..dbcff9f --- /dev/null +++ b/tests/pipeline_setup_v3/test_results/docs_router_deterministic/20260326_125615/full_chain_docs_intents_v3-3x_v3-system-flow-health-1.md @@ -0,0 +1,524 @@ +# v3-system-flow-health-1 + +- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_03_docs/full_chain_docs_intents_v3-3x.yaml +- runner: agent_runtime +- mode: pre_llm +- passed: False + +## Query +Как работает health check runtime? + +## Actual +{ + "intent": "GENERAL_QA", + "sub_intent": "GENERIC_QA", + "graph_id": "DocsQAGraph", + "conversation_mode": "START", + "rag_count": 12, + "llm_answer": "", + "answer_mode": "answered", + "path_scope": [], + "doc_scope": [ + "domain.runtime_health", + "api.health_endpoint", + "logic.telegram_notification_loop", + "api.control_actions_endpoint", + "api.actions_endpoint" + ], + "entity_candidates": [], + "symbol_candidates": [], + "layers": [ + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "filters": { + "doc_type": null + }, + "pipeline_mode": "pre_llm_only", + "gate_decision": "allow", + "prompt_used": "docs_general_answer", + "llm_mode": "prose", + "degraded_reason": null, + "code_intents_stubbed": true +} + +## Pipeline Steps +### input_query +```json +{ + "input": { + "query": "Как работает health check runtime?" + }, + "output": { + "query": "Как работает health check runtime?" + } +} +``` + +### router +```json +{ + "input": { + "query": "Как работает health check runtime?" + }, + "output": { + "intent": "GENERAL_QA", + "sub_intent": "GENERIC_QA", + "graph_id": "DocsQAGraph", + "conversation_mode": "START" + } +} +``` + +### docs_pipeline +```json +{ + "input": { + "query": "Как работает health check runtime?" + }, + "output": { + "answer_mode": "ready", + "prompt_name": "docs_general_answer", + "llm_request": { + "prompt_name": "docs_general_answer", + "log_context": "graph.project_qa.docs.answer", + "prompt_stats": { + "system_chars": 345, + "user_chars": 9461, + "tokens_in_estimate": 2452 + } + }, + "degraded_reason": "" + } +} +``` + +## Diagnostics +{ + "intent": "GENERAL_QA", + "sub_intent": "GENERIC_QA", + "layers_used": [ + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "documents_found": 4, + "facts_found": 0, + "relations_found": 0, + "openapi_fields_extracted": 0, + "missing_required_fields": [], + "openapi_status": { + "has_path": false, + "has_method": false, + "has_request": false, + "has_response": false + }, + "prompt_used": "docs_general_answer", + "llm_mode": "prose", + "output_valid": true, + "matched_intent_source": "deterministic", + "matched_anchor_type": "none", + "matched_anchor_value": null, + "exact_anchor_match": false, + "docs_layers_requested": [ + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "docs_layers_with_hits": [ + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "planned_layers": [ + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "executed_layers": [ + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "non_empty_layers": [ + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "layer_diagnostics": { + "D1_DOCUMENT_CATALOG": { + "hits": 4, + "top_ids": [ + "domain.runtime_health", + "api.health_endpoint", + "logic.telegram_notification_loop", + "api.control_actions_endpoint" + ] + }, + "D0_DOC_CHUNKS": { + "hits": 8, + "top_ids": [ + "api.health_endpoint" + ] + } + }, + "query_entity_candidates": [], + "resolved_entity_candidates": [], + "query_anchor_candidates": [], + "resolved_anchor_candidates": [ + "domain.runtime_health", + "docs/documentation/domain/runtime-health-entity.md", + "api.health_endpoint", + "docs/documentation/api/health-endpoint.md", + "logic.telegram_notification_loop", + "docs/documentation/logic/telegram-notification-loop.md", + "api.control_actions_endpoint", + "docs/documentation/api/control-actions-endpoint.md" + ], + "anchor_candidates": [], + "selected_anchor": null, + "anchor_selection_reason": "", + "anchor_match_type": "", + "doc_ids": [ + "domain.runtime_health", + "api.health_endpoint", + "logic.telegram_notification_loop", + "api.control_actions_endpoint", + "api.actions_endpoint" + ], + "doc_paths": [ + "docs/documentation/domain/runtime-health-entity.md", + "docs/documentation/api/health-endpoint.md", + "docs/documentation/logic/telegram-notification-loop.md", + "docs/documentation/api/control-actions-endpoint.md" + ], + "doc_titles": [ + "Сущность runtime health", + "HTTP API /health", + "Цикл отправки уведомлений в Telegram", + "HTTP API /actions/{action}", + "api.health_endpoint:Функциональные требования", + "api.health_endpoint:Выходные параметры", + "api.health_endpoint:Описание", + "api.health_endpoint:Сценарий", + "api.health_endpoint:Нефункциональные требования", + "api.health_endpoint:Входные параметры", + "api.health_endpoint:Summary", + "api.health_endpoint:Пример ответа" + ], + "relation_hits_count": 0, + "relation_targets": [], + "fallback_doc_hits_count": 12, + "fallback_used": false, + "fact_hits": 0, + "entity_hits": 0, + "evidence_summary": { + "documents": 4, + "facts": 0, + "relations": 0, + "chunks": 8, + "entity_hits": 0, + "openapi_signals": { + "path_found": false, + "method_found": false, + "request_schema": false, + "response_schema": false, + "status_codes": false, + "payload_description": false + } + }, + "gate_decision": "allow", + "gate_decision_reason": "evidence_sufficient", + "gate_missing_requirements": [], + "gate_satisfied_requirements": [ + "retrieval_non_empty" + ], + "openapi_evidence": { + "path_found": false, + "method_found": false, + "request_schema": false, + "response_schema": false, + "status_codes": false, + "payload_description": false + }, + "requested_fragment_type": null, + "fragment_evidence_found": [], + "fragment_missing_requirements": [], + "answer_mode": "ready", + "degrade_reason": null, + "degraded_reason": null, + "code_intents_stubbed": false +} + +## LLM Request +- prompt_name: docs_general_answer +- log_context: graph.project_qa.docs.answer + +### Prompt Stats +```json +{ + "system_chars": 345, + "user_chars": 9461, + "tokens_in_estimate": 2452 +} +``` + +### System Prompt +```text +Ты отвечаешь на общий вопрос по документации проекта. + +На вход приходит JSON с полями: +- question +- intent +- sub_intent +- documents +- facts +- relations + +Правила: +- Используй только предоставленные документы и факты +- Не додумывай отсутствующие детали +- Если данных недостаточно, скажи это прямо +- Дай короткий понятный ответ без лишней структуры +``` + +### User Prompt +```json +{ + "question": "Как работает health check runtime?", + "intent": "GENERAL_QA", + "sub_intent": "GENERIC_QA", + "documents": [ + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/domain/runtime-health-entity.md", + "title": "Сущность runtime health", + "content": "`runtime health` — доменная модель наблюдаемости сервиса, которая описывает общее состояние runtime и состояние отдельных компонентов. Для `test_echo_app` главным объектом наблюдения является компонент `telegram_notify`, у которого важны статус, время старта и количество успешных отправок. Эта модель используется для внешнего health-monitoring и внутренней диагностики.", + "metadata": { + "name": "runtime_health", + "tags": [ + "domain", + "health", + "observability" + ], + "type": "domain_entity", + "layer": "domain", + "links": [ + { + "type": "part_of", + "target": "architecture.telegram_notify_app" + }, + { + "type": "used_by", + "target": "api.health_endpoint" + }, + { + "type": "related_logic", + "target": "logic.telegram_notification_loop" + } + ], + "owner": null, + "title": "Сущность runtime health", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "architecture.telegram_notify_app", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "37d4dcf470ea3de95d59e44786006e369a3ea11bf5dbf4c88877696e9183ee87", + "children": [], + "doc_kind": "misc", + "entities": [ + "WorkerHealth", + "WorkerStatus", + "TelegramNotifyWorker" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "domain.runtime_health", + "source_path": "docs/documentation/domain/runtime-health-entity.md", + "summary_text": "`runtime health` — доменная модель наблюдаемости сервиса, которая описывает общее состояние runtime и состояние отдельных компонентов. Для `test_echo_app` главным объектом наблюдения является компонент `telegram_notify`, у которого важны статус, время старта и количество успешных отправок. Эта модель используется для внешнего health-monitoring и внутренней диагностики.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/api/health-endpoint.md", + "title": "HTTP API /health", + "content": "Endpoint `/health` возвращает агрегированный health payload runtime. Если общий статус равен `ok`, API отвечает с HTTP 200; для состояний деградации или неготовности возвращается HTTP 503 с тем же payload. Endpoint служит основной точкой внешней проверки состояния приложения.", + "metadata": { + "name": "health_endpoint", + "tags": [ + "api", + "health", + "control-plane" + ], + "type": "api_method", + "layer": "application", + "links": [ + { + "type": "part_of", + "target": "architecture.telegram_notify_app" + }, + { + "type": "depends_on", + "target": "domain.runtime_health" + } + ], + "owner": null, + "title": "HTTP API /health", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "architecture.telegram_notify_app", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "8b5a533a8076e2e9d36995eee29aeade260080bdca2ec8e21fe28f08574b983f", + "children": [], + "doc_kind": "misc", + "entities": [ + "TelegramControlChannel", + "TelegramNotifyWorker", + "RuntimeManager", + "WorkerHealth" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "api.health_endpoint", + "source_path": "docs/documentation/api/health-endpoint.md", + "summary_text": "Endpoint `/health` возвращает агрегированный health payload runtime. Если общий статус равен `ok`, API отвечает с HTTP 200; для состояний деградации или неготовности возвращается HTTP 503 с тем же payload. Endpoint служит основной точкой внешней проверки состояния приложения.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/logic/telegram-notification-loop.md", + "title": "Цикл отправки уведомлений в Telegram", + "content": "`TelegramNotifyWorker` после старта runtime запускает отдельный поток, сразу делает первую попытку отправки сообщения и затем повторяет отправку через заданный интервал. При ошибках доставки или отсутствии credentials worker не останавливает сервис, а переводит собственное состояние в `degraded`. Этот workflow определяет основной полезный цикл приложения.", + "metadata": { + "name": "telegram_notification_loop", + "tags": [ + "logic", + "telegram", + "worker", + "scheduling" + ], + "type": "logic_block", + "layer": "application", + "links": [ + { + "type": "part_of", + "target": "architecture.telegram_notify_app" + }, + { + "type": "related_api", + "target": "api.send_message_endpoint" + }, + { + "type": "related_api", + "target": "api.control_actions_endpoint" + }, + { + "type": "related_api", + "target": "api.health_endpoint" + } + ], + "owner": null, + "title": "Цикл отправки уведомлений в Telegram", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "architecture.telegram_notify_app", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "0f62f9b4dab261ca4ca34575ff5d84411a22c90b780c52eda388782b94f08470", + "children": [], + "doc_kind": "misc", + "entities": [ + "TelegramNotifyWorker", + "TelegramSendService", + "WorkerHealth", + "WorkerStatus" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "logic.telegram_notification_loop", + "source_path": "docs/documentation/logic/telegram-notification-loop.md", + "summary_text": "`TelegramNotifyWorker` после старта runtime запускает отдельный поток, сразу делает первую попытку отправки сообщения и затем повторяет отправку через заданный интервал. При ошибках доставки или отсутствии credentials worker не останавливает сервис, а переводит собственное состояние в `degraded`. Этот workflow определяет основной полезный цикл приложения.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "HTTP API /actions/{action}", + "content": "Endpoint `/actions/{action}` управляет control actions runtime и поддерживает `start`, `stop` и `status`. Для долгих операций `start` и `stop` допускается ответ HTTP 202, если действие еще выполняется. Endpoint используется для operator-driven управления жизненным циклом worker'а через HTTP API.", + "metadata": { + "name": "control_actions_endpoint", + "tags": [ + "api", + "control-plane", + "lifecycle" + ], + "type": "api_method", + "layer": "application", + "links": [ + { + "type": "part_of", + "target": "architecture.telegram_notify_app" + }, + { + "type": "related_api", + "target": "api.health_endpoint" + }, + { + "type": "related_logic", + "target": "logic.telegram_notification_loop" + } + ], + "owner": null, + "title": "HTTP API /actions/{action}", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "architecture.telegram_notify_app", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "children": [], + "doc_kind": "misc", + "entities": [ + "TelegramControlChannel", + "ControlActionSet", + "JSONResponse" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "api.control_actions_endpoint", + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "summary_text": "Endpoint `/actions/{action}` управляет control actions runtime и поддерживает `start`, `stop` и `status`. Для долгих операций `start` и `stop` допускается ответ HTTP 202, если действие еще выполняется. Endpoint используется для operator-driven управления жизненным циклом worker'а через HTTP API.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + } + ], + "facts": [], + "relations": [] +} +``` + +### User Prompt Overview +- question: Как работает health check runtime? +- intent: GENERAL_QA +- sub_intent: GENERIC_QA +- documents: 4 | samples: Сущность runtime health, HTTP API /health, Цикл отправки уведомлений в Telegram +- facts: 0 +- relations: 0 + +## Mismatches +- sub_intent: expected SYSTEM_FLOW_EXPLAIN, got GENERIC_QA \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/docs_router_deterministic/20260326_125615/full_chain_docs_intents_v3-3x_v3-system-flow-health-2.json b/tests/pipeline_setup_v3/test_results/docs_router_deterministic/20260326_125615/full_chain_docs_intents_v3-3x_v3-system-flow-health-2.json new file mode 100644 index 0000000..b0563b8 --- /dev/null +++ b/tests/pipeline_setup_v3/test_results/docs_router_deterministic/20260326_125615/full_chain_docs_intents_v3-3x_v3-system-flow-health-2.json @@ -0,0 +1,91 @@ +{ + "meta": { + "case_id": "v3-system-flow-health-2", + "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_03_docs/full_chain_docs_intents_v3-3x.yaml", + "runner": "agent_runtime", + "mode": "pre_llm", + "passed": true, + "mismatches": [], + "actual": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "SYSTEM_FLOW_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START", + "rag_count": 23, + "llm_answer": "", + "answer_mode": "answered", + "path_scope": [], + "doc_scope": [ + "domain.runtime_health", + "logic.telegram_notification_loop", + "api.health_endpoint", + "api.control_actions_endpoint", + "api.actions_endpoint", + "architecture.telegram_notify_app", + "architecture.telegram_notify_app_overview", + "api.send_message_endpoint", + "docs/README.md" + ], + "entity_candidates": [], + "symbol_candidates": [], + "layers": [ + "D1_DOCUMENT_CATALOG", + "D4_WORKFLOW_INDEX", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "filters": { + "doc_type": null + }, + "pipeline_mode": "pre_llm_only", + "gate_decision": "allow", + "prompt_used": "docs_explain_answer", + "llm_mode": "prose", + "degraded_reason": null, + "code_intents_stubbed": true + } + }, + "pipeline_steps": [ + { + "step": "input_query", + "input": { + "query": "Как происходит проверка состояния runtime?" + }, + "output": { + "query": "Как происходит проверка состояния runtime?" + } + }, + { + "step": "router", + "input": { + "query": "Как происходит проверка состояния runtime?" + }, + "output": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "SYSTEM_FLOW_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START" + } + }, + { + "step": "docs_pipeline", + "input": { + "query": "Как происходит проверка состояния runtime?" + }, + "output": { + "answer_mode": "ready", + "prompt_name": "docs_explain_answer", + "llm_request": { + "prompt_name": "docs_explain_answer", + "log_context": "graph.project_qa.docs.answer", + "prompt_stats": { + "system_chars": 393, + "user_chars": 22363, + "tokens_in_estimate": 5689 + } + }, + "degraded_reason": "" + } + } + ] +} \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/docs_router_deterministic/20260326_125615/full_chain_docs_intents_v3-3x_v3-system-flow-health-2.md b/tests/pipeline_setup_v3/test_results/docs_router_deterministic/20260326_125615/full_chain_docs_intents_v3-3x_v3-system-flow-health-2.md new file mode 100644 index 0000000..4a84f98 --- /dev/null +++ b/tests/pipeline_setup_v3/test_results/docs_router_deterministic/20260326_125615/full_chain_docs_intents_v3-3x_v3-system-flow-health-2.md @@ -0,0 +1,915 @@ +# v3-system-flow-health-2 + +- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_03_docs/full_chain_docs_intents_v3-3x.yaml +- runner: agent_runtime +- mode: pre_llm +- passed: True + +## Query +Как происходит проверка состояния runtime? + +## Actual +{ + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "SYSTEM_FLOW_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START", + "rag_count": 23, + "llm_answer": "", + "answer_mode": "answered", + "path_scope": [], + "doc_scope": [ + "domain.runtime_health", + "logic.telegram_notification_loop", + "api.health_endpoint", + "api.control_actions_endpoint", + "api.actions_endpoint", + "architecture.telegram_notify_app", + "architecture.telegram_notify_app_overview", + "api.send_message_endpoint", + "docs/README.md" + ], + "entity_candidates": [], + "symbol_candidates": [], + "layers": [ + "D1_DOCUMENT_CATALOG", + "D4_WORKFLOW_INDEX", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "filters": { + "doc_type": null + }, + "pipeline_mode": "pre_llm_only", + "gate_decision": "allow", + "prompt_used": "docs_explain_answer", + "llm_mode": "prose", + "degraded_reason": null, + "code_intents_stubbed": true +} + +## Pipeline Steps +### input_query +```json +{ + "input": { + "query": "Как происходит проверка состояния runtime?" + }, + "output": { + "query": "Как происходит проверка состояния runtime?" + } +} +``` + +### router +```json +{ + "input": { + "query": "Как происходит проверка состояния runtime?" + }, + "output": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "SYSTEM_FLOW_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START" + } +} +``` + +### docs_pipeline +```json +{ + "input": { + "query": "Как происходит проверка состояния runtime?" + }, + "output": { + "answer_mode": "ready", + "prompt_name": "docs_explain_answer", + "llm_request": { + "prompt_name": "docs_explain_answer", + "log_context": "graph.project_qa.docs.answer", + "prompt_stats": { + "system_chars": 393, + "user_chars": 22363, + "tokens_in_estimate": 5689 + } + }, + "degraded_reason": "" + } +} +``` + +## Diagnostics +{ + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "SYSTEM_FLOW_EXPLAIN", + "layers_used": [ + "D1_DOCUMENT_CATALOG", + "D4_WORKFLOW_INDEX", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "documents_found": 6, + "facts_found": 0, + "relations_found": 8, + "openapi_fields_extracted": 0, + "missing_required_fields": [], + "openapi_status": { + "has_path": false, + "has_method": false, + "has_request": false, + "has_response": false + }, + "prompt_used": "docs_explain_answer", + "llm_mode": "prose", + "output_valid": true, + "matched_intent_source": "deterministic", + "matched_anchor_type": "none", + "matched_anchor_value": null, + "exact_anchor_match": false, + "docs_layers_requested": [ + "D1_DOCUMENT_CATALOG", + "D4_WORKFLOW_INDEX", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "docs_layers_with_hits": [ + "D1_DOCUMENT_CATALOG", + "D4_WORKFLOW_INDEX", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "planned_layers": [ + "D1_DOCUMENT_CATALOG", + "D4_WORKFLOW_INDEX", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "executed_layers": [ + "D1_DOCUMENT_CATALOG", + "D4_WORKFLOW_INDEX", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "non_empty_layers": [ + "D1_DOCUMENT_CATALOG", + "D4_WORKFLOW_INDEX", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "layer_diagnostics": { + "D1_DOCUMENT_CATALOG": { + "hits": 6, + "top_ids": [ + "domain.runtime_health", + "logic.telegram_notification_loop", + "api.health_endpoint", + "api.control_actions_endpoint", + "architecture.telegram_notify_app" + ] + }, + "D4_WORKFLOW_INDEX": { + "hits": 3, + "top_ids": [ + "api.health_endpoint", + "api.control_actions_endpoint", + "api.send_message_endpoint" + ] + }, + "D5_RELATION_GRAPH": { + "hits": 8, + "top_ids": [ + "8595d7b82fecdb7ef579fa8961cda6799bb21970061e5bc221d4dd7a3d53fd04", + "801650f8bcbfbfbefd35c14447bfef7b3c3827313db790efa7faf47db860f8c4", + "af2a4f7c1b677b908410ba720915405e10dbd0870e30a3c6e3aa2468550ddf0e", + "79bdb0a74713df6064008179ca8c5c186dc23e4e1c5e2c9607b0bdddeba50f93", + "77f5d358ab85b3d92018b6b51da7c39773148dfd346686e8832a45370c841160" + ] + }, + "D0_DOC_CHUNKS": { + "hits": 6, + "top_ids": [ + "domain.runtime_health", + "docs/README.md", + "api.control_actions_endpoint" + ] + } + }, + "query_entity_candidates": [], + "resolved_entity_candidates": [], + "query_anchor_candidates": [], + "resolved_anchor_candidates": [ + "domain.runtime_health", + "docs/documentation/domain/runtime-health-entity.md", + "logic.telegram_notification_loop", + "docs/documentation/logic/telegram-notification-loop.md", + "api.health_endpoint", + "docs/documentation/api/health-endpoint.md", + "api.control_actions_endpoint", + "docs/documentation/api/control-actions-endpoint.md", + "architecture.telegram_notify_app", + "docs/documentation/architecture/telegram-notify-app-overview.md", + "api.send_message_endpoint", + "docs/documentation/api/send-message-endpoint.md", + "docs/README.md" + ], + "anchor_candidates": [], + "selected_anchor": null, + "anchor_selection_reason": "", + "anchor_match_type": "", + "doc_ids": [ + "domain.runtime_health", + "logic.telegram_notification_loop", + "api.health_endpoint", + "api.control_actions_endpoint", + "api.actions_endpoint", + "architecture.telegram_notify_app", + "architecture.telegram_notify_app_overview", + "api.send_message_endpoint", + "docs/README.md" + ], + "doc_paths": [ + "docs/documentation/domain/runtime-health-entity.md", + "docs/documentation/logic/telegram-notification-loop.md", + "docs/documentation/api/health-endpoint.md", + "docs/documentation/api/control-actions-endpoint.md", + "docs/documentation/architecture/telegram-notify-app-overview.md", + "docs/documentation/api/send-message-endpoint.md", + "docs/README.md" + ], + "doc_titles": [ + "Сущность runtime health", + "Цикл отправки уведомлений в Telegram", + "HTTP API /health", + "HTTP API /actions/{action}", + "Архитектура Telegram Notify App", + "HTTP API /send", + "Scenario", + "domain.runtime_health:related_logic", + "domain.runtime_health:used_by", + "domain.runtime_health:part_of", + "domain.runtime_health:parent", + "api.health_endpoint:depends_on", + "architecture.telegram_notify_app:child", + "architecture.telegram_notify_app:depends_on", + "api.health_endpoint:part_of", + "domain.runtime_health:Details", + "domain.runtime_health:Summary", + "docs/README.md:Навигация", + "api.control_actions_endpoint:Summary", + "api.control_actions_endpoint:Описание", + "api.control_actions_endpoint:Сценарий" + ], + "relation_hits_count": 8, + "relation_targets": [ + "domain.runtime_health:related_logic", + "domain.runtime_health:used_by", + "domain.runtime_health:part_of", + "domain.runtime_health:parent", + "api.health_endpoint:depends_on", + "architecture.telegram_notify_app:child", + "architecture.telegram_notify_app:depends_on", + "api.health_endpoint:part_of" + ], + "fallback_doc_hits_count": 12, + "fallback_used": false, + "fact_hits": 0, + "entity_hits": 0, + "evidence_summary": { + "documents": 6, + "facts": 0, + "relations": 8, + "chunks": 6, + "entity_hits": 0, + "openapi_signals": { + "path_found": false, + "method_found": false, + "request_schema": false, + "response_schema": false, + "status_codes": false, + "payload_description": false + } + }, + "gate_decision": "allow", + "gate_decision_reason": "evidence_sufficient", + "gate_missing_requirements": [], + "gate_satisfied_requirements": [ + "retrieval_non_empty" + ], + "openapi_evidence": { + "path_found": false, + "method_found": false, + "request_schema": false, + "response_schema": false, + "status_codes": false, + "payload_description": false + }, + "requested_fragment_type": null, + "fragment_evidence_found": [], + "fragment_missing_requirements": [], + "answer_mode": "ready", + "degrade_reason": null, + "degraded_reason": null, + "code_intents_stubbed": false +} + +## LLM Request +- prompt_name: docs_explain_answer +- log_context: graph.project_qa.docs.answer + +### Prompt Stats +```json +{ + "system_chars": 393, + "user_chars": 22363, + "tokens_in_estimate": 5689 +} +``` + +### System Prompt +```text +Ты объясняешь документацию системы. + +На вход приходит JSON с полями: +- question +- intent +- sub_intent +- documents +- facts +- relations + +Правила: +- Используй только предоставленные факты +- Не додумывай +- Если данных недостаточно, скажи это явно +- Объясняй структурировано + +Формат ответа: +1. Краткое описание +2. Основные элементы +3. Как это работает +4. Связи с другими частями системы (если есть) +``` + +### User Prompt +```json +{ + "question": "Как происходит проверка состояния runtime?", + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "SYSTEM_FLOW_EXPLAIN", + "documents": [ + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/domain/runtime-health-entity.md", + "title": "Сущность runtime health", + "content": "`runtime health` — доменная модель наблюдаемости сервиса, которая описывает общее состояние runtime и состояние отдельных компонентов. Для `test_echo_app` главным объектом наблюдения является компонент `telegram_notify`, у которого важны статус, время старта и количество успешных отправок. Эта модель используется для внешнего health-monitoring и внутренней диагностики.", + "metadata": { + "name": "runtime_health", + "tags": [ + "domain", + "health", + "observability" + ], + "type": "domain_entity", + "layer": "domain", + "links": [ + { + "type": "part_of", + "target": "architecture.telegram_notify_app" + }, + { + "type": "used_by", + "target": "api.health_endpoint" + }, + { + "type": "related_logic", + "target": "logic.telegram_notification_loop" + } + ], + "owner": null, + "title": "Сущность runtime health", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "architecture.telegram_notify_app", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "37d4dcf470ea3de95d59e44786006e369a3ea11bf5dbf4c88877696e9183ee87", + "children": [], + "doc_kind": "misc", + "entities": [ + "WorkerHealth", + "WorkerStatus", + "TelegramNotifyWorker" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "domain.runtime_health", + "source_path": "docs/documentation/domain/runtime-health-entity.md", + "summary_text": "`runtime health` — доменная модель наблюдаемости сервиса, которая описывает общее состояние runtime и состояние отдельных компонентов. Для `test_echo_app` главным объектом наблюдения является компонент `telegram_notify`, у которого важны статус, время старта и количество успешных отправок. Эта модель используется для внешнего health-monitoring и внутренней диагностики.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/logic/telegram-notification-loop.md", + "title": "Цикл отправки уведомлений в Telegram", + "content": "`TelegramNotifyWorker` после старта runtime запускает отдельный поток, сразу делает первую попытку отправки сообщения и затем повторяет отправку через заданный интервал. При ошибках доставки или отсутствии credentials worker не останавливает сервис, а переводит собственное состояние в `degraded`. Этот workflow определяет основной полезный цикл приложения.", + "metadata": { + "name": "telegram_notification_loop", + "tags": [ + "logic", + "telegram", + "worker", + "scheduling" + ], + "type": "logic_block", + "layer": "application", + "links": [ + { + "type": "part_of", + "target": "architecture.telegram_notify_app" + }, + { + "type": "related_api", + "target": "api.send_message_endpoint" + }, + { + "type": "related_api", + "target": "api.control_actions_endpoint" + }, + { + "type": "related_api", + "target": "api.health_endpoint" + } + ], + "owner": null, + "title": "Цикл отправки уведомлений в Telegram", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "architecture.telegram_notify_app", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "0f62f9b4dab261ca4ca34575ff5d84411a22c90b780c52eda388782b94f08470", + "children": [], + "doc_kind": "misc", + "entities": [ + "TelegramNotifyWorker", + "TelegramSendService", + "WorkerHealth", + "WorkerStatus" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "logic.telegram_notification_loop", + "source_path": "docs/documentation/logic/telegram-notification-loop.md", + "summary_text": "`TelegramNotifyWorker` после старта runtime запускает отдельный поток, сразу делает первую попытку отправки сообщения и затем повторяет отправку через заданный интервал. При ошибках доставки или отсутствии credentials worker не останавливает сервис, а переводит собственное состояние в `degraded`. Этот workflow определяет основной полезный цикл приложения.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/api/health-endpoint.md", + "title": "HTTP API /health", + "content": "Endpoint `/health` возвращает агрегированный health payload runtime. Если общий статус равен `ok`, API отвечает с HTTP 200; для состояний деградации или неготовности возвращается HTTP 503 с тем же payload. Endpoint служит основной точкой внешней проверки состояния приложения.", + "metadata": { + "name": "health_endpoint", + "tags": [ + "api", + "health", + "control-plane" + ], + "type": "api_method", + "layer": "application", + "links": [ + { + "type": "part_of", + "target": "architecture.telegram_notify_app" + }, + { + "type": "depends_on", + "target": "domain.runtime_health" + } + ], + "owner": null, + "title": "HTTP API /health", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "architecture.telegram_notify_app", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "8b5a533a8076e2e9d36995eee29aeade260080bdca2ec8e21fe28f08574b983f", + "children": [], + "doc_kind": "misc", + "entities": [ + "TelegramControlChannel", + "TelegramNotifyWorker", + "RuntimeManager", + "WorkerHealth" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "api.health_endpoint", + "source_path": "docs/documentation/api/health-endpoint.md", + "summary_text": "Endpoint `/health` возвращает агрегированный health payload runtime. Если общий статус равен `ok`, API отвечает с HTTP 200; для состояний деградации или неготовности возвращается HTTP 503 с тем же payload. Endpoint служит основной точкой внешней проверки состояния приложения.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "HTTP API /actions/{action}", + "content": "Endpoint `/actions/{action}` управляет control actions runtime и поддерживает `start`, `stop` и `status`. Для долгих операций `start` и `stop` допускается ответ HTTP 202, если действие еще выполняется. Endpoint используется для operator-driven управления жизненным циклом worker'а через HTTP API.", + "metadata": { + "name": "control_actions_endpoint", + "tags": [ + "api", + "control-plane", + "lifecycle" + ], + "type": "api_method", + "layer": "application", + "links": [ + { + "type": "part_of", + "target": "architecture.telegram_notify_app" + }, + { + "type": "related_api", + "target": "api.health_endpoint" + }, + { + "type": "related_logic", + "target": "logic.telegram_notification_loop" + } + ], + "owner": null, + "title": "HTTP API /actions/{action}", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "architecture.telegram_notify_app", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "children": [], + "doc_kind": "misc", + "entities": [ + "TelegramControlChannel", + "ControlActionSet", + "JSONResponse" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "api.control_actions_endpoint", + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "summary_text": "Endpoint `/actions/{action}` управляет control actions runtime и поддерживает `start`, `stop` и `status`. Для долгих операций `start` и `stop` допускается ответ HTTP 202, если действие еще выполняется. Endpoint используется для operator-driven управления жизненным циклом worker'а через HTTP API.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/architecture/telegram-notify-app-overview.md", + "title": "Архитектура Telegram Notify App", + "content": "`test_echo_app` — сервис на базе PLBA runtime, который поднимает HTTP control plane и запускает фоновый воркер для периодической отправки уведомлений в Telegram. Приложение использует YAML-конфиг для runtime-настроек и переменные окружения для Telegram credentials. Основной контур системы состоит из runtime manager, control channel, send service и worker loop.", + "metadata": { + "name": "telegram_notify_app_overview", + "tags": [ + "architecture", + "telegram", + "plba", + "runtime" + ], + "type": "architecture_overview", + "layer": "system", + "links": [ + { + "type": "related_api", + "target": "api.health_endpoint" + }, + { + "type": "related_api", + "target": "api.control_actions_endpoint" + }, + { + "type": "related_api", + "target": "api.send_message_endpoint" + }, + { + "type": "depends_on", + "target": "logic.telegram_notification_loop" + }, + { + "type": "depends_on", + "target": "domain.runtime_health" + } + ], + "owner": null, + "title": "Архитектура Telegram Notify App", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "docs_root", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "8b1cc9f823e55bddbc825466d10a0fdb4ca4354ac02d91f9e2aef7b7d2ec8256", + "children": [ + "api.health_endpoint", + "api.control_actions_endpoint", + "api.send_message_endpoint", + "logic.telegram_notification_loop", + "domain.runtime_health" + ], + "doc_kind": "spec", + "entities": [ + "TelegramNotifyModule", + "TelegramNotifyWorker", + "TelegramControlChannel", + "TelegramSendService", + "RuntimeManager" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "architecture.telegram_notify_app", + "source_path": "docs/documentation/architecture/telegram-notify-app-overview.md", + "summary_text": "`test_echo_app` — сервис на базе PLBA runtime, который поднимает HTTP control plane и запускает фоновый воркер для периодической отправки уведомлений в Telegram. Приложение использует YAML-конфиг для runtime-настроек и переменные окружения для Telegram credentials. Основной контур системы состоит из runtime manager, control channel, send service и worker loop.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/api/send-message-endpoint.md", + "title": "HTTP API /send", + "content": "Endpoint `/send` выполняет ручную отправку сообщения в Telegram через `TelegramSendService`. Он используется для операторской проверки доставки и для отправки уведомлений вне периодического worker loop. Endpoint работает поверх тех же credentials и того же delivery path, что и фоновая отправка.", + "metadata": { + "name": "send_message_endpoint", + "tags": [ + "api", + "telegram", + "manual-send" + ], + "type": "api_method", + "layer": "application", + "links": [ + { + "type": "part_of", + "target": "architecture.telegram_notify_app" + }, + { + "type": "depends_on", + "target": "logic.telegram_notification_loop" + } + ], + "owner": null, + "title": "HTTP API /send", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "architecture.telegram_notify_app", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "5fbf2e33510b0676a3a53b957a4569bd3c2c31fb7719546602c573421ccaa32d", + "children": [], + "doc_kind": "misc", + "entities": [ + "TelegramControlAppFactory", + "TelegramSendService", + "TelegramNotifyWorker" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "api.send_message_endpoint", + "source_path": "docs/documentation/api/send-message-endpoint.md", + "summary_text": "Endpoint `/send` выполняет ручную отправку сообщения в Telegram через `TelegramSendService`. Он используется для операторской проверки доставки и для отправки уведомлений вне периодического worker loop. Endpoint работает поверх тех же credentials и того же delivery path, что и фоновая отправка.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + } + ], + "facts": [], + "relations": [ + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/domain/runtime-health-entity.md", + "title": "domain.runtime_health:related_logic", + "content": "domain.runtime_health related_logic logic.telegram_notification_loop", + "metadata": { + "owner": null, + "anchor": "frontmatter.links", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "37d4dcf470ea3de95d59e44786006e369a3ea11bf5dbf4c88877696e9183ee87", + "source_id": "domain.runtime_health", + "target_id": "logic.telegram_notification_loop", + "doc_version": null, + "relation_id": "8595d7b82fecdb7ef579fa8961cda6799bb21970061e5bc221d4dd7a3d53fd04", + "source_path": "docs/documentation/domain/runtime-health-entity.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "related_logic", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/domain/runtime-health-entity.md", + "title": "domain.runtime_health:used_by", + "content": "domain.runtime_health used_by api.health_endpoint", + "metadata": { + "owner": null, + "anchor": "frontmatter.links", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "37d4dcf470ea3de95d59e44786006e369a3ea11bf5dbf4c88877696e9183ee87", + "source_id": "domain.runtime_health", + "target_id": "api.health_endpoint", + "doc_version": null, + "relation_id": "801650f8bcbfbfbefd35c14447bfef7b3c3827313db790efa7faf47db860f8c4", + "source_path": "docs/documentation/domain/runtime-health-entity.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "used_by", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/domain/runtime-health-entity.md", + "title": "domain.runtime_health:part_of", + "content": "domain.runtime_health part_of architecture.telegram_notify_app", + "metadata": { + "owner": null, + "anchor": "frontmatter.links", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "37d4dcf470ea3de95d59e44786006e369a3ea11bf5dbf4c88877696e9183ee87", + "source_id": "domain.runtime_health", + "target_id": "architecture.telegram_notify_app", + "doc_version": null, + "relation_id": "af2a4f7c1b677b908410ba720915405e10dbd0870e30a3c6e3aa2468550ddf0e", + "source_path": "docs/documentation/domain/runtime-health-entity.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "part_of", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/domain/runtime-health-entity.md", + "title": "domain.runtime_health:parent", + "content": "domain.runtime_health parent architecture.telegram_notify_app", + "metadata": { + "owner": null, + "anchor": "frontmatter.parent", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "37d4dcf470ea3de95d59e44786006e369a3ea11bf5dbf4c88877696e9183ee87", + "source_id": "domain.runtime_health", + "target_id": "architecture.telegram_notify_app", + "doc_version": null, + "relation_id": "79bdb0a74713df6064008179ca8c5c186dc23e4e1c5e2c9607b0bdddeba50f93", + "source_path": "docs/documentation/domain/runtime-health-entity.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "parent", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/api/health-endpoint.md", + "title": "api.health_endpoint:depends_on", + "content": "api.health_endpoint depends_on domain.runtime_health", + "metadata": { + "owner": null, + "anchor": "frontmatter.links", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "8b5a533a8076e2e9d36995eee29aeade260080bdca2ec8e21fe28f08574b983f", + "source_id": "api.health_endpoint", + "target_id": "domain.runtime_health", + "doc_version": null, + "relation_id": "77f5d358ab85b3d92018b6b51da7c39773148dfd346686e8832a45370c841160", + "source_path": "docs/documentation/api/health-endpoint.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "depends_on", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/architecture/telegram-notify-app-overview.md", + "title": "architecture.telegram_notify_app:child", + "content": "architecture.telegram_notify_app child domain.runtime_health", + "metadata": { + "owner": null, + "anchor": "frontmatter.children", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "8b1cc9f823e55bddbc825466d10a0fdb4ca4354ac02d91f9e2aef7b7d2ec8256", + "source_id": "architecture.telegram_notify_app", + "target_id": "domain.runtime_health", + "doc_version": null, + "relation_id": "4e0bbeb8e97e25091a30412d8631b1d9f6bb58b5694d8b7cc632af69a9262ea8", + "source_path": "docs/documentation/architecture/telegram-notify-app-overview.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "child", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/architecture/telegram-notify-app-overview.md", + "title": "architecture.telegram_notify_app:depends_on", + "content": "architecture.telegram_notify_app depends_on domain.runtime_health", + "metadata": { + "owner": null, + "anchor": "frontmatter.links", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "8b1cc9f823e55bddbc825466d10a0fdb4ca4354ac02d91f9e2aef7b7d2ec8256", + "source_id": "architecture.telegram_notify_app", + "target_id": "domain.runtime_health", + "doc_version": null, + "relation_id": "228d9012df1811fd2ef79178ff79c3cbc85271cf2755b15a627ea320e8f442a5", + "source_path": "docs/documentation/architecture/telegram-notify-app-overview.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "depends_on", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/api/health-endpoint.md", + "title": "api.health_endpoint:part_of", + "content": "api.health_endpoint part_of architecture.telegram_notify_app", + "metadata": { + "owner": null, + "anchor": "frontmatter.links", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "8b5a533a8076e2e9d36995eee29aeade260080bdca2ec8e21fe28f08574b983f", + "source_id": "api.health_endpoint", + "target_id": "architecture.telegram_notify_app", + "doc_version": null, + "relation_id": "616f5cbf25da83cb51d8d0741a7fc351620c9ca2c6513fa2094b4aa476f0912a", + "source_path": "docs/documentation/api/health-endpoint.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "part_of", + "staleness_score": null, + "system_component": null + } + } + ] +} +``` + +### User Prompt Overview +- question: Как происходит проверка состояния runtime? +- intent: DOCUMENTATION_EXPLAIN +- sub_intent: SYSTEM_FLOW_EXPLAIN +- documents: 6 | samples: Сущность runtime health, Цикл отправки уведомлений в Telegram, HTTP API /health +- facts: 0 +- relations: 8 | samples: domain.runtime_health:related_logic, domain.runtime_health:used_by, domain.runtime_health:part_of + +## Mismatches +- none \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/docs_router_deterministic/20260326_125615/full_chain_docs_intents_v3-3x_v3-system-flow-telegram-loop-1.json b/tests/pipeline_setup_v3/test_results/docs_router_deterministic/20260326_125615/full_chain_docs_intents_v3-3x_v3-system-flow-telegram-loop-1.json new file mode 100644 index 0000000..697439d --- /dev/null +++ b/tests/pipeline_setup_v3/test_results/docs_router_deterministic/20260326_125615/full_chain_docs_intents_v3-3x_v3-system-flow-telegram-loop-1.json @@ -0,0 +1,90 @@ +{ + "meta": { + "case_id": "v3-system-flow-telegram-loop-1", + "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_03_docs/full_chain_docs_intents_v3-3x.yaml", + "runner": "agent_runtime", + "mode": "pre_llm", + "passed": true, + "mismatches": [], + "actual": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "SYSTEM_FLOW_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START", + "rag_count": 23, + "llm_answer": "", + "answer_mode": "answered", + "path_scope": [], + "doc_scope": [ + "docs/README.md", + "api.control_actions_endpoint", + "api.actions_endpoint", + "api.health_endpoint", + "api.send_message_endpoint", + "architecture.telegram_notify_app", + "architecture.telegram_notify_app_overview", + "domain.runtime_health" + ], + "entity_candidates": [], + "symbol_candidates": [], + "layers": [ + "D1_DOCUMENT_CATALOG", + "D4_WORKFLOW_INDEX", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "filters": { + "doc_type": null + }, + "pipeline_mode": "pre_llm_only", + "gate_decision": "allow", + "prompt_used": "docs_explain_answer", + "llm_mode": "prose", + "degraded_reason": null, + "code_intents_stubbed": true + } + }, + "pipeline_steps": [ + { + "step": "input_query", + "input": { + "query": "Объясни цикл отправки уведомлений" + }, + "output": { + "query": "Объясни цикл отправки уведомлений" + } + }, + { + "step": "router", + "input": { + "query": "Объясни цикл отправки уведомлений" + }, + "output": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "SYSTEM_FLOW_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START" + } + }, + { + "step": "docs_pipeline", + "input": { + "query": "Объясни цикл отправки уведомлений" + }, + "output": { + "answer_mode": "ready", + "prompt_name": "docs_explain_answer", + "llm_request": { + "prompt_name": "docs_explain_answer", + "log_context": "graph.project_qa.docs.answer", + "prompt_stats": { + "system_chars": 393, + "user_chars": 20708, + "tokens_in_estimate": 5276 + } + }, + "degraded_reason": "" + } + } + ] +} \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/docs_router_deterministic/20260326_125615/full_chain_docs_intents_v3-3x_v3-system-flow-telegram-loop-1.md b/tests/pipeline_setup_v3/test_results/docs_router_deterministic/20260326_125615/full_chain_docs_intents_v3-3x_v3-system-flow-telegram-loop-1.md new file mode 100644 index 0000000..afc4a41 --- /dev/null +++ b/tests/pipeline_setup_v3/test_results/docs_router_deterministic/20260326_125615/full_chain_docs_intents_v3-3x_v3-system-flow-telegram-loop-1.md @@ -0,0 +1,882 @@ +# v3-system-flow-telegram-loop-1 + +- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_03_docs/full_chain_docs_intents_v3-3x.yaml +- runner: agent_runtime +- mode: pre_llm +- passed: True + +## Query +Объясни цикл отправки уведомлений + +## Actual +{ + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "SYSTEM_FLOW_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START", + "rag_count": 23, + "llm_answer": "", + "answer_mode": "answered", + "path_scope": [], + "doc_scope": [ + "docs/README.md", + "api.control_actions_endpoint", + "api.actions_endpoint", + "api.health_endpoint", + "api.send_message_endpoint", + "architecture.telegram_notify_app", + "architecture.telegram_notify_app_overview", + "domain.runtime_health" + ], + "entity_candidates": [], + "symbol_candidates": [], + "layers": [ + "D1_DOCUMENT_CATALOG", + "D4_WORKFLOW_INDEX", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "filters": { + "doc_type": null + }, + "pipeline_mode": "pre_llm_only", + "gate_decision": "allow", + "prompt_used": "docs_explain_answer", + "llm_mode": "prose", + "degraded_reason": null, + "code_intents_stubbed": true +} + +## Pipeline Steps +### input_query +```json +{ + "input": { + "query": "Объясни цикл отправки уведомлений" + }, + "output": { + "query": "Объясни цикл отправки уведомлений" + } +} +``` + +### router +```json +{ + "input": { + "query": "Объясни цикл отправки уведомлений" + }, + "output": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "SYSTEM_FLOW_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START" + } +} +``` + +### docs_pipeline +```json +{ + "input": { + "query": "Объясни цикл отправки уведомлений" + }, + "output": { + "answer_mode": "ready", + "prompt_name": "docs_explain_answer", + "llm_request": { + "prompt_name": "docs_explain_answer", + "log_context": "graph.project_qa.docs.answer", + "prompt_stats": { + "system_chars": 393, + "user_chars": 20708, + "tokens_in_estimate": 5276 + } + }, + "degraded_reason": "" + } +} +``` + +## Diagnostics +{ + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "SYSTEM_FLOW_EXPLAIN", + "layers_used": [ + "D1_DOCUMENT_CATALOG", + "D4_WORKFLOW_INDEX", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "documents_found": 6, + "facts_found": 0, + "relations_found": 8, + "openapi_fields_extracted": 0, + "missing_required_fields": [], + "openapi_status": { + "has_path": false, + "has_method": false, + "has_request": false, + "has_response": false + }, + "prompt_used": "docs_explain_answer", + "llm_mode": "prose", + "output_valid": true, + "matched_intent_source": "deterministic", + "matched_anchor_type": "none", + "matched_anchor_value": null, + "exact_anchor_match": false, + "docs_layers_requested": [ + "D1_DOCUMENT_CATALOG", + "D4_WORKFLOW_INDEX", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "docs_layers_with_hits": [ + "D1_DOCUMENT_CATALOG", + "D4_WORKFLOW_INDEX", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "planned_layers": [ + "D1_DOCUMENT_CATALOG", + "D4_WORKFLOW_INDEX", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "executed_layers": [ + "D1_DOCUMENT_CATALOG", + "D4_WORKFLOW_INDEX", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "non_empty_layers": [ + "D1_DOCUMENT_CATALOG", + "D4_WORKFLOW_INDEX", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "layer_diagnostics": { + "D1_DOCUMENT_CATALOG": { + "hits": 6, + "top_ids": [ + "docs/README.md", + "api.control_actions_endpoint", + "api.health_endpoint", + "api.send_message_endpoint", + "architecture.telegram_notify_app" + ] + }, + "D4_WORKFLOW_INDEX": { + "hits": 3, + "top_ids": [ + "api.control_actions_endpoint", + "api.health_endpoint", + "api.send_message_endpoint" + ] + }, + "D5_RELATION_GRAPH": { + "hits": 8, + "top_ids": [ + "5f4909bde905cd3d294ad307074a05e4ae4deefcafe6272cd2d0436e73acb8dd", + "711fb2edb82dd222deaba3c91768b18cbbd453009235823282813c6e867dc2c1", + "eec79f7a02b804337e791ef231784862ae26e0599eb20224790e9d4f085fa9c0", + "c718b1939621233295ccaf6e8203e7fd94f3dd1bfb88f10c51bc5e33d53a24aa", + "616f5cbf25da83cb51d8d0741a7fc351620c9ca2c6513fa2094b4aa476f0912a" + ] + }, + "D0_DOC_CHUNKS": { + "hits": 6, + "top_ids": [ + "docs/README.md", + "api.control_actions_endpoint" + ] + } + }, + "query_entity_candidates": [], + "resolved_entity_candidates": [], + "query_anchor_candidates": [], + "resolved_anchor_candidates": [ + "docs/README.md", + "api.control_actions_endpoint", + "docs/documentation/api/control-actions-endpoint.md", + "api.health_endpoint", + "docs/documentation/api/health-endpoint.md", + "api.send_message_endpoint", + "docs/documentation/api/send-message-endpoint.md", + "architecture.telegram_notify_app", + "docs/documentation/architecture/telegram-notify-app-overview.md", + "domain.runtime_health", + "docs/documentation/domain/runtime-health-entity.md" + ], + "anchor_candidates": [], + "selected_anchor": null, + "anchor_selection_reason": "", + "anchor_match_type": "", + "doc_ids": [ + "docs/README.md", + "api.control_actions_endpoint", + "api.actions_endpoint", + "api.health_endpoint", + "api.send_message_endpoint", + "architecture.telegram_notify_app", + "architecture.telegram_notify_app_overview", + "domain.runtime_health" + ], + "doc_paths": [ + "docs/README.md", + "docs/documentation/api/control-actions-endpoint.md", + "docs/documentation/api/health-endpoint.md", + "docs/documentation/api/send-message-endpoint.md", + "docs/documentation/architecture/telegram-notify-app-overview.md", + "docs/documentation/domain/runtime-health-entity.md" + ], + "doc_titles": [ + "Readme", + "HTTP API /actions/{action}", + "HTTP API /health", + "HTTP API /send", + "Архитектура Telegram Notify App", + "Сущность runtime health", + "Scenario", + "api.control_actions_endpoint:part_of", + "api.control_actions_endpoint:related_api", + "api.control_actions_endpoint:related_logic", + "api.health_endpoint:parent", + "api.health_endpoint:part_of", + "api.health_endpoint:depends_on", + "api.send_message_endpoint:parent", + "api.control_actions_endpoint:parent", + "docs/README.md:Структура", + "docs/README.md:Навигация", + "docs/README.md:Правила и шаблоны", + "api.control_actions_endpoint:Summary", + "api.control_actions_endpoint:Описание", + "docs/README.md:Project Docs" + ], + "relation_hits_count": 8, + "relation_targets": [ + "api.control_actions_endpoint:part_of", + "api.control_actions_endpoint:related_api", + "api.control_actions_endpoint:related_logic", + "api.health_endpoint:parent", + "api.health_endpoint:part_of", + "api.health_endpoint:depends_on", + "api.send_message_endpoint:parent", + "api.control_actions_endpoint:parent" + ], + "fallback_doc_hits_count": 12, + "fallback_used": false, + "fact_hits": 0, + "entity_hits": 0, + "evidence_summary": { + "documents": 6, + "facts": 0, + "relations": 8, + "chunks": 6, + "entity_hits": 0, + "openapi_signals": { + "path_found": false, + "method_found": false, + "request_schema": false, + "response_schema": false, + "status_codes": false, + "payload_description": false + } + }, + "gate_decision": "allow", + "gate_decision_reason": "evidence_sufficient", + "gate_missing_requirements": [], + "gate_satisfied_requirements": [ + "retrieval_non_empty" + ], + "openapi_evidence": { + "path_found": false, + "method_found": false, + "request_schema": false, + "response_schema": false, + "status_codes": false, + "payload_description": false + }, + "requested_fragment_type": null, + "fragment_evidence_found": [], + "fragment_missing_requirements": [], + "answer_mode": "ready", + "degrade_reason": null, + "degraded_reason": null, + "code_intents_stubbed": false +} + +## LLM Request +- prompt_name: docs_explain_answer +- log_context: graph.project_qa.docs.answer + +### Prompt Stats +```json +{ + "system_chars": 393, + "user_chars": 20708, + "tokens_in_estimate": 5276 +} +``` + +### System Prompt +```text +Ты объясняешь документацию системы. + +На вход приходит JSON с полями: +- question +- intent +- sub_intent +- documents +- facts +- relations + +Правила: +- Используй только предоставленные факты +- Не додумывай +- Если данных недостаточно, скажи это явно +- Объясняй структурировано + +Формат ответа: +1. Краткое описание +2. Основные элементы +3. Как это работает +4. Связи с другими частями системы (если есть) +``` + +### User Prompt +```json +{ + "question": "Объясни цикл отправки уведомлений", + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "SYSTEM_FLOW_EXPLAIN", + "documents": [ + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/README.md", + "title": "Readme", + "content": "Readme", + "metadata": { + "name": "", + "tags": [], + "type": "", + "layer": "", + "links": [], + "owner": null, + "title": "Readme", + "doc_id": null, + "module": "", + "parent": null, + "status": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "81d952f1a6ea85b76f75e0e57f33b8fa4b2bf3cb7db11b91b90171aeedd655a6", + "children": [], + "doc_kind": "readme", + "entities": [], + "updated_at": null, + "doc_version": null, + "document_id": "docs/README.md", + "source_path": "docs/README.md", + "summary_text": "", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "HTTP API /actions/{action}", + "content": "Endpoint `/actions/{action}` управляет control actions runtime и поддерживает `start`, `stop` и `status`. Для долгих операций `start` и `stop` допускается ответ HTTP 202, если действие еще выполняется. Endpoint используется для operator-driven управления жизненным циклом worker'а через HTTP API.", + "metadata": { + "name": "control_actions_endpoint", + "tags": [ + "api", + "control-plane", + "lifecycle" + ], + "type": "api_method", + "layer": "application", + "links": [ + { + "type": "part_of", + "target": "architecture.telegram_notify_app" + }, + { + "type": "related_api", + "target": "api.health_endpoint" + }, + { + "type": "related_logic", + "target": "logic.telegram_notification_loop" + } + ], + "owner": null, + "title": "HTTP API /actions/{action}", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "architecture.telegram_notify_app", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "children": [], + "doc_kind": "misc", + "entities": [ + "TelegramControlChannel", + "ControlActionSet", + "JSONResponse" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "api.control_actions_endpoint", + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "summary_text": "Endpoint `/actions/{action}` управляет control actions runtime и поддерживает `start`, `stop` и `status`. Для долгих операций `start` и `stop` допускается ответ HTTP 202, если действие еще выполняется. Endpoint используется для operator-driven управления жизненным циклом worker'а через HTTP API.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/api/health-endpoint.md", + "title": "HTTP API /health", + "content": "Endpoint `/health` возвращает агрегированный health payload runtime. Если общий статус равен `ok`, API отвечает с HTTP 200; для состояний деградации или неготовности возвращается HTTP 503 с тем же payload. Endpoint служит основной точкой внешней проверки состояния приложения.", + "metadata": { + "name": "health_endpoint", + "tags": [ + "api", + "health", + "control-plane" + ], + "type": "api_method", + "layer": "application", + "links": [ + { + "type": "part_of", + "target": "architecture.telegram_notify_app" + }, + { + "type": "depends_on", + "target": "domain.runtime_health" + } + ], + "owner": null, + "title": "HTTP API /health", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "architecture.telegram_notify_app", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "8b5a533a8076e2e9d36995eee29aeade260080bdca2ec8e21fe28f08574b983f", + "children": [], + "doc_kind": "misc", + "entities": [ + "TelegramControlChannel", + "TelegramNotifyWorker", + "RuntimeManager", + "WorkerHealth" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "api.health_endpoint", + "source_path": "docs/documentation/api/health-endpoint.md", + "summary_text": "Endpoint `/health` возвращает агрегированный health payload runtime. Если общий статус равен `ok`, API отвечает с HTTP 200; для состояний деградации или неготовности возвращается HTTP 503 с тем же payload. Endpoint служит основной точкой внешней проверки состояния приложения.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/api/send-message-endpoint.md", + "title": "HTTP API /send", + "content": "Endpoint `/send` выполняет ручную отправку сообщения в Telegram через `TelegramSendService`. Он используется для операторской проверки доставки и для отправки уведомлений вне периодического worker loop. Endpoint работает поверх тех же credentials и того же delivery path, что и фоновая отправка.", + "metadata": { + "name": "send_message_endpoint", + "tags": [ + "api", + "telegram", + "manual-send" + ], + "type": "api_method", + "layer": "application", + "links": [ + { + "type": "part_of", + "target": "architecture.telegram_notify_app" + }, + { + "type": "depends_on", + "target": "logic.telegram_notification_loop" + } + ], + "owner": null, + "title": "HTTP API /send", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "architecture.telegram_notify_app", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "5fbf2e33510b0676a3a53b957a4569bd3c2c31fb7719546602c573421ccaa32d", + "children": [], + "doc_kind": "misc", + "entities": [ + "TelegramControlAppFactory", + "TelegramSendService", + "TelegramNotifyWorker" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "api.send_message_endpoint", + "source_path": "docs/documentation/api/send-message-endpoint.md", + "summary_text": "Endpoint `/send` выполняет ручную отправку сообщения в Telegram через `TelegramSendService`. Он используется для операторской проверки доставки и для отправки уведомлений вне периодического worker loop. Endpoint работает поверх тех же credentials и того же delivery path, что и фоновая отправка.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/architecture/telegram-notify-app-overview.md", + "title": "Архитектура Telegram Notify App", + "content": "`test_echo_app` — сервис на базе PLBA runtime, который поднимает HTTP control plane и запускает фоновый воркер для периодической отправки уведомлений в Telegram. Приложение использует YAML-конфиг для runtime-настроек и переменные окружения для Telegram credentials. Основной контур системы состоит из runtime manager, control channel, send service и worker loop.", + "metadata": { + "name": "telegram_notify_app_overview", + "tags": [ + "architecture", + "telegram", + "plba", + "runtime" + ], + "type": "architecture_overview", + "layer": "system", + "links": [ + { + "type": "related_api", + "target": "api.health_endpoint" + }, + { + "type": "related_api", + "target": "api.control_actions_endpoint" + }, + { + "type": "related_api", + "target": "api.send_message_endpoint" + }, + { + "type": "depends_on", + "target": "logic.telegram_notification_loop" + }, + { + "type": "depends_on", + "target": "domain.runtime_health" + } + ], + "owner": null, + "title": "Архитектура Telegram Notify App", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "docs_root", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "8b1cc9f823e55bddbc825466d10a0fdb4ca4354ac02d91f9e2aef7b7d2ec8256", + "children": [ + "api.health_endpoint", + "api.control_actions_endpoint", + "api.send_message_endpoint", + "logic.telegram_notification_loop", + "domain.runtime_health" + ], + "doc_kind": "spec", + "entities": [ + "TelegramNotifyModule", + "TelegramNotifyWorker", + "TelegramControlChannel", + "TelegramSendService", + "RuntimeManager" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "architecture.telegram_notify_app", + "source_path": "docs/documentation/architecture/telegram-notify-app-overview.md", + "summary_text": "`test_echo_app` — сервис на базе PLBA runtime, который поднимает HTTP control plane и запускает фоновый воркер для периодической отправки уведомлений в Telegram. Приложение использует YAML-конфиг для runtime-настроек и переменные окружения для Telegram credentials. Основной контур системы состоит из runtime manager, control channel, send service и worker loop.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/domain/runtime-health-entity.md", + "title": "Сущность runtime health", + "content": "`runtime health` — доменная модель наблюдаемости сервиса, которая описывает общее состояние runtime и состояние отдельных компонентов. Для `test_echo_app` главным объектом наблюдения является компонент `telegram_notify`, у которого важны статус, время старта и количество успешных отправок. Эта модель используется для внешнего health-monitoring и внутренней диагностики.", + "metadata": { + "name": "runtime_health", + "tags": [ + "domain", + "health", + "observability" + ], + "type": "domain_entity", + "layer": "domain", + "links": [ + { + "type": "part_of", + "target": "architecture.telegram_notify_app" + }, + { + "type": "used_by", + "target": "api.health_endpoint" + }, + { + "type": "related_logic", + "target": "logic.telegram_notification_loop" + } + ], + "owner": null, + "title": "Сущность runtime health", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "architecture.telegram_notify_app", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "37d4dcf470ea3de95d59e44786006e369a3ea11bf5dbf4c88877696e9183ee87", + "children": [], + "doc_kind": "misc", + "entities": [ + "WorkerHealth", + "WorkerStatus", + "TelegramNotifyWorker" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "domain.runtime_health", + "source_path": "docs/documentation/domain/runtime-health-entity.md", + "summary_text": "`runtime health` — доменная модель наблюдаемости сервиса, которая описывает общее состояние runtime и состояние отдельных компонентов. Для `test_echo_app` главным объектом наблюдения является компонент `telegram_notify`, у которого важны статус, время старта и количество успешных отправок. Эта модель используется для внешнего health-monitoring и внутренней диагностики.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + } + ], + "facts": [], + "relations": [ + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "api.control_actions_endpoint:part_of", + "content": "api.control_actions_endpoint part_of architecture.telegram_notify_app", + "metadata": { + "owner": null, + "anchor": "frontmatter.links", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "source_id": "api.control_actions_endpoint", + "target_id": "architecture.telegram_notify_app", + "doc_version": null, + "relation_id": "5f4909bde905cd3d294ad307074a05e4ae4deefcafe6272cd2d0436e73acb8dd", + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "part_of", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "api.control_actions_endpoint:related_api", + "content": "api.control_actions_endpoint related_api api.health_endpoint", + "metadata": { + "owner": null, + "anchor": "frontmatter.links", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "source_id": "api.control_actions_endpoint", + "target_id": "api.health_endpoint", + "doc_version": null, + "relation_id": "711fb2edb82dd222deaba3c91768b18cbbd453009235823282813c6e867dc2c1", + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "related_api", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "api.control_actions_endpoint:related_logic", + "content": "api.control_actions_endpoint related_logic logic.telegram_notification_loop", + "metadata": { + "owner": null, + "anchor": "frontmatter.links", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "source_id": "api.control_actions_endpoint", + "target_id": "logic.telegram_notification_loop", + "doc_version": null, + "relation_id": "eec79f7a02b804337e791ef231784862ae26e0599eb20224790e9d4f085fa9c0", + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "related_logic", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/api/health-endpoint.md", + "title": "api.health_endpoint:parent", + "content": "api.health_endpoint parent architecture.telegram_notify_app", + "metadata": { + "owner": null, + "anchor": "frontmatter.parent", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "8b5a533a8076e2e9d36995eee29aeade260080bdca2ec8e21fe28f08574b983f", + "source_id": "api.health_endpoint", + "target_id": "architecture.telegram_notify_app", + "doc_version": null, + "relation_id": "c718b1939621233295ccaf6e8203e7fd94f3dd1bfb88f10c51bc5e33d53a24aa", + "source_path": "docs/documentation/api/health-endpoint.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "parent", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/api/health-endpoint.md", + "title": "api.health_endpoint:part_of", + "content": "api.health_endpoint part_of architecture.telegram_notify_app", + "metadata": { + "owner": null, + "anchor": "frontmatter.links", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "8b5a533a8076e2e9d36995eee29aeade260080bdca2ec8e21fe28f08574b983f", + "source_id": "api.health_endpoint", + "target_id": "architecture.telegram_notify_app", + "doc_version": null, + "relation_id": "616f5cbf25da83cb51d8d0741a7fc351620c9ca2c6513fa2094b4aa476f0912a", + "source_path": "docs/documentation/api/health-endpoint.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "part_of", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/api/health-endpoint.md", + "title": "api.health_endpoint:depends_on", + "content": "api.health_endpoint depends_on domain.runtime_health", + "metadata": { + "owner": null, + "anchor": "frontmatter.links", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "8b5a533a8076e2e9d36995eee29aeade260080bdca2ec8e21fe28f08574b983f", + "source_id": "api.health_endpoint", + "target_id": "domain.runtime_health", + "doc_version": null, + "relation_id": "77f5d358ab85b3d92018b6b51da7c39773148dfd346686e8832a45370c841160", + "source_path": "docs/documentation/api/health-endpoint.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "depends_on", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/api/send-message-endpoint.md", + "title": "api.send_message_endpoint:parent", + "content": "api.send_message_endpoint parent architecture.telegram_notify_app", + "metadata": { + "owner": null, + "anchor": "frontmatter.parent", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "5fbf2e33510b0676a3a53b957a4569bd3c2c31fb7719546602c573421ccaa32d", + "source_id": "api.send_message_endpoint", + "target_id": "architecture.telegram_notify_app", + "doc_version": null, + "relation_id": "33eb0aa97f06d0afcaa4c230b5f5b73fa2fbfa5861ea9367b6c92f8a6fe0c054", + "source_path": "docs/documentation/api/send-message-endpoint.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "parent", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "api.control_actions_endpoint:parent", + "content": "api.control_actions_endpoint parent architecture.telegram_notify_app", + "metadata": { + "owner": null, + "anchor": "frontmatter.parent", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "source_id": "api.control_actions_endpoint", + "target_id": "architecture.telegram_notify_app", + "doc_version": null, + "relation_id": "afec31fd062e392dcd9699a92c7ab61fd4b1273c1a2b16702b23d55d8d0c47ac", + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "parent", + "staleness_score": null, + "system_component": null + } + } + ] +} +``` + +### User Prompt Overview +- question: Объясни цикл отправки уведомлений +- intent: DOCUMENTATION_EXPLAIN +- sub_intent: SYSTEM_FLOW_EXPLAIN +- documents: 6 | samples: Readme, HTTP API /actions/{action}, HTTP API /health +- facts: 0 +- relations: 8 | samples: api.control_actions_endpoint:part_of, api.control_actions_endpoint:related_api, api.control_actions_endpoint:related_logic + +## Mismatches +- none \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/docs_router_deterministic/20260326_125615/full_chain_docs_intents_v3-3x_v3-system-flow-telegram-loop-2.json b/tests/pipeline_setup_v3/test_results/docs_router_deterministic/20260326_125615/full_chain_docs_intents_v3-3x_v3-system-flow-telegram-loop-2.json new file mode 100644 index 0000000..ba9c70c --- /dev/null +++ b/tests/pipeline_setup_v3/test_results/docs_router_deterministic/20260326_125615/full_chain_docs_intents_v3-3x_v3-system-flow-telegram-loop-2.json @@ -0,0 +1,91 @@ +{ + "meta": { + "case_id": "v3-system-flow-telegram-loop-2", + "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_03_docs/full_chain_docs_intents_v3-3x.yaml", + "runner": "agent_runtime", + "mode": "pre_llm", + "passed": true, + "mismatches": [], + "actual": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "SYSTEM_FLOW_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START", + "rag_count": 18, + "llm_answer": "", + "answer_mode": "answered", + "path_scope": [], + "doc_scope": [ + "architecture.telegram_notify_app", + "architecture.telegram_notify_app_overview", + "logic.telegram_notification_loop", + "api.send_message_endpoint", + "domain.runtime_health", + "api.health_endpoint", + "api.control_actions_endpoint", + "api.actions_endpoint", + "docs/README.md" + ], + "entity_candidates": [], + "symbol_candidates": [], + "layers": [ + "D1_DOCUMENT_CATALOG", + "D4_WORKFLOW_INDEX", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "filters": { + "doc_type": null + }, + "pipeline_mode": "pre_llm_only", + "gate_decision": "allow", + "prompt_used": "docs_explain_answer", + "llm_mode": "prose", + "degraded_reason": null, + "code_intents_stubbed": true + } + }, + "pipeline_steps": [ + { + "step": "input_query", + "input": { + "query": "Как работает процесс отправки уведомлений в Telegram?" + }, + "output": { + "query": "Как работает процесс отправки уведомлений в Telegram?" + } + }, + { + "step": "router", + "input": { + "query": "Как работает процесс отправки уведомлений в Telegram?" + }, + "output": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "SYSTEM_FLOW_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START" + } + }, + { + "step": "docs_pipeline", + "input": { + "query": "Как работает процесс отправки уведомлений в Telegram?" + }, + "output": { + "answer_mode": "ready", + "prompt_name": "docs_explain_answer", + "llm_request": { + "prompt_name": "docs_explain_answer", + "log_context": "graph.project_qa.docs.answer", + "prompt_stats": { + "system_chars": 393, + "user_chars": 17588, + "tokens_in_estimate": 4496 + } + }, + "degraded_reason": "" + } + } + ] +} \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/docs_router_deterministic/20260326_125615/full_chain_docs_intents_v3-3x_v3-system-flow-telegram-loop-2.md b/tests/pipeline_setup_v3/test_results/docs_router_deterministic/20260326_125615/full_chain_docs_intents_v3-3x_v3-system-flow-telegram-loop-2.md new file mode 100644 index 0000000..63fd540 --- /dev/null +++ b/tests/pipeline_setup_v3/test_results/docs_router_deterministic/20260326_125615/full_chain_docs_intents_v3-3x_v3-system-flow-telegram-loop-2.md @@ -0,0 +1,785 @@ +# v3-system-flow-telegram-loop-2 + +- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_03_docs/full_chain_docs_intents_v3-3x.yaml +- runner: agent_runtime +- mode: pre_llm +- passed: True + +## Query +Как работает процесс отправки уведомлений в Telegram? + +## Actual +{ + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "SYSTEM_FLOW_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START", + "rag_count": 18, + "llm_answer": "", + "answer_mode": "answered", + "path_scope": [], + "doc_scope": [ + "architecture.telegram_notify_app", + "architecture.telegram_notify_app_overview", + "logic.telegram_notification_loop", + "api.send_message_endpoint", + "domain.runtime_health", + "api.health_endpoint", + "api.control_actions_endpoint", + "api.actions_endpoint", + "docs/README.md" + ], + "entity_candidates": [], + "symbol_candidates": [], + "layers": [ + "D1_DOCUMENT_CATALOG", + "D4_WORKFLOW_INDEX", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "filters": { + "doc_type": null + }, + "pipeline_mode": "pre_llm_only", + "gate_decision": "allow", + "prompt_used": "docs_explain_answer", + "llm_mode": "prose", + "degraded_reason": null, + "code_intents_stubbed": true +} + +## Pipeline Steps +### input_query +```json +{ + "input": { + "query": "Как работает процесс отправки уведомлений в Telegram?" + }, + "output": { + "query": "Как работает процесс отправки уведомлений в Telegram?" + } +} +``` + +### router +```json +{ + "input": { + "query": "Как работает процесс отправки уведомлений в Telegram?" + }, + "output": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "SYSTEM_FLOW_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START" + } +} +``` + +### docs_pipeline +```json +{ + "input": { + "query": "Как работает процесс отправки уведомлений в Telegram?" + }, + "output": { + "answer_mode": "ready", + "prompt_name": "docs_explain_answer", + "llm_request": { + "prompt_name": "docs_explain_answer", + "log_context": "graph.project_qa.docs.answer", + "prompt_stats": { + "system_chars": 393, + "user_chars": 17588, + "tokens_in_estimate": 4496 + } + }, + "degraded_reason": "" + } +} +``` + +## Diagnostics +{ + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "SYSTEM_FLOW_EXPLAIN", + "layers_used": [ + "D1_DOCUMENT_CATALOG", + "D4_WORKFLOW_INDEX", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "documents_found": 6, + "facts_found": 0, + "relations_found": 3, + "openapi_fields_extracted": 0, + "missing_required_fields": [], + "openapi_status": { + "has_path": false, + "has_method": false, + "has_request": false, + "has_response": false + }, + "prompt_used": "docs_explain_answer", + "llm_mode": "prose", + "output_valid": true, + "matched_intent_source": "deterministic", + "matched_anchor_type": "workflow", + "matched_anchor_value": "отправки", + "exact_anchor_match": false, + "docs_layers_requested": [ + "D1_DOCUMENT_CATALOG", + "D4_WORKFLOW_INDEX", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "docs_layers_with_hits": [ + "D1_DOCUMENT_CATALOG", + "D4_WORKFLOW_INDEX", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "planned_layers": [ + "D1_DOCUMENT_CATALOG", + "D4_WORKFLOW_INDEX", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "executed_layers": [ + "D1_DOCUMENT_CATALOG", + "D4_WORKFLOW_INDEX", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "non_empty_layers": [ + "D1_DOCUMENT_CATALOG", + "D4_WORKFLOW_INDEX", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "layer_diagnostics": { + "D1_DOCUMENT_CATALOG": { + "hits": 6, + "top_ids": [ + "architecture.telegram_notify_app", + "logic.telegram_notification_loop", + "api.send_message_endpoint", + "domain.runtime_health", + "api.health_endpoint" + ] + }, + "D4_WORKFLOW_INDEX": { + "hits": 3, + "top_ids": [ + "api.control_actions_endpoint", + "api.health_endpoint", + "api.send_message_endpoint" + ] + }, + "D5_RELATION_GRAPH": { + "hits": 8, + "top_ids": [ + "305bab0c6567d93a2b453a9d70b676f9ecd8de083ef36f5cf3398747c25ebf94", + "7bd0428d23e9b20f7d65202cc269e45b3d1e7aed7b5df4a35581fd88677be29b", + "0eb7f73fcda8556439e06f5eeb5ce064ae32b6cd3129353f5b1b4eb3db626d88", + "ae34fe4b3cd2b47632b13b1e32303e842b57948aa21160abe8d9b478995e1d74", + "145ccbb861a8fb621286ec9c888ce69677168d35c7871c70537e888ce3a5b910" + ] + }, + "D0_DOC_CHUNKS": { + "hits": 6, + "top_ids": [ + "logic.telegram_notification_loop", + "architecture.telegram_notify_app", + "docs/README.md" + ] + } + }, + "query_entity_candidates": [], + "resolved_entity_candidates": [], + "query_anchor_candidates": [], + "resolved_anchor_candidates": [ + "architecture.telegram_notify_app", + "docs/documentation/architecture/telegram-notify-app-overview.md", + "logic.telegram_notification_loop", + "docs/documentation/logic/telegram-notification-loop.md", + "api.send_message_endpoint", + "docs/documentation/api/send-message-endpoint.md", + "domain.runtime_health", + "docs/documentation/domain/runtime-health-entity.md", + "api.health_endpoint", + "docs/documentation/api/health-endpoint.md", + "api.control_actions_endpoint", + "docs/documentation/api/control-actions-endpoint.md", + "docs/README.md" + ], + "anchor_candidates": [], + "selected_anchor": null, + "anchor_selection_reason": "", + "anchor_match_type": "", + "doc_ids": [ + "architecture.telegram_notify_app", + "architecture.telegram_notify_app_overview", + "logic.telegram_notification_loop", + "api.send_message_endpoint", + "domain.runtime_health", + "api.health_endpoint", + "api.control_actions_endpoint", + "api.actions_endpoint", + "docs/README.md" + ], + "doc_paths": [ + "docs/documentation/architecture/telegram-notify-app-overview.md", + "docs/documentation/logic/telegram-notification-loop.md", + "docs/documentation/api/send-message-endpoint.md", + "docs/documentation/domain/runtime-health-entity.md", + "docs/documentation/api/health-endpoint.md", + "docs/documentation/api/control-actions-endpoint.md", + "docs/README.md" + ], + "doc_titles": [ + "Архитектура Telegram Notify App", + "Цикл отправки уведомлений в Telegram", + "HTTP API /send", + "Сущность runtime health", + "HTTP API /health", + "HTTP API /actions/{action}", + "Scenario", + "architecture.telegram_notify_app:child", + "architecture.telegram_notify_app:related_api", + "architecture.telegram_notify_app:parent", + "logic.telegram_notification_loop:Summary", + "logic.telegram_notification_loop:Details", + "architecture.telegram_notify_app:Summary", + "architecture.telegram_notify_app:Details", + "docs/README.md:Навигация", + "api.health_endpoint:Функциональные требования" + ], + "relation_hits_count": 3, + "relation_targets": [ + "architecture.telegram_notify_app:child", + "architecture.telegram_notify_app:related_api", + "architecture.telegram_notify_app:parent" + ], + "fallback_doc_hits_count": 12, + "fallback_used": false, + "fact_hits": 0, + "entity_hits": 0, + "evidence_summary": { + "documents": 6, + "facts": 0, + "relations": 3, + "chunks": 6, + "entity_hits": 0, + "openapi_signals": { + "path_found": false, + "method_found": false, + "request_schema": false, + "response_schema": false, + "status_codes": false, + "payload_description": false + } + }, + "gate_decision": "allow", + "gate_decision_reason": "evidence_sufficient", + "gate_missing_requirements": [], + "gate_satisfied_requirements": [ + "retrieval_non_empty" + ], + "openapi_evidence": { + "path_found": false, + "method_found": false, + "request_schema": false, + "response_schema": false, + "status_codes": false, + "payload_description": false + }, + "requested_fragment_type": null, + "fragment_evidence_found": [], + "fragment_missing_requirements": [], + "answer_mode": "ready", + "degrade_reason": null, + "degraded_reason": null, + "code_intents_stubbed": false +} + +## LLM Request +- prompt_name: docs_explain_answer +- log_context: graph.project_qa.docs.answer + +### Prompt Stats +```json +{ + "system_chars": 393, + "user_chars": 17588, + "tokens_in_estimate": 4496 +} +``` + +### System Prompt +```text +Ты объясняешь документацию системы. + +На вход приходит JSON с полями: +- question +- intent +- sub_intent +- documents +- facts +- relations + +Правила: +- Используй только предоставленные факты +- Не додумывай +- Если данных недостаточно, скажи это явно +- Объясняй структурировано + +Формат ответа: +1. Краткое описание +2. Основные элементы +3. Как это работает +4. Связи с другими частями системы (если есть) +``` + +### User Prompt +```json +{ + "question": "Как работает процесс отправки уведомлений в Telegram?", + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "SYSTEM_FLOW_EXPLAIN", + "documents": [ + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/architecture/telegram-notify-app-overview.md", + "title": "Архитектура Telegram Notify App", + "content": "`test_echo_app` — сервис на базе PLBA runtime, который поднимает HTTP control plane и запускает фоновый воркер для периодической отправки уведомлений в Telegram. Приложение использует YAML-конфиг для runtime-настроек и переменные окружения для Telegram credentials. Основной контур системы состоит из runtime manager, control channel, send service и worker loop.", + "metadata": { + "name": "telegram_notify_app_overview", + "tags": [ + "architecture", + "telegram", + "plba", + "runtime" + ], + "type": "architecture_overview", + "layer": "system", + "links": [ + { + "type": "related_api", + "target": "api.health_endpoint" + }, + { + "type": "related_api", + "target": "api.control_actions_endpoint" + }, + { + "type": "related_api", + "target": "api.send_message_endpoint" + }, + { + "type": "depends_on", + "target": "logic.telegram_notification_loop" + }, + { + "type": "depends_on", + "target": "domain.runtime_health" + } + ], + "owner": null, + "title": "Архитектура Telegram Notify App", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "docs_root", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "8b1cc9f823e55bddbc825466d10a0fdb4ca4354ac02d91f9e2aef7b7d2ec8256", + "children": [ + "api.health_endpoint", + "api.control_actions_endpoint", + "api.send_message_endpoint", + "logic.telegram_notification_loop", + "domain.runtime_health" + ], + "doc_kind": "spec", + "entities": [ + "TelegramNotifyModule", + "TelegramNotifyWorker", + "TelegramControlChannel", + "TelegramSendService", + "RuntimeManager" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "architecture.telegram_notify_app", + "source_path": "docs/documentation/architecture/telegram-notify-app-overview.md", + "summary_text": "`test_echo_app` — сервис на базе PLBA runtime, который поднимает HTTP control plane и запускает фоновый воркер для периодической отправки уведомлений в Telegram. Приложение использует YAML-конфиг для runtime-настроек и переменные окружения для Telegram credentials. Основной контур системы состоит из runtime manager, control channel, send service и worker loop.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/logic/telegram-notification-loop.md", + "title": "Цикл отправки уведомлений в Telegram", + "content": "`TelegramNotifyWorker` после старта runtime запускает отдельный поток, сразу делает первую попытку отправки сообщения и затем повторяет отправку через заданный интервал. При ошибках доставки или отсутствии credentials worker не останавливает сервис, а переводит собственное состояние в `degraded`. Этот workflow определяет основной полезный цикл приложения.", + "metadata": { + "name": "telegram_notification_loop", + "tags": [ + "logic", + "telegram", + "worker", + "scheduling" + ], + "type": "logic_block", + "layer": "application", + "links": [ + { + "type": "part_of", + "target": "architecture.telegram_notify_app" + }, + { + "type": "related_api", + "target": "api.send_message_endpoint" + }, + { + "type": "related_api", + "target": "api.control_actions_endpoint" + }, + { + "type": "related_api", + "target": "api.health_endpoint" + } + ], + "owner": null, + "title": "Цикл отправки уведомлений в Telegram", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "architecture.telegram_notify_app", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "0f62f9b4dab261ca4ca34575ff5d84411a22c90b780c52eda388782b94f08470", + "children": [], + "doc_kind": "misc", + "entities": [ + "TelegramNotifyWorker", + "TelegramSendService", + "WorkerHealth", + "WorkerStatus" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "logic.telegram_notification_loop", + "source_path": "docs/documentation/logic/telegram-notification-loop.md", + "summary_text": "`TelegramNotifyWorker` после старта runtime запускает отдельный поток, сразу делает первую попытку отправки сообщения и затем повторяет отправку через заданный интервал. При ошибках доставки или отсутствии credentials worker не останавливает сервис, а переводит собственное состояние в `degraded`. Этот workflow определяет основной полезный цикл приложения.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/api/send-message-endpoint.md", + "title": "HTTP API /send", + "content": "Endpoint `/send` выполняет ручную отправку сообщения в Telegram через `TelegramSendService`. Он используется для операторской проверки доставки и для отправки уведомлений вне периодического worker loop. Endpoint работает поверх тех же credentials и того же delivery path, что и фоновая отправка.", + "metadata": { + "name": "send_message_endpoint", + "tags": [ + "api", + "telegram", + "manual-send" + ], + "type": "api_method", + "layer": "application", + "links": [ + { + "type": "part_of", + "target": "architecture.telegram_notify_app" + }, + { + "type": "depends_on", + "target": "logic.telegram_notification_loop" + } + ], + "owner": null, + "title": "HTTP API /send", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "architecture.telegram_notify_app", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "5fbf2e33510b0676a3a53b957a4569bd3c2c31fb7719546602c573421ccaa32d", + "children": [], + "doc_kind": "misc", + "entities": [ + "TelegramControlAppFactory", + "TelegramSendService", + "TelegramNotifyWorker" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "api.send_message_endpoint", + "source_path": "docs/documentation/api/send-message-endpoint.md", + "summary_text": "Endpoint `/send` выполняет ручную отправку сообщения в Telegram через `TelegramSendService`. Он используется для операторской проверки доставки и для отправки уведомлений вне периодического worker loop. Endpoint работает поверх тех же credentials и того же delivery path, что и фоновая отправка.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/domain/runtime-health-entity.md", + "title": "Сущность runtime health", + "content": "`runtime health` — доменная модель наблюдаемости сервиса, которая описывает общее состояние runtime и состояние отдельных компонентов. Для `test_echo_app` главным объектом наблюдения является компонент `telegram_notify`, у которого важны статус, время старта и количество успешных отправок. Эта модель используется для внешнего health-monitoring и внутренней диагностики.", + "metadata": { + "name": "runtime_health", + "tags": [ + "domain", + "health", + "observability" + ], + "type": "domain_entity", + "layer": "domain", + "links": [ + { + "type": "part_of", + "target": "architecture.telegram_notify_app" + }, + { + "type": "used_by", + "target": "api.health_endpoint" + }, + { + "type": "related_logic", + "target": "logic.telegram_notification_loop" + } + ], + "owner": null, + "title": "Сущность runtime health", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "architecture.telegram_notify_app", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "37d4dcf470ea3de95d59e44786006e369a3ea11bf5dbf4c88877696e9183ee87", + "children": [], + "doc_kind": "misc", + "entities": [ + "WorkerHealth", + "WorkerStatus", + "TelegramNotifyWorker" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "domain.runtime_health", + "source_path": "docs/documentation/domain/runtime-health-entity.md", + "summary_text": "`runtime health` — доменная модель наблюдаемости сервиса, которая описывает общее состояние runtime и состояние отдельных компонентов. Для `test_echo_app` главным объектом наблюдения является компонент `telegram_notify`, у которого важны статус, время старта и количество успешных отправок. Эта модель используется для внешнего health-monitoring и внутренней диагностики.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/api/health-endpoint.md", + "title": "HTTP API /health", + "content": "Endpoint `/health` возвращает агрегированный health payload runtime. Если общий статус равен `ok`, API отвечает с HTTP 200; для состояний деградации или неготовности возвращается HTTP 503 с тем же payload. Endpoint служит основной точкой внешней проверки состояния приложения.", + "metadata": { + "name": "health_endpoint", + "tags": [ + "api", + "health", + "control-plane" + ], + "type": "api_method", + "layer": "application", + "links": [ + { + "type": "part_of", + "target": "architecture.telegram_notify_app" + }, + { + "type": "depends_on", + "target": "domain.runtime_health" + } + ], + "owner": null, + "title": "HTTP API /health", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "architecture.telegram_notify_app", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "8b5a533a8076e2e9d36995eee29aeade260080bdca2ec8e21fe28f08574b983f", + "children": [], + "doc_kind": "misc", + "entities": [ + "TelegramControlChannel", + "TelegramNotifyWorker", + "RuntimeManager", + "WorkerHealth" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "api.health_endpoint", + "source_path": "docs/documentation/api/health-endpoint.md", + "summary_text": "Endpoint `/health` возвращает агрегированный health payload runtime. Если общий статус равен `ok`, API отвечает с HTTP 200; для состояний деградации или неготовности возвращается HTTP 503 с тем же payload. Endpoint служит основной точкой внешней проверки состояния приложения.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "HTTP API /actions/{action}", + "content": "Endpoint `/actions/{action}` управляет control actions runtime и поддерживает `start`, `stop` и `status`. Для долгих операций `start` и `stop` допускается ответ HTTP 202, если действие еще выполняется. Endpoint используется для operator-driven управления жизненным циклом worker'а через HTTP API.", + "metadata": { + "name": "control_actions_endpoint", + "tags": [ + "api", + "control-plane", + "lifecycle" + ], + "type": "api_method", + "layer": "application", + "links": [ + { + "type": "part_of", + "target": "architecture.telegram_notify_app" + }, + { + "type": "related_api", + "target": "api.health_endpoint" + }, + { + "type": "related_logic", + "target": "logic.telegram_notification_loop" + } + ], + "owner": null, + "title": "HTTP API /actions/{action}", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "architecture.telegram_notify_app", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "children": [], + "doc_kind": "misc", + "entities": [ + "TelegramControlChannel", + "ControlActionSet", + "JSONResponse" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "api.control_actions_endpoint", + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "summary_text": "Endpoint `/actions/{action}` управляет control actions runtime и поддерживает `start`, `stop` и `status`. Для долгих операций `start` и `stop` допускается ответ HTTP 202, если действие еще выполняется. Endpoint используется для operator-driven управления жизненным циклом worker'а через HTTP API.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + } + ], + "facts": [], + "relations": [ + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/architecture/telegram-notify-app-overview.md", + "title": "architecture.telegram_notify_app:child", + "content": "architecture.telegram_notify_app child api.send_message_endpoint", + "metadata": { + "owner": null, + "anchor": "frontmatter.children", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "8b1cc9f823e55bddbc825466d10a0fdb4ca4354ac02d91f9e2aef7b7d2ec8256", + "source_id": "architecture.telegram_notify_app", + "target_id": "api.send_message_endpoint", + "doc_version": null, + "relation_id": "305bab0c6567d93a2b453a9d70b676f9ecd8de083ef36f5cf3398747c25ebf94", + "source_path": "docs/documentation/architecture/telegram-notify-app-overview.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "child", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/architecture/telegram-notify-app-overview.md", + "title": "architecture.telegram_notify_app:related_api", + "content": "architecture.telegram_notify_app related_api api.health_endpoint", + "metadata": { + "owner": null, + "anchor": "frontmatter.links", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "8b1cc9f823e55bddbc825466d10a0fdb4ca4354ac02d91f9e2aef7b7d2ec8256", + "source_id": "architecture.telegram_notify_app", + "target_id": "api.health_endpoint", + "doc_version": null, + "relation_id": "7bd0428d23e9b20f7d65202cc269e45b3d1e7aed7b5df4a35581fd88677be29b", + "source_path": "docs/documentation/architecture/telegram-notify-app-overview.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "related_api", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/architecture/telegram-notify-app-overview.md", + "title": "architecture.telegram_notify_app:parent", + "content": "architecture.telegram_notify_app parent docs_root", + "metadata": { + "owner": null, + "anchor": "frontmatter.parent", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "8b1cc9f823e55bddbc825466d10a0fdb4ca4354ac02d91f9e2aef7b7d2ec8256", + "source_id": "architecture.telegram_notify_app", + "target_id": "docs_root", + "doc_version": null, + "relation_id": "e01922b36e3cc60d9349f89e43fcd4a92c6a01394b0028d6b6d56801b258645d", + "source_path": "docs/documentation/architecture/telegram-notify-app-overview.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "parent", + "staleness_score": null, + "system_component": null + } + } + ] +} +``` + +### User Prompt Overview +- question: Как работает процесс отправки уведомлений в Telegram? +- intent: DOCUMENTATION_EXPLAIN +- sub_intent: SYSTEM_FLOW_EXPLAIN +- documents: 6 | samples: Архитектура Telegram Notify App, Цикл отправки уведомлений в Telegram, HTTP API /send +- facts: 0 +- relations: 3 | samples: architecture.telegram_notify_app:child, architecture.telegram_notify_app:related_api, architecture.telegram_notify_app:parent + +## Mismatches +- none \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/docs_router_deterministic/20260326_125615/full_chain_docs_intents_v3-3x_v3-system-flow-telegram-loop-3.json b/tests/pipeline_setup_v3/test_results/docs_router_deterministic/20260326_125615/full_chain_docs_intents_v3-3x_v3-system-flow-telegram-loop-3.json new file mode 100644 index 0000000..f17e612 --- /dev/null +++ b/tests/pipeline_setup_v3/test_results/docs_router_deterministic/20260326_125615/full_chain_docs_intents_v3-3x_v3-system-flow-telegram-loop-3.json @@ -0,0 +1,91 @@ +{ + "meta": { + "case_id": "v3-system-flow-telegram-loop-3", + "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_03_docs/full_chain_docs_intents_v3-3x.yaml", + "runner": "agent_runtime", + "mode": "pre_llm", + "passed": true, + "mismatches": [], + "actual": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "SYSTEM_FLOW_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START", + "rag_count": 18, + "llm_answer": "", + "answer_mode": "answered", + "path_scope": [], + "doc_scope": [ + "architecture.telegram_notify_app", + "architecture.telegram_notify_app_overview", + "logic.telegram_notification_loop", + "api.send_message_endpoint", + "domain.runtime_health", + "api.health_endpoint", + "api.control_actions_endpoint", + "api.actions_endpoint", + "docs/README.md" + ], + "entity_candidates": [], + "symbol_candidates": [], + "layers": [ + "D1_DOCUMENT_CATALOG", + "D4_WORKFLOW_INDEX", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "filters": { + "doc_type": null + }, + "pipeline_mode": "pre_llm_only", + "gate_decision": "allow", + "prompt_used": "docs_explain_answer", + "llm_mode": "prose", + "degraded_reason": null, + "code_intents_stubbed": true + } + }, + "pipeline_steps": [ + { + "step": "input_query", + "input": { + "query": "Опиши workflow Telegram уведомлений" + }, + "output": { + "query": "Опиши workflow Telegram уведомлений" + } + }, + { + "step": "router", + "input": { + "query": "Опиши workflow Telegram уведомлений" + }, + "output": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "SYSTEM_FLOW_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START" + } + }, + { + "step": "docs_pipeline", + "input": { + "query": "Опиши workflow Telegram уведомлений" + }, + "output": { + "answer_mode": "ready", + "prompt_name": "docs_explain_answer", + "llm_request": { + "prompt_name": "docs_explain_answer", + "log_context": "graph.project_qa.docs.answer", + "prompt_stats": { + "system_chars": 393, + "user_chars": 17570, + "tokens_in_estimate": 4491 + } + }, + "degraded_reason": "" + } + } + ] +} \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/docs_router_deterministic/20260326_125615/full_chain_docs_intents_v3-3x_v3-system-flow-telegram-loop-3.md b/tests/pipeline_setup_v3/test_results/docs_router_deterministic/20260326_125615/full_chain_docs_intents_v3-3x_v3-system-flow-telegram-loop-3.md new file mode 100644 index 0000000..c5b8233 --- /dev/null +++ b/tests/pipeline_setup_v3/test_results/docs_router_deterministic/20260326_125615/full_chain_docs_intents_v3-3x_v3-system-flow-telegram-loop-3.md @@ -0,0 +1,785 @@ +# v3-system-flow-telegram-loop-3 + +- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_03_docs/full_chain_docs_intents_v3-3x.yaml +- runner: agent_runtime +- mode: pre_llm +- passed: True + +## Query +Опиши workflow Telegram уведомлений + +## Actual +{ + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "SYSTEM_FLOW_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START", + "rag_count": 18, + "llm_answer": "", + "answer_mode": "answered", + "path_scope": [], + "doc_scope": [ + "architecture.telegram_notify_app", + "architecture.telegram_notify_app_overview", + "logic.telegram_notification_loop", + "api.send_message_endpoint", + "domain.runtime_health", + "api.health_endpoint", + "api.control_actions_endpoint", + "api.actions_endpoint", + "docs/README.md" + ], + "entity_candidates": [], + "symbol_candidates": [], + "layers": [ + "D1_DOCUMENT_CATALOG", + "D4_WORKFLOW_INDEX", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "filters": { + "doc_type": null + }, + "pipeline_mode": "pre_llm_only", + "gate_decision": "allow", + "prompt_used": "docs_explain_answer", + "llm_mode": "prose", + "degraded_reason": null, + "code_intents_stubbed": true +} + +## Pipeline Steps +### input_query +```json +{ + "input": { + "query": "Опиши workflow Telegram уведомлений" + }, + "output": { + "query": "Опиши workflow Telegram уведомлений" + } +} +``` + +### router +```json +{ + "input": { + "query": "Опиши workflow Telegram уведомлений" + }, + "output": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "SYSTEM_FLOW_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START" + } +} +``` + +### docs_pipeline +```json +{ + "input": { + "query": "Опиши workflow Telegram уведомлений" + }, + "output": { + "answer_mode": "ready", + "prompt_name": "docs_explain_answer", + "llm_request": { + "prompt_name": "docs_explain_answer", + "log_context": "graph.project_qa.docs.answer", + "prompt_stats": { + "system_chars": 393, + "user_chars": 17570, + "tokens_in_estimate": 4491 + } + }, + "degraded_reason": "" + } +} +``` + +## Diagnostics +{ + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "SYSTEM_FLOW_EXPLAIN", + "layers_used": [ + "D1_DOCUMENT_CATALOG", + "D4_WORKFLOW_INDEX", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "documents_found": 6, + "facts_found": 0, + "relations_found": 3, + "openapi_fields_extracted": 0, + "missing_required_fields": [], + "openapi_status": { + "has_path": false, + "has_method": false, + "has_request": false, + "has_response": false + }, + "prompt_used": "docs_explain_answer", + "llm_mode": "prose", + "output_valid": true, + "matched_intent_source": "deterministic", + "matched_anchor_type": "workflow", + "matched_anchor_value": "Telegram", + "exact_anchor_match": false, + "docs_layers_requested": [ + "D1_DOCUMENT_CATALOG", + "D4_WORKFLOW_INDEX", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "docs_layers_with_hits": [ + "D1_DOCUMENT_CATALOG", + "D4_WORKFLOW_INDEX", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "planned_layers": [ + "D1_DOCUMENT_CATALOG", + "D4_WORKFLOW_INDEX", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "executed_layers": [ + "D1_DOCUMENT_CATALOG", + "D4_WORKFLOW_INDEX", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "non_empty_layers": [ + "D1_DOCUMENT_CATALOG", + "D4_WORKFLOW_INDEX", + "D5_RELATION_GRAPH", + "D0_DOC_CHUNKS" + ], + "layer_diagnostics": { + "D1_DOCUMENT_CATALOG": { + "hits": 6, + "top_ids": [ + "architecture.telegram_notify_app", + "logic.telegram_notification_loop", + "api.send_message_endpoint", + "domain.runtime_health", + "api.health_endpoint" + ] + }, + "D4_WORKFLOW_INDEX": { + "hits": 3, + "top_ids": [ + "api.control_actions_endpoint", + "api.health_endpoint", + "api.send_message_endpoint" + ] + }, + "D5_RELATION_GRAPH": { + "hits": 8, + "top_ids": [ + "305bab0c6567d93a2b453a9d70b676f9ecd8de083ef36f5cf3398747c25ebf94", + "7bd0428d23e9b20f7d65202cc269e45b3d1e7aed7b5df4a35581fd88677be29b", + "0eb7f73fcda8556439e06f5eeb5ce064ae32b6cd3129353f5b1b4eb3db626d88", + "ae34fe4b3cd2b47632b13b1e32303e842b57948aa21160abe8d9b478995e1d74", + "145ccbb861a8fb621286ec9c888ce69677168d35c7871c70537e888ce3a5b910" + ] + }, + "D0_DOC_CHUNKS": { + "hits": 6, + "top_ids": [ + "logic.telegram_notification_loop", + "architecture.telegram_notify_app", + "docs/README.md" + ] + } + }, + "query_entity_candidates": [], + "resolved_entity_candidates": [], + "query_anchor_candidates": [], + "resolved_anchor_candidates": [ + "architecture.telegram_notify_app", + "docs/documentation/architecture/telegram-notify-app-overview.md", + "logic.telegram_notification_loop", + "docs/documentation/logic/telegram-notification-loop.md", + "api.send_message_endpoint", + "docs/documentation/api/send-message-endpoint.md", + "domain.runtime_health", + "docs/documentation/domain/runtime-health-entity.md", + "api.health_endpoint", + "docs/documentation/api/health-endpoint.md", + "api.control_actions_endpoint", + "docs/documentation/api/control-actions-endpoint.md", + "docs/README.md" + ], + "anchor_candidates": [], + "selected_anchor": null, + "anchor_selection_reason": "", + "anchor_match_type": "", + "doc_ids": [ + "architecture.telegram_notify_app", + "architecture.telegram_notify_app_overview", + "logic.telegram_notification_loop", + "api.send_message_endpoint", + "domain.runtime_health", + "api.health_endpoint", + "api.control_actions_endpoint", + "api.actions_endpoint", + "docs/README.md" + ], + "doc_paths": [ + "docs/documentation/architecture/telegram-notify-app-overview.md", + "docs/documentation/logic/telegram-notification-loop.md", + "docs/documentation/api/send-message-endpoint.md", + "docs/documentation/domain/runtime-health-entity.md", + "docs/documentation/api/health-endpoint.md", + "docs/documentation/api/control-actions-endpoint.md", + "docs/README.md" + ], + "doc_titles": [ + "Архитектура Telegram Notify App", + "Цикл отправки уведомлений в Telegram", + "HTTP API /send", + "Сущность runtime health", + "HTTP API /health", + "HTTP API /actions/{action}", + "Scenario", + "architecture.telegram_notify_app:child", + "architecture.telegram_notify_app:related_api", + "architecture.telegram_notify_app:parent", + "logic.telegram_notification_loop:Summary", + "logic.telegram_notification_loop:Details", + "architecture.telegram_notify_app:Summary", + "architecture.telegram_notify_app:Details", + "docs/README.md:Навигация", + "api.health_endpoint:Сценарий" + ], + "relation_hits_count": 3, + "relation_targets": [ + "architecture.telegram_notify_app:child", + "architecture.telegram_notify_app:related_api", + "architecture.telegram_notify_app:parent" + ], + "fallback_doc_hits_count": 12, + "fallback_used": false, + "fact_hits": 0, + "entity_hits": 0, + "evidence_summary": { + "documents": 6, + "facts": 0, + "relations": 3, + "chunks": 6, + "entity_hits": 0, + "openapi_signals": { + "path_found": false, + "method_found": false, + "request_schema": false, + "response_schema": false, + "status_codes": false, + "payload_description": false + } + }, + "gate_decision": "allow", + "gate_decision_reason": "evidence_sufficient", + "gate_missing_requirements": [], + "gate_satisfied_requirements": [ + "retrieval_non_empty" + ], + "openapi_evidence": { + "path_found": false, + "method_found": false, + "request_schema": false, + "response_schema": false, + "status_codes": false, + "payload_description": false + }, + "requested_fragment_type": null, + "fragment_evidence_found": [], + "fragment_missing_requirements": [], + "answer_mode": "ready", + "degrade_reason": null, + "degraded_reason": null, + "code_intents_stubbed": false +} + +## LLM Request +- prompt_name: docs_explain_answer +- log_context: graph.project_qa.docs.answer + +### Prompt Stats +```json +{ + "system_chars": 393, + "user_chars": 17570, + "tokens_in_estimate": 4491 +} +``` + +### System Prompt +```text +Ты объясняешь документацию системы. + +На вход приходит JSON с полями: +- question +- intent +- sub_intent +- documents +- facts +- relations + +Правила: +- Используй только предоставленные факты +- Не додумывай +- Если данных недостаточно, скажи это явно +- Объясняй структурировано + +Формат ответа: +1. Краткое описание +2. Основные элементы +3. Как это работает +4. Связи с другими частями системы (если есть) +``` + +### User Prompt +```json +{ + "question": "Опиши workflow Telegram уведомлений", + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "SYSTEM_FLOW_EXPLAIN", + "documents": [ + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/architecture/telegram-notify-app-overview.md", + "title": "Архитектура Telegram Notify App", + "content": "`test_echo_app` — сервис на базе PLBA runtime, который поднимает HTTP control plane и запускает фоновый воркер для периодической отправки уведомлений в Telegram. Приложение использует YAML-конфиг для runtime-настроек и переменные окружения для Telegram credentials. Основной контур системы состоит из runtime manager, control channel, send service и worker loop.", + "metadata": { + "name": "telegram_notify_app_overview", + "tags": [ + "architecture", + "telegram", + "plba", + "runtime" + ], + "type": "architecture_overview", + "layer": "system", + "links": [ + { + "type": "related_api", + "target": "api.health_endpoint" + }, + { + "type": "related_api", + "target": "api.control_actions_endpoint" + }, + { + "type": "related_api", + "target": "api.send_message_endpoint" + }, + { + "type": "depends_on", + "target": "logic.telegram_notification_loop" + }, + { + "type": "depends_on", + "target": "domain.runtime_health" + } + ], + "owner": null, + "title": "Архитектура Telegram Notify App", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "docs_root", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "8b1cc9f823e55bddbc825466d10a0fdb4ca4354ac02d91f9e2aef7b7d2ec8256", + "children": [ + "api.health_endpoint", + "api.control_actions_endpoint", + "api.send_message_endpoint", + "logic.telegram_notification_loop", + "domain.runtime_health" + ], + "doc_kind": "spec", + "entities": [ + "TelegramNotifyModule", + "TelegramNotifyWorker", + "TelegramControlChannel", + "TelegramSendService", + "RuntimeManager" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "architecture.telegram_notify_app", + "source_path": "docs/documentation/architecture/telegram-notify-app-overview.md", + "summary_text": "`test_echo_app` — сервис на базе PLBA runtime, который поднимает HTTP control plane и запускает фоновый воркер для периодической отправки уведомлений в Telegram. Приложение использует YAML-конфиг для runtime-настроек и переменные окружения для Telegram credentials. Основной контур системы состоит из runtime manager, control channel, send service и worker loop.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/logic/telegram-notification-loop.md", + "title": "Цикл отправки уведомлений в Telegram", + "content": "`TelegramNotifyWorker` после старта runtime запускает отдельный поток, сразу делает первую попытку отправки сообщения и затем повторяет отправку через заданный интервал. При ошибках доставки или отсутствии credentials worker не останавливает сервис, а переводит собственное состояние в `degraded`. Этот workflow определяет основной полезный цикл приложения.", + "metadata": { + "name": "telegram_notification_loop", + "tags": [ + "logic", + "telegram", + "worker", + "scheduling" + ], + "type": "logic_block", + "layer": "application", + "links": [ + { + "type": "part_of", + "target": "architecture.telegram_notify_app" + }, + { + "type": "related_api", + "target": "api.send_message_endpoint" + }, + { + "type": "related_api", + "target": "api.control_actions_endpoint" + }, + { + "type": "related_api", + "target": "api.health_endpoint" + } + ], + "owner": null, + "title": "Цикл отправки уведомлений в Telegram", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "architecture.telegram_notify_app", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "0f62f9b4dab261ca4ca34575ff5d84411a22c90b780c52eda388782b94f08470", + "children": [], + "doc_kind": "misc", + "entities": [ + "TelegramNotifyWorker", + "TelegramSendService", + "WorkerHealth", + "WorkerStatus" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "logic.telegram_notification_loop", + "source_path": "docs/documentation/logic/telegram-notification-loop.md", + "summary_text": "`TelegramNotifyWorker` после старта runtime запускает отдельный поток, сразу делает первую попытку отправки сообщения и затем повторяет отправку через заданный интервал. При ошибках доставки или отсутствии credentials worker не останавливает сервис, а переводит собственное состояние в `degraded`. Этот workflow определяет основной полезный цикл приложения.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/api/send-message-endpoint.md", + "title": "HTTP API /send", + "content": "Endpoint `/send` выполняет ручную отправку сообщения в Telegram через `TelegramSendService`. Он используется для операторской проверки доставки и для отправки уведомлений вне периодического worker loop. Endpoint работает поверх тех же credentials и того же delivery path, что и фоновая отправка.", + "metadata": { + "name": "send_message_endpoint", + "tags": [ + "api", + "telegram", + "manual-send" + ], + "type": "api_method", + "layer": "application", + "links": [ + { + "type": "part_of", + "target": "architecture.telegram_notify_app" + }, + { + "type": "depends_on", + "target": "logic.telegram_notification_loop" + } + ], + "owner": null, + "title": "HTTP API /send", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "architecture.telegram_notify_app", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "5fbf2e33510b0676a3a53b957a4569bd3c2c31fb7719546602c573421ccaa32d", + "children": [], + "doc_kind": "misc", + "entities": [ + "TelegramControlAppFactory", + "TelegramSendService", + "TelegramNotifyWorker" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "api.send_message_endpoint", + "source_path": "docs/documentation/api/send-message-endpoint.md", + "summary_text": "Endpoint `/send` выполняет ручную отправку сообщения в Telegram через `TelegramSendService`. Он используется для операторской проверки доставки и для отправки уведомлений вне периодического worker loop. Endpoint работает поверх тех же credentials и того же delivery path, что и фоновая отправка.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/domain/runtime-health-entity.md", + "title": "Сущность runtime health", + "content": "`runtime health` — доменная модель наблюдаемости сервиса, которая описывает общее состояние runtime и состояние отдельных компонентов. Для `test_echo_app` главным объектом наблюдения является компонент `telegram_notify`, у которого важны статус, время старта и количество успешных отправок. Эта модель используется для внешнего health-monitoring и внутренней диагностики.", + "metadata": { + "name": "runtime_health", + "tags": [ + "domain", + "health", + "observability" + ], + "type": "domain_entity", + "layer": "domain", + "links": [ + { + "type": "part_of", + "target": "architecture.telegram_notify_app" + }, + { + "type": "used_by", + "target": "api.health_endpoint" + }, + { + "type": "related_logic", + "target": "logic.telegram_notification_loop" + } + ], + "owner": null, + "title": "Сущность runtime health", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "architecture.telegram_notify_app", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "37d4dcf470ea3de95d59e44786006e369a3ea11bf5dbf4c88877696e9183ee87", + "children": [], + "doc_kind": "misc", + "entities": [ + "WorkerHealth", + "WorkerStatus", + "TelegramNotifyWorker" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "domain.runtime_health", + "source_path": "docs/documentation/domain/runtime-health-entity.md", + "summary_text": "`runtime health` — доменная модель наблюдаемости сервиса, которая описывает общее состояние runtime и состояние отдельных компонентов. Для `test_echo_app` главным объектом наблюдения является компонент `telegram_notify`, у которого важны статус, время старта и количество успешных отправок. Эта модель используется для внешнего health-monitoring и внутренней диагностики.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/api/health-endpoint.md", + "title": "HTTP API /health", + "content": "Endpoint `/health` возвращает агрегированный health payload runtime. Если общий статус равен `ok`, API отвечает с HTTP 200; для состояний деградации или неготовности возвращается HTTP 503 с тем же payload. Endpoint служит основной точкой внешней проверки состояния приложения.", + "metadata": { + "name": "health_endpoint", + "tags": [ + "api", + "health", + "control-plane" + ], + "type": "api_method", + "layer": "application", + "links": [ + { + "type": "part_of", + "target": "architecture.telegram_notify_app" + }, + { + "type": "depends_on", + "target": "domain.runtime_health" + } + ], + "owner": null, + "title": "HTTP API /health", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "architecture.telegram_notify_app", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "8b5a533a8076e2e9d36995eee29aeade260080bdca2ec8e21fe28f08574b983f", + "children": [], + "doc_kind": "misc", + "entities": [ + "TelegramControlChannel", + "TelegramNotifyWorker", + "RuntimeManager", + "WorkerHealth" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "api.health_endpoint", + "source_path": "docs/documentation/api/health-endpoint.md", + "summary_text": "Endpoint `/health` возвращает агрегированный health payload runtime. Если общий статус равен `ok`, API отвечает с HTTP 200; для состояний деградации или неготовности возвращается HTTP 503 с тем же payload. Endpoint служит основной точкой внешней проверки состояния приложения.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "HTTP API /actions/{action}", + "content": "Endpoint `/actions/{action}` управляет control actions runtime и поддерживает `start`, `stop` и `status`. Для долгих операций `start` и `stop` допускается ответ HTTP 202, если действие еще выполняется. Endpoint используется для operator-driven управления жизненным циклом worker'а через HTTP API.", + "metadata": { + "name": "control_actions_endpoint", + "tags": [ + "api", + "control-plane", + "lifecycle" + ], + "type": "api_method", + "layer": "application", + "links": [ + { + "type": "part_of", + "target": "architecture.telegram_notify_app" + }, + { + "type": "related_api", + "target": "api.health_endpoint" + }, + { + "type": "related_logic", + "target": "logic.telegram_notification_loop" + } + ], + "owner": null, + "title": "HTTP API /actions/{action}", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "architecture.telegram_notify_app", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "children": [], + "doc_kind": "misc", + "entities": [ + "TelegramControlChannel", + "ControlActionSet", + "JSONResponse" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "api.control_actions_endpoint", + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "summary_text": "Endpoint `/actions/{action}` управляет control actions runtime и поддерживает `start`, `stop` и `status`. Для долгих операций `start` и `stop` допускается ответ HTTP 202, если действие еще выполняется. Endpoint используется для operator-driven управления жизненным циклом worker'а через HTTP API.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + } + ], + "facts": [], + "relations": [ + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/architecture/telegram-notify-app-overview.md", + "title": "architecture.telegram_notify_app:child", + "content": "architecture.telegram_notify_app child api.send_message_endpoint", + "metadata": { + "owner": null, + "anchor": "frontmatter.children", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "8b1cc9f823e55bddbc825466d10a0fdb4ca4354ac02d91f9e2aef7b7d2ec8256", + "source_id": "architecture.telegram_notify_app", + "target_id": "api.send_message_endpoint", + "doc_version": null, + "relation_id": "305bab0c6567d93a2b453a9d70b676f9ecd8de083ef36f5cf3398747c25ebf94", + "source_path": "docs/documentation/architecture/telegram-notify-app-overview.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "child", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/architecture/telegram-notify-app-overview.md", + "title": "architecture.telegram_notify_app:related_api", + "content": "architecture.telegram_notify_app related_api api.health_endpoint", + "metadata": { + "owner": null, + "anchor": "frontmatter.links", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "8b1cc9f823e55bddbc825466d10a0fdb4ca4354ac02d91f9e2aef7b7d2ec8256", + "source_id": "architecture.telegram_notify_app", + "target_id": "api.health_endpoint", + "doc_version": null, + "relation_id": "7bd0428d23e9b20f7d65202cc269e45b3d1e7aed7b5df4a35581fd88677be29b", + "source_path": "docs/documentation/architecture/telegram-notify-app-overview.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "related_api", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/architecture/telegram-notify-app-overview.md", + "title": "architecture.telegram_notify_app:parent", + "content": "architecture.telegram_notify_app parent docs_root", + "metadata": { + "owner": null, + "anchor": "frontmatter.parent", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "8b1cc9f823e55bddbc825466d10a0fdb4ca4354ac02d91f9e2aef7b7d2ec8256", + "source_id": "architecture.telegram_notify_app", + "target_id": "docs_root", + "doc_version": null, + "relation_id": "e01922b36e3cc60d9349f89e43fcd4a92c6a01394b0028d6b6d56801b258645d", + "source_path": "docs/documentation/architecture/telegram-notify-app-overview.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "parent", + "staleness_score": null, + "system_component": null + } + } + ] +} +``` + +### User Prompt Overview +- question: Опиши workflow Telegram уведомлений +- intent: DOCUMENTATION_EXPLAIN +- sub_intent: SYSTEM_FLOW_EXPLAIN +- documents: 6 | samples: Архитектура Telegram Notify App, Цикл отправки уведомлений в Telegram, HTTP API /send +- facts: 0 +- relations: 3 | samples: architecture.telegram_notify_app:child, architecture.telegram_notify_app:related_api, architecture.telegram_notify_app:parent + +## Mismatches +- none \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/docs_router_deterministic/20260326_125615/summary.md b/tests/pipeline_setup_v3/test_results/docs_router_deterministic/20260326_125615/summary.md new file mode 100644 index 0000000..5a310fe --- /dev/null +++ b/tests/pipeline_setup_v3/test_results/docs_router_deterministic/20260326_125615/summary.md @@ -0,0 +1,41 @@ +# pipeline_setup_v3 summary + +Passed: 27/30 + +| File | Case | Mode | Query | Actual sub-intent | RAG layers | Tokens | Pass | +|------|------|------|-------|-------------------|------------|--------|------| +| full_chain_docs_intents_v3-3x.yaml | v3-system-flow-telegram-loop-1 | pre_llm | Объясни цикл отправки уведомлений | SYSTEM_FLOW_EXPLAIN | D0_DOC_CHUNKS:6, D1_DOCUMENT_CATALOG:6, D4_WORKFLOW_INDEX:3, D5_RELATION_GRAPH:8 | 5276 | ✓ | +| full_chain_docs_intents_v3-3x.yaml | v3-system-flow-telegram-loop-2 | pre_llm | Как работает процесс отправки уведомлений в Telegram? | SYSTEM_FLOW_EXPLAIN | D0_DOC_CHUNKS:6, D1_DOCUMENT_CATALOG:6, D4_WORKFLOW_INDEX:3, D5_RELATION_GRAPH:3 | 4496 | ✓ | +| full_chain_docs_intents_v3-3x.yaml | v3-system-flow-telegram-loop-3 | pre_llm | Опиши workflow Telegram уведомлений | SYSTEM_FLOW_EXPLAIN | D0_DOC_CHUNKS:6, D1_DOCUMENT_CATALOG:6, D4_WORKFLOW_INDEX:3, D5_RELATION_GRAPH:3 | 4491 | ✓ | +| full_chain_docs_intents_v3-3x.yaml | v3-system-flow-health-1 | pre_llm | Как работает health check runtime? | GENERIC_QA | D0_DOC_CHUNKS:8, D1_DOCUMENT_CATALOG:4 | 2452 | ✗ | +| full_chain_docs_intents_v3-3x.yaml | v3-system-flow-health-2 | pre_llm | Как происходит проверка состояния runtime? | SYSTEM_FLOW_EXPLAIN | D0_DOC_CHUNKS:6, D1_DOCUMENT_CATALOG:6, D4_WORKFLOW_INDEX:3, D5_RELATION_GRAPH:8 | 5689 | ✓ | +| full_chain_docs_intents_v3-3x.yaml | v3-component-runtime-manager-1 | pre_llm | Что делает RuntimeManager? | COMPONENT_EXPLAIN | D0_DOC_CHUNKS:6, D1_DOCUMENT_CATALOG:6, D2_FACT_INDEX:2, D5_RELATION_GRAPH:6 | 5471 | ✓ | +| full_chain_docs_intents_v3-3x.yaml | v3-component-runtime-manager-2 | pre_llm | Как устроен RuntimeManager? | COMPONENT_EXPLAIN | D0_DOC_CHUNKS:6, D1_DOCUMENT_CATALOG:6, D2_FACT_INDEX:2, D5_RELATION_GRAPH:6 | 5471 | ✓ | +| full_chain_docs_intents_v3-3x.yaml | v3-component-runtime-manager-3 | pre_llm | Опиши компонент RuntimeManager | COMPONENT_EXPLAIN | D0_DOC_CHUNKS:6, D1_DOCUMENT_CATALOG:6, D2_FACT_INDEX:2, D5_RELATION_GRAPH:6 | 5472 | ✓ | +| full_chain_docs_intents_v3-3x.yaml | v3-component-control-channel-1 | pre_llm | Как работает TelegramControlChannel? | COMPONENT_EXPLAIN | D0_DOC_CHUNKS:6, D1_DOCUMENT_CATALOG:6, D2_FACT_INDEX:2, D5_RELATION_GRAPH:6 | 5474 | ✓ | +| full_chain_docs_intents_v3-3x.yaml | v3-component-control-channel-2 | pre_llm | Роль TelegramControlChannel в системе | COMPONENT_EXPLAIN | D0_DOC_CHUNKS:6, D1_DOCUMENT_CATALOG:6, D2_FACT_INDEX:2, D5_RELATION_GRAPH:6 | 5474 | ✓ | +| full_chain_docs_intents_v3-3x.yaml | v3-api-health-1 | pre_llm | Что делает /health? | API_METHOD_EXPLAIN | D0_DOC_CHUNKS:6, D1_DOCUMENT_CATALOG:1, D2_FACT_INDEX:2, D4_WORKFLOW_INDEX:1 | 1149 | ✓ | +| full_chain_docs_intents_v3-3x.yaml | v3-api-health-2 | pre_llm | Как работает health endpoint? | API_METHOD_EXPLAIN | D0_DOC_CHUNKS:6, D1_DOCUMENT_CATALOG:6, D2_FACT_INDEX:2, D4_WORKFLOW_INDEX:3 | 4254 | ✓ | +| full_chain_docs_intents_v3-3x.yaml | v3-api-health-3 | pre_llm | Опиши endpoint health | API_METHOD_EXPLAIN | D0_DOC_CHUNKS:6, D1_DOCUMENT_CATALOG:6, D2_FACT_INDEX:2, D4_WORKFLOW_INDEX:3 | 4252 | ✓ | +| full_chain_docs_intents_v3-3x.yaml | v3-api-send-1 | pre_llm | Что делает /send? | API_METHOD_EXPLAIN | D0_DOC_CHUNKS:6, D1_DOCUMENT_CATALOG:1, D2_FACT_INDEX:2, D4_WORKFLOW_INDEX:1 | 1195 | ✓ | +| full_chain_docs_intents_v3-3x.yaml | v3-api-send-2 | pre_llm | Как работает send endpoint? | API_METHOD_EXPLAIN | D0_DOC_CHUNKS:6, D1_DOCUMENT_CATALOG:6, D2_FACT_INDEX:2, D4_WORKFLOW_INDEX:3 | 3846 | ✓ | +| full_chain_docs_intents_v3-3x.yaml | v3-api-send-3 | pre_llm | Опиши endpoint отправки сообщений | API_METHOD_EXPLAIN | D0_DOC_CHUNKS:6, D1_DOCUMENT_CATALOG:6, D2_FACT_INDEX:2, D4_WORKFLOW_INDEX:3 | 3847 | ✓ | +| full_chain_docs_intents_v3-3x.yaml | v3-entity-runtime-health-1 | pre_llm | Что такое runtime health? | ENTITY_EXPLAIN | D0_DOC_CHUNKS:6, D1_DOCUMENT_CATALOG:6, D3_ENTITY_CATALOG:8, D5_RELATION_GRAPH:6 | 5165 | ✓ | +| full_chain_docs_intents_v3-3x.yaml | v3-entity-runtime-health-2 | pre_llm | Объясни runtime health | GENERIC_QA | D0_DOC_CHUNKS:8, D1_DOCUMENT_CATALOG:4 | 2449 | ✗ | +| full_chain_docs_intents_v3-3x.yaml | v3-entity-worker-status-1 | pre_llm | Что такое WorkerStatus? | ENTITY_EXPLAIN | D0_DOC_CHUNKS:6, D1_DOCUMENT_CATALOG:6, D3_ENTITY_CATALOG:8, D5_RELATION_GRAPH:6 | 4793 | ✓ | +| full_chain_docs_intents_v3-3x.yaml | v3-entity-worker-status-2 | pre_llm | Опиши статус воркера | GENERIC_QA | D0_DOC_CHUNKS:8, D1_DOCUMENT_CATALOG:4 | 1976 | ✗ | +| full_chain_docs_intents_v3-3x.yaml | v3-related-health-1 | pre_llm | Что связано с /health? | RELATED_DOCS_EXPLAIN | D0_DOC_CHUNKS:6, D5_RELATION_GRAPH:8 | 2070 | ✓ | +| full_chain_docs_intents_v3-3x.yaml | v3-related-health-2 | pre_llm | Какие документы относятся к health endpoint? | RELATED_DOCS_EXPLAIN | D0_DOC_CHUNKS:6, D5_RELATION_GRAPH:8 | 2098 | ✓ | +| full_chain_docs_intents_v3-3x.yaml | v3-related-send-1 | pre_llm | Какие документы связаны с /send? | RELATED_DOCS_EXPLAIN | D0_DOC_CHUNKS:6, D5_RELATION_GRAPH:8 | 2120 | ✓ | +| full_chain_docs_intents_v3-3x.yaml | v3-related-architecture-1 | pre_llm | Какие документы связаны с архитектурой? | RELATED_DOCS_EXPLAIN | D0_DOC_CHUNKS:6, D5_RELATION_GRAPH:8 | 2097 | ✓ | +| full_chain_docs_intents_v3-3x.yaml | v3-general-1 | pre_llm | Что есть в документации? | GENERIC_QA | D0_DOC_CHUNKS:6, D1_DOCUMENT_CATALOG:6, D2_FACT_INDEX:1, D5_RELATION_GRAPH:6 | 5037 | ✓ | +| full_chain_docs_intents_v3-3x.yaml | v3-general-2 | pre_llm | Какая структура документации? | GENERIC_QA | D0_DOC_CHUNKS:8, D1_DOCUMENT_CATALOG:4 | 1978 | ✓ | +| full_chain_docs_intents_v3-3x.yaml | v3-general-3 | pre_llm | С чего начать читать документацию? | GENERIC_QA | D0_DOC_CHUNKS:8, D1_DOCUMENT_CATALOG:4 | 1980 | ✓ | +| full_chain_docs_intents_v3-3x.yaml | v3-negative-1 | pre_llm | Что такое PaymentTransaction? | ENTITY_EXPLAIN | D0_DOC_CHUNKS:6, D1_DOCUMENT_CATALOG:6, D3_ENTITY_CATALOG:8, D5_RELATION_GRAPH:6 | 4794 | ✓ | +| full_chain_docs_intents_v3-3x.yaml | v3-negative-2 | pre_llm | Объясни сущность UnknownEntity | ENTITY_EXPLAIN | — | 142 | ✓ | +| full_chain_docs_intents_v3-3x.yaml | v3-negative-3 | pre_llm | Что делает endpoint /unknown? | API_METHOD_EXPLAIN | — | 143 | ✓ | + +## Failures +- **v3-system-flow-health-1**: sub_intent: expected SYSTEM_FLOW_EXPLAIN, got GENERIC_QA +- **v3-entity-runtime-health-2**: sub_intent: expected ENTITY_EXPLAIN, got GENERIC_QA +- **v3-entity-worker-status-2**: sub_intent: expected ENTITY_EXPLAIN, got GENERIC_QA \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/docs_router_llm_disambiguation/20260326_150139/full_chain_docs_intents_v3-3x_v3-api-health-1.json b/tests/pipeline_setup_v3/test_results/docs_router_llm_disambiguation/20260326_150139/full_chain_docs_intents_v3-3x_v3-api-health-1.json new file mode 100644 index 0000000..c37e565 --- /dev/null +++ b/tests/pipeline_setup_v3/test_results/docs_router_llm_disambiguation/20260326_150139/full_chain_docs_intents_v3-3x_v3-api-health-1.json @@ -0,0 +1,83 @@ +{ + "meta": { + "case_id": "v3-api-health-1", + "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_03_docs/full_chain_docs_intents_v3-3x.yaml", + "runner": "agent_runtime", + "mode": "pre_llm", + "passed": true, + "mismatches": [], + "actual": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "API_METHOD_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START", + "rag_count": 8, + "llm_answer": "", + "answer_mode": "answered", + "path_scope": [], + "doc_scope": [ + "api.health_endpoint" + ], + "entity_candidates": [], + "symbol_candidates": [], + "layers": [ + "D2_FACT_INDEX", + "D4_WORKFLOW_INDEX", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "filters": { + "doc_type": "api_method" + }, + "pipeline_mode": "pre_llm_only", + "gate_decision": "allow", + "prompt_used": "docs_explain_answer", + "llm_mode": "prose", + "degraded_reason": null, + "code_intents_stubbed": true + } + }, + "pipeline_steps": [ + { + "step": "input_query", + "input": { + "query": "Что делает /health?" + }, + "output": { + "query": "Что делает /health?" + } + }, + { + "step": "router", + "input": { + "query": "Что делает /health?" + }, + "output": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "API_METHOD_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START" + } + }, + { + "step": "docs_pipeline", + "input": { + "query": "Что делает /health?" + }, + "output": { + "answer_mode": "ready", + "prompt_name": "docs_explain_answer", + "llm_request": { + "prompt_name": "docs_explain_answer", + "log_context": "graph.project_qa.docs.answer", + "prompt_stats": { + "system_chars": 393, + "user_chars": 9482, + "tokens_in_estimate": 2469 + } + }, + "degraded_reason": "" + } + } + ] +} \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/docs_router_llm_disambiguation/20260326_150139/full_chain_docs_intents_v3-3x_v3-api-health-1.md b/tests/pipeline_setup_v3/test_results/docs_router_llm_disambiguation/20260326_150139/full_chain_docs_intents_v3-3x_v3-api-health-1.md new file mode 100644 index 0000000..4c27979 --- /dev/null +++ b/tests/pipeline_setup_v3/test_results/docs_router_llm_disambiguation/20260326_150139/full_chain_docs_intents_v3-3x_v3-api-health-1.md @@ -0,0 +1,599 @@ +# v3-api-health-1 + +- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_03_docs/full_chain_docs_intents_v3-3x.yaml +- runner: agent_runtime +- mode: pre_llm +- passed: True + +## Query +Что делает /health? + +## Actual +{ + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "API_METHOD_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START", + "rag_count": 8, + "llm_answer": "", + "answer_mode": "answered", + "path_scope": [], + "doc_scope": [ + "api.health_endpoint" + ], + "entity_candidates": [], + "symbol_candidates": [], + "layers": [ + "D2_FACT_INDEX", + "D4_WORKFLOW_INDEX", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "filters": { + "doc_type": "api_method" + }, + "pipeline_mode": "pre_llm_only", + "gate_decision": "allow", + "prompt_used": "docs_explain_answer", + "llm_mode": "prose", + "degraded_reason": null, + "code_intents_stubbed": true +} + +## Pipeline Steps +### input_query +```json +{ + "input": { + "query": "Что делает /health?" + }, + "output": { + "query": "Что делает /health?" + } +} +``` + +### router +```json +{ + "input": { + "query": "Что делает /health?" + }, + "output": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "API_METHOD_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START" + } +} +``` + +### docs_pipeline +```json +{ + "input": { + "query": "Что делает /health?" + }, + "output": { + "answer_mode": "ready", + "prompt_name": "docs_explain_answer", + "llm_request": { + "prompt_name": "docs_explain_answer", + "log_context": "graph.project_qa.docs.answer", + "prompt_stats": { + "system_chars": 393, + "user_chars": 9482, + "tokens_in_estimate": 2469 + } + }, + "degraded_reason": "" + } +} +``` + +## Diagnostics +{ + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "API_METHOD_EXPLAIN", + "layers_used": [ + "D2_FACT_INDEX", + "D4_WORKFLOW_INDEX", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "documents_found": 1, + "facts_found": 2, + "relations_found": 0, + "openapi_fields_extracted": 0, + "missing_required_fields": [], + "openapi_status": { + "has_path": false, + "has_method": false, + "has_request": false, + "has_response": false + }, + "prompt_used": "docs_explain_answer", + "llm_mode": "prose", + "output_valid": true, + "matched_intent_source": "deterministic", + "matched_anchor_type": "endpoint", + "matched_anchor_value": "/health", + "exact_anchor_match": true, + "docs_layers_requested": [ + "D2_FACT_INDEX", + "D4_WORKFLOW_INDEX", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "docs_layers_with_hits": [ + "D2_FACT_INDEX", + "D4_WORKFLOW_INDEX", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "planned_layers": [ + "D2_FACT_INDEX", + "D4_WORKFLOW_INDEX", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "executed_layers": [ + "D2_FACT_INDEX", + "D4_WORKFLOW_INDEX", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "non_empty_layers": [ + "D2_FACT_INDEX", + "D4_WORKFLOW_INDEX", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "layer_diagnostics": { + "D2_FACT_INDEX": { + "hits": 8, + "top_ids": [ + "1cff54331a52b7a92946e7afabe7e45d7e3ec693b59546f9666e494396593bc3", + "0d923b02d15cef527d51740b7a09378a7dc74fb58db27cd059a8658ad11601a5", + "3d3b6fcc21144cb68657be099291db0ae36d61d32d6d72fd5b7c3cb81f379877", + "0b70cbff38a527cecfb53d3f72d573e9da1826cc75bd4cb92357e1de10988204", + "ce6d44c30418b0b171433a144f78d4bbf53b7a060d9b7cd42b9feecc8ca3044e" + ], + "top_sections": [ + "api.health_endpoint:workflow_step", + "api.health_endpoint:mentions_entity" + ] + }, + "D4_WORKFLOW_INDEX": { + "hits": 3, + "top_ids": [ + "api.health_endpoint", + "api.control_actions_endpoint", + "api.send_message_endpoint" + ], + "top_sections": [ + "Scenario" + ] + }, + "D1_DOCUMENT_CATALOG": { + "hits": 4, + "top_ids": [ + "domain.runtime_health", + "api.health_endpoint", + "docs/README.md", + "architecture.telegram_notify_app" + ], + "top_sections": [ + "Сущность runtime health", + "HTTP API /health", + "Readme", + "Архитектура Telegram Notify App" + ] + }, + "D0_DOC_CHUNKS": { + "hits": 4, + "top_ids": [ + "api.health_endpoint" + ], + "top_sections": [ + "api.health_endpoint:Описание", + "api.health_endpoint:Сценарий", + "api.health_endpoint:Summary", + "api.health_endpoint:Функциональные требования" + ] + } + }, + "query_entity_candidates": [], + "resolved_entity_candidates": [], + "query_anchor_candidates": [ + "/health" + ], + "resolved_anchor_candidates": [ + "api.health_endpoint", + "docs/documentation/api/health-endpoint.md" + ], + "anchor_candidates": [], + "selected_anchor": null, + "anchor_selection_reason": "", + "anchor_match_type": "", + "doc_ids": [ + "api.health_endpoint" + ], + "doc_paths": [ + "docs/documentation/api/health-endpoint.md" + ], + "doc_titles": [ + "Scenario", + "HTTP API /health", + "api.health_endpoint:Сценарий", + "api.health_endpoint:workflow_step", + "api.health_endpoint:mentions_entity", + "api.health_endpoint:Описание", + "api.health_endpoint:Summary", + "api.health_endpoint:Функциональные требования" + ], + "relation_hits_count": 0, + "relation_targets": [], + "selected_doc_ids": [ + "api.health_endpoint" + ], + "selected_fact_ids": [ + "1cff54331a52b7a92946e7afabe7e45d7e3ec693b59546f9666e494396593bc3", + "3d3b6fcc21144cb68657be099291db0ae36d61d32d6d72fd5b7c3cb81f379877" + ], + "selected_relation_ids": [], + "selected_chunk_ids": [ + "api.health_endpoint" + ], + "selected_entity_ids": [], + "selected_workflow_ids": [ + "83a9287bd9ac1f709258078d0e16d326615b4af1b7d77b323ff050dfb97a3e41" + ], + "fallback_doc_hits_count": 3, + "fallback_used": false, + "fact_hits": 2, + "entity_hits": 0, + "evidence_summary": { + "documents": 1, + "facts": 2, + "entities": 0, + "workflows": 1, + "relations": 0, + "chunks": 2, + "selected_doc_ids": [ + "api.health_endpoint" + ], + "selected_fact_ids": [ + "1cff54331a52b7a92946e7afabe7e45d7e3ec693b59546f9666e494396593bc3", + "3d3b6fcc21144cb68657be099291db0ae36d61d32d6d72fd5b7c3cb81f379877" + ], + "selected_relation_ids": [], + "selected_chunk_ids": [ + "api.health_endpoint" + ], + "entity_hits": 0, + "openapi_signals": { + "path_found": false, + "method_found": false, + "operation_semantics_found": false, + "request_payload_found": false, + "request_schema": false, + "request_fields_found": false, + "response_payload_found": false, + "response_schema": false, + "response_fields_found": false, + "status_codes": false, + "content_type_found": false, + "examples_found": false, + "payload_description": false + } + }, + "gate_decision": "allow", + "gate_decision_reason": "evidence_sufficient", + "gate_missing_requirements": [], + "gate_satisfied_requirements": [ + "retrieval_non_empty", + "exact_anchor_match" + ], + "openapi_evidence": { + "path_found": false, + "method_found": false, + "operation_semantics_found": false, + "request_payload_found": false, + "request_schema": false, + "request_fields_found": false, + "response_payload_found": false, + "response_schema": false, + "response_fields_found": false, + "status_codes": false, + "content_type_found": false, + "examples_found": false, + "payload_description": false + }, + "requested_fragment_type": null, + "fragment_evidence_found": [], + "fragment_missing_requirements": [], + "answer_mode": "ready", + "degrade_reason": null, + "degraded_reason": null, + "code_intents_stubbed": false +} + +## LLM Request +- prompt_name: docs_explain_answer +- log_context: graph.project_qa.docs.answer + +### Prompt Stats +```json +{ + "system_chars": 393, + "user_chars": 9482, + "tokens_in_estimate": 2469 +} +``` + +### System Prompt +```text +Ты объясняешь документацию системы. + +На вход приходит JSON с полями: +- question +- intent +- sub_intent +- documents +- facts +- relations + +Правила: +- Используй только предоставленные факты +- Не додумывай +- Если данных недостаточно, скажи это явно +- Объясняй структурировано + +Формат ответа: +1. Краткое описание +2. Основные элементы +3. Как это работает +4. Связи с другими частями системы (если есть) +``` + +### User Prompt +```json +{ + "question": "Что делает /health?", + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "API_METHOD_EXPLAIN", + "documents": [ + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/api/health-endpoint.md", + "title": "HTTP API /health", + "content": "Endpoint `/health` возвращает агрегированный health payload runtime. Если общий статус равен `ok`, API отвечает с HTTP 200; для состояний деградации или неготовности возвращается HTTP 503 с тем же payload. Endpoint служит основной точкой внешней проверки состояния приложения.", + "metadata": { + "name": "health_endpoint", + "tags": [ + "api", + "health", + "control-plane" + ], + "type": "api_method", + "layer": "application", + "links": [ + { + "type": "part_of", + "target": "architecture.telegram_notify_app" + }, + { + "type": "depends_on", + "target": "domain.runtime_health" + } + ], + "owner": null, + "title": "HTTP API /health", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "architecture.telegram_notify_app", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "8b5a533a8076e2e9d36995eee29aeade260080bdca2ec8e21fe28f08574b983f", + "children": [], + "doc_kind": "misc", + "entities": [ + "TelegramControlChannel", + "TelegramNotifyWorker", + "RuntimeManager", + "WorkerHealth" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "api.health_endpoint", + "source_path": "docs/documentation/api/health-endpoint.md", + "summary_text": "Endpoint `/health` возвращает агрегированный health payload runtime. Если общий статус равен `ok`, API отвечает с HTTP 200; для состояний деградации или неготовности возвращается HTTP 503 с тем же payload. Endpoint служит основной точкой внешней проверки состояния приложения.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + } + ], + "facts": [ + { + "layer": "D2_FACT_INDEX", + "path": "docs/documentation/api/health-endpoint.md", + "title": "api.health_endpoint:workflow_step", + "content": "api.health_endpoint workflow_step Предусловия:**", + "metadata": { + "tags": [], + "owner": null, + "anchor": "Сценарий", + "doc_id": null, + "object": "Предусловия:**", + "fact_id": "1cff54331a52b7a92946e7afabe7e45d7e3ec693b59546f9666e494396593bc3", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "8b5a533a8076e2e9d36995eee29aeade260080bdca2ec8e21fe28f08574b983f", + "predicate": "workflow_step", + "object_ref": null, + "subject_id": "api.health_endpoint", + "doc_version": null, + "source_path": "docs/documentation/api/health-endpoint.md", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D2_FACT_INDEX", + "path": "docs/documentation/api/health-endpoint.md", + "title": "api.health_endpoint:mentions_entity", + "content": "api.health_endpoint mentions_entity TelegramControlChannel", + "metadata": { + "tags": [], + "owner": null, + "anchor": "frontmatter.entities", + "doc_id": null, + "object": "TelegramControlChannel", + "fact_id": "3d3b6fcc21144cb68657be099291db0ae36d61d32d6d72fd5b7c3cb81f379877", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "8b5a533a8076e2e9d36995eee29aeade260080bdca2ec8e21fe28f08574b983f", + "predicate": "mentions_entity", + "object_ref": null, + "subject_id": "api.health_endpoint", + "doc_version": null, + "source_path": "docs/documentation/api/health-endpoint.md", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + } + ], + "entities": [], + "workflows": [ + { + "layer": "D4_WORKFLOW_INDEX", + "path": "docs/documentation/api/health-endpoint.md", + "title": "Scenario", + "content": "Scenario\nHTTP control plane запущен.\n`TelegramControlChannel` зарегистрирован в runtime.\nКлиент отправляет `GET /health`.\n1. Endpoint принимает HTTP-запрос `GET /health`.\n2. API вызывает `health_provider` через `TelegramControlChannel`.\n3. Канал получает health payload от runtime.\n4. Endpoint определяет HTTP status code по полю `status` в payload.\n5. Endpoint возвращает payload клиенту в формате JSON.\n1. Если runtime вернул статус, отличный от `ok`, endpoint возвращает тот же payload c HTTP 503.", + "metadata": { + "owner": null, + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "trigger": [ + "Клиент отправляет `GET /health`." + ], + "blob_sha": "8b5a533a8076e2e9d36995eee29aeade260080bdca2ec8e21fe28f08574b983f", + "main_flow": [ + "1. Endpoint принимает HTTP-запрос `GET /health`.", + "2. API вызывает `health_provider` через `TelegramControlChannel`.", + "3. Канал получает health payload от runtime.", + "4. Endpoint определяет HTTP status code по полю `status` в payload.", + "5. Endpoint возвращает payload клиенту в формате JSON." + ], + "doc_version": null, + "document_id": "api.health_endpoint", + "source_path": "docs/documentation/api/health-endpoint.md", + "workflow_id": "83a9287bd9ac1f709258078d0e16d326615b4af1b7d77b323ff050dfb97a3e41", + "artifact_type": null, + "last_modified": null, + "preconditions": [ + "HTTP control plane запущен.", + "`TelegramControlChannel` зарегистрирован в runtime." + ], + "workflow_name": "Scenario", + "error_handling": [ + "1. Если provider завершился исключением, запрос завершается server-side ошибкой." + ], + "postconditions": [ + "Клиент получает актуальный health payload runtime." + ], + "staleness_score": null, + "alternative_flow": [ + "1. Если runtime вернул статус, отличный от `ok`, endpoint возвращает тот же payload c HTTP 503." + ], + "system_component": null + } + } + ], + "relations": [], + "chunks": [ + { + "layer": "D0_DOC_CHUNKS", + "path": "docs/documentation/api/health-endpoint.md", + "title": "api.health_endpoint:Сценарий", + "content": "**Название:** Получение health-состояния runtime\n\n**Предусловия:**\n- HTTP control plane запущен.\n- `TelegramControlChannel` зарегистрирован в runtime.\n\n**Триггер:**\n- Клиент отправляет `GET /health`.\n\n**Основной сценарий:**\n1. Endpoint принимает HTTP-запрос `GET /health`.\n2. API вызывает `health_provider` через `TelegramControlChannel`.\n3. Канал получает health payload от runtime.\n4. Endpoint определяет HTTP status code по полю `status` в payload.\n5. Endpoint возвращает payload клиенту в формате JSON.\n\n**Альтернативный сценарий:**\n1. Если runtime вернул статус, отличный от `ok`, endpoint возвращает тот же payload c HTTP 503.\n\n**Обработка ошибок:**\n1. Если provider завершился исключением, запрос завершается server-side ошибкой.\n\n**Постусловие:**\n- Клиент получает актуальный health payload runtime.", + "metadata": { + "tags": [ + "api", + "health", + "control-plane" + ], + "type": "api_method", + "order": 4, + "owner": null, + "doc_id": null, + "module": "telegram_notify_app", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "8b5a533a8076e2e9d36995eee29aeade260080bdca2ec8e21fe28f08574b983f", + "doc_kind": "misc", + "doc_version": null, + "document_id": "api.health_endpoint", + "source_path": "docs/documentation/api/health-endpoint.md", + "section_path": "Details > Сценарий", + "artifact_type": null, + "last_modified": null, + "section_title": "Сценарий", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D0_DOC_CHUNKS", + "path": "docs/documentation/api/health-endpoint.md", + "title": "api.health_endpoint:Описание", + "content": "Метод предоставляет текущее состояние runtime и его компонентов без изменения состояния системы. Он нужен для мониторинга, readiness/liveness-проверок и быстрой диагностики worker'а `telegram_notify`.", + "metadata": { + "tags": [ + "api", + "health", + "control-plane" + ], + "type": "api_method", + "order": 3, + "owner": null, + "doc_id": null, + "module": "telegram_notify_app", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "8b5a533a8076e2e9d36995eee29aeade260080bdca2ec8e21fe28f08574b983f", + "doc_kind": "misc", + "doc_version": null, + "document_id": "api.health_endpoint", + "source_path": "docs/documentation/api/health-endpoint.md", + "section_path": "Details > Описание", + "artifact_type": null, + "last_modified": null, + "section_title": "Описание", + "staleness_score": null, + "system_component": null + } + } + ] +} +``` + +### User Prompt Overview +- question: Что делает /health? +- intent: DOCUMENTATION_EXPLAIN +- sub_intent: API_METHOD_EXPLAIN +- documents: 1 | samples: HTTP API /health +- facts: 2 | samples: api.health_endpoint:workflow_step, api.health_endpoint:mentions_entity +- relations: 0 + +## Mismatches +- none \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/docs_router_llm_disambiguation/20260326_150139/full_chain_docs_intents_v3-3x_v3-api-health-2.json b/tests/pipeline_setup_v3/test_results/docs_router_llm_disambiguation/20260326_150139/full_chain_docs_intents_v3-3x_v3-api-health-2.json new file mode 100644 index 0000000..9245f07 --- /dev/null +++ b/tests/pipeline_setup_v3/test_results/docs_router_llm_disambiguation/20260326_150139/full_chain_docs_intents_v3-3x_v3-api-health-2.json @@ -0,0 +1,87 @@ +{ + "meta": { + "case_id": "v3-api-health-2", + "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_03_docs/full_chain_docs_intents_v3-3x.yaml", + "runner": "agent_runtime", + "mode": "pre_llm", + "passed": true, + "mismatches": [], + "actual": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "API_METHOD_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START", + "rag_count": 13, + "llm_answer": "", + "answer_mode": "answered", + "path_scope": [], + "doc_scope": [ + "api.control_actions_endpoint", + "api.health_endpoint", + "api.send_message_endpoint", + "api.actions_endpoint", + "domain.runtime_health" + ], + "entity_candidates": [], + "symbol_candidates": [], + "layers": [ + "D2_FACT_INDEX", + "D4_WORKFLOW_INDEX", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "filters": { + "doc_type": "api_method" + }, + "pipeline_mode": "pre_llm_only", + "gate_decision": "allow", + "prompt_used": "docs_explain_answer", + "llm_mode": "prose", + "degraded_reason": null, + "code_intents_stubbed": true + } + }, + "pipeline_steps": [ + { + "step": "input_query", + "input": { + "query": "Как работает health endpoint?" + }, + "output": { + "query": "Как работает health endpoint?" + } + }, + { + "step": "router", + "input": { + "query": "Как работает health endpoint?" + }, + "output": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "API_METHOD_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START" + } + }, + { + "step": "docs_pipeline", + "input": { + "query": "Как работает health endpoint?" + }, + "output": { + "answer_mode": "ready", + "prompt_name": "docs_explain_answer", + "llm_request": { + "prompt_name": "docs_explain_answer", + "log_context": "graph.project_qa.docs.answer", + "prompt_stats": { + "system_chars": 393, + "user_chars": 10990, + "tokens_in_estimate": 2846 + } + }, + "degraded_reason": "" + } + } + ] +} \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/docs_router_llm_disambiguation/20260326_150139/full_chain_docs_intents_v3-3x_v3-api-health-2.md b/tests/pipeline_setup_v3/test_results/docs_router_llm_disambiguation/20260326_150139/full_chain_docs_intents_v3-3x_v3-api-health-2.md new file mode 100644 index 0000000..cd8aad2 --- /dev/null +++ b/tests/pipeline_setup_v3/test_results/docs_router_llm_disambiguation/20260326_150139/full_chain_docs_intents_v3-3x_v3-api-health-2.md @@ -0,0 +1,621 @@ +# v3-api-health-2 + +- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_03_docs/full_chain_docs_intents_v3-3x.yaml +- runner: agent_runtime +- mode: pre_llm +- passed: True + +## Query +Как работает health endpoint? + +## Actual +{ + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "API_METHOD_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START", + "rag_count": 13, + "llm_answer": "", + "answer_mode": "answered", + "path_scope": [], + "doc_scope": [ + "api.control_actions_endpoint", + "api.health_endpoint", + "api.send_message_endpoint", + "api.actions_endpoint", + "domain.runtime_health" + ], + "entity_candidates": [], + "symbol_candidates": [], + "layers": [ + "D2_FACT_INDEX", + "D4_WORKFLOW_INDEX", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "filters": { + "doc_type": "api_method" + }, + "pipeline_mode": "pre_llm_only", + "gate_decision": "allow", + "prompt_used": "docs_explain_answer", + "llm_mode": "prose", + "degraded_reason": null, + "code_intents_stubbed": true +} + +## Pipeline Steps +### input_query +```json +{ + "input": { + "query": "Как работает health endpoint?" + }, + "output": { + "query": "Как работает health endpoint?" + } +} +``` + +### router +```json +{ + "input": { + "query": "Как работает health endpoint?" + }, + "output": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "API_METHOD_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START" + } +} +``` + +### docs_pipeline +```json +{ + "input": { + "query": "Как работает health endpoint?" + }, + "output": { + "answer_mode": "ready", + "prompt_name": "docs_explain_answer", + "llm_request": { + "prompt_name": "docs_explain_answer", + "log_context": "graph.project_qa.docs.answer", + "prompt_stats": { + "system_chars": 393, + "user_chars": 10990, + "tokens_in_estimate": 2846 + } + }, + "degraded_reason": "" + } +} +``` + +## Diagnostics +{ + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "API_METHOD_EXPLAIN", + "layers_used": [ + "D2_FACT_INDEX", + "D4_WORKFLOW_INDEX", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "documents_found": 1, + "facts_found": 2, + "relations_found": 0, + "openapi_fields_extracted": 0, + "missing_required_fields": [], + "openapi_status": { + "has_path": false, + "has_method": false, + "has_request": false, + "has_response": false + }, + "prompt_used": "docs_explain_answer", + "llm_mode": "prose", + "output_valid": true, + "matched_intent_source": "llm", + "matched_anchor_type": "topic", + "matched_anchor_value": null, + "exact_anchor_match": false, + "docs_layers_requested": [ + "D2_FACT_INDEX", + "D4_WORKFLOW_INDEX", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "docs_layers_with_hits": [ + "D2_FACT_INDEX", + "D4_WORKFLOW_INDEX", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "planned_layers": [ + "D2_FACT_INDEX", + "D4_WORKFLOW_INDEX", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "executed_layers": [ + "D2_FACT_INDEX", + "D4_WORKFLOW_INDEX", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "non_empty_layers": [ + "D2_FACT_INDEX", + "D4_WORKFLOW_INDEX", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "layer_diagnostics": { + "D2_FACT_INDEX": { + "hits": 8, + "top_ids": [ + "f85d982c272a2ee6baeadc433221a20e684cd8ef01cb4788d6f76d05ca56d6d0", + "b8e44c3adb74aaa6c91ae8815fa091289e58dd3990a3a1b63e850c62075aea75", + "b6bfad59b3bf00f199b5ef90c1208af19664de700413e7354468a93a4abaaa2f", + "a8a325e0815b3a2a870ba2825f3afb3f41056b4c091df4c3bb3418ffd20891dd", + "bafb867ffed41c9db637df98d6cd5f6722d7747bbebc6c03e6f0d0caf3b7f9f3" + ], + "top_sections": [ + "api.control_actions_endpoint:workflow_step", + "api.control_actions_endpoint:mentions_entity" + ] + }, + "D4_WORKFLOW_INDEX": { + "hits": 3, + "top_ids": [ + "api.control_actions_endpoint", + "api.health_endpoint", + "api.send_message_endpoint" + ], + "top_sections": [ + "Scenario" + ] + }, + "D1_DOCUMENT_CATALOG": { + "hits": 4, + "top_ids": [ + "api.send_message_endpoint", + "api.control_actions_endpoint", + "api.health_endpoint", + "domain.runtime_health" + ], + "top_sections": [ + "HTTP API /send", + "HTTP API /actions/{action}", + "HTTP API /health", + "Сущность runtime health" + ] + }, + "D0_DOC_CHUNKS": { + "hits": 4, + "top_ids": [ + "api.control_actions_endpoint" + ], + "top_sections": [ + "api.control_actions_endpoint:Описание", + "api.control_actions_endpoint:Сценарий", + "api.control_actions_endpoint:Summary", + "api.control_actions_endpoint:Функциональные требования" + ] + } + }, + "query_entity_candidates": [], + "resolved_entity_candidates": [], + "query_anchor_candidates": [], + "resolved_anchor_candidates": [ + "docs/documentation/api/control-actions-endpoint.md", + "api.control_actions_endpoint", + "api.health_endpoint", + "docs/documentation/api/health-endpoint.md", + "api.send_message_endpoint", + "docs/documentation/api/send-message-endpoint.md", + "domain.runtime_health", + "docs/documentation/domain/runtime-health-entity.md" + ], + "anchor_candidates": [], + "selected_anchor": null, + "anchor_selection_reason": "", + "anchor_match_type": "", + "doc_ids": [ + "api.control_actions_endpoint", + "api.health_endpoint", + "api.send_message_endpoint", + "api.actions_endpoint", + "domain.runtime_health" + ], + "doc_paths": [ + "docs/documentation/api/control-actions-endpoint.md", + "docs/documentation/api/health-endpoint.md", + "docs/documentation/api/send-message-endpoint.md", + "docs/documentation/domain/runtime-health-entity.md" + ], + "doc_titles": [ + "api.control_actions_endpoint:workflow_step", + "api.control_actions_endpoint:mentions_entity", + "Scenario", + "HTTP API /send", + "HTTP API /actions/{action}", + "HTTP API /health", + "Сущность runtime health", + "api.control_actions_endpoint:Описание", + "api.control_actions_endpoint:Сценарий", + "api.control_actions_endpoint:Summary", + "api.control_actions_endpoint:Функциональные требования" + ], + "relation_hits_count": 0, + "relation_targets": [], + "selected_doc_ids": [ + "api.send_message_endpoint", + "api.control_actions_endpoint" + ], + "selected_fact_ids": [ + "f85d982c272a2ee6baeadc433221a20e684cd8ef01cb4788d6f76d05ca56d6d0", + "b6bfad59b3bf00f199b5ef90c1208af19664de700413e7354468a93a4abaaa2f" + ], + "selected_relation_ids": [], + "selected_chunk_ids": [ + "api.control_actions_endpoint" + ], + "selected_entity_ids": [], + "selected_workflow_ids": [ + "f78b822d4366b10322fd4a35e347deae59d55ff4132951201f4df3d1653aec61" + ], + "fallback_doc_hits_count": 3, + "fallback_used": false, + "fact_hits": 2, + "entity_hits": 0, + "evidence_summary": { + "documents": 1, + "facts": 2, + "entities": 0, + "workflows": 1, + "relations": 0, + "chunks": 2, + "selected_doc_ids": [ + "api.send_message_endpoint", + "api.control_actions_endpoint" + ], + "selected_fact_ids": [ + "f85d982c272a2ee6baeadc433221a20e684cd8ef01cb4788d6f76d05ca56d6d0", + "b6bfad59b3bf00f199b5ef90c1208af19664de700413e7354468a93a4abaaa2f" + ], + "selected_relation_ids": [], + "selected_chunk_ids": [ + "api.control_actions_endpoint" + ], + "entity_hits": 0, + "openapi_signals": { + "path_found": false, + "method_found": false, + "operation_semantics_found": false, + "request_payload_found": false, + "request_schema": false, + "request_fields_found": false, + "response_payload_found": false, + "response_schema": false, + "response_fields_found": false, + "status_codes": false, + "content_type_found": false, + "examples_found": false, + "payload_description": false + } + }, + "gate_decision": "allow", + "gate_decision_reason": "evidence_sufficient", + "gate_missing_requirements": [], + "gate_satisfied_requirements": [ + "retrieval_non_empty" + ], + "openapi_evidence": { + "path_found": false, + "method_found": false, + "operation_semantics_found": false, + "request_payload_found": false, + "request_schema": false, + "request_fields_found": false, + "response_payload_found": false, + "response_schema": false, + "response_fields_found": false, + "status_codes": false, + "content_type_found": false, + "examples_found": false, + "payload_description": false + }, + "requested_fragment_type": null, + "fragment_evidence_found": [], + "fragment_missing_requirements": [], + "answer_mode": "ready", + "degrade_reason": null, + "degraded_reason": null, + "code_intents_stubbed": false +} + +## LLM Request +- prompt_name: docs_explain_answer +- log_context: graph.project_qa.docs.answer + +### Prompt Stats +```json +{ + "system_chars": 393, + "user_chars": 10990, + "tokens_in_estimate": 2846 +} +``` + +### System Prompt +```text +Ты объясняешь документацию системы. + +На вход приходит JSON с полями: +- question +- intent +- sub_intent +- documents +- facts +- relations + +Правила: +- Используй только предоставленные факты +- Не додумывай +- Если данных недостаточно, скажи это явно +- Объясняй структурировано + +Формат ответа: +1. Краткое описание +2. Основные элементы +3. Как это работает +4. Связи с другими частями системы (если есть) +``` + +### User Prompt +```json +{ + "question": "Как работает health endpoint?", + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "API_METHOD_EXPLAIN", + "documents": [ + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/api/send-message-endpoint.md", + "title": "HTTP API /send", + "content": "Endpoint `/send` выполняет ручную отправку сообщения в Telegram через `TelegramSendService`. Он используется для операторской проверки доставки и для отправки уведомлений вне периодического worker loop. Endpoint работает поверх тех же credentials и того же delivery path, что и фоновая отправка.", + "metadata": { + "name": "send_message_endpoint", + "tags": [ + "api", + "telegram", + "manual-send" + ], + "type": "api_method", + "layer": "application", + "links": [ + { + "type": "part_of", + "target": "architecture.telegram_notify_app" + }, + { + "type": "depends_on", + "target": "logic.telegram_notification_loop" + } + ], + "owner": null, + "title": "HTTP API /send", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "architecture.telegram_notify_app", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "5fbf2e33510b0676a3a53b957a4569bd3c2c31fb7719546602c573421ccaa32d", + "children": [], + "doc_kind": "misc", + "entities": [ + "TelegramControlAppFactory", + "TelegramSendService", + "TelegramNotifyWorker" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "api.send_message_endpoint", + "source_path": "docs/documentation/api/send-message-endpoint.md", + "summary_text": "Endpoint `/send` выполняет ручную отправку сообщения в Telegram через `TelegramSendService`. Он используется для операторской проверки доставки и для отправки уведомлений вне периодического worker loop. Endpoint работает поверх тех же credentials и того же delivery path, что и фоновая отправка.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + } + ], + "facts": [ + { + "layer": "D2_FACT_INDEX", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "api.control_actions_endpoint:workflow_step", + "content": "api.control_actions_endpoint workflow_step Название:** Выполнение control action runtime", + "metadata": { + "tags": [], + "owner": null, + "anchor": "Сценарий", + "doc_id": null, + "object": "Название:** Выполнение control action runtime", + "fact_id": "f85d982c272a2ee6baeadc433221a20e684cd8ef01cb4788d6f76d05ca56d6d0", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "predicate": "workflow_step", + "object_ref": null, + "subject_id": "api.control_actions_endpoint", + "doc_version": null, + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D2_FACT_INDEX", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "api.control_actions_endpoint:mentions_entity", + "content": "api.control_actions_endpoint mentions_entity JSONResponse", + "metadata": { + "tags": [], + "owner": null, + "anchor": "frontmatter.entities", + "doc_id": null, + "object": "JSONResponse", + "fact_id": "b6bfad59b3bf00f199b5ef90c1208af19664de700413e7354468a93a4abaaa2f", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "predicate": "mentions_entity", + "object_ref": null, + "subject_id": "api.control_actions_endpoint", + "doc_version": null, + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + } + ], + "entities": [], + "workflows": [ + { + "layer": "D4_WORKFLOW_INDEX", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "Scenario", + "content": "Scenario\nHTTP control plane запущен.\n`ControlActionSet` сконфигурирован в `TelegramControlChannel`.\nВ path передано одно из поддерживаемых действий: `start`, `stop`, `status`.\nКлиент отправляет `GET` или `POST` на `/actions/{action}`.\n1. Endpoint принимает запрос и извлекает path parameter `action`.\n2. API определяет источник клиента через `X-Client-Source` или `User-Agent`.\n3. Для `start` и `stop` запрос логируется как control action.\n4. Канал сопоставляет `action` с callback из `ControlActionSet`.\n5. API ожидает завершения callback в пределах допустимого timeout.\n6. При успешном завершении API возвращает JSON со статусом `ok`.\n1. Если `start` или `stop` не успевают завершиться в timeout, API возвращает `202 accepted` и сообщает, что операция еще выполняется.", + "metadata": { + "owner": null, + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "trigger": [ + "Клиент отправляет `GET` или `POST` на `/actions/{action}`." + ], + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "main_flow": [ + "1. Endpoint принимает запрос и извлекает path parameter `action`.", + "2. API определяет источник клиента через `X-Client-Source` или `User-Agent`.", + "3. Для `start` и `stop` запрос логируется как control action.", + "4. Канал сопоставляет `action` с callback из `ControlActionSet`.", + "5. API ожидает завершения callback в пределах допустимого timeout.", + "6. При успешном завершении API возвращает JSON со статусом `ok`." + ], + "doc_version": null, + "document_id": "api.control_actions_endpoint", + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "workflow_id": "f78b822d4366b10322fd4a35e347deae59d55ff4132951201f4df3d1653aec61", + "artifact_type": null, + "last_modified": null, + "preconditions": [ + "HTTP control plane запущен.", + "`ControlActionSet` сконфигурирован в `TelegramControlChannel`.", + "В path передано одно из поддерживаемых действий: `start`, `stop`, `status`." + ], + "workflow_name": "Scenario", + "error_handling": [ + "1. Если actions не сконфигурированы, API возвращает `404`.", + "2. Если передано неподдерживаемое действие, API возвращает `404`.", + "3. Если callback завершился исключением, API возвращает `500`." + ], + "postconditions": [ + "Клиент получает результат выполнения control action или признак, что операция еще продолжается." + ], + "staleness_score": null, + "alternative_flow": [ + "1. Если `start` или `stop` не успевают завершиться в timeout, API возвращает `202 accepted` и сообщает, что операция еще выполняется." + ], + "system_component": null + } + } + ], + "relations": [], + "chunks": [ + { + "layer": "D0_DOC_CHUNKS", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "api.control_actions_endpoint:Описание", + "content": "Метод предоставляет HTTP-доступ к control actions runtime и позволяет запускать, останавливать или проверять состояние управляемых компонентов. Endpoint не реализует lifecycle самостоятельно, а делегирует выполнение в `ControlActionSet`.", + "metadata": { + "tags": [ + "api", + "control-plane", + "lifecycle" + ], + "type": "api_method", + "order": 3, + "owner": null, + "doc_id": null, + "module": "telegram_notify_app", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "doc_kind": "misc", + "doc_version": null, + "document_id": "api.control_actions_endpoint", + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "section_path": "Details > Описание", + "artifact_type": null, + "last_modified": null, + "section_title": "Описание", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D0_DOC_CHUNKS", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "api.control_actions_endpoint:Сценарий", + "content": "**Название:** Выполнение control action runtime\n\n**Предусловия:**\n- HTTP control plane запущен.\n- `ControlActionSet` сконфигурирован в `TelegramControlChannel`.\n- В path передано одно из поддерживаемых действий: `start`, `stop`, `status`.\n\n**Триггер:**\n- Клиент отправляет `GET` или `POST` на `/actions/{action}`.\n\n**Основной сценарий:**\n1. Endpoint принимает запрос и извлекает path parameter `action`.\n2. API определяет источник клиента через `X-Client-Source` или `User-Agent`.\n3. Для `start` и `stop` запрос логируется как control action.\n4. Канал сопоставляет `action` с callback из `ControlActionSet`.\n5. API ожидает завершения callback в пределах допустимого timeout.\n6. При успешном завершении API возвращает JSON со статусом `ok`.\n\n**Альтернативный сценарий:**\n1. Если `start` или `stop` не успевают завершиться в timeout, API возвращает `202 accepted` и сообщает, что операция еще выполняется.\n\n**Обработка ошибок:**\n1. Если actions не сконфигурированы, API возвращает `404`.\n2. Если передано неподдерживаемое действие, API возвращает `404`.\n3. Если callback завершился исключением, API возвращает `500`.\n\n**Постусловие:**\n- Клиент получает результат выполнения control action или признак, что операция еще продолжается.", + "metadata": { + "tags": [ + "api", + "control-plane", + "lifecycle" + ], + "type": "api_method", + "order": 4, + "owner": null, + "doc_id": null, + "module": "telegram_notify_app", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "doc_kind": "misc", + "doc_version": null, + "document_id": "api.control_actions_endpoint", + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "section_path": "Details > Сценарий", + "artifact_type": null, + "last_modified": null, + "section_title": "Сценарий", + "staleness_score": null, + "system_component": null + } + } + ] +} +``` + +### User Prompt Overview +- question: Как работает health endpoint? +- intent: DOCUMENTATION_EXPLAIN +- sub_intent: API_METHOD_EXPLAIN +- documents: 1 | samples: HTTP API /send +- facts: 2 | samples: api.control_actions_endpoint:workflow_step, api.control_actions_endpoint:mentions_entity +- relations: 0 + +## Mismatches +- none \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/docs_router_llm_disambiguation/20260326_150139/full_chain_docs_intents_v3-3x_v3-api-health-3.json b/tests/pipeline_setup_v3/test_results/docs_router_llm_disambiguation/20260326_150139/full_chain_docs_intents_v3-3x_v3-api-health-3.json new file mode 100644 index 0000000..796bce7 --- /dev/null +++ b/tests/pipeline_setup_v3/test_results/docs_router_llm_disambiguation/20260326_150139/full_chain_docs_intents_v3-3x_v3-api-health-3.json @@ -0,0 +1,87 @@ +{ + "meta": { + "case_id": "v3-api-health-3", + "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_03_docs/full_chain_docs_intents_v3-3x.yaml", + "runner": "agent_runtime", + "mode": "pre_llm", + "passed": true, + "mismatches": [], + "actual": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "API_METHOD_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START", + "rag_count": 13, + "llm_answer": "", + "answer_mode": "answered", + "path_scope": [], + "doc_scope": [ + "api.control_actions_endpoint", + "api.health_endpoint", + "api.send_message_endpoint", + "api.actions_endpoint", + "domain.runtime_health" + ], + "entity_candidates": [], + "symbol_candidates": [], + "layers": [ + "D2_FACT_INDEX", + "D4_WORKFLOW_INDEX", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "filters": { + "doc_type": "api_method" + }, + "pipeline_mode": "pre_llm_only", + "gate_decision": "allow", + "prompt_used": "docs_explain_answer", + "llm_mode": "prose", + "degraded_reason": null, + "code_intents_stubbed": true + } + }, + "pipeline_steps": [ + { + "step": "input_query", + "input": { + "query": "Опиши endpoint health" + }, + "output": { + "query": "Опиши endpoint health" + } + }, + { + "step": "router", + "input": { + "query": "Опиши endpoint health" + }, + "output": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "API_METHOD_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START" + } + }, + { + "step": "docs_pipeline", + "input": { + "query": "Опиши endpoint health" + }, + "output": { + "answer_mode": "ready", + "prompt_name": "docs_explain_answer", + "llm_request": { + "prompt_name": "docs_explain_answer", + "log_context": "graph.project_qa.docs.answer", + "prompt_stats": { + "system_chars": 393, + "user_chars": 10982, + "tokens_in_estimate": 2844 + } + }, + "degraded_reason": "" + } + } + ] +} \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/docs_router_llm_disambiguation/20260326_150139/full_chain_docs_intents_v3-3x_v3-api-health-3.md b/tests/pipeline_setup_v3/test_results/docs_router_llm_disambiguation/20260326_150139/full_chain_docs_intents_v3-3x_v3-api-health-3.md new file mode 100644 index 0000000..5ccff94 --- /dev/null +++ b/tests/pipeline_setup_v3/test_results/docs_router_llm_disambiguation/20260326_150139/full_chain_docs_intents_v3-3x_v3-api-health-3.md @@ -0,0 +1,621 @@ +# v3-api-health-3 + +- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_03_docs/full_chain_docs_intents_v3-3x.yaml +- runner: agent_runtime +- mode: pre_llm +- passed: True + +## Query +Опиши endpoint health + +## Actual +{ + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "API_METHOD_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START", + "rag_count": 13, + "llm_answer": "", + "answer_mode": "answered", + "path_scope": [], + "doc_scope": [ + "api.control_actions_endpoint", + "api.health_endpoint", + "api.send_message_endpoint", + "api.actions_endpoint", + "domain.runtime_health" + ], + "entity_candidates": [], + "symbol_candidates": [], + "layers": [ + "D2_FACT_INDEX", + "D4_WORKFLOW_INDEX", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "filters": { + "doc_type": "api_method" + }, + "pipeline_mode": "pre_llm_only", + "gate_decision": "allow", + "prompt_used": "docs_explain_answer", + "llm_mode": "prose", + "degraded_reason": null, + "code_intents_stubbed": true +} + +## Pipeline Steps +### input_query +```json +{ + "input": { + "query": "Опиши endpoint health" + }, + "output": { + "query": "Опиши endpoint health" + } +} +``` + +### router +```json +{ + "input": { + "query": "Опиши endpoint health" + }, + "output": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "API_METHOD_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START" + } +} +``` + +### docs_pipeline +```json +{ + "input": { + "query": "Опиши endpoint health" + }, + "output": { + "answer_mode": "ready", + "prompt_name": "docs_explain_answer", + "llm_request": { + "prompt_name": "docs_explain_answer", + "log_context": "graph.project_qa.docs.answer", + "prompt_stats": { + "system_chars": 393, + "user_chars": 10982, + "tokens_in_estimate": 2844 + } + }, + "degraded_reason": "" + } +} +``` + +## Diagnostics +{ + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "API_METHOD_EXPLAIN", + "layers_used": [ + "D2_FACT_INDEX", + "D4_WORKFLOW_INDEX", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "documents_found": 1, + "facts_found": 2, + "relations_found": 0, + "openapi_fields_extracted": 0, + "missing_required_fields": [], + "openapi_status": { + "has_path": false, + "has_method": false, + "has_request": false, + "has_response": false + }, + "prompt_used": "docs_explain_answer", + "llm_mode": "prose", + "output_valid": true, + "matched_intent_source": "deterministic", + "matched_anchor_type": "topic", + "matched_anchor_value": null, + "exact_anchor_match": false, + "docs_layers_requested": [ + "D2_FACT_INDEX", + "D4_WORKFLOW_INDEX", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "docs_layers_with_hits": [ + "D2_FACT_INDEX", + "D4_WORKFLOW_INDEX", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "planned_layers": [ + "D2_FACT_INDEX", + "D4_WORKFLOW_INDEX", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "executed_layers": [ + "D2_FACT_INDEX", + "D4_WORKFLOW_INDEX", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "non_empty_layers": [ + "D2_FACT_INDEX", + "D4_WORKFLOW_INDEX", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "layer_diagnostics": { + "D2_FACT_INDEX": { + "hits": 8, + "top_ids": [ + "f85d982c272a2ee6baeadc433221a20e684cd8ef01cb4788d6f76d05ca56d6d0", + "b8e44c3adb74aaa6c91ae8815fa091289e58dd3990a3a1b63e850c62075aea75", + "b6bfad59b3bf00f199b5ef90c1208af19664de700413e7354468a93a4abaaa2f", + "a8a325e0815b3a2a870ba2825f3afb3f41056b4c091df4c3bb3418ffd20891dd", + "bafb867ffed41c9db637df98d6cd5f6722d7747bbebc6c03e6f0d0caf3b7f9f3" + ], + "top_sections": [ + "api.control_actions_endpoint:workflow_step", + "api.control_actions_endpoint:mentions_entity" + ] + }, + "D4_WORKFLOW_INDEX": { + "hits": 3, + "top_ids": [ + "api.control_actions_endpoint", + "api.health_endpoint", + "api.send_message_endpoint" + ], + "top_sections": [ + "Scenario" + ] + }, + "D1_DOCUMENT_CATALOG": { + "hits": 4, + "top_ids": [ + "api.send_message_endpoint", + "api.control_actions_endpoint", + "api.health_endpoint", + "domain.runtime_health" + ], + "top_sections": [ + "HTTP API /send", + "HTTP API /actions/{action}", + "HTTP API /health", + "Сущность runtime health" + ] + }, + "D0_DOC_CHUNKS": { + "hits": 4, + "top_ids": [ + "api.control_actions_endpoint" + ], + "top_sections": [ + "api.control_actions_endpoint:Описание", + "api.control_actions_endpoint:Сценарий", + "api.control_actions_endpoint:Summary", + "api.control_actions_endpoint:Функциональные требования" + ] + } + }, + "query_entity_candidates": [], + "resolved_entity_candidates": [], + "query_anchor_candidates": [], + "resolved_anchor_candidates": [ + "docs/documentation/api/control-actions-endpoint.md", + "api.control_actions_endpoint", + "api.health_endpoint", + "docs/documentation/api/health-endpoint.md", + "api.send_message_endpoint", + "docs/documentation/api/send-message-endpoint.md", + "domain.runtime_health", + "docs/documentation/domain/runtime-health-entity.md" + ], + "anchor_candidates": [], + "selected_anchor": null, + "anchor_selection_reason": "", + "anchor_match_type": "", + "doc_ids": [ + "api.control_actions_endpoint", + "api.health_endpoint", + "api.send_message_endpoint", + "api.actions_endpoint", + "domain.runtime_health" + ], + "doc_paths": [ + "docs/documentation/api/control-actions-endpoint.md", + "docs/documentation/api/health-endpoint.md", + "docs/documentation/api/send-message-endpoint.md", + "docs/documentation/domain/runtime-health-entity.md" + ], + "doc_titles": [ + "api.control_actions_endpoint:workflow_step", + "api.control_actions_endpoint:mentions_entity", + "Scenario", + "HTTP API /send", + "HTTP API /actions/{action}", + "HTTP API /health", + "Сущность runtime health", + "api.control_actions_endpoint:Описание", + "api.control_actions_endpoint:Сценарий", + "api.control_actions_endpoint:Summary", + "api.control_actions_endpoint:Функциональные требования" + ], + "relation_hits_count": 0, + "relation_targets": [], + "selected_doc_ids": [ + "api.send_message_endpoint", + "api.control_actions_endpoint" + ], + "selected_fact_ids": [ + "f85d982c272a2ee6baeadc433221a20e684cd8ef01cb4788d6f76d05ca56d6d0", + "b6bfad59b3bf00f199b5ef90c1208af19664de700413e7354468a93a4abaaa2f" + ], + "selected_relation_ids": [], + "selected_chunk_ids": [ + "api.control_actions_endpoint" + ], + "selected_entity_ids": [], + "selected_workflow_ids": [ + "f78b822d4366b10322fd4a35e347deae59d55ff4132951201f4df3d1653aec61" + ], + "fallback_doc_hits_count": 3, + "fallback_used": false, + "fact_hits": 2, + "entity_hits": 0, + "evidence_summary": { + "documents": 1, + "facts": 2, + "entities": 0, + "workflows": 1, + "relations": 0, + "chunks": 2, + "selected_doc_ids": [ + "api.send_message_endpoint", + "api.control_actions_endpoint" + ], + "selected_fact_ids": [ + "f85d982c272a2ee6baeadc433221a20e684cd8ef01cb4788d6f76d05ca56d6d0", + "b6bfad59b3bf00f199b5ef90c1208af19664de700413e7354468a93a4abaaa2f" + ], + "selected_relation_ids": [], + "selected_chunk_ids": [ + "api.control_actions_endpoint" + ], + "entity_hits": 0, + "openapi_signals": { + "path_found": false, + "method_found": false, + "operation_semantics_found": false, + "request_payload_found": false, + "request_schema": false, + "request_fields_found": false, + "response_payload_found": false, + "response_schema": false, + "response_fields_found": false, + "status_codes": false, + "content_type_found": false, + "examples_found": false, + "payload_description": false + } + }, + "gate_decision": "allow", + "gate_decision_reason": "evidence_sufficient", + "gate_missing_requirements": [], + "gate_satisfied_requirements": [ + "retrieval_non_empty" + ], + "openapi_evidence": { + "path_found": false, + "method_found": false, + "operation_semantics_found": false, + "request_payload_found": false, + "request_schema": false, + "request_fields_found": false, + "response_payload_found": false, + "response_schema": false, + "response_fields_found": false, + "status_codes": false, + "content_type_found": false, + "examples_found": false, + "payload_description": false + }, + "requested_fragment_type": null, + "fragment_evidence_found": [], + "fragment_missing_requirements": [], + "answer_mode": "ready", + "degrade_reason": null, + "degraded_reason": null, + "code_intents_stubbed": false +} + +## LLM Request +- prompt_name: docs_explain_answer +- log_context: graph.project_qa.docs.answer + +### Prompt Stats +```json +{ + "system_chars": 393, + "user_chars": 10982, + "tokens_in_estimate": 2844 +} +``` + +### System Prompt +```text +Ты объясняешь документацию системы. + +На вход приходит JSON с полями: +- question +- intent +- sub_intent +- documents +- facts +- relations + +Правила: +- Используй только предоставленные факты +- Не додумывай +- Если данных недостаточно, скажи это явно +- Объясняй структурировано + +Формат ответа: +1. Краткое описание +2. Основные элементы +3. Как это работает +4. Связи с другими частями системы (если есть) +``` + +### User Prompt +```json +{ + "question": "Опиши endpoint health", + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "API_METHOD_EXPLAIN", + "documents": [ + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/api/send-message-endpoint.md", + "title": "HTTP API /send", + "content": "Endpoint `/send` выполняет ручную отправку сообщения в Telegram через `TelegramSendService`. Он используется для операторской проверки доставки и для отправки уведомлений вне периодического worker loop. Endpoint работает поверх тех же credentials и того же delivery path, что и фоновая отправка.", + "metadata": { + "name": "send_message_endpoint", + "tags": [ + "api", + "telegram", + "manual-send" + ], + "type": "api_method", + "layer": "application", + "links": [ + { + "type": "part_of", + "target": "architecture.telegram_notify_app" + }, + { + "type": "depends_on", + "target": "logic.telegram_notification_loop" + } + ], + "owner": null, + "title": "HTTP API /send", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "architecture.telegram_notify_app", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "5fbf2e33510b0676a3a53b957a4569bd3c2c31fb7719546602c573421ccaa32d", + "children": [], + "doc_kind": "misc", + "entities": [ + "TelegramControlAppFactory", + "TelegramSendService", + "TelegramNotifyWorker" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "api.send_message_endpoint", + "source_path": "docs/documentation/api/send-message-endpoint.md", + "summary_text": "Endpoint `/send` выполняет ручную отправку сообщения в Telegram через `TelegramSendService`. Он используется для операторской проверки доставки и для отправки уведомлений вне периодического worker loop. Endpoint работает поверх тех же credentials и того же delivery path, что и фоновая отправка.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + } + ], + "facts": [ + { + "layer": "D2_FACT_INDEX", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "api.control_actions_endpoint:workflow_step", + "content": "api.control_actions_endpoint workflow_step Название:** Выполнение control action runtime", + "metadata": { + "tags": [], + "owner": null, + "anchor": "Сценарий", + "doc_id": null, + "object": "Название:** Выполнение control action runtime", + "fact_id": "f85d982c272a2ee6baeadc433221a20e684cd8ef01cb4788d6f76d05ca56d6d0", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "predicate": "workflow_step", + "object_ref": null, + "subject_id": "api.control_actions_endpoint", + "doc_version": null, + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D2_FACT_INDEX", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "api.control_actions_endpoint:mentions_entity", + "content": "api.control_actions_endpoint mentions_entity JSONResponse", + "metadata": { + "tags": [], + "owner": null, + "anchor": "frontmatter.entities", + "doc_id": null, + "object": "JSONResponse", + "fact_id": "b6bfad59b3bf00f199b5ef90c1208af19664de700413e7354468a93a4abaaa2f", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "predicate": "mentions_entity", + "object_ref": null, + "subject_id": "api.control_actions_endpoint", + "doc_version": null, + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + } + ], + "entities": [], + "workflows": [ + { + "layer": "D4_WORKFLOW_INDEX", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "Scenario", + "content": "Scenario\nHTTP control plane запущен.\n`ControlActionSet` сконфигурирован в `TelegramControlChannel`.\nВ path передано одно из поддерживаемых действий: `start`, `stop`, `status`.\nКлиент отправляет `GET` или `POST` на `/actions/{action}`.\n1. Endpoint принимает запрос и извлекает path parameter `action`.\n2. API определяет источник клиента через `X-Client-Source` или `User-Agent`.\n3. Для `start` и `stop` запрос логируется как control action.\n4. Канал сопоставляет `action` с callback из `ControlActionSet`.\n5. API ожидает завершения callback в пределах допустимого timeout.\n6. При успешном завершении API возвращает JSON со статусом `ok`.\n1. Если `start` или `stop` не успевают завершиться в timeout, API возвращает `202 accepted` и сообщает, что операция еще выполняется.", + "metadata": { + "owner": null, + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "trigger": [ + "Клиент отправляет `GET` или `POST` на `/actions/{action}`." + ], + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "main_flow": [ + "1. Endpoint принимает запрос и извлекает path parameter `action`.", + "2. API определяет источник клиента через `X-Client-Source` или `User-Agent`.", + "3. Для `start` и `stop` запрос логируется как control action.", + "4. Канал сопоставляет `action` с callback из `ControlActionSet`.", + "5. API ожидает завершения callback в пределах допустимого timeout.", + "6. При успешном завершении API возвращает JSON со статусом `ok`." + ], + "doc_version": null, + "document_id": "api.control_actions_endpoint", + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "workflow_id": "f78b822d4366b10322fd4a35e347deae59d55ff4132951201f4df3d1653aec61", + "artifact_type": null, + "last_modified": null, + "preconditions": [ + "HTTP control plane запущен.", + "`ControlActionSet` сконфигурирован в `TelegramControlChannel`.", + "В path передано одно из поддерживаемых действий: `start`, `stop`, `status`." + ], + "workflow_name": "Scenario", + "error_handling": [ + "1. Если actions не сконфигурированы, API возвращает `404`.", + "2. Если передано неподдерживаемое действие, API возвращает `404`.", + "3. Если callback завершился исключением, API возвращает `500`." + ], + "postconditions": [ + "Клиент получает результат выполнения control action или признак, что операция еще продолжается." + ], + "staleness_score": null, + "alternative_flow": [ + "1. Если `start` или `stop` не успевают завершиться в timeout, API возвращает `202 accepted` и сообщает, что операция еще выполняется." + ], + "system_component": null + } + } + ], + "relations": [], + "chunks": [ + { + "layer": "D0_DOC_CHUNKS", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "api.control_actions_endpoint:Описание", + "content": "Метод предоставляет HTTP-доступ к control actions runtime и позволяет запускать, останавливать или проверять состояние управляемых компонентов. Endpoint не реализует lifecycle самостоятельно, а делегирует выполнение в `ControlActionSet`.", + "metadata": { + "tags": [ + "api", + "control-plane", + "lifecycle" + ], + "type": "api_method", + "order": 3, + "owner": null, + "doc_id": null, + "module": "telegram_notify_app", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "doc_kind": "misc", + "doc_version": null, + "document_id": "api.control_actions_endpoint", + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "section_path": "Details > Описание", + "artifact_type": null, + "last_modified": null, + "section_title": "Описание", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D0_DOC_CHUNKS", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "api.control_actions_endpoint:Сценарий", + "content": "**Название:** Выполнение control action runtime\n\n**Предусловия:**\n- HTTP control plane запущен.\n- `ControlActionSet` сконфигурирован в `TelegramControlChannel`.\n- В path передано одно из поддерживаемых действий: `start`, `stop`, `status`.\n\n**Триггер:**\n- Клиент отправляет `GET` или `POST` на `/actions/{action}`.\n\n**Основной сценарий:**\n1. Endpoint принимает запрос и извлекает path parameter `action`.\n2. API определяет источник клиента через `X-Client-Source` или `User-Agent`.\n3. Для `start` и `stop` запрос логируется как control action.\n4. Канал сопоставляет `action` с callback из `ControlActionSet`.\n5. API ожидает завершения callback в пределах допустимого timeout.\n6. При успешном завершении API возвращает JSON со статусом `ok`.\n\n**Альтернативный сценарий:**\n1. Если `start` или `stop` не успевают завершиться в timeout, API возвращает `202 accepted` и сообщает, что операция еще выполняется.\n\n**Обработка ошибок:**\n1. Если actions не сконфигурированы, API возвращает `404`.\n2. Если передано неподдерживаемое действие, API возвращает `404`.\n3. Если callback завершился исключением, API возвращает `500`.\n\n**Постусловие:**\n- Клиент получает результат выполнения control action или признак, что операция еще продолжается.", + "metadata": { + "tags": [ + "api", + "control-plane", + "lifecycle" + ], + "type": "api_method", + "order": 4, + "owner": null, + "doc_id": null, + "module": "telegram_notify_app", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "doc_kind": "misc", + "doc_version": null, + "document_id": "api.control_actions_endpoint", + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "section_path": "Details > Сценарий", + "artifact_type": null, + "last_modified": null, + "section_title": "Сценарий", + "staleness_score": null, + "system_component": null + } + } + ] +} +``` + +### User Prompt Overview +- question: Опиши endpoint health +- intent: DOCUMENTATION_EXPLAIN +- sub_intent: API_METHOD_EXPLAIN +- documents: 1 | samples: HTTP API /send +- facts: 2 | samples: api.control_actions_endpoint:workflow_step, api.control_actions_endpoint:mentions_entity +- relations: 0 + +## Mismatches +- none \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/docs_router_llm_disambiguation/20260326_150139/full_chain_docs_intents_v3-3x_v3-api-send-1.json b/tests/pipeline_setup_v3/test_results/docs_router_llm_disambiguation/20260326_150139/full_chain_docs_intents_v3-3x_v3-api-send-1.json new file mode 100644 index 0000000..e96ca9f --- /dev/null +++ b/tests/pipeline_setup_v3/test_results/docs_router_llm_disambiguation/20260326_150139/full_chain_docs_intents_v3-3x_v3-api-send-1.json @@ -0,0 +1,83 @@ +{ + "meta": { + "case_id": "v3-api-send-1", + "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_03_docs/full_chain_docs_intents_v3-3x.yaml", + "runner": "agent_runtime", + "mode": "pre_llm", + "passed": true, + "mismatches": [], + "actual": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "API_METHOD_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START", + "rag_count": 8, + "llm_answer": "", + "answer_mode": "answered", + "path_scope": [], + "doc_scope": [ + "api.send_message_endpoint" + ], + "entity_candidates": [], + "symbol_candidates": [], + "layers": [ + "D2_FACT_INDEX", + "D4_WORKFLOW_INDEX", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "filters": { + "doc_type": "api_method" + }, + "pipeline_mode": "pre_llm_only", + "gate_decision": "allow", + "prompt_used": "docs_explain_answer", + "llm_mode": "prose", + "degraded_reason": null, + "code_intents_stubbed": true + } + }, + "pipeline_steps": [ + { + "step": "input_query", + "input": { + "query": "Что делает /send?" + }, + "output": { + "query": "Что делает /send?" + } + }, + { + "step": "router", + "input": { + "query": "Что делает /send?" + }, + "output": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "API_METHOD_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START" + } + }, + { + "step": "docs_pipeline", + "input": { + "query": "Что делает /send?" + }, + "output": { + "answer_mode": "ready", + "prompt_name": "docs_explain_answer", + "llm_request": { + "prompt_name": "docs_explain_answer", + "log_context": "graph.project_qa.docs.answer", + "prompt_stats": { + "system_chars": 393, + "user_chars": 10326, + "tokens_in_estimate": 2680 + } + }, + "degraded_reason": "" + } + } + ] +} \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/docs_router_llm_disambiguation/20260326_150139/full_chain_docs_intents_v3-3x_v3-api-send-1.md b/tests/pipeline_setup_v3/test_results/docs_router_llm_disambiguation/20260326_150139/full_chain_docs_intents_v3-3x_v3-api-send-1.md new file mode 100644 index 0000000..9761e6b --- /dev/null +++ b/tests/pipeline_setup_v3/test_results/docs_router_llm_disambiguation/20260326_150139/full_chain_docs_intents_v3-3x_v3-api-send-1.md @@ -0,0 +1,602 @@ +# v3-api-send-1 + +- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_03_docs/full_chain_docs_intents_v3-3x.yaml +- runner: agent_runtime +- mode: pre_llm +- passed: True + +## Query +Что делает /send? + +## Actual +{ + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "API_METHOD_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START", + "rag_count": 8, + "llm_answer": "", + "answer_mode": "answered", + "path_scope": [], + "doc_scope": [ + "api.send_message_endpoint" + ], + "entity_candidates": [], + "symbol_candidates": [], + "layers": [ + "D2_FACT_INDEX", + "D4_WORKFLOW_INDEX", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "filters": { + "doc_type": "api_method" + }, + "pipeline_mode": "pre_llm_only", + "gate_decision": "allow", + "prompt_used": "docs_explain_answer", + "llm_mode": "prose", + "degraded_reason": null, + "code_intents_stubbed": true +} + +## Pipeline Steps +### input_query +```json +{ + "input": { + "query": "Что делает /send?" + }, + "output": { + "query": "Что делает /send?" + } +} +``` + +### router +```json +{ + "input": { + "query": "Что делает /send?" + }, + "output": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "API_METHOD_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START" + } +} +``` + +### docs_pipeline +```json +{ + "input": { + "query": "Что делает /send?" + }, + "output": { + "answer_mode": "ready", + "prompt_name": "docs_explain_answer", + "llm_request": { + "prompt_name": "docs_explain_answer", + "log_context": "graph.project_qa.docs.answer", + "prompt_stats": { + "system_chars": 393, + "user_chars": 10326, + "tokens_in_estimate": 2680 + } + }, + "degraded_reason": "" + } +} +``` + +## Diagnostics +{ + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "API_METHOD_EXPLAIN", + "layers_used": [ + "D2_FACT_INDEX", + "D4_WORKFLOW_INDEX", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "documents_found": 1, + "facts_found": 2, + "relations_found": 0, + "openapi_fields_extracted": 0, + "missing_required_fields": [], + "openapi_status": { + "has_path": false, + "has_method": false, + "has_request": false, + "has_response": false + }, + "prompt_used": "docs_explain_answer", + "llm_mode": "prose", + "output_valid": true, + "matched_intent_source": "deterministic", + "matched_anchor_type": "endpoint", + "matched_anchor_value": "/send", + "exact_anchor_match": true, + "docs_layers_requested": [ + "D2_FACT_INDEX", + "D4_WORKFLOW_INDEX", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "docs_layers_with_hits": [ + "D2_FACT_INDEX", + "D4_WORKFLOW_INDEX", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "planned_layers": [ + "D2_FACT_INDEX", + "D4_WORKFLOW_INDEX", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "executed_layers": [ + "D2_FACT_INDEX", + "D4_WORKFLOW_INDEX", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "non_empty_layers": [ + "D2_FACT_INDEX", + "D4_WORKFLOW_INDEX", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "layer_diagnostics": { + "D2_FACT_INDEX": { + "hits": 8, + "top_ids": [ + "6bf0a662808009874a108d0c97f7cca7fc4ff7a3a3d66e0947b31bf813cfdf4d", + "dc979c31d511a14d3af89f5f5c493fcfc0c9f2090dc16fb20ff874f4b3566221", + "149c4e0d3d34b3faba055b1495d54818fadc882af633da70035b82190c1bd327", + "480d85819e9298d4078f8a3bd6cfccb9c0fe2a03695b87f65f82f9aa8e2097b0", + "7aefee9ff6110088aad1891da66fc9085eb3f77d832605a3da565deecb96e850" + ], + "top_sections": [ + "api.send_message_endpoint:workflow_step", + "api.send_message_endpoint:mentions_entity" + ] + }, + "D4_WORKFLOW_INDEX": { + "hits": 3, + "top_ids": [ + "api.send_message_endpoint", + "api.control_actions_endpoint", + "api.health_endpoint" + ], + "top_sections": [ + "Scenario" + ] + }, + "D1_DOCUMENT_CATALOG": { + "hits": 4, + "top_ids": [ + "api.send_message_endpoint", + "architecture.telegram_notify_app", + "api.control_actions_endpoint", + "api.health_endpoint" + ], + "top_sections": [ + "HTTP API /send", + "Архитектура Telegram Notify App", + "HTTP API /actions/{action}", + "HTTP API /health" + ] + }, + "D0_DOC_CHUNKS": { + "hits": 4, + "top_ids": [ + "api.send_message_endpoint" + ], + "top_sections": [ + "api.send_message_endpoint:Описание", + "api.send_message_endpoint:Сценарий", + "api.send_message_endpoint:Summary", + "api.send_message_endpoint:Функциональные требования" + ] + } + }, + "query_entity_candidates": [], + "resolved_entity_candidates": [], + "query_anchor_candidates": [ + "/send" + ], + "resolved_anchor_candidates": [ + "api.send_message_endpoint", + "docs/documentation/api/send-message-endpoint.md" + ], + "anchor_candidates": [], + "selected_anchor": null, + "anchor_selection_reason": "", + "anchor_match_type": "", + "doc_ids": [ + "api.send_message_endpoint" + ], + "doc_paths": [ + "docs/documentation/api/send-message-endpoint.md" + ], + "doc_titles": [ + "Scenario", + "HTTP API /send", + "api.send_message_endpoint:Сценарий", + "api.send_message_endpoint:workflow_step", + "api.send_message_endpoint:mentions_entity", + "api.send_message_endpoint:Описание", + "api.send_message_endpoint:Summary", + "api.send_message_endpoint:Функциональные требования" + ], + "relation_hits_count": 0, + "relation_targets": [], + "selected_doc_ids": [ + "api.send_message_endpoint" + ], + "selected_fact_ids": [ + "6bf0a662808009874a108d0c97f7cca7fc4ff7a3a3d66e0947b31bf813cfdf4d", + "149c4e0d3d34b3faba055b1495d54818fadc882af633da70035b82190c1bd327" + ], + "selected_relation_ids": [], + "selected_chunk_ids": [ + "api.send_message_endpoint" + ], + "selected_entity_ids": [], + "selected_workflow_ids": [ + "1ce912e07e5105b30244d71c832f25a8292e725bf5a043dbf29ab479fcbf7a00" + ], + "fallback_doc_hits_count": 3, + "fallback_used": false, + "fact_hits": 2, + "entity_hits": 0, + "evidence_summary": { + "documents": 1, + "facts": 2, + "entities": 0, + "workflows": 1, + "relations": 0, + "chunks": 2, + "selected_doc_ids": [ + "api.send_message_endpoint" + ], + "selected_fact_ids": [ + "6bf0a662808009874a108d0c97f7cca7fc4ff7a3a3d66e0947b31bf813cfdf4d", + "149c4e0d3d34b3faba055b1495d54818fadc882af633da70035b82190c1bd327" + ], + "selected_relation_ids": [], + "selected_chunk_ids": [ + "api.send_message_endpoint" + ], + "entity_hits": 0, + "openapi_signals": { + "path_found": false, + "method_found": false, + "operation_semantics_found": false, + "request_payload_found": false, + "request_schema": false, + "request_fields_found": false, + "response_payload_found": false, + "response_schema": false, + "response_fields_found": false, + "status_codes": false, + "content_type_found": false, + "examples_found": false, + "payload_description": false + } + }, + "gate_decision": "allow", + "gate_decision_reason": "evidence_sufficient", + "gate_missing_requirements": [], + "gate_satisfied_requirements": [ + "retrieval_non_empty", + "exact_anchor_match" + ], + "openapi_evidence": { + "path_found": false, + "method_found": false, + "operation_semantics_found": false, + "request_payload_found": false, + "request_schema": false, + "request_fields_found": false, + "response_payload_found": false, + "response_schema": false, + "response_fields_found": false, + "status_codes": false, + "content_type_found": false, + "examples_found": false, + "payload_description": false + }, + "requested_fragment_type": null, + "fragment_evidence_found": [], + "fragment_missing_requirements": [], + "answer_mode": "ready", + "degrade_reason": null, + "degraded_reason": null, + "code_intents_stubbed": false +} + +## LLM Request +- prompt_name: docs_explain_answer +- log_context: graph.project_qa.docs.answer + +### Prompt Stats +```json +{ + "system_chars": 393, + "user_chars": 10326, + "tokens_in_estimate": 2680 +} +``` + +### System Prompt +```text +Ты объясняешь документацию системы. + +На вход приходит JSON с полями: +- question +- intent +- sub_intent +- documents +- facts +- relations + +Правила: +- Используй только предоставленные факты +- Не додумывай +- Если данных недостаточно, скажи это явно +- Объясняй структурировано + +Формат ответа: +1. Краткое описание +2. Основные элементы +3. Как это работает +4. Связи с другими частями системы (если есть) +``` + +### User Prompt +```json +{ + "question": "Что делает /send?", + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "API_METHOD_EXPLAIN", + "documents": [ + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/api/send-message-endpoint.md", + "title": "HTTP API /send", + "content": "Endpoint `/send` выполняет ручную отправку сообщения в Telegram через `TelegramSendService`. Он используется для операторской проверки доставки и для отправки уведомлений вне периодического worker loop. Endpoint работает поверх тех же credentials и того же delivery path, что и фоновая отправка.", + "metadata": { + "name": "send_message_endpoint", + "tags": [ + "api", + "telegram", + "manual-send" + ], + "type": "api_method", + "layer": "application", + "links": [ + { + "type": "part_of", + "target": "architecture.telegram_notify_app" + }, + { + "type": "depends_on", + "target": "logic.telegram_notification_loop" + } + ], + "owner": null, + "title": "HTTP API /send", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "architecture.telegram_notify_app", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "5fbf2e33510b0676a3a53b957a4569bd3c2c31fb7719546602c573421ccaa32d", + "children": [], + "doc_kind": "misc", + "entities": [ + "TelegramControlAppFactory", + "TelegramSendService", + "TelegramNotifyWorker" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "api.send_message_endpoint", + "source_path": "docs/documentation/api/send-message-endpoint.md", + "summary_text": "Endpoint `/send` выполняет ручную отправку сообщения в Telegram через `TelegramSendService`. Он используется для операторской проверки доставки и для отправки уведомлений вне периодического worker loop. Endpoint работает поверх тех же credentials и того же delivery path, что и фоновая отправка.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + } + ], + "facts": [ + { + "layer": "D2_FACT_INDEX", + "path": "docs/documentation/api/send-message-endpoint.md", + "title": "api.send_message_endpoint:workflow_step", + "content": "api.send_message_endpoint workflow_step Telegram credentials доступны в переменных окружения.", + "metadata": { + "tags": [], + "owner": null, + "anchor": "Сценарий", + "doc_id": null, + "object": "Telegram credentials доступны в переменных окружения.", + "fact_id": "6bf0a662808009874a108d0c97f7cca7fc4ff7a3a3d66e0947b31bf813cfdf4d", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "5fbf2e33510b0676a3a53b957a4569bd3c2c31fb7719546602c573421ccaa32d", + "predicate": "workflow_step", + "object_ref": null, + "subject_id": "api.send_message_endpoint", + "doc_version": null, + "source_path": "docs/documentation/api/send-message-endpoint.md", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D2_FACT_INDEX", + "path": "docs/documentation/api/send-message-endpoint.md", + "title": "api.send_message_endpoint:mentions_entity", + "content": "api.send_message_endpoint mentions_entity TelegramNotifyWorker", + "metadata": { + "tags": [], + "owner": null, + "anchor": "frontmatter.entities", + "doc_id": null, + "object": "TelegramNotifyWorker", + "fact_id": "149c4e0d3d34b3faba055b1495d54818fadc882af633da70035b82190c1bd327", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "5fbf2e33510b0676a3a53b957a4569bd3c2c31fb7719546602c573421ccaa32d", + "predicate": "mentions_entity", + "object_ref": null, + "subject_id": "api.send_message_endpoint", + "doc_version": null, + "source_path": "docs/documentation/api/send-message-endpoint.md", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + } + ], + "entities": [], + "workflows": [ + { + "layer": "D4_WORKFLOW_INDEX", + "path": "docs/documentation/api/send-message-endpoint.md", + "title": "Scenario", + "content": "Scenario\nHTTP control plane запущен.\nTelegram credentials доступны в переменных окружения.\nКлиент передает непустой параметр `message`.\nКлиент отправляет `GET /send?message=...`.\n1. Endpoint принимает HTTP-запрос `GET /send`.\n2. API извлекает query parameter `message`.\n3. API проверяет, что сообщение не пустое.\n4. Endpoint вызывает `TelegramSendService.send(message)`.\n5. Сервис получает Telegram credentials из окружения.\n6. Сервис вызывает Telegram Bot API для отправки сообщения.\n7. API возвращает клиенту успешный JSON-ответ.\n1. Если credentials отсутствуют, сервис завершает вызов пользовательской ошибкой.", + "metadata": { + "owner": null, + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "trigger": [ + "Клиент отправляет `GET /send?message=...`." + ], + "blob_sha": "5fbf2e33510b0676a3a53b957a4569bd3c2c31fb7719546602c573421ccaa32d", + "main_flow": [ + "1. Endpoint принимает HTTP-запрос `GET /send`.", + "2. API извлекает query parameter `message`.", + "3. API проверяет, что сообщение не пустое.", + "4. Endpoint вызывает `TelegramSendService.send(message)`.", + "5. Сервис получает Telegram credentials из окружения.", + "6. Сервис вызывает Telegram Bot API для отправки сообщения.", + "7. API возвращает клиенту успешный JSON-ответ." + ], + "doc_version": null, + "document_id": "api.send_message_endpoint", + "source_path": "docs/documentation/api/send-message-endpoint.md", + "workflow_id": "1ce912e07e5105b30244d71c832f25a8292e725bf5a043dbf29ab479fcbf7a00", + "artifact_type": null, + "last_modified": null, + "preconditions": [ + "HTTP control plane запущен.", + "Telegram credentials доступны в переменных окружения.", + "Клиент передает непустой параметр `message`." + ], + "workflow_name": "Scenario", + "error_handling": [ + "1. Если `message` пустой или credentials не заданы, API возвращает `400`.", + "2. Если отправка завершилась непредвиденной ошибкой, API возвращает `500`." + ], + "postconditions": [ + "Сообщение либо отправлено в Telegram, либо клиент получил диагностическую ошибку." + ], + "staleness_score": null, + "alternative_flow": [ + "1. Если credentials отсутствуют, сервис завершает вызов пользовательской ошибкой." + ], + "system_component": null + } + } + ], + "relations": [], + "chunks": [ + { + "layer": "D0_DOC_CHUNKS", + "path": "docs/documentation/api/send-message-endpoint.md", + "title": "api.send_message_endpoint:Сценарий", + "content": "**Название:** Ручная отправка сообщения в Telegram\n\n**Предусловия:**\n- HTTP control plane запущен.\n- Telegram credentials доступны в переменных окружения.\n- Клиент передает непустой параметр `message`.\n\n**Триггер:**\n- Клиент отправляет `GET /send?message=...`.\n\n**Основной сценарий:**\n1. Endpoint принимает HTTP-запрос `GET /send`.\n2. API извлекает query parameter `message`.\n3. API проверяет, что сообщение не пустое.\n4. Endpoint вызывает `TelegramSendService.send(message)`.\n5. Сервис получает Telegram credentials из окружения.\n6. Сервис вызывает Telegram Bot API для отправки сообщения.\n7. API возвращает клиенту успешный JSON-ответ.\n\n**Альтернативный сценарий:**\n1. Если credentials отсутствуют, сервис завершает вызов пользовательской ошибкой.\n\n**Обработка ошибок:**\n1. Если `message` пустой или credentials не заданы, API возвращает `400`.\n2. Если отправка завершилась непредвиденной ошибкой, API возвращает `500`.\n\n**Постусловие:**\n- Сообщение либо отправлено в Telegram, либо клиент получил диагностическую ошибку.", + "metadata": { + "tags": [ + "api", + "telegram", + "manual-send" + ], + "type": "api_method", + "order": 4, + "owner": null, + "doc_id": null, + "module": "telegram_notify_app", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "5fbf2e33510b0676a3a53b957a4569bd3c2c31fb7719546602c573421ccaa32d", + "doc_kind": "misc", + "doc_version": null, + "document_id": "api.send_message_endpoint", + "source_path": "docs/documentation/api/send-message-endpoint.md", + "section_path": "Details > Сценарий", + "artifact_type": null, + "last_modified": null, + "section_title": "Сценарий", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D0_DOC_CHUNKS", + "path": "docs/documentation/api/send-message-endpoint.md", + "title": "api.send_message_endpoint:Описание", + "content": "Метод принимает текст сообщения и инициирует разовую отправку в Telegram без ожидания планового интервала worker'а. Endpoint нужен для ручной диагностики канала доставки и для ad-hoc уведомлений.", + "metadata": { + "tags": [ + "api", + "telegram", + "manual-send" + ], + "type": "api_method", + "order": 3, + "owner": null, + "doc_id": null, + "module": "telegram_notify_app", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "5fbf2e33510b0676a3a53b957a4569bd3c2c31fb7719546602c573421ccaa32d", + "doc_kind": "misc", + "doc_version": null, + "document_id": "api.send_message_endpoint", + "source_path": "docs/documentation/api/send-message-endpoint.md", + "section_path": "Details > Описание", + "artifact_type": null, + "last_modified": null, + "section_title": "Описание", + "staleness_score": null, + "system_component": null + } + } + ] +} +``` + +### User Prompt Overview +- question: Что делает /send? +- intent: DOCUMENTATION_EXPLAIN +- sub_intent: API_METHOD_EXPLAIN +- documents: 1 | samples: HTTP API /send +- facts: 2 | samples: api.send_message_endpoint:workflow_step, api.send_message_endpoint:mentions_entity +- relations: 0 + +## Mismatches +- none \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/docs_router_llm_disambiguation/20260326_150139/full_chain_docs_intents_v3-3x_v3-api-send-2.json b/tests/pipeline_setup_v3/test_results/docs_router_llm_disambiguation/20260326_150139/full_chain_docs_intents_v3-3x_v3-api-send-2.json new file mode 100644 index 0000000..95dfc3c --- /dev/null +++ b/tests/pipeline_setup_v3/test_results/docs_router_llm_disambiguation/20260326_150139/full_chain_docs_intents_v3-3x_v3-api-send-2.json @@ -0,0 +1,88 @@ +{ + "meta": { + "case_id": "v3-api-send-2", + "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_03_docs/full_chain_docs_intents_v3-3x.yaml", + "runner": "agent_runtime", + "mode": "pre_llm", + "passed": true, + "mismatches": [], + "actual": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "API_METHOD_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START", + "rag_count": 13, + "llm_answer": "", + "answer_mode": "answered", + "path_scope": [], + "doc_scope": [ + "api.control_actions_endpoint", + "api.health_endpoint", + "api.send_message_endpoint", + "api.actions_endpoint", + "architecture.telegram_notify_app", + "architecture.telegram_notify_app_overview" + ], + "entity_candidates": [], + "symbol_candidates": [], + "layers": [ + "D2_FACT_INDEX", + "D4_WORKFLOW_INDEX", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "filters": { + "doc_type": "api_method" + }, + "pipeline_mode": "pre_llm_only", + "gate_decision": "allow", + "prompt_used": "docs_explain_answer", + "llm_mode": "prose", + "degraded_reason": null, + "code_intents_stubbed": true + } + }, + "pipeline_steps": [ + { + "step": "input_query", + "input": { + "query": "Как работает send endpoint?" + }, + "output": { + "query": "Как работает send endpoint?" + } + }, + { + "step": "router", + "input": { + "query": "Как работает send endpoint?" + }, + "output": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "API_METHOD_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START" + } + }, + { + "step": "docs_pipeline", + "input": { + "query": "Как работает send endpoint?" + }, + "output": { + "answer_mode": "ready", + "prompt_name": "docs_explain_answer", + "llm_request": { + "prompt_name": "docs_explain_answer", + "log_context": "graph.project_qa.docs.answer", + "prompt_stats": { + "system_chars": 393, + "user_chars": 10996, + "tokens_in_estimate": 2848 + } + }, + "degraded_reason": "" + } + } + ] +} \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/docs_router_llm_disambiguation/20260326_150139/full_chain_docs_intents_v3-3x_v3-api-send-2.md b/tests/pipeline_setup_v3/test_results/docs_router_llm_disambiguation/20260326_150139/full_chain_docs_intents_v3-3x_v3-api-send-2.md new file mode 100644 index 0000000..0be8139 --- /dev/null +++ b/tests/pipeline_setup_v3/test_results/docs_router_llm_disambiguation/20260326_150139/full_chain_docs_intents_v3-3x_v3-api-send-2.md @@ -0,0 +1,623 @@ +# v3-api-send-2 + +- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_03_docs/full_chain_docs_intents_v3-3x.yaml +- runner: agent_runtime +- mode: pre_llm +- passed: True + +## Query +Как работает send endpoint? + +## Actual +{ + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "API_METHOD_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START", + "rag_count": 13, + "llm_answer": "", + "answer_mode": "answered", + "path_scope": [], + "doc_scope": [ + "api.control_actions_endpoint", + "api.health_endpoint", + "api.send_message_endpoint", + "api.actions_endpoint", + "architecture.telegram_notify_app", + "architecture.telegram_notify_app_overview" + ], + "entity_candidates": [], + "symbol_candidates": [], + "layers": [ + "D2_FACT_INDEX", + "D4_WORKFLOW_INDEX", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "filters": { + "doc_type": "api_method" + }, + "pipeline_mode": "pre_llm_only", + "gate_decision": "allow", + "prompt_used": "docs_explain_answer", + "llm_mode": "prose", + "degraded_reason": null, + "code_intents_stubbed": true +} + +## Pipeline Steps +### input_query +```json +{ + "input": { + "query": "Как работает send endpoint?" + }, + "output": { + "query": "Как работает send endpoint?" + } +} +``` + +### router +```json +{ + "input": { + "query": "Как работает send endpoint?" + }, + "output": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "API_METHOD_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START" + } +} +``` + +### docs_pipeline +```json +{ + "input": { + "query": "Как работает send endpoint?" + }, + "output": { + "answer_mode": "ready", + "prompt_name": "docs_explain_answer", + "llm_request": { + "prompt_name": "docs_explain_answer", + "log_context": "graph.project_qa.docs.answer", + "prompt_stats": { + "system_chars": 393, + "user_chars": 10996, + "tokens_in_estimate": 2848 + } + }, + "degraded_reason": "" + } +} +``` + +## Diagnostics +{ + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "API_METHOD_EXPLAIN", + "layers_used": [ + "D2_FACT_INDEX", + "D4_WORKFLOW_INDEX", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "documents_found": 1, + "facts_found": 2, + "relations_found": 0, + "openapi_fields_extracted": 0, + "missing_required_fields": [], + "openapi_status": { + "has_path": false, + "has_method": false, + "has_request": false, + "has_response": false + }, + "prompt_used": "docs_explain_answer", + "llm_mode": "prose", + "output_valid": true, + "matched_intent_source": "llm", + "matched_anchor_type": "topic", + "matched_anchor_value": null, + "exact_anchor_match": false, + "docs_layers_requested": [ + "D2_FACT_INDEX", + "D4_WORKFLOW_INDEX", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "docs_layers_with_hits": [ + "D2_FACT_INDEX", + "D4_WORKFLOW_INDEX", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "planned_layers": [ + "D2_FACT_INDEX", + "D4_WORKFLOW_INDEX", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "executed_layers": [ + "D2_FACT_INDEX", + "D4_WORKFLOW_INDEX", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "non_empty_layers": [ + "D2_FACT_INDEX", + "D4_WORKFLOW_INDEX", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "layer_diagnostics": { + "D2_FACT_INDEX": { + "hits": 8, + "top_ids": [ + "f85d982c272a2ee6baeadc433221a20e684cd8ef01cb4788d6f76d05ca56d6d0", + "b8e44c3adb74aaa6c91ae8815fa091289e58dd3990a3a1b63e850c62075aea75", + "bafb867ffed41c9db637df98d6cd5f6722d7747bbebc6c03e6f0d0caf3b7f9f3", + "54bbcbac242f1c85ec3280236ed5841998a8a3a548ff16cbf0b5acafbff469e3", + "b6bfad59b3bf00f199b5ef90c1208af19664de700413e7354468a93a4abaaa2f" + ], + "top_sections": [ + "api.control_actions_endpoint:workflow_step", + "api.control_actions_endpoint:mentions_entity" + ] + }, + "D4_WORKFLOW_INDEX": { + "hits": 3, + "top_ids": [ + "api.control_actions_endpoint", + "api.health_endpoint", + "api.send_message_endpoint" + ], + "top_sections": [ + "Scenario" + ] + }, + "D1_DOCUMENT_CATALOG": { + "hits": 4, + "top_ids": [ + "api.send_message_endpoint", + "api.control_actions_endpoint", + "api.health_endpoint", + "architecture.telegram_notify_app" + ], + "top_sections": [ + "HTTP API /send", + "HTTP API /actions/{action}", + "HTTP API /health", + "Архитектура Telegram Notify App" + ] + }, + "D0_DOC_CHUNKS": { + "hits": 4, + "top_ids": [ + "api.control_actions_endpoint" + ], + "top_sections": [ + "api.control_actions_endpoint:Описание", + "api.control_actions_endpoint:Сценарий", + "api.control_actions_endpoint:Summary", + "api.control_actions_endpoint:Функциональные требования" + ] + } + }, + "query_entity_candidates": [], + "resolved_entity_candidates": [], + "query_anchor_candidates": [], + "resolved_anchor_candidates": [ + "docs/documentation/api/control-actions-endpoint.md", + "api.control_actions_endpoint", + "api.health_endpoint", + "docs/documentation/api/health-endpoint.md", + "api.send_message_endpoint", + "docs/documentation/api/send-message-endpoint.md", + "architecture.telegram_notify_app", + "docs/documentation/architecture/telegram-notify-app-overview.md" + ], + "anchor_candidates": [], + "selected_anchor": null, + "anchor_selection_reason": "", + "anchor_match_type": "", + "doc_ids": [ + "api.control_actions_endpoint", + "api.health_endpoint", + "api.send_message_endpoint", + "api.actions_endpoint", + "architecture.telegram_notify_app", + "architecture.telegram_notify_app_overview" + ], + "doc_paths": [ + "docs/documentation/api/control-actions-endpoint.md", + "docs/documentation/api/health-endpoint.md", + "docs/documentation/api/send-message-endpoint.md", + "docs/documentation/architecture/telegram-notify-app-overview.md" + ], + "doc_titles": [ + "api.control_actions_endpoint:workflow_step", + "api.control_actions_endpoint:mentions_entity", + "Scenario", + "HTTP API /send", + "HTTP API /actions/{action}", + "HTTP API /health", + "Архитектура Telegram Notify App", + "api.control_actions_endpoint:Описание", + "api.control_actions_endpoint:Сценарий", + "api.control_actions_endpoint:Summary", + "api.control_actions_endpoint:Функциональные требования" + ], + "relation_hits_count": 0, + "relation_targets": [], + "selected_doc_ids": [ + "api.send_message_endpoint", + "api.control_actions_endpoint" + ], + "selected_fact_ids": [ + "f85d982c272a2ee6baeadc433221a20e684cd8ef01cb4788d6f76d05ca56d6d0", + "bafb867ffed41c9db637df98d6cd5f6722d7747bbebc6c03e6f0d0caf3b7f9f3" + ], + "selected_relation_ids": [], + "selected_chunk_ids": [ + "api.control_actions_endpoint" + ], + "selected_entity_ids": [], + "selected_workflow_ids": [ + "f78b822d4366b10322fd4a35e347deae59d55ff4132951201f4df3d1653aec61" + ], + "fallback_doc_hits_count": 3, + "fallback_used": false, + "fact_hits": 2, + "entity_hits": 0, + "evidence_summary": { + "documents": 1, + "facts": 2, + "entities": 0, + "workflows": 1, + "relations": 0, + "chunks": 2, + "selected_doc_ids": [ + "api.send_message_endpoint", + "api.control_actions_endpoint" + ], + "selected_fact_ids": [ + "f85d982c272a2ee6baeadc433221a20e684cd8ef01cb4788d6f76d05ca56d6d0", + "bafb867ffed41c9db637df98d6cd5f6722d7747bbebc6c03e6f0d0caf3b7f9f3" + ], + "selected_relation_ids": [], + "selected_chunk_ids": [ + "api.control_actions_endpoint" + ], + "entity_hits": 0, + "openapi_signals": { + "path_found": false, + "method_found": false, + "operation_semantics_found": false, + "request_payload_found": false, + "request_schema": false, + "request_fields_found": false, + "response_payload_found": false, + "response_schema": false, + "response_fields_found": false, + "status_codes": false, + "content_type_found": false, + "examples_found": false, + "payload_description": false + } + }, + "gate_decision": "allow", + "gate_decision_reason": "evidence_sufficient", + "gate_missing_requirements": [], + "gate_satisfied_requirements": [ + "retrieval_non_empty" + ], + "openapi_evidence": { + "path_found": false, + "method_found": false, + "operation_semantics_found": false, + "request_payload_found": false, + "request_schema": false, + "request_fields_found": false, + "response_payload_found": false, + "response_schema": false, + "response_fields_found": false, + "status_codes": false, + "content_type_found": false, + "examples_found": false, + "payload_description": false + }, + "requested_fragment_type": null, + "fragment_evidence_found": [], + "fragment_missing_requirements": [], + "answer_mode": "ready", + "degrade_reason": null, + "degraded_reason": null, + "code_intents_stubbed": false +} + +## LLM Request +- prompt_name: docs_explain_answer +- log_context: graph.project_qa.docs.answer + +### Prompt Stats +```json +{ + "system_chars": 393, + "user_chars": 10996, + "tokens_in_estimate": 2848 +} +``` + +### System Prompt +```text +Ты объясняешь документацию системы. + +На вход приходит JSON с полями: +- question +- intent +- sub_intent +- documents +- facts +- relations + +Правила: +- Используй только предоставленные факты +- Не додумывай +- Если данных недостаточно, скажи это явно +- Объясняй структурировано + +Формат ответа: +1. Краткое описание +2. Основные элементы +3. Как это работает +4. Связи с другими частями системы (если есть) +``` + +### User Prompt +```json +{ + "question": "Как работает send endpoint?", + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "API_METHOD_EXPLAIN", + "documents": [ + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/api/send-message-endpoint.md", + "title": "HTTP API /send", + "content": "Endpoint `/send` выполняет ручную отправку сообщения в Telegram через `TelegramSendService`. Он используется для операторской проверки доставки и для отправки уведомлений вне периодического worker loop. Endpoint работает поверх тех же credentials и того же delivery path, что и фоновая отправка.", + "metadata": { + "name": "send_message_endpoint", + "tags": [ + "api", + "telegram", + "manual-send" + ], + "type": "api_method", + "layer": "application", + "links": [ + { + "type": "part_of", + "target": "architecture.telegram_notify_app" + }, + { + "type": "depends_on", + "target": "logic.telegram_notification_loop" + } + ], + "owner": null, + "title": "HTTP API /send", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "architecture.telegram_notify_app", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "5fbf2e33510b0676a3a53b957a4569bd3c2c31fb7719546602c573421ccaa32d", + "children": [], + "doc_kind": "misc", + "entities": [ + "TelegramControlAppFactory", + "TelegramSendService", + "TelegramNotifyWorker" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "api.send_message_endpoint", + "source_path": "docs/documentation/api/send-message-endpoint.md", + "summary_text": "Endpoint `/send` выполняет ручную отправку сообщения в Telegram через `TelegramSendService`. Он используется для операторской проверки доставки и для отправки уведомлений вне периодического worker loop. Endpoint работает поверх тех же credentials и того же delivery path, что и фоновая отправка.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + } + ], + "facts": [ + { + "layer": "D2_FACT_INDEX", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "api.control_actions_endpoint:workflow_step", + "content": "api.control_actions_endpoint workflow_step Название:** Выполнение control action runtime", + "metadata": { + "tags": [], + "owner": null, + "anchor": "Сценарий", + "doc_id": null, + "object": "Название:** Выполнение control action runtime", + "fact_id": "f85d982c272a2ee6baeadc433221a20e684cd8ef01cb4788d6f76d05ca56d6d0", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "predicate": "workflow_step", + "object_ref": null, + "subject_id": "api.control_actions_endpoint", + "doc_version": null, + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D2_FACT_INDEX", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "api.control_actions_endpoint:mentions_entity", + "content": "api.control_actions_endpoint mentions_entity ControlActionSet", + "metadata": { + "tags": [], + "owner": null, + "anchor": "frontmatter.entities", + "doc_id": null, + "object": "ControlActionSet", + "fact_id": "bafb867ffed41c9db637df98d6cd5f6722d7747bbebc6c03e6f0d0caf3b7f9f3", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "predicate": "mentions_entity", + "object_ref": null, + "subject_id": "api.control_actions_endpoint", + "doc_version": null, + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + } + ], + "entities": [], + "workflows": [ + { + "layer": "D4_WORKFLOW_INDEX", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "Scenario", + "content": "Scenario\nHTTP control plane запущен.\n`ControlActionSet` сконфигурирован в `TelegramControlChannel`.\nВ path передано одно из поддерживаемых действий: `start`, `stop`, `status`.\nКлиент отправляет `GET` или `POST` на `/actions/{action}`.\n1. Endpoint принимает запрос и извлекает path parameter `action`.\n2. API определяет источник клиента через `X-Client-Source` или `User-Agent`.\n3. Для `start` и `stop` запрос логируется как control action.\n4. Канал сопоставляет `action` с callback из `ControlActionSet`.\n5. API ожидает завершения callback в пределах допустимого timeout.\n6. При успешном завершении API возвращает JSON со статусом `ok`.\n1. Если `start` или `stop` не успевают завершиться в timeout, API возвращает `202 accepted` и сообщает, что операция еще выполняется.", + "metadata": { + "owner": null, + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "trigger": [ + "Клиент отправляет `GET` или `POST` на `/actions/{action}`." + ], + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "main_flow": [ + "1. Endpoint принимает запрос и извлекает path parameter `action`.", + "2. API определяет источник клиента через `X-Client-Source` или `User-Agent`.", + "3. Для `start` и `stop` запрос логируется как control action.", + "4. Канал сопоставляет `action` с callback из `ControlActionSet`.", + "5. API ожидает завершения callback в пределах допустимого timeout.", + "6. При успешном завершении API возвращает JSON со статусом `ok`." + ], + "doc_version": null, + "document_id": "api.control_actions_endpoint", + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "workflow_id": "f78b822d4366b10322fd4a35e347deae59d55ff4132951201f4df3d1653aec61", + "artifact_type": null, + "last_modified": null, + "preconditions": [ + "HTTP control plane запущен.", + "`ControlActionSet` сконфигурирован в `TelegramControlChannel`.", + "В path передано одно из поддерживаемых действий: `start`, `stop`, `status`." + ], + "workflow_name": "Scenario", + "error_handling": [ + "1. Если actions не сконфигурированы, API возвращает `404`.", + "2. Если передано неподдерживаемое действие, API возвращает `404`.", + "3. Если callback завершился исключением, API возвращает `500`." + ], + "postconditions": [ + "Клиент получает результат выполнения control action или признак, что операция еще продолжается." + ], + "staleness_score": null, + "alternative_flow": [ + "1. Если `start` или `stop` не успевают завершиться в timeout, API возвращает `202 accepted` и сообщает, что операция еще выполняется." + ], + "system_component": null + } + } + ], + "relations": [], + "chunks": [ + { + "layer": "D0_DOC_CHUNKS", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "api.control_actions_endpoint:Описание", + "content": "Метод предоставляет HTTP-доступ к control actions runtime и позволяет запускать, останавливать или проверять состояние управляемых компонентов. Endpoint не реализует lifecycle самостоятельно, а делегирует выполнение в `ControlActionSet`.", + "metadata": { + "tags": [ + "api", + "control-plane", + "lifecycle" + ], + "type": "api_method", + "order": 3, + "owner": null, + "doc_id": null, + "module": "telegram_notify_app", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "doc_kind": "misc", + "doc_version": null, + "document_id": "api.control_actions_endpoint", + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "section_path": "Details > Описание", + "artifact_type": null, + "last_modified": null, + "section_title": "Описание", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D0_DOC_CHUNKS", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "api.control_actions_endpoint:Сценарий", + "content": "**Название:** Выполнение control action runtime\n\n**Предусловия:**\n- HTTP control plane запущен.\n- `ControlActionSet` сконфигурирован в `TelegramControlChannel`.\n- В path передано одно из поддерживаемых действий: `start`, `stop`, `status`.\n\n**Триггер:**\n- Клиент отправляет `GET` или `POST` на `/actions/{action}`.\n\n**Основной сценарий:**\n1. Endpoint принимает запрос и извлекает path parameter `action`.\n2. API определяет источник клиента через `X-Client-Source` или `User-Agent`.\n3. Для `start` и `stop` запрос логируется как control action.\n4. Канал сопоставляет `action` с callback из `ControlActionSet`.\n5. API ожидает завершения callback в пределах допустимого timeout.\n6. При успешном завершении API возвращает JSON со статусом `ok`.\n\n**Альтернативный сценарий:**\n1. Если `start` или `stop` не успевают завершиться в timeout, API возвращает `202 accepted` и сообщает, что операция еще выполняется.\n\n**Обработка ошибок:**\n1. Если actions не сконфигурированы, API возвращает `404`.\n2. Если передано неподдерживаемое действие, API возвращает `404`.\n3. Если callback завершился исключением, API возвращает `500`.\n\n**Постусловие:**\n- Клиент получает результат выполнения control action или признак, что операция еще продолжается.", + "metadata": { + "tags": [ + "api", + "control-plane", + "lifecycle" + ], + "type": "api_method", + "order": 4, + "owner": null, + "doc_id": null, + "module": "telegram_notify_app", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "doc_kind": "misc", + "doc_version": null, + "document_id": "api.control_actions_endpoint", + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "section_path": "Details > Сценарий", + "artifact_type": null, + "last_modified": null, + "section_title": "Сценарий", + "staleness_score": null, + "system_component": null + } + } + ] +} +``` + +### User Prompt Overview +- question: Как работает send endpoint? +- intent: DOCUMENTATION_EXPLAIN +- sub_intent: API_METHOD_EXPLAIN +- documents: 1 | samples: HTTP API /send +- facts: 2 | samples: api.control_actions_endpoint:workflow_step, api.control_actions_endpoint:mentions_entity +- relations: 0 + +## Mismatches +- none \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/docs_router_llm_disambiguation/20260326_150139/full_chain_docs_intents_v3-3x_v3-api-send-3.json b/tests/pipeline_setup_v3/test_results/docs_router_llm_disambiguation/20260326_150139/full_chain_docs_intents_v3-3x_v3-api-send-3.json new file mode 100644 index 0000000..bf775ce --- /dev/null +++ b/tests/pipeline_setup_v3/test_results/docs_router_llm_disambiguation/20260326_150139/full_chain_docs_intents_v3-3x_v3-api-send-3.json @@ -0,0 +1,87 @@ +{ + "meta": { + "case_id": "v3-api-send-3", + "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_03_docs/full_chain_docs_intents_v3-3x.yaml", + "runner": "agent_runtime", + "mode": "pre_llm", + "passed": true, + "mismatches": [], + "actual": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "API_METHOD_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START", + "rag_count": 13, + "llm_answer": "", + "answer_mode": "answered", + "path_scope": [], + "doc_scope": [ + "api.control_actions_endpoint", + "api.health_endpoint", + "api.send_message_endpoint", + "api.actions_endpoint", + "docs/README.md" + ], + "entity_candidates": [], + "symbol_candidates": [], + "layers": [ + "D2_FACT_INDEX", + "D4_WORKFLOW_INDEX", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "filters": { + "doc_type": "api_method" + }, + "pipeline_mode": "pre_llm_only", + "gate_decision": "allow", + "prompt_used": "docs_explain_answer", + "llm_mode": "prose", + "degraded_reason": null, + "code_intents_stubbed": true + } + }, + "pipeline_steps": [ + { + "step": "input_query", + "input": { + "query": "Опиши endpoint отправки сообщений" + }, + "output": { + "query": "Опиши endpoint отправки сообщений" + } + }, + { + "step": "router", + "input": { + "query": "Опиши endpoint отправки сообщений" + }, + "output": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "API_METHOD_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START" + } + }, + { + "step": "docs_pipeline", + "input": { + "query": "Опиши endpoint отправки сообщений" + }, + "output": { + "answer_mode": "ready", + "prompt_name": "docs_explain_answer", + "llm_request": { + "prompt_name": "docs_explain_answer", + "log_context": "graph.project_qa.docs.answer", + "prompt_stats": { + "system_chars": 393, + "user_chars": 11002, + "tokens_in_estimate": 2849 + } + }, + "degraded_reason": "" + } + } + ] +} \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/docs_router_llm_disambiguation/20260326_150139/full_chain_docs_intents_v3-3x_v3-api-send-3.md b/tests/pipeline_setup_v3/test_results/docs_router_llm_disambiguation/20260326_150139/full_chain_docs_intents_v3-3x_v3-api-send-3.md new file mode 100644 index 0000000..6b03579 --- /dev/null +++ b/tests/pipeline_setup_v3/test_results/docs_router_llm_disambiguation/20260326_150139/full_chain_docs_intents_v3-3x_v3-api-send-3.md @@ -0,0 +1,620 @@ +# v3-api-send-3 + +- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_03_docs/full_chain_docs_intents_v3-3x.yaml +- runner: agent_runtime +- mode: pre_llm +- passed: True + +## Query +Опиши endpoint отправки сообщений + +## Actual +{ + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "API_METHOD_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START", + "rag_count": 13, + "llm_answer": "", + "answer_mode": "answered", + "path_scope": [], + "doc_scope": [ + "api.control_actions_endpoint", + "api.health_endpoint", + "api.send_message_endpoint", + "api.actions_endpoint", + "docs/README.md" + ], + "entity_candidates": [], + "symbol_candidates": [], + "layers": [ + "D2_FACT_INDEX", + "D4_WORKFLOW_INDEX", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "filters": { + "doc_type": "api_method" + }, + "pipeline_mode": "pre_llm_only", + "gate_decision": "allow", + "prompt_used": "docs_explain_answer", + "llm_mode": "prose", + "degraded_reason": null, + "code_intents_stubbed": true +} + +## Pipeline Steps +### input_query +```json +{ + "input": { + "query": "Опиши endpoint отправки сообщений" + }, + "output": { + "query": "Опиши endpoint отправки сообщений" + } +} +``` + +### router +```json +{ + "input": { + "query": "Опиши endpoint отправки сообщений" + }, + "output": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "API_METHOD_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START" + } +} +``` + +### docs_pipeline +```json +{ + "input": { + "query": "Опиши endpoint отправки сообщений" + }, + "output": { + "answer_mode": "ready", + "prompt_name": "docs_explain_answer", + "llm_request": { + "prompt_name": "docs_explain_answer", + "log_context": "graph.project_qa.docs.answer", + "prompt_stats": { + "system_chars": 393, + "user_chars": 11002, + "tokens_in_estimate": 2849 + } + }, + "degraded_reason": "" + } +} +``` + +## Diagnostics +{ + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "API_METHOD_EXPLAIN", + "layers_used": [ + "D2_FACT_INDEX", + "D4_WORKFLOW_INDEX", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "documents_found": 1, + "facts_found": 2, + "relations_found": 0, + "openapi_fields_extracted": 0, + "missing_required_fields": [], + "openapi_status": { + "has_path": false, + "has_method": false, + "has_request": false, + "has_response": false + }, + "prompt_used": "docs_explain_answer", + "llm_mode": "prose", + "output_valid": true, + "matched_intent_source": "deterministic", + "matched_anchor_type": "topic", + "matched_anchor_value": null, + "exact_anchor_match": false, + "docs_layers_requested": [ + "D2_FACT_INDEX", + "D4_WORKFLOW_INDEX", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "docs_layers_with_hits": [ + "D2_FACT_INDEX", + "D4_WORKFLOW_INDEX", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "planned_layers": [ + "D2_FACT_INDEX", + "D4_WORKFLOW_INDEX", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "executed_layers": [ + "D2_FACT_INDEX", + "D4_WORKFLOW_INDEX", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "non_empty_layers": [ + "D2_FACT_INDEX", + "D4_WORKFLOW_INDEX", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "layer_diagnostics": { + "D2_FACT_INDEX": { + "hits": 8, + "top_ids": [ + "f85d982c272a2ee6baeadc433221a20e684cd8ef01cb4788d6f76d05ca56d6d0", + "b8e44c3adb74aaa6c91ae8815fa091289e58dd3990a3a1b63e850c62075aea75", + "bafb867ffed41c9db637df98d6cd5f6722d7747bbebc6c03e6f0d0caf3b7f9f3", + "54bbcbac242f1c85ec3280236ed5841998a8a3a548ff16cbf0b5acafbff469e3", + "b6bfad59b3bf00f199b5ef90c1208af19664de700413e7354468a93a4abaaa2f" + ], + "top_sections": [ + "api.control_actions_endpoint:workflow_step", + "api.control_actions_endpoint:mentions_entity" + ] + }, + "D4_WORKFLOW_INDEX": { + "hits": 3, + "top_ids": [ + "api.control_actions_endpoint", + "api.health_endpoint", + "api.send_message_endpoint" + ], + "top_sections": [ + "Scenario" + ] + }, + "D1_DOCUMENT_CATALOG": { + "hits": 4, + "top_ids": [ + "api.send_message_endpoint", + "api.control_actions_endpoint", + "api.health_endpoint", + "docs/README.md" + ], + "top_sections": [ + "HTTP API /send", + "HTTP API /actions/{action}", + "HTTP API /health", + "Readme" + ] + }, + "D0_DOC_CHUNKS": { + "hits": 4, + "top_ids": [ + "api.control_actions_endpoint" + ], + "top_sections": [ + "api.control_actions_endpoint:Описание", + "api.control_actions_endpoint:Сценарий", + "api.control_actions_endpoint:Summary", + "api.control_actions_endpoint:Функциональные требования" + ] + } + }, + "query_entity_candidates": [], + "resolved_entity_candidates": [], + "query_anchor_candidates": [], + "resolved_anchor_candidates": [ + "docs/documentation/api/control-actions-endpoint.md", + "api.control_actions_endpoint", + "api.health_endpoint", + "docs/documentation/api/health-endpoint.md", + "api.send_message_endpoint", + "docs/documentation/api/send-message-endpoint.md", + "docs/README.md" + ], + "anchor_candidates": [], + "selected_anchor": null, + "anchor_selection_reason": "", + "anchor_match_type": "", + "doc_ids": [ + "api.control_actions_endpoint", + "api.health_endpoint", + "api.send_message_endpoint", + "api.actions_endpoint", + "docs/README.md" + ], + "doc_paths": [ + "docs/documentation/api/control-actions-endpoint.md", + "docs/documentation/api/health-endpoint.md", + "docs/documentation/api/send-message-endpoint.md", + "docs/README.md" + ], + "doc_titles": [ + "api.control_actions_endpoint:workflow_step", + "api.control_actions_endpoint:mentions_entity", + "Scenario", + "HTTP API /send", + "HTTP API /actions/{action}", + "HTTP API /health", + "Readme", + "api.control_actions_endpoint:Описание", + "api.control_actions_endpoint:Сценарий", + "api.control_actions_endpoint:Summary", + "api.control_actions_endpoint:Функциональные требования" + ], + "relation_hits_count": 0, + "relation_targets": [], + "selected_doc_ids": [ + "api.send_message_endpoint", + "api.control_actions_endpoint" + ], + "selected_fact_ids": [ + "f85d982c272a2ee6baeadc433221a20e684cd8ef01cb4788d6f76d05ca56d6d0", + "bafb867ffed41c9db637df98d6cd5f6722d7747bbebc6c03e6f0d0caf3b7f9f3" + ], + "selected_relation_ids": [], + "selected_chunk_ids": [ + "api.control_actions_endpoint" + ], + "selected_entity_ids": [], + "selected_workflow_ids": [ + "f78b822d4366b10322fd4a35e347deae59d55ff4132951201f4df3d1653aec61" + ], + "fallback_doc_hits_count": 3, + "fallback_used": false, + "fact_hits": 2, + "entity_hits": 0, + "evidence_summary": { + "documents": 1, + "facts": 2, + "entities": 0, + "workflows": 1, + "relations": 0, + "chunks": 2, + "selected_doc_ids": [ + "api.send_message_endpoint", + "api.control_actions_endpoint" + ], + "selected_fact_ids": [ + "f85d982c272a2ee6baeadc433221a20e684cd8ef01cb4788d6f76d05ca56d6d0", + "bafb867ffed41c9db637df98d6cd5f6722d7747bbebc6c03e6f0d0caf3b7f9f3" + ], + "selected_relation_ids": [], + "selected_chunk_ids": [ + "api.control_actions_endpoint" + ], + "entity_hits": 0, + "openapi_signals": { + "path_found": false, + "method_found": false, + "operation_semantics_found": false, + "request_payload_found": false, + "request_schema": false, + "request_fields_found": false, + "response_payload_found": false, + "response_schema": false, + "response_fields_found": false, + "status_codes": false, + "content_type_found": false, + "examples_found": false, + "payload_description": false + } + }, + "gate_decision": "allow", + "gate_decision_reason": "evidence_sufficient", + "gate_missing_requirements": [], + "gate_satisfied_requirements": [ + "retrieval_non_empty" + ], + "openapi_evidence": { + "path_found": false, + "method_found": false, + "operation_semantics_found": false, + "request_payload_found": false, + "request_schema": false, + "request_fields_found": false, + "response_payload_found": false, + "response_schema": false, + "response_fields_found": false, + "status_codes": false, + "content_type_found": false, + "examples_found": false, + "payload_description": false + }, + "requested_fragment_type": null, + "fragment_evidence_found": [], + "fragment_missing_requirements": [], + "answer_mode": "ready", + "degrade_reason": null, + "degraded_reason": null, + "code_intents_stubbed": false +} + +## LLM Request +- prompt_name: docs_explain_answer +- log_context: graph.project_qa.docs.answer + +### Prompt Stats +```json +{ + "system_chars": 393, + "user_chars": 11002, + "tokens_in_estimate": 2849 +} +``` + +### System Prompt +```text +Ты объясняешь документацию системы. + +На вход приходит JSON с полями: +- question +- intent +- sub_intent +- documents +- facts +- relations + +Правила: +- Используй только предоставленные факты +- Не додумывай +- Если данных недостаточно, скажи это явно +- Объясняй структурировано + +Формат ответа: +1. Краткое описание +2. Основные элементы +3. Как это работает +4. Связи с другими частями системы (если есть) +``` + +### User Prompt +```json +{ + "question": "Опиши endpoint отправки сообщений", + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "API_METHOD_EXPLAIN", + "documents": [ + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/api/send-message-endpoint.md", + "title": "HTTP API /send", + "content": "Endpoint `/send` выполняет ручную отправку сообщения в Telegram через `TelegramSendService`. Он используется для операторской проверки доставки и для отправки уведомлений вне периодического worker loop. Endpoint работает поверх тех же credentials и того же delivery path, что и фоновая отправка.", + "metadata": { + "name": "send_message_endpoint", + "tags": [ + "api", + "telegram", + "manual-send" + ], + "type": "api_method", + "layer": "application", + "links": [ + { + "type": "part_of", + "target": "architecture.telegram_notify_app" + }, + { + "type": "depends_on", + "target": "logic.telegram_notification_loop" + } + ], + "owner": null, + "title": "HTTP API /send", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "architecture.telegram_notify_app", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "5fbf2e33510b0676a3a53b957a4569bd3c2c31fb7719546602c573421ccaa32d", + "children": [], + "doc_kind": "misc", + "entities": [ + "TelegramControlAppFactory", + "TelegramSendService", + "TelegramNotifyWorker" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "api.send_message_endpoint", + "source_path": "docs/documentation/api/send-message-endpoint.md", + "summary_text": "Endpoint `/send` выполняет ручную отправку сообщения в Telegram через `TelegramSendService`. Он используется для операторской проверки доставки и для отправки уведомлений вне периодического worker loop. Endpoint работает поверх тех же credentials и того же delivery path, что и фоновая отправка.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + } + ], + "facts": [ + { + "layer": "D2_FACT_INDEX", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "api.control_actions_endpoint:workflow_step", + "content": "api.control_actions_endpoint workflow_step Название:** Выполнение control action runtime", + "metadata": { + "tags": [], + "owner": null, + "anchor": "Сценарий", + "doc_id": null, + "object": "Название:** Выполнение control action runtime", + "fact_id": "f85d982c272a2ee6baeadc433221a20e684cd8ef01cb4788d6f76d05ca56d6d0", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "predicate": "workflow_step", + "object_ref": null, + "subject_id": "api.control_actions_endpoint", + "doc_version": null, + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D2_FACT_INDEX", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "api.control_actions_endpoint:mentions_entity", + "content": "api.control_actions_endpoint mentions_entity ControlActionSet", + "metadata": { + "tags": [], + "owner": null, + "anchor": "frontmatter.entities", + "doc_id": null, + "object": "ControlActionSet", + "fact_id": "bafb867ffed41c9db637df98d6cd5f6722d7747bbebc6c03e6f0d0caf3b7f9f3", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "predicate": "mentions_entity", + "object_ref": null, + "subject_id": "api.control_actions_endpoint", + "doc_version": null, + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + } + ], + "entities": [], + "workflows": [ + { + "layer": "D4_WORKFLOW_INDEX", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "Scenario", + "content": "Scenario\nHTTP control plane запущен.\n`ControlActionSet` сконфигурирован в `TelegramControlChannel`.\nВ path передано одно из поддерживаемых действий: `start`, `stop`, `status`.\nКлиент отправляет `GET` или `POST` на `/actions/{action}`.\n1. Endpoint принимает запрос и извлекает path parameter `action`.\n2. API определяет источник клиента через `X-Client-Source` или `User-Agent`.\n3. Для `start` и `stop` запрос логируется как control action.\n4. Канал сопоставляет `action` с callback из `ControlActionSet`.\n5. API ожидает завершения callback в пределах допустимого timeout.\n6. При успешном завершении API возвращает JSON со статусом `ok`.\n1. Если `start` или `stop` не успевают завершиться в timeout, API возвращает `202 accepted` и сообщает, что операция еще выполняется.", + "metadata": { + "owner": null, + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "trigger": [ + "Клиент отправляет `GET` или `POST` на `/actions/{action}`." + ], + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "main_flow": [ + "1. Endpoint принимает запрос и извлекает path parameter `action`.", + "2. API определяет источник клиента через `X-Client-Source` или `User-Agent`.", + "3. Для `start` и `stop` запрос логируется как control action.", + "4. Канал сопоставляет `action` с callback из `ControlActionSet`.", + "5. API ожидает завершения callback в пределах допустимого timeout.", + "6. При успешном завершении API возвращает JSON со статусом `ok`." + ], + "doc_version": null, + "document_id": "api.control_actions_endpoint", + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "workflow_id": "f78b822d4366b10322fd4a35e347deae59d55ff4132951201f4df3d1653aec61", + "artifact_type": null, + "last_modified": null, + "preconditions": [ + "HTTP control plane запущен.", + "`ControlActionSet` сконфигурирован в `TelegramControlChannel`.", + "В path передано одно из поддерживаемых действий: `start`, `stop`, `status`." + ], + "workflow_name": "Scenario", + "error_handling": [ + "1. Если actions не сконфигурированы, API возвращает `404`.", + "2. Если передано неподдерживаемое действие, API возвращает `404`.", + "3. Если callback завершился исключением, API возвращает `500`." + ], + "postconditions": [ + "Клиент получает результат выполнения control action или признак, что операция еще продолжается." + ], + "staleness_score": null, + "alternative_flow": [ + "1. Если `start` или `stop` не успевают завершиться в timeout, API возвращает `202 accepted` и сообщает, что операция еще выполняется." + ], + "system_component": null + } + } + ], + "relations": [], + "chunks": [ + { + "layer": "D0_DOC_CHUNKS", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "api.control_actions_endpoint:Описание", + "content": "Метод предоставляет HTTP-доступ к control actions runtime и позволяет запускать, останавливать или проверять состояние управляемых компонентов. Endpoint не реализует lifecycle самостоятельно, а делегирует выполнение в `ControlActionSet`.", + "metadata": { + "tags": [ + "api", + "control-plane", + "lifecycle" + ], + "type": "api_method", + "order": 3, + "owner": null, + "doc_id": null, + "module": "telegram_notify_app", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "doc_kind": "misc", + "doc_version": null, + "document_id": "api.control_actions_endpoint", + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "section_path": "Details > Описание", + "artifact_type": null, + "last_modified": null, + "section_title": "Описание", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D0_DOC_CHUNKS", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "api.control_actions_endpoint:Сценарий", + "content": "**Название:** Выполнение control action runtime\n\n**Предусловия:**\n- HTTP control plane запущен.\n- `ControlActionSet` сконфигурирован в `TelegramControlChannel`.\n- В path передано одно из поддерживаемых действий: `start`, `stop`, `status`.\n\n**Триггер:**\n- Клиент отправляет `GET` или `POST` на `/actions/{action}`.\n\n**Основной сценарий:**\n1. Endpoint принимает запрос и извлекает path parameter `action`.\n2. API определяет источник клиента через `X-Client-Source` или `User-Agent`.\n3. Для `start` и `stop` запрос логируется как control action.\n4. Канал сопоставляет `action` с callback из `ControlActionSet`.\n5. API ожидает завершения callback в пределах допустимого timeout.\n6. При успешном завершении API возвращает JSON со статусом `ok`.\n\n**Альтернативный сценарий:**\n1. Если `start` или `stop` не успевают завершиться в timeout, API возвращает `202 accepted` и сообщает, что операция еще выполняется.\n\n**Обработка ошибок:**\n1. Если actions не сконфигурированы, API возвращает `404`.\n2. Если передано неподдерживаемое действие, API возвращает `404`.\n3. Если callback завершился исключением, API возвращает `500`.\n\n**Постусловие:**\n- Клиент получает результат выполнения control action или признак, что операция еще продолжается.", + "metadata": { + "tags": [ + "api", + "control-plane", + "lifecycle" + ], + "type": "api_method", + "order": 4, + "owner": null, + "doc_id": null, + "module": "telegram_notify_app", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "doc_kind": "misc", + "doc_version": null, + "document_id": "api.control_actions_endpoint", + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "section_path": "Details > Сценарий", + "artifact_type": null, + "last_modified": null, + "section_title": "Сценарий", + "staleness_score": null, + "system_component": null + } + } + ] +} +``` + +### User Prompt Overview +- question: Опиши endpoint отправки сообщений +- intent: DOCUMENTATION_EXPLAIN +- sub_intent: API_METHOD_EXPLAIN +- documents: 1 | samples: HTTP API /send +- facts: 2 | samples: api.control_actions_endpoint:workflow_step, api.control_actions_endpoint:mentions_entity +- relations: 0 + +## Mismatches +- none \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/docs_router_llm_disambiguation/20260326_150139/full_chain_docs_intents_v3-3x_v3-component-control-channel-1.json b/tests/pipeline_setup_v3/test_results/docs_router_llm_disambiguation/20260326_150139/full_chain_docs_intents_v3-3x_v3-component-control-channel-1.json new file mode 100644 index 0000000..fcb328b --- /dev/null +++ b/tests/pipeline_setup_v3/test_results/docs_router_llm_disambiguation/20260326_150139/full_chain_docs_intents_v3-3x_v3-component-control-channel-1.json @@ -0,0 +1,92 @@ +{ + "meta": { + "case_id": "v3-component-control-channel-1", + "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_03_docs/full_chain_docs_intents_v3-3x.yaml", + "runner": "agent_runtime", + "mode": "pre_llm", + "passed": true, + "mismatches": [], + "actual": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "COMPONENT_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START", + "rag_count": 18, + "llm_answer": "", + "answer_mode": "answered", + "path_scope": [], + "doc_scope": [ + "api.control_actions_endpoint", + "logic.telegram_notification_loop", + "architecture.telegram_notify_app_overview", + "api.health_endpoint", + "api.actions_endpoint", + "architecture.telegram_notify_app", + "docs/README.md", + "domain.runtime_health" + ], + "entity_candidates": [ + "TelegramControlChannel" + ], + "symbol_candidates": [], + "layers": [ + "D2_FACT_INDEX", + "D5_RELATION_GRAPH", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "filters": { + "doc_type": null + }, + "pipeline_mode": "pre_llm_only", + "gate_decision": "allow", + "prompt_used": "docs_explain_answer", + "llm_mode": "prose", + "degraded_reason": null, + "code_intents_stubbed": true + } + }, + "pipeline_steps": [ + { + "step": "input_query", + "input": { + "query": "Как работает TelegramControlChannel?" + }, + "output": { + "query": "Как работает TelegramControlChannel?" + } + }, + { + "step": "router", + "input": { + "query": "Как работает TelegramControlChannel?" + }, + "output": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "COMPONENT_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START" + } + }, + { + "step": "docs_pipeline", + "input": { + "query": "Как работает TelegramControlChannel?" + }, + "output": { + "answer_mode": "ready", + "prompt_name": "docs_explain_answer", + "llm_request": { + "prompt_name": "docs_explain_answer", + "log_context": "graph.project_qa.docs.answer", + "prompt_stats": { + "system_chars": 393, + "user_chars": 10053, + "tokens_in_estimate": 2612 + } + }, + "degraded_reason": "" + } + } + ] +} \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/docs_router_llm_disambiguation/20260326_150139/full_chain_docs_intents_v3-3x_v3-component-control-channel-1.md b/tests/pipeline_setup_v3/test_results/docs_router_llm_disambiguation/20260326_150139/full_chain_docs_intents_v3-3x_v3-component-control-channel-1.md new file mode 100644 index 0000000..8b5296d --- /dev/null +++ b/tests/pipeline_setup_v3/test_results/docs_router_llm_disambiguation/20260326_150139/full_chain_docs_intents_v3-3x_v3-component-control-channel-1.md @@ -0,0 +1,657 @@ +# v3-component-control-channel-1 + +- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_03_docs/full_chain_docs_intents_v3-3x.yaml +- runner: agent_runtime +- mode: pre_llm +- passed: True + +## Query +Как работает TelegramControlChannel? + +## Actual +{ + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "COMPONENT_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START", + "rag_count": 18, + "llm_answer": "", + "answer_mode": "answered", + "path_scope": [], + "doc_scope": [ + "api.control_actions_endpoint", + "logic.telegram_notification_loop", + "architecture.telegram_notify_app_overview", + "api.health_endpoint", + "api.actions_endpoint", + "architecture.telegram_notify_app", + "docs/README.md", + "domain.runtime_health" + ], + "entity_candidates": [ + "TelegramControlChannel" + ], + "symbol_candidates": [], + "layers": [ + "D2_FACT_INDEX", + "D5_RELATION_GRAPH", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "filters": { + "doc_type": null + }, + "pipeline_mode": "pre_llm_only", + "gate_decision": "allow", + "prompt_used": "docs_explain_answer", + "llm_mode": "prose", + "degraded_reason": null, + "code_intents_stubbed": true +} + +## Pipeline Steps +### input_query +```json +{ + "input": { + "query": "Как работает TelegramControlChannel?" + }, + "output": { + "query": "Как работает TelegramControlChannel?" + } +} +``` + +### router +```json +{ + "input": { + "query": "Как работает TelegramControlChannel?" + }, + "output": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "COMPONENT_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START" + } +} +``` + +### docs_pipeline +```json +{ + "input": { + "query": "Как работает TelegramControlChannel?" + }, + "output": { + "answer_mode": "ready", + "prompt_name": "docs_explain_answer", + "llm_request": { + "prompt_name": "docs_explain_answer", + "log_context": "graph.project_qa.docs.answer", + "prompt_stats": { + "system_chars": 393, + "user_chars": 10053, + "tokens_in_estimate": 2612 + } + }, + "degraded_reason": "" + } +} +``` + +## Diagnostics +{ + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "COMPONENT_EXPLAIN", + "layers_used": [ + "D2_FACT_INDEX", + "D5_RELATION_GRAPH", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "documents_found": 1, + "facts_found": 2, + "relations_found": 2, + "openapi_fields_extracted": 0, + "missing_required_fields": [], + "openapi_status": { + "has_path": false, + "has_method": false, + "has_request": false, + "has_response": false + }, + "prompt_used": "docs_explain_answer", + "llm_mode": "prose", + "output_valid": true, + "matched_intent_source": "llm", + "matched_anchor_type": "none", + "matched_anchor_value": null, + "exact_anchor_match": false, + "docs_layers_requested": [ + "D2_FACT_INDEX", + "D5_RELATION_GRAPH", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "docs_layers_with_hits": [ + "D2_FACT_INDEX", + "D5_RELATION_GRAPH", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "planned_layers": [ + "D2_FACT_INDEX", + "D5_RELATION_GRAPH", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "executed_layers": [ + "D2_FACT_INDEX", + "D5_RELATION_GRAPH", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "non_empty_layers": [ + "D2_FACT_INDEX", + "D5_RELATION_GRAPH", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "layer_diagnostics": { + "D2_FACT_INDEX": { + "hits": 8, + "top_ids": [ + "b480201013a7e5231146f665773ebc54af37c28135f407c6b758304c74561645", + "b8e44c3adb74aaa6c91ae8815fa091289e58dd3990a3a1b63e850c62075aea75", + "bafb867ffed41c9db637df98d6cd5f6722d7747bbebc6c03e6f0d0caf3b7f9f3", + "54bbcbac242f1c85ec3280236ed5841998a8a3a548ff16cbf0b5acafbff469e3", + "b6bfad59b3bf00f199b5ef90c1208af19664de700413e7354468a93a4abaaa2f" + ], + "top_sections": [ + "api.control_actions_endpoint:workflow_step", + "api.control_actions_endpoint:mentions_entity" + ] + }, + "D5_RELATION_GRAPH": { + "hits": 8, + "top_ids": [ + "eec79f7a02b804337e791ef231784862ae26e0599eb20224790e9d4f085fa9c0", + "711fb2edb82dd222deaba3c91768b18cbbd453009235823282813c6e867dc2c1", + "afec31fd062e392dcd9699a92c7ab61fd4b1273c1a2b16702b23d55d8d0c47ac", + "5f4909bde905cd3d294ad307074a05e4ae4deefcafe6272cd2d0436e73acb8dd", + "921934af8cd7b16572a6cbd3c42011a08d2762f121853cb2458dff348284ac76" + ], + "top_sections": [ + "api.control_actions_endpoint:related_logic", + "api.control_actions_endpoint:related_api", + "api.control_actions_endpoint:parent", + "api.control_actions_endpoint:part_of", + "logic.telegram_notification_loop:related_api" + ] + }, + "D1_DOCUMENT_CATALOG": { + "hits": 4, + "top_ids": [ + "api.control_actions_endpoint", + "architecture.telegram_notify_app", + "docs/README.md", + "domain.runtime_health" + ], + "top_sections": [ + "HTTP API /actions/{action}", + "Архитектура Telegram Notify App", + "Readme", + "Сущность runtime health" + ] + }, + "D0_DOC_CHUNKS": { + "hits": 4, + "top_ids": [ + "api.control_actions_endpoint" + ], + "top_sections": [ + "api.control_actions_endpoint:Описание", + "api.control_actions_endpoint:Сценарий", + "api.control_actions_endpoint:Summary", + "api.control_actions_endpoint:Функциональные требования" + ] + } + }, + "query_entity_candidates": [ + "TelegramControlChannel" + ], + "resolved_entity_candidates": [], + "query_anchor_candidates": [ + "TelegramControlChannel" + ], + "resolved_anchor_candidates": [ + "docs/documentation/api/control-actions-endpoint.md", + "docs/documentation/logic/telegram-notification-loop.md", + "docs/documentation/architecture/telegram-notify-app-overview.md", + "docs/documentation/api/health-endpoint.md", + "api.control_actions_endpoint", + "architecture.telegram_notify_app", + "docs/README.md", + "domain.runtime_health", + "docs/documentation/domain/runtime-health-entity.md" + ], + "anchor_candidates": [], + "selected_anchor": null, + "anchor_selection_reason": "", + "anchor_match_type": "", + "doc_ids": [ + "api.control_actions_endpoint", + "logic.telegram_notification_loop", + "architecture.telegram_notify_app_overview", + "api.health_endpoint", + "api.actions_endpoint", + "architecture.telegram_notify_app", + "docs/README.md", + "domain.runtime_health" + ], + "doc_paths": [ + "docs/documentation/api/control-actions-endpoint.md", + "docs/documentation/logic/telegram-notification-loop.md", + "docs/documentation/architecture/telegram-notify-app-overview.md", + "docs/documentation/api/health-endpoint.md", + "docs/README.md", + "docs/documentation/domain/runtime-health-entity.md" + ], + "doc_titles": [ + "api.control_actions_endpoint:workflow_step", + "api.control_actions_endpoint:mentions_entity", + "api.control_actions_endpoint:related_logic", + "api.control_actions_endpoint:related_api", + "api.control_actions_endpoint:parent", + "api.control_actions_endpoint:part_of", + "logic.telegram_notification_loop:related_api", + "architecture.telegram_notify_app:related_api", + "architecture.telegram_notify_app:child", + "api.health_endpoint:depends_on", + "HTTP API /actions/{action}", + "Архитектура Telegram Notify App", + "Readme", + "Сущность runtime health", + "api.control_actions_endpoint:Описание", + "api.control_actions_endpoint:Сценарий", + "api.control_actions_endpoint:Summary", + "api.control_actions_endpoint:Функциональные требования" + ], + "relation_hits_count": 2, + "relation_targets": [ + "api.control_actions_endpoint:related_logic", + "api.control_actions_endpoint:related_api" + ], + "selected_doc_ids": [ + "api.control_actions_endpoint" + ], + "selected_fact_ids": [ + "b480201013a7e5231146f665773ebc54af37c28135f407c6b758304c74561645", + "bafb867ffed41c9db637df98d6cd5f6722d7747bbebc6c03e6f0d0caf3b7f9f3" + ], + "selected_relation_ids": [ + "eec79f7a02b804337e791ef231784862ae26e0599eb20224790e9d4f085fa9c0", + "711fb2edb82dd222deaba3c91768b18cbbd453009235823282813c6e867dc2c1" + ], + "selected_chunk_ids": [ + "api.control_actions_endpoint" + ], + "selected_entity_ids": [], + "selected_workflow_ids": [], + "fallback_doc_hits_count": 3, + "fallback_used": false, + "fact_hits": 2, + "entity_hits": 0, + "evidence_summary": { + "documents": 1, + "facts": 2, + "entities": 0, + "workflows": 0, + "relations": 2, + "chunks": 2, + "selected_doc_ids": [ + "api.control_actions_endpoint" + ], + "selected_fact_ids": [ + "b480201013a7e5231146f665773ebc54af37c28135f407c6b758304c74561645", + "bafb867ffed41c9db637df98d6cd5f6722d7747bbebc6c03e6f0d0caf3b7f9f3" + ], + "selected_relation_ids": [ + "eec79f7a02b804337e791ef231784862ae26e0599eb20224790e9d4f085fa9c0", + "711fb2edb82dd222deaba3c91768b18cbbd453009235823282813c6e867dc2c1" + ], + "selected_chunk_ids": [ + "api.control_actions_endpoint" + ], + "entity_hits": 0, + "openapi_signals": { + "path_found": false, + "method_found": false, + "operation_semantics_found": false, + "request_payload_found": false, + "request_schema": false, + "request_fields_found": false, + "response_payload_found": false, + "response_schema": false, + "response_fields_found": false, + "status_codes": false, + "content_type_found": false, + "examples_found": false, + "payload_description": false + } + }, + "gate_decision": "allow", + "gate_decision_reason": "evidence_sufficient", + "gate_missing_requirements": [], + "gate_satisfied_requirements": [ + "retrieval_non_empty" + ], + "openapi_evidence": { + "path_found": false, + "method_found": false, + "operation_semantics_found": false, + "request_payload_found": false, + "request_schema": false, + "request_fields_found": false, + "response_payload_found": false, + "response_schema": false, + "response_fields_found": false, + "status_codes": false, + "content_type_found": false, + "examples_found": false, + "payload_description": false + }, + "requested_fragment_type": null, + "fragment_evidence_found": [], + "fragment_missing_requirements": [], + "answer_mode": "ready", + "degrade_reason": null, + "degraded_reason": null, + "code_intents_stubbed": false +} + +## LLM Request +- prompt_name: docs_explain_answer +- log_context: graph.project_qa.docs.answer + +### Prompt Stats +```json +{ + "system_chars": 393, + "user_chars": 10053, + "tokens_in_estimate": 2612 +} +``` + +### System Prompt +```text +Ты объясняешь документацию системы. + +На вход приходит JSON с полями: +- question +- intent +- sub_intent +- documents +- facts +- relations + +Правила: +- Используй только предоставленные факты +- Не додумывай +- Если данных недостаточно, скажи это явно +- Объясняй структурировано + +Формат ответа: +1. Краткое описание +2. Основные элементы +3. Как это работает +4. Связи с другими частями системы (если есть) +``` + +### User Prompt +```json +{ + "question": "Как работает TelegramControlChannel?", + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "COMPONENT_EXPLAIN", + "documents": [ + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "HTTP API /actions/{action}", + "content": "Endpoint `/actions/{action}` управляет control actions runtime и поддерживает `start`, `stop` и `status`. Для долгих операций `start` и `stop` допускается ответ HTTP 202, если действие еще выполняется. Endpoint используется для operator-driven управления жизненным циклом worker'а через HTTP API.", + "metadata": { + "name": "control_actions_endpoint", + "tags": [ + "api", + "control-plane", + "lifecycle" + ], + "type": "api_method", + "layer": "application", + "links": [ + { + "type": "part_of", + "target": "architecture.telegram_notify_app" + }, + { + "type": "related_api", + "target": "api.health_endpoint" + }, + { + "type": "related_logic", + "target": "logic.telegram_notification_loop" + } + ], + "owner": null, + "title": "HTTP API /actions/{action}", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "architecture.telegram_notify_app", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "children": [], + "doc_kind": "misc", + "entities": [ + "TelegramControlChannel", + "ControlActionSet", + "JSONResponse" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "api.control_actions_endpoint", + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "summary_text": "Endpoint `/actions/{action}` управляет control actions runtime и поддерживает `start`, `stop` и `status`. Для долгих операций `start` и `stop` допускается ответ HTTP 202, если действие еще выполняется. Endpoint используется для operator-driven управления жизненным циклом worker'а через HTTP API.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + } + ], + "facts": [ + { + "layer": "D2_FACT_INDEX", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "api.control_actions_endpoint:workflow_step", + "content": "api.control_actions_endpoint workflow_step HTTP control plane запущен.", + "metadata": { + "tags": [], + "owner": null, + "anchor": "Сценарий", + "doc_id": null, + "object": "HTTP control plane запущен.", + "fact_id": "b480201013a7e5231146f665773ebc54af37c28135f407c6b758304c74561645", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "predicate": "workflow_step", + "object_ref": null, + "subject_id": "api.control_actions_endpoint", + "doc_version": null, + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D2_FACT_INDEX", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "api.control_actions_endpoint:mentions_entity", + "content": "api.control_actions_endpoint mentions_entity ControlActionSet", + "metadata": { + "tags": [], + "owner": null, + "anchor": "frontmatter.entities", + "doc_id": null, + "object": "ControlActionSet", + "fact_id": "bafb867ffed41c9db637df98d6cd5f6722d7747bbebc6c03e6f0d0caf3b7f9f3", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "predicate": "mentions_entity", + "object_ref": null, + "subject_id": "api.control_actions_endpoint", + "doc_version": null, + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + } + ], + "entities": [], + "workflows": [], + "relations": [ + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "api.control_actions_endpoint:related_logic", + "content": "api.control_actions_endpoint related_logic logic.telegram_notification_loop", + "metadata": { + "owner": null, + "anchor": "frontmatter.links", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "source_id": "api.control_actions_endpoint", + "target_id": "logic.telegram_notification_loop", + "doc_version": null, + "relation_id": "eec79f7a02b804337e791ef231784862ae26e0599eb20224790e9d4f085fa9c0", + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "related_logic", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "api.control_actions_endpoint:related_api", + "content": "api.control_actions_endpoint related_api api.health_endpoint", + "metadata": { + "owner": null, + "anchor": "frontmatter.links", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "source_id": "api.control_actions_endpoint", + "target_id": "api.health_endpoint", + "doc_version": null, + "relation_id": "711fb2edb82dd222deaba3c91768b18cbbd453009235823282813c6e867dc2c1", + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "related_api", + "staleness_score": null, + "system_component": null + } + } + ], + "chunks": [ + { + "layer": "D0_DOC_CHUNKS", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "api.control_actions_endpoint:Описание", + "content": "Метод предоставляет HTTP-доступ к control actions runtime и позволяет запускать, останавливать или проверять состояние управляемых компонентов. Endpoint не реализует lifecycle самостоятельно, а делегирует выполнение в `ControlActionSet`.", + "metadata": { + "tags": [ + "api", + "control-plane", + "lifecycle" + ], + "type": "api_method", + "order": 3, + "owner": null, + "doc_id": null, + "module": "telegram_notify_app", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "doc_kind": "misc", + "doc_version": null, + "document_id": "api.control_actions_endpoint", + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "section_path": "Details > Описание", + "artifact_type": null, + "last_modified": null, + "section_title": "Описание", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D0_DOC_CHUNKS", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "api.control_actions_endpoint:Сценарий", + "content": "**Название:** Выполнение control action runtime\n\n**Предусловия:**\n- HTTP control plane запущен.\n- `ControlActionSet` сконфигурирован в `TelegramControlChannel`.\n- В path передано одно из поддерживаемых действий: `start`, `stop`, `status`.\n\n**Триггер:**\n- Клиент отправляет `GET` или `POST` на `/actions/{action}`.\n\n**Основной сценарий:**\n1. Endpoint принимает запрос и извлекает path parameter `action`.\n2. API определяет источник клиента через `X-Client-Source` или `User-Agent`.\n3. Для `start` и `stop` запрос логируется как control action.\n4. Канал сопоставляет `action` с callback из `ControlActionSet`.\n5. API ожидает завершения callback в пределах допустимого timeout.\n6. При успешном завершении API возвращает JSON со статусом `ok`.\n\n**Альтернативный сценарий:**\n1. Если `start` или `stop` не успевают завершиться в timeout, API возвращает `202 accepted` и сообщает, что операция еще выполняется.\n\n**Обработка ошибок:**\n1. Если actions не сконфигурированы, API возвращает `404`.\n2. Если передано неподдерживаемое действие, API возвращает `404`.\n3. Если callback завершился исключением, API возвращает `500`.\n\n**Постусловие:**\n- Клиент получает результат выполнения control action или признак, что операция еще продолжается.", + "metadata": { + "tags": [ + "api", + "control-plane", + "lifecycle" + ], + "type": "api_method", + "order": 4, + "owner": null, + "doc_id": null, + "module": "telegram_notify_app", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "doc_kind": "misc", + "doc_version": null, + "document_id": "api.control_actions_endpoint", + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "section_path": "Details > Сценарий", + "artifact_type": null, + "last_modified": null, + "section_title": "Сценарий", + "staleness_score": null, + "system_component": null + } + } + ] +} +``` + +### User Prompt Overview +- question: Как работает TelegramControlChannel? +- intent: DOCUMENTATION_EXPLAIN +- sub_intent: COMPONENT_EXPLAIN +- documents: 1 | samples: HTTP API /actions/{action} +- facts: 2 | samples: api.control_actions_endpoint:workflow_step, api.control_actions_endpoint:mentions_entity +- relations: 2 | samples: api.control_actions_endpoint:related_logic, api.control_actions_endpoint:related_api + +## Mismatches +- none \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/docs_router_llm_disambiguation/20260326_150139/full_chain_docs_intents_v3-3x_v3-component-control-channel-2.json b/tests/pipeline_setup_v3/test_results/docs_router_llm_disambiguation/20260326_150139/full_chain_docs_intents_v3-3x_v3-component-control-channel-2.json new file mode 100644 index 0000000..0abc76d --- /dev/null +++ b/tests/pipeline_setup_v3/test_results/docs_router_llm_disambiguation/20260326_150139/full_chain_docs_intents_v3-3x_v3-component-control-channel-2.json @@ -0,0 +1,92 @@ +{ + "meta": { + "case_id": "v3-component-control-channel-2", + "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_03_docs/full_chain_docs_intents_v3-3x.yaml", + "runner": "agent_runtime", + "mode": "pre_llm", + "passed": true, + "mismatches": [], + "actual": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "COMPONENT_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START", + "rag_count": 18, + "llm_answer": "", + "answer_mode": "answered", + "path_scope": [], + "doc_scope": [ + "api.control_actions_endpoint", + "logic.telegram_notification_loop", + "architecture.telegram_notify_app_overview", + "api.health_endpoint", + "api.actions_endpoint", + "architecture.telegram_notify_app", + "docs/README.md", + "domain.runtime_health" + ], + "entity_candidates": [ + "TelegramControlChannel" + ], + "symbol_candidates": [], + "layers": [ + "D2_FACT_INDEX", + "D5_RELATION_GRAPH", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "filters": { + "doc_type": null + }, + "pipeline_mode": "pre_llm_only", + "gate_decision": "allow", + "prompt_used": "docs_explain_answer", + "llm_mode": "prose", + "degraded_reason": null, + "code_intents_stubbed": true + } + }, + "pipeline_steps": [ + { + "step": "input_query", + "input": { + "query": "Роль TelegramControlChannel в системе" + }, + "output": { + "query": "Роль TelegramControlChannel в системе" + } + }, + { + "step": "router", + "input": { + "query": "Роль TelegramControlChannel в системе" + }, + "output": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "COMPONENT_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START" + } + }, + { + "step": "docs_pipeline", + "input": { + "query": "Роль TelegramControlChannel в системе" + }, + "output": { + "answer_mode": "ready", + "prompt_name": "docs_explain_answer", + "llm_request": { + "prompt_name": "docs_explain_answer", + "log_context": "graph.project_qa.docs.answer", + "prompt_stats": { + "system_chars": 393, + "user_chars": 10054, + "tokens_in_estimate": 2612 + } + }, + "degraded_reason": "" + } + } + ] +} \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/docs_router_llm_disambiguation/20260326_150139/full_chain_docs_intents_v3-3x_v3-component-control-channel-2.md b/tests/pipeline_setup_v3/test_results/docs_router_llm_disambiguation/20260326_150139/full_chain_docs_intents_v3-3x_v3-component-control-channel-2.md new file mode 100644 index 0000000..13da7b0 --- /dev/null +++ b/tests/pipeline_setup_v3/test_results/docs_router_llm_disambiguation/20260326_150139/full_chain_docs_intents_v3-3x_v3-component-control-channel-2.md @@ -0,0 +1,657 @@ +# v3-component-control-channel-2 + +- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_03_docs/full_chain_docs_intents_v3-3x.yaml +- runner: agent_runtime +- mode: pre_llm +- passed: True + +## Query +Роль TelegramControlChannel в системе + +## Actual +{ + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "COMPONENT_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START", + "rag_count": 18, + "llm_answer": "", + "answer_mode": "answered", + "path_scope": [], + "doc_scope": [ + "api.control_actions_endpoint", + "logic.telegram_notification_loop", + "architecture.telegram_notify_app_overview", + "api.health_endpoint", + "api.actions_endpoint", + "architecture.telegram_notify_app", + "docs/README.md", + "domain.runtime_health" + ], + "entity_candidates": [ + "TelegramControlChannel" + ], + "symbol_candidates": [], + "layers": [ + "D2_FACT_INDEX", + "D5_RELATION_GRAPH", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "filters": { + "doc_type": null + }, + "pipeline_mode": "pre_llm_only", + "gate_decision": "allow", + "prompt_used": "docs_explain_answer", + "llm_mode": "prose", + "degraded_reason": null, + "code_intents_stubbed": true +} + +## Pipeline Steps +### input_query +```json +{ + "input": { + "query": "Роль TelegramControlChannel в системе" + }, + "output": { + "query": "Роль TelegramControlChannel в системе" + } +} +``` + +### router +```json +{ + "input": { + "query": "Роль TelegramControlChannel в системе" + }, + "output": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "COMPONENT_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START" + } +} +``` + +### docs_pipeline +```json +{ + "input": { + "query": "Роль TelegramControlChannel в системе" + }, + "output": { + "answer_mode": "ready", + "prompt_name": "docs_explain_answer", + "llm_request": { + "prompt_name": "docs_explain_answer", + "log_context": "graph.project_qa.docs.answer", + "prompt_stats": { + "system_chars": 393, + "user_chars": 10054, + "tokens_in_estimate": 2612 + } + }, + "degraded_reason": "" + } +} +``` + +## Diagnostics +{ + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "COMPONENT_EXPLAIN", + "layers_used": [ + "D2_FACT_INDEX", + "D5_RELATION_GRAPH", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "documents_found": 1, + "facts_found": 2, + "relations_found": 2, + "openapi_fields_extracted": 0, + "missing_required_fields": [], + "openapi_status": { + "has_path": false, + "has_method": false, + "has_request": false, + "has_response": false + }, + "prompt_used": "docs_explain_answer", + "llm_mode": "prose", + "output_valid": true, + "matched_intent_source": "deterministic", + "matched_anchor_type": "none", + "matched_anchor_value": null, + "exact_anchor_match": false, + "docs_layers_requested": [ + "D2_FACT_INDEX", + "D5_RELATION_GRAPH", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "docs_layers_with_hits": [ + "D2_FACT_INDEX", + "D5_RELATION_GRAPH", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "planned_layers": [ + "D2_FACT_INDEX", + "D5_RELATION_GRAPH", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "executed_layers": [ + "D2_FACT_INDEX", + "D5_RELATION_GRAPH", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "non_empty_layers": [ + "D2_FACT_INDEX", + "D5_RELATION_GRAPH", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "layer_diagnostics": { + "D2_FACT_INDEX": { + "hits": 8, + "top_ids": [ + "b480201013a7e5231146f665773ebc54af37c28135f407c6b758304c74561645", + "b8e44c3adb74aaa6c91ae8815fa091289e58dd3990a3a1b63e850c62075aea75", + "bafb867ffed41c9db637df98d6cd5f6722d7747bbebc6c03e6f0d0caf3b7f9f3", + "54bbcbac242f1c85ec3280236ed5841998a8a3a548ff16cbf0b5acafbff469e3", + "b6bfad59b3bf00f199b5ef90c1208af19664de700413e7354468a93a4abaaa2f" + ], + "top_sections": [ + "api.control_actions_endpoint:workflow_step", + "api.control_actions_endpoint:mentions_entity" + ] + }, + "D5_RELATION_GRAPH": { + "hits": 8, + "top_ids": [ + "eec79f7a02b804337e791ef231784862ae26e0599eb20224790e9d4f085fa9c0", + "711fb2edb82dd222deaba3c91768b18cbbd453009235823282813c6e867dc2c1", + "afec31fd062e392dcd9699a92c7ab61fd4b1273c1a2b16702b23d55d8d0c47ac", + "5f4909bde905cd3d294ad307074a05e4ae4deefcafe6272cd2d0436e73acb8dd", + "921934af8cd7b16572a6cbd3c42011a08d2762f121853cb2458dff348284ac76" + ], + "top_sections": [ + "api.control_actions_endpoint:related_logic", + "api.control_actions_endpoint:related_api", + "api.control_actions_endpoint:parent", + "api.control_actions_endpoint:part_of", + "logic.telegram_notification_loop:related_api" + ] + }, + "D1_DOCUMENT_CATALOG": { + "hits": 4, + "top_ids": [ + "api.control_actions_endpoint", + "architecture.telegram_notify_app", + "docs/README.md", + "domain.runtime_health" + ], + "top_sections": [ + "HTTP API /actions/{action}", + "Архитектура Telegram Notify App", + "Readme", + "Сущность runtime health" + ] + }, + "D0_DOC_CHUNKS": { + "hits": 4, + "top_ids": [ + "api.control_actions_endpoint" + ], + "top_sections": [ + "api.control_actions_endpoint:Описание", + "api.control_actions_endpoint:Сценарий", + "api.control_actions_endpoint:Summary", + "api.control_actions_endpoint:Функциональные требования" + ] + } + }, + "query_entity_candidates": [ + "TelegramControlChannel" + ], + "resolved_entity_candidates": [], + "query_anchor_candidates": [ + "TelegramControlChannel" + ], + "resolved_anchor_candidates": [ + "docs/documentation/api/control-actions-endpoint.md", + "docs/documentation/logic/telegram-notification-loop.md", + "docs/documentation/architecture/telegram-notify-app-overview.md", + "docs/documentation/api/health-endpoint.md", + "api.control_actions_endpoint", + "architecture.telegram_notify_app", + "docs/README.md", + "domain.runtime_health", + "docs/documentation/domain/runtime-health-entity.md" + ], + "anchor_candidates": [], + "selected_anchor": null, + "anchor_selection_reason": "", + "anchor_match_type": "", + "doc_ids": [ + "api.control_actions_endpoint", + "logic.telegram_notification_loop", + "architecture.telegram_notify_app_overview", + "api.health_endpoint", + "api.actions_endpoint", + "architecture.telegram_notify_app", + "docs/README.md", + "domain.runtime_health" + ], + "doc_paths": [ + "docs/documentation/api/control-actions-endpoint.md", + "docs/documentation/logic/telegram-notification-loop.md", + "docs/documentation/architecture/telegram-notify-app-overview.md", + "docs/documentation/api/health-endpoint.md", + "docs/README.md", + "docs/documentation/domain/runtime-health-entity.md" + ], + "doc_titles": [ + "api.control_actions_endpoint:workflow_step", + "api.control_actions_endpoint:mentions_entity", + "api.control_actions_endpoint:related_logic", + "api.control_actions_endpoint:related_api", + "api.control_actions_endpoint:parent", + "api.control_actions_endpoint:part_of", + "logic.telegram_notification_loop:related_api", + "architecture.telegram_notify_app:related_api", + "architecture.telegram_notify_app:child", + "api.health_endpoint:depends_on", + "HTTP API /actions/{action}", + "Архитектура Telegram Notify App", + "Readme", + "Сущность runtime health", + "api.control_actions_endpoint:Описание", + "api.control_actions_endpoint:Сценарий", + "api.control_actions_endpoint:Summary", + "api.control_actions_endpoint:Функциональные требования" + ], + "relation_hits_count": 2, + "relation_targets": [ + "api.control_actions_endpoint:related_logic", + "api.control_actions_endpoint:related_api" + ], + "selected_doc_ids": [ + "api.control_actions_endpoint" + ], + "selected_fact_ids": [ + "b480201013a7e5231146f665773ebc54af37c28135f407c6b758304c74561645", + "bafb867ffed41c9db637df98d6cd5f6722d7747bbebc6c03e6f0d0caf3b7f9f3" + ], + "selected_relation_ids": [ + "eec79f7a02b804337e791ef231784862ae26e0599eb20224790e9d4f085fa9c0", + "711fb2edb82dd222deaba3c91768b18cbbd453009235823282813c6e867dc2c1" + ], + "selected_chunk_ids": [ + "api.control_actions_endpoint" + ], + "selected_entity_ids": [], + "selected_workflow_ids": [], + "fallback_doc_hits_count": 3, + "fallback_used": false, + "fact_hits": 2, + "entity_hits": 0, + "evidence_summary": { + "documents": 1, + "facts": 2, + "entities": 0, + "workflows": 0, + "relations": 2, + "chunks": 2, + "selected_doc_ids": [ + "api.control_actions_endpoint" + ], + "selected_fact_ids": [ + "b480201013a7e5231146f665773ebc54af37c28135f407c6b758304c74561645", + "bafb867ffed41c9db637df98d6cd5f6722d7747bbebc6c03e6f0d0caf3b7f9f3" + ], + "selected_relation_ids": [ + "eec79f7a02b804337e791ef231784862ae26e0599eb20224790e9d4f085fa9c0", + "711fb2edb82dd222deaba3c91768b18cbbd453009235823282813c6e867dc2c1" + ], + "selected_chunk_ids": [ + "api.control_actions_endpoint" + ], + "entity_hits": 0, + "openapi_signals": { + "path_found": false, + "method_found": false, + "operation_semantics_found": false, + "request_payload_found": false, + "request_schema": false, + "request_fields_found": false, + "response_payload_found": false, + "response_schema": false, + "response_fields_found": false, + "status_codes": false, + "content_type_found": false, + "examples_found": false, + "payload_description": false + } + }, + "gate_decision": "allow", + "gate_decision_reason": "evidence_sufficient", + "gate_missing_requirements": [], + "gate_satisfied_requirements": [ + "retrieval_non_empty" + ], + "openapi_evidence": { + "path_found": false, + "method_found": false, + "operation_semantics_found": false, + "request_payload_found": false, + "request_schema": false, + "request_fields_found": false, + "response_payload_found": false, + "response_schema": false, + "response_fields_found": false, + "status_codes": false, + "content_type_found": false, + "examples_found": false, + "payload_description": false + }, + "requested_fragment_type": null, + "fragment_evidence_found": [], + "fragment_missing_requirements": [], + "answer_mode": "ready", + "degrade_reason": null, + "degraded_reason": null, + "code_intents_stubbed": false +} + +## LLM Request +- prompt_name: docs_explain_answer +- log_context: graph.project_qa.docs.answer + +### Prompt Stats +```json +{ + "system_chars": 393, + "user_chars": 10054, + "tokens_in_estimate": 2612 +} +``` + +### System Prompt +```text +Ты объясняешь документацию системы. + +На вход приходит JSON с полями: +- question +- intent +- sub_intent +- documents +- facts +- relations + +Правила: +- Используй только предоставленные факты +- Не додумывай +- Если данных недостаточно, скажи это явно +- Объясняй структурировано + +Формат ответа: +1. Краткое описание +2. Основные элементы +3. Как это работает +4. Связи с другими частями системы (если есть) +``` + +### User Prompt +```json +{ + "question": "Роль TelegramControlChannel в системе", + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "COMPONENT_EXPLAIN", + "documents": [ + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "HTTP API /actions/{action}", + "content": "Endpoint `/actions/{action}` управляет control actions runtime и поддерживает `start`, `stop` и `status`. Для долгих операций `start` и `stop` допускается ответ HTTP 202, если действие еще выполняется. Endpoint используется для operator-driven управления жизненным циклом worker'а через HTTP API.", + "metadata": { + "name": "control_actions_endpoint", + "tags": [ + "api", + "control-plane", + "lifecycle" + ], + "type": "api_method", + "layer": "application", + "links": [ + { + "type": "part_of", + "target": "architecture.telegram_notify_app" + }, + { + "type": "related_api", + "target": "api.health_endpoint" + }, + { + "type": "related_logic", + "target": "logic.telegram_notification_loop" + } + ], + "owner": null, + "title": "HTTP API /actions/{action}", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "architecture.telegram_notify_app", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "children": [], + "doc_kind": "misc", + "entities": [ + "TelegramControlChannel", + "ControlActionSet", + "JSONResponse" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "api.control_actions_endpoint", + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "summary_text": "Endpoint `/actions/{action}` управляет control actions runtime и поддерживает `start`, `stop` и `status`. Для долгих операций `start` и `stop` допускается ответ HTTP 202, если действие еще выполняется. Endpoint используется для operator-driven управления жизненным циклом worker'а через HTTP API.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + } + ], + "facts": [ + { + "layer": "D2_FACT_INDEX", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "api.control_actions_endpoint:workflow_step", + "content": "api.control_actions_endpoint workflow_step HTTP control plane запущен.", + "metadata": { + "tags": [], + "owner": null, + "anchor": "Сценарий", + "doc_id": null, + "object": "HTTP control plane запущен.", + "fact_id": "b480201013a7e5231146f665773ebc54af37c28135f407c6b758304c74561645", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "predicate": "workflow_step", + "object_ref": null, + "subject_id": "api.control_actions_endpoint", + "doc_version": null, + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D2_FACT_INDEX", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "api.control_actions_endpoint:mentions_entity", + "content": "api.control_actions_endpoint mentions_entity ControlActionSet", + "metadata": { + "tags": [], + "owner": null, + "anchor": "frontmatter.entities", + "doc_id": null, + "object": "ControlActionSet", + "fact_id": "bafb867ffed41c9db637df98d6cd5f6722d7747bbebc6c03e6f0d0caf3b7f9f3", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "predicate": "mentions_entity", + "object_ref": null, + "subject_id": "api.control_actions_endpoint", + "doc_version": null, + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + } + ], + "entities": [], + "workflows": [], + "relations": [ + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "api.control_actions_endpoint:related_logic", + "content": "api.control_actions_endpoint related_logic logic.telegram_notification_loop", + "metadata": { + "owner": null, + "anchor": "frontmatter.links", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "source_id": "api.control_actions_endpoint", + "target_id": "logic.telegram_notification_loop", + "doc_version": null, + "relation_id": "eec79f7a02b804337e791ef231784862ae26e0599eb20224790e9d4f085fa9c0", + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "related_logic", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "api.control_actions_endpoint:related_api", + "content": "api.control_actions_endpoint related_api api.health_endpoint", + "metadata": { + "owner": null, + "anchor": "frontmatter.links", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "source_id": "api.control_actions_endpoint", + "target_id": "api.health_endpoint", + "doc_version": null, + "relation_id": "711fb2edb82dd222deaba3c91768b18cbbd453009235823282813c6e867dc2c1", + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "related_api", + "staleness_score": null, + "system_component": null + } + } + ], + "chunks": [ + { + "layer": "D0_DOC_CHUNKS", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "api.control_actions_endpoint:Описание", + "content": "Метод предоставляет HTTP-доступ к control actions runtime и позволяет запускать, останавливать или проверять состояние управляемых компонентов. Endpoint не реализует lifecycle самостоятельно, а делегирует выполнение в `ControlActionSet`.", + "metadata": { + "tags": [ + "api", + "control-plane", + "lifecycle" + ], + "type": "api_method", + "order": 3, + "owner": null, + "doc_id": null, + "module": "telegram_notify_app", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "doc_kind": "misc", + "doc_version": null, + "document_id": "api.control_actions_endpoint", + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "section_path": "Details > Описание", + "artifact_type": null, + "last_modified": null, + "section_title": "Описание", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D0_DOC_CHUNKS", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "api.control_actions_endpoint:Сценарий", + "content": "**Название:** Выполнение control action runtime\n\n**Предусловия:**\n- HTTP control plane запущен.\n- `ControlActionSet` сконфигурирован в `TelegramControlChannel`.\n- В path передано одно из поддерживаемых действий: `start`, `stop`, `status`.\n\n**Триггер:**\n- Клиент отправляет `GET` или `POST` на `/actions/{action}`.\n\n**Основной сценарий:**\n1. Endpoint принимает запрос и извлекает path parameter `action`.\n2. API определяет источник клиента через `X-Client-Source` или `User-Agent`.\n3. Для `start` и `stop` запрос логируется как control action.\n4. Канал сопоставляет `action` с callback из `ControlActionSet`.\n5. API ожидает завершения callback в пределах допустимого timeout.\n6. При успешном завершении API возвращает JSON со статусом `ok`.\n\n**Альтернативный сценарий:**\n1. Если `start` или `stop` не успевают завершиться в timeout, API возвращает `202 accepted` и сообщает, что операция еще выполняется.\n\n**Обработка ошибок:**\n1. Если actions не сконфигурированы, API возвращает `404`.\n2. Если передано неподдерживаемое действие, API возвращает `404`.\n3. Если callback завершился исключением, API возвращает `500`.\n\n**Постусловие:**\n- Клиент получает результат выполнения control action или признак, что операция еще продолжается.", + "metadata": { + "tags": [ + "api", + "control-plane", + "lifecycle" + ], + "type": "api_method", + "order": 4, + "owner": null, + "doc_id": null, + "module": "telegram_notify_app", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "doc_kind": "misc", + "doc_version": null, + "document_id": "api.control_actions_endpoint", + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "section_path": "Details > Сценарий", + "artifact_type": null, + "last_modified": null, + "section_title": "Сценарий", + "staleness_score": null, + "system_component": null + } + } + ] +} +``` + +### User Prompt Overview +- question: Роль TelegramControlChannel в системе +- intent: DOCUMENTATION_EXPLAIN +- sub_intent: COMPONENT_EXPLAIN +- documents: 1 | samples: HTTP API /actions/{action} +- facts: 2 | samples: api.control_actions_endpoint:workflow_step, api.control_actions_endpoint:mentions_entity +- relations: 2 | samples: api.control_actions_endpoint:related_logic, api.control_actions_endpoint:related_api + +## Mismatches +- none \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/docs_router_llm_disambiguation/20260326_150139/full_chain_docs_intents_v3-3x_v3-component-runtime-manager-1.json b/tests/pipeline_setup_v3/test_results/docs_router_llm_disambiguation/20260326_150139/full_chain_docs_intents_v3-3x_v3-component-runtime-manager-1.json new file mode 100644 index 0000000..17222b5 --- /dev/null +++ b/tests/pipeline_setup_v3/test_results/docs_router_llm_disambiguation/20260326_150139/full_chain_docs_intents_v3-3x_v3-component-runtime-manager-1.json @@ -0,0 +1,92 @@ +{ + "meta": { + "case_id": "v3-component-runtime-manager-1", + "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_03_docs/full_chain_docs_intents_v3-3x.yaml", + "runner": "agent_runtime", + "mode": "pre_llm", + "passed": true, + "mismatches": [], + "actual": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "COMPONENT_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START", + "rag_count": 18, + "llm_answer": "", + "answer_mode": "answered", + "path_scope": [], + "doc_scope": [ + "api.control_actions_endpoint", + "logic.telegram_notification_loop", + "architecture.telegram_notify_app_overview", + "api.health_endpoint", + "api.actions_endpoint", + "architecture.telegram_notify_app", + "docs/README.md", + "domain.runtime_health" + ], + "entity_candidates": [ + "RuntimeManager" + ], + "symbol_candidates": [], + "layers": [ + "D2_FACT_INDEX", + "D5_RELATION_GRAPH", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "filters": { + "doc_type": null + }, + "pipeline_mode": "pre_llm_only", + "gate_decision": "allow", + "prompt_used": "docs_explain_answer", + "llm_mode": "prose", + "degraded_reason": null, + "code_intents_stubbed": true + } + }, + "pipeline_steps": [ + { + "step": "input_query", + "input": { + "query": "Что делает RuntimeManager?" + }, + "output": { + "query": "Что делает RuntimeManager?" + } + }, + { + "step": "router", + "input": { + "query": "Что делает RuntimeManager?" + }, + "output": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "COMPONENT_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START" + } + }, + { + "step": "docs_pipeline", + "input": { + "query": "Что делает RuntimeManager?" + }, + "output": { + "answer_mode": "ready", + "prompt_name": "docs_explain_answer", + "llm_request": { + "prompt_name": "docs_explain_answer", + "log_context": "graph.project_qa.docs.answer", + "prompt_stats": { + "system_chars": 393, + "user_chars": 10043, + "tokens_in_estimate": 2609 + } + }, + "degraded_reason": "" + } + } + ] +} \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/docs_router_llm_disambiguation/20260326_150139/full_chain_docs_intents_v3-3x_v3-component-runtime-manager-1.md b/tests/pipeline_setup_v3/test_results/docs_router_llm_disambiguation/20260326_150139/full_chain_docs_intents_v3-3x_v3-component-runtime-manager-1.md new file mode 100644 index 0000000..f7cffa6 --- /dev/null +++ b/tests/pipeline_setup_v3/test_results/docs_router_llm_disambiguation/20260326_150139/full_chain_docs_intents_v3-3x_v3-component-runtime-manager-1.md @@ -0,0 +1,657 @@ +# v3-component-runtime-manager-1 + +- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_03_docs/full_chain_docs_intents_v3-3x.yaml +- runner: agent_runtime +- mode: pre_llm +- passed: True + +## Query +Что делает RuntimeManager? + +## Actual +{ + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "COMPONENT_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START", + "rag_count": 18, + "llm_answer": "", + "answer_mode": "answered", + "path_scope": [], + "doc_scope": [ + "api.control_actions_endpoint", + "logic.telegram_notification_loop", + "architecture.telegram_notify_app_overview", + "api.health_endpoint", + "api.actions_endpoint", + "architecture.telegram_notify_app", + "docs/README.md", + "domain.runtime_health" + ], + "entity_candidates": [ + "RuntimeManager" + ], + "symbol_candidates": [], + "layers": [ + "D2_FACT_INDEX", + "D5_RELATION_GRAPH", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "filters": { + "doc_type": null + }, + "pipeline_mode": "pre_llm_only", + "gate_decision": "allow", + "prompt_used": "docs_explain_answer", + "llm_mode": "prose", + "degraded_reason": null, + "code_intents_stubbed": true +} + +## Pipeline Steps +### input_query +```json +{ + "input": { + "query": "Что делает RuntimeManager?" + }, + "output": { + "query": "Что делает RuntimeManager?" + } +} +``` + +### router +```json +{ + "input": { + "query": "Что делает RuntimeManager?" + }, + "output": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "COMPONENT_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START" + } +} +``` + +### docs_pipeline +```json +{ + "input": { + "query": "Что делает RuntimeManager?" + }, + "output": { + "answer_mode": "ready", + "prompt_name": "docs_explain_answer", + "llm_request": { + "prompt_name": "docs_explain_answer", + "log_context": "graph.project_qa.docs.answer", + "prompt_stats": { + "system_chars": 393, + "user_chars": 10043, + "tokens_in_estimate": 2609 + } + }, + "degraded_reason": "" + } +} +``` + +## Diagnostics +{ + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "COMPONENT_EXPLAIN", + "layers_used": [ + "D2_FACT_INDEX", + "D5_RELATION_GRAPH", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "documents_found": 1, + "facts_found": 2, + "relations_found": 2, + "openapi_fields_extracted": 0, + "missing_required_fields": [], + "openapi_status": { + "has_path": false, + "has_method": false, + "has_request": false, + "has_response": false + }, + "prompt_used": "docs_explain_answer", + "llm_mode": "prose", + "output_valid": true, + "matched_intent_source": "deterministic", + "matched_anchor_type": "none", + "matched_anchor_value": null, + "exact_anchor_match": false, + "docs_layers_requested": [ + "D2_FACT_INDEX", + "D5_RELATION_GRAPH", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "docs_layers_with_hits": [ + "D2_FACT_INDEX", + "D5_RELATION_GRAPH", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "planned_layers": [ + "D2_FACT_INDEX", + "D5_RELATION_GRAPH", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "executed_layers": [ + "D2_FACT_INDEX", + "D5_RELATION_GRAPH", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "non_empty_layers": [ + "D2_FACT_INDEX", + "D5_RELATION_GRAPH", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "layer_diagnostics": { + "D2_FACT_INDEX": { + "hits": 8, + "top_ids": [ + "b480201013a7e5231146f665773ebc54af37c28135f407c6b758304c74561645", + "b8e44c3adb74aaa6c91ae8815fa091289e58dd3990a3a1b63e850c62075aea75", + "bafb867ffed41c9db637df98d6cd5f6722d7747bbebc6c03e6f0d0caf3b7f9f3", + "54bbcbac242f1c85ec3280236ed5841998a8a3a548ff16cbf0b5acafbff469e3", + "b6bfad59b3bf00f199b5ef90c1208af19664de700413e7354468a93a4abaaa2f" + ], + "top_sections": [ + "api.control_actions_endpoint:workflow_step", + "api.control_actions_endpoint:mentions_entity" + ] + }, + "D5_RELATION_GRAPH": { + "hits": 8, + "top_ids": [ + "eec79f7a02b804337e791ef231784862ae26e0599eb20224790e9d4f085fa9c0", + "711fb2edb82dd222deaba3c91768b18cbbd453009235823282813c6e867dc2c1", + "afec31fd062e392dcd9699a92c7ab61fd4b1273c1a2b16702b23d55d8d0c47ac", + "5f4909bde905cd3d294ad307074a05e4ae4deefcafe6272cd2d0436e73acb8dd", + "921934af8cd7b16572a6cbd3c42011a08d2762f121853cb2458dff348284ac76" + ], + "top_sections": [ + "api.control_actions_endpoint:related_logic", + "api.control_actions_endpoint:related_api", + "api.control_actions_endpoint:parent", + "api.control_actions_endpoint:part_of", + "logic.telegram_notification_loop:related_api" + ] + }, + "D1_DOCUMENT_CATALOG": { + "hits": 4, + "top_ids": [ + "api.control_actions_endpoint", + "architecture.telegram_notify_app", + "docs/README.md", + "domain.runtime_health" + ], + "top_sections": [ + "HTTP API /actions/{action}", + "Архитектура Telegram Notify App", + "Readme", + "Сущность runtime health" + ] + }, + "D0_DOC_CHUNKS": { + "hits": 4, + "top_ids": [ + "api.control_actions_endpoint" + ], + "top_sections": [ + "api.control_actions_endpoint:Описание", + "api.control_actions_endpoint:Сценарий", + "api.control_actions_endpoint:Summary", + "api.control_actions_endpoint:Функциональные требования" + ] + } + }, + "query_entity_candidates": [ + "RuntimeManager" + ], + "resolved_entity_candidates": [], + "query_anchor_candidates": [ + "RuntimeManager" + ], + "resolved_anchor_candidates": [ + "docs/documentation/api/control-actions-endpoint.md", + "docs/documentation/logic/telegram-notification-loop.md", + "docs/documentation/architecture/telegram-notify-app-overview.md", + "docs/documentation/api/health-endpoint.md", + "api.control_actions_endpoint", + "architecture.telegram_notify_app", + "docs/README.md", + "domain.runtime_health", + "docs/documentation/domain/runtime-health-entity.md" + ], + "anchor_candidates": [], + "selected_anchor": null, + "anchor_selection_reason": "", + "anchor_match_type": "", + "doc_ids": [ + "api.control_actions_endpoint", + "logic.telegram_notification_loop", + "architecture.telegram_notify_app_overview", + "api.health_endpoint", + "api.actions_endpoint", + "architecture.telegram_notify_app", + "docs/README.md", + "domain.runtime_health" + ], + "doc_paths": [ + "docs/documentation/api/control-actions-endpoint.md", + "docs/documentation/logic/telegram-notification-loop.md", + "docs/documentation/architecture/telegram-notify-app-overview.md", + "docs/documentation/api/health-endpoint.md", + "docs/README.md", + "docs/documentation/domain/runtime-health-entity.md" + ], + "doc_titles": [ + "api.control_actions_endpoint:workflow_step", + "api.control_actions_endpoint:mentions_entity", + "api.control_actions_endpoint:related_logic", + "api.control_actions_endpoint:related_api", + "api.control_actions_endpoint:parent", + "api.control_actions_endpoint:part_of", + "logic.telegram_notification_loop:related_api", + "architecture.telegram_notify_app:related_api", + "architecture.telegram_notify_app:child", + "api.health_endpoint:depends_on", + "HTTP API /actions/{action}", + "Архитектура Telegram Notify App", + "Readme", + "Сущность runtime health", + "api.control_actions_endpoint:Описание", + "api.control_actions_endpoint:Сценарий", + "api.control_actions_endpoint:Summary", + "api.control_actions_endpoint:Функциональные требования" + ], + "relation_hits_count": 2, + "relation_targets": [ + "api.control_actions_endpoint:related_logic", + "api.control_actions_endpoint:related_api" + ], + "selected_doc_ids": [ + "api.control_actions_endpoint" + ], + "selected_fact_ids": [ + "b480201013a7e5231146f665773ebc54af37c28135f407c6b758304c74561645", + "bafb867ffed41c9db637df98d6cd5f6722d7747bbebc6c03e6f0d0caf3b7f9f3" + ], + "selected_relation_ids": [ + "eec79f7a02b804337e791ef231784862ae26e0599eb20224790e9d4f085fa9c0", + "711fb2edb82dd222deaba3c91768b18cbbd453009235823282813c6e867dc2c1" + ], + "selected_chunk_ids": [ + "api.control_actions_endpoint" + ], + "selected_entity_ids": [], + "selected_workflow_ids": [], + "fallback_doc_hits_count": 3, + "fallback_used": false, + "fact_hits": 2, + "entity_hits": 0, + "evidence_summary": { + "documents": 1, + "facts": 2, + "entities": 0, + "workflows": 0, + "relations": 2, + "chunks": 2, + "selected_doc_ids": [ + "api.control_actions_endpoint" + ], + "selected_fact_ids": [ + "b480201013a7e5231146f665773ebc54af37c28135f407c6b758304c74561645", + "bafb867ffed41c9db637df98d6cd5f6722d7747bbebc6c03e6f0d0caf3b7f9f3" + ], + "selected_relation_ids": [ + "eec79f7a02b804337e791ef231784862ae26e0599eb20224790e9d4f085fa9c0", + "711fb2edb82dd222deaba3c91768b18cbbd453009235823282813c6e867dc2c1" + ], + "selected_chunk_ids": [ + "api.control_actions_endpoint" + ], + "entity_hits": 0, + "openapi_signals": { + "path_found": false, + "method_found": false, + "operation_semantics_found": false, + "request_payload_found": false, + "request_schema": false, + "request_fields_found": false, + "response_payload_found": false, + "response_schema": false, + "response_fields_found": false, + "status_codes": false, + "content_type_found": false, + "examples_found": false, + "payload_description": false + } + }, + "gate_decision": "allow", + "gate_decision_reason": "evidence_sufficient", + "gate_missing_requirements": [], + "gate_satisfied_requirements": [ + "retrieval_non_empty" + ], + "openapi_evidence": { + "path_found": false, + "method_found": false, + "operation_semantics_found": false, + "request_payload_found": false, + "request_schema": false, + "request_fields_found": false, + "response_payload_found": false, + "response_schema": false, + "response_fields_found": false, + "status_codes": false, + "content_type_found": false, + "examples_found": false, + "payload_description": false + }, + "requested_fragment_type": null, + "fragment_evidence_found": [], + "fragment_missing_requirements": [], + "answer_mode": "ready", + "degrade_reason": null, + "degraded_reason": null, + "code_intents_stubbed": false +} + +## LLM Request +- prompt_name: docs_explain_answer +- log_context: graph.project_qa.docs.answer + +### Prompt Stats +```json +{ + "system_chars": 393, + "user_chars": 10043, + "tokens_in_estimate": 2609 +} +``` + +### System Prompt +```text +Ты объясняешь документацию системы. + +На вход приходит JSON с полями: +- question +- intent +- sub_intent +- documents +- facts +- relations + +Правила: +- Используй только предоставленные факты +- Не додумывай +- Если данных недостаточно, скажи это явно +- Объясняй структурировано + +Формат ответа: +1. Краткое описание +2. Основные элементы +3. Как это работает +4. Связи с другими частями системы (если есть) +``` + +### User Prompt +```json +{ + "question": "Что делает RuntimeManager?", + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "COMPONENT_EXPLAIN", + "documents": [ + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "HTTP API /actions/{action}", + "content": "Endpoint `/actions/{action}` управляет control actions runtime и поддерживает `start`, `stop` и `status`. Для долгих операций `start` и `stop` допускается ответ HTTP 202, если действие еще выполняется. Endpoint используется для operator-driven управления жизненным циклом worker'а через HTTP API.", + "metadata": { + "name": "control_actions_endpoint", + "tags": [ + "api", + "control-plane", + "lifecycle" + ], + "type": "api_method", + "layer": "application", + "links": [ + { + "type": "part_of", + "target": "architecture.telegram_notify_app" + }, + { + "type": "related_api", + "target": "api.health_endpoint" + }, + { + "type": "related_logic", + "target": "logic.telegram_notification_loop" + } + ], + "owner": null, + "title": "HTTP API /actions/{action}", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "architecture.telegram_notify_app", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "children": [], + "doc_kind": "misc", + "entities": [ + "TelegramControlChannel", + "ControlActionSet", + "JSONResponse" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "api.control_actions_endpoint", + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "summary_text": "Endpoint `/actions/{action}` управляет control actions runtime и поддерживает `start`, `stop` и `status`. Для долгих операций `start` и `stop` допускается ответ HTTP 202, если действие еще выполняется. Endpoint используется для operator-driven управления жизненным циклом worker'а через HTTP API.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + } + ], + "facts": [ + { + "layer": "D2_FACT_INDEX", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "api.control_actions_endpoint:workflow_step", + "content": "api.control_actions_endpoint workflow_step HTTP control plane запущен.", + "metadata": { + "tags": [], + "owner": null, + "anchor": "Сценарий", + "doc_id": null, + "object": "HTTP control plane запущен.", + "fact_id": "b480201013a7e5231146f665773ebc54af37c28135f407c6b758304c74561645", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "predicate": "workflow_step", + "object_ref": null, + "subject_id": "api.control_actions_endpoint", + "doc_version": null, + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D2_FACT_INDEX", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "api.control_actions_endpoint:mentions_entity", + "content": "api.control_actions_endpoint mentions_entity ControlActionSet", + "metadata": { + "tags": [], + "owner": null, + "anchor": "frontmatter.entities", + "doc_id": null, + "object": "ControlActionSet", + "fact_id": "bafb867ffed41c9db637df98d6cd5f6722d7747bbebc6c03e6f0d0caf3b7f9f3", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "predicate": "mentions_entity", + "object_ref": null, + "subject_id": "api.control_actions_endpoint", + "doc_version": null, + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + } + ], + "entities": [], + "workflows": [], + "relations": [ + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "api.control_actions_endpoint:related_logic", + "content": "api.control_actions_endpoint related_logic logic.telegram_notification_loop", + "metadata": { + "owner": null, + "anchor": "frontmatter.links", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "source_id": "api.control_actions_endpoint", + "target_id": "logic.telegram_notification_loop", + "doc_version": null, + "relation_id": "eec79f7a02b804337e791ef231784862ae26e0599eb20224790e9d4f085fa9c0", + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "related_logic", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "api.control_actions_endpoint:related_api", + "content": "api.control_actions_endpoint related_api api.health_endpoint", + "metadata": { + "owner": null, + "anchor": "frontmatter.links", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "source_id": "api.control_actions_endpoint", + "target_id": "api.health_endpoint", + "doc_version": null, + "relation_id": "711fb2edb82dd222deaba3c91768b18cbbd453009235823282813c6e867dc2c1", + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "related_api", + "staleness_score": null, + "system_component": null + } + } + ], + "chunks": [ + { + "layer": "D0_DOC_CHUNKS", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "api.control_actions_endpoint:Описание", + "content": "Метод предоставляет HTTP-доступ к control actions runtime и позволяет запускать, останавливать или проверять состояние управляемых компонентов. Endpoint не реализует lifecycle самостоятельно, а делегирует выполнение в `ControlActionSet`.", + "metadata": { + "tags": [ + "api", + "control-plane", + "lifecycle" + ], + "type": "api_method", + "order": 3, + "owner": null, + "doc_id": null, + "module": "telegram_notify_app", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "doc_kind": "misc", + "doc_version": null, + "document_id": "api.control_actions_endpoint", + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "section_path": "Details > Описание", + "artifact_type": null, + "last_modified": null, + "section_title": "Описание", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D0_DOC_CHUNKS", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "api.control_actions_endpoint:Сценарий", + "content": "**Название:** Выполнение control action runtime\n\n**Предусловия:**\n- HTTP control plane запущен.\n- `ControlActionSet` сконфигурирован в `TelegramControlChannel`.\n- В path передано одно из поддерживаемых действий: `start`, `stop`, `status`.\n\n**Триггер:**\n- Клиент отправляет `GET` или `POST` на `/actions/{action}`.\n\n**Основной сценарий:**\n1. Endpoint принимает запрос и извлекает path parameter `action`.\n2. API определяет источник клиента через `X-Client-Source` или `User-Agent`.\n3. Для `start` и `stop` запрос логируется как control action.\n4. Канал сопоставляет `action` с callback из `ControlActionSet`.\n5. API ожидает завершения callback в пределах допустимого timeout.\n6. При успешном завершении API возвращает JSON со статусом `ok`.\n\n**Альтернативный сценарий:**\n1. Если `start` или `stop` не успевают завершиться в timeout, API возвращает `202 accepted` и сообщает, что операция еще выполняется.\n\n**Обработка ошибок:**\n1. Если actions не сконфигурированы, API возвращает `404`.\n2. Если передано неподдерживаемое действие, API возвращает `404`.\n3. Если callback завершился исключением, API возвращает `500`.\n\n**Постусловие:**\n- Клиент получает результат выполнения control action или признак, что операция еще продолжается.", + "metadata": { + "tags": [ + "api", + "control-plane", + "lifecycle" + ], + "type": "api_method", + "order": 4, + "owner": null, + "doc_id": null, + "module": "telegram_notify_app", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "doc_kind": "misc", + "doc_version": null, + "document_id": "api.control_actions_endpoint", + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "section_path": "Details > Сценарий", + "artifact_type": null, + "last_modified": null, + "section_title": "Сценарий", + "staleness_score": null, + "system_component": null + } + } + ] +} +``` + +### User Prompt Overview +- question: Что делает RuntimeManager? +- intent: DOCUMENTATION_EXPLAIN +- sub_intent: COMPONENT_EXPLAIN +- documents: 1 | samples: HTTP API /actions/{action} +- facts: 2 | samples: api.control_actions_endpoint:workflow_step, api.control_actions_endpoint:mentions_entity +- relations: 2 | samples: api.control_actions_endpoint:related_logic, api.control_actions_endpoint:related_api + +## Mismatches +- none \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/docs_router_llm_disambiguation/20260326_150139/full_chain_docs_intents_v3-3x_v3-component-runtime-manager-2.json b/tests/pipeline_setup_v3/test_results/docs_router_llm_disambiguation/20260326_150139/full_chain_docs_intents_v3-3x_v3-component-runtime-manager-2.json new file mode 100644 index 0000000..dd780b9 --- /dev/null +++ b/tests/pipeline_setup_v3/test_results/docs_router_llm_disambiguation/20260326_150139/full_chain_docs_intents_v3-3x_v3-component-runtime-manager-2.json @@ -0,0 +1,92 @@ +{ + "meta": { + "case_id": "v3-component-runtime-manager-2", + "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_03_docs/full_chain_docs_intents_v3-3x.yaml", + "runner": "agent_runtime", + "mode": "pre_llm", + "passed": true, + "mismatches": [], + "actual": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "COMPONENT_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START", + "rag_count": 18, + "llm_answer": "", + "answer_mode": "answered", + "path_scope": [], + "doc_scope": [ + "api.control_actions_endpoint", + "logic.telegram_notification_loop", + "architecture.telegram_notify_app_overview", + "api.health_endpoint", + "api.actions_endpoint", + "architecture.telegram_notify_app", + "docs/README.md", + "domain.runtime_health" + ], + "entity_candidates": [ + "RuntimeManager" + ], + "symbol_candidates": [], + "layers": [ + "D2_FACT_INDEX", + "D5_RELATION_GRAPH", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "filters": { + "doc_type": null + }, + "pipeline_mode": "pre_llm_only", + "gate_decision": "allow", + "prompt_used": "docs_explain_answer", + "llm_mode": "prose", + "degraded_reason": null, + "code_intents_stubbed": true + } + }, + "pipeline_steps": [ + { + "step": "input_query", + "input": { + "query": "Как устроен RuntimeManager?" + }, + "output": { + "query": "Как устроен RuntimeManager?" + } + }, + { + "step": "router", + "input": { + "query": "Как устроен RuntimeManager?" + }, + "output": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "COMPONENT_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START" + } + }, + { + "step": "docs_pipeline", + "input": { + "query": "Как устроен RuntimeManager?" + }, + "output": { + "answer_mode": "ready", + "prompt_name": "docs_explain_answer", + "llm_request": { + "prompt_name": "docs_explain_answer", + "log_context": "graph.project_qa.docs.answer", + "prompt_stats": { + "system_chars": 393, + "user_chars": 10044, + "tokens_in_estimate": 2610 + } + }, + "degraded_reason": "" + } + } + ] +} \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/docs_router_llm_disambiguation/20260326_150139/full_chain_docs_intents_v3-3x_v3-component-runtime-manager-2.md b/tests/pipeline_setup_v3/test_results/docs_router_llm_disambiguation/20260326_150139/full_chain_docs_intents_v3-3x_v3-component-runtime-manager-2.md new file mode 100644 index 0000000..fcb3b77 --- /dev/null +++ b/tests/pipeline_setup_v3/test_results/docs_router_llm_disambiguation/20260326_150139/full_chain_docs_intents_v3-3x_v3-component-runtime-manager-2.md @@ -0,0 +1,657 @@ +# v3-component-runtime-manager-2 + +- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_03_docs/full_chain_docs_intents_v3-3x.yaml +- runner: agent_runtime +- mode: pre_llm +- passed: True + +## Query +Как устроен RuntimeManager? + +## Actual +{ + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "COMPONENT_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START", + "rag_count": 18, + "llm_answer": "", + "answer_mode": "answered", + "path_scope": [], + "doc_scope": [ + "api.control_actions_endpoint", + "logic.telegram_notification_loop", + "architecture.telegram_notify_app_overview", + "api.health_endpoint", + "api.actions_endpoint", + "architecture.telegram_notify_app", + "docs/README.md", + "domain.runtime_health" + ], + "entity_candidates": [ + "RuntimeManager" + ], + "symbol_candidates": [], + "layers": [ + "D2_FACT_INDEX", + "D5_RELATION_GRAPH", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "filters": { + "doc_type": null + }, + "pipeline_mode": "pre_llm_only", + "gate_decision": "allow", + "prompt_used": "docs_explain_answer", + "llm_mode": "prose", + "degraded_reason": null, + "code_intents_stubbed": true +} + +## Pipeline Steps +### input_query +```json +{ + "input": { + "query": "Как устроен RuntimeManager?" + }, + "output": { + "query": "Как устроен RuntimeManager?" + } +} +``` + +### router +```json +{ + "input": { + "query": "Как устроен RuntimeManager?" + }, + "output": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "COMPONENT_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START" + } +} +``` + +### docs_pipeline +```json +{ + "input": { + "query": "Как устроен RuntimeManager?" + }, + "output": { + "answer_mode": "ready", + "prompt_name": "docs_explain_answer", + "llm_request": { + "prompt_name": "docs_explain_answer", + "log_context": "graph.project_qa.docs.answer", + "prompt_stats": { + "system_chars": 393, + "user_chars": 10044, + "tokens_in_estimate": 2610 + } + }, + "degraded_reason": "" + } +} +``` + +## Diagnostics +{ + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "COMPONENT_EXPLAIN", + "layers_used": [ + "D2_FACT_INDEX", + "D5_RELATION_GRAPH", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "documents_found": 1, + "facts_found": 2, + "relations_found": 2, + "openapi_fields_extracted": 0, + "missing_required_fields": [], + "openapi_status": { + "has_path": false, + "has_method": false, + "has_request": false, + "has_response": false + }, + "prompt_used": "docs_explain_answer", + "llm_mode": "prose", + "output_valid": true, + "matched_intent_source": "llm", + "matched_anchor_type": "none", + "matched_anchor_value": null, + "exact_anchor_match": false, + "docs_layers_requested": [ + "D2_FACT_INDEX", + "D5_RELATION_GRAPH", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "docs_layers_with_hits": [ + "D2_FACT_INDEX", + "D5_RELATION_GRAPH", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "planned_layers": [ + "D2_FACT_INDEX", + "D5_RELATION_GRAPH", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "executed_layers": [ + "D2_FACT_INDEX", + "D5_RELATION_GRAPH", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "non_empty_layers": [ + "D2_FACT_INDEX", + "D5_RELATION_GRAPH", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "layer_diagnostics": { + "D2_FACT_INDEX": { + "hits": 8, + "top_ids": [ + "b480201013a7e5231146f665773ebc54af37c28135f407c6b758304c74561645", + "b8e44c3adb74aaa6c91ae8815fa091289e58dd3990a3a1b63e850c62075aea75", + "bafb867ffed41c9db637df98d6cd5f6722d7747bbebc6c03e6f0d0caf3b7f9f3", + "54bbcbac242f1c85ec3280236ed5841998a8a3a548ff16cbf0b5acafbff469e3", + "b6bfad59b3bf00f199b5ef90c1208af19664de700413e7354468a93a4abaaa2f" + ], + "top_sections": [ + "api.control_actions_endpoint:workflow_step", + "api.control_actions_endpoint:mentions_entity" + ] + }, + "D5_RELATION_GRAPH": { + "hits": 8, + "top_ids": [ + "eec79f7a02b804337e791ef231784862ae26e0599eb20224790e9d4f085fa9c0", + "711fb2edb82dd222deaba3c91768b18cbbd453009235823282813c6e867dc2c1", + "afec31fd062e392dcd9699a92c7ab61fd4b1273c1a2b16702b23d55d8d0c47ac", + "5f4909bde905cd3d294ad307074a05e4ae4deefcafe6272cd2d0436e73acb8dd", + "921934af8cd7b16572a6cbd3c42011a08d2762f121853cb2458dff348284ac76" + ], + "top_sections": [ + "api.control_actions_endpoint:related_logic", + "api.control_actions_endpoint:related_api", + "api.control_actions_endpoint:parent", + "api.control_actions_endpoint:part_of", + "logic.telegram_notification_loop:related_api" + ] + }, + "D1_DOCUMENT_CATALOG": { + "hits": 4, + "top_ids": [ + "api.control_actions_endpoint", + "architecture.telegram_notify_app", + "docs/README.md", + "domain.runtime_health" + ], + "top_sections": [ + "HTTP API /actions/{action}", + "Архитектура Telegram Notify App", + "Readme", + "Сущность runtime health" + ] + }, + "D0_DOC_CHUNKS": { + "hits": 4, + "top_ids": [ + "api.control_actions_endpoint" + ], + "top_sections": [ + "api.control_actions_endpoint:Описание", + "api.control_actions_endpoint:Сценарий", + "api.control_actions_endpoint:Summary", + "api.control_actions_endpoint:Функциональные требования" + ] + } + }, + "query_entity_candidates": [ + "RuntimeManager" + ], + "resolved_entity_candidates": [], + "query_anchor_candidates": [ + "RuntimeManager" + ], + "resolved_anchor_candidates": [ + "docs/documentation/api/control-actions-endpoint.md", + "docs/documentation/logic/telegram-notification-loop.md", + "docs/documentation/architecture/telegram-notify-app-overview.md", + "docs/documentation/api/health-endpoint.md", + "api.control_actions_endpoint", + "architecture.telegram_notify_app", + "docs/README.md", + "domain.runtime_health", + "docs/documentation/domain/runtime-health-entity.md" + ], + "anchor_candidates": [], + "selected_anchor": null, + "anchor_selection_reason": "", + "anchor_match_type": "", + "doc_ids": [ + "api.control_actions_endpoint", + "logic.telegram_notification_loop", + "architecture.telegram_notify_app_overview", + "api.health_endpoint", + "api.actions_endpoint", + "architecture.telegram_notify_app", + "docs/README.md", + "domain.runtime_health" + ], + "doc_paths": [ + "docs/documentation/api/control-actions-endpoint.md", + "docs/documentation/logic/telegram-notification-loop.md", + "docs/documentation/architecture/telegram-notify-app-overview.md", + "docs/documentation/api/health-endpoint.md", + "docs/README.md", + "docs/documentation/domain/runtime-health-entity.md" + ], + "doc_titles": [ + "api.control_actions_endpoint:workflow_step", + "api.control_actions_endpoint:mentions_entity", + "api.control_actions_endpoint:related_logic", + "api.control_actions_endpoint:related_api", + "api.control_actions_endpoint:parent", + "api.control_actions_endpoint:part_of", + "logic.telegram_notification_loop:related_api", + "architecture.telegram_notify_app:related_api", + "architecture.telegram_notify_app:child", + "api.health_endpoint:depends_on", + "HTTP API /actions/{action}", + "Архитектура Telegram Notify App", + "Readme", + "Сущность runtime health", + "api.control_actions_endpoint:Описание", + "api.control_actions_endpoint:Сценарий", + "api.control_actions_endpoint:Summary", + "api.control_actions_endpoint:Функциональные требования" + ], + "relation_hits_count": 2, + "relation_targets": [ + "api.control_actions_endpoint:related_logic", + "api.control_actions_endpoint:related_api" + ], + "selected_doc_ids": [ + "api.control_actions_endpoint" + ], + "selected_fact_ids": [ + "b480201013a7e5231146f665773ebc54af37c28135f407c6b758304c74561645", + "bafb867ffed41c9db637df98d6cd5f6722d7747bbebc6c03e6f0d0caf3b7f9f3" + ], + "selected_relation_ids": [ + "eec79f7a02b804337e791ef231784862ae26e0599eb20224790e9d4f085fa9c0", + "711fb2edb82dd222deaba3c91768b18cbbd453009235823282813c6e867dc2c1" + ], + "selected_chunk_ids": [ + "api.control_actions_endpoint" + ], + "selected_entity_ids": [], + "selected_workflow_ids": [], + "fallback_doc_hits_count": 3, + "fallback_used": false, + "fact_hits": 2, + "entity_hits": 0, + "evidence_summary": { + "documents": 1, + "facts": 2, + "entities": 0, + "workflows": 0, + "relations": 2, + "chunks": 2, + "selected_doc_ids": [ + "api.control_actions_endpoint" + ], + "selected_fact_ids": [ + "b480201013a7e5231146f665773ebc54af37c28135f407c6b758304c74561645", + "bafb867ffed41c9db637df98d6cd5f6722d7747bbebc6c03e6f0d0caf3b7f9f3" + ], + "selected_relation_ids": [ + "eec79f7a02b804337e791ef231784862ae26e0599eb20224790e9d4f085fa9c0", + "711fb2edb82dd222deaba3c91768b18cbbd453009235823282813c6e867dc2c1" + ], + "selected_chunk_ids": [ + "api.control_actions_endpoint" + ], + "entity_hits": 0, + "openapi_signals": { + "path_found": false, + "method_found": false, + "operation_semantics_found": false, + "request_payload_found": false, + "request_schema": false, + "request_fields_found": false, + "response_payload_found": false, + "response_schema": false, + "response_fields_found": false, + "status_codes": false, + "content_type_found": false, + "examples_found": false, + "payload_description": false + } + }, + "gate_decision": "allow", + "gate_decision_reason": "evidence_sufficient", + "gate_missing_requirements": [], + "gate_satisfied_requirements": [ + "retrieval_non_empty" + ], + "openapi_evidence": { + "path_found": false, + "method_found": false, + "operation_semantics_found": false, + "request_payload_found": false, + "request_schema": false, + "request_fields_found": false, + "response_payload_found": false, + "response_schema": false, + "response_fields_found": false, + "status_codes": false, + "content_type_found": false, + "examples_found": false, + "payload_description": false + }, + "requested_fragment_type": null, + "fragment_evidence_found": [], + "fragment_missing_requirements": [], + "answer_mode": "ready", + "degrade_reason": null, + "degraded_reason": null, + "code_intents_stubbed": false +} + +## LLM Request +- prompt_name: docs_explain_answer +- log_context: graph.project_qa.docs.answer + +### Prompt Stats +```json +{ + "system_chars": 393, + "user_chars": 10044, + "tokens_in_estimate": 2610 +} +``` + +### System Prompt +```text +Ты объясняешь документацию системы. + +На вход приходит JSON с полями: +- question +- intent +- sub_intent +- documents +- facts +- relations + +Правила: +- Используй только предоставленные факты +- Не додумывай +- Если данных недостаточно, скажи это явно +- Объясняй структурировано + +Формат ответа: +1. Краткое описание +2. Основные элементы +3. Как это работает +4. Связи с другими частями системы (если есть) +``` + +### User Prompt +```json +{ + "question": "Как устроен RuntimeManager?", + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "COMPONENT_EXPLAIN", + "documents": [ + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "HTTP API /actions/{action}", + "content": "Endpoint `/actions/{action}` управляет control actions runtime и поддерживает `start`, `stop` и `status`. Для долгих операций `start` и `stop` допускается ответ HTTP 202, если действие еще выполняется. Endpoint используется для operator-driven управления жизненным циклом worker'а через HTTP API.", + "metadata": { + "name": "control_actions_endpoint", + "tags": [ + "api", + "control-plane", + "lifecycle" + ], + "type": "api_method", + "layer": "application", + "links": [ + { + "type": "part_of", + "target": "architecture.telegram_notify_app" + }, + { + "type": "related_api", + "target": "api.health_endpoint" + }, + { + "type": "related_logic", + "target": "logic.telegram_notification_loop" + } + ], + "owner": null, + "title": "HTTP API /actions/{action}", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "architecture.telegram_notify_app", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "children": [], + "doc_kind": "misc", + "entities": [ + "TelegramControlChannel", + "ControlActionSet", + "JSONResponse" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "api.control_actions_endpoint", + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "summary_text": "Endpoint `/actions/{action}` управляет control actions runtime и поддерживает `start`, `stop` и `status`. Для долгих операций `start` и `stop` допускается ответ HTTP 202, если действие еще выполняется. Endpoint используется для operator-driven управления жизненным циклом worker'а через HTTP API.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + } + ], + "facts": [ + { + "layer": "D2_FACT_INDEX", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "api.control_actions_endpoint:workflow_step", + "content": "api.control_actions_endpoint workflow_step HTTP control plane запущен.", + "metadata": { + "tags": [], + "owner": null, + "anchor": "Сценарий", + "doc_id": null, + "object": "HTTP control plane запущен.", + "fact_id": "b480201013a7e5231146f665773ebc54af37c28135f407c6b758304c74561645", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "predicate": "workflow_step", + "object_ref": null, + "subject_id": "api.control_actions_endpoint", + "doc_version": null, + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D2_FACT_INDEX", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "api.control_actions_endpoint:mentions_entity", + "content": "api.control_actions_endpoint mentions_entity ControlActionSet", + "metadata": { + "tags": [], + "owner": null, + "anchor": "frontmatter.entities", + "doc_id": null, + "object": "ControlActionSet", + "fact_id": "bafb867ffed41c9db637df98d6cd5f6722d7747bbebc6c03e6f0d0caf3b7f9f3", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "predicate": "mentions_entity", + "object_ref": null, + "subject_id": "api.control_actions_endpoint", + "doc_version": null, + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + } + ], + "entities": [], + "workflows": [], + "relations": [ + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "api.control_actions_endpoint:related_logic", + "content": "api.control_actions_endpoint related_logic logic.telegram_notification_loop", + "metadata": { + "owner": null, + "anchor": "frontmatter.links", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "source_id": "api.control_actions_endpoint", + "target_id": "logic.telegram_notification_loop", + "doc_version": null, + "relation_id": "eec79f7a02b804337e791ef231784862ae26e0599eb20224790e9d4f085fa9c0", + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "related_logic", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "api.control_actions_endpoint:related_api", + "content": "api.control_actions_endpoint related_api api.health_endpoint", + "metadata": { + "owner": null, + "anchor": "frontmatter.links", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "source_id": "api.control_actions_endpoint", + "target_id": "api.health_endpoint", + "doc_version": null, + "relation_id": "711fb2edb82dd222deaba3c91768b18cbbd453009235823282813c6e867dc2c1", + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "related_api", + "staleness_score": null, + "system_component": null + } + } + ], + "chunks": [ + { + "layer": "D0_DOC_CHUNKS", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "api.control_actions_endpoint:Описание", + "content": "Метод предоставляет HTTP-доступ к control actions runtime и позволяет запускать, останавливать или проверять состояние управляемых компонентов. Endpoint не реализует lifecycle самостоятельно, а делегирует выполнение в `ControlActionSet`.", + "metadata": { + "tags": [ + "api", + "control-plane", + "lifecycle" + ], + "type": "api_method", + "order": 3, + "owner": null, + "doc_id": null, + "module": "telegram_notify_app", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "doc_kind": "misc", + "doc_version": null, + "document_id": "api.control_actions_endpoint", + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "section_path": "Details > Описание", + "artifact_type": null, + "last_modified": null, + "section_title": "Описание", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D0_DOC_CHUNKS", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "api.control_actions_endpoint:Сценарий", + "content": "**Название:** Выполнение control action runtime\n\n**Предусловия:**\n- HTTP control plane запущен.\n- `ControlActionSet` сконфигурирован в `TelegramControlChannel`.\n- В path передано одно из поддерживаемых действий: `start`, `stop`, `status`.\n\n**Триггер:**\n- Клиент отправляет `GET` или `POST` на `/actions/{action}`.\n\n**Основной сценарий:**\n1. Endpoint принимает запрос и извлекает path parameter `action`.\n2. API определяет источник клиента через `X-Client-Source` или `User-Agent`.\n3. Для `start` и `stop` запрос логируется как control action.\n4. Канал сопоставляет `action` с callback из `ControlActionSet`.\n5. API ожидает завершения callback в пределах допустимого timeout.\n6. При успешном завершении API возвращает JSON со статусом `ok`.\n\n**Альтернативный сценарий:**\n1. Если `start` или `stop` не успевают завершиться в timeout, API возвращает `202 accepted` и сообщает, что операция еще выполняется.\n\n**Обработка ошибок:**\n1. Если actions не сконфигурированы, API возвращает `404`.\n2. Если передано неподдерживаемое действие, API возвращает `404`.\n3. Если callback завершился исключением, API возвращает `500`.\n\n**Постусловие:**\n- Клиент получает результат выполнения control action или признак, что операция еще продолжается.", + "metadata": { + "tags": [ + "api", + "control-plane", + "lifecycle" + ], + "type": "api_method", + "order": 4, + "owner": null, + "doc_id": null, + "module": "telegram_notify_app", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "doc_kind": "misc", + "doc_version": null, + "document_id": "api.control_actions_endpoint", + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "section_path": "Details > Сценарий", + "artifact_type": null, + "last_modified": null, + "section_title": "Сценарий", + "staleness_score": null, + "system_component": null + } + } + ] +} +``` + +### User Prompt Overview +- question: Как устроен RuntimeManager? +- intent: DOCUMENTATION_EXPLAIN +- sub_intent: COMPONENT_EXPLAIN +- documents: 1 | samples: HTTP API /actions/{action} +- facts: 2 | samples: api.control_actions_endpoint:workflow_step, api.control_actions_endpoint:mentions_entity +- relations: 2 | samples: api.control_actions_endpoint:related_logic, api.control_actions_endpoint:related_api + +## Mismatches +- none \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/docs_router_llm_disambiguation/20260326_150139/full_chain_docs_intents_v3-3x_v3-component-runtime-manager-3.json b/tests/pipeline_setup_v3/test_results/docs_router_llm_disambiguation/20260326_150139/full_chain_docs_intents_v3-3x_v3-component-runtime-manager-3.json new file mode 100644 index 0000000..687dffc --- /dev/null +++ b/tests/pipeline_setup_v3/test_results/docs_router_llm_disambiguation/20260326_150139/full_chain_docs_intents_v3-3x_v3-component-runtime-manager-3.json @@ -0,0 +1,92 @@ +{ + "meta": { + "case_id": "v3-component-runtime-manager-3", + "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_03_docs/full_chain_docs_intents_v3-3x.yaml", + "runner": "agent_runtime", + "mode": "pre_llm", + "passed": true, + "mismatches": [], + "actual": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "COMPONENT_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START", + "rag_count": 18, + "llm_answer": "", + "answer_mode": "answered", + "path_scope": [], + "doc_scope": [ + "api.control_actions_endpoint", + "logic.telegram_notification_loop", + "architecture.telegram_notify_app_overview", + "api.health_endpoint", + "api.actions_endpoint", + "architecture.telegram_notify_app", + "docs/README.md", + "domain.runtime_health" + ], + "entity_candidates": [ + "RuntimeManager" + ], + "symbol_candidates": [], + "layers": [ + "D2_FACT_INDEX", + "D5_RELATION_GRAPH", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "filters": { + "doc_type": null + }, + "pipeline_mode": "pre_llm_only", + "gate_decision": "allow", + "prompt_used": "docs_explain_answer", + "llm_mode": "prose", + "degraded_reason": null, + "code_intents_stubbed": true + } + }, + "pipeline_steps": [ + { + "step": "input_query", + "input": { + "query": "Опиши компонент RuntimeManager" + }, + "output": { + "query": "Опиши компонент RuntimeManager" + } + }, + { + "step": "router", + "input": { + "query": "Опиши компонент RuntimeManager" + }, + "output": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "COMPONENT_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START" + } + }, + { + "step": "docs_pipeline", + "input": { + "query": "Опиши компонент RuntimeManager" + }, + "output": { + "answer_mode": "ready", + "prompt_name": "docs_explain_answer", + "llm_request": { + "prompt_name": "docs_explain_answer", + "log_context": "graph.project_qa.docs.answer", + "prompt_stats": { + "system_chars": 393, + "user_chars": 10047, + "tokens_in_estimate": 2610 + } + }, + "degraded_reason": "" + } + } + ] +} \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/docs_router_llm_disambiguation/20260326_150139/full_chain_docs_intents_v3-3x_v3-component-runtime-manager-3.md b/tests/pipeline_setup_v3/test_results/docs_router_llm_disambiguation/20260326_150139/full_chain_docs_intents_v3-3x_v3-component-runtime-manager-3.md new file mode 100644 index 0000000..2846e62 --- /dev/null +++ b/tests/pipeline_setup_v3/test_results/docs_router_llm_disambiguation/20260326_150139/full_chain_docs_intents_v3-3x_v3-component-runtime-manager-3.md @@ -0,0 +1,657 @@ +# v3-component-runtime-manager-3 + +- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_03_docs/full_chain_docs_intents_v3-3x.yaml +- runner: agent_runtime +- mode: pre_llm +- passed: True + +## Query +Опиши компонент RuntimeManager + +## Actual +{ + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "COMPONENT_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START", + "rag_count": 18, + "llm_answer": "", + "answer_mode": "answered", + "path_scope": [], + "doc_scope": [ + "api.control_actions_endpoint", + "logic.telegram_notification_loop", + "architecture.telegram_notify_app_overview", + "api.health_endpoint", + "api.actions_endpoint", + "architecture.telegram_notify_app", + "docs/README.md", + "domain.runtime_health" + ], + "entity_candidates": [ + "RuntimeManager" + ], + "symbol_candidates": [], + "layers": [ + "D2_FACT_INDEX", + "D5_RELATION_GRAPH", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "filters": { + "doc_type": null + }, + "pipeline_mode": "pre_llm_only", + "gate_decision": "allow", + "prompt_used": "docs_explain_answer", + "llm_mode": "prose", + "degraded_reason": null, + "code_intents_stubbed": true +} + +## Pipeline Steps +### input_query +```json +{ + "input": { + "query": "Опиши компонент RuntimeManager" + }, + "output": { + "query": "Опиши компонент RuntimeManager" + } +} +``` + +### router +```json +{ + "input": { + "query": "Опиши компонент RuntimeManager" + }, + "output": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "COMPONENT_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START" + } +} +``` + +### docs_pipeline +```json +{ + "input": { + "query": "Опиши компонент RuntimeManager" + }, + "output": { + "answer_mode": "ready", + "prompt_name": "docs_explain_answer", + "llm_request": { + "prompt_name": "docs_explain_answer", + "log_context": "graph.project_qa.docs.answer", + "prompt_stats": { + "system_chars": 393, + "user_chars": 10047, + "tokens_in_estimate": 2610 + } + }, + "degraded_reason": "" + } +} +``` + +## Diagnostics +{ + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "COMPONENT_EXPLAIN", + "layers_used": [ + "D2_FACT_INDEX", + "D5_RELATION_GRAPH", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "documents_found": 1, + "facts_found": 2, + "relations_found": 2, + "openapi_fields_extracted": 0, + "missing_required_fields": [], + "openapi_status": { + "has_path": false, + "has_method": false, + "has_request": false, + "has_response": false + }, + "prompt_used": "docs_explain_answer", + "llm_mode": "prose", + "output_valid": true, + "matched_intent_source": "deterministic", + "matched_anchor_type": "component", + "matched_anchor_value": "RuntimeManager", + "exact_anchor_match": false, + "docs_layers_requested": [ + "D2_FACT_INDEX", + "D5_RELATION_GRAPH", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "docs_layers_with_hits": [ + "D2_FACT_INDEX", + "D5_RELATION_GRAPH", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "planned_layers": [ + "D2_FACT_INDEX", + "D5_RELATION_GRAPH", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "executed_layers": [ + "D2_FACT_INDEX", + "D5_RELATION_GRAPH", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "non_empty_layers": [ + "D2_FACT_INDEX", + "D5_RELATION_GRAPH", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "layer_diagnostics": { + "D2_FACT_INDEX": { + "hits": 8, + "top_ids": [ + "b480201013a7e5231146f665773ebc54af37c28135f407c6b758304c74561645", + "b8e44c3adb74aaa6c91ae8815fa091289e58dd3990a3a1b63e850c62075aea75", + "bafb867ffed41c9db637df98d6cd5f6722d7747bbebc6c03e6f0d0caf3b7f9f3", + "54bbcbac242f1c85ec3280236ed5841998a8a3a548ff16cbf0b5acafbff469e3", + "b6bfad59b3bf00f199b5ef90c1208af19664de700413e7354468a93a4abaaa2f" + ], + "top_sections": [ + "api.control_actions_endpoint:workflow_step", + "api.control_actions_endpoint:mentions_entity" + ] + }, + "D5_RELATION_GRAPH": { + "hits": 8, + "top_ids": [ + "eec79f7a02b804337e791ef231784862ae26e0599eb20224790e9d4f085fa9c0", + "711fb2edb82dd222deaba3c91768b18cbbd453009235823282813c6e867dc2c1", + "afec31fd062e392dcd9699a92c7ab61fd4b1273c1a2b16702b23d55d8d0c47ac", + "5f4909bde905cd3d294ad307074a05e4ae4deefcafe6272cd2d0436e73acb8dd", + "921934af8cd7b16572a6cbd3c42011a08d2762f121853cb2458dff348284ac76" + ], + "top_sections": [ + "api.control_actions_endpoint:related_logic", + "api.control_actions_endpoint:related_api", + "api.control_actions_endpoint:parent", + "api.control_actions_endpoint:part_of", + "logic.telegram_notification_loop:related_api" + ] + }, + "D1_DOCUMENT_CATALOG": { + "hits": 4, + "top_ids": [ + "api.control_actions_endpoint", + "architecture.telegram_notify_app", + "docs/README.md", + "domain.runtime_health" + ], + "top_sections": [ + "HTTP API /actions/{action}", + "Архитектура Telegram Notify App", + "Readme", + "Сущность runtime health" + ] + }, + "D0_DOC_CHUNKS": { + "hits": 4, + "top_ids": [ + "api.control_actions_endpoint" + ], + "top_sections": [ + "api.control_actions_endpoint:Описание", + "api.control_actions_endpoint:Сценарий", + "api.control_actions_endpoint:Summary", + "api.control_actions_endpoint:Функциональные требования" + ] + } + }, + "query_entity_candidates": [ + "RuntimeManager" + ], + "resolved_entity_candidates": [], + "query_anchor_candidates": [ + "RuntimeManager" + ], + "resolved_anchor_candidates": [ + "docs/documentation/api/control-actions-endpoint.md", + "docs/documentation/logic/telegram-notification-loop.md", + "docs/documentation/architecture/telegram-notify-app-overview.md", + "docs/documentation/api/health-endpoint.md", + "api.control_actions_endpoint", + "architecture.telegram_notify_app", + "docs/README.md", + "domain.runtime_health", + "docs/documentation/domain/runtime-health-entity.md" + ], + "anchor_candidates": [], + "selected_anchor": null, + "anchor_selection_reason": "", + "anchor_match_type": "", + "doc_ids": [ + "api.control_actions_endpoint", + "logic.telegram_notification_loop", + "architecture.telegram_notify_app_overview", + "api.health_endpoint", + "api.actions_endpoint", + "architecture.telegram_notify_app", + "docs/README.md", + "domain.runtime_health" + ], + "doc_paths": [ + "docs/documentation/api/control-actions-endpoint.md", + "docs/documentation/logic/telegram-notification-loop.md", + "docs/documentation/architecture/telegram-notify-app-overview.md", + "docs/documentation/api/health-endpoint.md", + "docs/README.md", + "docs/documentation/domain/runtime-health-entity.md" + ], + "doc_titles": [ + "api.control_actions_endpoint:workflow_step", + "api.control_actions_endpoint:mentions_entity", + "api.control_actions_endpoint:related_logic", + "api.control_actions_endpoint:related_api", + "api.control_actions_endpoint:parent", + "api.control_actions_endpoint:part_of", + "logic.telegram_notification_loop:related_api", + "architecture.telegram_notify_app:related_api", + "architecture.telegram_notify_app:child", + "api.health_endpoint:depends_on", + "HTTP API /actions/{action}", + "Архитектура Telegram Notify App", + "Readme", + "Сущность runtime health", + "api.control_actions_endpoint:Описание", + "api.control_actions_endpoint:Сценарий", + "api.control_actions_endpoint:Summary", + "api.control_actions_endpoint:Функциональные требования" + ], + "relation_hits_count": 2, + "relation_targets": [ + "api.control_actions_endpoint:related_logic", + "api.control_actions_endpoint:related_api" + ], + "selected_doc_ids": [ + "api.control_actions_endpoint" + ], + "selected_fact_ids": [ + "b480201013a7e5231146f665773ebc54af37c28135f407c6b758304c74561645", + "bafb867ffed41c9db637df98d6cd5f6722d7747bbebc6c03e6f0d0caf3b7f9f3" + ], + "selected_relation_ids": [ + "eec79f7a02b804337e791ef231784862ae26e0599eb20224790e9d4f085fa9c0", + "711fb2edb82dd222deaba3c91768b18cbbd453009235823282813c6e867dc2c1" + ], + "selected_chunk_ids": [ + "api.control_actions_endpoint" + ], + "selected_entity_ids": [], + "selected_workflow_ids": [], + "fallback_doc_hits_count": 3, + "fallback_used": false, + "fact_hits": 2, + "entity_hits": 0, + "evidence_summary": { + "documents": 1, + "facts": 2, + "entities": 0, + "workflows": 0, + "relations": 2, + "chunks": 2, + "selected_doc_ids": [ + "api.control_actions_endpoint" + ], + "selected_fact_ids": [ + "b480201013a7e5231146f665773ebc54af37c28135f407c6b758304c74561645", + "bafb867ffed41c9db637df98d6cd5f6722d7747bbebc6c03e6f0d0caf3b7f9f3" + ], + "selected_relation_ids": [ + "eec79f7a02b804337e791ef231784862ae26e0599eb20224790e9d4f085fa9c0", + "711fb2edb82dd222deaba3c91768b18cbbd453009235823282813c6e867dc2c1" + ], + "selected_chunk_ids": [ + "api.control_actions_endpoint" + ], + "entity_hits": 0, + "openapi_signals": { + "path_found": false, + "method_found": false, + "operation_semantics_found": false, + "request_payload_found": false, + "request_schema": false, + "request_fields_found": false, + "response_payload_found": false, + "response_schema": false, + "response_fields_found": false, + "status_codes": false, + "content_type_found": false, + "examples_found": false, + "payload_description": false + } + }, + "gate_decision": "allow", + "gate_decision_reason": "evidence_sufficient", + "gate_missing_requirements": [], + "gate_satisfied_requirements": [ + "retrieval_non_empty" + ], + "openapi_evidence": { + "path_found": false, + "method_found": false, + "operation_semantics_found": false, + "request_payload_found": false, + "request_schema": false, + "request_fields_found": false, + "response_payload_found": false, + "response_schema": false, + "response_fields_found": false, + "status_codes": false, + "content_type_found": false, + "examples_found": false, + "payload_description": false + }, + "requested_fragment_type": null, + "fragment_evidence_found": [], + "fragment_missing_requirements": [], + "answer_mode": "ready", + "degrade_reason": null, + "degraded_reason": null, + "code_intents_stubbed": false +} + +## LLM Request +- prompt_name: docs_explain_answer +- log_context: graph.project_qa.docs.answer + +### Prompt Stats +```json +{ + "system_chars": 393, + "user_chars": 10047, + "tokens_in_estimate": 2610 +} +``` + +### System Prompt +```text +Ты объясняешь документацию системы. + +На вход приходит JSON с полями: +- question +- intent +- sub_intent +- documents +- facts +- relations + +Правила: +- Используй только предоставленные факты +- Не додумывай +- Если данных недостаточно, скажи это явно +- Объясняй структурировано + +Формат ответа: +1. Краткое описание +2. Основные элементы +3. Как это работает +4. Связи с другими частями системы (если есть) +``` + +### User Prompt +```json +{ + "question": "Опиши компонент RuntimeManager", + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "COMPONENT_EXPLAIN", + "documents": [ + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "HTTP API /actions/{action}", + "content": "Endpoint `/actions/{action}` управляет control actions runtime и поддерживает `start`, `stop` и `status`. Для долгих операций `start` и `stop` допускается ответ HTTP 202, если действие еще выполняется. Endpoint используется для operator-driven управления жизненным циклом worker'а через HTTP API.", + "metadata": { + "name": "control_actions_endpoint", + "tags": [ + "api", + "control-plane", + "lifecycle" + ], + "type": "api_method", + "layer": "application", + "links": [ + { + "type": "part_of", + "target": "architecture.telegram_notify_app" + }, + { + "type": "related_api", + "target": "api.health_endpoint" + }, + { + "type": "related_logic", + "target": "logic.telegram_notification_loop" + } + ], + "owner": null, + "title": "HTTP API /actions/{action}", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "architecture.telegram_notify_app", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "children": [], + "doc_kind": "misc", + "entities": [ + "TelegramControlChannel", + "ControlActionSet", + "JSONResponse" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "api.control_actions_endpoint", + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "summary_text": "Endpoint `/actions/{action}` управляет control actions runtime и поддерживает `start`, `stop` и `status`. Для долгих операций `start` и `stop` допускается ответ HTTP 202, если действие еще выполняется. Endpoint используется для operator-driven управления жизненным циклом worker'а через HTTP API.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + } + ], + "facts": [ + { + "layer": "D2_FACT_INDEX", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "api.control_actions_endpoint:workflow_step", + "content": "api.control_actions_endpoint workflow_step HTTP control plane запущен.", + "metadata": { + "tags": [], + "owner": null, + "anchor": "Сценарий", + "doc_id": null, + "object": "HTTP control plane запущен.", + "fact_id": "b480201013a7e5231146f665773ebc54af37c28135f407c6b758304c74561645", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "predicate": "workflow_step", + "object_ref": null, + "subject_id": "api.control_actions_endpoint", + "doc_version": null, + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D2_FACT_INDEX", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "api.control_actions_endpoint:mentions_entity", + "content": "api.control_actions_endpoint mentions_entity ControlActionSet", + "metadata": { + "tags": [], + "owner": null, + "anchor": "frontmatter.entities", + "doc_id": null, + "object": "ControlActionSet", + "fact_id": "bafb867ffed41c9db637df98d6cd5f6722d7747bbebc6c03e6f0d0caf3b7f9f3", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "predicate": "mentions_entity", + "object_ref": null, + "subject_id": "api.control_actions_endpoint", + "doc_version": null, + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + } + ], + "entities": [], + "workflows": [], + "relations": [ + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "api.control_actions_endpoint:related_logic", + "content": "api.control_actions_endpoint related_logic logic.telegram_notification_loop", + "metadata": { + "owner": null, + "anchor": "frontmatter.links", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "source_id": "api.control_actions_endpoint", + "target_id": "logic.telegram_notification_loop", + "doc_version": null, + "relation_id": "eec79f7a02b804337e791ef231784862ae26e0599eb20224790e9d4f085fa9c0", + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "related_logic", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "api.control_actions_endpoint:related_api", + "content": "api.control_actions_endpoint related_api api.health_endpoint", + "metadata": { + "owner": null, + "anchor": "frontmatter.links", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "source_id": "api.control_actions_endpoint", + "target_id": "api.health_endpoint", + "doc_version": null, + "relation_id": "711fb2edb82dd222deaba3c91768b18cbbd453009235823282813c6e867dc2c1", + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "related_api", + "staleness_score": null, + "system_component": null + } + } + ], + "chunks": [ + { + "layer": "D0_DOC_CHUNKS", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "api.control_actions_endpoint:Описание", + "content": "Метод предоставляет HTTP-доступ к control actions runtime и позволяет запускать, останавливать или проверять состояние управляемых компонентов. Endpoint не реализует lifecycle самостоятельно, а делегирует выполнение в `ControlActionSet`.", + "metadata": { + "tags": [ + "api", + "control-plane", + "lifecycle" + ], + "type": "api_method", + "order": 3, + "owner": null, + "doc_id": null, + "module": "telegram_notify_app", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "doc_kind": "misc", + "doc_version": null, + "document_id": "api.control_actions_endpoint", + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "section_path": "Details > Описание", + "artifact_type": null, + "last_modified": null, + "section_title": "Описание", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D0_DOC_CHUNKS", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "api.control_actions_endpoint:Сценарий", + "content": "**Название:** Выполнение control action runtime\n\n**Предусловия:**\n- HTTP control plane запущен.\n- `ControlActionSet` сконфигурирован в `TelegramControlChannel`.\n- В path передано одно из поддерживаемых действий: `start`, `stop`, `status`.\n\n**Триггер:**\n- Клиент отправляет `GET` или `POST` на `/actions/{action}`.\n\n**Основной сценарий:**\n1. Endpoint принимает запрос и извлекает path parameter `action`.\n2. API определяет источник клиента через `X-Client-Source` или `User-Agent`.\n3. Для `start` и `stop` запрос логируется как control action.\n4. Канал сопоставляет `action` с callback из `ControlActionSet`.\n5. API ожидает завершения callback в пределах допустимого timeout.\n6. При успешном завершении API возвращает JSON со статусом `ok`.\n\n**Альтернативный сценарий:**\n1. Если `start` или `stop` не успевают завершиться в timeout, API возвращает `202 accepted` и сообщает, что операция еще выполняется.\n\n**Обработка ошибок:**\n1. Если actions не сконфигурированы, API возвращает `404`.\n2. Если передано неподдерживаемое действие, API возвращает `404`.\n3. Если callback завершился исключением, API возвращает `500`.\n\n**Постусловие:**\n- Клиент получает результат выполнения control action или признак, что операция еще продолжается.", + "metadata": { + "tags": [ + "api", + "control-plane", + "lifecycle" + ], + "type": "api_method", + "order": 4, + "owner": null, + "doc_id": null, + "module": "telegram_notify_app", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "doc_kind": "misc", + "doc_version": null, + "document_id": "api.control_actions_endpoint", + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "section_path": "Details > Сценарий", + "artifact_type": null, + "last_modified": null, + "section_title": "Сценарий", + "staleness_score": null, + "system_component": null + } + } + ] +} +``` + +### User Prompt Overview +- question: Опиши компонент RuntimeManager +- intent: DOCUMENTATION_EXPLAIN +- sub_intent: COMPONENT_EXPLAIN +- documents: 1 | samples: HTTP API /actions/{action} +- facts: 2 | samples: api.control_actions_endpoint:workflow_step, api.control_actions_endpoint:mentions_entity +- relations: 2 | samples: api.control_actions_endpoint:related_logic, api.control_actions_endpoint:related_api + +## Mismatches +- none \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/docs_router_llm_disambiguation/20260326_150139/full_chain_docs_intents_v3-3x_v3-entity-runtime-health-1.json b/tests/pipeline_setup_v3/test_results/docs_router_llm_disambiguation/20260326_150139/full_chain_docs_intents_v3-3x_v3-entity-runtime-health-1.json new file mode 100644 index 0000000..b63ce65 --- /dev/null +++ b/tests/pipeline_setup_v3/test_results/docs_router_llm_disambiguation/20260326_150139/full_chain_docs_intents_v3-3x_v3-entity-runtime-health-1.json @@ -0,0 +1,91 @@ +{ + "meta": { + "case_id": "v3-entity-runtime-health-1", + "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_03_docs/full_chain_docs_intents_v3-3x.yaml", + "runner": "agent_runtime", + "mode": "pre_llm", + "passed": true, + "mismatches": [], + "actual": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "ENTITY_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START", + "rag_count": 24, + "llm_answer": "", + "answer_mode": "answered", + "path_scope": [], + "doc_scope": [ + "api.health_endpoint", + "architecture.telegram_notify_app", + "architecture.telegram_notify_app_overview", + "domain.runtime_health", + "api.control_actions_endpoint", + "logic.telegram_notification_loop", + "api.actions_endpoint" + ], + "entity_candidates": [ + "runtime health" + ], + "symbol_candidates": [], + "layers": [ + "D3_ENTITY_CATALOG", + "D5_RELATION_GRAPH", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "filters": { + "doc_type": null + }, + "pipeline_mode": "pre_llm_only", + "gate_decision": "allow", + "prompt_used": "docs_explain_answer", + "llm_mode": "prose", + "degraded_reason": null, + "code_intents_stubbed": true + } + }, + "pipeline_steps": [ + { + "step": "input_query", + "input": { + "query": "Что такое runtime health?" + }, + "output": { + "query": "Что такое runtime health?" + } + }, + { + "step": "router", + "input": { + "query": "Что такое runtime health?" + }, + "output": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "ENTITY_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START" + } + }, + { + "step": "docs_pipeline", + "input": { + "query": "Что такое runtime health?" + }, + "output": { + "answer_mode": "ready", + "prompt_name": "docs_explain_answer", + "llm_request": { + "prompt_name": "docs_explain_answer", + "log_context": "graph.project_qa.docs.answer", + "prompt_stats": { + "system_chars": 393, + "user_chars": 7572, + "tokens_in_estimate": 1992 + } + }, + "degraded_reason": "" + } + } + ] +} \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/docs_router_llm_disambiguation/20260326_150139/full_chain_docs_intents_v3-3x_v3-entity-runtime-health-1.md b/tests/pipeline_setup_v3/test_results/docs_router_llm_disambiguation/20260326_150139/full_chain_docs_intents_v3-3x_v3-entity-runtime-health-1.md new file mode 100644 index 0000000..144a811 --- /dev/null +++ b/tests/pipeline_setup_v3/test_results/docs_router_llm_disambiguation/20260326_150139/full_chain_docs_intents_v3-3x_v3-entity-runtime-health-1.md @@ -0,0 +1,631 @@ +# v3-entity-runtime-health-1 + +- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_03_docs/full_chain_docs_intents_v3-3x.yaml +- runner: agent_runtime +- mode: pre_llm +- passed: True + +## Query +Что такое runtime health? + +## Actual +{ + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "ENTITY_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START", + "rag_count": 24, + "llm_answer": "", + "answer_mode": "answered", + "path_scope": [], + "doc_scope": [ + "api.health_endpoint", + "architecture.telegram_notify_app", + "architecture.telegram_notify_app_overview", + "domain.runtime_health", + "api.control_actions_endpoint", + "logic.telegram_notification_loop", + "api.actions_endpoint" + ], + "entity_candidates": [ + "runtime health" + ], + "symbol_candidates": [], + "layers": [ + "D3_ENTITY_CATALOG", + "D5_RELATION_GRAPH", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "filters": { + "doc_type": null + }, + "pipeline_mode": "pre_llm_only", + "gate_decision": "allow", + "prompt_used": "docs_explain_answer", + "llm_mode": "prose", + "degraded_reason": null, + "code_intents_stubbed": true +} + +## Pipeline Steps +### input_query +```json +{ + "input": { + "query": "Что такое runtime health?" + }, + "output": { + "query": "Что такое runtime health?" + } +} +``` + +### router +```json +{ + "input": { + "query": "Что такое runtime health?" + }, + "output": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "ENTITY_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START" + } +} +``` + +### docs_pipeline +```json +{ + "input": { + "query": "Что такое runtime health?" + }, + "output": { + "answer_mode": "ready", + "prompt_name": "docs_explain_answer", + "llm_request": { + "prompt_name": "docs_explain_answer", + "log_context": "graph.project_qa.docs.answer", + "prompt_stats": { + "system_chars": 393, + "user_chars": 7572, + "tokens_in_estimate": 1992 + } + }, + "degraded_reason": "" + } +} +``` + +## Diagnostics +{ + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "ENTITY_EXPLAIN", + "layers_used": [ + "D3_ENTITY_CATALOG", + "D5_RELATION_GRAPH", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "documents_found": 1, + "facts_found": 0, + "relations_found": 2, + "openapi_fields_extracted": 0, + "missing_required_fields": [], + "openapi_status": { + "has_path": false, + "has_method": false, + "has_request": false, + "has_response": false + }, + "prompt_used": "docs_explain_answer", + "llm_mode": "prose", + "output_valid": true, + "matched_intent_source": "deterministic", + "matched_anchor_type": "none", + "matched_anchor_value": null, + "exact_anchor_match": false, + "docs_layers_requested": [ + "D3_ENTITY_CATALOG", + "D5_RELATION_GRAPH", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "docs_layers_with_hits": [ + "D3_ENTITY_CATALOG", + "D5_RELATION_GRAPH", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "planned_layers": [ + "D3_ENTITY_CATALOG", + "D5_RELATION_GRAPH", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "executed_layers": [ + "D3_ENTITY_CATALOG", + "D5_RELATION_GRAPH", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "non_empty_layers": [ + "D3_ENTITY_CATALOG", + "D5_RELATION_GRAPH", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "layer_diagnostics": { + "D3_ENTITY_CATALOG": { + "hits": 8, + "top_ids": [ + "api.health_endpoint", + "architecture.telegram_notify_app", + "domain.runtime_health" + ], + "top_sections": [ + "RuntimeManager", + "WorkerStatus", + "TelegramNotifyWorker", + "TelegramControlChannel" + ] + }, + "D5_RELATION_GRAPH": { + "hits": 8, + "top_ids": [ + "801650f8bcbfbfbefd35c14447bfef7b3c3827313db790efa7faf47db860f8c4", + "8595d7b82fecdb7ef579fa8961cda6799bb21970061e5bc221d4dd7a3d53fd04", + "af2a4f7c1b677b908410ba720915405e10dbd0870e30a3c6e3aa2468550ddf0e", + "c718b1939621233295ccaf6e8203e7fd94f3dd1bfb88f10c51bc5e33d53a24aa", + "616f5cbf25da83cb51d8d0741a7fc351620c9ca2c6513fa2094b4aa476f0912a" + ], + "top_sections": [ + "domain.runtime_health:used_by", + "domain.runtime_health:related_logic", + "domain.runtime_health:part_of", + "api.health_endpoint:parent", + "api.health_endpoint:part_of" + ] + }, + "D1_DOCUMENT_CATALOG": { + "hits": 4, + "top_ids": [ + "domain.runtime_health", + "api.health_endpoint", + "logic.telegram_notification_loop", + "api.control_actions_endpoint" + ], + "top_sections": [ + "Сущность runtime health", + "HTTP API /health", + "Цикл отправки уведомлений в Telegram", + "HTTP API /actions/{action}" + ] + }, + "D0_DOC_CHUNKS": { + "hits": 4, + "top_ids": [ + "api.health_endpoint" + ], + "top_sections": [ + "api.health_endpoint:Описание", + "api.health_endpoint:Сценарий", + "api.health_endpoint:Summary", + "api.health_endpoint:Функциональные требования" + ] + } + }, + "query_entity_candidates": [ + "runtime health" + ], + "resolved_entity_candidates": [], + "query_anchor_candidates": [], + "resolved_anchor_candidates": [ + "api.health_endpoint", + "docs/documentation/api/health-endpoint.md", + "architecture.telegram_notify_app", + "docs/documentation/architecture/telegram-notify-app-overview.md", + "domain.runtime_health", + "docs/documentation/domain/runtime-health-entity.md", + "docs/documentation/api/control-actions-endpoint.md", + "logic.telegram_notification_loop", + "docs/documentation/logic/telegram-notification-loop.md", + "api.control_actions_endpoint" + ], + "anchor_candidates": [], + "selected_anchor": null, + "anchor_selection_reason": "", + "anchor_match_type": "", + "doc_ids": [ + "api.health_endpoint", + "architecture.telegram_notify_app", + "architecture.telegram_notify_app_overview", + "domain.runtime_health", + "api.control_actions_endpoint", + "logic.telegram_notification_loop", + "api.actions_endpoint" + ], + "doc_paths": [ + "docs/documentation/api/health-endpoint.md", + "docs/documentation/architecture/telegram-notify-app-overview.md", + "docs/documentation/domain/runtime-health-entity.md", + "docs/documentation/api/control-actions-endpoint.md", + "docs/documentation/logic/telegram-notification-loop.md" + ], + "doc_titles": [ + "RuntimeManager", + "WorkerStatus", + "TelegramNotifyWorker", + "TelegramControlChannel", + "WorkerHealth", + "domain.runtime_health:used_by", + "domain.runtime_health:related_logic", + "domain.runtime_health:part_of", + "api.health_endpoint:parent", + "api.health_endpoint:part_of", + "api.health_endpoint:depends_on", + "domain.runtime_health:parent", + "api.control_actions_endpoint:related_api", + "Сущность runtime health", + "HTTP API /health", + "Цикл отправки уведомлений в Telegram", + "HTTP API /actions/{action}", + "api.health_endpoint:Описание", + "api.health_endpoint:Сценарий", + "api.health_endpoint:Summary", + "api.health_endpoint:Функциональные требования" + ], + "relation_hits_count": 2, + "relation_targets": [ + "domain.runtime_health:used_by", + "domain.runtime_health:related_logic" + ], + "selected_doc_ids": [ + "domain.runtime_health", + "api.health_endpoint", + "architecture.telegram_notify_app" + ], + "selected_fact_ids": [], + "selected_relation_ids": [ + "801650f8bcbfbfbefd35c14447bfef7b3c3827313db790efa7faf47db860f8c4", + "8595d7b82fecdb7ef579fa8961cda6799bb21970061e5bc221d4dd7a3d53fd04" + ], + "selected_chunk_ids": [ + "api.health_endpoint" + ], + "selected_entity_ids": [ + "api.health_endpoint", + "architecture.telegram_notify_app" + ], + "selected_workflow_ids": [], + "fallback_doc_hits_count": 2, + "fallback_used": false, + "fact_hits": 0, + "entity_hits": 0, + "evidence_summary": { + "documents": 1, + "facts": 0, + "entities": 2, + "workflows": 0, + "relations": 2, + "chunks": 1, + "selected_doc_ids": [ + "domain.runtime_health", + "api.health_endpoint", + "architecture.telegram_notify_app" + ], + "selected_fact_ids": [], + "selected_relation_ids": [ + "801650f8bcbfbfbefd35c14447bfef7b3c3827313db790efa7faf47db860f8c4", + "8595d7b82fecdb7ef579fa8961cda6799bb21970061e5bc221d4dd7a3d53fd04" + ], + "selected_chunk_ids": [ + "api.health_endpoint" + ], + "entity_hits": 0, + "openapi_signals": { + "path_found": false, + "method_found": false, + "operation_semantics_found": false, + "request_payload_found": false, + "request_schema": false, + "request_fields_found": false, + "response_payload_found": false, + "response_schema": false, + "response_fields_found": false, + "status_codes": false, + "content_type_found": false, + "examples_found": false, + "payload_description": false + } + }, + "gate_decision": "allow", + "gate_decision_reason": "evidence_sufficient", + "gate_missing_requirements": [], + "gate_satisfied_requirements": [ + "retrieval_non_empty" + ], + "openapi_evidence": { + "path_found": false, + "method_found": false, + "operation_semantics_found": false, + "request_payload_found": false, + "request_schema": false, + "request_fields_found": false, + "response_payload_found": false, + "response_schema": false, + "response_fields_found": false, + "status_codes": false, + "content_type_found": false, + "examples_found": false, + "payload_description": false + }, + "requested_fragment_type": null, + "fragment_evidence_found": [], + "fragment_missing_requirements": [], + "answer_mode": "ready", + "degrade_reason": null, + "degraded_reason": null, + "code_intents_stubbed": false +} + +## LLM Request +- prompt_name: docs_explain_answer +- log_context: graph.project_qa.docs.answer + +### Prompt Stats +```json +{ + "system_chars": 393, + "user_chars": 7572, + "tokens_in_estimate": 1992 +} +``` + +### System Prompt +```text +Ты объясняешь документацию системы. + +На вход приходит JSON с полями: +- question +- intent +- sub_intent +- documents +- facts +- relations + +Правила: +- Используй только предоставленные факты +- Не додумывай +- Если данных недостаточно, скажи это явно +- Объясняй структурировано + +Формат ответа: +1. Краткое описание +2. Основные элементы +3. Как это работает +4. Связи с другими частями системы (если есть) +``` + +### User Prompt +```json +{ + "question": "Что такое runtime health?", + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "ENTITY_EXPLAIN", + "documents": [ + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/domain/runtime-health-entity.md", + "title": "Сущность runtime health", + "content": "`runtime health` — доменная модель наблюдаемости сервиса, которая описывает общее состояние runtime и состояние отдельных компонентов. Для `test_echo_app` главным объектом наблюдения является компонент `telegram_notify`, у которого важны статус, время старта и количество успешных отправок. Эта модель используется для внешнего health-monitoring и внутренней диагностики.", + "metadata": { + "name": "runtime_health", + "tags": [ + "domain", + "health", + "observability" + ], + "type": "domain_entity", + "layer": "domain", + "links": [ + { + "type": "part_of", + "target": "architecture.telegram_notify_app" + }, + { + "type": "used_by", + "target": "api.health_endpoint" + }, + { + "type": "related_logic", + "target": "logic.telegram_notification_loop" + } + ], + "owner": null, + "title": "Сущность runtime health", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "architecture.telegram_notify_app", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "37d4dcf470ea3de95d59e44786006e369a3ea11bf5dbf4c88877696e9183ee87", + "children": [], + "doc_kind": "misc", + "entities": [ + "WorkerHealth", + "WorkerStatus", + "TelegramNotifyWorker" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "domain.runtime_health", + "source_path": "docs/documentation/domain/runtime-health-entity.md", + "summary_text": "`runtime health` — доменная модель наблюдаемости сервиса, которая описывает общее состояние runtime и состояние отдельных компонентов. Для `test_echo_app` главным объектом наблюдения является компонент `telegram_notify`, у которого важны статус, время старта и количество успешных отправок. Эта модель используется для внешнего health-monitoring и внутренней диагностики.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + } + ], + "facts": [], + "entities": [ + { + "layer": "D3_ENTITY_CATALOG", + "path": "docs/documentation/api/health-endpoint.md", + "title": "RuntimeManager", + "content": "RuntimeManager", + "metadata": { + "tags": [ + "api", + "health", + "control-plane" + ], + "owner": null, + "doc_id": null, + "module": "telegram_notify_app", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "8b5a533a8076e2e9d36995eee29aeade260080bdca2ec8e21fe28f08574b983f", + "doc_version": null, + "document_id": "api.health_endpoint", + "entity_name": "RuntimeManager", + "source_path": "docs/documentation/api/health-endpoint.md", + "artifact_type": null, + "document_type": "api_method", + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D3_ENTITY_CATALOG", + "path": "docs/documentation/architecture/telegram-notify-app-overview.md", + "title": "RuntimeManager", + "content": "RuntimeManager", + "metadata": { + "tags": [ + "architecture", + "telegram", + "plba", + "runtime" + ], + "owner": null, + "doc_id": null, + "module": "telegram_notify_app", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "8b1cc9f823e55bddbc825466d10a0fdb4ca4354ac02d91f9e2aef7b7d2ec8256", + "doc_version": null, + "document_id": "architecture.telegram_notify_app", + "entity_name": "RuntimeManager", + "source_path": "docs/documentation/architecture/telegram-notify-app-overview.md", + "artifact_type": null, + "document_type": "architecture_overview", + "last_modified": null, + "staleness_score": null, + "system_component": null + } + } + ], + "workflows": [], + "relations": [ + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/domain/runtime-health-entity.md", + "title": "domain.runtime_health:used_by", + "content": "domain.runtime_health used_by api.health_endpoint", + "metadata": { + "owner": null, + "anchor": "frontmatter.links", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "37d4dcf470ea3de95d59e44786006e369a3ea11bf5dbf4c88877696e9183ee87", + "source_id": "domain.runtime_health", + "target_id": "api.health_endpoint", + "doc_version": null, + "relation_id": "801650f8bcbfbfbefd35c14447bfef7b3c3827313db790efa7faf47db860f8c4", + "source_path": "docs/documentation/domain/runtime-health-entity.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "used_by", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/domain/runtime-health-entity.md", + "title": "domain.runtime_health:related_logic", + "content": "domain.runtime_health related_logic logic.telegram_notification_loop", + "metadata": { + "owner": null, + "anchor": "frontmatter.links", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "37d4dcf470ea3de95d59e44786006e369a3ea11bf5dbf4c88877696e9183ee87", + "source_id": "domain.runtime_health", + "target_id": "logic.telegram_notification_loop", + "doc_version": null, + "relation_id": "8595d7b82fecdb7ef579fa8961cda6799bb21970061e5bc221d4dd7a3d53fd04", + "source_path": "docs/documentation/domain/runtime-health-entity.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "related_logic", + "staleness_score": null, + "system_component": null + } + } + ], + "chunks": [ + { + "layer": "D0_DOC_CHUNKS", + "path": "docs/documentation/api/health-endpoint.md", + "title": "api.health_endpoint:Описание", + "content": "Метод предоставляет текущее состояние runtime и его компонентов без изменения состояния системы. Он нужен для мониторинга, readiness/liveness-проверок и быстрой диагностики worker'а `telegram_notify`.", + "metadata": { + "tags": [ + "api", + "health", + "control-plane" + ], + "type": "api_method", + "order": 3, + "owner": null, + "doc_id": null, + "module": "telegram_notify_app", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "8b5a533a8076e2e9d36995eee29aeade260080bdca2ec8e21fe28f08574b983f", + "doc_kind": "misc", + "doc_version": null, + "document_id": "api.health_endpoint", + "source_path": "docs/documentation/api/health-endpoint.md", + "section_path": "Details > Описание", + "artifact_type": null, + "last_modified": null, + "section_title": "Описание", + "staleness_score": null, + "system_component": null + } + } + ] +} +``` + +### User Prompt Overview +- question: Что такое runtime health? +- intent: DOCUMENTATION_EXPLAIN +- sub_intent: ENTITY_EXPLAIN +- documents: 1 | samples: Сущность runtime health +- facts: 0 +- relations: 2 | samples: domain.runtime_health:used_by, domain.runtime_health:related_logic + +## Mismatches +- none \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/docs_router_llm_disambiguation/20260326_150139/full_chain_docs_intents_v3-3x_v3-entity-runtime-health-2.json b/tests/pipeline_setup_v3/test_results/docs_router_llm_disambiguation/20260326_150139/full_chain_docs_intents_v3-3x_v3-entity-runtime-health-2.json new file mode 100644 index 0000000..5ae848e --- /dev/null +++ b/tests/pipeline_setup_v3/test_results/docs_router_llm_disambiguation/20260326_150139/full_chain_docs_intents_v3-3x_v3-entity-runtime-health-2.json @@ -0,0 +1,91 @@ +{ + "meta": { + "case_id": "v3-entity-runtime-health-2", + "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_03_docs/full_chain_docs_intents_v3-3x.yaml", + "runner": "agent_runtime", + "mode": "pre_llm", + "passed": true, + "mismatches": [], + "actual": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "ENTITY_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START", + "rag_count": 24, + "llm_answer": "", + "answer_mode": "answered", + "path_scope": [], + "doc_scope": [ + "api.health_endpoint", + "architecture.telegram_notify_app", + "architecture.telegram_notify_app_overview", + "domain.runtime_health", + "api.control_actions_endpoint", + "logic.telegram_notification_loop", + "api.actions_endpoint" + ], + "entity_candidates": [ + "runtime health" + ], + "symbol_candidates": [], + "layers": [ + "D3_ENTITY_CATALOG", + "D5_RELATION_GRAPH", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "filters": { + "doc_type": null + }, + "pipeline_mode": "pre_llm_only", + "gate_decision": "allow", + "prompt_used": "docs_explain_answer", + "llm_mode": "prose", + "degraded_reason": null, + "code_intents_stubbed": true + } + }, + "pipeline_steps": [ + { + "step": "input_query", + "input": { + "query": "Объясни runtime health" + }, + "output": { + "query": "Объясни runtime health" + } + }, + { + "step": "router", + "input": { + "query": "Объясни runtime health" + }, + "output": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "ENTITY_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START" + } + }, + { + "step": "docs_pipeline", + "input": { + "query": "Объясни runtime health" + }, + "output": { + "answer_mode": "ready", + "prompt_name": "docs_explain_answer", + "llm_request": { + "prompt_name": "docs_explain_answer", + "log_context": "graph.project_qa.docs.answer", + "prompt_stats": { + "system_chars": 393, + "user_chars": 7569, + "tokens_in_estimate": 1991 + } + }, + "degraded_reason": "" + } + } + ] +} \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/docs_router_llm_disambiguation/20260326_150139/full_chain_docs_intents_v3-3x_v3-entity-runtime-health-2.md b/tests/pipeline_setup_v3/test_results/docs_router_llm_disambiguation/20260326_150139/full_chain_docs_intents_v3-3x_v3-entity-runtime-health-2.md new file mode 100644 index 0000000..c9bc8d5 --- /dev/null +++ b/tests/pipeline_setup_v3/test_results/docs_router_llm_disambiguation/20260326_150139/full_chain_docs_intents_v3-3x_v3-entity-runtime-health-2.md @@ -0,0 +1,631 @@ +# v3-entity-runtime-health-2 + +- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_03_docs/full_chain_docs_intents_v3-3x.yaml +- runner: agent_runtime +- mode: pre_llm +- passed: True + +## Query +Объясни runtime health + +## Actual +{ + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "ENTITY_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START", + "rag_count": 24, + "llm_answer": "", + "answer_mode": "answered", + "path_scope": [], + "doc_scope": [ + "api.health_endpoint", + "architecture.telegram_notify_app", + "architecture.telegram_notify_app_overview", + "domain.runtime_health", + "api.control_actions_endpoint", + "logic.telegram_notification_loop", + "api.actions_endpoint" + ], + "entity_candidates": [ + "runtime health" + ], + "symbol_candidates": [], + "layers": [ + "D3_ENTITY_CATALOG", + "D5_RELATION_GRAPH", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "filters": { + "doc_type": null + }, + "pipeline_mode": "pre_llm_only", + "gate_decision": "allow", + "prompt_used": "docs_explain_answer", + "llm_mode": "prose", + "degraded_reason": null, + "code_intents_stubbed": true +} + +## Pipeline Steps +### input_query +```json +{ + "input": { + "query": "Объясни runtime health" + }, + "output": { + "query": "Объясни runtime health" + } +} +``` + +### router +```json +{ + "input": { + "query": "Объясни runtime health" + }, + "output": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "ENTITY_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START" + } +} +``` + +### docs_pipeline +```json +{ + "input": { + "query": "Объясни runtime health" + }, + "output": { + "answer_mode": "ready", + "prompt_name": "docs_explain_answer", + "llm_request": { + "prompt_name": "docs_explain_answer", + "log_context": "graph.project_qa.docs.answer", + "prompt_stats": { + "system_chars": 393, + "user_chars": 7569, + "tokens_in_estimate": 1991 + } + }, + "degraded_reason": "" + } +} +``` + +## Diagnostics +{ + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "ENTITY_EXPLAIN", + "layers_used": [ + "D3_ENTITY_CATALOG", + "D5_RELATION_GRAPH", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "documents_found": 1, + "facts_found": 0, + "relations_found": 2, + "openapi_fields_extracted": 0, + "missing_required_fields": [], + "openapi_status": { + "has_path": false, + "has_method": false, + "has_request": false, + "has_response": false + }, + "prompt_used": "docs_explain_answer", + "llm_mode": "prose", + "output_valid": true, + "matched_intent_source": "llm", + "matched_anchor_type": "none", + "matched_anchor_value": null, + "exact_anchor_match": false, + "docs_layers_requested": [ + "D3_ENTITY_CATALOG", + "D5_RELATION_GRAPH", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "docs_layers_with_hits": [ + "D3_ENTITY_CATALOG", + "D5_RELATION_GRAPH", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "planned_layers": [ + "D3_ENTITY_CATALOG", + "D5_RELATION_GRAPH", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "executed_layers": [ + "D3_ENTITY_CATALOG", + "D5_RELATION_GRAPH", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "non_empty_layers": [ + "D3_ENTITY_CATALOG", + "D5_RELATION_GRAPH", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "layer_diagnostics": { + "D3_ENTITY_CATALOG": { + "hits": 8, + "top_ids": [ + "api.health_endpoint", + "architecture.telegram_notify_app", + "domain.runtime_health" + ], + "top_sections": [ + "RuntimeManager", + "WorkerStatus", + "TelegramNotifyWorker", + "TelegramControlChannel" + ] + }, + "D5_RELATION_GRAPH": { + "hits": 8, + "top_ids": [ + "801650f8bcbfbfbefd35c14447bfef7b3c3827313db790efa7faf47db860f8c4", + "8595d7b82fecdb7ef579fa8961cda6799bb21970061e5bc221d4dd7a3d53fd04", + "af2a4f7c1b677b908410ba720915405e10dbd0870e30a3c6e3aa2468550ddf0e", + "c718b1939621233295ccaf6e8203e7fd94f3dd1bfb88f10c51bc5e33d53a24aa", + "616f5cbf25da83cb51d8d0741a7fc351620c9ca2c6513fa2094b4aa476f0912a" + ], + "top_sections": [ + "domain.runtime_health:used_by", + "domain.runtime_health:related_logic", + "domain.runtime_health:part_of", + "api.health_endpoint:parent", + "api.health_endpoint:part_of" + ] + }, + "D1_DOCUMENT_CATALOG": { + "hits": 4, + "top_ids": [ + "domain.runtime_health", + "api.health_endpoint", + "logic.telegram_notification_loop", + "api.control_actions_endpoint" + ], + "top_sections": [ + "Сущность runtime health", + "HTTP API /health", + "Цикл отправки уведомлений в Telegram", + "HTTP API /actions/{action}" + ] + }, + "D0_DOC_CHUNKS": { + "hits": 4, + "top_ids": [ + "api.health_endpoint" + ], + "top_sections": [ + "api.health_endpoint:Описание", + "api.health_endpoint:Сценарий", + "api.health_endpoint:Summary", + "api.health_endpoint:Функциональные требования" + ] + } + }, + "query_entity_candidates": [ + "runtime health" + ], + "resolved_entity_candidates": [], + "query_anchor_candidates": [], + "resolved_anchor_candidates": [ + "api.health_endpoint", + "docs/documentation/api/health-endpoint.md", + "architecture.telegram_notify_app", + "docs/documentation/architecture/telegram-notify-app-overview.md", + "domain.runtime_health", + "docs/documentation/domain/runtime-health-entity.md", + "docs/documentation/api/control-actions-endpoint.md", + "logic.telegram_notification_loop", + "docs/documentation/logic/telegram-notification-loop.md", + "api.control_actions_endpoint" + ], + "anchor_candidates": [], + "selected_anchor": null, + "anchor_selection_reason": "", + "anchor_match_type": "", + "doc_ids": [ + "api.health_endpoint", + "architecture.telegram_notify_app", + "architecture.telegram_notify_app_overview", + "domain.runtime_health", + "api.control_actions_endpoint", + "logic.telegram_notification_loop", + "api.actions_endpoint" + ], + "doc_paths": [ + "docs/documentation/api/health-endpoint.md", + "docs/documentation/architecture/telegram-notify-app-overview.md", + "docs/documentation/domain/runtime-health-entity.md", + "docs/documentation/api/control-actions-endpoint.md", + "docs/documentation/logic/telegram-notification-loop.md" + ], + "doc_titles": [ + "RuntimeManager", + "WorkerStatus", + "TelegramNotifyWorker", + "TelegramControlChannel", + "WorkerHealth", + "domain.runtime_health:used_by", + "domain.runtime_health:related_logic", + "domain.runtime_health:part_of", + "api.health_endpoint:parent", + "api.health_endpoint:part_of", + "api.health_endpoint:depends_on", + "domain.runtime_health:parent", + "api.control_actions_endpoint:related_api", + "Сущность runtime health", + "HTTP API /health", + "Цикл отправки уведомлений в Telegram", + "HTTP API /actions/{action}", + "api.health_endpoint:Описание", + "api.health_endpoint:Сценарий", + "api.health_endpoint:Summary", + "api.health_endpoint:Функциональные требования" + ], + "relation_hits_count": 2, + "relation_targets": [ + "domain.runtime_health:used_by", + "domain.runtime_health:related_logic" + ], + "selected_doc_ids": [ + "domain.runtime_health", + "api.health_endpoint", + "architecture.telegram_notify_app" + ], + "selected_fact_ids": [], + "selected_relation_ids": [ + "801650f8bcbfbfbefd35c14447bfef7b3c3827313db790efa7faf47db860f8c4", + "8595d7b82fecdb7ef579fa8961cda6799bb21970061e5bc221d4dd7a3d53fd04" + ], + "selected_chunk_ids": [ + "api.health_endpoint" + ], + "selected_entity_ids": [ + "api.health_endpoint", + "architecture.telegram_notify_app" + ], + "selected_workflow_ids": [], + "fallback_doc_hits_count": 2, + "fallback_used": false, + "fact_hits": 0, + "entity_hits": 0, + "evidence_summary": { + "documents": 1, + "facts": 0, + "entities": 2, + "workflows": 0, + "relations": 2, + "chunks": 1, + "selected_doc_ids": [ + "domain.runtime_health", + "api.health_endpoint", + "architecture.telegram_notify_app" + ], + "selected_fact_ids": [], + "selected_relation_ids": [ + "801650f8bcbfbfbefd35c14447bfef7b3c3827313db790efa7faf47db860f8c4", + "8595d7b82fecdb7ef579fa8961cda6799bb21970061e5bc221d4dd7a3d53fd04" + ], + "selected_chunk_ids": [ + "api.health_endpoint" + ], + "entity_hits": 0, + "openapi_signals": { + "path_found": false, + "method_found": false, + "operation_semantics_found": false, + "request_payload_found": false, + "request_schema": false, + "request_fields_found": false, + "response_payload_found": false, + "response_schema": false, + "response_fields_found": false, + "status_codes": false, + "content_type_found": false, + "examples_found": false, + "payload_description": false + } + }, + "gate_decision": "allow", + "gate_decision_reason": "evidence_sufficient", + "gate_missing_requirements": [], + "gate_satisfied_requirements": [ + "retrieval_non_empty" + ], + "openapi_evidence": { + "path_found": false, + "method_found": false, + "operation_semantics_found": false, + "request_payload_found": false, + "request_schema": false, + "request_fields_found": false, + "response_payload_found": false, + "response_schema": false, + "response_fields_found": false, + "status_codes": false, + "content_type_found": false, + "examples_found": false, + "payload_description": false + }, + "requested_fragment_type": null, + "fragment_evidence_found": [], + "fragment_missing_requirements": [], + "answer_mode": "ready", + "degrade_reason": null, + "degraded_reason": null, + "code_intents_stubbed": false +} + +## LLM Request +- prompt_name: docs_explain_answer +- log_context: graph.project_qa.docs.answer + +### Prompt Stats +```json +{ + "system_chars": 393, + "user_chars": 7569, + "tokens_in_estimate": 1991 +} +``` + +### System Prompt +```text +Ты объясняешь документацию системы. + +На вход приходит JSON с полями: +- question +- intent +- sub_intent +- documents +- facts +- relations + +Правила: +- Используй только предоставленные факты +- Не додумывай +- Если данных недостаточно, скажи это явно +- Объясняй структурировано + +Формат ответа: +1. Краткое описание +2. Основные элементы +3. Как это работает +4. Связи с другими частями системы (если есть) +``` + +### User Prompt +```json +{ + "question": "Объясни runtime health", + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "ENTITY_EXPLAIN", + "documents": [ + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/domain/runtime-health-entity.md", + "title": "Сущность runtime health", + "content": "`runtime health` — доменная модель наблюдаемости сервиса, которая описывает общее состояние runtime и состояние отдельных компонентов. Для `test_echo_app` главным объектом наблюдения является компонент `telegram_notify`, у которого важны статус, время старта и количество успешных отправок. Эта модель используется для внешнего health-monitoring и внутренней диагностики.", + "metadata": { + "name": "runtime_health", + "tags": [ + "domain", + "health", + "observability" + ], + "type": "domain_entity", + "layer": "domain", + "links": [ + { + "type": "part_of", + "target": "architecture.telegram_notify_app" + }, + { + "type": "used_by", + "target": "api.health_endpoint" + }, + { + "type": "related_logic", + "target": "logic.telegram_notification_loop" + } + ], + "owner": null, + "title": "Сущность runtime health", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "architecture.telegram_notify_app", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "37d4dcf470ea3de95d59e44786006e369a3ea11bf5dbf4c88877696e9183ee87", + "children": [], + "doc_kind": "misc", + "entities": [ + "WorkerHealth", + "WorkerStatus", + "TelegramNotifyWorker" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "domain.runtime_health", + "source_path": "docs/documentation/domain/runtime-health-entity.md", + "summary_text": "`runtime health` — доменная модель наблюдаемости сервиса, которая описывает общее состояние runtime и состояние отдельных компонентов. Для `test_echo_app` главным объектом наблюдения является компонент `telegram_notify`, у которого важны статус, время старта и количество успешных отправок. Эта модель используется для внешнего health-monitoring и внутренней диагностики.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + } + ], + "facts": [], + "entities": [ + { + "layer": "D3_ENTITY_CATALOG", + "path": "docs/documentation/api/health-endpoint.md", + "title": "RuntimeManager", + "content": "RuntimeManager", + "metadata": { + "tags": [ + "api", + "health", + "control-plane" + ], + "owner": null, + "doc_id": null, + "module": "telegram_notify_app", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "8b5a533a8076e2e9d36995eee29aeade260080bdca2ec8e21fe28f08574b983f", + "doc_version": null, + "document_id": "api.health_endpoint", + "entity_name": "RuntimeManager", + "source_path": "docs/documentation/api/health-endpoint.md", + "artifact_type": null, + "document_type": "api_method", + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D3_ENTITY_CATALOG", + "path": "docs/documentation/architecture/telegram-notify-app-overview.md", + "title": "RuntimeManager", + "content": "RuntimeManager", + "metadata": { + "tags": [ + "architecture", + "telegram", + "plba", + "runtime" + ], + "owner": null, + "doc_id": null, + "module": "telegram_notify_app", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "8b1cc9f823e55bddbc825466d10a0fdb4ca4354ac02d91f9e2aef7b7d2ec8256", + "doc_version": null, + "document_id": "architecture.telegram_notify_app", + "entity_name": "RuntimeManager", + "source_path": "docs/documentation/architecture/telegram-notify-app-overview.md", + "artifact_type": null, + "document_type": "architecture_overview", + "last_modified": null, + "staleness_score": null, + "system_component": null + } + } + ], + "workflows": [], + "relations": [ + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/domain/runtime-health-entity.md", + "title": "domain.runtime_health:used_by", + "content": "domain.runtime_health used_by api.health_endpoint", + "metadata": { + "owner": null, + "anchor": "frontmatter.links", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "37d4dcf470ea3de95d59e44786006e369a3ea11bf5dbf4c88877696e9183ee87", + "source_id": "domain.runtime_health", + "target_id": "api.health_endpoint", + "doc_version": null, + "relation_id": "801650f8bcbfbfbefd35c14447bfef7b3c3827313db790efa7faf47db860f8c4", + "source_path": "docs/documentation/domain/runtime-health-entity.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "used_by", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/domain/runtime-health-entity.md", + "title": "domain.runtime_health:related_logic", + "content": "domain.runtime_health related_logic logic.telegram_notification_loop", + "metadata": { + "owner": null, + "anchor": "frontmatter.links", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "37d4dcf470ea3de95d59e44786006e369a3ea11bf5dbf4c88877696e9183ee87", + "source_id": "domain.runtime_health", + "target_id": "logic.telegram_notification_loop", + "doc_version": null, + "relation_id": "8595d7b82fecdb7ef579fa8961cda6799bb21970061e5bc221d4dd7a3d53fd04", + "source_path": "docs/documentation/domain/runtime-health-entity.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "related_logic", + "staleness_score": null, + "system_component": null + } + } + ], + "chunks": [ + { + "layer": "D0_DOC_CHUNKS", + "path": "docs/documentation/api/health-endpoint.md", + "title": "api.health_endpoint:Описание", + "content": "Метод предоставляет текущее состояние runtime и его компонентов без изменения состояния системы. Он нужен для мониторинга, readiness/liveness-проверок и быстрой диагностики worker'а `telegram_notify`.", + "metadata": { + "tags": [ + "api", + "health", + "control-plane" + ], + "type": "api_method", + "order": 3, + "owner": null, + "doc_id": null, + "module": "telegram_notify_app", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "8b5a533a8076e2e9d36995eee29aeade260080bdca2ec8e21fe28f08574b983f", + "doc_kind": "misc", + "doc_version": null, + "document_id": "api.health_endpoint", + "source_path": "docs/documentation/api/health-endpoint.md", + "section_path": "Details > Описание", + "artifact_type": null, + "last_modified": null, + "section_title": "Описание", + "staleness_score": null, + "system_component": null + } + } + ] +} +``` + +### User Prompt Overview +- question: Объясни runtime health +- intent: DOCUMENTATION_EXPLAIN +- sub_intent: ENTITY_EXPLAIN +- documents: 1 | samples: Сущность runtime health +- facts: 0 +- relations: 2 | samples: domain.runtime_health:used_by, domain.runtime_health:related_logic + +## Mismatches +- none \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/docs_router_llm_disambiguation/20260326_150139/full_chain_docs_intents_v3-3x_v3-entity-worker-status-1.json b/tests/pipeline_setup_v3/test_results/docs_router_llm_disambiguation/20260326_150139/full_chain_docs_intents_v3-3x_v3-entity-worker-status-1.json new file mode 100644 index 0000000..0a01fd4 --- /dev/null +++ b/tests/pipeline_setup_v3/test_results/docs_router_llm_disambiguation/20260326_150139/full_chain_docs_intents_v3-3x_v3-entity-worker-status-1.json @@ -0,0 +1,91 @@ +{ + "meta": { + "case_id": "v3-entity-worker-status-1", + "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_03_docs/full_chain_docs_intents_v3-3x.yaml", + "runner": "agent_runtime", + "mode": "pre_llm", + "passed": true, + "mismatches": [], + "actual": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "ENTITY_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START", + "rag_count": 24, + "llm_answer": "", + "answer_mode": "answered", + "path_scope": [], + "doc_scope": [ + "domain.runtime_health", + "logic.telegram_notification_loop", + "api.control_actions_endpoint", + "api.health_endpoint", + "api.send_message_endpoint", + "docs/README.md", + "api.actions_endpoint" + ], + "entity_candidates": [ + "WorkerStatus" + ], + "symbol_candidates": [], + "layers": [ + "D3_ENTITY_CATALOG", + "D5_RELATION_GRAPH", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "filters": { + "doc_type": null + }, + "pipeline_mode": "pre_llm_only", + "gate_decision": "allow", + "prompt_used": "docs_explain_answer", + "llm_mode": "prose", + "degraded_reason": null, + "code_intents_stubbed": true + } + }, + "pipeline_steps": [ + { + "step": "input_query", + "input": { + "query": "Что такое WorkerStatus?" + }, + "output": { + "query": "Что такое WorkerStatus?" + } + }, + { + "step": "router", + "input": { + "query": "Что такое WorkerStatus?" + }, + "output": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "ENTITY_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START" + } + }, + { + "step": "docs_pipeline", + "input": { + "query": "Что такое WorkerStatus?" + }, + "output": { + "answer_mode": "ready", + "prompt_name": "docs_explain_answer", + "llm_request": { + "prompt_name": "docs_explain_answer", + "log_context": "graph.project_qa.docs.answer", + "prompt_stats": { + "system_chars": 393, + "user_chars": 7030, + "tokens_in_estimate": 1856 + } + }, + "degraded_reason": "" + } + } + ] +} \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/docs_router_llm_disambiguation/20260326_150139/full_chain_docs_intents_v3-3x_v3-entity-worker-status-1.md b/tests/pipeline_setup_v3/test_results/docs_router_llm_disambiguation/20260326_150139/full_chain_docs_intents_v3-3x_v3-entity-worker-status-1.md new file mode 100644 index 0000000..cd8dce0 --- /dev/null +++ b/tests/pipeline_setup_v3/test_results/docs_router_llm_disambiguation/20260326_150139/full_chain_docs_intents_v3-3x_v3-entity-worker-status-1.md @@ -0,0 +1,619 @@ +# v3-entity-worker-status-1 + +- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_03_docs/full_chain_docs_intents_v3-3x.yaml +- runner: agent_runtime +- mode: pre_llm +- passed: True + +## Query +Что такое WorkerStatus? + +## Actual +{ + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "ENTITY_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START", + "rag_count": 24, + "llm_answer": "", + "answer_mode": "answered", + "path_scope": [], + "doc_scope": [ + "domain.runtime_health", + "logic.telegram_notification_loop", + "api.control_actions_endpoint", + "api.health_endpoint", + "api.send_message_endpoint", + "docs/README.md", + "api.actions_endpoint" + ], + "entity_candidates": [ + "WorkerStatus" + ], + "symbol_candidates": [], + "layers": [ + "D3_ENTITY_CATALOG", + "D5_RELATION_GRAPH", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "filters": { + "doc_type": null + }, + "pipeline_mode": "pre_llm_only", + "gate_decision": "allow", + "prompt_used": "docs_explain_answer", + "llm_mode": "prose", + "degraded_reason": null, + "code_intents_stubbed": true +} + +## Pipeline Steps +### input_query +```json +{ + "input": { + "query": "Что такое WorkerStatus?" + }, + "output": { + "query": "Что такое WorkerStatus?" + } +} +``` + +### router +```json +{ + "input": { + "query": "Что такое WorkerStatus?" + }, + "output": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "ENTITY_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START" + } +} +``` + +### docs_pipeline +```json +{ + "input": { + "query": "Что такое WorkerStatus?" + }, + "output": { + "answer_mode": "ready", + "prompt_name": "docs_explain_answer", + "llm_request": { + "prompt_name": "docs_explain_answer", + "log_context": "graph.project_qa.docs.answer", + "prompt_stats": { + "system_chars": 393, + "user_chars": 7030, + "tokens_in_estimate": 1856 + } + }, + "degraded_reason": "" + } +} +``` + +## Diagnostics +{ + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "ENTITY_EXPLAIN", + "layers_used": [ + "D3_ENTITY_CATALOG", + "D5_RELATION_GRAPH", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "documents_found": 1, + "facts_found": 0, + "relations_found": 2, + "openapi_fields_extracted": 0, + "missing_required_fields": [], + "openapi_status": { + "has_path": false, + "has_method": false, + "has_request": false, + "has_response": false + }, + "prompt_used": "docs_explain_answer", + "llm_mode": "prose", + "output_valid": true, + "matched_intent_source": "deterministic", + "matched_anchor_type": "none", + "matched_anchor_value": null, + "exact_anchor_match": false, + "docs_layers_requested": [ + "D3_ENTITY_CATALOG", + "D5_RELATION_GRAPH", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "docs_layers_with_hits": [ + "D3_ENTITY_CATALOG", + "D5_RELATION_GRAPH", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "planned_layers": [ + "D3_ENTITY_CATALOG", + "D5_RELATION_GRAPH", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "executed_layers": [ + "D3_ENTITY_CATALOG", + "D5_RELATION_GRAPH", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "non_empty_layers": [ + "D3_ENTITY_CATALOG", + "D5_RELATION_GRAPH", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "layer_diagnostics": { + "D3_ENTITY_CATALOG": { + "hits": 8, + "top_ids": [ + "domain.runtime_health", + "logic.telegram_notification_loop", + "api.control_actions_endpoint", + "api.health_endpoint" + ], + "top_sections": [ + "WorkerStatus", + "JSONResponse", + "TelegramNotifyWorker", + "RuntimeManager" + ] + }, + "D5_RELATION_GRAPH": { + "hits": 8, + "top_ids": [ + "5f4909bde905cd3d294ad307074a05e4ae4deefcafe6272cd2d0436e73acb8dd", + "711fb2edb82dd222deaba3c91768b18cbbd453009235823282813c6e867dc2c1", + "eec79f7a02b804337e791ef231784862ae26e0599eb20224790e9d4f085fa9c0", + "c718b1939621233295ccaf6e8203e7fd94f3dd1bfb88f10c51bc5e33d53a24aa", + "616f5cbf25da83cb51d8d0741a7fc351620c9ca2c6513fa2094b4aa476f0912a" + ], + "top_sections": [ + "api.control_actions_endpoint:part_of", + "api.control_actions_endpoint:related_api", + "api.control_actions_endpoint:related_logic", + "api.health_endpoint:parent", + "api.health_endpoint:part_of" + ] + }, + "D1_DOCUMENT_CATALOG": { + "hits": 4, + "top_ids": [ + "docs/README.md", + "api.control_actions_endpoint", + "api.health_endpoint", + "api.send_message_endpoint" + ], + "top_sections": [ + "Readme", + "HTTP API /actions/{action}", + "HTTP API /health", + "HTTP API /send" + ] + }, + "D0_DOC_CHUNKS": { + "hits": 4, + "top_ids": [ + "logic.telegram_notification_loop", + "docs/README.md" + ], + "top_sections": [ + "logic.telegram_notification_loop:Details", + "docs/README.md:Навигация", + "docs/README.md:Правила и шаблоны", + "docs/README.md:Структура" + ] + } + }, + "query_entity_candidates": [ + "WorkerStatus" + ], + "resolved_entity_candidates": [], + "query_anchor_candidates": [ + "WorkerStatus" + ], + "resolved_anchor_candidates": [ + "domain.runtime_health", + "docs/documentation/domain/runtime-health-entity.md", + "logic.telegram_notification_loop", + "docs/documentation/logic/telegram-notification-loop.md", + "api.control_actions_endpoint", + "docs/documentation/api/control-actions-endpoint.md", + "api.health_endpoint", + "docs/documentation/api/health-endpoint.md", + "api.send_message_endpoint", + "docs/documentation/api/send-message-endpoint.md", + "docs/README.md" + ], + "anchor_candidates": [], + "selected_anchor": null, + "anchor_selection_reason": "", + "anchor_match_type": "", + "doc_ids": [ + "domain.runtime_health", + "logic.telegram_notification_loop", + "api.control_actions_endpoint", + "api.health_endpoint", + "api.send_message_endpoint", + "docs/README.md", + "api.actions_endpoint" + ], + "doc_paths": [ + "docs/documentation/domain/runtime-health-entity.md", + "docs/documentation/logic/telegram-notification-loop.md", + "docs/documentation/api/control-actions-endpoint.md", + "docs/documentation/api/health-endpoint.md", + "docs/documentation/api/send-message-endpoint.md", + "docs/README.md" + ], + "doc_titles": [ + "WorkerStatus", + "JSONResponse", + "TelegramNotifyWorker", + "RuntimeManager", + "WorkerHealth", + "TelegramControlAppFactory", + "TelegramControlChannel", + "api.control_actions_endpoint:part_of", + "api.control_actions_endpoint:related_api", + "api.control_actions_endpoint:related_logic", + "api.health_endpoint:parent", + "api.health_endpoint:part_of", + "api.health_endpoint:depends_on", + "api.send_message_endpoint:parent", + "api.control_actions_endpoint:parent", + "Readme", + "HTTP API /actions/{action}", + "HTTP API /health", + "HTTP API /send", + "logic.telegram_notification_loop:Details", + "docs/README.md:Навигация", + "docs/README.md:Правила и шаблоны", + "docs/README.md:Структура" + ], + "relation_hits_count": 2, + "relation_targets": [ + "api.control_actions_endpoint:part_of", + "api.control_actions_endpoint:related_api" + ], + "selected_doc_ids": [ + "docs/README.md", + "domain.runtime_health", + "logic.telegram_notification_loop" + ], + "selected_fact_ids": [], + "selected_relation_ids": [ + "5f4909bde905cd3d294ad307074a05e4ae4deefcafe6272cd2d0436e73acb8dd", + "711fb2edb82dd222deaba3c91768b18cbbd453009235823282813c6e867dc2c1" + ], + "selected_chunk_ids": [ + "logic.telegram_notification_loop" + ], + "selected_entity_ids": [ + "domain.runtime_health", + "logic.telegram_notification_loop" + ], + "selected_workflow_ids": [], + "fallback_doc_hits_count": 2, + "fallback_used": false, + "fact_hits": 0, + "entity_hits": 0, + "evidence_summary": { + "documents": 1, + "facts": 0, + "entities": 2, + "workflows": 0, + "relations": 2, + "chunks": 1, + "selected_doc_ids": [ + "docs/README.md", + "domain.runtime_health", + "logic.telegram_notification_loop" + ], + "selected_fact_ids": [], + "selected_relation_ids": [ + "5f4909bde905cd3d294ad307074a05e4ae4deefcafe6272cd2d0436e73acb8dd", + "711fb2edb82dd222deaba3c91768b18cbbd453009235823282813c6e867dc2c1" + ], + "selected_chunk_ids": [ + "logic.telegram_notification_loop" + ], + "entity_hits": 0, + "openapi_signals": { + "path_found": false, + "method_found": false, + "operation_semantics_found": false, + "request_payload_found": false, + "request_schema": false, + "request_fields_found": false, + "response_payload_found": false, + "response_schema": false, + "response_fields_found": false, + "status_codes": false, + "content_type_found": false, + "examples_found": false, + "payload_description": false + } + }, + "gate_decision": "allow", + "gate_decision_reason": "evidence_sufficient", + "gate_missing_requirements": [], + "gate_satisfied_requirements": [ + "retrieval_non_empty" + ], + "openapi_evidence": { + "path_found": false, + "method_found": false, + "operation_semantics_found": false, + "request_payload_found": false, + "request_schema": false, + "request_fields_found": false, + "response_payload_found": false, + "response_schema": false, + "response_fields_found": false, + "status_codes": false, + "content_type_found": false, + "examples_found": false, + "payload_description": false + }, + "requested_fragment_type": null, + "fragment_evidence_found": [], + "fragment_missing_requirements": [], + "answer_mode": "ready", + "degrade_reason": null, + "degraded_reason": null, + "code_intents_stubbed": false +} + +## LLM Request +- prompt_name: docs_explain_answer +- log_context: graph.project_qa.docs.answer + +### Prompt Stats +```json +{ + "system_chars": 393, + "user_chars": 7030, + "tokens_in_estimate": 1856 +} +``` + +### System Prompt +```text +Ты объясняешь документацию системы. + +На вход приходит JSON с полями: +- question +- intent +- sub_intent +- documents +- facts +- relations + +Правила: +- Используй только предоставленные факты +- Не додумывай +- Если данных недостаточно, скажи это явно +- Объясняй структурировано + +Формат ответа: +1. Краткое описание +2. Основные элементы +3. Как это работает +4. Связи с другими частями системы (если есть) +``` + +### User Prompt +```json +{ + "question": "Что такое WorkerStatus?", + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "ENTITY_EXPLAIN", + "documents": [ + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/README.md", + "title": "Readme", + "content": "Readme", + "metadata": { + "name": "", + "tags": [], + "type": "", + "layer": "", + "links": [], + "owner": null, + "title": "Readme", + "doc_id": null, + "module": "", + "parent": null, + "status": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "81d952f1a6ea85b76f75e0e57f33b8fa4b2bf3cb7db11b91b90171aeedd655a6", + "children": [], + "doc_kind": "readme", + "entities": [], + "updated_at": null, + "doc_version": null, + "document_id": "docs/README.md", + "source_path": "docs/README.md", + "summary_text": "", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + } + ], + "facts": [], + "entities": [ + { + "layer": "D3_ENTITY_CATALOG", + "path": "docs/documentation/domain/runtime-health-entity.md", + "title": "WorkerStatus", + "content": "WorkerStatus", + "metadata": { + "tags": [ + "domain", + "health", + "observability" + ], + "owner": null, + "doc_id": null, + "module": "telegram_notify_app", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "37d4dcf470ea3de95d59e44786006e369a3ea11bf5dbf4c88877696e9183ee87", + "doc_version": null, + "document_id": "domain.runtime_health", + "entity_name": "WorkerStatus", + "source_path": "docs/documentation/domain/runtime-health-entity.md", + "artifact_type": null, + "document_type": "domain_entity", + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D3_ENTITY_CATALOG", + "path": "docs/documentation/logic/telegram-notification-loop.md", + "title": "WorkerStatus", + "content": "WorkerStatus", + "metadata": { + "tags": [ + "logic", + "telegram", + "worker", + "scheduling" + ], + "owner": null, + "doc_id": null, + "module": "telegram_notify_app", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "0f62f9b4dab261ca4ca34575ff5d84411a22c90b780c52eda388782b94f08470", + "doc_version": null, + "document_id": "logic.telegram_notification_loop", + "entity_name": "WorkerStatus", + "source_path": "docs/documentation/logic/telegram-notification-loop.md", + "artifact_type": null, + "document_type": "logic_block", + "last_modified": null, + "staleness_score": null, + "system_component": null + } + } + ], + "workflows": [], + "relations": [ + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "api.control_actions_endpoint:part_of", + "content": "api.control_actions_endpoint part_of architecture.telegram_notify_app", + "metadata": { + "owner": null, + "anchor": "frontmatter.links", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "source_id": "api.control_actions_endpoint", + "target_id": "architecture.telegram_notify_app", + "doc_version": null, + "relation_id": "5f4909bde905cd3d294ad307074a05e4ae4deefcafe6272cd2d0436e73acb8dd", + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "part_of", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "api.control_actions_endpoint:related_api", + "content": "api.control_actions_endpoint related_api api.health_endpoint", + "metadata": { + "owner": null, + "anchor": "frontmatter.links", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "source_id": "api.control_actions_endpoint", + "target_id": "api.health_endpoint", + "doc_version": null, + "relation_id": "711fb2edb82dd222deaba3c91768b18cbbd453009235823282813c6e867dc2c1", + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "related_api", + "staleness_score": null, + "system_component": null + } + } + ], + "chunks": [ + { + "layer": "D0_DOC_CHUNKS", + "path": "docs/documentation/logic/telegram-notification-loop.md", + "title": "logic.telegram_notification_loop:Details", + "content": "Workflow начинается после регистрации `TelegramNotifyModule` в `RuntimeManager`. Модуль создает `TelegramNotifyWorker` с интервалом из YAML-конфига и запускает его через стандартный lifecycle PLBA runtime.\n\nПри вызове `start()` worker фиксирует время старта, поднимает daemon thread `telegram-notify` и переходит в цикл `_loop()`. Внутри цикла он читает `TELEGRAM_BOT_TOKEN` и `TELEGRAM_CHAT_ID`, вычисляет текст сообщения и передает отправку в `send_telegram_message()`.\n\nЕсли credentials отсутствуют, worker записывает ошибку в `last_error`, ожидает следующий интервал и повторяет попытку. Если credentials заданы, worker вызывает Telegram Bot API `sendMessage`, обновляет `notifications_sent` при успехе и сохраняет текст ошибки при неуспехе.\n\nС точки зрения наблюдаемости workflow формирует `WorkerHealth` и `WorkerStatus`. Во health payload отражаются `app_started_at`, количество успешных отправок и состояние `ok`, `degraded` или `unhealthy` в зависимости от жизненного цикла потока и результата последней отправки.", + "metadata": { + "tags": [ + "logic", + "telegram", + "worker", + "scheduling" + ], + "type": "logic_block", + "order": 2, + "owner": null, + "doc_id": null, + "module": "telegram_notify_app", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "0f62f9b4dab261ca4ca34575ff5d84411a22c90b780c52eda388782b94f08470", + "doc_kind": "misc", + "doc_version": null, + "document_id": "logic.telegram_notification_loop", + "source_path": "docs/documentation/logic/telegram-notification-loop.md", + "section_path": "Details", + "artifact_type": null, + "last_modified": null, + "section_title": "Details", + "staleness_score": null, + "system_component": null + } + } + ] +} +``` + +### User Prompt Overview +- question: Что такое WorkerStatus? +- intent: DOCUMENTATION_EXPLAIN +- sub_intent: ENTITY_EXPLAIN +- documents: 1 | samples: Readme +- facts: 0 +- relations: 2 | samples: api.control_actions_endpoint:part_of, api.control_actions_endpoint:related_api + +## Mismatches +- none \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/docs_router_llm_disambiguation/20260326_150139/full_chain_docs_intents_v3-3x_v3-entity-worker-status-2.json b/tests/pipeline_setup_v3/test_results/docs_router_llm_disambiguation/20260326_150139/full_chain_docs_intents_v3-3x_v3-entity-worker-status-2.json new file mode 100644 index 0000000..c7d775b --- /dev/null +++ b/tests/pipeline_setup_v3/test_results/docs_router_llm_disambiguation/20260326_150139/full_chain_docs_intents_v3-3x_v3-entity-worker-status-2.json @@ -0,0 +1,95 @@ +{ + "meta": { + "case_id": "v3-entity-worker-status-2", + "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_03_docs/full_chain_docs_intents_v3-3x.yaml", + "runner": "agent_runtime", + "mode": "pre_llm", + "passed": true, + "mismatches": [], + "actual": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "ENTITY_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START", + "rag_count": 24, + "llm_answer": "", + "answer_mode": "answered", + "path_scope": [], + "doc_scope": [ + "api.control_actions_endpoint", + "api.health_endpoint", + "api.send_message_endpoint", + "docs/README.md", + "api.actions_endpoint" + ], + "entity_candidates": [ + "ControlActionSet", + "JSONResponse", + "TelegramControlChannel", + "TelegramNotifyWorker", + "RuntimeManager", + "WorkerHealth", + "TelegramControlAppFactory" + ], + "symbol_candidates": [], + "layers": [ + "D3_ENTITY_CATALOG", + "D5_RELATION_GRAPH", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "filters": { + "doc_type": null + }, + "pipeline_mode": "pre_llm_only", + "gate_decision": "allow", + "prompt_used": "docs_explain_answer", + "llm_mode": "prose", + "degraded_reason": null, + "code_intents_stubbed": true + } + }, + "pipeline_steps": [ + { + "step": "input_query", + "input": { + "query": "Опиши статус воркера" + }, + "output": { + "query": "Опиши статус воркера" + } + }, + { + "step": "router", + "input": { + "query": "Опиши статус воркера" + }, + "output": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "ENTITY_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START" + } + }, + { + "step": "docs_pipeline", + "input": { + "query": "Опиши статус воркера" + }, + "output": { + "answer_mode": "ready", + "prompt_name": "docs_explain_answer", + "llm_request": { + "prompt_name": "docs_explain_answer", + "log_context": "graph.project_qa.docs.answer", + "prompt_stats": { + "system_chars": 393, + "user_chars": 6052, + "tokens_in_estimate": 1612 + } + }, + "degraded_reason": "" + } + } + ] +} \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/docs_router_llm_disambiguation/20260326_150139/full_chain_docs_intents_v3-3x_v3-entity-worker-status-2.md b/tests/pipeline_setup_v3/test_results/docs_router_llm_disambiguation/20260326_150139/full_chain_docs_intents_v3-3x_v3-entity-worker-status-2.md new file mode 100644 index 0000000..aec71aa --- /dev/null +++ b/tests/pipeline_setup_v3/test_results/docs_router_llm_disambiguation/20260326_150139/full_chain_docs_intents_v3-3x_v3-entity-worker-status-2.md @@ -0,0 +1,600 @@ +# v3-entity-worker-status-2 + +- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_03_docs/full_chain_docs_intents_v3-3x.yaml +- runner: agent_runtime +- mode: pre_llm +- passed: True + +## Query +Опиши статус воркера + +## Actual +{ + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "ENTITY_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START", + "rag_count": 24, + "llm_answer": "", + "answer_mode": "answered", + "path_scope": [], + "doc_scope": [ + "api.control_actions_endpoint", + "api.health_endpoint", + "api.send_message_endpoint", + "docs/README.md", + "api.actions_endpoint" + ], + "entity_candidates": [ + "ControlActionSet", + "JSONResponse", + "TelegramControlChannel", + "TelegramNotifyWorker", + "RuntimeManager", + "WorkerHealth", + "TelegramControlAppFactory" + ], + "symbol_candidates": [], + "layers": [ + "D3_ENTITY_CATALOG", + "D5_RELATION_GRAPH", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "filters": { + "doc_type": null + }, + "pipeline_mode": "pre_llm_only", + "gate_decision": "allow", + "prompt_used": "docs_explain_answer", + "llm_mode": "prose", + "degraded_reason": null, + "code_intents_stubbed": true +} + +## Pipeline Steps +### input_query +```json +{ + "input": { + "query": "Опиши статус воркера" + }, + "output": { + "query": "Опиши статус воркера" + } +} +``` + +### router +```json +{ + "input": { + "query": "Опиши статус воркера" + }, + "output": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "ENTITY_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START" + } +} +``` + +### docs_pipeline +```json +{ + "input": { + "query": "Опиши статус воркера" + }, + "output": { + "answer_mode": "ready", + "prompt_name": "docs_explain_answer", + "llm_request": { + "prompt_name": "docs_explain_answer", + "log_context": "graph.project_qa.docs.answer", + "prompt_stats": { + "system_chars": 393, + "user_chars": 6052, + "tokens_in_estimate": 1612 + } + }, + "degraded_reason": "" + } +} +``` + +## Diagnostics +{ + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "ENTITY_EXPLAIN", + "layers_used": [ + "D3_ENTITY_CATALOG", + "D5_RELATION_GRAPH", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "documents_found": 1, + "facts_found": 0, + "relations_found": 2, + "openapi_fields_extracted": 0, + "missing_required_fields": [], + "openapi_status": { + "has_path": false, + "has_method": false, + "has_request": false, + "has_response": false + }, + "prompt_used": "docs_explain_answer", + "llm_mode": "prose", + "output_valid": true, + "matched_intent_source": "llm", + "matched_anchor_type": "none", + "matched_anchor_value": null, + "exact_anchor_match": false, + "docs_layers_requested": [ + "D3_ENTITY_CATALOG", + "D5_RELATION_GRAPH", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "docs_layers_with_hits": [ + "D3_ENTITY_CATALOG", + "D5_RELATION_GRAPH", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "planned_layers": [ + "D3_ENTITY_CATALOG", + "D5_RELATION_GRAPH", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "executed_layers": [ + "D3_ENTITY_CATALOG", + "D5_RELATION_GRAPH", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "non_empty_layers": [ + "D3_ENTITY_CATALOG", + "D5_RELATION_GRAPH", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "layer_diagnostics": { + "D3_ENTITY_CATALOG": { + "hits": 8, + "top_ids": [ + "api.control_actions_endpoint", + "api.health_endpoint" + ], + "top_sections": [ + "ControlActionSet", + "JSONResponse", + "TelegramControlChannel", + "TelegramNotifyWorker", + "RuntimeManager" + ] + }, + "D5_RELATION_GRAPH": { + "hits": 8, + "top_ids": [ + "5f4909bde905cd3d294ad307074a05e4ae4deefcafe6272cd2d0436e73acb8dd", + "711fb2edb82dd222deaba3c91768b18cbbd453009235823282813c6e867dc2c1", + "eec79f7a02b804337e791ef231784862ae26e0599eb20224790e9d4f085fa9c0", + "c718b1939621233295ccaf6e8203e7fd94f3dd1bfb88f10c51bc5e33d53a24aa", + "616f5cbf25da83cb51d8d0741a7fc351620c9ca2c6513fa2094b4aa476f0912a" + ], + "top_sections": [ + "api.control_actions_endpoint:part_of", + "api.control_actions_endpoint:related_api", + "api.control_actions_endpoint:related_logic", + "api.health_endpoint:parent", + "api.health_endpoint:part_of" + ] + }, + "D1_DOCUMENT_CATALOG": { + "hits": 4, + "top_ids": [ + "docs/README.md", + "api.control_actions_endpoint", + "api.health_endpoint", + "api.send_message_endpoint" + ], + "top_sections": [ + "Readme", + "HTTP API /actions/{action}", + "HTTP API /health", + "HTTP API /send" + ] + }, + "D0_DOC_CHUNKS": { + "hits": 4, + "top_ids": [ + "docs/README.md" + ], + "top_sections": [ + "docs/README.md:Структура", + "docs/README.md:Навигация", + "docs/README.md:Правила и шаблоны", + "docs/README.md:Project Docs" + ] + } + }, + "query_entity_candidates": [], + "resolved_entity_candidates": [], + "query_anchor_candidates": [], + "resolved_anchor_candidates": [ + "api.control_actions_endpoint", + "docs/documentation/api/control-actions-endpoint.md", + "api.health_endpoint", + "docs/documentation/api/health-endpoint.md", + "api.send_message_endpoint", + "docs/documentation/api/send-message-endpoint.md", + "docs/README.md" + ], + "anchor_candidates": [], + "selected_anchor": null, + "anchor_selection_reason": "", + "anchor_match_type": "", + "doc_ids": [ + "api.control_actions_endpoint", + "api.health_endpoint", + "api.send_message_endpoint", + "docs/README.md", + "api.actions_endpoint" + ], + "doc_paths": [ + "docs/documentation/api/control-actions-endpoint.md", + "docs/documentation/api/health-endpoint.md", + "docs/documentation/api/send-message-endpoint.md", + "docs/README.md" + ], + "doc_titles": [ + "ControlActionSet", + "JSONResponse", + "TelegramControlChannel", + "TelegramNotifyWorker", + "RuntimeManager", + "WorkerHealth", + "TelegramControlAppFactory", + "api.control_actions_endpoint:part_of", + "api.control_actions_endpoint:related_api", + "api.control_actions_endpoint:related_logic", + "api.health_endpoint:parent", + "api.health_endpoint:part_of", + "api.health_endpoint:depends_on", + "api.send_message_endpoint:parent", + "api.control_actions_endpoint:parent", + "Readme", + "HTTP API /actions/{action}", + "HTTP API /health", + "HTTP API /send", + "docs/README.md:Структура", + "docs/README.md:Навигация", + "docs/README.md:Правила и шаблоны", + "docs/README.md:Project Docs" + ], + "relation_hits_count": 2, + "relation_targets": [ + "api.control_actions_endpoint:part_of", + "api.control_actions_endpoint:related_api" + ], + "selected_doc_ids": [ + "docs/README.md", + "api.control_actions_endpoint" + ], + "selected_fact_ids": [], + "selected_relation_ids": [ + "5f4909bde905cd3d294ad307074a05e4ae4deefcafe6272cd2d0436e73acb8dd", + "711fb2edb82dd222deaba3c91768b18cbbd453009235823282813c6e867dc2c1" + ], + "selected_chunk_ids": [ + "docs/README.md" + ], + "selected_entity_ids": [ + "api.control_actions_endpoint" + ], + "selected_workflow_ids": [], + "fallback_doc_hits_count": 2, + "fallback_used": false, + "fact_hits": 0, + "entity_hits": 0, + "evidence_summary": { + "documents": 1, + "facts": 0, + "entities": 2, + "workflows": 0, + "relations": 2, + "chunks": 1, + "selected_doc_ids": [ + "docs/README.md", + "api.control_actions_endpoint" + ], + "selected_fact_ids": [], + "selected_relation_ids": [ + "5f4909bde905cd3d294ad307074a05e4ae4deefcafe6272cd2d0436e73acb8dd", + "711fb2edb82dd222deaba3c91768b18cbbd453009235823282813c6e867dc2c1" + ], + "selected_chunk_ids": [ + "docs/README.md" + ], + "entity_hits": 0, + "openapi_signals": { + "path_found": false, + "method_found": false, + "operation_semantics_found": false, + "request_payload_found": false, + "request_schema": false, + "request_fields_found": false, + "response_payload_found": false, + "response_schema": false, + "response_fields_found": false, + "status_codes": false, + "content_type_found": false, + "examples_found": false, + "payload_description": false + } + }, + "gate_decision": "allow", + "gate_decision_reason": "evidence_sufficient", + "gate_missing_requirements": [], + "gate_satisfied_requirements": [ + "retrieval_non_empty" + ], + "openapi_evidence": { + "path_found": false, + "method_found": false, + "operation_semantics_found": false, + "request_payload_found": false, + "request_schema": false, + "request_fields_found": false, + "response_payload_found": false, + "response_schema": false, + "response_fields_found": false, + "status_codes": false, + "content_type_found": false, + "examples_found": false, + "payload_description": false + }, + "requested_fragment_type": null, + "fragment_evidence_found": [], + "fragment_missing_requirements": [], + "answer_mode": "ready", + "degrade_reason": null, + "degraded_reason": null, + "code_intents_stubbed": false +} + +## LLM Request +- prompt_name: docs_explain_answer +- log_context: graph.project_qa.docs.answer + +### Prompt Stats +```json +{ + "system_chars": 393, + "user_chars": 6052, + "tokens_in_estimate": 1612 +} +``` + +### System Prompt +```text +Ты объясняешь документацию системы. + +На вход приходит JSON с полями: +- question +- intent +- sub_intent +- documents +- facts +- relations + +Правила: +- Используй только предоставленные факты +- Не додумывай +- Если данных недостаточно, скажи это явно +- Объясняй структурировано + +Формат ответа: +1. Краткое описание +2. Основные элементы +3. Как это работает +4. Связи с другими частями системы (если есть) +``` + +### User Prompt +```json +{ + "question": "Опиши статус воркера", + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "ENTITY_EXPLAIN", + "documents": [ + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/README.md", + "title": "Readme", + "content": "Readme", + "metadata": { + "name": "", + "tags": [], + "type": "", + "layer": "", + "links": [], + "owner": null, + "title": "Readme", + "doc_id": null, + "module": "", + "parent": null, + "status": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "81d952f1a6ea85b76f75e0e57f33b8fa4b2bf3cb7db11b91b90171aeedd655a6", + "children": [], + "doc_kind": "readme", + "entities": [], + "updated_at": null, + "doc_version": null, + "document_id": "docs/README.md", + "source_path": "docs/README.md", + "summary_text": "", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + } + ], + "facts": [], + "entities": [ + { + "layer": "D3_ENTITY_CATALOG", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "ControlActionSet", + "content": "ControlActionSet", + "metadata": { + "tags": [ + "api", + "control-plane", + "lifecycle" + ], + "owner": null, + "doc_id": null, + "module": "telegram_notify_app", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "doc_version": null, + "document_id": "api.control_actions_endpoint", + "entity_name": "ControlActionSet", + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "artifact_type": null, + "document_type": "api_method", + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D3_ENTITY_CATALOG", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "JSONResponse", + "content": "JSONResponse", + "metadata": { + "tags": [ + "api", + "control-plane", + "lifecycle" + ], + "owner": null, + "doc_id": null, + "module": "telegram_notify_app", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "doc_version": null, + "document_id": "api.control_actions_endpoint", + "entity_name": "JSONResponse", + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "artifact_type": null, + "document_type": "api_method", + "last_modified": null, + "staleness_score": null, + "system_component": null + } + } + ], + "workflows": [], + "relations": [ + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "api.control_actions_endpoint:part_of", + "content": "api.control_actions_endpoint part_of architecture.telegram_notify_app", + "metadata": { + "owner": null, + "anchor": "frontmatter.links", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "source_id": "api.control_actions_endpoint", + "target_id": "architecture.telegram_notify_app", + "doc_version": null, + "relation_id": "5f4909bde905cd3d294ad307074a05e4ae4deefcafe6272cd2d0436e73acb8dd", + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "part_of", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "api.control_actions_endpoint:related_api", + "content": "api.control_actions_endpoint related_api api.health_endpoint", + "metadata": { + "owner": null, + "anchor": "frontmatter.links", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "source_id": "api.control_actions_endpoint", + "target_id": "api.health_endpoint", + "doc_version": null, + "relation_id": "711fb2edb82dd222deaba3c91768b18cbbd453009235823282813c6e867dc2c1", + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "related_api", + "staleness_score": null, + "system_component": null + } + } + ], + "chunks": [ + { + "layer": "D0_DOC_CHUNKS", + "path": "docs/README.md", + "title": "docs/README.md:Структура", + "content": "- `documentation/architecture/` — обзор архитектуры и ключевых компонентов.\n- `documentation/api/` — документация HTTP API control plane.\n- `documentation/logic/` — описание основных workflow и бизнес-логики.\n- `documentation/domain/` — описание ключевых сущностей и состояний.", + "metadata": { + "tags": [], + "type": null, + "order": 2, + "owner": null, + "doc_id": null, + "module": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "81d952f1a6ea85b76f75e0e57f33b8fa4b2bf3cb7db11b91b90171aeedd655a6", + "doc_kind": "readme", + "doc_version": null, + "document_id": "docs/README.md", + "source_path": "docs/README.md", + "section_path": "Project Docs > Структура", + "artifact_type": null, + "last_modified": null, + "section_title": "Структура", + "staleness_score": null, + "system_component": null + } + } + ] +} +``` + +### User Prompt Overview +- question: Опиши статус воркера +- intent: DOCUMENTATION_EXPLAIN +- sub_intent: ENTITY_EXPLAIN +- documents: 1 | samples: Readme +- facts: 0 +- relations: 2 | samples: api.control_actions_endpoint:part_of, api.control_actions_endpoint:related_api + +## Mismatches +- none \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/docs_router_llm_disambiguation/20260326_150139/full_chain_docs_intents_v3-3x_v3-general-1.json b/tests/pipeline_setup_v3/test_results/docs_router_llm_disambiguation/20260326_150139/full_chain_docs_intents_v3-3x_v3-general-1.json new file mode 100644 index 0000000..2c8668a --- /dev/null +++ b/tests/pipeline_setup_v3/test_results/docs_router_llm_disambiguation/20260326_150139/full_chain_docs_intents_v3-3x_v3-general-1.json @@ -0,0 +1,87 @@ +{ + "meta": { + "case_id": "v3-general-1", + "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_03_docs/full_chain_docs_intents_v3-3x.yaml", + "runner": "agent_runtime", + "mode": "pre_llm", + "passed": true, + "mismatches": [], + "actual": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "GENERIC_QA", + "graph_id": "DocsQAGraph", + "conversation_mode": "START", + "rag_count": 17, + "llm_answer": "", + "answer_mode": "answered", + "path_scope": [], + "doc_scope": [ + "api.control_actions_endpoint", + "api.health_endpoint", + "api.send_message_endpoint", + "docs/README.md", + "api.actions_endpoint" + ], + "entity_candidates": [], + "symbol_candidates": [], + "layers": [ + "D2_FACT_INDEX", + "D5_RELATION_GRAPH", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "filters": { + "doc_type": null + }, + "pipeline_mode": "pre_llm_only", + "gate_decision": "allow", + "prompt_used": "docs_explain_answer", + "llm_mode": "prose", + "degraded_reason": null, + "code_intents_stubbed": true + } + }, + "pipeline_steps": [ + { + "step": "input_query", + "input": { + "query": "Что есть в документации?" + }, + "output": { + "query": "Что есть в документации?" + } + }, + { + "step": "router", + "input": { + "query": "Что есть в документации?" + }, + "output": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "GENERIC_QA", + "graph_id": "DocsQAGraph", + "conversation_mode": "START" + } + }, + { + "step": "docs_pipeline", + "input": { + "query": "Что есть в документации?" + }, + "output": { + "answer_mode": "ready", + "prompt_name": "docs_explain_answer", + "llm_request": { + "prompt_name": "docs_explain_answer", + "log_context": "graph.project_qa.docs.answer", + "prompt_stats": { + "system_chars": 393, + "user_chars": 4507, + "tokens_in_estimate": 1225 + } + }, + "degraded_reason": "" + } + } + ] +} \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/docs_router_llm_disambiguation/20260326_150139/full_chain_docs_intents_v3-3x_v3-general-1.md b/tests/pipeline_setup_v3/test_results/docs_router_llm_disambiguation/20260326_150139/full_chain_docs_intents_v3-3x_v3-general-1.md new file mode 100644 index 0000000..9a17a91 --- /dev/null +++ b/tests/pipeline_setup_v3/test_results/docs_router_llm_disambiguation/20260326_150139/full_chain_docs_intents_v3-3x_v3-general-1.md @@ -0,0 +1,523 @@ +# v3-general-1 + +- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_03_docs/full_chain_docs_intents_v3-3x.yaml +- runner: agent_runtime +- mode: pre_llm +- passed: True + +## Query +Что есть в документации? + +## Actual +{ + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "GENERIC_QA", + "graph_id": "DocsQAGraph", + "conversation_mode": "START", + "rag_count": 17, + "llm_answer": "", + "answer_mode": "answered", + "path_scope": [], + "doc_scope": [ + "api.control_actions_endpoint", + "api.health_endpoint", + "api.send_message_endpoint", + "docs/README.md", + "api.actions_endpoint" + ], + "entity_candidates": [], + "symbol_candidates": [], + "layers": [ + "D2_FACT_INDEX", + "D5_RELATION_GRAPH", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "filters": { + "doc_type": null + }, + "pipeline_mode": "pre_llm_only", + "gate_decision": "allow", + "prompt_used": "docs_explain_answer", + "llm_mode": "prose", + "degraded_reason": null, + "code_intents_stubbed": true +} + +## Pipeline Steps +### input_query +```json +{ + "input": { + "query": "Что есть в документации?" + }, + "output": { + "query": "Что есть в документации?" + } +} +``` + +### router +```json +{ + "input": { + "query": "Что есть в документации?" + }, + "output": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "GENERIC_QA", + "graph_id": "DocsQAGraph", + "conversation_mode": "START" + } +} +``` + +### docs_pipeline +```json +{ + "input": { + "query": "Что есть в документации?" + }, + "output": { + "answer_mode": "ready", + "prompt_name": "docs_explain_answer", + "llm_request": { + "prompt_name": "docs_explain_answer", + "log_context": "graph.project_qa.docs.answer", + "prompt_stats": { + "system_chars": 393, + "user_chars": 4507, + "tokens_in_estimate": 1225 + } + }, + "degraded_reason": "" + } +} +``` + +## Diagnostics +{ + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "GENERIC_QA", + "layers_used": [ + "D2_FACT_INDEX", + "D5_RELATION_GRAPH", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "documents_found": 2, + "facts_found": 0, + "relations_found": 0, + "openapi_fields_extracted": 0, + "missing_required_fields": [], + "openapi_status": { + "has_path": false, + "has_method": false, + "has_request": false, + "has_response": false + }, + "prompt_used": "docs_explain_answer", + "llm_mode": "prose", + "output_valid": true, + "matched_intent_source": "deterministic", + "matched_anchor_type": "none", + "matched_anchor_value": null, + "exact_anchor_match": false, + "docs_layers_requested": [ + "D2_FACT_INDEX", + "D5_RELATION_GRAPH", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "docs_layers_with_hits": [ + "D2_FACT_INDEX", + "D5_RELATION_GRAPH", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "planned_layers": [ + "D2_FACT_INDEX", + "D5_RELATION_GRAPH", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "executed_layers": [ + "D2_FACT_INDEX", + "D5_RELATION_GRAPH", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "non_empty_layers": [ + "D2_FACT_INDEX", + "D5_RELATION_GRAPH", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "layer_diagnostics": { + "D2_FACT_INDEX": { + "hits": 8, + "top_ids": [ + "2f539384881f5f776bf4cef22c00669e53e0fd0761b3d62fa53593254a272f5a", + "5a27c821aa4efea9f2a7c883b57d1f53ec3af31348abd220bc09f47fbca73e93", + "0102eac8e4f8b452b0351a4aa8dca63e4774beadac71eba483708d7a90ff1cc0", + "43fc2c29bf6f353fa55f1b8a05c903dbd1a0e8067b026b9455043669ceca37d9", + "a31bbca2eb31ffb6655bcec7ff07b8cf2b6c7416610cf58dfc1e0c737df12fe1" + ], + "top_sections": [ + "docs/README.md:doc_list_item" + ] + }, + "D5_RELATION_GRAPH": { + "hits": 8, + "top_ids": [ + "5f4909bde905cd3d294ad307074a05e4ae4deefcafe6272cd2d0436e73acb8dd", + "711fb2edb82dd222deaba3c91768b18cbbd453009235823282813c6e867dc2c1", + "eec79f7a02b804337e791ef231784862ae26e0599eb20224790e9d4f085fa9c0", + "c718b1939621233295ccaf6e8203e7fd94f3dd1bfb88f10c51bc5e33d53a24aa", + "616f5cbf25da83cb51d8d0741a7fc351620c9ca2c6513fa2094b4aa476f0912a" + ], + "top_sections": [ + "api.control_actions_endpoint:part_of", + "api.control_actions_endpoint:related_api", + "api.control_actions_endpoint:related_logic", + "api.health_endpoint:parent", + "api.health_endpoint:part_of" + ] + }, + "D1_DOCUMENT_CATALOG": { + "hits": 4, + "top_ids": [ + "docs/README.md", + "api.control_actions_endpoint", + "api.health_endpoint", + "api.send_message_endpoint" + ], + "top_sections": [ + "Readme", + "HTTP API /actions/{action}", + "HTTP API /health", + "HTTP API /send" + ] + }, + "D0_DOC_CHUNKS": { + "hits": 4, + "top_ids": [ + "docs/README.md" + ], + "top_sections": [ + "docs/README.md:Структура", + "docs/README.md:Навигация", + "docs/README.md:Правила и шаблоны", + "docs/README.md:Project Docs" + ] + } + }, + "query_entity_candidates": [], + "resolved_entity_candidates": [], + "query_anchor_candidates": [], + "resolved_anchor_candidates": [ + "docs/README.md", + "docs/documentation/api/control-actions-endpoint.md", + "docs/documentation/api/health-endpoint.md", + "docs/documentation/api/send-message-endpoint.md", + "api.control_actions_endpoint", + "api.health_endpoint", + "api.send_message_endpoint" + ], + "anchor_candidates": [], + "selected_anchor": null, + "anchor_selection_reason": "", + "anchor_match_type": "", + "doc_ids": [ + "api.control_actions_endpoint", + "api.health_endpoint", + "api.send_message_endpoint", + "docs/README.md", + "api.actions_endpoint" + ], + "doc_paths": [ + "docs/README.md", + "docs/documentation/api/control-actions-endpoint.md", + "docs/documentation/api/health-endpoint.md", + "docs/documentation/api/send-message-endpoint.md" + ], + "doc_titles": [ + "docs/README.md:doc_list_item", + "api.control_actions_endpoint:part_of", + "api.control_actions_endpoint:related_api", + "api.control_actions_endpoint:related_logic", + "api.health_endpoint:parent", + "api.health_endpoint:part_of", + "api.health_endpoint:depends_on", + "api.send_message_endpoint:parent", + "api.control_actions_endpoint:parent", + "Readme", + "HTTP API /actions/{action}", + "HTTP API /health", + "HTTP API /send", + "docs/README.md:Структура", + "docs/README.md:Навигация", + "docs/README.md:Правила и шаблоны", + "docs/README.md:Project Docs" + ], + "relation_hits_count": 0, + "relation_targets": [], + "selected_doc_ids": [ + "docs/README.md", + "api.control_actions_endpoint" + ], + "selected_fact_ids": [], + "selected_relation_ids": [], + "selected_chunk_ids": [ + "docs/README.md" + ], + "selected_entity_ids": [], + "selected_workflow_ids": [], + "fallback_doc_hits_count": 3, + "fallback_used": false, + "fact_hits": 0, + "entity_hits": 0, + "evidence_summary": { + "documents": 2, + "facts": 0, + "entities": 0, + "workflows": 0, + "relations": 0, + "chunks": 1, + "selected_doc_ids": [ + "docs/README.md", + "api.control_actions_endpoint" + ], + "selected_fact_ids": [], + "selected_relation_ids": [], + "selected_chunk_ids": [ + "docs/README.md" + ], + "entity_hits": 0, + "openapi_signals": { + "path_found": false, + "method_found": false, + "operation_semantics_found": false, + "request_payload_found": false, + "request_schema": false, + "request_fields_found": false, + "response_payload_found": false, + "response_schema": false, + "response_fields_found": false, + "status_codes": false, + "content_type_found": false, + "examples_found": false, + "payload_description": false + } + }, + "gate_decision": "allow", + "gate_decision_reason": "evidence_sufficient", + "gate_missing_requirements": [], + "gate_satisfied_requirements": [ + "retrieval_non_empty" + ], + "openapi_evidence": { + "path_found": false, + "method_found": false, + "operation_semantics_found": false, + "request_payload_found": false, + "request_schema": false, + "request_fields_found": false, + "response_payload_found": false, + "response_schema": false, + "response_fields_found": false, + "status_codes": false, + "content_type_found": false, + "examples_found": false, + "payload_description": false + }, + "requested_fragment_type": null, + "fragment_evidence_found": [], + "fragment_missing_requirements": [], + "answer_mode": "ready", + "degrade_reason": null, + "degraded_reason": null, + "code_intents_stubbed": false +} + +## LLM Request +- prompt_name: docs_explain_answer +- log_context: graph.project_qa.docs.answer + +### Prompt Stats +```json +{ + "system_chars": 393, + "user_chars": 4507, + "tokens_in_estimate": 1225 +} +``` + +### System Prompt +```text +Ты объясняешь документацию системы. + +На вход приходит JSON с полями: +- question +- intent +- sub_intent +- documents +- facts +- relations + +Правила: +- Используй только предоставленные факты +- Не додумывай +- Если данных недостаточно, скажи это явно +- Объясняй структурировано + +Формат ответа: +1. Краткое описание +2. Основные элементы +3. Как это работает +4. Связи с другими частями системы (если есть) +``` + +### User Prompt +```json +{ + "question": "Что есть в документации?", + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "GENERIC_QA", + "documents": [ + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/README.md", + "title": "Readme", + "content": "Readme", + "metadata": { + "name": "", + "tags": [], + "type": "", + "layer": "", + "links": [], + "owner": null, + "title": "Readme", + "doc_id": null, + "module": "", + "parent": null, + "status": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "81d952f1a6ea85b76f75e0e57f33b8fa4b2bf3cb7db11b91b90171aeedd655a6", + "children": [], + "doc_kind": "readme", + "entities": [], + "updated_at": null, + "doc_version": null, + "document_id": "docs/README.md", + "source_path": "docs/README.md", + "summary_text": "", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "HTTP API /actions/{action}", + "content": "Endpoint `/actions/{action}` управляет control actions runtime и поддерживает `start`, `stop` и `status`. Для долгих операций `start` и `stop` допускается ответ HTTP 202, если действие еще выполняется. Endpoint используется для operator-driven управления жизненным циклом worker'а через HTTP API.", + "metadata": { + "name": "control_actions_endpoint", + "tags": [ + "api", + "control-plane", + "lifecycle" + ], + "type": "api_method", + "layer": "application", + "links": [ + { + "type": "part_of", + "target": "architecture.telegram_notify_app" + }, + { + "type": "related_api", + "target": "api.health_endpoint" + }, + { + "type": "related_logic", + "target": "logic.telegram_notification_loop" + } + ], + "owner": null, + "title": "HTTP API /actions/{action}", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "architecture.telegram_notify_app", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "children": [], + "doc_kind": "misc", + "entities": [ + "TelegramControlChannel", + "ControlActionSet", + "JSONResponse" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "api.control_actions_endpoint", + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "summary_text": "Endpoint `/actions/{action}` управляет control actions runtime и поддерживает `start`, `stop` и `status`. Для долгих операций `start` и `stop` допускается ответ HTTP 202, если действие еще выполняется. Endpoint используется для operator-driven управления жизненным циклом worker'а через HTTP API.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + } + ], + "facts": [], + "entities": [], + "workflows": [], + "relations": [], + "chunks": [ + { + "layer": "D0_DOC_CHUNKS", + "path": "docs/README.md", + "title": "docs/README.md:Структура", + "content": "- `documentation/architecture/` — обзор архитектуры и ключевых компонентов.\n- `documentation/api/` — документация HTTP API control plane.\n- `documentation/logic/` — описание основных workflow и бизнес-логики.\n- `documentation/domain/` — описание ключевых сущностей и состояний.", + "metadata": { + "tags": [], + "type": null, + "order": 2, + "owner": null, + "doc_id": null, + "module": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "81d952f1a6ea85b76f75e0e57f33b8fa4b2bf3cb7db11b91b90171aeedd655a6", + "doc_kind": "readme", + "doc_version": null, + "document_id": "docs/README.md", + "source_path": "docs/README.md", + "section_path": "Project Docs > Структура", + "artifact_type": null, + "last_modified": null, + "section_title": "Структура", + "staleness_score": null, + "system_component": null + } + } + ] +} +``` + +### User Prompt Overview +- question: Что есть в документации? +- intent: DOCUMENTATION_EXPLAIN +- sub_intent: GENERIC_QA +- documents: 2 | samples: Readme, HTTP API /actions/{action} +- facts: 0 +- relations: 0 + +## Mismatches +- none \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/docs_router_llm_disambiguation/20260326_150139/full_chain_docs_intents_v3-3x_v3-general-2.json b/tests/pipeline_setup_v3/test_results/docs_router_llm_disambiguation/20260326_150139/full_chain_docs_intents_v3-3x_v3-general-2.json new file mode 100644 index 0000000..a4f6dba --- /dev/null +++ b/tests/pipeline_setup_v3/test_results/docs_router_llm_disambiguation/20260326_150139/full_chain_docs_intents_v3-3x_v3-general-2.json @@ -0,0 +1,85 @@ +{ + "meta": { + "case_id": "v3-general-2", + "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_03_docs/full_chain_docs_intents_v3-3x.yaml", + "runner": "agent_runtime", + "mode": "pre_llm", + "passed": true, + "mismatches": [], + "actual": { + "intent": "GENERAL_QA", + "sub_intent": "GENERIC_QA", + "graph_id": "DocsQAGraph", + "conversation_mode": "START", + "rag_count": 8, + "llm_answer": "", + "answer_mode": "answered", + "path_scope": [], + "doc_scope": [ + "docs/README.md", + "api.control_actions_endpoint", + "api.actions_endpoint", + "api.health_endpoint", + "api.send_message_endpoint" + ], + "entity_candidates": [], + "symbol_candidates": [], + "layers": [ + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "filters": { + "doc_type": null + }, + "pipeline_mode": "pre_llm_only", + "gate_decision": "allow", + "prompt_used": "docs_general_answer", + "llm_mode": "prose", + "degraded_reason": null, + "code_intents_stubbed": true + } + }, + "pipeline_steps": [ + { + "step": "input_query", + "input": { + "query": "Какая структура документации?" + }, + "output": { + "query": "Какая структура документации?" + } + }, + { + "step": "router", + "input": { + "query": "Какая структура документации?" + }, + "output": { + "intent": "GENERAL_QA", + "sub_intent": "GENERIC_QA", + "graph_id": "DocsQAGraph", + "conversation_mode": "START" + } + }, + { + "step": "docs_pipeline", + "input": { + "query": "Какая структура документации?" + }, + "output": { + "answer_mode": "ready", + "prompt_name": "docs_general_answer", + "llm_request": { + "prompt_name": "docs_general_answer", + "log_context": "graph.project_qa.docs.answer", + "prompt_stats": { + "system_chars": 345, + "user_chars": 4501, + "tokens_in_estimate": 1212 + } + }, + "degraded_reason": "" + } + } + ] +} \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/docs_router_llm_disambiguation/20260326_150139/full_chain_docs_intents_v3-3x_v3-general-2.md b/tests/pipeline_setup_v3/test_results/docs_router_llm_disambiguation/20260326_150139/full_chain_docs_intents_v3-3x_v3-general-2.md new file mode 100644 index 0000000..73f48c3 --- /dev/null +++ b/tests/pipeline_setup_v3/test_results/docs_router_llm_disambiguation/20260326_150139/full_chain_docs_intents_v3-3x_v3-general-2.md @@ -0,0 +1,464 @@ +# v3-general-2 + +- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_03_docs/full_chain_docs_intents_v3-3x.yaml +- runner: agent_runtime +- mode: pre_llm +- passed: True + +## Query +Какая структура документации? + +## Actual +{ + "intent": "GENERAL_QA", + "sub_intent": "GENERIC_QA", + "graph_id": "DocsQAGraph", + "conversation_mode": "START", + "rag_count": 8, + "llm_answer": "", + "answer_mode": "answered", + "path_scope": [], + "doc_scope": [ + "docs/README.md", + "api.control_actions_endpoint", + "api.actions_endpoint", + "api.health_endpoint", + "api.send_message_endpoint" + ], + "entity_candidates": [], + "symbol_candidates": [], + "layers": [ + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "filters": { + "doc_type": null + }, + "pipeline_mode": "pre_llm_only", + "gate_decision": "allow", + "prompt_used": "docs_general_answer", + "llm_mode": "prose", + "degraded_reason": null, + "code_intents_stubbed": true +} + +## Pipeline Steps +### input_query +```json +{ + "input": { + "query": "Какая структура документации?" + }, + "output": { + "query": "Какая структура документации?" + } +} +``` + +### router +```json +{ + "input": { + "query": "Какая структура документации?" + }, + "output": { + "intent": "GENERAL_QA", + "sub_intent": "GENERIC_QA", + "graph_id": "DocsQAGraph", + "conversation_mode": "START" + } +} +``` + +### docs_pipeline +```json +{ + "input": { + "query": "Какая структура документации?" + }, + "output": { + "answer_mode": "ready", + "prompt_name": "docs_general_answer", + "llm_request": { + "prompt_name": "docs_general_answer", + "log_context": "graph.project_qa.docs.answer", + "prompt_stats": { + "system_chars": 345, + "user_chars": 4501, + "tokens_in_estimate": 1212 + } + }, + "degraded_reason": "" + } +} +``` + +## Diagnostics +{ + "intent": "GENERAL_QA", + "sub_intent": "GENERIC_QA", + "layers_used": [ + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "documents_found": 2, + "facts_found": 0, + "relations_found": 0, + "openapi_fields_extracted": 0, + "missing_required_fields": [], + "openapi_status": { + "has_path": false, + "has_method": false, + "has_request": false, + "has_response": false + }, + "prompt_used": "docs_general_answer", + "llm_mode": "prose", + "output_valid": true, + "matched_intent_source": "deterministic", + "matched_anchor_type": "none", + "matched_anchor_value": null, + "exact_anchor_match": false, + "docs_layers_requested": [ + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "docs_layers_with_hits": [ + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "planned_layers": [ + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "executed_layers": [ + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "non_empty_layers": [ + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "layer_diagnostics": { + "D1_DOCUMENT_CATALOG": { + "hits": 4, + "top_ids": [ + "docs/README.md", + "api.control_actions_endpoint", + "api.health_endpoint", + "api.send_message_endpoint" + ], + "top_sections": [ + "Readme", + "HTTP API /actions/{action}", + "HTTP API /health", + "HTTP API /send" + ] + }, + "D0_DOC_CHUNKS": { + "hits": 4, + "top_ids": [ + "docs/README.md" + ], + "top_sections": [ + "docs/README.md:Структура", + "docs/README.md:Навигация", + "docs/README.md:Правила и шаблоны", + "docs/README.md:Project Docs" + ] + } + }, + "query_entity_candidates": [], + "resolved_entity_candidates": [], + "query_anchor_candidates": [], + "resolved_anchor_candidates": [ + "docs/README.md", + "api.control_actions_endpoint", + "docs/documentation/api/control-actions-endpoint.md", + "api.health_endpoint", + "docs/documentation/api/health-endpoint.md", + "api.send_message_endpoint", + "docs/documentation/api/send-message-endpoint.md" + ], + "anchor_candidates": [], + "selected_anchor": null, + "anchor_selection_reason": "", + "anchor_match_type": "", + "doc_ids": [ + "docs/README.md", + "api.control_actions_endpoint", + "api.actions_endpoint", + "api.health_endpoint", + "api.send_message_endpoint" + ], + "doc_paths": [ + "docs/README.md", + "docs/documentation/api/control-actions-endpoint.md", + "docs/documentation/api/health-endpoint.md", + "docs/documentation/api/send-message-endpoint.md" + ], + "doc_titles": [ + "Readme", + "HTTP API /actions/{action}", + "HTTP API /health", + "HTTP API /send", + "docs/README.md:Структура", + "docs/README.md:Навигация", + "docs/README.md:Правила и шаблоны", + "docs/README.md:Project Docs" + ], + "relation_hits_count": 0, + "relation_targets": [], + "selected_doc_ids": [ + "docs/README.md", + "api.control_actions_endpoint" + ], + "selected_fact_ids": [], + "selected_relation_ids": [], + "selected_chunk_ids": [ + "docs/README.md" + ], + "selected_entity_ids": [], + "selected_workflow_ids": [], + "fallback_doc_hits_count": 3, + "fallback_used": false, + "fact_hits": 0, + "entity_hits": 0, + "evidence_summary": { + "documents": 2, + "facts": 0, + "entities": 0, + "workflows": 0, + "relations": 0, + "chunks": 1, + "selected_doc_ids": [ + "docs/README.md", + "api.control_actions_endpoint" + ], + "selected_fact_ids": [], + "selected_relation_ids": [], + "selected_chunk_ids": [ + "docs/README.md" + ], + "entity_hits": 0, + "openapi_signals": { + "path_found": false, + "method_found": false, + "operation_semantics_found": false, + "request_payload_found": false, + "request_schema": false, + "request_fields_found": false, + "response_payload_found": false, + "response_schema": false, + "response_fields_found": false, + "status_codes": false, + "content_type_found": false, + "examples_found": false, + "payload_description": false + } + }, + "gate_decision": "allow", + "gate_decision_reason": "evidence_sufficient", + "gate_missing_requirements": [], + "gate_satisfied_requirements": [ + "retrieval_non_empty" + ], + "openapi_evidence": { + "path_found": false, + "method_found": false, + "operation_semantics_found": false, + "request_payload_found": false, + "request_schema": false, + "request_fields_found": false, + "response_payload_found": false, + "response_schema": false, + "response_fields_found": false, + "status_codes": false, + "content_type_found": false, + "examples_found": false, + "payload_description": false + }, + "requested_fragment_type": null, + "fragment_evidence_found": [], + "fragment_missing_requirements": [], + "answer_mode": "ready", + "degrade_reason": null, + "degraded_reason": null, + "code_intents_stubbed": false +} + +## LLM Request +- prompt_name: docs_general_answer +- log_context: graph.project_qa.docs.answer + +### Prompt Stats +```json +{ + "system_chars": 345, + "user_chars": 4501, + "tokens_in_estimate": 1212 +} +``` + +### System Prompt +```text +Ты отвечаешь на общий вопрос по документации проекта. + +На вход приходит JSON с полями: +- question +- intent +- sub_intent +- documents +- facts +- relations + +Правила: +- Используй только предоставленные документы и факты +- Не додумывай отсутствующие детали +- Если данных недостаточно, скажи это прямо +- Дай короткий понятный ответ без лишней структуры +``` + +### User Prompt +```json +{ + "question": "Какая структура документации?", + "intent": "GENERAL_QA", + "sub_intent": "GENERIC_QA", + "documents": [ + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/README.md", + "title": "Readme", + "content": "Readme", + "metadata": { + "name": "", + "tags": [], + "type": "", + "layer": "", + "links": [], + "owner": null, + "title": "Readme", + "doc_id": null, + "module": "", + "parent": null, + "status": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "81d952f1a6ea85b76f75e0e57f33b8fa4b2bf3cb7db11b91b90171aeedd655a6", + "children": [], + "doc_kind": "readme", + "entities": [], + "updated_at": null, + "doc_version": null, + "document_id": "docs/README.md", + "source_path": "docs/README.md", + "summary_text": "", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "HTTP API /actions/{action}", + "content": "Endpoint `/actions/{action}` управляет control actions runtime и поддерживает `start`, `stop` и `status`. Для долгих операций `start` и `stop` допускается ответ HTTP 202, если действие еще выполняется. Endpoint используется для operator-driven управления жизненным циклом worker'а через HTTP API.", + "metadata": { + "name": "control_actions_endpoint", + "tags": [ + "api", + "control-plane", + "lifecycle" + ], + "type": "api_method", + "layer": "application", + "links": [ + { + "type": "part_of", + "target": "architecture.telegram_notify_app" + }, + { + "type": "related_api", + "target": "api.health_endpoint" + }, + { + "type": "related_logic", + "target": "logic.telegram_notification_loop" + } + ], + "owner": null, + "title": "HTTP API /actions/{action}", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "architecture.telegram_notify_app", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "children": [], + "doc_kind": "misc", + "entities": [ + "TelegramControlChannel", + "ControlActionSet", + "JSONResponse" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "api.control_actions_endpoint", + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "summary_text": "Endpoint `/actions/{action}` управляет control actions runtime и поддерживает `start`, `stop` и `status`. Для долгих операций `start` и `stop` допускается ответ HTTP 202, если действие еще выполняется. Endpoint используется для operator-driven управления жизненным циклом worker'а через HTTP API.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + } + ], + "facts": [], + "entities": [], + "workflows": [], + "relations": [], + "chunks": [ + { + "layer": "D0_DOC_CHUNKS", + "path": "docs/README.md", + "title": "docs/README.md:Структура", + "content": "- `documentation/architecture/` — обзор архитектуры и ключевых компонентов.\n- `documentation/api/` — документация HTTP API control plane.\n- `documentation/logic/` — описание основных workflow и бизнес-логики.\n- `documentation/domain/` — описание ключевых сущностей и состояний.", + "metadata": { + "tags": [], + "type": null, + "order": 2, + "owner": null, + "doc_id": null, + "module": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "81d952f1a6ea85b76f75e0e57f33b8fa4b2bf3cb7db11b91b90171aeedd655a6", + "doc_kind": "readme", + "doc_version": null, + "document_id": "docs/README.md", + "source_path": "docs/README.md", + "section_path": "Project Docs > Структура", + "artifact_type": null, + "last_modified": null, + "section_title": "Структура", + "staleness_score": null, + "system_component": null + } + } + ] +} +``` + +### User Prompt Overview +- question: Какая структура документации? +- intent: GENERAL_QA +- sub_intent: GENERIC_QA +- documents: 2 | samples: Readme, HTTP API /actions/{action} +- facts: 0 +- relations: 0 + +## Mismatches +- none \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/docs_router_llm_disambiguation/20260326_150139/full_chain_docs_intents_v3-3x_v3-general-3.json b/tests/pipeline_setup_v3/test_results/docs_router_llm_disambiguation/20260326_150139/full_chain_docs_intents_v3-3x_v3-general-3.json new file mode 100644 index 0000000..1afce12 --- /dev/null +++ b/tests/pipeline_setup_v3/test_results/docs_router_llm_disambiguation/20260326_150139/full_chain_docs_intents_v3-3x_v3-general-3.json @@ -0,0 +1,85 @@ +{ + "meta": { + "case_id": "v3-general-3", + "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_03_docs/full_chain_docs_intents_v3-3x.yaml", + "runner": "agent_runtime", + "mode": "pre_llm", + "passed": true, + "mismatches": [], + "actual": { + "intent": "GENERAL_QA", + "sub_intent": "GENERIC_QA", + "graph_id": "DocsQAGraph", + "conversation_mode": "START", + "rag_count": 8, + "llm_answer": "", + "answer_mode": "answered", + "path_scope": [], + "doc_scope": [ + "docs/README.md", + "api.control_actions_endpoint", + "api.actions_endpoint", + "api.health_endpoint", + "api.send_message_endpoint" + ], + "entity_candidates": [], + "symbol_candidates": [], + "layers": [ + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "filters": { + "doc_type": null + }, + "pipeline_mode": "pre_llm_only", + "gate_decision": "allow", + "prompt_used": "docs_general_answer", + "llm_mode": "prose", + "degraded_reason": null, + "code_intents_stubbed": true + } + }, + "pipeline_steps": [ + { + "step": "input_query", + "input": { + "query": "С чего начать читать документацию?" + }, + "output": { + "query": "С чего начать читать документацию?" + } + }, + { + "step": "router", + "input": { + "query": "С чего начать читать документацию?" + }, + "output": { + "intent": "GENERAL_QA", + "sub_intent": "GENERIC_QA", + "graph_id": "DocsQAGraph", + "conversation_mode": "START" + } + }, + { + "step": "docs_pipeline", + "input": { + "query": "С чего начать читать документацию?" + }, + "output": { + "answer_mode": "ready", + "prompt_name": "docs_general_answer", + "llm_request": { + "prompt_name": "docs_general_answer", + "log_context": "graph.project_qa.docs.answer", + "prompt_stats": { + "system_chars": 345, + "user_chars": 4506, + "tokens_in_estimate": 1213 + } + }, + "degraded_reason": "" + } + } + ] +} \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/docs_router_llm_disambiguation/20260326_150139/full_chain_docs_intents_v3-3x_v3-general-3.md b/tests/pipeline_setup_v3/test_results/docs_router_llm_disambiguation/20260326_150139/full_chain_docs_intents_v3-3x_v3-general-3.md new file mode 100644 index 0000000..189baac --- /dev/null +++ b/tests/pipeline_setup_v3/test_results/docs_router_llm_disambiguation/20260326_150139/full_chain_docs_intents_v3-3x_v3-general-3.md @@ -0,0 +1,464 @@ +# v3-general-3 + +- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_03_docs/full_chain_docs_intents_v3-3x.yaml +- runner: agent_runtime +- mode: pre_llm +- passed: True + +## Query +С чего начать читать документацию? + +## Actual +{ + "intent": "GENERAL_QA", + "sub_intent": "GENERIC_QA", + "graph_id": "DocsQAGraph", + "conversation_mode": "START", + "rag_count": 8, + "llm_answer": "", + "answer_mode": "answered", + "path_scope": [], + "doc_scope": [ + "docs/README.md", + "api.control_actions_endpoint", + "api.actions_endpoint", + "api.health_endpoint", + "api.send_message_endpoint" + ], + "entity_candidates": [], + "symbol_candidates": [], + "layers": [ + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "filters": { + "doc_type": null + }, + "pipeline_mode": "pre_llm_only", + "gate_decision": "allow", + "prompt_used": "docs_general_answer", + "llm_mode": "prose", + "degraded_reason": null, + "code_intents_stubbed": true +} + +## Pipeline Steps +### input_query +```json +{ + "input": { + "query": "С чего начать читать документацию?" + }, + "output": { + "query": "С чего начать читать документацию?" + } +} +``` + +### router +```json +{ + "input": { + "query": "С чего начать читать документацию?" + }, + "output": { + "intent": "GENERAL_QA", + "sub_intent": "GENERIC_QA", + "graph_id": "DocsQAGraph", + "conversation_mode": "START" + } +} +``` + +### docs_pipeline +```json +{ + "input": { + "query": "С чего начать читать документацию?" + }, + "output": { + "answer_mode": "ready", + "prompt_name": "docs_general_answer", + "llm_request": { + "prompt_name": "docs_general_answer", + "log_context": "graph.project_qa.docs.answer", + "prompt_stats": { + "system_chars": 345, + "user_chars": 4506, + "tokens_in_estimate": 1213 + } + }, + "degraded_reason": "" + } +} +``` + +## Diagnostics +{ + "intent": "GENERAL_QA", + "sub_intent": "GENERIC_QA", + "layers_used": [ + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "documents_found": 2, + "facts_found": 0, + "relations_found": 0, + "openapi_fields_extracted": 0, + "missing_required_fields": [], + "openapi_status": { + "has_path": false, + "has_method": false, + "has_request": false, + "has_response": false + }, + "prompt_used": "docs_general_answer", + "llm_mode": "prose", + "output_valid": true, + "matched_intent_source": "deterministic", + "matched_anchor_type": "none", + "matched_anchor_value": null, + "exact_anchor_match": false, + "docs_layers_requested": [ + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "docs_layers_with_hits": [ + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "planned_layers": [ + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "executed_layers": [ + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "non_empty_layers": [ + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "layer_diagnostics": { + "D1_DOCUMENT_CATALOG": { + "hits": 4, + "top_ids": [ + "docs/README.md", + "api.control_actions_endpoint", + "api.health_endpoint", + "api.send_message_endpoint" + ], + "top_sections": [ + "Readme", + "HTTP API /actions/{action}", + "HTTP API /health", + "HTTP API /send" + ] + }, + "D0_DOC_CHUNKS": { + "hits": 4, + "top_ids": [ + "docs/README.md" + ], + "top_sections": [ + "docs/README.md:Структура", + "docs/README.md:Навигация", + "docs/README.md:Правила и шаблоны", + "docs/README.md:Project Docs" + ] + } + }, + "query_entity_candidates": [], + "resolved_entity_candidates": [], + "query_anchor_candidates": [], + "resolved_anchor_candidates": [ + "docs/README.md", + "api.control_actions_endpoint", + "docs/documentation/api/control-actions-endpoint.md", + "api.health_endpoint", + "docs/documentation/api/health-endpoint.md", + "api.send_message_endpoint", + "docs/documentation/api/send-message-endpoint.md" + ], + "anchor_candidates": [], + "selected_anchor": null, + "anchor_selection_reason": "", + "anchor_match_type": "", + "doc_ids": [ + "docs/README.md", + "api.control_actions_endpoint", + "api.actions_endpoint", + "api.health_endpoint", + "api.send_message_endpoint" + ], + "doc_paths": [ + "docs/README.md", + "docs/documentation/api/control-actions-endpoint.md", + "docs/documentation/api/health-endpoint.md", + "docs/documentation/api/send-message-endpoint.md" + ], + "doc_titles": [ + "Readme", + "HTTP API /actions/{action}", + "HTTP API /health", + "HTTP API /send", + "docs/README.md:Структура", + "docs/README.md:Навигация", + "docs/README.md:Правила и шаблоны", + "docs/README.md:Project Docs" + ], + "relation_hits_count": 0, + "relation_targets": [], + "selected_doc_ids": [ + "docs/README.md", + "api.control_actions_endpoint" + ], + "selected_fact_ids": [], + "selected_relation_ids": [], + "selected_chunk_ids": [ + "docs/README.md" + ], + "selected_entity_ids": [], + "selected_workflow_ids": [], + "fallback_doc_hits_count": 3, + "fallback_used": false, + "fact_hits": 0, + "entity_hits": 0, + "evidence_summary": { + "documents": 2, + "facts": 0, + "entities": 0, + "workflows": 0, + "relations": 0, + "chunks": 1, + "selected_doc_ids": [ + "docs/README.md", + "api.control_actions_endpoint" + ], + "selected_fact_ids": [], + "selected_relation_ids": [], + "selected_chunk_ids": [ + "docs/README.md" + ], + "entity_hits": 0, + "openapi_signals": { + "path_found": false, + "method_found": false, + "operation_semantics_found": false, + "request_payload_found": false, + "request_schema": false, + "request_fields_found": false, + "response_payload_found": false, + "response_schema": false, + "response_fields_found": false, + "status_codes": false, + "content_type_found": false, + "examples_found": false, + "payload_description": false + } + }, + "gate_decision": "allow", + "gate_decision_reason": "evidence_sufficient", + "gate_missing_requirements": [], + "gate_satisfied_requirements": [ + "retrieval_non_empty" + ], + "openapi_evidence": { + "path_found": false, + "method_found": false, + "operation_semantics_found": false, + "request_payload_found": false, + "request_schema": false, + "request_fields_found": false, + "response_payload_found": false, + "response_schema": false, + "response_fields_found": false, + "status_codes": false, + "content_type_found": false, + "examples_found": false, + "payload_description": false + }, + "requested_fragment_type": null, + "fragment_evidence_found": [], + "fragment_missing_requirements": [], + "answer_mode": "ready", + "degrade_reason": null, + "degraded_reason": null, + "code_intents_stubbed": false +} + +## LLM Request +- prompt_name: docs_general_answer +- log_context: graph.project_qa.docs.answer + +### Prompt Stats +```json +{ + "system_chars": 345, + "user_chars": 4506, + "tokens_in_estimate": 1213 +} +``` + +### System Prompt +```text +Ты отвечаешь на общий вопрос по документации проекта. + +На вход приходит JSON с полями: +- question +- intent +- sub_intent +- documents +- facts +- relations + +Правила: +- Используй только предоставленные документы и факты +- Не додумывай отсутствующие детали +- Если данных недостаточно, скажи это прямо +- Дай короткий понятный ответ без лишней структуры +``` + +### User Prompt +```json +{ + "question": "С чего начать читать документацию?", + "intent": "GENERAL_QA", + "sub_intent": "GENERIC_QA", + "documents": [ + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/README.md", + "title": "Readme", + "content": "Readme", + "metadata": { + "name": "", + "tags": [], + "type": "", + "layer": "", + "links": [], + "owner": null, + "title": "Readme", + "doc_id": null, + "module": "", + "parent": null, + "status": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "81d952f1a6ea85b76f75e0e57f33b8fa4b2bf3cb7db11b91b90171aeedd655a6", + "children": [], + "doc_kind": "readme", + "entities": [], + "updated_at": null, + "doc_version": null, + "document_id": "docs/README.md", + "source_path": "docs/README.md", + "summary_text": "", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "HTTP API /actions/{action}", + "content": "Endpoint `/actions/{action}` управляет control actions runtime и поддерживает `start`, `stop` и `status`. Для долгих операций `start` и `stop` допускается ответ HTTP 202, если действие еще выполняется. Endpoint используется для operator-driven управления жизненным циклом worker'а через HTTP API.", + "metadata": { + "name": "control_actions_endpoint", + "tags": [ + "api", + "control-plane", + "lifecycle" + ], + "type": "api_method", + "layer": "application", + "links": [ + { + "type": "part_of", + "target": "architecture.telegram_notify_app" + }, + { + "type": "related_api", + "target": "api.health_endpoint" + }, + { + "type": "related_logic", + "target": "logic.telegram_notification_loop" + } + ], + "owner": null, + "title": "HTTP API /actions/{action}", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "architecture.telegram_notify_app", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "children": [], + "doc_kind": "misc", + "entities": [ + "TelegramControlChannel", + "ControlActionSet", + "JSONResponse" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "api.control_actions_endpoint", + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "summary_text": "Endpoint `/actions/{action}` управляет control actions runtime и поддерживает `start`, `stop` и `status`. Для долгих операций `start` и `stop` допускается ответ HTTP 202, если действие еще выполняется. Endpoint используется для operator-driven управления жизненным циклом worker'а через HTTP API.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + } + ], + "facts": [], + "entities": [], + "workflows": [], + "relations": [], + "chunks": [ + { + "layer": "D0_DOC_CHUNKS", + "path": "docs/README.md", + "title": "docs/README.md:Структура", + "content": "- `documentation/architecture/` — обзор архитектуры и ключевых компонентов.\n- `documentation/api/` — документация HTTP API control plane.\n- `documentation/logic/` — описание основных workflow и бизнес-логики.\n- `documentation/domain/` — описание ключевых сущностей и состояний.", + "metadata": { + "tags": [], + "type": null, + "order": 2, + "owner": null, + "doc_id": null, + "module": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "81d952f1a6ea85b76f75e0e57f33b8fa4b2bf3cb7db11b91b90171aeedd655a6", + "doc_kind": "readme", + "doc_version": null, + "document_id": "docs/README.md", + "source_path": "docs/README.md", + "section_path": "Project Docs > Структура", + "artifact_type": null, + "last_modified": null, + "section_title": "Структура", + "staleness_score": null, + "system_component": null + } + } + ] +} +``` + +### User Prompt Overview +- question: С чего начать читать документацию? +- intent: GENERAL_QA +- sub_intent: GENERIC_QA +- documents: 2 | samples: Readme, HTTP API /actions/{action} +- facts: 0 +- relations: 0 + +## Mismatches +- none \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/docs_router_llm_disambiguation/20260326_150139/full_chain_docs_intents_v3-3x_v3-negative-1.json b/tests/pipeline_setup_v3/test_results/docs_router_llm_disambiguation/20260326_150139/full_chain_docs_intents_v3-3x_v3-negative-1.json new file mode 100644 index 0000000..e2915b8 --- /dev/null +++ b/tests/pipeline_setup_v3/test_results/docs_router_llm_disambiguation/20260326_150139/full_chain_docs_intents_v3-3x_v3-negative-1.json @@ -0,0 +1,89 @@ +{ + "meta": { + "case_id": "v3-negative-1", + "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_03_docs/full_chain_docs_intents_v3-3x.yaml", + "runner": "agent_runtime", + "mode": "pre_llm", + "passed": true, + "mismatches": [], + "actual": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "ENTITY_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START", + "rag_count": 24, + "llm_answer": "", + "answer_mode": "answered", + "path_scope": [], + "doc_scope": [ + "api.control_actions_endpoint", + "api.health_endpoint", + "api.send_message_endpoint", + "docs/README.md", + "api.actions_endpoint" + ], + "entity_candidates": [ + "PaymentTransaction" + ], + "symbol_candidates": [], + "layers": [ + "D3_ENTITY_CATALOG", + "D5_RELATION_GRAPH", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "filters": { + "doc_type": null + }, + "pipeline_mode": "pre_llm_only", + "gate_decision": "allow", + "prompt_used": "docs_explain_answer", + "llm_mode": "prose", + "degraded_reason": null, + "code_intents_stubbed": true + } + }, + "pipeline_steps": [ + { + "step": "input_query", + "input": { + "query": "Что такое PaymentTransaction?" + }, + "output": { + "query": "Что такое PaymentTransaction?" + } + }, + { + "step": "router", + "input": { + "query": "Что такое PaymentTransaction?" + }, + "output": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "ENTITY_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START" + } + }, + { + "step": "docs_pipeline", + "input": { + "query": "Что такое PaymentTransaction?" + }, + "output": { + "answer_mode": "ready", + "prompt_name": "docs_explain_answer", + "llm_request": { + "prompt_name": "docs_explain_answer", + "log_context": "graph.project_qa.docs.answer", + "prompt_stats": { + "system_chars": 393, + "user_chars": 6061, + "tokens_in_estimate": 1614 + } + }, + "degraded_reason": "" + } + } + ] +} \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/docs_router_llm_disambiguation/20260326_150139/full_chain_docs_intents_v3-3x_v3-negative-1.md b/tests/pipeline_setup_v3/test_results/docs_router_llm_disambiguation/20260326_150139/full_chain_docs_intents_v3-3x_v3-negative-1.md new file mode 100644 index 0000000..85f2f4f --- /dev/null +++ b/tests/pipeline_setup_v3/test_results/docs_router_llm_disambiguation/20260326_150139/full_chain_docs_intents_v3-3x_v3-negative-1.md @@ -0,0 +1,598 @@ +# v3-negative-1 + +- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_03_docs/full_chain_docs_intents_v3-3x.yaml +- runner: agent_runtime +- mode: pre_llm +- passed: True + +## Query +Что такое PaymentTransaction? + +## Actual +{ + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "ENTITY_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START", + "rag_count": 24, + "llm_answer": "", + "answer_mode": "answered", + "path_scope": [], + "doc_scope": [ + "api.control_actions_endpoint", + "api.health_endpoint", + "api.send_message_endpoint", + "docs/README.md", + "api.actions_endpoint" + ], + "entity_candidates": [ + "PaymentTransaction" + ], + "symbol_candidates": [], + "layers": [ + "D3_ENTITY_CATALOG", + "D5_RELATION_GRAPH", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "filters": { + "doc_type": null + }, + "pipeline_mode": "pre_llm_only", + "gate_decision": "allow", + "prompt_used": "docs_explain_answer", + "llm_mode": "prose", + "degraded_reason": null, + "code_intents_stubbed": true +} + +## Pipeline Steps +### input_query +```json +{ + "input": { + "query": "Что такое PaymentTransaction?" + }, + "output": { + "query": "Что такое PaymentTransaction?" + } +} +``` + +### router +```json +{ + "input": { + "query": "Что такое PaymentTransaction?" + }, + "output": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "ENTITY_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START" + } +} +``` + +### docs_pipeline +```json +{ + "input": { + "query": "Что такое PaymentTransaction?" + }, + "output": { + "answer_mode": "ready", + "prompt_name": "docs_explain_answer", + "llm_request": { + "prompt_name": "docs_explain_answer", + "log_context": "graph.project_qa.docs.answer", + "prompt_stats": { + "system_chars": 393, + "user_chars": 6061, + "tokens_in_estimate": 1614 + } + }, + "degraded_reason": "" + } +} +``` + +## Diagnostics +{ + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "ENTITY_EXPLAIN", + "layers_used": [ + "D3_ENTITY_CATALOG", + "D5_RELATION_GRAPH", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "documents_found": 1, + "facts_found": 0, + "relations_found": 2, + "openapi_fields_extracted": 0, + "missing_required_fields": [], + "openapi_status": { + "has_path": false, + "has_method": false, + "has_request": false, + "has_response": false + }, + "prompt_used": "docs_explain_answer", + "llm_mode": "prose", + "output_valid": true, + "matched_intent_source": "deterministic", + "matched_anchor_type": "none", + "matched_anchor_value": null, + "exact_anchor_match": false, + "docs_layers_requested": [ + "D3_ENTITY_CATALOG", + "D5_RELATION_GRAPH", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "docs_layers_with_hits": [ + "D3_ENTITY_CATALOG", + "D5_RELATION_GRAPH", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "planned_layers": [ + "D3_ENTITY_CATALOG", + "D5_RELATION_GRAPH", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "executed_layers": [ + "D3_ENTITY_CATALOG", + "D5_RELATION_GRAPH", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "non_empty_layers": [ + "D3_ENTITY_CATALOG", + "D5_RELATION_GRAPH", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "layer_diagnostics": { + "D3_ENTITY_CATALOG": { + "hits": 8, + "top_ids": [ + "api.control_actions_endpoint", + "api.health_endpoint" + ], + "top_sections": [ + "ControlActionSet", + "JSONResponse", + "TelegramControlChannel", + "TelegramNotifyWorker", + "RuntimeManager" + ] + }, + "D5_RELATION_GRAPH": { + "hits": 8, + "top_ids": [ + "5f4909bde905cd3d294ad307074a05e4ae4deefcafe6272cd2d0436e73acb8dd", + "711fb2edb82dd222deaba3c91768b18cbbd453009235823282813c6e867dc2c1", + "eec79f7a02b804337e791ef231784862ae26e0599eb20224790e9d4f085fa9c0", + "c718b1939621233295ccaf6e8203e7fd94f3dd1bfb88f10c51bc5e33d53a24aa", + "616f5cbf25da83cb51d8d0741a7fc351620c9ca2c6513fa2094b4aa476f0912a" + ], + "top_sections": [ + "api.control_actions_endpoint:part_of", + "api.control_actions_endpoint:related_api", + "api.control_actions_endpoint:related_logic", + "api.health_endpoint:parent", + "api.health_endpoint:part_of" + ] + }, + "D1_DOCUMENT_CATALOG": { + "hits": 4, + "top_ids": [ + "docs/README.md", + "api.control_actions_endpoint", + "api.health_endpoint", + "api.send_message_endpoint" + ], + "top_sections": [ + "Readme", + "HTTP API /actions/{action}", + "HTTP API /health", + "HTTP API /send" + ] + }, + "D0_DOC_CHUNKS": { + "hits": 4, + "top_ids": [ + "docs/README.md" + ], + "top_sections": [ + "docs/README.md:Структура", + "docs/README.md:Навигация", + "docs/README.md:Правила и шаблоны", + "docs/README.md:Project Docs" + ] + } + }, + "query_entity_candidates": [ + "PaymentTransaction" + ], + "resolved_entity_candidates": [], + "query_anchor_candidates": [ + "PaymentTransaction" + ], + "resolved_anchor_candidates": [ + "api.control_actions_endpoint", + "docs/documentation/api/control-actions-endpoint.md", + "api.health_endpoint", + "docs/documentation/api/health-endpoint.md", + "api.send_message_endpoint", + "docs/documentation/api/send-message-endpoint.md", + "docs/README.md" + ], + "anchor_candidates": [], + "selected_anchor": null, + "anchor_selection_reason": "", + "anchor_match_type": "", + "doc_ids": [ + "api.control_actions_endpoint", + "api.health_endpoint", + "api.send_message_endpoint", + "docs/README.md", + "api.actions_endpoint" + ], + "doc_paths": [ + "docs/documentation/api/control-actions-endpoint.md", + "docs/documentation/api/health-endpoint.md", + "docs/documentation/api/send-message-endpoint.md", + "docs/README.md" + ], + "doc_titles": [ + "ControlActionSet", + "JSONResponse", + "TelegramControlChannel", + "TelegramNotifyWorker", + "RuntimeManager", + "WorkerHealth", + "TelegramControlAppFactory", + "api.control_actions_endpoint:part_of", + "api.control_actions_endpoint:related_api", + "api.control_actions_endpoint:related_logic", + "api.health_endpoint:parent", + "api.health_endpoint:part_of", + "api.health_endpoint:depends_on", + "api.send_message_endpoint:parent", + "api.control_actions_endpoint:parent", + "Readme", + "HTTP API /actions/{action}", + "HTTP API /health", + "HTTP API /send", + "docs/README.md:Структура", + "docs/README.md:Навигация", + "docs/README.md:Правила и шаблоны", + "docs/README.md:Project Docs" + ], + "relation_hits_count": 2, + "relation_targets": [ + "api.control_actions_endpoint:part_of", + "api.control_actions_endpoint:related_api" + ], + "selected_doc_ids": [ + "docs/README.md", + "api.control_actions_endpoint" + ], + "selected_fact_ids": [], + "selected_relation_ids": [ + "5f4909bde905cd3d294ad307074a05e4ae4deefcafe6272cd2d0436e73acb8dd", + "711fb2edb82dd222deaba3c91768b18cbbd453009235823282813c6e867dc2c1" + ], + "selected_chunk_ids": [ + "docs/README.md" + ], + "selected_entity_ids": [ + "api.control_actions_endpoint" + ], + "selected_workflow_ids": [], + "fallback_doc_hits_count": 2, + "fallback_used": false, + "fact_hits": 0, + "entity_hits": 0, + "evidence_summary": { + "documents": 1, + "facts": 0, + "entities": 2, + "workflows": 0, + "relations": 2, + "chunks": 1, + "selected_doc_ids": [ + "docs/README.md", + "api.control_actions_endpoint" + ], + "selected_fact_ids": [], + "selected_relation_ids": [ + "5f4909bde905cd3d294ad307074a05e4ae4deefcafe6272cd2d0436e73acb8dd", + "711fb2edb82dd222deaba3c91768b18cbbd453009235823282813c6e867dc2c1" + ], + "selected_chunk_ids": [ + "docs/README.md" + ], + "entity_hits": 0, + "openapi_signals": { + "path_found": false, + "method_found": false, + "operation_semantics_found": false, + "request_payload_found": false, + "request_schema": false, + "request_fields_found": false, + "response_payload_found": false, + "response_schema": false, + "response_fields_found": false, + "status_codes": false, + "content_type_found": false, + "examples_found": false, + "payload_description": false + } + }, + "gate_decision": "allow", + "gate_decision_reason": "evidence_sufficient", + "gate_missing_requirements": [], + "gate_satisfied_requirements": [ + "retrieval_non_empty" + ], + "openapi_evidence": { + "path_found": false, + "method_found": false, + "operation_semantics_found": false, + "request_payload_found": false, + "request_schema": false, + "request_fields_found": false, + "response_payload_found": false, + "response_schema": false, + "response_fields_found": false, + "status_codes": false, + "content_type_found": false, + "examples_found": false, + "payload_description": false + }, + "requested_fragment_type": null, + "fragment_evidence_found": [], + "fragment_missing_requirements": [], + "answer_mode": "ready", + "degrade_reason": null, + "degraded_reason": null, + "code_intents_stubbed": false +} + +## LLM Request +- prompt_name: docs_explain_answer +- log_context: graph.project_qa.docs.answer + +### Prompt Stats +```json +{ + "system_chars": 393, + "user_chars": 6061, + "tokens_in_estimate": 1614 +} +``` + +### System Prompt +```text +Ты объясняешь документацию системы. + +На вход приходит JSON с полями: +- question +- intent +- sub_intent +- documents +- facts +- relations + +Правила: +- Используй только предоставленные факты +- Не додумывай +- Если данных недостаточно, скажи это явно +- Объясняй структурировано + +Формат ответа: +1. Краткое описание +2. Основные элементы +3. Как это работает +4. Связи с другими частями системы (если есть) +``` + +### User Prompt +```json +{ + "question": "Что такое PaymentTransaction?", + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "ENTITY_EXPLAIN", + "documents": [ + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/README.md", + "title": "Readme", + "content": "Readme", + "metadata": { + "name": "", + "tags": [], + "type": "", + "layer": "", + "links": [], + "owner": null, + "title": "Readme", + "doc_id": null, + "module": "", + "parent": null, + "status": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "81d952f1a6ea85b76f75e0e57f33b8fa4b2bf3cb7db11b91b90171aeedd655a6", + "children": [], + "doc_kind": "readme", + "entities": [], + "updated_at": null, + "doc_version": null, + "document_id": "docs/README.md", + "source_path": "docs/README.md", + "summary_text": "", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + } + ], + "facts": [], + "entities": [ + { + "layer": "D3_ENTITY_CATALOG", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "ControlActionSet", + "content": "ControlActionSet", + "metadata": { + "tags": [ + "api", + "control-plane", + "lifecycle" + ], + "owner": null, + "doc_id": null, + "module": "telegram_notify_app", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "doc_version": null, + "document_id": "api.control_actions_endpoint", + "entity_name": "ControlActionSet", + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "artifact_type": null, + "document_type": "api_method", + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D3_ENTITY_CATALOG", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "JSONResponse", + "content": "JSONResponse", + "metadata": { + "tags": [ + "api", + "control-plane", + "lifecycle" + ], + "owner": null, + "doc_id": null, + "module": "telegram_notify_app", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "doc_version": null, + "document_id": "api.control_actions_endpoint", + "entity_name": "JSONResponse", + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "artifact_type": null, + "document_type": "api_method", + "last_modified": null, + "staleness_score": null, + "system_component": null + } + } + ], + "workflows": [], + "relations": [ + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "api.control_actions_endpoint:part_of", + "content": "api.control_actions_endpoint part_of architecture.telegram_notify_app", + "metadata": { + "owner": null, + "anchor": "frontmatter.links", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "source_id": "api.control_actions_endpoint", + "target_id": "architecture.telegram_notify_app", + "doc_version": null, + "relation_id": "5f4909bde905cd3d294ad307074a05e4ae4deefcafe6272cd2d0436e73acb8dd", + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "part_of", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "api.control_actions_endpoint:related_api", + "content": "api.control_actions_endpoint related_api api.health_endpoint", + "metadata": { + "owner": null, + "anchor": "frontmatter.links", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "source_id": "api.control_actions_endpoint", + "target_id": "api.health_endpoint", + "doc_version": null, + "relation_id": "711fb2edb82dd222deaba3c91768b18cbbd453009235823282813c6e867dc2c1", + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "related_api", + "staleness_score": null, + "system_component": null + } + } + ], + "chunks": [ + { + "layer": "D0_DOC_CHUNKS", + "path": "docs/README.md", + "title": "docs/README.md:Структура", + "content": "- `documentation/architecture/` — обзор архитектуры и ключевых компонентов.\n- `documentation/api/` — документация HTTP API control plane.\n- `documentation/logic/` — описание основных workflow и бизнес-логики.\n- `documentation/domain/` — описание ключевых сущностей и состояний.", + "metadata": { + "tags": [], + "type": null, + "order": 2, + "owner": null, + "doc_id": null, + "module": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "81d952f1a6ea85b76f75e0e57f33b8fa4b2bf3cb7db11b91b90171aeedd655a6", + "doc_kind": "readme", + "doc_version": null, + "document_id": "docs/README.md", + "source_path": "docs/README.md", + "section_path": "Project Docs > Структура", + "artifact_type": null, + "last_modified": null, + "section_title": "Структура", + "staleness_score": null, + "system_component": null + } + } + ] +} +``` + +### User Prompt Overview +- question: Что такое PaymentTransaction? +- intent: DOCUMENTATION_EXPLAIN +- sub_intent: ENTITY_EXPLAIN +- documents: 1 | samples: Readme +- facts: 0 +- relations: 2 | samples: api.control_actions_endpoint:part_of, api.control_actions_endpoint:related_api + +## Mismatches +- none \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/docs_router_llm_disambiguation/20260326_150139/full_chain_docs_intents_v3-3x_v3-negative-2.json b/tests/pipeline_setup_v3/test_results/docs_router_llm_disambiguation/20260326_150139/full_chain_docs_intents_v3-3x_v3-negative-2.json new file mode 100644 index 0000000..3e1b302 --- /dev/null +++ b/tests/pipeline_setup_v3/test_results/docs_router_llm_disambiguation/20260326_150139/full_chain_docs_intents_v3-3x_v3-negative-2.json @@ -0,0 +1,83 @@ +{ + "meta": { + "case_id": "v3-negative-2", + "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_03_docs/full_chain_docs_intents_v3-3x.yaml", + "runner": "agent_runtime", + "mode": "pre_llm", + "passed": true, + "mismatches": [], + "actual": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "ENTITY_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START", + "rag_count": 0, + "llm_answer": "", + "answer_mode": "degraded", + "path_scope": [], + "doc_scope": [], + "entity_candidates": [ + "UnknownEntity" + ], + "symbol_candidates": [], + "layers": [ + "D3_ENTITY_CATALOG", + "D5_RELATION_GRAPH", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "filters": { + "doc_type": null + }, + "pipeline_mode": "pre_llm_only", + "gate_decision": "reject", + "prompt_used": "docs_explain_answer", + "llm_mode": "prose", + "degraded_reason": "not_found_exact_anchor", + "code_intents_stubbed": true + } + }, + "pipeline_steps": [ + { + "step": "input_query", + "input": { + "query": "Объясни сущность UnknownEntity" + }, + "output": { + "query": "Объясни сущность UnknownEntity" + } + }, + { + "step": "router", + "input": { + "query": "Объясни сущность UnknownEntity" + }, + "output": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "ENTITY_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START" + } + }, + { + "step": "docs_pipeline", + "input": { + "query": "Объясни сущность UnknownEntity" + }, + "output": { + "answer_mode": "degraded", + "prompt_name": "docs_explain_answer", + "llm_request": { + "prompt_name": "docs_explain_answer", + "log_context": "graph.project_qa.docs.answer", + "prompt_stats": { + "system_chars": 393, + "user_chars": 227, + "tokens_in_estimate": 155 + } + }, + "degraded_reason": "not_found_exact_anchor" + } + } + ] +} \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/docs_router_llm_disambiguation/20260326_150139/full_chain_docs_intents_v3-3x_v3-negative-2.md b/tests/pipeline_setup_v3/test_results/docs_router_llm_disambiguation/20260326_150139/full_chain_docs_intents_v3-3x_v3-negative-2.md new file mode 100644 index 0000000..885aa6c --- /dev/null +++ b/tests/pipeline_setup_v3/test_results/docs_router_llm_disambiguation/20260326_150139/full_chain_docs_intents_v3-3x_v3-negative-2.md @@ -0,0 +1,360 @@ +# v3-negative-2 + +- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_03_docs/full_chain_docs_intents_v3-3x.yaml +- runner: agent_runtime +- mode: pre_llm +- passed: True + +## Query +Объясни сущность UnknownEntity + +## Actual +{ + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "ENTITY_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START", + "rag_count": 0, + "llm_answer": "", + "answer_mode": "degraded", + "path_scope": [], + "doc_scope": [], + "entity_candidates": [ + "UnknownEntity" + ], + "symbol_candidates": [], + "layers": [ + "D3_ENTITY_CATALOG", + "D5_RELATION_GRAPH", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "filters": { + "doc_type": null + }, + "pipeline_mode": "pre_llm_only", + "gate_decision": "reject", + "prompt_used": "docs_explain_answer", + "llm_mode": "prose", + "degraded_reason": "not_found_exact_anchor", + "code_intents_stubbed": true +} + +## Pipeline Steps +### input_query +```json +{ + "input": { + "query": "Объясни сущность UnknownEntity" + }, + "output": { + "query": "Объясни сущность UnknownEntity" + } +} +``` + +### router +```json +{ + "input": { + "query": "Объясни сущность UnknownEntity" + }, + "output": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "ENTITY_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START" + } +} +``` + +### docs_pipeline +```json +{ + "input": { + "query": "Объясни сущность UnknownEntity" + }, + "output": { + "answer_mode": "degraded", + "prompt_name": "docs_explain_answer", + "llm_request": { + "prompt_name": "docs_explain_answer", + "log_context": "graph.project_qa.docs.answer", + "prompt_stats": { + "system_chars": 393, + "user_chars": 227, + "tokens_in_estimate": 155 + } + }, + "degraded_reason": "not_found_exact_anchor" + } +} +``` + +## Diagnostics +{ + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "ENTITY_EXPLAIN", + "layers_used": [ + "D3_ENTITY_CATALOG", + "D5_RELATION_GRAPH", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "documents_found": 0, + "facts_found": 0, + "relations_found": 0, + "openapi_fields_extracted": 0, + "missing_required_fields": [], + "openapi_status": { + "has_path": false, + "has_method": false, + "has_request": false, + "has_response": false + }, + "prompt_used": "docs_explain_answer", + "llm_mode": "prose", + "output_valid": false, + "matched_intent_source": "deterministic", + "matched_anchor_type": "entity", + "matched_anchor_value": "UnknownEntity", + "exact_anchor_match": false, + "docs_layers_requested": [ + "D3_ENTITY_CATALOG", + "D5_RELATION_GRAPH", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "docs_layers_with_hits": [ + "D3_ENTITY_CATALOG", + "D5_RELATION_GRAPH", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "planned_layers": [ + "D3_ENTITY_CATALOG", + "D5_RELATION_GRAPH", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "executed_layers": [ + "D3_ENTITY_CATALOG", + "D5_RELATION_GRAPH", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "non_empty_layers": [ + "D3_ENTITY_CATALOG", + "D5_RELATION_GRAPH", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "layer_diagnostics": { + "D3_ENTITY_CATALOG": { + "hits": 8, + "top_ids": [ + "api.control_actions_endpoint", + "api.health_endpoint" + ], + "top_sections": [ + "ControlActionSet", + "JSONResponse", + "TelegramControlChannel", + "TelegramNotifyWorker", + "RuntimeManager" + ] + }, + "D5_RELATION_GRAPH": { + "hits": 8, + "top_ids": [ + "5f4909bde905cd3d294ad307074a05e4ae4deefcafe6272cd2d0436e73acb8dd", + "711fb2edb82dd222deaba3c91768b18cbbd453009235823282813c6e867dc2c1", + "eec79f7a02b804337e791ef231784862ae26e0599eb20224790e9d4f085fa9c0", + "c718b1939621233295ccaf6e8203e7fd94f3dd1bfb88f10c51bc5e33d53a24aa", + "616f5cbf25da83cb51d8d0741a7fc351620c9ca2c6513fa2094b4aa476f0912a" + ], + "top_sections": [ + "api.control_actions_endpoint:part_of", + "api.control_actions_endpoint:related_api", + "api.control_actions_endpoint:related_logic", + "api.health_endpoint:parent", + "api.health_endpoint:part_of" + ] + }, + "D1_DOCUMENT_CATALOG": { + "hits": 4, + "top_ids": [ + "docs/README.md", + "api.control_actions_endpoint", + "api.health_endpoint", + "api.send_message_endpoint" + ], + "top_sections": [ + "Readme", + "HTTP API /actions/{action}", + "HTTP API /health", + "HTTP API /send" + ] + }, + "D0_DOC_CHUNKS": { + "hits": 4, + "top_ids": [ + "docs/README.md" + ], + "top_sections": [ + "docs/README.md:Структура", + "docs/README.md:Навигация", + "docs/README.md:Правила и шаблоны", + "docs/README.md:Project Docs" + ] + } + }, + "query_entity_candidates": [ + "UnknownEntity" + ], + "resolved_entity_candidates": [], + "query_anchor_candidates": [ + "UnknownEntity" + ], + "resolved_anchor_candidates": [], + "anchor_candidates": [], + "selected_anchor": null, + "anchor_selection_reason": "", + "anchor_match_type": "", + "doc_ids": [], + "doc_paths": [], + "doc_titles": [], + "relation_hits_count": 0, + "relation_targets": [], + "selected_doc_ids": [], + "selected_fact_ids": [], + "selected_relation_ids": [], + "selected_chunk_ids": [], + "selected_entity_ids": [], + "selected_workflow_ids": [], + "fallback_doc_hits_count": 0, + "fallback_used": false, + "fact_hits": 0, + "entity_hits": 0, + "evidence_summary": { + "documents": 0, + "facts": 0, + "entities": 0, + "workflows": 0, + "relations": 0, + "chunks": 0, + "selected_doc_ids": [], + "selected_fact_ids": [], + "selected_relation_ids": [], + "selected_chunk_ids": [], + "entity_hits": 0, + "openapi_signals": { + "path_found": false, + "method_found": false, + "operation_semantics_found": false, + "request_payload_found": false, + "request_schema": false, + "request_fields_found": false, + "response_payload_found": false, + "response_schema": false, + "response_fields_found": false, + "status_codes": false, + "content_type_found": false, + "examples_found": false, + "payload_description": false + } + }, + "gate_decision": "reject", + "gate_decision_reason": "not_found_exact_anchor", + "gate_missing_requirements": [ + "retrieval_non_empty", + "exact_anchor_match" + ], + "gate_satisfied_requirements": [], + "openapi_evidence": { + "path_found": false, + "method_found": false, + "operation_semantics_found": false, + "request_payload_found": false, + "request_schema": false, + "request_fields_found": false, + "response_payload_found": false, + "response_schema": false, + "response_fields_found": false, + "status_codes": false, + "content_type_found": false, + "examples_found": false, + "payload_description": false + }, + "requested_fragment_type": null, + "fragment_evidence_found": [], + "fragment_missing_requirements": [], + "answer_mode": "degraded", + "degrade_reason": "not_found_exact_anchor", + "degraded_reason": "not_found_exact_anchor", + "code_intents_stubbed": false +} + +## LLM Request +- prompt_name: docs_explain_answer +- log_context: graph.project_qa.docs.answer + +### Prompt Stats +```json +{ + "system_chars": 393, + "user_chars": 227, + "tokens_in_estimate": 155 +} +``` + +### System Prompt +```text +Ты объясняешь документацию системы. + +На вход приходит JSON с полями: +- question +- intent +- sub_intent +- documents +- facts +- relations + +Правила: +- Используй только предоставленные факты +- Не додумывай +- Если данных недостаточно, скажи это явно +- Объясняй структурировано + +Формат ответа: +1. Краткое описание +2. Основные элементы +3. Как это работает +4. Связи с другими частями системы (если есть) +``` + +### User Prompt +```json +{ + "question": "Объясни сущность UnknownEntity", + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "ENTITY_EXPLAIN", + "documents": [], + "facts": [], + "entities": [], + "workflows": [], + "relations": [], + "chunks": [] +} +``` + +### User Prompt Overview +- question: Объясни сущность UnknownEntity +- intent: DOCUMENTATION_EXPLAIN +- sub_intent: ENTITY_EXPLAIN +- documents: 0 +- facts: 0 +- relations: 0 + +## Mismatches +- none \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/docs_router_llm_disambiguation/20260326_150139/full_chain_docs_intents_v3-3x_v3-negative-3.json b/tests/pipeline_setup_v3/test_results/docs_router_llm_disambiguation/20260326_150139/full_chain_docs_intents_v3-3x_v3-negative-3.json new file mode 100644 index 0000000..fe3f383 --- /dev/null +++ b/tests/pipeline_setup_v3/test_results/docs_router_llm_disambiguation/20260326_150139/full_chain_docs_intents_v3-3x_v3-negative-3.json @@ -0,0 +1,81 @@ +{ + "meta": { + "case_id": "v3-negative-3", + "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_03_docs/full_chain_docs_intents_v3-3x.yaml", + "runner": "agent_runtime", + "mode": "pre_llm", + "passed": true, + "mismatches": [], + "actual": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "API_METHOD_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START", + "rag_count": 0, + "llm_answer": "", + "answer_mode": "degraded", + "path_scope": [], + "doc_scope": [], + "entity_candidates": [], + "symbol_candidates": [], + "layers": [ + "D2_FACT_INDEX", + "D4_WORKFLOW_INDEX", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "filters": { + "doc_type": "api_method" + }, + "pipeline_mode": "pre_llm_only", + "gate_decision": "reject", + "prompt_used": "docs_explain_answer", + "llm_mode": "prose", + "degraded_reason": "not_found_exact_anchor", + "code_intents_stubbed": true + } + }, + "pipeline_steps": [ + { + "step": "input_query", + "input": { + "query": "Что делает endpoint /unknown?" + }, + "output": { + "query": "Что делает endpoint /unknown?" + } + }, + { + "step": "router", + "input": { + "query": "Что делает endpoint /unknown?" + }, + "output": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "API_METHOD_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START" + } + }, + { + "step": "docs_pipeline", + "input": { + "query": "Что делает endpoint /unknown?" + }, + "output": { + "answer_mode": "degraded", + "prompt_name": "docs_explain_answer", + "llm_request": { + "prompt_name": "docs_explain_answer", + "log_context": "graph.project_qa.docs.answer", + "prompt_stats": { + "system_chars": 393, + "user_chars": 230, + "tokens_in_estimate": 156 + } + }, + "degraded_reason": "not_found_exact_anchor" + } + } + ] +} \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/docs_router_llm_disambiguation/20260326_150139/full_chain_docs_intents_v3-3x_v3-negative-3.md b/tests/pipeline_setup_v3/test_results/docs_router_llm_disambiguation/20260326_150139/full_chain_docs_intents_v3-3x_v3-negative-3.md new file mode 100644 index 0000000..039515b --- /dev/null +++ b/tests/pipeline_setup_v3/test_results/docs_router_llm_disambiguation/20260326_150139/full_chain_docs_intents_v3-3x_v3-negative-3.md @@ -0,0 +1,350 @@ +# v3-negative-3 + +- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_03_docs/full_chain_docs_intents_v3-3x.yaml +- runner: agent_runtime +- mode: pre_llm +- passed: True + +## Query +Что делает endpoint /unknown? + +## Actual +{ + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "API_METHOD_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START", + "rag_count": 0, + "llm_answer": "", + "answer_mode": "degraded", + "path_scope": [], + "doc_scope": [], + "entity_candidates": [], + "symbol_candidates": [], + "layers": [ + "D2_FACT_INDEX", + "D4_WORKFLOW_INDEX", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "filters": { + "doc_type": "api_method" + }, + "pipeline_mode": "pre_llm_only", + "gate_decision": "reject", + "prompt_used": "docs_explain_answer", + "llm_mode": "prose", + "degraded_reason": "not_found_exact_anchor", + "code_intents_stubbed": true +} + +## Pipeline Steps +### input_query +```json +{ + "input": { + "query": "Что делает endpoint /unknown?" + }, + "output": { + "query": "Что делает endpoint /unknown?" + } +} +``` + +### router +```json +{ + "input": { + "query": "Что делает endpoint /unknown?" + }, + "output": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "API_METHOD_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START" + } +} +``` + +### docs_pipeline +```json +{ + "input": { + "query": "Что делает endpoint /unknown?" + }, + "output": { + "answer_mode": "degraded", + "prompt_name": "docs_explain_answer", + "llm_request": { + "prompt_name": "docs_explain_answer", + "log_context": "graph.project_qa.docs.answer", + "prompt_stats": { + "system_chars": 393, + "user_chars": 230, + "tokens_in_estimate": 156 + } + }, + "degraded_reason": "not_found_exact_anchor" + } +} +``` + +## Diagnostics +{ + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "API_METHOD_EXPLAIN", + "layers_used": [ + "D2_FACT_INDEX", + "D4_WORKFLOW_INDEX", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "documents_found": 0, + "facts_found": 0, + "relations_found": 0, + "openapi_fields_extracted": 0, + "missing_required_fields": [], + "openapi_status": { + "has_path": false, + "has_method": false, + "has_request": false, + "has_response": false + }, + "prompt_used": "docs_explain_answer", + "llm_mode": "prose", + "output_valid": false, + "matched_intent_source": "deterministic", + "matched_anchor_type": "endpoint", + "matched_anchor_value": "/unknown", + "exact_anchor_match": false, + "docs_layers_requested": [ + "D2_FACT_INDEX", + "D4_WORKFLOW_INDEX", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "docs_layers_with_hits": [ + "D2_FACT_INDEX", + "D4_WORKFLOW_INDEX", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "planned_layers": [ + "D2_FACT_INDEX", + "D4_WORKFLOW_INDEX", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "executed_layers": [ + "D2_FACT_INDEX", + "D4_WORKFLOW_INDEX", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "non_empty_layers": [ + "D2_FACT_INDEX", + "D4_WORKFLOW_INDEX", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "layer_diagnostics": { + "D2_FACT_INDEX": { + "hits": 8, + "top_ids": [ + "f85d982c272a2ee6baeadc433221a20e684cd8ef01cb4788d6f76d05ca56d6d0", + "b8e44c3adb74aaa6c91ae8815fa091289e58dd3990a3a1b63e850c62075aea75", + "bafb867ffed41c9db637df98d6cd5f6722d7747bbebc6c03e6f0d0caf3b7f9f3", + "54bbcbac242f1c85ec3280236ed5841998a8a3a548ff16cbf0b5acafbff469e3", + "b6bfad59b3bf00f199b5ef90c1208af19664de700413e7354468a93a4abaaa2f" + ], + "top_sections": [ + "api.control_actions_endpoint:workflow_step", + "api.control_actions_endpoint:mentions_entity" + ] + }, + "D4_WORKFLOW_INDEX": { + "hits": 3, + "top_ids": [ + "api.control_actions_endpoint", + "api.health_endpoint", + "api.send_message_endpoint" + ], + "top_sections": [ + "Scenario" + ] + }, + "D1_DOCUMENT_CATALOG": { + "hits": 4, + "top_ids": [ + "api.send_message_endpoint", + "api.control_actions_endpoint", + "api.health_endpoint", + "docs/README.md" + ], + "top_sections": [ + "HTTP API /send", + "HTTP API /actions/{action}", + "HTTP API /health", + "Readme" + ] + }, + "D0_DOC_CHUNKS": { + "hits": 4, + "top_ids": [ + "api.control_actions_endpoint" + ], + "top_sections": [ + "api.control_actions_endpoint:Описание", + "api.control_actions_endpoint:Сценарий", + "api.control_actions_endpoint:Summary", + "api.control_actions_endpoint:Функциональные требования" + ] + } + }, + "query_entity_candidates": [], + "resolved_entity_candidates": [], + "query_anchor_candidates": [ + "/unknown" + ], + "resolved_anchor_candidates": [], + "anchor_candidates": [], + "selected_anchor": null, + "anchor_selection_reason": "", + "anchor_match_type": "", + "doc_ids": [], + "doc_paths": [], + "doc_titles": [], + "relation_hits_count": 0, + "relation_targets": [], + "selected_doc_ids": [], + "selected_fact_ids": [], + "selected_relation_ids": [], + "selected_chunk_ids": [], + "selected_entity_ids": [], + "selected_workflow_ids": [], + "fallback_doc_hits_count": 0, + "fallback_used": false, + "fact_hits": 0, + "entity_hits": 0, + "evidence_summary": { + "documents": 0, + "facts": 0, + "entities": 0, + "workflows": 0, + "relations": 0, + "chunks": 0, + "selected_doc_ids": [], + "selected_fact_ids": [], + "selected_relation_ids": [], + "selected_chunk_ids": [], + "entity_hits": 0, + "openapi_signals": { + "path_found": false, + "method_found": false, + "operation_semantics_found": false, + "request_payload_found": false, + "request_schema": false, + "request_fields_found": false, + "response_payload_found": false, + "response_schema": false, + "response_fields_found": false, + "status_codes": false, + "content_type_found": false, + "examples_found": false, + "payload_description": false + } + }, + "gate_decision": "reject", + "gate_decision_reason": "not_found_exact_anchor", + "gate_missing_requirements": [ + "retrieval_non_empty", + "exact_anchor_match" + ], + "gate_satisfied_requirements": [], + "openapi_evidence": { + "path_found": false, + "method_found": false, + "operation_semantics_found": false, + "request_payload_found": false, + "request_schema": false, + "request_fields_found": false, + "response_payload_found": false, + "response_schema": false, + "response_fields_found": false, + "status_codes": false, + "content_type_found": false, + "examples_found": false, + "payload_description": false + }, + "requested_fragment_type": null, + "fragment_evidence_found": [], + "fragment_missing_requirements": [], + "answer_mode": "degraded", + "degrade_reason": "not_found_exact_anchor", + "degraded_reason": "not_found_exact_anchor", + "code_intents_stubbed": false +} + +## LLM Request +- prompt_name: docs_explain_answer +- log_context: graph.project_qa.docs.answer + +### Prompt Stats +```json +{ + "system_chars": 393, + "user_chars": 230, + "tokens_in_estimate": 156 +} +``` + +### System Prompt +```text +Ты объясняешь документацию системы. + +На вход приходит JSON с полями: +- question +- intent +- sub_intent +- documents +- facts +- relations + +Правила: +- Используй только предоставленные факты +- Не додумывай +- Если данных недостаточно, скажи это явно +- Объясняй структурировано + +Формат ответа: +1. Краткое описание +2. Основные элементы +3. Как это работает +4. Связи с другими частями системы (если есть) +``` + +### User Prompt +```json +{ + "question": "Что делает endpoint /unknown?", + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "API_METHOD_EXPLAIN", + "documents": [], + "facts": [], + "entities": [], + "workflows": [], + "relations": [], + "chunks": [] +} +``` + +### User Prompt Overview +- question: Что делает endpoint /unknown? +- intent: DOCUMENTATION_EXPLAIN +- sub_intent: API_METHOD_EXPLAIN +- documents: 0 +- facts: 0 +- relations: 0 + +## Mismatches +- none \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/docs_router_llm_disambiguation/20260326_150139/full_chain_docs_intents_v3-3x_v3-related-architecture-1.json b/tests/pipeline_setup_v3/test_results/docs_router_llm_disambiguation/20260326_150139/full_chain_docs_intents_v3-3x_v3-related-architecture-1.json new file mode 100644 index 0000000..f1aaa33 --- /dev/null +++ b/tests/pipeline_setup_v3/test_results/docs_router_llm_disambiguation/20260326_150139/full_chain_docs_intents_v3-3x_v3-related-architecture-1.json @@ -0,0 +1,84 @@ +{ + "meta": { + "case_id": "v3-related-architecture-1", + "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_03_docs/full_chain_docs_intents_v3-3x.yaml", + "runner": "agent_runtime", + "mode": "pre_llm", + "passed": true, + "mismatches": [], + "actual": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "RELATED_DOCS_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START", + "rag_count": 14, + "llm_answer": "", + "answer_mode": "answered", + "path_scope": [], + "doc_scope": [ + "api.control_actions_endpoint", + "api.health_endpoint", + "api.send_message_endpoint" + ], + "entity_candidates": [], + "symbol_candidates": [], + "layers": [ + "D5_RELATION_GRAPH", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "filters": { + "doc_type": null + }, + "pipeline_mode": "pre_llm_only", + "gate_decision": "allow", + "prompt_used": "docs_explain_answer", + "llm_mode": "graph_summary", + "degraded_reason": null, + "code_intents_stubbed": true + } + }, + "pipeline_steps": [ + { + "step": "input_query", + "input": { + "query": "Какие документы связаны с архитектурой?" + }, + "output": { + "query": "Какие документы связаны с архитектурой?" + } + }, + { + "step": "router", + "input": { + "query": "Какие документы связаны с архитектурой?" + }, + "output": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "RELATED_DOCS_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START" + } + }, + { + "step": "docs_pipeline", + "input": { + "query": "Какие документы связаны с архитектурой?" + }, + "output": { + "answer_mode": "ready", + "prompt_name": "docs_explain_answer", + "llm_request": { + "prompt_name": "docs_explain_answer", + "log_context": "graph.project_qa.docs.answer", + "prompt_stats": { + "system_chars": 393, + "user_chars": 5470, + "tokens_in_estimate": 1466 + } + }, + "degraded_reason": "" + } + } + ] +} \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/docs_router_llm_disambiguation/20260326_150139/full_chain_docs_intents_v3-3x_v3-related-architecture-1.md b/tests/pipeline_setup_v3/test_results/docs_router_llm_disambiguation/20260326_150139/full_chain_docs_intents_v3-3x_v3-related-architecture-1.md new file mode 100644 index 0000000..873a04e --- /dev/null +++ b/tests/pipeline_setup_v3/test_results/docs_router_llm_disambiguation/20260326_150139/full_chain_docs_intents_v3-3x_v3-related-architecture-1.md @@ -0,0 +1,502 @@ +# v3-related-architecture-1 + +- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_03_docs/full_chain_docs_intents_v3-3x.yaml +- runner: agent_runtime +- mode: pre_llm +- passed: True + +## Query +Какие документы связаны с архитектурой? + +## Actual +{ + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "RELATED_DOCS_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START", + "rag_count": 14, + "llm_answer": "", + "answer_mode": "answered", + "path_scope": [], + "doc_scope": [ + "api.control_actions_endpoint", + "api.health_endpoint", + "api.send_message_endpoint" + ], + "entity_candidates": [], + "symbol_candidates": [], + "layers": [ + "D5_RELATION_GRAPH", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "filters": { + "doc_type": null + }, + "pipeline_mode": "pre_llm_only", + "gate_decision": "allow", + "prompt_used": "docs_explain_answer", + "llm_mode": "graph_summary", + "degraded_reason": null, + "code_intents_stubbed": true +} + +## Pipeline Steps +### input_query +```json +{ + "input": { + "query": "Какие документы связаны с архитектурой?" + }, + "output": { + "query": "Какие документы связаны с архитектурой?" + } +} +``` + +### router +```json +{ + "input": { + "query": "Какие документы связаны с архитектурой?" + }, + "output": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "RELATED_DOCS_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START" + } +} +``` + +### docs_pipeline +```json +{ + "input": { + "query": "Какие документы связаны с архитектурой?" + }, + "output": { + "answer_mode": "ready", + "prompt_name": "docs_explain_answer", + "llm_request": { + "prompt_name": "docs_explain_answer", + "log_context": "graph.project_qa.docs.answer", + "prompt_stats": { + "system_chars": 393, + "user_chars": 5470, + "tokens_in_estimate": 1466 + } + }, + "degraded_reason": "" + } +} +``` + +## Diagnostics +{ + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "RELATED_DOCS_EXPLAIN", + "layers_used": [ + "D5_RELATION_GRAPH", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "documents_found": 0, + "facts_found": 0, + "relations_found": 4, + "openapi_fields_extracted": 0, + "missing_required_fields": [], + "openapi_status": { + "has_path": false, + "has_method": false, + "has_request": false, + "has_response": false + }, + "prompt_used": "docs_explain_answer", + "llm_mode": "graph_summary", + "output_valid": true, + "matched_intent_source": "deterministic", + "matched_anchor_type": "none", + "matched_anchor_value": null, + "exact_anchor_match": false, + "docs_layers_requested": [ + "D5_RELATION_GRAPH", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "docs_layers_with_hits": [ + "D5_RELATION_GRAPH" + ], + "planned_layers": [ + "D5_RELATION_GRAPH", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "executed_layers": [ + "D5_RELATION_GRAPH" + ], + "non_empty_layers": [ + "D5_RELATION_GRAPH" + ], + "layer_diagnostics": { + "D5_RELATION_GRAPH": { + "hits": 8, + "top_ids": [ + "5f4909bde905cd3d294ad307074a05e4ae4deefcafe6272cd2d0436e73acb8dd", + "711fb2edb82dd222deaba3c91768b18cbbd453009235823282813c6e867dc2c1", + "eec79f7a02b804337e791ef231784862ae26e0599eb20224790e9d4f085fa9c0", + "c718b1939621233295ccaf6e8203e7fd94f3dd1bfb88f10c51bc5e33d53a24aa", + "616f5cbf25da83cb51d8d0741a7fc351620c9ca2c6513fa2094b4aa476f0912a" + ], + "top_sections": [ + "api.control_actions_endpoint:part_of", + "api.control_actions_endpoint:related_api", + "api.control_actions_endpoint:related_logic", + "api.health_endpoint:parent", + "api.health_endpoint:part_of" + ] + }, + "D1_DOCUMENT_CATALOG": { + "hits": 0, + "top_ids": [], + "skipped": true, + "reason": "relation_primary_sufficient" + }, + "D0_DOC_CHUNKS": { + "hits": 6, + "top_ids": [ + "api.control_actions_endpoint" + ], + "top_sections": [ + "api.control_actions_endpoint:Summary", + "api.control_actions_endpoint:Описание", + "api.control_actions_endpoint:Сценарий", + "api.control_actions_endpoint:Функциональные требования", + "api.control_actions_endpoint:Нефункциональные требования" + ] + } + }, + "query_entity_candidates": [], + "resolved_entity_candidates": [], + "query_anchor_candidates": [], + "resolved_anchor_candidates": [ + "docs/documentation/api/control-actions-endpoint.md", + "docs/documentation/api/health-endpoint.md", + "docs/documentation/api/send-message-endpoint.md", + "api.control_actions_endpoint" + ], + "anchor_candidates": [ + "api.control_actions_endpoint", + "api.health_endpoint", + "api.send_message_endpoint" + ], + "selected_anchor": "api.control_actions_endpoint", + "anchor_selection_reason": "relation_neighbor", + "anchor_match_type": "semantic_fallback", + "doc_ids": [ + "api.control_actions_endpoint", + "api.health_endpoint", + "api.send_message_endpoint" + ], + "doc_paths": [ + "docs/documentation/api/control-actions-endpoint.md", + "docs/documentation/api/health-endpoint.md", + "docs/documentation/api/send-message-endpoint.md" + ], + "doc_titles": [ + "api.control_actions_endpoint:part_of", + "api.control_actions_endpoint:related_api", + "api.control_actions_endpoint:related_logic", + "api.health_endpoint:parent", + "api.health_endpoint:part_of", + "api.health_endpoint:depends_on", + "api.send_message_endpoint:parent", + "api.control_actions_endpoint:parent", + "api.control_actions_endpoint:Summary", + "api.control_actions_endpoint:Описание", + "api.control_actions_endpoint:Сценарий", + "api.control_actions_endpoint:Функциональные требования", + "api.control_actions_endpoint:Нефункциональные требования", + "api.control_actions_endpoint:Входные параметры" + ], + "relation_hits_count": 4, + "relation_targets": [ + "api.control_actions_endpoint:part_of", + "api.control_actions_endpoint:related_api", + "api.control_actions_endpoint:related_logic", + "api.health_endpoint:parent" + ], + "selected_doc_ids": [], + "selected_fact_ids": [], + "selected_relation_ids": [ + "5f4909bde905cd3d294ad307074a05e4ae4deefcafe6272cd2d0436e73acb8dd", + "711fb2edb82dd222deaba3c91768b18cbbd453009235823282813c6e867dc2c1", + "eec79f7a02b804337e791ef231784862ae26e0599eb20224790e9d4f085fa9c0", + "c718b1939621233295ccaf6e8203e7fd94f3dd1bfb88f10c51bc5e33d53a24aa" + ], + "selected_chunk_ids": [ + "api.control_actions_endpoint" + ], + "selected_entity_ids": [], + "selected_workflow_ids": [], + "fallback_doc_hits_count": 1, + "fallback_used": true, + "fact_hits": 0, + "entity_hits": 0, + "evidence_summary": { + "documents": 0, + "facts": 0, + "entities": 0, + "workflows": 0, + "relations": 4, + "chunks": 1, + "selected_doc_ids": [], + "selected_fact_ids": [], + "selected_relation_ids": [ + "5f4909bde905cd3d294ad307074a05e4ae4deefcafe6272cd2d0436e73acb8dd", + "711fb2edb82dd222deaba3c91768b18cbbd453009235823282813c6e867dc2c1", + "eec79f7a02b804337e791ef231784862ae26e0599eb20224790e9d4f085fa9c0", + "c718b1939621233295ccaf6e8203e7fd94f3dd1bfb88f10c51bc5e33d53a24aa" + ], + "selected_chunk_ids": [ + "api.control_actions_endpoint" + ], + "entity_hits": 0, + "openapi_signals": { + "path_found": false, + "method_found": false, + "operation_semantics_found": false, + "request_payload_found": false, + "request_schema": false, + "request_fields_found": false, + "response_payload_found": false, + "response_schema": false, + "response_fields_found": false, + "status_codes": false, + "content_type_found": false, + "examples_found": false, + "payload_description": false + } + }, + "gate_decision": "allow", + "gate_decision_reason": "relation_evidence_available", + "gate_missing_requirements": [], + "gate_satisfied_requirements": [ + "retrieval_non_empty" + ], + "openapi_evidence": { + "path_found": false, + "method_found": false, + "operation_semantics_found": false, + "request_payload_found": false, + "request_schema": false, + "request_fields_found": false, + "response_payload_found": false, + "response_schema": false, + "response_fields_found": false, + "status_codes": false, + "content_type_found": false, + "examples_found": false, + "payload_description": false + }, + "requested_fragment_type": null, + "fragment_evidence_found": [], + "fragment_missing_requirements": [], + "answer_mode": "ready", + "degrade_reason": null, + "degraded_reason": null, + "code_intents_stubbed": false +} + +## LLM Request +- prompt_name: docs_explain_answer +- log_context: graph.project_qa.docs.answer + +### Prompt Stats +```json +{ + "system_chars": 393, + "user_chars": 5470, + "tokens_in_estimate": 1466 +} +``` + +### System Prompt +```text +Ты объясняешь документацию системы. + +На вход приходит JSON с полями: +- question +- intent +- sub_intent +- documents +- facts +- relations + +Правила: +- Используй только предоставленные факты +- Не додумывай +- Если данных недостаточно, скажи это явно +- Объясняй структурировано + +Формат ответа: +1. Краткое описание +2. Основные элементы +3. Как это работает +4. Связи с другими частями системы (если есть) +``` + +### User Prompt +```json +{ + "question": "Какие документы связаны с архитектурой?", + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "RELATED_DOCS_EXPLAIN", + "documents": [], + "facts": [], + "entities": [], + "workflows": [], + "relations": [ + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "api.control_actions_endpoint:part_of", + "content": "api.control_actions_endpoint part_of architecture.telegram_notify_app", + "metadata": { + "owner": null, + "anchor": "frontmatter.links", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "source_id": "api.control_actions_endpoint", + "target_id": "architecture.telegram_notify_app", + "doc_version": null, + "relation_id": "5f4909bde905cd3d294ad307074a05e4ae4deefcafe6272cd2d0436e73acb8dd", + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "part_of", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "api.control_actions_endpoint:related_api", + "content": "api.control_actions_endpoint related_api api.health_endpoint", + "metadata": { + "owner": null, + "anchor": "frontmatter.links", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "source_id": "api.control_actions_endpoint", + "target_id": "api.health_endpoint", + "doc_version": null, + "relation_id": "711fb2edb82dd222deaba3c91768b18cbbd453009235823282813c6e867dc2c1", + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "related_api", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "api.control_actions_endpoint:related_logic", + "content": "api.control_actions_endpoint related_logic logic.telegram_notification_loop", + "metadata": { + "owner": null, + "anchor": "frontmatter.links", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "source_id": "api.control_actions_endpoint", + "target_id": "logic.telegram_notification_loop", + "doc_version": null, + "relation_id": "eec79f7a02b804337e791ef231784862ae26e0599eb20224790e9d4f085fa9c0", + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "related_logic", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/api/health-endpoint.md", + "title": "api.health_endpoint:parent", + "content": "api.health_endpoint parent architecture.telegram_notify_app", + "metadata": { + "owner": null, + "anchor": "frontmatter.parent", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "8b5a533a8076e2e9d36995eee29aeade260080bdca2ec8e21fe28f08574b983f", + "source_id": "api.health_endpoint", + "target_id": "architecture.telegram_notify_app", + "doc_version": null, + "relation_id": "c718b1939621233295ccaf6e8203e7fd94f3dd1bfb88f10c51bc5e33d53a24aa", + "source_path": "docs/documentation/api/health-endpoint.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "parent", + "staleness_score": null, + "system_component": null + } + } + ], + "chunks": [ + { + "layer": "D0_DOC_CHUNKS", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "api.control_actions_endpoint:Summary", + "content": "Endpoint `/actions/{action}` управляет control actions runtime и поддерживает `start`, `stop` и `status`. Для долгих операций `start` и `stop` допускается ответ HTTP 202, если действие еще выполняется. Endpoint используется для operator-driven управления жизненным циклом worker'а через HTTP API.", + "metadata": { + "tags": [ + "api", + "control-plane", + "lifecycle" + ], + "type": "api_method", + "order": 1, + "owner": null, + "doc_id": null, + "module": "telegram_notify_app", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "doc_kind": "misc", + "doc_version": null, + "document_id": "api.control_actions_endpoint", + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "section_path": "Summary", + "artifact_type": null, + "last_modified": null, + "section_title": "Summary", + "staleness_score": null, + "system_component": null + } + } + ] +} +``` + +### User Prompt Overview +- question: Какие документы связаны с архитектурой? +- intent: DOCUMENTATION_EXPLAIN +- sub_intent: RELATED_DOCS_EXPLAIN +- documents: 0 +- facts: 0 +- relations: 4 | samples: api.control_actions_endpoint:part_of, api.control_actions_endpoint:related_api, api.control_actions_endpoint:related_logic + +## Mismatches +- none \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/docs_router_llm_disambiguation/20260326_150139/full_chain_docs_intents_v3-3x_v3-related-health-1.json b/tests/pipeline_setup_v3/test_results/docs_router_llm_disambiguation/20260326_150139/full_chain_docs_intents_v3-3x_v3-related-health-1.json new file mode 100644 index 0000000..63b6a1f --- /dev/null +++ b/tests/pipeline_setup_v3/test_results/docs_router_llm_disambiguation/20260326_150139/full_chain_docs_intents_v3-3x_v3-related-health-1.json @@ -0,0 +1,84 @@ +{ + "meta": { + "case_id": "v3-related-health-1", + "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_03_docs/full_chain_docs_intents_v3-3x.yaml", + "runner": "agent_runtime", + "mode": "pre_llm", + "passed": true, + "mismatches": [], + "actual": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "RELATED_DOCS_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START", + "rag_count": 14, + "llm_answer": "", + "answer_mode": "answered", + "path_scope": [], + "doc_scope": [ + "api.health_endpoint", + "domain.runtime_health", + "api.control_actions_endpoint" + ], + "entity_candidates": [], + "symbol_candidates": [], + "layers": [ + "D5_RELATION_GRAPH", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "filters": { + "doc_type": null + }, + "pipeline_mode": "pre_llm_only", + "gate_decision": "allow", + "prompt_used": "docs_explain_answer", + "llm_mode": "graph_summary", + "degraded_reason": null, + "code_intents_stubbed": true + } + }, + "pipeline_steps": [ + { + "step": "input_query", + "input": { + "query": "Что связано с /health?" + }, + "output": { + "query": "Что связано с /health?" + } + }, + { + "step": "router", + "input": { + "query": "Что связано с /health?" + }, + "output": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "RELATED_DOCS_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START" + } + }, + { + "step": "docs_pipeline", + "input": { + "query": "Что связано с /health?" + }, + "output": { + "answer_mode": "ready", + "prompt_name": "docs_explain_answer", + "llm_request": { + "prompt_name": "docs_explain_answer", + "log_context": "graph.project_qa.docs.answer", + "prompt_stats": { + "system_chars": 393, + "user_chars": 5378, + "tokens_in_estimate": 1443 + } + }, + "degraded_reason": "" + } + } + ] +} \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/docs_router_llm_disambiguation/20260326_150139/full_chain_docs_intents_v3-3x_v3-related-health-1.md b/tests/pipeline_setup_v3/test_results/docs_router_llm_disambiguation/20260326_150139/full_chain_docs_intents_v3-3x_v3-related-health-1.md new file mode 100644 index 0000000..3ca02d1 --- /dev/null +++ b/tests/pipeline_setup_v3/test_results/docs_router_llm_disambiguation/20260326_150139/full_chain_docs_intents_v3-3x_v3-related-health-1.md @@ -0,0 +1,505 @@ +# v3-related-health-1 + +- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_03_docs/full_chain_docs_intents_v3-3x.yaml +- runner: agent_runtime +- mode: pre_llm +- passed: True + +## Query +Что связано с /health? + +## Actual +{ + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "RELATED_DOCS_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START", + "rag_count": 14, + "llm_answer": "", + "answer_mode": "answered", + "path_scope": [], + "doc_scope": [ + "api.health_endpoint", + "domain.runtime_health", + "api.control_actions_endpoint" + ], + "entity_candidates": [], + "symbol_candidates": [], + "layers": [ + "D5_RELATION_GRAPH", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "filters": { + "doc_type": null + }, + "pipeline_mode": "pre_llm_only", + "gate_decision": "allow", + "prompt_used": "docs_explain_answer", + "llm_mode": "graph_summary", + "degraded_reason": null, + "code_intents_stubbed": true +} + +## Pipeline Steps +### input_query +```json +{ + "input": { + "query": "Что связано с /health?" + }, + "output": { + "query": "Что связано с /health?" + } +} +``` + +### router +```json +{ + "input": { + "query": "Что связано с /health?" + }, + "output": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "RELATED_DOCS_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START" + } +} +``` + +### docs_pipeline +```json +{ + "input": { + "query": "Что связано с /health?" + }, + "output": { + "answer_mode": "ready", + "prompt_name": "docs_explain_answer", + "llm_request": { + "prompt_name": "docs_explain_answer", + "log_context": "graph.project_qa.docs.answer", + "prompt_stats": { + "system_chars": 393, + "user_chars": 5378, + "tokens_in_estimate": 1443 + } + }, + "degraded_reason": "" + } +} +``` + +## Diagnostics +{ + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "RELATED_DOCS_EXPLAIN", + "layers_used": [ + "D5_RELATION_GRAPH", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "documents_found": 0, + "facts_found": 0, + "relations_found": 4, + "openapi_fields_extracted": 0, + "missing_required_fields": [], + "openapi_status": { + "has_path": false, + "has_method": false, + "has_request": false, + "has_response": false + }, + "prompt_used": "docs_explain_answer", + "llm_mode": "graph_summary", + "output_valid": true, + "matched_intent_source": "deterministic", + "matched_anchor_type": "endpoint", + "matched_anchor_value": "/health", + "exact_anchor_match": false, + "docs_layers_requested": [ + "D5_RELATION_GRAPH", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "docs_layers_with_hits": [ + "D5_RELATION_GRAPH" + ], + "planned_layers": [ + "D5_RELATION_GRAPH", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "executed_layers": [ + "D5_RELATION_GRAPH" + ], + "non_empty_layers": [ + "D5_RELATION_GRAPH" + ], + "layer_diagnostics": { + "D5_RELATION_GRAPH": { + "hits": 8, + "top_ids": [ + "801650f8bcbfbfbefd35c14447bfef7b3c3827313db790efa7faf47db860f8c4", + "8595d7b82fecdb7ef579fa8961cda6799bb21970061e5bc221d4dd7a3d53fd04", + "af2a4f7c1b677b908410ba720915405e10dbd0870e30a3c6e3aa2468550ddf0e", + "c718b1939621233295ccaf6e8203e7fd94f3dd1bfb88f10c51bc5e33d53a24aa", + "616f5cbf25da83cb51d8d0741a7fc351620c9ca2c6513fa2094b4aa476f0912a" + ], + "top_sections": [ + "domain.runtime_health:used_by", + "domain.runtime_health:related_logic", + "domain.runtime_health:part_of", + "api.health_endpoint:parent", + "api.health_endpoint:part_of" + ] + }, + "D1_DOCUMENT_CATALOG": { + "hits": 0, + "top_ids": [], + "skipped": true, + "reason": "relation_primary_sufficient" + }, + "D0_DOC_CHUNKS": { + "hits": 6, + "top_ids": [ + "api.control_actions_endpoint" + ], + "top_sections": [ + "api.control_actions_endpoint:Summary", + "api.control_actions_endpoint:Описание", + "api.control_actions_endpoint:Сценарий", + "api.control_actions_endpoint:Функциональные требования", + "api.control_actions_endpoint:Нефункциональные требования" + ] + } + }, + "query_entity_candidates": [], + "resolved_entity_candidates": [], + "query_anchor_candidates": [ + "/health" + ], + "resolved_anchor_candidates": [ + "docs/documentation/domain/runtime-health-entity.md", + "docs/documentation/api/health-endpoint.md", + "docs/documentation/api/control-actions-endpoint.md", + "api.control_actions_endpoint" + ], + "anchor_candidates": [ + "api.health_endpoint", + "domain.runtime_health", + "api.control_actions_endpoint" + ], + "selected_anchor": "api.health_endpoint", + "anchor_selection_reason": "doc_id matches requested endpoint slug", + "anchor_match_type": "exact_path", + "doc_ids": [ + "api.health_endpoint", + "domain.runtime_health", + "api.control_actions_endpoint" + ], + "doc_paths": [ + "docs/documentation/domain/runtime-health-entity.md", + "docs/documentation/api/health-endpoint.md", + "docs/documentation/api/control-actions-endpoint.md" + ], + "doc_titles": [ + "domain.runtime_health:used_by", + "domain.runtime_health:related_logic", + "domain.runtime_health:part_of", + "api.health_endpoint:parent", + "api.health_endpoint:part_of", + "api.health_endpoint:depends_on", + "domain.runtime_health:parent", + "api.control_actions_endpoint:related_api", + "api.control_actions_endpoint:Summary", + "api.control_actions_endpoint:Описание", + "api.control_actions_endpoint:Сценарий", + "api.control_actions_endpoint:Функциональные требования", + "api.control_actions_endpoint:Нефункциональные требования", + "api.control_actions_endpoint:Входные параметры" + ], + "relation_hits_count": 4, + "relation_targets": [ + "domain.runtime_health:used_by", + "domain.runtime_health:related_logic", + "domain.runtime_health:part_of", + "api.health_endpoint:parent" + ], + "selected_doc_ids": [], + "selected_fact_ids": [], + "selected_relation_ids": [ + "801650f8bcbfbfbefd35c14447bfef7b3c3827313db790efa7faf47db860f8c4", + "8595d7b82fecdb7ef579fa8961cda6799bb21970061e5bc221d4dd7a3d53fd04", + "af2a4f7c1b677b908410ba720915405e10dbd0870e30a3c6e3aa2468550ddf0e", + "c718b1939621233295ccaf6e8203e7fd94f3dd1bfb88f10c51bc5e33d53a24aa" + ], + "selected_chunk_ids": [ + "api.control_actions_endpoint" + ], + "selected_entity_ids": [], + "selected_workflow_ids": [], + "fallback_doc_hits_count": 1, + "fallback_used": true, + "fact_hits": 0, + "entity_hits": 0, + "evidence_summary": { + "documents": 0, + "facts": 0, + "entities": 0, + "workflows": 0, + "relations": 4, + "chunks": 1, + "selected_doc_ids": [], + "selected_fact_ids": [], + "selected_relation_ids": [ + "801650f8bcbfbfbefd35c14447bfef7b3c3827313db790efa7faf47db860f8c4", + "8595d7b82fecdb7ef579fa8961cda6799bb21970061e5bc221d4dd7a3d53fd04", + "af2a4f7c1b677b908410ba720915405e10dbd0870e30a3c6e3aa2468550ddf0e", + "c718b1939621233295ccaf6e8203e7fd94f3dd1bfb88f10c51bc5e33d53a24aa" + ], + "selected_chunk_ids": [ + "api.control_actions_endpoint" + ], + "entity_hits": 0, + "openapi_signals": { + "path_found": false, + "method_found": false, + "operation_semantics_found": false, + "request_payload_found": false, + "request_schema": false, + "request_fields_found": false, + "response_payload_found": false, + "response_schema": false, + "response_fields_found": false, + "status_codes": false, + "content_type_found": false, + "examples_found": false, + "payload_description": false + } + }, + "gate_decision": "allow", + "gate_decision_reason": "relation_evidence_available", + "gate_missing_requirements": [], + "gate_satisfied_requirements": [ + "retrieval_non_empty", + "exact_anchor_match" + ], + "openapi_evidence": { + "path_found": false, + "method_found": false, + "operation_semantics_found": false, + "request_payload_found": false, + "request_schema": false, + "request_fields_found": false, + "response_payload_found": false, + "response_schema": false, + "response_fields_found": false, + "status_codes": false, + "content_type_found": false, + "examples_found": false, + "payload_description": false + }, + "requested_fragment_type": null, + "fragment_evidence_found": [], + "fragment_missing_requirements": [], + "answer_mode": "ready", + "degrade_reason": null, + "degraded_reason": null, + "code_intents_stubbed": false +} + +## LLM Request +- prompt_name: docs_explain_answer +- log_context: graph.project_qa.docs.answer + +### Prompt Stats +```json +{ + "system_chars": 393, + "user_chars": 5378, + "tokens_in_estimate": 1443 +} +``` + +### System Prompt +```text +Ты объясняешь документацию системы. + +На вход приходит JSON с полями: +- question +- intent +- sub_intent +- documents +- facts +- relations + +Правила: +- Используй только предоставленные факты +- Не додумывай +- Если данных недостаточно, скажи это явно +- Объясняй структурировано + +Формат ответа: +1. Краткое описание +2. Основные элементы +3. Как это работает +4. Связи с другими частями системы (если есть) +``` + +### User Prompt +```json +{ + "question": "Что связано с /health?", + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "RELATED_DOCS_EXPLAIN", + "documents": [], + "facts": [], + "entities": [], + "workflows": [], + "relations": [ + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/domain/runtime-health-entity.md", + "title": "domain.runtime_health:used_by", + "content": "domain.runtime_health used_by api.health_endpoint", + "metadata": { + "owner": null, + "anchor": "frontmatter.links", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "37d4dcf470ea3de95d59e44786006e369a3ea11bf5dbf4c88877696e9183ee87", + "source_id": "domain.runtime_health", + "target_id": "api.health_endpoint", + "doc_version": null, + "relation_id": "801650f8bcbfbfbefd35c14447bfef7b3c3827313db790efa7faf47db860f8c4", + "source_path": "docs/documentation/domain/runtime-health-entity.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "used_by", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/domain/runtime-health-entity.md", + "title": "domain.runtime_health:related_logic", + "content": "domain.runtime_health related_logic logic.telegram_notification_loop", + "metadata": { + "owner": null, + "anchor": "frontmatter.links", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "37d4dcf470ea3de95d59e44786006e369a3ea11bf5dbf4c88877696e9183ee87", + "source_id": "domain.runtime_health", + "target_id": "logic.telegram_notification_loop", + "doc_version": null, + "relation_id": "8595d7b82fecdb7ef579fa8961cda6799bb21970061e5bc221d4dd7a3d53fd04", + "source_path": "docs/documentation/domain/runtime-health-entity.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "related_logic", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/domain/runtime-health-entity.md", + "title": "domain.runtime_health:part_of", + "content": "domain.runtime_health part_of architecture.telegram_notify_app", + "metadata": { + "owner": null, + "anchor": "frontmatter.links", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "37d4dcf470ea3de95d59e44786006e369a3ea11bf5dbf4c88877696e9183ee87", + "source_id": "domain.runtime_health", + "target_id": "architecture.telegram_notify_app", + "doc_version": null, + "relation_id": "af2a4f7c1b677b908410ba720915405e10dbd0870e30a3c6e3aa2468550ddf0e", + "source_path": "docs/documentation/domain/runtime-health-entity.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "part_of", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/api/health-endpoint.md", + "title": "api.health_endpoint:parent", + "content": "api.health_endpoint parent architecture.telegram_notify_app", + "metadata": { + "owner": null, + "anchor": "frontmatter.parent", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "8b5a533a8076e2e9d36995eee29aeade260080bdca2ec8e21fe28f08574b983f", + "source_id": "api.health_endpoint", + "target_id": "architecture.telegram_notify_app", + "doc_version": null, + "relation_id": "c718b1939621233295ccaf6e8203e7fd94f3dd1bfb88f10c51bc5e33d53a24aa", + "source_path": "docs/documentation/api/health-endpoint.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "parent", + "staleness_score": null, + "system_component": null + } + } + ], + "chunks": [ + { + "layer": "D0_DOC_CHUNKS", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "api.control_actions_endpoint:Summary", + "content": "Endpoint `/actions/{action}` управляет control actions runtime и поддерживает `start`, `stop` и `status`. Для долгих операций `start` и `stop` допускается ответ HTTP 202, если действие еще выполняется. Endpoint используется для operator-driven управления жизненным циклом worker'а через HTTP API.", + "metadata": { + "tags": [ + "api", + "control-plane", + "lifecycle" + ], + "type": "api_method", + "order": 1, + "owner": null, + "doc_id": null, + "module": "telegram_notify_app", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "doc_kind": "misc", + "doc_version": null, + "document_id": "api.control_actions_endpoint", + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "section_path": "Summary", + "artifact_type": null, + "last_modified": null, + "section_title": "Summary", + "staleness_score": null, + "system_component": null + } + } + ] +} +``` + +### User Prompt Overview +- question: Что связано с /health? +- intent: DOCUMENTATION_EXPLAIN +- sub_intent: RELATED_DOCS_EXPLAIN +- documents: 0 +- facts: 0 +- relations: 4 | samples: domain.runtime_health:used_by, domain.runtime_health:related_logic, domain.runtime_health:part_of + +## Mismatches +- none \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/docs_router_llm_disambiguation/20260326_150139/full_chain_docs_intents_v3-3x_v3-related-health-2.json b/tests/pipeline_setup_v3/test_results/docs_router_llm_disambiguation/20260326_150139/full_chain_docs_intents_v3-3x_v3-related-health-2.json new file mode 100644 index 0000000..43a59d0 --- /dev/null +++ b/tests/pipeline_setup_v3/test_results/docs_router_llm_disambiguation/20260326_150139/full_chain_docs_intents_v3-3x_v3-related-health-2.json @@ -0,0 +1,84 @@ +{ + "meta": { + "case_id": "v3-related-health-2", + "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_03_docs/full_chain_docs_intents_v3-3x.yaml", + "runner": "agent_runtime", + "mode": "pre_llm", + "passed": true, + "mismatches": [], + "actual": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "RELATED_DOCS_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START", + "rag_count": 14, + "llm_answer": "", + "answer_mode": "answered", + "path_scope": [], + "doc_scope": [ + "api.control_actions_endpoint", + "api.health_endpoint", + "api.send_message_endpoint" + ], + "entity_candidates": [], + "symbol_candidates": [], + "layers": [ + "D5_RELATION_GRAPH", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "filters": { + "doc_type": null + }, + "pipeline_mode": "pre_llm_only", + "gate_decision": "allow", + "prompt_used": "docs_explain_answer", + "llm_mode": "graph_summary", + "degraded_reason": null, + "code_intents_stubbed": true + } + }, + "pipeline_steps": [ + { + "step": "input_query", + "input": { + "query": "Какие документы относятся к health endpoint?" + }, + "output": { + "query": "Какие документы относятся к health endpoint?" + } + }, + { + "step": "router", + "input": { + "query": "Какие документы относятся к health endpoint?" + }, + "output": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "RELATED_DOCS_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START" + } + }, + { + "step": "docs_pipeline", + "input": { + "query": "Какие документы относятся к health endpoint?" + }, + "output": { + "answer_mode": "ready", + "prompt_name": "docs_explain_answer", + "llm_request": { + "prompt_name": "docs_explain_answer", + "log_context": "graph.project_qa.docs.answer", + "prompt_stats": { + "system_chars": 393, + "user_chars": 5475, + "tokens_in_estimate": 1467 + } + }, + "degraded_reason": "" + } + } + ] +} \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/docs_router_llm_disambiguation/20260326_150139/full_chain_docs_intents_v3-3x_v3-related-health-2.md b/tests/pipeline_setup_v3/test_results/docs_router_llm_disambiguation/20260326_150139/full_chain_docs_intents_v3-3x_v3-related-health-2.md new file mode 100644 index 0000000..328bf1a --- /dev/null +++ b/tests/pipeline_setup_v3/test_results/docs_router_llm_disambiguation/20260326_150139/full_chain_docs_intents_v3-3x_v3-related-health-2.md @@ -0,0 +1,502 @@ +# v3-related-health-2 + +- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_03_docs/full_chain_docs_intents_v3-3x.yaml +- runner: agent_runtime +- mode: pre_llm +- passed: True + +## Query +Какие документы относятся к health endpoint? + +## Actual +{ + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "RELATED_DOCS_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START", + "rag_count": 14, + "llm_answer": "", + "answer_mode": "answered", + "path_scope": [], + "doc_scope": [ + "api.control_actions_endpoint", + "api.health_endpoint", + "api.send_message_endpoint" + ], + "entity_candidates": [], + "symbol_candidates": [], + "layers": [ + "D5_RELATION_GRAPH", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "filters": { + "doc_type": null + }, + "pipeline_mode": "pre_llm_only", + "gate_decision": "allow", + "prompt_used": "docs_explain_answer", + "llm_mode": "graph_summary", + "degraded_reason": null, + "code_intents_stubbed": true +} + +## Pipeline Steps +### input_query +```json +{ + "input": { + "query": "Какие документы относятся к health endpoint?" + }, + "output": { + "query": "Какие документы относятся к health endpoint?" + } +} +``` + +### router +```json +{ + "input": { + "query": "Какие документы относятся к health endpoint?" + }, + "output": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "RELATED_DOCS_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START" + } +} +``` + +### docs_pipeline +```json +{ + "input": { + "query": "Какие документы относятся к health endpoint?" + }, + "output": { + "answer_mode": "ready", + "prompt_name": "docs_explain_answer", + "llm_request": { + "prompt_name": "docs_explain_answer", + "log_context": "graph.project_qa.docs.answer", + "prompt_stats": { + "system_chars": 393, + "user_chars": 5475, + "tokens_in_estimate": 1467 + } + }, + "degraded_reason": "" + } +} +``` + +## Diagnostics +{ + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "RELATED_DOCS_EXPLAIN", + "layers_used": [ + "D5_RELATION_GRAPH", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "documents_found": 0, + "facts_found": 0, + "relations_found": 4, + "openapi_fields_extracted": 0, + "missing_required_fields": [], + "openapi_status": { + "has_path": false, + "has_method": false, + "has_request": false, + "has_response": false + }, + "prompt_used": "docs_explain_answer", + "llm_mode": "graph_summary", + "output_valid": true, + "matched_intent_source": "deterministic", + "matched_anchor_type": "topic", + "matched_anchor_value": null, + "exact_anchor_match": false, + "docs_layers_requested": [ + "D5_RELATION_GRAPH", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "docs_layers_with_hits": [ + "D5_RELATION_GRAPH" + ], + "planned_layers": [ + "D5_RELATION_GRAPH", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "executed_layers": [ + "D5_RELATION_GRAPH" + ], + "non_empty_layers": [ + "D5_RELATION_GRAPH" + ], + "layer_diagnostics": { + "D5_RELATION_GRAPH": { + "hits": 8, + "top_ids": [ + "5f4909bde905cd3d294ad307074a05e4ae4deefcafe6272cd2d0436e73acb8dd", + "711fb2edb82dd222deaba3c91768b18cbbd453009235823282813c6e867dc2c1", + "eec79f7a02b804337e791ef231784862ae26e0599eb20224790e9d4f085fa9c0", + "c718b1939621233295ccaf6e8203e7fd94f3dd1bfb88f10c51bc5e33d53a24aa", + "616f5cbf25da83cb51d8d0741a7fc351620c9ca2c6513fa2094b4aa476f0912a" + ], + "top_sections": [ + "api.control_actions_endpoint:part_of", + "api.control_actions_endpoint:related_api", + "api.control_actions_endpoint:related_logic", + "api.health_endpoint:parent", + "api.health_endpoint:part_of" + ] + }, + "D1_DOCUMENT_CATALOG": { + "hits": 0, + "top_ids": [], + "skipped": true, + "reason": "relation_primary_sufficient" + }, + "D0_DOC_CHUNKS": { + "hits": 6, + "top_ids": [ + "api.control_actions_endpoint" + ], + "top_sections": [ + "api.control_actions_endpoint:Summary", + "api.control_actions_endpoint:Описание", + "api.control_actions_endpoint:Сценарий", + "api.control_actions_endpoint:Функциональные требования", + "api.control_actions_endpoint:Нефункциональные требования" + ] + } + }, + "query_entity_candidates": [], + "resolved_entity_candidates": [], + "query_anchor_candidates": [], + "resolved_anchor_candidates": [ + "docs/documentation/api/control-actions-endpoint.md", + "docs/documentation/api/health-endpoint.md", + "docs/documentation/api/send-message-endpoint.md", + "api.control_actions_endpoint" + ], + "anchor_candidates": [ + "api.control_actions_endpoint", + "api.health_endpoint", + "api.send_message_endpoint" + ], + "selected_anchor": "api.control_actions_endpoint", + "anchor_selection_reason": "relation_neighbor", + "anchor_match_type": "semantic_fallback", + "doc_ids": [ + "api.control_actions_endpoint", + "api.health_endpoint", + "api.send_message_endpoint" + ], + "doc_paths": [ + "docs/documentation/api/control-actions-endpoint.md", + "docs/documentation/api/health-endpoint.md", + "docs/documentation/api/send-message-endpoint.md" + ], + "doc_titles": [ + "api.control_actions_endpoint:part_of", + "api.control_actions_endpoint:related_api", + "api.control_actions_endpoint:related_logic", + "api.health_endpoint:parent", + "api.health_endpoint:part_of", + "api.health_endpoint:depends_on", + "api.send_message_endpoint:parent", + "api.control_actions_endpoint:parent", + "api.control_actions_endpoint:Summary", + "api.control_actions_endpoint:Описание", + "api.control_actions_endpoint:Сценарий", + "api.control_actions_endpoint:Функциональные требования", + "api.control_actions_endpoint:Нефункциональные требования", + "api.control_actions_endpoint:Входные параметры" + ], + "relation_hits_count": 4, + "relation_targets": [ + "api.control_actions_endpoint:part_of", + "api.control_actions_endpoint:related_api", + "api.control_actions_endpoint:related_logic", + "api.health_endpoint:parent" + ], + "selected_doc_ids": [], + "selected_fact_ids": [], + "selected_relation_ids": [ + "5f4909bde905cd3d294ad307074a05e4ae4deefcafe6272cd2d0436e73acb8dd", + "711fb2edb82dd222deaba3c91768b18cbbd453009235823282813c6e867dc2c1", + "eec79f7a02b804337e791ef231784862ae26e0599eb20224790e9d4f085fa9c0", + "c718b1939621233295ccaf6e8203e7fd94f3dd1bfb88f10c51bc5e33d53a24aa" + ], + "selected_chunk_ids": [ + "api.control_actions_endpoint" + ], + "selected_entity_ids": [], + "selected_workflow_ids": [], + "fallback_doc_hits_count": 1, + "fallback_used": true, + "fact_hits": 0, + "entity_hits": 0, + "evidence_summary": { + "documents": 0, + "facts": 0, + "entities": 0, + "workflows": 0, + "relations": 4, + "chunks": 1, + "selected_doc_ids": [], + "selected_fact_ids": [], + "selected_relation_ids": [ + "5f4909bde905cd3d294ad307074a05e4ae4deefcafe6272cd2d0436e73acb8dd", + "711fb2edb82dd222deaba3c91768b18cbbd453009235823282813c6e867dc2c1", + "eec79f7a02b804337e791ef231784862ae26e0599eb20224790e9d4f085fa9c0", + "c718b1939621233295ccaf6e8203e7fd94f3dd1bfb88f10c51bc5e33d53a24aa" + ], + "selected_chunk_ids": [ + "api.control_actions_endpoint" + ], + "entity_hits": 0, + "openapi_signals": { + "path_found": false, + "method_found": false, + "operation_semantics_found": false, + "request_payload_found": false, + "request_schema": false, + "request_fields_found": false, + "response_payload_found": false, + "response_schema": false, + "response_fields_found": false, + "status_codes": false, + "content_type_found": false, + "examples_found": false, + "payload_description": false + } + }, + "gate_decision": "allow", + "gate_decision_reason": "relation_evidence_available", + "gate_missing_requirements": [], + "gate_satisfied_requirements": [ + "retrieval_non_empty" + ], + "openapi_evidence": { + "path_found": false, + "method_found": false, + "operation_semantics_found": false, + "request_payload_found": false, + "request_schema": false, + "request_fields_found": false, + "response_payload_found": false, + "response_schema": false, + "response_fields_found": false, + "status_codes": false, + "content_type_found": false, + "examples_found": false, + "payload_description": false + }, + "requested_fragment_type": null, + "fragment_evidence_found": [], + "fragment_missing_requirements": [], + "answer_mode": "ready", + "degrade_reason": null, + "degraded_reason": null, + "code_intents_stubbed": false +} + +## LLM Request +- prompt_name: docs_explain_answer +- log_context: graph.project_qa.docs.answer + +### Prompt Stats +```json +{ + "system_chars": 393, + "user_chars": 5475, + "tokens_in_estimate": 1467 +} +``` + +### System Prompt +```text +Ты объясняешь документацию системы. + +На вход приходит JSON с полями: +- question +- intent +- sub_intent +- documents +- facts +- relations + +Правила: +- Используй только предоставленные факты +- Не додумывай +- Если данных недостаточно, скажи это явно +- Объясняй структурировано + +Формат ответа: +1. Краткое описание +2. Основные элементы +3. Как это работает +4. Связи с другими частями системы (если есть) +``` + +### User Prompt +```json +{ + "question": "Какие документы относятся к health endpoint?", + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "RELATED_DOCS_EXPLAIN", + "documents": [], + "facts": [], + "entities": [], + "workflows": [], + "relations": [ + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "api.control_actions_endpoint:part_of", + "content": "api.control_actions_endpoint part_of architecture.telegram_notify_app", + "metadata": { + "owner": null, + "anchor": "frontmatter.links", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "source_id": "api.control_actions_endpoint", + "target_id": "architecture.telegram_notify_app", + "doc_version": null, + "relation_id": "5f4909bde905cd3d294ad307074a05e4ae4deefcafe6272cd2d0436e73acb8dd", + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "part_of", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "api.control_actions_endpoint:related_api", + "content": "api.control_actions_endpoint related_api api.health_endpoint", + "metadata": { + "owner": null, + "anchor": "frontmatter.links", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "source_id": "api.control_actions_endpoint", + "target_id": "api.health_endpoint", + "doc_version": null, + "relation_id": "711fb2edb82dd222deaba3c91768b18cbbd453009235823282813c6e867dc2c1", + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "related_api", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "api.control_actions_endpoint:related_logic", + "content": "api.control_actions_endpoint related_logic logic.telegram_notification_loop", + "metadata": { + "owner": null, + "anchor": "frontmatter.links", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "source_id": "api.control_actions_endpoint", + "target_id": "logic.telegram_notification_loop", + "doc_version": null, + "relation_id": "eec79f7a02b804337e791ef231784862ae26e0599eb20224790e9d4f085fa9c0", + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "related_logic", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/api/health-endpoint.md", + "title": "api.health_endpoint:parent", + "content": "api.health_endpoint parent architecture.telegram_notify_app", + "metadata": { + "owner": null, + "anchor": "frontmatter.parent", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "8b5a533a8076e2e9d36995eee29aeade260080bdca2ec8e21fe28f08574b983f", + "source_id": "api.health_endpoint", + "target_id": "architecture.telegram_notify_app", + "doc_version": null, + "relation_id": "c718b1939621233295ccaf6e8203e7fd94f3dd1bfb88f10c51bc5e33d53a24aa", + "source_path": "docs/documentation/api/health-endpoint.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "parent", + "staleness_score": null, + "system_component": null + } + } + ], + "chunks": [ + { + "layer": "D0_DOC_CHUNKS", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "api.control_actions_endpoint:Summary", + "content": "Endpoint `/actions/{action}` управляет control actions runtime и поддерживает `start`, `stop` и `status`. Для долгих операций `start` и `stop` допускается ответ HTTP 202, если действие еще выполняется. Endpoint используется для operator-driven управления жизненным циклом worker'а через HTTP API.", + "metadata": { + "tags": [ + "api", + "control-plane", + "lifecycle" + ], + "type": "api_method", + "order": 1, + "owner": null, + "doc_id": null, + "module": "telegram_notify_app", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "doc_kind": "misc", + "doc_version": null, + "document_id": "api.control_actions_endpoint", + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "section_path": "Summary", + "artifact_type": null, + "last_modified": null, + "section_title": "Summary", + "staleness_score": null, + "system_component": null + } + } + ] +} +``` + +### User Prompt Overview +- question: Какие документы относятся к health endpoint? +- intent: DOCUMENTATION_EXPLAIN +- sub_intent: RELATED_DOCS_EXPLAIN +- documents: 0 +- facts: 0 +- relations: 4 | samples: api.control_actions_endpoint:part_of, api.control_actions_endpoint:related_api, api.control_actions_endpoint:related_logic + +## Mismatches +- none \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/docs_router_llm_disambiguation/20260326_150139/full_chain_docs_intents_v3-3x_v3-related-send-1.json b/tests/pipeline_setup_v3/test_results/docs_router_llm_disambiguation/20260326_150139/full_chain_docs_intents_v3-3x_v3-related-send-1.json new file mode 100644 index 0000000..22678f6 --- /dev/null +++ b/tests/pipeline_setup_v3/test_results/docs_router_llm_disambiguation/20260326_150139/full_chain_docs_intents_v3-3x_v3-related-send-1.json @@ -0,0 +1,85 @@ +{ + "meta": { + "case_id": "v3-related-send-1", + "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_03_docs/full_chain_docs_intents_v3-3x.yaml", + "runner": "agent_runtime", + "mode": "pre_llm", + "passed": true, + "mismatches": [], + "actual": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "RELATED_DOCS_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START", + "rag_count": 14, + "llm_answer": "", + "answer_mode": "answered", + "path_scope": [], + "doc_scope": [ + "api.send_message_endpoint", + "architecture.telegram_notify_app_overview", + "logic.telegram_notification_loop", + "api.health_endpoint" + ], + "entity_candidates": [], + "symbol_candidates": [], + "layers": [ + "D5_RELATION_GRAPH", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "filters": { + "doc_type": null + }, + "pipeline_mode": "pre_llm_only", + "gate_decision": "allow", + "prompt_used": "docs_explain_answer", + "llm_mode": "graph_summary", + "degraded_reason": null, + "code_intents_stubbed": true + } + }, + "pipeline_steps": [ + { + "step": "input_query", + "input": { + "query": "Какие документы связаны с /send?" + }, + "output": { + "query": "Какие документы связаны с /send?" + } + }, + { + "step": "router", + "input": { + "query": "Какие документы связаны с /send?" + }, + "output": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "RELATED_DOCS_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START" + } + }, + { + "step": "docs_pipeline", + "input": { + "query": "Какие документы связаны с /send?" + }, + "output": { + "answer_mode": "ready", + "prompt_name": "docs_explain_answer", + "llm_request": { + "prompt_name": "docs_explain_answer", + "log_context": "graph.project_qa.docs.answer", + "prompt_stats": { + "system_chars": 393, + "user_chars": 5445, + "tokens_in_estimate": 1460 + } + }, + "degraded_reason": "" + } + } + ] +} \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/docs_router_llm_disambiguation/20260326_150139/full_chain_docs_intents_v3-3x_v3-related-send-1.md b/tests/pipeline_setup_v3/test_results/docs_router_llm_disambiguation/20260326_150139/full_chain_docs_intents_v3-3x_v3-related-send-1.md new file mode 100644 index 0000000..c8cfb1f --- /dev/null +++ b/tests/pipeline_setup_v3/test_results/docs_router_llm_disambiguation/20260326_150139/full_chain_docs_intents_v3-3x_v3-related-send-1.md @@ -0,0 +1,510 @@ +# v3-related-send-1 + +- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_03_docs/full_chain_docs_intents_v3-3x.yaml +- runner: agent_runtime +- mode: pre_llm +- passed: True + +## Query +Какие документы связаны с /send? + +## Actual +{ + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "RELATED_DOCS_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START", + "rag_count": 14, + "llm_answer": "", + "answer_mode": "answered", + "path_scope": [], + "doc_scope": [ + "api.send_message_endpoint", + "architecture.telegram_notify_app_overview", + "logic.telegram_notification_loop", + "api.health_endpoint" + ], + "entity_candidates": [], + "symbol_candidates": [], + "layers": [ + "D5_RELATION_GRAPH", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "filters": { + "doc_type": null + }, + "pipeline_mode": "pre_llm_only", + "gate_decision": "allow", + "prompt_used": "docs_explain_answer", + "llm_mode": "graph_summary", + "degraded_reason": null, + "code_intents_stubbed": true +} + +## Pipeline Steps +### input_query +```json +{ + "input": { + "query": "Какие документы связаны с /send?" + }, + "output": { + "query": "Какие документы связаны с /send?" + } +} +``` + +### router +```json +{ + "input": { + "query": "Какие документы связаны с /send?" + }, + "output": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "RELATED_DOCS_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START" + } +} +``` + +### docs_pipeline +```json +{ + "input": { + "query": "Какие документы связаны с /send?" + }, + "output": { + "answer_mode": "ready", + "prompt_name": "docs_explain_answer", + "llm_request": { + "prompt_name": "docs_explain_answer", + "log_context": "graph.project_qa.docs.answer", + "prompt_stats": { + "system_chars": 393, + "user_chars": 5445, + "tokens_in_estimate": 1460 + } + }, + "degraded_reason": "" + } +} +``` + +## Diagnostics +{ + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "RELATED_DOCS_EXPLAIN", + "layers_used": [ + "D5_RELATION_GRAPH", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "documents_found": 0, + "facts_found": 0, + "relations_found": 4, + "openapi_fields_extracted": 0, + "missing_required_fields": [], + "openapi_status": { + "has_path": false, + "has_method": false, + "has_request": false, + "has_response": false + }, + "prompt_used": "docs_explain_answer", + "llm_mode": "graph_summary", + "output_valid": true, + "matched_intent_source": "deterministic", + "matched_anchor_type": "endpoint", + "matched_anchor_value": "/send", + "exact_anchor_match": false, + "docs_layers_requested": [ + "D5_RELATION_GRAPH", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "docs_layers_with_hits": [ + "D5_RELATION_GRAPH" + ], + "planned_layers": [ + "D5_RELATION_GRAPH", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "executed_layers": [ + "D5_RELATION_GRAPH" + ], + "non_empty_layers": [ + "D5_RELATION_GRAPH" + ], + "layer_diagnostics": { + "D5_RELATION_GRAPH": { + "hits": 8, + "top_ids": [ + "33eb0aa97f06d0afcaa4c230b5f5b73fa2fbfa5861ea9367b6c92f8a6fe0c054", + "53dbf99d1ed72fb30e988fa7080e6ec3d0028d2a1e896e4e818f2492cc161bf5", + "a5c452b6685216d12fc857cd5b10a19b347655b1f1fd9f59d64fd413e93e36a5", + "d3d3ce25ca6434582c9bbb8f94ab89c7a2a497f46f1124f7e335c217281d42d9", + "305bab0c6567d93a2b453a9d70b676f9ecd8de083ef36f5cf3398747c25ebf94" + ], + "top_sections": [ + "api.send_message_endpoint:parent", + "api.send_message_endpoint:depends_on", + "api.send_message_endpoint:part_of", + "architecture.telegram_notify_app:related_api", + "architecture.telegram_notify_app:child" + ] + }, + "D1_DOCUMENT_CATALOG": { + "hits": 0, + "top_ids": [], + "skipped": true, + "reason": "relation_primary_sufficient" + }, + "D0_DOC_CHUNKS": { + "hits": 6, + "top_ids": [ + "api.health_endpoint" + ], + "top_sections": [ + "api.health_endpoint:Summary", + "api.health_endpoint:Описание", + "api.health_endpoint:Сценарий", + "api.health_endpoint:Функциональные требования", + "api.health_endpoint:Нефункциональные требования" + ] + } + }, + "query_entity_candidates": [], + "resolved_entity_candidates": [], + "query_anchor_candidates": [ + "/send" + ], + "resolved_anchor_candidates": [ + "docs/documentation/api/send-message-endpoint.md", + "docs/documentation/architecture/telegram-notify-app-overview.md", + "docs/documentation/logic/telegram-notification-loop.md", + "docs/documentation/api/health-endpoint.md", + "api.health_endpoint" + ], + "anchor_candidates": [ + "api.send_message_endpoint", + "api.health_endpoint", + "architecture.telegram_notify_app_overview", + "logic.telegram_notification_loop" + ], + "selected_anchor": "api.send_message_endpoint", + "anchor_selection_reason": "doc_id matches requested endpoint slug", + "anchor_match_type": "exact_path", + "doc_ids": [ + "api.send_message_endpoint", + "architecture.telegram_notify_app_overview", + "logic.telegram_notification_loop", + "api.health_endpoint" + ], + "doc_paths": [ + "docs/documentation/api/send-message-endpoint.md", + "docs/documentation/architecture/telegram-notify-app-overview.md", + "docs/documentation/logic/telegram-notification-loop.md", + "docs/documentation/api/health-endpoint.md" + ], + "doc_titles": [ + "api.send_message_endpoint:parent", + "api.send_message_endpoint:depends_on", + "api.send_message_endpoint:part_of", + "architecture.telegram_notify_app:related_api", + "architecture.telegram_notify_app:child", + "logic.telegram_notification_loop:related_api", + "api.health_endpoint:depends_on", + "api.health_endpoint:part_of", + "api.health_endpoint:Summary", + "api.health_endpoint:Описание", + "api.health_endpoint:Сценарий", + "api.health_endpoint:Функциональные требования", + "api.health_endpoint:Нефункциональные требования", + "api.health_endpoint:Входные параметры" + ], + "relation_hits_count": 4, + "relation_targets": [ + "api.send_message_endpoint:parent", + "api.send_message_endpoint:depends_on", + "api.send_message_endpoint:part_of", + "architecture.telegram_notify_app:related_api" + ], + "selected_doc_ids": [], + "selected_fact_ids": [], + "selected_relation_ids": [ + "33eb0aa97f06d0afcaa4c230b5f5b73fa2fbfa5861ea9367b6c92f8a6fe0c054", + "53dbf99d1ed72fb30e988fa7080e6ec3d0028d2a1e896e4e818f2492cc161bf5", + "a5c452b6685216d12fc857cd5b10a19b347655b1f1fd9f59d64fd413e93e36a5", + "d3d3ce25ca6434582c9bbb8f94ab89c7a2a497f46f1124f7e335c217281d42d9" + ], + "selected_chunk_ids": [ + "api.health_endpoint" + ], + "selected_entity_ids": [], + "selected_workflow_ids": [], + "fallback_doc_hits_count": 1, + "fallback_used": true, + "fact_hits": 0, + "entity_hits": 0, + "evidence_summary": { + "documents": 0, + "facts": 0, + "entities": 0, + "workflows": 0, + "relations": 4, + "chunks": 1, + "selected_doc_ids": [], + "selected_fact_ids": [], + "selected_relation_ids": [ + "33eb0aa97f06d0afcaa4c230b5f5b73fa2fbfa5861ea9367b6c92f8a6fe0c054", + "53dbf99d1ed72fb30e988fa7080e6ec3d0028d2a1e896e4e818f2492cc161bf5", + "a5c452b6685216d12fc857cd5b10a19b347655b1f1fd9f59d64fd413e93e36a5", + "d3d3ce25ca6434582c9bbb8f94ab89c7a2a497f46f1124f7e335c217281d42d9" + ], + "selected_chunk_ids": [ + "api.health_endpoint" + ], + "entity_hits": 0, + "openapi_signals": { + "path_found": false, + "method_found": false, + "operation_semantics_found": false, + "request_payload_found": false, + "request_schema": false, + "request_fields_found": false, + "response_payload_found": false, + "response_schema": false, + "response_fields_found": false, + "status_codes": false, + "content_type_found": false, + "examples_found": false, + "payload_description": false + } + }, + "gate_decision": "allow", + "gate_decision_reason": "relation_evidence_available", + "gate_missing_requirements": [], + "gate_satisfied_requirements": [ + "retrieval_non_empty", + "exact_anchor_match" + ], + "openapi_evidence": { + "path_found": false, + "method_found": false, + "operation_semantics_found": false, + "request_payload_found": false, + "request_schema": false, + "request_fields_found": false, + "response_payload_found": false, + "response_schema": false, + "response_fields_found": false, + "status_codes": false, + "content_type_found": false, + "examples_found": false, + "payload_description": false + }, + "requested_fragment_type": null, + "fragment_evidence_found": [], + "fragment_missing_requirements": [], + "answer_mode": "ready", + "degrade_reason": null, + "degraded_reason": null, + "code_intents_stubbed": false +} + +## LLM Request +- prompt_name: docs_explain_answer +- log_context: graph.project_qa.docs.answer + +### Prompt Stats +```json +{ + "system_chars": 393, + "user_chars": 5445, + "tokens_in_estimate": 1460 +} +``` + +### System Prompt +```text +Ты объясняешь документацию системы. + +На вход приходит JSON с полями: +- question +- intent +- sub_intent +- documents +- facts +- relations + +Правила: +- Используй только предоставленные факты +- Не додумывай +- Если данных недостаточно, скажи это явно +- Объясняй структурировано + +Формат ответа: +1. Краткое описание +2. Основные элементы +3. Как это работает +4. Связи с другими частями системы (если есть) +``` + +### User Prompt +```json +{ + "question": "Какие документы связаны с /send?", + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "RELATED_DOCS_EXPLAIN", + "documents": [], + "facts": [], + "entities": [], + "workflows": [], + "relations": [ + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/api/send-message-endpoint.md", + "title": "api.send_message_endpoint:parent", + "content": "api.send_message_endpoint parent architecture.telegram_notify_app", + "metadata": { + "owner": null, + "anchor": "frontmatter.parent", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "5fbf2e33510b0676a3a53b957a4569bd3c2c31fb7719546602c573421ccaa32d", + "source_id": "api.send_message_endpoint", + "target_id": "architecture.telegram_notify_app", + "doc_version": null, + "relation_id": "33eb0aa97f06d0afcaa4c230b5f5b73fa2fbfa5861ea9367b6c92f8a6fe0c054", + "source_path": "docs/documentation/api/send-message-endpoint.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "parent", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/api/send-message-endpoint.md", + "title": "api.send_message_endpoint:depends_on", + "content": "api.send_message_endpoint depends_on logic.telegram_notification_loop", + "metadata": { + "owner": null, + "anchor": "frontmatter.links", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "5fbf2e33510b0676a3a53b957a4569bd3c2c31fb7719546602c573421ccaa32d", + "source_id": "api.send_message_endpoint", + "target_id": "logic.telegram_notification_loop", + "doc_version": null, + "relation_id": "53dbf99d1ed72fb30e988fa7080e6ec3d0028d2a1e896e4e818f2492cc161bf5", + "source_path": "docs/documentation/api/send-message-endpoint.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "depends_on", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/api/send-message-endpoint.md", + "title": "api.send_message_endpoint:part_of", + "content": "api.send_message_endpoint part_of architecture.telegram_notify_app", + "metadata": { + "owner": null, + "anchor": "frontmatter.links", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "5fbf2e33510b0676a3a53b957a4569bd3c2c31fb7719546602c573421ccaa32d", + "source_id": "api.send_message_endpoint", + "target_id": "architecture.telegram_notify_app", + "doc_version": null, + "relation_id": "a5c452b6685216d12fc857cd5b10a19b347655b1f1fd9f59d64fd413e93e36a5", + "source_path": "docs/documentation/api/send-message-endpoint.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "part_of", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/architecture/telegram-notify-app-overview.md", + "title": "architecture.telegram_notify_app:related_api", + "content": "architecture.telegram_notify_app related_api api.send_message_endpoint", + "metadata": { + "owner": null, + "anchor": "frontmatter.links", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "8b1cc9f823e55bddbc825466d10a0fdb4ca4354ac02d91f9e2aef7b7d2ec8256", + "source_id": "architecture.telegram_notify_app", + "target_id": "api.send_message_endpoint", + "doc_version": null, + "relation_id": "d3d3ce25ca6434582c9bbb8f94ab89c7a2a497f46f1124f7e335c217281d42d9", + "source_path": "docs/documentation/architecture/telegram-notify-app-overview.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "related_api", + "staleness_score": null, + "system_component": null + } + } + ], + "chunks": [ + { + "layer": "D0_DOC_CHUNKS", + "path": "docs/documentation/api/health-endpoint.md", + "title": "api.health_endpoint:Summary", + "content": "Endpoint `/health` возвращает агрегированный health payload runtime. Если общий статус равен `ok`, API отвечает с HTTP 200; для состояний деградации или неготовности возвращается HTTP 503 с тем же payload. Endpoint служит основной точкой внешней проверки состояния приложения.", + "metadata": { + "tags": [ + "api", + "health", + "control-plane" + ], + "type": "api_method", + "order": 1, + "owner": null, + "doc_id": null, + "module": "telegram_notify_app", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "8b5a533a8076e2e9d36995eee29aeade260080bdca2ec8e21fe28f08574b983f", + "doc_kind": "misc", + "doc_version": null, + "document_id": "api.health_endpoint", + "source_path": "docs/documentation/api/health-endpoint.md", + "section_path": "Summary", + "artifact_type": null, + "last_modified": null, + "section_title": "Summary", + "staleness_score": null, + "system_component": null + } + } + ] +} +``` + +### User Prompt Overview +- question: Какие документы связаны с /send? +- intent: DOCUMENTATION_EXPLAIN +- sub_intent: RELATED_DOCS_EXPLAIN +- documents: 0 +- facts: 0 +- relations: 4 | samples: api.send_message_endpoint:parent, api.send_message_endpoint:depends_on, api.send_message_endpoint:part_of + +## Mismatches +- none \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/docs_router_llm_disambiguation/20260326_150139/full_chain_docs_intents_v3-3x_v3-system-flow-health-1.json b/tests/pipeline_setup_v3/test_results/docs_router_llm_disambiguation/20260326_150139/full_chain_docs_intents_v3-3x_v3-system-flow-health-1.json new file mode 100644 index 0000000..5bb4a6a --- /dev/null +++ b/tests/pipeline_setup_v3/test_results/docs_router_llm_disambiguation/20260326_150139/full_chain_docs_intents_v3-3x_v3-system-flow-health-1.json @@ -0,0 +1,88 @@ +{ + "meta": { + "case_id": "v3-system-flow-health-1", + "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_03_docs/full_chain_docs_intents_v3-3x.yaml", + "runner": "agent_runtime", + "mode": "pre_llm", + "passed": true, + "mismatches": [], + "actual": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "SYSTEM_FLOW_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START", + "rag_count": 19, + "llm_answer": "", + "answer_mode": "answered", + "path_scope": [], + "doc_scope": [ + "api.health_endpoint", + "api.control_actions_endpoint", + "api.send_message_endpoint", + "domain.runtime_health", + "logic.telegram_notification_loop", + "api.actions_endpoint" + ], + "entity_candidates": [], + "symbol_candidates": [], + "layers": [ + "D4_WORKFLOW_INDEX", + "D5_RELATION_GRAPH", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "filters": { + "doc_type": null + }, + "pipeline_mode": "pre_llm_only", + "gate_decision": "allow", + "prompt_used": "docs_explain_answer", + "llm_mode": "prose", + "degraded_reason": null, + "code_intents_stubbed": true + } + }, + "pipeline_steps": [ + { + "step": "input_query", + "input": { + "query": "Как работает health check runtime?" + }, + "output": { + "query": "Как работает health check runtime?" + } + }, + { + "step": "router", + "input": { + "query": "Как работает health check runtime?" + }, + "output": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "SYSTEM_FLOW_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START" + } + }, + { + "step": "docs_pipeline", + "input": { + "query": "Как работает health check runtime?" + }, + "output": { + "answer_mode": "ready", + "prompt_name": "docs_explain_answer", + "llm_request": { + "prompt_name": "docs_explain_answer", + "log_context": "graph.project_qa.docs.answer", + "prompt_stats": { + "system_chars": 393, + "user_chars": 12835, + "tokens_in_estimate": 3307 + } + }, + "degraded_reason": "" + } + } + ] +} \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/docs_router_llm_disambiguation/20260326_150139/full_chain_docs_intents_v3-3x_v3-system-flow-health-1.md b/tests/pipeline_setup_v3/test_results/docs_router_llm_disambiguation/20260326_150139/full_chain_docs_intents_v3-3x_v3-system-flow-health-1.md new file mode 100644 index 0000000..50599f3 --- /dev/null +++ b/tests/pipeline_setup_v3/test_results/docs_router_llm_disambiguation/20260326_150139/full_chain_docs_intents_v3-3x_v3-system-flow-health-1.md @@ -0,0 +1,686 @@ +# v3-system-flow-health-1 + +- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_03_docs/full_chain_docs_intents_v3-3x.yaml +- runner: agent_runtime +- mode: pre_llm +- passed: True + +## Query +Как работает health check runtime? + +## Actual +{ + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "SYSTEM_FLOW_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START", + "rag_count": 19, + "llm_answer": "", + "answer_mode": "answered", + "path_scope": [], + "doc_scope": [ + "api.health_endpoint", + "api.control_actions_endpoint", + "api.send_message_endpoint", + "domain.runtime_health", + "logic.telegram_notification_loop", + "api.actions_endpoint" + ], + "entity_candidates": [], + "symbol_candidates": [], + "layers": [ + "D4_WORKFLOW_INDEX", + "D5_RELATION_GRAPH", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "filters": { + "doc_type": null + }, + "pipeline_mode": "pre_llm_only", + "gate_decision": "allow", + "prompt_used": "docs_explain_answer", + "llm_mode": "prose", + "degraded_reason": null, + "code_intents_stubbed": true +} + +## Pipeline Steps +### input_query +```json +{ + "input": { + "query": "Как работает health check runtime?" + }, + "output": { + "query": "Как работает health check runtime?" + } +} +``` + +### router +```json +{ + "input": { + "query": "Как работает health check runtime?" + }, + "output": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "SYSTEM_FLOW_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START" + } +} +``` + +### docs_pipeline +```json +{ + "input": { + "query": "Как работает health check runtime?" + }, + "output": { + "answer_mode": "ready", + "prompt_name": "docs_explain_answer", + "llm_request": { + "prompt_name": "docs_explain_answer", + "log_context": "graph.project_qa.docs.answer", + "prompt_stats": { + "system_chars": 393, + "user_chars": 12835, + "tokens_in_estimate": 3307 + } + }, + "degraded_reason": "" + } +} +``` + +## Diagnostics +{ + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "SYSTEM_FLOW_EXPLAIN", + "layers_used": [ + "D4_WORKFLOW_INDEX", + "D5_RELATION_GRAPH", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "documents_found": 1, + "facts_found": 0, + "relations_found": 2, + "openapi_fields_extracted": 0, + "missing_required_fields": [], + "openapi_status": { + "has_path": false, + "has_method": false, + "has_request": false, + "has_response": false + }, + "prompt_used": "docs_explain_answer", + "llm_mode": "prose", + "output_valid": true, + "matched_intent_source": "llm", + "matched_anchor_type": "none", + "matched_anchor_value": null, + "exact_anchor_match": false, + "docs_layers_requested": [ + "D4_WORKFLOW_INDEX", + "D5_RELATION_GRAPH", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "docs_layers_with_hits": [ + "D4_WORKFLOW_INDEX", + "D5_RELATION_GRAPH", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "planned_layers": [ + "D4_WORKFLOW_INDEX", + "D5_RELATION_GRAPH", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "executed_layers": [ + "D4_WORKFLOW_INDEX", + "D5_RELATION_GRAPH", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "non_empty_layers": [ + "D4_WORKFLOW_INDEX", + "D5_RELATION_GRAPH", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "layer_diagnostics": { + "D4_WORKFLOW_INDEX": { + "hits": 3, + "top_ids": [ + "api.health_endpoint", + "api.control_actions_endpoint", + "api.send_message_endpoint" + ], + "top_sections": [ + "Scenario" + ] + }, + "D5_RELATION_GRAPH": { + "hits": 8, + "top_ids": [ + "801650f8bcbfbfbefd35c14447bfef7b3c3827313db790efa7faf47db860f8c4", + "8595d7b82fecdb7ef579fa8961cda6799bb21970061e5bc221d4dd7a3d53fd04", + "af2a4f7c1b677b908410ba720915405e10dbd0870e30a3c6e3aa2468550ddf0e", + "c718b1939621233295ccaf6e8203e7fd94f3dd1bfb88f10c51bc5e33d53a24aa", + "616f5cbf25da83cb51d8d0741a7fc351620c9ca2c6513fa2094b4aa476f0912a" + ], + "top_sections": [ + "domain.runtime_health:used_by", + "domain.runtime_health:related_logic", + "domain.runtime_health:part_of", + "api.health_endpoint:parent", + "api.health_endpoint:part_of" + ] + }, + "D1_DOCUMENT_CATALOG": { + "hits": 4, + "top_ids": [ + "domain.runtime_health", + "api.health_endpoint", + "logic.telegram_notification_loop", + "api.control_actions_endpoint" + ], + "top_sections": [ + "Сущность runtime health", + "HTTP API /health", + "Цикл отправки уведомлений в Telegram", + "HTTP API /actions/{action}" + ] + }, + "D0_DOC_CHUNKS": { + "hits": 4, + "top_ids": [ + "api.health_endpoint" + ], + "top_sections": [ + "api.health_endpoint:Описание", + "api.health_endpoint:Сценарий", + "api.health_endpoint:Summary", + "api.health_endpoint:Функциональные требования" + ] + } + }, + "query_entity_candidates": [], + "resolved_entity_candidates": [], + "query_anchor_candidates": [], + "resolved_anchor_candidates": [ + "api.health_endpoint", + "docs/documentation/api/health-endpoint.md", + "api.control_actions_endpoint", + "docs/documentation/api/control-actions-endpoint.md", + "api.send_message_endpoint", + "docs/documentation/api/send-message-endpoint.md", + "docs/documentation/domain/runtime-health-entity.md", + "domain.runtime_health", + "logic.telegram_notification_loop", + "docs/documentation/logic/telegram-notification-loop.md" + ], + "anchor_candidates": [], + "selected_anchor": null, + "anchor_selection_reason": "", + "anchor_match_type": "", + "doc_ids": [ + "api.health_endpoint", + "api.control_actions_endpoint", + "api.send_message_endpoint", + "domain.runtime_health", + "logic.telegram_notification_loop", + "api.actions_endpoint" + ], + "doc_paths": [ + "docs/documentation/api/health-endpoint.md", + "docs/documentation/api/control-actions-endpoint.md", + "docs/documentation/api/send-message-endpoint.md", + "docs/documentation/domain/runtime-health-entity.md", + "docs/documentation/logic/telegram-notification-loop.md" + ], + "doc_titles": [ + "Scenario", + "domain.runtime_health:used_by", + "domain.runtime_health:related_logic", + "domain.runtime_health:part_of", + "api.health_endpoint:parent", + "api.health_endpoint:part_of", + "api.health_endpoint:depends_on", + "domain.runtime_health:parent", + "api.control_actions_endpoint:related_api", + "Сущность runtime health", + "HTTP API /health", + "Цикл отправки уведомлений в Telegram", + "HTTP API /actions/{action}", + "api.health_endpoint:Описание", + "api.health_endpoint:Сценарий", + "api.health_endpoint:Summary", + "api.health_endpoint:Функциональные требования" + ], + "relation_hits_count": 2, + "relation_targets": [ + "domain.runtime_health:used_by", + "domain.runtime_health:related_logic" + ], + "selected_doc_ids": [ + "domain.runtime_health", + "api.health_endpoint", + "api.control_actions_endpoint" + ], + "selected_fact_ids": [], + "selected_relation_ids": [ + "801650f8bcbfbfbefd35c14447bfef7b3c3827313db790efa7faf47db860f8c4", + "8595d7b82fecdb7ef579fa8961cda6799bb21970061e5bc221d4dd7a3d53fd04" + ], + "selected_chunk_ids": [ + "api.health_endpoint" + ], + "selected_entity_ids": [], + "selected_workflow_ids": [ + "83a9287bd9ac1f709258078d0e16d326615b4af1b7d77b323ff050dfb97a3e41", + "f78b822d4366b10322fd4a35e347deae59d55ff4132951201f4df3d1653aec61" + ], + "fallback_doc_hits_count": 3, + "fallback_used": false, + "fact_hits": 0, + "entity_hits": 0, + "evidence_summary": { + "documents": 1, + "facts": 0, + "entities": 0, + "workflows": 2, + "relations": 2, + "chunks": 2, + "selected_doc_ids": [ + "domain.runtime_health", + "api.health_endpoint", + "api.control_actions_endpoint" + ], + "selected_fact_ids": [], + "selected_relation_ids": [ + "801650f8bcbfbfbefd35c14447bfef7b3c3827313db790efa7faf47db860f8c4", + "8595d7b82fecdb7ef579fa8961cda6799bb21970061e5bc221d4dd7a3d53fd04" + ], + "selected_chunk_ids": [ + "api.health_endpoint" + ], + "entity_hits": 0, + "openapi_signals": { + "path_found": false, + "method_found": false, + "operation_semantics_found": false, + "request_payload_found": false, + "request_schema": false, + "request_fields_found": false, + "response_payload_found": false, + "response_schema": false, + "response_fields_found": false, + "status_codes": false, + "content_type_found": false, + "examples_found": false, + "payload_description": false + } + }, + "gate_decision": "allow", + "gate_decision_reason": "evidence_sufficient", + "gate_missing_requirements": [], + "gate_satisfied_requirements": [ + "retrieval_non_empty" + ], + "openapi_evidence": { + "path_found": false, + "method_found": false, + "operation_semantics_found": false, + "request_payload_found": false, + "request_schema": false, + "request_fields_found": false, + "response_payload_found": false, + "response_schema": false, + "response_fields_found": false, + "status_codes": false, + "content_type_found": false, + "examples_found": false, + "payload_description": false + }, + "requested_fragment_type": null, + "fragment_evidence_found": [], + "fragment_missing_requirements": [], + "answer_mode": "ready", + "degrade_reason": null, + "degraded_reason": null, + "code_intents_stubbed": false +} + +## LLM Request +- prompt_name: docs_explain_answer +- log_context: graph.project_qa.docs.answer + +### Prompt Stats +```json +{ + "system_chars": 393, + "user_chars": 12835, + "tokens_in_estimate": 3307 +} +``` + +### System Prompt +```text +Ты объясняешь документацию системы. + +На вход приходит JSON с полями: +- question +- intent +- sub_intent +- documents +- facts +- relations + +Правила: +- Используй только предоставленные факты +- Не додумывай +- Если данных недостаточно, скажи это явно +- Объясняй структурировано + +Формат ответа: +1. Краткое описание +2. Основные элементы +3. Как это работает +4. Связи с другими частями системы (если есть) +``` + +### User Prompt +```json +{ + "question": "Как работает health check runtime?", + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "SYSTEM_FLOW_EXPLAIN", + "documents": [ + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/domain/runtime-health-entity.md", + "title": "Сущность runtime health", + "content": "`runtime health` — доменная модель наблюдаемости сервиса, которая описывает общее состояние runtime и состояние отдельных компонентов. Для `test_echo_app` главным объектом наблюдения является компонент `telegram_notify`, у которого важны статус, время старта и количество успешных отправок. Эта модель используется для внешнего health-monitoring и внутренней диагностики.", + "metadata": { + "name": "runtime_health", + "tags": [ + "domain", + "health", + "observability" + ], + "type": "domain_entity", + "layer": "domain", + "links": [ + { + "type": "part_of", + "target": "architecture.telegram_notify_app" + }, + { + "type": "used_by", + "target": "api.health_endpoint" + }, + { + "type": "related_logic", + "target": "logic.telegram_notification_loop" + } + ], + "owner": null, + "title": "Сущность runtime health", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "architecture.telegram_notify_app", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "37d4dcf470ea3de95d59e44786006e369a3ea11bf5dbf4c88877696e9183ee87", + "children": [], + "doc_kind": "misc", + "entities": [ + "WorkerHealth", + "WorkerStatus", + "TelegramNotifyWorker" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "domain.runtime_health", + "source_path": "docs/documentation/domain/runtime-health-entity.md", + "summary_text": "`runtime health` — доменная модель наблюдаемости сервиса, которая описывает общее состояние runtime и состояние отдельных компонентов. Для `test_echo_app` главным объектом наблюдения является компонент `telegram_notify`, у которого важны статус, время старта и количество успешных отправок. Эта модель используется для внешнего health-monitoring и внутренней диагностики.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + } + ], + "facts": [], + "entities": [], + "workflows": [ + { + "layer": "D4_WORKFLOW_INDEX", + "path": "docs/documentation/api/health-endpoint.md", + "title": "Scenario", + "content": "Scenario\nHTTP control plane запущен.\n`TelegramControlChannel` зарегистрирован в runtime.\nКлиент отправляет `GET /health`.\n1. Endpoint принимает HTTP-запрос `GET /health`.\n2. API вызывает `health_provider` через `TelegramControlChannel`.\n3. Канал получает health payload от runtime.\n4. Endpoint определяет HTTP status code по полю `status` в payload.\n5. Endpoint возвращает payload клиенту в формате JSON.\n1. Если runtime вернул статус, отличный от `ok`, endpoint возвращает тот же payload c HTTP 503.", + "metadata": { + "owner": null, + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "trigger": [ + "Клиент отправляет `GET /health`." + ], + "blob_sha": "8b5a533a8076e2e9d36995eee29aeade260080bdca2ec8e21fe28f08574b983f", + "main_flow": [ + "1. Endpoint принимает HTTP-запрос `GET /health`.", + "2. API вызывает `health_provider` через `TelegramControlChannel`.", + "3. Канал получает health payload от runtime.", + "4. Endpoint определяет HTTP status code по полю `status` в payload.", + "5. Endpoint возвращает payload клиенту в формате JSON." + ], + "doc_version": null, + "document_id": "api.health_endpoint", + "source_path": "docs/documentation/api/health-endpoint.md", + "workflow_id": "83a9287bd9ac1f709258078d0e16d326615b4af1b7d77b323ff050dfb97a3e41", + "artifact_type": null, + "last_modified": null, + "preconditions": [ + "HTTP control plane запущен.", + "`TelegramControlChannel` зарегистрирован в runtime." + ], + "workflow_name": "Scenario", + "error_handling": [ + "1. Если provider завершился исключением, запрос завершается server-side ошибкой." + ], + "postconditions": [ + "Клиент получает актуальный health payload runtime." + ], + "staleness_score": null, + "alternative_flow": [ + "1. Если runtime вернул статус, отличный от `ok`, endpoint возвращает тот же payload c HTTP 503." + ], + "system_component": null + } + }, + { + "layer": "D4_WORKFLOW_INDEX", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "Scenario", + "content": "Scenario\nHTTP control plane запущен.\n`ControlActionSet` сконфигурирован в `TelegramControlChannel`.\nВ path передано одно из поддерживаемых действий: `start`, `stop`, `status`.\nКлиент отправляет `GET` или `POST` на `/actions/{action}`.\n1. Endpoint принимает запрос и извлекает path parameter `action`.\n2. API определяет источник клиента через `X-Client-Source` или `User-Agent`.\n3. Для `start` и `stop` запрос логируется как control action.\n4. Канал сопоставляет `action` с callback из `ControlActionSet`.\n5. API ожидает завершения callback в пределах допустимого timeout.\n6. При успешном завершении API возвращает JSON со статусом `ok`.\n1. Если `start` или `stop` не успевают завершиться в timeout, API возвращает `202 accepted` и сообщает, что операция еще выполняется.", + "metadata": { + "owner": null, + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "trigger": [ + "Клиент отправляет `GET` или `POST` на `/actions/{action}`." + ], + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "main_flow": [ + "1. Endpoint принимает запрос и извлекает path parameter `action`.", + "2. API определяет источник клиента через `X-Client-Source` или `User-Agent`.", + "3. Для `start` и `stop` запрос логируется как control action.", + "4. Канал сопоставляет `action` с callback из `ControlActionSet`.", + "5. API ожидает завершения callback в пределах допустимого timeout.", + "6. При успешном завершении API возвращает JSON со статусом `ok`." + ], + "doc_version": null, + "document_id": "api.control_actions_endpoint", + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "workflow_id": "f78b822d4366b10322fd4a35e347deae59d55ff4132951201f4df3d1653aec61", + "artifact_type": null, + "last_modified": null, + "preconditions": [ + "HTTP control plane запущен.", + "`ControlActionSet` сконфигурирован в `TelegramControlChannel`.", + "В path передано одно из поддерживаемых действий: `start`, `stop`, `status`." + ], + "workflow_name": "Scenario", + "error_handling": [ + "1. Если actions не сконфигурированы, API возвращает `404`.", + "2. Если передано неподдерживаемое действие, API возвращает `404`.", + "3. Если callback завершился исключением, API возвращает `500`." + ], + "postconditions": [ + "Клиент получает результат выполнения control action или признак, что операция еще продолжается." + ], + "staleness_score": null, + "alternative_flow": [ + "1. Если `start` или `stop` не успевают завершиться в timeout, API возвращает `202 accepted` и сообщает, что операция еще выполняется." + ], + "system_component": null + } + } + ], + "relations": [ + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/domain/runtime-health-entity.md", + "title": "domain.runtime_health:used_by", + "content": "domain.runtime_health used_by api.health_endpoint", + "metadata": { + "owner": null, + "anchor": "frontmatter.links", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "37d4dcf470ea3de95d59e44786006e369a3ea11bf5dbf4c88877696e9183ee87", + "source_id": "domain.runtime_health", + "target_id": "api.health_endpoint", + "doc_version": null, + "relation_id": "801650f8bcbfbfbefd35c14447bfef7b3c3827313db790efa7faf47db860f8c4", + "source_path": "docs/documentation/domain/runtime-health-entity.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "used_by", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/domain/runtime-health-entity.md", + "title": "domain.runtime_health:related_logic", + "content": "domain.runtime_health related_logic logic.telegram_notification_loop", + "metadata": { + "owner": null, + "anchor": "frontmatter.links", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "37d4dcf470ea3de95d59e44786006e369a3ea11bf5dbf4c88877696e9183ee87", + "source_id": "domain.runtime_health", + "target_id": "logic.telegram_notification_loop", + "doc_version": null, + "relation_id": "8595d7b82fecdb7ef579fa8961cda6799bb21970061e5bc221d4dd7a3d53fd04", + "source_path": "docs/documentation/domain/runtime-health-entity.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "related_logic", + "staleness_score": null, + "system_component": null + } + } + ], + "chunks": [ + { + "layer": "D0_DOC_CHUNKS", + "path": "docs/documentation/api/health-endpoint.md", + "title": "api.health_endpoint:Описание", + "content": "Метод предоставляет текущее состояние runtime и его компонентов без изменения состояния системы. Он нужен для мониторинга, readiness/liveness-проверок и быстрой диагностики worker'а `telegram_notify`.", + "metadata": { + "tags": [ + "api", + "health", + "control-plane" + ], + "type": "api_method", + "order": 3, + "owner": null, + "doc_id": null, + "module": "telegram_notify_app", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "8b5a533a8076e2e9d36995eee29aeade260080bdca2ec8e21fe28f08574b983f", + "doc_kind": "misc", + "doc_version": null, + "document_id": "api.health_endpoint", + "source_path": "docs/documentation/api/health-endpoint.md", + "section_path": "Details > Описание", + "artifact_type": null, + "last_modified": null, + "section_title": "Описание", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D0_DOC_CHUNKS", + "path": "docs/documentation/api/health-endpoint.md", + "title": "api.health_endpoint:Сценарий", + "content": "**Название:** Получение health-состояния runtime\n\n**Предусловия:**\n- HTTP control plane запущен.\n- `TelegramControlChannel` зарегистрирован в runtime.\n\n**Триггер:**\n- Клиент отправляет `GET /health`.\n\n**Основной сценарий:**\n1. Endpoint принимает HTTP-запрос `GET /health`.\n2. API вызывает `health_provider` через `TelegramControlChannel`.\n3. Канал получает health payload от runtime.\n4. Endpoint определяет HTTP status code по полю `status` в payload.\n5. Endpoint возвращает payload клиенту в формате JSON.\n\n**Альтернативный сценарий:**\n1. Если runtime вернул статус, отличный от `ok`, endpoint возвращает тот же payload c HTTP 503.\n\n**Обработка ошибок:**\n1. Если provider завершился исключением, запрос завершается server-side ошибкой.\n\n**Постусловие:**\n- Клиент получает актуальный health payload runtime.", + "metadata": { + "tags": [ + "api", + "health", + "control-plane" + ], + "type": "api_method", + "order": 4, + "owner": null, + "doc_id": null, + "module": "telegram_notify_app", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "8b5a533a8076e2e9d36995eee29aeade260080bdca2ec8e21fe28f08574b983f", + "doc_kind": "misc", + "doc_version": null, + "document_id": "api.health_endpoint", + "source_path": "docs/documentation/api/health-endpoint.md", + "section_path": "Details > Сценарий", + "artifact_type": null, + "last_modified": null, + "section_title": "Сценарий", + "staleness_score": null, + "system_component": null + } + } + ] +} +``` + +### User Prompt Overview +- question: Как работает health check runtime? +- intent: DOCUMENTATION_EXPLAIN +- sub_intent: SYSTEM_FLOW_EXPLAIN +- documents: 1 | samples: Сущность runtime health +- facts: 0 +- relations: 2 | samples: domain.runtime_health:used_by, domain.runtime_health:related_logic + +## Mismatches +- none \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/docs_router_llm_disambiguation/20260326_150139/full_chain_docs_intents_v3-3x_v3-system-flow-health-2.json b/tests/pipeline_setup_v3/test_results/docs_router_llm_disambiguation/20260326_150139/full_chain_docs_intents_v3-3x_v3-system-flow-health-2.json new file mode 100644 index 0000000..63877f9 --- /dev/null +++ b/tests/pipeline_setup_v3/test_results/docs_router_llm_disambiguation/20260326_150139/full_chain_docs_intents_v3-3x_v3-system-flow-health-2.json @@ -0,0 +1,90 @@ +{ + "meta": { + "case_id": "v3-system-flow-health-2", + "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_03_docs/full_chain_docs_intents_v3-3x.yaml", + "runner": "agent_runtime", + "mode": "pre_llm", + "passed": true, + "mismatches": [], + "actual": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "SYSTEM_FLOW_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START", + "rag_count": 19, + "llm_answer": "", + "answer_mode": "answered", + "path_scope": [], + "doc_scope": [ + "api.health_endpoint", + "api.control_actions_endpoint", + "api.send_message_endpoint", + "domain.runtime_health", + "architecture.telegram_notify_app_overview", + "logic.telegram_notification_loop", + "api.actions_endpoint", + "docs/README.md" + ], + "entity_candidates": [], + "symbol_candidates": [], + "layers": [ + "D4_WORKFLOW_INDEX", + "D5_RELATION_GRAPH", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "filters": { + "doc_type": null + }, + "pipeline_mode": "pre_llm_only", + "gate_decision": "allow", + "prompt_used": "docs_explain_answer", + "llm_mode": "prose", + "degraded_reason": null, + "code_intents_stubbed": true + } + }, + "pipeline_steps": [ + { + "step": "input_query", + "input": { + "query": "Как происходит проверка состояния runtime?" + }, + "output": { + "query": "Как происходит проверка состояния runtime?" + } + }, + { + "step": "router", + "input": { + "query": "Как происходит проверка состояния runtime?" + }, + "output": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "SYSTEM_FLOW_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START" + } + }, + { + "step": "docs_pipeline", + "input": { + "query": "Как происходит проверка состояния runtime?" + }, + "output": { + "answer_mode": "ready", + "prompt_name": "docs_explain_answer", + "llm_request": { + "prompt_name": "docs_explain_answer", + "log_context": "graph.project_qa.docs.answer", + "prompt_stats": { + "system_chars": 393, + "user_chars": 13070, + "tokens_in_estimate": 3366 + } + }, + "degraded_reason": "" + } + } + ] +} \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/docs_router_llm_disambiguation/20260326_150139/full_chain_docs_intents_v3-3x_v3-system-flow-health-2.md b/tests/pipeline_setup_v3/test_results/docs_router_llm_disambiguation/20260326_150139/full_chain_docs_intents_v3-3x_v3-system-flow-health-2.md new file mode 100644 index 0000000..c887c84 --- /dev/null +++ b/tests/pipeline_setup_v3/test_results/docs_router_llm_disambiguation/20260326_150139/full_chain_docs_intents_v3-3x_v3-system-flow-health-2.md @@ -0,0 +1,696 @@ +# v3-system-flow-health-2 + +- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_03_docs/full_chain_docs_intents_v3-3x.yaml +- runner: agent_runtime +- mode: pre_llm +- passed: True + +## Query +Как происходит проверка состояния runtime? + +## Actual +{ + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "SYSTEM_FLOW_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START", + "rag_count": 19, + "llm_answer": "", + "answer_mode": "answered", + "path_scope": [], + "doc_scope": [ + "api.health_endpoint", + "api.control_actions_endpoint", + "api.send_message_endpoint", + "domain.runtime_health", + "architecture.telegram_notify_app_overview", + "logic.telegram_notification_loop", + "api.actions_endpoint", + "docs/README.md" + ], + "entity_candidates": [], + "symbol_candidates": [], + "layers": [ + "D4_WORKFLOW_INDEX", + "D5_RELATION_GRAPH", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "filters": { + "doc_type": null + }, + "pipeline_mode": "pre_llm_only", + "gate_decision": "allow", + "prompt_used": "docs_explain_answer", + "llm_mode": "prose", + "degraded_reason": null, + "code_intents_stubbed": true +} + +## Pipeline Steps +### input_query +```json +{ + "input": { + "query": "Как происходит проверка состояния runtime?" + }, + "output": { + "query": "Как происходит проверка состояния runtime?" + } +} +``` + +### router +```json +{ + "input": { + "query": "Как происходит проверка состояния runtime?" + }, + "output": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "SYSTEM_FLOW_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START" + } +} +``` + +### docs_pipeline +```json +{ + "input": { + "query": "Как происходит проверка состояния runtime?" + }, + "output": { + "answer_mode": "ready", + "prompt_name": "docs_explain_answer", + "llm_request": { + "prompt_name": "docs_explain_answer", + "log_context": "graph.project_qa.docs.answer", + "prompt_stats": { + "system_chars": 393, + "user_chars": 13070, + "tokens_in_estimate": 3366 + } + }, + "degraded_reason": "" + } +} +``` + +## Diagnostics +{ + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "SYSTEM_FLOW_EXPLAIN", + "layers_used": [ + "D4_WORKFLOW_INDEX", + "D5_RELATION_GRAPH", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "documents_found": 1, + "facts_found": 0, + "relations_found": 2, + "openapi_fields_extracted": 0, + "missing_required_fields": [], + "openapi_status": { + "has_path": false, + "has_method": false, + "has_request": false, + "has_response": false + }, + "prompt_used": "docs_explain_answer", + "llm_mode": "prose", + "output_valid": true, + "matched_intent_source": "llm", + "matched_anchor_type": "none", + "matched_anchor_value": null, + "exact_anchor_match": false, + "docs_layers_requested": [ + "D4_WORKFLOW_INDEX", + "D5_RELATION_GRAPH", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "docs_layers_with_hits": [ + "D4_WORKFLOW_INDEX", + "D5_RELATION_GRAPH", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "planned_layers": [ + "D4_WORKFLOW_INDEX", + "D5_RELATION_GRAPH", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "executed_layers": [ + "D4_WORKFLOW_INDEX", + "D5_RELATION_GRAPH", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "non_empty_layers": [ + "D4_WORKFLOW_INDEX", + "D5_RELATION_GRAPH", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "layer_diagnostics": { + "D4_WORKFLOW_INDEX": { + "hits": 3, + "top_ids": [ + "api.health_endpoint", + "api.control_actions_endpoint", + "api.send_message_endpoint" + ], + "top_sections": [ + "Scenario" + ] + }, + "D5_RELATION_GRAPH": { + "hits": 8, + "top_ids": [ + "8595d7b82fecdb7ef579fa8961cda6799bb21970061e5bc221d4dd7a3d53fd04", + "801650f8bcbfbfbefd35c14447bfef7b3c3827313db790efa7faf47db860f8c4", + "af2a4f7c1b677b908410ba720915405e10dbd0870e30a3c6e3aa2468550ddf0e", + "79bdb0a74713df6064008179ca8c5c186dc23e4e1c5e2c9607b0bdddeba50f93", + "77f5d358ab85b3d92018b6b51da7c39773148dfd346686e8832a45370c841160" + ], + "top_sections": [ + "domain.runtime_health:related_logic", + "domain.runtime_health:used_by", + "domain.runtime_health:part_of", + "domain.runtime_health:parent", + "api.health_endpoint:depends_on" + ] + }, + "D1_DOCUMENT_CATALOG": { + "hits": 4, + "top_ids": [ + "domain.runtime_health", + "logic.telegram_notification_loop", + "api.health_endpoint", + "api.control_actions_endpoint" + ], + "top_sections": [ + "Сущность runtime health", + "Цикл отправки уведомлений в Telegram", + "HTTP API /health", + "HTTP API /actions/{action}" + ] + }, + "D0_DOC_CHUNKS": { + "hits": 4, + "top_ids": [ + "domain.runtime_health", + "docs/README.md", + "api.control_actions_endpoint" + ], + "top_sections": [ + "domain.runtime_health:Details", + "domain.runtime_health:Summary", + "docs/README.md:Навигация", + "api.control_actions_endpoint:Summary" + ] + } + }, + "query_entity_candidates": [], + "resolved_entity_candidates": [], + "query_anchor_candidates": [], + "resolved_anchor_candidates": [ + "api.health_endpoint", + "docs/documentation/api/health-endpoint.md", + "api.control_actions_endpoint", + "docs/documentation/api/control-actions-endpoint.md", + "api.send_message_endpoint", + "docs/documentation/api/send-message-endpoint.md", + "docs/documentation/domain/runtime-health-entity.md", + "docs/documentation/architecture/telegram-notify-app-overview.md", + "domain.runtime_health", + "logic.telegram_notification_loop", + "docs/documentation/logic/telegram-notification-loop.md", + "docs/README.md" + ], + "anchor_candidates": [], + "selected_anchor": null, + "anchor_selection_reason": "", + "anchor_match_type": "", + "doc_ids": [ + "api.health_endpoint", + "api.control_actions_endpoint", + "api.send_message_endpoint", + "domain.runtime_health", + "architecture.telegram_notify_app_overview", + "logic.telegram_notification_loop", + "api.actions_endpoint", + "docs/README.md" + ], + "doc_paths": [ + "docs/documentation/api/health-endpoint.md", + "docs/documentation/api/control-actions-endpoint.md", + "docs/documentation/api/send-message-endpoint.md", + "docs/documentation/domain/runtime-health-entity.md", + "docs/documentation/architecture/telegram-notify-app-overview.md", + "docs/documentation/logic/telegram-notification-loop.md", + "docs/README.md" + ], + "doc_titles": [ + "Scenario", + "domain.runtime_health:related_logic", + "domain.runtime_health:used_by", + "domain.runtime_health:part_of", + "domain.runtime_health:parent", + "api.health_endpoint:depends_on", + "architecture.telegram_notify_app:child", + "architecture.telegram_notify_app:depends_on", + "api.health_endpoint:part_of", + "Сущность runtime health", + "Цикл отправки уведомлений в Telegram", + "HTTP API /health", + "HTTP API /actions/{action}", + "domain.runtime_health:Details", + "domain.runtime_health:Summary", + "docs/README.md:Навигация", + "api.control_actions_endpoint:Summary" + ], + "relation_hits_count": 2, + "relation_targets": [ + "domain.runtime_health:related_logic", + "domain.runtime_health:used_by" + ], + "selected_doc_ids": [ + "domain.runtime_health", + "api.health_endpoint", + "api.control_actions_endpoint" + ], + "selected_fact_ids": [], + "selected_relation_ids": [ + "8595d7b82fecdb7ef579fa8961cda6799bb21970061e5bc221d4dd7a3d53fd04", + "801650f8bcbfbfbefd35c14447bfef7b3c3827313db790efa7faf47db860f8c4" + ], + "selected_chunk_ids": [ + "domain.runtime_health" + ], + "selected_entity_ids": [], + "selected_workflow_ids": [ + "83a9287bd9ac1f709258078d0e16d326615b4af1b7d77b323ff050dfb97a3e41", + "f78b822d4366b10322fd4a35e347deae59d55ff4132951201f4df3d1653aec61" + ], + "fallback_doc_hits_count": 3, + "fallback_used": false, + "fact_hits": 0, + "entity_hits": 0, + "evidence_summary": { + "documents": 1, + "facts": 0, + "entities": 0, + "workflows": 2, + "relations": 2, + "chunks": 2, + "selected_doc_ids": [ + "domain.runtime_health", + "api.health_endpoint", + "api.control_actions_endpoint" + ], + "selected_fact_ids": [], + "selected_relation_ids": [ + "8595d7b82fecdb7ef579fa8961cda6799bb21970061e5bc221d4dd7a3d53fd04", + "801650f8bcbfbfbefd35c14447bfef7b3c3827313db790efa7faf47db860f8c4" + ], + "selected_chunk_ids": [ + "domain.runtime_health" + ], + "entity_hits": 0, + "openapi_signals": { + "path_found": false, + "method_found": false, + "operation_semantics_found": false, + "request_payload_found": false, + "request_schema": false, + "request_fields_found": false, + "response_payload_found": false, + "response_schema": false, + "response_fields_found": false, + "status_codes": false, + "content_type_found": false, + "examples_found": false, + "payload_description": false + } + }, + "gate_decision": "allow", + "gate_decision_reason": "evidence_sufficient", + "gate_missing_requirements": [], + "gate_satisfied_requirements": [ + "retrieval_non_empty" + ], + "openapi_evidence": { + "path_found": false, + "method_found": false, + "operation_semantics_found": false, + "request_payload_found": false, + "request_schema": false, + "request_fields_found": false, + "response_payload_found": false, + "response_schema": false, + "response_fields_found": false, + "status_codes": false, + "content_type_found": false, + "examples_found": false, + "payload_description": false + }, + "requested_fragment_type": null, + "fragment_evidence_found": [], + "fragment_missing_requirements": [], + "answer_mode": "ready", + "degrade_reason": null, + "degraded_reason": null, + "code_intents_stubbed": false +} + +## LLM Request +- prompt_name: docs_explain_answer +- log_context: graph.project_qa.docs.answer + +### Prompt Stats +```json +{ + "system_chars": 393, + "user_chars": 13070, + "tokens_in_estimate": 3366 +} +``` + +### System Prompt +```text +Ты объясняешь документацию системы. + +На вход приходит JSON с полями: +- question +- intent +- sub_intent +- documents +- facts +- relations + +Правила: +- Используй только предоставленные факты +- Не додумывай +- Если данных недостаточно, скажи это явно +- Объясняй структурировано + +Формат ответа: +1. Краткое описание +2. Основные элементы +3. Как это работает +4. Связи с другими частями системы (если есть) +``` + +### User Prompt +```json +{ + "question": "Как происходит проверка состояния runtime?", + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "SYSTEM_FLOW_EXPLAIN", + "documents": [ + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/domain/runtime-health-entity.md", + "title": "Сущность runtime health", + "content": "`runtime health` — доменная модель наблюдаемости сервиса, которая описывает общее состояние runtime и состояние отдельных компонентов. Для `test_echo_app` главным объектом наблюдения является компонент `telegram_notify`, у которого важны статус, время старта и количество успешных отправок. Эта модель используется для внешнего health-monitoring и внутренней диагностики.", + "metadata": { + "name": "runtime_health", + "tags": [ + "domain", + "health", + "observability" + ], + "type": "domain_entity", + "layer": "domain", + "links": [ + { + "type": "part_of", + "target": "architecture.telegram_notify_app" + }, + { + "type": "used_by", + "target": "api.health_endpoint" + }, + { + "type": "related_logic", + "target": "logic.telegram_notification_loop" + } + ], + "owner": null, + "title": "Сущность runtime health", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "architecture.telegram_notify_app", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "37d4dcf470ea3de95d59e44786006e369a3ea11bf5dbf4c88877696e9183ee87", + "children": [], + "doc_kind": "misc", + "entities": [ + "WorkerHealth", + "WorkerStatus", + "TelegramNotifyWorker" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "domain.runtime_health", + "source_path": "docs/documentation/domain/runtime-health-entity.md", + "summary_text": "`runtime health` — доменная модель наблюдаемости сервиса, которая описывает общее состояние runtime и состояние отдельных компонентов. Для `test_echo_app` главным объектом наблюдения является компонент `telegram_notify`, у которого важны статус, время старта и количество успешных отправок. Эта модель используется для внешнего health-monitoring и внутренней диагностики.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + } + ], + "facts": [], + "entities": [], + "workflows": [ + { + "layer": "D4_WORKFLOW_INDEX", + "path": "docs/documentation/api/health-endpoint.md", + "title": "Scenario", + "content": "Scenario\nHTTP control plane запущен.\n`TelegramControlChannel` зарегистрирован в runtime.\nКлиент отправляет `GET /health`.\n1. Endpoint принимает HTTP-запрос `GET /health`.\n2. API вызывает `health_provider` через `TelegramControlChannel`.\n3. Канал получает health payload от runtime.\n4. Endpoint определяет HTTP status code по полю `status` в payload.\n5. Endpoint возвращает payload клиенту в формате JSON.\n1. Если runtime вернул статус, отличный от `ok`, endpoint возвращает тот же payload c HTTP 503.", + "metadata": { + "owner": null, + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "trigger": [ + "Клиент отправляет `GET /health`." + ], + "blob_sha": "8b5a533a8076e2e9d36995eee29aeade260080bdca2ec8e21fe28f08574b983f", + "main_flow": [ + "1. Endpoint принимает HTTP-запрос `GET /health`.", + "2. API вызывает `health_provider` через `TelegramControlChannel`.", + "3. Канал получает health payload от runtime.", + "4. Endpoint определяет HTTP status code по полю `status` в payload.", + "5. Endpoint возвращает payload клиенту в формате JSON." + ], + "doc_version": null, + "document_id": "api.health_endpoint", + "source_path": "docs/documentation/api/health-endpoint.md", + "workflow_id": "83a9287bd9ac1f709258078d0e16d326615b4af1b7d77b323ff050dfb97a3e41", + "artifact_type": null, + "last_modified": null, + "preconditions": [ + "HTTP control plane запущен.", + "`TelegramControlChannel` зарегистрирован в runtime." + ], + "workflow_name": "Scenario", + "error_handling": [ + "1. Если provider завершился исключением, запрос завершается server-side ошибкой." + ], + "postconditions": [ + "Клиент получает актуальный health payload runtime." + ], + "staleness_score": null, + "alternative_flow": [ + "1. Если runtime вернул статус, отличный от `ok`, endpoint возвращает тот же payload c HTTP 503." + ], + "system_component": null + } + }, + { + "layer": "D4_WORKFLOW_INDEX", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "Scenario", + "content": "Scenario\nHTTP control plane запущен.\n`ControlActionSet` сконфигурирован в `TelegramControlChannel`.\nВ path передано одно из поддерживаемых действий: `start`, `stop`, `status`.\nКлиент отправляет `GET` или `POST` на `/actions/{action}`.\n1. Endpoint принимает запрос и извлекает path parameter `action`.\n2. API определяет источник клиента через `X-Client-Source` или `User-Agent`.\n3. Для `start` и `stop` запрос логируется как control action.\n4. Канал сопоставляет `action` с callback из `ControlActionSet`.\n5. API ожидает завершения callback в пределах допустимого timeout.\n6. При успешном завершении API возвращает JSON со статусом `ok`.\n1. Если `start` или `stop` не успевают завершиться в timeout, API возвращает `202 accepted` и сообщает, что операция еще выполняется.", + "metadata": { + "owner": null, + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "trigger": [ + "Клиент отправляет `GET` или `POST` на `/actions/{action}`." + ], + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "main_flow": [ + "1. Endpoint принимает запрос и извлекает path parameter `action`.", + "2. API определяет источник клиента через `X-Client-Source` или `User-Agent`.", + "3. Для `start` и `stop` запрос логируется как control action.", + "4. Канал сопоставляет `action` с callback из `ControlActionSet`.", + "5. API ожидает завершения callback в пределах допустимого timeout.", + "6. При успешном завершении API возвращает JSON со статусом `ok`." + ], + "doc_version": null, + "document_id": "api.control_actions_endpoint", + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "workflow_id": "f78b822d4366b10322fd4a35e347deae59d55ff4132951201f4df3d1653aec61", + "artifact_type": null, + "last_modified": null, + "preconditions": [ + "HTTP control plane запущен.", + "`ControlActionSet` сконфигурирован в `TelegramControlChannel`.", + "В path передано одно из поддерживаемых действий: `start`, `stop`, `status`." + ], + "workflow_name": "Scenario", + "error_handling": [ + "1. Если actions не сконфигурированы, API возвращает `404`.", + "2. Если передано неподдерживаемое действие, API возвращает `404`.", + "3. Если callback завершился исключением, API возвращает `500`." + ], + "postconditions": [ + "Клиент получает результат выполнения control action или признак, что операция еще продолжается." + ], + "staleness_score": null, + "alternative_flow": [ + "1. Если `start` или `stop` не успевают завершиться в timeout, API возвращает `202 accepted` и сообщает, что операция еще выполняется." + ], + "system_component": null + } + } + ], + "relations": [ + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/domain/runtime-health-entity.md", + "title": "domain.runtime_health:related_logic", + "content": "domain.runtime_health related_logic logic.telegram_notification_loop", + "metadata": { + "owner": null, + "anchor": "frontmatter.links", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "37d4dcf470ea3de95d59e44786006e369a3ea11bf5dbf4c88877696e9183ee87", + "source_id": "domain.runtime_health", + "target_id": "logic.telegram_notification_loop", + "doc_version": null, + "relation_id": "8595d7b82fecdb7ef579fa8961cda6799bb21970061e5bc221d4dd7a3d53fd04", + "source_path": "docs/documentation/domain/runtime-health-entity.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "related_logic", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/domain/runtime-health-entity.md", + "title": "domain.runtime_health:used_by", + "content": "domain.runtime_health used_by api.health_endpoint", + "metadata": { + "owner": null, + "anchor": "frontmatter.links", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "37d4dcf470ea3de95d59e44786006e369a3ea11bf5dbf4c88877696e9183ee87", + "source_id": "domain.runtime_health", + "target_id": "api.health_endpoint", + "doc_version": null, + "relation_id": "801650f8bcbfbfbefd35c14447bfef7b3c3827313db790efa7faf47db860f8c4", + "source_path": "docs/documentation/domain/runtime-health-entity.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "used_by", + "staleness_score": null, + "system_component": null + } + } + ], + "chunks": [ + { + "layer": "D0_DOC_CHUNKS", + "path": "docs/documentation/domain/runtime-health-entity.md", + "title": "domain.runtime_health:Details", + "content": "Health payload собирается runtime'ом и включает общий статус приложения и список компонентов. Для worker `telegram_notify` используются состояния `ok`, `degraded` и `unhealthy`, которые зависят от жизненного цикла фонового потока, наличия Telegram credentials и результата последней отправки.\n\nКлючевые metadata поля компонента — `app_started_at` и `notifications_sent`. Первое отражает UTC timestamp запуска worker'а, второе показывает число успешных доставок с момента старта runtime. Эти поля позволяют отделить реальный жизненный цикл worker'а от простого факта, что HTTP API отвечает.\n\nСущность `runtime health` связывает техническое состояние worker'а с операторским представлением сервиса. Через нее клиент `/health` получает не только общий статус процесса, но и диагностический контекст, достаточный для базового мониторинга и troubleshooting.", + "metadata": { + "tags": [ + "domain", + "health", + "observability" + ], + "type": "domain_entity", + "order": 2, + "owner": null, + "doc_id": null, + "module": "telegram_notify_app", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "37d4dcf470ea3de95d59e44786006e369a3ea11bf5dbf4c88877696e9183ee87", + "doc_kind": "misc", + "doc_version": null, + "document_id": "domain.runtime_health", + "source_path": "docs/documentation/domain/runtime-health-entity.md", + "section_path": "Details", + "artifact_type": null, + "last_modified": null, + "section_title": "Details", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D0_DOC_CHUNKS", + "path": "docs/documentation/domain/runtime-health-entity.md", + "title": "domain.runtime_health:Summary", + "content": "`runtime health` — доменная модель наблюдаемости сервиса, которая описывает общее состояние runtime и состояние отдельных компонентов. Для `test_echo_app` главным объектом наблюдения является компонент `telegram_notify`, у которого важны статус, время старта и количество успешных отправок. Эта модель используется для внешнего health-monitoring и внутренней диагностики.", + "metadata": { + "tags": [ + "domain", + "health", + "observability" + ], + "type": "domain_entity", + "order": 1, + "owner": null, + "doc_id": null, + "module": "telegram_notify_app", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "37d4dcf470ea3de95d59e44786006e369a3ea11bf5dbf4c88877696e9183ee87", + "doc_kind": "misc", + "doc_version": null, + "document_id": "domain.runtime_health", + "source_path": "docs/documentation/domain/runtime-health-entity.md", + "section_path": "Summary", + "artifact_type": null, + "last_modified": null, + "section_title": "Summary", + "staleness_score": null, + "system_component": null + } + } + ] +} +``` + +### User Prompt Overview +- question: Как происходит проверка состояния runtime? +- intent: DOCUMENTATION_EXPLAIN +- sub_intent: SYSTEM_FLOW_EXPLAIN +- documents: 1 | samples: Сущность runtime health +- facts: 0 +- relations: 2 | samples: domain.runtime_health:related_logic, domain.runtime_health:used_by + +## Mismatches +- none \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/docs_router_llm_disambiguation/20260326_150139/full_chain_docs_intents_v3-3x_v3-system-flow-telegram-loop-1.json b/tests/pipeline_setup_v3/test_results/docs_router_llm_disambiguation/20260326_150139/full_chain_docs_intents_v3-3x_v3-system-flow-telegram-loop-1.json new file mode 100644 index 0000000..3faecc6 --- /dev/null +++ b/tests/pipeline_setup_v3/test_results/docs_router_llm_disambiguation/20260326_150139/full_chain_docs_intents_v3-3x_v3-system-flow-telegram-loop-1.json @@ -0,0 +1,87 @@ +{ + "meta": { + "case_id": "v3-system-flow-telegram-loop-1", + "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_03_docs/full_chain_docs_intents_v3-3x.yaml", + "runner": "agent_runtime", + "mode": "pre_llm", + "passed": true, + "mismatches": [], + "actual": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "SYSTEM_FLOW_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START", + "rag_count": 19, + "llm_answer": "", + "answer_mode": "answered", + "path_scope": [], + "doc_scope": [ + "api.control_actions_endpoint", + "api.health_endpoint", + "api.send_message_endpoint", + "docs/README.md", + "api.actions_endpoint" + ], + "entity_candidates": [], + "symbol_candidates": [], + "layers": [ + "D4_WORKFLOW_INDEX", + "D5_RELATION_GRAPH", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "filters": { + "doc_type": null + }, + "pipeline_mode": "pre_llm_only", + "gate_decision": "allow", + "prompt_used": "docs_explain_answer", + "llm_mode": "prose", + "degraded_reason": null, + "code_intents_stubbed": true + } + }, + "pipeline_steps": [ + { + "step": "input_query", + "input": { + "query": "Объясни цикл отправки уведомлений" + }, + "output": { + "query": "Объясни цикл отправки уведомлений" + } + }, + { + "step": "router", + "input": { + "query": "Объясни цикл отправки уведомлений" + }, + "output": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "SYSTEM_FLOW_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START" + } + }, + { + "step": "docs_pipeline", + "input": { + "query": "Объясни цикл отправки уведомлений" + }, + "output": { + "answer_mode": "ready", + "prompt_name": "docs_explain_answer", + "llm_request": { + "prompt_name": "docs_explain_answer", + "log_context": "graph.project_qa.docs.answer", + "prompt_stats": { + "system_chars": 393, + "user_chars": 10805, + "tokens_in_estimate": 2800 + } + }, + "degraded_reason": "" + } + } + ] +} \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/docs_router_llm_disambiguation/20260326_150139/full_chain_docs_intents_v3-3x_v3-system-flow-telegram-loop-1.md b/tests/pipeline_setup_v3/test_results/docs_router_llm_disambiguation/20260326_150139/full_chain_docs_intents_v3-3x_v3-system-flow-telegram-loop-1.md new file mode 100644 index 0000000..8eedfa9 --- /dev/null +++ b/tests/pipeline_setup_v3/test_results/docs_router_llm_disambiguation/20260326_150139/full_chain_docs_intents_v3-3x_v3-system-flow-telegram-loop-1.md @@ -0,0 +1,651 @@ +# v3-system-flow-telegram-loop-1 + +- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_03_docs/full_chain_docs_intents_v3-3x.yaml +- runner: agent_runtime +- mode: pre_llm +- passed: True + +## Query +Объясни цикл отправки уведомлений + +## Actual +{ + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "SYSTEM_FLOW_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START", + "rag_count": 19, + "llm_answer": "", + "answer_mode": "answered", + "path_scope": [], + "doc_scope": [ + "api.control_actions_endpoint", + "api.health_endpoint", + "api.send_message_endpoint", + "docs/README.md", + "api.actions_endpoint" + ], + "entity_candidates": [], + "symbol_candidates": [], + "layers": [ + "D4_WORKFLOW_INDEX", + "D5_RELATION_GRAPH", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "filters": { + "doc_type": null + }, + "pipeline_mode": "pre_llm_only", + "gate_decision": "allow", + "prompt_used": "docs_explain_answer", + "llm_mode": "prose", + "degraded_reason": null, + "code_intents_stubbed": true +} + +## Pipeline Steps +### input_query +```json +{ + "input": { + "query": "Объясни цикл отправки уведомлений" + }, + "output": { + "query": "Объясни цикл отправки уведомлений" + } +} +``` + +### router +```json +{ + "input": { + "query": "Объясни цикл отправки уведомлений" + }, + "output": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "SYSTEM_FLOW_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START" + } +} +``` + +### docs_pipeline +```json +{ + "input": { + "query": "Объясни цикл отправки уведомлений" + }, + "output": { + "answer_mode": "ready", + "prompt_name": "docs_explain_answer", + "llm_request": { + "prompt_name": "docs_explain_answer", + "log_context": "graph.project_qa.docs.answer", + "prompt_stats": { + "system_chars": 393, + "user_chars": 10805, + "tokens_in_estimate": 2800 + } + }, + "degraded_reason": "" + } +} +``` + +## Diagnostics +{ + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "SYSTEM_FLOW_EXPLAIN", + "layers_used": [ + "D4_WORKFLOW_INDEX", + "D5_RELATION_GRAPH", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "documents_found": 1, + "facts_found": 0, + "relations_found": 2, + "openapi_fields_extracted": 0, + "missing_required_fields": [], + "openapi_status": { + "has_path": false, + "has_method": false, + "has_request": false, + "has_response": false + }, + "prompt_used": "docs_explain_answer", + "llm_mode": "prose", + "output_valid": true, + "matched_intent_source": "deterministic", + "matched_anchor_type": "none", + "matched_anchor_value": null, + "exact_anchor_match": false, + "docs_layers_requested": [ + "D4_WORKFLOW_INDEX", + "D5_RELATION_GRAPH", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "docs_layers_with_hits": [ + "D4_WORKFLOW_INDEX", + "D5_RELATION_GRAPH", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "planned_layers": [ + "D4_WORKFLOW_INDEX", + "D5_RELATION_GRAPH", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "executed_layers": [ + "D4_WORKFLOW_INDEX", + "D5_RELATION_GRAPH", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "non_empty_layers": [ + "D4_WORKFLOW_INDEX", + "D5_RELATION_GRAPH", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "layer_diagnostics": { + "D4_WORKFLOW_INDEX": { + "hits": 3, + "top_ids": [ + "api.control_actions_endpoint", + "api.health_endpoint", + "api.send_message_endpoint" + ], + "top_sections": [ + "Scenario" + ] + }, + "D5_RELATION_GRAPH": { + "hits": 8, + "top_ids": [ + "5f4909bde905cd3d294ad307074a05e4ae4deefcafe6272cd2d0436e73acb8dd", + "711fb2edb82dd222deaba3c91768b18cbbd453009235823282813c6e867dc2c1", + "eec79f7a02b804337e791ef231784862ae26e0599eb20224790e9d4f085fa9c0", + "c718b1939621233295ccaf6e8203e7fd94f3dd1bfb88f10c51bc5e33d53a24aa", + "616f5cbf25da83cb51d8d0741a7fc351620c9ca2c6513fa2094b4aa476f0912a" + ], + "top_sections": [ + "api.control_actions_endpoint:part_of", + "api.control_actions_endpoint:related_api", + "api.control_actions_endpoint:related_logic", + "api.health_endpoint:parent", + "api.health_endpoint:part_of" + ] + }, + "D1_DOCUMENT_CATALOG": { + "hits": 4, + "top_ids": [ + "docs/README.md", + "api.control_actions_endpoint", + "api.health_endpoint", + "api.send_message_endpoint" + ], + "top_sections": [ + "Readme", + "HTTP API /actions/{action}", + "HTTP API /health", + "HTTP API /send" + ] + }, + "D0_DOC_CHUNKS": { + "hits": 4, + "top_ids": [ + "docs/README.md" + ], + "top_sections": [ + "docs/README.md:Структура", + "docs/README.md:Навигация", + "docs/README.md:Правила и шаблоны", + "docs/README.md:Project Docs" + ] + } + }, + "query_entity_candidates": [], + "resolved_entity_candidates": [], + "query_anchor_candidates": [], + "resolved_anchor_candidates": [ + "api.control_actions_endpoint", + "docs/documentation/api/control-actions-endpoint.md", + "api.health_endpoint", + "docs/documentation/api/health-endpoint.md", + "api.send_message_endpoint", + "docs/documentation/api/send-message-endpoint.md", + "docs/README.md" + ], + "anchor_candidates": [], + "selected_anchor": null, + "anchor_selection_reason": "", + "anchor_match_type": "", + "doc_ids": [ + "api.control_actions_endpoint", + "api.health_endpoint", + "api.send_message_endpoint", + "docs/README.md", + "api.actions_endpoint" + ], + "doc_paths": [ + "docs/documentation/api/control-actions-endpoint.md", + "docs/documentation/api/health-endpoint.md", + "docs/documentation/api/send-message-endpoint.md", + "docs/README.md" + ], + "doc_titles": [ + "Scenario", + "api.control_actions_endpoint:part_of", + "api.control_actions_endpoint:related_api", + "api.control_actions_endpoint:related_logic", + "api.health_endpoint:parent", + "api.health_endpoint:part_of", + "api.health_endpoint:depends_on", + "api.send_message_endpoint:parent", + "api.control_actions_endpoint:parent", + "Readme", + "HTTP API /actions/{action}", + "HTTP API /health", + "HTTP API /send", + "docs/README.md:Структура", + "docs/README.md:Навигация", + "docs/README.md:Правила и шаблоны", + "docs/README.md:Project Docs" + ], + "relation_hits_count": 2, + "relation_targets": [ + "api.control_actions_endpoint:part_of", + "api.control_actions_endpoint:related_api" + ], + "selected_doc_ids": [ + "docs/README.md", + "api.control_actions_endpoint", + "api.health_endpoint" + ], + "selected_fact_ids": [], + "selected_relation_ids": [ + "5f4909bde905cd3d294ad307074a05e4ae4deefcafe6272cd2d0436e73acb8dd", + "711fb2edb82dd222deaba3c91768b18cbbd453009235823282813c6e867dc2c1" + ], + "selected_chunk_ids": [ + "docs/README.md" + ], + "selected_entity_ids": [], + "selected_workflow_ids": [ + "f78b822d4366b10322fd4a35e347deae59d55ff4132951201f4df3d1653aec61", + "83a9287bd9ac1f709258078d0e16d326615b4af1b7d77b323ff050dfb97a3e41" + ], + "fallback_doc_hits_count": 3, + "fallback_used": false, + "fact_hits": 0, + "entity_hits": 0, + "evidence_summary": { + "documents": 1, + "facts": 0, + "entities": 0, + "workflows": 2, + "relations": 2, + "chunks": 2, + "selected_doc_ids": [ + "docs/README.md", + "api.control_actions_endpoint", + "api.health_endpoint" + ], + "selected_fact_ids": [], + "selected_relation_ids": [ + "5f4909bde905cd3d294ad307074a05e4ae4deefcafe6272cd2d0436e73acb8dd", + "711fb2edb82dd222deaba3c91768b18cbbd453009235823282813c6e867dc2c1" + ], + "selected_chunk_ids": [ + "docs/README.md" + ], + "entity_hits": 0, + "openapi_signals": { + "path_found": false, + "method_found": false, + "operation_semantics_found": false, + "request_payload_found": false, + "request_schema": false, + "request_fields_found": false, + "response_payload_found": false, + "response_schema": false, + "response_fields_found": false, + "status_codes": false, + "content_type_found": false, + "examples_found": false, + "payload_description": false + } + }, + "gate_decision": "allow", + "gate_decision_reason": "evidence_sufficient", + "gate_missing_requirements": [], + "gate_satisfied_requirements": [ + "retrieval_non_empty" + ], + "openapi_evidence": { + "path_found": false, + "method_found": false, + "operation_semantics_found": false, + "request_payload_found": false, + "request_schema": false, + "request_fields_found": false, + "response_payload_found": false, + "response_schema": false, + "response_fields_found": false, + "status_codes": false, + "content_type_found": false, + "examples_found": false, + "payload_description": false + }, + "requested_fragment_type": null, + "fragment_evidence_found": [], + "fragment_missing_requirements": [], + "answer_mode": "ready", + "degrade_reason": null, + "degraded_reason": null, + "code_intents_stubbed": false +} + +## LLM Request +- prompt_name: docs_explain_answer +- log_context: graph.project_qa.docs.answer + +### Prompt Stats +```json +{ + "system_chars": 393, + "user_chars": 10805, + "tokens_in_estimate": 2800 +} +``` + +### System Prompt +```text +Ты объясняешь документацию системы. + +На вход приходит JSON с полями: +- question +- intent +- sub_intent +- documents +- facts +- relations + +Правила: +- Используй только предоставленные факты +- Не додумывай +- Если данных недостаточно, скажи это явно +- Объясняй структурировано + +Формат ответа: +1. Краткое описание +2. Основные элементы +3. Как это работает +4. Связи с другими частями системы (если есть) +``` + +### User Prompt +```json +{ + "question": "Объясни цикл отправки уведомлений", + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "SYSTEM_FLOW_EXPLAIN", + "documents": [ + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/README.md", + "title": "Readme", + "content": "Readme", + "metadata": { + "name": "", + "tags": [], + "type": "", + "layer": "", + "links": [], + "owner": null, + "title": "Readme", + "doc_id": null, + "module": "", + "parent": null, + "status": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "81d952f1a6ea85b76f75e0e57f33b8fa4b2bf3cb7db11b91b90171aeedd655a6", + "children": [], + "doc_kind": "readme", + "entities": [], + "updated_at": null, + "doc_version": null, + "document_id": "docs/README.md", + "source_path": "docs/README.md", + "summary_text": "", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + } + ], + "facts": [], + "entities": [], + "workflows": [ + { + "layer": "D4_WORKFLOW_INDEX", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "Scenario", + "content": "Scenario\nHTTP control plane запущен.\n`ControlActionSet` сконфигурирован в `TelegramControlChannel`.\nВ path передано одно из поддерживаемых действий: `start`, `stop`, `status`.\nКлиент отправляет `GET` или `POST` на `/actions/{action}`.\n1. Endpoint принимает запрос и извлекает path parameter `action`.\n2. API определяет источник клиента через `X-Client-Source` или `User-Agent`.\n3. Для `start` и `stop` запрос логируется как control action.\n4. Канал сопоставляет `action` с callback из `ControlActionSet`.\n5. API ожидает завершения callback в пределах допустимого timeout.\n6. При успешном завершении API возвращает JSON со статусом `ok`.\n1. Если `start` или `stop` не успевают завершиться в timeout, API возвращает `202 accepted` и сообщает, что операция еще выполняется.", + "metadata": { + "owner": null, + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "trigger": [ + "Клиент отправляет `GET` или `POST` на `/actions/{action}`." + ], + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "main_flow": [ + "1. Endpoint принимает запрос и извлекает path parameter `action`.", + "2. API определяет источник клиента через `X-Client-Source` или `User-Agent`.", + "3. Для `start` и `stop` запрос логируется как control action.", + "4. Канал сопоставляет `action` с callback из `ControlActionSet`.", + "5. API ожидает завершения callback в пределах допустимого timeout.", + "6. При успешном завершении API возвращает JSON со статусом `ok`." + ], + "doc_version": null, + "document_id": "api.control_actions_endpoint", + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "workflow_id": "f78b822d4366b10322fd4a35e347deae59d55ff4132951201f4df3d1653aec61", + "artifact_type": null, + "last_modified": null, + "preconditions": [ + "HTTP control plane запущен.", + "`ControlActionSet` сконфигурирован в `TelegramControlChannel`.", + "В path передано одно из поддерживаемых действий: `start`, `stop`, `status`." + ], + "workflow_name": "Scenario", + "error_handling": [ + "1. Если actions не сконфигурированы, API возвращает `404`.", + "2. Если передано неподдерживаемое действие, API возвращает `404`.", + "3. Если callback завершился исключением, API возвращает `500`." + ], + "postconditions": [ + "Клиент получает результат выполнения control action или признак, что операция еще продолжается." + ], + "staleness_score": null, + "alternative_flow": [ + "1. Если `start` или `stop` не успевают завершиться в timeout, API возвращает `202 accepted` и сообщает, что операция еще выполняется." + ], + "system_component": null + } + }, + { + "layer": "D4_WORKFLOW_INDEX", + "path": "docs/documentation/api/health-endpoint.md", + "title": "Scenario", + "content": "Scenario\nHTTP control plane запущен.\n`TelegramControlChannel` зарегистрирован в runtime.\nКлиент отправляет `GET /health`.\n1. Endpoint принимает HTTP-запрос `GET /health`.\n2. API вызывает `health_provider` через `TelegramControlChannel`.\n3. Канал получает health payload от runtime.\n4. Endpoint определяет HTTP status code по полю `status` в payload.\n5. Endpoint возвращает payload клиенту в формате JSON.\n1. Если runtime вернул статус, отличный от `ok`, endpoint возвращает тот же payload c HTTP 503.", + "metadata": { + "owner": null, + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "trigger": [ + "Клиент отправляет `GET /health`." + ], + "blob_sha": "8b5a533a8076e2e9d36995eee29aeade260080bdca2ec8e21fe28f08574b983f", + "main_flow": [ + "1. Endpoint принимает HTTP-запрос `GET /health`.", + "2. API вызывает `health_provider` через `TelegramControlChannel`.", + "3. Канал получает health payload от runtime.", + "4. Endpoint определяет HTTP status code по полю `status` в payload.", + "5. Endpoint возвращает payload клиенту в формате JSON." + ], + "doc_version": null, + "document_id": "api.health_endpoint", + "source_path": "docs/documentation/api/health-endpoint.md", + "workflow_id": "83a9287bd9ac1f709258078d0e16d326615b4af1b7d77b323ff050dfb97a3e41", + "artifact_type": null, + "last_modified": null, + "preconditions": [ + "HTTP control plane запущен.", + "`TelegramControlChannel` зарегистрирован в runtime." + ], + "workflow_name": "Scenario", + "error_handling": [ + "1. Если provider завершился исключением, запрос завершается server-side ошибкой." + ], + "postconditions": [ + "Клиент получает актуальный health payload runtime." + ], + "staleness_score": null, + "alternative_flow": [ + "1. Если runtime вернул статус, отличный от `ok`, endpoint возвращает тот же payload c HTTP 503." + ], + "system_component": null + } + } + ], + "relations": [ + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "api.control_actions_endpoint:part_of", + "content": "api.control_actions_endpoint part_of architecture.telegram_notify_app", + "metadata": { + "owner": null, + "anchor": "frontmatter.links", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "source_id": "api.control_actions_endpoint", + "target_id": "architecture.telegram_notify_app", + "doc_version": null, + "relation_id": "5f4909bde905cd3d294ad307074a05e4ae4deefcafe6272cd2d0436e73acb8dd", + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "part_of", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "api.control_actions_endpoint:related_api", + "content": "api.control_actions_endpoint related_api api.health_endpoint", + "metadata": { + "owner": null, + "anchor": "frontmatter.links", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "source_id": "api.control_actions_endpoint", + "target_id": "api.health_endpoint", + "doc_version": null, + "relation_id": "711fb2edb82dd222deaba3c91768b18cbbd453009235823282813c6e867dc2c1", + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "related_api", + "staleness_score": null, + "system_component": null + } + } + ], + "chunks": [ + { + "layer": "D0_DOC_CHUNKS", + "path": "docs/README.md", + "title": "docs/README.md:Структура", + "content": "- `documentation/architecture/` — обзор архитектуры и ключевых компонентов.\n- `documentation/api/` — документация HTTP API control plane.\n- `documentation/logic/` — описание основных workflow и бизнес-логики.\n- `documentation/domain/` — описание ключевых сущностей и состояний.", + "metadata": { + "tags": [], + "type": null, + "order": 2, + "owner": null, + "doc_id": null, + "module": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "81d952f1a6ea85b76f75e0e57f33b8fa4b2bf3cb7db11b91b90171aeedd655a6", + "doc_kind": "readme", + "doc_version": null, + "document_id": "docs/README.md", + "source_path": "docs/README.md", + "section_path": "Project Docs > Структура", + "artifact_type": null, + "last_modified": null, + "section_title": "Структура", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D0_DOC_CHUNKS", + "path": "docs/README.md", + "title": "docs/README.md:Навигация", + "content": "- [Обзор архитектуры](./documentation/architecture/telegram-notify-app-overview.md)\n- [API: health](./documentation/api/health-endpoint.md)\n- [API: actions](./documentation/api/control-actions-endpoint.md)\n- [API: send](./documentation/api/send-message-endpoint.md)\n- [Logic: цикл отправки уведомлений](./documentation/logic/telegram-notification-loop.md)\n- [Domain: runtime health](./documentation/domain/runtime-health-entity.md)", + "metadata": { + "tags": [], + "type": null, + "order": 3, + "owner": null, + "doc_id": null, + "module": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "81d952f1a6ea85b76f75e0e57f33b8fa4b2bf3cb7db11b91b90171aeedd655a6", + "doc_kind": "readme", + "doc_version": null, + "document_id": "docs/README.md", + "source_path": "docs/README.md", + "section_path": "Project Docs > Навигация", + "artifact_type": null, + "last_modified": null, + "section_title": "Навигация", + "staleness_score": null, + "system_component": null + } + } + ] +} +``` + +### User Prompt Overview +- question: Объясни цикл отправки уведомлений +- intent: DOCUMENTATION_EXPLAIN +- sub_intent: SYSTEM_FLOW_EXPLAIN +- documents: 1 | samples: Readme +- facts: 0 +- relations: 2 | samples: api.control_actions_endpoint:part_of, api.control_actions_endpoint:related_api + +## Mismatches +- none \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/docs_router_llm_disambiguation/20260326_150139/full_chain_docs_intents_v3-3x_v3-system-flow-telegram-loop-2.json b/tests/pipeline_setup_v3/test_results/docs_router_llm_disambiguation/20260326_150139/full_chain_docs_intents_v3-3x_v3-system-flow-telegram-loop-2.json new file mode 100644 index 0000000..2507d94 --- /dev/null +++ b/tests/pipeline_setup_v3/test_results/docs_router_llm_disambiguation/20260326_150139/full_chain_docs_intents_v3-3x_v3-system-flow-telegram-loop-2.json @@ -0,0 +1,89 @@ +{ + "meta": { + "case_id": "v3-system-flow-telegram-loop-2", + "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_03_docs/full_chain_docs_intents_v3-3x.yaml", + "runner": "agent_runtime", + "mode": "pre_llm", + "passed": true, + "mismatches": [], + "actual": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "SYSTEM_FLOW_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START", + "rag_count": 14, + "llm_answer": "", + "answer_mode": "answered", + "path_scope": [], + "doc_scope": [ + "api.control_actions_endpoint", + "api.health_endpoint", + "api.send_message_endpoint", + "architecture.telegram_notify_app_overview", + "architecture.telegram_notify_app", + "logic.telegram_notification_loop", + "domain.runtime_health" + ], + "entity_candidates": [], + "symbol_candidates": [], + "layers": [ + "D4_WORKFLOW_INDEX", + "D5_RELATION_GRAPH", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "filters": { + "doc_type": null + }, + "pipeline_mode": "pre_llm_only", + "gate_decision": "allow", + "prompt_used": "docs_explain_answer", + "llm_mode": "prose", + "degraded_reason": null, + "code_intents_stubbed": true + } + }, + "pipeline_steps": [ + { + "step": "input_query", + "input": { + "query": "Как работает процесс отправки уведомлений в Telegram?" + }, + "output": { + "query": "Как работает процесс отправки уведомлений в Telegram?" + } + }, + { + "step": "router", + "input": { + "query": "Как работает процесс отправки уведомлений в Telegram?" + }, + "output": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "SYSTEM_FLOW_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START" + } + }, + { + "step": "docs_pipeline", + "input": { + "query": "Как работает процесс отправки уведомлений в Telegram?" + }, + "output": { + "answer_mode": "ready", + "prompt_name": "docs_explain_answer", + "llm_request": { + "prompt_name": "docs_explain_answer", + "log_context": "graph.project_qa.docs.answer", + "prompt_stats": { + "system_chars": 393, + "user_chars": 14240, + "tokens_in_estimate": 3659 + } + }, + "degraded_reason": "" + } + } + ] +} \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/docs_router_llm_disambiguation/20260326_150139/full_chain_docs_intents_v3-3x_v3-system-flow-telegram-loop-2.md b/tests/pipeline_setup_v3/test_results/docs_router_llm_disambiguation/20260326_150139/full_chain_docs_intents_v3-3x_v3-system-flow-telegram-loop-2.md new file mode 100644 index 0000000..3376111 --- /dev/null +++ b/tests/pipeline_setup_v3/test_results/docs_router_llm_disambiguation/20260326_150139/full_chain_docs_intents_v3-3x_v3-system-flow-telegram-loop-2.md @@ -0,0 +1,703 @@ +# v3-system-flow-telegram-loop-2 + +- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_03_docs/full_chain_docs_intents_v3-3x.yaml +- runner: agent_runtime +- mode: pre_llm +- passed: True + +## Query +Как работает процесс отправки уведомлений в Telegram? + +## Actual +{ + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "SYSTEM_FLOW_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START", + "rag_count": 14, + "llm_answer": "", + "answer_mode": "answered", + "path_scope": [], + "doc_scope": [ + "api.control_actions_endpoint", + "api.health_endpoint", + "api.send_message_endpoint", + "architecture.telegram_notify_app_overview", + "architecture.telegram_notify_app", + "logic.telegram_notification_loop", + "domain.runtime_health" + ], + "entity_candidates": [], + "symbol_candidates": [], + "layers": [ + "D4_WORKFLOW_INDEX", + "D5_RELATION_GRAPH", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "filters": { + "doc_type": null + }, + "pipeline_mode": "pre_llm_only", + "gate_decision": "allow", + "prompt_used": "docs_explain_answer", + "llm_mode": "prose", + "degraded_reason": null, + "code_intents_stubbed": true +} + +## Pipeline Steps +### input_query +```json +{ + "input": { + "query": "Как работает процесс отправки уведомлений в Telegram?" + }, + "output": { + "query": "Как работает процесс отправки уведомлений в Telegram?" + } +} +``` + +### router +```json +{ + "input": { + "query": "Как работает процесс отправки уведомлений в Telegram?" + }, + "output": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "SYSTEM_FLOW_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START" + } +} +``` + +### docs_pipeline +```json +{ + "input": { + "query": "Как работает процесс отправки уведомлений в Telegram?" + }, + "output": { + "answer_mode": "ready", + "prompt_name": "docs_explain_answer", + "llm_request": { + "prompt_name": "docs_explain_answer", + "log_context": "graph.project_qa.docs.answer", + "prompt_stats": { + "system_chars": 393, + "user_chars": 14240, + "tokens_in_estimate": 3659 + } + }, + "degraded_reason": "" + } +} +``` + +## Diagnostics +{ + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "SYSTEM_FLOW_EXPLAIN", + "layers_used": [ + "D4_WORKFLOW_INDEX", + "D5_RELATION_GRAPH", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "documents_found": 1, + "facts_found": 0, + "relations_found": 2, + "openapi_fields_extracted": 0, + "missing_required_fields": [], + "openapi_status": { + "has_path": false, + "has_method": false, + "has_request": false, + "has_response": false + }, + "prompt_used": "docs_explain_answer", + "llm_mode": "prose", + "output_valid": true, + "matched_intent_source": "deterministic", + "matched_anchor_type": "workflow", + "matched_anchor_value": "отправки", + "exact_anchor_match": false, + "docs_layers_requested": [ + "D4_WORKFLOW_INDEX", + "D5_RELATION_GRAPH", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "docs_layers_with_hits": [ + "D4_WORKFLOW_INDEX", + "D5_RELATION_GRAPH", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "planned_layers": [ + "D4_WORKFLOW_INDEX", + "D5_RELATION_GRAPH", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "executed_layers": [ + "D4_WORKFLOW_INDEX", + "D5_RELATION_GRAPH", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "non_empty_layers": [ + "D4_WORKFLOW_INDEX", + "D5_RELATION_GRAPH", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "layer_diagnostics": { + "D4_WORKFLOW_INDEX": { + "hits": 3, + "top_ids": [ + "api.control_actions_endpoint", + "api.health_endpoint", + "api.send_message_endpoint" + ], + "top_sections": [ + "Scenario" + ] + }, + "D5_RELATION_GRAPH": { + "hits": 8, + "top_ids": [ + "305bab0c6567d93a2b453a9d70b676f9ecd8de083ef36f5cf3398747c25ebf94", + "7bd0428d23e9b20f7d65202cc269e45b3d1e7aed7b5df4a35581fd88677be29b", + "0eb7f73fcda8556439e06f5eeb5ce064ae32b6cd3129353f5b1b4eb3db626d88", + "ae34fe4b3cd2b47632b13b1e32303e842b57948aa21160abe8d9b478995e1d74", + "145ccbb861a8fb621286ec9c888ce69677168d35c7871c70537e888ce3a5b910" + ], + "top_sections": [ + "architecture.telegram_notify_app:child", + "architecture.telegram_notify_app:related_api" + ] + }, + "D1_DOCUMENT_CATALOG": { + "hits": 4, + "top_ids": [ + "architecture.telegram_notify_app", + "logic.telegram_notification_loop", + "api.send_message_endpoint", + "domain.runtime_health" + ], + "top_sections": [ + "Архитектура Telegram Notify App", + "Цикл отправки уведомлений в Telegram", + "HTTP API /send", + "Сущность runtime health" + ] + }, + "D0_DOC_CHUNKS": { + "hits": 4, + "top_ids": [ + "architecture.telegram_notify_app", + "logic.telegram_notification_loop" + ], + "top_sections": [ + "architecture.telegram_notify_app:Details", + "logic.telegram_notification_loop:Summary", + "architecture.telegram_notify_app:Summary", + "logic.telegram_notification_loop:Details" + ] + } + }, + "query_entity_candidates": [], + "resolved_entity_candidates": [], + "query_anchor_candidates": [], + "resolved_anchor_candidates": [ + "api.control_actions_endpoint", + "docs/documentation/api/control-actions-endpoint.md", + "api.health_endpoint", + "docs/documentation/api/health-endpoint.md", + "api.send_message_endpoint", + "docs/documentation/api/send-message-endpoint.md", + "docs/documentation/architecture/telegram-notify-app-overview.md", + "architecture.telegram_notify_app", + "logic.telegram_notification_loop", + "docs/documentation/logic/telegram-notification-loop.md", + "domain.runtime_health", + "docs/documentation/domain/runtime-health-entity.md" + ], + "anchor_candidates": [], + "selected_anchor": null, + "anchor_selection_reason": "", + "anchor_match_type": "", + "doc_ids": [ + "api.control_actions_endpoint", + "api.health_endpoint", + "api.send_message_endpoint", + "architecture.telegram_notify_app_overview", + "architecture.telegram_notify_app", + "logic.telegram_notification_loop", + "domain.runtime_health" + ], + "doc_paths": [ + "docs/documentation/api/control-actions-endpoint.md", + "docs/documentation/api/health-endpoint.md", + "docs/documentation/api/send-message-endpoint.md", + "docs/documentation/architecture/telegram-notify-app-overview.md", + "docs/documentation/logic/telegram-notification-loop.md", + "docs/documentation/domain/runtime-health-entity.md" + ], + "doc_titles": [ + "Scenario", + "architecture.telegram_notify_app:child", + "architecture.telegram_notify_app:related_api", + "architecture.telegram_notify_app:parent", + "Архитектура Telegram Notify App", + "Цикл отправки уведомлений в Telegram", + "HTTP API /send", + "Сущность runtime health", + "architecture.telegram_notify_app:Details", + "logic.telegram_notification_loop:Summary", + "architecture.telegram_notify_app:Summary", + "logic.telegram_notification_loop:Details" + ], + "relation_hits_count": 2, + "relation_targets": [ + "architecture.telegram_notify_app:child", + "architecture.telegram_notify_app:related_api" + ], + "selected_doc_ids": [ + "architecture.telegram_notify_app", + "api.control_actions_endpoint", + "api.health_endpoint" + ], + "selected_fact_ids": [], + "selected_relation_ids": [ + "305bab0c6567d93a2b453a9d70b676f9ecd8de083ef36f5cf3398747c25ebf94", + "7bd0428d23e9b20f7d65202cc269e45b3d1e7aed7b5df4a35581fd88677be29b" + ], + "selected_chunk_ids": [ + "architecture.telegram_notify_app" + ], + "selected_entity_ids": [], + "selected_workflow_ids": [ + "f78b822d4366b10322fd4a35e347deae59d55ff4132951201f4df3d1653aec61", + "83a9287bd9ac1f709258078d0e16d326615b4af1b7d77b323ff050dfb97a3e41" + ], + "fallback_doc_hits_count": 3, + "fallback_used": false, + "fact_hits": 0, + "entity_hits": 0, + "evidence_summary": { + "documents": 1, + "facts": 0, + "entities": 0, + "workflows": 2, + "relations": 2, + "chunks": 2, + "selected_doc_ids": [ + "architecture.telegram_notify_app", + "api.control_actions_endpoint", + "api.health_endpoint" + ], + "selected_fact_ids": [], + "selected_relation_ids": [ + "305bab0c6567d93a2b453a9d70b676f9ecd8de083ef36f5cf3398747c25ebf94", + "7bd0428d23e9b20f7d65202cc269e45b3d1e7aed7b5df4a35581fd88677be29b" + ], + "selected_chunk_ids": [ + "architecture.telegram_notify_app" + ], + "entity_hits": 0, + "openapi_signals": { + "path_found": false, + "method_found": false, + "operation_semantics_found": false, + "request_payload_found": false, + "request_schema": false, + "request_fields_found": false, + "response_payload_found": false, + "response_schema": false, + "response_fields_found": false, + "status_codes": false, + "content_type_found": false, + "examples_found": false, + "payload_description": false + } + }, + "gate_decision": "allow", + "gate_decision_reason": "evidence_sufficient", + "gate_missing_requirements": [], + "gate_satisfied_requirements": [ + "retrieval_non_empty" + ], + "openapi_evidence": { + "path_found": false, + "method_found": false, + "operation_semantics_found": false, + "request_payload_found": false, + "request_schema": false, + "request_fields_found": false, + "response_payload_found": false, + "response_schema": false, + "response_fields_found": false, + "status_codes": false, + "content_type_found": false, + "examples_found": false, + "payload_description": false + }, + "requested_fragment_type": null, + "fragment_evidence_found": [], + "fragment_missing_requirements": [], + "answer_mode": "ready", + "degrade_reason": null, + "degraded_reason": null, + "code_intents_stubbed": false +} + +## LLM Request +- prompt_name: docs_explain_answer +- log_context: graph.project_qa.docs.answer + +### Prompt Stats +```json +{ + "system_chars": 393, + "user_chars": 14240, + "tokens_in_estimate": 3659 +} +``` + +### System Prompt +```text +Ты объясняешь документацию системы. + +На вход приходит JSON с полями: +- question +- intent +- sub_intent +- documents +- facts +- relations + +Правила: +- Используй только предоставленные факты +- Не додумывай +- Если данных недостаточно, скажи это явно +- Объясняй структурировано + +Формат ответа: +1. Краткое описание +2. Основные элементы +3. Как это работает +4. Связи с другими частями системы (если есть) +``` + +### User Prompt +```json +{ + "question": "Как работает процесс отправки уведомлений в Telegram?", + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "SYSTEM_FLOW_EXPLAIN", + "documents": [ + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/architecture/telegram-notify-app-overview.md", + "title": "Архитектура Telegram Notify App", + "content": "`test_echo_app` — сервис на базе PLBA runtime, который поднимает HTTP control plane и запускает фоновый воркер для периодической отправки уведомлений в Telegram. Приложение использует YAML-конфиг для runtime-настроек и переменные окружения для Telegram credentials. Основной контур системы состоит из runtime manager, control channel, send service и worker loop.", + "metadata": { + "name": "telegram_notify_app_overview", + "tags": [ + "architecture", + "telegram", + "plba", + "runtime" + ], + "type": "architecture_overview", + "layer": "system", + "links": [ + { + "type": "related_api", + "target": "api.health_endpoint" + }, + { + "type": "related_api", + "target": "api.control_actions_endpoint" + }, + { + "type": "related_api", + "target": "api.send_message_endpoint" + }, + { + "type": "depends_on", + "target": "logic.telegram_notification_loop" + }, + { + "type": "depends_on", + "target": "domain.runtime_health" + } + ], + "owner": null, + "title": "Архитектура Telegram Notify App", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "docs_root", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "8b1cc9f823e55bddbc825466d10a0fdb4ca4354ac02d91f9e2aef7b7d2ec8256", + "children": [ + "api.health_endpoint", + "api.control_actions_endpoint", + "api.send_message_endpoint", + "logic.telegram_notification_loop", + "domain.runtime_health" + ], + "doc_kind": "spec", + "entities": [ + "TelegramNotifyModule", + "TelegramNotifyWorker", + "TelegramControlChannel", + "TelegramSendService", + "RuntimeManager" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "architecture.telegram_notify_app", + "source_path": "docs/documentation/architecture/telegram-notify-app-overview.md", + "summary_text": "`test_echo_app` — сервис на базе PLBA runtime, который поднимает HTTP control plane и запускает фоновый воркер для периодической отправки уведомлений в Telegram. Приложение использует YAML-конфиг для runtime-настроек и переменные окружения для Telegram credentials. Основной контур системы состоит из runtime manager, control channel, send service и worker loop.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + } + ], + "facts": [], + "entities": [], + "workflows": [ + { + "layer": "D4_WORKFLOW_INDEX", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "Scenario", + "content": "Scenario\nHTTP control plane запущен.\n`ControlActionSet` сконфигурирован в `TelegramControlChannel`.\nВ path передано одно из поддерживаемых действий: `start`, `stop`, `status`.\nКлиент отправляет `GET` или `POST` на `/actions/{action}`.\n1. Endpoint принимает запрос и извлекает path parameter `action`.\n2. API определяет источник клиента через `X-Client-Source` или `User-Agent`.\n3. Для `start` и `stop` запрос логируется как control action.\n4. Канал сопоставляет `action` с callback из `ControlActionSet`.\n5. API ожидает завершения callback в пределах допустимого timeout.\n6. При успешном завершении API возвращает JSON со статусом `ok`.\n1. Если `start` или `stop` не успевают завершиться в timeout, API возвращает `202 accepted` и сообщает, что операция еще выполняется.", + "metadata": { + "owner": null, + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "trigger": [ + "Клиент отправляет `GET` или `POST` на `/actions/{action}`." + ], + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "main_flow": [ + "1. Endpoint принимает запрос и извлекает path parameter `action`.", + "2. API определяет источник клиента через `X-Client-Source` или `User-Agent`.", + "3. Для `start` и `stop` запрос логируется как control action.", + "4. Канал сопоставляет `action` с callback из `ControlActionSet`.", + "5. API ожидает завершения callback в пределах допустимого timeout.", + "6. При успешном завершении API возвращает JSON со статусом `ok`." + ], + "doc_version": null, + "document_id": "api.control_actions_endpoint", + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "workflow_id": "f78b822d4366b10322fd4a35e347deae59d55ff4132951201f4df3d1653aec61", + "artifact_type": null, + "last_modified": null, + "preconditions": [ + "HTTP control plane запущен.", + "`ControlActionSet` сконфигурирован в `TelegramControlChannel`.", + "В path передано одно из поддерживаемых действий: `start`, `stop`, `status`." + ], + "workflow_name": "Scenario", + "error_handling": [ + "1. Если actions не сконфигурированы, API возвращает `404`.", + "2. Если передано неподдерживаемое действие, API возвращает `404`.", + "3. Если callback завершился исключением, API возвращает `500`." + ], + "postconditions": [ + "Клиент получает результат выполнения control action или признак, что операция еще продолжается." + ], + "staleness_score": null, + "alternative_flow": [ + "1. Если `start` или `stop` не успевают завершиться в timeout, API возвращает `202 accepted` и сообщает, что операция еще выполняется." + ], + "system_component": null + } + }, + { + "layer": "D4_WORKFLOW_INDEX", + "path": "docs/documentation/api/health-endpoint.md", + "title": "Scenario", + "content": "Scenario\nHTTP control plane запущен.\n`TelegramControlChannel` зарегистрирован в runtime.\nКлиент отправляет `GET /health`.\n1. Endpoint принимает HTTP-запрос `GET /health`.\n2. API вызывает `health_provider` через `TelegramControlChannel`.\n3. Канал получает health payload от runtime.\n4. Endpoint определяет HTTP status code по полю `status` в payload.\n5. Endpoint возвращает payload клиенту в формате JSON.\n1. Если runtime вернул статус, отличный от `ok`, endpoint возвращает тот же payload c HTTP 503.", + "metadata": { + "owner": null, + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "trigger": [ + "Клиент отправляет `GET /health`." + ], + "blob_sha": "8b5a533a8076e2e9d36995eee29aeade260080bdca2ec8e21fe28f08574b983f", + "main_flow": [ + "1. Endpoint принимает HTTP-запрос `GET /health`.", + "2. API вызывает `health_provider` через `TelegramControlChannel`.", + "3. Канал получает health payload от runtime.", + "4. Endpoint определяет HTTP status code по полю `status` в payload.", + "5. Endpoint возвращает payload клиенту в формате JSON." + ], + "doc_version": null, + "document_id": "api.health_endpoint", + "source_path": "docs/documentation/api/health-endpoint.md", + "workflow_id": "83a9287bd9ac1f709258078d0e16d326615b4af1b7d77b323ff050dfb97a3e41", + "artifact_type": null, + "last_modified": null, + "preconditions": [ + "HTTP control plane запущен.", + "`TelegramControlChannel` зарегистрирован в runtime." + ], + "workflow_name": "Scenario", + "error_handling": [ + "1. Если provider завершился исключением, запрос завершается server-side ошибкой." + ], + "postconditions": [ + "Клиент получает актуальный health payload runtime." + ], + "staleness_score": null, + "alternative_flow": [ + "1. Если runtime вернул статус, отличный от `ok`, endpoint возвращает тот же payload c HTTP 503." + ], + "system_component": null + } + } + ], + "relations": [ + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/architecture/telegram-notify-app-overview.md", + "title": "architecture.telegram_notify_app:child", + "content": "architecture.telegram_notify_app child api.send_message_endpoint", + "metadata": { + "owner": null, + "anchor": "frontmatter.children", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "8b1cc9f823e55bddbc825466d10a0fdb4ca4354ac02d91f9e2aef7b7d2ec8256", + "source_id": "architecture.telegram_notify_app", + "target_id": "api.send_message_endpoint", + "doc_version": null, + "relation_id": "305bab0c6567d93a2b453a9d70b676f9ecd8de083ef36f5cf3398747c25ebf94", + "source_path": "docs/documentation/architecture/telegram-notify-app-overview.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "child", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/architecture/telegram-notify-app-overview.md", + "title": "architecture.telegram_notify_app:related_api", + "content": "architecture.telegram_notify_app related_api api.health_endpoint", + "metadata": { + "owner": null, + "anchor": "frontmatter.links", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "8b1cc9f823e55bddbc825466d10a0fdb4ca4354ac02d91f9e2aef7b7d2ec8256", + "source_id": "architecture.telegram_notify_app", + "target_id": "api.health_endpoint", + "doc_version": null, + "relation_id": "7bd0428d23e9b20f7d65202cc269e45b3d1e7aed7b5df4a35581fd88677be29b", + "source_path": "docs/documentation/architecture/telegram-notify-app-overview.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "related_api", + "staleness_score": null, + "system_component": null + } + } + ], + "chunks": [ + { + "layer": "D0_DOC_CHUNKS", + "path": "docs/documentation/architecture/telegram-notify-app-overview.md", + "title": "architecture.telegram_notify_app:Details", + "content": "Сервис стартует из `telegram_notify_app.main`, загружает `config/config.yaml` или путь из `CONFIG_PATH`, извлекает настройки control plane и интервал отправки, затем собирает runtime через `RuntimeManager`. В runtime регистрируются `TelegramControlChannel` и `TelegramNotifyModule`, который добавляет `TelegramNotifyWorker` и `TelegramSendService`.\n\n`TelegramControlChannel` поднимает FastAPI-приложение control plane и публикует endpoints `/health`, `/actions/{action}` и `/send`. Через эти endpoints внешний клиент получает состояние runtime, управляет lifecycle worker'а и инициирует ручную отправку сообщений.\n\n`TelegramNotifyWorker` работает в отдельном daemon thread. После старта он сразу делает первую попытку отправки сообщения, затем повторяет отправку через интервал `telegram.interval_seconds`. Если credentials отсутствуют или Telegram API возвращает ошибку, worker не переводит runtime в fatal state, а остается в рабочем цикле с деградированным статусом.\n\nHealth-модель сервиса строится вокруг компонента `telegram_notify`. Во внешнем health payload отражаются общее состояние runtime, время старта worker'а и количество успешных отправок. Детали HTTP API и worker workflow вынесены в дочерние документы.", + "metadata": { + "tags": [ + "architecture", + "telegram", + "plba", + "runtime" + ], + "type": "architecture_overview", + "order": 2, + "owner": null, + "doc_id": null, + "module": "telegram_notify_app", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "8b1cc9f823e55bddbc825466d10a0fdb4ca4354ac02d91f9e2aef7b7d2ec8256", + "doc_kind": "spec", + "doc_version": null, + "document_id": "architecture.telegram_notify_app", + "source_path": "docs/documentation/architecture/telegram-notify-app-overview.md", + "section_path": "Details", + "artifact_type": null, + "last_modified": null, + "section_title": "Details", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D0_DOC_CHUNKS", + "path": "docs/documentation/architecture/telegram-notify-app-overview.md", + "title": "architecture.telegram_notify_app:Summary", + "content": "`test_echo_app` — сервис на базе PLBA runtime, который поднимает HTTP control plane и запускает фоновый воркер для периодической отправки уведомлений в Telegram. Приложение использует YAML-конфиг для runtime-настроек и переменные окружения для Telegram credentials. Основной контур системы состоит из runtime manager, control channel, send service и worker loop.", + "metadata": { + "tags": [ + "architecture", + "telegram", + "plba", + "runtime" + ], + "type": "architecture_overview", + "order": 1, + "owner": null, + "doc_id": null, + "module": "telegram_notify_app", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "8b1cc9f823e55bddbc825466d10a0fdb4ca4354ac02d91f9e2aef7b7d2ec8256", + "doc_kind": "spec", + "doc_version": null, + "document_id": "architecture.telegram_notify_app", + "source_path": "docs/documentation/architecture/telegram-notify-app-overview.md", + "section_path": "Summary", + "artifact_type": null, + "last_modified": null, + "section_title": "Summary", + "staleness_score": null, + "system_component": null + } + } + ] +} +``` + +### User Prompt Overview +- question: Как работает процесс отправки уведомлений в Telegram? +- intent: DOCUMENTATION_EXPLAIN +- sub_intent: SYSTEM_FLOW_EXPLAIN +- documents: 1 | samples: Архитектура Telegram Notify App +- facts: 0 +- relations: 2 | samples: architecture.telegram_notify_app:child, architecture.telegram_notify_app:related_api + +## Mismatches +- none \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/docs_router_llm_disambiguation/20260326_150139/full_chain_docs_intents_v3-3x_v3-system-flow-telegram-loop-3.json b/tests/pipeline_setup_v3/test_results/docs_router_llm_disambiguation/20260326_150139/full_chain_docs_intents_v3-3x_v3-system-flow-telegram-loop-3.json new file mode 100644 index 0000000..7d61ebe --- /dev/null +++ b/tests/pipeline_setup_v3/test_results/docs_router_llm_disambiguation/20260326_150139/full_chain_docs_intents_v3-3x_v3-system-flow-telegram-loop-3.json @@ -0,0 +1,89 @@ +{ + "meta": { + "case_id": "v3-system-flow-telegram-loop-3", + "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_03_docs/full_chain_docs_intents_v3-3x.yaml", + "runner": "agent_runtime", + "mode": "pre_llm", + "passed": true, + "mismatches": [], + "actual": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "SYSTEM_FLOW_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START", + "rag_count": 14, + "llm_answer": "", + "answer_mode": "answered", + "path_scope": [], + "doc_scope": [ + "api.control_actions_endpoint", + "api.health_endpoint", + "api.send_message_endpoint", + "architecture.telegram_notify_app_overview", + "architecture.telegram_notify_app", + "logic.telegram_notification_loop", + "domain.runtime_health" + ], + "entity_candidates": [], + "symbol_candidates": [], + "layers": [ + "D4_WORKFLOW_INDEX", + "D5_RELATION_GRAPH", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "filters": { + "doc_type": null + }, + "pipeline_mode": "pre_llm_only", + "gate_decision": "allow", + "prompt_used": "docs_explain_answer", + "llm_mode": "prose", + "degraded_reason": null, + "code_intents_stubbed": true + } + }, + "pipeline_steps": [ + { + "step": "input_query", + "input": { + "query": "Опиши workflow Telegram уведомлений" + }, + "output": { + "query": "Опиши workflow Telegram уведомлений" + } + }, + { + "step": "router", + "input": { + "query": "Опиши workflow Telegram уведомлений" + }, + "output": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "SYSTEM_FLOW_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START" + } + }, + { + "step": "docs_pipeline", + "input": { + "query": "Опиши workflow Telegram уведомлений" + }, + "output": { + "answer_mode": "ready", + "prompt_name": "docs_explain_answer", + "llm_request": { + "prompt_name": "docs_explain_answer", + "log_context": "graph.project_qa.docs.answer", + "prompt_stats": { + "system_chars": 393, + "user_chars": 14222, + "tokens_in_estimate": 3654 + } + }, + "degraded_reason": "" + } + } + ] +} \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/docs_router_llm_disambiguation/20260326_150139/full_chain_docs_intents_v3-3x_v3-system-flow-telegram-loop-3.md b/tests/pipeline_setup_v3/test_results/docs_router_llm_disambiguation/20260326_150139/full_chain_docs_intents_v3-3x_v3-system-flow-telegram-loop-3.md new file mode 100644 index 0000000..f929010 --- /dev/null +++ b/tests/pipeline_setup_v3/test_results/docs_router_llm_disambiguation/20260326_150139/full_chain_docs_intents_v3-3x_v3-system-flow-telegram-loop-3.md @@ -0,0 +1,703 @@ +# v3-system-flow-telegram-loop-3 + +- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_03_docs/full_chain_docs_intents_v3-3x.yaml +- runner: agent_runtime +- mode: pre_llm +- passed: True + +## Query +Опиши workflow Telegram уведомлений + +## Actual +{ + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "SYSTEM_FLOW_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START", + "rag_count": 14, + "llm_answer": "", + "answer_mode": "answered", + "path_scope": [], + "doc_scope": [ + "api.control_actions_endpoint", + "api.health_endpoint", + "api.send_message_endpoint", + "architecture.telegram_notify_app_overview", + "architecture.telegram_notify_app", + "logic.telegram_notification_loop", + "domain.runtime_health" + ], + "entity_candidates": [], + "symbol_candidates": [], + "layers": [ + "D4_WORKFLOW_INDEX", + "D5_RELATION_GRAPH", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "filters": { + "doc_type": null + }, + "pipeline_mode": "pre_llm_only", + "gate_decision": "allow", + "prompt_used": "docs_explain_answer", + "llm_mode": "prose", + "degraded_reason": null, + "code_intents_stubbed": true +} + +## Pipeline Steps +### input_query +```json +{ + "input": { + "query": "Опиши workflow Telegram уведомлений" + }, + "output": { + "query": "Опиши workflow Telegram уведомлений" + } +} +``` + +### router +```json +{ + "input": { + "query": "Опиши workflow Telegram уведомлений" + }, + "output": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "SYSTEM_FLOW_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START" + } +} +``` + +### docs_pipeline +```json +{ + "input": { + "query": "Опиши workflow Telegram уведомлений" + }, + "output": { + "answer_mode": "ready", + "prompt_name": "docs_explain_answer", + "llm_request": { + "prompt_name": "docs_explain_answer", + "log_context": "graph.project_qa.docs.answer", + "prompt_stats": { + "system_chars": 393, + "user_chars": 14222, + "tokens_in_estimate": 3654 + } + }, + "degraded_reason": "" + } +} +``` + +## Diagnostics +{ + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "SYSTEM_FLOW_EXPLAIN", + "layers_used": [ + "D4_WORKFLOW_INDEX", + "D5_RELATION_GRAPH", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "documents_found": 1, + "facts_found": 0, + "relations_found": 2, + "openapi_fields_extracted": 0, + "missing_required_fields": [], + "openapi_status": { + "has_path": false, + "has_method": false, + "has_request": false, + "has_response": false + }, + "prompt_used": "docs_explain_answer", + "llm_mode": "prose", + "output_valid": true, + "matched_intent_source": "deterministic", + "matched_anchor_type": "workflow", + "matched_anchor_value": "Telegram", + "exact_anchor_match": false, + "docs_layers_requested": [ + "D4_WORKFLOW_INDEX", + "D5_RELATION_GRAPH", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "docs_layers_with_hits": [ + "D4_WORKFLOW_INDEX", + "D5_RELATION_GRAPH", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "planned_layers": [ + "D4_WORKFLOW_INDEX", + "D5_RELATION_GRAPH", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "executed_layers": [ + "D4_WORKFLOW_INDEX", + "D5_RELATION_GRAPH", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "non_empty_layers": [ + "D4_WORKFLOW_INDEX", + "D5_RELATION_GRAPH", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "layer_diagnostics": { + "D4_WORKFLOW_INDEX": { + "hits": 3, + "top_ids": [ + "api.control_actions_endpoint", + "api.health_endpoint", + "api.send_message_endpoint" + ], + "top_sections": [ + "Scenario" + ] + }, + "D5_RELATION_GRAPH": { + "hits": 8, + "top_ids": [ + "305bab0c6567d93a2b453a9d70b676f9ecd8de083ef36f5cf3398747c25ebf94", + "7bd0428d23e9b20f7d65202cc269e45b3d1e7aed7b5df4a35581fd88677be29b", + "0eb7f73fcda8556439e06f5eeb5ce064ae32b6cd3129353f5b1b4eb3db626d88", + "ae34fe4b3cd2b47632b13b1e32303e842b57948aa21160abe8d9b478995e1d74", + "145ccbb861a8fb621286ec9c888ce69677168d35c7871c70537e888ce3a5b910" + ], + "top_sections": [ + "architecture.telegram_notify_app:child", + "architecture.telegram_notify_app:related_api" + ] + }, + "D1_DOCUMENT_CATALOG": { + "hits": 4, + "top_ids": [ + "architecture.telegram_notify_app", + "logic.telegram_notification_loop", + "api.send_message_endpoint", + "domain.runtime_health" + ], + "top_sections": [ + "Архитектура Telegram Notify App", + "Цикл отправки уведомлений в Telegram", + "HTTP API /send", + "Сущность runtime health" + ] + }, + "D0_DOC_CHUNKS": { + "hits": 4, + "top_ids": [ + "architecture.telegram_notify_app", + "logic.telegram_notification_loop" + ], + "top_sections": [ + "architecture.telegram_notify_app:Details", + "logic.telegram_notification_loop:Summary", + "architecture.telegram_notify_app:Summary", + "logic.telegram_notification_loop:Details" + ] + } + }, + "query_entity_candidates": [], + "resolved_entity_candidates": [], + "query_anchor_candidates": [], + "resolved_anchor_candidates": [ + "api.control_actions_endpoint", + "docs/documentation/api/control-actions-endpoint.md", + "api.health_endpoint", + "docs/documentation/api/health-endpoint.md", + "api.send_message_endpoint", + "docs/documentation/api/send-message-endpoint.md", + "docs/documentation/architecture/telegram-notify-app-overview.md", + "architecture.telegram_notify_app", + "logic.telegram_notification_loop", + "docs/documentation/logic/telegram-notification-loop.md", + "domain.runtime_health", + "docs/documentation/domain/runtime-health-entity.md" + ], + "anchor_candidates": [], + "selected_anchor": null, + "anchor_selection_reason": "", + "anchor_match_type": "", + "doc_ids": [ + "api.control_actions_endpoint", + "api.health_endpoint", + "api.send_message_endpoint", + "architecture.telegram_notify_app_overview", + "architecture.telegram_notify_app", + "logic.telegram_notification_loop", + "domain.runtime_health" + ], + "doc_paths": [ + "docs/documentation/api/control-actions-endpoint.md", + "docs/documentation/api/health-endpoint.md", + "docs/documentation/api/send-message-endpoint.md", + "docs/documentation/architecture/telegram-notify-app-overview.md", + "docs/documentation/logic/telegram-notification-loop.md", + "docs/documentation/domain/runtime-health-entity.md" + ], + "doc_titles": [ + "Scenario", + "architecture.telegram_notify_app:child", + "architecture.telegram_notify_app:related_api", + "architecture.telegram_notify_app:parent", + "Архитектура Telegram Notify App", + "Цикл отправки уведомлений в Telegram", + "HTTP API /send", + "Сущность runtime health", + "architecture.telegram_notify_app:Details", + "logic.telegram_notification_loop:Summary", + "architecture.telegram_notify_app:Summary", + "logic.telegram_notification_loop:Details" + ], + "relation_hits_count": 2, + "relation_targets": [ + "architecture.telegram_notify_app:child", + "architecture.telegram_notify_app:related_api" + ], + "selected_doc_ids": [ + "architecture.telegram_notify_app", + "api.control_actions_endpoint", + "api.health_endpoint" + ], + "selected_fact_ids": [], + "selected_relation_ids": [ + "305bab0c6567d93a2b453a9d70b676f9ecd8de083ef36f5cf3398747c25ebf94", + "7bd0428d23e9b20f7d65202cc269e45b3d1e7aed7b5df4a35581fd88677be29b" + ], + "selected_chunk_ids": [ + "architecture.telegram_notify_app" + ], + "selected_entity_ids": [], + "selected_workflow_ids": [ + "f78b822d4366b10322fd4a35e347deae59d55ff4132951201f4df3d1653aec61", + "83a9287bd9ac1f709258078d0e16d326615b4af1b7d77b323ff050dfb97a3e41" + ], + "fallback_doc_hits_count": 3, + "fallback_used": false, + "fact_hits": 0, + "entity_hits": 0, + "evidence_summary": { + "documents": 1, + "facts": 0, + "entities": 0, + "workflows": 2, + "relations": 2, + "chunks": 2, + "selected_doc_ids": [ + "architecture.telegram_notify_app", + "api.control_actions_endpoint", + "api.health_endpoint" + ], + "selected_fact_ids": [], + "selected_relation_ids": [ + "305bab0c6567d93a2b453a9d70b676f9ecd8de083ef36f5cf3398747c25ebf94", + "7bd0428d23e9b20f7d65202cc269e45b3d1e7aed7b5df4a35581fd88677be29b" + ], + "selected_chunk_ids": [ + "architecture.telegram_notify_app" + ], + "entity_hits": 0, + "openapi_signals": { + "path_found": false, + "method_found": false, + "operation_semantics_found": false, + "request_payload_found": false, + "request_schema": false, + "request_fields_found": false, + "response_payload_found": false, + "response_schema": false, + "response_fields_found": false, + "status_codes": false, + "content_type_found": false, + "examples_found": false, + "payload_description": false + } + }, + "gate_decision": "allow", + "gate_decision_reason": "evidence_sufficient", + "gate_missing_requirements": [], + "gate_satisfied_requirements": [ + "retrieval_non_empty" + ], + "openapi_evidence": { + "path_found": false, + "method_found": false, + "operation_semantics_found": false, + "request_payload_found": false, + "request_schema": false, + "request_fields_found": false, + "response_payload_found": false, + "response_schema": false, + "response_fields_found": false, + "status_codes": false, + "content_type_found": false, + "examples_found": false, + "payload_description": false + }, + "requested_fragment_type": null, + "fragment_evidence_found": [], + "fragment_missing_requirements": [], + "answer_mode": "ready", + "degrade_reason": null, + "degraded_reason": null, + "code_intents_stubbed": false +} + +## LLM Request +- prompt_name: docs_explain_answer +- log_context: graph.project_qa.docs.answer + +### Prompt Stats +```json +{ + "system_chars": 393, + "user_chars": 14222, + "tokens_in_estimate": 3654 +} +``` + +### System Prompt +```text +Ты объясняешь документацию системы. + +На вход приходит JSON с полями: +- question +- intent +- sub_intent +- documents +- facts +- relations + +Правила: +- Используй только предоставленные факты +- Не додумывай +- Если данных недостаточно, скажи это явно +- Объясняй структурировано + +Формат ответа: +1. Краткое описание +2. Основные элементы +3. Как это работает +4. Связи с другими частями системы (если есть) +``` + +### User Prompt +```json +{ + "question": "Опиши workflow Telegram уведомлений", + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "SYSTEM_FLOW_EXPLAIN", + "documents": [ + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/architecture/telegram-notify-app-overview.md", + "title": "Архитектура Telegram Notify App", + "content": "`test_echo_app` — сервис на базе PLBA runtime, который поднимает HTTP control plane и запускает фоновый воркер для периодической отправки уведомлений в Telegram. Приложение использует YAML-конфиг для runtime-настроек и переменные окружения для Telegram credentials. Основной контур системы состоит из runtime manager, control channel, send service и worker loop.", + "metadata": { + "name": "telegram_notify_app_overview", + "tags": [ + "architecture", + "telegram", + "plba", + "runtime" + ], + "type": "architecture_overview", + "layer": "system", + "links": [ + { + "type": "related_api", + "target": "api.health_endpoint" + }, + { + "type": "related_api", + "target": "api.control_actions_endpoint" + }, + { + "type": "related_api", + "target": "api.send_message_endpoint" + }, + { + "type": "depends_on", + "target": "logic.telegram_notification_loop" + }, + { + "type": "depends_on", + "target": "domain.runtime_health" + } + ], + "owner": null, + "title": "Архитектура Telegram Notify App", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "docs_root", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "8b1cc9f823e55bddbc825466d10a0fdb4ca4354ac02d91f9e2aef7b7d2ec8256", + "children": [ + "api.health_endpoint", + "api.control_actions_endpoint", + "api.send_message_endpoint", + "logic.telegram_notification_loop", + "domain.runtime_health" + ], + "doc_kind": "spec", + "entities": [ + "TelegramNotifyModule", + "TelegramNotifyWorker", + "TelegramControlChannel", + "TelegramSendService", + "RuntimeManager" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "architecture.telegram_notify_app", + "source_path": "docs/documentation/architecture/telegram-notify-app-overview.md", + "summary_text": "`test_echo_app` — сервис на базе PLBA runtime, который поднимает HTTP control plane и запускает фоновый воркер для периодической отправки уведомлений в Telegram. Приложение использует YAML-конфиг для runtime-настроек и переменные окружения для Telegram credentials. Основной контур системы состоит из runtime manager, control channel, send service и worker loop.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + } + ], + "facts": [], + "entities": [], + "workflows": [ + { + "layer": "D4_WORKFLOW_INDEX", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "Scenario", + "content": "Scenario\nHTTP control plane запущен.\n`ControlActionSet` сконфигурирован в `TelegramControlChannel`.\nВ path передано одно из поддерживаемых действий: `start`, `stop`, `status`.\nКлиент отправляет `GET` или `POST` на `/actions/{action}`.\n1. Endpoint принимает запрос и извлекает path parameter `action`.\n2. API определяет источник клиента через `X-Client-Source` или `User-Agent`.\n3. Для `start` и `stop` запрос логируется как control action.\n4. Канал сопоставляет `action` с callback из `ControlActionSet`.\n5. API ожидает завершения callback в пределах допустимого timeout.\n6. При успешном завершении API возвращает JSON со статусом `ok`.\n1. Если `start` или `stop` не успевают завершиться в timeout, API возвращает `202 accepted` и сообщает, что операция еще выполняется.", + "metadata": { + "owner": null, + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "trigger": [ + "Клиент отправляет `GET` или `POST` на `/actions/{action}`." + ], + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "main_flow": [ + "1. Endpoint принимает запрос и извлекает path parameter `action`.", + "2. API определяет источник клиента через `X-Client-Source` или `User-Agent`.", + "3. Для `start` и `stop` запрос логируется как control action.", + "4. Канал сопоставляет `action` с callback из `ControlActionSet`.", + "5. API ожидает завершения callback в пределах допустимого timeout.", + "6. При успешном завершении API возвращает JSON со статусом `ok`." + ], + "doc_version": null, + "document_id": "api.control_actions_endpoint", + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "workflow_id": "f78b822d4366b10322fd4a35e347deae59d55ff4132951201f4df3d1653aec61", + "artifact_type": null, + "last_modified": null, + "preconditions": [ + "HTTP control plane запущен.", + "`ControlActionSet` сконфигурирован в `TelegramControlChannel`.", + "В path передано одно из поддерживаемых действий: `start`, `stop`, `status`." + ], + "workflow_name": "Scenario", + "error_handling": [ + "1. Если actions не сконфигурированы, API возвращает `404`.", + "2. Если передано неподдерживаемое действие, API возвращает `404`.", + "3. Если callback завершился исключением, API возвращает `500`." + ], + "postconditions": [ + "Клиент получает результат выполнения control action или признак, что операция еще продолжается." + ], + "staleness_score": null, + "alternative_flow": [ + "1. Если `start` или `stop` не успевают завершиться в timeout, API возвращает `202 accepted` и сообщает, что операция еще выполняется." + ], + "system_component": null + } + }, + { + "layer": "D4_WORKFLOW_INDEX", + "path": "docs/documentation/api/health-endpoint.md", + "title": "Scenario", + "content": "Scenario\nHTTP control plane запущен.\n`TelegramControlChannel` зарегистрирован в runtime.\nКлиент отправляет `GET /health`.\n1. Endpoint принимает HTTP-запрос `GET /health`.\n2. API вызывает `health_provider` через `TelegramControlChannel`.\n3. Канал получает health payload от runtime.\n4. Endpoint определяет HTTP status code по полю `status` в payload.\n5. Endpoint возвращает payload клиенту в формате JSON.\n1. Если runtime вернул статус, отличный от `ok`, endpoint возвращает тот же payload c HTTP 503.", + "metadata": { + "owner": null, + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "trigger": [ + "Клиент отправляет `GET /health`." + ], + "blob_sha": "8b5a533a8076e2e9d36995eee29aeade260080bdca2ec8e21fe28f08574b983f", + "main_flow": [ + "1. Endpoint принимает HTTP-запрос `GET /health`.", + "2. API вызывает `health_provider` через `TelegramControlChannel`.", + "3. Канал получает health payload от runtime.", + "4. Endpoint определяет HTTP status code по полю `status` в payload.", + "5. Endpoint возвращает payload клиенту в формате JSON." + ], + "doc_version": null, + "document_id": "api.health_endpoint", + "source_path": "docs/documentation/api/health-endpoint.md", + "workflow_id": "83a9287bd9ac1f709258078d0e16d326615b4af1b7d77b323ff050dfb97a3e41", + "artifact_type": null, + "last_modified": null, + "preconditions": [ + "HTTP control plane запущен.", + "`TelegramControlChannel` зарегистрирован в runtime." + ], + "workflow_name": "Scenario", + "error_handling": [ + "1. Если provider завершился исключением, запрос завершается server-side ошибкой." + ], + "postconditions": [ + "Клиент получает актуальный health payload runtime." + ], + "staleness_score": null, + "alternative_flow": [ + "1. Если runtime вернул статус, отличный от `ok`, endpoint возвращает тот же payload c HTTP 503." + ], + "system_component": null + } + } + ], + "relations": [ + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/architecture/telegram-notify-app-overview.md", + "title": "architecture.telegram_notify_app:child", + "content": "architecture.telegram_notify_app child api.send_message_endpoint", + "metadata": { + "owner": null, + "anchor": "frontmatter.children", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "8b1cc9f823e55bddbc825466d10a0fdb4ca4354ac02d91f9e2aef7b7d2ec8256", + "source_id": "architecture.telegram_notify_app", + "target_id": "api.send_message_endpoint", + "doc_version": null, + "relation_id": "305bab0c6567d93a2b453a9d70b676f9ecd8de083ef36f5cf3398747c25ebf94", + "source_path": "docs/documentation/architecture/telegram-notify-app-overview.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "child", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/architecture/telegram-notify-app-overview.md", + "title": "architecture.telegram_notify_app:related_api", + "content": "architecture.telegram_notify_app related_api api.health_endpoint", + "metadata": { + "owner": null, + "anchor": "frontmatter.links", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "8b1cc9f823e55bddbc825466d10a0fdb4ca4354ac02d91f9e2aef7b7d2ec8256", + "source_id": "architecture.telegram_notify_app", + "target_id": "api.health_endpoint", + "doc_version": null, + "relation_id": "7bd0428d23e9b20f7d65202cc269e45b3d1e7aed7b5df4a35581fd88677be29b", + "source_path": "docs/documentation/architecture/telegram-notify-app-overview.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "related_api", + "staleness_score": null, + "system_component": null + } + } + ], + "chunks": [ + { + "layer": "D0_DOC_CHUNKS", + "path": "docs/documentation/architecture/telegram-notify-app-overview.md", + "title": "architecture.telegram_notify_app:Details", + "content": "Сервис стартует из `telegram_notify_app.main`, загружает `config/config.yaml` или путь из `CONFIG_PATH`, извлекает настройки control plane и интервал отправки, затем собирает runtime через `RuntimeManager`. В runtime регистрируются `TelegramControlChannel` и `TelegramNotifyModule`, который добавляет `TelegramNotifyWorker` и `TelegramSendService`.\n\n`TelegramControlChannel` поднимает FastAPI-приложение control plane и публикует endpoints `/health`, `/actions/{action}` и `/send`. Через эти endpoints внешний клиент получает состояние runtime, управляет lifecycle worker'а и инициирует ручную отправку сообщений.\n\n`TelegramNotifyWorker` работает в отдельном daemon thread. После старта он сразу делает первую попытку отправки сообщения, затем повторяет отправку через интервал `telegram.interval_seconds`. Если credentials отсутствуют или Telegram API возвращает ошибку, worker не переводит runtime в fatal state, а остается в рабочем цикле с деградированным статусом.\n\nHealth-модель сервиса строится вокруг компонента `telegram_notify`. Во внешнем health payload отражаются общее состояние runtime, время старта worker'а и количество успешных отправок. Детали HTTP API и worker workflow вынесены в дочерние документы.", + "metadata": { + "tags": [ + "architecture", + "telegram", + "plba", + "runtime" + ], + "type": "architecture_overview", + "order": 2, + "owner": null, + "doc_id": null, + "module": "telegram_notify_app", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "8b1cc9f823e55bddbc825466d10a0fdb4ca4354ac02d91f9e2aef7b7d2ec8256", + "doc_kind": "spec", + "doc_version": null, + "document_id": "architecture.telegram_notify_app", + "source_path": "docs/documentation/architecture/telegram-notify-app-overview.md", + "section_path": "Details", + "artifact_type": null, + "last_modified": null, + "section_title": "Details", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D0_DOC_CHUNKS", + "path": "docs/documentation/architecture/telegram-notify-app-overview.md", + "title": "architecture.telegram_notify_app:Summary", + "content": "`test_echo_app` — сервис на базе PLBA runtime, который поднимает HTTP control plane и запускает фоновый воркер для периодической отправки уведомлений в Telegram. Приложение использует YAML-конфиг для runtime-настроек и переменные окружения для Telegram credentials. Основной контур системы состоит из runtime manager, control channel, send service и worker loop.", + "metadata": { + "tags": [ + "architecture", + "telegram", + "plba", + "runtime" + ], + "type": "architecture_overview", + "order": 1, + "owner": null, + "doc_id": null, + "module": "telegram_notify_app", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "8b1cc9f823e55bddbc825466d10a0fdb4ca4354ac02d91f9e2aef7b7d2ec8256", + "doc_kind": "spec", + "doc_version": null, + "document_id": "architecture.telegram_notify_app", + "source_path": "docs/documentation/architecture/telegram-notify-app-overview.md", + "section_path": "Summary", + "artifact_type": null, + "last_modified": null, + "section_title": "Summary", + "staleness_score": null, + "system_component": null + } + } + ] +} +``` + +### User Prompt Overview +- question: Опиши workflow Telegram уведомлений +- intent: DOCUMENTATION_EXPLAIN +- sub_intent: SYSTEM_FLOW_EXPLAIN +- documents: 1 | samples: Архитектура Telegram Notify App +- facts: 0 +- relations: 2 | samples: architecture.telegram_notify_app:child, architecture.telegram_notify_app:related_api + +## Mismatches +- none \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/docs_router_llm_disambiguation/20260326_150139/summary.md b/tests/pipeline_setup_v3/test_results/docs_router_llm_disambiguation/20260326_150139/summary.md new file mode 100644 index 0000000..896d4f7 --- /dev/null +++ b/tests/pipeline_setup_v3/test_results/docs_router_llm_disambiguation/20260326_150139/summary.md @@ -0,0 +1,36 @@ +# pipeline_setup_v3 summary + +Passed: 30/30 + +| File | Case | Mode | Query | Actual sub-intent | RAG layers | Tokens | Pass | +|------|------|------|-------|-------------------|------------|--------|------| +| full_chain_docs_intents_v3-3x.yaml | v3-system-flow-telegram-loop-1 | pre_llm | Объясни цикл отправки уведомлений | SYSTEM_FLOW_EXPLAIN | D0_DOC_CHUNKS:4, D1_DOCUMENT_CATALOG:4, D4_WORKFLOW_INDEX:3, D5_RELATION_GRAPH:8 | 2800 | ✓ | +| full_chain_docs_intents_v3-3x.yaml | v3-system-flow-telegram-loop-2 | pre_llm | Как работает процесс отправки уведомлений в Telegram? | SYSTEM_FLOW_EXPLAIN | D0_DOC_CHUNKS:4, D1_DOCUMENT_CATALOG:4, D4_WORKFLOW_INDEX:3, D5_RELATION_GRAPH:3 | 3659 | ✓ | +| full_chain_docs_intents_v3-3x.yaml | v3-system-flow-telegram-loop-3 | pre_llm | Опиши workflow Telegram уведомлений | SYSTEM_FLOW_EXPLAIN | D0_DOC_CHUNKS:4, D1_DOCUMENT_CATALOG:4, D4_WORKFLOW_INDEX:3, D5_RELATION_GRAPH:3 | 3654 | ✓ | +| full_chain_docs_intents_v3-3x.yaml | v3-system-flow-health-1 | pre_llm | Как работает health check runtime? | SYSTEM_FLOW_EXPLAIN | D0_DOC_CHUNKS:4, D1_DOCUMENT_CATALOG:4, D4_WORKFLOW_INDEX:3, D5_RELATION_GRAPH:8 | 3307 | ✓ | +| full_chain_docs_intents_v3-3x.yaml | v3-system-flow-health-2 | pre_llm | Как происходит проверка состояния runtime? | SYSTEM_FLOW_EXPLAIN | D0_DOC_CHUNKS:4, D1_DOCUMENT_CATALOG:4, D4_WORKFLOW_INDEX:3, D5_RELATION_GRAPH:8 | 3366 | ✓ | +| full_chain_docs_intents_v3-3x.yaml | v3-component-runtime-manager-1 | pre_llm | Что делает RuntimeManager? | COMPONENT_EXPLAIN | D0_DOC_CHUNKS:4, D1_DOCUMENT_CATALOG:4, D2_FACT_INDEX:2, D5_RELATION_GRAPH:8 | 2609 | ✓ | +| full_chain_docs_intents_v3-3x.yaml | v3-component-runtime-manager-2 | pre_llm | Как устроен RuntimeManager? | COMPONENT_EXPLAIN | D0_DOC_CHUNKS:4, D1_DOCUMENT_CATALOG:4, D2_FACT_INDEX:2, D5_RELATION_GRAPH:8 | 2610 | ✓ | +| full_chain_docs_intents_v3-3x.yaml | v3-component-runtime-manager-3 | pre_llm | Опиши компонент RuntimeManager | COMPONENT_EXPLAIN | D0_DOC_CHUNKS:4, D1_DOCUMENT_CATALOG:4, D2_FACT_INDEX:2, D5_RELATION_GRAPH:8 | 2610 | ✓ | +| full_chain_docs_intents_v3-3x.yaml | v3-component-control-channel-1 | pre_llm | Как работает TelegramControlChannel? | COMPONENT_EXPLAIN | D0_DOC_CHUNKS:4, D1_DOCUMENT_CATALOG:4, D2_FACT_INDEX:2, D5_RELATION_GRAPH:8 | 2612 | ✓ | +| full_chain_docs_intents_v3-3x.yaml | v3-component-control-channel-2 | pre_llm | Роль TelegramControlChannel в системе | COMPONENT_EXPLAIN | D0_DOC_CHUNKS:4, D1_DOCUMENT_CATALOG:4, D2_FACT_INDEX:2, D5_RELATION_GRAPH:8 | 2612 | ✓ | +| full_chain_docs_intents_v3-3x.yaml | v3-api-health-1 | pre_llm | Что делает /health? | API_METHOD_EXPLAIN | D0_DOC_CHUNKS:4, D1_DOCUMENT_CATALOG:1, D2_FACT_INDEX:2, D4_WORKFLOW_INDEX:1 | 2469 | ✓ | +| full_chain_docs_intents_v3-3x.yaml | v3-api-health-2 | pre_llm | Как работает health endpoint? | API_METHOD_EXPLAIN | D0_DOC_CHUNKS:4, D1_DOCUMENT_CATALOG:4, D2_FACT_INDEX:2, D4_WORKFLOW_INDEX:3 | 2846 | ✓ | +| full_chain_docs_intents_v3-3x.yaml | v3-api-health-3 | pre_llm | Опиши endpoint health | API_METHOD_EXPLAIN | D0_DOC_CHUNKS:4, D1_DOCUMENT_CATALOG:4, D2_FACT_INDEX:2, D4_WORKFLOW_INDEX:3 | 2844 | ✓ | +| full_chain_docs_intents_v3-3x.yaml | v3-api-send-1 | pre_llm | Что делает /send? | API_METHOD_EXPLAIN | D0_DOC_CHUNKS:4, D1_DOCUMENT_CATALOG:1, D2_FACT_INDEX:2, D4_WORKFLOW_INDEX:1 | 2680 | ✓ | +| full_chain_docs_intents_v3-3x.yaml | v3-api-send-2 | pre_llm | Как работает send endpoint? | API_METHOD_EXPLAIN | D0_DOC_CHUNKS:4, D1_DOCUMENT_CATALOG:4, D2_FACT_INDEX:2, D4_WORKFLOW_INDEX:3 | 2848 | ✓ | +| full_chain_docs_intents_v3-3x.yaml | v3-api-send-3 | pre_llm | Опиши endpoint отправки сообщений | API_METHOD_EXPLAIN | D0_DOC_CHUNKS:4, D1_DOCUMENT_CATALOG:4, D2_FACT_INDEX:2, D4_WORKFLOW_INDEX:3 | 2849 | ✓ | +| full_chain_docs_intents_v3-3x.yaml | v3-entity-runtime-health-1 | pre_llm | Что такое runtime health? | ENTITY_EXPLAIN | D0_DOC_CHUNKS:4, D1_DOCUMENT_CATALOG:4, D3_ENTITY_CATALOG:8, D5_RELATION_GRAPH:8 | 1992 | ✓ | +| full_chain_docs_intents_v3-3x.yaml | v3-entity-runtime-health-2 | pre_llm | Объясни runtime health | ENTITY_EXPLAIN | D0_DOC_CHUNKS:4, D1_DOCUMENT_CATALOG:4, D3_ENTITY_CATALOG:8, D5_RELATION_GRAPH:8 | 1991 | ✓ | +| full_chain_docs_intents_v3-3x.yaml | v3-entity-worker-status-1 | pre_llm | Что такое WorkerStatus? | ENTITY_EXPLAIN | D0_DOC_CHUNKS:4, D1_DOCUMENT_CATALOG:4, D3_ENTITY_CATALOG:8, D5_RELATION_GRAPH:8 | 1856 | ✓ | +| full_chain_docs_intents_v3-3x.yaml | v3-entity-worker-status-2 | pre_llm | Опиши статус воркера | ENTITY_EXPLAIN | D0_DOC_CHUNKS:4, D1_DOCUMENT_CATALOG:4, D3_ENTITY_CATALOG:8, D5_RELATION_GRAPH:8 | 1612 | ✓ | +| full_chain_docs_intents_v3-3x.yaml | v3-related-health-1 | pre_llm | Что связано с /health? | RELATED_DOCS_EXPLAIN | D0_DOC_CHUNKS:6, D5_RELATION_GRAPH:8 | 1443 | ✓ | +| full_chain_docs_intents_v3-3x.yaml | v3-related-health-2 | pre_llm | Какие документы относятся к health endpoint? | RELATED_DOCS_EXPLAIN | D0_DOC_CHUNKS:6, D5_RELATION_GRAPH:8 | 1467 | ✓ | +| full_chain_docs_intents_v3-3x.yaml | v3-related-send-1 | pre_llm | Какие документы связаны с /send? | RELATED_DOCS_EXPLAIN | D0_DOC_CHUNKS:6, D5_RELATION_GRAPH:8 | 1460 | ✓ | +| full_chain_docs_intents_v3-3x.yaml | v3-related-architecture-1 | pre_llm | Какие документы связаны с архитектурой? | RELATED_DOCS_EXPLAIN | D0_DOC_CHUNKS:6, D5_RELATION_GRAPH:8 | 1466 | ✓ | +| full_chain_docs_intents_v3-3x.yaml | v3-general-1 | pre_llm | Что есть в документации? | GENERIC_QA | D0_DOC_CHUNKS:4, D1_DOCUMENT_CATALOG:4, D2_FACT_INDEX:1, D5_RELATION_GRAPH:8 | 1225 | ✓ | +| full_chain_docs_intents_v3-3x.yaml | v3-general-2 | pre_llm | Какая структура документации? | GENERIC_QA | D0_DOC_CHUNKS:4, D1_DOCUMENT_CATALOG:4 | 1212 | ✓ | +| full_chain_docs_intents_v3-3x.yaml | v3-general-3 | pre_llm | С чего начать читать документацию? | GENERIC_QA | D0_DOC_CHUNKS:4, D1_DOCUMENT_CATALOG:4 | 1213 | ✓ | +| full_chain_docs_intents_v3-3x.yaml | v3-negative-1 | pre_llm | Что такое PaymentTransaction? | ENTITY_EXPLAIN | D0_DOC_CHUNKS:4, D1_DOCUMENT_CATALOG:4, D3_ENTITY_CATALOG:8, D5_RELATION_GRAPH:8 | 1614 | ✓ | +| full_chain_docs_intents_v3-3x.yaml | v3-negative-2 | pre_llm | Объясни сущность UnknownEntity | ENTITY_EXPLAIN | — | 155 | ✓ | +| full_chain_docs_intents_v3-3x.yaml | v3-negative-3 | pre_llm | Что делает endpoint /unknown? | API_METHOD_EXPLAIN | — | 156 | ✓ | \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/docs_router_llm_disambiguation/20260326_150213/full_chain_docs_intents_v4-llm_v4-api.json b/tests/pipeline_setup_v3/test_results/docs_router_llm_disambiguation/20260326_150213/full_chain_docs_intents_v4-llm_v4-api.json new file mode 100644 index 0000000..0986b00 --- /dev/null +++ b/tests/pipeline_setup_v3/test_results/docs_router_llm_disambiguation/20260326_150213/full_chain_docs_intents_v4-llm_v4-api.json @@ -0,0 +1,83 @@ +{ + "meta": { + "case_id": "v4-api", + "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_03_docs/full_chain_docs_intents_v4-llm.yaml", + "runner": "agent_runtime", + "mode": "full_chain", + "passed": true, + "mismatches": [], + "actual": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "API_METHOD_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START", + "rag_count": 2, + "llm_answer": "### Краткое описание\nEndpoint `/health` предназначен для предоставления агрегированного health payload'а текущего состояния runtime. В зависимости от общего статуса он возвращает соответствующий HTTP код и payload: если статус равен `\"ok\"`, возвращается HTTP 200, иначе – HTTP 503 с подробностями о состоянии деградации или неготовности.\n\n### Основные элементы\n- **Метод:** GET `/health`\n- **Ответы:**\n - HTTP 200 при общем статусе `\"ok\"`\n - HTTP 503 при любом другом статусе\n- **Payload:** Агрегированное состояние здоровья runtime\n\n### Как это работает\n1. Клиент отправляет HTTP-запрос типа GET на `/health`.\n2. API обращается к провайдеру здоровья (`health_provider`) через зарегистрированный канал (`TelegramControlChannel`), чтобы получить текущее состояние здоровья runtime.\n3. Полученный health payload анализируется, определяется статус (\"ok\" или другой).\n4. На основе поля `status` формируется HTTP ответ с соответствующим статусом и самим payload'ом.\n\n### Связи с другими частями системы\n- **Зависит от:** domain.runtime_health (предоставление информации о здоровье)\n- **Является частью:** architecture.telegram_notify_app (контрольная точка состояния приложения)", + "answer_mode": "answered", + "path_scope": [], + "doc_scope": [ + "api.health_endpoint" + ], + "entity_candidates": [], + "symbol_candidates": [], + "layers": [ + "D2_FACT_INDEX", + "D4_WORKFLOW_INDEX", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "filters": { + "doc_type": "api_method" + }, + "pipeline_mode": "full", + "gate_decision": "allow", + "prompt_used": "docs_explain_answer", + "llm_mode": "prose", + "degraded_reason": null, + "code_intents_stubbed": true + } + }, + "pipeline_steps": [ + { + "step": "input_query", + "input": { + "query": "Что делает endpoint /health?" + }, + "output": { + "query": "Что делает endpoint /health?" + } + }, + { + "step": "router", + "input": { + "query": "Что делает endpoint /health?" + }, + "output": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "API_METHOD_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START" + } + }, + { + "step": "docs_pipeline", + "input": { + "query": "Что делает endpoint /health?" + }, + "output": { + "answer_mode": "answered", + "prompt_name": "docs_explain_answer", + "llm_request": { + "prompt_name": "docs_explain_answer", + "log_context": "graph.project_qa.docs.answer", + "prompt_stats": { + "system_chars": 393, + "user_chars": 4585, + "tokens_in_estimate": 1245 + } + }, + "degraded_reason": "" + } + } + ] +} \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/docs_router_llm_disambiguation/20260326_150213/full_chain_docs_intents_v4-llm_v4-api.md b/tests/pipeline_setup_v3/test_results/docs_router_llm_disambiguation/20260326_150213/full_chain_docs_intents_v4-llm_v4-api.md new file mode 100644 index 0000000..cbbd791 --- /dev/null +++ b/tests/pipeline_setup_v3/test_results/docs_router_llm_disambiguation/20260326_150213/full_chain_docs_intents_v4-llm_v4-api.md @@ -0,0 +1,467 @@ +# v4-api + +- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_03_docs/full_chain_docs_intents_v4-llm.yaml +- runner: agent_runtime +- mode: full_chain +- passed: True + +## Query +Что делает endpoint /health? + +## Actual +{ + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "API_METHOD_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START", + "rag_count": 2, + "llm_answer": "### Краткое описание\nEndpoint `/health` предназначен для предоставления агрегированного health payload'а текущего состояния runtime. В зависимости от общего статуса он возвращает соответствующий HTTP код и payload: если статус равен `\"ok\"`, возвращается HTTP 200, иначе – HTTP 503 с подробностями о состоянии деградации или неготовности.\n\n### Основные элементы\n- **Метод:** GET `/health`\n- **Ответы:**\n - HTTP 200 при общем статусе `\"ok\"`\n - HTTP 503 при любом другом статусе\n- **Payload:** Агрегированное состояние здоровья runtime\n\n### Как это работает\n1. Клиент отправляет HTTP-запрос типа GET на `/health`.\n2. API обращается к провайдеру здоровья (`health_provider`) через зарегистрированный канал (`TelegramControlChannel`), чтобы получить текущее состояние здоровья runtime.\n3. Полученный health payload анализируется, определяется статус (\"ok\" или другой).\n4. На основе поля `status` формируется HTTP ответ с соответствующим статусом и самим payload'ом.\n\n### Связи с другими частями системы\n- **Зависит от:** domain.runtime_health (предоставление информации о здоровье)\n- **Является частью:** architecture.telegram_notify_app (контрольная точка состояния приложения)", + "answer_mode": "answered", + "path_scope": [], + "doc_scope": [ + "api.health_endpoint" + ], + "entity_candidates": [], + "symbol_candidates": [], + "layers": [ + "D2_FACT_INDEX", + "D4_WORKFLOW_INDEX", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "filters": { + "doc_type": "api_method" + }, + "pipeline_mode": "full", + "gate_decision": "allow", + "prompt_used": "docs_explain_answer", + "llm_mode": "prose", + "degraded_reason": null, + "code_intents_stubbed": true +} + +## Pipeline Steps +### input_query +```json +{ + "input": { + "query": "Что делает endpoint /health?" + }, + "output": { + "query": "Что делает endpoint /health?" + } +} +``` + +### router +```json +{ + "input": { + "query": "Что делает endpoint /health?" + }, + "output": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "API_METHOD_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START" + } +} +``` + +### docs_pipeline +```json +{ + "input": { + "query": "Что делает endpoint /health?" + }, + "output": { + "answer_mode": "answered", + "prompt_name": "docs_explain_answer", + "llm_request": { + "prompt_name": "docs_explain_answer", + "log_context": "graph.project_qa.docs.answer", + "prompt_stats": { + "system_chars": 393, + "user_chars": 4585, + "tokens_in_estimate": 1245 + } + }, + "degraded_reason": "" + } +} +``` + +## Diagnostics +{ + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "API_METHOD_EXPLAIN", + "layers_used": [ + "D2_FACT_INDEX", + "D4_WORKFLOW_INDEX", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "documents_found": 1, + "facts_found": 0, + "relations_found": 0, + "openapi_fields_extracted": 0, + "missing_required_fields": [], + "openapi_status": { + "has_path": false, + "has_method": false, + "has_request": false, + "has_response": false + }, + "prompt_used": "docs_explain_answer", + "llm_mode": "prose", + "output_valid": true, + "matched_intent_source": "deterministic", + "matched_anchor_type": "endpoint", + "matched_anchor_value": "/health", + "exact_anchor_match": true, + "docs_layers_requested": [ + "D2_FACT_INDEX", + "D4_WORKFLOW_INDEX", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "docs_layers_with_hits": [ + "D2_FACT_INDEX", + "D4_WORKFLOW_INDEX", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "planned_layers": [ + "D2_FACT_INDEX", + "D4_WORKFLOW_INDEX", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "executed_layers": [ + "D2_FACT_INDEX", + "D4_WORKFLOW_INDEX", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "non_empty_layers": [ + "D2_FACT_INDEX", + "D4_WORKFLOW_INDEX", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "layer_diagnostics": { + "D2_FACT_INDEX": { + "hits": 8, + "top_ids": [ + "f85d982c272a2ee6baeadc433221a20e684cd8ef01cb4788d6f76d05ca56d6d0", + "b8e44c3adb74aaa6c91ae8815fa091289e58dd3990a3a1b63e850c62075aea75", + "b6bfad59b3bf00f199b5ef90c1208af19664de700413e7354468a93a4abaaa2f", + "a8a325e0815b3a2a870ba2825f3afb3f41056b4c091df4c3bb3418ffd20891dd", + "bafb867ffed41c9db637df98d6cd5f6722d7747bbebc6c03e6f0d0caf3b7f9f3" + ], + "top_sections": [ + "api.control_actions_endpoint:workflow_step", + "api.control_actions_endpoint:mentions_entity" + ] + }, + "D4_WORKFLOW_INDEX": { + "hits": 3, + "top_ids": [ + "api.control_actions_endpoint", + "api.health_endpoint", + "api.send_message_endpoint" + ], + "top_sections": [ + "Scenario" + ] + }, + "D1_DOCUMENT_CATALOG": { + "hits": 4, + "top_ids": [ + "api.send_message_endpoint", + "api.control_actions_endpoint", + "api.health_endpoint", + "domain.runtime_health" + ], + "top_sections": [ + "HTTP API /send", + "HTTP API /actions/{action}", + "HTTP API /health", + "Сущность runtime health" + ] + }, + "D0_DOC_CHUNKS": { + "hits": 4, + "top_ids": [ + "api.control_actions_endpoint" + ], + "top_sections": [ + "api.control_actions_endpoint:Описание", + "api.control_actions_endpoint:Сценарий", + "api.control_actions_endpoint:Summary", + "api.control_actions_endpoint:Функциональные требования" + ] + } + }, + "query_entity_candidates": [], + "resolved_entity_candidates": [], + "query_anchor_candidates": [ + "/health" + ], + "resolved_anchor_candidates": [ + "api.health_endpoint", + "docs/documentation/api/health-endpoint.md" + ], + "anchor_candidates": [], + "selected_anchor": null, + "anchor_selection_reason": "", + "anchor_match_type": "", + "doc_ids": [ + "api.health_endpoint" + ], + "doc_paths": [ + "docs/documentation/api/health-endpoint.md" + ], + "doc_titles": [ + "Scenario", + "HTTP API /health" + ], + "relation_hits_count": 0, + "relation_targets": [], + "selected_doc_ids": [ + "api.health_endpoint" + ], + "selected_fact_ids": [], + "selected_relation_ids": [], + "selected_chunk_ids": [], + "selected_entity_ids": [], + "selected_workflow_ids": [ + "83a9287bd9ac1f709258078d0e16d326615b4af1b7d77b323ff050dfb97a3e41" + ], + "fallback_doc_hits_count": 1, + "fallback_used": false, + "fact_hits": 0, + "entity_hits": 0, + "evidence_summary": { + "documents": 1, + "facts": 0, + "entities": 0, + "workflows": 1, + "relations": 0, + "chunks": 0, + "selected_doc_ids": [ + "api.health_endpoint" + ], + "selected_fact_ids": [], + "selected_relation_ids": [], + "selected_chunk_ids": [], + "entity_hits": 0, + "openapi_signals": { + "path_found": false, + "method_found": false, + "operation_semantics_found": false, + "request_payload_found": false, + "request_schema": false, + "request_fields_found": false, + "response_payload_found": false, + "response_schema": false, + "response_fields_found": false, + "status_codes": false, + "content_type_found": false, + "examples_found": false, + "payload_description": false + } + }, + "gate_decision": "allow", + "gate_decision_reason": "evidence_sufficient", + "gate_missing_requirements": [], + "gate_satisfied_requirements": [ + "retrieval_non_empty", + "exact_anchor_match" + ], + "openapi_evidence": { + "path_found": false, + "method_found": false, + "operation_semantics_found": false, + "request_payload_found": false, + "request_schema": false, + "request_fields_found": false, + "response_payload_found": false, + "response_schema": false, + "response_fields_found": false, + "status_codes": false, + "content_type_found": false, + "examples_found": false, + "payload_description": false + }, + "requested_fragment_type": null, + "fragment_evidence_found": [], + "fragment_missing_requirements": [], + "answer_mode": "answered", + "degrade_reason": null, + "degraded_reason": null, + "code_intents_stubbed": false +} + +## LLM Request +- prompt_name: docs_explain_answer +- log_context: graph.project_qa.docs.answer + +### Prompt Stats +```json +{ + "system_chars": 393, + "user_chars": 4585, + "tokens_in_estimate": 1245 +} +``` + +### System Prompt +```text +Ты объясняешь документацию системы. + +На вход приходит JSON с полями: +- question +- intent +- sub_intent +- documents +- facts +- relations + +Правила: +- Используй только предоставленные факты +- Не додумывай +- Если данных недостаточно, скажи это явно +- Объясняй структурировано + +Формат ответа: +1. Краткое описание +2. Основные элементы +3. Как это работает +4. Связи с другими частями системы (если есть) +``` + +### User Prompt +```json +{ + "question": "Что делает endpoint /health?", + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "API_METHOD_EXPLAIN", + "documents": [ + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/api/health-endpoint.md", + "title": "HTTP API /health", + "content": "Endpoint `/health` возвращает агрегированный health payload runtime. Если общий статус равен `ok`, API отвечает с HTTP 200; для состояний деградации или неготовности возвращается HTTP 503 с тем же payload. Endpoint служит основной точкой внешней проверки состояния приложения.", + "metadata": { + "name": "health_endpoint", + "tags": [ + "api", + "health", + "control-plane" + ], + "type": "api_method", + "layer": "application", + "links": [ + { + "type": "part_of", + "target": "architecture.telegram_notify_app" + }, + { + "type": "depends_on", + "target": "domain.runtime_health" + } + ], + "owner": null, + "title": "HTTP API /health", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "architecture.telegram_notify_app", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "8b5a533a8076e2e9d36995eee29aeade260080bdca2ec8e21fe28f08574b983f", + "children": [], + "doc_kind": "misc", + "entities": [ + "TelegramControlChannel", + "TelegramNotifyWorker", + "RuntimeManager", + "WorkerHealth" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "api.health_endpoint", + "source_path": "docs/documentation/api/health-endpoint.md", + "summary_text": "Endpoint `/health` возвращает агрегированный health payload runtime. Если общий статус равен `ok`, API отвечает с HTTP 200; для состояний деградации или неготовности возвращается HTTP 503 с тем же payload. Endpoint служит основной точкой внешней проверки состояния приложения.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + } + ], + "facts": [], + "entities": [], + "workflows": [ + { + "layer": "D4_WORKFLOW_INDEX", + "path": "docs/documentation/api/health-endpoint.md", + "title": "Scenario", + "content": "Scenario\nHTTP control plane запущен.\n`TelegramControlChannel` зарегистрирован в runtime.\nКлиент отправляет `GET /health`.\n1. Endpoint принимает HTTP-запрос `GET /health`.\n2. API вызывает `health_provider` через `TelegramControlChannel`.\n3. Канал получает health payload от runtime.\n4. Endpoint определяет HTTP status code по полю `status` в payload.\n5. Endpoint возвращает payload клиенту в формате JSON.\n1. Если runtime вернул статус, отличный от `ok`, endpoint возвращает тот же payload c HTTP 503.", + "metadata": { + "owner": null, + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "trigger": [ + "Клиент отправляет `GET /health`." + ], + "blob_sha": "8b5a533a8076e2e9d36995eee29aeade260080bdca2ec8e21fe28f08574b983f", + "main_flow": [ + "1. Endpoint принимает HTTP-запрос `GET /health`.", + "2. API вызывает `health_provider` через `TelegramControlChannel`.", + "3. Канал получает health payload от runtime.", + "4. Endpoint определяет HTTP status code по полю `status` в payload.", + "5. Endpoint возвращает payload клиенту в формате JSON." + ], + "doc_version": null, + "document_id": "api.health_endpoint", + "source_path": "docs/documentation/api/health-endpoint.md", + "workflow_id": "83a9287bd9ac1f709258078d0e16d326615b4af1b7d77b323ff050dfb97a3e41", + "artifact_type": null, + "last_modified": null, + "preconditions": [ + "HTTP control plane запущен.", + "`TelegramControlChannel` зарегистрирован в runtime." + ], + "workflow_name": "Scenario", + "error_handling": [ + "1. Если provider завершился исключением, запрос завершается server-side ошибкой." + ], + "postconditions": [ + "Клиент получает актуальный health payload runtime." + ], + "staleness_score": null, + "alternative_flow": [ + "1. Если runtime вернул статус, отличный от `ok`, endpoint возвращает тот же payload c HTTP 503." + ], + "system_component": null + } + } + ], + "relations": [], + "chunks": [] +} +``` + +### User Prompt Overview +- question: Что делает endpoint /health? +- intent: DOCUMENTATION_EXPLAIN +- sub_intent: API_METHOD_EXPLAIN +- documents: 1 | samples: HTTP API /health +- facts: 0 +- relations: 0 + +## Mismatches +- none \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/docs_router_llm_disambiguation/20260326_150213/full_chain_docs_intents_v4-llm_v4-component.json b/tests/pipeline_setup_v3/test_results/docs_router_llm_disambiguation/20260326_150213/full_chain_docs_intents_v4-llm_v4-component.json new file mode 100644 index 0000000..43e5cec --- /dev/null +++ b/tests/pipeline_setup_v3/test_results/docs_router_llm_disambiguation/20260326_150213/full_chain_docs_intents_v4-llm_v4-component.json @@ -0,0 +1,92 @@ +{ + "meta": { + "case_id": "v4-component", + "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_03_docs/full_chain_docs_intents_v4-llm.yaml", + "runner": "agent_runtime", + "mode": "full_chain", + "passed": true, + "mismatches": [], + "actual": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "COMPONENT_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START", + "rag_count": 18, + "llm_answer": "### Краткое описание\nRuntimeManager не упоминается ни в одном из документов или фактов, представленных в запросе. Поэтому невозможно предоставить полное объяснение его работы по предоставленным данным.\n\nОднако, исходя из доступной информации о контрольных действиях и endpoint `/actions/{action}`, можно предположить, что RuntimeManager может быть связан с управлением жизненным циклом рабочих процессов через указанные endpoints.\n\n### Основные элементы\n- **API Endpoint**: `/actions/{action}`\n- **Поддерживаемые действия**: `start`, `stop`, `status`\n- **Связанные сущности**: `ControlActionSet`, `TelegramControlChannel`\n\n### Как это работает\nВ документах указано, что endpoint `/actions/{action}` управляет control actions runtime и использует делегирование задач в `ControlActionSet`. Подробности о том, как именно работает RuntimeManager, отсутствуют в предоставленных материалах.\n\n### Связи с другими частями системы\n- **Связанный логический компонент**: `logic.telegram_notification_loop`\n- **Связанный API**: `api.health_endpoint`\n\nДля полного понимания работы RuntimeManager необходимы дополнительные документы или информация.", + "answer_mode": "answered", + "path_scope": [], + "doc_scope": [ + "api.control_actions_endpoint", + "logic.telegram_notification_loop", + "architecture.telegram_notify_app_overview", + "api.health_endpoint", + "api.actions_endpoint", + "architecture.telegram_notify_app", + "docs/README.md", + "domain.runtime_health" + ], + "entity_candidates": [ + "RuntimeManager" + ], + "symbol_candidates": [], + "layers": [ + "D2_FACT_INDEX", + "D5_RELATION_GRAPH", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "filters": { + "doc_type": null + }, + "pipeline_mode": "full", + "gate_decision": "allow", + "prompt_used": "docs_explain_answer", + "llm_mode": "prose", + "degraded_reason": null, + "code_intents_stubbed": true + } + }, + "pipeline_steps": [ + { + "step": "input_query", + "input": { + "query": "Как работает RuntimeManager?" + }, + "output": { + "query": "Как работает RuntimeManager?" + } + }, + { + "step": "router", + "input": { + "query": "Как работает RuntimeManager?" + }, + "output": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "COMPONENT_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START" + } + }, + { + "step": "docs_pipeline", + "input": { + "query": "Как работает RuntimeManager?" + }, + "output": { + "answer_mode": "answered", + "prompt_name": "docs_explain_answer", + "llm_request": { + "prompt_name": "docs_explain_answer", + "log_context": "graph.project_qa.docs.answer", + "prompt_stats": { + "system_chars": 393, + "user_chars": 10045, + "tokens_in_estimate": 2610 + } + }, + "degraded_reason": "" + } + } + ] +} \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/docs_router_llm_disambiguation/20260326_150213/full_chain_docs_intents_v4-llm_v4-component.md b/tests/pipeline_setup_v3/test_results/docs_router_llm_disambiguation/20260326_150213/full_chain_docs_intents_v4-llm_v4-component.md new file mode 100644 index 0000000..0ae2501 --- /dev/null +++ b/tests/pipeline_setup_v3/test_results/docs_router_llm_disambiguation/20260326_150213/full_chain_docs_intents_v4-llm_v4-component.md @@ -0,0 +1,657 @@ +# v4-component + +- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_03_docs/full_chain_docs_intents_v4-llm.yaml +- runner: agent_runtime +- mode: full_chain +- passed: True + +## Query +Как работает RuntimeManager? + +## Actual +{ + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "COMPONENT_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START", + "rag_count": 18, + "llm_answer": "### Краткое описание\nRuntimeManager не упоминается ни в одном из документов или фактов, представленных в запросе. Поэтому невозможно предоставить полное объяснение его работы по предоставленным данным.\n\nОднако, исходя из доступной информации о контрольных действиях и endpoint `/actions/{action}`, можно предположить, что RuntimeManager может быть связан с управлением жизненным циклом рабочих процессов через указанные endpoints.\n\n### Основные элементы\n- **API Endpoint**: `/actions/{action}`\n- **Поддерживаемые действия**: `start`, `stop`, `status`\n- **Связанные сущности**: `ControlActionSet`, `TelegramControlChannel`\n\n### Как это работает\nВ документах указано, что endpoint `/actions/{action}` управляет control actions runtime и использует делегирование задач в `ControlActionSet`. Подробности о том, как именно работает RuntimeManager, отсутствуют в предоставленных материалах.\n\n### Связи с другими частями системы\n- **Связанный логический компонент**: `logic.telegram_notification_loop`\n- **Связанный API**: `api.health_endpoint`\n\nДля полного понимания работы RuntimeManager необходимы дополнительные документы или информация.", + "answer_mode": "answered", + "path_scope": [], + "doc_scope": [ + "api.control_actions_endpoint", + "logic.telegram_notification_loop", + "architecture.telegram_notify_app_overview", + "api.health_endpoint", + "api.actions_endpoint", + "architecture.telegram_notify_app", + "docs/README.md", + "domain.runtime_health" + ], + "entity_candidates": [ + "RuntimeManager" + ], + "symbol_candidates": [], + "layers": [ + "D2_FACT_INDEX", + "D5_RELATION_GRAPH", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "filters": { + "doc_type": null + }, + "pipeline_mode": "full", + "gate_decision": "allow", + "prompt_used": "docs_explain_answer", + "llm_mode": "prose", + "degraded_reason": null, + "code_intents_stubbed": true +} + +## Pipeline Steps +### input_query +```json +{ + "input": { + "query": "Как работает RuntimeManager?" + }, + "output": { + "query": "Как работает RuntimeManager?" + } +} +``` + +### router +```json +{ + "input": { + "query": "Как работает RuntimeManager?" + }, + "output": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "COMPONENT_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START" + } +} +``` + +### docs_pipeline +```json +{ + "input": { + "query": "Как работает RuntimeManager?" + }, + "output": { + "answer_mode": "answered", + "prompt_name": "docs_explain_answer", + "llm_request": { + "prompt_name": "docs_explain_answer", + "log_context": "graph.project_qa.docs.answer", + "prompt_stats": { + "system_chars": 393, + "user_chars": 10045, + "tokens_in_estimate": 2610 + } + }, + "degraded_reason": "" + } +} +``` + +## Diagnostics +{ + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "COMPONENT_EXPLAIN", + "layers_used": [ + "D2_FACT_INDEX", + "D5_RELATION_GRAPH", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "documents_found": 1, + "facts_found": 2, + "relations_found": 2, + "openapi_fields_extracted": 0, + "missing_required_fields": [], + "openapi_status": { + "has_path": false, + "has_method": false, + "has_request": false, + "has_response": false + }, + "prompt_used": "docs_explain_answer", + "llm_mode": "prose", + "output_valid": true, + "matched_intent_source": "llm", + "matched_anchor_type": "none", + "matched_anchor_value": null, + "exact_anchor_match": false, + "docs_layers_requested": [ + "D2_FACT_INDEX", + "D5_RELATION_GRAPH", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "docs_layers_with_hits": [ + "D2_FACT_INDEX", + "D5_RELATION_GRAPH", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "planned_layers": [ + "D2_FACT_INDEX", + "D5_RELATION_GRAPH", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "executed_layers": [ + "D2_FACT_INDEX", + "D5_RELATION_GRAPH", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "non_empty_layers": [ + "D2_FACT_INDEX", + "D5_RELATION_GRAPH", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "layer_diagnostics": { + "D2_FACT_INDEX": { + "hits": 8, + "top_ids": [ + "b480201013a7e5231146f665773ebc54af37c28135f407c6b758304c74561645", + "b8e44c3adb74aaa6c91ae8815fa091289e58dd3990a3a1b63e850c62075aea75", + "bafb867ffed41c9db637df98d6cd5f6722d7747bbebc6c03e6f0d0caf3b7f9f3", + "54bbcbac242f1c85ec3280236ed5841998a8a3a548ff16cbf0b5acafbff469e3", + "b6bfad59b3bf00f199b5ef90c1208af19664de700413e7354468a93a4abaaa2f" + ], + "top_sections": [ + "api.control_actions_endpoint:workflow_step", + "api.control_actions_endpoint:mentions_entity" + ] + }, + "D5_RELATION_GRAPH": { + "hits": 8, + "top_ids": [ + "eec79f7a02b804337e791ef231784862ae26e0599eb20224790e9d4f085fa9c0", + "711fb2edb82dd222deaba3c91768b18cbbd453009235823282813c6e867dc2c1", + "afec31fd062e392dcd9699a92c7ab61fd4b1273c1a2b16702b23d55d8d0c47ac", + "5f4909bde905cd3d294ad307074a05e4ae4deefcafe6272cd2d0436e73acb8dd", + "921934af8cd7b16572a6cbd3c42011a08d2762f121853cb2458dff348284ac76" + ], + "top_sections": [ + "api.control_actions_endpoint:related_logic", + "api.control_actions_endpoint:related_api", + "api.control_actions_endpoint:parent", + "api.control_actions_endpoint:part_of", + "logic.telegram_notification_loop:related_api" + ] + }, + "D1_DOCUMENT_CATALOG": { + "hits": 4, + "top_ids": [ + "api.control_actions_endpoint", + "architecture.telegram_notify_app", + "docs/README.md", + "domain.runtime_health" + ], + "top_sections": [ + "HTTP API /actions/{action}", + "Архитектура Telegram Notify App", + "Readme", + "Сущность runtime health" + ] + }, + "D0_DOC_CHUNKS": { + "hits": 4, + "top_ids": [ + "api.control_actions_endpoint" + ], + "top_sections": [ + "api.control_actions_endpoint:Описание", + "api.control_actions_endpoint:Сценарий", + "api.control_actions_endpoint:Summary", + "api.control_actions_endpoint:Функциональные требования" + ] + } + }, + "query_entity_candidates": [ + "RuntimeManager" + ], + "resolved_entity_candidates": [], + "query_anchor_candidates": [ + "RuntimeManager" + ], + "resolved_anchor_candidates": [ + "docs/documentation/api/control-actions-endpoint.md", + "docs/documentation/logic/telegram-notification-loop.md", + "docs/documentation/architecture/telegram-notify-app-overview.md", + "docs/documentation/api/health-endpoint.md", + "api.control_actions_endpoint", + "architecture.telegram_notify_app", + "docs/README.md", + "domain.runtime_health", + "docs/documentation/domain/runtime-health-entity.md" + ], + "anchor_candidates": [], + "selected_anchor": null, + "anchor_selection_reason": "", + "anchor_match_type": "", + "doc_ids": [ + "api.control_actions_endpoint", + "logic.telegram_notification_loop", + "architecture.telegram_notify_app_overview", + "api.health_endpoint", + "api.actions_endpoint", + "architecture.telegram_notify_app", + "docs/README.md", + "domain.runtime_health" + ], + "doc_paths": [ + "docs/documentation/api/control-actions-endpoint.md", + "docs/documentation/logic/telegram-notification-loop.md", + "docs/documentation/architecture/telegram-notify-app-overview.md", + "docs/documentation/api/health-endpoint.md", + "docs/README.md", + "docs/documentation/domain/runtime-health-entity.md" + ], + "doc_titles": [ + "api.control_actions_endpoint:workflow_step", + "api.control_actions_endpoint:mentions_entity", + "api.control_actions_endpoint:related_logic", + "api.control_actions_endpoint:related_api", + "api.control_actions_endpoint:parent", + "api.control_actions_endpoint:part_of", + "logic.telegram_notification_loop:related_api", + "architecture.telegram_notify_app:related_api", + "architecture.telegram_notify_app:child", + "api.health_endpoint:depends_on", + "HTTP API /actions/{action}", + "Архитектура Telegram Notify App", + "Readme", + "Сущность runtime health", + "api.control_actions_endpoint:Описание", + "api.control_actions_endpoint:Сценарий", + "api.control_actions_endpoint:Summary", + "api.control_actions_endpoint:Функциональные требования" + ], + "relation_hits_count": 2, + "relation_targets": [ + "api.control_actions_endpoint:related_logic", + "api.control_actions_endpoint:related_api" + ], + "selected_doc_ids": [ + "api.control_actions_endpoint" + ], + "selected_fact_ids": [ + "b480201013a7e5231146f665773ebc54af37c28135f407c6b758304c74561645", + "bafb867ffed41c9db637df98d6cd5f6722d7747bbebc6c03e6f0d0caf3b7f9f3" + ], + "selected_relation_ids": [ + "eec79f7a02b804337e791ef231784862ae26e0599eb20224790e9d4f085fa9c0", + "711fb2edb82dd222deaba3c91768b18cbbd453009235823282813c6e867dc2c1" + ], + "selected_chunk_ids": [ + "api.control_actions_endpoint" + ], + "selected_entity_ids": [], + "selected_workflow_ids": [], + "fallback_doc_hits_count": 3, + "fallback_used": false, + "fact_hits": 2, + "entity_hits": 0, + "evidence_summary": { + "documents": 1, + "facts": 2, + "entities": 0, + "workflows": 0, + "relations": 2, + "chunks": 2, + "selected_doc_ids": [ + "api.control_actions_endpoint" + ], + "selected_fact_ids": [ + "b480201013a7e5231146f665773ebc54af37c28135f407c6b758304c74561645", + "bafb867ffed41c9db637df98d6cd5f6722d7747bbebc6c03e6f0d0caf3b7f9f3" + ], + "selected_relation_ids": [ + "eec79f7a02b804337e791ef231784862ae26e0599eb20224790e9d4f085fa9c0", + "711fb2edb82dd222deaba3c91768b18cbbd453009235823282813c6e867dc2c1" + ], + "selected_chunk_ids": [ + "api.control_actions_endpoint" + ], + "entity_hits": 0, + "openapi_signals": { + "path_found": false, + "method_found": false, + "operation_semantics_found": false, + "request_payload_found": false, + "request_schema": false, + "request_fields_found": false, + "response_payload_found": false, + "response_schema": false, + "response_fields_found": false, + "status_codes": false, + "content_type_found": false, + "examples_found": false, + "payload_description": false + } + }, + "gate_decision": "allow", + "gate_decision_reason": "evidence_sufficient", + "gate_missing_requirements": [], + "gate_satisfied_requirements": [ + "retrieval_non_empty" + ], + "openapi_evidence": { + "path_found": false, + "method_found": false, + "operation_semantics_found": false, + "request_payload_found": false, + "request_schema": false, + "request_fields_found": false, + "response_payload_found": false, + "response_schema": false, + "response_fields_found": false, + "status_codes": false, + "content_type_found": false, + "examples_found": false, + "payload_description": false + }, + "requested_fragment_type": null, + "fragment_evidence_found": [], + "fragment_missing_requirements": [], + "answer_mode": "answered", + "degrade_reason": null, + "degraded_reason": null, + "code_intents_stubbed": false +} + +## LLM Request +- prompt_name: docs_explain_answer +- log_context: graph.project_qa.docs.answer + +### Prompt Stats +```json +{ + "system_chars": 393, + "user_chars": 10045, + "tokens_in_estimate": 2610 +} +``` + +### System Prompt +```text +Ты объясняешь документацию системы. + +На вход приходит JSON с полями: +- question +- intent +- sub_intent +- documents +- facts +- relations + +Правила: +- Используй только предоставленные факты +- Не додумывай +- Если данных недостаточно, скажи это явно +- Объясняй структурировано + +Формат ответа: +1. Краткое описание +2. Основные элементы +3. Как это работает +4. Связи с другими частями системы (если есть) +``` + +### User Prompt +```json +{ + "question": "Как работает RuntimeManager?", + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "COMPONENT_EXPLAIN", + "documents": [ + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "HTTP API /actions/{action}", + "content": "Endpoint `/actions/{action}` управляет control actions runtime и поддерживает `start`, `stop` и `status`. Для долгих операций `start` и `stop` допускается ответ HTTP 202, если действие еще выполняется. Endpoint используется для operator-driven управления жизненным циклом worker'а через HTTP API.", + "metadata": { + "name": "control_actions_endpoint", + "tags": [ + "api", + "control-plane", + "lifecycle" + ], + "type": "api_method", + "layer": "application", + "links": [ + { + "type": "part_of", + "target": "architecture.telegram_notify_app" + }, + { + "type": "related_api", + "target": "api.health_endpoint" + }, + { + "type": "related_logic", + "target": "logic.telegram_notification_loop" + } + ], + "owner": null, + "title": "HTTP API /actions/{action}", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "architecture.telegram_notify_app", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "children": [], + "doc_kind": "misc", + "entities": [ + "TelegramControlChannel", + "ControlActionSet", + "JSONResponse" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "api.control_actions_endpoint", + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "summary_text": "Endpoint `/actions/{action}` управляет control actions runtime и поддерживает `start`, `stop` и `status`. Для долгих операций `start` и `stop` допускается ответ HTTP 202, если действие еще выполняется. Endpoint используется для operator-driven управления жизненным циклом worker'а через HTTP API.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + } + ], + "facts": [ + { + "layer": "D2_FACT_INDEX", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "api.control_actions_endpoint:workflow_step", + "content": "api.control_actions_endpoint workflow_step HTTP control plane запущен.", + "metadata": { + "tags": [], + "owner": null, + "anchor": "Сценарий", + "doc_id": null, + "object": "HTTP control plane запущен.", + "fact_id": "b480201013a7e5231146f665773ebc54af37c28135f407c6b758304c74561645", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "predicate": "workflow_step", + "object_ref": null, + "subject_id": "api.control_actions_endpoint", + "doc_version": null, + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D2_FACT_INDEX", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "api.control_actions_endpoint:mentions_entity", + "content": "api.control_actions_endpoint mentions_entity ControlActionSet", + "metadata": { + "tags": [], + "owner": null, + "anchor": "frontmatter.entities", + "doc_id": null, + "object": "ControlActionSet", + "fact_id": "bafb867ffed41c9db637df98d6cd5f6722d7747bbebc6c03e6f0d0caf3b7f9f3", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "predicate": "mentions_entity", + "object_ref": null, + "subject_id": "api.control_actions_endpoint", + "doc_version": null, + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + } + ], + "entities": [], + "workflows": [], + "relations": [ + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "api.control_actions_endpoint:related_logic", + "content": "api.control_actions_endpoint related_logic logic.telegram_notification_loop", + "metadata": { + "owner": null, + "anchor": "frontmatter.links", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "source_id": "api.control_actions_endpoint", + "target_id": "logic.telegram_notification_loop", + "doc_version": null, + "relation_id": "eec79f7a02b804337e791ef231784862ae26e0599eb20224790e9d4f085fa9c0", + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "related_logic", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "api.control_actions_endpoint:related_api", + "content": "api.control_actions_endpoint related_api api.health_endpoint", + "metadata": { + "owner": null, + "anchor": "frontmatter.links", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "source_id": "api.control_actions_endpoint", + "target_id": "api.health_endpoint", + "doc_version": null, + "relation_id": "711fb2edb82dd222deaba3c91768b18cbbd453009235823282813c6e867dc2c1", + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "related_api", + "staleness_score": null, + "system_component": null + } + } + ], + "chunks": [ + { + "layer": "D0_DOC_CHUNKS", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "api.control_actions_endpoint:Описание", + "content": "Метод предоставляет HTTP-доступ к control actions runtime и позволяет запускать, останавливать или проверять состояние управляемых компонентов. Endpoint не реализует lifecycle самостоятельно, а делегирует выполнение в `ControlActionSet`.", + "metadata": { + "tags": [ + "api", + "control-plane", + "lifecycle" + ], + "type": "api_method", + "order": 3, + "owner": null, + "doc_id": null, + "module": "telegram_notify_app", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "doc_kind": "misc", + "doc_version": null, + "document_id": "api.control_actions_endpoint", + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "section_path": "Details > Описание", + "artifact_type": null, + "last_modified": null, + "section_title": "Описание", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D0_DOC_CHUNKS", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "api.control_actions_endpoint:Сценарий", + "content": "**Название:** Выполнение control action runtime\n\n**Предусловия:**\n- HTTP control plane запущен.\n- `ControlActionSet` сконфигурирован в `TelegramControlChannel`.\n- В path передано одно из поддерживаемых действий: `start`, `stop`, `status`.\n\n**Триггер:**\n- Клиент отправляет `GET` или `POST` на `/actions/{action}`.\n\n**Основной сценарий:**\n1. Endpoint принимает запрос и извлекает path parameter `action`.\n2. API определяет источник клиента через `X-Client-Source` или `User-Agent`.\n3. Для `start` и `stop` запрос логируется как control action.\n4. Канал сопоставляет `action` с callback из `ControlActionSet`.\n5. API ожидает завершения callback в пределах допустимого timeout.\n6. При успешном завершении API возвращает JSON со статусом `ok`.\n\n**Альтернативный сценарий:**\n1. Если `start` или `stop` не успевают завершиться в timeout, API возвращает `202 accepted` и сообщает, что операция еще выполняется.\n\n**Обработка ошибок:**\n1. Если actions не сконфигурированы, API возвращает `404`.\n2. Если передано неподдерживаемое действие, API возвращает `404`.\n3. Если callback завершился исключением, API возвращает `500`.\n\n**Постусловие:**\n- Клиент получает результат выполнения control action или признак, что операция еще продолжается.", + "metadata": { + "tags": [ + "api", + "control-plane", + "lifecycle" + ], + "type": "api_method", + "order": 4, + "owner": null, + "doc_id": null, + "module": "telegram_notify_app", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "doc_kind": "misc", + "doc_version": null, + "document_id": "api.control_actions_endpoint", + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "section_path": "Details > Сценарий", + "artifact_type": null, + "last_modified": null, + "section_title": "Сценарий", + "staleness_score": null, + "system_component": null + } + } + ] +} +``` + +### User Prompt Overview +- question: Как работает RuntimeManager? +- intent: DOCUMENTATION_EXPLAIN +- sub_intent: COMPONENT_EXPLAIN +- documents: 1 | samples: HTTP API /actions/{action} +- facts: 2 | samples: api.control_actions_endpoint:workflow_step, api.control_actions_endpoint:mentions_entity +- relations: 2 | samples: api.control_actions_endpoint:related_logic, api.control_actions_endpoint:related_api + +## Mismatches +- none \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/docs_router_llm_disambiguation/20260326_150213/full_chain_docs_intents_v4-llm_v4-entity.json b/tests/pipeline_setup_v3/test_results/docs_router_llm_disambiguation/20260326_150213/full_chain_docs_intents_v4-llm_v4-entity.json new file mode 100644 index 0000000..7f66d19 --- /dev/null +++ b/tests/pipeline_setup_v3/test_results/docs_router_llm_disambiguation/20260326_150213/full_chain_docs_intents_v4-llm_v4-entity.json @@ -0,0 +1,91 @@ +{ + "meta": { + "case_id": "v4-entity", + "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_03_docs/full_chain_docs_intents_v4-llm.yaml", + "runner": "agent_runtime", + "mode": "full_chain", + "passed": true, + "mismatches": [], + "actual": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "ENTITY_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START", + "rag_count": 24, + "llm_answer": "### Краткое описание\nRuntime Health – это доменная модель наблюдаемости сервиса, описывающая общее состояние runtime и отдельных его компонентов. Она используется для внешнего мониторинга здоровья приложения и внутренней диагностики.\n\n### Основные элементы\n- **Компоненты**: Главными объектами наблюдения являются компоненты, такие как `telegram_notify`.\n- **Параметры**: Важны параметры компонента, например, статус, время старта и количество успешных отправок.\n- **Модель**: Представляет собой набор метрик и состояний, отражающих текущую работоспособность сервиса.\n\n### Как это работает\nМодель Runtime Health собирает данные о состоянии различных компонентов сервиса и предоставляет их внешним системам мониторинга и внутренним диагностическим механизмам. Для тестового приложения `test_echo_app` основной наблюдаемый компонент - это `telegram_notify`. \n\nAPI endpoint `/health` предоставляет текущее состояние runtime и его компонентов без изменения текущего состояния системы. Это необходимо для мониторинга работоспособности приложения, проведения проверок готовности (readiness), жизнеспособности (liveness) и быстрой диагностики работы компонента `telegram_notify`.\n\n### Связи с другими частями системы\n- **Используется API**: Модель используется в методе API `/health`, который обеспечивает внешний мониторинг и диагностику.\n- **Связана с логикой**: Логика уведомления через Telegram (`logic.telegram_notification_loop`) связана с моделью Runtime Health и может использовать её данные для управления состоянием уведомлений.\n- **Часть архитектуры**: Модель является частью общей архитектуры приложения `telegram_notify_app` и интегрируется с другими компонентами этого приложения.", + "answer_mode": "answered", + "path_scope": [], + "doc_scope": [ + "api.health_endpoint", + "architecture.telegram_notify_app", + "architecture.telegram_notify_app_overview", + "domain.runtime_health", + "api.control_actions_endpoint", + "logic.telegram_notification_loop", + "api.actions_endpoint" + ], + "entity_candidates": [ + "runtime health" + ], + "symbol_candidates": [], + "layers": [ + "D3_ENTITY_CATALOG", + "D5_RELATION_GRAPH", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "filters": { + "doc_type": null + }, + "pipeline_mode": "full", + "gate_decision": "allow", + "prompt_used": "docs_explain_answer", + "llm_mode": "prose", + "degraded_reason": null, + "code_intents_stubbed": true + } + }, + "pipeline_steps": [ + { + "step": "input_query", + "input": { + "query": "Что такое runtime health?" + }, + "output": { + "query": "Что такое runtime health?" + } + }, + { + "step": "router", + "input": { + "query": "Что такое runtime health?" + }, + "output": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "ENTITY_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START" + } + }, + { + "step": "docs_pipeline", + "input": { + "query": "Что такое runtime health?" + }, + "output": { + "answer_mode": "answered", + "prompt_name": "docs_explain_answer", + "llm_request": { + "prompt_name": "docs_explain_answer", + "log_context": "graph.project_qa.docs.answer", + "prompt_stats": { + "system_chars": 393, + "user_chars": 7572, + "tokens_in_estimate": 1992 + } + }, + "degraded_reason": "" + } + } + ] +} \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/docs_router_llm_disambiguation/20260326_150213/full_chain_docs_intents_v4-llm_v4-entity.md b/tests/pipeline_setup_v3/test_results/docs_router_llm_disambiguation/20260326_150213/full_chain_docs_intents_v4-llm_v4-entity.md new file mode 100644 index 0000000..b78fd9c --- /dev/null +++ b/tests/pipeline_setup_v3/test_results/docs_router_llm_disambiguation/20260326_150213/full_chain_docs_intents_v4-llm_v4-entity.md @@ -0,0 +1,631 @@ +# v4-entity + +- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_03_docs/full_chain_docs_intents_v4-llm.yaml +- runner: agent_runtime +- mode: full_chain +- passed: True + +## Query +Что такое runtime health? + +## Actual +{ + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "ENTITY_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START", + "rag_count": 24, + "llm_answer": "### Краткое описание\nRuntime Health – это доменная модель наблюдаемости сервиса, описывающая общее состояние runtime и отдельных его компонентов. Она используется для внешнего мониторинга здоровья приложения и внутренней диагностики.\n\n### Основные элементы\n- **Компоненты**: Главными объектами наблюдения являются компоненты, такие как `telegram_notify`.\n- **Параметры**: Важны параметры компонента, например, статус, время старта и количество успешных отправок.\n- **Модель**: Представляет собой набор метрик и состояний, отражающих текущую работоспособность сервиса.\n\n### Как это работает\nМодель Runtime Health собирает данные о состоянии различных компонентов сервиса и предоставляет их внешним системам мониторинга и внутренним диагностическим механизмам. Для тестового приложения `test_echo_app` основной наблюдаемый компонент - это `telegram_notify`. \n\nAPI endpoint `/health` предоставляет текущее состояние runtime и его компонентов без изменения текущего состояния системы. Это необходимо для мониторинга работоспособности приложения, проведения проверок готовности (readiness), жизнеспособности (liveness) и быстрой диагностики работы компонента `telegram_notify`.\n\n### Связи с другими частями системы\n- **Используется API**: Модель используется в методе API `/health`, который обеспечивает внешний мониторинг и диагностику.\n- **Связана с логикой**: Логика уведомления через Telegram (`logic.telegram_notification_loop`) связана с моделью Runtime Health и может использовать её данные для управления состоянием уведомлений.\n- **Часть архитектуры**: Модель является частью общей архитектуры приложения `telegram_notify_app` и интегрируется с другими компонентами этого приложения.", + "answer_mode": "answered", + "path_scope": [], + "doc_scope": [ + "api.health_endpoint", + "architecture.telegram_notify_app", + "architecture.telegram_notify_app_overview", + "domain.runtime_health", + "api.control_actions_endpoint", + "logic.telegram_notification_loop", + "api.actions_endpoint" + ], + "entity_candidates": [ + "runtime health" + ], + "symbol_candidates": [], + "layers": [ + "D3_ENTITY_CATALOG", + "D5_RELATION_GRAPH", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "filters": { + "doc_type": null + }, + "pipeline_mode": "full", + "gate_decision": "allow", + "prompt_used": "docs_explain_answer", + "llm_mode": "prose", + "degraded_reason": null, + "code_intents_stubbed": true +} + +## Pipeline Steps +### input_query +```json +{ + "input": { + "query": "Что такое runtime health?" + }, + "output": { + "query": "Что такое runtime health?" + } +} +``` + +### router +```json +{ + "input": { + "query": "Что такое runtime health?" + }, + "output": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "ENTITY_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START" + } +} +``` + +### docs_pipeline +```json +{ + "input": { + "query": "Что такое runtime health?" + }, + "output": { + "answer_mode": "answered", + "prompt_name": "docs_explain_answer", + "llm_request": { + "prompt_name": "docs_explain_answer", + "log_context": "graph.project_qa.docs.answer", + "prompt_stats": { + "system_chars": 393, + "user_chars": 7572, + "tokens_in_estimate": 1992 + } + }, + "degraded_reason": "" + } +} +``` + +## Diagnostics +{ + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "ENTITY_EXPLAIN", + "layers_used": [ + "D3_ENTITY_CATALOG", + "D5_RELATION_GRAPH", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "documents_found": 1, + "facts_found": 0, + "relations_found": 2, + "openapi_fields_extracted": 0, + "missing_required_fields": [], + "openapi_status": { + "has_path": false, + "has_method": false, + "has_request": false, + "has_response": false + }, + "prompt_used": "docs_explain_answer", + "llm_mode": "prose", + "output_valid": true, + "matched_intent_source": "deterministic", + "matched_anchor_type": "none", + "matched_anchor_value": null, + "exact_anchor_match": false, + "docs_layers_requested": [ + "D3_ENTITY_CATALOG", + "D5_RELATION_GRAPH", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "docs_layers_with_hits": [ + "D3_ENTITY_CATALOG", + "D5_RELATION_GRAPH", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "planned_layers": [ + "D3_ENTITY_CATALOG", + "D5_RELATION_GRAPH", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "executed_layers": [ + "D3_ENTITY_CATALOG", + "D5_RELATION_GRAPH", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "non_empty_layers": [ + "D3_ENTITY_CATALOG", + "D5_RELATION_GRAPH", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "layer_diagnostics": { + "D3_ENTITY_CATALOG": { + "hits": 8, + "top_ids": [ + "api.health_endpoint", + "architecture.telegram_notify_app", + "domain.runtime_health" + ], + "top_sections": [ + "RuntimeManager", + "WorkerStatus", + "TelegramNotifyWorker", + "TelegramControlChannel" + ] + }, + "D5_RELATION_GRAPH": { + "hits": 8, + "top_ids": [ + "801650f8bcbfbfbefd35c14447bfef7b3c3827313db790efa7faf47db860f8c4", + "8595d7b82fecdb7ef579fa8961cda6799bb21970061e5bc221d4dd7a3d53fd04", + "af2a4f7c1b677b908410ba720915405e10dbd0870e30a3c6e3aa2468550ddf0e", + "c718b1939621233295ccaf6e8203e7fd94f3dd1bfb88f10c51bc5e33d53a24aa", + "616f5cbf25da83cb51d8d0741a7fc351620c9ca2c6513fa2094b4aa476f0912a" + ], + "top_sections": [ + "domain.runtime_health:used_by", + "domain.runtime_health:related_logic", + "domain.runtime_health:part_of", + "api.health_endpoint:parent", + "api.health_endpoint:part_of" + ] + }, + "D1_DOCUMENT_CATALOG": { + "hits": 4, + "top_ids": [ + "domain.runtime_health", + "api.health_endpoint", + "logic.telegram_notification_loop", + "api.control_actions_endpoint" + ], + "top_sections": [ + "Сущность runtime health", + "HTTP API /health", + "Цикл отправки уведомлений в Telegram", + "HTTP API /actions/{action}" + ] + }, + "D0_DOC_CHUNKS": { + "hits": 4, + "top_ids": [ + "api.health_endpoint" + ], + "top_sections": [ + "api.health_endpoint:Описание", + "api.health_endpoint:Сценарий", + "api.health_endpoint:Summary", + "api.health_endpoint:Функциональные требования" + ] + } + }, + "query_entity_candidates": [ + "runtime health" + ], + "resolved_entity_candidates": [], + "query_anchor_candidates": [], + "resolved_anchor_candidates": [ + "api.health_endpoint", + "docs/documentation/api/health-endpoint.md", + "architecture.telegram_notify_app", + "docs/documentation/architecture/telegram-notify-app-overview.md", + "domain.runtime_health", + "docs/documentation/domain/runtime-health-entity.md", + "docs/documentation/api/control-actions-endpoint.md", + "logic.telegram_notification_loop", + "docs/documentation/logic/telegram-notification-loop.md", + "api.control_actions_endpoint" + ], + "anchor_candidates": [], + "selected_anchor": null, + "anchor_selection_reason": "", + "anchor_match_type": "", + "doc_ids": [ + "api.health_endpoint", + "architecture.telegram_notify_app", + "architecture.telegram_notify_app_overview", + "domain.runtime_health", + "api.control_actions_endpoint", + "logic.telegram_notification_loop", + "api.actions_endpoint" + ], + "doc_paths": [ + "docs/documentation/api/health-endpoint.md", + "docs/documentation/architecture/telegram-notify-app-overview.md", + "docs/documentation/domain/runtime-health-entity.md", + "docs/documentation/api/control-actions-endpoint.md", + "docs/documentation/logic/telegram-notification-loop.md" + ], + "doc_titles": [ + "RuntimeManager", + "WorkerStatus", + "TelegramNotifyWorker", + "TelegramControlChannel", + "WorkerHealth", + "domain.runtime_health:used_by", + "domain.runtime_health:related_logic", + "domain.runtime_health:part_of", + "api.health_endpoint:parent", + "api.health_endpoint:part_of", + "api.health_endpoint:depends_on", + "domain.runtime_health:parent", + "api.control_actions_endpoint:related_api", + "Сущность runtime health", + "HTTP API /health", + "Цикл отправки уведомлений в Telegram", + "HTTP API /actions/{action}", + "api.health_endpoint:Описание", + "api.health_endpoint:Сценарий", + "api.health_endpoint:Summary", + "api.health_endpoint:Функциональные требования" + ], + "relation_hits_count": 2, + "relation_targets": [ + "domain.runtime_health:used_by", + "domain.runtime_health:related_logic" + ], + "selected_doc_ids": [ + "domain.runtime_health", + "api.health_endpoint", + "architecture.telegram_notify_app" + ], + "selected_fact_ids": [], + "selected_relation_ids": [ + "801650f8bcbfbfbefd35c14447bfef7b3c3827313db790efa7faf47db860f8c4", + "8595d7b82fecdb7ef579fa8961cda6799bb21970061e5bc221d4dd7a3d53fd04" + ], + "selected_chunk_ids": [ + "api.health_endpoint" + ], + "selected_entity_ids": [ + "api.health_endpoint", + "architecture.telegram_notify_app" + ], + "selected_workflow_ids": [], + "fallback_doc_hits_count": 2, + "fallback_used": false, + "fact_hits": 0, + "entity_hits": 0, + "evidence_summary": { + "documents": 1, + "facts": 0, + "entities": 2, + "workflows": 0, + "relations": 2, + "chunks": 1, + "selected_doc_ids": [ + "domain.runtime_health", + "api.health_endpoint", + "architecture.telegram_notify_app" + ], + "selected_fact_ids": [], + "selected_relation_ids": [ + "801650f8bcbfbfbefd35c14447bfef7b3c3827313db790efa7faf47db860f8c4", + "8595d7b82fecdb7ef579fa8961cda6799bb21970061e5bc221d4dd7a3d53fd04" + ], + "selected_chunk_ids": [ + "api.health_endpoint" + ], + "entity_hits": 0, + "openapi_signals": { + "path_found": false, + "method_found": false, + "operation_semantics_found": false, + "request_payload_found": false, + "request_schema": false, + "request_fields_found": false, + "response_payload_found": false, + "response_schema": false, + "response_fields_found": false, + "status_codes": false, + "content_type_found": false, + "examples_found": false, + "payload_description": false + } + }, + "gate_decision": "allow", + "gate_decision_reason": "evidence_sufficient", + "gate_missing_requirements": [], + "gate_satisfied_requirements": [ + "retrieval_non_empty" + ], + "openapi_evidence": { + "path_found": false, + "method_found": false, + "operation_semantics_found": false, + "request_payload_found": false, + "request_schema": false, + "request_fields_found": false, + "response_payload_found": false, + "response_schema": false, + "response_fields_found": false, + "status_codes": false, + "content_type_found": false, + "examples_found": false, + "payload_description": false + }, + "requested_fragment_type": null, + "fragment_evidence_found": [], + "fragment_missing_requirements": [], + "answer_mode": "answered", + "degrade_reason": null, + "degraded_reason": null, + "code_intents_stubbed": false +} + +## LLM Request +- prompt_name: docs_explain_answer +- log_context: graph.project_qa.docs.answer + +### Prompt Stats +```json +{ + "system_chars": 393, + "user_chars": 7572, + "tokens_in_estimate": 1992 +} +``` + +### System Prompt +```text +Ты объясняешь документацию системы. + +На вход приходит JSON с полями: +- question +- intent +- sub_intent +- documents +- facts +- relations + +Правила: +- Используй только предоставленные факты +- Не додумывай +- Если данных недостаточно, скажи это явно +- Объясняй структурировано + +Формат ответа: +1. Краткое описание +2. Основные элементы +3. Как это работает +4. Связи с другими частями системы (если есть) +``` + +### User Prompt +```json +{ + "question": "Что такое runtime health?", + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "ENTITY_EXPLAIN", + "documents": [ + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/domain/runtime-health-entity.md", + "title": "Сущность runtime health", + "content": "`runtime health` — доменная модель наблюдаемости сервиса, которая описывает общее состояние runtime и состояние отдельных компонентов. Для `test_echo_app` главным объектом наблюдения является компонент `telegram_notify`, у которого важны статус, время старта и количество успешных отправок. Эта модель используется для внешнего health-monitoring и внутренней диагностики.", + "metadata": { + "name": "runtime_health", + "tags": [ + "domain", + "health", + "observability" + ], + "type": "domain_entity", + "layer": "domain", + "links": [ + { + "type": "part_of", + "target": "architecture.telegram_notify_app" + }, + { + "type": "used_by", + "target": "api.health_endpoint" + }, + { + "type": "related_logic", + "target": "logic.telegram_notification_loop" + } + ], + "owner": null, + "title": "Сущность runtime health", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "architecture.telegram_notify_app", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "37d4dcf470ea3de95d59e44786006e369a3ea11bf5dbf4c88877696e9183ee87", + "children": [], + "doc_kind": "misc", + "entities": [ + "WorkerHealth", + "WorkerStatus", + "TelegramNotifyWorker" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "domain.runtime_health", + "source_path": "docs/documentation/domain/runtime-health-entity.md", + "summary_text": "`runtime health` — доменная модель наблюдаемости сервиса, которая описывает общее состояние runtime и состояние отдельных компонентов. Для `test_echo_app` главным объектом наблюдения является компонент `telegram_notify`, у которого важны статус, время старта и количество успешных отправок. Эта модель используется для внешнего health-monitoring и внутренней диагностики.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + } + ], + "facts": [], + "entities": [ + { + "layer": "D3_ENTITY_CATALOG", + "path": "docs/documentation/api/health-endpoint.md", + "title": "RuntimeManager", + "content": "RuntimeManager", + "metadata": { + "tags": [ + "api", + "health", + "control-plane" + ], + "owner": null, + "doc_id": null, + "module": "telegram_notify_app", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "8b5a533a8076e2e9d36995eee29aeade260080bdca2ec8e21fe28f08574b983f", + "doc_version": null, + "document_id": "api.health_endpoint", + "entity_name": "RuntimeManager", + "source_path": "docs/documentation/api/health-endpoint.md", + "artifact_type": null, + "document_type": "api_method", + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D3_ENTITY_CATALOG", + "path": "docs/documentation/architecture/telegram-notify-app-overview.md", + "title": "RuntimeManager", + "content": "RuntimeManager", + "metadata": { + "tags": [ + "architecture", + "telegram", + "plba", + "runtime" + ], + "owner": null, + "doc_id": null, + "module": "telegram_notify_app", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "8b1cc9f823e55bddbc825466d10a0fdb4ca4354ac02d91f9e2aef7b7d2ec8256", + "doc_version": null, + "document_id": "architecture.telegram_notify_app", + "entity_name": "RuntimeManager", + "source_path": "docs/documentation/architecture/telegram-notify-app-overview.md", + "artifact_type": null, + "document_type": "architecture_overview", + "last_modified": null, + "staleness_score": null, + "system_component": null + } + } + ], + "workflows": [], + "relations": [ + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/domain/runtime-health-entity.md", + "title": "domain.runtime_health:used_by", + "content": "domain.runtime_health used_by api.health_endpoint", + "metadata": { + "owner": null, + "anchor": "frontmatter.links", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "37d4dcf470ea3de95d59e44786006e369a3ea11bf5dbf4c88877696e9183ee87", + "source_id": "domain.runtime_health", + "target_id": "api.health_endpoint", + "doc_version": null, + "relation_id": "801650f8bcbfbfbefd35c14447bfef7b3c3827313db790efa7faf47db860f8c4", + "source_path": "docs/documentation/domain/runtime-health-entity.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "used_by", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/domain/runtime-health-entity.md", + "title": "domain.runtime_health:related_logic", + "content": "domain.runtime_health related_logic logic.telegram_notification_loop", + "metadata": { + "owner": null, + "anchor": "frontmatter.links", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "37d4dcf470ea3de95d59e44786006e369a3ea11bf5dbf4c88877696e9183ee87", + "source_id": "domain.runtime_health", + "target_id": "logic.telegram_notification_loop", + "doc_version": null, + "relation_id": "8595d7b82fecdb7ef579fa8961cda6799bb21970061e5bc221d4dd7a3d53fd04", + "source_path": "docs/documentation/domain/runtime-health-entity.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "related_logic", + "staleness_score": null, + "system_component": null + } + } + ], + "chunks": [ + { + "layer": "D0_DOC_CHUNKS", + "path": "docs/documentation/api/health-endpoint.md", + "title": "api.health_endpoint:Описание", + "content": "Метод предоставляет текущее состояние runtime и его компонентов без изменения состояния системы. Он нужен для мониторинга, readiness/liveness-проверок и быстрой диагностики worker'а `telegram_notify`.", + "metadata": { + "tags": [ + "api", + "health", + "control-plane" + ], + "type": "api_method", + "order": 3, + "owner": null, + "doc_id": null, + "module": "telegram_notify_app", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "8b5a533a8076e2e9d36995eee29aeade260080bdca2ec8e21fe28f08574b983f", + "doc_kind": "misc", + "doc_version": null, + "document_id": "api.health_endpoint", + "source_path": "docs/documentation/api/health-endpoint.md", + "section_path": "Details > Описание", + "artifact_type": null, + "last_modified": null, + "section_title": "Описание", + "staleness_score": null, + "system_component": null + } + } + ] +} +``` + +### User Prompt Overview +- question: Что такое runtime health? +- intent: DOCUMENTATION_EXPLAIN +- sub_intent: ENTITY_EXPLAIN +- documents: 1 | samples: Сущность runtime health +- facts: 0 +- relations: 2 | samples: domain.runtime_health:used_by, domain.runtime_health:related_logic + +## Mismatches +- none \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/docs_router_llm_disambiguation/20260326_150213/full_chain_docs_intents_v4-llm_v4-general.json b/tests/pipeline_setup_v3/test_results/docs_router_llm_disambiguation/20260326_150213/full_chain_docs_intents_v4-llm_v4-general.json new file mode 100644 index 0000000..2df1074 --- /dev/null +++ b/tests/pipeline_setup_v3/test_results/docs_router_llm_disambiguation/20260326_150213/full_chain_docs_intents_v4-llm_v4-general.json @@ -0,0 +1,85 @@ +{ + "meta": { + "case_id": "v4-general", + "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_03_docs/full_chain_docs_intents_v4-llm.yaml", + "runner": "agent_runtime", + "mode": "full_chain", + "passed": true, + "mismatches": [], + "actual": { + "intent": "GENERAL_QA", + "sub_intent": "GENERIC_QA", + "graph_id": "DocsQAGraph", + "conversation_mode": "START", + "rag_count": 8, + "llm_answer": "Документация описывает структуру проекта, включая разделы об архитектуре, HTTP API, бизнес-логике и ключевых сущностях. Конкретно представлен endpoint `/actions/{action}`, который управляет контрольными действиями и поддерживает операции start, stop и status.", + "answer_mode": "answered", + "path_scope": [], + "doc_scope": [ + "docs/README.md", + "api.control_actions_endpoint", + "api.actions_endpoint", + "api.health_endpoint", + "api.send_message_endpoint" + ], + "entity_candidates": [], + "symbol_candidates": [], + "layers": [ + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "filters": { + "doc_type": null + }, + "pipeline_mode": "full", + "gate_decision": "allow", + "prompt_used": "docs_general_answer", + "llm_mode": "prose", + "degraded_reason": null, + "code_intents_stubbed": true + } + }, + "pipeline_steps": [ + { + "step": "input_query", + "input": { + "query": "Что описано в документации?" + }, + "output": { + "query": "Что описано в документации?" + } + }, + { + "step": "router", + "input": { + "query": "Что описано в документации?" + }, + "output": { + "intent": "GENERAL_QA", + "sub_intent": "GENERIC_QA", + "graph_id": "DocsQAGraph", + "conversation_mode": "START" + } + }, + { + "step": "docs_pipeline", + "input": { + "query": "Что описано в документации?" + }, + "output": { + "answer_mode": "answered", + "prompt_name": "docs_general_answer", + "llm_request": { + "prompt_name": "docs_general_answer", + "log_context": "graph.project_qa.docs.answer", + "prompt_stats": { + "system_chars": 345, + "user_chars": 4499, + "tokens_in_estimate": 1211 + } + }, + "degraded_reason": "" + } + } + ] +} \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/docs_router_llm_disambiguation/20260326_150213/full_chain_docs_intents_v4-llm_v4-general.md b/tests/pipeline_setup_v3/test_results/docs_router_llm_disambiguation/20260326_150213/full_chain_docs_intents_v4-llm_v4-general.md new file mode 100644 index 0000000..88c3ad3 --- /dev/null +++ b/tests/pipeline_setup_v3/test_results/docs_router_llm_disambiguation/20260326_150213/full_chain_docs_intents_v4-llm_v4-general.md @@ -0,0 +1,464 @@ +# v4-general + +- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_03_docs/full_chain_docs_intents_v4-llm.yaml +- runner: agent_runtime +- mode: full_chain +- passed: True + +## Query +Что описано в документации? + +## Actual +{ + "intent": "GENERAL_QA", + "sub_intent": "GENERIC_QA", + "graph_id": "DocsQAGraph", + "conversation_mode": "START", + "rag_count": 8, + "llm_answer": "Документация описывает структуру проекта, включая разделы об архитектуре, HTTP API, бизнес-логике и ключевых сущностях. Конкретно представлен endpoint `/actions/{action}`, который управляет контрольными действиями и поддерживает операции start, stop и status.", + "answer_mode": "answered", + "path_scope": [], + "doc_scope": [ + "docs/README.md", + "api.control_actions_endpoint", + "api.actions_endpoint", + "api.health_endpoint", + "api.send_message_endpoint" + ], + "entity_candidates": [], + "symbol_candidates": [], + "layers": [ + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "filters": { + "doc_type": null + }, + "pipeline_mode": "full", + "gate_decision": "allow", + "prompt_used": "docs_general_answer", + "llm_mode": "prose", + "degraded_reason": null, + "code_intents_stubbed": true +} + +## Pipeline Steps +### input_query +```json +{ + "input": { + "query": "Что описано в документации?" + }, + "output": { + "query": "Что описано в документации?" + } +} +``` + +### router +```json +{ + "input": { + "query": "Что описано в документации?" + }, + "output": { + "intent": "GENERAL_QA", + "sub_intent": "GENERIC_QA", + "graph_id": "DocsQAGraph", + "conversation_mode": "START" + } +} +``` + +### docs_pipeline +```json +{ + "input": { + "query": "Что описано в документации?" + }, + "output": { + "answer_mode": "answered", + "prompt_name": "docs_general_answer", + "llm_request": { + "prompt_name": "docs_general_answer", + "log_context": "graph.project_qa.docs.answer", + "prompt_stats": { + "system_chars": 345, + "user_chars": 4499, + "tokens_in_estimate": 1211 + } + }, + "degraded_reason": "" + } +} +``` + +## Diagnostics +{ + "intent": "GENERAL_QA", + "sub_intent": "GENERIC_QA", + "layers_used": [ + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "documents_found": 2, + "facts_found": 0, + "relations_found": 0, + "openapi_fields_extracted": 0, + "missing_required_fields": [], + "openapi_status": { + "has_path": false, + "has_method": false, + "has_request": false, + "has_response": false + }, + "prompt_used": "docs_general_answer", + "llm_mode": "prose", + "output_valid": true, + "matched_intent_source": "deterministic", + "matched_anchor_type": "none", + "matched_anchor_value": null, + "exact_anchor_match": false, + "docs_layers_requested": [ + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "docs_layers_with_hits": [ + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "planned_layers": [ + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "executed_layers": [ + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "non_empty_layers": [ + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "layer_diagnostics": { + "D1_DOCUMENT_CATALOG": { + "hits": 4, + "top_ids": [ + "docs/README.md", + "api.control_actions_endpoint", + "api.health_endpoint", + "api.send_message_endpoint" + ], + "top_sections": [ + "Readme", + "HTTP API /actions/{action}", + "HTTP API /health", + "HTTP API /send" + ] + }, + "D0_DOC_CHUNKS": { + "hits": 4, + "top_ids": [ + "docs/README.md" + ], + "top_sections": [ + "docs/README.md:Структура", + "docs/README.md:Навигация", + "docs/README.md:Правила и шаблоны", + "docs/README.md:Project Docs" + ] + } + }, + "query_entity_candidates": [], + "resolved_entity_candidates": [], + "query_anchor_candidates": [], + "resolved_anchor_candidates": [ + "docs/README.md", + "api.control_actions_endpoint", + "docs/documentation/api/control-actions-endpoint.md", + "api.health_endpoint", + "docs/documentation/api/health-endpoint.md", + "api.send_message_endpoint", + "docs/documentation/api/send-message-endpoint.md" + ], + "anchor_candidates": [], + "selected_anchor": null, + "anchor_selection_reason": "", + "anchor_match_type": "", + "doc_ids": [ + "docs/README.md", + "api.control_actions_endpoint", + "api.actions_endpoint", + "api.health_endpoint", + "api.send_message_endpoint" + ], + "doc_paths": [ + "docs/README.md", + "docs/documentation/api/control-actions-endpoint.md", + "docs/documentation/api/health-endpoint.md", + "docs/documentation/api/send-message-endpoint.md" + ], + "doc_titles": [ + "Readme", + "HTTP API /actions/{action}", + "HTTP API /health", + "HTTP API /send", + "docs/README.md:Структура", + "docs/README.md:Навигация", + "docs/README.md:Правила и шаблоны", + "docs/README.md:Project Docs" + ], + "relation_hits_count": 0, + "relation_targets": [], + "selected_doc_ids": [ + "docs/README.md", + "api.control_actions_endpoint" + ], + "selected_fact_ids": [], + "selected_relation_ids": [], + "selected_chunk_ids": [ + "docs/README.md" + ], + "selected_entity_ids": [], + "selected_workflow_ids": [], + "fallback_doc_hits_count": 3, + "fallback_used": false, + "fact_hits": 0, + "entity_hits": 0, + "evidence_summary": { + "documents": 2, + "facts": 0, + "entities": 0, + "workflows": 0, + "relations": 0, + "chunks": 1, + "selected_doc_ids": [ + "docs/README.md", + "api.control_actions_endpoint" + ], + "selected_fact_ids": [], + "selected_relation_ids": [], + "selected_chunk_ids": [ + "docs/README.md" + ], + "entity_hits": 0, + "openapi_signals": { + "path_found": false, + "method_found": false, + "operation_semantics_found": false, + "request_payload_found": false, + "request_schema": false, + "request_fields_found": false, + "response_payload_found": false, + "response_schema": false, + "response_fields_found": false, + "status_codes": false, + "content_type_found": false, + "examples_found": false, + "payload_description": false + } + }, + "gate_decision": "allow", + "gate_decision_reason": "evidence_sufficient", + "gate_missing_requirements": [], + "gate_satisfied_requirements": [ + "retrieval_non_empty" + ], + "openapi_evidence": { + "path_found": false, + "method_found": false, + "operation_semantics_found": false, + "request_payload_found": false, + "request_schema": false, + "request_fields_found": false, + "response_payload_found": false, + "response_schema": false, + "response_fields_found": false, + "status_codes": false, + "content_type_found": false, + "examples_found": false, + "payload_description": false + }, + "requested_fragment_type": null, + "fragment_evidence_found": [], + "fragment_missing_requirements": [], + "answer_mode": "answered", + "degrade_reason": null, + "degraded_reason": null, + "code_intents_stubbed": false +} + +## LLM Request +- prompt_name: docs_general_answer +- log_context: graph.project_qa.docs.answer + +### Prompt Stats +```json +{ + "system_chars": 345, + "user_chars": 4499, + "tokens_in_estimate": 1211 +} +``` + +### System Prompt +```text +Ты отвечаешь на общий вопрос по документации проекта. + +На вход приходит JSON с полями: +- question +- intent +- sub_intent +- documents +- facts +- relations + +Правила: +- Используй только предоставленные документы и факты +- Не додумывай отсутствующие детали +- Если данных недостаточно, скажи это прямо +- Дай короткий понятный ответ без лишней структуры +``` + +### User Prompt +```json +{ + "question": "Что описано в документации?", + "intent": "GENERAL_QA", + "sub_intent": "GENERIC_QA", + "documents": [ + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/README.md", + "title": "Readme", + "content": "Readme", + "metadata": { + "name": "", + "tags": [], + "type": "", + "layer": "", + "links": [], + "owner": null, + "title": "Readme", + "doc_id": null, + "module": "", + "parent": null, + "status": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "81d952f1a6ea85b76f75e0e57f33b8fa4b2bf3cb7db11b91b90171aeedd655a6", + "children": [], + "doc_kind": "readme", + "entities": [], + "updated_at": null, + "doc_version": null, + "document_id": "docs/README.md", + "source_path": "docs/README.md", + "summary_text": "", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "HTTP API /actions/{action}", + "content": "Endpoint `/actions/{action}` управляет control actions runtime и поддерживает `start`, `stop` и `status`. Для долгих операций `start` и `stop` допускается ответ HTTP 202, если действие еще выполняется. Endpoint используется для operator-driven управления жизненным циклом worker'а через HTTP API.", + "metadata": { + "name": "control_actions_endpoint", + "tags": [ + "api", + "control-plane", + "lifecycle" + ], + "type": "api_method", + "layer": "application", + "links": [ + { + "type": "part_of", + "target": "architecture.telegram_notify_app" + }, + { + "type": "related_api", + "target": "api.health_endpoint" + }, + { + "type": "related_logic", + "target": "logic.telegram_notification_loop" + } + ], + "owner": null, + "title": "HTTP API /actions/{action}", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "architecture.telegram_notify_app", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "children": [], + "doc_kind": "misc", + "entities": [ + "TelegramControlChannel", + "ControlActionSet", + "JSONResponse" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "api.control_actions_endpoint", + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "summary_text": "Endpoint `/actions/{action}` управляет control actions runtime и поддерживает `start`, `stop` и `status`. Для долгих операций `start` и `stop` допускается ответ HTTP 202, если действие еще выполняется. Endpoint используется для operator-driven управления жизненным циклом worker'а через HTTP API.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + } + ], + "facts": [], + "entities": [], + "workflows": [], + "relations": [], + "chunks": [ + { + "layer": "D0_DOC_CHUNKS", + "path": "docs/README.md", + "title": "docs/README.md:Структура", + "content": "- `documentation/architecture/` — обзор архитектуры и ключевых компонентов.\n- `documentation/api/` — документация HTTP API control plane.\n- `documentation/logic/` — описание основных workflow и бизнес-логики.\n- `documentation/domain/` — описание ключевых сущностей и состояний.", + "metadata": { + "tags": [], + "type": null, + "order": 2, + "owner": null, + "doc_id": null, + "module": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "81d952f1a6ea85b76f75e0e57f33b8fa4b2bf3cb7db11b91b90171aeedd655a6", + "doc_kind": "readme", + "doc_version": null, + "document_id": "docs/README.md", + "source_path": "docs/README.md", + "section_path": "Project Docs > Структура", + "artifact_type": null, + "last_modified": null, + "section_title": "Структура", + "staleness_score": null, + "system_component": null + } + } + ] +} +``` + +### User Prompt Overview +- question: Что описано в документации? +- intent: GENERAL_QA +- sub_intent: GENERIC_QA +- documents: 2 | samples: Readme, HTTP API /actions/{action} +- facts: 0 +- relations: 0 + +## Mismatches +- none \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/docs_router_llm_disambiguation/20260326_150213/full_chain_docs_intents_v4-llm_v4-mixed.json b/tests/pipeline_setup_v3/test_results/docs_router_llm_disambiguation/20260326_150213/full_chain_docs_intents_v4-llm_v4-mixed.json new file mode 100644 index 0000000..a0f77d0 --- /dev/null +++ b/tests/pipeline_setup_v3/test_results/docs_router_llm_disambiguation/20260326_150213/full_chain_docs_intents_v4-llm_v4-mixed.json @@ -0,0 +1,85 @@ +{ + "meta": { + "case_id": "v4-mixed", + "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_03_docs/full_chain_docs_intents_v4-llm.yaml", + "runner": "agent_runtime", + "mode": "full_chain", + "passed": true, + "mismatches": [], + "actual": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "RELATED_DOCS_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START", + "rag_count": 14, + "llm_answer": "### Краткое описание\nОтправка сообщений через endpoint `/send` реализована в приложении Telegram Notify App. Этот endpoint является частью архитектуры данного приложения и зависит от логики обработки уведомлений.\n\n### Основные элементы\n- **Endpoint**: `/send`\n- **Приложение**: Telegram Notify App\n- **Логика обработки**: telegram_notification_loop\n\n### Как это работает\nEndpoint `/send` реализует отправку сообщений в рамках Telegram Notify App. Он использует логику обработки уведомлений (`telegram_notification_loop`) для выполнения своей функции.\n\n### Связи с другими частями системы\n- **Родительская архитектура**: architecture.telegram_notify_app\n- **Зависимости**: logic.telegram_notification_loop\n- **Связанные API**: api.send_message_endpoint (в контексте документации архитектуры Telegram Notify App)", + "answer_mode": "answered", + "path_scope": [], + "doc_scope": [ + "api.send_message_endpoint", + "architecture.telegram_notify_app_overview", + "logic.telegram_notification_loop", + "api.health_endpoint" + ], + "entity_candidates": [], + "symbol_candidates": [], + "layers": [ + "D5_RELATION_GRAPH", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "filters": { + "doc_type": null + }, + "pipeline_mode": "full", + "gate_decision": "allow", + "prompt_used": "docs_explain_answer", + "llm_mode": "graph_summary", + "degraded_reason": null, + "code_intents_stubbed": true + } + }, + "pipeline_steps": [ + { + "step": "input_query", + "input": { + "query": "Как работает /send и какие есть связанные документы?" + }, + "output": { + "query": "Как работает /send и какие есть связанные документы?" + } + }, + { + "step": "router", + "input": { + "query": "Как работает /send и какие есть связанные документы?" + }, + "output": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "RELATED_DOCS_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START" + } + }, + { + "step": "docs_pipeline", + "input": { + "query": "Как работает /send и какие есть связанные документы?" + }, + "output": { + "answer_mode": "answered", + "prompt_name": "docs_explain_answer", + "llm_request": { + "prompt_name": "docs_explain_answer", + "log_context": "graph.project_qa.docs.answer", + "prompt_stats": { + "system_chars": 393, + "user_chars": 5465, + "tokens_in_estimate": 1465 + } + }, + "degraded_reason": "" + } + } + ] +} \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/docs_router_llm_disambiguation/20260326_150213/full_chain_docs_intents_v4-llm_v4-mixed.md b/tests/pipeline_setup_v3/test_results/docs_router_llm_disambiguation/20260326_150213/full_chain_docs_intents_v4-llm_v4-mixed.md new file mode 100644 index 0000000..4829d9b --- /dev/null +++ b/tests/pipeline_setup_v3/test_results/docs_router_llm_disambiguation/20260326_150213/full_chain_docs_intents_v4-llm_v4-mixed.md @@ -0,0 +1,510 @@ +# v4-mixed + +- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_03_docs/full_chain_docs_intents_v4-llm.yaml +- runner: agent_runtime +- mode: full_chain +- passed: True + +## Query +Как работает /send и какие есть связанные документы? + +## Actual +{ + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "RELATED_DOCS_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START", + "rag_count": 14, + "llm_answer": "### Краткое описание\nОтправка сообщений через endpoint `/send` реализована в приложении Telegram Notify App. Этот endpoint является частью архитектуры данного приложения и зависит от логики обработки уведомлений.\n\n### Основные элементы\n- **Endpoint**: `/send`\n- **Приложение**: Telegram Notify App\n- **Логика обработки**: telegram_notification_loop\n\n### Как это работает\nEndpoint `/send` реализует отправку сообщений в рамках Telegram Notify App. Он использует логику обработки уведомлений (`telegram_notification_loop`) для выполнения своей функции.\n\n### Связи с другими частями системы\n- **Родительская архитектура**: architecture.telegram_notify_app\n- **Зависимости**: logic.telegram_notification_loop\n- **Связанные API**: api.send_message_endpoint (в контексте документации архитектуры Telegram Notify App)", + "answer_mode": "answered", + "path_scope": [], + "doc_scope": [ + "api.send_message_endpoint", + "architecture.telegram_notify_app_overview", + "logic.telegram_notification_loop", + "api.health_endpoint" + ], + "entity_candidates": [], + "symbol_candidates": [], + "layers": [ + "D5_RELATION_GRAPH", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "filters": { + "doc_type": null + }, + "pipeline_mode": "full", + "gate_decision": "allow", + "prompt_used": "docs_explain_answer", + "llm_mode": "graph_summary", + "degraded_reason": null, + "code_intents_stubbed": true +} + +## Pipeline Steps +### input_query +```json +{ + "input": { + "query": "Как работает /send и какие есть связанные документы?" + }, + "output": { + "query": "Как работает /send и какие есть связанные документы?" + } +} +``` + +### router +```json +{ + "input": { + "query": "Как работает /send и какие есть связанные документы?" + }, + "output": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "RELATED_DOCS_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START" + } +} +``` + +### docs_pipeline +```json +{ + "input": { + "query": "Как работает /send и какие есть связанные документы?" + }, + "output": { + "answer_mode": "answered", + "prompt_name": "docs_explain_answer", + "llm_request": { + "prompt_name": "docs_explain_answer", + "log_context": "graph.project_qa.docs.answer", + "prompt_stats": { + "system_chars": 393, + "user_chars": 5465, + "tokens_in_estimate": 1465 + } + }, + "degraded_reason": "" + } +} +``` + +## Diagnostics +{ + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "RELATED_DOCS_EXPLAIN", + "layers_used": [ + "D5_RELATION_GRAPH", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "documents_found": 0, + "facts_found": 0, + "relations_found": 4, + "openapi_fields_extracted": 0, + "missing_required_fields": [], + "openapi_status": { + "has_path": false, + "has_method": false, + "has_request": false, + "has_response": false + }, + "prompt_used": "docs_explain_answer", + "llm_mode": "graph_summary", + "output_valid": true, + "matched_intent_source": "deterministic", + "matched_anchor_type": "endpoint", + "matched_anchor_value": "/send", + "exact_anchor_match": false, + "docs_layers_requested": [ + "D5_RELATION_GRAPH", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "docs_layers_with_hits": [ + "D5_RELATION_GRAPH" + ], + "planned_layers": [ + "D5_RELATION_GRAPH", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "executed_layers": [ + "D5_RELATION_GRAPH" + ], + "non_empty_layers": [ + "D5_RELATION_GRAPH" + ], + "layer_diagnostics": { + "D5_RELATION_GRAPH": { + "hits": 8, + "top_ids": [ + "33eb0aa97f06d0afcaa4c230b5f5b73fa2fbfa5861ea9367b6c92f8a6fe0c054", + "53dbf99d1ed72fb30e988fa7080e6ec3d0028d2a1e896e4e818f2492cc161bf5", + "a5c452b6685216d12fc857cd5b10a19b347655b1f1fd9f59d64fd413e93e36a5", + "d3d3ce25ca6434582c9bbb8f94ab89c7a2a497f46f1124f7e335c217281d42d9", + "305bab0c6567d93a2b453a9d70b676f9ecd8de083ef36f5cf3398747c25ebf94" + ], + "top_sections": [ + "api.send_message_endpoint:parent", + "api.send_message_endpoint:depends_on", + "api.send_message_endpoint:part_of", + "architecture.telegram_notify_app:related_api", + "architecture.telegram_notify_app:child" + ] + }, + "D1_DOCUMENT_CATALOG": { + "hits": 0, + "top_ids": [], + "skipped": true, + "reason": "relation_primary_sufficient" + }, + "D0_DOC_CHUNKS": { + "hits": 6, + "top_ids": [ + "api.health_endpoint" + ], + "top_sections": [ + "api.health_endpoint:Summary", + "api.health_endpoint:Описание", + "api.health_endpoint:Сценарий", + "api.health_endpoint:Функциональные требования", + "api.health_endpoint:Нефункциональные требования" + ] + } + }, + "query_entity_candidates": [], + "resolved_entity_candidates": [], + "query_anchor_candidates": [ + "/send" + ], + "resolved_anchor_candidates": [ + "docs/documentation/api/send-message-endpoint.md", + "docs/documentation/architecture/telegram-notify-app-overview.md", + "docs/documentation/logic/telegram-notification-loop.md", + "docs/documentation/api/health-endpoint.md", + "api.health_endpoint" + ], + "anchor_candidates": [ + "api.send_message_endpoint", + "api.health_endpoint", + "architecture.telegram_notify_app_overview", + "logic.telegram_notification_loop" + ], + "selected_anchor": "api.send_message_endpoint", + "anchor_selection_reason": "doc_id matches requested endpoint slug", + "anchor_match_type": "exact_path", + "doc_ids": [ + "api.send_message_endpoint", + "architecture.telegram_notify_app_overview", + "logic.telegram_notification_loop", + "api.health_endpoint" + ], + "doc_paths": [ + "docs/documentation/api/send-message-endpoint.md", + "docs/documentation/architecture/telegram-notify-app-overview.md", + "docs/documentation/logic/telegram-notification-loop.md", + "docs/documentation/api/health-endpoint.md" + ], + "doc_titles": [ + "api.send_message_endpoint:parent", + "api.send_message_endpoint:depends_on", + "api.send_message_endpoint:part_of", + "architecture.telegram_notify_app:related_api", + "architecture.telegram_notify_app:child", + "logic.telegram_notification_loop:related_api", + "api.health_endpoint:depends_on", + "api.health_endpoint:part_of", + "api.health_endpoint:Summary", + "api.health_endpoint:Описание", + "api.health_endpoint:Сценарий", + "api.health_endpoint:Функциональные требования", + "api.health_endpoint:Нефункциональные требования", + "api.health_endpoint:Входные параметры" + ], + "relation_hits_count": 4, + "relation_targets": [ + "api.send_message_endpoint:parent", + "api.send_message_endpoint:depends_on", + "api.send_message_endpoint:part_of", + "architecture.telegram_notify_app:related_api" + ], + "selected_doc_ids": [], + "selected_fact_ids": [], + "selected_relation_ids": [ + "33eb0aa97f06d0afcaa4c230b5f5b73fa2fbfa5861ea9367b6c92f8a6fe0c054", + "53dbf99d1ed72fb30e988fa7080e6ec3d0028d2a1e896e4e818f2492cc161bf5", + "a5c452b6685216d12fc857cd5b10a19b347655b1f1fd9f59d64fd413e93e36a5", + "d3d3ce25ca6434582c9bbb8f94ab89c7a2a497f46f1124f7e335c217281d42d9" + ], + "selected_chunk_ids": [ + "api.health_endpoint" + ], + "selected_entity_ids": [], + "selected_workflow_ids": [], + "fallback_doc_hits_count": 1, + "fallback_used": true, + "fact_hits": 0, + "entity_hits": 0, + "evidence_summary": { + "documents": 0, + "facts": 0, + "entities": 0, + "workflows": 0, + "relations": 4, + "chunks": 1, + "selected_doc_ids": [], + "selected_fact_ids": [], + "selected_relation_ids": [ + "33eb0aa97f06d0afcaa4c230b5f5b73fa2fbfa5861ea9367b6c92f8a6fe0c054", + "53dbf99d1ed72fb30e988fa7080e6ec3d0028d2a1e896e4e818f2492cc161bf5", + "a5c452b6685216d12fc857cd5b10a19b347655b1f1fd9f59d64fd413e93e36a5", + "d3d3ce25ca6434582c9bbb8f94ab89c7a2a497f46f1124f7e335c217281d42d9" + ], + "selected_chunk_ids": [ + "api.health_endpoint" + ], + "entity_hits": 0, + "openapi_signals": { + "path_found": false, + "method_found": false, + "operation_semantics_found": false, + "request_payload_found": false, + "request_schema": false, + "request_fields_found": false, + "response_payload_found": false, + "response_schema": false, + "response_fields_found": false, + "status_codes": false, + "content_type_found": false, + "examples_found": false, + "payload_description": false + } + }, + "gate_decision": "allow", + "gate_decision_reason": "relation_evidence_available", + "gate_missing_requirements": [], + "gate_satisfied_requirements": [ + "retrieval_non_empty", + "exact_anchor_match" + ], + "openapi_evidence": { + "path_found": false, + "method_found": false, + "operation_semantics_found": false, + "request_payload_found": false, + "request_schema": false, + "request_fields_found": false, + "response_payload_found": false, + "response_schema": false, + "response_fields_found": false, + "status_codes": false, + "content_type_found": false, + "examples_found": false, + "payload_description": false + }, + "requested_fragment_type": null, + "fragment_evidence_found": [], + "fragment_missing_requirements": [], + "answer_mode": "answered", + "degrade_reason": null, + "degraded_reason": null, + "code_intents_stubbed": false +} + +## LLM Request +- prompt_name: docs_explain_answer +- log_context: graph.project_qa.docs.answer + +### Prompt Stats +```json +{ + "system_chars": 393, + "user_chars": 5465, + "tokens_in_estimate": 1465 +} +``` + +### System Prompt +```text +Ты объясняешь документацию системы. + +На вход приходит JSON с полями: +- question +- intent +- sub_intent +- documents +- facts +- relations + +Правила: +- Используй только предоставленные факты +- Не додумывай +- Если данных недостаточно, скажи это явно +- Объясняй структурировано + +Формат ответа: +1. Краткое описание +2. Основные элементы +3. Как это работает +4. Связи с другими частями системы (если есть) +``` + +### User Prompt +```json +{ + "question": "Как работает /send и какие есть связанные документы?", + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "RELATED_DOCS_EXPLAIN", + "documents": [], + "facts": [], + "entities": [], + "workflows": [], + "relations": [ + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/api/send-message-endpoint.md", + "title": "api.send_message_endpoint:parent", + "content": "api.send_message_endpoint parent architecture.telegram_notify_app", + "metadata": { + "owner": null, + "anchor": "frontmatter.parent", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "5fbf2e33510b0676a3a53b957a4569bd3c2c31fb7719546602c573421ccaa32d", + "source_id": "api.send_message_endpoint", + "target_id": "architecture.telegram_notify_app", + "doc_version": null, + "relation_id": "33eb0aa97f06d0afcaa4c230b5f5b73fa2fbfa5861ea9367b6c92f8a6fe0c054", + "source_path": "docs/documentation/api/send-message-endpoint.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "parent", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/api/send-message-endpoint.md", + "title": "api.send_message_endpoint:depends_on", + "content": "api.send_message_endpoint depends_on logic.telegram_notification_loop", + "metadata": { + "owner": null, + "anchor": "frontmatter.links", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "5fbf2e33510b0676a3a53b957a4569bd3c2c31fb7719546602c573421ccaa32d", + "source_id": "api.send_message_endpoint", + "target_id": "logic.telegram_notification_loop", + "doc_version": null, + "relation_id": "53dbf99d1ed72fb30e988fa7080e6ec3d0028d2a1e896e4e818f2492cc161bf5", + "source_path": "docs/documentation/api/send-message-endpoint.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "depends_on", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/api/send-message-endpoint.md", + "title": "api.send_message_endpoint:part_of", + "content": "api.send_message_endpoint part_of architecture.telegram_notify_app", + "metadata": { + "owner": null, + "anchor": "frontmatter.links", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "5fbf2e33510b0676a3a53b957a4569bd3c2c31fb7719546602c573421ccaa32d", + "source_id": "api.send_message_endpoint", + "target_id": "architecture.telegram_notify_app", + "doc_version": null, + "relation_id": "a5c452b6685216d12fc857cd5b10a19b347655b1f1fd9f59d64fd413e93e36a5", + "source_path": "docs/documentation/api/send-message-endpoint.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "part_of", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/architecture/telegram-notify-app-overview.md", + "title": "architecture.telegram_notify_app:related_api", + "content": "architecture.telegram_notify_app related_api api.send_message_endpoint", + "metadata": { + "owner": null, + "anchor": "frontmatter.links", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "8b1cc9f823e55bddbc825466d10a0fdb4ca4354ac02d91f9e2aef7b7d2ec8256", + "source_id": "architecture.telegram_notify_app", + "target_id": "api.send_message_endpoint", + "doc_version": null, + "relation_id": "d3d3ce25ca6434582c9bbb8f94ab89c7a2a497f46f1124f7e335c217281d42d9", + "source_path": "docs/documentation/architecture/telegram-notify-app-overview.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "related_api", + "staleness_score": null, + "system_component": null + } + } + ], + "chunks": [ + { + "layer": "D0_DOC_CHUNKS", + "path": "docs/documentation/api/health-endpoint.md", + "title": "api.health_endpoint:Summary", + "content": "Endpoint `/health` возвращает агрегированный health payload runtime. Если общий статус равен `ok`, API отвечает с HTTP 200; для состояний деградации или неготовности возвращается HTTP 503 с тем же payload. Endpoint служит основной точкой внешней проверки состояния приложения.", + "metadata": { + "tags": [ + "api", + "health", + "control-plane" + ], + "type": "api_method", + "order": 1, + "owner": null, + "doc_id": null, + "module": "telegram_notify_app", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "8b5a533a8076e2e9d36995eee29aeade260080bdca2ec8e21fe28f08574b983f", + "doc_kind": "misc", + "doc_version": null, + "document_id": "api.health_endpoint", + "source_path": "docs/documentation/api/health-endpoint.md", + "section_path": "Summary", + "artifact_type": null, + "last_modified": null, + "section_title": "Summary", + "staleness_score": null, + "system_component": null + } + } + ] +} +``` + +### User Prompt Overview +- question: Как работает /send и какие есть связанные документы? +- intent: DOCUMENTATION_EXPLAIN +- sub_intent: RELATED_DOCS_EXPLAIN +- documents: 0 +- facts: 0 +- relations: 4 | samples: api.send_message_endpoint:parent, api.send_message_endpoint:depends_on, api.send_message_endpoint:part_of + +## Mismatches +- none \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/docs_router_llm_disambiguation/20260326_150213/full_chain_docs_intents_v4-llm_v4-negative.json b/tests/pipeline_setup_v3/test_results/docs_router_llm_disambiguation/20260326_150213/full_chain_docs_intents_v4-llm_v4-negative.json new file mode 100644 index 0000000..756b2d4 --- /dev/null +++ b/tests/pipeline_setup_v3/test_results/docs_router_llm_disambiguation/20260326_150213/full_chain_docs_intents_v4-llm_v4-negative.json @@ -0,0 +1,89 @@ +{ + "meta": { + "case_id": "v4-negative", + "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_03_docs/full_chain_docs_intents_v4-llm.yaml", + "runner": "agent_runtime", + "mode": "full_chain", + "passed": true, + "mismatches": [], + "actual": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "ENTITY_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START", + "rag_count": 24, + "llm_answer": "К сожалению, на данный момент у меня нет информации о сущности PaymentTransaction в предоставленных вами данных.\n\nОднако я могу описать структуру и связи других элементов системы, основываясь на имеющихся данных:\n\n### 1. Краткое описание\nСистема включает несколько документов и метаданных, описывающих архитектуру, API, логику работы и ключевые сущности приложения.\n\n### 2. Основные элементы\n- **Документы**: Содержат информацию о структуре документации проекта и ссылки на различные разделы (архитектура, API, логика, доменные сущности).\n- **Сущности**: Включают ControlActionSet и JSONResponse, связанные с API и жизненным циклом управления приложением.\n- **Связи**: Определяют отношения между различными элементами системы, такими как часть архитектуры и связанные API.\n\n### 3. Как это работает\nДокументация организована по различным категориям, каждая из которых содержит специфическую информацию. Запросы к системе обрабатываются путем поиска соответствующих документов и сущностей, а также установления связей между ними для предоставления полной картины функционирования системы.\n\n### 4. Связи с другими частями системы\n- Документы связаны друг с другом через метаданные и структуры, что позволяет пользователям легко перемещаться между разными секциями документации.\n- Сущности связаны с документами, которые их описывают, и могут быть использованы для уточнения деталей реализации функций или методов.\n- Связи помогают определить, какие компоненты являются частью какого модуля и какие API взаимосвязаны.", + "answer_mode": "answered", + "path_scope": [], + "doc_scope": [ + "api.control_actions_endpoint", + "api.health_endpoint", + "api.send_message_endpoint", + "docs/README.md", + "api.actions_endpoint" + ], + "entity_candidates": [ + "PaymentTransaction" + ], + "symbol_candidates": [], + "layers": [ + "D3_ENTITY_CATALOG", + "D5_RELATION_GRAPH", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "filters": { + "doc_type": null + }, + "pipeline_mode": "full", + "gate_decision": "allow", + "prompt_used": "docs_explain_answer", + "llm_mode": "prose", + "degraded_reason": null, + "code_intents_stubbed": true + } + }, + "pipeline_steps": [ + { + "step": "input_query", + "input": { + "query": "Что такое PaymentTransaction?" + }, + "output": { + "query": "Что такое PaymentTransaction?" + } + }, + { + "step": "router", + "input": { + "query": "Что такое PaymentTransaction?" + }, + "output": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "ENTITY_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START" + } + }, + { + "step": "docs_pipeline", + "input": { + "query": "Что такое PaymentTransaction?" + }, + "output": { + "answer_mode": "answered", + "prompt_name": "docs_explain_answer", + "llm_request": { + "prompt_name": "docs_explain_answer", + "log_context": "graph.project_qa.docs.answer", + "prompt_stats": { + "system_chars": 393, + "user_chars": 6061, + "tokens_in_estimate": 1614 + } + }, + "degraded_reason": "" + } + } + ] +} \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/docs_router_llm_disambiguation/20260326_150213/full_chain_docs_intents_v4-llm_v4-negative.md b/tests/pipeline_setup_v3/test_results/docs_router_llm_disambiguation/20260326_150213/full_chain_docs_intents_v4-llm_v4-negative.md new file mode 100644 index 0000000..05c6fc7 --- /dev/null +++ b/tests/pipeline_setup_v3/test_results/docs_router_llm_disambiguation/20260326_150213/full_chain_docs_intents_v4-llm_v4-negative.md @@ -0,0 +1,598 @@ +# v4-negative + +- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_03_docs/full_chain_docs_intents_v4-llm.yaml +- runner: agent_runtime +- mode: full_chain +- passed: True + +## Query +Что такое PaymentTransaction? + +## Actual +{ + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "ENTITY_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START", + "rag_count": 24, + "llm_answer": "К сожалению, на данный момент у меня нет информации о сущности PaymentTransaction в предоставленных вами данных.\n\nОднако я могу описать структуру и связи других элементов системы, основываясь на имеющихся данных:\n\n### 1. Краткое описание\nСистема включает несколько документов и метаданных, описывающих архитектуру, API, логику работы и ключевые сущности приложения.\n\n### 2. Основные элементы\n- **Документы**: Содержат информацию о структуре документации проекта и ссылки на различные разделы (архитектура, API, логика, доменные сущности).\n- **Сущности**: Включают ControlActionSet и JSONResponse, связанные с API и жизненным циклом управления приложением.\n- **Связи**: Определяют отношения между различными элементами системы, такими как часть архитектуры и связанные API.\n\n### 3. Как это работает\nДокументация организована по различным категориям, каждая из которых содержит специфическую информацию. Запросы к системе обрабатываются путем поиска соответствующих документов и сущностей, а также установления связей между ними для предоставления полной картины функционирования системы.\n\n### 4. Связи с другими частями системы\n- Документы связаны друг с другом через метаданные и структуры, что позволяет пользователям легко перемещаться между разными секциями документации.\n- Сущности связаны с документами, которые их описывают, и могут быть использованы для уточнения деталей реализации функций или методов.\n- Связи помогают определить, какие компоненты являются частью какого модуля и какие API взаимосвязаны.", + "answer_mode": "answered", + "path_scope": [], + "doc_scope": [ + "api.control_actions_endpoint", + "api.health_endpoint", + "api.send_message_endpoint", + "docs/README.md", + "api.actions_endpoint" + ], + "entity_candidates": [ + "PaymentTransaction" + ], + "symbol_candidates": [], + "layers": [ + "D3_ENTITY_CATALOG", + "D5_RELATION_GRAPH", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "filters": { + "doc_type": null + }, + "pipeline_mode": "full", + "gate_decision": "allow", + "prompt_used": "docs_explain_answer", + "llm_mode": "prose", + "degraded_reason": null, + "code_intents_stubbed": true +} + +## Pipeline Steps +### input_query +```json +{ + "input": { + "query": "Что такое PaymentTransaction?" + }, + "output": { + "query": "Что такое PaymentTransaction?" + } +} +``` + +### router +```json +{ + "input": { + "query": "Что такое PaymentTransaction?" + }, + "output": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "ENTITY_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START" + } +} +``` + +### docs_pipeline +```json +{ + "input": { + "query": "Что такое PaymentTransaction?" + }, + "output": { + "answer_mode": "answered", + "prompt_name": "docs_explain_answer", + "llm_request": { + "prompt_name": "docs_explain_answer", + "log_context": "graph.project_qa.docs.answer", + "prompt_stats": { + "system_chars": 393, + "user_chars": 6061, + "tokens_in_estimate": 1614 + } + }, + "degraded_reason": "" + } +} +``` + +## Diagnostics +{ + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "ENTITY_EXPLAIN", + "layers_used": [ + "D3_ENTITY_CATALOG", + "D5_RELATION_GRAPH", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "documents_found": 1, + "facts_found": 0, + "relations_found": 2, + "openapi_fields_extracted": 0, + "missing_required_fields": [], + "openapi_status": { + "has_path": false, + "has_method": false, + "has_request": false, + "has_response": false + }, + "prompt_used": "docs_explain_answer", + "llm_mode": "prose", + "output_valid": true, + "matched_intent_source": "deterministic", + "matched_anchor_type": "none", + "matched_anchor_value": null, + "exact_anchor_match": false, + "docs_layers_requested": [ + "D3_ENTITY_CATALOG", + "D5_RELATION_GRAPH", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "docs_layers_with_hits": [ + "D3_ENTITY_CATALOG", + "D5_RELATION_GRAPH", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "planned_layers": [ + "D3_ENTITY_CATALOG", + "D5_RELATION_GRAPH", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "executed_layers": [ + "D3_ENTITY_CATALOG", + "D5_RELATION_GRAPH", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "non_empty_layers": [ + "D3_ENTITY_CATALOG", + "D5_RELATION_GRAPH", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "layer_diagnostics": { + "D3_ENTITY_CATALOG": { + "hits": 8, + "top_ids": [ + "api.control_actions_endpoint", + "api.health_endpoint" + ], + "top_sections": [ + "ControlActionSet", + "JSONResponse", + "TelegramControlChannel", + "TelegramNotifyWorker", + "RuntimeManager" + ] + }, + "D5_RELATION_GRAPH": { + "hits": 8, + "top_ids": [ + "5f4909bde905cd3d294ad307074a05e4ae4deefcafe6272cd2d0436e73acb8dd", + "711fb2edb82dd222deaba3c91768b18cbbd453009235823282813c6e867dc2c1", + "eec79f7a02b804337e791ef231784862ae26e0599eb20224790e9d4f085fa9c0", + "c718b1939621233295ccaf6e8203e7fd94f3dd1bfb88f10c51bc5e33d53a24aa", + "616f5cbf25da83cb51d8d0741a7fc351620c9ca2c6513fa2094b4aa476f0912a" + ], + "top_sections": [ + "api.control_actions_endpoint:part_of", + "api.control_actions_endpoint:related_api", + "api.control_actions_endpoint:related_logic", + "api.health_endpoint:parent", + "api.health_endpoint:part_of" + ] + }, + "D1_DOCUMENT_CATALOG": { + "hits": 4, + "top_ids": [ + "docs/README.md", + "api.control_actions_endpoint", + "api.health_endpoint", + "api.send_message_endpoint" + ], + "top_sections": [ + "Readme", + "HTTP API /actions/{action}", + "HTTP API /health", + "HTTP API /send" + ] + }, + "D0_DOC_CHUNKS": { + "hits": 4, + "top_ids": [ + "docs/README.md" + ], + "top_sections": [ + "docs/README.md:Структура", + "docs/README.md:Навигация", + "docs/README.md:Правила и шаблоны", + "docs/README.md:Project Docs" + ] + } + }, + "query_entity_candidates": [ + "PaymentTransaction" + ], + "resolved_entity_candidates": [], + "query_anchor_candidates": [ + "PaymentTransaction" + ], + "resolved_anchor_candidates": [ + "api.control_actions_endpoint", + "docs/documentation/api/control-actions-endpoint.md", + "api.health_endpoint", + "docs/documentation/api/health-endpoint.md", + "api.send_message_endpoint", + "docs/documentation/api/send-message-endpoint.md", + "docs/README.md" + ], + "anchor_candidates": [], + "selected_anchor": null, + "anchor_selection_reason": "", + "anchor_match_type": "", + "doc_ids": [ + "api.control_actions_endpoint", + "api.health_endpoint", + "api.send_message_endpoint", + "docs/README.md", + "api.actions_endpoint" + ], + "doc_paths": [ + "docs/documentation/api/control-actions-endpoint.md", + "docs/documentation/api/health-endpoint.md", + "docs/documentation/api/send-message-endpoint.md", + "docs/README.md" + ], + "doc_titles": [ + "ControlActionSet", + "JSONResponse", + "TelegramControlChannel", + "TelegramNotifyWorker", + "RuntimeManager", + "WorkerHealth", + "TelegramControlAppFactory", + "api.control_actions_endpoint:part_of", + "api.control_actions_endpoint:related_api", + "api.control_actions_endpoint:related_logic", + "api.health_endpoint:parent", + "api.health_endpoint:part_of", + "api.health_endpoint:depends_on", + "api.send_message_endpoint:parent", + "api.control_actions_endpoint:parent", + "Readme", + "HTTP API /actions/{action}", + "HTTP API /health", + "HTTP API /send", + "docs/README.md:Структура", + "docs/README.md:Навигация", + "docs/README.md:Правила и шаблоны", + "docs/README.md:Project Docs" + ], + "relation_hits_count": 2, + "relation_targets": [ + "api.control_actions_endpoint:part_of", + "api.control_actions_endpoint:related_api" + ], + "selected_doc_ids": [ + "docs/README.md", + "api.control_actions_endpoint" + ], + "selected_fact_ids": [], + "selected_relation_ids": [ + "5f4909bde905cd3d294ad307074a05e4ae4deefcafe6272cd2d0436e73acb8dd", + "711fb2edb82dd222deaba3c91768b18cbbd453009235823282813c6e867dc2c1" + ], + "selected_chunk_ids": [ + "docs/README.md" + ], + "selected_entity_ids": [ + "api.control_actions_endpoint" + ], + "selected_workflow_ids": [], + "fallback_doc_hits_count": 2, + "fallback_used": false, + "fact_hits": 0, + "entity_hits": 0, + "evidence_summary": { + "documents": 1, + "facts": 0, + "entities": 2, + "workflows": 0, + "relations": 2, + "chunks": 1, + "selected_doc_ids": [ + "docs/README.md", + "api.control_actions_endpoint" + ], + "selected_fact_ids": [], + "selected_relation_ids": [ + "5f4909bde905cd3d294ad307074a05e4ae4deefcafe6272cd2d0436e73acb8dd", + "711fb2edb82dd222deaba3c91768b18cbbd453009235823282813c6e867dc2c1" + ], + "selected_chunk_ids": [ + "docs/README.md" + ], + "entity_hits": 0, + "openapi_signals": { + "path_found": false, + "method_found": false, + "operation_semantics_found": false, + "request_payload_found": false, + "request_schema": false, + "request_fields_found": false, + "response_payload_found": false, + "response_schema": false, + "response_fields_found": false, + "status_codes": false, + "content_type_found": false, + "examples_found": false, + "payload_description": false + } + }, + "gate_decision": "allow", + "gate_decision_reason": "evidence_sufficient", + "gate_missing_requirements": [], + "gate_satisfied_requirements": [ + "retrieval_non_empty" + ], + "openapi_evidence": { + "path_found": false, + "method_found": false, + "operation_semantics_found": false, + "request_payload_found": false, + "request_schema": false, + "request_fields_found": false, + "response_payload_found": false, + "response_schema": false, + "response_fields_found": false, + "status_codes": false, + "content_type_found": false, + "examples_found": false, + "payload_description": false + }, + "requested_fragment_type": null, + "fragment_evidence_found": [], + "fragment_missing_requirements": [], + "answer_mode": "answered", + "degrade_reason": null, + "degraded_reason": null, + "code_intents_stubbed": false +} + +## LLM Request +- prompt_name: docs_explain_answer +- log_context: graph.project_qa.docs.answer + +### Prompt Stats +```json +{ + "system_chars": 393, + "user_chars": 6061, + "tokens_in_estimate": 1614 +} +``` + +### System Prompt +```text +Ты объясняешь документацию системы. + +На вход приходит JSON с полями: +- question +- intent +- sub_intent +- documents +- facts +- relations + +Правила: +- Используй только предоставленные факты +- Не додумывай +- Если данных недостаточно, скажи это явно +- Объясняй структурировано + +Формат ответа: +1. Краткое описание +2. Основные элементы +3. Как это работает +4. Связи с другими частями системы (если есть) +``` + +### User Prompt +```json +{ + "question": "Что такое PaymentTransaction?", + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "ENTITY_EXPLAIN", + "documents": [ + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/README.md", + "title": "Readme", + "content": "Readme", + "metadata": { + "name": "", + "tags": [], + "type": "", + "layer": "", + "links": [], + "owner": null, + "title": "Readme", + "doc_id": null, + "module": "", + "parent": null, + "status": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "81d952f1a6ea85b76f75e0e57f33b8fa4b2bf3cb7db11b91b90171aeedd655a6", + "children": [], + "doc_kind": "readme", + "entities": [], + "updated_at": null, + "doc_version": null, + "document_id": "docs/README.md", + "source_path": "docs/README.md", + "summary_text": "", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + } + ], + "facts": [], + "entities": [ + { + "layer": "D3_ENTITY_CATALOG", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "ControlActionSet", + "content": "ControlActionSet", + "metadata": { + "tags": [ + "api", + "control-plane", + "lifecycle" + ], + "owner": null, + "doc_id": null, + "module": "telegram_notify_app", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "doc_version": null, + "document_id": "api.control_actions_endpoint", + "entity_name": "ControlActionSet", + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "artifact_type": null, + "document_type": "api_method", + "last_modified": null, + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D3_ENTITY_CATALOG", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "JSONResponse", + "content": "JSONResponse", + "metadata": { + "tags": [ + "api", + "control-plane", + "lifecycle" + ], + "owner": null, + "doc_id": null, + "module": "telegram_notify_app", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "doc_version": null, + "document_id": "api.control_actions_endpoint", + "entity_name": "JSONResponse", + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "artifact_type": null, + "document_type": "api_method", + "last_modified": null, + "staleness_score": null, + "system_component": null + } + } + ], + "workflows": [], + "relations": [ + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "api.control_actions_endpoint:part_of", + "content": "api.control_actions_endpoint part_of architecture.telegram_notify_app", + "metadata": { + "owner": null, + "anchor": "frontmatter.links", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "source_id": "api.control_actions_endpoint", + "target_id": "architecture.telegram_notify_app", + "doc_version": null, + "relation_id": "5f4909bde905cd3d294ad307074a05e4ae4deefcafe6272cd2d0436e73acb8dd", + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "part_of", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "api.control_actions_endpoint:related_api", + "content": "api.control_actions_endpoint related_api api.health_endpoint", + "metadata": { + "owner": null, + "anchor": "frontmatter.links", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "source_id": "api.control_actions_endpoint", + "target_id": "api.health_endpoint", + "doc_version": null, + "relation_id": "711fb2edb82dd222deaba3c91768b18cbbd453009235823282813c6e867dc2c1", + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "related_api", + "staleness_score": null, + "system_component": null + } + } + ], + "chunks": [ + { + "layer": "D0_DOC_CHUNKS", + "path": "docs/README.md", + "title": "docs/README.md:Структура", + "content": "- `documentation/architecture/` — обзор архитектуры и ключевых компонентов.\n- `documentation/api/` — документация HTTP API control plane.\n- `documentation/logic/` — описание основных workflow и бизнес-логики.\n- `documentation/domain/` — описание ключевых сущностей и состояний.", + "metadata": { + "tags": [], + "type": null, + "order": 2, + "owner": null, + "doc_id": null, + "module": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "81d952f1a6ea85b76f75e0e57f33b8fa4b2bf3cb7db11b91b90171aeedd655a6", + "doc_kind": "readme", + "doc_version": null, + "document_id": "docs/README.md", + "source_path": "docs/README.md", + "section_path": "Project Docs > Структура", + "artifact_type": null, + "last_modified": null, + "section_title": "Структура", + "staleness_score": null, + "system_component": null + } + } + ] +} +``` + +### User Prompt Overview +- question: Что такое PaymentTransaction? +- intent: DOCUMENTATION_EXPLAIN +- sub_intent: ENTITY_EXPLAIN +- documents: 1 | samples: Readme +- facts: 0 +- relations: 2 | samples: api.control_actions_endpoint:part_of, api.control_actions_endpoint:related_api + +## Mismatches +- none \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/docs_router_llm_disambiguation/20260326_150213/full_chain_docs_intents_v4-llm_v4-openapi-fragment.json b/tests/pipeline_setup_v3/test_results/docs_router_llm_disambiguation/20260326_150213/full_chain_docs_intents_v4-llm_v4-openapi-fragment.json new file mode 100644 index 0000000..f45db01 --- /dev/null +++ b/tests/pipeline_setup_v3/test_results/docs_router_llm_disambiguation/20260326_150213/full_chain_docs_intents_v4-llm_v4-openapi-fragment.json @@ -0,0 +1,82 @@ +{ + "meta": { + "case_id": "v4-openapi-fragment", + "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_03_docs/full_chain_docs_intents_v4-llm.yaml", + "runner": "agent_runtime", + "mode": "full_chain", + "passed": true, + "mismatches": [], + "actual": { + "intent": "OPENAPI_GENERATION", + "sub_intent": "OPENAPI_FRAGMENT_GENERATE", + "graph_id": "DocsQAGraph", + "conversation_mode": "START", + "rag_count": 1, + "llm_answer": "requestBody:\n content:\n application/json:\n schema:\n type: object\n properties:\n chatId:\n type: string\n description: Идентификатор чата Telegram, куда отправляется сообщение\n messageText:\n type: string\n description: Текст сообщения, которое будет отправлено\n required:\n - chatId\n - messageText", + "answer_mode": "structured_spec_partial", + "path_scope": [], + "doc_scope": [ + "api.send_message_endpoint" + ], + "entity_candidates": [], + "symbol_candidates": [], + "layers": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D0_DOC_CHUNKS" + ], + "filters": { + "doc_type": "api_method" + }, + "pipeline_mode": "full", + "gate_decision": "partial", + "prompt_used": "docs_openapi_fragment_answer", + "llm_mode": "yaml", + "degraded_reason": "answered_with_gaps", + "code_intents_stubbed": true + } + }, + "pipeline_steps": [ + { + "step": "input_query", + "input": { + "query": "Сгенерируй request schema для endpoint /send" + }, + "output": { + "query": "Сгенерируй request schema для endpoint /send" + } + }, + { + "step": "router", + "input": { + "query": "Сгенерируй request schema для endpoint /send" + }, + "output": { + "intent": "OPENAPI_GENERATION", + "sub_intent": "OPENAPI_FRAGMENT_GENERATE", + "graph_id": "DocsQAGraph", + "conversation_mode": "START" + } + }, + { + "step": "docs_pipeline", + "input": { + "query": "Сгенерируй request schema для endpoint /send" + }, + "output": { + "answer_mode": "structured_spec_partial", + "prompt_name": "docs_openapi_fragment_answer", + "llm_request": { + "prompt_name": "docs_openapi_fragment_answer", + "log_context": "graph.project_qa.docs.openapi", + "prompt_stats": { + "system_chars": 319, + "user_chars": 3138, + "tokens_in_estimate": 865 + } + }, + "degraded_reason": "answered_with_gaps" + } + } + ] +} \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/docs_router_llm_disambiguation/20260326_150213/full_chain_docs_intents_v4-llm_v4-openapi-fragment.md b/tests/pipeline_setup_v3/test_results/docs_router_llm_disambiguation/20260326_150213/full_chain_docs_intents_v4-llm_v4-openapi-fragment.md new file mode 100644 index 0000000..066450e --- /dev/null +++ b/tests/pipeline_setup_v3/test_results/docs_router_llm_disambiguation/20260326_150213/full_chain_docs_intents_v4-llm_v4-openapi-fragment.md @@ -0,0 +1,444 @@ +# v4-openapi-fragment + +- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_03_docs/full_chain_docs_intents_v4-llm.yaml +- runner: agent_runtime +- mode: full_chain +- passed: True + +## Query +Сгенерируй request schema для endpoint /send + +## Actual +{ + "intent": "OPENAPI_GENERATION", + "sub_intent": "OPENAPI_FRAGMENT_GENERATE", + "graph_id": "DocsQAGraph", + "conversation_mode": "START", + "rag_count": 1, + "llm_answer": "requestBody:\n content:\n application/json:\n schema:\n type: object\n properties:\n chatId:\n type: string\n description: Идентификатор чата Telegram, куда отправляется сообщение\n messageText:\n type: string\n description: Текст сообщения, которое будет отправлено\n required:\n - chatId\n - messageText", + "answer_mode": "structured_spec_partial", + "path_scope": [], + "doc_scope": [ + "api.send_message_endpoint" + ], + "entity_candidates": [], + "symbol_candidates": [], + "layers": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D0_DOC_CHUNKS" + ], + "filters": { + "doc_type": "api_method" + }, + "pipeline_mode": "full", + "gate_decision": "partial", + "prompt_used": "docs_openapi_fragment_answer", + "llm_mode": "yaml", + "degraded_reason": "answered_with_gaps", + "code_intents_stubbed": true +} + +## Pipeline Steps +### input_query +```json +{ + "input": { + "query": "Сгенерируй request schema для endpoint /send" + }, + "output": { + "query": "Сгенерируй request schema для endpoint /send" + } +} +``` + +### router +```json +{ + "input": { + "query": "Сгенерируй request schema для endpoint /send" + }, + "output": { + "intent": "OPENAPI_GENERATION", + "sub_intent": "OPENAPI_FRAGMENT_GENERATE", + "graph_id": "DocsQAGraph", + "conversation_mode": "START" + } +} +``` + +### docs_pipeline +```json +{ + "input": { + "query": "Сгенерируй request schema для endpoint /send" + }, + "output": { + "answer_mode": "structured_spec_partial", + "prompt_name": "docs_openapi_fragment_answer", + "llm_request": { + "prompt_name": "docs_openapi_fragment_answer", + "log_context": "graph.project_qa.docs.openapi", + "prompt_stats": { + "system_chars": 319, + "user_chars": 3138, + "tokens_in_estimate": 865 + } + }, + "degraded_reason": "answered_with_gaps" + } +} +``` + +## Diagnostics +{ + "intent": "OPENAPI_GENERATION", + "sub_intent": "OPENAPI_FRAGMENT_GENERATE", + "layers_used": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D0_DOC_CHUNKS" + ], + "documents_found": 1, + "facts_found": 0, + "relations_found": 0, + "openapi_fields_extracted": 0, + "missing_required_fields": [ + "request_schema" + ], + "openapi_status": { + "has_path": true, + "has_method": false, + "has_request": false, + "has_response": false + }, + "prompt_used": "docs_openapi_fragment_answer", + "llm_mode": "yaml", + "output_valid": true, + "matched_intent_source": "deterministic", + "matched_anchor_type": "endpoint", + "matched_anchor_value": "/send", + "exact_anchor_match": true, + "docs_layers_requested": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D0_DOC_CHUNKS" + ], + "docs_layers_with_hits": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D0_DOC_CHUNKS" + ], + "planned_layers": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D0_DOC_CHUNKS" + ], + "executed_layers": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D0_DOC_CHUNKS" + ], + "non_empty_layers": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D0_DOC_CHUNKS" + ], + "layer_diagnostics": { + "D1_DOCUMENT_CATALOG": { + "hits": 7, + "top_ids": [ + "api.send_message_endpoint", + "api.control_actions_endpoint", + "api.health_endpoint", + "architecture.telegram_notify_app", + "docs/README.md" + ], + "top_sections": [ + "HTTP API /send", + "HTTP API /actions/{action}", + "HTTP API /health", + "Архитектура Telegram Notify App", + "Readme" + ] + }, + "D2_FACT_INDEX": { + "hits": 8, + "top_ids": [ + "f85d982c272a2ee6baeadc433221a20e684cd8ef01cb4788d6f76d05ca56d6d0", + "b8e44c3adb74aaa6c91ae8815fa091289e58dd3990a3a1b63e850c62075aea75", + "bafb867ffed41c9db637df98d6cd5f6722d7747bbebc6c03e6f0d0caf3b7f9f3", + "54bbcbac242f1c85ec3280236ed5841998a8a3a548ff16cbf0b5acafbff469e3", + "b6bfad59b3bf00f199b5ef90c1208af19664de700413e7354468a93a4abaaa2f" + ], + "top_sections": [ + "api.control_actions_endpoint:workflow_step", + "api.control_actions_endpoint:mentions_entity" + ] + }, + "D0_DOC_CHUNKS": { + "hits": 6, + "top_ids": [ + "api.control_actions_endpoint" + ], + "top_sections": [ + "api.control_actions_endpoint:Функциональные требования", + "api.control_actions_endpoint:Нефункциональные требования", + "api.control_actions_endpoint:Сценарий", + "api.control_actions_endpoint:Summary", + "api.control_actions_endpoint:Описание" + ] + } + }, + "query_entity_candidates": [], + "resolved_entity_candidates": [], + "query_anchor_candidates": [ + "/send" + ], + "resolved_anchor_candidates": [ + "api.send_message_endpoint", + "docs/documentation/api/send-message-endpoint.md" + ], + "anchor_candidates": [], + "selected_anchor": null, + "anchor_selection_reason": "", + "anchor_match_type": "", + "doc_ids": [ + "api.send_message_endpoint" + ], + "doc_paths": [ + "docs/documentation/api/send-message-endpoint.md" + ], + "doc_titles": [ + "HTTP API /send" + ], + "relation_hits_count": 0, + "relation_targets": [], + "selected_doc_ids": [ + "api.send_message_endpoint" + ], + "selected_fact_ids": [], + "selected_relation_ids": [], + "selected_chunk_ids": [], + "selected_entity_ids": [], + "selected_workflow_ids": [], + "fallback_doc_hits_count": 1, + "fallback_used": false, + "fact_hits": 0, + "entity_hits": 0, + "evidence_summary": { + "documents": 1, + "facts": 0, + "entities": 0, + "workflows": 0, + "relations": 0, + "chunks": 0, + "selected_doc_ids": [ + "api.send_message_endpoint" + ], + "selected_fact_ids": [], + "selected_relation_ids": [], + "selected_chunk_ids": [], + "entity_hits": 0, + "openapi_signals": { + "path_found": true, + "method_found": false, + "operation_semantics_found": true, + "request_payload_found": false, + "request_schema": false, + "request_fields_found": false, + "response_payload_found": false, + "response_schema": false, + "response_fields_found": false, + "status_codes": false, + "content_type_found": false, + "examples_found": false, + "payload_description": true + } + }, + "gate_decision": "partial", + "gate_decision_reason": "answered_with_gaps", + "gate_missing_requirements": [ + "http_method_found", + "contract_fields_found", + "status_codes_found" + ], + "gate_satisfied_requirements": [ + "retrieval_non_empty", + "exact_anchor_match", + "path_found", + "operation_semantics_found", + "payload_description_found", + "api_method_filter" + ], + "openapi_evidence": { + "path_found": true, + "method_found": false, + "operation_semantics_found": true, + "request_payload_found": false, + "request_schema": false, + "request_fields_found": false, + "response_payload_found": false, + "response_schema": false, + "response_fields_found": false, + "status_codes": false, + "content_type_found": false, + "examples_found": false, + "payload_description": true + }, + "requested_fragment_type": "request_schema", + "fragment_evidence_found": [ + "path", + "operation_semantics", + "payload_description" + ], + "fragment_missing_requirements": [], + "answer_mode": "structured_spec_partial", + "degrade_reason": "answered_with_gaps", + "degraded_reason": "answered_with_gaps", + "code_intents_stubbed": false +} + +## LLM Request +- prompt_name: docs_openapi_fragment_answer +- log_context: graph.project_qa.docs.openapi + +### Prompt Stats +```json +{ + "system_chars": 319, + "user_chars": 3138, + "tokens_in_estimate": 865 +} +``` + +### System Prompt +```text +Ты генерируешь часть OpenAPI schema по документации API. + +На вход приходит JSON с полями: +- question +- intent +- sub_intent +- documents +- facts +- relations +- api_contract + +Правила: +- Только schema +- Без полного OpenAPI документа +- Используй только данные из payload +- Не придумывай поля +- Верни ТОЛЬКО YAML без пояснений +``` + +### User Prompt +```json +{ + "question": "Сгенерируй request schema для endpoint /send", + "intent": "OPENAPI_GENERATION", + "sub_intent": "OPENAPI_FRAGMENT_GENERATE", + "documents": [ + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/api/send-message-endpoint.md", + "title": "HTTP API /send", + "content": "Endpoint `/send` выполняет ручную отправку сообщения в Telegram через `TelegramSendService`. Он используется для операторской проверки доставки и для отправки уведомлений вне периодического worker loop. Endpoint работает поверх тех же credentials и того же delivery path, что и фоновая отправка.", + "metadata": { + "name": "send_message_endpoint", + "tags": [ + "api", + "telegram", + "manual-send" + ], + "type": "api_method", + "layer": "application", + "links": [ + { + "type": "part_of", + "target": "architecture.telegram_notify_app" + }, + { + "type": "depends_on", + "target": "logic.telegram_notification_loop" + } + ], + "owner": null, + "title": "HTTP API /send", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "architecture.telegram_notify_app", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "5fbf2e33510b0676a3a53b957a4569bd3c2c31fb7719546602c573421ccaa32d", + "children": [], + "doc_kind": "misc", + "entities": [ + "TelegramControlAppFactory", + "TelegramSendService", + "TelegramNotifyWorker" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "api.send_message_endpoint", + "source_path": "docs/documentation/api/send-message-endpoint.md", + "summary_text": "Endpoint `/send` выполняет ручную отправку сообщения в Telegram через `TelegramSendService`. Он используется для операторской проверки доставки и для отправки уведомлений вне периодического worker loop. Endpoint работает поверх тех же credentials и того же delivery path, что и фоновая отправка.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + } + ], + "facts": [], + "entities": [], + "workflows": [], + "relations": [], + "chunks": [], + "api_contract": { + "path": "/send", + "method": "", + "request_schema": null, + "response_schema": null, + "diagnostics": { + "has_path": true, + "has_method": false, + "has_request": false, + "has_response": false, + "operation_semantics_found": true, + "request_payload_found": false, + "request_fields_found": false, + "response_payload_found": false, + "response_fields_found": false, + "status_codes_found": false, + "content_type_found": false, + "examples_found": false, + "payload_description_found": true, + "status_codes": [], + "content_type": "", + "operation_summary": "HTTP API /send", + "missing_required_fields": [ + "request_schema" + ] + } + } +} +``` + +### User Prompt Overview +- question: Сгенерируй request schema для endpoint /send +- intent: OPENAPI_GENERATION +- sub_intent: OPENAPI_FRAGMENT_GENERATE +- documents: 1 | samples: HTTP API /send +- facts: 0 +- relations: 0 +- api_contract: + path: /send + method: — + has_request_schema: False + has_response_schema: False + +## Mismatches +- none \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/docs_router_llm_disambiguation/20260326_150213/full_chain_docs_intents_v4-llm_v4-openapi-method.json b/tests/pipeline_setup_v3/test_results/docs_router_llm_disambiguation/20260326_150213/full_chain_docs_intents_v4-llm_v4-openapi-method.json new file mode 100644 index 0000000..db83301 --- /dev/null +++ b/tests/pipeline_setup_v3/test_results/docs_router_llm_disambiguation/20260326_150213/full_chain_docs_intents_v4-llm_v4-openapi-method.json @@ -0,0 +1,84 @@ +{ + "meta": { + "case_id": "v4-openapi-method", + "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_03_docs/full_chain_docs_intents_v4-llm.yaml", + "runner": "agent_runtime", + "mode": "full_chain", + "passed": true, + "mismatches": [], + "actual": { + "intent": "OPENAPI_GENERATION", + "sub_intent": "OPENAPI_METHOD_GENERATE", + "graph_id": "DocsQAGraph", + "conversation_mode": "START", + "rag_count": 1, + "llm_answer": "paths:\n /health:\n get:\n summary: HTTP API /health\n responses:\n '200':\n description: Общий статус равен `ok`\n '503':\n description: Состояния деградации или неготовности", + "answer_mode": "structured_spec_partial", + "path_scope": [], + "doc_scope": [ + "api.health_endpoint" + ], + "entity_candidates": [ + "OpenAPI" + ], + "symbol_candidates": [], + "layers": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D0_DOC_CHUNKS" + ], + "filters": { + "doc_type": "api_method" + }, + "pipeline_mode": "full", + "gate_decision": "partial", + "prompt_used": "docs_openapi_answer", + "llm_mode": "yaml", + "degraded_reason": "answered_with_gaps", + "code_intents_stubbed": true + } + }, + "pipeline_steps": [ + { + "step": "input_query", + "input": { + "query": "Сгенерируй OpenAPI для endpoint /health" + }, + "output": { + "query": "Сгенерируй OpenAPI для endpoint /health" + } + }, + { + "step": "router", + "input": { + "query": "Сгенерируй OpenAPI для endpoint /health" + }, + "output": { + "intent": "OPENAPI_GENERATION", + "sub_intent": "OPENAPI_METHOD_GENERATE", + "graph_id": "DocsQAGraph", + "conversation_mode": "START" + } + }, + { + "step": "docs_pipeline", + "input": { + "query": "Сгенерируй OpenAPI для endpoint /health" + }, + "output": { + "answer_mode": "structured_spec_partial", + "prompt_name": "docs_openapi_answer", + "llm_request": { + "prompt_name": "docs_openapi_answer", + "log_context": "graph.project_qa.docs.openapi", + "prompt_stats": { + "system_chars": 399, + "user_chars": 3110, + "tokens_in_estimate": 878 + } + }, + "degraded_reason": "answered_with_gaps" + } + } + ] +} \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/docs_router_llm_disambiguation/20260326_150213/full_chain_docs_intents_v4-llm_v4-openapi-method.md b/tests/pipeline_setup_v3/test_results/docs_router_llm_disambiguation/20260326_150213/full_chain_docs_intents_v4-llm_v4-openapi-method.md new file mode 100644 index 0000000..dcc0f64 --- /dev/null +++ b/tests/pipeline_setup_v3/test_results/docs_router_llm_disambiguation/20260326_150213/full_chain_docs_intents_v4-llm_v4-openapi-method.md @@ -0,0 +1,457 @@ +# v4-openapi-method + +- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_03_docs/full_chain_docs_intents_v4-llm.yaml +- runner: agent_runtime +- mode: full_chain +- passed: True + +## Query +Сгенерируй OpenAPI для endpoint /health + +## Actual +{ + "intent": "OPENAPI_GENERATION", + "sub_intent": "OPENAPI_METHOD_GENERATE", + "graph_id": "DocsQAGraph", + "conversation_mode": "START", + "rag_count": 1, + "llm_answer": "paths:\n /health:\n get:\n summary: HTTP API /health\n responses:\n '200':\n description: Общий статус равен `ok`\n '503':\n description: Состояния деградации или неготовности", + "answer_mode": "structured_spec_partial", + "path_scope": [], + "doc_scope": [ + "api.health_endpoint" + ], + "entity_candidates": [ + "OpenAPI" + ], + "symbol_candidates": [], + "layers": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D0_DOC_CHUNKS" + ], + "filters": { + "doc_type": "api_method" + }, + "pipeline_mode": "full", + "gate_decision": "partial", + "prompt_used": "docs_openapi_answer", + "llm_mode": "yaml", + "degraded_reason": "answered_with_gaps", + "code_intents_stubbed": true +} + +## Pipeline Steps +### input_query +```json +{ + "input": { + "query": "Сгенерируй OpenAPI для endpoint /health" + }, + "output": { + "query": "Сгенерируй OpenAPI для endpoint /health" + } +} +``` + +### router +```json +{ + "input": { + "query": "Сгенерируй OpenAPI для endpoint /health" + }, + "output": { + "intent": "OPENAPI_GENERATION", + "sub_intent": "OPENAPI_METHOD_GENERATE", + "graph_id": "DocsQAGraph", + "conversation_mode": "START" + } +} +``` + +### docs_pipeline +```json +{ + "input": { + "query": "Сгенерируй OpenAPI для endpoint /health" + }, + "output": { + "answer_mode": "structured_spec_partial", + "prompt_name": "docs_openapi_answer", + "llm_request": { + "prompt_name": "docs_openapi_answer", + "log_context": "graph.project_qa.docs.openapi", + "prompt_stats": { + "system_chars": 399, + "user_chars": 3110, + "tokens_in_estimate": 878 + } + }, + "degraded_reason": "answered_with_gaps" + } +} +``` + +## Diagnostics +{ + "intent": "OPENAPI_GENERATION", + "sub_intent": "OPENAPI_METHOD_GENERATE", + "layers_used": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D0_DOC_CHUNKS" + ], + "documents_found": 1, + "facts_found": 0, + "relations_found": 0, + "openapi_fields_extracted": 0, + "missing_required_fields": [ + "method" + ], + "openapi_status": { + "has_path": true, + "has_method": false, + "has_request": false, + "has_response": false + }, + "prompt_used": "docs_openapi_answer", + "llm_mode": "yaml", + "output_valid": true, + "matched_intent_source": "deterministic", + "matched_anchor_type": "endpoint", + "matched_anchor_value": "/health", + "exact_anchor_match": true, + "docs_layers_requested": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D0_DOC_CHUNKS" + ], + "docs_layers_with_hits": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D0_DOC_CHUNKS" + ], + "planned_layers": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D0_DOC_CHUNKS" + ], + "executed_layers": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D0_DOC_CHUNKS" + ], + "non_empty_layers": [ + "D1_DOCUMENT_CATALOG", + "D2_FACT_INDEX", + "D0_DOC_CHUNKS" + ], + "layer_diagnostics": { + "D1_DOCUMENT_CATALOG": { + "hits": 7, + "top_ids": [ + "api.send_message_endpoint", + "api.control_actions_endpoint", + "api.health_endpoint", + "domain.runtime_health", + "architecture.telegram_notify_app" + ], + "top_sections": [ + "HTTP API /send", + "HTTP API /actions/{action}", + "HTTP API /health", + "Сущность runtime health", + "Архитектура Telegram Notify App" + ] + }, + "D2_FACT_INDEX": { + "hits": 8, + "top_ids": [ + "f85d982c272a2ee6baeadc433221a20e684cd8ef01cb4788d6f76d05ca56d6d0", + "b8e44c3adb74aaa6c91ae8815fa091289e58dd3990a3a1b63e850c62075aea75", + "b6bfad59b3bf00f199b5ef90c1208af19664de700413e7354468a93a4abaaa2f", + "a8a325e0815b3a2a870ba2825f3afb3f41056b4c091df4c3bb3418ffd20891dd", + "bafb867ffed41c9db637df98d6cd5f6722d7747bbebc6c03e6f0d0caf3b7f9f3" + ], + "top_sections": [ + "api.control_actions_endpoint:workflow_step", + "api.control_actions_endpoint:mentions_entity" + ] + }, + "D0_DOC_CHUNKS": { + "hits": 6, + "top_ids": [ + "api.control_actions_endpoint" + ], + "top_sections": [ + "api.control_actions_endpoint:Функциональные требования", + "api.control_actions_endpoint:Нефункциональные требования", + "api.control_actions_endpoint:Сценарий", + "api.control_actions_endpoint:Summary", + "api.control_actions_endpoint:Описание" + ] + } + }, + "query_entity_candidates": [ + "OpenAPI" + ], + "resolved_entity_candidates": [], + "query_anchor_candidates": [ + "/health", + "OpenAPI" + ], + "resolved_anchor_candidates": [ + "api.health_endpoint", + "docs/documentation/api/health-endpoint.md" + ], + "anchor_candidates": [], + "selected_anchor": null, + "anchor_selection_reason": "", + "anchor_match_type": "", + "doc_ids": [ + "api.health_endpoint" + ], + "doc_paths": [ + "docs/documentation/api/health-endpoint.md" + ], + "doc_titles": [ + "HTTP API /health" + ], + "relation_hits_count": 0, + "relation_targets": [], + "selected_doc_ids": [ + "api.health_endpoint" + ], + "selected_fact_ids": [], + "selected_relation_ids": [], + "selected_chunk_ids": [], + "selected_entity_ids": [], + "selected_workflow_ids": [], + "fallback_doc_hits_count": 1, + "fallback_used": false, + "fact_hits": 0, + "entity_hits": 0, + "evidence_summary": { + "documents": 1, + "facts": 0, + "entities": 0, + "workflows": 0, + "relations": 0, + "chunks": 0, + "selected_doc_ids": [ + "api.health_endpoint" + ], + "selected_fact_ids": [], + "selected_relation_ids": [], + "selected_chunk_ids": [], + "entity_hits": 0, + "openapi_signals": { + "path_found": true, + "method_found": false, + "operation_semantics_found": true, + "request_payload_found": true, + "request_schema": false, + "request_fields_found": false, + "response_payload_found": false, + "response_schema": false, + "response_fields_found": false, + "status_codes": true, + "content_type_found": false, + "examples_found": false, + "payload_description": true + } + }, + "gate_decision": "partial", + "gate_decision_reason": "answered_with_gaps", + "gate_missing_requirements": [ + "http_method_found", + "contract_fields_found" + ], + "gate_satisfied_requirements": [ + "retrieval_non_empty", + "exact_anchor_match", + "path_found", + "operation_semantics_found", + "request_payload_found", + "status_codes_found", + "payload_description_found", + "api_method_filter" + ], + "openapi_evidence": { + "path_found": true, + "method_found": false, + "operation_semantics_found": true, + "request_payload_found": true, + "request_schema": false, + "request_fields_found": false, + "response_payload_found": false, + "response_schema": false, + "response_fields_found": false, + "status_codes": true, + "content_type_found": false, + "examples_found": false, + "payload_description": true + }, + "requested_fragment_type": "method", + "fragment_evidence_found": [], + "fragment_missing_requirements": [], + "answer_mode": "structured_spec_partial", + "degrade_reason": "answered_with_gaps", + "degraded_reason": "answered_with_gaps", + "code_intents_stubbed": false +} + +## LLM Request +- prompt_name: docs_openapi_answer +- log_context: graph.project_qa.docs.openapi + +### Prompt Stats +```json +{ + "system_chars": 399, + "user_chars": 3110, + "tokens_in_estimate": 878 +} +``` + +### System Prompt +```text +Ты генерируешь OpenAPI спецификацию по документации API. + +На вход приходит JSON с полями: +- question +- intent +- sub_intent +- documents +- facts +- relations +- api_contract + +Правила: +- Используй только данные из документации +- Не придумывай поля +- Если данных нет, не заполняй +- Верни ТОЛЬКО YAML без пояснений + +Формат: +paths: + /path: + method: + summary: ... + requestBody: + responses: +``` + +### User Prompt +```json +{ + "question": "Сгенерируй OpenAPI для endpoint /health", + "intent": "OPENAPI_GENERATION", + "sub_intent": "OPENAPI_METHOD_GENERATE", + "documents": [ + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/documentation/api/health-endpoint.md", + "title": "HTTP API /health", + "content": "Endpoint `/health` возвращает агрегированный health payload runtime. Если общий статус равен `ok`, API отвечает с HTTP 200; для состояний деградации или неготовности возвращается HTTP 503 с тем же payload. Endpoint служит основной точкой внешней проверки состояния приложения.", + "metadata": { + "name": "health_endpoint", + "tags": [ + "api", + "health", + "control-plane" + ], + "type": "api_method", + "layer": "application", + "links": [ + { + "type": "part_of", + "target": "architecture.telegram_notify_app" + }, + { + "type": "depends_on", + "target": "domain.runtime_health" + } + ], + "owner": null, + "title": "HTTP API /health", + "doc_id": null, + "module": "telegram_notify_app", + "parent": "architecture.telegram_notify_app", + "status": "draft", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "8b5a533a8076e2e9d36995eee29aeade260080bdca2ec8e21fe28f08574b983f", + "children": [], + "doc_kind": "misc", + "entities": [ + "TelegramControlChannel", + "TelegramNotifyWorker", + "RuntimeManager", + "WorkerHealth" + ], + "updated_at": "2026-03-20", + "doc_version": null, + "document_id": "api.health_endpoint", + "source_path": "docs/documentation/api/health-endpoint.md", + "summary_text": "Endpoint `/health` возвращает агрегированный health payload runtime. Если общий статус равен `ok`, API отвечает с HTTP 200; для состояний деградации или неготовности возвращается HTTP 503 с тем же payload. Endpoint служит основной точкой внешней проверки состояния приложения.", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + } + ], + "facts": [], + "entities": [], + "workflows": [], + "relations": [], + "chunks": [], + "api_contract": { + "path": "/health", + "method": "", + "request_schema": null, + "response_schema": null, + "diagnostics": { + "has_path": true, + "has_method": false, + "has_request": false, + "has_response": false, + "operation_semantics_found": true, + "request_payload_found": true, + "request_fields_found": false, + "response_payload_found": false, + "response_fields_found": false, + "status_codes_found": true, + "content_type_found": false, + "examples_found": false, + "payload_description_found": true, + "status_codes": [ + "200", + "503" + ], + "content_type": "", + "operation_summary": "HTTP API /health", + "missing_required_fields": [ + "method" + ] + } + } +} +``` + +### User Prompt Overview +- question: Сгенерируй OpenAPI для endpoint /health +- intent: OPENAPI_GENERATION +- sub_intent: OPENAPI_METHOD_GENERATE +- documents: 1 | samples: HTTP API /health +- facts: 0 +- relations: 0 +- api_contract: + path: /health + method: — + has_request_schema: False + has_response_schema: False + +## Mismatches +- none \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/docs_router_llm_disambiguation/20260326_150213/full_chain_docs_intents_v4-llm_v4-related.json b/tests/pipeline_setup_v3/test_results/docs_router_llm_disambiguation/20260326_150213/full_chain_docs_intents_v4-llm_v4-related.json new file mode 100644 index 0000000..2ab0293 --- /dev/null +++ b/tests/pipeline_setup_v3/test_results/docs_router_llm_disambiguation/20260326_150213/full_chain_docs_intents_v4-llm_v4-related.json @@ -0,0 +1,84 @@ +{ + "meta": { + "case_id": "v4-related", + "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_03_docs/full_chain_docs_intents_v4-llm.yaml", + "runner": "agent_runtime", + "mode": "full_chain", + "passed": true, + "mismatches": [], + "actual": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "RELATED_DOCS_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START", + "rag_count": 14, + "llm_answer": "### Краткое описание\nДокументация описывает взаимосвязь между различными компонентами и документами в системе, связанными с endpoint’ом `/health`.\n\n### Основные элементы\n1. **Relations** – содержат информацию о связях между различными элементами системы.\n - *Layer*: D5_RELATION_GRAPH\n - *Path*: Путь к документу, описывающему связь\n - *Title*: Название связи\n - *Content*: Описание содержания связи\n - *Metadata*: Дополнительные метаданные, такие как тип отношения, источник и цель связи.\n \n2. **Chunks** – фрагменты документации, содержащие описание функциональности и назначения endpoint’ов.\n - *Layer*: D0_DOC_CHUNKS\n - *Path*: Путь к документу\n - *Title*: Заголовок фрагмента\n - *Content*: Основное содержание документа\n - *Metadata*: Метаданные, включая теги, владельца, модуль, тип документа и другие атрибуты.\n\n### Как это работает\nСвязи между документами и компонентами системы представлены в виде отношений (relations), которые описывают различные типы связей, например, \"part_of\", \"related_api\" или \"related_logic\". Фрагменты документации (chunks) предоставляют подробное описание функциональных возможностей каждого endpoint’а и их использования.\n\n### Связи с другими частями системы\nВ системе присутствуют следующие важные связи:\n- Контрольный endpoint (`api.control_actions_endpoint`) является частью приложения `architecture.telegram_notify_app` и имеет связанные логические компоненты (`logic.telegram_notification_loop`), а также другой API (`api.health_endpoint`).\n- Health endpoint (`api.health_endpoint`) сам по себе является частью архитектуры приложения `architecture.telegram_notify_app`.\n\nОднако из предоставленных фактов нельзя точно определить полный список документов, связанных непосредственно с endpoint’ом `/health`. Более детальная информация требуется для полного ответа на поставленный вопрос.", + "answer_mode": "answered", + "path_scope": [], + "doc_scope": [ + "api.health_endpoint", + "api.control_actions_endpoint", + "api.send_message_endpoint" + ], + "entity_candidates": [], + "symbol_candidates": [], + "layers": [ + "D5_RELATION_GRAPH", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "filters": { + "doc_type": null + }, + "pipeline_mode": "full", + "gate_decision": "allow", + "prompt_used": "docs_explain_answer", + "llm_mode": "graph_summary", + "degraded_reason": null, + "code_intents_stubbed": true + } + }, + "pipeline_steps": [ + { + "step": "input_query", + "input": { + "query": "Какие документы связаны с endpoint /health?" + }, + "output": { + "query": "Какие документы связаны с endpoint /health?" + } + }, + { + "step": "router", + "input": { + "query": "Какие документы связаны с endpoint /health?" + }, + "output": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "RELATED_DOCS_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START" + } + }, + { + "step": "docs_pipeline", + "input": { + "query": "Какие документы связаны с endpoint /health?" + }, + "output": { + "answer_mode": "answered", + "prompt_name": "docs_explain_answer", + "llm_request": { + "prompt_name": "docs_explain_answer", + "log_context": "graph.project_qa.docs.answer", + "prompt_stats": { + "system_chars": 393, + "user_chars": 5474, + "tokens_in_estimate": 1467 + } + }, + "degraded_reason": "" + } + } + ] +} \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/docs_router_llm_disambiguation/20260326_150213/full_chain_docs_intents_v4-llm_v4-related.md b/tests/pipeline_setup_v3/test_results/docs_router_llm_disambiguation/20260326_150213/full_chain_docs_intents_v4-llm_v4-related.md new file mode 100644 index 0000000..72b9f25 --- /dev/null +++ b/tests/pipeline_setup_v3/test_results/docs_router_llm_disambiguation/20260326_150213/full_chain_docs_intents_v4-llm_v4-related.md @@ -0,0 +1,505 @@ +# v4-related + +- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_03_docs/full_chain_docs_intents_v4-llm.yaml +- runner: agent_runtime +- mode: full_chain +- passed: True + +## Query +Какие документы связаны с endpoint /health? + +## Actual +{ + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "RELATED_DOCS_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START", + "rag_count": 14, + "llm_answer": "### Краткое описание\nДокументация описывает взаимосвязь между различными компонентами и документами в системе, связанными с endpoint’ом `/health`.\n\n### Основные элементы\n1. **Relations** – содержат информацию о связях между различными элементами системы.\n - *Layer*: D5_RELATION_GRAPH\n - *Path*: Путь к документу, описывающему связь\n - *Title*: Название связи\n - *Content*: Описание содержания связи\n - *Metadata*: Дополнительные метаданные, такие как тип отношения, источник и цель связи.\n \n2. **Chunks** – фрагменты документации, содержащие описание функциональности и назначения endpoint’ов.\n - *Layer*: D0_DOC_CHUNKS\n - *Path*: Путь к документу\n - *Title*: Заголовок фрагмента\n - *Content*: Основное содержание документа\n - *Metadata*: Метаданные, включая теги, владельца, модуль, тип документа и другие атрибуты.\n\n### Как это работает\nСвязи между документами и компонентами системы представлены в виде отношений (relations), которые описывают различные типы связей, например, \"part_of\", \"related_api\" или \"related_logic\". Фрагменты документации (chunks) предоставляют подробное описание функциональных возможностей каждого endpoint’а и их использования.\n\n### Связи с другими частями системы\nВ системе присутствуют следующие важные связи:\n- Контрольный endpoint (`api.control_actions_endpoint`) является частью приложения `architecture.telegram_notify_app` и имеет связанные логические компоненты (`logic.telegram_notification_loop`), а также другой API (`api.health_endpoint`).\n- Health endpoint (`api.health_endpoint`) сам по себе является частью архитектуры приложения `architecture.telegram_notify_app`.\n\nОднако из предоставленных фактов нельзя точно определить полный список документов, связанных непосредственно с endpoint’ом `/health`. Более детальная информация требуется для полного ответа на поставленный вопрос.", + "answer_mode": "answered", + "path_scope": [], + "doc_scope": [ + "api.health_endpoint", + "api.control_actions_endpoint", + "api.send_message_endpoint" + ], + "entity_candidates": [], + "symbol_candidates": [], + "layers": [ + "D5_RELATION_GRAPH", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "filters": { + "doc_type": null + }, + "pipeline_mode": "full", + "gate_decision": "allow", + "prompt_used": "docs_explain_answer", + "llm_mode": "graph_summary", + "degraded_reason": null, + "code_intents_stubbed": true +} + +## Pipeline Steps +### input_query +```json +{ + "input": { + "query": "Какие документы связаны с endpoint /health?" + }, + "output": { + "query": "Какие документы связаны с endpoint /health?" + } +} +``` + +### router +```json +{ + "input": { + "query": "Какие документы связаны с endpoint /health?" + }, + "output": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "RELATED_DOCS_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START" + } +} +``` + +### docs_pipeline +```json +{ + "input": { + "query": "Какие документы связаны с endpoint /health?" + }, + "output": { + "answer_mode": "answered", + "prompt_name": "docs_explain_answer", + "llm_request": { + "prompt_name": "docs_explain_answer", + "log_context": "graph.project_qa.docs.answer", + "prompt_stats": { + "system_chars": 393, + "user_chars": 5474, + "tokens_in_estimate": 1467 + } + }, + "degraded_reason": "" + } +} +``` + +## Diagnostics +{ + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "RELATED_DOCS_EXPLAIN", + "layers_used": [ + "D5_RELATION_GRAPH", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "documents_found": 0, + "facts_found": 0, + "relations_found": 4, + "openapi_fields_extracted": 0, + "missing_required_fields": [], + "openapi_status": { + "has_path": false, + "has_method": false, + "has_request": false, + "has_response": false + }, + "prompt_used": "docs_explain_answer", + "llm_mode": "graph_summary", + "output_valid": true, + "matched_intent_source": "deterministic", + "matched_anchor_type": "endpoint", + "matched_anchor_value": "/health", + "exact_anchor_match": false, + "docs_layers_requested": [ + "D5_RELATION_GRAPH", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "docs_layers_with_hits": [ + "D5_RELATION_GRAPH" + ], + "planned_layers": [ + "D5_RELATION_GRAPH", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "executed_layers": [ + "D5_RELATION_GRAPH" + ], + "non_empty_layers": [ + "D5_RELATION_GRAPH" + ], + "layer_diagnostics": { + "D5_RELATION_GRAPH": { + "hits": 8, + "top_ids": [ + "5f4909bde905cd3d294ad307074a05e4ae4deefcafe6272cd2d0436e73acb8dd", + "711fb2edb82dd222deaba3c91768b18cbbd453009235823282813c6e867dc2c1", + "eec79f7a02b804337e791ef231784862ae26e0599eb20224790e9d4f085fa9c0", + "c718b1939621233295ccaf6e8203e7fd94f3dd1bfb88f10c51bc5e33d53a24aa", + "616f5cbf25da83cb51d8d0741a7fc351620c9ca2c6513fa2094b4aa476f0912a" + ], + "top_sections": [ + "api.control_actions_endpoint:part_of", + "api.control_actions_endpoint:related_api", + "api.control_actions_endpoint:related_logic", + "api.health_endpoint:parent", + "api.health_endpoint:part_of" + ] + }, + "D1_DOCUMENT_CATALOG": { + "hits": 0, + "top_ids": [], + "skipped": true, + "reason": "relation_primary_sufficient" + }, + "D0_DOC_CHUNKS": { + "hits": 6, + "top_ids": [ + "api.control_actions_endpoint" + ], + "top_sections": [ + "api.control_actions_endpoint:Summary", + "api.control_actions_endpoint:Описание", + "api.control_actions_endpoint:Сценарий", + "api.control_actions_endpoint:Функциональные требования", + "api.control_actions_endpoint:Нефункциональные требования" + ] + } + }, + "query_entity_candidates": [], + "resolved_entity_candidates": [], + "query_anchor_candidates": [ + "/health" + ], + "resolved_anchor_candidates": [ + "docs/documentation/api/control-actions-endpoint.md", + "docs/documentation/api/health-endpoint.md", + "docs/documentation/api/send-message-endpoint.md", + "api.control_actions_endpoint" + ], + "anchor_candidates": [ + "api.health_endpoint", + "api.control_actions_endpoint", + "api.send_message_endpoint" + ], + "selected_anchor": "api.health_endpoint", + "anchor_selection_reason": "doc_id matches requested endpoint slug", + "anchor_match_type": "exact_path", + "doc_ids": [ + "api.health_endpoint", + "api.control_actions_endpoint", + "api.send_message_endpoint" + ], + "doc_paths": [ + "docs/documentation/api/control-actions-endpoint.md", + "docs/documentation/api/health-endpoint.md", + "docs/documentation/api/send-message-endpoint.md" + ], + "doc_titles": [ + "api.control_actions_endpoint:part_of", + "api.control_actions_endpoint:related_api", + "api.control_actions_endpoint:related_logic", + "api.health_endpoint:parent", + "api.health_endpoint:part_of", + "api.health_endpoint:depends_on", + "api.send_message_endpoint:parent", + "api.control_actions_endpoint:parent", + "api.control_actions_endpoint:Summary", + "api.control_actions_endpoint:Описание", + "api.control_actions_endpoint:Сценарий", + "api.control_actions_endpoint:Функциональные требования", + "api.control_actions_endpoint:Нефункциональные требования", + "api.control_actions_endpoint:Входные параметры" + ], + "relation_hits_count": 4, + "relation_targets": [ + "api.control_actions_endpoint:part_of", + "api.control_actions_endpoint:related_api", + "api.control_actions_endpoint:related_logic", + "api.health_endpoint:parent" + ], + "selected_doc_ids": [], + "selected_fact_ids": [], + "selected_relation_ids": [ + "5f4909bde905cd3d294ad307074a05e4ae4deefcafe6272cd2d0436e73acb8dd", + "711fb2edb82dd222deaba3c91768b18cbbd453009235823282813c6e867dc2c1", + "eec79f7a02b804337e791ef231784862ae26e0599eb20224790e9d4f085fa9c0", + "c718b1939621233295ccaf6e8203e7fd94f3dd1bfb88f10c51bc5e33d53a24aa" + ], + "selected_chunk_ids": [ + "api.control_actions_endpoint" + ], + "selected_entity_ids": [], + "selected_workflow_ids": [], + "fallback_doc_hits_count": 1, + "fallback_used": true, + "fact_hits": 0, + "entity_hits": 0, + "evidence_summary": { + "documents": 0, + "facts": 0, + "entities": 0, + "workflows": 0, + "relations": 4, + "chunks": 1, + "selected_doc_ids": [], + "selected_fact_ids": [], + "selected_relation_ids": [ + "5f4909bde905cd3d294ad307074a05e4ae4deefcafe6272cd2d0436e73acb8dd", + "711fb2edb82dd222deaba3c91768b18cbbd453009235823282813c6e867dc2c1", + "eec79f7a02b804337e791ef231784862ae26e0599eb20224790e9d4f085fa9c0", + "c718b1939621233295ccaf6e8203e7fd94f3dd1bfb88f10c51bc5e33d53a24aa" + ], + "selected_chunk_ids": [ + "api.control_actions_endpoint" + ], + "entity_hits": 0, + "openapi_signals": { + "path_found": false, + "method_found": false, + "operation_semantics_found": false, + "request_payload_found": false, + "request_schema": false, + "request_fields_found": false, + "response_payload_found": false, + "response_schema": false, + "response_fields_found": false, + "status_codes": false, + "content_type_found": false, + "examples_found": false, + "payload_description": false + } + }, + "gate_decision": "allow", + "gate_decision_reason": "relation_evidence_available", + "gate_missing_requirements": [], + "gate_satisfied_requirements": [ + "retrieval_non_empty", + "exact_anchor_match" + ], + "openapi_evidence": { + "path_found": false, + "method_found": false, + "operation_semantics_found": false, + "request_payload_found": false, + "request_schema": false, + "request_fields_found": false, + "response_payload_found": false, + "response_schema": false, + "response_fields_found": false, + "status_codes": false, + "content_type_found": false, + "examples_found": false, + "payload_description": false + }, + "requested_fragment_type": null, + "fragment_evidence_found": [], + "fragment_missing_requirements": [], + "answer_mode": "answered", + "degrade_reason": null, + "degraded_reason": null, + "code_intents_stubbed": false +} + +## LLM Request +- prompt_name: docs_explain_answer +- log_context: graph.project_qa.docs.answer + +### Prompt Stats +```json +{ + "system_chars": 393, + "user_chars": 5474, + "tokens_in_estimate": 1467 +} +``` + +### System Prompt +```text +Ты объясняешь документацию системы. + +На вход приходит JSON с полями: +- question +- intent +- sub_intent +- documents +- facts +- relations + +Правила: +- Используй только предоставленные факты +- Не додумывай +- Если данных недостаточно, скажи это явно +- Объясняй структурировано + +Формат ответа: +1. Краткое описание +2. Основные элементы +3. Как это работает +4. Связи с другими частями системы (если есть) +``` + +### User Prompt +```json +{ + "question": "Какие документы связаны с endpoint /health?", + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "RELATED_DOCS_EXPLAIN", + "documents": [], + "facts": [], + "entities": [], + "workflows": [], + "relations": [ + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "api.control_actions_endpoint:part_of", + "content": "api.control_actions_endpoint part_of architecture.telegram_notify_app", + "metadata": { + "owner": null, + "anchor": "frontmatter.links", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "source_id": "api.control_actions_endpoint", + "target_id": "architecture.telegram_notify_app", + "doc_version": null, + "relation_id": "5f4909bde905cd3d294ad307074a05e4ae4deefcafe6272cd2d0436e73acb8dd", + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "part_of", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "api.control_actions_endpoint:related_api", + "content": "api.control_actions_endpoint related_api api.health_endpoint", + "metadata": { + "owner": null, + "anchor": "frontmatter.links", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "source_id": "api.control_actions_endpoint", + "target_id": "api.health_endpoint", + "doc_version": null, + "relation_id": "711fb2edb82dd222deaba3c91768b18cbbd453009235823282813c6e867dc2c1", + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "related_api", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "api.control_actions_endpoint:related_logic", + "content": "api.control_actions_endpoint related_logic logic.telegram_notification_loop", + "metadata": { + "owner": null, + "anchor": "frontmatter.links", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "source_id": "api.control_actions_endpoint", + "target_id": "logic.telegram_notification_loop", + "doc_version": null, + "relation_id": "eec79f7a02b804337e791ef231784862ae26e0599eb20224790e9d4f085fa9c0", + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "related_logic", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/api/health-endpoint.md", + "title": "api.health_endpoint:parent", + "content": "api.health_endpoint parent architecture.telegram_notify_app", + "metadata": { + "owner": null, + "anchor": "frontmatter.parent", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "8b5a533a8076e2e9d36995eee29aeade260080bdca2ec8e21fe28f08574b983f", + "source_id": "api.health_endpoint", + "target_id": "architecture.telegram_notify_app", + "doc_version": null, + "relation_id": "c718b1939621233295ccaf6e8203e7fd94f3dd1bfb88f10c51bc5e33d53a24aa", + "source_path": "docs/documentation/api/health-endpoint.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "parent", + "staleness_score": null, + "system_component": null + } + } + ], + "chunks": [ + { + "layer": "D0_DOC_CHUNKS", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "api.control_actions_endpoint:Summary", + "content": "Endpoint `/actions/{action}` управляет control actions runtime и поддерживает `start`, `stop` и `status`. Для долгих операций `start` и `stop` допускается ответ HTTP 202, если действие еще выполняется. Endpoint используется для operator-driven управления жизненным циклом worker'а через HTTP API.", + "metadata": { + "tags": [ + "api", + "control-plane", + "lifecycle" + ], + "type": "api_method", + "order": 1, + "owner": null, + "doc_id": null, + "module": "telegram_notify_app", + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "doc_kind": "misc", + "doc_version": null, + "document_id": "api.control_actions_endpoint", + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "section_path": "Summary", + "artifact_type": null, + "last_modified": null, + "section_title": "Summary", + "staleness_score": null, + "system_component": null + } + } + ] +} +``` + +### User Prompt Overview +- question: Какие документы связаны с endpoint /health? +- intent: DOCUMENTATION_EXPLAIN +- sub_intent: RELATED_DOCS_EXPLAIN +- documents: 0 +- facts: 0 +- relations: 4 | samples: api.control_actions_endpoint:part_of, api.control_actions_endpoint:related_api, api.control_actions_endpoint:related_logic + +## Mismatches +- none \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/docs_router_llm_disambiguation/20260326_150213/full_chain_docs_intents_v4-llm_v4-system-flow.json b/tests/pipeline_setup_v3/test_results/docs_router_llm_disambiguation/20260326_150213/full_chain_docs_intents_v4-llm_v4-system-flow.json new file mode 100644 index 0000000..7a29b0a --- /dev/null +++ b/tests/pipeline_setup_v3/test_results/docs_router_llm_disambiguation/20260326_150213/full_chain_docs_intents_v4-llm_v4-system-flow.json @@ -0,0 +1,87 @@ +{ + "meta": { + "case_id": "v4-system-flow", + "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_03_docs/full_chain_docs_intents_v4-llm.yaml", + "runner": "agent_runtime", + "mode": "full_chain", + "passed": true, + "mismatches": [], + "actual": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "SYSTEM_FLOW_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START", + "rag_count": 19, + "llm_answer": "Из предоставленных данных не удалось найти информацию о цикле отправки уведомлений.\n\nОднако я могу указать, где искать необходимую информацию согласно структуре документации:\n\n### Структура документации:\n- **Архитектура**: documentation/architecture/\n- **HTTP API Control Plane**: documentation/api/\n- **Основные Workflow и Бизнес-логика**: documentation/logic/\n- **Ключевые сущности и состояния**: documentation/domain/\n\n### Навигационные ссылки:\nДля получения информации о цикле отправки уведомлений рекомендую обратиться к следующему документу:\n- **Цикл отправки уведомлений**: documentation/logic/telegram-notification-loop.md\n\nПожалуйста, обратитесь непосредственно к указанному файлу для детального объяснения работы цикла отправки уведомлений.", + "answer_mode": "answered", + "path_scope": [], + "doc_scope": [ + "api.control_actions_endpoint", + "api.health_endpoint", + "api.send_message_endpoint", + "docs/README.md", + "api.actions_endpoint" + ], + "entity_candidates": [], + "symbol_candidates": [], + "layers": [ + "D4_WORKFLOW_INDEX", + "D5_RELATION_GRAPH", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "filters": { + "doc_type": null + }, + "pipeline_mode": "full", + "gate_decision": "allow", + "prompt_used": "docs_explain_answer", + "llm_mode": "prose", + "degraded_reason": null, + "code_intents_stubbed": true + } + }, + "pipeline_steps": [ + { + "step": "input_query", + "input": { + "query": "Объясни как работает цикл отправки уведомлений" + }, + "output": { + "query": "Объясни как работает цикл отправки уведомлений" + } + }, + { + "step": "router", + "input": { + "query": "Объясни как работает цикл отправки уведомлений" + }, + "output": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "SYSTEM_FLOW_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START" + } + }, + { + "step": "docs_pipeline", + "input": { + "query": "Объясни как работает цикл отправки уведомлений" + }, + "output": { + "answer_mode": "answered", + "prompt_name": "docs_explain_answer", + "llm_request": { + "prompt_name": "docs_explain_answer", + "log_context": "graph.project_qa.docs.answer", + "prompt_stats": { + "system_chars": 393, + "user_chars": 10818, + "tokens_in_estimate": 2803 + } + }, + "degraded_reason": "" + } + } + ] +} \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/docs_router_llm_disambiguation/20260326_150213/full_chain_docs_intents_v4-llm_v4-system-flow.md b/tests/pipeline_setup_v3/test_results/docs_router_llm_disambiguation/20260326_150213/full_chain_docs_intents_v4-llm_v4-system-flow.md new file mode 100644 index 0000000..12fe62a --- /dev/null +++ b/tests/pipeline_setup_v3/test_results/docs_router_llm_disambiguation/20260326_150213/full_chain_docs_intents_v4-llm_v4-system-flow.md @@ -0,0 +1,651 @@ +# v4-system-flow + +- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_03_docs/full_chain_docs_intents_v4-llm.yaml +- runner: agent_runtime +- mode: full_chain +- passed: True + +## Query +Объясни как работает цикл отправки уведомлений + +## Actual +{ + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "SYSTEM_FLOW_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START", + "rag_count": 19, + "llm_answer": "Из предоставленных данных не удалось найти информацию о цикле отправки уведомлений.\n\nОднако я могу указать, где искать необходимую информацию согласно структуре документации:\n\n### Структура документации:\n- **Архитектура**: documentation/architecture/\n- **HTTP API Control Plane**: documentation/api/\n- **Основные Workflow и Бизнес-логика**: documentation/logic/\n- **Ключевые сущности и состояния**: documentation/domain/\n\n### Навигационные ссылки:\nДля получения информации о цикле отправки уведомлений рекомендую обратиться к следующему документу:\n- **Цикл отправки уведомлений**: documentation/logic/telegram-notification-loop.md\n\nПожалуйста, обратитесь непосредственно к указанному файлу для детального объяснения работы цикла отправки уведомлений.", + "answer_mode": "answered", + "path_scope": [], + "doc_scope": [ + "api.control_actions_endpoint", + "api.health_endpoint", + "api.send_message_endpoint", + "docs/README.md", + "api.actions_endpoint" + ], + "entity_candidates": [], + "symbol_candidates": [], + "layers": [ + "D4_WORKFLOW_INDEX", + "D5_RELATION_GRAPH", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "filters": { + "doc_type": null + }, + "pipeline_mode": "full", + "gate_decision": "allow", + "prompt_used": "docs_explain_answer", + "llm_mode": "prose", + "degraded_reason": null, + "code_intents_stubbed": true +} + +## Pipeline Steps +### input_query +```json +{ + "input": { + "query": "Объясни как работает цикл отправки уведомлений" + }, + "output": { + "query": "Объясни как работает цикл отправки уведомлений" + } +} +``` + +### router +```json +{ + "input": { + "query": "Объясни как работает цикл отправки уведомлений" + }, + "output": { + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "SYSTEM_FLOW_EXPLAIN", + "graph_id": "DocsQAGraph", + "conversation_mode": "START" + } +} +``` + +### docs_pipeline +```json +{ + "input": { + "query": "Объясни как работает цикл отправки уведомлений" + }, + "output": { + "answer_mode": "answered", + "prompt_name": "docs_explain_answer", + "llm_request": { + "prompt_name": "docs_explain_answer", + "log_context": "graph.project_qa.docs.answer", + "prompt_stats": { + "system_chars": 393, + "user_chars": 10818, + "tokens_in_estimate": 2803 + } + }, + "degraded_reason": "" + } +} +``` + +## Diagnostics +{ + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "SYSTEM_FLOW_EXPLAIN", + "layers_used": [ + "D4_WORKFLOW_INDEX", + "D5_RELATION_GRAPH", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "documents_found": 1, + "facts_found": 0, + "relations_found": 2, + "openapi_fields_extracted": 0, + "missing_required_fields": [], + "openapi_status": { + "has_path": false, + "has_method": false, + "has_request": false, + "has_response": false + }, + "prompt_used": "docs_explain_answer", + "llm_mode": "prose", + "output_valid": true, + "matched_intent_source": "deterministic", + "matched_anchor_type": "none", + "matched_anchor_value": null, + "exact_anchor_match": false, + "docs_layers_requested": [ + "D4_WORKFLOW_INDEX", + "D5_RELATION_GRAPH", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "docs_layers_with_hits": [ + "D4_WORKFLOW_INDEX", + "D5_RELATION_GRAPH", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "planned_layers": [ + "D4_WORKFLOW_INDEX", + "D5_RELATION_GRAPH", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "executed_layers": [ + "D4_WORKFLOW_INDEX", + "D5_RELATION_GRAPH", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "non_empty_layers": [ + "D4_WORKFLOW_INDEX", + "D5_RELATION_GRAPH", + "D1_DOCUMENT_CATALOG", + "D0_DOC_CHUNKS" + ], + "layer_diagnostics": { + "D4_WORKFLOW_INDEX": { + "hits": 3, + "top_ids": [ + "api.control_actions_endpoint", + "api.health_endpoint", + "api.send_message_endpoint" + ], + "top_sections": [ + "Scenario" + ] + }, + "D5_RELATION_GRAPH": { + "hits": 8, + "top_ids": [ + "5f4909bde905cd3d294ad307074a05e4ae4deefcafe6272cd2d0436e73acb8dd", + "711fb2edb82dd222deaba3c91768b18cbbd453009235823282813c6e867dc2c1", + "eec79f7a02b804337e791ef231784862ae26e0599eb20224790e9d4f085fa9c0", + "c718b1939621233295ccaf6e8203e7fd94f3dd1bfb88f10c51bc5e33d53a24aa", + "616f5cbf25da83cb51d8d0741a7fc351620c9ca2c6513fa2094b4aa476f0912a" + ], + "top_sections": [ + "api.control_actions_endpoint:part_of", + "api.control_actions_endpoint:related_api", + "api.control_actions_endpoint:related_logic", + "api.health_endpoint:parent", + "api.health_endpoint:part_of" + ] + }, + "D1_DOCUMENT_CATALOG": { + "hits": 4, + "top_ids": [ + "docs/README.md", + "api.control_actions_endpoint", + "api.health_endpoint", + "api.send_message_endpoint" + ], + "top_sections": [ + "Readme", + "HTTP API /actions/{action}", + "HTTP API /health", + "HTTP API /send" + ] + }, + "D0_DOC_CHUNKS": { + "hits": 4, + "top_ids": [ + "docs/README.md" + ], + "top_sections": [ + "docs/README.md:Структура", + "docs/README.md:Навигация", + "docs/README.md:Правила и шаблоны", + "docs/README.md:Project Docs" + ] + } + }, + "query_entity_candidates": [], + "resolved_entity_candidates": [], + "query_anchor_candidates": [], + "resolved_anchor_candidates": [ + "api.control_actions_endpoint", + "docs/documentation/api/control-actions-endpoint.md", + "api.health_endpoint", + "docs/documentation/api/health-endpoint.md", + "api.send_message_endpoint", + "docs/documentation/api/send-message-endpoint.md", + "docs/README.md" + ], + "anchor_candidates": [], + "selected_anchor": null, + "anchor_selection_reason": "", + "anchor_match_type": "", + "doc_ids": [ + "api.control_actions_endpoint", + "api.health_endpoint", + "api.send_message_endpoint", + "docs/README.md", + "api.actions_endpoint" + ], + "doc_paths": [ + "docs/documentation/api/control-actions-endpoint.md", + "docs/documentation/api/health-endpoint.md", + "docs/documentation/api/send-message-endpoint.md", + "docs/README.md" + ], + "doc_titles": [ + "Scenario", + "api.control_actions_endpoint:part_of", + "api.control_actions_endpoint:related_api", + "api.control_actions_endpoint:related_logic", + "api.health_endpoint:parent", + "api.health_endpoint:part_of", + "api.health_endpoint:depends_on", + "api.send_message_endpoint:parent", + "api.control_actions_endpoint:parent", + "Readme", + "HTTP API /actions/{action}", + "HTTP API /health", + "HTTP API /send", + "docs/README.md:Структура", + "docs/README.md:Навигация", + "docs/README.md:Правила и шаблоны", + "docs/README.md:Project Docs" + ], + "relation_hits_count": 2, + "relation_targets": [ + "api.control_actions_endpoint:part_of", + "api.control_actions_endpoint:related_api" + ], + "selected_doc_ids": [ + "docs/README.md", + "api.control_actions_endpoint", + "api.health_endpoint" + ], + "selected_fact_ids": [], + "selected_relation_ids": [ + "5f4909bde905cd3d294ad307074a05e4ae4deefcafe6272cd2d0436e73acb8dd", + "711fb2edb82dd222deaba3c91768b18cbbd453009235823282813c6e867dc2c1" + ], + "selected_chunk_ids": [ + "docs/README.md" + ], + "selected_entity_ids": [], + "selected_workflow_ids": [ + "f78b822d4366b10322fd4a35e347deae59d55ff4132951201f4df3d1653aec61", + "83a9287bd9ac1f709258078d0e16d326615b4af1b7d77b323ff050dfb97a3e41" + ], + "fallback_doc_hits_count": 3, + "fallback_used": false, + "fact_hits": 0, + "entity_hits": 0, + "evidence_summary": { + "documents": 1, + "facts": 0, + "entities": 0, + "workflows": 2, + "relations": 2, + "chunks": 2, + "selected_doc_ids": [ + "docs/README.md", + "api.control_actions_endpoint", + "api.health_endpoint" + ], + "selected_fact_ids": [], + "selected_relation_ids": [ + "5f4909bde905cd3d294ad307074a05e4ae4deefcafe6272cd2d0436e73acb8dd", + "711fb2edb82dd222deaba3c91768b18cbbd453009235823282813c6e867dc2c1" + ], + "selected_chunk_ids": [ + "docs/README.md" + ], + "entity_hits": 0, + "openapi_signals": { + "path_found": false, + "method_found": false, + "operation_semantics_found": false, + "request_payload_found": false, + "request_schema": false, + "request_fields_found": false, + "response_payload_found": false, + "response_schema": false, + "response_fields_found": false, + "status_codes": false, + "content_type_found": false, + "examples_found": false, + "payload_description": false + } + }, + "gate_decision": "allow", + "gate_decision_reason": "evidence_sufficient", + "gate_missing_requirements": [], + "gate_satisfied_requirements": [ + "retrieval_non_empty" + ], + "openapi_evidence": { + "path_found": false, + "method_found": false, + "operation_semantics_found": false, + "request_payload_found": false, + "request_schema": false, + "request_fields_found": false, + "response_payload_found": false, + "response_schema": false, + "response_fields_found": false, + "status_codes": false, + "content_type_found": false, + "examples_found": false, + "payload_description": false + }, + "requested_fragment_type": null, + "fragment_evidence_found": [], + "fragment_missing_requirements": [], + "answer_mode": "answered", + "degrade_reason": null, + "degraded_reason": null, + "code_intents_stubbed": false +} + +## LLM Request +- prompt_name: docs_explain_answer +- log_context: graph.project_qa.docs.answer + +### Prompt Stats +```json +{ + "system_chars": 393, + "user_chars": 10818, + "tokens_in_estimate": 2803 +} +``` + +### System Prompt +```text +Ты объясняешь документацию системы. + +На вход приходит JSON с полями: +- question +- intent +- sub_intent +- documents +- facts +- relations + +Правила: +- Используй только предоставленные факты +- Не додумывай +- Если данных недостаточно, скажи это явно +- Объясняй структурировано + +Формат ответа: +1. Краткое описание +2. Основные элементы +3. Как это работает +4. Связи с другими частями системы (если есть) +``` + +### User Prompt +```json +{ + "question": "Объясни как работает цикл отправки уведомлений", + "intent": "DOCUMENTATION_EXPLAIN", + "sub_intent": "SYSTEM_FLOW_EXPLAIN", + "documents": [ + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/README.md", + "title": "Readme", + "content": "Readme", + "metadata": { + "name": "", + "tags": [], + "type": "", + "layer": "", + "links": [], + "owner": null, + "title": "Readme", + "doc_id": null, + "module": "", + "parent": null, + "status": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "81d952f1a6ea85b76f75e0e57f33b8fa4b2bf3cb7db11b91b90171aeedd655a6", + "children": [], + "doc_kind": "readme", + "entities": [], + "updated_at": null, + "doc_version": null, + "document_id": "docs/README.md", + "source_path": "docs/README.md", + "summary_text": "", + "artifact_type": null, + "last_modified": null, + "staleness_score": null, + "system_component": null + } + } + ], + "facts": [], + "entities": [], + "workflows": [ + { + "layer": "D4_WORKFLOW_INDEX", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "Scenario", + "content": "Scenario\nHTTP control plane запущен.\n`ControlActionSet` сконфигурирован в `TelegramControlChannel`.\nВ path передано одно из поддерживаемых действий: `start`, `stop`, `status`.\nКлиент отправляет `GET` или `POST` на `/actions/{action}`.\n1. Endpoint принимает запрос и извлекает path parameter `action`.\n2. API определяет источник клиента через `X-Client-Source` или `User-Agent`.\n3. Для `start` и `stop` запрос логируется как control action.\n4. Канал сопоставляет `action` с callback из `ControlActionSet`.\n5. API ожидает завершения callback в пределах допустимого timeout.\n6. При успешном завершении API возвращает JSON со статусом `ok`.\n1. Если `start` или `stop` не успевают завершиться в timeout, API возвращает `202 accepted` и сообщает, что операция еще выполняется.", + "metadata": { + "owner": null, + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "trigger": [ + "Клиент отправляет `GET` или `POST` на `/actions/{action}`." + ], + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "main_flow": [ + "1. Endpoint принимает запрос и извлекает path parameter `action`.", + "2. API определяет источник клиента через `X-Client-Source` или `User-Agent`.", + "3. Для `start` и `stop` запрос логируется как control action.", + "4. Канал сопоставляет `action` с callback из `ControlActionSet`.", + "5. API ожидает завершения callback в пределах допустимого timeout.", + "6. При успешном завершении API возвращает JSON со статусом `ok`." + ], + "doc_version": null, + "document_id": "api.control_actions_endpoint", + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "workflow_id": "f78b822d4366b10322fd4a35e347deae59d55ff4132951201f4df3d1653aec61", + "artifact_type": null, + "last_modified": null, + "preconditions": [ + "HTTP control plane запущен.", + "`ControlActionSet` сконфигурирован в `TelegramControlChannel`.", + "В path передано одно из поддерживаемых действий: `start`, `stop`, `status`." + ], + "workflow_name": "Scenario", + "error_handling": [ + "1. Если actions не сконфигурированы, API возвращает `404`.", + "2. Если передано неподдерживаемое действие, API возвращает `404`.", + "3. Если callback завершился исключением, API возвращает `500`." + ], + "postconditions": [ + "Клиент получает результат выполнения control action или признак, что операция еще продолжается." + ], + "staleness_score": null, + "alternative_flow": [ + "1. Если `start` или `stop` не успевают завершиться в timeout, API возвращает `202 accepted` и сообщает, что операция еще выполняется." + ], + "system_component": null + } + }, + { + "layer": "D4_WORKFLOW_INDEX", + "path": "docs/documentation/api/health-endpoint.md", + "title": "Scenario", + "content": "Scenario\nHTTP control plane запущен.\n`TelegramControlChannel` зарегистрирован в runtime.\nКлиент отправляет `GET /health`.\n1. Endpoint принимает HTTP-запрос `GET /health`.\n2. API вызывает `health_provider` через `TelegramControlChannel`.\n3. Канал получает health payload от runtime.\n4. Endpoint определяет HTTP status code по полю `status` в payload.\n5. Endpoint возвращает payload клиенту в формате JSON.\n1. Если runtime вернул статус, отличный от `ok`, endpoint возвращает тот же payload c HTTP 503.", + "metadata": { + "owner": null, + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "trigger": [ + "Клиент отправляет `GET /health`." + ], + "blob_sha": "8b5a533a8076e2e9d36995eee29aeade260080bdca2ec8e21fe28f08574b983f", + "main_flow": [ + "1. Endpoint принимает HTTP-запрос `GET /health`.", + "2. API вызывает `health_provider` через `TelegramControlChannel`.", + "3. Канал получает health payload от runtime.", + "4. Endpoint определяет HTTP status code по полю `status` в payload.", + "5. Endpoint возвращает payload клиенту в формате JSON." + ], + "doc_version": null, + "document_id": "api.health_endpoint", + "source_path": "docs/documentation/api/health-endpoint.md", + "workflow_id": "83a9287bd9ac1f709258078d0e16d326615b4af1b7d77b323ff050dfb97a3e41", + "artifact_type": null, + "last_modified": null, + "preconditions": [ + "HTTP control plane запущен.", + "`TelegramControlChannel` зарегистрирован в runtime." + ], + "workflow_name": "Scenario", + "error_handling": [ + "1. Если provider завершился исключением, запрос завершается server-side ошибкой." + ], + "postconditions": [ + "Клиент получает актуальный health payload runtime." + ], + "staleness_score": null, + "alternative_flow": [ + "1. Если runtime вернул статус, отличный от `ok`, endpoint возвращает тот же payload c HTTP 503." + ], + "system_component": null + } + } + ], + "relations": [ + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "api.control_actions_endpoint:part_of", + "content": "api.control_actions_endpoint part_of architecture.telegram_notify_app", + "metadata": { + "owner": null, + "anchor": "frontmatter.links", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "source_id": "api.control_actions_endpoint", + "target_id": "architecture.telegram_notify_app", + "doc_version": null, + "relation_id": "5f4909bde905cd3d294ad307074a05e4ae4deefcafe6272cd2d0436e73acb8dd", + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "part_of", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "api.control_actions_endpoint:related_api", + "content": "api.control_actions_endpoint related_api api.health_endpoint", + "metadata": { + "owner": null, + "anchor": "frontmatter.links", + "doc_id": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "a251c550a23249ef1a74389c93aaccd4c5ae88ef621efad2aa018fcd132cce7e", + "source_id": "api.control_actions_endpoint", + "target_id": "api.health_endpoint", + "doc_version": null, + "relation_id": "711fb2edb82dd222deaba3c91768b18cbbd453009235823282813c6e867dc2c1", + "source_path": "docs/documentation/api/control-actions-endpoint.md", + "artifact_type": null, + "last_modified": null, + "relation_type": "related_api", + "staleness_score": null, + "system_component": null + } + } + ], + "chunks": [ + { + "layer": "D0_DOC_CHUNKS", + "path": "docs/README.md", + "title": "docs/README.md:Структура", + "content": "- `documentation/architecture/` — обзор архитектуры и ключевых компонентов.\n- `documentation/api/` — документация HTTP API control plane.\n- `documentation/logic/` — описание основных workflow и бизнес-логики.\n- `documentation/domain/` — описание ключевых сущностей и состояний.", + "metadata": { + "tags": [], + "type": null, + "order": 2, + "owner": null, + "doc_id": null, + "module": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "81d952f1a6ea85b76f75e0e57f33b8fa4b2bf3cb7db11b91b90171aeedd655a6", + "doc_kind": "readme", + "doc_version": null, + "document_id": "docs/README.md", + "source_path": "docs/README.md", + "section_path": "Project Docs > Структура", + "artifact_type": null, + "last_modified": null, + "section_title": "Структура", + "staleness_score": null, + "system_component": null + } + }, + { + "layer": "D0_DOC_CHUNKS", + "path": "docs/README.md", + "title": "docs/README.md:Навигация", + "content": "- [Обзор архитектуры](./documentation/architecture/telegram-notify-app-overview.md)\n- [API: health](./documentation/api/health-endpoint.md)\n- [API: actions](./documentation/api/control-actions-endpoint.md)\n- [API: send](./documentation/api/send-message-endpoint.md)\n- [Logic: цикл отправки уведомлений](./documentation/logic/telegram-notification-loop.md)\n- [Domain: runtime health](./documentation/domain/runtime-health-entity.md)", + "metadata": { + "tags": [], + "type": null, + "order": 3, + "owner": null, + "doc_id": null, + "module": null, + "repo_id": "test_echo_app", + "section": null, + "blob_sha": "81d952f1a6ea85b76f75e0e57f33b8fa4b2bf3cb7db11b91b90171aeedd655a6", + "doc_kind": "readme", + "doc_version": null, + "document_id": "docs/README.md", + "source_path": "docs/README.md", + "section_path": "Project Docs > Навигация", + "artifact_type": null, + "last_modified": null, + "section_title": "Навигация", + "staleness_score": null, + "system_component": null + } + } + ] +} +``` + +### User Prompt Overview +- question: Объясни как работает цикл отправки уведомлений +- intent: DOCUMENTATION_EXPLAIN +- sub_intent: SYSTEM_FLOW_EXPLAIN +- documents: 1 | samples: Readme +- facts: 0 +- relations: 2 | samples: api.control_actions_endpoint:part_of, api.control_actions_endpoint:related_api + +## Mismatches +- none \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/docs_router_llm_disambiguation/20260326_150213/summary.md b/tests/pipeline_setup_v3/test_results/docs_router_llm_disambiguation/20260326_150213/summary.md new file mode 100644 index 0000000..e514651 --- /dev/null +++ b/tests/pipeline_setup_v3/test_results/docs_router_llm_disambiguation/20260326_150213/summary.md @@ -0,0 +1,48 @@ +# pipeline_setup_v3 summary + +Passed: 10/10 + +| File | Case | Mode | Query | Actual sub-intent | RAG layers | Tokens | Pass | +|------|------|------|-------|-------------------|------------|--------|------| +| full_chain_docs_intents_v4-llm.yaml | v4-system-flow | full_chain | Объясни как работает цикл отправки уведомлений | SYSTEM_FLOW_EXPLAIN | D0_DOC_CHUNKS:4, D1_DOCUMENT_CATALOG:4, D4_WORKFLOW_INDEX:3, D5_RELATION_GRAPH:8 | 2803 | ✓ | +| full_chain_docs_intents_v4-llm.yaml | v4-component | full_chain | Как работает RuntimeManager? | COMPONENT_EXPLAIN | D0_DOC_CHUNKS:4, D1_DOCUMENT_CATALOG:4, D2_FACT_INDEX:2, D5_RELATION_GRAPH:8 | 2610 | ✓ | +| full_chain_docs_intents_v4-llm.yaml | v4-api | full_chain | Что делает endpoint /health? | API_METHOD_EXPLAIN | D1_DOCUMENT_CATALOG:1, D4_WORKFLOW_INDEX:1 | 1245 | ✓ | +| full_chain_docs_intents_v4-llm.yaml | v4-entity | full_chain | Что такое runtime health? | ENTITY_EXPLAIN | D0_DOC_CHUNKS:4, D1_DOCUMENT_CATALOG:4, D3_ENTITY_CATALOG:8, D5_RELATION_GRAPH:8 | 1992 | ✓ | +| full_chain_docs_intents_v4-llm.yaml | v4-related | full_chain | Какие документы связаны с endpoint /health? | RELATED_DOCS_EXPLAIN | D0_DOC_CHUNKS:6, D5_RELATION_GRAPH:8 | 1467 | ✓ | +| full_chain_docs_intents_v4-llm.yaml | v4-openapi-method | full_chain | Сгенерируй OpenAPI для endpoint /health | OPENAPI_METHOD_GENERATE | D1_DOCUMENT_CATALOG:1 | 878 | ✓ | +| full_chain_docs_intents_v4-llm.yaml | v4-openapi-fragment | full_chain | Сгенерируй request schema для endpoint /send | OPENAPI_FRAGMENT_GENERATE | D1_DOCUMENT_CATALOG:1 | 865 | ✓ | +| full_chain_docs_intents_v4-llm.yaml | v4-general | full_chain | Что описано в документации? | GENERIC_QA | D0_DOC_CHUNKS:4, D1_DOCUMENT_CATALOG:4 | 1211 | ✓ | +| full_chain_docs_intents_v4-llm.yaml | v4-negative | full_chain | Что такое PaymentTransaction? | ENTITY_EXPLAIN | D0_DOC_CHUNKS:4, D1_DOCUMENT_CATALOG:4, D3_ENTITY_CATALOG:8, D5_RELATION_GRAPH:8 | 1614 | ✓ | +| full_chain_docs_intents_v4-llm.yaml | v4-mixed | full_chain | Как работает /send и какие есть связанные документы? | RELATED_DOCS_EXPLAIN | D0_DOC_CHUNKS:6, D5_RELATION_GRAPH:8 | 1465 | ✓ | + +## LLM Answers +- **v4-system-flow** + Query: Объясни как работает цикл отправки уведомлений + > Из предоставленных данных не удалось найти информацию о цикле отправки уведомлений. Однако я могу указать, где искать необходимую информацию согласно структуре документации: \#\#\# Структура документации: \- \*\*Архитектура\*\*: documentation/architecture/ \- \*\*HTTP API Control Plane\*\*: documentation/api/ \- \*\*Основные Workflow и Бизнес\-логика\*\*: documentation/logic/ \- \*\*Ключевые сущности и состояния\*\*: documentation/domain/ \#\#\# Навигационные ссылки: Для получения информации о цикле отправки уведомлений рекомендую обратиться к следующему документу: \- \*\*Цикл отправки уведомлений\*\*: documentation/logic/telegram\-notification\-loop.md Пожалуйста, обратитесь непосредственно к указанному файлу для детального объяснения работы цикла отправки уведомлений. +- **v4-component** + Query: Как работает RuntimeManager? + > \#\#\# Краткое описание RuntimeManager не упоминается ни в одном из документов или фактов, представленных в запросе. Поэтому невозможно предоставить полное объяснение его работы по предоставленным данным. Однако, исходя из доступной информации о контрольных действиях и endpoint \`/actions/\{action\}\`, можно предположить, что RuntimeManager может быть связан с управлением жизненным циклом рабочих процессов через указанные endpoints. \#\#\# Основные элементы \- \*\*API Endpoint\*\*: \`/actions/\{action\}\` \- \*\*Поддерживаемые действия\*\*: \`start\`, \`stop\`, \`status\` \- \*\*Связанные сущности\*\*: \`ControlActionSet\`, \`TelegramControlChannel\` \#\#\# Как это работает В документах указано, что endpoint \`/actions/\{action\}\` управляет control actions runtime и использует делегирование задач в \`ControlActionSet\`. Подробности о том, как именно работает RuntimeManager, отсутствуют в предоставленных материала… +- **v4-api** + Query: Что делает endpoint /health? + > \#\#\# Краткое описание Endpoint \`/health\` предназначен для предоставления агрегированного health payload'а текущего состояния runtime. В зависимости от общего статуса он возвращает соответствующий HTTP код и payload: если статус равен \`"ok"\`, возвращается HTTP 200, иначе – HTTP 503 с подробностями о состоянии деградации или неготовности. \#\#\# Основные элементы \- \*\*Метод:\*\* GET \`/health\` \- \*\*Ответы:\*\* \- HTTP 200 при общем статусе \`"ok"\` \- HTTP 503 при любом другом статусе \- \*\*Payload:\*\* Агрегированное состояние здоровья runtime \#\#\# Как это работает 1. Клиент отправляет HTTP\-запрос типа GET на \`/health\`. 2. API обращается к провайдеру здоровья \(\`health\_provider\`\) через зарегистрированный канал \(\`TelegramControlChannel\`\), чтобы получить текущее состояние здоровья runtime. 3. Полученный health payload анализируется, определяется статус \("ok" или другой\). 4. На основе поля \`… +- **v4-entity** + Query: Что такое runtime health? + > \#\#\# Краткое описание Runtime Health – это доменная модель наблюдаемости сервиса, описывающая общее состояние runtime и отдельных его компонентов. Она используется для внешнего мониторинга здоровья приложения и внутренней диагностики. \#\#\# Основные элементы \- \*\*Компоненты\*\*: Главными объектами наблюдения являются компоненты, такие как \`telegram\_notify\`. \- \*\*Параметры\*\*: Важны параметры компонента, например, статус, время старта и количество успешных отправок. \- \*\*Модель\*\*: Представляет собой набор метрик и состояний, отражающих текущую работоспособность сервиса. \#\#\# Как это работает Модель Runtime Health собирает данные о состоянии различных компонентов сервиса и предоставляет их внешним системам мониторинга и внутренним диагностическим механизмам. Для тестового приложения \`test\_echo\_app\` основной наблюдаемый компонент \- это \`telegram\_notify\`. API endpoint \`/health\` пр… +- **v4-related** + Query: Какие документы связаны с endpoint /health? + > \#\#\# Краткое описание Документация описывает взаимосвязь между различными компонентами и документами в системе, связанными с endpoint’ом \`/health\`. \#\#\# Основные элементы 1. \*\*Relations\*\* – содержат информацию о связях между различными элементами системы. \- \*Layer\*: D5\_RELATION\_GRAPH \- \*Path\*: Путь к документу, описывающему связь \- \*Title\*: Название связи \- \*Content\*: Описание содержания связи \- \*Metadata\*: Дополнительные метаданные, такие как тип отношения, источник и цель связи. 2. \*\*Chunks\*\* – фрагменты документации, содержащие описание функциональности и назначения endpoint’ов. \- \*Layer\*: D0\_DOC\_CHUNKS \- \*Path\*: Путь к документу \- \*Title\*: Заголовок фрагмента \- \*Content\*: Основное содержание документа \- \*Metadata\*: Метаданные, включая теги, владельца, модуль, тип документа и другие атрибуты. \#\#\# Как это работает Связи между документами и компонентами системы предст… +- **v4-openapi-method** + Query: Сгенерируй OpenAPI для endpoint /health + > paths: /health: get: summary: HTTP API /health responses: '200': description: Общий статус равен \`ok\` '503': description: Состояния деградации или неготовности +- **v4-openapi-fragment** + Query: Сгенерируй request schema для endpoint /send + > requestBody: content: application/json: schema: type: object properties: chatId: type: string description: Идентификатор чата Telegram, куда отправляется сообщение messageText: type: string description: Текст сообщения, которое будет отправлено required: \- chatId \- messageText +- **v4-general** + Query: Что описано в документации? + > Документация описывает структуру проекта, включая разделы об архитектуре, HTTP API, бизнес\-логике и ключевых сущностях. Конкретно представлен endpoint \`/actions/\{action\}\`, который управляет контрольными действиями и поддерживает операции start, stop и status. +- **v4-negative** + Query: Что такое PaymentTransaction? + > К сожалению, на данный момент у меня нет информации о сущности PaymentTransaction в предоставленных вами данных. Однако я могу описать структуру и связи других элементов системы, основываясь на имеющихся данных: \#\#\# 1. Краткое описание Система включает несколько документов и метаданных, описывающих архитектуру, API, логику работы и ключевые сущности приложения. \#\#\# 2. Основные элементы \- \*\*Документы\*\*: Содержат информацию о структуре документации проекта и ссылки на различные разделы \(архитектура, API, логика, доменные сущности\). \- \*\*Сущности\*\*: Включают ControlActionSet и JSONResponse, связанные с API и жизненным циклом управления приложением. \- \*\*Связи\*\*: Определяют отношения между различными элементами системы, такими как часть архитектуры и связанные API. \#\#\# 3. Как это работает Документация организована по различным категориям, каждая из которых содержит специфи… +- **v4-mixed** + Query: Как работает /send и какие есть связанные документы? + > \#\#\# Краткое описание Отправка сообщений через endpoint \`/send\` реализована в приложении Telegram Notify App. Этот endpoint является частью архитектуры данного приложения и зависит от логики обработки уведомлений. \#\#\# Основные элементы \- \*\*Endpoint\*\*: \`/send\` \- \*\*Приложение\*\*: Telegram Notify App \- \*\*Логика обработки\*\*: telegram\_notification\_loop \#\#\# Как это работает Endpoint \`/send\` реализует отправку сообщений в рамках Telegram Notify App. Он использует логику обработки уведомлений \(\`telegram\_notification\_loop\`\) для выполнения своей функции. \#\#\# Связи с другими частями системы \- \*\*Родительская архитектура\*\*: architecture.telegram\_notify\_app \- \*\*Зависимости\*\*: logic.telegram\_notification\_loop \- \*\*Связанные API\*\*: api.send\_message\_endpoint \(в контексте документации архитектуры Telegram Notify App\) \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/manual_run/20260312_193339.zip b/tests/pipeline_setup_v3/test_results/manual_run/20260312_193339.zip deleted file mode 100644 index af85126..0000000 Binary files a/tests/pipeline_setup_v3/test_results/manual_run/20260312_193339.zip and /dev/null differ diff --git a/tests/pipeline_setup_v3/test_results/manual_run/20260312_193339/full_chain_plba_code_subintents_one_per_subintent_plba-v3-architecture-runtime-manager.json b/tests/pipeline_setup_v3/test_results/manual_run/20260312_193339/full_chain_plba_code_subintents_one_per_subintent_plba-v3-architecture-runtime-manager.json deleted file mode 100644 index f5b99ed..0000000 --- a/tests/pipeline_setup_v3/test_results/manual_run/20260312_193339/full_chain_plba_code_subintents_one_per_subintent_plba-v3-architecture-runtime-manager.json +++ /dev/null @@ -1,4715 +0,0 @@ -{ - "case_id": "plba-v3-architecture-runtime-manager", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_02_pipeline/full_chain_plba_code_subintents_one_per_subintent.yaml", - "runner": "agent_runtime", - "mode": "full_chain", - "query": "Какие компоненты участвуют в RuntimeManager?", - "actual": { - "intent": "CODE_QA", - "sub_intent": "ARCHITECTURE", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 33, - "llm_answer": "Компоненты, участвующие в подсистеме RuntimeManager:\n\n- **RuntimeManager** (src/app_runtime/core/runtime.py:18-179)\n- **ControlPlaneService.__init__** (src/app_runtime/control/service.py:14-51)\n- **RuntimeManager.__init__** (src/app_runtime/core/runtime.py:32-127)\n- **ControlPlaneService._start_async** (src/app_runtime/control/service.py:14-47)\n- **RuntimeManager.start** (src/app_runtime/core/runtime.py:32-59)\n- **ControlPlaneService.start** (src/app_runtime/control/service.py:14-20)\n- **ControlPlaneService.stop** (src/app_runtime/control/service.py:14-25)\n- **ControlPlaneService._stop_async** (src/app_runtime/control/service.py:14-51)\n- **RuntimeManager.add_config_file** (src/app_runtime/core/runtime.py:32-52)\n- **ControlPlaneService.register_channel** (src/app_runtime/control/service.py:14-17)\n\nСвязи между компонентами:\n\n- **ControlPlaneService.__init__ dataflow_slice ControlPlaneService._start_async**\n- **RuntimeManager.__init__ dataflow_slice RuntimeManager.start**\n- **ControlPlaneService.__init__ dataflow_slice ControlPlaneService.start**\n- **ControlPlaneService.__init__ dataflow_slice ControlPlaneService.stop**\n- **ControlPlaneService.__init__ dataflow_slice ControlPlaneService._stop_async**\n- **RuntimeManager.__init__ dataflow_slice RuntimeManager.add_config_file**\n- **ControlPlaneService.__init__ dataflow_slice ControlPlaneService.register_channel**\n- **RuntimeManager.__init__ dataflow_slice RuntimeManager._register_core_services**\n\nОтветственность подсистемы заключается в управлении жизненным циклом приложения, загрузке конфигурационных файлов и регистрации каналов управления через ControlPlaneService.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "RuntimeManager" - ], - "layers": [ - "C4_SEMANTIC_ROLES", - "C3_ENTRYPOINTS", - "C2_DEPENDENCY_GRAPH", - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS" - ] - }, - "passed": true, - "mismatches": [], - "details": { - "query": "Какие компоненты участвуют в RuntimeManager?", - "router_result": { - "schema_version": "1.1", - "intent": "CODE_QA", - "retrieval_profile": "code", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query_plan": { - "raw": "Какие компоненты участвуют в RuntimeManager?", - "normalized": "Какие компоненты участвуют в RuntimeManager?", - "sub_intent": "ARCHITECTURE", - "negations": [], - "expansions": [ - "RuntimeManager" - ], - "keyword_hints": [ - "RuntimeManager" - ], - "path_hints": [], - "doc_scope_hints": [], - "symbol_candidates": [ - "RuntimeManager" - ], - "symbol_kind_hint": "class", - "anchors": [ - { - "type": "SYMBOL", - "value": "RuntimeManager", - "source": "user_text", - "subtype": null, - "span": { - "start": 29, - "end": 43 - }, - "confidence": 0.88 - } - ] - }, - "retrieval_spec": { - "domains": [ - "CODE" - ], - "layer_queries": [ - { - "layer_id": "C4_SEMANTIC_ROLES", - "top_k": 12 - }, - { - "layer_id": "C3_ENTRYPOINTS", - "top_k": 8 - }, - { - "layer_id": "C2_DEPENDENCY_GRAPH", - "top_k": 8 - }, - { - "layer_id": "C1_SYMBOL_CATALOG", - "top_k": 6 - }, - { - "layer_id": "C0_SOURCE_CHUNKS", - "top_k": 4 - } - ], - "filters": { - "test_policy": "EXCLUDE", - "path_scope": [], - "language": [ - "python" - ] - }, - "rerank_profile": "code" - }, - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - }, - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "RuntimeManager", - "alternatives": [ - "RuntimeManager", - "RuntimeManager", - "RuntimeManager", - "RuntimeManager", - "RuntimeManager" - ], - "confidence": 0.99 - }, - "evidence_policy": { - "require_def": true, - "require_flow": true, - "require_spec": false, - "allow_answer_without_evidence": false - } - }, - "retrieval_request": { - "rag_session_id": "7d11da21-faa0-4cea-aede-aeabe069164c", - "query": "Какие компоненты участвуют в RuntimeManager?", - "sub_intent": "ARCHITECTURE", - "path_scope": [], - "keyword_hints": [ - "RuntimeManager" - ], - "symbol_candidates": [ - "RuntimeManager" - ], - "requested_layers": [ - "C4_SEMANTIC_ROLES", - "C3_ENTRYPOINTS", - "C2_DEPENDENCY_GRAPH", - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS" - ], - "retrieval_spec": { - "domains": [ - "CODE" - ], - "layer_queries": [ - { - "layer_id": "C4_SEMANTIC_ROLES", - "top_k": 12 - }, - { - "layer_id": "C3_ENTRYPOINTS", - "top_k": 8 - }, - { - "layer_id": "C2_DEPENDENCY_GRAPH", - "top_k": 8 - }, - { - "layer_id": "C1_SYMBOL_CATALOG", - "top_k": 6 - }, - { - "layer_id": "C0_SOURCE_CHUNKS", - "top_k": 4 - } - ], - "filters": { - "test_policy": "EXCLUDE", - "path_scope": [], - "language": [ - "python" - ] - }, - "rerank_profile": "code" - }, - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - }, - "query_plan": { - "raw": "Какие компоненты участвуют в RuntimeManager?", - "normalized": "Какие компоненты участвуют в RuntimeManager?", - "sub_intent": "ARCHITECTURE", - "negations": [], - "expansions": [ - "RuntimeManager" - ], - "keyword_hints": [ - "RuntimeManager" - ], - "path_hints": [], - "doc_scope_hints": [], - "symbol_candidates": [ - "RuntimeManager" - ], - "symbol_kind_hint": "class", - "anchors": [ - { - "type": "SYMBOL", - "value": "RuntimeManager", - "source": "user_text", - "subtype": null, - "span": { - "start": 29, - "end": 43 - }, - "confidence": 0.88 - } - ] - } - }, - "retrieval_result": { - "target_symbol_candidates": [ - "RuntimeManager", - "ControlChannel" - ], - "resolved_symbol": "RuntimeManager", - "symbol_resolution_status": "resolved", - "file_candidates": [ - "src/app_runtime/core/runtime.py", - "src/app_runtime/control/base.py", - "src/app_runtime/control/service.py", - "src/app_runtime/control/http_runner.py", - "src/app_runtime/control/http_channel.py", - "src/app_runtime/control/http_app.py", - "src/app_runtime/workflow/persistence/workflow_persistence.py", - "src/app_runtime/queue/in_memory.py", - "src/app_runtime/config/file_loader.py", - "src/app_runtime/tracing/store.py", - "src/app_runtime/workers/supervisor.py", - "src/plba/__init__.py", - "src/plba/core.py", - "src/plba/bootstrap.py", - "src/app_runtime/control/__init__.py" - ], - "code_chunks": [ - { - "layer": "C4_SEMANTIC_ROLES", - "path": "src/app_runtime/core/runtime.py", - "title": "RuntimeManager", - "content": "RuntimeManager\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests manager\n- orchestrates role-like calls (4)\n- reads and writes state attributes\n- participates in dataflow slices (50)", - "start_line": 18, - "end_line": 179, - "metadata": { - "symbol_id": "7e4a9381328c5803bbc6179458612fc4e947d928aa7bf8b4b2bebb2c8592f758", - "symbol_name": "RuntimeManager", - "qname": "RuntimeManager", - "role": "pipeline_stage", - "confidence": 0.67, - "dataflow_participation": 50, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C4_SEMANTIC_ROLES", - "path": "src/app_runtime/control/base.py", - "title": "ControlActionSet", - "content": "ControlActionSet\nrole: model\n\nResponsibilities:\n- default model role", - "start_line": 14, - "end_line": 18, - "metadata": { - "symbol_id": "46eb026cb3313415ec47b82dd22f84f4d112c9d987e8b1716dcb0baa1cce8988", - "symbol_name": "ControlActionSet", - "qname": "ControlActionSet", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C4_SEMANTIC_ROLES", - "path": "src/app_runtime/control/base.py", - "title": "ControlChannel", - "content": "ControlChannel\nrole: model\n\nResponsibilities:\n- default model role", - "start_line": 21, - "end_line": 28, - "metadata": { - "symbol_id": "cfcfe9a311d3a2dbdaf32ac4ccd73c0eb9a117f830591a1c0867ee97d46204ff", - "symbol_name": "ControlChannel", - "qname": "ControlChannel", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C4_SEMANTIC_ROLES", - "path": "src/app_runtime/control/service.py", - "title": "ControlPlaneService", - "content": "ControlPlaneService\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests service\n- reads and writes state attributes\n- participates in dataflow slices (5)", - "start_line": 12, - "end_line": 52, - "metadata": { - "symbol_id": "b13471e5916986dccffb53fab613812842965705e6b3a89ae549d30c9e91e9aa", - "symbol_name": "ControlPlaneService", - "qname": "ControlPlaneService", - "role": "pipeline_stage", - "confidence": 0.57, - "dataflow_participation": 5, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C4_SEMANTIC_ROLES", - "path": "src/app_runtime/control/http_runner.py", - "title": "UvicornThreadRunner", - "content": "UvicornThreadRunner\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (24)", - "start_line": 10, - "end_line": 61, - "metadata": { - "symbol_id": "fd55630045a02100df8877ac27d951ee08617d4598764394d48cb51fe067476a", - "symbol_name": "UvicornThreadRunner", - "qname": "UvicornThreadRunner", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 24, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "3779fdd2878b770e789a35bb2a89c9d79f13b61c26d7db1b3b683f9bb9e1623f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C4_SEMANTIC_ROLES", - "path": "src/app_runtime/control/http_channel.py", - "title": "HttpControlChannel", - "content": "HttpControlChannel\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (10)", - "start_line": 12, - "end_line": 57, - "metadata": { - "symbol_id": "1c9fbdc24819e5604c26ea55428a74310f03a03e1af197ed84846af61e42fdb0", - "symbol_name": "HttpControlChannel", - "qname": "HttpControlChannel", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 10, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C4_SEMANTIC_ROLES", - "path": "src/app_runtime/control/http_app.py", - "title": "HttpControlAppFactory", - "content": "HttpControlAppFactory\nrole: factory\n\nResponsibilities:\n- name suffix suggests factory", - "start_line": 15, - "end_line": 53, - "metadata": { - "symbol_id": "9b3502a5fb408b273223db13264349cf500de24915b6c649d9ea8970d0dfd8e0", - "symbol_name": "HttpControlAppFactory", - "qname": "HttpControlAppFactory", - "role": "factory", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C4_SEMANTIC_ROLES", - "path": "src/app_runtime/workflow/persistence/workflow_persistence.py", - "title": "WorkflowPersistence", - "content": "WorkflowPersistence\nrole: pipeline_stage\n\nResponsibilities:\n- orchestrates role-like calls (2)\n- reads and writes state attributes\n- participates in dataflow slices (16)", - "start_line": 8, - "end_line": 54, - "metadata": { - "symbol_id": "7bd01ee45cf31f2d5c2e3e51656254860ac785d10cef9e0852cd4fba90857bae", - "symbol_name": "WorkflowPersistence", - "qname": "WorkflowPersistence", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 16, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "80e9410ddc639789b4353c2a1a757ba8d0d5b5bb6075b0b263b61551f04ae1f0", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C4_SEMANTIC_ROLES", - "path": "src/app_runtime/queue/in_memory.py", - "title": "InMemoryTaskQueue", - "content": "InMemoryTaskQueue\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (9)", - "start_line": 9, - "end_line": 38, - "metadata": { - "symbol_id": "2da04cb94544a3bcbf0943a95ad4bdd8710bcafaa32a02fd0e4de2178dcf3533", - "symbol_name": "InMemoryTaskQueue", - "qname": "InMemoryTaskQueue", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 9, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "58f0cc001ccda0eee4c6bc32ed83bd05eafd6b6644f1e8b4aa9eed3103db73dc", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C4_SEMANTIC_ROLES", - "path": "src/app_runtime/config/file_loader.py", - "title": "ConfigFileLoader", - "content": "ConfigFileLoader\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (8)", - "start_line": 11, - "end_line": 48, - "metadata": { - "symbol_id": "a8474eca8b6e9dc86ae67ed68b16fa5fb639ef08739c053e7b7195489765667f", - "symbol_name": "ConfigFileLoader", - "qname": "ConfigFileLoader", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 8, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "1f19ffebde5e38e4be5a5d5a678059a0f36dedb8fb8b3e00ab395c67106a87ea", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C4_SEMANTIC_ROLES", - "path": "src/app_runtime/tracing/store.py", - "title": "TraceContextStore", - "content": "TraceContextStore\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (6)", - "start_line": 15, - "end_line": 52, - "metadata": { - "symbol_id": "b2dad4fbe16ffb11b58deba311c7739955c39d59f291b22181f33e9c8cce4059", - "symbol_name": "TraceContextStore", - "qname": "TraceContextStore", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 6, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "d369554f08fc92039c6edd5a2a1e73b23901533e8974459170bbd9347d263dc5", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C4_SEMANTIC_ROLES", - "path": "src/app_runtime/workers/supervisor.py", - "title": "WorkerSupervisor", - "content": "WorkerSupervisor\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (6)", - "start_line": 10, - "end_line": 59, - "metadata": { - "symbol_id": "c17b44e8d9e97d490989b21fa67d7c346cdda8a0472e4c41fb243c8846faa124", - "symbol_name": "WorkerSupervisor", - "qname": "WorkerSupervisor", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 6, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "77609d9d5927171cce7fc3a54897c183fd63068710c6362029b700937aae5eee", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C3_ENTRYPOINTS", - "path": "src/app_runtime/control/http_app.py", - "title": "app.post", - "content": "fastapi http app.post", - "start_line": 38, - "end_line": 42, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C3_ENTRYPOINTS", - "path": "src/app_runtime/control/http_app.py", - "title": "app.get", - "content": "fastapi http app.get", - "start_line": 31, - "end_line": 34, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C3_ENTRYPOINTS", - "path": "src/app_runtime/control/http_app.py", - "title": "app.get", - "content": "fastapi http app.get", - "start_line": 38, - "end_line": 42, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "path": "src/app_runtime/control/service.py", - "title": "ControlPlaneService.__init__:dataflow_slice", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._start_async", - "start_line": 14, - "end_line": 47, - "metadata": { - "edge_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517", - "dst_ref": "ControlPlaneService._start_async", - "resolution": "resolved", - "slice_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._start_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "path": "src/app_runtime/core/runtime.py", - "title": "RuntimeManager.__init__:dataflow_slice", - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager.start", - "start_line": 32, - "end_line": 59, - "metadata": { - "edge_id": "98312ace7fc62b1c7194c5aa1732b6ef736eae1668a3a120dd1ecd5ab1d64f7a", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "77a7b260193018845e4e204df094ab89cfd7c82ee4e822b3a83ad4cd945f9cb1", - "dst_ref": "RuntimeManager.start", - "resolution": "resolved", - "slice_id": "98312ace7fc62b1c7194c5aa1732b6ef736eae1668a3a120dd1ecd5ab1d64f7a", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager.start" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "77a7b260193018845e4e204df094ab89cfd7c82ee4e822b3a83ad4cd945f9cb1" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "path": "src/app_runtime/control/service.py", - "title": "ControlPlaneService.__init__:dataflow_slice", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.start", - "start_line": 14, - "end_line": 20, - "metadata": { - "edge_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154", - "dst_ref": "ControlPlaneService.start", - "resolution": "resolved", - "slice_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.start" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "path": "src/app_runtime/control/service.py", - "title": "ControlPlaneService.__init__:dataflow_slice", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.stop", - "start_line": 14, - "end_line": 25, - "metadata": { - "edge_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d", - "dst_ref": "ControlPlaneService.stop", - "resolution": "resolved", - "slice_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.stop" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "path": "src/app_runtime/control/service.py", - "title": "ControlPlaneService.__init__:dataflow_slice", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._stop_async", - "start_line": 14, - "end_line": 51, - "metadata": { - "edge_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a", - "dst_ref": "ControlPlaneService._stop_async", - "resolution": "resolved", - "slice_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._stop_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "path": "src/app_runtime/core/runtime.py", - "title": "RuntimeManager.__init__:dataflow_slice", - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager.add_config_file", - "start_line": 32, - "end_line": 52, - "metadata": { - "edge_id": "a23b8a11ebdb12708b60c96ea12a69f7f042082f1adfddd572444e246d81d167", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "57ffbd4f0d9fdf3507c2b8624312ce211f3d02fdf86a57a8ec90778d8a7b498d", - "dst_ref": "RuntimeManager.add_config_file", - "resolution": "resolved", - "slice_id": "a23b8a11ebdb12708b60c96ea12a69f7f042082f1adfddd572444e246d81d167", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager.add_config_file" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "57ffbd4f0d9fdf3507c2b8624312ce211f3d02fdf86a57a8ec90778d8a7b498d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "path": "src/app_runtime/control/service.py", - "title": "ControlPlaneService.__init__:dataflow_slice", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.register_channel", - "start_line": 14, - "end_line": 17, - "metadata": { - "edge_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957", - "dst_ref": "ControlPlaneService.register_channel", - "resolution": "resolved", - "slice_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.register_channel" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "path": "src/app_runtime/core/runtime.py", - "title": "RuntimeManager.__init__:dataflow_slice", - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager._register_core_services", - "start_line": 32, - "end_line": 127, - "metadata": { - "edge_id": "3e5811f3b511fa0cabe363f5d01f2ac5fa039bc8b93f7ee108323e1f5f45a293", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "972d6057a6caac9cf31ebc1e29c6f39f71b10d4cc170dec57cf875ba458549c6", - "dst_ref": "RuntimeManager._register_core_services", - "resolution": "resolved", - "slice_id": "3e5811f3b511fa0cabe363f5d01f2ac5fa039bc8b93f7ee108323e1f5f45a293", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager._register_core_services" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "972d6057a6caac9cf31ebc1e29c6f39f71b10d4cc170dec57cf875ba458549c6" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C1_SYMBOL_CATALOG", - "path": "src/plba/__init__.py", - "title": "RuntimeManager", - "content": "const RuntimeManager\nRuntimeManager = plba.core.RuntimeManager", - "start_line": 16, - "end_line": 16, - "metadata": { - "symbol_id": "7eacec84f9b8d6c4201374591faecdac7493091c263681495c338973f2971ad9", - "qname": "RuntimeManager", - "kind": "const", - "signature": "RuntimeManager = plba.core.RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "src.plba.__init__", - "is_test": false, - "blob_sha": "24e755ec8c249d14fb0e675b5dbf2b71ab91afb9c849897eebfa9feb2499e19d", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C1_SYMBOL_CATALOG", - "path": "src/plba/core.py", - "title": "RuntimeManager", - "content": "const RuntimeManager\nRuntimeManager = app_runtime.core.runtime.RuntimeManager", - "start_line": 2, - "end_line": 2, - "metadata": { - "symbol_id": "e1684562d978b7af7fe9b27dc5869d770348a87b5dc19a50360f58544668578b", - "qname": "RuntimeManager", - "kind": "const", - "signature": "RuntimeManager = app_runtime.core.runtime.RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "src.plba.core", - "is_test": false, - "blob_sha": "c0ae25110d20e665216616e26b68adfe035b624ba45d31d1272fb21f906f9ca8", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C1_SYMBOL_CATALOG", - "path": "src/app_runtime/control/service.py", - "title": "RuntimeManager", - "content": "const RuntimeManager\nRuntimeManager = app_runtime.core.runtime.RuntimeManager", - "start_line": 9, - "end_line": 9, - "metadata": { - "symbol_id": "62a9575c77aad894120d18b4f2a08cf2ba42f77e9be4a8a432b767d157701afe", - "qname": "RuntimeManager", - "kind": "const", - "signature": "RuntimeManager = app_runtime.core.runtime.RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.control.service", - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C1_SYMBOL_CATALOG", - "path": "src/app_runtime/core/runtime.py", - "title": "RuntimeManager", - "content": "class RuntimeManager\nRuntimeManager", - "start_line": 18, - "end_line": 179, - "metadata": { - "symbol_id": "7e4a9381328c5803bbc6179458612fc4e947d928aa7bf8b4b2bebb2c8592f758", - "qname": "RuntimeManager", - "kind": "class", - "signature": "RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.core.runtime", - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C1_SYMBOL_CATALOG", - "path": "src/plba/bootstrap.py", - "title": "RuntimeManager", - "content": "const RuntimeManager\nRuntimeManager = app_runtime.core.runtime.RuntimeManager", - "start_line": 4, - "end_line": 4, - "metadata": { - "symbol_id": "27158ca220022eeb5083c6addf8a50775d45f7161284fd60aac48410105f4b98", - "qname": "RuntimeManager", - "kind": "const", - "signature": "RuntimeManager = app_runtime.core.runtime.RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "src.plba.bootstrap", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C1_SYMBOL_CATALOG", - "path": "src/app_runtime/control/__init__.py", - "title": "ControlChannel", - "content": "const ControlChannel\nControlChannel = app_runtime.control.base.ControlChannel", - "start_line": 1, - "end_line": 1, - "metadata": { - "symbol_id": "268420f7aa4ed74082b9276cae0cded4f00bac090ffd58fa020a65be0fe19c27", - "qname": "ControlChannel", - "kind": "const", - "signature": "ControlChannel = app_runtime.control.base.ControlChannel", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.control.__init__", - "is_test": false, - "blob_sha": "bf3c37e3369a84cc618adc0fd71c232e5eb4b871eaff743069a17e661e498316", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C0_SOURCE_CHUNKS", - "path": "src/app_runtime/control/base.py", - "title": "src/app_runtime/control/base.py:ControlChannel", - "content": "class ControlChannel(ABC):\n @abstractmethod\n async def start(self, actions: ControlActionSet) -> None:\n \"\"\"Start the control channel and bind handlers.\"\"\"\n\n @abstractmethod\n async def stop(self) -> None:\n \"\"\"Stop the control channel and release resources.\"\"\"", - "start_line": 21, - "end_line": 28, - "metadata": { - "chunk_index": 1, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.base", - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C0_SOURCE_CHUNKS", - "path": "src/app_runtime/control/__init__.py", - "title": "src/app_runtime/control/__init__.py:1-5", - "content": "from app_runtime.control.base import ControlActionSet, ControlChannel\nfrom app_runtime.control.http_channel import HttpControlChannel\nfrom app_runtime.control.service import ControlPlaneService\n\n__all__ = [\"ControlActionSet\", \"ControlChannel\", \"ControlPlaneService\", \"HttpControlChannel\"]", - "start_line": 1, - "end_line": 5, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.app_runtime.control.__init__", - "is_test": false, - "blob_sha": "bf3c37e3369a84cc618adc0fd71c232e5eb4b871eaff743069a17e661e498316", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C0_SOURCE_CHUNKS", - "path": "src/app_runtime/control/base.py", - "title": "src/app_runtime/control/base.py:ControlActionSet", - "content": "class ControlActionSet:\n health: HealthHandler\n start: ActionHandler\n stop: ActionHandler\n status: ActionHandler", - "start_line": 14, - "end_line": 18, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.base", - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C0_SOURCE_CHUNKS", - "path": "src/app_runtime/control/http_app.py", - "title": "src/app_runtime/control/http_app.py:HttpControlAppFactory", - "content": "class HttpControlAppFactory:\n def create(\n self,\n health_provider: Callable[[], Awaitable[HealthPayload]],\n action_provider: Callable[[str, str], Awaitable[JSONResponse]],\n ) -> FastAPI:\n app = FastAPI(title=\"PLBA Control API\")\n\n @app.middleware(\"http\")\n async def log_api_call(request: Request, call_next): # type: ignore[no-untyped-def]\n started = time.monotonic()\n response = await call_next(request)\n response.headers[\"X-Response-Time-Ms\"] = str(int((time.monotonic() - started) * 1000))\n return response\n\n @app.get(\"/health\")\n async def health() -> JSONResponse:\n payload = await health_provider()\n status_code = 200 if payload.get(\"status\") == \"ok\" else 503\n return JSONResponse(content=payload, status_code=status_code)\n\n @app.get(\"/actions/{action}\")\n @app.post(\"/actions/{action}\")\n async def action(action: str, request: Request) -> JSONResponse:\n client_source = self._client_source(request)\n if action in {\"start\", \"stop\"}:\n LOGGER.warning(\"Control action requested: /actions/%s client=%s\", action, client_source)\n return await action_provider(action, client_source)\n\n return app\n\n def _client_source(self, request: Request) -> str:\n explicit_header = request.headers.get(\"X-Client-Source\", \"\").strip()\n if explicit_header:\n return explicit_header\n user_agent = request.headers.get(\"User-Agent\", \"\").strip()\n if user_agent:\n return f\"user-agent:{user_agent}\"\n return \"unknown\"", - "start_line": 15, - "end_line": 53, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.http_app", - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "relations": [ - { - "path": "src/app_runtime/control/service.py", - "start_line": 14, - "end_line": 47, - "edge_type": "dataflow_slice", - "source": "ControlPlaneService.__init__", - "target": "ControlPlaneService._start_async", - "metadata": { - "edge_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517", - "dst_ref": "ControlPlaneService._start_async", - "resolution": "resolved", - "slice_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._start_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - }, - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._start_async" - }, - { - "path": "src/app_runtime/core/runtime.py", - "start_line": 32, - "end_line": 59, - "edge_type": "dataflow_slice", - "source": "RuntimeManager.__init__", - "target": "RuntimeManager.start", - "metadata": { - "edge_id": "98312ace7fc62b1c7194c5aa1732b6ef736eae1668a3a120dd1ecd5ab1d64f7a", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "77a7b260193018845e4e204df094ab89cfd7c82ee4e822b3a83ad4cd945f9cb1", - "dst_ref": "RuntimeManager.start", - "resolution": "resolved", - "slice_id": "98312ace7fc62b1c7194c5aa1732b6ef736eae1668a3a120dd1ecd5ab1d64f7a", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager.start" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "77a7b260193018845e4e204df094ab89cfd7c82ee4e822b3a83ad4cd945f9cb1" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - }, - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager.start" - }, - { - "path": "src/app_runtime/control/service.py", - "start_line": 14, - "end_line": 20, - "edge_type": "dataflow_slice", - "source": "ControlPlaneService.__init__", - "target": "ControlPlaneService.start", - "metadata": { - "edge_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154", - "dst_ref": "ControlPlaneService.start", - "resolution": "resolved", - "slice_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.start" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - }, - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.start" - }, - { - "path": "src/app_runtime/control/service.py", - "start_line": 14, - "end_line": 25, - "edge_type": "dataflow_slice", - "source": "ControlPlaneService.__init__", - "target": "ControlPlaneService.stop", - "metadata": { - "edge_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d", - "dst_ref": "ControlPlaneService.stop", - "resolution": "resolved", - "slice_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.stop" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - }, - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.stop" - }, - { - "path": "src/app_runtime/control/service.py", - "start_line": 14, - "end_line": 51, - "edge_type": "dataflow_slice", - "source": "ControlPlaneService.__init__", - "target": "ControlPlaneService._stop_async", - "metadata": { - "edge_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a", - "dst_ref": "ControlPlaneService._stop_async", - "resolution": "resolved", - "slice_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._stop_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - }, - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._stop_async" - }, - { - "path": "src/app_runtime/core/runtime.py", - "start_line": 32, - "end_line": 52, - "edge_type": "dataflow_slice", - "source": "RuntimeManager.__init__", - "target": "RuntimeManager.add_config_file", - "metadata": { - "edge_id": "a23b8a11ebdb12708b60c96ea12a69f7f042082f1adfddd572444e246d81d167", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "57ffbd4f0d9fdf3507c2b8624312ce211f3d02fdf86a57a8ec90778d8a7b498d", - "dst_ref": "RuntimeManager.add_config_file", - "resolution": "resolved", - "slice_id": "a23b8a11ebdb12708b60c96ea12a69f7f042082f1adfddd572444e246d81d167", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager.add_config_file" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "57ffbd4f0d9fdf3507c2b8624312ce211f3d02fdf86a57a8ec90778d8a7b498d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - }, - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager.add_config_file" - }, - { - "path": "src/app_runtime/control/service.py", - "start_line": 14, - "end_line": 17, - "edge_type": "dataflow_slice", - "source": "ControlPlaneService.__init__", - "target": "ControlPlaneService.register_channel", - "metadata": { - "edge_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957", - "dst_ref": "ControlPlaneService.register_channel", - "resolution": "resolved", - "slice_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.register_channel" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - }, - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.register_channel" - }, - { - "path": "src/app_runtime/core/runtime.py", - "start_line": 32, - "end_line": 127, - "edge_type": "dataflow_slice", - "source": "RuntimeManager.__init__", - "target": "RuntimeManager._register_core_services", - "metadata": { - "edge_id": "3e5811f3b511fa0cabe363f5d01f2ac5fa039bc8b93f7ee108323e1f5f45a293", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "972d6057a6caac9cf31ebc1e29c6f39f71b10d4cc170dec57cf875ba458549c6", - "dst_ref": "RuntimeManager._register_core_services", - "resolution": "resolved", - "slice_id": "3e5811f3b511fa0cabe363f5d01f2ac5fa039bc8b93f7ee108323e1f5f45a293", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager._register_core_services" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "972d6057a6caac9cf31ebc1e29c6f39f71b10d4cc170dec57cf875ba458549c6" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - }, - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager._register_core_services" - } - ], - "semantic_hints": [ - { - "path": "src/app_runtime/core/runtime.py", - "title": "RuntimeManager", - "symbol": "RuntimeManager", - "role": "pipeline_stage", - "confidence": 0.67, - "content": "RuntimeManager\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests manager\n- orchestrates role-like calls (4)\n- reads and writes state attributes\n- participates in dataflow slices (50)" - }, - { - "path": "src/app_runtime/control/base.py", - "title": "ControlActionSet", - "symbol": "ControlActionSet", - "role": "model", - "confidence": 0.99, - "content": "ControlActionSet\nrole: model\n\nResponsibilities:\n- default model role" - }, - { - "path": "src/app_runtime/control/base.py", - "title": "ControlChannel", - "symbol": "ControlChannel", - "role": "model", - "confidence": 0.99, - "content": "ControlChannel\nrole: model\n\nResponsibilities:\n- default model role" - }, - { - "path": "src/app_runtime/control/service.py", - "title": "ControlPlaneService", - "symbol": "ControlPlaneService", - "role": "pipeline_stage", - "confidence": 0.57, - "content": "ControlPlaneService\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests service\n- reads and writes state attributes\n- participates in dataflow slices (5)" - }, - { - "path": "src/app_runtime/control/http_runner.py", - "title": "UvicornThreadRunner", - "symbol": "UvicornThreadRunner", - "role": "pipeline_stage", - "confidence": 0.99, - "content": "UvicornThreadRunner\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (24)" - }, - { - "path": "src/app_runtime/control/http_channel.py", - "title": "HttpControlChannel", - "symbol": "HttpControlChannel", - "role": "pipeline_stage", - "confidence": 0.99, - "content": "HttpControlChannel\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (10)" - }, - { - "path": "src/app_runtime/control/http_app.py", - "title": "HttpControlAppFactory", - "symbol": "HttpControlAppFactory", - "role": "factory", - "confidence": 0.99, - "content": "HttpControlAppFactory\nrole: factory\n\nResponsibilities:\n- name suffix suggests factory" - }, - { - "path": "src/app_runtime/workflow/persistence/workflow_persistence.py", - "title": "WorkflowPersistence", - "symbol": "WorkflowPersistence", - "role": "pipeline_stage", - "confidence": 0.99, - "content": "WorkflowPersistence\nrole: pipeline_stage\n\nResponsibilities:\n- orchestrates role-like calls (2)\n- reads and writes state attributes\n- participates in dataflow slices (16)" - }, - { - "path": "src/app_runtime/queue/in_memory.py", - "title": "InMemoryTaskQueue", - "symbol": "InMemoryTaskQueue", - "role": "pipeline_stage", - "confidence": 0.99, - "content": "InMemoryTaskQueue\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (9)" - }, - { - "path": "src/app_runtime/config/file_loader.py", - "title": "ConfigFileLoader", - "symbol": "ConfigFileLoader", - "role": "pipeline_stage", - "confidence": 0.99, - "content": "ConfigFileLoader\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (8)" - }, - { - "path": "src/app_runtime/tracing/store.py", - "title": "TraceContextStore", - "symbol": "TraceContextStore", - "role": "pipeline_stage", - "confidence": 0.99, - "content": "TraceContextStore\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (6)" - }, - { - "path": "src/app_runtime/workers/supervisor.py", - "title": "WorkerSupervisor", - "symbol": "WorkerSupervisor", - "role": "pipeline_stage", - "confidence": 0.99, - "content": "WorkerSupervisor\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (6)" - } - ], - "entrypoints": [ - { - "path": "src/app_runtime/control/http_app.py", - "title": "app.get", - "start_line": 31, - "end_line": 34, - "http_method": "GET", - "route_path": "/health", - "handler_symbol": "health", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "route_or_command": "app.get", - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "title": "app.get", - "start_line": 38, - "end_line": 42, - "http_method": "GET", - "route_path": "/actions/{action}", - "handler_symbol": "action", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "route_or_command": "app.get", - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "title": "app.post", - "start_line": 38, - "end_line": 42, - "http_method": "POST", - "route_path": "/actions/{action}", - "handler_symbol": "action", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "route_or_command": "app.post", - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "test_candidates": [], - "layer_outcomes": [ - { - "layer_id": "C4_SEMANTIC_ROLES", - "hit_count": 12, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C3_ENTRYPOINTS", - "hit_count": 3, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C2_DEPENDENCY_GRAPH", - "hit_count": 8, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C1_SYMBOL_CATALOG", - "hit_count": 6, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C0_SOURCE_CHUNKS", - "hit_count": 4, - "empty": false, - "fallback_used": false - } - ], - "missing_layers": [], - "raw_rows": [ - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests manager\n- orchestrates role-like calls (4)\n- reads and writes state attributes\n- participates in dataflow slices (50)", - "layer": "C4_SEMANTIC_ROLES", - "title": "RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 43, - "layer_rank": 2, - "distance": null, - "metadata": { - "symbol_id": "7e4a9381328c5803bbc6179458612fc4e947d928aa7bf8b4b2bebb2c8592f758", - "symbol_name": "RuntimeManager", - "qname": "RuntimeManager", - "role": "pipeline_stage", - "confidence": 0.67, - "dataflow_participation": 50, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "ControlActionSet\nrole: model\n\nResponsibilities:\n- default model role", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlActionSet", - "span_start": 14, - "span_end": 18, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 40, - "layer_rank": 2, - "distance": null, - "metadata": { - "symbol_id": "46eb026cb3313415ec47b82dd22f84f4d112c9d987e8b1716dcb0baa1cce8988", - "symbol_name": "ControlActionSet", - "qname": "ControlActionSet", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "ControlChannel\nrole: model\n\nResponsibilities:\n- default model role", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlChannel", - "span_start": 21, - "span_end": 28, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 40, - "layer_rank": 2, - "distance": null, - "metadata": { - "symbol_id": "cfcfe9a311d3a2dbdaf32ac4ccd73c0eb9a117f830591a1c0867ee97d46204ff", - "symbol_name": "ControlChannel", - "qname": "ControlChannel", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests service\n- reads and writes state attributes\n- participates in dataflow slices (5)", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlPlaneService", - "span_start": 12, - "span_end": 52, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 68, - "layer_rank": 2, - "distance": null, - "metadata": { - "symbol_id": "b13471e5916986dccffb53fab613812842965705e6b3a89ae549d30c9e91e9aa", - "symbol_name": "ControlPlaneService", - "qname": "ControlPlaneService", - "role": "pipeline_stage", - "confidence": 0.57, - "dataflow_participation": 5, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_runner.py", - "content": "UvicornThreadRunner\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (24)", - "layer": "C4_SEMANTIC_ROLES", - "title": "UvicornThreadRunner", - "span_start": 10, - "span_end": 61, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 11, - "layer_rank": 2, - "distance": null, - "metadata": { - "symbol_id": "fd55630045a02100df8877ac27d951ee08617d4598764394d48cb51fe067476a", - "symbol_name": "UvicornThreadRunner", - "qname": "UvicornThreadRunner", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 24, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "3779fdd2878b770e789a35bb2a89c9d79f13b61c26d7db1b3b683f9bb9e1623f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (10)", - "layer": "C4_SEMANTIC_ROLES", - "title": "HttpControlChannel", - "span_start": 12, - "span_end": 57, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 21, - "layer_rank": 2, - "distance": null, - "metadata": { - "symbol_id": "1c9fbdc24819e5604c26ea55428a74310f03a03e1af197ed84846af61e42fdb0", - "symbol_name": "HttpControlChannel", - "qname": "HttpControlChannel", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 10, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "HttpControlAppFactory\nrole: factory\n\nResponsibilities:\n- name suffix suggests factory", - "layer": "C4_SEMANTIC_ROLES", - "title": "HttpControlAppFactory", - "span_start": 15, - "span_end": 53, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 39, - "layer_rank": 2, - "distance": null, - "metadata": { - "symbol_id": "9b3502a5fb408b273223db13264349cf500de24915b6c649d9ea8970d0dfd8e0", - "symbol_name": "HttpControlAppFactory", - "qname": "HttpControlAppFactory", - "role": "factory", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/persistence/workflow_persistence.py", - "content": "WorkflowPersistence\nrole: pipeline_stage\n\nResponsibilities:\n- orchestrates role-like calls (2)\n- reads and writes state attributes\n- participates in dataflow slices (16)", - "layer": "C4_SEMANTIC_ROLES", - "title": "WorkflowPersistence", - "span_start": 8, - "span_end": 54, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 15, - "layer_rank": 2, - "distance": null, - "metadata": { - "symbol_id": "7bd01ee45cf31f2d5c2e3e51656254860ac785d10cef9e0852cd4fba90857bae", - "symbol_name": "WorkflowPersistence", - "qname": "WorkflowPersistence", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 16, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "80e9410ddc639789b4353c2a1a757ba8d0d5b5bb6075b0b263b61551f04ae1f0", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/queue/in_memory.py", - "content": "InMemoryTaskQueue\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (9)", - "layer": "C4_SEMANTIC_ROLES", - "title": "InMemoryTaskQueue", - "span_start": 9, - "span_end": 38, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 22, - "layer_rank": 2, - "distance": null, - "metadata": { - "symbol_id": "2da04cb94544a3bcbf0943a95ad4bdd8710bcafaa32a02fd0e4de2178dcf3533", - "symbol_name": "InMemoryTaskQueue", - "qname": "InMemoryTaskQueue", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 9, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "58f0cc001ccda0eee4c6bc32ed83bd05eafd6b6644f1e8b4aa9eed3103db73dc", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/config/file_loader.py", - "content": "ConfigFileLoader\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (8)", - "layer": "C4_SEMANTIC_ROLES", - "title": "ConfigFileLoader", - "span_start": 11, - "span_end": 48, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 23, - "layer_rank": 2, - "distance": null, - "metadata": { - "symbol_id": "a8474eca8b6e9dc86ae67ed68b16fa5fb639ef08739c053e7b7195489765667f", - "symbol_name": "ConfigFileLoader", - "qname": "ConfigFileLoader", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 8, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "1f19ffebde5e38e4be5a5d5a678059a0f36dedb8fb8b3e00ab395c67106a87ea", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/store.py", - "content": "TraceContextStore\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (6)", - "layer": "C4_SEMANTIC_ROLES", - "title": "TraceContextStore", - "span_start": 15, - "span_end": 52, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 25, - "layer_rank": 2, - "distance": null, - "metadata": { - "symbol_id": "b2dad4fbe16ffb11b58deba311c7739955c39d59f291b22181f33e9c8cce4059", - "symbol_name": "TraceContextStore", - "qname": "TraceContextStore", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 6, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "d369554f08fc92039c6edd5a2a1e73b23901533e8974459170bbd9347d263dc5", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workers/supervisor.py", - "content": "WorkerSupervisor\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (6)", - "layer": "C4_SEMANTIC_ROLES", - "title": "WorkerSupervisor", - "span_start": 10, - "span_end": 59, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 25, - "layer_rank": 2, - "distance": null, - "metadata": { - "symbol_id": "c17b44e8d9e97d490989b21fa67d7c346cdda8a0472e4c41fb243c8846faa124", - "symbol_name": "WorkerSupervisor", - "qname": "WorkerSupervisor", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 6, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "77609d9d5927171cce7fc3a54897c183fd63068710c6362029b700937aae5eee", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": null, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": null, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": null, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._start_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 47, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": null, - "metadata": { - "edge_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517", - "dst_ref": "ControlPlaneService._start_async", - "resolution": "resolved", - "slice_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._start_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager.start", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 32, - "span_end": 59, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": null, - "metadata": { - "edge_id": "98312ace7fc62b1c7194c5aa1732b6ef736eae1668a3a120dd1ecd5ab1d64f7a", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "77a7b260193018845e4e204df094ab89cfd7c82ee4e822b3a83ad4cd945f9cb1", - "dst_ref": "RuntimeManager.start", - "resolution": "resolved", - "slice_id": "98312ace7fc62b1c7194c5aa1732b6ef736eae1668a3a120dd1ecd5ab1d64f7a", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager.start" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "77a7b260193018845e4e204df094ab89cfd7c82ee4e822b3a83ad4cd945f9cb1" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.start", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 20, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": null, - "metadata": { - "edge_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154", - "dst_ref": "ControlPlaneService.start", - "resolution": "resolved", - "slice_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.start" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.stop", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 25, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": null, - "metadata": { - "edge_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d", - "dst_ref": "ControlPlaneService.stop", - "resolution": "resolved", - "slice_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.stop" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._stop_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 51, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": null, - "metadata": { - "edge_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a", - "dst_ref": "ControlPlaneService._stop_async", - "resolution": "resolved", - "slice_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._stop_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager.add_config_file", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 32, - "span_end": 52, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": null, - "metadata": { - "edge_id": "a23b8a11ebdb12708b60c96ea12a69f7f042082f1adfddd572444e246d81d167", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "57ffbd4f0d9fdf3507c2b8624312ce211f3d02fdf86a57a8ec90778d8a7b498d", - "dst_ref": "RuntimeManager.add_config_file", - "resolution": "resolved", - "slice_id": "a23b8a11ebdb12708b60c96ea12a69f7f042082f1adfddd572444e246d81d167", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager.add_config_file" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "57ffbd4f0d9fdf3507c2b8624312ce211f3d02fdf86a57a8ec90778d8a7b498d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.register_channel", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 17, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": null, - "metadata": { - "edge_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957", - "dst_ref": "ControlPlaneService.register_channel", - "resolution": "resolved", - "slice_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.register_channel" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager._register_core_services", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 32, - "span_end": 127, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": null, - "metadata": { - "edge_id": "3e5811f3b511fa0cabe363f5d01f2ac5fa039bc8b93f7ee108323e1f5f45a293", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "972d6057a6caac9cf31ebc1e29c6f39f71b10d4cc170dec57cf875ba458549c6", - "dst_ref": "RuntimeManager._register_core_services", - "resolution": "resolved", - "slice_id": "3e5811f3b511fa0cabe363f5d01f2ac5fa039bc8b93f7ee108323e1f5f45a293", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager._register_core_services" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "972d6057a6caac9cf31ebc1e29c6f39f71b10d4cc170dec57cf875ba458549c6" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/__init__.py", - "content": "const RuntimeManager\nRuntimeManager = plba.core.RuntimeManager", - "layer": "C1_SYMBOL_CATALOG", - "title": "RuntimeManager", - "span_start": 16, - "span_end": 16, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": null, - "metadata": { - "symbol_id": "7eacec84f9b8d6c4201374591faecdac7493091c263681495c338973f2971ad9", - "qname": "RuntimeManager", - "kind": "const", - "signature": "RuntimeManager = plba.core.RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "src.plba.__init__", - "is_test": false, - "blob_sha": "24e755ec8c249d14fb0e675b5dbf2b71ab91afb9c849897eebfa9feb2499e19d", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/core.py", - "content": "const RuntimeManager\nRuntimeManager = app_runtime.core.runtime.RuntimeManager", - "layer": "C1_SYMBOL_CATALOG", - "title": "RuntimeManager", - "span_start": 2, - "span_end": 2, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": null, - "metadata": { - "symbol_id": "e1684562d978b7af7fe9b27dc5869d770348a87b5dc19a50360f58544668578b", - "qname": "RuntimeManager", - "kind": "const", - "signature": "RuntimeManager = app_runtime.core.runtime.RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "src.plba.core", - "is_test": false, - "blob_sha": "c0ae25110d20e665216616e26b68adfe035b624ba45d31d1272fb21f906f9ca8", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "const RuntimeManager\nRuntimeManager = app_runtime.core.runtime.RuntimeManager", - "layer": "C1_SYMBOL_CATALOG", - "title": "RuntimeManager", - "span_start": 9, - "span_end": 9, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": null, - "metadata": { - "symbol_id": "62a9575c77aad894120d18b4f2a08cf2ba42f77e9be4a8a432b767d157701afe", - "qname": "RuntimeManager", - "kind": "const", - "signature": "RuntimeManager = app_runtime.core.runtime.RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.control.service", - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "class RuntimeManager\nRuntimeManager", - "layer": "C1_SYMBOL_CATALOG", - "title": "RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": null, - "metadata": { - "symbol_id": "7e4a9381328c5803bbc6179458612fc4e947d928aa7bf8b4b2bebb2c8592f758", - "qname": "RuntimeManager", - "kind": "class", - "signature": "RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.core.runtime", - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/bootstrap.py", - "content": "const RuntimeManager\nRuntimeManager = app_runtime.core.runtime.RuntimeManager", - "layer": "C1_SYMBOL_CATALOG", - "title": "RuntimeManager", - "span_start": 4, - "span_end": 4, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": null, - "metadata": { - "symbol_id": "27158ca220022eeb5083c6addf8a50775d45f7161284fd60aac48410105f4b98", - "qname": "RuntimeManager", - "kind": "const", - "signature": "RuntimeManager = app_runtime.core.runtime.RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "src.plba.bootstrap", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/__init__.py", - "content": "const ControlChannel\nControlChannel = app_runtime.control.base.ControlChannel", - "layer": "C1_SYMBOL_CATALOG", - "title": "ControlChannel", - "span_start": 1, - "span_end": 1, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": null, - "metadata": { - "symbol_id": "268420f7aa4ed74082b9276cae0cded4f00bac090ffd58fa020a65be0fe19c27", - "qname": "ControlChannel", - "kind": "const", - "signature": "ControlChannel = app_runtime.control.base.ControlChannel", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.control.__init__", - "is_test": false, - "blob_sha": "bf3c37e3369a84cc618adc0fd71c232e5eb4b871eaff743069a17e661e498316", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "class ControlChannel(ABC):\n @abstractmethod\n async def start(self, actions: ControlActionSet) -> None:\n \"\"\"Start the control channel and bind handlers.\"\"\"\n\n @abstractmethod\n async def stop(self) -> None:\n \"\"\"Stop the control channel and release resources.\"\"\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/base.py:ControlChannel", - "span_start": 21, - "span_end": 28, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": null, - "metadata": { - "chunk_index": 1, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.base", - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/__init__.py", - "content": "from app_runtime.control.base import ControlActionSet, ControlChannel\nfrom app_runtime.control.http_channel import HttpControlChannel\nfrom app_runtime.control.service import ControlPlaneService\n\n__all__ = [\"ControlActionSet\", \"ControlChannel\", \"ControlPlaneService\", \"HttpControlChannel\"]", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/__init__.py:1-5", - "span_start": 1, - "span_end": 5, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": null, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.app_runtime.control.__init__", - "is_test": false, - "blob_sha": "bf3c37e3369a84cc618adc0fd71c232e5eb4b871eaff743069a17e661e498316", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "class ControlActionSet:\n health: HealthHandler\n start: ActionHandler\n stop: ActionHandler\n status: ActionHandler", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/base.py:ControlActionSet", - "span_start": 14, - "span_end": 18, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": null, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.base", - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "class HttpControlAppFactory:\n def create(\n self,\n health_provider: Callable[[], Awaitable[HealthPayload]],\n action_provider: Callable[[str, str], Awaitable[JSONResponse]],\n ) -> FastAPI:\n app = FastAPI(title=\"PLBA Control API\")\n\n @app.middleware(\"http\")\n async def log_api_call(request: Request, call_next): # type: ignore[no-untyped-def]\n started = time.monotonic()\n response = await call_next(request)\n response.headers[\"X-Response-Time-Ms\"] = str(int((time.monotonic() - started) * 1000))\n return response\n\n @app.get(\"/health\")\n async def health() -> JSONResponse:\n payload = await health_provider()\n status_code = 200 if payload.get(\"status\") == \"ok\" else 503\n return JSONResponse(content=payload, status_code=status_code)\n\n @app.get(\"/actions/{action}\")\n @app.post(\"/actions/{action}\")\n async def action(action: str, request: Request) -> JSONResponse:\n client_source = self._client_source(request)\n if action in {\"start\", \"stop\"}:\n LOGGER.warning(\"Control action requested: /actions/%s client=%s\", action, client_source)\n return await action_provider(action, client_source)\n\n return app\n\n def _client_source(self, request: Request) -> str:\n explicit_header = request.headers.get(\"X-Client-Source\", \"\").strip()\n if explicit_header:\n return explicit_header\n user_agent = request.headers.get(\"User-Agent\", \"\").strip()\n if user_agent:\n return f\"user-agent:{user_agent}\"\n return \"unknown\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/http_app.py:HttpControlAppFactory", - "span_start": 15, - "span_end": 53, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": null, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.http_app", - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "retrieval_report": { - "executed_layers": [ - "C4_SEMANTIC_ROLES", - "C3_ENTRYPOINTS", - "C2_DEPENDENCY_GRAPH", - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS" - ], - "retrieval_mode_by_layer": { - "C4_SEMANTIC_ROLES": "vector", - "C3_ENTRYPOINTS": "vector", - "C2_DEPENDENCY_GRAPH": "vector", - "C1_SYMBOL_CATALOG": "vector", - "C0_SOURCE_CHUNKS": "vector" - }, - "top_k_by_layer": { - "C4_SEMANTIC_ROLES": 12, - "C3_ENTRYPOINTS": 8, - "C2_DEPENDENCY_GRAPH": 8, - "C1_SYMBOL_CATALOG": 6, - "C0_SOURCE_CHUNKS": 4 - }, - "filters_by_layer": { - "C4_SEMANTIC_ROLES": { - "path_scope": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [] - }, - "C1_SYMBOL_CATALOG": { - "path_scope": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [] - } - }, - "fallback": { - "used": false, - "reason": null - }, - "retrieval_by_layer_ms": { - "C4_SEMANTIC_ROLES": 43, - "C3_ENTRYPOINTS": 25, - "C2_DEPENDENCY_GRAPH": 64, - "C1_SYMBOL_CATALOG": 34, - "C0_SOURCE_CHUNKS": 27 - } - } - }, - "diagnostics": { - "intent_correct": null, - "target_found": true, - "layers_used": [ - "C4_SEMANTIC_ROLES", - "C3_ENTRYPOINTS", - "C2_DEPENDENCY_GRAPH", - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS" - ], - "retrieval_sufficient": true, - "answer_mode": "normal", - "resolved_target": "RuntimeManager", - "answer_policy_branch": "normal_answer", - "decision_reason": "evidence_sufficient", - "router_result": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "retrieval_profile": "code", - "sub_intent": "ARCHITECTURE", - "path_scope": [], - "layers": [ - "C4_SEMANTIC_ROLES", - "C3_ENTRYPOINTS", - "C2_DEPENDENCY_GRAPH", - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS" - ], - "symbol_resolution_status": "resolved" - }, - "retrieval_request": { - "rag_session_id": "7d11da21-faa0-4cea-aede-aeabe069164c", - "query": "Какие компоненты участвуют в RuntimeManager?", - "sub_intent": "ARCHITECTURE", - "path_scope": [], - "requested_layers": [ - "C4_SEMANTIC_ROLES", - "C3_ENTRYPOINTS", - "C2_DEPENDENCY_GRAPH", - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS" - ] - }, - "per_layer_outcome": [ - { - "layer_id": "C4_SEMANTIC_ROLES", - "hit_count": 12, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C3_ENTRYPOINTS", - "hit_count": 3, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C2_DEPENDENCY_GRAPH", - "hit_count": 8, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C1_SYMBOL_CATALOG", - "hit_count": 6, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C0_SOURCE_CHUNKS", - "hit_count": 4, - "empty": false, - "fallback_used": false - } - ], - "empty_layers": [], - "evidence_gate_decision": { - "sufficient": true, - "failure_reasons": [], - "evidence_count": 33 - }, - "evidence_gate_input": { - "resolved_target": "RuntimeManager", - "sub_intent": "ARCHITECTURE", - "target_type": "symbol", - "evidence_count": 33, - "code_chunk_count": 33, - "entrypoint_count": 3, - "relation_count": 8, - "test_evidence_count": 0, - "symbol_resolution_status": "resolved", - "path_scope": [] - }, - "post_evidence_gate": { - "input": { - "answer_mode": "normal", - "degraded_message": "", - "resolved_target": "RuntimeManager", - "draft_answer_preview": "Компоненты, участвующие в подсистеме RuntimeManager:\n\n- **RuntimeManager** (src/app_runtime/core/runtime.py:18-179)\n- **ControlPlaneService.__init__** (src/app_runtime/control/service.py:14-51)\n- **RuntimeManager.__init__** (src/app_runtime/core/runtime.py:32-127)\n- **ControlPlaneService._start_asyn", - "repair_candidate": true - }, - "output": { - "passed": true, - "action": "return", - "reasons": [], - "repair_used": false, - "final_answer_preview": "Компоненты, участвующие в подсистеме RuntimeManager:\n\n- **RuntimeManager** (src/app_runtime/core/runtime.py:18-179)\n- **ControlPlaneService.__init__** (src/app_runtime/control/service.py:14-51)\n- **RuntimeManager.__init__** (src/app_runtime/core/runtime.py:32-127)\n- **ControlPlaneService._start_asyn" - } - }, - "failure_reasons": [], - "timings_ms": { - "router": 1, - "retrieval": 196, - "pre_evidence_gate": 1, - "llm": 9911, - "post_evidence_gate": 1 - } - }, - "rag_rows": [ - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests manager\n- orchestrates role-like calls (4)\n- reads and writes state attributes\n- participates in dataflow slices (50)", - "layer": "C4_SEMANTIC_ROLES", - "title": "RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 43, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "7e4a9381328c5803bbc6179458612fc4e947d928aa7bf8b4b2bebb2c8592f758", - "symbol_name": "RuntimeManager", - "qname": "RuntimeManager", - "role": "pipeline_stage", - "confidence": 0.67, - "dataflow_participation": 50, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "ControlActionSet\nrole: model\n\nResponsibilities:\n- default model role", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlActionSet", - "span_start": 14, - "span_end": 18, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 40, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "46eb026cb3313415ec47b82dd22f84f4d112c9d987e8b1716dcb0baa1cce8988", - "symbol_name": "ControlActionSet", - "qname": "ControlActionSet", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "ControlChannel\nrole: model\n\nResponsibilities:\n- default model role", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlChannel", - "span_start": 21, - "span_end": 28, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 40, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "cfcfe9a311d3a2dbdaf32ac4ccd73c0eb9a117f830591a1c0867ee97d46204ff", - "symbol_name": "ControlChannel", - "qname": "ControlChannel", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests service\n- reads and writes state attributes\n- participates in dataflow slices (5)", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlPlaneService", - "span_start": 12, - "span_end": 52, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 68, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "b13471e5916986dccffb53fab613812842965705e6b3a89ae549d30c9e91e9aa", - "symbol_name": "ControlPlaneService", - "qname": "ControlPlaneService", - "role": "pipeline_stage", - "confidence": 0.57, - "dataflow_participation": 5, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_runner.py", - "content": "UvicornThreadRunner\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (24)", - "layer": "C4_SEMANTIC_ROLES", - "title": "UvicornThreadRunner", - "span_start": 10, - "span_end": 61, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 11, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "fd55630045a02100df8877ac27d951ee08617d4598764394d48cb51fe067476a", - "symbol_name": "UvicornThreadRunner", - "qname": "UvicornThreadRunner", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 24, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "3779fdd2878b770e789a35bb2a89c9d79f13b61c26d7db1b3b683f9bb9e1623f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (10)", - "layer": "C4_SEMANTIC_ROLES", - "title": "HttpControlChannel", - "span_start": 12, - "span_end": 57, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 21, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "1c9fbdc24819e5604c26ea55428a74310f03a03e1af197ed84846af61e42fdb0", - "symbol_name": "HttpControlChannel", - "qname": "HttpControlChannel", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 10, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "HttpControlAppFactory\nrole: factory\n\nResponsibilities:\n- name suffix suggests factory", - "layer": "C4_SEMANTIC_ROLES", - "title": "HttpControlAppFactory", - "span_start": 15, - "span_end": 53, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 39, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "9b3502a5fb408b273223db13264349cf500de24915b6c649d9ea8970d0dfd8e0", - "symbol_name": "HttpControlAppFactory", - "qname": "HttpControlAppFactory", - "role": "factory", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/persistence/workflow_persistence.py", - "content": "WorkflowPersistence\nrole: pipeline_stage\n\nResponsibilities:\n- orchestrates role-like calls (2)\n- reads and writes state attributes\n- participates in dataflow slices (16)", - "layer": "C4_SEMANTIC_ROLES", - "title": "WorkflowPersistence", - "span_start": 8, - "span_end": 54, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 15, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "7bd01ee45cf31f2d5c2e3e51656254860ac785d10cef9e0852cd4fba90857bae", - "symbol_name": "WorkflowPersistence", - "qname": "WorkflowPersistence", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 16, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "80e9410ddc639789b4353c2a1a757ba8d0d5b5bb6075b0b263b61551f04ae1f0", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/queue/in_memory.py", - "content": "InMemoryTaskQueue\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (9)", - "layer": "C4_SEMANTIC_ROLES", - "title": "InMemoryTaskQueue", - "span_start": 9, - "span_end": 38, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 22, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "2da04cb94544a3bcbf0943a95ad4bdd8710bcafaa32a02fd0e4de2178dcf3533", - "symbol_name": "InMemoryTaskQueue", - "qname": "InMemoryTaskQueue", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 9, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "58f0cc001ccda0eee4c6bc32ed83bd05eafd6b6644f1e8b4aa9eed3103db73dc", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/config/file_loader.py", - "content": "ConfigFileLoader\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (8)", - "layer": "C4_SEMANTIC_ROLES", - "title": "ConfigFileLoader", - "span_start": 11, - "span_end": 48, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 23, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "a8474eca8b6e9dc86ae67ed68b16fa5fb639ef08739c053e7b7195489765667f", - "symbol_name": "ConfigFileLoader", - "qname": "ConfigFileLoader", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 8, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "1f19ffebde5e38e4be5a5d5a678059a0f36dedb8fb8b3e00ab395c67106a87ea", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/store.py", - "content": "TraceContextStore\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (6)", - "layer": "C4_SEMANTIC_ROLES", - "title": "TraceContextStore", - "span_start": 15, - "span_end": 52, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 25, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "b2dad4fbe16ffb11b58deba311c7739955c39d59f291b22181f33e9c8cce4059", - "symbol_name": "TraceContextStore", - "qname": "TraceContextStore", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 6, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "d369554f08fc92039c6edd5a2a1e73b23901533e8974459170bbd9347d263dc5", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workers/supervisor.py", - "content": "WorkerSupervisor\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (6)", - "layer": "C4_SEMANTIC_ROLES", - "title": "WorkerSupervisor", - "span_start": 10, - "span_end": 59, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 25, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "c17b44e8d9e97d490989b21fa67d7c346cdda8a0472e4c41fb243c8846faa124", - "symbol_name": "WorkerSupervisor", - "qname": "WorkerSupervisor", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 6, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "77609d9d5927171cce7fc3a54897c183fd63068710c6362029b700937aae5eee", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._start_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 47, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517", - "dst_ref": "ControlPlaneService._start_async", - "resolution": "resolved", - "slice_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._start_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager.start", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 32, - "span_end": 59, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "98312ace7fc62b1c7194c5aa1732b6ef736eae1668a3a120dd1ecd5ab1d64f7a", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "77a7b260193018845e4e204df094ab89cfd7c82ee4e822b3a83ad4cd945f9cb1", - "dst_ref": "RuntimeManager.start", - "resolution": "resolved", - "slice_id": "98312ace7fc62b1c7194c5aa1732b6ef736eae1668a3a120dd1ecd5ab1d64f7a", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager.start" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "77a7b260193018845e4e204df094ab89cfd7c82ee4e822b3a83ad4cd945f9cb1" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.start", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 20, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154", - "dst_ref": "ControlPlaneService.start", - "resolution": "resolved", - "slice_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.start" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.stop", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 25, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d", - "dst_ref": "ControlPlaneService.stop", - "resolution": "resolved", - "slice_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.stop" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._stop_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 51, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a", - "dst_ref": "ControlPlaneService._stop_async", - "resolution": "resolved", - "slice_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._stop_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager.add_config_file", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 32, - "span_end": 52, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "a23b8a11ebdb12708b60c96ea12a69f7f042082f1adfddd572444e246d81d167", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "57ffbd4f0d9fdf3507c2b8624312ce211f3d02fdf86a57a8ec90778d8a7b498d", - "dst_ref": "RuntimeManager.add_config_file", - "resolution": "resolved", - "slice_id": "a23b8a11ebdb12708b60c96ea12a69f7f042082f1adfddd572444e246d81d167", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager.add_config_file" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "57ffbd4f0d9fdf3507c2b8624312ce211f3d02fdf86a57a8ec90778d8a7b498d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.register_channel", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 17, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957", - "dst_ref": "ControlPlaneService.register_channel", - "resolution": "resolved", - "slice_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.register_channel" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager._register_core_services", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 32, - "span_end": 127, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "3e5811f3b511fa0cabe363f5d01f2ac5fa039bc8b93f7ee108323e1f5f45a293", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "972d6057a6caac9cf31ebc1e29c6f39f71b10d4cc170dec57cf875ba458549c6", - "dst_ref": "RuntimeManager._register_core_services", - "resolution": "resolved", - "slice_id": "3e5811f3b511fa0cabe363f5d01f2ac5fa039bc8b93f7ee108323e1f5f45a293", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager._register_core_services" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "972d6057a6caac9cf31ebc1e29c6f39f71b10d4cc170dec57cf875ba458549c6" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/__init__.py", - "content": "const RuntimeManager\nRuntimeManager = plba.core.RuntimeManager", - "layer": "C1_SYMBOL_CATALOG", - "title": "RuntimeManager", - "span_start": 16, - "span_end": 16, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "7eacec84f9b8d6c4201374591faecdac7493091c263681495c338973f2971ad9", - "qname": "RuntimeManager", - "kind": "const", - "signature": "RuntimeManager = plba.core.RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "src.plba.__init__", - "is_test": false, - "blob_sha": "24e755ec8c249d14fb0e675b5dbf2b71ab91afb9c849897eebfa9feb2499e19d", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/core.py", - "content": "const RuntimeManager\nRuntimeManager = app_runtime.core.runtime.RuntimeManager", - "layer": "C1_SYMBOL_CATALOG", - "title": "RuntimeManager", - "span_start": 2, - "span_end": 2, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "e1684562d978b7af7fe9b27dc5869d770348a87b5dc19a50360f58544668578b", - "qname": "RuntimeManager", - "kind": "const", - "signature": "RuntimeManager = app_runtime.core.runtime.RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "src.plba.core", - "is_test": false, - "blob_sha": "c0ae25110d20e665216616e26b68adfe035b624ba45d31d1272fb21f906f9ca8", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "const RuntimeManager\nRuntimeManager = app_runtime.core.runtime.RuntimeManager", - "layer": "C1_SYMBOL_CATALOG", - "title": "RuntimeManager", - "span_start": 9, - "span_end": 9, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "62a9575c77aad894120d18b4f2a08cf2ba42f77e9be4a8a432b767d157701afe", - "qname": "RuntimeManager", - "kind": "const", - "signature": "RuntimeManager = app_runtime.core.runtime.RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.control.service", - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "class RuntimeManager\nRuntimeManager", - "layer": "C1_SYMBOL_CATALOG", - "title": "RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "7e4a9381328c5803bbc6179458612fc4e947d928aa7bf8b4b2bebb2c8592f758", - "qname": "RuntimeManager", - "kind": "class", - "signature": "RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.core.runtime", - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/bootstrap.py", - "content": "const RuntimeManager\nRuntimeManager = app_runtime.core.runtime.RuntimeManager", - "layer": "C1_SYMBOL_CATALOG", - "title": "RuntimeManager", - "span_start": 4, - "span_end": 4, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "27158ca220022eeb5083c6addf8a50775d45f7161284fd60aac48410105f4b98", - "qname": "RuntimeManager", - "kind": "const", - "signature": "RuntimeManager = app_runtime.core.runtime.RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "src.plba.bootstrap", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/__init__.py", - "content": "const ControlChannel\nControlChannel = app_runtime.control.base.ControlChannel", - "layer": "C1_SYMBOL_CATALOG", - "title": "ControlChannel", - "span_start": 1, - "span_end": 1, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "268420f7aa4ed74082b9276cae0cded4f00bac090ffd58fa020a65be0fe19c27", - "qname": "ControlChannel", - "kind": "const", - "signature": "ControlChannel = app_runtime.control.base.ControlChannel", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.control.__init__", - "is_test": false, - "blob_sha": "bf3c37e3369a84cc618adc0fd71c232e5eb4b871eaff743069a17e661e498316", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "class ControlChannel(ABC):\n @abstractmethod\n async def start(self, actions: ControlActionSet) -> None:\n \"\"\"Start the control channel and bind handlers.\"\"\"\n\n @abstractmethod\n async def stop(self) -> None:\n \"\"\"Stop the control channel and release resources.\"\"\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/base.py:ControlChannel", - "span_start": 21, - "span_end": 28, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 1, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.base", - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/__init__.py", - "content": "from app_runtime.control.base import ControlActionSet, ControlChannel\nfrom app_runtime.control.http_channel import HttpControlChannel\nfrom app_runtime.control.service import ControlPlaneService\n\n__all__ = [\"ControlActionSet\", \"ControlChannel\", \"ControlPlaneService\", \"HttpControlChannel\"]", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/__init__.py:1-5", - "span_start": 1, - "span_end": 5, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.app_runtime.control.__init__", - "is_test": false, - "blob_sha": "bf3c37e3369a84cc618adc0fd71c232e5eb4b871eaff743069a17e661e498316", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "class ControlActionSet:\n health: HealthHandler\n start: ActionHandler\n stop: ActionHandler\n status: ActionHandler", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/base.py:ControlActionSet", - "span_start": 14, - "span_end": 18, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.base", - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "class HttpControlAppFactory:\n def create(\n self,\n health_provider: Callable[[], Awaitable[HealthPayload]],\n action_provider: Callable[[str, str], Awaitable[JSONResponse]],\n ) -> FastAPI:\n app = FastAPI(title=\"PLBA Control API\")\n\n @app.middleware(\"http\")\n async def log_api_call(request: Request, call_next): # type: ignore[no-untyped-def]\n started = time.monotonic()\n response = await call_next(request)\n response.headers[\"X-Response-Time-Ms\"] = str(int((time.monotonic() - started) * 1000))\n return response\n\n @app.get(\"/health\")\n async def health() -> JSONResponse:\n payload = await health_provider()\n status_code = 200 if payload.get(\"status\") == \"ok\" else 503\n return JSONResponse(content=payload, status_code=status_code)\n\n @app.get(\"/actions/{action}\")\n @app.post(\"/actions/{action}\")\n async def action(action: str, request: Request) -> JSONResponse:\n client_source = self._client_source(request)\n if action in {\"start\", \"stop\"}:\n LOGGER.warning(\"Control action requested: /actions/%s client=%s\", action, client_source)\n return await action_provider(action, client_source)\n\n return app\n\n def _client_source(self, request: Request) -> str:\n explicit_header = request.headers.get(\"X-Client-Source\", \"\").strip()\n if explicit_header:\n return explicit_header\n user_agent = request.headers.get(\"User-Agent\", \"\").strip()\n if user_agent:\n return f\"user-agent:{user_agent}\"\n return \"unknown\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/http_app.py:HttpControlAppFactory", - "span_start": 15, - "span_end": 53, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.http_app", - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "validation": { - "passed": true, - "action": "return", - "reasons": [] - }, - "token_usage": { - "prompt_name": "code_qa_architecture_answer", - "tokens_in_estimate": 4061 - }, - "steps": [ - { - "step": "router", - "status": "completed", - "timings_ms": { - "router": 1 - }, - "output": { - "intent": "CODE_QA", - "sub_intent": "ARCHITECTURE", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - } - }, - { - "step": "retrieval", - "status": "completed", - "timings_ms": { - "retrieval": 196 - }, - "output": { - "rag_count": 33, - "answer_path_rag_count": 33, - "resolved_symbol_status": "resolved", - "resolved_symbol": "RuntimeManager", - "requested_layers": [ - "C4_SEMANTIC_ROLES", - "C3_ENTRYPOINTS", - "C2_DEPENDENCY_GRAPH", - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS" - ] - }, - "diagnostics": { - "executed_layers": [ - "C4_SEMANTIC_ROLES", - "C3_ENTRYPOINTS", - "C2_DEPENDENCY_GRAPH", - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS" - ], - "retrieval_mode_by_layer": { - "C4_SEMANTIC_ROLES": "vector", - "C3_ENTRYPOINTS": "vector", - "C2_DEPENDENCY_GRAPH": "vector", - "C1_SYMBOL_CATALOG": "vector", - "C0_SOURCE_CHUNKS": "vector" - }, - "top_k_by_layer": { - "C4_SEMANTIC_ROLES": 12, - "C3_ENTRYPOINTS": 8, - "C2_DEPENDENCY_GRAPH": 8, - "C1_SYMBOL_CATALOG": 6, - "C0_SOURCE_CHUNKS": 4 - }, - "filters_by_layer": { - "C4_SEMANTIC_ROLES": { - "path_scope": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [] - }, - "C1_SYMBOL_CATALOG": { - "path_scope": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [] - } - }, - "fallback": { - "used": false, - "reason": null - }, - "retrieval_by_layer_ms": { - "C4_SEMANTIC_ROLES": 43, - "C3_ENTRYPOINTS": 25, - "C2_DEPENDENCY_GRAPH": 64, - "C1_SYMBOL_CATALOG": 34, - "C0_SOURCE_CHUNKS": 27 - } - } - }, - { - "step": "pre_evidence_gate", - "status": "passed", - "timings_ms": { - "pre_evidence_gate": 1 - }, - "input": { - "resolved_target": "RuntimeManager", - "sub_intent": "ARCHITECTURE", - "target_type": "symbol", - "evidence_count": 33, - "code_chunk_count": 33, - "entrypoint_count": 3, - "relation_count": 8, - "test_evidence_count": 0, - "symbol_resolution_status": "resolved", - "path_scope": [] - }, - "output": { - "passed": true, - "failure_reasons": [], - "degraded_message": "", - "evidence_count": 33 - } - }, - { - "step": "llm", - "status": "completed", - "timings_ms": { - "llm": 9911 - }, - "output": { - "prompt_name": "code_qa_architecture_answer", - "answer_preview": "Компоненты, участвующие в подсистеме RuntimeManager:\n\n- **RuntimeManager** (src/app_runtime/core/runtime.py:18-179)\n- **ControlPlaneService.__init__** (src/app_runtime/control/service.py:14-51)\n- **RuntimeManager.__init__** (src/app_runtime/core/runtime.py:32-127)\n- **ControlPlaneService._start_asyn", - "resolved_target": "RuntimeManager", - "answer_policy_branch": "normal_answer", - "decision_reason": "evidence_sufficient" - } - }, - { - "step": "post_evidence_gate", - "status": "passed", - "timings_ms": { - "post_evidence_gate": 1, - "post_evidence_gate_recheck": 0, - "repair": 0 - }, - "input": { - "answer_mode": "normal", - "degraded_message": "", - "resolved_target": "RuntimeManager", - "draft_answer_preview": "Компоненты, участвующие в подсистеме RuntimeManager:\n\n- **RuntimeManager** (src/app_runtime/core/runtime.py:18-179)\n- **ControlPlaneService.__init__** (src/app_runtime/control/service.py:14-51)\n- **RuntimeManager.__init__** (src/app_runtime/core/runtime.py:32-127)\n- **ControlPlaneService._start_asyn", - "repair_candidate": true - }, - "output": { - "passed": true, - "action": "return", - "reasons": [], - "repair_used": false, - "final_answer_preview": "Компоненты, участвующие в подсистеме RuntimeManager:\n\n- **RuntimeManager** (src/app_runtime/core/runtime.py:18-179)\n- **ControlPlaneService.__init__** (src/app_runtime/control/service.py:14-51)\n- **RuntimeManager.__init__** (src/app_runtime/core/runtime.py:32-127)\n- **ControlPlaneService._start_asyn" - } - } - ] - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/manual_run/20260312_193339/full_chain_plba_code_subintents_one_per_subintent_plba-v3-architecture-runtime-manager.md b/tests/pipeline_setup_v3/test_results/manual_run/20260312_193339/full_chain_plba_code_subintents_one_per_subintent_plba-v3-architecture-runtime-manager.md deleted file mode 100644 index d6453a8..0000000 --- a/tests/pipeline_setup_v3/test_results/manual_run/20260312_193339/full_chain_plba_code_subintents_one_per_subintent_plba-v3-architecture-runtime-manager.md +++ /dev/null @@ -1,305 +0,0 @@ -# plba-v3-architecture-runtime-manager - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_02_pipeline/full_chain_plba_code_subintents_one_per_subintent.yaml -- runner: agent_runtime -- mode: full_chain -- passed: True - -## Query -Какие компоненты участвуют в RuntimeManager? - -## Actual -{ - "intent": "CODE_QA", - "sub_intent": "ARCHITECTURE", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 33, - "llm_answer": "Компоненты, участвующие в подсистеме RuntimeManager:\n\n- **RuntimeManager** (src/app_runtime/core/runtime.py:18-179)\n- **ControlPlaneService.__init__** (src/app_runtime/control/service.py:14-51)\n- **RuntimeManager.__init__** (src/app_runtime/core/runtime.py:32-127)\n- **ControlPlaneService._start_async** (src/app_runtime/control/service.py:14-47)\n- **RuntimeManager.start** (src/app_runtime/core/runtime.py:32-59)\n- **ControlPlaneService.start** (src/app_runtime/control/service.py:14-20)\n- **ControlPlaneService.stop** (src/app_runtime/control/service.py:14-25)\n- **ControlPlaneService._stop_async** (src/app_runtime/control/service.py:14-51)\n- **RuntimeManager.add_config_file** (src/app_runtime/core/runtime.py:32-52)\n- **ControlPlaneService.register_channel** (src/app_runtime/control/service.py:14-17)\n\nСвязи между компонентами:\n\n- **ControlPlaneService.__init__ dataflow_slice ControlPlaneService._start_async**\n- **RuntimeManager.__init__ dataflow_slice RuntimeManager.start**\n- **ControlPlaneService.__init__ dataflow_slice ControlPlaneService.start**\n- **ControlPlaneService.__init__ dataflow_slice ControlPlaneService.stop**\n- **ControlPlaneService.__init__ dataflow_slice ControlPlaneService._stop_async**\n- **RuntimeManager.__init__ dataflow_slice RuntimeManager.add_config_file**\n- **ControlPlaneService.__init__ dataflow_slice ControlPlaneService.register_channel**\n- **RuntimeManager.__init__ dataflow_slice RuntimeManager._register_core_services**\n\nОтветственность подсистемы заключается в управлении жизненным циклом приложения, загрузке конфигурационных файлов и регистрации каналов управления через ControlPlaneService.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "RuntimeManager" - ], - "layers": [ - "C4_SEMANTIC_ROLES", - "C3_ENTRYPOINTS", - "C2_DEPENDENCY_GRAPH", - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS" - ] -} - -## Steps -[ - { - "step": "router", - "status": "completed", - "timings_ms": { - "router": 1 - }, - "output": { - "intent": "CODE_QA", - "sub_intent": "ARCHITECTURE", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - } - }, - { - "step": "retrieval", - "status": "completed", - "timings_ms": { - "retrieval": 196 - }, - "output": { - "rag_count": 33, - "answer_path_rag_count": 33, - "resolved_symbol_status": "resolved", - "resolved_symbol": "RuntimeManager", - "requested_layers": [ - "C4_SEMANTIC_ROLES", - "C3_ENTRYPOINTS", - "C2_DEPENDENCY_GRAPH", - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS" - ] - }, - "diagnostics": { - "executed_layers": [ - "C4_SEMANTIC_ROLES", - "C3_ENTRYPOINTS", - "C2_DEPENDENCY_GRAPH", - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS" - ], - "retrieval_mode_by_layer": { - "C4_SEMANTIC_ROLES": "vector", - "C3_ENTRYPOINTS": "vector", - "C2_DEPENDENCY_GRAPH": "vector", - "C1_SYMBOL_CATALOG": "vector", - "C0_SOURCE_CHUNKS": "vector" - }, - "top_k_by_layer": { - "C4_SEMANTIC_ROLES": 12, - "C3_ENTRYPOINTS": 8, - "C2_DEPENDENCY_GRAPH": 8, - "C1_SYMBOL_CATALOG": 6, - "C0_SOURCE_CHUNKS": 4 - }, - "filters_by_layer": { - "C4_SEMANTIC_ROLES": { - "path_scope": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [] - }, - "C1_SYMBOL_CATALOG": { - "path_scope": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [] - } - }, - "fallback": { - "used": false, - "reason": null - }, - "retrieval_by_layer_ms": { - "C4_SEMANTIC_ROLES": 43, - "C3_ENTRYPOINTS": 25, - "C2_DEPENDENCY_GRAPH": 64, - "C1_SYMBOL_CATALOG": 34, - "C0_SOURCE_CHUNKS": 27 - } - } - }, - { - "step": "pre_evidence_gate", - "status": "passed", - "timings_ms": { - "pre_evidence_gate": 1 - }, - "input": { - "resolved_target": "RuntimeManager", - "sub_intent": "ARCHITECTURE", - "target_type": "symbol", - "evidence_count": 33, - "code_chunk_count": 33, - "entrypoint_count": 3, - "relation_count": 8, - "test_evidence_count": 0, - "symbol_resolution_status": "resolved", - "path_scope": [] - }, - "output": { - "passed": true, - "failure_reasons": [], - "degraded_message": "", - "evidence_count": 33 - } - }, - { - "step": "llm", - "status": "completed", - "timings_ms": { - "llm": 9911 - }, - "output": { - "prompt_name": "code_qa_architecture_answer", - "answer_preview": "Компоненты, участвующие в подсистеме RuntimeManager:\n\n- **RuntimeManager** (src/app_runtime/core/runtime.py:18-179)\n- **ControlPlaneService.__init__** (src/app_runtime/control/service.py:14-51)\n- **RuntimeManager.__init__** (src/app_runtime/core/runtime.py:32-127)\n- **ControlPlaneService._start_asyn", - "resolved_target": "RuntimeManager", - "answer_policy_branch": "normal_answer", - "decision_reason": "evidence_sufficient" - } - }, - { - "step": "post_evidence_gate", - "status": "passed", - "timings_ms": { - "post_evidence_gate": 1, - "post_evidence_gate_recheck": 0, - "repair": 0 - }, - "input": { - "answer_mode": "normal", - "degraded_message": "", - "resolved_target": "RuntimeManager", - "draft_answer_preview": "Компоненты, участвующие в подсистеме RuntimeManager:\n\n- **RuntimeManager** (src/app_runtime/core/runtime.py:18-179)\n- **ControlPlaneService.__init__** (src/app_runtime/control/service.py:14-51)\n- **RuntimeManager.__init__** (src/app_runtime/core/runtime.py:32-127)\n- **ControlPlaneService._start_asyn", - "repair_candidate": true - }, - "output": { - "passed": true, - "action": "return", - "reasons": [], - "repair_used": false, - "final_answer_preview": "Компоненты, участвующие в подсистеме RuntimeManager:\n\n- **RuntimeManager** (src/app_runtime/core/runtime.py:18-179)\n- **ControlPlaneService.__init__** (src/app_runtime/control/service.py:14-51)\n- **RuntimeManager.__init__** (src/app_runtime/core/runtime.py:32-127)\n- **ControlPlaneService._start_asyn" - } - } -] - -## Diagnostics -{ - "intent_correct": null, - "target_found": true, - "layers_used": [ - "C4_SEMANTIC_ROLES", - "C3_ENTRYPOINTS", - "C2_DEPENDENCY_GRAPH", - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS" - ], - "retrieval_sufficient": true, - "answer_mode": "normal", - "resolved_target": "RuntimeManager", - "answer_policy_branch": "normal_answer", - "decision_reason": "evidence_sufficient", - "router_result": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "retrieval_profile": "code", - "sub_intent": "ARCHITECTURE", - "path_scope": [], - "layers": [ - "C4_SEMANTIC_ROLES", - "C3_ENTRYPOINTS", - "C2_DEPENDENCY_GRAPH", - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS" - ], - "symbol_resolution_status": "resolved" - }, - "retrieval_request": { - "rag_session_id": "7d11da21-faa0-4cea-aede-aeabe069164c", - "query": "Какие компоненты участвуют в RuntimeManager?", - "sub_intent": "ARCHITECTURE", - "path_scope": [], - "requested_layers": [ - "C4_SEMANTIC_ROLES", - "C3_ENTRYPOINTS", - "C2_DEPENDENCY_GRAPH", - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS" - ] - }, - "per_layer_outcome": [ - { - "layer_id": "C4_SEMANTIC_ROLES", - "hit_count": 12, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C3_ENTRYPOINTS", - "hit_count": 3, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C2_DEPENDENCY_GRAPH", - "hit_count": 8, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C1_SYMBOL_CATALOG", - "hit_count": 6, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C0_SOURCE_CHUNKS", - "hit_count": 4, - "empty": false, - "fallback_used": false - } - ], - "empty_layers": [], - "evidence_gate_decision": { - "sufficient": true, - "failure_reasons": [], - "evidence_count": 33 - }, - "evidence_gate_input": { - "resolved_target": "RuntimeManager", - "sub_intent": "ARCHITECTURE", - "target_type": "symbol", - "evidence_count": 33, - "code_chunk_count": 33, - "entrypoint_count": 3, - "relation_count": 8, - "test_evidence_count": 0, - "symbol_resolution_status": "resolved", - "path_scope": [] - }, - "post_evidence_gate": { - "input": { - "answer_mode": "normal", - "degraded_message": "", - "resolved_target": "RuntimeManager", - "draft_answer_preview": "Компоненты, участвующие в подсистеме RuntimeManager:\n\n- **RuntimeManager** (src/app_runtime/core/runtime.py:18-179)\n- **ControlPlaneService.__init__** (src/app_runtime/control/service.py:14-51)\n- **RuntimeManager.__init__** (src/app_runtime/core/runtime.py:32-127)\n- **ControlPlaneService._start_asyn", - "repair_candidate": true - }, - "output": { - "passed": true, - "action": "return", - "reasons": [], - "repair_used": false, - "final_answer_preview": "Компоненты, участвующие в подсистеме RuntimeManager:\n\n- **RuntimeManager** (src/app_runtime/core/runtime.py:18-179)\n- **ControlPlaneService.__init__** (src/app_runtime/control/service.py:14-51)\n- **RuntimeManager.__init__** (src/app_runtime/core/runtime.py:32-127)\n- **ControlPlaneService._start_asyn" - } - }, - "failure_reasons": [], - "timings_ms": { - "router": 1, - "retrieval": 196, - "pre_evidence_gate": 1, - "llm": 9911, - "post_evidence_gate": 1 - } -} - -## Mismatches -- none \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/manual_run/20260312_193339/full_chain_plba_code_subintents_one_per_subintent_plba-v3-explain-local-http-channel.json b/tests/pipeline_setup_v3/test_results/manual_run/20260312_193339/full_chain_plba_code_subintents_one_per_subintent_plba-v3-explain-local-http-channel.json deleted file mode 100644 index 404d2b8..0000000 --- a/tests/pipeline_setup_v3/test_results/manual_run/20260312_193339/full_chain_plba_code_subintents_one_per_subintent_plba-v3-explain-local-http-channel.json +++ /dev/null @@ -1,2241 +0,0 @@ -{ - "case_id": "plba-v3-explain-local-http-channel", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_02_pipeline/full_chain_plba_code_subintents_one_per_subintent.yaml", - "runner": "agent_runtime", - "mode": "full_chain", - "query": "Почему в файле src/app_runtime/control/http_channel.py класс HttpControlChannel устроен так?", - "actual": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN_LOCAL", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 13, - "llm_answer": "Класс HttpControlChannel наследует ControlChannel и реализует HTTP-канал управления. Он принимает хост, порт и таймаут при инициализации, создаёт экземпляр UvicornThreadRunner для запуска сервера и использует HttpControlAppFactory для создания FastAPI-приложения. \n\nМетод start запускает сервер с переданным набором действий (ControlActionSet), а метод stop останавливает его. Свойство port возвращает текущий порт runner.\n\nВнутри класса определены два обработчика: _health_response проверяет здоровье канала, возвращая статус \"unhealthy\" если действия не установлены; \n_action_response предположительно обрабатывает запросы на выполнение действий, но его реализация в данном фрагменте не показана.", - "answer_mode": "answered", - "path_scope": [ - "src/app_runtime/control/http_channel.py" - ], - "symbol_candidates": [ - "HttpControlChannel" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C2_DEPENDENCY_GRAPH" - ] - }, - "passed": true, - "mismatches": [], - "details": { - "query": "Почему в файле src/app_runtime/control/http_channel.py класс HttpControlChannel устроен так?", - "router_result": { - "schema_version": "1.1", - "intent": "CODE_QA", - "retrieval_profile": "code", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query_plan": { - "raw": "Почему в файле src/app_runtime/control/http_channel.py класс HttpControlChannel устроен так?", - "normalized": "Почему в файле src/app_runtime/control/http_channel.py класс HttpControlChannel устроен так?", - "sub_intent": "EXPLAIN_LOCAL", - "negations": [], - "expansions": [ - "file", - "HttpControlChannel" - ], - "keyword_hints": [ - "src/app_runtime/control/http_channel.py", - "HttpControlChannel" - ], - "path_hints": [ - "src/app_runtime/control/http_channel.py" - ], - "doc_scope_hints": [], - "symbol_candidates": [ - "HttpControlChannel" - ], - "symbol_kind_hint": "class", - "anchors": [ - { - "type": "FILE_PATH", - "value": "src/app_runtime/control/http_channel.py", - "source": "user_text", - "subtype": null, - "span": { - "start": 15, - "end": 54 - }, - "confidence": 0.95 - }, - { - "type": "SYMBOL", - "value": "HttpControlChannel", - "source": "user_text", - "subtype": null, - "span": { - "start": 61, - "end": 79 - }, - "confidence": 0.88 - }, - { - "type": "KEY_TERM", - "value": "файл", - "source": "user_text", - "subtype": null, - "span": { - "start": 9, - "end": 14 - }, - "confidence": 0.9 - }, - { - "type": "KEY_TERM", - "value": "класс", - "source": "user_text", - "subtype": null, - "span": { - "start": 55, - "end": 60 - }, - "confidence": 0.9 - } - ] - }, - "retrieval_spec": { - "domains": [ - "CODE" - ], - "layer_queries": [ - { - "layer_id": "C1_SYMBOL_CATALOG", - "top_k": 8 - }, - { - "layer_id": "C0_SOURCE_CHUNKS", - "top_k": 12 - }, - { - "layer_id": "C2_DEPENDENCY_GRAPH", - "top_k": 4 - } - ], - "filters": { - "test_policy": "EXCLUDE", - "path_scope": [ - "src/app_runtime/control/http_channel.py" - ], - "language": [ - "python" - ] - }, - "rerank_profile": "code" - }, - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - }, - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "HttpControlChannel", - "alternatives": [ - "ControlChannel", - "ControlActionSet", - "JSONResponse", - "HttpControlAppFactory", - "UvicornThreadRunner" - ], - "confidence": 0.99 - }, - "evidence_policy": { - "require_def": true, - "require_flow": false, - "require_spec": false, - "allow_answer_without_evidence": false - } - }, - "retrieval_request": { - "rag_session_id": "7d11da21-faa0-4cea-aede-aeabe069164c", - "query": "Почему в файле src/app_runtime/control/http_channel.py класс HttpControlChannel устроен так?", - "sub_intent": "EXPLAIN_LOCAL", - "path_scope": [ - "src/app_runtime/control/http_channel.py" - ], - "keyword_hints": [ - "src/app_runtime/control/http_channel.py", - "HttpControlChannel" - ], - "symbol_candidates": [ - "HttpControlChannel" - ], - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C2_DEPENDENCY_GRAPH" - ], - "retrieval_spec": { - "domains": [ - "CODE" - ], - "layer_queries": [ - { - "layer_id": "C1_SYMBOL_CATALOG", - "top_k": 8 - }, - { - "layer_id": "C0_SOURCE_CHUNKS", - "top_k": 12 - }, - { - "layer_id": "C2_DEPENDENCY_GRAPH", - "top_k": 4 - } - ], - "filters": { - "test_policy": "EXCLUDE", - "path_scope": [ - "src/app_runtime/control/http_channel.py" - ], - "language": [ - "python" - ] - }, - "rerank_profile": "code" - }, - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - }, - "query_plan": { - "raw": "Почему в файле src/app_runtime/control/http_channel.py класс HttpControlChannel устроен так?", - "normalized": "Почему в файле src/app_runtime/control/http_channel.py класс HttpControlChannel устроен так?", - "sub_intent": "EXPLAIN_LOCAL", - "negations": [], - "expansions": [ - "file", - "HttpControlChannel" - ], - "keyword_hints": [ - "src/app_runtime/control/http_channel.py", - "HttpControlChannel" - ], - "path_hints": [ - "src/app_runtime/control/http_channel.py" - ], - "doc_scope_hints": [], - "symbol_candidates": [ - "HttpControlChannel" - ], - "symbol_kind_hint": "class", - "anchors": [ - { - "type": "FILE_PATH", - "value": "src/app_runtime/control/http_channel.py", - "source": "user_text", - "subtype": null, - "span": { - "start": 15, - "end": 54 - }, - "confidence": 0.95 - }, - { - "type": "SYMBOL", - "value": "HttpControlChannel", - "source": "user_text", - "subtype": null, - "span": { - "start": 61, - "end": 79 - }, - "confidence": 0.88 - }, - { - "type": "KEY_TERM", - "value": "файл", - "source": "user_text", - "subtype": null, - "span": { - "start": 9, - "end": 14 - }, - "confidence": 0.9 - }, - { - "type": "KEY_TERM", - "value": "класс", - "source": "user_text", - "subtype": null, - "span": { - "start": 55, - "end": 60 - }, - "confidence": 0.9 - } - ] - } - }, - "retrieval_result": { - "target_symbol_candidates": [ - "ControlChannel", - "ControlActionSet", - "JSONResponse", - "HttpControlAppFactory", - "UvicornThreadRunner", - "HttpControlChannel", - "HttpControlChannel.__init__", - "HttpControlChannel.start" - ], - "resolved_symbol": "HttpControlChannel", - "symbol_resolution_status": "resolved", - "file_candidates": [ - "src/app_runtime/control/http_channel.py" - ], - "code_chunks": [ - { - "layer": "C1_SYMBOL_CATALOG", - "path": "src/app_runtime/control/http_channel.py", - "title": "ControlChannel", - "content": "const ControlChannel\nControlChannel = app_runtime.control.base.ControlChannel", - "start_line": 7, - "end_line": 7, - "metadata": { - "symbol_id": "6e69a934202b6e11891af8fb72b2033e8ae3071eb7577c64f5545b5b7ddfb51e", - "qname": "ControlChannel", - "kind": "const", - "signature": "ControlChannel = app_runtime.control.base.ControlChannel", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.control.http_channel", - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C1_SYMBOL_CATALOG", - "path": "src/app_runtime/control/http_channel.py", - "title": "ControlActionSet", - "content": "const ControlActionSet\nControlActionSet = app_runtime.control.base.ControlActionSet", - "start_line": 7, - "end_line": 7, - "metadata": { - "symbol_id": "2132a5717c57061e3488a1bf4d43650a60ea903a42278f4d494c014bc80d2df9", - "qname": "ControlActionSet", - "kind": "const", - "signature": "ControlActionSet = app_runtime.control.base.ControlActionSet", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.control.http_channel", - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C1_SYMBOL_CATALOG", - "path": "src/app_runtime/control/http_channel.py", - "title": "JSONResponse", - "content": "const JSONResponse\nJSONResponse = fastapi.responses.JSONResponse", - "start_line": 5, - "end_line": 5, - "metadata": { - "symbol_id": "238f600ea55013e25a3e1451f7fd65caabea125b314b89247900cdab5b801a23", - "qname": "JSONResponse", - "kind": "const", - "signature": "JSONResponse = fastapi.responses.JSONResponse", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.control.http_channel", - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C1_SYMBOL_CATALOG", - "path": "src/app_runtime/control/http_channel.py", - "title": "HttpControlAppFactory", - "content": "const HttpControlAppFactory\nHttpControlAppFactory = app_runtime.control.http_app.HttpControlAppFactory", - "start_line": 8, - "end_line": 8, - "metadata": { - "symbol_id": "9ee00379ee797cd2386e88a6e37dc69e3e31de9144fc4b95f0206cd1430e8983", - "qname": "HttpControlAppFactory", - "kind": "const", - "signature": "HttpControlAppFactory = app_runtime.control.http_app.HttpControlAppFactory", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.control.http_channel", - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C1_SYMBOL_CATALOG", - "path": "src/app_runtime/control/http_channel.py", - "title": "UvicornThreadRunner", - "content": "const UvicornThreadRunner\nUvicornThreadRunner = app_runtime.control.http_runner.UvicornThreadRunner", - "start_line": 9, - "end_line": 9, - "metadata": { - "symbol_id": "c6ee53f4ff75d5b34ee95854cb63bb3ecfa163023717cd969b8cba937a0cd3b3", - "qname": "UvicornThreadRunner", - "kind": "const", - "signature": "UvicornThreadRunner = app_runtime.control.http_runner.UvicornThreadRunner", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.control.http_channel", - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C1_SYMBOL_CATALOG", - "path": "src/app_runtime/control/http_channel.py", - "title": "HttpControlChannel", - "content": "class HttpControlChannel\nHttpControlChannel(ControlChannel)", - "start_line": 12, - "end_line": 57, - "metadata": { - "symbol_id": "1c9fbdc24819e5604c26ea55428a74310f03a03e1af197ed84846af61e42fdb0", - "qname": "HttpControlChannel", - "kind": "class", - "signature": "HttpControlChannel(ControlChannel)", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.control.http_channel", - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C1_SYMBOL_CATALOG", - "path": "src/app_runtime/control/http_channel.py", - "title": "HttpControlChannel.__init__", - "content": "method HttpControlChannel.__init__\n__init__(self, host, port, timeout)", - "start_line": 13, - "end_line": 17, - "metadata": { - "symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "qname": "HttpControlChannel.__init__", - "kind": "method", - "signature": "__init__(self, host, port, timeout)", - "parent_symbol_id": "HttpControlChannel", - "package_or_module": "src.app_runtime.control.http_channel", - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C1_SYMBOL_CATALOG", - "path": "src/app_runtime/control/http_channel.py", - "title": "HttpControlChannel.start", - "content": "method HttpControlChannel.start\nstart(self, actions)", - "start_line": 19, - "end_line": 22, - "metadata": { - "symbol_id": "d1933f04137f52535b6525f1b93ff2cd83bfb216b480e887e791ed1714cda8e0", - "qname": "HttpControlChannel.start", - "kind": "method", - "signature": "start(self, actions)", - "parent_symbol_id": "HttpControlChannel", - "package_or_module": "src.app_runtime.control.http_channel", - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C0_SOURCE_CHUNKS", - "path": "src/app_runtime/control/http_channel.py", - "title": "src/app_runtime/control/http_channel.py:HttpControlChannel", - "content": "class HttpControlChannel(ControlChannel):\n def __init__(self, host: str, port: int, timeout: int) -> None:\n self._timeout = timeout\n self._runner = UvicornThreadRunner(host, port, timeout)\n self._factory = HttpControlAppFactory()\n self._actions: ControlActionSet | None = None\n\n async def start(self, actions: ControlActionSet) -> None:\n self._actions = actions\n app = self._factory.create(self._health_response, self._action_response)\n await self._runner.start(app)\n\n async def stop(self) -> None:\n await self._runner.stop()\n\n @property\n def port(self) -> int:\n return self._runner.port\n\n async def _health_response(self) -> dict[str, object]:\n if self._actions is None:\n return {\"status\": \"unhealthy\", \"detail\": \"control actions are not configured\"}\n return await asyncio.wait_for(self._actions.health(), timeout=float(self._timeout))\n\n async def _action_response(self, action: str, _client_source: str = \"unknown\") -> JSONResponse:\n if self._actions is None:\n return JSONResponse(content={\"status\": \"error\", \"detail\": f\"{action} handler is not configured\"}, status_code=404)\n callbacks = {\n \"start\": self._actions.start,\n \"stop\": self._actions.stop,\n \"status\": self._actions.status,\n }\n callback = callbacks.get(action)\n if callback is None:\n return JSONResponse(content={\"status\": \"error\", \"detail\": f\"unsupported action: {action}\"}, status_code=404)\n action_timeout = max(float(self._timeout), 10.0) if action in {\"start\", \"stop\"} else float(self._timeout)\n try:\n detail = await asyncio.wait_for(callback(), timeout=action_timeout)\n except asyncio.TimeoutError:\n return JSONResponse(\n content={\"status\": \"accepted\", \"detail\": f\"{action} operation is still in progress\"},\n status_code=202,\n )\n except Exception as exc:\n return JSONResponse(content={\"status\": \"error\", \"detail\": str(exc)}, status_code=500)\n return JSONResponse(content={\"status\": \"ok\", \"detail\": detail or f\"{action} action accepted\"}, status_code=200)", - "start_line": 12, - "end_line": 57, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.http_channel", - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "path": "src/app_runtime/control/http_channel.py", - "title": "HttpControlChannel.__init__:dataflow_slice", - "content": "HttpControlChannel.__init__\n -> HttpControlChannel._timeout\n -> HttpControlChannel._action_response", - "start_line": 14, - "end_line": 47, - "metadata": { - "edge_id": "c3ef21fcae96c82c00be74b3ab827d4af2085d89cb3fa5521c19a174aad84dbb", - "edge_type": "dataflow_slice", - "src_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "src_qname": "HttpControlChannel.__init__", - "dst_symbol_id": "e64969024ccaeb34d8d91473fad07b3b3d341875846392e7a006406c7ada1954", - "dst_ref": "HttpControlChannel._action_response", - "resolution": "resolved", - "slice_id": "c3ef21fcae96c82c00be74b3ab827d4af2085d89cb3fa5521c19a174aad84dbb", - "root_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "path_symbols": [ - "HttpControlChannel.__init__", - "HttpControlChannel._timeout", - "HttpControlChannel._action_response" - ], - "path_symbol_ids": [ - "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "e64969024ccaeb34d8d91473fad07b3b3d341875846392e7a006406c7ada1954" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "path": "src/app_runtime/control/http_channel.py", - "title": "HttpControlChannel.__init__:dataflow_slice", - "content": "HttpControlChannel.__init__\n -> HttpControlChannel._runner\n -> HttpControlChannel.start", - "start_line": 15, - "end_line": 22, - "metadata": { - "edge_id": "51d73913df709152258ed1b9a8c8f4eb3c575eccfe6b982aef0b28e0789a29da", - "edge_type": "dataflow_slice", - "src_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "src_qname": "HttpControlChannel.__init__", - "dst_symbol_id": "d1933f04137f52535b6525f1b93ff2cd83bfb216b480e887e791ed1714cda8e0", - "dst_ref": "HttpControlChannel.start", - "resolution": "resolved", - "slice_id": "51d73913df709152258ed1b9a8c8f4eb3c575eccfe6b982aef0b28e0789a29da", - "root_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "path_symbols": [ - "HttpControlChannel.__init__", - "HttpControlChannel._runner", - "HttpControlChannel.start" - ], - "path_symbol_ids": [ - "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "d1933f04137f52535b6525f1b93ff2cd83bfb216b480e887e791ed1714cda8e0" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "path": "src/app_runtime/control/http_channel.py", - "title": "HttpControlChannel.__init__:dataflow_slice", - "content": "HttpControlChannel.__init__\n -> HttpControlChannel._timeout\n -> HttpControlChannel._health_response", - "start_line": 14, - "end_line": 34, - "metadata": { - "edge_id": "f858f5c9e575f6c4cdfe3853571b7ee21d1f628a443541d2037c3dc9d0790bef", - "edge_type": "dataflow_slice", - "src_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "src_qname": "HttpControlChannel.__init__", - "dst_symbol_id": "e84bf04e9cd2127df235b7064d05f47e19f19a89c7c82f4c247231d4e8fa426a", - "dst_ref": "HttpControlChannel._health_response", - "resolution": "resolved", - "slice_id": "f858f5c9e575f6c4cdfe3853571b7ee21d1f628a443541d2037c3dc9d0790bef", - "root_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "path_symbols": [ - "HttpControlChannel.__init__", - "HttpControlChannel._timeout", - "HttpControlChannel._health_response" - ], - "path_symbol_ids": [ - "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "e84bf04e9cd2127df235b7064d05f47e19f19a89c7c82f4c247231d4e8fa426a" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "path": "src/app_runtime/control/http_channel.py", - "title": "HttpControlChannel.__init__:dataflow_slice", - "content": "HttpControlChannel.__init__\n -> HttpControlChannel._runner\n -> HttpControlChannel.stop", - "start_line": 15, - "end_line": 25, - "metadata": { - "edge_id": "0f827ef81a990258a8a74381c8564a8361afa6712dba3200592659c939adcb9d", - "edge_type": "dataflow_slice", - "src_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "src_qname": "HttpControlChannel.__init__", - "dst_symbol_id": "f29ab212620093d72be20e26c5a399624c7939a6056a728762ed3f84a250bfa3", - "dst_ref": "HttpControlChannel.stop", - "resolution": "resolved", - "slice_id": "0f827ef81a990258a8a74381c8564a8361afa6712dba3200592659c939adcb9d", - "root_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "path_symbols": [ - "HttpControlChannel.__init__", - "HttpControlChannel._runner", - "HttpControlChannel.stop" - ], - "path_symbol_ids": [ - "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "f29ab212620093d72be20e26c5a399624c7939a6056a728762ed3f84a250bfa3" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "relations": [ - { - "path": "src/app_runtime/control/http_channel.py", - "start_line": 14, - "end_line": 47, - "edge_type": "dataflow_slice", - "source": "HttpControlChannel.__init__", - "target": "HttpControlChannel._action_response", - "metadata": { - "edge_id": "c3ef21fcae96c82c00be74b3ab827d4af2085d89cb3fa5521c19a174aad84dbb", - "edge_type": "dataflow_slice", - "src_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "src_qname": "HttpControlChannel.__init__", - "dst_symbol_id": "e64969024ccaeb34d8d91473fad07b3b3d341875846392e7a006406c7ada1954", - "dst_ref": "HttpControlChannel._action_response", - "resolution": "resolved", - "slice_id": "c3ef21fcae96c82c00be74b3ab827d4af2085d89cb3fa5521c19a174aad84dbb", - "root_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "path_symbols": [ - "HttpControlChannel.__init__", - "HttpControlChannel._timeout", - "HttpControlChannel._action_response" - ], - "path_symbol_ids": [ - "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "e64969024ccaeb34d8d91473fad07b3b3d341875846392e7a006406c7ada1954" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - }, - "content": "HttpControlChannel.__init__\n -> HttpControlChannel._timeout\n -> HttpControlChannel._action_response" - }, - { - "path": "src/app_runtime/control/http_channel.py", - "start_line": 15, - "end_line": 22, - "edge_type": "dataflow_slice", - "source": "HttpControlChannel.__init__", - "target": "HttpControlChannel.start", - "metadata": { - "edge_id": "51d73913df709152258ed1b9a8c8f4eb3c575eccfe6b982aef0b28e0789a29da", - "edge_type": "dataflow_slice", - "src_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "src_qname": "HttpControlChannel.__init__", - "dst_symbol_id": "d1933f04137f52535b6525f1b93ff2cd83bfb216b480e887e791ed1714cda8e0", - "dst_ref": "HttpControlChannel.start", - "resolution": "resolved", - "slice_id": "51d73913df709152258ed1b9a8c8f4eb3c575eccfe6b982aef0b28e0789a29da", - "root_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "path_symbols": [ - "HttpControlChannel.__init__", - "HttpControlChannel._runner", - "HttpControlChannel.start" - ], - "path_symbol_ids": [ - "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "d1933f04137f52535b6525f1b93ff2cd83bfb216b480e887e791ed1714cda8e0" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - }, - "content": "HttpControlChannel.__init__\n -> HttpControlChannel._runner\n -> HttpControlChannel.start" - }, - { - "path": "src/app_runtime/control/http_channel.py", - "start_line": 14, - "end_line": 34, - "edge_type": "dataflow_slice", - "source": "HttpControlChannel.__init__", - "target": "HttpControlChannel._health_response", - "metadata": { - "edge_id": "f858f5c9e575f6c4cdfe3853571b7ee21d1f628a443541d2037c3dc9d0790bef", - "edge_type": "dataflow_slice", - "src_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "src_qname": "HttpControlChannel.__init__", - "dst_symbol_id": "e84bf04e9cd2127df235b7064d05f47e19f19a89c7c82f4c247231d4e8fa426a", - "dst_ref": "HttpControlChannel._health_response", - "resolution": "resolved", - "slice_id": "f858f5c9e575f6c4cdfe3853571b7ee21d1f628a443541d2037c3dc9d0790bef", - "root_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "path_symbols": [ - "HttpControlChannel.__init__", - "HttpControlChannel._timeout", - "HttpControlChannel._health_response" - ], - "path_symbol_ids": [ - "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "e84bf04e9cd2127df235b7064d05f47e19f19a89c7c82f4c247231d4e8fa426a" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - }, - "content": "HttpControlChannel.__init__\n -> HttpControlChannel._timeout\n -> HttpControlChannel._health_response" - }, - { - "path": "src/app_runtime/control/http_channel.py", - "start_line": 15, - "end_line": 25, - "edge_type": "dataflow_slice", - "source": "HttpControlChannel.__init__", - "target": "HttpControlChannel.stop", - "metadata": { - "edge_id": "0f827ef81a990258a8a74381c8564a8361afa6712dba3200592659c939adcb9d", - "edge_type": "dataflow_slice", - "src_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "src_qname": "HttpControlChannel.__init__", - "dst_symbol_id": "f29ab212620093d72be20e26c5a399624c7939a6056a728762ed3f84a250bfa3", - "dst_ref": "HttpControlChannel.stop", - "resolution": "resolved", - "slice_id": "0f827ef81a990258a8a74381c8564a8361afa6712dba3200592659c939adcb9d", - "root_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "path_symbols": [ - "HttpControlChannel.__init__", - "HttpControlChannel._runner", - "HttpControlChannel.stop" - ], - "path_symbol_ids": [ - "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "f29ab212620093d72be20e26c5a399624c7939a6056a728762ed3f84a250bfa3" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - }, - "content": "HttpControlChannel.__init__\n -> HttpControlChannel._runner\n -> HttpControlChannel.stop" - } - ], - "semantic_hints": [], - "entrypoints": [], - "test_candidates": [], - "layer_outcomes": [ - { - "layer_id": "C1_SYMBOL_CATALOG", - "hit_count": 8, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C0_SOURCE_CHUNKS", - "hit_count": 1, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C2_DEPENDENCY_GRAPH", - "hit_count": 4, - "empty": false, - "fallback_used": false - } - ], - "missing_layers": [], - "raw_rows": [ - { - "path": "src/app_runtime/control/http_channel.py", - "content": "const ControlChannel\nControlChannel = app_runtime.control.base.ControlChannel", - "layer": "C1_SYMBOL_CATALOG", - "title": "ControlChannel", - "span_start": 7, - "span_end": 7, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": null, - "metadata": { - "symbol_id": "6e69a934202b6e11891af8fb72b2033e8ae3071eb7577c64f5545b5b7ddfb51e", - "qname": "ControlChannel", - "kind": "const", - "signature": "ControlChannel = app_runtime.control.base.ControlChannel", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.control.http_channel", - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "const ControlActionSet\nControlActionSet = app_runtime.control.base.ControlActionSet", - "layer": "C1_SYMBOL_CATALOG", - "title": "ControlActionSet", - "span_start": 7, - "span_end": 7, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": null, - "metadata": { - "symbol_id": "2132a5717c57061e3488a1bf4d43650a60ea903a42278f4d494c014bc80d2df9", - "qname": "ControlActionSet", - "kind": "const", - "signature": "ControlActionSet = app_runtime.control.base.ControlActionSet", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.control.http_channel", - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "const JSONResponse\nJSONResponse = fastapi.responses.JSONResponse", - "layer": "C1_SYMBOL_CATALOG", - "title": "JSONResponse", - "span_start": 5, - "span_end": 5, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": null, - "metadata": { - "symbol_id": "238f600ea55013e25a3e1451f7fd65caabea125b314b89247900cdab5b801a23", - "qname": "JSONResponse", - "kind": "const", - "signature": "JSONResponse = fastapi.responses.JSONResponse", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.control.http_channel", - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "const HttpControlAppFactory\nHttpControlAppFactory = app_runtime.control.http_app.HttpControlAppFactory", - "layer": "C1_SYMBOL_CATALOG", - "title": "HttpControlAppFactory", - "span_start": 8, - "span_end": 8, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": null, - "metadata": { - "symbol_id": "9ee00379ee797cd2386e88a6e37dc69e3e31de9144fc4b95f0206cd1430e8983", - "qname": "HttpControlAppFactory", - "kind": "const", - "signature": "HttpControlAppFactory = app_runtime.control.http_app.HttpControlAppFactory", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.control.http_channel", - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "const UvicornThreadRunner\nUvicornThreadRunner = app_runtime.control.http_runner.UvicornThreadRunner", - "layer": "C1_SYMBOL_CATALOG", - "title": "UvicornThreadRunner", - "span_start": 9, - "span_end": 9, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": null, - "metadata": { - "symbol_id": "c6ee53f4ff75d5b34ee95854cb63bb3ecfa163023717cd969b8cba937a0cd3b3", - "qname": "UvicornThreadRunner", - "kind": "const", - "signature": "UvicornThreadRunner = app_runtime.control.http_runner.UvicornThreadRunner", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.control.http_channel", - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "class HttpControlChannel\nHttpControlChannel(ControlChannel)", - "layer": "C1_SYMBOL_CATALOG", - "title": "HttpControlChannel", - "span_start": 12, - "span_end": 57, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": null, - "metadata": { - "symbol_id": "1c9fbdc24819e5604c26ea55428a74310f03a03e1af197ed84846af61e42fdb0", - "qname": "HttpControlChannel", - "kind": "class", - "signature": "HttpControlChannel(ControlChannel)", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.control.http_channel", - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "method HttpControlChannel.__init__\n__init__(self, host, port, timeout)", - "layer": "C1_SYMBOL_CATALOG", - "title": "HttpControlChannel.__init__", - "span_start": 13, - "span_end": 17, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": null, - "metadata": { - "symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "qname": "HttpControlChannel.__init__", - "kind": "method", - "signature": "__init__(self, host, port, timeout)", - "parent_symbol_id": "HttpControlChannel", - "package_or_module": "src.app_runtime.control.http_channel", - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "method HttpControlChannel.start\nstart(self, actions)", - "layer": "C1_SYMBOL_CATALOG", - "title": "HttpControlChannel.start", - "span_start": 19, - "span_end": 22, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": null, - "metadata": { - "symbol_id": "d1933f04137f52535b6525f1b93ff2cd83bfb216b480e887e791ed1714cda8e0", - "qname": "HttpControlChannel.start", - "kind": "method", - "signature": "start(self, actions)", - "parent_symbol_id": "HttpControlChannel", - "package_or_module": "src.app_runtime.control.http_channel", - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "class HttpControlChannel(ControlChannel):\n def __init__(self, host: str, port: int, timeout: int) -> None:\n self._timeout = timeout\n self._runner = UvicornThreadRunner(host, port, timeout)\n self._factory = HttpControlAppFactory()\n self._actions: ControlActionSet | None = None\n\n async def start(self, actions: ControlActionSet) -> None:\n self._actions = actions\n app = self._factory.create(self._health_response, self._action_response)\n await self._runner.start(app)\n\n async def stop(self) -> None:\n await self._runner.stop()\n\n @property\n def port(self) -> int:\n return self._runner.port\n\n async def _health_response(self) -> dict[str, object]:\n if self._actions is None:\n return {\"status\": \"unhealthy\", \"detail\": \"control actions are not configured\"}\n return await asyncio.wait_for(self._actions.health(), timeout=float(self._timeout))\n\n async def _action_response(self, action: str, _client_source: str = \"unknown\") -> JSONResponse:\n if self._actions is None:\n return JSONResponse(content={\"status\": \"error\", \"detail\": f\"{action} handler is not configured\"}, status_code=404)\n callbacks = {\n \"start\": self._actions.start,\n \"stop\": self._actions.stop,\n \"status\": self._actions.status,\n }\n callback = callbacks.get(action)\n if callback is None:\n return JSONResponse(content={\"status\": \"error\", \"detail\": f\"unsupported action: {action}\"}, status_code=404)\n action_timeout = max(float(self._timeout), 10.0) if action in {\"start\", \"stop\"} else float(self._timeout)\n try:\n detail = await asyncio.wait_for(callback(), timeout=action_timeout)\n except asyncio.TimeoutError:\n return JSONResponse(\n content={\"status\": \"accepted\", \"detail\": f\"{action} operation is still in progress\"},\n status_code=202,\n )\n except Exception as exc:\n return JSONResponse(content={\"status\": \"error\", \"detail\": str(exc)}, status_code=500)\n return JSONResponse(content={\"status\": \"ok\", \"detail\": detail or f\"{action} action accepted\"}, status_code=200)", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/http_channel.py:HttpControlChannel", - "span_start": 12, - "span_end": 57, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": null, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.http_channel", - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel.__init__\n -> HttpControlChannel._timeout\n -> HttpControlChannel._action_response", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "HttpControlChannel.__init__:dataflow_slice", - "span_start": 14, - "span_end": 47, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": null, - "metadata": { - "edge_id": "c3ef21fcae96c82c00be74b3ab827d4af2085d89cb3fa5521c19a174aad84dbb", - "edge_type": "dataflow_slice", - "src_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "src_qname": "HttpControlChannel.__init__", - "dst_symbol_id": "e64969024ccaeb34d8d91473fad07b3b3d341875846392e7a006406c7ada1954", - "dst_ref": "HttpControlChannel._action_response", - "resolution": "resolved", - "slice_id": "c3ef21fcae96c82c00be74b3ab827d4af2085d89cb3fa5521c19a174aad84dbb", - "root_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "path_symbols": [ - "HttpControlChannel.__init__", - "HttpControlChannel._timeout", - "HttpControlChannel._action_response" - ], - "path_symbol_ids": [ - "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "e64969024ccaeb34d8d91473fad07b3b3d341875846392e7a006406c7ada1954" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel.__init__\n -> HttpControlChannel._runner\n -> HttpControlChannel.start", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "HttpControlChannel.__init__:dataflow_slice", - "span_start": 15, - "span_end": 22, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": null, - "metadata": { - "edge_id": "51d73913df709152258ed1b9a8c8f4eb3c575eccfe6b982aef0b28e0789a29da", - "edge_type": "dataflow_slice", - "src_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "src_qname": "HttpControlChannel.__init__", - "dst_symbol_id": "d1933f04137f52535b6525f1b93ff2cd83bfb216b480e887e791ed1714cda8e0", - "dst_ref": "HttpControlChannel.start", - "resolution": "resolved", - "slice_id": "51d73913df709152258ed1b9a8c8f4eb3c575eccfe6b982aef0b28e0789a29da", - "root_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "path_symbols": [ - "HttpControlChannel.__init__", - "HttpControlChannel._runner", - "HttpControlChannel.start" - ], - "path_symbol_ids": [ - "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "d1933f04137f52535b6525f1b93ff2cd83bfb216b480e887e791ed1714cda8e0" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel.__init__\n -> HttpControlChannel._timeout\n -> HttpControlChannel._health_response", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "HttpControlChannel.__init__:dataflow_slice", - "span_start": 14, - "span_end": 34, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": null, - "metadata": { - "edge_id": "f858f5c9e575f6c4cdfe3853571b7ee21d1f628a443541d2037c3dc9d0790bef", - "edge_type": "dataflow_slice", - "src_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "src_qname": "HttpControlChannel.__init__", - "dst_symbol_id": "e84bf04e9cd2127df235b7064d05f47e19f19a89c7c82f4c247231d4e8fa426a", - "dst_ref": "HttpControlChannel._health_response", - "resolution": "resolved", - "slice_id": "f858f5c9e575f6c4cdfe3853571b7ee21d1f628a443541d2037c3dc9d0790bef", - "root_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "path_symbols": [ - "HttpControlChannel.__init__", - "HttpControlChannel._timeout", - "HttpControlChannel._health_response" - ], - "path_symbol_ids": [ - "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "e84bf04e9cd2127df235b7064d05f47e19f19a89c7c82f4c247231d4e8fa426a" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel.__init__\n -> HttpControlChannel._runner\n -> HttpControlChannel.stop", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "HttpControlChannel.__init__:dataflow_slice", - "span_start": 15, - "span_end": 25, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": null, - "metadata": { - "edge_id": "0f827ef81a990258a8a74381c8564a8361afa6712dba3200592659c939adcb9d", - "edge_type": "dataflow_slice", - "src_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "src_qname": "HttpControlChannel.__init__", - "dst_symbol_id": "f29ab212620093d72be20e26c5a399624c7939a6056a728762ed3f84a250bfa3", - "dst_ref": "HttpControlChannel.stop", - "resolution": "resolved", - "slice_id": "0f827ef81a990258a8a74381c8564a8361afa6712dba3200592659c939adcb9d", - "root_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "path_symbols": [ - "HttpControlChannel.__init__", - "HttpControlChannel._runner", - "HttpControlChannel.stop" - ], - "path_symbol_ids": [ - "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "f29ab212620093d72be20e26c5a399624c7939a6056a728762ed3f84a250bfa3" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "retrieval_report": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C2_DEPENDENCY_GRAPH" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "vector", - "C0_SOURCE_CHUNKS": "vector", - "C2_DEPENDENCY_GRAPH": "vector" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 12, - "C2_DEPENDENCY_GRAPH": 4 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [ - "src/app_runtime/control/http_channel.py" - ] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src/app_runtime/control/http_channel.py" - ] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src/app_runtime/control/http_channel.py" - ] - } - }, - "fallback": { - "used": false, - "reason": null - }, - "retrieval_by_layer_ms": { - "C1_SYMBOL_CATALOG": 26, - "C0_SOURCE_CHUNKS": 16, - "C2_DEPENDENCY_GRAPH": 17 - } - } - }, - "diagnostics": { - "intent_correct": null, - "target_found": true, - "layers_used": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C2_DEPENDENCY_GRAPH" - ], - "retrieval_sufficient": true, - "answer_mode": "normal", - "resolved_target": "HttpControlChannel", - "answer_policy_branch": "normal_answer", - "decision_reason": "evidence_sufficient", - "router_result": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "retrieval_profile": "code", - "sub_intent": "EXPLAIN_LOCAL", - "path_scope": [ - "src/app_runtime/control/http_channel.py" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C2_DEPENDENCY_GRAPH" - ], - "symbol_resolution_status": "resolved" - }, - "retrieval_request": { - "rag_session_id": "7d11da21-faa0-4cea-aede-aeabe069164c", - "query": "Почему в файле src/app_runtime/control/http_channel.py класс HttpControlChannel устроен так?", - "sub_intent": "EXPLAIN_LOCAL", - "path_scope": [ - "src/app_runtime/control/http_channel.py" - ], - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C2_DEPENDENCY_GRAPH" - ] - }, - "per_layer_outcome": [ - { - "layer_id": "C1_SYMBOL_CATALOG", - "hit_count": 8, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C0_SOURCE_CHUNKS", - "hit_count": 1, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C2_DEPENDENCY_GRAPH", - "hit_count": 4, - "empty": false, - "fallback_used": false - } - ], - "empty_layers": [], - "evidence_gate_decision": { - "sufficient": true, - "failure_reasons": [], - "evidence_count": 13 - }, - "evidence_gate_input": { - "resolved_target": "HttpControlChannel", - "sub_intent": "EXPLAIN_LOCAL", - "target_type": "symbol", - "evidence_count": 13, - "code_chunk_count": 13, - "entrypoint_count": 0, - "relation_count": 4, - "test_evidence_count": 0, - "symbol_resolution_status": "resolved", - "path_scope": [ - "src/app_runtime/control/http_channel.py" - ] - }, - "post_evidence_gate": { - "input": { - "answer_mode": "normal", - "degraded_message": "", - "resolved_target": "HttpControlChannel", - "draft_answer_preview": "Класс HttpControlChannel наследует ControlChannel и реализует HTTP-канал управления. Он принимает хост, порт и таймаут при инициализации, создаёт экземпляр UvicornThreadRunner для запуска сервера и использует HttpControlAppFactory для создания FastAPI-приложения. \n\nМетод start запускает сервер с пер", - "repair_candidate": true - }, - "output": { - "passed": true, - "action": "return", - "reasons": [], - "repair_used": false, - "final_answer_preview": "Класс HttpControlChannel наследует ControlChannel и реализует HTTP-канал управления. Он принимает хост, порт и таймаут при инициализации, создаёт экземпляр UvicornThreadRunner для запуска сервера и использует HttpControlAppFactory для создания FastAPI-приложения. \n\nМетод start запускает сервер с пер" - } - }, - "failure_reasons": [], - "timings_ms": { - "router": 2, - "retrieval": 60, - "pre_evidence_gate": 1, - "llm": 3231, - "post_evidence_gate": 1 - } - }, - "rag_rows": [ - { - "path": "src/app_runtime/control/http_channel.py", - "content": "const ControlChannel\nControlChannel = app_runtime.control.base.ControlChannel", - "layer": "C1_SYMBOL_CATALOG", - "title": "ControlChannel", - "span_start": 7, - "span_end": 7, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "6e69a934202b6e11891af8fb72b2033e8ae3071eb7577c64f5545b5b7ddfb51e", - "qname": "ControlChannel", - "kind": "const", - "signature": "ControlChannel = app_runtime.control.base.ControlChannel", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.control.http_channel", - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "const ControlActionSet\nControlActionSet = app_runtime.control.base.ControlActionSet", - "layer": "C1_SYMBOL_CATALOG", - "title": "ControlActionSet", - "span_start": 7, - "span_end": 7, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "2132a5717c57061e3488a1bf4d43650a60ea903a42278f4d494c014bc80d2df9", - "qname": "ControlActionSet", - "kind": "const", - "signature": "ControlActionSet = app_runtime.control.base.ControlActionSet", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.control.http_channel", - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "const JSONResponse\nJSONResponse = fastapi.responses.JSONResponse", - "layer": "C1_SYMBOL_CATALOG", - "title": "JSONResponse", - "span_start": 5, - "span_end": 5, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "238f600ea55013e25a3e1451f7fd65caabea125b314b89247900cdab5b801a23", - "qname": "JSONResponse", - "kind": "const", - "signature": "JSONResponse = fastapi.responses.JSONResponse", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.control.http_channel", - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "const HttpControlAppFactory\nHttpControlAppFactory = app_runtime.control.http_app.HttpControlAppFactory", - "layer": "C1_SYMBOL_CATALOG", - "title": "HttpControlAppFactory", - "span_start": 8, - "span_end": 8, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "9ee00379ee797cd2386e88a6e37dc69e3e31de9144fc4b95f0206cd1430e8983", - "qname": "HttpControlAppFactory", - "kind": "const", - "signature": "HttpControlAppFactory = app_runtime.control.http_app.HttpControlAppFactory", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.control.http_channel", - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "const UvicornThreadRunner\nUvicornThreadRunner = app_runtime.control.http_runner.UvicornThreadRunner", - "layer": "C1_SYMBOL_CATALOG", - "title": "UvicornThreadRunner", - "span_start": 9, - "span_end": 9, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "c6ee53f4ff75d5b34ee95854cb63bb3ecfa163023717cd969b8cba937a0cd3b3", - "qname": "UvicornThreadRunner", - "kind": "const", - "signature": "UvicornThreadRunner = app_runtime.control.http_runner.UvicornThreadRunner", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.control.http_channel", - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "class HttpControlChannel\nHttpControlChannel(ControlChannel)", - "layer": "C1_SYMBOL_CATALOG", - "title": "HttpControlChannel", - "span_start": 12, - "span_end": 57, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "1c9fbdc24819e5604c26ea55428a74310f03a03e1af197ed84846af61e42fdb0", - "qname": "HttpControlChannel", - "kind": "class", - "signature": "HttpControlChannel(ControlChannel)", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.control.http_channel", - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "method HttpControlChannel.__init__\n__init__(self, host, port, timeout)", - "layer": "C1_SYMBOL_CATALOG", - "title": "HttpControlChannel.__init__", - "span_start": 13, - "span_end": 17, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "qname": "HttpControlChannel.__init__", - "kind": "method", - "signature": "__init__(self, host, port, timeout)", - "parent_symbol_id": "HttpControlChannel", - "package_or_module": "src.app_runtime.control.http_channel", - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "method HttpControlChannel.start\nstart(self, actions)", - "layer": "C1_SYMBOL_CATALOG", - "title": "HttpControlChannel.start", - "span_start": 19, - "span_end": 22, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "d1933f04137f52535b6525f1b93ff2cd83bfb216b480e887e791ed1714cda8e0", - "qname": "HttpControlChannel.start", - "kind": "method", - "signature": "start(self, actions)", - "parent_symbol_id": "HttpControlChannel", - "package_or_module": "src.app_runtime.control.http_channel", - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "class HttpControlChannel(ControlChannel):\n def __init__(self, host: str, port: int, timeout: int) -> None:\n self._timeout = timeout\n self._runner = UvicornThreadRunner(host, port, timeout)\n self._factory = HttpControlAppFactory()\n self._actions: ControlActionSet | None = None\n\n async def start(self, actions: ControlActionSet) -> None:\n self._actions = actions\n app = self._factory.create(self._health_response, self._action_response)\n await self._runner.start(app)\n\n async def stop(self) -> None:\n await self._runner.stop()\n\n @property\n def port(self) -> int:\n return self._runner.port\n\n async def _health_response(self) -> dict[str, object]:\n if self._actions is None:\n return {\"status\": \"unhealthy\", \"detail\": \"control actions are not configured\"}\n return await asyncio.wait_for(self._actions.health(), timeout=float(self._timeout))\n\n async def _action_response(self, action: str, _client_source: str = \"unknown\") -> JSONResponse:\n if self._actions is None:\n return JSONResponse(content={\"status\": \"error\", \"detail\": f\"{action} handler is not configured\"}, status_code=404)\n callbacks = {\n \"start\": self._actions.start,\n \"stop\": self._actions.stop,\n \"status\": self._actions.status,\n }\n callback = callbacks.get(action)\n if callback is None:\n return JSONResponse(content={\"status\": \"error\", \"detail\": f\"unsupported action: {action}\"}, status_code=404)\n action_timeout = max(float(self._timeout), 10.0) if action in {\"start\", \"stop\"} else float(self._timeout)\n try:\n detail = await asyncio.wait_for(callback(), timeout=action_timeout)\n except asyncio.TimeoutError:\n return JSONResponse(\n content={\"status\": \"accepted\", \"detail\": f\"{action} operation is still in progress\"},\n status_code=202,\n )\n except Exception as exc:\n return JSONResponse(content={\"status\": \"error\", \"detail\": str(exc)}, status_code=500)\n return JSONResponse(content={\"status\": \"ok\", \"detail\": detail or f\"{action} action accepted\"}, status_code=200)", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/http_channel.py:HttpControlChannel", - "span_start": 12, - "span_end": 57, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.http_channel", - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel.__init__\n -> HttpControlChannel._timeout\n -> HttpControlChannel._action_response", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "HttpControlChannel.__init__:dataflow_slice", - "span_start": 14, - "span_end": 47, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "c3ef21fcae96c82c00be74b3ab827d4af2085d89cb3fa5521c19a174aad84dbb", - "edge_type": "dataflow_slice", - "src_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "src_qname": "HttpControlChannel.__init__", - "dst_symbol_id": "e64969024ccaeb34d8d91473fad07b3b3d341875846392e7a006406c7ada1954", - "dst_ref": "HttpControlChannel._action_response", - "resolution": "resolved", - "slice_id": "c3ef21fcae96c82c00be74b3ab827d4af2085d89cb3fa5521c19a174aad84dbb", - "root_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "path_symbols": [ - "HttpControlChannel.__init__", - "HttpControlChannel._timeout", - "HttpControlChannel._action_response" - ], - "path_symbol_ids": [ - "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "e64969024ccaeb34d8d91473fad07b3b3d341875846392e7a006406c7ada1954" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel.__init__\n -> HttpControlChannel._runner\n -> HttpControlChannel.start", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "HttpControlChannel.__init__:dataflow_slice", - "span_start": 15, - "span_end": 22, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "51d73913df709152258ed1b9a8c8f4eb3c575eccfe6b982aef0b28e0789a29da", - "edge_type": "dataflow_slice", - "src_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "src_qname": "HttpControlChannel.__init__", - "dst_symbol_id": "d1933f04137f52535b6525f1b93ff2cd83bfb216b480e887e791ed1714cda8e0", - "dst_ref": "HttpControlChannel.start", - "resolution": "resolved", - "slice_id": "51d73913df709152258ed1b9a8c8f4eb3c575eccfe6b982aef0b28e0789a29da", - "root_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "path_symbols": [ - "HttpControlChannel.__init__", - "HttpControlChannel._runner", - "HttpControlChannel.start" - ], - "path_symbol_ids": [ - "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "d1933f04137f52535b6525f1b93ff2cd83bfb216b480e887e791ed1714cda8e0" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel.__init__\n -> HttpControlChannel._timeout\n -> HttpControlChannel._health_response", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "HttpControlChannel.__init__:dataflow_slice", - "span_start": 14, - "span_end": 34, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "f858f5c9e575f6c4cdfe3853571b7ee21d1f628a443541d2037c3dc9d0790bef", - "edge_type": "dataflow_slice", - "src_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "src_qname": "HttpControlChannel.__init__", - "dst_symbol_id": "e84bf04e9cd2127df235b7064d05f47e19f19a89c7c82f4c247231d4e8fa426a", - "dst_ref": "HttpControlChannel._health_response", - "resolution": "resolved", - "slice_id": "f858f5c9e575f6c4cdfe3853571b7ee21d1f628a443541d2037c3dc9d0790bef", - "root_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "path_symbols": [ - "HttpControlChannel.__init__", - "HttpControlChannel._timeout", - "HttpControlChannel._health_response" - ], - "path_symbol_ids": [ - "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "e84bf04e9cd2127df235b7064d05f47e19f19a89c7c82f4c247231d4e8fa426a" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel.__init__\n -> HttpControlChannel._runner\n -> HttpControlChannel.stop", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "HttpControlChannel.__init__:dataflow_slice", - "span_start": 15, - "span_end": 25, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "0f827ef81a990258a8a74381c8564a8361afa6712dba3200592659c939adcb9d", - "edge_type": "dataflow_slice", - "src_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "src_qname": "HttpControlChannel.__init__", - "dst_symbol_id": "f29ab212620093d72be20e26c5a399624c7939a6056a728762ed3f84a250bfa3", - "dst_ref": "HttpControlChannel.stop", - "resolution": "resolved", - "slice_id": "0f827ef81a990258a8a74381c8564a8361afa6712dba3200592659c939adcb9d", - "root_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "path_symbols": [ - "HttpControlChannel.__init__", - "HttpControlChannel._runner", - "HttpControlChannel.stop" - ], - "path_symbol_ids": [ - "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "f29ab212620093d72be20e26c5a399624c7939a6056a728762ed3f84a250bfa3" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "validation": { - "passed": true, - "action": "return", - "reasons": [] - }, - "token_usage": { - "prompt_name": "code_qa_explain_local_answer", - "tokens_in_estimate": 2071 - }, - "steps": [ - { - "step": "router", - "status": "completed", - "timings_ms": { - "router": 2 - }, - "output": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN_LOCAL", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - } - }, - { - "step": "retrieval", - "status": "completed", - "timings_ms": { - "retrieval": 60 - }, - "output": { - "rag_count": 13, - "answer_path_rag_count": 13, - "resolved_symbol_status": "resolved", - "resolved_symbol": "HttpControlChannel", - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C2_DEPENDENCY_GRAPH" - ] - }, - "diagnostics": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C2_DEPENDENCY_GRAPH" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "vector", - "C0_SOURCE_CHUNKS": "vector", - "C2_DEPENDENCY_GRAPH": "vector" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 12, - "C2_DEPENDENCY_GRAPH": 4 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [ - "src/app_runtime/control/http_channel.py" - ] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src/app_runtime/control/http_channel.py" - ] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src/app_runtime/control/http_channel.py" - ] - } - }, - "fallback": { - "used": false, - "reason": null - }, - "retrieval_by_layer_ms": { - "C1_SYMBOL_CATALOG": 26, - "C0_SOURCE_CHUNKS": 16, - "C2_DEPENDENCY_GRAPH": 17 - } - } - }, - { - "step": "pre_evidence_gate", - "status": "passed", - "timings_ms": { - "pre_evidence_gate": 1 - }, - "input": { - "resolved_target": "HttpControlChannel", - "sub_intent": "EXPLAIN_LOCAL", - "target_type": "symbol", - "evidence_count": 13, - "code_chunk_count": 13, - "entrypoint_count": 0, - "relation_count": 4, - "test_evidence_count": 0, - "symbol_resolution_status": "resolved", - "path_scope": [ - "src/app_runtime/control/http_channel.py" - ] - }, - "output": { - "passed": true, - "failure_reasons": [], - "degraded_message": "", - "evidence_count": 13 - } - }, - { - "step": "llm", - "status": "completed", - "timings_ms": { - "llm": 3231 - }, - "output": { - "prompt_name": "code_qa_explain_local_answer", - "answer_preview": "Класс HttpControlChannel наследует ControlChannel и реализует HTTP-канал управления. Он принимает хост, порт и таймаут при инициализации, создаёт экземпляр UvicornThreadRunner для запуска сервера и использует HttpControlAppFactory для создания FastAPI-приложения. \n\nМетод start запускает сервер с пер", - "resolved_target": "HttpControlChannel", - "answer_policy_branch": "normal_answer", - "decision_reason": "evidence_sufficient" - } - }, - { - "step": "post_evidence_gate", - "status": "passed", - "timings_ms": { - "post_evidence_gate": 1, - "post_evidence_gate_recheck": 0, - "repair": 0 - }, - "input": { - "answer_mode": "normal", - "degraded_message": "", - "resolved_target": "HttpControlChannel", - "draft_answer_preview": "Класс HttpControlChannel наследует ControlChannel и реализует HTTP-канал управления. Он принимает хост, порт и таймаут при инициализации, создаёт экземпляр UvicornThreadRunner для запуска сервера и использует HttpControlAppFactory для создания FastAPI-приложения. \n\nМетод start запускает сервер с пер", - "repair_candidate": true - }, - "output": { - "passed": true, - "action": "return", - "reasons": [], - "repair_used": false, - "final_answer_preview": "Класс HttpControlChannel наследует ControlChannel и реализует HTTP-канал управления. Он принимает хост, порт и таймаут при инициализации, создаёт экземпляр UvicornThreadRunner для запуска сервера и использует HttpControlAppFactory для создания FastAPI-приложения. \n\nМетод start запускает сервер с пер" - } - } - ] - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/manual_run/20260312_193339/full_chain_plba_code_subintents_one_per_subintent_plba-v3-explain-local-http-channel.md b/tests/pipeline_setup_v3/test_results/manual_run/20260312_193339/full_chain_plba_code_subintents_one_per_subintent_plba-v3-explain-local-http-channel.md deleted file mode 100644 index 5a9d240..0000000 --- a/tests/pipeline_setup_v3/test_results/manual_run/20260312_193339/full_chain_plba_code_subintents_one_per_subintent_plba-v3-explain-local-http-channel.md +++ /dev/null @@ -1,285 +0,0 @@ -# plba-v3-explain-local-http-channel - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_02_pipeline/full_chain_plba_code_subintents_one_per_subintent.yaml -- runner: agent_runtime -- mode: full_chain -- passed: True - -## Query -Почему в файле src/app_runtime/control/http_channel.py класс HttpControlChannel устроен так? - -## Actual -{ - "intent": "CODE_QA", - "sub_intent": "EXPLAIN_LOCAL", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 13, - "llm_answer": "Класс HttpControlChannel наследует ControlChannel и реализует HTTP-канал управления. Он принимает хост, порт и таймаут при инициализации, создаёт экземпляр UvicornThreadRunner для запуска сервера и использует HttpControlAppFactory для создания FastAPI-приложения. \n\nМетод start запускает сервер с переданным набором действий (ControlActionSet), а метод stop останавливает его. Свойство port возвращает текущий порт runner.\n\nВнутри класса определены два обработчика: _health_response проверяет здоровье канала, возвращая статус \"unhealthy\" если действия не установлены; \n_action_response предположительно обрабатывает запросы на выполнение действий, но его реализация в данном фрагменте не показана.", - "answer_mode": "answered", - "path_scope": [ - "src/app_runtime/control/http_channel.py" - ], - "symbol_candidates": [ - "HttpControlChannel" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C2_DEPENDENCY_GRAPH" - ] -} - -## Steps -[ - { - "step": "router", - "status": "completed", - "timings_ms": { - "router": 2 - }, - "output": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN_LOCAL", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - } - }, - { - "step": "retrieval", - "status": "completed", - "timings_ms": { - "retrieval": 60 - }, - "output": { - "rag_count": 13, - "answer_path_rag_count": 13, - "resolved_symbol_status": "resolved", - "resolved_symbol": "HttpControlChannel", - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C2_DEPENDENCY_GRAPH" - ] - }, - "diagnostics": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C2_DEPENDENCY_GRAPH" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "vector", - "C0_SOURCE_CHUNKS": "vector", - "C2_DEPENDENCY_GRAPH": "vector" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 12, - "C2_DEPENDENCY_GRAPH": 4 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [ - "src/app_runtime/control/http_channel.py" - ] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src/app_runtime/control/http_channel.py" - ] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src/app_runtime/control/http_channel.py" - ] - } - }, - "fallback": { - "used": false, - "reason": null - }, - "retrieval_by_layer_ms": { - "C1_SYMBOL_CATALOG": 26, - "C0_SOURCE_CHUNKS": 16, - "C2_DEPENDENCY_GRAPH": 17 - } - } - }, - { - "step": "pre_evidence_gate", - "status": "passed", - "timings_ms": { - "pre_evidence_gate": 1 - }, - "input": { - "resolved_target": "HttpControlChannel", - "sub_intent": "EXPLAIN_LOCAL", - "target_type": "symbol", - "evidence_count": 13, - "code_chunk_count": 13, - "entrypoint_count": 0, - "relation_count": 4, - "test_evidence_count": 0, - "symbol_resolution_status": "resolved", - "path_scope": [ - "src/app_runtime/control/http_channel.py" - ] - }, - "output": { - "passed": true, - "failure_reasons": [], - "degraded_message": "", - "evidence_count": 13 - } - }, - { - "step": "llm", - "status": "completed", - "timings_ms": { - "llm": 3231 - }, - "output": { - "prompt_name": "code_qa_explain_local_answer", - "answer_preview": "Класс HttpControlChannel наследует ControlChannel и реализует HTTP-канал управления. Он принимает хост, порт и таймаут при инициализации, создаёт экземпляр UvicornThreadRunner для запуска сервера и использует HttpControlAppFactory для создания FastAPI-приложения. \n\nМетод start запускает сервер с пер", - "resolved_target": "HttpControlChannel", - "answer_policy_branch": "normal_answer", - "decision_reason": "evidence_sufficient" - } - }, - { - "step": "post_evidence_gate", - "status": "passed", - "timings_ms": { - "post_evidence_gate": 1, - "post_evidence_gate_recheck": 0, - "repair": 0 - }, - "input": { - "answer_mode": "normal", - "degraded_message": "", - "resolved_target": "HttpControlChannel", - "draft_answer_preview": "Класс HttpControlChannel наследует ControlChannel и реализует HTTP-канал управления. Он принимает хост, порт и таймаут при инициализации, создаёт экземпляр UvicornThreadRunner для запуска сервера и использует HttpControlAppFactory для создания FastAPI-приложения. \n\nМетод start запускает сервер с пер", - "repair_candidate": true - }, - "output": { - "passed": true, - "action": "return", - "reasons": [], - "repair_used": false, - "final_answer_preview": "Класс HttpControlChannel наследует ControlChannel и реализует HTTP-канал управления. Он принимает хост, порт и таймаут при инициализации, создаёт экземпляр UvicornThreadRunner для запуска сервера и использует HttpControlAppFactory для создания FastAPI-приложения. \n\nМетод start запускает сервер с пер" - } - } -] - -## Diagnostics -{ - "intent_correct": null, - "target_found": true, - "layers_used": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C2_DEPENDENCY_GRAPH" - ], - "retrieval_sufficient": true, - "answer_mode": "normal", - "resolved_target": "HttpControlChannel", - "answer_policy_branch": "normal_answer", - "decision_reason": "evidence_sufficient", - "router_result": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "retrieval_profile": "code", - "sub_intent": "EXPLAIN_LOCAL", - "path_scope": [ - "src/app_runtime/control/http_channel.py" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C2_DEPENDENCY_GRAPH" - ], - "symbol_resolution_status": "resolved" - }, - "retrieval_request": { - "rag_session_id": "7d11da21-faa0-4cea-aede-aeabe069164c", - "query": "Почему в файле src/app_runtime/control/http_channel.py класс HttpControlChannel устроен так?", - "sub_intent": "EXPLAIN_LOCAL", - "path_scope": [ - "src/app_runtime/control/http_channel.py" - ], - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C2_DEPENDENCY_GRAPH" - ] - }, - "per_layer_outcome": [ - { - "layer_id": "C1_SYMBOL_CATALOG", - "hit_count": 8, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C0_SOURCE_CHUNKS", - "hit_count": 1, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C2_DEPENDENCY_GRAPH", - "hit_count": 4, - "empty": false, - "fallback_used": false - } - ], - "empty_layers": [], - "evidence_gate_decision": { - "sufficient": true, - "failure_reasons": [], - "evidence_count": 13 - }, - "evidence_gate_input": { - "resolved_target": "HttpControlChannel", - "sub_intent": "EXPLAIN_LOCAL", - "target_type": "symbol", - "evidence_count": 13, - "code_chunk_count": 13, - "entrypoint_count": 0, - "relation_count": 4, - "test_evidence_count": 0, - "symbol_resolution_status": "resolved", - "path_scope": [ - "src/app_runtime/control/http_channel.py" - ] - }, - "post_evidence_gate": { - "input": { - "answer_mode": "normal", - "degraded_message": "", - "resolved_target": "HttpControlChannel", - "draft_answer_preview": "Класс HttpControlChannel наследует ControlChannel и реализует HTTP-канал управления. Он принимает хост, порт и таймаут при инициализации, создаёт экземпляр UvicornThreadRunner для запуска сервера и использует HttpControlAppFactory для создания FastAPI-приложения. \n\nМетод start запускает сервер с пер", - "repair_candidate": true - }, - "output": { - "passed": true, - "action": "return", - "reasons": [], - "repair_used": false, - "final_answer_preview": "Класс HttpControlChannel наследует ControlChannel и реализует HTTP-канал управления. Он принимает хост, порт и таймаут при инициализации, создаёт экземпляр UvicornThreadRunner для запуска сервера и использует HttpControlAppFactory для создания FastAPI-приложения. \n\nМетод start запускает сервер с пер" - } - }, - "failure_reasons": [], - "timings_ms": { - "router": 2, - "retrieval": 60, - "pre_evidence_gate": 1, - "llm": 3231, - "post_evidence_gate": 1 - } -} - -## Mismatches -- none \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/manual_run/20260312_193339/full_chain_plba_code_subintents_one_per_subintent_plba-v3-explain-runtime-manager.json b/tests/pipeline_setup_v3/test_results/manual_run/20260312_193339/full_chain_plba_code_subintents_one_per_subintent_plba-v3-explain-runtime-manager.json deleted file mode 100644 index a6501f3..0000000 --- a/tests/pipeline_setup_v3/test_results/manual_run/20260312_193339/full_chain_plba_code_subintents_one_per_subintent_plba-v3-explain-runtime-manager.json +++ /dev/null @@ -1,4472 +0,0 @@ -{ - "case_id": "plba-v3-explain-runtime-manager", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_02_pipeline/full_chain_plba_code_subintents_one_per_subintent.yaml", - "runner": "agent_runtime", - "mode": "full_chain", - "query": "Объясни как работает класс RuntimeManager", - "actual": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 33, - "llm_answer": "Недостаточно подтверждённых данных для уверенного ответа по RuntimeManager.", - "answer_mode": "degraded", - "path_scope": [], - "symbol_candidates": [ - "RuntimeManager" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "passed": true, - "mismatches": [], - "details": { - "query": "Объясни как работает класс RuntimeManager", - "router_result": { - "schema_version": "1.1", - "intent": "CODE_QA", - "retrieval_profile": "code", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query_plan": { - "raw": "Объясни как работает класс RuntimeManager", - "normalized": "Объясни как работает класс RuntimeManager", - "sub_intent": "EXPLAIN", - "negations": [], - "expansions": [ - "RuntimeManager" - ], - "keyword_hints": [ - "RuntimeManager" - ], - "path_hints": [], - "doc_scope_hints": [], - "symbol_candidates": [ - "RuntimeManager" - ], - "symbol_kind_hint": "class", - "anchors": [ - { - "type": "SYMBOL", - "value": "RuntimeManager", - "source": "user_text", - "subtype": null, - "span": { - "start": 27, - "end": 41 - }, - "confidence": 0.88 - }, - { - "type": "KEY_TERM", - "value": "класс", - "source": "user_text", - "subtype": null, - "span": { - "start": 21, - "end": 26 - }, - "confidence": 0.9 - } - ] - }, - "retrieval_spec": { - "domains": [ - "CODE" - ], - "layer_queries": [ - { - "layer_id": "C1_SYMBOL_CATALOG", - "top_k": 8 - }, - { - "layer_id": "C0_SOURCE_CHUNKS", - "top_k": 8 - }, - { - "layer_id": "C4_SEMANTIC_ROLES", - "top_k": 8 - }, - { - "layer_id": "C2_DEPENDENCY_GRAPH", - "top_k": 6 - }, - { - "layer_id": "C3_ENTRYPOINTS", - "top_k": 6 - } - ], - "filters": { - "test_policy": "EXCLUDE", - "path_scope": [], - "language": [ - "python" - ] - }, - "rerank_profile": "code" - }, - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - }, - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "RuntimeManager", - "alternatives": [ - "RuntimeManager", - "RuntimeManager", - "RuntimeManager", - "RuntimeManager", - "RuntimeManager" - ], - "confidence": 0.99 - }, - "evidence_policy": { - "require_def": true, - "require_flow": true, - "require_spec": false, - "allow_answer_without_evidence": false - } - }, - "retrieval_request": { - "rag_session_id": "7d11da21-faa0-4cea-aede-aeabe069164c", - "query": "Объясни как работает класс RuntimeManager", - "sub_intent": "EXPLAIN", - "path_scope": [], - "keyword_hints": [ - "RuntimeManager" - ], - "symbol_candidates": [ - "RuntimeManager" - ], - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_spec": { - "domains": [ - "CODE" - ], - "layer_queries": [ - { - "layer_id": "C1_SYMBOL_CATALOG", - "top_k": 8 - }, - { - "layer_id": "C0_SOURCE_CHUNKS", - "top_k": 8 - }, - { - "layer_id": "C4_SEMANTIC_ROLES", - "top_k": 8 - }, - { - "layer_id": "C2_DEPENDENCY_GRAPH", - "top_k": 6 - }, - { - "layer_id": "C3_ENTRYPOINTS", - "top_k": 6 - } - ], - "filters": { - "test_policy": "EXCLUDE", - "path_scope": [], - "language": [ - "python" - ] - }, - "rerank_profile": "code" - }, - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - }, - "query_plan": { - "raw": "Объясни как работает класс RuntimeManager", - "normalized": "Объясни как работает класс RuntimeManager", - "sub_intent": "EXPLAIN", - "negations": [], - "expansions": [ - "RuntimeManager" - ], - "keyword_hints": [ - "RuntimeManager" - ], - "path_hints": [], - "doc_scope_hints": [], - "symbol_candidates": [ - "RuntimeManager" - ], - "symbol_kind_hint": "class", - "anchors": [ - { - "type": "SYMBOL", - "value": "RuntimeManager", - "source": "user_text", - "subtype": null, - "span": { - "start": 27, - "end": 41 - }, - "confidence": 0.88 - }, - { - "type": "KEY_TERM", - "value": "класс", - "source": "user_text", - "subtype": null, - "span": { - "start": 21, - "end": 26 - }, - "confidence": 0.9 - } - ] - } - }, - "retrieval_result": { - "target_symbol_candidates": [ - "RuntimeManager", - "ControlPlaneService", - "ControlChannel.start", - "ControlChannel.stop" - ], - "resolved_symbol": "RuntimeManager", - "symbol_resolution_status": "resolved", - "file_candidates": [ - "src/plba/bootstrap.py", - "src/app_runtime/control/service.py", - "src/app_runtime/core/runtime.py", - "src/plba/__init__.py", - "src/plba/core.py", - "src/app_runtime/control/__init__.py", - "src/app_runtime/control/base.py", - "src/app_runtime/control/http_runner.py", - "src/app_runtime/control/http_app.py", - "src/app_runtime/control/http_channel.py", - "src/plba/control.py", - "src/app_runtime/workflow/persistence/workflow_persistence.py" - ], - "code_chunks": [ - { - "layer": "C1_SYMBOL_CATALOG", - "path": "src/plba/bootstrap.py", - "title": "RuntimeManager", - "content": "const RuntimeManager\nRuntimeManager = app_runtime.core.runtime.RuntimeManager", - "start_line": 4, - "end_line": 4, - "metadata": { - "symbol_id": "27158ca220022eeb5083c6addf8a50775d45f7161284fd60aac48410105f4b98", - "qname": "RuntimeManager", - "kind": "const", - "signature": "RuntimeManager = app_runtime.core.runtime.RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "src.plba.bootstrap", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C1_SYMBOL_CATALOG", - "path": "src/app_runtime/control/service.py", - "title": "RuntimeManager", - "content": "const RuntimeManager\nRuntimeManager = app_runtime.core.runtime.RuntimeManager", - "start_line": 9, - "end_line": 9, - "metadata": { - "symbol_id": "62a9575c77aad894120d18b4f2a08cf2ba42f77e9be4a8a432b767d157701afe", - "qname": "RuntimeManager", - "kind": "const", - "signature": "RuntimeManager = app_runtime.core.runtime.RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.control.service", - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C1_SYMBOL_CATALOG", - "path": "src/app_runtime/core/runtime.py", - "title": "RuntimeManager", - "content": "class RuntimeManager\nRuntimeManager", - "start_line": 18, - "end_line": 179, - "metadata": { - "symbol_id": "7e4a9381328c5803bbc6179458612fc4e947d928aa7bf8b4b2bebb2c8592f758", - "qname": "RuntimeManager", - "kind": "class", - "signature": "RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.core.runtime", - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C1_SYMBOL_CATALOG", - "path": "src/plba/__init__.py", - "title": "RuntimeManager", - "content": "const RuntimeManager\nRuntimeManager = plba.core.RuntimeManager", - "start_line": 16, - "end_line": 16, - "metadata": { - "symbol_id": "7eacec84f9b8d6c4201374591faecdac7493091c263681495c338973f2971ad9", - "qname": "RuntimeManager", - "kind": "const", - "signature": "RuntimeManager = plba.core.RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "src.plba.__init__", - "is_test": false, - "blob_sha": "24e755ec8c249d14fb0e675b5dbf2b71ab91afb9c849897eebfa9feb2499e19d", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C1_SYMBOL_CATALOG", - "path": "src/plba/core.py", - "title": "RuntimeManager", - "content": "const RuntimeManager\nRuntimeManager = app_runtime.core.runtime.RuntimeManager", - "start_line": 2, - "end_line": 2, - "metadata": { - "symbol_id": "e1684562d978b7af7fe9b27dc5869d770348a87b5dc19a50360f58544668578b", - "qname": "RuntimeManager", - "kind": "const", - "signature": "RuntimeManager = app_runtime.core.runtime.RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "src.plba.core", - "is_test": false, - "blob_sha": "c0ae25110d20e665216616e26b68adfe035b624ba45d31d1272fb21f906f9ca8", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C1_SYMBOL_CATALOG", - "path": "src/app_runtime/control/__init__.py", - "title": "ControlPlaneService", - "content": "const ControlPlaneService\nControlPlaneService = app_runtime.control.service.ControlPlaneService", - "start_line": 3, - "end_line": 3, - "metadata": { - "symbol_id": "217e8f044d1c01644bf7b81e5046af9e84469210c692a2fb0c476a19bb069ae1", - "qname": "ControlPlaneService", - "kind": "const", - "signature": "ControlPlaneService = app_runtime.control.service.ControlPlaneService", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.control.__init__", - "is_test": false, - "blob_sha": "bf3c37e3369a84cc618adc0fd71c232e5eb4b871eaff743069a17e661e498316", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C1_SYMBOL_CATALOG", - "path": "src/app_runtime/control/base.py", - "title": "ControlChannel.start", - "content": "method ControlChannel.start\nstart(self, actions)\nStart the control channel and bind handlers.", - "start_line": 23, - "end_line": 24, - "metadata": { - "symbol_id": "e01e0d50d0f48d0c84c119c989b7a7c57ceea263811ce2605c684ae24d1a03b1", - "qname": "ControlChannel.start", - "kind": "method", - "signature": "start(self, actions)", - "parent_symbol_id": "ControlChannel", - "package_or_module": "src.app_runtime.control.base", - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C1_SYMBOL_CATALOG", - "path": "src/app_runtime/control/base.py", - "title": "ControlChannel.stop", - "content": "method ControlChannel.stop\nstop(self)\nStop the control channel and release resources.", - "start_line": 27, - "end_line": 28, - "metadata": { - "symbol_id": "54b5adf9866c526836221dc721b474ba23fbec83e1b1d3b8bc4da67ae3c1541d", - "qname": "ControlChannel.stop", - "kind": "method", - "signature": "stop(self)", - "parent_symbol_id": "ControlChannel", - "package_or_module": "src.app_runtime.control.base", - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C0_SOURCE_CHUNKS", - "path": "src/app_runtime/control/service.py", - "title": "src/app_runtime/control/service.py:ControlPlaneService", - "content": "class ControlPlaneService:\n def __init__(self) -> None:\n self._channels: list[ControlChannel] = []\n\n def register_channel(self, channel: ControlChannel) -> None:\n self._channels.append(channel)\n\n def start(self, runtime: RuntimeManager) -> None:\n if not self._channels:\n return\n asyncio.run(self._start_async(runtime))\n\n def stop(self) -> None:\n if not self._channels:\n return\n asyncio.run(self._stop_async())\n\n def snapshot(self, runtime: RuntimeManager) -> dict[str, object]:\n health = runtime.current_health()\n return {\n \"runtime\": {\"state\": runtime._state.value},\n \"modules\": list(runtime.registry.modules),\n \"services\": runtime.services.snapshot(),\n \"workers\": runtime.workers.snapshot(),\n \"health\": runtime.health.snapshot(runtime.workers.healths()) | {\"status\": health[\"status\"]},\n \"config\": runtime.configuration.get(),\n }\n\n async def _start_async(self, runtime: RuntimeManager) -> None:\n actions = ControlActionSet(\n health=runtime.health_status,\n start=runtime.start_runtime,\n stop=runtime.stop_runtime,\n status=runtime.runtime_status,\n )\n for channel in self._channels:\n await channel.start(actions)\n\n async def _stop_async(self) -> None:\n for channel in reversed(self._channels):\n await channel.stop()", - "start_line": 12, - "end_line": 52, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.service", - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C0_SOURCE_CHUNKS", - "path": "src/app_runtime/control/http_runner.py", - "title": "src/app_runtime/control/http_runner.py:UvicornThreadRunner", - "content": "class UvicornThreadRunner:\n def __init__(self, host: str, port: int, timeout: int) -> None:\n self._host = host\n self._port = port\n self._timeout = timeout\n self._server: Server | None = None\n self._thread: Thread | None = None\n self._error: BaseException | None = None\n\n async def start(self, app: FastAPI) -> None:\n if self._thread is not None and self._thread.is_alive():\n return\n self._error = None\n config = Config(app=app, host=self._host, port=self._port, log_level=\"warning\")\n self._server = Server(config)\n self._thread = Thread(target=self._serve, name=\"plba-http-control\", daemon=True)\n self._thread.start()\n await self._wait_until_started()\n\n async def stop(self) -> None:\n if self._server is None or self._thread is None:\n return\n self._server.should_exit = True\n await asyncio.to_thread(self._thread.join, self._timeout)\n self._server = None\n self._thread = None\n\n @property\n def port(self) -> int:\n if self._server is None or not getattr(self._server, \"servers\", None):\n return self._port\n socket = self._server.servers[0].sockets[0]\n return int(socket.getsockname()[1])\n\n async def _wait_until_started(self) -> None:\n if self._server is None:\n raise RuntimeError(\"Server is not initialized\")\n deadline = asyncio.get_running_loop().time() + max(float(self._timeout), 1.0)\n while not self._server.started:\n if self._error is not None:\n raise RuntimeError(\"HTTP control server failed to start\") from self._error\n if asyncio.get_running_loop().time() >= deadline:\n raise TimeoutError(\"HTTP control server startup timed out\")\n await asyncio.sleep(0.05)\n\n def _serve(self) -> None:\n if self._server is None:\n return\n try:\n asyncio.run(self._server.serve())\n except BaseException as exc: # noqa: BLE001\n self._error = exc", - "start_line": 10, - "end_line": 61, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.http_runner", - "is_test": false, - "blob_sha": "3779fdd2878b770e789a35bb2a89c9d79f13b61c26d7db1b3b683f9bb9e1623f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C0_SOURCE_CHUNKS", - "path": "src/app_runtime/control/base.py", - "title": "src/app_runtime/control/base.py:ControlChannel", - "content": "class ControlChannel(ABC):\n @abstractmethod\n async def start(self, actions: ControlActionSet) -> None:\n \"\"\"Start the control channel and bind handlers.\"\"\"\n\n @abstractmethod\n async def stop(self) -> None:\n \"\"\"Stop the control channel and release resources.\"\"\"", - "start_line": 21, - "end_line": 28, - "metadata": { - "chunk_index": 1, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.base", - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C0_SOURCE_CHUNKS", - "path": "src/app_runtime/control/__init__.py", - "title": "src/app_runtime/control/__init__.py:1-5", - "content": "from app_runtime.control.base import ControlActionSet, ControlChannel\nfrom app_runtime.control.http_channel import HttpControlChannel\nfrom app_runtime.control.service import ControlPlaneService\n\n__all__ = [\"ControlActionSet\", \"ControlChannel\", \"ControlPlaneService\", \"HttpControlChannel\"]", - "start_line": 1, - "end_line": 5, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.app_runtime.control.__init__", - "is_test": false, - "blob_sha": "bf3c37e3369a84cc618adc0fd71c232e5eb4b871eaff743069a17e661e498316", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C0_SOURCE_CHUNKS", - "path": "src/app_runtime/control/http_app.py", - "title": "src/app_runtime/control/http_app.py:HttpControlAppFactory", - "content": "class HttpControlAppFactory:\n def create(\n self,\n health_provider: Callable[[], Awaitable[HealthPayload]],\n action_provider: Callable[[str, str], Awaitable[JSONResponse]],\n ) -> FastAPI:\n app = FastAPI(title=\"PLBA Control API\")\n\n @app.middleware(\"http\")\n async def log_api_call(request: Request, call_next): # type: ignore[no-untyped-def]\n started = time.monotonic()\n response = await call_next(request)\n response.headers[\"X-Response-Time-Ms\"] = str(int((time.monotonic() - started) * 1000))\n return response\n\n @app.get(\"/health\")\n async def health() -> JSONResponse:\n payload = await health_provider()\n status_code = 200 if payload.get(\"status\") == \"ok\" else 503\n return JSONResponse(content=payload, status_code=status_code)\n\n @app.get(\"/actions/{action}\")\n @app.post(\"/actions/{action}\")\n async def action(action: str, request: Request) -> JSONResponse:\n client_source = self._client_source(request)\n if action in {\"start\", \"stop\"}:\n LOGGER.warning(\"Control action requested: /actions/%s client=%s\", action, client_source)\n return await action_provider(action, client_source)\n\n return app\n\n def _client_source(self, request: Request) -> str:\n explicit_header = request.headers.get(\"X-Client-Source\", \"\").strip()\n if explicit_header:\n return explicit_header\n user_agent = request.headers.get(\"User-Agent\", \"\").strip()\n if user_agent:\n return f\"user-agent:{user_agent}\"\n return \"unknown\"", - "start_line": 15, - "end_line": 53, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.http_app", - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C0_SOURCE_CHUNKS", - "path": "src/app_runtime/control/http_channel.py", - "title": "src/app_runtime/control/http_channel.py:HttpControlChannel", - "content": "class HttpControlChannel(ControlChannel):\n def __init__(self, host: str, port: int, timeout: int) -> None:\n self._timeout = timeout\n self._runner = UvicornThreadRunner(host, port, timeout)\n self._factory = HttpControlAppFactory()\n self._actions: ControlActionSet | None = None\n\n async def start(self, actions: ControlActionSet) -> None:\n self._actions = actions\n app = self._factory.create(self._health_response, self._action_response)\n await self._runner.start(app)\n\n async def stop(self) -> None:\n await self._runner.stop()\n\n @property\n def port(self) -> int:\n return self._runner.port\n\n async def _health_response(self) -> dict[str, object]:\n if self._actions is None:\n return {\"status\": \"unhealthy\", \"detail\": \"control actions are not configured\"}\n return await asyncio.wait_for(self._actions.health(), timeout=float(self._timeout))\n\n async def _action_response(self, action: str, _client_source: str = \"unknown\") -> JSONResponse:\n if self._actions is None:\n return JSONResponse(content={\"status\": \"error\", \"detail\": f\"{action} handler is not configured\"}, status_code=404)\n callbacks = {\n \"start\": self._actions.start,\n \"stop\": self._actions.stop,\n \"status\": self._actions.status,\n }\n callback = callbacks.get(action)\n if callback is None:\n return JSONResponse(content={\"status\": \"error\", \"detail\": f\"unsupported action: {action}\"}, status_code=404)\n action_timeout = max(float(self._timeout), 10.0) if action in {\"start\", \"stop\"} else float(self._timeout)\n try:\n detail = await asyncio.wait_for(callback(), timeout=action_timeout)\n except asyncio.TimeoutError:\n return JSONResponse(\n content={\"status\": \"accepted\", \"detail\": f\"{action} operation is still in progress\"},\n status_code=202,\n )\n except Exception as exc:\n return JSONResponse(content={\"status\": \"error\", \"detail\": str(exc)}, status_code=500)\n return JSONResponse(content={\"status\": \"ok\", \"detail\": detail or f\"{action} action accepted\"}, status_code=200)", - "start_line": 12, - "end_line": 57, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.http_channel", - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C0_SOURCE_CHUNKS", - "path": "src/app_runtime/control/base.py", - "title": "src/app_runtime/control/base.py:ControlActionSet", - "content": "class ControlActionSet:\n health: HealthHandler\n start: ActionHandler\n stop: ActionHandler\n status: ActionHandler", - "start_line": 14, - "end_line": 18, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.base", - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C0_SOURCE_CHUNKS", - "path": "src/plba/control.py", - "title": "src/plba/control.py:1-10", - "content": "from app_runtime.control.base import ControlActionSet, ControlChannel\nfrom app_runtime.control.http_channel import HttpControlChannel\nfrom app_runtime.control.service import ControlPlaneService\n\n__all__ = [\n \"ControlActionSet\",\n \"ControlChannel\",\n \"ControlPlaneService\",\n \"HttpControlChannel\",\n]", - "start_line": 1, - "end_line": 10, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.plba.control", - "is_test": false, - "blob_sha": "31bd5c4481bfa7fbca8fae56d4860a67e3953ca74474ac8439e1f39b685d7bc8", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C4_SEMANTIC_ROLES", - "path": "src/app_runtime/core/runtime.py", - "title": "RuntimeManager", - "content": "RuntimeManager\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests manager\n- orchestrates role-like calls (4)\n- reads and writes state attributes\n- participates in dataflow slices (50)", - "start_line": 18, - "end_line": 179, - "metadata": { - "symbol_id": "7e4a9381328c5803bbc6179458612fc4e947d928aa7bf8b4b2bebb2c8592f758", - "symbol_name": "RuntimeManager", - "qname": "RuntimeManager", - "role": "pipeline_stage", - "confidence": 0.67, - "dataflow_participation": 50, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C4_SEMANTIC_ROLES", - "path": "src/app_runtime/control/base.py", - "title": "ControlChannel", - "content": "ControlChannel\nrole: model\n\nResponsibilities:\n- default model role", - "start_line": 21, - "end_line": 28, - "metadata": { - "symbol_id": "cfcfe9a311d3a2dbdaf32ac4ccd73c0eb9a117f830591a1c0867ee97d46204ff", - "symbol_name": "ControlChannel", - "qname": "ControlChannel", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C4_SEMANTIC_ROLES", - "path": "src/app_runtime/control/base.py", - "title": "ControlActionSet", - "content": "ControlActionSet\nrole: model\n\nResponsibilities:\n- default model role", - "start_line": 14, - "end_line": 18, - "metadata": { - "symbol_id": "46eb026cb3313415ec47b82dd22f84f4d112c9d987e8b1716dcb0baa1cce8988", - "symbol_name": "ControlActionSet", - "qname": "ControlActionSet", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C4_SEMANTIC_ROLES", - "path": "src/app_runtime/control/service.py", - "title": "ControlPlaneService", - "content": "ControlPlaneService\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests service\n- reads and writes state attributes\n- participates in dataflow slices (5)", - "start_line": 12, - "end_line": 52, - "metadata": { - "symbol_id": "b13471e5916986dccffb53fab613812842965705e6b3a89ae549d30c9e91e9aa", - "symbol_name": "ControlPlaneService", - "qname": "ControlPlaneService", - "role": "pipeline_stage", - "confidence": 0.57, - "dataflow_participation": 5, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C4_SEMANTIC_ROLES", - "path": "src/app_runtime/control/http_runner.py", - "title": "UvicornThreadRunner", - "content": "UvicornThreadRunner\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (24)", - "start_line": 10, - "end_line": 61, - "metadata": { - "symbol_id": "fd55630045a02100df8877ac27d951ee08617d4598764394d48cb51fe067476a", - "symbol_name": "UvicornThreadRunner", - "qname": "UvicornThreadRunner", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 24, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "3779fdd2878b770e789a35bb2a89c9d79f13b61c26d7db1b3b683f9bb9e1623f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C4_SEMANTIC_ROLES", - "path": "src/app_runtime/control/http_channel.py", - "title": "HttpControlChannel", - "content": "HttpControlChannel\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (10)", - "start_line": 12, - "end_line": 57, - "metadata": { - "symbol_id": "1c9fbdc24819e5604c26ea55428a74310f03a03e1af197ed84846af61e42fdb0", - "symbol_name": "HttpControlChannel", - "qname": "HttpControlChannel", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 10, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C4_SEMANTIC_ROLES", - "path": "src/app_runtime/control/http_app.py", - "title": "HttpControlAppFactory", - "content": "HttpControlAppFactory\nrole: factory\n\nResponsibilities:\n- name suffix suggests factory", - "start_line": 15, - "end_line": 53, - "metadata": { - "symbol_id": "9b3502a5fb408b273223db13264349cf500de24915b6c649d9ea8970d0dfd8e0", - "symbol_name": "HttpControlAppFactory", - "qname": "HttpControlAppFactory", - "role": "factory", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C4_SEMANTIC_ROLES", - "path": "src/app_runtime/workflow/persistence/workflow_persistence.py", - "title": "WorkflowPersistence", - "content": "WorkflowPersistence\nrole: pipeline_stage\n\nResponsibilities:\n- orchestrates role-like calls (2)\n- reads and writes state attributes\n- participates in dataflow slices (16)", - "start_line": 8, - "end_line": 54, - "metadata": { - "symbol_id": "7bd01ee45cf31f2d5c2e3e51656254860ac785d10cef9e0852cd4fba90857bae", - "symbol_name": "WorkflowPersistence", - "qname": "WorkflowPersistence", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 16, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "80e9410ddc639789b4353c2a1a757ba8d0d5b5bb6075b0b263b61551f04ae1f0", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "path": "src/app_runtime/control/service.py", - "title": "ControlPlaneService.__init__:dataflow_slice", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.stop", - "start_line": 14, - "end_line": 25, - "metadata": { - "edge_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d", - "dst_ref": "ControlPlaneService.stop", - "resolution": "resolved", - "slice_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.stop" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "path": "src/app_runtime/control/service.py", - "title": "ControlPlaneService.__init__:dataflow_slice", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._stop_async", - "start_line": 14, - "end_line": 51, - "metadata": { - "edge_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a", - "dst_ref": "ControlPlaneService._stop_async", - "resolution": "resolved", - "slice_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._stop_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "path": "src/app_runtime/control/service.py", - "title": "ControlPlaneService.__init__:dataflow_slice", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.register_channel", - "start_line": 14, - "end_line": 17, - "metadata": { - "edge_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957", - "dst_ref": "ControlPlaneService.register_channel", - "resolution": "resolved", - "slice_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.register_channel" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "path": "src/app_runtime/control/service.py", - "title": "ControlPlaneService.__init__:dataflow_slice", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.start", - "start_line": 14, - "end_line": 20, - "metadata": { - "edge_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154", - "dst_ref": "ControlPlaneService.start", - "resolution": "resolved", - "slice_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.start" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "path": "src/app_runtime/control/service.py", - "title": "ControlPlaneService.__init__:dataflow_slice", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._start_async", - "start_line": 14, - "end_line": 47, - "metadata": { - "edge_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517", - "dst_ref": "ControlPlaneService._start_async", - "resolution": "resolved", - "slice_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._start_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "path": "src/app_runtime/core/runtime.py", - "title": "RuntimeManager.__init__:dataflow_slice", - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager.add_config_file", - "start_line": 32, - "end_line": 52, - "metadata": { - "edge_id": "a23b8a11ebdb12708b60c96ea12a69f7f042082f1adfddd572444e246d81d167", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "57ffbd4f0d9fdf3507c2b8624312ce211f3d02fdf86a57a8ec90778d8a7b498d", - "dst_ref": "RuntimeManager.add_config_file", - "resolution": "resolved", - "slice_id": "a23b8a11ebdb12708b60c96ea12a69f7f042082f1adfddd572444e246d81d167", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager.add_config_file" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "57ffbd4f0d9fdf3507c2b8624312ce211f3d02fdf86a57a8ec90778d8a7b498d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C3_ENTRYPOINTS", - "path": "src/app_runtime/control/http_app.py", - "title": "app.post", - "content": "fastapi http app.post", - "start_line": 38, - "end_line": 42, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C3_ENTRYPOINTS", - "path": "src/app_runtime/control/http_app.py", - "title": "app.get", - "content": "fastapi http app.get", - "start_line": 31, - "end_line": 34, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C3_ENTRYPOINTS", - "path": "src/app_runtime/control/http_app.py", - "title": "app.get", - "content": "fastapi http app.get", - "start_line": 38, - "end_line": 42, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "relations": [ - { - "path": "src/app_runtime/control/service.py", - "start_line": 14, - "end_line": 25, - "edge_type": "dataflow_slice", - "source": "ControlPlaneService.__init__", - "target": "ControlPlaneService.stop", - "metadata": { - "edge_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d", - "dst_ref": "ControlPlaneService.stop", - "resolution": "resolved", - "slice_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.stop" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - }, - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.stop" - }, - { - "path": "src/app_runtime/control/service.py", - "start_line": 14, - "end_line": 51, - "edge_type": "dataflow_slice", - "source": "ControlPlaneService.__init__", - "target": "ControlPlaneService._stop_async", - "metadata": { - "edge_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a", - "dst_ref": "ControlPlaneService._stop_async", - "resolution": "resolved", - "slice_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._stop_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - }, - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._stop_async" - }, - { - "path": "src/app_runtime/control/service.py", - "start_line": 14, - "end_line": 17, - "edge_type": "dataflow_slice", - "source": "ControlPlaneService.__init__", - "target": "ControlPlaneService.register_channel", - "metadata": { - "edge_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957", - "dst_ref": "ControlPlaneService.register_channel", - "resolution": "resolved", - "slice_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.register_channel" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - }, - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.register_channel" - }, - { - "path": "src/app_runtime/control/service.py", - "start_line": 14, - "end_line": 20, - "edge_type": "dataflow_slice", - "source": "ControlPlaneService.__init__", - "target": "ControlPlaneService.start", - "metadata": { - "edge_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154", - "dst_ref": "ControlPlaneService.start", - "resolution": "resolved", - "slice_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.start" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - }, - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.start" - }, - { - "path": "src/app_runtime/control/service.py", - "start_line": 14, - "end_line": 47, - "edge_type": "dataflow_slice", - "source": "ControlPlaneService.__init__", - "target": "ControlPlaneService._start_async", - "metadata": { - "edge_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517", - "dst_ref": "ControlPlaneService._start_async", - "resolution": "resolved", - "slice_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._start_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - }, - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._start_async" - }, - { - "path": "src/app_runtime/core/runtime.py", - "start_line": 32, - "end_line": 52, - "edge_type": "dataflow_slice", - "source": "RuntimeManager.__init__", - "target": "RuntimeManager.add_config_file", - "metadata": { - "edge_id": "a23b8a11ebdb12708b60c96ea12a69f7f042082f1adfddd572444e246d81d167", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "57ffbd4f0d9fdf3507c2b8624312ce211f3d02fdf86a57a8ec90778d8a7b498d", - "dst_ref": "RuntimeManager.add_config_file", - "resolution": "resolved", - "slice_id": "a23b8a11ebdb12708b60c96ea12a69f7f042082f1adfddd572444e246d81d167", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager.add_config_file" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "57ffbd4f0d9fdf3507c2b8624312ce211f3d02fdf86a57a8ec90778d8a7b498d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - }, - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager.add_config_file" - } - ], - "semantic_hints": [ - { - "path": "src/app_runtime/core/runtime.py", - "title": "RuntimeManager", - "symbol": "RuntimeManager", - "role": "pipeline_stage", - "confidence": 0.67, - "content": "RuntimeManager\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests manager\n- orchestrates role-like calls (4)\n- reads and writes state attributes\n- participates in dataflow slices (50)" - }, - { - "path": "src/app_runtime/control/base.py", - "title": "ControlChannel", - "symbol": "ControlChannel", - "role": "model", - "confidence": 0.99, - "content": "ControlChannel\nrole: model\n\nResponsibilities:\n- default model role" - }, - { - "path": "src/app_runtime/control/base.py", - "title": "ControlActionSet", - "symbol": "ControlActionSet", - "role": "model", - "confidence": 0.99, - "content": "ControlActionSet\nrole: model\n\nResponsibilities:\n- default model role" - }, - { - "path": "src/app_runtime/control/service.py", - "title": "ControlPlaneService", - "symbol": "ControlPlaneService", - "role": "pipeline_stage", - "confidence": 0.57, - "content": "ControlPlaneService\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests service\n- reads and writes state attributes\n- participates in dataflow slices (5)" - }, - { - "path": "src/app_runtime/control/http_runner.py", - "title": "UvicornThreadRunner", - "symbol": "UvicornThreadRunner", - "role": "pipeline_stage", - "confidence": 0.99, - "content": "UvicornThreadRunner\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (24)" - }, - { - "path": "src/app_runtime/control/http_channel.py", - "title": "HttpControlChannel", - "symbol": "HttpControlChannel", - "role": "pipeline_stage", - "confidence": 0.99, - "content": "HttpControlChannel\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (10)" - }, - { - "path": "src/app_runtime/control/http_app.py", - "title": "HttpControlAppFactory", - "symbol": "HttpControlAppFactory", - "role": "factory", - "confidence": 0.99, - "content": "HttpControlAppFactory\nrole: factory\n\nResponsibilities:\n- name suffix suggests factory" - }, - { - "path": "src/app_runtime/workflow/persistence/workflow_persistence.py", - "title": "WorkflowPersistence", - "symbol": "WorkflowPersistence", - "role": "pipeline_stage", - "confidence": 0.99, - "content": "WorkflowPersistence\nrole: pipeline_stage\n\nResponsibilities:\n- orchestrates role-like calls (2)\n- reads and writes state attributes\n- participates in dataflow slices (16)" - } - ], - "entrypoints": [ - { - "path": "src/app_runtime/control/http_app.py", - "title": "app.get", - "start_line": 31, - "end_line": 34, - "http_method": "GET", - "route_path": "/health", - "handler_symbol": "health", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "route_or_command": "app.get", - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "title": "app.get", - "start_line": 38, - "end_line": 42, - "http_method": "GET", - "route_path": "/actions/{action}", - "handler_symbol": "action", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "route_or_command": "app.get", - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "title": "app.post", - "start_line": 38, - "end_line": 42, - "http_method": "POST", - "route_path": "/actions/{action}", - "handler_symbol": "action", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "route_or_command": "app.post", - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "test_candidates": [], - "layer_outcomes": [ - { - "layer_id": "C1_SYMBOL_CATALOG", - "hit_count": 8, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C0_SOURCE_CHUNKS", - "hit_count": 8, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C4_SEMANTIC_ROLES", - "hit_count": 8, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C2_DEPENDENCY_GRAPH", - "hit_count": 6, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C3_ENTRYPOINTS", - "hit_count": 3, - "empty": false, - "fallback_used": false - } - ], - "missing_layers": [], - "raw_rows": [ - { - "path": "src/plba/bootstrap.py", - "content": "const RuntimeManager\nRuntimeManager = app_runtime.core.runtime.RuntimeManager", - "layer": "C1_SYMBOL_CATALOG", - "title": "RuntimeManager", - "span_start": 4, - "span_end": 4, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": null, - "metadata": { - "symbol_id": "27158ca220022eeb5083c6addf8a50775d45f7161284fd60aac48410105f4b98", - "qname": "RuntimeManager", - "kind": "const", - "signature": "RuntimeManager = app_runtime.core.runtime.RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "src.plba.bootstrap", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "const RuntimeManager\nRuntimeManager = app_runtime.core.runtime.RuntimeManager", - "layer": "C1_SYMBOL_CATALOG", - "title": "RuntimeManager", - "span_start": 9, - "span_end": 9, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": null, - "metadata": { - "symbol_id": "62a9575c77aad894120d18b4f2a08cf2ba42f77e9be4a8a432b767d157701afe", - "qname": "RuntimeManager", - "kind": "const", - "signature": "RuntimeManager = app_runtime.core.runtime.RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.control.service", - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "class RuntimeManager\nRuntimeManager", - "layer": "C1_SYMBOL_CATALOG", - "title": "RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": null, - "metadata": { - "symbol_id": "7e4a9381328c5803bbc6179458612fc4e947d928aa7bf8b4b2bebb2c8592f758", - "qname": "RuntimeManager", - "kind": "class", - "signature": "RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.core.runtime", - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/__init__.py", - "content": "const RuntimeManager\nRuntimeManager = plba.core.RuntimeManager", - "layer": "C1_SYMBOL_CATALOG", - "title": "RuntimeManager", - "span_start": 16, - "span_end": 16, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": null, - "metadata": { - "symbol_id": "7eacec84f9b8d6c4201374591faecdac7493091c263681495c338973f2971ad9", - "qname": "RuntimeManager", - "kind": "const", - "signature": "RuntimeManager = plba.core.RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "src.plba.__init__", - "is_test": false, - "blob_sha": "24e755ec8c249d14fb0e675b5dbf2b71ab91afb9c849897eebfa9feb2499e19d", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/core.py", - "content": "const RuntimeManager\nRuntimeManager = app_runtime.core.runtime.RuntimeManager", - "layer": "C1_SYMBOL_CATALOG", - "title": "RuntimeManager", - "span_start": 2, - "span_end": 2, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": null, - "metadata": { - "symbol_id": "e1684562d978b7af7fe9b27dc5869d770348a87b5dc19a50360f58544668578b", - "qname": "RuntimeManager", - "kind": "const", - "signature": "RuntimeManager = app_runtime.core.runtime.RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "src.plba.core", - "is_test": false, - "blob_sha": "c0ae25110d20e665216616e26b68adfe035b624ba45d31d1272fb21f906f9ca8", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/__init__.py", - "content": "const ControlPlaneService\nControlPlaneService = app_runtime.control.service.ControlPlaneService", - "layer": "C1_SYMBOL_CATALOG", - "title": "ControlPlaneService", - "span_start": 3, - "span_end": 3, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": null, - "metadata": { - "symbol_id": "217e8f044d1c01644bf7b81e5046af9e84469210c692a2fb0c476a19bb069ae1", - "qname": "ControlPlaneService", - "kind": "const", - "signature": "ControlPlaneService = app_runtime.control.service.ControlPlaneService", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.control.__init__", - "is_test": false, - "blob_sha": "bf3c37e3369a84cc618adc0fd71c232e5eb4b871eaff743069a17e661e498316", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "method ControlChannel.start\nstart(self, actions)\nStart the control channel and bind handlers.", - "layer": "C1_SYMBOL_CATALOG", - "title": "ControlChannel.start", - "span_start": 23, - "span_end": 24, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": null, - "metadata": { - "symbol_id": "e01e0d50d0f48d0c84c119c989b7a7c57ceea263811ce2605c684ae24d1a03b1", - "qname": "ControlChannel.start", - "kind": "method", - "signature": "start(self, actions)", - "parent_symbol_id": "ControlChannel", - "package_or_module": "src.app_runtime.control.base", - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "method ControlChannel.stop\nstop(self)\nStop the control channel and release resources.", - "layer": "C1_SYMBOL_CATALOG", - "title": "ControlChannel.stop", - "span_start": 27, - "span_end": 28, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": null, - "metadata": { - "symbol_id": "54b5adf9866c526836221dc721b474ba23fbec83e1b1d3b8bc4da67ae3c1541d", - "qname": "ControlChannel.stop", - "kind": "method", - "signature": "stop(self)", - "parent_symbol_id": "ControlChannel", - "package_or_module": "src.app_runtime.control.base", - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "class ControlPlaneService:\n def __init__(self) -> None:\n self._channels: list[ControlChannel] = []\n\n def register_channel(self, channel: ControlChannel) -> None:\n self._channels.append(channel)\n\n def start(self, runtime: RuntimeManager) -> None:\n if not self._channels:\n return\n asyncio.run(self._start_async(runtime))\n\n def stop(self) -> None:\n if not self._channels:\n return\n asyncio.run(self._stop_async())\n\n def snapshot(self, runtime: RuntimeManager) -> dict[str, object]:\n health = runtime.current_health()\n return {\n \"runtime\": {\"state\": runtime._state.value},\n \"modules\": list(runtime.registry.modules),\n \"services\": runtime.services.snapshot(),\n \"workers\": runtime.workers.snapshot(),\n \"health\": runtime.health.snapshot(runtime.workers.healths()) | {\"status\": health[\"status\"]},\n \"config\": runtime.configuration.get(),\n }\n\n async def _start_async(self, runtime: RuntimeManager) -> None:\n actions = ControlActionSet(\n health=runtime.health_status,\n start=runtime.start_runtime,\n stop=runtime.stop_runtime,\n status=runtime.runtime_status,\n )\n for channel in self._channels:\n await channel.start(actions)\n\n async def _stop_async(self) -> None:\n for channel in reversed(self._channels):\n await channel.stop()", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/service.py:ControlPlaneService", - "span_start": 12, - "span_end": 52, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": null, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.service", - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_runner.py", - "content": "class UvicornThreadRunner:\n def __init__(self, host: str, port: int, timeout: int) -> None:\n self._host = host\n self._port = port\n self._timeout = timeout\n self._server: Server | None = None\n self._thread: Thread | None = None\n self._error: BaseException | None = None\n\n async def start(self, app: FastAPI) -> None:\n if self._thread is not None and self._thread.is_alive():\n return\n self._error = None\n config = Config(app=app, host=self._host, port=self._port, log_level=\"warning\")\n self._server = Server(config)\n self._thread = Thread(target=self._serve, name=\"plba-http-control\", daemon=True)\n self._thread.start()\n await self._wait_until_started()\n\n async def stop(self) -> None:\n if self._server is None or self._thread is None:\n return\n self._server.should_exit = True\n await asyncio.to_thread(self._thread.join, self._timeout)\n self._server = None\n self._thread = None\n\n @property\n def port(self) -> int:\n if self._server is None or not getattr(self._server, \"servers\", None):\n return self._port\n socket = self._server.servers[0].sockets[0]\n return int(socket.getsockname()[1])\n\n async def _wait_until_started(self) -> None:\n if self._server is None:\n raise RuntimeError(\"Server is not initialized\")\n deadline = asyncio.get_running_loop().time() + max(float(self._timeout), 1.0)\n while not self._server.started:\n if self._error is not None:\n raise RuntimeError(\"HTTP control server failed to start\") from self._error\n if asyncio.get_running_loop().time() >= deadline:\n raise TimeoutError(\"HTTP control server startup timed out\")\n await asyncio.sleep(0.05)\n\n def _serve(self) -> None:\n if self._server is None:\n return\n try:\n asyncio.run(self._server.serve())\n except BaseException as exc: # noqa: BLE001\n self._error = exc", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/http_runner.py:UvicornThreadRunner", - "span_start": 10, - "span_end": 61, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": null, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.http_runner", - "is_test": false, - "blob_sha": "3779fdd2878b770e789a35bb2a89c9d79f13b61c26d7db1b3b683f9bb9e1623f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "class ControlChannel(ABC):\n @abstractmethod\n async def start(self, actions: ControlActionSet) -> None:\n \"\"\"Start the control channel and bind handlers.\"\"\"\n\n @abstractmethod\n async def stop(self) -> None:\n \"\"\"Stop the control channel and release resources.\"\"\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/base.py:ControlChannel", - "span_start": 21, - "span_end": 28, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": null, - "metadata": { - "chunk_index": 1, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.base", - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/__init__.py", - "content": "from app_runtime.control.base import ControlActionSet, ControlChannel\nfrom app_runtime.control.http_channel import HttpControlChannel\nfrom app_runtime.control.service import ControlPlaneService\n\n__all__ = [\"ControlActionSet\", \"ControlChannel\", \"ControlPlaneService\", \"HttpControlChannel\"]", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/__init__.py:1-5", - "span_start": 1, - "span_end": 5, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": null, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.app_runtime.control.__init__", - "is_test": false, - "blob_sha": "bf3c37e3369a84cc618adc0fd71c232e5eb4b871eaff743069a17e661e498316", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "class HttpControlAppFactory:\n def create(\n self,\n health_provider: Callable[[], Awaitable[HealthPayload]],\n action_provider: Callable[[str, str], Awaitable[JSONResponse]],\n ) -> FastAPI:\n app = FastAPI(title=\"PLBA Control API\")\n\n @app.middleware(\"http\")\n async def log_api_call(request: Request, call_next): # type: ignore[no-untyped-def]\n started = time.monotonic()\n response = await call_next(request)\n response.headers[\"X-Response-Time-Ms\"] = str(int((time.monotonic() - started) * 1000))\n return response\n\n @app.get(\"/health\")\n async def health() -> JSONResponse:\n payload = await health_provider()\n status_code = 200 if payload.get(\"status\") == \"ok\" else 503\n return JSONResponse(content=payload, status_code=status_code)\n\n @app.get(\"/actions/{action}\")\n @app.post(\"/actions/{action}\")\n async def action(action: str, request: Request) -> JSONResponse:\n client_source = self._client_source(request)\n if action in {\"start\", \"stop\"}:\n LOGGER.warning(\"Control action requested: /actions/%s client=%s\", action, client_source)\n return await action_provider(action, client_source)\n\n return app\n\n def _client_source(self, request: Request) -> str:\n explicit_header = request.headers.get(\"X-Client-Source\", \"\").strip()\n if explicit_header:\n return explicit_header\n user_agent = request.headers.get(\"User-Agent\", \"\").strip()\n if user_agent:\n return f\"user-agent:{user_agent}\"\n return \"unknown\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/http_app.py:HttpControlAppFactory", - "span_start": 15, - "span_end": 53, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": null, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.http_app", - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "class HttpControlChannel(ControlChannel):\n def __init__(self, host: str, port: int, timeout: int) -> None:\n self._timeout = timeout\n self._runner = UvicornThreadRunner(host, port, timeout)\n self._factory = HttpControlAppFactory()\n self._actions: ControlActionSet | None = None\n\n async def start(self, actions: ControlActionSet) -> None:\n self._actions = actions\n app = self._factory.create(self._health_response, self._action_response)\n await self._runner.start(app)\n\n async def stop(self) -> None:\n await self._runner.stop()\n\n @property\n def port(self) -> int:\n return self._runner.port\n\n async def _health_response(self) -> dict[str, object]:\n if self._actions is None:\n return {\"status\": \"unhealthy\", \"detail\": \"control actions are not configured\"}\n return await asyncio.wait_for(self._actions.health(), timeout=float(self._timeout))\n\n async def _action_response(self, action: str, _client_source: str = \"unknown\") -> JSONResponse:\n if self._actions is None:\n return JSONResponse(content={\"status\": \"error\", \"detail\": f\"{action} handler is not configured\"}, status_code=404)\n callbacks = {\n \"start\": self._actions.start,\n \"stop\": self._actions.stop,\n \"status\": self._actions.status,\n }\n callback = callbacks.get(action)\n if callback is None:\n return JSONResponse(content={\"status\": \"error\", \"detail\": f\"unsupported action: {action}\"}, status_code=404)\n action_timeout = max(float(self._timeout), 10.0) if action in {\"start\", \"stop\"} else float(self._timeout)\n try:\n detail = await asyncio.wait_for(callback(), timeout=action_timeout)\n except asyncio.TimeoutError:\n return JSONResponse(\n content={\"status\": \"accepted\", \"detail\": f\"{action} operation is still in progress\"},\n status_code=202,\n )\n except Exception as exc:\n return JSONResponse(content={\"status\": \"error\", \"detail\": str(exc)}, status_code=500)\n return JSONResponse(content={\"status\": \"ok\", \"detail\": detail or f\"{action} action accepted\"}, status_code=200)", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/http_channel.py:HttpControlChannel", - "span_start": 12, - "span_end": 57, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": null, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.http_channel", - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "class ControlActionSet:\n health: HealthHandler\n start: ActionHandler\n stop: ActionHandler\n status: ActionHandler", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/base.py:ControlActionSet", - "span_start": 14, - "span_end": 18, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": null, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.base", - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/control.py", - "content": "from app_runtime.control.base import ControlActionSet, ControlChannel\nfrom app_runtime.control.http_channel import HttpControlChannel\nfrom app_runtime.control.service import ControlPlaneService\n\n__all__ = [\n \"ControlActionSet\",\n \"ControlChannel\",\n \"ControlPlaneService\",\n \"HttpControlChannel\",\n]", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/plba/control.py:1-10", - "span_start": 1, - "span_end": 10, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": null, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.plba.control", - "is_test": false, - "blob_sha": "31bd5c4481bfa7fbca8fae56d4860a67e3953ca74474ac8439e1f39b685d7bc8", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests manager\n- orchestrates role-like calls (4)\n- reads and writes state attributes\n- participates in dataflow slices (50)", - "layer": "C4_SEMANTIC_ROLES", - "title": "RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 43, - "layer_rank": 2, - "distance": null, - "metadata": { - "symbol_id": "7e4a9381328c5803bbc6179458612fc4e947d928aa7bf8b4b2bebb2c8592f758", - "symbol_name": "RuntimeManager", - "qname": "RuntimeManager", - "role": "pipeline_stage", - "confidence": 0.67, - "dataflow_participation": 50, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "ControlChannel\nrole: model\n\nResponsibilities:\n- default model role", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlChannel", - "span_start": 21, - "span_end": 28, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 40, - "layer_rank": 2, - "distance": null, - "metadata": { - "symbol_id": "cfcfe9a311d3a2dbdaf32ac4ccd73c0eb9a117f830591a1c0867ee97d46204ff", - "symbol_name": "ControlChannel", - "qname": "ControlChannel", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "ControlActionSet\nrole: model\n\nResponsibilities:\n- default model role", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlActionSet", - "span_start": 14, - "span_end": 18, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 40, - "layer_rank": 2, - "distance": null, - "metadata": { - "symbol_id": "46eb026cb3313415ec47b82dd22f84f4d112c9d987e8b1716dcb0baa1cce8988", - "symbol_name": "ControlActionSet", - "qname": "ControlActionSet", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests service\n- reads and writes state attributes\n- participates in dataflow slices (5)", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlPlaneService", - "span_start": 12, - "span_end": 52, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 68, - "layer_rank": 2, - "distance": null, - "metadata": { - "symbol_id": "b13471e5916986dccffb53fab613812842965705e6b3a89ae549d30c9e91e9aa", - "symbol_name": "ControlPlaneService", - "qname": "ControlPlaneService", - "role": "pipeline_stage", - "confidence": 0.57, - "dataflow_participation": 5, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_runner.py", - "content": "UvicornThreadRunner\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (24)", - "layer": "C4_SEMANTIC_ROLES", - "title": "UvicornThreadRunner", - "span_start": 10, - "span_end": 61, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 11, - "layer_rank": 2, - "distance": null, - "metadata": { - "symbol_id": "fd55630045a02100df8877ac27d951ee08617d4598764394d48cb51fe067476a", - "symbol_name": "UvicornThreadRunner", - "qname": "UvicornThreadRunner", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 24, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "3779fdd2878b770e789a35bb2a89c9d79f13b61c26d7db1b3b683f9bb9e1623f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (10)", - "layer": "C4_SEMANTIC_ROLES", - "title": "HttpControlChannel", - "span_start": 12, - "span_end": 57, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 21, - "layer_rank": 2, - "distance": null, - "metadata": { - "symbol_id": "1c9fbdc24819e5604c26ea55428a74310f03a03e1af197ed84846af61e42fdb0", - "symbol_name": "HttpControlChannel", - "qname": "HttpControlChannel", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 10, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "HttpControlAppFactory\nrole: factory\n\nResponsibilities:\n- name suffix suggests factory", - "layer": "C4_SEMANTIC_ROLES", - "title": "HttpControlAppFactory", - "span_start": 15, - "span_end": 53, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 39, - "layer_rank": 2, - "distance": null, - "metadata": { - "symbol_id": "9b3502a5fb408b273223db13264349cf500de24915b6c649d9ea8970d0dfd8e0", - "symbol_name": "HttpControlAppFactory", - "qname": "HttpControlAppFactory", - "role": "factory", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/persistence/workflow_persistence.py", - "content": "WorkflowPersistence\nrole: pipeline_stage\n\nResponsibilities:\n- orchestrates role-like calls (2)\n- reads and writes state attributes\n- participates in dataflow slices (16)", - "layer": "C4_SEMANTIC_ROLES", - "title": "WorkflowPersistence", - "span_start": 8, - "span_end": 54, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 15, - "layer_rank": 2, - "distance": null, - "metadata": { - "symbol_id": "7bd01ee45cf31f2d5c2e3e51656254860ac785d10cef9e0852cd4fba90857bae", - "symbol_name": "WorkflowPersistence", - "qname": "WorkflowPersistence", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 16, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "80e9410ddc639789b4353c2a1a757ba8d0d5b5bb6075b0b263b61551f04ae1f0", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.stop", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 25, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": null, - "metadata": { - "edge_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d", - "dst_ref": "ControlPlaneService.stop", - "resolution": "resolved", - "slice_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.stop" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._stop_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 51, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": null, - "metadata": { - "edge_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a", - "dst_ref": "ControlPlaneService._stop_async", - "resolution": "resolved", - "slice_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._stop_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.register_channel", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 17, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": null, - "metadata": { - "edge_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957", - "dst_ref": "ControlPlaneService.register_channel", - "resolution": "resolved", - "slice_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.register_channel" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.start", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 20, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": null, - "metadata": { - "edge_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154", - "dst_ref": "ControlPlaneService.start", - "resolution": "resolved", - "slice_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.start" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._start_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 47, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": null, - "metadata": { - "edge_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517", - "dst_ref": "ControlPlaneService._start_async", - "resolution": "resolved", - "slice_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._start_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager.add_config_file", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 32, - "span_end": 52, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": null, - "metadata": { - "edge_id": "a23b8a11ebdb12708b60c96ea12a69f7f042082f1adfddd572444e246d81d167", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "57ffbd4f0d9fdf3507c2b8624312ce211f3d02fdf86a57a8ec90778d8a7b498d", - "dst_ref": "RuntimeManager.add_config_file", - "resolution": "resolved", - "slice_id": "a23b8a11ebdb12708b60c96ea12a69f7f042082f1adfddd572444e246d81d167", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager.add_config_file" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "57ffbd4f0d9fdf3507c2b8624312ce211f3d02fdf86a57a8ec90778d8a7b498d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": null, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": null, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": null, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "retrieval_report": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "vector", - "C0_SOURCE_CHUNKS": "vector", - "C4_SEMANTIC_ROLES": "vector", - "C2_DEPENDENCY_GRAPH": "vector", - "C3_ENTRYPOINTS": "vector" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 8, - "C4_SEMANTIC_ROLES": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C3_ENTRYPOINTS": 6 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [] - }, - "C4_SEMANTIC_ROLES": { - "path_scope": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [] - } - }, - "fallback": { - "used": false, - "reason": null - }, - "retrieval_by_layer_ms": { - "C1_SYMBOL_CATALOG": 494, - "C0_SOURCE_CHUNKS": 17, - "C4_SEMANTIC_ROLES": 14, - "C2_DEPENDENCY_GRAPH": 55, - "C3_ENTRYPOINTS": 14 - } - } - }, - "diagnostics": { - "intent_correct": null, - "target_found": true, - "layers_used": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_sufficient": true, - "answer_mode": "degraded", - "resolved_target": "RuntimeManager", - "answer_policy_branch": "normal_answer", - "decision_reason": "evidence_sufficient", - "router_result": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "retrieval_profile": "code", - "sub_intent": "EXPLAIN", - "path_scope": [], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "symbol_resolution_status": "resolved" - }, - "retrieval_request": { - "rag_session_id": "7d11da21-faa0-4cea-aede-aeabe069164c", - "query": "Объясни как работает класс RuntimeManager", - "sub_intent": "EXPLAIN", - "path_scope": [], - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "per_layer_outcome": [ - { - "layer_id": "C1_SYMBOL_CATALOG", - "hit_count": 8, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C0_SOURCE_CHUNKS", - "hit_count": 8, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C4_SEMANTIC_ROLES", - "hit_count": 8, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C2_DEPENDENCY_GRAPH", - "hit_count": 6, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C3_ENTRYPOINTS", - "hit_count": 3, - "empty": false, - "fallback_used": false - } - ], - "empty_layers": [], - "evidence_gate_decision": { - "sufficient": true, - "failure_reasons": [], - "evidence_count": 33 - }, - "evidence_gate_input": { - "resolved_target": "RuntimeManager", - "sub_intent": "EXPLAIN", - "target_type": "symbol", - "evidence_count": 33, - "code_chunk_count": 33, - "entrypoint_count": 3, - "relation_count": 6, - "test_evidence_count": 0, - "symbol_resolution_status": "resolved", - "path_scope": [] - }, - "post_evidence_gate": { - "input": { - "answer_mode": "normal", - "degraded_message": "", - "resolved_target": "RuntimeManager", - "draft_answer_preview": "Класс `RuntimeManager` определён в файле `src/app_runtime/core/runtime.py`. Он является основным компонентом для управления жизненным циклом приложения и конфигурациями.\n\nМетоды:\n- Конструктор `__init__`: инициализирует объект RuntimeManager и принимает конфигурацию.\n- `add_config_file`: добавляет ф", - "repair_candidate": true - }, - "output": { - "passed": false, - "action": "repair", - "reasons": [ - "missing_concrete_methods" - ], - "repair_used": true, - "final_answer_preview": "Недостаточно подтверждённых данных для уверенного ответа по RuntimeManager." - } - }, - "failure_reasons": [], - "timings_ms": { - "router": 2, - "retrieval": 597, - "pre_evidence_gate": 1, - "llm": 5865, - "post_evidence_gate": 2, - "repair": 4529, - "post_evidence_gate_recheck": 2 - } - }, - "rag_rows": [ - { - "path": "src/plba/bootstrap.py", - "content": "const RuntimeManager\nRuntimeManager = app_runtime.core.runtime.RuntimeManager", - "layer": "C1_SYMBOL_CATALOG", - "title": "RuntimeManager", - "span_start": 4, - "span_end": 4, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "27158ca220022eeb5083c6addf8a50775d45f7161284fd60aac48410105f4b98", - "qname": "RuntimeManager", - "kind": "const", - "signature": "RuntimeManager = app_runtime.core.runtime.RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "src.plba.bootstrap", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "const RuntimeManager\nRuntimeManager = app_runtime.core.runtime.RuntimeManager", - "layer": "C1_SYMBOL_CATALOG", - "title": "RuntimeManager", - "span_start": 9, - "span_end": 9, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "62a9575c77aad894120d18b4f2a08cf2ba42f77e9be4a8a432b767d157701afe", - "qname": "RuntimeManager", - "kind": "const", - "signature": "RuntimeManager = app_runtime.core.runtime.RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.control.service", - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "class RuntimeManager\nRuntimeManager", - "layer": "C1_SYMBOL_CATALOG", - "title": "RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "7e4a9381328c5803bbc6179458612fc4e947d928aa7bf8b4b2bebb2c8592f758", - "qname": "RuntimeManager", - "kind": "class", - "signature": "RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.core.runtime", - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/__init__.py", - "content": "const RuntimeManager\nRuntimeManager = plba.core.RuntimeManager", - "layer": "C1_SYMBOL_CATALOG", - "title": "RuntimeManager", - "span_start": 16, - "span_end": 16, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "7eacec84f9b8d6c4201374591faecdac7493091c263681495c338973f2971ad9", - "qname": "RuntimeManager", - "kind": "const", - "signature": "RuntimeManager = plba.core.RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "src.plba.__init__", - "is_test": false, - "blob_sha": "24e755ec8c249d14fb0e675b5dbf2b71ab91afb9c849897eebfa9feb2499e19d", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/core.py", - "content": "const RuntimeManager\nRuntimeManager = app_runtime.core.runtime.RuntimeManager", - "layer": "C1_SYMBOL_CATALOG", - "title": "RuntimeManager", - "span_start": 2, - "span_end": 2, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "e1684562d978b7af7fe9b27dc5869d770348a87b5dc19a50360f58544668578b", - "qname": "RuntimeManager", - "kind": "const", - "signature": "RuntimeManager = app_runtime.core.runtime.RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "src.plba.core", - "is_test": false, - "blob_sha": "c0ae25110d20e665216616e26b68adfe035b624ba45d31d1272fb21f906f9ca8", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/__init__.py", - "content": "const ControlPlaneService\nControlPlaneService = app_runtime.control.service.ControlPlaneService", - "layer": "C1_SYMBOL_CATALOG", - "title": "ControlPlaneService", - "span_start": 3, - "span_end": 3, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "217e8f044d1c01644bf7b81e5046af9e84469210c692a2fb0c476a19bb069ae1", - "qname": "ControlPlaneService", - "kind": "const", - "signature": "ControlPlaneService = app_runtime.control.service.ControlPlaneService", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.control.__init__", - "is_test": false, - "blob_sha": "bf3c37e3369a84cc618adc0fd71c232e5eb4b871eaff743069a17e661e498316", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "method ControlChannel.start\nstart(self, actions)\nStart the control channel and bind handlers.", - "layer": "C1_SYMBOL_CATALOG", - "title": "ControlChannel.start", - "span_start": 23, - "span_end": 24, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "e01e0d50d0f48d0c84c119c989b7a7c57ceea263811ce2605c684ae24d1a03b1", - "qname": "ControlChannel.start", - "kind": "method", - "signature": "start(self, actions)", - "parent_symbol_id": "ControlChannel", - "package_or_module": "src.app_runtime.control.base", - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "method ControlChannel.stop\nstop(self)\nStop the control channel and release resources.", - "layer": "C1_SYMBOL_CATALOG", - "title": "ControlChannel.stop", - "span_start": 27, - "span_end": 28, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "54b5adf9866c526836221dc721b474ba23fbec83e1b1d3b8bc4da67ae3c1541d", - "qname": "ControlChannel.stop", - "kind": "method", - "signature": "stop(self)", - "parent_symbol_id": "ControlChannel", - "package_or_module": "src.app_runtime.control.base", - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "class ControlPlaneService:\n def __init__(self) -> None:\n self._channels: list[ControlChannel] = []\n\n def register_channel(self, channel: ControlChannel) -> None:\n self._channels.append(channel)\n\n def start(self, runtime: RuntimeManager) -> None:\n if not self._channels:\n return\n asyncio.run(self._start_async(runtime))\n\n def stop(self) -> None:\n if not self._channels:\n return\n asyncio.run(self._stop_async())\n\n def snapshot(self, runtime: RuntimeManager) -> dict[str, object]:\n health = runtime.current_health()\n return {\n \"runtime\": {\"state\": runtime._state.value},\n \"modules\": list(runtime.registry.modules),\n \"services\": runtime.services.snapshot(),\n \"workers\": runtime.workers.snapshot(),\n \"health\": runtime.health.snapshot(runtime.workers.healths()) | {\"status\": health[\"status\"]},\n \"config\": runtime.configuration.get(),\n }\n\n async def _start_async(self, runtime: RuntimeManager) -> None:\n actions = ControlActionSet(\n health=runtime.health_status,\n start=runtime.start_runtime,\n stop=runtime.stop_runtime,\n status=runtime.runtime_status,\n )\n for channel in self._channels:\n await channel.start(actions)\n\n async def _stop_async(self) -> None:\n for channel in reversed(self._channels):\n await channel.stop()", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/service.py:ControlPlaneService", - "span_start": 12, - "span_end": 52, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.service", - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_runner.py", - "content": "class UvicornThreadRunner:\n def __init__(self, host: str, port: int, timeout: int) -> None:\n self._host = host\n self._port = port\n self._timeout = timeout\n self._server: Server | None = None\n self._thread: Thread | None = None\n self._error: BaseException | None = None\n\n async def start(self, app: FastAPI) -> None:\n if self._thread is not None and self._thread.is_alive():\n return\n self._error = None\n config = Config(app=app, host=self._host, port=self._port, log_level=\"warning\")\n self._server = Server(config)\n self._thread = Thread(target=self._serve, name=\"plba-http-control\", daemon=True)\n self._thread.start()\n await self._wait_until_started()\n\n async def stop(self) -> None:\n if self._server is None or self._thread is None:\n return\n self._server.should_exit = True\n await asyncio.to_thread(self._thread.join, self._timeout)\n self._server = None\n self._thread = None\n\n @property\n def port(self) -> int:\n if self._server is None or not getattr(self._server, \"servers\", None):\n return self._port\n socket = self._server.servers[0].sockets[0]\n return int(socket.getsockname()[1])\n\n async def _wait_until_started(self) -> None:\n if self._server is None:\n raise RuntimeError(\"Server is not initialized\")\n deadline = asyncio.get_running_loop().time() + max(float(self._timeout), 1.0)\n while not self._server.started:\n if self._error is not None:\n raise RuntimeError(\"HTTP control server failed to start\") from self._error\n if asyncio.get_running_loop().time() >= deadline:\n raise TimeoutError(\"HTTP control server startup timed out\")\n await asyncio.sleep(0.05)\n\n def _serve(self) -> None:\n if self._server is None:\n return\n try:\n asyncio.run(self._server.serve())\n except BaseException as exc: # noqa: BLE001\n self._error = exc", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/http_runner.py:UvicornThreadRunner", - "span_start": 10, - "span_end": 61, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.http_runner", - "is_test": false, - "blob_sha": "3779fdd2878b770e789a35bb2a89c9d79f13b61c26d7db1b3b683f9bb9e1623f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "class ControlChannel(ABC):\n @abstractmethod\n async def start(self, actions: ControlActionSet) -> None:\n \"\"\"Start the control channel and bind handlers.\"\"\"\n\n @abstractmethod\n async def stop(self) -> None:\n \"\"\"Stop the control channel and release resources.\"\"\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/base.py:ControlChannel", - "span_start": 21, - "span_end": 28, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 1, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.base", - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/__init__.py", - "content": "from app_runtime.control.base import ControlActionSet, ControlChannel\nfrom app_runtime.control.http_channel import HttpControlChannel\nfrom app_runtime.control.service import ControlPlaneService\n\n__all__ = [\"ControlActionSet\", \"ControlChannel\", \"ControlPlaneService\", \"HttpControlChannel\"]", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/__init__.py:1-5", - "span_start": 1, - "span_end": 5, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.app_runtime.control.__init__", - "is_test": false, - "blob_sha": "bf3c37e3369a84cc618adc0fd71c232e5eb4b871eaff743069a17e661e498316", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "class HttpControlAppFactory:\n def create(\n self,\n health_provider: Callable[[], Awaitable[HealthPayload]],\n action_provider: Callable[[str, str], Awaitable[JSONResponse]],\n ) -> FastAPI:\n app = FastAPI(title=\"PLBA Control API\")\n\n @app.middleware(\"http\")\n async def log_api_call(request: Request, call_next): # type: ignore[no-untyped-def]\n started = time.monotonic()\n response = await call_next(request)\n response.headers[\"X-Response-Time-Ms\"] = str(int((time.monotonic() - started) * 1000))\n return response\n\n @app.get(\"/health\")\n async def health() -> JSONResponse:\n payload = await health_provider()\n status_code = 200 if payload.get(\"status\") == \"ok\" else 503\n return JSONResponse(content=payload, status_code=status_code)\n\n @app.get(\"/actions/{action}\")\n @app.post(\"/actions/{action}\")\n async def action(action: str, request: Request) -> JSONResponse:\n client_source = self._client_source(request)\n if action in {\"start\", \"stop\"}:\n LOGGER.warning(\"Control action requested: /actions/%s client=%s\", action, client_source)\n return await action_provider(action, client_source)\n\n return app\n\n def _client_source(self, request: Request) -> str:\n explicit_header = request.headers.get(\"X-Client-Source\", \"\").strip()\n if explicit_header:\n return explicit_header\n user_agent = request.headers.get(\"User-Agent\", \"\").strip()\n if user_agent:\n return f\"user-agent:{user_agent}\"\n return \"unknown\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/http_app.py:HttpControlAppFactory", - "span_start": 15, - "span_end": 53, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.http_app", - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "class HttpControlChannel(ControlChannel):\n def __init__(self, host: str, port: int, timeout: int) -> None:\n self._timeout = timeout\n self._runner = UvicornThreadRunner(host, port, timeout)\n self._factory = HttpControlAppFactory()\n self._actions: ControlActionSet | None = None\n\n async def start(self, actions: ControlActionSet) -> None:\n self._actions = actions\n app = self._factory.create(self._health_response, self._action_response)\n await self._runner.start(app)\n\n async def stop(self) -> None:\n await self._runner.stop()\n\n @property\n def port(self) -> int:\n return self._runner.port\n\n async def _health_response(self) -> dict[str, object]:\n if self._actions is None:\n return {\"status\": \"unhealthy\", \"detail\": \"control actions are not configured\"}\n return await asyncio.wait_for(self._actions.health(), timeout=float(self._timeout))\n\n async def _action_response(self, action: str, _client_source: str = \"unknown\") -> JSONResponse:\n if self._actions is None:\n return JSONResponse(content={\"status\": \"error\", \"detail\": f\"{action} handler is not configured\"}, status_code=404)\n callbacks = {\n \"start\": self._actions.start,\n \"stop\": self._actions.stop,\n \"status\": self._actions.status,\n }\n callback = callbacks.get(action)\n if callback is None:\n return JSONResponse(content={\"status\": \"error\", \"detail\": f\"unsupported action: {action}\"}, status_code=404)\n action_timeout = max(float(self._timeout), 10.0) if action in {\"start\", \"stop\"} else float(self._timeout)\n try:\n detail = await asyncio.wait_for(callback(), timeout=action_timeout)\n except asyncio.TimeoutError:\n return JSONResponse(\n content={\"status\": \"accepted\", \"detail\": f\"{action} operation is still in progress\"},\n status_code=202,\n )\n except Exception as exc:\n return JSONResponse(content={\"status\": \"error\", \"detail\": str(exc)}, status_code=500)\n return JSONResponse(content={\"status\": \"ok\", \"detail\": detail or f\"{action} action accepted\"}, status_code=200)", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/http_channel.py:HttpControlChannel", - "span_start": 12, - "span_end": 57, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.http_channel", - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "class ControlActionSet:\n health: HealthHandler\n start: ActionHandler\n stop: ActionHandler\n status: ActionHandler", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/base.py:ControlActionSet", - "span_start": 14, - "span_end": 18, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.base", - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/control.py", - "content": "from app_runtime.control.base import ControlActionSet, ControlChannel\nfrom app_runtime.control.http_channel import HttpControlChannel\nfrom app_runtime.control.service import ControlPlaneService\n\n__all__ = [\n \"ControlActionSet\",\n \"ControlChannel\",\n \"ControlPlaneService\",\n \"HttpControlChannel\",\n]", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/plba/control.py:1-10", - "span_start": 1, - "span_end": 10, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.plba.control", - "is_test": false, - "blob_sha": "31bd5c4481bfa7fbca8fae56d4860a67e3953ca74474ac8439e1f39b685d7bc8", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests manager\n- orchestrates role-like calls (4)\n- reads and writes state attributes\n- participates in dataflow slices (50)", - "layer": "C4_SEMANTIC_ROLES", - "title": "RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 43, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "7e4a9381328c5803bbc6179458612fc4e947d928aa7bf8b4b2bebb2c8592f758", - "symbol_name": "RuntimeManager", - "qname": "RuntimeManager", - "role": "pipeline_stage", - "confidence": 0.67, - "dataflow_participation": 50, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "ControlChannel\nrole: model\n\nResponsibilities:\n- default model role", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlChannel", - "span_start": 21, - "span_end": 28, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 40, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "cfcfe9a311d3a2dbdaf32ac4ccd73c0eb9a117f830591a1c0867ee97d46204ff", - "symbol_name": "ControlChannel", - "qname": "ControlChannel", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "ControlActionSet\nrole: model\n\nResponsibilities:\n- default model role", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlActionSet", - "span_start": 14, - "span_end": 18, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 40, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "46eb026cb3313415ec47b82dd22f84f4d112c9d987e8b1716dcb0baa1cce8988", - "symbol_name": "ControlActionSet", - "qname": "ControlActionSet", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests service\n- reads and writes state attributes\n- participates in dataflow slices (5)", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlPlaneService", - "span_start": 12, - "span_end": 52, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 68, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "b13471e5916986dccffb53fab613812842965705e6b3a89ae549d30c9e91e9aa", - "symbol_name": "ControlPlaneService", - "qname": "ControlPlaneService", - "role": "pipeline_stage", - "confidence": 0.57, - "dataflow_participation": 5, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_runner.py", - "content": "UvicornThreadRunner\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (24)", - "layer": "C4_SEMANTIC_ROLES", - "title": "UvicornThreadRunner", - "span_start": 10, - "span_end": 61, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 11, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "fd55630045a02100df8877ac27d951ee08617d4598764394d48cb51fe067476a", - "symbol_name": "UvicornThreadRunner", - "qname": "UvicornThreadRunner", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 24, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "3779fdd2878b770e789a35bb2a89c9d79f13b61c26d7db1b3b683f9bb9e1623f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (10)", - "layer": "C4_SEMANTIC_ROLES", - "title": "HttpControlChannel", - "span_start": 12, - "span_end": 57, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 21, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "1c9fbdc24819e5604c26ea55428a74310f03a03e1af197ed84846af61e42fdb0", - "symbol_name": "HttpControlChannel", - "qname": "HttpControlChannel", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 10, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "HttpControlAppFactory\nrole: factory\n\nResponsibilities:\n- name suffix suggests factory", - "layer": "C4_SEMANTIC_ROLES", - "title": "HttpControlAppFactory", - "span_start": 15, - "span_end": 53, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 39, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "9b3502a5fb408b273223db13264349cf500de24915b6c649d9ea8970d0dfd8e0", - "symbol_name": "HttpControlAppFactory", - "qname": "HttpControlAppFactory", - "role": "factory", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/persistence/workflow_persistence.py", - "content": "WorkflowPersistence\nrole: pipeline_stage\n\nResponsibilities:\n- orchestrates role-like calls (2)\n- reads and writes state attributes\n- participates in dataflow slices (16)", - "layer": "C4_SEMANTIC_ROLES", - "title": "WorkflowPersistence", - "span_start": 8, - "span_end": 54, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 15, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "7bd01ee45cf31f2d5c2e3e51656254860ac785d10cef9e0852cd4fba90857bae", - "symbol_name": "WorkflowPersistence", - "qname": "WorkflowPersistence", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 16, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "80e9410ddc639789b4353c2a1a757ba8d0d5b5bb6075b0b263b61551f04ae1f0", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.stop", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 25, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d", - "dst_ref": "ControlPlaneService.stop", - "resolution": "resolved", - "slice_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.stop" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._stop_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 51, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a", - "dst_ref": "ControlPlaneService._stop_async", - "resolution": "resolved", - "slice_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._stop_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.register_channel", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 17, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957", - "dst_ref": "ControlPlaneService.register_channel", - "resolution": "resolved", - "slice_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.register_channel" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.start", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 20, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154", - "dst_ref": "ControlPlaneService.start", - "resolution": "resolved", - "slice_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.start" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._start_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 47, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517", - "dst_ref": "ControlPlaneService._start_async", - "resolution": "resolved", - "slice_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._start_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager.add_config_file", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 32, - "span_end": 52, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "a23b8a11ebdb12708b60c96ea12a69f7f042082f1adfddd572444e246d81d167", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "57ffbd4f0d9fdf3507c2b8624312ce211f3d02fdf86a57a8ec90778d8a7b498d", - "dst_ref": "RuntimeManager.add_config_file", - "resolution": "resolved", - "slice_id": "a23b8a11ebdb12708b60c96ea12a69f7f042082f1adfddd572444e246d81d167", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager.add_config_file" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "57ffbd4f0d9fdf3507c2b8624312ce211f3d02fdf86a57a8ec90778d8a7b498d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "validation": { - "passed": false, - "action": "repair", - "reasons": [ - "missing_concrete_methods" - ] - }, - "token_usage": { - "prompt_name": "code_qa_explain_answer", - "tokens_in_estimate": 4504 - }, - "steps": [ - { - "step": "router", - "status": "completed", - "timings_ms": { - "router": 2 - }, - "output": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - } - }, - { - "step": "retrieval", - "status": "completed", - "timings_ms": { - "retrieval": 597 - }, - "output": { - "rag_count": 33, - "answer_path_rag_count": 33, - "resolved_symbol_status": "resolved", - "resolved_symbol": "RuntimeManager", - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "diagnostics": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "vector", - "C0_SOURCE_CHUNKS": "vector", - "C4_SEMANTIC_ROLES": "vector", - "C2_DEPENDENCY_GRAPH": "vector", - "C3_ENTRYPOINTS": "vector" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 8, - "C4_SEMANTIC_ROLES": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C3_ENTRYPOINTS": 6 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [] - }, - "C4_SEMANTIC_ROLES": { - "path_scope": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [] - } - }, - "fallback": { - "used": false, - "reason": null - }, - "retrieval_by_layer_ms": { - "C1_SYMBOL_CATALOG": 494, - "C0_SOURCE_CHUNKS": 17, - "C4_SEMANTIC_ROLES": 14, - "C2_DEPENDENCY_GRAPH": 55, - "C3_ENTRYPOINTS": 14 - } - } - }, - { - "step": "pre_evidence_gate", - "status": "passed", - "timings_ms": { - "pre_evidence_gate": 1 - }, - "input": { - "resolved_target": "RuntimeManager", - "sub_intent": "EXPLAIN", - "target_type": "symbol", - "evidence_count": 33, - "code_chunk_count": 33, - "entrypoint_count": 3, - "relation_count": 6, - "test_evidence_count": 0, - "symbol_resolution_status": "resolved", - "path_scope": [] - }, - "output": { - "passed": true, - "failure_reasons": [], - "degraded_message": "", - "evidence_count": 33 - } - }, - { - "step": "llm", - "status": "completed", - "timings_ms": { - "llm": 5865 - }, - "output": { - "prompt_name": "code_qa_explain_answer", - "answer_preview": "Класс `RuntimeManager` определён в файле `src/app_runtime/core/runtime.py`. Он является основным компонентом для управления жизненным циклом приложения и конфигурациями.\n\nМетоды:\n- Конструктор `__init__`: инициализирует объект RuntimeManager и принимает конфигурацию.\n- `add_config_file`: добавляет ф", - "resolved_target": "RuntimeManager", - "answer_policy_branch": "normal_answer", - "decision_reason": "evidence_sufficient" - } - }, - { - "step": "post_evidence_gate", - "status": "failed", - "timings_ms": { - "post_evidence_gate": 2, - "post_evidence_gate_recheck": 2, - "repair": 4529 - }, - "input": { - "answer_mode": "normal", - "degraded_message": "", - "resolved_target": "RuntimeManager", - "draft_answer_preview": "Класс `RuntimeManager` определён в файле `src/app_runtime/core/runtime.py`. Он является основным компонентом для управления жизненным циклом приложения и конфигурациями.\n\nМетоды:\n- Конструктор `__init__`: инициализирует объект RuntimeManager и принимает конфигурацию.\n- `add_config_file`: добавляет ф", - "repair_candidate": true - }, - "output": { - "passed": false, - "action": "repair", - "reasons": [ - "missing_concrete_methods" - ], - "repair_used": true, - "final_answer_preview": "Недостаточно подтверждённых данных для уверенного ответа по RuntimeManager." - } - } - ] - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/manual_run/20260312_193339/full_chain_plba_code_subintents_one_per_subintent_plba-v3-explain-runtime-manager.md b/tests/pipeline_setup_v3/test_results/manual_run/20260312_193339/full_chain_plba_code_subintents_one_per_subintent_plba-v3-explain-runtime-manager.md deleted file mode 100644 index f45eef0..0000000 --- a/tests/pipeline_setup_v3/test_results/manual_run/20260312_193339/full_chain_plba_code_subintents_one_per_subintent_plba-v3-explain-runtime-manager.md +++ /dev/null @@ -1,311 +0,0 @@ -# plba-v3-explain-runtime-manager - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_02_pipeline/full_chain_plba_code_subintents_one_per_subintent.yaml -- runner: agent_runtime -- mode: full_chain -- passed: True - -## Query -Объясни как работает класс RuntimeManager - -## Actual -{ - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 33, - "llm_answer": "Недостаточно подтверждённых данных для уверенного ответа по RuntimeManager.", - "answer_mode": "degraded", - "path_scope": [], - "symbol_candidates": [ - "RuntimeManager" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] -} - -## Steps -[ - { - "step": "router", - "status": "completed", - "timings_ms": { - "router": 2 - }, - "output": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - } - }, - { - "step": "retrieval", - "status": "completed", - "timings_ms": { - "retrieval": 597 - }, - "output": { - "rag_count": 33, - "answer_path_rag_count": 33, - "resolved_symbol_status": "resolved", - "resolved_symbol": "RuntimeManager", - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "diagnostics": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "vector", - "C0_SOURCE_CHUNKS": "vector", - "C4_SEMANTIC_ROLES": "vector", - "C2_DEPENDENCY_GRAPH": "vector", - "C3_ENTRYPOINTS": "vector" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 8, - "C4_SEMANTIC_ROLES": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C3_ENTRYPOINTS": 6 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [] - }, - "C4_SEMANTIC_ROLES": { - "path_scope": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [] - } - }, - "fallback": { - "used": false, - "reason": null - }, - "retrieval_by_layer_ms": { - "C1_SYMBOL_CATALOG": 494, - "C0_SOURCE_CHUNKS": 17, - "C4_SEMANTIC_ROLES": 14, - "C2_DEPENDENCY_GRAPH": 55, - "C3_ENTRYPOINTS": 14 - } - } - }, - { - "step": "pre_evidence_gate", - "status": "passed", - "timings_ms": { - "pre_evidence_gate": 1 - }, - "input": { - "resolved_target": "RuntimeManager", - "sub_intent": "EXPLAIN", - "target_type": "symbol", - "evidence_count": 33, - "code_chunk_count": 33, - "entrypoint_count": 3, - "relation_count": 6, - "test_evidence_count": 0, - "symbol_resolution_status": "resolved", - "path_scope": [] - }, - "output": { - "passed": true, - "failure_reasons": [], - "degraded_message": "", - "evidence_count": 33 - } - }, - { - "step": "llm", - "status": "completed", - "timings_ms": { - "llm": 5865 - }, - "output": { - "prompt_name": "code_qa_explain_answer", - "answer_preview": "Класс `RuntimeManager` определён в файле `src/app_runtime/core/runtime.py`. Он является основным компонентом для управления жизненным циклом приложения и конфигурациями.\n\nМетоды:\n- Конструктор `__init__`: инициализирует объект RuntimeManager и принимает конфигурацию.\n- `add_config_file`: добавляет ф", - "resolved_target": "RuntimeManager", - "answer_policy_branch": "normal_answer", - "decision_reason": "evidence_sufficient" - } - }, - { - "step": "post_evidence_gate", - "status": "failed", - "timings_ms": { - "post_evidence_gate": 2, - "post_evidence_gate_recheck": 2, - "repair": 4529 - }, - "input": { - "answer_mode": "normal", - "degraded_message": "", - "resolved_target": "RuntimeManager", - "draft_answer_preview": "Класс `RuntimeManager` определён в файле `src/app_runtime/core/runtime.py`. Он является основным компонентом для управления жизненным циклом приложения и конфигурациями.\n\nМетоды:\n- Конструктор `__init__`: инициализирует объект RuntimeManager и принимает конфигурацию.\n- `add_config_file`: добавляет ф", - "repair_candidate": true - }, - "output": { - "passed": false, - "action": "repair", - "reasons": [ - "missing_concrete_methods" - ], - "repair_used": true, - "final_answer_preview": "Недостаточно подтверждённых данных для уверенного ответа по RuntimeManager." - } - } -] - -## Diagnostics -{ - "intent_correct": null, - "target_found": true, - "layers_used": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_sufficient": true, - "answer_mode": "degraded", - "resolved_target": "RuntimeManager", - "answer_policy_branch": "normal_answer", - "decision_reason": "evidence_sufficient", - "router_result": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "retrieval_profile": "code", - "sub_intent": "EXPLAIN", - "path_scope": [], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "symbol_resolution_status": "resolved" - }, - "retrieval_request": { - "rag_session_id": "7d11da21-faa0-4cea-aede-aeabe069164c", - "query": "Объясни как работает класс RuntimeManager", - "sub_intent": "EXPLAIN", - "path_scope": [], - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "per_layer_outcome": [ - { - "layer_id": "C1_SYMBOL_CATALOG", - "hit_count": 8, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C0_SOURCE_CHUNKS", - "hit_count": 8, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C4_SEMANTIC_ROLES", - "hit_count": 8, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C2_DEPENDENCY_GRAPH", - "hit_count": 6, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C3_ENTRYPOINTS", - "hit_count": 3, - "empty": false, - "fallback_used": false - } - ], - "empty_layers": [], - "evidence_gate_decision": { - "sufficient": true, - "failure_reasons": [], - "evidence_count": 33 - }, - "evidence_gate_input": { - "resolved_target": "RuntimeManager", - "sub_intent": "EXPLAIN", - "target_type": "symbol", - "evidence_count": 33, - "code_chunk_count": 33, - "entrypoint_count": 3, - "relation_count": 6, - "test_evidence_count": 0, - "symbol_resolution_status": "resolved", - "path_scope": [] - }, - "post_evidence_gate": { - "input": { - "answer_mode": "normal", - "degraded_message": "", - "resolved_target": "RuntimeManager", - "draft_answer_preview": "Класс `RuntimeManager` определён в файле `src/app_runtime/core/runtime.py`. Он является основным компонентом для управления жизненным циклом приложения и конфигурациями.\n\nМетоды:\n- Конструктор `__init__`: инициализирует объект RuntimeManager и принимает конфигурацию.\n- `add_config_file`: добавляет ф", - "repair_candidate": true - }, - "output": { - "passed": false, - "action": "repair", - "reasons": [ - "missing_concrete_methods" - ], - "repair_used": true, - "final_answer_preview": "Недостаточно подтверждённых данных для уверенного ответа по RuntimeManager." - } - }, - "failure_reasons": [], - "timings_ms": { - "router": 2, - "retrieval": 597, - "pre_evidence_gate": 1, - "llm": 5865, - "post_evidence_gate": 2, - "repair": 4529, - "post_evidence_gate_recheck": 2 - } -} - -## Mismatches -- none \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/manual_run/20260312_193339/full_chain_plba_code_subintents_one_per_subintent_plba-v3-find-entrypoints-health-endpoint.json b/tests/pipeline_setup_v3/test_results/manual_run/20260312_193339/full_chain_plba_code_subintents_one_per_subintent_plba-v3-find-entrypoints-health-endpoint.json deleted file mode 100644 index a37e36a..0000000 --- a/tests/pipeline_setup_v3/test_results/manual_run/20260312_193339/full_chain_plba_code_subintents_one_per_subintent_plba-v3-find-entrypoints-health-endpoint.json +++ /dev/null @@ -1,1558 +0,0 @@ -{ - "case_id": "plba-v3-find-entrypoints-health-endpoint", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_02_pipeline/full_chain_plba_code_subintents_one_per_subintent.yaml", - "runner": "agent_runtime", - "mode": "full_chain", - "query": "Где health endpoint?", - "actual": { - "intent": "CODE_QA", - "sub_intent": "FIND_ENTRYPOINTS", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 10, - "llm_answer": "Подтверждённая точка входа для health endpoint:\nGET /health, declared in src/app_runtime/control/http_app.py, lines 31-34, handler function named 'health'.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "health", - "endpoint" - ], - "layers": [ - "C3_ENTRYPOINTS", - "C0_SOURCE_CHUNKS" - ] - }, - "passed": true, - "mismatches": [], - "details": { - "query": "Где health endpoint?", - "router_result": { - "schema_version": "1.1", - "intent": "CODE_QA", - "retrieval_profile": "code", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query_plan": { - "raw": "Где health endpoint?", - "normalized": "Где health endpoint?", - "sub_intent": "FIND_ENTRYPOINTS", - "negations": [], - "expansions": [ - "health", - "endpoint" - ], - "keyword_hints": [ - "health", - "endpoint" - ], - "path_hints": [], - "doc_scope_hints": [], - "symbol_candidates": [ - "health", - "endpoint" - ], - "symbol_kind_hint": "unknown", - "anchors": [ - { - "type": "SYMBOL", - "value": "health", - "source": "user_text", - "subtype": null, - "span": { - "start": 4, - "end": 10 - }, - "confidence": 0.88 - }, - { - "type": "SYMBOL", - "value": "endpoint", - "source": "user_text", - "subtype": null, - "span": { - "start": 11, - "end": 19 - }, - "confidence": 0.88 - } - ] - }, - "retrieval_spec": { - "domains": [ - "CODE" - ], - "layer_queries": [ - { - "layer_id": "C3_ENTRYPOINTS", - "top_k": 12 - }, - { - "layer_id": "C0_SOURCE_CHUNKS", - "top_k": 6 - } - ], - "filters": { - "test_policy": "EXCLUDE", - "path_scope": [], - "language": [ - "python" - ] - }, - "rerank_profile": "code" - }, - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - }, - "symbol_resolution": { - "status": "not_found", - "resolved_symbol": null, - "alternatives": [], - "confidence": 0.0 - }, - "evidence_policy": { - "require_def": true, - "require_flow": true, - "require_spec": false, - "allow_answer_without_evidence": false - } - }, - "retrieval_request": { - "rag_session_id": "7d11da21-faa0-4cea-aede-aeabe069164c", - "query": "Где health endpoint?", - "sub_intent": "FIND_ENTRYPOINTS", - "path_scope": [], - "keyword_hints": [ - "health", - "endpoint" - ], - "symbol_candidates": [ - "health", - "endpoint" - ], - "requested_layers": [ - "C3_ENTRYPOINTS", - "C0_SOURCE_CHUNKS" - ], - "retrieval_spec": { - "domains": [ - "CODE" - ], - "layer_queries": [ - { - "layer_id": "C3_ENTRYPOINTS", - "top_k": 12 - }, - { - "layer_id": "C0_SOURCE_CHUNKS", - "top_k": 6 - } - ], - "filters": { - "test_policy": "EXCLUDE", - "path_scope": [], - "language": [ - "python" - ] - }, - "rerank_profile": "code" - }, - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - }, - "query_plan": { - "raw": "Где health endpoint?", - "normalized": "Где health endpoint?", - "sub_intent": "FIND_ENTRYPOINTS", - "negations": [], - "expansions": [ - "health", - "endpoint" - ], - "keyword_hints": [ - "health", - "endpoint" - ], - "path_hints": [], - "doc_scope_hints": [], - "symbol_candidates": [ - "health", - "endpoint" - ], - "symbol_kind_hint": "unknown", - "anchors": [ - { - "type": "SYMBOL", - "value": "health", - "source": "user_text", - "subtype": null, - "span": { - "start": 4, - "end": 10 - }, - "confidence": 0.88 - }, - { - "type": "SYMBOL", - "value": "endpoint", - "source": "user_text", - "subtype": null, - "span": { - "start": 11, - "end": 19 - }, - "confidence": 0.88 - } - ] - } - }, - "retrieval_result": { - "target_symbol_candidates": [], - "resolved_symbol": null, - "symbol_resolution_status": "not_found", - "file_candidates": [ - "src/app_runtime/control/http_app.py", - "src/app_runtime/health/registry.py", - "src/plba/health.py", - "src/app_runtime/contracts/health.py", - "src/app_runtime/health/__init__.py", - "src/app_runtime/contracts/worker.py" - ], - "code_chunks": [ - { - "layer": "C3_ENTRYPOINTS", - "path": "src/app_runtime/control/http_app.py", - "title": "app.post", - "content": "fastapi http app.post", - "start_line": 38, - "end_line": 42, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C3_ENTRYPOINTS", - "path": "src/app_runtime/control/http_app.py", - "title": "app.get", - "content": "fastapi http app.get", - "start_line": 31, - "end_line": 34, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C3_ENTRYPOINTS", - "path": "src/app_runtime/control/http_app.py", - "title": "app.get", - "content": "fastapi http app.get", - "start_line": 38, - "end_line": 42, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C0_SOURCE_CHUNKS", - "path": "src/app_runtime/health/registry.py", - "title": "src/app_runtime/health/registry.py:HealthRegistry", - "content": "class HealthRegistry:\n def __init__(self) -> None:\n self._contributors: list[HealthContributor] = []\n\n def register(self, contributor: HealthContributor) -> None:\n self._contributors.append(contributor)\n\n def contributor_healths(self) -> list[WorkerHealth]:\n return [contributor.health() for contributor in self._contributors]\n\n def snapshot(self, worker_healths: list[WorkerHealth]) -> dict[str, object]:\n component_healths = worker_healths + self.contributor_healths()\n return {\n \"status\": self._aggregate_status(component_healths),\n \"components\": [self._health_dict(item) for item in component_healths],\n }\n\n def payload(self, state: LifecycleState, worker_healths: list[WorkerHealth]) -> HealthPayload:\n component_healths = worker_healths + self.contributor_healths()\n if state == LifecycleState.STOPPED:\n return {\"status\": \"unhealthy\", \"detail\": \"state=stopped\", \"state\": state.value}\n if state in {LifecycleState.STARTING, LifecycleState.STOPPING}:\n return {\n \"status\": \"degraded\",\n \"detail\": f\"state={state.value}\",\n \"state\": state.value,\n \"components\": [self._health_dict(item) for item in component_healths],\n }\n return {\n \"status\": self._aggregate_status(component_healths),\n \"state\": state.value,\n \"components\": [self._health_dict(item) for item in component_healths],\n }\n\n def _aggregate_status(self, component_healths: list[WorkerHealth]) -> str:\n if any(item.status == \"unhealthy\" and item.critical for item in component_healths):\n return \"unhealthy\"\n if any(item.status in {\"degraded\", \"unhealthy\"} for item in component_healths):\n return \"degraded\"\n return \"ok\"\n\n def _health_dict(self, health: WorkerHealth) -> dict[str, object]:\n return {\n \"name\": health.name,\n \"status\": health.status,\n \"critical\": health.critical,\n \"detail\": health.detail,\n \"meta\": health.meta,\n }", - "start_line": 8, - "end_line": 56, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.health.registry", - "is_test": false, - "blob_sha": "26e6a24daa43407ba5340b74497c20153020e79f8d7828ae502aaec378dfcf75", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C0_SOURCE_CHUNKS", - "path": "src/plba/health.py", - "title": "src/app_runtime/health/__init__.py:1-3", - "content": "from app_runtime.health.registry import HealthRegistry\n\n__all__ = [\"HealthRegistry\"]", - "start_line": 1, - "end_line": 3, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.app_runtime.health.__init__", - "is_test": false, - "blob_sha": "f7b15eed8b1f1cca8dfd467909a2612d8cb4e66e46b972ad89a0c9459ce283a0", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C0_SOURCE_CHUNKS", - "path": "src/app_runtime/contracts/health.py", - "title": "src/app_runtime/contracts/health.py:HealthContributor", - "content": "class HealthContributor(ABC):\n @abstractmethod\n def health(self) -> WorkerHealth:\n \"\"\"Return contributor health state.\"\"\"", - "start_line": 7, - "end_line": 10, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.contracts.health", - "is_test": false, - "blob_sha": "6bd92611def7131e32d4dd34a8ed85e6cf3c67722ad27797032a632cb30dc097", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C0_SOURCE_CHUNKS", - "path": "src/app_runtime/health/__init__.py", - "title": "src/app_runtime/health/__init__.py:1-3", - "content": "from app_runtime.health.registry import HealthRegistry\n\n__all__ = [\"HealthRegistry\"]", - "start_line": 1, - "end_line": 3, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.app_runtime.health.__init__", - "is_test": false, - "blob_sha": "f7b15eed8b1f1cca8dfd467909a2612d8cb4e66e46b972ad89a0c9459ce283a0", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C0_SOURCE_CHUNKS", - "path": "src/app_runtime/contracts/worker.py", - "title": "src/app_runtime/contracts/worker.py:WorkerHealth", - "content": "class WorkerHealth:\n name: str\n status: HealthState\n critical: bool\n detail: str | None = None\n meta: dict[str, Any] = field(default_factory=dict)", - "start_line": 13, - "end_line": 18, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.contracts.worker", - "is_test": false, - "blob_sha": "e4827d32220f322d8adc3e42769da3ca0cc680db6a5eab7a11f4d8773a75304e", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C0_SOURCE_CHUNKS", - "path": "src/app_runtime/contracts/worker.py", - "title": "src/app_runtime/contracts/worker.py:Worker", - "content": "class Worker(ABC):\n @property\n @abstractmethod\n def name(self) -> str:\n \"\"\"Stable worker name for diagnostics.\"\"\"\n\n @property\n @abstractmethod\n def critical(self) -> bool:\n \"\"\"Whether this worker is required for healthy app operation.\"\"\"\n\n @abstractmethod\n def start(self) -> None:\n \"\"\"Start worker execution.\"\"\"\n\n @abstractmethod\n def stop(self, force: bool = False) -> None:\n \"\"\"Request graceful or immediate stop.\"\"\"\n\n @abstractmethod\n def health(self) -> WorkerHealth:\n \"\"\"Return current health state.\"\"\"\n\n @abstractmethod\n def status(self) -> WorkerStatus:\n \"\"\"Return current runtime status.\"\"\"", - "start_line": 30, - "end_line": 55, - "metadata": { - "chunk_index": 2, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.contracts.worker", - "is_test": false, - "blob_sha": "e4827d32220f322d8adc3e42769da3ca0cc680db6a5eab7a11f4d8773a75304e", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C0_SOURCE_CHUNKS", - "path": "src/app_runtime/control/http_app.py", - "title": "src/app_runtime/control/http_app.py:HttpControlAppFactory", - "content": "class HttpControlAppFactory:\n def create(\n self,\n health_provider: Callable[[], Awaitable[HealthPayload]],\n action_provider: Callable[[str, str], Awaitable[JSONResponse]],\n ) -> FastAPI:\n app = FastAPI(title=\"PLBA Control API\")\n\n @app.middleware(\"http\")\n async def log_api_call(request: Request, call_next): # type: ignore[no-untyped-def]\n started = time.monotonic()\n response = await call_next(request)\n response.headers[\"X-Response-Time-Ms\"] = str(int((time.monotonic() - started) * 1000))\n return response\n\n @app.get(\"/health\")\n async def health() -> JSONResponse:\n payload = await health_provider()\n status_code = 200 if payload.get(\"status\") == \"ok\" else 503\n return JSONResponse(content=payload, status_code=status_code)\n\n @app.get(\"/actions/{action}\")\n @app.post(\"/actions/{action}\")\n async def action(action: str, request: Request) -> JSONResponse:\n client_source = self._client_source(request)\n if action in {\"start\", \"stop\"}:\n LOGGER.warning(\"Control action requested: /actions/%s client=%s\", action, client_source)\n return await action_provider(action, client_source)\n\n return app\n\n def _client_source(self, request: Request) -> str:\n explicit_header = request.headers.get(\"X-Client-Source\", \"\").strip()\n if explicit_header:\n return explicit_header\n user_agent = request.headers.get(\"User-Agent\", \"\").strip()\n if user_agent:\n return f\"user-agent:{user_agent}\"\n return \"unknown\"", - "start_line": 15, - "end_line": 53, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.http_app", - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "relations": [], - "semantic_hints": [], - "entrypoints": [ - { - "path": "src/app_runtime/control/http_app.py", - "title": "app.get", - "start_line": 31, - "end_line": 34, - "http_method": "GET", - "route_path": "/health", - "handler_symbol": "health", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "route_or_command": "app.get", - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "title": "app.get", - "start_line": 38, - "end_line": 42, - "http_method": "GET", - "route_path": "/actions/{action}", - "handler_symbol": "action", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "route_or_command": "app.get", - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "title": "app.post", - "start_line": 38, - "end_line": 42, - "http_method": "POST", - "route_path": "/actions/{action}", - "handler_symbol": "action", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "route_or_command": "app.post", - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "test_candidates": [], - "layer_outcomes": [ - { - "layer_id": "C3_ENTRYPOINTS", - "hit_count": 3, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C0_SOURCE_CHUNKS", - "hit_count": 7, - "empty": false, - "fallback_used": false - } - ], - "missing_layers": [], - "raw_rows": [ - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": null, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": null, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": null, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/health/registry.py", - "content": "class HealthRegistry:\n def __init__(self) -> None:\n self._contributors: list[HealthContributor] = []\n\n def register(self, contributor: HealthContributor) -> None:\n self._contributors.append(contributor)\n\n def contributor_healths(self) -> list[WorkerHealth]:\n return [contributor.health() for contributor in self._contributors]\n\n def snapshot(self, worker_healths: list[WorkerHealth]) -> dict[str, object]:\n component_healths = worker_healths + self.contributor_healths()\n return {\n \"status\": self._aggregate_status(component_healths),\n \"components\": [self._health_dict(item) for item in component_healths],\n }\n\n def payload(self, state: LifecycleState, worker_healths: list[WorkerHealth]) -> HealthPayload:\n component_healths = worker_healths + self.contributor_healths()\n if state == LifecycleState.STOPPED:\n return {\"status\": \"unhealthy\", \"detail\": \"state=stopped\", \"state\": state.value}\n if state in {LifecycleState.STARTING, LifecycleState.STOPPING}:\n return {\n \"status\": \"degraded\",\n \"detail\": f\"state={state.value}\",\n \"state\": state.value,\n \"components\": [self._health_dict(item) for item in component_healths],\n }\n return {\n \"status\": self._aggregate_status(component_healths),\n \"state\": state.value,\n \"components\": [self._health_dict(item) for item in component_healths],\n }\n\n def _aggregate_status(self, component_healths: list[WorkerHealth]) -> str:\n if any(item.status == \"unhealthy\" and item.critical for item in component_healths):\n return \"unhealthy\"\n if any(item.status in {\"degraded\", \"unhealthy\"} for item in component_healths):\n return \"degraded\"\n return \"ok\"\n\n def _health_dict(self, health: WorkerHealth) -> dict[str, object]:\n return {\n \"name\": health.name,\n \"status\": health.status,\n \"critical\": health.critical,\n \"detail\": health.detail,\n \"meta\": health.meta,\n }", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/health/registry.py:HealthRegistry", - "span_start": 8, - "span_end": 56, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": null, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.health.registry", - "is_test": false, - "blob_sha": "26e6a24daa43407ba5340b74497c20153020e79f8d7828ae502aaec378dfcf75", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/health.py", - "content": "from app_runtime.health.registry import HealthRegistry\n\n__all__ = [\"HealthRegistry\"]", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/health/__init__.py:1-3", - "span_start": 1, - "span_end": 3, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": null, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.app_runtime.health.__init__", - "is_test": false, - "blob_sha": "f7b15eed8b1f1cca8dfd467909a2612d8cb4e66e46b972ad89a0c9459ce283a0", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/contracts/health.py", - "content": "class HealthContributor(ABC):\n @abstractmethod\n def health(self) -> WorkerHealth:\n \"\"\"Return contributor health state.\"\"\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/contracts/health.py:HealthContributor", - "span_start": 7, - "span_end": 10, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": null, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.contracts.health", - "is_test": false, - "blob_sha": "6bd92611def7131e32d4dd34a8ed85e6cf3c67722ad27797032a632cb30dc097", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/health/__init__.py", - "content": "from app_runtime.health.registry import HealthRegistry\n\n__all__ = [\"HealthRegistry\"]", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/health/__init__.py:1-3", - "span_start": 1, - "span_end": 3, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": null, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.app_runtime.health.__init__", - "is_test": false, - "blob_sha": "f7b15eed8b1f1cca8dfd467909a2612d8cb4e66e46b972ad89a0c9459ce283a0", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/contracts/worker.py", - "content": "class WorkerHealth:\n name: str\n status: HealthState\n critical: bool\n detail: str | None = None\n meta: dict[str, Any] = field(default_factory=dict)", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/contracts/worker.py:WorkerHealth", - "span_start": 13, - "span_end": 18, - "lexical_rank": 6, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": null, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.contracts.worker", - "is_test": false, - "blob_sha": "e4827d32220f322d8adc3e42769da3ca0cc680db6a5eab7a11f4d8773a75304e", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/contracts/worker.py", - "content": "class Worker(ABC):\n @property\n @abstractmethod\n def name(self) -> str:\n \"\"\"Stable worker name for diagnostics.\"\"\"\n\n @property\n @abstractmethod\n def critical(self) -> bool:\n \"\"\"Whether this worker is required for healthy app operation.\"\"\"\n\n @abstractmethod\n def start(self) -> None:\n \"\"\"Start worker execution.\"\"\"\n\n @abstractmethod\n def stop(self, force: bool = False) -> None:\n \"\"\"Request graceful or immediate stop.\"\"\"\n\n @abstractmethod\n def health(self) -> WorkerHealth:\n \"\"\"Return current health state.\"\"\"\n\n @abstractmethod\n def status(self) -> WorkerStatus:\n \"\"\"Return current runtime status.\"\"\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/contracts/worker.py:Worker", - "span_start": 30, - "span_end": 55, - "lexical_rank": 6, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": null, - "metadata": { - "chunk_index": 2, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.contracts.worker", - "is_test": false, - "blob_sha": "e4827d32220f322d8adc3e42769da3ca0cc680db6a5eab7a11f4d8773a75304e", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "class HttpControlAppFactory:\n def create(\n self,\n health_provider: Callable[[], Awaitable[HealthPayload]],\n action_provider: Callable[[str, str], Awaitable[JSONResponse]],\n ) -> FastAPI:\n app = FastAPI(title=\"PLBA Control API\")\n\n @app.middleware(\"http\")\n async def log_api_call(request: Request, call_next): # type: ignore[no-untyped-def]\n started = time.monotonic()\n response = await call_next(request)\n response.headers[\"X-Response-Time-Ms\"] = str(int((time.monotonic() - started) * 1000))\n return response\n\n @app.get(\"/health\")\n async def health() -> JSONResponse:\n payload = await health_provider()\n status_code = 200 if payload.get(\"status\") == \"ok\" else 503\n return JSONResponse(content=payload, status_code=status_code)\n\n @app.get(\"/actions/{action}\")\n @app.post(\"/actions/{action}\")\n async def action(action: str, request: Request) -> JSONResponse:\n client_source = self._client_source(request)\n if action in {\"start\", \"stop\"}:\n LOGGER.warning(\"Control action requested: /actions/%s client=%s\", action, client_source)\n return await action_provider(action, client_source)\n\n return app\n\n def _client_source(self, request: Request) -> str:\n explicit_header = request.headers.get(\"X-Client-Source\", \"\").strip()\n if explicit_header:\n return explicit_header\n user_agent = request.headers.get(\"User-Agent\", \"\").strip()\n if user_agent:\n return f\"user-agent:{user_agent}\"\n return \"unknown\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/http_app.py:HttpControlAppFactory", - "span_start": 15, - "span_end": 53, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.http_app", - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "retrieval_report": { - "executed_layers": [ - "C3_ENTRYPOINTS", - "C0_SOURCE_CHUNKS" - ], - "retrieval_mode_by_layer": { - "C3_ENTRYPOINTS": "vector", - "C0_SOURCE_CHUNKS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C3_ENTRYPOINTS": 12, - "C0_SOURCE_CHUNKS": 24 - }, - "filters_by_layer": { - "C3_ENTRYPOINTS": { - "path_scope": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src/app_runtime/control/http_app.py" - ] - } - }, - "fallback": { - "used": false, - "reason": null - }, - "retrieval_by_layer_ms": { - "C3_ENTRYPOINTS": 34, - "C0_SOURCE_CHUNKS": 15 - }, - "supplemental_requests": [ - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Где health endpoint?", - "ranking_profile": "entrypoint_source_hydration" - } - ] - } - }, - "diagnostics": { - "intent_correct": null, - "target_found": true, - "layers_used": [ - "C3_ENTRYPOINTS", - "C0_SOURCE_CHUNKS" - ], - "retrieval_sufficient": true, - "answer_mode": "normal", - "resolved_target": "src/app_runtime/control/http_app.py", - "answer_policy_branch": "normal_answer", - "decision_reason": "evidence_sufficient", - "router_result": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "retrieval_profile": "code", - "sub_intent": "FIND_ENTRYPOINTS", - "path_scope": [], - "layers": [ - "C3_ENTRYPOINTS", - "C0_SOURCE_CHUNKS" - ], - "symbol_resolution_status": "not_found" - }, - "retrieval_request": { - "rag_session_id": "7d11da21-faa0-4cea-aede-aeabe069164c", - "query": "Где health endpoint?", - "sub_intent": "FIND_ENTRYPOINTS", - "path_scope": [], - "requested_layers": [ - "C3_ENTRYPOINTS", - "C0_SOURCE_CHUNKS" - ] - }, - "per_layer_outcome": [ - { - "layer_id": "C3_ENTRYPOINTS", - "hit_count": 3, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C0_SOURCE_CHUNKS", - "hit_count": 7, - "empty": false, - "fallback_used": false - } - ], - "empty_layers": [], - "evidence_gate_decision": { - "sufficient": true, - "failure_reasons": [], - "evidence_count": 10 - }, - "evidence_gate_input": { - "resolved_target": "src/app_runtime/control/http_app.py", - "sub_intent": "FIND_ENTRYPOINTS", - "target_type": "file", - "evidence_count": 10, - "code_chunk_count": 10, - "entrypoint_count": 3, - "relation_count": 0, - "test_evidence_count": 0, - "symbol_resolution_status": "not_found", - "path_scope": [] - }, - "post_evidence_gate": { - "input": { - "answer_mode": "normal", - "degraded_message": "", - "resolved_target": "src/app_runtime/control/http_app.py", - "draft_answer_preview": "Подтверждённая точка входа для health endpoint:\nGET /health, declared in src/app_runtime/control/http_app.py, lines 31-34, handler function named 'health'.", - "repair_candidate": true - }, - "output": { - "passed": true, - "action": "return", - "reasons": [], - "repair_used": false, - "final_answer_preview": "Подтверждённая точка входа для health endpoint:\nGET /health, declared in src/app_runtime/control/http_app.py, lines 31-34, handler function named 'health'." - } - }, - "failure_reasons": [], - "timings_ms": { - "router": 1, - "retrieval": 64, - "pre_evidence_gate": 1, - "llm": 1406, - "post_evidence_gate": 1 - } - }, - "rag_rows": [ - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/health/registry.py", - "content": "class HealthRegistry:\n def __init__(self) -> None:\n self._contributors: list[HealthContributor] = []\n\n def register(self, contributor: HealthContributor) -> None:\n self._contributors.append(contributor)\n\n def contributor_healths(self) -> list[WorkerHealth]:\n return [contributor.health() for contributor in self._contributors]\n\n def snapshot(self, worker_healths: list[WorkerHealth]) -> dict[str, object]:\n component_healths = worker_healths + self.contributor_healths()\n return {\n \"status\": self._aggregate_status(component_healths),\n \"components\": [self._health_dict(item) for item in component_healths],\n }\n\n def payload(self, state: LifecycleState, worker_healths: list[WorkerHealth]) -> HealthPayload:\n component_healths = worker_healths + self.contributor_healths()\n if state == LifecycleState.STOPPED:\n return {\"status\": \"unhealthy\", \"detail\": \"state=stopped\", \"state\": state.value}\n if state in {LifecycleState.STARTING, LifecycleState.STOPPING}:\n return {\n \"status\": \"degraded\",\n \"detail\": f\"state={state.value}\",\n \"state\": state.value,\n \"components\": [self._health_dict(item) for item in component_healths],\n }\n return {\n \"status\": self._aggregate_status(component_healths),\n \"state\": state.value,\n \"components\": [self._health_dict(item) for item in component_healths],\n }\n\n def _aggregate_status(self, component_healths: list[WorkerHealth]) -> str:\n if any(item.status == \"unhealthy\" and item.critical for item in component_healths):\n return \"unhealthy\"\n if any(item.status in {\"degraded\", \"unhealthy\"} for item in component_healths):\n return \"degraded\"\n return \"ok\"\n\n def _health_dict(self, health: WorkerHealth) -> dict[str, object]:\n return {\n \"name\": health.name,\n \"status\": health.status,\n \"critical\": health.critical,\n \"detail\": health.detail,\n \"meta\": health.meta,\n }", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/health/registry.py:HealthRegistry", - "span_start": 8, - "span_end": 56, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.health.registry", - "is_test": false, - "blob_sha": "26e6a24daa43407ba5340b74497c20153020e79f8d7828ae502aaec378dfcf75", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/health.py", - "content": "from app_runtime.health.registry import HealthRegistry\n\n__all__ = [\"HealthRegistry\"]", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/health/__init__.py:1-3", - "span_start": 1, - "span_end": 3, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.app_runtime.health.__init__", - "is_test": false, - "blob_sha": "f7b15eed8b1f1cca8dfd467909a2612d8cb4e66e46b972ad89a0c9459ce283a0", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/contracts/health.py", - "content": "class HealthContributor(ABC):\n @abstractmethod\n def health(self) -> WorkerHealth:\n \"\"\"Return contributor health state.\"\"\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/contracts/health.py:HealthContributor", - "span_start": 7, - "span_end": 10, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.contracts.health", - "is_test": false, - "blob_sha": "6bd92611def7131e32d4dd34a8ed85e6cf3c67722ad27797032a632cb30dc097", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/health/__init__.py", - "content": "from app_runtime.health.registry import HealthRegistry\n\n__all__ = [\"HealthRegistry\"]", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/health/__init__.py:1-3", - "span_start": 1, - "span_end": 3, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.app_runtime.health.__init__", - "is_test": false, - "blob_sha": "f7b15eed8b1f1cca8dfd467909a2612d8cb4e66e46b972ad89a0c9459ce283a0", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/contracts/worker.py", - "content": "class WorkerHealth:\n name: str\n status: HealthState\n critical: bool\n detail: str | None = None\n meta: dict[str, Any] = field(default_factory=dict)", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/contracts/worker.py:WorkerHealth", - "span_start": 13, - "span_end": 18, - "lexical_rank": 6, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.contracts.worker", - "is_test": false, - "blob_sha": "e4827d32220f322d8adc3e42769da3ca0cc680db6a5eab7a11f4d8773a75304e", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/contracts/worker.py", - "content": "class Worker(ABC):\n @property\n @abstractmethod\n def name(self) -> str:\n \"\"\"Stable worker name for diagnostics.\"\"\"\n\n @property\n @abstractmethod\n def critical(self) -> bool:\n \"\"\"Whether this worker is required for healthy app operation.\"\"\"\n\n @abstractmethod\n def start(self) -> None:\n \"\"\"Start worker execution.\"\"\"\n\n @abstractmethod\n def stop(self, force: bool = False) -> None:\n \"\"\"Request graceful or immediate stop.\"\"\"\n\n @abstractmethod\n def health(self) -> WorkerHealth:\n \"\"\"Return current health state.\"\"\"\n\n @abstractmethod\n def status(self) -> WorkerStatus:\n \"\"\"Return current runtime status.\"\"\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/contracts/worker.py:Worker", - "span_start": 30, - "span_end": 55, - "lexical_rank": 6, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 2, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.contracts.worker", - "is_test": false, - "blob_sha": "e4827d32220f322d8adc3e42769da3ca0cc680db6a5eab7a11f4d8773a75304e", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "class HttpControlAppFactory:\n def create(\n self,\n health_provider: Callable[[], Awaitable[HealthPayload]],\n action_provider: Callable[[str, str], Awaitable[JSONResponse]],\n ) -> FastAPI:\n app = FastAPI(title=\"PLBA Control API\")\n\n @app.middleware(\"http\")\n async def log_api_call(request: Request, call_next): # type: ignore[no-untyped-def]\n started = time.monotonic()\n response = await call_next(request)\n response.headers[\"X-Response-Time-Ms\"] = str(int((time.monotonic() - started) * 1000))\n return response\n\n @app.get(\"/health\")\n async def health() -> JSONResponse:\n payload = await health_provider()\n status_code = 200 if payload.get(\"status\") == \"ok\" else 503\n return JSONResponse(content=payload, status_code=status_code)\n\n @app.get(\"/actions/{action}\")\n @app.post(\"/actions/{action}\")\n async def action(action: str, request: Request) -> JSONResponse:\n client_source = self._client_source(request)\n if action in {\"start\", \"stop\"}:\n LOGGER.warning(\"Control action requested: /actions/%s client=%s\", action, client_source)\n return await action_provider(action, client_source)\n\n return app\n\n def _client_source(self, request: Request) -> str:\n explicit_header = request.headers.get(\"X-Client-Source\", \"\").strip()\n if explicit_header:\n return explicit_header\n user_agent = request.headers.get(\"User-Agent\", \"\").strip()\n if user_agent:\n return f\"user-agent:{user_agent}\"\n return \"unknown\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/http_app.py:HttpControlAppFactory", - "span_start": 15, - "span_end": 53, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.http_app", - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "validation": { - "passed": true, - "action": "return", - "reasons": [] - }, - "token_usage": { - "prompt_name": "code_qa_find_entrypoints_answer", - "tokens_in_estimate": 2531 - }, - "steps": [ - { - "step": "router", - "status": "completed", - "timings_ms": { - "router": 1 - }, - "output": { - "intent": "CODE_QA", - "sub_intent": "FIND_ENTRYPOINTS", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - } - }, - { - "step": "retrieval", - "status": "completed", - "timings_ms": { - "retrieval": 64 - }, - "output": { - "rag_count": 10, - "answer_path_rag_count": 10, - "resolved_symbol_status": "not_found", - "resolved_symbol": null, - "requested_layers": [ - "C3_ENTRYPOINTS", - "C0_SOURCE_CHUNKS" - ] - }, - "diagnostics": { - "executed_layers": [ - "C3_ENTRYPOINTS", - "C0_SOURCE_CHUNKS" - ], - "retrieval_mode_by_layer": { - "C3_ENTRYPOINTS": "vector", - "C0_SOURCE_CHUNKS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C3_ENTRYPOINTS": 12, - "C0_SOURCE_CHUNKS": 24 - }, - "filters_by_layer": { - "C3_ENTRYPOINTS": { - "path_scope": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src/app_runtime/control/http_app.py" - ] - } - }, - "fallback": { - "used": false, - "reason": null - }, - "retrieval_by_layer_ms": { - "C3_ENTRYPOINTS": 34, - "C0_SOURCE_CHUNKS": 15 - }, - "supplemental_requests": [ - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Где health endpoint?", - "ranking_profile": "entrypoint_source_hydration" - } - ] - } - }, - { - "step": "pre_evidence_gate", - "status": "passed", - "timings_ms": { - "pre_evidence_gate": 1 - }, - "input": { - "resolved_target": "src/app_runtime/control/http_app.py", - "sub_intent": "FIND_ENTRYPOINTS", - "target_type": "file", - "evidence_count": 10, - "code_chunk_count": 10, - "entrypoint_count": 3, - "relation_count": 0, - "test_evidence_count": 0, - "symbol_resolution_status": "not_found", - "path_scope": [] - }, - "output": { - "passed": true, - "failure_reasons": [], - "degraded_message": "", - "evidence_count": 10 - } - }, - { - "step": "llm", - "status": "completed", - "timings_ms": { - "llm": 1406 - }, - "output": { - "prompt_name": "code_qa_find_entrypoints_answer", - "answer_preview": "Подтверждённая точка входа для health endpoint:\nGET /health, declared in src/app_runtime/control/http_app.py, lines 31-34, handler function named 'health'.", - "resolved_target": "src/app_runtime/control/http_app.py", - "answer_policy_branch": "normal_answer", - "decision_reason": "evidence_sufficient" - } - }, - { - "step": "post_evidence_gate", - "status": "passed", - "timings_ms": { - "post_evidence_gate": 1, - "post_evidence_gate_recheck": 0, - "repair": 0 - }, - "input": { - "answer_mode": "normal", - "degraded_message": "", - "resolved_target": "src/app_runtime/control/http_app.py", - "draft_answer_preview": "Подтверждённая точка входа для health endpoint:\nGET /health, declared in src/app_runtime/control/http_app.py, lines 31-34, handler function named 'health'.", - "repair_candidate": true - }, - "output": { - "passed": true, - "action": "return", - "reasons": [], - "repair_used": false, - "final_answer_preview": "Подтверждённая точка входа для health endpoint:\nGET /health, declared in src/app_runtime/control/http_app.py, lines 31-34, handler function named 'health'." - } - } - ] - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/manual_run/20260312_193339/full_chain_plba_code_subintents_one_per_subintent_plba-v3-find-entrypoints-health-endpoint.md b/tests/pipeline_setup_v3/test_results/manual_run/20260312_193339/full_chain_plba_code_subintents_one_per_subintent_plba-v3-find-entrypoints-health-endpoint.md deleted file mode 100644 index 1d8636e..0000000 --- a/tests/pipeline_setup_v3/test_results/manual_run/20260312_193339/full_chain_plba_code_subintents_one_per_subintent_plba-v3-find-entrypoints-health-endpoint.md +++ /dev/null @@ -1,261 +0,0 @@ -# plba-v3-find-entrypoints-health-endpoint - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_02_pipeline/full_chain_plba_code_subintents_one_per_subintent.yaml -- runner: agent_runtime -- mode: full_chain -- passed: True - -## Query -Где health endpoint? - -## Actual -{ - "intent": "CODE_QA", - "sub_intent": "FIND_ENTRYPOINTS", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 10, - "llm_answer": "Подтверждённая точка входа для health endpoint:\nGET /health, declared in src/app_runtime/control/http_app.py, lines 31-34, handler function named 'health'.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "health", - "endpoint" - ], - "layers": [ - "C3_ENTRYPOINTS", - "C0_SOURCE_CHUNKS" - ] -} - -## Steps -[ - { - "step": "router", - "status": "completed", - "timings_ms": { - "router": 1 - }, - "output": { - "intent": "CODE_QA", - "sub_intent": "FIND_ENTRYPOINTS", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - } - }, - { - "step": "retrieval", - "status": "completed", - "timings_ms": { - "retrieval": 64 - }, - "output": { - "rag_count": 10, - "answer_path_rag_count": 10, - "resolved_symbol_status": "not_found", - "resolved_symbol": null, - "requested_layers": [ - "C3_ENTRYPOINTS", - "C0_SOURCE_CHUNKS" - ] - }, - "diagnostics": { - "executed_layers": [ - "C3_ENTRYPOINTS", - "C0_SOURCE_CHUNKS" - ], - "retrieval_mode_by_layer": { - "C3_ENTRYPOINTS": "vector", - "C0_SOURCE_CHUNKS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C3_ENTRYPOINTS": 12, - "C0_SOURCE_CHUNKS": 24 - }, - "filters_by_layer": { - "C3_ENTRYPOINTS": { - "path_scope": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src/app_runtime/control/http_app.py" - ] - } - }, - "fallback": { - "used": false, - "reason": null - }, - "retrieval_by_layer_ms": { - "C3_ENTRYPOINTS": 34, - "C0_SOURCE_CHUNKS": 15 - }, - "supplemental_requests": [ - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Где health endpoint?", - "ranking_profile": "entrypoint_source_hydration" - } - ] - } - }, - { - "step": "pre_evidence_gate", - "status": "passed", - "timings_ms": { - "pre_evidence_gate": 1 - }, - "input": { - "resolved_target": "src/app_runtime/control/http_app.py", - "sub_intent": "FIND_ENTRYPOINTS", - "target_type": "file", - "evidence_count": 10, - "code_chunk_count": 10, - "entrypoint_count": 3, - "relation_count": 0, - "test_evidence_count": 0, - "symbol_resolution_status": "not_found", - "path_scope": [] - }, - "output": { - "passed": true, - "failure_reasons": [], - "degraded_message": "", - "evidence_count": 10 - } - }, - { - "step": "llm", - "status": "completed", - "timings_ms": { - "llm": 1406 - }, - "output": { - "prompt_name": "code_qa_find_entrypoints_answer", - "answer_preview": "Подтверждённая точка входа для health endpoint:\nGET /health, declared in src/app_runtime/control/http_app.py, lines 31-34, handler function named 'health'.", - "resolved_target": "src/app_runtime/control/http_app.py", - "answer_policy_branch": "normal_answer", - "decision_reason": "evidence_sufficient" - } - }, - { - "step": "post_evidence_gate", - "status": "passed", - "timings_ms": { - "post_evidence_gate": 1, - "post_evidence_gate_recheck": 0, - "repair": 0 - }, - "input": { - "answer_mode": "normal", - "degraded_message": "", - "resolved_target": "src/app_runtime/control/http_app.py", - "draft_answer_preview": "Подтверждённая точка входа для health endpoint:\nGET /health, declared in src/app_runtime/control/http_app.py, lines 31-34, handler function named 'health'.", - "repair_candidate": true - }, - "output": { - "passed": true, - "action": "return", - "reasons": [], - "repair_used": false, - "final_answer_preview": "Подтверждённая точка входа для health endpoint:\nGET /health, declared in src/app_runtime/control/http_app.py, lines 31-34, handler function named 'health'." - } - } -] - -## Diagnostics -{ - "intent_correct": null, - "target_found": true, - "layers_used": [ - "C3_ENTRYPOINTS", - "C0_SOURCE_CHUNKS" - ], - "retrieval_sufficient": true, - "answer_mode": "normal", - "resolved_target": "src/app_runtime/control/http_app.py", - "answer_policy_branch": "normal_answer", - "decision_reason": "evidence_sufficient", - "router_result": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "retrieval_profile": "code", - "sub_intent": "FIND_ENTRYPOINTS", - "path_scope": [], - "layers": [ - "C3_ENTRYPOINTS", - "C0_SOURCE_CHUNKS" - ], - "symbol_resolution_status": "not_found" - }, - "retrieval_request": { - "rag_session_id": "7d11da21-faa0-4cea-aede-aeabe069164c", - "query": "Где health endpoint?", - "sub_intent": "FIND_ENTRYPOINTS", - "path_scope": [], - "requested_layers": [ - "C3_ENTRYPOINTS", - "C0_SOURCE_CHUNKS" - ] - }, - "per_layer_outcome": [ - { - "layer_id": "C3_ENTRYPOINTS", - "hit_count": 3, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C0_SOURCE_CHUNKS", - "hit_count": 7, - "empty": false, - "fallback_used": false - } - ], - "empty_layers": [], - "evidence_gate_decision": { - "sufficient": true, - "failure_reasons": [], - "evidence_count": 10 - }, - "evidence_gate_input": { - "resolved_target": "src/app_runtime/control/http_app.py", - "sub_intent": "FIND_ENTRYPOINTS", - "target_type": "file", - "evidence_count": 10, - "code_chunk_count": 10, - "entrypoint_count": 3, - "relation_count": 0, - "test_evidence_count": 0, - "symbol_resolution_status": "not_found", - "path_scope": [] - }, - "post_evidence_gate": { - "input": { - "answer_mode": "normal", - "degraded_message": "", - "resolved_target": "src/app_runtime/control/http_app.py", - "draft_answer_preview": "Подтверждённая точка входа для health endpoint:\nGET /health, declared in src/app_runtime/control/http_app.py, lines 31-34, handler function named 'health'.", - "repair_candidate": true - }, - "output": { - "passed": true, - "action": "return", - "reasons": [], - "repair_used": false, - "final_answer_preview": "Подтверждённая точка входа для health endpoint:\nGET /health, declared in src/app_runtime/control/http_app.py, lines 31-34, handler function named 'health'." - } - }, - "failure_reasons": [], - "timings_ms": { - "router": 1, - "retrieval": 64, - "pre_evidence_gate": 1, - "llm": 1406, - "post_evidence_gate": 1 - } -} - -## Mismatches -- none \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/manual_run/20260312_193339/full_chain_plba_code_subintents_one_per_subintent_plba-v3-find-tests-runtime-manager.json b/tests/pipeline_setup_v3/test_results/manual_run/20260312_193339/full_chain_plba_code_subintents_one_per_subintent_plba-v3-find-tests-runtime-manager.json deleted file mode 100644 index 5e4a159..0000000 --- a/tests/pipeline_setup_v3/test_results/manual_run/20260312_193339/full_chain_plba_code_subintents_one_per_subintent_plba-v3-find-tests-runtime-manager.json +++ /dev/null @@ -1,3341 +0,0 @@ -{ - "case_id": "plba-v3-find-tests-runtime-manager", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_02_pipeline/full_chain_plba_code_subintents_one_per_subintent.yaml", - "runner": "agent_runtime", - "mode": "full_chain", - "query": "Где тесты для RuntimeManager?", - "actual": { - "intent": "CODE_QA", - "sub_intent": "FIND_TESTS", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 24, - "llm_answer": "Прямые тесты для `RuntimeManager` находятся в файле `tests/test_runtime.py`.\n\nКосвенные тесты:\n- В файле `tests/test_business_control_actions.py` есть тесты, использующие сущности контроля, которые взаимодействуют с `RuntimeManager`.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "RuntimeManager" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ] - }, - "passed": true, - "mismatches": [], - "details": { - "query": "Где тесты для RuntimeManager?", - "router_result": { - "schema_version": "1.1", - "intent": "CODE_QA", - "retrieval_profile": "code", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query_plan": { - "raw": "Где тесты для RuntimeManager?", - "normalized": "Где тесты для RuntimeManager?", - "sub_intent": "FIND_TESTS", - "negations": [], - "expansions": [ - "test", - "unit test", - "RuntimeManager" - ], - "keyword_hints": [ - "RuntimeManager" - ], - "path_hints": [], - "doc_scope_hints": [], - "symbol_candidates": [ - "RuntimeManager" - ], - "symbol_kind_hint": "class", - "anchors": [ - { - "type": "SYMBOL", - "value": "RuntimeManager", - "source": "user_text", - "subtype": null, - "span": { - "start": 14, - "end": 28 - }, - "confidence": 0.88 - }, - { - "type": "KEY_TERM", - "value": "тест", - "source": "user_text", - "subtype": null, - "span": { - "start": 4, - "end": 9 - }, - "confidence": 0.9 - } - ] - }, - "retrieval_spec": { - "domains": [ - "CODE" - ], - "layer_queries": [ - { - "layer_id": "C1_SYMBOL_CATALOG", - "top_k": 8 - }, - { - "layer_id": "C2_DEPENDENCY_GRAPH", - "top_k": 6 - }, - { - "layer_id": "C0_SOURCE_CHUNKS", - "top_k": 10 - } - ], - "filters": { - "test_policy": "INCLUDE", - "path_scope": [], - "language": [ - "python" - ] - }, - "rerank_profile": "code" - }, - "retrieval_constraints": { - "include_globs": [ - "src/**", - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "test_file_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "test_symbol_patterns": [ - "test_runtime_manager", - "TestRuntimeManager", - "RuntimeManager" - ], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - }, - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "RuntimeManager", - "alternatives": [ - "RuntimeManager", - "RuntimeManager", - "RuntimeManager", - "RuntimeManager", - "RuntimeManager" - ], - "confidence": 0.99 - }, - "evidence_policy": { - "require_def": true, - "require_flow": true, - "require_spec": false, - "allow_answer_without_evidence": false - } - }, - "retrieval_request": { - "rag_session_id": "7d11da21-faa0-4cea-aede-aeabe069164c", - "query": "Где тесты для RuntimeManager?", - "sub_intent": "FIND_TESTS", - "path_scope": [], - "keyword_hints": [ - "RuntimeManager" - ], - "symbol_candidates": [ - "RuntimeManager" - ], - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ], - "retrieval_spec": { - "domains": [ - "CODE" - ], - "layer_queries": [ - { - "layer_id": "C1_SYMBOL_CATALOG", - "top_k": 8 - }, - { - "layer_id": "C2_DEPENDENCY_GRAPH", - "top_k": 6 - }, - { - "layer_id": "C0_SOURCE_CHUNKS", - "top_k": 10 - } - ], - "filters": { - "test_policy": "INCLUDE", - "path_scope": [], - "language": [ - "python" - ] - }, - "rerank_profile": "code" - }, - "retrieval_constraints": { - "include_globs": [ - "src/**", - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "test_file_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "test_symbol_patterns": [ - "test_runtime_manager", - "TestRuntimeManager", - "RuntimeManager" - ], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - }, - "query_plan": { - "raw": "Где тесты для RuntimeManager?", - "normalized": "Где тесты для RuntimeManager?", - "sub_intent": "FIND_TESTS", - "negations": [], - "expansions": [ - "test", - "unit test", - "RuntimeManager" - ], - "keyword_hints": [ - "RuntimeManager" - ], - "path_hints": [], - "doc_scope_hints": [], - "symbol_candidates": [ - "RuntimeManager" - ], - "symbol_kind_hint": "class", - "anchors": [ - { - "type": "SYMBOL", - "value": "RuntimeManager", - "source": "user_text", - "subtype": null, - "span": { - "start": 14, - "end": 28 - }, - "confidence": 0.88 - }, - { - "type": "KEY_TERM", - "value": "тест", - "source": "user_text", - "subtype": null, - "span": { - "start": 4, - "end": 9 - }, - "confidence": 0.9 - } - ] - } - }, - "retrieval_result": { - "target_symbol_candidates": [ - "RuntimeManager", - "ControlPlaneService" - ], - "resolved_symbol": "RuntimeManager", - "symbol_resolution_status": "resolved", - "file_candidates": [ - "src/plba/bootstrap.py", - "tests/test_runtime.py", - "src/app_runtime/core/runtime.py", - "src/plba/__init__.py", - "src/plba/core.py", - "tests/test_business_control_actions.py", - "src/app_runtime/control/service.py", - "src/app_runtime/control/__init__.py", - "src/plba/control.py", - "src/app_runtime/control/http_channel.py", - "src/app_runtime/control/http_app.py", - "src/app_runtime/control/http_runner.py", - "src/app_runtime/control/base.py" - ], - "code_chunks": [ - { - "layer": "C1_SYMBOL_CATALOG", - "path": "src/plba/bootstrap.py", - "title": "RuntimeManager", - "content": "const RuntimeManager\nRuntimeManager = app_runtime.core.runtime.RuntimeManager", - "start_line": 4, - "end_line": 4, - "metadata": { - "symbol_id": "27158ca220022eeb5083c6addf8a50775d45f7161284fd60aac48410105f4b98", - "qname": "RuntimeManager", - "kind": "const", - "signature": "RuntimeManager = app_runtime.core.runtime.RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "src.plba.bootstrap", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C1_SYMBOL_CATALOG", - "path": "tests/test_runtime.py", - "title": "RuntimeManager", - "content": "const RuntimeManager\nRuntimeManager = app_runtime.core.runtime.RuntimeManager", - "start_line": 12, - "end_line": 12, - "metadata": { - "symbol_id": "aeadc039653807b0da1ca6e3cc1078ee61cfc510b28e7f9c2ec04c59da43cc8d", - "qname": "RuntimeManager", - "kind": "const", - "signature": "RuntimeManager = app_runtime.core.runtime.RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "tests.test_runtime", - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C1_SYMBOL_CATALOG", - "path": "src/app_runtime/core/runtime.py", - "title": "RuntimeManager", - "content": "class RuntimeManager\nRuntimeManager", - "start_line": 18, - "end_line": 179, - "metadata": { - "symbol_id": "7e4a9381328c5803bbc6179458612fc4e947d928aa7bf8b4b2bebb2c8592f758", - "qname": "RuntimeManager", - "kind": "class", - "signature": "RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.core.runtime", - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C1_SYMBOL_CATALOG", - "path": "src/plba/__init__.py", - "title": "RuntimeManager", - "content": "const RuntimeManager\nRuntimeManager = plba.core.RuntimeManager", - "start_line": 16, - "end_line": 16, - "metadata": { - "symbol_id": "7eacec84f9b8d6c4201374591faecdac7493091c263681495c338973f2971ad9", - "qname": "RuntimeManager", - "kind": "const", - "signature": "RuntimeManager = plba.core.RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "src.plba.__init__", - "is_test": false, - "blob_sha": "24e755ec8c249d14fb0e675b5dbf2b71ab91afb9c849897eebfa9feb2499e19d", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C1_SYMBOL_CATALOG", - "path": "src/plba/core.py", - "title": "RuntimeManager", - "content": "const RuntimeManager\nRuntimeManager = app_runtime.core.runtime.RuntimeManager", - "start_line": 2, - "end_line": 2, - "metadata": { - "symbol_id": "e1684562d978b7af7fe9b27dc5869d770348a87b5dc19a50360f58544668578b", - "qname": "RuntimeManager", - "kind": "const", - "signature": "RuntimeManager = app_runtime.core.runtime.RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "src.plba.core", - "is_test": false, - "blob_sha": "c0ae25110d20e665216616e26b68adfe035b624ba45d31d1272fb21f906f9ca8", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C1_SYMBOL_CATALOG", - "path": "tests/test_business_control_actions.py", - "title": "RuntimeManager", - "content": "const RuntimeManager\nRuntimeManager = app_runtime.core.runtime.RuntimeManager", - "start_line": 14, - "end_line": 14, - "metadata": { - "symbol_id": "a1572ea8183dc0cd6ddbc74342bbde8c28cecfde37ad40b62feff09f8d103d11", - "qname": "RuntimeManager", - "kind": "const", - "signature": "RuntimeManager = app_runtime.core.runtime.RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C1_SYMBOL_CATALOG", - "path": "src/app_runtime/control/service.py", - "title": "RuntimeManager", - "content": "const RuntimeManager\nRuntimeManager = app_runtime.core.runtime.RuntimeManager", - "start_line": 9, - "end_line": 9, - "metadata": { - "symbol_id": "62a9575c77aad894120d18b4f2a08cf2ba42f77e9be4a8a432b767d157701afe", - "qname": "RuntimeManager", - "kind": "const", - "signature": "RuntimeManager = app_runtime.core.runtime.RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.control.service", - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C1_SYMBOL_CATALOG", - "path": "src/app_runtime/control/__init__.py", - "title": "ControlPlaneService", - "content": "const ControlPlaneService\nControlPlaneService = app_runtime.control.service.ControlPlaneService", - "start_line": 3, - "end_line": 3, - "metadata": { - "symbol_id": "217e8f044d1c01644bf7b81e5046af9e84469210c692a2fb0c476a19bb069ae1", - "qname": "ControlPlaneService", - "kind": "const", - "signature": "ControlPlaneService = app_runtime.control.service.ControlPlaneService", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.control.__init__", - "is_test": false, - "blob_sha": "bf3c37e3369a84cc618adc0fd71c232e5eb4b871eaff743069a17e661e498316", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "path": "src/app_runtime/control/service.py", - "title": "ControlPlaneService.__init__:dataflow_slice", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.stop", - "start_line": 14, - "end_line": 25, - "metadata": { - "edge_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d", - "dst_ref": "ControlPlaneService.stop", - "resolution": "resolved", - "slice_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.stop" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "path": "src/app_runtime/control/service.py", - "title": "ControlPlaneService.__init__:dataflow_slice", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._stop_async", - "start_line": 14, - "end_line": 51, - "metadata": { - "edge_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a", - "dst_ref": "ControlPlaneService._stop_async", - "resolution": "resolved", - "slice_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._stop_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "path": "src/app_runtime/control/service.py", - "title": "ControlPlaneService.__init__:dataflow_slice", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.register_channel", - "start_line": 14, - "end_line": 17, - "metadata": { - "edge_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957", - "dst_ref": "ControlPlaneService.register_channel", - "resolution": "resolved", - "slice_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.register_channel" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "path": "src/app_runtime/control/service.py", - "title": "ControlPlaneService.__init__:dataflow_slice", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.start", - "start_line": 14, - "end_line": 20, - "metadata": { - "edge_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154", - "dst_ref": "ControlPlaneService.start", - "resolution": "resolved", - "slice_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.start" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "path": "src/app_runtime/control/service.py", - "title": "ControlPlaneService.__init__:dataflow_slice", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._start_async", - "start_line": 14, - "end_line": 47, - "metadata": { - "edge_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517", - "dst_ref": "ControlPlaneService._start_async", - "resolution": "resolved", - "slice_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._start_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "path": "src/app_runtime/core/runtime.py", - "title": "RuntimeManager.__init__:dataflow_slice", - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager.add_config_file", - "start_line": 32, - "end_line": 52, - "metadata": { - "edge_id": "a23b8a11ebdb12708b60c96ea12a69f7f042082f1adfddd572444e246d81d167", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "57ffbd4f0d9fdf3507c2b8624312ce211f3d02fdf86a57a8ec90778d8a7b498d", - "dst_ref": "RuntimeManager.add_config_file", - "resolution": "resolved", - "slice_id": "a23b8a11ebdb12708b60c96ea12a69f7f042082f1adfddd572444e246d81d167", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager.add_config_file" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "57ffbd4f0d9fdf3507c2b8624312ce211f3d02fdf86a57a8ec90778d8a7b498d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C0_SOURCE_CHUNKS", - "path": "src/plba/control.py", - "title": "src/plba/control.py:1-10", - "content": "from app_runtime.control.base import ControlActionSet, ControlChannel\nfrom app_runtime.control.http_channel import HttpControlChannel\nfrom app_runtime.control.service import ControlPlaneService\n\n__all__ = [\n \"ControlActionSet\",\n \"ControlChannel\",\n \"ControlPlaneService\",\n \"HttpControlChannel\",\n]", - "start_line": 1, - "end_line": 10, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.plba.control", - "is_test": false, - "blob_sha": "31bd5c4481bfa7fbca8fae56d4860a67e3953ca74474ac8439e1f39b685d7bc8", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C0_SOURCE_CHUNKS", - "path": "tests/test_business_control_actions.py", - "title": "tests/test_business_control_actions.py:IntervalRoutine", - "content": "class IntervalRoutine:\n calls: list[float] = field(default_factory=list)\n _lock: Lock = field(default_factory=Lock)\n\n def run(self) -> None:\n with self._lock:\n self.calls.append(monotonic())\n\n def wait_runs(self, count: int, timeout: float) -> bool:\n deadline = monotonic() + timeout\n while monotonic() < deadline:\n with self._lock:\n if len(self.calls) >= count:\n return True\n sleep(0.01)\n return False\n\n def deltas(self) -> list[float]:\n with self._lock:\n return [self.calls[index + 1] - self.calls[index] for index in range(len(self.calls) - 1)]", - "start_line": 18, - "end_line": 37, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C0_SOURCE_CHUNKS", - "path": "src/app_runtime/control/http_channel.py", - "title": "src/app_runtime/control/http_channel.py:HttpControlChannel", - "content": "class HttpControlChannel(ControlChannel):\n def __init__(self, host: str, port: int, timeout: int) -> None:\n self._timeout = timeout\n self._runner = UvicornThreadRunner(host, port, timeout)\n self._factory = HttpControlAppFactory()\n self._actions: ControlActionSet | None = None\n\n async def start(self, actions: ControlActionSet) -> None:\n self._actions = actions\n app = self._factory.create(self._health_response, self._action_response)\n await self._runner.start(app)\n\n async def stop(self) -> None:\n await self._runner.stop()\n\n @property\n def port(self) -> int:\n return self._runner.port\n\n async def _health_response(self) -> dict[str, object]:\n if self._actions is None:\n return {\"status\": \"unhealthy\", \"detail\": \"control actions are not configured\"}\n return await asyncio.wait_for(self._actions.health(), timeout=float(self._timeout))\n\n async def _action_response(self, action: str, _client_source: str = \"unknown\") -> JSONResponse:\n if self._actions is None:\n return JSONResponse(content={\"status\": \"error\", \"detail\": f\"{action} handler is not configured\"}, status_code=404)\n callbacks = {\n \"start\": self._actions.start,\n \"stop\": self._actions.stop,\n \"status\": self._actions.status,\n }\n callback = callbacks.get(action)\n if callback is None:\n return JSONResponse(content={\"status\": \"error\", \"detail\": f\"unsupported action: {action}\"}, status_code=404)\n action_timeout = max(float(self._timeout), 10.0) if action in {\"start\", \"stop\"} else float(self._timeout)\n try:\n detail = await asyncio.wait_for(callback(), timeout=action_timeout)\n except asyncio.TimeoutError:\n return JSONResponse(\n content={\"status\": \"accepted\", \"detail\": f\"{action} operation is still in progress\"},\n status_code=202,\n )\n except Exception as exc:\n return JSONResponse(content={\"status\": \"error\", \"detail\": str(exc)}, status_code=500)\n return JSONResponse(content={\"status\": \"ok\", \"detail\": detail or f\"{action} action accepted\"}, status_code=200)", - "start_line": 12, - "end_line": 57, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.http_channel", - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C0_SOURCE_CHUNKS", - "path": "src/app_runtime/control/http_app.py", - "title": "src/app_runtime/control/http_app.py:HttpControlAppFactory", - "content": "class HttpControlAppFactory:\n def create(\n self,\n health_provider: Callable[[], Awaitable[HealthPayload]],\n action_provider: Callable[[str, str], Awaitable[JSONResponse]],\n ) -> FastAPI:\n app = FastAPI(title=\"PLBA Control API\")\n\n @app.middleware(\"http\")\n async def log_api_call(request: Request, call_next): # type: ignore[no-untyped-def]\n started = time.monotonic()\n response = await call_next(request)\n response.headers[\"X-Response-Time-Ms\"] = str(int((time.monotonic() - started) * 1000))\n return response\n\n @app.get(\"/health\")\n async def health() -> JSONResponse:\n payload = await health_provider()\n status_code = 200 if payload.get(\"status\") == \"ok\" else 503\n return JSONResponse(content=payload, status_code=status_code)\n\n @app.get(\"/actions/{action}\")\n @app.post(\"/actions/{action}\")\n async def action(action: str, request: Request) -> JSONResponse:\n client_source = self._client_source(request)\n if action in {\"start\", \"stop\"}:\n LOGGER.warning(\"Control action requested: /actions/%s client=%s\", action, client_source)\n return await action_provider(action, client_source)\n\n return app\n\n def _client_source(self, request: Request) -> str:\n explicit_header = request.headers.get(\"X-Client-Source\", \"\").strip()\n if explicit_header:\n return explicit_header\n user_agent = request.headers.get(\"User-Agent\", \"\").strip()\n if user_agent:\n return f\"user-agent:{user_agent}\"\n return \"unknown\"", - "start_line": 15, - "end_line": 53, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.http_app", - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C0_SOURCE_CHUNKS", - "path": "src/app_runtime/control/http_runner.py", - "title": "src/app_runtime/control/http_runner.py:UvicornThreadRunner", - "content": "class UvicornThreadRunner:\n def __init__(self, host: str, port: int, timeout: int) -> None:\n self._host = host\n self._port = port\n self._timeout = timeout\n self._server: Server | None = None\n self._thread: Thread | None = None\n self._error: BaseException | None = None\n\n async def start(self, app: FastAPI) -> None:\n if self._thread is not None and self._thread.is_alive():\n return\n self._error = None\n config = Config(app=app, host=self._host, port=self._port, log_level=\"warning\")\n self._server = Server(config)\n self._thread = Thread(target=self._serve, name=\"plba-http-control\", daemon=True)\n self._thread.start()\n await self._wait_until_started()\n\n async def stop(self) -> None:\n if self._server is None or self._thread is None:\n return\n self._server.should_exit = True\n await asyncio.to_thread(self._thread.join, self._timeout)\n self._server = None\n self._thread = None\n\n @property\n def port(self) -> int:\n if self._server is None or not getattr(self._server, \"servers\", None):\n return self._port\n socket = self._server.servers[0].sockets[0]\n return int(socket.getsockname()[1])\n\n async def _wait_until_started(self) -> None:\n if self._server is None:\n raise RuntimeError(\"Server is not initialized\")\n deadline = asyncio.get_running_loop().time() + max(float(self._timeout), 1.0)\n while not self._server.started:\n if self._error is not None:\n raise RuntimeError(\"HTTP control server failed to start\") from self._error\n if asyncio.get_running_loop().time() >= deadline:\n raise TimeoutError(\"HTTP control server startup timed out\")\n await asyncio.sleep(0.05)\n\n def _serve(self) -> None:\n if self._server is None:\n return\n try:\n asyncio.run(self._server.serve())\n except BaseException as exc: # noqa: BLE001\n self._error = exc", - "start_line": 10, - "end_line": 61, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.http_runner", - "is_test": false, - "blob_sha": "3779fdd2878b770e789a35bb2a89c9d79f13b61c26d7db1b3b683f9bb9e1623f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C0_SOURCE_CHUNKS", - "path": "src/app_runtime/control/service.py", - "title": "src/app_runtime/control/service.py:ControlPlaneService", - "content": "class ControlPlaneService:\n def __init__(self) -> None:\n self._channels: list[ControlChannel] = []\n\n def register_channel(self, channel: ControlChannel) -> None:\n self._channels.append(channel)\n\n def start(self, runtime: RuntimeManager) -> None:\n if not self._channels:\n return\n asyncio.run(self._start_async(runtime))\n\n def stop(self) -> None:\n if not self._channels:\n return\n asyncio.run(self._stop_async())\n\n def snapshot(self, runtime: RuntimeManager) -> dict[str, object]:\n health = runtime.current_health()\n return {\n \"runtime\": {\"state\": runtime._state.value},\n \"modules\": list(runtime.registry.modules),\n \"services\": runtime.services.snapshot(),\n \"workers\": runtime.workers.snapshot(),\n \"health\": runtime.health.snapshot(runtime.workers.healths()) | {\"status\": health[\"status\"]},\n \"config\": runtime.configuration.get(),\n }\n\n async def _start_async(self, runtime: RuntimeManager) -> None:\n actions = ControlActionSet(\n health=runtime.health_status,\n start=runtime.start_runtime,\n stop=runtime.stop_runtime,\n status=runtime.runtime_status,\n )\n for channel in self._channels:\n await channel.start(actions)\n\n async def _stop_async(self) -> None:\n for channel in reversed(self._channels):\n await channel.stop()", - "start_line": 12, - "end_line": 52, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.service", - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C0_SOURCE_CHUNKS", - "path": "src/app_runtime/control/base.py", - "title": "src/app_runtime/control/base.py:ControlActionSet", - "content": "class ControlActionSet:\n health: HealthHandler\n start: ActionHandler\n stop: ActionHandler\n status: ActionHandler", - "start_line": 14, - "end_line": 18, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.base", - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C0_SOURCE_CHUNKS", - "path": "src/app_runtime/control/__init__.py", - "title": "src/app_runtime/control/__init__.py:1-5", - "content": "from app_runtime.control.base import ControlActionSet, ControlChannel\nfrom app_runtime.control.http_channel import HttpControlChannel\nfrom app_runtime.control.service import ControlPlaneService\n\n__all__ = [\"ControlActionSet\", \"ControlChannel\", \"ControlPlaneService\", \"HttpControlChannel\"]", - "start_line": 1, - "end_line": 5, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.app_runtime.control.__init__", - "is_test": false, - "blob_sha": "bf3c37e3369a84cc618adc0fd71c232e5eb4b871eaff743069a17e661e498316", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C0_SOURCE_CHUNKS", - "path": "src/app_runtime/control/base.py", - "title": "src/app_runtime/control/base.py:ControlChannel", - "content": "class ControlChannel(ABC):\n @abstractmethod\n async def start(self, actions: ControlActionSet) -> None:\n \"\"\"Start the control channel and bind handlers.\"\"\"\n\n @abstractmethod\n async def stop(self) -> None:\n \"\"\"Stop the control channel and release resources.\"\"\"", - "start_line": 21, - "end_line": 28, - "metadata": { - "chunk_index": 1, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.base", - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C0_SOURCE_CHUNKS", - "path": "tests/test_business_control_actions.py", - "title": "tests/test_business_control_actions.py:BlockingRoutine", - "content": "class BlockingRoutine:\n def __init__(self, started: Event, release: Event) -> None:\n self._started = started\n self._release = release\n\n def run(self) -> None:\n self._started.set()\n self._release.wait(timeout=5.0)", - "start_line": 40, - "end_line": 47, - "metadata": { - "chunk_index": 1, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "relations": [ - { - "path": "src/app_runtime/control/service.py", - "start_line": 14, - "end_line": 25, - "edge_type": "dataflow_slice", - "source": "ControlPlaneService.__init__", - "target": "ControlPlaneService.stop", - "metadata": { - "edge_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d", - "dst_ref": "ControlPlaneService.stop", - "resolution": "resolved", - "slice_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.stop" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - }, - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.stop" - }, - { - "path": "src/app_runtime/control/service.py", - "start_line": 14, - "end_line": 51, - "edge_type": "dataflow_slice", - "source": "ControlPlaneService.__init__", - "target": "ControlPlaneService._stop_async", - "metadata": { - "edge_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a", - "dst_ref": "ControlPlaneService._stop_async", - "resolution": "resolved", - "slice_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._stop_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - }, - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._stop_async" - }, - { - "path": "src/app_runtime/control/service.py", - "start_line": 14, - "end_line": 17, - "edge_type": "dataflow_slice", - "source": "ControlPlaneService.__init__", - "target": "ControlPlaneService.register_channel", - "metadata": { - "edge_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957", - "dst_ref": "ControlPlaneService.register_channel", - "resolution": "resolved", - "slice_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.register_channel" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - }, - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.register_channel" - }, - { - "path": "src/app_runtime/control/service.py", - "start_line": 14, - "end_line": 20, - "edge_type": "dataflow_slice", - "source": "ControlPlaneService.__init__", - "target": "ControlPlaneService.start", - "metadata": { - "edge_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154", - "dst_ref": "ControlPlaneService.start", - "resolution": "resolved", - "slice_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.start" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - }, - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.start" - }, - { - "path": "src/app_runtime/control/service.py", - "start_line": 14, - "end_line": 47, - "edge_type": "dataflow_slice", - "source": "ControlPlaneService.__init__", - "target": "ControlPlaneService._start_async", - "metadata": { - "edge_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517", - "dst_ref": "ControlPlaneService._start_async", - "resolution": "resolved", - "slice_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._start_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - }, - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._start_async" - }, - { - "path": "src/app_runtime/core/runtime.py", - "start_line": 32, - "end_line": 52, - "edge_type": "dataflow_slice", - "source": "RuntimeManager.__init__", - "target": "RuntimeManager.add_config_file", - "metadata": { - "edge_id": "a23b8a11ebdb12708b60c96ea12a69f7f042082f1adfddd572444e246d81d167", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "57ffbd4f0d9fdf3507c2b8624312ce211f3d02fdf86a57a8ec90778d8a7b498d", - "dst_ref": "RuntimeManager.add_config_file", - "resolution": "resolved", - "slice_id": "a23b8a11ebdb12708b60c96ea12a69f7f042082f1adfddd572444e246d81d167", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager.add_config_file" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "57ffbd4f0d9fdf3507c2b8624312ce211f3d02fdf86a57a8ec90778d8a7b498d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - }, - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager.add_config_file" - } - ], - "semantic_hints": [], - "entrypoints": [], - "test_candidates": [ - { - "path": "tests/test_business_control_actions.py", - "title": "tests/test_business_control_actions.py:IntervalRoutine", - "content": "class IntervalRoutine:\n calls: list[float] = field(default_factory=list)\n _lock: Lock = field(default_factory=Lock)\n\n def run(self) -> None:\n with self._lock:\n self.calls.append(monotonic())\n\n def wait_runs(self, count: int, timeout: float) -> bool:\n deadline = m" - }, - { - "path": "tests/test_business_control_actions.py", - "title": "tests/test_business_control_actions.py:BlockingRoutine", - "content": "class BlockingRoutine:\n def __init__(self, started: Event, release: Event) -> None:\n self._started = started\n self._release = release\n\n def run(self) -> None:\n self._started.set()\n self._release.wait(timeout=5.0)" - } - ], - "layer_outcomes": [ - { - "layer_id": "C1_SYMBOL_CATALOG", - "hit_count": 8, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C2_DEPENDENCY_GRAPH", - "hit_count": 6, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C0_SOURCE_CHUNKS", - "hit_count": 10, - "empty": false, - "fallback_used": false - } - ], - "missing_layers": [], - "raw_rows": [ - { - "path": "src/plba/bootstrap.py", - "content": "const RuntimeManager\nRuntimeManager = app_runtime.core.runtime.RuntimeManager", - "layer": "C1_SYMBOL_CATALOG", - "title": "RuntimeManager", - "span_start": 4, - "span_end": 4, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": null, - "metadata": { - "symbol_id": "27158ca220022eeb5083c6addf8a50775d45f7161284fd60aac48410105f4b98", - "qname": "RuntimeManager", - "kind": "const", - "signature": "RuntimeManager = app_runtime.core.runtime.RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "src.plba.bootstrap", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_runtime.py", - "content": "const RuntimeManager\nRuntimeManager = app_runtime.core.runtime.RuntimeManager", - "layer": "C1_SYMBOL_CATALOG", - "title": "RuntimeManager", - "span_start": 12, - "span_end": 12, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": null, - "metadata": { - "symbol_id": "aeadc039653807b0da1ca6e3cc1078ee61cfc510b28e7f9c2ec04c59da43cc8d", - "qname": "RuntimeManager", - "kind": "const", - "signature": "RuntimeManager = app_runtime.core.runtime.RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "tests.test_runtime", - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "class RuntimeManager\nRuntimeManager", - "layer": "C1_SYMBOL_CATALOG", - "title": "RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": null, - "metadata": { - "symbol_id": "7e4a9381328c5803bbc6179458612fc4e947d928aa7bf8b4b2bebb2c8592f758", - "qname": "RuntimeManager", - "kind": "class", - "signature": "RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.core.runtime", - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/__init__.py", - "content": "const RuntimeManager\nRuntimeManager = plba.core.RuntimeManager", - "layer": "C1_SYMBOL_CATALOG", - "title": "RuntimeManager", - "span_start": 16, - "span_end": 16, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": null, - "metadata": { - "symbol_id": "7eacec84f9b8d6c4201374591faecdac7493091c263681495c338973f2971ad9", - "qname": "RuntimeManager", - "kind": "const", - "signature": "RuntimeManager = plba.core.RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "src.plba.__init__", - "is_test": false, - "blob_sha": "24e755ec8c249d14fb0e675b5dbf2b71ab91afb9c849897eebfa9feb2499e19d", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/core.py", - "content": "const RuntimeManager\nRuntimeManager = app_runtime.core.runtime.RuntimeManager", - "layer": "C1_SYMBOL_CATALOG", - "title": "RuntimeManager", - "span_start": 2, - "span_end": 2, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": null, - "metadata": { - "symbol_id": "e1684562d978b7af7fe9b27dc5869d770348a87b5dc19a50360f58544668578b", - "qname": "RuntimeManager", - "kind": "const", - "signature": "RuntimeManager = app_runtime.core.runtime.RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "src.plba.core", - "is_test": false, - "blob_sha": "c0ae25110d20e665216616e26b68adfe035b624ba45d31d1272fb21f906f9ca8", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "const RuntimeManager\nRuntimeManager = app_runtime.core.runtime.RuntimeManager", - "layer": "C1_SYMBOL_CATALOG", - "title": "RuntimeManager", - "span_start": 14, - "span_end": 14, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": null, - "metadata": { - "symbol_id": "a1572ea8183dc0cd6ddbc74342bbde8c28cecfde37ad40b62feff09f8d103d11", - "qname": "RuntimeManager", - "kind": "const", - "signature": "RuntimeManager = app_runtime.core.runtime.RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "const RuntimeManager\nRuntimeManager = app_runtime.core.runtime.RuntimeManager", - "layer": "C1_SYMBOL_CATALOG", - "title": "RuntimeManager", - "span_start": 9, - "span_end": 9, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": null, - "metadata": { - "symbol_id": "62a9575c77aad894120d18b4f2a08cf2ba42f77e9be4a8a432b767d157701afe", - "qname": "RuntimeManager", - "kind": "const", - "signature": "RuntimeManager = app_runtime.core.runtime.RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.control.service", - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/__init__.py", - "content": "const ControlPlaneService\nControlPlaneService = app_runtime.control.service.ControlPlaneService", - "layer": "C1_SYMBOL_CATALOG", - "title": "ControlPlaneService", - "span_start": 3, - "span_end": 3, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": null, - "metadata": { - "symbol_id": "217e8f044d1c01644bf7b81e5046af9e84469210c692a2fb0c476a19bb069ae1", - "qname": "ControlPlaneService", - "kind": "const", - "signature": "ControlPlaneService = app_runtime.control.service.ControlPlaneService", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.control.__init__", - "is_test": false, - "blob_sha": "bf3c37e3369a84cc618adc0fd71c232e5eb4b871eaff743069a17e661e498316", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.stop", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 25, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": null, - "metadata": { - "edge_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d", - "dst_ref": "ControlPlaneService.stop", - "resolution": "resolved", - "slice_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.stop" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._stop_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 51, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": null, - "metadata": { - "edge_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a", - "dst_ref": "ControlPlaneService._stop_async", - "resolution": "resolved", - "slice_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._stop_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.register_channel", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 17, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": null, - "metadata": { - "edge_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957", - "dst_ref": "ControlPlaneService.register_channel", - "resolution": "resolved", - "slice_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.register_channel" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.start", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 20, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": null, - "metadata": { - "edge_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154", - "dst_ref": "ControlPlaneService.start", - "resolution": "resolved", - "slice_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.start" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._start_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 47, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": null, - "metadata": { - "edge_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517", - "dst_ref": "ControlPlaneService._start_async", - "resolution": "resolved", - "slice_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._start_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager.add_config_file", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 32, - "span_end": 52, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": null, - "metadata": { - "edge_id": "a23b8a11ebdb12708b60c96ea12a69f7f042082f1adfddd572444e246d81d167", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "57ffbd4f0d9fdf3507c2b8624312ce211f3d02fdf86a57a8ec90778d8a7b498d", - "dst_ref": "RuntimeManager.add_config_file", - "resolution": "resolved", - "slice_id": "a23b8a11ebdb12708b60c96ea12a69f7f042082f1adfddd572444e246d81d167", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager.add_config_file" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "57ffbd4f0d9fdf3507c2b8624312ce211f3d02fdf86a57a8ec90778d8a7b498d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/control.py", - "content": "from app_runtime.control.base import ControlActionSet, ControlChannel\nfrom app_runtime.control.http_channel import HttpControlChannel\nfrom app_runtime.control.service import ControlPlaneService\n\n__all__ = [\n \"ControlActionSet\",\n \"ControlChannel\",\n \"ControlPlaneService\",\n \"HttpControlChannel\",\n]", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/plba/control.py:1-10", - "span_start": 1, - "span_end": 10, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": null, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.plba.control", - "is_test": false, - "blob_sha": "31bd5c4481bfa7fbca8fae56d4860a67e3953ca74474ac8439e1f39b685d7bc8", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "class IntervalRoutine:\n calls: list[float] = field(default_factory=list)\n _lock: Lock = field(default_factory=Lock)\n\n def run(self) -> None:\n with self._lock:\n self.calls.append(monotonic())\n\n def wait_runs(self, count: int, timeout: float) -> bool:\n deadline = monotonic() + timeout\n while monotonic() < deadline:\n with self._lock:\n if len(self.calls) >= count:\n return True\n sleep(0.01)\n return False\n\n def deltas(self) -> list[float]:\n with self._lock:\n return [self.calls[index + 1] - self.calls[index] for index in range(len(self.calls) - 1)]", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:IntervalRoutine", - "span_start": 18, - "span_end": 37, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": null, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "class HttpControlChannel(ControlChannel):\n def __init__(self, host: str, port: int, timeout: int) -> None:\n self._timeout = timeout\n self._runner = UvicornThreadRunner(host, port, timeout)\n self._factory = HttpControlAppFactory()\n self._actions: ControlActionSet | None = None\n\n async def start(self, actions: ControlActionSet) -> None:\n self._actions = actions\n app = self._factory.create(self._health_response, self._action_response)\n await self._runner.start(app)\n\n async def stop(self) -> None:\n await self._runner.stop()\n\n @property\n def port(self) -> int:\n return self._runner.port\n\n async def _health_response(self) -> dict[str, object]:\n if self._actions is None:\n return {\"status\": \"unhealthy\", \"detail\": \"control actions are not configured\"}\n return await asyncio.wait_for(self._actions.health(), timeout=float(self._timeout))\n\n async def _action_response(self, action: str, _client_source: str = \"unknown\") -> JSONResponse:\n if self._actions is None:\n return JSONResponse(content={\"status\": \"error\", \"detail\": f\"{action} handler is not configured\"}, status_code=404)\n callbacks = {\n \"start\": self._actions.start,\n \"stop\": self._actions.stop,\n \"status\": self._actions.status,\n }\n callback = callbacks.get(action)\n if callback is None:\n return JSONResponse(content={\"status\": \"error\", \"detail\": f\"unsupported action: {action}\"}, status_code=404)\n action_timeout = max(float(self._timeout), 10.0) if action in {\"start\", \"stop\"} else float(self._timeout)\n try:\n detail = await asyncio.wait_for(callback(), timeout=action_timeout)\n except asyncio.TimeoutError:\n return JSONResponse(\n content={\"status\": \"accepted\", \"detail\": f\"{action} operation is still in progress\"},\n status_code=202,\n )\n except Exception as exc:\n return JSONResponse(content={\"status\": \"error\", \"detail\": str(exc)}, status_code=500)\n return JSONResponse(content={\"status\": \"ok\", \"detail\": detail or f\"{action} action accepted\"}, status_code=200)", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/http_channel.py:HttpControlChannel", - "span_start": 12, - "span_end": 57, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": null, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.http_channel", - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "class HttpControlAppFactory:\n def create(\n self,\n health_provider: Callable[[], Awaitable[HealthPayload]],\n action_provider: Callable[[str, str], Awaitable[JSONResponse]],\n ) -> FastAPI:\n app = FastAPI(title=\"PLBA Control API\")\n\n @app.middleware(\"http\")\n async def log_api_call(request: Request, call_next): # type: ignore[no-untyped-def]\n started = time.monotonic()\n response = await call_next(request)\n response.headers[\"X-Response-Time-Ms\"] = str(int((time.monotonic() - started) * 1000))\n return response\n\n @app.get(\"/health\")\n async def health() -> JSONResponse:\n payload = await health_provider()\n status_code = 200 if payload.get(\"status\") == \"ok\" else 503\n return JSONResponse(content=payload, status_code=status_code)\n\n @app.get(\"/actions/{action}\")\n @app.post(\"/actions/{action}\")\n async def action(action: str, request: Request) -> JSONResponse:\n client_source = self._client_source(request)\n if action in {\"start\", \"stop\"}:\n LOGGER.warning(\"Control action requested: /actions/%s client=%s\", action, client_source)\n return await action_provider(action, client_source)\n\n return app\n\n def _client_source(self, request: Request) -> str:\n explicit_header = request.headers.get(\"X-Client-Source\", \"\").strip()\n if explicit_header:\n return explicit_header\n user_agent = request.headers.get(\"User-Agent\", \"\").strip()\n if user_agent:\n return f\"user-agent:{user_agent}\"\n return \"unknown\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/http_app.py:HttpControlAppFactory", - "span_start": 15, - "span_end": 53, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": null, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.http_app", - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_runner.py", - "content": "class UvicornThreadRunner:\n def __init__(self, host: str, port: int, timeout: int) -> None:\n self._host = host\n self._port = port\n self._timeout = timeout\n self._server: Server | None = None\n self._thread: Thread | None = None\n self._error: BaseException | None = None\n\n async def start(self, app: FastAPI) -> None:\n if self._thread is not None and self._thread.is_alive():\n return\n self._error = None\n config = Config(app=app, host=self._host, port=self._port, log_level=\"warning\")\n self._server = Server(config)\n self._thread = Thread(target=self._serve, name=\"plba-http-control\", daemon=True)\n self._thread.start()\n await self._wait_until_started()\n\n async def stop(self) -> None:\n if self._server is None or self._thread is None:\n return\n self._server.should_exit = True\n await asyncio.to_thread(self._thread.join, self._timeout)\n self._server = None\n self._thread = None\n\n @property\n def port(self) -> int:\n if self._server is None or not getattr(self._server, \"servers\", None):\n return self._port\n socket = self._server.servers[0].sockets[0]\n return int(socket.getsockname()[1])\n\n async def _wait_until_started(self) -> None:\n if self._server is None:\n raise RuntimeError(\"Server is not initialized\")\n deadline = asyncio.get_running_loop().time() + max(float(self._timeout), 1.0)\n while not self._server.started:\n if self._error is not None:\n raise RuntimeError(\"HTTP control server failed to start\") from self._error\n if asyncio.get_running_loop().time() >= deadline:\n raise TimeoutError(\"HTTP control server startup timed out\")\n await asyncio.sleep(0.05)\n\n def _serve(self) -> None:\n if self._server is None:\n return\n try:\n asyncio.run(self._server.serve())\n except BaseException as exc: # noqa: BLE001\n self._error = exc", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/http_runner.py:UvicornThreadRunner", - "span_start": 10, - "span_end": 61, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": null, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.http_runner", - "is_test": false, - "blob_sha": "3779fdd2878b770e789a35bb2a89c9d79f13b61c26d7db1b3b683f9bb9e1623f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "class ControlPlaneService:\n def __init__(self) -> None:\n self._channels: list[ControlChannel] = []\n\n def register_channel(self, channel: ControlChannel) -> None:\n self._channels.append(channel)\n\n def start(self, runtime: RuntimeManager) -> None:\n if not self._channels:\n return\n asyncio.run(self._start_async(runtime))\n\n def stop(self) -> None:\n if not self._channels:\n return\n asyncio.run(self._stop_async())\n\n def snapshot(self, runtime: RuntimeManager) -> dict[str, object]:\n health = runtime.current_health()\n return {\n \"runtime\": {\"state\": runtime._state.value},\n \"modules\": list(runtime.registry.modules),\n \"services\": runtime.services.snapshot(),\n \"workers\": runtime.workers.snapshot(),\n \"health\": runtime.health.snapshot(runtime.workers.healths()) | {\"status\": health[\"status\"]},\n \"config\": runtime.configuration.get(),\n }\n\n async def _start_async(self, runtime: RuntimeManager) -> None:\n actions = ControlActionSet(\n health=runtime.health_status,\n start=runtime.start_runtime,\n stop=runtime.stop_runtime,\n status=runtime.runtime_status,\n )\n for channel in self._channels:\n await channel.start(actions)\n\n async def _stop_async(self) -> None:\n for channel in reversed(self._channels):\n await channel.stop()", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/service.py:ControlPlaneService", - "span_start": 12, - "span_end": 52, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": null, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.service", - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "class ControlActionSet:\n health: HealthHandler\n start: ActionHandler\n stop: ActionHandler\n status: ActionHandler", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/base.py:ControlActionSet", - "span_start": 14, - "span_end": 18, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": null, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.base", - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/__init__.py", - "content": "from app_runtime.control.base import ControlActionSet, ControlChannel\nfrom app_runtime.control.http_channel import HttpControlChannel\nfrom app_runtime.control.service import ControlPlaneService\n\n__all__ = [\"ControlActionSet\", \"ControlChannel\", \"ControlPlaneService\", \"HttpControlChannel\"]", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/__init__.py:1-5", - "span_start": 1, - "span_end": 5, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": null, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.app_runtime.control.__init__", - "is_test": false, - "blob_sha": "bf3c37e3369a84cc618adc0fd71c232e5eb4b871eaff743069a17e661e498316", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "class ControlChannel(ABC):\n @abstractmethod\n async def start(self, actions: ControlActionSet) -> None:\n \"\"\"Start the control channel and bind handlers.\"\"\"\n\n @abstractmethod\n async def stop(self) -> None:\n \"\"\"Stop the control channel and release resources.\"\"\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/base.py:ControlChannel", - "span_start": 21, - "span_end": 28, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": null, - "metadata": { - "chunk_index": 1, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.base", - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "class BlockingRoutine:\n def __init__(self, started: Event, release: Event) -> None:\n self._started = started\n self._release = release\n\n def run(self) -> None:\n self._started.set()\n self._release.wait(timeout=5.0)", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:BlockingRoutine", - "span_start": 40, - "span_end": 47, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": null, - "metadata": { - "chunk_index": 1, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "retrieval_report": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "vector", - "C2_DEPENDENCY_GRAPH": "vector", - "C0_SOURCE_CHUNKS": "vector" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C0_SOURCE_CHUNKS": 10 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [] - } - }, - "fallback": { - "used": false, - "reason": null - }, - "retrieval_by_layer_ms": { - "C1_SYMBOL_CATALOG": 50, - "C2_DEPENDENCY_GRAPH": 59, - "C0_SOURCE_CHUNKS": 22 - } - } - }, - "diagnostics": { - "intent_correct": null, - "target_found": true, - "layers_used": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ], - "retrieval_sufficient": true, - "answer_mode": "normal", - "resolved_target": "RuntimeManager", - "answer_policy_branch": "normal_answer", - "decision_reason": "evidence_sufficient", - "router_result": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "retrieval_profile": "code", - "sub_intent": "FIND_TESTS", - "path_scope": [], - "layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ], - "symbol_resolution_status": "resolved" - }, - "retrieval_request": { - "rag_session_id": "7d11da21-faa0-4cea-aede-aeabe069164c", - "query": "Где тесты для RuntimeManager?", - "sub_intent": "FIND_TESTS", - "path_scope": [], - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ] - }, - "per_layer_outcome": [ - { - "layer_id": "C1_SYMBOL_CATALOG", - "hit_count": 8, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C2_DEPENDENCY_GRAPH", - "hit_count": 6, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C0_SOURCE_CHUNKS", - "hit_count": 10, - "empty": false, - "fallback_used": false - } - ], - "empty_layers": [], - "evidence_gate_decision": { - "sufficient": true, - "failure_reasons": [], - "evidence_count": 24 - }, - "evidence_gate_input": { - "resolved_target": "RuntimeManager", - "sub_intent": "FIND_TESTS", - "target_type": "symbol", - "evidence_count": 24, - "code_chunk_count": 24, - "entrypoint_count": 0, - "relation_count": 6, - "test_evidence_count": 2, - "symbol_resolution_status": "resolved", - "path_scope": [] - }, - "post_evidence_gate": { - "input": { - "answer_mode": "normal", - "degraded_message": "", - "resolved_target": "RuntimeManager", - "draft_answer_preview": "Прямые тесты для `RuntimeManager` находятся в файле `tests/test_runtime.py`.\n\nКосвенные тесты:\n- В файле `tests/test_business_control_actions.py` есть тесты, использующие сущности контроля, которые взаимодействуют с `RuntimeManager`.", - "repair_candidate": true - }, - "output": { - "passed": true, - "action": "return", - "reasons": [], - "repair_used": false, - "final_answer_preview": "Прямые тесты для `RuntimeManager` находятся в файле `tests/test_runtime.py`.\n\nКосвенные тесты:\n- В файле `tests/test_business_control_actions.py` есть тесты, использующие сущности контроля, которые взаимодействуют с `RuntimeManager`." - } - }, - "failure_reasons": [], - "timings_ms": { - "router": 1, - "retrieval": 132, - "pre_evidence_gate": 1, - "llm": 1662, - "post_evidence_gate": 1 - } - }, - "rag_rows": [ - { - "path": "src/plba/bootstrap.py", - "content": "const RuntimeManager\nRuntimeManager = app_runtime.core.runtime.RuntimeManager", - "layer": "C1_SYMBOL_CATALOG", - "title": "RuntimeManager", - "span_start": 4, - "span_end": 4, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "27158ca220022eeb5083c6addf8a50775d45f7161284fd60aac48410105f4b98", - "qname": "RuntimeManager", - "kind": "const", - "signature": "RuntimeManager = app_runtime.core.runtime.RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "src.plba.bootstrap", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_runtime.py", - "content": "const RuntimeManager\nRuntimeManager = app_runtime.core.runtime.RuntimeManager", - "layer": "C1_SYMBOL_CATALOG", - "title": "RuntimeManager", - "span_start": 12, - "span_end": 12, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "aeadc039653807b0da1ca6e3cc1078ee61cfc510b28e7f9c2ec04c59da43cc8d", - "qname": "RuntimeManager", - "kind": "const", - "signature": "RuntimeManager = app_runtime.core.runtime.RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "tests.test_runtime", - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "class RuntimeManager\nRuntimeManager", - "layer": "C1_SYMBOL_CATALOG", - "title": "RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "7e4a9381328c5803bbc6179458612fc4e947d928aa7bf8b4b2bebb2c8592f758", - "qname": "RuntimeManager", - "kind": "class", - "signature": "RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.core.runtime", - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/__init__.py", - "content": "const RuntimeManager\nRuntimeManager = plba.core.RuntimeManager", - "layer": "C1_SYMBOL_CATALOG", - "title": "RuntimeManager", - "span_start": 16, - "span_end": 16, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "7eacec84f9b8d6c4201374591faecdac7493091c263681495c338973f2971ad9", - "qname": "RuntimeManager", - "kind": "const", - "signature": "RuntimeManager = plba.core.RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "src.plba.__init__", - "is_test": false, - "blob_sha": "24e755ec8c249d14fb0e675b5dbf2b71ab91afb9c849897eebfa9feb2499e19d", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/core.py", - "content": "const RuntimeManager\nRuntimeManager = app_runtime.core.runtime.RuntimeManager", - "layer": "C1_SYMBOL_CATALOG", - "title": "RuntimeManager", - "span_start": 2, - "span_end": 2, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "e1684562d978b7af7fe9b27dc5869d770348a87b5dc19a50360f58544668578b", - "qname": "RuntimeManager", - "kind": "const", - "signature": "RuntimeManager = app_runtime.core.runtime.RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "src.plba.core", - "is_test": false, - "blob_sha": "c0ae25110d20e665216616e26b68adfe035b624ba45d31d1272fb21f906f9ca8", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "const RuntimeManager\nRuntimeManager = app_runtime.core.runtime.RuntimeManager", - "layer": "C1_SYMBOL_CATALOG", - "title": "RuntimeManager", - "span_start": 14, - "span_end": 14, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "a1572ea8183dc0cd6ddbc74342bbde8c28cecfde37ad40b62feff09f8d103d11", - "qname": "RuntimeManager", - "kind": "const", - "signature": "RuntimeManager = app_runtime.core.runtime.RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "const RuntimeManager\nRuntimeManager = app_runtime.core.runtime.RuntimeManager", - "layer": "C1_SYMBOL_CATALOG", - "title": "RuntimeManager", - "span_start": 9, - "span_end": 9, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "62a9575c77aad894120d18b4f2a08cf2ba42f77e9be4a8a432b767d157701afe", - "qname": "RuntimeManager", - "kind": "const", - "signature": "RuntimeManager = app_runtime.core.runtime.RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.control.service", - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/__init__.py", - "content": "const ControlPlaneService\nControlPlaneService = app_runtime.control.service.ControlPlaneService", - "layer": "C1_SYMBOL_CATALOG", - "title": "ControlPlaneService", - "span_start": 3, - "span_end": 3, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "217e8f044d1c01644bf7b81e5046af9e84469210c692a2fb0c476a19bb069ae1", - "qname": "ControlPlaneService", - "kind": "const", - "signature": "ControlPlaneService = app_runtime.control.service.ControlPlaneService", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.control.__init__", - "is_test": false, - "blob_sha": "bf3c37e3369a84cc618adc0fd71c232e5eb4b871eaff743069a17e661e498316", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.stop", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 25, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d", - "dst_ref": "ControlPlaneService.stop", - "resolution": "resolved", - "slice_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.stop" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._stop_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 51, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a", - "dst_ref": "ControlPlaneService._stop_async", - "resolution": "resolved", - "slice_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._stop_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.register_channel", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 17, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957", - "dst_ref": "ControlPlaneService.register_channel", - "resolution": "resolved", - "slice_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.register_channel" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.start", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 20, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154", - "dst_ref": "ControlPlaneService.start", - "resolution": "resolved", - "slice_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.start" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._start_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 47, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517", - "dst_ref": "ControlPlaneService._start_async", - "resolution": "resolved", - "slice_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._start_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager.add_config_file", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 32, - "span_end": 52, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "a23b8a11ebdb12708b60c96ea12a69f7f042082f1adfddd572444e246d81d167", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "57ffbd4f0d9fdf3507c2b8624312ce211f3d02fdf86a57a8ec90778d8a7b498d", - "dst_ref": "RuntimeManager.add_config_file", - "resolution": "resolved", - "slice_id": "a23b8a11ebdb12708b60c96ea12a69f7f042082f1adfddd572444e246d81d167", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager.add_config_file" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "57ffbd4f0d9fdf3507c2b8624312ce211f3d02fdf86a57a8ec90778d8a7b498d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/control.py", - "content": "from app_runtime.control.base import ControlActionSet, ControlChannel\nfrom app_runtime.control.http_channel import HttpControlChannel\nfrom app_runtime.control.service import ControlPlaneService\n\n__all__ = [\n \"ControlActionSet\",\n \"ControlChannel\",\n \"ControlPlaneService\",\n \"HttpControlChannel\",\n]", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/plba/control.py:1-10", - "span_start": 1, - "span_end": 10, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.plba.control", - "is_test": false, - "blob_sha": "31bd5c4481bfa7fbca8fae56d4860a67e3953ca74474ac8439e1f39b685d7bc8", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "class IntervalRoutine:\n calls: list[float] = field(default_factory=list)\n _lock: Lock = field(default_factory=Lock)\n\n def run(self) -> None:\n with self._lock:\n self.calls.append(monotonic())\n\n def wait_runs(self, count: int, timeout: float) -> bool:\n deadline = monotonic() + timeout\n while monotonic() < deadline:\n with self._lock:\n if len(self.calls) >= count:\n return True\n sleep(0.01)\n return False\n\n def deltas(self) -> list[float]:\n with self._lock:\n return [self.calls[index + 1] - self.calls[index] for index in range(len(self.calls) - 1)]", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:IntervalRoutine", - "span_start": 18, - "span_end": 37, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "class HttpControlChannel(ControlChannel):\n def __init__(self, host: str, port: int, timeout: int) -> None:\n self._timeout = timeout\n self._runner = UvicornThreadRunner(host, port, timeout)\n self._factory = HttpControlAppFactory()\n self._actions: ControlActionSet | None = None\n\n async def start(self, actions: ControlActionSet) -> None:\n self._actions = actions\n app = self._factory.create(self._health_response, self._action_response)\n await self._runner.start(app)\n\n async def stop(self) -> None:\n await self._runner.stop()\n\n @property\n def port(self) -> int:\n return self._runner.port\n\n async def _health_response(self) -> dict[str, object]:\n if self._actions is None:\n return {\"status\": \"unhealthy\", \"detail\": \"control actions are not configured\"}\n return await asyncio.wait_for(self._actions.health(), timeout=float(self._timeout))\n\n async def _action_response(self, action: str, _client_source: str = \"unknown\") -> JSONResponse:\n if self._actions is None:\n return JSONResponse(content={\"status\": \"error\", \"detail\": f\"{action} handler is not configured\"}, status_code=404)\n callbacks = {\n \"start\": self._actions.start,\n \"stop\": self._actions.stop,\n \"status\": self._actions.status,\n }\n callback = callbacks.get(action)\n if callback is None:\n return JSONResponse(content={\"status\": \"error\", \"detail\": f\"unsupported action: {action}\"}, status_code=404)\n action_timeout = max(float(self._timeout), 10.0) if action in {\"start\", \"stop\"} else float(self._timeout)\n try:\n detail = await asyncio.wait_for(callback(), timeout=action_timeout)\n except asyncio.TimeoutError:\n return JSONResponse(\n content={\"status\": \"accepted\", \"detail\": f\"{action} operation is still in progress\"},\n status_code=202,\n )\n except Exception as exc:\n return JSONResponse(content={\"status\": \"error\", \"detail\": str(exc)}, status_code=500)\n return JSONResponse(content={\"status\": \"ok\", \"detail\": detail or f\"{action} action accepted\"}, status_code=200)", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/http_channel.py:HttpControlChannel", - "span_start": 12, - "span_end": 57, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.http_channel", - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "class HttpControlAppFactory:\n def create(\n self,\n health_provider: Callable[[], Awaitable[HealthPayload]],\n action_provider: Callable[[str, str], Awaitable[JSONResponse]],\n ) -> FastAPI:\n app = FastAPI(title=\"PLBA Control API\")\n\n @app.middleware(\"http\")\n async def log_api_call(request: Request, call_next): # type: ignore[no-untyped-def]\n started = time.monotonic()\n response = await call_next(request)\n response.headers[\"X-Response-Time-Ms\"] = str(int((time.monotonic() - started) * 1000))\n return response\n\n @app.get(\"/health\")\n async def health() -> JSONResponse:\n payload = await health_provider()\n status_code = 200 if payload.get(\"status\") == \"ok\" else 503\n return JSONResponse(content=payload, status_code=status_code)\n\n @app.get(\"/actions/{action}\")\n @app.post(\"/actions/{action}\")\n async def action(action: str, request: Request) -> JSONResponse:\n client_source = self._client_source(request)\n if action in {\"start\", \"stop\"}:\n LOGGER.warning(\"Control action requested: /actions/%s client=%s\", action, client_source)\n return await action_provider(action, client_source)\n\n return app\n\n def _client_source(self, request: Request) -> str:\n explicit_header = request.headers.get(\"X-Client-Source\", \"\").strip()\n if explicit_header:\n return explicit_header\n user_agent = request.headers.get(\"User-Agent\", \"\").strip()\n if user_agent:\n return f\"user-agent:{user_agent}\"\n return \"unknown\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/http_app.py:HttpControlAppFactory", - "span_start": 15, - "span_end": 53, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.http_app", - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_runner.py", - "content": "class UvicornThreadRunner:\n def __init__(self, host: str, port: int, timeout: int) -> None:\n self._host = host\n self._port = port\n self._timeout = timeout\n self._server: Server | None = None\n self._thread: Thread | None = None\n self._error: BaseException | None = None\n\n async def start(self, app: FastAPI) -> None:\n if self._thread is not None and self._thread.is_alive():\n return\n self._error = None\n config = Config(app=app, host=self._host, port=self._port, log_level=\"warning\")\n self._server = Server(config)\n self._thread = Thread(target=self._serve, name=\"plba-http-control\", daemon=True)\n self._thread.start()\n await self._wait_until_started()\n\n async def stop(self) -> None:\n if self._server is None or self._thread is None:\n return\n self._server.should_exit = True\n await asyncio.to_thread(self._thread.join, self._timeout)\n self._server = None\n self._thread = None\n\n @property\n def port(self) -> int:\n if self._server is None or not getattr(self._server, \"servers\", None):\n return self._port\n socket = self._server.servers[0].sockets[0]\n return int(socket.getsockname()[1])\n\n async def _wait_until_started(self) -> None:\n if self._server is None:\n raise RuntimeError(\"Server is not initialized\")\n deadline = asyncio.get_running_loop().time() + max(float(self._timeout), 1.0)\n while not self._server.started:\n if self._error is not None:\n raise RuntimeError(\"HTTP control server failed to start\") from self._error\n if asyncio.get_running_loop().time() >= deadline:\n raise TimeoutError(\"HTTP control server startup timed out\")\n await asyncio.sleep(0.05)\n\n def _serve(self) -> None:\n if self._server is None:\n return\n try:\n asyncio.run(self._server.serve())\n except BaseException as exc: # noqa: BLE001\n self._error = exc", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/http_runner.py:UvicornThreadRunner", - "span_start": 10, - "span_end": 61, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.http_runner", - "is_test": false, - "blob_sha": "3779fdd2878b770e789a35bb2a89c9d79f13b61c26d7db1b3b683f9bb9e1623f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "class ControlPlaneService:\n def __init__(self) -> None:\n self._channels: list[ControlChannel] = []\n\n def register_channel(self, channel: ControlChannel) -> None:\n self._channels.append(channel)\n\n def start(self, runtime: RuntimeManager) -> None:\n if not self._channels:\n return\n asyncio.run(self._start_async(runtime))\n\n def stop(self) -> None:\n if not self._channels:\n return\n asyncio.run(self._stop_async())\n\n def snapshot(self, runtime: RuntimeManager) -> dict[str, object]:\n health = runtime.current_health()\n return {\n \"runtime\": {\"state\": runtime._state.value},\n \"modules\": list(runtime.registry.modules),\n \"services\": runtime.services.snapshot(),\n \"workers\": runtime.workers.snapshot(),\n \"health\": runtime.health.snapshot(runtime.workers.healths()) | {\"status\": health[\"status\"]},\n \"config\": runtime.configuration.get(),\n }\n\n async def _start_async(self, runtime: RuntimeManager) -> None:\n actions = ControlActionSet(\n health=runtime.health_status,\n start=runtime.start_runtime,\n stop=runtime.stop_runtime,\n status=runtime.runtime_status,\n )\n for channel in self._channels:\n await channel.start(actions)\n\n async def _stop_async(self) -> None:\n for channel in reversed(self._channels):\n await channel.stop()", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/service.py:ControlPlaneService", - "span_start": 12, - "span_end": 52, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.service", - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "class ControlActionSet:\n health: HealthHandler\n start: ActionHandler\n stop: ActionHandler\n status: ActionHandler", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/base.py:ControlActionSet", - "span_start": 14, - "span_end": 18, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.base", - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/__init__.py", - "content": "from app_runtime.control.base import ControlActionSet, ControlChannel\nfrom app_runtime.control.http_channel import HttpControlChannel\nfrom app_runtime.control.service import ControlPlaneService\n\n__all__ = [\"ControlActionSet\", \"ControlChannel\", \"ControlPlaneService\", \"HttpControlChannel\"]", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/__init__.py:1-5", - "span_start": 1, - "span_end": 5, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.app_runtime.control.__init__", - "is_test": false, - "blob_sha": "bf3c37e3369a84cc618adc0fd71c232e5eb4b871eaff743069a17e661e498316", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "class ControlChannel(ABC):\n @abstractmethod\n async def start(self, actions: ControlActionSet) -> None:\n \"\"\"Start the control channel and bind handlers.\"\"\"\n\n @abstractmethod\n async def stop(self) -> None:\n \"\"\"Stop the control channel and release resources.\"\"\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/base.py:ControlChannel", - "span_start": 21, - "span_end": 28, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 1, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.base", - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "class BlockingRoutine:\n def __init__(self, started: Event, release: Event) -> None:\n self._started = started\n self._release = release\n\n def run(self) -> None:\n self._started.set()\n self._release.wait(timeout=5.0)", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:BlockingRoutine", - "span_start": 40, - "span_end": 47, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 1, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "validation": { - "passed": true, - "action": "return", - "reasons": [] - }, - "token_usage": { - "prompt_name": "code_qa_find_tests_answer", - "tokens_in_estimate": 3660 - }, - "steps": [ - { - "step": "router", - "status": "completed", - "timings_ms": { - "router": 1 - }, - "output": { - "intent": "CODE_QA", - "sub_intent": "FIND_TESTS", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - } - }, - { - "step": "retrieval", - "status": "completed", - "timings_ms": { - "retrieval": 132 - }, - "output": { - "rag_count": 24, - "answer_path_rag_count": 24, - "resolved_symbol_status": "resolved", - "resolved_symbol": "RuntimeManager", - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ] - }, - "diagnostics": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "vector", - "C2_DEPENDENCY_GRAPH": "vector", - "C0_SOURCE_CHUNKS": "vector" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C0_SOURCE_CHUNKS": 10 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [] - } - }, - "fallback": { - "used": false, - "reason": null - }, - "retrieval_by_layer_ms": { - "C1_SYMBOL_CATALOG": 50, - "C2_DEPENDENCY_GRAPH": 59, - "C0_SOURCE_CHUNKS": 22 - } - } - }, - { - "step": "pre_evidence_gate", - "status": "passed", - "timings_ms": { - "pre_evidence_gate": 1 - }, - "input": { - "resolved_target": "RuntimeManager", - "sub_intent": "FIND_TESTS", - "target_type": "symbol", - "evidence_count": 24, - "code_chunk_count": 24, - "entrypoint_count": 0, - "relation_count": 6, - "test_evidence_count": 2, - "symbol_resolution_status": "resolved", - "path_scope": [] - }, - "output": { - "passed": true, - "failure_reasons": [], - "degraded_message": "", - "evidence_count": 24 - } - }, - { - "step": "llm", - "status": "completed", - "timings_ms": { - "llm": 1662 - }, - "output": { - "prompt_name": "code_qa_find_tests_answer", - "answer_preview": "Прямые тесты для `RuntimeManager` находятся в файле `tests/test_runtime.py`.\n\nКосвенные тесты:\n- В файле `tests/test_business_control_actions.py` есть тесты, использующие сущности контроля, которые взаимодействуют с `RuntimeManager`.", - "resolved_target": "RuntimeManager", - "answer_policy_branch": "normal_answer", - "decision_reason": "evidence_sufficient" - } - }, - { - "step": "post_evidence_gate", - "status": "passed", - "timings_ms": { - "post_evidence_gate": 1, - "post_evidence_gate_recheck": 0, - "repair": 0 - }, - "input": { - "answer_mode": "normal", - "degraded_message": "", - "resolved_target": "RuntimeManager", - "draft_answer_preview": "Прямые тесты для `RuntimeManager` находятся в файле `tests/test_runtime.py`.\n\nКосвенные тесты:\n- В файле `tests/test_business_control_actions.py` есть тесты, использующие сущности контроля, которые взаимодействуют с `RuntimeManager`.", - "repair_candidate": true - }, - "output": { - "passed": true, - "action": "return", - "reasons": [], - "repair_used": false, - "final_answer_preview": "Прямые тесты для `RuntimeManager` находятся в файле `tests/test_runtime.py`.\n\nКосвенные тесты:\n- В файле `tests/test_business_control_actions.py` есть тесты, использующие сущности контроля, которые взаимодействуют с `RuntimeManager`." - } - } - ] - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/manual_run/20260312_193339/full_chain_plba_code_subintents_one_per_subintent_plba-v3-find-tests-runtime-manager.md b/tests/pipeline_setup_v3/test_results/manual_run/20260312_193339/full_chain_plba_code_subintents_one_per_subintent_plba-v3-find-tests-runtime-manager.md deleted file mode 100644 index 32ab13f..0000000 --- a/tests/pipeline_setup_v3/test_results/manual_run/20260312_193339/full_chain_plba_code_subintents_one_per_subintent_plba-v3-find-tests-runtime-manager.md +++ /dev/null @@ -1,269 +0,0 @@ -# plba-v3-find-tests-runtime-manager - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_02_pipeline/full_chain_plba_code_subintents_one_per_subintent.yaml -- runner: agent_runtime -- mode: full_chain -- passed: True - -## Query -Где тесты для RuntimeManager? - -## Actual -{ - "intent": "CODE_QA", - "sub_intent": "FIND_TESTS", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 24, - "llm_answer": "Прямые тесты для `RuntimeManager` находятся в файле `tests/test_runtime.py`.\n\nКосвенные тесты:\n- В файле `tests/test_business_control_actions.py` есть тесты, использующие сущности контроля, которые взаимодействуют с `RuntimeManager`.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "RuntimeManager" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ] -} - -## Steps -[ - { - "step": "router", - "status": "completed", - "timings_ms": { - "router": 1 - }, - "output": { - "intent": "CODE_QA", - "sub_intent": "FIND_TESTS", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - } - }, - { - "step": "retrieval", - "status": "completed", - "timings_ms": { - "retrieval": 132 - }, - "output": { - "rag_count": 24, - "answer_path_rag_count": 24, - "resolved_symbol_status": "resolved", - "resolved_symbol": "RuntimeManager", - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ] - }, - "diagnostics": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "vector", - "C2_DEPENDENCY_GRAPH": "vector", - "C0_SOURCE_CHUNKS": "vector" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C0_SOURCE_CHUNKS": 10 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [] - } - }, - "fallback": { - "used": false, - "reason": null - }, - "retrieval_by_layer_ms": { - "C1_SYMBOL_CATALOG": 50, - "C2_DEPENDENCY_GRAPH": 59, - "C0_SOURCE_CHUNKS": 22 - } - } - }, - { - "step": "pre_evidence_gate", - "status": "passed", - "timings_ms": { - "pre_evidence_gate": 1 - }, - "input": { - "resolved_target": "RuntimeManager", - "sub_intent": "FIND_TESTS", - "target_type": "symbol", - "evidence_count": 24, - "code_chunk_count": 24, - "entrypoint_count": 0, - "relation_count": 6, - "test_evidence_count": 2, - "symbol_resolution_status": "resolved", - "path_scope": [] - }, - "output": { - "passed": true, - "failure_reasons": [], - "degraded_message": "", - "evidence_count": 24 - } - }, - { - "step": "llm", - "status": "completed", - "timings_ms": { - "llm": 1662 - }, - "output": { - "prompt_name": "code_qa_find_tests_answer", - "answer_preview": "Прямые тесты для `RuntimeManager` находятся в файле `tests/test_runtime.py`.\n\nКосвенные тесты:\n- В файле `tests/test_business_control_actions.py` есть тесты, использующие сущности контроля, которые взаимодействуют с `RuntimeManager`.", - "resolved_target": "RuntimeManager", - "answer_policy_branch": "normal_answer", - "decision_reason": "evidence_sufficient" - } - }, - { - "step": "post_evidence_gate", - "status": "passed", - "timings_ms": { - "post_evidence_gate": 1, - "post_evidence_gate_recheck": 0, - "repair": 0 - }, - "input": { - "answer_mode": "normal", - "degraded_message": "", - "resolved_target": "RuntimeManager", - "draft_answer_preview": "Прямые тесты для `RuntimeManager` находятся в файле `tests/test_runtime.py`.\n\nКосвенные тесты:\n- В файле `tests/test_business_control_actions.py` есть тесты, использующие сущности контроля, которые взаимодействуют с `RuntimeManager`.", - "repair_candidate": true - }, - "output": { - "passed": true, - "action": "return", - "reasons": [], - "repair_used": false, - "final_answer_preview": "Прямые тесты для `RuntimeManager` находятся в файле `tests/test_runtime.py`.\n\nКосвенные тесты:\n- В файле `tests/test_business_control_actions.py` есть тесты, использующие сущности контроля, которые взаимодействуют с `RuntimeManager`." - } - } -] - -## Diagnostics -{ - "intent_correct": null, - "target_found": true, - "layers_used": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ], - "retrieval_sufficient": true, - "answer_mode": "normal", - "resolved_target": "RuntimeManager", - "answer_policy_branch": "normal_answer", - "decision_reason": "evidence_sufficient", - "router_result": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "retrieval_profile": "code", - "sub_intent": "FIND_TESTS", - "path_scope": [], - "layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ], - "symbol_resolution_status": "resolved" - }, - "retrieval_request": { - "rag_session_id": "7d11da21-faa0-4cea-aede-aeabe069164c", - "query": "Где тесты для RuntimeManager?", - "sub_intent": "FIND_TESTS", - "path_scope": [], - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ] - }, - "per_layer_outcome": [ - { - "layer_id": "C1_SYMBOL_CATALOG", - "hit_count": 8, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C2_DEPENDENCY_GRAPH", - "hit_count": 6, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C0_SOURCE_CHUNKS", - "hit_count": 10, - "empty": false, - "fallback_used": false - } - ], - "empty_layers": [], - "evidence_gate_decision": { - "sufficient": true, - "failure_reasons": [], - "evidence_count": 24 - }, - "evidence_gate_input": { - "resolved_target": "RuntimeManager", - "sub_intent": "FIND_TESTS", - "target_type": "symbol", - "evidence_count": 24, - "code_chunk_count": 24, - "entrypoint_count": 0, - "relation_count": 6, - "test_evidence_count": 2, - "symbol_resolution_status": "resolved", - "path_scope": [] - }, - "post_evidence_gate": { - "input": { - "answer_mode": "normal", - "degraded_message": "", - "resolved_target": "RuntimeManager", - "draft_answer_preview": "Прямые тесты для `RuntimeManager` находятся в файле `tests/test_runtime.py`.\n\nКосвенные тесты:\n- В файле `tests/test_business_control_actions.py` есть тесты, использующие сущности контроля, которые взаимодействуют с `RuntimeManager`.", - "repair_candidate": true - }, - "output": { - "passed": true, - "action": "return", - "reasons": [], - "repair_used": false, - "final_answer_preview": "Прямые тесты для `RuntimeManager` находятся в файле `tests/test_runtime.py`.\n\nКосвенные тесты:\n- В файле `tests/test_business_control_actions.py` есть тесты, использующие сущности контроля, которые взаимодействуют с `RuntimeManager`." - } - }, - "failure_reasons": [], - "timings_ms": { - "router": 1, - "retrieval": 132, - "pre_evidence_gate": 1, - "llm": 1662, - "post_evidence_gate": 1 - } -} - -## Mismatches -- none \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/manual_run/20260312_193339/full_chain_plba_code_subintents_one_per_subintent_plba-v3-open-file-runtime.json b/tests/pipeline_setup_v3/test_results/manual_run/20260312_193339/full_chain_plba_code_subintents_one_per_subintent_plba-v3-open-file-runtime.json deleted file mode 100644 index 1f07d15..0000000 --- a/tests/pipeline_setup_v3/test_results/manual_run/20260312_193339/full_chain_plba_code_subintents_one_per_subintent_plba-v3-open-file-runtime.json +++ /dev/null @@ -1,588 +0,0 @@ -{ - "case_id": "plba-v3-open-file-runtime", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_02_pipeline/full_chain_plba_code_subintents_one_per_subintent.yaml", - "runner": "agent_runtime", - "mode": "full_chain", - "query": "Открой файл src/app_runtime/core/runtime.py", - "actual": { - "intent": "CODE_QA", - "sub_intent": "OPEN_FILE", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 1, - "llm_answer": "В файле `src/app_runtime/core/runtime.py` определён класс `RuntimeManager`.\nУ него есть несколько классов полей с умолчательными сервисами:\n- `configuration`: тип `ConfigurationManager`\n- `services`: тип `ServiceContainer`\n- `traces`: тип `TraceService`\n- `health`: тип `HealthRegistry`\n- `logs`: тип `LogManager`\n- `workers`: тип `WorkerSupervisor`\n- `control_plane`: тип `ControlPlaneService`\n\nТакже определены константы таймаутов:\n- `ACTION_TIMEOUT_SECONDS = 10.0`\n- `ACTION_POLL_INTERVAL_SECONDS = 0.05`", - "answer_mode": "answered", - "path_scope": [ - "src/app_runtime/core/runtime.py" - ], - "symbol_candidates": [], - "layers": [ - "C0_SOURCE_CHUNKS" - ] - }, - "passed": true, - "mismatches": [], - "details": { - "query": "Открой файл src/app_runtime/core/runtime.py", - "router_result": { - "schema_version": "1.1", - "intent": "CODE_QA", - "retrieval_profile": "code", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query_plan": { - "raw": "Открой файл src/app_runtime/core/runtime.py", - "normalized": "Открой файл src/app_runtime/core/runtime.py", - "sub_intent": "OPEN_FILE", - "negations": [], - "expansions": [ - "file" - ], - "keyword_hints": [], - "path_hints": [ - "src/app_runtime/core/runtime.py" - ], - "doc_scope_hints": [], - "symbol_candidates": [], - "symbol_kind_hint": "unknown", - "anchors": [ - { - "type": "FILE_PATH", - "value": "src/app_runtime/core/runtime.py", - "source": "user_text", - "subtype": null, - "span": { - "start": 12, - "end": 43 - }, - "confidence": 0.95 - }, - { - "type": "KEY_TERM", - "value": "файл", - "source": "user_text", - "subtype": null, - "span": { - "start": 7, - "end": 11 - }, - "confidence": 0.9 - } - ] - }, - "retrieval_spec": { - "domains": [ - "CODE" - ], - "layer_queries": [ - { - "layer_id": "C0_SOURCE_CHUNKS", - "top_k": 12 - } - ], - "filters": { - "test_policy": "EXCLUDE", - "path_scope": [ - "src/app_runtime/core/runtime.py" - ], - "language": [ - "python" - ] - }, - "rerank_profile": "code" - }, - "retrieval_constraints": { - "include_globs": [ - "src/app_runtime/core/runtime.py" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": false, - "max_distance": 2, - "top_k": 5 - } - }, - "symbol_resolution": { - "status": "not_requested", - "resolved_symbol": null, - "alternatives": [], - "confidence": 0.0 - }, - "evidence_policy": { - "require_def": false, - "require_flow": false, - "require_spec": false, - "allow_answer_without_evidence": false - } - }, - "retrieval_request": { - "rag_session_id": "7d11da21-faa0-4cea-aede-aeabe069164c", - "query": "Открой файл src/app_runtime/core/runtime.py", - "sub_intent": "OPEN_FILE", - "path_scope": [ - "src/app_runtime/core/runtime.py" - ], - "keyword_hints": [], - "symbol_candidates": [], - "requested_layers": [ - "C0_SOURCE_CHUNKS" - ], - "retrieval_spec": { - "domains": [ - "CODE" - ], - "layer_queries": [ - { - "layer_id": "C0_SOURCE_CHUNKS", - "top_k": 12 - } - ], - "filters": { - "test_policy": "EXCLUDE", - "path_scope": [ - "src/app_runtime/core/runtime.py" - ], - "language": [ - "python" - ] - }, - "rerank_profile": "code" - }, - "retrieval_constraints": { - "include_globs": [ - "src/app_runtime/core/runtime.py" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": false, - "max_distance": 2, - "top_k": 5 - } - }, - "query_plan": { - "raw": "Открой файл src/app_runtime/core/runtime.py", - "normalized": "Открой файл src/app_runtime/core/runtime.py", - "sub_intent": "OPEN_FILE", - "negations": [], - "expansions": [ - "file" - ], - "keyword_hints": [], - "path_hints": [ - "src/app_runtime/core/runtime.py" - ], - "doc_scope_hints": [], - "symbol_candidates": [], - "symbol_kind_hint": "unknown", - "anchors": [ - { - "type": "FILE_PATH", - "value": "src/app_runtime/core/runtime.py", - "source": "user_text", - "subtype": null, - "span": { - "start": 12, - "end": 43 - }, - "confidence": 0.95 - }, - { - "type": "KEY_TERM", - "value": "файл", - "source": "user_text", - "subtype": null, - "span": { - "start": 7, - "end": 11 - }, - "confidence": 0.9 - } - ] - } - }, - "retrieval_result": { - "target_symbol_candidates": [], - "resolved_symbol": null, - "symbol_resolution_status": "not_requested", - "file_candidates": [ - "src/app_runtime/core/runtime.py" - ], - "code_chunks": [ - { - "layer": "C0_SOURCE_CHUNKS", - "path": "src/app_runtime/core/runtime.py", - "title": "src/app_runtime/core/runtime.py:RuntimeManager", - "content": "class RuntimeManager:\n ACTION_TIMEOUT_SECONDS = 10.0\n ACTION_POLL_INTERVAL_SECONDS = 0.05\n\n def __init__(\n self,\n configuration: ConfigurationManager | None = None,\n services: ServiceContainer | None = None,\n traces: TraceService | None = None,\n health: HealthRegistry | None = None,\n logs: LogManager | None = None,\n workers: WorkerSupervisor | None = None,\n control_plane: ControlPlaneService | None = None,\n ) -> None:\n self.configuration = configuration or ConfigurationManager()\n self.services = services or ServiceContainer()\n self.traces = traces or TraceService()\n self.health = health or HealthRegistry()\n self.logs = logs or LogManager()\n self.workers = workers or WorkerSupervisor()\n self.control_plane = control_plane or ControlPlaneService()\n self.registry = ModuleRegistry(self.services)\n self._started = False\n self._state = LifecycleState.IDLE\n self._core_registered = False\n self._workers_registered = False\n self._register_core_services()\n\n def register_module(self, module: ApplicationModule) -> None:\n self.registry.register_module(module.name)\n module.register(self.registry)\n\n def add_config_file(self, path: str) -> FileConfigProvider:\n provider = FileConfigProvider(path)\n self.configuration.add_provider(provider)\n return provider\n\n def start(self, *, start_control_plane: bool = True) -> None:\n if self._started:\n return\n self._state = LifecycleState.STARTING\n config = self.configuration.load()\n self.logs.apply_config(config)\n self._register_health_contributors()\n self._register_workers()\n self.workers.start()\n if start_control_plane:\n self.control_plane.start(self)\n self._started = True\n self._refresh_state()\n\n def stop(self, timeout: float = 30.0, force: bool = False, stop_control_plane: bool = True) -> None:\n if not self._started:\n return\n self._state = LifecycleState.STOPPING\n self.workers.stop(timeout=timeout, force=force)\n if stop_control_plane:\n self.control_plane.stop()\n self._started = False\n self._state = LifecycleState.STOPPED\n\n def status(self) -> dict[str, object]:\n self._refresh_state()\n return self.control_plane.snapshot(self)\n\n def current_health(self) -> HealthPayload:\n self._refresh_state()\n return self.health.payload(self._state, self.workers.healths())\n\n async def health_status(self) -> HealthPayload:\n return self.current_health()\n\n async def start_runtime(self) -> dict[str, object] | str:\n self._refresh_state()\n if self._started:\n return \"runtime already running\"\n if self._state == LifecycleState.STOPPING:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n\n self.start(start_control_plane=False)\n started = self._wait_for_state({LifecycleState.IDLE, LifecycleState.BUSY}, timeout=self.ACTION_TIMEOUT_SECONDS)\n if started:\n return self._action_detail(\"runtime started\", timed_out=False)\n return self._action_detail(\"runtime start is still in progress\", timed_out=True)\n\n async def stop_runtime(self) -> dict[str, object] | str:\n self._refresh_state()\n if not self._started:\n if self._state == LifecycleState.STOPPING:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n return \"runtime already stopped\"\n\n self._state = LifecycleState.STOPPING\n try:\n self.workers.stop(timeout=self.ACTION_TIMEOUT_SECONDS, force=False)\n except TimeoutError:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n\n self._started = False\n self._state = LifecycleState.STOPPED\n return self._action_detail(\"runtime stopped\", timed_out=False)\n\n async def runtime_status(self) -> str:\n self._refresh_state()\n return self._state.value\n\n def _register_core_services(self) -> None:\n if self._core_registered:\n return\n self.services.register(\"configuration\", self.configuration)\n self.services.register(\"traces\", self.traces)\n self.services.register(\"health\", self.health)\n self.services.register(\"logs\", self.logs)\n self.services.register(\"workers\", self.workers)\n self.services.register(\"control_plane\", self.control_plane)\n self._core_registered = True\n\n def _register_health_contributors(self) -> None:\n for contributor in self.registry.health_contributors:\n self.health.register(contributor)\n\n def _register_workers(self) -> None:\n if self._workers_registered:\n return\n for worker in self.registry.workers:\n self.workers.register(worker)\n self._workers_registered = True\n\n def _refresh_state(self) -> None:\n lifecycle = self.workers.lifecycle_state()\n\n if self._state == LifecycleState.STOPPING:\n if lifecycle == LifecycleState.STOPPED:\n self._started = False\n self._state = LifecycleState.STOPPED\n return\n\n if not self._started:\n if lifecycle == LifecycleState.STOPPED:\n self._state = LifecycleState.STOPPED\n return\n\n self._state = lifecycle\n\n def _wait_for_state(self, target_states: set[LifecycleState], *, timeout: float) -> bool:\n deadline = monotonic() + timeout\n while monotonic() < deadline:\n self._refresh_state()\n if self._state in target_states:\n return True\n sleep(self.ACTION_POLL_INTERVAL_SECONDS)\n self._refresh_state()\n return self._state in target_states\n\n def _action_detail(self, message: str, *, timed_out: bool) -> dict[str, object]:\n self._refresh_state()\n return {\n \"message\": message,\n \"state\": self._state.value,\n \"timed_out\": timed_out,\n \"workers\": self.workers.snapshot(),\n }", - "start_line": 18, - "end_line": 179, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.core.runtime", - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "relations": [], - "semantic_hints": [], - "entrypoints": [], - "test_candidates": [], - "layer_outcomes": [ - { - "layer_id": "C0_SOURCE_CHUNKS", - "hit_count": 1, - "empty": false, - "fallback_used": false - } - ], - "missing_layers": [], - "raw_rows": [ - { - "path": "src/app_runtime/core/runtime.py", - "content": "class RuntimeManager:\n ACTION_TIMEOUT_SECONDS = 10.0\n ACTION_POLL_INTERVAL_SECONDS = 0.05\n\n def __init__(\n self,\n configuration: ConfigurationManager | None = None,\n services: ServiceContainer | None = None,\n traces: TraceService | None = None,\n health: HealthRegistry | None = None,\n logs: LogManager | None = None,\n workers: WorkerSupervisor | None = None,\n control_plane: ControlPlaneService | None = None,\n ) -> None:\n self.configuration = configuration or ConfigurationManager()\n self.services = services or ServiceContainer()\n self.traces = traces or TraceService()\n self.health = health or HealthRegistry()\n self.logs = logs or LogManager()\n self.workers = workers or WorkerSupervisor()\n self.control_plane = control_plane or ControlPlaneService()\n self.registry = ModuleRegistry(self.services)\n self._started = False\n self._state = LifecycleState.IDLE\n self._core_registered = False\n self._workers_registered = False\n self._register_core_services()\n\n def register_module(self, module: ApplicationModule) -> None:\n self.registry.register_module(module.name)\n module.register(self.registry)\n\n def add_config_file(self, path: str) -> FileConfigProvider:\n provider = FileConfigProvider(path)\n self.configuration.add_provider(provider)\n return provider\n\n def start(self, *, start_control_plane: bool = True) -> None:\n if self._started:\n return\n self._state = LifecycleState.STARTING\n config = self.configuration.load()\n self.logs.apply_config(config)\n self._register_health_contributors()\n self._register_workers()\n self.workers.start()\n if start_control_plane:\n self.control_plane.start(self)\n self._started = True\n self._refresh_state()\n\n def stop(self, timeout: float = 30.0, force: bool = False, stop_control_plane: bool = True) -> None:\n if not self._started:\n return\n self._state = LifecycleState.STOPPING\n self.workers.stop(timeout=timeout, force=force)\n if stop_control_plane:\n self.control_plane.stop()\n self._started = False\n self._state = LifecycleState.STOPPED\n\n def status(self) -> dict[str, object]:\n self._refresh_state()\n return self.control_plane.snapshot(self)\n\n def current_health(self) -> HealthPayload:\n self._refresh_state()\n return self.health.payload(self._state, self.workers.healths())\n\n async def health_status(self) -> HealthPayload:\n return self.current_health()\n\n async def start_runtime(self) -> dict[str, object] | str:\n self._refresh_state()\n if self._started:\n return \"runtime already running\"\n if self._state == LifecycleState.STOPPING:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n\n self.start(start_control_plane=False)\n started = self._wait_for_state({LifecycleState.IDLE, LifecycleState.BUSY}, timeout=self.ACTION_TIMEOUT_SECONDS)\n if started:\n return self._action_detail(\"runtime started\", timed_out=False)\n return self._action_detail(\"runtime start is still in progress\", timed_out=True)\n\n async def stop_runtime(self) -> dict[str, object] | str:\n self._refresh_state()\n if not self._started:\n if self._state == LifecycleState.STOPPING:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n return \"runtime already stopped\"\n\n self._state = LifecycleState.STOPPING\n try:\n self.workers.stop(timeout=self.ACTION_TIMEOUT_SECONDS, force=False)\n except TimeoutError:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n\n self._started = False\n self._state = LifecycleState.STOPPED\n return self._action_detail(\"runtime stopped\", timed_out=False)\n\n async def runtime_status(self) -> str:\n self._refresh_state()\n return self._state.value\n\n def _register_core_services(self) -> None:\n if self._core_registered:\n return\n self.services.register(\"configuration\", self.configuration)\n self.services.register(\"traces\", self.traces)\n self.services.register(\"health\", self.health)\n self.services.register(\"logs\", self.logs)\n self.services.register(\"workers\", self.workers)\n self.services.register(\"control_plane\", self.control_plane)\n self._core_registered = True\n\n def _register_health_contributors(self) -> None:\n for contributor in self.registry.health_contributors:\n self.health.register(contributor)\n\n def _register_workers(self) -> None:\n if self._workers_registered:\n return\n for worker in self.registry.workers:\n self.workers.register(worker)\n self._workers_registered = True\n\n def _refresh_state(self) -> None:\n lifecycle = self.workers.lifecycle_state()\n\n if self._state == LifecycleState.STOPPING:\n if lifecycle == LifecycleState.STOPPED:\n self._started = False\n self._state = LifecycleState.STOPPED\n return\n\n if not self._started:\n if lifecycle == LifecycleState.STOPPED:\n self._state = LifecycleState.STOPPED\n return\n\n self._state = lifecycle\n\n def _wait_for_state(self, target_states: set[LifecycleState], *, timeout: float) -> bool:\n deadline = monotonic() + timeout\n while monotonic() < deadline:\n self._refresh_state()\n if self._state in target_states:\n return True\n sleep(self.ACTION_POLL_INTERVAL_SECONDS)\n self._refresh_state()\n return self._state in target_states\n\n def _action_detail(self, message: str, *, timed_out: bool) -> dict[str, object]:\n self._refresh_state()\n return {\n \"message\": message,\n \"state\": self._state.value,\n \"timed_out\": timed_out,\n \"workers\": self.workers.snapshot(),\n }", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/core/runtime.py:RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.core.runtime", - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "retrieval_report": { - "executed_layers": [ - "C0_SOURCE_CHUNKS" - ], - "retrieval_mode_by_layer": { - "C0_SOURCE_CHUNKS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C0_SOURCE_CHUNKS": 200 - }, - "filters_by_layer": { - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src/app_runtime/core/runtime.py" - ] - } - }, - "requests": [ - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Открой файл src/app_runtime/core/runtime.py", - "ranking_profile": "code" - } - ], - "fallback": { - "used": false, - "reason": null - }, - "retrieval_by_layer_ms": { - "C0_SOURCE_CHUNKS": 132 - } - } - }, - "diagnostics": { - "intent_correct": null, - "target_found": true, - "layers_used": [ - "C0_SOURCE_CHUNKS" - ], - "retrieval_sufficient": true, - "answer_mode": "normal", - "resolved_target": "src/app_runtime/core/runtime.py", - "answer_policy_branch": "normal_answer", - "decision_reason": "evidence_sufficient", - "router_result": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "retrieval_profile": "code", - "sub_intent": "OPEN_FILE", - "path_scope": [ - "src/app_runtime/core/runtime.py" - ], - "layers": [ - "C0_SOURCE_CHUNKS" - ], - "symbol_resolution_status": "not_requested" - }, - "retrieval_request": { - "rag_session_id": "7d11da21-faa0-4cea-aede-aeabe069164c", - "query": "Открой файл src/app_runtime/core/runtime.py", - "sub_intent": "OPEN_FILE", - "path_scope": [ - "src/app_runtime/core/runtime.py" - ], - "requested_layers": [ - "C0_SOURCE_CHUNKS" - ] - }, - "per_layer_outcome": [ - { - "layer_id": "C0_SOURCE_CHUNKS", - "hit_count": 1, - "empty": false, - "fallback_used": false - } - ], - "empty_layers": [], - "evidence_gate_decision": { - "sufficient": true, - "failure_reasons": [], - "evidence_count": 1 - }, - "evidence_gate_input": { - "resolved_target": "src/app_runtime/core/runtime.py", - "sub_intent": "OPEN_FILE", - "target_type": "file", - "evidence_count": 1, - "code_chunk_count": 1, - "entrypoint_count": 0, - "relation_count": 0, - "test_evidence_count": 0, - "symbol_resolution_status": "not_requested", - "path_scope": [ - "src/app_runtime/core/runtime.py" - ] - }, - "post_evidence_gate": { - "input": { - "answer_mode": "normal", - "degraded_message": "", - "resolved_target": "src/app_runtime/core/runtime.py", - "draft_answer_preview": "В файле `src/app_runtime/core/runtime.py` определён класс `RuntimeManager`.\nУ него есть несколько классов полей с умолчательными сервисами:\n- `configuration`: тип `ConfigurationManager`\n- `services`: тип `ServiceContainer`\n- `traces`: тип `TraceService`\n- `health`: тип `HealthRegistry`\n- `logs`: тип", - "repair_candidate": true - }, - "output": { - "passed": true, - "action": "return", - "reasons": [], - "repair_used": false, - "final_answer_preview": "В файле `src/app_runtime/core/runtime.py` определён класс `RuntimeManager`.\nУ него есть несколько классов полей с умолчательными сервисами:\n- `configuration`: тип `ConfigurationManager`\n- `services`: тип `ServiceContainer`\n- `traces`: тип `TraceService`\n- `health`: тип `HealthRegistry`\n- `logs`: тип" - } - }, - "failure_reasons": [], - "timings_ms": { - "router": 1, - "retrieval": 132, - "pre_evidence_gate": 1, - "llm": 3550, - "post_evidence_gate": 2 - } - }, - "rag_rows": [ - { - "path": "src/app_runtime/core/runtime.py", - "content": "class RuntimeManager:\n ACTION_TIMEOUT_SECONDS = 10.0\n ACTION_POLL_INTERVAL_SECONDS = 0.05\n\n def __init__(\n self,\n configuration: ConfigurationManager | None = None,\n services: ServiceContainer | None = None,\n traces: TraceService | None = None,\n health: HealthRegistry | None = None,\n logs: LogManager | None = None,\n workers: WorkerSupervisor | None = None,\n control_plane: ControlPlaneService | None = None,\n ) -> None:\n self.configuration = configuration or ConfigurationManager()\n self.services = services or ServiceContainer()\n self.traces = traces or TraceService()\n self.health = health or HealthRegistry()\n self.logs = logs or LogManager()\n self.workers = workers or WorkerSupervisor()\n self.control_plane = control_plane or ControlPlaneService()\n self.registry = ModuleRegistry(self.services)\n self._started = False\n self._state = LifecycleState.IDLE\n self._core_registered = False\n self._workers_registered = False\n self._register_core_services()\n\n def register_module(self, module: ApplicationModule) -> None:\n self.registry.register_module(module.name)\n module.register(self.registry)\n\n def add_config_file(self, path: str) -> FileConfigProvider:\n provider = FileConfigProvider(path)\n self.configuration.add_provider(provider)\n return provider\n\n def start(self, *, start_control_plane: bool = True) -> None:\n if self._started:\n return\n self._state = LifecycleState.STARTING\n config = self.configuration.load()\n self.logs.apply_config(config)\n self._register_health_contributors()\n self._register_workers()\n self.workers.start()\n if start_control_plane:\n self.control_plane.start(self)\n self._started = True\n self._refresh_state()\n\n def stop(self, timeout: float = 30.0, force: bool = False, stop_control_plane: bool = True) -> None:\n if not self._started:\n return\n self._state = LifecycleState.STOPPING\n self.workers.stop(timeout=timeout, force=force)\n if stop_control_plane:\n self.control_plane.stop()\n self._started = False\n self._state = LifecycleState.STOPPED\n\n def status(self) -> dict[str, object]:\n self._refresh_state()\n return self.control_plane.snapshot(self)\n\n def current_health(self) -> HealthPayload:\n self._refresh_state()\n return self.health.payload(self._state, self.workers.healths())\n\n async def health_status(self) -> HealthPayload:\n return self.current_health()\n\n async def start_runtime(self) -> dict[str, object] | str:\n self._refresh_state()\n if self._started:\n return \"runtime already running\"\n if self._state == LifecycleState.STOPPING:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n\n self.start(start_control_plane=False)\n started = self._wait_for_state({LifecycleState.IDLE, LifecycleState.BUSY}, timeout=self.ACTION_TIMEOUT_SECONDS)\n if started:\n return self._action_detail(\"runtime started\", timed_out=False)\n return self._action_detail(\"runtime start is still in progress\", timed_out=True)\n\n async def stop_runtime(self) -> dict[str, object] | str:\n self._refresh_state()\n if not self._started:\n if self._state == LifecycleState.STOPPING:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n return \"runtime already stopped\"\n\n self._state = LifecycleState.STOPPING\n try:\n self.workers.stop(timeout=self.ACTION_TIMEOUT_SECONDS, force=False)\n except TimeoutError:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n\n self._started = False\n self._state = LifecycleState.STOPPED\n return self._action_detail(\"runtime stopped\", timed_out=False)\n\n async def runtime_status(self) -> str:\n self._refresh_state()\n return self._state.value\n\n def _register_core_services(self) -> None:\n if self._core_registered:\n return\n self.services.register(\"configuration\", self.configuration)\n self.services.register(\"traces\", self.traces)\n self.services.register(\"health\", self.health)\n self.services.register(\"logs\", self.logs)\n self.services.register(\"workers\", self.workers)\n self.services.register(\"control_plane\", self.control_plane)\n self._core_registered = True\n\n def _register_health_contributors(self) -> None:\n for contributor in self.registry.health_contributors:\n self.health.register(contributor)\n\n def _register_workers(self) -> None:\n if self._workers_registered:\n return\n for worker in self.registry.workers:\n self.workers.register(worker)\n self._workers_registered = True\n\n def _refresh_state(self) -> None:\n lifecycle = self.workers.lifecycle_state()\n\n if self._state == LifecycleState.STOPPING:\n if lifecycle == LifecycleState.STOPPED:\n self._started = False\n self._state = LifecycleState.STOPPED\n return\n\n if not self._started:\n if lifecycle == LifecycleState.STOPPED:\n self._state = LifecycleState.STOPPED\n return\n\n self._state = lifecycle\n\n def _wait_for_state(self, target_states: set[LifecycleState], *, timeout: float) -> bool:\n deadline = monotonic() + timeout\n while monotonic() < deadline:\n self._refresh_state()\n if self._state in target_states:\n return True\n sleep(self.ACTION_POLL_INTERVAL_SECONDS)\n self._refresh_state()\n return self._state in target_states\n\n def _action_detail(self, message: str, *, timed_out: bool) -> dict[str, object]:\n self._refresh_state()\n return {\n \"message\": message,\n \"state\": self._state.value,\n \"timed_out\": timed_out,\n \"workers\": self.workers.snapshot(),\n }", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/core/runtime.py:RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.core.runtime", - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "validation": { - "passed": true, - "action": "return", - "reasons": [] - }, - "token_usage": { - "prompt_name": "code_qa_open_file_answer", - "tokens_in_estimate": 1128 - }, - "steps": [ - { - "step": "router", - "status": "completed", - "timings_ms": { - "router": 1 - }, - "output": { - "intent": "CODE_QA", - "sub_intent": "OPEN_FILE", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - } - }, - { - "step": "retrieval", - "status": "completed", - "timings_ms": { - "retrieval": 132 - }, - "output": { - "rag_count": 1, - "answer_path_rag_count": 1, - "resolved_symbol_status": "not_requested", - "resolved_symbol": null, - "requested_layers": [ - "C0_SOURCE_CHUNKS" - ] - }, - "diagnostics": { - "executed_layers": [ - "C0_SOURCE_CHUNKS" - ], - "retrieval_mode_by_layer": { - "C0_SOURCE_CHUNKS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C0_SOURCE_CHUNKS": 200 - }, - "filters_by_layer": { - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src/app_runtime/core/runtime.py" - ] - } - }, - "requests": [ - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Открой файл src/app_runtime/core/runtime.py", - "ranking_profile": "code" - } - ], - "fallback": { - "used": false, - "reason": null - }, - "retrieval_by_layer_ms": { - "C0_SOURCE_CHUNKS": 132 - } - } - }, - { - "step": "pre_evidence_gate", - "status": "passed", - "timings_ms": { - "pre_evidence_gate": 1 - }, - "input": { - "resolved_target": "src/app_runtime/core/runtime.py", - "sub_intent": "OPEN_FILE", - "target_type": "file", - "evidence_count": 1, - "code_chunk_count": 1, - "entrypoint_count": 0, - "relation_count": 0, - "test_evidence_count": 0, - "symbol_resolution_status": "not_requested", - "path_scope": [ - "src/app_runtime/core/runtime.py" - ] - }, - "output": { - "passed": true, - "failure_reasons": [], - "degraded_message": "", - "evidence_count": 1 - } - }, - { - "step": "llm", - "status": "completed", - "timings_ms": { - "llm": 3550 - }, - "output": { - "prompt_name": "code_qa_open_file_answer", - "answer_preview": "В файле `src/app_runtime/core/runtime.py` определён класс `RuntimeManager`.\nУ него есть несколько классов полей с умолчательными сервисами:\n- `configuration`: тип `ConfigurationManager`\n- `services`: тип `ServiceContainer`\n- `traces`: тип `TraceService`\n- `health`: тип `HealthRegistry`\n- `logs`: тип", - "resolved_target": "src/app_runtime/core/runtime.py", - "answer_policy_branch": "normal_answer", - "decision_reason": "evidence_sufficient" - } - }, - { - "step": "post_evidence_gate", - "status": "passed", - "timings_ms": { - "post_evidence_gate": 2, - "post_evidence_gate_recheck": 0, - "repair": 0 - }, - "input": { - "answer_mode": "normal", - "degraded_message": "", - "resolved_target": "src/app_runtime/core/runtime.py", - "draft_answer_preview": "В файле `src/app_runtime/core/runtime.py` определён класс `RuntimeManager`.\nУ него есть несколько классов полей с умолчательными сервисами:\n- `configuration`: тип `ConfigurationManager`\n- `services`: тип `ServiceContainer`\n- `traces`: тип `TraceService`\n- `health`: тип `HealthRegistry`\n- `logs`: тип", - "repair_candidate": true - }, - "output": { - "passed": true, - "action": "return", - "reasons": [], - "repair_used": false, - "final_answer_preview": "В файле `src/app_runtime/core/runtime.py` определён класс `RuntimeManager`.\nУ него есть несколько классов полей с умолчательными сервисами:\n- `configuration`: тип `ConfigurationManager`\n- `services`: тип `ServiceContainer`\n- `traces`: тип `TraceService`\n- `health`: тип `HealthRegistry`\n- `logs`: тип" - } - } - ] - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/manual_run/20260312_193339/full_chain_plba_code_subintents_one_per_subintent_plba-v3-open-file-runtime.md b/tests/pipeline_setup_v3/test_results/manual_run/20260312_193339/full_chain_plba_code_subintents_one_per_subintent_plba-v3-open-file-runtime.md deleted file mode 100644 index fcc93ea..0000000 --- a/tests/pipeline_setup_v3/test_results/manual_run/20260312_193339/full_chain_plba_code_subintents_one_per_subintent_plba-v3-open-file-runtime.md +++ /dev/null @@ -1,250 +0,0 @@ -# plba-v3-open-file-runtime - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_02_pipeline/full_chain_plba_code_subintents_one_per_subintent.yaml -- runner: agent_runtime -- mode: full_chain -- passed: True - -## Query -Открой файл src/app_runtime/core/runtime.py - -## Actual -{ - "intent": "CODE_QA", - "sub_intent": "OPEN_FILE", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 1, - "llm_answer": "В файле `src/app_runtime/core/runtime.py` определён класс `RuntimeManager`.\nУ него есть несколько классов полей с умолчательными сервисами:\n- `configuration`: тип `ConfigurationManager`\n- `services`: тип `ServiceContainer`\n- `traces`: тип `TraceService`\n- `health`: тип `HealthRegistry`\n- `logs`: тип `LogManager`\n- `workers`: тип `WorkerSupervisor`\n- `control_plane`: тип `ControlPlaneService`\n\nТакже определены константы таймаутов:\n- `ACTION_TIMEOUT_SECONDS = 10.0`\n- `ACTION_POLL_INTERVAL_SECONDS = 0.05`", - "answer_mode": "answered", - "path_scope": [ - "src/app_runtime/core/runtime.py" - ], - "symbol_candidates": [], - "layers": [ - "C0_SOURCE_CHUNKS" - ] -} - -## Steps -[ - { - "step": "router", - "status": "completed", - "timings_ms": { - "router": 1 - }, - "output": { - "intent": "CODE_QA", - "sub_intent": "OPEN_FILE", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - } - }, - { - "step": "retrieval", - "status": "completed", - "timings_ms": { - "retrieval": 132 - }, - "output": { - "rag_count": 1, - "answer_path_rag_count": 1, - "resolved_symbol_status": "not_requested", - "resolved_symbol": null, - "requested_layers": [ - "C0_SOURCE_CHUNKS" - ] - }, - "diagnostics": { - "executed_layers": [ - "C0_SOURCE_CHUNKS" - ], - "retrieval_mode_by_layer": { - "C0_SOURCE_CHUNKS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C0_SOURCE_CHUNKS": 200 - }, - "filters_by_layer": { - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src/app_runtime/core/runtime.py" - ] - } - }, - "requests": [ - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Открой файл src/app_runtime/core/runtime.py", - "ranking_profile": "code" - } - ], - "fallback": { - "used": false, - "reason": null - }, - "retrieval_by_layer_ms": { - "C0_SOURCE_CHUNKS": 132 - } - } - }, - { - "step": "pre_evidence_gate", - "status": "passed", - "timings_ms": { - "pre_evidence_gate": 1 - }, - "input": { - "resolved_target": "src/app_runtime/core/runtime.py", - "sub_intent": "OPEN_FILE", - "target_type": "file", - "evidence_count": 1, - "code_chunk_count": 1, - "entrypoint_count": 0, - "relation_count": 0, - "test_evidence_count": 0, - "symbol_resolution_status": "not_requested", - "path_scope": [ - "src/app_runtime/core/runtime.py" - ] - }, - "output": { - "passed": true, - "failure_reasons": [], - "degraded_message": "", - "evidence_count": 1 - } - }, - { - "step": "llm", - "status": "completed", - "timings_ms": { - "llm": 3550 - }, - "output": { - "prompt_name": "code_qa_open_file_answer", - "answer_preview": "В файле `src/app_runtime/core/runtime.py` определён класс `RuntimeManager`.\nУ него есть несколько классов полей с умолчательными сервисами:\n- `configuration`: тип `ConfigurationManager`\n- `services`: тип `ServiceContainer`\n- `traces`: тип `TraceService`\n- `health`: тип `HealthRegistry`\n- `logs`: тип", - "resolved_target": "src/app_runtime/core/runtime.py", - "answer_policy_branch": "normal_answer", - "decision_reason": "evidence_sufficient" - } - }, - { - "step": "post_evidence_gate", - "status": "passed", - "timings_ms": { - "post_evidence_gate": 2, - "post_evidence_gate_recheck": 0, - "repair": 0 - }, - "input": { - "answer_mode": "normal", - "degraded_message": "", - "resolved_target": "src/app_runtime/core/runtime.py", - "draft_answer_preview": "В файле `src/app_runtime/core/runtime.py` определён класс `RuntimeManager`.\nУ него есть несколько классов полей с умолчательными сервисами:\n- `configuration`: тип `ConfigurationManager`\n- `services`: тип `ServiceContainer`\n- `traces`: тип `TraceService`\n- `health`: тип `HealthRegistry`\n- `logs`: тип", - "repair_candidate": true - }, - "output": { - "passed": true, - "action": "return", - "reasons": [], - "repair_used": false, - "final_answer_preview": "В файле `src/app_runtime/core/runtime.py` определён класс `RuntimeManager`.\nУ него есть несколько классов полей с умолчательными сервисами:\n- `configuration`: тип `ConfigurationManager`\n- `services`: тип `ServiceContainer`\n- `traces`: тип `TraceService`\n- `health`: тип `HealthRegistry`\n- `logs`: тип" - } - } -] - -## Diagnostics -{ - "intent_correct": null, - "target_found": true, - "layers_used": [ - "C0_SOURCE_CHUNKS" - ], - "retrieval_sufficient": true, - "answer_mode": "normal", - "resolved_target": "src/app_runtime/core/runtime.py", - "answer_policy_branch": "normal_answer", - "decision_reason": "evidence_sufficient", - "router_result": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "retrieval_profile": "code", - "sub_intent": "OPEN_FILE", - "path_scope": [ - "src/app_runtime/core/runtime.py" - ], - "layers": [ - "C0_SOURCE_CHUNKS" - ], - "symbol_resolution_status": "not_requested" - }, - "retrieval_request": { - "rag_session_id": "7d11da21-faa0-4cea-aede-aeabe069164c", - "query": "Открой файл src/app_runtime/core/runtime.py", - "sub_intent": "OPEN_FILE", - "path_scope": [ - "src/app_runtime/core/runtime.py" - ], - "requested_layers": [ - "C0_SOURCE_CHUNKS" - ] - }, - "per_layer_outcome": [ - { - "layer_id": "C0_SOURCE_CHUNKS", - "hit_count": 1, - "empty": false, - "fallback_used": false - } - ], - "empty_layers": [], - "evidence_gate_decision": { - "sufficient": true, - "failure_reasons": [], - "evidence_count": 1 - }, - "evidence_gate_input": { - "resolved_target": "src/app_runtime/core/runtime.py", - "sub_intent": "OPEN_FILE", - "target_type": "file", - "evidence_count": 1, - "code_chunk_count": 1, - "entrypoint_count": 0, - "relation_count": 0, - "test_evidence_count": 0, - "symbol_resolution_status": "not_requested", - "path_scope": [ - "src/app_runtime/core/runtime.py" - ] - }, - "post_evidence_gate": { - "input": { - "answer_mode": "normal", - "degraded_message": "", - "resolved_target": "src/app_runtime/core/runtime.py", - "draft_answer_preview": "В файле `src/app_runtime/core/runtime.py` определён класс `RuntimeManager`.\nУ него есть несколько классов полей с умолчательными сервисами:\n- `configuration`: тип `ConfigurationManager`\n- `services`: тип `ServiceContainer`\n- `traces`: тип `TraceService`\n- `health`: тип `HealthRegistry`\n- `logs`: тип", - "repair_candidate": true - }, - "output": { - "passed": true, - "action": "return", - "reasons": [], - "repair_used": false, - "final_answer_preview": "В файле `src/app_runtime/core/runtime.py` определён класс `RuntimeManager`.\nУ него есть несколько классов полей с умолчательными сервисами:\n- `configuration`: тип `ConfigurationManager`\n- `services`: тип `ServiceContainer`\n- `traces`: тип `TraceService`\n- `health`: тип `HealthRegistry`\n- `logs`: тип" - } - }, - "failure_reasons": [], - "timings_ms": { - "router": 1, - "retrieval": 132, - "pre_evidence_gate": 1, - "llm": 3550, - "post_evidence_gate": 2 - } -} - -## Mismatches -- none \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/manual_run/20260312_193339/full_chain_plba_code_subintents_one_per_subintent_plba-v3-trace-flow-runtime-start.json b/tests/pipeline_setup_v3/test_results/manual_run/20260312_193339/full_chain_plba_code_subintents_one_per_subintent_plba-v3-trace-flow-runtime-start.json deleted file mode 100644 index 222bed8..0000000 --- a/tests/pipeline_setup_v3/test_results/manual_run/20260312_193339/full_chain_plba_code_subintents_one_per_subintent_plba-v3-trace-flow-runtime-start.json +++ /dev/null @@ -1,5198 +0,0 @@ -{ - "case_id": "plba-v3-trace-flow-runtime-start", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_02_pipeline/full_chain_plba_code_subintents_one_per_subintent.yaml", - "runner": "agent_runtime", - "mode": "full_chain", - "query": "Покажи поток выполнения при запуске RuntimeManager", - "actual": { - "intent": "CODE_QA", - "sub_intent": "TRACE_FLOW", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 37, - "llm_answer": "При запуске `RuntimeManager` выполняются следующие шаги:\n\n1. Инициализация конфигурации через `add_config_file`.\n2. Инициализация сервисов.\n3. Регистрация основных служб через `_register_core_services`.\n4. Запуск менеджера с помощью метода `start`.\n\nЭти этапы основаны на сигнатурах методов и их связях внутри класса `RuntimeManager`. \nКонкретные реализации логики запуска находятся в файле `src/app_runtime/core/runtime.py`, строки 32–127.\n\nПоток выполнения полностью восстанавливается по данным контекстного фрагмента.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "RuntimeManager" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "passed": true, - "mismatches": [], - "details": { - "query": "Покажи поток выполнения при запуске RuntimeManager", - "router_result": { - "schema_version": "1.1", - "intent": "CODE_QA", - "retrieval_profile": "code", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query_plan": { - "raw": "Покажи поток выполнения при запуске RuntimeManager", - "normalized": "Покажи поток выполнения при запуске RuntimeManager", - "sub_intent": "TRACE_FLOW", - "negations": [], - "expansions": [ - "RuntimeManager" - ], - "keyword_hints": [ - "RuntimeManager" - ], - "path_hints": [], - "doc_scope_hints": [], - "symbol_candidates": [ - "RuntimeManager" - ], - "symbol_kind_hint": "class", - "anchors": [ - { - "type": "SYMBOL", - "value": "RuntimeManager", - "source": "user_text", - "subtype": null, - "span": { - "start": 36, - "end": 50 - }, - "confidence": 0.88 - } - ] - }, - "retrieval_spec": { - "domains": [ - "CODE" - ], - "layer_queries": [ - { - "layer_id": "C1_SYMBOL_CATALOG", - "top_k": 8 - }, - { - "layer_id": "C0_SOURCE_CHUNKS", - "top_k": 8 - }, - { - "layer_id": "C4_SEMANTIC_ROLES", - "top_k": 8 - }, - { - "layer_id": "C2_DEPENDENCY_GRAPH", - "top_k": 10 - }, - { - "layer_id": "C3_ENTRYPOINTS", - "top_k": 10 - } - ], - "filters": { - "test_policy": "EXCLUDE", - "path_scope": [], - "language": [ - "python" - ] - }, - "rerank_profile": "code" - }, - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - }, - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "RuntimeManager", - "alternatives": [ - "RuntimeManager", - "RuntimeManager", - "RuntimeManager", - "RuntimeManager", - "RuntimeManager" - ], - "confidence": 0.99 - }, - "evidence_policy": { - "require_def": true, - "require_flow": true, - "require_spec": false, - "allow_answer_without_evidence": false - } - }, - "retrieval_request": { - "rag_session_id": "7d11da21-faa0-4cea-aede-aeabe069164c", - "query": "Покажи поток выполнения при запуске RuntimeManager", - "sub_intent": "TRACE_FLOW", - "path_scope": [], - "keyword_hints": [ - "RuntimeManager" - ], - "symbol_candidates": [ - "RuntimeManager" - ], - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_spec": { - "domains": [ - "CODE" - ], - "layer_queries": [ - { - "layer_id": "C1_SYMBOL_CATALOG", - "top_k": 8 - }, - { - "layer_id": "C0_SOURCE_CHUNKS", - "top_k": 8 - }, - { - "layer_id": "C4_SEMANTIC_ROLES", - "top_k": 8 - }, - { - "layer_id": "C2_DEPENDENCY_GRAPH", - "top_k": 10 - }, - { - "layer_id": "C3_ENTRYPOINTS", - "top_k": 10 - } - ], - "filters": { - "test_policy": "EXCLUDE", - "path_scope": [], - "language": [ - "python" - ] - }, - "rerank_profile": "code" - }, - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - }, - "query_plan": { - "raw": "Покажи поток выполнения при запуске RuntimeManager", - "normalized": "Покажи поток выполнения при запуске RuntimeManager", - "sub_intent": "TRACE_FLOW", - "negations": [], - "expansions": [ - "RuntimeManager" - ], - "keyword_hints": [ - "RuntimeManager" - ], - "path_hints": [], - "doc_scope_hints": [], - "symbol_candidates": [ - "RuntimeManager" - ], - "symbol_kind_hint": "class", - "anchors": [ - { - "type": "SYMBOL", - "value": "RuntimeManager", - "source": "user_text", - "subtype": null, - "span": { - "start": 36, - "end": 50 - }, - "confidence": 0.88 - } - ] - } - }, - "retrieval_result": { - "target_symbol_candidates": [ - "RuntimeManager", - "ControlPlaneService", - "ControlChannel.start", - "ControlChannel.stop" - ], - "resolved_symbol": "RuntimeManager", - "symbol_resolution_status": "resolved", - "file_candidates": [ - "src/plba/bootstrap.py", - "src/app_runtime/control/service.py", - "src/app_runtime/core/runtime.py", - "src/plba/__init__.py", - "src/plba/core.py", - "src/app_runtime/control/__init__.py", - "src/app_runtime/control/base.py", - "src/app_runtime/control/http_runner.py", - "src/app_runtime/control/http_app.py", - "src/app_runtime/control/http_channel.py", - "src/plba/control.py", - "src/app_runtime/workflow/persistence/workflow_persistence.py" - ], - "code_chunks": [ - { - "layer": "C1_SYMBOL_CATALOG", - "path": "src/plba/bootstrap.py", - "title": "RuntimeManager", - "content": "const RuntimeManager\nRuntimeManager = app_runtime.core.runtime.RuntimeManager", - "start_line": 4, - "end_line": 4, - "metadata": { - "symbol_id": "27158ca220022eeb5083c6addf8a50775d45f7161284fd60aac48410105f4b98", - "qname": "RuntimeManager", - "kind": "const", - "signature": "RuntimeManager = app_runtime.core.runtime.RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "src.plba.bootstrap", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C1_SYMBOL_CATALOG", - "path": "src/app_runtime/control/service.py", - "title": "RuntimeManager", - "content": "const RuntimeManager\nRuntimeManager = app_runtime.core.runtime.RuntimeManager", - "start_line": 9, - "end_line": 9, - "metadata": { - "symbol_id": "62a9575c77aad894120d18b4f2a08cf2ba42f77e9be4a8a432b767d157701afe", - "qname": "RuntimeManager", - "kind": "const", - "signature": "RuntimeManager = app_runtime.core.runtime.RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.control.service", - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C1_SYMBOL_CATALOG", - "path": "src/app_runtime/core/runtime.py", - "title": "RuntimeManager", - "content": "class RuntimeManager\nRuntimeManager", - "start_line": 18, - "end_line": 179, - "metadata": { - "symbol_id": "7e4a9381328c5803bbc6179458612fc4e947d928aa7bf8b4b2bebb2c8592f758", - "qname": "RuntimeManager", - "kind": "class", - "signature": "RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.core.runtime", - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C1_SYMBOL_CATALOG", - "path": "src/plba/__init__.py", - "title": "RuntimeManager", - "content": "const RuntimeManager\nRuntimeManager = plba.core.RuntimeManager", - "start_line": 16, - "end_line": 16, - "metadata": { - "symbol_id": "7eacec84f9b8d6c4201374591faecdac7493091c263681495c338973f2971ad9", - "qname": "RuntimeManager", - "kind": "const", - "signature": "RuntimeManager = plba.core.RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "src.plba.__init__", - "is_test": false, - "blob_sha": "24e755ec8c249d14fb0e675b5dbf2b71ab91afb9c849897eebfa9feb2499e19d", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C1_SYMBOL_CATALOG", - "path": "src/plba/core.py", - "title": "RuntimeManager", - "content": "const RuntimeManager\nRuntimeManager = app_runtime.core.runtime.RuntimeManager", - "start_line": 2, - "end_line": 2, - "metadata": { - "symbol_id": "e1684562d978b7af7fe9b27dc5869d770348a87b5dc19a50360f58544668578b", - "qname": "RuntimeManager", - "kind": "const", - "signature": "RuntimeManager = app_runtime.core.runtime.RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "src.plba.core", - "is_test": false, - "blob_sha": "c0ae25110d20e665216616e26b68adfe035b624ba45d31d1272fb21f906f9ca8", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C1_SYMBOL_CATALOG", - "path": "src/app_runtime/control/__init__.py", - "title": "ControlPlaneService", - "content": "const ControlPlaneService\nControlPlaneService = app_runtime.control.service.ControlPlaneService", - "start_line": 3, - "end_line": 3, - "metadata": { - "symbol_id": "217e8f044d1c01644bf7b81e5046af9e84469210c692a2fb0c476a19bb069ae1", - "qname": "ControlPlaneService", - "kind": "const", - "signature": "ControlPlaneService = app_runtime.control.service.ControlPlaneService", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.control.__init__", - "is_test": false, - "blob_sha": "bf3c37e3369a84cc618adc0fd71c232e5eb4b871eaff743069a17e661e498316", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C1_SYMBOL_CATALOG", - "path": "src/app_runtime/control/base.py", - "title": "ControlChannel.start", - "content": "method ControlChannel.start\nstart(self, actions)\nStart the control channel and bind handlers.", - "start_line": 23, - "end_line": 24, - "metadata": { - "symbol_id": "e01e0d50d0f48d0c84c119c989b7a7c57ceea263811ce2605c684ae24d1a03b1", - "qname": "ControlChannel.start", - "kind": "method", - "signature": "start(self, actions)", - "parent_symbol_id": "ControlChannel", - "package_or_module": "src.app_runtime.control.base", - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C1_SYMBOL_CATALOG", - "path": "src/app_runtime/control/base.py", - "title": "ControlChannel.stop", - "content": "method ControlChannel.stop\nstop(self)\nStop the control channel and release resources.", - "start_line": 27, - "end_line": 28, - "metadata": { - "symbol_id": "54b5adf9866c526836221dc721b474ba23fbec83e1b1d3b8bc4da67ae3c1541d", - "qname": "ControlChannel.stop", - "kind": "method", - "signature": "stop(self)", - "parent_symbol_id": "ControlChannel", - "package_or_module": "src.app_runtime.control.base", - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C0_SOURCE_CHUNKS", - "path": "src/app_runtime/control/service.py", - "title": "src/app_runtime/control/service.py:ControlPlaneService", - "content": "class ControlPlaneService:\n def __init__(self) -> None:\n self._channels: list[ControlChannel] = []\n\n def register_channel(self, channel: ControlChannel) -> None:\n self._channels.append(channel)\n\n def start(self, runtime: RuntimeManager) -> None:\n if not self._channels:\n return\n asyncio.run(self._start_async(runtime))\n\n def stop(self) -> None:\n if not self._channels:\n return\n asyncio.run(self._stop_async())\n\n def snapshot(self, runtime: RuntimeManager) -> dict[str, object]:\n health = runtime.current_health()\n return {\n \"runtime\": {\"state\": runtime._state.value},\n \"modules\": list(runtime.registry.modules),\n \"services\": runtime.services.snapshot(),\n \"workers\": runtime.workers.snapshot(),\n \"health\": runtime.health.snapshot(runtime.workers.healths()) | {\"status\": health[\"status\"]},\n \"config\": runtime.configuration.get(),\n }\n\n async def _start_async(self, runtime: RuntimeManager) -> None:\n actions = ControlActionSet(\n health=runtime.health_status,\n start=runtime.start_runtime,\n stop=runtime.stop_runtime,\n status=runtime.runtime_status,\n )\n for channel in self._channels:\n await channel.start(actions)\n\n async def _stop_async(self) -> None:\n for channel in reversed(self._channels):\n await channel.stop()", - "start_line": 12, - "end_line": 52, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.service", - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C0_SOURCE_CHUNKS", - "path": "src/app_runtime/control/http_runner.py", - "title": "src/app_runtime/control/http_runner.py:UvicornThreadRunner", - "content": "class UvicornThreadRunner:\n def __init__(self, host: str, port: int, timeout: int) -> None:\n self._host = host\n self._port = port\n self._timeout = timeout\n self._server: Server | None = None\n self._thread: Thread | None = None\n self._error: BaseException | None = None\n\n async def start(self, app: FastAPI) -> None:\n if self._thread is not None and self._thread.is_alive():\n return\n self._error = None\n config = Config(app=app, host=self._host, port=self._port, log_level=\"warning\")\n self._server = Server(config)\n self._thread = Thread(target=self._serve, name=\"plba-http-control\", daemon=True)\n self._thread.start()\n await self._wait_until_started()\n\n async def stop(self) -> None:\n if self._server is None or self._thread is None:\n return\n self._server.should_exit = True\n await asyncio.to_thread(self._thread.join, self._timeout)\n self._server = None\n self._thread = None\n\n @property\n def port(self) -> int:\n if self._server is None or not getattr(self._server, \"servers\", None):\n return self._port\n socket = self._server.servers[0].sockets[0]\n return int(socket.getsockname()[1])\n\n async def _wait_until_started(self) -> None:\n if self._server is None:\n raise RuntimeError(\"Server is not initialized\")\n deadline = asyncio.get_running_loop().time() + max(float(self._timeout), 1.0)\n while not self._server.started:\n if self._error is not None:\n raise RuntimeError(\"HTTP control server failed to start\") from self._error\n if asyncio.get_running_loop().time() >= deadline:\n raise TimeoutError(\"HTTP control server startup timed out\")\n await asyncio.sleep(0.05)\n\n def _serve(self) -> None:\n if self._server is None:\n return\n try:\n asyncio.run(self._server.serve())\n except BaseException as exc: # noqa: BLE001\n self._error = exc", - "start_line": 10, - "end_line": 61, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.http_runner", - "is_test": false, - "blob_sha": "3779fdd2878b770e789a35bb2a89c9d79f13b61c26d7db1b3b683f9bb9e1623f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C0_SOURCE_CHUNKS", - "path": "src/app_runtime/control/base.py", - "title": "src/app_runtime/control/base.py:ControlChannel", - "content": "class ControlChannel(ABC):\n @abstractmethod\n async def start(self, actions: ControlActionSet) -> None:\n \"\"\"Start the control channel and bind handlers.\"\"\"\n\n @abstractmethod\n async def stop(self) -> None:\n \"\"\"Stop the control channel and release resources.\"\"\"", - "start_line": 21, - "end_line": 28, - "metadata": { - "chunk_index": 1, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.base", - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C0_SOURCE_CHUNKS", - "path": "src/app_runtime/control/__init__.py", - "title": "src/app_runtime/control/__init__.py:1-5", - "content": "from app_runtime.control.base import ControlActionSet, ControlChannel\nfrom app_runtime.control.http_channel import HttpControlChannel\nfrom app_runtime.control.service import ControlPlaneService\n\n__all__ = [\"ControlActionSet\", \"ControlChannel\", \"ControlPlaneService\", \"HttpControlChannel\"]", - "start_line": 1, - "end_line": 5, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.app_runtime.control.__init__", - "is_test": false, - "blob_sha": "bf3c37e3369a84cc618adc0fd71c232e5eb4b871eaff743069a17e661e498316", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C0_SOURCE_CHUNKS", - "path": "src/app_runtime/control/http_app.py", - "title": "src/app_runtime/control/http_app.py:HttpControlAppFactory", - "content": "class HttpControlAppFactory:\n def create(\n self,\n health_provider: Callable[[], Awaitable[HealthPayload]],\n action_provider: Callable[[str, str], Awaitable[JSONResponse]],\n ) -> FastAPI:\n app = FastAPI(title=\"PLBA Control API\")\n\n @app.middleware(\"http\")\n async def log_api_call(request: Request, call_next): # type: ignore[no-untyped-def]\n started = time.monotonic()\n response = await call_next(request)\n response.headers[\"X-Response-Time-Ms\"] = str(int((time.monotonic() - started) * 1000))\n return response\n\n @app.get(\"/health\")\n async def health() -> JSONResponse:\n payload = await health_provider()\n status_code = 200 if payload.get(\"status\") == \"ok\" else 503\n return JSONResponse(content=payload, status_code=status_code)\n\n @app.get(\"/actions/{action}\")\n @app.post(\"/actions/{action}\")\n async def action(action: str, request: Request) -> JSONResponse:\n client_source = self._client_source(request)\n if action in {\"start\", \"stop\"}:\n LOGGER.warning(\"Control action requested: /actions/%s client=%s\", action, client_source)\n return await action_provider(action, client_source)\n\n return app\n\n def _client_source(self, request: Request) -> str:\n explicit_header = request.headers.get(\"X-Client-Source\", \"\").strip()\n if explicit_header:\n return explicit_header\n user_agent = request.headers.get(\"User-Agent\", \"\").strip()\n if user_agent:\n return f\"user-agent:{user_agent}\"\n return \"unknown\"", - "start_line": 15, - "end_line": 53, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.http_app", - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C0_SOURCE_CHUNKS", - "path": "src/app_runtime/control/http_channel.py", - "title": "src/app_runtime/control/http_channel.py:HttpControlChannel", - "content": "class HttpControlChannel(ControlChannel):\n def __init__(self, host: str, port: int, timeout: int) -> None:\n self._timeout = timeout\n self._runner = UvicornThreadRunner(host, port, timeout)\n self._factory = HttpControlAppFactory()\n self._actions: ControlActionSet | None = None\n\n async def start(self, actions: ControlActionSet) -> None:\n self._actions = actions\n app = self._factory.create(self._health_response, self._action_response)\n await self._runner.start(app)\n\n async def stop(self) -> None:\n await self._runner.stop()\n\n @property\n def port(self) -> int:\n return self._runner.port\n\n async def _health_response(self) -> dict[str, object]:\n if self._actions is None:\n return {\"status\": \"unhealthy\", \"detail\": \"control actions are not configured\"}\n return await asyncio.wait_for(self._actions.health(), timeout=float(self._timeout))\n\n async def _action_response(self, action: str, _client_source: str = \"unknown\") -> JSONResponse:\n if self._actions is None:\n return JSONResponse(content={\"status\": \"error\", \"detail\": f\"{action} handler is not configured\"}, status_code=404)\n callbacks = {\n \"start\": self._actions.start,\n \"stop\": self._actions.stop,\n \"status\": self._actions.status,\n }\n callback = callbacks.get(action)\n if callback is None:\n return JSONResponse(content={\"status\": \"error\", \"detail\": f\"unsupported action: {action}\"}, status_code=404)\n action_timeout = max(float(self._timeout), 10.0) if action in {\"start\", \"stop\"} else float(self._timeout)\n try:\n detail = await asyncio.wait_for(callback(), timeout=action_timeout)\n except asyncio.TimeoutError:\n return JSONResponse(\n content={\"status\": \"accepted\", \"detail\": f\"{action} operation is still in progress\"},\n status_code=202,\n )\n except Exception as exc:\n return JSONResponse(content={\"status\": \"error\", \"detail\": str(exc)}, status_code=500)\n return JSONResponse(content={\"status\": \"ok\", \"detail\": detail or f\"{action} action accepted\"}, status_code=200)", - "start_line": 12, - "end_line": 57, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.http_channel", - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C0_SOURCE_CHUNKS", - "path": "src/app_runtime/control/base.py", - "title": "src/app_runtime/control/base.py:ControlActionSet", - "content": "class ControlActionSet:\n health: HealthHandler\n start: ActionHandler\n stop: ActionHandler\n status: ActionHandler", - "start_line": 14, - "end_line": 18, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.base", - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C0_SOURCE_CHUNKS", - "path": "src/plba/control.py", - "title": "src/plba/control.py:1-10", - "content": "from app_runtime.control.base import ControlActionSet, ControlChannel\nfrom app_runtime.control.http_channel import HttpControlChannel\nfrom app_runtime.control.service import ControlPlaneService\n\n__all__ = [\n \"ControlActionSet\",\n \"ControlChannel\",\n \"ControlPlaneService\",\n \"HttpControlChannel\",\n]", - "start_line": 1, - "end_line": 10, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.plba.control", - "is_test": false, - "blob_sha": "31bd5c4481bfa7fbca8fae56d4860a67e3953ca74474ac8439e1f39b685d7bc8", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C4_SEMANTIC_ROLES", - "path": "src/app_runtime/core/runtime.py", - "title": "RuntimeManager", - "content": "RuntimeManager\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests manager\n- orchestrates role-like calls (4)\n- reads and writes state attributes\n- participates in dataflow slices (50)", - "start_line": 18, - "end_line": 179, - "metadata": { - "symbol_id": "7e4a9381328c5803bbc6179458612fc4e947d928aa7bf8b4b2bebb2c8592f758", - "symbol_name": "RuntimeManager", - "qname": "RuntimeManager", - "role": "pipeline_stage", - "confidence": 0.67, - "dataflow_participation": 50, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C4_SEMANTIC_ROLES", - "path": "src/app_runtime/control/base.py", - "title": "ControlChannel", - "content": "ControlChannel\nrole: model\n\nResponsibilities:\n- default model role", - "start_line": 21, - "end_line": 28, - "metadata": { - "symbol_id": "cfcfe9a311d3a2dbdaf32ac4ccd73c0eb9a117f830591a1c0867ee97d46204ff", - "symbol_name": "ControlChannel", - "qname": "ControlChannel", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C4_SEMANTIC_ROLES", - "path": "src/app_runtime/control/base.py", - "title": "ControlActionSet", - "content": "ControlActionSet\nrole: model\n\nResponsibilities:\n- default model role", - "start_line": 14, - "end_line": 18, - "metadata": { - "symbol_id": "46eb026cb3313415ec47b82dd22f84f4d112c9d987e8b1716dcb0baa1cce8988", - "symbol_name": "ControlActionSet", - "qname": "ControlActionSet", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C4_SEMANTIC_ROLES", - "path": "src/app_runtime/control/service.py", - "title": "ControlPlaneService", - "content": "ControlPlaneService\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests service\n- reads and writes state attributes\n- participates in dataflow slices (5)", - "start_line": 12, - "end_line": 52, - "metadata": { - "symbol_id": "b13471e5916986dccffb53fab613812842965705e6b3a89ae549d30c9e91e9aa", - "symbol_name": "ControlPlaneService", - "qname": "ControlPlaneService", - "role": "pipeline_stage", - "confidence": 0.57, - "dataflow_participation": 5, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C4_SEMANTIC_ROLES", - "path": "src/app_runtime/control/http_runner.py", - "title": "UvicornThreadRunner", - "content": "UvicornThreadRunner\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (24)", - "start_line": 10, - "end_line": 61, - "metadata": { - "symbol_id": "fd55630045a02100df8877ac27d951ee08617d4598764394d48cb51fe067476a", - "symbol_name": "UvicornThreadRunner", - "qname": "UvicornThreadRunner", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 24, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "3779fdd2878b770e789a35bb2a89c9d79f13b61c26d7db1b3b683f9bb9e1623f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C4_SEMANTIC_ROLES", - "path": "src/app_runtime/control/http_channel.py", - "title": "HttpControlChannel", - "content": "HttpControlChannel\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (10)", - "start_line": 12, - "end_line": 57, - "metadata": { - "symbol_id": "1c9fbdc24819e5604c26ea55428a74310f03a03e1af197ed84846af61e42fdb0", - "symbol_name": "HttpControlChannel", - "qname": "HttpControlChannel", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 10, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C4_SEMANTIC_ROLES", - "path": "src/app_runtime/control/http_app.py", - "title": "HttpControlAppFactory", - "content": "HttpControlAppFactory\nrole: factory\n\nResponsibilities:\n- name suffix suggests factory", - "start_line": 15, - "end_line": 53, - "metadata": { - "symbol_id": "9b3502a5fb408b273223db13264349cf500de24915b6c649d9ea8970d0dfd8e0", - "symbol_name": "HttpControlAppFactory", - "qname": "HttpControlAppFactory", - "role": "factory", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C4_SEMANTIC_ROLES", - "path": "src/app_runtime/workflow/persistence/workflow_persistence.py", - "title": "WorkflowPersistence", - "content": "WorkflowPersistence\nrole: pipeline_stage\n\nResponsibilities:\n- orchestrates role-like calls (2)\n- reads and writes state attributes\n- participates in dataflow slices (16)", - "start_line": 8, - "end_line": 54, - "metadata": { - "symbol_id": "7bd01ee45cf31f2d5c2e3e51656254860ac785d10cef9e0852cd4fba90857bae", - "symbol_name": "WorkflowPersistence", - "qname": "WorkflowPersistence", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 16, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "80e9410ddc639789b4353c2a1a757ba8d0d5b5bb6075b0b263b61551f04ae1f0", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "path": "src/app_runtime/core/runtime.py", - "title": "RuntimeManager.__init__:dataflow_slice", - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager.add_config_file", - "start_line": 32, - "end_line": 52, - "metadata": { - "edge_id": "a23b8a11ebdb12708b60c96ea12a69f7f042082f1adfddd572444e246d81d167", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "57ffbd4f0d9fdf3507c2b8624312ce211f3d02fdf86a57a8ec90778d8a7b498d", - "dst_ref": "RuntimeManager.add_config_file", - "resolution": "resolved", - "slice_id": "a23b8a11ebdb12708b60c96ea12a69f7f042082f1adfddd572444e246d81d167", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager.add_config_file" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "57ffbd4f0d9fdf3507c2b8624312ce211f3d02fdf86a57a8ec90778d8a7b498d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "path": "src/app_runtime/core/runtime.py", - "title": "RuntimeManager.__init__:dataflow_slice", - "content": "RuntimeManager.__init__\n -> RuntimeManager.services\n -> RuntimeManager.__init__", - "start_line": 33, - "end_line": 39, - "metadata": { - "edge_id": "d43af85989222ee6d788ce418cdcb217c7ff044cfb915e3bdbd184417dc7bd61", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "dst_ref": "RuntimeManager.__init__", - "resolution": "resolved", - "slice_id": "d43af85989222ee6d788ce418cdcb217c7ff044cfb915e3bdbd184417dc7bd61", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.services", - "RuntimeManager.__init__" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "path": "src/app_runtime/control/service.py", - "title": "ControlPlaneService.__init__:dataflow_slice", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.stop", - "start_line": 14, - "end_line": 25, - "metadata": { - "edge_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d", - "dst_ref": "ControlPlaneService.stop", - "resolution": "resolved", - "slice_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.stop" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "path": "src/app_runtime/control/service.py", - "title": "ControlPlaneService.__init__:dataflow_slice", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._stop_async", - "start_line": 14, - "end_line": 51, - "metadata": { - "edge_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a", - "dst_ref": "ControlPlaneService._stop_async", - "resolution": "resolved", - "slice_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._stop_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "path": "src/app_runtime/core/runtime.py", - "title": "RuntimeManager.__init__:dataflow_slice", - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager.start", - "start_line": 32, - "end_line": 59, - "metadata": { - "edge_id": "98312ace7fc62b1c7194c5aa1732b6ef736eae1668a3a120dd1ecd5ab1d64f7a", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "77a7b260193018845e4e204df094ab89cfd7c82ee4e822b3a83ad4cd945f9cb1", - "dst_ref": "RuntimeManager.start", - "resolution": "resolved", - "slice_id": "98312ace7fc62b1c7194c5aa1732b6ef736eae1668a3a120dd1ecd5ab1d64f7a", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager.start" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "77a7b260193018845e4e204df094ab89cfd7c82ee4e822b3a83ad4cd945f9cb1" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "path": "src/app_runtime/core/runtime.py", - "title": "RuntimeManager.__init__:dataflow_slice", - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager._register_core_services", - "start_line": 32, - "end_line": 127, - "metadata": { - "edge_id": "3e5811f3b511fa0cabe363f5d01f2ac5fa039bc8b93f7ee108323e1f5f45a293", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "972d6057a6caac9cf31ebc1e29c6f39f71b10d4cc170dec57cf875ba458549c6", - "dst_ref": "RuntimeManager._register_core_services", - "resolution": "resolved", - "slice_id": "3e5811f3b511fa0cabe363f5d01f2ac5fa039bc8b93f7ee108323e1f5f45a293", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager._register_core_services" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "972d6057a6caac9cf31ebc1e29c6f39f71b10d4cc170dec57cf875ba458549c6" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "path": "src/app_runtime/control/service.py", - "title": "ControlPlaneService.__init__:dataflow_slice", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.register_channel", - "start_line": 14, - "end_line": 17, - "metadata": { - "edge_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957", - "dst_ref": "ControlPlaneService.register_channel", - "resolution": "resolved", - "slice_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.register_channel" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "path": "src/app_runtime/control/service.py", - "title": "ControlPlaneService.__init__:dataflow_slice", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.start", - "start_line": 14, - "end_line": 20, - "metadata": { - "edge_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154", - "dst_ref": "ControlPlaneService.start", - "resolution": "resolved", - "slice_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.start" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "path": "src/app_runtime/control/service.py", - "title": "ControlPlaneService.__init__:dataflow_slice", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._start_async", - "start_line": 14, - "end_line": 47, - "metadata": { - "edge_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517", - "dst_ref": "ControlPlaneService._start_async", - "resolution": "resolved", - "slice_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._start_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "path": "src/app_runtime/core/runtime.py", - "title": "RuntimeManager.__init__:dataflow_slice", - "content": "RuntimeManager.__init__\n -> RuntimeManager.services\n -> RuntimeManager._register_core_services", - "start_line": 33, - "end_line": 127, - "metadata": { - "edge_id": "aac6f9dda73963b977083a892bee39a48eca4fbd7404787e022ecf4ebedec65d", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "972d6057a6caac9cf31ebc1e29c6f39f71b10d4cc170dec57cf875ba458549c6", - "dst_ref": "RuntimeManager._register_core_services", - "resolution": "resolved", - "slice_id": "aac6f9dda73963b977083a892bee39a48eca4fbd7404787e022ecf4ebedec65d", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.services", - "RuntimeManager._register_core_services" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "972d6057a6caac9cf31ebc1e29c6f39f71b10d4cc170dec57cf875ba458549c6" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C3_ENTRYPOINTS", - "path": "src/app_runtime/control/http_app.py", - "title": "app.post", - "content": "fastapi http app.post", - "start_line": 38, - "end_line": 42, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C3_ENTRYPOINTS", - "path": "src/app_runtime/control/http_app.py", - "title": "app.get", - "content": "fastapi http app.get", - "start_line": 31, - "end_line": 34, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C3_ENTRYPOINTS", - "path": "src/app_runtime/control/http_app.py", - "title": "app.get", - "content": "fastapi http app.get", - "start_line": 38, - "end_line": 42, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "relations": [ - { - "path": "src/app_runtime/core/runtime.py", - "start_line": 32, - "end_line": 52, - "edge_type": "dataflow_slice", - "source": "RuntimeManager.__init__", - "target": "RuntimeManager.add_config_file", - "metadata": { - "edge_id": "a23b8a11ebdb12708b60c96ea12a69f7f042082f1adfddd572444e246d81d167", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "57ffbd4f0d9fdf3507c2b8624312ce211f3d02fdf86a57a8ec90778d8a7b498d", - "dst_ref": "RuntimeManager.add_config_file", - "resolution": "resolved", - "slice_id": "a23b8a11ebdb12708b60c96ea12a69f7f042082f1adfddd572444e246d81d167", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager.add_config_file" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "57ffbd4f0d9fdf3507c2b8624312ce211f3d02fdf86a57a8ec90778d8a7b498d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - }, - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager.add_config_file" - }, - { - "path": "src/app_runtime/core/runtime.py", - "start_line": 33, - "end_line": 39, - "edge_type": "dataflow_slice", - "source": "RuntimeManager.__init__", - "target": "RuntimeManager.__init__", - "metadata": { - "edge_id": "d43af85989222ee6d788ce418cdcb217c7ff044cfb915e3bdbd184417dc7bd61", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "dst_ref": "RuntimeManager.__init__", - "resolution": "resolved", - "slice_id": "d43af85989222ee6d788ce418cdcb217c7ff044cfb915e3bdbd184417dc7bd61", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.services", - "RuntimeManager.__init__" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - }, - "content": "RuntimeManager.__init__\n -> RuntimeManager.services\n -> RuntimeManager.__init__" - }, - { - "path": "src/app_runtime/control/service.py", - "start_line": 14, - "end_line": 25, - "edge_type": "dataflow_slice", - "source": "ControlPlaneService.__init__", - "target": "ControlPlaneService.stop", - "metadata": { - "edge_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d", - "dst_ref": "ControlPlaneService.stop", - "resolution": "resolved", - "slice_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.stop" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - }, - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.stop" - }, - { - "path": "src/app_runtime/control/service.py", - "start_line": 14, - "end_line": 51, - "edge_type": "dataflow_slice", - "source": "ControlPlaneService.__init__", - "target": "ControlPlaneService._stop_async", - "metadata": { - "edge_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a", - "dst_ref": "ControlPlaneService._stop_async", - "resolution": "resolved", - "slice_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._stop_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - }, - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._stop_async" - }, - { - "path": "src/app_runtime/core/runtime.py", - "start_line": 32, - "end_line": 59, - "edge_type": "dataflow_slice", - "source": "RuntimeManager.__init__", - "target": "RuntimeManager.start", - "metadata": { - "edge_id": "98312ace7fc62b1c7194c5aa1732b6ef736eae1668a3a120dd1ecd5ab1d64f7a", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "77a7b260193018845e4e204df094ab89cfd7c82ee4e822b3a83ad4cd945f9cb1", - "dst_ref": "RuntimeManager.start", - "resolution": "resolved", - "slice_id": "98312ace7fc62b1c7194c5aa1732b6ef736eae1668a3a120dd1ecd5ab1d64f7a", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager.start" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "77a7b260193018845e4e204df094ab89cfd7c82ee4e822b3a83ad4cd945f9cb1" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - }, - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager.start" - }, - { - "path": "src/app_runtime/core/runtime.py", - "start_line": 32, - "end_line": 127, - "edge_type": "dataflow_slice", - "source": "RuntimeManager.__init__", - "target": "RuntimeManager._register_core_services", - "metadata": { - "edge_id": "3e5811f3b511fa0cabe363f5d01f2ac5fa039bc8b93f7ee108323e1f5f45a293", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "972d6057a6caac9cf31ebc1e29c6f39f71b10d4cc170dec57cf875ba458549c6", - "dst_ref": "RuntimeManager._register_core_services", - "resolution": "resolved", - "slice_id": "3e5811f3b511fa0cabe363f5d01f2ac5fa039bc8b93f7ee108323e1f5f45a293", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager._register_core_services" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "972d6057a6caac9cf31ebc1e29c6f39f71b10d4cc170dec57cf875ba458549c6" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - }, - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager._register_core_services" - }, - { - "path": "src/app_runtime/control/service.py", - "start_line": 14, - "end_line": 17, - "edge_type": "dataflow_slice", - "source": "ControlPlaneService.__init__", - "target": "ControlPlaneService.register_channel", - "metadata": { - "edge_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957", - "dst_ref": "ControlPlaneService.register_channel", - "resolution": "resolved", - "slice_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.register_channel" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - }, - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.register_channel" - }, - { - "path": "src/app_runtime/control/service.py", - "start_line": 14, - "end_line": 20, - "edge_type": "dataflow_slice", - "source": "ControlPlaneService.__init__", - "target": "ControlPlaneService.start", - "metadata": { - "edge_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154", - "dst_ref": "ControlPlaneService.start", - "resolution": "resolved", - "slice_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.start" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - }, - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.start" - }, - { - "path": "src/app_runtime/control/service.py", - "start_line": 14, - "end_line": 47, - "edge_type": "dataflow_slice", - "source": "ControlPlaneService.__init__", - "target": "ControlPlaneService._start_async", - "metadata": { - "edge_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517", - "dst_ref": "ControlPlaneService._start_async", - "resolution": "resolved", - "slice_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._start_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - }, - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._start_async" - }, - { - "path": "src/app_runtime/core/runtime.py", - "start_line": 33, - "end_line": 127, - "edge_type": "dataflow_slice", - "source": "RuntimeManager.__init__", - "target": "RuntimeManager._register_core_services", - "metadata": { - "edge_id": "aac6f9dda73963b977083a892bee39a48eca4fbd7404787e022ecf4ebedec65d", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "972d6057a6caac9cf31ebc1e29c6f39f71b10d4cc170dec57cf875ba458549c6", - "dst_ref": "RuntimeManager._register_core_services", - "resolution": "resolved", - "slice_id": "aac6f9dda73963b977083a892bee39a48eca4fbd7404787e022ecf4ebedec65d", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.services", - "RuntimeManager._register_core_services" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "972d6057a6caac9cf31ebc1e29c6f39f71b10d4cc170dec57cf875ba458549c6" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - }, - "content": "RuntimeManager.__init__\n -> RuntimeManager.services\n -> RuntimeManager._register_core_services" - } - ], - "semantic_hints": [ - { - "path": "src/app_runtime/core/runtime.py", - "title": "RuntimeManager", - "symbol": "RuntimeManager", - "role": "pipeline_stage", - "confidence": 0.67, - "content": "RuntimeManager\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests manager\n- orchestrates role-like calls (4)\n- reads and writes state attributes\n- participates in dataflow slices (50)" - }, - { - "path": "src/app_runtime/control/base.py", - "title": "ControlChannel", - "symbol": "ControlChannel", - "role": "model", - "confidence": 0.99, - "content": "ControlChannel\nrole: model\n\nResponsibilities:\n- default model role" - }, - { - "path": "src/app_runtime/control/base.py", - "title": "ControlActionSet", - "symbol": "ControlActionSet", - "role": "model", - "confidence": 0.99, - "content": "ControlActionSet\nrole: model\n\nResponsibilities:\n- default model role" - }, - { - "path": "src/app_runtime/control/service.py", - "title": "ControlPlaneService", - "symbol": "ControlPlaneService", - "role": "pipeline_stage", - "confidence": 0.57, - "content": "ControlPlaneService\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests service\n- reads and writes state attributes\n- participates in dataflow slices (5)" - }, - { - "path": "src/app_runtime/control/http_runner.py", - "title": "UvicornThreadRunner", - "symbol": "UvicornThreadRunner", - "role": "pipeline_stage", - "confidence": 0.99, - "content": "UvicornThreadRunner\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (24)" - }, - { - "path": "src/app_runtime/control/http_channel.py", - "title": "HttpControlChannel", - "symbol": "HttpControlChannel", - "role": "pipeline_stage", - "confidence": 0.99, - "content": "HttpControlChannel\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (10)" - }, - { - "path": "src/app_runtime/control/http_app.py", - "title": "HttpControlAppFactory", - "symbol": "HttpControlAppFactory", - "role": "factory", - "confidence": 0.99, - "content": "HttpControlAppFactory\nrole: factory\n\nResponsibilities:\n- name suffix suggests factory" - }, - { - "path": "src/app_runtime/workflow/persistence/workflow_persistence.py", - "title": "WorkflowPersistence", - "symbol": "WorkflowPersistence", - "role": "pipeline_stage", - "confidence": 0.99, - "content": "WorkflowPersistence\nrole: pipeline_stage\n\nResponsibilities:\n- orchestrates role-like calls (2)\n- reads and writes state attributes\n- participates in dataflow slices (16)" - } - ], - "entrypoints": [ - { - "path": "src/app_runtime/control/http_app.py", - "title": "app.get", - "start_line": 31, - "end_line": 34, - "http_method": "GET", - "route_path": "/health", - "handler_symbol": "health", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "route_or_command": "app.get", - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "title": "app.get", - "start_line": 38, - "end_line": 42, - "http_method": "GET", - "route_path": "/actions/{action}", - "handler_symbol": "action", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "route_or_command": "app.get", - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "title": "app.post", - "start_line": 38, - "end_line": 42, - "http_method": "POST", - "route_path": "/actions/{action}", - "handler_symbol": "action", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "route_or_command": "app.post", - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "test_candidates": [], - "layer_outcomes": [ - { - "layer_id": "C1_SYMBOL_CATALOG", - "hit_count": 8, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C0_SOURCE_CHUNKS", - "hit_count": 8, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C4_SEMANTIC_ROLES", - "hit_count": 8, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C2_DEPENDENCY_GRAPH", - "hit_count": 10, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C3_ENTRYPOINTS", - "hit_count": 3, - "empty": false, - "fallback_used": false - } - ], - "missing_layers": [], - "raw_rows": [ - { - "path": "src/plba/bootstrap.py", - "content": "const RuntimeManager\nRuntimeManager = app_runtime.core.runtime.RuntimeManager", - "layer": "C1_SYMBOL_CATALOG", - "title": "RuntimeManager", - "span_start": 4, - "span_end": 4, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": null, - "metadata": { - "symbol_id": "27158ca220022eeb5083c6addf8a50775d45f7161284fd60aac48410105f4b98", - "qname": "RuntimeManager", - "kind": "const", - "signature": "RuntimeManager = app_runtime.core.runtime.RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "src.plba.bootstrap", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "const RuntimeManager\nRuntimeManager = app_runtime.core.runtime.RuntimeManager", - "layer": "C1_SYMBOL_CATALOG", - "title": "RuntimeManager", - "span_start": 9, - "span_end": 9, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": null, - "metadata": { - "symbol_id": "62a9575c77aad894120d18b4f2a08cf2ba42f77e9be4a8a432b767d157701afe", - "qname": "RuntimeManager", - "kind": "const", - "signature": "RuntimeManager = app_runtime.core.runtime.RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.control.service", - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "class RuntimeManager\nRuntimeManager", - "layer": "C1_SYMBOL_CATALOG", - "title": "RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": null, - "metadata": { - "symbol_id": "7e4a9381328c5803bbc6179458612fc4e947d928aa7bf8b4b2bebb2c8592f758", - "qname": "RuntimeManager", - "kind": "class", - "signature": "RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.core.runtime", - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/__init__.py", - "content": "const RuntimeManager\nRuntimeManager = plba.core.RuntimeManager", - "layer": "C1_SYMBOL_CATALOG", - "title": "RuntimeManager", - "span_start": 16, - "span_end": 16, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": null, - "metadata": { - "symbol_id": "7eacec84f9b8d6c4201374591faecdac7493091c263681495c338973f2971ad9", - "qname": "RuntimeManager", - "kind": "const", - "signature": "RuntimeManager = plba.core.RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "src.plba.__init__", - "is_test": false, - "blob_sha": "24e755ec8c249d14fb0e675b5dbf2b71ab91afb9c849897eebfa9feb2499e19d", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/core.py", - "content": "const RuntimeManager\nRuntimeManager = app_runtime.core.runtime.RuntimeManager", - "layer": "C1_SYMBOL_CATALOG", - "title": "RuntimeManager", - "span_start": 2, - "span_end": 2, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": null, - "metadata": { - "symbol_id": "e1684562d978b7af7fe9b27dc5869d770348a87b5dc19a50360f58544668578b", - "qname": "RuntimeManager", - "kind": "const", - "signature": "RuntimeManager = app_runtime.core.runtime.RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "src.plba.core", - "is_test": false, - "blob_sha": "c0ae25110d20e665216616e26b68adfe035b624ba45d31d1272fb21f906f9ca8", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/__init__.py", - "content": "const ControlPlaneService\nControlPlaneService = app_runtime.control.service.ControlPlaneService", - "layer": "C1_SYMBOL_CATALOG", - "title": "ControlPlaneService", - "span_start": 3, - "span_end": 3, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": null, - "metadata": { - "symbol_id": "217e8f044d1c01644bf7b81e5046af9e84469210c692a2fb0c476a19bb069ae1", - "qname": "ControlPlaneService", - "kind": "const", - "signature": "ControlPlaneService = app_runtime.control.service.ControlPlaneService", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.control.__init__", - "is_test": false, - "blob_sha": "bf3c37e3369a84cc618adc0fd71c232e5eb4b871eaff743069a17e661e498316", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "method ControlChannel.start\nstart(self, actions)\nStart the control channel and bind handlers.", - "layer": "C1_SYMBOL_CATALOG", - "title": "ControlChannel.start", - "span_start": 23, - "span_end": 24, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": null, - "metadata": { - "symbol_id": "e01e0d50d0f48d0c84c119c989b7a7c57ceea263811ce2605c684ae24d1a03b1", - "qname": "ControlChannel.start", - "kind": "method", - "signature": "start(self, actions)", - "parent_symbol_id": "ControlChannel", - "package_or_module": "src.app_runtime.control.base", - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "method ControlChannel.stop\nstop(self)\nStop the control channel and release resources.", - "layer": "C1_SYMBOL_CATALOG", - "title": "ControlChannel.stop", - "span_start": 27, - "span_end": 28, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": null, - "metadata": { - "symbol_id": "54b5adf9866c526836221dc721b474ba23fbec83e1b1d3b8bc4da67ae3c1541d", - "qname": "ControlChannel.stop", - "kind": "method", - "signature": "stop(self)", - "parent_symbol_id": "ControlChannel", - "package_or_module": "src.app_runtime.control.base", - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "class ControlPlaneService:\n def __init__(self) -> None:\n self._channels: list[ControlChannel] = []\n\n def register_channel(self, channel: ControlChannel) -> None:\n self._channels.append(channel)\n\n def start(self, runtime: RuntimeManager) -> None:\n if not self._channels:\n return\n asyncio.run(self._start_async(runtime))\n\n def stop(self) -> None:\n if not self._channels:\n return\n asyncio.run(self._stop_async())\n\n def snapshot(self, runtime: RuntimeManager) -> dict[str, object]:\n health = runtime.current_health()\n return {\n \"runtime\": {\"state\": runtime._state.value},\n \"modules\": list(runtime.registry.modules),\n \"services\": runtime.services.snapshot(),\n \"workers\": runtime.workers.snapshot(),\n \"health\": runtime.health.snapshot(runtime.workers.healths()) | {\"status\": health[\"status\"]},\n \"config\": runtime.configuration.get(),\n }\n\n async def _start_async(self, runtime: RuntimeManager) -> None:\n actions = ControlActionSet(\n health=runtime.health_status,\n start=runtime.start_runtime,\n stop=runtime.stop_runtime,\n status=runtime.runtime_status,\n )\n for channel in self._channels:\n await channel.start(actions)\n\n async def _stop_async(self) -> None:\n for channel in reversed(self._channels):\n await channel.stop()", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/service.py:ControlPlaneService", - "span_start": 12, - "span_end": 52, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": null, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.service", - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_runner.py", - "content": "class UvicornThreadRunner:\n def __init__(self, host: str, port: int, timeout: int) -> None:\n self._host = host\n self._port = port\n self._timeout = timeout\n self._server: Server | None = None\n self._thread: Thread | None = None\n self._error: BaseException | None = None\n\n async def start(self, app: FastAPI) -> None:\n if self._thread is not None and self._thread.is_alive():\n return\n self._error = None\n config = Config(app=app, host=self._host, port=self._port, log_level=\"warning\")\n self._server = Server(config)\n self._thread = Thread(target=self._serve, name=\"plba-http-control\", daemon=True)\n self._thread.start()\n await self._wait_until_started()\n\n async def stop(self) -> None:\n if self._server is None or self._thread is None:\n return\n self._server.should_exit = True\n await asyncio.to_thread(self._thread.join, self._timeout)\n self._server = None\n self._thread = None\n\n @property\n def port(self) -> int:\n if self._server is None or not getattr(self._server, \"servers\", None):\n return self._port\n socket = self._server.servers[0].sockets[0]\n return int(socket.getsockname()[1])\n\n async def _wait_until_started(self) -> None:\n if self._server is None:\n raise RuntimeError(\"Server is not initialized\")\n deadline = asyncio.get_running_loop().time() + max(float(self._timeout), 1.0)\n while not self._server.started:\n if self._error is not None:\n raise RuntimeError(\"HTTP control server failed to start\") from self._error\n if asyncio.get_running_loop().time() >= deadline:\n raise TimeoutError(\"HTTP control server startup timed out\")\n await asyncio.sleep(0.05)\n\n def _serve(self) -> None:\n if self._server is None:\n return\n try:\n asyncio.run(self._server.serve())\n except BaseException as exc: # noqa: BLE001\n self._error = exc", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/http_runner.py:UvicornThreadRunner", - "span_start": 10, - "span_end": 61, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": null, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.http_runner", - "is_test": false, - "blob_sha": "3779fdd2878b770e789a35bb2a89c9d79f13b61c26d7db1b3b683f9bb9e1623f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "class ControlChannel(ABC):\n @abstractmethod\n async def start(self, actions: ControlActionSet) -> None:\n \"\"\"Start the control channel and bind handlers.\"\"\"\n\n @abstractmethod\n async def stop(self) -> None:\n \"\"\"Stop the control channel and release resources.\"\"\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/base.py:ControlChannel", - "span_start": 21, - "span_end": 28, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": null, - "metadata": { - "chunk_index": 1, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.base", - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/__init__.py", - "content": "from app_runtime.control.base import ControlActionSet, ControlChannel\nfrom app_runtime.control.http_channel import HttpControlChannel\nfrom app_runtime.control.service import ControlPlaneService\n\n__all__ = [\"ControlActionSet\", \"ControlChannel\", \"ControlPlaneService\", \"HttpControlChannel\"]", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/__init__.py:1-5", - "span_start": 1, - "span_end": 5, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": null, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.app_runtime.control.__init__", - "is_test": false, - "blob_sha": "bf3c37e3369a84cc618adc0fd71c232e5eb4b871eaff743069a17e661e498316", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "class HttpControlAppFactory:\n def create(\n self,\n health_provider: Callable[[], Awaitable[HealthPayload]],\n action_provider: Callable[[str, str], Awaitable[JSONResponse]],\n ) -> FastAPI:\n app = FastAPI(title=\"PLBA Control API\")\n\n @app.middleware(\"http\")\n async def log_api_call(request: Request, call_next): # type: ignore[no-untyped-def]\n started = time.monotonic()\n response = await call_next(request)\n response.headers[\"X-Response-Time-Ms\"] = str(int((time.monotonic() - started) * 1000))\n return response\n\n @app.get(\"/health\")\n async def health() -> JSONResponse:\n payload = await health_provider()\n status_code = 200 if payload.get(\"status\") == \"ok\" else 503\n return JSONResponse(content=payload, status_code=status_code)\n\n @app.get(\"/actions/{action}\")\n @app.post(\"/actions/{action}\")\n async def action(action: str, request: Request) -> JSONResponse:\n client_source = self._client_source(request)\n if action in {\"start\", \"stop\"}:\n LOGGER.warning(\"Control action requested: /actions/%s client=%s\", action, client_source)\n return await action_provider(action, client_source)\n\n return app\n\n def _client_source(self, request: Request) -> str:\n explicit_header = request.headers.get(\"X-Client-Source\", \"\").strip()\n if explicit_header:\n return explicit_header\n user_agent = request.headers.get(\"User-Agent\", \"\").strip()\n if user_agent:\n return f\"user-agent:{user_agent}\"\n return \"unknown\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/http_app.py:HttpControlAppFactory", - "span_start": 15, - "span_end": 53, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": null, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.http_app", - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "class HttpControlChannel(ControlChannel):\n def __init__(self, host: str, port: int, timeout: int) -> None:\n self._timeout = timeout\n self._runner = UvicornThreadRunner(host, port, timeout)\n self._factory = HttpControlAppFactory()\n self._actions: ControlActionSet | None = None\n\n async def start(self, actions: ControlActionSet) -> None:\n self._actions = actions\n app = self._factory.create(self._health_response, self._action_response)\n await self._runner.start(app)\n\n async def stop(self) -> None:\n await self._runner.stop()\n\n @property\n def port(self) -> int:\n return self._runner.port\n\n async def _health_response(self) -> dict[str, object]:\n if self._actions is None:\n return {\"status\": \"unhealthy\", \"detail\": \"control actions are not configured\"}\n return await asyncio.wait_for(self._actions.health(), timeout=float(self._timeout))\n\n async def _action_response(self, action: str, _client_source: str = \"unknown\") -> JSONResponse:\n if self._actions is None:\n return JSONResponse(content={\"status\": \"error\", \"detail\": f\"{action} handler is not configured\"}, status_code=404)\n callbacks = {\n \"start\": self._actions.start,\n \"stop\": self._actions.stop,\n \"status\": self._actions.status,\n }\n callback = callbacks.get(action)\n if callback is None:\n return JSONResponse(content={\"status\": \"error\", \"detail\": f\"unsupported action: {action}\"}, status_code=404)\n action_timeout = max(float(self._timeout), 10.0) if action in {\"start\", \"stop\"} else float(self._timeout)\n try:\n detail = await asyncio.wait_for(callback(), timeout=action_timeout)\n except asyncio.TimeoutError:\n return JSONResponse(\n content={\"status\": \"accepted\", \"detail\": f\"{action} operation is still in progress\"},\n status_code=202,\n )\n except Exception as exc:\n return JSONResponse(content={\"status\": \"error\", \"detail\": str(exc)}, status_code=500)\n return JSONResponse(content={\"status\": \"ok\", \"detail\": detail or f\"{action} action accepted\"}, status_code=200)", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/http_channel.py:HttpControlChannel", - "span_start": 12, - "span_end": 57, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": null, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.http_channel", - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "class ControlActionSet:\n health: HealthHandler\n start: ActionHandler\n stop: ActionHandler\n status: ActionHandler", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/base.py:ControlActionSet", - "span_start": 14, - "span_end": 18, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": null, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.base", - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/control.py", - "content": "from app_runtime.control.base import ControlActionSet, ControlChannel\nfrom app_runtime.control.http_channel import HttpControlChannel\nfrom app_runtime.control.service import ControlPlaneService\n\n__all__ = [\n \"ControlActionSet\",\n \"ControlChannel\",\n \"ControlPlaneService\",\n \"HttpControlChannel\",\n]", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/plba/control.py:1-10", - "span_start": 1, - "span_end": 10, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": null, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.plba.control", - "is_test": false, - "blob_sha": "31bd5c4481bfa7fbca8fae56d4860a67e3953ca74474ac8439e1f39b685d7bc8", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests manager\n- orchestrates role-like calls (4)\n- reads and writes state attributes\n- participates in dataflow slices (50)", - "layer": "C4_SEMANTIC_ROLES", - "title": "RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 43, - "layer_rank": 2, - "distance": null, - "metadata": { - "symbol_id": "7e4a9381328c5803bbc6179458612fc4e947d928aa7bf8b4b2bebb2c8592f758", - "symbol_name": "RuntimeManager", - "qname": "RuntimeManager", - "role": "pipeline_stage", - "confidence": 0.67, - "dataflow_participation": 50, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "ControlChannel\nrole: model\n\nResponsibilities:\n- default model role", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlChannel", - "span_start": 21, - "span_end": 28, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 40, - "layer_rank": 2, - "distance": null, - "metadata": { - "symbol_id": "cfcfe9a311d3a2dbdaf32ac4ccd73c0eb9a117f830591a1c0867ee97d46204ff", - "symbol_name": "ControlChannel", - "qname": "ControlChannel", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "ControlActionSet\nrole: model\n\nResponsibilities:\n- default model role", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlActionSet", - "span_start": 14, - "span_end": 18, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 40, - "layer_rank": 2, - "distance": null, - "metadata": { - "symbol_id": "46eb026cb3313415ec47b82dd22f84f4d112c9d987e8b1716dcb0baa1cce8988", - "symbol_name": "ControlActionSet", - "qname": "ControlActionSet", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests service\n- reads and writes state attributes\n- participates in dataflow slices (5)", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlPlaneService", - "span_start": 12, - "span_end": 52, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 68, - "layer_rank": 2, - "distance": null, - "metadata": { - "symbol_id": "b13471e5916986dccffb53fab613812842965705e6b3a89ae549d30c9e91e9aa", - "symbol_name": "ControlPlaneService", - "qname": "ControlPlaneService", - "role": "pipeline_stage", - "confidence": 0.57, - "dataflow_participation": 5, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_runner.py", - "content": "UvicornThreadRunner\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (24)", - "layer": "C4_SEMANTIC_ROLES", - "title": "UvicornThreadRunner", - "span_start": 10, - "span_end": 61, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 11, - "layer_rank": 2, - "distance": null, - "metadata": { - "symbol_id": "fd55630045a02100df8877ac27d951ee08617d4598764394d48cb51fe067476a", - "symbol_name": "UvicornThreadRunner", - "qname": "UvicornThreadRunner", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 24, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "3779fdd2878b770e789a35bb2a89c9d79f13b61c26d7db1b3b683f9bb9e1623f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (10)", - "layer": "C4_SEMANTIC_ROLES", - "title": "HttpControlChannel", - "span_start": 12, - "span_end": 57, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 21, - "layer_rank": 2, - "distance": null, - "metadata": { - "symbol_id": "1c9fbdc24819e5604c26ea55428a74310f03a03e1af197ed84846af61e42fdb0", - "symbol_name": "HttpControlChannel", - "qname": "HttpControlChannel", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 10, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "HttpControlAppFactory\nrole: factory\n\nResponsibilities:\n- name suffix suggests factory", - "layer": "C4_SEMANTIC_ROLES", - "title": "HttpControlAppFactory", - "span_start": 15, - "span_end": 53, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 39, - "layer_rank": 2, - "distance": null, - "metadata": { - "symbol_id": "9b3502a5fb408b273223db13264349cf500de24915b6c649d9ea8970d0dfd8e0", - "symbol_name": "HttpControlAppFactory", - "qname": "HttpControlAppFactory", - "role": "factory", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/persistence/workflow_persistence.py", - "content": "WorkflowPersistence\nrole: pipeline_stage\n\nResponsibilities:\n- orchestrates role-like calls (2)\n- reads and writes state attributes\n- participates in dataflow slices (16)", - "layer": "C4_SEMANTIC_ROLES", - "title": "WorkflowPersistence", - "span_start": 8, - "span_end": 54, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 15, - "layer_rank": 2, - "distance": null, - "metadata": { - "symbol_id": "7bd01ee45cf31f2d5c2e3e51656254860ac785d10cef9e0852cd4fba90857bae", - "symbol_name": "WorkflowPersistence", - "qname": "WorkflowPersistence", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 16, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "80e9410ddc639789b4353c2a1a757ba8d0d5b5bb6075b0b263b61551f04ae1f0", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager.add_config_file", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 32, - "span_end": 52, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": null, - "metadata": { - "edge_id": "a23b8a11ebdb12708b60c96ea12a69f7f042082f1adfddd572444e246d81d167", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "57ffbd4f0d9fdf3507c2b8624312ce211f3d02fdf86a57a8ec90778d8a7b498d", - "dst_ref": "RuntimeManager.add_config_file", - "resolution": "resolved", - "slice_id": "a23b8a11ebdb12708b60c96ea12a69f7f042082f1adfddd572444e246d81d167", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager.add_config_file" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "57ffbd4f0d9fdf3507c2b8624312ce211f3d02fdf86a57a8ec90778d8a7b498d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.services\n -> RuntimeManager.__init__", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 33, - "span_end": 39, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": null, - "metadata": { - "edge_id": "d43af85989222ee6d788ce418cdcb217c7ff044cfb915e3bdbd184417dc7bd61", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "dst_ref": "RuntimeManager.__init__", - "resolution": "resolved", - "slice_id": "d43af85989222ee6d788ce418cdcb217c7ff044cfb915e3bdbd184417dc7bd61", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.services", - "RuntimeManager.__init__" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.stop", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 25, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": null, - "metadata": { - "edge_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d", - "dst_ref": "ControlPlaneService.stop", - "resolution": "resolved", - "slice_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.stop" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._stop_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 51, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": null, - "metadata": { - "edge_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a", - "dst_ref": "ControlPlaneService._stop_async", - "resolution": "resolved", - "slice_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._stop_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager.start", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 32, - "span_end": 59, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": null, - "metadata": { - "edge_id": "98312ace7fc62b1c7194c5aa1732b6ef736eae1668a3a120dd1ecd5ab1d64f7a", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "77a7b260193018845e4e204df094ab89cfd7c82ee4e822b3a83ad4cd945f9cb1", - "dst_ref": "RuntimeManager.start", - "resolution": "resolved", - "slice_id": "98312ace7fc62b1c7194c5aa1732b6ef736eae1668a3a120dd1ecd5ab1d64f7a", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager.start" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "77a7b260193018845e4e204df094ab89cfd7c82ee4e822b3a83ad4cd945f9cb1" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager._register_core_services", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 32, - "span_end": 127, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": null, - "metadata": { - "edge_id": "3e5811f3b511fa0cabe363f5d01f2ac5fa039bc8b93f7ee108323e1f5f45a293", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "972d6057a6caac9cf31ebc1e29c6f39f71b10d4cc170dec57cf875ba458549c6", - "dst_ref": "RuntimeManager._register_core_services", - "resolution": "resolved", - "slice_id": "3e5811f3b511fa0cabe363f5d01f2ac5fa039bc8b93f7ee108323e1f5f45a293", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager._register_core_services" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "972d6057a6caac9cf31ebc1e29c6f39f71b10d4cc170dec57cf875ba458549c6" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.register_channel", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 17, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": null, - "metadata": { - "edge_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957", - "dst_ref": "ControlPlaneService.register_channel", - "resolution": "resolved", - "slice_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.register_channel" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.start", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 20, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": null, - "metadata": { - "edge_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154", - "dst_ref": "ControlPlaneService.start", - "resolution": "resolved", - "slice_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.start" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._start_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 47, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": null, - "metadata": { - "edge_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517", - "dst_ref": "ControlPlaneService._start_async", - "resolution": "resolved", - "slice_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._start_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.services\n -> RuntimeManager._register_core_services", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 33, - "span_end": 127, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": null, - "metadata": { - "edge_id": "aac6f9dda73963b977083a892bee39a48eca4fbd7404787e022ecf4ebedec65d", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "972d6057a6caac9cf31ebc1e29c6f39f71b10d4cc170dec57cf875ba458549c6", - "dst_ref": "RuntimeManager._register_core_services", - "resolution": "resolved", - "slice_id": "aac6f9dda73963b977083a892bee39a48eca4fbd7404787e022ecf4ebedec65d", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.services", - "RuntimeManager._register_core_services" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "972d6057a6caac9cf31ebc1e29c6f39f71b10d4cc170dec57cf875ba458549c6" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": null, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": null, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": null, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "retrieval_report": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "vector", - "C0_SOURCE_CHUNKS": "vector", - "C4_SEMANTIC_ROLES": "vector", - "C2_DEPENDENCY_GRAPH": "vector", - "C3_ENTRYPOINTS": "vector" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 8, - "C4_SEMANTIC_ROLES": 8, - "C2_DEPENDENCY_GRAPH": 10, - "C3_ENTRYPOINTS": 10 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [] - }, - "C4_SEMANTIC_ROLES": { - "path_scope": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [] - } - }, - "fallback": { - "used": false, - "reason": null - }, - "retrieval_by_layer_ms": { - "C1_SYMBOL_CATALOG": 59, - "C0_SOURCE_CHUNKS": 45, - "C4_SEMANTIC_ROLES": 21, - "C2_DEPENDENCY_GRAPH": 62, - "C3_ENTRYPOINTS": 21 - } - } - }, - "diagnostics": { - "intent_correct": null, - "target_found": true, - "layers_used": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_sufficient": true, - "answer_mode": "normal", - "resolved_target": "RuntimeManager", - "answer_policy_branch": "normal_answer", - "decision_reason": "evidence_sufficient", - "router_result": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "retrieval_profile": "code", - "sub_intent": "TRACE_FLOW", - "path_scope": [], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "symbol_resolution_status": "resolved" - }, - "retrieval_request": { - "rag_session_id": "7d11da21-faa0-4cea-aede-aeabe069164c", - "query": "Покажи поток выполнения при запуске RuntimeManager", - "sub_intent": "TRACE_FLOW", - "path_scope": [], - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "per_layer_outcome": [ - { - "layer_id": "C1_SYMBOL_CATALOG", - "hit_count": 8, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C0_SOURCE_CHUNKS", - "hit_count": 8, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C4_SEMANTIC_ROLES", - "hit_count": 8, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C2_DEPENDENCY_GRAPH", - "hit_count": 10, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C3_ENTRYPOINTS", - "hit_count": 3, - "empty": false, - "fallback_used": false - } - ], - "empty_layers": [], - "evidence_gate_decision": { - "sufficient": true, - "failure_reasons": [], - "evidence_count": 37 - }, - "evidence_gate_input": { - "resolved_target": "RuntimeManager", - "sub_intent": "TRACE_FLOW", - "target_type": "symbol", - "evidence_count": 37, - "code_chunk_count": 37, - "entrypoint_count": 3, - "relation_count": 10, - "test_evidence_count": 0, - "symbol_resolution_status": "resolved", - "path_scope": [] - }, - "post_evidence_gate": { - "input": { - "answer_mode": "normal", - "degraded_message": "", - "resolved_target": "RuntimeManager", - "draft_answer_preview": "При запуске `RuntimeManager` выполняются следующие шаги:\n\n1. Инициализация конфигурации через `add_config_file`.\n2. Инициализация сервисов.\n3. Регистрация основных служб через `_register_core_services`.\n4. Запуск менеджера с помощью метода `start`.\n\nЭти этапы основаны на сигнатурах методов и их связ", - "repair_candidate": true - }, - "output": { - "passed": true, - "action": "return", - "reasons": [], - "repair_used": false, - "final_answer_preview": "При запуске `RuntimeManager` выполняются следующие шаги:\n\n1. Инициализация конфигурации через `add_config_file`.\n2. Инициализация сервисов.\n3. Регистрация основных служб через `_register_core_services`.\n4. Запуск менеджера с помощью метода `start`.\n\nЭти этапы основаны на сигнатурах методов и их связ" - } - }, - "failure_reasons": [], - "timings_ms": { - "router": 2, - "retrieval": 211, - "pre_evidence_gate": 1, - "llm": 3158, - "post_evidence_gate": 1 - } - }, - "rag_rows": [ - { - "path": "src/plba/bootstrap.py", - "content": "const RuntimeManager\nRuntimeManager = app_runtime.core.runtime.RuntimeManager", - "layer": "C1_SYMBOL_CATALOG", - "title": "RuntimeManager", - "span_start": 4, - "span_end": 4, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "27158ca220022eeb5083c6addf8a50775d45f7161284fd60aac48410105f4b98", - "qname": "RuntimeManager", - "kind": "const", - "signature": "RuntimeManager = app_runtime.core.runtime.RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "src.plba.bootstrap", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "const RuntimeManager\nRuntimeManager = app_runtime.core.runtime.RuntimeManager", - "layer": "C1_SYMBOL_CATALOG", - "title": "RuntimeManager", - "span_start": 9, - "span_end": 9, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "62a9575c77aad894120d18b4f2a08cf2ba42f77e9be4a8a432b767d157701afe", - "qname": "RuntimeManager", - "kind": "const", - "signature": "RuntimeManager = app_runtime.core.runtime.RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.control.service", - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "class RuntimeManager\nRuntimeManager", - "layer": "C1_SYMBOL_CATALOG", - "title": "RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "7e4a9381328c5803bbc6179458612fc4e947d928aa7bf8b4b2bebb2c8592f758", - "qname": "RuntimeManager", - "kind": "class", - "signature": "RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.core.runtime", - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/__init__.py", - "content": "const RuntimeManager\nRuntimeManager = plba.core.RuntimeManager", - "layer": "C1_SYMBOL_CATALOG", - "title": "RuntimeManager", - "span_start": 16, - "span_end": 16, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "7eacec84f9b8d6c4201374591faecdac7493091c263681495c338973f2971ad9", - "qname": "RuntimeManager", - "kind": "const", - "signature": "RuntimeManager = plba.core.RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "src.plba.__init__", - "is_test": false, - "blob_sha": "24e755ec8c249d14fb0e675b5dbf2b71ab91afb9c849897eebfa9feb2499e19d", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/core.py", - "content": "const RuntimeManager\nRuntimeManager = app_runtime.core.runtime.RuntimeManager", - "layer": "C1_SYMBOL_CATALOG", - "title": "RuntimeManager", - "span_start": 2, - "span_end": 2, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "e1684562d978b7af7fe9b27dc5869d770348a87b5dc19a50360f58544668578b", - "qname": "RuntimeManager", - "kind": "const", - "signature": "RuntimeManager = app_runtime.core.runtime.RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "src.plba.core", - "is_test": false, - "blob_sha": "c0ae25110d20e665216616e26b68adfe035b624ba45d31d1272fb21f906f9ca8", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/__init__.py", - "content": "const ControlPlaneService\nControlPlaneService = app_runtime.control.service.ControlPlaneService", - "layer": "C1_SYMBOL_CATALOG", - "title": "ControlPlaneService", - "span_start": 3, - "span_end": 3, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "217e8f044d1c01644bf7b81e5046af9e84469210c692a2fb0c476a19bb069ae1", - "qname": "ControlPlaneService", - "kind": "const", - "signature": "ControlPlaneService = app_runtime.control.service.ControlPlaneService", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.control.__init__", - "is_test": false, - "blob_sha": "bf3c37e3369a84cc618adc0fd71c232e5eb4b871eaff743069a17e661e498316", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "method ControlChannel.start\nstart(self, actions)\nStart the control channel and bind handlers.", - "layer": "C1_SYMBOL_CATALOG", - "title": "ControlChannel.start", - "span_start": 23, - "span_end": 24, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "e01e0d50d0f48d0c84c119c989b7a7c57ceea263811ce2605c684ae24d1a03b1", - "qname": "ControlChannel.start", - "kind": "method", - "signature": "start(self, actions)", - "parent_symbol_id": "ControlChannel", - "package_or_module": "src.app_runtime.control.base", - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "method ControlChannel.stop\nstop(self)\nStop the control channel and release resources.", - "layer": "C1_SYMBOL_CATALOG", - "title": "ControlChannel.stop", - "span_start": 27, - "span_end": 28, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "54b5adf9866c526836221dc721b474ba23fbec83e1b1d3b8bc4da67ae3c1541d", - "qname": "ControlChannel.stop", - "kind": "method", - "signature": "stop(self)", - "parent_symbol_id": "ControlChannel", - "package_or_module": "src.app_runtime.control.base", - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "class ControlPlaneService:\n def __init__(self) -> None:\n self._channels: list[ControlChannel] = []\n\n def register_channel(self, channel: ControlChannel) -> None:\n self._channels.append(channel)\n\n def start(self, runtime: RuntimeManager) -> None:\n if not self._channels:\n return\n asyncio.run(self._start_async(runtime))\n\n def stop(self) -> None:\n if not self._channels:\n return\n asyncio.run(self._stop_async())\n\n def snapshot(self, runtime: RuntimeManager) -> dict[str, object]:\n health = runtime.current_health()\n return {\n \"runtime\": {\"state\": runtime._state.value},\n \"modules\": list(runtime.registry.modules),\n \"services\": runtime.services.snapshot(),\n \"workers\": runtime.workers.snapshot(),\n \"health\": runtime.health.snapshot(runtime.workers.healths()) | {\"status\": health[\"status\"]},\n \"config\": runtime.configuration.get(),\n }\n\n async def _start_async(self, runtime: RuntimeManager) -> None:\n actions = ControlActionSet(\n health=runtime.health_status,\n start=runtime.start_runtime,\n stop=runtime.stop_runtime,\n status=runtime.runtime_status,\n )\n for channel in self._channels:\n await channel.start(actions)\n\n async def _stop_async(self) -> None:\n for channel in reversed(self._channels):\n await channel.stop()", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/service.py:ControlPlaneService", - "span_start": 12, - "span_end": 52, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.service", - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_runner.py", - "content": "class UvicornThreadRunner:\n def __init__(self, host: str, port: int, timeout: int) -> None:\n self._host = host\n self._port = port\n self._timeout = timeout\n self._server: Server | None = None\n self._thread: Thread | None = None\n self._error: BaseException | None = None\n\n async def start(self, app: FastAPI) -> None:\n if self._thread is not None and self._thread.is_alive():\n return\n self._error = None\n config = Config(app=app, host=self._host, port=self._port, log_level=\"warning\")\n self._server = Server(config)\n self._thread = Thread(target=self._serve, name=\"plba-http-control\", daemon=True)\n self._thread.start()\n await self._wait_until_started()\n\n async def stop(self) -> None:\n if self._server is None or self._thread is None:\n return\n self._server.should_exit = True\n await asyncio.to_thread(self._thread.join, self._timeout)\n self._server = None\n self._thread = None\n\n @property\n def port(self) -> int:\n if self._server is None or not getattr(self._server, \"servers\", None):\n return self._port\n socket = self._server.servers[0].sockets[0]\n return int(socket.getsockname()[1])\n\n async def _wait_until_started(self) -> None:\n if self._server is None:\n raise RuntimeError(\"Server is not initialized\")\n deadline = asyncio.get_running_loop().time() + max(float(self._timeout), 1.0)\n while not self._server.started:\n if self._error is not None:\n raise RuntimeError(\"HTTP control server failed to start\") from self._error\n if asyncio.get_running_loop().time() >= deadline:\n raise TimeoutError(\"HTTP control server startup timed out\")\n await asyncio.sleep(0.05)\n\n def _serve(self) -> None:\n if self._server is None:\n return\n try:\n asyncio.run(self._server.serve())\n except BaseException as exc: # noqa: BLE001\n self._error = exc", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/http_runner.py:UvicornThreadRunner", - "span_start": 10, - "span_end": 61, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.http_runner", - "is_test": false, - "blob_sha": "3779fdd2878b770e789a35bb2a89c9d79f13b61c26d7db1b3b683f9bb9e1623f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "class ControlChannel(ABC):\n @abstractmethod\n async def start(self, actions: ControlActionSet) -> None:\n \"\"\"Start the control channel and bind handlers.\"\"\"\n\n @abstractmethod\n async def stop(self) -> None:\n \"\"\"Stop the control channel and release resources.\"\"\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/base.py:ControlChannel", - "span_start": 21, - "span_end": 28, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 1, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.base", - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/__init__.py", - "content": "from app_runtime.control.base import ControlActionSet, ControlChannel\nfrom app_runtime.control.http_channel import HttpControlChannel\nfrom app_runtime.control.service import ControlPlaneService\n\n__all__ = [\"ControlActionSet\", \"ControlChannel\", \"ControlPlaneService\", \"HttpControlChannel\"]", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/__init__.py:1-5", - "span_start": 1, - "span_end": 5, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.app_runtime.control.__init__", - "is_test": false, - "blob_sha": "bf3c37e3369a84cc618adc0fd71c232e5eb4b871eaff743069a17e661e498316", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "class HttpControlAppFactory:\n def create(\n self,\n health_provider: Callable[[], Awaitable[HealthPayload]],\n action_provider: Callable[[str, str], Awaitable[JSONResponse]],\n ) -> FastAPI:\n app = FastAPI(title=\"PLBA Control API\")\n\n @app.middleware(\"http\")\n async def log_api_call(request: Request, call_next): # type: ignore[no-untyped-def]\n started = time.monotonic()\n response = await call_next(request)\n response.headers[\"X-Response-Time-Ms\"] = str(int((time.monotonic() - started) * 1000))\n return response\n\n @app.get(\"/health\")\n async def health() -> JSONResponse:\n payload = await health_provider()\n status_code = 200 if payload.get(\"status\") == \"ok\" else 503\n return JSONResponse(content=payload, status_code=status_code)\n\n @app.get(\"/actions/{action}\")\n @app.post(\"/actions/{action}\")\n async def action(action: str, request: Request) -> JSONResponse:\n client_source = self._client_source(request)\n if action in {\"start\", \"stop\"}:\n LOGGER.warning(\"Control action requested: /actions/%s client=%s\", action, client_source)\n return await action_provider(action, client_source)\n\n return app\n\n def _client_source(self, request: Request) -> str:\n explicit_header = request.headers.get(\"X-Client-Source\", \"\").strip()\n if explicit_header:\n return explicit_header\n user_agent = request.headers.get(\"User-Agent\", \"\").strip()\n if user_agent:\n return f\"user-agent:{user_agent}\"\n return \"unknown\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/http_app.py:HttpControlAppFactory", - "span_start": 15, - "span_end": 53, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.http_app", - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "class HttpControlChannel(ControlChannel):\n def __init__(self, host: str, port: int, timeout: int) -> None:\n self._timeout = timeout\n self._runner = UvicornThreadRunner(host, port, timeout)\n self._factory = HttpControlAppFactory()\n self._actions: ControlActionSet | None = None\n\n async def start(self, actions: ControlActionSet) -> None:\n self._actions = actions\n app = self._factory.create(self._health_response, self._action_response)\n await self._runner.start(app)\n\n async def stop(self) -> None:\n await self._runner.stop()\n\n @property\n def port(self) -> int:\n return self._runner.port\n\n async def _health_response(self) -> dict[str, object]:\n if self._actions is None:\n return {\"status\": \"unhealthy\", \"detail\": \"control actions are not configured\"}\n return await asyncio.wait_for(self._actions.health(), timeout=float(self._timeout))\n\n async def _action_response(self, action: str, _client_source: str = \"unknown\") -> JSONResponse:\n if self._actions is None:\n return JSONResponse(content={\"status\": \"error\", \"detail\": f\"{action} handler is not configured\"}, status_code=404)\n callbacks = {\n \"start\": self._actions.start,\n \"stop\": self._actions.stop,\n \"status\": self._actions.status,\n }\n callback = callbacks.get(action)\n if callback is None:\n return JSONResponse(content={\"status\": \"error\", \"detail\": f\"unsupported action: {action}\"}, status_code=404)\n action_timeout = max(float(self._timeout), 10.0) if action in {\"start\", \"stop\"} else float(self._timeout)\n try:\n detail = await asyncio.wait_for(callback(), timeout=action_timeout)\n except asyncio.TimeoutError:\n return JSONResponse(\n content={\"status\": \"accepted\", \"detail\": f\"{action} operation is still in progress\"},\n status_code=202,\n )\n except Exception as exc:\n return JSONResponse(content={\"status\": \"error\", \"detail\": str(exc)}, status_code=500)\n return JSONResponse(content={\"status\": \"ok\", \"detail\": detail or f\"{action} action accepted\"}, status_code=200)", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/http_channel.py:HttpControlChannel", - "span_start": 12, - "span_end": 57, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.http_channel", - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "class ControlActionSet:\n health: HealthHandler\n start: ActionHandler\n stop: ActionHandler\n status: ActionHandler", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/base.py:ControlActionSet", - "span_start": 14, - "span_end": 18, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.base", - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/control.py", - "content": "from app_runtime.control.base import ControlActionSet, ControlChannel\nfrom app_runtime.control.http_channel import HttpControlChannel\nfrom app_runtime.control.service import ControlPlaneService\n\n__all__ = [\n \"ControlActionSet\",\n \"ControlChannel\",\n \"ControlPlaneService\",\n \"HttpControlChannel\",\n]", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/plba/control.py:1-10", - "span_start": 1, - "span_end": 10, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.plba.control", - "is_test": false, - "blob_sha": "31bd5c4481bfa7fbca8fae56d4860a67e3953ca74474ac8439e1f39b685d7bc8", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests manager\n- orchestrates role-like calls (4)\n- reads and writes state attributes\n- participates in dataflow slices (50)", - "layer": "C4_SEMANTIC_ROLES", - "title": "RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 43, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "7e4a9381328c5803bbc6179458612fc4e947d928aa7bf8b4b2bebb2c8592f758", - "symbol_name": "RuntimeManager", - "qname": "RuntimeManager", - "role": "pipeline_stage", - "confidence": 0.67, - "dataflow_participation": 50, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "ControlChannel\nrole: model\n\nResponsibilities:\n- default model role", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlChannel", - "span_start": 21, - "span_end": 28, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 40, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "cfcfe9a311d3a2dbdaf32ac4ccd73c0eb9a117f830591a1c0867ee97d46204ff", - "symbol_name": "ControlChannel", - "qname": "ControlChannel", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "ControlActionSet\nrole: model\n\nResponsibilities:\n- default model role", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlActionSet", - "span_start": 14, - "span_end": 18, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 40, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "46eb026cb3313415ec47b82dd22f84f4d112c9d987e8b1716dcb0baa1cce8988", - "symbol_name": "ControlActionSet", - "qname": "ControlActionSet", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests service\n- reads and writes state attributes\n- participates in dataflow slices (5)", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlPlaneService", - "span_start": 12, - "span_end": 52, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 68, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "b13471e5916986dccffb53fab613812842965705e6b3a89ae549d30c9e91e9aa", - "symbol_name": "ControlPlaneService", - "qname": "ControlPlaneService", - "role": "pipeline_stage", - "confidence": 0.57, - "dataflow_participation": 5, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_runner.py", - "content": "UvicornThreadRunner\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (24)", - "layer": "C4_SEMANTIC_ROLES", - "title": "UvicornThreadRunner", - "span_start": 10, - "span_end": 61, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 11, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "fd55630045a02100df8877ac27d951ee08617d4598764394d48cb51fe067476a", - "symbol_name": "UvicornThreadRunner", - "qname": "UvicornThreadRunner", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 24, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "3779fdd2878b770e789a35bb2a89c9d79f13b61c26d7db1b3b683f9bb9e1623f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (10)", - "layer": "C4_SEMANTIC_ROLES", - "title": "HttpControlChannel", - "span_start": 12, - "span_end": 57, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 21, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "1c9fbdc24819e5604c26ea55428a74310f03a03e1af197ed84846af61e42fdb0", - "symbol_name": "HttpControlChannel", - "qname": "HttpControlChannel", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 10, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "HttpControlAppFactory\nrole: factory\n\nResponsibilities:\n- name suffix suggests factory", - "layer": "C4_SEMANTIC_ROLES", - "title": "HttpControlAppFactory", - "span_start": 15, - "span_end": 53, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 39, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "9b3502a5fb408b273223db13264349cf500de24915b6c649d9ea8970d0dfd8e0", - "symbol_name": "HttpControlAppFactory", - "qname": "HttpControlAppFactory", - "role": "factory", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/persistence/workflow_persistence.py", - "content": "WorkflowPersistence\nrole: pipeline_stage\n\nResponsibilities:\n- orchestrates role-like calls (2)\n- reads and writes state attributes\n- participates in dataflow slices (16)", - "layer": "C4_SEMANTIC_ROLES", - "title": "WorkflowPersistence", - "span_start": 8, - "span_end": 54, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 15, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "7bd01ee45cf31f2d5c2e3e51656254860ac785d10cef9e0852cd4fba90857bae", - "symbol_name": "WorkflowPersistence", - "qname": "WorkflowPersistence", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 16, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "80e9410ddc639789b4353c2a1a757ba8d0d5b5bb6075b0b263b61551f04ae1f0", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager.add_config_file", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 32, - "span_end": 52, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "a23b8a11ebdb12708b60c96ea12a69f7f042082f1adfddd572444e246d81d167", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "57ffbd4f0d9fdf3507c2b8624312ce211f3d02fdf86a57a8ec90778d8a7b498d", - "dst_ref": "RuntimeManager.add_config_file", - "resolution": "resolved", - "slice_id": "a23b8a11ebdb12708b60c96ea12a69f7f042082f1adfddd572444e246d81d167", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager.add_config_file" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "57ffbd4f0d9fdf3507c2b8624312ce211f3d02fdf86a57a8ec90778d8a7b498d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.services\n -> RuntimeManager.__init__", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 33, - "span_end": 39, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "d43af85989222ee6d788ce418cdcb217c7ff044cfb915e3bdbd184417dc7bd61", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "dst_ref": "RuntimeManager.__init__", - "resolution": "resolved", - "slice_id": "d43af85989222ee6d788ce418cdcb217c7ff044cfb915e3bdbd184417dc7bd61", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.services", - "RuntimeManager.__init__" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.stop", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 25, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d", - "dst_ref": "ControlPlaneService.stop", - "resolution": "resolved", - "slice_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.stop" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._stop_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 51, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a", - "dst_ref": "ControlPlaneService._stop_async", - "resolution": "resolved", - "slice_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._stop_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager.start", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 32, - "span_end": 59, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "98312ace7fc62b1c7194c5aa1732b6ef736eae1668a3a120dd1ecd5ab1d64f7a", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "77a7b260193018845e4e204df094ab89cfd7c82ee4e822b3a83ad4cd945f9cb1", - "dst_ref": "RuntimeManager.start", - "resolution": "resolved", - "slice_id": "98312ace7fc62b1c7194c5aa1732b6ef736eae1668a3a120dd1ecd5ab1d64f7a", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager.start" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "77a7b260193018845e4e204df094ab89cfd7c82ee4e822b3a83ad4cd945f9cb1" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager._register_core_services", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 32, - "span_end": 127, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "3e5811f3b511fa0cabe363f5d01f2ac5fa039bc8b93f7ee108323e1f5f45a293", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "972d6057a6caac9cf31ebc1e29c6f39f71b10d4cc170dec57cf875ba458549c6", - "dst_ref": "RuntimeManager._register_core_services", - "resolution": "resolved", - "slice_id": "3e5811f3b511fa0cabe363f5d01f2ac5fa039bc8b93f7ee108323e1f5f45a293", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager._register_core_services" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "972d6057a6caac9cf31ebc1e29c6f39f71b10d4cc170dec57cf875ba458549c6" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.register_channel", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 17, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957", - "dst_ref": "ControlPlaneService.register_channel", - "resolution": "resolved", - "slice_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.register_channel" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.start", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 20, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154", - "dst_ref": "ControlPlaneService.start", - "resolution": "resolved", - "slice_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.start" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._start_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 47, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517", - "dst_ref": "ControlPlaneService._start_async", - "resolution": "resolved", - "slice_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._start_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.services\n -> RuntimeManager._register_core_services", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 33, - "span_end": 127, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "aac6f9dda73963b977083a892bee39a48eca4fbd7404787e022ecf4ebedec65d", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "972d6057a6caac9cf31ebc1e29c6f39f71b10d4cc170dec57cf875ba458549c6", - "dst_ref": "RuntimeManager._register_core_services", - "resolution": "resolved", - "slice_id": "aac6f9dda73963b977083a892bee39a48eca4fbd7404787e022ecf4ebedec65d", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.services", - "RuntimeManager._register_core_services" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "972d6057a6caac9cf31ebc1e29c6f39f71b10d4cc170dec57cf875ba458549c6" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "validation": { - "passed": true, - "action": "return", - "reasons": [] - }, - "token_usage": { - "prompt_name": "code_qa_trace_flow_answer", - "tokens_in_estimate": 4310 - }, - "steps": [ - { - "step": "router", - "status": "completed", - "timings_ms": { - "router": 2 - }, - "output": { - "intent": "CODE_QA", - "sub_intent": "TRACE_FLOW", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - } - }, - { - "step": "retrieval", - "status": "completed", - "timings_ms": { - "retrieval": 211 - }, - "output": { - "rag_count": 37, - "answer_path_rag_count": 37, - "resolved_symbol_status": "resolved", - "resolved_symbol": "RuntimeManager", - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "diagnostics": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "vector", - "C0_SOURCE_CHUNKS": "vector", - "C4_SEMANTIC_ROLES": "vector", - "C2_DEPENDENCY_GRAPH": "vector", - "C3_ENTRYPOINTS": "vector" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 8, - "C4_SEMANTIC_ROLES": 8, - "C2_DEPENDENCY_GRAPH": 10, - "C3_ENTRYPOINTS": 10 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [] - }, - "C4_SEMANTIC_ROLES": { - "path_scope": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [] - } - }, - "fallback": { - "used": false, - "reason": null - }, - "retrieval_by_layer_ms": { - "C1_SYMBOL_CATALOG": 59, - "C0_SOURCE_CHUNKS": 45, - "C4_SEMANTIC_ROLES": 21, - "C2_DEPENDENCY_GRAPH": 62, - "C3_ENTRYPOINTS": 21 - } - } - }, - { - "step": "pre_evidence_gate", - "status": "passed", - "timings_ms": { - "pre_evidence_gate": 1 - }, - "input": { - "resolved_target": "RuntimeManager", - "sub_intent": "TRACE_FLOW", - "target_type": "symbol", - "evidence_count": 37, - "code_chunk_count": 37, - "entrypoint_count": 3, - "relation_count": 10, - "test_evidence_count": 0, - "symbol_resolution_status": "resolved", - "path_scope": [] - }, - "output": { - "passed": true, - "failure_reasons": [], - "degraded_message": "", - "evidence_count": 37 - } - }, - { - "step": "llm", - "status": "completed", - "timings_ms": { - "llm": 3158 - }, - "output": { - "prompt_name": "code_qa_trace_flow_answer", - "answer_preview": "При запуске `RuntimeManager` выполняются следующие шаги:\n\n1. Инициализация конфигурации через `add_config_file`.\n2. Инициализация сервисов.\n3. Регистрация основных служб через `_register_core_services`.\n4. Запуск менеджера с помощью метода `start`.\n\nЭти этапы основаны на сигнатурах методов и их связ", - "resolved_target": "RuntimeManager", - "answer_policy_branch": "normal_answer", - "decision_reason": "evidence_sufficient" - } - }, - { - "step": "post_evidence_gate", - "status": "passed", - "timings_ms": { - "post_evidence_gate": 1, - "post_evidence_gate_recheck": 0, - "repair": 0 - }, - "input": { - "answer_mode": "normal", - "degraded_message": "", - "resolved_target": "RuntimeManager", - "draft_answer_preview": "При запуске `RuntimeManager` выполняются следующие шаги:\n\n1. Инициализация конфигурации через `add_config_file`.\n2. Инициализация сервисов.\n3. Регистрация основных служб через `_register_core_services`.\n4. Запуск менеджера с помощью метода `start`.\n\nЭти этапы основаны на сигнатурах методов и их связ", - "repair_candidate": true - }, - "output": { - "passed": true, - "action": "return", - "reasons": [], - "repair_used": false, - "final_answer_preview": "При запуске `RuntimeManager` выполняются следующие шаги:\n\n1. Инициализация конфигурации через `add_config_file`.\n2. Инициализация сервисов.\n3. Регистрация основных служб через `_register_core_services`.\n4. Запуск менеджера с помощью метода `start`.\n\nЭти этапы основаны на сигнатурах методов и их связ" - } - } - ] - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/manual_run/20260312_193339/full_chain_plba_code_subintents_one_per_subintent_plba-v3-trace-flow-runtime-start.md b/tests/pipeline_setup_v3/test_results/manual_run/20260312_193339/full_chain_plba_code_subintents_one_per_subintent_plba-v3-trace-flow-runtime-start.md deleted file mode 100644 index 8dade62..0000000 --- a/tests/pipeline_setup_v3/test_results/manual_run/20260312_193339/full_chain_plba_code_subintents_one_per_subintent_plba-v3-trace-flow-runtime-start.md +++ /dev/null @@ -1,305 +0,0 @@ -# plba-v3-trace-flow-runtime-start - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_02_pipeline/full_chain_plba_code_subintents_one_per_subintent.yaml -- runner: agent_runtime -- mode: full_chain -- passed: True - -## Query -Покажи поток выполнения при запуске RuntimeManager - -## Actual -{ - "intent": "CODE_QA", - "sub_intent": "TRACE_FLOW", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 37, - "llm_answer": "При запуске `RuntimeManager` выполняются следующие шаги:\n\n1. Инициализация конфигурации через `add_config_file`.\n2. Инициализация сервисов.\n3. Регистрация основных служб через `_register_core_services`.\n4. Запуск менеджера с помощью метода `start`.\n\nЭти этапы основаны на сигнатурах методов и их связях внутри класса `RuntimeManager`. \nКонкретные реализации логики запуска находятся в файле `src/app_runtime/core/runtime.py`, строки 32–127.\n\nПоток выполнения полностью восстанавливается по данным контекстного фрагмента.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "RuntimeManager" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] -} - -## Steps -[ - { - "step": "router", - "status": "completed", - "timings_ms": { - "router": 2 - }, - "output": { - "intent": "CODE_QA", - "sub_intent": "TRACE_FLOW", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - } - }, - { - "step": "retrieval", - "status": "completed", - "timings_ms": { - "retrieval": 211 - }, - "output": { - "rag_count": 37, - "answer_path_rag_count": 37, - "resolved_symbol_status": "resolved", - "resolved_symbol": "RuntimeManager", - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "diagnostics": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "vector", - "C0_SOURCE_CHUNKS": "vector", - "C4_SEMANTIC_ROLES": "vector", - "C2_DEPENDENCY_GRAPH": "vector", - "C3_ENTRYPOINTS": "vector" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 8, - "C4_SEMANTIC_ROLES": 8, - "C2_DEPENDENCY_GRAPH": 10, - "C3_ENTRYPOINTS": 10 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [] - }, - "C4_SEMANTIC_ROLES": { - "path_scope": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [] - } - }, - "fallback": { - "used": false, - "reason": null - }, - "retrieval_by_layer_ms": { - "C1_SYMBOL_CATALOG": 59, - "C0_SOURCE_CHUNKS": 45, - "C4_SEMANTIC_ROLES": 21, - "C2_DEPENDENCY_GRAPH": 62, - "C3_ENTRYPOINTS": 21 - } - } - }, - { - "step": "pre_evidence_gate", - "status": "passed", - "timings_ms": { - "pre_evidence_gate": 1 - }, - "input": { - "resolved_target": "RuntimeManager", - "sub_intent": "TRACE_FLOW", - "target_type": "symbol", - "evidence_count": 37, - "code_chunk_count": 37, - "entrypoint_count": 3, - "relation_count": 10, - "test_evidence_count": 0, - "symbol_resolution_status": "resolved", - "path_scope": [] - }, - "output": { - "passed": true, - "failure_reasons": [], - "degraded_message": "", - "evidence_count": 37 - } - }, - { - "step": "llm", - "status": "completed", - "timings_ms": { - "llm": 3158 - }, - "output": { - "prompt_name": "code_qa_trace_flow_answer", - "answer_preview": "При запуске `RuntimeManager` выполняются следующие шаги:\n\n1. Инициализация конфигурации через `add_config_file`.\n2. Инициализация сервисов.\n3. Регистрация основных служб через `_register_core_services`.\n4. Запуск менеджера с помощью метода `start`.\n\nЭти этапы основаны на сигнатурах методов и их связ", - "resolved_target": "RuntimeManager", - "answer_policy_branch": "normal_answer", - "decision_reason": "evidence_sufficient" - } - }, - { - "step": "post_evidence_gate", - "status": "passed", - "timings_ms": { - "post_evidence_gate": 1, - "post_evidence_gate_recheck": 0, - "repair": 0 - }, - "input": { - "answer_mode": "normal", - "degraded_message": "", - "resolved_target": "RuntimeManager", - "draft_answer_preview": "При запуске `RuntimeManager` выполняются следующие шаги:\n\n1. Инициализация конфигурации через `add_config_file`.\n2. Инициализация сервисов.\n3. Регистрация основных служб через `_register_core_services`.\n4. Запуск менеджера с помощью метода `start`.\n\nЭти этапы основаны на сигнатурах методов и их связ", - "repair_candidate": true - }, - "output": { - "passed": true, - "action": "return", - "reasons": [], - "repair_used": false, - "final_answer_preview": "При запуске `RuntimeManager` выполняются следующие шаги:\n\n1. Инициализация конфигурации через `add_config_file`.\n2. Инициализация сервисов.\n3. Регистрация основных служб через `_register_core_services`.\n4. Запуск менеджера с помощью метода `start`.\n\nЭти этапы основаны на сигнатурах методов и их связ" - } - } -] - -## Diagnostics -{ - "intent_correct": null, - "target_found": true, - "layers_used": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_sufficient": true, - "answer_mode": "normal", - "resolved_target": "RuntimeManager", - "answer_policy_branch": "normal_answer", - "decision_reason": "evidence_sufficient", - "router_result": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "retrieval_profile": "code", - "sub_intent": "TRACE_FLOW", - "path_scope": [], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "symbol_resolution_status": "resolved" - }, - "retrieval_request": { - "rag_session_id": "7d11da21-faa0-4cea-aede-aeabe069164c", - "query": "Покажи поток выполнения при запуске RuntimeManager", - "sub_intent": "TRACE_FLOW", - "path_scope": [], - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "per_layer_outcome": [ - { - "layer_id": "C1_SYMBOL_CATALOG", - "hit_count": 8, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C0_SOURCE_CHUNKS", - "hit_count": 8, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C4_SEMANTIC_ROLES", - "hit_count": 8, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C2_DEPENDENCY_GRAPH", - "hit_count": 10, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C3_ENTRYPOINTS", - "hit_count": 3, - "empty": false, - "fallback_used": false - } - ], - "empty_layers": [], - "evidence_gate_decision": { - "sufficient": true, - "failure_reasons": [], - "evidence_count": 37 - }, - "evidence_gate_input": { - "resolved_target": "RuntimeManager", - "sub_intent": "TRACE_FLOW", - "target_type": "symbol", - "evidence_count": 37, - "code_chunk_count": 37, - "entrypoint_count": 3, - "relation_count": 10, - "test_evidence_count": 0, - "symbol_resolution_status": "resolved", - "path_scope": [] - }, - "post_evidence_gate": { - "input": { - "answer_mode": "normal", - "degraded_message": "", - "resolved_target": "RuntimeManager", - "draft_answer_preview": "При запуске `RuntimeManager` выполняются следующие шаги:\n\n1. Инициализация конфигурации через `add_config_file`.\n2. Инициализация сервисов.\n3. Регистрация основных служб через `_register_core_services`.\n4. Запуск менеджера с помощью метода `start`.\n\nЭти этапы основаны на сигнатурах методов и их связ", - "repair_candidate": true - }, - "output": { - "passed": true, - "action": "return", - "reasons": [], - "repair_used": false, - "final_answer_preview": "При запуске `RuntimeManager` выполняются следующие шаги:\n\n1. Инициализация конфигурации через `add_config_file`.\n2. Инициализация сервисов.\n3. Регистрация основных служб через `_register_core_services`.\n4. Запуск менеджера с помощью метода `start`.\n\nЭти этапы основаны на сигнатурах методов и их связ" - } - }, - "failure_reasons": [], - "timings_ms": { - "router": 2, - "retrieval": 211, - "pre_evidence_gate": 1, - "llm": 3158, - "post_evidence_gate": 1 - } -} - -## Mismatches -- none \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/manual_run/20260312_193339/summary.md b/tests/pipeline_setup_v3/test_results/manual_run/20260312_193339/summary.md deleted file mode 100644 index c6bb4a5..0000000 --- a/tests/pipeline_setup_v3/test_results/manual_run/20260312_193339/summary.md +++ /dev/null @@ -1,36 +0,0 @@ -# pipeline_setup_v3 summary - -Passed: 7/7 - -| File | Case | Mode | Query | Actual sub-intent | RAG layers | Tokens | Pass | -|------|------|------|-------|-------------------|------------|--------|------| -| full_chain_plba_code_subintents_one_per_subintent.yaml | plba-v3-open-file-runtime | full_chain | Открой файл src/app_runtime/core/runtime.py | OPEN_FILE | C0_SOURCE_CHUNKS:1 | 1128 | ✓ | -| full_chain_plba_code_subintents_one_per_subintent.yaml | plba-v3-explain-runtime-manager | full_chain | Объясни как работает класс RuntimeManager | EXPLAIN | C0_SOURCE_CHUNKS:8, C1_SYMBOL_CATALOG:8, C2_DEPENDENCY_GRAPH:6, C3_ENTRYPOINTS:3, C4_SEMANTIC_ROLES:8 | 4504 | ✓ | -| full_chain_plba_code_subintents_one_per_subintent.yaml | plba-v3-explain-local-http-channel | full_chain | Почему в файле src/app_runtime/control/http_channel.py класс HttpControlChannel устроен так? | EXPLAIN_LOCAL | C0_SOURCE_CHUNKS:1, C1_SYMBOL_CATALOG:8, C2_DEPENDENCY_GRAPH:4 | 2071 | ✓ | -| full_chain_plba_code_subintents_one_per_subintent.yaml | plba-v3-find-tests-runtime-manager | full_chain | Где тесты для RuntimeManager? | FIND_TESTS | C0_SOURCE_CHUNKS:10, C1_SYMBOL_CATALOG:8, C2_DEPENDENCY_GRAPH:6 | 3660 | ✓ | -| full_chain_plba_code_subintents_one_per_subintent.yaml | plba-v3-find-entrypoints-health-endpoint | full_chain | Где health endpoint? | FIND_ENTRYPOINTS | C0_SOURCE_CHUNKS:7, C3_ENTRYPOINTS:3 | 2531 | ✓ | -| full_chain_plba_code_subintents_one_per_subintent.yaml | plba-v3-trace-flow-runtime-start | full_chain | Покажи поток выполнения при запуске RuntimeManager | TRACE_FLOW | C0_SOURCE_CHUNKS:8, C1_SYMBOL_CATALOG:8, C2_DEPENDENCY_GRAPH:10, C3_ENTRYPOINTS:3, C4_SEMANTIC_ROLES:8 | 4310 | ✓ | -| full_chain_plba_code_subintents_one_per_subintent.yaml | plba-v3-architecture-runtime-manager | full_chain | Какие компоненты участвуют в RuntimeManager? | ARCHITECTURE | C0_SOURCE_CHUNKS:4, C1_SYMBOL_CATALOG:6, C2_DEPENDENCY_GRAPH:8, C3_ENTRYPOINTS:3, C4_SEMANTIC_ROLES:12 | 4061 | ✓ | - -## LLM Answers -- **plba-v3-open-file-runtime** - Query: Открой файл src/app_runtime/core/runtime.py - > В файле \`src/app\_runtime/core/runtime.py\` определён класс \`RuntimeManager\`. У него есть несколько классов полей с умолчательными сервисами: \- \`configuration\`: тип \`ConfigurationManager\` \- \`services\`: тип \`ServiceContainer\` \- \`traces\`: тип \`TraceService\` \- \`health\`: тип \`HealthRegistry\` \- \`logs\`: тип \`LogManager\` \- \`workers\`: тип \`WorkerSupervisor\` \- \`control\_plane\`: тип \`ControlPlaneService\` Также определены константы таймаутов: \- \`ACTION\_TIMEOUT\_SECONDS = 10.0\` \- \`ACTION\_POLL\_INTERVAL\_SECONDS = 0.05\` -- **plba-v3-explain-runtime-manager** - Query: Объясни как работает класс RuntimeManager - > Недостаточно подтверждённых данных для уверенного ответа по RuntimeManager. -- **plba-v3-explain-local-http-channel** - Query: Почему в файле src/app_runtime/control/http_channel.py класс HttpControlChannel устроен так? - > Класс HttpControlChannel наследует ControlChannel и реализует HTTP\-канал управления. Он принимает хост, порт и таймаут при инициализации, создаёт экземпляр UvicornThreadRunner для запуска сервера и использует HttpControlAppFactory для создания FastAPI\-приложения. Метод start запускает сервер с переданным набором действий \(ControlActionSet\), а метод stop останавливает его. Свойство port возвращает текущий порт runner. Внутри класса определены два обработчика: \_health\_response проверяет здоровье канала, возвращая статус "unhealthy" если действия не установлены; \_action\_response предположительно обрабатывает запросы на выполнение действий, но его реализация в данном фрагменте не показана. -- **plba-v3-find-tests-runtime-manager** - Query: Где тесты для RuntimeManager? - > Прямые тесты для \`RuntimeManager\` находятся в файле \`tests/test\_runtime.py\`. Косвенные тесты: \- В файле \`tests/test\_business\_control\_actions.py\` есть тесты, использующие сущности контроля, которые взаимодействуют с \`RuntimeManager\`. -- **plba-v3-find-entrypoints-health-endpoint** - Query: Где health endpoint? - > Подтверждённая точка входа для health endpoint: GET /health, declared in src/app\_runtime/control/http\_app.py, lines 31\-34, handler function named 'health'. -- **plba-v3-trace-flow-runtime-start** - Query: Покажи поток выполнения при запуске RuntimeManager - > При запуске \`RuntimeManager\` выполняются следующие шаги: 1. Инициализация конфигурации через \`add\_config\_file\`. 2. Инициализация сервисов. 3. Регистрация основных служб через \`\_register\_core\_services\`. 4. Запуск менеджера с помощью метода \`start\`. Эти этапы основаны на сигнатурах методов и их связях внутри класса \`RuntimeManager\`. Конкретные реализации логики запуска находятся в файле \`src/app\_runtime/core/runtime.py\`, строки 32–127. Поток выполнения полностью восстанавливается по данным контекстного фрагмента. -- **plba-v3-architecture-runtime-manager** - Query: Какие компоненты участвуют в RuntimeManager? - > Компоненты, участвующие в подсистеме RuntimeManager: \- \*\*RuntimeManager\*\* \(src/app\_runtime/core/runtime.py:18\-179\) \- \*\*ControlPlaneService.\_\_init\_\_\*\* \(src/app\_runtime/control/service.py:14\-51\) \- \*\*RuntimeManager.\_\_init\_\_\*\* \(src/app\_runtime/core/runtime.py:32\-127\) \- \*\*ControlPlaneService.\_start\_async\*\* \(src/app\_runtime/control/service.py:14\-47\) \- \*\*RuntimeManager.start\*\* \(src/app\_runtime/core/runtime.py:32\-59\) \- \*\*ControlPlaneService.start\*\* \(src/app\_runtime/control/service.py:14\-20\) \- \*\*ControlPlaneService.stop\*\* \(src/app\_runtime/control/service.py:14\-25\) \- \*\*ControlPlaneService.\_stop\_async\*\* \(src/app\_runtime/control/service.py:14\-51\) \- \*\*RuntimeManager.add\_config\_file\*\* \(src/app\_runtime/core/runtime.py:32\-52\) \- \*\*ControlPlaneService.register\_channel\*\* \(src/app\_runtime/control/service.py:14\-17\) Связи между компонентами: \- \*\*ControlPlaneService.\_\_init\_\_ dataflow\_slice… \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/plba_full_chain_subintents_v3/20260312_174008/full_chain_plba_code_subintents_v2_plba-v2-architecture-control-plane.json b/tests/pipeline_setup_v3/test_results/plba_full_chain_subintents_v3/20260312_174008/full_chain_plba_code_subintents_v2_plba-v2-architecture-control-plane.json deleted file mode 100644 index f6b7b73..0000000 --- a/tests/pipeline_setup_v3/test_results/plba_full_chain_subintents_v3/20260312_174008/full_chain_plba_code_subintents_v2_plba-v2-architecture-control-plane.json +++ /dev/null @@ -1,4381 +0,0 @@ -{ - "case_id": "plba-v2-architecture-control-plane", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_02_pipeline/full_chain_plba_code_subintents_v2.yaml", - "runner": "agent_runtime", - "mode": "full_chain", - "query": "Какие компоненты участвуют в ControlPlaneService?", - "actual": { - "intent": "CODE_QA", - "sub_intent": "ARCHITECTURE", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 33, - "llm_answer": "Компоненты, участвующие в ControlPlaneService:\n\n- **ControlActionSet** – модель для управления действиями.\n- **ControlChannel** – абстрактный базовый класс каналов контроля с методами start и stop.\n- **UvicornThreadRunner** – этап пайплайна для многопоточного запуска HTTP сервера.\n- **HttpControlChannel** – канал HTTP-контроля, этап пайплайна.\n- **HttpControlAppFactory** – фабрика создания HTTP-приложения контроля.\n- **WorkflowPersistence** – сохранение состояний рабочих процессов.\n- **InMemoryTaskQueue** – очередь задач в памяти.\n- **ConfigFileLoader** – загрузчик конфигурационных файлов.\n- **TraceContextStore** – хранилище контекстов трассировки.\n- **WorkerSupervisor** – надзор за рабочими процессами.\n- **WorkflowEngine** – движок обработки рабочих процессов.\n\nСвязи внутри ControlPlaneService:\n\n- _channels – атрибут, используемый во многих методах сервиса.\n- register_channel() – метод регистрации канала контроля.\n- start(), stop() – методы старта и остановки сервиса асинхронно.\n\nГраницы ответственности ControlPlaneService подтверждаются инициализацией, регистрацией каналов и управлением жизненным циклом сервисов.\n\nФайлы с ключевыми реализациями: \n- src/app_runtime/control/service.py\n- src/app_runtime/control/base.py\n- src/app_runtime/control/http_runner.py\n- src/app_runtime/control/http_channel.py\n- src/app_runtime/control/http_app.py\n\nВызовы fastapi app.post и app.get используются для HTTP-обработки действий контроля.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "ControlPlaneService" - ], - "layers": [ - "C4_SEMANTIC_ROLES", - "C3_ENTRYPOINTS", - "C2_DEPENDENCY_GRAPH", - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS" - ] - }, - "passed": true, - "mismatches": [], - "details": { - "query": "Какие компоненты участвуют в ControlPlaneService?", - "router_result": { - "schema_version": "1.1", - "intent": "CODE_QA", - "retrieval_profile": "code", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query_plan": { - "raw": "Какие компоненты участвуют в ControlPlaneService?", - "normalized": "Какие компоненты участвуют в ControlPlaneService?", - "sub_intent": "ARCHITECTURE", - "negations": [], - "expansions": [ - "ControlPlaneService" - ], - "keyword_hints": [ - "ControlPlaneService" - ], - "path_hints": [], - "doc_scope_hints": [], - "symbol_candidates": [ - "ControlPlaneService" - ], - "symbol_kind_hint": "class", - "anchors": [ - { - "type": "SYMBOL", - "value": "ControlPlaneService", - "source": "user_text", - "subtype": null, - "span": { - "start": 29, - "end": 48 - }, - "confidence": 0.88 - } - ] - }, - "retrieval_spec": { - "domains": [ - "CODE" - ], - "layer_queries": [ - { - "layer_id": "C4_SEMANTIC_ROLES", - "top_k": 12 - }, - { - "layer_id": "C3_ENTRYPOINTS", - "top_k": 8 - }, - { - "layer_id": "C2_DEPENDENCY_GRAPH", - "top_k": 8 - }, - { - "layer_id": "C1_SYMBOL_CATALOG", - "top_k": 6 - }, - { - "layer_id": "C0_SOURCE_CHUNKS", - "top_k": 4 - } - ], - "filters": { - "test_policy": "EXCLUDE", - "path_scope": [], - "language": [ - "python" - ] - }, - "rerank_profile": "code" - }, - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - }, - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "ControlPlaneService", - "alternatives": [ - "ControlPlaneService", - "ControlPlaneService", - "ControlPlaneService", - "ControlPlaneService", - "ControlPlaneService" - ], - "confidence": 0.99 - }, - "evidence_policy": { - "require_def": true, - "require_flow": true, - "require_spec": false, - "allow_answer_without_evidence": false - } - }, - "retrieval_request": { - "rag_session_id": "7d11da21-faa0-4cea-aede-aeabe069164c", - "query": "Какие компоненты участвуют в ControlPlaneService?", - "sub_intent": "ARCHITECTURE", - "path_scope": [], - "keyword_hints": [ - "ControlPlaneService" - ], - "symbol_candidates": [ - "ControlPlaneService" - ], - "requested_layers": [ - "C4_SEMANTIC_ROLES", - "C3_ENTRYPOINTS", - "C2_DEPENDENCY_GRAPH", - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS" - ], - "retrieval_spec": { - "domains": [ - "CODE" - ], - "layer_queries": [ - { - "layer_id": "C4_SEMANTIC_ROLES", - "top_k": 12 - }, - { - "layer_id": "C3_ENTRYPOINTS", - "top_k": 8 - }, - { - "layer_id": "C2_DEPENDENCY_GRAPH", - "top_k": 8 - }, - { - "layer_id": "C1_SYMBOL_CATALOG", - "top_k": 6 - }, - { - "layer_id": "C0_SOURCE_CHUNKS", - "top_k": 4 - } - ], - "filters": { - "test_policy": "EXCLUDE", - "path_scope": [], - "language": [ - "python" - ] - }, - "rerank_profile": "code" - }, - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - }, - "query_plan": { - "raw": "Какие компоненты участвуют в ControlPlaneService?", - "normalized": "Какие компоненты участвуют в ControlPlaneService?", - "sub_intent": "ARCHITECTURE", - "negations": [], - "expansions": [ - "ControlPlaneService" - ], - "keyword_hints": [ - "ControlPlaneService" - ], - "path_hints": [], - "doc_scope_hints": [], - "symbol_candidates": [ - "ControlPlaneService" - ], - "symbol_kind_hint": "class", - "anchors": [ - { - "type": "SYMBOL", - "value": "ControlPlaneService", - "source": "user_text", - "subtype": null, - "span": { - "start": 29, - "end": 48 - }, - "confidence": 0.88 - } - ] - } - }, - "retrieval_result": { - "target_symbol_candidates": [ - "ControlPlaneService", - "ControlChannel" - ], - "resolved_symbol": "ControlPlaneService", - "symbol_resolution_status": "resolved", - "file_candidates": [ - "src/app_runtime/control/service.py", - "src/app_runtime/control/base.py", - "src/app_runtime/control/http_runner.py", - "src/app_runtime/control/http_channel.py", - "src/app_runtime/control/http_app.py", - "src/app_runtime/workflow/persistence/workflow_persistence.py", - "src/app_runtime/queue/in_memory.py", - "src/app_runtime/config/file_loader.py", - "src/app_runtime/tracing/store.py", - "src/app_runtime/workers/supervisor.py", - "src/app_runtime/workflow/engine/workflow_engine.py", - "src/app_runtime/core/runtime.py", - "src/plba/control.py", - "src/app_runtime/control/__init__.py", - "src/plba/__init__.py" - ], - "code_chunks": [ - { - "layer": "C4_SEMANTIC_ROLES", - "path": "src/app_runtime/control/service.py", - "title": "ControlPlaneService", - "content": "ControlPlaneService\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests service\n- reads and writes state attributes\n- participates in dataflow slices (5)", - "start_line": 12, - "end_line": 52, - "metadata": { - "symbol_id": "b13471e5916986dccffb53fab613812842965705e6b3a89ae549d30c9e91e9aa", - "symbol_name": "ControlPlaneService", - "qname": "ControlPlaneService", - "role": "pipeline_stage", - "confidence": 0.57, - "dataflow_participation": 5, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C4_SEMANTIC_ROLES", - "path": "src/app_runtime/control/base.py", - "title": "ControlActionSet", - "content": "ControlActionSet\nrole: model\n\nResponsibilities:\n- default model role", - "start_line": 14, - "end_line": 18, - "metadata": { - "symbol_id": "46eb026cb3313415ec47b82dd22f84f4d112c9d987e8b1716dcb0baa1cce8988", - "symbol_name": "ControlActionSet", - "qname": "ControlActionSet", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C4_SEMANTIC_ROLES", - "path": "src/app_runtime/control/base.py", - "title": "ControlChannel", - "content": "ControlChannel\nrole: model\n\nResponsibilities:\n- default model role", - "start_line": 21, - "end_line": 28, - "metadata": { - "symbol_id": "cfcfe9a311d3a2dbdaf32ac4ccd73c0eb9a117f830591a1c0867ee97d46204ff", - "symbol_name": "ControlChannel", - "qname": "ControlChannel", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C4_SEMANTIC_ROLES", - "path": "src/app_runtime/control/http_runner.py", - "title": "UvicornThreadRunner", - "content": "UvicornThreadRunner\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (24)", - "start_line": 10, - "end_line": 61, - "metadata": { - "symbol_id": "fd55630045a02100df8877ac27d951ee08617d4598764394d48cb51fe067476a", - "symbol_name": "UvicornThreadRunner", - "qname": "UvicornThreadRunner", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 24, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "3779fdd2878b770e789a35bb2a89c9d79f13b61c26d7db1b3b683f9bb9e1623f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C4_SEMANTIC_ROLES", - "path": "src/app_runtime/control/http_channel.py", - "title": "HttpControlChannel", - "content": "HttpControlChannel\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (10)", - "start_line": 12, - "end_line": 57, - "metadata": { - "symbol_id": "1c9fbdc24819e5604c26ea55428a74310f03a03e1af197ed84846af61e42fdb0", - "symbol_name": "HttpControlChannel", - "qname": "HttpControlChannel", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 10, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C4_SEMANTIC_ROLES", - "path": "src/app_runtime/control/http_app.py", - "title": "HttpControlAppFactory", - "content": "HttpControlAppFactory\nrole: factory\n\nResponsibilities:\n- name suffix suggests factory", - "start_line": 15, - "end_line": 53, - "metadata": { - "symbol_id": "9b3502a5fb408b273223db13264349cf500de24915b6c649d9ea8970d0dfd8e0", - "symbol_name": "HttpControlAppFactory", - "qname": "HttpControlAppFactory", - "role": "factory", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C4_SEMANTIC_ROLES", - "path": "src/app_runtime/workflow/persistence/workflow_persistence.py", - "title": "WorkflowPersistence", - "content": "WorkflowPersistence\nrole: pipeline_stage\n\nResponsibilities:\n- orchestrates role-like calls (2)\n- reads and writes state attributes\n- participates in dataflow slices (16)", - "start_line": 8, - "end_line": 54, - "metadata": { - "symbol_id": "7bd01ee45cf31f2d5c2e3e51656254860ac785d10cef9e0852cd4fba90857bae", - "symbol_name": "WorkflowPersistence", - "qname": "WorkflowPersistence", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 16, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "80e9410ddc639789b4353c2a1a757ba8d0d5b5bb6075b0b263b61551f04ae1f0", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C4_SEMANTIC_ROLES", - "path": "src/app_runtime/queue/in_memory.py", - "title": "InMemoryTaskQueue", - "content": "InMemoryTaskQueue\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (9)", - "start_line": 9, - "end_line": 38, - "metadata": { - "symbol_id": "2da04cb94544a3bcbf0943a95ad4bdd8710bcafaa32a02fd0e4de2178dcf3533", - "symbol_name": "InMemoryTaskQueue", - "qname": "InMemoryTaskQueue", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 9, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "58f0cc001ccda0eee4c6bc32ed83bd05eafd6b6644f1e8b4aa9eed3103db73dc", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C4_SEMANTIC_ROLES", - "path": "src/app_runtime/config/file_loader.py", - "title": "ConfigFileLoader", - "content": "ConfigFileLoader\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (8)", - "start_line": 11, - "end_line": 48, - "metadata": { - "symbol_id": "a8474eca8b6e9dc86ae67ed68b16fa5fb639ef08739c053e7b7195489765667f", - "symbol_name": "ConfigFileLoader", - "qname": "ConfigFileLoader", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 8, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "1f19ffebde5e38e4be5a5d5a678059a0f36dedb8fb8b3e00ab395c67106a87ea", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C4_SEMANTIC_ROLES", - "path": "src/app_runtime/tracing/store.py", - "title": "TraceContextStore", - "content": "TraceContextStore\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (6)", - "start_line": 15, - "end_line": 52, - "metadata": { - "symbol_id": "b2dad4fbe16ffb11b58deba311c7739955c39d59f291b22181f33e9c8cce4059", - "symbol_name": "TraceContextStore", - "qname": "TraceContextStore", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 6, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "d369554f08fc92039c6edd5a2a1e73b23901533e8974459170bbd9347d263dc5", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C4_SEMANTIC_ROLES", - "path": "src/app_runtime/workers/supervisor.py", - "title": "WorkerSupervisor", - "content": "WorkerSupervisor\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (6)", - "start_line": 10, - "end_line": 59, - "metadata": { - "symbol_id": "c17b44e8d9e97d490989b21fa67d7c346cdda8a0472e4c41fb243c8846faa124", - "symbol_name": "WorkerSupervisor", - "qname": "WorkerSupervisor", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 6, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "77609d9d5927171cce7fc3a54897c183fd63068710c6362029b700937aae5eee", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C4_SEMANTIC_ROLES", - "path": "src/app_runtime/workflow/engine/workflow_engine.py", - "title": "WorkflowEngine", - "content": "WorkflowEngine\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (6)", - "start_line": 10, - "end_line": 86, - "metadata": { - "symbol_id": "57ec0a9f11c542c78e008684a888397e8d9ef4223671acb2567e631a0cbc70b4", - "symbol_name": "WorkflowEngine", - "qname": "WorkflowEngine", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 6, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "1057136e58a325cd5ab6f4e265d15665fb6a711b7022d9fab52a1a290afa2368", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C3_ENTRYPOINTS", - "path": "src/app_runtime/control/http_app.py", - "title": "app.post", - "content": "fastapi http app.post", - "start_line": 38, - "end_line": 42, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C3_ENTRYPOINTS", - "path": "src/app_runtime/control/http_app.py", - "title": "app.get", - "content": "fastapi http app.get", - "start_line": 31, - "end_line": 34, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C3_ENTRYPOINTS", - "path": "src/app_runtime/control/http_app.py", - "title": "app.get", - "content": "fastapi http app.get", - "start_line": 38, - "end_line": 42, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "path": "src/app_runtime/control/service.py", - "title": "ControlPlaneService.__init__:dataflow_slice", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._start_async", - "start_line": 14, - "end_line": 47, - "metadata": { - "edge_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517", - "dst_ref": "ControlPlaneService._start_async", - "resolution": "resolved", - "slice_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._start_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "path": "src/app_runtime/control/service.py", - "title": "ControlPlaneService.__init__:dataflow_slice", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.register_channel", - "start_line": 14, - "end_line": 17, - "metadata": { - "edge_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957", - "dst_ref": "ControlPlaneService.register_channel", - "resolution": "resolved", - "slice_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.register_channel" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "path": "src/app_runtime/control/service.py", - "title": "ControlPlaneService.__init__:dataflow_slice", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.start", - "start_line": 14, - "end_line": 20, - "metadata": { - "edge_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154", - "dst_ref": "ControlPlaneService.start", - "resolution": "resolved", - "slice_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.start" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "path": "src/app_runtime/control/service.py", - "title": "ControlPlaneService.__init__:dataflow_slice", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.stop", - "start_line": 14, - "end_line": 25, - "metadata": { - "edge_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d", - "dst_ref": "ControlPlaneService.stop", - "resolution": "resolved", - "slice_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.stop" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "path": "src/app_runtime/control/service.py", - "title": "ControlPlaneService.__init__:dataflow_slice", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._stop_async", - "start_line": 14, - "end_line": 51, - "metadata": { - "edge_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a", - "dst_ref": "ControlPlaneService._stop_async", - "resolution": "resolved", - "slice_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._stop_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "path": "src/app_runtime/control/service.py", - "title": "ControlPlaneService.start:calls", - "content": "ControlPlaneService.start calls asyncio.run", - "start_line": 22, - "end_line": 22, - "metadata": { - "edge_id": "4e0b3147fb867d48d26567570c259f4052a739e3098133802d4b8bafcf03be6b", - "edge_type": "calls", - "src_symbol_id": "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154", - "src_qname": "ControlPlaneService.start", - "dst_symbol_id": null, - "dst_ref": "asyncio.run", - "resolution": "partial", - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "path": "src/app_runtime/control/service.py", - "title": "ControlPlaneService.register_channel:reads_attr", - "content": "ControlPlaneService.register_channel reads_attr ControlPlaneService._channels", - "start_line": 17, - "end_line": 17, - "metadata": { - "edge_id": "3101fdc99a7a9c5aebf18a024bc148d37b348248a6fd02b95724dff280f2908a", - "edge_type": "reads_attr", - "src_symbol_id": "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957", - "src_qname": "ControlPlaneService.register_channel", - "dst_symbol_id": null, - "dst_ref": "ControlPlaneService._channels", - "resolution": "partial", - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "path": "src/app_runtime/control/service.py", - "title": "ControlPlaneService.start:reads_attr", - "content": "ControlPlaneService.start reads_attr ControlPlaneService._channels", - "start_line": 20, - "end_line": 20, - "metadata": { - "edge_id": "9452e50ef27d47c30ee1c311c48fe73ecddbf7a6dbcf967a6345e98222d9f71a", - "edge_type": "reads_attr", - "src_symbol_id": "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154", - "src_qname": "ControlPlaneService.start", - "dst_symbol_id": null, - "dst_ref": "ControlPlaneService._channels", - "resolution": "partial", - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C1_SYMBOL_CATALOG", - "path": "src/app_runtime/core/runtime.py", - "title": "ControlPlaneService", - "content": "const ControlPlaneService\nControlPlaneService = app_runtime.control.service.ControlPlaneService", - "start_line": 7, - "end_line": 7, - "metadata": { - "symbol_id": "3030804d119fa1d4b8a6c32616062a5e11080b03d33818c9280bcc5bdd8fd512", - "qname": "ControlPlaneService", - "kind": "const", - "signature": "ControlPlaneService = app_runtime.control.service.ControlPlaneService", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.core.runtime", - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C1_SYMBOL_CATALOG", - "path": "src/plba/control.py", - "title": "ControlPlaneService", - "content": "const ControlPlaneService\nControlPlaneService = app_runtime.control.service.ControlPlaneService", - "start_line": 3, - "end_line": 3, - "metadata": { - "symbol_id": "bd7f620031a049b8d791534536941ce75071029542395a7bb14817742827070a", - "qname": "ControlPlaneService", - "kind": "const", - "signature": "ControlPlaneService = app_runtime.control.service.ControlPlaneService", - "parent_symbol_id": null, - "package_or_module": "src.plba.control", - "is_test": false, - "blob_sha": "31bd5c4481bfa7fbca8fae56d4860a67e3953ca74474ac8439e1f39b685d7bc8", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C1_SYMBOL_CATALOG", - "path": "src/app_runtime/control/service.py", - "title": "ControlPlaneService", - "content": "class ControlPlaneService\nControlPlaneService", - "start_line": 12, - "end_line": 52, - "metadata": { - "symbol_id": "b13471e5916986dccffb53fab613812842965705e6b3a89ae549d30c9e91e9aa", - "qname": "ControlPlaneService", - "kind": "class", - "signature": "ControlPlaneService", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.control.service", - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C1_SYMBOL_CATALOG", - "path": "src/app_runtime/control/__init__.py", - "title": "ControlPlaneService", - "content": "const ControlPlaneService\nControlPlaneService = app_runtime.control.service.ControlPlaneService", - "start_line": 3, - "end_line": 3, - "metadata": { - "symbol_id": "217e8f044d1c01644bf7b81e5046af9e84469210c692a2fb0c476a19bb069ae1", - "qname": "ControlPlaneService", - "kind": "const", - "signature": "ControlPlaneService = app_runtime.control.service.ControlPlaneService", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.control.__init__", - "is_test": false, - "blob_sha": "bf3c37e3369a84cc618adc0fd71c232e5eb4b871eaff743069a17e661e498316", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C1_SYMBOL_CATALOG", - "path": "src/plba/__init__.py", - "title": "ControlPlaneService", - "content": "const ControlPlaneService\nControlPlaneService = plba.control.ControlPlaneService", - "start_line": 3, - "end_line": 3, - "metadata": { - "symbol_id": "90b154d49d544efb7c448e91bf5b75231578a6571b98c06a2a555fa5dcffb152", - "qname": "ControlPlaneService", - "kind": "const", - "signature": "ControlPlaneService = plba.control.ControlPlaneService", - "parent_symbol_id": null, - "package_or_module": "src.plba.__init__", - "is_test": false, - "blob_sha": "24e755ec8c249d14fb0e675b5dbf2b71ab91afb9c849897eebfa9feb2499e19d", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C1_SYMBOL_CATALOG", - "path": "src/app_runtime/control/__init__.py", - "title": "ControlChannel", - "content": "const ControlChannel\nControlChannel = app_runtime.control.base.ControlChannel", - "start_line": 1, - "end_line": 1, - "metadata": { - "symbol_id": "268420f7aa4ed74082b9276cae0cded4f00bac090ffd58fa020a65be0fe19c27", - "qname": "ControlChannel", - "kind": "const", - "signature": "ControlChannel = app_runtime.control.base.ControlChannel", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.control.__init__", - "is_test": false, - "blob_sha": "bf3c37e3369a84cc618adc0fd71c232e5eb4b871eaff743069a17e661e498316", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C0_SOURCE_CHUNKS", - "path": "src/app_runtime/control/base.py", - "title": "src/app_runtime/control/base.py:ControlChannel", - "content": "class ControlChannel(ABC):\n @abstractmethod\n async def start(self, actions: ControlActionSet) -> None:\n \"\"\"Start the control channel and bind handlers.\"\"\"\n\n @abstractmethod\n async def stop(self) -> None:\n \"\"\"Stop the control channel and release resources.\"\"\"", - "start_line": 21, - "end_line": 28, - "metadata": { - "chunk_index": 1, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.base", - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C0_SOURCE_CHUNKS", - "path": "src/app_runtime/control/__init__.py", - "title": "src/app_runtime/control/__init__.py:1-5", - "content": "from app_runtime.control.base import ControlActionSet, ControlChannel\nfrom app_runtime.control.http_channel import HttpControlChannel\nfrom app_runtime.control.service import ControlPlaneService\n\n__all__ = [\"ControlActionSet\", \"ControlChannel\", \"ControlPlaneService\", \"HttpControlChannel\"]", - "start_line": 1, - "end_line": 5, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.app_runtime.control.__init__", - "is_test": false, - "blob_sha": "bf3c37e3369a84cc618adc0fd71c232e5eb4b871eaff743069a17e661e498316", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C0_SOURCE_CHUNKS", - "path": "src/app_runtime/control/base.py", - "title": "src/app_runtime/control/base.py:ControlActionSet", - "content": "class ControlActionSet:\n health: HealthHandler\n start: ActionHandler\n stop: ActionHandler\n status: ActionHandler", - "start_line": 14, - "end_line": 18, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.base", - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C0_SOURCE_CHUNKS", - "path": "src/app_runtime/control/http_app.py", - "title": "src/app_runtime/control/http_app.py:HttpControlAppFactory", - "content": "class HttpControlAppFactory:\n def create(\n self,\n health_provider: Callable[[], Awaitable[HealthPayload]],\n action_provider: Callable[[str, str], Awaitable[JSONResponse]],\n ) -> FastAPI:\n app = FastAPI(title=\"PLBA Control API\")\n\n @app.middleware(\"http\")\n async def log_api_call(request: Request, call_next): # type: ignore[no-untyped-def]\n started = time.monotonic()\n response = await call_next(request)\n response.headers[\"X-Response-Time-Ms\"] = str(int((time.monotonic() - started) * 1000))\n return response\n\n @app.get(\"/health\")\n async def health() -> JSONResponse:\n payload = await health_provider()\n status_code = 200 if payload.get(\"status\") == \"ok\" else 503\n return JSONResponse(content=payload, status_code=status_code)\n\n @app.get(\"/actions/{action}\")\n @app.post(\"/actions/{action}\")\n async def action(action: str, request: Request) -> JSONResponse:\n client_source = self._client_source(request)\n if action in {\"start\", \"stop\"}:\n LOGGER.warning(\"Control action requested: /actions/%s client=%s\", action, client_source)\n return await action_provider(action, client_source)\n\n return app\n\n def _client_source(self, request: Request) -> str:\n explicit_header = request.headers.get(\"X-Client-Source\", \"\").strip()\n if explicit_header:\n return explicit_header\n user_agent = request.headers.get(\"User-Agent\", \"\").strip()\n if user_agent:\n return f\"user-agent:{user_agent}\"\n return \"unknown\"", - "start_line": 15, - "end_line": 53, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.http_app", - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "relations": [ - { - "path": "src/app_runtime/control/service.py", - "metadata": { - "edge_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517", - "dst_ref": "ControlPlaneService._start_async", - "resolution": "resolved", - "slice_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._start_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - }, - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._start_async" - }, - { - "path": "src/app_runtime/control/service.py", - "metadata": { - "edge_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957", - "dst_ref": "ControlPlaneService.register_channel", - "resolution": "resolved", - "slice_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.register_channel" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - }, - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.register_channel" - }, - { - "path": "src/app_runtime/control/service.py", - "metadata": { - "edge_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154", - "dst_ref": "ControlPlaneService.start", - "resolution": "resolved", - "slice_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.start" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - }, - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.start" - }, - { - "path": "src/app_runtime/control/service.py", - "metadata": { - "edge_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d", - "dst_ref": "ControlPlaneService.stop", - "resolution": "resolved", - "slice_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.stop" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - }, - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.stop" - }, - { - "path": "src/app_runtime/control/service.py", - "metadata": { - "edge_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a", - "dst_ref": "ControlPlaneService._stop_async", - "resolution": "resolved", - "slice_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._stop_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - }, - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._stop_async" - }, - { - "path": "src/app_runtime/control/service.py", - "metadata": { - "edge_id": "4e0b3147fb867d48d26567570c259f4052a739e3098133802d4b8bafcf03be6b", - "edge_type": "calls", - "src_symbol_id": "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154", - "src_qname": "ControlPlaneService.start", - "dst_symbol_id": null, - "dst_ref": "asyncio.run", - "resolution": "partial", - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - }, - "content": "ControlPlaneService.start calls asyncio.run" - }, - { - "path": "src/app_runtime/control/service.py", - "metadata": { - "edge_id": "3101fdc99a7a9c5aebf18a024bc148d37b348248a6fd02b95724dff280f2908a", - "edge_type": "reads_attr", - "src_symbol_id": "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957", - "src_qname": "ControlPlaneService.register_channel", - "dst_symbol_id": null, - "dst_ref": "ControlPlaneService._channels", - "resolution": "partial", - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - }, - "content": "ControlPlaneService.register_channel reads_attr ControlPlaneService._channels" - }, - { - "path": "src/app_runtime/control/service.py", - "metadata": { - "edge_id": "9452e50ef27d47c30ee1c311c48fe73ecddbf7a6dbcf967a6345e98222d9f71a", - "edge_type": "reads_attr", - "src_symbol_id": "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154", - "src_qname": "ControlPlaneService.start", - "dst_symbol_id": null, - "dst_ref": "ControlPlaneService._channels", - "resolution": "partial", - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - }, - "content": "ControlPlaneService.start reads_attr ControlPlaneService._channels" - } - ], - "entrypoints": [ - { - "path": "src/app_runtime/control/http_app.py", - "title": "app.get", - "start_line": 31, - "end_line": 34, - "http_method": "GET", - "route_path": "/health", - "handler_symbol": "health", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "route_or_command": "app.get", - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "title": "app.get", - "start_line": 38, - "end_line": 42, - "http_method": "GET", - "route_path": "/actions/{action}", - "handler_symbol": "action", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "route_or_command": "app.get", - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "title": "app.post", - "start_line": 38, - "end_line": 42, - "http_method": "POST", - "route_path": "/actions/{action}", - "handler_symbol": "action", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "route_or_command": "app.post", - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "test_candidates": [], - "layer_outcomes": [ - { - "layer_id": "C4_SEMANTIC_ROLES", - "hit_count": 12, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C3_ENTRYPOINTS", - "hit_count": 3, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C2_DEPENDENCY_GRAPH", - "hit_count": 8, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C1_SYMBOL_CATALOG", - "hit_count": 6, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C0_SOURCE_CHUNKS", - "hit_count": 4, - "empty": false, - "fallback_used": false - } - ], - "missing_layers": [], - "raw_rows": [ - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests service\n- reads and writes state attributes\n- participates in dataflow slices (5)", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlPlaneService", - "span_start": 12, - "span_end": 52, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 68, - "layer_rank": 2, - "distance": null, - "metadata": { - "symbol_id": "b13471e5916986dccffb53fab613812842965705e6b3a89ae549d30c9e91e9aa", - "symbol_name": "ControlPlaneService", - "qname": "ControlPlaneService", - "role": "pipeline_stage", - "confidence": 0.57, - "dataflow_participation": 5, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "ControlActionSet\nrole: model\n\nResponsibilities:\n- default model role", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlActionSet", - "span_start": 14, - "span_end": 18, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 40, - "layer_rank": 2, - "distance": null, - "metadata": { - "symbol_id": "46eb026cb3313415ec47b82dd22f84f4d112c9d987e8b1716dcb0baa1cce8988", - "symbol_name": "ControlActionSet", - "qname": "ControlActionSet", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "ControlChannel\nrole: model\n\nResponsibilities:\n- default model role", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlChannel", - "span_start": 21, - "span_end": 28, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 40, - "layer_rank": 2, - "distance": null, - "metadata": { - "symbol_id": "cfcfe9a311d3a2dbdaf32ac4ccd73c0eb9a117f830591a1c0867ee97d46204ff", - "symbol_name": "ControlChannel", - "qname": "ControlChannel", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_runner.py", - "content": "UvicornThreadRunner\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (24)", - "layer": "C4_SEMANTIC_ROLES", - "title": "UvicornThreadRunner", - "span_start": 10, - "span_end": 61, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 11, - "layer_rank": 2, - "distance": null, - "metadata": { - "symbol_id": "fd55630045a02100df8877ac27d951ee08617d4598764394d48cb51fe067476a", - "symbol_name": "UvicornThreadRunner", - "qname": "UvicornThreadRunner", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 24, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "3779fdd2878b770e789a35bb2a89c9d79f13b61c26d7db1b3b683f9bb9e1623f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (10)", - "layer": "C4_SEMANTIC_ROLES", - "title": "HttpControlChannel", - "span_start": 12, - "span_end": 57, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 21, - "layer_rank": 2, - "distance": null, - "metadata": { - "symbol_id": "1c9fbdc24819e5604c26ea55428a74310f03a03e1af197ed84846af61e42fdb0", - "symbol_name": "HttpControlChannel", - "qname": "HttpControlChannel", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 10, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "HttpControlAppFactory\nrole: factory\n\nResponsibilities:\n- name suffix suggests factory", - "layer": "C4_SEMANTIC_ROLES", - "title": "HttpControlAppFactory", - "span_start": 15, - "span_end": 53, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 39, - "layer_rank": 2, - "distance": null, - "metadata": { - "symbol_id": "9b3502a5fb408b273223db13264349cf500de24915b6c649d9ea8970d0dfd8e0", - "symbol_name": "HttpControlAppFactory", - "qname": "HttpControlAppFactory", - "role": "factory", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/persistence/workflow_persistence.py", - "content": "WorkflowPersistence\nrole: pipeline_stage\n\nResponsibilities:\n- orchestrates role-like calls (2)\n- reads and writes state attributes\n- participates in dataflow slices (16)", - "layer": "C4_SEMANTIC_ROLES", - "title": "WorkflowPersistence", - "span_start": 8, - "span_end": 54, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 15, - "layer_rank": 2, - "distance": null, - "metadata": { - "symbol_id": "7bd01ee45cf31f2d5c2e3e51656254860ac785d10cef9e0852cd4fba90857bae", - "symbol_name": "WorkflowPersistence", - "qname": "WorkflowPersistence", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 16, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "80e9410ddc639789b4353c2a1a757ba8d0d5b5bb6075b0b263b61551f04ae1f0", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/queue/in_memory.py", - "content": "InMemoryTaskQueue\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (9)", - "layer": "C4_SEMANTIC_ROLES", - "title": "InMemoryTaskQueue", - "span_start": 9, - "span_end": 38, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 22, - "layer_rank": 2, - "distance": null, - "metadata": { - "symbol_id": "2da04cb94544a3bcbf0943a95ad4bdd8710bcafaa32a02fd0e4de2178dcf3533", - "symbol_name": "InMemoryTaskQueue", - "qname": "InMemoryTaskQueue", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 9, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "58f0cc001ccda0eee4c6bc32ed83bd05eafd6b6644f1e8b4aa9eed3103db73dc", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/config/file_loader.py", - "content": "ConfigFileLoader\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (8)", - "layer": "C4_SEMANTIC_ROLES", - "title": "ConfigFileLoader", - "span_start": 11, - "span_end": 48, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 23, - "layer_rank": 2, - "distance": null, - "metadata": { - "symbol_id": "a8474eca8b6e9dc86ae67ed68b16fa5fb639ef08739c053e7b7195489765667f", - "symbol_name": "ConfigFileLoader", - "qname": "ConfigFileLoader", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 8, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "1f19ffebde5e38e4be5a5d5a678059a0f36dedb8fb8b3e00ab395c67106a87ea", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/store.py", - "content": "TraceContextStore\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (6)", - "layer": "C4_SEMANTIC_ROLES", - "title": "TraceContextStore", - "span_start": 15, - "span_end": 52, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 25, - "layer_rank": 2, - "distance": null, - "metadata": { - "symbol_id": "b2dad4fbe16ffb11b58deba311c7739955c39d59f291b22181f33e9c8cce4059", - "symbol_name": "TraceContextStore", - "qname": "TraceContextStore", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 6, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "d369554f08fc92039c6edd5a2a1e73b23901533e8974459170bbd9347d263dc5", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workers/supervisor.py", - "content": "WorkerSupervisor\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (6)", - "layer": "C4_SEMANTIC_ROLES", - "title": "WorkerSupervisor", - "span_start": 10, - "span_end": 59, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 25, - "layer_rank": 2, - "distance": null, - "metadata": { - "symbol_id": "c17b44e8d9e97d490989b21fa67d7c346cdda8a0472e4c41fb243c8846faa124", - "symbol_name": "WorkerSupervisor", - "qname": "WorkerSupervisor", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 6, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "77609d9d5927171cce7fc3a54897c183fd63068710c6362029b700937aae5eee", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/engine/workflow_engine.py", - "content": "WorkflowEngine\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (6)", - "layer": "C4_SEMANTIC_ROLES", - "title": "WorkflowEngine", - "span_start": 10, - "span_end": 86, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 25, - "layer_rank": 2, - "distance": null, - "metadata": { - "symbol_id": "57ec0a9f11c542c78e008684a888397e8d9ef4223671acb2567e631a0cbc70b4", - "symbol_name": "WorkflowEngine", - "qname": "WorkflowEngine", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 6, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "1057136e58a325cd5ab6f4e265d15665fb6a711b7022d9fab52a1a290afa2368", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": null, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": null, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": null, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._start_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 47, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": null, - "metadata": { - "edge_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517", - "dst_ref": "ControlPlaneService._start_async", - "resolution": "resolved", - "slice_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._start_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.register_channel", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 17, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": null, - "metadata": { - "edge_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957", - "dst_ref": "ControlPlaneService.register_channel", - "resolution": "resolved", - "slice_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.register_channel" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.start", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 20, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": null, - "metadata": { - "edge_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154", - "dst_ref": "ControlPlaneService.start", - "resolution": "resolved", - "slice_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.start" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.stop", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 25, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": null, - "metadata": { - "edge_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d", - "dst_ref": "ControlPlaneService.stop", - "resolution": "resolved", - "slice_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.stop" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._stop_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 51, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": null, - "metadata": { - "edge_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a", - "dst_ref": "ControlPlaneService._stop_async", - "resolution": "resolved", - "slice_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._stop_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.start calls asyncio.run", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.start:calls", - "span_start": 22, - "span_end": 22, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": null, - "metadata": { - "edge_id": "4e0b3147fb867d48d26567570c259f4052a739e3098133802d4b8bafcf03be6b", - "edge_type": "calls", - "src_symbol_id": "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154", - "src_qname": "ControlPlaneService.start", - "dst_symbol_id": null, - "dst_ref": "asyncio.run", - "resolution": "partial", - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.register_channel reads_attr ControlPlaneService._channels", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.register_channel:reads_attr", - "span_start": 17, - "span_end": 17, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": null, - "metadata": { - "edge_id": "3101fdc99a7a9c5aebf18a024bc148d37b348248a6fd02b95724dff280f2908a", - "edge_type": "reads_attr", - "src_symbol_id": "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957", - "src_qname": "ControlPlaneService.register_channel", - "dst_symbol_id": null, - "dst_ref": "ControlPlaneService._channels", - "resolution": "partial", - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.start reads_attr ControlPlaneService._channels", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.start:reads_attr", - "span_start": 20, - "span_end": 20, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": null, - "metadata": { - "edge_id": "9452e50ef27d47c30ee1c311c48fe73ecddbf7a6dbcf967a6345e98222d9f71a", - "edge_type": "reads_attr", - "src_symbol_id": "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154", - "src_qname": "ControlPlaneService.start", - "dst_symbol_id": null, - "dst_ref": "ControlPlaneService._channels", - "resolution": "partial", - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "const ControlPlaneService\nControlPlaneService = app_runtime.control.service.ControlPlaneService", - "layer": "C1_SYMBOL_CATALOG", - "title": "ControlPlaneService", - "span_start": 7, - "span_end": 7, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": null, - "metadata": { - "symbol_id": "3030804d119fa1d4b8a6c32616062a5e11080b03d33818c9280bcc5bdd8fd512", - "qname": "ControlPlaneService", - "kind": "const", - "signature": "ControlPlaneService = app_runtime.control.service.ControlPlaneService", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.core.runtime", - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/control.py", - "content": "const ControlPlaneService\nControlPlaneService = app_runtime.control.service.ControlPlaneService", - "layer": "C1_SYMBOL_CATALOG", - "title": "ControlPlaneService", - "span_start": 3, - "span_end": 3, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": null, - "metadata": { - "symbol_id": "bd7f620031a049b8d791534536941ce75071029542395a7bb14817742827070a", - "qname": "ControlPlaneService", - "kind": "const", - "signature": "ControlPlaneService = app_runtime.control.service.ControlPlaneService", - "parent_symbol_id": null, - "package_or_module": "src.plba.control", - "is_test": false, - "blob_sha": "31bd5c4481bfa7fbca8fae56d4860a67e3953ca74474ac8439e1f39b685d7bc8", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "class ControlPlaneService\nControlPlaneService", - "layer": "C1_SYMBOL_CATALOG", - "title": "ControlPlaneService", - "span_start": 12, - "span_end": 52, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": null, - "metadata": { - "symbol_id": "b13471e5916986dccffb53fab613812842965705e6b3a89ae549d30c9e91e9aa", - "qname": "ControlPlaneService", - "kind": "class", - "signature": "ControlPlaneService", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.control.service", - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/__init__.py", - "content": "const ControlPlaneService\nControlPlaneService = app_runtime.control.service.ControlPlaneService", - "layer": "C1_SYMBOL_CATALOG", - "title": "ControlPlaneService", - "span_start": 3, - "span_end": 3, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": null, - "metadata": { - "symbol_id": "217e8f044d1c01644bf7b81e5046af9e84469210c692a2fb0c476a19bb069ae1", - "qname": "ControlPlaneService", - "kind": "const", - "signature": "ControlPlaneService = app_runtime.control.service.ControlPlaneService", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.control.__init__", - "is_test": false, - "blob_sha": "bf3c37e3369a84cc618adc0fd71c232e5eb4b871eaff743069a17e661e498316", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/__init__.py", - "content": "const ControlPlaneService\nControlPlaneService = plba.control.ControlPlaneService", - "layer": "C1_SYMBOL_CATALOG", - "title": "ControlPlaneService", - "span_start": 3, - "span_end": 3, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": null, - "metadata": { - "symbol_id": "90b154d49d544efb7c448e91bf5b75231578a6571b98c06a2a555fa5dcffb152", - "qname": "ControlPlaneService", - "kind": "const", - "signature": "ControlPlaneService = plba.control.ControlPlaneService", - "parent_symbol_id": null, - "package_or_module": "src.plba.__init__", - "is_test": false, - "blob_sha": "24e755ec8c249d14fb0e675b5dbf2b71ab91afb9c849897eebfa9feb2499e19d", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/__init__.py", - "content": "const ControlChannel\nControlChannel = app_runtime.control.base.ControlChannel", - "layer": "C1_SYMBOL_CATALOG", - "title": "ControlChannel", - "span_start": 1, - "span_end": 1, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": null, - "metadata": { - "symbol_id": "268420f7aa4ed74082b9276cae0cded4f00bac090ffd58fa020a65be0fe19c27", - "qname": "ControlChannel", - "kind": "const", - "signature": "ControlChannel = app_runtime.control.base.ControlChannel", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.control.__init__", - "is_test": false, - "blob_sha": "bf3c37e3369a84cc618adc0fd71c232e5eb4b871eaff743069a17e661e498316", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "class ControlChannel(ABC):\n @abstractmethod\n async def start(self, actions: ControlActionSet) -> None:\n \"\"\"Start the control channel and bind handlers.\"\"\"\n\n @abstractmethod\n async def stop(self) -> None:\n \"\"\"Stop the control channel and release resources.\"\"\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/base.py:ControlChannel", - "span_start": 21, - "span_end": 28, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": null, - "metadata": { - "chunk_index": 1, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.base", - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/__init__.py", - "content": "from app_runtime.control.base import ControlActionSet, ControlChannel\nfrom app_runtime.control.http_channel import HttpControlChannel\nfrom app_runtime.control.service import ControlPlaneService\n\n__all__ = [\"ControlActionSet\", \"ControlChannel\", \"ControlPlaneService\", \"HttpControlChannel\"]", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/__init__.py:1-5", - "span_start": 1, - "span_end": 5, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": null, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.app_runtime.control.__init__", - "is_test": false, - "blob_sha": "bf3c37e3369a84cc618adc0fd71c232e5eb4b871eaff743069a17e661e498316", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "class ControlActionSet:\n health: HealthHandler\n start: ActionHandler\n stop: ActionHandler\n status: ActionHandler", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/base.py:ControlActionSet", - "span_start": 14, - "span_end": 18, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": null, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.base", - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "class HttpControlAppFactory:\n def create(\n self,\n health_provider: Callable[[], Awaitable[HealthPayload]],\n action_provider: Callable[[str, str], Awaitable[JSONResponse]],\n ) -> FastAPI:\n app = FastAPI(title=\"PLBA Control API\")\n\n @app.middleware(\"http\")\n async def log_api_call(request: Request, call_next): # type: ignore[no-untyped-def]\n started = time.monotonic()\n response = await call_next(request)\n response.headers[\"X-Response-Time-Ms\"] = str(int((time.monotonic() - started) * 1000))\n return response\n\n @app.get(\"/health\")\n async def health() -> JSONResponse:\n payload = await health_provider()\n status_code = 200 if payload.get(\"status\") == \"ok\" else 503\n return JSONResponse(content=payload, status_code=status_code)\n\n @app.get(\"/actions/{action}\")\n @app.post(\"/actions/{action}\")\n async def action(action: str, request: Request) -> JSONResponse:\n client_source = self._client_source(request)\n if action in {\"start\", \"stop\"}:\n LOGGER.warning(\"Control action requested: /actions/%s client=%s\", action, client_source)\n return await action_provider(action, client_source)\n\n return app\n\n def _client_source(self, request: Request) -> str:\n explicit_header = request.headers.get(\"X-Client-Source\", \"\").strip()\n if explicit_header:\n return explicit_header\n user_agent = request.headers.get(\"User-Agent\", \"\").strip()\n if user_agent:\n return f\"user-agent:{user_agent}\"\n return \"unknown\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/http_app.py:HttpControlAppFactory", - "span_start": 15, - "span_end": 53, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": null, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.http_app", - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "retrieval_report": { - "executed_layers": [ - "C4_SEMANTIC_ROLES", - "C3_ENTRYPOINTS", - "C2_DEPENDENCY_GRAPH", - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS" - ], - "retrieval_mode_by_layer": { - "C4_SEMANTIC_ROLES": "vector", - "C3_ENTRYPOINTS": "vector", - "C2_DEPENDENCY_GRAPH": "vector", - "C1_SYMBOL_CATALOG": "vector", - "C0_SOURCE_CHUNKS": "vector" - }, - "top_k_by_layer": { - "C4_SEMANTIC_ROLES": 12, - "C3_ENTRYPOINTS": 8, - "C2_DEPENDENCY_GRAPH": 8, - "C1_SYMBOL_CATALOG": 6, - "C0_SOURCE_CHUNKS": 4 - }, - "filters_by_layer": { - "C4_SEMANTIC_ROLES": { - "path_scope": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [] - }, - "C1_SYMBOL_CATALOG": { - "path_scope": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [] - } - }, - "fallback": { - "used": false, - "reason": null - }, - "retrieval_by_layer_ms": { - "C4_SEMANTIC_ROLES": 57, - "C3_ENTRYPOINTS": 14, - "C2_DEPENDENCY_GRAPH": 61, - "C1_SYMBOL_CATALOG": 25, - "C0_SOURCE_CHUNKS": 17 - } - } - }, - "diagnostics": { - "intent_correct": null, - "target_found": true, - "layers_used": [ - "C4_SEMANTIC_ROLES", - "C3_ENTRYPOINTS", - "C2_DEPENDENCY_GRAPH", - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS" - ], - "retrieval_sufficient": true, - "answer_mode": "normal", - "resolved_target": "ControlPlaneService", - "answer_policy_branch": "normal_answer", - "decision_reason": "evidence_sufficient", - "router_result": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "retrieval_profile": "code", - "sub_intent": "ARCHITECTURE", - "path_scope": [], - "layers": [ - "C4_SEMANTIC_ROLES", - "C3_ENTRYPOINTS", - "C2_DEPENDENCY_GRAPH", - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS" - ], - "symbol_resolution_status": "resolved" - }, - "retrieval_request": { - "rag_session_id": "7d11da21-faa0-4cea-aede-aeabe069164c", - "query": "Какие компоненты участвуют в ControlPlaneService?", - "sub_intent": "ARCHITECTURE", - "path_scope": [], - "requested_layers": [ - "C4_SEMANTIC_ROLES", - "C3_ENTRYPOINTS", - "C2_DEPENDENCY_GRAPH", - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS" - ] - }, - "per_layer_outcome": [ - { - "layer_id": "C4_SEMANTIC_ROLES", - "hit_count": 12, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C3_ENTRYPOINTS", - "hit_count": 3, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C2_DEPENDENCY_GRAPH", - "hit_count": 8, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C1_SYMBOL_CATALOG", - "hit_count": 6, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C0_SOURCE_CHUNKS", - "hit_count": 4, - "empty": false, - "fallback_used": false - } - ], - "empty_layers": [], - "evidence_gate_decision": { - "sufficient": true, - "failure_reasons": [], - "evidence_count": 33 - }, - "evidence_gate_input": { - "resolved_target": "ControlPlaneService", - "sub_intent": "ARCHITECTURE", - "target_type": "symbol", - "evidence_count": 33, - "code_chunk_count": 33, - "entrypoint_count": 3, - "relation_count": 8, - "test_evidence_count": 0, - "symbol_resolution_status": "resolved", - "path_scope": [] - }, - "post_evidence_gate": { - "input": { - "answer_mode": "normal", - "degraded_message": "", - "resolved_target": "ControlPlaneService", - "draft_answer_preview": "Компоненты, участвующие в ControlPlaneService:\n\n- **ControlActionSet** – модель для управления действиями.\n- **ControlChannel** – абстрактный базовый класс каналов контроля с методами start и stop.\n- **UvicornThreadRunner** – этап пайплайна для многопоточного запуска HTTP сервера.\n- **HttpControlCha", - "repair_candidate": true - }, - "output": { - "passed": true, - "action": "return", - "reasons": [], - "repair_used": false, - "final_answer_preview": "Компоненты, участвующие в ControlPlaneService:\n\n- **ControlActionSet** – модель для управления действиями.\n- **ControlChannel** – абстрактный базовый класс каналов контроля с методами start и stop.\n- **UvicornThreadRunner** – этап пайплайна для многопоточного запуска HTTP сервера.\n- **HttpControlCha" - } - }, - "failure_reasons": [], - "timings_ms": { - "router": 1, - "retrieval": 177, - "pre_evidence_gate": 1, - "llm": 6818, - "post_evidence_gate": 1 - } - }, - "rag_rows": [ - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests service\n- reads and writes state attributes\n- participates in dataflow slices (5)", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlPlaneService", - "span_start": 12, - "span_end": 52, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 68, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "b13471e5916986dccffb53fab613812842965705e6b3a89ae549d30c9e91e9aa", - "symbol_name": "ControlPlaneService", - "qname": "ControlPlaneService", - "role": "pipeline_stage", - "confidence": 0.57, - "dataflow_participation": 5, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "ControlActionSet\nrole: model\n\nResponsibilities:\n- default model role", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlActionSet", - "span_start": 14, - "span_end": 18, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 40, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "46eb026cb3313415ec47b82dd22f84f4d112c9d987e8b1716dcb0baa1cce8988", - "symbol_name": "ControlActionSet", - "qname": "ControlActionSet", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "ControlChannel\nrole: model\n\nResponsibilities:\n- default model role", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlChannel", - "span_start": 21, - "span_end": 28, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 40, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "cfcfe9a311d3a2dbdaf32ac4ccd73c0eb9a117f830591a1c0867ee97d46204ff", - "symbol_name": "ControlChannel", - "qname": "ControlChannel", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_runner.py", - "content": "UvicornThreadRunner\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (24)", - "layer": "C4_SEMANTIC_ROLES", - "title": "UvicornThreadRunner", - "span_start": 10, - "span_end": 61, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 11, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "fd55630045a02100df8877ac27d951ee08617d4598764394d48cb51fe067476a", - "symbol_name": "UvicornThreadRunner", - "qname": "UvicornThreadRunner", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 24, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "3779fdd2878b770e789a35bb2a89c9d79f13b61c26d7db1b3b683f9bb9e1623f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (10)", - "layer": "C4_SEMANTIC_ROLES", - "title": "HttpControlChannel", - "span_start": 12, - "span_end": 57, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 21, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "1c9fbdc24819e5604c26ea55428a74310f03a03e1af197ed84846af61e42fdb0", - "symbol_name": "HttpControlChannel", - "qname": "HttpControlChannel", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 10, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "HttpControlAppFactory\nrole: factory\n\nResponsibilities:\n- name suffix suggests factory", - "layer": "C4_SEMANTIC_ROLES", - "title": "HttpControlAppFactory", - "span_start": 15, - "span_end": 53, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 39, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "9b3502a5fb408b273223db13264349cf500de24915b6c649d9ea8970d0dfd8e0", - "symbol_name": "HttpControlAppFactory", - "qname": "HttpControlAppFactory", - "role": "factory", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/persistence/workflow_persistence.py", - "content": "WorkflowPersistence\nrole: pipeline_stage\n\nResponsibilities:\n- orchestrates role-like calls (2)\n- reads and writes state attributes\n- participates in dataflow slices (16)", - "layer": "C4_SEMANTIC_ROLES", - "title": "WorkflowPersistence", - "span_start": 8, - "span_end": 54, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 15, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "7bd01ee45cf31f2d5c2e3e51656254860ac785d10cef9e0852cd4fba90857bae", - "symbol_name": "WorkflowPersistence", - "qname": "WorkflowPersistence", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 16, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "80e9410ddc639789b4353c2a1a757ba8d0d5b5bb6075b0b263b61551f04ae1f0", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/queue/in_memory.py", - "content": "InMemoryTaskQueue\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (9)", - "layer": "C4_SEMANTIC_ROLES", - "title": "InMemoryTaskQueue", - "span_start": 9, - "span_end": 38, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 22, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "2da04cb94544a3bcbf0943a95ad4bdd8710bcafaa32a02fd0e4de2178dcf3533", - "symbol_name": "InMemoryTaskQueue", - "qname": "InMemoryTaskQueue", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 9, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "58f0cc001ccda0eee4c6bc32ed83bd05eafd6b6644f1e8b4aa9eed3103db73dc", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/config/file_loader.py", - "content": "ConfigFileLoader\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (8)", - "layer": "C4_SEMANTIC_ROLES", - "title": "ConfigFileLoader", - "span_start": 11, - "span_end": 48, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 23, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "a8474eca8b6e9dc86ae67ed68b16fa5fb639ef08739c053e7b7195489765667f", - "symbol_name": "ConfigFileLoader", - "qname": "ConfigFileLoader", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 8, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "1f19ffebde5e38e4be5a5d5a678059a0f36dedb8fb8b3e00ab395c67106a87ea", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/store.py", - "content": "TraceContextStore\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (6)", - "layer": "C4_SEMANTIC_ROLES", - "title": "TraceContextStore", - "span_start": 15, - "span_end": 52, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 25, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "b2dad4fbe16ffb11b58deba311c7739955c39d59f291b22181f33e9c8cce4059", - "symbol_name": "TraceContextStore", - "qname": "TraceContextStore", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 6, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "d369554f08fc92039c6edd5a2a1e73b23901533e8974459170bbd9347d263dc5", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workers/supervisor.py", - "content": "WorkerSupervisor\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (6)", - "layer": "C4_SEMANTIC_ROLES", - "title": "WorkerSupervisor", - "span_start": 10, - "span_end": 59, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 25, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "c17b44e8d9e97d490989b21fa67d7c346cdda8a0472e4c41fb243c8846faa124", - "symbol_name": "WorkerSupervisor", - "qname": "WorkerSupervisor", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 6, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "77609d9d5927171cce7fc3a54897c183fd63068710c6362029b700937aae5eee", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/engine/workflow_engine.py", - "content": "WorkflowEngine\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (6)", - "layer": "C4_SEMANTIC_ROLES", - "title": "WorkflowEngine", - "span_start": 10, - "span_end": 86, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 25, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "57ec0a9f11c542c78e008684a888397e8d9ef4223671acb2567e631a0cbc70b4", - "symbol_name": "WorkflowEngine", - "qname": "WorkflowEngine", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 6, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "1057136e58a325cd5ab6f4e265d15665fb6a711b7022d9fab52a1a290afa2368", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._start_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 47, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517", - "dst_ref": "ControlPlaneService._start_async", - "resolution": "resolved", - "slice_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._start_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.register_channel", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 17, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957", - "dst_ref": "ControlPlaneService.register_channel", - "resolution": "resolved", - "slice_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.register_channel" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.start", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 20, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154", - "dst_ref": "ControlPlaneService.start", - "resolution": "resolved", - "slice_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.start" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.stop", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 25, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d", - "dst_ref": "ControlPlaneService.stop", - "resolution": "resolved", - "slice_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.stop" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._stop_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 51, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a", - "dst_ref": "ControlPlaneService._stop_async", - "resolution": "resolved", - "slice_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._stop_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.start calls asyncio.run", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.start:calls", - "span_start": 22, - "span_end": 22, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "4e0b3147fb867d48d26567570c259f4052a739e3098133802d4b8bafcf03be6b", - "edge_type": "calls", - "src_symbol_id": "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154", - "src_qname": "ControlPlaneService.start", - "dst_symbol_id": null, - "dst_ref": "asyncio.run", - "resolution": "partial", - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.register_channel reads_attr ControlPlaneService._channels", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.register_channel:reads_attr", - "span_start": 17, - "span_end": 17, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "3101fdc99a7a9c5aebf18a024bc148d37b348248a6fd02b95724dff280f2908a", - "edge_type": "reads_attr", - "src_symbol_id": "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957", - "src_qname": "ControlPlaneService.register_channel", - "dst_symbol_id": null, - "dst_ref": "ControlPlaneService._channels", - "resolution": "partial", - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.start reads_attr ControlPlaneService._channels", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.start:reads_attr", - "span_start": 20, - "span_end": 20, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "9452e50ef27d47c30ee1c311c48fe73ecddbf7a6dbcf967a6345e98222d9f71a", - "edge_type": "reads_attr", - "src_symbol_id": "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154", - "src_qname": "ControlPlaneService.start", - "dst_symbol_id": null, - "dst_ref": "ControlPlaneService._channels", - "resolution": "partial", - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "const ControlPlaneService\nControlPlaneService = app_runtime.control.service.ControlPlaneService", - "layer": "C1_SYMBOL_CATALOG", - "title": "ControlPlaneService", - "span_start": 7, - "span_end": 7, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "3030804d119fa1d4b8a6c32616062a5e11080b03d33818c9280bcc5bdd8fd512", - "qname": "ControlPlaneService", - "kind": "const", - "signature": "ControlPlaneService = app_runtime.control.service.ControlPlaneService", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.core.runtime", - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/control.py", - "content": "const ControlPlaneService\nControlPlaneService = app_runtime.control.service.ControlPlaneService", - "layer": "C1_SYMBOL_CATALOG", - "title": "ControlPlaneService", - "span_start": 3, - "span_end": 3, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "bd7f620031a049b8d791534536941ce75071029542395a7bb14817742827070a", - "qname": "ControlPlaneService", - "kind": "const", - "signature": "ControlPlaneService = app_runtime.control.service.ControlPlaneService", - "parent_symbol_id": null, - "package_or_module": "src.plba.control", - "is_test": false, - "blob_sha": "31bd5c4481bfa7fbca8fae56d4860a67e3953ca74474ac8439e1f39b685d7bc8", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "class ControlPlaneService\nControlPlaneService", - "layer": "C1_SYMBOL_CATALOG", - "title": "ControlPlaneService", - "span_start": 12, - "span_end": 52, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "b13471e5916986dccffb53fab613812842965705e6b3a89ae549d30c9e91e9aa", - "qname": "ControlPlaneService", - "kind": "class", - "signature": "ControlPlaneService", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.control.service", - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/__init__.py", - "content": "const ControlPlaneService\nControlPlaneService = app_runtime.control.service.ControlPlaneService", - "layer": "C1_SYMBOL_CATALOG", - "title": "ControlPlaneService", - "span_start": 3, - "span_end": 3, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "217e8f044d1c01644bf7b81e5046af9e84469210c692a2fb0c476a19bb069ae1", - "qname": "ControlPlaneService", - "kind": "const", - "signature": "ControlPlaneService = app_runtime.control.service.ControlPlaneService", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.control.__init__", - "is_test": false, - "blob_sha": "bf3c37e3369a84cc618adc0fd71c232e5eb4b871eaff743069a17e661e498316", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/__init__.py", - "content": "const ControlPlaneService\nControlPlaneService = plba.control.ControlPlaneService", - "layer": "C1_SYMBOL_CATALOG", - "title": "ControlPlaneService", - "span_start": 3, - "span_end": 3, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "90b154d49d544efb7c448e91bf5b75231578a6571b98c06a2a555fa5dcffb152", - "qname": "ControlPlaneService", - "kind": "const", - "signature": "ControlPlaneService = plba.control.ControlPlaneService", - "parent_symbol_id": null, - "package_or_module": "src.plba.__init__", - "is_test": false, - "blob_sha": "24e755ec8c249d14fb0e675b5dbf2b71ab91afb9c849897eebfa9feb2499e19d", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/__init__.py", - "content": "const ControlChannel\nControlChannel = app_runtime.control.base.ControlChannel", - "layer": "C1_SYMBOL_CATALOG", - "title": "ControlChannel", - "span_start": 1, - "span_end": 1, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "268420f7aa4ed74082b9276cae0cded4f00bac090ffd58fa020a65be0fe19c27", - "qname": "ControlChannel", - "kind": "const", - "signature": "ControlChannel = app_runtime.control.base.ControlChannel", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.control.__init__", - "is_test": false, - "blob_sha": "bf3c37e3369a84cc618adc0fd71c232e5eb4b871eaff743069a17e661e498316", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "class ControlChannel(ABC):\n @abstractmethod\n async def start(self, actions: ControlActionSet) -> None:\n \"\"\"Start the control channel and bind handlers.\"\"\"\n\n @abstractmethod\n async def stop(self) -> None:\n \"\"\"Stop the control channel and release resources.\"\"\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/base.py:ControlChannel", - "span_start": 21, - "span_end": 28, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 1, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.base", - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/__init__.py", - "content": "from app_runtime.control.base import ControlActionSet, ControlChannel\nfrom app_runtime.control.http_channel import HttpControlChannel\nfrom app_runtime.control.service import ControlPlaneService\n\n__all__ = [\"ControlActionSet\", \"ControlChannel\", \"ControlPlaneService\", \"HttpControlChannel\"]", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/__init__.py:1-5", - "span_start": 1, - "span_end": 5, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.app_runtime.control.__init__", - "is_test": false, - "blob_sha": "bf3c37e3369a84cc618adc0fd71c232e5eb4b871eaff743069a17e661e498316", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "class ControlActionSet:\n health: HealthHandler\n start: ActionHandler\n stop: ActionHandler\n status: ActionHandler", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/base.py:ControlActionSet", - "span_start": 14, - "span_end": 18, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.base", - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "class HttpControlAppFactory:\n def create(\n self,\n health_provider: Callable[[], Awaitable[HealthPayload]],\n action_provider: Callable[[str, str], Awaitable[JSONResponse]],\n ) -> FastAPI:\n app = FastAPI(title=\"PLBA Control API\")\n\n @app.middleware(\"http\")\n async def log_api_call(request: Request, call_next): # type: ignore[no-untyped-def]\n started = time.monotonic()\n response = await call_next(request)\n response.headers[\"X-Response-Time-Ms\"] = str(int((time.monotonic() - started) * 1000))\n return response\n\n @app.get(\"/health\")\n async def health() -> JSONResponse:\n payload = await health_provider()\n status_code = 200 if payload.get(\"status\") == \"ok\" else 503\n return JSONResponse(content=payload, status_code=status_code)\n\n @app.get(\"/actions/{action}\")\n @app.post(\"/actions/{action}\")\n async def action(action: str, request: Request) -> JSONResponse:\n client_source = self._client_source(request)\n if action in {\"start\", \"stop\"}:\n LOGGER.warning(\"Control action requested: /actions/%s client=%s\", action, client_source)\n return await action_provider(action, client_source)\n\n return app\n\n def _client_source(self, request: Request) -> str:\n explicit_header = request.headers.get(\"X-Client-Source\", \"\").strip()\n if explicit_header:\n return explicit_header\n user_agent = request.headers.get(\"User-Agent\", \"\").strip()\n if user_agent:\n return f\"user-agent:{user_agent}\"\n return \"unknown\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/http_app.py:HttpControlAppFactory", - "span_start": 15, - "span_end": 53, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.http_app", - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "validation": { - "passed": true, - "action": "return", - "reasons": [] - }, - "steps": [ - { - "step": "router", - "status": "completed", - "timings_ms": { - "router": 1 - }, - "output": { - "intent": "CODE_QA", - "sub_intent": "ARCHITECTURE", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - } - }, - { - "step": "retrieval", - "status": "completed", - "timings_ms": { - "retrieval": 177 - }, - "output": { - "rag_count": 33, - "answer_path_rag_count": 33, - "resolved_symbol_status": "resolved", - "resolved_symbol": "ControlPlaneService", - "requested_layers": [ - "C4_SEMANTIC_ROLES", - "C3_ENTRYPOINTS", - "C2_DEPENDENCY_GRAPH", - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS" - ] - }, - "diagnostics": { - "executed_layers": [ - "C4_SEMANTIC_ROLES", - "C3_ENTRYPOINTS", - "C2_DEPENDENCY_GRAPH", - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS" - ], - "retrieval_mode_by_layer": { - "C4_SEMANTIC_ROLES": "vector", - "C3_ENTRYPOINTS": "vector", - "C2_DEPENDENCY_GRAPH": "vector", - "C1_SYMBOL_CATALOG": "vector", - "C0_SOURCE_CHUNKS": "vector" - }, - "top_k_by_layer": { - "C4_SEMANTIC_ROLES": 12, - "C3_ENTRYPOINTS": 8, - "C2_DEPENDENCY_GRAPH": 8, - "C1_SYMBOL_CATALOG": 6, - "C0_SOURCE_CHUNKS": 4 - }, - "filters_by_layer": { - "C4_SEMANTIC_ROLES": { - "path_scope": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [] - }, - "C1_SYMBOL_CATALOG": { - "path_scope": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [] - } - }, - "fallback": { - "used": false, - "reason": null - }, - "retrieval_by_layer_ms": { - "C4_SEMANTIC_ROLES": 57, - "C3_ENTRYPOINTS": 14, - "C2_DEPENDENCY_GRAPH": 61, - "C1_SYMBOL_CATALOG": 25, - "C0_SOURCE_CHUNKS": 17 - } - } - }, - { - "step": "pre_evidence_gate", - "status": "passed", - "timings_ms": { - "pre_evidence_gate": 1 - }, - "input": { - "resolved_target": "ControlPlaneService", - "sub_intent": "ARCHITECTURE", - "target_type": "symbol", - "evidence_count": 33, - "code_chunk_count": 33, - "entrypoint_count": 3, - "relation_count": 8, - "test_evidence_count": 0, - "symbol_resolution_status": "resolved", - "path_scope": [] - }, - "output": { - "passed": true, - "failure_reasons": [], - "degraded_message": "", - "evidence_count": 33 - } - }, - { - "step": "llm", - "status": "completed", - "timings_ms": { - "llm": 6818 - }, - "output": { - "prompt_name": "code_qa_architecture_answer", - "answer_preview": "Компоненты, участвующие в ControlPlaneService:\n\n- **ControlActionSet** – модель для управления действиями.\n- **ControlChannel** – абстрактный базовый класс каналов контроля с методами start и stop.\n- **UvicornThreadRunner** – этап пайплайна для многопоточного запуска HTTP сервера.\n- **HttpControlCha", - "resolved_target": "ControlPlaneService", - "answer_policy_branch": "normal_answer", - "decision_reason": "evidence_sufficient" - } - }, - { - "step": "post_evidence_gate", - "status": "passed", - "timings_ms": { - "post_evidence_gate": 1, - "post_evidence_gate_recheck": 0, - "repair": 0 - }, - "input": { - "answer_mode": "normal", - "degraded_message": "", - "resolved_target": "ControlPlaneService", - "draft_answer_preview": "Компоненты, участвующие в ControlPlaneService:\n\n- **ControlActionSet** – модель для управления действиями.\n- **ControlChannel** – абстрактный базовый класс каналов контроля с методами start и stop.\n- **UvicornThreadRunner** – этап пайплайна для многопоточного запуска HTTP сервера.\n- **HttpControlCha", - "repair_candidate": true - }, - "output": { - "passed": true, - "action": "return", - "reasons": [], - "repair_used": false, - "final_answer_preview": "Компоненты, участвующие в ControlPlaneService:\n\n- **ControlActionSet** – модель для управления действиями.\n- **ControlChannel** – абстрактный базовый класс каналов контроля с методами start и stop.\n- **UvicornThreadRunner** – этап пайплайна для многопоточного запуска HTTP сервера.\n- **HttpControlCha" - } - } - ] - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/plba_full_chain_subintents_v3/20260312_174008/full_chain_plba_code_subintents_v2_plba-v2-architecture-control-plane.md b/tests/pipeline_setup_v3/test_results/plba_full_chain_subintents_v3/20260312_174008/full_chain_plba_code_subintents_v2_plba-v2-architecture-control-plane.md deleted file mode 100644 index e6b24a9..0000000 --- a/tests/pipeline_setup_v3/test_results/plba_full_chain_subintents_v3/20260312_174008/full_chain_plba_code_subintents_v2_plba-v2-architecture-control-plane.md +++ /dev/null @@ -1,305 +0,0 @@ -# plba-v2-architecture-control-plane - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_02_pipeline/full_chain_plba_code_subintents_v2.yaml -- runner: agent_runtime -- mode: full_chain -- passed: True - -## Query -Какие компоненты участвуют в ControlPlaneService? - -## Actual -{ - "intent": "CODE_QA", - "sub_intent": "ARCHITECTURE", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 33, - "llm_answer": "Компоненты, участвующие в ControlPlaneService:\n\n- **ControlActionSet** – модель для управления действиями.\n- **ControlChannel** – абстрактный базовый класс каналов контроля с методами start и stop.\n- **UvicornThreadRunner** – этап пайплайна для многопоточного запуска HTTP сервера.\n- **HttpControlChannel** – канал HTTP-контроля, этап пайплайна.\n- **HttpControlAppFactory** – фабрика создания HTTP-приложения контроля.\n- **WorkflowPersistence** – сохранение состояний рабочих процессов.\n- **InMemoryTaskQueue** – очередь задач в памяти.\n- **ConfigFileLoader** – загрузчик конфигурационных файлов.\n- **TraceContextStore** – хранилище контекстов трассировки.\n- **WorkerSupervisor** – надзор за рабочими процессами.\n- **WorkflowEngine** – движок обработки рабочих процессов.\n\nСвязи внутри ControlPlaneService:\n\n- _channels – атрибут, используемый во многих методах сервиса.\n- register_channel() – метод регистрации канала контроля.\n- start(), stop() – методы старта и остановки сервиса асинхронно.\n\nГраницы ответственности ControlPlaneService подтверждаются инициализацией, регистрацией каналов и управлением жизненным циклом сервисов.\n\nФайлы с ключевыми реализациями: \n- src/app_runtime/control/service.py\n- src/app_runtime/control/base.py\n- src/app_runtime/control/http_runner.py\n- src/app_runtime/control/http_channel.py\n- src/app_runtime/control/http_app.py\n\nВызовы fastapi app.post и app.get используются для HTTP-обработки действий контроля.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "ControlPlaneService" - ], - "layers": [ - "C4_SEMANTIC_ROLES", - "C3_ENTRYPOINTS", - "C2_DEPENDENCY_GRAPH", - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS" - ] -} - -## Steps -[ - { - "step": "router", - "status": "completed", - "timings_ms": { - "router": 1 - }, - "output": { - "intent": "CODE_QA", - "sub_intent": "ARCHITECTURE", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - } - }, - { - "step": "retrieval", - "status": "completed", - "timings_ms": { - "retrieval": 177 - }, - "output": { - "rag_count": 33, - "answer_path_rag_count": 33, - "resolved_symbol_status": "resolved", - "resolved_symbol": "ControlPlaneService", - "requested_layers": [ - "C4_SEMANTIC_ROLES", - "C3_ENTRYPOINTS", - "C2_DEPENDENCY_GRAPH", - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS" - ] - }, - "diagnostics": { - "executed_layers": [ - "C4_SEMANTIC_ROLES", - "C3_ENTRYPOINTS", - "C2_DEPENDENCY_GRAPH", - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS" - ], - "retrieval_mode_by_layer": { - "C4_SEMANTIC_ROLES": "vector", - "C3_ENTRYPOINTS": "vector", - "C2_DEPENDENCY_GRAPH": "vector", - "C1_SYMBOL_CATALOG": "vector", - "C0_SOURCE_CHUNKS": "vector" - }, - "top_k_by_layer": { - "C4_SEMANTIC_ROLES": 12, - "C3_ENTRYPOINTS": 8, - "C2_DEPENDENCY_GRAPH": 8, - "C1_SYMBOL_CATALOG": 6, - "C0_SOURCE_CHUNKS": 4 - }, - "filters_by_layer": { - "C4_SEMANTIC_ROLES": { - "path_scope": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [] - }, - "C1_SYMBOL_CATALOG": { - "path_scope": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [] - } - }, - "fallback": { - "used": false, - "reason": null - }, - "retrieval_by_layer_ms": { - "C4_SEMANTIC_ROLES": 57, - "C3_ENTRYPOINTS": 14, - "C2_DEPENDENCY_GRAPH": 61, - "C1_SYMBOL_CATALOG": 25, - "C0_SOURCE_CHUNKS": 17 - } - } - }, - { - "step": "pre_evidence_gate", - "status": "passed", - "timings_ms": { - "pre_evidence_gate": 1 - }, - "input": { - "resolved_target": "ControlPlaneService", - "sub_intent": "ARCHITECTURE", - "target_type": "symbol", - "evidence_count": 33, - "code_chunk_count": 33, - "entrypoint_count": 3, - "relation_count": 8, - "test_evidence_count": 0, - "symbol_resolution_status": "resolved", - "path_scope": [] - }, - "output": { - "passed": true, - "failure_reasons": [], - "degraded_message": "", - "evidence_count": 33 - } - }, - { - "step": "llm", - "status": "completed", - "timings_ms": { - "llm": 6818 - }, - "output": { - "prompt_name": "code_qa_architecture_answer", - "answer_preview": "Компоненты, участвующие в ControlPlaneService:\n\n- **ControlActionSet** – модель для управления действиями.\n- **ControlChannel** – абстрактный базовый класс каналов контроля с методами start и stop.\n- **UvicornThreadRunner** – этап пайплайна для многопоточного запуска HTTP сервера.\n- **HttpControlCha", - "resolved_target": "ControlPlaneService", - "answer_policy_branch": "normal_answer", - "decision_reason": "evidence_sufficient" - } - }, - { - "step": "post_evidence_gate", - "status": "passed", - "timings_ms": { - "post_evidence_gate": 1, - "post_evidence_gate_recheck": 0, - "repair": 0 - }, - "input": { - "answer_mode": "normal", - "degraded_message": "", - "resolved_target": "ControlPlaneService", - "draft_answer_preview": "Компоненты, участвующие в ControlPlaneService:\n\n- **ControlActionSet** – модель для управления действиями.\n- **ControlChannel** – абстрактный базовый класс каналов контроля с методами start и stop.\n- **UvicornThreadRunner** – этап пайплайна для многопоточного запуска HTTP сервера.\n- **HttpControlCha", - "repair_candidate": true - }, - "output": { - "passed": true, - "action": "return", - "reasons": [], - "repair_used": false, - "final_answer_preview": "Компоненты, участвующие в ControlPlaneService:\n\n- **ControlActionSet** – модель для управления действиями.\n- **ControlChannel** – абстрактный базовый класс каналов контроля с методами start и stop.\n- **UvicornThreadRunner** – этап пайплайна для многопоточного запуска HTTP сервера.\n- **HttpControlCha" - } - } -] - -## Diagnostics -{ - "intent_correct": null, - "target_found": true, - "layers_used": [ - "C4_SEMANTIC_ROLES", - "C3_ENTRYPOINTS", - "C2_DEPENDENCY_GRAPH", - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS" - ], - "retrieval_sufficient": true, - "answer_mode": "normal", - "resolved_target": "ControlPlaneService", - "answer_policy_branch": "normal_answer", - "decision_reason": "evidence_sufficient", - "router_result": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "retrieval_profile": "code", - "sub_intent": "ARCHITECTURE", - "path_scope": [], - "layers": [ - "C4_SEMANTIC_ROLES", - "C3_ENTRYPOINTS", - "C2_DEPENDENCY_GRAPH", - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS" - ], - "symbol_resolution_status": "resolved" - }, - "retrieval_request": { - "rag_session_id": "7d11da21-faa0-4cea-aede-aeabe069164c", - "query": "Какие компоненты участвуют в ControlPlaneService?", - "sub_intent": "ARCHITECTURE", - "path_scope": [], - "requested_layers": [ - "C4_SEMANTIC_ROLES", - "C3_ENTRYPOINTS", - "C2_DEPENDENCY_GRAPH", - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS" - ] - }, - "per_layer_outcome": [ - { - "layer_id": "C4_SEMANTIC_ROLES", - "hit_count": 12, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C3_ENTRYPOINTS", - "hit_count": 3, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C2_DEPENDENCY_GRAPH", - "hit_count": 8, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C1_SYMBOL_CATALOG", - "hit_count": 6, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C0_SOURCE_CHUNKS", - "hit_count": 4, - "empty": false, - "fallback_used": false - } - ], - "empty_layers": [], - "evidence_gate_decision": { - "sufficient": true, - "failure_reasons": [], - "evidence_count": 33 - }, - "evidence_gate_input": { - "resolved_target": "ControlPlaneService", - "sub_intent": "ARCHITECTURE", - "target_type": "symbol", - "evidence_count": 33, - "code_chunk_count": 33, - "entrypoint_count": 3, - "relation_count": 8, - "test_evidence_count": 0, - "symbol_resolution_status": "resolved", - "path_scope": [] - }, - "post_evidence_gate": { - "input": { - "answer_mode": "normal", - "degraded_message": "", - "resolved_target": "ControlPlaneService", - "draft_answer_preview": "Компоненты, участвующие в ControlPlaneService:\n\n- **ControlActionSet** – модель для управления действиями.\n- **ControlChannel** – абстрактный базовый класс каналов контроля с методами start и stop.\n- **UvicornThreadRunner** – этап пайплайна для многопоточного запуска HTTP сервера.\n- **HttpControlCha", - "repair_candidate": true - }, - "output": { - "passed": true, - "action": "return", - "reasons": [], - "repair_used": false, - "final_answer_preview": "Компоненты, участвующие в ControlPlaneService:\n\n- **ControlActionSet** – модель для управления действиями.\n- **ControlChannel** – абстрактный базовый класс каналов контроля с методами start и stop.\n- **UvicornThreadRunner** – этап пайплайна для многопоточного запуска HTTP сервера.\n- **HttpControlCha" - } - }, - "failure_reasons": [], - "timings_ms": { - "router": 1, - "retrieval": 177, - "pre_evidence_gate": 1, - "llm": 6818, - "post_evidence_gate": 1 - } -} - -## Mismatches -- none \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/plba_full_chain_subintents_v3/20260312_174008/full_chain_plba_code_subintents_v2_plba-v2-architecture-runtime-manager.json b/tests/pipeline_setup_v3/test_results/plba_full_chain_subintents_v3/20260312_174008/full_chain_plba_code_subintents_v2_plba-v2-architecture-runtime-manager.json deleted file mode 100644 index 5bafbcb..0000000 --- a/tests/pipeline_setup_v3/test_results/plba_full_chain_subintents_v3/20260312_174008/full_chain_plba_code_subintents_v2_plba-v2-architecture-runtime-manager.json +++ /dev/null @@ -1,4573 +0,0 @@ -{ - "case_id": "plba-v2-architecture-runtime-manager", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_02_pipeline/full_chain_plba_code_subintents_v2.yaml", - "runner": "agent_runtime", - "mode": "full_chain", - "query": "Какие компоненты участвуют в RuntimeManager?", - "actual": { - "intent": "CODE_QA", - "sub_intent": "ARCHITECTURE", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 33, - "llm_answer": "Компоненты, участвующие в RuntimeManager:\n\n1. **ControlPlaneService** \n - Регистрирует каналы управления (_register_channel_), запускается асинхронно (_start_async), останавливается (_stop_, _stop_async_). \n - Файлы: `service.py` (строки 14–52).\n\n2. **HttpControlAppFactory** \n - Фабрика для создания HTTP-приложений контроля. \n - Файл: `http_app.py` (строки 15–53).\n\n3. **UvicornThreadRunner** \n - Выполняет работу в потоке Uvicorn. \n - Файл: `http_runner.py` (строки 10–61).\n\n4. **HttpControlChannel** \n - Канал HTTP-контроля. \n - Файл: `http_channel.py` (строки 12–57).\n\n5. **WorkflowPersistence** \n - Сохраняет состояние рабочих процессов. \n - Файл: `workflow_persistence.py` (строки 8–54).\n\n6. **InMemoryTaskQueue** \n - Очередь задач в памяти. \n - Файл: `in_memory.py` (строки 9–38).\n\n7. **ConfigFileLoader** \n - Загружает конфигурационные файлы. \n - Файл: `file_loader.py` (строки 11–48).\n\n8. **TraceContextStore** \n - Хранит контекст трассировки. \n - Файл: `store.py` (строки 15–52).\n\n9. **WorkerSupervisor** \n - Наблюдатель за рабочими процессами. \n - Файл: `supervisor.py` (строки 10–59).\n\nСвязи внутри конструктора RuntimeManager включают инициализацию конфигурации, регистрацию сервисов и добавление конфигурационных файлов. \nФайл: `runtime.py`, строки 32–127.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "RuntimeManager" - ], - "layers": [ - "C4_SEMANTIC_ROLES", - "C3_ENTRYPOINTS", - "C2_DEPENDENCY_GRAPH", - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS" - ] - }, - "passed": true, - "mismatches": [], - "details": { - "query": "Какие компоненты участвуют в RuntimeManager?", - "router_result": { - "schema_version": "1.1", - "intent": "CODE_QA", - "retrieval_profile": "code", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query_plan": { - "raw": "Какие компоненты участвуют в RuntimeManager?", - "normalized": "Какие компоненты участвуют в RuntimeManager?", - "sub_intent": "ARCHITECTURE", - "negations": [], - "expansions": [ - "RuntimeManager" - ], - "keyword_hints": [ - "RuntimeManager" - ], - "path_hints": [], - "doc_scope_hints": [], - "symbol_candidates": [ - "RuntimeManager" - ], - "symbol_kind_hint": "class", - "anchors": [ - { - "type": "SYMBOL", - "value": "RuntimeManager", - "source": "user_text", - "subtype": null, - "span": { - "start": 29, - "end": 43 - }, - "confidence": 0.88 - } - ] - }, - "retrieval_spec": { - "domains": [ - "CODE" - ], - "layer_queries": [ - { - "layer_id": "C4_SEMANTIC_ROLES", - "top_k": 12 - }, - { - "layer_id": "C3_ENTRYPOINTS", - "top_k": 8 - }, - { - "layer_id": "C2_DEPENDENCY_GRAPH", - "top_k": 8 - }, - { - "layer_id": "C1_SYMBOL_CATALOG", - "top_k": 6 - }, - { - "layer_id": "C0_SOURCE_CHUNKS", - "top_k": 4 - } - ], - "filters": { - "test_policy": "EXCLUDE", - "path_scope": [], - "language": [ - "python" - ] - }, - "rerank_profile": "code" - }, - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - }, - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "RuntimeManager", - "alternatives": [ - "RuntimeManager", - "RuntimeManager", - "RuntimeManager", - "RuntimeManager", - "RuntimeManager" - ], - "confidence": 0.99 - }, - "evidence_policy": { - "require_def": true, - "require_flow": true, - "require_spec": false, - "allow_answer_without_evidence": false - } - }, - "retrieval_request": { - "rag_session_id": "7d11da21-faa0-4cea-aede-aeabe069164c", - "query": "Какие компоненты участвуют в RuntimeManager?", - "sub_intent": "ARCHITECTURE", - "path_scope": [], - "keyword_hints": [ - "RuntimeManager" - ], - "symbol_candidates": [ - "RuntimeManager" - ], - "requested_layers": [ - "C4_SEMANTIC_ROLES", - "C3_ENTRYPOINTS", - "C2_DEPENDENCY_GRAPH", - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS" - ], - "retrieval_spec": { - "domains": [ - "CODE" - ], - "layer_queries": [ - { - "layer_id": "C4_SEMANTIC_ROLES", - "top_k": 12 - }, - { - "layer_id": "C3_ENTRYPOINTS", - "top_k": 8 - }, - { - "layer_id": "C2_DEPENDENCY_GRAPH", - "top_k": 8 - }, - { - "layer_id": "C1_SYMBOL_CATALOG", - "top_k": 6 - }, - { - "layer_id": "C0_SOURCE_CHUNKS", - "top_k": 4 - } - ], - "filters": { - "test_policy": "EXCLUDE", - "path_scope": [], - "language": [ - "python" - ] - }, - "rerank_profile": "code" - }, - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - }, - "query_plan": { - "raw": "Какие компоненты участвуют в RuntimeManager?", - "normalized": "Какие компоненты участвуют в RuntimeManager?", - "sub_intent": "ARCHITECTURE", - "negations": [], - "expansions": [ - "RuntimeManager" - ], - "keyword_hints": [ - "RuntimeManager" - ], - "path_hints": [], - "doc_scope_hints": [], - "symbol_candidates": [ - "RuntimeManager" - ], - "symbol_kind_hint": "class", - "anchors": [ - { - "type": "SYMBOL", - "value": "RuntimeManager", - "source": "user_text", - "subtype": null, - "span": { - "start": 29, - "end": 43 - }, - "confidence": 0.88 - } - ] - } - }, - "retrieval_result": { - "target_symbol_candidates": [ - "RuntimeManager", - "ControlChannel" - ], - "resolved_symbol": "RuntimeManager", - "symbol_resolution_status": "resolved", - "file_candidates": [ - "src/app_runtime/core/runtime.py", - "src/app_runtime/control/base.py", - "src/app_runtime/control/service.py", - "src/app_runtime/control/http_runner.py", - "src/app_runtime/control/http_channel.py", - "src/app_runtime/control/http_app.py", - "src/app_runtime/workflow/persistence/workflow_persistence.py", - "src/app_runtime/queue/in_memory.py", - "src/app_runtime/config/file_loader.py", - "src/app_runtime/tracing/store.py", - "src/app_runtime/workers/supervisor.py", - "src/plba/__init__.py", - "src/plba/core.py", - "src/plba/bootstrap.py", - "src/app_runtime/control/__init__.py" - ], - "code_chunks": [ - { - "layer": "C4_SEMANTIC_ROLES", - "path": "src/app_runtime/core/runtime.py", - "title": "RuntimeManager", - "content": "RuntimeManager\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests manager\n- orchestrates role-like calls (4)\n- reads and writes state attributes\n- participates in dataflow slices (50)", - "start_line": 18, - "end_line": 179, - "metadata": { - "symbol_id": "7e4a9381328c5803bbc6179458612fc4e947d928aa7bf8b4b2bebb2c8592f758", - "symbol_name": "RuntimeManager", - "qname": "RuntimeManager", - "role": "pipeline_stage", - "confidence": 0.67, - "dataflow_participation": 50, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C4_SEMANTIC_ROLES", - "path": "src/app_runtime/control/base.py", - "title": "ControlActionSet", - "content": "ControlActionSet\nrole: model\n\nResponsibilities:\n- default model role", - "start_line": 14, - "end_line": 18, - "metadata": { - "symbol_id": "46eb026cb3313415ec47b82dd22f84f4d112c9d987e8b1716dcb0baa1cce8988", - "symbol_name": "ControlActionSet", - "qname": "ControlActionSet", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C4_SEMANTIC_ROLES", - "path": "src/app_runtime/control/base.py", - "title": "ControlChannel", - "content": "ControlChannel\nrole: model\n\nResponsibilities:\n- default model role", - "start_line": 21, - "end_line": 28, - "metadata": { - "symbol_id": "cfcfe9a311d3a2dbdaf32ac4ccd73c0eb9a117f830591a1c0867ee97d46204ff", - "symbol_name": "ControlChannel", - "qname": "ControlChannel", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C4_SEMANTIC_ROLES", - "path": "src/app_runtime/control/service.py", - "title": "ControlPlaneService", - "content": "ControlPlaneService\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests service\n- reads and writes state attributes\n- participates in dataflow slices (5)", - "start_line": 12, - "end_line": 52, - "metadata": { - "symbol_id": "b13471e5916986dccffb53fab613812842965705e6b3a89ae549d30c9e91e9aa", - "symbol_name": "ControlPlaneService", - "qname": "ControlPlaneService", - "role": "pipeline_stage", - "confidence": 0.57, - "dataflow_participation": 5, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C4_SEMANTIC_ROLES", - "path": "src/app_runtime/control/http_runner.py", - "title": "UvicornThreadRunner", - "content": "UvicornThreadRunner\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (24)", - "start_line": 10, - "end_line": 61, - "metadata": { - "symbol_id": "fd55630045a02100df8877ac27d951ee08617d4598764394d48cb51fe067476a", - "symbol_name": "UvicornThreadRunner", - "qname": "UvicornThreadRunner", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 24, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "3779fdd2878b770e789a35bb2a89c9d79f13b61c26d7db1b3b683f9bb9e1623f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C4_SEMANTIC_ROLES", - "path": "src/app_runtime/control/http_channel.py", - "title": "HttpControlChannel", - "content": "HttpControlChannel\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (10)", - "start_line": 12, - "end_line": 57, - "metadata": { - "symbol_id": "1c9fbdc24819e5604c26ea55428a74310f03a03e1af197ed84846af61e42fdb0", - "symbol_name": "HttpControlChannel", - "qname": "HttpControlChannel", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 10, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C4_SEMANTIC_ROLES", - "path": "src/app_runtime/control/http_app.py", - "title": "HttpControlAppFactory", - "content": "HttpControlAppFactory\nrole: factory\n\nResponsibilities:\n- name suffix suggests factory", - "start_line": 15, - "end_line": 53, - "metadata": { - "symbol_id": "9b3502a5fb408b273223db13264349cf500de24915b6c649d9ea8970d0dfd8e0", - "symbol_name": "HttpControlAppFactory", - "qname": "HttpControlAppFactory", - "role": "factory", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C4_SEMANTIC_ROLES", - "path": "src/app_runtime/workflow/persistence/workflow_persistence.py", - "title": "WorkflowPersistence", - "content": "WorkflowPersistence\nrole: pipeline_stage\n\nResponsibilities:\n- orchestrates role-like calls (2)\n- reads and writes state attributes\n- participates in dataflow slices (16)", - "start_line": 8, - "end_line": 54, - "metadata": { - "symbol_id": "7bd01ee45cf31f2d5c2e3e51656254860ac785d10cef9e0852cd4fba90857bae", - "symbol_name": "WorkflowPersistence", - "qname": "WorkflowPersistence", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 16, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "80e9410ddc639789b4353c2a1a757ba8d0d5b5bb6075b0b263b61551f04ae1f0", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C4_SEMANTIC_ROLES", - "path": "src/app_runtime/queue/in_memory.py", - "title": "InMemoryTaskQueue", - "content": "InMemoryTaskQueue\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (9)", - "start_line": 9, - "end_line": 38, - "metadata": { - "symbol_id": "2da04cb94544a3bcbf0943a95ad4bdd8710bcafaa32a02fd0e4de2178dcf3533", - "symbol_name": "InMemoryTaskQueue", - "qname": "InMemoryTaskQueue", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 9, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "58f0cc001ccda0eee4c6bc32ed83bd05eafd6b6644f1e8b4aa9eed3103db73dc", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C4_SEMANTIC_ROLES", - "path": "src/app_runtime/config/file_loader.py", - "title": "ConfigFileLoader", - "content": "ConfigFileLoader\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (8)", - "start_line": 11, - "end_line": 48, - "metadata": { - "symbol_id": "a8474eca8b6e9dc86ae67ed68b16fa5fb639ef08739c053e7b7195489765667f", - "symbol_name": "ConfigFileLoader", - "qname": "ConfigFileLoader", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 8, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "1f19ffebde5e38e4be5a5d5a678059a0f36dedb8fb8b3e00ab395c67106a87ea", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C4_SEMANTIC_ROLES", - "path": "src/app_runtime/tracing/store.py", - "title": "TraceContextStore", - "content": "TraceContextStore\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (6)", - "start_line": 15, - "end_line": 52, - "metadata": { - "symbol_id": "b2dad4fbe16ffb11b58deba311c7739955c39d59f291b22181f33e9c8cce4059", - "symbol_name": "TraceContextStore", - "qname": "TraceContextStore", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 6, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "d369554f08fc92039c6edd5a2a1e73b23901533e8974459170bbd9347d263dc5", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C4_SEMANTIC_ROLES", - "path": "src/app_runtime/workers/supervisor.py", - "title": "WorkerSupervisor", - "content": "WorkerSupervisor\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (6)", - "start_line": 10, - "end_line": 59, - "metadata": { - "symbol_id": "c17b44e8d9e97d490989b21fa67d7c346cdda8a0472e4c41fb243c8846faa124", - "symbol_name": "WorkerSupervisor", - "qname": "WorkerSupervisor", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 6, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "77609d9d5927171cce7fc3a54897c183fd63068710c6362029b700937aae5eee", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C3_ENTRYPOINTS", - "path": "src/app_runtime/control/http_app.py", - "title": "app.post", - "content": "fastapi http app.post", - "start_line": 38, - "end_line": 42, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C3_ENTRYPOINTS", - "path": "src/app_runtime/control/http_app.py", - "title": "app.get", - "content": "fastapi http app.get", - "start_line": 31, - "end_line": 34, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C3_ENTRYPOINTS", - "path": "src/app_runtime/control/http_app.py", - "title": "app.get", - "content": "fastapi http app.get", - "start_line": 38, - "end_line": 42, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "path": "src/app_runtime/control/service.py", - "title": "ControlPlaneService.__init__:dataflow_slice", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._start_async", - "start_line": 14, - "end_line": 47, - "metadata": { - "edge_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517", - "dst_ref": "ControlPlaneService._start_async", - "resolution": "resolved", - "slice_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._start_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "path": "src/app_runtime/core/runtime.py", - "title": "RuntimeManager.__init__:dataflow_slice", - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager.start", - "start_line": 32, - "end_line": 59, - "metadata": { - "edge_id": "98312ace7fc62b1c7194c5aa1732b6ef736eae1668a3a120dd1ecd5ab1d64f7a", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "77a7b260193018845e4e204df094ab89cfd7c82ee4e822b3a83ad4cd945f9cb1", - "dst_ref": "RuntimeManager.start", - "resolution": "resolved", - "slice_id": "98312ace7fc62b1c7194c5aa1732b6ef736eae1668a3a120dd1ecd5ab1d64f7a", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager.start" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "77a7b260193018845e4e204df094ab89cfd7c82ee4e822b3a83ad4cd945f9cb1" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "path": "src/app_runtime/control/service.py", - "title": "ControlPlaneService.__init__:dataflow_slice", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.start", - "start_line": 14, - "end_line": 20, - "metadata": { - "edge_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154", - "dst_ref": "ControlPlaneService.start", - "resolution": "resolved", - "slice_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.start" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "path": "src/app_runtime/control/service.py", - "title": "ControlPlaneService.__init__:dataflow_slice", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.stop", - "start_line": 14, - "end_line": 25, - "metadata": { - "edge_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d", - "dst_ref": "ControlPlaneService.stop", - "resolution": "resolved", - "slice_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.stop" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "path": "src/app_runtime/control/service.py", - "title": "ControlPlaneService.__init__:dataflow_slice", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._stop_async", - "start_line": 14, - "end_line": 51, - "metadata": { - "edge_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a", - "dst_ref": "ControlPlaneService._stop_async", - "resolution": "resolved", - "slice_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._stop_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "path": "src/app_runtime/core/runtime.py", - "title": "RuntimeManager.__init__:dataflow_slice", - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager.add_config_file", - "start_line": 32, - "end_line": 52, - "metadata": { - "edge_id": "a23b8a11ebdb12708b60c96ea12a69f7f042082f1adfddd572444e246d81d167", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "57ffbd4f0d9fdf3507c2b8624312ce211f3d02fdf86a57a8ec90778d8a7b498d", - "dst_ref": "RuntimeManager.add_config_file", - "resolution": "resolved", - "slice_id": "a23b8a11ebdb12708b60c96ea12a69f7f042082f1adfddd572444e246d81d167", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager.add_config_file" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "57ffbd4f0d9fdf3507c2b8624312ce211f3d02fdf86a57a8ec90778d8a7b498d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "path": "src/app_runtime/control/service.py", - "title": "ControlPlaneService.__init__:dataflow_slice", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.register_channel", - "start_line": 14, - "end_line": 17, - "metadata": { - "edge_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957", - "dst_ref": "ControlPlaneService.register_channel", - "resolution": "resolved", - "slice_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.register_channel" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "path": "src/app_runtime/core/runtime.py", - "title": "RuntimeManager.__init__:dataflow_slice", - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager._register_core_services", - "start_line": 32, - "end_line": 127, - "metadata": { - "edge_id": "3e5811f3b511fa0cabe363f5d01f2ac5fa039bc8b93f7ee108323e1f5f45a293", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "972d6057a6caac9cf31ebc1e29c6f39f71b10d4cc170dec57cf875ba458549c6", - "dst_ref": "RuntimeManager._register_core_services", - "resolution": "resolved", - "slice_id": "3e5811f3b511fa0cabe363f5d01f2ac5fa039bc8b93f7ee108323e1f5f45a293", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager._register_core_services" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "972d6057a6caac9cf31ebc1e29c6f39f71b10d4cc170dec57cf875ba458549c6" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C1_SYMBOL_CATALOG", - "path": "src/plba/__init__.py", - "title": "RuntimeManager", - "content": "const RuntimeManager\nRuntimeManager = plba.core.RuntimeManager", - "start_line": 16, - "end_line": 16, - "metadata": { - "symbol_id": "7eacec84f9b8d6c4201374591faecdac7493091c263681495c338973f2971ad9", - "qname": "RuntimeManager", - "kind": "const", - "signature": "RuntimeManager = plba.core.RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "src.plba.__init__", - "is_test": false, - "blob_sha": "24e755ec8c249d14fb0e675b5dbf2b71ab91afb9c849897eebfa9feb2499e19d", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C1_SYMBOL_CATALOG", - "path": "src/plba/core.py", - "title": "RuntimeManager", - "content": "const RuntimeManager\nRuntimeManager = app_runtime.core.runtime.RuntimeManager", - "start_line": 2, - "end_line": 2, - "metadata": { - "symbol_id": "e1684562d978b7af7fe9b27dc5869d770348a87b5dc19a50360f58544668578b", - "qname": "RuntimeManager", - "kind": "const", - "signature": "RuntimeManager = app_runtime.core.runtime.RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "src.plba.core", - "is_test": false, - "blob_sha": "c0ae25110d20e665216616e26b68adfe035b624ba45d31d1272fb21f906f9ca8", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C1_SYMBOL_CATALOG", - "path": "src/app_runtime/control/service.py", - "title": "RuntimeManager", - "content": "const RuntimeManager\nRuntimeManager = app_runtime.core.runtime.RuntimeManager", - "start_line": 9, - "end_line": 9, - "metadata": { - "symbol_id": "62a9575c77aad894120d18b4f2a08cf2ba42f77e9be4a8a432b767d157701afe", - "qname": "RuntimeManager", - "kind": "const", - "signature": "RuntimeManager = app_runtime.core.runtime.RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.control.service", - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C1_SYMBOL_CATALOG", - "path": "src/app_runtime/core/runtime.py", - "title": "RuntimeManager", - "content": "class RuntimeManager\nRuntimeManager", - "start_line": 18, - "end_line": 179, - "metadata": { - "symbol_id": "7e4a9381328c5803bbc6179458612fc4e947d928aa7bf8b4b2bebb2c8592f758", - "qname": "RuntimeManager", - "kind": "class", - "signature": "RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.core.runtime", - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C1_SYMBOL_CATALOG", - "path": "src/plba/bootstrap.py", - "title": "RuntimeManager", - "content": "const RuntimeManager\nRuntimeManager = app_runtime.core.runtime.RuntimeManager", - "start_line": 4, - "end_line": 4, - "metadata": { - "symbol_id": "27158ca220022eeb5083c6addf8a50775d45f7161284fd60aac48410105f4b98", - "qname": "RuntimeManager", - "kind": "const", - "signature": "RuntimeManager = app_runtime.core.runtime.RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "src.plba.bootstrap", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C1_SYMBOL_CATALOG", - "path": "src/app_runtime/control/__init__.py", - "title": "ControlChannel", - "content": "const ControlChannel\nControlChannel = app_runtime.control.base.ControlChannel", - "start_line": 1, - "end_line": 1, - "metadata": { - "symbol_id": "268420f7aa4ed74082b9276cae0cded4f00bac090ffd58fa020a65be0fe19c27", - "qname": "ControlChannel", - "kind": "const", - "signature": "ControlChannel = app_runtime.control.base.ControlChannel", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.control.__init__", - "is_test": false, - "blob_sha": "bf3c37e3369a84cc618adc0fd71c232e5eb4b871eaff743069a17e661e498316", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C0_SOURCE_CHUNKS", - "path": "src/app_runtime/control/base.py", - "title": "src/app_runtime/control/base.py:ControlChannel", - "content": "class ControlChannel(ABC):\n @abstractmethod\n async def start(self, actions: ControlActionSet) -> None:\n \"\"\"Start the control channel and bind handlers.\"\"\"\n\n @abstractmethod\n async def stop(self) -> None:\n \"\"\"Stop the control channel and release resources.\"\"\"", - "start_line": 21, - "end_line": 28, - "metadata": { - "chunk_index": 1, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.base", - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C0_SOURCE_CHUNKS", - "path": "src/app_runtime/control/__init__.py", - "title": "src/app_runtime/control/__init__.py:1-5", - "content": "from app_runtime.control.base import ControlActionSet, ControlChannel\nfrom app_runtime.control.http_channel import HttpControlChannel\nfrom app_runtime.control.service import ControlPlaneService\n\n__all__ = [\"ControlActionSet\", \"ControlChannel\", \"ControlPlaneService\", \"HttpControlChannel\"]", - "start_line": 1, - "end_line": 5, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.app_runtime.control.__init__", - "is_test": false, - "blob_sha": "bf3c37e3369a84cc618adc0fd71c232e5eb4b871eaff743069a17e661e498316", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C0_SOURCE_CHUNKS", - "path": "src/app_runtime/control/base.py", - "title": "src/app_runtime/control/base.py:ControlActionSet", - "content": "class ControlActionSet:\n health: HealthHandler\n start: ActionHandler\n stop: ActionHandler\n status: ActionHandler", - "start_line": 14, - "end_line": 18, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.base", - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C0_SOURCE_CHUNKS", - "path": "src/app_runtime/control/http_app.py", - "title": "src/app_runtime/control/http_app.py:HttpControlAppFactory", - "content": "class HttpControlAppFactory:\n def create(\n self,\n health_provider: Callable[[], Awaitable[HealthPayload]],\n action_provider: Callable[[str, str], Awaitable[JSONResponse]],\n ) -> FastAPI:\n app = FastAPI(title=\"PLBA Control API\")\n\n @app.middleware(\"http\")\n async def log_api_call(request: Request, call_next): # type: ignore[no-untyped-def]\n started = time.monotonic()\n response = await call_next(request)\n response.headers[\"X-Response-Time-Ms\"] = str(int((time.monotonic() - started) * 1000))\n return response\n\n @app.get(\"/health\")\n async def health() -> JSONResponse:\n payload = await health_provider()\n status_code = 200 if payload.get(\"status\") == \"ok\" else 503\n return JSONResponse(content=payload, status_code=status_code)\n\n @app.get(\"/actions/{action}\")\n @app.post(\"/actions/{action}\")\n async def action(action: str, request: Request) -> JSONResponse:\n client_source = self._client_source(request)\n if action in {\"start\", \"stop\"}:\n LOGGER.warning(\"Control action requested: /actions/%s client=%s\", action, client_source)\n return await action_provider(action, client_source)\n\n return app\n\n def _client_source(self, request: Request) -> str:\n explicit_header = request.headers.get(\"X-Client-Source\", \"\").strip()\n if explicit_header:\n return explicit_header\n user_agent = request.headers.get(\"User-Agent\", \"\").strip()\n if user_agent:\n return f\"user-agent:{user_agent}\"\n return \"unknown\"", - "start_line": 15, - "end_line": 53, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.http_app", - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "relations": [ - { - "path": "src/app_runtime/control/service.py", - "metadata": { - "edge_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517", - "dst_ref": "ControlPlaneService._start_async", - "resolution": "resolved", - "slice_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._start_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - }, - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._start_async" - }, - { - "path": "src/app_runtime/core/runtime.py", - "metadata": { - "edge_id": "98312ace7fc62b1c7194c5aa1732b6ef736eae1668a3a120dd1ecd5ab1d64f7a", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "77a7b260193018845e4e204df094ab89cfd7c82ee4e822b3a83ad4cd945f9cb1", - "dst_ref": "RuntimeManager.start", - "resolution": "resolved", - "slice_id": "98312ace7fc62b1c7194c5aa1732b6ef736eae1668a3a120dd1ecd5ab1d64f7a", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager.start" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "77a7b260193018845e4e204df094ab89cfd7c82ee4e822b3a83ad4cd945f9cb1" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - }, - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager.start" - }, - { - "path": "src/app_runtime/control/service.py", - "metadata": { - "edge_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154", - "dst_ref": "ControlPlaneService.start", - "resolution": "resolved", - "slice_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.start" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - }, - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.start" - }, - { - "path": "src/app_runtime/control/service.py", - "metadata": { - "edge_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d", - "dst_ref": "ControlPlaneService.stop", - "resolution": "resolved", - "slice_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.stop" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - }, - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.stop" - }, - { - "path": "src/app_runtime/control/service.py", - "metadata": { - "edge_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a", - "dst_ref": "ControlPlaneService._stop_async", - "resolution": "resolved", - "slice_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._stop_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - }, - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._stop_async" - }, - { - "path": "src/app_runtime/core/runtime.py", - "metadata": { - "edge_id": "a23b8a11ebdb12708b60c96ea12a69f7f042082f1adfddd572444e246d81d167", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "57ffbd4f0d9fdf3507c2b8624312ce211f3d02fdf86a57a8ec90778d8a7b498d", - "dst_ref": "RuntimeManager.add_config_file", - "resolution": "resolved", - "slice_id": "a23b8a11ebdb12708b60c96ea12a69f7f042082f1adfddd572444e246d81d167", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager.add_config_file" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "57ffbd4f0d9fdf3507c2b8624312ce211f3d02fdf86a57a8ec90778d8a7b498d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - }, - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager.add_config_file" - }, - { - "path": "src/app_runtime/control/service.py", - "metadata": { - "edge_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957", - "dst_ref": "ControlPlaneService.register_channel", - "resolution": "resolved", - "slice_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.register_channel" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - }, - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.register_channel" - }, - { - "path": "src/app_runtime/core/runtime.py", - "metadata": { - "edge_id": "3e5811f3b511fa0cabe363f5d01f2ac5fa039bc8b93f7ee108323e1f5f45a293", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "972d6057a6caac9cf31ebc1e29c6f39f71b10d4cc170dec57cf875ba458549c6", - "dst_ref": "RuntimeManager._register_core_services", - "resolution": "resolved", - "slice_id": "3e5811f3b511fa0cabe363f5d01f2ac5fa039bc8b93f7ee108323e1f5f45a293", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager._register_core_services" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "972d6057a6caac9cf31ebc1e29c6f39f71b10d4cc170dec57cf875ba458549c6" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - }, - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager._register_core_services" - } - ], - "entrypoints": [ - { - "path": "src/app_runtime/control/http_app.py", - "title": "app.get", - "start_line": 31, - "end_line": 34, - "http_method": "GET", - "route_path": "/health", - "handler_symbol": "health", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "route_or_command": "app.get", - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "title": "app.get", - "start_line": 38, - "end_line": 42, - "http_method": "GET", - "route_path": "/actions/{action}", - "handler_symbol": "action", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "route_or_command": "app.get", - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "title": "app.post", - "start_line": 38, - "end_line": 42, - "http_method": "POST", - "route_path": "/actions/{action}", - "handler_symbol": "action", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "route_or_command": "app.post", - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "test_candidates": [], - "layer_outcomes": [ - { - "layer_id": "C4_SEMANTIC_ROLES", - "hit_count": 12, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C3_ENTRYPOINTS", - "hit_count": 3, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C2_DEPENDENCY_GRAPH", - "hit_count": 8, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C1_SYMBOL_CATALOG", - "hit_count": 6, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C0_SOURCE_CHUNKS", - "hit_count": 4, - "empty": false, - "fallback_used": false - } - ], - "missing_layers": [], - "raw_rows": [ - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests manager\n- orchestrates role-like calls (4)\n- reads and writes state attributes\n- participates in dataflow slices (50)", - "layer": "C4_SEMANTIC_ROLES", - "title": "RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 43, - "layer_rank": 2, - "distance": null, - "metadata": { - "symbol_id": "7e4a9381328c5803bbc6179458612fc4e947d928aa7bf8b4b2bebb2c8592f758", - "symbol_name": "RuntimeManager", - "qname": "RuntimeManager", - "role": "pipeline_stage", - "confidence": 0.67, - "dataflow_participation": 50, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "ControlActionSet\nrole: model\n\nResponsibilities:\n- default model role", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlActionSet", - "span_start": 14, - "span_end": 18, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 40, - "layer_rank": 2, - "distance": null, - "metadata": { - "symbol_id": "46eb026cb3313415ec47b82dd22f84f4d112c9d987e8b1716dcb0baa1cce8988", - "symbol_name": "ControlActionSet", - "qname": "ControlActionSet", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "ControlChannel\nrole: model\n\nResponsibilities:\n- default model role", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlChannel", - "span_start": 21, - "span_end": 28, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 40, - "layer_rank": 2, - "distance": null, - "metadata": { - "symbol_id": "cfcfe9a311d3a2dbdaf32ac4ccd73c0eb9a117f830591a1c0867ee97d46204ff", - "symbol_name": "ControlChannel", - "qname": "ControlChannel", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests service\n- reads and writes state attributes\n- participates in dataflow slices (5)", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlPlaneService", - "span_start": 12, - "span_end": 52, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 68, - "layer_rank": 2, - "distance": null, - "metadata": { - "symbol_id": "b13471e5916986dccffb53fab613812842965705e6b3a89ae549d30c9e91e9aa", - "symbol_name": "ControlPlaneService", - "qname": "ControlPlaneService", - "role": "pipeline_stage", - "confidence": 0.57, - "dataflow_participation": 5, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_runner.py", - "content": "UvicornThreadRunner\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (24)", - "layer": "C4_SEMANTIC_ROLES", - "title": "UvicornThreadRunner", - "span_start": 10, - "span_end": 61, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 11, - "layer_rank": 2, - "distance": null, - "metadata": { - "symbol_id": "fd55630045a02100df8877ac27d951ee08617d4598764394d48cb51fe067476a", - "symbol_name": "UvicornThreadRunner", - "qname": "UvicornThreadRunner", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 24, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "3779fdd2878b770e789a35bb2a89c9d79f13b61c26d7db1b3b683f9bb9e1623f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (10)", - "layer": "C4_SEMANTIC_ROLES", - "title": "HttpControlChannel", - "span_start": 12, - "span_end": 57, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 21, - "layer_rank": 2, - "distance": null, - "metadata": { - "symbol_id": "1c9fbdc24819e5604c26ea55428a74310f03a03e1af197ed84846af61e42fdb0", - "symbol_name": "HttpControlChannel", - "qname": "HttpControlChannel", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 10, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "HttpControlAppFactory\nrole: factory\n\nResponsibilities:\n- name suffix suggests factory", - "layer": "C4_SEMANTIC_ROLES", - "title": "HttpControlAppFactory", - "span_start": 15, - "span_end": 53, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 39, - "layer_rank": 2, - "distance": null, - "metadata": { - "symbol_id": "9b3502a5fb408b273223db13264349cf500de24915b6c649d9ea8970d0dfd8e0", - "symbol_name": "HttpControlAppFactory", - "qname": "HttpControlAppFactory", - "role": "factory", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/persistence/workflow_persistence.py", - "content": "WorkflowPersistence\nrole: pipeline_stage\n\nResponsibilities:\n- orchestrates role-like calls (2)\n- reads and writes state attributes\n- participates in dataflow slices (16)", - "layer": "C4_SEMANTIC_ROLES", - "title": "WorkflowPersistence", - "span_start": 8, - "span_end": 54, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 15, - "layer_rank": 2, - "distance": null, - "metadata": { - "symbol_id": "7bd01ee45cf31f2d5c2e3e51656254860ac785d10cef9e0852cd4fba90857bae", - "symbol_name": "WorkflowPersistence", - "qname": "WorkflowPersistence", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 16, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "80e9410ddc639789b4353c2a1a757ba8d0d5b5bb6075b0b263b61551f04ae1f0", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/queue/in_memory.py", - "content": "InMemoryTaskQueue\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (9)", - "layer": "C4_SEMANTIC_ROLES", - "title": "InMemoryTaskQueue", - "span_start": 9, - "span_end": 38, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 22, - "layer_rank": 2, - "distance": null, - "metadata": { - "symbol_id": "2da04cb94544a3bcbf0943a95ad4bdd8710bcafaa32a02fd0e4de2178dcf3533", - "symbol_name": "InMemoryTaskQueue", - "qname": "InMemoryTaskQueue", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 9, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "58f0cc001ccda0eee4c6bc32ed83bd05eafd6b6644f1e8b4aa9eed3103db73dc", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/config/file_loader.py", - "content": "ConfigFileLoader\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (8)", - "layer": "C4_SEMANTIC_ROLES", - "title": "ConfigFileLoader", - "span_start": 11, - "span_end": 48, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 23, - "layer_rank": 2, - "distance": null, - "metadata": { - "symbol_id": "a8474eca8b6e9dc86ae67ed68b16fa5fb639ef08739c053e7b7195489765667f", - "symbol_name": "ConfigFileLoader", - "qname": "ConfigFileLoader", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 8, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "1f19ffebde5e38e4be5a5d5a678059a0f36dedb8fb8b3e00ab395c67106a87ea", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/store.py", - "content": "TraceContextStore\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (6)", - "layer": "C4_SEMANTIC_ROLES", - "title": "TraceContextStore", - "span_start": 15, - "span_end": 52, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 25, - "layer_rank": 2, - "distance": null, - "metadata": { - "symbol_id": "b2dad4fbe16ffb11b58deba311c7739955c39d59f291b22181f33e9c8cce4059", - "symbol_name": "TraceContextStore", - "qname": "TraceContextStore", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 6, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "d369554f08fc92039c6edd5a2a1e73b23901533e8974459170bbd9347d263dc5", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workers/supervisor.py", - "content": "WorkerSupervisor\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (6)", - "layer": "C4_SEMANTIC_ROLES", - "title": "WorkerSupervisor", - "span_start": 10, - "span_end": 59, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 25, - "layer_rank": 2, - "distance": null, - "metadata": { - "symbol_id": "c17b44e8d9e97d490989b21fa67d7c346cdda8a0472e4c41fb243c8846faa124", - "symbol_name": "WorkerSupervisor", - "qname": "WorkerSupervisor", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 6, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "77609d9d5927171cce7fc3a54897c183fd63068710c6362029b700937aae5eee", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": null, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": null, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": null, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._start_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 47, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": null, - "metadata": { - "edge_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517", - "dst_ref": "ControlPlaneService._start_async", - "resolution": "resolved", - "slice_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._start_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager.start", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 32, - "span_end": 59, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": null, - "metadata": { - "edge_id": "98312ace7fc62b1c7194c5aa1732b6ef736eae1668a3a120dd1ecd5ab1d64f7a", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "77a7b260193018845e4e204df094ab89cfd7c82ee4e822b3a83ad4cd945f9cb1", - "dst_ref": "RuntimeManager.start", - "resolution": "resolved", - "slice_id": "98312ace7fc62b1c7194c5aa1732b6ef736eae1668a3a120dd1ecd5ab1d64f7a", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager.start" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "77a7b260193018845e4e204df094ab89cfd7c82ee4e822b3a83ad4cd945f9cb1" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.start", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 20, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": null, - "metadata": { - "edge_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154", - "dst_ref": "ControlPlaneService.start", - "resolution": "resolved", - "slice_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.start" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.stop", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 25, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": null, - "metadata": { - "edge_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d", - "dst_ref": "ControlPlaneService.stop", - "resolution": "resolved", - "slice_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.stop" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._stop_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 51, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": null, - "metadata": { - "edge_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a", - "dst_ref": "ControlPlaneService._stop_async", - "resolution": "resolved", - "slice_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._stop_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager.add_config_file", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 32, - "span_end": 52, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": null, - "metadata": { - "edge_id": "a23b8a11ebdb12708b60c96ea12a69f7f042082f1adfddd572444e246d81d167", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "57ffbd4f0d9fdf3507c2b8624312ce211f3d02fdf86a57a8ec90778d8a7b498d", - "dst_ref": "RuntimeManager.add_config_file", - "resolution": "resolved", - "slice_id": "a23b8a11ebdb12708b60c96ea12a69f7f042082f1adfddd572444e246d81d167", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager.add_config_file" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "57ffbd4f0d9fdf3507c2b8624312ce211f3d02fdf86a57a8ec90778d8a7b498d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.register_channel", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 17, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": null, - "metadata": { - "edge_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957", - "dst_ref": "ControlPlaneService.register_channel", - "resolution": "resolved", - "slice_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.register_channel" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager._register_core_services", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 32, - "span_end": 127, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": null, - "metadata": { - "edge_id": "3e5811f3b511fa0cabe363f5d01f2ac5fa039bc8b93f7ee108323e1f5f45a293", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "972d6057a6caac9cf31ebc1e29c6f39f71b10d4cc170dec57cf875ba458549c6", - "dst_ref": "RuntimeManager._register_core_services", - "resolution": "resolved", - "slice_id": "3e5811f3b511fa0cabe363f5d01f2ac5fa039bc8b93f7ee108323e1f5f45a293", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager._register_core_services" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "972d6057a6caac9cf31ebc1e29c6f39f71b10d4cc170dec57cf875ba458549c6" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/__init__.py", - "content": "const RuntimeManager\nRuntimeManager = plba.core.RuntimeManager", - "layer": "C1_SYMBOL_CATALOG", - "title": "RuntimeManager", - "span_start": 16, - "span_end": 16, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": null, - "metadata": { - "symbol_id": "7eacec84f9b8d6c4201374591faecdac7493091c263681495c338973f2971ad9", - "qname": "RuntimeManager", - "kind": "const", - "signature": "RuntimeManager = plba.core.RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "src.plba.__init__", - "is_test": false, - "blob_sha": "24e755ec8c249d14fb0e675b5dbf2b71ab91afb9c849897eebfa9feb2499e19d", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/core.py", - "content": "const RuntimeManager\nRuntimeManager = app_runtime.core.runtime.RuntimeManager", - "layer": "C1_SYMBOL_CATALOG", - "title": "RuntimeManager", - "span_start": 2, - "span_end": 2, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": null, - "metadata": { - "symbol_id": "e1684562d978b7af7fe9b27dc5869d770348a87b5dc19a50360f58544668578b", - "qname": "RuntimeManager", - "kind": "const", - "signature": "RuntimeManager = app_runtime.core.runtime.RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "src.plba.core", - "is_test": false, - "blob_sha": "c0ae25110d20e665216616e26b68adfe035b624ba45d31d1272fb21f906f9ca8", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "const RuntimeManager\nRuntimeManager = app_runtime.core.runtime.RuntimeManager", - "layer": "C1_SYMBOL_CATALOG", - "title": "RuntimeManager", - "span_start": 9, - "span_end": 9, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": null, - "metadata": { - "symbol_id": "62a9575c77aad894120d18b4f2a08cf2ba42f77e9be4a8a432b767d157701afe", - "qname": "RuntimeManager", - "kind": "const", - "signature": "RuntimeManager = app_runtime.core.runtime.RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.control.service", - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "class RuntimeManager\nRuntimeManager", - "layer": "C1_SYMBOL_CATALOG", - "title": "RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": null, - "metadata": { - "symbol_id": "7e4a9381328c5803bbc6179458612fc4e947d928aa7bf8b4b2bebb2c8592f758", - "qname": "RuntimeManager", - "kind": "class", - "signature": "RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.core.runtime", - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/bootstrap.py", - "content": "const RuntimeManager\nRuntimeManager = app_runtime.core.runtime.RuntimeManager", - "layer": "C1_SYMBOL_CATALOG", - "title": "RuntimeManager", - "span_start": 4, - "span_end": 4, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": null, - "metadata": { - "symbol_id": "27158ca220022eeb5083c6addf8a50775d45f7161284fd60aac48410105f4b98", - "qname": "RuntimeManager", - "kind": "const", - "signature": "RuntimeManager = app_runtime.core.runtime.RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "src.plba.bootstrap", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/__init__.py", - "content": "const ControlChannel\nControlChannel = app_runtime.control.base.ControlChannel", - "layer": "C1_SYMBOL_CATALOG", - "title": "ControlChannel", - "span_start": 1, - "span_end": 1, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": null, - "metadata": { - "symbol_id": "268420f7aa4ed74082b9276cae0cded4f00bac090ffd58fa020a65be0fe19c27", - "qname": "ControlChannel", - "kind": "const", - "signature": "ControlChannel = app_runtime.control.base.ControlChannel", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.control.__init__", - "is_test": false, - "blob_sha": "bf3c37e3369a84cc618adc0fd71c232e5eb4b871eaff743069a17e661e498316", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "class ControlChannel(ABC):\n @abstractmethod\n async def start(self, actions: ControlActionSet) -> None:\n \"\"\"Start the control channel and bind handlers.\"\"\"\n\n @abstractmethod\n async def stop(self) -> None:\n \"\"\"Stop the control channel and release resources.\"\"\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/base.py:ControlChannel", - "span_start": 21, - "span_end": 28, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": null, - "metadata": { - "chunk_index": 1, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.base", - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/__init__.py", - "content": "from app_runtime.control.base import ControlActionSet, ControlChannel\nfrom app_runtime.control.http_channel import HttpControlChannel\nfrom app_runtime.control.service import ControlPlaneService\n\n__all__ = [\"ControlActionSet\", \"ControlChannel\", \"ControlPlaneService\", \"HttpControlChannel\"]", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/__init__.py:1-5", - "span_start": 1, - "span_end": 5, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": null, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.app_runtime.control.__init__", - "is_test": false, - "blob_sha": "bf3c37e3369a84cc618adc0fd71c232e5eb4b871eaff743069a17e661e498316", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "class ControlActionSet:\n health: HealthHandler\n start: ActionHandler\n stop: ActionHandler\n status: ActionHandler", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/base.py:ControlActionSet", - "span_start": 14, - "span_end": 18, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": null, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.base", - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "class HttpControlAppFactory:\n def create(\n self,\n health_provider: Callable[[], Awaitable[HealthPayload]],\n action_provider: Callable[[str, str], Awaitable[JSONResponse]],\n ) -> FastAPI:\n app = FastAPI(title=\"PLBA Control API\")\n\n @app.middleware(\"http\")\n async def log_api_call(request: Request, call_next): # type: ignore[no-untyped-def]\n started = time.monotonic()\n response = await call_next(request)\n response.headers[\"X-Response-Time-Ms\"] = str(int((time.monotonic() - started) * 1000))\n return response\n\n @app.get(\"/health\")\n async def health() -> JSONResponse:\n payload = await health_provider()\n status_code = 200 if payload.get(\"status\") == \"ok\" else 503\n return JSONResponse(content=payload, status_code=status_code)\n\n @app.get(\"/actions/{action}\")\n @app.post(\"/actions/{action}\")\n async def action(action: str, request: Request) -> JSONResponse:\n client_source = self._client_source(request)\n if action in {\"start\", \"stop\"}:\n LOGGER.warning(\"Control action requested: /actions/%s client=%s\", action, client_source)\n return await action_provider(action, client_source)\n\n return app\n\n def _client_source(self, request: Request) -> str:\n explicit_header = request.headers.get(\"X-Client-Source\", \"\").strip()\n if explicit_header:\n return explicit_header\n user_agent = request.headers.get(\"User-Agent\", \"\").strip()\n if user_agent:\n return f\"user-agent:{user_agent}\"\n return \"unknown\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/http_app.py:HttpControlAppFactory", - "span_start": 15, - "span_end": 53, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": null, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.http_app", - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "retrieval_report": { - "executed_layers": [ - "C4_SEMANTIC_ROLES", - "C3_ENTRYPOINTS", - "C2_DEPENDENCY_GRAPH", - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS" - ], - "retrieval_mode_by_layer": { - "C4_SEMANTIC_ROLES": "vector", - "C3_ENTRYPOINTS": "vector", - "C2_DEPENDENCY_GRAPH": "vector", - "C1_SYMBOL_CATALOG": "vector", - "C0_SOURCE_CHUNKS": "vector" - }, - "top_k_by_layer": { - "C4_SEMANTIC_ROLES": 12, - "C3_ENTRYPOINTS": 8, - "C2_DEPENDENCY_GRAPH": 8, - "C1_SYMBOL_CATALOG": 6, - "C0_SOURCE_CHUNKS": 4 - }, - "filters_by_layer": { - "C4_SEMANTIC_ROLES": { - "path_scope": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [] - }, - "C1_SYMBOL_CATALOG": { - "path_scope": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [] - } - }, - "fallback": { - "used": false, - "reason": null - }, - "retrieval_by_layer_ms": { - "C4_SEMANTIC_ROLES": 33, - "C3_ENTRYPOINTS": 16, - "C2_DEPENDENCY_GRAPH": 67, - "C1_SYMBOL_CATALOG": 36, - "C0_SOURCE_CHUNKS": 24 - } - } - }, - "diagnostics": { - "intent_correct": null, - "target_found": true, - "layers_used": [ - "C4_SEMANTIC_ROLES", - "C3_ENTRYPOINTS", - "C2_DEPENDENCY_GRAPH", - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS" - ], - "retrieval_sufficient": true, - "answer_mode": "normal", - "resolved_target": "RuntimeManager", - "answer_policy_branch": "normal_answer", - "decision_reason": "evidence_sufficient", - "router_result": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "retrieval_profile": "code", - "sub_intent": "ARCHITECTURE", - "path_scope": [], - "layers": [ - "C4_SEMANTIC_ROLES", - "C3_ENTRYPOINTS", - "C2_DEPENDENCY_GRAPH", - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS" - ], - "symbol_resolution_status": "resolved" - }, - "retrieval_request": { - "rag_session_id": "7d11da21-faa0-4cea-aede-aeabe069164c", - "query": "Какие компоненты участвуют в RuntimeManager?", - "sub_intent": "ARCHITECTURE", - "path_scope": [], - "requested_layers": [ - "C4_SEMANTIC_ROLES", - "C3_ENTRYPOINTS", - "C2_DEPENDENCY_GRAPH", - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS" - ] - }, - "per_layer_outcome": [ - { - "layer_id": "C4_SEMANTIC_ROLES", - "hit_count": 12, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C3_ENTRYPOINTS", - "hit_count": 3, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C2_DEPENDENCY_GRAPH", - "hit_count": 8, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C1_SYMBOL_CATALOG", - "hit_count": 6, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C0_SOURCE_CHUNKS", - "hit_count": 4, - "empty": false, - "fallback_used": false - } - ], - "empty_layers": [], - "evidence_gate_decision": { - "sufficient": true, - "failure_reasons": [], - "evidence_count": 33 - }, - "evidence_gate_input": { - "resolved_target": "RuntimeManager", - "sub_intent": "ARCHITECTURE", - "target_type": "symbol", - "evidence_count": 33, - "code_chunk_count": 33, - "entrypoint_count": 3, - "relation_count": 8, - "test_evidence_count": 0, - "symbol_resolution_status": "resolved", - "path_scope": [] - }, - "post_evidence_gate": { - "input": { - "answer_mode": "normal", - "degraded_message": "", - "resolved_target": "RuntimeManager", - "draft_answer_preview": "Компоненты, участвующие в RuntimeManager:\n\n1. **ControlPlaneService** \n - Регистрирует каналы управления (_register_channel_), запускается асинхронно (_start_async), останавливается (_stop_, _stop_async_). \n - Файлы: `service.py` (строки 14–52).\n\n2. **HttpControlAppFactory** \n - Фабрика для", - "repair_candidate": true - }, - "output": { - "passed": true, - "action": "return", - "reasons": [], - "repair_used": false, - "final_answer_preview": "Компоненты, участвующие в RuntimeManager:\n\n1. **ControlPlaneService** \n - Регистрирует каналы управления (_register_channel_), запускается асинхронно (_start_async), останавливается (_stop_, _stop_async_). \n - Файлы: `service.py` (строки 14–52).\n\n2. **HttpControlAppFactory** \n - Фабрика для" - } - }, - "failure_reasons": [], - "timings_ms": { - "router": 1, - "retrieval": 178, - "pre_evidence_gate": 1, - "llm": 9368, - "post_evidence_gate": 1 - } - }, - "rag_rows": [ - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests manager\n- orchestrates role-like calls (4)\n- reads and writes state attributes\n- participates in dataflow slices (50)", - "layer": "C4_SEMANTIC_ROLES", - "title": "RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 43, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "7e4a9381328c5803bbc6179458612fc4e947d928aa7bf8b4b2bebb2c8592f758", - "symbol_name": "RuntimeManager", - "qname": "RuntimeManager", - "role": "pipeline_stage", - "confidence": 0.67, - "dataflow_participation": 50, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "ControlActionSet\nrole: model\n\nResponsibilities:\n- default model role", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlActionSet", - "span_start": 14, - "span_end": 18, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 40, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "46eb026cb3313415ec47b82dd22f84f4d112c9d987e8b1716dcb0baa1cce8988", - "symbol_name": "ControlActionSet", - "qname": "ControlActionSet", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "ControlChannel\nrole: model\n\nResponsibilities:\n- default model role", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlChannel", - "span_start": 21, - "span_end": 28, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 40, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "cfcfe9a311d3a2dbdaf32ac4ccd73c0eb9a117f830591a1c0867ee97d46204ff", - "symbol_name": "ControlChannel", - "qname": "ControlChannel", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests service\n- reads and writes state attributes\n- participates in dataflow slices (5)", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlPlaneService", - "span_start": 12, - "span_end": 52, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 68, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "b13471e5916986dccffb53fab613812842965705e6b3a89ae549d30c9e91e9aa", - "symbol_name": "ControlPlaneService", - "qname": "ControlPlaneService", - "role": "pipeline_stage", - "confidence": 0.57, - "dataflow_participation": 5, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_runner.py", - "content": "UvicornThreadRunner\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (24)", - "layer": "C4_SEMANTIC_ROLES", - "title": "UvicornThreadRunner", - "span_start": 10, - "span_end": 61, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 11, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "fd55630045a02100df8877ac27d951ee08617d4598764394d48cb51fe067476a", - "symbol_name": "UvicornThreadRunner", - "qname": "UvicornThreadRunner", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 24, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "3779fdd2878b770e789a35bb2a89c9d79f13b61c26d7db1b3b683f9bb9e1623f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (10)", - "layer": "C4_SEMANTIC_ROLES", - "title": "HttpControlChannel", - "span_start": 12, - "span_end": 57, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 21, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "1c9fbdc24819e5604c26ea55428a74310f03a03e1af197ed84846af61e42fdb0", - "symbol_name": "HttpControlChannel", - "qname": "HttpControlChannel", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 10, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "HttpControlAppFactory\nrole: factory\n\nResponsibilities:\n- name suffix suggests factory", - "layer": "C4_SEMANTIC_ROLES", - "title": "HttpControlAppFactory", - "span_start": 15, - "span_end": 53, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 39, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "9b3502a5fb408b273223db13264349cf500de24915b6c649d9ea8970d0dfd8e0", - "symbol_name": "HttpControlAppFactory", - "qname": "HttpControlAppFactory", - "role": "factory", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/persistence/workflow_persistence.py", - "content": "WorkflowPersistence\nrole: pipeline_stage\n\nResponsibilities:\n- orchestrates role-like calls (2)\n- reads and writes state attributes\n- participates in dataflow slices (16)", - "layer": "C4_SEMANTIC_ROLES", - "title": "WorkflowPersistence", - "span_start": 8, - "span_end": 54, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 15, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "7bd01ee45cf31f2d5c2e3e51656254860ac785d10cef9e0852cd4fba90857bae", - "symbol_name": "WorkflowPersistence", - "qname": "WorkflowPersistence", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 16, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "80e9410ddc639789b4353c2a1a757ba8d0d5b5bb6075b0b263b61551f04ae1f0", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/queue/in_memory.py", - "content": "InMemoryTaskQueue\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (9)", - "layer": "C4_SEMANTIC_ROLES", - "title": "InMemoryTaskQueue", - "span_start": 9, - "span_end": 38, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 22, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "2da04cb94544a3bcbf0943a95ad4bdd8710bcafaa32a02fd0e4de2178dcf3533", - "symbol_name": "InMemoryTaskQueue", - "qname": "InMemoryTaskQueue", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 9, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "58f0cc001ccda0eee4c6bc32ed83bd05eafd6b6644f1e8b4aa9eed3103db73dc", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/config/file_loader.py", - "content": "ConfigFileLoader\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (8)", - "layer": "C4_SEMANTIC_ROLES", - "title": "ConfigFileLoader", - "span_start": 11, - "span_end": 48, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 23, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "a8474eca8b6e9dc86ae67ed68b16fa5fb639ef08739c053e7b7195489765667f", - "symbol_name": "ConfigFileLoader", - "qname": "ConfigFileLoader", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 8, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "1f19ffebde5e38e4be5a5d5a678059a0f36dedb8fb8b3e00ab395c67106a87ea", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/store.py", - "content": "TraceContextStore\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (6)", - "layer": "C4_SEMANTIC_ROLES", - "title": "TraceContextStore", - "span_start": 15, - "span_end": 52, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 25, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "b2dad4fbe16ffb11b58deba311c7739955c39d59f291b22181f33e9c8cce4059", - "symbol_name": "TraceContextStore", - "qname": "TraceContextStore", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 6, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "d369554f08fc92039c6edd5a2a1e73b23901533e8974459170bbd9347d263dc5", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workers/supervisor.py", - "content": "WorkerSupervisor\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (6)", - "layer": "C4_SEMANTIC_ROLES", - "title": "WorkerSupervisor", - "span_start": 10, - "span_end": 59, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 25, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "c17b44e8d9e97d490989b21fa67d7c346cdda8a0472e4c41fb243c8846faa124", - "symbol_name": "WorkerSupervisor", - "qname": "WorkerSupervisor", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 6, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "77609d9d5927171cce7fc3a54897c183fd63068710c6362029b700937aae5eee", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._start_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 47, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517", - "dst_ref": "ControlPlaneService._start_async", - "resolution": "resolved", - "slice_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._start_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager.start", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 32, - "span_end": 59, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "98312ace7fc62b1c7194c5aa1732b6ef736eae1668a3a120dd1ecd5ab1d64f7a", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "77a7b260193018845e4e204df094ab89cfd7c82ee4e822b3a83ad4cd945f9cb1", - "dst_ref": "RuntimeManager.start", - "resolution": "resolved", - "slice_id": "98312ace7fc62b1c7194c5aa1732b6ef736eae1668a3a120dd1ecd5ab1d64f7a", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager.start" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "77a7b260193018845e4e204df094ab89cfd7c82ee4e822b3a83ad4cd945f9cb1" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.start", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 20, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154", - "dst_ref": "ControlPlaneService.start", - "resolution": "resolved", - "slice_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.start" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.stop", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 25, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d", - "dst_ref": "ControlPlaneService.stop", - "resolution": "resolved", - "slice_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.stop" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._stop_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 51, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a", - "dst_ref": "ControlPlaneService._stop_async", - "resolution": "resolved", - "slice_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._stop_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager.add_config_file", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 32, - "span_end": 52, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "a23b8a11ebdb12708b60c96ea12a69f7f042082f1adfddd572444e246d81d167", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "57ffbd4f0d9fdf3507c2b8624312ce211f3d02fdf86a57a8ec90778d8a7b498d", - "dst_ref": "RuntimeManager.add_config_file", - "resolution": "resolved", - "slice_id": "a23b8a11ebdb12708b60c96ea12a69f7f042082f1adfddd572444e246d81d167", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager.add_config_file" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "57ffbd4f0d9fdf3507c2b8624312ce211f3d02fdf86a57a8ec90778d8a7b498d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.register_channel", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 17, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957", - "dst_ref": "ControlPlaneService.register_channel", - "resolution": "resolved", - "slice_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.register_channel" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager._register_core_services", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 32, - "span_end": 127, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "3e5811f3b511fa0cabe363f5d01f2ac5fa039bc8b93f7ee108323e1f5f45a293", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "972d6057a6caac9cf31ebc1e29c6f39f71b10d4cc170dec57cf875ba458549c6", - "dst_ref": "RuntimeManager._register_core_services", - "resolution": "resolved", - "slice_id": "3e5811f3b511fa0cabe363f5d01f2ac5fa039bc8b93f7ee108323e1f5f45a293", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager._register_core_services" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "972d6057a6caac9cf31ebc1e29c6f39f71b10d4cc170dec57cf875ba458549c6" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/__init__.py", - "content": "const RuntimeManager\nRuntimeManager = plba.core.RuntimeManager", - "layer": "C1_SYMBOL_CATALOG", - "title": "RuntimeManager", - "span_start": 16, - "span_end": 16, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "7eacec84f9b8d6c4201374591faecdac7493091c263681495c338973f2971ad9", - "qname": "RuntimeManager", - "kind": "const", - "signature": "RuntimeManager = plba.core.RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "src.plba.__init__", - "is_test": false, - "blob_sha": "24e755ec8c249d14fb0e675b5dbf2b71ab91afb9c849897eebfa9feb2499e19d", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/core.py", - "content": "const RuntimeManager\nRuntimeManager = app_runtime.core.runtime.RuntimeManager", - "layer": "C1_SYMBOL_CATALOG", - "title": "RuntimeManager", - "span_start": 2, - "span_end": 2, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "e1684562d978b7af7fe9b27dc5869d770348a87b5dc19a50360f58544668578b", - "qname": "RuntimeManager", - "kind": "const", - "signature": "RuntimeManager = app_runtime.core.runtime.RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "src.plba.core", - "is_test": false, - "blob_sha": "c0ae25110d20e665216616e26b68adfe035b624ba45d31d1272fb21f906f9ca8", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "const RuntimeManager\nRuntimeManager = app_runtime.core.runtime.RuntimeManager", - "layer": "C1_SYMBOL_CATALOG", - "title": "RuntimeManager", - "span_start": 9, - "span_end": 9, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "62a9575c77aad894120d18b4f2a08cf2ba42f77e9be4a8a432b767d157701afe", - "qname": "RuntimeManager", - "kind": "const", - "signature": "RuntimeManager = app_runtime.core.runtime.RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.control.service", - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "class RuntimeManager\nRuntimeManager", - "layer": "C1_SYMBOL_CATALOG", - "title": "RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "7e4a9381328c5803bbc6179458612fc4e947d928aa7bf8b4b2bebb2c8592f758", - "qname": "RuntimeManager", - "kind": "class", - "signature": "RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.core.runtime", - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/bootstrap.py", - "content": "const RuntimeManager\nRuntimeManager = app_runtime.core.runtime.RuntimeManager", - "layer": "C1_SYMBOL_CATALOG", - "title": "RuntimeManager", - "span_start": 4, - "span_end": 4, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "27158ca220022eeb5083c6addf8a50775d45f7161284fd60aac48410105f4b98", - "qname": "RuntimeManager", - "kind": "const", - "signature": "RuntimeManager = app_runtime.core.runtime.RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "src.plba.bootstrap", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/__init__.py", - "content": "const ControlChannel\nControlChannel = app_runtime.control.base.ControlChannel", - "layer": "C1_SYMBOL_CATALOG", - "title": "ControlChannel", - "span_start": 1, - "span_end": 1, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "268420f7aa4ed74082b9276cae0cded4f00bac090ffd58fa020a65be0fe19c27", - "qname": "ControlChannel", - "kind": "const", - "signature": "ControlChannel = app_runtime.control.base.ControlChannel", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.control.__init__", - "is_test": false, - "blob_sha": "bf3c37e3369a84cc618adc0fd71c232e5eb4b871eaff743069a17e661e498316", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "class ControlChannel(ABC):\n @abstractmethod\n async def start(self, actions: ControlActionSet) -> None:\n \"\"\"Start the control channel and bind handlers.\"\"\"\n\n @abstractmethod\n async def stop(self) -> None:\n \"\"\"Stop the control channel and release resources.\"\"\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/base.py:ControlChannel", - "span_start": 21, - "span_end": 28, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 1, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.base", - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/__init__.py", - "content": "from app_runtime.control.base import ControlActionSet, ControlChannel\nfrom app_runtime.control.http_channel import HttpControlChannel\nfrom app_runtime.control.service import ControlPlaneService\n\n__all__ = [\"ControlActionSet\", \"ControlChannel\", \"ControlPlaneService\", \"HttpControlChannel\"]", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/__init__.py:1-5", - "span_start": 1, - "span_end": 5, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.app_runtime.control.__init__", - "is_test": false, - "blob_sha": "bf3c37e3369a84cc618adc0fd71c232e5eb4b871eaff743069a17e661e498316", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "class ControlActionSet:\n health: HealthHandler\n start: ActionHandler\n stop: ActionHandler\n status: ActionHandler", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/base.py:ControlActionSet", - "span_start": 14, - "span_end": 18, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.base", - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "class HttpControlAppFactory:\n def create(\n self,\n health_provider: Callable[[], Awaitable[HealthPayload]],\n action_provider: Callable[[str, str], Awaitable[JSONResponse]],\n ) -> FastAPI:\n app = FastAPI(title=\"PLBA Control API\")\n\n @app.middleware(\"http\")\n async def log_api_call(request: Request, call_next): # type: ignore[no-untyped-def]\n started = time.monotonic()\n response = await call_next(request)\n response.headers[\"X-Response-Time-Ms\"] = str(int((time.monotonic() - started) * 1000))\n return response\n\n @app.get(\"/health\")\n async def health() -> JSONResponse:\n payload = await health_provider()\n status_code = 200 if payload.get(\"status\") == \"ok\" else 503\n return JSONResponse(content=payload, status_code=status_code)\n\n @app.get(\"/actions/{action}\")\n @app.post(\"/actions/{action}\")\n async def action(action: str, request: Request) -> JSONResponse:\n client_source = self._client_source(request)\n if action in {\"start\", \"stop\"}:\n LOGGER.warning(\"Control action requested: /actions/%s client=%s\", action, client_source)\n return await action_provider(action, client_source)\n\n return app\n\n def _client_source(self, request: Request) -> str:\n explicit_header = request.headers.get(\"X-Client-Source\", \"\").strip()\n if explicit_header:\n return explicit_header\n user_agent = request.headers.get(\"User-Agent\", \"\").strip()\n if user_agent:\n return f\"user-agent:{user_agent}\"\n return \"unknown\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/http_app.py:HttpControlAppFactory", - "span_start": 15, - "span_end": 53, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.http_app", - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "validation": { - "passed": true, - "action": "return", - "reasons": [] - }, - "steps": [ - { - "step": "router", - "status": "completed", - "timings_ms": { - "router": 1 - }, - "output": { - "intent": "CODE_QA", - "sub_intent": "ARCHITECTURE", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - } - }, - { - "step": "retrieval", - "status": "completed", - "timings_ms": { - "retrieval": 178 - }, - "output": { - "rag_count": 33, - "answer_path_rag_count": 33, - "resolved_symbol_status": "resolved", - "resolved_symbol": "RuntimeManager", - "requested_layers": [ - "C4_SEMANTIC_ROLES", - "C3_ENTRYPOINTS", - "C2_DEPENDENCY_GRAPH", - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS" - ] - }, - "diagnostics": { - "executed_layers": [ - "C4_SEMANTIC_ROLES", - "C3_ENTRYPOINTS", - "C2_DEPENDENCY_GRAPH", - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS" - ], - "retrieval_mode_by_layer": { - "C4_SEMANTIC_ROLES": "vector", - "C3_ENTRYPOINTS": "vector", - "C2_DEPENDENCY_GRAPH": "vector", - "C1_SYMBOL_CATALOG": "vector", - "C0_SOURCE_CHUNKS": "vector" - }, - "top_k_by_layer": { - "C4_SEMANTIC_ROLES": 12, - "C3_ENTRYPOINTS": 8, - "C2_DEPENDENCY_GRAPH": 8, - "C1_SYMBOL_CATALOG": 6, - "C0_SOURCE_CHUNKS": 4 - }, - "filters_by_layer": { - "C4_SEMANTIC_ROLES": { - "path_scope": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [] - }, - "C1_SYMBOL_CATALOG": { - "path_scope": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [] - } - }, - "fallback": { - "used": false, - "reason": null - }, - "retrieval_by_layer_ms": { - "C4_SEMANTIC_ROLES": 33, - "C3_ENTRYPOINTS": 16, - "C2_DEPENDENCY_GRAPH": 67, - "C1_SYMBOL_CATALOG": 36, - "C0_SOURCE_CHUNKS": 24 - } - } - }, - { - "step": "pre_evidence_gate", - "status": "passed", - "timings_ms": { - "pre_evidence_gate": 1 - }, - "input": { - "resolved_target": "RuntimeManager", - "sub_intent": "ARCHITECTURE", - "target_type": "symbol", - "evidence_count": 33, - "code_chunk_count": 33, - "entrypoint_count": 3, - "relation_count": 8, - "test_evidence_count": 0, - "symbol_resolution_status": "resolved", - "path_scope": [] - }, - "output": { - "passed": true, - "failure_reasons": [], - "degraded_message": "", - "evidence_count": 33 - } - }, - { - "step": "llm", - "status": "completed", - "timings_ms": { - "llm": 9368 - }, - "output": { - "prompt_name": "code_qa_architecture_answer", - "answer_preview": "Компоненты, участвующие в RuntimeManager:\n\n1. **ControlPlaneService** \n - Регистрирует каналы управления (_register_channel_), запускается асинхронно (_start_async), останавливается (_stop_, _stop_async_). \n - Файлы: `service.py` (строки 14–52).\n\n2. **HttpControlAppFactory** \n - Фабрика для", - "resolved_target": "RuntimeManager", - "answer_policy_branch": "normal_answer", - "decision_reason": "evidence_sufficient" - } - }, - { - "step": "post_evidence_gate", - "status": "passed", - "timings_ms": { - "post_evidence_gate": 1, - "post_evidence_gate_recheck": 0, - "repair": 0 - }, - "input": { - "answer_mode": "normal", - "degraded_message": "", - "resolved_target": "RuntimeManager", - "draft_answer_preview": "Компоненты, участвующие в RuntimeManager:\n\n1. **ControlPlaneService** \n - Регистрирует каналы управления (_register_channel_), запускается асинхронно (_start_async), останавливается (_stop_, _stop_async_). \n - Файлы: `service.py` (строки 14–52).\n\n2. **HttpControlAppFactory** \n - Фабрика для", - "repair_candidate": true - }, - "output": { - "passed": true, - "action": "return", - "reasons": [], - "repair_used": false, - "final_answer_preview": "Компоненты, участвующие в RuntimeManager:\n\n1. **ControlPlaneService** \n - Регистрирует каналы управления (_register_channel_), запускается асинхронно (_start_async), останавливается (_stop_, _stop_async_). \n - Файлы: `service.py` (строки 14–52).\n\n2. **HttpControlAppFactory** \n - Фабрика для" - } - } - ] - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/plba_full_chain_subintents_v3/20260312_174008/full_chain_plba_code_subintents_v2_plba-v2-architecture-runtime-manager.md b/tests/pipeline_setup_v3/test_results/plba_full_chain_subintents_v3/20260312_174008/full_chain_plba_code_subintents_v2_plba-v2-architecture-runtime-manager.md deleted file mode 100644 index 1d63690..0000000 --- a/tests/pipeline_setup_v3/test_results/plba_full_chain_subintents_v3/20260312_174008/full_chain_plba_code_subintents_v2_plba-v2-architecture-runtime-manager.md +++ /dev/null @@ -1,305 +0,0 @@ -# plba-v2-architecture-runtime-manager - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_02_pipeline/full_chain_plba_code_subintents_v2.yaml -- runner: agent_runtime -- mode: full_chain -- passed: True - -## Query -Какие компоненты участвуют в RuntimeManager? - -## Actual -{ - "intent": "CODE_QA", - "sub_intent": "ARCHITECTURE", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 33, - "llm_answer": "Компоненты, участвующие в RuntimeManager:\n\n1. **ControlPlaneService** \n - Регистрирует каналы управления (_register_channel_), запускается асинхронно (_start_async), останавливается (_stop_, _stop_async_). \n - Файлы: `service.py` (строки 14–52).\n\n2. **HttpControlAppFactory** \n - Фабрика для создания HTTP-приложений контроля. \n - Файл: `http_app.py` (строки 15–53).\n\n3. **UvicornThreadRunner** \n - Выполняет работу в потоке Uvicorn. \n - Файл: `http_runner.py` (строки 10–61).\n\n4. **HttpControlChannel** \n - Канал HTTP-контроля. \n - Файл: `http_channel.py` (строки 12–57).\n\n5. **WorkflowPersistence** \n - Сохраняет состояние рабочих процессов. \n - Файл: `workflow_persistence.py` (строки 8–54).\n\n6. **InMemoryTaskQueue** \n - Очередь задач в памяти. \n - Файл: `in_memory.py` (строки 9–38).\n\n7. **ConfigFileLoader** \n - Загружает конфигурационные файлы. \n - Файл: `file_loader.py` (строки 11–48).\n\n8. **TraceContextStore** \n - Хранит контекст трассировки. \n - Файл: `store.py` (строки 15–52).\n\n9. **WorkerSupervisor** \n - Наблюдатель за рабочими процессами. \n - Файл: `supervisor.py` (строки 10–59).\n\nСвязи внутри конструктора RuntimeManager включают инициализацию конфигурации, регистрацию сервисов и добавление конфигурационных файлов. \nФайл: `runtime.py`, строки 32–127.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "RuntimeManager" - ], - "layers": [ - "C4_SEMANTIC_ROLES", - "C3_ENTRYPOINTS", - "C2_DEPENDENCY_GRAPH", - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS" - ] -} - -## Steps -[ - { - "step": "router", - "status": "completed", - "timings_ms": { - "router": 1 - }, - "output": { - "intent": "CODE_QA", - "sub_intent": "ARCHITECTURE", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - } - }, - { - "step": "retrieval", - "status": "completed", - "timings_ms": { - "retrieval": 178 - }, - "output": { - "rag_count": 33, - "answer_path_rag_count": 33, - "resolved_symbol_status": "resolved", - "resolved_symbol": "RuntimeManager", - "requested_layers": [ - "C4_SEMANTIC_ROLES", - "C3_ENTRYPOINTS", - "C2_DEPENDENCY_GRAPH", - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS" - ] - }, - "diagnostics": { - "executed_layers": [ - "C4_SEMANTIC_ROLES", - "C3_ENTRYPOINTS", - "C2_DEPENDENCY_GRAPH", - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS" - ], - "retrieval_mode_by_layer": { - "C4_SEMANTIC_ROLES": "vector", - "C3_ENTRYPOINTS": "vector", - "C2_DEPENDENCY_GRAPH": "vector", - "C1_SYMBOL_CATALOG": "vector", - "C0_SOURCE_CHUNKS": "vector" - }, - "top_k_by_layer": { - "C4_SEMANTIC_ROLES": 12, - "C3_ENTRYPOINTS": 8, - "C2_DEPENDENCY_GRAPH": 8, - "C1_SYMBOL_CATALOG": 6, - "C0_SOURCE_CHUNKS": 4 - }, - "filters_by_layer": { - "C4_SEMANTIC_ROLES": { - "path_scope": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [] - }, - "C1_SYMBOL_CATALOG": { - "path_scope": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [] - } - }, - "fallback": { - "used": false, - "reason": null - }, - "retrieval_by_layer_ms": { - "C4_SEMANTIC_ROLES": 33, - "C3_ENTRYPOINTS": 16, - "C2_DEPENDENCY_GRAPH": 67, - "C1_SYMBOL_CATALOG": 36, - "C0_SOURCE_CHUNKS": 24 - } - } - }, - { - "step": "pre_evidence_gate", - "status": "passed", - "timings_ms": { - "pre_evidence_gate": 1 - }, - "input": { - "resolved_target": "RuntimeManager", - "sub_intent": "ARCHITECTURE", - "target_type": "symbol", - "evidence_count": 33, - "code_chunk_count": 33, - "entrypoint_count": 3, - "relation_count": 8, - "test_evidence_count": 0, - "symbol_resolution_status": "resolved", - "path_scope": [] - }, - "output": { - "passed": true, - "failure_reasons": [], - "degraded_message": "", - "evidence_count": 33 - } - }, - { - "step": "llm", - "status": "completed", - "timings_ms": { - "llm": 9368 - }, - "output": { - "prompt_name": "code_qa_architecture_answer", - "answer_preview": "Компоненты, участвующие в RuntimeManager:\n\n1. **ControlPlaneService** \n - Регистрирует каналы управления (_register_channel_), запускается асинхронно (_start_async), останавливается (_stop_, _stop_async_). \n - Файлы: `service.py` (строки 14–52).\n\n2. **HttpControlAppFactory** \n - Фабрика для", - "resolved_target": "RuntimeManager", - "answer_policy_branch": "normal_answer", - "decision_reason": "evidence_sufficient" - } - }, - { - "step": "post_evidence_gate", - "status": "passed", - "timings_ms": { - "post_evidence_gate": 1, - "post_evidence_gate_recheck": 0, - "repair": 0 - }, - "input": { - "answer_mode": "normal", - "degraded_message": "", - "resolved_target": "RuntimeManager", - "draft_answer_preview": "Компоненты, участвующие в RuntimeManager:\n\n1. **ControlPlaneService** \n - Регистрирует каналы управления (_register_channel_), запускается асинхронно (_start_async), останавливается (_stop_, _stop_async_). \n - Файлы: `service.py` (строки 14–52).\n\n2. **HttpControlAppFactory** \n - Фабрика для", - "repair_candidate": true - }, - "output": { - "passed": true, - "action": "return", - "reasons": [], - "repair_used": false, - "final_answer_preview": "Компоненты, участвующие в RuntimeManager:\n\n1. **ControlPlaneService** \n - Регистрирует каналы управления (_register_channel_), запускается асинхронно (_start_async), останавливается (_stop_, _stop_async_). \n - Файлы: `service.py` (строки 14–52).\n\n2. **HttpControlAppFactory** \n - Фабрика для" - } - } -] - -## Diagnostics -{ - "intent_correct": null, - "target_found": true, - "layers_used": [ - "C4_SEMANTIC_ROLES", - "C3_ENTRYPOINTS", - "C2_DEPENDENCY_GRAPH", - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS" - ], - "retrieval_sufficient": true, - "answer_mode": "normal", - "resolved_target": "RuntimeManager", - "answer_policy_branch": "normal_answer", - "decision_reason": "evidence_sufficient", - "router_result": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "retrieval_profile": "code", - "sub_intent": "ARCHITECTURE", - "path_scope": [], - "layers": [ - "C4_SEMANTIC_ROLES", - "C3_ENTRYPOINTS", - "C2_DEPENDENCY_GRAPH", - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS" - ], - "symbol_resolution_status": "resolved" - }, - "retrieval_request": { - "rag_session_id": "7d11da21-faa0-4cea-aede-aeabe069164c", - "query": "Какие компоненты участвуют в RuntimeManager?", - "sub_intent": "ARCHITECTURE", - "path_scope": [], - "requested_layers": [ - "C4_SEMANTIC_ROLES", - "C3_ENTRYPOINTS", - "C2_DEPENDENCY_GRAPH", - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS" - ] - }, - "per_layer_outcome": [ - { - "layer_id": "C4_SEMANTIC_ROLES", - "hit_count": 12, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C3_ENTRYPOINTS", - "hit_count": 3, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C2_DEPENDENCY_GRAPH", - "hit_count": 8, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C1_SYMBOL_CATALOG", - "hit_count": 6, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C0_SOURCE_CHUNKS", - "hit_count": 4, - "empty": false, - "fallback_used": false - } - ], - "empty_layers": [], - "evidence_gate_decision": { - "sufficient": true, - "failure_reasons": [], - "evidence_count": 33 - }, - "evidence_gate_input": { - "resolved_target": "RuntimeManager", - "sub_intent": "ARCHITECTURE", - "target_type": "symbol", - "evidence_count": 33, - "code_chunk_count": 33, - "entrypoint_count": 3, - "relation_count": 8, - "test_evidence_count": 0, - "symbol_resolution_status": "resolved", - "path_scope": [] - }, - "post_evidence_gate": { - "input": { - "answer_mode": "normal", - "degraded_message": "", - "resolved_target": "RuntimeManager", - "draft_answer_preview": "Компоненты, участвующие в RuntimeManager:\n\n1. **ControlPlaneService** \n - Регистрирует каналы управления (_register_channel_), запускается асинхронно (_start_async), останавливается (_stop_, _stop_async_). \n - Файлы: `service.py` (строки 14–52).\n\n2. **HttpControlAppFactory** \n - Фабрика для", - "repair_candidate": true - }, - "output": { - "passed": true, - "action": "return", - "reasons": [], - "repair_used": false, - "final_answer_preview": "Компоненты, участвующие в RuntimeManager:\n\n1. **ControlPlaneService** \n - Регистрирует каналы управления (_register_channel_), запускается асинхронно (_start_async), останавливается (_stop_, _stop_async_). \n - Файлы: `service.py` (строки 14–52).\n\n2. **HttpControlAppFactory** \n - Фабрика для" - } - }, - "failure_reasons": [], - "timings_ms": { - "router": 1, - "retrieval": 178, - "pre_evidence_gate": 1, - "llm": 9368, - "post_evidence_gate": 1 - } -} - -## Mismatches -- none \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/plba_full_chain_subintents_v3/20260312_174008/full_chain_plba_code_subintents_v2_plba-v2-explain-create-runtime.json b/tests/pipeline_setup_v3/test_results/plba_full_chain_subintents_v3/20260312_174008/full_chain_plba_code_subintents_v2_plba-v2-explain-create-runtime.json deleted file mode 100644 index 60170a3..0000000 --- a/tests/pipeline_setup_v3/test_results/plba_full_chain_subintents_v3/20260312_174008/full_chain_plba_code_subintents_v2_plba-v2-explain-create-runtime.json +++ /dev/null @@ -1,3989 +0,0 @@ -{ - "case_id": "plba-v2-explain-create-runtime", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_02_pipeline/full_chain_plba_code_subintents_v2.yaml", - "runner": "agent_runtime", - "mode": "full_chain", - "query": "Что делает функция create_runtime?", - "actual": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 33, - "llm_answer": "Функция `create_runtime` определена в модуле `src/plba/bootstrap.py`. Она создаёт и настраивает экземпляр `RuntimeManager`, регистрируя модуль приложения и, при необходимости, конфигурационные файлы и HTTP-канал управления.\n\nОсновные действия функции:\n- Инициализирует объект `RuntimeManager`.\n- Если указан путь к конфигурационному файлу (`config_path`), добавляет его в менеджер.\n- Если включено управление через HTTP (`enable_http_control`), регистрирует HTTP-канал управления в плоскости контроля.\n- Регистрирует модуль приложения в менеджере времени выполнения.\n- Возвращает настроенный объект `RuntimeManager`.\n\nВходные параметры:\n- `module`: экземпляр `ApplicationModule`.\n- `config_path`: опциональный путь к конфигурационному файлу.\n- `enable_http_control`: флаг включения HTTP-контроля.\n- `control_host`, `control_port`, `control_timeout`: параметры подключения для HTTP-канала управления.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "create_runtime" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "passed": true, - "mismatches": [], - "details": { - "query": "Что делает функция create_runtime?", - "router_result": { - "schema_version": "1.1", - "intent": "CODE_QA", - "retrieval_profile": "code", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query_plan": { - "raw": "Что делает функция create_runtime?", - "normalized": "Что делает функция create_runtime?", - "sub_intent": "EXPLAIN", - "negations": [], - "expansions": [ - "function", - "create_runtime" - ], - "keyword_hints": [ - "create_runtime" - ], - "path_hints": [], - "doc_scope_hints": [], - "symbol_candidates": [ - "create_runtime" - ], - "symbol_kind_hint": "function", - "anchors": [ - { - "type": "SYMBOL", - "value": "create_runtime", - "source": "user_text", - "subtype": null, - "span": { - "start": 19, - "end": 33 - }, - "confidence": 0.88 - }, - { - "type": "KEY_TERM", - "value": "функция", - "source": "user_text", - "subtype": null, - "span": { - "start": 11, - "end": 18 - }, - "confidence": 0.9 - } - ] - }, - "retrieval_spec": { - "domains": [ - "CODE" - ], - "layer_queries": [ - { - "layer_id": "C1_SYMBOL_CATALOG", - "top_k": 8 - }, - { - "layer_id": "C0_SOURCE_CHUNKS", - "top_k": 8 - }, - { - "layer_id": "C4_SEMANTIC_ROLES", - "top_k": 8 - }, - { - "layer_id": "C2_DEPENDENCY_GRAPH", - "top_k": 6 - }, - { - "layer_id": "C3_ENTRYPOINTS", - "top_k": 6 - } - ], - "filters": { - "test_policy": "EXCLUDE", - "path_scope": [], - "language": [ - "python" - ] - }, - "rerank_profile": "code" - }, - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - }, - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "create_runtime", - "alternatives": [ - "create_runtime", - "create_runtime", - "annotations", - "json", - "Path" - ], - "confidence": 0.99 - }, - "evidence_policy": { - "require_def": true, - "require_flow": true, - "require_spec": false, - "allow_answer_without_evidence": false - } - }, - "retrieval_request": { - "rag_session_id": "7d11da21-faa0-4cea-aede-aeabe069164c", - "query": "Что делает функция create_runtime?", - "sub_intent": "EXPLAIN", - "path_scope": [], - "keyword_hints": [ - "create_runtime" - ], - "symbol_candidates": [ - "create_runtime" - ], - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_spec": { - "domains": [ - "CODE" - ], - "layer_queries": [ - { - "layer_id": "C1_SYMBOL_CATALOG", - "top_k": 8 - }, - { - "layer_id": "C0_SOURCE_CHUNKS", - "top_k": 8 - }, - { - "layer_id": "C4_SEMANTIC_ROLES", - "top_k": 8 - }, - { - "layer_id": "C2_DEPENDENCY_GRAPH", - "top_k": 6 - }, - { - "layer_id": "C3_ENTRYPOINTS", - "top_k": 6 - } - ], - "filters": { - "test_policy": "EXCLUDE", - "path_scope": [], - "language": [ - "python" - ] - }, - "rerank_profile": "code" - }, - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - }, - "query_plan": { - "raw": "Что делает функция create_runtime?", - "normalized": "Что делает функция create_runtime?", - "sub_intent": "EXPLAIN", - "negations": [], - "expansions": [ - "function", - "create_runtime" - ], - "keyword_hints": [ - "create_runtime" - ], - "path_hints": [], - "doc_scope_hints": [], - "symbol_candidates": [ - "create_runtime" - ], - "symbol_kind_hint": "function", - "anchors": [ - { - "type": "SYMBOL", - "value": "create_runtime", - "source": "user_text", - "subtype": null, - "span": { - "start": 19, - "end": 33 - }, - "confidence": 0.88 - }, - { - "type": "KEY_TERM", - "value": "функция", - "source": "user_text", - "subtype": null, - "span": { - "start": 11, - "end": 18 - }, - "confidence": 0.9 - } - ] - } - }, - "retrieval_result": { - "target_symbol_candidates": [ - "create_runtime", - "annotations", - "json", - "Path", - "Any", - "yaml", - "hashlib" - ], - "resolved_symbol": "create_runtime", - "symbol_resolution_status": "resolved", - "file_candidates": [ - "src/plba/__init__.py", - "src/plba/bootstrap.py", - "src/app_runtime/config/file_loader.py", - "src/app_runtime/config/__init__.py", - "src/app_runtime/config/providers.py", - "src/app_runtime/contracts/__init__.py", - "src/app_runtime/contracts/application.py", - "src/app_runtime/__init__.py", - "src/app_runtime/control/http_runner.py", - "src/app_runtime/workflow/persistence/workflow_persistence.py", - "src/app_runtime/control/http_channel.py", - "src/app_runtime/queue/in_memory.py", - "src/app_runtime/workers/supervisor.py", - "src/app_runtime/workflow/engine/workflow_engine.py", - "src/app_runtime/tracing/store.py", - "src/app_runtime/control/http_app.py" - ], - "code_chunks": [ - { - "layer": "C1_SYMBOL_CATALOG", - "path": "src/plba/__init__.py", - "title": "create_runtime", - "content": "const create_runtime\ncreate_runtime = plba.bootstrap.create_runtime", - "start_line": 1, - "end_line": 1, - "metadata": { - "symbol_id": "fa1e84f16c8c659bcd5448637386af4d15d431064e07714e34689ee64233cb51", - "qname": "create_runtime", - "kind": "const", - "signature": "create_runtime = plba.bootstrap.create_runtime", - "parent_symbol_id": null, - "package_or_module": "src.plba.__init__", - "is_test": false, - "blob_sha": "24e755ec8c249d14fb0e675b5dbf2b71ab91afb9c849897eebfa9feb2499e19d", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C1_SYMBOL_CATALOG", - "path": "src/plba/bootstrap.py", - "title": "create_runtime", - "content": "function create_runtime\ncreate_runtime(module)", - "start_line": 8, - "end_line": 29, - "metadata": { - "symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "qname": "create_runtime", - "kind": "function", - "signature": "create_runtime(module)", - "parent_symbol_id": null, - "package_or_module": "src.plba.bootstrap", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C1_SYMBOL_CATALOG", - "path": "src/app_runtime/config/file_loader.py", - "title": "annotations", - "content": "const annotations\nannotations = __future__.annotations", - "start_line": 1, - "end_line": 1, - "metadata": { - "symbol_id": "5ed640ccec43a78659d50ec24f3717bf1144a182c22588f37456649ac6a4a815", - "qname": "annotations", - "kind": "const", - "signature": "annotations = __future__.annotations", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.config.file_loader", - "is_test": false, - "blob_sha": "1f19ffebde5e38e4be5a5d5a678059a0f36dedb8fb8b3e00ab395c67106a87ea", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C1_SYMBOL_CATALOG", - "path": "src/app_runtime/config/file_loader.py", - "title": "json", - "content": "const json\nimport json", - "start_line": 4, - "end_line": 4, - "metadata": { - "symbol_id": "bb9e2eaf992bfd050f7072d72eed87c55b1a4b001daa034a0f7c630a61bb1d78", - "qname": "json", - "kind": "const", - "signature": "import json", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.config.file_loader", - "is_test": false, - "blob_sha": "1f19ffebde5e38e4be5a5d5a678059a0f36dedb8fb8b3e00ab395c67106a87ea", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C1_SYMBOL_CATALOG", - "path": "src/app_runtime/config/file_loader.py", - "title": "Path", - "content": "const Path\nPath = pathlib.Path", - "start_line": 5, - "end_line": 5, - "metadata": { - "symbol_id": "b785967ed1fb83aa62d5724c6d6e9c6d2b1505523db39bd941cc39b48db48306", - "qname": "Path", - "kind": "const", - "signature": "Path = pathlib.Path", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.config.file_loader", - "is_test": false, - "blob_sha": "1f19ffebde5e38e4be5a5d5a678059a0f36dedb8fb8b3e00ab395c67106a87ea", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C1_SYMBOL_CATALOG", - "path": "src/app_runtime/config/file_loader.py", - "title": "Any", - "content": "const Any\nAny = typing.Any", - "start_line": 6, - "end_line": 6, - "metadata": { - "symbol_id": "8e330833b8073585db1c4b4315947c400683a23e4c3d2e2ccbcb260f347541b6", - "qname": "Any", - "kind": "const", - "signature": "Any = typing.Any", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.config.file_loader", - "is_test": false, - "blob_sha": "1f19ffebde5e38e4be5a5d5a678059a0f36dedb8fb8b3e00ab395c67106a87ea", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C1_SYMBOL_CATALOG", - "path": "src/app_runtime/config/file_loader.py", - "title": "yaml", - "content": "const yaml\nimport yaml", - "start_line": 8, - "end_line": 8, - "metadata": { - "symbol_id": "223502bbfc2b82aea662f7466403cc99a3cd44f1b0507d637cd674874f751e4f", - "qname": "yaml", - "kind": "const", - "signature": "import yaml", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.config.file_loader", - "is_test": false, - "blob_sha": "1f19ffebde5e38e4be5a5d5a678059a0f36dedb8fb8b3e00ab395c67106a87ea", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C1_SYMBOL_CATALOG", - "path": "src/app_runtime/config/file_loader.py", - "title": "hashlib", - "content": "const hashlib\nimport hashlib", - "start_line": 3, - "end_line": 3, - "metadata": { - "symbol_id": "e7375824bd473da3d73d316d22e3cb6428930e2db1ffbd900ce5a8b88427bf05", - "qname": "hashlib", - "kind": "const", - "signature": "import hashlib", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.config.file_loader", - "is_test": false, - "blob_sha": "1f19ffebde5e38e4be5a5d5a678059a0f36dedb8fb8b3e00ab395c67106a87ea", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C0_SOURCE_CHUNKS", - "path": "src/plba/__init__.py", - "title": "src/plba/__init__.py:1-69", - "content": "from plba.bootstrap import create_runtime\nfrom plba.config import ConfigFileLoader, FileConfigProvider\nfrom plba.control import ControlActionSet, ControlChannel, ControlPlaneService, HttpControlChannel\nfrom plba.contracts import (\n ApplicationModule,\n ConfigProvider,\n HealthContributor,\n TraceContext,\n TraceContextRecord,\n TraceLogMessage,\n TraceTransport,\n Worker,\n WorkerHealth,\n WorkerStatus,\n)\nfrom plba.core import ConfigurationManager, RuntimeManager, ServiceContainer\nfrom plba.health import HealthRegistry\nfrom plba.logging import LogManager\nfrom plba.queue import InMemoryTaskQueue\nfrom plba.tracing import MySqlTraceTransport, NoOpTraceTransport, TraceService\nfrom plba.workflow import (\n StepResult,\n WorkflowContext,\n WorkflowDefinition,\n WorkflowEngine,\n WorkflowEngineHooks,\n WorkflowNode,\n WorkflowRuntimeFactory,\n WorkflowStep,\n)\nfrom plba.workers import WorkerSupervisor\n\n__all__ = [\n \"ApplicationModule\",\n \"ConfigFileLoader\",\n \"ConfigProvider\",\n \"ConfigurationManager\",\n \"ControlActionSet\",\n \"ControlChannel\",\n \"ControlPlaneService\",\n \"create_runtime\",\n \"FileConfigProvider\",\n \"HealthContributor\",\n \"HealthRegistry\",\n \"HttpControlChannel\",\n \"InMemoryTaskQueue\",\n \"LogManager\",\n \"MySqlTraceTransport\",\n \"NoOpTraceTransport\",\n \"RuntimeManager\",\n \"ServiceContainer\",\n \"TraceContext\",\n \"TraceContextRecord\",\n \"TraceLogMessage\",\n \"TraceService\",\n \"TraceTransport\",\n \"StepResult\",\n \"Worker\",\n \"WorkerHealth\",\n \"WorkerStatus\",\n \"WorkflowContext\",\n \"WorkflowDefinition\",\n \"WorkflowEngine\",\n \"WorkflowEngineHooks\",\n \"WorkflowNode\",\n \"WorkflowRuntimeFactory\",\n \"WorkflowStep\",\n \"WorkerSupervisor\",\n]", - "start_line": 1, - "end_line": 69, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.plba.__init__", - "is_test": false, - "blob_sha": "24e755ec8c249d14fb0e675b5dbf2b71ab91afb9c849897eebfa9feb2499e19d", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C0_SOURCE_CHUNKS", - "path": "src/plba/bootstrap.py", - "title": "src/plba/bootstrap.py:create_runtime", - "content": "def create_runtime(\n module: ApplicationModule,\n *,\n config_path: str | None = None,\n enable_http_control: bool = False,\n control_host: str = \"127.0.0.1\",\n control_port: int = 8080,\n control_timeout: int = 5,\n) -> RuntimeManager:\n runtime = RuntimeManager()\n if config_path is not None:\n runtime.add_config_file(config_path)\n if enable_http_control:\n runtime.control_plane.register_channel(\n HttpControlChannel(\n host=control_host,\n port=control_port,\n timeout=control_timeout,\n )\n )\n runtime.register_module(module)\n return runtime", - "start_line": 8, - "end_line": 29, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.plba.bootstrap", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C0_SOURCE_CHUNKS", - "path": "src/app_runtime/config/__init__.py", - "title": "src/app_runtime/config/__init__.py:1-4", - "content": "from app_runtime.config.file_loader import ConfigFileLoader\nfrom app_runtime.config.providers import FileConfigProvider\n\n__all__ = [\"ConfigFileLoader\", \"FileConfigProvider\"]", - "start_line": 1, - "end_line": 4, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.app_runtime.config.__init__", - "is_test": false, - "blob_sha": "612918029820a2a983330ec92256142b55b9de4bdf3399ece18e2a02dbad9729", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C0_SOURCE_CHUNKS", - "path": "src/app_runtime/config/file_loader.py", - "title": "src/app_runtime/config/file_loader.py:ConfigFileLoader", - "content": "class ConfigFileLoader:\n def __init__(self, path: str | Path) -> None:\n self.path = Path(path)\n self.config: Any = None\n self.last_valid_config: Any = None\n self._last_seen_hash: str | None = None\n\n def read_text(self) -> str:\n return self.path.read_text(encoding=\"utf-8\")\n\n def parse(self, data: str) -> Any:\n suffix = self.path.suffix.lower()\n if suffix in {\".yml\", \".yaml\"}:\n return yaml.safe_load(data)\n return json.loads(data)\n\n def load_sync(self) -> Any:\n data = self.read_text()\n parsed = self.parse(data)\n self.config = parsed\n self.last_valid_config = parsed\n self._last_seen_hash = self._calculate_hash(data)\n return parsed\n\n def load_if_changed(self) -> tuple[bool, Any]:\n data = self.read_text()\n current_hash = self._calculate_hash(data)\n if current_hash == self._last_seen_hash:\n return False, self.config\n parsed = self.parse(data)\n self.config = parsed\n self.last_valid_config = parsed\n self._last_seen_hash = current_hash\n return True, parsed\n\n @staticmethod\n def _calculate_hash(data: str) -> str:\n return hashlib.sha256(data.encode(\"utf-8\")).hexdigest()", - "start_line": 11, - "end_line": 48, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.config.file_loader", - "is_test": false, - "blob_sha": "1f19ffebde5e38e4be5a5d5a678059a0f36dedb8fb8b3e00ab395c67106a87ea", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C0_SOURCE_CHUNKS", - "path": "src/app_runtime/config/providers.py", - "title": "src/app_runtime/config/providers.py:FileConfigProvider", - "content": "class FileConfigProvider(ConfigProvider):\n def __init__(self, path: str | Path) -> None:\n self._loader = ConfigFileLoader(path)\n\n @property\n def loader(self) -> ConfigFileLoader:\n return self._loader\n\n def load(self) -> dict[str, Any]:\n config = self._loader.load_sync()\n if not isinstance(config, dict):\n raise TypeError(\"Config root must be a mapping\")\n return dict(config)", - "start_line": 10, - "end_line": 22, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.config.providers", - "is_test": false, - "blob_sha": "8c53ca0122d6df6c5763bca15e99434bb4daebd5a618b8fc927e9ae90b022e64", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C0_SOURCE_CHUNKS", - "path": "src/app_runtime/contracts/__init__.py", - "title": "src/app_runtime/__init__.py:1-1", - "content": "__all__: list[str] = []", - "start_line": 1, - "end_line": 1, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.app_runtime.__init__", - "is_test": false, - "blob_sha": "8eea9df4f6d7b38ca0e39ccc27b04700e3d08dbeec8046d613d22706d19985fa", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C0_SOURCE_CHUNKS", - "path": "src/app_runtime/contracts/application.py", - "title": "src/app_runtime/contracts/application.py:ApplicationModule", - "content": "class ApplicationModule(ABC):\n @property\n @abstractmethod\n def name(self) -> str:\n \"\"\"Module name used for runtime status and diagnostics.\"\"\"\n\n @abstractmethod\n def register(self, registry: ModuleRegistry) -> None:\n \"\"\"Register workers, services, and health contributors.\"\"\"", - "start_line": 8, - "end_line": 16, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.contracts.application", - "is_test": false, - "blob_sha": "197c35634dca49c352ce3f230295a485fbffb672ce7bb8c08e752bfdf61e7fa4", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C0_SOURCE_CHUNKS", - "path": "src/app_runtime/__init__.py", - "title": "src/app_runtime/__init__.py:1-1", - "content": "__all__: list[str] = []", - "start_line": 1, - "end_line": 1, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.app_runtime.__init__", - "is_test": false, - "blob_sha": "8eea9df4f6d7b38ca0e39ccc27b04700e3d08dbeec8046d613d22706d19985fa", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C4_SEMANTIC_ROLES", - "path": "src/app_runtime/control/http_runner.py", - "title": "UvicornThreadRunner", - "content": "UvicornThreadRunner\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (24)", - "start_line": 10, - "end_line": 61, - "metadata": { - "symbol_id": "fd55630045a02100df8877ac27d951ee08617d4598764394d48cb51fe067476a", - "symbol_name": "UvicornThreadRunner", - "qname": "UvicornThreadRunner", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 24, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "3779fdd2878b770e789a35bb2a89c9d79f13b61c26d7db1b3b683f9bb9e1623f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C4_SEMANTIC_ROLES", - "path": "src/app_runtime/workflow/persistence/workflow_persistence.py", - "title": "WorkflowPersistence", - "content": "WorkflowPersistence\nrole: pipeline_stage\n\nResponsibilities:\n- orchestrates role-like calls (2)\n- reads and writes state attributes\n- participates in dataflow slices (16)", - "start_line": 8, - "end_line": 54, - "metadata": { - "symbol_id": "7bd01ee45cf31f2d5c2e3e51656254860ac785d10cef9e0852cd4fba90857bae", - "symbol_name": "WorkflowPersistence", - "qname": "WorkflowPersistence", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 16, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "80e9410ddc639789b4353c2a1a757ba8d0d5b5bb6075b0b263b61551f04ae1f0", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C4_SEMANTIC_ROLES", - "path": "src/app_runtime/control/http_channel.py", - "title": "HttpControlChannel", - "content": "HttpControlChannel\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (10)", - "start_line": 12, - "end_line": 57, - "metadata": { - "symbol_id": "1c9fbdc24819e5604c26ea55428a74310f03a03e1af197ed84846af61e42fdb0", - "symbol_name": "HttpControlChannel", - "qname": "HttpControlChannel", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 10, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C4_SEMANTIC_ROLES", - "path": "src/app_runtime/queue/in_memory.py", - "title": "InMemoryTaskQueue", - "content": "InMemoryTaskQueue\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (9)", - "start_line": 9, - "end_line": 38, - "metadata": { - "symbol_id": "2da04cb94544a3bcbf0943a95ad4bdd8710bcafaa32a02fd0e4de2178dcf3533", - "symbol_name": "InMemoryTaskQueue", - "qname": "InMemoryTaskQueue", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 9, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "58f0cc001ccda0eee4c6bc32ed83bd05eafd6b6644f1e8b4aa9eed3103db73dc", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C4_SEMANTIC_ROLES", - "path": "src/app_runtime/config/file_loader.py", - "title": "ConfigFileLoader", - "content": "ConfigFileLoader\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (8)", - "start_line": 11, - "end_line": 48, - "metadata": { - "symbol_id": "a8474eca8b6e9dc86ae67ed68b16fa5fb639ef08739c053e7b7195489765667f", - "symbol_name": "ConfigFileLoader", - "qname": "ConfigFileLoader", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 8, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "1f19ffebde5e38e4be5a5d5a678059a0f36dedb8fb8b3e00ab395c67106a87ea", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C4_SEMANTIC_ROLES", - "path": "src/app_runtime/workers/supervisor.py", - "title": "WorkerSupervisor", - "content": "WorkerSupervisor\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (6)", - "start_line": 10, - "end_line": 59, - "metadata": { - "symbol_id": "c17b44e8d9e97d490989b21fa67d7c346cdda8a0472e4c41fb243c8846faa124", - "symbol_name": "WorkerSupervisor", - "qname": "WorkerSupervisor", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 6, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "77609d9d5927171cce7fc3a54897c183fd63068710c6362029b700937aae5eee", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C4_SEMANTIC_ROLES", - "path": "src/app_runtime/workflow/engine/workflow_engine.py", - "title": "WorkflowEngine", - "content": "WorkflowEngine\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (6)", - "start_line": 10, - "end_line": 86, - "metadata": { - "symbol_id": "57ec0a9f11c542c78e008684a888397e8d9ef4223671acb2567e631a0cbc70b4", - "symbol_name": "WorkflowEngine", - "qname": "WorkflowEngine", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 6, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "1057136e58a325cd5ab6f4e265d15665fb6a711b7022d9fab52a1a290afa2368", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C4_SEMANTIC_ROLES", - "path": "src/app_runtime/tracing/store.py", - "title": "TraceContextStore", - "content": "TraceContextStore\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (6)", - "start_line": 15, - "end_line": 52, - "metadata": { - "symbol_id": "b2dad4fbe16ffb11b58deba311c7739955c39d59f291b22181f33e9c8cce4059", - "symbol_name": "TraceContextStore", - "qname": "TraceContextStore", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 6, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "d369554f08fc92039c6edd5a2a1e73b23901533e8974459170bbd9347d263dc5", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "path": "src/plba/bootstrap.py", - "title": "create_runtime:calls", - "content": "create_runtime calls runtime.add_config_file", - "start_line": 19, - "end_line": 19, - "metadata": { - "edge_id": "4eaeec4ac55a59d5f66fd01c4754955f8fedaf4bc3df13fa769b352c7bfaacbb", - "edge_type": "calls", - "src_symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "src_qname": "create_runtime", - "dst_symbol_id": null, - "dst_ref": "runtime.add_config_file", - "resolution": "partial", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "path": "src/plba/bootstrap.py", - "title": "create_runtime:reads_attr", - "content": "create_runtime reads_attr runtime.register_module", - "start_line": 28, - "end_line": 28, - "metadata": { - "edge_id": "45516c79ff358dbf9b650a081668df0f66d2fe989300f985a1a78be6be166f8f", - "edge_type": "reads_attr", - "src_symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "src_qname": "create_runtime", - "dst_symbol_id": null, - "dst_ref": "runtime.register_module", - "resolution": "partial", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "path": "src/plba/bootstrap.py", - "title": "create_runtime:instantiates", - "content": "create_runtime instantiates RuntimeManager", - "start_line": 17, - "end_line": 17, - "metadata": { - "edge_id": "0adba17984f850ea1608c9e734d2dd5c325cfde3a8133123aa239e44935ad18e", - "edge_type": "instantiates", - "src_symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "src_qname": "create_runtime", - "dst_symbol_id": "27158ca220022eeb5083c6addf8a50775d45f7161284fd60aac48410105f4b98", - "dst_ref": "RuntimeManager", - "resolution": "resolved", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "path": "src/plba/bootstrap.py", - "title": "create_runtime:calls", - "content": "create_runtime calls runtime.register_module", - "start_line": 28, - "end_line": 28, - "metadata": { - "edge_id": "ab6003c3441addc1ba1b81edeca009165559f652f6b2cf424e5ae61b1f617de8", - "edge_type": "calls", - "src_symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "src_qname": "create_runtime", - "dst_symbol_id": null, - "dst_ref": "runtime.register_module", - "resolution": "partial", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "path": "src/plba/bootstrap.py", - "title": "create_runtime:calls", - "content": "create_runtime calls runtime.control_plane.register_channel", - "start_line": 21, - "end_line": 27, - "metadata": { - "edge_id": "2678250030b9ce47a3b3b55fac7897ac530367edc8374ac9d5e6ecafb1e483f0", - "edge_type": "calls", - "src_symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "src_qname": "create_runtime", - "dst_symbol_id": null, - "dst_ref": "runtime.control_plane.register_channel", - "resolution": "partial", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "path": "src/plba/bootstrap.py", - "title": "create_runtime:reads_attr", - "content": "create_runtime reads_attr runtime.add_config_file", - "start_line": 19, - "end_line": 19, - "metadata": { - "edge_id": "30d4e8aae984ab84d523e80d02f1caeda52d547fa3d2aa47be8845931cabbca2", - "edge_type": "reads_attr", - "src_symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "src_qname": "create_runtime", - "dst_symbol_id": null, - "dst_ref": "runtime.add_config_file", - "resolution": "partial", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C3_ENTRYPOINTS", - "path": "src/app_runtime/control/http_app.py", - "title": "app.post", - "content": "fastapi http app.post", - "start_line": 38, - "end_line": 42, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C3_ENTRYPOINTS", - "path": "src/app_runtime/control/http_app.py", - "title": "app.get", - "content": "fastapi http app.get", - "start_line": 31, - "end_line": 34, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C3_ENTRYPOINTS", - "path": "src/app_runtime/control/http_app.py", - "title": "app.get", - "content": "fastapi http app.get", - "start_line": 38, - "end_line": 42, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "relations": [ - { - "path": "src/plba/bootstrap.py", - "metadata": { - "edge_id": "4eaeec4ac55a59d5f66fd01c4754955f8fedaf4bc3df13fa769b352c7bfaacbb", - "edge_type": "calls", - "src_symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "src_qname": "create_runtime", - "dst_symbol_id": null, - "dst_ref": "runtime.add_config_file", - "resolution": "partial", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - }, - "content": "create_runtime calls runtime.add_config_file" - }, - { - "path": "src/plba/bootstrap.py", - "metadata": { - "edge_id": "45516c79ff358dbf9b650a081668df0f66d2fe989300f985a1a78be6be166f8f", - "edge_type": "reads_attr", - "src_symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "src_qname": "create_runtime", - "dst_symbol_id": null, - "dst_ref": "runtime.register_module", - "resolution": "partial", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - }, - "content": "create_runtime reads_attr runtime.register_module" - }, - { - "path": "src/plba/bootstrap.py", - "metadata": { - "edge_id": "0adba17984f850ea1608c9e734d2dd5c325cfde3a8133123aa239e44935ad18e", - "edge_type": "instantiates", - "src_symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "src_qname": "create_runtime", - "dst_symbol_id": "27158ca220022eeb5083c6addf8a50775d45f7161284fd60aac48410105f4b98", - "dst_ref": "RuntimeManager", - "resolution": "resolved", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - }, - "content": "create_runtime instantiates RuntimeManager" - }, - { - "path": "src/plba/bootstrap.py", - "metadata": { - "edge_id": "ab6003c3441addc1ba1b81edeca009165559f652f6b2cf424e5ae61b1f617de8", - "edge_type": "calls", - "src_symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "src_qname": "create_runtime", - "dst_symbol_id": null, - "dst_ref": "runtime.register_module", - "resolution": "partial", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - }, - "content": "create_runtime calls runtime.register_module" - }, - { - "path": "src/plba/bootstrap.py", - "metadata": { - "edge_id": "2678250030b9ce47a3b3b55fac7897ac530367edc8374ac9d5e6ecafb1e483f0", - "edge_type": "calls", - "src_symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "src_qname": "create_runtime", - "dst_symbol_id": null, - "dst_ref": "runtime.control_plane.register_channel", - "resolution": "partial", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - }, - "content": "create_runtime calls runtime.control_plane.register_channel" - }, - { - "path": "src/plba/bootstrap.py", - "metadata": { - "edge_id": "30d4e8aae984ab84d523e80d02f1caeda52d547fa3d2aa47be8845931cabbca2", - "edge_type": "reads_attr", - "src_symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "src_qname": "create_runtime", - "dst_symbol_id": null, - "dst_ref": "runtime.add_config_file", - "resolution": "partial", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - }, - "content": "create_runtime reads_attr runtime.add_config_file" - } - ], - "entrypoints": [ - { - "path": "src/app_runtime/control/http_app.py", - "title": "app.get", - "start_line": 31, - "end_line": 34, - "http_method": "GET", - "route_path": "", - "handler_symbol": "", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "route_or_command": "app.get", - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "title": "app.get", - "start_line": 38, - "end_line": 42, - "http_method": "GET", - "route_path": "", - "handler_symbol": "", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "route_or_command": "app.get", - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "title": "app.post", - "start_line": 38, - "end_line": 42, - "http_method": "POST", - "route_path": "", - "handler_symbol": "", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "route_or_command": "app.post", - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "test_candidates": [], - "layer_outcomes": [ - { - "layer_id": "C1_SYMBOL_CATALOG", - "hit_count": 8, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C0_SOURCE_CHUNKS", - "hit_count": 8, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C4_SEMANTIC_ROLES", - "hit_count": 8, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C2_DEPENDENCY_GRAPH", - "hit_count": 6, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C3_ENTRYPOINTS", - "hit_count": 3, - "empty": false, - "fallback_used": false - } - ], - "missing_layers": [], - "raw_rows": [ - { - "path": "src/plba/__init__.py", - "content": "const create_runtime\ncreate_runtime = plba.bootstrap.create_runtime", - "layer": "C1_SYMBOL_CATALOG", - "title": "create_runtime", - "span_start": 1, - "span_end": 1, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": null, - "metadata": { - "symbol_id": "fa1e84f16c8c659bcd5448637386af4d15d431064e07714e34689ee64233cb51", - "qname": "create_runtime", - "kind": "const", - "signature": "create_runtime = plba.bootstrap.create_runtime", - "parent_symbol_id": null, - "package_or_module": "src.plba.__init__", - "is_test": false, - "blob_sha": "24e755ec8c249d14fb0e675b5dbf2b71ab91afb9c849897eebfa9feb2499e19d", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/bootstrap.py", - "content": "function create_runtime\ncreate_runtime(module)", - "layer": "C1_SYMBOL_CATALOG", - "title": "create_runtime", - "span_start": 8, - "span_end": 29, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": null, - "metadata": { - "symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "qname": "create_runtime", - "kind": "function", - "signature": "create_runtime(module)", - "parent_symbol_id": null, - "package_or_module": "src.plba.bootstrap", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/config/file_loader.py", - "content": "const annotations\nannotations = __future__.annotations", - "layer": "C1_SYMBOL_CATALOG", - "title": "annotations", - "span_start": 1, - "span_end": 1, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": null, - "metadata": { - "symbol_id": "5ed640ccec43a78659d50ec24f3717bf1144a182c22588f37456649ac6a4a815", - "qname": "annotations", - "kind": "const", - "signature": "annotations = __future__.annotations", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.config.file_loader", - "is_test": false, - "blob_sha": "1f19ffebde5e38e4be5a5d5a678059a0f36dedb8fb8b3e00ab395c67106a87ea", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/config/file_loader.py", - "content": "const json\nimport json", - "layer": "C1_SYMBOL_CATALOG", - "title": "json", - "span_start": 4, - "span_end": 4, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": null, - "metadata": { - "symbol_id": "bb9e2eaf992bfd050f7072d72eed87c55b1a4b001daa034a0f7c630a61bb1d78", - "qname": "json", - "kind": "const", - "signature": "import json", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.config.file_loader", - "is_test": false, - "blob_sha": "1f19ffebde5e38e4be5a5d5a678059a0f36dedb8fb8b3e00ab395c67106a87ea", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/config/file_loader.py", - "content": "const Path\nPath = pathlib.Path", - "layer": "C1_SYMBOL_CATALOG", - "title": "Path", - "span_start": 5, - "span_end": 5, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": null, - "metadata": { - "symbol_id": "b785967ed1fb83aa62d5724c6d6e9c6d2b1505523db39bd941cc39b48db48306", - "qname": "Path", - "kind": "const", - "signature": "Path = pathlib.Path", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.config.file_loader", - "is_test": false, - "blob_sha": "1f19ffebde5e38e4be5a5d5a678059a0f36dedb8fb8b3e00ab395c67106a87ea", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/config/file_loader.py", - "content": "const Any\nAny = typing.Any", - "layer": "C1_SYMBOL_CATALOG", - "title": "Any", - "span_start": 6, - "span_end": 6, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": null, - "metadata": { - "symbol_id": "8e330833b8073585db1c4b4315947c400683a23e4c3d2e2ccbcb260f347541b6", - "qname": "Any", - "kind": "const", - "signature": "Any = typing.Any", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.config.file_loader", - "is_test": false, - "blob_sha": "1f19ffebde5e38e4be5a5d5a678059a0f36dedb8fb8b3e00ab395c67106a87ea", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/config/file_loader.py", - "content": "const yaml\nimport yaml", - "layer": "C1_SYMBOL_CATALOG", - "title": "yaml", - "span_start": 8, - "span_end": 8, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": null, - "metadata": { - "symbol_id": "223502bbfc2b82aea662f7466403cc99a3cd44f1b0507d637cd674874f751e4f", - "qname": "yaml", - "kind": "const", - "signature": "import yaml", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.config.file_loader", - "is_test": false, - "blob_sha": "1f19ffebde5e38e4be5a5d5a678059a0f36dedb8fb8b3e00ab395c67106a87ea", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/config/file_loader.py", - "content": "const hashlib\nimport hashlib", - "layer": "C1_SYMBOL_CATALOG", - "title": "hashlib", - "span_start": 3, - "span_end": 3, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": null, - "metadata": { - "symbol_id": "e7375824bd473da3d73d316d22e3cb6428930e2db1ffbd900ce5a8b88427bf05", - "qname": "hashlib", - "kind": "const", - "signature": "import hashlib", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.config.file_loader", - "is_test": false, - "blob_sha": "1f19ffebde5e38e4be5a5d5a678059a0f36dedb8fb8b3e00ab395c67106a87ea", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/__init__.py", - "content": "from plba.bootstrap import create_runtime\nfrom plba.config import ConfigFileLoader, FileConfigProvider\nfrom plba.control import ControlActionSet, ControlChannel, ControlPlaneService, HttpControlChannel\nfrom plba.contracts import (\n ApplicationModule,\n ConfigProvider,\n HealthContributor,\n TraceContext,\n TraceContextRecord,\n TraceLogMessage,\n TraceTransport,\n Worker,\n WorkerHealth,\n WorkerStatus,\n)\nfrom plba.core import ConfigurationManager, RuntimeManager, ServiceContainer\nfrom plba.health import HealthRegistry\nfrom plba.logging import LogManager\nfrom plba.queue import InMemoryTaskQueue\nfrom plba.tracing import MySqlTraceTransport, NoOpTraceTransport, TraceService\nfrom plba.workflow import (\n StepResult,\n WorkflowContext,\n WorkflowDefinition,\n WorkflowEngine,\n WorkflowEngineHooks,\n WorkflowNode,\n WorkflowRuntimeFactory,\n WorkflowStep,\n)\nfrom plba.workers import WorkerSupervisor\n\n__all__ = [\n \"ApplicationModule\",\n \"ConfigFileLoader\",\n \"ConfigProvider\",\n \"ConfigurationManager\",\n \"ControlActionSet\",\n \"ControlChannel\",\n \"ControlPlaneService\",\n \"create_runtime\",\n \"FileConfigProvider\",\n \"HealthContributor\",\n \"HealthRegistry\",\n \"HttpControlChannel\",\n \"InMemoryTaskQueue\",\n \"LogManager\",\n \"MySqlTraceTransport\",\n \"NoOpTraceTransport\",\n \"RuntimeManager\",\n \"ServiceContainer\",\n \"TraceContext\",\n \"TraceContextRecord\",\n \"TraceLogMessage\",\n \"TraceService\",\n \"TraceTransport\",\n \"StepResult\",\n \"Worker\",\n \"WorkerHealth\",\n \"WorkerStatus\",\n \"WorkflowContext\",\n \"WorkflowDefinition\",\n \"WorkflowEngine\",\n \"WorkflowEngineHooks\",\n \"WorkflowNode\",\n \"WorkflowRuntimeFactory\",\n \"WorkflowStep\",\n \"WorkerSupervisor\",\n]", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/plba/__init__.py:1-69", - "span_start": 1, - "span_end": 69, - "lexical_rank": 6, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": null, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.plba.__init__", - "is_test": false, - "blob_sha": "24e755ec8c249d14fb0e675b5dbf2b71ab91afb9c849897eebfa9feb2499e19d", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/bootstrap.py", - "content": "def create_runtime(\n module: ApplicationModule,\n *,\n config_path: str | None = None,\n enable_http_control: bool = False,\n control_host: str = \"127.0.0.1\",\n control_port: int = 8080,\n control_timeout: int = 5,\n) -> RuntimeManager:\n runtime = RuntimeManager()\n if config_path is not None:\n runtime.add_config_file(config_path)\n if enable_http_control:\n runtime.control_plane.register_channel(\n HttpControlChannel(\n host=control_host,\n port=control_port,\n timeout=control_timeout,\n )\n )\n runtime.register_module(module)\n return runtime", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/plba/bootstrap.py:create_runtime", - "span_start": 8, - "span_end": 29, - "lexical_rank": 6, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": null, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.plba.bootstrap", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/config/__init__.py", - "content": "from app_runtime.config.file_loader import ConfigFileLoader\nfrom app_runtime.config.providers import FileConfigProvider\n\n__all__ = [\"ConfigFileLoader\", \"FileConfigProvider\"]", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/config/__init__.py:1-4", - "span_start": 1, - "span_end": 4, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": null, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.app_runtime.config.__init__", - "is_test": false, - "blob_sha": "612918029820a2a983330ec92256142b55b9de4bdf3399ece18e2a02dbad9729", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/config/file_loader.py", - "content": "class ConfigFileLoader:\n def __init__(self, path: str | Path) -> None:\n self.path = Path(path)\n self.config: Any = None\n self.last_valid_config: Any = None\n self._last_seen_hash: str | None = None\n\n def read_text(self) -> str:\n return self.path.read_text(encoding=\"utf-8\")\n\n def parse(self, data: str) -> Any:\n suffix = self.path.suffix.lower()\n if suffix in {\".yml\", \".yaml\"}:\n return yaml.safe_load(data)\n return json.loads(data)\n\n def load_sync(self) -> Any:\n data = self.read_text()\n parsed = self.parse(data)\n self.config = parsed\n self.last_valid_config = parsed\n self._last_seen_hash = self._calculate_hash(data)\n return parsed\n\n def load_if_changed(self) -> tuple[bool, Any]:\n data = self.read_text()\n current_hash = self._calculate_hash(data)\n if current_hash == self._last_seen_hash:\n return False, self.config\n parsed = self.parse(data)\n self.config = parsed\n self.last_valid_config = parsed\n self._last_seen_hash = current_hash\n return True, parsed\n\n @staticmethod\n def _calculate_hash(data: str) -> str:\n return hashlib.sha256(data.encode(\"utf-8\")).hexdigest()", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/config/file_loader.py:ConfigFileLoader", - "span_start": 11, - "span_end": 48, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": null, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.config.file_loader", - "is_test": false, - "blob_sha": "1f19ffebde5e38e4be5a5d5a678059a0f36dedb8fb8b3e00ab395c67106a87ea", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/config/providers.py", - "content": "class FileConfigProvider(ConfigProvider):\n def __init__(self, path: str | Path) -> None:\n self._loader = ConfigFileLoader(path)\n\n @property\n def loader(self) -> ConfigFileLoader:\n return self._loader\n\n def load(self) -> dict[str, Any]:\n config = self._loader.load_sync()\n if not isinstance(config, dict):\n raise TypeError(\"Config root must be a mapping\")\n return dict(config)", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/config/providers.py:FileConfigProvider", - "span_start": 10, - "span_end": 22, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": null, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.config.providers", - "is_test": false, - "blob_sha": "8c53ca0122d6df6c5763bca15e99434bb4daebd5a618b8fc927e9ae90b022e64", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/contracts/__init__.py", - "content": "__all__: list[str] = []", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/__init__.py:1-1", - "span_start": 1, - "span_end": 1, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": null, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.app_runtime.__init__", - "is_test": false, - "blob_sha": "8eea9df4f6d7b38ca0e39ccc27b04700e3d08dbeec8046d613d22706d19985fa", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/contracts/application.py", - "content": "class ApplicationModule(ABC):\n @property\n @abstractmethod\n def name(self) -> str:\n \"\"\"Module name used for runtime status and diagnostics.\"\"\"\n\n @abstractmethod\n def register(self, registry: ModuleRegistry) -> None:\n \"\"\"Register workers, services, and health contributors.\"\"\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/contracts/application.py:ApplicationModule", - "span_start": 8, - "span_end": 16, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": null, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.contracts.application", - "is_test": false, - "blob_sha": "197c35634dca49c352ce3f230295a485fbffb672ce7bb8c08e752bfdf61e7fa4", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/__init__.py", - "content": "__all__: list[str] = []", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/__init__.py:1-1", - "span_start": 1, - "span_end": 1, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": null, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.app_runtime.__init__", - "is_test": false, - "blob_sha": "8eea9df4f6d7b38ca0e39ccc27b04700e3d08dbeec8046d613d22706d19985fa", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_runner.py", - "content": "UvicornThreadRunner\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (24)", - "layer": "C4_SEMANTIC_ROLES", - "title": "UvicornThreadRunner", - "span_start": 10, - "span_end": 61, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 11, - "layer_rank": 2, - "distance": null, - "metadata": { - "symbol_id": "fd55630045a02100df8877ac27d951ee08617d4598764394d48cb51fe067476a", - "symbol_name": "UvicornThreadRunner", - "qname": "UvicornThreadRunner", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 24, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "3779fdd2878b770e789a35bb2a89c9d79f13b61c26d7db1b3b683f9bb9e1623f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/persistence/workflow_persistence.py", - "content": "WorkflowPersistence\nrole: pipeline_stage\n\nResponsibilities:\n- orchestrates role-like calls (2)\n- reads and writes state attributes\n- participates in dataflow slices (16)", - "layer": "C4_SEMANTIC_ROLES", - "title": "WorkflowPersistence", - "span_start": 8, - "span_end": 54, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 15, - "layer_rank": 2, - "distance": null, - "metadata": { - "symbol_id": "7bd01ee45cf31f2d5c2e3e51656254860ac785d10cef9e0852cd4fba90857bae", - "symbol_name": "WorkflowPersistence", - "qname": "WorkflowPersistence", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 16, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "80e9410ddc639789b4353c2a1a757ba8d0d5b5bb6075b0b263b61551f04ae1f0", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (10)", - "layer": "C4_SEMANTIC_ROLES", - "title": "HttpControlChannel", - "span_start": 12, - "span_end": 57, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 21, - "layer_rank": 2, - "distance": null, - "metadata": { - "symbol_id": "1c9fbdc24819e5604c26ea55428a74310f03a03e1af197ed84846af61e42fdb0", - "symbol_name": "HttpControlChannel", - "qname": "HttpControlChannel", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 10, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/queue/in_memory.py", - "content": "InMemoryTaskQueue\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (9)", - "layer": "C4_SEMANTIC_ROLES", - "title": "InMemoryTaskQueue", - "span_start": 9, - "span_end": 38, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 22, - "layer_rank": 2, - "distance": null, - "metadata": { - "symbol_id": "2da04cb94544a3bcbf0943a95ad4bdd8710bcafaa32a02fd0e4de2178dcf3533", - "symbol_name": "InMemoryTaskQueue", - "qname": "InMemoryTaskQueue", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 9, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "58f0cc001ccda0eee4c6bc32ed83bd05eafd6b6644f1e8b4aa9eed3103db73dc", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/config/file_loader.py", - "content": "ConfigFileLoader\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (8)", - "layer": "C4_SEMANTIC_ROLES", - "title": "ConfigFileLoader", - "span_start": 11, - "span_end": 48, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 23, - "layer_rank": 2, - "distance": null, - "metadata": { - "symbol_id": "a8474eca8b6e9dc86ae67ed68b16fa5fb639ef08739c053e7b7195489765667f", - "symbol_name": "ConfigFileLoader", - "qname": "ConfigFileLoader", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 8, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "1f19ffebde5e38e4be5a5d5a678059a0f36dedb8fb8b3e00ab395c67106a87ea", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workers/supervisor.py", - "content": "WorkerSupervisor\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (6)", - "layer": "C4_SEMANTIC_ROLES", - "title": "WorkerSupervisor", - "span_start": 10, - "span_end": 59, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 25, - "layer_rank": 2, - "distance": null, - "metadata": { - "symbol_id": "c17b44e8d9e97d490989b21fa67d7c346cdda8a0472e4c41fb243c8846faa124", - "symbol_name": "WorkerSupervisor", - "qname": "WorkerSupervisor", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 6, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "77609d9d5927171cce7fc3a54897c183fd63068710c6362029b700937aae5eee", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/engine/workflow_engine.py", - "content": "WorkflowEngine\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (6)", - "layer": "C4_SEMANTIC_ROLES", - "title": "WorkflowEngine", - "span_start": 10, - "span_end": 86, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 25, - "layer_rank": 2, - "distance": null, - "metadata": { - "symbol_id": "57ec0a9f11c542c78e008684a888397e8d9ef4223671acb2567e631a0cbc70b4", - "symbol_name": "WorkflowEngine", - "qname": "WorkflowEngine", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 6, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "1057136e58a325cd5ab6f4e265d15665fb6a711b7022d9fab52a1a290afa2368", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/store.py", - "content": "TraceContextStore\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (6)", - "layer": "C4_SEMANTIC_ROLES", - "title": "TraceContextStore", - "span_start": 15, - "span_end": 52, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 25, - "layer_rank": 2, - "distance": null, - "metadata": { - "symbol_id": "b2dad4fbe16ffb11b58deba311c7739955c39d59f291b22181f33e9c8cce4059", - "symbol_name": "TraceContextStore", - "qname": "TraceContextStore", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 6, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "d369554f08fc92039c6edd5a2a1e73b23901533e8974459170bbd9347d263dc5", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/bootstrap.py", - "content": "create_runtime calls runtime.add_config_file", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "create_runtime:calls", - "span_start": 19, - "span_end": 19, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": null, - "metadata": { - "edge_id": "4eaeec4ac55a59d5f66fd01c4754955f8fedaf4bc3df13fa769b352c7bfaacbb", - "edge_type": "calls", - "src_symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "src_qname": "create_runtime", - "dst_symbol_id": null, - "dst_ref": "runtime.add_config_file", - "resolution": "partial", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/bootstrap.py", - "content": "create_runtime reads_attr runtime.register_module", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "create_runtime:reads_attr", - "span_start": 28, - "span_end": 28, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": null, - "metadata": { - "edge_id": "45516c79ff358dbf9b650a081668df0f66d2fe989300f985a1a78be6be166f8f", - "edge_type": "reads_attr", - "src_symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "src_qname": "create_runtime", - "dst_symbol_id": null, - "dst_ref": "runtime.register_module", - "resolution": "partial", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/bootstrap.py", - "content": "create_runtime instantiates RuntimeManager", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "create_runtime:instantiates", - "span_start": 17, - "span_end": 17, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": null, - "metadata": { - "edge_id": "0adba17984f850ea1608c9e734d2dd5c325cfde3a8133123aa239e44935ad18e", - "edge_type": "instantiates", - "src_symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "src_qname": "create_runtime", - "dst_symbol_id": "27158ca220022eeb5083c6addf8a50775d45f7161284fd60aac48410105f4b98", - "dst_ref": "RuntimeManager", - "resolution": "resolved", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/bootstrap.py", - "content": "create_runtime calls runtime.register_module", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "create_runtime:calls", - "span_start": 28, - "span_end": 28, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": null, - "metadata": { - "edge_id": "ab6003c3441addc1ba1b81edeca009165559f652f6b2cf424e5ae61b1f617de8", - "edge_type": "calls", - "src_symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "src_qname": "create_runtime", - "dst_symbol_id": null, - "dst_ref": "runtime.register_module", - "resolution": "partial", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/bootstrap.py", - "content": "create_runtime calls runtime.control_plane.register_channel", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "create_runtime:calls", - "span_start": 21, - "span_end": 27, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": null, - "metadata": { - "edge_id": "2678250030b9ce47a3b3b55fac7897ac530367edc8374ac9d5e6ecafb1e483f0", - "edge_type": "calls", - "src_symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "src_qname": "create_runtime", - "dst_symbol_id": null, - "dst_ref": "runtime.control_plane.register_channel", - "resolution": "partial", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/bootstrap.py", - "content": "create_runtime reads_attr runtime.add_config_file", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "create_runtime:reads_attr", - "span_start": 19, - "span_end": 19, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": null, - "metadata": { - "edge_id": "30d4e8aae984ab84d523e80d02f1caeda52d547fa3d2aa47be8845931cabbca2", - "edge_type": "reads_attr", - "src_symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "src_qname": "create_runtime", - "dst_symbol_id": null, - "dst_ref": "runtime.add_config_file", - "resolution": "partial", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": null, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": null, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": null, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "retrieval_report": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "vector", - "C0_SOURCE_CHUNKS": "vector", - "C4_SEMANTIC_ROLES": "vector", - "C2_DEPENDENCY_GRAPH": "vector", - "C3_ENTRYPOINTS": "vector" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 8, - "C4_SEMANTIC_ROLES": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C3_ENTRYPOINTS": 6 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [] - }, - "C4_SEMANTIC_ROLES": { - "path_scope": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [] - } - }, - "fallback": { - "used": false, - "reason": null - }, - "retrieval_by_layer_ms": { - "C1_SYMBOL_CATALOG": 49, - "C0_SOURCE_CHUNKS": 24, - "C4_SEMANTIC_ROLES": 19, - "C2_DEPENDENCY_GRAPH": 49, - "C3_ENTRYPOINTS": 17 - } - } - }, - "diagnostics": { - "intent_correct": null, - "target_found": true, - "layers_used": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_sufficient": true, - "answer_mode": "normal", - "resolved_target": "create_runtime", - "answer_policy_branch": "normal_answer", - "decision_reason": "evidence_sufficient", - "router_result": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "retrieval_profile": "code", - "sub_intent": "EXPLAIN", - "path_scope": [], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "symbol_resolution_status": "resolved" - }, - "retrieval_request": { - "rag_session_id": "7d11da21-faa0-4cea-aede-aeabe069164c", - "query": "Что делает функция create_runtime?", - "sub_intent": "EXPLAIN", - "path_scope": [], - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "per_layer_outcome": [ - { - "layer_id": "C1_SYMBOL_CATALOG", - "hit_count": 8, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C0_SOURCE_CHUNKS", - "hit_count": 8, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C4_SEMANTIC_ROLES", - "hit_count": 8, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C2_DEPENDENCY_GRAPH", - "hit_count": 6, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C3_ENTRYPOINTS", - "hit_count": 3, - "empty": false, - "fallback_used": false - } - ], - "empty_layers": [], - "evidence_gate_decision": { - "sufficient": true, - "failure_reasons": [], - "evidence_count": 33 - }, - "evidence_gate_input": { - "resolved_target": "create_runtime", - "sub_intent": "EXPLAIN", - "target_type": "symbol", - "evidence_count": 33, - "code_chunk_count": 33, - "entrypoint_count": 3, - "relation_count": 6, - "test_evidence_count": 0, - "symbol_resolution_status": "resolved", - "path_scope": [] - }, - "post_evidence_gate": { - "input": { - "answer_mode": "normal", - "degraded_message": "", - "resolved_target": "create_runtime", - "draft_answer_preview": "Функция `create_runtime` определена в модуле `src/plba/bootstrap.py`. Она создаёт и настраивает экземпляр `RuntimeManager`, регистрируя модуль приложения и, при необходимости, конфигурационные файлы и HTTP-канал управления.\n\nОсновные действия функции:\n- Инициализирует объект `RuntimeManager`.\n- Если", - "repair_candidate": true - }, - "output": { - "passed": true, - "action": "return", - "reasons": [], - "repair_used": false, - "final_answer_preview": "Функция `create_runtime` определена в модуле `src/plba/bootstrap.py`. Она создаёт и настраивает экземпляр `RuntimeManager`, регистрируя модуль приложения и, при необходимости, конфигурационные файлы и HTTP-канал управления.\n\nОсновные действия функции:\n- Инициализирует объект `RuntimeManager`.\n- Если" - } - }, - "failure_reasons": [], - "timings_ms": { - "router": 1, - "retrieval": 161, - "pre_evidence_gate": 1, - "llm": 4445, - "post_evidence_gate": 1 - } - }, - "rag_rows": [ - { - "path": "src/plba/__init__.py", - "content": "const create_runtime\ncreate_runtime = plba.bootstrap.create_runtime", - "layer": "C1_SYMBOL_CATALOG", - "title": "create_runtime", - "span_start": 1, - "span_end": 1, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "fa1e84f16c8c659bcd5448637386af4d15d431064e07714e34689ee64233cb51", - "qname": "create_runtime", - "kind": "const", - "signature": "create_runtime = plba.bootstrap.create_runtime", - "parent_symbol_id": null, - "package_or_module": "src.plba.__init__", - "is_test": false, - "blob_sha": "24e755ec8c249d14fb0e675b5dbf2b71ab91afb9c849897eebfa9feb2499e19d", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/bootstrap.py", - "content": "function create_runtime\ncreate_runtime(module)", - "layer": "C1_SYMBOL_CATALOG", - "title": "create_runtime", - "span_start": 8, - "span_end": 29, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "qname": "create_runtime", - "kind": "function", - "signature": "create_runtime(module)", - "parent_symbol_id": null, - "package_or_module": "src.plba.bootstrap", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/config/file_loader.py", - "content": "const annotations\nannotations = __future__.annotations", - "layer": "C1_SYMBOL_CATALOG", - "title": "annotations", - "span_start": 1, - "span_end": 1, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "5ed640ccec43a78659d50ec24f3717bf1144a182c22588f37456649ac6a4a815", - "qname": "annotations", - "kind": "const", - "signature": "annotations = __future__.annotations", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.config.file_loader", - "is_test": false, - "blob_sha": "1f19ffebde5e38e4be5a5d5a678059a0f36dedb8fb8b3e00ab395c67106a87ea", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/config/file_loader.py", - "content": "const json\nimport json", - "layer": "C1_SYMBOL_CATALOG", - "title": "json", - "span_start": 4, - "span_end": 4, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "bb9e2eaf992bfd050f7072d72eed87c55b1a4b001daa034a0f7c630a61bb1d78", - "qname": "json", - "kind": "const", - "signature": "import json", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.config.file_loader", - "is_test": false, - "blob_sha": "1f19ffebde5e38e4be5a5d5a678059a0f36dedb8fb8b3e00ab395c67106a87ea", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/config/file_loader.py", - "content": "const Path\nPath = pathlib.Path", - "layer": "C1_SYMBOL_CATALOG", - "title": "Path", - "span_start": 5, - "span_end": 5, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "b785967ed1fb83aa62d5724c6d6e9c6d2b1505523db39bd941cc39b48db48306", - "qname": "Path", - "kind": "const", - "signature": "Path = pathlib.Path", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.config.file_loader", - "is_test": false, - "blob_sha": "1f19ffebde5e38e4be5a5d5a678059a0f36dedb8fb8b3e00ab395c67106a87ea", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/config/file_loader.py", - "content": "const Any\nAny = typing.Any", - "layer": "C1_SYMBOL_CATALOG", - "title": "Any", - "span_start": 6, - "span_end": 6, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "8e330833b8073585db1c4b4315947c400683a23e4c3d2e2ccbcb260f347541b6", - "qname": "Any", - "kind": "const", - "signature": "Any = typing.Any", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.config.file_loader", - "is_test": false, - "blob_sha": "1f19ffebde5e38e4be5a5d5a678059a0f36dedb8fb8b3e00ab395c67106a87ea", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/config/file_loader.py", - "content": "const yaml\nimport yaml", - "layer": "C1_SYMBOL_CATALOG", - "title": "yaml", - "span_start": 8, - "span_end": 8, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "223502bbfc2b82aea662f7466403cc99a3cd44f1b0507d637cd674874f751e4f", - "qname": "yaml", - "kind": "const", - "signature": "import yaml", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.config.file_loader", - "is_test": false, - "blob_sha": "1f19ffebde5e38e4be5a5d5a678059a0f36dedb8fb8b3e00ab395c67106a87ea", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/config/file_loader.py", - "content": "const hashlib\nimport hashlib", - "layer": "C1_SYMBOL_CATALOG", - "title": "hashlib", - "span_start": 3, - "span_end": 3, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "e7375824bd473da3d73d316d22e3cb6428930e2db1ffbd900ce5a8b88427bf05", - "qname": "hashlib", - "kind": "const", - "signature": "import hashlib", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.config.file_loader", - "is_test": false, - "blob_sha": "1f19ffebde5e38e4be5a5d5a678059a0f36dedb8fb8b3e00ab395c67106a87ea", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/__init__.py", - "content": "from plba.bootstrap import create_runtime\nfrom plba.config import ConfigFileLoader, FileConfigProvider\nfrom plba.control import ControlActionSet, ControlChannel, ControlPlaneService, HttpControlChannel\nfrom plba.contracts import (\n ApplicationModule,\n ConfigProvider,\n HealthContributor,\n TraceContext,\n TraceContextRecord,\n TraceLogMessage,\n TraceTransport,\n Worker,\n WorkerHealth,\n WorkerStatus,\n)\nfrom plba.core import ConfigurationManager, RuntimeManager, ServiceContainer\nfrom plba.health import HealthRegistry\nfrom plba.logging import LogManager\nfrom plba.queue import InMemoryTaskQueue\nfrom plba.tracing import MySqlTraceTransport, NoOpTraceTransport, TraceService\nfrom plba.workflow import (\n StepResult,\n WorkflowContext,\n WorkflowDefinition,\n WorkflowEngine,\n WorkflowEngineHooks,\n WorkflowNode,\n WorkflowRuntimeFactory,\n WorkflowStep,\n)\nfrom plba.workers import WorkerSupervisor\n\n__all__ = [\n \"ApplicationModule\",\n \"ConfigFileLoader\",\n \"ConfigProvider\",\n \"ConfigurationManager\",\n \"ControlActionSet\",\n \"ControlChannel\",\n \"ControlPlaneService\",\n \"create_runtime\",\n \"FileConfigProvider\",\n \"HealthContributor\",\n \"HealthRegistry\",\n \"HttpControlChannel\",\n \"InMemoryTaskQueue\",\n \"LogManager\",\n \"MySqlTraceTransport\",\n \"NoOpTraceTransport\",\n \"RuntimeManager\",\n \"ServiceContainer\",\n \"TraceContext\",\n \"TraceContextRecord\",\n \"TraceLogMessage\",\n \"TraceService\",\n \"TraceTransport\",\n \"StepResult\",\n \"Worker\",\n \"WorkerHealth\",\n \"WorkerStatus\",\n \"WorkflowContext\",\n \"WorkflowDefinition\",\n \"WorkflowEngine\",\n \"WorkflowEngineHooks\",\n \"WorkflowNode\",\n \"WorkflowRuntimeFactory\",\n \"WorkflowStep\",\n \"WorkerSupervisor\",\n]", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/plba/__init__.py:1-69", - "span_start": 1, - "span_end": 69, - "lexical_rank": 6, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.plba.__init__", - "is_test": false, - "blob_sha": "24e755ec8c249d14fb0e675b5dbf2b71ab91afb9c849897eebfa9feb2499e19d", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/bootstrap.py", - "content": "def create_runtime(\n module: ApplicationModule,\n *,\n config_path: str | None = None,\n enable_http_control: bool = False,\n control_host: str = \"127.0.0.1\",\n control_port: int = 8080,\n control_timeout: int = 5,\n) -> RuntimeManager:\n runtime = RuntimeManager()\n if config_path is not None:\n runtime.add_config_file(config_path)\n if enable_http_control:\n runtime.control_plane.register_channel(\n HttpControlChannel(\n host=control_host,\n port=control_port,\n timeout=control_timeout,\n )\n )\n runtime.register_module(module)\n return runtime", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/plba/bootstrap.py:create_runtime", - "span_start": 8, - "span_end": 29, - "lexical_rank": 6, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.plba.bootstrap", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/config/__init__.py", - "content": "from app_runtime.config.file_loader import ConfigFileLoader\nfrom app_runtime.config.providers import FileConfigProvider\n\n__all__ = [\"ConfigFileLoader\", \"FileConfigProvider\"]", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/config/__init__.py:1-4", - "span_start": 1, - "span_end": 4, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.app_runtime.config.__init__", - "is_test": false, - "blob_sha": "612918029820a2a983330ec92256142b55b9de4bdf3399ece18e2a02dbad9729", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/config/file_loader.py", - "content": "class ConfigFileLoader:\n def __init__(self, path: str | Path) -> None:\n self.path = Path(path)\n self.config: Any = None\n self.last_valid_config: Any = None\n self._last_seen_hash: str | None = None\n\n def read_text(self) -> str:\n return self.path.read_text(encoding=\"utf-8\")\n\n def parse(self, data: str) -> Any:\n suffix = self.path.suffix.lower()\n if suffix in {\".yml\", \".yaml\"}:\n return yaml.safe_load(data)\n return json.loads(data)\n\n def load_sync(self) -> Any:\n data = self.read_text()\n parsed = self.parse(data)\n self.config = parsed\n self.last_valid_config = parsed\n self._last_seen_hash = self._calculate_hash(data)\n return parsed\n\n def load_if_changed(self) -> tuple[bool, Any]:\n data = self.read_text()\n current_hash = self._calculate_hash(data)\n if current_hash == self._last_seen_hash:\n return False, self.config\n parsed = self.parse(data)\n self.config = parsed\n self.last_valid_config = parsed\n self._last_seen_hash = current_hash\n return True, parsed\n\n @staticmethod\n def _calculate_hash(data: str) -> str:\n return hashlib.sha256(data.encode(\"utf-8\")).hexdigest()", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/config/file_loader.py:ConfigFileLoader", - "span_start": 11, - "span_end": 48, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.config.file_loader", - "is_test": false, - "blob_sha": "1f19ffebde5e38e4be5a5d5a678059a0f36dedb8fb8b3e00ab395c67106a87ea", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/config/providers.py", - "content": "class FileConfigProvider(ConfigProvider):\n def __init__(self, path: str | Path) -> None:\n self._loader = ConfigFileLoader(path)\n\n @property\n def loader(self) -> ConfigFileLoader:\n return self._loader\n\n def load(self) -> dict[str, Any]:\n config = self._loader.load_sync()\n if not isinstance(config, dict):\n raise TypeError(\"Config root must be a mapping\")\n return dict(config)", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/config/providers.py:FileConfigProvider", - "span_start": 10, - "span_end": 22, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.config.providers", - "is_test": false, - "blob_sha": "8c53ca0122d6df6c5763bca15e99434bb4daebd5a618b8fc927e9ae90b022e64", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/contracts/__init__.py", - "content": "__all__: list[str] = []", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/__init__.py:1-1", - "span_start": 1, - "span_end": 1, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.app_runtime.__init__", - "is_test": false, - "blob_sha": "8eea9df4f6d7b38ca0e39ccc27b04700e3d08dbeec8046d613d22706d19985fa", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/contracts/application.py", - "content": "class ApplicationModule(ABC):\n @property\n @abstractmethod\n def name(self) -> str:\n \"\"\"Module name used for runtime status and diagnostics.\"\"\"\n\n @abstractmethod\n def register(self, registry: ModuleRegistry) -> None:\n \"\"\"Register workers, services, and health contributors.\"\"\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/contracts/application.py:ApplicationModule", - "span_start": 8, - "span_end": 16, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.contracts.application", - "is_test": false, - "blob_sha": "197c35634dca49c352ce3f230295a485fbffb672ce7bb8c08e752bfdf61e7fa4", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/__init__.py", - "content": "__all__: list[str] = []", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/__init__.py:1-1", - "span_start": 1, - "span_end": 1, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.app_runtime.__init__", - "is_test": false, - "blob_sha": "8eea9df4f6d7b38ca0e39ccc27b04700e3d08dbeec8046d613d22706d19985fa", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_runner.py", - "content": "UvicornThreadRunner\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (24)", - "layer": "C4_SEMANTIC_ROLES", - "title": "UvicornThreadRunner", - "span_start": 10, - "span_end": 61, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 11, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "fd55630045a02100df8877ac27d951ee08617d4598764394d48cb51fe067476a", - "symbol_name": "UvicornThreadRunner", - "qname": "UvicornThreadRunner", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 24, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "3779fdd2878b770e789a35bb2a89c9d79f13b61c26d7db1b3b683f9bb9e1623f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/persistence/workflow_persistence.py", - "content": "WorkflowPersistence\nrole: pipeline_stage\n\nResponsibilities:\n- orchestrates role-like calls (2)\n- reads and writes state attributes\n- participates in dataflow slices (16)", - "layer": "C4_SEMANTIC_ROLES", - "title": "WorkflowPersistence", - "span_start": 8, - "span_end": 54, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 15, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "7bd01ee45cf31f2d5c2e3e51656254860ac785d10cef9e0852cd4fba90857bae", - "symbol_name": "WorkflowPersistence", - "qname": "WorkflowPersistence", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 16, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "80e9410ddc639789b4353c2a1a757ba8d0d5b5bb6075b0b263b61551f04ae1f0", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (10)", - "layer": "C4_SEMANTIC_ROLES", - "title": "HttpControlChannel", - "span_start": 12, - "span_end": 57, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 21, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "1c9fbdc24819e5604c26ea55428a74310f03a03e1af197ed84846af61e42fdb0", - "symbol_name": "HttpControlChannel", - "qname": "HttpControlChannel", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 10, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/queue/in_memory.py", - "content": "InMemoryTaskQueue\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (9)", - "layer": "C4_SEMANTIC_ROLES", - "title": "InMemoryTaskQueue", - "span_start": 9, - "span_end": 38, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 22, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "2da04cb94544a3bcbf0943a95ad4bdd8710bcafaa32a02fd0e4de2178dcf3533", - "symbol_name": "InMemoryTaskQueue", - "qname": "InMemoryTaskQueue", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 9, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "58f0cc001ccda0eee4c6bc32ed83bd05eafd6b6644f1e8b4aa9eed3103db73dc", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/config/file_loader.py", - "content": "ConfigFileLoader\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (8)", - "layer": "C4_SEMANTIC_ROLES", - "title": "ConfigFileLoader", - "span_start": 11, - "span_end": 48, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 23, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "a8474eca8b6e9dc86ae67ed68b16fa5fb639ef08739c053e7b7195489765667f", - "symbol_name": "ConfigFileLoader", - "qname": "ConfigFileLoader", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 8, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "1f19ffebde5e38e4be5a5d5a678059a0f36dedb8fb8b3e00ab395c67106a87ea", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workers/supervisor.py", - "content": "WorkerSupervisor\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (6)", - "layer": "C4_SEMANTIC_ROLES", - "title": "WorkerSupervisor", - "span_start": 10, - "span_end": 59, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 25, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "c17b44e8d9e97d490989b21fa67d7c346cdda8a0472e4c41fb243c8846faa124", - "symbol_name": "WorkerSupervisor", - "qname": "WorkerSupervisor", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 6, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "77609d9d5927171cce7fc3a54897c183fd63068710c6362029b700937aae5eee", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/engine/workflow_engine.py", - "content": "WorkflowEngine\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (6)", - "layer": "C4_SEMANTIC_ROLES", - "title": "WorkflowEngine", - "span_start": 10, - "span_end": 86, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 25, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "57ec0a9f11c542c78e008684a888397e8d9ef4223671acb2567e631a0cbc70b4", - "symbol_name": "WorkflowEngine", - "qname": "WorkflowEngine", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 6, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "1057136e58a325cd5ab6f4e265d15665fb6a711b7022d9fab52a1a290afa2368", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/store.py", - "content": "TraceContextStore\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (6)", - "layer": "C4_SEMANTIC_ROLES", - "title": "TraceContextStore", - "span_start": 15, - "span_end": 52, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 25, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "b2dad4fbe16ffb11b58deba311c7739955c39d59f291b22181f33e9c8cce4059", - "symbol_name": "TraceContextStore", - "qname": "TraceContextStore", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 6, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "d369554f08fc92039c6edd5a2a1e73b23901533e8974459170bbd9347d263dc5", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/bootstrap.py", - "content": "create_runtime calls runtime.add_config_file", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "create_runtime:calls", - "span_start": 19, - "span_end": 19, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "4eaeec4ac55a59d5f66fd01c4754955f8fedaf4bc3df13fa769b352c7bfaacbb", - "edge_type": "calls", - "src_symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "src_qname": "create_runtime", - "dst_symbol_id": null, - "dst_ref": "runtime.add_config_file", - "resolution": "partial", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/bootstrap.py", - "content": "create_runtime reads_attr runtime.register_module", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "create_runtime:reads_attr", - "span_start": 28, - "span_end": 28, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "45516c79ff358dbf9b650a081668df0f66d2fe989300f985a1a78be6be166f8f", - "edge_type": "reads_attr", - "src_symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "src_qname": "create_runtime", - "dst_symbol_id": null, - "dst_ref": "runtime.register_module", - "resolution": "partial", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/bootstrap.py", - "content": "create_runtime instantiates RuntimeManager", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "create_runtime:instantiates", - "span_start": 17, - "span_end": 17, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "0adba17984f850ea1608c9e734d2dd5c325cfde3a8133123aa239e44935ad18e", - "edge_type": "instantiates", - "src_symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "src_qname": "create_runtime", - "dst_symbol_id": "27158ca220022eeb5083c6addf8a50775d45f7161284fd60aac48410105f4b98", - "dst_ref": "RuntimeManager", - "resolution": "resolved", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/bootstrap.py", - "content": "create_runtime calls runtime.register_module", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "create_runtime:calls", - "span_start": 28, - "span_end": 28, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "ab6003c3441addc1ba1b81edeca009165559f652f6b2cf424e5ae61b1f617de8", - "edge_type": "calls", - "src_symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "src_qname": "create_runtime", - "dst_symbol_id": null, - "dst_ref": "runtime.register_module", - "resolution": "partial", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/bootstrap.py", - "content": "create_runtime calls runtime.control_plane.register_channel", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "create_runtime:calls", - "span_start": 21, - "span_end": 27, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "2678250030b9ce47a3b3b55fac7897ac530367edc8374ac9d5e6ecafb1e483f0", - "edge_type": "calls", - "src_symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "src_qname": "create_runtime", - "dst_symbol_id": null, - "dst_ref": "runtime.control_plane.register_channel", - "resolution": "partial", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/bootstrap.py", - "content": "create_runtime reads_attr runtime.add_config_file", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "create_runtime:reads_attr", - "span_start": 19, - "span_end": 19, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "30d4e8aae984ab84d523e80d02f1caeda52d547fa3d2aa47be8845931cabbca2", - "edge_type": "reads_attr", - "src_symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "src_qname": "create_runtime", - "dst_symbol_id": null, - "dst_ref": "runtime.add_config_file", - "resolution": "partial", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "validation": { - "passed": true, - "action": "return", - "reasons": [] - }, - "steps": [ - { - "step": "router", - "status": "completed", - "timings_ms": { - "router": 1 - }, - "output": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - } - }, - { - "step": "retrieval", - "status": "completed", - "timings_ms": { - "retrieval": 161 - }, - "output": { - "rag_count": 33, - "answer_path_rag_count": 33, - "resolved_symbol_status": "resolved", - "resolved_symbol": "create_runtime", - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "diagnostics": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "vector", - "C0_SOURCE_CHUNKS": "vector", - "C4_SEMANTIC_ROLES": "vector", - "C2_DEPENDENCY_GRAPH": "vector", - "C3_ENTRYPOINTS": "vector" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 8, - "C4_SEMANTIC_ROLES": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C3_ENTRYPOINTS": 6 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [] - }, - "C4_SEMANTIC_ROLES": { - "path_scope": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [] - } - }, - "fallback": { - "used": false, - "reason": null - }, - "retrieval_by_layer_ms": { - "C1_SYMBOL_CATALOG": 49, - "C0_SOURCE_CHUNKS": 24, - "C4_SEMANTIC_ROLES": 19, - "C2_DEPENDENCY_GRAPH": 49, - "C3_ENTRYPOINTS": 17 - } - } - }, - { - "step": "pre_evidence_gate", - "status": "passed", - "timings_ms": { - "pre_evidence_gate": 1 - }, - "input": { - "resolved_target": "create_runtime", - "sub_intent": "EXPLAIN", - "target_type": "symbol", - "evidence_count": 33, - "code_chunk_count": 33, - "entrypoint_count": 3, - "relation_count": 6, - "test_evidence_count": 0, - "symbol_resolution_status": "resolved", - "path_scope": [] - }, - "output": { - "passed": true, - "failure_reasons": [], - "degraded_message": "", - "evidence_count": 33 - } - }, - { - "step": "llm", - "status": "completed", - "timings_ms": { - "llm": 4445 - }, - "output": { - "prompt_name": "code_qa_explain_answer", - "answer_preview": "Функция `create_runtime` определена в модуле `src/plba/bootstrap.py`. Она создаёт и настраивает экземпляр `RuntimeManager`, регистрируя модуль приложения и, при необходимости, конфигурационные файлы и HTTP-канал управления.\n\nОсновные действия функции:\n- Инициализирует объект `RuntimeManager`.\n- Если", - "resolved_target": "create_runtime", - "answer_policy_branch": "normal_answer", - "decision_reason": "evidence_sufficient" - } - }, - { - "step": "post_evidence_gate", - "status": "passed", - "timings_ms": { - "post_evidence_gate": 1, - "post_evidence_gate_recheck": 0, - "repair": 0 - }, - "input": { - "answer_mode": "normal", - "degraded_message": "", - "resolved_target": "create_runtime", - "draft_answer_preview": "Функция `create_runtime` определена в модуле `src/plba/bootstrap.py`. Она создаёт и настраивает экземпляр `RuntimeManager`, регистрируя модуль приложения и, при необходимости, конфигурационные файлы и HTTP-канал управления.\n\nОсновные действия функции:\n- Инициализирует объект `RuntimeManager`.\n- Если", - "repair_candidate": true - }, - "output": { - "passed": true, - "action": "return", - "reasons": [], - "repair_used": false, - "final_answer_preview": "Функция `create_runtime` определена в модуле `src/plba/bootstrap.py`. Она создаёт и настраивает экземпляр `RuntimeManager`, регистрируя модуль приложения и, при необходимости, конфигурационные файлы и HTTP-канал управления.\n\nОсновные действия функции:\n- Инициализирует объект `RuntimeManager`.\n- Если" - } - } - ] - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/plba_full_chain_subintents_v3/20260312_174008/full_chain_plba_code_subintents_v2_plba-v2-explain-create-runtime.md b/tests/pipeline_setup_v3/test_results/plba_full_chain_subintents_v3/20260312_174008/full_chain_plba_code_subintents_v2_plba-v2-explain-create-runtime.md deleted file mode 100644 index e7b0f13..0000000 --- a/tests/pipeline_setup_v3/test_results/plba_full_chain_subintents_v3/20260312_174008/full_chain_plba_code_subintents_v2_plba-v2-explain-create-runtime.md +++ /dev/null @@ -1,305 +0,0 @@ -# plba-v2-explain-create-runtime - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_02_pipeline/full_chain_plba_code_subintents_v2.yaml -- runner: agent_runtime -- mode: full_chain -- passed: True - -## Query -Что делает функция create_runtime? - -## Actual -{ - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 33, - "llm_answer": "Функция `create_runtime` определена в модуле `src/plba/bootstrap.py`. Она создаёт и настраивает экземпляр `RuntimeManager`, регистрируя модуль приложения и, при необходимости, конфигурационные файлы и HTTP-канал управления.\n\nОсновные действия функции:\n- Инициализирует объект `RuntimeManager`.\n- Если указан путь к конфигурационному файлу (`config_path`), добавляет его в менеджер.\n- Если включено управление через HTTP (`enable_http_control`), регистрирует HTTP-канал управления в плоскости контроля.\n- Регистрирует модуль приложения в менеджере времени выполнения.\n- Возвращает настроенный объект `RuntimeManager`.\n\nВходные параметры:\n- `module`: экземпляр `ApplicationModule`.\n- `config_path`: опциональный путь к конфигурационному файлу.\n- `enable_http_control`: флаг включения HTTP-контроля.\n- `control_host`, `control_port`, `control_timeout`: параметры подключения для HTTP-канала управления.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "create_runtime" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] -} - -## Steps -[ - { - "step": "router", - "status": "completed", - "timings_ms": { - "router": 1 - }, - "output": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - } - }, - { - "step": "retrieval", - "status": "completed", - "timings_ms": { - "retrieval": 161 - }, - "output": { - "rag_count": 33, - "answer_path_rag_count": 33, - "resolved_symbol_status": "resolved", - "resolved_symbol": "create_runtime", - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "diagnostics": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "vector", - "C0_SOURCE_CHUNKS": "vector", - "C4_SEMANTIC_ROLES": "vector", - "C2_DEPENDENCY_GRAPH": "vector", - "C3_ENTRYPOINTS": "vector" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 8, - "C4_SEMANTIC_ROLES": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C3_ENTRYPOINTS": 6 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [] - }, - "C4_SEMANTIC_ROLES": { - "path_scope": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [] - } - }, - "fallback": { - "used": false, - "reason": null - }, - "retrieval_by_layer_ms": { - "C1_SYMBOL_CATALOG": 49, - "C0_SOURCE_CHUNKS": 24, - "C4_SEMANTIC_ROLES": 19, - "C2_DEPENDENCY_GRAPH": 49, - "C3_ENTRYPOINTS": 17 - } - } - }, - { - "step": "pre_evidence_gate", - "status": "passed", - "timings_ms": { - "pre_evidence_gate": 1 - }, - "input": { - "resolved_target": "create_runtime", - "sub_intent": "EXPLAIN", - "target_type": "symbol", - "evidence_count": 33, - "code_chunk_count": 33, - "entrypoint_count": 3, - "relation_count": 6, - "test_evidence_count": 0, - "symbol_resolution_status": "resolved", - "path_scope": [] - }, - "output": { - "passed": true, - "failure_reasons": [], - "degraded_message": "", - "evidence_count": 33 - } - }, - { - "step": "llm", - "status": "completed", - "timings_ms": { - "llm": 4445 - }, - "output": { - "prompt_name": "code_qa_explain_answer", - "answer_preview": "Функция `create_runtime` определена в модуле `src/plba/bootstrap.py`. Она создаёт и настраивает экземпляр `RuntimeManager`, регистрируя модуль приложения и, при необходимости, конфигурационные файлы и HTTP-канал управления.\n\nОсновные действия функции:\n- Инициализирует объект `RuntimeManager`.\n- Если", - "resolved_target": "create_runtime", - "answer_policy_branch": "normal_answer", - "decision_reason": "evidence_sufficient" - } - }, - { - "step": "post_evidence_gate", - "status": "passed", - "timings_ms": { - "post_evidence_gate": 1, - "post_evidence_gate_recheck": 0, - "repair": 0 - }, - "input": { - "answer_mode": "normal", - "degraded_message": "", - "resolved_target": "create_runtime", - "draft_answer_preview": "Функция `create_runtime` определена в модуле `src/plba/bootstrap.py`. Она создаёт и настраивает экземпляр `RuntimeManager`, регистрируя модуль приложения и, при необходимости, конфигурационные файлы и HTTP-канал управления.\n\nОсновные действия функции:\n- Инициализирует объект `RuntimeManager`.\n- Если", - "repair_candidate": true - }, - "output": { - "passed": true, - "action": "return", - "reasons": [], - "repair_used": false, - "final_answer_preview": "Функция `create_runtime` определена в модуле `src/plba/bootstrap.py`. Она создаёт и настраивает экземпляр `RuntimeManager`, регистрируя модуль приложения и, при необходимости, конфигурационные файлы и HTTP-канал управления.\n\nОсновные действия функции:\n- Инициализирует объект `RuntimeManager`.\n- Если" - } - } -] - -## Diagnostics -{ - "intent_correct": null, - "target_found": true, - "layers_used": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_sufficient": true, - "answer_mode": "normal", - "resolved_target": "create_runtime", - "answer_policy_branch": "normal_answer", - "decision_reason": "evidence_sufficient", - "router_result": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "retrieval_profile": "code", - "sub_intent": "EXPLAIN", - "path_scope": [], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "symbol_resolution_status": "resolved" - }, - "retrieval_request": { - "rag_session_id": "7d11da21-faa0-4cea-aede-aeabe069164c", - "query": "Что делает функция create_runtime?", - "sub_intent": "EXPLAIN", - "path_scope": [], - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "per_layer_outcome": [ - { - "layer_id": "C1_SYMBOL_CATALOG", - "hit_count": 8, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C0_SOURCE_CHUNKS", - "hit_count": 8, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C4_SEMANTIC_ROLES", - "hit_count": 8, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C2_DEPENDENCY_GRAPH", - "hit_count": 6, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C3_ENTRYPOINTS", - "hit_count": 3, - "empty": false, - "fallback_used": false - } - ], - "empty_layers": [], - "evidence_gate_decision": { - "sufficient": true, - "failure_reasons": [], - "evidence_count": 33 - }, - "evidence_gate_input": { - "resolved_target": "create_runtime", - "sub_intent": "EXPLAIN", - "target_type": "symbol", - "evidence_count": 33, - "code_chunk_count": 33, - "entrypoint_count": 3, - "relation_count": 6, - "test_evidence_count": 0, - "symbol_resolution_status": "resolved", - "path_scope": [] - }, - "post_evidence_gate": { - "input": { - "answer_mode": "normal", - "degraded_message": "", - "resolved_target": "create_runtime", - "draft_answer_preview": "Функция `create_runtime` определена в модуле `src/plba/bootstrap.py`. Она создаёт и настраивает экземпляр `RuntimeManager`, регистрируя модуль приложения и, при необходимости, конфигурационные файлы и HTTP-канал управления.\n\nОсновные действия функции:\n- Инициализирует объект `RuntimeManager`.\n- Если", - "repair_candidate": true - }, - "output": { - "passed": true, - "action": "return", - "reasons": [], - "repair_used": false, - "final_answer_preview": "Функция `create_runtime` определена в модуле `src/plba/bootstrap.py`. Она создаёт и настраивает экземпляр `RuntimeManager`, регистрируя модуль приложения и, при необходимости, конфигурационные файлы и HTTP-канал управления.\n\nОсновные действия функции:\n- Инициализирует объект `RuntimeManager`.\n- Если" - } - }, - "failure_reasons": [], - "timings_ms": { - "router": 1, - "retrieval": 161, - "pre_evidence_gate": 1, - "llm": 4445, - "post_evidence_gate": 1 - } -} - -## Mismatches -- none \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/plba_full_chain_subintents_v3/20260312_174008/full_chain_plba_code_subintents_v2_plba-v2-explain-local-http-channel.json b/tests/pipeline_setup_v3/test_results/plba_full_chain_subintents_v3/20260312_174008/full_chain_plba_code_subintents_v2_plba-v2-explain-local-http-channel.json deleted file mode 100644 index c4a2606..0000000 --- a/tests/pipeline_setup_v3/test_results/plba_full_chain_subintents_v3/20260312_174008/full_chain_plba_code_subintents_v2_plba-v2-explain-local-http-channel.json +++ /dev/null @@ -1,2216 +0,0 @@ -{ - "case_id": "plba-v2-explain-local-http-channel", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_02_pipeline/full_chain_plba_code_subintents_v2.yaml", - "runner": "agent_runtime", - "mode": "full_chain", - "query": "Почему в файле src/app_runtime/control/http_channel.py класс HttpControlChannel устроен так?", - "actual": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN_LOCAL", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 13, - "llm_answer": "Класс HttpControlChannel в файле http_channel.py наследует ControlChannel и реализует HTTP-канал управления. \nОн имеет конструктор с параметрами хост, порт и таймаут, где инициализирует runner (используя Uvicorn для запуска сервера) и factory для создания FastAPI-приложения. \nМетод start запускает сервер с приложением, используя фабрику и передавая обработчики здоровья и действий. \nМетоды _health_response и _action_response отвечают за обработку запросов к здоровью сервиса и выполнение действий соответственно. \nСтруктура класса ориентирована на создание отдельного HTTP-канала для управления приложением через HTTP-запросы.", - "answer_mode": "answered", - "path_scope": [ - "src/app_runtime/control/http_channel.py" - ], - "symbol_candidates": [ - "HttpControlChannel" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C2_DEPENDENCY_GRAPH" - ] - }, - "passed": true, - "mismatches": [], - "details": { - "query": "Почему в файле src/app_runtime/control/http_channel.py класс HttpControlChannel устроен так?", - "router_result": { - "schema_version": "1.1", - "intent": "CODE_QA", - "retrieval_profile": "code", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query_plan": { - "raw": "Почему в файле src/app_runtime/control/http_channel.py класс HttpControlChannel устроен так?", - "normalized": "Почему в файле src/app_runtime/control/http_channel.py класс HttpControlChannel устроен так?", - "sub_intent": "EXPLAIN_LOCAL", - "negations": [], - "expansions": [ - "file", - "HttpControlChannel" - ], - "keyword_hints": [ - "src/app_runtime/control/http_channel.py", - "HttpControlChannel" - ], - "path_hints": [ - "src/app_runtime/control/http_channel.py" - ], - "doc_scope_hints": [], - "symbol_candidates": [ - "HttpControlChannel" - ], - "symbol_kind_hint": "class", - "anchors": [ - { - "type": "FILE_PATH", - "value": "src/app_runtime/control/http_channel.py", - "source": "user_text", - "subtype": null, - "span": { - "start": 15, - "end": 54 - }, - "confidence": 0.95 - }, - { - "type": "SYMBOL", - "value": "HttpControlChannel", - "source": "user_text", - "subtype": null, - "span": { - "start": 61, - "end": 79 - }, - "confidence": 0.88 - }, - { - "type": "KEY_TERM", - "value": "файл", - "source": "user_text", - "subtype": null, - "span": { - "start": 9, - "end": 14 - }, - "confidence": 0.9 - }, - { - "type": "KEY_TERM", - "value": "класс", - "source": "user_text", - "subtype": null, - "span": { - "start": 55, - "end": 60 - }, - "confidence": 0.9 - } - ] - }, - "retrieval_spec": { - "domains": [ - "CODE" - ], - "layer_queries": [ - { - "layer_id": "C1_SYMBOL_CATALOG", - "top_k": 8 - }, - { - "layer_id": "C0_SOURCE_CHUNKS", - "top_k": 12 - }, - { - "layer_id": "C2_DEPENDENCY_GRAPH", - "top_k": 4 - } - ], - "filters": { - "test_policy": "EXCLUDE", - "path_scope": [ - "src/app_runtime/control/http_channel.py" - ], - "language": [ - "python" - ] - }, - "rerank_profile": "code" - }, - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - }, - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "HttpControlChannel", - "alternatives": [ - "ControlChannel", - "ControlActionSet", - "JSONResponse", - "HttpControlAppFactory", - "UvicornThreadRunner" - ], - "confidence": 0.99 - }, - "evidence_policy": { - "require_def": true, - "require_flow": false, - "require_spec": false, - "allow_answer_without_evidence": false - } - }, - "retrieval_request": { - "rag_session_id": "7d11da21-faa0-4cea-aede-aeabe069164c", - "query": "Почему в файле src/app_runtime/control/http_channel.py класс HttpControlChannel устроен так?", - "sub_intent": "EXPLAIN_LOCAL", - "path_scope": [ - "src/app_runtime/control/http_channel.py" - ], - "keyword_hints": [ - "src/app_runtime/control/http_channel.py", - "HttpControlChannel" - ], - "symbol_candidates": [ - "HttpControlChannel" - ], - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C2_DEPENDENCY_GRAPH" - ], - "retrieval_spec": { - "domains": [ - "CODE" - ], - "layer_queries": [ - { - "layer_id": "C1_SYMBOL_CATALOG", - "top_k": 8 - }, - { - "layer_id": "C0_SOURCE_CHUNKS", - "top_k": 12 - }, - { - "layer_id": "C2_DEPENDENCY_GRAPH", - "top_k": 4 - } - ], - "filters": { - "test_policy": "EXCLUDE", - "path_scope": [ - "src/app_runtime/control/http_channel.py" - ], - "language": [ - "python" - ] - }, - "rerank_profile": "code" - }, - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - }, - "query_plan": { - "raw": "Почему в файле src/app_runtime/control/http_channel.py класс HttpControlChannel устроен так?", - "normalized": "Почему в файле src/app_runtime/control/http_channel.py класс HttpControlChannel устроен так?", - "sub_intent": "EXPLAIN_LOCAL", - "negations": [], - "expansions": [ - "file", - "HttpControlChannel" - ], - "keyword_hints": [ - "src/app_runtime/control/http_channel.py", - "HttpControlChannel" - ], - "path_hints": [ - "src/app_runtime/control/http_channel.py" - ], - "doc_scope_hints": [], - "symbol_candidates": [ - "HttpControlChannel" - ], - "symbol_kind_hint": "class", - "anchors": [ - { - "type": "FILE_PATH", - "value": "src/app_runtime/control/http_channel.py", - "source": "user_text", - "subtype": null, - "span": { - "start": 15, - "end": 54 - }, - "confidence": 0.95 - }, - { - "type": "SYMBOL", - "value": "HttpControlChannel", - "source": "user_text", - "subtype": null, - "span": { - "start": 61, - "end": 79 - }, - "confidence": 0.88 - }, - { - "type": "KEY_TERM", - "value": "файл", - "source": "user_text", - "subtype": null, - "span": { - "start": 9, - "end": 14 - }, - "confidence": 0.9 - }, - { - "type": "KEY_TERM", - "value": "класс", - "source": "user_text", - "subtype": null, - "span": { - "start": 55, - "end": 60 - }, - "confidence": 0.9 - } - ] - } - }, - "retrieval_result": { - "target_symbol_candidates": [ - "ControlChannel", - "ControlActionSet", - "JSONResponse", - "HttpControlAppFactory", - "UvicornThreadRunner", - "HttpControlChannel", - "HttpControlChannel.__init__", - "HttpControlChannel.start" - ], - "resolved_symbol": "HttpControlChannel", - "symbol_resolution_status": "resolved", - "file_candidates": [ - "src/app_runtime/control/http_channel.py" - ], - "code_chunks": [ - { - "layer": "C1_SYMBOL_CATALOG", - "path": "src/app_runtime/control/http_channel.py", - "title": "ControlChannel", - "content": "const ControlChannel\nControlChannel = app_runtime.control.base.ControlChannel", - "start_line": 7, - "end_line": 7, - "metadata": { - "symbol_id": "6e69a934202b6e11891af8fb72b2033e8ae3071eb7577c64f5545b5b7ddfb51e", - "qname": "ControlChannel", - "kind": "const", - "signature": "ControlChannel = app_runtime.control.base.ControlChannel", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.control.http_channel", - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C1_SYMBOL_CATALOG", - "path": "src/app_runtime/control/http_channel.py", - "title": "ControlActionSet", - "content": "const ControlActionSet\nControlActionSet = app_runtime.control.base.ControlActionSet", - "start_line": 7, - "end_line": 7, - "metadata": { - "symbol_id": "2132a5717c57061e3488a1bf4d43650a60ea903a42278f4d494c014bc80d2df9", - "qname": "ControlActionSet", - "kind": "const", - "signature": "ControlActionSet = app_runtime.control.base.ControlActionSet", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.control.http_channel", - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C1_SYMBOL_CATALOG", - "path": "src/app_runtime/control/http_channel.py", - "title": "JSONResponse", - "content": "const JSONResponse\nJSONResponse = fastapi.responses.JSONResponse", - "start_line": 5, - "end_line": 5, - "metadata": { - "symbol_id": "238f600ea55013e25a3e1451f7fd65caabea125b314b89247900cdab5b801a23", - "qname": "JSONResponse", - "kind": "const", - "signature": "JSONResponse = fastapi.responses.JSONResponse", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.control.http_channel", - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C1_SYMBOL_CATALOG", - "path": "src/app_runtime/control/http_channel.py", - "title": "HttpControlAppFactory", - "content": "const HttpControlAppFactory\nHttpControlAppFactory = app_runtime.control.http_app.HttpControlAppFactory", - "start_line": 8, - "end_line": 8, - "metadata": { - "symbol_id": "9ee00379ee797cd2386e88a6e37dc69e3e31de9144fc4b95f0206cd1430e8983", - "qname": "HttpControlAppFactory", - "kind": "const", - "signature": "HttpControlAppFactory = app_runtime.control.http_app.HttpControlAppFactory", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.control.http_channel", - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C1_SYMBOL_CATALOG", - "path": "src/app_runtime/control/http_channel.py", - "title": "UvicornThreadRunner", - "content": "const UvicornThreadRunner\nUvicornThreadRunner = app_runtime.control.http_runner.UvicornThreadRunner", - "start_line": 9, - "end_line": 9, - "metadata": { - "symbol_id": "c6ee53f4ff75d5b34ee95854cb63bb3ecfa163023717cd969b8cba937a0cd3b3", - "qname": "UvicornThreadRunner", - "kind": "const", - "signature": "UvicornThreadRunner = app_runtime.control.http_runner.UvicornThreadRunner", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.control.http_channel", - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C1_SYMBOL_CATALOG", - "path": "src/app_runtime/control/http_channel.py", - "title": "HttpControlChannel", - "content": "class HttpControlChannel\nHttpControlChannel(ControlChannel)", - "start_line": 12, - "end_line": 57, - "metadata": { - "symbol_id": "1c9fbdc24819e5604c26ea55428a74310f03a03e1af197ed84846af61e42fdb0", - "qname": "HttpControlChannel", - "kind": "class", - "signature": "HttpControlChannel(ControlChannel)", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.control.http_channel", - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C1_SYMBOL_CATALOG", - "path": "src/app_runtime/control/http_channel.py", - "title": "HttpControlChannel.__init__", - "content": "method HttpControlChannel.__init__\n__init__(self, host, port, timeout)", - "start_line": 13, - "end_line": 17, - "metadata": { - "symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "qname": "HttpControlChannel.__init__", - "kind": "method", - "signature": "__init__(self, host, port, timeout)", - "parent_symbol_id": "HttpControlChannel", - "package_or_module": "src.app_runtime.control.http_channel", - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C1_SYMBOL_CATALOG", - "path": "src/app_runtime/control/http_channel.py", - "title": "HttpControlChannel.start", - "content": "method HttpControlChannel.start\nstart(self, actions)", - "start_line": 19, - "end_line": 22, - "metadata": { - "symbol_id": "d1933f04137f52535b6525f1b93ff2cd83bfb216b480e887e791ed1714cda8e0", - "qname": "HttpControlChannel.start", - "kind": "method", - "signature": "start(self, actions)", - "parent_symbol_id": "HttpControlChannel", - "package_or_module": "src.app_runtime.control.http_channel", - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C0_SOURCE_CHUNKS", - "path": "src/app_runtime/control/http_channel.py", - "title": "src/app_runtime/control/http_channel.py:HttpControlChannel", - "content": "class HttpControlChannel(ControlChannel):\n def __init__(self, host: str, port: int, timeout: int) -> None:\n self._timeout = timeout\n self._runner = UvicornThreadRunner(host, port, timeout)\n self._factory = HttpControlAppFactory()\n self._actions: ControlActionSet | None = None\n\n async def start(self, actions: ControlActionSet) -> None:\n self._actions = actions\n app = self._factory.create(self._health_response, self._action_response)\n await self._runner.start(app)\n\n async def stop(self) -> None:\n await self._runner.stop()\n\n @property\n def port(self) -> int:\n return self._runner.port\n\n async def _health_response(self) -> dict[str, object]:\n if self._actions is None:\n return {\"status\": \"unhealthy\", \"detail\": \"control actions are not configured\"}\n return await asyncio.wait_for(self._actions.health(), timeout=float(self._timeout))\n\n async def _action_response(self, action: str, _client_source: str = \"unknown\") -> JSONResponse:\n if self._actions is None:\n return JSONResponse(content={\"status\": \"error\", \"detail\": f\"{action} handler is not configured\"}, status_code=404)\n callbacks = {\n \"start\": self._actions.start,\n \"stop\": self._actions.stop,\n \"status\": self._actions.status,\n }\n callback = callbacks.get(action)\n if callback is None:\n return JSONResponse(content={\"status\": \"error\", \"detail\": f\"unsupported action: {action}\"}, status_code=404)\n action_timeout = max(float(self._timeout), 10.0) if action in {\"start\", \"stop\"} else float(self._timeout)\n try:\n detail = await asyncio.wait_for(callback(), timeout=action_timeout)\n except asyncio.TimeoutError:\n return JSONResponse(\n content={\"status\": \"accepted\", \"detail\": f\"{action} operation is still in progress\"},\n status_code=202,\n )\n except Exception as exc:\n return JSONResponse(content={\"status\": \"error\", \"detail\": str(exc)}, status_code=500)\n return JSONResponse(content={\"status\": \"ok\", \"detail\": detail or f\"{action} action accepted\"}, status_code=200)", - "start_line": 12, - "end_line": 57, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.http_channel", - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "path": "src/app_runtime/control/http_channel.py", - "title": "HttpControlChannel.__init__:dataflow_slice", - "content": "HttpControlChannel.__init__\n -> HttpControlChannel._timeout\n -> HttpControlChannel._action_response", - "start_line": 14, - "end_line": 47, - "metadata": { - "edge_id": "c3ef21fcae96c82c00be74b3ab827d4af2085d89cb3fa5521c19a174aad84dbb", - "edge_type": "dataflow_slice", - "src_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "src_qname": "HttpControlChannel.__init__", - "dst_symbol_id": "e64969024ccaeb34d8d91473fad07b3b3d341875846392e7a006406c7ada1954", - "dst_ref": "HttpControlChannel._action_response", - "resolution": "resolved", - "slice_id": "c3ef21fcae96c82c00be74b3ab827d4af2085d89cb3fa5521c19a174aad84dbb", - "root_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "path_symbols": [ - "HttpControlChannel.__init__", - "HttpControlChannel._timeout", - "HttpControlChannel._action_response" - ], - "path_symbol_ids": [ - "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "e64969024ccaeb34d8d91473fad07b3b3d341875846392e7a006406c7ada1954" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "path": "src/app_runtime/control/http_channel.py", - "title": "HttpControlChannel.__init__:dataflow_slice", - "content": "HttpControlChannel.__init__\n -> HttpControlChannel._runner\n -> HttpControlChannel.start", - "start_line": 15, - "end_line": 22, - "metadata": { - "edge_id": "51d73913df709152258ed1b9a8c8f4eb3c575eccfe6b982aef0b28e0789a29da", - "edge_type": "dataflow_slice", - "src_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "src_qname": "HttpControlChannel.__init__", - "dst_symbol_id": "d1933f04137f52535b6525f1b93ff2cd83bfb216b480e887e791ed1714cda8e0", - "dst_ref": "HttpControlChannel.start", - "resolution": "resolved", - "slice_id": "51d73913df709152258ed1b9a8c8f4eb3c575eccfe6b982aef0b28e0789a29da", - "root_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "path_symbols": [ - "HttpControlChannel.__init__", - "HttpControlChannel._runner", - "HttpControlChannel.start" - ], - "path_symbol_ids": [ - "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "d1933f04137f52535b6525f1b93ff2cd83bfb216b480e887e791ed1714cda8e0" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "path": "src/app_runtime/control/http_channel.py", - "title": "HttpControlChannel.__init__:dataflow_slice", - "content": "HttpControlChannel.__init__\n -> HttpControlChannel._timeout\n -> HttpControlChannel._health_response", - "start_line": 14, - "end_line": 34, - "metadata": { - "edge_id": "f858f5c9e575f6c4cdfe3853571b7ee21d1f628a443541d2037c3dc9d0790bef", - "edge_type": "dataflow_slice", - "src_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "src_qname": "HttpControlChannel.__init__", - "dst_symbol_id": "e84bf04e9cd2127df235b7064d05f47e19f19a89c7c82f4c247231d4e8fa426a", - "dst_ref": "HttpControlChannel._health_response", - "resolution": "resolved", - "slice_id": "f858f5c9e575f6c4cdfe3853571b7ee21d1f628a443541d2037c3dc9d0790bef", - "root_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "path_symbols": [ - "HttpControlChannel.__init__", - "HttpControlChannel._timeout", - "HttpControlChannel._health_response" - ], - "path_symbol_ids": [ - "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "e84bf04e9cd2127df235b7064d05f47e19f19a89c7c82f4c247231d4e8fa426a" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "path": "src/app_runtime/control/http_channel.py", - "title": "HttpControlChannel.__init__:dataflow_slice", - "content": "HttpControlChannel.__init__\n -> HttpControlChannel._runner\n -> HttpControlChannel.stop", - "start_line": 15, - "end_line": 25, - "metadata": { - "edge_id": "0f827ef81a990258a8a74381c8564a8361afa6712dba3200592659c939adcb9d", - "edge_type": "dataflow_slice", - "src_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "src_qname": "HttpControlChannel.__init__", - "dst_symbol_id": "f29ab212620093d72be20e26c5a399624c7939a6056a728762ed3f84a250bfa3", - "dst_ref": "HttpControlChannel.stop", - "resolution": "resolved", - "slice_id": "0f827ef81a990258a8a74381c8564a8361afa6712dba3200592659c939adcb9d", - "root_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "path_symbols": [ - "HttpControlChannel.__init__", - "HttpControlChannel._runner", - "HttpControlChannel.stop" - ], - "path_symbol_ids": [ - "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "f29ab212620093d72be20e26c5a399624c7939a6056a728762ed3f84a250bfa3" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "relations": [ - { - "path": "src/app_runtime/control/http_channel.py", - "metadata": { - "edge_id": "c3ef21fcae96c82c00be74b3ab827d4af2085d89cb3fa5521c19a174aad84dbb", - "edge_type": "dataflow_slice", - "src_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "src_qname": "HttpControlChannel.__init__", - "dst_symbol_id": "e64969024ccaeb34d8d91473fad07b3b3d341875846392e7a006406c7ada1954", - "dst_ref": "HttpControlChannel._action_response", - "resolution": "resolved", - "slice_id": "c3ef21fcae96c82c00be74b3ab827d4af2085d89cb3fa5521c19a174aad84dbb", - "root_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "path_symbols": [ - "HttpControlChannel.__init__", - "HttpControlChannel._timeout", - "HttpControlChannel._action_response" - ], - "path_symbol_ids": [ - "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "e64969024ccaeb34d8d91473fad07b3b3d341875846392e7a006406c7ada1954" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - }, - "content": "HttpControlChannel.__init__\n -> HttpControlChannel._timeout\n -> HttpControlChannel._action_response" - }, - { - "path": "src/app_runtime/control/http_channel.py", - "metadata": { - "edge_id": "51d73913df709152258ed1b9a8c8f4eb3c575eccfe6b982aef0b28e0789a29da", - "edge_type": "dataflow_slice", - "src_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "src_qname": "HttpControlChannel.__init__", - "dst_symbol_id": "d1933f04137f52535b6525f1b93ff2cd83bfb216b480e887e791ed1714cda8e0", - "dst_ref": "HttpControlChannel.start", - "resolution": "resolved", - "slice_id": "51d73913df709152258ed1b9a8c8f4eb3c575eccfe6b982aef0b28e0789a29da", - "root_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "path_symbols": [ - "HttpControlChannel.__init__", - "HttpControlChannel._runner", - "HttpControlChannel.start" - ], - "path_symbol_ids": [ - "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "d1933f04137f52535b6525f1b93ff2cd83bfb216b480e887e791ed1714cda8e0" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - }, - "content": "HttpControlChannel.__init__\n -> HttpControlChannel._runner\n -> HttpControlChannel.start" - }, - { - "path": "src/app_runtime/control/http_channel.py", - "metadata": { - "edge_id": "f858f5c9e575f6c4cdfe3853571b7ee21d1f628a443541d2037c3dc9d0790bef", - "edge_type": "dataflow_slice", - "src_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "src_qname": "HttpControlChannel.__init__", - "dst_symbol_id": "e84bf04e9cd2127df235b7064d05f47e19f19a89c7c82f4c247231d4e8fa426a", - "dst_ref": "HttpControlChannel._health_response", - "resolution": "resolved", - "slice_id": "f858f5c9e575f6c4cdfe3853571b7ee21d1f628a443541d2037c3dc9d0790bef", - "root_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "path_symbols": [ - "HttpControlChannel.__init__", - "HttpControlChannel._timeout", - "HttpControlChannel._health_response" - ], - "path_symbol_ids": [ - "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "e84bf04e9cd2127df235b7064d05f47e19f19a89c7c82f4c247231d4e8fa426a" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - }, - "content": "HttpControlChannel.__init__\n -> HttpControlChannel._timeout\n -> HttpControlChannel._health_response" - }, - { - "path": "src/app_runtime/control/http_channel.py", - "metadata": { - "edge_id": "0f827ef81a990258a8a74381c8564a8361afa6712dba3200592659c939adcb9d", - "edge_type": "dataflow_slice", - "src_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "src_qname": "HttpControlChannel.__init__", - "dst_symbol_id": "f29ab212620093d72be20e26c5a399624c7939a6056a728762ed3f84a250bfa3", - "dst_ref": "HttpControlChannel.stop", - "resolution": "resolved", - "slice_id": "0f827ef81a990258a8a74381c8564a8361afa6712dba3200592659c939adcb9d", - "root_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "path_symbols": [ - "HttpControlChannel.__init__", - "HttpControlChannel._runner", - "HttpControlChannel.stop" - ], - "path_symbol_ids": [ - "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "f29ab212620093d72be20e26c5a399624c7939a6056a728762ed3f84a250bfa3" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - }, - "content": "HttpControlChannel.__init__\n -> HttpControlChannel._runner\n -> HttpControlChannel.stop" - } - ], - "entrypoints": [], - "test_candidates": [], - "layer_outcomes": [ - { - "layer_id": "C1_SYMBOL_CATALOG", - "hit_count": 8, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C0_SOURCE_CHUNKS", - "hit_count": 1, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C2_DEPENDENCY_GRAPH", - "hit_count": 4, - "empty": false, - "fallback_used": false - } - ], - "missing_layers": [], - "raw_rows": [ - { - "path": "src/app_runtime/control/http_channel.py", - "content": "const ControlChannel\nControlChannel = app_runtime.control.base.ControlChannel", - "layer": "C1_SYMBOL_CATALOG", - "title": "ControlChannel", - "span_start": 7, - "span_end": 7, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": null, - "metadata": { - "symbol_id": "6e69a934202b6e11891af8fb72b2033e8ae3071eb7577c64f5545b5b7ddfb51e", - "qname": "ControlChannel", - "kind": "const", - "signature": "ControlChannel = app_runtime.control.base.ControlChannel", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.control.http_channel", - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "const ControlActionSet\nControlActionSet = app_runtime.control.base.ControlActionSet", - "layer": "C1_SYMBOL_CATALOG", - "title": "ControlActionSet", - "span_start": 7, - "span_end": 7, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": null, - "metadata": { - "symbol_id": "2132a5717c57061e3488a1bf4d43650a60ea903a42278f4d494c014bc80d2df9", - "qname": "ControlActionSet", - "kind": "const", - "signature": "ControlActionSet = app_runtime.control.base.ControlActionSet", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.control.http_channel", - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "const JSONResponse\nJSONResponse = fastapi.responses.JSONResponse", - "layer": "C1_SYMBOL_CATALOG", - "title": "JSONResponse", - "span_start": 5, - "span_end": 5, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": null, - "metadata": { - "symbol_id": "238f600ea55013e25a3e1451f7fd65caabea125b314b89247900cdab5b801a23", - "qname": "JSONResponse", - "kind": "const", - "signature": "JSONResponse = fastapi.responses.JSONResponse", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.control.http_channel", - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "const HttpControlAppFactory\nHttpControlAppFactory = app_runtime.control.http_app.HttpControlAppFactory", - "layer": "C1_SYMBOL_CATALOG", - "title": "HttpControlAppFactory", - "span_start": 8, - "span_end": 8, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": null, - "metadata": { - "symbol_id": "9ee00379ee797cd2386e88a6e37dc69e3e31de9144fc4b95f0206cd1430e8983", - "qname": "HttpControlAppFactory", - "kind": "const", - "signature": "HttpControlAppFactory = app_runtime.control.http_app.HttpControlAppFactory", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.control.http_channel", - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "const UvicornThreadRunner\nUvicornThreadRunner = app_runtime.control.http_runner.UvicornThreadRunner", - "layer": "C1_SYMBOL_CATALOG", - "title": "UvicornThreadRunner", - "span_start": 9, - "span_end": 9, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": null, - "metadata": { - "symbol_id": "c6ee53f4ff75d5b34ee95854cb63bb3ecfa163023717cd969b8cba937a0cd3b3", - "qname": "UvicornThreadRunner", - "kind": "const", - "signature": "UvicornThreadRunner = app_runtime.control.http_runner.UvicornThreadRunner", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.control.http_channel", - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "class HttpControlChannel\nHttpControlChannel(ControlChannel)", - "layer": "C1_SYMBOL_CATALOG", - "title": "HttpControlChannel", - "span_start": 12, - "span_end": 57, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": null, - "metadata": { - "symbol_id": "1c9fbdc24819e5604c26ea55428a74310f03a03e1af197ed84846af61e42fdb0", - "qname": "HttpControlChannel", - "kind": "class", - "signature": "HttpControlChannel(ControlChannel)", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.control.http_channel", - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "method HttpControlChannel.__init__\n__init__(self, host, port, timeout)", - "layer": "C1_SYMBOL_CATALOG", - "title": "HttpControlChannel.__init__", - "span_start": 13, - "span_end": 17, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": null, - "metadata": { - "symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "qname": "HttpControlChannel.__init__", - "kind": "method", - "signature": "__init__(self, host, port, timeout)", - "parent_symbol_id": "HttpControlChannel", - "package_or_module": "src.app_runtime.control.http_channel", - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "method HttpControlChannel.start\nstart(self, actions)", - "layer": "C1_SYMBOL_CATALOG", - "title": "HttpControlChannel.start", - "span_start": 19, - "span_end": 22, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": null, - "metadata": { - "symbol_id": "d1933f04137f52535b6525f1b93ff2cd83bfb216b480e887e791ed1714cda8e0", - "qname": "HttpControlChannel.start", - "kind": "method", - "signature": "start(self, actions)", - "parent_symbol_id": "HttpControlChannel", - "package_or_module": "src.app_runtime.control.http_channel", - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "class HttpControlChannel(ControlChannel):\n def __init__(self, host: str, port: int, timeout: int) -> None:\n self._timeout = timeout\n self._runner = UvicornThreadRunner(host, port, timeout)\n self._factory = HttpControlAppFactory()\n self._actions: ControlActionSet | None = None\n\n async def start(self, actions: ControlActionSet) -> None:\n self._actions = actions\n app = self._factory.create(self._health_response, self._action_response)\n await self._runner.start(app)\n\n async def stop(self) -> None:\n await self._runner.stop()\n\n @property\n def port(self) -> int:\n return self._runner.port\n\n async def _health_response(self) -> dict[str, object]:\n if self._actions is None:\n return {\"status\": \"unhealthy\", \"detail\": \"control actions are not configured\"}\n return await asyncio.wait_for(self._actions.health(), timeout=float(self._timeout))\n\n async def _action_response(self, action: str, _client_source: str = \"unknown\") -> JSONResponse:\n if self._actions is None:\n return JSONResponse(content={\"status\": \"error\", \"detail\": f\"{action} handler is not configured\"}, status_code=404)\n callbacks = {\n \"start\": self._actions.start,\n \"stop\": self._actions.stop,\n \"status\": self._actions.status,\n }\n callback = callbacks.get(action)\n if callback is None:\n return JSONResponse(content={\"status\": \"error\", \"detail\": f\"unsupported action: {action}\"}, status_code=404)\n action_timeout = max(float(self._timeout), 10.0) if action in {\"start\", \"stop\"} else float(self._timeout)\n try:\n detail = await asyncio.wait_for(callback(), timeout=action_timeout)\n except asyncio.TimeoutError:\n return JSONResponse(\n content={\"status\": \"accepted\", \"detail\": f\"{action} operation is still in progress\"},\n status_code=202,\n )\n except Exception as exc:\n return JSONResponse(content={\"status\": \"error\", \"detail\": str(exc)}, status_code=500)\n return JSONResponse(content={\"status\": \"ok\", \"detail\": detail or f\"{action} action accepted\"}, status_code=200)", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/http_channel.py:HttpControlChannel", - "span_start": 12, - "span_end": 57, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": null, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.http_channel", - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel.__init__\n -> HttpControlChannel._timeout\n -> HttpControlChannel._action_response", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "HttpControlChannel.__init__:dataflow_slice", - "span_start": 14, - "span_end": 47, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": null, - "metadata": { - "edge_id": "c3ef21fcae96c82c00be74b3ab827d4af2085d89cb3fa5521c19a174aad84dbb", - "edge_type": "dataflow_slice", - "src_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "src_qname": "HttpControlChannel.__init__", - "dst_symbol_id": "e64969024ccaeb34d8d91473fad07b3b3d341875846392e7a006406c7ada1954", - "dst_ref": "HttpControlChannel._action_response", - "resolution": "resolved", - "slice_id": "c3ef21fcae96c82c00be74b3ab827d4af2085d89cb3fa5521c19a174aad84dbb", - "root_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "path_symbols": [ - "HttpControlChannel.__init__", - "HttpControlChannel._timeout", - "HttpControlChannel._action_response" - ], - "path_symbol_ids": [ - "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "e64969024ccaeb34d8d91473fad07b3b3d341875846392e7a006406c7ada1954" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel.__init__\n -> HttpControlChannel._runner\n -> HttpControlChannel.start", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "HttpControlChannel.__init__:dataflow_slice", - "span_start": 15, - "span_end": 22, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": null, - "metadata": { - "edge_id": "51d73913df709152258ed1b9a8c8f4eb3c575eccfe6b982aef0b28e0789a29da", - "edge_type": "dataflow_slice", - "src_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "src_qname": "HttpControlChannel.__init__", - "dst_symbol_id": "d1933f04137f52535b6525f1b93ff2cd83bfb216b480e887e791ed1714cda8e0", - "dst_ref": "HttpControlChannel.start", - "resolution": "resolved", - "slice_id": "51d73913df709152258ed1b9a8c8f4eb3c575eccfe6b982aef0b28e0789a29da", - "root_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "path_symbols": [ - "HttpControlChannel.__init__", - "HttpControlChannel._runner", - "HttpControlChannel.start" - ], - "path_symbol_ids": [ - "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "d1933f04137f52535b6525f1b93ff2cd83bfb216b480e887e791ed1714cda8e0" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel.__init__\n -> HttpControlChannel._timeout\n -> HttpControlChannel._health_response", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "HttpControlChannel.__init__:dataflow_slice", - "span_start": 14, - "span_end": 34, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": null, - "metadata": { - "edge_id": "f858f5c9e575f6c4cdfe3853571b7ee21d1f628a443541d2037c3dc9d0790bef", - "edge_type": "dataflow_slice", - "src_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "src_qname": "HttpControlChannel.__init__", - "dst_symbol_id": "e84bf04e9cd2127df235b7064d05f47e19f19a89c7c82f4c247231d4e8fa426a", - "dst_ref": "HttpControlChannel._health_response", - "resolution": "resolved", - "slice_id": "f858f5c9e575f6c4cdfe3853571b7ee21d1f628a443541d2037c3dc9d0790bef", - "root_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "path_symbols": [ - "HttpControlChannel.__init__", - "HttpControlChannel._timeout", - "HttpControlChannel._health_response" - ], - "path_symbol_ids": [ - "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "e84bf04e9cd2127df235b7064d05f47e19f19a89c7c82f4c247231d4e8fa426a" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel.__init__\n -> HttpControlChannel._runner\n -> HttpControlChannel.stop", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "HttpControlChannel.__init__:dataflow_slice", - "span_start": 15, - "span_end": 25, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": null, - "metadata": { - "edge_id": "0f827ef81a990258a8a74381c8564a8361afa6712dba3200592659c939adcb9d", - "edge_type": "dataflow_slice", - "src_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "src_qname": "HttpControlChannel.__init__", - "dst_symbol_id": "f29ab212620093d72be20e26c5a399624c7939a6056a728762ed3f84a250bfa3", - "dst_ref": "HttpControlChannel.stop", - "resolution": "resolved", - "slice_id": "0f827ef81a990258a8a74381c8564a8361afa6712dba3200592659c939adcb9d", - "root_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "path_symbols": [ - "HttpControlChannel.__init__", - "HttpControlChannel._runner", - "HttpControlChannel.stop" - ], - "path_symbol_ids": [ - "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "f29ab212620093d72be20e26c5a399624c7939a6056a728762ed3f84a250bfa3" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "retrieval_report": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C2_DEPENDENCY_GRAPH" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "vector", - "C0_SOURCE_CHUNKS": "vector", - "C2_DEPENDENCY_GRAPH": "vector" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 12, - "C2_DEPENDENCY_GRAPH": 4 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [ - "src/app_runtime/control/http_channel.py" - ] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src/app_runtime/control/http_channel.py" - ] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src/app_runtime/control/http_channel.py" - ] - } - }, - "fallback": { - "used": false, - "reason": null - }, - "retrieval_by_layer_ms": { - "C1_SYMBOL_CATALOG": 29, - "C0_SOURCE_CHUNKS": 14, - "C2_DEPENDENCY_GRAPH": 16 - } - } - }, - "diagnostics": { - "intent_correct": null, - "target_found": true, - "layers_used": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C2_DEPENDENCY_GRAPH" - ], - "retrieval_sufficient": true, - "answer_mode": "normal", - "resolved_target": "HttpControlChannel", - "answer_policy_branch": "normal_answer", - "decision_reason": "evidence_sufficient", - "router_result": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "retrieval_profile": "code", - "sub_intent": "EXPLAIN_LOCAL", - "path_scope": [ - "src/app_runtime/control/http_channel.py" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C2_DEPENDENCY_GRAPH" - ], - "symbol_resolution_status": "resolved" - }, - "retrieval_request": { - "rag_session_id": "7d11da21-faa0-4cea-aede-aeabe069164c", - "query": "Почему в файле src/app_runtime/control/http_channel.py класс HttpControlChannel устроен так?", - "sub_intent": "EXPLAIN_LOCAL", - "path_scope": [ - "src/app_runtime/control/http_channel.py" - ], - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C2_DEPENDENCY_GRAPH" - ] - }, - "per_layer_outcome": [ - { - "layer_id": "C1_SYMBOL_CATALOG", - "hit_count": 8, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C0_SOURCE_CHUNKS", - "hit_count": 1, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C2_DEPENDENCY_GRAPH", - "hit_count": 4, - "empty": false, - "fallback_used": false - } - ], - "empty_layers": [], - "evidence_gate_decision": { - "sufficient": true, - "failure_reasons": [], - "evidence_count": 13 - }, - "evidence_gate_input": { - "resolved_target": "HttpControlChannel", - "sub_intent": "EXPLAIN_LOCAL", - "target_type": "symbol", - "evidence_count": 13, - "code_chunk_count": 13, - "entrypoint_count": 0, - "relation_count": 4, - "test_evidence_count": 0, - "symbol_resolution_status": "resolved", - "path_scope": [ - "src/app_runtime/control/http_channel.py" - ] - }, - "post_evidence_gate": { - "input": { - "answer_mode": "normal", - "degraded_message": "", - "resolved_target": "HttpControlChannel", - "draft_answer_preview": "Класс HttpControlChannel в файле http_channel.py наследует ControlChannel и реализует HTTP-канал управления. \nОн имеет конструктор с параметрами хост, порт и таймаут, где инициализирует runner (используя Uvicorn для запуска сервера) и factory для создания FastAPI-приложения. \nМетод start запускает с", - "repair_candidate": true - }, - "output": { - "passed": true, - "action": "return", - "reasons": [], - "repair_used": false, - "final_answer_preview": "Класс HttpControlChannel в файле http_channel.py наследует ControlChannel и реализует HTTP-канал управления. \nОн имеет конструктор с параметрами хост, порт и таймаут, где инициализирует runner (используя Uvicorn для запуска сервера) и factory для создания FastAPI-приложения. \nМетод start запускает с" - } - }, - "failure_reasons": [], - "timings_ms": { - "router": 1, - "retrieval": 61, - "pre_evidence_gate": 1, - "llm": 3038, - "post_evidence_gate": 1 - } - }, - "rag_rows": [ - { - "path": "src/app_runtime/control/http_channel.py", - "content": "const ControlChannel\nControlChannel = app_runtime.control.base.ControlChannel", - "layer": "C1_SYMBOL_CATALOG", - "title": "ControlChannel", - "span_start": 7, - "span_end": 7, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "6e69a934202b6e11891af8fb72b2033e8ae3071eb7577c64f5545b5b7ddfb51e", - "qname": "ControlChannel", - "kind": "const", - "signature": "ControlChannel = app_runtime.control.base.ControlChannel", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.control.http_channel", - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "const ControlActionSet\nControlActionSet = app_runtime.control.base.ControlActionSet", - "layer": "C1_SYMBOL_CATALOG", - "title": "ControlActionSet", - "span_start": 7, - "span_end": 7, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "2132a5717c57061e3488a1bf4d43650a60ea903a42278f4d494c014bc80d2df9", - "qname": "ControlActionSet", - "kind": "const", - "signature": "ControlActionSet = app_runtime.control.base.ControlActionSet", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.control.http_channel", - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "const JSONResponse\nJSONResponse = fastapi.responses.JSONResponse", - "layer": "C1_SYMBOL_CATALOG", - "title": "JSONResponse", - "span_start": 5, - "span_end": 5, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "238f600ea55013e25a3e1451f7fd65caabea125b314b89247900cdab5b801a23", - "qname": "JSONResponse", - "kind": "const", - "signature": "JSONResponse = fastapi.responses.JSONResponse", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.control.http_channel", - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "const HttpControlAppFactory\nHttpControlAppFactory = app_runtime.control.http_app.HttpControlAppFactory", - "layer": "C1_SYMBOL_CATALOG", - "title": "HttpControlAppFactory", - "span_start": 8, - "span_end": 8, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "9ee00379ee797cd2386e88a6e37dc69e3e31de9144fc4b95f0206cd1430e8983", - "qname": "HttpControlAppFactory", - "kind": "const", - "signature": "HttpControlAppFactory = app_runtime.control.http_app.HttpControlAppFactory", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.control.http_channel", - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "const UvicornThreadRunner\nUvicornThreadRunner = app_runtime.control.http_runner.UvicornThreadRunner", - "layer": "C1_SYMBOL_CATALOG", - "title": "UvicornThreadRunner", - "span_start": 9, - "span_end": 9, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "c6ee53f4ff75d5b34ee95854cb63bb3ecfa163023717cd969b8cba937a0cd3b3", - "qname": "UvicornThreadRunner", - "kind": "const", - "signature": "UvicornThreadRunner = app_runtime.control.http_runner.UvicornThreadRunner", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.control.http_channel", - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "class HttpControlChannel\nHttpControlChannel(ControlChannel)", - "layer": "C1_SYMBOL_CATALOG", - "title": "HttpControlChannel", - "span_start": 12, - "span_end": 57, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "1c9fbdc24819e5604c26ea55428a74310f03a03e1af197ed84846af61e42fdb0", - "qname": "HttpControlChannel", - "kind": "class", - "signature": "HttpControlChannel(ControlChannel)", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.control.http_channel", - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "method HttpControlChannel.__init__\n__init__(self, host, port, timeout)", - "layer": "C1_SYMBOL_CATALOG", - "title": "HttpControlChannel.__init__", - "span_start": 13, - "span_end": 17, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "qname": "HttpControlChannel.__init__", - "kind": "method", - "signature": "__init__(self, host, port, timeout)", - "parent_symbol_id": "HttpControlChannel", - "package_or_module": "src.app_runtime.control.http_channel", - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "method HttpControlChannel.start\nstart(self, actions)", - "layer": "C1_SYMBOL_CATALOG", - "title": "HttpControlChannel.start", - "span_start": 19, - "span_end": 22, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "d1933f04137f52535b6525f1b93ff2cd83bfb216b480e887e791ed1714cda8e0", - "qname": "HttpControlChannel.start", - "kind": "method", - "signature": "start(self, actions)", - "parent_symbol_id": "HttpControlChannel", - "package_or_module": "src.app_runtime.control.http_channel", - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "class HttpControlChannel(ControlChannel):\n def __init__(self, host: str, port: int, timeout: int) -> None:\n self._timeout = timeout\n self._runner = UvicornThreadRunner(host, port, timeout)\n self._factory = HttpControlAppFactory()\n self._actions: ControlActionSet | None = None\n\n async def start(self, actions: ControlActionSet) -> None:\n self._actions = actions\n app = self._factory.create(self._health_response, self._action_response)\n await self._runner.start(app)\n\n async def stop(self) -> None:\n await self._runner.stop()\n\n @property\n def port(self) -> int:\n return self._runner.port\n\n async def _health_response(self) -> dict[str, object]:\n if self._actions is None:\n return {\"status\": \"unhealthy\", \"detail\": \"control actions are not configured\"}\n return await asyncio.wait_for(self._actions.health(), timeout=float(self._timeout))\n\n async def _action_response(self, action: str, _client_source: str = \"unknown\") -> JSONResponse:\n if self._actions is None:\n return JSONResponse(content={\"status\": \"error\", \"detail\": f\"{action} handler is not configured\"}, status_code=404)\n callbacks = {\n \"start\": self._actions.start,\n \"stop\": self._actions.stop,\n \"status\": self._actions.status,\n }\n callback = callbacks.get(action)\n if callback is None:\n return JSONResponse(content={\"status\": \"error\", \"detail\": f\"unsupported action: {action}\"}, status_code=404)\n action_timeout = max(float(self._timeout), 10.0) if action in {\"start\", \"stop\"} else float(self._timeout)\n try:\n detail = await asyncio.wait_for(callback(), timeout=action_timeout)\n except asyncio.TimeoutError:\n return JSONResponse(\n content={\"status\": \"accepted\", \"detail\": f\"{action} operation is still in progress\"},\n status_code=202,\n )\n except Exception as exc:\n return JSONResponse(content={\"status\": \"error\", \"detail\": str(exc)}, status_code=500)\n return JSONResponse(content={\"status\": \"ok\", \"detail\": detail or f\"{action} action accepted\"}, status_code=200)", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/http_channel.py:HttpControlChannel", - "span_start": 12, - "span_end": 57, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.http_channel", - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel.__init__\n -> HttpControlChannel._timeout\n -> HttpControlChannel._action_response", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "HttpControlChannel.__init__:dataflow_slice", - "span_start": 14, - "span_end": 47, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "c3ef21fcae96c82c00be74b3ab827d4af2085d89cb3fa5521c19a174aad84dbb", - "edge_type": "dataflow_slice", - "src_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "src_qname": "HttpControlChannel.__init__", - "dst_symbol_id": "e64969024ccaeb34d8d91473fad07b3b3d341875846392e7a006406c7ada1954", - "dst_ref": "HttpControlChannel._action_response", - "resolution": "resolved", - "slice_id": "c3ef21fcae96c82c00be74b3ab827d4af2085d89cb3fa5521c19a174aad84dbb", - "root_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "path_symbols": [ - "HttpControlChannel.__init__", - "HttpControlChannel._timeout", - "HttpControlChannel._action_response" - ], - "path_symbol_ids": [ - "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "e64969024ccaeb34d8d91473fad07b3b3d341875846392e7a006406c7ada1954" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel.__init__\n -> HttpControlChannel._runner\n -> HttpControlChannel.start", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "HttpControlChannel.__init__:dataflow_slice", - "span_start": 15, - "span_end": 22, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "51d73913df709152258ed1b9a8c8f4eb3c575eccfe6b982aef0b28e0789a29da", - "edge_type": "dataflow_slice", - "src_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "src_qname": "HttpControlChannel.__init__", - "dst_symbol_id": "d1933f04137f52535b6525f1b93ff2cd83bfb216b480e887e791ed1714cda8e0", - "dst_ref": "HttpControlChannel.start", - "resolution": "resolved", - "slice_id": "51d73913df709152258ed1b9a8c8f4eb3c575eccfe6b982aef0b28e0789a29da", - "root_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "path_symbols": [ - "HttpControlChannel.__init__", - "HttpControlChannel._runner", - "HttpControlChannel.start" - ], - "path_symbol_ids": [ - "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "d1933f04137f52535b6525f1b93ff2cd83bfb216b480e887e791ed1714cda8e0" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel.__init__\n -> HttpControlChannel._timeout\n -> HttpControlChannel._health_response", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "HttpControlChannel.__init__:dataflow_slice", - "span_start": 14, - "span_end": 34, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "f858f5c9e575f6c4cdfe3853571b7ee21d1f628a443541d2037c3dc9d0790bef", - "edge_type": "dataflow_slice", - "src_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "src_qname": "HttpControlChannel.__init__", - "dst_symbol_id": "e84bf04e9cd2127df235b7064d05f47e19f19a89c7c82f4c247231d4e8fa426a", - "dst_ref": "HttpControlChannel._health_response", - "resolution": "resolved", - "slice_id": "f858f5c9e575f6c4cdfe3853571b7ee21d1f628a443541d2037c3dc9d0790bef", - "root_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "path_symbols": [ - "HttpControlChannel.__init__", - "HttpControlChannel._timeout", - "HttpControlChannel._health_response" - ], - "path_symbol_ids": [ - "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "e84bf04e9cd2127df235b7064d05f47e19f19a89c7c82f4c247231d4e8fa426a" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel.__init__\n -> HttpControlChannel._runner\n -> HttpControlChannel.stop", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "HttpControlChannel.__init__:dataflow_slice", - "span_start": 15, - "span_end": 25, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "0f827ef81a990258a8a74381c8564a8361afa6712dba3200592659c939adcb9d", - "edge_type": "dataflow_slice", - "src_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "src_qname": "HttpControlChannel.__init__", - "dst_symbol_id": "f29ab212620093d72be20e26c5a399624c7939a6056a728762ed3f84a250bfa3", - "dst_ref": "HttpControlChannel.stop", - "resolution": "resolved", - "slice_id": "0f827ef81a990258a8a74381c8564a8361afa6712dba3200592659c939adcb9d", - "root_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "path_symbols": [ - "HttpControlChannel.__init__", - "HttpControlChannel._runner", - "HttpControlChannel.stop" - ], - "path_symbol_ids": [ - "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "f29ab212620093d72be20e26c5a399624c7939a6056a728762ed3f84a250bfa3" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "validation": { - "passed": true, - "action": "return", - "reasons": [] - }, - "steps": [ - { - "step": "router", - "status": "completed", - "timings_ms": { - "router": 1 - }, - "output": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN_LOCAL", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - } - }, - { - "step": "retrieval", - "status": "completed", - "timings_ms": { - "retrieval": 61 - }, - "output": { - "rag_count": 13, - "answer_path_rag_count": 13, - "resolved_symbol_status": "resolved", - "resolved_symbol": "HttpControlChannel", - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C2_DEPENDENCY_GRAPH" - ] - }, - "diagnostics": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C2_DEPENDENCY_GRAPH" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "vector", - "C0_SOURCE_CHUNKS": "vector", - "C2_DEPENDENCY_GRAPH": "vector" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 12, - "C2_DEPENDENCY_GRAPH": 4 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [ - "src/app_runtime/control/http_channel.py" - ] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src/app_runtime/control/http_channel.py" - ] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src/app_runtime/control/http_channel.py" - ] - } - }, - "fallback": { - "used": false, - "reason": null - }, - "retrieval_by_layer_ms": { - "C1_SYMBOL_CATALOG": 29, - "C0_SOURCE_CHUNKS": 14, - "C2_DEPENDENCY_GRAPH": 16 - } - } - }, - { - "step": "pre_evidence_gate", - "status": "passed", - "timings_ms": { - "pre_evidence_gate": 1 - }, - "input": { - "resolved_target": "HttpControlChannel", - "sub_intent": "EXPLAIN_LOCAL", - "target_type": "symbol", - "evidence_count": 13, - "code_chunk_count": 13, - "entrypoint_count": 0, - "relation_count": 4, - "test_evidence_count": 0, - "symbol_resolution_status": "resolved", - "path_scope": [ - "src/app_runtime/control/http_channel.py" - ] - }, - "output": { - "passed": true, - "failure_reasons": [], - "degraded_message": "", - "evidence_count": 13 - } - }, - { - "step": "llm", - "status": "completed", - "timings_ms": { - "llm": 3038 - }, - "output": { - "prompt_name": "code_qa_explain_local_answer", - "answer_preview": "Класс HttpControlChannel в файле http_channel.py наследует ControlChannel и реализует HTTP-канал управления. \nОн имеет конструктор с параметрами хост, порт и таймаут, где инициализирует runner (используя Uvicorn для запуска сервера) и factory для создания FastAPI-приложения. \nМетод start запускает с", - "resolved_target": "HttpControlChannel", - "answer_policy_branch": "normal_answer", - "decision_reason": "evidence_sufficient" - } - }, - { - "step": "post_evidence_gate", - "status": "passed", - "timings_ms": { - "post_evidence_gate": 1, - "post_evidence_gate_recheck": 0, - "repair": 0 - }, - "input": { - "answer_mode": "normal", - "degraded_message": "", - "resolved_target": "HttpControlChannel", - "draft_answer_preview": "Класс HttpControlChannel в файле http_channel.py наследует ControlChannel и реализует HTTP-канал управления. \nОн имеет конструктор с параметрами хост, порт и таймаут, где инициализирует runner (используя Uvicorn для запуска сервера) и factory для создания FastAPI-приложения. \nМетод start запускает с", - "repair_candidate": true - }, - "output": { - "passed": true, - "action": "return", - "reasons": [], - "repair_used": false, - "final_answer_preview": "Класс HttpControlChannel в файле http_channel.py наследует ControlChannel и реализует HTTP-канал управления. \nОн имеет конструктор с параметрами хост, порт и таймаут, где инициализирует runner (используя Uvicorn для запуска сервера) и factory для создания FastAPI-приложения. \nМетод start запускает с" - } - } - ] - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/plba_full_chain_subintents_v3/20260312_174008/full_chain_plba_code_subintents_v2_plba-v2-explain-local-http-channel.md b/tests/pipeline_setup_v3/test_results/plba_full_chain_subintents_v3/20260312_174008/full_chain_plba_code_subintents_v2_plba-v2-explain-local-http-channel.md deleted file mode 100644 index 663d0e5..0000000 --- a/tests/pipeline_setup_v3/test_results/plba_full_chain_subintents_v3/20260312_174008/full_chain_plba_code_subintents_v2_plba-v2-explain-local-http-channel.md +++ /dev/null @@ -1,285 +0,0 @@ -# plba-v2-explain-local-http-channel - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_02_pipeline/full_chain_plba_code_subintents_v2.yaml -- runner: agent_runtime -- mode: full_chain -- passed: True - -## Query -Почему в файле src/app_runtime/control/http_channel.py класс HttpControlChannel устроен так? - -## Actual -{ - "intent": "CODE_QA", - "sub_intent": "EXPLAIN_LOCAL", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 13, - "llm_answer": "Класс HttpControlChannel в файле http_channel.py наследует ControlChannel и реализует HTTP-канал управления. \nОн имеет конструктор с параметрами хост, порт и таймаут, где инициализирует runner (используя Uvicorn для запуска сервера) и factory для создания FastAPI-приложения. \nМетод start запускает сервер с приложением, используя фабрику и передавая обработчики здоровья и действий. \nМетоды _health_response и _action_response отвечают за обработку запросов к здоровью сервиса и выполнение действий соответственно. \nСтруктура класса ориентирована на создание отдельного HTTP-канала для управления приложением через HTTP-запросы.", - "answer_mode": "answered", - "path_scope": [ - "src/app_runtime/control/http_channel.py" - ], - "symbol_candidates": [ - "HttpControlChannel" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C2_DEPENDENCY_GRAPH" - ] -} - -## Steps -[ - { - "step": "router", - "status": "completed", - "timings_ms": { - "router": 1 - }, - "output": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN_LOCAL", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - } - }, - { - "step": "retrieval", - "status": "completed", - "timings_ms": { - "retrieval": 61 - }, - "output": { - "rag_count": 13, - "answer_path_rag_count": 13, - "resolved_symbol_status": "resolved", - "resolved_symbol": "HttpControlChannel", - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C2_DEPENDENCY_GRAPH" - ] - }, - "diagnostics": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C2_DEPENDENCY_GRAPH" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "vector", - "C0_SOURCE_CHUNKS": "vector", - "C2_DEPENDENCY_GRAPH": "vector" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 12, - "C2_DEPENDENCY_GRAPH": 4 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [ - "src/app_runtime/control/http_channel.py" - ] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src/app_runtime/control/http_channel.py" - ] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src/app_runtime/control/http_channel.py" - ] - } - }, - "fallback": { - "used": false, - "reason": null - }, - "retrieval_by_layer_ms": { - "C1_SYMBOL_CATALOG": 29, - "C0_SOURCE_CHUNKS": 14, - "C2_DEPENDENCY_GRAPH": 16 - } - } - }, - { - "step": "pre_evidence_gate", - "status": "passed", - "timings_ms": { - "pre_evidence_gate": 1 - }, - "input": { - "resolved_target": "HttpControlChannel", - "sub_intent": "EXPLAIN_LOCAL", - "target_type": "symbol", - "evidence_count": 13, - "code_chunk_count": 13, - "entrypoint_count": 0, - "relation_count": 4, - "test_evidence_count": 0, - "symbol_resolution_status": "resolved", - "path_scope": [ - "src/app_runtime/control/http_channel.py" - ] - }, - "output": { - "passed": true, - "failure_reasons": [], - "degraded_message": "", - "evidence_count": 13 - } - }, - { - "step": "llm", - "status": "completed", - "timings_ms": { - "llm": 3038 - }, - "output": { - "prompt_name": "code_qa_explain_local_answer", - "answer_preview": "Класс HttpControlChannel в файле http_channel.py наследует ControlChannel и реализует HTTP-канал управления. \nОн имеет конструктор с параметрами хост, порт и таймаут, где инициализирует runner (используя Uvicorn для запуска сервера) и factory для создания FastAPI-приложения. \nМетод start запускает с", - "resolved_target": "HttpControlChannel", - "answer_policy_branch": "normal_answer", - "decision_reason": "evidence_sufficient" - } - }, - { - "step": "post_evidence_gate", - "status": "passed", - "timings_ms": { - "post_evidence_gate": 1, - "post_evidence_gate_recheck": 0, - "repair": 0 - }, - "input": { - "answer_mode": "normal", - "degraded_message": "", - "resolved_target": "HttpControlChannel", - "draft_answer_preview": "Класс HttpControlChannel в файле http_channel.py наследует ControlChannel и реализует HTTP-канал управления. \nОн имеет конструктор с параметрами хост, порт и таймаут, где инициализирует runner (используя Uvicorn для запуска сервера) и factory для создания FastAPI-приложения. \nМетод start запускает с", - "repair_candidate": true - }, - "output": { - "passed": true, - "action": "return", - "reasons": [], - "repair_used": false, - "final_answer_preview": "Класс HttpControlChannel в файле http_channel.py наследует ControlChannel и реализует HTTP-канал управления. \nОн имеет конструктор с параметрами хост, порт и таймаут, где инициализирует runner (используя Uvicorn для запуска сервера) и factory для создания FastAPI-приложения. \nМетод start запускает с" - } - } -] - -## Diagnostics -{ - "intent_correct": null, - "target_found": true, - "layers_used": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C2_DEPENDENCY_GRAPH" - ], - "retrieval_sufficient": true, - "answer_mode": "normal", - "resolved_target": "HttpControlChannel", - "answer_policy_branch": "normal_answer", - "decision_reason": "evidence_sufficient", - "router_result": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "retrieval_profile": "code", - "sub_intent": "EXPLAIN_LOCAL", - "path_scope": [ - "src/app_runtime/control/http_channel.py" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C2_DEPENDENCY_GRAPH" - ], - "symbol_resolution_status": "resolved" - }, - "retrieval_request": { - "rag_session_id": "7d11da21-faa0-4cea-aede-aeabe069164c", - "query": "Почему в файле src/app_runtime/control/http_channel.py класс HttpControlChannel устроен так?", - "sub_intent": "EXPLAIN_LOCAL", - "path_scope": [ - "src/app_runtime/control/http_channel.py" - ], - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C2_DEPENDENCY_GRAPH" - ] - }, - "per_layer_outcome": [ - { - "layer_id": "C1_SYMBOL_CATALOG", - "hit_count": 8, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C0_SOURCE_CHUNKS", - "hit_count": 1, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C2_DEPENDENCY_GRAPH", - "hit_count": 4, - "empty": false, - "fallback_used": false - } - ], - "empty_layers": [], - "evidence_gate_decision": { - "sufficient": true, - "failure_reasons": [], - "evidence_count": 13 - }, - "evidence_gate_input": { - "resolved_target": "HttpControlChannel", - "sub_intent": "EXPLAIN_LOCAL", - "target_type": "symbol", - "evidence_count": 13, - "code_chunk_count": 13, - "entrypoint_count": 0, - "relation_count": 4, - "test_evidence_count": 0, - "symbol_resolution_status": "resolved", - "path_scope": [ - "src/app_runtime/control/http_channel.py" - ] - }, - "post_evidence_gate": { - "input": { - "answer_mode": "normal", - "degraded_message": "", - "resolved_target": "HttpControlChannel", - "draft_answer_preview": "Класс HttpControlChannel в файле http_channel.py наследует ControlChannel и реализует HTTP-канал управления. \nОн имеет конструктор с параметрами хост, порт и таймаут, где инициализирует runner (используя Uvicorn для запуска сервера) и factory для создания FastAPI-приложения. \nМетод start запускает с", - "repair_candidate": true - }, - "output": { - "passed": true, - "action": "return", - "reasons": [], - "repair_used": false, - "final_answer_preview": "Класс HttpControlChannel в файле http_channel.py наследует ControlChannel и реализует HTTP-канал управления. \nОн имеет конструктор с параметрами хост, порт и таймаут, где инициализирует runner (используя Uvicorn для запуска сервера) и factory для создания FastAPI-приложения. \nМетод start запускает с" - } - }, - "failure_reasons": [], - "timings_ms": { - "router": 1, - "retrieval": 61, - "pre_evidence_gate": 1, - "llm": 3038, - "post_evidence_gate": 1 - } -} - -## Mismatches -- none \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/plba_full_chain_subintents_v3/20260312_174008/full_chain_plba_code_subintents_v2_plba-v2-explain-nonexistent-symbol.json b/tests/pipeline_setup_v3/test_results/plba_full_chain_subintents_v3/20260312_174008/full_chain_plba_code_subintents_v2_plba-v2-explain-nonexistent-symbol.json deleted file mode 100644 index b3254ea..0000000 --- a/tests/pipeline_setup_v3/test_results/plba_full_chain_subintents_v3/20260312_174008/full_chain_plba_code_subintents_v2_plba-v2-explain-nonexistent-symbol.json +++ /dev/null @@ -1,632 +0,0 @@ -{ - "case_id": "plba-v2-explain-nonexistent-symbol", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_02_pipeline/full_chain_plba_code_subintents_v2.yaml", - "runner": "agent_runtime", - "mode": "full_chain", - "query": "Объясни класс RuntimeFactoryManager", - "actual": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 0, - "llm_answer": "Сущность RuntimeFactoryManager не найдена в доступном коде.", - "answer_mode": "not_found", - "path_scope": [], - "symbol_candidates": [ - "RuntimeFactoryManager" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "passed": true, - "mismatches": [], - "details": { - "query": "Объясни класс RuntimeFactoryManager", - "router_result": { - "schema_version": "1.1", - "intent": "CODE_QA", - "retrieval_profile": "code", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query_plan": { - "raw": "Объясни класс RuntimeFactoryManager", - "normalized": "Объясни класс RuntimeFactoryManager", - "sub_intent": "EXPLAIN", - "negations": [], - "expansions": [ - "RuntimeFactoryManager" - ], - "keyword_hints": [ - "RuntimeFactoryManager" - ], - "path_hints": [], - "doc_scope_hints": [], - "symbol_candidates": [ - "RuntimeFactoryManager" - ], - "symbol_kind_hint": "class", - "anchors": [ - { - "type": "SYMBOL", - "value": "RuntimeFactoryManager", - "source": "user_text", - "subtype": null, - "span": { - "start": 14, - "end": 35 - }, - "confidence": 0.88 - }, - { - "type": "KEY_TERM", - "value": "класс", - "source": "user_text", - "subtype": null, - "span": { - "start": 8, - "end": 13 - }, - "confidence": 0.9 - } - ] - }, - "retrieval_spec": { - "domains": [ - "CODE" - ], - "layer_queries": [ - { - "layer_id": "C1_SYMBOL_CATALOG", - "top_k": 8 - }, - { - "layer_id": "C0_SOURCE_CHUNKS", - "top_k": 8 - }, - { - "layer_id": "C4_SEMANTIC_ROLES", - "top_k": 8 - }, - { - "layer_id": "C2_DEPENDENCY_GRAPH", - "top_k": 6 - }, - { - "layer_id": "C3_ENTRYPOINTS", - "top_k": 6 - } - ], - "filters": { - "test_policy": "EXCLUDE", - "path_scope": [], - "language": [ - "python" - ] - }, - "rerank_profile": "code" - }, - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - }, - "symbol_resolution": { - "status": "not_found", - "resolved_symbol": null, - "alternatives": [], - "confidence": 0.0 - }, - "evidence_policy": { - "require_def": true, - "require_flow": true, - "require_spec": false, - "allow_answer_without_evidence": false - } - }, - "retrieval_request": { - "rag_session_id": "7d11da21-faa0-4cea-aede-aeabe069164c", - "query": "Объясни класс RuntimeFactoryManager", - "sub_intent": "EXPLAIN", - "path_scope": [], - "keyword_hints": [ - "RuntimeFactoryManager" - ], - "symbol_candidates": [ - "RuntimeFactoryManager" - ], - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_spec": { - "domains": [ - "CODE" - ], - "layer_queries": [ - { - "layer_id": "C1_SYMBOL_CATALOG", - "top_k": 8 - }, - { - "layer_id": "C0_SOURCE_CHUNKS", - "top_k": 8 - }, - { - "layer_id": "C4_SEMANTIC_ROLES", - "top_k": 8 - }, - { - "layer_id": "C2_DEPENDENCY_GRAPH", - "top_k": 6 - }, - { - "layer_id": "C3_ENTRYPOINTS", - "top_k": 6 - } - ], - "filters": { - "test_policy": "EXCLUDE", - "path_scope": [], - "language": [ - "python" - ] - }, - "rerank_profile": "code" - }, - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - }, - "query_plan": { - "raw": "Объясни класс RuntimeFactoryManager", - "normalized": "Объясни класс RuntimeFactoryManager", - "sub_intent": "EXPLAIN", - "negations": [], - "expansions": [ - "RuntimeFactoryManager" - ], - "keyword_hints": [ - "RuntimeFactoryManager" - ], - "path_hints": [], - "doc_scope_hints": [], - "symbol_candidates": [ - "RuntimeFactoryManager" - ], - "symbol_kind_hint": "class", - "anchors": [ - { - "type": "SYMBOL", - "value": "RuntimeFactoryManager", - "source": "user_text", - "subtype": null, - "span": { - "start": 14, - "end": 35 - }, - "confidence": 0.88 - }, - { - "type": "KEY_TERM", - "value": "класс", - "source": "user_text", - "subtype": null, - "span": { - "start": 8, - "end": 13 - }, - "confidence": 0.9 - } - ] - } - }, - "retrieval_result": { - "target_symbol_candidates": [], - "resolved_symbol": null, - "symbol_resolution_status": "not_found", - "file_candidates": [], - "code_chunks": [], - "relations": [], - "entrypoints": [], - "test_candidates": [], - "layer_outcomes": [ - { - "layer_id": "C1_SYMBOL_CATALOG", - "hit_count": 0, - "empty": true, - "fallback_used": false - }, - { - "layer_id": "C0_SOURCE_CHUNKS", - "hit_count": 0, - "empty": true, - "fallback_used": false - }, - { - "layer_id": "C4_SEMANTIC_ROLES", - "hit_count": 0, - "empty": true, - "fallback_used": false - }, - { - "layer_id": "C2_DEPENDENCY_GRAPH", - "hit_count": 0, - "empty": true, - "fallback_used": false - }, - { - "layer_id": "C3_ENTRYPOINTS", - "hit_count": 0, - "empty": true, - "fallback_used": false - } - ], - "missing_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "raw_rows": [], - "retrieval_report": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "vector", - "C0_SOURCE_CHUNKS": "vector", - "C4_SEMANTIC_ROLES": "vector", - "C2_DEPENDENCY_GRAPH": "vector", - "C3_ENTRYPOINTS": "vector" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 8, - "C4_SEMANTIC_ROLES": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C3_ENTRYPOINTS": 6 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [] - }, - "C4_SEMANTIC_ROLES": { - "path_scope": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [] - } - }, - "fallback": { - "used": false, - "reason": null - }, - "retrieval_by_layer_ms": { - "C1_SYMBOL_CATALOG": 55, - "C0_SOURCE_CHUNKS": 25, - "C4_SEMANTIC_ROLES": 24, - "C2_DEPENDENCY_GRAPH": 59, - "C3_ENTRYPOINTS": 18 - } - } - }, - "diagnostics": { - "intent_correct": null, - "target_found": false, - "layers_used": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_sufficient": false, - "answer_mode": "insufficient", - "resolved_target": null, - "answer_policy_branch": "explain_not_found", - "decision_reason": "symbol_resolution_not_found", - "router_result": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "retrieval_profile": "code", - "sub_intent": "EXPLAIN", - "path_scope": [], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "symbol_resolution_status": "not_found" - }, - "retrieval_request": { - "rag_session_id": "7d11da21-faa0-4cea-aede-aeabe069164c", - "query": "Объясни класс RuntimeFactoryManager", - "sub_intent": "EXPLAIN", - "path_scope": [], - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "per_layer_outcome": [ - { - "layer_id": "C1_SYMBOL_CATALOG", - "hit_count": 0, - "empty": true, - "fallback_used": false - }, - { - "layer_id": "C0_SOURCE_CHUNKS", - "hit_count": 0, - "empty": true, - "fallback_used": false - }, - { - "layer_id": "C4_SEMANTIC_ROLES", - "hit_count": 0, - "empty": true, - "fallback_used": false - }, - { - "layer_id": "C2_DEPENDENCY_GRAPH", - "hit_count": 0, - "empty": true, - "fallback_used": false - }, - { - "layer_id": "C3_ENTRYPOINTS", - "hit_count": 0, - "empty": true, - "fallback_used": false - } - ], - "empty_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "evidence_gate_decision": { - "sufficient": false, - "failure_reasons": [ - "insufficient_evidence" - ], - "evidence_count": 0 - }, - "evidence_gate_input": { - "resolved_target": null, - "sub_intent": "EXPLAIN", - "target_type": "none", - "evidence_count": 0, - "code_chunk_count": 0, - "entrypoint_count": 0, - "relation_count": 0, - "test_evidence_count": 0, - "symbol_resolution_status": "not_found", - "path_scope": [] - }, - "post_evidence_gate": { - "input": { - "answer_mode": "not_found", - "draft_present": false, - "resolved_target": null - }, - "output": { - "reason": "no_draft_answer" - } - }, - "failure_reasons": [ - "insufficient_evidence" - ], - "timings_ms": { - "router": 2, - "retrieval": 184, - "pre_evidence_gate": 1, - "post_evidence_gate": 1 - } - }, - "rag_rows": [], - "validation": { - "passed": true, - "action": "return", - "reasons": [] - }, - "steps": [ - { - "step": "router", - "status": "completed", - "timings_ms": { - "router": 2 - }, - "output": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - } - }, - { - "step": "retrieval", - "status": "completed", - "timings_ms": { - "retrieval": 184 - }, - "output": { - "rag_count": 33, - "answer_path_rag_count": 0, - "resolved_symbol_status": "not_found", - "resolved_symbol": null, - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "diagnostics": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "vector", - "C0_SOURCE_CHUNKS": "vector", - "C4_SEMANTIC_ROLES": "vector", - "C2_DEPENDENCY_GRAPH": "vector", - "C3_ENTRYPOINTS": "vector" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 8, - "C4_SEMANTIC_ROLES": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C3_ENTRYPOINTS": 6 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [] - }, - "C4_SEMANTIC_ROLES": { - "path_scope": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [] - } - }, - "fallback": { - "used": false, - "reason": null - }, - "retrieval_by_layer_ms": { - "C1_SYMBOL_CATALOG": 55, - "C0_SOURCE_CHUNKS": 25, - "C4_SEMANTIC_ROLES": 24, - "C2_DEPENDENCY_GRAPH": 59, - "C3_ENTRYPOINTS": 18 - } - } - }, - { - "step": "pre_evidence_gate", - "status": "blocked", - "timings_ms": { - "pre_evidence_gate": 1 - }, - "input": { - "resolved_target": null, - "sub_intent": "EXPLAIN", - "target_type": "none", - "evidence_count": 0, - "code_chunk_count": 0, - "entrypoint_count": 0, - "relation_count": 0, - "test_evidence_count": 0, - "symbol_resolution_status": "not_found", - "path_scope": [] - }, - "output": { - "passed": false, - "failure_reasons": [ - "insufficient_evidence" - ], - "degraded_message": "Insufficient evidence for a confident answer. Evidence count: 0 (minimum required not met).", - "evidence_count": 0 - } - }, - { - "step": "llm", - "status": "skipped", - "timings_ms": { - "llm": 1 - }, - "output": { - "reason": "policy_short_circuit", - "answer_mode": "not_found", - "decision_reason": "symbol_resolution_not_found", - "answer_policy_branch": "explain_not_found" - } - }, - { - "step": "post_evidence_gate", - "status": "skipped", - "timings_ms": { - "post_evidence_gate": 1 - }, - "input": { - "answer_mode": "not_found", - "draft_present": false, - "resolved_target": null - }, - "output": { - "reason": "no_draft_answer" - } - } - ] - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/plba_full_chain_subintents_v3/20260312_174008/full_chain_plba_code_subintents_v2_plba-v2-explain-nonexistent-symbol.md b/tests/pipeline_setup_v3/test_results/plba_full_chain_subintents_v3/20260312_174008/full_chain_plba_code_subintents_v2_plba-v2-explain-nonexistent-symbol.md deleted file mode 100644 index 7dc52a4..0000000 --- a/tests/pipeline_setup_v3/test_results/plba_full_chain_subintents_v3/20260312_174008/full_chain_plba_code_subintents_v2_plba-v2-explain-nonexistent-symbol.md +++ /dev/null @@ -1,301 +0,0 @@ -# plba-v2-explain-nonexistent-symbol - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_02_pipeline/full_chain_plba_code_subintents_v2.yaml -- runner: agent_runtime -- mode: full_chain -- passed: True - -## Query -Объясни класс RuntimeFactoryManager - -## Actual -{ - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 0, - "llm_answer": "Сущность RuntimeFactoryManager не найдена в доступном коде.", - "answer_mode": "not_found", - "path_scope": [], - "symbol_candidates": [ - "RuntimeFactoryManager" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] -} - -## Steps -[ - { - "step": "router", - "status": "completed", - "timings_ms": { - "router": 2 - }, - "output": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - } - }, - { - "step": "retrieval", - "status": "completed", - "timings_ms": { - "retrieval": 184 - }, - "output": { - "rag_count": 33, - "answer_path_rag_count": 0, - "resolved_symbol_status": "not_found", - "resolved_symbol": null, - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "diagnostics": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "vector", - "C0_SOURCE_CHUNKS": "vector", - "C4_SEMANTIC_ROLES": "vector", - "C2_DEPENDENCY_GRAPH": "vector", - "C3_ENTRYPOINTS": "vector" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 8, - "C4_SEMANTIC_ROLES": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C3_ENTRYPOINTS": 6 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [] - }, - "C4_SEMANTIC_ROLES": { - "path_scope": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [] - } - }, - "fallback": { - "used": false, - "reason": null - }, - "retrieval_by_layer_ms": { - "C1_SYMBOL_CATALOG": 55, - "C0_SOURCE_CHUNKS": 25, - "C4_SEMANTIC_ROLES": 24, - "C2_DEPENDENCY_GRAPH": 59, - "C3_ENTRYPOINTS": 18 - } - } - }, - { - "step": "pre_evidence_gate", - "status": "blocked", - "timings_ms": { - "pre_evidence_gate": 1 - }, - "input": { - "resolved_target": null, - "sub_intent": "EXPLAIN", - "target_type": "none", - "evidence_count": 0, - "code_chunk_count": 0, - "entrypoint_count": 0, - "relation_count": 0, - "test_evidence_count": 0, - "symbol_resolution_status": "not_found", - "path_scope": [] - }, - "output": { - "passed": false, - "failure_reasons": [ - "insufficient_evidence" - ], - "degraded_message": "Insufficient evidence for a confident answer. Evidence count: 0 (minimum required not met).", - "evidence_count": 0 - } - }, - { - "step": "llm", - "status": "skipped", - "timings_ms": { - "llm": 1 - }, - "output": { - "reason": "policy_short_circuit", - "answer_mode": "not_found", - "decision_reason": "symbol_resolution_not_found", - "answer_policy_branch": "explain_not_found" - } - }, - { - "step": "post_evidence_gate", - "status": "skipped", - "timings_ms": { - "post_evidence_gate": 1 - }, - "input": { - "answer_mode": "not_found", - "draft_present": false, - "resolved_target": null - }, - "output": { - "reason": "no_draft_answer" - } - } -] - -## Diagnostics -{ - "intent_correct": null, - "target_found": false, - "layers_used": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_sufficient": false, - "answer_mode": "insufficient", - "resolved_target": null, - "answer_policy_branch": "explain_not_found", - "decision_reason": "symbol_resolution_not_found", - "router_result": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "retrieval_profile": "code", - "sub_intent": "EXPLAIN", - "path_scope": [], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "symbol_resolution_status": "not_found" - }, - "retrieval_request": { - "rag_session_id": "7d11da21-faa0-4cea-aede-aeabe069164c", - "query": "Объясни класс RuntimeFactoryManager", - "sub_intent": "EXPLAIN", - "path_scope": [], - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "per_layer_outcome": [ - { - "layer_id": "C1_SYMBOL_CATALOG", - "hit_count": 0, - "empty": true, - "fallback_used": false - }, - { - "layer_id": "C0_SOURCE_CHUNKS", - "hit_count": 0, - "empty": true, - "fallback_used": false - }, - { - "layer_id": "C4_SEMANTIC_ROLES", - "hit_count": 0, - "empty": true, - "fallback_used": false - }, - { - "layer_id": "C2_DEPENDENCY_GRAPH", - "hit_count": 0, - "empty": true, - "fallback_used": false - }, - { - "layer_id": "C3_ENTRYPOINTS", - "hit_count": 0, - "empty": true, - "fallback_used": false - } - ], - "empty_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "evidence_gate_decision": { - "sufficient": false, - "failure_reasons": [ - "insufficient_evidence" - ], - "evidence_count": 0 - }, - "evidence_gate_input": { - "resolved_target": null, - "sub_intent": "EXPLAIN", - "target_type": "none", - "evidence_count": 0, - "code_chunk_count": 0, - "entrypoint_count": 0, - "relation_count": 0, - "test_evidence_count": 0, - "symbol_resolution_status": "not_found", - "path_scope": [] - }, - "post_evidence_gate": { - "input": { - "answer_mode": "not_found", - "draft_present": false, - "resolved_target": null - }, - "output": { - "reason": "no_draft_answer" - } - }, - "failure_reasons": [ - "insufficient_evidence" - ], - "timings_ms": { - "router": 2, - "retrieval": 184, - "pre_evidence_gate": 1, - "post_evidence_gate": 1 - } -} - -## Mismatches -- none \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/plba_full_chain_subintents_v3/20260312_174008/full_chain_plba_code_subintents_v2_plba-v2-explain-runtime-manager.json b/tests/pipeline_setup_v3/test_results/plba_full_chain_subintents_v3/20260312_174008/full_chain_plba_code_subintents_v2_plba-v2-explain-runtime-manager.json deleted file mode 100644 index e95197d..0000000 --- a/tests/pipeline_setup_v3/test_results/plba_full_chain_subintents_v3/20260312_174008/full_chain_plba_code_subintents_v2_plba-v2-explain-runtime-manager.json +++ /dev/null @@ -1,4364 +0,0 @@ -{ - "case_id": "plba-v2-explain-runtime-manager", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_02_pipeline/full_chain_plba_code_subintents_v2.yaml", - "runner": "agent_runtime", - "mode": "full_chain", - "query": "Объясни как работает класс RuntimeManager", - "actual": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 33, - "llm_answer": "Класс `RuntimeManager` определён в файле `src/app_runtime/core/runtime.py` и имеет responsibilities характерные для менеджера: управляет конфигурацией, состоянием и участвует в потоках данных через 50 срезов dataflow.\n\nКонструктор `RuntimeManager.__init__` инициализирует объект и вызывает:\n- `RuntimeManager.configuration`\n- `RuntimeManager.add_config_file`\n\nСвязи и вызовы других сущностей не указаны явно в данном контексте, но известно, что `RuntimeManager` используется в службах контроля (`ControlPlaneService`) и взаимодействует с ними через методы старта, стопа и получения снимков состояния.\n\nДополнительные детали о взаимодействии с другими компонентами отсутствуют в представленном контексте.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "RuntimeManager" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "passed": true, - "mismatches": [], - "details": { - "query": "Объясни как работает класс RuntimeManager", - "router_result": { - "schema_version": "1.1", - "intent": "CODE_QA", - "retrieval_profile": "code", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query_plan": { - "raw": "Объясни как работает класс RuntimeManager", - "normalized": "Объясни как работает класс RuntimeManager", - "sub_intent": "EXPLAIN", - "negations": [], - "expansions": [ - "RuntimeManager" - ], - "keyword_hints": [ - "RuntimeManager" - ], - "path_hints": [], - "doc_scope_hints": [], - "symbol_candidates": [ - "RuntimeManager" - ], - "symbol_kind_hint": "class", - "anchors": [ - { - "type": "SYMBOL", - "value": "RuntimeManager", - "source": "user_text", - "subtype": null, - "span": { - "start": 27, - "end": 41 - }, - "confidence": 0.88 - }, - { - "type": "KEY_TERM", - "value": "класс", - "source": "user_text", - "subtype": null, - "span": { - "start": 21, - "end": 26 - }, - "confidence": 0.9 - } - ] - }, - "retrieval_spec": { - "domains": [ - "CODE" - ], - "layer_queries": [ - { - "layer_id": "C1_SYMBOL_CATALOG", - "top_k": 8 - }, - { - "layer_id": "C0_SOURCE_CHUNKS", - "top_k": 8 - }, - { - "layer_id": "C4_SEMANTIC_ROLES", - "top_k": 8 - }, - { - "layer_id": "C2_DEPENDENCY_GRAPH", - "top_k": 6 - }, - { - "layer_id": "C3_ENTRYPOINTS", - "top_k": 6 - } - ], - "filters": { - "test_policy": "EXCLUDE", - "path_scope": [], - "language": [ - "python" - ] - }, - "rerank_profile": "code" - }, - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - }, - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "RuntimeManager", - "alternatives": [ - "RuntimeManager", - "RuntimeManager", - "RuntimeManager", - "RuntimeManager", - "RuntimeManager" - ], - "confidence": 0.99 - }, - "evidence_policy": { - "require_def": true, - "require_flow": true, - "require_spec": false, - "allow_answer_without_evidence": false - } - }, - "retrieval_request": { - "rag_session_id": "7d11da21-faa0-4cea-aede-aeabe069164c", - "query": "Объясни как работает класс RuntimeManager", - "sub_intent": "EXPLAIN", - "path_scope": [], - "keyword_hints": [ - "RuntimeManager" - ], - "symbol_candidates": [ - "RuntimeManager" - ], - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_spec": { - "domains": [ - "CODE" - ], - "layer_queries": [ - { - "layer_id": "C1_SYMBOL_CATALOG", - "top_k": 8 - }, - { - "layer_id": "C0_SOURCE_CHUNKS", - "top_k": 8 - }, - { - "layer_id": "C4_SEMANTIC_ROLES", - "top_k": 8 - }, - { - "layer_id": "C2_DEPENDENCY_GRAPH", - "top_k": 6 - }, - { - "layer_id": "C3_ENTRYPOINTS", - "top_k": 6 - } - ], - "filters": { - "test_policy": "EXCLUDE", - "path_scope": [], - "language": [ - "python" - ] - }, - "rerank_profile": "code" - }, - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - }, - "query_plan": { - "raw": "Объясни как работает класс RuntimeManager", - "normalized": "Объясни как работает класс RuntimeManager", - "sub_intent": "EXPLAIN", - "negations": [], - "expansions": [ - "RuntimeManager" - ], - "keyword_hints": [ - "RuntimeManager" - ], - "path_hints": [], - "doc_scope_hints": [], - "symbol_candidates": [ - "RuntimeManager" - ], - "symbol_kind_hint": "class", - "anchors": [ - { - "type": "SYMBOL", - "value": "RuntimeManager", - "source": "user_text", - "subtype": null, - "span": { - "start": 27, - "end": 41 - }, - "confidence": 0.88 - }, - { - "type": "KEY_TERM", - "value": "класс", - "source": "user_text", - "subtype": null, - "span": { - "start": 21, - "end": 26 - }, - "confidence": 0.9 - } - ] - } - }, - "retrieval_result": { - "target_symbol_candidates": [ - "RuntimeManager", - "ControlPlaneService", - "ControlChannel.start", - "ControlChannel.stop" - ], - "resolved_symbol": "RuntimeManager", - "symbol_resolution_status": "resolved", - "file_candidates": [ - "src/plba/bootstrap.py", - "src/app_runtime/control/service.py", - "src/app_runtime/core/runtime.py", - "src/plba/__init__.py", - "src/plba/core.py", - "src/app_runtime/control/__init__.py", - "src/app_runtime/control/base.py", - "src/app_runtime/control/http_runner.py", - "src/app_runtime/control/http_app.py", - "src/app_runtime/control/http_channel.py", - "src/plba/control.py", - "src/app_runtime/workflow/persistence/workflow_persistence.py" - ], - "code_chunks": [ - { - "layer": "C1_SYMBOL_CATALOG", - "path": "src/plba/bootstrap.py", - "title": "RuntimeManager", - "content": "const RuntimeManager\nRuntimeManager = app_runtime.core.runtime.RuntimeManager", - "start_line": 4, - "end_line": 4, - "metadata": { - "symbol_id": "27158ca220022eeb5083c6addf8a50775d45f7161284fd60aac48410105f4b98", - "qname": "RuntimeManager", - "kind": "const", - "signature": "RuntimeManager = app_runtime.core.runtime.RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "src.plba.bootstrap", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C1_SYMBOL_CATALOG", - "path": "src/app_runtime/control/service.py", - "title": "RuntimeManager", - "content": "const RuntimeManager\nRuntimeManager = app_runtime.core.runtime.RuntimeManager", - "start_line": 9, - "end_line": 9, - "metadata": { - "symbol_id": "62a9575c77aad894120d18b4f2a08cf2ba42f77e9be4a8a432b767d157701afe", - "qname": "RuntimeManager", - "kind": "const", - "signature": "RuntimeManager = app_runtime.core.runtime.RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.control.service", - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C1_SYMBOL_CATALOG", - "path": "src/app_runtime/core/runtime.py", - "title": "RuntimeManager", - "content": "class RuntimeManager\nRuntimeManager", - "start_line": 18, - "end_line": 179, - "metadata": { - "symbol_id": "7e4a9381328c5803bbc6179458612fc4e947d928aa7bf8b4b2bebb2c8592f758", - "qname": "RuntimeManager", - "kind": "class", - "signature": "RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.core.runtime", - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C1_SYMBOL_CATALOG", - "path": "src/plba/__init__.py", - "title": "RuntimeManager", - "content": "const RuntimeManager\nRuntimeManager = plba.core.RuntimeManager", - "start_line": 16, - "end_line": 16, - "metadata": { - "symbol_id": "7eacec84f9b8d6c4201374591faecdac7493091c263681495c338973f2971ad9", - "qname": "RuntimeManager", - "kind": "const", - "signature": "RuntimeManager = plba.core.RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "src.plba.__init__", - "is_test": false, - "blob_sha": "24e755ec8c249d14fb0e675b5dbf2b71ab91afb9c849897eebfa9feb2499e19d", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C1_SYMBOL_CATALOG", - "path": "src/plba/core.py", - "title": "RuntimeManager", - "content": "const RuntimeManager\nRuntimeManager = app_runtime.core.runtime.RuntimeManager", - "start_line": 2, - "end_line": 2, - "metadata": { - "symbol_id": "e1684562d978b7af7fe9b27dc5869d770348a87b5dc19a50360f58544668578b", - "qname": "RuntimeManager", - "kind": "const", - "signature": "RuntimeManager = app_runtime.core.runtime.RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "src.plba.core", - "is_test": false, - "blob_sha": "c0ae25110d20e665216616e26b68adfe035b624ba45d31d1272fb21f906f9ca8", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C1_SYMBOL_CATALOG", - "path": "src/app_runtime/control/__init__.py", - "title": "ControlPlaneService", - "content": "const ControlPlaneService\nControlPlaneService = app_runtime.control.service.ControlPlaneService", - "start_line": 3, - "end_line": 3, - "metadata": { - "symbol_id": "217e8f044d1c01644bf7b81e5046af9e84469210c692a2fb0c476a19bb069ae1", - "qname": "ControlPlaneService", - "kind": "const", - "signature": "ControlPlaneService = app_runtime.control.service.ControlPlaneService", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.control.__init__", - "is_test": false, - "blob_sha": "bf3c37e3369a84cc618adc0fd71c232e5eb4b871eaff743069a17e661e498316", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C1_SYMBOL_CATALOG", - "path": "src/app_runtime/control/base.py", - "title": "ControlChannel.start", - "content": "method ControlChannel.start\nstart(self, actions)\nStart the control channel and bind handlers.", - "start_line": 23, - "end_line": 24, - "metadata": { - "symbol_id": "e01e0d50d0f48d0c84c119c989b7a7c57ceea263811ce2605c684ae24d1a03b1", - "qname": "ControlChannel.start", - "kind": "method", - "signature": "start(self, actions)", - "parent_symbol_id": "ControlChannel", - "package_or_module": "src.app_runtime.control.base", - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C1_SYMBOL_CATALOG", - "path": "src/app_runtime/control/base.py", - "title": "ControlChannel.stop", - "content": "method ControlChannel.stop\nstop(self)\nStop the control channel and release resources.", - "start_line": 27, - "end_line": 28, - "metadata": { - "symbol_id": "54b5adf9866c526836221dc721b474ba23fbec83e1b1d3b8bc4da67ae3c1541d", - "qname": "ControlChannel.stop", - "kind": "method", - "signature": "stop(self)", - "parent_symbol_id": "ControlChannel", - "package_or_module": "src.app_runtime.control.base", - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C0_SOURCE_CHUNKS", - "path": "src/app_runtime/control/service.py", - "title": "src/app_runtime/control/service.py:ControlPlaneService", - "content": "class ControlPlaneService:\n def __init__(self) -> None:\n self._channels: list[ControlChannel] = []\n\n def register_channel(self, channel: ControlChannel) -> None:\n self._channels.append(channel)\n\n def start(self, runtime: RuntimeManager) -> None:\n if not self._channels:\n return\n asyncio.run(self._start_async(runtime))\n\n def stop(self) -> None:\n if not self._channels:\n return\n asyncio.run(self._stop_async())\n\n def snapshot(self, runtime: RuntimeManager) -> dict[str, object]:\n health = runtime.current_health()\n return {\n \"runtime\": {\"state\": runtime._state.value},\n \"modules\": list(runtime.registry.modules),\n \"services\": runtime.services.snapshot(),\n \"workers\": runtime.workers.snapshot(),\n \"health\": runtime.health.snapshot(runtime.workers.healths()) | {\"status\": health[\"status\"]},\n \"config\": runtime.configuration.get(),\n }\n\n async def _start_async(self, runtime: RuntimeManager) -> None:\n actions = ControlActionSet(\n health=runtime.health_status,\n start=runtime.start_runtime,\n stop=runtime.stop_runtime,\n status=runtime.runtime_status,\n )\n for channel in self._channels:\n await channel.start(actions)\n\n async def _stop_async(self) -> None:\n for channel in reversed(self._channels):\n await channel.stop()", - "start_line": 12, - "end_line": 52, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.service", - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C0_SOURCE_CHUNKS", - "path": "src/app_runtime/control/http_runner.py", - "title": "src/app_runtime/control/http_runner.py:UvicornThreadRunner", - "content": "class UvicornThreadRunner:\n def __init__(self, host: str, port: int, timeout: int) -> None:\n self._host = host\n self._port = port\n self._timeout = timeout\n self._server: Server | None = None\n self._thread: Thread | None = None\n self._error: BaseException | None = None\n\n async def start(self, app: FastAPI) -> None:\n if self._thread is not None and self._thread.is_alive():\n return\n self._error = None\n config = Config(app=app, host=self._host, port=self._port, log_level=\"warning\")\n self._server = Server(config)\n self._thread = Thread(target=self._serve, name=\"plba-http-control\", daemon=True)\n self._thread.start()\n await self._wait_until_started()\n\n async def stop(self) -> None:\n if self._server is None or self._thread is None:\n return\n self._server.should_exit = True\n await asyncio.to_thread(self._thread.join, self._timeout)\n self._server = None\n self._thread = None\n\n @property\n def port(self) -> int:\n if self._server is None or not getattr(self._server, \"servers\", None):\n return self._port\n socket = self._server.servers[0].sockets[0]\n return int(socket.getsockname()[1])\n\n async def _wait_until_started(self) -> None:\n if self._server is None:\n raise RuntimeError(\"Server is not initialized\")\n deadline = asyncio.get_running_loop().time() + max(float(self._timeout), 1.0)\n while not self._server.started:\n if self._error is not None:\n raise RuntimeError(\"HTTP control server failed to start\") from self._error\n if asyncio.get_running_loop().time() >= deadline:\n raise TimeoutError(\"HTTP control server startup timed out\")\n await asyncio.sleep(0.05)\n\n def _serve(self) -> None:\n if self._server is None:\n return\n try:\n asyncio.run(self._server.serve())\n except BaseException as exc: # noqa: BLE001\n self._error = exc", - "start_line": 10, - "end_line": 61, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.http_runner", - "is_test": false, - "blob_sha": "3779fdd2878b770e789a35bb2a89c9d79f13b61c26d7db1b3b683f9bb9e1623f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C0_SOURCE_CHUNKS", - "path": "src/app_runtime/control/base.py", - "title": "src/app_runtime/control/base.py:ControlChannel", - "content": "class ControlChannel(ABC):\n @abstractmethod\n async def start(self, actions: ControlActionSet) -> None:\n \"\"\"Start the control channel and bind handlers.\"\"\"\n\n @abstractmethod\n async def stop(self) -> None:\n \"\"\"Stop the control channel and release resources.\"\"\"", - "start_line": 21, - "end_line": 28, - "metadata": { - "chunk_index": 1, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.base", - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C0_SOURCE_CHUNKS", - "path": "src/app_runtime/control/__init__.py", - "title": "src/app_runtime/control/__init__.py:1-5", - "content": "from app_runtime.control.base import ControlActionSet, ControlChannel\nfrom app_runtime.control.http_channel import HttpControlChannel\nfrom app_runtime.control.service import ControlPlaneService\n\n__all__ = [\"ControlActionSet\", \"ControlChannel\", \"ControlPlaneService\", \"HttpControlChannel\"]", - "start_line": 1, - "end_line": 5, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.app_runtime.control.__init__", - "is_test": false, - "blob_sha": "bf3c37e3369a84cc618adc0fd71c232e5eb4b871eaff743069a17e661e498316", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C0_SOURCE_CHUNKS", - "path": "src/app_runtime/control/http_app.py", - "title": "src/app_runtime/control/http_app.py:HttpControlAppFactory", - "content": "class HttpControlAppFactory:\n def create(\n self,\n health_provider: Callable[[], Awaitable[HealthPayload]],\n action_provider: Callable[[str, str], Awaitable[JSONResponse]],\n ) -> FastAPI:\n app = FastAPI(title=\"PLBA Control API\")\n\n @app.middleware(\"http\")\n async def log_api_call(request: Request, call_next): # type: ignore[no-untyped-def]\n started = time.monotonic()\n response = await call_next(request)\n response.headers[\"X-Response-Time-Ms\"] = str(int((time.monotonic() - started) * 1000))\n return response\n\n @app.get(\"/health\")\n async def health() -> JSONResponse:\n payload = await health_provider()\n status_code = 200 if payload.get(\"status\") == \"ok\" else 503\n return JSONResponse(content=payload, status_code=status_code)\n\n @app.get(\"/actions/{action}\")\n @app.post(\"/actions/{action}\")\n async def action(action: str, request: Request) -> JSONResponse:\n client_source = self._client_source(request)\n if action in {\"start\", \"stop\"}:\n LOGGER.warning(\"Control action requested: /actions/%s client=%s\", action, client_source)\n return await action_provider(action, client_source)\n\n return app\n\n def _client_source(self, request: Request) -> str:\n explicit_header = request.headers.get(\"X-Client-Source\", \"\").strip()\n if explicit_header:\n return explicit_header\n user_agent = request.headers.get(\"User-Agent\", \"\").strip()\n if user_agent:\n return f\"user-agent:{user_agent}\"\n return \"unknown\"", - "start_line": 15, - "end_line": 53, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.http_app", - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C0_SOURCE_CHUNKS", - "path": "src/app_runtime/control/http_channel.py", - "title": "src/app_runtime/control/http_channel.py:HttpControlChannel", - "content": "class HttpControlChannel(ControlChannel):\n def __init__(self, host: str, port: int, timeout: int) -> None:\n self._timeout = timeout\n self._runner = UvicornThreadRunner(host, port, timeout)\n self._factory = HttpControlAppFactory()\n self._actions: ControlActionSet | None = None\n\n async def start(self, actions: ControlActionSet) -> None:\n self._actions = actions\n app = self._factory.create(self._health_response, self._action_response)\n await self._runner.start(app)\n\n async def stop(self) -> None:\n await self._runner.stop()\n\n @property\n def port(self) -> int:\n return self._runner.port\n\n async def _health_response(self) -> dict[str, object]:\n if self._actions is None:\n return {\"status\": \"unhealthy\", \"detail\": \"control actions are not configured\"}\n return await asyncio.wait_for(self._actions.health(), timeout=float(self._timeout))\n\n async def _action_response(self, action: str, _client_source: str = \"unknown\") -> JSONResponse:\n if self._actions is None:\n return JSONResponse(content={\"status\": \"error\", \"detail\": f\"{action} handler is not configured\"}, status_code=404)\n callbacks = {\n \"start\": self._actions.start,\n \"stop\": self._actions.stop,\n \"status\": self._actions.status,\n }\n callback = callbacks.get(action)\n if callback is None:\n return JSONResponse(content={\"status\": \"error\", \"detail\": f\"unsupported action: {action}\"}, status_code=404)\n action_timeout = max(float(self._timeout), 10.0) if action in {\"start\", \"stop\"} else float(self._timeout)\n try:\n detail = await asyncio.wait_for(callback(), timeout=action_timeout)\n except asyncio.TimeoutError:\n return JSONResponse(\n content={\"status\": \"accepted\", \"detail\": f\"{action} operation is still in progress\"},\n status_code=202,\n )\n except Exception as exc:\n return JSONResponse(content={\"status\": \"error\", \"detail\": str(exc)}, status_code=500)\n return JSONResponse(content={\"status\": \"ok\", \"detail\": detail or f\"{action} action accepted\"}, status_code=200)", - "start_line": 12, - "end_line": 57, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.http_channel", - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C0_SOURCE_CHUNKS", - "path": "src/app_runtime/control/base.py", - "title": "src/app_runtime/control/base.py:ControlActionSet", - "content": "class ControlActionSet:\n health: HealthHandler\n start: ActionHandler\n stop: ActionHandler\n status: ActionHandler", - "start_line": 14, - "end_line": 18, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.base", - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C0_SOURCE_CHUNKS", - "path": "src/plba/control.py", - "title": "src/plba/control.py:1-10", - "content": "from app_runtime.control.base import ControlActionSet, ControlChannel\nfrom app_runtime.control.http_channel import HttpControlChannel\nfrom app_runtime.control.service import ControlPlaneService\n\n__all__ = [\n \"ControlActionSet\",\n \"ControlChannel\",\n \"ControlPlaneService\",\n \"HttpControlChannel\",\n]", - "start_line": 1, - "end_line": 10, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.plba.control", - "is_test": false, - "blob_sha": "31bd5c4481bfa7fbca8fae56d4860a67e3953ca74474ac8439e1f39b685d7bc8", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C4_SEMANTIC_ROLES", - "path": "src/app_runtime/core/runtime.py", - "title": "RuntimeManager", - "content": "RuntimeManager\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests manager\n- orchestrates role-like calls (4)\n- reads and writes state attributes\n- participates in dataflow slices (50)", - "start_line": 18, - "end_line": 179, - "metadata": { - "symbol_id": "7e4a9381328c5803bbc6179458612fc4e947d928aa7bf8b4b2bebb2c8592f758", - "symbol_name": "RuntimeManager", - "qname": "RuntimeManager", - "role": "pipeline_stage", - "confidence": 0.67, - "dataflow_participation": 50, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C4_SEMANTIC_ROLES", - "path": "src/app_runtime/control/base.py", - "title": "ControlChannel", - "content": "ControlChannel\nrole: model\n\nResponsibilities:\n- default model role", - "start_line": 21, - "end_line": 28, - "metadata": { - "symbol_id": "cfcfe9a311d3a2dbdaf32ac4ccd73c0eb9a117f830591a1c0867ee97d46204ff", - "symbol_name": "ControlChannel", - "qname": "ControlChannel", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C4_SEMANTIC_ROLES", - "path": "src/app_runtime/control/base.py", - "title": "ControlActionSet", - "content": "ControlActionSet\nrole: model\n\nResponsibilities:\n- default model role", - "start_line": 14, - "end_line": 18, - "metadata": { - "symbol_id": "46eb026cb3313415ec47b82dd22f84f4d112c9d987e8b1716dcb0baa1cce8988", - "symbol_name": "ControlActionSet", - "qname": "ControlActionSet", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C4_SEMANTIC_ROLES", - "path": "src/app_runtime/control/service.py", - "title": "ControlPlaneService", - "content": "ControlPlaneService\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests service\n- reads and writes state attributes\n- participates in dataflow slices (5)", - "start_line": 12, - "end_line": 52, - "metadata": { - "symbol_id": "b13471e5916986dccffb53fab613812842965705e6b3a89ae549d30c9e91e9aa", - "symbol_name": "ControlPlaneService", - "qname": "ControlPlaneService", - "role": "pipeline_stage", - "confidence": 0.57, - "dataflow_participation": 5, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C4_SEMANTIC_ROLES", - "path": "src/app_runtime/control/http_runner.py", - "title": "UvicornThreadRunner", - "content": "UvicornThreadRunner\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (24)", - "start_line": 10, - "end_line": 61, - "metadata": { - "symbol_id": "fd55630045a02100df8877ac27d951ee08617d4598764394d48cb51fe067476a", - "symbol_name": "UvicornThreadRunner", - "qname": "UvicornThreadRunner", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 24, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "3779fdd2878b770e789a35bb2a89c9d79f13b61c26d7db1b3b683f9bb9e1623f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C4_SEMANTIC_ROLES", - "path": "src/app_runtime/control/http_channel.py", - "title": "HttpControlChannel", - "content": "HttpControlChannel\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (10)", - "start_line": 12, - "end_line": 57, - "metadata": { - "symbol_id": "1c9fbdc24819e5604c26ea55428a74310f03a03e1af197ed84846af61e42fdb0", - "symbol_name": "HttpControlChannel", - "qname": "HttpControlChannel", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 10, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C4_SEMANTIC_ROLES", - "path": "src/app_runtime/control/http_app.py", - "title": "HttpControlAppFactory", - "content": "HttpControlAppFactory\nrole: factory\n\nResponsibilities:\n- name suffix suggests factory", - "start_line": 15, - "end_line": 53, - "metadata": { - "symbol_id": "9b3502a5fb408b273223db13264349cf500de24915b6c649d9ea8970d0dfd8e0", - "symbol_name": "HttpControlAppFactory", - "qname": "HttpControlAppFactory", - "role": "factory", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C4_SEMANTIC_ROLES", - "path": "src/app_runtime/workflow/persistence/workflow_persistence.py", - "title": "WorkflowPersistence", - "content": "WorkflowPersistence\nrole: pipeline_stage\n\nResponsibilities:\n- orchestrates role-like calls (2)\n- reads and writes state attributes\n- participates in dataflow slices (16)", - "start_line": 8, - "end_line": 54, - "metadata": { - "symbol_id": "7bd01ee45cf31f2d5c2e3e51656254860ac785d10cef9e0852cd4fba90857bae", - "symbol_name": "WorkflowPersistence", - "qname": "WorkflowPersistence", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 16, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "80e9410ddc639789b4353c2a1a757ba8d0d5b5bb6075b0b263b61551f04ae1f0", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "path": "src/app_runtime/control/service.py", - "title": "ControlPlaneService.__init__:dataflow_slice", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.stop", - "start_line": 14, - "end_line": 25, - "metadata": { - "edge_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d", - "dst_ref": "ControlPlaneService.stop", - "resolution": "resolved", - "slice_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.stop" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "path": "src/app_runtime/control/service.py", - "title": "ControlPlaneService.__init__:dataflow_slice", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._stop_async", - "start_line": 14, - "end_line": 51, - "metadata": { - "edge_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a", - "dst_ref": "ControlPlaneService._stop_async", - "resolution": "resolved", - "slice_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._stop_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "path": "src/app_runtime/control/service.py", - "title": "ControlPlaneService.__init__:dataflow_slice", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.register_channel", - "start_line": 14, - "end_line": 17, - "metadata": { - "edge_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957", - "dst_ref": "ControlPlaneService.register_channel", - "resolution": "resolved", - "slice_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.register_channel" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "path": "src/app_runtime/control/service.py", - "title": "ControlPlaneService.__init__:dataflow_slice", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.start", - "start_line": 14, - "end_line": 20, - "metadata": { - "edge_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154", - "dst_ref": "ControlPlaneService.start", - "resolution": "resolved", - "slice_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.start" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "path": "src/app_runtime/control/service.py", - "title": "ControlPlaneService.__init__:dataflow_slice", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._start_async", - "start_line": 14, - "end_line": 47, - "metadata": { - "edge_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517", - "dst_ref": "ControlPlaneService._start_async", - "resolution": "resolved", - "slice_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._start_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "path": "src/app_runtime/core/runtime.py", - "title": "RuntimeManager.__init__:dataflow_slice", - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager.add_config_file", - "start_line": 32, - "end_line": 52, - "metadata": { - "edge_id": "a23b8a11ebdb12708b60c96ea12a69f7f042082f1adfddd572444e246d81d167", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "57ffbd4f0d9fdf3507c2b8624312ce211f3d02fdf86a57a8ec90778d8a7b498d", - "dst_ref": "RuntimeManager.add_config_file", - "resolution": "resolved", - "slice_id": "a23b8a11ebdb12708b60c96ea12a69f7f042082f1adfddd572444e246d81d167", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager.add_config_file" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "57ffbd4f0d9fdf3507c2b8624312ce211f3d02fdf86a57a8ec90778d8a7b498d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C3_ENTRYPOINTS", - "path": "src/app_runtime/control/http_app.py", - "title": "app.post", - "content": "fastapi http app.post", - "start_line": 38, - "end_line": 42, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C3_ENTRYPOINTS", - "path": "src/app_runtime/control/http_app.py", - "title": "app.get", - "content": "fastapi http app.get", - "start_line": 31, - "end_line": 34, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C3_ENTRYPOINTS", - "path": "src/app_runtime/control/http_app.py", - "title": "app.get", - "content": "fastapi http app.get", - "start_line": 38, - "end_line": 42, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "relations": [ - { - "path": "src/app_runtime/control/service.py", - "metadata": { - "edge_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d", - "dst_ref": "ControlPlaneService.stop", - "resolution": "resolved", - "slice_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.stop" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - }, - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.stop" - }, - { - "path": "src/app_runtime/control/service.py", - "metadata": { - "edge_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a", - "dst_ref": "ControlPlaneService._stop_async", - "resolution": "resolved", - "slice_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._stop_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - }, - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._stop_async" - }, - { - "path": "src/app_runtime/control/service.py", - "metadata": { - "edge_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957", - "dst_ref": "ControlPlaneService.register_channel", - "resolution": "resolved", - "slice_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.register_channel" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - }, - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.register_channel" - }, - { - "path": "src/app_runtime/control/service.py", - "metadata": { - "edge_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154", - "dst_ref": "ControlPlaneService.start", - "resolution": "resolved", - "slice_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.start" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - }, - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.start" - }, - { - "path": "src/app_runtime/control/service.py", - "metadata": { - "edge_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517", - "dst_ref": "ControlPlaneService._start_async", - "resolution": "resolved", - "slice_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._start_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - }, - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._start_async" - }, - { - "path": "src/app_runtime/core/runtime.py", - "metadata": { - "edge_id": "a23b8a11ebdb12708b60c96ea12a69f7f042082f1adfddd572444e246d81d167", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "57ffbd4f0d9fdf3507c2b8624312ce211f3d02fdf86a57a8ec90778d8a7b498d", - "dst_ref": "RuntimeManager.add_config_file", - "resolution": "resolved", - "slice_id": "a23b8a11ebdb12708b60c96ea12a69f7f042082f1adfddd572444e246d81d167", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager.add_config_file" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "57ffbd4f0d9fdf3507c2b8624312ce211f3d02fdf86a57a8ec90778d8a7b498d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - }, - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager.add_config_file" - } - ], - "entrypoints": [ - { - "path": "src/app_runtime/control/http_app.py", - "title": "app.get", - "start_line": 31, - "end_line": 34, - "http_method": "GET", - "route_path": "/health", - "handler_symbol": "health", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "route_or_command": "app.get", - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "title": "app.get", - "start_line": 38, - "end_line": 42, - "http_method": "GET", - "route_path": "/actions/{action}", - "handler_symbol": "action", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "route_or_command": "app.get", - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "title": "app.post", - "start_line": 38, - "end_line": 42, - "http_method": "POST", - "route_path": "/actions/{action}", - "handler_symbol": "action", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "route_or_command": "app.post", - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "test_candidates": [], - "layer_outcomes": [ - { - "layer_id": "C1_SYMBOL_CATALOG", - "hit_count": 8, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C0_SOURCE_CHUNKS", - "hit_count": 8, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C4_SEMANTIC_ROLES", - "hit_count": 8, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C2_DEPENDENCY_GRAPH", - "hit_count": 6, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C3_ENTRYPOINTS", - "hit_count": 3, - "empty": false, - "fallback_used": false - } - ], - "missing_layers": [], - "raw_rows": [ - { - "path": "src/plba/bootstrap.py", - "content": "const RuntimeManager\nRuntimeManager = app_runtime.core.runtime.RuntimeManager", - "layer": "C1_SYMBOL_CATALOG", - "title": "RuntimeManager", - "span_start": 4, - "span_end": 4, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": null, - "metadata": { - "symbol_id": "27158ca220022eeb5083c6addf8a50775d45f7161284fd60aac48410105f4b98", - "qname": "RuntimeManager", - "kind": "const", - "signature": "RuntimeManager = app_runtime.core.runtime.RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "src.plba.bootstrap", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "const RuntimeManager\nRuntimeManager = app_runtime.core.runtime.RuntimeManager", - "layer": "C1_SYMBOL_CATALOG", - "title": "RuntimeManager", - "span_start": 9, - "span_end": 9, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": null, - "metadata": { - "symbol_id": "62a9575c77aad894120d18b4f2a08cf2ba42f77e9be4a8a432b767d157701afe", - "qname": "RuntimeManager", - "kind": "const", - "signature": "RuntimeManager = app_runtime.core.runtime.RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.control.service", - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "class RuntimeManager\nRuntimeManager", - "layer": "C1_SYMBOL_CATALOG", - "title": "RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": null, - "metadata": { - "symbol_id": "7e4a9381328c5803bbc6179458612fc4e947d928aa7bf8b4b2bebb2c8592f758", - "qname": "RuntimeManager", - "kind": "class", - "signature": "RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.core.runtime", - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/__init__.py", - "content": "const RuntimeManager\nRuntimeManager = plba.core.RuntimeManager", - "layer": "C1_SYMBOL_CATALOG", - "title": "RuntimeManager", - "span_start": 16, - "span_end": 16, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": null, - "metadata": { - "symbol_id": "7eacec84f9b8d6c4201374591faecdac7493091c263681495c338973f2971ad9", - "qname": "RuntimeManager", - "kind": "const", - "signature": "RuntimeManager = plba.core.RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "src.plba.__init__", - "is_test": false, - "blob_sha": "24e755ec8c249d14fb0e675b5dbf2b71ab91afb9c849897eebfa9feb2499e19d", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/core.py", - "content": "const RuntimeManager\nRuntimeManager = app_runtime.core.runtime.RuntimeManager", - "layer": "C1_SYMBOL_CATALOG", - "title": "RuntimeManager", - "span_start": 2, - "span_end": 2, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": null, - "metadata": { - "symbol_id": "e1684562d978b7af7fe9b27dc5869d770348a87b5dc19a50360f58544668578b", - "qname": "RuntimeManager", - "kind": "const", - "signature": "RuntimeManager = app_runtime.core.runtime.RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "src.plba.core", - "is_test": false, - "blob_sha": "c0ae25110d20e665216616e26b68adfe035b624ba45d31d1272fb21f906f9ca8", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/__init__.py", - "content": "const ControlPlaneService\nControlPlaneService = app_runtime.control.service.ControlPlaneService", - "layer": "C1_SYMBOL_CATALOG", - "title": "ControlPlaneService", - "span_start": 3, - "span_end": 3, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": null, - "metadata": { - "symbol_id": "217e8f044d1c01644bf7b81e5046af9e84469210c692a2fb0c476a19bb069ae1", - "qname": "ControlPlaneService", - "kind": "const", - "signature": "ControlPlaneService = app_runtime.control.service.ControlPlaneService", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.control.__init__", - "is_test": false, - "blob_sha": "bf3c37e3369a84cc618adc0fd71c232e5eb4b871eaff743069a17e661e498316", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "method ControlChannel.start\nstart(self, actions)\nStart the control channel and bind handlers.", - "layer": "C1_SYMBOL_CATALOG", - "title": "ControlChannel.start", - "span_start": 23, - "span_end": 24, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": null, - "metadata": { - "symbol_id": "e01e0d50d0f48d0c84c119c989b7a7c57ceea263811ce2605c684ae24d1a03b1", - "qname": "ControlChannel.start", - "kind": "method", - "signature": "start(self, actions)", - "parent_symbol_id": "ControlChannel", - "package_or_module": "src.app_runtime.control.base", - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "method ControlChannel.stop\nstop(self)\nStop the control channel and release resources.", - "layer": "C1_SYMBOL_CATALOG", - "title": "ControlChannel.stop", - "span_start": 27, - "span_end": 28, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": null, - "metadata": { - "symbol_id": "54b5adf9866c526836221dc721b474ba23fbec83e1b1d3b8bc4da67ae3c1541d", - "qname": "ControlChannel.stop", - "kind": "method", - "signature": "stop(self)", - "parent_symbol_id": "ControlChannel", - "package_or_module": "src.app_runtime.control.base", - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "class ControlPlaneService:\n def __init__(self) -> None:\n self._channels: list[ControlChannel] = []\n\n def register_channel(self, channel: ControlChannel) -> None:\n self._channels.append(channel)\n\n def start(self, runtime: RuntimeManager) -> None:\n if not self._channels:\n return\n asyncio.run(self._start_async(runtime))\n\n def stop(self) -> None:\n if not self._channels:\n return\n asyncio.run(self._stop_async())\n\n def snapshot(self, runtime: RuntimeManager) -> dict[str, object]:\n health = runtime.current_health()\n return {\n \"runtime\": {\"state\": runtime._state.value},\n \"modules\": list(runtime.registry.modules),\n \"services\": runtime.services.snapshot(),\n \"workers\": runtime.workers.snapshot(),\n \"health\": runtime.health.snapshot(runtime.workers.healths()) | {\"status\": health[\"status\"]},\n \"config\": runtime.configuration.get(),\n }\n\n async def _start_async(self, runtime: RuntimeManager) -> None:\n actions = ControlActionSet(\n health=runtime.health_status,\n start=runtime.start_runtime,\n stop=runtime.stop_runtime,\n status=runtime.runtime_status,\n )\n for channel in self._channels:\n await channel.start(actions)\n\n async def _stop_async(self) -> None:\n for channel in reversed(self._channels):\n await channel.stop()", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/service.py:ControlPlaneService", - "span_start": 12, - "span_end": 52, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": null, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.service", - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_runner.py", - "content": "class UvicornThreadRunner:\n def __init__(self, host: str, port: int, timeout: int) -> None:\n self._host = host\n self._port = port\n self._timeout = timeout\n self._server: Server | None = None\n self._thread: Thread | None = None\n self._error: BaseException | None = None\n\n async def start(self, app: FastAPI) -> None:\n if self._thread is not None and self._thread.is_alive():\n return\n self._error = None\n config = Config(app=app, host=self._host, port=self._port, log_level=\"warning\")\n self._server = Server(config)\n self._thread = Thread(target=self._serve, name=\"plba-http-control\", daemon=True)\n self._thread.start()\n await self._wait_until_started()\n\n async def stop(self) -> None:\n if self._server is None or self._thread is None:\n return\n self._server.should_exit = True\n await asyncio.to_thread(self._thread.join, self._timeout)\n self._server = None\n self._thread = None\n\n @property\n def port(self) -> int:\n if self._server is None or not getattr(self._server, \"servers\", None):\n return self._port\n socket = self._server.servers[0].sockets[0]\n return int(socket.getsockname()[1])\n\n async def _wait_until_started(self) -> None:\n if self._server is None:\n raise RuntimeError(\"Server is not initialized\")\n deadline = asyncio.get_running_loop().time() + max(float(self._timeout), 1.0)\n while not self._server.started:\n if self._error is not None:\n raise RuntimeError(\"HTTP control server failed to start\") from self._error\n if asyncio.get_running_loop().time() >= deadline:\n raise TimeoutError(\"HTTP control server startup timed out\")\n await asyncio.sleep(0.05)\n\n def _serve(self) -> None:\n if self._server is None:\n return\n try:\n asyncio.run(self._server.serve())\n except BaseException as exc: # noqa: BLE001\n self._error = exc", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/http_runner.py:UvicornThreadRunner", - "span_start": 10, - "span_end": 61, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": null, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.http_runner", - "is_test": false, - "blob_sha": "3779fdd2878b770e789a35bb2a89c9d79f13b61c26d7db1b3b683f9bb9e1623f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "class ControlChannel(ABC):\n @abstractmethod\n async def start(self, actions: ControlActionSet) -> None:\n \"\"\"Start the control channel and bind handlers.\"\"\"\n\n @abstractmethod\n async def stop(self) -> None:\n \"\"\"Stop the control channel and release resources.\"\"\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/base.py:ControlChannel", - "span_start": 21, - "span_end": 28, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": null, - "metadata": { - "chunk_index": 1, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.base", - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/__init__.py", - "content": "from app_runtime.control.base import ControlActionSet, ControlChannel\nfrom app_runtime.control.http_channel import HttpControlChannel\nfrom app_runtime.control.service import ControlPlaneService\n\n__all__ = [\"ControlActionSet\", \"ControlChannel\", \"ControlPlaneService\", \"HttpControlChannel\"]", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/__init__.py:1-5", - "span_start": 1, - "span_end": 5, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": null, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.app_runtime.control.__init__", - "is_test": false, - "blob_sha": "bf3c37e3369a84cc618adc0fd71c232e5eb4b871eaff743069a17e661e498316", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "class HttpControlAppFactory:\n def create(\n self,\n health_provider: Callable[[], Awaitable[HealthPayload]],\n action_provider: Callable[[str, str], Awaitable[JSONResponse]],\n ) -> FastAPI:\n app = FastAPI(title=\"PLBA Control API\")\n\n @app.middleware(\"http\")\n async def log_api_call(request: Request, call_next): # type: ignore[no-untyped-def]\n started = time.monotonic()\n response = await call_next(request)\n response.headers[\"X-Response-Time-Ms\"] = str(int((time.monotonic() - started) * 1000))\n return response\n\n @app.get(\"/health\")\n async def health() -> JSONResponse:\n payload = await health_provider()\n status_code = 200 if payload.get(\"status\") == \"ok\" else 503\n return JSONResponse(content=payload, status_code=status_code)\n\n @app.get(\"/actions/{action}\")\n @app.post(\"/actions/{action}\")\n async def action(action: str, request: Request) -> JSONResponse:\n client_source = self._client_source(request)\n if action in {\"start\", \"stop\"}:\n LOGGER.warning(\"Control action requested: /actions/%s client=%s\", action, client_source)\n return await action_provider(action, client_source)\n\n return app\n\n def _client_source(self, request: Request) -> str:\n explicit_header = request.headers.get(\"X-Client-Source\", \"\").strip()\n if explicit_header:\n return explicit_header\n user_agent = request.headers.get(\"User-Agent\", \"\").strip()\n if user_agent:\n return f\"user-agent:{user_agent}\"\n return \"unknown\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/http_app.py:HttpControlAppFactory", - "span_start": 15, - "span_end": 53, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": null, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.http_app", - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "class HttpControlChannel(ControlChannel):\n def __init__(self, host: str, port: int, timeout: int) -> None:\n self._timeout = timeout\n self._runner = UvicornThreadRunner(host, port, timeout)\n self._factory = HttpControlAppFactory()\n self._actions: ControlActionSet | None = None\n\n async def start(self, actions: ControlActionSet) -> None:\n self._actions = actions\n app = self._factory.create(self._health_response, self._action_response)\n await self._runner.start(app)\n\n async def stop(self) -> None:\n await self._runner.stop()\n\n @property\n def port(self) -> int:\n return self._runner.port\n\n async def _health_response(self) -> dict[str, object]:\n if self._actions is None:\n return {\"status\": \"unhealthy\", \"detail\": \"control actions are not configured\"}\n return await asyncio.wait_for(self._actions.health(), timeout=float(self._timeout))\n\n async def _action_response(self, action: str, _client_source: str = \"unknown\") -> JSONResponse:\n if self._actions is None:\n return JSONResponse(content={\"status\": \"error\", \"detail\": f\"{action} handler is not configured\"}, status_code=404)\n callbacks = {\n \"start\": self._actions.start,\n \"stop\": self._actions.stop,\n \"status\": self._actions.status,\n }\n callback = callbacks.get(action)\n if callback is None:\n return JSONResponse(content={\"status\": \"error\", \"detail\": f\"unsupported action: {action}\"}, status_code=404)\n action_timeout = max(float(self._timeout), 10.0) if action in {\"start\", \"stop\"} else float(self._timeout)\n try:\n detail = await asyncio.wait_for(callback(), timeout=action_timeout)\n except asyncio.TimeoutError:\n return JSONResponse(\n content={\"status\": \"accepted\", \"detail\": f\"{action} operation is still in progress\"},\n status_code=202,\n )\n except Exception as exc:\n return JSONResponse(content={\"status\": \"error\", \"detail\": str(exc)}, status_code=500)\n return JSONResponse(content={\"status\": \"ok\", \"detail\": detail or f\"{action} action accepted\"}, status_code=200)", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/http_channel.py:HttpControlChannel", - "span_start": 12, - "span_end": 57, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": null, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.http_channel", - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "class ControlActionSet:\n health: HealthHandler\n start: ActionHandler\n stop: ActionHandler\n status: ActionHandler", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/base.py:ControlActionSet", - "span_start": 14, - "span_end": 18, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": null, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.base", - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/control.py", - "content": "from app_runtime.control.base import ControlActionSet, ControlChannel\nfrom app_runtime.control.http_channel import HttpControlChannel\nfrom app_runtime.control.service import ControlPlaneService\n\n__all__ = [\n \"ControlActionSet\",\n \"ControlChannel\",\n \"ControlPlaneService\",\n \"HttpControlChannel\",\n]", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/plba/control.py:1-10", - "span_start": 1, - "span_end": 10, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": null, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.plba.control", - "is_test": false, - "blob_sha": "31bd5c4481bfa7fbca8fae56d4860a67e3953ca74474ac8439e1f39b685d7bc8", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests manager\n- orchestrates role-like calls (4)\n- reads and writes state attributes\n- participates in dataflow slices (50)", - "layer": "C4_SEMANTIC_ROLES", - "title": "RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 43, - "layer_rank": 2, - "distance": null, - "metadata": { - "symbol_id": "7e4a9381328c5803bbc6179458612fc4e947d928aa7bf8b4b2bebb2c8592f758", - "symbol_name": "RuntimeManager", - "qname": "RuntimeManager", - "role": "pipeline_stage", - "confidence": 0.67, - "dataflow_participation": 50, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "ControlChannel\nrole: model\n\nResponsibilities:\n- default model role", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlChannel", - "span_start": 21, - "span_end": 28, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 40, - "layer_rank": 2, - "distance": null, - "metadata": { - "symbol_id": "cfcfe9a311d3a2dbdaf32ac4ccd73c0eb9a117f830591a1c0867ee97d46204ff", - "symbol_name": "ControlChannel", - "qname": "ControlChannel", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "ControlActionSet\nrole: model\n\nResponsibilities:\n- default model role", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlActionSet", - "span_start": 14, - "span_end": 18, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 40, - "layer_rank": 2, - "distance": null, - "metadata": { - "symbol_id": "46eb026cb3313415ec47b82dd22f84f4d112c9d987e8b1716dcb0baa1cce8988", - "symbol_name": "ControlActionSet", - "qname": "ControlActionSet", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests service\n- reads and writes state attributes\n- participates in dataflow slices (5)", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlPlaneService", - "span_start": 12, - "span_end": 52, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 68, - "layer_rank": 2, - "distance": null, - "metadata": { - "symbol_id": "b13471e5916986dccffb53fab613812842965705e6b3a89ae549d30c9e91e9aa", - "symbol_name": "ControlPlaneService", - "qname": "ControlPlaneService", - "role": "pipeline_stage", - "confidence": 0.57, - "dataflow_participation": 5, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_runner.py", - "content": "UvicornThreadRunner\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (24)", - "layer": "C4_SEMANTIC_ROLES", - "title": "UvicornThreadRunner", - "span_start": 10, - "span_end": 61, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 11, - "layer_rank": 2, - "distance": null, - "metadata": { - "symbol_id": "fd55630045a02100df8877ac27d951ee08617d4598764394d48cb51fe067476a", - "symbol_name": "UvicornThreadRunner", - "qname": "UvicornThreadRunner", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 24, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "3779fdd2878b770e789a35bb2a89c9d79f13b61c26d7db1b3b683f9bb9e1623f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (10)", - "layer": "C4_SEMANTIC_ROLES", - "title": "HttpControlChannel", - "span_start": 12, - "span_end": 57, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 21, - "layer_rank": 2, - "distance": null, - "metadata": { - "symbol_id": "1c9fbdc24819e5604c26ea55428a74310f03a03e1af197ed84846af61e42fdb0", - "symbol_name": "HttpControlChannel", - "qname": "HttpControlChannel", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 10, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "HttpControlAppFactory\nrole: factory\n\nResponsibilities:\n- name suffix suggests factory", - "layer": "C4_SEMANTIC_ROLES", - "title": "HttpControlAppFactory", - "span_start": 15, - "span_end": 53, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 39, - "layer_rank": 2, - "distance": null, - "metadata": { - "symbol_id": "9b3502a5fb408b273223db13264349cf500de24915b6c649d9ea8970d0dfd8e0", - "symbol_name": "HttpControlAppFactory", - "qname": "HttpControlAppFactory", - "role": "factory", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/persistence/workflow_persistence.py", - "content": "WorkflowPersistence\nrole: pipeline_stage\n\nResponsibilities:\n- orchestrates role-like calls (2)\n- reads and writes state attributes\n- participates in dataflow slices (16)", - "layer": "C4_SEMANTIC_ROLES", - "title": "WorkflowPersistence", - "span_start": 8, - "span_end": 54, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 15, - "layer_rank": 2, - "distance": null, - "metadata": { - "symbol_id": "7bd01ee45cf31f2d5c2e3e51656254860ac785d10cef9e0852cd4fba90857bae", - "symbol_name": "WorkflowPersistence", - "qname": "WorkflowPersistence", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 16, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "80e9410ddc639789b4353c2a1a757ba8d0d5b5bb6075b0b263b61551f04ae1f0", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.stop", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 25, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": null, - "metadata": { - "edge_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d", - "dst_ref": "ControlPlaneService.stop", - "resolution": "resolved", - "slice_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.stop" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._stop_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 51, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": null, - "metadata": { - "edge_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a", - "dst_ref": "ControlPlaneService._stop_async", - "resolution": "resolved", - "slice_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._stop_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.register_channel", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 17, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": null, - "metadata": { - "edge_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957", - "dst_ref": "ControlPlaneService.register_channel", - "resolution": "resolved", - "slice_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.register_channel" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.start", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 20, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": null, - "metadata": { - "edge_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154", - "dst_ref": "ControlPlaneService.start", - "resolution": "resolved", - "slice_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.start" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._start_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 47, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": null, - "metadata": { - "edge_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517", - "dst_ref": "ControlPlaneService._start_async", - "resolution": "resolved", - "slice_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._start_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager.add_config_file", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 32, - "span_end": 52, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": null, - "metadata": { - "edge_id": "a23b8a11ebdb12708b60c96ea12a69f7f042082f1adfddd572444e246d81d167", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "57ffbd4f0d9fdf3507c2b8624312ce211f3d02fdf86a57a8ec90778d8a7b498d", - "dst_ref": "RuntimeManager.add_config_file", - "resolution": "resolved", - "slice_id": "a23b8a11ebdb12708b60c96ea12a69f7f042082f1adfddd572444e246d81d167", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager.add_config_file" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "57ffbd4f0d9fdf3507c2b8624312ce211f3d02fdf86a57a8ec90778d8a7b498d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": null, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": null, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": null, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "retrieval_report": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "vector", - "C0_SOURCE_CHUNKS": "vector", - "C4_SEMANTIC_ROLES": "vector", - "C2_DEPENDENCY_GRAPH": "vector", - "C3_ENTRYPOINTS": "vector" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 8, - "C4_SEMANTIC_ROLES": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C3_ENTRYPOINTS": 6 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [] - }, - "C4_SEMANTIC_ROLES": { - "path_scope": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [] - } - }, - "fallback": { - "used": false, - "reason": null - }, - "retrieval_by_layer_ms": { - "C1_SYMBOL_CATALOG": 68, - "C0_SOURCE_CHUNKS": 25, - "C4_SEMANTIC_ROLES": 22, - "C2_DEPENDENCY_GRAPH": 61, - "C3_ENTRYPOINTS": 17 - } - } - }, - "diagnostics": { - "intent_correct": null, - "target_found": true, - "layers_used": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_sufficient": true, - "answer_mode": "normal", - "resolved_target": "RuntimeManager", - "answer_policy_branch": "normal_answer", - "decision_reason": "evidence_sufficient", - "router_result": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "retrieval_profile": "code", - "sub_intent": "EXPLAIN", - "path_scope": [], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "symbol_resolution_status": "resolved" - }, - "retrieval_request": { - "rag_session_id": "7d11da21-faa0-4cea-aede-aeabe069164c", - "query": "Объясни как работает класс RuntimeManager", - "sub_intent": "EXPLAIN", - "path_scope": [], - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "per_layer_outcome": [ - { - "layer_id": "C1_SYMBOL_CATALOG", - "hit_count": 8, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C0_SOURCE_CHUNKS", - "hit_count": 8, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C4_SEMANTIC_ROLES", - "hit_count": 8, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C2_DEPENDENCY_GRAPH", - "hit_count": 6, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C3_ENTRYPOINTS", - "hit_count": 3, - "empty": false, - "fallback_used": false - } - ], - "empty_layers": [], - "evidence_gate_decision": { - "sufficient": true, - "failure_reasons": [], - "evidence_count": 33 - }, - "evidence_gate_input": { - "resolved_target": "RuntimeManager", - "sub_intent": "EXPLAIN", - "target_type": "symbol", - "evidence_count": 33, - "code_chunk_count": 33, - "entrypoint_count": 3, - "relation_count": 6, - "test_evidence_count": 0, - "symbol_resolution_status": "resolved", - "path_scope": [] - }, - "post_evidence_gate": { - "input": { - "answer_mode": "normal", - "degraded_message": "", - "resolved_target": "RuntimeManager", - "draft_answer_preview": "Класс `RuntimeManager` определён в файле `src/app_runtime/core/runtime.py` и имеет responsibilities характерные для менеджера: управляет конфигурацией, состоянием и участвует в потоках данных через 50 срезов dataflow.\n\nКонструктор `RuntimeManager.__init__` инициализирует объект и вызывает:\n- `Runtim", - "repair_candidate": true - }, - "output": { - "passed": true, - "action": "return", - "reasons": [], - "repair_used": false, - "final_answer_preview": "Класс `RuntimeManager` определён в файле `src/app_runtime/core/runtime.py` и имеет responsibilities характерные для менеджера: управляет конфигурацией, состоянием и участвует в потоках данных через 50 срезов dataflow.\n\nКонструктор `RuntimeManager.__init__` инициализирует объект и вызывает:\n- `Runtim" - } - }, - "failure_reasons": [], - "timings_ms": { - "router": 1, - "retrieval": 195, - "pre_evidence_gate": 1, - "llm": 3442, - "post_evidence_gate": 1 - } - }, - "rag_rows": [ - { - "path": "src/plba/bootstrap.py", - "content": "const RuntimeManager\nRuntimeManager = app_runtime.core.runtime.RuntimeManager", - "layer": "C1_SYMBOL_CATALOG", - "title": "RuntimeManager", - "span_start": 4, - "span_end": 4, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "27158ca220022eeb5083c6addf8a50775d45f7161284fd60aac48410105f4b98", - "qname": "RuntimeManager", - "kind": "const", - "signature": "RuntimeManager = app_runtime.core.runtime.RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "src.plba.bootstrap", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "const RuntimeManager\nRuntimeManager = app_runtime.core.runtime.RuntimeManager", - "layer": "C1_SYMBOL_CATALOG", - "title": "RuntimeManager", - "span_start": 9, - "span_end": 9, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "62a9575c77aad894120d18b4f2a08cf2ba42f77e9be4a8a432b767d157701afe", - "qname": "RuntimeManager", - "kind": "const", - "signature": "RuntimeManager = app_runtime.core.runtime.RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.control.service", - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "class RuntimeManager\nRuntimeManager", - "layer": "C1_SYMBOL_CATALOG", - "title": "RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "7e4a9381328c5803bbc6179458612fc4e947d928aa7bf8b4b2bebb2c8592f758", - "qname": "RuntimeManager", - "kind": "class", - "signature": "RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.core.runtime", - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/__init__.py", - "content": "const RuntimeManager\nRuntimeManager = plba.core.RuntimeManager", - "layer": "C1_SYMBOL_CATALOG", - "title": "RuntimeManager", - "span_start": 16, - "span_end": 16, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "7eacec84f9b8d6c4201374591faecdac7493091c263681495c338973f2971ad9", - "qname": "RuntimeManager", - "kind": "const", - "signature": "RuntimeManager = plba.core.RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "src.plba.__init__", - "is_test": false, - "blob_sha": "24e755ec8c249d14fb0e675b5dbf2b71ab91afb9c849897eebfa9feb2499e19d", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/core.py", - "content": "const RuntimeManager\nRuntimeManager = app_runtime.core.runtime.RuntimeManager", - "layer": "C1_SYMBOL_CATALOG", - "title": "RuntimeManager", - "span_start": 2, - "span_end": 2, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "e1684562d978b7af7fe9b27dc5869d770348a87b5dc19a50360f58544668578b", - "qname": "RuntimeManager", - "kind": "const", - "signature": "RuntimeManager = app_runtime.core.runtime.RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "src.plba.core", - "is_test": false, - "blob_sha": "c0ae25110d20e665216616e26b68adfe035b624ba45d31d1272fb21f906f9ca8", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/__init__.py", - "content": "const ControlPlaneService\nControlPlaneService = app_runtime.control.service.ControlPlaneService", - "layer": "C1_SYMBOL_CATALOG", - "title": "ControlPlaneService", - "span_start": 3, - "span_end": 3, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "217e8f044d1c01644bf7b81e5046af9e84469210c692a2fb0c476a19bb069ae1", - "qname": "ControlPlaneService", - "kind": "const", - "signature": "ControlPlaneService = app_runtime.control.service.ControlPlaneService", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.control.__init__", - "is_test": false, - "blob_sha": "bf3c37e3369a84cc618adc0fd71c232e5eb4b871eaff743069a17e661e498316", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "method ControlChannel.start\nstart(self, actions)\nStart the control channel and bind handlers.", - "layer": "C1_SYMBOL_CATALOG", - "title": "ControlChannel.start", - "span_start": 23, - "span_end": 24, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "e01e0d50d0f48d0c84c119c989b7a7c57ceea263811ce2605c684ae24d1a03b1", - "qname": "ControlChannel.start", - "kind": "method", - "signature": "start(self, actions)", - "parent_symbol_id": "ControlChannel", - "package_or_module": "src.app_runtime.control.base", - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "method ControlChannel.stop\nstop(self)\nStop the control channel and release resources.", - "layer": "C1_SYMBOL_CATALOG", - "title": "ControlChannel.stop", - "span_start": 27, - "span_end": 28, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "54b5adf9866c526836221dc721b474ba23fbec83e1b1d3b8bc4da67ae3c1541d", - "qname": "ControlChannel.stop", - "kind": "method", - "signature": "stop(self)", - "parent_symbol_id": "ControlChannel", - "package_or_module": "src.app_runtime.control.base", - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "class ControlPlaneService:\n def __init__(self) -> None:\n self._channels: list[ControlChannel] = []\n\n def register_channel(self, channel: ControlChannel) -> None:\n self._channels.append(channel)\n\n def start(self, runtime: RuntimeManager) -> None:\n if not self._channels:\n return\n asyncio.run(self._start_async(runtime))\n\n def stop(self) -> None:\n if not self._channels:\n return\n asyncio.run(self._stop_async())\n\n def snapshot(self, runtime: RuntimeManager) -> dict[str, object]:\n health = runtime.current_health()\n return {\n \"runtime\": {\"state\": runtime._state.value},\n \"modules\": list(runtime.registry.modules),\n \"services\": runtime.services.snapshot(),\n \"workers\": runtime.workers.snapshot(),\n \"health\": runtime.health.snapshot(runtime.workers.healths()) | {\"status\": health[\"status\"]},\n \"config\": runtime.configuration.get(),\n }\n\n async def _start_async(self, runtime: RuntimeManager) -> None:\n actions = ControlActionSet(\n health=runtime.health_status,\n start=runtime.start_runtime,\n stop=runtime.stop_runtime,\n status=runtime.runtime_status,\n )\n for channel in self._channels:\n await channel.start(actions)\n\n async def _stop_async(self) -> None:\n for channel in reversed(self._channels):\n await channel.stop()", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/service.py:ControlPlaneService", - "span_start": 12, - "span_end": 52, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.service", - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_runner.py", - "content": "class UvicornThreadRunner:\n def __init__(self, host: str, port: int, timeout: int) -> None:\n self._host = host\n self._port = port\n self._timeout = timeout\n self._server: Server | None = None\n self._thread: Thread | None = None\n self._error: BaseException | None = None\n\n async def start(self, app: FastAPI) -> None:\n if self._thread is not None and self._thread.is_alive():\n return\n self._error = None\n config = Config(app=app, host=self._host, port=self._port, log_level=\"warning\")\n self._server = Server(config)\n self._thread = Thread(target=self._serve, name=\"plba-http-control\", daemon=True)\n self._thread.start()\n await self._wait_until_started()\n\n async def stop(self) -> None:\n if self._server is None or self._thread is None:\n return\n self._server.should_exit = True\n await asyncio.to_thread(self._thread.join, self._timeout)\n self._server = None\n self._thread = None\n\n @property\n def port(self) -> int:\n if self._server is None or not getattr(self._server, \"servers\", None):\n return self._port\n socket = self._server.servers[0].sockets[0]\n return int(socket.getsockname()[1])\n\n async def _wait_until_started(self) -> None:\n if self._server is None:\n raise RuntimeError(\"Server is not initialized\")\n deadline = asyncio.get_running_loop().time() + max(float(self._timeout), 1.0)\n while not self._server.started:\n if self._error is not None:\n raise RuntimeError(\"HTTP control server failed to start\") from self._error\n if asyncio.get_running_loop().time() >= deadline:\n raise TimeoutError(\"HTTP control server startup timed out\")\n await asyncio.sleep(0.05)\n\n def _serve(self) -> None:\n if self._server is None:\n return\n try:\n asyncio.run(self._server.serve())\n except BaseException as exc: # noqa: BLE001\n self._error = exc", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/http_runner.py:UvicornThreadRunner", - "span_start": 10, - "span_end": 61, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.http_runner", - "is_test": false, - "blob_sha": "3779fdd2878b770e789a35bb2a89c9d79f13b61c26d7db1b3b683f9bb9e1623f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "class ControlChannel(ABC):\n @abstractmethod\n async def start(self, actions: ControlActionSet) -> None:\n \"\"\"Start the control channel and bind handlers.\"\"\"\n\n @abstractmethod\n async def stop(self) -> None:\n \"\"\"Stop the control channel and release resources.\"\"\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/base.py:ControlChannel", - "span_start": 21, - "span_end": 28, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 1, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.base", - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/__init__.py", - "content": "from app_runtime.control.base import ControlActionSet, ControlChannel\nfrom app_runtime.control.http_channel import HttpControlChannel\nfrom app_runtime.control.service import ControlPlaneService\n\n__all__ = [\"ControlActionSet\", \"ControlChannel\", \"ControlPlaneService\", \"HttpControlChannel\"]", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/__init__.py:1-5", - "span_start": 1, - "span_end": 5, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.app_runtime.control.__init__", - "is_test": false, - "blob_sha": "bf3c37e3369a84cc618adc0fd71c232e5eb4b871eaff743069a17e661e498316", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "class HttpControlAppFactory:\n def create(\n self,\n health_provider: Callable[[], Awaitable[HealthPayload]],\n action_provider: Callable[[str, str], Awaitable[JSONResponse]],\n ) -> FastAPI:\n app = FastAPI(title=\"PLBA Control API\")\n\n @app.middleware(\"http\")\n async def log_api_call(request: Request, call_next): # type: ignore[no-untyped-def]\n started = time.monotonic()\n response = await call_next(request)\n response.headers[\"X-Response-Time-Ms\"] = str(int((time.monotonic() - started) * 1000))\n return response\n\n @app.get(\"/health\")\n async def health() -> JSONResponse:\n payload = await health_provider()\n status_code = 200 if payload.get(\"status\") == \"ok\" else 503\n return JSONResponse(content=payload, status_code=status_code)\n\n @app.get(\"/actions/{action}\")\n @app.post(\"/actions/{action}\")\n async def action(action: str, request: Request) -> JSONResponse:\n client_source = self._client_source(request)\n if action in {\"start\", \"stop\"}:\n LOGGER.warning(\"Control action requested: /actions/%s client=%s\", action, client_source)\n return await action_provider(action, client_source)\n\n return app\n\n def _client_source(self, request: Request) -> str:\n explicit_header = request.headers.get(\"X-Client-Source\", \"\").strip()\n if explicit_header:\n return explicit_header\n user_agent = request.headers.get(\"User-Agent\", \"\").strip()\n if user_agent:\n return f\"user-agent:{user_agent}\"\n return \"unknown\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/http_app.py:HttpControlAppFactory", - "span_start": 15, - "span_end": 53, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.http_app", - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "class HttpControlChannel(ControlChannel):\n def __init__(self, host: str, port: int, timeout: int) -> None:\n self._timeout = timeout\n self._runner = UvicornThreadRunner(host, port, timeout)\n self._factory = HttpControlAppFactory()\n self._actions: ControlActionSet | None = None\n\n async def start(self, actions: ControlActionSet) -> None:\n self._actions = actions\n app = self._factory.create(self._health_response, self._action_response)\n await self._runner.start(app)\n\n async def stop(self) -> None:\n await self._runner.stop()\n\n @property\n def port(self) -> int:\n return self._runner.port\n\n async def _health_response(self) -> dict[str, object]:\n if self._actions is None:\n return {\"status\": \"unhealthy\", \"detail\": \"control actions are not configured\"}\n return await asyncio.wait_for(self._actions.health(), timeout=float(self._timeout))\n\n async def _action_response(self, action: str, _client_source: str = \"unknown\") -> JSONResponse:\n if self._actions is None:\n return JSONResponse(content={\"status\": \"error\", \"detail\": f\"{action} handler is not configured\"}, status_code=404)\n callbacks = {\n \"start\": self._actions.start,\n \"stop\": self._actions.stop,\n \"status\": self._actions.status,\n }\n callback = callbacks.get(action)\n if callback is None:\n return JSONResponse(content={\"status\": \"error\", \"detail\": f\"unsupported action: {action}\"}, status_code=404)\n action_timeout = max(float(self._timeout), 10.0) if action in {\"start\", \"stop\"} else float(self._timeout)\n try:\n detail = await asyncio.wait_for(callback(), timeout=action_timeout)\n except asyncio.TimeoutError:\n return JSONResponse(\n content={\"status\": \"accepted\", \"detail\": f\"{action} operation is still in progress\"},\n status_code=202,\n )\n except Exception as exc:\n return JSONResponse(content={\"status\": \"error\", \"detail\": str(exc)}, status_code=500)\n return JSONResponse(content={\"status\": \"ok\", \"detail\": detail or f\"{action} action accepted\"}, status_code=200)", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/http_channel.py:HttpControlChannel", - "span_start": 12, - "span_end": 57, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.http_channel", - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "class ControlActionSet:\n health: HealthHandler\n start: ActionHandler\n stop: ActionHandler\n status: ActionHandler", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/base.py:ControlActionSet", - "span_start": 14, - "span_end": 18, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.base", - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/control.py", - "content": "from app_runtime.control.base import ControlActionSet, ControlChannel\nfrom app_runtime.control.http_channel import HttpControlChannel\nfrom app_runtime.control.service import ControlPlaneService\n\n__all__ = [\n \"ControlActionSet\",\n \"ControlChannel\",\n \"ControlPlaneService\",\n \"HttpControlChannel\",\n]", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/plba/control.py:1-10", - "span_start": 1, - "span_end": 10, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.plba.control", - "is_test": false, - "blob_sha": "31bd5c4481bfa7fbca8fae56d4860a67e3953ca74474ac8439e1f39b685d7bc8", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests manager\n- orchestrates role-like calls (4)\n- reads and writes state attributes\n- participates in dataflow slices (50)", - "layer": "C4_SEMANTIC_ROLES", - "title": "RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 43, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "7e4a9381328c5803bbc6179458612fc4e947d928aa7bf8b4b2bebb2c8592f758", - "symbol_name": "RuntimeManager", - "qname": "RuntimeManager", - "role": "pipeline_stage", - "confidence": 0.67, - "dataflow_participation": 50, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "ControlChannel\nrole: model\n\nResponsibilities:\n- default model role", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlChannel", - "span_start": 21, - "span_end": 28, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 40, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "cfcfe9a311d3a2dbdaf32ac4ccd73c0eb9a117f830591a1c0867ee97d46204ff", - "symbol_name": "ControlChannel", - "qname": "ControlChannel", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "ControlActionSet\nrole: model\n\nResponsibilities:\n- default model role", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlActionSet", - "span_start": 14, - "span_end": 18, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 40, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "46eb026cb3313415ec47b82dd22f84f4d112c9d987e8b1716dcb0baa1cce8988", - "symbol_name": "ControlActionSet", - "qname": "ControlActionSet", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests service\n- reads and writes state attributes\n- participates in dataflow slices (5)", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlPlaneService", - "span_start": 12, - "span_end": 52, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 68, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "b13471e5916986dccffb53fab613812842965705e6b3a89ae549d30c9e91e9aa", - "symbol_name": "ControlPlaneService", - "qname": "ControlPlaneService", - "role": "pipeline_stage", - "confidence": 0.57, - "dataflow_participation": 5, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_runner.py", - "content": "UvicornThreadRunner\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (24)", - "layer": "C4_SEMANTIC_ROLES", - "title": "UvicornThreadRunner", - "span_start": 10, - "span_end": 61, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 11, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "fd55630045a02100df8877ac27d951ee08617d4598764394d48cb51fe067476a", - "symbol_name": "UvicornThreadRunner", - "qname": "UvicornThreadRunner", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 24, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "3779fdd2878b770e789a35bb2a89c9d79f13b61c26d7db1b3b683f9bb9e1623f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (10)", - "layer": "C4_SEMANTIC_ROLES", - "title": "HttpControlChannel", - "span_start": 12, - "span_end": 57, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 21, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "1c9fbdc24819e5604c26ea55428a74310f03a03e1af197ed84846af61e42fdb0", - "symbol_name": "HttpControlChannel", - "qname": "HttpControlChannel", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 10, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "HttpControlAppFactory\nrole: factory\n\nResponsibilities:\n- name suffix suggests factory", - "layer": "C4_SEMANTIC_ROLES", - "title": "HttpControlAppFactory", - "span_start": 15, - "span_end": 53, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 39, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "9b3502a5fb408b273223db13264349cf500de24915b6c649d9ea8970d0dfd8e0", - "symbol_name": "HttpControlAppFactory", - "qname": "HttpControlAppFactory", - "role": "factory", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/persistence/workflow_persistence.py", - "content": "WorkflowPersistence\nrole: pipeline_stage\n\nResponsibilities:\n- orchestrates role-like calls (2)\n- reads and writes state attributes\n- participates in dataflow slices (16)", - "layer": "C4_SEMANTIC_ROLES", - "title": "WorkflowPersistence", - "span_start": 8, - "span_end": 54, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 15, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "7bd01ee45cf31f2d5c2e3e51656254860ac785d10cef9e0852cd4fba90857bae", - "symbol_name": "WorkflowPersistence", - "qname": "WorkflowPersistence", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 16, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "80e9410ddc639789b4353c2a1a757ba8d0d5b5bb6075b0b263b61551f04ae1f0", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.stop", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 25, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d", - "dst_ref": "ControlPlaneService.stop", - "resolution": "resolved", - "slice_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.stop" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._stop_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 51, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a", - "dst_ref": "ControlPlaneService._stop_async", - "resolution": "resolved", - "slice_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._stop_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.register_channel", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 17, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957", - "dst_ref": "ControlPlaneService.register_channel", - "resolution": "resolved", - "slice_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.register_channel" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.start", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 20, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154", - "dst_ref": "ControlPlaneService.start", - "resolution": "resolved", - "slice_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.start" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._start_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 47, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517", - "dst_ref": "ControlPlaneService._start_async", - "resolution": "resolved", - "slice_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._start_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager.add_config_file", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 32, - "span_end": 52, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "a23b8a11ebdb12708b60c96ea12a69f7f042082f1adfddd572444e246d81d167", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "57ffbd4f0d9fdf3507c2b8624312ce211f3d02fdf86a57a8ec90778d8a7b498d", - "dst_ref": "RuntimeManager.add_config_file", - "resolution": "resolved", - "slice_id": "a23b8a11ebdb12708b60c96ea12a69f7f042082f1adfddd572444e246d81d167", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager.add_config_file" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "57ffbd4f0d9fdf3507c2b8624312ce211f3d02fdf86a57a8ec90778d8a7b498d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "validation": { - "passed": true, - "action": "return", - "reasons": [] - }, - "steps": [ - { - "step": "router", - "status": "completed", - "timings_ms": { - "router": 1 - }, - "output": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - } - }, - { - "step": "retrieval", - "status": "completed", - "timings_ms": { - "retrieval": 195 - }, - "output": { - "rag_count": 33, - "answer_path_rag_count": 33, - "resolved_symbol_status": "resolved", - "resolved_symbol": "RuntimeManager", - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "diagnostics": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "vector", - "C0_SOURCE_CHUNKS": "vector", - "C4_SEMANTIC_ROLES": "vector", - "C2_DEPENDENCY_GRAPH": "vector", - "C3_ENTRYPOINTS": "vector" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 8, - "C4_SEMANTIC_ROLES": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C3_ENTRYPOINTS": 6 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [] - }, - "C4_SEMANTIC_ROLES": { - "path_scope": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [] - } - }, - "fallback": { - "used": false, - "reason": null - }, - "retrieval_by_layer_ms": { - "C1_SYMBOL_CATALOG": 68, - "C0_SOURCE_CHUNKS": 25, - "C4_SEMANTIC_ROLES": 22, - "C2_DEPENDENCY_GRAPH": 61, - "C3_ENTRYPOINTS": 17 - } - } - }, - { - "step": "pre_evidence_gate", - "status": "passed", - "timings_ms": { - "pre_evidence_gate": 1 - }, - "input": { - "resolved_target": "RuntimeManager", - "sub_intent": "EXPLAIN", - "target_type": "symbol", - "evidence_count": 33, - "code_chunk_count": 33, - "entrypoint_count": 3, - "relation_count": 6, - "test_evidence_count": 0, - "symbol_resolution_status": "resolved", - "path_scope": [] - }, - "output": { - "passed": true, - "failure_reasons": [], - "degraded_message": "", - "evidence_count": 33 - } - }, - { - "step": "llm", - "status": "completed", - "timings_ms": { - "llm": 3442 - }, - "output": { - "prompt_name": "code_qa_explain_answer", - "answer_preview": "Класс `RuntimeManager` определён в файле `src/app_runtime/core/runtime.py` и имеет responsibilities характерные для менеджера: управляет конфигурацией, состоянием и участвует в потоках данных через 50 срезов dataflow.\n\nКонструктор `RuntimeManager.__init__` инициализирует объект и вызывает:\n- `Runtim", - "resolved_target": "RuntimeManager", - "answer_policy_branch": "normal_answer", - "decision_reason": "evidence_sufficient" - } - }, - { - "step": "post_evidence_gate", - "status": "passed", - "timings_ms": { - "post_evidence_gate": 1, - "post_evidence_gate_recheck": 0, - "repair": 0 - }, - "input": { - "answer_mode": "normal", - "degraded_message": "", - "resolved_target": "RuntimeManager", - "draft_answer_preview": "Класс `RuntimeManager` определён в файле `src/app_runtime/core/runtime.py` и имеет responsibilities характерные для менеджера: управляет конфигурацией, состоянием и участвует в потоках данных через 50 срезов dataflow.\n\nКонструктор `RuntimeManager.__init__` инициализирует объект и вызывает:\n- `Runtim", - "repair_candidate": true - }, - "output": { - "passed": true, - "action": "return", - "reasons": [], - "repair_used": false, - "final_answer_preview": "Класс `RuntimeManager` определён в файле `src/app_runtime/core/runtime.py` и имеет responsibilities характерные для менеджера: управляет конфигурацией, состоянием и участвует в потоках данных через 50 срезов dataflow.\n\nКонструктор `RuntimeManager.__init__` инициализирует объект и вызывает:\n- `Runtim" - } - } - ] - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/plba_full_chain_subintents_v3/20260312_174008/full_chain_plba_code_subintents_v2_plba-v2-explain-runtime-manager.md b/tests/pipeline_setup_v3/test_results/plba_full_chain_subintents_v3/20260312_174008/full_chain_plba_code_subintents_v2_plba-v2-explain-runtime-manager.md deleted file mode 100644 index 541464f..0000000 --- a/tests/pipeline_setup_v3/test_results/plba_full_chain_subintents_v3/20260312_174008/full_chain_plba_code_subintents_v2_plba-v2-explain-runtime-manager.md +++ /dev/null @@ -1,305 +0,0 @@ -# plba-v2-explain-runtime-manager - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_02_pipeline/full_chain_plba_code_subintents_v2.yaml -- runner: agent_runtime -- mode: full_chain -- passed: True - -## Query -Объясни как работает класс RuntimeManager - -## Actual -{ - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 33, - "llm_answer": "Класс `RuntimeManager` определён в файле `src/app_runtime/core/runtime.py` и имеет responsibilities характерные для менеджера: управляет конфигурацией, состоянием и участвует в потоках данных через 50 срезов dataflow.\n\nКонструктор `RuntimeManager.__init__` инициализирует объект и вызывает:\n- `RuntimeManager.configuration`\n- `RuntimeManager.add_config_file`\n\nСвязи и вызовы других сущностей не указаны явно в данном контексте, но известно, что `RuntimeManager` используется в службах контроля (`ControlPlaneService`) и взаимодействует с ними через методы старта, стопа и получения снимков состояния.\n\nДополнительные детали о взаимодействии с другими компонентами отсутствуют в представленном контексте.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "RuntimeManager" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] -} - -## Steps -[ - { - "step": "router", - "status": "completed", - "timings_ms": { - "router": 1 - }, - "output": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - } - }, - { - "step": "retrieval", - "status": "completed", - "timings_ms": { - "retrieval": 195 - }, - "output": { - "rag_count": 33, - "answer_path_rag_count": 33, - "resolved_symbol_status": "resolved", - "resolved_symbol": "RuntimeManager", - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "diagnostics": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "vector", - "C0_SOURCE_CHUNKS": "vector", - "C4_SEMANTIC_ROLES": "vector", - "C2_DEPENDENCY_GRAPH": "vector", - "C3_ENTRYPOINTS": "vector" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 8, - "C4_SEMANTIC_ROLES": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C3_ENTRYPOINTS": 6 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [] - }, - "C4_SEMANTIC_ROLES": { - "path_scope": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [] - } - }, - "fallback": { - "used": false, - "reason": null - }, - "retrieval_by_layer_ms": { - "C1_SYMBOL_CATALOG": 68, - "C0_SOURCE_CHUNKS": 25, - "C4_SEMANTIC_ROLES": 22, - "C2_DEPENDENCY_GRAPH": 61, - "C3_ENTRYPOINTS": 17 - } - } - }, - { - "step": "pre_evidence_gate", - "status": "passed", - "timings_ms": { - "pre_evidence_gate": 1 - }, - "input": { - "resolved_target": "RuntimeManager", - "sub_intent": "EXPLAIN", - "target_type": "symbol", - "evidence_count": 33, - "code_chunk_count": 33, - "entrypoint_count": 3, - "relation_count": 6, - "test_evidence_count": 0, - "symbol_resolution_status": "resolved", - "path_scope": [] - }, - "output": { - "passed": true, - "failure_reasons": [], - "degraded_message": "", - "evidence_count": 33 - } - }, - { - "step": "llm", - "status": "completed", - "timings_ms": { - "llm": 3442 - }, - "output": { - "prompt_name": "code_qa_explain_answer", - "answer_preview": "Класс `RuntimeManager` определён в файле `src/app_runtime/core/runtime.py` и имеет responsibilities характерные для менеджера: управляет конфигурацией, состоянием и участвует в потоках данных через 50 срезов dataflow.\n\nКонструктор `RuntimeManager.__init__` инициализирует объект и вызывает:\n- `Runtim", - "resolved_target": "RuntimeManager", - "answer_policy_branch": "normal_answer", - "decision_reason": "evidence_sufficient" - } - }, - { - "step": "post_evidence_gate", - "status": "passed", - "timings_ms": { - "post_evidence_gate": 1, - "post_evidence_gate_recheck": 0, - "repair": 0 - }, - "input": { - "answer_mode": "normal", - "degraded_message": "", - "resolved_target": "RuntimeManager", - "draft_answer_preview": "Класс `RuntimeManager` определён в файле `src/app_runtime/core/runtime.py` и имеет responsibilities характерные для менеджера: управляет конфигурацией, состоянием и участвует в потоках данных через 50 срезов dataflow.\n\nКонструктор `RuntimeManager.__init__` инициализирует объект и вызывает:\n- `Runtim", - "repair_candidate": true - }, - "output": { - "passed": true, - "action": "return", - "reasons": [], - "repair_used": false, - "final_answer_preview": "Класс `RuntimeManager` определён в файле `src/app_runtime/core/runtime.py` и имеет responsibilities характерные для менеджера: управляет конфигурацией, состоянием и участвует в потоках данных через 50 срезов dataflow.\n\nКонструктор `RuntimeManager.__init__` инициализирует объект и вызывает:\n- `Runtim" - } - } -] - -## Diagnostics -{ - "intent_correct": null, - "target_found": true, - "layers_used": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_sufficient": true, - "answer_mode": "normal", - "resolved_target": "RuntimeManager", - "answer_policy_branch": "normal_answer", - "decision_reason": "evidence_sufficient", - "router_result": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "retrieval_profile": "code", - "sub_intent": "EXPLAIN", - "path_scope": [], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "symbol_resolution_status": "resolved" - }, - "retrieval_request": { - "rag_session_id": "7d11da21-faa0-4cea-aede-aeabe069164c", - "query": "Объясни как работает класс RuntimeManager", - "sub_intent": "EXPLAIN", - "path_scope": [], - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "per_layer_outcome": [ - { - "layer_id": "C1_SYMBOL_CATALOG", - "hit_count": 8, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C0_SOURCE_CHUNKS", - "hit_count": 8, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C4_SEMANTIC_ROLES", - "hit_count": 8, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C2_DEPENDENCY_GRAPH", - "hit_count": 6, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C3_ENTRYPOINTS", - "hit_count": 3, - "empty": false, - "fallback_used": false - } - ], - "empty_layers": [], - "evidence_gate_decision": { - "sufficient": true, - "failure_reasons": [], - "evidence_count": 33 - }, - "evidence_gate_input": { - "resolved_target": "RuntimeManager", - "sub_intent": "EXPLAIN", - "target_type": "symbol", - "evidence_count": 33, - "code_chunk_count": 33, - "entrypoint_count": 3, - "relation_count": 6, - "test_evidence_count": 0, - "symbol_resolution_status": "resolved", - "path_scope": [] - }, - "post_evidence_gate": { - "input": { - "answer_mode": "normal", - "degraded_message": "", - "resolved_target": "RuntimeManager", - "draft_answer_preview": "Класс `RuntimeManager` определён в файле `src/app_runtime/core/runtime.py` и имеет responsibilities характерные для менеджера: управляет конфигурацией, состоянием и участвует в потоках данных через 50 срезов dataflow.\n\nКонструктор `RuntimeManager.__init__` инициализирует объект и вызывает:\n- `Runtim", - "repair_candidate": true - }, - "output": { - "passed": true, - "action": "return", - "reasons": [], - "repair_used": false, - "final_answer_preview": "Класс `RuntimeManager` определён в файле `src/app_runtime/core/runtime.py` и имеет responsibilities характерные для менеджера: управляет конфигурацией, состоянием и участвует в потоках данных через 50 срезов dataflow.\n\nКонструктор `RuntimeManager.__init__` инициализирует объект и вызывает:\n- `Runtim" - } - }, - "failure_reasons": [], - "timings_ms": { - "router": 1, - "retrieval": 195, - "pre_evidence_gate": 1, - "llm": 3442, - "post_evidence_gate": 1 - } -} - -## Mismatches -- none \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/plba_full_chain_subintents_v3/20260312_174008/full_chain_plba_code_subintents_v2_plba-v2-explain-trace-service.json b/tests/pipeline_setup_v3/test_results/plba_full_chain_subintents_v3/20260312_174008/full_chain_plba_code_subintents_v2_plba-v2-explain-trace-service.json deleted file mode 100644 index 8463d28..0000000 --- a/tests/pipeline_setup_v3/test_results/plba_full_chain_subintents_v3/20260312_174008/full_chain_plba_code_subintents_v2_plba-v2-explain-trace-service.json +++ /dev/null @@ -1,4367 +0,0 @@ -{ - "case_id": "plba-v2-explain-trace-service", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_02_pipeline/full_chain_plba_code_subintents_v2.yaml", - "runner": "agent_runtime", - "mode": "full_chain", - "query": "Объясни как работает класс TraceService", - "actual": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 33, - "llm_answer": "Класс `TraceService` находится в файле `src/app_runtime/tracing/service.py`. Он наследуется от `TraceContextFactory`.\n\nОсновные компоненты:\n\n- **Конструктор (`__init__`)**: принимает параметры `transport` и `store`, инициализирует транспорт для трассировки и хранилище контекста трассировки. Если транспорт или хранилище не указаны, используются реализации по умолчанию: `NoOpTraceTransport()` и `TraceContextStore()`.\n \n- **Метод `create_context`**: создаёт новый контекст трассировки, принимая параметры `alias`, `parent_id`, `kind` и `attrs`. В нём создаётся запись контекста трассировки с уникальным идентификатором, текущим временем и переданными параметрами, затем эта запись сохраняется в хранилище.\n\nТакже определены методы `open_context`, `close_context`, `current_trace_id`, но их реализация не приведена в контексте.\n\nОсторожный вывод: `TraceService` используется для управления контекстами трассировки приложения, позволяя создавать, открывать и управлять записями трассировок. Он играет ключевую роль в инфраструктуре отслеживания и логирования внутри приложения. \n\nФакты основаны на видимом фрагменте кода.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "TraceService" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "passed": true, - "mismatches": [], - "details": { - "query": "Объясни как работает класс TraceService", - "router_result": { - "schema_version": "1.1", - "intent": "CODE_QA", - "retrieval_profile": "code", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query_plan": { - "raw": "Объясни как работает класс TraceService", - "normalized": "Объясни как работает класс TraceService", - "sub_intent": "EXPLAIN", - "negations": [], - "expansions": [ - "TraceService" - ], - "keyword_hints": [ - "TraceService" - ], - "path_hints": [], - "doc_scope_hints": [], - "symbol_candidates": [ - "TraceService" - ], - "symbol_kind_hint": "class", - "anchors": [ - { - "type": "SYMBOL", - "value": "TraceService", - "source": "user_text", - "subtype": null, - "span": { - "start": 27, - "end": 39 - }, - "confidence": 0.88 - }, - { - "type": "KEY_TERM", - "value": "класс", - "source": "user_text", - "subtype": null, - "span": { - "start": 21, - "end": 26 - }, - "confidence": 0.9 - } - ] - }, - "retrieval_spec": { - "domains": [ - "CODE" - ], - "layer_queries": [ - { - "layer_id": "C1_SYMBOL_CATALOG", - "top_k": 8 - }, - { - "layer_id": "C0_SOURCE_CHUNKS", - "top_k": 8 - }, - { - "layer_id": "C4_SEMANTIC_ROLES", - "top_k": 8 - }, - { - "layer_id": "C2_DEPENDENCY_GRAPH", - "top_k": 6 - }, - { - "layer_id": "C3_ENTRYPOINTS", - "top_k": 6 - } - ], - "filters": { - "test_policy": "EXCLUDE", - "path_scope": [], - "language": [ - "python" - ] - }, - "rerank_profile": "code" - }, - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - }, - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "TraceService", - "alternatives": [ - "TraceService", - "TraceService", - "TraceService", - "TraceService", - "TraceService" - ], - "confidence": 0.99 - }, - "evidence_policy": { - "require_def": true, - "require_flow": true, - "require_spec": false, - "allow_answer_without_evidence": false - } - }, - "retrieval_request": { - "rag_session_id": "7d11da21-faa0-4cea-aede-aeabe069164c", - "query": "Объясни как работает класс TraceService", - "sub_intent": "EXPLAIN", - "path_scope": [], - "keyword_hints": [ - "TraceService" - ], - "symbol_candidates": [ - "TraceService" - ], - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_spec": { - "domains": [ - "CODE" - ], - "layer_queries": [ - { - "layer_id": "C1_SYMBOL_CATALOG", - "top_k": 8 - }, - { - "layer_id": "C0_SOURCE_CHUNKS", - "top_k": 8 - }, - { - "layer_id": "C4_SEMANTIC_ROLES", - "top_k": 8 - }, - { - "layer_id": "C2_DEPENDENCY_GRAPH", - "top_k": 6 - }, - { - "layer_id": "C3_ENTRYPOINTS", - "top_k": 6 - } - ], - "filters": { - "test_policy": "EXCLUDE", - "path_scope": [], - "language": [ - "python" - ] - }, - "rerank_profile": "code" - }, - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - }, - "query_plan": { - "raw": "Объясни как работает класс TraceService", - "normalized": "Объясни как работает класс TraceService", - "sub_intent": "EXPLAIN", - "negations": [], - "expansions": [ - "TraceService" - ], - "keyword_hints": [ - "TraceService" - ], - "path_hints": [], - "doc_scope_hints": [], - "symbol_candidates": [ - "TraceService" - ], - "symbol_kind_hint": "class", - "anchors": [ - { - "type": "SYMBOL", - "value": "TraceService", - "source": "user_text", - "subtype": null, - "span": { - "start": 27, - "end": 39 - }, - "confidence": 0.88 - }, - { - "type": "KEY_TERM", - "value": "класс", - "source": "user_text", - "subtype": null, - "span": { - "start": 21, - "end": 26 - }, - "confidence": 0.9 - } - ] - } - }, - "retrieval_result": { - "target_symbol_candidates": [ - "TraceService", - "TraceService.open_context", - "TraceService.create_context", - "TraceService.current_trace_id" - ], - "resolved_symbol": "TraceService", - "symbol_resolution_status": "resolved", - "file_candidates": [ - "src/plba/__init__.py", - "src/app_runtime/core/runtime.py", - "src/app_runtime/tracing/__init__.py", - "src/app_runtime/tracing/service.py", - "src/plba/tracing.py", - "src/app_runtime/contracts/__init__.py", - "src/app_runtime/config/providers.py", - "src/app_runtime/control/http_runner.py", - "src/app_runtime/workflow/persistence/workflow_persistence.py", - "src/app_runtime/control/http_channel.py", - "src/app_runtime/queue/in_memory.py", - "src/app_runtime/config/file_loader.py", - "src/app_runtime/tracing/store.py", - "src/app_runtime/workers/supervisor.py", - "src/app_runtime/control/http_app.py" - ], - "code_chunks": [ - { - "layer": "C1_SYMBOL_CATALOG", - "path": "src/plba/__init__.py", - "title": "TraceService", - "content": "const TraceService\nTraceService = plba.tracing.TraceService", - "start_line": 20, - "end_line": 20, - "metadata": { - "symbol_id": "259ec03b77b9387ea53f69c77af32791dd29adf6de617ba72dd3f839197342a1", - "qname": "TraceService", - "kind": "const", - "signature": "TraceService = plba.tracing.TraceService", - "parent_symbol_id": null, - "package_or_module": "src.plba.__init__", - "is_test": false, - "blob_sha": "24e755ec8c249d14fb0e675b5dbf2b71ab91afb9c849897eebfa9feb2499e19d", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C1_SYMBOL_CATALOG", - "path": "src/app_runtime/core/runtime.py", - "title": "TraceService", - "content": "const TraceService\nTraceService = app_runtime.tracing.service.TraceService", - "start_line": 14, - "end_line": 14, - "metadata": { - "symbol_id": "3ccf6212fd7d9730f9df933e2ee7671b65bdae0520577e1a49c6432262842db6", - "qname": "TraceService", - "kind": "const", - "signature": "TraceService = app_runtime.tracing.service.TraceService", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.core.runtime", - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C1_SYMBOL_CATALOG", - "path": "src/app_runtime/tracing/__init__.py", - "title": "TraceService", - "content": "const TraceService\nTraceService = app_runtime.tracing.service.TraceService", - "start_line": 2, - "end_line": 2, - "metadata": { - "symbol_id": "ecd2fab7fa9744b2adca84d3d213f7aadcb7e1da84b9c2764a4ab39c65282b11", - "qname": "TraceService", - "kind": "const", - "signature": "TraceService = app_runtime.tracing.service.TraceService", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.tracing.__init__", - "is_test": false, - "blob_sha": "a01dea5f773515aeaae8e6d3431fcb93531a8b577dfa26c2e5db16cd6ae6e4d9", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C1_SYMBOL_CATALOG", - "path": "src/app_runtime/tracing/service.py", - "title": "TraceService", - "content": "class TraceService\nTraceService(TraceContextFactory)", - "start_line": 39, - "end_line": 166, - "metadata": { - "symbol_id": "c2b2b976d99f2c600000b753731b26e0a69adcb4359398b93073590c5d5d04f4", - "qname": "TraceService", - "kind": "class", - "signature": "TraceService(TraceContextFactory)", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.tracing.service", - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C1_SYMBOL_CATALOG", - "path": "src/plba/tracing.py", - "title": "TraceService", - "content": "const TraceService\nTraceService = app_runtime.tracing.service.TraceService", - "start_line": 1, - "end_line": 1, - "metadata": { - "symbol_id": "a4556fb3f83c50ea68b94a679786ce802cab7ffd9d7138aad3d6009b2661f425", - "qname": "TraceService", - "kind": "const", - "signature": "TraceService = app_runtime.tracing.service.TraceService", - "parent_symbol_id": null, - "package_or_module": "src.plba.tracing", - "is_test": false, - "blob_sha": "a27e11c716c93c3fcefe6f11b4cc420a6b743e7606606071d7f1aeeccc4e7d45", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C1_SYMBOL_CATALOG", - "path": "src/app_runtime/tracing/service.py", - "title": "TraceService.open_context", - "content": "method TraceService.open_context\nopen_context(self)", - "start_line": 66, - "end_line": 78, - "metadata": { - "symbol_id": "2da3d5b20a947bf63e14c103be4689b72fd837e0a82abd6c497846375d4c7426", - "qname": "TraceService.open_context", - "kind": "method", - "signature": "open_context(self)", - "parent_symbol_id": "TraceService", - "package_or_module": "src.app_runtime.tracing.service", - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C1_SYMBOL_CATALOG", - "path": "src/app_runtime/tracing/service.py", - "title": "TraceService.create_context", - "content": "method TraceService.create_context\ncreate_context(self)", - "start_line": 45, - "end_line": 63, - "metadata": { - "symbol_id": "ff44881104b65ef50ee6fe16d367d4a81b6e7eb5c44c0963cf4543faec785d4a", - "qname": "TraceService.create_context", - "kind": "method", - "signature": "create_context(self)", - "parent_symbol_id": "TraceService", - "package_or_module": "src.app_runtime.tracing.service", - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C1_SYMBOL_CATALOG", - "path": "src/app_runtime/tracing/service.py", - "title": "TraceService.current_trace_id", - "content": "method TraceService.current_trace_id\ncurrent_trace_id(self)", - "start_line": 80, - "end_line": 81, - "metadata": { - "symbol_id": "41135180f7b3b9ab20e097e0747474e219c37dd2366ef08a7b43c1f3edb10b4c", - "qname": "TraceService.current_trace_id", - "kind": "method", - "signature": "current_trace_id(self)", - "parent_symbol_id": "TraceService", - "package_or_module": "src.app_runtime.tracing.service", - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C0_SOURCE_CHUNKS", - "path": "src/app_runtime/tracing/service.py", - "title": "src/app_runtime/tracing/service.py:TraceService", - "content": "class TraceService(TraceContextFactory):\n def __init__(self, transport: TraceTransport | None = None, store: TraceContextStore | None = None) -> None:\n self.transport = transport or NoOpTraceTransport()\n self.store = store or TraceContextStore()\n self._writer = TraceRecordWriter(self.transport)\n\n def create_context(\n self,\n *,\n alias: str,\n parent_id: str | None = None,\n kind: str | None = None,\n attrs: dict[str, Any] | None = None,\n ) -> str:\n record = TraceContextRecord(\n trace_id=uuid4().hex,\n alias=str(alias or \"\"),\n parent_id=parent_id,\n type=kind,\n event_time=utc_now(),\n attrs=dict(attrs or {}),\n )\n self.store.push(record)\n self._writer.write_context(record)\n return record.trace_id\n\n @contextmanager\n def open_context(\n self,\n *,\n alias: str,\n parent_id: str | None = None,\n kind: str | None = None,\n attrs: dict[str, Any] | None = None,\n ) -> Iterator[str]:\n trace_id = self.create_context(alias=alias, parent_id=parent_id, kind=kind, attrs=attrs)\n try:\n yield trace_id\n finally:\n self.store.pop()\n\n def current_trace_id(self) -> str | None:\n return self.store.current_trace_id()\n\n def close_context(self) -> str | None:\n previous = self.store.pop()\n return previous.record.trace_id if previous else None\n\n def step(self, name: str) -> None:\n self.store.set_step(str(name or \"\"))\n\n def info(self, message: str, *, status: str | None = None, attrs: dict[str, Any] | None = None) -> None:\n self._write_message(\"INFO\", message, status, attrs)\n\n def debug(self, message: str, *, status: str | None = None, attrs: dict[str, Any] | None = None) -> None:\n self._write_message(\"DEBUG\", message, status, attrs)\n\n def warning(self, message: str, *, status: str | None = None, attrs: dict[str, Any] | None = None) -> None:\n self._write_message(\"WARNING\", message, status, attrs)\n\n def error(self, message: str, *, status: str | None = None, attrs: dict[str, Any] | None = None) -> None:\n self._write_message(\"ERROR\", message, status, attrs)\n\n def exception(self, message: str, *, status: str = \"failed\", attrs: dict[str, Any] | None = None) -> None:\n self._write_message(\"ERROR\", message, status, attrs)\n\n def new_root(self, operation: str) -> TraceContext:\n trace_id = self.create_context(alias=operation, kind=\"operation\", attrs={\"operation\": operation})\n return TraceContext(trace_id=trace_id, span_id=trace_id, attributes={\"operation\": operation})\n\n def child_of(self, parent: TraceContext, operation: str) -> TraceContext:\n trace_id = self.create_context(\n alias=operation,\n parent_id=parent.trace_id,\n kind=\"worker\",\n attrs={\"operation\": operation},\n )\n return TraceContext(\n trace_id=trace_id,\n span_id=trace_id,\n parent_span_id=parent.span_id,\n attributes={\"operation\": operation},\n )\n\n def attach(self, metadata: dict[str, object], context: TraceContext) -> dict[str, object]:\n updated = dict(metadata)\n updated[\"trace_id\"] = context.trace_id\n updated[\"span_id\"] = context.span_id\n updated[\"parent_span_id\"] = context.parent_span_id\n return updated\n\n def resume(self, metadata: dict[str, object], operation: str) -> TraceContext:\n trace_id = str(metadata.get(\"trace_id\") or uuid4().hex)\n span_id = str(metadata.get(\"span_id\") or trace_id)\n parent_id = metadata.get(\"parent_span_id\")\n self.create_context(\n alias=operation,\n parent_id=str(parent_id) if parent_id else None,\n kind=\"worker\",\n attrs=dict(metadata),\n )\n return TraceContext(\n trace_id=trace_id,\n span_id=span_id,\n parent_span_id=str(parent_id) if parent_id else None,\n attributes={\"operation\": operation},\n )\n\n def _write_message(\n self,\n level: TraceLevel,\n message: str,\n status: str | None,\n attrs: dict[str, Any] | None,\n ) -> None:\n active = self.store.current()\n if active is None:\n raise RuntimeError(\"Trace context is not bound. Call create_context() first.\")\n record = TraceLogMessage(\n trace_id=active.record.trace_id,\n step=active.step,\n status=str(status or \"\"),\n message=str(message or \"\"),\n level=level,\n event_time=utc_now(),\n attrs=dict(attrs or {}),\n )\n self._writer.write_message(record)", - "start_line": 39, - "end_line": 166, - "metadata": { - "chunk_index": 1, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.tracing.service", - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C0_SOURCE_CHUNKS", - "path": "src/app_runtime/tracing/service.py", - "title": "src/app_runtime/tracing/service.py:TraceManager", - "content": "class TraceManager(TraceService):\n \"\"\"Compatibility alias during the transition from ConfigManager-shaped naming.\"\"\"", - "start_line": 169, - "end_line": 170, - "metadata": { - "chunk_index": 2, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.tracing.service", - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C0_SOURCE_CHUNKS", - "path": "src/app_runtime/core/runtime.py", - "title": "src/app_runtime/core/runtime.py:RuntimeManager", - "content": "class RuntimeManager:\n ACTION_TIMEOUT_SECONDS = 10.0\n ACTION_POLL_INTERVAL_SECONDS = 0.05\n\n def __init__(\n self,\n configuration: ConfigurationManager | None = None,\n services: ServiceContainer | None = None,\n traces: TraceService | None = None,\n health: HealthRegistry | None = None,\n logs: LogManager | None = None,\n workers: WorkerSupervisor | None = None,\n control_plane: ControlPlaneService | None = None,\n ) -> None:\n self.configuration = configuration or ConfigurationManager()\n self.services = services or ServiceContainer()\n self.traces = traces or TraceService()\n self.health = health or HealthRegistry()\n self.logs = logs or LogManager()\n self.workers = workers or WorkerSupervisor()\n self.control_plane = control_plane or ControlPlaneService()\n self.registry = ModuleRegistry(self.services)\n self._started = False\n self._state = LifecycleState.IDLE\n self._core_registered = False\n self._workers_registered = False\n self._register_core_services()\n\n def register_module(self, module: ApplicationModule) -> None:\n self.registry.register_module(module.name)\n module.register(self.registry)\n\n def add_config_file(self, path: str) -> FileConfigProvider:\n provider = FileConfigProvider(path)\n self.configuration.add_provider(provider)\n return provider\n\n def start(self, *, start_control_plane: bool = True) -> None:\n if self._started:\n return\n self._state = LifecycleState.STARTING\n config = self.configuration.load()\n self.logs.apply_config(config)\n self._register_health_contributors()\n self._register_workers()\n self.workers.start()\n if start_control_plane:\n self.control_plane.start(self)\n self._started = True\n self._refresh_state()\n\n def stop(self, timeout: float = 30.0, force: bool = False, stop_control_plane: bool = True) -> None:\n if not self._started:\n return\n self._state = LifecycleState.STOPPING\n self.workers.stop(timeout=timeout, force=force)\n if stop_control_plane:\n self.control_plane.stop()\n self._started = False\n self._state = LifecycleState.STOPPED\n\n def status(self) -> dict[str, object]:\n self._refresh_state()\n return self.control_plane.snapshot(self)\n\n def current_health(self) -> HealthPayload:\n self._refresh_state()\n return self.health.payload(self._state, self.workers.healths())\n\n async def health_status(self) -> HealthPayload:\n return self.current_health()\n\n async def start_runtime(self) -> dict[str, object] | str:\n self._refresh_state()\n if self._started:\n return \"runtime already running\"\n if self._state == LifecycleState.STOPPING:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n\n self.start(start_control_plane=False)\n started = self._wait_for_state({LifecycleState.IDLE, LifecycleState.BUSY}, timeout=self.ACTION_TIMEOUT_SECONDS)\n if started:\n return self._action_detail(\"runtime started\", timed_out=False)\n return self._action_detail(\"runtime start is still in progress\", timed_out=True)\n\n async def stop_runtime(self) -> dict[str, object] | str:\n self._refresh_state()\n if not self._started:\n if self._state == LifecycleState.STOPPING:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n return \"runtime already stopped\"\n\n self._state = LifecycleState.STOPPING\n try:\n self.workers.stop(timeout=self.ACTION_TIMEOUT_SECONDS, force=False)\n except TimeoutError:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n\n self._started = False\n self._state = LifecycleState.STOPPED\n return self._action_detail(\"runtime stopped\", timed_out=False)\n\n async def runtime_status(self) -> str:\n self._refresh_state()\n return self._state.value\n\n def _register_core_services(self) -> None:\n if self._core_registered:\n return\n self.services.register(\"configuration\", self.configuration)\n self.services.register(\"traces\", self.traces)\n self.services.register(\"health\", self.health)\n self.services.register(\"logs\", self.logs)\n self.services.register(\"workers\", self.workers)\n self.services.register(\"control_plane\", self.control_plane)\n self._core_registered = True\n\n def _register_health_contributors(self) -> None:\n for contributor in self.registry.health_contributors:\n self.health.register(contributor)\n\n def _register_workers(self) -> None:\n if self._workers_registered:\n return\n for worker in self.registry.workers:\n self.workers.register(worker)\n self._workers_registered = True\n\n def _refresh_state(self) -> None:\n lifecycle = self.workers.lifecycle_state()\n\n if self._state == LifecycleState.STOPPING:\n if lifecycle == LifecycleState.STOPPED:\n self._started = False\n self._state = LifecycleState.STOPPED\n return\n\n if not self._started:\n if lifecycle == LifecycleState.STOPPED:\n self._state = LifecycleState.STOPPED\n return\n\n self._state = lifecycle\n\n def _wait_for_state(self, target_states: set[LifecycleState], *, timeout: float) -> bool:\n deadline = monotonic() + timeout\n while monotonic() < deadline:\n self._refresh_state()\n if self._state in target_states:\n return True\n sleep(self.ACTION_POLL_INTERVAL_SECONDS)\n self._refresh_state()\n return self._state in target_states\n\n def _action_detail(self, message: str, *, timed_out: bool) -> dict[str, object]:\n self._refresh_state()\n return {\n \"message\": message,\n \"state\": self._state.value,\n \"timed_out\": timed_out,\n \"workers\": self.workers.snapshot(),\n }", - "start_line": 18, - "end_line": 179, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.core.runtime", - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C0_SOURCE_CHUNKS", - "path": "src/app_runtime/tracing/__init__.py", - "title": "src/app_runtime/tracing/__init__.py:1-17", - "content": "from app_runtime.contracts.trace import TraceContext, TraceContextRecord, TraceLogMessage, TraceTransport\nfrom app_runtime.tracing.service import TraceManager, TraceService\nfrom app_runtime.tracing.store import ActiveTraceContext, TraceContextStore\nfrom app_runtime.tracing.transport import MySqlTraceTransport, NoOpTraceTransport\n\n__all__ = [\n \"ActiveTraceContext\",\n \"MySqlTraceTransport\",\n \"NoOpTraceTransport\",\n \"TraceContext\",\n \"TraceContextRecord\",\n \"TraceContextStore\",\n \"TraceLogMessage\",\n \"TraceManager\",\n \"TraceService\",\n \"TraceTransport\",\n]", - "start_line": 1, - "end_line": 17, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.app_runtime.tracing.__init__", - "is_test": false, - "blob_sha": "a01dea5f773515aeaae8e6d3431fcb93531a8b577dfa26c2e5db16cd6ae6e4d9", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C0_SOURCE_CHUNKS", - "path": "src/plba/__init__.py", - "title": "src/plba/__init__.py:1-69", - "content": "from plba.bootstrap import create_runtime\nfrom plba.config import ConfigFileLoader, FileConfigProvider\nfrom plba.control import ControlActionSet, ControlChannel, ControlPlaneService, HttpControlChannel\nfrom plba.contracts import (\n ApplicationModule,\n ConfigProvider,\n HealthContributor,\n TraceContext,\n TraceContextRecord,\n TraceLogMessage,\n TraceTransport,\n Worker,\n WorkerHealth,\n WorkerStatus,\n)\nfrom plba.core import ConfigurationManager, RuntimeManager, ServiceContainer\nfrom plba.health import HealthRegistry\nfrom plba.logging import LogManager\nfrom plba.queue import InMemoryTaskQueue\nfrom plba.tracing import MySqlTraceTransport, NoOpTraceTransport, TraceService\nfrom plba.workflow import (\n StepResult,\n WorkflowContext,\n WorkflowDefinition,\n WorkflowEngine,\n WorkflowEngineHooks,\n WorkflowNode,\n WorkflowRuntimeFactory,\n WorkflowStep,\n)\nfrom plba.workers import WorkerSupervisor\n\n__all__ = [\n \"ApplicationModule\",\n \"ConfigFileLoader\",\n \"ConfigProvider\",\n \"ConfigurationManager\",\n \"ControlActionSet\",\n \"ControlChannel\",\n \"ControlPlaneService\",\n \"create_runtime\",\n \"FileConfigProvider\",\n \"HealthContributor\",\n \"HealthRegistry\",\n \"HttpControlChannel\",\n \"InMemoryTaskQueue\",\n \"LogManager\",\n \"MySqlTraceTransport\",\n \"NoOpTraceTransport\",\n \"RuntimeManager\",\n \"ServiceContainer\",\n \"TraceContext\",\n \"TraceContextRecord\",\n \"TraceLogMessage\",\n \"TraceService\",\n \"TraceTransport\",\n \"StepResult\",\n \"Worker\",\n \"WorkerHealth\",\n \"WorkerStatus\",\n \"WorkflowContext\",\n \"WorkflowDefinition\",\n \"WorkflowEngine\",\n \"WorkflowEngineHooks\",\n \"WorkflowNode\",\n \"WorkflowRuntimeFactory\",\n \"WorkflowStep\",\n \"WorkerSupervisor\",\n]", - "start_line": 1, - "end_line": 69, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.plba.__init__", - "is_test": false, - "blob_sha": "24e755ec8c249d14fb0e675b5dbf2b71ab91afb9c849897eebfa9feb2499e19d", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C0_SOURCE_CHUNKS", - "path": "src/plba/tracing.py", - "title": "src/plba/tracing.py:1-4", - "content": "from app_runtime.tracing.service import TraceService\nfrom app_runtime.tracing.transport import MySqlTraceTransport, NoOpTraceTransport\n\n__all__ = [\"MySqlTraceTransport\", \"NoOpTraceTransport\", \"TraceService\"]", - "start_line": 1, - "end_line": 4, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.plba.tracing", - "is_test": false, - "blob_sha": "a27e11c716c93c3fcefe6f11b4cc420a6b743e7606606071d7f1aeeccc4e7d45", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C0_SOURCE_CHUNKS", - "path": "src/app_runtime/contracts/__init__.py", - "title": "src/app_runtime/__init__.py:1-1", - "content": "__all__: list[str] = []", - "start_line": 1, - "end_line": 1, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.app_runtime.__init__", - "is_test": false, - "blob_sha": "8eea9df4f6d7b38ca0e39ccc27b04700e3d08dbeec8046d613d22706d19985fa", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C0_SOURCE_CHUNKS", - "path": "src/app_runtime/config/providers.py", - "title": "src/app_runtime/config/providers.py:FileConfigProvider", - "content": "class FileConfigProvider(ConfigProvider):\n def __init__(self, path: str | Path) -> None:\n self._loader = ConfigFileLoader(path)\n\n @property\n def loader(self) -> ConfigFileLoader:\n return self._loader\n\n def load(self) -> dict[str, Any]:\n config = self._loader.load_sync()\n if not isinstance(config, dict):\n raise TypeError(\"Config root must be a mapping\")\n return dict(config)", - "start_line": 10, - "end_line": 22, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.config.providers", - "is_test": false, - "blob_sha": "8c53ca0122d6df6c5763bca15e99434bb4daebd5a618b8fc927e9ae90b022e64", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C4_SEMANTIC_ROLES", - "path": "src/app_runtime/tracing/service.py", - "title": "TraceService", - "content": "TraceService\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests service\n- reads and writes state attributes\n- participates in dataflow slices (13)", - "start_line": 39, - "end_line": 166, - "metadata": { - "symbol_id": "c2b2b976d99f2c600000b753731b26e0a69adcb4359398b93073590c5d5d04f4", - "symbol_name": "TraceService", - "qname": "TraceService", - "role": "pipeline_stage", - "confidence": 0.57, - "dataflow_participation": 13, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C4_SEMANTIC_ROLES", - "path": "src/app_runtime/control/http_runner.py", - "title": "UvicornThreadRunner", - "content": "UvicornThreadRunner\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (24)", - "start_line": 10, - "end_line": 61, - "metadata": { - "symbol_id": "fd55630045a02100df8877ac27d951ee08617d4598764394d48cb51fe067476a", - "symbol_name": "UvicornThreadRunner", - "qname": "UvicornThreadRunner", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 24, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "3779fdd2878b770e789a35bb2a89c9d79f13b61c26d7db1b3b683f9bb9e1623f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C4_SEMANTIC_ROLES", - "path": "src/app_runtime/workflow/persistence/workflow_persistence.py", - "title": "WorkflowPersistence", - "content": "WorkflowPersistence\nrole: pipeline_stage\n\nResponsibilities:\n- orchestrates role-like calls (2)\n- reads and writes state attributes\n- participates in dataflow slices (16)", - "start_line": 8, - "end_line": 54, - "metadata": { - "symbol_id": "7bd01ee45cf31f2d5c2e3e51656254860ac785d10cef9e0852cd4fba90857bae", - "symbol_name": "WorkflowPersistence", - "qname": "WorkflowPersistence", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 16, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "80e9410ddc639789b4353c2a1a757ba8d0d5b5bb6075b0b263b61551f04ae1f0", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C4_SEMANTIC_ROLES", - "path": "src/app_runtime/control/http_channel.py", - "title": "HttpControlChannel", - "content": "HttpControlChannel\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (10)", - "start_line": 12, - "end_line": 57, - "metadata": { - "symbol_id": "1c9fbdc24819e5604c26ea55428a74310f03a03e1af197ed84846af61e42fdb0", - "symbol_name": "HttpControlChannel", - "qname": "HttpControlChannel", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 10, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C4_SEMANTIC_ROLES", - "path": "src/app_runtime/queue/in_memory.py", - "title": "InMemoryTaskQueue", - "content": "InMemoryTaskQueue\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (9)", - "start_line": 9, - "end_line": 38, - "metadata": { - "symbol_id": "2da04cb94544a3bcbf0943a95ad4bdd8710bcafaa32a02fd0e4de2178dcf3533", - "symbol_name": "InMemoryTaskQueue", - "qname": "InMemoryTaskQueue", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 9, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "58f0cc001ccda0eee4c6bc32ed83bd05eafd6b6644f1e8b4aa9eed3103db73dc", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C4_SEMANTIC_ROLES", - "path": "src/app_runtime/config/file_loader.py", - "title": "ConfigFileLoader", - "content": "ConfigFileLoader\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (8)", - "start_line": 11, - "end_line": 48, - "metadata": { - "symbol_id": "a8474eca8b6e9dc86ae67ed68b16fa5fb639ef08739c053e7b7195489765667f", - "symbol_name": "ConfigFileLoader", - "qname": "ConfigFileLoader", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 8, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "1f19ffebde5e38e4be5a5d5a678059a0f36dedb8fb8b3e00ab395c67106a87ea", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C4_SEMANTIC_ROLES", - "path": "src/app_runtime/tracing/store.py", - "title": "TraceContextStore", - "content": "TraceContextStore\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (6)", - "start_line": 15, - "end_line": 52, - "metadata": { - "symbol_id": "b2dad4fbe16ffb11b58deba311c7739955c39d59f291b22181f33e9c8cce4059", - "symbol_name": "TraceContextStore", - "qname": "TraceContextStore", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 6, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "d369554f08fc92039c6edd5a2a1e73b23901533e8974459170bbd9347d263dc5", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C4_SEMANTIC_ROLES", - "path": "src/app_runtime/workers/supervisor.py", - "title": "WorkerSupervisor", - "content": "WorkerSupervisor\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (6)", - "start_line": 10, - "end_line": 59, - "metadata": { - "symbol_id": "c17b44e8d9e97d490989b21fa67d7c346cdda8a0472e4c41fb243c8846faa124", - "symbol_name": "WorkerSupervisor", - "qname": "WorkerSupervisor", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 6, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "77609d9d5927171cce7fc3a54897c183fd63068710c6362029b700937aae5eee", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "path": "src/app_runtime/tracing/service.py", - "title": "TraceService.__init__:dataflow_slice", - "content": "TraceService.__init__\n -> TraceService.store\n -> TraceService.create_context", - "start_line": 42, - "end_line": 61, - "metadata": { - "edge_id": "3b052062067a78aef3302ee1d996897e02a67d1b340397bea4f59fe147c0492a", - "edge_type": "dataflow_slice", - "src_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "src_qname": "TraceService.__init__", - "dst_symbol_id": "ff44881104b65ef50ee6fe16d367d4a81b6e7eb5c44c0963cf4543faec785d4a", - "dst_ref": "TraceService.create_context", - "resolution": "resolved", - "slice_id": "3b052062067a78aef3302ee1d996897e02a67d1b340397bea4f59fe147c0492a", - "root_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "path_symbols": [ - "TraceService.__init__", - "TraceService.store", - "TraceService.create_context" - ], - "path_symbol_ids": [ - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "ff44881104b65ef50ee6fe16d367d4a81b6e7eb5c44c0963cf4543faec785d4a" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "path": "src/app_runtime/tracing/service.py", - "title": "TraceService.__init__:dataflow_slice", - "content": "TraceService.__init__\n -> TraceService.store\n -> TraceService.close_context", - "start_line": 42, - "end_line": 84, - "metadata": { - "edge_id": "7a9353ef57c9ae5d19b3a0c6ac50fad05e6d21d31bbe1cd1cd07af6332ba6505", - "edge_type": "dataflow_slice", - "src_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "src_qname": "TraceService.__init__", - "dst_symbol_id": "01e14158dcced7e52d0c8ac84ac7b9a75225c261b6aca6a1d7da802d0994721c", - "dst_ref": "TraceService.close_context", - "resolution": "resolved", - "slice_id": "7a9353ef57c9ae5d19b3a0c6ac50fad05e6d21d31bbe1cd1cd07af6332ba6505", - "root_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "path_symbols": [ - "TraceService.__init__", - "TraceService.store", - "TraceService.close_context" - ], - "path_symbol_ids": [ - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "01e14158dcced7e52d0c8ac84ac7b9a75225c261b6aca6a1d7da802d0994721c" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "path": "src/app_runtime/tracing/service.py", - "title": "TraceService.__init__:dataflow_slice", - "content": "TraceService.__init__\n -> TraceService.store\n -> TraceService.open_context", - "start_line": 42, - "end_line": 78, - "metadata": { - "edge_id": "a6e13b9ebc4fed84586afd53ed92a4d14757e440873f572b2337d5622ee96031", - "edge_type": "dataflow_slice", - "src_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "src_qname": "TraceService.__init__", - "dst_symbol_id": "2da3d5b20a947bf63e14c103be4689b72fd837e0a82abd6c497846375d4c7426", - "dst_ref": "TraceService.open_context", - "resolution": "resolved", - "slice_id": "a6e13b9ebc4fed84586afd53ed92a4d14757e440873f572b2337d5622ee96031", - "root_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "path_symbols": [ - "TraceService.__init__", - "TraceService.store", - "TraceService.open_context" - ], - "path_symbol_ids": [ - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "2da3d5b20a947bf63e14c103be4689b72fd837e0a82abd6c497846375d4c7426" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "path": "src/app_runtime/tracing/service.py", - "title": "TraceService.__init__:dataflow_slice", - "content": "TraceService.__init__\n -> TraceService.transport\n -> TraceService.__init__", - "start_line": 41, - "end_line": 43, - "metadata": { - "edge_id": "1e923a93faa05c3c43ca9b19bd047007a8589ccce57d3cc1798ae7f9f200af98", - "edge_type": "dataflow_slice", - "src_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "src_qname": "TraceService.__init__", - "dst_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "dst_ref": "TraceService.__init__", - "resolution": "resolved", - "slice_id": "1e923a93faa05c3c43ca9b19bd047007a8589ccce57d3cc1798ae7f9f200af98", - "root_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "path_symbols": [ - "TraceService.__init__", - "TraceService.transport", - "TraceService.__init__" - ], - "path_symbol_ids": [ - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "path": "src/app_runtime/tracing/service.py", - "title": "TraceService.__init__:dataflow_slice", - "content": "TraceService.__init__\n -> TraceService.store\n -> TraceService.current_trace_id", - "start_line": 42, - "end_line": 81, - "metadata": { - "edge_id": "3ea17138634b1190bded77ddb84aa1595124f6519b246f24fc4b02bd62b5cac1", - "edge_type": "dataflow_slice", - "src_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "src_qname": "TraceService.__init__", - "dst_symbol_id": "41135180f7b3b9ab20e097e0747474e219c37dd2366ef08a7b43c1f3edb10b4c", - "dst_ref": "TraceService.current_trace_id", - "resolution": "resolved", - "slice_id": "3ea17138634b1190bded77ddb84aa1595124f6519b246f24fc4b02bd62b5cac1", - "root_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "path_symbols": [ - "TraceService.__init__", - "TraceService.store", - "TraceService.current_trace_id" - ], - "path_symbol_ids": [ - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "41135180f7b3b9ab20e097e0747474e219c37dd2366ef08a7b43c1f3edb10b4c" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "path": "src/app_runtime/tracing/service.py", - "title": "TraceService.__init__:dataflow_slice", - "content": "TraceService.__init__\n -> TraceService.store\n -> TraceService.step", - "start_line": 42, - "end_line": 88, - "metadata": { - "edge_id": "9f34c5da9b09fba99df6f6b1bde183a9aeb45111b8218a747c71590c2c9f60f2", - "edge_type": "dataflow_slice", - "src_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "src_qname": "TraceService.__init__", - "dst_symbol_id": "c44bfbc66cf747283f30088da3e011a10395031d41e77b74e523c24997f641ca", - "dst_ref": "TraceService.step", - "resolution": "resolved", - "slice_id": "9f34c5da9b09fba99df6f6b1bde183a9aeb45111b8218a747c71590c2c9f60f2", - "root_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "path_symbols": [ - "TraceService.__init__", - "TraceService.store", - "TraceService.step" - ], - "path_symbol_ids": [ - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "c44bfbc66cf747283f30088da3e011a10395031d41e77b74e523c24997f641ca" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C3_ENTRYPOINTS", - "path": "src/app_runtime/control/http_app.py", - "title": "app.post", - "content": "fastapi http app.post", - "start_line": 38, - "end_line": 42, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C3_ENTRYPOINTS", - "path": "src/app_runtime/control/http_app.py", - "title": "app.get", - "content": "fastapi http app.get", - "start_line": 31, - "end_line": 34, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C3_ENTRYPOINTS", - "path": "src/app_runtime/control/http_app.py", - "title": "app.get", - "content": "fastapi http app.get", - "start_line": 38, - "end_line": 42, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "relations": [ - { - "path": "src/app_runtime/tracing/service.py", - "metadata": { - "edge_id": "3b052062067a78aef3302ee1d996897e02a67d1b340397bea4f59fe147c0492a", - "edge_type": "dataflow_slice", - "src_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "src_qname": "TraceService.__init__", - "dst_symbol_id": "ff44881104b65ef50ee6fe16d367d4a81b6e7eb5c44c0963cf4543faec785d4a", - "dst_ref": "TraceService.create_context", - "resolution": "resolved", - "slice_id": "3b052062067a78aef3302ee1d996897e02a67d1b340397bea4f59fe147c0492a", - "root_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "path_symbols": [ - "TraceService.__init__", - "TraceService.store", - "TraceService.create_context" - ], - "path_symbol_ids": [ - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "ff44881104b65ef50ee6fe16d367d4a81b6e7eb5c44c0963cf4543faec785d4a" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - }, - "content": "TraceService.__init__\n -> TraceService.store\n -> TraceService.create_context" - }, - { - "path": "src/app_runtime/tracing/service.py", - "metadata": { - "edge_id": "7a9353ef57c9ae5d19b3a0c6ac50fad05e6d21d31bbe1cd1cd07af6332ba6505", - "edge_type": "dataflow_slice", - "src_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "src_qname": "TraceService.__init__", - "dst_symbol_id": "01e14158dcced7e52d0c8ac84ac7b9a75225c261b6aca6a1d7da802d0994721c", - "dst_ref": "TraceService.close_context", - "resolution": "resolved", - "slice_id": "7a9353ef57c9ae5d19b3a0c6ac50fad05e6d21d31bbe1cd1cd07af6332ba6505", - "root_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "path_symbols": [ - "TraceService.__init__", - "TraceService.store", - "TraceService.close_context" - ], - "path_symbol_ids": [ - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "01e14158dcced7e52d0c8ac84ac7b9a75225c261b6aca6a1d7da802d0994721c" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - }, - "content": "TraceService.__init__\n -> TraceService.store\n -> TraceService.close_context" - }, - { - "path": "src/app_runtime/tracing/service.py", - "metadata": { - "edge_id": "a6e13b9ebc4fed84586afd53ed92a4d14757e440873f572b2337d5622ee96031", - "edge_type": "dataflow_slice", - "src_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "src_qname": "TraceService.__init__", - "dst_symbol_id": "2da3d5b20a947bf63e14c103be4689b72fd837e0a82abd6c497846375d4c7426", - "dst_ref": "TraceService.open_context", - "resolution": "resolved", - "slice_id": "a6e13b9ebc4fed84586afd53ed92a4d14757e440873f572b2337d5622ee96031", - "root_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "path_symbols": [ - "TraceService.__init__", - "TraceService.store", - "TraceService.open_context" - ], - "path_symbol_ids": [ - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "2da3d5b20a947bf63e14c103be4689b72fd837e0a82abd6c497846375d4c7426" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - }, - "content": "TraceService.__init__\n -> TraceService.store\n -> TraceService.open_context" - }, - { - "path": "src/app_runtime/tracing/service.py", - "metadata": { - "edge_id": "1e923a93faa05c3c43ca9b19bd047007a8589ccce57d3cc1798ae7f9f200af98", - "edge_type": "dataflow_slice", - "src_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "src_qname": "TraceService.__init__", - "dst_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "dst_ref": "TraceService.__init__", - "resolution": "resolved", - "slice_id": "1e923a93faa05c3c43ca9b19bd047007a8589ccce57d3cc1798ae7f9f200af98", - "root_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "path_symbols": [ - "TraceService.__init__", - "TraceService.transport", - "TraceService.__init__" - ], - "path_symbol_ids": [ - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - }, - "content": "TraceService.__init__\n -> TraceService.transport\n -> TraceService.__init__" - }, - { - "path": "src/app_runtime/tracing/service.py", - "metadata": { - "edge_id": "3ea17138634b1190bded77ddb84aa1595124f6519b246f24fc4b02bd62b5cac1", - "edge_type": "dataflow_slice", - "src_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "src_qname": "TraceService.__init__", - "dst_symbol_id": "41135180f7b3b9ab20e097e0747474e219c37dd2366ef08a7b43c1f3edb10b4c", - "dst_ref": "TraceService.current_trace_id", - "resolution": "resolved", - "slice_id": "3ea17138634b1190bded77ddb84aa1595124f6519b246f24fc4b02bd62b5cac1", - "root_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "path_symbols": [ - "TraceService.__init__", - "TraceService.store", - "TraceService.current_trace_id" - ], - "path_symbol_ids": [ - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "41135180f7b3b9ab20e097e0747474e219c37dd2366ef08a7b43c1f3edb10b4c" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - }, - "content": "TraceService.__init__\n -> TraceService.store\n -> TraceService.current_trace_id" - }, - { - "path": "src/app_runtime/tracing/service.py", - "metadata": { - "edge_id": "9f34c5da9b09fba99df6f6b1bde183a9aeb45111b8218a747c71590c2c9f60f2", - "edge_type": "dataflow_slice", - "src_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "src_qname": "TraceService.__init__", - "dst_symbol_id": "c44bfbc66cf747283f30088da3e011a10395031d41e77b74e523c24997f641ca", - "dst_ref": "TraceService.step", - "resolution": "resolved", - "slice_id": "9f34c5da9b09fba99df6f6b1bde183a9aeb45111b8218a747c71590c2c9f60f2", - "root_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "path_symbols": [ - "TraceService.__init__", - "TraceService.store", - "TraceService.step" - ], - "path_symbol_ids": [ - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "c44bfbc66cf747283f30088da3e011a10395031d41e77b74e523c24997f641ca" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - }, - "content": "TraceService.__init__\n -> TraceService.store\n -> TraceService.step" - } - ], - "entrypoints": [ - { - "path": "src/app_runtime/control/http_app.py", - "title": "app.get", - "start_line": 31, - "end_line": 34, - "http_method": "GET", - "route_path": "", - "handler_symbol": "", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "route_or_command": "app.get", - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "title": "app.get", - "start_line": 38, - "end_line": 42, - "http_method": "GET", - "route_path": "", - "handler_symbol": "", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "route_or_command": "app.get", - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "title": "app.post", - "start_line": 38, - "end_line": 42, - "http_method": "POST", - "route_path": "", - "handler_symbol": "", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "route_or_command": "app.post", - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "test_candidates": [], - "layer_outcomes": [ - { - "layer_id": "C1_SYMBOL_CATALOG", - "hit_count": 8, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C0_SOURCE_CHUNKS", - "hit_count": 8, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C4_SEMANTIC_ROLES", - "hit_count": 8, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C2_DEPENDENCY_GRAPH", - "hit_count": 6, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C3_ENTRYPOINTS", - "hit_count": 3, - "empty": false, - "fallback_used": false - } - ], - "missing_layers": [], - "raw_rows": [ - { - "path": "src/plba/__init__.py", - "content": "const TraceService\nTraceService = plba.tracing.TraceService", - "layer": "C1_SYMBOL_CATALOG", - "title": "TraceService", - "span_start": 20, - "span_end": 20, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": null, - "metadata": { - "symbol_id": "259ec03b77b9387ea53f69c77af32791dd29adf6de617ba72dd3f839197342a1", - "qname": "TraceService", - "kind": "const", - "signature": "TraceService = plba.tracing.TraceService", - "parent_symbol_id": null, - "package_or_module": "src.plba.__init__", - "is_test": false, - "blob_sha": "24e755ec8c249d14fb0e675b5dbf2b71ab91afb9c849897eebfa9feb2499e19d", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "const TraceService\nTraceService = app_runtime.tracing.service.TraceService", - "layer": "C1_SYMBOL_CATALOG", - "title": "TraceService", - "span_start": 14, - "span_end": 14, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": null, - "metadata": { - "symbol_id": "3ccf6212fd7d9730f9df933e2ee7671b65bdae0520577e1a49c6432262842db6", - "qname": "TraceService", - "kind": "const", - "signature": "TraceService = app_runtime.tracing.service.TraceService", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.core.runtime", - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/__init__.py", - "content": "const TraceService\nTraceService = app_runtime.tracing.service.TraceService", - "layer": "C1_SYMBOL_CATALOG", - "title": "TraceService", - "span_start": 2, - "span_end": 2, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": null, - "metadata": { - "symbol_id": "ecd2fab7fa9744b2adca84d3d213f7aadcb7e1da84b9c2764a4ab39c65282b11", - "qname": "TraceService", - "kind": "const", - "signature": "TraceService = app_runtime.tracing.service.TraceService", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.tracing.__init__", - "is_test": false, - "blob_sha": "a01dea5f773515aeaae8e6d3431fcb93531a8b577dfa26c2e5db16cd6ae6e4d9", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "class TraceService\nTraceService(TraceContextFactory)", - "layer": "C1_SYMBOL_CATALOG", - "title": "TraceService", - "span_start": 39, - "span_end": 166, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": null, - "metadata": { - "symbol_id": "c2b2b976d99f2c600000b753731b26e0a69adcb4359398b93073590c5d5d04f4", - "qname": "TraceService", - "kind": "class", - "signature": "TraceService(TraceContextFactory)", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.tracing.service", - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/tracing.py", - "content": "const TraceService\nTraceService = app_runtime.tracing.service.TraceService", - "layer": "C1_SYMBOL_CATALOG", - "title": "TraceService", - "span_start": 1, - "span_end": 1, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": null, - "metadata": { - "symbol_id": "a4556fb3f83c50ea68b94a679786ce802cab7ffd9d7138aad3d6009b2661f425", - "qname": "TraceService", - "kind": "const", - "signature": "TraceService = app_runtime.tracing.service.TraceService", - "parent_symbol_id": null, - "package_or_module": "src.plba.tracing", - "is_test": false, - "blob_sha": "a27e11c716c93c3fcefe6f11b4cc420a6b743e7606606071d7f1aeeccc4e7d45", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "method TraceService.open_context\nopen_context(self)", - "layer": "C1_SYMBOL_CATALOG", - "title": "TraceService.open_context", - "span_start": 66, - "span_end": 78, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": null, - "metadata": { - "symbol_id": "2da3d5b20a947bf63e14c103be4689b72fd837e0a82abd6c497846375d4c7426", - "qname": "TraceService.open_context", - "kind": "method", - "signature": "open_context(self)", - "parent_symbol_id": "TraceService", - "package_or_module": "src.app_runtime.tracing.service", - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "method TraceService.create_context\ncreate_context(self)", - "layer": "C1_SYMBOL_CATALOG", - "title": "TraceService.create_context", - "span_start": 45, - "span_end": 63, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": null, - "metadata": { - "symbol_id": "ff44881104b65ef50ee6fe16d367d4a81b6e7eb5c44c0963cf4543faec785d4a", - "qname": "TraceService.create_context", - "kind": "method", - "signature": "create_context(self)", - "parent_symbol_id": "TraceService", - "package_or_module": "src.app_runtime.tracing.service", - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "method TraceService.current_trace_id\ncurrent_trace_id(self)", - "layer": "C1_SYMBOL_CATALOG", - "title": "TraceService.current_trace_id", - "span_start": 80, - "span_end": 81, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": null, - "metadata": { - "symbol_id": "41135180f7b3b9ab20e097e0747474e219c37dd2366ef08a7b43c1f3edb10b4c", - "qname": "TraceService.current_trace_id", - "kind": "method", - "signature": "current_trace_id(self)", - "parent_symbol_id": "TraceService", - "package_or_module": "src.app_runtime.tracing.service", - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "class TraceService(TraceContextFactory):\n def __init__(self, transport: TraceTransport | None = None, store: TraceContextStore | None = None) -> None:\n self.transport = transport or NoOpTraceTransport()\n self.store = store or TraceContextStore()\n self._writer = TraceRecordWriter(self.transport)\n\n def create_context(\n self,\n *,\n alias: str,\n parent_id: str | None = None,\n kind: str | None = None,\n attrs: dict[str, Any] | None = None,\n ) -> str:\n record = TraceContextRecord(\n trace_id=uuid4().hex,\n alias=str(alias or \"\"),\n parent_id=parent_id,\n type=kind,\n event_time=utc_now(),\n attrs=dict(attrs or {}),\n )\n self.store.push(record)\n self._writer.write_context(record)\n return record.trace_id\n\n @contextmanager\n def open_context(\n self,\n *,\n alias: str,\n parent_id: str | None = None,\n kind: str | None = None,\n attrs: dict[str, Any] | None = None,\n ) -> Iterator[str]:\n trace_id = self.create_context(alias=alias, parent_id=parent_id, kind=kind, attrs=attrs)\n try:\n yield trace_id\n finally:\n self.store.pop()\n\n def current_trace_id(self) -> str | None:\n return self.store.current_trace_id()\n\n def close_context(self) -> str | None:\n previous = self.store.pop()\n return previous.record.trace_id if previous else None\n\n def step(self, name: str) -> None:\n self.store.set_step(str(name or \"\"))\n\n def info(self, message: str, *, status: str | None = None, attrs: dict[str, Any] | None = None) -> None:\n self._write_message(\"INFO\", message, status, attrs)\n\n def debug(self, message: str, *, status: str | None = None, attrs: dict[str, Any] | None = None) -> None:\n self._write_message(\"DEBUG\", message, status, attrs)\n\n def warning(self, message: str, *, status: str | None = None, attrs: dict[str, Any] | None = None) -> None:\n self._write_message(\"WARNING\", message, status, attrs)\n\n def error(self, message: str, *, status: str | None = None, attrs: dict[str, Any] | None = None) -> None:\n self._write_message(\"ERROR\", message, status, attrs)\n\n def exception(self, message: str, *, status: str = \"failed\", attrs: dict[str, Any] | None = None) -> None:\n self._write_message(\"ERROR\", message, status, attrs)\n\n def new_root(self, operation: str) -> TraceContext:\n trace_id = self.create_context(alias=operation, kind=\"operation\", attrs={\"operation\": operation})\n return TraceContext(trace_id=trace_id, span_id=trace_id, attributes={\"operation\": operation})\n\n def child_of(self, parent: TraceContext, operation: str) -> TraceContext:\n trace_id = self.create_context(\n alias=operation,\n parent_id=parent.trace_id,\n kind=\"worker\",\n attrs={\"operation\": operation},\n )\n return TraceContext(\n trace_id=trace_id,\n span_id=trace_id,\n parent_span_id=parent.span_id,\n attributes={\"operation\": operation},\n )\n\n def attach(self, metadata: dict[str, object], context: TraceContext) -> dict[str, object]:\n updated = dict(metadata)\n updated[\"trace_id\"] = context.trace_id\n updated[\"span_id\"] = context.span_id\n updated[\"parent_span_id\"] = context.parent_span_id\n return updated\n\n def resume(self, metadata: dict[str, object], operation: str) -> TraceContext:\n trace_id = str(metadata.get(\"trace_id\") or uuid4().hex)\n span_id = str(metadata.get(\"span_id\") or trace_id)\n parent_id = metadata.get(\"parent_span_id\")\n self.create_context(\n alias=operation,\n parent_id=str(parent_id) if parent_id else None,\n kind=\"worker\",\n attrs=dict(metadata),\n )\n return TraceContext(\n trace_id=trace_id,\n span_id=span_id,\n parent_span_id=str(parent_id) if parent_id else None,\n attributes={\"operation\": operation},\n )\n\n def _write_message(\n self,\n level: TraceLevel,\n message: str,\n status: str | None,\n attrs: dict[str, Any] | None,\n ) -> None:\n active = self.store.current()\n if active is None:\n raise RuntimeError(\"Trace context is not bound. Call create_context() first.\")\n record = TraceLogMessage(\n trace_id=active.record.trace_id,\n step=active.step,\n status=str(status or \"\"),\n message=str(message or \"\"),\n level=level,\n event_time=utc_now(),\n attrs=dict(attrs or {}),\n )\n self._writer.write_message(record)", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/tracing/service.py:TraceService", - "span_start": 39, - "span_end": 166, - "lexical_rank": 6, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": null, - "metadata": { - "chunk_index": 1, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.tracing.service", - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "class TraceManager(TraceService):\n \"\"\"Compatibility alias during the transition from ConfigManager-shaped naming.\"\"\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/tracing/service.py:TraceManager", - "span_start": 169, - "span_end": 170, - "lexical_rank": 6, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": null, - "metadata": { - "chunk_index": 2, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.tracing.service", - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "class RuntimeManager:\n ACTION_TIMEOUT_SECONDS = 10.0\n ACTION_POLL_INTERVAL_SECONDS = 0.05\n\n def __init__(\n self,\n configuration: ConfigurationManager | None = None,\n services: ServiceContainer | None = None,\n traces: TraceService | None = None,\n health: HealthRegistry | None = None,\n logs: LogManager | None = None,\n workers: WorkerSupervisor | None = None,\n control_plane: ControlPlaneService | None = None,\n ) -> None:\n self.configuration = configuration or ConfigurationManager()\n self.services = services or ServiceContainer()\n self.traces = traces or TraceService()\n self.health = health or HealthRegistry()\n self.logs = logs or LogManager()\n self.workers = workers or WorkerSupervisor()\n self.control_plane = control_plane or ControlPlaneService()\n self.registry = ModuleRegistry(self.services)\n self._started = False\n self._state = LifecycleState.IDLE\n self._core_registered = False\n self._workers_registered = False\n self._register_core_services()\n\n def register_module(self, module: ApplicationModule) -> None:\n self.registry.register_module(module.name)\n module.register(self.registry)\n\n def add_config_file(self, path: str) -> FileConfigProvider:\n provider = FileConfigProvider(path)\n self.configuration.add_provider(provider)\n return provider\n\n def start(self, *, start_control_plane: bool = True) -> None:\n if self._started:\n return\n self._state = LifecycleState.STARTING\n config = self.configuration.load()\n self.logs.apply_config(config)\n self._register_health_contributors()\n self._register_workers()\n self.workers.start()\n if start_control_plane:\n self.control_plane.start(self)\n self._started = True\n self._refresh_state()\n\n def stop(self, timeout: float = 30.0, force: bool = False, stop_control_plane: bool = True) -> None:\n if not self._started:\n return\n self._state = LifecycleState.STOPPING\n self.workers.stop(timeout=timeout, force=force)\n if stop_control_plane:\n self.control_plane.stop()\n self._started = False\n self._state = LifecycleState.STOPPED\n\n def status(self) -> dict[str, object]:\n self._refresh_state()\n return self.control_plane.snapshot(self)\n\n def current_health(self) -> HealthPayload:\n self._refresh_state()\n return self.health.payload(self._state, self.workers.healths())\n\n async def health_status(self) -> HealthPayload:\n return self.current_health()\n\n async def start_runtime(self) -> dict[str, object] | str:\n self._refresh_state()\n if self._started:\n return \"runtime already running\"\n if self._state == LifecycleState.STOPPING:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n\n self.start(start_control_plane=False)\n started = self._wait_for_state({LifecycleState.IDLE, LifecycleState.BUSY}, timeout=self.ACTION_TIMEOUT_SECONDS)\n if started:\n return self._action_detail(\"runtime started\", timed_out=False)\n return self._action_detail(\"runtime start is still in progress\", timed_out=True)\n\n async def stop_runtime(self) -> dict[str, object] | str:\n self._refresh_state()\n if not self._started:\n if self._state == LifecycleState.STOPPING:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n return \"runtime already stopped\"\n\n self._state = LifecycleState.STOPPING\n try:\n self.workers.stop(timeout=self.ACTION_TIMEOUT_SECONDS, force=False)\n except TimeoutError:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n\n self._started = False\n self._state = LifecycleState.STOPPED\n return self._action_detail(\"runtime stopped\", timed_out=False)\n\n async def runtime_status(self) -> str:\n self._refresh_state()\n return self._state.value\n\n def _register_core_services(self) -> None:\n if self._core_registered:\n return\n self.services.register(\"configuration\", self.configuration)\n self.services.register(\"traces\", self.traces)\n self.services.register(\"health\", self.health)\n self.services.register(\"logs\", self.logs)\n self.services.register(\"workers\", self.workers)\n self.services.register(\"control_plane\", self.control_plane)\n self._core_registered = True\n\n def _register_health_contributors(self) -> None:\n for contributor in self.registry.health_contributors:\n self.health.register(contributor)\n\n def _register_workers(self) -> None:\n if self._workers_registered:\n return\n for worker in self.registry.workers:\n self.workers.register(worker)\n self._workers_registered = True\n\n def _refresh_state(self) -> None:\n lifecycle = self.workers.lifecycle_state()\n\n if self._state == LifecycleState.STOPPING:\n if lifecycle == LifecycleState.STOPPED:\n self._started = False\n self._state = LifecycleState.STOPPED\n return\n\n if not self._started:\n if lifecycle == LifecycleState.STOPPED:\n self._state = LifecycleState.STOPPED\n return\n\n self._state = lifecycle\n\n def _wait_for_state(self, target_states: set[LifecycleState], *, timeout: float) -> bool:\n deadline = monotonic() + timeout\n while monotonic() < deadline:\n self._refresh_state()\n if self._state in target_states:\n return True\n sleep(self.ACTION_POLL_INTERVAL_SECONDS)\n self._refresh_state()\n return self._state in target_states\n\n def _action_detail(self, message: str, *, timed_out: bool) -> dict[str, object]:\n self._refresh_state()\n return {\n \"message\": message,\n \"state\": self._state.value,\n \"timed_out\": timed_out,\n \"workers\": self.workers.snapshot(),\n }", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/core/runtime.py:RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 6, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": null, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.core.runtime", - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/__init__.py", - "content": "from app_runtime.contracts.trace import TraceContext, TraceContextRecord, TraceLogMessage, TraceTransport\nfrom app_runtime.tracing.service import TraceManager, TraceService\nfrom app_runtime.tracing.store import ActiveTraceContext, TraceContextStore\nfrom app_runtime.tracing.transport import MySqlTraceTransport, NoOpTraceTransport\n\n__all__ = [\n \"ActiveTraceContext\",\n \"MySqlTraceTransport\",\n \"NoOpTraceTransport\",\n \"TraceContext\",\n \"TraceContextRecord\",\n \"TraceContextStore\",\n \"TraceLogMessage\",\n \"TraceManager\",\n \"TraceService\",\n \"TraceTransport\",\n]", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/tracing/__init__.py:1-17", - "span_start": 1, - "span_end": 17, - "lexical_rank": 6, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": null, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.app_runtime.tracing.__init__", - "is_test": false, - "blob_sha": "a01dea5f773515aeaae8e6d3431fcb93531a8b577dfa26c2e5db16cd6ae6e4d9", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/__init__.py", - "content": "from plba.bootstrap import create_runtime\nfrom plba.config import ConfigFileLoader, FileConfigProvider\nfrom plba.control import ControlActionSet, ControlChannel, ControlPlaneService, HttpControlChannel\nfrom plba.contracts import (\n ApplicationModule,\n ConfigProvider,\n HealthContributor,\n TraceContext,\n TraceContextRecord,\n TraceLogMessage,\n TraceTransport,\n Worker,\n WorkerHealth,\n WorkerStatus,\n)\nfrom plba.core import ConfigurationManager, RuntimeManager, ServiceContainer\nfrom plba.health import HealthRegistry\nfrom plba.logging import LogManager\nfrom plba.queue import InMemoryTaskQueue\nfrom plba.tracing import MySqlTraceTransport, NoOpTraceTransport, TraceService\nfrom plba.workflow import (\n StepResult,\n WorkflowContext,\n WorkflowDefinition,\n WorkflowEngine,\n WorkflowEngineHooks,\n WorkflowNode,\n WorkflowRuntimeFactory,\n WorkflowStep,\n)\nfrom plba.workers import WorkerSupervisor\n\n__all__ = [\n \"ApplicationModule\",\n \"ConfigFileLoader\",\n \"ConfigProvider\",\n \"ConfigurationManager\",\n \"ControlActionSet\",\n \"ControlChannel\",\n \"ControlPlaneService\",\n \"create_runtime\",\n \"FileConfigProvider\",\n \"HealthContributor\",\n \"HealthRegistry\",\n \"HttpControlChannel\",\n \"InMemoryTaskQueue\",\n \"LogManager\",\n \"MySqlTraceTransport\",\n \"NoOpTraceTransport\",\n \"RuntimeManager\",\n \"ServiceContainer\",\n \"TraceContext\",\n \"TraceContextRecord\",\n \"TraceLogMessage\",\n \"TraceService\",\n \"TraceTransport\",\n \"StepResult\",\n \"Worker\",\n \"WorkerHealth\",\n \"WorkerStatus\",\n \"WorkflowContext\",\n \"WorkflowDefinition\",\n \"WorkflowEngine\",\n \"WorkflowEngineHooks\",\n \"WorkflowNode\",\n \"WorkflowRuntimeFactory\",\n \"WorkflowStep\",\n \"WorkerSupervisor\",\n]", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/plba/__init__.py:1-69", - "span_start": 1, - "span_end": 69, - "lexical_rank": 6, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": null, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.plba.__init__", - "is_test": false, - "blob_sha": "24e755ec8c249d14fb0e675b5dbf2b71ab91afb9c849897eebfa9feb2499e19d", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/tracing.py", - "content": "from app_runtime.tracing.service import TraceService\nfrom app_runtime.tracing.transport import MySqlTraceTransport, NoOpTraceTransport\n\n__all__ = [\"MySqlTraceTransport\", \"NoOpTraceTransport\", \"TraceService\"]", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/plba/tracing.py:1-4", - "span_start": 1, - "span_end": 4, - "lexical_rank": 6, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": null, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.plba.tracing", - "is_test": false, - "blob_sha": "a27e11c716c93c3fcefe6f11b4cc420a6b743e7606606071d7f1aeeccc4e7d45", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/contracts/__init__.py", - "content": "__all__: list[str] = []", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/__init__.py:1-1", - "span_start": 1, - "span_end": 1, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": null, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.app_runtime.__init__", - "is_test": false, - "blob_sha": "8eea9df4f6d7b38ca0e39ccc27b04700e3d08dbeec8046d613d22706d19985fa", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/config/providers.py", - "content": "class FileConfigProvider(ConfigProvider):\n def __init__(self, path: str | Path) -> None:\n self._loader = ConfigFileLoader(path)\n\n @property\n def loader(self) -> ConfigFileLoader:\n return self._loader\n\n def load(self) -> dict[str, Any]:\n config = self._loader.load_sync()\n if not isinstance(config, dict):\n raise TypeError(\"Config root must be a mapping\")\n return dict(config)", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/config/providers.py:FileConfigProvider", - "span_start": 10, - "span_end": 22, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": null, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.config.providers", - "is_test": false, - "blob_sha": "8c53ca0122d6df6c5763bca15e99434bb4daebd5a618b8fc927e9ae90b022e64", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "TraceService\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests service\n- reads and writes state attributes\n- participates in dataflow slices (13)", - "layer": "C4_SEMANTIC_ROLES", - "title": "TraceService", - "span_start": 39, - "span_end": 166, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 60, - "layer_rank": 2, - "distance": null, - "metadata": { - "symbol_id": "c2b2b976d99f2c600000b753731b26e0a69adcb4359398b93073590c5d5d04f4", - "symbol_name": "TraceService", - "qname": "TraceService", - "role": "pipeline_stage", - "confidence": 0.57, - "dataflow_participation": 13, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_runner.py", - "content": "UvicornThreadRunner\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (24)", - "layer": "C4_SEMANTIC_ROLES", - "title": "UvicornThreadRunner", - "span_start": 10, - "span_end": 61, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 11, - "layer_rank": 2, - "distance": null, - "metadata": { - "symbol_id": "fd55630045a02100df8877ac27d951ee08617d4598764394d48cb51fe067476a", - "symbol_name": "UvicornThreadRunner", - "qname": "UvicornThreadRunner", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 24, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "3779fdd2878b770e789a35bb2a89c9d79f13b61c26d7db1b3b683f9bb9e1623f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/persistence/workflow_persistence.py", - "content": "WorkflowPersistence\nrole: pipeline_stage\n\nResponsibilities:\n- orchestrates role-like calls (2)\n- reads and writes state attributes\n- participates in dataflow slices (16)", - "layer": "C4_SEMANTIC_ROLES", - "title": "WorkflowPersistence", - "span_start": 8, - "span_end": 54, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 15, - "layer_rank": 2, - "distance": null, - "metadata": { - "symbol_id": "7bd01ee45cf31f2d5c2e3e51656254860ac785d10cef9e0852cd4fba90857bae", - "symbol_name": "WorkflowPersistence", - "qname": "WorkflowPersistence", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 16, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "80e9410ddc639789b4353c2a1a757ba8d0d5b5bb6075b0b263b61551f04ae1f0", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (10)", - "layer": "C4_SEMANTIC_ROLES", - "title": "HttpControlChannel", - "span_start": 12, - "span_end": 57, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 21, - "layer_rank": 2, - "distance": null, - "metadata": { - "symbol_id": "1c9fbdc24819e5604c26ea55428a74310f03a03e1af197ed84846af61e42fdb0", - "symbol_name": "HttpControlChannel", - "qname": "HttpControlChannel", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 10, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/queue/in_memory.py", - "content": "InMemoryTaskQueue\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (9)", - "layer": "C4_SEMANTIC_ROLES", - "title": "InMemoryTaskQueue", - "span_start": 9, - "span_end": 38, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 22, - "layer_rank": 2, - "distance": null, - "metadata": { - "symbol_id": "2da04cb94544a3bcbf0943a95ad4bdd8710bcafaa32a02fd0e4de2178dcf3533", - "symbol_name": "InMemoryTaskQueue", - "qname": "InMemoryTaskQueue", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 9, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "58f0cc001ccda0eee4c6bc32ed83bd05eafd6b6644f1e8b4aa9eed3103db73dc", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/config/file_loader.py", - "content": "ConfigFileLoader\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (8)", - "layer": "C4_SEMANTIC_ROLES", - "title": "ConfigFileLoader", - "span_start": 11, - "span_end": 48, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 23, - "layer_rank": 2, - "distance": null, - "metadata": { - "symbol_id": "a8474eca8b6e9dc86ae67ed68b16fa5fb639ef08739c053e7b7195489765667f", - "symbol_name": "ConfigFileLoader", - "qname": "ConfigFileLoader", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 8, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "1f19ffebde5e38e4be5a5d5a678059a0f36dedb8fb8b3e00ab395c67106a87ea", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/store.py", - "content": "TraceContextStore\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (6)", - "layer": "C4_SEMANTIC_ROLES", - "title": "TraceContextStore", - "span_start": 15, - "span_end": 52, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 25, - "layer_rank": 2, - "distance": null, - "metadata": { - "symbol_id": "b2dad4fbe16ffb11b58deba311c7739955c39d59f291b22181f33e9c8cce4059", - "symbol_name": "TraceContextStore", - "qname": "TraceContextStore", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 6, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "d369554f08fc92039c6edd5a2a1e73b23901533e8974459170bbd9347d263dc5", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workers/supervisor.py", - "content": "WorkerSupervisor\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (6)", - "layer": "C4_SEMANTIC_ROLES", - "title": "WorkerSupervisor", - "span_start": 10, - "span_end": 59, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 25, - "layer_rank": 2, - "distance": null, - "metadata": { - "symbol_id": "c17b44e8d9e97d490989b21fa67d7c346cdda8a0472e4c41fb243c8846faa124", - "symbol_name": "WorkerSupervisor", - "qname": "WorkerSupervisor", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 6, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "77609d9d5927171cce7fc3a54897c183fd63068710c6362029b700937aae5eee", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "TraceService.__init__\n -> TraceService.store\n -> TraceService.create_context", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "TraceService.__init__:dataflow_slice", - "span_start": 42, - "span_end": 61, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": null, - "metadata": { - "edge_id": "3b052062067a78aef3302ee1d996897e02a67d1b340397bea4f59fe147c0492a", - "edge_type": "dataflow_slice", - "src_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "src_qname": "TraceService.__init__", - "dst_symbol_id": "ff44881104b65ef50ee6fe16d367d4a81b6e7eb5c44c0963cf4543faec785d4a", - "dst_ref": "TraceService.create_context", - "resolution": "resolved", - "slice_id": "3b052062067a78aef3302ee1d996897e02a67d1b340397bea4f59fe147c0492a", - "root_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "path_symbols": [ - "TraceService.__init__", - "TraceService.store", - "TraceService.create_context" - ], - "path_symbol_ids": [ - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "ff44881104b65ef50ee6fe16d367d4a81b6e7eb5c44c0963cf4543faec785d4a" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "TraceService.__init__\n -> TraceService.store\n -> TraceService.close_context", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "TraceService.__init__:dataflow_slice", - "span_start": 42, - "span_end": 84, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": null, - "metadata": { - "edge_id": "7a9353ef57c9ae5d19b3a0c6ac50fad05e6d21d31bbe1cd1cd07af6332ba6505", - "edge_type": "dataflow_slice", - "src_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "src_qname": "TraceService.__init__", - "dst_symbol_id": "01e14158dcced7e52d0c8ac84ac7b9a75225c261b6aca6a1d7da802d0994721c", - "dst_ref": "TraceService.close_context", - "resolution": "resolved", - "slice_id": "7a9353ef57c9ae5d19b3a0c6ac50fad05e6d21d31bbe1cd1cd07af6332ba6505", - "root_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "path_symbols": [ - "TraceService.__init__", - "TraceService.store", - "TraceService.close_context" - ], - "path_symbol_ids": [ - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "01e14158dcced7e52d0c8ac84ac7b9a75225c261b6aca6a1d7da802d0994721c" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "TraceService.__init__\n -> TraceService.store\n -> TraceService.open_context", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "TraceService.__init__:dataflow_slice", - "span_start": 42, - "span_end": 78, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": null, - "metadata": { - "edge_id": "a6e13b9ebc4fed84586afd53ed92a4d14757e440873f572b2337d5622ee96031", - "edge_type": "dataflow_slice", - "src_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "src_qname": "TraceService.__init__", - "dst_symbol_id": "2da3d5b20a947bf63e14c103be4689b72fd837e0a82abd6c497846375d4c7426", - "dst_ref": "TraceService.open_context", - "resolution": "resolved", - "slice_id": "a6e13b9ebc4fed84586afd53ed92a4d14757e440873f572b2337d5622ee96031", - "root_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "path_symbols": [ - "TraceService.__init__", - "TraceService.store", - "TraceService.open_context" - ], - "path_symbol_ids": [ - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "2da3d5b20a947bf63e14c103be4689b72fd837e0a82abd6c497846375d4c7426" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "TraceService.__init__\n -> TraceService.transport\n -> TraceService.__init__", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "TraceService.__init__:dataflow_slice", - "span_start": 41, - "span_end": 43, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": null, - "metadata": { - "edge_id": "1e923a93faa05c3c43ca9b19bd047007a8589ccce57d3cc1798ae7f9f200af98", - "edge_type": "dataflow_slice", - "src_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "src_qname": "TraceService.__init__", - "dst_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "dst_ref": "TraceService.__init__", - "resolution": "resolved", - "slice_id": "1e923a93faa05c3c43ca9b19bd047007a8589ccce57d3cc1798ae7f9f200af98", - "root_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "path_symbols": [ - "TraceService.__init__", - "TraceService.transport", - "TraceService.__init__" - ], - "path_symbol_ids": [ - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "TraceService.__init__\n -> TraceService.store\n -> TraceService.current_trace_id", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "TraceService.__init__:dataflow_slice", - "span_start": 42, - "span_end": 81, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": null, - "metadata": { - "edge_id": "3ea17138634b1190bded77ddb84aa1595124f6519b246f24fc4b02bd62b5cac1", - "edge_type": "dataflow_slice", - "src_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "src_qname": "TraceService.__init__", - "dst_symbol_id": "41135180f7b3b9ab20e097e0747474e219c37dd2366ef08a7b43c1f3edb10b4c", - "dst_ref": "TraceService.current_trace_id", - "resolution": "resolved", - "slice_id": "3ea17138634b1190bded77ddb84aa1595124f6519b246f24fc4b02bd62b5cac1", - "root_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "path_symbols": [ - "TraceService.__init__", - "TraceService.store", - "TraceService.current_trace_id" - ], - "path_symbol_ids": [ - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "41135180f7b3b9ab20e097e0747474e219c37dd2366ef08a7b43c1f3edb10b4c" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "TraceService.__init__\n -> TraceService.store\n -> TraceService.step", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "TraceService.__init__:dataflow_slice", - "span_start": 42, - "span_end": 88, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": null, - "metadata": { - "edge_id": "9f34c5da9b09fba99df6f6b1bde183a9aeb45111b8218a747c71590c2c9f60f2", - "edge_type": "dataflow_slice", - "src_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "src_qname": "TraceService.__init__", - "dst_symbol_id": "c44bfbc66cf747283f30088da3e011a10395031d41e77b74e523c24997f641ca", - "dst_ref": "TraceService.step", - "resolution": "resolved", - "slice_id": "9f34c5da9b09fba99df6f6b1bde183a9aeb45111b8218a747c71590c2c9f60f2", - "root_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "path_symbols": [ - "TraceService.__init__", - "TraceService.store", - "TraceService.step" - ], - "path_symbol_ids": [ - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "c44bfbc66cf747283f30088da3e011a10395031d41e77b74e523c24997f641ca" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": null, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": null, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": null, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "retrieval_report": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "vector", - "C0_SOURCE_CHUNKS": "vector", - "C4_SEMANTIC_ROLES": "vector", - "C2_DEPENDENCY_GRAPH": "vector", - "C3_ENTRYPOINTS": "vector" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 8, - "C4_SEMANTIC_ROLES": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C3_ENTRYPOINTS": 6 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [] - }, - "C4_SEMANTIC_ROLES": { - "path_scope": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [] - } - }, - "fallback": { - "used": false, - "reason": null - }, - "retrieval_by_layer_ms": { - "C1_SYMBOL_CATALOG": 50, - "C0_SOURCE_CHUNKS": 18, - "C4_SEMANTIC_ROLES": 18, - "C2_DEPENDENCY_GRAPH": 50, - "C3_ENTRYPOINTS": 17 - } - } - }, - "diagnostics": { - "intent_correct": null, - "target_found": true, - "layers_used": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_sufficient": true, - "answer_mode": "normal", - "resolved_target": "TraceService", - "answer_policy_branch": "normal_answer", - "decision_reason": "evidence_sufficient", - "router_result": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "retrieval_profile": "code", - "sub_intent": "EXPLAIN", - "path_scope": [], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "symbol_resolution_status": "resolved" - }, - "retrieval_request": { - "rag_session_id": "7d11da21-faa0-4cea-aede-aeabe069164c", - "query": "Объясни как работает класс TraceService", - "sub_intent": "EXPLAIN", - "path_scope": [], - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "per_layer_outcome": [ - { - "layer_id": "C1_SYMBOL_CATALOG", - "hit_count": 8, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C0_SOURCE_CHUNKS", - "hit_count": 8, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C4_SEMANTIC_ROLES", - "hit_count": 8, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C2_DEPENDENCY_GRAPH", - "hit_count": 6, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C3_ENTRYPOINTS", - "hit_count": 3, - "empty": false, - "fallback_used": false - } - ], - "empty_layers": [], - "evidence_gate_decision": { - "sufficient": true, - "failure_reasons": [], - "evidence_count": 33 - }, - "evidence_gate_input": { - "resolved_target": "TraceService", - "sub_intent": "EXPLAIN", - "target_type": "symbol", - "evidence_count": 33, - "code_chunk_count": 33, - "entrypoint_count": 3, - "relation_count": 6, - "test_evidence_count": 0, - "symbol_resolution_status": "resolved", - "path_scope": [] - }, - "post_evidence_gate": { - "input": { - "answer_mode": "normal", - "degraded_message": "", - "resolved_target": "TraceService", - "draft_answer_preview": "Класс `TraceService` находится в файле `src/app_runtime/tracing/service.py`. Он наследуется от `TraceContextFactory`.\n\nОсновные компоненты:\n\n- **Конструктор (`__init__`)**: принимает параметры `transport` и `store`, инициализирует транспорт для трассировки и хранилище контекста трассировки. Если тра", - "repair_candidate": true - }, - "output": { - "passed": true, - "action": "return", - "reasons": [], - "repair_used": false, - "final_answer_preview": "Класс `TraceService` находится в файле `src/app_runtime/tracing/service.py`. Он наследуется от `TraceContextFactory`.\n\nОсновные компоненты:\n\n- **Конструктор (`__init__`)**: принимает параметры `transport` и `store`, инициализирует транспорт для трассировки и хранилище контекста трассировки. Если тра" - } - }, - "failure_reasons": [], - "timings_ms": { - "router": 2, - "retrieval": 156, - "pre_evidence_gate": 1, - "llm": 5609, - "post_evidence_gate": 1 - } - }, - "rag_rows": [ - { - "path": "src/plba/__init__.py", - "content": "const TraceService\nTraceService = plba.tracing.TraceService", - "layer": "C1_SYMBOL_CATALOG", - "title": "TraceService", - "span_start": 20, - "span_end": 20, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "259ec03b77b9387ea53f69c77af32791dd29adf6de617ba72dd3f839197342a1", - "qname": "TraceService", - "kind": "const", - "signature": "TraceService = plba.tracing.TraceService", - "parent_symbol_id": null, - "package_or_module": "src.plba.__init__", - "is_test": false, - "blob_sha": "24e755ec8c249d14fb0e675b5dbf2b71ab91afb9c849897eebfa9feb2499e19d", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "const TraceService\nTraceService = app_runtime.tracing.service.TraceService", - "layer": "C1_SYMBOL_CATALOG", - "title": "TraceService", - "span_start": 14, - "span_end": 14, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "3ccf6212fd7d9730f9df933e2ee7671b65bdae0520577e1a49c6432262842db6", - "qname": "TraceService", - "kind": "const", - "signature": "TraceService = app_runtime.tracing.service.TraceService", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.core.runtime", - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/__init__.py", - "content": "const TraceService\nTraceService = app_runtime.tracing.service.TraceService", - "layer": "C1_SYMBOL_CATALOG", - "title": "TraceService", - "span_start": 2, - "span_end": 2, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "ecd2fab7fa9744b2adca84d3d213f7aadcb7e1da84b9c2764a4ab39c65282b11", - "qname": "TraceService", - "kind": "const", - "signature": "TraceService = app_runtime.tracing.service.TraceService", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.tracing.__init__", - "is_test": false, - "blob_sha": "a01dea5f773515aeaae8e6d3431fcb93531a8b577dfa26c2e5db16cd6ae6e4d9", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "class TraceService\nTraceService(TraceContextFactory)", - "layer": "C1_SYMBOL_CATALOG", - "title": "TraceService", - "span_start": 39, - "span_end": 166, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "c2b2b976d99f2c600000b753731b26e0a69adcb4359398b93073590c5d5d04f4", - "qname": "TraceService", - "kind": "class", - "signature": "TraceService(TraceContextFactory)", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.tracing.service", - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/tracing.py", - "content": "const TraceService\nTraceService = app_runtime.tracing.service.TraceService", - "layer": "C1_SYMBOL_CATALOG", - "title": "TraceService", - "span_start": 1, - "span_end": 1, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "a4556fb3f83c50ea68b94a679786ce802cab7ffd9d7138aad3d6009b2661f425", - "qname": "TraceService", - "kind": "const", - "signature": "TraceService = app_runtime.tracing.service.TraceService", - "parent_symbol_id": null, - "package_or_module": "src.plba.tracing", - "is_test": false, - "blob_sha": "a27e11c716c93c3fcefe6f11b4cc420a6b743e7606606071d7f1aeeccc4e7d45", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "method TraceService.open_context\nopen_context(self)", - "layer": "C1_SYMBOL_CATALOG", - "title": "TraceService.open_context", - "span_start": 66, - "span_end": 78, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "2da3d5b20a947bf63e14c103be4689b72fd837e0a82abd6c497846375d4c7426", - "qname": "TraceService.open_context", - "kind": "method", - "signature": "open_context(self)", - "parent_symbol_id": "TraceService", - "package_or_module": "src.app_runtime.tracing.service", - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "method TraceService.create_context\ncreate_context(self)", - "layer": "C1_SYMBOL_CATALOG", - "title": "TraceService.create_context", - "span_start": 45, - "span_end": 63, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "ff44881104b65ef50ee6fe16d367d4a81b6e7eb5c44c0963cf4543faec785d4a", - "qname": "TraceService.create_context", - "kind": "method", - "signature": "create_context(self)", - "parent_symbol_id": "TraceService", - "package_or_module": "src.app_runtime.tracing.service", - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "method TraceService.current_trace_id\ncurrent_trace_id(self)", - "layer": "C1_SYMBOL_CATALOG", - "title": "TraceService.current_trace_id", - "span_start": 80, - "span_end": 81, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "41135180f7b3b9ab20e097e0747474e219c37dd2366ef08a7b43c1f3edb10b4c", - "qname": "TraceService.current_trace_id", - "kind": "method", - "signature": "current_trace_id(self)", - "parent_symbol_id": "TraceService", - "package_or_module": "src.app_runtime.tracing.service", - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "class TraceService(TraceContextFactory):\n def __init__(self, transport: TraceTransport | None = None, store: TraceContextStore | None = None) -> None:\n self.transport = transport or NoOpTraceTransport()\n self.store = store or TraceContextStore()\n self._writer = TraceRecordWriter(self.transport)\n\n def create_context(\n self,\n *,\n alias: str,\n parent_id: str | None = None,\n kind: str | None = None,\n attrs: dict[str, Any] | None = None,\n ) -> str:\n record = TraceContextRecord(\n trace_id=uuid4().hex,\n alias=str(alias or \"\"),\n parent_id=parent_id,\n type=kind,\n event_time=utc_now(),\n attrs=dict(attrs or {}),\n )\n self.store.push(record)\n self._writer.write_context(record)\n return record.trace_id\n\n @contextmanager\n def open_context(\n self,\n *,\n alias: str,\n parent_id: str | None = None,\n kind: str | None = None,\n attrs: dict[str, Any] | None = None,\n ) -> Iterator[str]:\n trace_id = self.create_context(alias=alias, parent_id=parent_id, kind=kind, attrs=attrs)\n try:\n yield trace_id\n finally:\n self.store.pop()\n\n def current_trace_id(self) -> str | None:\n return self.store.current_trace_id()\n\n def close_context(self) -> str | None:\n previous = self.store.pop()\n return previous.record.trace_id if previous else None\n\n def step(self, name: str) -> None:\n self.store.set_step(str(name or \"\"))\n\n def info(self, message: str, *, status: str | None = None, attrs: dict[str, Any] | None = None) -> None:\n self._write_message(\"INFO\", message, status, attrs)\n\n def debug(self, message: str, *, status: str | None = None, attrs: dict[str, Any] | None = None) -> None:\n self._write_message(\"DEBUG\", message, status, attrs)\n\n def warning(self, message: str, *, status: str | None = None, attrs: dict[str, Any] | None = None) -> None:\n self._write_message(\"WARNING\", message, status, attrs)\n\n def error(self, message: str, *, status: str | None = None, attrs: dict[str, Any] | None = None) -> None:\n self._write_message(\"ERROR\", message, status, attrs)\n\n def exception(self, message: str, *, status: str = \"failed\", attrs: dict[str, Any] | None = None) -> None:\n self._write_message(\"ERROR\", message, status, attrs)\n\n def new_root(self, operation: str) -> TraceContext:\n trace_id = self.create_context(alias=operation, kind=\"operation\", attrs={\"operation\": operation})\n return TraceContext(trace_id=trace_id, span_id=trace_id, attributes={\"operation\": operation})\n\n def child_of(self, parent: TraceContext, operation: str) -> TraceContext:\n trace_id = self.create_context(\n alias=operation,\n parent_id=parent.trace_id,\n kind=\"worker\",\n attrs={\"operation\": operation},\n )\n return TraceContext(\n trace_id=trace_id,\n span_id=trace_id,\n parent_span_id=parent.span_id,\n attributes={\"operation\": operation},\n )\n\n def attach(self, metadata: dict[str, object], context: TraceContext) -> dict[str, object]:\n updated = dict(metadata)\n updated[\"trace_id\"] = context.trace_id\n updated[\"span_id\"] = context.span_id\n updated[\"parent_span_id\"] = context.parent_span_id\n return updated\n\n def resume(self, metadata: dict[str, object], operation: str) -> TraceContext:\n trace_id = str(metadata.get(\"trace_id\") or uuid4().hex)\n span_id = str(metadata.get(\"span_id\") or trace_id)\n parent_id = metadata.get(\"parent_span_id\")\n self.create_context(\n alias=operation,\n parent_id=str(parent_id) if parent_id else None,\n kind=\"worker\",\n attrs=dict(metadata),\n )\n return TraceContext(\n trace_id=trace_id,\n span_id=span_id,\n parent_span_id=str(parent_id) if parent_id else None,\n attributes={\"operation\": operation},\n )\n\n def _write_message(\n self,\n level: TraceLevel,\n message: str,\n status: str | None,\n attrs: dict[str, Any] | None,\n ) -> None:\n active = self.store.current()\n if active is None:\n raise RuntimeError(\"Trace context is not bound. Call create_context() first.\")\n record = TraceLogMessage(\n trace_id=active.record.trace_id,\n step=active.step,\n status=str(status or \"\"),\n message=str(message or \"\"),\n level=level,\n event_time=utc_now(),\n attrs=dict(attrs or {}),\n )\n self._writer.write_message(record)", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/tracing/service.py:TraceService", - "span_start": 39, - "span_end": 166, - "lexical_rank": 6, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 1, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.tracing.service", - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "class TraceManager(TraceService):\n \"\"\"Compatibility alias during the transition from ConfigManager-shaped naming.\"\"\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/tracing/service.py:TraceManager", - "span_start": 169, - "span_end": 170, - "lexical_rank": 6, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 2, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.tracing.service", - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "class RuntimeManager:\n ACTION_TIMEOUT_SECONDS = 10.0\n ACTION_POLL_INTERVAL_SECONDS = 0.05\n\n def __init__(\n self,\n configuration: ConfigurationManager | None = None,\n services: ServiceContainer | None = None,\n traces: TraceService | None = None,\n health: HealthRegistry | None = None,\n logs: LogManager | None = None,\n workers: WorkerSupervisor | None = None,\n control_plane: ControlPlaneService | None = None,\n ) -> None:\n self.configuration = configuration or ConfigurationManager()\n self.services = services or ServiceContainer()\n self.traces = traces or TraceService()\n self.health = health or HealthRegistry()\n self.logs = logs or LogManager()\n self.workers = workers or WorkerSupervisor()\n self.control_plane = control_plane or ControlPlaneService()\n self.registry = ModuleRegistry(self.services)\n self._started = False\n self._state = LifecycleState.IDLE\n self._core_registered = False\n self._workers_registered = False\n self._register_core_services()\n\n def register_module(self, module: ApplicationModule) -> None:\n self.registry.register_module(module.name)\n module.register(self.registry)\n\n def add_config_file(self, path: str) -> FileConfigProvider:\n provider = FileConfigProvider(path)\n self.configuration.add_provider(provider)\n return provider\n\n def start(self, *, start_control_plane: bool = True) -> None:\n if self._started:\n return\n self._state = LifecycleState.STARTING\n config = self.configuration.load()\n self.logs.apply_config(config)\n self._register_health_contributors()\n self._register_workers()\n self.workers.start()\n if start_control_plane:\n self.control_plane.start(self)\n self._started = True\n self._refresh_state()\n\n def stop(self, timeout: float = 30.0, force: bool = False, stop_control_plane: bool = True) -> None:\n if not self._started:\n return\n self._state = LifecycleState.STOPPING\n self.workers.stop(timeout=timeout, force=force)\n if stop_control_plane:\n self.control_plane.stop()\n self._started = False\n self._state = LifecycleState.STOPPED\n\n def status(self) -> dict[str, object]:\n self._refresh_state()\n return self.control_plane.snapshot(self)\n\n def current_health(self) -> HealthPayload:\n self._refresh_state()\n return self.health.payload(self._state, self.workers.healths())\n\n async def health_status(self) -> HealthPayload:\n return self.current_health()\n\n async def start_runtime(self) -> dict[str, object] | str:\n self._refresh_state()\n if self._started:\n return \"runtime already running\"\n if self._state == LifecycleState.STOPPING:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n\n self.start(start_control_plane=False)\n started = self._wait_for_state({LifecycleState.IDLE, LifecycleState.BUSY}, timeout=self.ACTION_TIMEOUT_SECONDS)\n if started:\n return self._action_detail(\"runtime started\", timed_out=False)\n return self._action_detail(\"runtime start is still in progress\", timed_out=True)\n\n async def stop_runtime(self) -> dict[str, object] | str:\n self._refresh_state()\n if not self._started:\n if self._state == LifecycleState.STOPPING:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n return \"runtime already stopped\"\n\n self._state = LifecycleState.STOPPING\n try:\n self.workers.stop(timeout=self.ACTION_TIMEOUT_SECONDS, force=False)\n except TimeoutError:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n\n self._started = False\n self._state = LifecycleState.STOPPED\n return self._action_detail(\"runtime stopped\", timed_out=False)\n\n async def runtime_status(self) -> str:\n self._refresh_state()\n return self._state.value\n\n def _register_core_services(self) -> None:\n if self._core_registered:\n return\n self.services.register(\"configuration\", self.configuration)\n self.services.register(\"traces\", self.traces)\n self.services.register(\"health\", self.health)\n self.services.register(\"logs\", self.logs)\n self.services.register(\"workers\", self.workers)\n self.services.register(\"control_plane\", self.control_plane)\n self._core_registered = True\n\n def _register_health_contributors(self) -> None:\n for contributor in self.registry.health_contributors:\n self.health.register(contributor)\n\n def _register_workers(self) -> None:\n if self._workers_registered:\n return\n for worker in self.registry.workers:\n self.workers.register(worker)\n self._workers_registered = True\n\n def _refresh_state(self) -> None:\n lifecycle = self.workers.lifecycle_state()\n\n if self._state == LifecycleState.STOPPING:\n if lifecycle == LifecycleState.STOPPED:\n self._started = False\n self._state = LifecycleState.STOPPED\n return\n\n if not self._started:\n if lifecycle == LifecycleState.STOPPED:\n self._state = LifecycleState.STOPPED\n return\n\n self._state = lifecycle\n\n def _wait_for_state(self, target_states: set[LifecycleState], *, timeout: float) -> bool:\n deadline = monotonic() + timeout\n while monotonic() < deadline:\n self._refresh_state()\n if self._state in target_states:\n return True\n sleep(self.ACTION_POLL_INTERVAL_SECONDS)\n self._refresh_state()\n return self._state in target_states\n\n def _action_detail(self, message: str, *, timed_out: bool) -> dict[str, object]:\n self._refresh_state()\n return {\n \"message\": message,\n \"state\": self._state.value,\n \"timed_out\": timed_out,\n \"workers\": self.workers.snapshot(),\n }", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/core/runtime.py:RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 6, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.core.runtime", - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/__init__.py", - "content": "from app_runtime.contracts.trace import TraceContext, TraceContextRecord, TraceLogMessage, TraceTransport\nfrom app_runtime.tracing.service import TraceManager, TraceService\nfrom app_runtime.tracing.store import ActiveTraceContext, TraceContextStore\nfrom app_runtime.tracing.transport import MySqlTraceTransport, NoOpTraceTransport\n\n__all__ = [\n \"ActiveTraceContext\",\n \"MySqlTraceTransport\",\n \"NoOpTraceTransport\",\n \"TraceContext\",\n \"TraceContextRecord\",\n \"TraceContextStore\",\n \"TraceLogMessage\",\n \"TraceManager\",\n \"TraceService\",\n \"TraceTransport\",\n]", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/tracing/__init__.py:1-17", - "span_start": 1, - "span_end": 17, - "lexical_rank": 6, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.app_runtime.tracing.__init__", - "is_test": false, - "blob_sha": "a01dea5f773515aeaae8e6d3431fcb93531a8b577dfa26c2e5db16cd6ae6e4d9", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/__init__.py", - "content": "from plba.bootstrap import create_runtime\nfrom plba.config import ConfigFileLoader, FileConfigProvider\nfrom plba.control import ControlActionSet, ControlChannel, ControlPlaneService, HttpControlChannel\nfrom plba.contracts import (\n ApplicationModule,\n ConfigProvider,\n HealthContributor,\n TraceContext,\n TraceContextRecord,\n TraceLogMessage,\n TraceTransport,\n Worker,\n WorkerHealth,\n WorkerStatus,\n)\nfrom plba.core import ConfigurationManager, RuntimeManager, ServiceContainer\nfrom plba.health import HealthRegistry\nfrom plba.logging import LogManager\nfrom plba.queue import InMemoryTaskQueue\nfrom plba.tracing import MySqlTraceTransport, NoOpTraceTransport, TraceService\nfrom plba.workflow import (\n StepResult,\n WorkflowContext,\n WorkflowDefinition,\n WorkflowEngine,\n WorkflowEngineHooks,\n WorkflowNode,\n WorkflowRuntimeFactory,\n WorkflowStep,\n)\nfrom plba.workers import WorkerSupervisor\n\n__all__ = [\n \"ApplicationModule\",\n \"ConfigFileLoader\",\n \"ConfigProvider\",\n \"ConfigurationManager\",\n \"ControlActionSet\",\n \"ControlChannel\",\n \"ControlPlaneService\",\n \"create_runtime\",\n \"FileConfigProvider\",\n \"HealthContributor\",\n \"HealthRegistry\",\n \"HttpControlChannel\",\n \"InMemoryTaskQueue\",\n \"LogManager\",\n \"MySqlTraceTransport\",\n \"NoOpTraceTransport\",\n \"RuntimeManager\",\n \"ServiceContainer\",\n \"TraceContext\",\n \"TraceContextRecord\",\n \"TraceLogMessage\",\n \"TraceService\",\n \"TraceTransport\",\n \"StepResult\",\n \"Worker\",\n \"WorkerHealth\",\n \"WorkerStatus\",\n \"WorkflowContext\",\n \"WorkflowDefinition\",\n \"WorkflowEngine\",\n \"WorkflowEngineHooks\",\n \"WorkflowNode\",\n \"WorkflowRuntimeFactory\",\n \"WorkflowStep\",\n \"WorkerSupervisor\",\n]", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/plba/__init__.py:1-69", - "span_start": 1, - "span_end": 69, - "lexical_rank": 6, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.plba.__init__", - "is_test": false, - "blob_sha": "24e755ec8c249d14fb0e675b5dbf2b71ab91afb9c849897eebfa9feb2499e19d", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/tracing.py", - "content": "from app_runtime.tracing.service import TraceService\nfrom app_runtime.tracing.transport import MySqlTraceTransport, NoOpTraceTransport\n\n__all__ = [\"MySqlTraceTransport\", \"NoOpTraceTransport\", \"TraceService\"]", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/plba/tracing.py:1-4", - "span_start": 1, - "span_end": 4, - "lexical_rank": 6, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.plba.tracing", - "is_test": false, - "blob_sha": "a27e11c716c93c3fcefe6f11b4cc420a6b743e7606606071d7f1aeeccc4e7d45", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/contracts/__init__.py", - "content": "__all__: list[str] = []", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/__init__.py:1-1", - "span_start": 1, - "span_end": 1, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.app_runtime.__init__", - "is_test": false, - "blob_sha": "8eea9df4f6d7b38ca0e39ccc27b04700e3d08dbeec8046d613d22706d19985fa", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/config/providers.py", - "content": "class FileConfigProvider(ConfigProvider):\n def __init__(self, path: str | Path) -> None:\n self._loader = ConfigFileLoader(path)\n\n @property\n def loader(self) -> ConfigFileLoader:\n return self._loader\n\n def load(self) -> dict[str, Any]:\n config = self._loader.load_sync()\n if not isinstance(config, dict):\n raise TypeError(\"Config root must be a mapping\")\n return dict(config)", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/config/providers.py:FileConfigProvider", - "span_start": 10, - "span_end": 22, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.config.providers", - "is_test": false, - "blob_sha": "8c53ca0122d6df6c5763bca15e99434bb4daebd5a618b8fc927e9ae90b022e64", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "TraceService\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests service\n- reads and writes state attributes\n- participates in dataflow slices (13)", - "layer": "C4_SEMANTIC_ROLES", - "title": "TraceService", - "span_start": 39, - "span_end": 166, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 60, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "c2b2b976d99f2c600000b753731b26e0a69adcb4359398b93073590c5d5d04f4", - "symbol_name": "TraceService", - "qname": "TraceService", - "role": "pipeline_stage", - "confidence": 0.57, - "dataflow_participation": 13, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_runner.py", - "content": "UvicornThreadRunner\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (24)", - "layer": "C4_SEMANTIC_ROLES", - "title": "UvicornThreadRunner", - "span_start": 10, - "span_end": 61, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 11, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "fd55630045a02100df8877ac27d951ee08617d4598764394d48cb51fe067476a", - "symbol_name": "UvicornThreadRunner", - "qname": "UvicornThreadRunner", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 24, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "3779fdd2878b770e789a35bb2a89c9d79f13b61c26d7db1b3b683f9bb9e1623f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/persistence/workflow_persistence.py", - "content": "WorkflowPersistence\nrole: pipeline_stage\n\nResponsibilities:\n- orchestrates role-like calls (2)\n- reads and writes state attributes\n- participates in dataflow slices (16)", - "layer": "C4_SEMANTIC_ROLES", - "title": "WorkflowPersistence", - "span_start": 8, - "span_end": 54, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 15, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "7bd01ee45cf31f2d5c2e3e51656254860ac785d10cef9e0852cd4fba90857bae", - "symbol_name": "WorkflowPersistence", - "qname": "WorkflowPersistence", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 16, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "80e9410ddc639789b4353c2a1a757ba8d0d5b5bb6075b0b263b61551f04ae1f0", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (10)", - "layer": "C4_SEMANTIC_ROLES", - "title": "HttpControlChannel", - "span_start": 12, - "span_end": 57, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 21, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "1c9fbdc24819e5604c26ea55428a74310f03a03e1af197ed84846af61e42fdb0", - "symbol_name": "HttpControlChannel", - "qname": "HttpControlChannel", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 10, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/queue/in_memory.py", - "content": "InMemoryTaskQueue\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (9)", - "layer": "C4_SEMANTIC_ROLES", - "title": "InMemoryTaskQueue", - "span_start": 9, - "span_end": 38, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 22, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "2da04cb94544a3bcbf0943a95ad4bdd8710bcafaa32a02fd0e4de2178dcf3533", - "symbol_name": "InMemoryTaskQueue", - "qname": "InMemoryTaskQueue", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 9, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "58f0cc001ccda0eee4c6bc32ed83bd05eafd6b6644f1e8b4aa9eed3103db73dc", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/config/file_loader.py", - "content": "ConfigFileLoader\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (8)", - "layer": "C4_SEMANTIC_ROLES", - "title": "ConfigFileLoader", - "span_start": 11, - "span_end": 48, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 23, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "a8474eca8b6e9dc86ae67ed68b16fa5fb639ef08739c053e7b7195489765667f", - "symbol_name": "ConfigFileLoader", - "qname": "ConfigFileLoader", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 8, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "1f19ffebde5e38e4be5a5d5a678059a0f36dedb8fb8b3e00ab395c67106a87ea", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/store.py", - "content": "TraceContextStore\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (6)", - "layer": "C4_SEMANTIC_ROLES", - "title": "TraceContextStore", - "span_start": 15, - "span_end": 52, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 25, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "b2dad4fbe16ffb11b58deba311c7739955c39d59f291b22181f33e9c8cce4059", - "symbol_name": "TraceContextStore", - "qname": "TraceContextStore", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 6, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "d369554f08fc92039c6edd5a2a1e73b23901533e8974459170bbd9347d263dc5", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workers/supervisor.py", - "content": "WorkerSupervisor\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (6)", - "layer": "C4_SEMANTIC_ROLES", - "title": "WorkerSupervisor", - "span_start": 10, - "span_end": 59, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 25, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "c17b44e8d9e97d490989b21fa67d7c346cdda8a0472e4c41fb243c8846faa124", - "symbol_name": "WorkerSupervisor", - "qname": "WorkerSupervisor", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 6, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "77609d9d5927171cce7fc3a54897c183fd63068710c6362029b700937aae5eee", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "TraceService.__init__\n -> TraceService.store\n -> TraceService.create_context", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "TraceService.__init__:dataflow_slice", - "span_start": 42, - "span_end": 61, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "3b052062067a78aef3302ee1d996897e02a67d1b340397bea4f59fe147c0492a", - "edge_type": "dataflow_slice", - "src_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "src_qname": "TraceService.__init__", - "dst_symbol_id": "ff44881104b65ef50ee6fe16d367d4a81b6e7eb5c44c0963cf4543faec785d4a", - "dst_ref": "TraceService.create_context", - "resolution": "resolved", - "slice_id": "3b052062067a78aef3302ee1d996897e02a67d1b340397bea4f59fe147c0492a", - "root_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "path_symbols": [ - "TraceService.__init__", - "TraceService.store", - "TraceService.create_context" - ], - "path_symbol_ids": [ - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "ff44881104b65ef50ee6fe16d367d4a81b6e7eb5c44c0963cf4543faec785d4a" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "TraceService.__init__\n -> TraceService.store\n -> TraceService.close_context", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "TraceService.__init__:dataflow_slice", - "span_start": 42, - "span_end": 84, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "7a9353ef57c9ae5d19b3a0c6ac50fad05e6d21d31bbe1cd1cd07af6332ba6505", - "edge_type": "dataflow_slice", - "src_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "src_qname": "TraceService.__init__", - "dst_symbol_id": "01e14158dcced7e52d0c8ac84ac7b9a75225c261b6aca6a1d7da802d0994721c", - "dst_ref": "TraceService.close_context", - "resolution": "resolved", - "slice_id": "7a9353ef57c9ae5d19b3a0c6ac50fad05e6d21d31bbe1cd1cd07af6332ba6505", - "root_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "path_symbols": [ - "TraceService.__init__", - "TraceService.store", - "TraceService.close_context" - ], - "path_symbol_ids": [ - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "01e14158dcced7e52d0c8ac84ac7b9a75225c261b6aca6a1d7da802d0994721c" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "TraceService.__init__\n -> TraceService.store\n -> TraceService.open_context", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "TraceService.__init__:dataflow_slice", - "span_start": 42, - "span_end": 78, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "a6e13b9ebc4fed84586afd53ed92a4d14757e440873f572b2337d5622ee96031", - "edge_type": "dataflow_slice", - "src_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "src_qname": "TraceService.__init__", - "dst_symbol_id": "2da3d5b20a947bf63e14c103be4689b72fd837e0a82abd6c497846375d4c7426", - "dst_ref": "TraceService.open_context", - "resolution": "resolved", - "slice_id": "a6e13b9ebc4fed84586afd53ed92a4d14757e440873f572b2337d5622ee96031", - "root_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "path_symbols": [ - "TraceService.__init__", - "TraceService.store", - "TraceService.open_context" - ], - "path_symbol_ids": [ - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "2da3d5b20a947bf63e14c103be4689b72fd837e0a82abd6c497846375d4c7426" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "TraceService.__init__\n -> TraceService.transport\n -> TraceService.__init__", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "TraceService.__init__:dataflow_slice", - "span_start": 41, - "span_end": 43, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "1e923a93faa05c3c43ca9b19bd047007a8589ccce57d3cc1798ae7f9f200af98", - "edge_type": "dataflow_slice", - "src_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "src_qname": "TraceService.__init__", - "dst_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "dst_ref": "TraceService.__init__", - "resolution": "resolved", - "slice_id": "1e923a93faa05c3c43ca9b19bd047007a8589ccce57d3cc1798ae7f9f200af98", - "root_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "path_symbols": [ - "TraceService.__init__", - "TraceService.transport", - "TraceService.__init__" - ], - "path_symbol_ids": [ - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "TraceService.__init__\n -> TraceService.store\n -> TraceService.current_trace_id", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "TraceService.__init__:dataflow_slice", - "span_start": 42, - "span_end": 81, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "3ea17138634b1190bded77ddb84aa1595124f6519b246f24fc4b02bd62b5cac1", - "edge_type": "dataflow_slice", - "src_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "src_qname": "TraceService.__init__", - "dst_symbol_id": "41135180f7b3b9ab20e097e0747474e219c37dd2366ef08a7b43c1f3edb10b4c", - "dst_ref": "TraceService.current_trace_id", - "resolution": "resolved", - "slice_id": "3ea17138634b1190bded77ddb84aa1595124f6519b246f24fc4b02bd62b5cac1", - "root_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "path_symbols": [ - "TraceService.__init__", - "TraceService.store", - "TraceService.current_trace_id" - ], - "path_symbol_ids": [ - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "41135180f7b3b9ab20e097e0747474e219c37dd2366ef08a7b43c1f3edb10b4c" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "TraceService.__init__\n -> TraceService.store\n -> TraceService.step", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "TraceService.__init__:dataflow_slice", - "span_start": 42, - "span_end": 88, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "9f34c5da9b09fba99df6f6b1bde183a9aeb45111b8218a747c71590c2c9f60f2", - "edge_type": "dataflow_slice", - "src_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "src_qname": "TraceService.__init__", - "dst_symbol_id": "c44bfbc66cf747283f30088da3e011a10395031d41e77b74e523c24997f641ca", - "dst_ref": "TraceService.step", - "resolution": "resolved", - "slice_id": "9f34c5da9b09fba99df6f6b1bde183a9aeb45111b8218a747c71590c2c9f60f2", - "root_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "path_symbols": [ - "TraceService.__init__", - "TraceService.store", - "TraceService.step" - ], - "path_symbol_ids": [ - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "c44bfbc66cf747283f30088da3e011a10395031d41e77b74e523c24997f641ca" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "validation": { - "passed": true, - "action": "return", - "reasons": [] - }, - "steps": [ - { - "step": "router", - "status": "completed", - "timings_ms": { - "router": 2 - }, - "output": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - } - }, - { - "step": "retrieval", - "status": "completed", - "timings_ms": { - "retrieval": 156 - }, - "output": { - "rag_count": 33, - "answer_path_rag_count": 33, - "resolved_symbol_status": "resolved", - "resolved_symbol": "TraceService", - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "diagnostics": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "vector", - "C0_SOURCE_CHUNKS": "vector", - "C4_SEMANTIC_ROLES": "vector", - "C2_DEPENDENCY_GRAPH": "vector", - "C3_ENTRYPOINTS": "vector" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 8, - "C4_SEMANTIC_ROLES": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C3_ENTRYPOINTS": 6 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [] - }, - "C4_SEMANTIC_ROLES": { - "path_scope": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [] - } - }, - "fallback": { - "used": false, - "reason": null - }, - "retrieval_by_layer_ms": { - "C1_SYMBOL_CATALOG": 50, - "C0_SOURCE_CHUNKS": 18, - "C4_SEMANTIC_ROLES": 18, - "C2_DEPENDENCY_GRAPH": 50, - "C3_ENTRYPOINTS": 17 - } - } - }, - { - "step": "pre_evidence_gate", - "status": "passed", - "timings_ms": { - "pre_evidence_gate": 1 - }, - "input": { - "resolved_target": "TraceService", - "sub_intent": "EXPLAIN", - "target_type": "symbol", - "evidence_count": 33, - "code_chunk_count": 33, - "entrypoint_count": 3, - "relation_count": 6, - "test_evidence_count": 0, - "symbol_resolution_status": "resolved", - "path_scope": [] - }, - "output": { - "passed": true, - "failure_reasons": [], - "degraded_message": "", - "evidence_count": 33 - } - }, - { - "step": "llm", - "status": "completed", - "timings_ms": { - "llm": 5609 - }, - "output": { - "prompt_name": "code_qa_explain_answer", - "answer_preview": "Класс `TraceService` находится в файле `src/app_runtime/tracing/service.py`. Он наследуется от `TraceContextFactory`.\n\nОсновные компоненты:\n\n- **Конструктор (`__init__`)**: принимает параметры `transport` и `store`, инициализирует транспорт для трассировки и хранилище контекста трассировки. Если тра", - "resolved_target": "TraceService", - "answer_policy_branch": "normal_answer", - "decision_reason": "evidence_sufficient" - } - }, - { - "step": "post_evidence_gate", - "status": "passed", - "timings_ms": { - "post_evidence_gate": 1, - "post_evidence_gate_recheck": 0, - "repair": 0 - }, - "input": { - "answer_mode": "normal", - "degraded_message": "", - "resolved_target": "TraceService", - "draft_answer_preview": "Класс `TraceService` находится в файле `src/app_runtime/tracing/service.py`. Он наследуется от `TraceContextFactory`.\n\nОсновные компоненты:\n\n- **Конструктор (`__init__`)**: принимает параметры `transport` и `store`, инициализирует транспорт для трассировки и хранилище контекста трассировки. Если тра", - "repair_candidate": true - }, - "output": { - "passed": true, - "action": "return", - "reasons": [], - "repair_used": false, - "final_answer_preview": "Класс `TraceService` находится в файле `src/app_runtime/tracing/service.py`. Он наследуется от `TraceContextFactory`.\n\nОсновные компоненты:\n\n- **Конструктор (`__init__`)**: принимает параметры `transport` и `store`, инициализирует транспорт для трассировки и хранилище контекста трассировки. Если тра" - } - } - ] - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/plba_full_chain_subintents_v3/20260312_174008/full_chain_plba_code_subintents_v2_plba-v2-explain-trace-service.md b/tests/pipeline_setup_v3/test_results/plba_full_chain_subintents_v3/20260312_174008/full_chain_plba_code_subintents_v2_plba-v2-explain-trace-service.md deleted file mode 100644 index baf3eb0..0000000 --- a/tests/pipeline_setup_v3/test_results/plba_full_chain_subintents_v3/20260312_174008/full_chain_plba_code_subintents_v2_plba-v2-explain-trace-service.md +++ /dev/null @@ -1,305 +0,0 @@ -# plba-v2-explain-trace-service - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_02_pipeline/full_chain_plba_code_subintents_v2.yaml -- runner: agent_runtime -- mode: full_chain -- passed: True - -## Query -Объясни как работает класс TraceService - -## Actual -{ - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 33, - "llm_answer": "Класс `TraceService` находится в файле `src/app_runtime/tracing/service.py`. Он наследуется от `TraceContextFactory`.\n\nОсновные компоненты:\n\n- **Конструктор (`__init__`)**: принимает параметры `transport` и `store`, инициализирует транспорт для трассировки и хранилище контекста трассировки. Если транспорт или хранилище не указаны, используются реализации по умолчанию: `NoOpTraceTransport()` и `TraceContextStore()`.\n \n- **Метод `create_context`**: создаёт новый контекст трассировки, принимая параметры `alias`, `parent_id`, `kind` и `attrs`. В нём создаётся запись контекста трассировки с уникальным идентификатором, текущим временем и переданными параметрами, затем эта запись сохраняется в хранилище.\n\nТакже определены методы `open_context`, `close_context`, `current_trace_id`, но их реализация не приведена в контексте.\n\nОсторожный вывод: `TraceService` используется для управления контекстами трассировки приложения, позволяя создавать, открывать и управлять записями трассировок. Он играет ключевую роль в инфраструктуре отслеживания и логирования внутри приложения. \n\nФакты основаны на видимом фрагменте кода.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "TraceService" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] -} - -## Steps -[ - { - "step": "router", - "status": "completed", - "timings_ms": { - "router": 2 - }, - "output": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - } - }, - { - "step": "retrieval", - "status": "completed", - "timings_ms": { - "retrieval": 156 - }, - "output": { - "rag_count": 33, - "answer_path_rag_count": 33, - "resolved_symbol_status": "resolved", - "resolved_symbol": "TraceService", - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "diagnostics": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "vector", - "C0_SOURCE_CHUNKS": "vector", - "C4_SEMANTIC_ROLES": "vector", - "C2_DEPENDENCY_GRAPH": "vector", - "C3_ENTRYPOINTS": "vector" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 8, - "C4_SEMANTIC_ROLES": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C3_ENTRYPOINTS": 6 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [] - }, - "C4_SEMANTIC_ROLES": { - "path_scope": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [] - } - }, - "fallback": { - "used": false, - "reason": null - }, - "retrieval_by_layer_ms": { - "C1_SYMBOL_CATALOG": 50, - "C0_SOURCE_CHUNKS": 18, - "C4_SEMANTIC_ROLES": 18, - "C2_DEPENDENCY_GRAPH": 50, - "C3_ENTRYPOINTS": 17 - } - } - }, - { - "step": "pre_evidence_gate", - "status": "passed", - "timings_ms": { - "pre_evidence_gate": 1 - }, - "input": { - "resolved_target": "TraceService", - "sub_intent": "EXPLAIN", - "target_type": "symbol", - "evidence_count": 33, - "code_chunk_count": 33, - "entrypoint_count": 3, - "relation_count": 6, - "test_evidence_count": 0, - "symbol_resolution_status": "resolved", - "path_scope": [] - }, - "output": { - "passed": true, - "failure_reasons": [], - "degraded_message": "", - "evidence_count": 33 - } - }, - { - "step": "llm", - "status": "completed", - "timings_ms": { - "llm": 5609 - }, - "output": { - "prompt_name": "code_qa_explain_answer", - "answer_preview": "Класс `TraceService` находится в файле `src/app_runtime/tracing/service.py`. Он наследуется от `TraceContextFactory`.\n\nОсновные компоненты:\n\n- **Конструктор (`__init__`)**: принимает параметры `transport` и `store`, инициализирует транспорт для трассировки и хранилище контекста трассировки. Если тра", - "resolved_target": "TraceService", - "answer_policy_branch": "normal_answer", - "decision_reason": "evidence_sufficient" - } - }, - { - "step": "post_evidence_gate", - "status": "passed", - "timings_ms": { - "post_evidence_gate": 1, - "post_evidence_gate_recheck": 0, - "repair": 0 - }, - "input": { - "answer_mode": "normal", - "degraded_message": "", - "resolved_target": "TraceService", - "draft_answer_preview": "Класс `TraceService` находится в файле `src/app_runtime/tracing/service.py`. Он наследуется от `TraceContextFactory`.\n\nОсновные компоненты:\n\n- **Конструктор (`__init__`)**: принимает параметры `transport` и `store`, инициализирует транспорт для трассировки и хранилище контекста трассировки. Если тра", - "repair_candidate": true - }, - "output": { - "passed": true, - "action": "return", - "reasons": [], - "repair_used": false, - "final_answer_preview": "Класс `TraceService` находится в файле `src/app_runtime/tracing/service.py`. Он наследуется от `TraceContextFactory`.\n\nОсновные компоненты:\n\n- **Конструктор (`__init__`)**: принимает параметры `transport` и `store`, инициализирует транспорт для трассировки и хранилище контекста трассировки. Если тра" - } - } -] - -## Diagnostics -{ - "intent_correct": null, - "target_found": true, - "layers_used": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_sufficient": true, - "answer_mode": "normal", - "resolved_target": "TraceService", - "answer_policy_branch": "normal_answer", - "decision_reason": "evidence_sufficient", - "router_result": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "retrieval_profile": "code", - "sub_intent": "EXPLAIN", - "path_scope": [], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "symbol_resolution_status": "resolved" - }, - "retrieval_request": { - "rag_session_id": "7d11da21-faa0-4cea-aede-aeabe069164c", - "query": "Объясни как работает класс TraceService", - "sub_intent": "EXPLAIN", - "path_scope": [], - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "per_layer_outcome": [ - { - "layer_id": "C1_SYMBOL_CATALOG", - "hit_count": 8, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C0_SOURCE_CHUNKS", - "hit_count": 8, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C4_SEMANTIC_ROLES", - "hit_count": 8, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C2_DEPENDENCY_GRAPH", - "hit_count": 6, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C3_ENTRYPOINTS", - "hit_count": 3, - "empty": false, - "fallback_used": false - } - ], - "empty_layers": [], - "evidence_gate_decision": { - "sufficient": true, - "failure_reasons": [], - "evidence_count": 33 - }, - "evidence_gate_input": { - "resolved_target": "TraceService", - "sub_intent": "EXPLAIN", - "target_type": "symbol", - "evidence_count": 33, - "code_chunk_count": 33, - "entrypoint_count": 3, - "relation_count": 6, - "test_evidence_count": 0, - "symbol_resolution_status": "resolved", - "path_scope": [] - }, - "post_evidence_gate": { - "input": { - "answer_mode": "normal", - "degraded_message": "", - "resolved_target": "TraceService", - "draft_answer_preview": "Класс `TraceService` находится в файле `src/app_runtime/tracing/service.py`. Он наследуется от `TraceContextFactory`.\n\nОсновные компоненты:\n\n- **Конструктор (`__init__`)**: принимает параметры `transport` и `store`, инициализирует транспорт для трассировки и хранилище контекста трассировки. Если тра", - "repair_candidate": true - }, - "output": { - "passed": true, - "action": "return", - "reasons": [], - "repair_used": false, - "final_answer_preview": "Класс `TraceService` находится в файле `src/app_runtime/tracing/service.py`. Он наследуется от `TraceContextFactory`.\n\nОсновные компоненты:\n\n- **Конструктор (`__init__`)**: принимает параметры `transport` и `store`, инициализирует транспорт для трассировки и хранилище контекста трассировки. Если тра" - } - }, - "failure_reasons": [], - "timings_ms": { - "router": 2, - "retrieval": 156, - "pre_evidence_gate": 1, - "llm": 5609, - "post_evidence_gate": 1 - } -} - -## Mismatches -- none \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/plba_full_chain_subintents_v3/20260312_174008/full_chain_plba_code_subintents_v2_plba-v2-find-entrypoints-control-plane.json b/tests/pipeline_setup_v3/test_results/plba_full_chain_subintents_v3/20260312_174008/full_chain_plba_code_subintents_v2_plba-v2-find-entrypoints-control-plane.json deleted file mode 100644 index 03ca84f..0000000 --- a/tests/pipeline_setup_v3/test_results/plba_full_chain_subintents_v3/20260312_174008/full_chain_plba_code_subintents_v2_plba-v2-find-entrypoints-control-plane.json +++ /dev/null @@ -1,1499 +0,0 @@ -{ - "case_id": "plba-v2-find-entrypoints-control-plane", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_02_pipeline/full_chain_plba_code_subintents_v2.yaml", - "runner": "agent_runtime", - "mode": "full_chain", - "query": "Найди точки входа HTTP control plane", - "actual": { - "intent": "CODE_QA", - "sub_intent": "FIND_ENTRYPOINTS", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 9, - "llm_answer": "Подтверждённые HTTP routes:\n\n- GET /health, объявлен в src/app_runtime/control/http_app.py, строки 31-34, обработчик health\n- GET /actions/{action}, объявлен в src/app_runtime/control/http_app.py, строки 38-42, обработчик action\n- POST /actions/{action}, объявлен в src/app_runtime/control/http_app.py, строки 38-42, обработчик action\n\nКандидаты на входы не требуются, так как все маршруты уже подтверждены.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "HTTP", - "control", - "plane" - ], - "layers": [ - "C3_ENTRYPOINTS", - "C0_SOURCE_CHUNKS" - ] - }, - "passed": true, - "mismatches": [], - "details": { - "query": "Найди точки входа HTTP control plane", - "router_result": { - "schema_version": "1.1", - "intent": "CODE_QA", - "retrieval_profile": "code", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query_plan": { - "raw": "Найди точки входа HTTP control plane", - "normalized": "Найди точки входа HTTP control plane", - "sub_intent": "FIND_ENTRYPOINTS", - "negations": [], - "expansions": [ - "HTTP", - "control", - "plane" - ], - "keyword_hints": [ - "HTTP", - "control", - "plane" - ], - "path_hints": [], - "doc_scope_hints": [], - "symbol_candidates": [ - "HTTP", - "control", - "plane" - ], - "symbol_kind_hint": "class", - "anchors": [ - { - "type": "SYMBOL", - "value": "HTTP", - "source": "user_text", - "subtype": null, - "span": { - "start": 18, - "end": 22 - }, - "confidence": 0.88 - }, - { - "type": "SYMBOL", - "value": "control", - "source": "user_text", - "subtype": null, - "span": { - "start": 23, - "end": 30 - }, - "confidence": 0.88 - }, - { - "type": "SYMBOL", - "value": "plane", - "source": "user_text", - "subtype": null, - "span": { - "start": 31, - "end": 36 - }, - "confidence": 0.88 - } - ] - }, - "retrieval_spec": { - "domains": [ - "CODE" - ], - "layer_queries": [ - { - "layer_id": "C3_ENTRYPOINTS", - "top_k": 12 - }, - { - "layer_id": "C0_SOURCE_CHUNKS", - "top_k": 6 - } - ], - "filters": { - "test_policy": "EXCLUDE", - "path_scope": [], - "language": [ - "python" - ] - }, - "rerank_profile": "code" - }, - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - }, - "symbol_resolution": { - "status": "not_found", - "resolved_symbol": null, - "alternatives": [], - "confidence": 0.0 - }, - "evidence_policy": { - "require_def": true, - "require_flow": true, - "require_spec": false, - "allow_answer_without_evidence": false - } - }, - "retrieval_request": { - "rag_session_id": "7d11da21-faa0-4cea-aede-aeabe069164c", - "query": "Найди точки входа HTTP control plane", - "sub_intent": "FIND_ENTRYPOINTS", - "path_scope": [], - "keyword_hints": [ - "HTTP", - "control", - "plane" - ], - "symbol_candidates": [ - "HTTP", - "control", - "plane" - ], - "requested_layers": [ - "C3_ENTRYPOINTS", - "C0_SOURCE_CHUNKS" - ], - "retrieval_spec": { - "domains": [ - "CODE" - ], - "layer_queries": [ - { - "layer_id": "C3_ENTRYPOINTS", - "top_k": 12 - }, - { - "layer_id": "C0_SOURCE_CHUNKS", - "top_k": 6 - } - ], - "filters": { - "test_policy": "EXCLUDE", - "path_scope": [], - "language": [ - "python" - ] - }, - "rerank_profile": "code" - }, - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - }, - "query_plan": { - "raw": "Найди точки входа HTTP control plane", - "normalized": "Найди точки входа HTTP control plane", - "sub_intent": "FIND_ENTRYPOINTS", - "negations": [], - "expansions": [ - "HTTP", - "control", - "plane" - ], - "keyword_hints": [ - "HTTP", - "control", - "plane" - ], - "path_hints": [], - "doc_scope_hints": [], - "symbol_candidates": [ - "HTTP", - "control", - "plane" - ], - "symbol_kind_hint": "class", - "anchors": [ - { - "type": "SYMBOL", - "value": "HTTP", - "source": "user_text", - "subtype": null, - "span": { - "start": 18, - "end": 22 - }, - "confidence": 0.88 - }, - { - "type": "SYMBOL", - "value": "control", - "source": "user_text", - "subtype": null, - "span": { - "start": 23, - "end": 30 - }, - "confidence": 0.88 - }, - { - "type": "SYMBOL", - "value": "plane", - "source": "user_text", - "subtype": null, - "span": { - "start": 31, - "end": 36 - }, - "confidence": 0.88 - } - ] - } - }, - "retrieval_result": { - "target_symbol_candidates": [], - "resolved_symbol": null, - "symbol_resolution_status": "not_found", - "file_candidates": [ - "src/app_runtime/control/http_app.py", - "src/app_runtime/control/http_channel.py", - "src/app_runtime/control/base.py", - "src/app_runtime/control/__init__.py", - "src/app_runtime/control/http_runner.py" - ], - "code_chunks": [ - { - "layer": "C3_ENTRYPOINTS", - "path": "src/app_runtime/control/http_app.py", - "title": "app.post", - "content": "fastapi http app.post", - "start_line": 38, - "end_line": 42, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C3_ENTRYPOINTS", - "path": "src/app_runtime/control/http_app.py", - "title": "app.get", - "content": "fastapi http app.get", - "start_line": 31, - "end_line": 34, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C3_ENTRYPOINTS", - "path": "src/app_runtime/control/http_app.py", - "title": "app.get", - "content": "fastapi http app.get", - "start_line": 38, - "end_line": 42, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C0_SOURCE_CHUNKS", - "path": "src/app_runtime/control/http_channel.py", - "title": "src/app_runtime/control/http_channel.py:HttpControlChannel", - "content": "class HttpControlChannel(ControlChannel):\n def __init__(self, host: str, port: int, timeout: int) -> None:\n self._timeout = timeout\n self._runner = UvicornThreadRunner(host, port, timeout)\n self._factory = HttpControlAppFactory()\n self._actions: ControlActionSet | None = None\n\n async def start(self, actions: ControlActionSet) -> None:\n self._actions = actions\n app = self._factory.create(self._health_response, self._action_response)\n await self._runner.start(app)\n\n async def stop(self) -> None:\n await self._runner.stop()\n\n @property\n def port(self) -> int:\n return self._runner.port\n\n async def _health_response(self) -> dict[str, object]:\n if self._actions is None:\n return {\"status\": \"unhealthy\", \"detail\": \"control actions are not configured\"}\n return await asyncio.wait_for(self._actions.health(), timeout=float(self._timeout))\n\n async def _action_response(self, action: str, _client_source: str = \"unknown\") -> JSONResponse:\n if self._actions is None:\n return JSONResponse(content={\"status\": \"error\", \"detail\": f\"{action} handler is not configured\"}, status_code=404)\n callbacks = {\n \"start\": self._actions.start,\n \"stop\": self._actions.stop,\n \"status\": self._actions.status,\n }\n callback = callbacks.get(action)\n if callback is None:\n return JSONResponse(content={\"status\": \"error\", \"detail\": f\"unsupported action: {action}\"}, status_code=404)\n action_timeout = max(float(self._timeout), 10.0) if action in {\"start\", \"stop\"} else float(self._timeout)\n try:\n detail = await asyncio.wait_for(callback(), timeout=action_timeout)\n except asyncio.TimeoutError:\n return JSONResponse(\n content={\"status\": \"accepted\", \"detail\": f\"{action} operation is still in progress\"},\n status_code=202,\n )\n except Exception as exc:\n return JSONResponse(content={\"status\": \"error\", \"detail\": str(exc)}, status_code=500)\n return JSONResponse(content={\"status\": \"ok\", \"detail\": detail or f\"{action} action accepted\"}, status_code=200)", - "start_line": 12, - "end_line": 57, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.http_channel", - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C0_SOURCE_CHUNKS", - "path": "src/app_runtime/control/http_app.py", - "title": "src/app_runtime/control/http_app.py:HttpControlAppFactory", - "content": "class HttpControlAppFactory:\n def create(\n self,\n health_provider: Callable[[], Awaitable[HealthPayload]],\n action_provider: Callable[[str, str], Awaitable[JSONResponse]],\n ) -> FastAPI:\n app = FastAPI(title=\"PLBA Control API\")\n\n @app.middleware(\"http\")\n async def log_api_call(request: Request, call_next): # type: ignore[no-untyped-def]\n started = time.monotonic()\n response = await call_next(request)\n response.headers[\"X-Response-Time-Ms\"] = str(int((time.monotonic() - started) * 1000))\n return response\n\n @app.get(\"/health\")\n async def health() -> JSONResponse:\n payload = await health_provider()\n status_code = 200 if payload.get(\"status\") == \"ok\" else 503\n return JSONResponse(content=payload, status_code=status_code)\n\n @app.get(\"/actions/{action}\")\n @app.post(\"/actions/{action}\")\n async def action(action: str, request: Request) -> JSONResponse:\n client_source = self._client_source(request)\n if action in {\"start\", \"stop\"}:\n LOGGER.warning(\"Control action requested: /actions/%s client=%s\", action, client_source)\n return await action_provider(action, client_source)\n\n return app\n\n def _client_source(self, request: Request) -> str:\n explicit_header = request.headers.get(\"X-Client-Source\", \"\").strip()\n if explicit_header:\n return explicit_header\n user_agent = request.headers.get(\"User-Agent\", \"\").strip()\n if user_agent:\n return f\"user-agent:{user_agent}\"\n return \"unknown\"", - "start_line": 15, - "end_line": 53, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.http_app", - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C0_SOURCE_CHUNKS", - "path": "src/app_runtime/control/base.py", - "title": "src/app_runtime/control/base.py:ControlActionSet", - "content": "class ControlActionSet:\n health: HealthHandler\n start: ActionHandler\n stop: ActionHandler\n status: ActionHandler", - "start_line": 14, - "end_line": 18, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.base", - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C0_SOURCE_CHUNKS", - "path": "src/app_runtime/control/__init__.py", - "title": "src/app_runtime/control/__init__.py:1-5", - "content": "from app_runtime.control.base import ControlActionSet, ControlChannel\nfrom app_runtime.control.http_channel import HttpControlChannel\nfrom app_runtime.control.service import ControlPlaneService\n\n__all__ = [\"ControlActionSet\", \"ControlChannel\", \"ControlPlaneService\", \"HttpControlChannel\"]", - "start_line": 1, - "end_line": 5, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.app_runtime.control.__init__", - "is_test": false, - "blob_sha": "bf3c37e3369a84cc618adc0fd71c232e5eb4b871eaff743069a17e661e498316", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C0_SOURCE_CHUNKS", - "path": "src/app_runtime/control/base.py", - "title": "src/app_runtime/control/base.py:ControlChannel", - "content": "class ControlChannel(ABC):\n @abstractmethod\n async def start(self, actions: ControlActionSet) -> None:\n \"\"\"Start the control channel and bind handlers.\"\"\"\n\n @abstractmethod\n async def stop(self) -> None:\n \"\"\"Stop the control channel and release resources.\"\"\"", - "start_line": 21, - "end_line": 28, - "metadata": { - "chunk_index": 1, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.base", - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C0_SOURCE_CHUNKS", - "path": "src/app_runtime/control/http_runner.py", - "title": "src/app_runtime/control/http_runner.py:UvicornThreadRunner", - "content": "class UvicornThreadRunner:\n def __init__(self, host: str, port: int, timeout: int) -> None:\n self._host = host\n self._port = port\n self._timeout = timeout\n self._server: Server | None = None\n self._thread: Thread | None = None\n self._error: BaseException | None = None\n\n async def start(self, app: FastAPI) -> None:\n if self._thread is not None and self._thread.is_alive():\n return\n self._error = None\n config = Config(app=app, host=self._host, port=self._port, log_level=\"warning\")\n self._server = Server(config)\n self._thread = Thread(target=self._serve, name=\"plba-http-control\", daemon=True)\n self._thread.start()\n await self._wait_until_started()\n\n async def stop(self) -> None:\n if self._server is None or self._thread is None:\n return\n self._server.should_exit = True\n await asyncio.to_thread(self._thread.join, self._timeout)\n self._server = None\n self._thread = None\n\n @property\n def port(self) -> int:\n if self._server is None or not getattr(self._server, \"servers\", None):\n return self._port\n socket = self._server.servers[0].sockets[0]\n return int(socket.getsockname()[1])\n\n async def _wait_until_started(self) -> None:\n if self._server is None:\n raise RuntimeError(\"Server is not initialized\")\n deadline = asyncio.get_running_loop().time() + max(float(self._timeout), 1.0)\n while not self._server.started:\n if self._error is not None:\n raise RuntimeError(\"HTTP control server failed to start\") from self._error\n if asyncio.get_running_loop().time() >= deadline:\n raise TimeoutError(\"HTTP control server startup timed out\")\n await asyncio.sleep(0.05)\n\n def _serve(self) -> None:\n if self._server is None:\n return\n try:\n asyncio.run(self._server.serve())\n except BaseException as exc: # noqa: BLE001\n self._error = exc", - "start_line": 10, - "end_line": 61, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.http_runner", - "is_test": false, - "blob_sha": "3779fdd2878b770e789a35bb2a89c9d79f13b61c26d7db1b3b683f9bb9e1623f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "relations": [], - "entrypoints": [ - { - "path": "src/app_runtime/control/http_app.py", - "title": "app.get", - "start_line": 31, - "end_line": 34, - "http_method": "GET", - "route_path": "/health", - "handler_symbol": "health", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "route_or_command": "app.get", - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "title": "app.get", - "start_line": 38, - "end_line": 42, - "http_method": "GET", - "route_path": "/actions/{action}", - "handler_symbol": "action", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "route_or_command": "app.get", - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "title": "app.post", - "start_line": 38, - "end_line": 42, - "http_method": "POST", - "route_path": "/actions/{action}", - "handler_symbol": "action", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "route_or_command": "app.post", - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "test_candidates": [], - "layer_outcomes": [ - { - "layer_id": "C3_ENTRYPOINTS", - "hit_count": 3, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C0_SOURCE_CHUNKS", - "hit_count": 6, - "empty": false, - "fallback_used": false - } - ], - "missing_layers": [], - "raw_rows": [ - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": null, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": null, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": null, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "class HttpControlChannel(ControlChannel):\n def __init__(self, host: str, port: int, timeout: int) -> None:\n self._timeout = timeout\n self._runner = UvicornThreadRunner(host, port, timeout)\n self._factory = HttpControlAppFactory()\n self._actions: ControlActionSet | None = None\n\n async def start(self, actions: ControlActionSet) -> None:\n self._actions = actions\n app = self._factory.create(self._health_response, self._action_response)\n await self._runner.start(app)\n\n async def stop(self) -> None:\n await self._runner.stop()\n\n @property\n def port(self) -> int:\n return self._runner.port\n\n async def _health_response(self) -> dict[str, object]:\n if self._actions is None:\n return {\"status\": \"unhealthy\", \"detail\": \"control actions are not configured\"}\n return await asyncio.wait_for(self._actions.health(), timeout=float(self._timeout))\n\n async def _action_response(self, action: str, _client_source: str = \"unknown\") -> JSONResponse:\n if self._actions is None:\n return JSONResponse(content={\"status\": \"error\", \"detail\": f\"{action} handler is not configured\"}, status_code=404)\n callbacks = {\n \"start\": self._actions.start,\n \"stop\": self._actions.stop,\n \"status\": self._actions.status,\n }\n callback = callbacks.get(action)\n if callback is None:\n return JSONResponse(content={\"status\": \"error\", \"detail\": f\"unsupported action: {action}\"}, status_code=404)\n action_timeout = max(float(self._timeout), 10.0) if action in {\"start\", \"stop\"} else float(self._timeout)\n try:\n detail = await asyncio.wait_for(callback(), timeout=action_timeout)\n except asyncio.TimeoutError:\n return JSONResponse(\n content={\"status\": \"accepted\", \"detail\": f\"{action} operation is still in progress\"},\n status_code=202,\n )\n except Exception as exc:\n return JSONResponse(content={\"status\": \"error\", \"detail\": str(exc)}, status_code=500)\n return JSONResponse(content={\"status\": \"ok\", \"detail\": detail or f\"{action} action accepted\"}, status_code=200)", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/http_channel.py:HttpControlChannel", - "span_start": 12, - "span_end": 57, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": null, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.http_channel", - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "class HttpControlAppFactory:\n def create(\n self,\n health_provider: Callable[[], Awaitable[HealthPayload]],\n action_provider: Callable[[str, str], Awaitable[JSONResponse]],\n ) -> FastAPI:\n app = FastAPI(title=\"PLBA Control API\")\n\n @app.middleware(\"http\")\n async def log_api_call(request: Request, call_next): # type: ignore[no-untyped-def]\n started = time.monotonic()\n response = await call_next(request)\n response.headers[\"X-Response-Time-Ms\"] = str(int((time.monotonic() - started) * 1000))\n return response\n\n @app.get(\"/health\")\n async def health() -> JSONResponse:\n payload = await health_provider()\n status_code = 200 if payload.get(\"status\") == \"ok\" else 503\n return JSONResponse(content=payload, status_code=status_code)\n\n @app.get(\"/actions/{action}\")\n @app.post(\"/actions/{action}\")\n async def action(action: str, request: Request) -> JSONResponse:\n client_source = self._client_source(request)\n if action in {\"start\", \"stop\"}:\n LOGGER.warning(\"Control action requested: /actions/%s client=%s\", action, client_source)\n return await action_provider(action, client_source)\n\n return app\n\n def _client_source(self, request: Request) -> str:\n explicit_header = request.headers.get(\"X-Client-Source\", \"\").strip()\n if explicit_header:\n return explicit_header\n user_agent = request.headers.get(\"User-Agent\", \"\").strip()\n if user_agent:\n return f\"user-agent:{user_agent}\"\n return \"unknown\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/http_app.py:HttpControlAppFactory", - "span_start": 15, - "span_end": 53, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": null, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.http_app", - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "class ControlActionSet:\n health: HealthHandler\n start: ActionHandler\n stop: ActionHandler\n status: ActionHandler", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/base.py:ControlActionSet", - "span_start": 14, - "span_end": 18, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": null, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.base", - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/__init__.py", - "content": "from app_runtime.control.base import ControlActionSet, ControlChannel\nfrom app_runtime.control.http_channel import HttpControlChannel\nfrom app_runtime.control.service import ControlPlaneService\n\n__all__ = [\"ControlActionSet\", \"ControlChannel\", \"ControlPlaneService\", \"HttpControlChannel\"]", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/__init__.py:1-5", - "span_start": 1, - "span_end": 5, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": null, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.app_runtime.control.__init__", - "is_test": false, - "blob_sha": "bf3c37e3369a84cc618adc0fd71c232e5eb4b871eaff743069a17e661e498316", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "class ControlChannel(ABC):\n @abstractmethod\n async def start(self, actions: ControlActionSet) -> None:\n \"\"\"Start the control channel and bind handlers.\"\"\"\n\n @abstractmethod\n async def stop(self) -> None:\n \"\"\"Stop the control channel and release resources.\"\"\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/base.py:ControlChannel", - "span_start": 21, - "span_end": 28, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": null, - "metadata": { - "chunk_index": 1, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.base", - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_runner.py", - "content": "class UvicornThreadRunner:\n def __init__(self, host: str, port: int, timeout: int) -> None:\n self._host = host\n self._port = port\n self._timeout = timeout\n self._server: Server | None = None\n self._thread: Thread | None = None\n self._error: BaseException | None = None\n\n async def start(self, app: FastAPI) -> None:\n if self._thread is not None and self._thread.is_alive():\n return\n self._error = None\n config = Config(app=app, host=self._host, port=self._port, log_level=\"warning\")\n self._server = Server(config)\n self._thread = Thread(target=self._serve, name=\"plba-http-control\", daemon=True)\n self._thread.start()\n await self._wait_until_started()\n\n async def stop(self) -> None:\n if self._server is None or self._thread is None:\n return\n self._server.should_exit = True\n await asyncio.to_thread(self._thread.join, self._timeout)\n self._server = None\n self._thread = None\n\n @property\n def port(self) -> int:\n if self._server is None or not getattr(self._server, \"servers\", None):\n return self._port\n socket = self._server.servers[0].sockets[0]\n return int(socket.getsockname()[1])\n\n async def _wait_until_started(self) -> None:\n if self._server is None:\n raise RuntimeError(\"Server is not initialized\")\n deadline = asyncio.get_running_loop().time() + max(float(self._timeout), 1.0)\n while not self._server.started:\n if self._error is not None:\n raise RuntimeError(\"HTTP control server failed to start\") from self._error\n if asyncio.get_running_loop().time() >= deadline:\n raise TimeoutError(\"HTTP control server startup timed out\")\n await asyncio.sleep(0.05)\n\n def _serve(self) -> None:\n if self._server is None:\n return\n try:\n asyncio.run(self._server.serve())\n except BaseException as exc: # noqa: BLE001\n self._error = exc", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/http_runner.py:UvicornThreadRunner", - "span_start": 10, - "span_end": 61, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": null, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.http_runner", - "is_test": false, - "blob_sha": "3779fdd2878b770e789a35bb2a89c9d79f13b61c26d7db1b3b683f9bb9e1623f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "retrieval_report": { - "executed_layers": [ - "C3_ENTRYPOINTS", - "C0_SOURCE_CHUNKS" - ], - "retrieval_mode_by_layer": { - "C3_ENTRYPOINTS": "vector", - "C0_SOURCE_CHUNKS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C3_ENTRYPOINTS": 12, - "C0_SOURCE_CHUNKS": 24 - }, - "filters_by_layer": { - "C3_ENTRYPOINTS": { - "path_scope": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src/app_runtime/control/http_app.py" - ] - } - }, - "fallback": { - "used": false, - "reason": null - }, - "retrieval_by_layer_ms": { - "C3_ENTRYPOINTS": 16, - "C0_SOURCE_CHUNKS": 12 - }, - "supplemental_requests": [ - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Найди точки входа HTTP control plane", - "ranking_profile": "entrypoint_source_hydration" - } - ] - } - }, - "diagnostics": { - "intent_correct": null, - "target_found": true, - "layers_used": [ - "C3_ENTRYPOINTS", - "C0_SOURCE_CHUNKS" - ], - "retrieval_sufficient": true, - "answer_mode": "normal", - "resolved_target": "src/app_runtime/control/http_app.py", - "answer_policy_branch": "normal_answer", - "decision_reason": "evidence_sufficient", - "router_result": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "retrieval_profile": "code", - "sub_intent": "FIND_ENTRYPOINTS", - "path_scope": [], - "layers": [ - "C3_ENTRYPOINTS", - "C0_SOURCE_CHUNKS" - ], - "symbol_resolution_status": "not_found" - }, - "retrieval_request": { - "rag_session_id": "7d11da21-faa0-4cea-aede-aeabe069164c", - "query": "Найди точки входа HTTP control plane", - "sub_intent": "FIND_ENTRYPOINTS", - "path_scope": [], - "requested_layers": [ - "C3_ENTRYPOINTS", - "C0_SOURCE_CHUNKS" - ] - }, - "per_layer_outcome": [ - { - "layer_id": "C3_ENTRYPOINTS", - "hit_count": 3, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C0_SOURCE_CHUNKS", - "hit_count": 6, - "empty": false, - "fallback_used": false - } - ], - "empty_layers": [], - "evidence_gate_decision": { - "sufficient": true, - "failure_reasons": [], - "evidence_count": 9 - }, - "evidence_gate_input": { - "resolved_target": "src/app_runtime/control/http_app.py", - "sub_intent": "FIND_ENTRYPOINTS", - "target_type": "file", - "evidence_count": 9, - "code_chunk_count": 9, - "entrypoint_count": 3, - "relation_count": 0, - "test_evidence_count": 0, - "symbol_resolution_status": "not_found", - "path_scope": [] - }, - "post_evidence_gate": { - "input": { - "answer_mode": "normal", - "degraded_message": "", - "resolved_target": "src/app_runtime/control/http_app.py", - "draft_answer_preview": "Подтверждённые HTTP routes:\n\n- GET /health, объявлен в src/app_runtime/control/http_app.py, строки 31-34, обработчик health\n- GET /actions/{action}, объявлен в src/app_runtime/control/http_app.py, строки 38-42, обработчик action\n- POST /actions/{action}, объявлен в src/app_runtime/control/http_app.p", - "repair_candidate": true - }, - "output": { - "passed": true, - "action": "return", - "reasons": [], - "repair_used": false, - "final_answer_preview": "Подтверждённые HTTP routes:\n\n- GET /health, объявлен в src/app_runtime/control/http_app.py, строки 31-34, обработчик health\n- GET /actions/{action}, объявлен в src/app_runtime/control/http_app.py, строки 38-42, обработчик action\n- POST /actions/{action}, объявлен в src/app_runtime/control/http_app.p" - } - }, - "failure_reasons": [], - "timings_ms": { - "router": 1, - "retrieval": 38, - "pre_evidence_gate": 1, - "llm": 2451, - "post_evidence_gate": 1 - } - }, - "rag_rows": [ - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "class HttpControlChannel(ControlChannel):\n def __init__(self, host: str, port: int, timeout: int) -> None:\n self._timeout = timeout\n self._runner = UvicornThreadRunner(host, port, timeout)\n self._factory = HttpControlAppFactory()\n self._actions: ControlActionSet | None = None\n\n async def start(self, actions: ControlActionSet) -> None:\n self._actions = actions\n app = self._factory.create(self._health_response, self._action_response)\n await self._runner.start(app)\n\n async def stop(self) -> None:\n await self._runner.stop()\n\n @property\n def port(self) -> int:\n return self._runner.port\n\n async def _health_response(self) -> dict[str, object]:\n if self._actions is None:\n return {\"status\": \"unhealthy\", \"detail\": \"control actions are not configured\"}\n return await asyncio.wait_for(self._actions.health(), timeout=float(self._timeout))\n\n async def _action_response(self, action: str, _client_source: str = \"unknown\") -> JSONResponse:\n if self._actions is None:\n return JSONResponse(content={\"status\": \"error\", \"detail\": f\"{action} handler is not configured\"}, status_code=404)\n callbacks = {\n \"start\": self._actions.start,\n \"stop\": self._actions.stop,\n \"status\": self._actions.status,\n }\n callback = callbacks.get(action)\n if callback is None:\n return JSONResponse(content={\"status\": \"error\", \"detail\": f\"unsupported action: {action}\"}, status_code=404)\n action_timeout = max(float(self._timeout), 10.0) if action in {\"start\", \"stop\"} else float(self._timeout)\n try:\n detail = await asyncio.wait_for(callback(), timeout=action_timeout)\n except asyncio.TimeoutError:\n return JSONResponse(\n content={\"status\": \"accepted\", \"detail\": f\"{action} operation is still in progress\"},\n status_code=202,\n )\n except Exception as exc:\n return JSONResponse(content={\"status\": \"error\", \"detail\": str(exc)}, status_code=500)\n return JSONResponse(content={\"status\": \"ok\", \"detail\": detail or f\"{action} action accepted\"}, status_code=200)", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/http_channel.py:HttpControlChannel", - "span_start": 12, - "span_end": 57, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.http_channel", - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "class HttpControlAppFactory:\n def create(\n self,\n health_provider: Callable[[], Awaitable[HealthPayload]],\n action_provider: Callable[[str, str], Awaitable[JSONResponse]],\n ) -> FastAPI:\n app = FastAPI(title=\"PLBA Control API\")\n\n @app.middleware(\"http\")\n async def log_api_call(request: Request, call_next): # type: ignore[no-untyped-def]\n started = time.monotonic()\n response = await call_next(request)\n response.headers[\"X-Response-Time-Ms\"] = str(int((time.monotonic() - started) * 1000))\n return response\n\n @app.get(\"/health\")\n async def health() -> JSONResponse:\n payload = await health_provider()\n status_code = 200 if payload.get(\"status\") == \"ok\" else 503\n return JSONResponse(content=payload, status_code=status_code)\n\n @app.get(\"/actions/{action}\")\n @app.post(\"/actions/{action}\")\n async def action(action: str, request: Request) -> JSONResponse:\n client_source = self._client_source(request)\n if action in {\"start\", \"stop\"}:\n LOGGER.warning(\"Control action requested: /actions/%s client=%s\", action, client_source)\n return await action_provider(action, client_source)\n\n return app\n\n def _client_source(self, request: Request) -> str:\n explicit_header = request.headers.get(\"X-Client-Source\", \"\").strip()\n if explicit_header:\n return explicit_header\n user_agent = request.headers.get(\"User-Agent\", \"\").strip()\n if user_agent:\n return f\"user-agent:{user_agent}\"\n return \"unknown\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/http_app.py:HttpControlAppFactory", - "span_start": 15, - "span_end": 53, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.http_app", - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "class ControlActionSet:\n health: HealthHandler\n start: ActionHandler\n stop: ActionHandler\n status: ActionHandler", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/base.py:ControlActionSet", - "span_start": 14, - "span_end": 18, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.base", - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/__init__.py", - "content": "from app_runtime.control.base import ControlActionSet, ControlChannel\nfrom app_runtime.control.http_channel import HttpControlChannel\nfrom app_runtime.control.service import ControlPlaneService\n\n__all__ = [\"ControlActionSet\", \"ControlChannel\", \"ControlPlaneService\", \"HttpControlChannel\"]", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/__init__.py:1-5", - "span_start": 1, - "span_end": 5, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.app_runtime.control.__init__", - "is_test": false, - "blob_sha": "bf3c37e3369a84cc618adc0fd71c232e5eb4b871eaff743069a17e661e498316", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "class ControlChannel(ABC):\n @abstractmethod\n async def start(self, actions: ControlActionSet) -> None:\n \"\"\"Start the control channel and bind handlers.\"\"\"\n\n @abstractmethod\n async def stop(self) -> None:\n \"\"\"Stop the control channel and release resources.\"\"\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/base.py:ControlChannel", - "span_start": 21, - "span_end": 28, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 1, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.base", - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_runner.py", - "content": "class UvicornThreadRunner:\n def __init__(self, host: str, port: int, timeout: int) -> None:\n self._host = host\n self._port = port\n self._timeout = timeout\n self._server: Server | None = None\n self._thread: Thread | None = None\n self._error: BaseException | None = None\n\n async def start(self, app: FastAPI) -> None:\n if self._thread is not None and self._thread.is_alive():\n return\n self._error = None\n config = Config(app=app, host=self._host, port=self._port, log_level=\"warning\")\n self._server = Server(config)\n self._thread = Thread(target=self._serve, name=\"plba-http-control\", daemon=True)\n self._thread.start()\n await self._wait_until_started()\n\n async def stop(self) -> None:\n if self._server is None or self._thread is None:\n return\n self._server.should_exit = True\n await asyncio.to_thread(self._thread.join, self._timeout)\n self._server = None\n self._thread = None\n\n @property\n def port(self) -> int:\n if self._server is None or not getattr(self._server, \"servers\", None):\n return self._port\n socket = self._server.servers[0].sockets[0]\n return int(socket.getsockname()[1])\n\n async def _wait_until_started(self) -> None:\n if self._server is None:\n raise RuntimeError(\"Server is not initialized\")\n deadline = asyncio.get_running_loop().time() + max(float(self._timeout), 1.0)\n while not self._server.started:\n if self._error is not None:\n raise RuntimeError(\"HTTP control server failed to start\") from self._error\n if asyncio.get_running_loop().time() >= deadline:\n raise TimeoutError(\"HTTP control server startup timed out\")\n await asyncio.sleep(0.05)\n\n def _serve(self) -> None:\n if self._server is None:\n return\n try:\n asyncio.run(self._server.serve())\n except BaseException as exc: # noqa: BLE001\n self._error = exc", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/http_runner.py:UvicornThreadRunner", - "span_start": 10, - "span_end": 61, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.http_runner", - "is_test": false, - "blob_sha": "3779fdd2878b770e789a35bb2a89c9d79f13b61c26d7db1b3b683f9bb9e1623f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "validation": { - "passed": true, - "action": "return", - "reasons": [] - }, - "steps": [ - { - "step": "router", - "status": "completed", - "timings_ms": { - "router": 1 - }, - "output": { - "intent": "CODE_QA", - "sub_intent": "FIND_ENTRYPOINTS", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - } - }, - { - "step": "retrieval", - "status": "completed", - "timings_ms": { - "retrieval": 38 - }, - "output": { - "rag_count": 9, - "answer_path_rag_count": 9, - "resolved_symbol_status": "not_found", - "resolved_symbol": null, - "requested_layers": [ - "C3_ENTRYPOINTS", - "C0_SOURCE_CHUNKS" - ] - }, - "diagnostics": { - "executed_layers": [ - "C3_ENTRYPOINTS", - "C0_SOURCE_CHUNKS" - ], - "retrieval_mode_by_layer": { - "C3_ENTRYPOINTS": "vector", - "C0_SOURCE_CHUNKS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C3_ENTRYPOINTS": 12, - "C0_SOURCE_CHUNKS": 24 - }, - "filters_by_layer": { - "C3_ENTRYPOINTS": { - "path_scope": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src/app_runtime/control/http_app.py" - ] - } - }, - "fallback": { - "used": false, - "reason": null - }, - "retrieval_by_layer_ms": { - "C3_ENTRYPOINTS": 16, - "C0_SOURCE_CHUNKS": 12 - }, - "supplemental_requests": [ - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Найди точки входа HTTP control plane", - "ranking_profile": "entrypoint_source_hydration" - } - ] - } - }, - { - "step": "pre_evidence_gate", - "status": "passed", - "timings_ms": { - "pre_evidence_gate": 1 - }, - "input": { - "resolved_target": "src/app_runtime/control/http_app.py", - "sub_intent": "FIND_ENTRYPOINTS", - "target_type": "file", - "evidence_count": 9, - "code_chunk_count": 9, - "entrypoint_count": 3, - "relation_count": 0, - "test_evidence_count": 0, - "symbol_resolution_status": "not_found", - "path_scope": [] - }, - "output": { - "passed": true, - "failure_reasons": [], - "degraded_message": "", - "evidence_count": 9 - } - }, - { - "step": "llm", - "status": "completed", - "timings_ms": { - "llm": 2451 - }, - "output": { - "prompt_name": "code_qa_find_entrypoints_answer", - "answer_preview": "Подтверждённые HTTP routes:\n\n- GET /health, объявлен в src/app_runtime/control/http_app.py, строки 31-34, обработчик health\n- GET /actions/{action}, объявлен в src/app_runtime/control/http_app.py, строки 38-42, обработчик action\n- POST /actions/{action}, объявлен в src/app_runtime/control/http_app.p", - "resolved_target": "src/app_runtime/control/http_app.py", - "answer_policy_branch": "normal_answer", - "decision_reason": "evidence_sufficient" - } - }, - { - "step": "post_evidence_gate", - "status": "passed", - "timings_ms": { - "post_evidence_gate": 1, - "post_evidence_gate_recheck": 0, - "repair": 0 - }, - "input": { - "answer_mode": "normal", - "degraded_message": "", - "resolved_target": "src/app_runtime/control/http_app.py", - "draft_answer_preview": "Подтверждённые HTTP routes:\n\n- GET /health, объявлен в src/app_runtime/control/http_app.py, строки 31-34, обработчик health\n- GET /actions/{action}, объявлен в src/app_runtime/control/http_app.py, строки 38-42, обработчик action\n- POST /actions/{action}, объявлен в src/app_runtime/control/http_app.p", - "repair_candidate": true - }, - "output": { - "passed": true, - "action": "return", - "reasons": [], - "repair_used": false, - "final_answer_preview": "Подтверждённые HTTP routes:\n\n- GET /health, объявлен в src/app_runtime/control/http_app.py, строки 31-34, обработчик health\n- GET /actions/{action}, объявлен в src/app_runtime/control/http_app.py, строки 38-42, обработчик action\n- POST /actions/{action}, объявлен в src/app_runtime/control/http_app.p" - } - } - ] - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/plba_full_chain_subintents_v3/20260312_174008/full_chain_plba_code_subintents_v2_plba-v2-find-entrypoints-control-plane.md b/tests/pipeline_setup_v3/test_results/plba_full_chain_subintents_v3/20260312_174008/full_chain_plba_code_subintents_v2_plba-v2-find-entrypoints-control-plane.md deleted file mode 100644 index 3143dd5..0000000 --- a/tests/pipeline_setup_v3/test_results/plba_full_chain_subintents_v3/20260312_174008/full_chain_plba_code_subintents_v2_plba-v2-find-entrypoints-control-plane.md +++ /dev/null @@ -1,262 +0,0 @@ -# plba-v2-find-entrypoints-control-plane - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_02_pipeline/full_chain_plba_code_subintents_v2.yaml -- runner: agent_runtime -- mode: full_chain -- passed: True - -## Query -Найди точки входа HTTP control plane - -## Actual -{ - "intent": "CODE_QA", - "sub_intent": "FIND_ENTRYPOINTS", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 9, - "llm_answer": "Подтверждённые HTTP routes:\n\n- GET /health, объявлен в src/app_runtime/control/http_app.py, строки 31-34, обработчик health\n- GET /actions/{action}, объявлен в src/app_runtime/control/http_app.py, строки 38-42, обработчик action\n- POST /actions/{action}, объявлен в src/app_runtime/control/http_app.py, строки 38-42, обработчик action\n\nКандидаты на входы не требуются, так как все маршруты уже подтверждены.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "HTTP", - "control", - "plane" - ], - "layers": [ - "C3_ENTRYPOINTS", - "C0_SOURCE_CHUNKS" - ] -} - -## Steps -[ - { - "step": "router", - "status": "completed", - "timings_ms": { - "router": 1 - }, - "output": { - "intent": "CODE_QA", - "sub_intent": "FIND_ENTRYPOINTS", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - } - }, - { - "step": "retrieval", - "status": "completed", - "timings_ms": { - "retrieval": 38 - }, - "output": { - "rag_count": 9, - "answer_path_rag_count": 9, - "resolved_symbol_status": "not_found", - "resolved_symbol": null, - "requested_layers": [ - "C3_ENTRYPOINTS", - "C0_SOURCE_CHUNKS" - ] - }, - "diagnostics": { - "executed_layers": [ - "C3_ENTRYPOINTS", - "C0_SOURCE_CHUNKS" - ], - "retrieval_mode_by_layer": { - "C3_ENTRYPOINTS": "vector", - "C0_SOURCE_CHUNKS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C3_ENTRYPOINTS": 12, - "C0_SOURCE_CHUNKS": 24 - }, - "filters_by_layer": { - "C3_ENTRYPOINTS": { - "path_scope": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src/app_runtime/control/http_app.py" - ] - } - }, - "fallback": { - "used": false, - "reason": null - }, - "retrieval_by_layer_ms": { - "C3_ENTRYPOINTS": 16, - "C0_SOURCE_CHUNKS": 12 - }, - "supplemental_requests": [ - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Найди точки входа HTTP control plane", - "ranking_profile": "entrypoint_source_hydration" - } - ] - } - }, - { - "step": "pre_evidence_gate", - "status": "passed", - "timings_ms": { - "pre_evidence_gate": 1 - }, - "input": { - "resolved_target": "src/app_runtime/control/http_app.py", - "sub_intent": "FIND_ENTRYPOINTS", - "target_type": "file", - "evidence_count": 9, - "code_chunk_count": 9, - "entrypoint_count": 3, - "relation_count": 0, - "test_evidence_count": 0, - "symbol_resolution_status": "not_found", - "path_scope": [] - }, - "output": { - "passed": true, - "failure_reasons": [], - "degraded_message": "", - "evidence_count": 9 - } - }, - { - "step": "llm", - "status": "completed", - "timings_ms": { - "llm": 2451 - }, - "output": { - "prompt_name": "code_qa_find_entrypoints_answer", - "answer_preview": "Подтверждённые HTTP routes:\n\n- GET /health, объявлен в src/app_runtime/control/http_app.py, строки 31-34, обработчик health\n- GET /actions/{action}, объявлен в src/app_runtime/control/http_app.py, строки 38-42, обработчик action\n- POST /actions/{action}, объявлен в src/app_runtime/control/http_app.p", - "resolved_target": "src/app_runtime/control/http_app.py", - "answer_policy_branch": "normal_answer", - "decision_reason": "evidence_sufficient" - } - }, - { - "step": "post_evidence_gate", - "status": "passed", - "timings_ms": { - "post_evidence_gate": 1, - "post_evidence_gate_recheck": 0, - "repair": 0 - }, - "input": { - "answer_mode": "normal", - "degraded_message": "", - "resolved_target": "src/app_runtime/control/http_app.py", - "draft_answer_preview": "Подтверждённые HTTP routes:\n\n- GET /health, объявлен в src/app_runtime/control/http_app.py, строки 31-34, обработчик health\n- GET /actions/{action}, объявлен в src/app_runtime/control/http_app.py, строки 38-42, обработчик action\n- POST /actions/{action}, объявлен в src/app_runtime/control/http_app.p", - "repair_candidate": true - }, - "output": { - "passed": true, - "action": "return", - "reasons": [], - "repair_used": false, - "final_answer_preview": "Подтверждённые HTTP routes:\n\n- GET /health, объявлен в src/app_runtime/control/http_app.py, строки 31-34, обработчик health\n- GET /actions/{action}, объявлен в src/app_runtime/control/http_app.py, строки 38-42, обработчик action\n- POST /actions/{action}, объявлен в src/app_runtime/control/http_app.p" - } - } -] - -## Diagnostics -{ - "intent_correct": null, - "target_found": true, - "layers_used": [ - "C3_ENTRYPOINTS", - "C0_SOURCE_CHUNKS" - ], - "retrieval_sufficient": true, - "answer_mode": "normal", - "resolved_target": "src/app_runtime/control/http_app.py", - "answer_policy_branch": "normal_answer", - "decision_reason": "evidence_sufficient", - "router_result": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "retrieval_profile": "code", - "sub_intent": "FIND_ENTRYPOINTS", - "path_scope": [], - "layers": [ - "C3_ENTRYPOINTS", - "C0_SOURCE_CHUNKS" - ], - "symbol_resolution_status": "not_found" - }, - "retrieval_request": { - "rag_session_id": "7d11da21-faa0-4cea-aede-aeabe069164c", - "query": "Найди точки входа HTTP control plane", - "sub_intent": "FIND_ENTRYPOINTS", - "path_scope": [], - "requested_layers": [ - "C3_ENTRYPOINTS", - "C0_SOURCE_CHUNKS" - ] - }, - "per_layer_outcome": [ - { - "layer_id": "C3_ENTRYPOINTS", - "hit_count": 3, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C0_SOURCE_CHUNKS", - "hit_count": 6, - "empty": false, - "fallback_used": false - } - ], - "empty_layers": [], - "evidence_gate_decision": { - "sufficient": true, - "failure_reasons": [], - "evidence_count": 9 - }, - "evidence_gate_input": { - "resolved_target": "src/app_runtime/control/http_app.py", - "sub_intent": "FIND_ENTRYPOINTS", - "target_type": "file", - "evidence_count": 9, - "code_chunk_count": 9, - "entrypoint_count": 3, - "relation_count": 0, - "test_evidence_count": 0, - "symbol_resolution_status": "not_found", - "path_scope": [] - }, - "post_evidence_gate": { - "input": { - "answer_mode": "normal", - "degraded_message": "", - "resolved_target": "src/app_runtime/control/http_app.py", - "draft_answer_preview": "Подтверждённые HTTP routes:\n\n- GET /health, объявлен в src/app_runtime/control/http_app.py, строки 31-34, обработчик health\n- GET /actions/{action}, объявлен в src/app_runtime/control/http_app.py, строки 38-42, обработчик action\n- POST /actions/{action}, объявлен в src/app_runtime/control/http_app.p", - "repair_candidate": true - }, - "output": { - "passed": true, - "action": "return", - "reasons": [], - "repair_used": false, - "final_answer_preview": "Подтверждённые HTTP routes:\n\n- GET /health, объявлен в src/app_runtime/control/http_app.py, строки 31-34, обработчик health\n- GET /actions/{action}, объявлен в src/app_runtime/control/http_app.py, строки 38-42, обработчик action\n- POST /actions/{action}, объявлен в src/app_runtime/control/http_app.p" - } - }, - "failure_reasons": [], - "timings_ms": { - "router": 1, - "retrieval": 38, - "pre_evidence_gate": 1, - "llm": 2451, - "post_evidence_gate": 1 - } -} - -## Mismatches -- none \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/plba_full_chain_subintents_v3/20260312_174008/full_chain_plba_code_subintents_v2_plba-v2-find-entrypoints-health-endpoint.json b/tests/pipeline_setup_v3/test_results/plba_full_chain_subintents_v3/20260312_174008/full_chain_plba_code_subintents_v2_plba-v2-find-entrypoints-health-endpoint.json deleted file mode 100644 index 29d5b1e..0000000 --- a/tests/pipeline_setup_v3/test_results/plba_full_chain_subintents_v3/20260312_174008/full_chain_plba_code_subintents_v2_plba-v2-find-entrypoints-health-endpoint.json +++ /dev/null @@ -1,1553 +0,0 @@ -{ - "case_id": "plba-v2-find-entrypoints-health-endpoint", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_02_pipeline/full_chain_plba_code_subintents_v2.yaml", - "runner": "agent_runtime", - "mode": "full_chain", - "query": "Где health endpoint?", - "actual": { - "intent": "CODE_QA", - "sub_intent": "FIND_ENTRYPOINTS", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 10, - "llm_answer": "Подтверждённая точка входа для health endpoint:\nGET /health, declared in src/app_runtime/control/http_app.py, lines 31-34, handler function named 'health'.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "health", - "endpoint" - ], - "layers": [ - "C3_ENTRYPOINTS", - "C0_SOURCE_CHUNKS" - ] - }, - "passed": true, - "mismatches": [], - "details": { - "query": "Где health endpoint?", - "router_result": { - "schema_version": "1.1", - "intent": "CODE_QA", - "retrieval_profile": "code", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query_plan": { - "raw": "Где health endpoint?", - "normalized": "Где health endpoint?", - "sub_intent": "FIND_ENTRYPOINTS", - "negations": [], - "expansions": [ - "health", - "endpoint" - ], - "keyword_hints": [ - "health", - "endpoint" - ], - "path_hints": [], - "doc_scope_hints": [], - "symbol_candidates": [ - "health", - "endpoint" - ], - "symbol_kind_hint": "unknown", - "anchors": [ - { - "type": "SYMBOL", - "value": "health", - "source": "user_text", - "subtype": null, - "span": { - "start": 4, - "end": 10 - }, - "confidence": 0.88 - }, - { - "type": "SYMBOL", - "value": "endpoint", - "source": "user_text", - "subtype": null, - "span": { - "start": 11, - "end": 19 - }, - "confidence": 0.88 - } - ] - }, - "retrieval_spec": { - "domains": [ - "CODE" - ], - "layer_queries": [ - { - "layer_id": "C3_ENTRYPOINTS", - "top_k": 12 - }, - { - "layer_id": "C0_SOURCE_CHUNKS", - "top_k": 6 - } - ], - "filters": { - "test_policy": "EXCLUDE", - "path_scope": [], - "language": [ - "python" - ] - }, - "rerank_profile": "code" - }, - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - }, - "symbol_resolution": { - "status": "not_found", - "resolved_symbol": null, - "alternatives": [], - "confidence": 0.0 - }, - "evidence_policy": { - "require_def": true, - "require_flow": true, - "require_spec": false, - "allow_answer_without_evidence": false - } - }, - "retrieval_request": { - "rag_session_id": "7d11da21-faa0-4cea-aede-aeabe069164c", - "query": "Где health endpoint?", - "sub_intent": "FIND_ENTRYPOINTS", - "path_scope": [], - "keyword_hints": [ - "health", - "endpoint" - ], - "symbol_candidates": [ - "health", - "endpoint" - ], - "requested_layers": [ - "C3_ENTRYPOINTS", - "C0_SOURCE_CHUNKS" - ], - "retrieval_spec": { - "domains": [ - "CODE" - ], - "layer_queries": [ - { - "layer_id": "C3_ENTRYPOINTS", - "top_k": 12 - }, - { - "layer_id": "C0_SOURCE_CHUNKS", - "top_k": 6 - } - ], - "filters": { - "test_policy": "EXCLUDE", - "path_scope": [], - "language": [ - "python" - ] - }, - "rerank_profile": "code" - }, - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - }, - "query_plan": { - "raw": "Где health endpoint?", - "normalized": "Где health endpoint?", - "sub_intent": "FIND_ENTRYPOINTS", - "negations": [], - "expansions": [ - "health", - "endpoint" - ], - "keyword_hints": [ - "health", - "endpoint" - ], - "path_hints": [], - "doc_scope_hints": [], - "symbol_candidates": [ - "health", - "endpoint" - ], - "symbol_kind_hint": "unknown", - "anchors": [ - { - "type": "SYMBOL", - "value": "health", - "source": "user_text", - "subtype": null, - "span": { - "start": 4, - "end": 10 - }, - "confidence": 0.88 - }, - { - "type": "SYMBOL", - "value": "endpoint", - "source": "user_text", - "subtype": null, - "span": { - "start": 11, - "end": 19 - }, - "confidence": 0.88 - } - ] - } - }, - "retrieval_result": { - "target_symbol_candidates": [], - "resolved_symbol": null, - "symbol_resolution_status": "not_found", - "file_candidates": [ - "src/app_runtime/control/http_app.py", - "src/app_runtime/health/registry.py", - "src/plba/health.py", - "src/app_runtime/contracts/health.py", - "src/app_runtime/health/__init__.py", - "src/app_runtime/contracts/worker.py" - ], - "code_chunks": [ - { - "layer": "C3_ENTRYPOINTS", - "path": "src/app_runtime/control/http_app.py", - "title": "app.post", - "content": "fastapi http app.post", - "start_line": 38, - "end_line": 42, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C3_ENTRYPOINTS", - "path": "src/app_runtime/control/http_app.py", - "title": "app.get", - "content": "fastapi http app.get", - "start_line": 31, - "end_line": 34, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C3_ENTRYPOINTS", - "path": "src/app_runtime/control/http_app.py", - "title": "app.get", - "content": "fastapi http app.get", - "start_line": 38, - "end_line": 42, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C0_SOURCE_CHUNKS", - "path": "src/app_runtime/health/registry.py", - "title": "src/app_runtime/health/registry.py:HealthRegistry", - "content": "class HealthRegistry:\n def __init__(self) -> None:\n self._contributors: list[HealthContributor] = []\n\n def register(self, contributor: HealthContributor) -> None:\n self._contributors.append(contributor)\n\n def contributor_healths(self) -> list[WorkerHealth]:\n return [contributor.health() for contributor in self._contributors]\n\n def snapshot(self, worker_healths: list[WorkerHealth]) -> dict[str, object]:\n component_healths = worker_healths + self.contributor_healths()\n return {\n \"status\": self._aggregate_status(component_healths),\n \"components\": [self._health_dict(item) for item in component_healths],\n }\n\n def payload(self, state: LifecycleState, worker_healths: list[WorkerHealth]) -> HealthPayload:\n component_healths = worker_healths + self.contributor_healths()\n if state == LifecycleState.STOPPED:\n return {\"status\": \"unhealthy\", \"detail\": \"state=stopped\", \"state\": state.value}\n if state in {LifecycleState.STARTING, LifecycleState.STOPPING}:\n return {\n \"status\": \"degraded\",\n \"detail\": f\"state={state.value}\",\n \"state\": state.value,\n \"components\": [self._health_dict(item) for item in component_healths],\n }\n return {\n \"status\": self._aggregate_status(component_healths),\n \"state\": state.value,\n \"components\": [self._health_dict(item) for item in component_healths],\n }\n\n def _aggregate_status(self, component_healths: list[WorkerHealth]) -> str:\n if any(item.status == \"unhealthy\" and item.critical for item in component_healths):\n return \"unhealthy\"\n if any(item.status in {\"degraded\", \"unhealthy\"} for item in component_healths):\n return \"degraded\"\n return \"ok\"\n\n def _health_dict(self, health: WorkerHealth) -> dict[str, object]:\n return {\n \"name\": health.name,\n \"status\": health.status,\n \"critical\": health.critical,\n \"detail\": health.detail,\n \"meta\": health.meta,\n }", - "start_line": 8, - "end_line": 56, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.health.registry", - "is_test": false, - "blob_sha": "26e6a24daa43407ba5340b74497c20153020e79f8d7828ae502aaec378dfcf75", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C0_SOURCE_CHUNKS", - "path": "src/plba/health.py", - "title": "src/app_runtime/health/__init__.py:1-3", - "content": "from app_runtime.health.registry import HealthRegistry\n\n__all__ = [\"HealthRegistry\"]", - "start_line": 1, - "end_line": 3, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.app_runtime.health.__init__", - "is_test": false, - "blob_sha": "f7b15eed8b1f1cca8dfd467909a2612d8cb4e66e46b972ad89a0c9459ce283a0", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C0_SOURCE_CHUNKS", - "path": "src/app_runtime/contracts/health.py", - "title": "src/app_runtime/contracts/health.py:HealthContributor", - "content": "class HealthContributor(ABC):\n @abstractmethod\n def health(self) -> WorkerHealth:\n \"\"\"Return contributor health state.\"\"\"", - "start_line": 7, - "end_line": 10, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.contracts.health", - "is_test": false, - "blob_sha": "6bd92611def7131e32d4dd34a8ed85e6cf3c67722ad27797032a632cb30dc097", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C0_SOURCE_CHUNKS", - "path": "src/app_runtime/health/__init__.py", - "title": "src/app_runtime/health/__init__.py:1-3", - "content": "from app_runtime.health.registry import HealthRegistry\n\n__all__ = [\"HealthRegistry\"]", - "start_line": 1, - "end_line": 3, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.app_runtime.health.__init__", - "is_test": false, - "blob_sha": "f7b15eed8b1f1cca8dfd467909a2612d8cb4e66e46b972ad89a0c9459ce283a0", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C0_SOURCE_CHUNKS", - "path": "src/app_runtime/contracts/worker.py", - "title": "src/app_runtime/contracts/worker.py:WorkerHealth", - "content": "class WorkerHealth:\n name: str\n status: HealthState\n critical: bool\n detail: str | None = None\n meta: dict[str, Any] = field(default_factory=dict)", - "start_line": 13, - "end_line": 18, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.contracts.worker", - "is_test": false, - "blob_sha": "e4827d32220f322d8adc3e42769da3ca0cc680db6a5eab7a11f4d8773a75304e", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C0_SOURCE_CHUNKS", - "path": "src/app_runtime/contracts/worker.py", - "title": "src/app_runtime/contracts/worker.py:Worker", - "content": "class Worker(ABC):\n @property\n @abstractmethod\n def name(self) -> str:\n \"\"\"Stable worker name for diagnostics.\"\"\"\n\n @property\n @abstractmethod\n def critical(self) -> bool:\n \"\"\"Whether this worker is required for healthy app operation.\"\"\"\n\n @abstractmethod\n def start(self) -> None:\n \"\"\"Start worker execution.\"\"\"\n\n @abstractmethod\n def stop(self, force: bool = False) -> None:\n \"\"\"Request graceful or immediate stop.\"\"\"\n\n @abstractmethod\n def health(self) -> WorkerHealth:\n \"\"\"Return current health state.\"\"\"\n\n @abstractmethod\n def status(self) -> WorkerStatus:\n \"\"\"Return current runtime status.\"\"\"", - "start_line": 30, - "end_line": 55, - "metadata": { - "chunk_index": 2, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.contracts.worker", - "is_test": false, - "blob_sha": "e4827d32220f322d8adc3e42769da3ca0cc680db6a5eab7a11f4d8773a75304e", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C0_SOURCE_CHUNKS", - "path": "src/app_runtime/control/http_app.py", - "title": "src/app_runtime/control/http_app.py:HttpControlAppFactory", - "content": "class HttpControlAppFactory:\n def create(\n self,\n health_provider: Callable[[], Awaitable[HealthPayload]],\n action_provider: Callable[[str, str], Awaitable[JSONResponse]],\n ) -> FastAPI:\n app = FastAPI(title=\"PLBA Control API\")\n\n @app.middleware(\"http\")\n async def log_api_call(request: Request, call_next): # type: ignore[no-untyped-def]\n started = time.monotonic()\n response = await call_next(request)\n response.headers[\"X-Response-Time-Ms\"] = str(int((time.monotonic() - started) * 1000))\n return response\n\n @app.get(\"/health\")\n async def health() -> JSONResponse:\n payload = await health_provider()\n status_code = 200 if payload.get(\"status\") == \"ok\" else 503\n return JSONResponse(content=payload, status_code=status_code)\n\n @app.get(\"/actions/{action}\")\n @app.post(\"/actions/{action}\")\n async def action(action: str, request: Request) -> JSONResponse:\n client_source = self._client_source(request)\n if action in {\"start\", \"stop\"}:\n LOGGER.warning(\"Control action requested: /actions/%s client=%s\", action, client_source)\n return await action_provider(action, client_source)\n\n return app\n\n def _client_source(self, request: Request) -> str:\n explicit_header = request.headers.get(\"X-Client-Source\", \"\").strip()\n if explicit_header:\n return explicit_header\n user_agent = request.headers.get(\"User-Agent\", \"\").strip()\n if user_agent:\n return f\"user-agent:{user_agent}\"\n return \"unknown\"", - "start_line": 15, - "end_line": 53, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.http_app", - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "relations": [], - "entrypoints": [ - { - "path": "src/app_runtime/control/http_app.py", - "title": "app.get", - "start_line": 31, - "end_line": 34, - "http_method": "GET", - "route_path": "/health", - "handler_symbol": "health", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "route_or_command": "app.get", - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "title": "app.get", - "start_line": 38, - "end_line": 42, - "http_method": "GET", - "route_path": "/actions/{action}", - "handler_symbol": "action", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "route_or_command": "app.get", - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "title": "app.post", - "start_line": 38, - "end_line": 42, - "http_method": "POST", - "route_path": "/actions/{action}", - "handler_symbol": "action", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "route_or_command": "app.post", - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "test_candidates": [], - "layer_outcomes": [ - { - "layer_id": "C3_ENTRYPOINTS", - "hit_count": 3, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C0_SOURCE_CHUNKS", - "hit_count": 7, - "empty": false, - "fallback_used": false - } - ], - "missing_layers": [], - "raw_rows": [ - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": null, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": null, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": null, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/health/registry.py", - "content": "class HealthRegistry:\n def __init__(self) -> None:\n self._contributors: list[HealthContributor] = []\n\n def register(self, contributor: HealthContributor) -> None:\n self._contributors.append(contributor)\n\n def contributor_healths(self) -> list[WorkerHealth]:\n return [contributor.health() for contributor in self._contributors]\n\n def snapshot(self, worker_healths: list[WorkerHealth]) -> dict[str, object]:\n component_healths = worker_healths + self.contributor_healths()\n return {\n \"status\": self._aggregate_status(component_healths),\n \"components\": [self._health_dict(item) for item in component_healths],\n }\n\n def payload(self, state: LifecycleState, worker_healths: list[WorkerHealth]) -> HealthPayload:\n component_healths = worker_healths + self.contributor_healths()\n if state == LifecycleState.STOPPED:\n return {\"status\": \"unhealthy\", \"detail\": \"state=stopped\", \"state\": state.value}\n if state in {LifecycleState.STARTING, LifecycleState.STOPPING}:\n return {\n \"status\": \"degraded\",\n \"detail\": f\"state={state.value}\",\n \"state\": state.value,\n \"components\": [self._health_dict(item) for item in component_healths],\n }\n return {\n \"status\": self._aggregate_status(component_healths),\n \"state\": state.value,\n \"components\": [self._health_dict(item) for item in component_healths],\n }\n\n def _aggregate_status(self, component_healths: list[WorkerHealth]) -> str:\n if any(item.status == \"unhealthy\" and item.critical for item in component_healths):\n return \"unhealthy\"\n if any(item.status in {\"degraded\", \"unhealthy\"} for item in component_healths):\n return \"degraded\"\n return \"ok\"\n\n def _health_dict(self, health: WorkerHealth) -> dict[str, object]:\n return {\n \"name\": health.name,\n \"status\": health.status,\n \"critical\": health.critical,\n \"detail\": health.detail,\n \"meta\": health.meta,\n }", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/health/registry.py:HealthRegistry", - "span_start": 8, - "span_end": 56, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": null, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.health.registry", - "is_test": false, - "blob_sha": "26e6a24daa43407ba5340b74497c20153020e79f8d7828ae502aaec378dfcf75", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/health.py", - "content": "from app_runtime.health.registry import HealthRegistry\n\n__all__ = [\"HealthRegistry\"]", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/health/__init__.py:1-3", - "span_start": 1, - "span_end": 3, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": null, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.app_runtime.health.__init__", - "is_test": false, - "blob_sha": "f7b15eed8b1f1cca8dfd467909a2612d8cb4e66e46b972ad89a0c9459ce283a0", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/contracts/health.py", - "content": "class HealthContributor(ABC):\n @abstractmethod\n def health(self) -> WorkerHealth:\n \"\"\"Return contributor health state.\"\"\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/contracts/health.py:HealthContributor", - "span_start": 7, - "span_end": 10, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": null, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.contracts.health", - "is_test": false, - "blob_sha": "6bd92611def7131e32d4dd34a8ed85e6cf3c67722ad27797032a632cb30dc097", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/health/__init__.py", - "content": "from app_runtime.health.registry import HealthRegistry\n\n__all__ = [\"HealthRegistry\"]", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/health/__init__.py:1-3", - "span_start": 1, - "span_end": 3, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": null, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.app_runtime.health.__init__", - "is_test": false, - "blob_sha": "f7b15eed8b1f1cca8dfd467909a2612d8cb4e66e46b972ad89a0c9459ce283a0", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/contracts/worker.py", - "content": "class WorkerHealth:\n name: str\n status: HealthState\n critical: bool\n detail: str | None = None\n meta: dict[str, Any] = field(default_factory=dict)", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/contracts/worker.py:WorkerHealth", - "span_start": 13, - "span_end": 18, - "lexical_rank": 6, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": null, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.contracts.worker", - "is_test": false, - "blob_sha": "e4827d32220f322d8adc3e42769da3ca0cc680db6a5eab7a11f4d8773a75304e", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/contracts/worker.py", - "content": "class Worker(ABC):\n @property\n @abstractmethod\n def name(self) -> str:\n \"\"\"Stable worker name for diagnostics.\"\"\"\n\n @property\n @abstractmethod\n def critical(self) -> bool:\n \"\"\"Whether this worker is required for healthy app operation.\"\"\"\n\n @abstractmethod\n def start(self) -> None:\n \"\"\"Start worker execution.\"\"\"\n\n @abstractmethod\n def stop(self, force: bool = False) -> None:\n \"\"\"Request graceful or immediate stop.\"\"\"\n\n @abstractmethod\n def health(self) -> WorkerHealth:\n \"\"\"Return current health state.\"\"\"\n\n @abstractmethod\n def status(self) -> WorkerStatus:\n \"\"\"Return current runtime status.\"\"\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/contracts/worker.py:Worker", - "span_start": 30, - "span_end": 55, - "lexical_rank": 6, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": null, - "metadata": { - "chunk_index": 2, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.contracts.worker", - "is_test": false, - "blob_sha": "e4827d32220f322d8adc3e42769da3ca0cc680db6a5eab7a11f4d8773a75304e", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "class HttpControlAppFactory:\n def create(\n self,\n health_provider: Callable[[], Awaitable[HealthPayload]],\n action_provider: Callable[[str, str], Awaitable[JSONResponse]],\n ) -> FastAPI:\n app = FastAPI(title=\"PLBA Control API\")\n\n @app.middleware(\"http\")\n async def log_api_call(request: Request, call_next): # type: ignore[no-untyped-def]\n started = time.monotonic()\n response = await call_next(request)\n response.headers[\"X-Response-Time-Ms\"] = str(int((time.monotonic() - started) * 1000))\n return response\n\n @app.get(\"/health\")\n async def health() -> JSONResponse:\n payload = await health_provider()\n status_code = 200 if payload.get(\"status\") == \"ok\" else 503\n return JSONResponse(content=payload, status_code=status_code)\n\n @app.get(\"/actions/{action}\")\n @app.post(\"/actions/{action}\")\n async def action(action: str, request: Request) -> JSONResponse:\n client_source = self._client_source(request)\n if action in {\"start\", \"stop\"}:\n LOGGER.warning(\"Control action requested: /actions/%s client=%s\", action, client_source)\n return await action_provider(action, client_source)\n\n return app\n\n def _client_source(self, request: Request) -> str:\n explicit_header = request.headers.get(\"X-Client-Source\", \"\").strip()\n if explicit_header:\n return explicit_header\n user_agent = request.headers.get(\"User-Agent\", \"\").strip()\n if user_agent:\n return f\"user-agent:{user_agent}\"\n return \"unknown\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/http_app.py:HttpControlAppFactory", - "span_start": 15, - "span_end": 53, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.http_app", - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "retrieval_report": { - "executed_layers": [ - "C3_ENTRYPOINTS", - "C0_SOURCE_CHUNKS" - ], - "retrieval_mode_by_layer": { - "C3_ENTRYPOINTS": "vector", - "C0_SOURCE_CHUNKS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C3_ENTRYPOINTS": 12, - "C0_SOURCE_CHUNKS": 24 - }, - "filters_by_layer": { - "C3_ENTRYPOINTS": { - "path_scope": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src/app_runtime/control/http_app.py" - ] - } - }, - "fallback": { - "used": false, - "reason": null - }, - "retrieval_by_layer_ms": { - "C3_ENTRYPOINTS": 34, - "C0_SOURCE_CHUNKS": 15 - }, - "supplemental_requests": [ - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Где health endpoint?", - "ranking_profile": "entrypoint_source_hydration" - } - ] - } - }, - "diagnostics": { - "intent_correct": null, - "target_found": true, - "layers_used": [ - "C3_ENTRYPOINTS", - "C0_SOURCE_CHUNKS" - ], - "retrieval_sufficient": true, - "answer_mode": "normal", - "resolved_target": "src/app_runtime/control/http_app.py", - "answer_policy_branch": "normal_answer", - "decision_reason": "evidence_sufficient", - "router_result": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "retrieval_profile": "code", - "sub_intent": "FIND_ENTRYPOINTS", - "path_scope": [], - "layers": [ - "C3_ENTRYPOINTS", - "C0_SOURCE_CHUNKS" - ], - "symbol_resolution_status": "not_found" - }, - "retrieval_request": { - "rag_session_id": "7d11da21-faa0-4cea-aede-aeabe069164c", - "query": "Где health endpoint?", - "sub_intent": "FIND_ENTRYPOINTS", - "path_scope": [], - "requested_layers": [ - "C3_ENTRYPOINTS", - "C0_SOURCE_CHUNKS" - ] - }, - "per_layer_outcome": [ - { - "layer_id": "C3_ENTRYPOINTS", - "hit_count": 3, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C0_SOURCE_CHUNKS", - "hit_count": 7, - "empty": false, - "fallback_used": false - } - ], - "empty_layers": [], - "evidence_gate_decision": { - "sufficient": true, - "failure_reasons": [], - "evidence_count": 10 - }, - "evidence_gate_input": { - "resolved_target": "src/app_runtime/control/http_app.py", - "sub_intent": "FIND_ENTRYPOINTS", - "target_type": "file", - "evidence_count": 10, - "code_chunk_count": 10, - "entrypoint_count": 3, - "relation_count": 0, - "test_evidence_count": 0, - "symbol_resolution_status": "not_found", - "path_scope": [] - }, - "post_evidence_gate": { - "input": { - "answer_mode": "normal", - "degraded_message": "", - "resolved_target": "src/app_runtime/control/http_app.py", - "draft_answer_preview": "Подтверждённая точка входа для health endpoint:\nGET /health, declared in src/app_runtime/control/http_app.py, lines 31-34, handler function named 'health'.", - "repair_candidate": true - }, - "output": { - "passed": true, - "action": "return", - "reasons": [], - "repair_used": false, - "final_answer_preview": "Подтверждённая точка входа для health endpoint:\nGET /health, declared in src/app_runtime/control/http_app.py, lines 31-34, handler function named 'health'." - } - }, - "failure_reasons": [], - "timings_ms": { - "router": 1, - "retrieval": 56, - "pre_evidence_gate": 1, - "llm": 1462, - "post_evidence_gate": 1 - } - }, - "rag_rows": [ - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/health/registry.py", - "content": "class HealthRegistry:\n def __init__(self) -> None:\n self._contributors: list[HealthContributor] = []\n\n def register(self, contributor: HealthContributor) -> None:\n self._contributors.append(contributor)\n\n def contributor_healths(self) -> list[WorkerHealth]:\n return [contributor.health() for contributor in self._contributors]\n\n def snapshot(self, worker_healths: list[WorkerHealth]) -> dict[str, object]:\n component_healths = worker_healths + self.contributor_healths()\n return {\n \"status\": self._aggregate_status(component_healths),\n \"components\": [self._health_dict(item) for item in component_healths],\n }\n\n def payload(self, state: LifecycleState, worker_healths: list[WorkerHealth]) -> HealthPayload:\n component_healths = worker_healths + self.contributor_healths()\n if state == LifecycleState.STOPPED:\n return {\"status\": \"unhealthy\", \"detail\": \"state=stopped\", \"state\": state.value}\n if state in {LifecycleState.STARTING, LifecycleState.STOPPING}:\n return {\n \"status\": \"degraded\",\n \"detail\": f\"state={state.value}\",\n \"state\": state.value,\n \"components\": [self._health_dict(item) for item in component_healths],\n }\n return {\n \"status\": self._aggregate_status(component_healths),\n \"state\": state.value,\n \"components\": [self._health_dict(item) for item in component_healths],\n }\n\n def _aggregate_status(self, component_healths: list[WorkerHealth]) -> str:\n if any(item.status == \"unhealthy\" and item.critical for item in component_healths):\n return \"unhealthy\"\n if any(item.status in {\"degraded\", \"unhealthy\"} for item in component_healths):\n return \"degraded\"\n return \"ok\"\n\n def _health_dict(self, health: WorkerHealth) -> dict[str, object]:\n return {\n \"name\": health.name,\n \"status\": health.status,\n \"critical\": health.critical,\n \"detail\": health.detail,\n \"meta\": health.meta,\n }", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/health/registry.py:HealthRegistry", - "span_start": 8, - "span_end": 56, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.health.registry", - "is_test": false, - "blob_sha": "26e6a24daa43407ba5340b74497c20153020e79f8d7828ae502aaec378dfcf75", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/health.py", - "content": "from app_runtime.health.registry import HealthRegistry\n\n__all__ = [\"HealthRegistry\"]", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/health/__init__.py:1-3", - "span_start": 1, - "span_end": 3, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.app_runtime.health.__init__", - "is_test": false, - "blob_sha": "f7b15eed8b1f1cca8dfd467909a2612d8cb4e66e46b972ad89a0c9459ce283a0", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/contracts/health.py", - "content": "class HealthContributor(ABC):\n @abstractmethod\n def health(self) -> WorkerHealth:\n \"\"\"Return contributor health state.\"\"\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/contracts/health.py:HealthContributor", - "span_start": 7, - "span_end": 10, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.contracts.health", - "is_test": false, - "blob_sha": "6bd92611def7131e32d4dd34a8ed85e6cf3c67722ad27797032a632cb30dc097", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/health/__init__.py", - "content": "from app_runtime.health.registry import HealthRegistry\n\n__all__ = [\"HealthRegistry\"]", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/health/__init__.py:1-3", - "span_start": 1, - "span_end": 3, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.app_runtime.health.__init__", - "is_test": false, - "blob_sha": "f7b15eed8b1f1cca8dfd467909a2612d8cb4e66e46b972ad89a0c9459ce283a0", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/contracts/worker.py", - "content": "class WorkerHealth:\n name: str\n status: HealthState\n critical: bool\n detail: str | None = None\n meta: dict[str, Any] = field(default_factory=dict)", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/contracts/worker.py:WorkerHealth", - "span_start": 13, - "span_end": 18, - "lexical_rank": 6, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.contracts.worker", - "is_test": false, - "blob_sha": "e4827d32220f322d8adc3e42769da3ca0cc680db6a5eab7a11f4d8773a75304e", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/contracts/worker.py", - "content": "class Worker(ABC):\n @property\n @abstractmethod\n def name(self) -> str:\n \"\"\"Stable worker name for diagnostics.\"\"\"\n\n @property\n @abstractmethod\n def critical(self) -> bool:\n \"\"\"Whether this worker is required for healthy app operation.\"\"\"\n\n @abstractmethod\n def start(self) -> None:\n \"\"\"Start worker execution.\"\"\"\n\n @abstractmethod\n def stop(self, force: bool = False) -> None:\n \"\"\"Request graceful or immediate stop.\"\"\"\n\n @abstractmethod\n def health(self) -> WorkerHealth:\n \"\"\"Return current health state.\"\"\"\n\n @abstractmethod\n def status(self) -> WorkerStatus:\n \"\"\"Return current runtime status.\"\"\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/contracts/worker.py:Worker", - "span_start": 30, - "span_end": 55, - "lexical_rank": 6, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 2, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.contracts.worker", - "is_test": false, - "blob_sha": "e4827d32220f322d8adc3e42769da3ca0cc680db6a5eab7a11f4d8773a75304e", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "class HttpControlAppFactory:\n def create(\n self,\n health_provider: Callable[[], Awaitable[HealthPayload]],\n action_provider: Callable[[str, str], Awaitable[JSONResponse]],\n ) -> FastAPI:\n app = FastAPI(title=\"PLBA Control API\")\n\n @app.middleware(\"http\")\n async def log_api_call(request: Request, call_next): # type: ignore[no-untyped-def]\n started = time.monotonic()\n response = await call_next(request)\n response.headers[\"X-Response-Time-Ms\"] = str(int((time.monotonic() - started) * 1000))\n return response\n\n @app.get(\"/health\")\n async def health() -> JSONResponse:\n payload = await health_provider()\n status_code = 200 if payload.get(\"status\") == \"ok\" else 503\n return JSONResponse(content=payload, status_code=status_code)\n\n @app.get(\"/actions/{action}\")\n @app.post(\"/actions/{action}\")\n async def action(action: str, request: Request) -> JSONResponse:\n client_source = self._client_source(request)\n if action in {\"start\", \"stop\"}:\n LOGGER.warning(\"Control action requested: /actions/%s client=%s\", action, client_source)\n return await action_provider(action, client_source)\n\n return app\n\n def _client_source(self, request: Request) -> str:\n explicit_header = request.headers.get(\"X-Client-Source\", \"\").strip()\n if explicit_header:\n return explicit_header\n user_agent = request.headers.get(\"User-Agent\", \"\").strip()\n if user_agent:\n return f\"user-agent:{user_agent}\"\n return \"unknown\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/http_app.py:HttpControlAppFactory", - "span_start": 15, - "span_end": 53, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.http_app", - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "validation": { - "passed": true, - "action": "return", - "reasons": [] - }, - "steps": [ - { - "step": "router", - "status": "completed", - "timings_ms": { - "router": 1 - }, - "output": { - "intent": "CODE_QA", - "sub_intent": "FIND_ENTRYPOINTS", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - } - }, - { - "step": "retrieval", - "status": "completed", - "timings_ms": { - "retrieval": 56 - }, - "output": { - "rag_count": 10, - "answer_path_rag_count": 10, - "resolved_symbol_status": "not_found", - "resolved_symbol": null, - "requested_layers": [ - "C3_ENTRYPOINTS", - "C0_SOURCE_CHUNKS" - ] - }, - "diagnostics": { - "executed_layers": [ - "C3_ENTRYPOINTS", - "C0_SOURCE_CHUNKS" - ], - "retrieval_mode_by_layer": { - "C3_ENTRYPOINTS": "vector", - "C0_SOURCE_CHUNKS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C3_ENTRYPOINTS": 12, - "C0_SOURCE_CHUNKS": 24 - }, - "filters_by_layer": { - "C3_ENTRYPOINTS": { - "path_scope": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src/app_runtime/control/http_app.py" - ] - } - }, - "fallback": { - "used": false, - "reason": null - }, - "retrieval_by_layer_ms": { - "C3_ENTRYPOINTS": 34, - "C0_SOURCE_CHUNKS": 15 - }, - "supplemental_requests": [ - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Где health endpoint?", - "ranking_profile": "entrypoint_source_hydration" - } - ] - } - }, - { - "step": "pre_evidence_gate", - "status": "passed", - "timings_ms": { - "pre_evidence_gate": 1 - }, - "input": { - "resolved_target": "src/app_runtime/control/http_app.py", - "sub_intent": "FIND_ENTRYPOINTS", - "target_type": "file", - "evidence_count": 10, - "code_chunk_count": 10, - "entrypoint_count": 3, - "relation_count": 0, - "test_evidence_count": 0, - "symbol_resolution_status": "not_found", - "path_scope": [] - }, - "output": { - "passed": true, - "failure_reasons": [], - "degraded_message": "", - "evidence_count": 10 - } - }, - { - "step": "llm", - "status": "completed", - "timings_ms": { - "llm": 1462 - }, - "output": { - "prompt_name": "code_qa_find_entrypoints_answer", - "answer_preview": "Подтверждённая точка входа для health endpoint:\nGET /health, declared in src/app_runtime/control/http_app.py, lines 31-34, handler function named 'health'.", - "resolved_target": "src/app_runtime/control/http_app.py", - "answer_policy_branch": "normal_answer", - "decision_reason": "evidence_sufficient" - } - }, - { - "step": "post_evidence_gate", - "status": "passed", - "timings_ms": { - "post_evidence_gate": 1, - "post_evidence_gate_recheck": 0, - "repair": 0 - }, - "input": { - "answer_mode": "normal", - "degraded_message": "", - "resolved_target": "src/app_runtime/control/http_app.py", - "draft_answer_preview": "Подтверждённая точка входа для health endpoint:\nGET /health, declared in src/app_runtime/control/http_app.py, lines 31-34, handler function named 'health'.", - "repair_candidate": true - }, - "output": { - "passed": true, - "action": "return", - "reasons": [], - "repair_used": false, - "final_answer_preview": "Подтверждённая точка входа для health endpoint:\nGET /health, declared in src/app_runtime/control/http_app.py, lines 31-34, handler function named 'health'." - } - } - ] - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/plba_full_chain_subintents_v3/20260312_174008/full_chain_plba_code_subintents_v2_plba-v2-find-entrypoints-health-endpoint.md b/tests/pipeline_setup_v3/test_results/plba_full_chain_subintents_v3/20260312_174008/full_chain_plba_code_subintents_v2_plba-v2-find-entrypoints-health-endpoint.md deleted file mode 100644 index 4b489c1..0000000 --- a/tests/pipeline_setup_v3/test_results/plba_full_chain_subintents_v3/20260312_174008/full_chain_plba_code_subintents_v2_plba-v2-find-entrypoints-health-endpoint.md +++ /dev/null @@ -1,261 +0,0 @@ -# plba-v2-find-entrypoints-health-endpoint - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_02_pipeline/full_chain_plba_code_subintents_v2.yaml -- runner: agent_runtime -- mode: full_chain -- passed: True - -## Query -Где health endpoint? - -## Actual -{ - "intent": "CODE_QA", - "sub_intent": "FIND_ENTRYPOINTS", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 10, - "llm_answer": "Подтверждённая точка входа для health endpoint:\nGET /health, declared in src/app_runtime/control/http_app.py, lines 31-34, handler function named 'health'.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "health", - "endpoint" - ], - "layers": [ - "C3_ENTRYPOINTS", - "C0_SOURCE_CHUNKS" - ] -} - -## Steps -[ - { - "step": "router", - "status": "completed", - "timings_ms": { - "router": 1 - }, - "output": { - "intent": "CODE_QA", - "sub_intent": "FIND_ENTRYPOINTS", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - } - }, - { - "step": "retrieval", - "status": "completed", - "timings_ms": { - "retrieval": 56 - }, - "output": { - "rag_count": 10, - "answer_path_rag_count": 10, - "resolved_symbol_status": "not_found", - "resolved_symbol": null, - "requested_layers": [ - "C3_ENTRYPOINTS", - "C0_SOURCE_CHUNKS" - ] - }, - "diagnostics": { - "executed_layers": [ - "C3_ENTRYPOINTS", - "C0_SOURCE_CHUNKS" - ], - "retrieval_mode_by_layer": { - "C3_ENTRYPOINTS": "vector", - "C0_SOURCE_CHUNKS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C3_ENTRYPOINTS": 12, - "C0_SOURCE_CHUNKS": 24 - }, - "filters_by_layer": { - "C3_ENTRYPOINTS": { - "path_scope": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src/app_runtime/control/http_app.py" - ] - } - }, - "fallback": { - "used": false, - "reason": null - }, - "retrieval_by_layer_ms": { - "C3_ENTRYPOINTS": 34, - "C0_SOURCE_CHUNKS": 15 - }, - "supplemental_requests": [ - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Где health endpoint?", - "ranking_profile": "entrypoint_source_hydration" - } - ] - } - }, - { - "step": "pre_evidence_gate", - "status": "passed", - "timings_ms": { - "pre_evidence_gate": 1 - }, - "input": { - "resolved_target": "src/app_runtime/control/http_app.py", - "sub_intent": "FIND_ENTRYPOINTS", - "target_type": "file", - "evidence_count": 10, - "code_chunk_count": 10, - "entrypoint_count": 3, - "relation_count": 0, - "test_evidence_count": 0, - "symbol_resolution_status": "not_found", - "path_scope": [] - }, - "output": { - "passed": true, - "failure_reasons": [], - "degraded_message": "", - "evidence_count": 10 - } - }, - { - "step": "llm", - "status": "completed", - "timings_ms": { - "llm": 1462 - }, - "output": { - "prompt_name": "code_qa_find_entrypoints_answer", - "answer_preview": "Подтверждённая точка входа для health endpoint:\nGET /health, declared in src/app_runtime/control/http_app.py, lines 31-34, handler function named 'health'.", - "resolved_target": "src/app_runtime/control/http_app.py", - "answer_policy_branch": "normal_answer", - "decision_reason": "evidence_sufficient" - } - }, - { - "step": "post_evidence_gate", - "status": "passed", - "timings_ms": { - "post_evidence_gate": 1, - "post_evidence_gate_recheck": 0, - "repair": 0 - }, - "input": { - "answer_mode": "normal", - "degraded_message": "", - "resolved_target": "src/app_runtime/control/http_app.py", - "draft_answer_preview": "Подтверждённая точка входа для health endpoint:\nGET /health, declared in src/app_runtime/control/http_app.py, lines 31-34, handler function named 'health'.", - "repair_candidate": true - }, - "output": { - "passed": true, - "action": "return", - "reasons": [], - "repair_used": false, - "final_answer_preview": "Подтверждённая точка входа для health endpoint:\nGET /health, declared in src/app_runtime/control/http_app.py, lines 31-34, handler function named 'health'." - } - } -] - -## Diagnostics -{ - "intent_correct": null, - "target_found": true, - "layers_used": [ - "C3_ENTRYPOINTS", - "C0_SOURCE_CHUNKS" - ], - "retrieval_sufficient": true, - "answer_mode": "normal", - "resolved_target": "src/app_runtime/control/http_app.py", - "answer_policy_branch": "normal_answer", - "decision_reason": "evidence_sufficient", - "router_result": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "retrieval_profile": "code", - "sub_intent": "FIND_ENTRYPOINTS", - "path_scope": [], - "layers": [ - "C3_ENTRYPOINTS", - "C0_SOURCE_CHUNKS" - ], - "symbol_resolution_status": "not_found" - }, - "retrieval_request": { - "rag_session_id": "7d11da21-faa0-4cea-aede-aeabe069164c", - "query": "Где health endpoint?", - "sub_intent": "FIND_ENTRYPOINTS", - "path_scope": [], - "requested_layers": [ - "C3_ENTRYPOINTS", - "C0_SOURCE_CHUNKS" - ] - }, - "per_layer_outcome": [ - { - "layer_id": "C3_ENTRYPOINTS", - "hit_count": 3, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C0_SOURCE_CHUNKS", - "hit_count": 7, - "empty": false, - "fallback_used": false - } - ], - "empty_layers": [], - "evidence_gate_decision": { - "sufficient": true, - "failure_reasons": [], - "evidence_count": 10 - }, - "evidence_gate_input": { - "resolved_target": "src/app_runtime/control/http_app.py", - "sub_intent": "FIND_ENTRYPOINTS", - "target_type": "file", - "evidence_count": 10, - "code_chunk_count": 10, - "entrypoint_count": 3, - "relation_count": 0, - "test_evidence_count": 0, - "symbol_resolution_status": "not_found", - "path_scope": [] - }, - "post_evidence_gate": { - "input": { - "answer_mode": "normal", - "degraded_message": "", - "resolved_target": "src/app_runtime/control/http_app.py", - "draft_answer_preview": "Подтверждённая точка входа для health endpoint:\nGET /health, declared in src/app_runtime/control/http_app.py, lines 31-34, handler function named 'health'.", - "repair_candidate": true - }, - "output": { - "passed": true, - "action": "return", - "reasons": [], - "repair_used": false, - "final_answer_preview": "Подтверждённая точка входа для health endpoint:\nGET /health, declared in src/app_runtime/control/http_app.py, lines 31-34, handler function named 'health'." - } - }, - "failure_reasons": [], - "timings_ms": { - "router": 1, - "retrieval": 56, - "pre_evidence_gate": 1, - "llm": 1462, - "post_evidence_gate": 1 - } -} - -## Mismatches -- none \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/plba_full_chain_subintents_v3/20260312_174008/full_chain_plba_code_subintents_v2_plba-v2-find-tests-create-runtime.json b/tests/pipeline_setup_v3/test_results/plba_full_chain_subintents_v3/20260312_174008/full_chain_plba_code_subintents_v2_plba-v2-find-tests-create-runtime.json deleted file mode 100644 index 000671e..0000000 --- a/tests/pipeline_setup_v3/test_results/plba_full_chain_subintents_v3/20260312_174008/full_chain_plba_code_subintents_v2_plba-v2-find-tests-create-runtime.json +++ /dev/null @@ -1,2919 +0,0 @@ -{ - "case_id": "plba-v2-find-tests-create-runtime", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_02_pipeline/full_chain_plba_code_subintents_v2.yaml", - "runner": "agent_runtime", - "mode": "full_chain", - "query": "Где тесты для create_runtime?", - "actual": { - "intent": "CODE_QA", - "sub_intent": "FIND_TESTS", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 24, - "llm_answer": "Прямые тесты для `create_runtime` не найдены.\n\nБлижайший косвенный тест:\n- `tests/test_runtime.py::test_public_plba_package_exports_runtime_builder_and_worker_contract`\n - Проверяет экспорт пакета plba и доступность создания runtime, включая `create_runtime`.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "create_runtime" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ] - }, - "passed": true, - "mismatches": [], - "details": { - "query": "Где тесты для create_runtime?", - "router_result": { - "schema_version": "1.1", - "intent": "CODE_QA", - "retrieval_profile": "code", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query_plan": { - "raw": "Где тесты для create_runtime?", - "normalized": "Где тесты для create_runtime?", - "sub_intent": "FIND_TESTS", - "negations": [], - "expansions": [ - "test", - "unit test", - "create_runtime" - ], - "keyword_hints": [ - "create_runtime" - ], - "path_hints": [], - "doc_scope_hints": [], - "symbol_candidates": [ - "create_runtime" - ], - "symbol_kind_hint": "function", - "anchors": [ - { - "type": "SYMBOL", - "value": "create_runtime", - "source": "user_text", - "subtype": null, - "span": { - "start": 14, - "end": 28 - }, - "confidence": 0.88 - }, - { - "type": "KEY_TERM", - "value": "тест", - "source": "user_text", - "subtype": null, - "span": { - "start": 4, - "end": 9 - }, - "confidence": 0.9 - } - ] - }, - "retrieval_spec": { - "domains": [ - "CODE" - ], - "layer_queries": [ - { - "layer_id": "C1_SYMBOL_CATALOG", - "top_k": 8 - }, - { - "layer_id": "C2_DEPENDENCY_GRAPH", - "top_k": 6 - }, - { - "layer_id": "C0_SOURCE_CHUNKS", - "top_k": 10 - } - ], - "filters": { - "test_policy": "INCLUDE", - "path_scope": [], - "language": [ - "python" - ] - }, - "rerank_profile": "code" - }, - "retrieval_constraints": { - "include_globs": [ - "src/**", - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "test_file_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "test_symbol_patterns": [ - "test_create_runtime", - "Testcreate_runtime", - "create_runtime" - ], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - }, - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "create_runtime", - "alternatives": [ - "create_runtime", - "create_runtime", - "FileConfigProvider", - "hashlib", - "json" - ], - "confidence": 0.99 - }, - "evidence_policy": { - "require_def": true, - "require_flow": true, - "require_spec": false, - "allow_answer_without_evidence": false - } - }, - "retrieval_request": { - "rag_session_id": "7d11da21-faa0-4cea-aede-aeabe069164c", - "query": "Где тесты для create_runtime?", - "sub_intent": "FIND_TESTS", - "path_scope": [], - "keyword_hints": [ - "create_runtime" - ], - "symbol_candidates": [ - "create_runtime" - ], - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ], - "retrieval_spec": { - "domains": [ - "CODE" - ], - "layer_queries": [ - { - "layer_id": "C1_SYMBOL_CATALOG", - "top_k": 8 - }, - { - "layer_id": "C2_DEPENDENCY_GRAPH", - "top_k": 6 - }, - { - "layer_id": "C0_SOURCE_CHUNKS", - "top_k": 10 - } - ], - "filters": { - "test_policy": "INCLUDE", - "path_scope": [], - "language": [ - "python" - ] - }, - "rerank_profile": "code" - }, - "retrieval_constraints": { - "include_globs": [ - "src/**", - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "test_file_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "test_symbol_patterns": [ - "test_create_runtime", - "Testcreate_runtime", - "create_runtime" - ], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - }, - "query_plan": { - "raw": "Где тесты для create_runtime?", - "normalized": "Где тесты для create_runtime?", - "sub_intent": "FIND_TESTS", - "negations": [], - "expansions": [ - "test", - "unit test", - "create_runtime" - ], - "keyword_hints": [ - "create_runtime" - ], - "path_hints": [], - "doc_scope_hints": [], - "symbol_candidates": [ - "create_runtime" - ], - "symbol_kind_hint": "function", - "anchors": [ - { - "type": "SYMBOL", - "value": "create_runtime", - "source": "user_text", - "subtype": null, - "span": { - "start": 14, - "end": 28 - }, - "confidence": 0.88 - }, - { - "type": "KEY_TERM", - "value": "тест", - "source": "user_text", - "subtype": null, - "span": { - "start": 4, - "end": 9 - }, - "confidence": 0.9 - } - ] - } - }, - "retrieval_result": { - "target_symbol_candidates": [ - "create_runtime", - "FileConfigProvider", - "hashlib", - "json", - "Path", - "Any", - "annotations" - ], - "resolved_symbol": "create_runtime", - "symbol_resolution_status": "resolved", - "file_candidates": [ - "src/plba/__init__.py", - "src/plba/bootstrap.py", - "src/app_runtime/config/__init__.py", - "src/app_runtime/config/file_loader.py", - "tests/test_runtime.py", - "src/app_runtime/config/providers.py", - "src/app_runtime/contracts/__init__.py", - "src/app_runtime/contracts/config.py", - "src/app_runtime/contracts/health.py", - "src/app_runtime/contracts/application.py" - ], - "code_chunks": [ - { - "layer": "C1_SYMBOL_CATALOG", - "path": "src/plba/__init__.py", - "title": "create_runtime", - "content": "const create_runtime\ncreate_runtime = plba.bootstrap.create_runtime", - "start_line": 1, - "end_line": 1, - "metadata": { - "symbol_id": "fa1e84f16c8c659bcd5448637386af4d15d431064e07714e34689ee64233cb51", - "qname": "create_runtime", - "kind": "const", - "signature": "create_runtime = plba.bootstrap.create_runtime", - "parent_symbol_id": null, - "package_or_module": "src.plba.__init__", - "is_test": false, - "blob_sha": "24e755ec8c249d14fb0e675b5dbf2b71ab91afb9c849897eebfa9feb2499e19d", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C1_SYMBOL_CATALOG", - "path": "src/plba/bootstrap.py", - "title": "create_runtime", - "content": "function create_runtime\ncreate_runtime(module)", - "start_line": 8, - "end_line": 29, - "metadata": { - "symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "qname": "create_runtime", - "kind": "function", - "signature": "create_runtime(module)", - "parent_symbol_id": null, - "package_or_module": "src.plba.bootstrap", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C1_SYMBOL_CATALOG", - "path": "src/app_runtime/config/__init__.py", - "title": "FileConfigProvider", - "content": "const FileConfigProvider\nFileConfigProvider = app_runtime.config.providers.FileConfigProvider", - "start_line": 2, - "end_line": 2, - "metadata": { - "symbol_id": "e449b19e5881889adeb6e056eafe1da30acbae864f06984ea2edc7c15f7cb6d6", - "qname": "FileConfigProvider", - "kind": "const", - "signature": "FileConfigProvider = app_runtime.config.providers.FileConfigProvider", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.config.__init__", - "is_test": false, - "blob_sha": "612918029820a2a983330ec92256142b55b9de4bdf3399ece18e2a02dbad9729", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C1_SYMBOL_CATALOG", - "path": "src/app_runtime/config/file_loader.py", - "title": "hashlib", - "content": "const hashlib\nimport hashlib", - "start_line": 3, - "end_line": 3, - "metadata": { - "symbol_id": "e7375824bd473da3d73d316d22e3cb6428930e2db1ffbd900ce5a8b88427bf05", - "qname": "hashlib", - "kind": "const", - "signature": "import hashlib", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.config.file_loader", - "is_test": false, - "blob_sha": "1f19ffebde5e38e4be5a5d5a678059a0f36dedb8fb8b3e00ab395c67106a87ea", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C1_SYMBOL_CATALOG", - "path": "src/app_runtime/config/file_loader.py", - "title": "json", - "content": "const json\nimport json", - "start_line": 4, - "end_line": 4, - "metadata": { - "symbol_id": "bb9e2eaf992bfd050f7072d72eed87c55b1a4b001daa034a0f7c630a61bb1d78", - "qname": "json", - "kind": "const", - "signature": "import json", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.config.file_loader", - "is_test": false, - "blob_sha": "1f19ffebde5e38e4be5a5d5a678059a0f36dedb8fb8b3e00ab395c67106a87ea", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C1_SYMBOL_CATALOG", - "path": "src/app_runtime/config/file_loader.py", - "title": "Path", - "content": "const Path\nPath = pathlib.Path", - "start_line": 5, - "end_line": 5, - "metadata": { - "symbol_id": "b785967ed1fb83aa62d5724c6d6e9c6d2b1505523db39bd941cc39b48db48306", - "qname": "Path", - "kind": "const", - "signature": "Path = pathlib.Path", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.config.file_loader", - "is_test": false, - "blob_sha": "1f19ffebde5e38e4be5a5d5a678059a0f36dedb8fb8b3e00ab395c67106a87ea", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C1_SYMBOL_CATALOG", - "path": "src/app_runtime/config/file_loader.py", - "title": "Any", - "content": "const Any\nAny = typing.Any", - "start_line": 6, - "end_line": 6, - "metadata": { - "symbol_id": "8e330833b8073585db1c4b4315947c400683a23e4c3d2e2ccbcb260f347541b6", - "qname": "Any", - "kind": "const", - "signature": "Any = typing.Any", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.config.file_loader", - "is_test": false, - "blob_sha": "1f19ffebde5e38e4be5a5d5a678059a0f36dedb8fb8b3e00ab395c67106a87ea", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C1_SYMBOL_CATALOG", - "path": "src/app_runtime/config/file_loader.py", - "title": "annotations", - "content": "const annotations\nannotations = __future__.annotations", - "start_line": 1, - "end_line": 1, - "metadata": { - "symbol_id": "5ed640ccec43a78659d50ec24f3717bf1144a182c22588f37456649ac6a4a815", - "qname": "annotations", - "kind": "const", - "signature": "annotations = __future__.annotations", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.config.file_loader", - "is_test": false, - "blob_sha": "1f19ffebde5e38e4be5a5d5a678059a0f36dedb8fb8b3e00ab395c67106a87ea", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "path": "src/plba/bootstrap.py", - "title": "create_runtime:calls", - "content": "create_runtime calls runtime.add_config_file", - "start_line": 19, - "end_line": 19, - "metadata": { - "edge_id": "4eaeec4ac55a59d5f66fd01c4754955f8fedaf4bc3df13fa769b352c7bfaacbb", - "edge_type": "calls", - "src_symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "src_qname": "create_runtime", - "dst_symbol_id": null, - "dst_ref": "runtime.add_config_file", - "resolution": "partial", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "path": "src/plba/bootstrap.py", - "title": "create_runtime:reads_attr", - "content": "create_runtime reads_attr runtime.register_module", - "start_line": 28, - "end_line": 28, - "metadata": { - "edge_id": "45516c79ff358dbf9b650a081668df0f66d2fe989300f985a1a78be6be166f8f", - "edge_type": "reads_attr", - "src_symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "src_qname": "create_runtime", - "dst_symbol_id": null, - "dst_ref": "runtime.register_module", - "resolution": "partial", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "path": "src/plba/bootstrap.py", - "title": "create_runtime:instantiates", - "content": "create_runtime instantiates RuntimeManager", - "start_line": 17, - "end_line": 17, - "metadata": { - "edge_id": "0adba17984f850ea1608c9e734d2dd5c325cfde3a8133123aa239e44935ad18e", - "edge_type": "instantiates", - "src_symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "src_qname": "create_runtime", - "dst_symbol_id": "27158ca220022eeb5083c6addf8a50775d45f7161284fd60aac48410105f4b98", - "dst_ref": "RuntimeManager", - "resolution": "resolved", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "path": "src/plba/bootstrap.py", - "title": "create_runtime:calls", - "content": "create_runtime calls runtime.register_module", - "start_line": 28, - "end_line": 28, - "metadata": { - "edge_id": "ab6003c3441addc1ba1b81edeca009165559f652f6b2cf424e5ae61b1f617de8", - "edge_type": "calls", - "src_symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "src_qname": "create_runtime", - "dst_symbol_id": null, - "dst_ref": "runtime.register_module", - "resolution": "partial", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "path": "src/plba/bootstrap.py", - "title": "create_runtime:calls", - "content": "create_runtime calls runtime.control_plane.register_channel", - "start_line": 21, - "end_line": 27, - "metadata": { - "edge_id": "2678250030b9ce47a3b3b55fac7897ac530367edc8374ac9d5e6ecafb1e483f0", - "edge_type": "calls", - "src_symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "src_qname": "create_runtime", - "dst_symbol_id": null, - "dst_ref": "runtime.control_plane.register_channel", - "resolution": "partial", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "path": "src/plba/bootstrap.py", - "title": "create_runtime:reads_attr", - "content": "create_runtime reads_attr runtime.add_config_file", - "start_line": 19, - "end_line": 19, - "metadata": { - "edge_id": "30d4e8aae984ab84d523e80d02f1caeda52d547fa3d2aa47be8845931cabbca2", - "edge_type": "reads_attr", - "src_symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "src_qname": "create_runtime", - "dst_symbol_id": null, - "dst_ref": "runtime.add_config_file", - "resolution": "partial", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C0_SOURCE_CHUNKS", - "path": "src/plba/__init__.py", - "title": "src/plba/__init__.py:1-69", - "content": "from plba.bootstrap import create_runtime\nfrom plba.config import ConfigFileLoader, FileConfigProvider\nfrom plba.control import ControlActionSet, ControlChannel, ControlPlaneService, HttpControlChannel\nfrom plba.contracts import (\n ApplicationModule,\n ConfigProvider,\n HealthContributor,\n TraceContext,\n TraceContextRecord,\n TraceLogMessage,\n TraceTransport,\n Worker,\n WorkerHealth,\n WorkerStatus,\n)\nfrom plba.core import ConfigurationManager, RuntimeManager, ServiceContainer\nfrom plba.health import HealthRegistry\nfrom plba.logging import LogManager\nfrom plba.queue import InMemoryTaskQueue\nfrom plba.tracing import MySqlTraceTransport, NoOpTraceTransport, TraceService\nfrom plba.workflow import (\n StepResult,\n WorkflowContext,\n WorkflowDefinition,\n WorkflowEngine,\n WorkflowEngineHooks,\n WorkflowNode,\n WorkflowRuntimeFactory,\n WorkflowStep,\n)\nfrom plba.workers import WorkerSupervisor\n\n__all__ = [\n \"ApplicationModule\",\n \"ConfigFileLoader\",\n \"ConfigProvider\",\n \"ConfigurationManager\",\n \"ControlActionSet\",\n \"ControlChannel\",\n \"ControlPlaneService\",\n \"create_runtime\",\n \"FileConfigProvider\",\n \"HealthContributor\",\n \"HealthRegistry\",\n \"HttpControlChannel\",\n \"InMemoryTaskQueue\",\n \"LogManager\",\n \"MySqlTraceTransport\",\n \"NoOpTraceTransport\",\n \"RuntimeManager\",\n \"ServiceContainer\",\n \"TraceContext\",\n \"TraceContextRecord\",\n \"TraceLogMessage\",\n \"TraceService\",\n \"TraceTransport\",\n \"StepResult\",\n \"Worker\",\n \"WorkerHealth\",\n \"WorkerStatus\",\n \"WorkflowContext\",\n \"WorkflowDefinition\",\n \"WorkflowEngine\",\n \"WorkflowEngineHooks\",\n \"WorkflowNode\",\n \"WorkflowRuntimeFactory\",\n \"WorkflowStep\",\n \"WorkerSupervisor\",\n]", - "start_line": 1, - "end_line": 69, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.plba.__init__", - "is_test": false, - "blob_sha": "24e755ec8c249d14fb0e675b5dbf2b71ab91afb9c849897eebfa9feb2499e19d", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C0_SOURCE_CHUNKS", - "path": "src/plba/bootstrap.py", - "title": "src/plba/bootstrap.py:create_runtime", - "content": "def create_runtime(\n module: ApplicationModule,\n *,\n config_path: str | None = None,\n enable_http_control: bool = False,\n control_host: str = \"127.0.0.1\",\n control_port: int = 8080,\n control_timeout: int = 5,\n) -> RuntimeManager:\n runtime = RuntimeManager()\n if config_path is not None:\n runtime.add_config_file(config_path)\n if enable_http_control:\n runtime.control_plane.register_channel(\n HttpControlChannel(\n host=control_host,\n port=control_port,\n timeout=control_timeout,\n )\n )\n runtime.register_module(module)\n return runtime", - "start_line": 8, - "end_line": 29, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.plba.bootstrap", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C0_SOURCE_CHUNKS", - "path": "tests/test_runtime.py", - "title": "tests/test_runtime.py:test_public_plba_package_exports_runtime_builder_and_worker_contract", - "content": "def test_public_plba_package_exports_runtime_builder_and_worker_contract(tmp_path) -> None:\n import plba\n from plba import ApplicationModule as PublicApplicationModule\n from plba import InMemoryTaskQueue\n from plba import Worker as PublicWorker\n from plba import WorkerHealth as PublicWorkerHealth\n from plba import WorkerStatus as PublicWorkerStatus\n from plba import create_runtime\n\n config_path = tmp_path / \"config.yml\"\n config_path.write_text(\"platform: {}\\n\", encoding=\"utf-8\")\n\n queue = InMemoryTaskQueue[int]()\n queue.put(2)\n assert queue.get(timeout=0.01) == 2\n queue.task_done()\n\n class PublicRoutine:\n def __init__(self) -> None:\n self.runs = 0\n\n def run(self) -> None:\n if self.runs == 0:\n self.runs += 1\n\n class PublicWorkerImpl(PublicWorker):\n def __init__(self, routine: PublicRoutine) -> None:\n self._inner = RoutineWorker(\"public-worker\", routine)\n\n @property\n def name(self) -> str:\n return self._inner.name\n\n @property\n def critical(self) -> bool:\n return self._inner.critical\n\n def start(self) -> None:\n self._inner.start()\n\n def stop(self, force: bool = False) -> None:\n self._inner.stop(force=force)\n\n def health(self) -> PublicWorkerHealth:\n return self._inner.health()\n\n def status(self) -> PublicWorkerStatus:\n return self._inner.status()\n\n class PublicExampleModule(PublicApplicationModule):\n @property\n def name(self) -> str:\n return \"public-example\"\n\n def register(self, registry: ModuleRegistry) -> None:\n registry.add_worker(PublicWorkerImpl(PublicRoutine()))\n\n runtime = create_runtime(PublicExampleModule(), config_path=str(config_path))\n runtime.start()\n sleep(0.2)\n assert runtime.configuration.get() == {\"platform\": {}}\n assert runtime.status()[\"workers\"][\"registered\"] == 1\n assert hasattr(plba, \"QueueWorker\") is False\n runtime.stop()", - "start_line": 342, - "end_line": 405, - "metadata": { - "chunk_index": 13, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_runtime", - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C0_SOURCE_CHUNKS", - "path": "src/app_runtime/config/__init__.py", - "title": "src/app_runtime/config/__init__.py:1-4", - "content": "from app_runtime.config.file_loader import ConfigFileLoader\nfrom app_runtime.config.providers import FileConfigProvider\n\n__all__ = [\"ConfigFileLoader\", \"FileConfigProvider\"]", - "start_line": 1, - "end_line": 4, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.app_runtime.config.__init__", - "is_test": false, - "blob_sha": "612918029820a2a983330ec92256142b55b9de4bdf3399ece18e2a02dbad9729", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C0_SOURCE_CHUNKS", - "path": "src/app_runtime/config/providers.py", - "title": "src/app_runtime/config/providers.py:FileConfigProvider", - "content": "class FileConfigProvider(ConfigProvider):\n def __init__(self, path: str | Path) -> None:\n self._loader = ConfigFileLoader(path)\n\n @property\n def loader(self) -> ConfigFileLoader:\n return self._loader\n\n def load(self) -> dict[str, Any]:\n config = self._loader.load_sync()\n if not isinstance(config, dict):\n raise TypeError(\"Config root must be a mapping\")\n return dict(config)", - "start_line": 10, - "end_line": 22, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.config.providers", - "is_test": false, - "blob_sha": "8c53ca0122d6df6c5763bca15e99434bb4daebd5a618b8fc927e9ae90b022e64", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C0_SOURCE_CHUNKS", - "path": "src/app_runtime/contracts/__init__.py", - "title": "src/app_runtime/__init__.py:1-1", - "content": "__all__: list[str] = []", - "start_line": 1, - "end_line": 1, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.app_runtime.__init__", - "is_test": false, - "blob_sha": "8eea9df4f6d7b38ca0e39ccc27b04700e3d08dbeec8046d613d22706d19985fa", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C0_SOURCE_CHUNKS", - "path": "src/app_runtime/config/file_loader.py", - "title": "src/app_runtime/config/file_loader.py:ConfigFileLoader", - "content": "class ConfigFileLoader:\n def __init__(self, path: str | Path) -> None:\n self.path = Path(path)\n self.config: Any = None\n self.last_valid_config: Any = None\n self._last_seen_hash: str | None = None\n\n def read_text(self) -> str:\n return self.path.read_text(encoding=\"utf-8\")\n\n def parse(self, data: str) -> Any:\n suffix = self.path.suffix.lower()\n if suffix in {\".yml\", \".yaml\"}:\n return yaml.safe_load(data)\n return json.loads(data)\n\n def load_sync(self) -> Any:\n data = self.read_text()\n parsed = self.parse(data)\n self.config = parsed\n self.last_valid_config = parsed\n self._last_seen_hash = self._calculate_hash(data)\n return parsed\n\n def load_if_changed(self) -> tuple[bool, Any]:\n data = self.read_text()\n current_hash = self._calculate_hash(data)\n if current_hash == self._last_seen_hash:\n return False, self.config\n parsed = self.parse(data)\n self.config = parsed\n self.last_valid_config = parsed\n self._last_seen_hash = current_hash\n return True, parsed\n\n @staticmethod\n def _calculate_hash(data: str) -> str:\n return hashlib.sha256(data.encode(\"utf-8\")).hexdigest()", - "start_line": 11, - "end_line": 48, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.config.file_loader", - "is_test": false, - "blob_sha": "1f19ffebde5e38e4be5a5d5a678059a0f36dedb8fb8b3e00ab395c67106a87ea", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C0_SOURCE_CHUNKS", - "path": "src/app_runtime/contracts/config.py", - "title": "src/app_runtime/contracts/config.py:ConfigProvider", - "content": "class ConfigProvider(ABC):\n @abstractmethod\n def load(self) -> dict[str, Any]:\n \"\"\"Return a config fragment.\"\"\"", - "start_line": 7, - "end_line": 10, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.contracts.config", - "is_test": false, - "blob_sha": "5e773880267743ee94954ea2db120c2d88c54d4312893293d1b89df405283ed4", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C0_SOURCE_CHUNKS", - "path": "src/app_runtime/contracts/health.py", - "title": "src/app_runtime/contracts/health.py:HealthContributor", - "content": "class HealthContributor(ABC):\n @abstractmethod\n def health(self) -> WorkerHealth:\n \"\"\"Return contributor health state.\"\"\"", - "start_line": 7, - "end_line": 10, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.contracts.health", - "is_test": false, - "blob_sha": "6bd92611def7131e32d4dd34a8ed85e6cf3c67722ad27797032a632cb30dc097", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C0_SOURCE_CHUNKS", - "path": "src/app_runtime/contracts/application.py", - "title": "src/app_runtime/contracts/application.py:ApplicationModule", - "content": "class ApplicationModule(ABC):\n @property\n @abstractmethod\n def name(self) -> str:\n \"\"\"Module name used for runtime status and diagnostics.\"\"\"\n\n @abstractmethod\n def register(self, registry: ModuleRegistry) -> None:\n \"\"\"Register workers, services, and health contributors.\"\"\"", - "start_line": 8, - "end_line": 16, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.contracts.application", - "is_test": false, - "blob_sha": "197c35634dca49c352ce3f230295a485fbffb672ce7bb8c08e752bfdf61e7fa4", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "relations": [ - { - "path": "src/plba/bootstrap.py", - "metadata": { - "edge_id": "4eaeec4ac55a59d5f66fd01c4754955f8fedaf4bc3df13fa769b352c7bfaacbb", - "edge_type": "calls", - "src_symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "src_qname": "create_runtime", - "dst_symbol_id": null, - "dst_ref": "runtime.add_config_file", - "resolution": "partial", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - }, - "content": "create_runtime calls runtime.add_config_file" - }, - { - "path": "src/plba/bootstrap.py", - "metadata": { - "edge_id": "45516c79ff358dbf9b650a081668df0f66d2fe989300f985a1a78be6be166f8f", - "edge_type": "reads_attr", - "src_symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "src_qname": "create_runtime", - "dst_symbol_id": null, - "dst_ref": "runtime.register_module", - "resolution": "partial", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - }, - "content": "create_runtime reads_attr runtime.register_module" - }, - { - "path": "src/plba/bootstrap.py", - "metadata": { - "edge_id": "0adba17984f850ea1608c9e734d2dd5c325cfde3a8133123aa239e44935ad18e", - "edge_type": "instantiates", - "src_symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "src_qname": "create_runtime", - "dst_symbol_id": "27158ca220022eeb5083c6addf8a50775d45f7161284fd60aac48410105f4b98", - "dst_ref": "RuntimeManager", - "resolution": "resolved", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - }, - "content": "create_runtime instantiates RuntimeManager" - }, - { - "path": "src/plba/bootstrap.py", - "metadata": { - "edge_id": "ab6003c3441addc1ba1b81edeca009165559f652f6b2cf424e5ae61b1f617de8", - "edge_type": "calls", - "src_symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "src_qname": "create_runtime", - "dst_symbol_id": null, - "dst_ref": "runtime.register_module", - "resolution": "partial", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - }, - "content": "create_runtime calls runtime.register_module" - }, - { - "path": "src/plba/bootstrap.py", - "metadata": { - "edge_id": "2678250030b9ce47a3b3b55fac7897ac530367edc8374ac9d5e6ecafb1e483f0", - "edge_type": "calls", - "src_symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "src_qname": "create_runtime", - "dst_symbol_id": null, - "dst_ref": "runtime.control_plane.register_channel", - "resolution": "partial", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - }, - "content": "create_runtime calls runtime.control_plane.register_channel" - }, - { - "path": "src/plba/bootstrap.py", - "metadata": { - "edge_id": "30d4e8aae984ab84d523e80d02f1caeda52d547fa3d2aa47be8845931cabbca2", - "edge_type": "reads_attr", - "src_symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "src_qname": "create_runtime", - "dst_symbol_id": null, - "dst_ref": "runtime.add_config_file", - "resolution": "partial", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - }, - "content": "create_runtime reads_attr runtime.add_config_file" - } - ], - "entrypoints": [], - "test_candidates": [ - { - "path": "tests/test_runtime.py", - "title": "tests/test_runtime.py:test_public_plba_package_exports_runtime_builder_and_worker_contract", - "content": "def test_public_plba_package_exports_runtime_builder_and_worker_contract(tmp_path) -> None:\n import plba\n from plba import ApplicationModule as PublicApplicationModule\n from plba import InMemoryTaskQueue\n from plba import Worker as PublicWorker\n from plba import WorkerHealth as Public" - } - ], - "layer_outcomes": [ - { - "layer_id": "C1_SYMBOL_CATALOG", - "hit_count": 8, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C2_DEPENDENCY_GRAPH", - "hit_count": 6, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C0_SOURCE_CHUNKS", - "hit_count": 10, - "empty": false, - "fallback_used": false - } - ], - "missing_layers": [], - "raw_rows": [ - { - "path": "src/plba/__init__.py", - "content": "const create_runtime\ncreate_runtime = plba.bootstrap.create_runtime", - "layer": "C1_SYMBOL_CATALOG", - "title": "create_runtime", - "span_start": 1, - "span_end": 1, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": null, - "metadata": { - "symbol_id": "fa1e84f16c8c659bcd5448637386af4d15d431064e07714e34689ee64233cb51", - "qname": "create_runtime", - "kind": "const", - "signature": "create_runtime = plba.bootstrap.create_runtime", - "parent_symbol_id": null, - "package_or_module": "src.plba.__init__", - "is_test": false, - "blob_sha": "24e755ec8c249d14fb0e675b5dbf2b71ab91afb9c849897eebfa9feb2499e19d", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/bootstrap.py", - "content": "function create_runtime\ncreate_runtime(module)", - "layer": "C1_SYMBOL_CATALOG", - "title": "create_runtime", - "span_start": 8, - "span_end": 29, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": null, - "metadata": { - "symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "qname": "create_runtime", - "kind": "function", - "signature": "create_runtime(module)", - "parent_symbol_id": null, - "package_or_module": "src.plba.bootstrap", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/config/__init__.py", - "content": "const FileConfigProvider\nFileConfigProvider = app_runtime.config.providers.FileConfigProvider", - "layer": "C1_SYMBOL_CATALOG", - "title": "FileConfigProvider", - "span_start": 2, - "span_end": 2, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": null, - "metadata": { - "symbol_id": "e449b19e5881889adeb6e056eafe1da30acbae864f06984ea2edc7c15f7cb6d6", - "qname": "FileConfigProvider", - "kind": "const", - "signature": "FileConfigProvider = app_runtime.config.providers.FileConfigProvider", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.config.__init__", - "is_test": false, - "blob_sha": "612918029820a2a983330ec92256142b55b9de4bdf3399ece18e2a02dbad9729", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/config/file_loader.py", - "content": "const hashlib\nimport hashlib", - "layer": "C1_SYMBOL_CATALOG", - "title": "hashlib", - "span_start": 3, - "span_end": 3, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": null, - "metadata": { - "symbol_id": "e7375824bd473da3d73d316d22e3cb6428930e2db1ffbd900ce5a8b88427bf05", - "qname": "hashlib", - "kind": "const", - "signature": "import hashlib", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.config.file_loader", - "is_test": false, - "blob_sha": "1f19ffebde5e38e4be5a5d5a678059a0f36dedb8fb8b3e00ab395c67106a87ea", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/config/file_loader.py", - "content": "const json\nimport json", - "layer": "C1_SYMBOL_CATALOG", - "title": "json", - "span_start": 4, - "span_end": 4, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": null, - "metadata": { - "symbol_id": "bb9e2eaf992bfd050f7072d72eed87c55b1a4b001daa034a0f7c630a61bb1d78", - "qname": "json", - "kind": "const", - "signature": "import json", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.config.file_loader", - "is_test": false, - "blob_sha": "1f19ffebde5e38e4be5a5d5a678059a0f36dedb8fb8b3e00ab395c67106a87ea", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/config/file_loader.py", - "content": "const Path\nPath = pathlib.Path", - "layer": "C1_SYMBOL_CATALOG", - "title": "Path", - "span_start": 5, - "span_end": 5, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": null, - "metadata": { - "symbol_id": "b785967ed1fb83aa62d5724c6d6e9c6d2b1505523db39bd941cc39b48db48306", - "qname": "Path", - "kind": "const", - "signature": "Path = pathlib.Path", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.config.file_loader", - "is_test": false, - "blob_sha": "1f19ffebde5e38e4be5a5d5a678059a0f36dedb8fb8b3e00ab395c67106a87ea", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/config/file_loader.py", - "content": "const Any\nAny = typing.Any", - "layer": "C1_SYMBOL_CATALOG", - "title": "Any", - "span_start": 6, - "span_end": 6, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": null, - "metadata": { - "symbol_id": "8e330833b8073585db1c4b4315947c400683a23e4c3d2e2ccbcb260f347541b6", - "qname": "Any", - "kind": "const", - "signature": "Any = typing.Any", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.config.file_loader", - "is_test": false, - "blob_sha": "1f19ffebde5e38e4be5a5d5a678059a0f36dedb8fb8b3e00ab395c67106a87ea", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/config/file_loader.py", - "content": "const annotations\nannotations = __future__.annotations", - "layer": "C1_SYMBOL_CATALOG", - "title": "annotations", - "span_start": 1, - "span_end": 1, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": null, - "metadata": { - "symbol_id": "5ed640ccec43a78659d50ec24f3717bf1144a182c22588f37456649ac6a4a815", - "qname": "annotations", - "kind": "const", - "signature": "annotations = __future__.annotations", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.config.file_loader", - "is_test": false, - "blob_sha": "1f19ffebde5e38e4be5a5d5a678059a0f36dedb8fb8b3e00ab395c67106a87ea", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/bootstrap.py", - "content": "create_runtime calls runtime.add_config_file", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "create_runtime:calls", - "span_start": 19, - "span_end": 19, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": null, - "metadata": { - "edge_id": "4eaeec4ac55a59d5f66fd01c4754955f8fedaf4bc3df13fa769b352c7bfaacbb", - "edge_type": "calls", - "src_symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "src_qname": "create_runtime", - "dst_symbol_id": null, - "dst_ref": "runtime.add_config_file", - "resolution": "partial", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/bootstrap.py", - "content": "create_runtime reads_attr runtime.register_module", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "create_runtime:reads_attr", - "span_start": 28, - "span_end": 28, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": null, - "metadata": { - "edge_id": "45516c79ff358dbf9b650a081668df0f66d2fe989300f985a1a78be6be166f8f", - "edge_type": "reads_attr", - "src_symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "src_qname": "create_runtime", - "dst_symbol_id": null, - "dst_ref": "runtime.register_module", - "resolution": "partial", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/bootstrap.py", - "content": "create_runtime instantiates RuntimeManager", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "create_runtime:instantiates", - "span_start": 17, - "span_end": 17, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": null, - "metadata": { - "edge_id": "0adba17984f850ea1608c9e734d2dd5c325cfde3a8133123aa239e44935ad18e", - "edge_type": "instantiates", - "src_symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "src_qname": "create_runtime", - "dst_symbol_id": "27158ca220022eeb5083c6addf8a50775d45f7161284fd60aac48410105f4b98", - "dst_ref": "RuntimeManager", - "resolution": "resolved", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/bootstrap.py", - "content": "create_runtime calls runtime.register_module", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "create_runtime:calls", - "span_start": 28, - "span_end": 28, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": null, - "metadata": { - "edge_id": "ab6003c3441addc1ba1b81edeca009165559f652f6b2cf424e5ae61b1f617de8", - "edge_type": "calls", - "src_symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "src_qname": "create_runtime", - "dst_symbol_id": null, - "dst_ref": "runtime.register_module", - "resolution": "partial", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/bootstrap.py", - "content": "create_runtime calls runtime.control_plane.register_channel", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "create_runtime:calls", - "span_start": 21, - "span_end": 27, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": null, - "metadata": { - "edge_id": "2678250030b9ce47a3b3b55fac7897ac530367edc8374ac9d5e6ecafb1e483f0", - "edge_type": "calls", - "src_symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "src_qname": "create_runtime", - "dst_symbol_id": null, - "dst_ref": "runtime.control_plane.register_channel", - "resolution": "partial", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/bootstrap.py", - "content": "create_runtime reads_attr runtime.add_config_file", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "create_runtime:reads_attr", - "span_start": 19, - "span_end": 19, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": null, - "metadata": { - "edge_id": "30d4e8aae984ab84d523e80d02f1caeda52d547fa3d2aa47be8845931cabbca2", - "edge_type": "reads_attr", - "src_symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "src_qname": "create_runtime", - "dst_symbol_id": null, - "dst_ref": "runtime.add_config_file", - "resolution": "partial", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/__init__.py", - "content": "from plba.bootstrap import create_runtime\nfrom plba.config import ConfigFileLoader, FileConfigProvider\nfrom plba.control import ControlActionSet, ControlChannel, ControlPlaneService, HttpControlChannel\nfrom plba.contracts import (\n ApplicationModule,\n ConfigProvider,\n HealthContributor,\n TraceContext,\n TraceContextRecord,\n TraceLogMessage,\n TraceTransport,\n Worker,\n WorkerHealth,\n WorkerStatus,\n)\nfrom plba.core import ConfigurationManager, RuntimeManager, ServiceContainer\nfrom plba.health import HealthRegistry\nfrom plba.logging import LogManager\nfrom plba.queue import InMemoryTaskQueue\nfrom plba.tracing import MySqlTraceTransport, NoOpTraceTransport, TraceService\nfrom plba.workflow import (\n StepResult,\n WorkflowContext,\n WorkflowDefinition,\n WorkflowEngine,\n WorkflowEngineHooks,\n WorkflowNode,\n WorkflowRuntimeFactory,\n WorkflowStep,\n)\nfrom plba.workers import WorkerSupervisor\n\n__all__ = [\n \"ApplicationModule\",\n \"ConfigFileLoader\",\n \"ConfigProvider\",\n \"ConfigurationManager\",\n \"ControlActionSet\",\n \"ControlChannel\",\n \"ControlPlaneService\",\n \"create_runtime\",\n \"FileConfigProvider\",\n \"HealthContributor\",\n \"HealthRegistry\",\n \"HttpControlChannel\",\n \"InMemoryTaskQueue\",\n \"LogManager\",\n \"MySqlTraceTransport\",\n \"NoOpTraceTransport\",\n \"RuntimeManager\",\n \"ServiceContainer\",\n \"TraceContext\",\n \"TraceContextRecord\",\n \"TraceLogMessage\",\n \"TraceService\",\n \"TraceTransport\",\n \"StepResult\",\n \"Worker\",\n \"WorkerHealth\",\n \"WorkerStatus\",\n \"WorkflowContext\",\n \"WorkflowDefinition\",\n \"WorkflowEngine\",\n \"WorkflowEngineHooks\",\n \"WorkflowNode\",\n \"WorkflowRuntimeFactory\",\n \"WorkflowStep\",\n \"WorkerSupervisor\",\n]", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/plba/__init__.py:1-69", - "span_start": 1, - "span_end": 69, - "lexical_rank": 6, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": null, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.plba.__init__", - "is_test": false, - "blob_sha": "24e755ec8c249d14fb0e675b5dbf2b71ab91afb9c849897eebfa9feb2499e19d", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/bootstrap.py", - "content": "def create_runtime(\n module: ApplicationModule,\n *,\n config_path: str | None = None,\n enable_http_control: bool = False,\n control_host: str = \"127.0.0.1\",\n control_port: int = 8080,\n control_timeout: int = 5,\n) -> RuntimeManager:\n runtime = RuntimeManager()\n if config_path is not None:\n runtime.add_config_file(config_path)\n if enable_http_control:\n runtime.control_plane.register_channel(\n HttpControlChannel(\n host=control_host,\n port=control_port,\n timeout=control_timeout,\n )\n )\n runtime.register_module(module)\n return runtime", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/plba/bootstrap.py:create_runtime", - "span_start": 8, - "span_end": 29, - "lexical_rank": 6, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": null, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.plba.bootstrap", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_runtime.py", - "content": "def test_public_plba_package_exports_runtime_builder_and_worker_contract(tmp_path) -> None:\n import plba\n from plba import ApplicationModule as PublicApplicationModule\n from plba import InMemoryTaskQueue\n from plba import Worker as PublicWorker\n from plba import WorkerHealth as PublicWorkerHealth\n from plba import WorkerStatus as PublicWorkerStatus\n from plba import create_runtime\n\n config_path = tmp_path / \"config.yml\"\n config_path.write_text(\"platform: {}\\n\", encoding=\"utf-8\")\n\n queue = InMemoryTaskQueue[int]()\n queue.put(2)\n assert queue.get(timeout=0.01) == 2\n queue.task_done()\n\n class PublicRoutine:\n def __init__(self) -> None:\n self.runs = 0\n\n def run(self) -> None:\n if self.runs == 0:\n self.runs += 1\n\n class PublicWorkerImpl(PublicWorker):\n def __init__(self, routine: PublicRoutine) -> None:\n self._inner = RoutineWorker(\"public-worker\", routine)\n\n @property\n def name(self) -> str:\n return self._inner.name\n\n @property\n def critical(self) -> bool:\n return self._inner.critical\n\n def start(self) -> None:\n self._inner.start()\n\n def stop(self, force: bool = False) -> None:\n self._inner.stop(force=force)\n\n def health(self) -> PublicWorkerHealth:\n return self._inner.health()\n\n def status(self) -> PublicWorkerStatus:\n return self._inner.status()\n\n class PublicExampleModule(PublicApplicationModule):\n @property\n def name(self) -> str:\n return \"public-example\"\n\n def register(self, registry: ModuleRegistry) -> None:\n registry.add_worker(PublicWorkerImpl(PublicRoutine()))\n\n runtime = create_runtime(PublicExampleModule(), config_path=str(config_path))\n runtime.start()\n sleep(0.2)\n assert runtime.configuration.get() == {\"platform\": {}}\n assert runtime.status()[\"workers\"][\"registered\"] == 1\n assert hasattr(plba, \"QueueWorker\") is False\n runtime.stop()", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_runtime.py:test_public_plba_package_exports_runtime_builder_and_worker_contract", - "span_start": 342, - "span_end": 405, - "lexical_rank": 6, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": null, - "metadata": { - "chunk_index": 13, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_runtime", - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/config/__init__.py", - "content": "from app_runtime.config.file_loader import ConfigFileLoader\nfrom app_runtime.config.providers import FileConfigProvider\n\n__all__ = [\"ConfigFileLoader\", \"FileConfigProvider\"]", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/config/__init__.py:1-4", - "span_start": 1, - "span_end": 4, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": null, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.app_runtime.config.__init__", - "is_test": false, - "blob_sha": "612918029820a2a983330ec92256142b55b9de4bdf3399ece18e2a02dbad9729", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/config/providers.py", - "content": "class FileConfigProvider(ConfigProvider):\n def __init__(self, path: str | Path) -> None:\n self._loader = ConfigFileLoader(path)\n\n @property\n def loader(self) -> ConfigFileLoader:\n return self._loader\n\n def load(self) -> dict[str, Any]:\n config = self._loader.load_sync()\n if not isinstance(config, dict):\n raise TypeError(\"Config root must be a mapping\")\n return dict(config)", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/config/providers.py:FileConfigProvider", - "span_start": 10, - "span_end": 22, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": null, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.config.providers", - "is_test": false, - "blob_sha": "8c53ca0122d6df6c5763bca15e99434bb4daebd5a618b8fc927e9ae90b022e64", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/contracts/__init__.py", - "content": "__all__: list[str] = []", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/__init__.py:1-1", - "span_start": 1, - "span_end": 1, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": null, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.app_runtime.__init__", - "is_test": false, - "blob_sha": "8eea9df4f6d7b38ca0e39ccc27b04700e3d08dbeec8046d613d22706d19985fa", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/config/file_loader.py", - "content": "class ConfigFileLoader:\n def __init__(self, path: str | Path) -> None:\n self.path = Path(path)\n self.config: Any = None\n self.last_valid_config: Any = None\n self._last_seen_hash: str | None = None\n\n def read_text(self) -> str:\n return self.path.read_text(encoding=\"utf-8\")\n\n def parse(self, data: str) -> Any:\n suffix = self.path.suffix.lower()\n if suffix in {\".yml\", \".yaml\"}:\n return yaml.safe_load(data)\n return json.loads(data)\n\n def load_sync(self) -> Any:\n data = self.read_text()\n parsed = self.parse(data)\n self.config = parsed\n self.last_valid_config = parsed\n self._last_seen_hash = self._calculate_hash(data)\n return parsed\n\n def load_if_changed(self) -> tuple[bool, Any]:\n data = self.read_text()\n current_hash = self._calculate_hash(data)\n if current_hash == self._last_seen_hash:\n return False, self.config\n parsed = self.parse(data)\n self.config = parsed\n self.last_valid_config = parsed\n self._last_seen_hash = current_hash\n return True, parsed\n\n @staticmethod\n def _calculate_hash(data: str) -> str:\n return hashlib.sha256(data.encode(\"utf-8\")).hexdigest()", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/config/file_loader.py:ConfigFileLoader", - "span_start": 11, - "span_end": 48, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": null, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.config.file_loader", - "is_test": false, - "blob_sha": "1f19ffebde5e38e4be5a5d5a678059a0f36dedb8fb8b3e00ab395c67106a87ea", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/contracts/config.py", - "content": "class ConfigProvider(ABC):\n @abstractmethod\n def load(self) -> dict[str, Any]:\n \"\"\"Return a config fragment.\"\"\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/contracts/config.py:ConfigProvider", - "span_start": 7, - "span_end": 10, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": null, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.contracts.config", - "is_test": false, - "blob_sha": "5e773880267743ee94954ea2db120c2d88c54d4312893293d1b89df405283ed4", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/contracts/health.py", - "content": "class HealthContributor(ABC):\n @abstractmethod\n def health(self) -> WorkerHealth:\n \"\"\"Return contributor health state.\"\"\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/contracts/health.py:HealthContributor", - "span_start": 7, - "span_end": 10, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": null, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.contracts.health", - "is_test": false, - "blob_sha": "6bd92611def7131e32d4dd34a8ed85e6cf3c67722ad27797032a632cb30dc097", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/contracts/application.py", - "content": "class ApplicationModule(ABC):\n @property\n @abstractmethod\n def name(self) -> str:\n \"\"\"Module name used for runtime status and diagnostics.\"\"\"\n\n @abstractmethod\n def register(self, registry: ModuleRegistry) -> None:\n \"\"\"Register workers, services, and health contributors.\"\"\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/contracts/application.py:ApplicationModule", - "span_start": 8, - "span_end": 16, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": null, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.contracts.application", - "is_test": false, - "blob_sha": "197c35634dca49c352ce3f230295a485fbffb672ce7bb8c08e752bfdf61e7fa4", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "retrieval_report": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "vector", - "C2_DEPENDENCY_GRAPH": "vector", - "C0_SOURCE_CHUNKS": "vector" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C0_SOURCE_CHUNKS": 10 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [] - } - }, - "fallback": { - "used": false, - "reason": null - }, - "retrieval_by_layer_ms": { - "C1_SYMBOL_CATALOG": 24, - "C2_DEPENDENCY_GRAPH": 29, - "C0_SOURCE_CHUNKS": 10 - } - } - }, - "diagnostics": { - "intent_correct": null, - "target_found": true, - "layers_used": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ], - "retrieval_sufficient": true, - "answer_mode": "normal", - "resolved_target": "create_runtime", - "answer_policy_branch": "normal_answer", - "decision_reason": "evidence_sufficient", - "router_result": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "retrieval_profile": "code", - "sub_intent": "FIND_TESTS", - "path_scope": [], - "layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ], - "symbol_resolution_status": "resolved" - }, - "retrieval_request": { - "rag_session_id": "7d11da21-faa0-4cea-aede-aeabe069164c", - "query": "Где тесты для create_runtime?", - "sub_intent": "FIND_TESTS", - "path_scope": [], - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ] - }, - "per_layer_outcome": [ - { - "layer_id": "C1_SYMBOL_CATALOG", - "hit_count": 8, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C2_DEPENDENCY_GRAPH", - "hit_count": 6, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C0_SOURCE_CHUNKS", - "hit_count": 10, - "empty": false, - "fallback_used": false - } - ], - "empty_layers": [], - "evidence_gate_decision": { - "sufficient": true, - "failure_reasons": [], - "evidence_count": 24 - }, - "evidence_gate_input": { - "resolved_target": "create_runtime", - "sub_intent": "FIND_TESTS", - "target_type": "symbol", - "evidence_count": 24, - "code_chunk_count": 24, - "entrypoint_count": 0, - "relation_count": 6, - "test_evidence_count": 1, - "symbol_resolution_status": "resolved", - "path_scope": [] - }, - "post_evidence_gate": { - "input": { - "answer_mode": "normal", - "degraded_message": "", - "resolved_target": "create_runtime", - "draft_answer_preview": "Прямые тесты для `create_runtime` не найдены.\n\nБлижайший косвенный тест:\n- `tests/test_runtime.py::test_public_plba_package_exports_runtime_builder_and_worker_contract`\n - Проверяет экспорт пакета plba и доступность создания runtime, включая `create_runtime`.", - "repair_candidate": true - }, - "output": { - "passed": true, - "action": "return", - "reasons": [], - "repair_used": false, - "final_answer_preview": "Прямые тесты для `create_runtime` не найдены.\n\nБлижайший косвенный тест:\n- `tests/test_runtime.py::test_public_plba_package_exports_runtime_builder_and_worker_contract`\n - Проверяет экспорт пакета plba и доступность создания runtime, включая `create_runtime`." - } - }, - "failure_reasons": [], - "timings_ms": { - "router": 1, - "retrieval": 64, - "pre_evidence_gate": 1, - "llm": 1663, - "post_evidence_gate": 1 - } - }, - "rag_rows": [ - { - "path": "src/plba/__init__.py", - "content": "const create_runtime\ncreate_runtime = plba.bootstrap.create_runtime", - "layer": "C1_SYMBOL_CATALOG", - "title": "create_runtime", - "span_start": 1, - "span_end": 1, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "fa1e84f16c8c659bcd5448637386af4d15d431064e07714e34689ee64233cb51", - "qname": "create_runtime", - "kind": "const", - "signature": "create_runtime = plba.bootstrap.create_runtime", - "parent_symbol_id": null, - "package_or_module": "src.plba.__init__", - "is_test": false, - "blob_sha": "24e755ec8c249d14fb0e675b5dbf2b71ab91afb9c849897eebfa9feb2499e19d", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/bootstrap.py", - "content": "function create_runtime\ncreate_runtime(module)", - "layer": "C1_SYMBOL_CATALOG", - "title": "create_runtime", - "span_start": 8, - "span_end": 29, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "qname": "create_runtime", - "kind": "function", - "signature": "create_runtime(module)", - "parent_symbol_id": null, - "package_or_module": "src.plba.bootstrap", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/config/__init__.py", - "content": "const FileConfigProvider\nFileConfigProvider = app_runtime.config.providers.FileConfigProvider", - "layer": "C1_SYMBOL_CATALOG", - "title": "FileConfigProvider", - "span_start": 2, - "span_end": 2, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "e449b19e5881889adeb6e056eafe1da30acbae864f06984ea2edc7c15f7cb6d6", - "qname": "FileConfigProvider", - "kind": "const", - "signature": "FileConfigProvider = app_runtime.config.providers.FileConfigProvider", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.config.__init__", - "is_test": false, - "blob_sha": "612918029820a2a983330ec92256142b55b9de4bdf3399ece18e2a02dbad9729", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/config/file_loader.py", - "content": "const hashlib\nimport hashlib", - "layer": "C1_SYMBOL_CATALOG", - "title": "hashlib", - "span_start": 3, - "span_end": 3, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "e7375824bd473da3d73d316d22e3cb6428930e2db1ffbd900ce5a8b88427bf05", - "qname": "hashlib", - "kind": "const", - "signature": "import hashlib", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.config.file_loader", - "is_test": false, - "blob_sha": "1f19ffebde5e38e4be5a5d5a678059a0f36dedb8fb8b3e00ab395c67106a87ea", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/config/file_loader.py", - "content": "const json\nimport json", - "layer": "C1_SYMBOL_CATALOG", - "title": "json", - "span_start": 4, - "span_end": 4, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "bb9e2eaf992bfd050f7072d72eed87c55b1a4b001daa034a0f7c630a61bb1d78", - "qname": "json", - "kind": "const", - "signature": "import json", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.config.file_loader", - "is_test": false, - "blob_sha": "1f19ffebde5e38e4be5a5d5a678059a0f36dedb8fb8b3e00ab395c67106a87ea", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/config/file_loader.py", - "content": "const Path\nPath = pathlib.Path", - "layer": "C1_SYMBOL_CATALOG", - "title": "Path", - "span_start": 5, - "span_end": 5, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "b785967ed1fb83aa62d5724c6d6e9c6d2b1505523db39bd941cc39b48db48306", - "qname": "Path", - "kind": "const", - "signature": "Path = pathlib.Path", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.config.file_loader", - "is_test": false, - "blob_sha": "1f19ffebde5e38e4be5a5d5a678059a0f36dedb8fb8b3e00ab395c67106a87ea", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/config/file_loader.py", - "content": "const Any\nAny = typing.Any", - "layer": "C1_SYMBOL_CATALOG", - "title": "Any", - "span_start": 6, - "span_end": 6, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "8e330833b8073585db1c4b4315947c400683a23e4c3d2e2ccbcb260f347541b6", - "qname": "Any", - "kind": "const", - "signature": "Any = typing.Any", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.config.file_loader", - "is_test": false, - "blob_sha": "1f19ffebde5e38e4be5a5d5a678059a0f36dedb8fb8b3e00ab395c67106a87ea", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/config/file_loader.py", - "content": "const annotations\nannotations = __future__.annotations", - "layer": "C1_SYMBOL_CATALOG", - "title": "annotations", - "span_start": 1, - "span_end": 1, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "5ed640ccec43a78659d50ec24f3717bf1144a182c22588f37456649ac6a4a815", - "qname": "annotations", - "kind": "const", - "signature": "annotations = __future__.annotations", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.config.file_loader", - "is_test": false, - "blob_sha": "1f19ffebde5e38e4be5a5d5a678059a0f36dedb8fb8b3e00ab395c67106a87ea", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/bootstrap.py", - "content": "create_runtime calls runtime.add_config_file", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "create_runtime:calls", - "span_start": 19, - "span_end": 19, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "4eaeec4ac55a59d5f66fd01c4754955f8fedaf4bc3df13fa769b352c7bfaacbb", - "edge_type": "calls", - "src_symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "src_qname": "create_runtime", - "dst_symbol_id": null, - "dst_ref": "runtime.add_config_file", - "resolution": "partial", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/bootstrap.py", - "content": "create_runtime reads_attr runtime.register_module", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "create_runtime:reads_attr", - "span_start": 28, - "span_end": 28, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "45516c79ff358dbf9b650a081668df0f66d2fe989300f985a1a78be6be166f8f", - "edge_type": "reads_attr", - "src_symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "src_qname": "create_runtime", - "dst_symbol_id": null, - "dst_ref": "runtime.register_module", - "resolution": "partial", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/bootstrap.py", - "content": "create_runtime instantiates RuntimeManager", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "create_runtime:instantiates", - "span_start": 17, - "span_end": 17, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "0adba17984f850ea1608c9e734d2dd5c325cfde3a8133123aa239e44935ad18e", - "edge_type": "instantiates", - "src_symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "src_qname": "create_runtime", - "dst_symbol_id": "27158ca220022eeb5083c6addf8a50775d45f7161284fd60aac48410105f4b98", - "dst_ref": "RuntimeManager", - "resolution": "resolved", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/bootstrap.py", - "content": "create_runtime calls runtime.register_module", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "create_runtime:calls", - "span_start": 28, - "span_end": 28, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "ab6003c3441addc1ba1b81edeca009165559f652f6b2cf424e5ae61b1f617de8", - "edge_type": "calls", - "src_symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "src_qname": "create_runtime", - "dst_symbol_id": null, - "dst_ref": "runtime.register_module", - "resolution": "partial", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/bootstrap.py", - "content": "create_runtime calls runtime.control_plane.register_channel", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "create_runtime:calls", - "span_start": 21, - "span_end": 27, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "2678250030b9ce47a3b3b55fac7897ac530367edc8374ac9d5e6ecafb1e483f0", - "edge_type": "calls", - "src_symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "src_qname": "create_runtime", - "dst_symbol_id": null, - "dst_ref": "runtime.control_plane.register_channel", - "resolution": "partial", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/bootstrap.py", - "content": "create_runtime reads_attr runtime.add_config_file", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "create_runtime:reads_attr", - "span_start": 19, - "span_end": 19, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "30d4e8aae984ab84d523e80d02f1caeda52d547fa3d2aa47be8845931cabbca2", - "edge_type": "reads_attr", - "src_symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "src_qname": "create_runtime", - "dst_symbol_id": null, - "dst_ref": "runtime.add_config_file", - "resolution": "partial", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/__init__.py", - "content": "from plba.bootstrap import create_runtime\nfrom plba.config import ConfigFileLoader, FileConfigProvider\nfrom plba.control import ControlActionSet, ControlChannel, ControlPlaneService, HttpControlChannel\nfrom plba.contracts import (\n ApplicationModule,\n ConfigProvider,\n HealthContributor,\n TraceContext,\n TraceContextRecord,\n TraceLogMessage,\n TraceTransport,\n Worker,\n WorkerHealth,\n WorkerStatus,\n)\nfrom plba.core import ConfigurationManager, RuntimeManager, ServiceContainer\nfrom plba.health import HealthRegistry\nfrom plba.logging import LogManager\nfrom plba.queue import InMemoryTaskQueue\nfrom plba.tracing import MySqlTraceTransport, NoOpTraceTransport, TraceService\nfrom plba.workflow import (\n StepResult,\n WorkflowContext,\n WorkflowDefinition,\n WorkflowEngine,\n WorkflowEngineHooks,\n WorkflowNode,\n WorkflowRuntimeFactory,\n WorkflowStep,\n)\nfrom plba.workers import WorkerSupervisor\n\n__all__ = [\n \"ApplicationModule\",\n \"ConfigFileLoader\",\n \"ConfigProvider\",\n \"ConfigurationManager\",\n \"ControlActionSet\",\n \"ControlChannel\",\n \"ControlPlaneService\",\n \"create_runtime\",\n \"FileConfigProvider\",\n \"HealthContributor\",\n \"HealthRegistry\",\n \"HttpControlChannel\",\n \"InMemoryTaskQueue\",\n \"LogManager\",\n \"MySqlTraceTransport\",\n \"NoOpTraceTransport\",\n \"RuntimeManager\",\n \"ServiceContainer\",\n \"TraceContext\",\n \"TraceContextRecord\",\n \"TraceLogMessage\",\n \"TraceService\",\n \"TraceTransport\",\n \"StepResult\",\n \"Worker\",\n \"WorkerHealth\",\n \"WorkerStatus\",\n \"WorkflowContext\",\n \"WorkflowDefinition\",\n \"WorkflowEngine\",\n \"WorkflowEngineHooks\",\n \"WorkflowNode\",\n \"WorkflowRuntimeFactory\",\n \"WorkflowStep\",\n \"WorkerSupervisor\",\n]", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/plba/__init__.py:1-69", - "span_start": 1, - "span_end": 69, - "lexical_rank": 6, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.plba.__init__", - "is_test": false, - "blob_sha": "24e755ec8c249d14fb0e675b5dbf2b71ab91afb9c849897eebfa9feb2499e19d", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/bootstrap.py", - "content": "def create_runtime(\n module: ApplicationModule,\n *,\n config_path: str | None = None,\n enable_http_control: bool = False,\n control_host: str = \"127.0.0.1\",\n control_port: int = 8080,\n control_timeout: int = 5,\n) -> RuntimeManager:\n runtime = RuntimeManager()\n if config_path is not None:\n runtime.add_config_file(config_path)\n if enable_http_control:\n runtime.control_plane.register_channel(\n HttpControlChannel(\n host=control_host,\n port=control_port,\n timeout=control_timeout,\n )\n )\n runtime.register_module(module)\n return runtime", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/plba/bootstrap.py:create_runtime", - "span_start": 8, - "span_end": 29, - "lexical_rank": 6, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.plba.bootstrap", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_runtime.py", - "content": "def test_public_plba_package_exports_runtime_builder_and_worker_contract(tmp_path) -> None:\n import plba\n from plba import ApplicationModule as PublicApplicationModule\n from plba import InMemoryTaskQueue\n from plba import Worker as PublicWorker\n from plba import WorkerHealth as PublicWorkerHealth\n from plba import WorkerStatus as PublicWorkerStatus\n from plba import create_runtime\n\n config_path = tmp_path / \"config.yml\"\n config_path.write_text(\"platform: {}\\n\", encoding=\"utf-8\")\n\n queue = InMemoryTaskQueue[int]()\n queue.put(2)\n assert queue.get(timeout=0.01) == 2\n queue.task_done()\n\n class PublicRoutine:\n def __init__(self) -> None:\n self.runs = 0\n\n def run(self) -> None:\n if self.runs == 0:\n self.runs += 1\n\n class PublicWorkerImpl(PublicWorker):\n def __init__(self, routine: PublicRoutine) -> None:\n self._inner = RoutineWorker(\"public-worker\", routine)\n\n @property\n def name(self) -> str:\n return self._inner.name\n\n @property\n def critical(self) -> bool:\n return self._inner.critical\n\n def start(self) -> None:\n self._inner.start()\n\n def stop(self, force: bool = False) -> None:\n self._inner.stop(force=force)\n\n def health(self) -> PublicWorkerHealth:\n return self._inner.health()\n\n def status(self) -> PublicWorkerStatus:\n return self._inner.status()\n\n class PublicExampleModule(PublicApplicationModule):\n @property\n def name(self) -> str:\n return \"public-example\"\n\n def register(self, registry: ModuleRegistry) -> None:\n registry.add_worker(PublicWorkerImpl(PublicRoutine()))\n\n runtime = create_runtime(PublicExampleModule(), config_path=str(config_path))\n runtime.start()\n sleep(0.2)\n assert runtime.configuration.get() == {\"platform\": {}}\n assert runtime.status()[\"workers\"][\"registered\"] == 1\n assert hasattr(plba, \"QueueWorker\") is False\n runtime.stop()", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_runtime.py:test_public_plba_package_exports_runtime_builder_and_worker_contract", - "span_start": 342, - "span_end": 405, - "lexical_rank": 6, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 13, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_runtime", - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/config/__init__.py", - "content": "from app_runtime.config.file_loader import ConfigFileLoader\nfrom app_runtime.config.providers import FileConfigProvider\n\n__all__ = [\"ConfigFileLoader\", \"FileConfigProvider\"]", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/config/__init__.py:1-4", - "span_start": 1, - "span_end": 4, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.app_runtime.config.__init__", - "is_test": false, - "blob_sha": "612918029820a2a983330ec92256142b55b9de4bdf3399ece18e2a02dbad9729", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/config/providers.py", - "content": "class FileConfigProvider(ConfigProvider):\n def __init__(self, path: str | Path) -> None:\n self._loader = ConfigFileLoader(path)\n\n @property\n def loader(self) -> ConfigFileLoader:\n return self._loader\n\n def load(self) -> dict[str, Any]:\n config = self._loader.load_sync()\n if not isinstance(config, dict):\n raise TypeError(\"Config root must be a mapping\")\n return dict(config)", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/config/providers.py:FileConfigProvider", - "span_start": 10, - "span_end": 22, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.config.providers", - "is_test": false, - "blob_sha": "8c53ca0122d6df6c5763bca15e99434bb4daebd5a618b8fc927e9ae90b022e64", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/contracts/__init__.py", - "content": "__all__: list[str] = []", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/__init__.py:1-1", - "span_start": 1, - "span_end": 1, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.app_runtime.__init__", - "is_test": false, - "blob_sha": "8eea9df4f6d7b38ca0e39ccc27b04700e3d08dbeec8046d613d22706d19985fa", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/config/file_loader.py", - "content": "class ConfigFileLoader:\n def __init__(self, path: str | Path) -> None:\n self.path = Path(path)\n self.config: Any = None\n self.last_valid_config: Any = None\n self._last_seen_hash: str | None = None\n\n def read_text(self) -> str:\n return self.path.read_text(encoding=\"utf-8\")\n\n def parse(self, data: str) -> Any:\n suffix = self.path.suffix.lower()\n if suffix in {\".yml\", \".yaml\"}:\n return yaml.safe_load(data)\n return json.loads(data)\n\n def load_sync(self) -> Any:\n data = self.read_text()\n parsed = self.parse(data)\n self.config = parsed\n self.last_valid_config = parsed\n self._last_seen_hash = self._calculate_hash(data)\n return parsed\n\n def load_if_changed(self) -> tuple[bool, Any]:\n data = self.read_text()\n current_hash = self._calculate_hash(data)\n if current_hash == self._last_seen_hash:\n return False, self.config\n parsed = self.parse(data)\n self.config = parsed\n self.last_valid_config = parsed\n self._last_seen_hash = current_hash\n return True, parsed\n\n @staticmethod\n def _calculate_hash(data: str) -> str:\n return hashlib.sha256(data.encode(\"utf-8\")).hexdigest()", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/config/file_loader.py:ConfigFileLoader", - "span_start": 11, - "span_end": 48, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.config.file_loader", - "is_test": false, - "blob_sha": "1f19ffebde5e38e4be5a5d5a678059a0f36dedb8fb8b3e00ab395c67106a87ea", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/contracts/config.py", - "content": "class ConfigProvider(ABC):\n @abstractmethod\n def load(self) -> dict[str, Any]:\n \"\"\"Return a config fragment.\"\"\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/contracts/config.py:ConfigProvider", - "span_start": 7, - "span_end": 10, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.contracts.config", - "is_test": false, - "blob_sha": "5e773880267743ee94954ea2db120c2d88c54d4312893293d1b89df405283ed4", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/contracts/health.py", - "content": "class HealthContributor(ABC):\n @abstractmethod\n def health(self) -> WorkerHealth:\n \"\"\"Return contributor health state.\"\"\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/contracts/health.py:HealthContributor", - "span_start": 7, - "span_end": 10, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.contracts.health", - "is_test": false, - "blob_sha": "6bd92611def7131e32d4dd34a8ed85e6cf3c67722ad27797032a632cb30dc097", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/contracts/application.py", - "content": "class ApplicationModule(ABC):\n @property\n @abstractmethod\n def name(self) -> str:\n \"\"\"Module name used for runtime status and diagnostics.\"\"\"\n\n @abstractmethod\n def register(self, registry: ModuleRegistry) -> None:\n \"\"\"Register workers, services, and health contributors.\"\"\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/contracts/application.py:ApplicationModule", - "span_start": 8, - "span_end": 16, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.contracts.application", - "is_test": false, - "blob_sha": "197c35634dca49c352ce3f230295a485fbffb672ce7bb8c08e752bfdf61e7fa4", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "validation": { - "passed": true, - "action": "return", - "reasons": [] - }, - "steps": [ - { - "step": "router", - "status": "completed", - "timings_ms": { - "router": 1 - }, - "output": { - "intent": "CODE_QA", - "sub_intent": "FIND_TESTS", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - } - }, - { - "step": "retrieval", - "status": "completed", - "timings_ms": { - "retrieval": 64 - }, - "output": { - "rag_count": 24, - "answer_path_rag_count": 24, - "resolved_symbol_status": "resolved", - "resolved_symbol": "create_runtime", - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ] - }, - "diagnostics": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "vector", - "C2_DEPENDENCY_GRAPH": "vector", - "C0_SOURCE_CHUNKS": "vector" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C0_SOURCE_CHUNKS": 10 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [] - } - }, - "fallback": { - "used": false, - "reason": null - }, - "retrieval_by_layer_ms": { - "C1_SYMBOL_CATALOG": 24, - "C2_DEPENDENCY_GRAPH": 29, - "C0_SOURCE_CHUNKS": 10 - } - } - }, - { - "step": "pre_evidence_gate", - "status": "passed", - "timings_ms": { - "pre_evidence_gate": 1 - }, - "input": { - "resolved_target": "create_runtime", - "sub_intent": "FIND_TESTS", - "target_type": "symbol", - "evidence_count": 24, - "code_chunk_count": 24, - "entrypoint_count": 0, - "relation_count": 6, - "test_evidence_count": 1, - "symbol_resolution_status": "resolved", - "path_scope": [] - }, - "output": { - "passed": true, - "failure_reasons": [], - "degraded_message": "", - "evidence_count": 24 - } - }, - { - "step": "llm", - "status": "completed", - "timings_ms": { - "llm": 1663 - }, - "output": { - "prompt_name": "code_qa_find_tests_answer", - "answer_preview": "Прямые тесты для `create_runtime` не найдены.\n\nБлижайший косвенный тест:\n- `tests/test_runtime.py::test_public_plba_package_exports_runtime_builder_and_worker_contract`\n - Проверяет экспорт пакета plba и доступность создания runtime, включая `create_runtime`.", - "resolved_target": "create_runtime", - "answer_policy_branch": "normal_answer", - "decision_reason": "evidence_sufficient" - } - }, - { - "step": "post_evidence_gate", - "status": "passed", - "timings_ms": { - "post_evidence_gate": 1, - "post_evidence_gate_recheck": 0, - "repair": 0 - }, - "input": { - "answer_mode": "normal", - "degraded_message": "", - "resolved_target": "create_runtime", - "draft_answer_preview": "Прямые тесты для `create_runtime` не найдены.\n\nБлижайший косвенный тест:\n- `tests/test_runtime.py::test_public_plba_package_exports_runtime_builder_and_worker_contract`\n - Проверяет экспорт пакета plba и доступность создания runtime, включая `create_runtime`.", - "repair_candidate": true - }, - "output": { - "passed": true, - "action": "return", - "reasons": [], - "repair_used": false, - "final_answer_preview": "Прямые тесты для `create_runtime` не найдены.\n\nБлижайший косвенный тест:\n- `tests/test_runtime.py::test_public_plba_package_exports_runtime_builder_and_worker_contract`\n - Проверяет экспорт пакета plba и доступность создания runtime, включая `create_runtime`." - } - } - ] - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/plba_full_chain_subintents_v3/20260312_174008/full_chain_plba_code_subintents_v2_plba-v2-find-tests-create-runtime.md b/tests/pipeline_setup_v3/test_results/plba_full_chain_subintents_v3/20260312_174008/full_chain_plba_code_subintents_v2_plba-v2-find-tests-create-runtime.md deleted file mode 100644 index 06dbc0f..0000000 --- a/tests/pipeline_setup_v3/test_results/plba_full_chain_subintents_v3/20260312_174008/full_chain_plba_code_subintents_v2_plba-v2-find-tests-create-runtime.md +++ /dev/null @@ -1,269 +0,0 @@ -# plba-v2-find-tests-create-runtime - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_02_pipeline/full_chain_plba_code_subintents_v2.yaml -- runner: agent_runtime -- mode: full_chain -- passed: True - -## Query -Где тесты для create_runtime? - -## Actual -{ - "intent": "CODE_QA", - "sub_intent": "FIND_TESTS", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 24, - "llm_answer": "Прямые тесты для `create_runtime` не найдены.\n\nБлижайший косвенный тест:\n- `tests/test_runtime.py::test_public_plba_package_exports_runtime_builder_and_worker_contract`\n - Проверяет экспорт пакета plba и доступность создания runtime, включая `create_runtime`.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "create_runtime" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ] -} - -## Steps -[ - { - "step": "router", - "status": "completed", - "timings_ms": { - "router": 1 - }, - "output": { - "intent": "CODE_QA", - "sub_intent": "FIND_TESTS", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - } - }, - { - "step": "retrieval", - "status": "completed", - "timings_ms": { - "retrieval": 64 - }, - "output": { - "rag_count": 24, - "answer_path_rag_count": 24, - "resolved_symbol_status": "resolved", - "resolved_symbol": "create_runtime", - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ] - }, - "diagnostics": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "vector", - "C2_DEPENDENCY_GRAPH": "vector", - "C0_SOURCE_CHUNKS": "vector" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C0_SOURCE_CHUNKS": 10 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [] - } - }, - "fallback": { - "used": false, - "reason": null - }, - "retrieval_by_layer_ms": { - "C1_SYMBOL_CATALOG": 24, - "C2_DEPENDENCY_GRAPH": 29, - "C0_SOURCE_CHUNKS": 10 - } - } - }, - { - "step": "pre_evidence_gate", - "status": "passed", - "timings_ms": { - "pre_evidence_gate": 1 - }, - "input": { - "resolved_target": "create_runtime", - "sub_intent": "FIND_TESTS", - "target_type": "symbol", - "evidence_count": 24, - "code_chunk_count": 24, - "entrypoint_count": 0, - "relation_count": 6, - "test_evidence_count": 1, - "symbol_resolution_status": "resolved", - "path_scope": [] - }, - "output": { - "passed": true, - "failure_reasons": [], - "degraded_message": "", - "evidence_count": 24 - } - }, - { - "step": "llm", - "status": "completed", - "timings_ms": { - "llm": 1663 - }, - "output": { - "prompt_name": "code_qa_find_tests_answer", - "answer_preview": "Прямые тесты для `create_runtime` не найдены.\n\nБлижайший косвенный тест:\n- `tests/test_runtime.py::test_public_plba_package_exports_runtime_builder_and_worker_contract`\n - Проверяет экспорт пакета plba и доступность создания runtime, включая `create_runtime`.", - "resolved_target": "create_runtime", - "answer_policy_branch": "normal_answer", - "decision_reason": "evidence_sufficient" - } - }, - { - "step": "post_evidence_gate", - "status": "passed", - "timings_ms": { - "post_evidence_gate": 1, - "post_evidence_gate_recheck": 0, - "repair": 0 - }, - "input": { - "answer_mode": "normal", - "degraded_message": "", - "resolved_target": "create_runtime", - "draft_answer_preview": "Прямые тесты для `create_runtime` не найдены.\n\nБлижайший косвенный тест:\n- `tests/test_runtime.py::test_public_plba_package_exports_runtime_builder_and_worker_contract`\n - Проверяет экспорт пакета plba и доступность создания runtime, включая `create_runtime`.", - "repair_candidate": true - }, - "output": { - "passed": true, - "action": "return", - "reasons": [], - "repair_used": false, - "final_answer_preview": "Прямые тесты для `create_runtime` не найдены.\n\nБлижайший косвенный тест:\n- `tests/test_runtime.py::test_public_plba_package_exports_runtime_builder_and_worker_contract`\n - Проверяет экспорт пакета plba и доступность создания runtime, включая `create_runtime`." - } - } -] - -## Diagnostics -{ - "intent_correct": null, - "target_found": true, - "layers_used": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ], - "retrieval_sufficient": true, - "answer_mode": "normal", - "resolved_target": "create_runtime", - "answer_policy_branch": "normal_answer", - "decision_reason": "evidence_sufficient", - "router_result": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "retrieval_profile": "code", - "sub_intent": "FIND_TESTS", - "path_scope": [], - "layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ], - "symbol_resolution_status": "resolved" - }, - "retrieval_request": { - "rag_session_id": "7d11da21-faa0-4cea-aede-aeabe069164c", - "query": "Где тесты для create_runtime?", - "sub_intent": "FIND_TESTS", - "path_scope": [], - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ] - }, - "per_layer_outcome": [ - { - "layer_id": "C1_SYMBOL_CATALOG", - "hit_count": 8, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C2_DEPENDENCY_GRAPH", - "hit_count": 6, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C0_SOURCE_CHUNKS", - "hit_count": 10, - "empty": false, - "fallback_used": false - } - ], - "empty_layers": [], - "evidence_gate_decision": { - "sufficient": true, - "failure_reasons": [], - "evidence_count": 24 - }, - "evidence_gate_input": { - "resolved_target": "create_runtime", - "sub_intent": "FIND_TESTS", - "target_type": "symbol", - "evidence_count": 24, - "code_chunk_count": 24, - "entrypoint_count": 0, - "relation_count": 6, - "test_evidence_count": 1, - "symbol_resolution_status": "resolved", - "path_scope": [] - }, - "post_evidence_gate": { - "input": { - "answer_mode": "normal", - "degraded_message": "", - "resolved_target": "create_runtime", - "draft_answer_preview": "Прямые тесты для `create_runtime` не найдены.\n\nБлижайший косвенный тест:\n- `tests/test_runtime.py::test_public_plba_package_exports_runtime_builder_and_worker_contract`\n - Проверяет экспорт пакета plba и доступность создания runtime, включая `create_runtime`.", - "repair_candidate": true - }, - "output": { - "passed": true, - "action": "return", - "reasons": [], - "repair_used": false, - "final_answer_preview": "Прямые тесты для `create_runtime` не найдены.\n\nБлижайший косвенный тест:\n- `tests/test_runtime.py::test_public_plba_package_exports_runtime_builder_and_worker_contract`\n - Проверяет экспорт пакета plba и доступность создания runtime, включая `create_runtime`." - } - }, - "failure_reasons": [], - "timings_ms": { - "router": 1, - "retrieval": 64, - "pre_evidence_gate": 1, - "llm": 1663, - "post_evidence_gate": 1 - } -} - -## Mismatches -- none \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/plba_full_chain_subintents_v3/20260312_174008/full_chain_plba_code_subintents_v2_plba-v2-find-tests-runtime-manager.json b/tests/pipeline_setup_v3/test_results/plba_full_chain_subintents_v3/20260312_174008/full_chain_plba_code_subintents_v2_plba-v2-find-tests-runtime-manager.json deleted file mode 100644 index 763215d..0000000 --- a/tests/pipeline_setup_v3/test_results/plba_full_chain_subintents_v3/20260312_174008/full_chain_plba_code_subintents_v2_plba-v2-find-tests-runtime-manager.json +++ /dev/null @@ -1,3306 +0,0 @@ -{ - "case_id": "plba-v2-find-tests-runtime-manager", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_02_pipeline/full_chain_plba_code_subintents_v2.yaml", - "runner": "agent_runtime", - "mode": "full_chain", - "query": "Где тесты для RuntimeManager?", - "actual": { - "intent": "CODE_QA", - "sub_intent": "FIND_TESTS", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 24, - "llm_answer": "Прямые тесты для `RuntimeManager` находятся в файле `tests/test_runtime.py`.\n\nКосвенные тесты:\n- В файле `tests/test_business_control_actions.py` есть тесты, использующие компоненты контроля, которые взаимодействуют с `RuntimeManager`.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "RuntimeManager" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ] - }, - "passed": true, - "mismatches": [], - "details": { - "query": "Где тесты для RuntimeManager?", - "router_result": { - "schema_version": "1.1", - "intent": "CODE_QA", - "retrieval_profile": "code", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query_plan": { - "raw": "Где тесты для RuntimeManager?", - "normalized": "Где тесты для RuntimeManager?", - "sub_intent": "FIND_TESTS", - "negations": [], - "expansions": [ - "test", - "unit test", - "RuntimeManager" - ], - "keyword_hints": [ - "RuntimeManager" - ], - "path_hints": [], - "doc_scope_hints": [], - "symbol_candidates": [ - "RuntimeManager" - ], - "symbol_kind_hint": "class", - "anchors": [ - { - "type": "SYMBOL", - "value": "RuntimeManager", - "source": "user_text", - "subtype": null, - "span": { - "start": 14, - "end": 28 - }, - "confidence": 0.88 - }, - { - "type": "KEY_TERM", - "value": "тест", - "source": "user_text", - "subtype": null, - "span": { - "start": 4, - "end": 9 - }, - "confidence": 0.9 - } - ] - }, - "retrieval_spec": { - "domains": [ - "CODE" - ], - "layer_queries": [ - { - "layer_id": "C1_SYMBOL_CATALOG", - "top_k": 8 - }, - { - "layer_id": "C2_DEPENDENCY_GRAPH", - "top_k": 6 - }, - { - "layer_id": "C0_SOURCE_CHUNKS", - "top_k": 10 - } - ], - "filters": { - "test_policy": "INCLUDE", - "path_scope": [], - "language": [ - "python" - ] - }, - "rerank_profile": "code" - }, - "retrieval_constraints": { - "include_globs": [ - "src/**", - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "test_file_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "test_symbol_patterns": [ - "test_runtime_manager", - "TestRuntimeManager", - "RuntimeManager" - ], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - }, - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "RuntimeManager", - "alternatives": [ - "RuntimeManager", - "RuntimeManager", - "RuntimeManager", - "RuntimeManager", - "RuntimeManager" - ], - "confidence": 0.99 - }, - "evidence_policy": { - "require_def": true, - "require_flow": true, - "require_spec": false, - "allow_answer_without_evidence": false - } - }, - "retrieval_request": { - "rag_session_id": "7d11da21-faa0-4cea-aede-aeabe069164c", - "query": "Где тесты для RuntimeManager?", - "sub_intent": "FIND_TESTS", - "path_scope": [], - "keyword_hints": [ - "RuntimeManager" - ], - "symbol_candidates": [ - "RuntimeManager" - ], - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ], - "retrieval_spec": { - "domains": [ - "CODE" - ], - "layer_queries": [ - { - "layer_id": "C1_SYMBOL_CATALOG", - "top_k": 8 - }, - { - "layer_id": "C2_DEPENDENCY_GRAPH", - "top_k": 6 - }, - { - "layer_id": "C0_SOURCE_CHUNKS", - "top_k": 10 - } - ], - "filters": { - "test_policy": "INCLUDE", - "path_scope": [], - "language": [ - "python" - ] - }, - "rerank_profile": "code" - }, - "retrieval_constraints": { - "include_globs": [ - "src/**", - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "test_file_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "test_symbol_patterns": [ - "test_runtime_manager", - "TestRuntimeManager", - "RuntimeManager" - ], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - }, - "query_plan": { - "raw": "Где тесты для RuntimeManager?", - "normalized": "Где тесты для RuntimeManager?", - "sub_intent": "FIND_TESTS", - "negations": [], - "expansions": [ - "test", - "unit test", - "RuntimeManager" - ], - "keyword_hints": [ - "RuntimeManager" - ], - "path_hints": [], - "doc_scope_hints": [], - "symbol_candidates": [ - "RuntimeManager" - ], - "symbol_kind_hint": "class", - "anchors": [ - { - "type": "SYMBOL", - "value": "RuntimeManager", - "source": "user_text", - "subtype": null, - "span": { - "start": 14, - "end": 28 - }, - "confidence": 0.88 - }, - { - "type": "KEY_TERM", - "value": "тест", - "source": "user_text", - "subtype": null, - "span": { - "start": 4, - "end": 9 - }, - "confidence": 0.9 - } - ] - } - }, - "retrieval_result": { - "target_symbol_candidates": [ - "RuntimeManager", - "ControlPlaneService" - ], - "resolved_symbol": "RuntimeManager", - "symbol_resolution_status": "resolved", - "file_candidates": [ - "src/plba/bootstrap.py", - "tests/test_runtime.py", - "src/app_runtime/core/runtime.py", - "src/plba/__init__.py", - "src/plba/core.py", - "tests/test_business_control_actions.py", - "src/app_runtime/control/service.py", - "src/app_runtime/control/__init__.py", - "src/plba/control.py", - "src/app_runtime/control/http_channel.py", - "src/app_runtime/control/http_app.py", - "src/app_runtime/control/http_runner.py", - "src/app_runtime/control/base.py" - ], - "code_chunks": [ - { - "layer": "C1_SYMBOL_CATALOG", - "path": "src/plba/bootstrap.py", - "title": "RuntimeManager", - "content": "const RuntimeManager\nRuntimeManager = app_runtime.core.runtime.RuntimeManager", - "start_line": 4, - "end_line": 4, - "metadata": { - "symbol_id": "27158ca220022eeb5083c6addf8a50775d45f7161284fd60aac48410105f4b98", - "qname": "RuntimeManager", - "kind": "const", - "signature": "RuntimeManager = app_runtime.core.runtime.RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "src.plba.bootstrap", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C1_SYMBOL_CATALOG", - "path": "tests/test_runtime.py", - "title": "RuntimeManager", - "content": "const RuntimeManager\nRuntimeManager = app_runtime.core.runtime.RuntimeManager", - "start_line": 12, - "end_line": 12, - "metadata": { - "symbol_id": "aeadc039653807b0da1ca6e3cc1078ee61cfc510b28e7f9c2ec04c59da43cc8d", - "qname": "RuntimeManager", - "kind": "const", - "signature": "RuntimeManager = app_runtime.core.runtime.RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "tests.test_runtime", - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C1_SYMBOL_CATALOG", - "path": "src/app_runtime/core/runtime.py", - "title": "RuntimeManager", - "content": "class RuntimeManager\nRuntimeManager", - "start_line": 18, - "end_line": 179, - "metadata": { - "symbol_id": "7e4a9381328c5803bbc6179458612fc4e947d928aa7bf8b4b2bebb2c8592f758", - "qname": "RuntimeManager", - "kind": "class", - "signature": "RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.core.runtime", - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C1_SYMBOL_CATALOG", - "path": "src/plba/__init__.py", - "title": "RuntimeManager", - "content": "const RuntimeManager\nRuntimeManager = plba.core.RuntimeManager", - "start_line": 16, - "end_line": 16, - "metadata": { - "symbol_id": "7eacec84f9b8d6c4201374591faecdac7493091c263681495c338973f2971ad9", - "qname": "RuntimeManager", - "kind": "const", - "signature": "RuntimeManager = plba.core.RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "src.plba.__init__", - "is_test": false, - "blob_sha": "24e755ec8c249d14fb0e675b5dbf2b71ab91afb9c849897eebfa9feb2499e19d", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C1_SYMBOL_CATALOG", - "path": "src/plba/core.py", - "title": "RuntimeManager", - "content": "const RuntimeManager\nRuntimeManager = app_runtime.core.runtime.RuntimeManager", - "start_line": 2, - "end_line": 2, - "metadata": { - "symbol_id": "e1684562d978b7af7fe9b27dc5869d770348a87b5dc19a50360f58544668578b", - "qname": "RuntimeManager", - "kind": "const", - "signature": "RuntimeManager = app_runtime.core.runtime.RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "src.plba.core", - "is_test": false, - "blob_sha": "c0ae25110d20e665216616e26b68adfe035b624ba45d31d1272fb21f906f9ca8", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C1_SYMBOL_CATALOG", - "path": "tests/test_business_control_actions.py", - "title": "RuntimeManager", - "content": "const RuntimeManager\nRuntimeManager = app_runtime.core.runtime.RuntimeManager", - "start_line": 14, - "end_line": 14, - "metadata": { - "symbol_id": "a1572ea8183dc0cd6ddbc74342bbde8c28cecfde37ad40b62feff09f8d103d11", - "qname": "RuntimeManager", - "kind": "const", - "signature": "RuntimeManager = app_runtime.core.runtime.RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C1_SYMBOL_CATALOG", - "path": "src/app_runtime/control/service.py", - "title": "RuntimeManager", - "content": "const RuntimeManager\nRuntimeManager = app_runtime.core.runtime.RuntimeManager", - "start_line": 9, - "end_line": 9, - "metadata": { - "symbol_id": "62a9575c77aad894120d18b4f2a08cf2ba42f77e9be4a8a432b767d157701afe", - "qname": "RuntimeManager", - "kind": "const", - "signature": "RuntimeManager = app_runtime.core.runtime.RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.control.service", - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C1_SYMBOL_CATALOG", - "path": "src/app_runtime/control/__init__.py", - "title": "ControlPlaneService", - "content": "const ControlPlaneService\nControlPlaneService = app_runtime.control.service.ControlPlaneService", - "start_line": 3, - "end_line": 3, - "metadata": { - "symbol_id": "217e8f044d1c01644bf7b81e5046af9e84469210c692a2fb0c476a19bb069ae1", - "qname": "ControlPlaneService", - "kind": "const", - "signature": "ControlPlaneService = app_runtime.control.service.ControlPlaneService", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.control.__init__", - "is_test": false, - "blob_sha": "bf3c37e3369a84cc618adc0fd71c232e5eb4b871eaff743069a17e661e498316", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "path": "src/app_runtime/control/service.py", - "title": "ControlPlaneService.__init__:dataflow_slice", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.stop", - "start_line": 14, - "end_line": 25, - "metadata": { - "edge_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d", - "dst_ref": "ControlPlaneService.stop", - "resolution": "resolved", - "slice_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.stop" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "path": "src/app_runtime/control/service.py", - "title": "ControlPlaneService.__init__:dataflow_slice", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._stop_async", - "start_line": 14, - "end_line": 51, - "metadata": { - "edge_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a", - "dst_ref": "ControlPlaneService._stop_async", - "resolution": "resolved", - "slice_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._stop_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "path": "src/app_runtime/control/service.py", - "title": "ControlPlaneService.__init__:dataflow_slice", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.register_channel", - "start_line": 14, - "end_line": 17, - "metadata": { - "edge_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957", - "dst_ref": "ControlPlaneService.register_channel", - "resolution": "resolved", - "slice_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.register_channel" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "path": "src/app_runtime/control/service.py", - "title": "ControlPlaneService.__init__:dataflow_slice", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.start", - "start_line": 14, - "end_line": 20, - "metadata": { - "edge_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154", - "dst_ref": "ControlPlaneService.start", - "resolution": "resolved", - "slice_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.start" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "path": "src/app_runtime/control/service.py", - "title": "ControlPlaneService.__init__:dataflow_slice", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._start_async", - "start_line": 14, - "end_line": 47, - "metadata": { - "edge_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517", - "dst_ref": "ControlPlaneService._start_async", - "resolution": "resolved", - "slice_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._start_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "path": "src/app_runtime/core/runtime.py", - "title": "RuntimeManager.__init__:dataflow_slice", - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager.add_config_file", - "start_line": 32, - "end_line": 52, - "metadata": { - "edge_id": "a23b8a11ebdb12708b60c96ea12a69f7f042082f1adfddd572444e246d81d167", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "57ffbd4f0d9fdf3507c2b8624312ce211f3d02fdf86a57a8ec90778d8a7b498d", - "dst_ref": "RuntimeManager.add_config_file", - "resolution": "resolved", - "slice_id": "a23b8a11ebdb12708b60c96ea12a69f7f042082f1adfddd572444e246d81d167", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager.add_config_file" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "57ffbd4f0d9fdf3507c2b8624312ce211f3d02fdf86a57a8ec90778d8a7b498d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C0_SOURCE_CHUNKS", - "path": "src/plba/control.py", - "title": "src/plba/control.py:1-10", - "content": "from app_runtime.control.base import ControlActionSet, ControlChannel\nfrom app_runtime.control.http_channel import HttpControlChannel\nfrom app_runtime.control.service import ControlPlaneService\n\n__all__ = [\n \"ControlActionSet\",\n \"ControlChannel\",\n \"ControlPlaneService\",\n \"HttpControlChannel\",\n]", - "start_line": 1, - "end_line": 10, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.plba.control", - "is_test": false, - "blob_sha": "31bd5c4481bfa7fbca8fae56d4860a67e3953ca74474ac8439e1f39b685d7bc8", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C0_SOURCE_CHUNKS", - "path": "tests/test_business_control_actions.py", - "title": "tests/test_business_control_actions.py:IntervalRoutine", - "content": "class IntervalRoutine:\n calls: list[float] = field(default_factory=list)\n _lock: Lock = field(default_factory=Lock)\n\n def run(self) -> None:\n with self._lock:\n self.calls.append(monotonic())\n\n def wait_runs(self, count: int, timeout: float) -> bool:\n deadline = monotonic() + timeout\n while monotonic() < deadline:\n with self._lock:\n if len(self.calls) >= count:\n return True\n sleep(0.01)\n return False\n\n def deltas(self) -> list[float]:\n with self._lock:\n return [self.calls[index + 1] - self.calls[index] for index in range(len(self.calls) - 1)]", - "start_line": 18, - "end_line": 37, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C0_SOURCE_CHUNKS", - "path": "src/app_runtime/control/http_channel.py", - "title": "src/app_runtime/control/http_channel.py:HttpControlChannel", - "content": "class HttpControlChannel(ControlChannel):\n def __init__(self, host: str, port: int, timeout: int) -> None:\n self._timeout = timeout\n self._runner = UvicornThreadRunner(host, port, timeout)\n self._factory = HttpControlAppFactory()\n self._actions: ControlActionSet | None = None\n\n async def start(self, actions: ControlActionSet) -> None:\n self._actions = actions\n app = self._factory.create(self._health_response, self._action_response)\n await self._runner.start(app)\n\n async def stop(self) -> None:\n await self._runner.stop()\n\n @property\n def port(self) -> int:\n return self._runner.port\n\n async def _health_response(self) -> dict[str, object]:\n if self._actions is None:\n return {\"status\": \"unhealthy\", \"detail\": \"control actions are not configured\"}\n return await asyncio.wait_for(self._actions.health(), timeout=float(self._timeout))\n\n async def _action_response(self, action: str, _client_source: str = \"unknown\") -> JSONResponse:\n if self._actions is None:\n return JSONResponse(content={\"status\": \"error\", \"detail\": f\"{action} handler is not configured\"}, status_code=404)\n callbacks = {\n \"start\": self._actions.start,\n \"stop\": self._actions.stop,\n \"status\": self._actions.status,\n }\n callback = callbacks.get(action)\n if callback is None:\n return JSONResponse(content={\"status\": \"error\", \"detail\": f\"unsupported action: {action}\"}, status_code=404)\n action_timeout = max(float(self._timeout), 10.0) if action in {\"start\", \"stop\"} else float(self._timeout)\n try:\n detail = await asyncio.wait_for(callback(), timeout=action_timeout)\n except asyncio.TimeoutError:\n return JSONResponse(\n content={\"status\": \"accepted\", \"detail\": f\"{action} operation is still in progress\"},\n status_code=202,\n )\n except Exception as exc:\n return JSONResponse(content={\"status\": \"error\", \"detail\": str(exc)}, status_code=500)\n return JSONResponse(content={\"status\": \"ok\", \"detail\": detail or f\"{action} action accepted\"}, status_code=200)", - "start_line": 12, - "end_line": 57, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.http_channel", - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C0_SOURCE_CHUNKS", - "path": "src/app_runtime/control/http_app.py", - "title": "src/app_runtime/control/http_app.py:HttpControlAppFactory", - "content": "class HttpControlAppFactory:\n def create(\n self,\n health_provider: Callable[[], Awaitable[HealthPayload]],\n action_provider: Callable[[str, str], Awaitable[JSONResponse]],\n ) -> FastAPI:\n app = FastAPI(title=\"PLBA Control API\")\n\n @app.middleware(\"http\")\n async def log_api_call(request: Request, call_next): # type: ignore[no-untyped-def]\n started = time.monotonic()\n response = await call_next(request)\n response.headers[\"X-Response-Time-Ms\"] = str(int((time.monotonic() - started) * 1000))\n return response\n\n @app.get(\"/health\")\n async def health() -> JSONResponse:\n payload = await health_provider()\n status_code = 200 if payload.get(\"status\") == \"ok\" else 503\n return JSONResponse(content=payload, status_code=status_code)\n\n @app.get(\"/actions/{action}\")\n @app.post(\"/actions/{action}\")\n async def action(action: str, request: Request) -> JSONResponse:\n client_source = self._client_source(request)\n if action in {\"start\", \"stop\"}:\n LOGGER.warning(\"Control action requested: /actions/%s client=%s\", action, client_source)\n return await action_provider(action, client_source)\n\n return app\n\n def _client_source(self, request: Request) -> str:\n explicit_header = request.headers.get(\"X-Client-Source\", \"\").strip()\n if explicit_header:\n return explicit_header\n user_agent = request.headers.get(\"User-Agent\", \"\").strip()\n if user_agent:\n return f\"user-agent:{user_agent}\"\n return \"unknown\"", - "start_line": 15, - "end_line": 53, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.http_app", - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C0_SOURCE_CHUNKS", - "path": "src/app_runtime/control/http_runner.py", - "title": "src/app_runtime/control/http_runner.py:UvicornThreadRunner", - "content": "class UvicornThreadRunner:\n def __init__(self, host: str, port: int, timeout: int) -> None:\n self._host = host\n self._port = port\n self._timeout = timeout\n self._server: Server | None = None\n self._thread: Thread | None = None\n self._error: BaseException | None = None\n\n async def start(self, app: FastAPI) -> None:\n if self._thread is not None and self._thread.is_alive():\n return\n self._error = None\n config = Config(app=app, host=self._host, port=self._port, log_level=\"warning\")\n self._server = Server(config)\n self._thread = Thread(target=self._serve, name=\"plba-http-control\", daemon=True)\n self._thread.start()\n await self._wait_until_started()\n\n async def stop(self) -> None:\n if self._server is None or self._thread is None:\n return\n self._server.should_exit = True\n await asyncio.to_thread(self._thread.join, self._timeout)\n self._server = None\n self._thread = None\n\n @property\n def port(self) -> int:\n if self._server is None or not getattr(self._server, \"servers\", None):\n return self._port\n socket = self._server.servers[0].sockets[0]\n return int(socket.getsockname()[1])\n\n async def _wait_until_started(self) -> None:\n if self._server is None:\n raise RuntimeError(\"Server is not initialized\")\n deadline = asyncio.get_running_loop().time() + max(float(self._timeout), 1.0)\n while not self._server.started:\n if self._error is not None:\n raise RuntimeError(\"HTTP control server failed to start\") from self._error\n if asyncio.get_running_loop().time() >= deadline:\n raise TimeoutError(\"HTTP control server startup timed out\")\n await asyncio.sleep(0.05)\n\n def _serve(self) -> None:\n if self._server is None:\n return\n try:\n asyncio.run(self._server.serve())\n except BaseException as exc: # noqa: BLE001\n self._error = exc", - "start_line": 10, - "end_line": 61, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.http_runner", - "is_test": false, - "blob_sha": "3779fdd2878b770e789a35bb2a89c9d79f13b61c26d7db1b3b683f9bb9e1623f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C0_SOURCE_CHUNKS", - "path": "src/app_runtime/control/service.py", - "title": "src/app_runtime/control/service.py:ControlPlaneService", - "content": "class ControlPlaneService:\n def __init__(self) -> None:\n self._channels: list[ControlChannel] = []\n\n def register_channel(self, channel: ControlChannel) -> None:\n self._channels.append(channel)\n\n def start(self, runtime: RuntimeManager) -> None:\n if not self._channels:\n return\n asyncio.run(self._start_async(runtime))\n\n def stop(self) -> None:\n if not self._channels:\n return\n asyncio.run(self._stop_async())\n\n def snapshot(self, runtime: RuntimeManager) -> dict[str, object]:\n health = runtime.current_health()\n return {\n \"runtime\": {\"state\": runtime._state.value},\n \"modules\": list(runtime.registry.modules),\n \"services\": runtime.services.snapshot(),\n \"workers\": runtime.workers.snapshot(),\n \"health\": runtime.health.snapshot(runtime.workers.healths()) | {\"status\": health[\"status\"]},\n \"config\": runtime.configuration.get(),\n }\n\n async def _start_async(self, runtime: RuntimeManager) -> None:\n actions = ControlActionSet(\n health=runtime.health_status,\n start=runtime.start_runtime,\n stop=runtime.stop_runtime,\n status=runtime.runtime_status,\n )\n for channel in self._channels:\n await channel.start(actions)\n\n async def _stop_async(self) -> None:\n for channel in reversed(self._channels):\n await channel.stop()", - "start_line": 12, - "end_line": 52, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.service", - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C0_SOURCE_CHUNKS", - "path": "src/app_runtime/control/base.py", - "title": "src/app_runtime/control/base.py:ControlActionSet", - "content": "class ControlActionSet:\n health: HealthHandler\n start: ActionHandler\n stop: ActionHandler\n status: ActionHandler", - "start_line": 14, - "end_line": 18, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.base", - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C0_SOURCE_CHUNKS", - "path": "src/app_runtime/control/__init__.py", - "title": "src/app_runtime/control/__init__.py:1-5", - "content": "from app_runtime.control.base import ControlActionSet, ControlChannel\nfrom app_runtime.control.http_channel import HttpControlChannel\nfrom app_runtime.control.service import ControlPlaneService\n\n__all__ = [\"ControlActionSet\", \"ControlChannel\", \"ControlPlaneService\", \"HttpControlChannel\"]", - "start_line": 1, - "end_line": 5, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.app_runtime.control.__init__", - "is_test": false, - "blob_sha": "bf3c37e3369a84cc618adc0fd71c232e5eb4b871eaff743069a17e661e498316", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C0_SOURCE_CHUNKS", - "path": "src/app_runtime/control/base.py", - "title": "src/app_runtime/control/base.py:ControlChannel", - "content": "class ControlChannel(ABC):\n @abstractmethod\n async def start(self, actions: ControlActionSet) -> None:\n \"\"\"Start the control channel and bind handlers.\"\"\"\n\n @abstractmethod\n async def stop(self) -> None:\n \"\"\"Stop the control channel and release resources.\"\"\"", - "start_line": 21, - "end_line": 28, - "metadata": { - "chunk_index": 1, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.base", - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C0_SOURCE_CHUNKS", - "path": "tests/test_business_control_actions.py", - "title": "tests/test_business_control_actions.py:BlockingRoutine", - "content": "class BlockingRoutine:\n def __init__(self, started: Event, release: Event) -> None:\n self._started = started\n self._release = release\n\n def run(self) -> None:\n self._started.set()\n self._release.wait(timeout=5.0)", - "start_line": 40, - "end_line": 47, - "metadata": { - "chunk_index": 1, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "relations": [ - { - "path": "src/app_runtime/control/service.py", - "metadata": { - "edge_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d", - "dst_ref": "ControlPlaneService.stop", - "resolution": "resolved", - "slice_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.stop" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - }, - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.stop" - }, - { - "path": "src/app_runtime/control/service.py", - "metadata": { - "edge_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a", - "dst_ref": "ControlPlaneService._stop_async", - "resolution": "resolved", - "slice_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._stop_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - }, - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._stop_async" - }, - { - "path": "src/app_runtime/control/service.py", - "metadata": { - "edge_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957", - "dst_ref": "ControlPlaneService.register_channel", - "resolution": "resolved", - "slice_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.register_channel" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - }, - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.register_channel" - }, - { - "path": "src/app_runtime/control/service.py", - "metadata": { - "edge_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154", - "dst_ref": "ControlPlaneService.start", - "resolution": "resolved", - "slice_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.start" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - }, - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.start" - }, - { - "path": "src/app_runtime/control/service.py", - "metadata": { - "edge_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517", - "dst_ref": "ControlPlaneService._start_async", - "resolution": "resolved", - "slice_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._start_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - }, - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._start_async" - }, - { - "path": "src/app_runtime/core/runtime.py", - "metadata": { - "edge_id": "a23b8a11ebdb12708b60c96ea12a69f7f042082f1adfddd572444e246d81d167", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "57ffbd4f0d9fdf3507c2b8624312ce211f3d02fdf86a57a8ec90778d8a7b498d", - "dst_ref": "RuntimeManager.add_config_file", - "resolution": "resolved", - "slice_id": "a23b8a11ebdb12708b60c96ea12a69f7f042082f1adfddd572444e246d81d167", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager.add_config_file" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "57ffbd4f0d9fdf3507c2b8624312ce211f3d02fdf86a57a8ec90778d8a7b498d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - }, - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager.add_config_file" - } - ], - "entrypoints": [], - "test_candidates": [ - { - "path": "tests/test_business_control_actions.py", - "title": "tests/test_business_control_actions.py:IntervalRoutine", - "content": "class IntervalRoutine:\n calls: list[float] = field(default_factory=list)\n _lock: Lock = field(default_factory=Lock)\n\n def run(self) -> None:\n with self._lock:\n self.calls.append(monotonic())\n\n def wait_runs(self, count: int, timeout: float) -> bool:\n deadline = m" - }, - { - "path": "tests/test_business_control_actions.py", - "title": "tests/test_business_control_actions.py:BlockingRoutine", - "content": "class BlockingRoutine:\n def __init__(self, started: Event, release: Event) -> None:\n self._started = started\n self._release = release\n\n def run(self) -> None:\n self._started.set()\n self._release.wait(timeout=5.0)" - } - ], - "layer_outcomes": [ - { - "layer_id": "C1_SYMBOL_CATALOG", - "hit_count": 8, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C2_DEPENDENCY_GRAPH", - "hit_count": 6, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C0_SOURCE_CHUNKS", - "hit_count": 10, - "empty": false, - "fallback_used": false - } - ], - "missing_layers": [], - "raw_rows": [ - { - "path": "src/plba/bootstrap.py", - "content": "const RuntimeManager\nRuntimeManager = app_runtime.core.runtime.RuntimeManager", - "layer": "C1_SYMBOL_CATALOG", - "title": "RuntimeManager", - "span_start": 4, - "span_end": 4, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": null, - "metadata": { - "symbol_id": "27158ca220022eeb5083c6addf8a50775d45f7161284fd60aac48410105f4b98", - "qname": "RuntimeManager", - "kind": "const", - "signature": "RuntimeManager = app_runtime.core.runtime.RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "src.plba.bootstrap", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_runtime.py", - "content": "const RuntimeManager\nRuntimeManager = app_runtime.core.runtime.RuntimeManager", - "layer": "C1_SYMBOL_CATALOG", - "title": "RuntimeManager", - "span_start": 12, - "span_end": 12, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": null, - "metadata": { - "symbol_id": "aeadc039653807b0da1ca6e3cc1078ee61cfc510b28e7f9c2ec04c59da43cc8d", - "qname": "RuntimeManager", - "kind": "const", - "signature": "RuntimeManager = app_runtime.core.runtime.RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "tests.test_runtime", - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "class RuntimeManager\nRuntimeManager", - "layer": "C1_SYMBOL_CATALOG", - "title": "RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": null, - "metadata": { - "symbol_id": "7e4a9381328c5803bbc6179458612fc4e947d928aa7bf8b4b2bebb2c8592f758", - "qname": "RuntimeManager", - "kind": "class", - "signature": "RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.core.runtime", - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/__init__.py", - "content": "const RuntimeManager\nRuntimeManager = plba.core.RuntimeManager", - "layer": "C1_SYMBOL_CATALOG", - "title": "RuntimeManager", - "span_start": 16, - "span_end": 16, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": null, - "metadata": { - "symbol_id": "7eacec84f9b8d6c4201374591faecdac7493091c263681495c338973f2971ad9", - "qname": "RuntimeManager", - "kind": "const", - "signature": "RuntimeManager = plba.core.RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "src.plba.__init__", - "is_test": false, - "blob_sha": "24e755ec8c249d14fb0e675b5dbf2b71ab91afb9c849897eebfa9feb2499e19d", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/core.py", - "content": "const RuntimeManager\nRuntimeManager = app_runtime.core.runtime.RuntimeManager", - "layer": "C1_SYMBOL_CATALOG", - "title": "RuntimeManager", - "span_start": 2, - "span_end": 2, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": null, - "metadata": { - "symbol_id": "e1684562d978b7af7fe9b27dc5869d770348a87b5dc19a50360f58544668578b", - "qname": "RuntimeManager", - "kind": "const", - "signature": "RuntimeManager = app_runtime.core.runtime.RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "src.plba.core", - "is_test": false, - "blob_sha": "c0ae25110d20e665216616e26b68adfe035b624ba45d31d1272fb21f906f9ca8", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "const RuntimeManager\nRuntimeManager = app_runtime.core.runtime.RuntimeManager", - "layer": "C1_SYMBOL_CATALOG", - "title": "RuntimeManager", - "span_start": 14, - "span_end": 14, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": null, - "metadata": { - "symbol_id": "a1572ea8183dc0cd6ddbc74342bbde8c28cecfde37ad40b62feff09f8d103d11", - "qname": "RuntimeManager", - "kind": "const", - "signature": "RuntimeManager = app_runtime.core.runtime.RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "const RuntimeManager\nRuntimeManager = app_runtime.core.runtime.RuntimeManager", - "layer": "C1_SYMBOL_CATALOG", - "title": "RuntimeManager", - "span_start": 9, - "span_end": 9, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": null, - "metadata": { - "symbol_id": "62a9575c77aad894120d18b4f2a08cf2ba42f77e9be4a8a432b767d157701afe", - "qname": "RuntimeManager", - "kind": "const", - "signature": "RuntimeManager = app_runtime.core.runtime.RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.control.service", - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/__init__.py", - "content": "const ControlPlaneService\nControlPlaneService = app_runtime.control.service.ControlPlaneService", - "layer": "C1_SYMBOL_CATALOG", - "title": "ControlPlaneService", - "span_start": 3, - "span_end": 3, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": null, - "metadata": { - "symbol_id": "217e8f044d1c01644bf7b81e5046af9e84469210c692a2fb0c476a19bb069ae1", - "qname": "ControlPlaneService", - "kind": "const", - "signature": "ControlPlaneService = app_runtime.control.service.ControlPlaneService", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.control.__init__", - "is_test": false, - "blob_sha": "bf3c37e3369a84cc618adc0fd71c232e5eb4b871eaff743069a17e661e498316", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.stop", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 25, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": null, - "metadata": { - "edge_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d", - "dst_ref": "ControlPlaneService.stop", - "resolution": "resolved", - "slice_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.stop" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._stop_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 51, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": null, - "metadata": { - "edge_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a", - "dst_ref": "ControlPlaneService._stop_async", - "resolution": "resolved", - "slice_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._stop_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.register_channel", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 17, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": null, - "metadata": { - "edge_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957", - "dst_ref": "ControlPlaneService.register_channel", - "resolution": "resolved", - "slice_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.register_channel" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.start", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 20, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": null, - "metadata": { - "edge_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154", - "dst_ref": "ControlPlaneService.start", - "resolution": "resolved", - "slice_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.start" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._start_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 47, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": null, - "metadata": { - "edge_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517", - "dst_ref": "ControlPlaneService._start_async", - "resolution": "resolved", - "slice_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._start_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager.add_config_file", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 32, - "span_end": 52, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": null, - "metadata": { - "edge_id": "a23b8a11ebdb12708b60c96ea12a69f7f042082f1adfddd572444e246d81d167", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "57ffbd4f0d9fdf3507c2b8624312ce211f3d02fdf86a57a8ec90778d8a7b498d", - "dst_ref": "RuntimeManager.add_config_file", - "resolution": "resolved", - "slice_id": "a23b8a11ebdb12708b60c96ea12a69f7f042082f1adfddd572444e246d81d167", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager.add_config_file" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "57ffbd4f0d9fdf3507c2b8624312ce211f3d02fdf86a57a8ec90778d8a7b498d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/control.py", - "content": "from app_runtime.control.base import ControlActionSet, ControlChannel\nfrom app_runtime.control.http_channel import HttpControlChannel\nfrom app_runtime.control.service import ControlPlaneService\n\n__all__ = [\n \"ControlActionSet\",\n \"ControlChannel\",\n \"ControlPlaneService\",\n \"HttpControlChannel\",\n]", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/plba/control.py:1-10", - "span_start": 1, - "span_end": 10, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": null, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.plba.control", - "is_test": false, - "blob_sha": "31bd5c4481bfa7fbca8fae56d4860a67e3953ca74474ac8439e1f39b685d7bc8", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "class IntervalRoutine:\n calls: list[float] = field(default_factory=list)\n _lock: Lock = field(default_factory=Lock)\n\n def run(self) -> None:\n with self._lock:\n self.calls.append(monotonic())\n\n def wait_runs(self, count: int, timeout: float) -> bool:\n deadline = monotonic() + timeout\n while monotonic() < deadline:\n with self._lock:\n if len(self.calls) >= count:\n return True\n sleep(0.01)\n return False\n\n def deltas(self) -> list[float]:\n with self._lock:\n return [self.calls[index + 1] - self.calls[index] for index in range(len(self.calls) - 1)]", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:IntervalRoutine", - "span_start": 18, - "span_end": 37, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": null, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "class HttpControlChannel(ControlChannel):\n def __init__(self, host: str, port: int, timeout: int) -> None:\n self._timeout = timeout\n self._runner = UvicornThreadRunner(host, port, timeout)\n self._factory = HttpControlAppFactory()\n self._actions: ControlActionSet | None = None\n\n async def start(self, actions: ControlActionSet) -> None:\n self._actions = actions\n app = self._factory.create(self._health_response, self._action_response)\n await self._runner.start(app)\n\n async def stop(self) -> None:\n await self._runner.stop()\n\n @property\n def port(self) -> int:\n return self._runner.port\n\n async def _health_response(self) -> dict[str, object]:\n if self._actions is None:\n return {\"status\": \"unhealthy\", \"detail\": \"control actions are not configured\"}\n return await asyncio.wait_for(self._actions.health(), timeout=float(self._timeout))\n\n async def _action_response(self, action: str, _client_source: str = \"unknown\") -> JSONResponse:\n if self._actions is None:\n return JSONResponse(content={\"status\": \"error\", \"detail\": f\"{action} handler is not configured\"}, status_code=404)\n callbacks = {\n \"start\": self._actions.start,\n \"stop\": self._actions.stop,\n \"status\": self._actions.status,\n }\n callback = callbacks.get(action)\n if callback is None:\n return JSONResponse(content={\"status\": \"error\", \"detail\": f\"unsupported action: {action}\"}, status_code=404)\n action_timeout = max(float(self._timeout), 10.0) if action in {\"start\", \"stop\"} else float(self._timeout)\n try:\n detail = await asyncio.wait_for(callback(), timeout=action_timeout)\n except asyncio.TimeoutError:\n return JSONResponse(\n content={\"status\": \"accepted\", \"detail\": f\"{action} operation is still in progress\"},\n status_code=202,\n )\n except Exception as exc:\n return JSONResponse(content={\"status\": \"error\", \"detail\": str(exc)}, status_code=500)\n return JSONResponse(content={\"status\": \"ok\", \"detail\": detail or f\"{action} action accepted\"}, status_code=200)", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/http_channel.py:HttpControlChannel", - "span_start": 12, - "span_end": 57, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": null, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.http_channel", - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "class HttpControlAppFactory:\n def create(\n self,\n health_provider: Callable[[], Awaitable[HealthPayload]],\n action_provider: Callable[[str, str], Awaitable[JSONResponse]],\n ) -> FastAPI:\n app = FastAPI(title=\"PLBA Control API\")\n\n @app.middleware(\"http\")\n async def log_api_call(request: Request, call_next): # type: ignore[no-untyped-def]\n started = time.monotonic()\n response = await call_next(request)\n response.headers[\"X-Response-Time-Ms\"] = str(int((time.monotonic() - started) * 1000))\n return response\n\n @app.get(\"/health\")\n async def health() -> JSONResponse:\n payload = await health_provider()\n status_code = 200 if payload.get(\"status\") == \"ok\" else 503\n return JSONResponse(content=payload, status_code=status_code)\n\n @app.get(\"/actions/{action}\")\n @app.post(\"/actions/{action}\")\n async def action(action: str, request: Request) -> JSONResponse:\n client_source = self._client_source(request)\n if action in {\"start\", \"stop\"}:\n LOGGER.warning(\"Control action requested: /actions/%s client=%s\", action, client_source)\n return await action_provider(action, client_source)\n\n return app\n\n def _client_source(self, request: Request) -> str:\n explicit_header = request.headers.get(\"X-Client-Source\", \"\").strip()\n if explicit_header:\n return explicit_header\n user_agent = request.headers.get(\"User-Agent\", \"\").strip()\n if user_agent:\n return f\"user-agent:{user_agent}\"\n return \"unknown\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/http_app.py:HttpControlAppFactory", - "span_start": 15, - "span_end": 53, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": null, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.http_app", - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_runner.py", - "content": "class UvicornThreadRunner:\n def __init__(self, host: str, port: int, timeout: int) -> None:\n self._host = host\n self._port = port\n self._timeout = timeout\n self._server: Server | None = None\n self._thread: Thread | None = None\n self._error: BaseException | None = None\n\n async def start(self, app: FastAPI) -> None:\n if self._thread is not None and self._thread.is_alive():\n return\n self._error = None\n config = Config(app=app, host=self._host, port=self._port, log_level=\"warning\")\n self._server = Server(config)\n self._thread = Thread(target=self._serve, name=\"plba-http-control\", daemon=True)\n self._thread.start()\n await self._wait_until_started()\n\n async def stop(self) -> None:\n if self._server is None or self._thread is None:\n return\n self._server.should_exit = True\n await asyncio.to_thread(self._thread.join, self._timeout)\n self._server = None\n self._thread = None\n\n @property\n def port(self) -> int:\n if self._server is None or not getattr(self._server, \"servers\", None):\n return self._port\n socket = self._server.servers[0].sockets[0]\n return int(socket.getsockname()[1])\n\n async def _wait_until_started(self) -> None:\n if self._server is None:\n raise RuntimeError(\"Server is not initialized\")\n deadline = asyncio.get_running_loop().time() + max(float(self._timeout), 1.0)\n while not self._server.started:\n if self._error is not None:\n raise RuntimeError(\"HTTP control server failed to start\") from self._error\n if asyncio.get_running_loop().time() >= deadline:\n raise TimeoutError(\"HTTP control server startup timed out\")\n await asyncio.sleep(0.05)\n\n def _serve(self) -> None:\n if self._server is None:\n return\n try:\n asyncio.run(self._server.serve())\n except BaseException as exc: # noqa: BLE001\n self._error = exc", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/http_runner.py:UvicornThreadRunner", - "span_start": 10, - "span_end": 61, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": null, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.http_runner", - "is_test": false, - "blob_sha": "3779fdd2878b770e789a35bb2a89c9d79f13b61c26d7db1b3b683f9bb9e1623f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "class ControlPlaneService:\n def __init__(self) -> None:\n self._channels: list[ControlChannel] = []\n\n def register_channel(self, channel: ControlChannel) -> None:\n self._channels.append(channel)\n\n def start(self, runtime: RuntimeManager) -> None:\n if not self._channels:\n return\n asyncio.run(self._start_async(runtime))\n\n def stop(self) -> None:\n if not self._channels:\n return\n asyncio.run(self._stop_async())\n\n def snapshot(self, runtime: RuntimeManager) -> dict[str, object]:\n health = runtime.current_health()\n return {\n \"runtime\": {\"state\": runtime._state.value},\n \"modules\": list(runtime.registry.modules),\n \"services\": runtime.services.snapshot(),\n \"workers\": runtime.workers.snapshot(),\n \"health\": runtime.health.snapshot(runtime.workers.healths()) | {\"status\": health[\"status\"]},\n \"config\": runtime.configuration.get(),\n }\n\n async def _start_async(self, runtime: RuntimeManager) -> None:\n actions = ControlActionSet(\n health=runtime.health_status,\n start=runtime.start_runtime,\n stop=runtime.stop_runtime,\n status=runtime.runtime_status,\n )\n for channel in self._channels:\n await channel.start(actions)\n\n async def _stop_async(self) -> None:\n for channel in reversed(self._channels):\n await channel.stop()", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/service.py:ControlPlaneService", - "span_start": 12, - "span_end": 52, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": null, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.service", - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "class ControlActionSet:\n health: HealthHandler\n start: ActionHandler\n stop: ActionHandler\n status: ActionHandler", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/base.py:ControlActionSet", - "span_start": 14, - "span_end": 18, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": null, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.base", - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/__init__.py", - "content": "from app_runtime.control.base import ControlActionSet, ControlChannel\nfrom app_runtime.control.http_channel import HttpControlChannel\nfrom app_runtime.control.service import ControlPlaneService\n\n__all__ = [\"ControlActionSet\", \"ControlChannel\", \"ControlPlaneService\", \"HttpControlChannel\"]", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/__init__.py:1-5", - "span_start": 1, - "span_end": 5, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": null, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.app_runtime.control.__init__", - "is_test": false, - "blob_sha": "bf3c37e3369a84cc618adc0fd71c232e5eb4b871eaff743069a17e661e498316", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "class ControlChannel(ABC):\n @abstractmethod\n async def start(self, actions: ControlActionSet) -> None:\n \"\"\"Start the control channel and bind handlers.\"\"\"\n\n @abstractmethod\n async def stop(self) -> None:\n \"\"\"Stop the control channel and release resources.\"\"\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/base.py:ControlChannel", - "span_start": 21, - "span_end": 28, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": null, - "metadata": { - "chunk_index": 1, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.base", - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "class BlockingRoutine:\n def __init__(self, started: Event, release: Event) -> None:\n self._started = started\n self._release = release\n\n def run(self) -> None:\n self._started.set()\n self._release.wait(timeout=5.0)", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:BlockingRoutine", - "span_start": 40, - "span_end": 47, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": null, - "metadata": { - "chunk_index": 1, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "retrieval_report": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "vector", - "C2_DEPENDENCY_GRAPH": "vector", - "C0_SOURCE_CHUNKS": "vector" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C0_SOURCE_CHUNKS": 10 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [] - } - }, - "fallback": { - "used": false, - "reason": null - }, - "retrieval_by_layer_ms": { - "C1_SYMBOL_CATALOG": 48, - "C2_DEPENDENCY_GRAPH": 59, - "C0_SOURCE_CHUNKS": 21 - } - } - }, - "diagnostics": { - "intent_correct": null, - "target_found": true, - "layers_used": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ], - "retrieval_sufficient": true, - "answer_mode": "normal", - "resolved_target": "RuntimeManager", - "answer_policy_branch": "normal_answer", - "decision_reason": "evidence_sufficient", - "router_result": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "retrieval_profile": "code", - "sub_intent": "FIND_TESTS", - "path_scope": [], - "layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ], - "symbol_resolution_status": "resolved" - }, - "retrieval_request": { - "rag_session_id": "7d11da21-faa0-4cea-aede-aeabe069164c", - "query": "Где тесты для RuntimeManager?", - "sub_intent": "FIND_TESTS", - "path_scope": [], - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ] - }, - "per_layer_outcome": [ - { - "layer_id": "C1_SYMBOL_CATALOG", - "hit_count": 8, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C2_DEPENDENCY_GRAPH", - "hit_count": 6, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C0_SOURCE_CHUNKS", - "hit_count": 10, - "empty": false, - "fallback_used": false - } - ], - "empty_layers": [], - "evidence_gate_decision": { - "sufficient": true, - "failure_reasons": [], - "evidence_count": 24 - }, - "evidence_gate_input": { - "resolved_target": "RuntimeManager", - "sub_intent": "FIND_TESTS", - "target_type": "symbol", - "evidence_count": 24, - "code_chunk_count": 24, - "entrypoint_count": 0, - "relation_count": 6, - "test_evidence_count": 2, - "symbol_resolution_status": "resolved", - "path_scope": [] - }, - "post_evidence_gate": { - "input": { - "answer_mode": "normal", - "degraded_message": "", - "resolved_target": "RuntimeManager", - "draft_answer_preview": "Прямые тесты для `RuntimeManager` находятся в файле `tests/test_runtime.py`.\n\nКосвенные тесты:\n- В файле `tests/test_business_control_actions.py` есть тесты, использующие компоненты контроля, которые взаимодействуют с `RuntimeManager`.", - "repair_candidate": true - }, - "output": { - "passed": true, - "action": "return", - "reasons": [], - "repair_used": false, - "final_answer_preview": "Прямые тесты для `RuntimeManager` находятся в файле `tests/test_runtime.py`.\n\nКосвенные тесты:\n- В файле `tests/test_business_control_actions.py` есть тесты, использующие компоненты контроля, которые взаимодействуют с `RuntimeManager`." - } - }, - "failure_reasons": [], - "timings_ms": { - "router": 1, - "retrieval": 129, - "pre_evidence_gate": 1, - "llm": 1551, - "post_evidence_gate": 1 - } - }, - "rag_rows": [ - { - "path": "src/plba/bootstrap.py", - "content": "const RuntimeManager\nRuntimeManager = app_runtime.core.runtime.RuntimeManager", - "layer": "C1_SYMBOL_CATALOG", - "title": "RuntimeManager", - "span_start": 4, - "span_end": 4, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "27158ca220022eeb5083c6addf8a50775d45f7161284fd60aac48410105f4b98", - "qname": "RuntimeManager", - "kind": "const", - "signature": "RuntimeManager = app_runtime.core.runtime.RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "src.plba.bootstrap", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_runtime.py", - "content": "const RuntimeManager\nRuntimeManager = app_runtime.core.runtime.RuntimeManager", - "layer": "C1_SYMBOL_CATALOG", - "title": "RuntimeManager", - "span_start": 12, - "span_end": 12, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "aeadc039653807b0da1ca6e3cc1078ee61cfc510b28e7f9c2ec04c59da43cc8d", - "qname": "RuntimeManager", - "kind": "const", - "signature": "RuntimeManager = app_runtime.core.runtime.RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "tests.test_runtime", - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "class RuntimeManager\nRuntimeManager", - "layer": "C1_SYMBOL_CATALOG", - "title": "RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "7e4a9381328c5803bbc6179458612fc4e947d928aa7bf8b4b2bebb2c8592f758", - "qname": "RuntimeManager", - "kind": "class", - "signature": "RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.core.runtime", - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/__init__.py", - "content": "const RuntimeManager\nRuntimeManager = plba.core.RuntimeManager", - "layer": "C1_SYMBOL_CATALOG", - "title": "RuntimeManager", - "span_start": 16, - "span_end": 16, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "7eacec84f9b8d6c4201374591faecdac7493091c263681495c338973f2971ad9", - "qname": "RuntimeManager", - "kind": "const", - "signature": "RuntimeManager = plba.core.RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "src.plba.__init__", - "is_test": false, - "blob_sha": "24e755ec8c249d14fb0e675b5dbf2b71ab91afb9c849897eebfa9feb2499e19d", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/core.py", - "content": "const RuntimeManager\nRuntimeManager = app_runtime.core.runtime.RuntimeManager", - "layer": "C1_SYMBOL_CATALOG", - "title": "RuntimeManager", - "span_start": 2, - "span_end": 2, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "e1684562d978b7af7fe9b27dc5869d770348a87b5dc19a50360f58544668578b", - "qname": "RuntimeManager", - "kind": "const", - "signature": "RuntimeManager = app_runtime.core.runtime.RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "src.plba.core", - "is_test": false, - "blob_sha": "c0ae25110d20e665216616e26b68adfe035b624ba45d31d1272fb21f906f9ca8", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "const RuntimeManager\nRuntimeManager = app_runtime.core.runtime.RuntimeManager", - "layer": "C1_SYMBOL_CATALOG", - "title": "RuntimeManager", - "span_start": 14, - "span_end": 14, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "a1572ea8183dc0cd6ddbc74342bbde8c28cecfde37ad40b62feff09f8d103d11", - "qname": "RuntimeManager", - "kind": "const", - "signature": "RuntimeManager = app_runtime.core.runtime.RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "const RuntimeManager\nRuntimeManager = app_runtime.core.runtime.RuntimeManager", - "layer": "C1_SYMBOL_CATALOG", - "title": "RuntimeManager", - "span_start": 9, - "span_end": 9, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "62a9575c77aad894120d18b4f2a08cf2ba42f77e9be4a8a432b767d157701afe", - "qname": "RuntimeManager", - "kind": "const", - "signature": "RuntimeManager = app_runtime.core.runtime.RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.control.service", - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/__init__.py", - "content": "const ControlPlaneService\nControlPlaneService = app_runtime.control.service.ControlPlaneService", - "layer": "C1_SYMBOL_CATALOG", - "title": "ControlPlaneService", - "span_start": 3, - "span_end": 3, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "217e8f044d1c01644bf7b81e5046af9e84469210c692a2fb0c476a19bb069ae1", - "qname": "ControlPlaneService", - "kind": "const", - "signature": "ControlPlaneService = app_runtime.control.service.ControlPlaneService", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.control.__init__", - "is_test": false, - "blob_sha": "bf3c37e3369a84cc618adc0fd71c232e5eb4b871eaff743069a17e661e498316", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.stop", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 25, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d", - "dst_ref": "ControlPlaneService.stop", - "resolution": "resolved", - "slice_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.stop" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._stop_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 51, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a", - "dst_ref": "ControlPlaneService._stop_async", - "resolution": "resolved", - "slice_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._stop_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.register_channel", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 17, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957", - "dst_ref": "ControlPlaneService.register_channel", - "resolution": "resolved", - "slice_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.register_channel" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.start", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 20, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154", - "dst_ref": "ControlPlaneService.start", - "resolution": "resolved", - "slice_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.start" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._start_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 47, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517", - "dst_ref": "ControlPlaneService._start_async", - "resolution": "resolved", - "slice_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._start_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager.add_config_file", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 32, - "span_end": 52, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "a23b8a11ebdb12708b60c96ea12a69f7f042082f1adfddd572444e246d81d167", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "57ffbd4f0d9fdf3507c2b8624312ce211f3d02fdf86a57a8ec90778d8a7b498d", - "dst_ref": "RuntimeManager.add_config_file", - "resolution": "resolved", - "slice_id": "a23b8a11ebdb12708b60c96ea12a69f7f042082f1adfddd572444e246d81d167", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager.add_config_file" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "57ffbd4f0d9fdf3507c2b8624312ce211f3d02fdf86a57a8ec90778d8a7b498d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/control.py", - "content": "from app_runtime.control.base import ControlActionSet, ControlChannel\nfrom app_runtime.control.http_channel import HttpControlChannel\nfrom app_runtime.control.service import ControlPlaneService\n\n__all__ = [\n \"ControlActionSet\",\n \"ControlChannel\",\n \"ControlPlaneService\",\n \"HttpControlChannel\",\n]", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/plba/control.py:1-10", - "span_start": 1, - "span_end": 10, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.plba.control", - "is_test": false, - "blob_sha": "31bd5c4481bfa7fbca8fae56d4860a67e3953ca74474ac8439e1f39b685d7bc8", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "class IntervalRoutine:\n calls: list[float] = field(default_factory=list)\n _lock: Lock = field(default_factory=Lock)\n\n def run(self) -> None:\n with self._lock:\n self.calls.append(monotonic())\n\n def wait_runs(self, count: int, timeout: float) -> bool:\n deadline = monotonic() + timeout\n while monotonic() < deadline:\n with self._lock:\n if len(self.calls) >= count:\n return True\n sleep(0.01)\n return False\n\n def deltas(self) -> list[float]:\n with self._lock:\n return [self.calls[index + 1] - self.calls[index] for index in range(len(self.calls) - 1)]", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:IntervalRoutine", - "span_start": 18, - "span_end": 37, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "class HttpControlChannel(ControlChannel):\n def __init__(self, host: str, port: int, timeout: int) -> None:\n self._timeout = timeout\n self._runner = UvicornThreadRunner(host, port, timeout)\n self._factory = HttpControlAppFactory()\n self._actions: ControlActionSet | None = None\n\n async def start(self, actions: ControlActionSet) -> None:\n self._actions = actions\n app = self._factory.create(self._health_response, self._action_response)\n await self._runner.start(app)\n\n async def stop(self) -> None:\n await self._runner.stop()\n\n @property\n def port(self) -> int:\n return self._runner.port\n\n async def _health_response(self) -> dict[str, object]:\n if self._actions is None:\n return {\"status\": \"unhealthy\", \"detail\": \"control actions are not configured\"}\n return await asyncio.wait_for(self._actions.health(), timeout=float(self._timeout))\n\n async def _action_response(self, action: str, _client_source: str = \"unknown\") -> JSONResponse:\n if self._actions is None:\n return JSONResponse(content={\"status\": \"error\", \"detail\": f\"{action} handler is not configured\"}, status_code=404)\n callbacks = {\n \"start\": self._actions.start,\n \"stop\": self._actions.stop,\n \"status\": self._actions.status,\n }\n callback = callbacks.get(action)\n if callback is None:\n return JSONResponse(content={\"status\": \"error\", \"detail\": f\"unsupported action: {action}\"}, status_code=404)\n action_timeout = max(float(self._timeout), 10.0) if action in {\"start\", \"stop\"} else float(self._timeout)\n try:\n detail = await asyncio.wait_for(callback(), timeout=action_timeout)\n except asyncio.TimeoutError:\n return JSONResponse(\n content={\"status\": \"accepted\", \"detail\": f\"{action} operation is still in progress\"},\n status_code=202,\n )\n except Exception as exc:\n return JSONResponse(content={\"status\": \"error\", \"detail\": str(exc)}, status_code=500)\n return JSONResponse(content={\"status\": \"ok\", \"detail\": detail or f\"{action} action accepted\"}, status_code=200)", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/http_channel.py:HttpControlChannel", - "span_start": 12, - "span_end": 57, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.http_channel", - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "class HttpControlAppFactory:\n def create(\n self,\n health_provider: Callable[[], Awaitable[HealthPayload]],\n action_provider: Callable[[str, str], Awaitable[JSONResponse]],\n ) -> FastAPI:\n app = FastAPI(title=\"PLBA Control API\")\n\n @app.middleware(\"http\")\n async def log_api_call(request: Request, call_next): # type: ignore[no-untyped-def]\n started = time.monotonic()\n response = await call_next(request)\n response.headers[\"X-Response-Time-Ms\"] = str(int((time.monotonic() - started) * 1000))\n return response\n\n @app.get(\"/health\")\n async def health() -> JSONResponse:\n payload = await health_provider()\n status_code = 200 if payload.get(\"status\") == \"ok\" else 503\n return JSONResponse(content=payload, status_code=status_code)\n\n @app.get(\"/actions/{action}\")\n @app.post(\"/actions/{action}\")\n async def action(action: str, request: Request) -> JSONResponse:\n client_source = self._client_source(request)\n if action in {\"start\", \"stop\"}:\n LOGGER.warning(\"Control action requested: /actions/%s client=%s\", action, client_source)\n return await action_provider(action, client_source)\n\n return app\n\n def _client_source(self, request: Request) -> str:\n explicit_header = request.headers.get(\"X-Client-Source\", \"\").strip()\n if explicit_header:\n return explicit_header\n user_agent = request.headers.get(\"User-Agent\", \"\").strip()\n if user_agent:\n return f\"user-agent:{user_agent}\"\n return \"unknown\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/http_app.py:HttpControlAppFactory", - "span_start": 15, - "span_end": 53, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.http_app", - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_runner.py", - "content": "class UvicornThreadRunner:\n def __init__(self, host: str, port: int, timeout: int) -> None:\n self._host = host\n self._port = port\n self._timeout = timeout\n self._server: Server | None = None\n self._thread: Thread | None = None\n self._error: BaseException | None = None\n\n async def start(self, app: FastAPI) -> None:\n if self._thread is not None and self._thread.is_alive():\n return\n self._error = None\n config = Config(app=app, host=self._host, port=self._port, log_level=\"warning\")\n self._server = Server(config)\n self._thread = Thread(target=self._serve, name=\"plba-http-control\", daemon=True)\n self._thread.start()\n await self._wait_until_started()\n\n async def stop(self) -> None:\n if self._server is None or self._thread is None:\n return\n self._server.should_exit = True\n await asyncio.to_thread(self._thread.join, self._timeout)\n self._server = None\n self._thread = None\n\n @property\n def port(self) -> int:\n if self._server is None or not getattr(self._server, \"servers\", None):\n return self._port\n socket = self._server.servers[0].sockets[0]\n return int(socket.getsockname()[1])\n\n async def _wait_until_started(self) -> None:\n if self._server is None:\n raise RuntimeError(\"Server is not initialized\")\n deadline = asyncio.get_running_loop().time() + max(float(self._timeout), 1.0)\n while not self._server.started:\n if self._error is not None:\n raise RuntimeError(\"HTTP control server failed to start\") from self._error\n if asyncio.get_running_loop().time() >= deadline:\n raise TimeoutError(\"HTTP control server startup timed out\")\n await asyncio.sleep(0.05)\n\n def _serve(self) -> None:\n if self._server is None:\n return\n try:\n asyncio.run(self._server.serve())\n except BaseException as exc: # noqa: BLE001\n self._error = exc", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/http_runner.py:UvicornThreadRunner", - "span_start": 10, - "span_end": 61, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.http_runner", - "is_test": false, - "blob_sha": "3779fdd2878b770e789a35bb2a89c9d79f13b61c26d7db1b3b683f9bb9e1623f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "class ControlPlaneService:\n def __init__(self) -> None:\n self._channels: list[ControlChannel] = []\n\n def register_channel(self, channel: ControlChannel) -> None:\n self._channels.append(channel)\n\n def start(self, runtime: RuntimeManager) -> None:\n if not self._channels:\n return\n asyncio.run(self._start_async(runtime))\n\n def stop(self) -> None:\n if not self._channels:\n return\n asyncio.run(self._stop_async())\n\n def snapshot(self, runtime: RuntimeManager) -> dict[str, object]:\n health = runtime.current_health()\n return {\n \"runtime\": {\"state\": runtime._state.value},\n \"modules\": list(runtime.registry.modules),\n \"services\": runtime.services.snapshot(),\n \"workers\": runtime.workers.snapshot(),\n \"health\": runtime.health.snapshot(runtime.workers.healths()) | {\"status\": health[\"status\"]},\n \"config\": runtime.configuration.get(),\n }\n\n async def _start_async(self, runtime: RuntimeManager) -> None:\n actions = ControlActionSet(\n health=runtime.health_status,\n start=runtime.start_runtime,\n stop=runtime.stop_runtime,\n status=runtime.runtime_status,\n )\n for channel in self._channels:\n await channel.start(actions)\n\n async def _stop_async(self) -> None:\n for channel in reversed(self._channels):\n await channel.stop()", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/service.py:ControlPlaneService", - "span_start": 12, - "span_end": 52, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.service", - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "class ControlActionSet:\n health: HealthHandler\n start: ActionHandler\n stop: ActionHandler\n status: ActionHandler", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/base.py:ControlActionSet", - "span_start": 14, - "span_end": 18, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.base", - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/__init__.py", - "content": "from app_runtime.control.base import ControlActionSet, ControlChannel\nfrom app_runtime.control.http_channel import HttpControlChannel\nfrom app_runtime.control.service import ControlPlaneService\n\n__all__ = [\"ControlActionSet\", \"ControlChannel\", \"ControlPlaneService\", \"HttpControlChannel\"]", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/__init__.py:1-5", - "span_start": 1, - "span_end": 5, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.app_runtime.control.__init__", - "is_test": false, - "blob_sha": "bf3c37e3369a84cc618adc0fd71c232e5eb4b871eaff743069a17e661e498316", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "class ControlChannel(ABC):\n @abstractmethod\n async def start(self, actions: ControlActionSet) -> None:\n \"\"\"Start the control channel and bind handlers.\"\"\"\n\n @abstractmethod\n async def stop(self) -> None:\n \"\"\"Stop the control channel and release resources.\"\"\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/base.py:ControlChannel", - "span_start": 21, - "span_end": 28, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 1, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.base", - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "class BlockingRoutine:\n def __init__(self, started: Event, release: Event) -> None:\n self._started = started\n self._release = release\n\n def run(self) -> None:\n self._started.set()\n self._release.wait(timeout=5.0)", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:BlockingRoutine", - "span_start": 40, - "span_end": 47, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 1, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "validation": { - "passed": true, - "action": "return", - "reasons": [] - }, - "steps": [ - { - "step": "router", - "status": "completed", - "timings_ms": { - "router": 1 - }, - "output": { - "intent": "CODE_QA", - "sub_intent": "FIND_TESTS", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - } - }, - { - "step": "retrieval", - "status": "completed", - "timings_ms": { - "retrieval": 129 - }, - "output": { - "rag_count": 24, - "answer_path_rag_count": 24, - "resolved_symbol_status": "resolved", - "resolved_symbol": "RuntimeManager", - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ] - }, - "diagnostics": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "vector", - "C2_DEPENDENCY_GRAPH": "vector", - "C0_SOURCE_CHUNKS": "vector" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C0_SOURCE_CHUNKS": 10 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [] - } - }, - "fallback": { - "used": false, - "reason": null - }, - "retrieval_by_layer_ms": { - "C1_SYMBOL_CATALOG": 48, - "C2_DEPENDENCY_GRAPH": 59, - "C0_SOURCE_CHUNKS": 21 - } - } - }, - { - "step": "pre_evidence_gate", - "status": "passed", - "timings_ms": { - "pre_evidence_gate": 1 - }, - "input": { - "resolved_target": "RuntimeManager", - "sub_intent": "FIND_TESTS", - "target_type": "symbol", - "evidence_count": 24, - "code_chunk_count": 24, - "entrypoint_count": 0, - "relation_count": 6, - "test_evidence_count": 2, - "symbol_resolution_status": "resolved", - "path_scope": [] - }, - "output": { - "passed": true, - "failure_reasons": [], - "degraded_message": "", - "evidence_count": 24 - } - }, - { - "step": "llm", - "status": "completed", - "timings_ms": { - "llm": 1551 - }, - "output": { - "prompt_name": "code_qa_find_tests_answer", - "answer_preview": "Прямые тесты для `RuntimeManager` находятся в файле `tests/test_runtime.py`.\n\nКосвенные тесты:\n- В файле `tests/test_business_control_actions.py` есть тесты, использующие компоненты контроля, которые взаимодействуют с `RuntimeManager`.", - "resolved_target": "RuntimeManager", - "answer_policy_branch": "normal_answer", - "decision_reason": "evidence_sufficient" - } - }, - { - "step": "post_evidence_gate", - "status": "passed", - "timings_ms": { - "post_evidence_gate": 1, - "post_evidence_gate_recheck": 0, - "repair": 0 - }, - "input": { - "answer_mode": "normal", - "degraded_message": "", - "resolved_target": "RuntimeManager", - "draft_answer_preview": "Прямые тесты для `RuntimeManager` находятся в файле `tests/test_runtime.py`.\n\nКосвенные тесты:\n- В файле `tests/test_business_control_actions.py` есть тесты, использующие компоненты контроля, которые взаимодействуют с `RuntimeManager`.", - "repair_candidate": true - }, - "output": { - "passed": true, - "action": "return", - "reasons": [], - "repair_used": false, - "final_answer_preview": "Прямые тесты для `RuntimeManager` находятся в файле `tests/test_runtime.py`.\n\nКосвенные тесты:\n- В файле `tests/test_business_control_actions.py` есть тесты, использующие компоненты контроля, которые взаимодействуют с `RuntimeManager`." - } - } - ] - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/plba_full_chain_subintents_v3/20260312_174008/full_chain_plba_code_subintents_v2_plba-v2-find-tests-runtime-manager.md b/tests/pipeline_setup_v3/test_results/plba_full_chain_subintents_v3/20260312_174008/full_chain_plba_code_subintents_v2_plba-v2-find-tests-runtime-manager.md deleted file mode 100644 index a4e89a9..0000000 --- a/tests/pipeline_setup_v3/test_results/plba_full_chain_subintents_v3/20260312_174008/full_chain_plba_code_subintents_v2_plba-v2-find-tests-runtime-manager.md +++ /dev/null @@ -1,269 +0,0 @@ -# plba-v2-find-tests-runtime-manager - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_02_pipeline/full_chain_plba_code_subintents_v2.yaml -- runner: agent_runtime -- mode: full_chain -- passed: True - -## Query -Где тесты для RuntimeManager? - -## Actual -{ - "intent": "CODE_QA", - "sub_intent": "FIND_TESTS", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 24, - "llm_answer": "Прямые тесты для `RuntimeManager` находятся в файле `tests/test_runtime.py`.\n\nКосвенные тесты:\n- В файле `tests/test_business_control_actions.py` есть тесты, использующие компоненты контроля, которые взаимодействуют с `RuntimeManager`.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "RuntimeManager" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ] -} - -## Steps -[ - { - "step": "router", - "status": "completed", - "timings_ms": { - "router": 1 - }, - "output": { - "intent": "CODE_QA", - "sub_intent": "FIND_TESTS", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - } - }, - { - "step": "retrieval", - "status": "completed", - "timings_ms": { - "retrieval": 129 - }, - "output": { - "rag_count": 24, - "answer_path_rag_count": 24, - "resolved_symbol_status": "resolved", - "resolved_symbol": "RuntimeManager", - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ] - }, - "diagnostics": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "vector", - "C2_DEPENDENCY_GRAPH": "vector", - "C0_SOURCE_CHUNKS": "vector" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C0_SOURCE_CHUNKS": 10 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [] - } - }, - "fallback": { - "used": false, - "reason": null - }, - "retrieval_by_layer_ms": { - "C1_SYMBOL_CATALOG": 48, - "C2_DEPENDENCY_GRAPH": 59, - "C0_SOURCE_CHUNKS": 21 - } - } - }, - { - "step": "pre_evidence_gate", - "status": "passed", - "timings_ms": { - "pre_evidence_gate": 1 - }, - "input": { - "resolved_target": "RuntimeManager", - "sub_intent": "FIND_TESTS", - "target_type": "symbol", - "evidence_count": 24, - "code_chunk_count": 24, - "entrypoint_count": 0, - "relation_count": 6, - "test_evidence_count": 2, - "symbol_resolution_status": "resolved", - "path_scope": [] - }, - "output": { - "passed": true, - "failure_reasons": [], - "degraded_message": "", - "evidence_count": 24 - } - }, - { - "step": "llm", - "status": "completed", - "timings_ms": { - "llm": 1551 - }, - "output": { - "prompt_name": "code_qa_find_tests_answer", - "answer_preview": "Прямые тесты для `RuntimeManager` находятся в файле `tests/test_runtime.py`.\n\nКосвенные тесты:\n- В файле `tests/test_business_control_actions.py` есть тесты, использующие компоненты контроля, которые взаимодействуют с `RuntimeManager`.", - "resolved_target": "RuntimeManager", - "answer_policy_branch": "normal_answer", - "decision_reason": "evidence_sufficient" - } - }, - { - "step": "post_evidence_gate", - "status": "passed", - "timings_ms": { - "post_evidence_gate": 1, - "post_evidence_gate_recheck": 0, - "repair": 0 - }, - "input": { - "answer_mode": "normal", - "degraded_message": "", - "resolved_target": "RuntimeManager", - "draft_answer_preview": "Прямые тесты для `RuntimeManager` находятся в файле `tests/test_runtime.py`.\n\nКосвенные тесты:\n- В файле `tests/test_business_control_actions.py` есть тесты, использующие компоненты контроля, которые взаимодействуют с `RuntimeManager`.", - "repair_candidate": true - }, - "output": { - "passed": true, - "action": "return", - "reasons": [], - "repair_used": false, - "final_answer_preview": "Прямые тесты для `RuntimeManager` находятся в файле `tests/test_runtime.py`.\n\nКосвенные тесты:\n- В файле `tests/test_business_control_actions.py` есть тесты, использующие компоненты контроля, которые взаимодействуют с `RuntimeManager`." - } - } -] - -## Diagnostics -{ - "intent_correct": null, - "target_found": true, - "layers_used": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ], - "retrieval_sufficient": true, - "answer_mode": "normal", - "resolved_target": "RuntimeManager", - "answer_policy_branch": "normal_answer", - "decision_reason": "evidence_sufficient", - "router_result": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "retrieval_profile": "code", - "sub_intent": "FIND_TESTS", - "path_scope": [], - "layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ], - "symbol_resolution_status": "resolved" - }, - "retrieval_request": { - "rag_session_id": "7d11da21-faa0-4cea-aede-aeabe069164c", - "query": "Где тесты для RuntimeManager?", - "sub_intent": "FIND_TESTS", - "path_scope": [], - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ] - }, - "per_layer_outcome": [ - { - "layer_id": "C1_SYMBOL_CATALOG", - "hit_count": 8, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C2_DEPENDENCY_GRAPH", - "hit_count": 6, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C0_SOURCE_CHUNKS", - "hit_count": 10, - "empty": false, - "fallback_used": false - } - ], - "empty_layers": [], - "evidence_gate_decision": { - "sufficient": true, - "failure_reasons": [], - "evidence_count": 24 - }, - "evidence_gate_input": { - "resolved_target": "RuntimeManager", - "sub_intent": "FIND_TESTS", - "target_type": "symbol", - "evidence_count": 24, - "code_chunk_count": 24, - "entrypoint_count": 0, - "relation_count": 6, - "test_evidence_count": 2, - "symbol_resolution_status": "resolved", - "path_scope": [] - }, - "post_evidence_gate": { - "input": { - "answer_mode": "normal", - "degraded_message": "", - "resolved_target": "RuntimeManager", - "draft_answer_preview": "Прямые тесты для `RuntimeManager` находятся в файле `tests/test_runtime.py`.\n\nКосвенные тесты:\n- В файле `tests/test_business_control_actions.py` есть тесты, использующие компоненты контроля, которые взаимодействуют с `RuntimeManager`.", - "repair_candidate": true - }, - "output": { - "passed": true, - "action": "return", - "reasons": [], - "repair_used": false, - "final_answer_preview": "Прямые тесты для `RuntimeManager` находятся в файле `tests/test_runtime.py`.\n\nКосвенные тесты:\n- В файле `tests/test_business_control_actions.py` есть тесты, использующие компоненты контроля, которые взаимодействуют с `RuntimeManager`." - } - }, - "failure_reasons": [], - "timings_ms": { - "router": 1, - "retrieval": 129, - "pre_evidence_gate": 1, - "llm": 1551, - "post_evidence_gate": 1 - } -} - -## Mismatches -- none \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/plba_full_chain_subintents_v3/20260312_174008/full_chain_plba_code_subintents_v2_plba-v2-find-tests-trace-service.json b/tests/pipeline_setup_v3/test_results/plba_full_chain_subintents_v3/20260312_174008/full_chain_plba_code_subintents_v2_plba-v2-find-tests-trace-service.json deleted file mode 100644 index 38f1f7a..0000000 --- a/tests/pipeline_setup_v3/test_results/plba_full_chain_subintents_v3/20260312_174008/full_chain_plba_code_subintents_v2_plba-v2-find-tests-trace-service.json +++ /dev/null @@ -1,3307 +0,0 @@ -{ - "case_id": "plba-v2-find-tests-trace-service", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_02_pipeline/full_chain_plba_code_subintents_v2.yaml", - "runner": "agent_runtime", - "mode": "full_chain", - "query": "Где тесты для TraceService?", - "actual": { - "intent": "CODE_QA", - "sub_intent": "FIND_TESTS", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 24, - "llm_answer": "Прямые тесты для TraceService находятся в файле `tests/test_runtime.py`:\n\n- `test_trace_service_allows_messages_without_status`: проверяет возможность отправки сообщений без статуса.\n- `test_trace_service_writes_contexts_and_messages`: проверяет запись контекстов и сообщений.\n- `test_trace_service_supports_debug_warning_and_error_levels`: проверяет поддержку уровней debug, warning и error.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "TraceService" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ] - }, - "passed": true, - "mismatches": [], - "details": { - "query": "Где тесты для TraceService?", - "router_result": { - "schema_version": "1.1", - "intent": "CODE_QA", - "retrieval_profile": "code", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query_plan": { - "raw": "Где тесты для TraceService?", - "normalized": "Где тесты для TraceService?", - "sub_intent": "FIND_TESTS", - "negations": [], - "expansions": [ - "test", - "unit test", - "TraceService" - ], - "keyword_hints": [ - "TraceService" - ], - "path_hints": [], - "doc_scope_hints": [], - "symbol_candidates": [ - "TraceService" - ], - "symbol_kind_hint": "class", - "anchors": [ - { - "type": "SYMBOL", - "value": "TraceService", - "source": "user_text", - "subtype": null, - "span": { - "start": 14, - "end": 26 - }, - "confidence": 0.88 - }, - { - "type": "KEY_TERM", - "value": "тест", - "source": "user_text", - "subtype": null, - "span": { - "start": 4, - "end": 9 - }, - "confidence": 0.9 - } - ] - }, - "retrieval_spec": { - "domains": [ - "CODE" - ], - "layer_queries": [ - { - "layer_id": "C1_SYMBOL_CATALOG", - "top_k": 8 - }, - { - "layer_id": "C2_DEPENDENCY_GRAPH", - "top_k": 6 - }, - { - "layer_id": "C0_SOURCE_CHUNKS", - "top_k": 10 - } - ], - "filters": { - "test_policy": "INCLUDE", - "path_scope": [], - "language": [ - "python" - ] - }, - "rerank_profile": "code" - }, - "retrieval_constraints": { - "include_globs": [ - "src/**", - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "test_file_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "test_symbol_patterns": [ - "test_trace_service", - "TestTraceService", - "TraceService" - ], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - }, - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "TraceService", - "alternatives": [ - "TraceService", - "TraceService", - "TraceService", - "TraceService", - "TraceService" - ], - "confidence": 0.99 - }, - "evidence_policy": { - "require_def": true, - "require_flow": true, - "require_spec": false, - "allow_answer_without_evidence": false - } - }, - "retrieval_request": { - "rag_session_id": "7d11da21-faa0-4cea-aede-aeabe069164c", - "query": "Где тесты для TraceService?", - "sub_intent": "FIND_TESTS", - "path_scope": [], - "keyword_hints": [ - "TraceService" - ], - "symbol_candidates": [ - "TraceService" - ], - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ], - "retrieval_spec": { - "domains": [ - "CODE" - ], - "layer_queries": [ - { - "layer_id": "C1_SYMBOL_CATALOG", - "top_k": 8 - }, - { - "layer_id": "C2_DEPENDENCY_GRAPH", - "top_k": 6 - }, - { - "layer_id": "C0_SOURCE_CHUNKS", - "top_k": 10 - } - ], - "filters": { - "test_policy": "INCLUDE", - "path_scope": [], - "language": [ - "python" - ] - }, - "rerank_profile": "code" - }, - "retrieval_constraints": { - "include_globs": [ - "src/**", - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "test_file_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "test_symbol_patterns": [ - "test_trace_service", - "TestTraceService", - "TraceService" - ], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - }, - "query_plan": { - "raw": "Где тесты для TraceService?", - "normalized": "Где тесты для TraceService?", - "sub_intent": "FIND_TESTS", - "negations": [], - "expansions": [ - "test", - "unit test", - "TraceService" - ], - "keyword_hints": [ - "TraceService" - ], - "path_hints": [], - "doc_scope_hints": [], - "symbol_candidates": [ - "TraceService" - ], - "symbol_kind_hint": "class", - "anchors": [ - { - "type": "SYMBOL", - "value": "TraceService", - "source": "user_text", - "subtype": null, - "span": { - "start": 14, - "end": 26 - }, - "confidence": 0.88 - }, - { - "type": "KEY_TERM", - "value": "тест", - "source": "user_text", - "subtype": null, - "span": { - "start": 4, - "end": 9 - }, - "confidence": 0.9 - } - ] - } - }, - "retrieval_result": { - "target_symbol_candidates": [ - "TraceService", - "TraceService.open_context", - "TraceService.create_context", - "TraceService.current_trace_id" - ], - "resolved_symbol": "TraceService", - "symbol_resolution_status": "resolved", - "file_candidates": [ - "src/plba/__init__.py", - "src/app_runtime/core/runtime.py", - "src/app_runtime/tracing/__init__.py", - "src/app_runtime/tracing/service.py", - "src/plba/tracing.py", - "tests/test_runtime.py", - "src/app_runtime/contracts/__init__.py" - ], - "code_chunks": [ - { - "layer": "C1_SYMBOL_CATALOG", - "path": "src/plba/__init__.py", - "title": "TraceService", - "content": "const TraceService\nTraceService = plba.tracing.TraceService", - "start_line": 20, - "end_line": 20, - "metadata": { - "symbol_id": "259ec03b77b9387ea53f69c77af32791dd29adf6de617ba72dd3f839197342a1", - "qname": "TraceService", - "kind": "const", - "signature": "TraceService = plba.tracing.TraceService", - "parent_symbol_id": null, - "package_or_module": "src.plba.__init__", - "is_test": false, - "blob_sha": "24e755ec8c249d14fb0e675b5dbf2b71ab91afb9c849897eebfa9feb2499e19d", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C1_SYMBOL_CATALOG", - "path": "src/app_runtime/core/runtime.py", - "title": "TraceService", - "content": "const TraceService\nTraceService = app_runtime.tracing.service.TraceService", - "start_line": 14, - "end_line": 14, - "metadata": { - "symbol_id": "3ccf6212fd7d9730f9df933e2ee7671b65bdae0520577e1a49c6432262842db6", - "qname": "TraceService", - "kind": "const", - "signature": "TraceService = app_runtime.tracing.service.TraceService", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.core.runtime", - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C1_SYMBOL_CATALOG", - "path": "src/app_runtime/tracing/__init__.py", - "title": "TraceService", - "content": "const TraceService\nTraceService = app_runtime.tracing.service.TraceService", - "start_line": 2, - "end_line": 2, - "metadata": { - "symbol_id": "ecd2fab7fa9744b2adca84d3d213f7aadcb7e1da84b9c2764a4ab39c65282b11", - "qname": "TraceService", - "kind": "const", - "signature": "TraceService = app_runtime.tracing.service.TraceService", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.tracing.__init__", - "is_test": false, - "blob_sha": "a01dea5f773515aeaae8e6d3431fcb93531a8b577dfa26c2e5db16cd6ae6e4d9", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C1_SYMBOL_CATALOG", - "path": "src/app_runtime/tracing/service.py", - "title": "TraceService", - "content": "class TraceService\nTraceService(TraceContextFactory)", - "start_line": 39, - "end_line": 166, - "metadata": { - "symbol_id": "c2b2b976d99f2c600000b753731b26e0a69adcb4359398b93073590c5d5d04f4", - "qname": "TraceService", - "kind": "class", - "signature": "TraceService(TraceContextFactory)", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.tracing.service", - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C1_SYMBOL_CATALOG", - "path": "src/plba/tracing.py", - "title": "TraceService", - "content": "const TraceService\nTraceService = app_runtime.tracing.service.TraceService", - "start_line": 1, - "end_line": 1, - "metadata": { - "symbol_id": "a4556fb3f83c50ea68b94a679786ce802cab7ffd9d7138aad3d6009b2661f425", - "qname": "TraceService", - "kind": "const", - "signature": "TraceService = app_runtime.tracing.service.TraceService", - "parent_symbol_id": null, - "package_or_module": "src.plba.tracing", - "is_test": false, - "blob_sha": "a27e11c716c93c3fcefe6f11b4cc420a6b743e7606606071d7f1aeeccc4e7d45", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C1_SYMBOL_CATALOG", - "path": "src/app_runtime/tracing/service.py", - "title": "TraceService.open_context", - "content": "method TraceService.open_context\nopen_context(self)", - "start_line": 66, - "end_line": 78, - "metadata": { - "symbol_id": "2da3d5b20a947bf63e14c103be4689b72fd837e0a82abd6c497846375d4c7426", - "qname": "TraceService.open_context", - "kind": "method", - "signature": "open_context(self)", - "parent_symbol_id": "TraceService", - "package_or_module": "src.app_runtime.tracing.service", - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C1_SYMBOL_CATALOG", - "path": "src/app_runtime/tracing/service.py", - "title": "TraceService.create_context", - "content": "method TraceService.create_context\ncreate_context(self)", - "start_line": 45, - "end_line": 63, - "metadata": { - "symbol_id": "ff44881104b65ef50ee6fe16d367d4a81b6e7eb5c44c0963cf4543faec785d4a", - "qname": "TraceService.create_context", - "kind": "method", - "signature": "create_context(self)", - "parent_symbol_id": "TraceService", - "package_or_module": "src.app_runtime.tracing.service", - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C1_SYMBOL_CATALOG", - "path": "src/app_runtime/tracing/service.py", - "title": "TraceService.current_trace_id", - "content": "method TraceService.current_trace_id\ncurrent_trace_id(self)", - "start_line": 80, - "end_line": 81, - "metadata": { - "symbol_id": "41135180f7b3b9ab20e097e0747474e219c37dd2366ef08a7b43c1f3edb10b4c", - "qname": "TraceService.current_trace_id", - "kind": "method", - "signature": "current_trace_id(self)", - "parent_symbol_id": "TraceService", - "package_or_module": "src.app_runtime.tracing.service", - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "path": "src/app_runtime/tracing/service.py", - "title": "TraceService.__init__:dataflow_slice", - "content": "TraceService.__init__\n -> TraceService.store\n -> TraceService.create_context", - "start_line": 42, - "end_line": 61, - "metadata": { - "edge_id": "3b052062067a78aef3302ee1d996897e02a67d1b340397bea4f59fe147c0492a", - "edge_type": "dataflow_slice", - "src_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "src_qname": "TraceService.__init__", - "dst_symbol_id": "ff44881104b65ef50ee6fe16d367d4a81b6e7eb5c44c0963cf4543faec785d4a", - "dst_ref": "TraceService.create_context", - "resolution": "resolved", - "slice_id": "3b052062067a78aef3302ee1d996897e02a67d1b340397bea4f59fe147c0492a", - "root_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "path_symbols": [ - "TraceService.__init__", - "TraceService.store", - "TraceService.create_context" - ], - "path_symbol_ids": [ - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "ff44881104b65ef50ee6fe16d367d4a81b6e7eb5c44c0963cf4543faec785d4a" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "path": "src/app_runtime/tracing/service.py", - "title": "TraceService.__init__:dataflow_slice", - "content": "TraceService.__init__\n -> TraceService.store\n -> TraceService.close_context", - "start_line": 42, - "end_line": 84, - "metadata": { - "edge_id": "7a9353ef57c9ae5d19b3a0c6ac50fad05e6d21d31bbe1cd1cd07af6332ba6505", - "edge_type": "dataflow_slice", - "src_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "src_qname": "TraceService.__init__", - "dst_symbol_id": "01e14158dcced7e52d0c8ac84ac7b9a75225c261b6aca6a1d7da802d0994721c", - "dst_ref": "TraceService.close_context", - "resolution": "resolved", - "slice_id": "7a9353ef57c9ae5d19b3a0c6ac50fad05e6d21d31bbe1cd1cd07af6332ba6505", - "root_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "path_symbols": [ - "TraceService.__init__", - "TraceService.store", - "TraceService.close_context" - ], - "path_symbol_ids": [ - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "01e14158dcced7e52d0c8ac84ac7b9a75225c261b6aca6a1d7da802d0994721c" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "path": "src/app_runtime/tracing/service.py", - "title": "TraceService.__init__:dataflow_slice", - "content": "TraceService.__init__\n -> TraceService.store\n -> TraceService.open_context", - "start_line": 42, - "end_line": 78, - "metadata": { - "edge_id": "a6e13b9ebc4fed84586afd53ed92a4d14757e440873f572b2337d5622ee96031", - "edge_type": "dataflow_slice", - "src_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "src_qname": "TraceService.__init__", - "dst_symbol_id": "2da3d5b20a947bf63e14c103be4689b72fd837e0a82abd6c497846375d4c7426", - "dst_ref": "TraceService.open_context", - "resolution": "resolved", - "slice_id": "a6e13b9ebc4fed84586afd53ed92a4d14757e440873f572b2337d5622ee96031", - "root_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "path_symbols": [ - "TraceService.__init__", - "TraceService.store", - "TraceService.open_context" - ], - "path_symbol_ids": [ - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "2da3d5b20a947bf63e14c103be4689b72fd837e0a82abd6c497846375d4c7426" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "path": "src/app_runtime/tracing/service.py", - "title": "TraceService.__init__:dataflow_slice", - "content": "TraceService.__init__\n -> TraceService.transport\n -> TraceService.__init__", - "start_line": 41, - "end_line": 43, - "metadata": { - "edge_id": "1e923a93faa05c3c43ca9b19bd047007a8589ccce57d3cc1798ae7f9f200af98", - "edge_type": "dataflow_slice", - "src_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "src_qname": "TraceService.__init__", - "dst_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "dst_ref": "TraceService.__init__", - "resolution": "resolved", - "slice_id": "1e923a93faa05c3c43ca9b19bd047007a8589ccce57d3cc1798ae7f9f200af98", - "root_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "path_symbols": [ - "TraceService.__init__", - "TraceService.transport", - "TraceService.__init__" - ], - "path_symbol_ids": [ - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "path": "src/app_runtime/tracing/service.py", - "title": "TraceService.__init__:dataflow_slice", - "content": "TraceService.__init__\n -> TraceService.store\n -> TraceService.current_trace_id", - "start_line": 42, - "end_line": 81, - "metadata": { - "edge_id": "3ea17138634b1190bded77ddb84aa1595124f6519b246f24fc4b02bd62b5cac1", - "edge_type": "dataflow_slice", - "src_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "src_qname": "TraceService.__init__", - "dst_symbol_id": "41135180f7b3b9ab20e097e0747474e219c37dd2366ef08a7b43c1f3edb10b4c", - "dst_ref": "TraceService.current_trace_id", - "resolution": "resolved", - "slice_id": "3ea17138634b1190bded77ddb84aa1595124f6519b246f24fc4b02bd62b5cac1", - "root_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "path_symbols": [ - "TraceService.__init__", - "TraceService.store", - "TraceService.current_trace_id" - ], - "path_symbol_ids": [ - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "41135180f7b3b9ab20e097e0747474e219c37dd2366ef08a7b43c1f3edb10b4c" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "path": "src/app_runtime/tracing/service.py", - "title": "TraceService.__init__:dataflow_slice", - "content": "TraceService.__init__\n -> TraceService.store\n -> TraceService.step", - "start_line": 42, - "end_line": 88, - "metadata": { - "edge_id": "9f34c5da9b09fba99df6f6b1bde183a9aeb45111b8218a747c71590c2c9f60f2", - "edge_type": "dataflow_slice", - "src_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "src_qname": "TraceService.__init__", - "dst_symbol_id": "c44bfbc66cf747283f30088da3e011a10395031d41e77b74e523c24997f641ca", - "dst_ref": "TraceService.step", - "resolution": "resolved", - "slice_id": "9f34c5da9b09fba99df6f6b1bde183a9aeb45111b8218a747c71590c2c9f60f2", - "root_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "path_symbols": [ - "TraceService.__init__", - "TraceService.store", - "TraceService.step" - ], - "path_symbol_ids": [ - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "c44bfbc66cf747283f30088da3e011a10395031d41e77b74e523c24997f641ca" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C0_SOURCE_CHUNKS", - "path": "src/plba/tracing.py", - "title": "src/plba/tracing.py:1-4", - "content": "from app_runtime.tracing.service import TraceService\nfrom app_runtime.tracing.transport import MySqlTraceTransport, NoOpTraceTransport\n\n__all__ = [\"MySqlTraceTransport\", \"NoOpTraceTransport\", \"TraceService\"]", - "start_line": 1, - "end_line": 4, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.plba.tracing", - "is_test": false, - "blob_sha": "a27e11c716c93c3fcefe6f11b4cc420a6b743e7606606071d7f1aeeccc4e7d45", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C0_SOURCE_CHUNKS", - "path": "tests/test_runtime.py", - "title": "tests/test_runtime.py:test_trace_service_allows_messages_without_status", - "content": "def test_trace_service_allows_messages_without_status() -> None:\n from app_runtime.tracing.service import TraceService\n\n transport = RecordingTransport()\n manager = TraceService(transport=transport)\n\n with manager.open_context(alias=\"worker\", kind=\"worker\"):\n manager.step(\"optional-status\")\n manager.debug(\"debug without status\")\n manager.info(\"info without status\")\n manager.warning(\"warning without status\")\n manager.error(\"error without status\")\n\n assert [message.status for message in transport.messages] == [\"\", \"\", \"\", \"\"]\n assert all(message.trace_id == transport.contexts[0].trace_id for message in transport.messages)", - "start_line": 279, - "end_line": 293, - "metadata": { - "chunk_index": 11, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_runtime", - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C0_SOURCE_CHUNKS", - "path": "src/app_runtime/tracing/__init__.py", - "title": "src/app_runtime/tracing/__init__.py:1-17", - "content": "from app_runtime.contracts.trace import TraceContext, TraceContextRecord, TraceLogMessage, TraceTransport\nfrom app_runtime.tracing.service import TraceManager, TraceService\nfrom app_runtime.tracing.store import ActiveTraceContext, TraceContextStore\nfrom app_runtime.tracing.transport import MySqlTraceTransport, NoOpTraceTransport\n\n__all__ = [\n \"ActiveTraceContext\",\n \"MySqlTraceTransport\",\n \"NoOpTraceTransport\",\n \"TraceContext\",\n \"TraceContextRecord\",\n \"TraceContextStore\",\n \"TraceLogMessage\",\n \"TraceManager\",\n \"TraceService\",\n \"TraceTransport\",\n]", - "start_line": 1, - "end_line": 17, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.app_runtime.tracing.__init__", - "is_test": false, - "blob_sha": "a01dea5f773515aeaae8e6d3431fcb93531a8b577dfa26c2e5db16cd6ae6e4d9", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C0_SOURCE_CHUNKS", - "path": "src/plba/__init__.py", - "title": "src/plba/__init__.py:1-69", - "content": "from plba.bootstrap import create_runtime\nfrom plba.config import ConfigFileLoader, FileConfigProvider\nfrom plba.control import ControlActionSet, ControlChannel, ControlPlaneService, HttpControlChannel\nfrom plba.contracts import (\n ApplicationModule,\n ConfigProvider,\n HealthContributor,\n TraceContext,\n TraceContextRecord,\n TraceLogMessage,\n TraceTransport,\n Worker,\n WorkerHealth,\n WorkerStatus,\n)\nfrom plba.core import ConfigurationManager, RuntimeManager, ServiceContainer\nfrom plba.health import HealthRegistry\nfrom plba.logging import LogManager\nfrom plba.queue import InMemoryTaskQueue\nfrom plba.tracing import MySqlTraceTransport, NoOpTraceTransport, TraceService\nfrom plba.workflow import (\n StepResult,\n WorkflowContext,\n WorkflowDefinition,\n WorkflowEngine,\n WorkflowEngineHooks,\n WorkflowNode,\n WorkflowRuntimeFactory,\n WorkflowStep,\n)\nfrom plba.workers import WorkerSupervisor\n\n__all__ = [\n \"ApplicationModule\",\n \"ConfigFileLoader\",\n \"ConfigProvider\",\n \"ConfigurationManager\",\n \"ControlActionSet\",\n \"ControlChannel\",\n \"ControlPlaneService\",\n \"create_runtime\",\n \"FileConfigProvider\",\n \"HealthContributor\",\n \"HealthRegistry\",\n \"HttpControlChannel\",\n \"InMemoryTaskQueue\",\n \"LogManager\",\n \"MySqlTraceTransport\",\n \"NoOpTraceTransport\",\n \"RuntimeManager\",\n \"ServiceContainer\",\n \"TraceContext\",\n \"TraceContextRecord\",\n \"TraceLogMessage\",\n \"TraceService\",\n \"TraceTransport\",\n \"StepResult\",\n \"Worker\",\n \"WorkerHealth\",\n \"WorkerStatus\",\n \"WorkflowContext\",\n \"WorkflowDefinition\",\n \"WorkflowEngine\",\n \"WorkflowEngineHooks\",\n \"WorkflowNode\",\n \"WorkflowRuntimeFactory\",\n \"WorkflowStep\",\n \"WorkerSupervisor\",\n]", - "start_line": 1, - "end_line": 69, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.plba.__init__", - "is_test": false, - "blob_sha": "24e755ec8c249d14fb0e675b5dbf2b71ab91afb9c849897eebfa9feb2499e19d", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C0_SOURCE_CHUNKS", - "path": "tests/test_runtime.py", - "title": "tests/test_runtime.py:test_trace_service_writes_contexts_and_messages", - "content": "def test_trace_service_writes_contexts_and_messages() -> None:\n from app_runtime.tracing.service import TraceService\n\n transport = RecordingTransport()\n manager = TraceService(transport=transport)\n\n with manager.open_context(alias=\"worker\", kind=\"worker\", attrs={\"routine\": \"incoming\"}):\n manager.step(\"parse\")\n manager.info(\"started\", status=\"ok\", attrs={\"attempt\": 1})\n\n assert len(transport.contexts) == 1\n assert len(transport.messages) == 1\n assert transport.contexts[0].alias == \"worker\"\n assert transport.messages[0].step == \"parse\"", - "start_line": 246, - "end_line": 259, - "metadata": { - "chunk_index": 9, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_runtime", - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C0_SOURCE_CHUNKS", - "path": "tests/test_runtime.py", - "title": "tests/test_runtime.py:test_trace_service_supports_debug_warning_and_error_levels", - "content": "def test_trace_service_supports_debug_warning_and_error_levels() -> None:\n from app_runtime.tracing.service import TraceService\n\n transport = RecordingTransport()\n manager = TraceService(transport=transport)\n\n with manager.open_context(alias=\"worker\", kind=\"worker\", attrs={\"routine\": \"incoming\"}):\n manager.step(\"validate\")\n manager.debug(\"validation details\", attrs={\"rule\": \"basic\"})\n manager.warning(\"validation warning\", status=\"degraded\", attrs={\"attempt\": 1})\n manager.error(\"integration failed\", status=\"failed\", attrs={\"integration\": \"crm\"})\n manager.exception(\"caught exception\", attrs={\"exception_type\": \"RuntimeError\"})\n\n levels = [message.level for message in transport.messages]\n assert levels == [\"DEBUG\", \"WARNING\", \"ERROR\", \"ERROR\"]", - "start_line": 262, - "end_line": 276, - "metadata": { - "chunk_index": 10, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_runtime", - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C0_SOURCE_CHUNKS", - "path": "src/app_runtime/tracing/service.py", - "title": "src/app_runtime/tracing/service.py:TraceManager", - "content": "class TraceManager(TraceService):\n \"\"\"Compatibility alias during the transition from ConfigManager-shaped naming.\"\"\"", - "start_line": 169, - "end_line": 170, - "metadata": { - "chunk_index": 2, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.tracing.service", - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C0_SOURCE_CHUNKS", - "path": "src/app_runtime/core/runtime.py", - "title": "src/app_runtime/core/runtime.py:RuntimeManager", - "content": "class RuntimeManager:\n ACTION_TIMEOUT_SECONDS = 10.0\n ACTION_POLL_INTERVAL_SECONDS = 0.05\n\n def __init__(\n self,\n configuration: ConfigurationManager | None = None,\n services: ServiceContainer | None = None,\n traces: TraceService | None = None,\n health: HealthRegistry | None = None,\n logs: LogManager | None = None,\n workers: WorkerSupervisor | None = None,\n control_plane: ControlPlaneService | None = None,\n ) -> None:\n self.configuration = configuration or ConfigurationManager()\n self.services = services or ServiceContainer()\n self.traces = traces or TraceService()\n self.health = health or HealthRegistry()\n self.logs = logs or LogManager()\n self.workers = workers or WorkerSupervisor()\n self.control_plane = control_plane or ControlPlaneService()\n self.registry = ModuleRegistry(self.services)\n self._started = False\n self._state = LifecycleState.IDLE\n self._core_registered = False\n self._workers_registered = False\n self._register_core_services()\n\n def register_module(self, module: ApplicationModule) -> None:\n self.registry.register_module(module.name)\n module.register(self.registry)\n\n def add_config_file(self, path: str) -> FileConfigProvider:\n provider = FileConfigProvider(path)\n self.configuration.add_provider(provider)\n return provider\n\n def start(self, *, start_control_plane: bool = True) -> None:\n if self._started:\n return\n self._state = LifecycleState.STARTING\n config = self.configuration.load()\n self.logs.apply_config(config)\n self._register_health_contributors()\n self._register_workers()\n self.workers.start()\n if start_control_plane:\n self.control_plane.start(self)\n self._started = True\n self._refresh_state()\n\n def stop(self, timeout: float = 30.0, force: bool = False, stop_control_plane: bool = True) -> None:\n if not self._started:\n return\n self._state = LifecycleState.STOPPING\n self.workers.stop(timeout=timeout, force=force)\n if stop_control_plane:\n self.control_plane.stop()\n self._started = False\n self._state = LifecycleState.STOPPED\n\n def status(self) -> dict[str, object]:\n self._refresh_state()\n return self.control_plane.snapshot(self)\n\n def current_health(self) -> HealthPayload:\n self._refresh_state()\n return self.health.payload(self._state, self.workers.healths())\n\n async def health_status(self) -> HealthPayload:\n return self.current_health()\n\n async def start_runtime(self) -> dict[str, object] | str:\n self._refresh_state()\n if self._started:\n return \"runtime already running\"\n if self._state == LifecycleState.STOPPING:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n\n self.start(start_control_plane=False)\n started = self._wait_for_state({LifecycleState.IDLE, LifecycleState.BUSY}, timeout=self.ACTION_TIMEOUT_SECONDS)\n if started:\n return self._action_detail(\"runtime started\", timed_out=False)\n return self._action_detail(\"runtime start is still in progress\", timed_out=True)\n\n async def stop_runtime(self) -> dict[str, object] | str:\n self._refresh_state()\n if not self._started:\n if self._state == LifecycleState.STOPPING:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n return \"runtime already stopped\"\n\n self._state = LifecycleState.STOPPING\n try:\n self.workers.stop(timeout=self.ACTION_TIMEOUT_SECONDS, force=False)\n except TimeoutError:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n\n self._started = False\n self._state = LifecycleState.STOPPED\n return self._action_detail(\"runtime stopped\", timed_out=False)\n\n async def runtime_status(self) -> str:\n self._refresh_state()\n return self._state.value\n\n def _register_core_services(self) -> None:\n if self._core_registered:\n return\n self.services.register(\"configuration\", self.configuration)\n self.services.register(\"traces\", self.traces)\n self.services.register(\"health\", self.health)\n self.services.register(\"logs\", self.logs)\n self.services.register(\"workers\", self.workers)\n self.services.register(\"control_plane\", self.control_plane)\n self._core_registered = True\n\n def _register_health_contributors(self) -> None:\n for contributor in self.registry.health_contributors:\n self.health.register(contributor)\n\n def _register_workers(self) -> None:\n if self._workers_registered:\n return\n for worker in self.registry.workers:\n self.workers.register(worker)\n self._workers_registered = True\n\n def _refresh_state(self) -> None:\n lifecycle = self.workers.lifecycle_state()\n\n if self._state == LifecycleState.STOPPING:\n if lifecycle == LifecycleState.STOPPED:\n self._started = False\n self._state = LifecycleState.STOPPED\n return\n\n if not self._started:\n if lifecycle == LifecycleState.STOPPED:\n self._state = LifecycleState.STOPPED\n return\n\n self._state = lifecycle\n\n def _wait_for_state(self, target_states: set[LifecycleState], *, timeout: float) -> bool:\n deadline = monotonic() + timeout\n while monotonic() < deadline:\n self._refresh_state()\n if self._state in target_states:\n return True\n sleep(self.ACTION_POLL_INTERVAL_SECONDS)\n self._refresh_state()\n return self._state in target_states\n\n def _action_detail(self, message: str, *, timed_out: bool) -> dict[str, object]:\n self._refresh_state()\n return {\n \"message\": message,\n \"state\": self._state.value,\n \"timed_out\": timed_out,\n \"workers\": self.workers.snapshot(),\n }", - "start_line": 18, - "end_line": 179, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.core.runtime", - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C0_SOURCE_CHUNKS", - "path": "src/app_runtime/tracing/service.py", - "title": "src/app_runtime/tracing/service.py:TraceService", - "content": "class TraceService(TraceContextFactory):\n def __init__(self, transport: TraceTransport | None = None, store: TraceContextStore | None = None) -> None:\n self.transport = transport or NoOpTraceTransport()\n self.store = store or TraceContextStore()\n self._writer = TraceRecordWriter(self.transport)\n\n def create_context(\n self,\n *,\n alias: str,\n parent_id: str | None = None,\n kind: str | None = None,\n attrs: dict[str, Any] | None = None,\n ) -> str:\n record = TraceContextRecord(\n trace_id=uuid4().hex,\n alias=str(alias or \"\"),\n parent_id=parent_id,\n type=kind,\n event_time=utc_now(),\n attrs=dict(attrs or {}),\n )\n self.store.push(record)\n self._writer.write_context(record)\n return record.trace_id\n\n @contextmanager\n def open_context(\n self,\n *,\n alias: str,\n parent_id: str | None = None,\n kind: str | None = None,\n attrs: dict[str, Any] | None = None,\n ) -> Iterator[str]:\n trace_id = self.create_context(alias=alias, parent_id=parent_id, kind=kind, attrs=attrs)\n try:\n yield trace_id\n finally:\n self.store.pop()\n\n def current_trace_id(self) -> str | None:\n return self.store.current_trace_id()\n\n def close_context(self) -> str | None:\n previous = self.store.pop()\n return previous.record.trace_id if previous else None\n\n def step(self, name: str) -> None:\n self.store.set_step(str(name or \"\"))\n\n def info(self, message: str, *, status: str | None = None, attrs: dict[str, Any] | None = None) -> None:\n self._write_message(\"INFO\", message, status, attrs)\n\n def debug(self, message: str, *, status: str | None = None, attrs: dict[str, Any] | None = None) -> None:\n self._write_message(\"DEBUG\", message, status, attrs)\n\n def warning(self, message: str, *, status: str | None = None, attrs: dict[str, Any] | None = None) -> None:\n self._write_message(\"WARNING\", message, status, attrs)\n\n def error(self, message: str, *, status: str | None = None, attrs: dict[str, Any] | None = None) -> None:\n self._write_message(\"ERROR\", message, status, attrs)\n\n def exception(self, message: str, *, status: str = \"failed\", attrs: dict[str, Any] | None = None) -> None:\n self._write_message(\"ERROR\", message, status, attrs)\n\n def new_root(self, operation: str) -> TraceContext:\n trace_id = self.create_context(alias=operation, kind=\"operation\", attrs={\"operation\": operation})\n return TraceContext(trace_id=trace_id, span_id=trace_id, attributes={\"operation\": operation})\n\n def child_of(self, parent: TraceContext, operation: str) -> TraceContext:\n trace_id = self.create_context(\n alias=operation,\n parent_id=parent.trace_id,\n kind=\"worker\",\n attrs={\"operation\": operation},\n )\n return TraceContext(\n trace_id=trace_id,\n span_id=trace_id,\n parent_span_id=parent.span_id,\n attributes={\"operation\": operation},\n )\n\n def attach(self, metadata: dict[str, object], context: TraceContext) -> dict[str, object]:\n updated = dict(metadata)\n updated[\"trace_id\"] = context.trace_id\n updated[\"span_id\"] = context.span_id\n updated[\"parent_span_id\"] = context.parent_span_id\n return updated\n\n def resume(self, metadata: dict[str, object], operation: str) -> TraceContext:\n trace_id = str(metadata.get(\"trace_id\") or uuid4().hex)\n span_id = str(metadata.get(\"span_id\") or trace_id)\n parent_id = metadata.get(\"parent_span_id\")\n self.create_context(\n alias=operation,\n parent_id=str(parent_id) if parent_id else None,\n kind=\"worker\",\n attrs=dict(metadata),\n )\n return TraceContext(\n trace_id=trace_id,\n span_id=span_id,\n parent_span_id=str(parent_id) if parent_id else None,\n attributes={\"operation\": operation},\n )\n\n def _write_message(\n self,\n level: TraceLevel,\n message: str,\n status: str | None,\n attrs: dict[str, Any] | None,\n ) -> None:\n active = self.store.current()\n if active is None:\n raise RuntimeError(\"Trace context is not bound. Call create_context() first.\")\n record = TraceLogMessage(\n trace_id=active.record.trace_id,\n step=active.step,\n status=str(status or \"\"),\n message=str(message or \"\"),\n level=level,\n event_time=utc_now(),\n attrs=dict(attrs or {}),\n )\n self._writer.write_message(record)", - "start_line": 39, - "end_line": 166, - "metadata": { - "chunk_index": 1, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.tracing.service", - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C0_SOURCE_CHUNKS", - "path": "src/app_runtime/contracts/__init__.py", - "title": "src/app_runtime/__init__.py:1-1", - "content": "__all__: list[str] = []", - "start_line": 1, - "end_line": 1, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.app_runtime.__init__", - "is_test": false, - "blob_sha": "8eea9df4f6d7b38ca0e39ccc27b04700e3d08dbeec8046d613d22706d19985fa", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "relations": [ - { - "path": "src/app_runtime/tracing/service.py", - "metadata": { - "edge_id": "3b052062067a78aef3302ee1d996897e02a67d1b340397bea4f59fe147c0492a", - "edge_type": "dataflow_slice", - "src_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "src_qname": "TraceService.__init__", - "dst_symbol_id": "ff44881104b65ef50ee6fe16d367d4a81b6e7eb5c44c0963cf4543faec785d4a", - "dst_ref": "TraceService.create_context", - "resolution": "resolved", - "slice_id": "3b052062067a78aef3302ee1d996897e02a67d1b340397bea4f59fe147c0492a", - "root_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "path_symbols": [ - "TraceService.__init__", - "TraceService.store", - "TraceService.create_context" - ], - "path_symbol_ids": [ - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "ff44881104b65ef50ee6fe16d367d4a81b6e7eb5c44c0963cf4543faec785d4a" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - }, - "content": "TraceService.__init__\n -> TraceService.store\n -> TraceService.create_context" - }, - { - "path": "src/app_runtime/tracing/service.py", - "metadata": { - "edge_id": "7a9353ef57c9ae5d19b3a0c6ac50fad05e6d21d31bbe1cd1cd07af6332ba6505", - "edge_type": "dataflow_slice", - "src_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "src_qname": "TraceService.__init__", - "dst_symbol_id": "01e14158dcced7e52d0c8ac84ac7b9a75225c261b6aca6a1d7da802d0994721c", - "dst_ref": "TraceService.close_context", - "resolution": "resolved", - "slice_id": "7a9353ef57c9ae5d19b3a0c6ac50fad05e6d21d31bbe1cd1cd07af6332ba6505", - "root_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "path_symbols": [ - "TraceService.__init__", - "TraceService.store", - "TraceService.close_context" - ], - "path_symbol_ids": [ - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "01e14158dcced7e52d0c8ac84ac7b9a75225c261b6aca6a1d7da802d0994721c" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - }, - "content": "TraceService.__init__\n -> TraceService.store\n -> TraceService.close_context" - }, - { - "path": "src/app_runtime/tracing/service.py", - "metadata": { - "edge_id": "a6e13b9ebc4fed84586afd53ed92a4d14757e440873f572b2337d5622ee96031", - "edge_type": "dataflow_slice", - "src_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "src_qname": "TraceService.__init__", - "dst_symbol_id": "2da3d5b20a947bf63e14c103be4689b72fd837e0a82abd6c497846375d4c7426", - "dst_ref": "TraceService.open_context", - "resolution": "resolved", - "slice_id": "a6e13b9ebc4fed84586afd53ed92a4d14757e440873f572b2337d5622ee96031", - "root_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "path_symbols": [ - "TraceService.__init__", - "TraceService.store", - "TraceService.open_context" - ], - "path_symbol_ids": [ - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "2da3d5b20a947bf63e14c103be4689b72fd837e0a82abd6c497846375d4c7426" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - }, - "content": "TraceService.__init__\n -> TraceService.store\n -> TraceService.open_context" - }, - { - "path": "src/app_runtime/tracing/service.py", - "metadata": { - "edge_id": "1e923a93faa05c3c43ca9b19bd047007a8589ccce57d3cc1798ae7f9f200af98", - "edge_type": "dataflow_slice", - "src_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "src_qname": "TraceService.__init__", - "dst_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "dst_ref": "TraceService.__init__", - "resolution": "resolved", - "slice_id": "1e923a93faa05c3c43ca9b19bd047007a8589ccce57d3cc1798ae7f9f200af98", - "root_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "path_symbols": [ - "TraceService.__init__", - "TraceService.transport", - "TraceService.__init__" - ], - "path_symbol_ids": [ - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - }, - "content": "TraceService.__init__\n -> TraceService.transport\n -> TraceService.__init__" - }, - { - "path": "src/app_runtime/tracing/service.py", - "metadata": { - "edge_id": "3ea17138634b1190bded77ddb84aa1595124f6519b246f24fc4b02bd62b5cac1", - "edge_type": "dataflow_slice", - "src_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "src_qname": "TraceService.__init__", - "dst_symbol_id": "41135180f7b3b9ab20e097e0747474e219c37dd2366ef08a7b43c1f3edb10b4c", - "dst_ref": "TraceService.current_trace_id", - "resolution": "resolved", - "slice_id": "3ea17138634b1190bded77ddb84aa1595124f6519b246f24fc4b02bd62b5cac1", - "root_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "path_symbols": [ - "TraceService.__init__", - "TraceService.store", - "TraceService.current_trace_id" - ], - "path_symbol_ids": [ - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "41135180f7b3b9ab20e097e0747474e219c37dd2366ef08a7b43c1f3edb10b4c" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - }, - "content": "TraceService.__init__\n -> TraceService.store\n -> TraceService.current_trace_id" - }, - { - "path": "src/app_runtime/tracing/service.py", - "metadata": { - "edge_id": "9f34c5da9b09fba99df6f6b1bde183a9aeb45111b8218a747c71590c2c9f60f2", - "edge_type": "dataflow_slice", - "src_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "src_qname": "TraceService.__init__", - "dst_symbol_id": "c44bfbc66cf747283f30088da3e011a10395031d41e77b74e523c24997f641ca", - "dst_ref": "TraceService.step", - "resolution": "resolved", - "slice_id": "9f34c5da9b09fba99df6f6b1bde183a9aeb45111b8218a747c71590c2c9f60f2", - "root_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "path_symbols": [ - "TraceService.__init__", - "TraceService.store", - "TraceService.step" - ], - "path_symbol_ids": [ - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "c44bfbc66cf747283f30088da3e011a10395031d41e77b74e523c24997f641ca" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - }, - "content": "TraceService.__init__\n -> TraceService.store\n -> TraceService.step" - } - ], - "entrypoints": [], - "test_candidates": [ - { - "path": "tests/test_runtime.py", - "title": "tests/test_runtime.py:test_trace_service_allows_messages_without_status", - "content": "def test_trace_service_allows_messages_without_status() -> None:\n from app_runtime.tracing.service import TraceService\n\n transport = RecordingTransport()\n manager = TraceService(transport=transport)\n\n with manager.open_context(alias=\"worker\", kind=\"worker\"):\n manager.step(\"optiona" - }, - { - "path": "tests/test_runtime.py", - "title": "tests/test_runtime.py:test_trace_service_writes_contexts_and_messages", - "content": "def test_trace_service_writes_contexts_and_messages() -> None:\n from app_runtime.tracing.service import TraceService\n\n transport = RecordingTransport()\n manager = TraceService(transport=transport)\n\n with manager.open_context(alias=\"worker\", kind=\"worker\", attrs={\"routine\": \"incoming\"}):\n" - }, - { - "path": "tests/test_runtime.py", - "title": "tests/test_runtime.py:test_trace_service_supports_debug_warning_and_error_levels", - "content": "def test_trace_service_supports_debug_warning_and_error_levels() -> None:\n from app_runtime.tracing.service import TraceService\n\n transport = RecordingTransport()\n manager = TraceService(transport=transport)\n\n with manager.open_context(alias=\"worker\", kind=\"worker\", attrs={\"routine\": \"in" - } - ], - "layer_outcomes": [ - { - "layer_id": "C1_SYMBOL_CATALOG", - "hit_count": 8, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C2_DEPENDENCY_GRAPH", - "hit_count": 6, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C0_SOURCE_CHUNKS", - "hit_count": 10, - "empty": false, - "fallback_used": false - } - ], - "missing_layers": [], - "raw_rows": [ - { - "path": "src/plba/__init__.py", - "content": "const TraceService\nTraceService = plba.tracing.TraceService", - "layer": "C1_SYMBOL_CATALOG", - "title": "TraceService", - "span_start": 20, - "span_end": 20, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": null, - "metadata": { - "symbol_id": "259ec03b77b9387ea53f69c77af32791dd29adf6de617ba72dd3f839197342a1", - "qname": "TraceService", - "kind": "const", - "signature": "TraceService = plba.tracing.TraceService", - "parent_symbol_id": null, - "package_or_module": "src.plba.__init__", - "is_test": false, - "blob_sha": "24e755ec8c249d14fb0e675b5dbf2b71ab91afb9c849897eebfa9feb2499e19d", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "const TraceService\nTraceService = app_runtime.tracing.service.TraceService", - "layer": "C1_SYMBOL_CATALOG", - "title": "TraceService", - "span_start": 14, - "span_end": 14, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": null, - "metadata": { - "symbol_id": "3ccf6212fd7d9730f9df933e2ee7671b65bdae0520577e1a49c6432262842db6", - "qname": "TraceService", - "kind": "const", - "signature": "TraceService = app_runtime.tracing.service.TraceService", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.core.runtime", - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/__init__.py", - "content": "const TraceService\nTraceService = app_runtime.tracing.service.TraceService", - "layer": "C1_SYMBOL_CATALOG", - "title": "TraceService", - "span_start": 2, - "span_end": 2, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": null, - "metadata": { - "symbol_id": "ecd2fab7fa9744b2adca84d3d213f7aadcb7e1da84b9c2764a4ab39c65282b11", - "qname": "TraceService", - "kind": "const", - "signature": "TraceService = app_runtime.tracing.service.TraceService", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.tracing.__init__", - "is_test": false, - "blob_sha": "a01dea5f773515aeaae8e6d3431fcb93531a8b577dfa26c2e5db16cd6ae6e4d9", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "class TraceService\nTraceService(TraceContextFactory)", - "layer": "C1_SYMBOL_CATALOG", - "title": "TraceService", - "span_start": 39, - "span_end": 166, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": null, - "metadata": { - "symbol_id": "c2b2b976d99f2c600000b753731b26e0a69adcb4359398b93073590c5d5d04f4", - "qname": "TraceService", - "kind": "class", - "signature": "TraceService(TraceContextFactory)", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.tracing.service", - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/tracing.py", - "content": "const TraceService\nTraceService = app_runtime.tracing.service.TraceService", - "layer": "C1_SYMBOL_CATALOG", - "title": "TraceService", - "span_start": 1, - "span_end": 1, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": null, - "metadata": { - "symbol_id": "a4556fb3f83c50ea68b94a679786ce802cab7ffd9d7138aad3d6009b2661f425", - "qname": "TraceService", - "kind": "const", - "signature": "TraceService = app_runtime.tracing.service.TraceService", - "parent_symbol_id": null, - "package_or_module": "src.plba.tracing", - "is_test": false, - "blob_sha": "a27e11c716c93c3fcefe6f11b4cc420a6b743e7606606071d7f1aeeccc4e7d45", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "method TraceService.open_context\nopen_context(self)", - "layer": "C1_SYMBOL_CATALOG", - "title": "TraceService.open_context", - "span_start": 66, - "span_end": 78, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": null, - "metadata": { - "symbol_id": "2da3d5b20a947bf63e14c103be4689b72fd837e0a82abd6c497846375d4c7426", - "qname": "TraceService.open_context", - "kind": "method", - "signature": "open_context(self)", - "parent_symbol_id": "TraceService", - "package_or_module": "src.app_runtime.tracing.service", - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "method TraceService.create_context\ncreate_context(self)", - "layer": "C1_SYMBOL_CATALOG", - "title": "TraceService.create_context", - "span_start": 45, - "span_end": 63, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": null, - "metadata": { - "symbol_id": "ff44881104b65ef50ee6fe16d367d4a81b6e7eb5c44c0963cf4543faec785d4a", - "qname": "TraceService.create_context", - "kind": "method", - "signature": "create_context(self)", - "parent_symbol_id": "TraceService", - "package_or_module": "src.app_runtime.tracing.service", - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "method TraceService.current_trace_id\ncurrent_trace_id(self)", - "layer": "C1_SYMBOL_CATALOG", - "title": "TraceService.current_trace_id", - "span_start": 80, - "span_end": 81, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": null, - "metadata": { - "symbol_id": "41135180f7b3b9ab20e097e0747474e219c37dd2366ef08a7b43c1f3edb10b4c", - "qname": "TraceService.current_trace_id", - "kind": "method", - "signature": "current_trace_id(self)", - "parent_symbol_id": "TraceService", - "package_or_module": "src.app_runtime.tracing.service", - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "TraceService.__init__\n -> TraceService.store\n -> TraceService.create_context", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "TraceService.__init__:dataflow_slice", - "span_start": 42, - "span_end": 61, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": null, - "metadata": { - "edge_id": "3b052062067a78aef3302ee1d996897e02a67d1b340397bea4f59fe147c0492a", - "edge_type": "dataflow_slice", - "src_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "src_qname": "TraceService.__init__", - "dst_symbol_id": "ff44881104b65ef50ee6fe16d367d4a81b6e7eb5c44c0963cf4543faec785d4a", - "dst_ref": "TraceService.create_context", - "resolution": "resolved", - "slice_id": "3b052062067a78aef3302ee1d996897e02a67d1b340397bea4f59fe147c0492a", - "root_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "path_symbols": [ - "TraceService.__init__", - "TraceService.store", - "TraceService.create_context" - ], - "path_symbol_ids": [ - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "ff44881104b65ef50ee6fe16d367d4a81b6e7eb5c44c0963cf4543faec785d4a" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "TraceService.__init__\n -> TraceService.store\n -> TraceService.close_context", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "TraceService.__init__:dataflow_slice", - "span_start": 42, - "span_end": 84, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": null, - "metadata": { - "edge_id": "7a9353ef57c9ae5d19b3a0c6ac50fad05e6d21d31bbe1cd1cd07af6332ba6505", - "edge_type": "dataflow_slice", - "src_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "src_qname": "TraceService.__init__", - "dst_symbol_id": "01e14158dcced7e52d0c8ac84ac7b9a75225c261b6aca6a1d7da802d0994721c", - "dst_ref": "TraceService.close_context", - "resolution": "resolved", - "slice_id": "7a9353ef57c9ae5d19b3a0c6ac50fad05e6d21d31bbe1cd1cd07af6332ba6505", - "root_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "path_symbols": [ - "TraceService.__init__", - "TraceService.store", - "TraceService.close_context" - ], - "path_symbol_ids": [ - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "01e14158dcced7e52d0c8ac84ac7b9a75225c261b6aca6a1d7da802d0994721c" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "TraceService.__init__\n -> TraceService.store\n -> TraceService.open_context", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "TraceService.__init__:dataflow_slice", - "span_start": 42, - "span_end": 78, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": null, - "metadata": { - "edge_id": "a6e13b9ebc4fed84586afd53ed92a4d14757e440873f572b2337d5622ee96031", - "edge_type": "dataflow_slice", - "src_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "src_qname": "TraceService.__init__", - "dst_symbol_id": "2da3d5b20a947bf63e14c103be4689b72fd837e0a82abd6c497846375d4c7426", - "dst_ref": "TraceService.open_context", - "resolution": "resolved", - "slice_id": "a6e13b9ebc4fed84586afd53ed92a4d14757e440873f572b2337d5622ee96031", - "root_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "path_symbols": [ - "TraceService.__init__", - "TraceService.store", - "TraceService.open_context" - ], - "path_symbol_ids": [ - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "2da3d5b20a947bf63e14c103be4689b72fd837e0a82abd6c497846375d4c7426" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "TraceService.__init__\n -> TraceService.transport\n -> TraceService.__init__", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "TraceService.__init__:dataflow_slice", - "span_start": 41, - "span_end": 43, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": null, - "metadata": { - "edge_id": "1e923a93faa05c3c43ca9b19bd047007a8589ccce57d3cc1798ae7f9f200af98", - "edge_type": "dataflow_slice", - "src_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "src_qname": "TraceService.__init__", - "dst_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "dst_ref": "TraceService.__init__", - "resolution": "resolved", - "slice_id": "1e923a93faa05c3c43ca9b19bd047007a8589ccce57d3cc1798ae7f9f200af98", - "root_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "path_symbols": [ - "TraceService.__init__", - "TraceService.transport", - "TraceService.__init__" - ], - "path_symbol_ids": [ - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "TraceService.__init__\n -> TraceService.store\n -> TraceService.current_trace_id", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "TraceService.__init__:dataflow_slice", - "span_start": 42, - "span_end": 81, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": null, - "metadata": { - "edge_id": "3ea17138634b1190bded77ddb84aa1595124f6519b246f24fc4b02bd62b5cac1", - "edge_type": "dataflow_slice", - "src_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "src_qname": "TraceService.__init__", - "dst_symbol_id": "41135180f7b3b9ab20e097e0747474e219c37dd2366ef08a7b43c1f3edb10b4c", - "dst_ref": "TraceService.current_trace_id", - "resolution": "resolved", - "slice_id": "3ea17138634b1190bded77ddb84aa1595124f6519b246f24fc4b02bd62b5cac1", - "root_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "path_symbols": [ - "TraceService.__init__", - "TraceService.store", - "TraceService.current_trace_id" - ], - "path_symbol_ids": [ - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "41135180f7b3b9ab20e097e0747474e219c37dd2366ef08a7b43c1f3edb10b4c" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "TraceService.__init__\n -> TraceService.store\n -> TraceService.step", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "TraceService.__init__:dataflow_slice", - "span_start": 42, - "span_end": 88, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": null, - "metadata": { - "edge_id": "9f34c5da9b09fba99df6f6b1bde183a9aeb45111b8218a747c71590c2c9f60f2", - "edge_type": "dataflow_slice", - "src_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "src_qname": "TraceService.__init__", - "dst_symbol_id": "c44bfbc66cf747283f30088da3e011a10395031d41e77b74e523c24997f641ca", - "dst_ref": "TraceService.step", - "resolution": "resolved", - "slice_id": "9f34c5da9b09fba99df6f6b1bde183a9aeb45111b8218a747c71590c2c9f60f2", - "root_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "path_symbols": [ - "TraceService.__init__", - "TraceService.store", - "TraceService.step" - ], - "path_symbol_ids": [ - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "c44bfbc66cf747283f30088da3e011a10395031d41e77b74e523c24997f641ca" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/tracing.py", - "content": "from app_runtime.tracing.service import TraceService\nfrom app_runtime.tracing.transport import MySqlTraceTransport, NoOpTraceTransport\n\n__all__ = [\"MySqlTraceTransport\", \"NoOpTraceTransport\", \"TraceService\"]", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/plba/tracing.py:1-4", - "span_start": 1, - "span_end": 4, - "lexical_rank": 6, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": null, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.plba.tracing", - "is_test": false, - "blob_sha": "a27e11c716c93c3fcefe6f11b4cc420a6b743e7606606071d7f1aeeccc4e7d45", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_runtime.py", - "content": "def test_trace_service_allows_messages_without_status() -> None:\n from app_runtime.tracing.service import TraceService\n\n transport = RecordingTransport()\n manager = TraceService(transport=transport)\n\n with manager.open_context(alias=\"worker\", kind=\"worker\"):\n manager.step(\"optional-status\")\n manager.debug(\"debug without status\")\n manager.info(\"info without status\")\n manager.warning(\"warning without status\")\n manager.error(\"error without status\")\n\n assert [message.status for message in transport.messages] == [\"\", \"\", \"\", \"\"]\n assert all(message.trace_id == transport.contexts[0].trace_id for message in transport.messages)", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_runtime.py:test_trace_service_allows_messages_without_status", - "span_start": 279, - "span_end": 293, - "lexical_rank": 6, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": null, - "metadata": { - "chunk_index": 11, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_runtime", - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/__init__.py", - "content": "from app_runtime.contracts.trace import TraceContext, TraceContextRecord, TraceLogMessage, TraceTransport\nfrom app_runtime.tracing.service import TraceManager, TraceService\nfrom app_runtime.tracing.store import ActiveTraceContext, TraceContextStore\nfrom app_runtime.tracing.transport import MySqlTraceTransport, NoOpTraceTransport\n\n__all__ = [\n \"ActiveTraceContext\",\n \"MySqlTraceTransport\",\n \"NoOpTraceTransport\",\n \"TraceContext\",\n \"TraceContextRecord\",\n \"TraceContextStore\",\n \"TraceLogMessage\",\n \"TraceManager\",\n \"TraceService\",\n \"TraceTransport\",\n]", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/tracing/__init__.py:1-17", - "span_start": 1, - "span_end": 17, - "lexical_rank": 6, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": null, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.app_runtime.tracing.__init__", - "is_test": false, - "blob_sha": "a01dea5f773515aeaae8e6d3431fcb93531a8b577dfa26c2e5db16cd6ae6e4d9", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/__init__.py", - "content": "from plba.bootstrap import create_runtime\nfrom plba.config import ConfigFileLoader, FileConfigProvider\nfrom plba.control import ControlActionSet, ControlChannel, ControlPlaneService, HttpControlChannel\nfrom plba.contracts import (\n ApplicationModule,\n ConfigProvider,\n HealthContributor,\n TraceContext,\n TraceContextRecord,\n TraceLogMessage,\n TraceTransport,\n Worker,\n WorkerHealth,\n WorkerStatus,\n)\nfrom plba.core import ConfigurationManager, RuntimeManager, ServiceContainer\nfrom plba.health import HealthRegistry\nfrom plba.logging import LogManager\nfrom plba.queue import InMemoryTaskQueue\nfrom plba.tracing import MySqlTraceTransport, NoOpTraceTransport, TraceService\nfrom plba.workflow import (\n StepResult,\n WorkflowContext,\n WorkflowDefinition,\n WorkflowEngine,\n WorkflowEngineHooks,\n WorkflowNode,\n WorkflowRuntimeFactory,\n WorkflowStep,\n)\nfrom plba.workers import WorkerSupervisor\n\n__all__ = [\n \"ApplicationModule\",\n \"ConfigFileLoader\",\n \"ConfigProvider\",\n \"ConfigurationManager\",\n \"ControlActionSet\",\n \"ControlChannel\",\n \"ControlPlaneService\",\n \"create_runtime\",\n \"FileConfigProvider\",\n \"HealthContributor\",\n \"HealthRegistry\",\n \"HttpControlChannel\",\n \"InMemoryTaskQueue\",\n \"LogManager\",\n \"MySqlTraceTransport\",\n \"NoOpTraceTransport\",\n \"RuntimeManager\",\n \"ServiceContainer\",\n \"TraceContext\",\n \"TraceContextRecord\",\n \"TraceLogMessage\",\n \"TraceService\",\n \"TraceTransport\",\n \"StepResult\",\n \"Worker\",\n \"WorkerHealth\",\n \"WorkerStatus\",\n \"WorkflowContext\",\n \"WorkflowDefinition\",\n \"WorkflowEngine\",\n \"WorkflowEngineHooks\",\n \"WorkflowNode\",\n \"WorkflowRuntimeFactory\",\n \"WorkflowStep\",\n \"WorkerSupervisor\",\n]", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/plba/__init__.py:1-69", - "span_start": 1, - "span_end": 69, - "lexical_rank": 6, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": null, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.plba.__init__", - "is_test": false, - "blob_sha": "24e755ec8c249d14fb0e675b5dbf2b71ab91afb9c849897eebfa9feb2499e19d", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_runtime.py", - "content": "def test_trace_service_writes_contexts_and_messages() -> None:\n from app_runtime.tracing.service import TraceService\n\n transport = RecordingTransport()\n manager = TraceService(transport=transport)\n\n with manager.open_context(alias=\"worker\", kind=\"worker\", attrs={\"routine\": \"incoming\"}):\n manager.step(\"parse\")\n manager.info(\"started\", status=\"ok\", attrs={\"attempt\": 1})\n\n assert len(transport.contexts) == 1\n assert len(transport.messages) == 1\n assert transport.contexts[0].alias == \"worker\"\n assert transport.messages[0].step == \"parse\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_runtime.py:test_trace_service_writes_contexts_and_messages", - "span_start": 246, - "span_end": 259, - "lexical_rank": 6, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": null, - "metadata": { - "chunk_index": 9, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_runtime", - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_runtime.py", - "content": "def test_trace_service_supports_debug_warning_and_error_levels() -> None:\n from app_runtime.tracing.service import TraceService\n\n transport = RecordingTransport()\n manager = TraceService(transport=transport)\n\n with manager.open_context(alias=\"worker\", kind=\"worker\", attrs={\"routine\": \"incoming\"}):\n manager.step(\"validate\")\n manager.debug(\"validation details\", attrs={\"rule\": \"basic\"})\n manager.warning(\"validation warning\", status=\"degraded\", attrs={\"attempt\": 1})\n manager.error(\"integration failed\", status=\"failed\", attrs={\"integration\": \"crm\"})\n manager.exception(\"caught exception\", attrs={\"exception_type\": \"RuntimeError\"})\n\n levels = [message.level for message in transport.messages]\n assert levels == [\"DEBUG\", \"WARNING\", \"ERROR\", \"ERROR\"]", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_runtime.py:test_trace_service_supports_debug_warning_and_error_levels", - "span_start": 262, - "span_end": 276, - "lexical_rank": 6, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": null, - "metadata": { - "chunk_index": 10, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_runtime", - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "class TraceManager(TraceService):\n \"\"\"Compatibility alias during the transition from ConfigManager-shaped naming.\"\"\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/tracing/service.py:TraceManager", - "span_start": 169, - "span_end": 170, - "lexical_rank": 6, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": null, - "metadata": { - "chunk_index": 2, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.tracing.service", - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "class RuntimeManager:\n ACTION_TIMEOUT_SECONDS = 10.0\n ACTION_POLL_INTERVAL_SECONDS = 0.05\n\n def __init__(\n self,\n configuration: ConfigurationManager | None = None,\n services: ServiceContainer | None = None,\n traces: TraceService | None = None,\n health: HealthRegistry | None = None,\n logs: LogManager | None = None,\n workers: WorkerSupervisor | None = None,\n control_plane: ControlPlaneService | None = None,\n ) -> None:\n self.configuration = configuration or ConfigurationManager()\n self.services = services or ServiceContainer()\n self.traces = traces or TraceService()\n self.health = health or HealthRegistry()\n self.logs = logs or LogManager()\n self.workers = workers or WorkerSupervisor()\n self.control_plane = control_plane or ControlPlaneService()\n self.registry = ModuleRegistry(self.services)\n self._started = False\n self._state = LifecycleState.IDLE\n self._core_registered = False\n self._workers_registered = False\n self._register_core_services()\n\n def register_module(self, module: ApplicationModule) -> None:\n self.registry.register_module(module.name)\n module.register(self.registry)\n\n def add_config_file(self, path: str) -> FileConfigProvider:\n provider = FileConfigProvider(path)\n self.configuration.add_provider(provider)\n return provider\n\n def start(self, *, start_control_plane: bool = True) -> None:\n if self._started:\n return\n self._state = LifecycleState.STARTING\n config = self.configuration.load()\n self.logs.apply_config(config)\n self._register_health_contributors()\n self._register_workers()\n self.workers.start()\n if start_control_plane:\n self.control_plane.start(self)\n self._started = True\n self._refresh_state()\n\n def stop(self, timeout: float = 30.0, force: bool = False, stop_control_plane: bool = True) -> None:\n if not self._started:\n return\n self._state = LifecycleState.STOPPING\n self.workers.stop(timeout=timeout, force=force)\n if stop_control_plane:\n self.control_plane.stop()\n self._started = False\n self._state = LifecycleState.STOPPED\n\n def status(self) -> dict[str, object]:\n self._refresh_state()\n return self.control_plane.snapshot(self)\n\n def current_health(self) -> HealthPayload:\n self._refresh_state()\n return self.health.payload(self._state, self.workers.healths())\n\n async def health_status(self) -> HealthPayload:\n return self.current_health()\n\n async def start_runtime(self) -> dict[str, object] | str:\n self._refresh_state()\n if self._started:\n return \"runtime already running\"\n if self._state == LifecycleState.STOPPING:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n\n self.start(start_control_plane=False)\n started = self._wait_for_state({LifecycleState.IDLE, LifecycleState.BUSY}, timeout=self.ACTION_TIMEOUT_SECONDS)\n if started:\n return self._action_detail(\"runtime started\", timed_out=False)\n return self._action_detail(\"runtime start is still in progress\", timed_out=True)\n\n async def stop_runtime(self) -> dict[str, object] | str:\n self._refresh_state()\n if not self._started:\n if self._state == LifecycleState.STOPPING:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n return \"runtime already stopped\"\n\n self._state = LifecycleState.STOPPING\n try:\n self.workers.stop(timeout=self.ACTION_TIMEOUT_SECONDS, force=False)\n except TimeoutError:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n\n self._started = False\n self._state = LifecycleState.STOPPED\n return self._action_detail(\"runtime stopped\", timed_out=False)\n\n async def runtime_status(self) -> str:\n self._refresh_state()\n return self._state.value\n\n def _register_core_services(self) -> None:\n if self._core_registered:\n return\n self.services.register(\"configuration\", self.configuration)\n self.services.register(\"traces\", self.traces)\n self.services.register(\"health\", self.health)\n self.services.register(\"logs\", self.logs)\n self.services.register(\"workers\", self.workers)\n self.services.register(\"control_plane\", self.control_plane)\n self._core_registered = True\n\n def _register_health_contributors(self) -> None:\n for contributor in self.registry.health_contributors:\n self.health.register(contributor)\n\n def _register_workers(self) -> None:\n if self._workers_registered:\n return\n for worker in self.registry.workers:\n self.workers.register(worker)\n self._workers_registered = True\n\n def _refresh_state(self) -> None:\n lifecycle = self.workers.lifecycle_state()\n\n if self._state == LifecycleState.STOPPING:\n if lifecycle == LifecycleState.STOPPED:\n self._started = False\n self._state = LifecycleState.STOPPED\n return\n\n if not self._started:\n if lifecycle == LifecycleState.STOPPED:\n self._state = LifecycleState.STOPPED\n return\n\n self._state = lifecycle\n\n def _wait_for_state(self, target_states: set[LifecycleState], *, timeout: float) -> bool:\n deadline = monotonic() + timeout\n while monotonic() < deadline:\n self._refresh_state()\n if self._state in target_states:\n return True\n sleep(self.ACTION_POLL_INTERVAL_SECONDS)\n self._refresh_state()\n return self._state in target_states\n\n def _action_detail(self, message: str, *, timed_out: bool) -> dict[str, object]:\n self._refresh_state()\n return {\n \"message\": message,\n \"state\": self._state.value,\n \"timed_out\": timed_out,\n \"workers\": self.workers.snapshot(),\n }", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/core/runtime.py:RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 6, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": null, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.core.runtime", - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "class TraceService(TraceContextFactory):\n def __init__(self, transport: TraceTransport | None = None, store: TraceContextStore | None = None) -> None:\n self.transport = transport or NoOpTraceTransport()\n self.store = store or TraceContextStore()\n self._writer = TraceRecordWriter(self.transport)\n\n def create_context(\n self,\n *,\n alias: str,\n parent_id: str | None = None,\n kind: str | None = None,\n attrs: dict[str, Any] | None = None,\n ) -> str:\n record = TraceContextRecord(\n trace_id=uuid4().hex,\n alias=str(alias or \"\"),\n parent_id=parent_id,\n type=kind,\n event_time=utc_now(),\n attrs=dict(attrs or {}),\n )\n self.store.push(record)\n self._writer.write_context(record)\n return record.trace_id\n\n @contextmanager\n def open_context(\n self,\n *,\n alias: str,\n parent_id: str | None = None,\n kind: str | None = None,\n attrs: dict[str, Any] | None = None,\n ) -> Iterator[str]:\n trace_id = self.create_context(alias=alias, parent_id=parent_id, kind=kind, attrs=attrs)\n try:\n yield trace_id\n finally:\n self.store.pop()\n\n def current_trace_id(self) -> str | None:\n return self.store.current_trace_id()\n\n def close_context(self) -> str | None:\n previous = self.store.pop()\n return previous.record.trace_id if previous else None\n\n def step(self, name: str) -> None:\n self.store.set_step(str(name or \"\"))\n\n def info(self, message: str, *, status: str | None = None, attrs: dict[str, Any] | None = None) -> None:\n self._write_message(\"INFO\", message, status, attrs)\n\n def debug(self, message: str, *, status: str | None = None, attrs: dict[str, Any] | None = None) -> None:\n self._write_message(\"DEBUG\", message, status, attrs)\n\n def warning(self, message: str, *, status: str | None = None, attrs: dict[str, Any] | None = None) -> None:\n self._write_message(\"WARNING\", message, status, attrs)\n\n def error(self, message: str, *, status: str | None = None, attrs: dict[str, Any] | None = None) -> None:\n self._write_message(\"ERROR\", message, status, attrs)\n\n def exception(self, message: str, *, status: str = \"failed\", attrs: dict[str, Any] | None = None) -> None:\n self._write_message(\"ERROR\", message, status, attrs)\n\n def new_root(self, operation: str) -> TraceContext:\n trace_id = self.create_context(alias=operation, kind=\"operation\", attrs={\"operation\": operation})\n return TraceContext(trace_id=trace_id, span_id=trace_id, attributes={\"operation\": operation})\n\n def child_of(self, parent: TraceContext, operation: str) -> TraceContext:\n trace_id = self.create_context(\n alias=operation,\n parent_id=parent.trace_id,\n kind=\"worker\",\n attrs={\"operation\": operation},\n )\n return TraceContext(\n trace_id=trace_id,\n span_id=trace_id,\n parent_span_id=parent.span_id,\n attributes={\"operation\": operation},\n )\n\n def attach(self, metadata: dict[str, object], context: TraceContext) -> dict[str, object]:\n updated = dict(metadata)\n updated[\"trace_id\"] = context.trace_id\n updated[\"span_id\"] = context.span_id\n updated[\"parent_span_id\"] = context.parent_span_id\n return updated\n\n def resume(self, metadata: dict[str, object], operation: str) -> TraceContext:\n trace_id = str(metadata.get(\"trace_id\") or uuid4().hex)\n span_id = str(metadata.get(\"span_id\") or trace_id)\n parent_id = metadata.get(\"parent_span_id\")\n self.create_context(\n alias=operation,\n parent_id=str(parent_id) if parent_id else None,\n kind=\"worker\",\n attrs=dict(metadata),\n )\n return TraceContext(\n trace_id=trace_id,\n span_id=span_id,\n parent_span_id=str(parent_id) if parent_id else None,\n attributes={\"operation\": operation},\n )\n\n def _write_message(\n self,\n level: TraceLevel,\n message: str,\n status: str | None,\n attrs: dict[str, Any] | None,\n ) -> None:\n active = self.store.current()\n if active is None:\n raise RuntimeError(\"Trace context is not bound. Call create_context() first.\")\n record = TraceLogMessage(\n trace_id=active.record.trace_id,\n step=active.step,\n status=str(status or \"\"),\n message=str(message or \"\"),\n level=level,\n event_time=utc_now(),\n attrs=dict(attrs or {}),\n )\n self._writer.write_message(record)", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/tracing/service.py:TraceService", - "span_start": 39, - "span_end": 166, - "lexical_rank": 6, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": null, - "metadata": { - "chunk_index": 1, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.tracing.service", - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/contracts/__init__.py", - "content": "__all__: list[str] = []", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/__init__.py:1-1", - "span_start": 1, - "span_end": 1, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": null, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.app_runtime.__init__", - "is_test": false, - "blob_sha": "8eea9df4f6d7b38ca0e39ccc27b04700e3d08dbeec8046d613d22706d19985fa", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "retrieval_report": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "vector", - "C2_DEPENDENCY_GRAPH": "vector", - "C0_SOURCE_CHUNKS": "vector" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C0_SOURCE_CHUNKS": 10 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [] - } - }, - "fallback": { - "used": false, - "reason": null - }, - "retrieval_by_layer_ms": { - "C1_SYMBOL_CATALOG": 41, - "C2_DEPENDENCY_GRAPH": 42, - "C0_SOURCE_CHUNKS": 35 - } - } - }, - "diagnostics": { - "intent_correct": null, - "target_found": true, - "layers_used": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ], - "retrieval_sufficient": true, - "answer_mode": "normal", - "resolved_target": "TraceService", - "answer_policy_branch": "normal_answer", - "decision_reason": "evidence_sufficient", - "router_result": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "retrieval_profile": "code", - "sub_intent": "FIND_TESTS", - "path_scope": [], - "layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ], - "symbol_resolution_status": "resolved" - }, - "retrieval_request": { - "rag_session_id": "7d11da21-faa0-4cea-aede-aeabe069164c", - "query": "Где тесты для TraceService?", - "sub_intent": "FIND_TESTS", - "path_scope": [], - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ] - }, - "per_layer_outcome": [ - { - "layer_id": "C1_SYMBOL_CATALOG", - "hit_count": 8, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C2_DEPENDENCY_GRAPH", - "hit_count": 6, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C0_SOURCE_CHUNKS", - "hit_count": 10, - "empty": false, - "fallback_used": false - } - ], - "empty_layers": [], - "evidence_gate_decision": { - "sufficient": true, - "failure_reasons": [], - "evidence_count": 24 - }, - "evidence_gate_input": { - "resolved_target": "TraceService", - "sub_intent": "FIND_TESTS", - "target_type": "symbol", - "evidence_count": 24, - "code_chunk_count": 24, - "entrypoint_count": 0, - "relation_count": 6, - "test_evidence_count": 3, - "symbol_resolution_status": "resolved", - "path_scope": [] - }, - "post_evidence_gate": { - "input": { - "answer_mode": "normal", - "degraded_message": "", - "resolved_target": "TraceService", - "draft_answer_preview": "Прямые тесты для TraceService находятся в файле `tests/test_runtime.py`:\n\n- `test_trace_service_allows_messages_without_status`: проверяет возможность отправки сообщений без статуса.\n- `test_trace_service_writes_contexts_and_messages`: проверяет запись контекстов и сообщений.\n- `test_trace_service_s", - "repair_candidate": true - }, - "output": { - "passed": true, - "action": "return", - "reasons": [], - "repair_used": false, - "final_answer_preview": "Прямые тесты для TraceService находятся в файле `tests/test_runtime.py`:\n\n- `test_trace_service_allows_messages_without_status`: проверяет возможность отправки сообщений без статуса.\n- `test_trace_service_writes_contexts_and_messages`: проверяет запись контекстов и сообщений.\n- `test_trace_service_s" - } - }, - "failure_reasons": [], - "timings_ms": { - "router": 1, - "retrieval": 119, - "pre_evidence_gate": 1, - "llm": 2200, - "post_evidence_gate": 1 - } - }, - "rag_rows": [ - { - "path": "src/plba/__init__.py", - "content": "const TraceService\nTraceService = plba.tracing.TraceService", - "layer": "C1_SYMBOL_CATALOG", - "title": "TraceService", - "span_start": 20, - "span_end": 20, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "259ec03b77b9387ea53f69c77af32791dd29adf6de617ba72dd3f839197342a1", - "qname": "TraceService", - "kind": "const", - "signature": "TraceService = plba.tracing.TraceService", - "parent_symbol_id": null, - "package_or_module": "src.plba.__init__", - "is_test": false, - "blob_sha": "24e755ec8c249d14fb0e675b5dbf2b71ab91afb9c849897eebfa9feb2499e19d", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "const TraceService\nTraceService = app_runtime.tracing.service.TraceService", - "layer": "C1_SYMBOL_CATALOG", - "title": "TraceService", - "span_start": 14, - "span_end": 14, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "3ccf6212fd7d9730f9df933e2ee7671b65bdae0520577e1a49c6432262842db6", - "qname": "TraceService", - "kind": "const", - "signature": "TraceService = app_runtime.tracing.service.TraceService", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.core.runtime", - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/__init__.py", - "content": "const TraceService\nTraceService = app_runtime.tracing.service.TraceService", - "layer": "C1_SYMBOL_CATALOG", - "title": "TraceService", - "span_start": 2, - "span_end": 2, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "ecd2fab7fa9744b2adca84d3d213f7aadcb7e1da84b9c2764a4ab39c65282b11", - "qname": "TraceService", - "kind": "const", - "signature": "TraceService = app_runtime.tracing.service.TraceService", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.tracing.__init__", - "is_test": false, - "blob_sha": "a01dea5f773515aeaae8e6d3431fcb93531a8b577dfa26c2e5db16cd6ae6e4d9", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "class TraceService\nTraceService(TraceContextFactory)", - "layer": "C1_SYMBOL_CATALOG", - "title": "TraceService", - "span_start": 39, - "span_end": 166, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "c2b2b976d99f2c600000b753731b26e0a69adcb4359398b93073590c5d5d04f4", - "qname": "TraceService", - "kind": "class", - "signature": "TraceService(TraceContextFactory)", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.tracing.service", - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/tracing.py", - "content": "const TraceService\nTraceService = app_runtime.tracing.service.TraceService", - "layer": "C1_SYMBOL_CATALOG", - "title": "TraceService", - "span_start": 1, - "span_end": 1, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "a4556fb3f83c50ea68b94a679786ce802cab7ffd9d7138aad3d6009b2661f425", - "qname": "TraceService", - "kind": "const", - "signature": "TraceService = app_runtime.tracing.service.TraceService", - "parent_symbol_id": null, - "package_or_module": "src.plba.tracing", - "is_test": false, - "blob_sha": "a27e11c716c93c3fcefe6f11b4cc420a6b743e7606606071d7f1aeeccc4e7d45", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "method TraceService.open_context\nopen_context(self)", - "layer": "C1_SYMBOL_CATALOG", - "title": "TraceService.open_context", - "span_start": 66, - "span_end": 78, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "2da3d5b20a947bf63e14c103be4689b72fd837e0a82abd6c497846375d4c7426", - "qname": "TraceService.open_context", - "kind": "method", - "signature": "open_context(self)", - "parent_symbol_id": "TraceService", - "package_or_module": "src.app_runtime.tracing.service", - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "method TraceService.create_context\ncreate_context(self)", - "layer": "C1_SYMBOL_CATALOG", - "title": "TraceService.create_context", - "span_start": 45, - "span_end": 63, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "ff44881104b65ef50ee6fe16d367d4a81b6e7eb5c44c0963cf4543faec785d4a", - "qname": "TraceService.create_context", - "kind": "method", - "signature": "create_context(self)", - "parent_symbol_id": "TraceService", - "package_or_module": "src.app_runtime.tracing.service", - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "method TraceService.current_trace_id\ncurrent_trace_id(self)", - "layer": "C1_SYMBOL_CATALOG", - "title": "TraceService.current_trace_id", - "span_start": 80, - "span_end": 81, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "41135180f7b3b9ab20e097e0747474e219c37dd2366ef08a7b43c1f3edb10b4c", - "qname": "TraceService.current_trace_id", - "kind": "method", - "signature": "current_trace_id(self)", - "parent_symbol_id": "TraceService", - "package_or_module": "src.app_runtime.tracing.service", - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "TraceService.__init__\n -> TraceService.store\n -> TraceService.create_context", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "TraceService.__init__:dataflow_slice", - "span_start": 42, - "span_end": 61, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "3b052062067a78aef3302ee1d996897e02a67d1b340397bea4f59fe147c0492a", - "edge_type": "dataflow_slice", - "src_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "src_qname": "TraceService.__init__", - "dst_symbol_id": "ff44881104b65ef50ee6fe16d367d4a81b6e7eb5c44c0963cf4543faec785d4a", - "dst_ref": "TraceService.create_context", - "resolution": "resolved", - "slice_id": "3b052062067a78aef3302ee1d996897e02a67d1b340397bea4f59fe147c0492a", - "root_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "path_symbols": [ - "TraceService.__init__", - "TraceService.store", - "TraceService.create_context" - ], - "path_symbol_ids": [ - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "ff44881104b65ef50ee6fe16d367d4a81b6e7eb5c44c0963cf4543faec785d4a" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "TraceService.__init__\n -> TraceService.store\n -> TraceService.close_context", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "TraceService.__init__:dataflow_slice", - "span_start": 42, - "span_end": 84, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "7a9353ef57c9ae5d19b3a0c6ac50fad05e6d21d31bbe1cd1cd07af6332ba6505", - "edge_type": "dataflow_slice", - "src_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "src_qname": "TraceService.__init__", - "dst_symbol_id": "01e14158dcced7e52d0c8ac84ac7b9a75225c261b6aca6a1d7da802d0994721c", - "dst_ref": "TraceService.close_context", - "resolution": "resolved", - "slice_id": "7a9353ef57c9ae5d19b3a0c6ac50fad05e6d21d31bbe1cd1cd07af6332ba6505", - "root_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "path_symbols": [ - "TraceService.__init__", - "TraceService.store", - "TraceService.close_context" - ], - "path_symbol_ids": [ - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "01e14158dcced7e52d0c8ac84ac7b9a75225c261b6aca6a1d7da802d0994721c" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "TraceService.__init__\n -> TraceService.store\n -> TraceService.open_context", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "TraceService.__init__:dataflow_slice", - "span_start": 42, - "span_end": 78, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "a6e13b9ebc4fed84586afd53ed92a4d14757e440873f572b2337d5622ee96031", - "edge_type": "dataflow_slice", - "src_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "src_qname": "TraceService.__init__", - "dst_symbol_id": "2da3d5b20a947bf63e14c103be4689b72fd837e0a82abd6c497846375d4c7426", - "dst_ref": "TraceService.open_context", - "resolution": "resolved", - "slice_id": "a6e13b9ebc4fed84586afd53ed92a4d14757e440873f572b2337d5622ee96031", - "root_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "path_symbols": [ - "TraceService.__init__", - "TraceService.store", - "TraceService.open_context" - ], - "path_symbol_ids": [ - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "2da3d5b20a947bf63e14c103be4689b72fd837e0a82abd6c497846375d4c7426" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "TraceService.__init__\n -> TraceService.transport\n -> TraceService.__init__", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "TraceService.__init__:dataflow_slice", - "span_start": 41, - "span_end": 43, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "1e923a93faa05c3c43ca9b19bd047007a8589ccce57d3cc1798ae7f9f200af98", - "edge_type": "dataflow_slice", - "src_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "src_qname": "TraceService.__init__", - "dst_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "dst_ref": "TraceService.__init__", - "resolution": "resolved", - "slice_id": "1e923a93faa05c3c43ca9b19bd047007a8589ccce57d3cc1798ae7f9f200af98", - "root_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "path_symbols": [ - "TraceService.__init__", - "TraceService.transport", - "TraceService.__init__" - ], - "path_symbol_ids": [ - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "TraceService.__init__\n -> TraceService.store\n -> TraceService.current_trace_id", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "TraceService.__init__:dataflow_slice", - "span_start": 42, - "span_end": 81, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "3ea17138634b1190bded77ddb84aa1595124f6519b246f24fc4b02bd62b5cac1", - "edge_type": "dataflow_slice", - "src_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "src_qname": "TraceService.__init__", - "dst_symbol_id": "41135180f7b3b9ab20e097e0747474e219c37dd2366ef08a7b43c1f3edb10b4c", - "dst_ref": "TraceService.current_trace_id", - "resolution": "resolved", - "slice_id": "3ea17138634b1190bded77ddb84aa1595124f6519b246f24fc4b02bd62b5cac1", - "root_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "path_symbols": [ - "TraceService.__init__", - "TraceService.store", - "TraceService.current_trace_id" - ], - "path_symbol_ids": [ - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "41135180f7b3b9ab20e097e0747474e219c37dd2366ef08a7b43c1f3edb10b4c" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "TraceService.__init__\n -> TraceService.store\n -> TraceService.step", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "TraceService.__init__:dataflow_slice", - "span_start": 42, - "span_end": 88, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "9f34c5da9b09fba99df6f6b1bde183a9aeb45111b8218a747c71590c2c9f60f2", - "edge_type": "dataflow_slice", - "src_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "src_qname": "TraceService.__init__", - "dst_symbol_id": "c44bfbc66cf747283f30088da3e011a10395031d41e77b74e523c24997f641ca", - "dst_ref": "TraceService.step", - "resolution": "resolved", - "slice_id": "9f34c5da9b09fba99df6f6b1bde183a9aeb45111b8218a747c71590c2c9f60f2", - "root_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "path_symbols": [ - "TraceService.__init__", - "TraceService.store", - "TraceService.step" - ], - "path_symbol_ids": [ - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "c44bfbc66cf747283f30088da3e011a10395031d41e77b74e523c24997f641ca" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/tracing.py", - "content": "from app_runtime.tracing.service import TraceService\nfrom app_runtime.tracing.transport import MySqlTraceTransport, NoOpTraceTransport\n\n__all__ = [\"MySqlTraceTransport\", \"NoOpTraceTransport\", \"TraceService\"]", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/plba/tracing.py:1-4", - "span_start": 1, - "span_end": 4, - "lexical_rank": 6, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.plba.tracing", - "is_test": false, - "blob_sha": "a27e11c716c93c3fcefe6f11b4cc420a6b743e7606606071d7f1aeeccc4e7d45", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_runtime.py", - "content": "def test_trace_service_allows_messages_without_status() -> None:\n from app_runtime.tracing.service import TraceService\n\n transport = RecordingTransport()\n manager = TraceService(transport=transport)\n\n with manager.open_context(alias=\"worker\", kind=\"worker\"):\n manager.step(\"optional-status\")\n manager.debug(\"debug without status\")\n manager.info(\"info without status\")\n manager.warning(\"warning without status\")\n manager.error(\"error without status\")\n\n assert [message.status for message in transport.messages] == [\"\", \"\", \"\", \"\"]\n assert all(message.trace_id == transport.contexts[0].trace_id for message in transport.messages)", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_runtime.py:test_trace_service_allows_messages_without_status", - "span_start": 279, - "span_end": 293, - "lexical_rank": 6, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 11, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_runtime", - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/__init__.py", - "content": "from app_runtime.contracts.trace import TraceContext, TraceContextRecord, TraceLogMessage, TraceTransport\nfrom app_runtime.tracing.service import TraceManager, TraceService\nfrom app_runtime.tracing.store import ActiveTraceContext, TraceContextStore\nfrom app_runtime.tracing.transport import MySqlTraceTransport, NoOpTraceTransport\n\n__all__ = [\n \"ActiveTraceContext\",\n \"MySqlTraceTransport\",\n \"NoOpTraceTransport\",\n \"TraceContext\",\n \"TraceContextRecord\",\n \"TraceContextStore\",\n \"TraceLogMessage\",\n \"TraceManager\",\n \"TraceService\",\n \"TraceTransport\",\n]", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/tracing/__init__.py:1-17", - "span_start": 1, - "span_end": 17, - "lexical_rank": 6, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.app_runtime.tracing.__init__", - "is_test": false, - "blob_sha": "a01dea5f773515aeaae8e6d3431fcb93531a8b577dfa26c2e5db16cd6ae6e4d9", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/__init__.py", - "content": "from plba.bootstrap import create_runtime\nfrom plba.config import ConfigFileLoader, FileConfigProvider\nfrom plba.control import ControlActionSet, ControlChannel, ControlPlaneService, HttpControlChannel\nfrom plba.contracts import (\n ApplicationModule,\n ConfigProvider,\n HealthContributor,\n TraceContext,\n TraceContextRecord,\n TraceLogMessage,\n TraceTransport,\n Worker,\n WorkerHealth,\n WorkerStatus,\n)\nfrom plba.core import ConfigurationManager, RuntimeManager, ServiceContainer\nfrom plba.health import HealthRegistry\nfrom plba.logging import LogManager\nfrom plba.queue import InMemoryTaskQueue\nfrom plba.tracing import MySqlTraceTransport, NoOpTraceTransport, TraceService\nfrom plba.workflow import (\n StepResult,\n WorkflowContext,\n WorkflowDefinition,\n WorkflowEngine,\n WorkflowEngineHooks,\n WorkflowNode,\n WorkflowRuntimeFactory,\n WorkflowStep,\n)\nfrom plba.workers import WorkerSupervisor\n\n__all__ = [\n \"ApplicationModule\",\n \"ConfigFileLoader\",\n \"ConfigProvider\",\n \"ConfigurationManager\",\n \"ControlActionSet\",\n \"ControlChannel\",\n \"ControlPlaneService\",\n \"create_runtime\",\n \"FileConfigProvider\",\n \"HealthContributor\",\n \"HealthRegistry\",\n \"HttpControlChannel\",\n \"InMemoryTaskQueue\",\n \"LogManager\",\n \"MySqlTraceTransport\",\n \"NoOpTraceTransport\",\n \"RuntimeManager\",\n \"ServiceContainer\",\n \"TraceContext\",\n \"TraceContextRecord\",\n \"TraceLogMessage\",\n \"TraceService\",\n \"TraceTransport\",\n \"StepResult\",\n \"Worker\",\n \"WorkerHealth\",\n \"WorkerStatus\",\n \"WorkflowContext\",\n \"WorkflowDefinition\",\n \"WorkflowEngine\",\n \"WorkflowEngineHooks\",\n \"WorkflowNode\",\n \"WorkflowRuntimeFactory\",\n \"WorkflowStep\",\n \"WorkerSupervisor\",\n]", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/plba/__init__.py:1-69", - "span_start": 1, - "span_end": 69, - "lexical_rank": 6, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.plba.__init__", - "is_test": false, - "blob_sha": "24e755ec8c249d14fb0e675b5dbf2b71ab91afb9c849897eebfa9feb2499e19d", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_runtime.py", - "content": "def test_trace_service_writes_contexts_and_messages() -> None:\n from app_runtime.tracing.service import TraceService\n\n transport = RecordingTransport()\n manager = TraceService(transport=transport)\n\n with manager.open_context(alias=\"worker\", kind=\"worker\", attrs={\"routine\": \"incoming\"}):\n manager.step(\"parse\")\n manager.info(\"started\", status=\"ok\", attrs={\"attempt\": 1})\n\n assert len(transport.contexts) == 1\n assert len(transport.messages) == 1\n assert transport.contexts[0].alias == \"worker\"\n assert transport.messages[0].step == \"parse\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_runtime.py:test_trace_service_writes_contexts_and_messages", - "span_start": 246, - "span_end": 259, - "lexical_rank": 6, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 9, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_runtime", - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_runtime.py", - "content": "def test_trace_service_supports_debug_warning_and_error_levels() -> None:\n from app_runtime.tracing.service import TraceService\n\n transport = RecordingTransport()\n manager = TraceService(transport=transport)\n\n with manager.open_context(alias=\"worker\", kind=\"worker\", attrs={\"routine\": \"incoming\"}):\n manager.step(\"validate\")\n manager.debug(\"validation details\", attrs={\"rule\": \"basic\"})\n manager.warning(\"validation warning\", status=\"degraded\", attrs={\"attempt\": 1})\n manager.error(\"integration failed\", status=\"failed\", attrs={\"integration\": \"crm\"})\n manager.exception(\"caught exception\", attrs={\"exception_type\": \"RuntimeError\"})\n\n levels = [message.level for message in transport.messages]\n assert levels == [\"DEBUG\", \"WARNING\", \"ERROR\", \"ERROR\"]", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_runtime.py:test_trace_service_supports_debug_warning_and_error_levels", - "span_start": 262, - "span_end": 276, - "lexical_rank": 6, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 10, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_runtime", - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "class TraceManager(TraceService):\n \"\"\"Compatibility alias during the transition from ConfigManager-shaped naming.\"\"\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/tracing/service.py:TraceManager", - "span_start": 169, - "span_end": 170, - "lexical_rank": 6, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 2, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.tracing.service", - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "class RuntimeManager:\n ACTION_TIMEOUT_SECONDS = 10.0\n ACTION_POLL_INTERVAL_SECONDS = 0.05\n\n def __init__(\n self,\n configuration: ConfigurationManager | None = None,\n services: ServiceContainer | None = None,\n traces: TraceService | None = None,\n health: HealthRegistry | None = None,\n logs: LogManager | None = None,\n workers: WorkerSupervisor | None = None,\n control_plane: ControlPlaneService | None = None,\n ) -> None:\n self.configuration = configuration or ConfigurationManager()\n self.services = services or ServiceContainer()\n self.traces = traces or TraceService()\n self.health = health or HealthRegistry()\n self.logs = logs or LogManager()\n self.workers = workers or WorkerSupervisor()\n self.control_plane = control_plane or ControlPlaneService()\n self.registry = ModuleRegistry(self.services)\n self._started = False\n self._state = LifecycleState.IDLE\n self._core_registered = False\n self._workers_registered = False\n self._register_core_services()\n\n def register_module(self, module: ApplicationModule) -> None:\n self.registry.register_module(module.name)\n module.register(self.registry)\n\n def add_config_file(self, path: str) -> FileConfigProvider:\n provider = FileConfigProvider(path)\n self.configuration.add_provider(provider)\n return provider\n\n def start(self, *, start_control_plane: bool = True) -> None:\n if self._started:\n return\n self._state = LifecycleState.STARTING\n config = self.configuration.load()\n self.logs.apply_config(config)\n self._register_health_contributors()\n self._register_workers()\n self.workers.start()\n if start_control_plane:\n self.control_plane.start(self)\n self._started = True\n self._refresh_state()\n\n def stop(self, timeout: float = 30.0, force: bool = False, stop_control_plane: bool = True) -> None:\n if not self._started:\n return\n self._state = LifecycleState.STOPPING\n self.workers.stop(timeout=timeout, force=force)\n if stop_control_plane:\n self.control_plane.stop()\n self._started = False\n self._state = LifecycleState.STOPPED\n\n def status(self) -> dict[str, object]:\n self._refresh_state()\n return self.control_plane.snapshot(self)\n\n def current_health(self) -> HealthPayload:\n self._refresh_state()\n return self.health.payload(self._state, self.workers.healths())\n\n async def health_status(self) -> HealthPayload:\n return self.current_health()\n\n async def start_runtime(self) -> dict[str, object] | str:\n self._refresh_state()\n if self._started:\n return \"runtime already running\"\n if self._state == LifecycleState.STOPPING:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n\n self.start(start_control_plane=False)\n started = self._wait_for_state({LifecycleState.IDLE, LifecycleState.BUSY}, timeout=self.ACTION_TIMEOUT_SECONDS)\n if started:\n return self._action_detail(\"runtime started\", timed_out=False)\n return self._action_detail(\"runtime start is still in progress\", timed_out=True)\n\n async def stop_runtime(self) -> dict[str, object] | str:\n self._refresh_state()\n if not self._started:\n if self._state == LifecycleState.STOPPING:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n return \"runtime already stopped\"\n\n self._state = LifecycleState.STOPPING\n try:\n self.workers.stop(timeout=self.ACTION_TIMEOUT_SECONDS, force=False)\n except TimeoutError:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n\n self._started = False\n self._state = LifecycleState.STOPPED\n return self._action_detail(\"runtime stopped\", timed_out=False)\n\n async def runtime_status(self) -> str:\n self._refresh_state()\n return self._state.value\n\n def _register_core_services(self) -> None:\n if self._core_registered:\n return\n self.services.register(\"configuration\", self.configuration)\n self.services.register(\"traces\", self.traces)\n self.services.register(\"health\", self.health)\n self.services.register(\"logs\", self.logs)\n self.services.register(\"workers\", self.workers)\n self.services.register(\"control_plane\", self.control_plane)\n self._core_registered = True\n\n def _register_health_contributors(self) -> None:\n for contributor in self.registry.health_contributors:\n self.health.register(contributor)\n\n def _register_workers(self) -> None:\n if self._workers_registered:\n return\n for worker in self.registry.workers:\n self.workers.register(worker)\n self._workers_registered = True\n\n def _refresh_state(self) -> None:\n lifecycle = self.workers.lifecycle_state()\n\n if self._state == LifecycleState.STOPPING:\n if lifecycle == LifecycleState.STOPPED:\n self._started = False\n self._state = LifecycleState.STOPPED\n return\n\n if not self._started:\n if lifecycle == LifecycleState.STOPPED:\n self._state = LifecycleState.STOPPED\n return\n\n self._state = lifecycle\n\n def _wait_for_state(self, target_states: set[LifecycleState], *, timeout: float) -> bool:\n deadline = monotonic() + timeout\n while monotonic() < deadline:\n self._refresh_state()\n if self._state in target_states:\n return True\n sleep(self.ACTION_POLL_INTERVAL_SECONDS)\n self._refresh_state()\n return self._state in target_states\n\n def _action_detail(self, message: str, *, timed_out: bool) -> dict[str, object]:\n self._refresh_state()\n return {\n \"message\": message,\n \"state\": self._state.value,\n \"timed_out\": timed_out,\n \"workers\": self.workers.snapshot(),\n }", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/core/runtime.py:RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 6, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.core.runtime", - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "class TraceService(TraceContextFactory):\n def __init__(self, transport: TraceTransport | None = None, store: TraceContextStore | None = None) -> None:\n self.transport = transport or NoOpTraceTransport()\n self.store = store or TraceContextStore()\n self._writer = TraceRecordWriter(self.transport)\n\n def create_context(\n self,\n *,\n alias: str,\n parent_id: str | None = None,\n kind: str | None = None,\n attrs: dict[str, Any] | None = None,\n ) -> str:\n record = TraceContextRecord(\n trace_id=uuid4().hex,\n alias=str(alias or \"\"),\n parent_id=parent_id,\n type=kind,\n event_time=utc_now(),\n attrs=dict(attrs or {}),\n )\n self.store.push(record)\n self._writer.write_context(record)\n return record.trace_id\n\n @contextmanager\n def open_context(\n self,\n *,\n alias: str,\n parent_id: str | None = None,\n kind: str | None = None,\n attrs: dict[str, Any] | None = None,\n ) -> Iterator[str]:\n trace_id = self.create_context(alias=alias, parent_id=parent_id, kind=kind, attrs=attrs)\n try:\n yield trace_id\n finally:\n self.store.pop()\n\n def current_trace_id(self) -> str | None:\n return self.store.current_trace_id()\n\n def close_context(self) -> str | None:\n previous = self.store.pop()\n return previous.record.trace_id if previous else None\n\n def step(self, name: str) -> None:\n self.store.set_step(str(name or \"\"))\n\n def info(self, message: str, *, status: str | None = None, attrs: dict[str, Any] | None = None) -> None:\n self._write_message(\"INFO\", message, status, attrs)\n\n def debug(self, message: str, *, status: str | None = None, attrs: dict[str, Any] | None = None) -> None:\n self._write_message(\"DEBUG\", message, status, attrs)\n\n def warning(self, message: str, *, status: str | None = None, attrs: dict[str, Any] | None = None) -> None:\n self._write_message(\"WARNING\", message, status, attrs)\n\n def error(self, message: str, *, status: str | None = None, attrs: dict[str, Any] | None = None) -> None:\n self._write_message(\"ERROR\", message, status, attrs)\n\n def exception(self, message: str, *, status: str = \"failed\", attrs: dict[str, Any] | None = None) -> None:\n self._write_message(\"ERROR\", message, status, attrs)\n\n def new_root(self, operation: str) -> TraceContext:\n trace_id = self.create_context(alias=operation, kind=\"operation\", attrs={\"operation\": operation})\n return TraceContext(trace_id=trace_id, span_id=trace_id, attributes={\"operation\": operation})\n\n def child_of(self, parent: TraceContext, operation: str) -> TraceContext:\n trace_id = self.create_context(\n alias=operation,\n parent_id=parent.trace_id,\n kind=\"worker\",\n attrs={\"operation\": operation},\n )\n return TraceContext(\n trace_id=trace_id,\n span_id=trace_id,\n parent_span_id=parent.span_id,\n attributes={\"operation\": operation},\n )\n\n def attach(self, metadata: dict[str, object], context: TraceContext) -> dict[str, object]:\n updated = dict(metadata)\n updated[\"trace_id\"] = context.trace_id\n updated[\"span_id\"] = context.span_id\n updated[\"parent_span_id\"] = context.parent_span_id\n return updated\n\n def resume(self, metadata: dict[str, object], operation: str) -> TraceContext:\n trace_id = str(metadata.get(\"trace_id\") or uuid4().hex)\n span_id = str(metadata.get(\"span_id\") or trace_id)\n parent_id = metadata.get(\"parent_span_id\")\n self.create_context(\n alias=operation,\n parent_id=str(parent_id) if parent_id else None,\n kind=\"worker\",\n attrs=dict(metadata),\n )\n return TraceContext(\n trace_id=trace_id,\n span_id=span_id,\n parent_span_id=str(parent_id) if parent_id else None,\n attributes={\"operation\": operation},\n )\n\n def _write_message(\n self,\n level: TraceLevel,\n message: str,\n status: str | None,\n attrs: dict[str, Any] | None,\n ) -> None:\n active = self.store.current()\n if active is None:\n raise RuntimeError(\"Trace context is not bound. Call create_context() first.\")\n record = TraceLogMessage(\n trace_id=active.record.trace_id,\n step=active.step,\n status=str(status or \"\"),\n message=str(message or \"\"),\n level=level,\n event_time=utc_now(),\n attrs=dict(attrs or {}),\n )\n self._writer.write_message(record)", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/tracing/service.py:TraceService", - "span_start": 39, - "span_end": 166, - "lexical_rank": 6, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 1, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.tracing.service", - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/contracts/__init__.py", - "content": "__all__: list[str] = []", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/__init__.py:1-1", - "span_start": 1, - "span_end": 1, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.app_runtime.__init__", - "is_test": false, - "blob_sha": "8eea9df4f6d7b38ca0e39ccc27b04700e3d08dbeec8046d613d22706d19985fa", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "validation": { - "passed": true, - "action": "return", - "reasons": [] - }, - "steps": [ - { - "step": "router", - "status": "completed", - "timings_ms": { - "router": 1 - }, - "output": { - "intent": "CODE_QA", - "sub_intent": "FIND_TESTS", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - } - }, - { - "step": "retrieval", - "status": "completed", - "timings_ms": { - "retrieval": 119 - }, - "output": { - "rag_count": 24, - "answer_path_rag_count": 24, - "resolved_symbol_status": "resolved", - "resolved_symbol": "TraceService", - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ] - }, - "diagnostics": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "vector", - "C2_DEPENDENCY_GRAPH": "vector", - "C0_SOURCE_CHUNKS": "vector" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C0_SOURCE_CHUNKS": 10 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [] - } - }, - "fallback": { - "used": false, - "reason": null - }, - "retrieval_by_layer_ms": { - "C1_SYMBOL_CATALOG": 41, - "C2_DEPENDENCY_GRAPH": 42, - "C0_SOURCE_CHUNKS": 35 - } - } - }, - { - "step": "pre_evidence_gate", - "status": "passed", - "timings_ms": { - "pre_evidence_gate": 1 - }, - "input": { - "resolved_target": "TraceService", - "sub_intent": "FIND_TESTS", - "target_type": "symbol", - "evidence_count": 24, - "code_chunk_count": 24, - "entrypoint_count": 0, - "relation_count": 6, - "test_evidence_count": 3, - "symbol_resolution_status": "resolved", - "path_scope": [] - }, - "output": { - "passed": true, - "failure_reasons": [], - "degraded_message": "", - "evidence_count": 24 - } - }, - { - "step": "llm", - "status": "completed", - "timings_ms": { - "llm": 2200 - }, - "output": { - "prompt_name": "code_qa_find_tests_answer", - "answer_preview": "Прямые тесты для TraceService находятся в файле `tests/test_runtime.py`:\n\n- `test_trace_service_allows_messages_without_status`: проверяет возможность отправки сообщений без статуса.\n- `test_trace_service_writes_contexts_and_messages`: проверяет запись контекстов и сообщений.\n- `test_trace_service_s", - "resolved_target": "TraceService", - "answer_policy_branch": "normal_answer", - "decision_reason": "evidence_sufficient" - } - }, - { - "step": "post_evidence_gate", - "status": "passed", - "timings_ms": { - "post_evidence_gate": 1, - "post_evidence_gate_recheck": 0, - "repair": 0 - }, - "input": { - "answer_mode": "normal", - "degraded_message": "", - "resolved_target": "TraceService", - "draft_answer_preview": "Прямые тесты для TraceService находятся в файле `tests/test_runtime.py`:\n\n- `test_trace_service_allows_messages_without_status`: проверяет возможность отправки сообщений без статуса.\n- `test_trace_service_writes_contexts_and_messages`: проверяет запись контекстов и сообщений.\n- `test_trace_service_s", - "repair_candidate": true - }, - "output": { - "passed": true, - "action": "return", - "reasons": [], - "repair_used": false, - "final_answer_preview": "Прямые тесты для TraceService находятся в файле `tests/test_runtime.py`:\n\n- `test_trace_service_allows_messages_without_status`: проверяет возможность отправки сообщений без статуса.\n- `test_trace_service_writes_contexts_and_messages`: проверяет запись контекстов и сообщений.\n- `test_trace_service_s" - } - } - ] - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/plba_full_chain_subintents_v3/20260312_174008/full_chain_plba_code_subintents_v2_plba-v2-find-tests-trace-service.md b/tests/pipeline_setup_v3/test_results/plba_full_chain_subintents_v3/20260312_174008/full_chain_plba_code_subintents_v2_plba-v2-find-tests-trace-service.md deleted file mode 100644 index fe688c2..0000000 --- a/tests/pipeline_setup_v3/test_results/plba_full_chain_subintents_v3/20260312_174008/full_chain_plba_code_subintents_v2_plba-v2-find-tests-trace-service.md +++ /dev/null @@ -1,269 +0,0 @@ -# plba-v2-find-tests-trace-service - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_02_pipeline/full_chain_plba_code_subintents_v2.yaml -- runner: agent_runtime -- mode: full_chain -- passed: True - -## Query -Где тесты для TraceService? - -## Actual -{ - "intent": "CODE_QA", - "sub_intent": "FIND_TESTS", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 24, - "llm_answer": "Прямые тесты для TraceService находятся в файле `tests/test_runtime.py`:\n\n- `test_trace_service_allows_messages_without_status`: проверяет возможность отправки сообщений без статуса.\n- `test_trace_service_writes_contexts_and_messages`: проверяет запись контекстов и сообщений.\n- `test_trace_service_supports_debug_warning_and_error_levels`: проверяет поддержку уровней debug, warning и error.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "TraceService" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ] -} - -## Steps -[ - { - "step": "router", - "status": "completed", - "timings_ms": { - "router": 1 - }, - "output": { - "intent": "CODE_QA", - "sub_intent": "FIND_TESTS", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - } - }, - { - "step": "retrieval", - "status": "completed", - "timings_ms": { - "retrieval": 119 - }, - "output": { - "rag_count": 24, - "answer_path_rag_count": 24, - "resolved_symbol_status": "resolved", - "resolved_symbol": "TraceService", - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ] - }, - "diagnostics": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "vector", - "C2_DEPENDENCY_GRAPH": "vector", - "C0_SOURCE_CHUNKS": "vector" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C0_SOURCE_CHUNKS": 10 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [] - } - }, - "fallback": { - "used": false, - "reason": null - }, - "retrieval_by_layer_ms": { - "C1_SYMBOL_CATALOG": 41, - "C2_DEPENDENCY_GRAPH": 42, - "C0_SOURCE_CHUNKS": 35 - } - } - }, - { - "step": "pre_evidence_gate", - "status": "passed", - "timings_ms": { - "pre_evidence_gate": 1 - }, - "input": { - "resolved_target": "TraceService", - "sub_intent": "FIND_TESTS", - "target_type": "symbol", - "evidence_count": 24, - "code_chunk_count": 24, - "entrypoint_count": 0, - "relation_count": 6, - "test_evidence_count": 3, - "symbol_resolution_status": "resolved", - "path_scope": [] - }, - "output": { - "passed": true, - "failure_reasons": [], - "degraded_message": "", - "evidence_count": 24 - } - }, - { - "step": "llm", - "status": "completed", - "timings_ms": { - "llm": 2200 - }, - "output": { - "prompt_name": "code_qa_find_tests_answer", - "answer_preview": "Прямые тесты для TraceService находятся в файле `tests/test_runtime.py`:\n\n- `test_trace_service_allows_messages_without_status`: проверяет возможность отправки сообщений без статуса.\n- `test_trace_service_writes_contexts_and_messages`: проверяет запись контекстов и сообщений.\n- `test_trace_service_s", - "resolved_target": "TraceService", - "answer_policy_branch": "normal_answer", - "decision_reason": "evidence_sufficient" - } - }, - { - "step": "post_evidence_gate", - "status": "passed", - "timings_ms": { - "post_evidence_gate": 1, - "post_evidence_gate_recheck": 0, - "repair": 0 - }, - "input": { - "answer_mode": "normal", - "degraded_message": "", - "resolved_target": "TraceService", - "draft_answer_preview": "Прямые тесты для TraceService находятся в файле `tests/test_runtime.py`:\n\n- `test_trace_service_allows_messages_without_status`: проверяет возможность отправки сообщений без статуса.\n- `test_trace_service_writes_contexts_and_messages`: проверяет запись контекстов и сообщений.\n- `test_trace_service_s", - "repair_candidate": true - }, - "output": { - "passed": true, - "action": "return", - "reasons": [], - "repair_used": false, - "final_answer_preview": "Прямые тесты для TraceService находятся в файле `tests/test_runtime.py`:\n\n- `test_trace_service_allows_messages_without_status`: проверяет возможность отправки сообщений без статуса.\n- `test_trace_service_writes_contexts_and_messages`: проверяет запись контекстов и сообщений.\n- `test_trace_service_s" - } - } -] - -## Diagnostics -{ - "intent_correct": null, - "target_found": true, - "layers_used": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ], - "retrieval_sufficient": true, - "answer_mode": "normal", - "resolved_target": "TraceService", - "answer_policy_branch": "normal_answer", - "decision_reason": "evidence_sufficient", - "router_result": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "retrieval_profile": "code", - "sub_intent": "FIND_TESTS", - "path_scope": [], - "layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ], - "symbol_resolution_status": "resolved" - }, - "retrieval_request": { - "rag_session_id": "7d11da21-faa0-4cea-aede-aeabe069164c", - "query": "Где тесты для TraceService?", - "sub_intent": "FIND_TESTS", - "path_scope": [], - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ] - }, - "per_layer_outcome": [ - { - "layer_id": "C1_SYMBOL_CATALOG", - "hit_count": 8, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C2_DEPENDENCY_GRAPH", - "hit_count": 6, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C0_SOURCE_CHUNKS", - "hit_count": 10, - "empty": false, - "fallback_used": false - } - ], - "empty_layers": [], - "evidence_gate_decision": { - "sufficient": true, - "failure_reasons": [], - "evidence_count": 24 - }, - "evidence_gate_input": { - "resolved_target": "TraceService", - "sub_intent": "FIND_TESTS", - "target_type": "symbol", - "evidence_count": 24, - "code_chunk_count": 24, - "entrypoint_count": 0, - "relation_count": 6, - "test_evidence_count": 3, - "symbol_resolution_status": "resolved", - "path_scope": [] - }, - "post_evidence_gate": { - "input": { - "answer_mode": "normal", - "degraded_message": "", - "resolved_target": "TraceService", - "draft_answer_preview": "Прямые тесты для TraceService находятся в файле `tests/test_runtime.py`:\n\n- `test_trace_service_allows_messages_without_status`: проверяет возможность отправки сообщений без статуса.\n- `test_trace_service_writes_contexts_and_messages`: проверяет запись контекстов и сообщений.\n- `test_trace_service_s", - "repair_candidate": true - }, - "output": { - "passed": true, - "action": "return", - "reasons": [], - "repair_used": false, - "final_answer_preview": "Прямые тесты для TraceService находятся в файле `tests/test_runtime.py`:\n\n- `test_trace_service_allows_messages_without_status`: проверяет возможность отправки сообщений без статуса.\n- `test_trace_service_writes_contexts_and_messages`: проверяет запись контекстов и сообщений.\n- `test_trace_service_s" - } - }, - "failure_reasons": [], - "timings_ms": { - "router": 1, - "retrieval": 119, - "pre_evidence_gate": 1, - "llm": 2200, - "post_evidence_gate": 1 - } -} - -## Mismatches -- none \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/plba_full_chain_subintents_v3/20260312_174008/full_chain_plba_code_subintents_v2_plba-v2-find-tests-workflow-runtime-factory-negative.json b/tests/pipeline_setup_v3/test_results/plba_full_chain_subintents_v3/20260312_174008/full_chain_plba_code_subintents_v2_plba-v2-find-tests-workflow-runtime-factory-negative.json deleted file mode 100644 index 7815d88..0000000 --- a/tests/pipeline_setup_v3/test_results/plba_full_chain_subintents_v3/20260312_174008/full_chain_plba_code_subintents_v2_plba-v2-find-tests-workflow-runtime-factory-negative.json +++ /dev/null @@ -1,3160 +0,0 @@ -{ - "case_id": "plba-v2-find-tests-workflow-runtime-factory-negative", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_02_pipeline/full_chain_plba_code_subintents_v2.yaml", - "runner": "agent_runtime", - "mode": "full_chain", - "query": "Где тесты для WorkflowRuntimeFactory?", - "actual": { - "intent": "CODE_QA", - "sub_intent": "FIND_TESTS", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 24, - "llm_answer": "Insufficient evidence for a confident answer. No test candidates found.", - "answer_mode": "degraded", - "path_scope": [], - "symbol_candidates": [ - "WorkflowRuntimeFactory" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ] - }, - "passed": true, - "mismatches": [], - "details": { - "query": "Где тесты для WorkflowRuntimeFactory?", - "router_result": { - "schema_version": "1.1", - "intent": "CODE_QA", - "retrieval_profile": "code", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query_plan": { - "raw": "Где тесты для WorkflowRuntimeFactory?", - "normalized": "Где тесты для WorkflowRuntimeFactory?", - "sub_intent": "FIND_TESTS", - "negations": [], - "expansions": [ - "test", - "unit test", - "WorkflowRuntimeFactory" - ], - "keyword_hints": [ - "WorkflowRuntimeFactory" - ], - "path_hints": [], - "doc_scope_hints": [], - "symbol_candidates": [ - "WorkflowRuntimeFactory" - ], - "symbol_kind_hint": "class", - "anchors": [ - { - "type": "SYMBOL", - "value": "WorkflowRuntimeFactory", - "source": "user_text", - "subtype": null, - "span": { - "start": 14, - "end": 36 - }, - "confidence": 0.88 - }, - { - "type": "KEY_TERM", - "value": "тест", - "source": "user_text", - "subtype": null, - "span": { - "start": 4, - "end": 9 - }, - "confidence": 0.9 - } - ] - }, - "retrieval_spec": { - "domains": [ - "CODE" - ], - "layer_queries": [ - { - "layer_id": "C1_SYMBOL_CATALOG", - "top_k": 8 - }, - { - "layer_id": "C2_DEPENDENCY_GRAPH", - "top_k": 6 - }, - { - "layer_id": "C0_SOURCE_CHUNKS", - "top_k": 10 - } - ], - "filters": { - "test_policy": "INCLUDE", - "path_scope": [], - "language": [ - "python" - ] - }, - "rerank_profile": "code" - }, - "retrieval_constraints": { - "include_globs": [ - "src/**", - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "test_file_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "test_symbol_patterns": [ - "test_workflow_runtime_factory", - "TestWorkflowRuntimeFactory", - "WorkflowRuntimeFactory" - ], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - }, - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "WorkflowRuntimeFactory", - "alternatives": [ - "WorkflowRuntimeFactory", - "WorkflowRuntimeFactory", - "WorkflowRuntimeFactory", - "WorkflowRuntimeFactory.__init__", - "WorkflowRuntimeFactory.create_engine" - ], - "confidence": 0.99 - }, - "evidence_policy": { - "require_def": true, - "require_flow": true, - "require_spec": false, - "allow_answer_without_evidence": false - } - }, - "retrieval_request": { - "rag_session_id": "7d11da21-faa0-4cea-aede-aeabe069164c", - "query": "Где тесты для WorkflowRuntimeFactory?", - "sub_intent": "FIND_TESTS", - "path_scope": [], - "keyword_hints": [ - "WorkflowRuntimeFactory" - ], - "symbol_candidates": [ - "WorkflowRuntimeFactory" - ], - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ], - "retrieval_spec": { - "domains": [ - "CODE" - ], - "layer_queries": [ - { - "layer_id": "C1_SYMBOL_CATALOG", - "top_k": 8 - }, - { - "layer_id": "C2_DEPENDENCY_GRAPH", - "top_k": 6 - }, - { - "layer_id": "C0_SOURCE_CHUNKS", - "top_k": 10 - } - ], - "filters": { - "test_policy": "INCLUDE", - "path_scope": [], - "language": [ - "python" - ] - }, - "rerank_profile": "code" - }, - "retrieval_constraints": { - "include_globs": [ - "src/**", - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "test_file_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "test_symbol_patterns": [ - "test_workflow_runtime_factory", - "TestWorkflowRuntimeFactory", - "WorkflowRuntimeFactory" - ], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - }, - "query_plan": { - "raw": "Где тесты для WorkflowRuntimeFactory?", - "normalized": "Где тесты для WorkflowRuntimeFactory?", - "sub_intent": "FIND_TESTS", - "negations": [], - "expansions": [ - "test", - "unit test", - "WorkflowRuntimeFactory" - ], - "keyword_hints": [ - "WorkflowRuntimeFactory" - ], - "path_hints": [], - "doc_scope_hints": [], - "symbol_candidates": [ - "WorkflowRuntimeFactory" - ], - "symbol_kind_hint": "class", - "anchors": [ - { - "type": "SYMBOL", - "value": "WorkflowRuntimeFactory", - "source": "user_text", - "subtype": null, - "span": { - "start": 14, - "end": 36 - }, - "confidence": 0.88 - }, - { - "type": "KEY_TERM", - "value": "тест", - "source": "user_text", - "subtype": null, - "span": { - "start": 4, - "end": 9 - }, - "confidence": 0.9 - } - ] - } - }, - "retrieval_result": { - "target_symbol_candidates": [ - "WorkflowRuntimeFactory", - "WorkflowRuntimeFactory.__init__", - "WorkflowRuntimeFactory.create_engine", - "WorkflowPersistence", - "annotations", - "WorkflowEngine" - ], - "resolved_symbol": "WorkflowRuntimeFactory", - "symbol_resolution_status": "resolved", - "file_candidates": [ - "src/plba/__init__.py", - "src/app_runtime/workflow/runtime_factory.py", - "src/plba/workflow.py", - "src/app_runtime/config/__init__.py", - "src/app_runtime/config/providers.py", - "src/app_runtime/contracts/__init__.py", - "src/app_runtime/config/file_loader.py", - "src/app_runtime/contracts/config.py", - "src/app_runtime/contracts/health.py", - "src/app_runtime/contracts/application.py" - ], - "code_chunks": [ - { - "layer": "C1_SYMBOL_CATALOG", - "path": "src/plba/__init__.py", - "title": "WorkflowRuntimeFactory", - "content": "const WorkflowRuntimeFactory\nWorkflowRuntimeFactory = plba.workflow.WorkflowRuntimeFactory", - "start_line": 21, - "end_line": 30, - "metadata": { - "symbol_id": "cb7c73db05c2622aac89114bed1cddd1d567de21cfac5c53037c62b1074b25c9", - "qname": "WorkflowRuntimeFactory", - "kind": "const", - "signature": "WorkflowRuntimeFactory = plba.workflow.WorkflowRuntimeFactory", - "parent_symbol_id": null, - "package_or_module": "src.plba.__init__", - "is_test": false, - "blob_sha": "24e755ec8c249d14fb0e675b5dbf2b71ab91afb9c849897eebfa9feb2499e19d", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C1_SYMBOL_CATALOG", - "path": "src/app_runtime/workflow/runtime_factory.py", - "title": "WorkflowRuntimeFactory", - "content": "class WorkflowRuntimeFactory\nWorkflowRuntimeFactory", - "start_line": 7, - "end_line": 19, - "metadata": { - "symbol_id": "9da827270329de64ebb426fadaaa5e35145e6666b92c6da186e08bf4b071f458", - "qname": "WorkflowRuntimeFactory", - "kind": "class", - "signature": "WorkflowRuntimeFactory", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.workflow.runtime_factory", - "is_test": false, - "blob_sha": "4d03c095f3082eb3ea8d558d65a785eb747fffd9c1383946e6c433bcedb7259a", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C1_SYMBOL_CATALOG", - "path": "src/plba/workflow.py", - "title": "WorkflowRuntimeFactory", - "content": "const WorkflowRuntimeFactory\nWorkflowRuntimeFactory = app_runtime.workflow.runtime_factory.WorkflowRuntimeFactory", - "start_line": 7, - "end_line": 7, - "metadata": { - "symbol_id": "80865947d1ca709971efe9d68a9ee1f348c1c43d351bf4e1b4a5884d72985b6b", - "qname": "WorkflowRuntimeFactory", - "kind": "const", - "signature": "WorkflowRuntimeFactory = app_runtime.workflow.runtime_factory.WorkflowRuntimeFactory", - "parent_symbol_id": null, - "package_or_module": "src.plba.workflow", - "is_test": false, - "blob_sha": "f227797606042273d1f1798f76846952892eeb9e4e9e6a38fb8a631d7231ff39", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C1_SYMBOL_CATALOG", - "path": "src/app_runtime/workflow/runtime_factory.py", - "title": "WorkflowRuntimeFactory.__init__", - "content": "method WorkflowRuntimeFactory.__init__\n__init__(self, connection_factory)", - "start_line": 8, - "end_line": 12, - "metadata": { - "symbol_id": "d82a367758b2f7bcce3d351e576f25768b0afe8b915d01ace1c7d6380f14f52f", - "qname": "WorkflowRuntimeFactory.__init__", - "kind": "method", - "signature": "__init__(self, connection_factory)", - "parent_symbol_id": "WorkflowRuntimeFactory", - "package_or_module": "src.app_runtime.workflow.runtime_factory", - "is_test": false, - "blob_sha": "4d03c095f3082eb3ea8d558d65a785eb747fffd9c1383946e6c433bcedb7259a", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C1_SYMBOL_CATALOG", - "path": "src/app_runtime/workflow/runtime_factory.py", - "title": "WorkflowRuntimeFactory.create_engine", - "content": "method WorkflowRuntimeFactory.create_engine\ncreate_engine(self, workflow)", - "start_line": 14, - "end_line": 19, - "metadata": { - "symbol_id": "86f3a0bf3332952bf469e564748f16f1f7814ab51d5a963e5eb33de5e171b333", - "qname": "WorkflowRuntimeFactory.create_engine", - "kind": "method", - "signature": "create_engine(self, workflow)", - "parent_symbol_id": "WorkflowRuntimeFactory", - "package_or_module": "src.app_runtime.workflow.runtime_factory", - "is_test": false, - "blob_sha": "4d03c095f3082eb3ea8d558d65a785eb747fffd9c1383946e6c433bcedb7259a", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C1_SYMBOL_CATALOG", - "path": "src/app_runtime/workflow/runtime_factory.py", - "title": "WorkflowPersistence", - "content": "const WorkflowPersistence\nWorkflowPersistence = app_runtime.workflow.persistence.WorkflowPersistence", - "start_line": 4, - "end_line": 4, - "metadata": { - "symbol_id": "35693d37698e35079400b6a021d46209966ce469d9f77763d1c82d82ef4600b2", - "qname": "WorkflowPersistence", - "kind": "const", - "signature": "WorkflowPersistence = app_runtime.workflow.persistence.WorkflowPersistence", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.workflow.runtime_factory", - "is_test": false, - "blob_sha": "4d03c095f3082eb3ea8d558d65a785eb747fffd9c1383946e6c433bcedb7259a", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C1_SYMBOL_CATALOG", - "path": "src/app_runtime/workflow/runtime_factory.py", - "title": "annotations", - "content": "const annotations\nannotations = __future__.annotations", - "start_line": 1, - "end_line": 1, - "metadata": { - "symbol_id": "e016ec68f9d15d52fe0505774229fafc705c1bf3dfda78845a3db9b032a4441d", - "qname": "annotations", - "kind": "const", - "signature": "annotations = __future__.annotations", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.workflow.runtime_factory", - "is_test": false, - "blob_sha": "4d03c095f3082eb3ea8d558d65a785eb747fffd9c1383946e6c433bcedb7259a", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C1_SYMBOL_CATALOG", - "path": "src/app_runtime/workflow/runtime_factory.py", - "title": "WorkflowEngine", - "content": "const WorkflowEngine\nWorkflowEngine = app_runtime.workflow.engine.workflow_engine.WorkflowEngine", - "start_line": 3, - "end_line": 3, - "metadata": { - "symbol_id": "da4aee8bc7d248177fbc4f892732c6eb08baa6d268c32921a217747143a99fe0", - "qname": "WorkflowEngine", - "kind": "const", - "signature": "WorkflowEngine = app_runtime.workflow.engine.workflow_engine.WorkflowEngine", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.workflow.runtime_factory", - "is_test": false, - "blob_sha": "4d03c095f3082eb3ea8d558d65a785eb747fffd9c1383946e6c433bcedb7259a", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "path": "src/app_runtime/workflow/runtime_factory.py", - "title": "WorkflowRuntimeFactory.__init__:dataflow_slice", - "content": "WorkflowRuntimeFactory.__init__\n -> WorkflowRuntimeFactory._hooks\n -> WorkflowRuntimeFactory.create_engine", - "start_line": 11, - "end_line": 19, - "metadata": { - "edge_id": "db6124c75b447e4a0a9ba267bd6d6cdf267b41a733b2843d724dd42ec6f4945d", - "edge_type": "dataflow_slice", - "src_symbol_id": "d82a367758b2f7bcce3d351e576f25768b0afe8b915d01ace1c7d6380f14f52f", - "src_qname": "WorkflowRuntimeFactory.__init__", - "dst_symbol_id": "86f3a0bf3332952bf469e564748f16f1f7814ab51d5a963e5eb33de5e171b333", - "dst_ref": "WorkflowRuntimeFactory.create_engine", - "resolution": "resolved", - "slice_id": "db6124c75b447e4a0a9ba267bd6d6cdf267b41a733b2843d724dd42ec6f4945d", - "root_symbol_id": "d82a367758b2f7bcce3d351e576f25768b0afe8b915d01ace1c7d6380f14f52f", - "path_symbols": [ - "WorkflowRuntimeFactory.__init__", - "WorkflowRuntimeFactory._hooks", - "WorkflowRuntimeFactory.create_engine" - ], - "path_symbol_ids": [ - "d82a367758b2f7bcce3d351e576f25768b0afe8b915d01ace1c7d6380f14f52f", - "86f3a0bf3332952bf469e564748f16f1f7814ab51d5a963e5eb33de5e171b333" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "4d03c095f3082eb3ea8d558d65a785eb747fffd9c1383946e6c433bcedb7259a", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "path": "src/app_runtime/workflow/runtime_factory.py", - "title": "WorkflowRuntimeFactory.__init__:dataflow_slice", - "content": "WorkflowRuntimeFactory.__init__\n -> WorkflowRuntimeFactory._snapshot_sanitizer\n -> WorkflowRuntimeFactory.create_engine", - "start_line": 12, - "end_line": 17, - "metadata": { - "edge_id": "f46f5a871a3800b517b0f94ed2551392629e1d7920bc3e3b5a21e0d8f012b741", - "edge_type": "dataflow_slice", - "src_symbol_id": "d82a367758b2f7bcce3d351e576f25768b0afe8b915d01ace1c7d6380f14f52f", - "src_qname": "WorkflowRuntimeFactory.__init__", - "dst_symbol_id": "86f3a0bf3332952bf469e564748f16f1f7814ab51d5a963e5eb33de5e171b333", - "dst_ref": "WorkflowRuntimeFactory.create_engine", - "resolution": "resolved", - "slice_id": "f46f5a871a3800b517b0f94ed2551392629e1d7920bc3e3b5a21e0d8f012b741", - "root_symbol_id": "d82a367758b2f7bcce3d351e576f25768b0afe8b915d01ace1c7d6380f14f52f", - "path_symbols": [ - "WorkflowRuntimeFactory.__init__", - "WorkflowRuntimeFactory._snapshot_sanitizer", - "WorkflowRuntimeFactory.create_engine" - ], - "path_symbol_ids": [ - "d82a367758b2f7bcce3d351e576f25768b0afe8b915d01ace1c7d6380f14f52f", - "86f3a0bf3332952bf469e564748f16f1f7814ab51d5a963e5eb33de5e171b333" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "4d03c095f3082eb3ea8d558d65a785eb747fffd9c1383946e6c433bcedb7259a", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "path": "src/app_runtime/workflow/runtime_factory.py", - "title": "WorkflowRuntimeFactory.__init__:dataflow_slice", - "content": "WorkflowRuntimeFactory.__init__\n -> WorkflowRuntimeFactory._connection_factory\n -> WorkflowRuntimeFactory.create_engine", - "start_line": 9, - "end_line": 16, - "metadata": { - "edge_id": "543624853400c556d1939007017145281d76b00a694c7d5c4fbb0414ded3434e", - "edge_type": "dataflow_slice", - "src_symbol_id": "d82a367758b2f7bcce3d351e576f25768b0afe8b915d01ace1c7d6380f14f52f", - "src_qname": "WorkflowRuntimeFactory.__init__", - "dst_symbol_id": "86f3a0bf3332952bf469e564748f16f1f7814ab51d5a963e5eb33de5e171b333", - "dst_ref": "WorkflowRuntimeFactory.create_engine", - "resolution": "resolved", - "slice_id": "543624853400c556d1939007017145281d76b00a694c7d5c4fbb0414ded3434e", - "root_symbol_id": "d82a367758b2f7bcce3d351e576f25768b0afe8b915d01ace1c7d6380f14f52f", - "path_symbols": [ - "WorkflowRuntimeFactory.__init__", - "WorkflowRuntimeFactory._connection_factory", - "WorkflowRuntimeFactory.create_engine" - ], - "path_symbol_ids": [ - "d82a367758b2f7bcce3d351e576f25768b0afe8b915d01ace1c7d6380f14f52f", - "86f3a0bf3332952bf469e564748f16f1f7814ab51d5a963e5eb33de5e171b333" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "4d03c095f3082eb3ea8d558d65a785eb747fffd9c1383946e6c433bcedb7259a", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "path": "src/app_runtime/workflow/runtime_factory.py", - "title": "WorkflowRuntimeFactory.__init__:dataflow_slice", - "content": "WorkflowRuntimeFactory.__init__\n -> WorkflowRuntimeFactory._traces\n -> WorkflowRuntimeFactory.create_engine", - "start_line": 10, - "end_line": 19, - "metadata": { - "edge_id": "346cf5ddb4308b8403d27c5b54da8cba298bb0af7dc04c2fe30312ef574103c6", - "edge_type": "dataflow_slice", - "src_symbol_id": "d82a367758b2f7bcce3d351e576f25768b0afe8b915d01ace1c7d6380f14f52f", - "src_qname": "WorkflowRuntimeFactory.__init__", - "dst_symbol_id": "86f3a0bf3332952bf469e564748f16f1f7814ab51d5a963e5eb33de5e171b333", - "dst_ref": "WorkflowRuntimeFactory.create_engine", - "resolution": "resolved", - "slice_id": "346cf5ddb4308b8403d27c5b54da8cba298bb0af7dc04c2fe30312ef574103c6", - "root_symbol_id": "d82a367758b2f7bcce3d351e576f25768b0afe8b915d01ace1c7d6380f14f52f", - "path_symbols": [ - "WorkflowRuntimeFactory.__init__", - "WorkflowRuntimeFactory._traces", - "WorkflowRuntimeFactory.create_engine" - ], - "path_symbol_ids": [ - "d82a367758b2f7bcce3d351e576f25768b0afe8b915d01ace1c7d6380f14f52f", - "86f3a0bf3332952bf469e564748f16f1f7814ab51d5a963e5eb33de5e171b333" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "4d03c095f3082eb3ea8d558d65a785eb747fffd9c1383946e6c433bcedb7259a", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "path": "src/app_runtime/workflow/runtime_factory.py", - "title": "WorkflowRuntimeFactory.__init__:writes_attr", - "content": "WorkflowRuntimeFactory.__init__ writes_attr WorkflowRuntimeFactory._snapshot_sanitizer", - "start_line": 12, - "end_line": 12, - "metadata": { - "edge_id": "de0cb1913ba41f673cfb601cab23cfb2e1044ed3dd8c061aff486075aeb8af20", - "edge_type": "writes_attr", - "src_symbol_id": "d82a367758b2f7bcce3d351e576f25768b0afe8b915d01ace1c7d6380f14f52f", - "src_qname": "WorkflowRuntimeFactory.__init__", - "dst_symbol_id": null, - "dst_ref": "WorkflowRuntimeFactory._snapshot_sanitizer", - "resolution": "partial", - "is_test": false, - "blob_sha": "4d03c095f3082eb3ea8d558d65a785eb747fffd9c1383946e6c433bcedb7259a", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "path": "src/app_runtime/workflow/runtime_factory.py", - "title": "WorkflowRuntimeFactory.create_engine:calls", - "content": "WorkflowRuntimeFactory.create_engine calls WorkflowPersistence.create_default", - "start_line": 15, - "end_line": 18, - "metadata": { - "edge_id": "fa86efb6871092fc88df68295c0d92dbe46253e1afa3246ca62b6da11d4d5569", - "edge_type": "calls", - "src_symbol_id": "86f3a0bf3332952bf469e564748f16f1f7814ab51d5a963e5eb33de5e171b333", - "src_qname": "WorkflowRuntimeFactory.create_engine", - "dst_symbol_id": null, - "dst_ref": "WorkflowPersistence.create_default", - "resolution": "partial", - "is_test": false, - "blob_sha": "4d03c095f3082eb3ea8d558d65a785eb747fffd9c1383946e6c433bcedb7259a", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C0_SOURCE_CHUNKS", - "path": "src/app_runtime/workflow/runtime_factory.py", - "title": "src/app_runtime/workflow/runtime_factory.py:WorkflowRuntimeFactory", - "content": "class WorkflowRuntimeFactory:\n def __init__(self, connection_factory=None, *, traces, hooks=None, snapshot_sanitizer=None) -> None:\n self._connection_factory = connection_factory\n self._traces = traces\n self._hooks = hooks\n self._snapshot_sanitizer = snapshot_sanitizer\n\n def create_engine(self, workflow) -> WorkflowEngine:\n persistence = WorkflowPersistence.create_default(\n self._connection_factory,\n snapshot_sanitizer=self._snapshot_sanitizer,\n )\n return WorkflowEngine(workflow, persistence, traces=self._traces, hooks=self._hooks)", - "start_line": 7, - "end_line": 19, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.workflow.runtime_factory", - "is_test": false, - "blob_sha": "4d03c095f3082eb3ea8d558d65a785eb747fffd9c1383946e6c433bcedb7259a", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C0_SOURCE_CHUNKS", - "path": "src/plba/__init__.py", - "title": "src/plba/__init__.py:1-69", - "content": "from plba.bootstrap import create_runtime\nfrom plba.config import ConfigFileLoader, FileConfigProvider\nfrom plba.control import ControlActionSet, ControlChannel, ControlPlaneService, HttpControlChannel\nfrom plba.contracts import (\n ApplicationModule,\n ConfigProvider,\n HealthContributor,\n TraceContext,\n TraceContextRecord,\n TraceLogMessage,\n TraceTransport,\n Worker,\n WorkerHealth,\n WorkerStatus,\n)\nfrom plba.core import ConfigurationManager, RuntimeManager, ServiceContainer\nfrom plba.health import HealthRegistry\nfrom plba.logging import LogManager\nfrom plba.queue import InMemoryTaskQueue\nfrom plba.tracing import MySqlTraceTransport, NoOpTraceTransport, TraceService\nfrom plba.workflow import (\n StepResult,\n WorkflowContext,\n WorkflowDefinition,\n WorkflowEngine,\n WorkflowEngineHooks,\n WorkflowNode,\n WorkflowRuntimeFactory,\n WorkflowStep,\n)\nfrom plba.workers import WorkerSupervisor\n\n__all__ = [\n \"ApplicationModule\",\n \"ConfigFileLoader\",\n \"ConfigProvider\",\n \"ConfigurationManager\",\n \"ControlActionSet\",\n \"ControlChannel\",\n \"ControlPlaneService\",\n \"create_runtime\",\n \"FileConfigProvider\",\n \"HealthContributor\",\n \"HealthRegistry\",\n \"HttpControlChannel\",\n \"InMemoryTaskQueue\",\n \"LogManager\",\n \"MySqlTraceTransport\",\n \"NoOpTraceTransport\",\n \"RuntimeManager\",\n \"ServiceContainer\",\n \"TraceContext\",\n \"TraceContextRecord\",\n \"TraceLogMessage\",\n \"TraceService\",\n \"TraceTransport\",\n \"StepResult\",\n \"Worker\",\n \"WorkerHealth\",\n \"WorkerStatus\",\n \"WorkflowContext\",\n \"WorkflowDefinition\",\n \"WorkflowEngine\",\n \"WorkflowEngineHooks\",\n \"WorkflowNode\",\n \"WorkflowRuntimeFactory\",\n \"WorkflowStep\",\n \"WorkerSupervisor\",\n]", - "start_line": 1, - "end_line": 69, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.plba.__init__", - "is_test": false, - "blob_sha": "24e755ec8c249d14fb0e675b5dbf2b71ab91afb9c849897eebfa9feb2499e19d", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C0_SOURCE_CHUNKS", - "path": "src/plba/workflow.py", - "title": "src/plba/workflow.py:1-18", - "content": "from app_runtime.workflow.contracts.context import WorkflowContext\nfrom app_runtime.workflow.contracts.result import StepResult\nfrom app_runtime.workflow.contracts.step import WorkflowStep\nfrom app_runtime.workflow.contracts.workflow import WorkflowDefinition, WorkflowNode\nfrom app_runtime.workflow.engine.hooks import WorkflowEngineHooks\nfrom app_runtime.workflow.engine.workflow_engine import WorkflowEngine\nfrom app_runtime.workflow.runtime_factory import WorkflowRuntimeFactory\n\n__all__ = [\n \"StepResult\",\n \"WorkflowContext\",\n \"WorkflowDefinition\",\n \"WorkflowEngine\",\n \"WorkflowEngineHooks\",\n \"WorkflowNode\",\n \"WorkflowRuntimeFactory\",\n \"WorkflowStep\",\n]", - "start_line": 1, - "end_line": 18, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.plba.workflow", - "is_test": false, - "blob_sha": "f227797606042273d1f1798f76846952892eeb9e4e9e6a38fb8a631d7231ff39", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C0_SOURCE_CHUNKS", - "path": "src/app_runtime/config/__init__.py", - "title": "src/app_runtime/config/__init__.py:1-4", - "content": "from app_runtime.config.file_loader import ConfigFileLoader\nfrom app_runtime.config.providers import FileConfigProvider\n\n__all__ = [\"ConfigFileLoader\", \"FileConfigProvider\"]", - "start_line": 1, - "end_line": 4, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.app_runtime.config.__init__", - "is_test": false, - "blob_sha": "612918029820a2a983330ec92256142b55b9de4bdf3399ece18e2a02dbad9729", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C0_SOURCE_CHUNKS", - "path": "src/app_runtime/config/providers.py", - "title": "src/app_runtime/config/providers.py:FileConfigProvider", - "content": "class FileConfigProvider(ConfigProvider):\n def __init__(self, path: str | Path) -> None:\n self._loader = ConfigFileLoader(path)\n\n @property\n def loader(self) -> ConfigFileLoader:\n return self._loader\n\n def load(self) -> dict[str, Any]:\n config = self._loader.load_sync()\n if not isinstance(config, dict):\n raise TypeError(\"Config root must be a mapping\")\n return dict(config)", - "start_line": 10, - "end_line": 22, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.config.providers", - "is_test": false, - "blob_sha": "8c53ca0122d6df6c5763bca15e99434bb4daebd5a618b8fc927e9ae90b022e64", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C0_SOURCE_CHUNKS", - "path": "src/app_runtime/contracts/__init__.py", - "title": "src/app_runtime/__init__.py:1-1", - "content": "__all__: list[str] = []", - "start_line": 1, - "end_line": 1, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.app_runtime.__init__", - "is_test": false, - "blob_sha": "8eea9df4f6d7b38ca0e39ccc27b04700e3d08dbeec8046d613d22706d19985fa", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C0_SOURCE_CHUNKS", - "path": "src/app_runtime/config/file_loader.py", - "title": "src/app_runtime/config/file_loader.py:ConfigFileLoader", - "content": "class ConfigFileLoader:\n def __init__(self, path: str | Path) -> None:\n self.path = Path(path)\n self.config: Any = None\n self.last_valid_config: Any = None\n self._last_seen_hash: str | None = None\n\n def read_text(self) -> str:\n return self.path.read_text(encoding=\"utf-8\")\n\n def parse(self, data: str) -> Any:\n suffix = self.path.suffix.lower()\n if suffix in {\".yml\", \".yaml\"}:\n return yaml.safe_load(data)\n return json.loads(data)\n\n def load_sync(self) -> Any:\n data = self.read_text()\n parsed = self.parse(data)\n self.config = parsed\n self.last_valid_config = parsed\n self._last_seen_hash = self._calculate_hash(data)\n return parsed\n\n def load_if_changed(self) -> tuple[bool, Any]:\n data = self.read_text()\n current_hash = self._calculate_hash(data)\n if current_hash == self._last_seen_hash:\n return False, self.config\n parsed = self.parse(data)\n self.config = parsed\n self.last_valid_config = parsed\n self._last_seen_hash = current_hash\n return True, parsed\n\n @staticmethod\n def _calculate_hash(data: str) -> str:\n return hashlib.sha256(data.encode(\"utf-8\")).hexdigest()", - "start_line": 11, - "end_line": 48, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.config.file_loader", - "is_test": false, - "blob_sha": "1f19ffebde5e38e4be5a5d5a678059a0f36dedb8fb8b3e00ab395c67106a87ea", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C0_SOURCE_CHUNKS", - "path": "src/app_runtime/contracts/config.py", - "title": "src/app_runtime/contracts/config.py:ConfigProvider", - "content": "class ConfigProvider(ABC):\n @abstractmethod\n def load(self) -> dict[str, Any]:\n \"\"\"Return a config fragment.\"\"\"", - "start_line": 7, - "end_line": 10, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.contracts.config", - "is_test": false, - "blob_sha": "5e773880267743ee94954ea2db120c2d88c54d4312893293d1b89df405283ed4", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C0_SOURCE_CHUNKS", - "path": "src/app_runtime/contracts/health.py", - "title": "src/app_runtime/contracts/health.py:HealthContributor", - "content": "class HealthContributor(ABC):\n @abstractmethod\n def health(self) -> WorkerHealth:\n \"\"\"Return contributor health state.\"\"\"", - "start_line": 7, - "end_line": 10, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.contracts.health", - "is_test": false, - "blob_sha": "6bd92611def7131e32d4dd34a8ed85e6cf3c67722ad27797032a632cb30dc097", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C0_SOURCE_CHUNKS", - "path": "src/app_runtime/contracts/application.py", - "title": "src/app_runtime/contracts/application.py:ApplicationModule", - "content": "class ApplicationModule(ABC):\n @property\n @abstractmethod\n def name(self) -> str:\n \"\"\"Module name used for runtime status and diagnostics.\"\"\"\n\n @abstractmethod\n def register(self, registry: ModuleRegistry) -> None:\n \"\"\"Register workers, services, and health contributors.\"\"\"", - "start_line": 8, - "end_line": 16, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.contracts.application", - "is_test": false, - "blob_sha": "197c35634dca49c352ce3f230295a485fbffb672ce7bb8c08e752bfdf61e7fa4", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "relations": [ - { - "path": "src/app_runtime/workflow/runtime_factory.py", - "metadata": { - "edge_id": "db6124c75b447e4a0a9ba267bd6d6cdf267b41a733b2843d724dd42ec6f4945d", - "edge_type": "dataflow_slice", - "src_symbol_id": "d82a367758b2f7bcce3d351e576f25768b0afe8b915d01ace1c7d6380f14f52f", - "src_qname": "WorkflowRuntimeFactory.__init__", - "dst_symbol_id": "86f3a0bf3332952bf469e564748f16f1f7814ab51d5a963e5eb33de5e171b333", - "dst_ref": "WorkflowRuntimeFactory.create_engine", - "resolution": "resolved", - "slice_id": "db6124c75b447e4a0a9ba267bd6d6cdf267b41a733b2843d724dd42ec6f4945d", - "root_symbol_id": "d82a367758b2f7bcce3d351e576f25768b0afe8b915d01ace1c7d6380f14f52f", - "path_symbols": [ - "WorkflowRuntimeFactory.__init__", - "WorkflowRuntimeFactory._hooks", - "WorkflowRuntimeFactory.create_engine" - ], - "path_symbol_ids": [ - "d82a367758b2f7bcce3d351e576f25768b0afe8b915d01ace1c7d6380f14f52f", - "86f3a0bf3332952bf469e564748f16f1f7814ab51d5a963e5eb33de5e171b333" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "4d03c095f3082eb3ea8d558d65a785eb747fffd9c1383946e6c433bcedb7259a", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - }, - "content": "WorkflowRuntimeFactory.__init__\n -> WorkflowRuntimeFactory._hooks\n -> WorkflowRuntimeFactory.create_engine" - }, - { - "path": "src/app_runtime/workflow/runtime_factory.py", - "metadata": { - "edge_id": "f46f5a871a3800b517b0f94ed2551392629e1d7920bc3e3b5a21e0d8f012b741", - "edge_type": "dataflow_slice", - "src_symbol_id": "d82a367758b2f7bcce3d351e576f25768b0afe8b915d01ace1c7d6380f14f52f", - "src_qname": "WorkflowRuntimeFactory.__init__", - "dst_symbol_id": "86f3a0bf3332952bf469e564748f16f1f7814ab51d5a963e5eb33de5e171b333", - "dst_ref": "WorkflowRuntimeFactory.create_engine", - "resolution": "resolved", - "slice_id": "f46f5a871a3800b517b0f94ed2551392629e1d7920bc3e3b5a21e0d8f012b741", - "root_symbol_id": "d82a367758b2f7bcce3d351e576f25768b0afe8b915d01ace1c7d6380f14f52f", - "path_symbols": [ - "WorkflowRuntimeFactory.__init__", - "WorkflowRuntimeFactory._snapshot_sanitizer", - "WorkflowRuntimeFactory.create_engine" - ], - "path_symbol_ids": [ - "d82a367758b2f7bcce3d351e576f25768b0afe8b915d01ace1c7d6380f14f52f", - "86f3a0bf3332952bf469e564748f16f1f7814ab51d5a963e5eb33de5e171b333" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "4d03c095f3082eb3ea8d558d65a785eb747fffd9c1383946e6c433bcedb7259a", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - }, - "content": "WorkflowRuntimeFactory.__init__\n -> WorkflowRuntimeFactory._snapshot_sanitizer\n -> WorkflowRuntimeFactory.create_engine" - }, - { - "path": "src/app_runtime/workflow/runtime_factory.py", - "metadata": { - "edge_id": "543624853400c556d1939007017145281d76b00a694c7d5c4fbb0414ded3434e", - "edge_type": "dataflow_slice", - "src_symbol_id": "d82a367758b2f7bcce3d351e576f25768b0afe8b915d01ace1c7d6380f14f52f", - "src_qname": "WorkflowRuntimeFactory.__init__", - "dst_symbol_id": "86f3a0bf3332952bf469e564748f16f1f7814ab51d5a963e5eb33de5e171b333", - "dst_ref": "WorkflowRuntimeFactory.create_engine", - "resolution": "resolved", - "slice_id": "543624853400c556d1939007017145281d76b00a694c7d5c4fbb0414ded3434e", - "root_symbol_id": "d82a367758b2f7bcce3d351e576f25768b0afe8b915d01ace1c7d6380f14f52f", - "path_symbols": [ - "WorkflowRuntimeFactory.__init__", - "WorkflowRuntimeFactory._connection_factory", - "WorkflowRuntimeFactory.create_engine" - ], - "path_symbol_ids": [ - "d82a367758b2f7bcce3d351e576f25768b0afe8b915d01ace1c7d6380f14f52f", - "86f3a0bf3332952bf469e564748f16f1f7814ab51d5a963e5eb33de5e171b333" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "4d03c095f3082eb3ea8d558d65a785eb747fffd9c1383946e6c433bcedb7259a", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - }, - "content": "WorkflowRuntimeFactory.__init__\n -> WorkflowRuntimeFactory._connection_factory\n -> WorkflowRuntimeFactory.create_engine" - }, - { - "path": "src/app_runtime/workflow/runtime_factory.py", - "metadata": { - "edge_id": "346cf5ddb4308b8403d27c5b54da8cba298bb0af7dc04c2fe30312ef574103c6", - "edge_type": "dataflow_slice", - "src_symbol_id": "d82a367758b2f7bcce3d351e576f25768b0afe8b915d01ace1c7d6380f14f52f", - "src_qname": "WorkflowRuntimeFactory.__init__", - "dst_symbol_id": "86f3a0bf3332952bf469e564748f16f1f7814ab51d5a963e5eb33de5e171b333", - "dst_ref": "WorkflowRuntimeFactory.create_engine", - "resolution": "resolved", - "slice_id": "346cf5ddb4308b8403d27c5b54da8cba298bb0af7dc04c2fe30312ef574103c6", - "root_symbol_id": "d82a367758b2f7bcce3d351e576f25768b0afe8b915d01ace1c7d6380f14f52f", - "path_symbols": [ - "WorkflowRuntimeFactory.__init__", - "WorkflowRuntimeFactory._traces", - "WorkflowRuntimeFactory.create_engine" - ], - "path_symbol_ids": [ - "d82a367758b2f7bcce3d351e576f25768b0afe8b915d01ace1c7d6380f14f52f", - "86f3a0bf3332952bf469e564748f16f1f7814ab51d5a963e5eb33de5e171b333" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "4d03c095f3082eb3ea8d558d65a785eb747fffd9c1383946e6c433bcedb7259a", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - }, - "content": "WorkflowRuntimeFactory.__init__\n -> WorkflowRuntimeFactory._traces\n -> WorkflowRuntimeFactory.create_engine" - }, - { - "path": "src/app_runtime/workflow/runtime_factory.py", - "metadata": { - "edge_id": "de0cb1913ba41f673cfb601cab23cfb2e1044ed3dd8c061aff486075aeb8af20", - "edge_type": "writes_attr", - "src_symbol_id": "d82a367758b2f7bcce3d351e576f25768b0afe8b915d01ace1c7d6380f14f52f", - "src_qname": "WorkflowRuntimeFactory.__init__", - "dst_symbol_id": null, - "dst_ref": "WorkflowRuntimeFactory._snapshot_sanitizer", - "resolution": "partial", - "is_test": false, - "blob_sha": "4d03c095f3082eb3ea8d558d65a785eb747fffd9c1383946e6c433bcedb7259a", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - }, - "content": "WorkflowRuntimeFactory.__init__ writes_attr WorkflowRuntimeFactory._snapshot_sanitizer" - }, - { - "path": "src/app_runtime/workflow/runtime_factory.py", - "metadata": { - "edge_id": "fa86efb6871092fc88df68295c0d92dbe46253e1afa3246ca62b6da11d4d5569", - "edge_type": "calls", - "src_symbol_id": "86f3a0bf3332952bf469e564748f16f1f7814ab51d5a963e5eb33de5e171b333", - "src_qname": "WorkflowRuntimeFactory.create_engine", - "dst_symbol_id": null, - "dst_ref": "WorkflowPersistence.create_default", - "resolution": "partial", - "is_test": false, - "blob_sha": "4d03c095f3082eb3ea8d558d65a785eb747fffd9c1383946e6c433bcedb7259a", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - }, - "content": "WorkflowRuntimeFactory.create_engine calls WorkflowPersistence.create_default" - } - ], - "entrypoints": [], - "test_candidates": [], - "layer_outcomes": [ - { - "layer_id": "C1_SYMBOL_CATALOG", - "hit_count": 8, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C2_DEPENDENCY_GRAPH", - "hit_count": 6, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C0_SOURCE_CHUNKS", - "hit_count": 10, - "empty": false, - "fallback_used": false - } - ], - "missing_layers": [], - "raw_rows": [ - { - "path": "src/plba/__init__.py", - "content": "const WorkflowRuntimeFactory\nWorkflowRuntimeFactory = plba.workflow.WorkflowRuntimeFactory", - "layer": "C1_SYMBOL_CATALOG", - "title": "WorkflowRuntimeFactory", - "span_start": 21, - "span_end": 30, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": null, - "metadata": { - "symbol_id": "cb7c73db05c2622aac89114bed1cddd1d567de21cfac5c53037c62b1074b25c9", - "qname": "WorkflowRuntimeFactory", - "kind": "const", - "signature": "WorkflowRuntimeFactory = plba.workflow.WorkflowRuntimeFactory", - "parent_symbol_id": null, - "package_or_module": "src.plba.__init__", - "is_test": false, - "blob_sha": "24e755ec8c249d14fb0e675b5dbf2b71ab91afb9c849897eebfa9feb2499e19d", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/runtime_factory.py", - "content": "class WorkflowRuntimeFactory\nWorkflowRuntimeFactory", - "layer": "C1_SYMBOL_CATALOG", - "title": "WorkflowRuntimeFactory", - "span_start": 7, - "span_end": 19, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": null, - "metadata": { - "symbol_id": "9da827270329de64ebb426fadaaa5e35145e6666b92c6da186e08bf4b071f458", - "qname": "WorkflowRuntimeFactory", - "kind": "class", - "signature": "WorkflowRuntimeFactory", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.workflow.runtime_factory", - "is_test": false, - "blob_sha": "4d03c095f3082eb3ea8d558d65a785eb747fffd9c1383946e6c433bcedb7259a", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/workflow.py", - "content": "const WorkflowRuntimeFactory\nWorkflowRuntimeFactory = app_runtime.workflow.runtime_factory.WorkflowRuntimeFactory", - "layer": "C1_SYMBOL_CATALOG", - "title": "WorkflowRuntimeFactory", - "span_start": 7, - "span_end": 7, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": null, - "metadata": { - "symbol_id": "80865947d1ca709971efe9d68a9ee1f348c1c43d351bf4e1b4a5884d72985b6b", - "qname": "WorkflowRuntimeFactory", - "kind": "const", - "signature": "WorkflowRuntimeFactory = app_runtime.workflow.runtime_factory.WorkflowRuntimeFactory", - "parent_symbol_id": null, - "package_or_module": "src.plba.workflow", - "is_test": false, - "blob_sha": "f227797606042273d1f1798f76846952892eeb9e4e9e6a38fb8a631d7231ff39", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/runtime_factory.py", - "content": "method WorkflowRuntimeFactory.__init__\n__init__(self, connection_factory)", - "layer": "C1_SYMBOL_CATALOG", - "title": "WorkflowRuntimeFactory.__init__", - "span_start": 8, - "span_end": 12, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": null, - "metadata": { - "symbol_id": "d82a367758b2f7bcce3d351e576f25768b0afe8b915d01ace1c7d6380f14f52f", - "qname": "WorkflowRuntimeFactory.__init__", - "kind": "method", - "signature": "__init__(self, connection_factory)", - "parent_symbol_id": "WorkflowRuntimeFactory", - "package_or_module": "src.app_runtime.workflow.runtime_factory", - "is_test": false, - "blob_sha": "4d03c095f3082eb3ea8d558d65a785eb747fffd9c1383946e6c433bcedb7259a", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/runtime_factory.py", - "content": "method WorkflowRuntimeFactory.create_engine\ncreate_engine(self, workflow)", - "layer": "C1_SYMBOL_CATALOG", - "title": "WorkflowRuntimeFactory.create_engine", - "span_start": 14, - "span_end": 19, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": null, - "metadata": { - "symbol_id": "86f3a0bf3332952bf469e564748f16f1f7814ab51d5a963e5eb33de5e171b333", - "qname": "WorkflowRuntimeFactory.create_engine", - "kind": "method", - "signature": "create_engine(self, workflow)", - "parent_symbol_id": "WorkflowRuntimeFactory", - "package_or_module": "src.app_runtime.workflow.runtime_factory", - "is_test": false, - "blob_sha": "4d03c095f3082eb3ea8d558d65a785eb747fffd9c1383946e6c433bcedb7259a", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/runtime_factory.py", - "content": "const WorkflowPersistence\nWorkflowPersistence = app_runtime.workflow.persistence.WorkflowPersistence", - "layer": "C1_SYMBOL_CATALOG", - "title": "WorkflowPersistence", - "span_start": 4, - "span_end": 4, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": null, - "metadata": { - "symbol_id": "35693d37698e35079400b6a021d46209966ce469d9f77763d1c82d82ef4600b2", - "qname": "WorkflowPersistence", - "kind": "const", - "signature": "WorkflowPersistence = app_runtime.workflow.persistence.WorkflowPersistence", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.workflow.runtime_factory", - "is_test": false, - "blob_sha": "4d03c095f3082eb3ea8d558d65a785eb747fffd9c1383946e6c433bcedb7259a", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/runtime_factory.py", - "content": "const annotations\nannotations = __future__.annotations", - "layer": "C1_SYMBOL_CATALOG", - "title": "annotations", - "span_start": 1, - "span_end": 1, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": null, - "metadata": { - "symbol_id": "e016ec68f9d15d52fe0505774229fafc705c1bf3dfda78845a3db9b032a4441d", - "qname": "annotations", - "kind": "const", - "signature": "annotations = __future__.annotations", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.workflow.runtime_factory", - "is_test": false, - "blob_sha": "4d03c095f3082eb3ea8d558d65a785eb747fffd9c1383946e6c433bcedb7259a", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/runtime_factory.py", - "content": "const WorkflowEngine\nWorkflowEngine = app_runtime.workflow.engine.workflow_engine.WorkflowEngine", - "layer": "C1_SYMBOL_CATALOG", - "title": "WorkflowEngine", - "span_start": 3, - "span_end": 3, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": null, - "metadata": { - "symbol_id": "da4aee8bc7d248177fbc4f892732c6eb08baa6d268c32921a217747143a99fe0", - "qname": "WorkflowEngine", - "kind": "const", - "signature": "WorkflowEngine = app_runtime.workflow.engine.workflow_engine.WorkflowEngine", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.workflow.runtime_factory", - "is_test": false, - "blob_sha": "4d03c095f3082eb3ea8d558d65a785eb747fffd9c1383946e6c433bcedb7259a", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/runtime_factory.py", - "content": "WorkflowRuntimeFactory.__init__\n -> WorkflowRuntimeFactory._hooks\n -> WorkflowRuntimeFactory.create_engine", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "WorkflowRuntimeFactory.__init__:dataflow_slice", - "span_start": 11, - "span_end": 19, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": null, - "metadata": { - "edge_id": "db6124c75b447e4a0a9ba267bd6d6cdf267b41a733b2843d724dd42ec6f4945d", - "edge_type": "dataflow_slice", - "src_symbol_id": "d82a367758b2f7bcce3d351e576f25768b0afe8b915d01ace1c7d6380f14f52f", - "src_qname": "WorkflowRuntimeFactory.__init__", - "dst_symbol_id": "86f3a0bf3332952bf469e564748f16f1f7814ab51d5a963e5eb33de5e171b333", - "dst_ref": "WorkflowRuntimeFactory.create_engine", - "resolution": "resolved", - "slice_id": "db6124c75b447e4a0a9ba267bd6d6cdf267b41a733b2843d724dd42ec6f4945d", - "root_symbol_id": "d82a367758b2f7bcce3d351e576f25768b0afe8b915d01ace1c7d6380f14f52f", - "path_symbols": [ - "WorkflowRuntimeFactory.__init__", - "WorkflowRuntimeFactory._hooks", - "WorkflowRuntimeFactory.create_engine" - ], - "path_symbol_ids": [ - "d82a367758b2f7bcce3d351e576f25768b0afe8b915d01ace1c7d6380f14f52f", - "86f3a0bf3332952bf469e564748f16f1f7814ab51d5a963e5eb33de5e171b333" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "4d03c095f3082eb3ea8d558d65a785eb747fffd9c1383946e6c433bcedb7259a", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/runtime_factory.py", - "content": "WorkflowRuntimeFactory.__init__\n -> WorkflowRuntimeFactory._snapshot_sanitizer\n -> WorkflowRuntimeFactory.create_engine", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "WorkflowRuntimeFactory.__init__:dataflow_slice", - "span_start": 12, - "span_end": 17, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": null, - "metadata": { - "edge_id": "f46f5a871a3800b517b0f94ed2551392629e1d7920bc3e3b5a21e0d8f012b741", - "edge_type": "dataflow_slice", - "src_symbol_id": "d82a367758b2f7bcce3d351e576f25768b0afe8b915d01ace1c7d6380f14f52f", - "src_qname": "WorkflowRuntimeFactory.__init__", - "dst_symbol_id": "86f3a0bf3332952bf469e564748f16f1f7814ab51d5a963e5eb33de5e171b333", - "dst_ref": "WorkflowRuntimeFactory.create_engine", - "resolution": "resolved", - "slice_id": "f46f5a871a3800b517b0f94ed2551392629e1d7920bc3e3b5a21e0d8f012b741", - "root_symbol_id": "d82a367758b2f7bcce3d351e576f25768b0afe8b915d01ace1c7d6380f14f52f", - "path_symbols": [ - "WorkflowRuntimeFactory.__init__", - "WorkflowRuntimeFactory._snapshot_sanitizer", - "WorkflowRuntimeFactory.create_engine" - ], - "path_symbol_ids": [ - "d82a367758b2f7bcce3d351e576f25768b0afe8b915d01ace1c7d6380f14f52f", - "86f3a0bf3332952bf469e564748f16f1f7814ab51d5a963e5eb33de5e171b333" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "4d03c095f3082eb3ea8d558d65a785eb747fffd9c1383946e6c433bcedb7259a", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/runtime_factory.py", - "content": "WorkflowRuntimeFactory.__init__\n -> WorkflowRuntimeFactory._connection_factory\n -> WorkflowRuntimeFactory.create_engine", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "WorkflowRuntimeFactory.__init__:dataflow_slice", - "span_start": 9, - "span_end": 16, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": null, - "metadata": { - "edge_id": "543624853400c556d1939007017145281d76b00a694c7d5c4fbb0414ded3434e", - "edge_type": "dataflow_slice", - "src_symbol_id": "d82a367758b2f7bcce3d351e576f25768b0afe8b915d01ace1c7d6380f14f52f", - "src_qname": "WorkflowRuntimeFactory.__init__", - "dst_symbol_id": "86f3a0bf3332952bf469e564748f16f1f7814ab51d5a963e5eb33de5e171b333", - "dst_ref": "WorkflowRuntimeFactory.create_engine", - "resolution": "resolved", - "slice_id": "543624853400c556d1939007017145281d76b00a694c7d5c4fbb0414ded3434e", - "root_symbol_id": "d82a367758b2f7bcce3d351e576f25768b0afe8b915d01ace1c7d6380f14f52f", - "path_symbols": [ - "WorkflowRuntimeFactory.__init__", - "WorkflowRuntimeFactory._connection_factory", - "WorkflowRuntimeFactory.create_engine" - ], - "path_symbol_ids": [ - "d82a367758b2f7bcce3d351e576f25768b0afe8b915d01ace1c7d6380f14f52f", - "86f3a0bf3332952bf469e564748f16f1f7814ab51d5a963e5eb33de5e171b333" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "4d03c095f3082eb3ea8d558d65a785eb747fffd9c1383946e6c433bcedb7259a", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/runtime_factory.py", - "content": "WorkflowRuntimeFactory.__init__\n -> WorkflowRuntimeFactory._traces\n -> WorkflowRuntimeFactory.create_engine", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "WorkflowRuntimeFactory.__init__:dataflow_slice", - "span_start": 10, - "span_end": 19, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": null, - "metadata": { - "edge_id": "346cf5ddb4308b8403d27c5b54da8cba298bb0af7dc04c2fe30312ef574103c6", - "edge_type": "dataflow_slice", - "src_symbol_id": "d82a367758b2f7bcce3d351e576f25768b0afe8b915d01ace1c7d6380f14f52f", - "src_qname": "WorkflowRuntimeFactory.__init__", - "dst_symbol_id": "86f3a0bf3332952bf469e564748f16f1f7814ab51d5a963e5eb33de5e171b333", - "dst_ref": "WorkflowRuntimeFactory.create_engine", - "resolution": "resolved", - "slice_id": "346cf5ddb4308b8403d27c5b54da8cba298bb0af7dc04c2fe30312ef574103c6", - "root_symbol_id": "d82a367758b2f7bcce3d351e576f25768b0afe8b915d01ace1c7d6380f14f52f", - "path_symbols": [ - "WorkflowRuntimeFactory.__init__", - "WorkflowRuntimeFactory._traces", - "WorkflowRuntimeFactory.create_engine" - ], - "path_symbol_ids": [ - "d82a367758b2f7bcce3d351e576f25768b0afe8b915d01ace1c7d6380f14f52f", - "86f3a0bf3332952bf469e564748f16f1f7814ab51d5a963e5eb33de5e171b333" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "4d03c095f3082eb3ea8d558d65a785eb747fffd9c1383946e6c433bcedb7259a", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/runtime_factory.py", - "content": "WorkflowRuntimeFactory.__init__ writes_attr WorkflowRuntimeFactory._snapshot_sanitizer", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "WorkflowRuntimeFactory.__init__:writes_attr", - "span_start": 12, - "span_end": 12, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": null, - "metadata": { - "edge_id": "de0cb1913ba41f673cfb601cab23cfb2e1044ed3dd8c061aff486075aeb8af20", - "edge_type": "writes_attr", - "src_symbol_id": "d82a367758b2f7bcce3d351e576f25768b0afe8b915d01ace1c7d6380f14f52f", - "src_qname": "WorkflowRuntimeFactory.__init__", - "dst_symbol_id": null, - "dst_ref": "WorkflowRuntimeFactory._snapshot_sanitizer", - "resolution": "partial", - "is_test": false, - "blob_sha": "4d03c095f3082eb3ea8d558d65a785eb747fffd9c1383946e6c433bcedb7259a", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/runtime_factory.py", - "content": "WorkflowRuntimeFactory.create_engine calls WorkflowPersistence.create_default", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "WorkflowRuntimeFactory.create_engine:calls", - "span_start": 15, - "span_end": 18, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": null, - "metadata": { - "edge_id": "fa86efb6871092fc88df68295c0d92dbe46253e1afa3246ca62b6da11d4d5569", - "edge_type": "calls", - "src_symbol_id": "86f3a0bf3332952bf469e564748f16f1f7814ab51d5a963e5eb33de5e171b333", - "src_qname": "WorkflowRuntimeFactory.create_engine", - "dst_symbol_id": null, - "dst_ref": "WorkflowPersistence.create_default", - "resolution": "partial", - "is_test": false, - "blob_sha": "4d03c095f3082eb3ea8d558d65a785eb747fffd9c1383946e6c433bcedb7259a", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/runtime_factory.py", - "content": "class WorkflowRuntimeFactory:\n def __init__(self, connection_factory=None, *, traces, hooks=None, snapshot_sanitizer=None) -> None:\n self._connection_factory = connection_factory\n self._traces = traces\n self._hooks = hooks\n self._snapshot_sanitizer = snapshot_sanitizer\n\n def create_engine(self, workflow) -> WorkflowEngine:\n persistence = WorkflowPersistence.create_default(\n self._connection_factory,\n snapshot_sanitizer=self._snapshot_sanitizer,\n )\n return WorkflowEngine(workflow, persistence, traces=self._traces, hooks=self._hooks)", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/workflow/runtime_factory.py:WorkflowRuntimeFactory", - "span_start": 7, - "span_end": 19, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": null, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.workflow.runtime_factory", - "is_test": false, - "blob_sha": "4d03c095f3082eb3ea8d558d65a785eb747fffd9c1383946e6c433bcedb7259a", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/__init__.py", - "content": "from plba.bootstrap import create_runtime\nfrom plba.config import ConfigFileLoader, FileConfigProvider\nfrom plba.control import ControlActionSet, ControlChannel, ControlPlaneService, HttpControlChannel\nfrom plba.contracts import (\n ApplicationModule,\n ConfigProvider,\n HealthContributor,\n TraceContext,\n TraceContextRecord,\n TraceLogMessage,\n TraceTransport,\n Worker,\n WorkerHealth,\n WorkerStatus,\n)\nfrom plba.core import ConfigurationManager, RuntimeManager, ServiceContainer\nfrom plba.health import HealthRegistry\nfrom plba.logging import LogManager\nfrom plba.queue import InMemoryTaskQueue\nfrom plba.tracing import MySqlTraceTransport, NoOpTraceTransport, TraceService\nfrom plba.workflow import (\n StepResult,\n WorkflowContext,\n WorkflowDefinition,\n WorkflowEngine,\n WorkflowEngineHooks,\n WorkflowNode,\n WorkflowRuntimeFactory,\n WorkflowStep,\n)\nfrom plba.workers import WorkerSupervisor\n\n__all__ = [\n \"ApplicationModule\",\n \"ConfigFileLoader\",\n \"ConfigProvider\",\n \"ConfigurationManager\",\n \"ControlActionSet\",\n \"ControlChannel\",\n \"ControlPlaneService\",\n \"create_runtime\",\n \"FileConfigProvider\",\n \"HealthContributor\",\n \"HealthRegistry\",\n \"HttpControlChannel\",\n \"InMemoryTaskQueue\",\n \"LogManager\",\n \"MySqlTraceTransport\",\n \"NoOpTraceTransport\",\n \"RuntimeManager\",\n \"ServiceContainer\",\n \"TraceContext\",\n \"TraceContextRecord\",\n \"TraceLogMessage\",\n \"TraceService\",\n \"TraceTransport\",\n \"StepResult\",\n \"Worker\",\n \"WorkerHealth\",\n \"WorkerStatus\",\n \"WorkflowContext\",\n \"WorkflowDefinition\",\n \"WorkflowEngine\",\n \"WorkflowEngineHooks\",\n \"WorkflowNode\",\n \"WorkflowRuntimeFactory\",\n \"WorkflowStep\",\n \"WorkerSupervisor\",\n]", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/plba/__init__.py:1-69", - "span_start": 1, - "span_end": 69, - "lexical_rank": 6, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": null, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.plba.__init__", - "is_test": false, - "blob_sha": "24e755ec8c249d14fb0e675b5dbf2b71ab91afb9c849897eebfa9feb2499e19d", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/workflow.py", - "content": "from app_runtime.workflow.contracts.context import WorkflowContext\nfrom app_runtime.workflow.contracts.result import StepResult\nfrom app_runtime.workflow.contracts.step import WorkflowStep\nfrom app_runtime.workflow.contracts.workflow import WorkflowDefinition, WorkflowNode\nfrom app_runtime.workflow.engine.hooks import WorkflowEngineHooks\nfrom app_runtime.workflow.engine.workflow_engine import WorkflowEngine\nfrom app_runtime.workflow.runtime_factory import WorkflowRuntimeFactory\n\n__all__ = [\n \"StepResult\",\n \"WorkflowContext\",\n \"WorkflowDefinition\",\n \"WorkflowEngine\",\n \"WorkflowEngineHooks\",\n \"WorkflowNode\",\n \"WorkflowRuntimeFactory\",\n \"WorkflowStep\",\n]", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/plba/workflow.py:1-18", - "span_start": 1, - "span_end": 18, - "lexical_rank": 6, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": null, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.plba.workflow", - "is_test": false, - "blob_sha": "f227797606042273d1f1798f76846952892eeb9e4e9e6a38fb8a631d7231ff39", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/config/__init__.py", - "content": "from app_runtime.config.file_loader import ConfigFileLoader\nfrom app_runtime.config.providers import FileConfigProvider\n\n__all__ = [\"ConfigFileLoader\", \"FileConfigProvider\"]", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/config/__init__.py:1-4", - "span_start": 1, - "span_end": 4, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": null, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.app_runtime.config.__init__", - "is_test": false, - "blob_sha": "612918029820a2a983330ec92256142b55b9de4bdf3399ece18e2a02dbad9729", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/config/providers.py", - "content": "class FileConfigProvider(ConfigProvider):\n def __init__(self, path: str | Path) -> None:\n self._loader = ConfigFileLoader(path)\n\n @property\n def loader(self) -> ConfigFileLoader:\n return self._loader\n\n def load(self) -> dict[str, Any]:\n config = self._loader.load_sync()\n if not isinstance(config, dict):\n raise TypeError(\"Config root must be a mapping\")\n return dict(config)", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/config/providers.py:FileConfigProvider", - "span_start": 10, - "span_end": 22, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": null, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.config.providers", - "is_test": false, - "blob_sha": "8c53ca0122d6df6c5763bca15e99434bb4daebd5a618b8fc927e9ae90b022e64", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/contracts/__init__.py", - "content": "__all__: list[str] = []", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/__init__.py:1-1", - "span_start": 1, - "span_end": 1, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": null, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.app_runtime.__init__", - "is_test": false, - "blob_sha": "8eea9df4f6d7b38ca0e39ccc27b04700e3d08dbeec8046d613d22706d19985fa", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/config/file_loader.py", - "content": "class ConfigFileLoader:\n def __init__(self, path: str | Path) -> None:\n self.path = Path(path)\n self.config: Any = None\n self.last_valid_config: Any = None\n self._last_seen_hash: str | None = None\n\n def read_text(self) -> str:\n return self.path.read_text(encoding=\"utf-8\")\n\n def parse(self, data: str) -> Any:\n suffix = self.path.suffix.lower()\n if suffix in {\".yml\", \".yaml\"}:\n return yaml.safe_load(data)\n return json.loads(data)\n\n def load_sync(self) -> Any:\n data = self.read_text()\n parsed = self.parse(data)\n self.config = parsed\n self.last_valid_config = parsed\n self._last_seen_hash = self._calculate_hash(data)\n return parsed\n\n def load_if_changed(self) -> tuple[bool, Any]:\n data = self.read_text()\n current_hash = self._calculate_hash(data)\n if current_hash == self._last_seen_hash:\n return False, self.config\n parsed = self.parse(data)\n self.config = parsed\n self.last_valid_config = parsed\n self._last_seen_hash = current_hash\n return True, parsed\n\n @staticmethod\n def _calculate_hash(data: str) -> str:\n return hashlib.sha256(data.encode(\"utf-8\")).hexdigest()", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/config/file_loader.py:ConfigFileLoader", - "span_start": 11, - "span_end": 48, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": null, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.config.file_loader", - "is_test": false, - "blob_sha": "1f19ffebde5e38e4be5a5d5a678059a0f36dedb8fb8b3e00ab395c67106a87ea", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/contracts/config.py", - "content": "class ConfigProvider(ABC):\n @abstractmethod\n def load(self) -> dict[str, Any]:\n \"\"\"Return a config fragment.\"\"\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/contracts/config.py:ConfigProvider", - "span_start": 7, - "span_end": 10, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": null, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.contracts.config", - "is_test": false, - "blob_sha": "5e773880267743ee94954ea2db120c2d88c54d4312893293d1b89df405283ed4", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/contracts/health.py", - "content": "class HealthContributor(ABC):\n @abstractmethod\n def health(self) -> WorkerHealth:\n \"\"\"Return contributor health state.\"\"\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/contracts/health.py:HealthContributor", - "span_start": 7, - "span_end": 10, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": null, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.contracts.health", - "is_test": false, - "blob_sha": "6bd92611def7131e32d4dd34a8ed85e6cf3c67722ad27797032a632cb30dc097", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/contracts/application.py", - "content": "class ApplicationModule(ABC):\n @property\n @abstractmethod\n def name(self) -> str:\n \"\"\"Module name used for runtime status and diagnostics.\"\"\"\n\n @abstractmethod\n def register(self, registry: ModuleRegistry) -> None:\n \"\"\"Register workers, services, and health contributors.\"\"\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/contracts/application.py:ApplicationModule", - "span_start": 8, - "span_end": 16, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": null, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.contracts.application", - "is_test": false, - "blob_sha": "197c35634dca49c352ce3f230295a485fbffb672ce7bb8c08e752bfdf61e7fa4", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "retrieval_report": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "vector", - "C2_DEPENDENCY_GRAPH": "vector", - "C0_SOURCE_CHUNKS": "vector" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C0_SOURCE_CHUNKS": 10 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [] - } - }, - "fallback": { - "used": false, - "reason": null - }, - "retrieval_by_layer_ms": { - "C1_SYMBOL_CATALOG": 24, - "C2_DEPENDENCY_GRAPH": 36, - "C0_SOURCE_CHUNKS": 20 - } - } - }, - "diagnostics": { - "intent_correct": null, - "target_found": true, - "layers_used": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ], - "retrieval_sufficient": false, - "answer_mode": "degraded", - "resolved_target": "WorkflowRuntimeFactory", - "answer_policy_branch": "evidence_gate_short_circuit", - "decision_reason": "tests_not_found", - "router_result": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "retrieval_profile": "code", - "sub_intent": "FIND_TESTS", - "path_scope": [], - "layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ], - "symbol_resolution_status": "resolved" - }, - "retrieval_request": { - "rag_session_id": "7d11da21-faa0-4cea-aede-aeabe069164c", - "query": "Где тесты для WorkflowRuntimeFactory?", - "sub_intent": "FIND_TESTS", - "path_scope": [], - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ] - }, - "per_layer_outcome": [ - { - "layer_id": "C1_SYMBOL_CATALOG", - "hit_count": 8, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C2_DEPENDENCY_GRAPH", - "hit_count": 6, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C0_SOURCE_CHUNKS", - "hit_count": 10, - "empty": false, - "fallback_used": false - } - ], - "empty_layers": [], - "evidence_gate_decision": { - "sufficient": false, - "failure_reasons": [ - "tests_not_found" - ], - "evidence_count": 24 - }, - "evidence_gate_input": { - "resolved_target": "WorkflowRuntimeFactory", - "sub_intent": "FIND_TESTS", - "target_type": "symbol", - "evidence_count": 24, - "code_chunk_count": 24, - "entrypoint_count": 0, - "relation_count": 6, - "test_evidence_count": 0, - "symbol_resolution_status": "resolved", - "path_scope": [] - }, - "post_evidence_gate": { - "input": { - "answer_mode": "degraded", - "draft_present": false, - "resolved_target": "WorkflowRuntimeFactory" - }, - "output": { - "reason": "no_draft_answer" - } - }, - "failure_reasons": [ - "tests_not_found" - ], - "timings_ms": { - "router": 1, - "retrieval": 82, - "pre_evidence_gate": 1, - "post_evidence_gate": 1 - } - }, - "rag_rows": [ - { - "path": "src/plba/__init__.py", - "content": "const WorkflowRuntimeFactory\nWorkflowRuntimeFactory = plba.workflow.WorkflowRuntimeFactory", - "layer": "C1_SYMBOL_CATALOG", - "title": "WorkflowRuntimeFactory", - "span_start": 21, - "span_end": 30, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "cb7c73db05c2622aac89114bed1cddd1d567de21cfac5c53037c62b1074b25c9", - "qname": "WorkflowRuntimeFactory", - "kind": "const", - "signature": "WorkflowRuntimeFactory = plba.workflow.WorkflowRuntimeFactory", - "parent_symbol_id": null, - "package_or_module": "src.plba.__init__", - "is_test": false, - "blob_sha": "24e755ec8c249d14fb0e675b5dbf2b71ab91afb9c849897eebfa9feb2499e19d", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/runtime_factory.py", - "content": "class WorkflowRuntimeFactory\nWorkflowRuntimeFactory", - "layer": "C1_SYMBOL_CATALOG", - "title": "WorkflowRuntimeFactory", - "span_start": 7, - "span_end": 19, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "9da827270329de64ebb426fadaaa5e35145e6666b92c6da186e08bf4b071f458", - "qname": "WorkflowRuntimeFactory", - "kind": "class", - "signature": "WorkflowRuntimeFactory", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.workflow.runtime_factory", - "is_test": false, - "blob_sha": "4d03c095f3082eb3ea8d558d65a785eb747fffd9c1383946e6c433bcedb7259a", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/workflow.py", - "content": "const WorkflowRuntimeFactory\nWorkflowRuntimeFactory = app_runtime.workflow.runtime_factory.WorkflowRuntimeFactory", - "layer": "C1_SYMBOL_CATALOG", - "title": "WorkflowRuntimeFactory", - "span_start": 7, - "span_end": 7, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "80865947d1ca709971efe9d68a9ee1f348c1c43d351bf4e1b4a5884d72985b6b", - "qname": "WorkflowRuntimeFactory", - "kind": "const", - "signature": "WorkflowRuntimeFactory = app_runtime.workflow.runtime_factory.WorkflowRuntimeFactory", - "parent_symbol_id": null, - "package_or_module": "src.plba.workflow", - "is_test": false, - "blob_sha": "f227797606042273d1f1798f76846952892eeb9e4e9e6a38fb8a631d7231ff39", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/runtime_factory.py", - "content": "method WorkflowRuntimeFactory.__init__\n__init__(self, connection_factory)", - "layer": "C1_SYMBOL_CATALOG", - "title": "WorkflowRuntimeFactory.__init__", - "span_start": 8, - "span_end": 12, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "d82a367758b2f7bcce3d351e576f25768b0afe8b915d01ace1c7d6380f14f52f", - "qname": "WorkflowRuntimeFactory.__init__", - "kind": "method", - "signature": "__init__(self, connection_factory)", - "parent_symbol_id": "WorkflowRuntimeFactory", - "package_or_module": "src.app_runtime.workflow.runtime_factory", - "is_test": false, - "blob_sha": "4d03c095f3082eb3ea8d558d65a785eb747fffd9c1383946e6c433bcedb7259a", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/runtime_factory.py", - "content": "method WorkflowRuntimeFactory.create_engine\ncreate_engine(self, workflow)", - "layer": "C1_SYMBOL_CATALOG", - "title": "WorkflowRuntimeFactory.create_engine", - "span_start": 14, - "span_end": 19, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "86f3a0bf3332952bf469e564748f16f1f7814ab51d5a963e5eb33de5e171b333", - "qname": "WorkflowRuntimeFactory.create_engine", - "kind": "method", - "signature": "create_engine(self, workflow)", - "parent_symbol_id": "WorkflowRuntimeFactory", - "package_or_module": "src.app_runtime.workflow.runtime_factory", - "is_test": false, - "blob_sha": "4d03c095f3082eb3ea8d558d65a785eb747fffd9c1383946e6c433bcedb7259a", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/runtime_factory.py", - "content": "const WorkflowPersistence\nWorkflowPersistence = app_runtime.workflow.persistence.WorkflowPersistence", - "layer": "C1_SYMBOL_CATALOG", - "title": "WorkflowPersistence", - "span_start": 4, - "span_end": 4, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "35693d37698e35079400b6a021d46209966ce469d9f77763d1c82d82ef4600b2", - "qname": "WorkflowPersistence", - "kind": "const", - "signature": "WorkflowPersistence = app_runtime.workflow.persistence.WorkflowPersistence", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.workflow.runtime_factory", - "is_test": false, - "blob_sha": "4d03c095f3082eb3ea8d558d65a785eb747fffd9c1383946e6c433bcedb7259a", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/runtime_factory.py", - "content": "const annotations\nannotations = __future__.annotations", - "layer": "C1_SYMBOL_CATALOG", - "title": "annotations", - "span_start": 1, - "span_end": 1, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "e016ec68f9d15d52fe0505774229fafc705c1bf3dfda78845a3db9b032a4441d", - "qname": "annotations", - "kind": "const", - "signature": "annotations = __future__.annotations", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.workflow.runtime_factory", - "is_test": false, - "blob_sha": "4d03c095f3082eb3ea8d558d65a785eb747fffd9c1383946e6c433bcedb7259a", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/runtime_factory.py", - "content": "const WorkflowEngine\nWorkflowEngine = app_runtime.workflow.engine.workflow_engine.WorkflowEngine", - "layer": "C1_SYMBOL_CATALOG", - "title": "WorkflowEngine", - "span_start": 3, - "span_end": 3, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "da4aee8bc7d248177fbc4f892732c6eb08baa6d268c32921a217747143a99fe0", - "qname": "WorkflowEngine", - "kind": "const", - "signature": "WorkflowEngine = app_runtime.workflow.engine.workflow_engine.WorkflowEngine", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.workflow.runtime_factory", - "is_test": false, - "blob_sha": "4d03c095f3082eb3ea8d558d65a785eb747fffd9c1383946e6c433bcedb7259a", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/runtime_factory.py", - "content": "WorkflowRuntimeFactory.__init__\n -> WorkflowRuntimeFactory._hooks\n -> WorkflowRuntimeFactory.create_engine", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "WorkflowRuntimeFactory.__init__:dataflow_slice", - "span_start": 11, - "span_end": 19, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "db6124c75b447e4a0a9ba267bd6d6cdf267b41a733b2843d724dd42ec6f4945d", - "edge_type": "dataflow_slice", - "src_symbol_id": "d82a367758b2f7bcce3d351e576f25768b0afe8b915d01ace1c7d6380f14f52f", - "src_qname": "WorkflowRuntimeFactory.__init__", - "dst_symbol_id": "86f3a0bf3332952bf469e564748f16f1f7814ab51d5a963e5eb33de5e171b333", - "dst_ref": "WorkflowRuntimeFactory.create_engine", - "resolution": "resolved", - "slice_id": "db6124c75b447e4a0a9ba267bd6d6cdf267b41a733b2843d724dd42ec6f4945d", - "root_symbol_id": "d82a367758b2f7bcce3d351e576f25768b0afe8b915d01ace1c7d6380f14f52f", - "path_symbols": [ - "WorkflowRuntimeFactory.__init__", - "WorkflowRuntimeFactory._hooks", - "WorkflowRuntimeFactory.create_engine" - ], - "path_symbol_ids": [ - "d82a367758b2f7bcce3d351e576f25768b0afe8b915d01ace1c7d6380f14f52f", - "86f3a0bf3332952bf469e564748f16f1f7814ab51d5a963e5eb33de5e171b333" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "4d03c095f3082eb3ea8d558d65a785eb747fffd9c1383946e6c433bcedb7259a", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/runtime_factory.py", - "content": "WorkflowRuntimeFactory.__init__\n -> WorkflowRuntimeFactory._snapshot_sanitizer\n -> WorkflowRuntimeFactory.create_engine", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "WorkflowRuntimeFactory.__init__:dataflow_slice", - "span_start": 12, - "span_end": 17, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "f46f5a871a3800b517b0f94ed2551392629e1d7920bc3e3b5a21e0d8f012b741", - "edge_type": "dataflow_slice", - "src_symbol_id": "d82a367758b2f7bcce3d351e576f25768b0afe8b915d01ace1c7d6380f14f52f", - "src_qname": "WorkflowRuntimeFactory.__init__", - "dst_symbol_id": "86f3a0bf3332952bf469e564748f16f1f7814ab51d5a963e5eb33de5e171b333", - "dst_ref": "WorkflowRuntimeFactory.create_engine", - "resolution": "resolved", - "slice_id": "f46f5a871a3800b517b0f94ed2551392629e1d7920bc3e3b5a21e0d8f012b741", - "root_symbol_id": "d82a367758b2f7bcce3d351e576f25768b0afe8b915d01ace1c7d6380f14f52f", - "path_symbols": [ - "WorkflowRuntimeFactory.__init__", - "WorkflowRuntimeFactory._snapshot_sanitizer", - "WorkflowRuntimeFactory.create_engine" - ], - "path_symbol_ids": [ - "d82a367758b2f7bcce3d351e576f25768b0afe8b915d01ace1c7d6380f14f52f", - "86f3a0bf3332952bf469e564748f16f1f7814ab51d5a963e5eb33de5e171b333" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "4d03c095f3082eb3ea8d558d65a785eb747fffd9c1383946e6c433bcedb7259a", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/runtime_factory.py", - "content": "WorkflowRuntimeFactory.__init__\n -> WorkflowRuntimeFactory._connection_factory\n -> WorkflowRuntimeFactory.create_engine", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "WorkflowRuntimeFactory.__init__:dataflow_slice", - "span_start": 9, - "span_end": 16, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "543624853400c556d1939007017145281d76b00a694c7d5c4fbb0414ded3434e", - "edge_type": "dataflow_slice", - "src_symbol_id": "d82a367758b2f7bcce3d351e576f25768b0afe8b915d01ace1c7d6380f14f52f", - "src_qname": "WorkflowRuntimeFactory.__init__", - "dst_symbol_id": "86f3a0bf3332952bf469e564748f16f1f7814ab51d5a963e5eb33de5e171b333", - "dst_ref": "WorkflowRuntimeFactory.create_engine", - "resolution": "resolved", - "slice_id": "543624853400c556d1939007017145281d76b00a694c7d5c4fbb0414ded3434e", - "root_symbol_id": "d82a367758b2f7bcce3d351e576f25768b0afe8b915d01ace1c7d6380f14f52f", - "path_symbols": [ - "WorkflowRuntimeFactory.__init__", - "WorkflowRuntimeFactory._connection_factory", - "WorkflowRuntimeFactory.create_engine" - ], - "path_symbol_ids": [ - "d82a367758b2f7bcce3d351e576f25768b0afe8b915d01ace1c7d6380f14f52f", - "86f3a0bf3332952bf469e564748f16f1f7814ab51d5a963e5eb33de5e171b333" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "4d03c095f3082eb3ea8d558d65a785eb747fffd9c1383946e6c433bcedb7259a", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/runtime_factory.py", - "content": "WorkflowRuntimeFactory.__init__\n -> WorkflowRuntimeFactory._traces\n -> WorkflowRuntimeFactory.create_engine", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "WorkflowRuntimeFactory.__init__:dataflow_slice", - "span_start": 10, - "span_end": 19, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "346cf5ddb4308b8403d27c5b54da8cba298bb0af7dc04c2fe30312ef574103c6", - "edge_type": "dataflow_slice", - "src_symbol_id": "d82a367758b2f7bcce3d351e576f25768b0afe8b915d01ace1c7d6380f14f52f", - "src_qname": "WorkflowRuntimeFactory.__init__", - "dst_symbol_id": "86f3a0bf3332952bf469e564748f16f1f7814ab51d5a963e5eb33de5e171b333", - "dst_ref": "WorkflowRuntimeFactory.create_engine", - "resolution": "resolved", - "slice_id": "346cf5ddb4308b8403d27c5b54da8cba298bb0af7dc04c2fe30312ef574103c6", - "root_symbol_id": "d82a367758b2f7bcce3d351e576f25768b0afe8b915d01ace1c7d6380f14f52f", - "path_symbols": [ - "WorkflowRuntimeFactory.__init__", - "WorkflowRuntimeFactory._traces", - "WorkflowRuntimeFactory.create_engine" - ], - "path_symbol_ids": [ - "d82a367758b2f7bcce3d351e576f25768b0afe8b915d01ace1c7d6380f14f52f", - "86f3a0bf3332952bf469e564748f16f1f7814ab51d5a963e5eb33de5e171b333" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "4d03c095f3082eb3ea8d558d65a785eb747fffd9c1383946e6c433bcedb7259a", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/runtime_factory.py", - "content": "WorkflowRuntimeFactory.__init__ writes_attr WorkflowRuntimeFactory._snapshot_sanitizer", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "WorkflowRuntimeFactory.__init__:writes_attr", - "span_start": 12, - "span_end": 12, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "de0cb1913ba41f673cfb601cab23cfb2e1044ed3dd8c061aff486075aeb8af20", - "edge_type": "writes_attr", - "src_symbol_id": "d82a367758b2f7bcce3d351e576f25768b0afe8b915d01ace1c7d6380f14f52f", - "src_qname": "WorkflowRuntimeFactory.__init__", - "dst_symbol_id": null, - "dst_ref": "WorkflowRuntimeFactory._snapshot_sanitizer", - "resolution": "partial", - "is_test": false, - "blob_sha": "4d03c095f3082eb3ea8d558d65a785eb747fffd9c1383946e6c433bcedb7259a", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/runtime_factory.py", - "content": "WorkflowRuntimeFactory.create_engine calls WorkflowPersistence.create_default", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "WorkflowRuntimeFactory.create_engine:calls", - "span_start": 15, - "span_end": 18, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "fa86efb6871092fc88df68295c0d92dbe46253e1afa3246ca62b6da11d4d5569", - "edge_type": "calls", - "src_symbol_id": "86f3a0bf3332952bf469e564748f16f1f7814ab51d5a963e5eb33de5e171b333", - "src_qname": "WorkflowRuntimeFactory.create_engine", - "dst_symbol_id": null, - "dst_ref": "WorkflowPersistence.create_default", - "resolution": "partial", - "is_test": false, - "blob_sha": "4d03c095f3082eb3ea8d558d65a785eb747fffd9c1383946e6c433bcedb7259a", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/runtime_factory.py", - "content": "class WorkflowRuntimeFactory:\n def __init__(self, connection_factory=None, *, traces, hooks=None, snapshot_sanitizer=None) -> None:\n self._connection_factory = connection_factory\n self._traces = traces\n self._hooks = hooks\n self._snapshot_sanitizer = snapshot_sanitizer\n\n def create_engine(self, workflow) -> WorkflowEngine:\n persistence = WorkflowPersistence.create_default(\n self._connection_factory,\n snapshot_sanitizer=self._snapshot_sanitizer,\n )\n return WorkflowEngine(workflow, persistence, traces=self._traces, hooks=self._hooks)", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/workflow/runtime_factory.py:WorkflowRuntimeFactory", - "span_start": 7, - "span_end": 19, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.workflow.runtime_factory", - "is_test": false, - "blob_sha": "4d03c095f3082eb3ea8d558d65a785eb747fffd9c1383946e6c433bcedb7259a", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/__init__.py", - "content": "from plba.bootstrap import create_runtime\nfrom plba.config import ConfigFileLoader, FileConfigProvider\nfrom plba.control import ControlActionSet, ControlChannel, ControlPlaneService, HttpControlChannel\nfrom plba.contracts import (\n ApplicationModule,\n ConfigProvider,\n HealthContributor,\n TraceContext,\n TraceContextRecord,\n TraceLogMessage,\n TraceTransport,\n Worker,\n WorkerHealth,\n WorkerStatus,\n)\nfrom plba.core import ConfigurationManager, RuntimeManager, ServiceContainer\nfrom plba.health import HealthRegistry\nfrom plba.logging import LogManager\nfrom plba.queue import InMemoryTaskQueue\nfrom plba.tracing import MySqlTraceTransport, NoOpTraceTransport, TraceService\nfrom plba.workflow import (\n StepResult,\n WorkflowContext,\n WorkflowDefinition,\n WorkflowEngine,\n WorkflowEngineHooks,\n WorkflowNode,\n WorkflowRuntimeFactory,\n WorkflowStep,\n)\nfrom plba.workers import WorkerSupervisor\n\n__all__ = [\n \"ApplicationModule\",\n \"ConfigFileLoader\",\n \"ConfigProvider\",\n \"ConfigurationManager\",\n \"ControlActionSet\",\n \"ControlChannel\",\n \"ControlPlaneService\",\n \"create_runtime\",\n \"FileConfigProvider\",\n \"HealthContributor\",\n \"HealthRegistry\",\n \"HttpControlChannel\",\n \"InMemoryTaskQueue\",\n \"LogManager\",\n \"MySqlTraceTransport\",\n \"NoOpTraceTransport\",\n \"RuntimeManager\",\n \"ServiceContainer\",\n \"TraceContext\",\n \"TraceContextRecord\",\n \"TraceLogMessage\",\n \"TraceService\",\n \"TraceTransport\",\n \"StepResult\",\n \"Worker\",\n \"WorkerHealth\",\n \"WorkerStatus\",\n \"WorkflowContext\",\n \"WorkflowDefinition\",\n \"WorkflowEngine\",\n \"WorkflowEngineHooks\",\n \"WorkflowNode\",\n \"WorkflowRuntimeFactory\",\n \"WorkflowStep\",\n \"WorkerSupervisor\",\n]", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/plba/__init__.py:1-69", - "span_start": 1, - "span_end": 69, - "lexical_rank": 6, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.plba.__init__", - "is_test": false, - "blob_sha": "24e755ec8c249d14fb0e675b5dbf2b71ab91afb9c849897eebfa9feb2499e19d", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/workflow.py", - "content": "from app_runtime.workflow.contracts.context import WorkflowContext\nfrom app_runtime.workflow.contracts.result import StepResult\nfrom app_runtime.workflow.contracts.step import WorkflowStep\nfrom app_runtime.workflow.contracts.workflow import WorkflowDefinition, WorkflowNode\nfrom app_runtime.workflow.engine.hooks import WorkflowEngineHooks\nfrom app_runtime.workflow.engine.workflow_engine import WorkflowEngine\nfrom app_runtime.workflow.runtime_factory import WorkflowRuntimeFactory\n\n__all__ = [\n \"StepResult\",\n \"WorkflowContext\",\n \"WorkflowDefinition\",\n \"WorkflowEngine\",\n \"WorkflowEngineHooks\",\n \"WorkflowNode\",\n \"WorkflowRuntimeFactory\",\n \"WorkflowStep\",\n]", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/plba/workflow.py:1-18", - "span_start": 1, - "span_end": 18, - "lexical_rank": 6, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.plba.workflow", - "is_test": false, - "blob_sha": "f227797606042273d1f1798f76846952892eeb9e4e9e6a38fb8a631d7231ff39", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/config/__init__.py", - "content": "from app_runtime.config.file_loader import ConfigFileLoader\nfrom app_runtime.config.providers import FileConfigProvider\n\n__all__ = [\"ConfigFileLoader\", \"FileConfigProvider\"]", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/config/__init__.py:1-4", - "span_start": 1, - "span_end": 4, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.app_runtime.config.__init__", - "is_test": false, - "blob_sha": "612918029820a2a983330ec92256142b55b9de4bdf3399ece18e2a02dbad9729", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/config/providers.py", - "content": "class FileConfigProvider(ConfigProvider):\n def __init__(self, path: str | Path) -> None:\n self._loader = ConfigFileLoader(path)\n\n @property\n def loader(self) -> ConfigFileLoader:\n return self._loader\n\n def load(self) -> dict[str, Any]:\n config = self._loader.load_sync()\n if not isinstance(config, dict):\n raise TypeError(\"Config root must be a mapping\")\n return dict(config)", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/config/providers.py:FileConfigProvider", - "span_start": 10, - "span_end": 22, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.config.providers", - "is_test": false, - "blob_sha": "8c53ca0122d6df6c5763bca15e99434bb4daebd5a618b8fc927e9ae90b022e64", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/contracts/__init__.py", - "content": "__all__: list[str] = []", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/__init__.py:1-1", - "span_start": 1, - "span_end": 1, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.app_runtime.__init__", - "is_test": false, - "blob_sha": "8eea9df4f6d7b38ca0e39ccc27b04700e3d08dbeec8046d613d22706d19985fa", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/config/file_loader.py", - "content": "class ConfigFileLoader:\n def __init__(self, path: str | Path) -> None:\n self.path = Path(path)\n self.config: Any = None\n self.last_valid_config: Any = None\n self._last_seen_hash: str | None = None\n\n def read_text(self) -> str:\n return self.path.read_text(encoding=\"utf-8\")\n\n def parse(self, data: str) -> Any:\n suffix = self.path.suffix.lower()\n if suffix in {\".yml\", \".yaml\"}:\n return yaml.safe_load(data)\n return json.loads(data)\n\n def load_sync(self) -> Any:\n data = self.read_text()\n parsed = self.parse(data)\n self.config = parsed\n self.last_valid_config = parsed\n self._last_seen_hash = self._calculate_hash(data)\n return parsed\n\n def load_if_changed(self) -> tuple[bool, Any]:\n data = self.read_text()\n current_hash = self._calculate_hash(data)\n if current_hash == self._last_seen_hash:\n return False, self.config\n parsed = self.parse(data)\n self.config = parsed\n self.last_valid_config = parsed\n self._last_seen_hash = current_hash\n return True, parsed\n\n @staticmethod\n def _calculate_hash(data: str) -> str:\n return hashlib.sha256(data.encode(\"utf-8\")).hexdigest()", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/config/file_loader.py:ConfigFileLoader", - "span_start": 11, - "span_end": 48, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.config.file_loader", - "is_test": false, - "blob_sha": "1f19ffebde5e38e4be5a5d5a678059a0f36dedb8fb8b3e00ab395c67106a87ea", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/contracts/config.py", - "content": "class ConfigProvider(ABC):\n @abstractmethod\n def load(self) -> dict[str, Any]:\n \"\"\"Return a config fragment.\"\"\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/contracts/config.py:ConfigProvider", - "span_start": 7, - "span_end": 10, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.contracts.config", - "is_test": false, - "blob_sha": "5e773880267743ee94954ea2db120c2d88c54d4312893293d1b89df405283ed4", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/contracts/health.py", - "content": "class HealthContributor(ABC):\n @abstractmethod\n def health(self) -> WorkerHealth:\n \"\"\"Return contributor health state.\"\"\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/contracts/health.py:HealthContributor", - "span_start": 7, - "span_end": 10, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.contracts.health", - "is_test": false, - "blob_sha": "6bd92611def7131e32d4dd34a8ed85e6cf3c67722ad27797032a632cb30dc097", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/contracts/application.py", - "content": "class ApplicationModule(ABC):\n @property\n @abstractmethod\n def name(self) -> str:\n \"\"\"Module name used for runtime status and diagnostics.\"\"\"\n\n @abstractmethod\n def register(self, registry: ModuleRegistry) -> None:\n \"\"\"Register workers, services, and health contributors.\"\"\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/contracts/application.py:ApplicationModule", - "span_start": 8, - "span_end": 16, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.contracts.application", - "is_test": false, - "blob_sha": "197c35634dca49c352ce3f230295a485fbffb672ce7bb8c08e752bfdf61e7fa4", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "validation": { - "passed": false, - "action": "repair", - "reasons": [ - "degraded_answer_missing_guardrail" - ] - }, - "steps": [ - { - "step": "router", - "status": "completed", - "timings_ms": { - "router": 1 - }, - "output": { - "intent": "CODE_QA", - "sub_intent": "FIND_TESTS", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - } - }, - { - "step": "retrieval", - "status": "completed", - "timings_ms": { - "retrieval": 82 - }, - "output": { - "rag_count": 24, - "answer_path_rag_count": 24, - "resolved_symbol_status": "resolved", - "resolved_symbol": "WorkflowRuntimeFactory", - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ] - }, - "diagnostics": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "vector", - "C2_DEPENDENCY_GRAPH": "vector", - "C0_SOURCE_CHUNKS": "vector" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C0_SOURCE_CHUNKS": 10 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [] - } - }, - "fallback": { - "used": false, - "reason": null - }, - "retrieval_by_layer_ms": { - "C1_SYMBOL_CATALOG": 24, - "C2_DEPENDENCY_GRAPH": 36, - "C0_SOURCE_CHUNKS": 20 - } - } - }, - { - "step": "pre_evidence_gate", - "status": "blocked", - "timings_ms": { - "pre_evidence_gate": 1 - }, - "input": { - "resolved_target": "WorkflowRuntimeFactory", - "sub_intent": "FIND_TESTS", - "target_type": "symbol", - "evidence_count": 24, - "code_chunk_count": 24, - "entrypoint_count": 0, - "relation_count": 6, - "test_evidence_count": 0, - "symbol_resolution_status": "resolved", - "path_scope": [] - }, - "output": { - "passed": false, - "failure_reasons": [ - "tests_not_found" - ], - "degraded_message": "Insufficient evidence for a confident answer. No test candidates found.", - "evidence_count": 24 - } - }, - { - "step": "llm", - "status": "skipped", - "timings_ms": { - "llm": 1 - }, - "output": { - "reason": "policy_short_circuit", - "answer_mode": "degraded", - "decision_reason": "tests_not_found", - "answer_policy_branch": "evidence_gate_short_circuit" - } - }, - { - "step": "post_evidence_gate", - "status": "skipped", - "timings_ms": { - "post_evidence_gate": 1 - }, - "input": { - "answer_mode": "degraded", - "draft_present": false, - "resolved_target": "WorkflowRuntimeFactory" - }, - "output": { - "reason": "no_draft_answer" - } - } - ] - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/plba_full_chain_subintents_v3/20260312_174008/full_chain_plba_code_subintents_v2_plba-v2-find-tests-workflow-runtime-factory-negative.md b/tests/pipeline_setup_v3/test_results/plba_full_chain_subintents_v3/20260312_174008/full_chain_plba_code_subintents_v2_plba-v2-find-tests-workflow-runtime-factory-negative.md deleted file mode 100644 index a87b0c0..0000000 --- a/tests/pipeline_setup_v3/test_results/plba_full_chain_subintents_v3/20260312_174008/full_chain_plba_code_subintents_v2_plba-v2-find-tests-workflow-runtime-factory-negative.md +++ /dev/null @@ -1,259 +0,0 @@ -# plba-v2-find-tests-workflow-runtime-factory-negative - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_02_pipeline/full_chain_plba_code_subintents_v2.yaml -- runner: agent_runtime -- mode: full_chain -- passed: True - -## Query -Где тесты для WorkflowRuntimeFactory? - -## Actual -{ - "intent": "CODE_QA", - "sub_intent": "FIND_TESTS", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 24, - "llm_answer": "Insufficient evidence for a confident answer. No test candidates found.", - "answer_mode": "degraded", - "path_scope": [], - "symbol_candidates": [ - "WorkflowRuntimeFactory" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ] -} - -## Steps -[ - { - "step": "router", - "status": "completed", - "timings_ms": { - "router": 1 - }, - "output": { - "intent": "CODE_QA", - "sub_intent": "FIND_TESTS", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - } - }, - { - "step": "retrieval", - "status": "completed", - "timings_ms": { - "retrieval": 82 - }, - "output": { - "rag_count": 24, - "answer_path_rag_count": 24, - "resolved_symbol_status": "resolved", - "resolved_symbol": "WorkflowRuntimeFactory", - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ] - }, - "diagnostics": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "vector", - "C2_DEPENDENCY_GRAPH": "vector", - "C0_SOURCE_CHUNKS": "vector" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C0_SOURCE_CHUNKS": 10 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [] - } - }, - "fallback": { - "used": false, - "reason": null - }, - "retrieval_by_layer_ms": { - "C1_SYMBOL_CATALOG": 24, - "C2_DEPENDENCY_GRAPH": 36, - "C0_SOURCE_CHUNKS": 20 - } - } - }, - { - "step": "pre_evidence_gate", - "status": "blocked", - "timings_ms": { - "pre_evidence_gate": 1 - }, - "input": { - "resolved_target": "WorkflowRuntimeFactory", - "sub_intent": "FIND_TESTS", - "target_type": "symbol", - "evidence_count": 24, - "code_chunk_count": 24, - "entrypoint_count": 0, - "relation_count": 6, - "test_evidence_count": 0, - "symbol_resolution_status": "resolved", - "path_scope": [] - }, - "output": { - "passed": false, - "failure_reasons": [ - "tests_not_found" - ], - "degraded_message": "Insufficient evidence for a confident answer. No test candidates found.", - "evidence_count": 24 - } - }, - { - "step": "llm", - "status": "skipped", - "timings_ms": { - "llm": 1 - }, - "output": { - "reason": "policy_short_circuit", - "answer_mode": "degraded", - "decision_reason": "tests_not_found", - "answer_policy_branch": "evidence_gate_short_circuit" - } - }, - { - "step": "post_evidence_gate", - "status": "skipped", - "timings_ms": { - "post_evidence_gate": 1 - }, - "input": { - "answer_mode": "degraded", - "draft_present": false, - "resolved_target": "WorkflowRuntimeFactory" - }, - "output": { - "reason": "no_draft_answer" - } - } -] - -## Diagnostics -{ - "intent_correct": null, - "target_found": true, - "layers_used": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ], - "retrieval_sufficient": false, - "answer_mode": "degraded", - "resolved_target": "WorkflowRuntimeFactory", - "answer_policy_branch": "evidence_gate_short_circuit", - "decision_reason": "tests_not_found", - "router_result": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "retrieval_profile": "code", - "sub_intent": "FIND_TESTS", - "path_scope": [], - "layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ], - "symbol_resolution_status": "resolved" - }, - "retrieval_request": { - "rag_session_id": "7d11da21-faa0-4cea-aede-aeabe069164c", - "query": "Где тесты для WorkflowRuntimeFactory?", - "sub_intent": "FIND_TESTS", - "path_scope": [], - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ] - }, - "per_layer_outcome": [ - { - "layer_id": "C1_SYMBOL_CATALOG", - "hit_count": 8, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C2_DEPENDENCY_GRAPH", - "hit_count": 6, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C0_SOURCE_CHUNKS", - "hit_count": 10, - "empty": false, - "fallback_used": false - } - ], - "empty_layers": [], - "evidence_gate_decision": { - "sufficient": false, - "failure_reasons": [ - "tests_not_found" - ], - "evidence_count": 24 - }, - "evidence_gate_input": { - "resolved_target": "WorkflowRuntimeFactory", - "sub_intent": "FIND_TESTS", - "target_type": "symbol", - "evidence_count": 24, - "code_chunk_count": 24, - "entrypoint_count": 0, - "relation_count": 6, - "test_evidence_count": 0, - "symbol_resolution_status": "resolved", - "path_scope": [] - }, - "post_evidence_gate": { - "input": { - "answer_mode": "degraded", - "draft_present": false, - "resolved_target": "WorkflowRuntimeFactory" - }, - "output": { - "reason": "no_draft_answer" - } - }, - "failure_reasons": [ - "tests_not_found" - ], - "timings_ms": { - "router": 1, - "retrieval": 82, - "pre_evidence_gate": 1, - "post_evidence_gate": 1 - } -} - -## Mismatches -- none \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/plba_full_chain_subintents_v3/20260312_174008/full_chain_plba_code_subintents_v2_plba-v2-open-file-nonexistent.json b/tests/pipeline_setup_v3/test_results/plba_full_chain_subintents_v3/20260312_174008/full_chain_plba_code_subintents_v2_plba-v2-open-file-nonexistent.json deleted file mode 100644 index 73dc7e5..0000000 --- a/tests/pipeline_setup_v3/test_results/plba_full_chain_subintents_v3/20260312_174008/full_chain_plba_code_subintents_v2_plba-v2-open-file-nonexistent.json +++ /dev/null @@ -1,491 +0,0 @@ -{ - "case_id": "plba-v2-open-file-nonexistent", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_02_pipeline/full_chain_plba_code_subintents_v2.yaml", - "runner": "agent_runtime", - "mode": "full_chain", - "query": "Открой файл src/app_runtime/core/missing_runtime.py", - "actual": { - "intent": "CODE_QA", - "sub_intent": "OPEN_FILE", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 0, - "llm_answer": "Файл src/app_runtime/core/missing_runtime.py не найден.", - "answer_mode": "not_found", - "path_scope": [ - "src/app_runtime/core/missing_runtime.py" - ], - "symbol_candidates": [], - "layers": [ - "C0_SOURCE_CHUNKS" - ] - }, - "passed": true, - "mismatches": [], - "details": { - "query": "Открой файл src/app_runtime/core/missing_runtime.py", - "router_result": { - "schema_version": "1.1", - "intent": "CODE_QA", - "retrieval_profile": "code", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query_plan": { - "raw": "Открой файл src/app_runtime/core/missing_runtime.py", - "normalized": "Открой файл src/app_runtime/core/missing_runtime.py", - "sub_intent": "OPEN_FILE", - "negations": [], - "expansions": [ - "file" - ], - "keyword_hints": [], - "path_hints": [ - "src/app_runtime/core/missing_runtime.py" - ], - "doc_scope_hints": [], - "symbol_candidates": [], - "symbol_kind_hint": "unknown", - "anchors": [ - { - "type": "FILE_PATH", - "value": "src/app_runtime/core/missing_runtime.py", - "source": "user_text", - "subtype": null, - "span": { - "start": 12, - "end": 51 - }, - "confidence": 0.95 - }, - { - "type": "KEY_TERM", - "value": "файл", - "source": "user_text", - "subtype": null, - "span": { - "start": 7, - "end": 11 - }, - "confidence": 0.9 - } - ] - }, - "retrieval_spec": { - "domains": [ - "CODE" - ], - "layer_queries": [ - { - "layer_id": "C0_SOURCE_CHUNKS", - "top_k": 12 - } - ], - "filters": { - "test_policy": "EXCLUDE", - "path_scope": [ - "src/app_runtime/core/missing_runtime.py" - ], - "language": [ - "python" - ] - }, - "rerank_profile": "code" - }, - "retrieval_constraints": { - "include_globs": [ - "src/app_runtime/core/missing_runtime.py" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": false, - "max_distance": 2, - "top_k": 5 - } - }, - "symbol_resolution": { - "status": "not_requested", - "resolved_symbol": null, - "alternatives": [], - "confidence": 0.0 - }, - "evidence_policy": { - "require_def": false, - "require_flow": false, - "require_spec": false, - "allow_answer_without_evidence": false - } - }, - "retrieval_request": { - "rag_session_id": "7d11da21-faa0-4cea-aede-aeabe069164c", - "query": "Открой файл src/app_runtime/core/missing_runtime.py", - "sub_intent": "OPEN_FILE", - "path_scope": [ - "src/app_runtime/core/missing_runtime.py" - ], - "keyword_hints": [], - "symbol_candidates": [], - "requested_layers": [ - "C0_SOURCE_CHUNKS" - ], - "retrieval_spec": { - "domains": [ - "CODE" - ], - "layer_queries": [ - { - "layer_id": "C0_SOURCE_CHUNKS", - "top_k": 12 - } - ], - "filters": { - "test_policy": "EXCLUDE", - "path_scope": [ - "src/app_runtime/core/missing_runtime.py" - ], - "language": [ - "python" - ] - }, - "rerank_profile": "code" - }, - "retrieval_constraints": { - "include_globs": [ - "src/app_runtime/core/missing_runtime.py" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": false, - "max_distance": 2, - "top_k": 5 - } - }, - "query_plan": { - "raw": "Открой файл src/app_runtime/core/missing_runtime.py", - "normalized": "Открой файл src/app_runtime/core/missing_runtime.py", - "sub_intent": "OPEN_FILE", - "negations": [], - "expansions": [ - "file" - ], - "keyword_hints": [], - "path_hints": [ - "src/app_runtime/core/missing_runtime.py" - ], - "doc_scope_hints": [], - "symbol_candidates": [], - "symbol_kind_hint": "unknown", - "anchors": [ - { - "type": "FILE_PATH", - "value": "src/app_runtime/core/missing_runtime.py", - "source": "user_text", - "subtype": null, - "span": { - "start": 12, - "end": 51 - }, - "confidence": 0.95 - }, - { - "type": "KEY_TERM", - "value": "файл", - "source": "user_text", - "subtype": null, - "span": { - "start": 7, - "end": 11 - }, - "confidence": 0.9 - } - ] - } - }, - "retrieval_result": { - "target_symbol_candidates": [], - "resolved_symbol": null, - "symbol_resolution_status": "not_requested", - "file_candidates": [], - "code_chunks": [], - "relations": [], - "entrypoints": [], - "test_candidates": [], - "layer_outcomes": [ - { - "layer_id": "C0_SOURCE_CHUNKS", - "hit_count": 0, - "empty": true, - "fallback_used": false - } - ], - "missing_layers": [ - "C0_SOURCE_CHUNKS" - ], - "raw_rows": [], - "retrieval_report": { - "executed_layers": [ - "C0_SOURCE_CHUNKS" - ], - "retrieval_mode_by_layer": { - "C0_SOURCE_CHUNKS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C0_SOURCE_CHUNKS": 200 - }, - "filters_by_layer": { - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src/app_runtime/core/missing_runtime.py" - ] - } - }, - "requests": [ - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Открой файл src/app_runtime/core/missing_runtime.py", - "ranking_profile": "code" - } - ], - "fallback": { - "used": false, - "reason": null - }, - "retrieval_by_layer_ms": { - "C0_SOURCE_CHUNKS": 14 - } - } - }, - "diagnostics": { - "intent_correct": null, - "target_found": false, - "layers_used": [ - "C0_SOURCE_CHUNKS" - ], - "retrieval_sufficient": false, - "answer_mode": "insufficient", - "resolved_target": "src/app_runtime/core/missing_runtime.py", - "answer_policy_branch": "open_file_not_found", - "decision_reason": "path_scope_empty", - "router_result": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "retrieval_profile": "code", - "sub_intent": "OPEN_FILE", - "path_scope": [ - "src/app_runtime/core/missing_runtime.py" - ], - "layers": [ - "C0_SOURCE_CHUNKS" - ], - "symbol_resolution_status": "not_requested" - }, - "retrieval_request": { - "rag_session_id": "7d11da21-faa0-4cea-aede-aeabe069164c", - "query": "Открой файл src/app_runtime/core/missing_runtime.py", - "sub_intent": "OPEN_FILE", - "path_scope": [ - "src/app_runtime/core/missing_runtime.py" - ], - "requested_layers": [ - "C0_SOURCE_CHUNKS" - ] - }, - "per_layer_outcome": [ - { - "layer_id": "C0_SOURCE_CHUNKS", - "hit_count": 0, - "empty": true, - "fallback_used": false - } - ], - "empty_layers": [ - "C0_SOURCE_CHUNKS" - ], - "evidence_gate_decision": { - "sufficient": false, - "failure_reasons": [ - "path_scope_empty", - "layer_c0_empty" - ], - "evidence_count": 0 - }, - "evidence_gate_input": { - "resolved_target": "src/app_runtime/core/missing_runtime.py", - "sub_intent": "OPEN_FILE", - "target_type": "none", - "evidence_count": 0, - "code_chunk_count": 0, - "entrypoint_count": 0, - "relation_count": 0, - "test_evidence_count": 0, - "symbol_resolution_status": "not_requested", - "path_scope": [ - "src/app_runtime/core/missing_runtime.py" - ] - }, - "post_evidence_gate": { - "input": { - "answer_mode": "not_found", - "draft_present": false, - "resolved_target": "src/app_runtime/core/missing_runtime.py" - }, - "output": { - "reason": "no_draft_answer" - } - }, - "failure_reasons": [ - "path_scope_empty", - "layer_c0_empty" - ], - "timings_ms": { - "router": 1, - "retrieval": 15, - "pre_evidence_gate": 1, - "post_evidence_gate": 1 - } - }, - "rag_rows": [], - "validation": { - "passed": true, - "action": "return", - "reasons": [] - }, - "steps": [ - { - "step": "router", - "status": "completed", - "timings_ms": { - "router": 1 - }, - "output": { - "intent": "CODE_QA", - "sub_intent": "OPEN_FILE", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - } - }, - { - "step": "retrieval", - "status": "completed", - "timings_ms": { - "retrieval": 15 - }, - "output": { - "rag_count": 0, - "answer_path_rag_count": 0, - "resolved_symbol_status": "not_requested", - "resolved_symbol": null, - "requested_layers": [ - "C0_SOURCE_CHUNKS" - ] - }, - "diagnostics": { - "executed_layers": [ - "C0_SOURCE_CHUNKS" - ], - "retrieval_mode_by_layer": { - "C0_SOURCE_CHUNKS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C0_SOURCE_CHUNKS": 200 - }, - "filters_by_layer": { - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src/app_runtime/core/missing_runtime.py" - ] - } - }, - "requests": [ - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Открой файл src/app_runtime/core/missing_runtime.py", - "ranking_profile": "code" - } - ], - "fallback": { - "used": false, - "reason": null - }, - "retrieval_by_layer_ms": { - "C0_SOURCE_CHUNKS": 14 - } - } - }, - { - "step": "pre_evidence_gate", - "status": "blocked", - "timings_ms": { - "pre_evidence_gate": 1 - }, - "input": { - "resolved_target": "src/app_runtime/core/missing_runtime.py", - "sub_intent": "OPEN_FILE", - "target_type": "none", - "evidence_count": 0, - "code_chunk_count": 0, - "entrypoint_count": 0, - "relation_count": 0, - "test_evidence_count": 0, - "symbol_resolution_status": "not_requested", - "path_scope": [ - "src/app_runtime/core/missing_runtime.py" - ] - }, - "output": { - "passed": false, - "failure_reasons": [ - "path_scope_empty", - "layer_c0_empty" - ], - "degraded_message": "Insufficient evidence for a confident answer. No matching path or file found. No code chunks retrieved.", - "evidence_count": 0 - } - }, - { - "step": "llm", - "status": "skipped", - "timings_ms": { - "llm": 1 - }, - "output": { - "reason": "policy_short_circuit", - "answer_mode": "not_found", - "decision_reason": "path_scope_empty", - "answer_policy_branch": "open_file_not_found" - } - }, - { - "step": "post_evidence_gate", - "status": "skipped", - "timings_ms": { - "post_evidence_gate": 1 - }, - "input": { - "answer_mode": "not_found", - "draft_present": false, - "resolved_target": "src/app_runtime/core/missing_runtime.py" - }, - "output": { - "reason": "no_draft_answer" - } - } - ] - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/plba_full_chain_subintents_v3/20260312_174008/full_chain_plba_code_subintents_v2_plba-v2-open-file-nonexistent.md b/tests/pipeline_setup_v3/test_results/plba_full_chain_subintents_v3/20260312_174008/full_chain_plba_code_subintents_v2_plba-v2-open-file-nonexistent.md deleted file mode 100644 index 8f60590..0000000 --- a/tests/pipeline_setup_v3/test_results/plba_full_chain_subintents_v3/20260312_174008/full_chain_plba_code_subintents_v2_plba-v2-open-file-nonexistent.md +++ /dev/null @@ -1,245 +0,0 @@ -# plba-v2-open-file-nonexistent - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_02_pipeline/full_chain_plba_code_subintents_v2.yaml -- runner: agent_runtime -- mode: full_chain -- passed: True - -## Query -Открой файл src/app_runtime/core/missing_runtime.py - -## Actual -{ - "intent": "CODE_QA", - "sub_intent": "OPEN_FILE", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 0, - "llm_answer": "Файл src/app_runtime/core/missing_runtime.py не найден.", - "answer_mode": "not_found", - "path_scope": [ - "src/app_runtime/core/missing_runtime.py" - ], - "symbol_candidates": [], - "layers": [ - "C0_SOURCE_CHUNKS" - ] -} - -## Steps -[ - { - "step": "router", - "status": "completed", - "timings_ms": { - "router": 1 - }, - "output": { - "intent": "CODE_QA", - "sub_intent": "OPEN_FILE", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - } - }, - { - "step": "retrieval", - "status": "completed", - "timings_ms": { - "retrieval": 15 - }, - "output": { - "rag_count": 0, - "answer_path_rag_count": 0, - "resolved_symbol_status": "not_requested", - "resolved_symbol": null, - "requested_layers": [ - "C0_SOURCE_CHUNKS" - ] - }, - "diagnostics": { - "executed_layers": [ - "C0_SOURCE_CHUNKS" - ], - "retrieval_mode_by_layer": { - "C0_SOURCE_CHUNKS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C0_SOURCE_CHUNKS": 200 - }, - "filters_by_layer": { - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src/app_runtime/core/missing_runtime.py" - ] - } - }, - "requests": [ - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Открой файл src/app_runtime/core/missing_runtime.py", - "ranking_profile": "code" - } - ], - "fallback": { - "used": false, - "reason": null - }, - "retrieval_by_layer_ms": { - "C0_SOURCE_CHUNKS": 14 - } - } - }, - { - "step": "pre_evidence_gate", - "status": "blocked", - "timings_ms": { - "pre_evidence_gate": 1 - }, - "input": { - "resolved_target": "src/app_runtime/core/missing_runtime.py", - "sub_intent": "OPEN_FILE", - "target_type": "none", - "evidence_count": 0, - "code_chunk_count": 0, - "entrypoint_count": 0, - "relation_count": 0, - "test_evidence_count": 0, - "symbol_resolution_status": "not_requested", - "path_scope": [ - "src/app_runtime/core/missing_runtime.py" - ] - }, - "output": { - "passed": false, - "failure_reasons": [ - "path_scope_empty", - "layer_c0_empty" - ], - "degraded_message": "Insufficient evidence for a confident answer. No matching path or file found. No code chunks retrieved.", - "evidence_count": 0 - } - }, - { - "step": "llm", - "status": "skipped", - "timings_ms": { - "llm": 1 - }, - "output": { - "reason": "policy_short_circuit", - "answer_mode": "not_found", - "decision_reason": "path_scope_empty", - "answer_policy_branch": "open_file_not_found" - } - }, - { - "step": "post_evidence_gate", - "status": "skipped", - "timings_ms": { - "post_evidence_gate": 1 - }, - "input": { - "answer_mode": "not_found", - "draft_present": false, - "resolved_target": "src/app_runtime/core/missing_runtime.py" - }, - "output": { - "reason": "no_draft_answer" - } - } -] - -## Diagnostics -{ - "intent_correct": null, - "target_found": false, - "layers_used": [ - "C0_SOURCE_CHUNKS" - ], - "retrieval_sufficient": false, - "answer_mode": "insufficient", - "resolved_target": "src/app_runtime/core/missing_runtime.py", - "answer_policy_branch": "open_file_not_found", - "decision_reason": "path_scope_empty", - "router_result": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "retrieval_profile": "code", - "sub_intent": "OPEN_FILE", - "path_scope": [ - "src/app_runtime/core/missing_runtime.py" - ], - "layers": [ - "C0_SOURCE_CHUNKS" - ], - "symbol_resolution_status": "not_requested" - }, - "retrieval_request": { - "rag_session_id": "7d11da21-faa0-4cea-aede-aeabe069164c", - "query": "Открой файл src/app_runtime/core/missing_runtime.py", - "sub_intent": "OPEN_FILE", - "path_scope": [ - "src/app_runtime/core/missing_runtime.py" - ], - "requested_layers": [ - "C0_SOURCE_CHUNKS" - ] - }, - "per_layer_outcome": [ - { - "layer_id": "C0_SOURCE_CHUNKS", - "hit_count": 0, - "empty": true, - "fallback_used": false - } - ], - "empty_layers": [ - "C0_SOURCE_CHUNKS" - ], - "evidence_gate_decision": { - "sufficient": false, - "failure_reasons": [ - "path_scope_empty", - "layer_c0_empty" - ], - "evidence_count": 0 - }, - "evidence_gate_input": { - "resolved_target": "src/app_runtime/core/missing_runtime.py", - "sub_intent": "OPEN_FILE", - "target_type": "none", - "evidence_count": 0, - "code_chunk_count": 0, - "entrypoint_count": 0, - "relation_count": 0, - "test_evidence_count": 0, - "symbol_resolution_status": "not_requested", - "path_scope": [ - "src/app_runtime/core/missing_runtime.py" - ] - }, - "post_evidence_gate": { - "input": { - "answer_mode": "not_found", - "draft_present": false, - "resolved_target": "src/app_runtime/core/missing_runtime.py" - }, - "output": { - "reason": "no_draft_answer" - } - }, - "failure_reasons": [ - "path_scope_empty", - "layer_c0_empty" - ], - "timings_ms": { - "router": 1, - "retrieval": 15, - "pre_evidence_gate": 1, - "post_evidence_gate": 1 - } -} - -## Mismatches -- none \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/plba_full_chain_subintents_v3/20260312_174008/full_chain_plba_code_subintents_v2_plba-v2-open-file-public-api.json b/tests/pipeline_setup_v3/test_results/plba_full_chain_subintents_v3/20260312_174008/full_chain_plba_code_subintents_v2_plba-v2-open-file-public-api.json deleted file mode 100644 index 435f2a9..0000000 --- a/tests/pipeline_setup_v3/test_results/plba_full_chain_subintents_v3/20260312_174008/full_chain_plba_code_subintents_v2_plba-v2-open-file-public-api.json +++ /dev/null @@ -1,583 +0,0 @@ -{ - "case_id": "plba-v2-open-file-public-api", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_02_pipeline/full_chain_plba_code_subintents_v2.yaml", - "runner": "agent_runtime", - "mode": "full_chain", - "query": "Открой файл src/plba/__init__.py", - "actual": { - "intent": "CODE_QA", - "sub_intent": "OPEN_FILE", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 1, - "llm_answer": "Файл `src/plba/__init__.py` импортирует следующие основные компоненты:\n\n- Из `plba.bootstrap`: `create_runtime`\n- Из `plba.config`: `ConfigFileLoader`, `FileConfigProvider`\n- Из `plba.control`: `ControlActionSet`, `ControlChannel`, `ControlPlaneService`, `HttpControlChannel`\n- Из `plba.contracts`: несколько контрактов, таких как `ApplicationModule`, `ConfigProvider`, `Worker`, `WorkerHealth`\n- Из `plba.core`: `ConfigurationManager`, `RuntimeManager`, `ServiceContainer`\n- Из `plba.health`: `HealthRegistry`\n- Из `plba.logging`: `LogManager`\n- Из `plba.queue`: `InMemoryTaskQueue`\n- Из `plba.tracing`: `MySqlTraceTransport`, `NoOpTraceTransport`, `TraceService`\n- Из `plba.workflow`: различные классы для работы с workflow\n\nЭто инициализационный скрипт пакета `plba`, обеспечивающий доступ ко всем основным функциональным блокам пакета.", - "answer_mode": "answered", - "path_scope": [ - "src/plba/__init__.py" - ], - "symbol_candidates": [], - "layers": [ - "C0_SOURCE_CHUNKS" - ] - }, - "passed": true, - "mismatches": [], - "details": { - "query": "Открой файл src/plba/__init__.py", - "router_result": { - "schema_version": "1.1", - "intent": "CODE_QA", - "retrieval_profile": "code", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query_plan": { - "raw": "Открой файл src/plba/__init__.py", - "normalized": "Открой файл src/plba/__init__.py", - "sub_intent": "OPEN_FILE", - "negations": [], - "expansions": [ - "file" - ], - "keyword_hints": [], - "path_hints": [ - "src/plba/__init__.py" - ], - "doc_scope_hints": [], - "symbol_candidates": [], - "symbol_kind_hint": "unknown", - "anchors": [ - { - "type": "FILE_PATH", - "value": "src/plba/__init__.py", - "source": "user_text", - "subtype": null, - "span": { - "start": 12, - "end": 32 - }, - "confidence": 0.95 - }, - { - "type": "KEY_TERM", - "value": "файл", - "source": "user_text", - "subtype": null, - "span": { - "start": 7, - "end": 11 - }, - "confidence": 0.9 - } - ] - }, - "retrieval_spec": { - "domains": [ - "CODE" - ], - "layer_queries": [ - { - "layer_id": "C0_SOURCE_CHUNKS", - "top_k": 12 - } - ], - "filters": { - "test_policy": "EXCLUDE", - "path_scope": [ - "src/plba/__init__.py" - ], - "language": [ - "python" - ] - }, - "rerank_profile": "code" - }, - "retrieval_constraints": { - "include_globs": [ - "src/plba/__init__.py" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": false, - "max_distance": 2, - "top_k": 5 - } - }, - "symbol_resolution": { - "status": "not_requested", - "resolved_symbol": null, - "alternatives": [], - "confidence": 0.0 - }, - "evidence_policy": { - "require_def": false, - "require_flow": false, - "require_spec": false, - "allow_answer_without_evidence": false - } - }, - "retrieval_request": { - "rag_session_id": "7d11da21-faa0-4cea-aede-aeabe069164c", - "query": "Открой файл src/plba/__init__.py", - "sub_intent": "OPEN_FILE", - "path_scope": [ - "src/plba/__init__.py" - ], - "keyword_hints": [], - "symbol_candidates": [], - "requested_layers": [ - "C0_SOURCE_CHUNKS" - ], - "retrieval_spec": { - "domains": [ - "CODE" - ], - "layer_queries": [ - { - "layer_id": "C0_SOURCE_CHUNKS", - "top_k": 12 - } - ], - "filters": { - "test_policy": "EXCLUDE", - "path_scope": [ - "src/plba/__init__.py" - ], - "language": [ - "python" - ] - }, - "rerank_profile": "code" - }, - "retrieval_constraints": { - "include_globs": [ - "src/plba/__init__.py" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": false, - "max_distance": 2, - "top_k": 5 - } - }, - "query_plan": { - "raw": "Открой файл src/plba/__init__.py", - "normalized": "Открой файл src/plba/__init__.py", - "sub_intent": "OPEN_FILE", - "negations": [], - "expansions": [ - "file" - ], - "keyword_hints": [], - "path_hints": [ - "src/plba/__init__.py" - ], - "doc_scope_hints": [], - "symbol_candidates": [], - "symbol_kind_hint": "unknown", - "anchors": [ - { - "type": "FILE_PATH", - "value": "src/plba/__init__.py", - "source": "user_text", - "subtype": null, - "span": { - "start": 12, - "end": 32 - }, - "confidence": 0.95 - }, - { - "type": "KEY_TERM", - "value": "файл", - "source": "user_text", - "subtype": null, - "span": { - "start": 7, - "end": 11 - }, - "confidence": 0.9 - } - ] - } - }, - "retrieval_result": { - "target_symbol_candidates": [], - "resolved_symbol": null, - "symbol_resolution_status": "not_requested", - "file_candidates": [ - "src/plba/__init__.py" - ], - "code_chunks": [ - { - "layer": "C0_SOURCE_CHUNKS", - "path": "src/plba/__init__.py", - "title": "src/plba/__init__.py:1-69", - "content": "from plba.bootstrap import create_runtime\nfrom plba.config import ConfigFileLoader, FileConfigProvider\nfrom plba.control import ControlActionSet, ControlChannel, ControlPlaneService, HttpControlChannel\nfrom plba.contracts import (\n ApplicationModule,\n ConfigProvider,\n HealthContributor,\n TraceContext,\n TraceContextRecord,\n TraceLogMessage,\n TraceTransport,\n Worker,\n WorkerHealth,\n WorkerStatus,\n)\nfrom plba.core import ConfigurationManager, RuntimeManager, ServiceContainer\nfrom plba.health import HealthRegistry\nfrom plba.logging import LogManager\nfrom plba.queue import InMemoryTaskQueue\nfrom plba.tracing import MySqlTraceTransport, NoOpTraceTransport, TraceService\nfrom plba.workflow import (\n StepResult,\n WorkflowContext,\n WorkflowDefinition,\n WorkflowEngine,\n WorkflowEngineHooks,\n WorkflowNode,\n WorkflowRuntimeFactory,\n WorkflowStep,\n)\nfrom plba.workers import WorkerSupervisor\n\n__all__ = [\n \"ApplicationModule\",\n \"ConfigFileLoader\",\n \"ConfigProvider\",\n \"ConfigurationManager\",\n \"ControlActionSet\",\n \"ControlChannel\",\n \"ControlPlaneService\",\n \"create_runtime\",\n \"FileConfigProvider\",\n \"HealthContributor\",\n \"HealthRegistry\",\n \"HttpControlChannel\",\n \"InMemoryTaskQueue\",\n \"LogManager\",\n \"MySqlTraceTransport\",\n \"NoOpTraceTransport\",\n \"RuntimeManager\",\n \"ServiceContainer\",\n \"TraceContext\",\n \"TraceContextRecord\",\n \"TraceLogMessage\",\n \"TraceService\",\n \"TraceTransport\",\n \"StepResult\",\n \"Worker\",\n \"WorkerHealth\",\n \"WorkerStatus\",\n \"WorkflowContext\",\n \"WorkflowDefinition\",\n \"WorkflowEngine\",\n \"WorkflowEngineHooks\",\n \"WorkflowNode\",\n \"WorkflowRuntimeFactory\",\n \"WorkflowStep\",\n \"WorkerSupervisor\",\n]", - "start_line": 1, - "end_line": 69, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.plba.__init__", - "is_test": false, - "blob_sha": "24e755ec8c249d14fb0e675b5dbf2b71ab91afb9c849897eebfa9feb2499e19d", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "relations": [], - "entrypoints": [], - "test_candidates": [], - "layer_outcomes": [ - { - "layer_id": "C0_SOURCE_CHUNKS", - "hit_count": 1, - "empty": false, - "fallback_used": false - } - ], - "missing_layers": [], - "raw_rows": [ - { - "path": "src/plba/__init__.py", - "content": "from plba.bootstrap import create_runtime\nfrom plba.config import ConfigFileLoader, FileConfigProvider\nfrom plba.control import ControlActionSet, ControlChannel, ControlPlaneService, HttpControlChannel\nfrom plba.contracts import (\n ApplicationModule,\n ConfigProvider,\n HealthContributor,\n TraceContext,\n TraceContextRecord,\n TraceLogMessage,\n TraceTransport,\n Worker,\n WorkerHealth,\n WorkerStatus,\n)\nfrom plba.core import ConfigurationManager, RuntimeManager, ServiceContainer\nfrom plba.health import HealthRegistry\nfrom plba.logging import LogManager\nfrom plba.queue import InMemoryTaskQueue\nfrom plba.tracing import MySqlTraceTransport, NoOpTraceTransport, TraceService\nfrom plba.workflow import (\n StepResult,\n WorkflowContext,\n WorkflowDefinition,\n WorkflowEngine,\n WorkflowEngineHooks,\n WorkflowNode,\n WorkflowRuntimeFactory,\n WorkflowStep,\n)\nfrom plba.workers import WorkerSupervisor\n\n__all__ = [\n \"ApplicationModule\",\n \"ConfigFileLoader\",\n \"ConfigProvider\",\n \"ConfigurationManager\",\n \"ControlActionSet\",\n \"ControlChannel\",\n \"ControlPlaneService\",\n \"create_runtime\",\n \"FileConfigProvider\",\n \"HealthContributor\",\n \"HealthRegistry\",\n \"HttpControlChannel\",\n \"InMemoryTaskQueue\",\n \"LogManager\",\n \"MySqlTraceTransport\",\n \"NoOpTraceTransport\",\n \"RuntimeManager\",\n \"ServiceContainer\",\n \"TraceContext\",\n \"TraceContextRecord\",\n \"TraceLogMessage\",\n \"TraceService\",\n \"TraceTransport\",\n \"StepResult\",\n \"Worker\",\n \"WorkerHealth\",\n \"WorkerStatus\",\n \"WorkflowContext\",\n \"WorkflowDefinition\",\n \"WorkflowEngine\",\n \"WorkflowEngineHooks\",\n \"WorkflowNode\",\n \"WorkflowRuntimeFactory\",\n \"WorkflowStep\",\n \"WorkerSupervisor\",\n]", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/plba/__init__.py:1-69", - "span_start": 1, - "span_end": 69, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.plba.__init__", - "is_test": false, - "blob_sha": "24e755ec8c249d14fb0e675b5dbf2b71ab91afb9c849897eebfa9feb2499e19d", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "retrieval_report": { - "executed_layers": [ - "C0_SOURCE_CHUNKS" - ], - "retrieval_mode_by_layer": { - "C0_SOURCE_CHUNKS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C0_SOURCE_CHUNKS": 200 - }, - "filters_by_layer": { - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src/plba/__init__.py" - ] - } - }, - "requests": [ - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Открой файл src/plba/__init__.py", - "ranking_profile": "code" - } - ], - "fallback": { - "used": false, - "reason": null - }, - "retrieval_by_layer_ms": { - "C0_SOURCE_CHUNKS": 24 - } - } - }, - "diagnostics": { - "intent_correct": null, - "target_found": true, - "layers_used": [ - "C0_SOURCE_CHUNKS" - ], - "retrieval_sufficient": true, - "answer_mode": "normal", - "resolved_target": "src/plba/__init__.py", - "answer_policy_branch": "normal_answer", - "decision_reason": "evidence_sufficient", - "router_result": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "retrieval_profile": "code", - "sub_intent": "OPEN_FILE", - "path_scope": [ - "src/plba/__init__.py" - ], - "layers": [ - "C0_SOURCE_CHUNKS" - ], - "symbol_resolution_status": "not_requested" - }, - "retrieval_request": { - "rag_session_id": "7d11da21-faa0-4cea-aede-aeabe069164c", - "query": "Открой файл src/plba/__init__.py", - "sub_intent": "OPEN_FILE", - "path_scope": [ - "src/plba/__init__.py" - ], - "requested_layers": [ - "C0_SOURCE_CHUNKS" - ] - }, - "per_layer_outcome": [ - { - "layer_id": "C0_SOURCE_CHUNKS", - "hit_count": 1, - "empty": false, - "fallback_used": false - } - ], - "empty_layers": [], - "evidence_gate_decision": { - "sufficient": true, - "failure_reasons": [], - "evidence_count": 1 - }, - "evidence_gate_input": { - "resolved_target": "src/plba/__init__.py", - "sub_intent": "OPEN_FILE", - "target_type": "file", - "evidence_count": 1, - "code_chunk_count": 1, - "entrypoint_count": 0, - "relation_count": 0, - "test_evidence_count": 0, - "symbol_resolution_status": "not_requested", - "path_scope": [ - "src/plba/__init__.py" - ] - }, - "post_evidence_gate": { - "input": { - "answer_mode": "normal", - "degraded_message": "", - "resolved_target": "src/plba/__init__.py", - "draft_answer_preview": "Файл `src/plba/__init__.py` импортирует следующие основные компоненты:\n\n- Из `plba.bootstrap`: `create_runtime`\n- Из `plba.config`: `ConfigFileLoader`, `FileConfigProvider`\n- Из `plba.control`: `ControlActionSet`, `ControlChannel`, `ControlPlaneService`, `HttpControlChannel`\n- Из `plba.contracts`: н", - "repair_candidate": true - }, - "output": { - "passed": true, - "action": "return", - "reasons": [], - "repair_used": false, - "final_answer_preview": "Файл `src/plba/__init__.py` импортирует следующие основные компоненты:\n\n- Из `plba.bootstrap`: `create_runtime`\n- Из `plba.config`: `ConfigFileLoader`, `FileConfigProvider`\n- Из `plba.control`: `ControlActionSet`, `ControlChannel`, `ControlPlaneService`, `HttpControlChannel`\n- Из `plba.contracts`: н" - } - }, - "failure_reasons": [], - "timings_ms": { - "router": 1, - "retrieval": 25, - "pre_evidence_gate": 1, - "llm": 4851, - "post_evidence_gate": 1 - } - }, - "rag_rows": [ - { - "path": "src/plba/__init__.py", - "content": "from plba.bootstrap import create_runtime\nfrom plba.config import ConfigFileLoader, FileConfigProvider\nfrom plba.control import ControlActionSet, ControlChannel, ControlPlaneService, HttpControlChannel\nfrom plba.contracts import (\n ApplicationModule,\n ConfigProvider,\n HealthContributor,\n TraceContext,\n TraceContextRecord,\n TraceLogMessage,\n TraceTransport,\n Worker,\n WorkerHealth,\n WorkerStatus,\n)\nfrom plba.core import ConfigurationManager, RuntimeManager, ServiceContainer\nfrom plba.health import HealthRegistry\nfrom plba.logging import LogManager\nfrom plba.queue import InMemoryTaskQueue\nfrom plba.tracing import MySqlTraceTransport, NoOpTraceTransport, TraceService\nfrom plba.workflow import (\n StepResult,\n WorkflowContext,\n WorkflowDefinition,\n WorkflowEngine,\n WorkflowEngineHooks,\n WorkflowNode,\n WorkflowRuntimeFactory,\n WorkflowStep,\n)\nfrom plba.workers import WorkerSupervisor\n\n__all__ = [\n \"ApplicationModule\",\n \"ConfigFileLoader\",\n \"ConfigProvider\",\n \"ConfigurationManager\",\n \"ControlActionSet\",\n \"ControlChannel\",\n \"ControlPlaneService\",\n \"create_runtime\",\n \"FileConfigProvider\",\n \"HealthContributor\",\n \"HealthRegistry\",\n \"HttpControlChannel\",\n \"InMemoryTaskQueue\",\n \"LogManager\",\n \"MySqlTraceTransport\",\n \"NoOpTraceTransport\",\n \"RuntimeManager\",\n \"ServiceContainer\",\n \"TraceContext\",\n \"TraceContextRecord\",\n \"TraceLogMessage\",\n \"TraceService\",\n \"TraceTransport\",\n \"StepResult\",\n \"Worker\",\n \"WorkerHealth\",\n \"WorkerStatus\",\n \"WorkflowContext\",\n \"WorkflowDefinition\",\n \"WorkflowEngine\",\n \"WorkflowEngineHooks\",\n \"WorkflowNode\",\n \"WorkflowRuntimeFactory\",\n \"WorkflowStep\",\n \"WorkerSupervisor\",\n]", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/plba/__init__.py:1-69", - "span_start": 1, - "span_end": 69, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.plba.__init__", - "is_test": false, - "blob_sha": "24e755ec8c249d14fb0e675b5dbf2b71ab91afb9c849897eebfa9feb2499e19d", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "validation": { - "passed": true, - "action": "return", - "reasons": [] - }, - "steps": [ - { - "step": "router", - "status": "completed", - "timings_ms": { - "router": 1 - }, - "output": { - "intent": "CODE_QA", - "sub_intent": "OPEN_FILE", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - } - }, - { - "step": "retrieval", - "status": "completed", - "timings_ms": { - "retrieval": 25 - }, - "output": { - "rag_count": 1, - "answer_path_rag_count": 1, - "resolved_symbol_status": "not_requested", - "resolved_symbol": null, - "requested_layers": [ - "C0_SOURCE_CHUNKS" - ] - }, - "diagnostics": { - "executed_layers": [ - "C0_SOURCE_CHUNKS" - ], - "retrieval_mode_by_layer": { - "C0_SOURCE_CHUNKS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C0_SOURCE_CHUNKS": 200 - }, - "filters_by_layer": { - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src/plba/__init__.py" - ] - } - }, - "requests": [ - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Открой файл src/plba/__init__.py", - "ranking_profile": "code" - } - ], - "fallback": { - "used": false, - "reason": null - }, - "retrieval_by_layer_ms": { - "C0_SOURCE_CHUNKS": 24 - } - } - }, - { - "step": "pre_evidence_gate", - "status": "passed", - "timings_ms": { - "pre_evidence_gate": 1 - }, - "input": { - "resolved_target": "src/plba/__init__.py", - "sub_intent": "OPEN_FILE", - "target_type": "file", - "evidence_count": 1, - "code_chunk_count": 1, - "entrypoint_count": 0, - "relation_count": 0, - "test_evidence_count": 0, - "symbol_resolution_status": "not_requested", - "path_scope": [ - "src/plba/__init__.py" - ] - }, - "output": { - "passed": true, - "failure_reasons": [], - "degraded_message": "", - "evidence_count": 1 - } - }, - { - "step": "llm", - "status": "completed", - "timings_ms": { - "llm": 4851 - }, - "output": { - "prompt_name": "code_qa_open_file_answer", - "answer_preview": "Файл `src/plba/__init__.py` импортирует следующие основные компоненты:\n\n- Из `plba.bootstrap`: `create_runtime`\n- Из `plba.config`: `ConfigFileLoader`, `FileConfigProvider`\n- Из `plba.control`: `ControlActionSet`, `ControlChannel`, `ControlPlaneService`, `HttpControlChannel`\n- Из `plba.contracts`: н", - "resolved_target": "src/plba/__init__.py", - "answer_policy_branch": "normal_answer", - "decision_reason": "evidence_sufficient" - } - }, - { - "step": "post_evidence_gate", - "status": "passed", - "timings_ms": { - "post_evidence_gate": 1, - "post_evidence_gate_recheck": 0, - "repair": 0 - }, - "input": { - "answer_mode": "normal", - "degraded_message": "", - "resolved_target": "src/plba/__init__.py", - "draft_answer_preview": "Файл `src/plba/__init__.py` импортирует следующие основные компоненты:\n\n- Из `plba.bootstrap`: `create_runtime`\n- Из `plba.config`: `ConfigFileLoader`, `FileConfigProvider`\n- Из `plba.control`: `ControlActionSet`, `ControlChannel`, `ControlPlaneService`, `HttpControlChannel`\n- Из `plba.contracts`: н", - "repair_candidate": true - }, - "output": { - "passed": true, - "action": "return", - "reasons": [], - "repair_used": false, - "final_answer_preview": "Файл `src/plba/__init__.py` импортирует следующие основные компоненты:\n\n- Из `plba.bootstrap`: `create_runtime`\n- Из `plba.config`: `ConfigFileLoader`, `FileConfigProvider`\n- Из `plba.control`: `ControlActionSet`, `ControlChannel`, `ControlPlaneService`, `HttpControlChannel`\n- Из `plba.contracts`: н" - } - } - ] - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/plba_full_chain_subintents_v3/20260312_174008/full_chain_plba_code_subintents_v2_plba-v2-open-file-public-api.md b/tests/pipeline_setup_v3/test_results/plba_full_chain_subintents_v3/20260312_174008/full_chain_plba_code_subintents_v2_plba-v2-open-file-public-api.md deleted file mode 100644 index 60f4d37..0000000 --- a/tests/pipeline_setup_v3/test_results/plba_full_chain_subintents_v3/20260312_174008/full_chain_plba_code_subintents_v2_plba-v2-open-file-public-api.md +++ /dev/null @@ -1,250 +0,0 @@ -# plba-v2-open-file-public-api - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_02_pipeline/full_chain_plba_code_subintents_v2.yaml -- runner: agent_runtime -- mode: full_chain -- passed: True - -## Query -Открой файл src/plba/__init__.py - -## Actual -{ - "intent": "CODE_QA", - "sub_intent": "OPEN_FILE", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 1, - "llm_answer": "Файл `src/plba/__init__.py` импортирует следующие основные компоненты:\n\n- Из `plba.bootstrap`: `create_runtime`\n- Из `plba.config`: `ConfigFileLoader`, `FileConfigProvider`\n- Из `plba.control`: `ControlActionSet`, `ControlChannel`, `ControlPlaneService`, `HttpControlChannel`\n- Из `plba.contracts`: несколько контрактов, таких как `ApplicationModule`, `ConfigProvider`, `Worker`, `WorkerHealth`\n- Из `plba.core`: `ConfigurationManager`, `RuntimeManager`, `ServiceContainer`\n- Из `plba.health`: `HealthRegistry`\n- Из `plba.logging`: `LogManager`\n- Из `plba.queue`: `InMemoryTaskQueue`\n- Из `plba.tracing`: `MySqlTraceTransport`, `NoOpTraceTransport`, `TraceService`\n- Из `plba.workflow`: различные классы для работы с workflow\n\nЭто инициализационный скрипт пакета `plba`, обеспечивающий доступ ко всем основным функциональным блокам пакета.", - "answer_mode": "answered", - "path_scope": [ - "src/plba/__init__.py" - ], - "symbol_candidates": [], - "layers": [ - "C0_SOURCE_CHUNKS" - ] -} - -## Steps -[ - { - "step": "router", - "status": "completed", - "timings_ms": { - "router": 1 - }, - "output": { - "intent": "CODE_QA", - "sub_intent": "OPEN_FILE", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - } - }, - { - "step": "retrieval", - "status": "completed", - "timings_ms": { - "retrieval": 25 - }, - "output": { - "rag_count": 1, - "answer_path_rag_count": 1, - "resolved_symbol_status": "not_requested", - "resolved_symbol": null, - "requested_layers": [ - "C0_SOURCE_CHUNKS" - ] - }, - "diagnostics": { - "executed_layers": [ - "C0_SOURCE_CHUNKS" - ], - "retrieval_mode_by_layer": { - "C0_SOURCE_CHUNKS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C0_SOURCE_CHUNKS": 200 - }, - "filters_by_layer": { - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src/plba/__init__.py" - ] - } - }, - "requests": [ - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Открой файл src/plba/__init__.py", - "ranking_profile": "code" - } - ], - "fallback": { - "used": false, - "reason": null - }, - "retrieval_by_layer_ms": { - "C0_SOURCE_CHUNKS": 24 - } - } - }, - { - "step": "pre_evidence_gate", - "status": "passed", - "timings_ms": { - "pre_evidence_gate": 1 - }, - "input": { - "resolved_target": "src/plba/__init__.py", - "sub_intent": "OPEN_FILE", - "target_type": "file", - "evidence_count": 1, - "code_chunk_count": 1, - "entrypoint_count": 0, - "relation_count": 0, - "test_evidence_count": 0, - "symbol_resolution_status": "not_requested", - "path_scope": [ - "src/plba/__init__.py" - ] - }, - "output": { - "passed": true, - "failure_reasons": [], - "degraded_message": "", - "evidence_count": 1 - } - }, - { - "step": "llm", - "status": "completed", - "timings_ms": { - "llm": 4851 - }, - "output": { - "prompt_name": "code_qa_open_file_answer", - "answer_preview": "Файл `src/plba/__init__.py` импортирует следующие основные компоненты:\n\n- Из `plba.bootstrap`: `create_runtime`\n- Из `plba.config`: `ConfigFileLoader`, `FileConfigProvider`\n- Из `plba.control`: `ControlActionSet`, `ControlChannel`, `ControlPlaneService`, `HttpControlChannel`\n- Из `plba.contracts`: н", - "resolved_target": "src/plba/__init__.py", - "answer_policy_branch": "normal_answer", - "decision_reason": "evidence_sufficient" - } - }, - { - "step": "post_evidence_gate", - "status": "passed", - "timings_ms": { - "post_evidence_gate": 1, - "post_evidence_gate_recheck": 0, - "repair": 0 - }, - "input": { - "answer_mode": "normal", - "degraded_message": "", - "resolved_target": "src/plba/__init__.py", - "draft_answer_preview": "Файл `src/plba/__init__.py` импортирует следующие основные компоненты:\n\n- Из `plba.bootstrap`: `create_runtime`\n- Из `plba.config`: `ConfigFileLoader`, `FileConfigProvider`\n- Из `plba.control`: `ControlActionSet`, `ControlChannel`, `ControlPlaneService`, `HttpControlChannel`\n- Из `plba.contracts`: н", - "repair_candidate": true - }, - "output": { - "passed": true, - "action": "return", - "reasons": [], - "repair_used": false, - "final_answer_preview": "Файл `src/plba/__init__.py` импортирует следующие основные компоненты:\n\n- Из `plba.bootstrap`: `create_runtime`\n- Из `plba.config`: `ConfigFileLoader`, `FileConfigProvider`\n- Из `plba.control`: `ControlActionSet`, `ControlChannel`, `ControlPlaneService`, `HttpControlChannel`\n- Из `plba.contracts`: н" - } - } -] - -## Diagnostics -{ - "intent_correct": null, - "target_found": true, - "layers_used": [ - "C0_SOURCE_CHUNKS" - ], - "retrieval_sufficient": true, - "answer_mode": "normal", - "resolved_target": "src/plba/__init__.py", - "answer_policy_branch": "normal_answer", - "decision_reason": "evidence_sufficient", - "router_result": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "retrieval_profile": "code", - "sub_intent": "OPEN_FILE", - "path_scope": [ - "src/plba/__init__.py" - ], - "layers": [ - "C0_SOURCE_CHUNKS" - ], - "symbol_resolution_status": "not_requested" - }, - "retrieval_request": { - "rag_session_id": "7d11da21-faa0-4cea-aede-aeabe069164c", - "query": "Открой файл src/plba/__init__.py", - "sub_intent": "OPEN_FILE", - "path_scope": [ - "src/plba/__init__.py" - ], - "requested_layers": [ - "C0_SOURCE_CHUNKS" - ] - }, - "per_layer_outcome": [ - { - "layer_id": "C0_SOURCE_CHUNKS", - "hit_count": 1, - "empty": false, - "fallback_used": false - } - ], - "empty_layers": [], - "evidence_gate_decision": { - "sufficient": true, - "failure_reasons": [], - "evidence_count": 1 - }, - "evidence_gate_input": { - "resolved_target": "src/plba/__init__.py", - "sub_intent": "OPEN_FILE", - "target_type": "file", - "evidence_count": 1, - "code_chunk_count": 1, - "entrypoint_count": 0, - "relation_count": 0, - "test_evidence_count": 0, - "symbol_resolution_status": "not_requested", - "path_scope": [ - "src/plba/__init__.py" - ] - }, - "post_evidence_gate": { - "input": { - "answer_mode": "normal", - "degraded_message": "", - "resolved_target": "src/plba/__init__.py", - "draft_answer_preview": "Файл `src/plba/__init__.py` импортирует следующие основные компоненты:\n\n- Из `plba.bootstrap`: `create_runtime`\n- Из `plba.config`: `ConfigFileLoader`, `FileConfigProvider`\n- Из `plba.control`: `ControlActionSet`, `ControlChannel`, `ControlPlaneService`, `HttpControlChannel`\n- Из `plba.contracts`: н", - "repair_candidate": true - }, - "output": { - "passed": true, - "action": "return", - "reasons": [], - "repair_used": false, - "final_answer_preview": "Файл `src/plba/__init__.py` импортирует следующие основные компоненты:\n\n- Из `plba.bootstrap`: `create_runtime`\n- Из `plba.config`: `ConfigFileLoader`, `FileConfigProvider`\n- Из `plba.control`: `ControlActionSet`, `ControlChannel`, `ControlPlaneService`, `HttpControlChannel`\n- Из `plba.contracts`: н" - } - }, - "failure_reasons": [], - "timings_ms": { - "router": 1, - "retrieval": 25, - "pre_evidence_gate": 1, - "llm": 4851, - "post_evidence_gate": 1 - } -} - -## Mismatches -- none \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/plba_full_chain_subintents_v3/20260312_174008/full_chain_plba_code_subintents_v2_plba-v2-open-file-runtime.json b/tests/pipeline_setup_v3/test_results/plba_full_chain_subintents_v3/20260312_174008/full_chain_plba_code_subintents_v2_plba-v2-open-file-runtime.json deleted file mode 100644 index 6ddbd1d..0000000 --- a/tests/pipeline_setup_v3/test_results/plba_full_chain_subintents_v3/20260312_174008/full_chain_plba_code_subintents_v2_plba-v2-open-file-runtime.json +++ /dev/null @@ -1,583 +0,0 @@ -{ - "case_id": "plba-v2-open-file-runtime", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_02_pipeline/full_chain_plba_code_subintents_v2.yaml", - "runner": "agent_runtime", - "mode": "full_chain", - "query": "Открой файл src/app_runtime/core/runtime.py", - "actual": { - "intent": "CODE_QA", - "sub_intent": "OPEN_FILE", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 1, - "llm_answer": "В файле `src/app_runtime/core/runtime.py` определён класс `RuntimeManager`.\nУ него есть несколько атрибутов класса:\n- `ACTION_TIMEOUT_SECONDS = 10.0`\n- `ACTION_POLL_INTERVAL_SECONDS = 0.05`\n\nВ конструкторе (`__init__`) инициализируются следующие поля объекта:\n- `configuration`: экземпляр `ConfigurationManager`\n- `services`: экземпляр `ServiceContainer`\n- `traces`: экземпляр `TraceService`\n- `health`: экземпляр `HealthRegistry`\n- `logs`: экземпляр `LogManager`\n- `workers`: экземпляр `WorkerSupervisor`\n- `control_plane`: экземпляр `ControlPlaneService`\n\nВсе эти поля могут принимать значения по умолчанию, если при создании объекта явные аргументы не указаны.", - "answer_mode": "answered", - "path_scope": [ - "src/app_runtime/core/runtime.py" - ], - "symbol_candidates": [], - "layers": [ - "C0_SOURCE_CHUNKS" - ] - }, - "passed": true, - "mismatches": [], - "details": { - "query": "Открой файл src/app_runtime/core/runtime.py", - "router_result": { - "schema_version": "1.1", - "intent": "CODE_QA", - "retrieval_profile": "code", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query_plan": { - "raw": "Открой файл src/app_runtime/core/runtime.py", - "normalized": "Открой файл src/app_runtime/core/runtime.py", - "sub_intent": "OPEN_FILE", - "negations": [], - "expansions": [ - "file" - ], - "keyword_hints": [], - "path_hints": [ - "src/app_runtime/core/runtime.py" - ], - "doc_scope_hints": [], - "symbol_candidates": [], - "symbol_kind_hint": "unknown", - "anchors": [ - { - "type": "FILE_PATH", - "value": "src/app_runtime/core/runtime.py", - "source": "user_text", - "subtype": null, - "span": { - "start": 12, - "end": 43 - }, - "confidence": 0.95 - }, - { - "type": "KEY_TERM", - "value": "файл", - "source": "user_text", - "subtype": null, - "span": { - "start": 7, - "end": 11 - }, - "confidence": 0.9 - } - ] - }, - "retrieval_spec": { - "domains": [ - "CODE" - ], - "layer_queries": [ - { - "layer_id": "C0_SOURCE_CHUNKS", - "top_k": 12 - } - ], - "filters": { - "test_policy": "EXCLUDE", - "path_scope": [ - "src/app_runtime/core/runtime.py" - ], - "language": [ - "python" - ] - }, - "rerank_profile": "code" - }, - "retrieval_constraints": { - "include_globs": [ - "src/app_runtime/core/runtime.py" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": false, - "max_distance": 2, - "top_k": 5 - } - }, - "symbol_resolution": { - "status": "not_requested", - "resolved_symbol": null, - "alternatives": [], - "confidence": 0.0 - }, - "evidence_policy": { - "require_def": false, - "require_flow": false, - "require_spec": false, - "allow_answer_without_evidence": false - } - }, - "retrieval_request": { - "rag_session_id": "7d11da21-faa0-4cea-aede-aeabe069164c", - "query": "Открой файл src/app_runtime/core/runtime.py", - "sub_intent": "OPEN_FILE", - "path_scope": [ - "src/app_runtime/core/runtime.py" - ], - "keyword_hints": [], - "symbol_candidates": [], - "requested_layers": [ - "C0_SOURCE_CHUNKS" - ], - "retrieval_spec": { - "domains": [ - "CODE" - ], - "layer_queries": [ - { - "layer_id": "C0_SOURCE_CHUNKS", - "top_k": 12 - } - ], - "filters": { - "test_policy": "EXCLUDE", - "path_scope": [ - "src/app_runtime/core/runtime.py" - ], - "language": [ - "python" - ] - }, - "rerank_profile": "code" - }, - "retrieval_constraints": { - "include_globs": [ - "src/app_runtime/core/runtime.py" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": false, - "max_distance": 2, - "top_k": 5 - } - }, - "query_plan": { - "raw": "Открой файл src/app_runtime/core/runtime.py", - "normalized": "Открой файл src/app_runtime/core/runtime.py", - "sub_intent": "OPEN_FILE", - "negations": [], - "expansions": [ - "file" - ], - "keyword_hints": [], - "path_hints": [ - "src/app_runtime/core/runtime.py" - ], - "doc_scope_hints": [], - "symbol_candidates": [], - "symbol_kind_hint": "unknown", - "anchors": [ - { - "type": "FILE_PATH", - "value": "src/app_runtime/core/runtime.py", - "source": "user_text", - "subtype": null, - "span": { - "start": 12, - "end": 43 - }, - "confidence": 0.95 - }, - { - "type": "KEY_TERM", - "value": "файл", - "source": "user_text", - "subtype": null, - "span": { - "start": 7, - "end": 11 - }, - "confidence": 0.9 - } - ] - } - }, - "retrieval_result": { - "target_symbol_candidates": [], - "resolved_symbol": null, - "symbol_resolution_status": "not_requested", - "file_candidates": [ - "src/app_runtime/core/runtime.py" - ], - "code_chunks": [ - { - "layer": "C0_SOURCE_CHUNKS", - "path": "src/app_runtime/core/runtime.py", - "title": "src/app_runtime/core/runtime.py:RuntimeManager", - "content": "class RuntimeManager:\n ACTION_TIMEOUT_SECONDS = 10.0\n ACTION_POLL_INTERVAL_SECONDS = 0.05\n\n def __init__(\n self,\n configuration: ConfigurationManager | None = None,\n services: ServiceContainer | None = None,\n traces: TraceService | None = None,\n health: HealthRegistry | None = None,\n logs: LogManager | None = None,\n workers: WorkerSupervisor | None = None,\n control_plane: ControlPlaneService | None = None,\n ) -> None:\n self.configuration = configuration or ConfigurationManager()\n self.services = services or ServiceContainer()\n self.traces = traces or TraceService()\n self.health = health or HealthRegistry()\n self.logs = logs or LogManager()\n self.workers = workers or WorkerSupervisor()\n self.control_plane = control_plane or ControlPlaneService()\n self.registry = ModuleRegistry(self.services)\n self._started = False\n self._state = LifecycleState.IDLE\n self._core_registered = False\n self._workers_registered = False\n self._register_core_services()\n\n def register_module(self, module: ApplicationModule) -> None:\n self.registry.register_module(module.name)\n module.register(self.registry)\n\n def add_config_file(self, path: str) -> FileConfigProvider:\n provider = FileConfigProvider(path)\n self.configuration.add_provider(provider)\n return provider\n\n def start(self, *, start_control_plane: bool = True) -> None:\n if self._started:\n return\n self._state = LifecycleState.STARTING\n config = self.configuration.load()\n self.logs.apply_config(config)\n self._register_health_contributors()\n self._register_workers()\n self.workers.start()\n if start_control_plane:\n self.control_plane.start(self)\n self._started = True\n self._refresh_state()\n\n def stop(self, timeout: float = 30.0, force: bool = False, stop_control_plane: bool = True) -> None:\n if not self._started:\n return\n self._state = LifecycleState.STOPPING\n self.workers.stop(timeout=timeout, force=force)\n if stop_control_plane:\n self.control_plane.stop()\n self._started = False\n self._state = LifecycleState.STOPPED\n\n def status(self) -> dict[str, object]:\n self._refresh_state()\n return self.control_plane.snapshot(self)\n\n def current_health(self) -> HealthPayload:\n self._refresh_state()\n return self.health.payload(self._state, self.workers.healths())\n\n async def health_status(self) -> HealthPayload:\n return self.current_health()\n\n async def start_runtime(self) -> dict[str, object] | str:\n self._refresh_state()\n if self._started:\n return \"runtime already running\"\n if self._state == LifecycleState.STOPPING:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n\n self.start(start_control_plane=False)\n started = self._wait_for_state({LifecycleState.IDLE, LifecycleState.BUSY}, timeout=self.ACTION_TIMEOUT_SECONDS)\n if started:\n return self._action_detail(\"runtime started\", timed_out=False)\n return self._action_detail(\"runtime start is still in progress\", timed_out=True)\n\n async def stop_runtime(self) -> dict[str, object] | str:\n self._refresh_state()\n if not self._started:\n if self._state == LifecycleState.STOPPING:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n return \"runtime already stopped\"\n\n self._state = LifecycleState.STOPPING\n try:\n self.workers.stop(timeout=self.ACTION_TIMEOUT_SECONDS, force=False)\n except TimeoutError:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n\n self._started = False\n self._state = LifecycleState.STOPPED\n return self._action_detail(\"runtime stopped\", timed_out=False)\n\n async def runtime_status(self) -> str:\n self._refresh_state()\n return self._state.value\n\n def _register_core_services(self) -> None:\n if self._core_registered:\n return\n self.services.register(\"configuration\", self.configuration)\n self.services.register(\"traces\", self.traces)\n self.services.register(\"health\", self.health)\n self.services.register(\"logs\", self.logs)\n self.services.register(\"workers\", self.workers)\n self.services.register(\"control_plane\", self.control_plane)\n self._core_registered = True\n\n def _register_health_contributors(self) -> None:\n for contributor in self.registry.health_contributors:\n self.health.register(contributor)\n\n def _register_workers(self) -> None:\n if self._workers_registered:\n return\n for worker in self.registry.workers:\n self.workers.register(worker)\n self._workers_registered = True\n\n def _refresh_state(self) -> None:\n lifecycle = self.workers.lifecycle_state()\n\n if self._state == LifecycleState.STOPPING:\n if lifecycle == LifecycleState.STOPPED:\n self._started = False\n self._state = LifecycleState.STOPPED\n return\n\n if not self._started:\n if lifecycle == LifecycleState.STOPPED:\n self._state = LifecycleState.STOPPED\n return\n\n self._state = lifecycle\n\n def _wait_for_state(self, target_states: set[LifecycleState], *, timeout: float) -> bool:\n deadline = monotonic() + timeout\n while monotonic() < deadline:\n self._refresh_state()\n if self._state in target_states:\n return True\n sleep(self.ACTION_POLL_INTERVAL_SECONDS)\n self._refresh_state()\n return self._state in target_states\n\n def _action_detail(self, message: str, *, timed_out: bool) -> dict[str, object]:\n self._refresh_state()\n return {\n \"message\": message,\n \"state\": self._state.value,\n \"timed_out\": timed_out,\n \"workers\": self.workers.snapshot(),\n }", - "start_line": 18, - "end_line": 179, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.core.runtime", - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "relations": [], - "entrypoints": [], - "test_candidates": [], - "layer_outcomes": [ - { - "layer_id": "C0_SOURCE_CHUNKS", - "hit_count": 1, - "empty": false, - "fallback_used": false - } - ], - "missing_layers": [], - "raw_rows": [ - { - "path": "src/app_runtime/core/runtime.py", - "content": "class RuntimeManager:\n ACTION_TIMEOUT_SECONDS = 10.0\n ACTION_POLL_INTERVAL_SECONDS = 0.05\n\n def __init__(\n self,\n configuration: ConfigurationManager | None = None,\n services: ServiceContainer | None = None,\n traces: TraceService | None = None,\n health: HealthRegistry | None = None,\n logs: LogManager | None = None,\n workers: WorkerSupervisor | None = None,\n control_plane: ControlPlaneService | None = None,\n ) -> None:\n self.configuration = configuration or ConfigurationManager()\n self.services = services or ServiceContainer()\n self.traces = traces or TraceService()\n self.health = health or HealthRegistry()\n self.logs = logs or LogManager()\n self.workers = workers or WorkerSupervisor()\n self.control_plane = control_plane or ControlPlaneService()\n self.registry = ModuleRegistry(self.services)\n self._started = False\n self._state = LifecycleState.IDLE\n self._core_registered = False\n self._workers_registered = False\n self._register_core_services()\n\n def register_module(self, module: ApplicationModule) -> None:\n self.registry.register_module(module.name)\n module.register(self.registry)\n\n def add_config_file(self, path: str) -> FileConfigProvider:\n provider = FileConfigProvider(path)\n self.configuration.add_provider(provider)\n return provider\n\n def start(self, *, start_control_plane: bool = True) -> None:\n if self._started:\n return\n self._state = LifecycleState.STARTING\n config = self.configuration.load()\n self.logs.apply_config(config)\n self._register_health_contributors()\n self._register_workers()\n self.workers.start()\n if start_control_plane:\n self.control_plane.start(self)\n self._started = True\n self._refresh_state()\n\n def stop(self, timeout: float = 30.0, force: bool = False, stop_control_plane: bool = True) -> None:\n if not self._started:\n return\n self._state = LifecycleState.STOPPING\n self.workers.stop(timeout=timeout, force=force)\n if stop_control_plane:\n self.control_plane.stop()\n self._started = False\n self._state = LifecycleState.STOPPED\n\n def status(self) -> dict[str, object]:\n self._refresh_state()\n return self.control_plane.snapshot(self)\n\n def current_health(self) -> HealthPayload:\n self._refresh_state()\n return self.health.payload(self._state, self.workers.healths())\n\n async def health_status(self) -> HealthPayload:\n return self.current_health()\n\n async def start_runtime(self) -> dict[str, object] | str:\n self._refresh_state()\n if self._started:\n return \"runtime already running\"\n if self._state == LifecycleState.STOPPING:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n\n self.start(start_control_plane=False)\n started = self._wait_for_state({LifecycleState.IDLE, LifecycleState.BUSY}, timeout=self.ACTION_TIMEOUT_SECONDS)\n if started:\n return self._action_detail(\"runtime started\", timed_out=False)\n return self._action_detail(\"runtime start is still in progress\", timed_out=True)\n\n async def stop_runtime(self) -> dict[str, object] | str:\n self._refresh_state()\n if not self._started:\n if self._state == LifecycleState.STOPPING:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n return \"runtime already stopped\"\n\n self._state = LifecycleState.STOPPING\n try:\n self.workers.stop(timeout=self.ACTION_TIMEOUT_SECONDS, force=False)\n except TimeoutError:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n\n self._started = False\n self._state = LifecycleState.STOPPED\n return self._action_detail(\"runtime stopped\", timed_out=False)\n\n async def runtime_status(self) -> str:\n self._refresh_state()\n return self._state.value\n\n def _register_core_services(self) -> None:\n if self._core_registered:\n return\n self.services.register(\"configuration\", self.configuration)\n self.services.register(\"traces\", self.traces)\n self.services.register(\"health\", self.health)\n self.services.register(\"logs\", self.logs)\n self.services.register(\"workers\", self.workers)\n self.services.register(\"control_plane\", self.control_plane)\n self._core_registered = True\n\n def _register_health_contributors(self) -> None:\n for contributor in self.registry.health_contributors:\n self.health.register(contributor)\n\n def _register_workers(self) -> None:\n if self._workers_registered:\n return\n for worker in self.registry.workers:\n self.workers.register(worker)\n self._workers_registered = True\n\n def _refresh_state(self) -> None:\n lifecycle = self.workers.lifecycle_state()\n\n if self._state == LifecycleState.STOPPING:\n if lifecycle == LifecycleState.STOPPED:\n self._started = False\n self._state = LifecycleState.STOPPED\n return\n\n if not self._started:\n if lifecycle == LifecycleState.STOPPED:\n self._state = LifecycleState.STOPPED\n return\n\n self._state = lifecycle\n\n def _wait_for_state(self, target_states: set[LifecycleState], *, timeout: float) -> bool:\n deadline = monotonic() + timeout\n while monotonic() < deadline:\n self._refresh_state()\n if self._state in target_states:\n return True\n sleep(self.ACTION_POLL_INTERVAL_SECONDS)\n self._refresh_state()\n return self._state in target_states\n\n def _action_detail(self, message: str, *, timed_out: bool) -> dict[str, object]:\n self._refresh_state()\n return {\n \"message\": message,\n \"state\": self._state.value,\n \"timed_out\": timed_out,\n \"workers\": self.workers.snapshot(),\n }", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/core/runtime.py:RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.core.runtime", - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "retrieval_report": { - "executed_layers": [ - "C0_SOURCE_CHUNKS" - ], - "retrieval_mode_by_layer": { - "C0_SOURCE_CHUNKS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C0_SOURCE_CHUNKS": 200 - }, - "filters_by_layer": { - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src/app_runtime/core/runtime.py" - ] - } - }, - "requests": [ - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Открой файл src/app_runtime/core/runtime.py", - "ranking_profile": "code" - } - ], - "fallback": { - "used": false, - "reason": null - }, - "retrieval_by_layer_ms": { - "C0_SOURCE_CHUNKS": 136 - } - } - }, - "diagnostics": { - "intent_correct": null, - "target_found": true, - "layers_used": [ - "C0_SOURCE_CHUNKS" - ], - "retrieval_sufficient": true, - "answer_mode": "normal", - "resolved_target": "src/app_runtime/core/runtime.py", - "answer_policy_branch": "normal_answer", - "decision_reason": "evidence_sufficient", - "router_result": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "retrieval_profile": "code", - "sub_intent": "OPEN_FILE", - "path_scope": [ - "src/app_runtime/core/runtime.py" - ], - "layers": [ - "C0_SOURCE_CHUNKS" - ], - "symbol_resolution_status": "not_requested" - }, - "retrieval_request": { - "rag_session_id": "7d11da21-faa0-4cea-aede-aeabe069164c", - "query": "Открой файл src/app_runtime/core/runtime.py", - "sub_intent": "OPEN_FILE", - "path_scope": [ - "src/app_runtime/core/runtime.py" - ], - "requested_layers": [ - "C0_SOURCE_CHUNKS" - ] - }, - "per_layer_outcome": [ - { - "layer_id": "C0_SOURCE_CHUNKS", - "hit_count": 1, - "empty": false, - "fallback_used": false - } - ], - "empty_layers": [], - "evidence_gate_decision": { - "sufficient": true, - "failure_reasons": [], - "evidence_count": 1 - }, - "evidence_gate_input": { - "resolved_target": "src/app_runtime/core/runtime.py", - "sub_intent": "OPEN_FILE", - "target_type": "file", - "evidence_count": 1, - "code_chunk_count": 1, - "entrypoint_count": 0, - "relation_count": 0, - "test_evidence_count": 0, - "symbol_resolution_status": "not_requested", - "path_scope": [ - "src/app_runtime/core/runtime.py" - ] - }, - "post_evidence_gate": { - "input": { - "answer_mode": "normal", - "degraded_message": "", - "resolved_target": "src/app_runtime/core/runtime.py", - "draft_answer_preview": "В файле `src/app_runtime/core/runtime.py` определён класс `RuntimeManager`.\nУ него есть несколько атрибутов класса:\n- `ACTION_TIMEOUT_SECONDS = 10.0`\n- `ACTION_POLL_INTERVAL_SECONDS = 0.05`\n\nВ конструкторе (`__init__`) инициализируются следующие поля объекта:\n- `configuration`: экземпляр `Configurat", - "repair_candidate": true - }, - "output": { - "passed": true, - "action": "return", - "reasons": [], - "repair_used": false, - "final_answer_preview": "В файле `src/app_runtime/core/runtime.py` определён класс `RuntimeManager`.\nУ него есть несколько атрибутов класса:\n- `ACTION_TIMEOUT_SECONDS = 10.0`\n- `ACTION_POLL_INTERVAL_SECONDS = 0.05`\n\nВ конструкторе (`__init__`) инициализируются следующие поля объекта:\n- `configuration`: экземпляр `Configurat" - } - }, - "failure_reasons": [], - "timings_ms": { - "router": 1, - "retrieval": 137, - "pre_evidence_gate": 1, - "llm": 3254, - "post_evidence_gate": 1 - } - }, - "rag_rows": [ - { - "path": "src/app_runtime/core/runtime.py", - "content": "class RuntimeManager:\n ACTION_TIMEOUT_SECONDS = 10.0\n ACTION_POLL_INTERVAL_SECONDS = 0.05\n\n def __init__(\n self,\n configuration: ConfigurationManager | None = None,\n services: ServiceContainer | None = None,\n traces: TraceService | None = None,\n health: HealthRegistry | None = None,\n logs: LogManager | None = None,\n workers: WorkerSupervisor | None = None,\n control_plane: ControlPlaneService | None = None,\n ) -> None:\n self.configuration = configuration or ConfigurationManager()\n self.services = services or ServiceContainer()\n self.traces = traces or TraceService()\n self.health = health or HealthRegistry()\n self.logs = logs or LogManager()\n self.workers = workers or WorkerSupervisor()\n self.control_plane = control_plane or ControlPlaneService()\n self.registry = ModuleRegistry(self.services)\n self._started = False\n self._state = LifecycleState.IDLE\n self._core_registered = False\n self._workers_registered = False\n self._register_core_services()\n\n def register_module(self, module: ApplicationModule) -> None:\n self.registry.register_module(module.name)\n module.register(self.registry)\n\n def add_config_file(self, path: str) -> FileConfigProvider:\n provider = FileConfigProvider(path)\n self.configuration.add_provider(provider)\n return provider\n\n def start(self, *, start_control_plane: bool = True) -> None:\n if self._started:\n return\n self._state = LifecycleState.STARTING\n config = self.configuration.load()\n self.logs.apply_config(config)\n self._register_health_contributors()\n self._register_workers()\n self.workers.start()\n if start_control_plane:\n self.control_plane.start(self)\n self._started = True\n self._refresh_state()\n\n def stop(self, timeout: float = 30.0, force: bool = False, stop_control_plane: bool = True) -> None:\n if not self._started:\n return\n self._state = LifecycleState.STOPPING\n self.workers.stop(timeout=timeout, force=force)\n if stop_control_plane:\n self.control_plane.stop()\n self._started = False\n self._state = LifecycleState.STOPPED\n\n def status(self) -> dict[str, object]:\n self._refresh_state()\n return self.control_plane.snapshot(self)\n\n def current_health(self) -> HealthPayload:\n self._refresh_state()\n return self.health.payload(self._state, self.workers.healths())\n\n async def health_status(self) -> HealthPayload:\n return self.current_health()\n\n async def start_runtime(self) -> dict[str, object] | str:\n self._refresh_state()\n if self._started:\n return \"runtime already running\"\n if self._state == LifecycleState.STOPPING:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n\n self.start(start_control_plane=False)\n started = self._wait_for_state({LifecycleState.IDLE, LifecycleState.BUSY}, timeout=self.ACTION_TIMEOUT_SECONDS)\n if started:\n return self._action_detail(\"runtime started\", timed_out=False)\n return self._action_detail(\"runtime start is still in progress\", timed_out=True)\n\n async def stop_runtime(self) -> dict[str, object] | str:\n self._refresh_state()\n if not self._started:\n if self._state == LifecycleState.STOPPING:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n return \"runtime already stopped\"\n\n self._state = LifecycleState.STOPPING\n try:\n self.workers.stop(timeout=self.ACTION_TIMEOUT_SECONDS, force=False)\n except TimeoutError:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n\n self._started = False\n self._state = LifecycleState.STOPPED\n return self._action_detail(\"runtime stopped\", timed_out=False)\n\n async def runtime_status(self) -> str:\n self._refresh_state()\n return self._state.value\n\n def _register_core_services(self) -> None:\n if self._core_registered:\n return\n self.services.register(\"configuration\", self.configuration)\n self.services.register(\"traces\", self.traces)\n self.services.register(\"health\", self.health)\n self.services.register(\"logs\", self.logs)\n self.services.register(\"workers\", self.workers)\n self.services.register(\"control_plane\", self.control_plane)\n self._core_registered = True\n\n def _register_health_contributors(self) -> None:\n for contributor in self.registry.health_contributors:\n self.health.register(contributor)\n\n def _register_workers(self) -> None:\n if self._workers_registered:\n return\n for worker in self.registry.workers:\n self.workers.register(worker)\n self._workers_registered = True\n\n def _refresh_state(self) -> None:\n lifecycle = self.workers.lifecycle_state()\n\n if self._state == LifecycleState.STOPPING:\n if lifecycle == LifecycleState.STOPPED:\n self._started = False\n self._state = LifecycleState.STOPPED\n return\n\n if not self._started:\n if lifecycle == LifecycleState.STOPPED:\n self._state = LifecycleState.STOPPED\n return\n\n self._state = lifecycle\n\n def _wait_for_state(self, target_states: set[LifecycleState], *, timeout: float) -> bool:\n deadline = monotonic() + timeout\n while monotonic() < deadline:\n self._refresh_state()\n if self._state in target_states:\n return True\n sleep(self.ACTION_POLL_INTERVAL_SECONDS)\n self._refresh_state()\n return self._state in target_states\n\n def _action_detail(self, message: str, *, timed_out: bool) -> dict[str, object]:\n self._refresh_state()\n return {\n \"message\": message,\n \"state\": self._state.value,\n \"timed_out\": timed_out,\n \"workers\": self.workers.snapshot(),\n }", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/core/runtime.py:RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.core.runtime", - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "validation": { - "passed": true, - "action": "return", - "reasons": [] - }, - "steps": [ - { - "step": "router", - "status": "completed", - "timings_ms": { - "router": 1 - }, - "output": { - "intent": "CODE_QA", - "sub_intent": "OPEN_FILE", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - } - }, - { - "step": "retrieval", - "status": "completed", - "timings_ms": { - "retrieval": 137 - }, - "output": { - "rag_count": 1, - "answer_path_rag_count": 1, - "resolved_symbol_status": "not_requested", - "resolved_symbol": null, - "requested_layers": [ - "C0_SOURCE_CHUNKS" - ] - }, - "diagnostics": { - "executed_layers": [ - "C0_SOURCE_CHUNKS" - ], - "retrieval_mode_by_layer": { - "C0_SOURCE_CHUNKS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C0_SOURCE_CHUNKS": 200 - }, - "filters_by_layer": { - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src/app_runtime/core/runtime.py" - ] - } - }, - "requests": [ - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Открой файл src/app_runtime/core/runtime.py", - "ranking_profile": "code" - } - ], - "fallback": { - "used": false, - "reason": null - }, - "retrieval_by_layer_ms": { - "C0_SOURCE_CHUNKS": 136 - } - } - }, - { - "step": "pre_evidence_gate", - "status": "passed", - "timings_ms": { - "pre_evidence_gate": 1 - }, - "input": { - "resolved_target": "src/app_runtime/core/runtime.py", - "sub_intent": "OPEN_FILE", - "target_type": "file", - "evidence_count": 1, - "code_chunk_count": 1, - "entrypoint_count": 0, - "relation_count": 0, - "test_evidence_count": 0, - "symbol_resolution_status": "not_requested", - "path_scope": [ - "src/app_runtime/core/runtime.py" - ] - }, - "output": { - "passed": true, - "failure_reasons": [], - "degraded_message": "", - "evidence_count": 1 - } - }, - { - "step": "llm", - "status": "completed", - "timings_ms": { - "llm": 3254 - }, - "output": { - "prompt_name": "code_qa_open_file_answer", - "answer_preview": "В файле `src/app_runtime/core/runtime.py` определён класс `RuntimeManager`.\nУ него есть несколько атрибутов класса:\n- `ACTION_TIMEOUT_SECONDS = 10.0`\n- `ACTION_POLL_INTERVAL_SECONDS = 0.05`\n\nВ конструкторе (`__init__`) инициализируются следующие поля объекта:\n- `configuration`: экземпляр `Configurat", - "resolved_target": "src/app_runtime/core/runtime.py", - "answer_policy_branch": "normal_answer", - "decision_reason": "evidence_sufficient" - } - }, - { - "step": "post_evidence_gate", - "status": "passed", - "timings_ms": { - "post_evidence_gate": 1, - "post_evidence_gate_recheck": 0, - "repair": 0 - }, - "input": { - "answer_mode": "normal", - "degraded_message": "", - "resolved_target": "src/app_runtime/core/runtime.py", - "draft_answer_preview": "В файле `src/app_runtime/core/runtime.py` определён класс `RuntimeManager`.\nУ него есть несколько атрибутов класса:\n- `ACTION_TIMEOUT_SECONDS = 10.0`\n- `ACTION_POLL_INTERVAL_SECONDS = 0.05`\n\nВ конструкторе (`__init__`) инициализируются следующие поля объекта:\n- `configuration`: экземпляр `Configurat", - "repair_candidate": true - }, - "output": { - "passed": true, - "action": "return", - "reasons": [], - "repair_used": false, - "final_answer_preview": "В файле `src/app_runtime/core/runtime.py` определён класс `RuntimeManager`.\nУ него есть несколько атрибутов класса:\n- `ACTION_TIMEOUT_SECONDS = 10.0`\n- `ACTION_POLL_INTERVAL_SECONDS = 0.05`\n\nВ конструкторе (`__init__`) инициализируются следующие поля объекта:\n- `configuration`: экземпляр `Configurat" - } - } - ] - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/plba_full_chain_subintents_v3/20260312_174008/full_chain_plba_code_subintents_v2_plba-v2-open-file-runtime.md b/tests/pipeline_setup_v3/test_results/plba_full_chain_subintents_v3/20260312_174008/full_chain_plba_code_subintents_v2_plba-v2-open-file-runtime.md deleted file mode 100644 index 271d2e1..0000000 --- a/tests/pipeline_setup_v3/test_results/plba_full_chain_subintents_v3/20260312_174008/full_chain_plba_code_subintents_v2_plba-v2-open-file-runtime.md +++ /dev/null @@ -1,250 +0,0 @@ -# plba-v2-open-file-runtime - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_02_pipeline/full_chain_plba_code_subintents_v2.yaml -- runner: agent_runtime -- mode: full_chain -- passed: True - -## Query -Открой файл src/app_runtime/core/runtime.py - -## Actual -{ - "intent": "CODE_QA", - "sub_intent": "OPEN_FILE", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 1, - "llm_answer": "В файле `src/app_runtime/core/runtime.py` определён класс `RuntimeManager`.\nУ него есть несколько атрибутов класса:\n- `ACTION_TIMEOUT_SECONDS = 10.0`\n- `ACTION_POLL_INTERVAL_SECONDS = 0.05`\n\nВ конструкторе (`__init__`) инициализируются следующие поля объекта:\n- `configuration`: экземпляр `ConfigurationManager`\n- `services`: экземпляр `ServiceContainer`\n- `traces`: экземпляр `TraceService`\n- `health`: экземпляр `HealthRegistry`\n- `logs`: экземпляр `LogManager`\n- `workers`: экземпляр `WorkerSupervisor`\n- `control_plane`: экземпляр `ControlPlaneService`\n\nВсе эти поля могут принимать значения по умолчанию, если при создании объекта явные аргументы не указаны.", - "answer_mode": "answered", - "path_scope": [ - "src/app_runtime/core/runtime.py" - ], - "symbol_candidates": [], - "layers": [ - "C0_SOURCE_CHUNKS" - ] -} - -## Steps -[ - { - "step": "router", - "status": "completed", - "timings_ms": { - "router": 1 - }, - "output": { - "intent": "CODE_QA", - "sub_intent": "OPEN_FILE", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - } - }, - { - "step": "retrieval", - "status": "completed", - "timings_ms": { - "retrieval": 137 - }, - "output": { - "rag_count": 1, - "answer_path_rag_count": 1, - "resolved_symbol_status": "not_requested", - "resolved_symbol": null, - "requested_layers": [ - "C0_SOURCE_CHUNKS" - ] - }, - "diagnostics": { - "executed_layers": [ - "C0_SOURCE_CHUNKS" - ], - "retrieval_mode_by_layer": { - "C0_SOURCE_CHUNKS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C0_SOURCE_CHUNKS": 200 - }, - "filters_by_layer": { - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src/app_runtime/core/runtime.py" - ] - } - }, - "requests": [ - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Открой файл src/app_runtime/core/runtime.py", - "ranking_profile": "code" - } - ], - "fallback": { - "used": false, - "reason": null - }, - "retrieval_by_layer_ms": { - "C0_SOURCE_CHUNKS": 136 - } - } - }, - { - "step": "pre_evidence_gate", - "status": "passed", - "timings_ms": { - "pre_evidence_gate": 1 - }, - "input": { - "resolved_target": "src/app_runtime/core/runtime.py", - "sub_intent": "OPEN_FILE", - "target_type": "file", - "evidence_count": 1, - "code_chunk_count": 1, - "entrypoint_count": 0, - "relation_count": 0, - "test_evidence_count": 0, - "symbol_resolution_status": "not_requested", - "path_scope": [ - "src/app_runtime/core/runtime.py" - ] - }, - "output": { - "passed": true, - "failure_reasons": [], - "degraded_message": "", - "evidence_count": 1 - } - }, - { - "step": "llm", - "status": "completed", - "timings_ms": { - "llm": 3254 - }, - "output": { - "prompt_name": "code_qa_open_file_answer", - "answer_preview": "В файле `src/app_runtime/core/runtime.py` определён класс `RuntimeManager`.\nУ него есть несколько атрибутов класса:\n- `ACTION_TIMEOUT_SECONDS = 10.0`\n- `ACTION_POLL_INTERVAL_SECONDS = 0.05`\n\nВ конструкторе (`__init__`) инициализируются следующие поля объекта:\n- `configuration`: экземпляр `Configurat", - "resolved_target": "src/app_runtime/core/runtime.py", - "answer_policy_branch": "normal_answer", - "decision_reason": "evidence_sufficient" - } - }, - { - "step": "post_evidence_gate", - "status": "passed", - "timings_ms": { - "post_evidence_gate": 1, - "post_evidence_gate_recheck": 0, - "repair": 0 - }, - "input": { - "answer_mode": "normal", - "degraded_message": "", - "resolved_target": "src/app_runtime/core/runtime.py", - "draft_answer_preview": "В файле `src/app_runtime/core/runtime.py` определён класс `RuntimeManager`.\nУ него есть несколько атрибутов класса:\n- `ACTION_TIMEOUT_SECONDS = 10.0`\n- `ACTION_POLL_INTERVAL_SECONDS = 0.05`\n\nВ конструкторе (`__init__`) инициализируются следующие поля объекта:\n- `configuration`: экземпляр `Configurat", - "repair_candidate": true - }, - "output": { - "passed": true, - "action": "return", - "reasons": [], - "repair_used": false, - "final_answer_preview": "В файле `src/app_runtime/core/runtime.py` определён класс `RuntimeManager`.\nУ него есть несколько атрибутов класса:\n- `ACTION_TIMEOUT_SECONDS = 10.0`\n- `ACTION_POLL_INTERVAL_SECONDS = 0.05`\n\nВ конструкторе (`__init__`) инициализируются следующие поля объекта:\n- `configuration`: экземпляр `Configurat" - } - } -] - -## Diagnostics -{ - "intent_correct": null, - "target_found": true, - "layers_used": [ - "C0_SOURCE_CHUNKS" - ], - "retrieval_sufficient": true, - "answer_mode": "normal", - "resolved_target": "src/app_runtime/core/runtime.py", - "answer_policy_branch": "normal_answer", - "decision_reason": "evidence_sufficient", - "router_result": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "retrieval_profile": "code", - "sub_intent": "OPEN_FILE", - "path_scope": [ - "src/app_runtime/core/runtime.py" - ], - "layers": [ - "C0_SOURCE_CHUNKS" - ], - "symbol_resolution_status": "not_requested" - }, - "retrieval_request": { - "rag_session_id": "7d11da21-faa0-4cea-aede-aeabe069164c", - "query": "Открой файл src/app_runtime/core/runtime.py", - "sub_intent": "OPEN_FILE", - "path_scope": [ - "src/app_runtime/core/runtime.py" - ], - "requested_layers": [ - "C0_SOURCE_CHUNKS" - ] - }, - "per_layer_outcome": [ - { - "layer_id": "C0_SOURCE_CHUNKS", - "hit_count": 1, - "empty": false, - "fallback_used": false - } - ], - "empty_layers": [], - "evidence_gate_decision": { - "sufficient": true, - "failure_reasons": [], - "evidence_count": 1 - }, - "evidence_gate_input": { - "resolved_target": "src/app_runtime/core/runtime.py", - "sub_intent": "OPEN_FILE", - "target_type": "file", - "evidence_count": 1, - "code_chunk_count": 1, - "entrypoint_count": 0, - "relation_count": 0, - "test_evidence_count": 0, - "symbol_resolution_status": "not_requested", - "path_scope": [ - "src/app_runtime/core/runtime.py" - ] - }, - "post_evidence_gate": { - "input": { - "answer_mode": "normal", - "degraded_message": "", - "resolved_target": "src/app_runtime/core/runtime.py", - "draft_answer_preview": "В файле `src/app_runtime/core/runtime.py` определён класс `RuntimeManager`.\nУ него есть несколько атрибутов класса:\n- `ACTION_TIMEOUT_SECONDS = 10.0`\n- `ACTION_POLL_INTERVAL_SECONDS = 0.05`\n\nВ конструкторе (`__init__`) инициализируются следующие поля объекта:\n- `configuration`: экземпляр `Configurat", - "repair_candidate": true - }, - "output": { - "passed": true, - "action": "return", - "reasons": [], - "repair_used": false, - "final_answer_preview": "В файле `src/app_runtime/core/runtime.py` определён класс `RuntimeManager`.\nУ него есть несколько атрибутов класса:\n- `ACTION_TIMEOUT_SECONDS = 10.0`\n- `ACTION_POLL_INTERVAL_SECONDS = 0.05`\n\nВ конструкторе (`__init__`) инициализируются следующие поля объекта:\n- `configuration`: экземпляр `Configurat" - } - }, - "failure_reasons": [], - "timings_ms": { - "router": 1, - "retrieval": 137, - "pre_evidence_gate": 1, - "llm": 3254, - "post_evidence_gate": 1 - } -} - -## Mismatches -- none \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/plba_full_chain_subintents_v3/20260312_174008/full_chain_plba_code_subintents_v2_plba-v2-trace-flow-health-endpoint.json b/tests/pipeline_setup_v3/test_results/plba_full_chain_subintents_v3/20260312_174008/full_chain_plba_code_subintents_v2_plba-v2-trace-flow-health-endpoint.json deleted file mode 100644 index f09dd7f..0000000 --- a/tests/pipeline_setup_v3/test_results/plba_full_chain_subintents_v3/20260312_174008/full_chain_plba_code_subintents_v2_plba-v2-trace-flow-health-endpoint.json +++ /dev/null @@ -1,4916 +0,0 @@ -{ - "case_id": "plba-v2-trace-flow-health-endpoint", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_02_pipeline/full_chain_plba_code_subintents_v2.yaml", - "runner": "agent_runtime", - "mode": "full_chain", - "query": "Покажи как проходит запрос /health в HttpControlAppFactory", - "actual": { - "intent": "CODE_QA", - "sub_intent": "TRACE_FLOW", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 37, - "llm_answer": "Запрос /health обрабатывается следующим образом:\n\n1. В файле `http_app.py` класс `HttpControlAppFactory` создаёт объект FastAPI с маршрутом `/health`.\n2. Маршрут `/health` сопоставлен с функцией-обработчиком `health`, определённой внутри фабрики на строках 31–34.\n3. При обращении к маршруту `/health` вызывается этот обработчик, который асинхронно вызывает провайдер здоровья (`health_provider`), переданный в фабрику.\n4. Приложение обернуто middleware для логирования времени ответа, которое добавляется в заголовок X-Response-Time-Ms.\n\nЦепочка вызовов завершается на уровне фабрики, конкретных имплементаций провайдера здоровья в данном контексте нет.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "health", - "HttpControlAppFactory" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "passed": true, - "mismatches": [], - "details": { - "query": "Покажи как проходит запрос /health в HttpControlAppFactory", - "router_result": { - "schema_version": "1.1", - "intent": "CODE_QA", - "retrieval_profile": "code", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query_plan": { - "raw": "Покажи как проходит запрос /health в HttpControlAppFactory", - "normalized": "Покажи как проходит запрос /health в HttpControlAppFactory", - "sub_intent": "TRACE_FLOW", - "negations": [], - "expansions": [ - "health", - "HttpControlAppFactory" - ], - "keyword_hints": [ - "health", - "HttpControlAppFactory" - ], - "path_hints": [], - "doc_scope_hints": [], - "symbol_candidates": [ - "health", - "HttpControlAppFactory" - ], - "symbol_kind_hint": "unknown", - "anchors": [ - { - "type": "SYMBOL", - "value": "health", - "source": "user_text", - "subtype": null, - "span": { - "start": 28, - "end": 34 - }, - "confidence": 0.88 - }, - { - "type": "SYMBOL", - "value": "HttpControlAppFactory", - "source": "user_text", - "subtype": null, - "span": { - "start": 37, - "end": 58 - }, - "confidence": 0.88 - } - ] - }, - "retrieval_spec": { - "domains": [ - "CODE" - ], - "layer_queries": [ - { - "layer_id": "C1_SYMBOL_CATALOG", - "top_k": 8 - }, - { - "layer_id": "C0_SOURCE_CHUNKS", - "top_k": 8 - }, - { - "layer_id": "C4_SEMANTIC_ROLES", - "top_k": 8 - }, - { - "layer_id": "C2_DEPENDENCY_GRAPH", - "top_k": 10 - }, - { - "layer_id": "C3_ENTRYPOINTS", - "top_k": 10 - } - ], - "filters": { - "test_policy": "EXCLUDE", - "path_scope": [], - "language": [ - "python" - ] - }, - "rerank_profile": "code" - }, - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - }, - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "HttpControlAppFactory", - "alternatives": [ - "HttpControlAppFactory", - "HttpControlAppFactory", - "ControlActionSet", - "ControlPlaneService", - "HealthContributor.health" - ], - "confidence": 0.99 - }, - "evidence_policy": { - "require_def": true, - "require_flow": true, - "require_spec": false, - "allow_answer_without_evidence": false - } - }, - "retrieval_request": { - "rag_session_id": "7d11da21-faa0-4cea-aede-aeabe069164c", - "query": "Покажи как проходит запрос /health в HttpControlAppFactory", - "sub_intent": "TRACE_FLOW", - "path_scope": [], - "keyword_hints": [ - "health", - "HttpControlAppFactory" - ], - "symbol_candidates": [ - "health", - "HttpControlAppFactory" - ], - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_spec": { - "domains": [ - "CODE" - ], - "layer_queries": [ - { - "layer_id": "C1_SYMBOL_CATALOG", - "top_k": 8 - }, - { - "layer_id": "C0_SOURCE_CHUNKS", - "top_k": 8 - }, - { - "layer_id": "C4_SEMANTIC_ROLES", - "top_k": 8 - }, - { - "layer_id": "C2_DEPENDENCY_GRAPH", - "top_k": 10 - }, - { - "layer_id": "C3_ENTRYPOINTS", - "top_k": 10 - } - ], - "filters": { - "test_policy": "EXCLUDE", - "path_scope": [], - "language": [ - "python" - ] - }, - "rerank_profile": "code" - }, - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - }, - "query_plan": { - "raw": "Покажи как проходит запрос /health в HttpControlAppFactory", - "normalized": "Покажи как проходит запрос /health в HttpControlAppFactory", - "sub_intent": "TRACE_FLOW", - "negations": [], - "expansions": [ - "health", - "HttpControlAppFactory" - ], - "keyword_hints": [ - "health", - "HttpControlAppFactory" - ], - "path_hints": [], - "doc_scope_hints": [], - "symbol_candidates": [ - "health", - "HttpControlAppFactory" - ], - "symbol_kind_hint": "unknown", - "anchors": [ - { - "type": "SYMBOL", - "value": "health", - "source": "user_text", - "subtype": null, - "span": { - "start": 28, - "end": 34 - }, - "confidence": 0.88 - }, - { - "type": "SYMBOL", - "value": "HttpControlAppFactory", - "source": "user_text", - "subtype": null, - "span": { - "start": 37, - "end": 58 - }, - "confidence": 0.88 - } - ] - } - }, - "retrieval_result": { - "target_symbol_candidates": [ - "HttpControlAppFactory", - "ControlActionSet", - "ControlPlaneService", - "HealthContributor.health", - "HealthContributor", - "ControlChannel" - ], - "resolved_symbol": "HttpControlAppFactory", - "symbol_resolution_status": "resolved", - "file_candidates": [ - "src/app_runtime/control/http_app.py", - "src/app_runtime/control/http_channel.py", - "src/app_runtime/control/base.py", - "src/app_runtime/control/__init__.py", - "src/app_runtime/contracts/health.py", - "src/app_runtime/control/http_runner.py", - "src/app_runtime/control/service.py", - "src/app_runtime/health/registry.py", - "src/app_runtime/core/types.py" - ], - "code_chunks": [ - { - "layer": "C1_SYMBOL_CATALOG", - "path": "src/app_runtime/control/http_app.py", - "title": "HttpControlAppFactory", - "content": "class HttpControlAppFactory\nHttpControlAppFactory", - "start_line": 15, - "end_line": 53, - "metadata": { - "symbol_id": "9b3502a5fb408b273223db13264349cf500de24915b6c649d9ea8970d0dfd8e0", - "qname": "HttpControlAppFactory", - "kind": "class", - "signature": "HttpControlAppFactory", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.control.http_app", - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C1_SYMBOL_CATALOG", - "path": "src/app_runtime/control/http_channel.py", - "title": "HttpControlAppFactory", - "content": "const HttpControlAppFactory\nHttpControlAppFactory = app_runtime.control.http_app.HttpControlAppFactory", - "start_line": 8, - "end_line": 8, - "metadata": { - "symbol_id": "9ee00379ee797cd2386e88a6e37dc69e3e31de9144fc4b95f0206cd1430e8983", - "qname": "HttpControlAppFactory", - "kind": "const", - "signature": "HttpControlAppFactory = app_runtime.control.http_app.HttpControlAppFactory", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.control.http_channel", - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C1_SYMBOL_CATALOG", - "path": "src/app_runtime/control/base.py", - "title": "ControlActionSet", - "content": "class ControlActionSet\nControlActionSet", - "start_line": 14, - "end_line": 18, - "metadata": { - "symbol_id": "46eb026cb3313415ec47b82dd22f84f4d112c9d987e8b1716dcb0baa1cce8988", - "qname": "ControlActionSet", - "kind": "class", - "signature": "ControlActionSet", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.control.base", - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C1_SYMBOL_CATALOG", - "path": "src/app_runtime/control/__init__.py", - "title": "ControlPlaneService", - "content": "const ControlPlaneService\nControlPlaneService = app_runtime.control.service.ControlPlaneService", - "start_line": 3, - "end_line": 3, - "metadata": { - "symbol_id": "217e8f044d1c01644bf7b81e5046af9e84469210c692a2fb0c476a19bb069ae1", - "qname": "ControlPlaneService", - "kind": "const", - "signature": "ControlPlaneService = app_runtime.control.service.ControlPlaneService", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.control.__init__", - "is_test": false, - "blob_sha": "bf3c37e3369a84cc618adc0fd71c232e5eb4b871eaff743069a17e661e498316", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C1_SYMBOL_CATALOG", - "path": "src/app_runtime/contracts/health.py", - "title": "HealthContributor.health", - "content": "method HealthContributor.health\nhealth(self)\nReturn contributor health state.", - "start_line": 9, - "end_line": 10, - "metadata": { - "symbol_id": "728cff18958d8a25e2661a0f08c83d68c3bbbfa8cef212b85dc0da2b11b3dc90", - "qname": "HealthContributor.health", - "kind": "method", - "signature": "health(self)", - "parent_symbol_id": "HealthContributor", - "package_or_module": "src.app_runtime.contracts.health", - "is_test": false, - "blob_sha": "6bd92611def7131e32d4dd34a8ed85e6cf3c67722ad27797032a632cb30dc097", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C1_SYMBOL_CATALOG", - "path": "src/app_runtime/contracts/health.py", - "title": "HealthContributor", - "content": "class HealthContributor\nHealthContributor(ABC)", - "start_line": 7, - "end_line": 10, - "metadata": { - "symbol_id": "db91ae387b89a2e9d83829754f27fa18a4055b3e72d7f31789a0b8e0bf5bba0b", - "qname": "HealthContributor", - "kind": "class", - "signature": "HealthContributor(ABC)", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.contracts.health", - "is_test": false, - "blob_sha": "6bd92611def7131e32d4dd34a8ed85e6cf3c67722ad27797032a632cb30dc097", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C1_SYMBOL_CATALOG", - "path": "src/app_runtime/control/__init__.py", - "title": "ControlActionSet", - "content": "const ControlActionSet\nControlActionSet = app_runtime.control.base.ControlActionSet", - "start_line": 1, - "end_line": 1, - "metadata": { - "symbol_id": "767e4ac0d4224aeccb0783a38359d3c03899a876736eb83d99887c16ea07cc6c", - "qname": "ControlActionSet", - "kind": "const", - "signature": "ControlActionSet = app_runtime.control.base.ControlActionSet", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.control.__init__", - "is_test": false, - "blob_sha": "bf3c37e3369a84cc618adc0fd71c232e5eb4b871eaff743069a17e661e498316", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C1_SYMBOL_CATALOG", - "path": "src/app_runtime/control/__init__.py", - "title": "ControlChannel", - "content": "const ControlChannel\nControlChannel = app_runtime.control.base.ControlChannel", - "start_line": 1, - "end_line": 1, - "metadata": { - "symbol_id": "268420f7aa4ed74082b9276cae0cded4f00bac090ffd58fa020a65be0fe19c27", - "qname": "ControlChannel", - "kind": "const", - "signature": "ControlChannel = app_runtime.control.base.ControlChannel", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.control.__init__", - "is_test": false, - "blob_sha": "bf3c37e3369a84cc618adc0fd71c232e5eb4b871eaff743069a17e661e498316", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C0_SOURCE_CHUNKS", - "path": "src/app_runtime/control/http_channel.py", - "title": "src/app_runtime/control/http_channel.py:HttpControlChannel", - "content": "class HttpControlChannel(ControlChannel):\n def __init__(self, host: str, port: int, timeout: int) -> None:\n self._timeout = timeout\n self._runner = UvicornThreadRunner(host, port, timeout)\n self._factory = HttpControlAppFactory()\n self._actions: ControlActionSet | None = None\n\n async def start(self, actions: ControlActionSet) -> None:\n self._actions = actions\n app = self._factory.create(self._health_response, self._action_response)\n await self._runner.start(app)\n\n async def stop(self) -> None:\n await self._runner.stop()\n\n @property\n def port(self) -> int:\n return self._runner.port\n\n async def _health_response(self) -> dict[str, object]:\n if self._actions is None:\n return {\"status\": \"unhealthy\", \"detail\": \"control actions are not configured\"}\n return await asyncio.wait_for(self._actions.health(), timeout=float(self._timeout))\n\n async def _action_response(self, action: str, _client_source: str = \"unknown\") -> JSONResponse:\n if self._actions is None:\n return JSONResponse(content={\"status\": \"error\", \"detail\": f\"{action} handler is not configured\"}, status_code=404)\n callbacks = {\n \"start\": self._actions.start,\n \"stop\": self._actions.stop,\n \"status\": self._actions.status,\n }\n callback = callbacks.get(action)\n if callback is None:\n return JSONResponse(content={\"status\": \"error\", \"detail\": f\"unsupported action: {action}\"}, status_code=404)\n action_timeout = max(float(self._timeout), 10.0) if action in {\"start\", \"stop\"} else float(self._timeout)\n try:\n detail = await asyncio.wait_for(callback(), timeout=action_timeout)\n except asyncio.TimeoutError:\n return JSONResponse(\n content={\"status\": \"accepted\", \"detail\": f\"{action} operation is still in progress\"},\n status_code=202,\n )\n except Exception as exc:\n return JSONResponse(content={\"status\": \"error\", \"detail\": str(exc)}, status_code=500)\n return JSONResponse(content={\"status\": \"ok\", \"detail\": detail or f\"{action} action accepted\"}, status_code=200)", - "start_line": 12, - "end_line": 57, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.http_channel", - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C0_SOURCE_CHUNKS", - "path": "src/app_runtime/control/http_runner.py", - "title": "src/app_runtime/control/http_runner.py:UvicornThreadRunner", - "content": "class UvicornThreadRunner:\n def __init__(self, host: str, port: int, timeout: int) -> None:\n self._host = host\n self._port = port\n self._timeout = timeout\n self._server: Server | None = None\n self._thread: Thread | None = None\n self._error: BaseException | None = None\n\n async def start(self, app: FastAPI) -> None:\n if self._thread is not None and self._thread.is_alive():\n return\n self._error = None\n config = Config(app=app, host=self._host, port=self._port, log_level=\"warning\")\n self._server = Server(config)\n self._thread = Thread(target=self._serve, name=\"plba-http-control\", daemon=True)\n self._thread.start()\n await self._wait_until_started()\n\n async def stop(self) -> None:\n if self._server is None or self._thread is None:\n return\n self._server.should_exit = True\n await asyncio.to_thread(self._thread.join, self._timeout)\n self._server = None\n self._thread = None\n\n @property\n def port(self) -> int:\n if self._server is None or not getattr(self._server, \"servers\", None):\n return self._port\n socket = self._server.servers[0].sockets[0]\n return int(socket.getsockname()[1])\n\n async def _wait_until_started(self) -> None:\n if self._server is None:\n raise RuntimeError(\"Server is not initialized\")\n deadline = asyncio.get_running_loop().time() + max(float(self._timeout), 1.0)\n while not self._server.started:\n if self._error is not None:\n raise RuntimeError(\"HTTP control server failed to start\") from self._error\n if asyncio.get_running_loop().time() >= deadline:\n raise TimeoutError(\"HTTP control server startup timed out\")\n await asyncio.sleep(0.05)\n\n def _serve(self) -> None:\n if self._server is None:\n return\n try:\n asyncio.run(self._server.serve())\n except BaseException as exc: # noqa: BLE001\n self._error = exc", - "start_line": 10, - "end_line": 61, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.http_runner", - "is_test": false, - "blob_sha": "3779fdd2878b770e789a35bb2a89c9d79f13b61c26d7db1b3b683f9bb9e1623f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C0_SOURCE_CHUNKS", - "path": "src/app_runtime/control/http_app.py", - "title": "src/app_runtime/control/http_app.py:HttpControlAppFactory", - "content": "class HttpControlAppFactory:\n def create(\n self,\n health_provider: Callable[[], Awaitable[HealthPayload]],\n action_provider: Callable[[str, str], Awaitable[JSONResponse]],\n ) -> FastAPI:\n app = FastAPI(title=\"PLBA Control API\")\n\n @app.middleware(\"http\")\n async def log_api_call(request: Request, call_next): # type: ignore[no-untyped-def]\n started = time.monotonic()\n response = await call_next(request)\n response.headers[\"X-Response-Time-Ms\"] = str(int((time.monotonic() - started) * 1000))\n return response\n\n @app.get(\"/health\")\n async def health() -> JSONResponse:\n payload = await health_provider()\n status_code = 200 if payload.get(\"status\") == \"ok\" else 503\n return JSONResponse(content=payload, status_code=status_code)\n\n @app.get(\"/actions/{action}\")\n @app.post(\"/actions/{action}\")\n async def action(action: str, request: Request) -> JSONResponse:\n client_source = self._client_source(request)\n if action in {\"start\", \"stop\"}:\n LOGGER.warning(\"Control action requested: /actions/%s client=%s\", action, client_source)\n return await action_provider(action, client_source)\n\n return app\n\n def _client_source(self, request: Request) -> str:\n explicit_header = request.headers.get(\"X-Client-Source\", \"\").strip()\n if explicit_header:\n return explicit_header\n user_agent = request.headers.get(\"User-Agent\", \"\").strip()\n if user_agent:\n return f\"user-agent:{user_agent}\"\n return \"unknown\"", - "start_line": 15, - "end_line": 53, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.http_app", - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C0_SOURCE_CHUNKS", - "path": "src/app_runtime/contracts/health.py", - "title": "src/app_runtime/contracts/health.py:HealthContributor", - "content": "class HealthContributor(ABC):\n @abstractmethod\n def health(self) -> WorkerHealth:\n \"\"\"Return contributor health state.\"\"\"", - "start_line": 7, - "end_line": 10, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.contracts.health", - "is_test": false, - "blob_sha": "6bd92611def7131e32d4dd34a8ed85e6cf3c67722ad27797032a632cb30dc097", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C0_SOURCE_CHUNKS", - "path": "src/app_runtime/control/base.py", - "title": "src/app_runtime/control/base.py:ControlChannel", - "content": "class ControlChannel(ABC):\n @abstractmethod\n async def start(self, actions: ControlActionSet) -> None:\n \"\"\"Start the control channel and bind handlers.\"\"\"\n\n @abstractmethod\n async def stop(self) -> None:\n \"\"\"Stop the control channel and release resources.\"\"\"", - "start_line": 21, - "end_line": 28, - "metadata": { - "chunk_index": 1, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.base", - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C0_SOURCE_CHUNKS", - "path": "src/app_runtime/control/__init__.py", - "title": "src/app_runtime/control/__init__.py:1-5", - "content": "from app_runtime.control.base import ControlActionSet, ControlChannel\nfrom app_runtime.control.http_channel import HttpControlChannel\nfrom app_runtime.control.service import ControlPlaneService\n\n__all__ = [\"ControlActionSet\", \"ControlChannel\", \"ControlPlaneService\", \"HttpControlChannel\"]", - "start_line": 1, - "end_line": 5, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.app_runtime.control.__init__", - "is_test": false, - "blob_sha": "bf3c37e3369a84cc618adc0fd71c232e5eb4b871eaff743069a17e661e498316", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C0_SOURCE_CHUNKS", - "path": "src/app_runtime/control/base.py", - "title": "src/app_runtime/control/base.py:ControlActionSet", - "content": "class ControlActionSet:\n health: HealthHandler\n start: ActionHandler\n stop: ActionHandler\n status: ActionHandler", - "start_line": 14, - "end_line": 18, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.base", - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C0_SOURCE_CHUNKS", - "path": "src/app_runtime/control/service.py", - "title": "src/app_runtime/control/service.py:ControlPlaneService", - "content": "class ControlPlaneService:\n def __init__(self) -> None:\n self._channels: list[ControlChannel] = []\n\n def register_channel(self, channel: ControlChannel) -> None:\n self._channels.append(channel)\n\n def start(self, runtime: RuntimeManager) -> None:\n if not self._channels:\n return\n asyncio.run(self._start_async(runtime))\n\n def stop(self) -> None:\n if not self._channels:\n return\n asyncio.run(self._stop_async())\n\n def snapshot(self, runtime: RuntimeManager) -> dict[str, object]:\n health = runtime.current_health()\n return {\n \"runtime\": {\"state\": runtime._state.value},\n \"modules\": list(runtime.registry.modules),\n \"services\": runtime.services.snapshot(),\n \"workers\": runtime.workers.snapshot(),\n \"health\": runtime.health.snapshot(runtime.workers.healths()) | {\"status\": health[\"status\"]},\n \"config\": runtime.configuration.get(),\n }\n\n async def _start_async(self, runtime: RuntimeManager) -> None:\n actions = ControlActionSet(\n health=runtime.health_status,\n start=runtime.start_runtime,\n stop=runtime.stop_runtime,\n status=runtime.runtime_status,\n )\n for channel in self._channels:\n await channel.start(actions)\n\n async def _stop_async(self) -> None:\n for channel in reversed(self._channels):\n await channel.stop()", - "start_line": 12, - "end_line": 52, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.service", - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C4_SEMANTIC_ROLES", - "path": "src/app_runtime/control/http_app.py", - "title": "HttpControlAppFactory", - "content": "HttpControlAppFactory\nrole: factory\n\nResponsibilities:\n- name suffix suggests factory", - "start_line": 15, - "end_line": 53, - "metadata": { - "symbol_id": "9b3502a5fb408b273223db13264349cf500de24915b6c649d9ea8970d0dfd8e0", - "symbol_name": "HttpControlAppFactory", - "qname": "HttpControlAppFactory", - "role": "factory", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C4_SEMANTIC_ROLES", - "path": "src/app_runtime/health/registry.py", - "title": "HealthRegistry", - "content": "HealthRegistry\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (2)", - "start_line": 8, - "end_line": 56, - "metadata": { - "symbol_id": "fd3390eb0ba29c9979466b9c2117238e0da3bb829eeb4d505cb34c9c3df7a8e8", - "symbol_name": "HealthRegistry", - "qname": "HealthRegistry", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 2, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "26e6a24daa43407ba5340b74497c20153020e79f8d7828ae502aaec378dfcf75", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C4_SEMANTIC_ROLES", - "path": "src/app_runtime/core/types.py", - "title": "HealthPayload", - "content": "HealthPayload\nrole: model\n\nResponsibilities:\n- default model role", - "start_line": 7, - "end_line": 11, - "metadata": { - "symbol_id": "392235d63ddf752d6e419cb8528c93fe070d1bc02d3c87ba6a897baac810cf5d", - "symbol_name": "HealthPayload", - "qname": "HealthPayload", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "448a02e4a432b5ab65b246b2bd24a32a6f127b9d2091ea73b53ee3c0a2f53bb3", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C4_SEMANTIC_ROLES", - "path": "src/app_runtime/contracts/health.py", - "title": "HealthContributor", - "content": "HealthContributor\nrole: model\n\nResponsibilities:\n- default model role", - "start_line": 7, - "end_line": 10, - "metadata": { - "symbol_id": "db91ae387b89a2e9d83829754f27fa18a4055b3e72d7f31789a0b8e0bf5bba0b", - "symbol_name": "HealthContributor", - "qname": "HealthContributor", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "6bd92611def7131e32d4dd34a8ed85e6cf3c67722ad27797032a632cb30dc097", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C4_SEMANTIC_ROLES", - "path": "src/app_runtime/control/base.py", - "title": "ControlActionSet", - "content": "ControlActionSet\nrole: model\n\nResponsibilities:\n- default model role", - "start_line": 14, - "end_line": 18, - "metadata": { - "symbol_id": "46eb026cb3313415ec47b82dd22f84f4d112c9d987e8b1716dcb0baa1cce8988", - "symbol_name": "ControlActionSet", - "qname": "ControlActionSet", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C4_SEMANTIC_ROLES", - "path": "src/app_runtime/control/base.py", - "title": "ControlChannel", - "content": "ControlChannel\nrole: model\n\nResponsibilities:\n- default model role", - "start_line": 21, - "end_line": 28, - "metadata": { - "symbol_id": "cfcfe9a311d3a2dbdaf32ac4ccd73c0eb9a117f830591a1c0867ee97d46204ff", - "symbol_name": "ControlChannel", - "qname": "ControlChannel", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C4_SEMANTIC_ROLES", - "path": "src/app_runtime/control/service.py", - "title": "ControlPlaneService", - "content": "ControlPlaneService\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests service\n- reads and writes state attributes\n- participates in dataflow slices (5)", - "start_line": 12, - "end_line": 52, - "metadata": { - "symbol_id": "b13471e5916986dccffb53fab613812842965705e6b3a89ae549d30c9e91e9aa", - "symbol_name": "ControlPlaneService", - "qname": "ControlPlaneService", - "role": "pipeline_stage", - "confidence": 0.57, - "dataflow_participation": 5, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C4_SEMANTIC_ROLES", - "path": "src/app_runtime/control/http_runner.py", - "title": "UvicornThreadRunner", - "content": "UvicornThreadRunner\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (24)", - "start_line": 10, - "end_line": 61, - "metadata": { - "symbol_id": "fd55630045a02100df8877ac27d951ee08617d4598764394d48cb51fe067476a", - "symbol_name": "UvicornThreadRunner", - "qname": "UvicornThreadRunner", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 24, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "3779fdd2878b770e789a35bb2a89c9d79f13b61c26d7db1b3b683f9bb9e1623f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "path": "src/app_runtime/health/registry.py", - "title": "HealthRegistry.__init__:dataflow_slice", - "content": "HealthRegistry.__init__\n -> HealthRegistry._contributors\n -> HealthRegistry.register", - "start_line": 10, - "end_line": 13, - "metadata": { - "edge_id": "2381dfb339d541367c3251d2a610cac9d8b3f6bd6a352e119d00a93c5ccc2b7d", - "edge_type": "dataflow_slice", - "src_symbol_id": "e8ffd58441c231de43d9e86c31eb12303d4e2bf045b2acf13d1dfe78da01f8dc", - "src_qname": "HealthRegistry.__init__", - "dst_symbol_id": "a9e1f290c346c8bb1d67af0cafeebb5bcaf29c3ed7027e33c794532743df38f2", - "dst_ref": "HealthRegistry.register", - "resolution": "resolved", - "slice_id": "2381dfb339d541367c3251d2a610cac9d8b3f6bd6a352e119d00a93c5ccc2b7d", - "root_symbol_id": "e8ffd58441c231de43d9e86c31eb12303d4e2bf045b2acf13d1dfe78da01f8dc", - "path_symbols": [ - "HealthRegistry.__init__", - "HealthRegistry._contributors", - "HealthRegistry.register" - ], - "path_symbol_ids": [ - "e8ffd58441c231de43d9e86c31eb12303d4e2bf045b2acf13d1dfe78da01f8dc", - "a9e1f290c346c8bb1d67af0cafeebb5bcaf29c3ed7027e33c794532743df38f2" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "26e6a24daa43407ba5340b74497c20153020e79f8d7828ae502aaec378dfcf75", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "path": "src/app_runtime/control/service.py", - "title": "ControlPlaneService.__init__:dataflow_slice", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.start", - "start_line": 14, - "end_line": 20, - "metadata": { - "edge_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154", - "dst_ref": "ControlPlaneService.start", - "resolution": "resolved", - "slice_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.start" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "path": "src/app_runtime/control/service.py", - "title": "ControlPlaneService.__init__:dataflow_slice", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.stop", - "start_line": 14, - "end_line": 25, - "metadata": { - "edge_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d", - "dst_ref": "ControlPlaneService.stop", - "resolution": "resolved", - "slice_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.stop" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "path": "src/app_runtime/control/service.py", - "title": "ControlPlaneService.__init__:dataflow_slice", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._stop_async", - "start_line": 14, - "end_line": 51, - "metadata": { - "edge_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a", - "dst_ref": "ControlPlaneService._stop_async", - "resolution": "resolved", - "slice_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._stop_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "path": "src/app_runtime/health/registry.py", - "title": "HealthRegistry.__init__:dataflow_slice", - "content": "HealthRegistry.__init__\n -> HealthRegistry._contributors\n -> HealthRegistry.contributor_healths", - "start_line": 10, - "end_line": 16, - "metadata": { - "edge_id": "d3a88a7abf16359e903e809ffc24473658fdd8198f60641fe1584fc4ac663c31", - "edge_type": "dataflow_slice", - "src_symbol_id": "e8ffd58441c231de43d9e86c31eb12303d4e2bf045b2acf13d1dfe78da01f8dc", - "src_qname": "HealthRegistry.__init__", - "dst_symbol_id": "fa7bbd8f4b64a55a5088640c30f52e84075d65f531bd7e1f6c1d7bb8d24fcbf2", - "dst_ref": "HealthRegistry.contributor_healths", - "resolution": "resolved", - "slice_id": "d3a88a7abf16359e903e809ffc24473658fdd8198f60641fe1584fc4ac663c31", - "root_symbol_id": "e8ffd58441c231de43d9e86c31eb12303d4e2bf045b2acf13d1dfe78da01f8dc", - "path_symbols": [ - "HealthRegistry.__init__", - "HealthRegistry._contributors", - "HealthRegistry.contributor_healths" - ], - "path_symbol_ids": [ - "e8ffd58441c231de43d9e86c31eb12303d4e2bf045b2acf13d1dfe78da01f8dc", - "fa7bbd8f4b64a55a5088640c30f52e84075d65f531bd7e1f6c1d7bb8d24fcbf2" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "26e6a24daa43407ba5340b74497c20153020e79f8d7828ae502aaec378dfcf75", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "path": "src/app_runtime/control/service.py", - "title": "ControlPlaneService.__init__:dataflow_slice", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._start_async", - "start_line": 14, - "end_line": 47, - "metadata": { - "edge_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517", - "dst_ref": "ControlPlaneService._start_async", - "resolution": "resolved", - "slice_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._start_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "path": "src/app_runtime/control/service.py", - "title": "ControlPlaneService.__init__:dataflow_slice", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.register_channel", - "start_line": 14, - "end_line": 17, - "metadata": { - "edge_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957", - "dst_ref": "ControlPlaneService.register_channel", - "resolution": "resolved", - "slice_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.register_channel" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "path": "src/app_runtime/control/http_app.py", - "title": "HttpControlAppFactory.create:calls", - "content": "HttpControlAppFactory.create calls time.monotonic", - "start_line": 25, - "end_line": 25, - "metadata": { - "edge_id": "3fdd0a88d10225ee74f3b84ab57e13f09f5ccc72f00e31af9ae4655411c289c0", - "edge_type": "calls", - "src_symbol_id": "4af42c2a9275d652e710a98ec48b8247236b4453a093629f8958704ff6d3cb58", - "src_qname": "HttpControlAppFactory.create", - "dst_symbol_id": null, - "dst_ref": "time.monotonic", - "resolution": "partial", - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "path": "src/app_runtime/control/http_app.py", - "title": "HttpControlAppFactory.create:calls", - "content": "HttpControlAppFactory.create calls app.post", - "start_line": 37, - "end_line": 37, - "metadata": { - "edge_id": "0e545d4b5187db7bec5ceac03071d2ad68177550c42af748fee364639e533c90", - "edge_type": "calls", - "src_symbol_id": "4af42c2a9275d652e710a98ec48b8247236b4453a093629f8958704ff6d3cb58", - "src_qname": "HttpControlAppFactory.create", - "dst_symbol_id": null, - "dst_ref": "app.post", - "resolution": "partial", - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "path": "src/app_runtime/control/http_app.py", - "title": "HttpControlAppFactory.create:calls", - "content": "HttpControlAppFactory.create calls str", - "start_line": 27, - "end_line": 27, - "metadata": { - "edge_id": "2a87c51461e31cd556508cc37fdff37b4d24c26f7f1604db30af5e8f1bda96cb", - "edge_type": "calls", - "src_symbol_id": "4af42c2a9275d652e710a98ec48b8247236b4453a093629f8958704ff6d3cb58", - "src_qname": "HttpControlAppFactory.create", - "dst_symbol_id": null, - "dst_ref": "str", - "resolution": "partial", - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C3_ENTRYPOINTS", - "path": "src/app_runtime/control/http_app.py", - "title": "app.post", - "content": "fastapi http app.post", - "start_line": 38, - "end_line": 42, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C3_ENTRYPOINTS", - "path": "src/app_runtime/control/http_app.py", - "title": "app.get", - "content": "fastapi http app.get", - "start_line": 31, - "end_line": 34, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C3_ENTRYPOINTS", - "path": "src/app_runtime/control/http_app.py", - "title": "app.get", - "content": "fastapi http app.get", - "start_line": 38, - "end_line": 42, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "relations": [ - { - "path": "src/app_runtime/health/registry.py", - "metadata": { - "edge_id": "2381dfb339d541367c3251d2a610cac9d8b3f6bd6a352e119d00a93c5ccc2b7d", - "edge_type": "dataflow_slice", - "src_symbol_id": "e8ffd58441c231de43d9e86c31eb12303d4e2bf045b2acf13d1dfe78da01f8dc", - "src_qname": "HealthRegistry.__init__", - "dst_symbol_id": "a9e1f290c346c8bb1d67af0cafeebb5bcaf29c3ed7027e33c794532743df38f2", - "dst_ref": "HealthRegistry.register", - "resolution": "resolved", - "slice_id": "2381dfb339d541367c3251d2a610cac9d8b3f6bd6a352e119d00a93c5ccc2b7d", - "root_symbol_id": "e8ffd58441c231de43d9e86c31eb12303d4e2bf045b2acf13d1dfe78da01f8dc", - "path_symbols": [ - "HealthRegistry.__init__", - "HealthRegistry._contributors", - "HealthRegistry.register" - ], - "path_symbol_ids": [ - "e8ffd58441c231de43d9e86c31eb12303d4e2bf045b2acf13d1dfe78da01f8dc", - "a9e1f290c346c8bb1d67af0cafeebb5bcaf29c3ed7027e33c794532743df38f2" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "26e6a24daa43407ba5340b74497c20153020e79f8d7828ae502aaec378dfcf75", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - }, - "content": "HealthRegistry.__init__\n -> HealthRegistry._contributors\n -> HealthRegistry.register" - }, - { - "path": "src/app_runtime/control/service.py", - "metadata": { - "edge_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154", - "dst_ref": "ControlPlaneService.start", - "resolution": "resolved", - "slice_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.start" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - }, - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.start" - }, - { - "path": "src/app_runtime/control/service.py", - "metadata": { - "edge_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d", - "dst_ref": "ControlPlaneService.stop", - "resolution": "resolved", - "slice_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.stop" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - }, - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.stop" - }, - { - "path": "src/app_runtime/control/service.py", - "metadata": { - "edge_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a", - "dst_ref": "ControlPlaneService._stop_async", - "resolution": "resolved", - "slice_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._stop_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - }, - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._stop_async" - }, - { - "path": "src/app_runtime/health/registry.py", - "metadata": { - "edge_id": "d3a88a7abf16359e903e809ffc24473658fdd8198f60641fe1584fc4ac663c31", - "edge_type": "dataflow_slice", - "src_symbol_id": "e8ffd58441c231de43d9e86c31eb12303d4e2bf045b2acf13d1dfe78da01f8dc", - "src_qname": "HealthRegistry.__init__", - "dst_symbol_id": "fa7bbd8f4b64a55a5088640c30f52e84075d65f531bd7e1f6c1d7bb8d24fcbf2", - "dst_ref": "HealthRegistry.contributor_healths", - "resolution": "resolved", - "slice_id": "d3a88a7abf16359e903e809ffc24473658fdd8198f60641fe1584fc4ac663c31", - "root_symbol_id": "e8ffd58441c231de43d9e86c31eb12303d4e2bf045b2acf13d1dfe78da01f8dc", - "path_symbols": [ - "HealthRegistry.__init__", - "HealthRegistry._contributors", - "HealthRegistry.contributor_healths" - ], - "path_symbol_ids": [ - "e8ffd58441c231de43d9e86c31eb12303d4e2bf045b2acf13d1dfe78da01f8dc", - "fa7bbd8f4b64a55a5088640c30f52e84075d65f531bd7e1f6c1d7bb8d24fcbf2" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "26e6a24daa43407ba5340b74497c20153020e79f8d7828ae502aaec378dfcf75", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - }, - "content": "HealthRegistry.__init__\n -> HealthRegistry._contributors\n -> HealthRegistry.contributor_healths" - }, - { - "path": "src/app_runtime/control/service.py", - "metadata": { - "edge_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517", - "dst_ref": "ControlPlaneService._start_async", - "resolution": "resolved", - "slice_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._start_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - }, - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._start_async" - }, - { - "path": "src/app_runtime/control/service.py", - "metadata": { - "edge_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957", - "dst_ref": "ControlPlaneService.register_channel", - "resolution": "resolved", - "slice_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.register_channel" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - }, - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.register_channel" - }, - { - "path": "src/app_runtime/control/http_app.py", - "metadata": { - "edge_id": "3fdd0a88d10225ee74f3b84ab57e13f09f5ccc72f00e31af9ae4655411c289c0", - "edge_type": "calls", - "src_symbol_id": "4af42c2a9275d652e710a98ec48b8247236b4453a093629f8958704ff6d3cb58", - "src_qname": "HttpControlAppFactory.create", - "dst_symbol_id": null, - "dst_ref": "time.monotonic", - "resolution": "partial", - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - }, - "content": "HttpControlAppFactory.create calls time.monotonic" - }, - { - "path": "src/app_runtime/control/http_app.py", - "metadata": { - "edge_id": "0e545d4b5187db7bec5ceac03071d2ad68177550c42af748fee364639e533c90", - "edge_type": "calls", - "src_symbol_id": "4af42c2a9275d652e710a98ec48b8247236b4453a093629f8958704ff6d3cb58", - "src_qname": "HttpControlAppFactory.create", - "dst_symbol_id": null, - "dst_ref": "app.post", - "resolution": "partial", - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - }, - "content": "HttpControlAppFactory.create calls app.post" - }, - { - "path": "src/app_runtime/control/http_app.py", - "metadata": { - "edge_id": "2a87c51461e31cd556508cc37fdff37b4d24c26f7f1604db30af5e8f1bda96cb", - "edge_type": "calls", - "src_symbol_id": "4af42c2a9275d652e710a98ec48b8247236b4453a093629f8958704ff6d3cb58", - "src_qname": "HttpControlAppFactory.create", - "dst_symbol_id": null, - "dst_ref": "str", - "resolution": "partial", - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - }, - "content": "HttpControlAppFactory.create calls str" - } - ], - "entrypoints": [ - { - "path": "src/app_runtime/control/http_app.py", - "title": "app.get", - "start_line": 31, - "end_line": 34, - "http_method": "GET", - "route_path": "/health", - "handler_symbol": "health", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "route_or_command": "app.get", - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "title": "app.get", - "start_line": 38, - "end_line": 42, - "http_method": "GET", - "route_path": "/actions/{action}", - "handler_symbol": "action", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "route_or_command": "app.get", - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "title": "app.post", - "start_line": 38, - "end_line": 42, - "http_method": "POST", - "route_path": "/actions/{action}", - "handler_symbol": "action", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "route_or_command": "app.post", - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "test_candidates": [], - "layer_outcomes": [ - { - "layer_id": "C1_SYMBOL_CATALOG", - "hit_count": 8, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C0_SOURCE_CHUNKS", - "hit_count": 8, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C4_SEMANTIC_ROLES", - "hit_count": 8, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C2_DEPENDENCY_GRAPH", - "hit_count": 10, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C3_ENTRYPOINTS", - "hit_count": 3, - "empty": false, - "fallback_used": false - } - ], - "missing_layers": [], - "raw_rows": [ - { - "path": "src/app_runtime/control/http_app.py", - "content": "class HttpControlAppFactory\nHttpControlAppFactory", - "layer": "C1_SYMBOL_CATALOG", - "title": "HttpControlAppFactory", - "span_start": 15, - "span_end": 53, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": null, - "metadata": { - "symbol_id": "9b3502a5fb408b273223db13264349cf500de24915b6c649d9ea8970d0dfd8e0", - "qname": "HttpControlAppFactory", - "kind": "class", - "signature": "HttpControlAppFactory", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.control.http_app", - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "const HttpControlAppFactory\nHttpControlAppFactory = app_runtime.control.http_app.HttpControlAppFactory", - "layer": "C1_SYMBOL_CATALOG", - "title": "HttpControlAppFactory", - "span_start": 8, - "span_end": 8, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": null, - "metadata": { - "symbol_id": "9ee00379ee797cd2386e88a6e37dc69e3e31de9144fc4b95f0206cd1430e8983", - "qname": "HttpControlAppFactory", - "kind": "const", - "signature": "HttpControlAppFactory = app_runtime.control.http_app.HttpControlAppFactory", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.control.http_channel", - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "class ControlActionSet\nControlActionSet", - "layer": "C1_SYMBOL_CATALOG", - "title": "ControlActionSet", - "span_start": 14, - "span_end": 18, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": null, - "metadata": { - "symbol_id": "46eb026cb3313415ec47b82dd22f84f4d112c9d987e8b1716dcb0baa1cce8988", - "qname": "ControlActionSet", - "kind": "class", - "signature": "ControlActionSet", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.control.base", - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/__init__.py", - "content": "const ControlPlaneService\nControlPlaneService = app_runtime.control.service.ControlPlaneService", - "layer": "C1_SYMBOL_CATALOG", - "title": "ControlPlaneService", - "span_start": 3, - "span_end": 3, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": null, - "metadata": { - "symbol_id": "217e8f044d1c01644bf7b81e5046af9e84469210c692a2fb0c476a19bb069ae1", - "qname": "ControlPlaneService", - "kind": "const", - "signature": "ControlPlaneService = app_runtime.control.service.ControlPlaneService", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.control.__init__", - "is_test": false, - "blob_sha": "bf3c37e3369a84cc618adc0fd71c232e5eb4b871eaff743069a17e661e498316", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/contracts/health.py", - "content": "method HealthContributor.health\nhealth(self)\nReturn contributor health state.", - "layer": "C1_SYMBOL_CATALOG", - "title": "HealthContributor.health", - "span_start": 9, - "span_end": 10, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": null, - "metadata": { - "symbol_id": "728cff18958d8a25e2661a0f08c83d68c3bbbfa8cef212b85dc0da2b11b3dc90", - "qname": "HealthContributor.health", - "kind": "method", - "signature": "health(self)", - "parent_symbol_id": "HealthContributor", - "package_or_module": "src.app_runtime.contracts.health", - "is_test": false, - "blob_sha": "6bd92611def7131e32d4dd34a8ed85e6cf3c67722ad27797032a632cb30dc097", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/contracts/health.py", - "content": "class HealthContributor\nHealthContributor(ABC)", - "layer": "C1_SYMBOL_CATALOG", - "title": "HealthContributor", - "span_start": 7, - "span_end": 10, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": null, - "metadata": { - "symbol_id": "db91ae387b89a2e9d83829754f27fa18a4055b3e72d7f31789a0b8e0bf5bba0b", - "qname": "HealthContributor", - "kind": "class", - "signature": "HealthContributor(ABC)", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.contracts.health", - "is_test": false, - "blob_sha": "6bd92611def7131e32d4dd34a8ed85e6cf3c67722ad27797032a632cb30dc097", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/__init__.py", - "content": "const ControlActionSet\nControlActionSet = app_runtime.control.base.ControlActionSet", - "layer": "C1_SYMBOL_CATALOG", - "title": "ControlActionSet", - "span_start": 1, - "span_end": 1, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": null, - "metadata": { - "symbol_id": "767e4ac0d4224aeccb0783a38359d3c03899a876736eb83d99887c16ea07cc6c", - "qname": "ControlActionSet", - "kind": "const", - "signature": "ControlActionSet = app_runtime.control.base.ControlActionSet", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.control.__init__", - "is_test": false, - "blob_sha": "bf3c37e3369a84cc618adc0fd71c232e5eb4b871eaff743069a17e661e498316", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/__init__.py", - "content": "const ControlChannel\nControlChannel = app_runtime.control.base.ControlChannel", - "layer": "C1_SYMBOL_CATALOG", - "title": "ControlChannel", - "span_start": 1, - "span_end": 1, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": null, - "metadata": { - "symbol_id": "268420f7aa4ed74082b9276cae0cded4f00bac090ffd58fa020a65be0fe19c27", - "qname": "ControlChannel", - "kind": "const", - "signature": "ControlChannel = app_runtime.control.base.ControlChannel", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.control.__init__", - "is_test": false, - "blob_sha": "bf3c37e3369a84cc618adc0fd71c232e5eb4b871eaff743069a17e661e498316", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "class HttpControlChannel(ControlChannel):\n def __init__(self, host: str, port: int, timeout: int) -> None:\n self._timeout = timeout\n self._runner = UvicornThreadRunner(host, port, timeout)\n self._factory = HttpControlAppFactory()\n self._actions: ControlActionSet | None = None\n\n async def start(self, actions: ControlActionSet) -> None:\n self._actions = actions\n app = self._factory.create(self._health_response, self._action_response)\n await self._runner.start(app)\n\n async def stop(self) -> None:\n await self._runner.stop()\n\n @property\n def port(self) -> int:\n return self._runner.port\n\n async def _health_response(self) -> dict[str, object]:\n if self._actions is None:\n return {\"status\": \"unhealthy\", \"detail\": \"control actions are not configured\"}\n return await asyncio.wait_for(self._actions.health(), timeout=float(self._timeout))\n\n async def _action_response(self, action: str, _client_source: str = \"unknown\") -> JSONResponse:\n if self._actions is None:\n return JSONResponse(content={\"status\": \"error\", \"detail\": f\"{action} handler is not configured\"}, status_code=404)\n callbacks = {\n \"start\": self._actions.start,\n \"stop\": self._actions.stop,\n \"status\": self._actions.status,\n }\n callback = callbacks.get(action)\n if callback is None:\n return JSONResponse(content={\"status\": \"error\", \"detail\": f\"unsupported action: {action}\"}, status_code=404)\n action_timeout = max(float(self._timeout), 10.0) if action in {\"start\", \"stop\"} else float(self._timeout)\n try:\n detail = await asyncio.wait_for(callback(), timeout=action_timeout)\n except asyncio.TimeoutError:\n return JSONResponse(\n content={\"status\": \"accepted\", \"detail\": f\"{action} operation is still in progress\"},\n status_code=202,\n )\n except Exception as exc:\n return JSONResponse(content={\"status\": \"error\", \"detail\": str(exc)}, status_code=500)\n return JSONResponse(content={\"status\": \"ok\", \"detail\": detail or f\"{action} action accepted\"}, status_code=200)", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/http_channel.py:HttpControlChannel", - "span_start": 12, - "span_end": 57, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": null, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.http_channel", - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_runner.py", - "content": "class UvicornThreadRunner:\n def __init__(self, host: str, port: int, timeout: int) -> None:\n self._host = host\n self._port = port\n self._timeout = timeout\n self._server: Server | None = None\n self._thread: Thread | None = None\n self._error: BaseException | None = None\n\n async def start(self, app: FastAPI) -> None:\n if self._thread is not None and self._thread.is_alive():\n return\n self._error = None\n config = Config(app=app, host=self._host, port=self._port, log_level=\"warning\")\n self._server = Server(config)\n self._thread = Thread(target=self._serve, name=\"plba-http-control\", daemon=True)\n self._thread.start()\n await self._wait_until_started()\n\n async def stop(self) -> None:\n if self._server is None or self._thread is None:\n return\n self._server.should_exit = True\n await asyncio.to_thread(self._thread.join, self._timeout)\n self._server = None\n self._thread = None\n\n @property\n def port(self) -> int:\n if self._server is None or not getattr(self._server, \"servers\", None):\n return self._port\n socket = self._server.servers[0].sockets[0]\n return int(socket.getsockname()[1])\n\n async def _wait_until_started(self) -> None:\n if self._server is None:\n raise RuntimeError(\"Server is not initialized\")\n deadline = asyncio.get_running_loop().time() + max(float(self._timeout), 1.0)\n while not self._server.started:\n if self._error is not None:\n raise RuntimeError(\"HTTP control server failed to start\") from self._error\n if asyncio.get_running_loop().time() >= deadline:\n raise TimeoutError(\"HTTP control server startup timed out\")\n await asyncio.sleep(0.05)\n\n def _serve(self) -> None:\n if self._server is None:\n return\n try:\n asyncio.run(self._server.serve())\n except BaseException as exc: # noqa: BLE001\n self._error = exc", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/http_runner.py:UvicornThreadRunner", - "span_start": 10, - "span_end": 61, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": null, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.http_runner", - "is_test": false, - "blob_sha": "3779fdd2878b770e789a35bb2a89c9d79f13b61c26d7db1b3b683f9bb9e1623f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "class HttpControlAppFactory:\n def create(\n self,\n health_provider: Callable[[], Awaitable[HealthPayload]],\n action_provider: Callable[[str, str], Awaitable[JSONResponse]],\n ) -> FastAPI:\n app = FastAPI(title=\"PLBA Control API\")\n\n @app.middleware(\"http\")\n async def log_api_call(request: Request, call_next): # type: ignore[no-untyped-def]\n started = time.monotonic()\n response = await call_next(request)\n response.headers[\"X-Response-Time-Ms\"] = str(int((time.monotonic() - started) * 1000))\n return response\n\n @app.get(\"/health\")\n async def health() -> JSONResponse:\n payload = await health_provider()\n status_code = 200 if payload.get(\"status\") == \"ok\" else 503\n return JSONResponse(content=payload, status_code=status_code)\n\n @app.get(\"/actions/{action}\")\n @app.post(\"/actions/{action}\")\n async def action(action: str, request: Request) -> JSONResponse:\n client_source = self._client_source(request)\n if action in {\"start\", \"stop\"}:\n LOGGER.warning(\"Control action requested: /actions/%s client=%s\", action, client_source)\n return await action_provider(action, client_source)\n\n return app\n\n def _client_source(self, request: Request) -> str:\n explicit_header = request.headers.get(\"X-Client-Source\", \"\").strip()\n if explicit_header:\n return explicit_header\n user_agent = request.headers.get(\"User-Agent\", \"\").strip()\n if user_agent:\n return f\"user-agent:{user_agent}\"\n return \"unknown\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/http_app.py:HttpControlAppFactory", - "span_start": 15, - "span_end": 53, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": null, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.http_app", - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/contracts/health.py", - "content": "class HealthContributor(ABC):\n @abstractmethod\n def health(self) -> WorkerHealth:\n \"\"\"Return contributor health state.\"\"\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/contracts/health.py:HealthContributor", - "span_start": 7, - "span_end": 10, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": null, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.contracts.health", - "is_test": false, - "blob_sha": "6bd92611def7131e32d4dd34a8ed85e6cf3c67722ad27797032a632cb30dc097", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "class ControlChannel(ABC):\n @abstractmethod\n async def start(self, actions: ControlActionSet) -> None:\n \"\"\"Start the control channel and bind handlers.\"\"\"\n\n @abstractmethod\n async def stop(self) -> None:\n \"\"\"Stop the control channel and release resources.\"\"\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/base.py:ControlChannel", - "span_start": 21, - "span_end": 28, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": null, - "metadata": { - "chunk_index": 1, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.base", - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/__init__.py", - "content": "from app_runtime.control.base import ControlActionSet, ControlChannel\nfrom app_runtime.control.http_channel import HttpControlChannel\nfrom app_runtime.control.service import ControlPlaneService\n\n__all__ = [\"ControlActionSet\", \"ControlChannel\", \"ControlPlaneService\", \"HttpControlChannel\"]", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/__init__.py:1-5", - "span_start": 1, - "span_end": 5, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": null, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.app_runtime.control.__init__", - "is_test": false, - "blob_sha": "bf3c37e3369a84cc618adc0fd71c232e5eb4b871eaff743069a17e661e498316", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "class ControlActionSet:\n health: HealthHandler\n start: ActionHandler\n stop: ActionHandler\n status: ActionHandler", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/base.py:ControlActionSet", - "span_start": 14, - "span_end": 18, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": null, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.base", - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "class ControlPlaneService:\n def __init__(self) -> None:\n self._channels: list[ControlChannel] = []\n\n def register_channel(self, channel: ControlChannel) -> None:\n self._channels.append(channel)\n\n def start(self, runtime: RuntimeManager) -> None:\n if not self._channels:\n return\n asyncio.run(self._start_async(runtime))\n\n def stop(self) -> None:\n if not self._channels:\n return\n asyncio.run(self._stop_async())\n\n def snapshot(self, runtime: RuntimeManager) -> dict[str, object]:\n health = runtime.current_health()\n return {\n \"runtime\": {\"state\": runtime._state.value},\n \"modules\": list(runtime.registry.modules),\n \"services\": runtime.services.snapshot(),\n \"workers\": runtime.workers.snapshot(),\n \"health\": runtime.health.snapshot(runtime.workers.healths()) | {\"status\": health[\"status\"]},\n \"config\": runtime.configuration.get(),\n }\n\n async def _start_async(self, runtime: RuntimeManager) -> None:\n actions = ControlActionSet(\n health=runtime.health_status,\n start=runtime.start_runtime,\n stop=runtime.stop_runtime,\n status=runtime.runtime_status,\n )\n for channel in self._channels:\n await channel.start(actions)\n\n async def _stop_async(self) -> None:\n for channel in reversed(self._channels):\n await channel.stop()", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/service.py:ControlPlaneService", - "span_start": 12, - "span_end": 52, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": null, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.service", - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "HttpControlAppFactory\nrole: factory\n\nResponsibilities:\n- name suffix suggests factory", - "layer": "C4_SEMANTIC_ROLES", - "title": "HttpControlAppFactory", - "span_start": 15, - "span_end": 53, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 39, - "layer_rank": 2, - "distance": null, - "metadata": { - "symbol_id": "9b3502a5fb408b273223db13264349cf500de24915b6c649d9ea8970d0dfd8e0", - "symbol_name": "HttpControlAppFactory", - "qname": "HttpControlAppFactory", - "role": "factory", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/health/registry.py", - "content": "HealthRegistry\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (2)", - "layer": "C4_SEMANTIC_ROLES", - "title": "HealthRegistry", - "span_start": 8, - "span_end": 56, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 29, - "layer_rank": 2, - "distance": null, - "metadata": { - "symbol_id": "fd3390eb0ba29c9979466b9c2117238e0da3bb829eeb4d505cb34c9c3df7a8e8", - "symbol_name": "HealthRegistry", - "qname": "HealthRegistry", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 2, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "26e6a24daa43407ba5340b74497c20153020e79f8d7828ae502aaec378dfcf75", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/types.py", - "content": "HealthPayload\nrole: model\n\nResponsibilities:\n- default model role", - "layer": "C4_SEMANTIC_ROLES", - "title": "HealthPayload", - "span_start": 7, - "span_end": 11, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 40, - "layer_rank": 2, - "distance": null, - "metadata": { - "symbol_id": "392235d63ddf752d6e419cb8528c93fe070d1bc02d3c87ba6a897baac810cf5d", - "symbol_name": "HealthPayload", - "qname": "HealthPayload", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "448a02e4a432b5ab65b246b2bd24a32a6f127b9d2091ea73b53ee3c0a2f53bb3", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/contracts/health.py", - "content": "HealthContributor\nrole: model\n\nResponsibilities:\n- default model role", - "layer": "C4_SEMANTIC_ROLES", - "title": "HealthContributor", - "span_start": 7, - "span_end": 10, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 40, - "layer_rank": 2, - "distance": null, - "metadata": { - "symbol_id": "db91ae387b89a2e9d83829754f27fa18a4055b3e72d7f31789a0b8e0bf5bba0b", - "symbol_name": "HealthContributor", - "qname": "HealthContributor", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "6bd92611def7131e32d4dd34a8ed85e6cf3c67722ad27797032a632cb30dc097", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "ControlActionSet\nrole: model\n\nResponsibilities:\n- default model role", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlActionSet", - "span_start": 14, - "span_end": 18, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 40, - "layer_rank": 2, - "distance": null, - "metadata": { - "symbol_id": "46eb026cb3313415ec47b82dd22f84f4d112c9d987e8b1716dcb0baa1cce8988", - "symbol_name": "ControlActionSet", - "qname": "ControlActionSet", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "ControlChannel\nrole: model\n\nResponsibilities:\n- default model role", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlChannel", - "span_start": 21, - "span_end": 28, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 40, - "layer_rank": 2, - "distance": null, - "metadata": { - "symbol_id": "cfcfe9a311d3a2dbdaf32ac4ccd73c0eb9a117f830591a1c0867ee97d46204ff", - "symbol_name": "ControlChannel", - "qname": "ControlChannel", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests service\n- reads and writes state attributes\n- participates in dataflow slices (5)", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlPlaneService", - "span_start": 12, - "span_end": 52, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 68, - "layer_rank": 2, - "distance": null, - "metadata": { - "symbol_id": "b13471e5916986dccffb53fab613812842965705e6b3a89ae549d30c9e91e9aa", - "symbol_name": "ControlPlaneService", - "qname": "ControlPlaneService", - "role": "pipeline_stage", - "confidence": 0.57, - "dataflow_participation": 5, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_runner.py", - "content": "UvicornThreadRunner\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (24)", - "layer": "C4_SEMANTIC_ROLES", - "title": "UvicornThreadRunner", - "span_start": 10, - "span_end": 61, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 11, - "layer_rank": 2, - "distance": null, - "metadata": { - "symbol_id": "fd55630045a02100df8877ac27d951ee08617d4598764394d48cb51fe067476a", - "symbol_name": "UvicornThreadRunner", - "qname": "UvicornThreadRunner", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 24, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "3779fdd2878b770e789a35bb2a89c9d79f13b61c26d7db1b3b683f9bb9e1623f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/health/registry.py", - "content": "HealthRegistry.__init__\n -> HealthRegistry._contributors\n -> HealthRegistry.register", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "HealthRegistry.__init__:dataflow_slice", - "span_start": 10, - "span_end": 13, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": null, - "metadata": { - "edge_id": "2381dfb339d541367c3251d2a610cac9d8b3f6bd6a352e119d00a93c5ccc2b7d", - "edge_type": "dataflow_slice", - "src_symbol_id": "e8ffd58441c231de43d9e86c31eb12303d4e2bf045b2acf13d1dfe78da01f8dc", - "src_qname": "HealthRegistry.__init__", - "dst_symbol_id": "a9e1f290c346c8bb1d67af0cafeebb5bcaf29c3ed7027e33c794532743df38f2", - "dst_ref": "HealthRegistry.register", - "resolution": "resolved", - "slice_id": "2381dfb339d541367c3251d2a610cac9d8b3f6bd6a352e119d00a93c5ccc2b7d", - "root_symbol_id": "e8ffd58441c231de43d9e86c31eb12303d4e2bf045b2acf13d1dfe78da01f8dc", - "path_symbols": [ - "HealthRegistry.__init__", - "HealthRegistry._contributors", - "HealthRegistry.register" - ], - "path_symbol_ids": [ - "e8ffd58441c231de43d9e86c31eb12303d4e2bf045b2acf13d1dfe78da01f8dc", - "a9e1f290c346c8bb1d67af0cafeebb5bcaf29c3ed7027e33c794532743df38f2" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "26e6a24daa43407ba5340b74497c20153020e79f8d7828ae502aaec378dfcf75", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.start", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 20, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": null, - "metadata": { - "edge_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154", - "dst_ref": "ControlPlaneService.start", - "resolution": "resolved", - "slice_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.start" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.stop", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 25, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": null, - "metadata": { - "edge_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d", - "dst_ref": "ControlPlaneService.stop", - "resolution": "resolved", - "slice_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.stop" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._stop_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 51, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": null, - "metadata": { - "edge_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a", - "dst_ref": "ControlPlaneService._stop_async", - "resolution": "resolved", - "slice_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._stop_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/health/registry.py", - "content": "HealthRegistry.__init__\n -> HealthRegistry._contributors\n -> HealthRegistry.contributor_healths", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "HealthRegistry.__init__:dataflow_slice", - "span_start": 10, - "span_end": 16, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": null, - "metadata": { - "edge_id": "d3a88a7abf16359e903e809ffc24473658fdd8198f60641fe1584fc4ac663c31", - "edge_type": "dataflow_slice", - "src_symbol_id": "e8ffd58441c231de43d9e86c31eb12303d4e2bf045b2acf13d1dfe78da01f8dc", - "src_qname": "HealthRegistry.__init__", - "dst_symbol_id": "fa7bbd8f4b64a55a5088640c30f52e84075d65f531bd7e1f6c1d7bb8d24fcbf2", - "dst_ref": "HealthRegistry.contributor_healths", - "resolution": "resolved", - "slice_id": "d3a88a7abf16359e903e809ffc24473658fdd8198f60641fe1584fc4ac663c31", - "root_symbol_id": "e8ffd58441c231de43d9e86c31eb12303d4e2bf045b2acf13d1dfe78da01f8dc", - "path_symbols": [ - "HealthRegistry.__init__", - "HealthRegistry._contributors", - "HealthRegistry.contributor_healths" - ], - "path_symbol_ids": [ - "e8ffd58441c231de43d9e86c31eb12303d4e2bf045b2acf13d1dfe78da01f8dc", - "fa7bbd8f4b64a55a5088640c30f52e84075d65f531bd7e1f6c1d7bb8d24fcbf2" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "26e6a24daa43407ba5340b74497c20153020e79f8d7828ae502aaec378dfcf75", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._start_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 47, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": null, - "metadata": { - "edge_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517", - "dst_ref": "ControlPlaneService._start_async", - "resolution": "resolved", - "slice_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._start_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.register_channel", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 17, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": null, - "metadata": { - "edge_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957", - "dst_ref": "ControlPlaneService.register_channel", - "resolution": "resolved", - "slice_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.register_channel" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "HttpControlAppFactory.create calls time.monotonic", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "HttpControlAppFactory.create:calls", - "span_start": 25, - "span_end": 25, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": null, - "metadata": { - "edge_id": "3fdd0a88d10225ee74f3b84ab57e13f09f5ccc72f00e31af9ae4655411c289c0", - "edge_type": "calls", - "src_symbol_id": "4af42c2a9275d652e710a98ec48b8247236b4453a093629f8958704ff6d3cb58", - "src_qname": "HttpControlAppFactory.create", - "dst_symbol_id": null, - "dst_ref": "time.monotonic", - "resolution": "partial", - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "HttpControlAppFactory.create calls app.post", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "HttpControlAppFactory.create:calls", - "span_start": 37, - "span_end": 37, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": null, - "metadata": { - "edge_id": "0e545d4b5187db7bec5ceac03071d2ad68177550c42af748fee364639e533c90", - "edge_type": "calls", - "src_symbol_id": "4af42c2a9275d652e710a98ec48b8247236b4453a093629f8958704ff6d3cb58", - "src_qname": "HttpControlAppFactory.create", - "dst_symbol_id": null, - "dst_ref": "app.post", - "resolution": "partial", - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "HttpControlAppFactory.create calls str", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "HttpControlAppFactory.create:calls", - "span_start": 27, - "span_end": 27, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": null, - "metadata": { - "edge_id": "2a87c51461e31cd556508cc37fdff37b4d24c26f7f1604db30af5e8f1bda96cb", - "edge_type": "calls", - "src_symbol_id": "4af42c2a9275d652e710a98ec48b8247236b4453a093629f8958704ff6d3cb58", - "src_qname": "HttpControlAppFactory.create", - "dst_symbol_id": null, - "dst_ref": "str", - "resolution": "partial", - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": null, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": null, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": null, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "retrieval_report": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "vector", - "C0_SOURCE_CHUNKS": "vector", - "C4_SEMANTIC_ROLES": "vector", - "C2_DEPENDENCY_GRAPH": "vector", - "C3_ENTRYPOINTS": "vector" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 8, - "C4_SEMANTIC_ROLES": 8, - "C2_DEPENDENCY_GRAPH": 10, - "C3_ENTRYPOINTS": 10 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [] - }, - "C4_SEMANTIC_ROLES": { - "path_scope": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [] - } - }, - "fallback": { - "used": false, - "reason": null - }, - "retrieval_by_layer_ms": { - "C1_SYMBOL_CATALOG": 67, - "C0_SOURCE_CHUNKS": 27, - "C4_SEMANTIC_ROLES": 22, - "C2_DEPENDENCY_GRAPH": 60, - "C3_ENTRYPOINTS": 19 - } - } - }, - "diagnostics": { - "intent_correct": null, - "target_found": true, - "layers_used": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_sufficient": true, - "answer_mode": "normal", - "resolved_target": "HttpControlAppFactory", - "answer_policy_branch": "normal_answer", - "decision_reason": "evidence_sufficient", - "router_result": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "retrieval_profile": "code", - "sub_intent": "TRACE_FLOW", - "path_scope": [], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "symbol_resolution_status": "resolved" - }, - "retrieval_request": { - "rag_session_id": "7d11da21-faa0-4cea-aede-aeabe069164c", - "query": "Покажи как проходит запрос /health в HttpControlAppFactory", - "sub_intent": "TRACE_FLOW", - "path_scope": [], - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "per_layer_outcome": [ - { - "layer_id": "C1_SYMBOL_CATALOG", - "hit_count": 8, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C0_SOURCE_CHUNKS", - "hit_count": 8, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C4_SEMANTIC_ROLES", - "hit_count": 8, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C2_DEPENDENCY_GRAPH", - "hit_count": 10, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C3_ENTRYPOINTS", - "hit_count": 3, - "empty": false, - "fallback_used": false - } - ], - "empty_layers": [], - "evidence_gate_decision": { - "sufficient": true, - "failure_reasons": [], - "evidence_count": 37 - }, - "evidence_gate_input": { - "resolved_target": "HttpControlAppFactory", - "sub_intent": "TRACE_FLOW", - "target_type": "symbol", - "evidence_count": 37, - "code_chunk_count": 37, - "entrypoint_count": 3, - "relation_count": 10, - "test_evidence_count": 0, - "symbol_resolution_status": "resolved", - "path_scope": [] - }, - "post_evidence_gate": { - "input": { - "answer_mode": "normal", - "degraded_message": "", - "resolved_target": "HttpControlAppFactory", - "draft_answer_preview": "Запрос /health обрабатывается следующим образом:\n\n1. В файле `http_app.py` класс `HttpControlAppFactory` создаёт объект FastAPI с маршрутом `/health`.\n2. Маршрут `/health` сопоставлен с функцией-обработчиком `health`, определённой внутри фабрики на строках 31–34.\n3. При обращении к маршруту `/health", - "repair_candidate": true - }, - "output": { - "passed": true, - "action": "return", - "reasons": [], - "repair_used": false, - "final_answer_preview": "Запрос /health обрабатывается следующим образом:\n\n1. В файле `http_app.py` класс `HttpControlAppFactory` создаёт объект FastAPI с маршрутом `/health`.\n2. Маршрут `/health` сопоставлен с функцией-обработчиком `health`, определённой внутри фабрики на строках 31–34.\n3. При обращении к маршруту `/health" - } - }, - "failure_reasons": [], - "timings_ms": { - "router": 1, - "retrieval": 197, - "pre_evidence_gate": 1, - "llm": 3593, - "post_evidence_gate": 1 - } - }, - "rag_rows": [ - { - "path": "src/app_runtime/control/http_app.py", - "content": "class HttpControlAppFactory\nHttpControlAppFactory", - "layer": "C1_SYMBOL_CATALOG", - "title": "HttpControlAppFactory", - "span_start": 15, - "span_end": 53, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "9b3502a5fb408b273223db13264349cf500de24915b6c649d9ea8970d0dfd8e0", - "qname": "HttpControlAppFactory", - "kind": "class", - "signature": "HttpControlAppFactory", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.control.http_app", - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "const HttpControlAppFactory\nHttpControlAppFactory = app_runtime.control.http_app.HttpControlAppFactory", - "layer": "C1_SYMBOL_CATALOG", - "title": "HttpControlAppFactory", - "span_start": 8, - "span_end": 8, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "9ee00379ee797cd2386e88a6e37dc69e3e31de9144fc4b95f0206cd1430e8983", - "qname": "HttpControlAppFactory", - "kind": "const", - "signature": "HttpControlAppFactory = app_runtime.control.http_app.HttpControlAppFactory", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.control.http_channel", - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "class ControlActionSet\nControlActionSet", - "layer": "C1_SYMBOL_CATALOG", - "title": "ControlActionSet", - "span_start": 14, - "span_end": 18, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "46eb026cb3313415ec47b82dd22f84f4d112c9d987e8b1716dcb0baa1cce8988", - "qname": "ControlActionSet", - "kind": "class", - "signature": "ControlActionSet", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.control.base", - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/__init__.py", - "content": "const ControlPlaneService\nControlPlaneService = app_runtime.control.service.ControlPlaneService", - "layer": "C1_SYMBOL_CATALOG", - "title": "ControlPlaneService", - "span_start": 3, - "span_end": 3, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "217e8f044d1c01644bf7b81e5046af9e84469210c692a2fb0c476a19bb069ae1", - "qname": "ControlPlaneService", - "kind": "const", - "signature": "ControlPlaneService = app_runtime.control.service.ControlPlaneService", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.control.__init__", - "is_test": false, - "blob_sha": "bf3c37e3369a84cc618adc0fd71c232e5eb4b871eaff743069a17e661e498316", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/contracts/health.py", - "content": "method HealthContributor.health\nhealth(self)\nReturn contributor health state.", - "layer": "C1_SYMBOL_CATALOG", - "title": "HealthContributor.health", - "span_start": 9, - "span_end": 10, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "728cff18958d8a25e2661a0f08c83d68c3bbbfa8cef212b85dc0da2b11b3dc90", - "qname": "HealthContributor.health", - "kind": "method", - "signature": "health(self)", - "parent_symbol_id": "HealthContributor", - "package_or_module": "src.app_runtime.contracts.health", - "is_test": false, - "blob_sha": "6bd92611def7131e32d4dd34a8ed85e6cf3c67722ad27797032a632cb30dc097", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/contracts/health.py", - "content": "class HealthContributor\nHealthContributor(ABC)", - "layer": "C1_SYMBOL_CATALOG", - "title": "HealthContributor", - "span_start": 7, - "span_end": 10, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "db91ae387b89a2e9d83829754f27fa18a4055b3e72d7f31789a0b8e0bf5bba0b", - "qname": "HealthContributor", - "kind": "class", - "signature": "HealthContributor(ABC)", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.contracts.health", - "is_test": false, - "blob_sha": "6bd92611def7131e32d4dd34a8ed85e6cf3c67722ad27797032a632cb30dc097", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/__init__.py", - "content": "const ControlActionSet\nControlActionSet = app_runtime.control.base.ControlActionSet", - "layer": "C1_SYMBOL_CATALOG", - "title": "ControlActionSet", - "span_start": 1, - "span_end": 1, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "767e4ac0d4224aeccb0783a38359d3c03899a876736eb83d99887c16ea07cc6c", - "qname": "ControlActionSet", - "kind": "const", - "signature": "ControlActionSet = app_runtime.control.base.ControlActionSet", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.control.__init__", - "is_test": false, - "blob_sha": "bf3c37e3369a84cc618adc0fd71c232e5eb4b871eaff743069a17e661e498316", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/__init__.py", - "content": "const ControlChannel\nControlChannel = app_runtime.control.base.ControlChannel", - "layer": "C1_SYMBOL_CATALOG", - "title": "ControlChannel", - "span_start": 1, - "span_end": 1, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "268420f7aa4ed74082b9276cae0cded4f00bac090ffd58fa020a65be0fe19c27", - "qname": "ControlChannel", - "kind": "const", - "signature": "ControlChannel = app_runtime.control.base.ControlChannel", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.control.__init__", - "is_test": false, - "blob_sha": "bf3c37e3369a84cc618adc0fd71c232e5eb4b871eaff743069a17e661e498316", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "class HttpControlChannel(ControlChannel):\n def __init__(self, host: str, port: int, timeout: int) -> None:\n self._timeout = timeout\n self._runner = UvicornThreadRunner(host, port, timeout)\n self._factory = HttpControlAppFactory()\n self._actions: ControlActionSet | None = None\n\n async def start(self, actions: ControlActionSet) -> None:\n self._actions = actions\n app = self._factory.create(self._health_response, self._action_response)\n await self._runner.start(app)\n\n async def stop(self) -> None:\n await self._runner.stop()\n\n @property\n def port(self) -> int:\n return self._runner.port\n\n async def _health_response(self) -> dict[str, object]:\n if self._actions is None:\n return {\"status\": \"unhealthy\", \"detail\": \"control actions are not configured\"}\n return await asyncio.wait_for(self._actions.health(), timeout=float(self._timeout))\n\n async def _action_response(self, action: str, _client_source: str = \"unknown\") -> JSONResponse:\n if self._actions is None:\n return JSONResponse(content={\"status\": \"error\", \"detail\": f\"{action} handler is not configured\"}, status_code=404)\n callbacks = {\n \"start\": self._actions.start,\n \"stop\": self._actions.stop,\n \"status\": self._actions.status,\n }\n callback = callbacks.get(action)\n if callback is None:\n return JSONResponse(content={\"status\": \"error\", \"detail\": f\"unsupported action: {action}\"}, status_code=404)\n action_timeout = max(float(self._timeout), 10.0) if action in {\"start\", \"stop\"} else float(self._timeout)\n try:\n detail = await asyncio.wait_for(callback(), timeout=action_timeout)\n except asyncio.TimeoutError:\n return JSONResponse(\n content={\"status\": \"accepted\", \"detail\": f\"{action} operation is still in progress\"},\n status_code=202,\n )\n except Exception as exc:\n return JSONResponse(content={\"status\": \"error\", \"detail\": str(exc)}, status_code=500)\n return JSONResponse(content={\"status\": \"ok\", \"detail\": detail or f\"{action} action accepted\"}, status_code=200)", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/http_channel.py:HttpControlChannel", - "span_start": 12, - "span_end": 57, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.http_channel", - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_runner.py", - "content": "class UvicornThreadRunner:\n def __init__(self, host: str, port: int, timeout: int) -> None:\n self._host = host\n self._port = port\n self._timeout = timeout\n self._server: Server | None = None\n self._thread: Thread | None = None\n self._error: BaseException | None = None\n\n async def start(self, app: FastAPI) -> None:\n if self._thread is not None and self._thread.is_alive():\n return\n self._error = None\n config = Config(app=app, host=self._host, port=self._port, log_level=\"warning\")\n self._server = Server(config)\n self._thread = Thread(target=self._serve, name=\"plba-http-control\", daemon=True)\n self._thread.start()\n await self._wait_until_started()\n\n async def stop(self) -> None:\n if self._server is None or self._thread is None:\n return\n self._server.should_exit = True\n await asyncio.to_thread(self._thread.join, self._timeout)\n self._server = None\n self._thread = None\n\n @property\n def port(self) -> int:\n if self._server is None or not getattr(self._server, \"servers\", None):\n return self._port\n socket = self._server.servers[0].sockets[0]\n return int(socket.getsockname()[1])\n\n async def _wait_until_started(self) -> None:\n if self._server is None:\n raise RuntimeError(\"Server is not initialized\")\n deadline = asyncio.get_running_loop().time() + max(float(self._timeout), 1.0)\n while not self._server.started:\n if self._error is not None:\n raise RuntimeError(\"HTTP control server failed to start\") from self._error\n if asyncio.get_running_loop().time() >= deadline:\n raise TimeoutError(\"HTTP control server startup timed out\")\n await asyncio.sleep(0.05)\n\n def _serve(self) -> None:\n if self._server is None:\n return\n try:\n asyncio.run(self._server.serve())\n except BaseException as exc: # noqa: BLE001\n self._error = exc", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/http_runner.py:UvicornThreadRunner", - "span_start": 10, - "span_end": 61, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.http_runner", - "is_test": false, - "blob_sha": "3779fdd2878b770e789a35bb2a89c9d79f13b61c26d7db1b3b683f9bb9e1623f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "class HttpControlAppFactory:\n def create(\n self,\n health_provider: Callable[[], Awaitable[HealthPayload]],\n action_provider: Callable[[str, str], Awaitable[JSONResponse]],\n ) -> FastAPI:\n app = FastAPI(title=\"PLBA Control API\")\n\n @app.middleware(\"http\")\n async def log_api_call(request: Request, call_next): # type: ignore[no-untyped-def]\n started = time.monotonic()\n response = await call_next(request)\n response.headers[\"X-Response-Time-Ms\"] = str(int((time.monotonic() - started) * 1000))\n return response\n\n @app.get(\"/health\")\n async def health() -> JSONResponse:\n payload = await health_provider()\n status_code = 200 if payload.get(\"status\") == \"ok\" else 503\n return JSONResponse(content=payload, status_code=status_code)\n\n @app.get(\"/actions/{action}\")\n @app.post(\"/actions/{action}\")\n async def action(action: str, request: Request) -> JSONResponse:\n client_source = self._client_source(request)\n if action in {\"start\", \"stop\"}:\n LOGGER.warning(\"Control action requested: /actions/%s client=%s\", action, client_source)\n return await action_provider(action, client_source)\n\n return app\n\n def _client_source(self, request: Request) -> str:\n explicit_header = request.headers.get(\"X-Client-Source\", \"\").strip()\n if explicit_header:\n return explicit_header\n user_agent = request.headers.get(\"User-Agent\", \"\").strip()\n if user_agent:\n return f\"user-agent:{user_agent}\"\n return \"unknown\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/http_app.py:HttpControlAppFactory", - "span_start": 15, - "span_end": 53, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.http_app", - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/contracts/health.py", - "content": "class HealthContributor(ABC):\n @abstractmethod\n def health(self) -> WorkerHealth:\n \"\"\"Return contributor health state.\"\"\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/contracts/health.py:HealthContributor", - "span_start": 7, - "span_end": 10, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.contracts.health", - "is_test": false, - "blob_sha": "6bd92611def7131e32d4dd34a8ed85e6cf3c67722ad27797032a632cb30dc097", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "class ControlChannel(ABC):\n @abstractmethod\n async def start(self, actions: ControlActionSet) -> None:\n \"\"\"Start the control channel and bind handlers.\"\"\"\n\n @abstractmethod\n async def stop(self) -> None:\n \"\"\"Stop the control channel and release resources.\"\"\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/base.py:ControlChannel", - "span_start": 21, - "span_end": 28, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 1, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.base", - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/__init__.py", - "content": "from app_runtime.control.base import ControlActionSet, ControlChannel\nfrom app_runtime.control.http_channel import HttpControlChannel\nfrom app_runtime.control.service import ControlPlaneService\n\n__all__ = [\"ControlActionSet\", \"ControlChannel\", \"ControlPlaneService\", \"HttpControlChannel\"]", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/__init__.py:1-5", - "span_start": 1, - "span_end": 5, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.app_runtime.control.__init__", - "is_test": false, - "blob_sha": "bf3c37e3369a84cc618adc0fd71c232e5eb4b871eaff743069a17e661e498316", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "class ControlActionSet:\n health: HealthHandler\n start: ActionHandler\n stop: ActionHandler\n status: ActionHandler", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/base.py:ControlActionSet", - "span_start": 14, - "span_end": 18, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.base", - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "class ControlPlaneService:\n def __init__(self) -> None:\n self._channels: list[ControlChannel] = []\n\n def register_channel(self, channel: ControlChannel) -> None:\n self._channels.append(channel)\n\n def start(self, runtime: RuntimeManager) -> None:\n if not self._channels:\n return\n asyncio.run(self._start_async(runtime))\n\n def stop(self) -> None:\n if not self._channels:\n return\n asyncio.run(self._stop_async())\n\n def snapshot(self, runtime: RuntimeManager) -> dict[str, object]:\n health = runtime.current_health()\n return {\n \"runtime\": {\"state\": runtime._state.value},\n \"modules\": list(runtime.registry.modules),\n \"services\": runtime.services.snapshot(),\n \"workers\": runtime.workers.snapshot(),\n \"health\": runtime.health.snapshot(runtime.workers.healths()) | {\"status\": health[\"status\"]},\n \"config\": runtime.configuration.get(),\n }\n\n async def _start_async(self, runtime: RuntimeManager) -> None:\n actions = ControlActionSet(\n health=runtime.health_status,\n start=runtime.start_runtime,\n stop=runtime.stop_runtime,\n status=runtime.runtime_status,\n )\n for channel in self._channels:\n await channel.start(actions)\n\n async def _stop_async(self) -> None:\n for channel in reversed(self._channels):\n await channel.stop()", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/service.py:ControlPlaneService", - "span_start": 12, - "span_end": 52, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.service", - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "HttpControlAppFactory\nrole: factory\n\nResponsibilities:\n- name suffix suggests factory", - "layer": "C4_SEMANTIC_ROLES", - "title": "HttpControlAppFactory", - "span_start": 15, - "span_end": 53, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 39, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "9b3502a5fb408b273223db13264349cf500de24915b6c649d9ea8970d0dfd8e0", - "symbol_name": "HttpControlAppFactory", - "qname": "HttpControlAppFactory", - "role": "factory", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/health/registry.py", - "content": "HealthRegistry\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (2)", - "layer": "C4_SEMANTIC_ROLES", - "title": "HealthRegistry", - "span_start": 8, - "span_end": 56, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 29, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "fd3390eb0ba29c9979466b9c2117238e0da3bb829eeb4d505cb34c9c3df7a8e8", - "symbol_name": "HealthRegistry", - "qname": "HealthRegistry", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 2, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "26e6a24daa43407ba5340b74497c20153020e79f8d7828ae502aaec378dfcf75", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/types.py", - "content": "HealthPayload\nrole: model\n\nResponsibilities:\n- default model role", - "layer": "C4_SEMANTIC_ROLES", - "title": "HealthPayload", - "span_start": 7, - "span_end": 11, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 40, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "392235d63ddf752d6e419cb8528c93fe070d1bc02d3c87ba6a897baac810cf5d", - "symbol_name": "HealthPayload", - "qname": "HealthPayload", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "448a02e4a432b5ab65b246b2bd24a32a6f127b9d2091ea73b53ee3c0a2f53bb3", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/contracts/health.py", - "content": "HealthContributor\nrole: model\n\nResponsibilities:\n- default model role", - "layer": "C4_SEMANTIC_ROLES", - "title": "HealthContributor", - "span_start": 7, - "span_end": 10, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 40, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "db91ae387b89a2e9d83829754f27fa18a4055b3e72d7f31789a0b8e0bf5bba0b", - "symbol_name": "HealthContributor", - "qname": "HealthContributor", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "6bd92611def7131e32d4dd34a8ed85e6cf3c67722ad27797032a632cb30dc097", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "ControlActionSet\nrole: model\n\nResponsibilities:\n- default model role", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlActionSet", - "span_start": 14, - "span_end": 18, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 40, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "46eb026cb3313415ec47b82dd22f84f4d112c9d987e8b1716dcb0baa1cce8988", - "symbol_name": "ControlActionSet", - "qname": "ControlActionSet", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "ControlChannel\nrole: model\n\nResponsibilities:\n- default model role", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlChannel", - "span_start": 21, - "span_end": 28, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 40, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "cfcfe9a311d3a2dbdaf32ac4ccd73c0eb9a117f830591a1c0867ee97d46204ff", - "symbol_name": "ControlChannel", - "qname": "ControlChannel", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests service\n- reads and writes state attributes\n- participates in dataflow slices (5)", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlPlaneService", - "span_start": 12, - "span_end": 52, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 68, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "b13471e5916986dccffb53fab613812842965705e6b3a89ae549d30c9e91e9aa", - "symbol_name": "ControlPlaneService", - "qname": "ControlPlaneService", - "role": "pipeline_stage", - "confidence": 0.57, - "dataflow_participation": 5, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_runner.py", - "content": "UvicornThreadRunner\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (24)", - "layer": "C4_SEMANTIC_ROLES", - "title": "UvicornThreadRunner", - "span_start": 10, - "span_end": 61, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 11, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "fd55630045a02100df8877ac27d951ee08617d4598764394d48cb51fe067476a", - "symbol_name": "UvicornThreadRunner", - "qname": "UvicornThreadRunner", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 24, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "3779fdd2878b770e789a35bb2a89c9d79f13b61c26d7db1b3b683f9bb9e1623f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/health/registry.py", - "content": "HealthRegistry.__init__\n -> HealthRegistry._contributors\n -> HealthRegistry.register", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "HealthRegistry.__init__:dataflow_slice", - "span_start": 10, - "span_end": 13, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "2381dfb339d541367c3251d2a610cac9d8b3f6bd6a352e119d00a93c5ccc2b7d", - "edge_type": "dataflow_slice", - "src_symbol_id": "e8ffd58441c231de43d9e86c31eb12303d4e2bf045b2acf13d1dfe78da01f8dc", - "src_qname": "HealthRegistry.__init__", - "dst_symbol_id": "a9e1f290c346c8bb1d67af0cafeebb5bcaf29c3ed7027e33c794532743df38f2", - "dst_ref": "HealthRegistry.register", - "resolution": "resolved", - "slice_id": "2381dfb339d541367c3251d2a610cac9d8b3f6bd6a352e119d00a93c5ccc2b7d", - "root_symbol_id": "e8ffd58441c231de43d9e86c31eb12303d4e2bf045b2acf13d1dfe78da01f8dc", - "path_symbols": [ - "HealthRegistry.__init__", - "HealthRegistry._contributors", - "HealthRegistry.register" - ], - "path_symbol_ids": [ - "e8ffd58441c231de43d9e86c31eb12303d4e2bf045b2acf13d1dfe78da01f8dc", - "a9e1f290c346c8bb1d67af0cafeebb5bcaf29c3ed7027e33c794532743df38f2" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "26e6a24daa43407ba5340b74497c20153020e79f8d7828ae502aaec378dfcf75", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.start", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 20, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154", - "dst_ref": "ControlPlaneService.start", - "resolution": "resolved", - "slice_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.start" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.stop", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 25, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d", - "dst_ref": "ControlPlaneService.stop", - "resolution": "resolved", - "slice_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.stop" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._stop_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 51, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a", - "dst_ref": "ControlPlaneService._stop_async", - "resolution": "resolved", - "slice_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._stop_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/health/registry.py", - "content": "HealthRegistry.__init__\n -> HealthRegistry._contributors\n -> HealthRegistry.contributor_healths", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "HealthRegistry.__init__:dataflow_slice", - "span_start": 10, - "span_end": 16, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "d3a88a7abf16359e903e809ffc24473658fdd8198f60641fe1584fc4ac663c31", - "edge_type": "dataflow_slice", - "src_symbol_id": "e8ffd58441c231de43d9e86c31eb12303d4e2bf045b2acf13d1dfe78da01f8dc", - "src_qname": "HealthRegistry.__init__", - "dst_symbol_id": "fa7bbd8f4b64a55a5088640c30f52e84075d65f531bd7e1f6c1d7bb8d24fcbf2", - "dst_ref": "HealthRegistry.contributor_healths", - "resolution": "resolved", - "slice_id": "d3a88a7abf16359e903e809ffc24473658fdd8198f60641fe1584fc4ac663c31", - "root_symbol_id": "e8ffd58441c231de43d9e86c31eb12303d4e2bf045b2acf13d1dfe78da01f8dc", - "path_symbols": [ - "HealthRegistry.__init__", - "HealthRegistry._contributors", - "HealthRegistry.contributor_healths" - ], - "path_symbol_ids": [ - "e8ffd58441c231de43d9e86c31eb12303d4e2bf045b2acf13d1dfe78da01f8dc", - "fa7bbd8f4b64a55a5088640c30f52e84075d65f531bd7e1f6c1d7bb8d24fcbf2" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "26e6a24daa43407ba5340b74497c20153020e79f8d7828ae502aaec378dfcf75", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._start_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 47, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517", - "dst_ref": "ControlPlaneService._start_async", - "resolution": "resolved", - "slice_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._start_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.register_channel", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 17, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957", - "dst_ref": "ControlPlaneService.register_channel", - "resolution": "resolved", - "slice_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.register_channel" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "HttpControlAppFactory.create calls time.monotonic", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "HttpControlAppFactory.create:calls", - "span_start": 25, - "span_end": 25, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "3fdd0a88d10225ee74f3b84ab57e13f09f5ccc72f00e31af9ae4655411c289c0", - "edge_type": "calls", - "src_symbol_id": "4af42c2a9275d652e710a98ec48b8247236b4453a093629f8958704ff6d3cb58", - "src_qname": "HttpControlAppFactory.create", - "dst_symbol_id": null, - "dst_ref": "time.monotonic", - "resolution": "partial", - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "HttpControlAppFactory.create calls app.post", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "HttpControlAppFactory.create:calls", - "span_start": 37, - "span_end": 37, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "0e545d4b5187db7bec5ceac03071d2ad68177550c42af748fee364639e533c90", - "edge_type": "calls", - "src_symbol_id": "4af42c2a9275d652e710a98ec48b8247236b4453a093629f8958704ff6d3cb58", - "src_qname": "HttpControlAppFactory.create", - "dst_symbol_id": null, - "dst_ref": "app.post", - "resolution": "partial", - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "HttpControlAppFactory.create calls str", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "HttpControlAppFactory.create:calls", - "span_start": 27, - "span_end": 27, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "2a87c51461e31cd556508cc37fdff37b4d24c26f7f1604db30af5e8f1bda96cb", - "edge_type": "calls", - "src_symbol_id": "4af42c2a9275d652e710a98ec48b8247236b4453a093629f8958704ff6d3cb58", - "src_qname": "HttpControlAppFactory.create", - "dst_symbol_id": null, - "dst_ref": "str", - "resolution": "partial", - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "validation": { - "passed": true, - "action": "return", - "reasons": [] - }, - "steps": [ - { - "step": "router", - "status": "completed", - "timings_ms": { - "router": 1 - }, - "output": { - "intent": "CODE_QA", - "sub_intent": "TRACE_FLOW", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - } - }, - { - "step": "retrieval", - "status": "completed", - "timings_ms": { - "retrieval": 197 - }, - "output": { - "rag_count": 37, - "answer_path_rag_count": 37, - "resolved_symbol_status": "resolved", - "resolved_symbol": "HttpControlAppFactory", - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "diagnostics": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "vector", - "C0_SOURCE_CHUNKS": "vector", - "C4_SEMANTIC_ROLES": "vector", - "C2_DEPENDENCY_GRAPH": "vector", - "C3_ENTRYPOINTS": "vector" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 8, - "C4_SEMANTIC_ROLES": 8, - "C2_DEPENDENCY_GRAPH": 10, - "C3_ENTRYPOINTS": 10 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [] - }, - "C4_SEMANTIC_ROLES": { - "path_scope": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [] - } - }, - "fallback": { - "used": false, - "reason": null - }, - "retrieval_by_layer_ms": { - "C1_SYMBOL_CATALOG": 67, - "C0_SOURCE_CHUNKS": 27, - "C4_SEMANTIC_ROLES": 22, - "C2_DEPENDENCY_GRAPH": 60, - "C3_ENTRYPOINTS": 19 - } - } - }, - { - "step": "pre_evidence_gate", - "status": "passed", - "timings_ms": { - "pre_evidence_gate": 1 - }, - "input": { - "resolved_target": "HttpControlAppFactory", - "sub_intent": "TRACE_FLOW", - "target_type": "symbol", - "evidence_count": 37, - "code_chunk_count": 37, - "entrypoint_count": 3, - "relation_count": 10, - "test_evidence_count": 0, - "symbol_resolution_status": "resolved", - "path_scope": [] - }, - "output": { - "passed": true, - "failure_reasons": [], - "degraded_message": "", - "evidence_count": 37 - } - }, - { - "step": "llm", - "status": "completed", - "timings_ms": { - "llm": 3593 - }, - "output": { - "prompt_name": "code_qa_trace_flow_answer", - "answer_preview": "Запрос /health обрабатывается следующим образом:\n\n1. В файле `http_app.py` класс `HttpControlAppFactory` создаёт объект FastAPI с маршрутом `/health`.\n2. Маршрут `/health` сопоставлен с функцией-обработчиком `health`, определённой внутри фабрики на строках 31–34.\n3. При обращении к маршруту `/health", - "resolved_target": "HttpControlAppFactory", - "answer_policy_branch": "normal_answer", - "decision_reason": "evidence_sufficient" - } - }, - { - "step": "post_evidence_gate", - "status": "passed", - "timings_ms": { - "post_evidence_gate": 1, - "post_evidence_gate_recheck": 0, - "repair": 0 - }, - "input": { - "answer_mode": "normal", - "degraded_message": "", - "resolved_target": "HttpControlAppFactory", - "draft_answer_preview": "Запрос /health обрабатывается следующим образом:\n\n1. В файле `http_app.py` класс `HttpControlAppFactory` создаёт объект FastAPI с маршрутом `/health`.\n2. Маршрут `/health` сопоставлен с функцией-обработчиком `health`, определённой внутри фабрики на строках 31–34.\n3. При обращении к маршруту `/health", - "repair_candidate": true - }, - "output": { - "passed": true, - "action": "return", - "reasons": [], - "repair_used": false, - "final_answer_preview": "Запрос /health обрабатывается следующим образом:\n\n1. В файле `http_app.py` класс `HttpControlAppFactory` создаёт объект FastAPI с маршрутом `/health`.\n2. Маршрут `/health` сопоставлен с функцией-обработчиком `health`, определённой внутри фабрики на строках 31–34.\n3. При обращении к маршруту `/health" - } - } - ] - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/plba_full_chain_subintents_v3/20260312_174008/full_chain_plba_code_subintents_v2_plba-v2-trace-flow-health-endpoint.md b/tests/pipeline_setup_v3/test_results/plba_full_chain_subintents_v3/20260312_174008/full_chain_plba_code_subintents_v2_plba-v2-trace-flow-health-endpoint.md deleted file mode 100644 index 2b7404a..0000000 --- a/tests/pipeline_setup_v3/test_results/plba_full_chain_subintents_v3/20260312_174008/full_chain_plba_code_subintents_v2_plba-v2-trace-flow-health-endpoint.md +++ /dev/null @@ -1,306 +0,0 @@ -# plba-v2-trace-flow-health-endpoint - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_02_pipeline/full_chain_plba_code_subintents_v2.yaml -- runner: agent_runtime -- mode: full_chain -- passed: True - -## Query -Покажи как проходит запрос /health в HttpControlAppFactory - -## Actual -{ - "intent": "CODE_QA", - "sub_intent": "TRACE_FLOW", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 37, - "llm_answer": "Запрос /health обрабатывается следующим образом:\n\n1. В файле `http_app.py` класс `HttpControlAppFactory` создаёт объект FastAPI с маршрутом `/health`.\n2. Маршрут `/health` сопоставлен с функцией-обработчиком `health`, определённой внутри фабрики на строках 31–34.\n3. При обращении к маршруту `/health` вызывается этот обработчик, который асинхронно вызывает провайдер здоровья (`health_provider`), переданный в фабрику.\n4. Приложение обернуто middleware для логирования времени ответа, которое добавляется в заголовок X-Response-Time-Ms.\n\nЦепочка вызовов завершается на уровне фабрики, конкретных имплементаций провайдера здоровья в данном контексте нет.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "health", - "HttpControlAppFactory" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] -} - -## Steps -[ - { - "step": "router", - "status": "completed", - "timings_ms": { - "router": 1 - }, - "output": { - "intent": "CODE_QA", - "sub_intent": "TRACE_FLOW", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - } - }, - { - "step": "retrieval", - "status": "completed", - "timings_ms": { - "retrieval": 197 - }, - "output": { - "rag_count": 37, - "answer_path_rag_count": 37, - "resolved_symbol_status": "resolved", - "resolved_symbol": "HttpControlAppFactory", - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "diagnostics": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "vector", - "C0_SOURCE_CHUNKS": "vector", - "C4_SEMANTIC_ROLES": "vector", - "C2_DEPENDENCY_GRAPH": "vector", - "C3_ENTRYPOINTS": "vector" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 8, - "C4_SEMANTIC_ROLES": 8, - "C2_DEPENDENCY_GRAPH": 10, - "C3_ENTRYPOINTS": 10 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [] - }, - "C4_SEMANTIC_ROLES": { - "path_scope": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [] - } - }, - "fallback": { - "used": false, - "reason": null - }, - "retrieval_by_layer_ms": { - "C1_SYMBOL_CATALOG": 67, - "C0_SOURCE_CHUNKS": 27, - "C4_SEMANTIC_ROLES": 22, - "C2_DEPENDENCY_GRAPH": 60, - "C3_ENTRYPOINTS": 19 - } - } - }, - { - "step": "pre_evidence_gate", - "status": "passed", - "timings_ms": { - "pre_evidence_gate": 1 - }, - "input": { - "resolved_target": "HttpControlAppFactory", - "sub_intent": "TRACE_FLOW", - "target_type": "symbol", - "evidence_count": 37, - "code_chunk_count": 37, - "entrypoint_count": 3, - "relation_count": 10, - "test_evidence_count": 0, - "symbol_resolution_status": "resolved", - "path_scope": [] - }, - "output": { - "passed": true, - "failure_reasons": [], - "degraded_message": "", - "evidence_count": 37 - } - }, - { - "step": "llm", - "status": "completed", - "timings_ms": { - "llm": 3593 - }, - "output": { - "prompt_name": "code_qa_trace_flow_answer", - "answer_preview": "Запрос /health обрабатывается следующим образом:\n\n1. В файле `http_app.py` класс `HttpControlAppFactory` создаёт объект FastAPI с маршрутом `/health`.\n2. Маршрут `/health` сопоставлен с функцией-обработчиком `health`, определённой внутри фабрики на строках 31–34.\n3. При обращении к маршруту `/health", - "resolved_target": "HttpControlAppFactory", - "answer_policy_branch": "normal_answer", - "decision_reason": "evidence_sufficient" - } - }, - { - "step": "post_evidence_gate", - "status": "passed", - "timings_ms": { - "post_evidence_gate": 1, - "post_evidence_gate_recheck": 0, - "repair": 0 - }, - "input": { - "answer_mode": "normal", - "degraded_message": "", - "resolved_target": "HttpControlAppFactory", - "draft_answer_preview": "Запрос /health обрабатывается следующим образом:\n\n1. В файле `http_app.py` класс `HttpControlAppFactory` создаёт объект FastAPI с маршрутом `/health`.\n2. Маршрут `/health` сопоставлен с функцией-обработчиком `health`, определённой внутри фабрики на строках 31–34.\n3. При обращении к маршруту `/health", - "repair_candidate": true - }, - "output": { - "passed": true, - "action": "return", - "reasons": [], - "repair_used": false, - "final_answer_preview": "Запрос /health обрабатывается следующим образом:\n\n1. В файле `http_app.py` класс `HttpControlAppFactory` создаёт объект FastAPI с маршрутом `/health`.\n2. Маршрут `/health` сопоставлен с функцией-обработчиком `health`, определённой внутри фабрики на строках 31–34.\n3. При обращении к маршруту `/health" - } - } -] - -## Diagnostics -{ - "intent_correct": null, - "target_found": true, - "layers_used": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_sufficient": true, - "answer_mode": "normal", - "resolved_target": "HttpControlAppFactory", - "answer_policy_branch": "normal_answer", - "decision_reason": "evidence_sufficient", - "router_result": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "retrieval_profile": "code", - "sub_intent": "TRACE_FLOW", - "path_scope": [], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "symbol_resolution_status": "resolved" - }, - "retrieval_request": { - "rag_session_id": "7d11da21-faa0-4cea-aede-aeabe069164c", - "query": "Покажи как проходит запрос /health в HttpControlAppFactory", - "sub_intent": "TRACE_FLOW", - "path_scope": [], - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "per_layer_outcome": [ - { - "layer_id": "C1_SYMBOL_CATALOG", - "hit_count": 8, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C0_SOURCE_CHUNKS", - "hit_count": 8, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C4_SEMANTIC_ROLES", - "hit_count": 8, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C2_DEPENDENCY_GRAPH", - "hit_count": 10, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C3_ENTRYPOINTS", - "hit_count": 3, - "empty": false, - "fallback_used": false - } - ], - "empty_layers": [], - "evidence_gate_decision": { - "sufficient": true, - "failure_reasons": [], - "evidence_count": 37 - }, - "evidence_gate_input": { - "resolved_target": "HttpControlAppFactory", - "sub_intent": "TRACE_FLOW", - "target_type": "symbol", - "evidence_count": 37, - "code_chunk_count": 37, - "entrypoint_count": 3, - "relation_count": 10, - "test_evidence_count": 0, - "symbol_resolution_status": "resolved", - "path_scope": [] - }, - "post_evidence_gate": { - "input": { - "answer_mode": "normal", - "degraded_message": "", - "resolved_target": "HttpControlAppFactory", - "draft_answer_preview": "Запрос /health обрабатывается следующим образом:\n\n1. В файле `http_app.py` класс `HttpControlAppFactory` создаёт объект FastAPI с маршрутом `/health`.\n2. Маршрут `/health` сопоставлен с функцией-обработчиком `health`, определённой внутри фабрики на строках 31–34.\n3. При обращении к маршруту `/health", - "repair_candidate": true - }, - "output": { - "passed": true, - "action": "return", - "reasons": [], - "repair_used": false, - "final_answer_preview": "Запрос /health обрабатывается следующим образом:\n\n1. В файле `http_app.py` класс `HttpControlAppFactory` создаёт объект FastAPI с маршрутом `/health`.\n2. Маршрут `/health` сопоставлен с функцией-обработчиком `health`, определённой внутри фабрики на строках 31–34.\n3. При обращении к маршруту `/health" - } - }, - "failure_reasons": [], - "timings_ms": { - "router": 1, - "retrieval": 197, - "pre_evidence_gate": 1, - "llm": 3593, - "post_evidence_gate": 1 - } -} - -## Mismatches -- none \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/plba_full_chain_subintents_v3/20260312_174008/full_chain_plba_code_subintents_v2_plba-v2-trace-flow-runtime-start.json b/tests/pipeline_setup_v3/test_results/plba_full_chain_subintents_v3/20260312_174008/full_chain_plba_code_subintents_v2_plba-v2-trace-flow-runtime-start.json deleted file mode 100644 index 95b4a91..0000000 --- a/tests/pipeline_setup_v3/test_results/plba_full_chain_subintents_v3/20260312_174008/full_chain_plba_code_subintents_v2_plba-v2-trace-flow-runtime-start.json +++ /dev/null @@ -1,5078 +0,0 @@ -{ - "case_id": "plba-v2-trace-flow-runtime-start", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_02_pipeline/full_chain_plba_code_subintents_v2.yaml", - "runner": "agent_runtime", - "mode": "full_chain", - "query": "Покажи поток выполнения при запуске RuntimeManager", - "actual": { - "intent": "CODE_QA", - "sub_intent": "TRACE_FLOW", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 37, - "llm_answer": "При запуске `RuntimeManager` выполняются следующие шаги:\n\n1. Инициализация конфигурации и сервисов:\n - В конструкторе `RuntimeManager.__init__` инициализируется конфигурация через поле `configuration`, загружаются файлы конфигурации с помощью метода `add_config_file`.\n - Создаются сервисы внутри конструктора, вызывая сам конструктор (`__init__`) и регистрируя основные сервисы методом `_register_core_services`.\n\n2. Начальная инициализация состояния:\n - Внутри конструктора происходит начальное чтение и запись атрибутов состояния, необходимых для работы менеджера.\n\n3. Запуск менеджера:\n - После полной инициализации выполняется метод `start`, который приводит `RuntimeManager` в активное состояние и начинает обработку запросов.\n\nПоток данных включает в себя загрузку конфигурации, создание и регистрацию сервисов, а также переход в рабочее состояние.\n\nДальнейшее восстановление потока возможно только по дополнительным данным.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "RuntimeManager" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "passed": true, - "mismatches": [], - "details": { - "query": "Покажи поток выполнения при запуске RuntimeManager", - "router_result": { - "schema_version": "1.1", - "intent": "CODE_QA", - "retrieval_profile": "code", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query_plan": { - "raw": "Покажи поток выполнения при запуске RuntimeManager", - "normalized": "Покажи поток выполнения при запуске RuntimeManager", - "sub_intent": "TRACE_FLOW", - "negations": [], - "expansions": [ - "RuntimeManager" - ], - "keyword_hints": [ - "RuntimeManager" - ], - "path_hints": [], - "doc_scope_hints": [], - "symbol_candidates": [ - "RuntimeManager" - ], - "symbol_kind_hint": "class", - "anchors": [ - { - "type": "SYMBOL", - "value": "RuntimeManager", - "source": "user_text", - "subtype": null, - "span": { - "start": 36, - "end": 50 - }, - "confidence": 0.88 - } - ] - }, - "retrieval_spec": { - "domains": [ - "CODE" - ], - "layer_queries": [ - { - "layer_id": "C1_SYMBOL_CATALOG", - "top_k": 8 - }, - { - "layer_id": "C0_SOURCE_CHUNKS", - "top_k": 8 - }, - { - "layer_id": "C4_SEMANTIC_ROLES", - "top_k": 8 - }, - { - "layer_id": "C2_DEPENDENCY_GRAPH", - "top_k": 10 - }, - { - "layer_id": "C3_ENTRYPOINTS", - "top_k": 10 - } - ], - "filters": { - "test_policy": "EXCLUDE", - "path_scope": [], - "language": [ - "python" - ] - }, - "rerank_profile": "code" - }, - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - }, - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "RuntimeManager", - "alternatives": [ - "RuntimeManager", - "RuntimeManager", - "RuntimeManager", - "RuntimeManager", - "RuntimeManager" - ], - "confidence": 0.99 - }, - "evidence_policy": { - "require_def": true, - "require_flow": true, - "require_spec": false, - "allow_answer_without_evidence": false - } - }, - "retrieval_request": { - "rag_session_id": "7d11da21-faa0-4cea-aede-aeabe069164c", - "query": "Покажи поток выполнения при запуске RuntimeManager", - "sub_intent": "TRACE_FLOW", - "path_scope": [], - "keyword_hints": [ - "RuntimeManager" - ], - "symbol_candidates": [ - "RuntimeManager" - ], - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_spec": { - "domains": [ - "CODE" - ], - "layer_queries": [ - { - "layer_id": "C1_SYMBOL_CATALOG", - "top_k": 8 - }, - { - "layer_id": "C0_SOURCE_CHUNKS", - "top_k": 8 - }, - { - "layer_id": "C4_SEMANTIC_ROLES", - "top_k": 8 - }, - { - "layer_id": "C2_DEPENDENCY_GRAPH", - "top_k": 10 - }, - { - "layer_id": "C3_ENTRYPOINTS", - "top_k": 10 - } - ], - "filters": { - "test_policy": "EXCLUDE", - "path_scope": [], - "language": [ - "python" - ] - }, - "rerank_profile": "code" - }, - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - }, - "query_plan": { - "raw": "Покажи поток выполнения при запуске RuntimeManager", - "normalized": "Покажи поток выполнения при запуске RuntimeManager", - "sub_intent": "TRACE_FLOW", - "negations": [], - "expansions": [ - "RuntimeManager" - ], - "keyword_hints": [ - "RuntimeManager" - ], - "path_hints": [], - "doc_scope_hints": [], - "symbol_candidates": [ - "RuntimeManager" - ], - "symbol_kind_hint": "class", - "anchors": [ - { - "type": "SYMBOL", - "value": "RuntimeManager", - "source": "user_text", - "subtype": null, - "span": { - "start": 36, - "end": 50 - }, - "confidence": 0.88 - } - ] - } - }, - "retrieval_result": { - "target_symbol_candidates": [ - "RuntimeManager", - "ControlPlaneService", - "ControlChannel.start", - "ControlChannel.stop" - ], - "resolved_symbol": "RuntimeManager", - "symbol_resolution_status": "resolved", - "file_candidates": [ - "src/plba/bootstrap.py", - "src/app_runtime/control/service.py", - "src/app_runtime/core/runtime.py", - "src/plba/__init__.py", - "src/plba/core.py", - "src/app_runtime/control/__init__.py", - "src/app_runtime/control/base.py", - "src/app_runtime/control/http_runner.py", - "src/app_runtime/control/http_app.py", - "src/app_runtime/control/http_channel.py", - "src/plba/control.py", - "src/app_runtime/workflow/persistence/workflow_persistence.py" - ], - "code_chunks": [ - { - "layer": "C1_SYMBOL_CATALOG", - "path": "src/plba/bootstrap.py", - "title": "RuntimeManager", - "content": "const RuntimeManager\nRuntimeManager = app_runtime.core.runtime.RuntimeManager", - "start_line": 4, - "end_line": 4, - "metadata": { - "symbol_id": "27158ca220022eeb5083c6addf8a50775d45f7161284fd60aac48410105f4b98", - "qname": "RuntimeManager", - "kind": "const", - "signature": "RuntimeManager = app_runtime.core.runtime.RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "src.plba.bootstrap", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C1_SYMBOL_CATALOG", - "path": "src/app_runtime/control/service.py", - "title": "RuntimeManager", - "content": "const RuntimeManager\nRuntimeManager = app_runtime.core.runtime.RuntimeManager", - "start_line": 9, - "end_line": 9, - "metadata": { - "symbol_id": "62a9575c77aad894120d18b4f2a08cf2ba42f77e9be4a8a432b767d157701afe", - "qname": "RuntimeManager", - "kind": "const", - "signature": "RuntimeManager = app_runtime.core.runtime.RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.control.service", - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C1_SYMBOL_CATALOG", - "path": "src/app_runtime/core/runtime.py", - "title": "RuntimeManager", - "content": "class RuntimeManager\nRuntimeManager", - "start_line": 18, - "end_line": 179, - "metadata": { - "symbol_id": "7e4a9381328c5803bbc6179458612fc4e947d928aa7bf8b4b2bebb2c8592f758", - "qname": "RuntimeManager", - "kind": "class", - "signature": "RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.core.runtime", - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C1_SYMBOL_CATALOG", - "path": "src/plba/__init__.py", - "title": "RuntimeManager", - "content": "const RuntimeManager\nRuntimeManager = plba.core.RuntimeManager", - "start_line": 16, - "end_line": 16, - "metadata": { - "symbol_id": "7eacec84f9b8d6c4201374591faecdac7493091c263681495c338973f2971ad9", - "qname": "RuntimeManager", - "kind": "const", - "signature": "RuntimeManager = plba.core.RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "src.plba.__init__", - "is_test": false, - "blob_sha": "24e755ec8c249d14fb0e675b5dbf2b71ab91afb9c849897eebfa9feb2499e19d", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C1_SYMBOL_CATALOG", - "path": "src/plba/core.py", - "title": "RuntimeManager", - "content": "const RuntimeManager\nRuntimeManager = app_runtime.core.runtime.RuntimeManager", - "start_line": 2, - "end_line": 2, - "metadata": { - "symbol_id": "e1684562d978b7af7fe9b27dc5869d770348a87b5dc19a50360f58544668578b", - "qname": "RuntimeManager", - "kind": "const", - "signature": "RuntimeManager = app_runtime.core.runtime.RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "src.plba.core", - "is_test": false, - "blob_sha": "c0ae25110d20e665216616e26b68adfe035b624ba45d31d1272fb21f906f9ca8", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C1_SYMBOL_CATALOG", - "path": "src/app_runtime/control/__init__.py", - "title": "ControlPlaneService", - "content": "const ControlPlaneService\nControlPlaneService = app_runtime.control.service.ControlPlaneService", - "start_line": 3, - "end_line": 3, - "metadata": { - "symbol_id": "217e8f044d1c01644bf7b81e5046af9e84469210c692a2fb0c476a19bb069ae1", - "qname": "ControlPlaneService", - "kind": "const", - "signature": "ControlPlaneService = app_runtime.control.service.ControlPlaneService", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.control.__init__", - "is_test": false, - "blob_sha": "bf3c37e3369a84cc618adc0fd71c232e5eb4b871eaff743069a17e661e498316", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C1_SYMBOL_CATALOG", - "path": "src/app_runtime/control/base.py", - "title": "ControlChannel.start", - "content": "method ControlChannel.start\nstart(self, actions)\nStart the control channel and bind handlers.", - "start_line": 23, - "end_line": 24, - "metadata": { - "symbol_id": "e01e0d50d0f48d0c84c119c989b7a7c57ceea263811ce2605c684ae24d1a03b1", - "qname": "ControlChannel.start", - "kind": "method", - "signature": "start(self, actions)", - "parent_symbol_id": "ControlChannel", - "package_or_module": "src.app_runtime.control.base", - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C1_SYMBOL_CATALOG", - "path": "src/app_runtime/control/base.py", - "title": "ControlChannel.stop", - "content": "method ControlChannel.stop\nstop(self)\nStop the control channel and release resources.", - "start_line": 27, - "end_line": 28, - "metadata": { - "symbol_id": "54b5adf9866c526836221dc721b474ba23fbec83e1b1d3b8bc4da67ae3c1541d", - "qname": "ControlChannel.stop", - "kind": "method", - "signature": "stop(self)", - "parent_symbol_id": "ControlChannel", - "package_or_module": "src.app_runtime.control.base", - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C0_SOURCE_CHUNKS", - "path": "src/app_runtime/control/service.py", - "title": "src/app_runtime/control/service.py:ControlPlaneService", - "content": "class ControlPlaneService:\n def __init__(self) -> None:\n self._channels: list[ControlChannel] = []\n\n def register_channel(self, channel: ControlChannel) -> None:\n self._channels.append(channel)\n\n def start(self, runtime: RuntimeManager) -> None:\n if not self._channels:\n return\n asyncio.run(self._start_async(runtime))\n\n def stop(self) -> None:\n if not self._channels:\n return\n asyncio.run(self._stop_async())\n\n def snapshot(self, runtime: RuntimeManager) -> dict[str, object]:\n health = runtime.current_health()\n return {\n \"runtime\": {\"state\": runtime._state.value},\n \"modules\": list(runtime.registry.modules),\n \"services\": runtime.services.snapshot(),\n \"workers\": runtime.workers.snapshot(),\n \"health\": runtime.health.snapshot(runtime.workers.healths()) | {\"status\": health[\"status\"]},\n \"config\": runtime.configuration.get(),\n }\n\n async def _start_async(self, runtime: RuntimeManager) -> None:\n actions = ControlActionSet(\n health=runtime.health_status,\n start=runtime.start_runtime,\n stop=runtime.stop_runtime,\n status=runtime.runtime_status,\n )\n for channel in self._channels:\n await channel.start(actions)\n\n async def _stop_async(self) -> None:\n for channel in reversed(self._channels):\n await channel.stop()", - "start_line": 12, - "end_line": 52, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.service", - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C0_SOURCE_CHUNKS", - "path": "src/app_runtime/control/http_runner.py", - "title": "src/app_runtime/control/http_runner.py:UvicornThreadRunner", - "content": "class UvicornThreadRunner:\n def __init__(self, host: str, port: int, timeout: int) -> None:\n self._host = host\n self._port = port\n self._timeout = timeout\n self._server: Server | None = None\n self._thread: Thread | None = None\n self._error: BaseException | None = None\n\n async def start(self, app: FastAPI) -> None:\n if self._thread is not None and self._thread.is_alive():\n return\n self._error = None\n config = Config(app=app, host=self._host, port=self._port, log_level=\"warning\")\n self._server = Server(config)\n self._thread = Thread(target=self._serve, name=\"plba-http-control\", daemon=True)\n self._thread.start()\n await self._wait_until_started()\n\n async def stop(self) -> None:\n if self._server is None or self._thread is None:\n return\n self._server.should_exit = True\n await asyncio.to_thread(self._thread.join, self._timeout)\n self._server = None\n self._thread = None\n\n @property\n def port(self) -> int:\n if self._server is None or not getattr(self._server, \"servers\", None):\n return self._port\n socket = self._server.servers[0].sockets[0]\n return int(socket.getsockname()[1])\n\n async def _wait_until_started(self) -> None:\n if self._server is None:\n raise RuntimeError(\"Server is not initialized\")\n deadline = asyncio.get_running_loop().time() + max(float(self._timeout), 1.0)\n while not self._server.started:\n if self._error is not None:\n raise RuntimeError(\"HTTP control server failed to start\") from self._error\n if asyncio.get_running_loop().time() >= deadline:\n raise TimeoutError(\"HTTP control server startup timed out\")\n await asyncio.sleep(0.05)\n\n def _serve(self) -> None:\n if self._server is None:\n return\n try:\n asyncio.run(self._server.serve())\n except BaseException as exc: # noqa: BLE001\n self._error = exc", - "start_line": 10, - "end_line": 61, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.http_runner", - "is_test": false, - "blob_sha": "3779fdd2878b770e789a35bb2a89c9d79f13b61c26d7db1b3b683f9bb9e1623f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C0_SOURCE_CHUNKS", - "path": "src/app_runtime/control/base.py", - "title": "src/app_runtime/control/base.py:ControlChannel", - "content": "class ControlChannel(ABC):\n @abstractmethod\n async def start(self, actions: ControlActionSet) -> None:\n \"\"\"Start the control channel and bind handlers.\"\"\"\n\n @abstractmethod\n async def stop(self) -> None:\n \"\"\"Stop the control channel and release resources.\"\"\"", - "start_line": 21, - "end_line": 28, - "metadata": { - "chunk_index": 1, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.base", - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C0_SOURCE_CHUNKS", - "path": "src/app_runtime/control/__init__.py", - "title": "src/app_runtime/control/__init__.py:1-5", - "content": "from app_runtime.control.base import ControlActionSet, ControlChannel\nfrom app_runtime.control.http_channel import HttpControlChannel\nfrom app_runtime.control.service import ControlPlaneService\n\n__all__ = [\"ControlActionSet\", \"ControlChannel\", \"ControlPlaneService\", \"HttpControlChannel\"]", - "start_line": 1, - "end_line": 5, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.app_runtime.control.__init__", - "is_test": false, - "blob_sha": "bf3c37e3369a84cc618adc0fd71c232e5eb4b871eaff743069a17e661e498316", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C0_SOURCE_CHUNKS", - "path": "src/app_runtime/control/http_app.py", - "title": "src/app_runtime/control/http_app.py:HttpControlAppFactory", - "content": "class HttpControlAppFactory:\n def create(\n self,\n health_provider: Callable[[], Awaitable[HealthPayload]],\n action_provider: Callable[[str, str], Awaitable[JSONResponse]],\n ) -> FastAPI:\n app = FastAPI(title=\"PLBA Control API\")\n\n @app.middleware(\"http\")\n async def log_api_call(request: Request, call_next): # type: ignore[no-untyped-def]\n started = time.monotonic()\n response = await call_next(request)\n response.headers[\"X-Response-Time-Ms\"] = str(int((time.monotonic() - started) * 1000))\n return response\n\n @app.get(\"/health\")\n async def health() -> JSONResponse:\n payload = await health_provider()\n status_code = 200 if payload.get(\"status\") == \"ok\" else 503\n return JSONResponse(content=payload, status_code=status_code)\n\n @app.get(\"/actions/{action}\")\n @app.post(\"/actions/{action}\")\n async def action(action: str, request: Request) -> JSONResponse:\n client_source = self._client_source(request)\n if action in {\"start\", \"stop\"}:\n LOGGER.warning(\"Control action requested: /actions/%s client=%s\", action, client_source)\n return await action_provider(action, client_source)\n\n return app\n\n def _client_source(self, request: Request) -> str:\n explicit_header = request.headers.get(\"X-Client-Source\", \"\").strip()\n if explicit_header:\n return explicit_header\n user_agent = request.headers.get(\"User-Agent\", \"\").strip()\n if user_agent:\n return f\"user-agent:{user_agent}\"\n return \"unknown\"", - "start_line": 15, - "end_line": 53, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.http_app", - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C0_SOURCE_CHUNKS", - "path": "src/app_runtime/control/http_channel.py", - "title": "src/app_runtime/control/http_channel.py:HttpControlChannel", - "content": "class HttpControlChannel(ControlChannel):\n def __init__(self, host: str, port: int, timeout: int) -> None:\n self._timeout = timeout\n self._runner = UvicornThreadRunner(host, port, timeout)\n self._factory = HttpControlAppFactory()\n self._actions: ControlActionSet | None = None\n\n async def start(self, actions: ControlActionSet) -> None:\n self._actions = actions\n app = self._factory.create(self._health_response, self._action_response)\n await self._runner.start(app)\n\n async def stop(self) -> None:\n await self._runner.stop()\n\n @property\n def port(self) -> int:\n return self._runner.port\n\n async def _health_response(self) -> dict[str, object]:\n if self._actions is None:\n return {\"status\": \"unhealthy\", \"detail\": \"control actions are not configured\"}\n return await asyncio.wait_for(self._actions.health(), timeout=float(self._timeout))\n\n async def _action_response(self, action: str, _client_source: str = \"unknown\") -> JSONResponse:\n if self._actions is None:\n return JSONResponse(content={\"status\": \"error\", \"detail\": f\"{action} handler is not configured\"}, status_code=404)\n callbacks = {\n \"start\": self._actions.start,\n \"stop\": self._actions.stop,\n \"status\": self._actions.status,\n }\n callback = callbacks.get(action)\n if callback is None:\n return JSONResponse(content={\"status\": \"error\", \"detail\": f\"unsupported action: {action}\"}, status_code=404)\n action_timeout = max(float(self._timeout), 10.0) if action in {\"start\", \"stop\"} else float(self._timeout)\n try:\n detail = await asyncio.wait_for(callback(), timeout=action_timeout)\n except asyncio.TimeoutError:\n return JSONResponse(\n content={\"status\": \"accepted\", \"detail\": f\"{action} operation is still in progress\"},\n status_code=202,\n )\n except Exception as exc:\n return JSONResponse(content={\"status\": \"error\", \"detail\": str(exc)}, status_code=500)\n return JSONResponse(content={\"status\": \"ok\", \"detail\": detail or f\"{action} action accepted\"}, status_code=200)", - "start_line": 12, - "end_line": 57, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.http_channel", - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C0_SOURCE_CHUNKS", - "path": "src/app_runtime/control/base.py", - "title": "src/app_runtime/control/base.py:ControlActionSet", - "content": "class ControlActionSet:\n health: HealthHandler\n start: ActionHandler\n stop: ActionHandler\n status: ActionHandler", - "start_line": 14, - "end_line": 18, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.base", - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C0_SOURCE_CHUNKS", - "path": "src/plba/control.py", - "title": "src/plba/control.py:1-10", - "content": "from app_runtime.control.base import ControlActionSet, ControlChannel\nfrom app_runtime.control.http_channel import HttpControlChannel\nfrom app_runtime.control.service import ControlPlaneService\n\n__all__ = [\n \"ControlActionSet\",\n \"ControlChannel\",\n \"ControlPlaneService\",\n \"HttpControlChannel\",\n]", - "start_line": 1, - "end_line": 10, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.plba.control", - "is_test": false, - "blob_sha": "31bd5c4481bfa7fbca8fae56d4860a67e3953ca74474ac8439e1f39b685d7bc8", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C4_SEMANTIC_ROLES", - "path": "src/app_runtime/core/runtime.py", - "title": "RuntimeManager", - "content": "RuntimeManager\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests manager\n- orchestrates role-like calls (4)\n- reads and writes state attributes\n- participates in dataflow slices (50)", - "start_line": 18, - "end_line": 179, - "metadata": { - "symbol_id": "7e4a9381328c5803bbc6179458612fc4e947d928aa7bf8b4b2bebb2c8592f758", - "symbol_name": "RuntimeManager", - "qname": "RuntimeManager", - "role": "pipeline_stage", - "confidence": 0.67, - "dataflow_participation": 50, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C4_SEMANTIC_ROLES", - "path": "src/app_runtime/control/base.py", - "title": "ControlChannel", - "content": "ControlChannel\nrole: model\n\nResponsibilities:\n- default model role", - "start_line": 21, - "end_line": 28, - "metadata": { - "symbol_id": "cfcfe9a311d3a2dbdaf32ac4ccd73c0eb9a117f830591a1c0867ee97d46204ff", - "symbol_name": "ControlChannel", - "qname": "ControlChannel", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C4_SEMANTIC_ROLES", - "path": "src/app_runtime/control/base.py", - "title": "ControlActionSet", - "content": "ControlActionSet\nrole: model\n\nResponsibilities:\n- default model role", - "start_line": 14, - "end_line": 18, - "metadata": { - "symbol_id": "46eb026cb3313415ec47b82dd22f84f4d112c9d987e8b1716dcb0baa1cce8988", - "symbol_name": "ControlActionSet", - "qname": "ControlActionSet", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C4_SEMANTIC_ROLES", - "path": "src/app_runtime/control/service.py", - "title": "ControlPlaneService", - "content": "ControlPlaneService\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests service\n- reads and writes state attributes\n- participates in dataflow slices (5)", - "start_line": 12, - "end_line": 52, - "metadata": { - "symbol_id": "b13471e5916986dccffb53fab613812842965705e6b3a89ae549d30c9e91e9aa", - "symbol_name": "ControlPlaneService", - "qname": "ControlPlaneService", - "role": "pipeline_stage", - "confidence": 0.57, - "dataflow_participation": 5, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C4_SEMANTIC_ROLES", - "path": "src/app_runtime/control/http_runner.py", - "title": "UvicornThreadRunner", - "content": "UvicornThreadRunner\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (24)", - "start_line": 10, - "end_line": 61, - "metadata": { - "symbol_id": "fd55630045a02100df8877ac27d951ee08617d4598764394d48cb51fe067476a", - "symbol_name": "UvicornThreadRunner", - "qname": "UvicornThreadRunner", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 24, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "3779fdd2878b770e789a35bb2a89c9d79f13b61c26d7db1b3b683f9bb9e1623f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C4_SEMANTIC_ROLES", - "path": "src/app_runtime/control/http_channel.py", - "title": "HttpControlChannel", - "content": "HttpControlChannel\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (10)", - "start_line": 12, - "end_line": 57, - "metadata": { - "symbol_id": "1c9fbdc24819e5604c26ea55428a74310f03a03e1af197ed84846af61e42fdb0", - "symbol_name": "HttpControlChannel", - "qname": "HttpControlChannel", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 10, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C4_SEMANTIC_ROLES", - "path": "src/app_runtime/control/http_app.py", - "title": "HttpControlAppFactory", - "content": "HttpControlAppFactory\nrole: factory\n\nResponsibilities:\n- name suffix suggests factory", - "start_line": 15, - "end_line": 53, - "metadata": { - "symbol_id": "9b3502a5fb408b273223db13264349cf500de24915b6c649d9ea8970d0dfd8e0", - "symbol_name": "HttpControlAppFactory", - "qname": "HttpControlAppFactory", - "role": "factory", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C4_SEMANTIC_ROLES", - "path": "src/app_runtime/workflow/persistence/workflow_persistence.py", - "title": "WorkflowPersistence", - "content": "WorkflowPersistence\nrole: pipeline_stage\n\nResponsibilities:\n- orchestrates role-like calls (2)\n- reads and writes state attributes\n- participates in dataflow slices (16)", - "start_line": 8, - "end_line": 54, - "metadata": { - "symbol_id": "7bd01ee45cf31f2d5c2e3e51656254860ac785d10cef9e0852cd4fba90857bae", - "symbol_name": "WorkflowPersistence", - "qname": "WorkflowPersistence", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 16, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "80e9410ddc639789b4353c2a1a757ba8d0d5b5bb6075b0b263b61551f04ae1f0", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "path": "src/app_runtime/core/runtime.py", - "title": "RuntimeManager.__init__:dataflow_slice", - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager.add_config_file", - "start_line": 32, - "end_line": 52, - "metadata": { - "edge_id": "a23b8a11ebdb12708b60c96ea12a69f7f042082f1adfddd572444e246d81d167", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "57ffbd4f0d9fdf3507c2b8624312ce211f3d02fdf86a57a8ec90778d8a7b498d", - "dst_ref": "RuntimeManager.add_config_file", - "resolution": "resolved", - "slice_id": "a23b8a11ebdb12708b60c96ea12a69f7f042082f1adfddd572444e246d81d167", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager.add_config_file" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "57ffbd4f0d9fdf3507c2b8624312ce211f3d02fdf86a57a8ec90778d8a7b498d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "path": "src/app_runtime/core/runtime.py", - "title": "RuntimeManager.__init__:dataflow_slice", - "content": "RuntimeManager.__init__\n -> RuntimeManager.services\n -> RuntimeManager.__init__", - "start_line": 33, - "end_line": 39, - "metadata": { - "edge_id": "d43af85989222ee6d788ce418cdcb217c7ff044cfb915e3bdbd184417dc7bd61", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "dst_ref": "RuntimeManager.__init__", - "resolution": "resolved", - "slice_id": "d43af85989222ee6d788ce418cdcb217c7ff044cfb915e3bdbd184417dc7bd61", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.services", - "RuntimeManager.__init__" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "path": "src/app_runtime/control/service.py", - "title": "ControlPlaneService.__init__:dataflow_slice", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.stop", - "start_line": 14, - "end_line": 25, - "metadata": { - "edge_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d", - "dst_ref": "ControlPlaneService.stop", - "resolution": "resolved", - "slice_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.stop" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "path": "src/app_runtime/control/service.py", - "title": "ControlPlaneService.__init__:dataflow_slice", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._stop_async", - "start_line": 14, - "end_line": 51, - "metadata": { - "edge_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a", - "dst_ref": "ControlPlaneService._stop_async", - "resolution": "resolved", - "slice_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._stop_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "path": "src/app_runtime/core/runtime.py", - "title": "RuntimeManager.__init__:dataflow_slice", - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager.start", - "start_line": 32, - "end_line": 59, - "metadata": { - "edge_id": "98312ace7fc62b1c7194c5aa1732b6ef736eae1668a3a120dd1ecd5ab1d64f7a", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "77a7b260193018845e4e204df094ab89cfd7c82ee4e822b3a83ad4cd945f9cb1", - "dst_ref": "RuntimeManager.start", - "resolution": "resolved", - "slice_id": "98312ace7fc62b1c7194c5aa1732b6ef736eae1668a3a120dd1ecd5ab1d64f7a", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager.start" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "77a7b260193018845e4e204df094ab89cfd7c82ee4e822b3a83ad4cd945f9cb1" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "path": "src/app_runtime/core/runtime.py", - "title": "RuntimeManager.__init__:dataflow_slice", - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager._register_core_services", - "start_line": 32, - "end_line": 127, - "metadata": { - "edge_id": "3e5811f3b511fa0cabe363f5d01f2ac5fa039bc8b93f7ee108323e1f5f45a293", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "972d6057a6caac9cf31ebc1e29c6f39f71b10d4cc170dec57cf875ba458549c6", - "dst_ref": "RuntimeManager._register_core_services", - "resolution": "resolved", - "slice_id": "3e5811f3b511fa0cabe363f5d01f2ac5fa039bc8b93f7ee108323e1f5f45a293", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager._register_core_services" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "972d6057a6caac9cf31ebc1e29c6f39f71b10d4cc170dec57cf875ba458549c6" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "path": "src/app_runtime/control/service.py", - "title": "ControlPlaneService.__init__:dataflow_slice", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.register_channel", - "start_line": 14, - "end_line": 17, - "metadata": { - "edge_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957", - "dst_ref": "ControlPlaneService.register_channel", - "resolution": "resolved", - "slice_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.register_channel" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "path": "src/app_runtime/control/service.py", - "title": "ControlPlaneService.__init__:dataflow_slice", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.start", - "start_line": 14, - "end_line": 20, - "metadata": { - "edge_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154", - "dst_ref": "ControlPlaneService.start", - "resolution": "resolved", - "slice_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.start" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "path": "src/app_runtime/control/service.py", - "title": "ControlPlaneService.__init__:dataflow_slice", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._start_async", - "start_line": 14, - "end_line": 47, - "metadata": { - "edge_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517", - "dst_ref": "ControlPlaneService._start_async", - "resolution": "resolved", - "slice_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._start_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "path": "src/app_runtime/core/runtime.py", - "title": "RuntimeManager.__init__:dataflow_slice", - "content": "RuntimeManager.__init__\n -> RuntimeManager.services\n -> RuntimeManager._register_core_services", - "start_line": 33, - "end_line": 127, - "metadata": { - "edge_id": "aac6f9dda73963b977083a892bee39a48eca4fbd7404787e022ecf4ebedec65d", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "972d6057a6caac9cf31ebc1e29c6f39f71b10d4cc170dec57cf875ba458549c6", - "dst_ref": "RuntimeManager._register_core_services", - "resolution": "resolved", - "slice_id": "aac6f9dda73963b977083a892bee39a48eca4fbd7404787e022ecf4ebedec65d", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.services", - "RuntimeManager._register_core_services" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "972d6057a6caac9cf31ebc1e29c6f39f71b10d4cc170dec57cf875ba458549c6" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C3_ENTRYPOINTS", - "path": "src/app_runtime/control/http_app.py", - "title": "app.post", - "content": "fastapi http app.post", - "start_line": 38, - "end_line": 42, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C3_ENTRYPOINTS", - "path": "src/app_runtime/control/http_app.py", - "title": "app.get", - "content": "fastapi http app.get", - "start_line": 31, - "end_line": 34, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C3_ENTRYPOINTS", - "path": "src/app_runtime/control/http_app.py", - "title": "app.get", - "content": "fastapi http app.get", - "start_line": 38, - "end_line": 42, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "relations": [ - { - "path": "src/app_runtime/core/runtime.py", - "metadata": { - "edge_id": "a23b8a11ebdb12708b60c96ea12a69f7f042082f1adfddd572444e246d81d167", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "57ffbd4f0d9fdf3507c2b8624312ce211f3d02fdf86a57a8ec90778d8a7b498d", - "dst_ref": "RuntimeManager.add_config_file", - "resolution": "resolved", - "slice_id": "a23b8a11ebdb12708b60c96ea12a69f7f042082f1adfddd572444e246d81d167", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager.add_config_file" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "57ffbd4f0d9fdf3507c2b8624312ce211f3d02fdf86a57a8ec90778d8a7b498d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - }, - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager.add_config_file" - }, - { - "path": "src/app_runtime/core/runtime.py", - "metadata": { - "edge_id": "d43af85989222ee6d788ce418cdcb217c7ff044cfb915e3bdbd184417dc7bd61", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "dst_ref": "RuntimeManager.__init__", - "resolution": "resolved", - "slice_id": "d43af85989222ee6d788ce418cdcb217c7ff044cfb915e3bdbd184417dc7bd61", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.services", - "RuntimeManager.__init__" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - }, - "content": "RuntimeManager.__init__\n -> RuntimeManager.services\n -> RuntimeManager.__init__" - }, - { - "path": "src/app_runtime/control/service.py", - "metadata": { - "edge_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d", - "dst_ref": "ControlPlaneService.stop", - "resolution": "resolved", - "slice_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.stop" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - }, - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.stop" - }, - { - "path": "src/app_runtime/control/service.py", - "metadata": { - "edge_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a", - "dst_ref": "ControlPlaneService._stop_async", - "resolution": "resolved", - "slice_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._stop_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - }, - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._stop_async" - }, - { - "path": "src/app_runtime/core/runtime.py", - "metadata": { - "edge_id": "98312ace7fc62b1c7194c5aa1732b6ef736eae1668a3a120dd1ecd5ab1d64f7a", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "77a7b260193018845e4e204df094ab89cfd7c82ee4e822b3a83ad4cd945f9cb1", - "dst_ref": "RuntimeManager.start", - "resolution": "resolved", - "slice_id": "98312ace7fc62b1c7194c5aa1732b6ef736eae1668a3a120dd1ecd5ab1d64f7a", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager.start" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "77a7b260193018845e4e204df094ab89cfd7c82ee4e822b3a83ad4cd945f9cb1" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - }, - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager.start" - }, - { - "path": "src/app_runtime/core/runtime.py", - "metadata": { - "edge_id": "3e5811f3b511fa0cabe363f5d01f2ac5fa039bc8b93f7ee108323e1f5f45a293", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "972d6057a6caac9cf31ebc1e29c6f39f71b10d4cc170dec57cf875ba458549c6", - "dst_ref": "RuntimeManager._register_core_services", - "resolution": "resolved", - "slice_id": "3e5811f3b511fa0cabe363f5d01f2ac5fa039bc8b93f7ee108323e1f5f45a293", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager._register_core_services" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "972d6057a6caac9cf31ebc1e29c6f39f71b10d4cc170dec57cf875ba458549c6" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - }, - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager._register_core_services" - }, - { - "path": "src/app_runtime/control/service.py", - "metadata": { - "edge_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957", - "dst_ref": "ControlPlaneService.register_channel", - "resolution": "resolved", - "slice_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.register_channel" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - }, - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.register_channel" - }, - { - "path": "src/app_runtime/control/service.py", - "metadata": { - "edge_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154", - "dst_ref": "ControlPlaneService.start", - "resolution": "resolved", - "slice_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.start" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - }, - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.start" - }, - { - "path": "src/app_runtime/control/service.py", - "metadata": { - "edge_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517", - "dst_ref": "ControlPlaneService._start_async", - "resolution": "resolved", - "slice_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._start_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - }, - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._start_async" - }, - { - "path": "src/app_runtime/core/runtime.py", - "metadata": { - "edge_id": "aac6f9dda73963b977083a892bee39a48eca4fbd7404787e022ecf4ebedec65d", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "972d6057a6caac9cf31ebc1e29c6f39f71b10d4cc170dec57cf875ba458549c6", - "dst_ref": "RuntimeManager._register_core_services", - "resolution": "resolved", - "slice_id": "aac6f9dda73963b977083a892bee39a48eca4fbd7404787e022ecf4ebedec65d", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.services", - "RuntimeManager._register_core_services" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "972d6057a6caac9cf31ebc1e29c6f39f71b10d4cc170dec57cf875ba458549c6" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - }, - "content": "RuntimeManager.__init__\n -> RuntimeManager.services\n -> RuntimeManager._register_core_services" - } - ], - "entrypoints": [ - { - "path": "src/app_runtime/control/http_app.py", - "title": "app.get", - "start_line": 31, - "end_line": 34, - "http_method": "GET", - "route_path": "/health", - "handler_symbol": "health", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "route_or_command": "app.get", - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "title": "app.get", - "start_line": 38, - "end_line": 42, - "http_method": "GET", - "route_path": "/actions/{action}", - "handler_symbol": "action", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "route_or_command": "app.get", - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "title": "app.post", - "start_line": 38, - "end_line": 42, - "http_method": "POST", - "route_path": "/actions/{action}", - "handler_symbol": "action", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "route_or_command": "app.post", - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "test_candidates": [], - "layer_outcomes": [ - { - "layer_id": "C1_SYMBOL_CATALOG", - "hit_count": 8, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C0_SOURCE_CHUNKS", - "hit_count": 8, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C4_SEMANTIC_ROLES", - "hit_count": 8, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C2_DEPENDENCY_GRAPH", - "hit_count": 10, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C3_ENTRYPOINTS", - "hit_count": 3, - "empty": false, - "fallback_used": false - } - ], - "missing_layers": [], - "raw_rows": [ - { - "path": "src/plba/bootstrap.py", - "content": "const RuntimeManager\nRuntimeManager = app_runtime.core.runtime.RuntimeManager", - "layer": "C1_SYMBOL_CATALOG", - "title": "RuntimeManager", - "span_start": 4, - "span_end": 4, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": null, - "metadata": { - "symbol_id": "27158ca220022eeb5083c6addf8a50775d45f7161284fd60aac48410105f4b98", - "qname": "RuntimeManager", - "kind": "const", - "signature": "RuntimeManager = app_runtime.core.runtime.RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "src.plba.bootstrap", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "const RuntimeManager\nRuntimeManager = app_runtime.core.runtime.RuntimeManager", - "layer": "C1_SYMBOL_CATALOG", - "title": "RuntimeManager", - "span_start": 9, - "span_end": 9, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": null, - "metadata": { - "symbol_id": "62a9575c77aad894120d18b4f2a08cf2ba42f77e9be4a8a432b767d157701afe", - "qname": "RuntimeManager", - "kind": "const", - "signature": "RuntimeManager = app_runtime.core.runtime.RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.control.service", - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "class RuntimeManager\nRuntimeManager", - "layer": "C1_SYMBOL_CATALOG", - "title": "RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": null, - "metadata": { - "symbol_id": "7e4a9381328c5803bbc6179458612fc4e947d928aa7bf8b4b2bebb2c8592f758", - "qname": "RuntimeManager", - "kind": "class", - "signature": "RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.core.runtime", - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/__init__.py", - "content": "const RuntimeManager\nRuntimeManager = plba.core.RuntimeManager", - "layer": "C1_SYMBOL_CATALOG", - "title": "RuntimeManager", - "span_start": 16, - "span_end": 16, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": null, - "metadata": { - "symbol_id": "7eacec84f9b8d6c4201374591faecdac7493091c263681495c338973f2971ad9", - "qname": "RuntimeManager", - "kind": "const", - "signature": "RuntimeManager = plba.core.RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "src.plba.__init__", - "is_test": false, - "blob_sha": "24e755ec8c249d14fb0e675b5dbf2b71ab91afb9c849897eebfa9feb2499e19d", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/core.py", - "content": "const RuntimeManager\nRuntimeManager = app_runtime.core.runtime.RuntimeManager", - "layer": "C1_SYMBOL_CATALOG", - "title": "RuntimeManager", - "span_start": 2, - "span_end": 2, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": null, - "metadata": { - "symbol_id": "e1684562d978b7af7fe9b27dc5869d770348a87b5dc19a50360f58544668578b", - "qname": "RuntimeManager", - "kind": "const", - "signature": "RuntimeManager = app_runtime.core.runtime.RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "src.plba.core", - "is_test": false, - "blob_sha": "c0ae25110d20e665216616e26b68adfe035b624ba45d31d1272fb21f906f9ca8", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/__init__.py", - "content": "const ControlPlaneService\nControlPlaneService = app_runtime.control.service.ControlPlaneService", - "layer": "C1_SYMBOL_CATALOG", - "title": "ControlPlaneService", - "span_start": 3, - "span_end": 3, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": null, - "metadata": { - "symbol_id": "217e8f044d1c01644bf7b81e5046af9e84469210c692a2fb0c476a19bb069ae1", - "qname": "ControlPlaneService", - "kind": "const", - "signature": "ControlPlaneService = app_runtime.control.service.ControlPlaneService", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.control.__init__", - "is_test": false, - "blob_sha": "bf3c37e3369a84cc618adc0fd71c232e5eb4b871eaff743069a17e661e498316", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "method ControlChannel.start\nstart(self, actions)\nStart the control channel and bind handlers.", - "layer": "C1_SYMBOL_CATALOG", - "title": "ControlChannel.start", - "span_start": 23, - "span_end": 24, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": null, - "metadata": { - "symbol_id": "e01e0d50d0f48d0c84c119c989b7a7c57ceea263811ce2605c684ae24d1a03b1", - "qname": "ControlChannel.start", - "kind": "method", - "signature": "start(self, actions)", - "parent_symbol_id": "ControlChannel", - "package_or_module": "src.app_runtime.control.base", - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "method ControlChannel.stop\nstop(self)\nStop the control channel and release resources.", - "layer": "C1_SYMBOL_CATALOG", - "title": "ControlChannel.stop", - "span_start": 27, - "span_end": 28, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": null, - "metadata": { - "symbol_id": "54b5adf9866c526836221dc721b474ba23fbec83e1b1d3b8bc4da67ae3c1541d", - "qname": "ControlChannel.stop", - "kind": "method", - "signature": "stop(self)", - "parent_symbol_id": "ControlChannel", - "package_or_module": "src.app_runtime.control.base", - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "class ControlPlaneService:\n def __init__(self) -> None:\n self._channels: list[ControlChannel] = []\n\n def register_channel(self, channel: ControlChannel) -> None:\n self._channels.append(channel)\n\n def start(self, runtime: RuntimeManager) -> None:\n if not self._channels:\n return\n asyncio.run(self._start_async(runtime))\n\n def stop(self) -> None:\n if not self._channels:\n return\n asyncio.run(self._stop_async())\n\n def snapshot(self, runtime: RuntimeManager) -> dict[str, object]:\n health = runtime.current_health()\n return {\n \"runtime\": {\"state\": runtime._state.value},\n \"modules\": list(runtime.registry.modules),\n \"services\": runtime.services.snapshot(),\n \"workers\": runtime.workers.snapshot(),\n \"health\": runtime.health.snapshot(runtime.workers.healths()) | {\"status\": health[\"status\"]},\n \"config\": runtime.configuration.get(),\n }\n\n async def _start_async(self, runtime: RuntimeManager) -> None:\n actions = ControlActionSet(\n health=runtime.health_status,\n start=runtime.start_runtime,\n stop=runtime.stop_runtime,\n status=runtime.runtime_status,\n )\n for channel in self._channels:\n await channel.start(actions)\n\n async def _stop_async(self) -> None:\n for channel in reversed(self._channels):\n await channel.stop()", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/service.py:ControlPlaneService", - "span_start": 12, - "span_end": 52, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": null, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.service", - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_runner.py", - "content": "class UvicornThreadRunner:\n def __init__(self, host: str, port: int, timeout: int) -> None:\n self._host = host\n self._port = port\n self._timeout = timeout\n self._server: Server | None = None\n self._thread: Thread | None = None\n self._error: BaseException | None = None\n\n async def start(self, app: FastAPI) -> None:\n if self._thread is not None and self._thread.is_alive():\n return\n self._error = None\n config = Config(app=app, host=self._host, port=self._port, log_level=\"warning\")\n self._server = Server(config)\n self._thread = Thread(target=self._serve, name=\"plba-http-control\", daemon=True)\n self._thread.start()\n await self._wait_until_started()\n\n async def stop(self) -> None:\n if self._server is None or self._thread is None:\n return\n self._server.should_exit = True\n await asyncio.to_thread(self._thread.join, self._timeout)\n self._server = None\n self._thread = None\n\n @property\n def port(self) -> int:\n if self._server is None or not getattr(self._server, \"servers\", None):\n return self._port\n socket = self._server.servers[0].sockets[0]\n return int(socket.getsockname()[1])\n\n async def _wait_until_started(self) -> None:\n if self._server is None:\n raise RuntimeError(\"Server is not initialized\")\n deadline = asyncio.get_running_loop().time() + max(float(self._timeout), 1.0)\n while not self._server.started:\n if self._error is not None:\n raise RuntimeError(\"HTTP control server failed to start\") from self._error\n if asyncio.get_running_loop().time() >= deadline:\n raise TimeoutError(\"HTTP control server startup timed out\")\n await asyncio.sleep(0.05)\n\n def _serve(self) -> None:\n if self._server is None:\n return\n try:\n asyncio.run(self._server.serve())\n except BaseException as exc: # noqa: BLE001\n self._error = exc", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/http_runner.py:UvicornThreadRunner", - "span_start": 10, - "span_end": 61, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": null, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.http_runner", - "is_test": false, - "blob_sha": "3779fdd2878b770e789a35bb2a89c9d79f13b61c26d7db1b3b683f9bb9e1623f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "class ControlChannel(ABC):\n @abstractmethod\n async def start(self, actions: ControlActionSet) -> None:\n \"\"\"Start the control channel and bind handlers.\"\"\"\n\n @abstractmethod\n async def stop(self) -> None:\n \"\"\"Stop the control channel and release resources.\"\"\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/base.py:ControlChannel", - "span_start": 21, - "span_end": 28, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": null, - "metadata": { - "chunk_index": 1, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.base", - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/__init__.py", - "content": "from app_runtime.control.base import ControlActionSet, ControlChannel\nfrom app_runtime.control.http_channel import HttpControlChannel\nfrom app_runtime.control.service import ControlPlaneService\n\n__all__ = [\"ControlActionSet\", \"ControlChannel\", \"ControlPlaneService\", \"HttpControlChannel\"]", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/__init__.py:1-5", - "span_start": 1, - "span_end": 5, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": null, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.app_runtime.control.__init__", - "is_test": false, - "blob_sha": "bf3c37e3369a84cc618adc0fd71c232e5eb4b871eaff743069a17e661e498316", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "class HttpControlAppFactory:\n def create(\n self,\n health_provider: Callable[[], Awaitable[HealthPayload]],\n action_provider: Callable[[str, str], Awaitable[JSONResponse]],\n ) -> FastAPI:\n app = FastAPI(title=\"PLBA Control API\")\n\n @app.middleware(\"http\")\n async def log_api_call(request: Request, call_next): # type: ignore[no-untyped-def]\n started = time.monotonic()\n response = await call_next(request)\n response.headers[\"X-Response-Time-Ms\"] = str(int((time.monotonic() - started) * 1000))\n return response\n\n @app.get(\"/health\")\n async def health() -> JSONResponse:\n payload = await health_provider()\n status_code = 200 if payload.get(\"status\") == \"ok\" else 503\n return JSONResponse(content=payload, status_code=status_code)\n\n @app.get(\"/actions/{action}\")\n @app.post(\"/actions/{action}\")\n async def action(action: str, request: Request) -> JSONResponse:\n client_source = self._client_source(request)\n if action in {\"start\", \"stop\"}:\n LOGGER.warning(\"Control action requested: /actions/%s client=%s\", action, client_source)\n return await action_provider(action, client_source)\n\n return app\n\n def _client_source(self, request: Request) -> str:\n explicit_header = request.headers.get(\"X-Client-Source\", \"\").strip()\n if explicit_header:\n return explicit_header\n user_agent = request.headers.get(\"User-Agent\", \"\").strip()\n if user_agent:\n return f\"user-agent:{user_agent}\"\n return \"unknown\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/http_app.py:HttpControlAppFactory", - "span_start": 15, - "span_end": 53, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": null, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.http_app", - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "class HttpControlChannel(ControlChannel):\n def __init__(self, host: str, port: int, timeout: int) -> None:\n self._timeout = timeout\n self._runner = UvicornThreadRunner(host, port, timeout)\n self._factory = HttpControlAppFactory()\n self._actions: ControlActionSet | None = None\n\n async def start(self, actions: ControlActionSet) -> None:\n self._actions = actions\n app = self._factory.create(self._health_response, self._action_response)\n await self._runner.start(app)\n\n async def stop(self) -> None:\n await self._runner.stop()\n\n @property\n def port(self) -> int:\n return self._runner.port\n\n async def _health_response(self) -> dict[str, object]:\n if self._actions is None:\n return {\"status\": \"unhealthy\", \"detail\": \"control actions are not configured\"}\n return await asyncio.wait_for(self._actions.health(), timeout=float(self._timeout))\n\n async def _action_response(self, action: str, _client_source: str = \"unknown\") -> JSONResponse:\n if self._actions is None:\n return JSONResponse(content={\"status\": \"error\", \"detail\": f\"{action} handler is not configured\"}, status_code=404)\n callbacks = {\n \"start\": self._actions.start,\n \"stop\": self._actions.stop,\n \"status\": self._actions.status,\n }\n callback = callbacks.get(action)\n if callback is None:\n return JSONResponse(content={\"status\": \"error\", \"detail\": f\"unsupported action: {action}\"}, status_code=404)\n action_timeout = max(float(self._timeout), 10.0) if action in {\"start\", \"stop\"} else float(self._timeout)\n try:\n detail = await asyncio.wait_for(callback(), timeout=action_timeout)\n except asyncio.TimeoutError:\n return JSONResponse(\n content={\"status\": \"accepted\", \"detail\": f\"{action} operation is still in progress\"},\n status_code=202,\n )\n except Exception as exc:\n return JSONResponse(content={\"status\": \"error\", \"detail\": str(exc)}, status_code=500)\n return JSONResponse(content={\"status\": \"ok\", \"detail\": detail or f\"{action} action accepted\"}, status_code=200)", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/http_channel.py:HttpControlChannel", - "span_start": 12, - "span_end": 57, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": null, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.http_channel", - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "class ControlActionSet:\n health: HealthHandler\n start: ActionHandler\n stop: ActionHandler\n status: ActionHandler", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/base.py:ControlActionSet", - "span_start": 14, - "span_end": 18, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": null, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.base", - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/control.py", - "content": "from app_runtime.control.base import ControlActionSet, ControlChannel\nfrom app_runtime.control.http_channel import HttpControlChannel\nfrom app_runtime.control.service import ControlPlaneService\n\n__all__ = [\n \"ControlActionSet\",\n \"ControlChannel\",\n \"ControlPlaneService\",\n \"HttpControlChannel\",\n]", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/plba/control.py:1-10", - "span_start": 1, - "span_end": 10, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": null, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.plba.control", - "is_test": false, - "blob_sha": "31bd5c4481bfa7fbca8fae56d4860a67e3953ca74474ac8439e1f39b685d7bc8", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests manager\n- orchestrates role-like calls (4)\n- reads and writes state attributes\n- participates in dataflow slices (50)", - "layer": "C4_SEMANTIC_ROLES", - "title": "RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 43, - "layer_rank": 2, - "distance": null, - "metadata": { - "symbol_id": "7e4a9381328c5803bbc6179458612fc4e947d928aa7bf8b4b2bebb2c8592f758", - "symbol_name": "RuntimeManager", - "qname": "RuntimeManager", - "role": "pipeline_stage", - "confidence": 0.67, - "dataflow_participation": 50, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "ControlChannel\nrole: model\n\nResponsibilities:\n- default model role", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlChannel", - "span_start": 21, - "span_end": 28, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 40, - "layer_rank": 2, - "distance": null, - "metadata": { - "symbol_id": "cfcfe9a311d3a2dbdaf32ac4ccd73c0eb9a117f830591a1c0867ee97d46204ff", - "symbol_name": "ControlChannel", - "qname": "ControlChannel", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "ControlActionSet\nrole: model\n\nResponsibilities:\n- default model role", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlActionSet", - "span_start": 14, - "span_end": 18, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 40, - "layer_rank": 2, - "distance": null, - "metadata": { - "symbol_id": "46eb026cb3313415ec47b82dd22f84f4d112c9d987e8b1716dcb0baa1cce8988", - "symbol_name": "ControlActionSet", - "qname": "ControlActionSet", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests service\n- reads and writes state attributes\n- participates in dataflow slices (5)", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlPlaneService", - "span_start": 12, - "span_end": 52, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 68, - "layer_rank": 2, - "distance": null, - "metadata": { - "symbol_id": "b13471e5916986dccffb53fab613812842965705e6b3a89ae549d30c9e91e9aa", - "symbol_name": "ControlPlaneService", - "qname": "ControlPlaneService", - "role": "pipeline_stage", - "confidence": 0.57, - "dataflow_participation": 5, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_runner.py", - "content": "UvicornThreadRunner\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (24)", - "layer": "C4_SEMANTIC_ROLES", - "title": "UvicornThreadRunner", - "span_start": 10, - "span_end": 61, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 11, - "layer_rank": 2, - "distance": null, - "metadata": { - "symbol_id": "fd55630045a02100df8877ac27d951ee08617d4598764394d48cb51fe067476a", - "symbol_name": "UvicornThreadRunner", - "qname": "UvicornThreadRunner", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 24, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "3779fdd2878b770e789a35bb2a89c9d79f13b61c26d7db1b3b683f9bb9e1623f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (10)", - "layer": "C4_SEMANTIC_ROLES", - "title": "HttpControlChannel", - "span_start": 12, - "span_end": 57, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 21, - "layer_rank": 2, - "distance": null, - "metadata": { - "symbol_id": "1c9fbdc24819e5604c26ea55428a74310f03a03e1af197ed84846af61e42fdb0", - "symbol_name": "HttpControlChannel", - "qname": "HttpControlChannel", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 10, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "HttpControlAppFactory\nrole: factory\n\nResponsibilities:\n- name suffix suggests factory", - "layer": "C4_SEMANTIC_ROLES", - "title": "HttpControlAppFactory", - "span_start": 15, - "span_end": 53, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 39, - "layer_rank": 2, - "distance": null, - "metadata": { - "symbol_id": "9b3502a5fb408b273223db13264349cf500de24915b6c649d9ea8970d0dfd8e0", - "symbol_name": "HttpControlAppFactory", - "qname": "HttpControlAppFactory", - "role": "factory", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/persistence/workflow_persistence.py", - "content": "WorkflowPersistence\nrole: pipeline_stage\n\nResponsibilities:\n- orchestrates role-like calls (2)\n- reads and writes state attributes\n- participates in dataflow slices (16)", - "layer": "C4_SEMANTIC_ROLES", - "title": "WorkflowPersistence", - "span_start": 8, - "span_end": 54, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 15, - "layer_rank": 2, - "distance": null, - "metadata": { - "symbol_id": "7bd01ee45cf31f2d5c2e3e51656254860ac785d10cef9e0852cd4fba90857bae", - "symbol_name": "WorkflowPersistence", - "qname": "WorkflowPersistence", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 16, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "80e9410ddc639789b4353c2a1a757ba8d0d5b5bb6075b0b263b61551f04ae1f0", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager.add_config_file", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 32, - "span_end": 52, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": null, - "metadata": { - "edge_id": "a23b8a11ebdb12708b60c96ea12a69f7f042082f1adfddd572444e246d81d167", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "57ffbd4f0d9fdf3507c2b8624312ce211f3d02fdf86a57a8ec90778d8a7b498d", - "dst_ref": "RuntimeManager.add_config_file", - "resolution": "resolved", - "slice_id": "a23b8a11ebdb12708b60c96ea12a69f7f042082f1adfddd572444e246d81d167", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager.add_config_file" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "57ffbd4f0d9fdf3507c2b8624312ce211f3d02fdf86a57a8ec90778d8a7b498d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.services\n -> RuntimeManager.__init__", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 33, - "span_end": 39, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": null, - "metadata": { - "edge_id": "d43af85989222ee6d788ce418cdcb217c7ff044cfb915e3bdbd184417dc7bd61", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "dst_ref": "RuntimeManager.__init__", - "resolution": "resolved", - "slice_id": "d43af85989222ee6d788ce418cdcb217c7ff044cfb915e3bdbd184417dc7bd61", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.services", - "RuntimeManager.__init__" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.stop", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 25, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": null, - "metadata": { - "edge_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d", - "dst_ref": "ControlPlaneService.stop", - "resolution": "resolved", - "slice_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.stop" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._stop_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 51, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": null, - "metadata": { - "edge_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a", - "dst_ref": "ControlPlaneService._stop_async", - "resolution": "resolved", - "slice_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._stop_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager.start", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 32, - "span_end": 59, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": null, - "metadata": { - "edge_id": "98312ace7fc62b1c7194c5aa1732b6ef736eae1668a3a120dd1ecd5ab1d64f7a", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "77a7b260193018845e4e204df094ab89cfd7c82ee4e822b3a83ad4cd945f9cb1", - "dst_ref": "RuntimeManager.start", - "resolution": "resolved", - "slice_id": "98312ace7fc62b1c7194c5aa1732b6ef736eae1668a3a120dd1ecd5ab1d64f7a", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager.start" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "77a7b260193018845e4e204df094ab89cfd7c82ee4e822b3a83ad4cd945f9cb1" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager._register_core_services", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 32, - "span_end": 127, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": null, - "metadata": { - "edge_id": "3e5811f3b511fa0cabe363f5d01f2ac5fa039bc8b93f7ee108323e1f5f45a293", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "972d6057a6caac9cf31ebc1e29c6f39f71b10d4cc170dec57cf875ba458549c6", - "dst_ref": "RuntimeManager._register_core_services", - "resolution": "resolved", - "slice_id": "3e5811f3b511fa0cabe363f5d01f2ac5fa039bc8b93f7ee108323e1f5f45a293", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager._register_core_services" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "972d6057a6caac9cf31ebc1e29c6f39f71b10d4cc170dec57cf875ba458549c6" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.register_channel", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 17, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": null, - "metadata": { - "edge_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957", - "dst_ref": "ControlPlaneService.register_channel", - "resolution": "resolved", - "slice_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.register_channel" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.start", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 20, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": null, - "metadata": { - "edge_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154", - "dst_ref": "ControlPlaneService.start", - "resolution": "resolved", - "slice_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.start" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._start_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 47, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": null, - "metadata": { - "edge_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517", - "dst_ref": "ControlPlaneService._start_async", - "resolution": "resolved", - "slice_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._start_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.services\n -> RuntimeManager._register_core_services", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 33, - "span_end": 127, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": null, - "metadata": { - "edge_id": "aac6f9dda73963b977083a892bee39a48eca4fbd7404787e022ecf4ebedec65d", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "972d6057a6caac9cf31ebc1e29c6f39f71b10d4cc170dec57cf875ba458549c6", - "dst_ref": "RuntimeManager._register_core_services", - "resolution": "resolved", - "slice_id": "aac6f9dda73963b977083a892bee39a48eca4fbd7404787e022ecf4ebedec65d", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.services", - "RuntimeManager._register_core_services" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "972d6057a6caac9cf31ebc1e29c6f39f71b10d4cc170dec57cf875ba458549c6" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": null, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": null, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": null, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "retrieval_report": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "vector", - "C0_SOURCE_CHUNKS": "vector", - "C4_SEMANTIC_ROLES": "vector", - "C2_DEPENDENCY_GRAPH": "vector", - "C3_ENTRYPOINTS": "vector" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 8, - "C4_SEMANTIC_ROLES": 8, - "C2_DEPENDENCY_GRAPH": 10, - "C3_ENTRYPOINTS": 10 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [] - }, - "C4_SEMANTIC_ROLES": { - "path_scope": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [] - } - }, - "fallback": { - "used": false, - "reason": null - }, - "retrieval_by_layer_ms": { - "C1_SYMBOL_CATALOG": 52, - "C0_SOURCE_CHUNKS": 25, - "C4_SEMANTIC_ROLES": 23, - "C2_DEPENDENCY_GRAPH": 63, - "C3_ENTRYPOINTS": 22 - } - } - }, - "diagnostics": { - "intent_correct": null, - "target_found": true, - "layers_used": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_sufficient": true, - "answer_mode": "normal", - "resolved_target": "RuntimeManager", - "answer_policy_branch": "normal_answer", - "decision_reason": "evidence_sufficient", - "router_result": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "retrieval_profile": "code", - "sub_intent": "TRACE_FLOW", - "path_scope": [], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "symbol_resolution_status": "resolved" - }, - "retrieval_request": { - "rag_session_id": "7d11da21-faa0-4cea-aede-aeabe069164c", - "query": "Покажи поток выполнения при запуске RuntimeManager", - "sub_intent": "TRACE_FLOW", - "path_scope": [], - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "per_layer_outcome": [ - { - "layer_id": "C1_SYMBOL_CATALOG", - "hit_count": 8, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C0_SOURCE_CHUNKS", - "hit_count": 8, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C4_SEMANTIC_ROLES", - "hit_count": 8, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C2_DEPENDENCY_GRAPH", - "hit_count": 10, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C3_ENTRYPOINTS", - "hit_count": 3, - "empty": false, - "fallback_used": false - } - ], - "empty_layers": [], - "evidence_gate_decision": { - "sufficient": true, - "failure_reasons": [], - "evidence_count": 37 - }, - "evidence_gate_input": { - "resolved_target": "RuntimeManager", - "sub_intent": "TRACE_FLOW", - "target_type": "symbol", - "evidence_count": 37, - "code_chunk_count": 37, - "entrypoint_count": 3, - "relation_count": 10, - "test_evidence_count": 0, - "symbol_resolution_status": "resolved", - "path_scope": [] - }, - "post_evidence_gate": { - "input": { - "answer_mode": "normal", - "degraded_message": "", - "resolved_target": "RuntimeManager", - "draft_answer_preview": "При запуске `RuntimeManager` выполняются следующие шаги:\n\n1. Инициализация конфигурации и сервисов:\n - В конструкторе `RuntimeManager.__init__` инициализируется конфигурация через поле `configuration`, загружаются файлы конфигурации с помощью метода `add_config_file`.\n - Создаются сервисы внутри", - "repair_candidate": true - }, - "output": { - "passed": true, - "action": "return", - "reasons": [], - "repair_used": false, - "final_answer_preview": "При запуске `RuntimeManager` выполняются следующие шаги:\n\n1. Инициализация конфигурации и сервисов:\n - В конструкторе `RuntimeManager.__init__` инициализируется конфигурация через поле `configuration`, загружаются файлы конфигурации с помощью метода `add_config_file`.\n - Создаются сервисы внутри" - } - }, - "failure_reasons": [], - "timings_ms": { - "router": 1, - "retrieval": 187, - "pre_evidence_gate": 1, - "llm": 4010, - "post_evidence_gate": 1 - } - }, - "rag_rows": [ - { - "path": "src/plba/bootstrap.py", - "content": "const RuntimeManager\nRuntimeManager = app_runtime.core.runtime.RuntimeManager", - "layer": "C1_SYMBOL_CATALOG", - "title": "RuntimeManager", - "span_start": 4, - "span_end": 4, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "27158ca220022eeb5083c6addf8a50775d45f7161284fd60aac48410105f4b98", - "qname": "RuntimeManager", - "kind": "const", - "signature": "RuntimeManager = app_runtime.core.runtime.RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "src.plba.bootstrap", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "const RuntimeManager\nRuntimeManager = app_runtime.core.runtime.RuntimeManager", - "layer": "C1_SYMBOL_CATALOG", - "title": "RuntimeManager", - "span_start": 9, - "span_end": 9, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "62a9575c77aad894120d18b4f2a08cf2ba42f77e9be4a8a432b767d157701afe", - "qname": "RuntimeManager", - "kind": "const", - "signature": "RuntimeManager = app_runtime.core.runtime.RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.control.service", - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "class RuntimeManager\nRuntimeManager", - "layer": "C1_SYMBOL_CATALOG", - "title": "RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "7e4a9381328c5803bbc6179458612fc4e947d928aa7bf8b4b2bebb2c8592f758", - "qname": "RuntimeManager", - "kind": "class", - "signature": "RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.core.runtime", - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/__init__.py", - "content": "const RuntimeManager\nRuntimeManager = plba.core.RuntimeManager", - "layer": "C1_SYMBOL_CATALOG", - "title": "RuntimeManager", - "span_start": 16, - "span_end": 16, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "7eacec84f9b8d6c4201374591faecdac7493091c263681495c338973f2971ad9", - "qname": "RuntimeManager", - "kind": "const", - "signature": "RuntimeManager = plba.core.RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "src.plba.__init__", - "is_test": false, - "blob_sha": "24e755ec8c249d14fb0e675b5dbf2b71ab91afb9c849897eebfa9feb2499e19d", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/core.py", - "content": "const RuntimeManager\nRuntimeManager = app_runtime.core.runtime.RuntimeManager", - "layer": "C1_SYMBOL_CATALOG", - "title": "RuntimeManager", - "span_start": 2, - "span_end": 2, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "e1684562d978b7af7fe9b27dc5869d770348a87b5dc19a50360f58544668578b", - "qname": "RuntimeManager", - "kind": "const", - "signature": "RuntimeManager = app_runtime.core.runtime.RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "src.plba.core", - "is_test": false, - "blob_sha": "c0ae25110d20e665216616e26b68adfe035b624ba45d31d1272fb21f906f9ca8", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/__init__.py", - "content": "const ControlPlaneService\nControlPlaneService = app_runtime.control.service.ControlPlaneService", - "layer": "C1_SYMBOL_CATALOG", - "title": "ControlPlaneService", - "span_start": 3, - "span_end": 3, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "217e8f044d1c01644bf7b81e5046af9e84469210c692a2fb0c476a19bb069ae1", - "qname": "ControlPlaneService", - "kind": "const", - "signature": "ControlPlaneService = app_runtime.control.service.ControlPlaneService", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.control.__init__", - "is_test": false, - "blob_sha": "bf3c37e3369a84cc618adc0fd71c232e5eb4b871eaff743069a17e661e498316", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "method ControlChannel.start\nstart(self, actions)\nStart the control channel and bind handlers.", - "layer": "C1_SYMBOL_CATALOG", - "title": "ControlChannel.start", - "span_start": 23, - "span_end": 24, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "e01e0d50d0f48d0c84c119c989b7a7c57ceea263811ce2605c684ae24d1a03b1", - "qname": "ControlChannel.start", - "kind": "method", - "signature": "start(self, actions)", - "parent_symbol_id": "ControlChannel", - "package_or_module": "src.app_runtime.control.base", - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "method ControlChannel.stop\nstop(self)\nStop the control channel and release resources.", - "layer": "C1_SYMBOL_CATALOG", - "title": "ControlChannel.stop", - "span_start": 27, - "span_end": 28, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "54b5adf9866c526836221dc721b474ba23fbec83e1b1d3b8bc4da67ae3c1541d", - "qname": "ControlChannel.stop", - "kind": "method", - "signature": "stop(self)", - "parent_symbol_id": "ControlChannel", - "package_or_module": "src.app_runtime.control.base", - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "class ControlPlaneService:\n def __init__(self) -> None:\n self._channels: list[ControlChannel] = []\n\n def register_channel(self, channel: ControlChannel) -> None:\n self._channels.append(channel)\n\n def start(self, runtime: RuntimeManager) -> None:\n if not self._channels:\n return\n asyncio.run(self._start_async(runtime))\n\n def stop(self) -> None:\n if not self._channels:\n return\n asyncio.run(self._stop_async())\n\n def snapshot(self, runtime: RuntimeManager) -> dict[str, object]:\n health = runtime.current_health()\n return {\n \"runtime\": {\"state\": runtime._state.value},\n \"modules\": list(runtime.registry.modules),\n \"services\": runtime.services.snapshot(),\n \"workers\": runtime.workers.snapshot(),\n \"health\": runtime.health.snapshot(runtime.workers.healths()) | {\"status\": health[\"status\"]},\n \"config\": runtime.configuration.get(),\n }\n\n async def _start_async(self, runtime: RuntimeManager) -> None:\n actions = ControlActionSet(\n health=runtime.health_status,\n start=runtime.start_runtime,\n stop=runtime.stop_runtime,\n status=runtime.runtime_status,\n )\n for channel in self._channels:\n await channel.start(actions)\n\n async def _stop_async(self) -> None:\n for channel in reversed(self._channels):\n await channel.stop()", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/service.py:ControlPlaneService", - "span_start": 12, - "span_end": 52, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.service", - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_runner.py", - "content": "class UvicornThreadRunner:\n def __init__(self, host: str, port: int, timeout: int) -> None:\n self._host = host\n self._port = port\n self._timeout = timeout\n self._server: Server | None = None\n self._thread: Thread | None = None\n self._error: BaseException | None = None\n\n async def start(self, app: FastAPI) -> None:\n if self._thread is not None and self._thread.is_alive():\n return\n self._error = None\n config = Config(app=app, host=self._host, port=self._port, log_level=\"warning\")\n self._server = Server(config)\n self._thread = Thread(target=self._serve, name=\"plba-http-control\", daemon=True)\n self._thread.start()\n await self._wait_until_started()\n\n async def stop(self) -> None:\n if self._server is None or self._thread is None:\n return\n self._server.should_exit = True\n await asyncio.to_thread(self._thread.join, self._timeout)\n self._server = None\n self._thread = None\n\n @property\n def port(self) -> int:\n if self._server is None or not getattr(self._server, \"servers\", None):\n return self._port\n socket = self._server.servers[0].sockets[0]\n return int(socket.getsockname()[1])\n\n async def _wait_until_started(self) -> None:\n if self._server is None:\n raise RuntimeError(\"Server is not initialized\")\n deadline = asyncio.get_running_loop().time() + max(float(self._timeout), 1.0)\n while not self._server.started:\n if self._error is not None:\n raise RuntimeError(\"HTTP control server failed to start\") from self._error\n if asyncio.get_running_loop().time() >= deadline:\n raise TimeoutError(\"HTTP control server startup timed out\")\n await asyncio.sleep(0.05)\n\n def _serve(self) -> None:\n if self._server is None:\n return\n try:\n asyncio.run(self._server.serve())\n except BaseException as exc: # noqa: BLE001\n self._error = exc", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/http_runner.py:UvicornThreadRunner", - "span_start": 10, - "span_end": 61, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.http_runner", - "is_test": false, - "blob_sha": "3779fdd2878b770e789a35bb2a89c9d79f13b61c26d7db1b3b683f9bb9e1623f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "class ControlChannel(ABC):\n @abstractmethod\n async def start(self, actions: ControlActionSet) -> None:\n \"\"\"Start the control channel and bind handlers.\"\"\"\n\n @abstractmethod\n async def stop(self) -> None:\n \"\"\"Stop the control channel and release resources.\"\"\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/base.py:ControlChannel", - "span_start": 21, - "span_end": 28, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 1, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.base", - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/__init__.py", - "content": "from app_runtime.control.base import ControlActionSet, ControlChannel\nfrom app_runtime.control.http_channel import HttpControlChannel\nfrom app_runtime.control.service import ControlPlaneService\n\n__all__ = [\"ControlActionSet\", \"ControlChannel\", \"ControlPlaneService\", \"HttpControlChannel\"]", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/__init__.py:1-5", - "span_start": 1, - "span_end": 5, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.app_runtime.control.__init__", - "is_test": false, - "blob_sha": "bf3c37e3369a84cc618adc0fd71c232e5eb4b871eaff743069a17e661e498316", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "class HttpControlAppFactory:\n def create(\n self,\n health_provider: Callable[[], Awaitable[HealthPayload]],\n action_provider: Callable[[str, str], Awaitable[JSONResponse]],\n ) -> FastAPI:\n app = FastAPI(title=\"PLBA Control API\")\n\n @app.middleware(\"http\")\n async def log_api_call(request: Request, call_next): # type: ignore[no-untyped-def]\n started = time.monotonic()\n response = await call_next(request)\n response.headers[\"X-Response-Time-Ms\"] = str(int((time.monotonic() - started) * 1000))\n return response\n\n @app.get(\"/health\")\n async def health() -> JSONResponse:\n payload = await health_provider()\n status_code = 200 if payload.get(\"status\") == \"ok\" else 503\n return JSONResponse(content=payload, status_code=status_code)\n\n @app.get(\"/actions/{action}\")\n @app.post(\"/actions/{action}\")\n async def action(action: str, request: Request) -> JSONResponse:\n client_source = self._client_source(request)\n if action in {\"start\", \"stop\"}:\n LOGGER.warning(\"Control action requested: /actions/%s client=%s\", action, client_source)\n return await action_provider(action, client_source)\n\n return app\n\n def _client_source(self, request: Request) -> str:\n explicit_header = request.headers.get(\"X-Client-Source\", \"\").strip()\n if explicit_header:\n return explicit_header\n user_agent = request.headers.get(\"User-Agent\", \"\").strip()\n if user_agent:\n return f\"user-agent:{user_agent}\"\n return \"unknown\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/http_app.py:HttpControlAppFactory", - "span_start": 15, - "span_end": 53, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.http_app", - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "class HttpControlChannel(ControlChannel):\n def __init__(self, host: str, port: int, timeout: int) -> None:\n self._timeout = timeout\n self._runner = UvicornThreadRunner(host, port, timeout)\n self._factory = HttpControlAppFactory()\n self._actions: ControlActionSet | None = None\n\n async def start(self, actions: ControlActionSet) -> None:\n self._actions = actions\n app = self._factory.create(self._health_response, self._action_response)\n await self._runner.start(app)\n\n async def stop(self) -> None:\n await self._runner.stop()\n\n @property\n def port(self) -> int:\n return self._runner.port\n\n async def _health_response(self) -> dict[str, object]:\n if self._actions is None:\n return {\"status\": \"unhealthy\", \"detail\": \"control actions are not configured\"}\n return await asyncio.wait_for(self._actions.health(), timeout=float(self._timeout))\n\n async def _action_response(self, action: str, _client_source: str = \"unknown\") -> JSONResponse:\n if self._actions is None:\n return JSONResponse(content={\"status\": \"error\", \"detail\": f\"{action} handler is not configured\"}, status_code=404)\n callbacks = {\n \"start\": self._actions.start,\n \"stop\": self._actions.stop,\n \"status\": self._actions.status,\n }\n callback = callbacks.get(action)\n if callback is None:\n return JSONResponse(content={\"status\": \"error\", \"detail\": f\"unsupported action: {action}\"}, status_code=404)\n action_timeout = max(float(self._timeout), 10.0) if action in {\"start\", \"stop\"} else float(self._timeout)\n try:\n detail = await asyncio.wait_for(callback(), timeout=action_timeout)\n except asyncio.TimeoutError:\n return JSONResponse(\n content={\"status\": \"accepted\", \"detail\": f\"{action} operation is still in progress\"},\n status_code=202,\n )\n except Exception as exc:\n return JSONResponse(content={\"status\": \"error\", \"detail\": str(exc)}, status_code=500)\n return JSONResponse(content={\"status\": \"ok\", \"detail\": detail or f\"{action} action accepted\"}, status_code=200)", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/http_channel.py:HttpControlChannel", - "span_start": 12, - "span_end": 57, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.http_channel", - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "class ControlActionSet:\n health: HealthHandler\n start: ActionHandler\n stop: ActionHandler\n status: ActionHandler", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/base.py:ControlActionSet", - "span_start": 14, - "span_end": 18, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.base", - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/control.py", - "content": "from app_runtime.control.base import ControlActionSet, ControlChannel\nfrom app_runtime.control.http_channel import HttpControlChannel\nfrom app_runtime.control.service import ControlPlaneService\n\n__all__ = [\n \"ControlActionSet\",\n \"ControlChannel\",\n \"ControlPlaneService\",\n \"HttpControlChannel\",\n]", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/plba/control.py:1-10", - "span_start": 1, - "span_end": 10, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.plba.control", - "is_test": false, - "blob_sha": "31bd5c4481bfa7fbca8fae56d4860a67e3953ca74474ac8439e1f39b685d7bc8", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests manager\n- orchestrates role-like calls (4)\n- reads and writes state attributes\n- participates in dataflow slices (50)", - "layer": "C4_SEMANTIC_ROLES", - "title": "RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 43, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "7e4a9381328c5803bbc6179458612fc4e947d928aa7bf8b4b2bebb2c8592f758", - "symbol_name": "RuntimeManager", - "qname": "RuntimeManager", - "role": "pipeline_stage", - "confidence": 0.67, - "dataflow_participation": 50, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "ControlChannel\nrole: model\n\nResponsibilities:\n- default model role", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlChannel", - "span_start": 21, - "span_end": 28, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 40, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "cfcfe9a311d3a2dbdaf32ac4ccd73c0eb9a117f830591a1c0867ee97d46204ff", - "symbol_name": "ControlChannel", - "qname": "ControlChannel", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "ControlActionSet\nrole: model\n\nResponsibilities:\n- default model role", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlActionSet", - "span_start": 14, - "span_end": 18, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 40, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "46eb026cb3313415ec47b82dd22f84f4d112c9d987e8b1716dcb0baa1cce8988", - "symbol_name": "ControlActionSet", - "qname": "ControlActionSet", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests service\n- reads and writes state attributes\n- participates in dataflow slices (5)", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlPlaneService", - "span_start": 12, - "span_end": 52, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 68, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "b13471e5916986dccffb53fab613812842965705e6b3a89ae549d30c9e91e9aa", - "symbol_name": "ControlPlaneService", - "qname": "ControlPlaneService", - "role": "pipeline_stage", - "confidence": 0.57, - "dataflow_participation": 5, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_runner.py", - "content": "UvicornThreadRunner\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (24)", - "layer": "C4_SEMANTIC_ROLES", - "title": "UvicornThreadRunner", - "span_start": 10, - "span_end": 61, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 11, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "fd55630045a02100df8877ac27d951ee08617d4598764394d48cb51fe067476a", - "symbol_name": "UvicornThreadRunner", - "qname": "UvicornThreadRunner", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 24, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "3779fdd2878b770e789a35bb2a89c9d79f13b61c26d7db1b3b683f9bb9e1623f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (10)", - "layer": "C4_SEMANTIC_ROLES", - "title": "HttpControlChannel", - "span_start": 12, - "span_end": 57, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 21, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "1c9fbdc24819e5604c26ea55428a74310f03a03e1af197ed84846af61e42fdb0", - "symbol_name": "HttpControlChannel", - "qname": "HttpControlChannel", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 10, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "HttpControlAppFactory\nrole: factory\n\nResponsibilities:\n- name suffix suggests factory", - "layer": "C4_SEMANTIC_ROLES", - "title": "HttpControlAppFactory", - "span_start": 15, - "span_end": 53, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 39, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "9b3502a5fb408b273223db13264349cf500de24915b6c649d9ea8970d0dfd8e0", - "symbol_name": "HttpControlAppFactory", - "qname": "HttpControlAppFactory", - "role": "factory", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/persistence/workflow_persistence.py", - "content": "WorkflowPersistence\nrole: pipeline_stage\n\nResponsibilities:\n- orchestrates role-like calls (2)\n- reads and writes state attributes\n- participates in dataflow slices (16)", - "layer": "C4_SEMANTIC_ROLES", - "title": "WorkflowPersistence", - "span_start": 8, - "span_end": 54, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 15, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "7bd01ee45cf31f2d5c2e3e51656254860ac785d10cef9e0852cd4fba90857bae", - "symbol_name": "WorkflowPersistence", - "qname": "WorkflowPersistence", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 16, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "80e9410ddc639789b4353c2a1a757ba8d0d5b5bb6075b0b263b61551f04ae1f0", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager.add_config_file", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 32, - "span_end": 52, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "a23b8a11ebdb12708b60c96ea12a69f7f042082f1adfddd572444e246d81d167", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "57ffbd4f0d9fdf3507c2b8624312ce211f3d02fdf86a57a8ec90778d8a7b498d", - "dst_ref": "RuntimeManager.add_config_file", - "resolution": "resolved", - "slice_id": "a23b8a11ebdb12708b60c96ea12a69f7f042082f1adfddd572444e246d81d167", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager.add_config_file" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "57ffbd4f0d9fdf3507c2b8624312ce211f3d02fdf86a57a8ec90778d8a7b498d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.services\n -> RuntimeManager.__init__", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 33, - "span_end": 39, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "d43af85989222ee6d788ce418cdcb217c7ff044cfb915e3bdbd184417dc7bd61", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "dst_ref": "RuntimeManager.__init__", - "resolution": "resolved", - "slice_id": "d43af85989222ee6d788ce418cdcb217c7ff044cfb915e3bdbd184417dc7bd61", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.services", - "RuntimeManager.__init__" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.stop", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 25, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d", - "dst_ref": "ControlPlaneService.stop", - "resolution": "resolved", - "slice_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.stop" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._stop_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 51, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a", - "dst_ref": "ControlPlaneService._stop_async", - "resolution": "resolved", - "slice_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._stop_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager.start", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 32, - "span_end": 59, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "98312ace7fc62b1c7194c5aa1732b6ef736eae1668a3a120dd1ecd5ab1d64f7a", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "77a7b260193018845e4e204df094ab89cfd7c82ee4e822b3a83ad4cd945f9cb1", - "dst_ref": "RuntimeManager.start", - "resolution": "resolved", - "slice_id": "98312ace7fc62b1c7194c5aa1732b6ef736eae1668a3a120dd1ecd5ab1d64f7a", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager.start" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "77a7b260193018845e4e204df094ab89cfd7c82ee4e822b3a83ad4cd945f9cb1" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager._register_core_services", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 32, - "span_end": 127, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "3e5811f3b511fa0cabe363f5d01f2ac5fa039bc8b93f7ee108323e1f5f45a293", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "972d6057a6caac9cf31ebc1e29c6f39f71b10d4cc170dec57cf875ba458549c6", - "dst_ref": "RuntimeManager._register_core_services", - "resolution": "resolved", - "slice_id": "3e5811f3b511fa0cabe363f5d01f2ac5fa039bc8b93f7ee108323e1f5f45a293", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager._register_core_services" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "972d6057a6caac9cf31ebc1e29c6f39f71b10d4cc170dec57cf875ba458549c6" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.register_channel", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 17, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957", - "dst_ref": "ControlPlaneService.register_channel", - "resolution": "resolved", - "slice_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.register_channel" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.start", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 20, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154", - "dst_ref": "ControlPlaneService.start", - "resolution": "resolved", - "slice_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.start" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._start_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 47, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517", - "dst_ref": "ControlPlaneService._start_async", - "resolution": "resolved", - "slice_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._start_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.services\n -> RuntimeManager._register_core_services", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 33, - "span_end": 127, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "aac6f9dda73963b977083a892bee39a48eca4fbd7404787e022ecf4ebedec65d", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "972d6057a6caac9cf31ebc1e29c6f39f71b10d4cc170dec57cf875ba458549c6", - "dst_ref": "RuntimeManager._register_core_services", - "resolution": "resolved", - "slice_id": "aac6f9dda73963b977083a892bee39a48eca4fbd7404787e022ecf4ebedec65d", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.services", - "RuntimeManager._register_core_services" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "972d6057a6caac9cf31ebc1e29c6f39f71b10d4cc170dec57cf875ba458549c6" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "validation": { - "passed": true, - "action": "return", - "reasons": [] - }, - "steps": [ - { - "step": "router", - "status": "completed", - "timings_ms": { - "router": 1 - }, - "output": { - "intent": "CODE_QA", - "sub_intent": "TRACE_FLOW", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - } - }, - { - "step": "retrieval", - "status": "completed", - "timings_ms": { - "retrieval": 187 - }, - "output": { - "rag_count": 37, - "answer_path_rag_count": 37, - "resolved_symbol_status": "resolved", - "resolved_symbol": "RuntimeManager", - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "diagnostics": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "vector", - "C0_SOURCE_CHUNKS": "vector", - "C4_SEMANTIC_ROLES": "vector", - "C2_DEPENDENCY_GRAPH": "vector", - "C3_ENTRYPOINTS": "vector" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 8, - "C4_SEMANTIC_ROLES": 8, - "C2_DEPENDENCY_GRAPH": 10, - "C3_ENTRYPOINTS": 10 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [] - }, - "C4_SEMANTIC_ROLES": { - "path_scope": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [] - } - }, - "fallback": { - "used": false, - "reason": null - }, - "retrieval_by_layer_ms": { - "C1_SYMBOL_CATALOG": 52, - "C0_SOURCE_CHUNKS": 25, - "C4_SEMANTIC_ROLES": 23, - "C2_DEPENDENCY_GRAPH": 63, - "C3_ENTRYPOINTS": 22 - } - } - }, - { - "step": "pre_evidence_gate", - "status": "passed", - "timings_ms": { - "pre_evidence_gate": 1 - }, - "input": { - "resolved_target": "RuntimeManager", - "sub_intent": "TRACE_FLOW", - "target_type": "symbol", - "evidence_count": 37, - "code_chunk_count": 37, - "entrypoint_count": 3, - "relation_count": 10, - "test_evidence_count": 0, - "symbol_resolution_status": "resolved", - "path_scope": [] - }, - "output": { - "passed": true, - "failure_reasons": [], - "degraded_message": "", - "evidence_count": 37 - } - }, - { - "step": "llm", - "status": "completed", - "timings_ms": { - "llm": 4010 - }, - "output": { - "prompt_name": "code_qa_trace_flow_answer", - "answer_preview": "При запуске `RuntimeManager` выполняются следующие шаги:\n\n1. Инициализация конфигурации и сервисов:\n - В конструкторе `RuntimeManager.__init__` инициализируется конфигурация через поле `configuration`, загружаются файлы конфигурации с помощью метода `add_config_file`.\n - Создаются сервисы внутри", - "resolved_target": "RuntimeManager", - "answer_policy_branch": "normal_answer", - "decision_reason": "evidence_sufficient" - } - }, - { - "step": "post_evidence_gate", - "status": "passed", - "timings_ms": { - "post_evidence_gate": 1, - "post_evidence_gate_recheck": 0, - "repair": 0 - }, - "input": { - "answer_mode": "normal", - "degraded_message": "", - "resolved_target": "RuntimeManager", - "draft_answer_preview": "При запуске `RuntimeManager` выполняются следующие шаги:\n\n1. Инициализация конфигурации и сервисов:\n - В конструкторе `RuntimeManager.__init__` инициализируется конфигурация через поле `configuration`, загружаются файлы конфигурации с помощью метода `add_config_file`.\n - Создаются сервисы внутри", - "repair_candidate": true - }, - "output": { - "passed": true, - "action": "return", - "reasons": [], - "repair_used": false, - "final_answer_preview": "При запуске `RuntimeManager` выполняются следующие шаги:\n\n1. Инициализация конфигурации и сервисов:\n - В конструкторе `RuntimeManager.__init__` инициализируется конфигурация через поле `configuration`, загружаются файлы конфигурации с помощью метода `add_config_file`.\n - Создаются сервисы внутри" - } - } - ] - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/plba_full_chain_subintents_v3/20260312_174008/full_chain_plba_code_subintents_v2_plba-v2-trace-flow-runtime-start.md b/tests/pipeline_setup_v3/test_results/plba_full_chain_subintents_v3/20260312_174008/full_chain_plba_code_subintents_v2_plba-v2-trace-flow-runtime-start.md deleted file mode 100644 index 4a32a37..0000000 --- a/tests/pipeline_setup_v3/test_results/plba_full_chain_subintents_v3/20260312_174008/full_chain_plba_code_subintents_v2_plba-v2-trace-flow-runtime-start.md +++ /dev/null @@ -1,305 +0,0 @@ -# plba-v2-trace-flow-runtime-start - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_02_pipeline/full_chain_plba_code_subintents_v2.yaml -- runner: agent_runtime -- mode: full_chain -- passed: True - -## Query -Покажи поток выполнения при запуске RuntimeManager - -## Actual -{ - "intent": "CODE_QA", - "sub_intent": "TRACE_FLOW", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 37, - "llm_answer": "При запуске `RuntimeManager` выполняются следующие шаги:\n\n1. Инициализация конфигурации и сервисов:\n - В конструкторе `RuntimeManager.__init__` инициализируется конфигурация через поле `configuration`, загружаются файлы конфигурации с помощью метода `add_config_file`.\n - Создаются сервисы внутри конструктора, вызывая сам конструктор (`__init__`) и регистрируя основные сервисы методом `_register_core_services`.\n\n2. Начальная инициализация состояния:\n - Внутри конструктора происходит начальное чтение и запись атрибутов состояния, необходимых для работы менеджера.\n\n3. Запуск менеджера:\n - После полной инициализации выполняется метод `start`, который приводит `RuntimeManager` в активное состояние и начинает обработку запросов.\n\nПоток данных включает в себя загрузку конфигурации, создание и регистрацию сервисов, а также переход в рабочее состояние.\n\nДальнейшее восстановление потока возможно только по дополнительным данным.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "RuntimeManager" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] -} - -## Steps -[ - { - "step": "router", - "status": "completed", - "timings_ms": { - "router": 1 - }, - "output": { - "intent": "CODE_QA", - "sub_intent": "TRACE_FLOW", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - } - }, - { - "step": "retrieval", - "status": "completed", - "timings_ms": { - "retrieval": 187 - }, - "output": { - "rag_count": 37, - "answer_path_rag_count": 37, - "resolved_symbol_status": "resolved", - "resolved_symbol": "RuntimeManager", - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "diagnostics": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "vector", - "C0_SOURCE_CHUNKS": "vector", - "C4_SEMANTIC_ROLES": "vector", - "C2_DEPENDENCY_GRAPH": "vector", - "C3_ENTRYPOINTS": "vector" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 8, - "C4_SEMANTIC_ROLES": 8, - "C2_DEPENDENCY_GRAPH": 10, - "C3_ENTRYPOINTS": 10 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [] - }, - "C4_SEMANTIC_ROLES": { - "path_scope": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [] - } - }, - "fallback": { - "used": false, - "reason": null - }, - "retrieval_by_layer_ms": { - "C1_SYMBOL_CATALOG": 52, - "C0_SOURCE_CHUNKS": 25, - "C4_SEMANTIC_ROLES": 23, - "C2_DEPENDENCY_GRAPH": 63, - "C3_ENTRYPOINTS": 22 - } - } - }, - { - "step": "pre_evidence_gate", - "status": "passed", - "timings_ms": { - "pre_evidence_gate": 1 - }, - "input": { - "resolved_target": "RuntimeManager", - "sub_intent": "TRACE_FLOW", - "target_type": "symbol", - "evidence_count": 37, - "code_chunk_count": 37, - "entrypoint_count": 3, - "relation_count": 10, - "test_evidence_count": 0, - "symbol_resolution_status": "resolved", - "path_scope": [] - }, - "output": { - "passed": true, - "failure_reasons": [], - "degraded_message": "", - "evidence_count": 37 - } - }, - { - "step": "llm", - "status": "completed", - "timings_ms": { - "llm": 4010 - }, - "output": { - "prompt_name": "code_qa_trace_flow_answer", - "answer_preview": "При запуске `RuntimeManager` выполняются следующие шаги:\n\n1. Инициализация конфигурации и сервисов:\n - В конструкторе `RuntimeManager.__init__` инициализируется конфигурация через поле `configuration`, загружаются файлы конфигурации с помощью метода `add_config_file`.\n - Создаются сервисы внутри", - "resolved_target": "RuntimeManager", - "answer_policy_branch": "normal_answer", - "decision_reason": "evidence_sufficient" - } - }, - { - "step": "post_evidence_gate", - "status": "passed", - "timings_ms": { - "post_evidence_gate": 1, - "post_evidence_gate_recheck": 0, - "repair": 0 - }, - "input": { - "answer_mode": "normal", - "degraded_message": "", - "resolved_target": "RuntimeManager", - "draft_answer_preview": "При запуске `RuntimeManager` выполняются следующие шаги:\n\n1. Инициализация конфигурации и сервисов:\n - В конструкторе `RuntimeManager.__init__` инициализируется конфигурация через поле `configuration`, загружаются файлы конфигурации с помощью метода `add_config_file`.\n - Создаются сервисы внутри", - "repair_candidate": true - }, - "output": { - "passed": true, - "action": "return", - "reasons": [], - "repair_used": false, - "final_answer_preview": "При запуске `RuntimeManager` выполняются следующие шаги:\n\n1. Инициализация конфигурации и сервисов:\n - В конструкторе `RuntimeManager.__init__` инициализируется конфигурация через поле `configuration`, загружаются файлы конфигурации с помощью метода `add_config_file`.\n - Создаются сервисы внутри" - } - } -] - -## Diagnostics -{ - "intent_correct": null, - "target_found": true, - "layers_used": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_sufficient": true, - "answer_mode": "normal", - "resolved_target": "RuntimeManager", - "answer_policy_branch": "normal_answer", - "decision_reason": "evidence_sufficient", - "router_result": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "retrieval_profile": "code", - "sub_intent": "TRACE_FLOW", - "path_scope": [], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "symbol_resolution_status": "resolved" - }, - "retrieval_request": { - "rag_session_id": "7d11da21-faa0-4cea-aede-aeabe069164c", - "query": "Покажи поток выполнения при запуске RuntimeManager", - "sub_intent": "TRACE_FLOW", - "path_scope": [], - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "per_layer_outcome": [ - { - "layer_id": "C1_SYMBOL_CATALOG", - "hit_count": 8, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C0_SOURCE_CHUNKS", - "hit_count": 8, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C4_SEMANTIC_ROLES", - "hit_count": 8, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C2_DEPENDENCY_GRAPH", - "hit_count": 10, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C3_ENTRYPOINTS", - "hit_count": 3, - "empty": false, - "fallback_used": false - } - ], - "empty_layers": [], - "evidence_gate_decision": { - "sufficient": true, - "failure_reasons": [], - "evidence_count": 37 - }, - "evidence_gate_input": { - "resolved_target": "RuntimeManager", - "sub_intent": "TRACE_FLOW", - "target_type": "symbol", - "evidence_count": 37, - "code_chunk_count": 37, - "entrypoint_count": 3, - "relation_count": 10, - "test_evidence_count": 0, - "symbol_resolution_status": "resolved", - "path_scope": [] - }, - "post_evidence_gate": { - "input": { - "answer_mode": "normal", - "degraded_message": "", - "resolved_target": "RuntimeManager", - "draft_answer_preview": "При запуске `RuntimeManager` выполняются следующие шаги:\n\n1. Инициализация конфигурации и сервисов:\n - В конструкторе `RuntimeManager.__init__` инициализируется конфигурация через поле `configuration`, загружаются файлы конфигурации с помощью метода `add_config_file`.\n - Создаются сервисы внутри", - "repair_candidate": true - }, - "output": { - "passed": true, - "action": "return", - "reasons": [], - "repair_used": false, - "final_answer_preview": "При запуске `RuntimeManager` выполняются следующие шаги:\n\n1. Инициализация конфигурации и сервисов:\n - В конструкторе `RuntimeManager.__init__` инициализируется конфигурация через поле `configuration`, загружаются файлы конфигурации с помощью метода `add_config_file`.\n - Создаются сервисы внутри" - } - }, - "failure_reasons": [], - "timings_ms": { - "router": 1, - "retrieval": 187, - "pre_evidence_gate": 1, - "llm": 4010, - "post_evidence_gate": 1 - } -} - -## Mismatches -- none \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/plba_full_chain_subintents_v3/20260312_174008/summary.md b/tests/pipeline_setup_v3/test_results/plba_full_chain_subintents_v3/20260312_174008/summary.md deleted file mode 100644 index 9717c0f..0000000 --- a/tests/pipeline_setup_v3/test_results/plba_full_chain_subintents_v3/20260312_174008/summary.md +++ /dev/null @@ -1,80 +0,0 @@ -# pipeline_setup_v3 summary - -Passed: 18/18 - -| File | Case | Mode | Query | Actual sub-intent | RAG layers | Pass | -|------|------|------|-------|-------------------|------------|------| -| full_chain_plba_code_subintents_v2.yaml | plba-v2-open-file-runtime | full_chain | Открой файл src/app_runtime/core/runtime.py | OPEN_FILE | C0_SOURCE_CHUNKS:1 | ✓ | -| full_chain_plba_code_subintents_v2.yaml | plba-v2-open-file-public-api | full_chain | Открой файл src/plba/__init__.py | OPEN_FILE | C0_SOURCE_CHUNKS:1 | ✓ | -| full_chain_plba_code_subintents_v2.yaml | plba-v2-explain-runtime-manager | full_chain | Объясни как работает класс RuntimeManager | EXPLAIN | C0_SOURCE_CHUNKS:8, C1_SYMBOL_CATALOG:8, C2_DEPENDENCY_GRAPH:6, C3_ENTRYPOINTS:3, C4_SEMANTIC_ROLES:8 | ✓ | -| full_chain_plba_code_subintents_v2.yaml | plba-v2-explain-trace-service | full_chain | Объясни как работает класс TraceService | EXPLAIN | C0_SOURCE_CHUNKS:8, C1_SYMBOL_CATALOG:8, C2_DEPENDENCY_GRAPH:6, C3_ENTRYPOINTS:3, C4_SEMANTIC_ROLES:8 | ✓ | -| full_chain_plba_code_subintents_v2.yaml | plba-v2-explain-create-runtime | full_chain | Что делает функция create_runtime? | EXPLAIN | C0_SOURCE_CHUNKS:8, C1_SYMBOL_CATALOG:8, C2_DEPENDENCY_GRAPH:6, C3_ENTRYPOINTS:3, C4_SEMANTIC_ROLES:8 | ✓ | -| full_chain_plba_code_subintents_v2.yaml | plba-v2-explain-local-http-channel | full_chain | Почему в файле src/app_runtime/control/http_channel.py класс HttpControlChannel устроен так? | EXPLAIN_LOCAL | C0_SOURCE_CHUNKS:1, C1_SYMBOL_CATALOG:8, C2_DEPENDENCY_GRAPH:4 | ✓ | -| full_chain_plba_code_subintents_v2.yaml | plba-v2-find-tests-runtime-manager | full_chain | Где тесты для RuntimeManager? | FIND_TESTS | C0_SOURCE_CHUNKS:10, C1_SYMBOL_CATALOG:8, C2_DEPENDENCY_GRAPH:6 | ✓ | -| full_chain_plba_code_subintents_v2.yaml | plba-v2-find-tests-trace-service | full_chain | Где тесты для TraceService? | FIND_TESTS | C0_SOURCE_CHUNKS:10, C1_SYMBOL_CATALOG:8, C2_DEPENDENCY_GRAPH:6 | ✓ | -| full_chain_plba_code_subintents_v2.yaml | plba-v2-find-tests-create-runtime | full_chain | Где тесты для create_runtime? | FIND_TESTS | C0_SOURCE_CHUNKS:10, C1_SYMBOL_CATALOG:8, C2_DEPENDENCY_GRAPH:6 | ✓ | -| full_chain_plba_code_subintents_v2.yaml | plba-v2-find-tests-workflow-runtime-factory-negative | full_chain | Где тесты для WorkflowRuntimeFactory? | FIND_TESTS | C0_SOURCE_CHUNKS:10, C1_SYMBOL_CATALOG:8, C2_DEPENDENCY_GRAPH:6 | ✓ | -| full_chain_plba_code_subintents_v2.yaml | plba-v2-find-entrypoints-control-plane | full_chain | Найди точки входа HTTP control plane | FIND_ENTRYPOINTS | C0_SOURCE_CHUNKS:6, C3_ENTRYPOINTS:3 | ✓ | -| full_chain_plba_code_subintents_v2.yaml | plba-v2-find-entrypoints-health-endpoint | full_chain | Где health endpoint? | FIND_ENTRYPOINTS | C0_SOURCE_CHUNKS:7, C3_ENTRYPOINTS:3 | ✓ | -| full_chain_plba_code_subintents_v2.yaml | plba-v2-trace-flow-runtime-start | full_chain | Покажи поток выполнения при запуске RuntimeManager | TRACE_FLOW | C0_SOURCE_CHUNKS:8, C1_SYMBOL_CATALOG:8, C2_DEPENDENCY_GRAPH:10, C3_ENTRYPOINTS:3, C4_SEMANTIC_ROLES:8 | ✓ | -| full_chain_plba_code_subintents_v2.yaml | plba-v2-trace-flow-health-endpoint | full_chain | Покажи как проходит запрос /health в HttpControlAppFactory | TRACE_FLOW | C0_SOURCE_CHUNKS:8, C1_SYMBOL_CATALOG:8, C2_DEPENDENCY_GRAPH:10, C3_ENTRYPOINTS:3, C4_SEMANTIC_ROLES:8 | ✓ | -| full_chain_plba_code_subintents_v2.yaml | plba-v2-architecture-runtime-manager | full_chain | Какие компоненты участвуют в RuntimeManager? | ARCHITECTURE | C0_SOURCE_CHUNKS:4, C1_SYMBOL_CATALOG:6, C2_DEPENDENCY_GRAPH:8, C3_ENTRYPOINTS:3, C4_SEMANTIC_ROLES:12 | ✓ | -| full_chain_plba_code_subintents_v2.yaml | plba-v2-architecture-control-plane | full_chain | Какие компоненты участвуют в ControlPlaneService? | ARCHITECTURE | C0_SOURCE_CHUNKS:4, C1_SYMBOL_CATALOG:6, C2_DEPENDENCY_GRAPH:8, C3_ENTRYPOINTS:3, C4_SEMANTIC_ROLES:12 | ✓ | -| full_chain_plba_code_subintents_v2.yaml | plba-v2-explain-nonexistent-symbol | full_chain | Объясни класс RuntimeFactoryManager | EXPLAIN | — | ✓ | -| full_chain_plba_code_subintents_v2.yaml | plba-v2-open-file-nonexistent | full_chain | Открой файл src/app_runtime/core/missing_runtime.py | OPEN_FILE | — | ✓ | - -## LLM Answers -- **plba-v2-open-file-runtime** - Query: Открой файл src/app_runtime/core/runtime.py - > В файле \`src/app\_runtime/core/runtime.py\` определён класс \`RuntimeManager\`. У него есть несколько атрибутов класса: \- \`ACTION\_TIMEOUT\_SECONDS = 10.0\` \- \`ACTION\_POLL\_INTERVAL\_SECONDS = 0.05\` В конструкторе \(\`\_\_init\_\_\`\) инициализируются следующие поля объекта: \- \`configuration\`: экземпляр \`ConfigurationManager\` \- \`services\`: экземпляр \`ServiceContainer\` \- \`traces\`: экземпляр \`TraceService\` \- \`health\`: экземпляр \`HealthRegistry\` \- \`logs\`: экземпляр \`LogManager\` \- \`workers\`: экземпляр \`WorkerSupervisor\` \- \`control\_plane\`: экземпляр \`ControlPlaneService\` Все эти поля могут принимать значения по умолчанию, если при создании объекта явные аргументы не указаны. -- **plba-v2-open-file-public-api** - Query: Открой файл src/plba/__init__.py - > Файл \`src/plba/\_\_init\_\_.py\` импортирует следующие основные компоненты: \- Из \`plba.bootstrap\`: \`create\_runtime\` \- Из \`plba.config\`: \`ConfigFileLoader\`, \`FileConfigProvider\` \- Из \`plba.control\`: \`ControlActionSet\`, \`ControlChannel\`, \`ControlPlaneService\`, \`HttpControlChannel\` \- Из \`plba.contracts\`: несколько контрактов, таких как \`ApplicationModule\`, \`ConfigProvider\`, \`Worker\`, \`WorkerHealth\` \- Из \`plba.core\`: \`ConfigurationManager\`, \`RuntimeManager\`, \`ServiceContainer\` \- Из \`plba.health\`: \`HealthRegistry\` \- Из \`plba.logging\`: \`LogManager\` \- Из \`plba.queue\`: \`InMemoryTaskQueue\` \- Из \`plba.tracing\`: \`MySqlTraceTransport\`, \`NoOpTraceTransport\`, \`TraceService\` \- Из \`plba.workflow\`: различные классы для работы с workflow Это инициализационный скрипт пакета \`plba\`, обеспечивающий доступ ко всем основным функциональным блокам пакета. -- **plba-v2-explain-runtime-manager** - Query: Объясни как работает класс RuntimeManager - > Класс \`RuntimeManager\` определён в файле \`src/app\_runtime/core/runtime.py\` и имеет responsibilities характерные для менеджера: управляет конфигурацией, состоянием и участвует в потоках данных через 50 срезов dataflow. Конструктор \`RuntimeManager.\_\_init\_\_\` инициализирует объект и вызывает: \- \`RuntimeManager.configuration\` \- \`RuntimeManager.add\_config\_file\` Связи и вызовы других сущностей не указаны явно в данном контексте, но известно, что \`RuntimeManager\` используется в службах контроля \(\`ControlPlaneService\`\) и взаимодействует с ними через методы старта, стопа и получения снимков состояния. Дополнительные детали о взаимодействии с другими компонентами отсутствуют в представленном контексте. -- **plba-v2-explain-trace-service** - Query: Объясни как работает класс TraceService - > Класс \`TraceService\` находится в файле \`src/app\_runtime/tracing/service.py\`. Он наследуется от \`TraceContextFactory\`. Основные компоненты: \- \*\*Конструктор \(\`\_\_init\_\_\`\)\*\*: принимает параметры \`transport\` и \`store\`, инициализирует транспорт для трассировки и хранилище контекста трассировки. Если транспорт или хранилище не указаны, используются реализации по умолчанию: \`NoOpTraceTransport\(\)\` и \`TraceContextStore\(\)\`. \- \*\*Метод \`create\_context\`\*\*: создаёт новый контекст трассировки, принимая параметры \`alias\`, \`parent\_id\`, \`kind\` и \`attrs\`. В нём создаётся запись контекста трассировки с уникальным идентификатором, текущим временем и переданными параметрами, затем эта запись сохраняется в хранилище. Также определены методы \`open\_context\`, \`close\_context\`, \`current\_trace\_id\`, но их реализация не приведена в контексте. Осторожный вывод: \`TraceService\` используется для управл… -- **plba-v2-explain-create-runtime** - Query: Что делает функция create_runtime? - > Функция \`create\_runtime\` определена в модуле \`src/plba/bootstrap.py\`. Она создаёт и настраивает экземпляр \`RuntimeManager\`, регистрируя модуль приложения и, при необходимости, конфигурационные файлы и HTTP\-канал управления. Основные действия функции: \- Инициализирует объект \`RuntimeManager\`. \- Если указан путь к конфигурационному файлу \(\`config\_path\`\), добавляет его в менеджер. \- Если включено управление через HTTP \(\`enable\_http\_control\`\), регистрирует HTTP\-канал управления в плоскости контроля. \- Регистрирует модуль приложения в менеджере времени выполнения. \- Возвращает настроенный объект \`RuntimeManager\`. Входные параметры: \- \`module\`: экземпляр \`ApplicationModule\`. \- \`config\_path\`: опциональный путь к конфигурационному файлу. \- \`enable\_http\_control\`: флаг включения HTTP\-контроля. \- \`control\_host\`, \`control\_port\`, \`control\_timeout\`: параметры подключения для HTTP\-… -- **plba-v2-explain-local-http-channel** - Query: Почему в файле src/app_runtime/control/http_channel.py класс HttpControlChannel устроен так? - > Класс HttpControlChannel в файле http\_channel.py наследует ControlChannel и реализует HTTP\-канал управления. Он имеет конструктор с параметрами хост, порт и таймаут, где инициализирует runner \(используя Uvicorn для запуска сервера\) и factory для создания FastAPI\-приложения. Метод start запускает сервер с приложением, используя фабрику и передавая обработчики здоровья и действий. Методы \_health\_response и \_action\_response отвечают за обработку запросов к здоровью сервиса и выполнение действий соответственно. Структура класса ориентирована на создание отдельного HTTP\-канала для управления приложением через HTTP\-запросы. -- **plba-v2-find-tests-runtime-manager** - Query: Где тесты для RuntimeManager? - > Прямые тесты для \`RuntimeManager\` находятся в файле \`tests/test\_runtime.py\`. Косвенные тесты: \- В файле \`tests/test\_business\_control\_actions.py\` есть тесты, использующие компоненты контроля, которые взаимодействуют с \`RuntimeManager\`. -- **plba-v2-find-tests-trace-service** - Query: Где тесты для TraceService? - > Прямые тесты для TraceService находятся в файле \`tests/test\_runtime.py\`: \- \`test\_trace\_service\_allows\_messages\_without\_status\`: проверяет возможность отправки сообщений без статуса. \- \`test\_trace\_service\_writes\_contexts\_and\_messages\`: проверяет запись контекстов и сообщений. \- \`test\_trace\_service\_supports\_debug\_warning\_and\_error\_levels\`: проверяет поддержку уровней debug, warning и error. -- **plba-v2-find-tests-create-runtime** - Query: Где тесты для create_runtime? - > Прямые тесты для \`create\_runtime\` не найдены. Ближайший косвенный тест: \- \`tests/test\_runtime.py::test\_public\_plba\_package\_exports\_runtime\_builder\_and\_worker\_contract\` \- Проверяет экспорт пакета plba и доступность создания runtime, включая \`create\_runtime\`. -- **plba-v2-find-tests-workflow-runtime-factory-negative** - Query: Где тесты для WorkflowRuntimeFactory? - > Insufficient evidence for a confident answer. No test candidates found. -- **plba-v2-find-entrypoints-control-plane** - Query: Найди точки входа HTTP control plane - > Подтверждённые HTTP routes: \- GET /health, объявлен в src/app\_runtime/control/http\_app.py, строки 31\-34, обработчик health \- GET /actions/\{action\}, объявлен в src/app\_runtime/control/http\_app.py, строки 38\-42, обработчик action \- POST /actions/\{action\}, объявлен в src/app\_runtime/control/http\_app.py, строки 38\-42, обработчик action Кандидаты на входы не требуются, так как все маршруты уже подтверждены. -- **plba-v2-find-entrypoints-health-endpoint** - Query: Где health endpoint? - > Подтверждённая точка входа для health endpoint: GET /health, declared in src/app\_runtime/control/http\_app.py, lines 31\-34, handler function named 'health'. -- **plba-v2-trace-flow-runtime-start** - Query: Покажи поток выполнения при запуске RuntimeManager - > При запуске \`RuntimeManager\` выполняются следующие шаги: 1. Инициализация конфигурации и сервисов: \- В конструкторе \`RuntimeManager.\_\_init\_\_\` инициализируется конфигурация через поле \`configuration\`, загружаются файлы конфигурации с помощью метода \`add\_config\_file\`. \- Создаются сервисы внутри конструктора, вызывая сам конструктор \(\`\_\_init\_\_\`\) и регистрируя основные сервисы методом \`\_register\_core\_services\`. 2. Начальная инициализация состояния: \- Внутри конструктора происходит начальное чтение и запись атрибутов состояния, необходимых для работы менеджера. 3. Запуск менеджера: \- После полной инициализации выполняется метод \`start\`, который приводит \`RuntimeManager\` в активное состояние и начинает обработку запросов. Поток данных включает в себя загрузку конфигурации, создание и регистрацию сервисов, а также переход в рабочее состояние. Дальнейшее восстановление поток… -- **plba-v2-trace-flow-health-endpoint** - Query: Покажи как проходит запрос /health в HttpControlAppFactory - > Запрос /health обрабатывается следующим образом: 1. В файле \`http\_app.py\` класс \`HttpControlAppFactory\` создаёт объект FastAPI с маршрутом \`/health\`. 2. Маршрут \`/health\` сопоставлен с функцией\-обработчиком \`health\`, определённой внутри фабрики на строках 31–34. 3. При обращении к маршруту \`/health\` вызывается этот обработчик, который асинхронно вызывает провайдер здоровья \(\`health\_provider\`\), переданный в фабрику. 4. Приложение обернуто middleware для логирования времени ответа, которое добавляется в заголовок X\-Response\-Time\-Ms. Цепочка вызовов завершается на уровне фабрики, конкретных имплементаций провайдера здоровья в данном контексте нет. -- **plba-v2-architecture-runtime-manager** - Query: Какие компоненты участвуют в RuntimeManager? - > Компоненты, участвующие в RuntimeManager: 1. \*\*ControlPlaneService\*\* \- Регистрирует каналы управления \(\_register\_channel\_\), запускается асинхронно \(\_start\_async\), останавливается \(\_stop\_, \_stop\_async\_\). \- Файлы: \`service.py\` \(строки 14–52\). 2. \*\*HttpControlAppFactory\*\* \- Фабрика для создания HTTP\-приложений контроля. \- Файл: \`http\_app.py\` \(строки 15–53\). 3. \*\*UvicornThreadRunner\*\* \- Выполняет работу в потоке Uvicorn. \- Файл: \`http\_runner.py\` \(строки 10–61\). 4. \*\*HttpControlChannel\*\* \- Канал HTTP\-контроля. \- Файл: \`http\_channel.py\` \(строки 12–57\). 5. \*\*WorkflowPersistence\*\* \- Сохраняет состояние рабочих процессов. \- Файл: \`workflow\_persistence.py\` \(строки 8–54\). 6. \*\*InMemoryTaskQueue\*\* \- Очередь задач в памяти. \- Файл: \`in\_memory.py\` \(строки 9–38\). 7. \*\*ConfigFileLoader\*\* \- Загружает конфигурационные файлы. \- Файл: \`file\_loader.py\` \(строки 11–48\). 8. \*\*TraceContextSt… -- **plba-v2-architecture-control-plane** - Query: Какие компоненты участвуют в ControlPlaneService? - > Компоненты, участвующие в ControlPlaneService: \- \*\*ControlActionSet\*\* – модель для управления действиями. \- \*\*ControlChannel\*\* – абстрактный базовый класс каналов контроля с методами start и stop. \- \*\*UvicornThreadRunner\*\* – этап пайплайна для многопоточного запуска HTTP сервера. \- \*\*HttpControlChannel\*\* – канал HTTP\-контроля, этап пайплайна. \- \*\*HttpControlAppFactory\*\* – фабрика создания HTTP\-приложения контроля. \- \*\*WorkflowPersistence\*\* – сохранение состояний рабочих процессов. \- \*\*InMemoryTaskQueue\*\* – очередь задач в памяти. \- \*\*ConfigFileLoader\*\* – загрузчик конфигурационных файлов. \- \*\*TraceContextStore\*\* – хранилище контекстов трассировки. \- \*\*WorkerSupervisor\*\* – надзор за рабочими процессами. \- \*\*WorkflowEngine\*\* – движок обработки рабочих процессов. Связи внутри ControlPlaneService: \- \_channels – атрибут, используемый во многих методах сервиса. \- register\_… -- **plba-v2-explain-nonexistent-symbol** - Query: Объясни класс RuntimeFactoryManager - > Сущность RuntimeFactoryManager не найдена в доступном коде. -- **plba-v2-open-file-nonexistent** - Query: Открой файл src/app_runtime/core/missing_runtime.py - > Файл src/app\_runtime/core/missing\_runtime.py не найден. \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/plba_full_chain_subintents_v3/20260312_192715/full_chain_plba_code_subintents_v2_plba-v2-architecture-control-plane.json b/tests/pipeline_setup_v3/test_results/plba_full_chain_subintents_v3/20260312_192715/full_chain_plba_code_subintents_v2_plba-v2-architecture-control-plane.json deleted file mode 100644 index c82b8f8..0000000 --- a/tests/pipeline_setup_v3/test_results/plba_full_chain_subintents_v3/20260312_192715/full_chain_plba_code_subintents_v2_plba-v2-architecture-control-plane.json +++ /dev/null @@ -1,4521 +0,0 @@ -{ - "case_id": "plba-v2-architecture-control-plane", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_02_pipeline/full_chain_plba_code_subintents_v2.yaml", - "runner": "agent_runtime", - "mode": "full_chain", - "query": "Какие компоненты участвуют в ControlPlaneService?", - "actual": { - "intent": "CODE_QA", - "sub_intent": "ARCHITECTURE", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 33, - "llm_answer": "**ControlPlaneService** является главным компонентом, управляющим жизненным циклом контролируемых каналов.\n\nКомпоненты:\n- **ControlPlaneService**\n- **ControlPlaneService.__init__**: инициализирует сервис, регистрирует каналы и запускает асинхронные операции.\n- **ControlPlaneService.start**: начинает работу сервиса, вызывая asyncio.run и читая атрибут _channels.\n- **ControlPlaneService.register_channel**: регистрирует канал, читая атрибут _channels.\n- **ControlPlaneService.stop**, **ControlPlaneService._stop_async**: останавливают сервисы.\n- **ControlPlaneService._start_async**: отвечает за асинхронный старт.\n- **ControlChannel**: абстрактный базовый класс всех каналов контроля с методами start и stop.\n\nСвязи между компонентами:\n- Инициализация (ControlPlaneService.__init__) выполняет dataflow_slice для методов регистрации и старта.\n- Метод старта (ControlPlaneService.start) вызывает asyncio.run и зависит от атрибута _channels.\n- Регистрация канала (ControlPlaneService.register_channel) использует данные из атрибута _channels.\n\nТаким образом, ControlPlaneService координирует работу зарегистрированных каналов (_channels), обеспечивая их правильный запуск и остановку.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "ControlPlaneService" - ], - "layers": [ - "C4_SEMANTIC_ROLES", - "C3_ENTRYPOINTS", - "C2_DEPENDENCY_GRAPH", - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS" - ] - }, - "passed": true, - "mismatches": [], - "details": { - "query": "Какие компоненты участвуют в ControlPlaneService?", - "router_result": { - "schema_version": "1.1", - "intent": "CODE_QA", - "retrieval_profile": "code", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query_plan": { - "raw": "Какие компоненты участвуют в ControlPlaneService?", - "normalized": "Какие компоненты участвуют в ControlPlaneService?", - "sub_intent": "ARCHITECTURE", - "negations": [], - "expansions": [ - "ControlPlaneService" - ], - "keyword_hints": [ - "ControlPlaneService" - ], - "path_hints": [], - "doc_scope_hints": [], - "symbol_candidates": [ - "ControlPlaneService" - ], - "symbol_kind_hint": "class", - "anchors": [ - { - "type": "SYMBOL", - "value": "ControlPlaneService", - "source": "user_text", - "subtype": null, - "span": { - "start": 29, - "end": 48 - }, - "confidence": 0.88 - } - ] - }, - "retrieval_spec": { - "domains": [ - "CODE" - ], - "layer_queries": [ - { - "layer_id": "C4_SEMANTIC_ROLES", - "top_k": 12 - }, - { - "layer_id": "C3_ENTRYPOINTS", - "top_k": 8 - }, - { - "layer_id": "C2_DEPENDENCY_GRAPH", - "top_k": 8 - }, - { - "layer_id": "C1_SYMBOL_CATALOG", - "top_k": 6 - }, - { - "layer_id": "C0_SOURCE_CHUNKS", - "top_k": 4 - } - ], - "filters": { - "test_policy": "EXCLUDE", - "path_scope": [], - "language": [ - "python" - ] - }, - "rerank_profile": "code" - }, - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - }, - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "ControlPlaneService", - "alternatives": [ - "ControlPlaneService", - "ControlPlaneService", - "ControlPlaneService", - "ControlPlaneService", - "ControlPlaneService" - ], - "confidence": 0.99 - }, - "evidence_policy": { - "require_def": true, - "require_flow": true, - "require_spec": false, - "allow_answer_without_evidence": false - } - }, - "retrieval_request": { - "rag_session_id": "7d11da21-faa0-4cea-aede-aeabe069164c", - "query": "Какие компоненты участвуют в ControlPlaneService?", - "sub_intent": "ARCHITECTURE", - "path_scope": [], - "keyword_hints": [ - "ControlPlaneService" - ], - "symbol_candidates": [ - "ControlPlaneService" - ], - "requested_layers": [ - "C4_SEMANTIC_ROLES", - "C3_ENTRYPOINTS", - "C2_DEPENDENCY_GRAPH", - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS" - ], - "retrieval_spec": { - "domains": [ - "CODE" - ], - "layer_queries": [ - { - "layer_id": "C4_SEMANTIC_ROLES", - "top_k": 12 - }, - { - "layer_id": "C3_ENTRYPOINTS", - "top_k": 8 - }, - { - "layer_id": "C2_DEPENDENCY_GRAPH", - "top_k": 8 - }, - { - "layer_id": "C1_SYMBOL_CATALOG", - "top_k": 6 - }, - { - "layer_id": "C0_SOURCE_CHUNKS", - "top_k": 4 - } - ], - "filters": { - "test_policy": "EXCLUDE", - "path_scope": [], - "language": [ - "python" - ] - }, - "rerank_profile": "code" - }, - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - }, - "query_plan": { - "raw": "Какие компоненты участвуют в ControlPlaneService?", - "normalized": "Какие компоненты участвуют в ControlPlaneService?", - "sub_intent": "ARCHITECTURE", - "negations": [], - "expansions": [ - "ControlPlaneService" - ], - "keyword_hints": [ - "ControlPlaneService" - ], - "path_hints": [], - "doc_scope_hints": [], - "symbol_candidates": [ - "ControlPlaneService" - ], - "symbol_kind_hint": "class", - "anchors": [ - { - "type": "SYMBOL", - "value": "ControlPlaneService", - "source": "user_text", - "subtype": null, - "span": { - "start": 29, - "end": 48 - }, - "confidence": 0.88 - } - ] - } - }, - "retrieval_result": { - "target_symbol_candidates": [ - "ControlPlaneService", - "ControlChannel" - ], - "resolved_symbol": "ControlPlaneService", - "symbol_resolution_status": "resolved", - "file_candidates": [ - "src/app_runtime/control/service.py", - "src/app_runtime/control/base.py", - "src/app_runtime/control/http_runner.py", - "src/app_runtime/control/http_channel.py", - "src/app_runtime/control/http_app.py", - "src/app_runtime/workflow/persistence/workflow_persistence.py", - "src/app_runtime/queue/in_memory.py", - "src/app_runtime/config/file_loader.py", - "src/app_runtime/tracing/store.py", - "src/app_runtime/workers/supervisor.py", - "src/app_runtime/workflow/engine/workflow_engine.py", - "src/app_runtime/core/runtime.py", - "src/plba/control.py", - "src/app_runtime/control/__init__.py", - "src/plba/__init__.py" - ], - "code_chunks": [ - { - "layer": "C4_SEMANTIC_ROLES", - "path": "src/app_runtime/control/service.py", - "title": "ControlPlaneService", - "content": "ControlPlaneService\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests service\n- reads and writes state attributes\n- participates in dataflow slices (5)", - "start_line": 12, - "end_line": 52, - "metadata": { - "symbol_id": "b13471e5916986dccffb53fab613812842965705e6b3a89ae549d30c9e91e9aa", - "symbol_name": "ControlPlaneService", - "qname": "ControlPlaneService", - "role": "pipeline_stage", - "confidence": 0.57, - "dataflow_participation": 5, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C4_SEMANTIC_ROLES", - "path": "src/app_runtime/control/base.py", - "title": "ControlActionSet", - "content": "ControlActionSet\nrole: model\n\nResponsibilities:\n- default model role", - "start_line": 14, - "end_line": 18, - "metadata": { - "symbol_id": "46eb026cb3313415ec47b82dd22f84f4d112c9d987e8b1716dcb0baa1cce8988", - "symbol_name": "ControlActionSet", - "qname": "ControlActionSet", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C4_SEMANTIC_ROLES", - "path": "src/app_runtime/control/base.py", - "title": "ControlChannel", - "content": "ControlChannel\nrole: model\n\nResponsibilities:\n- default model role", - "start_line": 21, - "end_line": 28, - "metadata": { - "symbol_id": "cfcfe9a311d3a2dbdaf32ac4ccd73c0eb9a117f830591a1c0867ee97d46204ff", - "symbol_name": "ControlChannel", - "qname": "ControlChannel", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C4_SEMANTIC_ROLES", - "path": "src/app_runtime/control/http_runner.py", - "title": "UvicornThreadRunner", - "content": "UvicornThreadRunner\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (24)", - "start_line": 10, - "end_line": 61, - "metadata": { - "symbol_id": "fd55630045a02100df8877ac27d951ee08617d4598764394d48cb51fe067476a", - "symbol_name": "UvicornThreadRunner", - "qname": "UvicornThreadRunner", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 24, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "3779fdd2878b770e789a35bb2a89c9d79f13b61c26d7db1b3b683f9bb9e1623f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C4_SEMANTIC_ROLES", - "path": "src/app_runtime/control/http_channel.py", - "title": "HttpControlChannel", - "content": "HttpControlChannel\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (10)", - "start_line": 12, - "end_line": 57, - "metadata": { - "symbol_id": "1c9fbdc24819e5604c26ea55428a74310f03a03e1af197ed84846af61e42fdb0", - "symbol_name": "HttpControlChannel", - "qname": "HttpControlChannel", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 10, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C4_SEMANTIC_ROLES", - "path": "src/app_runtime/control/http_app.py", - "title": "HttpControlAppFactory", - "content": "HttpControlAppFactory\nrole: factory\n\nResponsibilities:\n- name suffix suggests factory", - "start_line": 15, - "end_line": 53, - "metadata": { - "symbol_id": "9b3502a5fb408b273223db13264349cf500de24915b6c649d9ea8970d0dfd8e0", - "symbol_name": "HttpControlAppFactory", - "qname": "HttpControlAppFactory", - "role": "factory", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C4_SEMANTIC_ROLES", - "path": "src/app_runtime/workflow/persistence/workflow_persistence.py", - "title": "WorkflowPersistence", - "content": "WorkflowPersistence\nrole: pipeline_stage\n\nResponsibilities:\n- orchestrates role-like calls (2)\n- reads and writes state attributes\n- participates in dataflow slices (16)", - "start_line": 8, - "end_line": 54, - "metadata": { - "symbol_id": "7bd01ee45cf31f2d5c2e3e51656254860ac785d10cef9e0852cd4fba90857bae", - "symbol_name": "WorkflowPersistence", - "qname": "WorkflowPersistence", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 16, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "80e9410ddc639789b4353c2a1a757ba8d0d5b5bb6075b0b263b61551f04ae1f0", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C4_SEMANTIC_ROLES", - "path": "src/app_runtime/queue/in_memory.py", - "title": "InMemoryTaskQueue", - "content": "InMemoryTaskQueue\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (9)", - "start_line": 9, - "end_line": 38, - "metadata": { - "symbol_id": "2da04cb94544a3bcbf0943a95ad4bdd8710bcafaa32a02fd0e4de2178dcf3533", - "symbol_name": "InMemoryTaskQueue", - "qname": "InMemoryTaskQueue", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 9, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "58f0cc001ccda0eee4c6bc32ed83bd05eafd6b6644f1e8b4aa9eed3103db73dc", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C4_SEMANTIC_ROLES", - "path": "src/app_runtime/config/file_loader.py", - "title": "ConfigFileLoader", - "content": "ConfigFileLoader\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (8)", - "start_line": 11, - "end_line": 48, - "metadata": { - "symbol_id": "a8474eca8b6e9dc86ae67ed68b16fa5fb639ef08739c053e7b7195489765667f", - "symbol_name": "ConfigFileLoader", - "qname": "ConfigFileLoader", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 8, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "1f19ffebde5e38e4be5a5d5a678059a0f36dedb8fb8b3e00ab395c67106a87ea", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C4_SEMANTIC_ROLES", - "path": "src/app_runtime/tracing/store.py", - "title": "TraceContextStore", - "content": "TraceContextStore\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (6)", - "start_line": 15, - "end_line": 52, - "metadata": { - "symbol_id": "b2dad4fbe16ffb11b58deba311c7739955c39d59f291b22181f33e9c8cce4059", - "symbol_name": "TraceContextStore", - "qname": "TraceContextStore", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 6, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "d369554f08fc92039c6edd5a2a1e73b23901533e8974459170bbd9347d263dc5", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C4_SEMANTIC_ROLES", - "path": "src/app_runtime/workers/supervisor.py", - "title": "WorkerSupervisor", - "content": "WorkerSupervisor\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (6)", - "start_line": 10, - "end_line": 59, - "metadata": { - "symbol_id": "c17b44e8d9e97d490989b21fa67d7c346cdda8a0472e4c41fb243c8846faa124", - "symbol_name": "WorkerSupervisor", - "qname": "WorkerSupervisor", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 6, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "77609d9d5927171cce7fc3a54897c183fd63068710c6362029b700937aae5eee", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C4_SEMANTIC_ROLES", - "path": "src/app_runtime/workflow/engine/workflow_engine.py", - "title": "WorkflowEngine", - "content": "WorkflowEngine\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (6)", - "start_line": 10, - "end_line": 86, - "metadata": { - "symbol_id": "57ec0a9f11c542c78e008684a888397e8d9ef4223671acb2567e631a0cbc70b4", - "symbol_name": "WorkflowEngine", - "qname": "WorkflowEngine", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 6, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "1057136e58a325cd5ab6f4e265d15665fb6a711b7022d9fab52a1a290afa2368", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C3_ENTRYPOINTS", - "path": "src/app_runtime/control/http_app.py", - "title": "app.post", - "content": "fastapi http app.post", - "start_line": 38, - "end_line": 42, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C3_ENTRYPOINTS", - "path": "src/app_runtime/control/http_app.py", - "title": "app.get", - "content": "fastapi http app.get", - "start_line": 31, - "end_line": 34, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C3_ENTRYPOINTS", - "path": "src/app_runtime/control/http_app.py", - "title": "app.get", - "content": "fastapi http app.get", - "start_line": 38, - "end_line": 42, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "path": "src/app_runtime/control/service.py", - "title": "ControlPlaneService.__init__:dataflow_slice", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._start_async", - "start_line": 14, - "end_line": 47, - "metadata": { - "edge_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517", - "dst_ref": "ControlPlaneService._start_async", - "resolution": "resolved", - "slice_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._start_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "path": "src/app_runtime/control/service.py", - "title": "ControlPlaneService.__init__:dataflow_slice", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.register_channel", - "start_line": 14, - "end_line": 17, - "metadata": { - "edge_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957", - "dst_ref": "ControlPlaneService.register_channel", - "resolution": "resolved", - "slice_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.register_channel" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "path": "src/app_runtime/control/service.py", - "title": "ControlPlaneService.__init__:dataflow_slice", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.start", - "start_line": 14, - "end_line": 20, - "metadata": { - "edge_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154", - "dst_ref": "ControlPlaneService.start", - "resolution": "resolved", - "slice_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.start" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "path": "src/app_runtime/control/service.py", - "title": "ControlPlaneService.__init__:dataflow_slice", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.stop", - "start_line": 14, - "end_line": 25, - "metadata": { - "edge_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d", - "dst_ref": "ControlPlaneService.stop", - "resolution": "resolved", - "slice_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.stop" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "path": "src/app_runtime/control/service.py", - "title": "ControlPlaneService.__init__:dataflow_slice", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._stop_async", - "start_line": 14, - "end_line": 51, - "metadata": { - "edge_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a", - "dst_ref": "ControlPlaneService._stop_async", - "resolution": "resolved", - "slice_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._stop_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "path": "src/app_runtime/control/service.py", - "title": "ControlPlaneService.start:calls", - "content": "ControlPlaneService.start calls asyncio.run", - "start_line": 22, - "end_line": 22, - "metadata": { - "edge_id": "4e0b3147fb867d48d26567570c259f4052a739e3098133802d4b8bafcf03be6b", - "edge_type": "calls", - "src_symbol_id": "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154", - "src_qname": "ControlPlaneService.start", - "dst_symbol_id": null, - "dst_ref": "asyncio.run", - "resolution": "partial", - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "path": "src/app_runtime/control/service.py", - "title": "ControlPlaneService.register_channel:reads_attr", - "content": "ControlPlaneService.register_channel reads_attr ControlPlaneService._channels", - "start_line": 17, - "end_line": 17, - "metadata": { - "edge_id": "3101fdc99a7a9c5aebf18a024bc148d37b348248a6fd02b95724dff280f2908a", - "edge_type": "reads_attr", - "src_symbol_id": "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957", - "src_qname": "ControlPlaneService.register_channel", - "dst_symbol_id": null, - "dst_ref": "ControlPlaneService._channels", - "resolution": "partial", - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "path": "src/app_runtime/control/service.py", - "title": "ControlPlaneService.start:reads_attr", - "content": "ControlPlaneService.start reads_attr ControlPlaneService._channels", - "start_line": 20, - "end_line": 20, - "metadata": { - "edge_id": "9452e50ef27d47c30ee1c311c48fe73ecddbf7a6dbcf967a6345e98222d9f71a", - "edge_type": "reads_attr", - "src_symbol_id": "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154", - "src_qname": "ControlPlaneService.start", - "dst_symbol_id": null, - "dst_ref": "ControlPlaneService._channels", - "resolution": "partial", - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C1_SYMBOL_CATALOG", - "path": "src/app_runtime/core/runtime.py", - "title": "ControlPlaneService", - "content": "const ControlPlaneService\nControlPlaneService = app_runtime.control.service.ControlPlaneService", - "start_line": 7, - "end_line": 7, - "metadata": { - "symbol_id": "3030804d119fa1d4b8a6c32616062a5e11080b03d33818c9280bcc5bdd8fd512", - "qname": "ControlPlaneService", - "kind": "const", - "signature": "ControlPlaneService = app_runtime.control.service.ControlPlaneService", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.core.runtime", - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C1_SYMBOL_CATALOG", - "path": "src/plba/control.py", - "title": "ControlPlaneService", - "content": "const ControlPlaneService\nControlPlaneService = app_runtime.control.service.ControlPlaneService", - "start_line": 3, - "end_line": 3, - "metadata": { - "symbol_id": "bd7f620031a049b8d791534536941ce75071029542395a7bb14817742827070a", - "qname": "ControlPlaneService", - "kind": "const", - "signature": "ControlPlaneService = app_runtime.control.service.ControlPlaneService", - "parent_symbol_id": null, - "package_or_module": "src.plba.control", - "is_test": false, - "blob_sha": "31bd5c4481bfa7fbca8fae56d4860a67e3953ca74474ac8439e1f39b685d7bc8", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C1_SYMBOL_CATALOG", - "path": "src/app_runtime/control/service.py", - "title": "ControlPlaneService", - "content": "class ControlPlaneService\nControlPlaneService", - "start_line": 12, - "end_line": 52, - "metadata": { - "symbol_id": "b13471e5916986dccffb53fab613812842965705e6b3a89ae549d30c9e91e9aa", - "qname": "ControlPlaneService", - "kind": "class", - "signature": "ControlPlaneService", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.control.service", - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C1_SYMBOL_CATALOG", - "path": "src/app_runtime/control/__init__.py", - "title": "ControlPlaneService", - "content": "const ControlPlaneService\nControlPlaneService = app_runtime.control.service.ControlPlaneService", - "start_line": 3, - "end_line": 3, - "metadata": { - "symbol_id": "217e8f044d1c01644bf7b81e5046af9e84469210c692a2fb0c476a19bb069ae1", - "qname": "ControlPlaneService", - "kind": "const", - "signature": "ControlPlaneService = app_runtime.control.service.ControlPlaneService", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.control.__init__", - "is_test": false, - "blob_sha": "bf3c37e3369a84cc618adc0fd71c232e5eb4b871eaff743069a17e661e498316", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C1_SYMBOL_CATALOG", - "path": "src/plba/__init__.py", - "title": "ControlPlaneService", - "content": "const ControlPlaneService\nControlPlaneService = plba.control.ControlPlaneService", - "start_line": 3, - "end_line": 3, - "metadata": { - "symbol_id": "90b154d49d544efb7c448e91bf5b75231578a6571b98c06a2a555fa5dcffb152", - "qname": "ControlPlaneService", - "kind": "const", - "signature": "ControlPlaneService = plba.control.ControlPlaneService", - "parent_symbol_id": null, - "package_or_module": "src.plba.__init__", - "is_test": false, - "blob_sha": "24e755ec8c249d14fb0e675b5dbf2b71ab91afb9c849897eebfa9feb2499e19d", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C1_SYMBOL_CATALOG", - "path": "src/app_runtime/control/__init__.py", - "title": "ControlChannel", - "content": "const ControlChannel\nControlChannel = app_runtime.control.base.ControlChannel", - "start_line": 1, - "end_line": 1, - "metadata": { - "symbol_id": "268420f7aa4ed74082b9276cae0cded4f00bac090ffd58fa020a65be0fe19c27", - "qname": "ControlChannel", - "kind": "const", - "signature": "ControlChannel = app_runtime.control.base.ControlChannel", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.control.__init__", - "is_test": false, - "blob_sha": "bf3c37e3369a84cc618adc0fd71c232e5eb4b871eaff743069a17e661e498316", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C0_SOURCE_CHUNKS", - "path": "src/app_runtime/control/base.py", - "title": "src/app_runtime/control/base.py:ControlChannel", - "content": "class ControlChannel(ABC):\n @abstractmethod\n async def start(self, actions: ControlActionSet) -> None:\n \"\"\"Start the control channel and bind handlers.\"\"\"\n\n @abstractmethod\n async def stop(self) -> None:\n \"\"\"Stop the control channel and release resources.\"\"\"", - "start_line": 21, - "end_line": 28, - "metadata": { - "chunk_index": 1, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.base", - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C0_SOURCE_CHUNKS", - "path": "src/app_runtime/control/__init__.py", - "title": "src/app_runtime/control/__init__.py:1-5", - "content": "from app_runtime.control.base import ControlActionSet, ControlChannel\nfrom app_runtime.control.http_channel import HttpControlChannel\nfrom app_runtime.control.service import ControlPlaneService\n\n__all__ = [\"ControlActionSet\", \"ControlChannel\", \"ControlPlaneService\", \"HttpControlChannel\"]", - "start_line": 1, - "end_line": 5, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.app_runtime.control.__init__", - "is_test": false, - "blob_sha": "bf3c37e3369a84cc618adc0fd71c232e5eb4b871eaff743069a17e661e498316", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C0_SOURCE_CHUNKS", - "path": "src/app_runtime/control/base.py", - "title": "src/app_runtime/control/base.py:ControlActionSet", - "content": "class ControlActionSet:\n health: HealthHandler\n start: ActionHandler\n stop: ActionHandler\n status: ActionHandler", - "start_line": 14, - "end_line": 18, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.base", - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C0_SOURCE_CHUNKS", - "path": "src/app_runtime/control/http_app.py", - "title": "src/app_runtime/control/http_app.py:HttpControlAppFactory", - "content": "class HttpControlAppFactory:\n def create(\n self,\n health_provider: Callable[[], Awaitable[HealthPayload]],\n action_provider: Callable[[str, str], Awaitable[JSONResponse]],\n ) -> FastAPI:\n app = FastAPI(title=\"PLBA Control API\")\n\n @app.middleware(\"http\")\n async def log_api_call(request: Request, call_next): # type: ignore[no-untyped-def]\n started = time.monotonic()\n response = await call_next(request)\n response.headers[\"X-Response-Time-Ms\"] = str(int((time.monotonic() - started) * 1000))\n return response\n\n @app.get(\"/health\")\n async def health() -> JSONResponse:\n payload = await health_provider()\n status_code = 200 if payload.get(\"status\") == \"ok\" else 503\n return JSONResponse(content=payload, status_code=status_code)\n\n @app.get(\"/actions/{action}\")\n @app.post(\"/actions/{action}\")\n async def action(action: str, request: Request) -> JSONResponse:\n client_source = self._client_source(request)\n if action in {\"start\", \"stop\"}:\n LOGGER.warning(\"Control action requested: /actions/%s client=%s\", action, client_source)\n return await action_provider(action, client_source)\n\n return app\n\n def _client_source(self, request: Request) -> str:\n explicit_header = request.headers.get(\"X-Client-Source\", \"\").strip()\n if explicit_header:\n return explicit_header\n user_agent = request.headers.get(\"User-Agent\", \"\").strip()\n if user_agent:\n return f\"user-agent:{user_agent}\"\n return \"unknown\"", - "start_line": 15, - "end_line": 53, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.http_app", - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "relations": [ - { - "path": "src/app_runtime/control/service.py", - "start_line": 14, - "end_line": 47, - "edge_type": "dataflow_slice", - "source": "ControlPlaneService.__init__", - "target": "ControlPlaneService._start_async", - "metadata": { - "edge_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517", - "dst_ref": "ControlPlaneService._start_async", - "resolution": "resolved", - "slice_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._start_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - }, - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._start_async" - }, - { - "path": "src/app_runtime/control/service.py", - "start_line": 14, - "end_line": 17, - "edge_type": "dataflow_slice", - "source": "ControlPlaneService.__init__", - "target": "ControlPlaneService.register_channel", - "metadata": { - "edge_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957", - "dst_ref": "ControlPlaneService.register_channel", - "resolution": "resolved", - "slice_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.register_channel" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - }, - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.register_channel" - }, - { - "path": "src/app_runtime/control/service.py", - "start_line": 14, - "end_line": 20, - "edge_type": "dataflow_slice", - "source": "ControlPlaneService.__init__", - "target": "ControlPlaneService.start", - "metadata": { - "edge_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154", - "dst_ref": "ControlPlaneService.start", - "resolution": "resolved", - "slice_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.start" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - }, - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.start" - }, - { - "path": "src/app_runtime/control/service.py", - "start_line": 14, - "end_line": 25, - "edge_type": "dataflow_slice", - "source": "ControlPlaneService.__init__", - "target": "ControlPlaneService.stop", - "metadata": { - "edge_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d", - "dst_ref": "ControlPlaneService.stop", - "resolution": "resolved", - "slice_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.stop" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - }, - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.stop" - }, - { - "path": "src/app_runtime/control/service.py", - "start_line": 14, - "end_line": 51, - "edge_type": "dataflow_slice", - "source": "ControlPlaneService.__init__", - "target": "ControlPlaneService._stop_async", - "metadata": { - "edge_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a", - "dst_ref": "ControlPlaneService._stop_async", - "resolution": "resolved", - "slice_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._stop_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - }, - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._stop_async" - }, - { - "path": "src/app_runtime/control/service.py", - "start_line": 22, - "end_line": 22, - "edge_type": "calls", - "source": "ControlPlaneService.start", - "target": "asyncio.run", - "metadata": { - "edge_id": "4e0b3147fb867d48d26567570c259f4052a739e3098133802d4b8bafcf03be6b", - "edge_type": "calls", - "src_symbol_id": "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154", - "src_qname": "ControlPlaneService.start", - "dst_symbol_id": null, - "dst_ref": "asyncio.run", - "resolution": "partial", - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - }, - "content": "ControlPlaneService.start calls asyncio.run" - }, - { - "path": "src/app_runtime/control/service.py", - "start_line": 17, - "end_line": 17, - "edge_type": "reads_attr", - "source": "ControlPlaneService.register_channel", - "target": "ControlPlaneService._channels", - "metadata": { - "edge_id": "3101fdc99a7a9c5aebf18a024bc148d37b348248a6fd02b95724dff280f2908a", - "edge_type": "reads_attr", - "src_symbol_id": "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957", - "src_qname": "ControlPlaneService.register_channel", - "dst_symbol_id": null, - "dst_ref": "ControlPlaneService._channels", - "resolution": "partial", - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - }, - "content": "ControlPlaneService.register_channel reads_attr ControlPlaneService._channels" - }, - { - "path": "src/app_runtime/control/service.py", - "start_line": 20, - "end_line": 20, - "edge_type": "reads_attr", - "source": "ControlPlaneService.start", - "target": "ControlPlaneService._channels", - "metadata": { - "edge_id": "9452e50ef27d47c30ee1c311c48fe73ecddbf7a6dbcf967a6345e98222d9f71a", - "edge_type": "reads_attr", - "src_symbol_id": "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154", - "src_qname": "ControlPlaneService.start", - "dst_symbol_id": null, - "dst_ref": "ControlPlaneService._channels", - "resolution": "partial", - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - }, - "content": "ControlPlaneService.start reads_attr ControlPlaneService._channels" - } - ], - "semantic_hints": [ - { - "path": "src/app_runtime/control/service.py", - "title": "ControlPlaneService", - "symbol": "ControlPlaneService", - "role": "pipeline_stage", - "confidence": 0.57, - "content": "ControlPlaneService\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests service\n- reads and writes state attributes\n- participates in dataflow slices (5)" - }, - { - "path": "src/app_runtime/control/base.py", - "title": "ControlActionSet", - "symbol": "ControlActionSet", - "role": "model", - "confidence": 0.99, - "content": "ControlActionSet\nrole: model\n\nResponsibilities:\n- default model role" - }, - { - "path": "src/app_runtime/control/base.py", - "title": "ControlChannel", - "symbol": "ControlChannel", - "role": "model", - "confidence": 0.99, - "content": "ControlChannel\nrole: model\n\nResponsibilities:\n- default model role" - }, - { - "path": "src/app_runtime/control/http_runner.py", - "title": "UvicornThreadRunner", - "symbol": "UvicornThreadRunner", - "role": "pipeline_stage", - "confidence": 0.99, - "content": "UvicornThreadRunner\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (24)" - }, - { - "path": "src/app_runtime/control/http_channel.py", - "title": "HttpControlChannel", - "symbol": "HttpControlChannel", - "role": "pipeline_stage", - "confidence": 0.99, - "content": "HttpControlChannel\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (10)" - }, - { - "path": "src/app_runtime/control/http_app.py", - "title": "HttpControlAppFactory", - "symbol": "HttpControlAppFactory", - "role": "factory", - "confidence": 0.99, - "content": "HttpControlAppFactory\nrole: factory\n\nResponsibilities:\n- name suffix suggests factory" - }, - { - "path": "src/app_runtime/workflow/persistence/workflow_persistence.py", - "title": "WorkflowPersistence", - "symbol": "WorkflowPersistence", - "role": "pipeline_stage", - "confidence": 0.99, - "content": "WorkflowPersistence\nrole: pipeline_stage\n\nResponsibilities:\n- orchestrates role-like calls (2)\n- reads and writes state attributes\n- participates in dataflow slices (16)" - }, - { - "path": "src/app_runtime/queue/in_memory.py", - "title": "InMemoryTaskQueue", - "symbol": "InMemoryTaskQueue", - "role": "pipeline_stage", - "confidence": 0.99, - "content": "InMemoryTaskQueue\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (9)" - }, - { - "path": "src/app_runtime/config/file_loader.py", - "title": "ConfigFileLoader", - "symbol": "ConfigFileLoader", - "role": "pipeline_stage", - "confidence": 0.99, - "content": "ConfigFileLoader\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (8)" - }, - { - "path": "src/app_runtime/tracing/store.py", - "title": "TraceContextStore", - "symbol": "TraceContextStore", - "role": "pipeline_stage", - "confidence": 0.99, - "content": "TraceContextStore\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (6)" - }, - { - "path": "src/app_runtime/workers/supervisor.py", - "title": "WorkerSupervisor", - "symbol": "WorkerSupervisor", - "role": "pipeline_stage", - "confidence": 0.99, - "content": "WorkerSupervisor\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (6)" - }, - { - "path": "src/app_runtime/workflow/engine/workflow_engine.py", - "title": "WorkflowEngine", - "symbol": "WorkflowEngine", - "role": "pipeline_stage", - "confidence": 0.99, - "content": "WorkflowEngine\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (6)" - } - ], - "entrypoints": [ - { - "path": "src/app_runtime/control/http_app.py", - "title": "app.get", - "start_line": 31, - "end_line": 34, - "http_method": "GET", - "route_path": "/health", - "handler_symbol": "health", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "route_or_command": "app.get", - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "title": "app.get", - "start_line": 38, - "end_line": 42, - "http_method": "GET", - "route_path": "/actions/{action}", - "handler_symbol": "action", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "route_or_command": "app.get", - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "title": "app.post", - "start_line": 38, - "end_line": 42, - "http_method": "POST", - "route_path": "/actions/{action}", - "handler_symbol": "action", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "route_or_command": "app.post", - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "test_candidates": [], - "layer_outcomes": [ - { - "layer_id": "C4_SEMANTIC_ROLES", - "hit_count": 12, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C3_ENTRYPOINTS", - "hit_count": 3, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C2_DEPENDENCY_GRAPH", - "hit_count": 8, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C1_SYMBOL_CATALOG", - "hit_count": 6, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C0_SOURCE_CHUNKS", - "hit_count": 4, - "empty": false, - "fallback_used": false - } - ], - "missing_layers": [], - "raw_rows": [ - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests service\n- reads and writes state attributes\n- participates in dataflow slices (5)", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlPlaneService", - "span_start": 12, - "span_end": 52, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 68, - "layer_rank": 2, - "distance": null, - "metadata": { - "symbol_id": "b13471e5916986dccffb53fab613812842965705e6b3a89ae549d30c9e91e9aa", - "symbol_name": "ControlPlaneService", - "qname": "ControlPlaneService", - "role": "pipeline_stage", - "confidence": 0.57, - "dataflow_participation": 5, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "ControlActionSet\nrole: model\n\nResponsibilities:\n- default model role", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlActionSet", - "span_start": 14, - "span_end": 18, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 40, - "layer_rank": 2, - "distance": null, - "metadata": { - "symbol_id": "46eb026cb3313415ec47b82dd22f84f4d112c9d987e8b1716dcb0baa1cce8988", - "symbol_name": "ControlActionSet", - "qname": "ControlActionSet", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "ControlChannel\nrole: model\n\nResponsibilities:\n- default model role", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlChannel", - "span_start": 21, - "span_end": 28, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 40, - "layer_rank": 2, - "distance": null, - "metadata": { - "symbol_id": "cfcfe9a311d3a2dbdaf32ac4ccd73c0eb9a117f830591a1c0867ee97d46204ff", - "symbol_name": "ControlChannel", - "qname": "ControlChannel", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_runner.py", - "content": "UvicornThreadRunner\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (24)", - "layer": "C4_SEMANTIC_ROLES", - "title": "UvicornThreadRunner", - "span_start": 10, - "span_end": 61, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 11, - "layer_rank": 2, - "distance": null, - "metadata": { - "symbol_id": "fd55630045a02100df8877ac27d951ee08617d4598764394d48cb51fe067476a", - "symbol_name": "UvicornThreadRunner", - "qname": "UvicornThreadRunner", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 24, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "3779fdd2878b770e789a35bb2a89c9d79f13b61c26d7db1b3b683f9bb9e1623f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (10)", - "layer": "C4_SEMANTIC_ROLES", - "title": "HttpControlChannel", - "span_start": 12, - "span_end": 57, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 21, - "layer_rank": 2, - "distance": null, - "metadata": { - "symbol_id": "1c9fbdc24819e5604c26ea55428a74310f03a03e1af197ed84846af61e42fdb0", - "symbol_name": "HttpControlChannel", - "qname": "HttpControlChannel", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 10, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "HttpControlAppFactory\nrole: factory\n\nResponsibilities:\n- name suffix suggests factory", - "layer": "C4_SEMANTIC_ROLES", - "title": "HttpControlAppFactory", - "span_start": 15, - "span_end": 53, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 39, - "layer_rank": 2, - "distance": null, - "metadata": { - "symbol_id": "9b3502a5fb408b273223db13264349cf500de24915b6c649d9ea8970d0dfd8e0", - "symbol_name": "HttpControlAppFactory", - "qname": "HttpControlAppFactory", - "role": "factory", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/persistence/workflow_persistence.py", - "content": "WorkflowPersistence\nrole: pipeline_stage\n\nResponsibilities:\n- orchestrates role-like calls (2)\n- reads and writes state attributes\n- participates in dataflow slices (16)", - "layer": "C4_SEMANTIC_ROLES", - "title": "WorkflowPersistence", - "span_start": 8, - "span_end": 54, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 15, - "layer_rank": 2, - "distance": null, - "metadata": { - "symbol_id": "7bd01ee45cf31f2d5c2e3e51656254860ac785d10cef9e0852cd4fba90857bae", - "symbol_name": "WorkflowPersistence", - "qname": "WorkflowPersistence", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 16, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "80e9410ddc639789b4353c2a1a757ba8d0d5b5bb6075b0b263b61551f04ae1f0", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/queue/in_memory.py", - "content": "InMemoryTaskQueue\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (9)", - "layer": "C4_SEMANTIC_ROLES", - "title": "InMemoryTaskQueue", - "span_start": 9, - "span_end": 38, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 22, - "layer_rank": 2, - "distance": null, - "metadata": { - "symbol_id": "2da04cb94544a3bcbf0943a95ad4bdd8710bcafaa32a02fd0e4de2178dcf3533", - "symbol_name": "InMemoryTaskQueue", - "qname": "InMemoryTaskQueue", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 9, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "58f0cc001ccda0eee4c6bc32ed83bd05eafd6b6644f1e8b4aa9eed3103db73dc", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/config/file_loader.py", - "content": "ConfigFileLoader\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (8)", - "layer": "C4_SEMANTIC_ROLES", - "title": "ConfigFileLoader", - "span_start": 11, - "span_end": 48, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 23, - "layer_rank": 2, - "distance": null, - "metadata": { - "symbol_id": "a8474eca8b6e9dc86ae67ed68b16fa5fb639ef08739c053e7b7195489765667f", - "symbol_name": "ConfigFileLoader", - "qname": "ConfigFileLoader", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 8, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "1f19ffebde5e38e4be5a5d5a678059a0f36dedb8fb8b3e00ab395c67106a87ea", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/store.py", - "content": "TraceContextStore\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (6)", - "layer": "C4_SEMANTIC_ROLES", - "title": "TraceContextStore", - "span_start": 15, - "span_end": 52, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 25, - "layer_rank": 2, - "distance": null, - "metadata": { - "symbol_id": "b2dad4fbe16ffb11b58deba311c7739955c39d59f291b22181f33e9c8cce4059", - "symbol_name": "TraceContextStore", - "qname": "TraceContextStore", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 6, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "d369554f08fc92039c6edd5a2a1e73b23901533e8974459170bbd9347d263dc5", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workers/supervisor.py", - "content": "WorkerSupervisor\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (6)", - "layer": "C4_SEMANTIC_ROLES", - "title": "WorkerSupervisor", - "span_start": 10, - "span_end": 59, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 25, - "layer_rank": 2, - "distance": null, - "metadata": { - "symbol_id": "c17b44e8d9e97d490989b21fa67d7c346cdda8a0472e4c41fb243c8846faa124", - "symbol_name": "WorkerSupervisor", - "qname": "WorkerSupervisor", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 6, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "77609d9d5927171cce7fc3a54897c183fd63068710c6362029b700937aae5eee", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/engine/workflow_engine.py", - "content": "WorkflowEngine\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (6)", - "layer": "C4_SEMANTIC_ROLES", - "title": "WorkflowEngine", - "span_start": 10, - "span_end": 86, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 25, - "layer_rank": 2, - "distance": null, - "metadata": { - "symbol_id": "57ec0a9f11c542c78e008684a888397e8d9ef4223671acb2567e631a0cbc70b4", - "symbol_name": "WorkflowEngine", - "qname": "WorkflowEngine", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 6, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "1057136e58a325cd5ab6f4e265d15665fb6a711b7022d9fab52a1a290afa2368", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": null, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": null, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": null, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._start_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 47, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": null, - "metadata": { - "edge_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517", - "dst_ref": "ControlPlaneService._start_async", - "resolution": "resolved", - "slice_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._start_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.register_channel", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 17, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": null, - "metadata": { - "edge_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957", - "dst_ref": "ControlPlaneService.register_channel", - "resolution": "resolved", - "slice_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.register_channel" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.start", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 20, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": null, - "metadata": { - "edge_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154", - "dst_ref": "ControlPlaneService.start", - "resolution": "resolved", - "slice_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.start" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.stop", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 25, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": null, - "metadata": { - "edge_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d", - "dst_ref": "ControlPlaneService.stop", - "resolution": "resolved", - "slice_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.stop" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._stop_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 51, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": null, - "metadata": { - "edge_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a", - "dst_ref": "ControlPlaneService._stop_async", - "resolution": "resolved", - "slice_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._stop_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.start calls asyncio.run", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.start:calls", - "span_start": 22, - "span_end": 22, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": null, - "metadata": { - "edge_id": "4e0b3147fb867d48d26567570c259f4052a739e3098133802d4b8bafcf03be6b", - "edge_type": "calls", - "src_symbol_id": "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154", - "src_qname": "ControlPlaneService.start", - "dst_symbol_id": null, - "dst_ref": "asyncio.run", - "resolution": "partial", - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.register_channel reads_attr ControlPlaneService._channels", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.register_channel:reads_attr", - "span_start": 17, - "span_end": 17, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": null, - "metadata": { - "edge_id": "3101fdc99a7a9c5aebf18a024bc148d37b348248a6fd02b95724dff280f2908a", - "edge_type": "reads_attr", - "src_symbol_id": "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957", - "src_qname": "ControlPlaneService.register_channel", - "dst_symbol_id": null, - "dst_ref": "ControlPlaneService._channels", - "resolution": "partial", - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.start reads_attr ControlPlaneService._channels", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.start:reads_attr", - "span_start": 20, - "span_end": 20, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": null, - "metadata": { - "edge_id": "9452e50ef27d47c30ee1c311c48fe73ecddbf7a6dbcf967a6345e98222d9f71a", - "edge_type": "reads_attr", - "src_symbol_id": "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154", - "src_qname": "ControlPlaneService.start", - "dst_symbol_id": null, - "dst_ref": "ControlPlaneService._channels", - "resolution": "partial", - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "const ControlPlaneService\nControlPlaneService = app_runtime.control.service.ControlPlaneService", - "layer": "C1_SYMBOL_CATALOG", - "title": "ControlPlaneService", - "span_start": 7, - "span_end": 7, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": null, - "metadata": { - "symbol_id": "3030804d119fa1d4b8a6c32616062a5e11080b03d33818c9280bcc5bdd8fd512", - "qname": "ControlPlaneService", - "kind": "const", - "signature": "ControlPlaneService = app_runtime.control.service.ControlPlaneService", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.core.runtime", - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/control.py", - "content": "const ControlPlaneService\nControlPlaneService = app_runtime.control.service.ControlPlaneService", - "layer": "C1_SYMBOL_CATALOG", - "title": "ControlPlaneService", - "span_start": 3, - "span_end": 3, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": null, - "metadata": { - "symbol_id": "bd7f620031a049b8d791534536941ce75071029542395a7bb14817742827070a", - "qname": "ControlPlaneService", - "kind": "const", - "signature": "ControlPlaneService = app_runtime.control.service.ControlPlaneService", - "parent_symbol_id": null, - "package_or_module": "src.plba.control", - "is_test": false, - "blob_sha": "31bd5c4481bfa7fbca8fae56d4860a67e3953ca74474ac8439e1f39b685d7bc8", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "class ControlPlaneService\nControlPlaneService", - "layer": "C1_SYMBOL_CATALOG", - "title": "ControlPlaneService", - "span_start": 12, - "span_end": 52, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": null, - "metadata": { - "symbol_id": "b13471e5916986dccffb53fab613812842965705e6b3a89ae549d30c9e91e9aa", - "qname": "ControlPlaneService", - "kind": "class", - "signature": "ControlPlaneService", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.control.service", - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/__init__.py", - "content": "const ControlPlaneService\nControlPlaneService = app_runtime.control.service.ControlPlaneService", - "layer": "C1_SYMBOL_CATALOG", - "title": "ControlPlaneService", - "span_start": 3, - "span_end": 3, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": null, - "metadata": { - "symbol_id": "217e8f044d1c01644bf7b81e5046af9e84469210c692a2fb0c476a19bb069ae1", - "qname": "ControlPlaneService", - "kind": "const", - "signature": "ControlPlaneService = app_runtime.control.service.ControlPlaneService", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.control.__init__", - "is_test": false, - "blob_sha": "bf3c37e3369a84cc618adc0fd71c232e5eb4b871eaff743069a17e661e498316", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/__init__.py", - "content": "const ControlPlaneService\nControlPlaneService = plba.control.ControlPlaneService", - "layer": "C1_SYMBOL_CATALOG", - "title": "ControlPlaneService", - "span_start": 3, - "span_end": 3, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": null, - "metadata": { - "symbol_id": "90b154d49d544efb7c448e91bf5b75231578a6571b98c06a2a555fa5dcffb152", - "qname": "ControlPlaneService", - "kind": "const", - "signature": "ControlPlaneService = plba.control.ControlPlaneService", - "parent_symbol_id": null, - "package_or_module": "src.plba.__init__", - "is_test": false, - "blob_sha": "24e755ec8c249d14fb0e675b5dbf2b71ab91afb9c849897eebfa9feb2499e19d", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/__init__.py", - "content": "const ControlChannel\nControlChannel = app_runtime.control.base.ControlChannel", - "layer": "C1_SYMBOL_CATALOG", - "title": "ControlChannel", - "span_start": 1, - "span_end": 1, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": null, - "metadata": { - "symbol_id": "268420f7aa4ed74082b9276cae0cded4f00bac090ffd58fa020a65be0fe19c27", - "qname": "ControlChannel", - "kind": "const", - "signature": "ControlChannel = app_runtime.control.base.ControlChannel", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.control.__init__", - "is_test": false, - "blob_sha": "bf3c37e3369a84cc618adc0fd71c232e5eb4b871eaff743069a17e661e498316", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "class ControlChannel(ABC):\n @abstractmethod\n async def start(self, actions: ControlActionSet) -> None:\n \"\"\"Start the control channel and bind handlers.\"\"\"\n\n @abstractmethod\n async def stop(self) -> None:\n \"\"\"Stop the control channel and release resources.\"\"\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/base.py:ControlChannel", - "span_start": 21, - "span_end": 28, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": null, - "metadata": { - "chunk_index": 1, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.base", - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/__init__.py", - "content": "from app_runtime.control.base import ControlActionSet, ControlChannel\nfrom app_runtime.control.http_channel import HttpControlChannel\nfrom app_runtime.control.service import ControlPlaneService\n\n__all__ = [\"ControlActionSet\", \"ControlChannel\", \"ControlPlaneService\", \"HttpControlChannel\"]", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/__init__.py:1-5", - "span_start": 1, - "span_end": 5, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": null, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.app_runtime.control.__init__", - "is_test": false, - "blob_sha": "bf3c37e3369a84cc618adc0fd71c232e5eb4b871eaff743069a17e661e498316", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "class ControlActionSet:\n health: HealthHandler\n start: ActionHandler\n stop: ActionHandler\n status: ActionHandler", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/base.py:ControlActionSet", - "span_start": 14, - "span_end": 18, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": null, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.base", - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "class HttpControlAppFactory:\n def create(\n self,\n health_provider: Callable[[], Awaitable[HealthPayload]],\n action_provider: Callable[[str, str], Awaitable[JSONResponse]],\n ) -> FastAPI:\n app = FastAPI(title=\"PLBA Control API\")\n\n @app.middleware(\"http\")\n async def log_api_call(request: Request, call_next): # type: ignore[no-untyped-def]\n started = time.monotonic()\n response = await call_next(request)\n response.headers[\"X-Response-Time-Ms\"] = str(int((time.monotonic() - started) * 1000))\n return response\n\n @app.get(\"/health\")\n async def health() -> JSONResponse:\n payload = await health_provider()\n status_code = 200 if payload.get(\"status\") == \"ok\" else 503\n return JSONResponse(content=payload, status_code=status_code)\n\n @app.get(\"/actions/{action}\")\n @app.post(\"/actions/{action}\")\n async def action(action: str, request: Request) -> JSONResponse:\n client_source = self._client_source(request)\n if action in {\"start\", \"stop\"}:\n LOGGER.warning(\"Control action requested: /actions/%s client=%s\", action, client_source)\n return await action_provider(action, client_source)\n\n return app\n\n def _client_source(self, request: Request) -> str:\n explicit_header = request.headers.get(\"X-Client-Source\", \"\").strip()\n if explicit_header:\n return explicit_header\n user_agent = request.headers.get(\"User-Agent\", \"\").strip()\n if user_agent:\n return f\"user-agent:{user_agent}\"\n return \"unknown\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/http_app.py:HttpControlAppFactory", - "span_start": 15, - "span_end": 53, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": null, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.http_app", - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "retrieval_report": { - "executed_layers": [ - "C4_SEMANTIC_ROLES", - "C3_ENTRYPOINTS", - "C2_DEPENDENCY_GRAPH", - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS" - ], - "retrieval_mode_by_layer": { - "C4_SEMANTIC_ROLES": "vector", - "C3_ENTRYPOINTS": "vector", - "C2_DEPENDENCY_GRAPH": "vector", - "C1_SYMBOL_CATALOG": "vector", - "C0_SOURCE_CHUNKS": "vector" - }, - "top_k_by_layer": { - "C4_SEMANTIC_ROLES": 12, - "C3_ENTRYPOINTS": 8, - "C2_DEPENDENCY_GRAPH": 8, - "C1_SYMBOL_CATALOG": 6, - "C0_SOURCE_CHUNKS": 4 - }, - "filters_by_layer": { - "C4_SEMANTIC_ROLES": { - "path_scope": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [] - }, - "C1_SYMBOL_CATALOG": { - "path_scope": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [] - } - }, - "fallback": { - "used": false, - "reason": null - }, - "retrieval_by_layer_ms": { - "C4_SEMANTIC_ROLES": 81, - "C3_ENTRYPOINTS": 20, - "C2_DEPENDENCY_GRAPH": 60, - "C1_SYMBOL_CATALOG": 33, - "C0_SOURCE_CHUNKS": 37 - } - } - }, - "diagnostics": { - "intent_correct": null, - "target_found": true, - "layers_used": [ - "C4_SEMANTIC_ROLES", - "C3_ENTRYPOINTS", - "C2_DEPENDENCY_GRAPH", - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS" - ], - "retrieval_sufficient": true, - "answer_mode": "normal", - "resolved_target": "ControlPlaneService", - "answer_policy_branch": "normal_answer", - "decision_reason": "evidence_sufficient", - "router_result": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "retrieval_profile": "code", - "sub_intent": "ARCHITECTURE", - "path_scope": [], - "layers": [ - "C4_SEMANTIC_ROLES", - "C3_ENTRYPOINTS", - "C2_DEPENDENCY_GRAPH", - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS" - ], - "symbol_resolution_status": "resolved" - }, - "retrieval_request": { - "rag_session_id": "7d11da21-faa0-4cea-aede-aeabe069164c", - "query": "Какие компоненты участвуют в ControlPlaneService?", - "sub_intent": "ARCHITECTURE", - "path_scope": [], - "requested_layers": [ - "C4_SEMANTIC_ROLES", - "C3_ENTRYPOINTS", - "C2_DEPENDENCY_GRAPH", - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS" - ] - }, - "per_layer_outcome": [ - { - "layer_id": "C4_SEMANTIC_ROLES", - "hit_count": 12, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C3_ENTRYPOINTS", - "hit_count": 3, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C2_DEPENDENCY_GRAPH", - "hit_count": 8, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C1_SYMBOL_CATALOG", - "hit_count": 6, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C0_SOURCE_CHUNKS", - "hit_count": 4, - "empty": false, - "fallback_used": false - } - ], - "empty_layers": [], - "evidence_gate_decision": { - "sufficient": true, - "failure_reasons": [], - "evidence_count": 33 - }, - "evidence_gate_input": { - "resolved_target": "ControlPlaneService", - "sub_intent": "ARCHITECTURE", - "target_type": "symbol", - "evidence_count": 33, - "code_chunk_count": 33, - "entrypoint_count": 3, - "relation_count": 8, - "test_evidence_count": 0, - "symbol_resolution_status": "resolved", - "path_scope": [] - }, - "post_evidence_gate": { - "input": { - "answer_mode": "normal", - "degraded_message": "", - "resolved_target": "ControlPlaneService", - "draft_answer_preview": "**ControlPlaneService** — центральный компонент, отвечающий за инициализацию, запуск и остановку контролируемых каналов.\n\nОсновные компоненты:\n- **ControlPlaneService**: главный класс сервиса управления каналами контроля.\n- **ControlPlaneService.__init__**: метод инициализации, выполняющий dataflow_", - "repair_candidate": true - }, - "output": { - "passed": true, - "action": "return", - "reasons": [], - "repair_used": true, - "final_answer_preview": "**ControlPlaneService** является главным компонентом, управляющим жизненным циклом контролируемых каналов.\n\nКомпоненты:\n- **ControlPlaneService**\n- **ControlPlaneService.__init__**: инициализирует сервис, регистрирует каналы и запускает асинхронные операции.\n- **ControlPlaneService.start**: начинает" - } - }, - "failure_reasons": [], - "timings_ms": { - "router": 1, - "retrieval": 233, - "pre_evidence_gate": 1, - "llm": 6272, - "post_evidence_gate": 1, - "repair": 5760, - "post_evidence_gate_recheck": 1 - } - }, - "rag_rows": [ - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests service\n- reads and writes state attributes\n- participates in dataflow slices (5)", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlPlaneService", - "span_start": 12, - "span_end": 52, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 68, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "b13471e5916986dccffb53fab613812842965705e6b3a89ae549d30c9e91e9aa", - "symbol_name": "ControlPlaneService", - "qname": "ControlPlaneService", - "role": "pipeline_stage", - "confidence": 0.57, - "dataflow_participation": 5, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "ControlActionSet\nrole: model\n\nResponsibilities:\n- default model role", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlActionSet", - "span_start": 14, - "span_end": 18, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 40, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "46eb026cb3313415ec47b82dd22f84f4d112c9d987e8b1716dcb0baa1cce8988", - "symbol_name": "ControlActionSet", - "qname": "ControlActionSet", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "ControlChannel\nrole: model\n\nResponsibilities:\n- default model role", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlChannel", - "span_start": 21, - "span_end": 28, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 40, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "cfcfe9a311d3a2dbdaf32ac4ccd73c0eb9a117f830591a1c0867ee97d46204ff", - "symbol_name": "ControlChannel", - "qname": "ControlChannel", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_runner.py", - "content": "UvicornThreadRunner\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (24)", - "layer": "C4_SEMANTIC_ROLES", - "title": "UvicornThreadRunner", - "span_start": 10, - "span_end": 61, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 11, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "fd55630045a02100df8877ac27d951ee08617d4598764394d48cb51fe067476a", - "symbol_name": "UvicornThreadRunner", - "qname": "UvicornThreadRunner", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 24, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "3779fdd2878b770e789a35bb2a89c9d79f13b61c26d7db1b3b683f9bb9e1623f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (10)", - "layer": "C4_SEMANTIC_ROLES", - "title": "HttpControlChannel", - "span_start": 12, - "span_end": 57, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 21, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "1c9fbdc24819e5604c26ea55428a74310f03a03e1af197ed84846af61e42fdb0", - "symbol_name": "HttpControlChannel", - "qname": "HttpControlChannel", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 10, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "HttpControlAppFactory\nrole: factory\n\nResponsibilities:\n- name suffix suggests factory", - "layer": "C4_SEMANTIC_ROLES", - "title": "HttpControlAppFactory", - "span_start": 15, - "span_end": 53, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 39, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "9b3502a5fb408b273223db13264349cf500de24915b6c649d9ea8970d0dfd8e0", - "symbol_name": "HttpControlAppFactory", - "qname": "HttpControlAppFactory", - "role": "factory", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/persistence/workflow_persistence.py", - "content": "WorkflowPersistence\nrole: pipeline_stage\n\nResponsibilities:\n- orchestrates role-like calls (2)\n- reads and writes state attributes\n- participates in dataflow slices (16)", - "layer": "C4_SEMANTIC_ROLES", - "title": "WorkflowPersistence", - "span_start": 8, - "span_end": 54, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 15, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "7bd01ee45cf31f2d5c2e3e51656254860ac785d10cef9e0852cd4fba90857bae", - "symbol_name": "WorkflowPersistence", - "qname": "WorkflowPersistence", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 16, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "80e9410ddc639789b4353c2a1a757ba8d0d5b5bb6075b0b263b61551f04ae1f0", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/queue/in_memory.py", - "content": "InMemoryTaskQueue\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (9)", - "layer": "C4_SEMANTIC_ROLES", - "title": "InMemoryTaskQueue", - "span_start": 9, - "span_end": 38, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 22, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "2da04cb94544a3bcbf0943a95ad4bdd8710bcafaa32a02fd0e4de2178dcf3533", - "symbol_name": "InMemoryTaskQueue", - "qname": "InMemoryTaskQueue", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 9, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "58f0cc001ccda0eee4c6bc32ed83bd05eafd6b6644f1e8b4aa9eed3103db73dc", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/config/file_loader.py", - "content": "ConfigFileLoader\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (8)", - "layer": "C4_SEMANTIC_ROLES", - "title": "ConfigFileLoader", - "span_start": 11, - "span_end": 48, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 23, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "a8474eca8b6e9dc86ae67ed68b16fa5fb639ef08739c053e7b7195489765667f", - "symbol_name": "ConfigFileLoader", - "qname": "ConfigFileLoader", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 8, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "1f19ffebde5e38e4be5a5d5a678059a0f36dedb8fb8b3e00ab395c67106a87ea", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/store.py", - "content": "TraceContextStore\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (6)", - "layer": "C4_SEMANTIC_ROLES", - "title": "TraceContextStore", - "span_start": 15, - "span_end": 52, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 25, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "b2dad4fbe16ffb11b58deba311c7739955c39d59f291b22181f33e9c8cce4059", - "symbol_name": "TraceContextStore", - "qname": "TraceContextStore", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 6, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "d369554f08fc92039c6edd5a2a1e73b23901533e8974459170bbd9347d263dc5", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workers/supervisor.py", - "content": "WorkerSupervisor\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (6)", - "layer": "C4_SEMANTIC_ROLES", - "title": "WorkerSupervisor", - "span_start": 10, - "span_end": 59, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 25, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "c17b44e8d9e97d490989b21fa67d7c346cdda8a0472e4c41fb243c8846faa124", - "symbol_name": "WorkerSupervisor", - "qname": "WorkerSupervisor", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 6, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "77609d9d5927171cce7fc3a54897c183fd63068710c6362029b700937aae5eee", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/engine/workflow_engine.py", - "content": "WorkflowEngine\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (6)", - "layer": "C4_SEMANTIC_ROLES", - "title": "WorkflowEngine", - "span_start": 10, - "span_end": 86, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 25, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "57ec0a9f11c542c78e008684a888397e8d9ef4223671acb2567e631a0cbc70b4", - "symbol_name": "WorkflowEngine", - "qname": "WorkflowEngine", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 6, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "1057136e58a325cd5ab6f4e265d15665fb6a711b7022d9fab52a1a290afa2368", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._start_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 47, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517", - "dst_ref": "ControlPlaneService._start_async", - "resolution": "resolved", - "slice_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._start_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.register_channel", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 17, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957", - "dst_ref": "ControlPlaneService.register_channel", - "resolution": "resolved", - "slice_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.register_channel" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.start", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 20, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154", - "dst_ref": "ControlPlaneService.start", - "resolution": "resolved", - "slice_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.start" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.stop", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 25, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d", - "dst_ref": "ControlPlaneService.stop", - "resolution": "resolved", - "slice_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.stop" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._stop_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 51, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a", - "dst_ref": "ControlPlaneService._stop_async", - "resolution": "resolved", - "slice_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._stop_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.start calls asyncio.run", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.start:calls", - "span_start": 22, - "span_end": 22, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "4e0b3147fb867d48d26567570c259f4052a739e3098133802d4b8bafcf03be6b", - "edge_type": "calls", - "src_symbol_id": "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154", - "src_qname": "ControlPlaneService.start", - "dst_symbol_id": null, - "dst_ref": "asyncio.run", - "resolution": "partial", - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.register_channel reads_attr ControlPlaneService._channels", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.register_channel:reads_attr", - "span_start": 17, - "span_end": 17, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "3101fdc99a7a9c5aebf18a024bc148d37b348248a6fd02b95724dff280f2908a", - "edge_type": "reads_attr", - "src_symbol_id": "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957", - "src_qname": "ControlPlaneService.register_channel", - "dst_symbol_id": null, - "dst_ref": "ControlPlaneService._channels", - "resolution": "partial", - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.start reads_attr ControlPlaneService._channels", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.start:reads_attr", - "span_start": 20, - "span_end": 20, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "9452e50ef27d47c30ee1c311c48fe73ecddbf7a6dbcf967a6345e98222d9f71a", - "edge_type": "reads_attr", - "src_symbol_id": "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154", - "src_qname": "ControlPlaneService.start", - "dst_symbol_id": null, - "dst_ref": "ControlPlaneService._channels", - "resolution": "partial", - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "const ControlPlaneService\nControlPlaneService = app_runtime.control.service.ControlPlaneService", - "layer": "C1_SYMBOL_CATALOG", - "title": "ControlPlaneService", - "span_start": 7, - "span_end": 7, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "3030804d119fa1d4b8a6c32616062a5e11080b03d33818c9280bcc5bdd8fd512", - "qname": "ControlPlaneService", - "kind": "const", - "signature": "ControlPlaneService = app_runtime.control.service.ControlPlaneService", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.core.runtime", - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/control.py", - "content": "const ControlPlaneService\nControlPlaneService = app_runtime.control.service.ControlPlaneService", - "layer": "C1_SYMBOL_CATALOG", - "title": "ControlPlaneService", - "span_start": 3, - "span_end": 3, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "bd7f620031a049b8d791534536941ce75071029542395a7bb14817742827070a", - "qname": "ControlPlaneService", - "kind": "const", - "signature": "ControlPlaneService = app_runtime.control.service.ControlPlaneService", - "parent_symbol_id": null, - "package_or_module": "src.plba.control", - "is_test": false, - "blob_sha": "31bd5c4481bfa7fbca8fae56d4860a67e3953ca74474ac8439e1f39b685d7bc8", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "class ControlPlaneService\nControlPlaneService", - "layer": "C1_SYMBOL_CATALOG", - "title": "ControlPlaneService", - "span_start": 12, - "span_end": 52, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "b13471e5916986dccffb53fab613812842965705e6b3a89ae549d30c9e91e9aa", - "qname": "ControlPlaneService", - "kind": "class", - "signature": "ControlPlaneService", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.control.service", - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/__init__.py", - "content": "const ControlPlaneService\nControlPlaneService = app_runtime.control.service.ControlPlaneService", - "layer": "C1_SYMBOL_CATALOG", - "title": "ControlPlaneService", - "span_start": 3, - "span_end": 3, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "217e8f044d1c01644bf7b81e5046af9e84469210c692a2fb0c476a19bb069ae1", - "qname": "ControlPlaneService", - "kind": "const", - "signature": "ControlPlaneService = app_runtime.control.service.ControlPlaneService", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.control.__init__", - "is_test": false, - "blob_sha": "bf3c37e3369a84cc618adc0fd71c232e5eb4b871eaff743069a17e661e498316", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/__init__.py", - "content": "const ControlPlaneService\nControlPlaneService = plba.control.ControlPlaneService", - "layer": "C1_SYMBOL_CATALOG", - "title": "ControlPlaneService", - "span_start": 3, - "span_end": 3, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "90b154d49d544efb7c448e91bf5b75231578a6571b98c06a2a555fa5dcffb152", - "qname": "ControlPlaneService", - "kind": "const", - "signature": "ControlPlaneService = plba.control.ControlPlaneService", - "parent_symbol_id": null, - "package_or_module": "src.plba.__init__", - "is_test": false, - "blob_sha": "24e755ec8c249d14fb0e675b5dbf2b71ab91afb9c849897eebfa9feb2499e19d", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/__init__.py", - "content": "const ControlChannel\nControlChannel = app_runtime.control.base.ControlChannel", - "layer": "C1_SYMBOL_CATALOG", - "title": "ControlChannel", - "span_start": 1, - "span_end": 1, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "268420f7aa4ed74082b9276cae0cded4f00bac090ffd58fa020a65be0fe19c27", - "qname": "ControlChannel", - "kind": "const", - "signature": "ControlChannel = app_runtime.control.base.ControlChannel", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.control.__init__", - "is_test": false, - "blob_sha": "bf3c37e3369a84cc618adc0fd71c232e5eb4b871eaff743069a17e661e498316", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "class ControlChannel(ABC):\n @abstractmethod\n async def start(self, actions: ControlActionSet) -> None:\n \"\"\"Start the control channel and bind handlers.\"\"\"\n\n @abstractmethod\n async def stop(self) -> None:\n \"\"\"Stop the control channel and release resources.\"\"\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/base.py:ControlChannel", - "span_start": 21, - "span_end": 28, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 1, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.base", - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/__init__.py", - "content": "from app_runtime.control.base import ControlActionSet, ControlChannel\nfrom app_runtime.control.http_channel import HttpControlChannel\nfrom app_runtime.control.service import ControlPlaneService\n\n__all__ = [\"ControlActionSet\", \"ControlChannel\", \"ControlPlaneService\", \"HttpControlChannel\"]", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/__init__.py:1-5", - "span_start": 1, - "span_end": 5, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.app_runtime.control.__init__", - "is_test": false, - "blob_sha": "bf3c37e3369a84cc618adc0fd71c232e5eb4b871eaff743069a17e661e498316", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "class ControlActionSet:\n health: HealthHandler\n start: ActionHandler\n stop: ActionHandler\n status: ActionHandler", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/base.py:ControlActionSet", - "span_start": 14, - "span_end": 18, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.base", - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "class HttpControlAppFactory:\n def create(\n self,\n health_provider: Callable[[], Awaitable[HealthPayload]],\n action_provider: Callable[[str, str], Awaitable[JSONResponse]],\n ) -> FastAPI:\n app = FastAPI(title=\"PLBA Control API\")\n\n @app.middleware(\"http\")\n async def log_api_call(request: Request, call_next): # type: ignore[no-untyped-def]\n started = time.monotonic()\n response = await call_next(request)\n response.headers[\"X-Response-Time-Ms\"] = str(int((time.monotonic() - started) * 1000))\n return response\n\n @app.get(\"/health\")\n async def health() -> JSONResponse:\n payload = await health_provider()\n status_code = 200 if payload.get(\"status\") == \"ok\" else 503\n return JSONResponse(content=payload, status_code=status_code)\n\n @app.get(\"/actions/{action}\")\n @app.post(\"/actions/{action}\")\n async def action(action: str, request: Request) -> JSONResponse:\n client_source = self._client_source(request)\n if action in {\"start\", \"stop\"}:\n LOGGER.warning(\"Control action requested: /actions/%s client=%s\", action, client_source)\n return await action_provider(action, client_source)\n\n return app\n\n def _client_source(self, request: Request) -> str:\n explicit_header = request.headers.get(\"X-Client-Source\", \"\").strip()\n if explicit_header:\n return explicit_header\n user_agent = request.headers.get(\"User-Agent\", \"\").strip()\n if user_agent:\n return f\"user-agent:{user_agent}\"\n return \"unknown\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/http_app.py:HttpControlAppFactory", - "span_start": 15, - "span_end": 53, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.http_app", - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "validation": { - "passed": true, - "action": "return", - "reasons": [] - }, - "steps": [ - { - "step": "router", - "status": "completed", - "timings_ms": { - "router": 1 - }, - "output": { - "intent": "CODE_QA", - "sub_intent": "ARCHITECTURE", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - } - }, - { - "step": "retrieval", - "status": "completed", - "timings_ms": { - "retrieval": 233 - }, - "output": { - "rag_count": 33, - "answer_path_rag_count": 33, - "resolved_symbol_status": "resolved", - "resolved_symbol": "ControlPlaneService", - "requested_layers": [ - "C4_SEMANTIC_ROLES", - "C3_ENTRYPOINTS", - "C2_DEPENDENCY_GRAPH", - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS" - ] - }, - "diagnostics": { - "executed_layers": [ - "C4_SEMANTIC_ROLES", - "C3_ENTRYPOINTS", - "C2_DEPENDENCY_GRAPH", - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS" - ], - "retrieval_mode_by_layer": { - "C4_SEMANTIC_ROLES": "vector", - "C3_ENTRYPOINTS": "vector", - "C2_DEPENDENCY_GRAPH": "vector", - "C1_SYMBOL_CATALOG": "vector", - "C0_SOURCE_CHUNKS": "vector" - }, - "top_k_by_layer": { - "C4_SEMANTIC_ROLES": 12, - "C3_ENTRYPOINTS": 8, - "C2_DEPENDENCY_GRAPH": 8, - "C1_SYMBOL_CATALOG": 6, - "C0_SOURCE_CHUNKS": 4 - }, - "filters_by_layer": { - "C4_SEMANTIC_ROLES": { - "path_scope": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [] - }, - "C1_SYMBOL_CATALOG": { - "path_scope": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [] - } - }, - "fallback": { - "used": false, - "reason": null - }, - "retrieval_by_layer_ms": { - "C4_SEMANTIC_ROLES": 81, - "C3_ENTRYPOINTS": 20, - "C2_DEPENDENCY_GRAPH": 60, - "C1_SYMBOL_CATALOG": 33, - "C0_SOURCE_CHUNKS": 37 - } - } - }, - { - "step": "pre_evidence_gate", - "status": "passed", - "timings_ms": { - "pre_evidence_gate": 1 - }, - "input": { - "resolved_target": "ControlPlaneService", - "sub_intent": "ARCHITECTURE", - "target_type": "symbol", - "evidence_count": 33, - "code_chunk_count": 33, - "entrypoint_count": 3, - "relation_count": 8, - "test_evidence_count": 0, - "symbol_resolution_status": "resolved", - "path_scope": [] - }, - "output": { - "passed": true, - "failure_reasons": [], - "degraded_message": "", - "evidence_count": 33 - } - }, - { - "step": "llm", - "status": "completed", - "timings_ms": { - "llm": 6272 - }, - "output": { - "prompt_name": "code_qa_architecture_answer", - "answer_preview": "**ControlPlaneService** — центральный компонент, отвечающий за инициализацию, запуск и остановку контролируемых каналов.\n\nОсновные компоненты:\n- **ControlPlaneService**: главный класс сервиса управления каналами контроля.\n- **ControlPlaneService.__init__**: метод инициализации, выполняющий dataflow_", - "resolved_target": "ControlPlaneService", - "answer_policy_branch": "normal_answer", - "decision_reason": "evidence_sufficient" - } - }, - { - "step": "post_evidence_gate", - "status": "passed", - "timings_ms": { - "post_evidence_gate": 1, - "post_evidence_gate_recheck": 1, - "repair": 5760 - }, - "input": { - "answer_mode": "normal", - "degraded_message": "", - "resolved_target": "ControlPlaneService", - "draft_answer_preview": "**ControlPlaneService** — центральный компонент, отвечающий за инициализацию, запуск и остановку контролируемых каналов.\n\nОсновные компоненты:\n- **ControlPlaneService**: главный класс сервиса управления каналами контроля.\n- **ControlPlaneService.__init__**: метод инициализации, выполняющий dataflow_", - "repair_candidate": true - }, - "output": { - "passed": true, - "action": "return", - "reasons": [], - "repair_used": true, - "final_answer_preview": "**ControlPlaneService** является главным компонентом, управляющим жизненным циклом контролируемых каналов.\n\nКомпоненты:\n- **ControlPlaneService**\n- **ControlPlaneService.__init__**: инициализирует сервис, регистрирует каналы и запускает асинхронные операции.\n- **ControlPlaneService.start**: начинает" - } - } - ] - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/plba_full_chain_subintents_v3/20260312_192715/full_chain_plba_code_subintents_v2_plba-v2-architecture-control-plane.md b/tests/pipeline_setup_v3/test_results/plba_full_chain_subintents_v3/20260312_192715/full_chain_plba_code_subintents_v2_plba-v2-architecture-control-plane.md deleted file mode 100644 index 11a4dff..0000000 --- a/tests/pipeline_setup_v3/test_results/plba_full_chain_subintents_v3/20260312_192715/full_chain_plba_code_subintents_v2_plba-v2-architecture-control-plane.md +++ /dev/null @@ -1,307 +0,0 @@ -# plba-v2-architecture-control-plane - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_02_pipeline/full_chain_plba_code_subintents_v2.yaml -- runner: agent_runtime -- mode: full_chain -- passed: True - -## Query -Какие компоненты участвуют в ControlPlaneService? - -## Actual -{ - "intent": "CODE_QA", - "sub_intent": "ARCHITECTURE", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 33, - "llm_answer": "**ControlPlaneService** является главным компонентом, управляющим жизненным циклом контролируемых каналов.\n\nКомпоненты:\n- **ControlPlaneService**\n- **ControlPlaneService.__init__**: инициализирует сервис, регистрирует каналы и запускает асинхронные операции.\n- **ControlPlaneService.start**: начинает работу сервиса, вызывая asyncio.run и читая атрибут _channels.\n- **ControlPlaneService.register_channel**: регистрирует канал, читая атрибут _channels.\n- **ControlPlaneService.stop**, **ControlPlaneService._stop_async**: останавливают сервисы.\n- **ControlPlaneService._start_async**: отвечает за асинхронный старт.\n- **ControlChannel**: абстрактный базовый класс всех каналов контроля с методами start и stop.\n\nСвязи между компонентами:\n- Инициализация (ControlPlaneService.__init__) выполняет dataflow_slice для методов регистрации и старта.\n- Метод старта (ControlPlaneService.start) вызывает asyncio.run и зависит от атрибута _channels.\n- Регистрация канала (ControlPlaneService.register_channel) использует данные из атрибута _channels.\n\nТаким образом, ControlPlaneService координирует работу зарегистрированных каналов (_channels), обеспечивая их правильный запуск и остановку.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "ControlPlaneService" - ], - "layers": [ - "C4_SEMANTIC_ROLES", - "C3_ENTRYPOINTS", - "C2_DEPENDENCY_GRAPH", - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS" - ] -} - -## Steps -[ - { - "step": "router", - "status": "completed", - "timings_ms": { - "router": 1 - }, - "output": { - "intent": "CODE_QA", - "sub_intent": "ARCHITECTURE", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - } - }, - { - "step": "retrieval", - "status": "completed", - "timings_ms": { - "retrieval": 233 - }, - "output": { - "rag_count": 33, - "answer_path_rag_count": 33, - "resolved_symbol_status": "resolved", - "resolved_symbol": "ControlPlaneService", - "requested_layers": [ - "C4_SEMANTIC_ROLES", - "C3_ENTRYPOINTS", - "C2_DEPENDENCY_GRAPH", - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS" - ] - }, - "diagnostics": { - "executed_layers": [ - "C4_SEMANTIC_ROLES", - "C3_ENTRYPOINTS", - "C2_DEPENDENCY_GRAPH", - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS" - ], - "retrieval_mode_by_layer": { - "C4_SEMANTIC_ROLES": "vector", - "C3_ENTRYPOINTS": "vector", - "C2_DEPENDENCY_GRAPH": "vector", - "C1_SYMBOL_CATALOG": "vector", - "C0_SOURCE_CHUNKS": "vector" - }, - "top_k_by_layer": { - "C4_SEMANTIC_ROLES": 12, - "C3_ENTRYPOINTS": 8, - "C2_DEPENDENCY_GRAPH": 8, - "C1_SYMBOL_CATALOG": 6, - "C0_SOURCE_CHUNKS": 4 - }, - "filters_by_layer": { - "C4_SEMANTIC_ROLES": { - "path_scope": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [] - }, - "C1_SYMBOL_CATALOG": { - "path_scope": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [] - } - }, - "fallback": { - "used": false, - "reason": null - }, - "retrieval_by_layer_ms": { - "C4_SEMANTIC_ROLES": 81, - "C3_ENTRYPOINTS": 20, - "C2_DEPENDENCY_GRAPH": 60, - "C1_SYMBOL_CATALOG": 33, - "C0_SOURCE_CHUNKS": 37 - } - } - }, - { - "step": "pre_evidence_gate", - "status": "passed", - "timings_ms": { - "pre_evidence_gate": 1 - }, - "input": { - "resolved_target": "ControlPlaneService", - "sub_intent": "ARCHITECTURE", - "target_type": "symbol", - "evidence_count": 33, - "code_chunk_count": 33, - "entrypoint_count": 3, - "relation_count": 8, - "test_evidence_count": 0, - "symbol_resolution_status": "resolved", - "path_scope": [] - }, - "output": { - "passed": true, - "failure_reasons": [], - "degraded_message": "", - "evidence_count": 33 - } - }, - { - "step": "llm", - "status": "completed", - "timings_ms": { - "llm": 6272 - }, - "output": { - "prompt_name": "code_qa_architecture_answer", - "answer_preview": "**ControlPlaneService** — центральный компонент, отвечающий за инициализацию, запуск и остановку контролируемых каналов.\n\nОсновные компоненты:\n- **ControlPlaneService**: главный класс сервиса управления каналами контроля.\n- **ControlPlaneService.__init__**: метод инициализации, выполняющий dataflow_", - "resolved_target": "ControlPlaneService", - "answer_policy_branch": "normal_answer", - "decision_reason": "evidence_sufficient" - } - }, - { - "step": "post_evidence_gate", - "status": "passed", - "timings_ms": { - "post_evidence_gate": 1, - "post_evidence_gate_recheck": 1, - "repair": 5760 - }, - "input": { - "answer_mode": "normal", - "degraded_message": "", - "resolved_target": "ControlPlaneService", - "draft_answer_preview": "**ControlPlaneService** — центральный компонент, отвечающий за инициализацию, запуск и остановку контролируемых каналов.\n\nОсновные компоненты:\n- **ControlPlaneService**: главный класс сервиса управления каналами контроля.\n- **ControlPlaneService.__init__**: метод инициализации, выполняющий dataflow_", - "repair_candidate": true - }, - "output": { - "passed": true, - "action": "return", - "reasons": [], - "repair_used": true, - "final_answer_preview": "**ControlPlaneService** является главным компонентом, управляющим жизненным циклом контролируемых каналов.\n\nКомпоненты:\n- **ControlPlaneService**\n- **ControlPlaneService.__init__**: инициализирует сервис, регистрирует каналы и запускает асинхронные операции.\n- **ControlPlaneService.start**: начинает" - } - } -] - -## Diagnostics -{ - "intent_correct": null, - "target_found": true, - "layers_used": [ - "C4_SEMANTIC_ROLES", - "C3_ENTRYPOINTS", - "C2_DEPENDENCY_GRAPH", - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS" - ], - "retrieval_sufficient": true, - "answer_mode": "normal", - "resolved_target": "ControlPlaneService", - "answer_policy_branch": "normal_answer", - "decision_reason": "evidence_sufficient", - "router_result": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "retrieval_profile": "code", - "sub_intent": "ARCHITECTURE", - "path_scope": [], - "layers": [ - "C4_SEMANTIC_ROLES", - "C3_ENTRYPOINTS", - "C2_DEPENDENCY_GRAPH", - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS" - ], - "symbol_resolution_status": "resolved" - }, - "retrieval_request": { - "rag_session_id": "7d11da21-faa0-4cea-aede-aeabe069164c", - "query": "Какие компоненты участвуют в ControlPlaneService?", - "sub_intent": "ARCHITECTURE", - "path_scope": [], - "requested_layers": [ - "C4_SEMANTIC_ROLES", - "C3_ENTRYPOINTS", - "C2_DEPENDENCY_GRAPH", - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS" - ] - }, - "per_layer_outcome": [ - { - "layer_id": "C4_SEMANTIC_ROLES", - "hit_count": 12, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C3_ENTRYPOINTS", - "hit_count": 3, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C2_DEPENDENCY_GRAPH", - "hit_count": 8, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C1_SYMBOL_CATALOG", - "hit_count": 6, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C0_SOURCE_CHUNKS", - "hit_count": 4, - "empty": false, - "fallback_used": false - } - ], - "empty_layers": [], - "evidence_gate_decision": { - "sufficient": true, - "failure_reasons": [], - "evidence_count": 33 - }, - "evidence_gate_input": { - "resolved_target": "ControlPlaneService", - "sub_intent": "ARCHITECTURE", - "target_type": "symbol", - "evidence_count": 33, - "code_chunk_count": 33, - "entrypoint_count": 3, - "relation_count": 8, - "test_evidence_count": 0, - "symbol_resolution_status": "resolved", - "path_scope": [] - }, - "post_evidence_gate": { - "input": { - "answer_mode": "normal", - "degraded_message": "", - "resolved_target": "ControlPlaneService", - "draft_answer_preview": "**ControlPlaneService** — центральный компонент, отвечающий за инициализацию, запуск и остановку контролируемых каналов.\n\nОсновные компоненты:\n- **ControlPlaneService**: главный класс сервиса управления каналами контроля.\n- **ControlPlaneService.__init__**: метод инициализации, выполняющий dataflow_", - "repair_candidate": true - }, - "output": { - "passed": true, - "action": "return", - "reasons": [], - "repair_used": true, - "final_answer_preview": "**ControlPlaneService** является главным компонентом, управляющим жизненным циклом контролируемых каналов.\n\nКомпоненты:\n- **ControlPlaneService**\n- **ControlPlaneService.__init__**: инициализирует сервис, регистрирует каналы и запускает асинхронные операции.\n- **ControlPlaneService.start**: начинает" - } - }, - "failure_reasons": [], - "timings_ms": { - "router": 1, - "retrieval": 233, - "pre_evidence_gate": 1, - "llm": 6272, - "post_evidence_gate": 1, - "repair": 5760, - "post_evidence_gate_recheck": 1 - } -} - -## Mismatches -- none \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/plba_full_chain_subintents_v3/20260312_192715/full_chain_plba_code_subintents_v2_plba-v2-architecture-runtime-manager.json b/tests/pipeline_setup_v3/test_results/plba_full_chain_subintents_v3/20260312_192715/full_chain_plba_code_subintents_v2_plba-v2-architecture-runtime-manager.json deleted file mode 100644 index bd8c89d..0000000 --- a/tests/pipeline_setup_v3/test_results/plba_full_chain_subintents_v3/20260312_192715/full_chain_plba_code_subintents_v2_plba-v2-architecture-runtime-manager.json +++ /dev/null @@ -1,4722 +0,0 @@ -{ - "case_id": "plba-v2-architecture-runtime-manager", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_02_pipeline/full_chain_plba_code_subintents_v2.yaml", - "runner": "agent_runtime", - "mode": "full_chain", - "query": "Какие компоненты участвуют в RuntimeManager?", - "actual": { - "intent": "CODE_QA", - "sub_intent": "ARCHITECTURE", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 33, - "llm_answer": "Недостаточно подтверждённых данных для уверенного ответа по RuntimeManager.", - "answer_mode": "degraded", - "path_scope": [], - "symbol_candidates": [ - "RuntimeManager" - ], - "layers": [ - "C4_SEMANTIC_ROLES", - "C3_ENTRYPOINTS", - "C2_DEPENDENCY_GRAPH", - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS" - ] - }, - "passed": true, - "mismatches": [], - "details": { - "query": "Какие компоненты участвуют в RuntimeManager?", - "router_result": { - "schema_version": "1.1", - "intent": "CODE_QA", - "retrieval_profile": "code", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query_plan": { - "raw": "Какие компоненты участвуют в RuntimeManager?", - "normalized": "Какие компоненты участвуют в RuntimeManager?", - "sub_intent": "ARCHITECTURE", - "negations": [], - "expansions": [ - "RuntimeManager" - ], - "keyword_hints": [ - "RuntimeManager" - ], - "path_hints": [], - "doc_scope_hints": [], - "symbol_candidates": [ - "RuntimeManager" - ], - "symbol_kind_hint": "class", - "anchors": [ - { - "type": "SYMBOL", - "value": "RuntimeManager", - "source": "user_text", - "subtype": null, - "span": { - "start": 29, - "end": 43 - }, - "confidence": 0.88 - } - ] - }, - "retrieval_spec": { - "domains": [ - "CODE" - ], - "layer_queries": [ - { - "layer_id": "C4_SEMANTIC_ROLES", - "top_k": 12 - }, - { - "layer_id": "C3_ENTRYPOINTS", - "top_k": 8 - }, - { - "layer_id": "C2_DEPENDENCY_GRAPH", - "top_k": 8 - }, - { - "layer_id": "C1_SYMBOL_CATALOG", - "top_k": 6 - }, - { - "layer_id": "C0_SOURCE_CHUNKS", - "top_k": 4 - } - ], - "filters": { - "test_policy": "EXCLUDE", - "path_scope": [], - "language": [ - "python" - ] - }, - "rerank_profile": "code" - }, - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - }, - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "RuntimeManager", - "alternatives": [ - "RuntimeManager", - "RuntimeManager", - "RuntimeManager", - "RuntimeManager", - "RuntimeManager" - ], - "confidence": 0.99 - }, - "evidence_policy": { - "require_def": true, - "require_flow": true, - "require_spec": false, - "allow_answer_without_evidence": false - } - }, - "retrieval_request": { - "rag_session_id": "7d11da21-faa0-4cea-aede-aeabe069164c", - "query": "Какие компоненты участвуют в RuntimeManager?", - "sub_intent": "ARCHITECTURE", - "path_scope": [], - "keyword_hints": [ - "RuntimeManager" - ], - "symbol_candidates": [ - "RuntimeManager" - ], - "requested_layers": [ - "C4_SEMANTIC_ROLES", - "C3_ENTRYPOINTS", - "C2_DEPENDENCY_GRAPH", - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS" - ], - "retrieval_spec": { - "domains": [ - "CODE" - ], - "layer_queries": [ - { - "layer_id": "C4_SEMANTIC_ROLES", - "top_k": 12 - }, - { - "layer_id": "C3_ENTRYPOINTS", - "top_k": 8 - }, - { - "layer_id": "C2_DEPENDENCY_GRAPH", - "top_k": 8 - }, - { - "layer_id": "C1_SYMBOL_CATALOG", - "top_k": 6 - }, - { - "layer_id": "C0_SOURCE_CHUNKS", - "top_k": 4 - } - ], - "filters": { - "test_policy": "EXCLUDE", - "path_scope": [], - "language": [ - "python" - ] - }, - "rerank_profile": "code" - }, - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - }, - "query_plan": { - "raw": "Какие компоненты участвуют в RuntimeManager?", - "normalized": "Какие компоненты участвуют в RuntimeManager?", - "sub_intent": "ARCHITECTURE", - "negations": [], - "expansions": [ - "RuntimeManager" - ], - "keyword_hints": [ - "RuntimeManager" - ], - "path_hints": [], - "doc_scope_hints": [], - "symbol_candidates": [ - "RuntimeManager" - ], - "symbol_kind_hint": "class", - "anchors": [ - { - "type": "SYMBOL", - "value": "RuntimeManager", - "source": "user_text", - "subtype": null, - "span": { - "start": 29, - "end": 43 - }, - "confidence": 0.88 - } - ] - } - }, - "retrieval_result": { - "target_symbol_candidates": [ - "RuntimeManager", - "ControlChannel" - ], - "resolved_symbol": "RuntimeManager", - "symbol_resolution_status": "resolved", - "file_candidates": [ - "src/app_runtime/core/runtime.py", - "src/app_runtime/control/base.py", - "src/app_runtime/control/service.py", - "src/app_runtime/control/http_runner.py", - "src/app_runtime/control/http_channel.py", - "src/app_runtime/control/http_app.py", - "src/app_runtime/workflow/persistence/workflow_persistence.py", - "src/app_runtime/queue/in_memory.py", - "src/app_runtime/config/file_loader.py", - "src/app_runtime/tracing/store.py", - "src/app_runtime/workers/supervisor.py", - "src/plba/__init__.py", - "src/plba/core.py", - "src/plba/bootstrap.py", - "src/app_runtime/control/__init__.py" - ], - "code_chunks": [ - { - "layer": "C4_SEMANTIC_ROLES", - "path": "src/app_runtime/core/runtime.py", - "title": "RuntimeManager", - "content": "RuntimeManager\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests manager\n- orchestrates role-like calls (4)\n- reads and writes state attributes\n- participates in dataflow slices (50)", - "start_line": 18, - "end_line": 179, - "metadata": { - "symbol_id": "7e4a9381328c5803bbc6179458612fc4e947d928aa7bf8b4b2bebb2c8592f758", - "symbol_name": "RuntimeManager", - "qname": "RuntimeManager", - "role": "pipeline_stage", - "confidence": 0.67, - "dataflow_participation": 50, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C4_SEMANTIC_ROLES", - "path": "src/app_runtime/control/base.py", - "title": "ControlActionSet", - "content": "ControlActionSet\nrole: model\n\nResponsibilities:\n- default model role", - "start_line": 14, - "end_line": 18, - "metadata": { - "symbol_id": "46eb026cb3313415ec47b82dd22f84f4d112c9d987e8b1716dcb0baa1cce8988", - "symbol_name": "ControlActionSet", - "qname": "ControlActionSet", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C4_SEMANTIC_ROLES", - "path": "src/app_runtime/control/base.py", - "title": "ControlChannel", - "content": "ControlChannel\nrole: model\n\nResponsibilities:\n- default model role", - "start_line": 21, - "end_line": 28, - "metadata": { - "symbol_id": "cfcfe9a311d3a2dbdaf32ac4ccd73c0eb9a117f830591a1c0867ee97d46204ff", - "symbol_name": "ControlChannel", - "qname": "ControlChannel", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C4_SEMANTIC_ROLES", - "path": "src/app_runtime/control/service.py", - "title": "ControlPlaneService", - "content": "ControlPlaneService\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests service\n- reads and writes state attributes\n- participates in dataflow slices (5)", - "start_line": 12, - "end_line": 52, - "metadata": { - "symbol_id": "b13471e5916986dccffb53fab613812842965705e6b3a89ae549d30c9e91e9aa", - "symbol_name": "ControlPlaneService", - "qname": "ControlPlaneService", - "role": "pipeline_stage", - "confidence": 0.57, - "dataflow_participation": 5, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C4_SEMANTIC_ROLES", - "path": "src/app_runtime/control/http_runner.py", - "title": "UvicornThreadRunner", - "content": "UvicornThreadRunner\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (24)", - "start_line": 10, - "end_line": 61, - "metadata": { - "symbol_id": "fd55630045a02100df8877ac27d951ee08617d4598764394d48cb51fe067476a", - "symbol_name": "UvicornThreadRunner", - "qname": "UvicornThreadRunner", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 24, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "3779fdd2878b770e789a35bb2a89c9d79f13b61c26d7db1b3b683f9bb9e1623f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C4_SEMANTIC_ROLES", - "path": "src/app_runtime/control/http_channel.py", - "title": "HttpControlChannel", - "content": "HttpControlChannel\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (10)", - "start_line": 12, - "end_line": 57, - "metadata": { - "symbol_id": "1c9fbdc24819e5604c26ea55428a74310f03a03e1af197ed84846af61e42fdb0", - "symbol_name": "HttpControlChannel", - "qname": "HttpControlChannel", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 10, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C4_SEMANTIC_ROLES", - "path": "src/app_runtime/control/http_app.py", - "title": "HttpControlAppFactory", - "content": "HttpControlAppFactory\nrole: factory\n\nResponsibilities:\n- name suffix suggests factory", - "start_line": 15, - "end_line": 53, - "metadata": { - "symbol_id": "9b3502a5fb408b273223db13264349cf500de24915b6c649d9ea8970d0dfd8e0", - "symbol_name": "HttpControlAppFactory", - "qname": "HttpControlAppFactory", - "role": "factory", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C4_SEMANTIC_ROLES", - "path": "src/app_runtime/workflow/persistence/workflow_persistence.py", - "title": "WorkflowPersistence", - "content": "WorkflowPersistence\nrole: pipeline_stage\n\nResponsibilities:\n- orchestrates role-like calls (2)\n- reads and writes state attributes\n- participates in dataflow slices (16)", - "start_line": 8, - "end_line": 54, - "metadata": { - "symbol_id": "7bd01ee45cf31f2d5c2e3e51656254860ac785d10cef9e0852cd4fba90857bae", - "symbol_name": "WorkflowPersistence", - "qname": "WorkflowPersistence", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 16, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "80e9410ddc639789b4353c2a1a757ba8d0d5b5bb6075b0b263b61551f04ae1f0", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C4_SEMANTIC_ROLES", - "path": "src/app_runtime/queue/in_memory.py", - "title": "InMemoryTaskQueue", - "content": "InMemoryTaskQueue\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (9)", - "start_line": 9, - "end_line": 38, - "metadata": { - "symbol_id": "2da04cb94544a3bcbf0943a95ad4bdd8710bcafaa32a02fd0e4de2178dcf3533", - "symbol_name": "InMemoryTaskQueue", - "qname": "InMemoryTaskQueue", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 9, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "58f0cc001ccda0eee4c6bc32ed83bd05eafd6b6644f1e8b4aa9eed3103db73dc", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C4_SEMANTIC_ROLES", - "path": "src/app_runtime/config/file_loader.py", - "title": "ConfigFileLoader", - "content": "ConfigFileLoader\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (8)", - "start_line": 11, - "end_line": 48, - "metadata": { - "symbol_id": "a8474eca8b6e9dc86ae67ed68b16fa5fb639ef08739c053e7b7195489765667f", - "symbol_name": "ConfigFileLoader", - "qname": "ConfigFileLoader", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 8, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "1f19ffebde5e38e4be5a5d5a678059a0f36dedb8fb8b3e00ab395c67106a87ea", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C4_SEMANTIC_ROLES", - "path": "src/app_runtime/tracing/store.py", - "title": "TraceContextStore", - "content": "TraceContextStore\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (6)", - "start_line": 15, - "end_line": 52, - "metadata": { - "symbol_id": "b2dad4fbe16ffb11b58deba311c7739955c39d59f291b22181f33e9c8cce4059", - "symbol_name": "TraceContextStore", - "qname": "TraceContextStore", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 6, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "d369554f08fc92039c6edd5a2a1e73b23901533e8974459170bbd9347d263dc5", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C4_SEMANTIC_ROLES", - "path": "src/app_runtime/workers/supervisor.py", - "title": "WorkerSupervisor", - "content": "WorkerSupervisor\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (6)", - "start_line": 10, - "end_line": 59, - "metadata": { - "symbol_id": "c17b44e8d9e97d490989b21fa67d7c346cdda8a0472e4c41fb243c8846faa124", - "symbol_name": "WorkerSupervisor", - "qname": "WorkerSupervisor", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 6, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "77609d9d5927171cce7fc3a54897c183fd63068710c6362029b700937aae5eee", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C3_ENTRYPOINTS", - "path": "src/app_runtime/control/http_app.py", - "title": "app.post", - "content": "fastapi http app.post", - "start_line": 38, - "end_line": 42, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C3_ENTRYPOINTS", - "path": "src/app_runtime/control/http_app.py", - "title": "app.get", - "content": "fastapi http app.get", - "start_line": 31, - "end_line": 34, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C3_ENTRYPOINTS", - "path": "src/app_runtime/control/http_app.py", - "title": "app.get", - "content": "fastapi http app.get", - "start_line": 38, - "end_line": 42, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "path": "src/app_runtime/control/service.py", - "title": "ControlPlaneService.__init__:dataflow_slice", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._start_async", - "start_line": 14, - "end_line": 47, - "metadata": { - "edge_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517", - "dst_ref": "ControlPlaneService._start_async", - "resolution": "resolved", - "slice_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._start_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "path": "src/app_runtime/core/runtime.py", - "title": "RuntimeManager.__init__:dataflow_slice", - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager.start", - "start_line": 32, - "end_line": 59, - "metadata": { - "edge_id": "98312ace7fc62b1c7194c5aa1732b6ef736eae1668a3a120dd1ecd5ab1d64f7a", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "77a7b260193018845e4e204df094ab89cfd7c82ee4e822b3a83ad4cd945f9cb1", - "dst_ref": "RuntimeManager.start", - "resolution": "resolved", - "slice_id": "98312ace7fc62b1c7194c5aa1732b6ef736eae1668a3a120dd1ecd5ab1d64f7a", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager.start" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "77a7b260193018845e4e204df094ab89cfd7c82ee4e822b3a83ad4cd945f9cb1" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "path": "src/app_runtime/control/service.py", - "title": "ControlPlaneService.__init__:dataflow_slice", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.start", - "start_line": 14, - "end_line": 20, - "metadata": { - "edge_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154", - "dst_ref": "ControlPlaneService.start", - "resolution": "resolved", - "slice_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.start" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "path": "src/app_runtime/control/service.py", - "title": "ControlPlaneService.__init__:dataflow_slice", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.stop", - "start_line": 14, - "end_line": 25, - "metadata": { - "edge_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d", - "dst_ref": "ControlPlaneService.stop", - "resolution": "resolved", - "slice_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.stop" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "path": "src/app_runtime/control/service.py", - "title": "ControlPlaneService.__init__:dataflow_slice", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._stop_async", - "start_line": 14, - "end_line": 51, - "metadata": { - "edge_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a", - "dst_ref": "ControlPlaneService._stop_async", - "resolution": "resolved", - "slice_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._stop_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "path": "src/app_runtime/core/runtime.py", - "title": "RuntimeManager.__init__:dataflow_slice", - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager.add_config_file", - "start_line": 32, - "end_line": 52, - "metadata": { - "edge_id": "a23b8a11ebdb12708b60c96ea12a69f7f042082f1adfddd572444e246d81d167", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "57ffbd4f0d9fdf3507c2b8624312ce211f3d02fdf86a57a8ec90778d8a7b498d", - "dst_ref": "RuntimeManager.add_config_file", - "resolution": "resolved", - "slice_id": "a23b8a11ebdb12708b60c96ea12a69f7f042082f1adfddd572444e246d81d167", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager.add_config_file" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "57ffbd4f0d9fdf3507c2b8624312ce211f3d02fdf86a57a8ec90778d8a7b498d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "path": "src/app_runtime/control/service.py", - "title": "ControlPlaneService.__init__:dataflow_slice", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.register_channel", - "start_line": 14, - "end_line": 17, - "metadata": { - "edge_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957", - "dst_ref": "ControlPlaneService.register_channel", - "resolution": "resolved", - "slice_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.register_channel" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "path": "src/app_runtime/core/runtime.py", - "title": "RuntimeManager.__init__:dataflow_slice", - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager._register_core_services", - "start_line": 32, - "end_line": 127, - "metadata": { - "edge_id": "3e5811f3b511fa0cabe363f5d01f2ac5fa039bc8b93f7ee108323e1f5f45a293", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "972d6057a6caac9cf31ebc1e29c6f39f71b10d4cc170dec57cf875ba458549c6", - "dst_ref": "RuntimeManager._register_core_services", - "resolution": "resolved", - "slice_id": "3e5811f3b511fa0cabe363f5d01f2ac5fa039bc8b93f7ee108323e1f5f45a293", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager._register_core_services" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "972d6057a6caac9cf31ebc1e29c6f39f71b10d4cc170dec57cf875ba458549c6" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C1_SYMBOL_CATALOG", - "path": "src/plba/__init__.py", - "title": "RuntimeManager", - "content": "const RuntimeManager\nRuntimeManager = plba.core.RuntimeManager", - "start_line": 16, - "end_line": 16, - "metadata": { - "symbol_id": "7eacec84f9b8d6c4201374591faecdac7493091c263681495c338973f2971ad9", - "qname": "RuntimeManager", - "kind": "const", - "signature": "RuntimeManager = plba.core.RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "src.plba.__init__", - "is_test": false, - "blob_sha": "24e755ec8c249d14fb0e675b5dbf2b71ab91afb9c849897eebfa9feb2499e19d", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C1_SYMBOL_CATALOG", - "path": "src/plba/core.py", - "title": "RuntimeManager", - "content": "const RuntimeManager\nRuntimeManager = app_runtime.core.runtime.RuntimeManager", - "start_line": 2, - "end_line": 2, - "metadata": { - "symbol_id": "e1684562d978b7af7fe9b27dc5869d770348a87b5dc19a50360f58544668578b", - "qname": "RuntimeManager", - "kind": "const", - "signature": "RuntimeManager = app_runtime.core.runtime.RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "src.plba.core", - "is_test": false, - "blob_sha": "c0ae25110d20e665216616e26b68adfe035b624ba45d31d1272fb21f906f9ca8", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C1_SYMBOL_CATALOG", - "path": "src/app_runtime/control/service.py", - "title": "RuntimeManager", - "content": "const RuntimeManager\nRuntimeManager = app_runtime.core.runtime.RuntimeManager", - "start_line": 9, - "end_line": 9, - "metadata": { - "symbol_id": "62a9575c77aad894120d18b4f2a08cf2ba42f77e9be4a8a432b767d157701afe", - "qname": "RuntimeManager", - "kind": "const", - "signature": "RuntimeManager = app_runtime.core.runtime.RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.control.service", - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C1_SYMBOL_CATALOG", - "path": "src/app_runtime/core/runtime.py", - "title": "RuntimeManager", - "content": "class RuntimeManager\nRuntimeManager", - "start_line": 18, - "end_line": 179, - "metadata": { - "symbol_id": "7e4a9381328c5803bbc6179458612fc4e947d928aa7bf8b4b2bebb2c8592f758", - "qname": "RuntimeManager", - "kind": "class", - "signature": "RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.core.runtime", - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C1_SYMBOL_CATALOG", - "path": "src/plba/bootstrap.py", - "title": "RuntimeManager", - "content": "const RuntimeManager\nRuntimeManager = app_runtime.core.runtime.RuntimeManager", - "start_line": 4, - "end_line": 4, - "metadata": { - "symbol_id": "27158ca220022eeb5083c6addf8a50775d45f7161284fd60aac48410105f4b98", - "qname": "RuntimeManager", - "kind": "const", - "signature": "RuntimeManager = app_runtime.core.runtime.RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "src.plba.bootstrap", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C1_SYMBOL_CATALOG", - "path": "src/app_runtime/control/__init__.py", - "title": "ControlChannel", - "content": "const ControlChannel\nControlChannel = app_runtime.control.base.ControlChannel", - "start_line": 1, - "end_line": 1, - "metadata": { - "symbol_id": "268420f7aa4ed74082b9276cae0cded4f00bac090ffd58fa020a65be0fe19c27", - "qname": "ControlChannel", - "kind": "const", - "signature": "ControlChannel = app_runtime.control.base.ControlChannel", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.control.__init__", - "is_test": false, - "blob_sha": "bf3c37e3369a84cc618adc0fd71c232e5eb4b871eaff743069a17e661e498316", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C0_SOURCE_CHUNKS", - "path": "src/app_runtime/control/base.py", - "title": "src/app_runtime/control/base.py:ControlChannel", - "content": "class ControlChannel(ABC):\n @abstractmethod\n async def start(self, actions: ControlActionSet) -> None:\n \"\"\"Start the control channel and bind handlers.\"\"\"\n\n @abstractmethod\n async def stop(self) -> None:\n \"\"\"Stop the control channel and release resources.\"\"\"", - "start_line": 21, - "end_line": 28, - "metadata": { - "chunk_index": 1, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.base", - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C0_SOURCE_CHUNKS", - "path": "src/app_runtime/control/__init__.py", - "title": "src/app_runtime/control/__init__.py:1-5", - "content": "from app_runtime.control.base import ControlActionSet, ControlChannel\nfrom app_runtime.control.http_channel import HttpControlChannel\nfrom app_runtime.control.service import ControlPlaneService\n\n__all__ = [\"ControlActionSet\", \"ControlChannel\", \"ControlPlaneService\", \"HttpControlChannel\"]", - "start_line": 1, - "end_line": 5, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.app_runtime.control.__init__", - "is_test": false, - "blob_sha": "bf3c37e3369a84cc618adc0fd71c232e5eb4b871eaff743069a17e661e498316", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C0_SOURCE_CHUNKS", - "path": "src/app_runtime/control/base.py", - "title": "src/app_runtime/control/base.py:ControlActionSet", - "content": "class ControlActionSet:\n health: HealthHandler\n start: ActionHandler\n stop: ActionHandler\n status: ActionHandler", - "start_line": 14, - "end_line": 18, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.base", - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C0_SOURCE_CHUNKS", - "path": "src/app_runtime/control/http_app.py", - "title": "src/app_runtime/control/http_app.py:HttpControlAppFactory", - "content": "class HttpControlAppFactory:\n def create(\n self,\n health_provider: Callable[[], Awaitable[HealthPayload]],\n action_provider: Callable[[str, str], Awaitable[JSONResponse]],\n ) -> FastAPI:\n app = FastAPI(title=\"PLBA Control API\")\n\n @app.middleware(\"http\")\n async def log_api_call(request: Request, call_next): # type: ignore[no-untyped-def]\n started = time.monotonic()\n response = await call_next(request)\n response.headers[\"X-Response-Time-Ms\"] = str(int((time.monotonic() - started) * 1000))\n return response\n\n @app.get(\"/health\")\n async def health() -> JSONResponse:\n payload = await health_provider()\n status_code = 200 if payload.get(\"status\") == \"ok\" else 503\n return JSONResponse(content=payload, status_code=status_code)\n\n @app.get(\"/actions/{action}\")\n @app.post(\"/actions/{action}\")\n async def action(action: str, request: Request) -> JSONResponse:\n client_source = self._client_source(request)\n if action in {\"start\", \"stop\"}:\n LOGGER.warning(\"Control action requested: /actions/%s client=%s\", action, client_source)\n return await action_provider(action, client_source)\n\n return app\n\n def _client_source(self, request: Request) -> str:\n explicit_header = request.headers.get(\"X-Client-Source\", \"\").strip()\n if explicit_header:\n return explicit_header\n user_agent = request.headers.get(\"User-Agent\", \"\").strip()\n if user_agent:\n return f\"user-agent:{user_agent}\"\n return \"unknown\"", - "start_line": 15, - "end_line": 53, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.http_app", - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "relations": [ - { - "path": "src/app_runtime/control/service.py", - "start_line": 14, - "end_line": 47, - "edge_type": "dataflow_slice", - "source": "ControlPlaneService.__init__", - "target": "ControlPlaneService._start_async", - "metadata": { - "edge_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517", - "dst_ref": "ControlPlaneService._start_async", - "resolution": "resolved", - "slice_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._start_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - }, - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._start_async" - }, - { - "path": "src/app_runtime/core/runtime.py", - "start_line": 32, - "end_line": 59, - "edge_type": "dataflow_slice", - "source": "RuntimeManager.__init__", - "target": "RuntimeManager.start", - "metadata": { - "edge_id": "98312ace7fc62b1c7194c5aa1732b6ef736eae1668a3a120dd1ecd5ab1d64f7a", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "77a7b260193018845e4e204df094ab89cfd7c82ee4e822b3a83ad4cd945f9cb1", - "dst_ref": "RuntimeManager.start", - "resolution": "resolved", - "slice_id": "98312ace7fc62b1c7194c5aa1732b6ef736eae1668a3a120dd1ecd5ab1d64f7a", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager.start" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "77a7b260193018845e4e204df094ab89cfd7c82ee4e822b3a83ad4cd945f9cb1" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - }, - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager.start" - }, - { - "path": "src/app_runtime/control/service.py", - "start_line": 14, - "end_line": 20, - "edge_type": "dataflow_slice", - "source": "ControlPlaneService.__init__", - "target": "ControlPlaneService.start", - "metadata": { - "edge_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154", - "dst_ref": "ControlPlaneService.start", - "resolution": "resolved", - "slice_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.start" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - }, - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.start" - }, - { - "path": "src/app_runtime/control/service.py", - "start_line": 14, - "end_line": 25, - "edge_type": "dataflow_slice", - "source": "ControlPlaneService.__init__", - "target": "ControlPlaneService.stop", - "metadata": { - "edge_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d", - "dst_ref": "ControlPlaneService.stop", - "resolution": "resolved", - "slice_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.stop" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - }, - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.stop" - }, - { - "path": "src/app_runtime/control/service.py", - "start_line": 14, - "end_line": 51, - "edge_type": "dataflow_slice", - "source": "ControlPlaneService.__init__", - "target": "ControlPlaneService._stop_async", - "metadata": { - "edge_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a", - "dst_ref": "ControlPlaneService._stop_async", - "resolution": "resolved", - "slice_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._stop_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - }, - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._stop_async" - }, - { - "path": "src/app_runtime/core/runtime.py", - "start_line": 32, - "end_line": 52, - "edge_type": "dataflow_slice", - "source": "RuntimeManager.__init__", - "target": "RuntimeManager.add_config_file", - "metadata": { - "edge_id": "a23b8a11ebdb12708b60c96ea12a69f7f042082f1adfddd572444e246d81d167", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "57ffbd4f0d9fdf3507c2b8624312ce211f3d02fdf86a57a8ec90778d8a7b498d", - "dst_ref": "RuntimeManager.add_config_file", - "resolution": "resolved", - "slice_id": "a23b8a11ebdb12708b60c96ea12a69f7f042082f1adfddd572444e246d81d167", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager.add_config_file" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "57ffbd4f0d9fdf3507c2b8624312ce211f3d02fdf86a57a8ec90778d8a7b498d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - }, - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager.add_config_file" - }, - { - "path": "src/app_runtime/control/service.py", - "start_line": 14, - "end_line": 17, - "edge_type": "dataflow_slice", - "source": "ControlPlaneService.__init__", - "target": "ControlPlaneService.register_channel", - "metadata": { - "edge_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957", - "dst_ref": "ControlPlaneService.register_channel", - "resolution": "resolved", - "slice_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.register_channel" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - }, - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.register_channel" - }, - { - "path": "src/app_runtime/core/runtime.py", - "start_line": 32, - "end_line": 127, - "edge_type": "dataflow_slice", - "source": "RuntimeManager.__init__", - "target": "RuntimeManager._register_core_services", - "metadata": { - "edge_id": "3e5811f3b511fa0cabe363f5d01f2ac5fa039bc8b93f7ee108323e1f5f45a293", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "972d6057a6caac9cf31ebc1e29c6f39f71b10d4cc170dec57cf875ba458549c6", - "dst_ref": "RuntimeManager._register_core_services", - "resolution": "resolved", - "slice_id": "3e5811f3b511fa0cabe363f5d01f2ac5fa039bc8b93f7ee108323e1f5f45a293", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager._register_core_services" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "972d6057a6caac9cf31ebc1e29c6f39f71b10d4cc170dec57cf875ba458549c6" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - }, - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager._register_core_services" - } - ], - "semantic_hints": [ - { - "path": "src/app_runtime/core/runtime.py", - "title": "RuntimeManager", - "symbol": "RuntimeManager", - "role": "pipeline_stage", - "confidence": 0.67, - "content": "RuntimeManager\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests manager\n- orchestrates role-like calls (4)\n- reads and writes state attributes\n- participates in dataflow slices (50)" - }, - { - "path": "src/app_runtime/control/base.py", - "title": "ControlActionSet", - "symbol": "ControlActionSet", - "role": "model", - "confidence": 0.99, - "content": "ControlActionSet\nrole: model\n\nResponsibilities:\n- default model role" - }, - { - "path": "src/app_runtime/control/base.py", - "title": "ControlChannel", - "symbol": "ControlChannel", - "role": "model", - "confidence": 0.99, - "content": "ControlChannel\nrole: model\n\nResponsibilities:\n- default model role" - }, - { - "path": "src/app_runtime/control/service.py", - "title": "ControlPlaneService", - "symbol": "ControlPlaneService", - "role": "pipeline_stage", - "confidence": 0.57, - "content": "ControlPlaneService\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests service\n- reads and writes state attributes\n- participates in dataflow slices (5)" - }, - { - "path": "src/app_runtime/control/http_runner.py", - "title": "UvicornThreadRunner", - "symbol": "UvicornThreadRunner", - "role": "pipeline_stage", - "confidence": 0.99, - "content": "UvicornThreadRunner\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (24)" - }, - { - "path": "src/app_runtime/control/http_channel.py", - "title": "HttpControlChannel", - "symbol": "HttpControlChannel", - "role": "pipeline_stage", - "confidence": 0.99, - "content": "HttpControlChannel\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (10)" - }, - { - "path": "src/app_runtime/control/http_app.py", - "title": "HttpControlAppFactory", - "symbol": "HttpControlAppFactory", - "role": "factory", - "confidence": 0.99, - "content": "HttpControlAppFactory\nrole: factory\n\nResponsibilities:\n- name suffix suggests factory" - }, - { - "path": "src/app_runtime/workflow/persistence/workflow_persistence.py", - "title": "WorkflowPersistence", - "symbol": "WorkflowPersistence", - "role": "pipeline_stage", - "confidence": 0.99, - "content": "WorkflowPersistence\nrole: pipeline_stage\n\nResponsibilities:\n- orchestrates role-like calls (2)\n- reads and writes state attributes\n- participates in dataflow slices (16)" - }, - { - "path": "src/app_runtime/queue/in_memory.py", - "title": "InMemoryTaskQueue", - "symbol": "InMemoryTaskQueue", - "role": "pipeline_stage", - "confidence": 0.99, - "content": "InMemoryTaskQueue\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (9)" - }, - { - "path": "src/app_runtime/config/file_loader.py", - "title": "ConfigFileLoader", - "symbol": "ConfigFileLoader", - "role": "pipeline_stage", - "confidence": 0.99, - "content": "ConfigFileLoader\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (8)" - }, - { - "path": "src/app_runtime/tracing/store.py", - "title": "TraceContextStore", - "symbol": "TraceContextStore", - "role": "pipeline_stage", - "confidence": 0.99, - "content": "TraceContextStore\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (6)" - }, - { - "path": "src/app_runtime/workers/supervisor.py", - "title": "WorkerSupervisor", - "symbol": "WorkerSupervisor", - "role": "pipeline_stage", - "confidence": 0.99, - "content": "WorkerSupervisor\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (6)" - } - ], - "entrypoints": [ - { - "path": "src/app_runtime/control/http_app.py", - "title": "app.get", - "start_line": 31, - "end_line": 34, - "http_method": "GET", - "route_path": "/health", - "handler_symbol": "health", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "route_or_command": "app.get", - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "title": "app.get", - "start_line": 38, - "end_line": 42, - "http_method": "GET", - "route_path": "/actions/{action}", - "handler_symbol": "action", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "route_or_command": "app.get", - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "title": "app.post", - "start_line": 38, - "end_line": 42, - "http_method": "POST", - "route_path": "/actions/{action}", - "handler_symbol": "action", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "route_or_command": "app.post", - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "test_candidates": [], - "layer_outcomes": [ - { - "layer_id": "C4_SEMANTIC_ROLES", - "hit_count": 12, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C3_ENTRYPOINTS", - "hit_count": 3, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C2_DEPENDENCY_GRAPH", - "hit_count": 8, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C1_SYMBOL_CATALOG", - "hit_count": 6, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C0_SOURCE_CHUNKS", - "hit_count": 4, - "empty": false, - "fallback_used": false - } - ], - "missing_layers": [], - "raw_rows": [ - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests manager\n- orchestrates role-like calls (4)\n- reads and writes state attributes\n- participates in dataflow slices (50)", - "layer": "C4_SEMANTIC_ROLES", - "title": "RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 43, - "layer_rank": 2, - "distance": null, - "metadata": { - "symbol_id": "7e4a9381328c5803bbc6179458612fc4e947d928aa7bf8b4b2bebb2c8592f758", - "symbol_name": "RuntimeManager", - "qname": "RuntimeManager", - "role": "pipeline_stage", - "confidence": 0.67, - "dataflow_participation": 50, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "ControlActionSet\nrole: model\n\nResponsibilities:\n- default model role", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlActionSet", - "span_start": 14, - "span_end": 18, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 40, - "layer_rank": 2, - "distance": null, - "metadata": { - "symbol_id": "46eb026cb3313415ec47b82dd22f84f4d112c9d987e8b1716dcb0baa1cce8988", - "symbol_name": "ControlActionSet", - "qname": "ControlActionSet", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "ControlChannel\nrole: model\n\nResponsibilities:\n- default model role", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlChannel", - "span_start": 21, - "span_end": 28, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 40, - "layer_rank": 2, - "distance": null, - "metadata": { - "symbol_id": "cfcfe9a311d3a2dbdaf32ac4ccd73c0eb9a117f830591a1c0867ee97d46204ff", - "symbol_name": "ControlChannel", - "qname": "ControlChannel", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests service\n- reads and writes state attributes\n- participates in dataflow slices (5)", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlPlaneService", - "span_start": 12, - "span_end": 52, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 68, - "layer_rank": 2, - "distance": null, - "metadata": { - "symbol_id": "b13471e5916986dccffb53fab613812842965705e6b3a89ae549d30c9e91e9aa", - "symbol_name": "ControlPlaneService", - "qname": "ControlPlaneService", - "role": "pipeline_stage", - "confidence": 0.57, - "dataflow_participation": 5, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_runner.py", - "content": "UvicornThreadRunner\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (24)", - "layer": "C4_SEMANTIC_ROLES", - "title": "UvicornThreadRunner", - "span_start": 10, - "span_end": 61, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 11, - "layer_rank": 2, - "distance": null, - "metadata": { - "symbol_id": "fd55630045a02100df8877ac27d951ee08617d4598764394d48cb51fe067476a", - "symbol_name": "UvicornThreadRunner", - "qname": "UvicornThreadRunner", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 24, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "3779fdd2878b770e789a35bb2a89c9d79f13b61c26d7db1b3b683f9bb9e1623f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (10)", - "layer": "C4_SEMANTIC_ROLES", - "title": "HttpControlChannel", - "span_start": 12, - "span_end": 57, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 21, - "layer_rank": 2, - "distance": null, - "metadata": { - "symbol_id": "1c9fbdc24819e5604c26ea55428a74310f03a03e1af197ed84846af61e42fdb0", - "symbol_name": "HttpControlChannel", - "qname": "HttpControlChannel", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 10, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "HttpControlAppFactory\nrole: factory\n\nResponsibilities:\n- name suffix suggests factory", - "layer": "C4_SEMANTIC_ROLES", - "title": "HttpControlAppFactory", - "span_start": 15, - "span_end": 53, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 39, - "layer_rank": 2, - "distance": null, - "metadata": { - "symbol_id": "9b3502a5fb408b273223db13264349cf500de24915b6c649d9ea8970d0dfd8e0", - "symbol_name": "HttpControlAppFactory", - "qname": "HttpControlAppFactory", - "role": "factory", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/persistence/workflow_persistence.py", - "content": "WorkflowPersistence\nrole: pipeline_stage\n\nResponsibilities:\n- orchestrates role-like calls (2)\n- reads and writes state attributes\n- participates in dataflow slices (16)", - "layer": "C4_SEMANTIC_ROLES", - "title": "WorkflowPersistence", - "span_start": 8, - "span_end": 54, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 15, - "layer_rank": 2, - "distance": null, - "metadata": { - "symbol_id": "7bd01ee45cf31f2d5c2e3e51656254860ac785d10cef9e0852cd4fba90857bae", - "symbol_name": "WorkflowPersistence", - "qname": "WorkflowPersistence", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 16, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "80e9410ddc639789b4353c2a1a757ba8d0d5b5bb6075b0b263b61551f04ae1f0", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/queue/in_memory.py", - "content": "InMemoryTaskQueue\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (9)", - "layer": "C4_SEMANTIC_ROLES", - "title": "InMemoryTaskQueue", - "span_start": 9, - "span_end": 38, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 22, - "layer_rank": 2, - "distance": null, - "metadata": { - "symbol_id": "2da04cb94544a3bcbf0943a95ad4bdd8710bcafaa32a02fd0e4de2178dcf3533", - "symbol_name": "InMemoryTaskQueue", - "qname": "InMemoryTaskQueue", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 9, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "58f0cc001ccda0eee4c6bc32ed83bd05eafd6b6644f1e8b4aa9eed3103db73dc", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/config/file_loader.py", - "content": "ConfigFileLoader\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (8)", - "layer": "C4_SEMANTIC_ROLES", - "title": "ConfigFileLoader", - "span_start": 11, - "span_end": 48, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 23, - "layer_rank": 2, - "distance": null, - "metadata": { - "symbol_id": "a8474eca8b6e9dc86ae67ed68b16fa5fb639ef08739c053e7b7195489765667f", - "symbol_name": "ConfigFileLoader", - "qname": "ConfigFileLoader", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 8, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "1f19ffebde5e38e4be5a5d5a678059a0f36dedb8fb8b3e00ab395c67106a87ea", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/store.py", - "content": "TraceContextStore\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (6)", - "layer": "C4_SEMANTIC_ROLES", - "title": "TraceContextStore", - "span_start": 15, - "span_end": 52, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 25, - "layer_rank": 2, - "distance": null, - "metadata": { - "symbol_id": "b2dad4fbe16ffb11b58deba311c7739955c39d59f291b22181f33e9c8cce4059", - "symbol_name": "TraceContextStore", - "qname": "TraceContextStore", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 6, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "d369554f08fc92039c6edd5a2a1e73b23901533e8974459170bbd9347d263dc5", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workers/supervisor.py", - "content": "WorkerSupervisor\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (6)", - "layer": "C4_SEMANTIC_ROLES", - "title": "WorkerSupervisor", - "span_start": 10, - "span_end": 59, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 25, - "layer_rank": 2, - "distance": null, - "metadata": { - "symbol_id": "c17b44e8d9e97d490989b21fa67d7c346cdda8a0472e4c41fb243c8846faa124", - "symbol_name": "WorkerSupervisor", - "qname": "WorkerSupervisor", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 6, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "77609d9d5927171cce7fc3a54897c183fd63068710c6362029b700937aae5eee", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": null, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": null, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": null, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._start_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 47, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": null, - "metadata": { - "edge_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517", - "dst_ref": "ControlPlaneService._start_async", - "resolution": "resolved", - "slice_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._start_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager.start", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 32, - "span_end": 59, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": null, - "metadata": { - "edge_id": "98312ace7fc62b1c7194c5aa1732b6ef736eae1668a3a120dd1ecd5ab1d64f7a", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "77a7b260193018845e4e204df094ab89cfd7c82ee4e822b3a83ad4cd945f9cb1", - "dst_ref": "RuntimeManager.start", - "resolution": "resolved", - "slice_id": "98312ace7fc62b1c7194c5aa1732b6ef736eae1668a3a120dd1ecd5ab1d64f7a", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager.start" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "77a7b260193018845e4e204df094ab89cfd7c82ee4e822b3a83ad4cd945f9cb1" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.start", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 20, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": null, - "metadata": { - "edge_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154", - "dst_ref": "ControlPlaneService.start", - "resolution": "resolved", - "slice_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.start" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.stop", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 25, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": null, - "metadata": { - "edge_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d", - "dst_ref": "ControlPlaneService.stop", - "resolution": "resolved", - "slice_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.stop" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._stop_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 51, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": null, - "metadata": { - "edge_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a", - "dst_ref": "ControlPlaneService._stop_async", - "resolution": "resolved", - "slice_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._stop_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager.add_config_file", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 32, - "span_end": 52, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": null, - "metadata": { - "edge_id": "a23b8a11ebdb12708b60c96ea12a69f7f042082f1adfddd572444e246d81d167", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "57ffbd4f0d9fdf3507c2b8624312ce211f3d02fdf86a57a8ec90778d8a7b498d", - "dst_ref": "RuntimeManager.add_config_file", - "resolution": "resolved", - "slice_id": "a23b8a11ebdb12708b60c96ea12a69f7f042082f1adfddd572444e246d81d167", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager.add_config_file" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "57ffbd4f0d9fdf3507c2b8624312ce211f3d02fdf86a57a8ec90778d8a7b498d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.register_channel", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 17, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": null, - "metadata": { - "edge_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957", - "dst_ref": "ControlPlaneService.register_channel", - "resolution": "resolved", - "slice_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.register_channel" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager._register_core_services", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 32, - "span_end": 127, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": null, - "metadata": { - "edge_id": "3e5811f3b511fa0cabe363f5d01f2ac5fa039bc8b93f7ee108323e1f5f45a293", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "972d6057a6caac9cf31ebc1e29c6f39f71b10d4cc170dec57cf875ba458549c6", - "dst_ref": "RuntimeManager._register_core_services", - "resolution": "resolved", - "slice_id": "3e5811f3b511fa0cabe363f5d01f2ac5fa039bc8b93f7ee108323e1f5f45a293", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager._register_core_services" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "972d6057a6caac9cf31ebc1e29c6f39f71b10d4cc170dec57cf875ba458549c6" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/__init__.py", - "content": "const RuntimeManager\nRuntimeManager = plba.core.RuntimeManager", - "layer": "C1_SYMBOL_CATALOG", - "title": "RuntimeManager", - "span_start": 16, - "span_end": 16, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": null, - "metadata": { - "symbol_id": "7eacec84f9b8d6c4201374591faecdac7493091c263681495c338973f2971ad9", - "qname": "RuntimeManager", - "kind": "const", - "signature": "RuntimeManager = plba.core.RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "src.plba.__init__", - "is_test": false, - "blob_sha": "24e755ec8c249d14fb0e675b5dbf2b71ab91afb9c849897eebfa9feb2499e19d", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/core.py", - "content": "const RuntimeManager\nRuntimeManager = app_runtime.core.runtime.RuntimeManager", - "layer": "C1_SYMBOL_CATALOG", - "title": "RuntimeManager", - "span_start": 2, - "span_end": 2, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": null, - "metadata": { - "symbol_id": "e1684562d978b7af7fe9b27dc5869d770348a87b5dc19a50360f58544668578b", - "qname": "RuntimeManager", - "kind": "const", - "signature": "RuntimeManager = app_runtime.core.runtime.RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "src.plba.core", - "is_test": false, - "blob_sha": "c0ae25110d20e665216616e26b68adfe035b624ba45d31d1272fb21f906f9ca8", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "const RuntimeManager\nRuntimeManager = app_runtime.core.runtime.RuntimeManager", - "layer": "C1_SYMBOL_CATALOG", - "title": "RuntimeManager", - "span_start": 9, - "span_end": 9, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": null, - "metadata": { - "symbol_id": "62a9575c77aad894120d18b4f2a08cf2ba42f77e9be4a8a432b767d157701afe", - "qname": "RuntimeManager", - "kind": "const", - "signature": "RuntimeManager = app_runtime.core.runtime.RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.control.service", - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "class RuntimeManager\nRuntimeManager", - "layer": "C1_SYMBOL_CATALOG", - "title": "RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": null, - "metadata": { - "symbol_id": "7e4a9381328c5803bbc6179458612fc4e947d928aa7bf8b4b2bebb2c8592f758", - "qname": "RuntimeManager", - "kind": "class", - "signature": "RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.core.runtime", - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/bootstrap.py", - "content": "const RuntimeManager\nRuntimeManager = app_runtime.core.runtime.RuntimeManager", - "layer": "C1_SYMBOL_CATALOG", - "title": "RuntimeManager", - "span_start": 4, - "span_end": 4, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": null, - "metadata": { - "symbol_id": "27158ca220022eeb5083c6addf8a50775d45f7161284fd60aac48410105f4b98", - "qname": "RuntimeManager", - "kind": "const", - "signature": "RuntimeManager = app_runtime.core.runtime.RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "src.plba.bootstrap", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/__init__.py", - "content": "const ControlChannel\nControlChannel = app_runtime.control.base.ControlChannel", - "layer": "C1_SYMBOL_CATALOG", - "title": "ControlChannel", - "span_start": 1, - "span_end": 1, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": null, - "metadata": { - "symbol_id": "268420f7aa4ed74082b9276cae0cded4f00bac090ffd58fa020a65be0fe19c27", - "qname": "ControlChannel", - "kind": "const", - "signature": "ControlChannel = app_runtime.control.base.ControlChannel", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.control.__init__", - "is_test": false, - "blob_sha": "bf3c37e3369a84cc618adc0fd71c232e5eb4b871eaff743069a17e661e498316", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "class ControlChannel(ABC):\n @abstractmethod\n async def start(self, actions: ControlActionSet) -> None:\n \"\"\"Start the control channel and bind handlers.\"\"\"\n\n @abstractmethod\n async def stop(self) -> None:\n \"\"\"Stop the control channel and release resources.\"\"\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/base.py:ControlChannel", - "span_start": 21, - "span_end": 28, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": null, - "metadata": { - "chunk_index": 1, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.base", - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/__init__.py", - "content": "from app_runtime.control.base import ControlActionSet, ControlChannel\nfrom app_runtime.control.http_channel import HttpControlChannel\nfrom app_runtime.control.service import ControlPlaneService\n\n__all__ = [\"ControlActionSet\", \"ControlChannel\", \"ControlPlaneService\", \"HttpControlChannel\"]", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/__init__.py:1-5", - "span_start": 1, - "span_end": 5, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": null, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.app_runtime.control.__init__", - "is_test": false, - "blob_sha": "bf3c37e3369a84cc618adc0fd71c232e5eb4b871eaff743069a17e661e498316", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "class ControlActionSet:\n health: HealthHandler\n start: ActionHandler\n stop: ActionHandler\n status: ActionHandler", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/base.py:ControlActionSet", - "span_start": 14, - "span_end": 18, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": null, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.base", - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "class HttpControlAppFactory:\n def create(\n self,\n health_provider: Callable[[], Awaitable[HealthPayload]],\n action_provider: Callable[[str, str], Awaitable[JSONResponse]],\n ) -> FastAPI:\n app = FastAPI(title=\"PLBA Control API\")\n\n @app.middleware(\"http\")\n async def log_api_call(request: Request, call_next): # type: ignore[no-untyped-def]\n started = time.monotonic()\n response = await call_next(request)\n response.headers[\"X-Response-Time-Ms\"] = str(int((time.monotonic() - started) * 1000))\n return response\n\n @app.get(\"/health\")\n async def health() -> JSONResponse:\n payload = await health_provider()\n status_code = 200 if payload.get(\"status\") == \"ok\" else 503\n return JSONResponse(content=payload, status_code=status_code)\n\n @app.get(\"/actions/{action}\")\n @app.post(\"/actions/{action}\")\n async def action(action: str, request: Request) -> JSONResponse:\n client_source = self._client_source(request)\n if action in {\"start\", \"stop\"}:\n LOGGER.warning(\"Control action requested: /actions/%s client=%s\", action, client_source)\n return await action_provider(action, client_source)\n\n return app\n\n def _client_source(self, request: Request) -> str:\n explicit_header = request.headers.get(\"X-Client-Source\", \"\").strip()\n if explicit_header:\n return explicit_header\n user_agent = request.headers.get(\"User-Agent\", \"\").strip()\n if user_agent:\n return f\"user-agent:{user_agent}\"\n return \"unknown\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/http_app.py:HttpControlAppFactory", - "span_start": 15, - "span_end": 53, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": null, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.http_app", - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "retrieval_report": { - "executed_layers": [ - "C4_SEMANTIC_ROLES", - "C3_ENTRYPOINTS", - "C2_DEPENDENCY_GRAPH", - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS" - ], - "retrieval_mode_by_layer": { - "C4_SEMANTIC_ROLES": "vector", - "C3_ENTRYPOINTS": "vector", - "C2_DEPENDENCY_GRAPH": "vector", - "C1_SYMBOL_CATALOG": "vector", - "C0_SOURCE_CHUNKS": "vector" - }, - "top_k_by_layer": { - "C4_SEMANTIC_ROLES": 12, - "C3_ENTRYPOINTS": 8, - "C2_DEPENDENCY_GRAPH": 8, - "C1_SYMBOL_CATALOG": 6, - "C0_SOURCE_CHUNKS": 4 - }, - "filters_by_layer": { - "C4_SEMANTIC_ROLES": { - "path_scope": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [] - }, - "C1_SYMBOL_CATALOG": { - "path_scope": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [] - } - }, - "fallback": { - "used": false, - "reason": null - }, - "retrieval_by_layer_ms": { - "C4_SEMANTIC_ROLES": 41, - "C3_ENTRYPOINTS": 25, - "C2_DEPENDENCY_GRAPH": 70, - "C1_SYMBOL_CATALOG": 30, - "C0_SOURCE_CHUNKS": 22 - } - } - }, - "diagnostics": { - "intent_correct": null, - "target_found": true, - "layers_used": [ - "C4_SEMANTIC_ROLES", - "C3_ENTRYPOINTS", - "C2_DEPENDENCY_GRAPH", - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS" - ], - "retrieval_sufficient": true, - "answer_mode": "degraded", - "resolved_target": "RuntimeManager", - "answer_policy_branch": "normal_answer", - "decision_reason": "evidence_sufficient", - "router_result": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "retrieval_profile": "code", - "sub_intent": "ARCHITECTURE", - "path_scope": [], - "layers": [ - "C4_SEMANTIC_ROLES", - "C3_ENTRYPOINTS", - "C2_DEPENDENCY_GRAPH", - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS" - ], - "symbol_resolution_status": "resolved" - }, - "retrieval_request": { - "rag_session_id": "7d11da21-faa0-4cea-aede-aeabe069164c", - "query": "Какие компоненты участвуют в RuntimeManager?", - "sub_intent": "ARCHITECTURE", - "path_scope": [], - "requested_layers": [ - "C4_SEMANTIC_ROLES", - "C3_ENTRYPOINTS", - "C2_DEPENDENCY_GRAPH", - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS" - ] - }, - "per_layer_outcome": [ - { - "layer_id": "C4_SEMANTIC_ROLES", - "hit_count": 12, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C3_ENTRYPOINTS", - "hit_count": 3, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C2_DEPENDENCY_GRAPH", - "hit_count": 8, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C1_SYMBOL_CATALOG", - "hit_count": 6, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C0_SOURCE_CHUNKS", - "hit_count": 4, - "empty": false, - "fallback_used": false - } - ], - "empty_layers": [], - "evidence_gate_decision": { - "sufficient": true, - "failure_reasons": [], - "evidence_count": 33 - }, - "evidence_gate_input": { - "resolved_target": "RuntimeManager", - "sub_intent": "ARCHITECTURE", - "target_type": "symbol", - "evidence_count": 33, - "code_chunk_count": 33, - "entrypoint_count": 3, - "relation_count": 8, - "test_evidence_count": 0, - "symbol_resolution_status": "resolved", - "path_scope": [] - }, - "post_evidence_gate": { - "input": { - "answer_mode": "normal", - "degraded_message": "", - "resolved_target": "RuntimeManager", - "draft_answer_preview": "Компоненты, участвующие в подсистеме RuntimeManager:\n\n- **RuntimeManager** — инициализирует конфигурацию и запускает основные сервисы (методы: `__init__`, `start`, `add_config_file`, `_register_core_services`).\n- **ControlPlaneService** — управляет каналами контроля и асинхронными операциями старта ", - "repair_candidate": true - }, - "output": { - "passed": false, - "action": "repair", - "reasons": [ - "missing_concrete_relations", - "too_vague_for_architecture" - ], - "repair_used": true, - "final_answer_preview": "Недостаточно подтверждённых данных для уверенного ответа по RuntimeManager." - } - }, - "failure_reasons": [], - "timings_ms": { - "router": 1, - "retrieval": 191, - "pre_evidence_gate": 1, - "llm": 6733, - "post_evidence_gate": 1, - "repair": 4344, - "post_evidence_gate_recheck": 1 - } - }, - "rag_rows": [ - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests manager\n- orchestrates role-like calls (4)\n- reads and writes state attributes\n- participates in dataflow slices (50)", - "layer": "C4_SEMANTIC_ROLES", - "title": "RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 43, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "7e4a9381328c5803bbc6179458612fc4e947d928aa7bf8b4b2bebb2c8592f758", - "symbol_name": "RuntimeManager", - "qname": "RuntimeManager", - "role": "pipeline_stage", - "confidence": 0.67, - "dataflow_participation": 50, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "ControlActionSet\nrole: model\n\nResponsibilities:\n- default model role", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlActionSet", - "span_start": 14, - "span_end": 18, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 40, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "46eb026cb3313415ec47b82dd22f84f4d112c9d987e8b1716dcb0baa1cce8988", - "symbol_name": "ControlActionSet", - "qname": "ControlActionSet", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "ControlChannel\nrole: model\n\nResponsibilities:\n- default model role", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlChannel", - "span_start": 21, - "span_end": 28, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 40, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "cfcfe9a311d3a2dbdaf32ac4ccd73c0eb9a117f830591a1c0867ee97d46204ff", - "symbol_name": "ControlChannel", - "qname": "ControlChannel", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests service\n- reads and writes state attributes\n- participates in dataflow slices (5)", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlPlaneService", - "span_start": 12, - "span_end": 52, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 68, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "b13471e5916986dccffb53fab613812842965705e6b3a89ae549d30c9e91e9aa", - "symbol_name": "ControlPlaneService", - "qname": "ControlPlaneService", - "role": "pipeline_stage", - "confidence": 0.57, - "dataflow_participation": 5, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_runner.py", - "content": "UvicornThreadRunner\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (24)", - "layer": "C4_SEMANTIC_ROLES", - "title": "UvicornThreadRunner", - "span_start": 10, - "span_end": 61, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 11, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "fd55630045a02100df8877ac27d951ee08617d4598764394d48cb51fe067476a", - "symbol_name": "UvicornThreadRunner", - "qname": "UvicornThreadRunner", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 24, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "3779fdd2878b770e789a35bb2a89c9d79f13b61c26d7db1b3b683f9bb9e1623f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (10)", - "layer": "C4_SEMANTIC_ROLES", - "title": "HttpControlChannel", - "span_start": 12, - "span_end": 57, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 21, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "1c9fbdc24819e5604c26ea55428a74310f03a03e1af197ed84846af61e42fdb0", - "symbol_name": "HttpControlChannel", - "qname": "HttpControlChannel", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 10, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "HttpControlAppFactory\nrole: factory\n\nResponsibilities:\n- name suffix suggests factory", - "layer": "C4_SEMANTIC_ROLES", - "title": "HttpControlAppFactory", - "span_start": 15, - "span_end": 53, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 39, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "9b3502a5fb408b273223db13264349cf500de24915b6c649d9ea8970d0dfd8e0", - "symbol_name": "HttpControlAppFactory", - "qname": "HttpControlAppFactory", - "role": "factory", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/persistence/workflow_persistence.py", - "content": "WorkflowPersistence\nrole: pipeline_stage\n\nResponsibilities:\n- orchestrates role-like calls (2)\n- reads and writes state attributes\n- participates in dataflow slices (16)", - "layer": "C4_SEMANTIC_ROLES", - "title": "WorkflowPersistence", - "span_start": 8, - "span_end": 54, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 15, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "7bd01ee45cf31f2d5c2e3e51656254860ac785d10cef9e0852cd4fba90857bae", - "symbol_name": "WorkflowPersistence", - "qname": "WorkflowPersistence", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 16, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "80e9410ddc639789b4353c2a1a757ba8d0d5b5bb6075b0b263b61551f04ae1f0", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/queue/in_memory.py", - "content": "InMemoryTaskQueue\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (9)", - "layer": "C4_SEMANTIC_ROLES", - "title": "InMemoryTaskQueue", - "span_start": 9, - "span_end": 38, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 22, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "2da04cb94544a3bcbf0943a95ad4bdd8710bcafaa32a02fd0e4de2178dcf3533", - "symbol_name": "InMemoryTaskQueue", - "qname": "InMemoryTaskQueue", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 9, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "58f0cc001ccda0eee4c6bc32ed83bd05eafd6b6644f1e8b4aa9eed3103db73dc", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/config/file_loader.py", - "content": "ConfigFileLoader\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (8)", - "layer": "C4_SEMANTIC_ROLES", - "title": "ConfigFileLoader", - "span_start": 11, - "span_end": 48, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 23, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "a8474eca8b6e9dc86ae67ed68b16fa5fb639ef08739c053e7b7195489765667f", - "symbol_name": "ConfigFileLoader", - "qname": "ConfigFileLoader", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 8, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "1f19ffebde5e38e4be5a5d5a678059a0f36dedb8fb8b3e00ab395c67106a87ea", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/store.py", - "content": "TraceContextStore\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (6)", - "layer": "C4_SEMANTIC_ROLES", - "title": "TraceContextStore", - "span_start": 15, - "span_end": 52, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 25, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "b2dad4fbe16ffb11b58deba311c7739955c39d59f291b22181f33e9c8cce4059", - "symbol_name": "TraceContextStore", - "qname": "TraceContextStore", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 6, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "d369554f08fc92039c6edd5a2a1e73b23901533e8974459170bbd9347d263dc5", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workers/supervisor.py", - "content": "WorkerSupervisor\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (6)", - "layer": "C4_SEMANTIC_ROLES", - "title": "WorkerSupervisor", - "span_start": 10, - "span_end": 59, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 25, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "c17b44e8d9e97d490989b21fa67d7c346cdda8a0472e4c41fb243c8846faa124", - "symbol_name": "WorkerSupervisor", - "qname": "WorkerSupervisor", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 6, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "77609d9d5927171cce7fc3a54897c183fd63068710c6362029b700937aae5eee", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._start_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 47, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517", - "dst_ref": "ControlPlaneService._start_async", - "resolution": "resolved", - "slice_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._start_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager.start", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 32, - "span_end": 59, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "98312ace7fc62b1c7194c5aa1732b6ef736eae1668a3a120dd1ecd5ab1d64f7a", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "77a7b260193018845e4e204df094ab89cfd7c82ee4e822b3a83ad4cd945f9cb1", - "dst_ref": "RuntimeManager.start", - "resolution": "resolved", - "slice_id": "98312ace7fc62b1c7194c5aa1732b6ef736eae1668a3a120dd1ecd5ab1d64f7a", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager.start" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "77a7b260193018845e4e204df094ab89cfd7c82ee4e822b3a83ad4cd945f9cb1" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.start", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 20, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154", - "dst_ref": "ControlPlaneService.start", - "resolution": "resolved", - "slice_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.start" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.stop", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 25, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d", - "dst_ref": "ControlPlaneService.stop", - "resolution": "resolved", - "slice_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.stop" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._stop_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 51, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a", - "dst_ref": "ControlPlaneService._stop_async", - "resolution": "resolved", - "slice_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._stop_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager.add_config_file", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 32, - "span_end": 52, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "a23b8a11ebdb12708b60c96ea12a69f7f042082f1adfddd572444e246d81d167", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "57ffbd4f0d9fdf3507c2b8624312ce211f3d02fdf86a57a8ec90778d8a7b498d", - "dst_ref": "RuntimeManager.add_config_file", - "resolution": "resolved", - "slice_id": "a23b8a11ebdb12708b60c96ea12a69f7f042082f1adfddd572444e246d81d167", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager.add_config_file" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "57ffbd4f0d9fdf3507c2b8624312ce211f3d02fdf86a57a8ec90778d8a7b498d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.register_channel", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 17, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957", - "dst_ref": "ControlPlaneService.register_channel", - "resolution": "resolved", - "slice_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.register_channel" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager._register_core_services", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 32, - "span_end": 127, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "3e5811f3b511fa0cabe363f5d01f2ac5fa039bc8b93f7ee108323e1f5f45a293", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "972d6057a6caac9cf31ebc1e29c6f39f71b10d4cc170dec57cf875ba458549c6", - "dst_ref": "RuntimeManager._register_core_services", - "resolution": "resolved", - "slice_id": "3e5811f3b511fa0cabe363f5d01f2ac5fa039bc8b93f7ee108323e1f5f45a293", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager._register_core_services" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "972d6057a6caac9cf31ebc1e29c6f39f71b10d4cc170dec57cf875ba458549c6" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/__init__.py", - "content": "const RuntimeManager\nRuntimeManager = plba.core.RuntimeManager", - "layer": "C1_SYMBOL_CATALOG", - "title": "RuntimeManager", - "span_start": 16, - "span_end": 16, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "7eacec84f9b8d6c4201374591faecdac7493091c263681495c338973f2971ad9", - "qname": "RuntimeManager", - "kind": "const", - "signature": "RuntimeManager = plba.core.RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "src.plba.__init__", - "is_test": false, - "blob_sha": "24e755ec8c249d14fb0e675b5dbf2b71ab91afb9c849897eebfa9feb2499e19d", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/core.py", - "content": "const RuntimeManager\nRuntimeManager = app_runtime.core.runtime.RuntimeManager", - "layer": "C1_SYMBOL_CATALOG", - "title": "RuntimeManager", - "span_start": 2, - "span_end": 2, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "e1684562d978b7af7fe9b27dc5869d770348a87b5dc19a50360f58544668578b", - "qname": "RuntimeManager", - "kind": "const", - "signature": "RuntimeManager = app_runtime.core.runtime.RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "src.plba.core", - "is_test": false, - "blob_sha": "c0ae25110d20e665216616e26b68adfe035b624ba45d31d1272fb21f906f9ca8", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "const RuntimeManager\nRuntimeManager = app_runtime.core.runtime.RuntimeManager", - "layer": "C1_SYMBOL_CATALOG", - "title": "RuntimeManager", - "span_start": 9, - "span_end": 9, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "62a9575c77aad894120d18b4f2a08cf2ba42f77e9be4a8a432b767d157701afe", - "qname": "RuntimeManager", - "kind": "const", - "signature": "RuntimeManager = app_runtime.core.runtime.RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.control.service", - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "class RuntimeManager\nRuntimeManager", - "layer": "C1_SYMBOL_CATALOG", - "title": "RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "7e4a9381328c5803bbc6179458612fc4e947d928aa7bf8b4b2bebb2c8592f758", - "qname": "RuntimeManager", - "kind": "class", - "signature": "RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.core.runtime", - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/bootstrap.py", - "content": "const RuntimeManager\nRuntimeManager = app_runtime.core.runtime.RuntimeManager", - "layer": "C1_SYMBOL_CATALOG", - "title": "RuntimeManager", - "span_start": 4, - "span_end": 4, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "27158ca220022eeb5083c6addf8a50775d45f7161284fd60aac48410105f4b98", - "qname": "RuntimeManager", - "kind": "const", - "signature": "RuntimeManager = app_runtime.core.runtime.RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "src.plba.bootstrap", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/__init__.py", - "content": "const ControlChannel\nControlChannel = app_runtime.control.base.ControlChannel", - "layer": "C1_SYMBOL_CATALOG", - "title": "ControlChannel", - "span_start": 1, - "span_end": 1, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "268420f7aa4ed74082b9276cae0cded4f00bac090ffd58fa020a65be0fe19c27", - "qname": "ControlChannel", - "kind": "const", - "signature": "ControlChannel = app_runtime.control.base.ControlChannel", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.control.__init__", - "is_test": false, - "blob_sha": "bf3c37e3369a84cc618adc0fd71c232e5eb4b871eaff743069a17e661e498316", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "class ControlChannel(ABC):\n @abstractmethod\n async def start(self, actions: ControlActionSet) -> None:\n \"\"\"Start the control channel and bind handlers.\"\"\"\n\n @abstractmethod\n async def stop(self) -> None:\n \"\"\"Stop the control channel and release resources.\"\"\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/base.py:ControlChannel", - "span_start": 21, - "span_end": 28, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 1, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.base", - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/__init__.py", - "content": "from app_runtime.control.base import ControlActionSet, ControlChannel\nfrom app_runtime.control.http_channel import HttpControlChannel\nfrom app_runtime.control.service import ControlPlaneService\n\n__all__ = [\"ControlActionSet\", \"ControlChannel\", \"ControlPlaneService\", \"HttpControlChannel\"]", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/__init__.py:1-5", - "span_start": 1, - "span_end": 5, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.app_runtime.control.__init__", - "is_test": false, - "blob_sha": "bf3c37e3369a84cc618adc0fd71c232e5eb4b871eaff743069a17e661e498316", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "class ControlActionSet:\n health: HealthHandler\n start: ActionHandler\n stop: ActionHandler\n status: ActionHandler", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/base.py:ControlActionSet", - "span_start": 14, - "span_end": 18, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.base", - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "class HttpControlAppFactory:\n def create(\n self,\n health_provider: Callable[[], Awaitable[HealthPayload]],\n action_provider: Callable[[str, str], Awaitable[JSONResponse]],\n ) -> FastAPI:\n app = FastAPI(title=\"PLBA Control API\")\n\n @app.middleware(\"http\")\n async def log_api_call(request: Request, call_next): # type: ignore[no-untyped-def]\n started = time.monotonic()\n response = await call_next(request)\n response.headers[\"X-Response-Time-Ms\"] = str(int((time.monotonic() - started) * 1000))\n return response\n\n @app.get(\"/health\")\n async def health() -> JSONResponse:\n payload = await health_provider()\n status_code = 200 if payload.get(\"status\") == \"ok\" else 503\n return JSONResponse(content=payload, status_code=status_code)\n\n @app.get(\"/actions/{action}\")\n @app.post(\"/actions/{action}\")\n async def action(action: str, request: Request) -> JSONResponse:\n client_source = self._client_source(request)\n if action in {\"start\", \"stop\"}:\n LOGGER.warning(\"Control action requested: /actions/%s client=%s\", action, client_source)\n return await action_provider(action, client_source)\n\n return app\n\n def _client_source(self, request: Request) -> str:\n explicit_header = request.headers.get(\"X-Client-Source\", \"\").strip()\n if explicit_header:\n return explicit_header\n user_agent = request.headers.get(\"User-Agent\", \"\").strip()\n if user_agent:\n return f\"user-agent:{user_agent}\"\n return \"unknown\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/http_app.py:HttpControlAppFactory", - "span_start": 15, - "span_end": 53, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.http_app", - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "validation": { - "passed": false, - "action": "repair", - "reasons": [ - "missing_concrete_relations", - "too_vague_for_architecture" - ] - }, - "steps": [ - { - "step": "router", - "status": "completed", - "timings_ms": { - "router": 1 - }, - "output": { - "intent": "CODE_QA", - "sub_intent": "ARCHITECTURE", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - } - }, - { - "step": "retrieval", - "status": "completed", - "timings_ms": { - "retrieval": 191 - }, - "output": { - "rag_count": 33, - "answer_path_rag_count": 33, - "resolved_symbol_status": "resolved", - "resolved_symbol": "RuntimeManager", - "requested_layers": [ - "C4_SEMANTIC_ROLES", - "C3_ENTRYPOINTS", - "C2_DEPENDENCY_GRAPH", - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS" - ] - }, - "diagnostics": { - "executed_layers": [ - "C4_SEMANTIC_ROLES", - "C3_ENTRYPOINTS", - "C2_DEPENDENCY_GRAPH", - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS" - ], - "retrieval_mode_by_layer": { - "C4_SEMANTIC_ROLES": "vector", - "C3_ENTRYPOINTS": "vector", - "C2_DEPENDENCY_GRAPH": "vector", - "C1_SYMBOL_CATALOG": "vector", - "C0_SOURCE_CHUNKS": "vector" - }, - "top_k_by_layer": { - "C4_SEMANTIC_ROLES": 12, - "C3_ENTRYPOINTS": 8, - "C2_DEPENDENCY_GRAPH": 8, - "C1_SYMBOL_CATALOG": 6, - "C0_SOURCE_CHUNKS": 4 - }, - "filters_by_layer": { - "C4_SEMANTIC_ROLES": { - "path_scope": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [] - }, - "C1_SYMBOL_CATALOG": { - "path_scope": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [] - } - }, - "fallback": { - "used": false, - "reason": null - }, - "retrieval_by_layer_ms": { - "C4_SEMANTIC_ROLES": 41, - "C3_ENTRYPOINTS": 25, - "C2_DEPENDENCY_GRAPH": 70, - "C1_SYMBOL_CATALOG": 30, - "C0_SOURCE_CHUNKS": 22 - } - } - }, - { - "step": "pre_evidence_gate", - "status": "passed", - "timings_ms": { - "pre_evidence_gate": 1 - }, - "input": { - "resolved_target": "RuntimeManager", - "sub_intent": "ARCHITECTURE", - "target_type": "symbol", - "evidence_count": 33, - "code_chunk_count": 33, - "entrypoint_count": 3, - "relation_count": 8, - "test_evidence_count": 0, - "symbol_resolution_status": "resolved", - "path_scope": [] - }, - "output": { - "passed": true, - "failure_reasons": [], - "degraded_message": "", - "evidence_count": 33 - } - }, - { - "step": "llm", - "status": "completed", - "timings_ms": { - "llm": 6733 - }, - "output": { - "prompt_name": "code_qa_architecture_answer", - "answer_preview": "Компоненты, участвующие в подсистеме RuntimeManager:\n\n- **RuntimeManager** — инициализирует конфигурацию и запускает основные сервисы (методы: `__init__`, `start`, `add_config_file`, `_register_core_services`).\n- **ControlPlaneService** — управляет каналами контроля и асинхронными операциями старта ", - "resolved_target": "RuntimeManager", - "answer_policy_branch": "normal_answer", - "decision_reason": "evidence_sufficient" - } - }, - { - "step": "post_evidence_gate", - "status": "failed", - "timings_ms": { - "post_evidence_gate": 1, - "post_evidence_gate_recheck": 1, - "repair": 4344 - }, - "input": { - "answer_mode": "normal", - "degraded_message": "", - "resolved_target": "RuntimeManager", - "draft_answer_preview": "Компоненты, участвующие в подсистеме RuntimeManager:\n\n- **RuntimeManager** — инициализирует конфигурацию и запускает основные сервисы (методы: `__init__`, `start`, `add_config_file`, `_register_core_services`).\n- **ControlPlaneService** — управляет каналами контроля и асинхронными операциями старта ", - "repair_candidate": true - }, - "output": { - "passed": false, - "action": "repair", - "reasons": [ - "missing_concrete_relations", - "too_vague_for_architecture" - ], - "repair_used": true, - "final_answer_preview": "Недостаточно подтверждённых данных для уверенного ответа по RuntimeManager." - } - } - ] - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/plba_full_chain_subintents_v3/20260312_192715/full_chain_plba_code_subintents_v2_plba-v2-architecture-runtime-manager.md b/tests/pipeline_setup_v3/test_results/plba_full_chain_subintents_v3/20260312_192715/full_chain_plba_code_subintents_v2_plba-v2-architecture-runtime-manager.md deleted file mode 100644 index 1046850..0000000 --- a/tests/pipeline_setup_v3/test_results/plba_full_chain_subintents_v3/20260312_192715/full_chain_plba_code_subintents_v2_plba-v2-architecture-runtime-manager.md +++ /dev/null @@ -1,313 +0,0 @@ -# plba-v2-architecture-runtime-manager - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_02_pipeline/full_chain_plba_code_subintents_v2.yaml -- runner: agent_runtime -- mode: full_chain -- passed: True - -## Query -Какие компоненты участвуют в RuntimeManager? - -## Actual -{ - "intent": "CODE_QA", - "sub_intent": "ARCHITECTURE", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 33, - "llm_answer": "Недостаточно подтверждённых данных для уверенного ответа по RuntimeManager.", - "answer_mode": "degraded", - "path_scope": [], - "symbol_candidates": [ - "RuntimeManager" - ], - "layers": [ - "C4_SEMANTIC_ROLES", - "C3_ENTRYPOINTS", - "C2_DEPENDENCY_GRAPH", - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS" - ] -} - -## Steps -[ - { - "step": "router", - "status": "completed", - "timings_ms": { - "router": 1 - }, - "output": { - "intent": "CODE_QA", - "sub_intent": "ARCHITECTURE", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - } - }, - { - "step": "retrieval", - "status": "completed", - "timings_ms": { - "retrieval": 191 - }, - "output": { - "rag_count": 33, - "answer_path_rag_count": 33, - "resolved_symbol_status": "resolved", - "resolved_symbol": "RuntimeManager", - "requested_layers": [ - "C4_SEMANTIC_ROLES", - "C3_ENTRYPOINTS", - "C2_DEPENDENCY_GRAPH", - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS" - ] - }, - "diagnostics": { - "executed_layers": [ - "C4_SEMANTIC_ROLES", - "C3_ENTRYPOINTS", - "C2_DEPENDENCY_GRAPH", - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS" - ], - "retrieval_mode_by_layer": { - "C4_SEMANTIC_ROLES": "vector", - "C3_ENTRYPOINTS": "vector", - "C2_DEPENDENCY_GRAPH": "vector", - "C1_SYMBOL_CATALOG": "vector", - "C0_SOURCE_CHUNKS": "vector" - }, - "top_k_by_layer": { - "C4_SEMANTIC_ROLES": 12, - "C3_ENTRYPOINTS": 8, - "C2_DEPENDENCY_GRAPH": 8, - "C1_SYMBOL_CATALOG": 6, - "C0_SOURCE_CHUNKS": 4 - }, - "filters_by_layer": { - "C4_SEMANTIC_ROLES": { - "path_scope": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [] - }, - "C1_SYMBOL_CATALOG": { - "path_scope": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [] - } - }, - "fallback": { - "used": false, - "reason": null - }, - "retrieval_by_layer_ms": { - "C4_SEMANTIC_ROLES": 41, - "C3_ENTRYPOINTS": 25, - "C2_DEPENDENCY_GRAPH": 70, - "C1_SYMBOL_CATALOG": 30, - "C0_SOURCE_CHUNKS": 22 - } - } - }, - { - "step": "pre_evidence_gate", - "status": "passed", - "timings_ms": { - "pre_evidence_gate": 1 - }, - "input": { - "resolved_target": "RuntimeManager", - "sub_intent": "ARCHITECTURE", - "target_type": "symbol", - "evidence_count": 33, - "code_chunk_count": 33, - "entrypoint_count": 3, - "relation_count": 8, - "test_evidence_count": 0, - "symbol_resolution_status": "resolved", - "path_scope": [] - }, - "output": { - "passed": true, - "failure_reasons": [], - "degraded_message": "", - "evidence_count": 33 - } - }, - { - "step": "llm", - "status": "completed", - "timings_ms": { - "llm": 6733 - }, - "output": { - "prompt_name": "code_qa_architecture_answer", - "answer_preview": "Компоненты, участвующие в подсистеме RuntimeManager:\n\n- **RuntimeManager** — инициализирует конфигурацию и запускает основные сервисы (методы: `__init__`, `start`, `add_config_file`, `_register_core_services`).\n- **ControlPlaneService** — управляет каналами контроля и асинхронными операциями старта ", - "resolved_target": "RuntimeManager", - "answer_policy_branch": "normal_answer", - "decision_reason": "evidence_sufficient" - } - }, - { - "step": "post_evidence_gate", - "status": "failed", - "timings_ms": { - "post_evidence_gate": 1, - "post_evidence_gate_recheck": 1, - "repair": 4344 - }, - "input": { - "answer_mode": "normal", - "degraded_message": "", - "resolved_target": "RuntimeManager", - "draft_answer_preview": "Компоненты, участвующие в подсистеме RuntimeManager:\n\n- **RuntimeManager** — инициализирует конфигурацию и запускает основные сервисы (методы: `__init__`, `start`, `add_config_file`, `_register_core_services`).\n- **ControlPlaneService** — управляет каналами контроля и асинхронными операциями старта ", - "repair_candidate": true - }, - "output": { - "passed": false, - "action": "repair", - "reasons": [ - "missing_concrete_relations", - "too_vague_for_architecture" - ], - "repair_used": true, - "final_answer_preview": "Недостаточно подтверждённых данных для уверенного ответа по RuntimeManager." - } - } -] - -## Diagnostics -{ - "intent_correct": null, - "target_found": true, - "layers_used": [ - "C4_SEMANTIC_ROLES", - "C3_ENTRYPOINTS", - "C2_DEPENDENCY_GRAPH", - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS" - ], - "retrieval_sufficient": true, - "answer_mode": "degraded", - "resolved_target": "RuntimeManager", - "answer_policy_branch": "normal_answer", - "decision_reason": "evidence_sufficient", - "router_result": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "retrieval_profile": "code", - "sub_intent": "ARCHITECTURE", - "path_scope": [], - "layers": [ - "C4_SEMANTIC_ROLES", - "C3_ENTRYPOINTS", - "C2_DEPENDENCY_GRAPH", - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS" - ], - "symbol_resolution_status": "resolved" - }, - "retrieval_request": { - "rag_session_id": "7d11da21-faa0-4cea-aede-aeabe069164c", - "query": "Какие компоненты участвуют в RuntimeManager?", - "sub_intent": "ARCHITECTURE", - "path_scope": [], - "requested_layers": [ - "C4_SEMANTIC_ROLES", - "C3_ENTRYPOINTS", - "C2_DEPENDENCY_GRAPH", - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS" - ] - }, - "per_layer_outcome": [ - { - "layer_id": "C4_SEMANTIC_ROLES", - "hit_count": 12, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C3_ENTRYPOINTS", - "hit_count": 3, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C2_DEPENDENCY_GRAPH", - "hit_count": 8, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C1_SYMBOL_CATALOG", - "hit_count": 6, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C0_SOURCE_CHUNKS", - "hit_count": 4, - "empty": false, - "fallback_used": false - } - ], - "empty_layers": [], - "evidence_gate_decision": { - "sufficient": true, - "failure_reasons": [], - "evidence_count": 33 - }, - "evidence_gate_input": { - "resolved_target": "RuntimeManager", - "sub_intent": "ARCHITECTURE", - "target_type": "symbol", - "evidence_count": 33, - "code_chunk_count": 33, - "entrypoint_count": 3, - "relation_count": 8, - "test_evidence_count": 0, - "symbol_resolution_status": "resolved", - "path_scope": [] - }, - "post_evidence_gate": { - "input": { - "answer_mode": "normal", - "degraded_message": "", - "resolved_target": "RuntimeManager", - "draft_answer_preview": "Компоненты, участвующие в подсистеме RuntimeManager:\n\n- **RuntimeManager** — инициализирует конфигурацию и запускает основные сервисы (методы: `__init__`, `start`, `add_config_file`, `_register_core_services`).\n- **ControlPlaneService** — управляет каналами контроля и асинхронными операциями старта ", - "repair_candidate": true - }, - "output": { - "passed": false, - "action": "repair", - "reasons": [ - "missing_concrete_relations", - "too_vague_for_architecture" - ], - "repair_used": true, - "final_answer_preview": "Недостаточно подтверждённых данных для уверенного ответа по RuntimeManager." - } - }, - "failure_reasons": [], - "timings_ms": { - "router": 1, - "retrieval": 191, - "pre_evidence_gate": 1, - "llm": 6733, - "post_evidence_gate": 1, - "repair": 4344, - "post_evidence_gate_recheck": 1 - } -} - -## Mismatches -- none \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/plba_full_chain_subintents_v3/20260312_192715/full_chain_plba_code_subintents_v2_plba-v2-explain-create-runtime.json b/tests/pipeline_setup_v3/test_results/plba_full_chain_subintents_v3/20260312_192715/full_chain_plba_code_subintents_v2_plba-v2-explain-create-runtime.json deleted file mode 100644 index befe75f..0000000 --- a/tests/pipeline_setup_v3/test_results/plba_full_chain_subintents_v3/20260312_192715/full_chain_plba_code_subintents_v2_plba-v2-explain-create-runtime.json +++ /dev/null @@ -1,4085 +0,0 @@ -{ - "case_id": "plba-v2-explain-create-runtime", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_02_pipeline/full_chain_plba_code_subintents_v2.yaml", - "runner": "agent_runtime", - "mode": "full_chain", - "query": "Что делает функция create_runtime?", - "actual": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 33, - "llm_answer": "Функция `create_runtime` определена в файле `src/plba/bootstrap.py`. Она создаёт и конфигурирует экземпляр `RuntimeManager`, регистрируя модуль приложения и опционально добавляя файл конфигурации и HTTP-канал управления.\n\nОсновные действия функции:\n- Создаёт экземпляр `RuntimeManager`.\n- Если передан путь к конфигурационному файлу, вызывает `runtime.add_config_file(config_path)` для добавления конфигурации.\n- Если включён HTTP-контроль, регистрирует HTTP-канал управления через `runtime.control_plane.register_channel(HttpControlChannel(host=control_host, port=control_port, timeout=control_timeout))`.\n- Регистрирует модуль приложения методом `runtime.register_module(module)`.\n\nВозвращает сконфигурированный объект типа `RuntimeManager`.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "create_runtime" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "passed": true, - "mismatches": [], - "details": { - "query": "Что делает функция create_runtime?", - "router_result": { - "schema_version": "1.1", - "intent": "CODE_QA", - "retrieval_profile": "code", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query_plan": { - "raw": "Что делает функция create_runtime?", - "normalized": "Что делает функция create_runtime?", - "sub_intent": "EXPLAIN", - "negations": [], - "expansions": [ - "function", - "create_runtime" - ], - "keyword_hints": [ - "create_runtime" - ], - "path_hints": [], - "doc_scope_hints": [], - "symbol_candidates": [ - "create_runtime" - ], - "symbol_kind_hint": "function", - "anchors": [ - { - "type": "SYMBOL", - "value": "create_runtime", - "source": "user_text", - "subtype": null, - "span": { - "start": 19, - "end": 33 - }, - "confidence": 0.88 - }, - { - "type": "KEY_TERM", - "value": "функция", - "source": "user_text", - "subtype": null, - "span": { - "start": 11, - "end": 18 - }, - "confidence": 0.9 - } - ] - }, - "retrieval_spec": { - "domains": [ - "CODE" - ], - "layer_queries": [ - { - "layer_id": "C1_SYMBOL_CATALOG", - "top_k": 8 - }, - { - "layer_id": "C0_SOURCE_CHUNKS", - "top_k": 8 - }, - { - "layer_id": "C4_SEMANTIC_ROLES", - "top_k": 8 - }, - { - "layer_id": "C2_DEPENDENCY_GRAPH", - "top_k": 6 - }, - { - "layer_id": "C3_ENTRYPOINTS", - "top_k": 6 - } - ], - "filters": { - "test_policy": "EXCLUDE", - "path_scope": [], - "language": [ - "python" - ] - }, - "rerank_profile": "code" - }, - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - }, - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "create_runtime", - "alternatives": [ - "create_runtime", - "create_runtime", - "annotations", - "json", - "Path" - ], - "confidence": 0.99 - }, - "evidence_policy": { - "require_def": true, - "require_flow": true, - "require_spec": false, - "allow_answer_without_evidence": false - } - }, - "retrieval_request": { - "rag_session_id": "7d11da21-faa0-4cea-aede-aeabe069164c", - "query": "Что делает функция create_runtime?", - "sub_intent": "EXPLAIN", - "path_scope": [], - "keyword_hints": [ - "create_runtime" - ], - "symbol_candidates": [ - "create_runtime" - ], - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_spec": { - "domains": [ - "CODE" - ], - "layer_queries": [ - { - "layer_id": "C1_SYMBOL_CATALOG", - "top_k": 8 - }, - { - "layer_id": "C0_SOURCE_CHUNKS", - "top_k": 8 - }, - { - "layer_id": "C4_SEMANTIC_ROLES", - "top_k": 8 - }, - { - "layer_id": "C2_DEPENDENCY_GRAPH", - "top_k": 6 - }, - { - "layer_id": "C3_ENTRYPOINTS", - "top_k": 6 - } - ], - "filters": { - "test_policy": "EXCLUDE", - "path_scope": [], - "language": [ - "python" - ] - }, - "rerank_profile": "code" - }, - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - }, - "query_plan": { - "raw": "Что делает функция create_runtime?", - "normalized": "Что делает функция create_runtime?", - "sub_intent": "EXPLAIN", - "negations": [], - "expansions": [ - "function", - "create_runtime" - ], - "keyword_hints": [ - "create_runtime" - ], - "path_hints": [], - "doc_scope_hints": [], - "symbol_candidates": [ - "create_runtime" - ], - "symbol_kind_hint": "function", - "anchors": [ - { - "type": "SYMBOL", - "value": "create_runtime", - "source": "user_text", - "subtype": null, - "span": { - "start": 19, - "end": 33 - }, - "confidence": 0.88 - }, - { - "type": "KEY_TERM", - "value": "функция", - "source": "user_text", - "subtype": null, - "span": { - "start": 11, - "end": 18 - }, - "confidence": 0.9 - } - ] - } - }, - "retrieval_result": { - "target_symbol_candidates": [ - "create_runtime", - "annotations", - "json", - "Path", - "Any", - "yaml", - "hashlib" - ], - "resolved_symbol": "create_runtime", - "symbol_resolution_status": "resolved", - "file_candidates": [ - "src/plba/__init__.py", - "src/plba/bootstrap.py", - "src/app_runtime/config/file_loader.py", - "src/app_runtime/config/__init__.py", - "src/app_runtime/config/providers.py", - "src/app_runtime/contracts/__init__.py", - "src/app_runtime/contracts/application.py", - "src/app_runtime/__init__.py", - "src/app_runtime/control/http_runner.py", - "src/app_runtime/workflow/persistence/workflow_persistence.py", - "src/app_runtime/control/http_channel.py", - "src/app_runtime/queue/in_memory.py", - "src/app_runtime/workers/supervisor.py", - "src/app_runtime/workflow/engine/workflow_engine.py", - "src/app_runtime/tracing/store.py", - "src/app_runtime/control/http_app.py" - ], - "code_chunks": [ - { - "layer": "C1_SYMBOL_CATALOG", - "path": "src/plba/__init__.py", - "title": "create_runtime", - "content": "const create_runtime\ncreate_runtime = plba.bootstrap.create_runtime", - "start_line": 1, - "end_line": 1, - "metadata": { - "symbol_id": "fa1e84f16c8c659bcd5448637386af4d15d431064e07714e34689ee64233cb51", - "qname": "create_runtime", - "kind": "const", - "signature": "create_runtime = plba.bootstrap.create_runtime", - "parent_symbol_id": null, - "package_or_module": "src.plba.__init__", - "is_test": false, - "blob_sha": "24e755ec8c249d14fb0e675b5dbf2b71ab91afb9c849897eebfa9feb2499e19d", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C1_SYMBOL_CATALOG", - "path": "src/plba/bootstrap.py", - "title": "create_runtime", - "content": "function create_runtime\ncreate_runtime(module)", - "start_line": 8, - "end_line": 29, - "metadata": { - "symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "qname": "create_runtime", - "kind": "function", - "signature": "create_runtime(module)", - "parent_symbol_id": null, - "package_or_module": "src.plba.bootstrap", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C1_SYMBOL_CATALOG", - "path": "src/app_runtime/config/file_loader.py", - "title": "annotations", - "content": "const annotations\nannotations = __future__.annotations", - "start_line": 1, - "end_line": 1, - "metadata": { - "symbol_id": "5ed640ccec43a78659d50ec24f3717bf1144a182c22588f37456649ac6a4a815", - "qname": "annotations", - "kind": "const", - "signature": "annotations = __future__.annotations", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.config.file_loader", - "is_test": false, - "blob_sha": "1f19ffebde5e38e4be5a5d5a678059a0f36dedb8fb8b3e00ab395c67106a87ea", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C1_SYMBOL_CATALOG", - "path": "src/app_runtime/config/file_loader.py", - "title": "json", - "content": "const json\nimport json", - "start_line": 4, - "end_line": 4, - "metadata": { - "symbol_id": "bb9e2eaf992bfd050f7072d72eed87c55b1a4b001daa034a0f7c630a61bb1d78", - "qname": "json", - "kind": "const", - "signature": "import json", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.config.file_loader", - "is_test": false, - "blob_sha": "1f19ffebde5e38e4be5a5d5a678059a0f36dedb8fb8b3e00ab395c67106a87ea", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C1_SYMBOL_CATALOG", - "path": "src/app_runtime/config/file_loader.py", - "title": "Path", - "content": "const Path\nPath = pathlib.Path", - "start_line": 5, - "end_line": 5, - "metadata": { - "symbol_id": "b785967ed1fb83aa62d5724c6d6e9c6d2b1505523db39bd941cc39b48db48306", - "qname": "Path", - "kind": "const", - "signature": "Path = pathlib.Path", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.config.file_loader", - "is_test": false, - "blob_sha": "1f19ffebde5e38e4be5a5d5a678059a0f36dedb8fb8b3e00ab395c67106a87ea", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C1_SYMBOL_CATALOG", - "path": "src/app_runtime/config/file_loader.py", - "title": "Any", - "content": "const Any\nAny = typing.Any", - "start_line": 6, - "end_line": 6, - "metadata": { - "symbol_id": "8e330833b8073585db1c4b4315947c400683a23e4c3d2e2ccbcb260f347541b6", - "qname": "Any", - "kind": "const", - "signature": "Any = typing.Any", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.config.file_loader", - "is_test": false, - "blob_sha": "1f19ffebde5e38e4be5a5d5a678059a0f36dedb8fb8b3e00ab395c67106a87ea", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C1_SYMBOL_CATALOG", - "path": "src/app_runtime/config/file_loader.py", - "title": "yaml", - "content": "const yaml\nimport yaml", - "start_line": 8, - "end_line": 8, - "metadata": { - "symbol_id": "223502bbfc2b82aea662f7466403cc99a3cd44f1b0507d637cd674874f751e4f", - "qname": "yaml", - "kind": "const", - "signature": "import yaml", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.config.file_loader", - "is_test": false, - "blob_sha": "1f19ffebde5e38e4be5a5d5a678059a0f36dedb8fb8b3e00ab395c67106a87ea", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C1_SYMBOL_CATALOG", - "path": "src/app_runtime/config/file_loader.py", - "title": "hashlib", - "content": "const hashlib\nimport hashlib", - "start_line": 3, - "end_line": 3, - "metadata": { - "symbol_id": "e7375824bd473da3d73d316d22e3cb6428930e2db1ffbd900ce5a8b88427bf05", - "qname": "hashlib", - "kind": "const", - "signature": "import hashlib", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.config.file_loader", - "is_test": false, - "blob_sha": "1f19ffebde5e38e4be5a5d5a678059a0f36dedb8fb8b3e00ab395c67106a87ea", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C0_SOURCE_CHUNKS", - "path": "src/plba/__init__.py", - "title": "src/plba/__init__.py:1-69", - "content": "from plba.bootstrap import create_runtime\nfrom plba.config import ConfigFileLoader, FileConfigProvider\nfrom plba.control import ControlActionSet, ControlChannel, ControlPlaneService, HttpControlChannel\nfrom plba.contracts import (\n ApplicationModule,\n ConfigProvider,\n HealthContributor,\n TraceContext,\n TraceContextRecord,\n TraceLogMessage,\n TraceTransport,\n Worker,\n WorkerHealth,\n WorkerStatus,\n)\nfrom plba.core import ConfigurationManager, RuntimeManager, ServiceContainer\nfrom plba.health import HealthRegistry\nfrom plba.logging import LogManager\nfrom plba.queue import InMemoryTaskQueue\nfrom plba.tracing import MySqlTraceTransport, NoOpTraceTransport, TraceService\nfrom plba.workflow import (\n StepResult,\n WorkflowContext,\n WorkflowDefinition,\n WorkflowEngine,\n WorkflowEngineHooks,\n WorkflowNode,\n WorkflowRuntimeFactory,\n WorkflowStep,\n)\nfrom plba.workers import WorkerSupervisor\n\n__all__ = [\n \"ApplicationModule\",\n \"ConfigFileLoader\",\n \"ConfigProvider\",\n \"ConfigurationManager\",\n \"ControlActionSet\",\n \"ControlChannel\",\n \"ControlPlaneService\",\n \"create_runtime\",\n \"FileConfigProvider\",\n \"HealthContributor\",\n \"HealthRegistry\",\n \"HttpControlChannel\",\n \"InMemoryTaskQueue\",\n \"LogManager\",\n \"MySqlTraceTransport\",\n \"NoOpTraceTransport\",\n \"RuntimeManager\",\n \"ServiceContainer\",\n \"TraceContext\",\n \"TraceContextRecord\",\n \"TraceLogMessage\",\n \"TraceService\",\n \"TraceTransport\",\n \"StepResult\",\n \"Worker\",\n \"WorkerHealth\",\n \"WorkerStatus\",\n \"WorkflowContext\",\n \"WorkflowDefinition\",\n \"WorkflowEngine\",\n \"WorkflowEngineHooks\",\n \"WorkflowNode\",\n \"WorkflowRuntimeFactory\",\n \"WorkflowStep\",\n \"WorkerSupervisor\",\n]", - "start_line": 1, - "end_line": 69, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.plba.__init__", - "is_test": false, - "blob_sha": "24e755ec8c249d14fb0e675b5dbf2b71ab91afb9c849897eebfa9feb2499e19d", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C0_SOURCE_CHUNKS", - "path": "src/plba/bootstrap.py", - "title": "src/plba/bootstrap.py:create_runtime", - "content": "def create_runtime(\n module: ApplicationModule,\n *,\n config_path: str | None = None,\n enable_http_control: bool = False,\n control_host: str = \"127.0.0.1\",\n control_port: int = 8080,\n control_timeout: int = 5,\n) -> RuntimeManager:\n runtime = RuntimeManager()\n if config_path is not None:\n runtime.add_config_file(config_path)\n if enable_http_control:\n runtime.control_plane.register_channel(\n HttpControlChannel(\n host=control_host,\n port=control_port,\n timeout=control_timeout,\n )\n )\n runtime.register_module(module)\n return runtime", - "start_line": 8, - "end_line": 29, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.plba.bootstrap", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C0_SOURCE_CHUNKS", - "path": "src/app_runtime/config/__init__.py", - "title": "src/app_runtime/config/__init__.py:1-4", - "content": "from app_runtime.config.file_loader import ConfigFileLoader\nfrom app_runtime.config.providers import FileConfigProvider\n\n__all__ = [\"ConfigFileLoader\", \"FileConfigProvider\"]", - "start_line": 1, - "end_line": 4, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.app_runtime.config.__init__", - "is_test": false, - "blob_sha": "612918029820a2a983330ec92256142b55b9de4bdf3399ece18e2a02dbad9729", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C0_SOURCE_CHUNKS", - "path": "src/app_runtime/config/file_loader.py", - "title": "src/app_runtime/config/file_loader.py:ConfigFileLoader", - "content": "class ConfigFileLoader:\n def __init__(self, path: str | Path) -> None:\n self.path = Path(path)\n self.config: Any = None\n self.last_valid_config: Any = None\n self._last_seen_hash: str | None = None\n\n def read_text(self) -> str:\n return self.path.read_text(encoding=\"utf-8\")\n\n def parse(self, data: str) -> Any:\n suffix = self.path.suffix.lower()\n if suffix in {\".yml\", \".yaml\"}:\n return yaml.safe_load(data)\n return json.loads(data)\n\n def load_sync(self) -> Any:\n data = self.read_text()\n parsed = self.parse(data)\n self.config = parsed\n self.last_valid_config = parsed\n self._last_seen_hash = self._calculate_hash(data)\n return parsed\n\n def load_if_changed(self) -> tuple[bool, Any]:\n data = self.read_text()\n current_hash = self._calculate_hash(data)\n if current_hash == self._last_seen_hash:\n return False, self.config\n parsed = self.parse(data)\n self.config = parsed\n self.last_valid_config = parsed\n self._last_seen_hash = current_hash\n return True, parsed\n\n @staticmethod\n def _calculate_hash(data: str) -> str:\n return hashlib.sha256(data.encode(\"utf-8\")).hexdigest()", - "start_line": 11, - "end_line": 48, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.config.file_loader", - "is_test": false, - "blob_sha": "1f19ffebde5e38e4be5a5d5a678059a0f36dedb8fb8b3e00ab395c67106a87ea", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C0_SOURCE_CHUNKS", - "path": "src/app_runtime/config/providers.py", - "title": "src/app_runtime/config/providers.py:FileConfigProvider", - "content": "class FileConfigProvider(ConfigProvider):\n def __init__(self, path: str | Path) -> None:\n self._loader = ConfigFileLoader(path)\n\n @property\n def loader(self) -> ConfigFileLoader:\n return self._loader\n\n def load(self) -> dict[str, Any]:\n config = self._loader.load_sync()\n if not isinstance(config, dict):\n raise TypeError(\"Config root must be a mapping\")\n return dict(config)", - "start_line": 10, - "end_line": 22, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.config.providers", - "is_test": false, - "blob_sha": "8c53ca0122d6df6c5763bca15e99434bb4daebd5a618b8fc927e9ae90b022e64", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C0_SOURCE_CHUNKS", - "path": "src/app_runtime/contracts/__init__.py", - "title": "src/app_runtime/__init__.py:1-1", - "content": "__all__: list[str] = []", - "start_line": 1, - "end_line": 1, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.app_runtime.__init__", - "is_test": false, - "blob_sha": "8eea9df4f6d7b38ca0e39ccc27b04700e3d08dbeec8046d613d22706d19985fa", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C0_SOURCE_CHUNKS", - "path": "src/app_runtime/contracts/application.py", - "title": "src/app_runtime/contracts/application.py:ApplicationModule", - "content": "class ApplicationModule(ABC):\n @property\n @abstractmethod\n def name(self) -> str:\n \"\"\"Module name used for runtime status and diagnostics.\"\"\"\n\n @abstractmethod\n def register(self, registry: ModuleRegistry) -> None:\n \"\"\"Register workers, services, and health contributors.\"\"\"", - "start_line": 8, - "end_line": 16, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.contracts.application", - "is_test": false, - "blob_sha": "197c35634dca49c352ce3f230295a485fbffb672ce7bb8c08e752bfdf61e7fa4", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C0_SOURCE_CHUNKS", - "path": "src/app_runtime/__init__.py", - "title": "src/app_runtime/__init__.py:1-1", - "content": "__all__: list[str] = []", - "start_line": 1, - "end_line": 1, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.app_runtime.__init__", - "is_test": false, - "blob_sha": "8eea9df4f6d7b38ca0e39ccc27b04700e3d08dbeec8046d613d22706d19985fa", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C4_SEMANTIC_ROLES", - "path": "src/app_runtime/control/http_runner.py", - "title": "UvicornThreadRunner", - "content": "UvicornThreadRunner\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (24)", - "start_line": 10, - "end_line": 61, - "metadata": { - "symbol_id": "fd55630045a02100df8877ac27d951ee08617d4598764394d48cb51fe067476a", - "symbol_name": "UvicornThreadRunner", - "qname": "UvicornThreadRunner", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 24, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "3779fdd2878b770e789a35bb2a89c9d79f13b61c26d7db1b3b683f9bb9e1623f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C4_SEMANTIC_ROLES", - "path": "src/app_runtime/workflow/persistence/workflow_persistence.py", - "title": "WorkflowPersistence", - "content": "WorkflowPersistence\nrole: pipeline_stage\n\nResponsibilities:\n- orchestrates role-like calls (2)\n- reads and writes state attributes\n- participates in dataflow slices (16)", - "start_line": 8, - "end_line": 54, - "metadata": { - "symbol_id": "7bd01ee45cf31f2d5c2e3e51656254860ac785d10cef9e0852cd4fba90857bae", - "symbol_name": "WorkflowPersistence", - "qname": "WorkflowPersistence", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 16, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "80e9410ddc639789b4353c2a1a757ba8d0d5b5bb6075b0b263b61551f04ae1f0", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C4_SEMANTIC_ROLES", - "path": "src/app_runtime/control/http_channel.py", - "title": "HttpControlChannel", - "content": "HttpControlChannel\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (10)", - "start_line": 12, - "end_line": 57, - "metadata": { - "symbol_id": "1c9fbdc24819e5604c26ea55428a74310f03a03e1af197ed84846af61e42fdb0", - "symbol_name": "HttpControlChannel", - "qname": "HttpControlChannel", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 10, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C4_SEMANTIC_ROLES", - "path": "src/app_runtime/queue/in_memory.py", - "title": "InMemoryTaskQueue", - "content": "InMemoryTaskQueue\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (9)", - "start_line": 9, - "end_line": 38, - "metadata": { - "symbol_id": "2da04cb94544a3bcbf0943a95ad4bdd8710bcafaa32a02fd0e4de2178dcf3533", - "symbol_name": "InMemoryTaskQueue", - "qname": "InMemoryTaskQueue", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 9, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "58f0cc001ccda0eee4c6bc32ed83bd05eafd6b6644f1e8b4aa9eed3103db73dc", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C4_SEMANTIC_ROLES", - "path": "src/app_runtime/config/file_loader.py", - "title": "ConfigFileLoader", - "content": "ConfigFileLoader\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (8)", - "start_line": 11, - "end_line": 48, - "metadata": { - "symbol_id": "a8474eca8b6e9dc86ae67ed68b16fa5fb639ef08739c053e7b7195489765667f", - "symbol_name": "ConfigFileLoader", - "qname": "ConfigFileLoader", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 8, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "1f19ffebde5e38e4be5a5d5a678059a0f36dedb8fb8b3e00ab395c67106a87ea", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C4_SEMANTIC_ROLES", - "path": "src/app_runtime/workers/supervisor.py", - "title": "WorkerSupervisor", - "content": "WorkerSupervisor\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (6)", - "start_line": 10, - "end_line": 59, - "metadata": { - "symbol_id": "c17b44e8d9e97d490989b21fa67d7c346cdda8a0472e4c41fb243c8846faa124", - "symbol_name": "WorkerSupervisor", - "qname": "WorkerSupervisor", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 6, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "77609d9d5927171cce7fc3a54897c183fd63068710c6362029b700937aae5eee", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C4_SEMANTIC_ROLES", - "path": "src/app_runtime/workflow/engine/workflow_engine.py", - "title": "WorkflowEngine", - "content": "WorkflowEngine\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (6)", - "start_line": 10, - "end_line": 86, - "metadata": { - "symbol_id": "57ec0a9f11c542c78e008684a888397e8d9ef4223671acb2567e631a0cbc70b4", - "symbol_name": "WorkflowEngine", - "qname": "WorkflowEngine", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 6, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "1057136e58a325cd5ab6f4e265d15665fb6a711b7022d9fab52a1a290afa2368", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C4_SEMANTIC_ROLES", - "path": "src/app_runtime/tracing/store.py", - "title": "TraceContextStore", - "content": "TraceContextStore\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (6)", - "start_line": 15, - "end_line": 52, - "metadata": { - "symbol_id": "b2dad4fbe16ffb11b58deba311c7739955c39d59f291b22181f33e9c8cce4059", - "symbol_name": "TraceContextStore", - "qname": "TraceContextStore", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 6, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "d369554f08fc92039c6edd5a2a1e73b23901533e8974459170bbd9347d263dc5", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "path": "src/plba/bootstrap.py", - "title": "create_runtime:calls", - "content": "create_runtime calls runtime.add_config_file", - "start_line": 19, - "end_line": 19, - "metadata": { - "edge_id": "4eaeec4ac55a59d5f66fd01c4754955f8fedaf4bc3df13fa769b352c7bfaacbb", - "edge_type": "calls", - "src_symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "src_qname": "create_runtime", - "dst_symbol_id": null, - "dst_ref": "runtime.add_config_file", - "resolution": "partial", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "path": "src/plba/bootstrap.py", - "title": "create_runtime:reads_attr", - "content": "create_runtime reads_attr runtime.register_module", - "start_line": 28, - "end_line": 28, - "metadata": { - "edge_id": "45516c79ff358dbf9b650a081668df0f66d2fe989300f985a1a78be6be166f8f", - "edge_type": "reads_attr", - "src_symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "src_qname": "create_runtime", - "dst_symbol_id": null, - "dst_ref": "runtime.register_module", - "resolution": "partial", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "path": "src/plba/bootstrap.py", - "title": "create_runtime:instantiates", - "content": "create_runtime instantiates RuntimeManager", - "start_line": 17, - "end_line": 17, - "metadata": { - "edge_id": "0adba17984f850ea1608c9e734d2dd5c325cfde3a8133123aa239e44935ad18e", - "edge_type": "instantiates", - "src_symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "src_qname": "create_runtime", - "dst_symbol_id": "27158ca220022eeb5083c6addf8a50775d45f7161284fd60aac48410105f4b98", - "dst_ref": "RuntimeManager", - "resolution": "resolved", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "path": "src/plba/bootstrap.py", - "title": "create_runtime:calls", - "content": "create_runtime calls runtime.register_module", - "start_line": 28, - "end_line": 28, - "metadata": { - "edge_id": "ab6003c3441addc1ba1b81edeca009165559f652f6b2cf424e5ae61b1f617de8", - "edge_type": "calls", - "src_symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "src_qname": "create_runtime", - "dst_symbol_id": null, - "dst_ref": "runtime.register_module", - "resolution": "partial", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "path": "src/plba/bootstrap.py", - "title": "create_runtime:calls", - "content": "create_runtime calls runtime.control_plane.register_channel", - "start_line": 21, - "end_line": 27, - "metadata": { - "edge_id": "2678250030b9ce47a3b3b55fac7897ac530367edc8374ac9d5e6ecafb1e483f0", - "edge_type": "calls", - "src_symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "src_qname": "create_runtime", - "dst_symbol_id": null, - "dst_ref": "runtime.control_plane.register_channel", - "resolution": "partial", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "path": "src/plba/bootstrap.py", - "title": "create_runtime:reads_attr", - "content": "create_runtime reads_attr runtime.add_config_file", - "start_line": 19, - "end_line": 19, - "metadata": { - "edge_id": "30d4e8aae984ab84d523e80d02f1caeda52d547fa3d2aa47be8845931cabbca2", - "edge_type": "reads_attr", - "src_symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "src_qname": "create_runtime", - "dst_symbol_id": null, - "dst_ref": "runtime.add_config_file", - "resolution": "partial", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C3_ENTRYPOINTS", - "path": "src/app_runtime/control/http_app.py", - "title": "app.post", - "content": "fastapi http app.post", - "start_line": 38, - "end_line": 42, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C3_ENTRYPOINTS", - "path": "src/app_runtime/control/http_app.py", - "title": "app.get", - "content": "fastapi http app.get", - "start_line": 31, - "end_line": 34, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C3_ENTRYPOINTS", - "path": "src/app_runtime/control/http_app.py", - "title": "app.get", - "content": "fastapi http app.get", - "start_line": 38, - "end_line": 42, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "relations": [ - { - "path": "src/plba/bootstrap.py", - "start_line": 19, - "end_line": 19, - "edge_type": "calls", - "source": "create_runtime", - "target": "runtime.add_config_file", - "metadata": { - "edge_id": "4eaeec4ac55a59d5f66fd01c4754955f8fedaf4bc3df13fa769b352c7bfaacbb", - "edge_type": "calls", - "src_symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "src_qname": "create_runtime", - "dst_symbol_id": null, - "dst_ref": "runtime.add_config_file", - "resolution": "partial", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - }, - "content": "create_runtime calls runtime.add_config_file" - }, - { - "path": "src/plba/bootstrap.py", - "start_line": 28, - "end_line": 28, - "edge_type": "reads_attr", - "source": "create_runtime", - "target": "runtime.register_module", - "metadata": { - "edge_id": "45516c79ff358dbf9b650a081668df0f66d2fe989300f985a1a78be6be166f8f", - "edge_type": "reads_attr", - "src_symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "src_qname": "create_runtime", - "dst_symbol_id": null, - "dst_ref": "runtime.register_module", - "resolution": "partial", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - }, - "content": "create_runtime reads_attr runtime.register_module" - }, - { - "path": "src/plba/bootstrap.py", - "start_line": 17, - "end_line": 17, - "edge_type": "instantiates", - "source": "create_runtime", - "target": "RuntimeManager", - "metadata": { - "edge_id": "0adba17984f850ea1608c9e734d2dd5c325cfde3a8133123aa239e44935ad18e", - "edge_type": "instantiates", - "src_symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "src_qname": "create_runtime", - "dst_symbol_id": "27158ca220022eeb5083c6addf8a50775d45f7161284fd60aac48410105f4b98", - "dst_ref": "RuntimeManager", - "resolution": "resolved", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - }, - "content": "create_runtime instantiates RuntimeManager" - }, - { - "path": "src/plba/bootstrap.py", - "start_line": 28, - "end_line": 28, - "edge_type": "calls", - "source": "create_runtime", - "target": "runtime.register_module", - "metadata": { - "edge_id": "ab6003c3441addc1ba1b81edeca009165559f652f6b2cf424e5ae61b1f617de8", - "edge_type": "calls", - "src_symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "src_qname": "create_runtime", - "dst_symbol_id": null, - "dst_ref": "runtime.register_module", - "resolution": "partial", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - }, - "content": "create_runtime calls runtime.register_module" - }, - { - "path": "src/plba/bootstrap.py", - "start_line": 21, - "end_line": 27, - "edge_type": "calls", - "source": "create_runtime", - "target": "runtime.control_plane.register_channel", - "metadata": { - "edge_id": "2678250030b9ce47a3b3b55fac7897ac530367edc8374ac9d5e6ecafb1e483f0", - "edge_type": "calls", - "src_symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "src_qname": "create_runtime", - "dst_symbol_id": null, - "dst_ref": "runtime.control_plane.register_channel", - "resolution": "partial", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - }, - "content": "create_runtime calls runtime.control_plane.register_channel" - }, - { - "path": "src/plba/bootstrap.py", - "start_line": 19, - "end_line": 19, - "edge_type": "reads_attr", - "source": "create_runtime", - "target": "runtime.add_config_file", - "metadata": { - "edge_id": "30d4e8aae984ab84d523e80d02f1caeda52d547fa3d2aa47be8845931cabbca2", - "edge_type": "reads_attr", - "src_symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "src_qname": "create_runtime", - "dst_symbol_id": null, - "dst_ref": "runtime.add_config_file", - "resolution": "partial", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - }, - "content": "create_runtime reads_attr runtime.add_config_file" - } - ], - "semantic_hints": [ - { - "path": "src/app_runtime/control/http_runner.py", - "title": "UvicornThreadRunner", - "symbol": "UvicornThreadRunner", - "role": "pipeline_stage", - "confidence": 0.99, - "content": "UvicornThreadRunner\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (24)" - }, - { - "path": "src/app_runtime/workflow/persistence/workflow_persistence.py", - "title": "WorkflowPersistence", - "symbol": "WorkflowPersistence", - "role": "pipeline_stage", - "confidence": 0.99, - "content": "WorkflowPersistence\nrole: pipeline_stage\n\nResponsibilities:\n- orchestrates role-like calls (2)\n- reads and writes state attributes\n- participates in dataflow slices (16)" - }, - { - "path": "src/app_runtime/control/http_channel.py", - "title": "HttpControlChannel", - "symbol": "HttpControlChannel", - "role": "pipeline_stage", - "confidence": 0.99, - "content": "HttpControlChannel\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (10)" - }, - { - "path": "src/app_runtime/queue/in_memory.py", - "title": "InMemoryTaskQueue", - "symbol": "InMemoryTaskQueue", - "role": "pipeline_stage", - "confidence": 0.99, - "content": "InMemoryTaskQueue\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (9)" - }, - { - "path": "src/app_runtime/config/file_loader.py", - "title": "ConfigFileLoader", - "symbol": "ConfigFileLoader", - "role": "pipeline_stage", - "confidence": 0.99, - "content": "ConfigFileLoader\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (8)" - }, - { - "path": "src/app_runtime/workers/supervisor.py", - "title": "WorkerSupervisor", - "symbol": "WorkerSupervisor", - "role": "pipeline_stage", - "confidence": 0.99, - "content": "WorkerSupervisor\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (6)" - }, - { - "path": "src/app_runtime/workflow/engine/workflow_engine.py", - "title": "WorkflowEngine", - "symbol": "WorkflowEngine", - "role": "pipeline_stage", - "confidence": 0.99, - "content": "WorkflowEngine\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (6)" - }, - { - "path": "src/app_runtime/tracing/store.py", - "title": "TraceContextStore", - "symbol": "TraceContextStore", - "role": "pipeline_stage", - "confidence": 0.99, - "content": "TraceContextStore\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (6)" - } - ], - "entrypoints": [ - { - "path": "src/app_runtime/control/http_app.py", - "title": "app.get", - "start_line": 31, - "end_line": 34, - "http_method": "GET", - "route_path": "", - "handler_symbol": "", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "route_or_command": "app.get", - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "title": "app.get", - "start_line": 38, - "end_line": 42, - "http_method": "GET", - "route_path": "", - "handler_symbol": "", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "route_or_command": "app.get", - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "title": "app.post", - "start_line": 38, - "end_line": 42, - "http_method": "POST", - "route_path": "", - "handler_symbol": "", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "route_or_command": "app.post", - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "test_candidates": [], - "layer_outcomes": [ - { - "layer_id": "C1_SYMBOL_CATALOG", - "hit_count": 8, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C0_SOURCE_CHUNKS", - "hit_count": 8, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C4_SEMANTIC_ROLES", - "hit_count": 8, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C2_DEPENDENCY_GRAPH", - "hit_count": 6, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C3_ENTRYPOINTS", - "hit_count": 3, - "empty": false, - "fallback_used": false - } - ], - "missing_layers": [], - "raw_rows": [ - { - "path": "src/plba/__init__.py", - "content": "const create_runtime\ncreate_runtime = plba.bootstrap.create_runtime", - "layer": "C1_SYMBOL_CATALOG", - "title": "create_runtime", - "span_start": 1, - "span_end": 1, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": null, - "metadata": { - "symbol_id": "fa1e84f16c8c659bcd5448637386af4d15d431064e07714e34689ee64233cb51", - "qname": "create_runtime", - "kind": "const", - "signature": "create_runtime = plba.bootstrap.create_runtime", - "parent_symbol_id": null, - "package_or_module": "src.plba.__init__", - "is_test": false, - "blob_sha": "24e755ec8c249d14fb0e675b5dbf2b71ab91afb9c849897eebfa9feb2499e19d", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/bootstrap.py", - "content": "function create_runtime\ncreate_runtime(module)", - "layer": "C1_SYMBOL_CATALOG", - "title": "create_runtime", - "span_start": 8, - "span_end": 29, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": null, - "metadata": { - "symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "qname": "create_runtime", - "kind": "function", - "signature": "create_runtime(module)", - "parent_symbol_id": null, - "package_or_module": "src.plba.bootstrap", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/config/file_loader.py", - "content": "const annotations\nannotations = __future__.annotations", - "layer": "C1_SYMBOL_CATALOG", - "title": "annotations", - "span_start": 1, - "span_end": 1, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": null, - "metadata": { - "symbol_id": "5ed640ccec43a78659d50ec24f3717bf1144a182c22588f37456649ac6a4a815", - "qname": "annotations", - "kind": "const", - "signature": "annotations = __future__.annotations", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.config.file_loader", - "is_test": false, - "blob_sha": "1f19ffebde5e38e4be5a5d5a678059a0f36dedb8fb8b3e00ab395c67106a87ea", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/config/file_loader.py", - "content": "const json\nimport json", - "layer": "C1_SYMBOL_CATALOG", - "title": "json", - "span_start": 4, - "span_end": 4, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": null, - "metadata": { - "symbol_id": "bb9e2eaf992bfd050f7072d72eed87c55b1a4b001daa034a0f7c630a61bb1d78", - "qname": "json", - "kind": "const", - "signature": "import json", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.config.file_loader", - "is_test": false, - "blob_sha": "1f19ffebde5e38e4be5a5d5a678059a0f36dedb8fb8b3e00ab395c67106a87ea", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/config/file_loader.py", - "content": "const Path\nPath = pathlib.Path", - "layer": "C1_SYMBOL_CATALOG", - "title": "Path", - "span_start": 5, - "span_end": 5, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": null, - "metadata": { - "symbol_id": "b785967ed1fb83aa62d5724c6d6e9c6d2b1505523db39bd941cc39b48db48306", - "qname": "Path", - "kind": "const", - "signature": "Path = pathlib.Path", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.config.file_loader", - "is_test": false, - "blob_sha": "1f19ffebde5e38e4be5a5d5a678059a0f36dedb8fb8b3e00ab395c67106a87ea", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/config/file_loader.py", - "content": "const Any\nAny = typing.Any", - "layer": "C1_SYMBOL_CATALOG", - "title": "Any", - "span_start": 6, - "span_end": 6, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": null, - "metadata": { - "symbol_id": "8e330833b8073585db1c4b4315947c400683a23e4c3d2e2ccbcb260f347541b6", - "qname": "Any", - "kind": "const", - "signature": "Any = typing.Any", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.config.file_loader", - "is_test": false, - "blob_sha": "1f19ffebde5e38e4be5a5d5a678059a0f36dedb8fb8b3e00ab395c67106a87ea", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/config/file_loader.py", - "content": "const yaml\nimport yaml", - "layer": "C1_SYMBOL_CATALOG", - "title": "yaml", - "span_start": 8, - "span_end": 8, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": null, - "metadata": { - "symbol_id": "223502bbfc2b82aea662f7466403cc99a3cd44f1b0507d637cd674874f751e4f", - "qname": "yaml", - "kind": "const", - "signature": "import yaml", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.config.file_loader", - "is_test": false, - "blob_sha": "1f19ffebde5e38e4be5a5d5a678059a0f36dedb8fb8b3e00ab395c67106a87ea", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/config/file_loader.py", - "content": "const hashlib\nimport hashlib", - "layer": "C1_SYMBOL_CATALOG", - "title": "hashlib", - "span_start": 3, - "span_end": 3, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": null, - "metadata": { - "symbol_id": "e7375824bd473da3d73d316d22e3cb6428930e2db1ffbd900ce5a8b88427bf05", - "qname": "hashlib", - "kind": "const", - "signature": "import hashlib", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.config.file_loader", - "is_test": false, - "blob_sha": "1f19ffebde5e38e4be5a5d5a678059a0f36dedb8fb8b3e00ab395c67106a87ea", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/__init__.py", - "content": "from plba.bootstrap import create_runtime\nfrom plba.config import ConfigFileLoader, FileConfigProvider\nfrom plba.control import ControlActionSet, ControlChannel, ControlPlaneService, HttpControlChannel\nfrom plba.contracts import (\n ApplicationModule,\n ConfigProvider,\n HealthContributor,\n TraceContext,\n TraceContextRecord,\n TraceLogMessage,\n TraceTransport,\n Worker,\n WorkerHealth,\n WorkerStatus,\n)\nfrom plba.core import ConfigurationManager, RuntimeManager, ServiceContainer\nfrom plba.health import HealthRegistry\nfrom plba.logging import LogManager\nfrom plba.queue import InMemoryTaskQueue\nfrom plba.tracing import MySqlTraceTransport, NoOpTraceTransport, TraceService\nfrom plba.workflow import (\n StepResult,\n WorkflowContext,\n WorkflowDefinition,\n WorkflowEngine,\n WorkflowEngineHooks,\n WorkflowNode,\n WorkflowRuntimeFactory,\n WorkflowStep,\n)\nfrom plba.workers import WorkerSupervisor\n\n__all__ = [\n \"ApplicationModule\",\n \"ConfigFileLoader\",\n \"ConfigProvider\",\n \"ConfigurationManager\",\n \"ControlActionSet\",\n \"ControlChannel\",\n \"ControlPlaneService\",\n \"create_runtime\",\n \"FileConfigProvider\",\n \"HealthContributor\",\n \"HealthRegistry\",\n \"HttpControlChannel\",\n \"InMemoryTaskQueue\",\n \"LogManager\",\n \"MySqlTraceTransport\",\n \"NoOpTraceTransport\",\n \"RuntimeManager\",\n \"ServiceContainer\",\n \"TraceContext\",\n \"TraceContextRecord\",\n \"TraceLogMessage\",\n \"TraceService\",\n \"TraceTransport\",\n \"StepResult\",\n \"Worker\",\n \"WorkerHealth\",\n \"WorkerStatus\",\n \"WorkflowContext\",\n \"WorkflowDefinition\",\n \"WorkflowEngine\",\n \"WorkflowEngineHooks\",\n \"WorkflowNode\",\n \"WorkflowRuntimeFactory\",\n \"WorkflowStep\",\n \"WorkerSupervisor\",\n]", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/plba/__init__.py:1-69", - "span_start": 1, - "span_end": 69, - "lexical_rank": 6, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": null, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.plba.__init__", - "is_test": false, - "blob_sha": "24e755ec8c249d14fb0e675b5dbf2b71ab91afb9c849897eebfa9feb2499e19d", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/bootstrap.py", - "content": "def create_runtime(\n module: ApplicationModule,\n *,\n config_path: str | None = None,\n enable_http_control: bool = False,\n control_host: str = \"127.0.0.1\",\n control_port: int = 8080,\n control_timeout: int = 5,\n) -> RuntimeManager:\n runtime = RuntimeManager()\n if config_path is not None:\n runtime.add_config_file(config_path)\n if enable_http_control:\n runtime.control_plane.register_channel(\n HttpControlChannel(\n host=control_host,\n port=control_port,\n timeout=control_timeout,\n )\n )\n runtime.register_module(module)\n return runtime", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/plba/bootstrap.py:create_runtime", - "span_start": 8, - "span_end": 29, - "lexical_rank": 6, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": null, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.plba.bootstrap", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/config/__init__.py", - "content": "from app_runtime.config.file_loader import ConfigFileLoader\nfrom app_runtime.config.providers import FileConfigProvider\n\n__all__ = [\"ConfigFileLoader\", \"FileConfigProvider\"]", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/config/__init__.py:1-4", - "span_start": 1, - "span_end": 4, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": null, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.app_runtime.config.__init__", - "is_test": false, - "blob_sha": "612918029820a2a983330ec92256142b55b9de4bdf3399ece18e2a02dbad9729", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/config/file_loader.py", - "content": "class ConfigFileLoader:\n def __init__(self, path: str | Path) -> None:\n self.path = Path(path)\n self.config: Any = None\n self.last_valid_config: Any = None\n self._last_seen_hash: str | None = None\n\n def read_text(self) -> str:\n return self.path.read_text(encoding=\"utf-8\")\n\n def parse(self, data: str) -> Any:\n suffix = self.path.suffix.lower()\n if suffix in {\".yml\", \".yaml\"}:\n return yaml.safe_load(data)\n return json.loads(data)\n\n def load_sync(self) -> Any:\n data = self.read_text()\n parsed = self.parse(data)\n self.config = parsed\n self.last_valid_config = parsed\n self._last_seen_hash = self._calculate_hash(data)\n return parsed\n\n def load_if_changed(self) -> tuple[bool, Any]:\n data = self.read_text()\n current_hash = self._calculate_hash(data)\n if current_hash == self._last_seen_hash:\n return False, self.config\n parsed = self.parse(data)\n self.config = parsed\n self.last_valid_config = parsed\n self._last_seen_hash = current_hash\n return True, parsed\n\n @staticmethod\n def _calculate_hash(data: str) -> str:\n return hashlib.sha256(data.encode(\"utf-8\")).hexdigest()", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/config/file_loader.py:ConfigFileLoader", - "span_start": 11, - "span_end": 48, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": null, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.config.file_loader", - "is_test": false, - "blob_sha": "1f19ffebde5e38e4be5a5d5a678059a0f36dedb8fb8b3e00ab395c67106a87ea", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/config/providers.py", - "content": "class FileConfigProvider(ConfigProvider):\n def __init__(self, path: str | Path) -> None:\n self._loader = ConfigFileLoader(path)\n\n @property\n def loader(self) -> ConfigFileLoader:\n return self._loader\n\n def load(self) -> dict[str, Any]:\n config = self._loader.load_sync()\n if not isinstance(config, dict):\n raise TypeError(\"Config root must be a mapping\")\n return dict(config)", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/config/providers.py:FileConfigProvider", - "span_start": 10, - "span_end": 22, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": null, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.config.providers", - "is_test": false, - "blob_sha": "8c53ca0122d6df6c5763bca15e99434bb4daebd5a618b8fc927e9ae90b022e64", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/contracts/__init__.py", - "content": "__all__: list[str] = []", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/__init__.py:1-1", - "span_start": 1, - "span_end": 1, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": null, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.app_runtime.__init__", - "is_test": false, - "blob_sha": "8eea9df4f6d7b38ca0e39ccc27b04700e3d08dbeec8046d613d22706d19985fa", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/contracts/application.py", - "content": "class ApplicationModule(ABC):\n @property\n @abstractmethod\n def name(self) -> str:\n \"\"\"Module name used for runtime status and diagnostics.\"\"\"\n\n @abstractmethod\n def register(self, registry: ModuleRegistry) -> None:\n \"\"\"Register workers, services, and health contributors.\"\"\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/contracts/application.py:ApplicationModule", - "span_start": 8, - "span_end": 16, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": null, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.contracts.application", - "is_test": false, - "blob_sha": "197c35634dca49c352ce3f230295a485fbffb672ce7bb8c08e752bfdf61e7fa4", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/__init__.py", - "content": "__all__: list[str] = []", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/__init__.py:1-1", - "span_start": 1, - "span_end": 1, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": null, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.app_runtime.__init__", - "is_test": false, - "blob_sha": "8eea9df4f6d7b38ca0e39ccc27b04700e3d08dbeec8046d613d22706d19985fa", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_runner.py", - "content": "UvicornThreadRunner\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (24)", - "layer": "C4_SEMANTIC_ROLES", - "title": "UvicornThreadRunner", - "span_start": 10, - "span_end": 61, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 11, - "layer_rank": 2, - "distance": null, - "metadata": { - "symbol_id": "fd55630045a02100df8877ac27d951ee08617d4598764394d48cb51fe067476a", - "symbol_name": "UvicornThreadRunner", - "qname": "UvicornThreadRunner", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 24, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "3779fdd2878b770e789a35bb2a89c9d79f13b61c26d7db1b3b683f9bb9e1623f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/persistence/workflow_persistence.py", - "content": "WorkflowPersistence\nrole: pipeline_stage\n\nResponsibilities:\n- orchestrates role-like calls (2)\n- reads and writes state attributes\n- participates in dataflow slices (16)", - "layer": "C4_SEMANTIC_ROLES", - "title": "WorkflowPersistence", - "span_start": 8, - "span_end": 54, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 15, - "layer_rank": 2, - "distance": null, - "metadata": { - "symbol_id": "7bd01ee45cf31f2d5c2e3e51656254860ac785d10cef9e0852cd4fba90857bae", - "symbol_name": "WorkflowPersistence", - "qname": "WorkflowPersistence", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 16, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "80e9410ddc639789b4353c2a1a757ba8d0d5b5bb6075b0b263b61551f04ae1f0", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (10)", - "layer": "C4_SEMANTIC_ROLES", - "title": "HttpControlChannel", - "span_start": 12, - "span_end": 57, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 21, - "layer_rank": 2, - "distance": null, - "metadata": { - "symbol_id": "1c9fbdc24819e5604c26ea55428a74310f03a03e1af197ed84846af61e42fdb0", - "symbol_name": "HttpControlChannel", - "qname": "HttpControlChannel", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 10, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/queue/in_memory.py", - "content": "InMemoryTaskQueue\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (9)", - "layer": "C4_SEMANTIC_ROLES", - "title": "InMemoryTaskQueue", - "span_start": 9, - "span_end": 38, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 22, - "layer_rank": 2, - "distance": null, - "metadata": { - "symbol_id": "2da04cb94544a3bcbf0943a95ad4bdd8710bcafaa32a02fd0e4de2178dcf3533", - "symbol_name": "InMemoryTaskQueue", - "qname": "InMemoryTaskQueue", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 9, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "58f0cc001ccda0eee4c6bc32ed83bd05eafd6b6644f1e8b4aa9eed3103db73dc", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/config/file_loader.py", - "content": "ConfigFileLoader\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (8)", - "layer": "C4_SEMANTIC_ROLES", - "title": "ConfigFileLoader", - "span_start": 11, - "span_end": 48, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 23, - "layer_rank": 2, - "distance": null, - "metadata": { - "symbol_id": "a8474eca8b6e9dc86ae67ed68b16fa5fb639ef08739c053e7b7195489765667f", - "symbol_name": "ConfigFileLoader", - "qname": "ConfigFileLoader", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 8, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "1f19ffebde5e38e4be5a5d5a678059a0f36dedb8fb8b3e00ab395c67106a87ea", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workers/supervisor.py", - "content": "WorkerSupervisor\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (6)", - "layer": "C4_SEMANTIC_ROLES", - "title": "WorkerSupervisor", - "span_start": 10, - "span_end": 59, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 25, - "layer_rank": 2, - "distance": null, - "metadata": { - "symbol_id": "c17b44e8d9e97d490989b21fa67d7c346cdda8a0472e4c41fb243c8846faa124", - "symbol_name": "WorkerSupervisor", - "qname": "WorkerSupervisor", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 6, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "77609d9d5927171cce7fc3a54897c183fd63068710c6362029b700937aae5eee", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/engine/workflow_engine.py", - "content": "WorkflowEngine\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (6)", - "layer": "C4_SEMANTIC_ROLES", - "title": "WorkflowEngine", - "span_start": 10, - "span_end": 86, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 25, - "layer_rank": 2, - "distance": null, - "metadata": { - "symbol_id": "57ec0a9f11c542c78e008684a888397e8d9ef4223671acb2567e631a0cbc70b4", - "symbol_name": "WorkflowEngine", - "qname": "WorkflowEngine", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 6, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "1057136e58a325cd5ab6f4e265d15665fb6a711b7022d9fab52a1a290afa2368", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/store.py", - "content": "TraceContextStore\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (6)", - "layer": "C4_SEMANTIC_ROLES", - "title": "TraceContextStore", - "span_start": 15, - "span_end": 52, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 25, - "layer_rank": 2, - "distance": null, - "metadata": { - "symbol_id": "b2dad4fbe16ffb11b58deba311c7739955c39d59f291b22181f33e9c8cce4059", - "symbol_name": "TraceContextStore", - "qname": "TraceContextStore", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 6, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "d369554f08fc92039c6edd5a2a1e73b23901533e8974459170bbd9347d263dc5", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/bootstrap.py", - "content": "create_runtime calls runtime.add_config_file", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "create_runtime:calls", - "span_start": 19, - "span_end": 19, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": null, - "metadata": { - "edge_id": "4eaeec4ac55a59d5f66fd01c4754955f8fedaf4bc3df13fa769b352c7bfaacbb", - "edge_type": "calls", - "src_symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "src_qname": "create_runtime", - "dst_symbol_id": null, - "dst_ref": "runtime.add_config_file", - "resolution": "partial", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/bootstrap.py", - "content": "create_runtime reads_attr runtime.register_module", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "create_runtime:reads_attr", - "span_start": 28, - "span_end": 28, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": null, - "metadata": { - "edge_id": "45516c79ff358dbf9b650a081668df0f66d2fe989300f985a1a78be6be166f8f", - "edge_type": "reads_attr", - "src_symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "src_qname": "create_runtime", - "dst_symbol_id": null, - "dst_ref": "runtime.register_module", - "resolution": "partial", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/bootstrap.py", - "content": "create_runtime instantiates RuntimeManager", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "create_runtime:instantiates", - "span_start": 17, - "span_end": 17, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": null, - "metadata": { - "edge_id": "0adba17984f850ea1608c9e734d2dd5c325cfde3a8133123aa239e44935ad18e", - "edge_type": "instantiates", - "src_symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "src_qname": "create_runtime", - "dst_symbol_id": "27158ca220022eeb5083c6addf8a50775d45f7161284fd60aac48410105f4b98", - "dst_ref": "RuntimeManager", - "resolution": "resolved", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/bootstrap.py", - "content": "create_runtime calls runtime.register_module", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "create_runtime:calls", - "span_start": 28, - "span_end": 28, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": null, - "metadata": { - "edge_id": "ab6003c3441addc1ba1b81edeca009165559f652f6b2cf424e5ae61b1f617de8", - "edge_type": "calls", - "src_symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "src_qname": "create_runtime", - "dst_symbol_id": null, - "dst_ref": "runtime.register_module", - "resolution": "partial", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/bootstrap.py", - "content": "create_runtime calls runtime.control_plane.register_channel", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "create_runtime:calls", - "span_start": 21, - "span_end": 27, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": null, - "metadata": { - "edge_id": "2678250030b9ce47a3b3b55fac7897ac530367edc8374ac9d5e6ecafb1e483f0", - "edge_type": "calls", - "src_symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "src_qname": "create_runtime", - "dst_symbol_id": null, - "dst_ref": "runtime.control_plane.register_channel", - "resolution": "partial", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/bootstrap.py", - "content": "create_runtime reads_attr runtime.add_config_file", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "create_runtime:reads_attr", - "span_start": 19, - "span_end": 19, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": null, - "metadata": { - "edge_id": "30d4e8aae984ab84d523e80d02f1caeda52d547fa3d2aa47be8845931cabbca2", - "edge_type": "reads_attr", - "src_symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "src_qname": "create_runtime", - "dst_symbol_id": null, - "dst_ref": "runtime.add_config_file", - "resolution": "partial", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": null, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": null, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": null, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "retrieval_report": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "vector", - "C0_SOURCE_CHUNKS": "vector", - "C4_SEMANTIC_ROLES": "vector", - "C2_DEPENDENCY_GRAPH": "vector", - "C3_ENTRYPOINTS": "vector" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 8, - "C4_SEMANTIC_ROLES": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C3_ENTRYPOINTS": 6 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [] - }, - "C4_SEMANTIC_ROLES": { - "path_scope": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [] - } - }, - "fallback": { - "used": false, - "reason": null - }, - "retrieval_by_layer_ms": { - "C1_SYMBOL_CATALOG": 43, - "C0_SOURCE_CHUNKS": 20, - "C4_SEMANTIC_ROLES": 18, - "C2_DEPENDENCY_GRAPH": 47, - "C3_ENTRYPOINTS": 13 - } - } - }, - "diagnostics": { - "intent_correct": null, - "target_found": true, - "layers_used": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_sufficient": true, - "answer_mode": "normal", - "resolved_target": "create_runtime", - "answer_policy_branch": "normal_answer", - "decision_reason": "evidence_sufficient", - "router_result": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "retrieval_profile": "code", - "sub_intent": "EXPLAIN", - "path_scope": [], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "symbol_resolution_status": "resolved" - }, - "retrieval_request": { - "rag_session_id": "7d11da21-faa0-4cea-aede-aeabe069164c", - "query": "Что делает функция create_runtime?", - "sub_intent": "EXPLAIN", - "path_scope": [], - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "per_layer_outcome": [ - { - "layer_id": "C1_SYMBOL_CATALOG", - "hit_count": 8, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C0_SOURCE_CHUNKS", - "hit_count": 8, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C4_SEMANTIC_ROLES", - "hit_count": 8, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C2_DEPENDENCY_GRAPH", - "hit_count": 6, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C3_ENTRYPOINTS", - "hit_count": 3, - "empty": false, - "fallback_used": false - } - ], - "empty_layers": [], - "evidence_gate_decision": { - "sufficient": true, - "failure_reasons": [], - "evidence_count": 33 - }, - "evidence_gate_input": { - "resolved_target": "create_runtime", - "sub_intent": "EXPLAIN", - "target_type": "symbol", - "evidence_count": 33, - "code_chunk_count": 33, - "entrypoint_count": 3, - "relation_count": 6, - "test_evidence_count": 0, - "symbol_resolution_status": "resolved", - "path_scope": [] - }, - "post_evidence_gate": { - "input": { - "answer_mode": "normal", - "degraded_message": "", - "resolved_target": "create_runtime", - "draft_answer_preview": "Функция `create_runtime` определена в файле `src/plba/bootstrap.py`. Она создаёт и конфигурирует экземпляр `RuntimeManager`, регистрируя модуль приложения и опционально добавляя файл конфигурации и HTTP-канал управления.\n\nОсновные действия функции:\n- Создаёт экземпляр `RuntimeManager`.\n- Если переда", - "repair_candidate": true - }, - "output": { - "passed": true, - "action": "return", - "reasons": [], - "repair_used": false, - "final_answer_preview": "Функция `create_runtime` определена в файле `src/plba/bootstrap.py`. Она создаёт и конфигурирует экземпляр `RuntimeManager`, регистрируя модуль приложения и опционально добавляя файл конфигурации и HTTP-канал управления.\n\nОсновные действия функции:\n- Создаёт экземпляр `RuntimeManager`.\n- Если переда" - } - }, - "failure_reasons": [], - "timings_ms": { - "router": 1, - "retrieval": 144, - "pre_evidence_gate": 1, - "llm": 4185, - "post_evidence_gate": 1 - } - }, - "rag_rows": [ - { - "path": "src/plba/__init__.py", - "content": "const create_runtime\ncreate_runtime = plba.bootstrap.create_runtime", - "layer": "C1_SYMBOL_CATALOG", - "title": "create_runtime", - "span_start": 1, - "span_end": 1, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "fa1e84f16c8c659bcd5448637386af4d15d431064e07714e34689ee64233cb51", - "qname": "create_runtime", - "kind": "const", - "signature": "create_runtime = plba.bootstrap.create_runtime", - "parent_symbol_id": null, - "package_or_module": "src.plba.__init__", - "is_test": false, - "blob_sha": "24e755ec8c249d14fb0e675b5dbf2b71ab91afb9c849897eebfa9feb2499e19d", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/bootstrap.py", - "content": "function create_runtime\ncreate_runtime(module)", - "layer": "C1_SYMBOL_CATALOG", - "title": "create_runtime", - "span_start": 8, - "span_end": 29, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "qname": "create_runtime", - "kind": "function", - "signature": "create_runtime(module)", - "parent_symbol_id": null, - "package_or_module": "src.plba.bootstrap", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/config/file_loader.py", - "content": "const annotations\nannotations = __future__.annotations", - "layer": "C1_SYMBOL_CATALOG", - "title": "annotations", - "span_start": 1, - "span_end": 1, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "5ed640ccec43a78659d50ec24f3717bf1144a182c22588f37456649ac6a4a815", - "qname": "annotations", - "kind": "const", - "signature": "annotations = __future__.annotations", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.config.file_loader", - "is_test": false, - "blob_sha": "1f19ffebde5e38e4be5a5d5a678059a0f36dedb8fb8b3e00ab395c67106a87ea", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/config/file_loader.py", - "content": "const json\nimport json", - "layer": "C1_SYMBOL_CATALOG", - "title": "json", - "span_start": 4, - "span_end": 4, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "bb9e2eaf992bfd050f7072d72eed87c55b1a4b001daa034a0f7c630a61bb1d78", - "qname": "json", - "kind": "const", - "signature": "import json", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.config.file_loader", - "is_test": false, - "blob_sha": "1f19ffebde5e38e4be5a5d5a678059a0f36dedb8fb8b3e00ab395c67106a87ea", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/config/file_loader.py", - "content": "const Path\nPath = pathlib.Path", - "layer": "C1_SYMBOL_CATALOG", - "title": "Path", - "span_start": 5, - "span_end": 5, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "b785967ed1fb83aa62d5724c6d6e9c6d2b1505523db39bd941cc39b48db48306", - "qname": "Path", - "kind": "const", - "signature": "Path = pathlib.Path", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.config.file_loader", - "is_test": false, - "blob_sha": "1f19ffebde5e38e4be5a5d5a678059a0f36dedb8fb8b3e00ab395c67106a87ea", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/config/file_loader.py", - "content": "const Any\nAny = typing.Any", - "layer": "C1_SYMBOL_CATALOG", - "title": "Any", - "span_start": 6, - "span_end": 6, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "8e330833b8073585db1c4b4315947c400683a23e4c3d2e2ccbcb260f347541b6", - "qname": "Any", - "kind": "const", - "signature": "Any = typing.Any", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.config.file_loader", - "is_test": false, - "blob_sha": "1f19ffebde5e38e4be5a5d5a678059a0f36dedb8fb8b3e00ab395c67106a87ea", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/config/file_loader.py", - "content": "const yaml\nimport yaml", - "layer": "C1_SYMBOL_CATALOG", - "title": "yaml", - "span_start": 8, - "span_end": 8, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "223502bbfc2b82aea662f7466403cc99a3cd44f1b0507d637cd674874f751e4f", - "qname": "yaml", - "kind": "const", - "signature": "import yaml", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.config.file_loader", - "is_test": false, - "blob_sha": "1f19ffebde5e38e4be5a5d5a678059a0f36dedb8fb8b3e00ab395c67106a87ea", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/config/file_loader.py", - "content": "const hashlib\nimport hashlib", - "layer": "C1_SYMBOL_CATALOG", - "title": "hashlib", - "span_start": 3, - "span_end": 3, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "e7375824bd473da3d73d316d22e3cb6428930e2db1ffbd900ce5a8b88427bf05", - "qname": "hashlib", - "kind": "const", - "signature": "import hashlib", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.config.file_loader", - "is_test": false, - "blob_sha": "1f19ffebde5e38e4be5a5d5a678059a0f36dedb8fb8b3e00ab395c67106a87ea", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/__init__.py", - "content": "from plba.bootstrap import create_runtime\nfrom plba.config import ConfigFileLoader, FileConfigProvider\nfrom plba.control import ControlActionSet, ControlChannel, ControlPlaneService, HttpControlChannel\nfrom plba.contracts import (\n ApplicationModule,\n ConfigProvider,\n HealthContributor,\n TraceContext,\n TraceContextRecord,\n TraceLogMessage,\n TraceTransport,\n Worker,\n WorkerHealth,\n WorkerStatus,\n)\nfrom plba.core import ConfigurationManager, RuntimeManager, ServiceContainer\nfrom plba.health import HealthRegistry\nfrom plba.logging import LogManager\nfrom plba.queue import InMemoryTaskQueue\nfrom plba.tracing import MySqlTraceTransport, NoOpTraceTransport, TraceService\nfrom plba.workflow import (\n StepResult,\n WorkflowContext,\n WorkflowDefinition,\n WorkflowEngine,\n WorkflowEngineHooks,\n WorkflowNode,\n WorkflowRuntimeFactory,\n WorkflowStep,\n)\nfrom plba.workers import WorkerSupervisor\n\n__all__ = [\n \"ApplicationModule\",\n \"ConfigFileLoader\",\n \"ConfigProvider\",\n \"ConfigurationManager\",\n \"ControlActionSet\",\n \"ControlChannel\",\n \"ControlPlaneService\",\n \"create_runtime\",\n \"FileConfigProvider\",\n \"HealthContributor\",\n \"HealthRegistry\",\n \"HttpControlChannel\",\n \"InMemoryTaskQueue\",\n \"LogManager\",\n \"MySqlTraceTransport\",\n \"NoOpTraceTransport\",\n \"RuntimeManager\",\n \"ServiceContainer\",\n \"TraceContext\",\n \"TraceContextRecord\",\n \"TraceLogMessage\",\n \"TraceService\",\n \"TraceTransport\",\n \"StepResult\",\n \"Worker\",\n \"WorkerHealth\",\n \"WorkerStatus\",\n \"WorkflowContext\",\n \"WorkflowDefinition\",\n \"WorkflowEngine\",\n \"WorkflowEngineHooks\",\n \"WorkflowNode\",\n \"WorkflowRuntimeFactory\",\n \"WorkflowStep\",\n \"WorkerSupervisor\",\n]", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/plba/__init__.py:1-69", - "span_start": 1, - "span_end": 69, - "lexical_rank": 6, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.plba.__init__", - "is_test": false, - "blob_sha": "24e755ec8c249d14fb0e675b5dbf2b71ab91afb9c849897eebfa9feb2499e19d", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/bootstrap.py", - "content": "def create_runtime(\n module: ApplicationModule,\n *,\n config_path: str | None = None,\n enable_http_control: bool = False,\n control_host: str = \"127.0.0.1\",\n control_port: int = 8080,\n control_timeout: int = 5,\n) -> RuntimeManager:\n runtime = RuntimeManager()\n if config_path is not None:\n runtime.add_config_file(config_path)\n if enable_http_control:\n runtime.control_plane.register_channel(\n HttpControlChannel(\n host=control_host,\n port=control_port,\n timeout=control_timeout,\n )\n )\n runtime.register_module(module)\n return runtime", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/plba/bootstrap.py:create_runtime", - "span_start": 8, - "span_end": 29, - "lexical_rank": 6, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.plba.bootstrap", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/config/__init__.py", - "content": "from app_runtime.config.file_loader import ConfigFileLoader\nfrom app_runtime.config.providers import FileConfigProvider\n\n__all__ = [\"ConfigFileLoader\", \"FileConfigProvider\"]", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/config/__init__.py:1-4", - "span_start": 1, - "span_end": 4, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.app_runtime.config.__init__", - "is_test": false, - "blob_sha": "612918029820a2a983330ec92256142b55b9de4bdf3399ece18e2a02dbad9729", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/config/file_loader.py", - "content": "class ConfigFileLoader:\n def __init__(self, path: str | Path) -> None:\n self.path = Path(path)\n self.config: Any = None\n self.last_valid_config: Any = None\n self._last_seen_hash: str | None = None\n\n def read_text(self) -> str:\n return self.path.read_text(encoding=\"utf-8\")\n\n def parse(self, data: str) -> Any:\n suffix = self.path.suffix.lower()\n if suffix in {\".yml\", \".yaml\"}:\n return yaml.safe_load(data)\n return json.loads(data)\n\n def load_sync(self) -> Any:\n data = self.read_text()\n parsed = self.parse(data)\n self.config = parsed\n self.last_valid_config = parsed\n self._last_seen_hash = self._calculate_hash(data)\n return parsed\n\n def load_if_changed(self) -> tuple[bool, Any]:\n data = self.read_text()\n current_hash = self._calculate_hash(data)\n if current_hash == self._last_seen_hash:\n return False, self.config\n parsed = self.parse(data)\n self.config = parsed\n self.last_valid_config = parsed\n self._last_seen_hash = current_hash\n return True, parsed\n\n @staticmethod\n def _calculate_hash(data: str) -> str:\n return hashlib.sha256(data.encode(\"utf-8\")).hexdigest()", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/config/file_loader.py:ConfigFileLoader", - "span_start": 11, - "span_end": 48, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.config.file_loader", - "is_test": false, - "blob_sha": "1f19ffebde5e38e4be5a5d5a678059a0f36dedb8fb8b3e00ab395c67106a87ea", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/config/providers.py", - "content": "class FileConfigProvider(ConfigProvider):\n def __init__(self, path: str | Path) -> None:\n self._loader = ConfigFileLoader(path)\n\n @property\n def loader(self) -> ConfigFileLoader:\n return self._loader\n\n def load(self) -> dict[str, Any]:\n config = self._loader.load_sync()\n if not isinstance(config, dict):\n raise TypeError(\"Config root must be a mapping\")\n return dict(config)", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/config/providers.py:FileConfigProvider", - "span_start": 10, - "span_end": 22, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.config.providers", - "is_test": false, - "blob_sha": "8c53ca0122d6df6c5763bca15e99434bb4daebd5a618b8fc927e9ae90b022e64", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/contracts/__init__.py", - "content": "__all__: list[str] = []", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/__init__.py:1-1", - "span_start": 1, - "span_end": 1, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.app_runtime.__init__", - "is_test": false, - "blob_sha": "8eea9df4f6d7b38ca0e39ccc27b04700e3d08dbeec8046d613d22706d19985fa", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/contracts/application.py", - "content": "class ApplicationModule(ABC):\n @property\n @abstractmethod\n def name(self) -> str:\n \"\"\"Module name used for runtime status and diagnostics.\"\"\"\n\n @abstractmethod\n def register(self, registry: ModuleRegistry) -> None:\n \"\"\"Register workers, services, and health contributors.\"\"\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/contracts/application.py:ApplicationModule", - "span_start": 8, - "span_end": 16, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.contracts.application", - "is_test": false, - "blob_sha": "197c35634dca49c352ce3f230295a485fbffb672ce7bb8c08e752bfdf61e7fa4", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/__init__.py", - "content": "__all__: list[str] = []", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/__init__.py:1-1", - "span_start": 1, - "span_end": 1, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.app_runtime.__init__", - "is_test": false, - "blob_sha": "8eea9df4f6d7b38ca0e39ccc27b04700e3d08dbeec8046d613d22706d19985fa", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_runner.py", - "content": "UvicornThreadRunner\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (24)", - "layer": "C4_SEMANTIC_ROLES", - "title": "UvicornThreadRunner", - "span_start": 10, - "span_end": 61, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 11, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "fd55630045a02100df8877ac27d951ee08617d4598764394d48cb51fe067476a", - "symbol_name": "UvicornThreadRunner", - "qname": "UvicornThreadRunner", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 24, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "3779fdd2878b770e789a35bb2a89c9d79f13b61c26d7db1b3b683f9bb9e1623f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/persistence/workflow_persistence.py", - "content": "WorkflowPersistence\nrole: pipeline_stage\n\nResponsibilities:\n- orchestrates role-like calls (2)\n- reads and writes state attributes\n- participates in dataflow slices (16)", - "layer": "C4_SEMANTIC_ROLES", - "title": "WorkflowPersistence", - "span_start": 8, - "span_end": 54, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 15, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "7bd01ee45cf31f2d5c2e3e51656254860ac785d10cef9e0852cd4fba90857bae", - "symbol_name": "WorkflowPersistence", - "qname": "WorkflowPersistence", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 16, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "80e9410ddc639789b4353c2a1a757ba8d0d5b5bb6075b0b263b61551f04ae1f0", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (10)", - "layer": "C4_SEMANTIC_ROLES", - "title": "HttpControlChannel", - "span_start": 12, - "span_end": 57, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 21, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "1c9fbdc24819e5604c26ea55428a74310f03a03e1af197ed84846af61e42fdb0", - "symbol_name": "HttpControlChannel", - "qname": "HttpControlChannel", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 10, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/queue/in_memory.py", - "content": "InMemoryTaskQueue\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (9)", - "layer": "C4_SEMANTIC_ROLES", - "title": "InMemoryTaskQueue", - "span_start": 9, - "span_end": 38, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 22, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "2da04cb94544a3bcbf0943a95ad4bdd8710bcafaa32a02fd0e4de2178dcf3533", - "symbol_name": "InMemoryTaskQueue", - "qname": "InMemoryTaskQueue", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 9, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "58f0cc001ccda0eee4c6bc32ed83bd05eafd6b6644f1e8b4aa9eed3103db73dc", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/config/file_loader.py", - "content": "ConfigFileLoader\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (8)", - "layer": "C4_SEMANTIC_ROLES", - "title": "ConfigFileLoader", - "span_start": 11, - "span_end": 48, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 23, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "a8474eca8b6e9dc86ae67ed68b16fa5fb639ef08739c053e7b7195489765667f", - "symbol_name": "ConfigFileLoader", - "qname": "ConfigFileLoader", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 8, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "1f19ffebde5e38e4be5a5d5a678059a0f36dedb8fb8b3e00ab395c67106a87ea", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workers/supervisor.py", - "content": "WorkerSupervisor\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (6)", - "layer": "C4_SEMANTIC_ROLES", - "title": "WorkerSupervisor", - "span_start": 10, - "span_end": 59, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 25, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "c17b44e8d9e97d490989b21fa67d7c346cdda8a0472e4c41fb243c8846faa124", - "symbol_name": "WorkerSupervisor", - "qname": "WorkerSupervisor", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 6, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "77609d9d5927171cce7fc3a54897c183fd63068710c6362029b700937aae5eee", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/engine/workflow_engine.py", - "content": "WorkflowEngine\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (6)", - "layer": "C4_SEMANTIC_ROLES", - "title": "WorkflowEngine", - "span_start": 10, - "span_end": 86, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 25, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "57ec0a9f11c542c78e008684a888397e8d9ef4223671acb2567e631a0cbc70b4", - "symbol_name": "WorkflowEngine", - "qname": "WorkflowEngine", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 6, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "1057136e58a325cd5ab6f4e265d15665fb6a711b7022d9fab52a1a290afa2368", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/store.py", - "content": "TraceContextStore\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (6)", - "layer": "C4_SEMANTIC_ROLES", - "title": "TraceContextStore", - "span_start": 15, - "span_end": 52, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 25, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "b2dad4fbe16ffb11b58deba311c7739955c39d59f291b22181f33e9c8cce4059", - "symbol_name": "TraceContextStore", - "qname": "TraceContextStore", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 6, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "d369554f08fc92039c6edd5a2a1e73b23901533e8974459170bbd9347d263dc5", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/bootstrap.py", - "content": "create_runtime calls runtime.add_config_file", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "create_runtime:calls", - "span_start": 19, - "span_end": 19, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "4eaeec4ac55a59d5f66fd01c4754955f8fedaf4bc3df13fa769b352c7bfaacbb", - "edge_type": "calls", - "src_symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "src_qname": "create_runtime", - "dst_symbol_id": null, - "dst_ref": "runtime.add_config_file", - "resolution": "partial", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/bootstrap.py", - "content": "create_runtime reads_attr runtime.register_module", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "create_runtime:reads_attr", - "span_start": 28, - "span_end": 28, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "45516c79ff358dbf9b650a081668df0f66d2fe989300f985a1a78be6be166f8f", - "edge_type": "reads_attr", - "src_symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "src_qname": "create_runtime", - "dst_symbol_id": null, - "dst_ref": "runtime.register_module", - "resolution": "partial", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/bootstrap.py", - "content": "create_runtime instantiates RuntimeManager", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "create_runtime:instantiates", - "span_start": 17, - "span_end": 17, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "0adba17984f850ea1608c9e734d2dd5c325cfde3a8133123aa239e44935ad18e", - "edge_type": "instantiates", - "src_symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "src_qname": "create_runtime", - "dst_symbol_id": "27158ca220022eeb5083c6addf8a50775d45f7161284fd60aac48410105f4b98", - "dst_ref": "RuntimeManager", - "resolution": "resolved", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/bootstrap.py", - "content": "create_runtime calls runtime.register_module", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "create_runtime:calls", - "span_start": 28, - "span_end": 28, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "ab6003c3441addc1ba1b81edeca009165559f652f6b2cf424e5ae61b1f617de8", - "edge_type": "calls", - "src_symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "src_qname": "create_runtime", - "dst_symbol_id": null, - "dst_ref": "runtime.register_module", - "resolution": "partial", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/bootstrap.py", - "content": "create_runtime calls runtime.control_plane.register_channel", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "create_runtime:calls", - "span_start": 21, - "span_end": 27, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "2678250030b9ce47a3b3b55fac7897ac530367edc8374ac9d5e6ecafb1e483f0", - "edge_type": "calls", - "src_symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "src_qname": "create_runtime", - "dst_symbol_id": null, - "dst_ref": "runtime.control_plane.register_channel", - "resolution": "partial", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/bootstrap.py", - "content": "create_runtime reads_attr runtime.add_config_file", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "create_runtime:reads_attr", - "span_start": 19, - "span_end": 19, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "30d4e8aae984ab84d523e80d02f1caeda52d547fa3d2aa47be8845931cabbca2", - "edge_type": "reads_attr", - "src_symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "src_qname": "create_runtime", - "dst_symbol_id": null, - "dst_ref": "runtime.add_config_file", - "resolution": "partial", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "validation": { - "passed": true, - "action": "return", - "reasons": [] - }, - "steps": [ - { - "step": "router", - "status": "completed", - "timings_ms": { - "router": 1 - }, - "output": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - } - }, - { - "step": "retrieval", - "status": "completed", - "timings_ms": { - "retrieval": 144 - }, - "output": { - "rag_count": 33, - "answer_path_rag_count": 33, - "resolved_symbol_status": "resolved", - "resolved_symbol": "create_runtime", - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "diagnostics": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "vector", - "C0_SOURCE_CHUNKS": "vector", - "C4_SEMANTIC_ROLES": "vector", - "C2_DEPENDENCY_GRAPH": "vector", - "C3_ENTRYPOINTS": "vector" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 8, - "C4_SEMANTIC_ROLES": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C3_ENTRYPOINTS": 6 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [] - }, - "C4_SEMANTIC_ROLES": { - "path_scope": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [] - } - }, - "fallback": { - "used": false, - "reason": null - }, - "retrieval_by_layer_ms": { - "C1_SYMBOL_CATALOG": 43, - "C0_SOURCE_CHUNKS": 20, - "C4_SEMANTIC_ROLES": 18, - "C2_DEPENDENCY_GRAPH": 47, - "C3_ENTRYPOINTS": 13 - } - } - }, - { - "step": "pre_evidence_gate", - "status": "passed", - "timings_ms": { - "pre_evidence_gate": 1 - }, - "input": { - "resolved_target": "create_runtime", - "sub_intent": "EXPLAIN", - "target_type": "symbol", - "evidence_count": 33, - "code_chunk_count": 33, - "entrypoint_count": 3, - "relation_count": 6, - "test_evidence_count": 0, - "symbol_resolution_status": "resolved", - "path_scope": [] - }, - "output": { - "passed": true, - "failure_reasons": [], - "degraded_message": "", - "evidence_count": 33 - } - }, - { - "step": "llm", - "status": "completed", - "timings_ms": { - "llm": 4185 - }, - "output": { - "prompt_name": "code_qa_explain_answer", - "answer_preview": "Функция `create_runtime` определена в файле `src/plba/bootstrap.py`. Она создаёт и конфигурирует экземпляр `RuntimeManager`, регистрируя модуль приложения и опционально добавляя файл конфигурации и HTTP-канал управления.\n\nОсновные действия функции:\n- Создаёт экземпляр `RuntimeManager`.\n- Если переда", - "resolved_target": "create_runtime", - "answer_policy_branch": "normal_answer", - "decision_reason": "evidence_sufficient" - } - }, - { - "step": "post_evidence_gate", - "status": "passed", - "timings_ms": { - "post_evidence_gate": 1, - "post_evidence_gate_recheck": 0, - "repair": 0 - }, - "input": { - "answer_mode": "normal", - "degraded_message": "", - "resolved_target": "create_runtime", - "draft_answer_preview": "Функция `create_runtime` определена в файле `src/plba/bootstrap.py`. Она создаёт и конфигурирует экземпляр `RuntimeManager`, регистрируя модуль приложения и опционально добавляя файл конфигурации и HTTP-канал управления.\n\nОсновные действия функции:\n- Создаёт экземпляр `RuntimeManager`.\n- Если переда", - "repair_candidate": true - }, - "output": { - "passed": true, - "action": "return", - "reasons": [], - "repair_used": false, - "final_answer_preview": "Функция `create_runtime` определена в файле `src/plba/bootstrap.py`. Она создаёт и конфигурирует экземпляр `RuntimeManager`, регистрируя модуль приложения и опционально добавляя файл конфигурации и HTTP-канал управления.\n\nОсновные действия функции:\n- Создаёт экземпляр `RuntimeManager`.\n- Если переда" - } - } - ] - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/plba_full_chain_subintents_v3/20260312_192715/full_chain_plba_code_subintents_v2_plba-v2-explain-create-runtime.md b/tests/pipeline_setup_v3/test_results/plba_full_chain_subintents_v3/20260312_192715/full_chain_plba_code_subintents_v2_plba-v2-explain-create-runtime.md deleted file mode 100644 index e4c0102..0000000 --- a/tests/pipeline_setup_v3/test_results/plba_full_chain_subintents_v3/20260312_192715/full_chain_plba_code_subintents_v2_plba-v2-explain-create-runtime.md +++ /dev/null @@ -1,305 +0,0 @@ -# plba-v2-explain-create-runtime - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_02_pipeline/full_chain_plba_code_subintents_v2.yaml -- runner: agent_runtime -- mode: full_chain -- passed: True - -## Query -Что делает функция create_runtime? - -## Actual -{ - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 33, - "llm_answer": "Функция `create_runtime` определена в файле `src/plba/bootstrap.py`. Она создаёт и конфигурирует экземпляр `RuntimeManager`, регистрируя модуль приложения и опционально добавляя файл конфигурации и HTTP-канал управления.\n\nОсновные действия функции:\n- Создаёт экземпляр `RuntimeManager`.\n- Если передан путь к конфигурационному файлу, вызывает `runtime.add_config_file(config_path)` для добавления конфигурации.\n- Если включён HTTP-контроль, регистрирует HTTP-канал управления через `runtime.control_plane.register_channel(HttpControlChannel(host=control_host, port=control_port, timeout=control_timeout))`.\n- Регистрирует модуль приложения методом `runtime.register_module(module)`.\n\nВозвращает сконфигурированный объект типа `RuntimeManager`.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "create_runtime" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] -} - -## Steps -[ - { - "step": "router", - "status": "completed", - "timings_ms": { - "router": 1 - }, - "output": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - } - }, - { - "step": "retrieval", - "status": "completed", - "timings_ms": { - "retrieval": 144 - }, - "output": { - "rag_count": 33, - "answer_path_rag_count": 33, - "resolved_symbol_status": "resolved", - "resolved_symbol": "create_runtime", - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "diagnostics": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "vector", - "C0_SOURCE_CHUNKS": "vector", - "C4_SEMANTIC_ROLES": "vector", - "C2_DEPENDENCY_GRAPH": "vector", - "C3_ENTRYPOINTS": "vector" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 8, - "C4_SEMANTIC_ROLES": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C3_ENTRYPOINTS": 6 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [] - }, - "C4_SEMANTIC_ROLES": { - "path_scope": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [] - } - }, - "fallback": { - "used": false, - "reason": null - }, - "retrieval_by_layer_ms": { - "C1_SYMBOL_CATALOG": 43, - "C0_SOURCE_CHUNKS": 20, - "C4_SEMANTIC_ROLES": 18, - "C2_DEPENDENCY_GRAPH": 47, - "C3_ENTRYPOINTS": 13 - } - } - }, - { - "step": "pre_evidence_gate", - "status": "passed", - "timings_ms": { - "pre_evidence_gate": 1 - }, - "input": { - "resolved_target": "create_runtime", - "sub_intent": "EXPLAIN", - "target_type": "symbol", - "evidence_count": 33, - "code_chunk_count": 33, - "entrypoint_count": 3, - "relation_count": 6, - "test_evidence_count": 0, - "symbol_resolution_status": "resolved", - "path_scope": [] - }, - "output": { - "passed": true, - "failure_reasons": [], - "degraded_message": "", - "evidence_count": 33 - } - }, - { - "step": "llm", - "status": "completed", - "timings_ms": { - "llm": 4185 - }, - "output": { - "prompt_name": "code_qa_explain_answer", - "answer_preview": "Функция `create_runtime` определена в файле `src/plba/bootstrap.py`. Она создаёт и конфигурирует экземпляр `RuntimeManager`, регистрируя модуль приложения и опционально добавляя файл конфигурации и HTTP-канал управления.\n\nОсновные действия функции:\n- Создаёт экземпляр `RuntimeManager`.\n- Если переда", - "resolved_target": "create_runtime", - "answer_policy_branch": "normal_answer", - "decision_reason": "evidence_sufficient" - } - }, - { - "step": "post_evidence_gate", - "status": "passed", - "timings_ms": { - "post_evidence_gate": 1, - "post_evidence_gate_recheck": 0, - "repair": 0 - }, - "input": { - "answer_mode": "normal", - "degraded_message": "", - "resolved_target": "create_runtime", - "draft_answer_preview": "Функция `create_runtime` определена в файле `src/plba/bootstrap.py`. Она создаёт и конфигурирует экземпляр `RuntimeManager`, регистрируя модуль приложения и опционально добавляя файл конфигурации и HTTP-канал управления.\n\nОсновные действия функции:\n- Создаёт экземпляр `RuntimeManager`.\n- Если переда", - "repair_candidate": true - }, - "output": { - "passed": true, - "action": "return", - "reasons": [], - "repair_used": false, - "final_answer_preview": "Функция `create_runtime` определена в файле `src/plba/bootstrap.py`. Она создаёт и конфигурирует экземпляр `RuntimeManager`, регистрируя модуль приложения и опционально добавляя файл конфигурации и HTTP-канал управления.\n\nОсновные действия функции:\n- Создаёт экземпляр `RuntimeManager`.\n- Если переда" - } - } -] - -## Diagnostics -{ - "intent_correct": null, - "target_found": true, - "layers_used": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_sufficient": true, - "answer_mode": "normal", - "resolved_target": "create_runtime", - "answer_policy_branch": "normal_answer", - "decision_reason": "evidence_sufficient", - "router_result": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "retrieval_profile": "code", - "sub_intent": "EXPLAIN", - "path_scope": [], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "symbol_resolution_status": "resolved" - }, - "retrieval_request": { - "rag_session_id": "7d11da21-faa0-4cea-aede-aeabe069164c", - "query": "Что делает функция create_runtime?", - "sub_intent": "EXPLAIN", - "path_scope": [], - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "per_layer_outcome": [ - { - "layer_id": "C1_SYMBOL_CATALOG", - "hit_count": 8, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C0_SOURCE_CHUNKS", - "hit_count": 8, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C4_SEMANTIC_ROLES", - "hit_count": 8, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C2_DEPENDENCY_GRAPH", - "hit_count": 6, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C3_ENTRYPOINTS", - "hit_count": 3, - "empty": false, - "fallback_used": false - } - ], - "empty_layers": [], - "evidence_gate_decision": { - "sufficient": true, - "failure_reasons": [], - "evidence_count": 33 - }, - "evidence_gate_input": { - "resolved_target": "create_runtime", - "sub_intent": "EXPLAIN", - "target_type": "symbol", - "evidence_count": 33, - "code_chunk_count": 33, - "entrypoint_count": 3, - "relation_count": 6, - "test_evidence_count": 0, - "symbol_resolution_status": "resolved", - "path_scope": [] - }, - "post_evidence_gate": { - "input": { - "answer_mode": "normal", - "degraded_message": "", - "resolved_target": "create_runtime", - "draft_answer_preview": "Функция `create_runtime` определена в файле `src/plba/bootstrap.py`. Она создаёт и конфигурирует экземпляр `RuntimeManager`, регистрируя модуль приложения и опционально добавляя файл конфигурации и HTTP-канал управления.\n\nОсновные действия функции:\n- Создаёт экземпляр `RuntimeManager`.\n- Если переда", - "repair_candidate": true - }, - "output": { - "passed": true, - "action": "return", - "reasons": [], - "repair_used": false, - "final_answer_preview": "Функция `create_runtime` определена в файле `src/plba/bootstrap.py`. Она создаёт и конфигурирует экземпляр `RuntimeManager`, регистрируя модуль приложения и опционально добавляя файл конфигурации и HTTP-канал управления.\n\nОсновные действия функции:\n- Создаёт экземпляр `RuntimeManager`.\n- Если переда" - } - }, - "failure_reasons": [], - "timings_ms": { - "router": 1, - "retrieval": 144, - "pre_evidence_gate": 1, - "llm": 4185, - "post_evidence_gate": 1 - } -} - -## Mismatches -- none \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/plba_full_chain_subintents_v3/20260312_192715/full_chain_plba_code_subintents_v2_plba-v2-explain-local-http-channel.json b/tests/pipeline_setup_v3/test_results/plba_full_chain_subintents_v3/20260312_192715/full_chain_plba_code_subintents_v2_plba-v2-explain-local-http-channel.json deleted file mode 100644 index 493bbf0..0000000 --- a/tests/pipeline_setup_v3/test_results/plba_full_chain_subintents_v3/20260312_192715/full_chain_plba_code_subintents_v2_plba-v2-explain-local-http-channel.json +++ /dev/null @@ -1,2237 +0,0 @@ -{ - "case_id": "plba-v2-explain-local-http-channel", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_02_pipeline/full_chain_plba_code_subintents_v2.yaml", - "runner": "agent_runtime", - "mode": "full_chain", - "query": "Почему в файле src/app_runtime/control/http_channel.py класс HttpControlChannel устроен так?", - "actual": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN_LOCAL", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 13, - "llm_answer": "Класс HttpControlChannel наследует ControlChannel и управляет HTTP-каналом контроля. \nИнициализация задает хост, порт, таймаут, создаёт экземпляр UvicornThreadRunner для запуска сервера и HttpControlAppFactory для создания FastAPI-приложения. \nМетод start запускает сервер с приложением, используя фабрики и передавая коллбэки здоровья и действий. \nМетоды _health_response и _action_response (не полностью показаны) вероятно отвечают за обработчики API-эндпоинтов здоровья и выполнения действий. \nОстальные детали, такие как полный контекст методов или их реализации, отсутствуют в данном фрагменте.", - "answer_mode": "answered", - "path_scope": [ - "src/app_runtime/control/http_channel.py" - ], - "symbol_candidates": [ - "HttpControlChannel" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C2_DEPENDENCY_GRAPH" - ] - }, - "passed": true, - "mismatches": [], - "details": { - "query": "Почему в файле src/app_runtime/control/http_channel.py класс HttpControlChannel устроен так?", - "router_result": { - "schema_version": "1.1", - "intent": "CODE_QA", - "retrieval_profile": "code", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query_plan": { - "raw": "Почему в файле src/app_runtime/control/http_channel.py класс HttpControlChannel устроен так?", - "normalized": "Почему в файле src/app_runtime/control/http_channel.py класс HttpControlChannel устроен так?", - "sub_intent": "EXPLAIN_LOCAL", - "negations": [], - "expansions": [ - "file", - "HttpControlChannel" - ], - "keyword_hints": [ - "src/app_runtime/control/http_channel.py", - "HttpControlChannel" - ], - "path_hints": [ - "src/app_runtime/control/http_channel.py" - ], - "doc_scope_hints": [], - "symbol_candidates": [ - "HttpControlChannel" - ], - "symbol_kind_hint": "class", - "anchors": [ - { - "type": "FILE_PATH", - "value": "src/app_runtime/control/http_channel.py", - "source": "user_text", - "subtype": null, - "span": { - "start": 15, - "end": 54 - }, - "confidence": 0.95 - }, - { - "type": "SYMBOL", - "value": "HttpControlChannel", - "source": "user_text", - "subtype": null, - "span": { - "start": 61, - "end": 79 - }, - "confidence": 0.88 - }, - { - "type": "KEY_TERM", - "value": "файл", - "source": "user_text", - "subtype": null, - "span": { - "start": 9, - "end": 14 - }, - "confidence": 0.9 - }, - { - "type": "KEY_TERM", - "value": "класс", - "source": "user_text", - "subtype": null, - "span": { - "start": 55, - "end": 60 - }, - "confidence": 0.9 - } - ] - }, - "retrieval_spec": { - "domains": [ - "CODE" - ], - "layer_queries": [ - { - "layer_id": "C1_SYMBOL_CATALOG", - "top_k": 8 - }, - { - "layer_id": "C0_SOURCE_CHUNKS", - "top_k": 12 - }, - { - "layer_id": "C2_DEPENDENCY_GRAPH", - "top_k": 4 - } - ], - "filters": { - "test_policy": "EXCLUDE", - "path_scope": [ - "src/app_runtime/control/http_channel.py" - ], - "language": [ - "python" - ] - }, - "rerank_profile": "code" - }, - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - }, - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "HttpControlChannel", - "alternatives": [ - "ControlChannel", - "ControlActionSet", - "JSONResponse", - "HttpControlAppFactory", - "UvicornThreadRunner" - ], - "confidence": 0.99 - }, - "evidence_policy": { - "require_def": true, - "require_flow": false, - "require_spec": false, - "allow_answer_without_evidence": false - } - }, - "retrieval_request": { - "rag_session_id": "7d11da21-faa0-4cea-aede-aeabe069164c", - "query": "Почему в файле src/app_runtime/control/http_channel.py класс HttpControlChannel устроен так?", - "sub_intent": "EXPLAIN_LOCAL", - "path_scope": [ - "src/app_runtime/control/http_channel.py" - ], - "keyword_hints": [ - "src/app_runtime/control/http_channel.py", - "HttpControlChannel" - ], - "symbol_candidates": [ - "HttpControlChannel" - ], - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C2_DEPENDENCY_GRAPH" - ], - "retrieval_spec": { - "domains": [ - "CODE" - ], - "layer_queries": [ - { - "layer_id": "C1_SYMBOL_CATALOG", - "top_k": 8 - }, - { - "layer_id": "C0_SOURCE_CHUNKS", - "top_k": 12 - }, - { - "layer_id": "C2_DEPENDENCY_GRAPH", - "top_k": 4 - } - ], - "filters": { - "test_policy": "EXCLUDE", - "path_scope": [ - "src/app_runtime/control/http_channel.py" - ], - "language": [ - "python" - ] - }, - "rerank_profile": "code" - }, - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - }, - "query_plan": { - "raw": "Почему в файле src/app_runtime/control/http_channel.py класс HttpControlChannel устроен так?", - "normalized": "Почему в файле src/app_runtime/control/http_channel.py класс HttpControlChannel устроен так?", - "sub_intent": "EXPLAIN_LOCAL", - "negations": [], - "expansions": [ - "file", - "HttpControlChannel" - ], - "keyword_hints": [ - "src/app_runtime/control/http_channel.py", - "HttpControlChannel" - ], - "path_hints": [ - "src/app_runtime/control/http_channel.py" - ], - "doc_scope_hints": [], - "symbol_candidates": [ - "HttpControlChannel" - ], - "symbol_kind_hint": "class", - "anchors": [ - { - "type": "FILE_PATH", - "value": "src/app_runtime/control/http_channel.py", - "source": "user_text", - "subtype": null, - "span": { - "start": 15, - "end": 54 - }, - "confidence": 0.95 - }, - { - "type": "SYMBOL", - "value": "HttpControlChannel", - "source": "user_text", - "subtype": null, - "span": { - "start": 61, - "end": 79 - }, - "confidence": 0.88 - }, - { - "type": "KEY_TERM", - "value": "файл", - "source": "user_text", - "subtype": null, - "span": { - "start": 9, - "end": 14 - }, - "confidence": 0.9 - }, - { - "type": "KEY_TERM", - "value": "класс", - "source": "user_text", - "subtype": null, - "span": { - "start": 55, - "end": 60 - }, - "confidence": 0.9 - } - ] - } - }, - "retrieval_result": { - "target_symbol_candidates": [ - "ControlChannel", - "ControlActionSet", - "JSONResponse", - "HttpControlAppFactory", - "UvicornThreadRunner", - "HttpControlChannel", - "HttpControlChannel.__init__", - "HttpControlChannel.start" - ], - "resolved_symbol": "HttpControlChannel", - "symbol_resolution_status": "resolved", - "file_candidates": [ - "src/app_runtime/control/http_channel.py" - ], - "code_chunks": [ - { - "layer": "C1_SYMBOL_CATALOG", - "path": "src/app_runtime/control/http_channel.py", - "title": "ControlChannel", - "content": "const ControlChannel\nControlChannel = app_runtime.control.base.ControlChannel", - "start_line": 7, - "end_line": 7, - "metadata": { - "symbol_id": "6e69a934202b6e11891af8fb72b2033e8ae3071eb7577c64f5545b5b7ddfb51e", - "qname": "ControlChannel", - "kind": "const", - "signature": "ControlChannel = app_runtime.control.base.ControlChannel", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.control.http_channel", - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C1_SYMBOL_CATALOG", - "path": "src/app_runtime/control/http_channel.py", - "title": "ControlActionSet", - "content": "const ControlActionSet\nControlActionSet = app_runtime.control.base.ControlActionSet", - "start_line": 7, - "end_line": 7, - "metadata": { - "symbol_id": "2132a5717c57061e3488a1bf4d43650a60ea903a42278f4d494c014bc80d2df9", - "qname": "ControlActionSet", - "kind": "const", - "signature": "ControlActionSet = app_runtime.control.base.ControlActionSet", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.control.http_channel", - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C1_SYMBOL_CATALOG", - "path": "src/app_runtime/control/http_channel.py", - "title": "JSONResponse", - "content": "const JSONResponse\nJSONResponse = fastapi.responses.JSONResponse", - "start_line": 5, - "end_line": 5, - "metadata": { - "symbol_id": "238f600ea55013e25a3e1451f7fd65caabea125b314b89247900cdab5b801a23", - "qname": "JSONResponse", - "kind": "const", - "signature": "JSONResponse = fastapi.responses.JSONResponse", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.control.http_channel", - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C1_SYMBOL_CATALOG", - "path": "src/app_runtime/control/http_channel.py", - "title": "HttpControlAppFactory", - "content": "const HttpControlAppFactory\nHttpControlAppFactory = app_runtime.control.http_app.HttpControlAppFactory", - "start_line": 8, - "end_line": 8, - "metadata": { - "symbol_id": "9ee00379ee797cd2386e88a6e37dc69e3e31de9144fc4b95f0206cd1430e8983", - "qname": "HttpControlAppFactory", - "kind": "const", - "signature": "HttpControlAppFactory = app_runtime.control.http_app.HttpControlAppFactory", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.control.http_channel", - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C1_SYMBOL_CATALOG", - "path": "src/app_runtime/control/http_channel.py", - "title": "UvicornThreadRunner", - "content": "const UvicornThreadRunner\nUvicornThreadRunner = app_runtime.control.http_runner.UvicornThreadRunner", - "start_line": 9, - "end_line": 9, - "metadata": { - "symbol_id": "c6ee53f4ff75d5b34ee95854cb63bb3ecfa163023717cd969b8cba937a0cd3b3", - "qname": "UvicornThreadRunner", - "kind": "const", - "signature": "UvicornThreadRunner = app_runtime.control.http_runner.UvicornThreadRunner", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.control.http_channel", - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C1_SYMBOL_CATALOG", - "path": "src/app_runtime/control/http_channel.py", - "title": "HttpControlChannel", - "content": "class HttpControlChannel\nHttpControlChannel(ControlChannel)", - "start_line": 12, - "end_line": 57, - "metadata": { - "symbol_id": "1c9fbdc24819e5604c26ea55428a74310f03a03e1af197ed84846af61e42fdb0", - "qname": "HttpControlChannel", - "kind": "class", - "signature": "HttpControlChannel(ControlChannel)", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.control.http_channel", - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C1_SYMBOL_CATALOG", - "path": "src/app_runtime/control/http_channel.py", - "title": "HttpControlChannel.__init__", - "content": "method HttpControlChannel.__init__\n__init__(self, host, port, timeout)", - "start_line": 13, - "end_line": 17, - "metadata": { - "symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "qname": "HttpControlChannel.__init__", - "kind": "method", - "signature": "__init__(self, host, port, timeout)", - "parent_symbol_id": "HttpControlChannel", - "package_or_module": "src.app_runtime.control.http_channel", - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C1_SYMBOL_CATALOG", - "path": "src/app_runtime/control/http_channel.py", - "title": "HttpControlChannel.start", - "content": "method HttpControlChannel.start\nstart(self, actions)", - "start_line": 19, - "end_line": 22, - "metadata": { - "symbol_id": "d1933f04137f52535b6525f1b93ff2cd83bfb216b480e887e791ed1714cda8e0", - "qname": "HttpControlChannel.start", - "kind": "method", - "signature": "start(self, actions)", - "parent_symbol_id": "HttpControlChannel", - "package_or_module": "src.app_runtime.control.http_channel", - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C0_SOURCE_CHUNKS", - "path": "src/app_runtime/control/http_channel.py", - "title": "src/app_runtime/control/http_channel.py:HttpControlChannel", - "content": "class HttpControlChannel(ControlChannel):\n def __init__(self, host: str, port: int, timeout: int) -> None:\n self._timeout = timeout\n self._runner = UvicornThreadRunner(host, port, timeout)\n self._factory = HttpControlAppFactory()\n self._actions: ControlActionSet | None = None\n\n async def start(self, actions: ControlActionSet) -> None:\n self._actions = actions\n app = self._factory.create(self._health_response, self._action_response)\n await self._runner.start(app)\n\n async def stop(self) -> None:\n await self._runner.stop()\n\n @property\n def port(self) -> int:\n return self._runner.port\n\n async def _health_response(self) -> dict[str, object]:\n if self._actions is None:\n return {\"status\": \"unhealthy\", \"detail\": \"control actions are not configured\"}\n return await asyncio.wait_for(self._actions.health(), timeout=float(self._timeout))\n\n async def _action_response(self, action: str, _client_source: str = \"unknown\") -> JSONResponse:\n if self._actions is None:\n return JSONResponse(content={\"status\": \"error\", \"detail\": f\"{action} handler is not configured\"}, status_code=404)\n callbacks = {\n \"start\": self._actions.start,\n \"stop\": self._actions.stop,\n \"status\": self._actions.status,\n }\n callback = callbacks.get(action)\n if callback is None:\n return JSONResponse(content={\"status\": \"error\", \"detail\": f\"unsupported action: {action}\"}, status_code=404)\n action_timeout = max(float(self._timeout), 10.0) if action in {\"start\", \"stop\"} else float(self._timeout)\n try:\n detail = await asyncio.wait_for(callback(), timeout=action_timeout)\n except asyncio.TimeoutError:\n return JSONResponse(\n content={\"status\": \"accepted\", \"detail\": f\"{action} operation is still in progress\"},\n status_code=202,\n )\n except Exception as exc:\n return JSONResponse(content={\"status\": \"error\", \"detail\": str(exc)}, status_code=500)\n return JSONResponse(content={\"status\": \"ok\", \"detail\": detail or f\"{action} action accepted\"}, status_code=200)", - "start_line": 12, - "end_line": 57, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.http_channel", - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "path": "src/app_runtime/control/http_channel.py", - "title": "HttpControlChannel.__init__:dataflow_slice", - "content": "HttpControlChannel.__init__\n -> HttpControlChannel._timeout\n -> HttpControlChannel._action_response", - "start_line": 14, - "end_line": 47, - "metadata": { - "edge_id": "c3ef21fcae96c82c00be74b3ab827d4af2085d89cb3fa5521c19a174aad84dbb", - "edge_type": "dataflow_slice", - "src_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "src_qname": "HttpControlChannel.__init__", - "dst_symbol_id": "e64969024ccaeb34d8d91473fad07b3b3d341875846392e7a006406c7ada1954", - "dst_ref": "HttpControlChannel._action_response", - "resolution": "resolved", - "slice_id": "c3ef21fcae96c82c00be74b3ab827d4af2085d89cb3fa5521c19a174aad84dbb", - "root_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "path_symbols": [ - "HttpControlChannel.__init__", - "HttpControlChannel._timeout", - "HttpControlChannel._action_response" - ], - "path_symbol_ids": [ - "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "e64969024ccaeb34d8d91473fad07b3b3d341875846392e7a006406c7ada1954" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "path": "src/app_runtime/control/http_channel.py", - "title": "HttpControlChannel.__init__:dataflow_slice", - "content": "HttpControlChannel.__init__\n -> HttpControlChannel._runner\n -> HttpControlChannel.start", - "start_line": 15, - "end_line": 22, - "metadata": { - "edge_id": "51d73913df709152258ed1b9a8c8f4eb3c575eccfe6b982aef0b28e0789a29da", - "edge_type": "dataflow_slice", - "src_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "src_qname": "HttpControlChannel.__init__", - "dst_symbol_id": "d1933f04137f52535b6525f1b93ff2cd83bfb216b480e887e791ed1714cda8e0", - "dst_ref": "HttpControlChannel.start", - "resolution": "resolved", - "slice_id": "51d73913df709152258ed1b9a8c8f4eb3c575eccfe6b982aef0b28e0789a29da", - "root_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "path_symbols": [ - "HttpControlChannel.__init__", - "HttpControlChannel._runner", - "HttpControlChannel.start" - ], - "path_symbol_ids": [ - "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "d1933f04137f52535b6525f1b93ff2cd83bfb216b480e887e791ed1714cda8e0" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "path": "src/app_runtime/control/http_channel.py", - "title": "HttpControlChannel.__init__:dataflow_slice", - "content": "HttpControlChannel.__init__\n -> HttpControlChannel._timeout\n -> HttpControlChannel._health_response", - "start_line": 14, - "end_line": 34, - "metadata": { - "edge_id": "f858f5c9e575f6c4cdfe3853571b7ee21d1f628a443541d2037c3dc9d0790bef", - "edge_type": "dataflow_slice", - "src_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "src_qname": "HttpControlChannel.__init__", - "dst_symbol_id": "e84bf04e9cd2127df235b7064d05f47e19f19a89c7c82f4c247231d4e8fa426a", - "dst_ref": "HttpControlChannel._health_response", - "resolution": "resolved", - "slice_id": "f858f5c9e575f6c4cdfe3853571b7ee21d1f628a443541d2037c3dc9d0790bef", - "root_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "path_symbols": [ - "HttpControlChannel.__init__", - "HttpControlChannel._timeout", - "HttpControlChannel._health_response" - ], - "path_symbol_ids": [ - "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "e84bf04e9cd2127df235b7064d05f47e19f19a89c7c82f4c247231d4e8fa426a" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "path": "src/app_runtime/control/http_channel.py", - "title": "HttpControlChannel.__init__:dataflow_slice", - "content": "HttpControlChannel.__init__\n -> HttpControlChannel._runner\n -> HttpControlChannel.stop", - "start_line": 15, - "end_line": 25, - "metadata": { - "edge_id": "0f827ef81a990258a8a74381c8564a8361afa6712dba3200592659c939adcb9d", - "edge_type": "dataflow_slice", - "src_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "src_qname": "HttpControlChannel.__init__", - "dst_symbol_id": "f29ab212620093d72be20e26c5a399624c7939a6056a728762ed3f84a250bfa3", - "dst_ref": "HttpControlChannel.stop", - "resolution": "resolved", - "slice_id": "0f827ef81a990258a8a74381c8564a8361afa6712dba3200592659c939adcb9d", - "root_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "path_symbols": [ - "HttpControlChannel.__init__", - "HttpControlChannel._runner", - "HttpControlChannel.stop" - ], - "path_symbol_ids": [ - "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "f29ab212620093d72be20e26c5a399624c7939a6056a728762ed3f84a250bfa3" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "relations": [ - { - "path": "src/app_runtime/control/http_channel.py", - "start_line": 14, - "end_line": 47, - "edge_type": "dataflow_slice", - "source": "HttpControlChannel.__init__", - "target": "HttpControlChannel._action_response", - "metadata": { - "edge_id": "c3ef21fcae96c82c00be74b3ab827d4af2085d89cb3fa5521c19a174aad84dbb", - "edge_type": "dataflow_slice", - "src_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "src_qname": "HttpControlChannel.__init__", - "dst_symbol_id": "e64969024ccaeb34d8d91473fad07b3b3d341875846392e7a006406c7ada1954", - "dst_ref": "HttpControlChannel._action_response", - "resolution": "resolved", - "slice_id": "c3ef21fcae96c82c00be74b3ab827d4af2085d89cb3fa5521c19a174aad84dbb", - "root_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "path_symbols": [ - "HttpControlChannel.__init__", - "HttpControlChannel._timeout", - "HttpControlChannel._action_response" - ], - "path_symbol_ids": [ - "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "e64969024ccaeb34d8d91473fad07b3b3d341875846392e7a006406c7ada1954" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - }, - "content": "HttpControlChannel.__init__\n -> HttpControlChannel._timeout\n -> HttpControlChannel._action_response" - }, - { - "path": "src/app_runtime/control/http_channel.py", - "start_line": 15, - "end_line": 22, - "edge_type": "dataflow_slice", - "source": "HttpControlChannel.__init__", - "target": "HttpControlChannel.start", - "metadata": { - "edge_id": "51d73913df709152258ed1b9a8c8f4eb3c575eccfe6b982aef0b28e0789a29da", - "edge_type": "dataflow_slice", - "src_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "src_qname": "HttpControlChannel.__init__", - "dst_symbol_id": "d1933f04137f52535b6525f1b93ff2cd83bfb216b480e887e791ed1714cda8e0", - "dst_ref": "HttpControlChannel.start", - "resolution": "resolved", - "slice_id": "51d73913df709152258ed1b9a8c8f4eb3c575eccfe6b982aef0b28e0789a29da", - "root_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "path_symbols": [ - "HttpControlChannel.__init__", - "HttpControlChannel._runner", - "HttpControlChannel.start" - ], - "path_symbol_ids": [ - "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "d1933f04137f52535b6525f1b93ff2cd83bfb216b480e887e791ed1714cda8e0" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - }, - "content": "HttpControlChannel.__init__\n -> HttpControlChannel._runner\n -> HttpControlChannel.start" - }, - { - "path": "src/app_runtime/control/http_channel.py", - "start_line": 14, - "end_line": 34, - "edge_type": "dataflow_slice", - "source": "HttpControlChannel.__init__", - "target": "HttpControlChannel._health_response", - "metadata": { - "edge_id": "f858f5c9e575f6c4cdfe3853571b7ee21d1f628a443541d2037c3dc9d0790bef", - "edge_type": "dataflow_slice", - "src_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "src_qname": "HttpControlChannel.__init__", - "dst_symbol_id": "e84bf04e9cd2127df235b7064d05f47e19f19a89c7c82f4c247231d4e8fa426a", - "dst_ref": "HttpControlChannel._health_response", - "resolution": "resolved", - "slice_id": "f858f5c9e575f6c4cdfe3853571b7ee21d1f628a443541d2037c3dc9d0790bef", - "root_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "path_symbols": [ - "HttpControlChannel.__init__", - "HttpControlChannel._timeout", - "HttpControlChannel._health_response" - ], - "path_symbol_ids": [ - "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "e84bf04e9cd2127df235b7064d05f47e19f19a89c7c82f4c247231d4e8fa426a" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - }, - "content": "HttpControlChannel.__init__\n -> HttpControlChannel._timeout\n -> HttpControlChannel._health_response" - }, - { - "path": "src/app_runtime/control/http_channel.py", - "start_line": 15, - "end_line": 25, - "edge_type": "dataflow_slice", - "source": "HttpControlChannel.__init__", - "target": "HttpControlChannel.stop", - "metadata": { - "edge_id": "0f827ef81a990258a8a74381c8564a8361afa6712dba3200592659c939adcb9d", - "edge_type": "dataflow_slice", - "src_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "src_qname": "HttpControlChannel.__init__", - "dst_symbol_id": "f29ab212620093d72be20e26c5a399624c7939a6056a728762ed3f84a250bfa3", - "dst_ref": "HttpControlChannel.stop", - "resolution": "resolved", - "slice_id": "0f827ef81a990258a8a74381c8564a8361afa6712dba3200592659c939adcb9d", - "root_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "path_symbols": [ - "HttpControlChannel.__init__", - "HttpControlChannel._runner", - "HttpControlChannel.stop" - ], - "path_symbol_ids": [ - "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "f29ab212620093d72be20e26c5a399624c7939a6056a728762ed3f84a250bfa3" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - }, - "content": "HttpControlChannel.__init__\n -> HttpControlChannel._runner\n -> HttpControlChannel.stop" - } - ], - "semantic_hints": [], - "entrypoints": [], - "test_candidates": [], - "layer_outcomes": [ - { - "layer_id": "C1_SYMBOL_CATALOG", - "hit_count": 8, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C0_SOURCE_CHUNKS", - "hit_count": 1, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C2_DEPENDENCY_GRAPH", - "hit_count": 4, - "empty": false, - "fallback_used": false - } - ], - "missing_layers": [], - "raw_rows": [ - { - "path": "src/app_runtime/control/http_channel.py", - "content": "const ControlChannel\nControlChannel = app_runtime.control.base.ControlChannel", - "layer": "C1_SYMBOL_CATALOG", - "title": "ControlChannel", - "span_start": 7, - "span_end": 7, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": null, - "metadata": { - "symbol_id": "6e69a934202b6e11891af8fb72b2033e8ae3071eb7577c64f5545b5b7ddfb51e", - "qname": "ControlChannel", - "kind": "const", - "signature": "ControlChannel = app_runtime.control.base.ControlChannel", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.control.http_channel", - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "const ControlActionSet\nControlActionSet = app_runtime.control.base.ControlActionSet", - "layer": "C1_SYMBOL_CATALOG", - "title": "ControlActionSet", - "span_start": 7, - "span_end": 7, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": null, - "metadata": { - "symbol_id": "2132a5717c57061e3488a1bf4d43650a60ea903a42278f4d494c014bc80d2df9", - "qname": "ControlActionSet", - "kind": "const", - "signature": "ControlActionSet = app_runtime.control.base.ControlActionSet", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.control.http_channel", - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "const JSONResponse\nJSONResponse = fastapi.responses.JSONResponse", - "layer": "C1_SYMBOL_CATALOG", - "title": "JSONResponse", - "span_start": 5, - "span_end": 5, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": null, - "metadata": { - "symbol_id": "238f600ea55013e25a3e1451f7fd65caabea125b314b89247900cdab5b801a23", - "qname": "JSONResponse", - "kind": "const", - "signature": "JSONResponse = fastapi.responses.JSONResponse", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.control.http_channel", - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "const HttpControlAppFactory\nHttpControlAppFactory = app_runtime.control.http_app.HttpControlAppFactory", - "layer": "C1_SYMBOL_CATALOG", - "title": "HttpControlAppFactory", - "span_start": 8, - "span_end": 8, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": null, - "metadata": { - "symbol_id": "9ee00379ee797cd2386e88a6e37dc69e3e31de9144fc4b95f0206cd1430e8983", - "qname": "HttpControlAppFactory", - "kind": "const", - "signature": "HttpControlAppFactory = app_runtime.control.http_app.HttpControlAppFactory", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.control.http_channel", - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "const UvicornThreadRunner\nUvicornThreadRunner = app_runtime.control.http_runner.UvicornThreadRunner", - "layer": "C1_SYMBOL_CATALOG", - "title": "UvicornThreadRunner", - "span_start": 9, - "span_end": 9, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": null, - "metadata": { - "symbol_id": "c6ee53f4ff75d5b34ee95854cb63bb3ecfa163023717cd969b8cba937a0cd3b3", - "qname": "UvicornThreadRunner", - "kind": "const", - "signature": "UvicornThreadRunner = app_runtime.control.http_runner.UvicornThreadRunner", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.control.http_channel", - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "class HttpControlChannel\nHttpControlChannel(ControlChannel)", - "layer": "C1_SYMBOL_CATALOG", - "title": "HttpControlChannel", - "span_start": 12, - "span_end": 57, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": null, - "metadata": { - "symbol_id": "1c9fbdc24819e5604c26ea55428a74310f03a03e1af197ed84846af61e42fdb0", - "qname": "HttpControlChannel", - "kind": "class", - "signature": "HttpControlChannel(ControlChannel)", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.control.http_channel", - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "method HttpControlChannel.__init__\n__init__(self, host, port, timeout)", - "layer": "C1_SYMBOL_CATALOG", - "title": "HttpControlChannel.__init__", - "span_start": 13, - "span_end": 17, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": null, - "metadata": { - "symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "qname": "HttpControlChannel.__init__", - "kind": "method", - "signature": "__init__(self, host, port, timeout)", - "parent_symbol_id": "HttpControlChannel", - "package_or_module": "src.app_runtime.control.http_channel", - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "method HttpControlChannel.start\nstart(self, actions)", - "layer": "C1_SYMBOL_CATALOG", - "title": "HttpControlChannel.start", - "span_start": 19, - "span_end": 22, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": null, - "metadata": { - "symbol_id": "d1933f04137f52535b6525f1b93ff2cd83bfb216b480e887e791ed1714cda8e0", - "qname": "HttpControlChannel.start", - "kind": "method", - "signature": "start(self, actions)", - "parent_symbol_id": "HttpControlChannel", - "package_or_module": "src.app_runtime.control.http_channel", - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "class HttpControlChannel(ControlChannel):\n def __init__(self, host: str, port: int, timeout: int) -> None:\n self._timeout = timeout\n self._runner = UvicornThreadRunner(host, port, timeout)\n self._factory = HttpControlAppFactory()\n self._actions: ControlActionSet | None = None\n\n async def start(self, actions: ControlActionSet) -> None:\n self._actions = actions\n app = self._factory.create(self._health_response, self._action_response)\n await self._runner.start(app)\n\n async def stop(self) -> None:\n await self._runner.stop()\n\n @property\n def port(self) -> int:\n return self._runner.port\n\n async def _health_response(self) -> dict[str, object]:\n if self._actions is None:\n return {\"status\": \"unhealthy\", \"detail\": \"control actions are not configured\"}\n return await asyncio.wait_for(self._actions.health(), timeout=float(self._timeout))\n\n async def _action_response(self, action: str, _client_source: str = \"unknown\") -> JSONResponse:\n if self._actions is None:\n return JSONResponse(content={\"status\": \"error\", \"detail\": f\"{action} handler is not configured\"}, status_code=404)\n callbacks = {\n \"start\": self._actions.start,\n \"stop\": self._actions.stop,\n \"status\": self._actions.status,\n }\n callback = callbacks.get(action)\n if callback is None:\n return JSONResponse(content={\"status\": \"error\", \"detail\": f\"unsupported action: {action}\"}, status_code=404)\n action_timeout = max(float(self._timeout), 10.0) if action in {\"start\", \"stop\"} else float(self._timeout)\n try:\n detail = await asyncio.wait_for(callback(), timeout=action_timeout)\n except asyncio.TimeoutError:\n return JSONResponse(\n content={\"status\": \"accepted\", \"detail\": f\"{action} operation is still in progress\"},\n status_code=202,\n )\n except Exception as exc:\n return JSONResponse(content={\"status\": \"error\", \"detail\": str(exc)}, status_code=500)\n return JSONResponse(content={\"status\": \"ok\", \"detail\": detail or f\"{action} action accepted\"}, status_code=200)", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/http_channel.py:HttpControlChannel", - "span_start": 12, - "span_end": 57, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": null, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.http_channel", - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel.__init__\n -> HttpControlChannel._timeout\n -> HttpControlChannel._action_response", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "HttpControlChannel.__init__:dataflow_slice", - "span_start": 14, - "span_end": 47, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": null, - "metadata": { - "edge_id": "c3ef21fcae96c82c00be74b3ab827d4af2085d89cb3fa5521c19a174aad84dbb", - "edge_type": "dataflow_slice", - "src_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "src_qname": "HttpControlChannel.__init__", - "dst_symbol_id": "e64969024ccaeb34d8d91473fad07b3b3d341875846392e7a006406c7ada1954", - "dst_ref": "HttpControlChannel._action_response", - "resolution": "resolved", - "slice_id": "c3ef21fcae96c82c00be74b3ab827d4af2085d89cb3fa5521c19a174aad84dbb", - "root_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "path_symbols": [ - "HttpControlChannel.__init__", - "HttpControlChannel._timeout", - "HttpControlChannel._action_response" - ], - "path_symbol_ids": [ - "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "e64969024ccaeb34d8d91473fad07b3b3d341875846392e7a006406c7ada1954" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel.__init__\n -> HttpControlChannel._runner\n -> HttpControlChannel.start", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "HttpControlChannel.__init__:dataflow_slice", - "span_start": 15, - "span_end": 22, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": null, - "metadata": { - "edge_id": "51d73913df709152258ed1b9a8c8f4eb3c575eccfe6b982aef0b28e0789a29da", - "edge_type": "dataflow_slice", - "src_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "src_qname": "HttpControlChannel.__init__", - "dst_symbol_id": "d1933f04137f52535b6525f1b93ff2cd83bfb216b480e887e791ed1714cda8e0", - "dst_ref": "HttpControlChannel.start", - "resolution": "resolved", - "slice_id": "51d73913df709152258ed1b9a8c8f4eb3c575eccfe6b982aef0b28e0789a29da", - "root_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "path_symbols": [ - "HttpControlChannel.__init__", - "HttpControlChannel._runner", - "HttpControlChannel.start" - ], - "path_symbol_ids": [ - "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "d1933f04137f52535b6525f1b93ff2cd83bfb216b480e887e791ed1714cda8e0" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel.__init__\n -> HttpControlChannel._timeout\n -> HttpControlChannel._health_response", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "HttpControlChannel.__init__:dataflow_slice", - "span_start": 14, - "span_end": 34, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": null, - "metadata": { - "edge_id": "f858f5c9e575f6c4cdfe3853571b7ee21d1f628a443541d2037c3dc9d0790bef", - "edge_type": "dataflow_slice", - "src_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "src_qname": "HttpControlChannel.__init__", - "dst_symbol_id": "e84bf04e9cd2127df235b7064d05f47e19f19a89c7c82f4c247231d4e8fa426a", - "dst_ref": "HttpControlChannel._health_response", - "resolution": "resolved", - "slice_id": "f858f5c9e575f6c4cdfe3853571b7ee21d1f628a443541d2037c3dc9d0790bef", - "root_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "path_symbols": [ - "HttpControlChannel.__init__", - "HttpControlChannel._timeout", - "HttpControlChannel._health_response" - ], - "path_symbol_ids": [ - "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "e84bf04e9cd2127df235b7064d05f47e19f19a89c7c82f4c247231d4e8fa426a" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel.__init__\n -> HttpControlChannel._runner\n -> HttpControlChannel.stop", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "HttpControlChannel.__init__:dataflow_slice", - "span_start": 15, - "span_end": 25, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": null, - "metadata": { - "edge_id": "0f827ef81a990258a8a74381c8564a8361afa6712dba3200592659c939adcb9d", - "edge_type": "dataflow_slice", - "src_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "src_qname": "HttpControlChannel.__init__", - "dst_symbol_id": "f29ab212620093d72be20e26c5a399624c7939a6056a728762ed3f84a250bfa3", - "dst_ref": "HttpControlChannel.stop", - "resolution": "resolved", - "slice_id": "0f827ef81a990258a8a74381c8564a8361afa6712dba3200592659c939adcb9d", - "root_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "path_symbols": [ - "HttpControlChannel.__init__", - "HttpControlChannel._runner", - "HttpControlChannel.stop" - ], - "path_symbol_ids": [ - "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "f29ab212620093d72be20e26c5a399624c7939a6056a728762ed3f84a250bfa3" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "retrieval_report": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C2_DEPENDENCY_GRAPH" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "vector", - "C0_SOURCE_CHUNKS": "vector", - "C2_DEPENDENCY_GRAPH": "vector" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 12, - "C2_DEPENDENCY_GRAPH": 4 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [ - "src/app_runtime/control/http_channel.py" - ] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src/app_runtime/control/http_channel.py" - ] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src/app_runtime/control/http_channel.py" - ] - } - }, - "fallback": { - "used": false, - "reason": null - }, - "retrieval_by_layer_ms": { - "C1_SYMBOL_CATALOG": 40, - "C0_SOURCE_CHUNKS": 17, - "C2_DEPENDENCY_GRAPH": 18 - } - } - }, - "diagnostics": { - "intent_correct": null, - "target_found": true, - "layers_used": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C2_DEPENDENCY_GRAPH" - ], - "retrieval_sufficient": true, - "answer_mode": "normal", - "resolved_target": "HttpControlChannel", - "answer_policy_branch": "normal_answer", - "decision_reason": "evidence_sufficient", - "router_result": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "retrieval_profile": "code", - "sub_intent": "EXPLAIN_LOCAL", - "path_scope": [ - "src/app_runtime/control/http_channel.py" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C2_DEPENDENCY_GRAPH" - ], - "symbol_resolution_status": "resolved" - }, - "retrieval_request": { - "rag_session_id": "7d11da21-faa0-4cea-aede-aeabe069164c", - "query": "Почему в файле src/app_runtime/control/http_channel.py класс HttpControlChannel устроен так?", - "sub_intent": "EXPLAIN_LOCAL", - "path_scope": [ - "src/app_runtime/control/http_channel.py" - ], - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C2_DEPENDENCY_GRAPH" - ] - }, - "per_layer_outcome": [ - { - "layer_id": "C1_SYMBOL_CATALOG", - "hit_count": 8, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C0_SOURCE_CHUNKS", - "hit_count": 1, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C2_DEPENDENCY_GRAPH", - "hit_count": 4, - "empty": false, - "fallback_used": false - } - ], - "empty_layers": [], - "evidence_gate_decision": { - "sufficient": true, - "failure_reasons": [], - "evidence_count": 13 - }, - "evidence_gate_input": { - "resolved_target": "HttpControlChannel", - "sub_intent": "EXPLAIN_LOCAL", - "target_type": "symbol", - "evidence_count": 13, - "code_chunk_count": 13, - "entrypoint_count": 0, - "relation_count": 4, - "test_evidence_count": 0, - "symbol_resolution_status": "resolved", - "path_scope": [ - "src/app_runtime/control/http_channel.py" - ] - }, - "post_evidence_gate": { - "input": { - "answer_mode": "normal", - "degraded_message": "", - "resolved_target": "HttpControlChannel", - "draft_answer_preview": "Класс HttpControlChannel наследует ControlChannel и управляет HTTP-каналом контроля. \nИнициализация задает хост, порт, таймаут, создаёт экземпляр UvicornThreadRunner для запуска сервера и HttpControlAppFactory для создания FastAPI-приложения. \nМетод start запускает сервер с приложением, используя фа", - "repair_candidate": true - }, - "output": { - "passed": true, - "action": "return", - "reasons": [], - "repair_used": false, - "final_answer_preview": "Класс HttpControlChannel наследует ControlChannel и управляет HTTP-каналом контроля. \nИнициализация задает хост, порт, таймаут, создаёт экземпляр UvicornThreadRunner для запуска сервера и HttpControlAppFactory для создания FastAPI-приложения. \nМетод start запускает сервер с приложением, используя фа" - } - }, - "failure_reasons": [], - "timings_ms": { - "router": 1, - "retrieval": 75, - "pre_evidence_gate": 1, - "llm": 3936, - "post_evidence_gate": 1 - } - }, - "rag_rows": [ - { - "path": "src/app_runtime/control/http_channel.py", - "content": "const ControlChannel\nControlChannel = app_runtime.control.base.ControlChannel", - "layer": "C1_SYMBOL_CATALOG", - "title": "ControlChannel", - "span_start": 7, - "span_end": 7, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "6e69a934202b6e11891af8fb72b2033e8ae3071eb7577c64f5545b5b7ddfb51e", - "qname": "ControlChannel", - "kind": "const", - "signature": "ControlChannel = app_runtime.control.base.ControlChannel", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.control.http_channel", - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "const ControlActionSet\nControlActionSet = app_runtime.control.base.ControlActionSet", - "layer": "C1_SYMBOL_CATALOG", - "title": "ControlActionSet", - "span_start": 7, - "span_end": 7, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "2132a5717c57061e3488a1bf4d43650a60ea903a42278f4d494c014bc80d2df9", - "qname": "ControlActionSet", - "kind": "const", - "signature": "ControlActionSet = app_runtime.control.base.ControlActionSet", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.control.http_channel", - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "const JSONResponse\nJSONResponse = fastapi.responses.JSONResponse", - "layer": "C1_SYMBOL_CATALOG", - "title": "JSONResponse", - "span_start": 5, - "span_end": 5, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "238f600ea55013e25a3e1451f7fd65caabea125b314b89247900cdab5b801a23", - "qname": "JSONResponse", - "kind": "const", - "signature": "JSONResponse = fastapi.responses.JSONResponse", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.control.http_channel", - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "const HttpControlAppFactory\nHttpControlAppFactory = app_runtime.control.http_app.HttpControlAppFactory", - "layer": "C1_SYMBOL_CATALOG", - "title": "HttpControlAppFactory", - "span_start": 8, - "span_end": 8, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "9ee00379ee797cd2386e88a6e37dc69e3e31de9144fc4b95f0206cd1430e8983", - "qname": "HttpControlAppFactory", - "kind": "const", - "signature": "HttpControlAppFactory = app_runtime.control.http_app.HttpControlAppFactory", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.control.http_channel", - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "const UvicornThreadRunner\nUvicornThreadRunner = app_runtime.control.http_runner.UvicornThreadRunner", - "layer": "C1_SYMBOL_CATALOG", - "title": "UvicornThreadRunner", - "span_start": 9, - "span_end": 9, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "c6ee53f4ff75d5b34ee95854cb63bb3ecfa163023717cd969b8cba937a0cd3b3", - "qname": "UvicornThreadRunner", - "kind": "const", - "signature": "UvicornThreadRunner = app_runtime.control.http_runner.UvicornThreadRunner", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.control.http_channel", - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "class HttpControlChannel\nHttpControlChannel(ControlChannel)", - "layer": "C1_SYMBOL_CATALOG", - "title": "HttpControlChannel", - "span_start": 12, - "span_end": 57, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "1c9fbdc24819e5604c26ea55428a74310f03a03e1af197ed84846af61e42fdb0", - "qname": "HttpControlChannel", - "kind": "class", - "signature": "HttpControlChannel(ControlChannel)", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.control.http_channel", - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "method HttpControlChannel.__init__\n__init__(self, host, port, timeout)", - "layer": "C1_SYMBOL_CATALOG", - "title": "HttpControlChannel.__init__", - "span_start": 13, - "span_end": 17, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "qname": "HttpControlChannel.__init__", - "kind": "method", - "signature": "__init__(self, host, port, timeout)", - "parent_symbol_id": "HttpControlChannel", - "package_or_module": "src.app_runtime.control.http_channel", - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "method HttpControlChannel.start\nstart(self, actions)", - "layer": "C1_SYMBOL_CATALOG", - "title": "HttpControlChannel.start", - "span_start": 19, - "span_end": 22, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "d1933f04137f52535b6525f1b93ff2cd83bfb216b480e887e791ed1714cda8e0", - "qname": "HttpControlChannel.start", - "kind": "method", - "signature": "start(self, actions)", - "parent_symbol_id": "HttpControlChannel", - "package_or_module": "src.app_runtime.control.http_channel", - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "class HttpControlChannel(ControlChannel):\n def __init__(self, host: str, port: int, timeout: int) -> None:\n self._timeout = timeout\n self._runner = UvicornThreadRunner(host, port, timeout)\n self._factory = HttpControlAppFactory()\n self._actions: ControlActionSet | None = None\n\n async def start(self, actions: ControlActionSet) -> None:\n self._actions = actions\n app = self._factory.create(self._health_response, self._action_response)\n await self._runner.start(app)\n\n async def stop(self) -> None:\n await self._runner.stop()\n\n @property\n def port(self) -> int:\n return self._runner.port\n\n async def _health_response(self) -> dict[str, object]:\n if self._actions is None:\n return {\"status\": \"unhealthy\", \"detail\": \"control actions are not configured\"}\n return await asyncio.wait_for(self._actions.health(), timeout=float(self._timeout))\n\n async def _action_response(self, action: str, _client_source: str = \"unknown\") -> JSONResponse:\n if self._actions is None:\n return JSONResponse(content={\"status\": \"error\", \"detail\": f\"{action} handler is not configured\"}, status_code=404)\n callbacks = {\n \"start\": self._actions.start,\n \"stop\": self._actions.stop,\n \"status\": self._actions.status,\n }\n callback = callbacks.get(action)\n if callback is None:\n return JSONResponse(content={\"status\": \"error\", \"detail\": f\"unsupported action: {action}\"}, status_code=404)\n action_timeout = max(float(self._timeout), 10.0) if action in {\"start\", \"stop\"} else float(self._timeout)\n try:\n detail = await asyncio.wait_for(callback(), timeout=action_timeout)\n except asyncio.TimeoutError:\n return JSONResponse(\n content={\"status\": \"accepted\", \"detail\": f\"{action} operation is still in progress\"},\n status_code=202,\n )\n except Exception as exc:\n return JSONResponse(content={\"status\": \"error\", \"detail\": str(exc)}, status_code=500)\n return JSONResponse(content={\"status\": \"ok\", \"detail\": detail or f\"{action} action accepted\"}, status_code=200)", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/http_channel.py:HttpControlChannel", - "span_start": 12, - "span_end": 57, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.http_channel", - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel.__init__\n -> HttpControlChannel._timeout\n -> HttpControlChannel._action_response", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "HttpControlChannel.__init__:dataflow_slice", - "span_start": 14, - "span_end": 47, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "c3ef21fcae96c82c00be74b3ab827d4af2085d89cb3fa5521c19a174aad84dbb", - "edge_type": "dataflow_slice", - "src_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "src_qname": "HttpControlChannel.__init__", - "dst_symbol_id": "e64969024ccaeb34d8d91473fad07b3b3d341875846392e7a006406c7ada1954", - "dst_ref": "HttpControlChannel._action_response", - "resolution": "resolved", - "slice_id": "c3ef21fcae96c82c00be74b3ab827d4af2085d89cb3fa5521c19a174aad84dbb", - "root_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "path_symbols": [ - "HttpControlChannel.__init__", - "HttpControlChannel._timeout", - "HttpControlChannel._action_response" - ], - "path_symbol_ids": [ - "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "e64969024ccaeb34d8d91473fad07b3b3d341875846392e7a006406c7ada1954" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel.__init__\n -> HttpControlChannel._runner\n -> HttpControlChannel.start", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "HttpControlChannel.__init__:dataflow_slice", - "span_start": 15, - "span_end": 22, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "51d73913df709152258ed1b9a8c8f4eb3c575eccfe6b982aef0b28e0789a29da", - "edge_type": "dataflow_slice", - "src_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "src_qname": "HttpControlChannel.__init__", - "dst_symbol_id": "d1933f04137f52535b6525f1b93ff2cd83bfb216b480e887e791ed1714cda8e0", - "dst_ref": "HttpControlChannel.start", - "resolution": "resolved", - "slice_id": "51d73913df709152258ed1b9a8c8f4eb3c575eccfe6b982aef0b28e0789a29da", - "root_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "path_symbols": [ - "HttpControlChannel.__init__", - "HttpControlChannel._runner", - "HttpControlChannel.start" - ], - "path_symbol_ids": [ - "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "d1933f04137f52535b6525f1b93ff2cd83bfb216b480e887e791ed1714cda8e0" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel.__init__\n -> HttpControlChannel._timeout\n -> HttpControlChannel._health_response", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "HttpControlChannel.__init__:dataflow_slice", - "span_start": 14, - "span_end": 34, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "f858f5c9e575f6c4cdfe3853571b7ee21d1f628a443541d2037c3dc9d0790bef", - "edge_type": "dataflow_slice", - "src_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "src_qname": "HttpControlChannel.__init__", - "dst_symbol_id": "e84bf04e9cd2127df235b7064d05f47e19f19a89c7c82f4c247231d4e8fa426a", - "dst_ref": "HttpControlChannel._health_response", - "resolution": "resolved", - "slice_id": "f858f5c9e575f6c4cdfe3853571b7ee21d1f628a443541d2037c3dc9d0790bef", - "root_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "path_symbols": [ - "HttpControlChannel.__init__", - "HttpControlChannel._timeout", - "HttpControlChannel._health_response" - ], - "path_symbol_ids": [ - "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "e84bf04e9cd2127df235b7064d05f47e19f19a89c7c82f4c247231d4e8fa426a" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel.__init__\n -> HttpControlChannel._runner\n -> HttpControlChannel.stop", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "HttpControlChannel.__init__:dataflow_slice", - "span_start": 15, - "span_end": 25, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "0f827ef81a990258a8a74381c8564a8361afa6712dba3200592659c939adcb9d", - "edge_type": "dataflow_slice", - "src_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "src_qname": "HttpControlChannel.__init__", - "dst_symbol_id": "f29ab212620093d72be20e26c5a399624c7939a6056a728762ed3f84a250bfa3", - "dst_ref": "HttpControlChannel.stop", - "resolution": "resolved", - "slice_id": "0f827ef81a990258a8a74381c8564a8361afa6712dba3200592659c939adcb9d", - "root_symbol_id": "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "path_symbols": [ - "HttpControlChannel.__init__", - "HttpControlChannel._runner", - "HttpControlChannel.stop" - ], - "path_symbol_ids": [ - "8de037370533181832fa806ba2b86a458a7657ab5a95d9ffff90a649ada2dc3a", - "f29ab212620093d72be20e26c5a399624c7939a6056a728762ed3f84a250bfa3" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "validation": { - "passed": true, - "action": "return", - "reasons": [] - }, - "steps": [ - { - "step": "router", - "status": "completed", - "timings_ms": { - "router": 1 - }, - "output": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN_LOCAL", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - } - }, - { - "step": "retrieval", - "status": "completed", - "timings_ms": { - "retrieval": 75 - }, - "output": { - "rag_count": 13, - "answer_path_rag_count": 13, - "resolved_symbol_status": "resolved", - "resolved_symbol": "HttpControlChannel", - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C2_DEPENDENCY_GRAPH" - ] - }, - "diagnostics": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C2_DEPENDENCY_GRAPH" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "vector", - "C0_SOURCE_CHUNKS": "vector", - "C2_DEPENDENCY_GRAPH": "vector" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 12, - "C2_DEPENDENCY_GRAPH": 4 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [ - "src/app_runtime/control/http_channel.py" - ] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src/app_runtime/control/http_channel.py" - ] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src/app_runtime/control/http_channel.py" - ] - } - }, - "fallback": { - "used": false, - "reason": null - }, - "retrieval_by_layer_ms": { - "C1_SYMBOL_CATALOG": 40, - "C0_SOURCE_CHUNKS": 17, - "C2_DEPENDENCY_GRAPH": 18 - } - } - }, - { - "step": "pre_evidence_gate", - "status": "passed", - "timings_ms": { - "pre_evidence_gate": 1 - }, - "input": { - "resolved_target": "HttpControlChannel", - "sub_intent": "EXPLAIN_LOCAL", - "target_type": "symbol", - "evidence_count": 13, - "code_chunk_count": 13, - "entrypoint_count": 0, - "relation_count": 4, - "test_evidence_count": 0, - "symbol_resolution_status": "resolved", - "path_scope": [ - "src/app_runtime/control/http_channel.py" - ] - }, - "output": { - "passed": true, - "failure_reasons": [], - "degraded_message": "", - "evidence_count": 13 - } - }, - { - "step": "llm", - "status": "completed", - "timings_ms": { - "llm": 3936 - }, - "output": { - "prompt_name": "code_qa_explain_local_answer", - "answer_preview": "Класс HttpControlChannel наследует ControlChannel и управляет HTTP-каналом контроля. \nИнициализация задает хост, порт, таймаут, создаёт экземпляр UvicornThreadRunner для запуска сервера и HttpControlAppFactory для создания FastAPI-приложения. \nМетод start запускает сервер с приложением, используя фа", - "resolved_target": "HttpControlChannel", - "answer_policy_branch": "normal_answer", - "decision_reason": "evidence_sufficient" - } - }, - { - "step": "post_evidence_gate", - "status": "passed", - "timings_ms": { - "post_evidence_gate": 1, - "post_evidence_gate_recheck": 0, - "repair": 0 - }, - "input": { - "answer_mode": "normal", - "degraded_message": "", - "resolved_target": "HttpControlChannel", - "draft_answer_preview": "Класс HttpControlChannel наследует ControlChannel и управляет HTTP-каналом контроля. \nИнициализация задает хост, порт, таймаут, создаёт экземпляр UvicornThreadRunner для запуска сервера и HttpControlAppFactory для создания FastAPI-приложения. \nМетод start запускает сервер с приложением, используя фа", - "repair_candidate": true - }, - "output": { - "passed": true, - "action": "return", - "reasons": [], - "repair_used": false, - "final_answer_preview": "Класс HttpControlChannel наследует ControlChannel и управляет HTTP-каналом контроля. \nИнициализация задает хост, порт, таймаут, создаёт экземпляр UvicornThreadRunner для запуска сервера и HttpControlAppFactory для создания FastAPI-приложения. \nМетод start запускает сервер с приложением, используя фа" - } - } - ] - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/plba_full_chain_subintents_v3/20260312_192715/full_chain_plba_code_subintents_v2_plba-v2-explain-local-http-channel.md b/tests/pipeline_setup_v3/test_results/plba_full_chain_subintents_v3/20260312_192715/full_chain_plba_code_subintents_v2_plba-v2-explain-local-http-channel.md deleted file mode 100644 index 56a2960..0000000 --- a/tests/pipeline_setup_v3/test_results/plba_full_chain_subintents_v3/20260312_192715/full_chain_plba_code_subintents_v2_plba-v2-explain-local-http-channel.md +++ /dev/null @@ -1,285 +0,0 @@ -# plba-v2-explain-local-http-channel - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_02_pipeline/full_chain_plba_code_subintents_v2.yaml -- runner: agent_runtime -- mode: full_chain -- passed: True - -## Query -Почему в файле src/app_runtime/control/http_channel.py класс HttpControlChannel устроен так? - -## Actual -{ - "intent": "CODE_QA", - "sub_intent": "EXPLAIN_LOCAL", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 13, - "llm_answer": "Класс HttpControlChannel наследует ControlChannel и управляет HTTP-каналом контроля. \nИнициализация задает хост, порт, таймаут, создаёт экземпляр UvicornThreadRunner для запуска сервера и HttpControlAppFactory для создания FastAPI-приложения. \nМетод start запускает сервер с приложением, используя фабрики и передавая коллбэки здоровья и действий. \nМетоды _health_response и _action_response (не полностью показаны) вероятно отвечают за обработчики API-эндпоинтов здоровья и выполнения действий. \nОстальные детали, такие как полный контекст методов или их реализации, отсутствуют в данном фрагменте.", - "answer_mode": "answered", - "path_scope": [ - "src/app_runtime/control/http_channel.py" - ], - "symbol_candidates": [ - "HttpControlChannel" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C2_DEPENDENCY_GRAPH" - ] -} - -## Steps -[ - { - "step": "router", - "status": "completed", - "timings_ms": { - "router": 1 - }, - "output": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN_LOCAL", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - } - }, - { - "step": "retrieval", - "status": "completed", - "timings_ms": { - "retrieval": 75 - }, - "output": { - "rag_count": 13, - "answer_path_rag_count": 13, - "resolved_symbol_status": "resolved", - "resolved_symbol": "HttpControlChannel", - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C2_DEPENDENCY_GRAPH" - ] - }, - "diagnostics": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C2_DEPENDENCY_GRAPH" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "vector", - "C0_SOURCE_CHUNKS": "vector", - "C2_DEPENDENCY_GRAPH": "vector" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 12, - "C2_DEPENDENCY_GRAPH": 4 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [ - "src/app_runtime/control/http_channel.py" - ] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src/app_runtime/control/http_channel.py" - ] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [ - "src/app_runtime/control/http_channel.py" - ] - } - }, - "fallback": { - "used": false, - "reason": null - }, - "retrieval_by_layer_ms": { - "C1_SYMBOL_CATALOG": 40, - "C0_SOURCE_CHUNKS": 17, - "C2_DEPENDENCY_GRAPH": 18 - } - } - }, - { - "step": "pre_evidence_gate", - "status": "passed", - "timings_ms": { - "pre_evidence_gate": 1 - }, - "input": { - "resolved_target": "HttpControlChannel", - "sub_intent": "EXPLAIN_LOCAL", - "target_type": "symbol", - "evidence_count": 13, - "code_chunk_count": 13, - "entrypoint_count": 0, - "relation_count": 4, - "test_evidence_count": 0, - "symbol_resolution_status": "resolved", - "path_scope": [ - "src/app_runtime/control/http_channel.py" - ] - }, - "output": { - "passed": true, - "failure_reasons": [], - "degraded_message": "", - "evidence_count": 13 - } - }, - { - "step": "llm", - "status": "completed", - "timings_ms": { - "llm": 3936 - }, - "output": { - "prompt_name": "code_qa_explain_local_answer", - "answer_preview": "Класс HttpControlChannel наследует ControlChannel и управляет HTTP-каналом контроля. \nИнициализация задает хост, порт, таймаут, создаёт экземпляр UvicornThreadRunner для запуска сервера и HttpControlAppFactory для создания FastAPI-приложения. \nМетод start запускает сервер с приложением, используя фа", - "resolved_target": "HttpControlChannel", - "answer_policy_branch": "normal_answer", - "decision_reason": "evidence_sufficient" - } - }, - { - "step": "post_evidence_gate", - "status": "passed", - "timings_ms": { - "post_evidence_gate": 1, - "post_evidence_gate_recheck": 0, - "repair": 0 - }, - "input": { - "answer_mode": "normal", - "degraded_message": "", - "resolved_target": "HttpControlChannel", - "draft_answer_preview": "Класс HttpControlChannel наследует ControlChannel и управляет HTTP-каналом контроля. \nИнициализация задает хост, порт, таймаут, создаёт экземпляр UvicornThreadRunner для запуска сервера и HttpControlAppFactory для создания FastAPI-приложения. \nМетод start запускает сервер с приложением, используя фа", - "repair_candidate": true - }, - "output": { - "passed": true, - "action": "return", - "reasons": [], - "repair_used": false, - "final_answer_preview": "Класс HttpControlChannel наследует ControlChannel и управляет HTTP-каналом контроля. \nИнициализация задает хост, порт, таймаут, создаёт экземпляр UvicornThreadRunner для запуска сервера и HttpControlAppFactory для создания FastAPI-приложения. \nМетод start запускает сервер с приложением, используя фа" - } - } -] - -## Diagnostics -{ - "intent_correct": null, - "target_found": true, - "layers_used": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C2_DEPENDENCY_GRAPH" - ], - "retrieval_sufficient": true, - "answer_mode": "normal", - "resolved_target": "HttpControlChannel", - "answer_policy_branch": "normal_answer", - "decision_reason": "evidence_sufficient", - "router_result": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "retrieval_profile": "code", - "sub_intent": "EXPLAIN_LOCAL", - "path_scope": [ - "src/app_runtime/control/http_channel.py" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C2_DEPENDENCY_GRAPH" - ], - "symbol_resolution_status": "resolved" - }, - "retrieval_request": { - "rag_session_id": "7d11da21-faa0-4cea-aede-aeabe069164c", - "query": "Почему в файле src/app_runtime/control/http_channel.py класс HttpControlChannel устроен так?", - "sub_intent": "EXPLAIN_LOCAL", - "path_scope": [ - "src/app_runtime/control/http_channel.py" - ], - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C2_DEPENDENCY_GRAPH" - ] - }, - "per_layer_outcome": [ - { - "layer_id": "C1_SYMBOL_CATALOG", - "hit_count": 8, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C0_SOURCE_CHUNKS", - "hit_count": 1, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C2_DEPENDENCY_GRAPH", - "hit_count": 4, - "empty": false, - "fallback_used": false - } - ], - "empty_layers": [], - "evidence_gate_decision": { - "sufficient": true, - "failure_reasons": [], - "evidence_count": 13 - }, - "evidence_gate_input": { - "resolved_target": "HttpControlChannel", - "sub_intent": "EXPLAIN_LOCAL", - "target_type": "symbol", - "evidence_count": 13, - "code_chunk_count": 13, - "entrypoint_count": 0, - "relation_count": 4, - "test_evidence_count": 0, - "symbol_resolution_status": "resolved", - "path_scope": [ - "src/app_runtime/control/http_channel.py" - ] - }, - "post_evidence_gate": { - "input": { - "answer_mode": "normal", - "degraded_message": "", - "resolved_target": "HttpControlChannel", - "draft_answer_preview": "Класс HttpControlChannel наследует ControlChannel и управляет HTTP-каналом контроля. \nИнициализация задает хост, порт, таймаут, создаёт экземпляр UvicornThreadRunner для запуска сервера и HttpControlAppFactory для создания FastAPI-приложения. \nМетод start запускает сервер с приложением, используя фа", - "repair_candidate": true - }, - "output": { - "passed": true, - "action": "return", - "reasons": [], - "repair_used": false, - "final_answer_preview": "Класс HttpControlChannel наследует ControlChannel и управляет HTTP-каналом контроля. \nИнициализация задает хост, порт, таймаут, создаёт экземпляр UvicornThreadRunner для запуска сервера и HttpControlAppFactory для создания FastAPI-приложения. \nМетод start запускает сервер с приложением, используя фа" - } - }, - "failure_reasons": [], - "timings_ms": { - "router": 1, - "retrieval": 75, - "pre_evidence_gate": 1, - "llm": 3936, - "post_evidence_gate": 1 - } -} - -## Mismatches -- none \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/plba_full_chain_subintents_v3/20260312_192715/full_chain_plba_code_subintents_v2_plba-v2-explain-nonexistent-symbol.json b/tests/pipeline_setup_v3/test_results/plba_full_chain_subintents_v3/20260312_192715/full_chain_plba_code_subintents_v2_plba-v2-explain-nonexistent-symbol.json deleted file mode 100644 index e802c17..0000000 --- a/tests/pipeline_setup_v3/test_results/plba_full_chain_subintents_v3/20260312_192715/full_chain_plba_code_subintents_v2_plba-v2-explain-nonexistent-symbol.json +++ /dev/null @@ -1,633 +0,0 @@ -{ - "case_id": "plba-v2-explain-nonexistent-symbol", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_02_pipeline/full_chain_plba_code_subintents_v2.yaml", - "runner": "agent_runtime", - "mode": "full_chain", - "query": "Объясни класс RuntimeFactoryManager", - "actual": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 0, - "llm_answer": "Сущность RuntimeFactoryManager не найдена в доступном коде.", - "answer_mode": "not_found", - "path_scope": [], - "symbol_candidates": [ - "RuntimeFactoryManager" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "passed": true, - "mismatches": [], - "details": { - "query": "Объясни класс RuntimeFactoryManager", - "router_result": { - "schema_version": "1.1", - "intent": "CODE_QA", - "retrieval_profile": "code", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query_plan": { - "raw": "Объясни класс RuntimeFactoryManager", - "normalized": "Объясни класс RuntimeFactoryManager", - "sub_intent": "EXPLAIN", - "negations": [], - "expansions": [ - "RuntimeFactoryManager" - ], - "keyword_hints": [ - "RuntimeFactoryManager" - ], - "path_hints": [], - "doc_scope_hints": [], - "symbol_candidates": [ - "RuntimeFactoryManager" - ], - "symbol_kind_hint": "class", - "anchors": [ - { - "type": "SYMBOL", - "value": "RuntimeFactoryManager", - "source": "user_text", - "subtype": null, - "span": { - "start": 14, - "end": 35 - }, - "confidence": 0.88 - }, - { - "type": "KEY_TERM", - "value": "класс", - "source": "user_text", - "subtype": null, - "span": { - "start": 8, - "end": 13 - }, - "confidence": 0.9 - } - ] - }, - "retrieval_spec": { - "domains": [ - "CODE" - ], - "layer_queries": [ - { - "layer_id": "C1_SYMBOL_CATALOG", - "top_k": 8 - }, - { - "layer_id": "C0_SOURCE_CHUNKS", - "top_k": 8 - }, - { - "layer_id": "C4_SEMANTIC_ROLES", - "top_k": 8 - }, - { - "layer_id": "C2_DEPENDENCY_GRAPH", - "top_k": 6 - }, - { - "layer_id": "C3_ENTRYPOINTS", - "top_k": 6 - } - ], - "filters": { - "test_policy": "EXCLUDE", - "path_scope": [], - "language": [ - "python" - ] - }, - "rerank_profile": "code" - }, - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - }, - "symbol_resolution": { - "status": "not_found", - "resolved_symbol": null, - "alternatives": [], - "confidence": 0.0 - }, - "evidence_policy": { - "require_def": true, - "require_flow": true, - "require_spec": false, - "allow_answer_without_evidence": false - } - }, - "retrieval_request": { - "rag_session_id": "7d11da21-faa0-4cea-aede-aeabe069164c", - "query": "Объясни класс RuntimeFactoryManager", - "sub_intent": "EXPLAIN", - "path_scope": [], - "keyword_hints": [ - "RuntimeFactoryManager" - ], - "symbol_candidates": [ - "RuntimeFactoryManager" - ], - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_spec": { - "domains": [ - "CODE" - ], - "layer_queries": [ - { - "layer_id": "C1_SYMBOL_CATALOG", - "top_k": 8 - }, - { - "layer_id": "C0_SOURCE_CHUNKS", - "top_k": 8 - }, - { - "layer_id": "C4_SEMANTIC_ROLES", - "top_k": 8 - }, - { - "layer_id": "C2_DEPENDENCY_GRAPH", - "top_k": 6 - }, - { - "layer_id": "C3_ENTRYPOINTS", - "top_k": 6 - } - ], - "filters": { - "test_policy": "EXCLUDE", - "path_scope": [], - "language": [ - "python" - ] - }, - "rerank_profile": "code" - }, - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - }, - "query_plan": { - "raw": "Объясни класс RuntimeFactoryManager", - "normalized": "Объясни класс RuntimeFactoryManager", - "sub_intent": "EXPLAIN", - "negations": [], - "expansions": [ - "RuntimeFactoryManager" - ], - "keyword_hints": [ - "RuntimeFactoryManager" - ], - "path_hints": [], - "doc_scope_hints": [], - "symbol_candidates": [ - "RuntimeFactoryManager" - ], - "symbol_kind_hint": "class", - "anchors": [ - { - "type": "SYMBOL", - "value": "RuntimeFactoryManager", - "source": "user_text", - "subtype": null, - "span": { - "start": 14, - "end": 35 - }, - "confidence": 0.88 - }, - { - "type": "KEY_TERM", - "value": "класс", - "source": "user_text", - "subtype": null, - "span": { - "start": 8, - "end": 13 - }, - "confidence": 0.9 - } - ] - } - }, - "retrieval_result": { - "target_symbol_candidates": [], - "resolved_symbol": null, - "symbol_resolution_status": "not_found", - "file_candidates": [], - "code_chunks": [], - "relations": [], - "semantic_hints": [], - "entrypoints": [], - "test_candidates": [], - "layer_outcomes": [ - { - "layer_id": "C1_SYMBOL_CATALOG", - "hit_count": 0, - "empty": true, - "fallback_used": false - }, - { - "layer_id": "C0_SOURCE_CHUNKS", - "hit_count": 0, - "empty": true, - "fallback_used": false - }, - { - "layer_id": "C4_SEMANTIC_ROLES", - "hit_count": 0, - "empty": true, - "fallback_used": false - }, - { - "layer_id": "C2_DEPENDENCY_GRAPH", - "hit_count": 0, - "empty": true, - "fallback_used": false - }, - { - "layer_id": "C3_ENTRYPOINTS", - "hit_count": 0, - "empty": true, - "fallback_used": false - } - ], - "missing_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "raw_rows": [], - "retrieval_report": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "vector", - "C0_SOURCE_CHUNKS": "vector", - "C4_SEMANTIC_ROLES": "vector", - "C2_DEPENDENCY_GRAPH": "vector", - "C3_ENTRYPOINTS": "vector" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 8, - "C4_SEMANTIC_ROLES": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C3_ENTRYPOINTS": 6 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [] - }, - "C4_SEMANTIC_ROLES": { - "path_scope": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [] - } - }, - "fallback": { - "used": false, - "reason": null - }, - "retrieval_by_layer_ms": { - "C1_SYMBOL_CATALOG": 75, - "C0_SOURCE_CHUNKS": 28, - "C4_SEMANTIC_ROLES": 23, - "C2_DEPENDENCY_GRAPH": 55, - "C3_ENTRYPOINTS": 18 - } - } - }, - "diagnostics": { - "intent_correct": null, - "target_found": false, - "layers_used": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_sufficient": false, - "answer_mode": "insufficient", - "resolved_target": null, - "answer_policy_branch": "explain_not_found", - "decision_reason": "symbol_resolution_not_found", - "router_result": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "retrieval_profile": "code", - "sub_intent": "EXPLAIN", - "path_scope": [], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "symbol_resolution_status": "not_found" - }, - "retrieval_request": { - "rag_session_id": "7d11da21-faa0-4cea-aede-aeabe069164c", - "query": "Объясни класс RuntimeFactoryManager", - "sub_intent": "EXPLAIN", - "path_scope": [], - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "per_layer_outcome": [ - { - "layer_id": "C1_SYMBOL_CATALOG", - "hit_count": 0, - "empty": true, - "fallback_used": false - }, - { - "layer_id": "C0_SOURCE_CHUNKS", - "hit_count": 0, - "empty": true, - "fallback_used": false - }, - { - "layer_id": "C4_SEMANTIC_ROLES", - "hit_count": 0, - "empty": true, - "fallback_used": false - }, - { - "layer_id": "C2_DEPENDENCY_GRAPH", - "hit_count": 0, - "empty": true, - "fallback_used": false - }, - { - "layer_id": "C3_ENTRYPOINTS", - "hit_count": 0, - "empty": true, - "fallback_used": false - } - ], - "empty_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "evidence_gate_decision": { - "sufficient": false, - "failure_reasons": [ - "insufficient_evidence" - ], - "evidence_count": 0 - }, - "evidence_gate_input": { - "resolved_target": null, - "sub_intent": "EXPLAIN", - "target_type": "none", - "evidence_count": 0, - "code_chunk_count": 0, - "entrypoint_count": 0, - "relation_count": 0, - "test_evidence_count": 0, - "symbol_resolution_status": "not_found", - "path_scope": [] - }, - "post_evidence_gate": { - "input": { - "answer_mode": "not_found", - "draft_present": false, - "resolved_target": null - }, - "output": { - "reason": "no_draft_answer" - } - }, - "failure_reasons": [ - "insufficient_evidence" - ], - "timings_ms": { - "router": 2, - "retrieval": 201, - "pre_evidence_gate": 1, - "post_evidence_gate": 1 - } - }, - "rag_rows": [], - "validation": { - "passed": true, - "action": "return", - "reasons": [] - }, - "steps": [ - { - "step": "router", - "status": "completed", - "timings_ms": { - "router": 2 - }, - "output": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - } - }, - { - "step": "retrieval", - "status": "completed", - "timings_ms": { - "retrieval": 201 - }, - "output": { - "rag_count": 33, - "answer_path_rag_count": 0, - "resolved_symbol_status": "not_found", - "resolved_symbol": null, - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "diagnostics": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "vector", - "C0_SOURCE_CHUNKS": "vector", - "C4_SEMANTIC_ROLES": "vector", - "C2_DEPENDENCY_GRAPH": "vector", - "C3_ENTRYPOINTS": "vector" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 8, - "C4_SEMANTIC_ROLES": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C3_ENTRYPOINTS": 6 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [] - }, - "C4_SEMANTIC_ROLES": { - "path_scope": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [] - } - }, - "fallback": { - "used": false, - "reason": null - }, - "retrieval_by_layer_ms": { - "C1_SYMBOL_CATALOG": 75, - "C0_SOURCE_CHUNKS": 28, - "C4_SEMANTIC_ROLES": 23, - "C2_DEPENDENCY_GRAPH": 55, - "C3_ENTRYPOINTS": 18 - } - } - }, - { - "step": "pre_evidence_gate", - "status": "blocked", - "timings_ms": { - "pre_evidence_gate": 1 - }, - "input": { - "resolved_target": null, - "sub_intent": "EXPLAIN", - "target_type": "none", - "evidence_count": 0, - "code_chunk_count": 0, - "entrypoint_count": 0, - "relation_count": 0, - "test_evidence_count": 0, - "symbol_resolution_status": "not_found", - "path_scope": [] - }, - "output": { - "passed": false, - "failure_reasons": [ - "insufficient_evidence" - ], - "degraded_message": "Insufficient evidence for a confident answer. Evidence count: 0 (minimum required not met).", - "evidence_count": 0 - } - }, - { - "step": "llm", - "status": "skipped", - "timings_ms": { - "llm": 1 - }, - "output": { - "reason": "policy_short_circuit", - "answer_mode": "not_found", - "decision_reason": "symbol_resolution_not_found", - "answer_policy_branch": "explain_not_found" - } - }, - { - "step": "post_evidence_gate", - "status": "skipped", - "timings_ms": { - "post_evidence_gate": 1 - }, - "input": { - "answer_mode": "not_found", - "draft_present": false, - "resolved_target": null - }, - "output": { - "reason": "no_draft_answer" - } - } - ] - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/plba_full_chain_subintents_v3/20260312_192715/full_chain_plba_code_subintents_v2_plba-v2-explain-nonexistent-symbol.md b/tests/pipeline_setup_v3/test_results/plba_full_chain_subintents_v3/20260312_192715/full_chain_plba_code_subintents_v2_plba-v2-explain-nonexistent-symbol.md deleted file mode 100644 index 1784a91..0000000 --- a/tests/pipeline_setup_v3/test_results/plba_full_chain_subintents_v3/20260312_192715/full_chain_plba_code_subintents_v2_plba-v2-explain-nonexistent-symbol.md +++ /dev/null @@ -1,301 +0,0 @@ -# plba-v2-explain-nonexistent-symbol - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_02_pipeline/full_chain_plba_code_subintents_v2.yaml -- runner: agent_runtime -- mode: full_chain -- passed: True - -## Query -Объясни класс RuntimeFactoryManager - -## Actual -{ - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 0, - "llm_answer": "Сущность RuntimeFactoryManager не найдена в доступном коде.", - "answer_mode": "not_found", - "path_scope": [], - "symbol_candidates": [ - "RuntimeFactoryManager" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] -} - -## Steps -[ - { - "step": "router", - "status": "completed", - "timings_ms": { - "router": 2 - }, - "output": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - } - }, - { - "step": "retrieval", - "status": "completed", - "timings_ms": { - "retrieval": 201 - }, - "output": { - "rag_count": 33, - "answer_path_rag_count": 0, - "resolved_symbol_status": "not_found", - "resolved_symbol": null, - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "diagnostics": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "vector", - "C0_SOURCE_CHUNKS": "vector", - "C4_SEMANTIC_ROLES": "vector", - "C2_DEPENDENCY_GRAPH": "vector", - "C3_ENTRYPOINTS": "vector" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 8, - "C4_SEMANTIC_ROLES": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C3_ENTRYPOINTS": 6 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [] - }, - "C4_SEMANTIC_ROLES": { - "path_scope": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [] - } - }, - "fallback": { - "used": false, - "reason": null - }, - "retrieval_by_layer_ms": { - "C1_SYMBOL_CATALOG": 75, - "C0_SOURCE_CHUNKS": 28, - "C4_SEMANTIC_ROLES": 23, - "C2_DEPENDENCY_GRAPH": 55, - "C3_ENTRYPOINTS": 18 - } - } - }, - { - "step": "pre_evidence_gate", - "status": "blocked", - "timings_ms": { - "pre_evidence_gate": 1 - }, - "input": { - "resolved_target": null, - "sub_intent": "EXPLAIN", - "target_type": "none", - "evidence_count": 0, - "code_chunk_count": 0, - "entrypoint_count": 0, - "relation_count": 0, - "test_evidence_count": 0, - "symbol_resolution_status": "not_found", - "path_scope": [] - }, - "output": { - "passed": false, - "failure_reasons": [ - "insufficient_evidence" - ], - "degraded_message": "Insufficient evidence for a confident answer. Evidence count: 0 (minimum required not met).", - "evidence_count": 0 - } - }, - { - "step": "llm", - "status": "skipped", - "timings_ms": { - "llm": 1 - }, - "output": { - "reason": "policy_short_circuit", - "answer_mode": "not_found", - "decision_reason": "symbol_resolution_not_found", - "answer_policy_branch": "explain_not_found" - } - }, - { - "step": "post_evidence_gate", - "status": "skipped", - "timings_ms": { - "post_evidence_gate": 1 - }, - "input": { - "answer_mode": "not_found", - "draft_present": false, - "resolved_target": null - }, - "output": { - "reason": "no_draft_answer" - } - } -] - -## Diagnostics -{ - "intent_correct": null, - "target_found": false, - "layers_used": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_sufficient": false, - "answer_mode": "insufficient", - "resolved_target": null, - "answer_policy_branch": "explain_not_found", - "decision_reason": "symbol_resolution_not_found", - "router_result": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "retrieval_profile": "code", - "sub_intent": "EXPLAIN", - "path_scope": [], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "symbol_resolution_status": "not_found" - }, - "retrieval_request": { - "rag_session_id": "7d11da21-faa0-4cea-aede-aeabe069164c", - "query": "Объясни класс RuntimeFactoryManager", - "sub_intent": "EXPLAIN", - "path_scope": [], - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "per_layer_outcome": [ - { - "layer_id": "C1_SYMBOL_CATALOG", - "hit_count": 0, - "empty": true, - "fallback_used": false - }, - { - "layer_id": "C0_SOURCE_CHUNKS", - "hit_count": 0, - "empty": true, - "fallback_used": false - }, - { - "layer_id": "C4_SEMANTIC_ROLES", - "hit_count": 0, - "empty": true, - "fallback_used": false - }, - { - "layer_id": "C2_DEPENDENCY_GRAPH", - "hit_count": 0, - "empty": true, - "fallback_used": false - }, - { - "layer_id": "C3_ENTRYPOINTS", - "hit_count": 0, - "empty": true, - "fallback_used": false - } - ], - "empty_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "evidence_gate_decision": { - "sufficient": false, - "failure_reasons": [ - "insufficient_evidence" - ], - "evidence_count": 0 - }, - "evidence_gate_input": { - "resolved_target": null, - "sub_intent": "EXPLAIN", - "target_type": "none", - "evidence_count": 0, - "code_chunk_count": 0, - "entrypoint_count": 0, - "relation_count": 0, - "test_evidence_count": 0, - "symbol_resolution_status": "not_found", - "path_scope": [] - }, - "post_evidence_gate": { - "input": { - "answer_mode": "not_found", - "draft_present": false, - "resolved_target": null - }, - "output": { - "reason": "no_draft_answer" - } - }, - "failure_reasons": [ - "insufficient_evidence" - ], - "timings_ms": { - "router": 2, - "retrieval": 201, - "pre_evidence_gate": 1, - "post_evidence_gate": 1 - } -} - -## Mismatches -- none \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/plba_full_chain_subintents_v3/20260312_192715/full_chain_plba_code_subintents_v2_plba-v2-explain-runtime-manager.json b/tests/pipeline_setup_v3/test_results/plba_full_chain_subintents_v3/20260312_192715/full_chain_plba_code_subintents_v2_plba-v2-explain-runtime-manager.json deleted file mode 100644 index c12970a..0000000 --- a/tests/pipeline_setup_v3/test_results/plba_full_chain_subintents_v3/20260312_192715/full_chain_plba_code_subintents_v2_plba-v2-explain-runtime-manager.json +++ /dev/null @@ -1,4474 +0,0 @@ -{ - "case_id": "plba-v2-explain-runtime-manager", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_02_pipeline/full_chain_plba_code_subintents_v2.yaml", - "runner": "agent_runtime", - "mode": "full_chain", - "query": "Объясни как работает класс RuntimeManager", - "actual": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 33, - "llm_answer": "Недостаточно подтверждённых данных для уверенного ответа по RuntimeManager.", - "answer_mode": "degraded", - "path_scope": [], - "symbol_candidates": [ - "RuntimeManager" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "passed": true, - "mismatches": [], - "details": { - "query": "Объясни как работает класс RuntimeManager", - "router_result": { - "schema_version": "1.1", - "intent": "CODE_QA", - "retrieval_profile": "code", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query_plan": { - "raw": "Объясни как работает класс RuntimeManager", - "normalized": "Объясни как работает класс RuntimeManager", - "sub_intent": "EXPLAIN", - "negations": [], - "expansions": [ - "RuntimeManager" - ], - "keyword_hints": [ - "RuntimeManager" - ], - "path_hints": [], - "doc_scope_hints": [], - "symbol_candidates": [ - "RuntimeManager" - ], - "symbol_kind_hint": "class", - "anchors": [ - { - "type": "SYMBOL", - "value": "RuntimeManager", - "source": "user_text", - "subtype": null, - "span": { - "start": 27, - "end": 41 - }, - "confidence": 0.88 - }, - { - "type": "KEY_TERM", - "value": "класс", - "source": "user_text", - "subtype": null, - "span": { - "start": 21, - "end": 26 - }, - "confidence": 0.9 - } - ] - }, - "retrieval_spec": { - "domains": [ - "CODE" - ], - "layer_queries": [ - { - "layer_id": "C1_SYMBOL_CATALOG", - "top_k": 8 - }, - { - "layer_id": "C0_SOURCE_CHUNKS", - "top_k": 8 - }, - { - "layer_id": "C4_SEMANTIC_ROLES", - "top_k": 8 - }, - { - "layer_id": "C2_DEPENDENCY_GRAPH", - "top_k": 6 - }, - { - "layer_id": "C3_ENTRYPOINTS", - "top_k": 6 - } - ], - "filters": { - "test_policy": "EXCLUDE", - "path_scope": [], - "language": [ - "python" - ] - }, - "rerank_profile": "code" - }, - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - }, - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "RuntimeManager", - "alternatives": [ - "RuntimeManager", - "RuntimeManager", - "RuntimeManager", - "RuntimeManager", - "RuntimeManager" - ], - "confidence": 0.99 - }, - "evidence_policy": { - "require_def": true, - "require_flow": true, - "require_spec": false, - "allow_answer_without_evidence": false - } - }, - "retrieval_request": { - "rag_session_id": "7d11da21-faa0-4cea-aede-aeabe069164c", - "query": "Объясни как работает класс RuntimeManager", - "sub_intent": "EXPLAIN", - "path_scope": [], - "keyword_hints": [ - "RuntimeManager" - ], - "symbol_candidates": [ - "RuntimeManager" - ], - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_spec": { - "domains": [ - "CODE" - ], - "layer_queries": [ - { - "layer_id": "C1_SYMBOL_CATALOG", - "top_k": 8 - }, - { - "layer_id": "C0_SOURCE_CHUNKS", - "top_k": 8 - }, - { - "layer_id": "C4_SEMANTIC_ROLES", - "top_k": 8 - }, - { - "layer_id": "C2_DEPENDENCY_GRAPH", - "top_k": 6 - }, - { - "layer_id": "C3_ENTRYPOINTS", - "top_k": 6 - } - ], - "filters": { - "test_policy": "EXCLUDE", - "path_scope": [], - "language": [ - "python" - ] - }, - "rerank_profile": "code" - }, - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - }, - "query_plan": { - "raw": "Объясни как работает класс RuntimeManager", - "normalized": "Объясни как работает класс RuntimeManager", - "sub_intent": "EXPLAIN", - "negations": [], - "expansions": [ - "RuntimeManager" - ], - "keyword_hints": [ - "RuntimeManager" - ], - "path_hints": [], - "doc_scope_hints": [], - "symbol_candidates": [ - "RuntimeManager" - ], - "symbol_kind_hint": "class", - "anchors": [ - { - "type": "SYMBOL", - "value": "RuntimeManager", - "source": "user_text", - "subtype": null, - "span": { - "start": 27, - "end": 41 - }, - "confidence": 0.88 - }, - { - "type": "KEY_TERM", - "value": "класс", - "source": "user_text", - "subtype": null, - "span": { - "start": 21, - "end": 26 - }, - "confidence": 0.9 - } - ] - } - }, - "retrieval_result": { - "target_symbol_candidates": [ - "RuntimeManager", - "ControlPlaneService", - "ControlChannel.start", - "ControlChannel.stop" - ], - "resolved_symbol": "RuntimeManager", - "symbol_resolution_status": "resolved", - "file_candidates": [ - "src/plba/bootstrap.py", - "src/app_runtime/control/service.py", - "src/app_runtime/core/runtime.py", - "src/plba/__init__.py", - "src/plba/core.py", - "src/app_runtime/control/__init__.py", - "src/app_runtime/control/base.py", - "src/app_runtime/control/http_runner.py", - "src/app_runtime/control/http_app.py", - "src/app_runtime/control/http_channel.py", - "src/plba/control.py", - "src/app_runtime/workflow/persistence/workflow_persistence.py" - ], - "code_chunks": [ - { - "layer": "C1_SYMBOL_CATALOG", - "path": "src/plba/bootstrap.py", - "title": "RuntimeManager", - "content": "const RuntimeManager\nRuntimeManager = app_runtime.core.runtime.RuntimeManager", - "start_line": 4, - "end_line": 4, - "metadata": { - "symbol_id": "27158ca220022eeb5083c6addf8a50775d45f7161284fd60aac48410105f4b98", - "qname": "RuntimeManager", - "kind": "const", - "signature": "RuntimeManager = app_runtime.core.runtime.RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "src.plba.bootstrap", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C1_SYMBOL_CATALOG", - "path": "src/app_runtime/control/service.py", - "title": "RuntimeManager", - "content": "const RuntimeManager\nRuntimeManager = app_runtime.core.runtime.RuntimeManager", - "start_line": 9, - "end_line": 9, - "metadata": { - "symbol_id": "62a9575c77aad894120d18b4f2a08cf2ba42f77e9be4a8a432b767d157701afe", - "qname": "RuntimeManager", - "kind": "const", - "signature": "RuntimeManager = app_runtime.core.runtime.RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.control.service", - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C1_SYMBOL_CATALOG", - "path": "src/app_runtime/core/runtime.py", - "title": "RuntimeManager", - "content": "class RuntimeManager\nRuntimeManager", - "start_line": 18, - "end_line": 179, - "metadata": { - "symbol_id": "7e4a9381328c5803bbc6179458612fc4e947d928aa7bf8b4b2bebb2c8592f758", - "qname": "RuntimeManager", - "kind": "class", - "signature": "RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.core.runtime", - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C1_SYMBOL_CATALOG", - "path": "src/plba/__init__.py", - "title": "RuntimeManager", - "content": "const RuntimeManager\nRuntimeManager = plba.core.RuntimeManager", - "start_line": 16, - "end_line": 16, - "metadata": { - "symbol_id": "7eacec84f9b8d6c4201374591faecdac7493091c263681495c338973f2971ad9", - "qname": "RuntimeManager", - "kind": "const", - "signature": "RuntimeManager = plba.core.RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "src.plba.__init__", - "is_test": false, - "blob_sha": "24e755ec8c249d14fb0e675b5dbf2b71ab91afb9c849897eebfa9feb2499e19d", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C1_SYMBOL_CATALOG", - "path": "src/plba/core.py", - "title": "RuntimeManager", - "content": "const RuntimeManager\nRuntimeManager = app_runtime.core.runtime.RuntimeManager", - "start_line": 2, - "end_line": 2, - "metadata": { - "symbol_id": "e1684562d978b7af7fe9b27dc5869d770348a87b5dc19a50360f58544668578b", - "qname": "RuntimeManager", - "kind": "const", - "signature": "RuntimeManager = app_runtime.core.runtime.RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "src.plba.core", - "is_test": false, - "blob_sha": "c0ae25110d20e665216616e26b68adfe035b624ba45d31d1272fb21f906f9ca8", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C1_SYMBOL_CATALOG", - "path": "src/app_runtime/control/__init__.py", - "title": "ControlPlaneService", - "content": "const ControlPlaneService\nControlPlaneService = app_runtime.control.service.ControlPlaneService", - "start_line": 3, - "end_line": 3, - "metadata": { - "symbol_id": "217e8f044d1c01644bf7b81e5046af9e84469210c692a2fb0c476a19bb069ae1", - "qname": "ControlPlaneService", - "kind": "const", - "signature": "ControlPlaneService = app_runtime.control.service.ControlPlaneService", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.control.__init__", - "is_test": false, - "blob_sha": "bf3c37e3369a84cc618adc0fd71c232e5eb4b871eaff743069a17e661e498316", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C1_SYMBOL_CATALOG", - "path": "src/app_runtime/control/base.py", - "title": "ControlChannel.start", - "content": "method ControlChannel.start\nstart(self, actions)\nStart the control channel and bind handlers.", - "start_line": 23, - "end_line": 24, - "metadata": { - "symbol_id": "e01e0d50d0f48d0c84c119c989b7a7c57ceea263811ce2605c684ae24d1a03b1", - "qname": "ControlChannel.start", - "kind": "method", - "signature": "start(self, actions)", - "parent_symbol_id": "ControlChannel", - "package_or_module": "src.app_runtime.control.base", - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C1_SYMBOL_CATALOG", - "path": "src/app_runtime/control/base.py", - "title": "ControlChannel.stop", - "content": "method ControlChannel.stop\nstop(self)\nStop the control channel and release resources.", - "start_line": 27, - "end_line": 28, - "metadata": { - "symbol_id": "54b5adf9866c526836221dc721b474ba23fbec83e1b1d3b8bc4da67ae3c1541d", - "qname": "ControlChannel.stop", - "kind": "method", - "signature": "stop(self)", - "parent_symbol_id": "ControlChannel", - "package_or_module": "src.app_runtime.control.base", - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C0_SOURCE_CHUNKS", - "path": "src/app_runtime/control/service.py", - "title": "src/app_runtime/control/service.py:ControlPlaneService", - "content": "class ControlPlaneService:\n def __init__(self) -> None:\n self._channels: list[ControlChannel] = []\n\n def register_channel(self, channel: ControlChannel) -> None:\n self._channels.append(channel)\n\n def start(self, runtime: RuntimeManager) -> None:\n if not self._channels:\n return\n asyncio.run(self._start_async(runtime))\n\n def stop(self) -> None:\n if not self._channels:\n return\n asyncio.run(self._stop_async())\n\n def snapshot(self, runtime: RuntimeManager) -> dict[str, object]:\n health = runtime.current_health()\n return {\n \"runtime\": {\"state\": runtime._state.value},\n \"modules\": list(runtime.registry.modules),\n \"services\": runtime.services.snapshot(),\n \"workers\": runtime.workers.snapshot(),\n \"health\": runtime.health.snapshot(runtime.workers.healths()) | {\"status\": health[\"status\"]},\n \"config\": runtime.configuration.get(),\n }\n\n async def _start_async(self, runtime: RuntimeManager) -> None:\n actions = ControlActionSet(\n health=runtime.health_status,\n start=runtime.start_runtime,\n stop=runtime.stop_runtime,\n status=runtime.runtime_status,\n )\n for channel in self._channels:\n await channel.start(actions)\n\n async def _stop_async(self) -> None:\n for channel in reversed(self._channels):\n await channel.stop()", - "start_line": 12, - "end_line": 52, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.service", - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C0_SOURCE_CHUNKS", - "path": "src/app_runtime/control/http_runner.py", - "title": "src/app_runtime/control/http_runner.py:UvicornThreadRunner", - "content": "class UvicornThreadRunner:\n def __init__(self, host: str, port: int, timeout: int) -> None:\n self._host = host\n self._port = port\n self._timeout = timeout\n self._server: Server | None = None\n self._thread: Thread | None = None\n self._error: BaseException | None = None\n\n async def start(self, app: FastAPI) -> None:\n if self._thread is not None and self._thread.is_alive():\n return\n self._error = None\n config = Config(app=app, host=self._host, port=self._port, log_level=\"warning\")\n self._server = Server(config)\n self._thread = Thread(target=self._serve, name=\"plba-http-control\", daemon=True)\n self._thread.start()\n await self._wait_until_started()\n\n async def stop(self) -> None:\n if self._server is None or self._thread is None:\n return\n self._server.should_exit = True\n await asyncio.to_thread(self._thread.join, self._timeout)\n self._server = None\n self._thread = None\n\n @property\n def port(self) -> int:\n if self._server is None or not getattr(self._server, \"servers\", None):\n return self._port\n socket = self._server.servers[0].sockets[0]\n return int(socket.getsockname()[1])\n\n async def _wait_until_started(self) -> None:\n if self._server is None:\n raise RuntimeError(\"Server is not initialized\")\n deadline = asyncio.get_running_loop().time() + max(float(self._timeout), 1.0)\n while not self._server.started:\n if self._error is not None:\n raise RuntimeError(\"HTTP control server failed to start\") from self._error\n if asyncio.get_running_loop().time() >= deadline:\n raise TimeoutError(\"HTTP control server startup timed out\")\n await asyncio.sleep(0.05)\n\n def _serve(self) -> None:\n if self._server is None:\n return\n try:\n asyncio.run(self._server.serve())\n except BaseException as exc: # noqa: BLE001\n self._error = exc", - "start_line": 10, - "end_line": 61, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.http_runner", - "is_test": false, - "blob_sha": "3779fdd2878b770e789a35bb2a89c9d79f13b61c26d7db1b3b683f9bb9e1623f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C0_SOURCE_CHUNKS", - "path": "src/app_runtime/control/base.py", - "title": "src/app_runtime/control/base.py:ControlChannel", - "content": "class ControlChannel(ABC):\n @abstractmethod\n async def start(self, actions: ControlActionSet) -> None:\n \"\"\"Start the control channel and bind handlers.\"\"\"\n\n @abstractmethod\n async def stop(self) -> None:\n \"\"\"Stop the control channel and release resources.\"\"\"", - "start_line": 21, - "end_line": 28, - "metadata": { - "chunk_index": 1, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.base", - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C0_SOURCE_CHUNKS", - "path": "src/app_runtime/control/__init__.py", - "title": "src/app_runtime/control/__init__.py:1-5", - "content": "from app_runtime.control.base import ControlActionSet, ControlChannel\nfrom app_runtime.control.http_channel import HttpControlChannel\nfrom app_runtime.control.service import ControlPlaneService\n\n__all__ = [\"ControlActionSet\", \"ControlChannel\", \"ControlPlaneService\", \"HttpControlChannel\"]", - "start_line": 1, - "end_line": 5, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.app_runtime.control.__init__", - "is_test": false, - "blob_sha": "bf3c37e3369a84cc618adc0fd71c232e5eb4b871eaff743069a17e661e498316", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C0_SOURCE_CHUNKS", - "path": "src/app_runtime/control/http_app.py", - "title": "src/app_runtime/control/http_app.py:HttpControlAppFactory", - "content": "class HttpControlAppFactory:\n def create(\n self,\n health_provider: Callable[[], Awaitable[HealthPayload]],\n action_provider: Callable[[str, str], Awaitable[JSONResponse]],\n ) -> FastAPI:\n app = FastAPI(title=\"PLBA Control API\")\n\n @app.middleware(\"http\")\n async def log_api_call(request: Request, call_next): # type: ignore[no-untyped-def]\n started = time.monotonic()\n response = await call_next(request)\n response.headers[\"X-Response-Time-Ms\"] = str(int((time.monotonic() - started) * 1000))\n return response\n\n @app.get(\"/health\")\n async def health() -> JSONResponse:\n payload = await health_provider()\n status_code = 200 if payload.get(\"status\") == \"ok\" else 503\n return JSONResponse(content=payload, status_code=status_code)\n\n @app.get(\"/actions/{action}\")\n @app.post(\"/actions/{action}\")\n async def action(action: str, request: Request) -> JSONResponse:\n client_source = self._client_source(request)\n if action in {\"start\", \"stop\"}:\n LOGGER.warning(\"Control action requested: /actions/%s client=%s\", action, client_source)\n return await action_provider(action, client_source)\n\n return app\n\n def _client_source(self, request: Request) -> str:\n explicit_header = request.headers.get(\"X-Client-Source\", \"\").strip()\n if explicit_header:\n return explicit_header\n user_agent = request.headers.get(\"User-Agent\", \"\").strip()\n if user_agent:\n return f\"user-agent:{user_agent}\"\n return \"unknown\"", - "start_line": 15, - "end_line": 53, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.http_app", - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C0_SOURCE_CHUNKS", - "path": "src/app_runtime/control/http_channel.py", - "title": "src/app_runtime/control/http_channel.py:HttpControlChannel", - "content": "class HttpControlChannel(ControlChannel):\n def __init__(self, host: str, port: int, timeout: int) -> None:\n self._timeout = timeout\n self._runner = UvicornThreadRunner(host, port, timeout)\n self._factory = HttpControlAppFactory()\n self._actions: ControlActionSet | None = None\n\n async def start(self, actions: ControlActionSet) -> None:\n self._actions = actions\n app = self._factory.create(self._health_response, self._action_response)\n await self._runner.start(app)\n\n async def stop(self) -> None:\n await self._runner.stop()\n\n @property\n def port(self) -> int:\n return self._runner.port\n\n async def _health_response(self) -> dict[str, object]:\n if self._actions is None:\n return {\"status\": \"unhealthy\", \"detail\": \"control actions are not configured\"}\n return await asyncio.wait_for(self._actions.health(), timeout=float(self._timeout))\n\n async def _action_response(self, action: str, _client_source: str = \"unknown\") -> JSONResponse:\n if self._actions is None:\n return JSONResponse(content={\"status\": \"error\", \"detail\": f\"{action} handler is not configured\"}, status_code=404)\n callbacks = {\n \"start\": self._actions.start,\n \"stop\": self._actions.stop,\n \"status\": self._actions.status,\n }\n callback = callbacks.get(action)\n if callback is None:\n return JSONResponse(content={\"status\": \"error\", \"detail\": f\"unsupported action: {action}\"}, status_code=404)\n action_timeout = max(float(self._timeout), 10.0) if action in {\"start\", \"stop\"} else float(self._timeout)\n try:\n detail = await asyncio.wait_for(callback(), timeout=action_timeout)\n except asyncio.TimeoutError:\n return JSONResponse(\n content={\"status\": \"accepted\", \"detail\": f\"{action} operation is still in progress\"},\n status_code=202,\n )\n except Exception as exc:\n return JSONResponse(content={\"status\": \"error\", \"detail\": str(exc)}, status_code=500)\n return JSONResponse(content={\"status\": \"ok\", \"detail\": detail or f\"{action} action accepted\"}, status_code=200)", - "start_line": 12, - "end_line": 57, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.http_channel", - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C0_SOURCE_CHUNKS", - "path": "src/app_runtime/control/base.py", - "title": "src/app_runtime/control/base.py:ControlActionSet", - "content": "class ControlActionSet:\n health: HealthHandler\n start: ActionHandler\n stop: ActionHandler\n status: ActionHandler", - "start_line": 14, - "end_line": 18, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.base", - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C0_SOURCE_CHUNKS", - "path": "src/plba/control.py", - "title": "src/plba/control.py:1-10", - "content": "from app_runtime.control.base import ControlActionSet, ControlChannel\nfrom app_runtime.control.http_channel import HttpControlChannel\nfrom app_runtime.control.service import ControlPlaneService\n\n__all__ = [\n \"ControlActionSet\",\n \"ControlChannel\",\n \"ControlPlaneService\",\n \"HttpControlChannel\",\n]", - "start_line": 1, - "end_line": 10, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.plba.control", - "is_test": false, - "blob_sha": "31bd5c4481bfa7fbca8fae56d4860a67e3953ca74474ac8439e1f39b685d7bc8", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C4_SEMANTIC_ROLES", - "path": "src/app_runtime/core/runtime.py", - "title": "RuntimeManager", - "content": "RuntimeManager\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests manager\n- orchestrates role-like calls (4)\n- reads and writes state attributes\n- participates in dataflow slices (50)", - "start_line": 18, - "end_line": 179, - "metadata": { - "symbol_id": "7e4a9381328c5803bbc6179458612fc4e947d928aa7bf8b4b2bebb2c8592f758", - "symbol_name": "RuntimeManager", - "qname": "RuntimeManager", - "role": "pipeline_stage", - "confidence": 0.67, - "dataflow_participation": 50, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C4_SEMANTIC_ROLES", - "path": "src/app_runtime/control/base.py", - "title": "ControlChannel", - "content": "ControlChannel\nrole: model\n\nResponsibilities:\n- default model role", - "start_line": 21, - "end_line": 28, - "metadata": { - "symbol_id": "cfcfe9a311d3a2dbdaf32ac4ccd73c0eb9a117f830591a1c0867ee97d46204ff", - "symbol_name": "ControlChannel", - "qname": "ControlChannel", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C4_SEMANTIC_ROLES", - "path": "src/app_runtime/control/base.py", - "title": "ControlActionSet", - "content": "ControlActionSet\nrole: model\n\nResponsibilities:\n- default model role", - "start_line": 14, - "end_line": 18, - "metadata": { - "symbol_id": "46eb026cb3313415ec47b82dd22f84f4d112c9d987e8b1716dcb0baa1cce8988", - "symbol_name": "ControlActionSet", - "qname": "ControlActionSet", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C4_SEMANTIC_ROLES", - "path": "src/app_runtime/control/service.py", - "title": "ControlPlaneService", - "content": "ControlPlaneService\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests service\n- reads and writes state attributes\n- participates in dataflow slices (5)", - "start_line": 12, - "end_line": 52, - "metadata": { - "symbol_id": "b13471e5916986dccffb53fab613812842965705e6b3a89ae549d30c9e91e9aa", - "symbol_name": "ControlPlaneService", - "qname": "ControlPlaneService", - "role": "pipeline_stage", - "confidence": 0.57, - "dataflow_participation": 5, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C4_SEMANTIC_ROLES", - "path": "src/app_runtime/control/http_runner.py", - "title": "UvicornThreadRunner", - "content": "UvicornThreadRunner\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (24)", - "start_line": 10, - "end_line": 61, - "metadata": { - "symbol_id": "fd55630045a02100df8877ac27d951ee08617d4598764394d48cb51fe067476a", - "symbol_name": "UvicornThreadRunner", - "qname": "UvicornThreadRunner", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 24, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "3779fdd2878b770e789a35bb2a89c9d79f13b61c26d7db1b3b683f9bb9e1623f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C4_SEMANTIC_ROLES", - "path": "src/app_runtime/control/http_channel.py", - "title": "HttpControlChannel", - "content": "HttpControlChannel\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (10)", - "start_line": 12, - "end_line": 57, - "metadata": { - "symbol_id": "1c9fbdc24819e5604c26ea55428a74310f03a03e1af197ed84846af61e42fdb0", - "symbol_name": "HttpControlChannel", - "qname": "HttpControlChannel", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 10, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C4_SEMANTIC_ROLES", - "path": "src/app_runtime/control/http_app.py", - "title": "HttpControlAppFactory", - "content": "HttpControlAppFactory\nrole: factory\n\nResponsibilities:\n- name suffix suggests factory", - "start_line": 15, - "end_line": 53, - "metadata": { - "symbol_id": "9b3502a5fb408b273223db13264349cf500de24915b6c649d9ea8970d0dfd8e0", - "symbol_name": "HttpControlAppFactory", - "qname": "HttpControlAppFactory", - "role": "factory", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C4_SEMANTIC_ROLES", - "path": "src/app_runtime/workflow/persistence/workflow_persistence.py", - "title": "WorkflowPersistence", - "content": "WorkflowPersistence\nrole: pipeline_stage\n\nResponsibilities:\n- orchestrates role-like calls (2)\n- reads and writes state attributes\n- participates in dataflow slices (16)", - "start_line": 8, - "end_line": 54, - "metadata": { - "symbol_id": "7bd01ee45cf31f2d5c2e3e51656254860ac785d10cef9e0852cd4fba90857bae", - "symbol_name": "WorkflowPersistence", - "qname": "WorkflowPersistence", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 16, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "80e9410ddc639789b4353c2a1a757ba8d0d5b5bb6075b0b263b61551f04ae1f0", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "path": "src/app_runtime/control/service.py", - "title": "ControlPlaneService.__init__:dataflow_slice", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.stop", - "start_line": 14, - "end_line": 25, - "metadata": { - "edge_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d", - "dst_ref": "ControlPlaneService.stop", - "resolution": "resolved", - "slice_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.stop" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "path": "src/app_runtime/control/service.py", - "title": "ControlPlaneService.__init__:dataflow_slice", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._stop_async", - "start_line": 14, - "end_line": 51, - "metadata": { - "edge_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a", - "dst_ref": "ControlPlaneService._stop_async", - "resolution": "resolved", - "slice_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._stop_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "path": "src/app_runtime/control/service.py", - "title": "ControlPlaneService.__init__:dataflow_slice", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.register_channel", - "start_line": 14, - "end_line": 17, - "metadata": { - "edge_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957", - "dst_ref": "ControlPlaneService.register_channel", - "resolution": "resolved", - "slice_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.register_channel" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "path": "src/app_runtime/control/service.py", - "title": "ControlPlaneService.__init__:dataflow_slice", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.start", - "start_line": 14, - "end_line": 20, - "metadata": { - "edge_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154", - "dst_ref": "ControlPlaneService.start", - "resolution": "resolved", - "slice_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.start" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "path": "src/app_runtime/control/service.py", - "title": "ControlPlaneService.__init__:dataflow_slice", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._start_async", - "start_line": 14, - "end_line": 47, - "metadata": { - "edge_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517", - "dst_ref": "ControlPlaneService._start_async", - "resolution": "resolved", - "slice_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._start_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "path": "src/app_runtime/core/runtime.py", - "title": "RuntimeManager.__init__:dataflow_slice", - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager.add_config_file", - "start_line": 32, - "end_line": 52, - "metadata": { - "edge_id": "a23b8a11ebdb12708b60c96ea12a69f7f042082f1adfddd572444e246d81d167", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "57ffbd4f0d9fdf3507c2b8624312ce211f3d02fdf86a57a8ec90778d8a7b498d", - "dst_ref": "RuntimeManager.add_config_file", - "resolution": "resolved", - "slice_id": "a23b8a11ebdb12708b60c96ea12a69f7f042082f1adfddd572444e246d81d167", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager.add_config_file" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "57ffbd4f0d9fdf3507c2b8624312ce211f3d02fdf86a57a8ec90778d8a7b498d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C3_ENTRYPOINTS", - "path": "src/app_runtime/control/http_app.py", - "title": "app.post", - "content": "fastapi http app.post", - "start_line": 38, - "end_line": 42, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C3_ENTRYPOINTS", - "path": "src/app_runtime/control/http_app.py", - "title": "app.get", - "content": "fastapi http app.get", - "start_line": 31, - "end_line": 34, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C3_ENTRYPOINTS", - "path": "src/app_runtime/control/http_app.py", - "title": "app.get", - "content": "fastapi http app.get", - "start_line": 38, - "end_line": 42, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "relations": [ - { - "path": "src/app_runtime/control/service.py", - "start_line": 14, - "end_line": 25, - "edge_type": "dataflow_slice", - "source": "ControlPlaneService.__init__", - "target": "ControlPlaneService.stop", - "metadata": { - "edge_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d", - "dst_ref": "ControlPlaneService.stop", - "resolution": "resolved", - "slice_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.stop" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - }, - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.stop" - }, - { - "path": "src/app_runtime/control/service.py", - "start_line": 14, - "end_line": 51, - "edge_type": "dataflow_slice", - "source": "ControlPlaneService.__init__", - "target": "ControlPlaneService._stop_async", - "metadata": { - "edge_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a", - "dst_ref": "ControlPlaneService._stop_async", - "resolution": "resolved", - "slice_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._stop_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - }, - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._stop_async" - }, - { - "path": "src/app_runtime/control/service.py", - "start_line": 14, - "end_line": 17, - "edge_type": "dataflow_slice", - "source": "ControlPlaneService.__init__", - "target": "ControlPlaneService.register_channel", - "metadata": { - "edge_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957", - "dst_ref": "ControlPlaneService.register_channel", - "resolution": "resolved", - "slice_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.register_channel" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - }, - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.register_channel" - }, - { - "path": "src/app_runtime/control/service.py", - "start_line": 14, - "end_line": 20, - "edge_type": "dataflow_slice", - "source": "ControlPlaneService.__init__", - "target": "ControlPlaneService.start", - "metadata": { - "edge_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154", - "dst_ref": "ControlPlaneService.start", - "resolution": "resolved", - "slice_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.start" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - }, - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.start" - }, - { - "path": "src/app_runtime/control/service.py", - "start_line": 14, - "end_line": 47, - "edge_type": "dataflow_slice", - "source": "ControlPlaneService.__init__", - "target": "ControlPlaneService._start_async", - "metadata": { - "edge_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517", - "dst_ref": "ControlPlaneService._start_async", - "resolution": "resolved", - "slice_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._start_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - }, - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._start_async" - }, - { - "path": "src/app_runtime/core/runtime.py", - "start_line": 32, - "end_line": 52, - "edge_type": "dataflow_slice", - "source": "RuntimeManager.__init__", - "target": "RuntimeManager.add_config_file", - "metadata": { - "edge_id": "a23b8a11ebdb12708b60c96ea12a69f7f042082f1adfddd572444e246d81d167", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "57ffbd4f0d9fdf3507c2b8624312ce211f3d02fdf86a57a8ec90778d8a7b498d", - "dst_ref": "RuntimeManager.add_config_file", - "resolution": "resolved", - "slice_id": "a23b8a11ebdb12708b60c96ea12a69f7f042082f1adfddd572444e246d81d167", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager.add_config_file" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "57ffbd4f0d9fdf3507c2b8624312ce211f3d02fdf86a57a8ec90778d8a7b498d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - }, - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager.add_config_file" - } - ], - "semantic_hints": [ - { - "path": "src/app_runtime/core/runtime.py", - "title": "RuntimeManager", - "symbol": "RuntimeManager", - "role": "pipeline_stage", - "confidence": 0.67, - "content": "RuntimeManager\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests manager\n- orchestrates role-like calls (4)\n- reads and writes state attributes\n- participates in dataflow slices (50)" - }, - { - "path": "src/app_runtime/control/base.py", - "title": "ControlChannel", - "symbol": "ControlChannel", - "role": "model", - "confidence": 0.99, - "content": "ControlChannel\nrole: model\n\nResponsibilities:\n- default model role" - }, - { - "path": "src/app_runtime/control/base.py", - "title": "ControlActionSet", - "symbol": "ControlActionSet", - "role": "model", - "confidence": 0.99, - "content": "ControlActionSet\nrole: model\n\nResponsibilities:\n- default model role" - }, - { - "path": "src/app_runtime/control/service.py", - "title": "ControlPlaneService", - "symbol": "ControlPlaneService", - "role": "pipeline_stage", - "confidence": 0.57, - "content": "ControlPlaneService\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests service\n- reads and writes state attributes\n- participates in dataflow slices (5)" - }, - { - "path": "src/app_runtime/control/http_runner.py", - "title": "UvicornThreadRunner", - "symbol": "UvicornThreadRunner", - "role": "pipeline_stage", - "confidence": 0.99, - "content": "UvicornThreadRunner\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (24)" - }, - { - "path": "src/app_runtime/control/http_channel.py", - "title": "HttpControlChannel", - "symbol": "HttpControlChannel", - "role": "pipeline_stage", - "confidence": 0.99, - "content": "HttpControlChannel\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (10)" - }, - { - "path": "src/app_runtime/control/http_app.py", - "title": "HttpControlAppFactory", - "symbol": "HttpControlAppFactory", - "role": "factory", - "confidence": 0.99, - "content": "HttpControlAppFactory\nrole: factory\n\nResponsibilities:\n- name suffix suggests factory" - }, - { - "path": "src/app_runtime/workflow/persistence/workflow_persistence.py", - "title": "WorkflowPersistence", - "symbol": "WorkflowPersistence", - "role": "pipeline_stage", - "confidence": 0.99, - "content": "WorkflowPersistence\nrole: pipeline_stage\n\nResponsibilities:\n- orchestrates role-like calls (2)\n- reads and writes state attributes\n- participates in dataflow slices (16)" - } - ], - "entrypoints": [ - { - "path": "src/app_runtime/control/http_app.py", - "title": "app.get", - "start_line": 31, - "end_line": 34, - "http_method": "GET", - "route_path": "/health", - "handler_symbol": "health", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "route_or_command": "app.get", - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "title": "app.get", - "start_line": 38, - "end_line": 42, - "http_method": "GET", - "route_path": "/actions/{action}", - "handler_symbol": "action", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "route_or_command": "app.get", - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "title": "app.post", - "start_line": 38, - "end_line": 42, - "http_method": "POST", - "route_path": "/actions/{action}", - "handler_symbol": "action", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "route_or_command": "app.post", - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "test_candidates": [], - "layer_outcomes": [ - { - "layer_id": "C1_SYMBOL_CATALOG", - "hit_count": 8, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C0_SOURCE_CHUNKS", - "hit_count": 8, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C4_SEMANTIC_ROLES", - "hit_count": 8, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C2_DEPENDENCY_GRAPH", - "hit_count": 6, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C3_ENTRYPOINTS", - "hit_count": 3, - "empty": false, - "fallback_used": false - } - ], - "missing_layers": [], - "raw_rows": [ - { - "path": "src/plba/bootstrap.py", - "content": "const RuntimeManager\nRuntimeManager = app_runtime.core.runtime.RuntimeManager", - "layer": "C1_SYMBOL_CATALOG", - "title": "RuntimeManager", - "span_start": 4, - "span_end": 4, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": null, - "metadata": { - "symbol_id": "27158ca220022eeb5083c6addf8a50775d45f7161284fd60aac48410105f4b98", - "qname": "RuntimeManager", - "kind": "const", - "signature": "RuntimeManager = app_runtime.core.runtime.RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "src.plba.bootstrap", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "const RuntimeManager\nRuntimeManager = app_runtime.core.runtime.RuntimeManager", - "layer": "C1_SYMBOL_CATALOG", - "title": "RuntimeManager", - "span_start": 9, - "span_end": 9, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": null, - "metadata": { - "symbol_id": "62a9575c77aad894120d18b4f2a08cf2ba42f77e9be4a8a432b767d157701afe", - "qname": "RuntimeManager", - "kind": "const", - "signature": "RuntimeManager = app_runtime.core.runtime.RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.control.service", - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "class RuntimeManager\nRuntimeManager", - "layer": "C1_SYMBOL_CATALOG", - "title": "RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": null, - "metadata": { - "symbol_id": "7e4a9381328c5803bbc6179458612fc4e947d928aa7bf8b4b2bebb2c8592f758", - "qname": "RuntimeManager", - "kind": "class", - "signature": "RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.core.runtime", - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/__init__.py", - "content": "const RuntimeManager\nRuntimeManager = plba.core.RuntimeManager", - "layer": "C1_SYMBOL_CATALOG", - "title": "RuntimeManager", - "span_start": 16, - "span_end": 16, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": null, - "metadata": { - "symbol_id": "7eacec84f9b8d6c4201374591faecdac7493091c263681495c338973f2971ad9", - "qname": "RuntimeManager", - "kind": "const", - "signature": "RuntimeManager = plba.core.RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "src.plba.__init__", - "is_test": false, - "blob_sha": "24e755ec8c249d14fb0e675b5dbf2b71ab91afb9c849897eebfa9feb2499e19d", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/core.py", - "content": "const RuntimeManager\nRuntimeManager = app_runtime.core.runtime.RuntimeManager", - "layer": "C1_SYMBOL_CATALOG", - "title": "RuntimeManager", - "span_start": 2, - "span_end": 2, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": null, - "metadata": { - "symbol_id": "e1684562d978b7af7fe9b27dc5869d770348a87b5dc19a50360f58544668578b", - "qname": "RuntimeManager", - "kind": "const", - "signature": "RuntimeManager = app_runtime.core.runtime.RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "src.plba.core", - "is_test": false, - "blob_sha": "c0ae25110d20e665216616e26b68adfe035b624ba45d31d1272fb21f906f9ca8", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/__init__.py", - "content": "const ControlPlaneService\nControlPlaneService = app_runtime.control.service.ControlPlaneService", - "layer": "C1_SYMBOL_CATALOG", - "title": "ControlPlaneService", - "span_start": 3, - "span_end": 3, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": null, - "metadata": { - "symbol_id": "217e8f044d1c01644bf7b81e5046af9e84469210c692a2fb0c476a19bb069ae1", - "qname": "ControlPlaneService", - "kind": "const", - "signature": "ControlPlaneService = app_runtime.control.service.ControlPlaneService", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.control.__init__", - "is_test": false, - "blob_sha": "bf3c37e3369a84cc618adc0fd71c232e5eb4b871eaff743069a17e661e498316", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "method ControlChannel.start\nstart(self, actions)\nStart the control channel and bind handlers.", - "layer": "C1_SYMBOL_CATALOG", - "title": "ControlChannel.start", - "span_start": 23, - "span_end": 24, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": null, - "metadata": { - "symbol_id": "e01e0d50d0f48d0c84c119c989b7a7c57ceea263811ce2605c684ae24d1a03b1", - "qname": "ControlChannel.start", - "kind": "method", - "signature": "start(self, actions)", - "parent_symbol_id": "ControlChannel", - "package_or_module": "src.app_runtime.control.base", - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "method ControlChannel.stop\nstop(self)\nStop the control channel and release resources.", - "layer": "C1_SYMBOL_CATALOG", - "title": "ControlChannel.stop", - "span_start": 27, - "span_end": 28, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": null, - "metadata": { - "symbol_id": "54b5adf9866c526836221dc721b474ba23fbec83e1b1d3b8bc4da67ae3c1541d", - "qname": "ControlChannel.stop", - "kind": "method", - "signature": "stop(self)", - "parent_symbol_id": "ControlChannel", - "package_or_module": "src.app_runtime.control.base", - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "class ControlPlaneService:\n def __init__(self) -> None:\n self._channels: list[ControlChannel] = []\n\n def register_channel(self, channel: ControlChannel) -> None:\n self._channels.append(channel)\n\n def start(self, runtime: RuntimeManager) -> None:\n if not self._channels:\n return\n asyncio.run(self._start_async(runtime))\n\n def stop(self) -> None:\n if not self._channels:\n return\n asyncio.run(self._stop_async())\n\n def snapshot(self, runtime: RuntimeManager) -> dict[str, object]:\n health = runtime.current_health()\n return {\n \"runtime\": {\"state\": runtime._state.value},\n \"modules\": list(runtime.registry.modules),\n \"services\": runtime.services.snapshot(),\n \"workers\": runtime.workers.snapshot(),\n \"health\": runtime.health.snapshot(runtime.workers.healths()) | {\"status\": health[\"status\"]},\n \"config\": runtime.configuration.get(),\n }\n\n async def _start_async(self, runtime: RuntimeManager) -> None:\n actions = ControlActionSet(\n health=runtime.health_status,\n start=runtime.start_runtime,\n stop=runtime.stop_runtime,\n status=runtime.runtime_status,\n )\n for channel in self._channels:\n await channel.start(actions)\n\n async def _stop_async(self) -> None:\n for channel in reversed(self._channels):\n await channel.stop()", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/service.py:ControlPlaneService", - "span_start": 12, - "span_end": 52, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": null, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.service", - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_runner.py", - "content": "class UvicornThreadRunner:\n def __init__(self, host: str, port: int, timeout: int) -> None:\n self._host = host\n self._port = port\n self._timeout = timeout\n self._server: Server | None = None\n self._thread: Thread | None = None\n self._error: BaseException | None = None\n\n async def start(self, app: FastAPI) -> None:\n if self._thread is not None and self._thread.is_alive():\n return\n self._error = None\n config = Config(app=app, host=self._host, port=self._port, log_level=\"warning\")\n self._server = Server(config)\n self._thread = Thread(target=self._serve, name=\"plba-http-control\", daemon=True)\n self._thread.start()\n await self._wait_until_started()\n\n async def stop(self) -> None:\n if self._server is None or self._thread is None:\n return\n self._server.should_exit = True\n await asyncio.to_thread(self._thread.join, self._timeout)\n self._server = None\n self._thread = None\n\n @property\n def port(self) -> int:\n if self._server is None or not getattr(self._server, \"servers\", None):\n return self._port\n socket = self._server.servers[0].sockets[0]\n return int(socket.getsockname()[1])\n\n async def _wait_until_started(self) -> None:\n if self._server is None:\n raise RuntimeError(\"Server is not initialized\")\n deadline = asyncio.get_running_loop().time() + max(float(self._timeout), 1.0)\n while not self._server.started:\n if self._error is not None:\n raise RuntimeError(\"HTTP control server failed to start\") from self._error\n if asyncio.get_running_loop().time() >= deadline:\n raise TimeoutError(\"HTTP control server startup timed out\")\n await asyncio.sleep(0.05)\n\n def _serve(self) -> None:\n if self._server is None:\n return\n try:\n asyncio.run(self._server.serve())\n except BaseException as exc: # noqa: BLE001\n self._error = exc", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/http_runner.py:UvicornThreadRunner", - "span_start": 10, - "span_end": 61, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": null, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.http_runner", - "is_test": false, - "blob_sha": "3779fdd2878b770e789a35bb2a89c9d79f13b61c26d7db1b3b683f9bb9e1623f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "class ControlChannel(ABC):\n @abstractmethod\n async def start(self, actions: ControlActionSet) -> None:\n \"\"\"Start the control channel and bind handlers.\"\"\"\n\n @abstractmethod\n async def stop(self) -> None:\n \"\"\"Stop the control channel and release resources.\"\"\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/base.py:ControlChannel", - "span_start": 21, - "span_end": 28, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": null, - "metadata": { - "chunk_index": 1, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.base", - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/__init__.py", - "content": "from app_runtime.control.base import ControlActionSet, ControlChannel\nfrom app_runtime.control.http_channel import HttpControlChannel\nfrom app_runtime.control.service import ControlPlaneService\n\n__all__ = [\"ControlActionSet\", \"ControlChannel\", \"ControlPlaneService\", \"HttpControlChannel\"]", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/__init__.py:1-5", - "span_start": 1, - "span_end": 5, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": null, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.app_runtime.control.__init__", - "is_test": false, - "blob_sha": "bf3c37e3369a84cc618adc0fd71c232e5eb4b871eaff743069a17e661e498316", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "class HttpControlAppFactory:\n def create(\n self,\n health_provider: Callable[[], Awaitable[HealthPayload]],\n action_provider: Callable[[str, str], Awaitable[JSONResponse]],\n ) -> FastAPI:\n app = FastAPI(title=\"PLBA Control API\")\n\n @app.middleware(\"http\")\n async def log_api_call(request: Request, call_next): # type: ignore[no-untyped-def]\n started = time.monotonic()\n response = await call_next(request)\n response.headers[\"X-Response-Time-Ms\"] = str(int((time.monotonic() - started) * 1000))\n return response\n\n @app.get(\"/health\")\n async def health() -> JSONResponse:\n payload = await health_provider()\n status_code = 200 if payload.get(\"status\") == \"ok\" else 503\n return JSONResponse(content=payload, status_code=status_code)\n\n @app.get(\"/actions/{action}\")\n @app.post(\"/actions/{action}\")\n async def action(action: str, request: Request) -> JSONResponse:\n client_source = self._client_source(request)\n if action in {\"start\", \"stop\"}:\n LOGGER.warning(\"Control action requested: /actions/%s client=%s\", action, client_source)\n return await action_provider(action, client_source)\n\n return app\n\n def _client_source(self, request: Request) -> str:\n explicit_header = request.headers.get(\"X-Client-Source\", \"\").strip()\n if explicit_header:\n return explicit_header\n user_agent = request.headers.get(\"User-Agent\", \"\").strip()\n if user_agent:\n return f\"user-agent:{user_agent}\"\n return \"unknown\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/http_app.py:HttpControlAppFactory", - "span_start": 15, - "span_end": 53, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": null, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.http_app", - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "class HttpControlChannel(ControlChannel):\n def __init__(self, host: str, port: int, timeout: int) -> None:\n self._timeout = timeout\n self._runner = UvicornThreadRunner(host, port, timeout)\n self._factory = HttpControlAppFactory()\n self._actions: ControlActionSet | None = None\n\n async def start(self, actions: ControlActionSet) -> None:\n self._actions = actions\n app = self._factory.create(self._health_response, self._action_response)\n await self._runner.start(app)\n\n async def stop(self) -> None:\n await self._runner.stop()\n\n @property\n def port(self) -> int:\n return self._runner.port\n\n async def _health_response(self) -> dict[str, object]:\n if self._actions is None:\n return {\"status\": \"unhealthy\", \"detail\": \"control actions are not configured\"}\n return await asyncio.wait_for(self._actions.health(), timeout=float(self._timeout))\n\n async def _action_response(self, action: str, _client_source: str = \"unknown\") -> JSONResponse:\n if self._actions is None:\n return JSONResponse(content={\"status\": \"error\", \"detail\": f\"{action} handler is not configured\"}, status_code=404)\n callbacks = {\n \"start\": self._actions.start,\n \"stop\": self._actions.stop,\n \"status\": self._actions.status,\n }\n callback = callbacks.get(action)\n if callback is None:\n return JSONResponse(content={\"status\": \"error\", \"detail\": f\"unsupported action: {action}\"}, status_code=404)\n action_timeout = max(float(self._timeout), 10.0) if action in {\"start\", \"stop\"} else float(self._timeout)\n try:\n detail = await asyncio.wait_for(callback(), timeout=action_timeout)\n except asyncio.TimeoutError:\n return JSONResponse(\n content={\"status\": \"accepted\", \"detail\": f\"{action} operation is still in progress\"},\n status_code=202,\n )\n except Exception as exc:\n return JSONResponse(content={\"status\": \"error\", \"detail\": str(exc)}, status_code=500)\n return JSONResponse(content={\"status\": \"ok\", \"detail\": detail or f\"{action} action accepted\"}, status_code=200)", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/http_channel.py:HttpControlChannel", - "span_start": 12, - "span_end": 57, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": null, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.http_channel", - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "class ControlActionSet:\n health: HealthHandler\n start: ActionHandler\n stop: ActionHandler\n status: ActionHandler", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/base.py:ControlActionSet", - "span_start": 14, - "span_end": 18, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": null, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.base", - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/control.py", - "content": "from app_runtime.control.base import ControlActionSet, ControlChannel\nfrom app_runtime.control.http_channel import HttpControlChannel\nfrom app_runtime.control.service import ControlPlaneService\n\n__all__ = [\n \"ControlActionSet\",\n \"ControlChannel\",\n \"ControlPlaneService\",\n \"HttpControlChannel\",\n]", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/plba/control.py:1-10", - "span_start": 1, - "span_end": 10, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": null, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.plba.control", - "is_test": false, - "blob_sha": "31bd5c4481bfa7fbca8fae56d4860a67e3953ca74474ac8439e1f39b685d7bc8", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests manager\n- orchestrates role-like calls (4)\n- reads and writes state attributes\n- participates in dataflow slices (50)", - "layer": "C4_SEMANTIC_ROLES", - "title": "RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 43, - "layer_rank": 2, - "distance": null, - "metadata": { - "symbol_id": "7e4a9381328c5803bbc6179458612fc4e947d928aa7bf8b4b2bebb2c8592f758", - "symbol_name": "RuntimeManager", - "qname": "RuntimeManager", - "role": "pipeline_stage", - "confidence": 0.67, - "dataflow_participation": 50, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "ControlChannel\nrole: model\n\nResponsibilities:\n- default model role", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlChannel", - "span_start": 21, - "span_end": 28, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 40, - "layer_rank": 2, - "distance": null, - "metadata": { - "symbol_id": "cfcfe9a311d3a2dbdaf32ac4ccd73c0eb9a117f830591a1c0867ee97d46204ff", - "symbol_name": "ControlChannel", - "qname": "ControlChannel", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "ControlActionSet\nrole: model\n\nResponsibilities:\n- default model role", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlActionSet", - "span_start": 14, - "span_end": 18, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 40, - "layer_rank": 2, - "distance": null, - "metadata": { - "symbol_id": "46eb026cb3313415ec47b82dd22f84f4d112c9d987e8b1716dcb0baa1cce8988", - "symbol_name": "ControlActionSet", - "qname": "ControlActionSet", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests service\n- reads and writes state attributes\n- participates in dataflow slices (5)", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlPlaneService", - "span_start": 12, - "span_end": 52, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 68, - "layer_rank": 2, - "distance": null, - "metadata": { - "symbol_id": "b13471e5916986dccffb53fab613812842965705e6b3a89ae549d30c9e91e9aa", - "symbol_name": "ControlPlaneService", - "qname": "ControlPlaneService", - "role": "pipeline_stage", - "confidence": 0.57, - "dataflow_participation": 5, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_runner.py", - "content": "UvicornThreadRunner\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (24)", - "layer": "C4_SEMANTIC_ROLES", - "title": "UvicornThreadRunner", - "span_start": 10, - "span_end": 61, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 11, - "layer_rank": 2, - "distance": null, - "metadata": { - "symbol_id": "fd55630045a02100df8877ac27d951ee08617d4598764394d48cb51fe067476a", - "symbol_name": "UvicornThreadRunner", - "qname": "UvicornThreadRunner", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 24, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "3779fdd2878b770e789a35bb2a89c9d79f13b61c26d7db1b3b683f9bb9e1623f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (10)", - "layer": "C4_SEMANTIC_ROLES", - "title": "HttpControlChannel", - "span_start": 12, - "span_end": 57, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 21, - "layer_rank": 2, - "distance": null, - "metadata": { - "symbol_id": "1c9fbdc24819e5604c26ea55428a74310f03a03e1af197ed84846af61e42fdb0", - "symbol_name": "HttpControlChannel", - "qname": "HttpControlChannel", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 10, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "HttpControlAppFactory\nrole: factory\n\nResponsibilities:\n- name suffix suggests factory", - "layer": "C4_SEMANTIC_ROLES", - "title": "HttpControlAppFactory", - "span_start": 15, - "span_end": 53, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 39, - "layer_rank": 2, - "distance": null, - "metadata": { - "symbol_id": "9b3502a5fb408b273223db13264349cf500de24915b6c649d9ea8970d0dfd8e0", - "symbol_name": "HttpControlAppFactory", - "qname": "HttpControlAppFactory", - "role": "factory", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/persistence/workflow_persistence.py", - "content": "WorkflowPersistence\nrole: pipeline_stage\n\nResponsibilities:\n- orchestrates role-like calls (2)\n- reads and writes state attributes\n- participates in dataflow slices (16)", - "layer": "C4_SEMANTIC_ROLES", - "title": "WorkflowPersistence", - "span_start": 8, - "span_end": 54, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 15, - "layer_rank": 2, - "distance": null, - "metadata": { - "symbol_id": "7bd01ee45cf31f2d5c2e3e51656254860ac785d10cef9e0852cd4fba90857bae", - "symbol_name": "WorkflowPersistence", - "qname": "WorkflowPersistence", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 16, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "80e9410ddc639789b4353c2a1a757ba8d0d5b5bb6075b0b263b61551f04ae1f0", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.stop", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 25, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": null, - "metadata": { - "edge_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d", - "dst_ref": "ControlPlaneService.stop", - "resolution": "resolved", - "slice_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.stop" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._stop_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 51, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": null, - "metadata": { - "edge_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a", - "dst_ref": "ControlPlaneService._stop_async", - "resolution": "resolved", - "slice_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._stop_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.register_channel", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 17, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": null, - "metadata": { - "edge_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957", - "dst_ref": "ControlPlaneService.register_channel", - "resolution": "resolved", - "slice_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.register_channel" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.start", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 20, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": null, - "metadata": { - "edge_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154", - "dst_ref": "ControlPlaneService.start", - "resolution": "resolved", - "slice_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.start" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._start_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 47, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": null, - "metadata": { - "edge_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517", - "dst_ref": "ControlPlaneService._start_async", - "resolution": "resolved", - "slice_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._start_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager.add_config_file", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 32, - "span_end": 52, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": null, - "metadata": { - "edge_id": "a23b8a11ebdb12708b60c96ea12a69f7f042082f1adfddd572444e246d81d167", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "57ffbd4f0d9fdf3507c2b8624312ce211f3d02fdf86a57a8ec90778d8a7b498d", - "dst_ref": "RuntimeManager.add_config_file", - "resolution": "resolved", - "slice_id": "a23b8a11ebdb12708b60c96ea12a69f7f042082f1adfddd572444e246d81d167", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager.add_config_file" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "57ffbd4f0d9fdf3507c2b8624312ce211f3d02fdf86a57a8ec90778d8a7b498d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": null, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": null, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": null, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "retrieval_report": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "vector", - "C0_SOURCE_CHUNKS": "vector", - "C4_SEMANTIC_ROLES": "vector", - "C2_DEPENDENCY_GRAPH": "vector", - "C3_ENTRYPOINTS": "vector" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 8, - "C4_SEMANTIC_ROLES": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C3_ENTRYPOINTS": 6 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [] - }, - "C4_SEMANTIC_ROLES": { - "path_scope": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [] - } - }, - "fallback": { - "used": false, - "reason": null - }, - "retrieval_by_layer_ms": { - "C1_SYMBOL_CATALOG": 64, - "C0_SOURCE_CHUNKS": 20, - "C4_SEMANTIC_ROLES": 18, - "C2_DEPENDENCY_GRAPH": 57, - "C3_ENTRYPOINTS": 14 - } - } - }, - "diagnostics": { - "intent_correct": null, - "target_found": true, - "layers_used": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_sufficient": true, - "answer_mode": "degraded", - "resolved_target": "RuntimeManager", - "answer_policy_branch": "normal_answer", - "decision_reason": "evidence_sufficient", - "router_result": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "retrieval_profile": "code", - "sub_intent": "EXPLAIN", - "path_scope": [], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "symbol_resolution_status": "resolved" - }, - "retrieval_request": { - "rag_session_id": "7d11da21-faa0-4cea-aede-aeabe069164c", - "query": "Объясни как работает класс RuntimeManager", - "sub_intent": "EXPLAIN", - "path_scope": [], - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "per_layer_outcome": [ - { - "layer_id": "C1_SYMBOL_CATALOG", - "hit_count": 8, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C0_SOURCE_CHUNKS", - "hit_count": 8, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C4_SEMANTIC_ROLES", - "hit_count": 8, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C2_DEPENDENCY_GRAPH", - "hit_count": 6, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C3_ENTRYPOINTS", - "hit_count": 3, - "empty": false, - "fallback_used": false - } - ], - "empty_layers": [], - "evidence_gate_decision": { - "sufficient": true, - "failure_reasons": [], - "evidence_count": 33 - }, - "evidence_gate_input": { - "resolved_target": "RuntimeManager", - "sub_intent": "EXPLAIN", - "target_type": "symbol", - "evidence_count": 33, - "code_chunk_count": 33, - "entrypoint_count": 3, - "relation_count": 6, - "test_evidence_count": 0, - "symbol_resolution_status": "resolved", - "path_scope": [] - }, - "post_evidence_gate": { - "input": { - "answer_mode": "normal", - "degraded_message": "", - "resolved_target": "RuntimeManager", - "draft_answer_preview": "Класс `RuntimeManager` определён в файле `src/app_runtime/core/runtime.py`. Он играет роль стадии конвейера (pipeline stage), согласно семантическим подсказкам.\n\nОднако в предоставленном контексте отсутствуют конкретные методы, поля или вызовы этого класса. Если необходимы подробности работы `Runtim", - "repair_candidate": true - }, - "output": { - "passed": false, - "action": "repair", - "reasons": [ - "missing_concrete_methods", - "missing_concrete_calls", - "too_vague_for_explain" - ], - "repair_used": true, - "final_answer_preview": "Недостаточно подтверждённых данных для уверенного ответа по RuntimeManager." - } - }, - "failure_reasons": [], - "timings_ms": { - "router": 1, - "retrieval": 176, - "pre_evidence_gate": 1, - "llm": 3521, - "post_evidence_gate": 2, - "repair": 2383, - "post_evidence_gate_recheck": 2 - } - }, - "rag_rows": [ - { - "path": "src/plba/bootstrap.py", - "content": "const RuntimeManager\nRuntimeManager = app_runtime.core.runtime.RuntimeManager", - "layer": "C1_SYMBOL_CATALOG", - "title": "RuntimeManager", - "span_start": 4, - "span_end": 4, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "27158ca220022eeb5083c6addf8a50775d45f7161284fd60aac48410105f4b98", - "qname": "RuntimeManager", - "kind": "const", - "signature": "RuntimeManager = app_runtime.core.runtime.RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "src.plba.bootstrap", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "const RuntimeManager\nRuntimeManager = app_runtime.core.runtime.RuntimeManager", - "layer": "C1_SYMBOL_CATALOG", - "title": "RuntimeManager", - "span_start": 9, - "span_end": 9, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "62a9575c77aad894120d18b4f2a08cf2ba42f77e9be4a8a432b767d157701afe", - "qname": "RuntimeManager", - "kind": "const", - "signature": "RuntimeManager = app_runtime.core.runtime.RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.control.service", - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "class RuntimeManager\nRuntimeManager", - "layer": "C1_SYMBOL_CATALOG", - "title": "RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "7e4a9381328c5803bbc6179458612fc4e947d928aa7bf8b4b2bebb2c8592f758", - "qname": "RuntimeManager", - "kind": "class", - "signature": "RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.core.runtime", - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/__init__.py", - "content": "const RuntimeManager\nRuntimeManager = plba.core.RuntimeManager", - "layer": "C1_SYMBOL_CATALOG", - "title": "RuntimeManager", - "span_start": 16, - "span_end": 16, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "7eacec84f9b8d6c4201374591faecdac7493091c263681495c338973f2971ad9", - "qname": "RuntimeManager", - "kind": "const", - "signature": "RuntimeManager = plba.core.RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "src.plba.__init__", - "is_test": false, - "blob_sha": "24e755ec8c249d14fb0e675b5dbf2b71ab91afb9c849897eebfa9feb2499e19d", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/core.py", - "content": "const RuntimeManager\nRuntimeManager = app_runtime.core.runtime.RuntimeManager", - "layer": "C1_SYMBOL_CATALOG", - "title": "RuntimeManager", - "span_start": 2, - "span_end": 2, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "e1684562d978b7af7fe9b27dc5869d770348a87b5dc19a50360f58544668578b", - "qname": "RuntimeManager", - "kind": "const", - "signature": "RuntimeManager = app_runtime.core.runtime.RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "src.plba.core", - "is_test": false, - "blob_sha": "c0ae25110d20e665216616e26b68adfe035b624ba45d31d1272fb21f906f9ca8", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/__init__.py", - "content": "const ControlPlaneService\nControlPlaneService = app_runtime.control.service.ControlPlaneService", - "layer": "C1_SYMBOL_CATALOG", - "title": "ControlPlaneService", - "span_start": 3, - "span_end": 3, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "217e8f044d1c01644bf7b81e5046af9e84469210c692a2fb0c476a19bb069ae1", - "qname": "ControlPlaneService", - "kind": "const", - "signature": "ControlPlaneService = app_runtime.control.service.ControlPlaneService", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.control.__init__", - "is_test": false, - "blob_sha": "bf3c37e3369a84cc618adc0fd71c232e5eb4b871eaff743069a17e661e498316", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "method ControlChannel.start\nstart(self, actions)\nStart the control channel and bind handlers.", - "layer": "C1_SYMBOL_CATALOG", - "title": "ControlChannel.start", - "span_start": 23, - "span_end": 24, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "e01e0d50d0f48d0c84c119c989b7a7c57ceea263811ce2605c684ae24d1a03b1", - "qname": "ControlChannel.start", - "kind": "method", - "signature": "start(self, actions)", - "parent_symbol_id": "ControlChannel", - "package_or_module": "src.app_runtime.control.base", - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "method ControlChannel.stop\nstop(self)\nStop the control channel and release resources.", - "layer": "C1_SYMBOL_CATALOG", - "title": "ControlChannel.stop", - "span_start": 27, - "span_end": 28, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "54b5adf9866c526836221dc721b474ba23fbec83e1b1d3b8bc4da67ae3c1541d", - "qname": "ControlChannel.stop", - "kind": "method", - "signature": "stop(self)", - "parent_symbol_id": "ControlChannel", - "package_or_module": "src.app_runtime.control.base", - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "class ControlPlaneService:\n def __init__(self) -> None:\n self._channels: list[ControlChannel] = []\n\n def register_channel(self, channel: ControlChannel) -> None:\n self._channels.append(channel)\n\n def start(self, runtime: RuntimeManager) -> None:\n if not self._channels:\n return\n asyncio.run(self._start_async(runtime))\n\n def stop(self) -> None:\n if not self._channels:\n return\n asyncio.run(self._stop_async())\n\n def snapshot(self, runtime: RuntimeManager) -> dict[str, object]:\n health = runtime.current_health()\n return {\n \"runtime\": {\"state\": runtime._state.value},\n \"modules\": list(runtime.registry.modules),\n \"services\": runtime.services.snapshot(),\n \"workers\": runtime.workers.snapshot(),\n \"health\": runtime.health.snapshot(runtime.workers.healths()) | {\"status\": health[\"status\"]},\n \"config\": runtime.configuration.get(),\n }\n\n async def _start_async(self, runtime: RuntimeManager) -> None:\n actions = ControlActionSet(\n health=runtime.health_status,\n start=runtime.start_runtime,\n stop=runtime.stop_runtime,\n status=runtime.runtime_status,\n )\n for channel in self._channels:\n await channel.start(actions)\n\n async def _stop_async(self) -> None:\n for channel in reversed(self._channels):\n await channel.stop()", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/service.py:ControlPlaneService", - "span_start": 12, - "span_end": 52, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.service", - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_runner.py", - "content": "class UvicornThreadRunner:\n def __init__(self, host: str, port: int, timeout: int) -> None:\n self._host = host\n self._port = port\n self._timeout = timeout\n self._server: Server | None = None\n self._thread: Thread | None = None\n self._error: BaseException | None = None\n\n async def start(self, app: FastAPI) -> None:\n if self._thread is not None and self._thread.is_alive():\n return\n self._error = None\n config = Config(app=app, host=self._host, port=self._port, log_level=\"warning\")\n self._server = Server(config)\n self._thread = Thread(target=self._serve, name=\"plba-http-control\", daemon=True)\n self._thread.start()\n await self._wait_until_started()\n\n async def stop(self) -> None:\n if self._server is None or self._thread is None:\n return\n self._server.should_exit = True\n await asyncio.to_thread(self._thread.join, self._timeout)\n self._server = None\n self._thread = None\n\n @property\n def port(self) -> int:\n if self._server is None or not getattr(self._server, \"servers\", None):\n return self._port\n socket = self._server.servers[0].sockets[0]\n return int(socket.getsockname()[1])\n\n async def _wait_until_started(self) -> None:\n if self._server is None:\n raise RuntimeError(\"Server is not initialized\")\n deadline = asyncio.get_running_loop().time() + max(float(self._timeout), 1.0)\n while not self._server.started:\n if self._error is not None:\n raise RuntimeError(\"HTTP control server failed to start\") from self._error\n if asyncio.get_running_loop().time() >= deadline:\n raise TimeoutError(\"HTTP control server startup timed out\")\n await asyncio.sleep(0.05)\n\n def _serve(self) -> None:\n if self._server is None:\n return\n try:\n asyncio.run(self._server.serve())\n except BaseException as exc: # noqa: BLE001\n self._error = exc", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/http_runner.py:UvicornThreadRunner", - "span_start": 10, - "span_end": 61, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.http_runner", - "is_test": false, - "blob_sha": "3779fdd2878b770e789a35bb2a89c9d79f13b61c26d7db1b3b683f9bb9e1623f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "class ControlChannel(ABC):\n @abstractmethod\n async def start(self, actions: ControlActionSet) -> None:\n \"\"\"Start the control channel and bind handlers.\"\"\"\n\n @abstractmethod\n async def stop(self) -> None:\n \"\"\"Stop the control channel and release resources.\"\"\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/base.py:ControlChannel", - "span_start": 21, - "span_end": 28, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 1, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.base", - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/__init__.py", - "content": "from app_runtime.control.base import ControlActionSet, ControlChannel\nfrom app_runtime.control.http_channel import HttpControlChannel\nfrom app_runtime.control.service import ControlPlaneService\n\n__all__ = [\"ControlActionSet\", \"ControlChannel\", \"ControlPlaneService\", \"HttpControlChannel\"]", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/__init__.py:1-5", - "span_start": 1, - "span_end": 5, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.app_runtime.control.__init__", - "is_test": false, - "blob_sha": "bf3c37e3369a84cc618adc0fd71c232e5eb4b871eaff743069a17e661e498316", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "class HttpControlAppFactory:\n def create(\n self,\n health_provider: Callable[[], Awaitable[HealthPayload]],\n action_provider: Callable[[str, str], Awaitable[JSONResponse]],\n ) -> FastAPI:\n app = FastAPI(title=\"PLBA Control API\")\n\n @app.middleware(\"http\")\n async def log_api_call(request: Request, call_next): # type: ignore[no-untyped-def]\n started = time.monotonic()\n response = await call_next(request)\n response.headers[\"X-Response-Time-Ms\"] = str(int((time.monotonic() - started) * 1000))\n return response\n\n @app.get(\"/health\")\n async def health() -> JSONResponse:\n payload = await health_provider()\n status_code = 200 if payload.get(\"status\") == \"ok\" else 503\n return JSONResponse(content=payload, status_code=status_code)\n\n @app.get(\"/actions/{action}\")\n @app.post(\"/actions/{action}\")\n async def action(action: str, request: Request) -> JSONResponse:\n client_source = self._client_source(request)\n if action in {\"start\", \"stop\"}:\n LOGGER.warning(\"Control action requested: /actions/%s client=%s\", action, client_source)\n return await action_provider(action, client_source)\n\n return app\n\n def _client_source(self, request: Request) -> str:\n explicit_header = request.headers.get(\"X-Client-Source\", \"\").strip()\n if explicit_header:\n return explicit_header\n user_agent = request.headers.get(\"User-Agent\", \"\").strip()\n if user_agent:\n return f\"user-agent:{user_agent}\"\n return \"unknown\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/http_app.py:HttpControlAppFactory", - "span_start": 15, - "span_end": 53, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.http_app", - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "class HttpControlChannel(ControlChannel):\n def __init__(self, host: str, port: int, timeout: int) -> None:\n self._timeout = timeout\n self._runner = UvicornThreadRunner(host, port, timeout)\n self._factory = HttpControlAppFactory()\n self._actions: ControlActionSet | None = None\n\n async def start(self, actions: ControlActionSet) -> None:\n self._actions = actions\n app = self._factory.create(self._health_response, self._action_response)\n await self._runner.start(app)\n\n async def stop(self) -> None:\n await self._runner.stop()\n\n @property\n def port(self) -> int:\n return self._runner.port\n\n async def _health_response(self) -> dict[str, object]:\n if self._actions is None:\n return {\"status\": \"unhealthy\", \"detail\": \"control actions are not configured\"}\n return await asyncio.wait_for(self._actions.health(), timeout=float(self._timeout))\n\n async def _action_response(self, action: str, _client_source: str = \"unknown\") -> JSONResponse:\n if self._actions is None:\n return JSONResponse(content={\"status\": \"error\", \"detail\": f\"{action} handler is not configured\"}, status_code=404)\n callbacks = {\n \"start\": self._actions.start,\n \"stop\": self._actions.stop,\n \"status\": self._actions.status,\n }\n callback = callbacks.get(action)\n if callback is None:\n return JSONResponse(content={\"status\": \"error\", \"detail\": f\"unsupported action: {action}\"}, status_code=404)\n action_timeout = max(float(self._timeout), 10.0) if action in {\"start\", \"stop\"} else float(self._timeout)\n try:\n detail = await asyncio.wait_for(callback(), timeout=action_timeout)\n except asyncio.TimeoutError:\n return JSONResponse(\n content={\"status\": \"accepted\", \"detail\": f\"{action} operation is still in progress\"},\n status_code=202,\n )\n except Exception as exc:\n return JSONResponse(content={\"status\": \"error\", \"detail\": str(exc)}, status_code=500)\n return JSONResponse(content={\"status\": \"ok\", \"detail\": detail or f\"{action} action accepted\"}, status_code=200)", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/http_channel.py:HttpControlChannel", - "span_start": 12, - "span_end": 57, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.http_channel", - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "class ControlActionSet:\n health: HealthHandler\n start: ActionHandler\n stop: ActionHandler\n status: ActionHandler", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/base.py:ControlActionSet", - "span_start": 14, - "span_end": 18, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.base", - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/control.py", - "content": "from app_runtime.control.base import ControlActionSet, ControlChannel\nfrom app_runtime.control.http_channel import HttpControlChannel\nfrom app_runtime.control.service import ControlPlaneService\n\n__all__ = [\n \"ControlActionSet\",\n \"ControlChannel\",\n \"ControlPlaneService\",\n \"HttpControlChannel\",\n]", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/plba/control.py:1-10", - "span_start": 1, - "span_end": 10, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.plba.control", - "is_test": false, - "blob_sha": "31bd5c4481bfa7fbca8fae56d4860a67e3953ca74474ac8439e1f39b685d7bc8", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests manager\n- orchestrates role-like calls (4)\n- reads and writes state attributes\n- participates in dataflow slices (50)", - "layer": "C4_SEMANTIC_ROLES", - "title": "RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 43, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "7e4a9381328c5803bbc6179458612fc4e947d928aa7bf8b4b2bebb2c8592f758", - "symbol_name": "RuntimeManager", - "qname": "RuntimeManager", - "role": "pipeline_stage", - "confidence": 0.67, - "dataflow_participation": 50, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "ControlChannel\nrole: model\n\nResponsibilities:\n- default model role", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlChannel", - "span_start": 21, - "span_end": 28, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 40, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "cfcfe9a311d3a2dbdaf32ac4ccd73c0eb9a117f830591a1c0867ee97d46204ff", - "symbol_name": "ControlChannel", - "qname": "ControlChannel", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "ControlActionSet\nrole: model\n\nResponsibilities:\n- default model role", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlActionSet", - "span_start": 14, - "span_end": 18, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 40, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "46eb026cb3313415ec47b82dd22f84f4d112c9d987e8b1716dcb0baa1cce8988", - "symbol_name": "ControlActionSet", - "qname": "ControlActionSet", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests service\n- reads and writes state attributes\n- participates in dataflow slices (5)", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlPlaneService", - "span_start": 12, - "span_end": 52, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 68, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "b13471e5916986dccffb53fab613812842965705e6b3a89ae549d30c9e91e9aa", - "symbol_name": "ControlPlaneService", - "qname": "ControlPlaneService", - "role": "pipeline_stage", - "confidence": 0.57, - "dataflow_participation": 5, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_runner.py", - "content": "UvicornThreadRunner\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (24)", - "layer": "C4_SEMANTIC_ROLES", - "title": "UvicornThreadRunner", - "span_start": 10, - "span_end": 61, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 11, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "fd55630045a02100df8877ac27d951ee08617d4598764394d48cb51fe067476a", - "symbol_name": "UvicornThreadRunner", - "qname": "UvicornThreadRunner", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 24, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "3779fdd2878b770e789a35bb2a89c9d79f13b61c26d7db1b3b683f9bb9e1623f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (10)", - "layer": "C4_SEMANTIC_ROLES", - "title": "HttpControlChannel", - "span_start": 12, - "span_end": 57, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 21, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "1c9fbdc24819e5604c26ea55428a74310f03a03e1af197ed84846af61e42fdb0", - "symbol_name": "HttpControlChannel", - "qname": "HttpControlChannel", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 10, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "HttpControlAppFactory\nrole: factory\n\nResponsibilities:\n- name suffix suggests factory", - "layer": "C4_SEMANTIC_ROLES", - "title": "HttpControlAppFactory", - "span_start": 15, - "span_end": 53, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 39, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "9b3502a5fb408b273223db13264349cf500de24915b6c649d9ea8970d0dfd8e0", - "symbol_name": "HttpControlAppFactory", - "qname": "HttpControlAppFactory", - "role": "factory", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/persistence/workflow_persistence.py", - "content": "WorkflowPersistence\nrole: pipeline_stage\n\nResponsibilities:\n- orchestrates role-like calls (2)\n- reads and writes state attributes\n- participates in dataflow slices (16)", - "layer": "C4_SEMANTIC_ROLES", - "title": "WorkflowPersistence", - "span_start": 8, - "span_end": 54, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 15, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "7bd01ee45cf31f2d5c2e3e51656254860ac785d10cef9e0852cd4fba90857bae", - "symbol_name": "WorkflowPersistence", - "qname": "WorkflowPersistence", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 16, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "80e9410ddc639789b4353c2a1a757ba8d0d5b5bb6075b0b263b61551f04ae1f0", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.stop", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 25, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d", - "dst_ref": "ControlPlaneService.stop", - "resolution": "resolved", - "slice_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.stop" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._stop_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 51, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a", - "dst_ref": "ControlPlaneService._stop_async", - "resolution": "resolved", - "slice_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._stop_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.register_channel", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 17, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957", - "dst_ref": "ControlPlaneService.register_channel", - "resolution": "resolved", - "slice_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.register_channel" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.start", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 20, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154", - "dst_ref": "ControlPlaneService.start", - "resolution": "resolved", - "slice_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.start" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._start_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 47, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517", - "dst_ref": "ControlPlaneService._start_async", - "resolution": "resolved", - "slice_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._start_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager.add_config_file", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 32, - "span_end": 52, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "a23b8a11ebdb12708b60c96ea12a69f7f042082f1adfddd572444e246d81d167", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "57ffbd4f0d9fdf3507c2b8624312ce211f3d02fdf86a57a8ec90778d8a7b498d", - "dst_ref": "RuntimeManager.add_config_file", - "resolution": "resolved", - "slice_id": "a23b8a11ebdb12708b60c96ea12a69f7f042082f1adfddd572444e246d81d167", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager.add_config_file" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "57ffbd4f0d9fdf3507c2b8624312ce211f3d02fdf86a57a8ec90778d8a7b498d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "validation": { - "passed": false, - "action": "repair", - "reasons": [ - "missing_concrete_methods", - "missing_concrete_calls", - "too_vague_for_explain" - ] - }, - "steps": [ - { - "step": "router", - "status": "completed", - "timings_ms": { - "router": 1 - }, - "output": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - } - }, - { - "step": "retrieval", - "status": "completed", - "timings_ms": { - "retrieval": 176 - }, - "output": { - "rag_count": 33, - "answer_path_rag_count": 33, - "resolved_symbol_status": "resolved", - "resolved_symbol": "RuntimeManager", - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "diagnostics": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "vector", - "C0_SOURCE_CHUNKS": "vector", - "C4_SEMANTIC_ROLES": "vector", - "C2_DEPENDENCY_GRAPH": "vector", - "C3_ENTRYPOINTS": "vector" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 8, - "C4_SEMANTIC_ROLES": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C3_ENTRYPOINTS": 6 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [] - }, - "C4_SEMANTIC_ROLES": { - "path_scope": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [] - } - }, - "fallback": { - "used": false, - "reason": null - }, - "retrieval_by_layer_ms": { - "C1_SYMBOL_CATALOG": 64, - "C0_SOURCE_CHUNKS": 20, - "C4_SEMANTIC_ROLES": 18, - "C2_DEPENDENCY_GRAPH": 57, - "C3_ENTRYPOINTS": 14 - } - } - }, - { - "step": "pre_evidence_gate", - "status": "passed", - "timings_ms": { - "pre_evidence_gate": 1 - }, - "input": { - "resolved_target": "RuntimeManager", - "sub_intent": "EXPLAIN", - "target_type": "symbol", - "evidence_count": 33, - "code_chunk_count": 33, - "entrypoint_count": 3, - "relation_count": 6, - "test_evidence_count": 0, - "symbol_resolution_status": "resolved", - "path_scope": [] - }, - "output": { - "passed": true, - "failure_reasons": [], - "degraded_message": "", - "evidence_count": 33 - } - }, - { - "step": "llm", - "status": "completed", - "timings_ms": { - "llm": 3521 - }, - "output": { - "prompt_name": "code_qa_explain_answer", - "answer_preview": "Класс `RuntimeManager` определён в файле `src/app_runtime/core/runtime.py`. Он играет роль стадии конвейера (pipeline stage), согласно семантическим подсказкам.\n\nОднако в предоставленном контексте отсутствуют конкретные методы, поля или вызовы этого класса. Если необходимы подробности работы `Runtim", - "resolved_target": "RuntimeManager", - "answer_policy_branch": "normal_answer", - "decision_reason": "evidence_sufficient" - } - }, - { - "step": "post_evidence_gate", - "status": "failed", - "timings_ms": { - "post_evidence_gate": 2, - "post_evidence_gate_recheck": 2, - "repair": 2383 - }, - "input": { - "answer_mode": "normal", - "degraded_message": "", - "resolved_target": "RuntimeManager", - "draft_answer_preview": "Класс `RuntimeManager` определён в файле `src/app_runtime/core/runtime.py`. Он играет роль стадии конвейера (pipeline stage), согласно семантическим подсказкам.\n\nОднако в предоставленном контексте отсутствуют конкретные методы, поля или вызовы этого класса. Если необходимы подробности работы `Runtim", - "repair_candidate": true - }, - "output": { - "passed": false, - "action": "repair", - "reasons": [ - "missing_concrete_methods", - "missing_concrete_calls", - "too_vague_for_explain" - ], - "repair_used": true, - "final_answer_preview": "Недостаточно подтверждённых данных для уверенного ответа по RuntimeManager." - } - } - ] - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/plba_full_chain_subintents_v3/20260312_192715/full_chain_plba_code_subintents_v2_plba-v2-explain-runtime-manager.md b/tests/pipeline_setup_v3/test_results/plba_full_chain_subintents_v3/20260312_192715/full_chain_plba_code_subintents_v2_plba-v2-explain-runtime-manager.md deleted file mode 100644 index 11eea7b..0000000 --- a/tests/pipeline_setup_v3/test_results/plba_full_chain_subintents_v3/20260312_192715/full_chain_plba_code_subintents_v2_plba-v2-explain-runtime-manager.md +++ /dev/null @@ -1,315 +0,0 @@ -# plba-v2-explain-runtime-manager - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_02_pipeline/full_chain_plba_code_subintents_v2.yaml -- runner: agent_runtime -- mode: full_chain -- passed: True - -## Query -Объясни как работает класс RuntimeManager - -## Actual -{ - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 33, - "llm_answer": "Недостаточно подтверждённых данных для уверенного ответа по RuntimeManager.", - "answer_mode": "degraded", - "path_scope": [], - "symbol_candidates": [ - "RuntimeManager" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] -} - -## Steps -[ - { - "step": "router", - "status": "completed", - "timings_ms": { - "router": 1 - }, - "output": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - } - }, - { - "step": "retrieval", - "status": "completed", - "timings_ms": { - "retrieval": 176 - }, - "output": { - "rag_count": 33, - "answer_path_rag_count": 33, - "resolved_symbol_status": "resolved", - "resolved_symbol": "RuntimeManager", - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "diagnostics": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "vector", - "C0_SOURCE_CHUNKS": "vector", - "C4_SEMANTIC_ROLES": "vector", - "C2_DEPENDENCY_GRAPH": "vector", - "C3_ENTRYPOINTS": "vector" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 8, - "C4_SEMANTIC_ROLES": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C3_ENTRYPOINTS": 6 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [] - }, - "C4_SEMANTIC_ROLES": { - "path_scope": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [] - } - }, - "fallback": { - "used": false, - "reason": null - }, - "retrieval_by_layer_ms": { - "C1_SYMBOL_CATALOG": 64, - "C0_SOURCE_CHUNKS": 20, - "C4_SEMANTIC_ROLES": 18, - "C2_DEPENDENCY_GRAPH": 57, - "C3_ENTRYPOINTS": 14 - } - } - }, - { - "step": "pre_evidence_gate", - "status": "passed", - "timings_ms": { - "pre_evidence_gate": 1 - }, - "input": { - "resolved_target": "RuntimeManager", - "sub_intent": "EXPLAIN", - "target_type": "symbol", - "evidence_count": 33, - "code_chunk_count": 33, - "entrypoint_count": 3, - "relation_count": 6, - "test_evidence_count": 0, - "symbol_resolution_status": "resolved", - "path_scope": [] - }, - "output": { - "passed": true, - "failure_reasons": [], - "degraded_message": "", - "evidence_count": 33 - } - }, - { - "step": "llm", - "status": "completed", - "timings_ms": { - "llm": 3521 - }, - "output": { - "prompt_name": "code_qa_explain_answer", - "answer_preview": "Класс `RuntimeManager` определён в файле `src/app_runtime/core/runtime.py`. Он играет роль стадии конвейера (pipeline stage), согласно семантическим подсказкам.\n\nОднако в предоставленном контексте отсутствуют конкретные методы, поля или вызовы этого класса. Если необходимы подробности работы `Runtim", - "resolved_target": "RuntimeManager", - "answer_policy_branch": "normal_answer", - "decision_reason": "evidence_sufficient" - } - }, - { - "step": "post_evidence_gate", - "status": "failed", - "timings_ms": { - "post_evidence_gate": 2, - "post_evidence_gate_recheck": 2, - "repair": 2383 - }, - "input": { - "answer_mode": "normal", - "degraded_message": "", - "resolved_target": "RuntimeManager", - "draft_answer_preview": "Класс `RuntimeManager` определён в файле `src/app_runtime/core/runtime.py`. Он играет роль стадии конвейера (pipeline stage), согласно семантическим подсказкам.\n\nОднако в предоставленном контексте отсутствуют конкретные методы, поля или вызовы этого класса. Если необходимы подробности работы `Runtim", - "repair_candidate": true - }, - "output": { - "passed": false, - "action": "repair", - "reasons": [ - "missing_concrete_methods", - "missing_concrete_calls", - "too_vague_for_explain" - ], - "repair_used": true, - "final_answer_preview": "Недостаточно подтверждённых данных для уверенного ответа по RuntimeManager." - } - } -] - -## Diagnostics -{ - "intent_correct": null, - "target_found": true, - "layers_used": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_sufficient": true, - "answer_mode": "degraded", - "resolved_target": "RuntimeManager", - "answer_policy_branch": "normal_answer", - "decision_reason": "evidence_sufficient", - "router_result": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "retrieval_profile": "code", - "sub_intent": "EXPLAIN", - "path_scope": [], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "symbol_resolution_status": "resolved" - }, - "retrieval_request": { - "rag_session_id": "7d11da21-faa0-4cea-aede-aeabe069164c", - "query": "Объясни как работает класс RuntimeManager", - "sub_intent": "EXPLAIN", - "path_scope": [], - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "per_layer_outcome": [ - { - "layer_id": "C1_SYMBOL_CATALOG", - "hit_count": 8, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C0_SOURCE_CHUNKS", - "hit_count": 8, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C4_SEMANTIC_ROLES", - "hit_count": 8, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C2_DEPENDENCY_GRAPH", - "hit_count": 6, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C3_ENTRYPOINTS", - "hit_count": 3, - "empty": false, - "fallback_used": false - } - ], - "empty_layers": [], - "evidence_gate_decision": { - "sufficient": true, - "failure_reasons": [], - "evidence_count": 33 - }, - "evidence_gate_input": { - "resolved_target": "RuntimeManager", - "sub_intent": "EXPLAIN", - "target_type": "symbol", - "evidence_count": 33, - "code_chunk_count": 33, - "entrypoint_count": 3, - "relation_count": 6, - "test_evidence_count": 0, - "symbol_resolution_status": "resolved", - "path_scope": [] - }, - "post_evidence_gate": { - "input": { - "answer_mode": "normal", - "degraded_message": "", - "resolved_target": "RuntimeManager", - "draft_answer_preview": "Класс `RuntimeManager` определён в файле `src/app_runtime/core/runtime.py`. Он играет роль стадии конвейера (pipeline stage), согласно семантическим подсказкам.\n\nОднако в предоставленном контексте отсутствуют конкретные методы, поля или вызовы этого класса. Если необходимы подробности работы `Runtim", - "repair_candidate": true - }, - "output": { - "passed": false, - "action": "repair", - "reasons": [ - "missing_concrete_methods", - "missing_concrete_calls", - "too_vague_for_explain" - ], - "repair_used": true, - "final_answer_preview": "Недостаточно подтверждённых данных для уверенного ответа по RuntimeManager." - } - }, - "failure_reasons": [], - "timings_ms": { - "router": 1, - "retrieval": 176, - "pre_evidence_gate": 1, - "llm": 3521, - "post_evidence_gate": 2, - "repair": 2383, - "post_evidence_gate_recheck": 2 - } -} - -## Mismatches -- none \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/plba_full_chain_subintents_v3/20260312_192715/full_chain_plba_code_subintents_v2_plba-v2-explain-trace-service.json b/tests/pipeline_setup_v3/test_results/plba_full_chain_subintents_v3/20260312_192715/full_chain_plba_code_subintents_v2_plba-v2-explain-trace-service.json deleted file mode 100644 index 9762165..0000000 --- a/tests/pipeline_setup_v3/test_results/plba_full_chain_subintents_v3/20260312_192715/full_chain_plba_code_subintents_v2_plba-v2-explain-trace-service.json +++ /dev/null @@ -1,4471 +0,0 @@ -{ - "case_id": "plba-v2-explain-trace-service", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_02_pipeline/full_chain_plba_code_subintents_v2.yaml", - "runner": "agent_runtime", - "mode": "full_chain", - "query": "Объясни как работает класс TraceService", - "actual": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 33, - "llm_answer": "Недостаточно подтверждённых данных для уверенного ответа по TraceService.", - "answer_mode": "degraded", - "path_scope": [], - "symbol_candidates": [ - "TraceService" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "passed": true, - "mismatches": [], - "details": { - "query": "Объясни как работает класс TraceService", - "router_result": { - "schema_version": "1.1", - "intent": "CODE_QA", - "retrieval_profile": "code", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query_plan": { - "raw": "Объясни как работает класс TraceService", - "normalized": "Объясни как работает класс TraceService", - "sub_intent": "EXPLAIN", - "negations": [], - "expansions": [ - "TraceService" - ], - "keyword_hints": [ - "TraceService" - ], - "path_hints": [], - "doc_scope_hints": [], - "symbol_candidates": [ - "TraceService" - ], - "symbol_kind_hint": "class", - "anchors": [ - { - "type": "SYMBOL", - "value": "TraceService", - "source": "user_text", - "subtype": null, - "span": { - "start": 27, - "end": 39 - }, - "confidence": 0.88 - }, - { - "type": "KEY_TERM", - "value": "класс", - "source": "user_text", - "subtype": null, - "span": { - "start": 21, - "end": 26 - }, - "confidence": 0.9 - } - ] - }, - "retrieval_spec": { - "domains": [ - "CODE" - ], - "layer_queries": [ - { - "layer_id": "C1_SYMBOL_CATALOG", - "top_k": 8 - }, - { - "layer_id": "C0_SOURCE_CHUNKS", - "top_k": 8 - }, - { - "layer_id": "C4_SEMANTIC_ROLES", - "top_k": 8 - }, - { - "layer_id": "C2_DEPENDENCY_GRAPH", - "top_k": 6 - }, - { - "layer_id": "C3_ENTRYPOINTS", - "top_k": 6 - } - ], - "filters": { - "test_policy": "EXCLUDE", - "path_scope": [], - "language": [ - "python" - ] - }, - "rerank_profile": "code" - }, - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - }, - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "TraceService", - "alternatives": [ - "TraceService", - "TraceService", - "TraceService", - "TraceService", - "TraceService" - ], - "confidence": 0.99 - }, - "evidence_policy": { - "require_def": true, - "require_flow": true, - "require_spec": false, - "allow_answer_without_evidence": false - } - }, - "retrieval_request": { - "rag_session_id": "7d11da21-faa0-4cea-aede-aeabe069164c", - "query": "Объясни как работает класс TraceService", - "sub_intent": "EXPLAIN", - "path_scope": [], - "keyword_hints": [ - "TraceService" - ], - "symbol_candidates": [ - "TraceService" - ], - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_spec": { - "domains": [ - "CODE" - ], - "layer_queries": [ - { - "layer_id": "C1_SYMBOL_CATALOG", - "top_k": 8 - }, - { - "layer_id": "C0_SOURCE_CHUNKS", - "top_k": 8 - }, - { - "layer_id": "C4_SEMANTIC_ROLES", - "top_k": 8 - }, - { - "layer_id": "C2_DEPENDENCY_GRAPH", - "top_k": 6 - }, - { - "layer_id": "C3_ENTRYPOINTS", - "top_k": 6 - } - ], - "filters": { - "test_policy": "EXCLUDE", - "path_scope": [], - "language": [ - "python" - ] - }, - "rerank_profile": "code" - }, - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - }, - "query_plan": { - "raw": "Объясни как работает класс TraceService", - "normalized": "Объясни как работает класс TraceService", - "sub_intent": "EXPLAIN", - "negations": [], - "expansions": [ - "TraceService" - ], - "keyword_hints": [ - "TraceService" - ], - "path_hints": [], - "doc_scope_hints": [], - "symbol_candidates": [ - "TraceService" - ], - "symbol_kind_hint": "class", - "anchors": [ - { - "type": "SYMBOL", - "value": "TraceService", - "source": "user_text", - "subtype": null, - "span": { - "start": 27, - "end": 39 - }, - "confidence": 0.88 - }, - { - "type": "KEY_TERM", - "value": "класс", - "source": "user_text", - "subtype": null, - "span": { - "start": 21, - "end": 26 - }, - "confidence": 0.9 - } - ] - } - }, - "retrieval_result": { - "target_symbol_candidates": [ - "TraceService", - "TraceService.open_context", - "TraceService.create_context", - "TraceService.current_trace_id" - ], - "resolved_symbol": "TraceService", - "symbol_resolution_status": "resolved", - "file_candidates": [ - "src/plba/__init__.py", - "src/app_runtime/core/runtime.py", - "src/app_runtime/tracing/__init__.py", - "src/app_runtime/tracing/service.py", - "src/plba/tracing.py", - "src/app_runtime/contracts/__init__.py", - "src/app_runtime/config/providers.py", - "src/app_runtime/control/http_runner.py", - "src/app_runtime/workflow/persistence/workflow_persistence.py", - "src/app_runtime/control/http_channel.py", - "src/app_runtime/queue/in_memory.py", - "src/app_runtime/config/file_loader.py", - "src/app_runtime/tracing/store.py", - "src/app_runtime/workers/supervisor.py", - "src/app_runtime/control/http_app.py" - ], - "code_chunks": [ - { - "layer": "C1_SYMBOL_CATALOG", - "path": "src/plba/__init__.py", - "title": "TraceService", - "content": "const TraceService\nTraceService = plba.tracing.TraceService", - "start_line": 20, - "end_line": 20, - "metadata": { - "symbol_id": "259ec03b77b9387ea53f69c77af32791dd29adf6de617ba72dd3f839197342a1", - "qname": "TraceService", - "kind": "const", - "signature": "TraceService = plba.tracing.TraceService", - "parent_symbol_id": null, - "package_or_module": "src.plba.__init__", - "is_test": false, - "blob_sha": "24e755ec8c249d14fb0e675b5dbf2b71ab91afb9c849897eebfa9feb2499e19d", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C1_SYMBOL_CATALOG", - "path": "src/app_runtime/core/runtime.py", - "title": "TraceService", - "content": "const TraceService\nTraceService = app_runtime.tracing.service.TraceService", - "start_line": 14, - "end_line": 14, - "metadata": { - "symbol_id": "3ccf6212fd7d9730f9df933e2ee7671b65bdae0520577e1a49c6432262842db6", - "qname": "TraceService", - "kind": "const", - "signature": "TraceService = app_runtime.tracing.service.TraceService", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.core.runtime", - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C1_SYMBOL_CATALOG", - "path": "src/app_runtime/tracing/__init__.py", - "title": "TraceService", - "content": "const TraceService\nTraceService = app_runtime.tracing.service.TraceService", - "start_line": 2, - "end_line": 2, - "metadata": { - "symbol_id": "ecd2fab7fa9744b2adca84d3d213f7aadcb7e1da84b9c2764a4ab39c65282b11", - "qname": "TraceService", - "kind": "const", - "signature": "TraceService = app_runtime.tracing.service.TraceService", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.tracing.__init__", - "is_test": false, - "blob_sha": "a01dea5f773515aeaae8e6d3431fcb93531a8b577dfa26c2e5db16cd6ae6e4d9", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C1_SYMBOL_CATALOG", - "path": "src/app_runtime/tracing/service.py", - "title": "TraceService", - "content": "class TraceService\nTraceService(TraceContextFactory)", - "start_line": 39, - "end_line": 166, - "metadata": { - "symbol_id": "c2b2b976d99f2c600000b753731b26e0a69adcb4359398b93073590c5d5d04f4", - "qname": "TraceService", - "kind": "class", - "signature": "TraceService(TraceContextFactory)", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.tracing.service", - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C1_SYMBOL_CATALOG", - "path": "src/plba/tracing.py", - "title": "TraceService", - "content": "const TraceService\nTraceService = app_runtime.tracing.service.TraceService", - "start_line": 1, - "end_line": 1, - "metadata": { - "symbol_id": "a4556fb3f83c50ea68b94a679786ce802cab7ffd9d7138aad3d6009b2661f425", - "qname": "TraceService", - "kind": "const", - "signature": "TraceService = app_runtime.tracing.service.TraceService", - "parent_symbol_id": null, - "package_or_module": "src.plba.tracing", - "is_test": false, - "blob_sha": "a27e11c716c93c3fcefe6f11b4cc420a6b743e7606606071d7f1aeeccc4e7d45", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C1_SYMBOL_CATALOG", - "path": "src/app_runtime/tracing/service.py", - "title": "TraceService.open_context", - "content": "method TraceService.open_context\nopen_context(self)", - "start_line": 66, - "end_line": 78, - "metadata": { - "symbol_id": "2da3d5b20a947bf63e14c103be4689b72fd837e0a82abd6c497846375d4c7426", - "qname": "TraceService.open_context", - "kind": "method", - "signature": "open_context(self)", - "parent_symbol_id": "TraceService", - "package_or_module": "src.app_runtime.tracing.service", - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C1_SYMBOL_CATALOG", - "path": "src/app_runtime/tracing/service.py", - "title": "TraceService.create_context", - "content": "method TraceService.create_context\ncreate_context(self)", - "start_line": 45, - "end_line": 63, - "metadata": { - "symbol_id": "ff44881104b65ef50ee6fe16d367d4a81b6e7eb5c44c0963cf4543faec785d4a", - "qname": "TraceService.create_context", - "kind": "method", - "signature": "create_context(self)", - "parent_symbol_id": "TraceService", - "package_or_module": "src.app_runtime.tracing.service", - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C1_SYMBOL_CATALOG", - "path": "src/app_runtime/tracing/service.py", - "title": "TraceService.current_trace_id", - "content": "method TraceService.current_trace_id\ncurrent_trace_id(self)", - "start_line": 80, - "end_line": 81, - "metadata": { - "symbol_id": "41135180f7b3b9ab20e097e0747474e219c37dd2366ef08a7b43c1f3edb10b4c", - "qname": "TraceService.current_trace_id", - "kind": "method", - "signature": "current_trace_id(self)", - "parent_symbol_id": "TraceService", - "package_or_module": "src.app_runtime.tracing.service", - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C0_SOURCE_CHUNKS", - "path": "src/app_runtime/tracing/service.py", - "title": "src/app_runtime/tracing/service.py:TraceService", - "content": "class TraceService(TraceContextFactory):\n def __init__(self, transport: TraceTransport | None = None, store: TraceContextStore | None = None) -> None:\n self.transport = transport or NoOpTraceTransport()\n self.store = store or TraceContextStore()\n self._writer = TraceRecordWriter(self.transport)\n\n def create_context(\n self,\n *,\n alias: str,\n parent_id: str | None = None,\n kind: str | None = None,\n attrs: dict[str, Any] | None = None,\n ) -> str:\n record = TraceContextRecord(\n trace_id=uuid4().hex,\n alias=str(alias or \"\"),\n parent_id=parent_id,\n type=kind,\n event_time=utc_now(),\n attrs=dict(attrs or {}),\n )\n self.store.push(record)\n self._writer.write_context(record)\n return record.trace_id\n\n @contextmanager\n def open_context(\n self,\n *,\n alias: str,\n parent_id: str | None = None,\n kind: str | None = None,\n attrs: dict[str, Any] | None = None,\n ) -> Iterator[str]:\n trace_id = self.create_context(alias=alias, parent_id=parent_id, kind=kind, attrs=attrs)\n try:\n yield trace_id\n finally:\n self.store.pop()\n\n def current_trace_id(self) -> str | None:\n return self.store.current_trace_id()\n\n def close_context(self) -> str | None:\n previous = self.store.pop()\n return previous.record.trace_id if previous else None\n\n def step(self, name: str) -> None:\n self.store.set_step(str(name or \"\"))\n\n def info(self, message: str, *, status: str | None = None, attrs: dict[str, Any] | None = None) -> None:\n self._write_message(\"INFO\", message, status, attrs)\n\n def debug(self, message: str, *, status: str | None = None, attrs: dict[str, Any] | None = None) -> None:\n self._write_message(\"DEBUG\", message, status, attrs)\n\n def warning(self, message: str, *, status: str | None = None, attrs: dict[str, Any] | None = None) -> None:\n self._write_message(\"WARNING\", message, status, attrs)\n\n def error(self, message: str, *, status: str | None = None, attrs: dict[str, Any] | None = None) -> None:\n self._write_message(\"ERROR\", message, status, attrs)\n\n def exception(self, message: str, *, status: str = \"failed\", attrs: dict[str, Any] | None = None) -> None:\n self._write_message(\"ERROR\", message, status, attrs)\n\n def new_root(self, operation: str) -> TraceContext:\n trace_id = self.create_context(alias=operation, kind=\"operation\", attrs={\"operation\": operation})\n return TraceContext(trace_id=trace_id, span_id=trace_id, attributes={\"operation\": operation})\n\n def child_of(self, parent: TraceContext, operation: str) -> TraceContext:\n trace_id = self.create_context(\n alias=operation,\n parent_id=parent.trace_id,\n kind=\"worker\",\n attrs={\"operation\": operation},\n )\n return TraceContext(\n trace_id=trace_id,\n span_id=trace_id,\n parent_span_id=parent.span_id,\n attributes={\"operation\": operation},\n )\n\n def attach(self, metadata: dict[str, object], context: TraceContext) -> dict[str, object]:\n updated = dict(metadata)\n updated[\"trace_id\"] = context.trace_id\n updated[\"span_id\"] = context.span_id\n updated[\"parent_span_id\"] = context.parent_span_id\n return updated\n\n def resume(self, metadata: dict[str, object], operation: str) -> TraceContext:\n trace_id = str(metadata.get(\"trace_id\") or uuid4().hex)\n span_id = str(metadata.get(\"span_id\") or trace_id)\n parent_id = metadata.get(\"parent_span_id\")\n self.create_context(\n alias=operation,\n parent_id=str(parent_id) if parent_id else None,\n kind=\"worker\",\n attrs=dict(metadata),\n )\n return TraceContext(\n trace_id=trace_id,\n span_id=span_id,\n parent_span_id=str(parent_id) if parent_id else None,\n attributes={\"operation\": operation},\n )\n\n def _write_message(\n self,\n level: TraceLevel,\n message: str,\n status: str | None,\n attrs: dict[str, Any] | None,\n ) -> None:\n active = self.store.current()\n if active is None:\n raise RuntimeError(\"Trace context is not bound. Call create_context() first.\")\n record = TraceLogMessage(\n trace_id=active.record.trace_id,\n step=active.step,\n status=str(status or \"\"),\n message=str(message or \"\"),\n level=level,\n event_time=utc_now(),\n attrs=dict(attrs or {}),\n )\n self._writer.write_message(record)", - "start_line": 39, - "end_line": 166, - "metadata": { - "chunk_index": 1, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.tracing.service", - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C0_SOURCE_CHUNKS", - "path": "src/app_runtime/tracing/service.py", - "title": "src/app_runtime/tracing/service.py:TraceManager", - "content": "class TraceManager(TraceService):\n \"\"\"Compatibility alias during the transition from ConfigManager-shaped naming.\"\"\"", - "start_line": 169, - "end_line": 170, - "metadata": { - "chunk_index": 2, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.tracing.service", - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C0_SOURCE_CHUNKS", - "path": "src/app_runtime/core/runtime.py", - "title": "src/app_runtime/core/runtime.py:RuntimeManager", - "content": "class RuntimeManager:\n ACTION_TIMEOUT_SECONDS = 10.0\n ACTION_POLL_INTERVAL_SECONDS = 0.05\n\n def __init__(\n self,\n configuration: ConfigurationManager | None = None,\n services: ServiceContainer | None = None,\n traces: TraceService | None = None,\n health: HealthRegistry | None = None,\n logs: LogManager | None = None,\n workers: WorkerSupervisor | None = None,\n control_plane: ControlPlaneService | None = None,\n ) -> None:\n self.configuration = configuration or ConfigurationManager()\n self.services = services or ServiceContainer()\n self.traces = traces or TraceService()\n self.health = health or HealthRegistry()\n self.logs = logs or LogManager()\n self.workers = workers or WorkerSupervisor()\n self.control_plane = control_plane or ControlPlaneService()\n self.registry = ModuleRegistry(self.services)\n self._started = False\n self._state = LifecycleState.IDLE\n self._core_registered = False\n self._workers_registered = False\n self._register_core_services()\n\n def register_module(self, module: ApplicationModule) -> None:\n self.registry.register_module(module.name)\n module.register(self.registry)\n\n def add_config_file(self, path: str) -> FileConfigProvider:\n provider = FileConfigProvider(path)\n self.configuration.add_provider(provider)\n return provider\n\n def start(self, *, start_control_plane: bool = True) -> None:\n if self._started:\n return\n self._state = LifecycleState.STARTING\n config = self.configuration.load()\n self.logs.apply_config(config)\n self._register_health_contributors()\n self._register_workers()\n self.workers.start()\n if start_control_plane:\n self.control_plane.start(self)\n self._started = True\n self._refresh_state()\n\n def stop(self, timeout: float = 30.0, force: bool = False, stop_control_plane: bool = True) -> None:\n if not self._started:\n return\n self._state = LifecycleState.STOPPING\n self.workers.stop(timeout=timeout, force=force)\n if stop_control_plane:\n self.control_plane.stop()\n self._started = False\n self._state = LifecycleState.STOPPED\n\n def status(self) -> dict[str, object]:\n self._refresh_state()\n return self.control_plane.snapshot(self)\n\n def current_health(self) -> HealthPayload:\n self._refresh_state()\n return self.health.payload(self._state, self.workers.healths())\n\n async def health_status(self) -> HealthPayload:\n return self.current_health()\n\n async def start_runtime(self) -> dict[str, object] | str:\n self._refresh_state()\n if self._started:\n return \"runtime already running\"\n if self._state == LifecycleState.STOPPING:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n\n self.start(start_control_plane=False)\n started = self._wait_for_state({LifecycleState.IDLE, LifecycleState.BUSY}, timeout=self.ACTION_TIMEOUT_SECONDS)\n if started:\n return self._action_detail(\"runtime started\", timed_out=False)\n return self._action_detail(\"runtime start is still in progress\", timed_out=True)\n\n async def stop_runtime(self) -> dict[str, object] | str:\n self._refresh_state()\n if not self._started:\n if self._state == LifecycleState.STOPPING:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n return \"runtime already stopped\"\n\n self._state = LifecycleState.STOPPING\n try:\n self.workers.stop(timeout=self.ACTION_TIMEOUT_SECONDS, force=False)\n except TimeoutError:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n\n self._started = False\n self._state = LifecycleState.STOPPED\n return self._action_detail(\"runtime stopped\", timed_out=False)\n\n async def runtime_status(self) -> str:\n self._refresh_state()\n return self._state.value\n\n def _register_core_services(self) -> None:\n if self._core_registered:\n return\n self.services.register(\"configuration\", self.configuration)\n self.services.register(\"traces\", self.traces)\n self.services.register(\"health\", self.health)\n self.services.register(\"logs\", self.logs)\n self.services.register(\"workers\", self.workers)\n self.services.register(\"control_plane\", self.control_plane)\n self._core_registered = True\n\n def _register_health_contributors(self) -> None:\n for contributor in self.registry.health_contributors:\n self.health.register(contributor)\n\n def _register_workers(self) -> None:\n if self._workers_registered:\n return\n for worker in self.registry.workers:\n self.workers.register(worker)\n self._workers_registered = True\n\n def _refresh_state(self) -> None:\n lifecycle = self.workers.lifecycle_state()\n\n if self._state == LifecycleState.STOPPING:\n if lifecycle == LifecycleState.STOPPED:\n self._started = False\n self._state = LifecycleState.STOPPED\n return\n\n if not self._started:\n if lifecycle == LifecycleState.STOPPED:\n self._state = LifecycleState.STOPPED\n return\n\n self._state = lifecycle\n\n def _wait_for_state(self, target_states: set[LifecycleState], *, timeout: float) -> bool:\n deadline = monotonic() + timeout\n while monotonic() < deadline:\n self._refresh_state()\n if self._state in target_states:\n return True\n sleep(self.ACTION_POLL_INTERVAL_SECONDS)\n self._refresh_state()\n return self._state in target_states\n\n def _action_detail(self, message: str, *, timed_out: bool) -> dict[str, object]:\n self._refresh_state()\n return {\n \"message\": message,\n \"state\": self._state.value,\n \"timed_out\": timed_out,\n \"workers\": self.workers.snapshot(),\n }", - "start_line": 18, - "end_line": 179, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.core.runtime", - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C0_SOURCE_CHUNKS", - "path": "src/app_runtime/tracing/__init__.py", - "title": "src/app_runtime/tracing/__init__.py:1-17", - "content": "from app_runtime.contracts.trace import TraceContext, TraceContextRecord, TraceLogMessage, TraceTransport\nfrom app_runtime.tracing.service import TraceManager, TraceService\nfrom app_runtime.tracing.store import ActiveTraceContext, TraceContextStore\nfrom app_runtime.tracing.transport import MySqlTraceTransport, NoOpTraceTransport\n\n__all__ = [\n \"ActiveTraceContext\",\n \"MySqlTraceTransport\",\n \"NoOpTraceTransport\",\n \"TraceContext\",\n \"TraceContextRecord\",\n \"TraceContextStore\",\n \"TraceLogMessage\",\n \"TraceManager\",\n \"TraceService\",\n \"TraceTransport\",\n]", - "start_line": 1, - "end_line": 17, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.app_runtime.tracing.__init__", - "is_test": false, - "blob_sha": "a01dea5f773515aeaae8e6d3431fcb93531a8b577dfa26c2e5db16cd6ae6e4d9", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C0_SOURCE_CHUNKS", - "path": "src/plba/__init__.py", - "title": "src/plba/__init__.py:1-69", - "content": "from plba.bootstrap import create_runtime\nfrom plba.config import ConfigFileLoader, FileConfigProvider\nfrom plba.control import ControlActionSet, ControlChannel, ControlPlaneService, HttpControlChannel\nfrom plba.contracts import (\n ApplicationModule,\n ConfigProvider,\n HealthContributor,\n TraceContext,\n TraceContextRecord,\n TraceLogMessage,\n TraceTransport,\n Worker,\n WorkerHealth,\n WorkerStatus,\n)\nfrom plba.core import ConfigurationManager, RuntimeManager, ServiceContainer\nfrom plba.health import HealthRegistry\nfrom plba.logging import LogManager\nfrom plba.queue import InMemoryTaskQueue\nfrom plba.tracing import MySqlTraceTransport, NoOpTraceTransport, TraceService\nfrom plba.workflow import (\n StepResult,\n WorkflowContext,\n WorkflowDefinition,\n WorkflowEngine,\n WorkflowEngineHooks,\n WorkflowNode,\n WorkflowRuntimeFactory,\n WorkflowStep,\n)\nfrom plba.workers import WorkerSupervisor\n\n__all__ = [\n \"ApplicationModule\",\n \"ConfigFileLoader\",\n \"ConfigProvider\",\n \"ConfigurationManager\",\n \"ControlActionSet\",\n \"ControlChannel\",\n \"ControlPlaneService\",\n \"create_runtime\",\n \"FileConfigProvider\",\n \"HealthContributor\",\n \"HealthRegistry\",\n \"HttpControlChannel\",\n \"InMemoryTaskQueue\",\n \"LogManager\",\n \"MySqlTraceTransport\",\n \"NoOpTraceTransport\",\n \"RuntimeManager\",\n \"ServiceContainer\",\n \"TraceContext\",\n \"TraceContextRecord\",\n \"TraceLogMessage\",\n \"TraceService\",\n \"TraceTransport\",\n \"StepResult\",\n \"Worker\",\n \"WorkerHealth\",\n \"WorkerStatus\",\n \"WorkflowContext\",\n \"WorkflowDefinition\",\n \"WorkflowEngine\",\n \"WorkflowEngineHooks\",\n \"WorkflowNode\",\n \"WorkflowRuntimeFactory\",\n \"WorkflowStep\",\n \"WorkerSupervisor\",\n]", - "start_line": 1, - "end_line": 69, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.plba.__init__", - "is_test": false, - "blob_sha": "24e755ec8c249d14fb0e675b5dbf2b71ab91afb9c849897eebfa9feb2499e19d", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C0_SOURCE_CHUNKS", - "path": "src/plba/tracing.py", - "title": "src/plba/tracing.py:1-4", - "content": "from app_runtime.tracing.service import TraceService\nfrom app_runtime.tracing.transport import MySqlTraceTransport, NoOpTraceTransport\n\n__all__ = [\"MySqlTraceTransport\", \"NoOpTraceTransport\", \"TraceService\"]", - "start_line": 1, - "end_line": 4, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.plba.tracing", - "is_test": false, - "blob_sha": "a27e11c716c93c3fcefe6f11b4cc420a6b743e7606606071d7f1aeeccc4e7d45", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C0_SOURCE_CHUNKS", - "path": "src/app_runtime/contracts/__init__.py", - "title": "src/app_runtime/__init__.py:1-1", - "content": "__all__: list[str] = []", - "start_line": 1, - "end_line": 1, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.app_runtime.__init__", - "is_test": false, - "blob_sha": "8eea9df4f6d7b38ca0e39ccc27b04700e3d08dbeec8046d613d22706d19985fa", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C0_SOURCE_CHUNKS", - "path": "src/app_runtime/config/providers.py", - "title": "src/app_runtime/config/providers.py:FileConfigProvider", - "content": "class FileConfigProvider(ConfigProvider):\n def __init__(self, path: str | Path) -> None:\n self._loader = ConfigFileLoader(path)\n\n @property\n def loader(self) -> ConfigFileLoader:\n return self._loader\n\n def load(self) -> dict[str, Any]:\n config = self._loader.load_sync()\n if not isinstance(config, dict):\n raise TypeError(\"Config root must be a mapping\")\n return dict(config)", - "start_line": 10, - "end_line": 22, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.config.providers", - "is_test": false, - "blob_sha": "8c53ca0122d6df6c5763bca15e99434bb4daebd5a618b8fc927e9ae90b022e64", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C4_SEMANTIC_ROLES", - "path": "src/app_runtime/tracing/service.py", - "title": "TraceService", - "content": "TraceService\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests service\n- reads and writes state attributes\n- participates in dataflow slices (13)", - "start_line": 39, - "end_line": 166, - "metadata": { - "symbol_id": "c2b2b976d99f2c600000b753731b26e0a69adcb4359398b93073590c5d5d04f4", - "symbol_name": "TraceService", - "qname": "TraceService", - "role": "pipeline_stage", - "confidence": 0.57, - "dataflow_participation": 13, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C4_SEMANTIC_ROLES", - "path": "src/app_runtime/control/http_runner.py", - "title": "UvicornThreadRunner", - "content": "UvicornThreadRunner\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (24)", - "start_line": 10, - "end_line": 61, - "metadata": { - "symbol_id": "fd55630045a02100df8877ac27d951ee08617d4598764394d48cb51fe067476a", - "symbol_name": "UvicornThreadRunner", - "qname": "UvicornThreadRunner", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 24, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "3779fdd2878b770e789a35bb2a89c9d79f13b61c26d7db1b3b683f9bb9e1623f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C4_SEMANTIC_ROLES", - "path": "src/app_runtime/workflow/persistence/workflow_persistence.py", - "title": "WorkflowPersistence", - "content": "WorkflowPersistence\nrole: pipeline_stage\n\nResponsibilities:\n- orchestrates role-like calls (2)\n- reads and writes state attributes\n- participates in dataflow slices (16)", - "start_line": 8, - "end_line": 54, - "metadata": { - "symbol_id": "7bd01ee45cf31f2d5c2e3e51656254860ac785d10cef9e0852cd4fba90857bae", - "symbol_name": "WorkflowPersistence", - "qname": "WorkflowPersistence", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 16, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "80e9410ddc639789b4353c2a1a757ba8d0d5b5bb6075b0b263b61551f04ae1f0", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C4_SEMANTIC_ROLES", - "path": "src/app_runtime/control/http_channel.py", - "title": "HttpControlChannel", - "content": "HttpControlChannel\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (10)", - "start_line": 12, - "end_line": 57, - "metadata": { - "symbol_id": "1c9fbdc24819e5604c26ea55428a74310f03a03e1af197ed84846af61e42fdb0", - "symbol_name": "HttpControlChannel", - "qname": "HttpControlChannel", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 10, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C4_SEMANTIC_ROLES", - "path": "src/app_runtime/queue/in_memory.py", - "title": "InMemoryTaskQueue", - "content": "InMemoryTaskQueue\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (9)", - "start_line": 9, - "end_line": 38, - "metadata": { - "symbol_id": "2da04cb94544a3bcbf0943a95ad4bdd8710bcafaa32a02fd0e4de2178dcf3533", - "symbol_name": "InMemoryTaskQueue", - "qname": "InMemoryTaskQueue", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 9, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "58f0cc001ccda0eee4c6bc32ed83bd05eafd6b6644f1e8b4aa9eed3103db73dc", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C4_SEMANTIC_ROLES", - "path": "src/app_runtime/config/file_loader.py", - "title": "ConfigFileLoader", - "content": "ConfigFileLoader\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (8)", - "start_line": 11, - "end_line": 48, - "metadata": { - "symbol_id": "a8474eca8b6e9dc86ae67ed68b16fa5fb639ef08739c053e7b7195489765667f", - "symbol_name": "ConfigFileLoader", - "qname": "ConfigFileLoader", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 8, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "1f19ffebde5e38e4be5a5d5a678059a0f36dedb8fb8b3e00ab395c67106a87ea", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C4_SEMANTIC_ROLES", - "path": "src/app_runtime/tracing/store.py", - "title": "TraceContextStore", - "content": "TraceContextStore\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (6)", - "start_line": 15, - "end_line": 52, - "metadata": { - "symbol_id": "b2dad4fbe16ffb11b58deba311c7739955c39d59f291b22181f33e9c8cce4059", - "symbol_name": "TraceContextStore", - "qname": "TraceContextStore", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 6, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "d369554f08fc92039c6edd5a2a1e73b23901533e8974459170bbd9347d263dc5", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C4_SEMANTIC_ROLES", - "path": "src/app_runtime/workers/supervisor.py", - "title": "WorkerSupervisor", - "content": "WorkerSupervisor\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (6)", - "start_line": 10, - "end_line": 59, - "metadata": { - "symbol_id": "c17b44e8d9e97d490989b21fa67d7c346cdda8a0472e4c41fb243c8846faa124", - "symbol_name": "WorkerSupervisor", - "qname": "WorkerSupervisor", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 6, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "77609d9d5927171cce7fc3a54897c183fd63068710c6362029b700937aae5eee", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "path": "src/app_runtime/tracing/service.py", - "title": "TraceService.__init__:dataflow_slice", - "content": "TraceService.__init__\n -> TraceService.store\n -> TraceService.create_context", - "start_line": 42, - "end_line": 61, - "metadata": { - "edge_id": "3b052062067a78aef3302ee1d996897e02a67d1b340397bea4f59fe147c0492a", - "edge_type": "dataflow_slice", - "src_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "src_qname": "TraceService.__init__", - "dst_symbol_id": "ff44881104b65ef50ee6fe16d367d4a81b6e7eb5c44c0963cf4543faec785d4a", - "dst_ref": "TraceService.create_context", - "resolution": "resolved", - "slice_id": "3b052062067a78aef3302ee1d996897e02a67d1b340397bea4f59fe147c0492a", - "root_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "path_symbols": [ - "TraceService.__init__", - "TraceService.store", - "TraceService.create_context" - ], - "path_symbol_ids": [ - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "ff44881104b65ef50ee6fe16d367d4a81b6e7eb5c44c0963cf4543faec785d4a" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "path": "src/app_runtime/tracing/service.py", - "title": "TraceService.__init__:dataflow_slice", - "content": "TraceService.__init__\n -> TraceService.store\n -> TraceService.close_context", - "start_line": 42, - "end_line": 84, - "metadata": { - "edge_id": "7a9353ef57c9ae5d19b3a0c6ac50fad05e6d21d31bbe1cd1cd07af6332ba6505", - "edge_type": "dataflow_slice", - "src_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "src_qname": "TraceService.__init__", - "dst_symbol_id": "01e14158dcced7e52d0c8ac84ac7b9a75225c261b6aca6a1d7da802d0994721c", - "dst_ref": "TraceService.close_context", - "resolution": "resolved", - "slice_id": "7a9353ef57c9ae5d19b3a0c6ac50fad05e6d21d31bbe1cd1cd07af6332ba6505", - "root_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "path_symbols": [ - "TraceService.__init__", - "TraceService.store", - "TraceService.close_context" - ], - "path_symbol_ids": [ - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "01e14158dcced7e52d0c8ac84ac7b9a75225c261b6aca6a1d7da802d0994721c" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "path": "src/app_runtime/tracing/service.py", - "title": "TraceService.__init__:dataflow_slice", - "content": "TraceService.__init__\n -> TraceService.store\n -> TraceService.open_context", - "start_line": 42, - "end_line": 78, - "metadata": { - "edge_id": "a6e13b9ebc4fed84586afd53ed92a4d14757e440873f572b2337d5622ee96031", - "edge_type": "dataflow_slice", - "src_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "src_qname": "TraceService.__init__", - "dst_symbol_id": "2da3d5b20a947bf63e14c103be4689b72fd837e0a82abd6c497846375d4c7426", - "dst_ref": "TraceService.open_context", - "resolution": "resolved", - "slice_id": "a6e13b9ebc4fed84586afd53ed92a4d14757e440873f572b2337d5622ee96031", - "root_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "path_symbols": [ - "TraceService.__init__", - "TraceService.store", - "TraceService.open_context" - ], - "path_symbol_ids": [ - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "2da3d5b20a947bf63e14c103be4689b72fd837e0a82abd6c497846375d4c7426" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "path": "src/app_runtime/tracing/service.py", - "title": "TraceService.__init__:dataflow_slice", - "content": "TraceService.__init__\n -> TraceService.transport\n -> TraceService.__init__", - "start_line": 41, - "end_line": 43, - "metadata": { - "edge_id": "1e923a93faa05c3c43ca9b19bd047007a8589ccce57d3cc1798ae7f9f200af98", - "edge_type": "dataflow_slice", - "src_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "src_qname": "TraceService.__init__", - "dst_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "dst_ref": "TraceService.__init__", - "resolution": "resolved", - "slice_id": "1e923a93faa05c3c43ca9b19bd047007a8589ccce57d3cc1798ae7f9f200af98", - "root_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "path_symbols": [ - "TraceService.__init__", - "TraceService.transport", - "TraceService.__init__" - ], - "path_symbol_ids": [ - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "path": "src/app_runtime/tracing/service.py", - "title": "TraceService.__init__:dataflow_slice", - "content": "TraceService.__init__\n -> TraceService.store\n -> TraceService.current_trace_id", - "start_line": 42, - "end_line": 81, - "metadata": { - "edge_id": "3ea17138634b1190bded77ddb84aa1595124f6519b246f24fc4b02bd62b5cac1", - "edge_type": "dataflow_slice", - "src_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "src_qname": "TraceService.__init__", - "dst_symbol_id": "41135180f7b3b9ab20e097e0747474e219c37dd2366ef08a7b43c1f3edb10b4c", - "dst_ref": "TraceService.current_trace_id", - "resolution": "resolved", - "slice_id": "3ea17138634b1190bded77ddb84aa1595124f6519b246f24fc4b02bd62b5cac1", - "root_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "path_symbols": [ - "TraceService.__init__", - "TraceService.store", - "TraceService.current_trace_id" - ], - "path_symbol_ids": [ - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "41135180f7b3b9ab20e097e0747474e219c37dd2366ef08a7b43c1f3edb10b4c" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "path": "src/app_runtime/tracing/service.py", - "title": "TraceService.__init__:dataflow_slice", - "content": "TraceService.__init__\n -> TraceService.store\n -> TraceService.step", - "start_line": 42, - "end_line": 88, - "metadata": { - "edge_id": "9f34c5da9b09fba99df6f6b1bde183a9aeb45111b8218a747c71590c2c9f60f2", - "edge_type": "dataflow_slice", - "src_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "src_qname": "TraceService.__init__", - "dst_symbol_id": "c44bfbc66cf747283f30088da3e011a10395031d41e77b74e523c24997f641ca", - "dst_ref": "TraceService.step", - "resolution": "resolved", - "slice_id": "9f34c5da9b09fba99df6f6b1bde183a9aeb45111b8218a747c71590c2c9f60f2", - "root_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "path_symbols": [ - "TraceService.__init__", - "TraceService.store", - "TraceService.step" - ], - "path_symbol_ids": [ - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "c44bfbc66cf747283f30088da3e011a10395031d41e77b74e523c24997f641ca" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C3_ENTRYPOINTS", - "path": "src/app_runtime/control/http_app.py", - "title": "app.post", - "content": "fastapi http app.post", - "start_line": 38, - "end_line": 42, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C3_ENTRYPOINTS", - "path": "src/app_runtime/control/http_app.py", - "title": "app.get", - "content": "fastapi http app.get", - "start_line": 31, - "end_line": 34, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C3_ENTRYPOINTS", - "path": "src/app_runtime/control/http_app.py", - "title": "app.get", - "content": "fastapi http app.get", - "start_line": 38, - "end_line": 42, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "relations": [ - { - "path": "src/app_runtime/tracing/service.py", - "start_line": 42, - "end_line": 61, - "edge_type": "dataflow_slice", - "source": "TraceService.__init__", - "target": "TraceService.create_context", - "metadata": { - "edge_id": "3b052062067a78aef3302ee1d996897e02a67d1b340397bea4f59fe147c0492a", - "edge_type": "dataflow_slice", - "src_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "src_qname": "TraceService.__init__", - "dst_symbol_id": "ff44881104b65ef50ee6fe16d367d4a81b6e7eb5c44c0963cf4543faec785d4a", - "dst_ref": "TraceService.create_context", - "resolution": "resolved", - "slice_id": "3b052062067a78aef3302ee1d996897e02a67d1b340397bea4f59fe147c0492a", - "root_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "path_symbols": [ - "TraceService.__init__", - "TraceService.store", - "TraceService.create_context" - ], - "path_symbol_ids": [ - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "ff44881104b65ef50ee6fe16d367d4a81b6e7eb5c44c0963cf4543faec785d4a" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - }, - "content": "TraceService.__init__\n -> TraceService.store\n -> TraceService.create_context" - }, - { - "path": "src/app_runtime/tracing/service.py", - "start_line": 42, - "end_line": 84, - "edge_type": "dataflow_slice", - "source": "TraceService.__init__", - "target": "TraceService.close_context", - "metadata": { - "edge_id": "7a9353ef57c9ae5d19b3a0c6ac50fad05e6d21d31bbe1cd1cd07af6332ba6505", - "edge_type": "dataflow_slice", - "src_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "src_qname": "TraceService.__init__", - "dst_symbol_id": "01e14158dcced7e52d0c8ac84ac7b9a75225c261b6aca6a1d7da802d0994721c", - "dst_ref": "TraceService.close_context", - "resolution": "resolved", - "slice_id": "7a9353ef57c9ae5d19b3a0c6ac50fad05e6d21d31bbe1cd1cd07af6332ba6505", - "root_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "path_symbols": [ - "TraceService.__init__", - "TraceService.store", - "TraceService.close_context" - ], - "path_symbol_ids": [ - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "01e14158dcced7e52d0c8ac84ac7b9a75225c261b6aca6a1d7da802d0994721c" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - }, - "content": "TraceService.__init__\n -> TraceService.store\n -> TraceService.close_context" - }, - { - "path": "src/app_runtime/tracing/service.py", - "start_line": 42, - "end_line": 78, - "edge_type": "dataflow_slice", - "source": "TraceService.__init__", - "target": "TraceService.open_context", - "metadata": { - "edge_id": "a6e13b9ebc4fed84586afd53ed92a4d14757e440873f572b2337d5622ee96031", - "edge_type": "dataflow_slice", - "src_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "src_qname": "TraceService.__init__", - "dst_symbol_id": "2da3d5b20a947bf63e14c103be4689b72fd837e0a82abd6c497846375d4c7426", - "dst_ref": "TraceService.open_context", - "resolution": "resolved", - "slice_id": "a6e13b9ebc4fed84586afd53ed92a4d14757e440873f572b2337d5622ee96031", - "root_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "path_symbols": [ - "TraceService.__init__", - "TraceService.store", - "TraceService.open_context" - ], - "path_symbol_ids": [ - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "2da3d5b20a947bf63e14c103be4689b72fd837e0a82abd6c497846375d4c7426" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - }, - "content": "TraceService.__init__\n -> TraceService.store\n -> TraceService.open_context" - }, - { - "path": "src/app_runtime/tracing/service.py", - "start_line": 41, - "end_line": 43, - "edge_type": "dataflow_slice", - "source": "TraceService.__init__", - "target": "TraceService.__init__", - "metadata": { - "edge_id": "1e923a93faa05c3c43ca9b19bd047007a8589ccce57d3cc1798ae7f9f200af98", - "edge_type": "dataflow_slice", - "src_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "src_qname": "TraceService.__init__", - "dst_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "dst_ref": "TraceService.__init__", - "resolution": "resolved", - "slice_id": "1e923a93faa05c3c43ca9b19bd047007a8589ccce57d3cc1798ae7f9f200af98", - "root_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "path_symbols": [ - "TraceService.__init__", - "TraceService.transport", - "TraceService.__init__" - ], - "path_symbol_ids": [ - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - }, - "content": "TraceService.__init__\n -> TraceService.transport\n -> TraceService.__init__" - }, - { - "path": "src/app_runtime/tracing/service.py", - "start_line": 42, - "end_line": 81, - "edge_type": "dataflow_slice", - "source": "TraceService.__init__", - "target": "TraceService.current_trace_id", - "metadata": { - "edge_id": "3ea17138634b1190bded77ddb84aa1595124f6519b246f24fc4b02bd62b5cac1", - "edge_type": "dataflow_slice", - "src_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "src_qname": "TraceService.__init__", - "dst_symbol_id": "41135180f7b3b9ab20e097e0747474e219c37dd2366ef08a7b43c1f3edb10b4c", - "dst_ref": "TraceService.current_trace_id", - "resolution": "resolved", - "slice_id": "3ea17138634b1190bded77ddb84aa1595124f6519b246f24fc4b02bd62b5cac1", - "root_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "path_symbols": [ - "TraceService.__init__", - "TraceService.store", - "TraceService.current_trace_id" - ], - "path_symbol_ids": [ - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "41135180f7b3b9ab20e097e0747474e219c37dd2366ef08a7b43c1f3edb10b4c" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - }, - "content": "TraceService.__init__\n -> TraceService.store\n -> TraceService.current_trace_id" - }, - { - "path": "src/app_runtime/tracing/service.py", - "start_line": 42, - "end_line": 88, - "edge_type": "dataflow_slice", - "source": "TraceService.__init__", - "target": "TraceService.step", - "metadata": { - "edge_id": "9f34c5da9b09fba99df6f6b1bde183a9aeb45111b8218a747c71590c2c9f60f2", - "edge_type": "dataflow_slice", - "src_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "src_qname": "TraceService.__init__", - "dst_symbol_id": "c44bfbc66cf747283f30088da3e011a10395031d41e77b74e523c24997f641ca", - "dst_ref": "TraceService.step", - "resolution": "resolved", - "slice_id": "9f34c5da9b09fba99df6f6b1bde183a9aeb45111b8218a747c71590c2c9f60f2", - "root_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "path_symbols": [ - "TraceService.__init__", - "TraceService.store", - "TraceService.step" - ], - "path_symbol_ids": [ - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "c44bfbc66cf747283f30088da3e011a10395031d41e77b74e523c24997f641ca" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - }, - "content": "TraceService.__init__\n -> TraceService.store\n -> TraceService.step" - } - ], - "semantic_hints": [ - { - "path": "src/app_runtime/tracing/service.py", - "title": "TraceService", - "symbol": "TraceService", - "role": "pipeline_stage", - "confidence": 0.57, - "content": "TraceService\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests service\n- reads and writes state attributes\n- participates in dataflow slices (13)" - }, - { - "path": "src/app_runtime/control/http_runner.py", - "title": "UvicornThreadRunner", - "symbol": "UvicornThreadRunner", - "role": "pipeline_stage", - "confidence": 0.99, - "content": "UvicornThreadRunner\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (24)" - }, - { - "path": "src/app_runtime/workflow/persistence/workflow_persistence.py", - "title": "WorkflowPersistence", - "symbol": "WorkflowPersistence", - "role": "pipeline_stage", - "confidence": 0.99, - "content": "WorkflowPersistence\nrole: pipeline_stage\n\nResponsibilities:\n- orchestrates role-like calls (2)\n- reads and writes state attributes\n- participates in dataflow slices (16)" - }, - { - "path": "src/app_runtime/control/http_channel.py", - "title": "HttpControlChannel", - "symbol": "HttpControlChannel", - "role": "pipeline_stage", - "confidence": 0.99, - "content": "HttpControlChannel\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (10)" - }, - { - "path": "src/app_runtime/queue/in_memory.py", - "title": "InMemoryTaskQueue", - "symbol": "InMemoryTaskQueue", - "role": "pipeline_stage", - "confidence": 0.99, - "content": "InMemoryTaskQueue\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (9)" - }, - { - "path": "src/app_runtime/config/file_loader.py", - "title": "ConfigFileLoader", - "symbol": "ConfigFileLoader", - "role": "pipeline_stage", - "confidence": 0.99, - "content": "ConfigFileLoader\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (8)" - }, - { - "path": "src/app_runtime/tracing/store.py", - "title": "TraceContextStore", - "symbol": "TraceContextStore", - "role": "pipeline_stage", - "confidence": 0.99, - "content": "TraceContextStore\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (6)" - }, - { - "path": "src/app_runtime/workers/supervisor.py", - "title": "WorkerSupervisor", - "symbol": "WorkerSupervisor", - "role": "pipeline_stage", - "confidence": 0.99, - "content": "WorkerSupervisor\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (6)" - } - ], - "entrypoints": [ - { - "path": "src/app_runtime/control/http_app.py", - "title": "app.get", - "start_line": 31, - "end_line": 34, - "http_method": "GET", - "route_path": "", - "handler_symbol": "", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "route_or_command": "app.get", - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "title": "app.get", - "start_line": 38, - "end_line": 42, - "http_method": "GET", - "route_path": "", - "handler_symbol": "", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "route_or_command": "app.get", - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "title": "app.post", - "start_line": 38, - "end_line": 42, - "http_method": "POST", - "route_path": "", - "handler_symbol": "", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "route_or_command": "app.post", - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "test_candidates": [], - "layer_outcomes": [ - { - "layer_id": "C1_SYMBOL_CATALOG", - "hit_count": 8, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C0_SOURCE_CHUNKS", - "hit_count": 8, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C4_SEMANTIC_ROLES", - "hit_count": 8, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C2_DEPENDENCY_GRAPH", - "hit_count": 6, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C3_ENTRYPOINTS", - "hit_count": 3, - "empty": false, - "fallback_used": false - } - ], - "missing_layers": [], - "raw_rows": [ - { - "path": "src/plba/__init__.py", - "content": "const TraceService\nTraceService = plba.tracing.TraceService", - "layer": "C1_SYMBOL_CATALOG", - "title": "TraceService", - "span_start": 20, - "span_end": 20, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": null, - "metadata": { - "symbol_id": "259ec03b77b9387ea53f69c77af32791dd29adf6de617ba72dd3f839197342a1", - "qname": "TraceService", - "kind": "const", - "signature": "TraceService = plba.tracing.TraceService", - "parent_symbol_id": null, - "package_or_module": "src.plba.__init__", - "is_test": false, - "blob_sha": "24e755ec8c249d14fb0e675b5dbf2b71ab91afb9c849897eebfa9feb2499e19d", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "const TraceService\nTraceService = app_runtime.tracing.service.TraceService", - "layer": "C1_SYMBOL_CATALOG", - "title": "TraceService", - "span_start": 14, - "span_end": 14, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": null, - "metadata": { - "symbol_id": "3ccf6212fd7d9730f9df933e2ee7671b65bdae0520577e1a49c6432262842db6", - "qname": "TraceService", - "kind": "const", - "signature": "TraceService = app_runtime.tracing.service.TraceService", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.core.runtime", - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/__init__.py", - "content": "const TraceService\nTraceService = app_runtime.tracing.service.TraceService", - "layer": "C1_SYMBOL_CATALOG", - "title": "TraceService", - "span_start": 2, - "span_end": 2, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": null, - "metadata": { - "symbol_id": "ecd2fab7fa9744b2adca84d3d213f7aadcb7e1da84b9c2764a4ab39c65282b11", - "qname": "TraceService", - "kind": "const", - "signature": "TraceService = app_runtime.tracing.service.TraceService", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.tracing.__init__", - "is_test": false, - "blob_sha": "a01dea5f773515aeaae8e6d3431fcb93531a8b577dfa26c2e5db16cd6ae6e4d9", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "class TraceService\nTraceService(TraceContextFactory)", - "layer": "C1_SYMBOL_CATALOG", - "title": "TraceService", - "span_start": 39, - "span_end": 166, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": null, - "metadata": { - "symbol_id": "c2b2b976d99f2c600000b753731b26e0a69adcb4359398b93073590c5d5d04f4", - "qname": "TraceService", - "kind": "class", - "signature": "TraceService(TraceContextFactory)", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.tracing.service", - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/tracing.py", - "content": "const TraceService\nTraceService = app_runtime.tracing.service.TraceService", - "layer": "C1_SYMBOL_CATALOG", - "title": "TraceService", - "span_start": 1, - "span_end": 1, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": null, - "metadata": { - "symbol_id": "a4556fb3f83c50ea68b94a679786ce802cab7ffd9d7138aad3d6009b2661f425", - "qname": "TraceService", - "kind": "const", - "signature": "TraceService = app_runtime.tracing.service.TraceService", - "parent_symbol_id": null, - "package_or_module": "src.plba.tracing", - "is_test": false, - "blob_sha": "a27e11c716c93c3fcefe6f11b4cc420a6b743e7606606071d7f1aeeccc4e7d45", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "method TraceService.open_context\nopen_context(self)", - "layer": "C1_SYMBOL_CATALOG", - "title": "TraceService.open_context", - "span_start": 66, - "span_end": 78, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": null, - "metadata": { - "symbol_id": "2da3d5b20a947bf63e14c103be4689b72fd837e0a82abd6c497846375d4c7426", - "qname": "TraceService.open_context", - "kind": "method", - "signature": "open_context(self)", - "parent_symbol_id": "TraceService", - "package_or_module": "src.app_runtime.tracing.service", - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "method TraceService.create_context\ncreate_context(self)", - "layer": "C1_SYMBOL_CATALOG", - "title": "TraceService.create_context", - "span_start": 45, - "span_end": 63, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": null, - "metadata": { - "symbol_id": "ff44881104b65ef50ee6fe16d367d4a81b6e7eb5c44c0963cf4543faec785d4a", - "qname": "TraceService.create_context", - "kind": "method", - "signature": "create_context(self)", - "parent_symbol_id": "TraceService", - "package_or_module": "src.app_runtime.tracing.service", - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "method TraceService.current_trace_id\ncurrent_trace_id(self)", - "layer": "C1_SYMBOL_CATALOG", - "title": "TraceService.current_trace_id", - "span_start": 80, - "span_end": 81, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": null, - "metadata": { - "symbol_id": "41135180f7b3b9ab20e097e0747474e219c37dd2366ef08a7b43c1f3edb10b4c", - "qname": "TraceService.current_trace_id", - "kind": "method", - "signature": "current_trace_id(self)", - "parent_symbol_id": "TraceService", - "package_or_module": "src.app_runtime.tracing.service", - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "class TraceService(TraceContextFactory):\n def __init__(self, transport: TraceTransport | None = None, store: TraceContextStore | None = None) -> None:\n self.transport = transport or NoOpTraceTransport()\n self.store = store or TraceContextStore()\n self._writer = TraceRecordWriter(self.transport)\n\n def create_context(\n self,\n *,\n alias: str,\n parent_id: str | None = None,\n kind: str | None = None,\n attrs: dict[str, Any] | None = None,\n ) -> str:\n record = TraceContextRecord(\n trace_id=uuid4().hex,\n alias=str(alias or \"\"),\n parent_id=parent_id,\n type=kind,\n event_time=utc_now(),\n attrs=dict(attrs or {}),\n )\n self.store.push(record)\n self._writer.write_context(record)\n return record.trace_id\n\n @contextmanager\n def open_context(\n self,\n *,\n alias: str,\n parent_id: str | None = None,\n kind: str | None = None,\n attrs: dict[str, Any] | None = None,\n ) -> Iterator[str]:\n trace_id = self.create_context(alias=alias, parent_id=parent_id, kind=kind, attrs=attrs)\n try:\n yield trace_id\n finally:\n self.store.pop()\n\n def current_trace_id(self) -> str | None:\n return self.store.current_trace_id()\n\n def close_context(self) -> str | None:\n previous = self.store.pop()\n return previous.record.trace_id if previous else None\n\n def step(self, name: str) -> None:\n self.store.set_step(str(name or \"\"))\n\n def info(self, message: str, *, status: str | None = None, attrs: dict[str, Any] | None = None) -> None:\n self._write_message(\"INFO\", message, status, attrs)\n\n def debug(self, message: str, *, status: str | None = None, attrs: dict[str, Any] | None = None) -> None:\n self._write_message(\"DEBUG\", message, status, attrs)\n\n def warning(self, message: str, *, status: str | None = None, attrs: dict[str, Any] | None = None) -> None:\n self._write_message(\"WARNING\", message, status, attrs)\n\n def error(self, message: str, *, status: str | None = None, attrs: dict[str, Any] | None = None) -> None:\n self._write_message(\"ERROR\", message, status, attrs)\n\n def exception(self, message: str, *, status: str = \"failed\", attrs: dict[str, Any] | None = None) -> None:\n self._write_message(\"ERROR\", message, status, attrs)\n\n def new_root(self, operation: str) -> TraceContext:\n trace_id = self.create_context(alias=operation, kind=\"operation\", attrs={\"operation\": operation})\n return TraceContext(trace_id=trace_id, span_id=trace_id, attributes={\"operation\": operation})\n\n def child_of(self, parent: TraceContext, operation: str) -> TraceContext:\n trace_id = self.create_context(\n alias=operation,\n parent_id=parent.trace_id,\n kind=\"worker\",\n attrs={\"operation\": operation},\n )\n return TraceContext(\n trace_id=trace_id,\n span_id=trace_id,\n parent_span_id=parent.span_id,\n attributes={\"operation\": operation},\n )\n\n def attach(self, metadata: dict[str, object], context: TraceContext) -> dict[str, object]:\n updated = dict(metadata)\n updated[\"trace_id\"] = context.trace_id\n updated[\"span_id\"] = context.span_id\n updated[\"parent_span_id\"] = context.parent_span_id\n return updated\n\n def resume(self, metadata: dict[str, object], operation: str) -> TraceContext:\n trace_id = str(metadata.get(\"trace_id\") or uuid4().hex)\n span_id = str(metadata.get(\"span_id\") or trace_id)\n parent_id = metadata.get(\"parent_span_id\")\n self.create_context(\n alias=operation,\n parent_id=str(parent_id) if parent_id else None,\n kind=\"worker\",\n attrs=dict(metadata),\n )\n return TraceContext(\n trace_id=trace_id,\n span_id=span_id,\n parent_span_id=str(parent_id) if parent_id else None,\n attributes={\"operation\": operation},\n )\n\n def _write_message(\n self,\n level: TraceLevel,\n message: str,\n status: str | None,\n attrs: dict[str, Any] | None,\n ) -> None:\n active = self.store.current()\n if active is None:\n raise RuntimeError(\"Trace context is not bound. Call create_context() first.\")\n record = TraceLogMessage(\n trace_id=active.record.trace_id,\n step=active.step,\n status=str(status or \"\"),\n message=str(message or \"\"),\n level=level,\n event_time=utc_now(),\n attrs=dict(attrs or {}),\n )\n self._writer.write_message(record)", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/tracing/service.py:TraceService", - "span_start": 39, - "span_end": 166, - "lexical_rank": 6, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": null, - "metadata": { - "chunk_index": 1, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.tracing.service", - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "class TraceManager(TraceService):\n \"\"\"Compatibility alias during the transition from ConfigManager-shaped naming.\"\"\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/tracing/service.py:TraceManager", - "span_start": 169, - "span_end": 170, - "lexical_rank": 6, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": null, - "metadata": { - "chunk_index": 2, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.tracing.service", - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "class RuntimeManager:\n ACTION_TIMEOUT_SECONDS = 10.0\n ACTION_POLL_INTERVAL_SECONDS = 0.05\n\n def __init__(\n self,\n configuration: ConfigurationManager | None = None,\n services: ServiceContainer | None = None,\n traces: TraceService | None = None,\n health: HealthRegistry | None = None,\n logs: LogManager | None = None,\n workers: WorkerSupervisor | None = None,\n control_plane: ControlPlaneService | None = None,\n ) -> None:\n self.configuration = configuration or ConfigurationManager()\n self.services = services or ServiceContainer()\n self.traces = traces or TraceService()\n self.health = health or HealthRegistry()\n self.logs = logs or LogManager()\n self.workers = workers or WorkerSupervisor()\n self.control_plane = control_plane or ControlPlaneService()\n self.registry = ModuleRegistry(self.services)\n self._started = False\n self._state = LifecycleState.IDLE\n self._core_registered = False\n self._workers_registered = False\n self._register_core_services()\n\n def register_module(self, module: ApplicationModule) -> None:\n self.registry.register_module(module.name)\n module.register(self.registry)\n\n def add_config_file(self, path: str) -> FileConfigProvider:\n provider = FileConfigProvider(path)\n self.configuration.add_provider(provider)\n return provider\n\n def start(self, *, start_control_plane: bool = True) -> None:\n if self._started:\n return\n self._state = LifecycleState.STARTING\n config = self.configuration.load()\n self.logs.apply_config(config)\n self._register_health_contributors()\n self._register_workers()\n self.workers.start()\n if start_control_plane:\n self.control_plane.start(self)\n self._started = True\n self._refresh_state()\n\n def stop(self, timeout: float = 30.0, force: bool = False, stop_control_plane: bool = True) -> None:\n if not self._started:\n return\n self._state = LifecycleState.STOPPING\n self.workers.stop(timeout=timeout, force=force)\n if stop_control_plane:\n self.control_plane.stop()\n self._started = False\n self._state = LifecycleState.STOPPED\n\n def status(self) -> dict[str, object]:\n self._refresh_state()\n return self.control_plane.snapshot(self)\n\n def current_health(self) -> HealthPayload:\n self._refresh_state()\n return self.health.payload(self._state, self.workers.healths())\n\n async def health_status(self) -> HealthPayload:\n return self.current_health()\n\n async def start_runtime(self) -> dict[str, object] | str:\n self._refresh_state()\n if self._started:\n return \"runtime already running\"\n if self._state == LifecycleState.STOPPING:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n\n self.start(start_control_plane=False)\n started = self._wait_for_state({LifecycleState.IDLE, LifecycleState.BUSY}, timeout=self.ACTION_TIMEOUT_SECONDS)\n if started:\n return self._action_detail(\"runtime started\", timed_out=False)\n return self._action_detail(\"runtime start is still in progress\", timed_out=True)\n\n async def stop_runtime(self) -> dict[str, object] | str:\n self._refresh_state()\n if not self._started:\n if self._state == LifecycleState.STOPPING:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n return \"runtime already stopped\"\n\n self._state = LifecycleState.STOPPING\n try:\n self.workers.stop(timeout=self.ACTION_TIMEOUT_SECONDS, force=False)\n except TimeoutError:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n\n self._started = False\n self._state = LifecycleState.STOPPED\n return self._action_detail(\"runtime stopped\", timed_out=False)\n\n async def runtime_status(self) -> str:\n self._refresh_state()\n return self._state.value\n\n def _register_core_services(self) -> None:\n if self._core_registered:\n return\n self.services.register(\"configuration\", self.configuration)\n self.services.register(\"traces\", self.traces)\n self.services.register(\"health\", self.health)\n self.services.register(\"logs\", self.logs)\n self.services.register(\"workers\", self.workers)\n self.services.register(\"control_plane\", self.control_plane)\n self._core_registered = True\n\n def _register_health_contributors(self) -> None:\n for contributor in self.registry.health_contributors:\n self.health.register(contributor)\n\n def _register_workers(self) -> None:\n if self._workers_registered:\n return\n for worker in self.registry.workers:\n self.workers.register(worker)\n self._workers_registered = True\n\n def _refresh_state(self) -> None:\n lifecycle = self.workers.lifecycle_state()\n\n if self._state == LifecycleState.STOPPING:\n if lifecycle == LifecycleState.STOPPED:\n self._started = False\n self._state = LifecycleState.STOPPED\n return\n\n if not self._started:\n if lifecycle == LifecycleState.STOPPED:\n self._state = LifecycleState.STOPPED\n return\n\n self._state = lifecycle\n\n def _wait_for_state(self, target_states: set[LifecycleState], *, timeout: float) -> bool:\n deadline = monotonic() + timeout\n while monotonic() < deadline:\n self._refresh_state()\n if self._state in target_states:\n return True\n sleep(self.ACTION_POLL_INTERVAL_SECONDS)\n self._refresh_state()\n return self._state in target_states\n\n def _action_detail(self, message: str, *, timed_out: bool) -> dict[str, object]:\n self._refresh_state()\n return {\n \"message\": message,\n \"state\": self._state.value,\n \"timed_out\": timed_out,\n \"workers\": self.workers.snapshot(),\n }", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/core/runtime.py:RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 6, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": null, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.core.runtime", - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/__init__.py", - "content": "from app_runtime.contracts.trace import TraceContext, TraceContextRecord, TraceLogMessage, TraceTransport\nfrom app_runtime.tracing.service import TraceManager, TraceService\nfrom app_runtime.tracing.store import ActiveTraceContext, TraceContextStore\nfrom app_runtime.tracing.transport import MySqlTraceTransport, NoOpTraceTransport\n\n__all__ = [\n \"ActiveTraceContext\",\n \"MySqlTraceTransport\",\n \"NoOpTraceTransport\",\n \"TraceContext\",\n \"TraceContextRecord\",\n \"TraceContextStore\",\n \"TraceLogMessage\",\n \"TraceManager\",\n \"TraceService\",\n \"TraceTransport\",\n]", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/tracing/__init__.py:1-17", - "span_start": 1, - "span_end": 17, - "lexical_rank": 6, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": null, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.app_runtime.tracing.__init__", - "is_test": false, - "blob_sha": "a01dea5f773515aeaae8e6d3431fcb93531a8b577dfa26c2e5db16cd6ae6e4d9", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/__init__.py", - "content": "from plba.bootstrap import create_runtime\nfrom plba.config import ConfigFileLoader, FileConfigProvider\nfrom plba.control import ControlActionSet, ControlChannel, ControlPlaneService, HttpControlChannel\nfrom plba.contracts import (\n ApplicationModule,\n ConfigProvider,\n HealthContributor,\n TraceContext,\n TraceContextRecord,\n TraceLogMessage,\n TraceTransport,\n Worker,\n WorkerHealth,\n WorkerStatus,\n)\nfrom plba.core import ConfigurationManager, RuntimeManager, ServiceContainer\nfrom plba.health import HealthRegistry\nfrom plba.logging import LogManager\nfrom plba.queue import InMemoryTaskQueue\nfrom plba.tracing import MySqlTraceTransport, NoOpTraceTransport, TraceService\nfrom plba.workflow import (\n StepResult,\n WorkflowContext,\n WorkflowDefinition,\n WorkflowEngine,\n WorkflowEngineHooks,\n WorkflowNode,\n WorkflowRuntimeFactory,\n WorkflowStep,\n)\nfrom plba.workers import WorkerSupervisor\n\n__all__ = [\n \"ApplicationModule\",\n \"ConfigFileLoader\",\n \"ConfigProvider\",\n \"ConfigurationManager\",\n \"ControlActionSet\",\n \"ControlChannel\",\n \"ControlPlaneService\",\n \"create_runtime\",\n \"FileConfigProvider\",\n \"HealthContributor\",\n \"HealthRegistry\",\n \"HttpControlChannel\",\n \"InMemoryTaskQueue\",\n \"LogManager\",\n \"MySqlTraceTransport\",\n \"NoOpTraceTransport\",\n \"RuntimeManager\",\n \"ServiceContainer\",\n \"TraceContext\",\n \"TraceContextRecord\",\n \"TraceLogMessage\",\n \"TraceService\",\n \"TraceTransport\",\n \"StepResult\",\n \"Worker\",\n \"WorkerHealth\",\n \"WorkerStatus\",\n \"WorkflowContext\",\n \"WorkflowDefinition\",\n \"WorkflowEngine\",\n \"WorkflowEngineHooks\",\n \"WorkflowNode\",\n \"WorkflowRuntimeFactory\",\n \"WorkflowStep\",\n \"WorkerSupervisor\",\n]", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/plba/__init__.py:1-69", - "span_start": 1, - "span_end": 69, - "lexical_rank": 6, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": null, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.plba.__init__", - "is_test": false, - "blob_sha": "24e755ec8c249d14fb0e675b5dbf2b71ab91afb9c849897eebfa9feb2499e19d", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/tracing.py", - "content": "from app_runtime.tracing.service import TraceService\nfrom app_runtime.tracing.transport import MySqlTraceTransport, NoOpTraceTransport\n\n__all__ = [\"MySqlTraceTransport\", \"NoOpTraceTransport\", \"TraceService\"]", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/plba/tracing.py:1-4", - "span_start": 1, - "span_end": 4, - "lexical_rank": 6, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": null, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.plba.tracing", - "is_test": false, - "blob_sha": "a27e11c716c93c3fcefe6f11b4cc420a6b743e7606606071d7f1aeeccc4e7d45", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/contracts/__init__.py", - "content": "__all__: list[str] = []", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/__init__.py:1-1", - "span_start": 1, - "span_end": 1, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": null, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.app_runtime.__init__", - "is_test": false, - "blob_sha": "8eea9df4f6d7b38ca0e39ccc27b04700e3d08dbeec8046d613d22706d19985fa", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/config/providers.py", - "content": "class FileConfigProvider(ConfigProvider):\n def __init__(self, path: str | Path) -> None:\n self._loader = ConfigFileLoader(path)\n\n @property\n def loader(self) -> ConfigFileLoader:\n return self._loader\n\n def load(self) -> dict[str, Any]:\n config = self._loader.load_sync()\n if not isinstance(config, dict):\n raise TypeError(\"Config root must be a mapping\")\n return dict(config)", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/config/providers.py:FileConfigProvider", - "span_start": 10, - "span_end": 22, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": null, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.config.providers", - "is_test": false, - "blob_sha": "8c53ca0122d6df6c5763bca15e99434bb4daebd5a618b8fc927e9ae90b022e64", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "TraceService\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests service\n- reads and writes state attributes\n- participates in dataflow slices (13)", - "layer": "C4_SEMANTIC_ROLES", - "title": "TraceService", - "span_start": 39, - "span_end": 166, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 60, - "layer_rank": 2, - "distance": null, - "metadata": { - "symbol_id": "c2b2b976d99f2c600000b753731b26e0a69adcb4359398b93073590c5d5d04f4", - "symbol_name": "TraceService", - "qname": "TraceService", - "role": "pipeline_stage", - "confidence": 0.57, - "dataflow_participation": 13, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_runner.py", - "content": "UvicornThreadRunner\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (24)", - "layer": "C4_SEMANTIC_ROLES", - "title": "UvicornThreadRunner", - "span_start": 10, - "span_end": 61, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 11, - "layer_rank": 2, - "distance": null, - "metadata": { - "symbol_id": "fd55630045a02100df8877ac27d951ee08617d4598764394d48cb51fe067476a", - "symbol_name": "UvicornThreadRunner", - "qname": "UvicornThreadRunner", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 24, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "3779fdd2878b770e789a35bb2a89c9d79f13b61c26d7db1b3b683f9bb9e1623f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/persistence/workflow_persistence.py", - "content": "WorkflowPersistence\nrole: pipeline_stage\n\nResponsibilities:\n- orchestrates role-like calls (2)\n- reads and writes state attributes\n- participates in dataflow slices (16)", - "layer": "C4_SEMANTIC_ROLES", - "title": "WorkflowPersistence", - "span_start": 8, - "span_end": 54, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 15, - "layer_rank": 2, - "distance": null, - "metadata": { - "symbol_id": "7bd01ee45cf31f2d5c2e3e51656254860ac785d10cef9e0852cd4fba90857bae", - "symbol_name": "WorkflowPersistence", - "qname": "WorkflowPersistence", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 16, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "80e9410ddc639789b4353c2a1a757ba8d0d5b5bb6075b0b263b61551f04ae1f0", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (10)", - "layer": "C4_SEMANTIC_ROLES", - "title": "HttpControlChannel", - "span_start": 12, - "span_end": 57, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 21, - "layer_rank": 2, - "distance": null, - "metadata": { - "symbol_id": "1c9fbdc24819e5604c26ea55428a74310f03a03e1af197ed84846af61e42fdb0", - "symbol_name": "HttpControlChannel", - "qname": "HttpControlChannel", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 10, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/queue/in_memory.py", - "content": "InMemoryTaskQueue\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (9)", - "layer": "C4_SEMANTIC_ROLES", - "title": "InMemoryTaskQueue", - "span_start": 9, - "span_end": 38, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 22, - "layer_rank": 2, - "distance": null, - "metadata": { - "symbol_id": "2da04cb94544a3bcbf0943a95ad4bdd8710bcafaa32a02fd0e4de2178dcf3533", - "symbol_name": "InMemoryTaskQueue", - "qname": "InMemoryTaskQueue", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 9, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "58f0cc001ccda0eee4c6bc32ed83bd05eafd6b6644f1e8b4aa9eed3103db73dc", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/config/file_loader.py", - "content": "ConfigFileLoader\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (8)", - "layer": "C4_SEMANTIC_ROLES", - "title": "ConfigFileLoader", - "span_start": 11, - "span_end": 48, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 23, - "layer_rank": 2, - "distance": null, - "metadata": { - "symbol_id": "a8474eca8b6e9dc86ae67ed68b16fa5fb639ef08739c053e7b7195489765667f", - "symbol_name": "ConfigFileLoader", - "qname": "ConfigFileLoader", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 8, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "1f19ffebde5e38e4be5a5d5a678059a0f36dedb8fb8b3e00ab395c67106a87ea", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/store.py", - "content": "TraceContextStore\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (6)", - "layer": "C4_SEMANTIC_ROLES", - "title": "TraceContextStore", - "span_start": 15, - "span_end": 52, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 25, - "layer_rank": 2, - "distance": null, - "metadata": { - "symbol_id": "b2dad4fbe16ffb11b58deba311c7739955c39d59f291b22181f33e9c8cce4059", - "symbol_name": "TraceContextStore", - "qname": "TraceContextStore", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 6, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "d369554f08fc92039c6edd5a2a1e73b23901533e8974459170bbd9347d263dc5", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workers/supervisor.py", - "content": "WorkerSupervisor\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (6)", - "layer": "C4_SEMANTIC_ROLES", - "title": "WorkerSupervisor", - "span_start": 10, - "span_end": 59, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 25, - "layer_rank": 2, - "distance": null, - "metadata": { - "symbol_id": "c17b44e8d9e97d490989b21fa67d7c346cdda8a0472e4c41fb243c8846faa124", - "symbol_name": "WorkerSupervisor", - "qname": "WorkerSupervisor", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 6, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "77609d9d5927171cce7fc3a54897c183fd63068710c6362029b700937aae5eee", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "TraceService.__init__\n -> TraceService.store\n -> TraceService.create_context", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "TraceService.__init__:dataflow_slice", - "span_start": 42, - "span_end": 61, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": null, - "metadata": { - "edge_id": "3b052062067a78aef3302ee1d996897e02a67d1b340397bea4f59fe147c0492a", - "edge_type": "dataflow_slice", - "src_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "src_qname": "TraceService.__init__", - "dst_symbol_id": "ff44881104b65ef50ee6fe16d367d4a81b6e7eb5c44c0963cf4543faec785d4a", - "dst_ref": "TraceService.create_context", - "resolution": "resolved", - "slice_id": "3b052062067a78aef3302ee1d996897e02a67d1b340397bea4f59fe147c0492a", - "root_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "path_symbols": [ - "TraceService.__init__", - "TraceService.store", - "TraceService.create_context" - ], - "path_symbol_ids": [ - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "ff44881104b65ef50ee6fe16d367d4a81b6e7eb5c44c0963cf4543faec785d4a" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "TraceService.__init__\n -> TraceService.store\n -> TraceService.close_context", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "TraceService.__init__:dataflow_slice", - "span_start": 42, - "span_end": 84, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": null, - "metadata": { - "edge_id": "7a9353ef57c9ae5d19b3a0c6ac50fad05e6d21d31bbe1cd1cd07af6332ba6505", - "edge_type": "dataflow_slice", - "src_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "src_qname": "TraceService.__init__", - "dst_symbol_id": "01e14158dcced7e52d0c8ac84ac7b9a75225c261b6aca6a1d7da802d0994721c", - "dst_ref": "TraceService.close_context", - "resolution": "resolved", - "slice_id": "7a9353ef57c9ae5d19b3a0c6ac50fad05e6d21d31bbe1cd1cd07af6332ba6505", - "root_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "path_symbols": [ - "TraceService.__init__", - "TraceService.store", - "TraceService.close_context" - ], - "path_symbol_ids": [ - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "01e14158dcced7e52d0c8ac84ac7b9a75225c261b6aca6a1d7da802d0994721c" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "TraceService.__init__\n -> TraceService.store\n -> TraceService.open_context", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "TraceService.__init__:dataflow_slice", - "span_start": 42, - "span_end": 78, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": null, - "metadata": { - "edge_id": "a6e13b9ebc4fed84586afd53ed92a4d14757e440873f572b2337d5622ee96031", - "edge_type": "dataflow_slice", - "src_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "src_qname": "TraceService.__init__", - "dst_symbol_id": "2da3d5b20a947bf63e14c103be4689b72fd837e0a82abd6c497846375d4c7426", - "dst_ref": "TraceService.open_context", - "resolution": "resolved", - "slice_id": "a6e13b9ebc4fed84586afd53ed92a4d14757e440873f572b2337d5622ee96031", - "root_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "path_symbols": [ - "TraceService.__init__", - "TraceService.store", - "TraceService.open_context" - ], - "path_symbol_ids": [ - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "2da3d5b20a947bf63e14c103be4689b72fd837e0a82abd6c497846375d4c7426" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "TraceService.__init__\n -> TraceService.transport\n -> TraceService.__init__", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "TraceService.__init__:dataflow_slice", - "span_start": 41, - "span_end": 43, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": null, - "metadata": { - "edge_id": "1e923a93faa05c3c43ca9b19bd047007a8589ccce57d3cc1798ae7f9f200af98", - "edge_type": "dataflow_slice", - "src_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "src_qname": "TraceService.__init__", - "dst_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "dst_ref": "TraceService.__init__", - "resolution": "resolved", - "slice_id": "1e923a93faa05c3c43ca9b19bd047007a8589ccce57d3cc1798ae7f9f200af98", - "root_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "path_symbols": [ - "TraceService.__init__", - "TraceService.transport", - "TraceService.__init__" - ], - "path_symbol_ids": [ - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "TraceService.__init__\n -> TraceService.store\n -> TraceService.current_trace_id", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "TraceService.__init__:dataflow_slice", - "span_start": 42, - "span_end": 81, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": null, - "metadata": { - "edge_id": "3ea17138634b1190bded77ddb84aa1595124f6519b246f24fc4b02bd62b5cac1", - "edge_type": "dataflow_slice", - "src_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "src_qname": "TraceService.__init__", - "dst_symbol_id": "41135180f7b3b9ab20e097e0747474e219c37dd2366ef08a7b43c1f3edb10b4c", - "dst_ref": "TraceService.current_trace_id", - "resolution": "resolved", - "slice_id": "3ea17138634b1190bded77ddb84aa1595124f6519b246f24fc4b02bd62b5cac1", - "root_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "path_symbols": [ - "TraceService.__init__", - "TraceService.store", - "TraceService.current_trace_id" - ], - "path_symbol_ids": [ - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "41135180f7b3b9ab20e097e0747474e219c37dd2366ef08a7b43c1f3edb10b4c" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "TraceService.__init__\n -> TraceService.store\n -> TraceService.step", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "TraceService.__init__:dataflow_slice", - "span_start": 42, - "span_end": 88, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": null, - "metadata": { - "edge_id": "9f34c5da9b09fba99df6f6b1bde183a9aeb45111b8218a747c71590c2c9f60f2", - "edge_type": "dataflow_slice", - "src_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "src_qname": "TraceService.__init__", - "dst_symbol_id": "c44bfbc66cf747283f30088da3e011a10395031d41e77b74e523c24997f641ca", - "dst_ref": "TraceService.step", - "resolution": "resolved", - "slice_id": "9f34c5da9b09fba99df6f6b1bde183a9aeb45111b8218a747c71590c2c9f60f2", - "root_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "path_symbols": [ - "TraceService.__init__", - "TraceService.store", - "TraceService.step" - ], - "path_symbol_ids": [ - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "c44bfbc66cf747283f30088da3e011a10395031d41e77b74e523c24997f641ca" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": null, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": null, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": null, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "retrieval_report": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "vector", - "C0_SOURCE_CHUNKS": "vector", - "C4_SEMANTIC_ROLES": "vector", - "C2_DEPENDENCY_GRAPH": "vector", - "C3_ENTRYPOINTS": "vector" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 8, - "C4_SEMANTIC_ROLES": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C3_ENTRYPOINTS": 6 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [] - }, - "C4_SEMANTIC_ROLES": { - "path_scope": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [] - } - }, - "fallback": { - "used": false, - "reason": null - }, - "retrieval_by_layer_ms": { - "C1_SYMBOL_CATALOG": 49, - "C0_SOURCE_CHUNKS": 22, - "C4_SEMANTIC_ROLES": 21, - "C2_DEPENDENCY_GRAPH": 49, - "C3_ENTRYPOINTS": 15 - } - } - }, - "diagnostics": { - "intent_correct": null, - "target_found": true, - "layers_used": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_sufficient": true, - "answer_mode": "degraded", - "resolved_target": "TraceService", - "answer_policy_branch": "normal_answer", - "decision_reason": "evidence_sufficient", - "router_result": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "retrieval_profile": "code", - "sub_intent": "EXPLAIN", - "path_scope": [], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "symbol_resolution_status": "resolved" - }, - "retrieval_request": { - "rag_session_id": "7d11da21-faa0-4cea-aede-aeabe069164c", - "query": "Объясни как работает класс TraceService", - "sub_intent": "EXPLAIN", - "path_scope": [], - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "per_layer_outcome": [ - { - "layer_id": "C1_SYMBOL_CATALOG", - "hit_count": 8, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C0_SOURCE_CHUNKS", - "hit_count": 8, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C4_SEMANTIC_ROLES", - "hit_count": 8, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C2_DEPENDENCY_GRAPH", - "hit_count": 6, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C3_ENTRYPOINTS", - "hit_count": 3, - "empty": false, - "fallback_used": false - } - ], - "empty_layers": [], - "evidence_gate_decision": { - "sufficient": true, - "failure_reasons": [], - "evidence_count": 33 - }, - "evidence_gate_input": { - "resolved_target": "TraceService", - "sub_intent": "EXPLAIN", - "target_type": "symbol", - "evidence_count": 33, - "code_chunk_count": 33, - "entrypoint_count": 3, - "relation_count": 6, - "test_evidence_count": 0, - "symbol_resolution_status": "resolved", - "path_scope": [] - }, - "post_evidence_gate": { - "input": { - "answer_mode": "normal", - "degraded_message": "", - "resolved_target": "TraceService", - "draft_answer_preview": "Класс `TraceService` находится в файле `src/app_runtime/tracing/service.py`. Он наследует от `TraceContextFactory` и используется для управления трассировкой приложений.\n\nОсновные компоненты:\n- **Конструктор**: принимает опциональные аргументы `transport` и `store`. Если они не указаны, используются", - "repair_candidate": true - }, - "output": { - "passed": false, - "action": "repair", - "reasons": [ - "missing_concrete_methods" - ], - "repair_used": true, - "final_answer_preview": "Недостаточно подтверждённых данных для уверенного ответа по TraceService." - } - }, - "failure_reasons": [], - "timings_ms": { - "router": 1, - "retrieval": 158, - "pre_evidence_gate": 1, - "llm": 4974, - "post_evidence_gate": 3, - "repair": 4719, - "post_evidence_gate_recheck": 2 - } - }, - "rag_rows": [ - { - "path": "src/plba/__init__.py", - "content": "const TraceService\nTraceService = plba.tracing.TraceService", - "layer": "C1_SYMBOL_CATALOG", - "title": "TraceService", - "span_start": 20, - "span_end": 20, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "259ec03b77b9387ea53f69c77af32791dd29adf6de617ba72dd3f839197342a1", - "qname": "TraceService", - "kind": "const", - "signature": "TraceService = plba.tracing.TraceService", - "parent_symbol_id": null, - "package_or_module": "src.plba.__init__", - "is_test": false, - "blob_sha": "24e755ec8c249d14fb0e675b5dbf2b71ab91afb9c849897eebfa9feb2499e19d", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "const TraceService\nTraceService = app_runtime.tracing.service.TraceService", - "layer": "C1_SYMBOL_CATALOG", - "title": "TraceService", - "span_start": 14, - "span_end": 14, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "3ccf6212fd7d9730f9df933e2ee7671b65bdae0520577e1a49c6432262842db6", - "qname": "TraceService", - "kind": "const", - "signature": "TraceService = app_runtime.tracing.service.TraceService", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.core.runtime", - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/__init__.py", - "content": "const TraceService\nTraceService = app_runtime.tracing.service.TraceService", - "layer": "C1_SYMBOL_CATALOG", - "title": "TraceService", - "span_start": 2, - "span_end": 2, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "ecd2fab7fa9744b2adca84d3d213f7aadcb7e1da84b9c2764a4ab39c65282b11", - "qname": "TraceService", - "kind": "const", - "signature": "TraceService = app_runtime.tracing.service.TraceService", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.tracing.__init__", - "is_test": false, - "blob_sha": "a01dea5f773515aeaae8e6d3431fcb93531a8b577dfa26c2e5db16cd6ae6e4d9", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "class TraceService\nTraceService(TraceContextFactory)", - "layer": "C1_SYMBOL_CATALOG", - "title": "TraceService", - "span_start": 39, - "span_end": 166, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "c2b2b976d99f2c600000b753731b26e0a69adcb4359398b93073590c5d5d04f4", - "qname": "TraceService", - "kind": "class", - "signature": "TraceService(TraceContextFactory)", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.tracing.service", - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/tracing.py", - "content": "const TraceService\nTraceService = app_runtime.tracing.service.TraceService", - "layer": "C1_SYMBOL_CATALOG", - "title": "TraceService", - "span_start": 1, - "span_end": 1, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "a4556fb3f83c50ea68b94a679786ce802cab7ffd9d7138aad3d6009b2661f425", - "qname": "TraceService", - "kind": "const", - "signature": "TraceService = app_runtime.tracing.service.TraceService", - "parent_symbol_id": null, - "package_or_module": "src.plba.tracing", - "is_test": false, - "blob_sha": "a27e11c716c93c3fcefe6f11b4cc420a6b743e7606606071d7f1aeeccc4e7d45", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "method TraceService.open_context\nopen_context(self)", - "layer": "C1_SYMBOL_CATALOG", - "title": "TraceService.open_context", - "span_start": 66, - "span_end": 78, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "2da3d5b20a947bf63e14c103be4689b72fd837e0a82abd6c497846375d4c7426", - "qname": "TraceService.open_context", - "kind": "method", - "signature": "open_context(self)", - "parent_symbol_id": "TraceService", - "package_or_module": "src.app_runtime.tracing.service", - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "method TraceService.create_context\ncreate_context(self)", - "layer": "C1_SYMBOL_CATALOG", - "title": "TraceService.create_context", - "span_start": 45, - "span_end": 63, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "ff44881104b65ef50ee6fe16d367d4a81b6e7eb5c44c0963cf4543faec785d4a", - "qname": "TraceService.create_context", - "kind": "method", - "signature": "create_context(self)", - "parent_symbol_id": "TraceService", - "package_or_module": "src.app_runtime.tracing.service", - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "method TraceService.current_trace_id\ncurrent_trace_id(self)", - "layer": "C1_SYMBOL_CATALOG", - "title": "TraceService.current_trace_id", - "span_start": 80, - "span_end": 81, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "41135180f7b3b9ab20e097e0747474e219c37dd2366ef08a7b43c1f3edb10b4c", - "qname": "TraceService.current_trace_id", - "kind": "method", - "signature": "current_trace_id(self)", - "parent_symbol_id": "TraceService", - "package_or_module": "src.app_runtime.tracing.service", - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "class TraceService(TraceContextFactory):\n def __init__(self, transport: TraceTransport | None = None, store: TraceContextStore | None = None) -> None:\n self.transport = transport or NoOpTraceTransport()\n self.store = store or TraceContextStore()\n self._writer = TraceRecordWriter(self.transport)\n\n def create_context(\n self,\n *,\n alias: str,\n parent_id: str | None = None,\n kind: str | None = None,\n attrs: dict[str, Any] | None = None,\n ) -> str:\n record = TraceContextRecord(\n trace_id=uuid4().hex,\n alias=str(alias or \"\"),\n parent_id=parent_id,\n type=kind,\n event_time=utc_now(),\n attrs=dict(attrs or {}),\n )\n self.store.push(record)\n self._writer.write_context(record)\n return record.trace_id\n\n @contextmanager\n def open_context(\n self,\n *,\n alias: str,\n parent_id: str | None = None,\n kind: str | None = None,\n attrs: dict[str, Any] | None = None,\n ) -> Iterator[str]:\n trace_id = self.create_context(alias=alias, parent_id=parent_id, kind=kind, attrs=attrs)\n try:\n yield trace_id\n finally:\n self.store.pop()\n\n def current_trace_id(self) -> str | None:\n return self.store.current_trace_id()\n\n def close_context(self) -> str | None:\n previous = self.store.pop()\n return previous.record.trace_id if previous else None\n\n def step(self, name: str) -> None:\n self.store.set_step(str(name or \"\"))\n\n def info(self, message: str, *, status: str | None = None, attrs: dict[str, Any] | None = None) -> None:\n self._write_message(\"INFO\", message, status, attrs)\n\n def debug(self, message: str, *, status: str | None = None, attrs: dict[str, Any] | None = None) -> None:\n self._write_message(\"DEBUG\", message, status, attrs)\n\n def warning(self, message: str, *, status: str | None = None, attrs: dict[str, Any] | None = None) -> None:\n self._write_message(\"WARNING\", message, status, attrs)\n\n def error(self, message: str, *, status: str | None = None, attrs: dict[str, Any] | None = None) -> None:\n self._write_message(\"ERROR\", message, status, attrs)\n\n def exception(self, message: str, *, status: str = \"failed\", attrs: dict[str, Any] | None = None) -> None:\n self._write_message(\"ERROR\", message, status, attrs)\n\n def new_root(self, operation: str) -> TraceContext:\n trace_id = self.create_context(alias=operation, kind=\"operation\", attrs={\"operation\": operation})\n return TraceContext(trace_id=trace_id, span_id=trace_id, attributes={\"operation\": operation})\n\n def child_of(self, parent: TraceContext, operation: str) -> TraceContext:\n trace_id = self.create_context(\n alias=operation,\n parent_id=parent.trace_id,\n kind=\"worker\",\n attrs={\"operation\": operation},\n )\n return TraceContext(\n trace_id=trace_id,\n span_id=trace_id,\n parent_span_id=parent.span_id,\n attributes={\"operation\": operation},\n )\n\n def attach(self, metadata: dict[str, object], context: TraceContext) -> dict[str, object]:\n updated = dict(metadata)\n updated[\"trace_id\"] = context.trace_id\n updated[\"span_id\"] = context.span_id\n updated[\"parent_span_id\"] = context.parent_span_id\n return updated\n\n def resume(self, metadata: dict[str, object], operation: str) -> TraceContext:\n trace_id = str(metadata.get(\"trace_id\") or uuid4().hex)\n span_id = str(metadata.get(\"span_id\") or trace_id)\n parent_id = metadata.get(\"parent_span_id\")\n self.create_context(\n alias=operation,\n parent_id=str(parent_id) if parent_id else None,\n kind=\"worker\",\n attrs=dict(metadata),\n )\n return TraceContext(\n trace_id=trace_id,\n span_id=span_id,\n parent_span_id=str(parent_id) if parent_id else None,\n attributes={\"operation\": operation},\n )\n\n def _write_message(\n self,\n level: TraceLevel,\n message: str,\n status: str | None,\n attrs: dict[str, Any] | None,\n ) -> None:\n active = self.store.current()\n if active is None:\n raise RuntimeError(\"Trace context is not bound. Call create_context() first.\")\n record = TraceLogMessage(\n trace_id=active.record.trace_id,\n step=active.step,\n status=str(status or \"\"),\n message=str(message or \"\"),\n level=level,\n event_time=utc_now(),\n attrs=dict(attrs or {}),\n )\n self._writer.write_message(record)", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/tracing/service.py:TraceService", - "span_start": 39, - "span_end": 166, - "lexical_rank": 6, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 1, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.tracing.service", - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "class TraceManager(TraceService):\n \"\"\"Compatibility alias during the transition from ConfigManager-shaped naming.\"\"\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/tracing/service.py:TraceManager", - "span_start": 169, - "span_end": 170, - "lexical_rank": 6, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 2, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.tracing.service", - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "class RuntimeManager:\n ACTION_TIMEOUT_SECONDS = 10.0\n ACTION_POLL_INTERVAL_SECONDS = 0.05\n\n def __init__(\n self,\n configuration: ConfigurationManager | None = None,\n services: ServiceContainer | None = None,\n traces: TraceService | None = None,\n health: HealthRegistry | None = None,\n logs: LogManager | None = None,\n workers: WorkerSupervisor | None = None,\n control_plane: ControlPlaneService | None = None,\n ) -> None:\n self.configuration = configuration or ConfigurationManager()\n self.services = services or ServiceContainer()\n self.traces = traces or TraceService()\n self.health = health or HealthRegistry()\n self.logs = logs or LogManager()\n self.workers = workers or WorkerSupervisor()\n self.control_plane = control_plane or ControlPlaneService()\n self.registry = ModuleRegistry(self.services)\n self._started = False\n self._state = LifecycleState.IDLE\n self._core_registered = False\n self._workers_registered = False\n self._register_core_services()\n\n def register_module(self, module: ApplicationModule) -> None:\n self.registry.register_module(module.name)\n module.register(self.registry)\n\n def add_config_file(self, path: str) -> FileConfigProvider:\n provider = FileConfigProvider(path)\n self.configuration.add_provider(provider)\n return provider\n\n def start(self, *, start_control_plane: bool = True) -> None:\n if self._started:\n return\n self._state = LifecycleState.STARTING\n config = self.configuration.load()\n self.logs.apply_config(config)\n self._register_health_contributors()\n self._register_workers()\n self.workers.start()\n if start_control_plane:\n self.control_plane.start(self)\n self._started = True\n self._refresh_state()\n\n def stop(self, timeout: float = 30.0, force: bool = False, stop_control_plane: bool = True) -> None:\n if not self._started:\n return\n self._state = LifecycleState.STOPPING\n self.workers.stop(timeout=timeout, force=force)\n if stop_control_plane:\n self.control_plane.stop()\n self._started = False\n self._state = LifecycleState.STOPPED\n\n def status(self) -> dict[str, object]:\n self._refresh_state()\n return self.control_plane.snapshot(self)\n\n def current_health(self) -> HealthPayload:\n self._refresh_state()\n return self.health.payload(self._state, self.workers.healths())\n\n async def health_status(self) -> HealthPayload:\n return self.current_health()\n\n async def start_runtime(self) -> dict[str, object] | str:\n self._refresh_state()\n if self._started:\n return \"runtime already running\"\n if self._state == LifecycleState.STOPPING:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n\n self.start(start_control_plane=False)\n started = self._wait_for_state({LifecycleState.IDLE, LifecycleState.BUSY}, timeout=self.ACTION_TIMEOUT_SECONDS)\n if started:\n return self._action_detail(\"runtime started\", timed_out=False)\n return self._action_detail(\"runtime start is still in progress\", timed_out=True)\n\n async def stop_runtime(self) -> dict[str, object] | str:\n self._refresh_state()\n if not self._started:\n if self._state == LifecycleState.STOPPING:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n return \"runtime already stopped\"\n\n self._state = LifecycleState.STOPPING\n try:\n self.workers.stop(timeout=self.ACTION_TIMEOUT_SECONDS, force=False)\n except TimeoutError:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n\n self._started = False\n self._state = LifecycleState.STOPPED\n return self._action_detail(\"runtime stopped\", timed_out=False)\n\n async def runtime_status(self) -> str:\n self._refresh_state()\n return self._state.value\n\n def _register_core_services(self) -> None:\n if self._core_registered:\n return\n self.services.register(\"configuration\", self.configuration)\n self.services.register(\"traces\", self.traces)\n self.services.register(\"health\", self.health)\n self.services.register(\"logs\", self.logs)\n self.services.register(\"workers\", self.workers)\n self.services.register(\"control_plane\", self.control_plane)\n self._core_registered = True\n\n def _register_health_contributors(self) -> None:\n for contributor in self.registry.health_contributors:\n self.health.register(contributor)\n\n def _register_workers(self) -> None:\n if self._workers_registered:\n return\n for worker in self.registry.workers:\n self.workers.register(worker)\n self._workers_registered = True\n\n def _refresh_state(self) -> None:\n lifecycle = self.workers.lifecycle_state()\n\n if self._state == LifecycleState.STOPPING:\n if lifecycle == LifecycleState.STOPPED:\n self._started = False\n self._state = LifecycleState.STOPPED\n return\n\n if not self._started:\n if lifecycle == LifecycleState.STOPPED:\n self._state = LifecycleState.STOPPED\n return\n\n self._state = lifecycle\n\n def _wait_for_state(self, target_states: set[LifecycleState], *, timeout: float) -> bool:\n deadline = monotonic() + timeout\n while monotonic() < deadline:\n self._refresh_state()\n if self._state in target_states:\n return True\n sleep(self.ACTION_POLL_INTERVAL_SECONDS)\n self._refresh_state()\n return self._state in target_states\n\n def _action_detail(self, message: str, *, timed_out: bool) -> dict[str, object]:\n self._refresh_state()\n return {\n \"message\": message,\n \"state\": self._state.value,\n \"timed_out\": timed_out,\n \"workers\": self.workers.snapshot(),\n }", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/core/runtime.py:RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 6, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.core.runtime", - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/__init__.py", - "content": "from app_runtime.contracts.trace import TraceContext, TraceContextRecord, TraceLogMessage, TraceTransport\nfrom app_runtime.tracing.service import TraceManager, TraceService\nfrom app_runtime.tracing.store import ActiveTraceContext, TraceContextStore\nfrom app_runtime.tracing.transport import MySqlTraceTransport, NoOpTraceTransport\n\n__all__ = [\n \"ActiveTraceContext\",\n \"MySqlTraceTransport\",\n \"NoOpTraceTransport\",\n \"TraceContext\",\n \"TraceContextRecord\",\n \"TraceContextStore\",\n \"TraceLogMessage\",\n \"TraceManager\",\n \"TraceService\",\n \"TraceTransport\",\n]", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/tracing/__init__.py:1-17", - "span_start": 1, - "span_end": 17, - "lexical_rank": 6, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.app_runtime.tracing.__init__", - "is_test": false, - "blob_sha": "a01dea5f773515aeaae8e6d3431fcb93531a8b577dfa26c2e5db16cd6ae6e4d9", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/__init__.py", - "content": "from plba.bootstrap import create_runtime\nfrom plba.config import ConfigFileLoader, FileConfigProvider\nfrom plba.control import ControlActionSet, ControlChannel, ControlPlaneService, HttpControlChannel\nfrom plba.contracts import (\n ApplicationModule,\n ConfigProvider,\n HealthContributor,\n TraceContext,\n TraceContextRecord,\n TraceLogMessage,\n TraceTransport,\n Worker,\n WorkerHealth,\n WorkerStatus,\n)\nfrom plba.core import ConfigurationManager, RuntimeManager, ServiceContainer\nfrom plba.health import HealthRegistry\nfrom plba.logging import LogManager\nfrom plba.queue import InMemoryTaskQueue\nfrom plba.tracing import MySqlTraceTransport, NoOpTraceTransport, TraceService\nfrom plba.workflow import (\n StepResult,\n WorkflowContext,\n WorkflowDefinition,\n WorkflowEngine,\n WorkflowEngineHooks,\n WorkflowNode,\n WorkflowRuntimeFactory,\n WorkflowStep,\n)\nfrom plba.workers import WorkerSupervisor\n\n__all__ = [\n \"ApplicationModule\",\n \"ConfigFileLoader\",\n \"ConfigProvider\",\n \"ConfigurationManager\",\n \"ControlActionSet\",\n \"ControlChannel\",\n \"ControlPlaneService\",\n \"create_runtime\",\n \"FileConfigProvider\",\n \"HealthContributor\",\n \"HealthRegistry\",\n \"HttpControlChannel\",\n \"InMemoryTaskQueue\",\n \"LogManager\",\n \"MySqlTraceTransport\",\n \"NoOpTraceTransport\",\n \"RuntimeManager\",\n \"ServiceContainer\",\n \"TraceContext\",\n \"TraceContextRecord\",\n \"TraceLogMessage\",\n \"TraceService\",\n \"TraceTransport\",\n \"StepResult\",\n \"Worker\",\n \"WorkerHealth\",\n \"WorkerStatus\",\n \"WorkflowContext\",\n \"WorkflowDefinition\",\n \"WorkflowEngine\",\n \"WorkflowEngineHooks\",\n \"WorkflowNode\",\n \"WorkflowRuntimeFactory\",\n \"WorkflowStep\",\n \"WorkerSupervisor\",\n]", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/plba/__init__.py:1-69", - "span_start": 1, - "span_end": 69, - "lexical_rank": 6, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.plba.__init__", - "is_test": false, - "blob_sha": "24e755ec8c249d14fb0e675b5dbf2b71ab91afb9c849897eebfa9feb2499e19d", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/tracing.py", - "content": "from app_runtime.tracing.service import TraceService\nfrom app_runtime.tracing.transport import MySqlTraceTransport, NoOpTraceTransport\n\n__all__ = [\"MySqlTraceTransport\", \"NoOpTraceTransport\", \"TraceService\"]", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/plba/tracing.py:1-4", - "span_start": 1, - "span_end": 4, - "lexical_rank": 6, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.plba.tracing", - "is_test": false, - "blob_sha": "a27e11c716c93c3fcefe6f11b4cc420a6b743e7606606071d7f1aeeccc4e7d45", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/contracts/__init__.py", - "content": "__all__: list[str] = []", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/__init__.py:1-1", - "span_start": 1, - "span_end": 1, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.app_runtime.__init__", - "is_test": false, - "blob_sha": "8eea9df4f6d7b38ca0e39ccc27b04700e3d08dbeec8046d613d22706d19985fa", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/config/providers.py", - "content": "class FileConfigProvider(ConfigProvider):\n def __init__(self, path: str | Path) -> None:\n self._loader = ConfigFileLoader(path)\n\n @property\n def loader(self) -> ConfigFileLoader:\n return self._loader\n\n def load(self) -> dict[str, Any]:\n config = self._loader.load_sync()\n if not isinstance(config, dict):\n raise TypeError(\"Config root must be a mapping\")\n return dict(config)", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/config/providers.py:FileConfigProvider", - "span_start": 10, - "span_end": 22, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.config.providers", - "is_test": false, - "blob_sha": "8c53ca0122d6df6c5763bca15e99434bb4daebd5a618b8fc927e9ae90b022e64", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "TraceService\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests service\n- reads and writes state attributes\n- participates in dataflow slices (13)", - "layer": "C4_SEMANTIC_ROLES", - "title": "TraceService", - "span_start": 39, - "span_end": 166, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 60, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "c2b2b976d99f2c600000b753731b26e0a69adcb4359398b93073590c5d5d04f4", - "symbol_name": "TraceService", - "qname": "TraceService", - "role": "pipeline_stage", - "confidence": 0.57, - "dataflow_participation": 13, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_runner.py", - "content": "UvicornThreadRunner\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (24)", - "layer": "C4_SEMANTIC_ROLES", - "title": "UvicornThreadRunner", - "span_start": 10, - "span_end": 61, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 11, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "fd55630045a02100df8877ac27d951ee08617d4598764394d48cb51fe067476a", - "symbol_name": "UvicornThreadRunner", - "qname": "UvicornThreadRunner", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 24, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "3779fdd2878b770e789a35bb2a89c9d79f13b61c26d7db1b3b683f9bb9e1623f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/persistence/workflow_persistence.py", - "content": "WorkflowPersistence\nrole: pipeline_stage\n\nResponsibilities:\n- orchestrates role-like calls (2)\n- reads and writes state attributes\n- participates in dataflow slices (16)", - "layer": "C4_SEMANTIC_ROLES", - "title": "WorkflowPersistence", - "span_start": 8, - "span_end": 54, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 15, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "7bd01ee45cf31f2d5c2e3e51656254860ac785d10cef9e0852cd4fba90857bae", - "symbol_name": "WorkflowPersistence", - "qname": "WorkflowPersistence", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 16, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "80e9410ddc639789b4353c2a1a757ba8d0d5b5bb6075b0b263b61551f04ae1f0", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (10)", - "layer": "C4_SEMANTIC_ROLES", - "title": "HttpControlChannel", - "span_start": 12, - "span_end": 57, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 21, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "1c9fbdc24819e5604c26ea55428a74310f03a03e1af197ed84846af61e42fdb0", - "symbol_name": "HttpControlChannel", - "qname": "HttpControlChannel", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 10, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/queue/in_memory.py", - "content": "InMemoryTaskQueue\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (9)", - "layer": "C4_SEMANTIC_ROLES", - "title": "InMemoryTaskQueue", - "span_start": 9, - "span_end": 38, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 22, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "2da04cb94544a3bcbf0943a95ad4bdd8710bcafaa32a02fd0e4de2178dcf3533", - "symbol_name": "InMemoryTaskQueue", - "qname": "InMemoryTaskQueue", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 9, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "58f0cc001ccda0eee4c6bc32ed83bd05eafd6b6644f1e8b4aa9eed3103db73dc", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/config/file_loader.py", - "content": "ConfigFileLoader\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (8)", - "layer": "C4_SEMANTIC_ROLES", - "title": "ConfigFileLoader", - "span_start": 11, - "span_end": 48, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 23, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "a8474eca8b6e9dc86ae67ed68b16fa5fb639ef08739c053e7b7195489765667f", - "symbol_name": "ConfigFileLoader", - "qname": "ConfigFileLoader", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 8, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "1f19ffebde5e38e4be5a5d5a678059a0f36dedb8fb8b3e00ab395c67106a87ea", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/store.py", - "content": "TraceContextStore\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (6)", - "layer": "C4_SEMANTIC_ROLES", - "title": "TraceContextStore", - "span_start": 15, - "span_end": 52, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 25, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "b2dad4fbe16ffb11b58deba311c7739955c39d59f291b22181f33e9c8cce4059", - "symbol_name": "TraceContextStore", - "qname": "TraceContextStore", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 6, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "d369554f08fc92039c6edd5a2a1e73b23901533e8974459170bbd9347d263dc5", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workers/supervisor.py", - "content": "WorkerSupervisor\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (6)", - "layer": "C4_SEMANTIC_ROLES", - "title": "WorkerSupervisor", - "span_start": 10, - "span_end": 59, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 25, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "c17b44e8d9e97d490989b21fa67d7c346cdda8a0472e4c41fb243c8846faa124", - "symbol_name": "WorkerSupervisor", - "qname": "WorkerSupervisor", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 6, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "77609d9d5927171cce7fc3a54897c183fd63068710c6362029b700937aae5eee", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "TraceService.__init__\n -> TraceService.store\n -> TraceService.create_context", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "TraceService.__init__:dataflow_slice", - "span_start": 42, - "span_end": 61, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "3b052062067a78aef3302ee1d996897e02a67d1b340397bea4f59fe147c0492a", - "edge_type": "dataflow_slice", - "src_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "src_qname": "TraceService.__init__", - "dst_symbol_id": "ff44881104b65ef50ee6fe16d367d4a81b6e7eb5c44c0963cf4543faec785d4a", - "dst_ref": "TraceService.create_context", - "resolution": "resolved", - "slice_id": "3b052062067a78aef3302ee1d996897e02a67d1b340397bea4f59fe147c0492a", - "root_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "path_symbols": [ - "TraceService.__init__", - "TraceService.store", - "TraceService.create_context" - ], - "path_symbol_ids": [ - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "ff44881104b65ef50ee6fe16d367d4a81b6e7eb5c44c0963cf4543faec785d4a" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "TraceService.__init__\n -> TraceService.store\n -> TraceService.close_context", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "TraceService.__init__:dataflow_slice", - "span_start": 42, - "span_end": 84, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "7a9353ef57c9ae5d19b3a0c6ac50fad05e6d21d31bbe1cd1cd07af6332ba6505", - "edge_type": "dataflow_slice", - "src_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "src_qname": "TraceService.__init__", - "dst_symbol_id": "01e14158dcced7e52d0c8ac84ac7b9a75225c261b6aca6a1d7da802d0994721c", - "dst_ref": "TraceService.close_context", - "resolution": "resolved", - "slice_id": "7a9353ef57c9ae5d19b3a0c6ac50fad05e6d21d31bbe1cd1cd07af6332ba6505", - "root_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "path_symbols": [ - "TraceService.__init__", - "TraceService.store", - "TraceService.close_context" - ], - "path_symbol_ids": [ - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "01e14158dcced7e52d0c8ac84ac7b9a75225c261b6aca6a1d7da802d0994721c" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "TraceService.__init__\n -> TraceService.store\n -> TraceService.open_context", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "TraceService.__init__:dataflow_slice", - "span_start": 42, - "span_end": 78, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "a6e13b9ebc4fed84586afd53ed92a4d14757e440873f572b2337d5622ee96031", - "edge_type": "dataflow_slice", - "src_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "src_qname": "TraceService.__init__", - "dst_symbol_id": "2da3d5b20a947bf63e14c103be4689b72fd837e0a82abd6c497846375d4c7426", - "dst_ref": "TraceService.open_context", - "resolution": "resolved", - "slice_id": "a6e13b9ebc4fed84586afd53ed92a4d14757e440873f572b2337d5622ee96031", - "root_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "path_symbols": [ - "TraceService.__init__", - "TraceService.store", - "TraceService.open_context" - ], - "path_symbol_ids": [ - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "2da3d5b20a947bf63e14c103be4689b72fd837e0a82abd6c497846375d4c7426" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "TraceService.__init__\n -> TraceService.transport\n -> TraceService.__init__", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "TraceService.__init__:dataflow_slice", - "span_start": 41, - "span_end": 43, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "1e923a93faa05c3c43ca9b19bd047007a8589ccce57d3cc1798ae7f9f200af98", - "edge_type": "dataflow_slice", - "src_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "src_qname": "TraceService.__init__", - "dst_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "dst_ref": "TraceService.__init__", - "resolution": "resolved", - "slice_id": "1e923a93faa05c3c43ca9b19bd047007a8589ccce57d3cc1798ae7f9f200af98", - "root_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "path_symbols": [ - "TraceService.__init__", - "TraceService.transport", - "TraceService.__init__" - ], - "path_symbol_ids": [ - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "TraceService.__init__\n -> TraceService.store\n -> TraceService.current_trace_id", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "TraceService.__init__:dataflow_slice", - "span_start": 42, - "span_end": 81, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "3ea17138634b1190bded77ddb84aa1595124f6519b246f24fc4b02bd62b5cac1", - "edge_type": "dataflow_slice", - "src_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "src_qname": "TraceService.__init__", - "dst_symbol_id": "41135180f7b3b9ab20e097e0747474e219c37dd2366ef08a7b43c1f3edb10b4c", - "dst_ref": "TraceService.current_trace_id", - "resolution": "resolved", - "slice_id": "3ea17138634b1190bded77ddb84aa1595124f6519b246f24fc4b02bd62b5cac1", - "root_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "path_symbols": [ - "TraceService.__init__", - "TraceService.store", - "TraceService.current_trace_id" - ], - "path_symbol_ids": [ - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "41135180f7b3b9ab20e097e0747474e219c37dd2366ef08a7b43c1f3edb10b4c" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "TraceService.__init__\n -> TraceService.store\n -> TraceService.step", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "TraceService.__init__:dataflow_slice", - "span_start": 42, - "span_end": 88, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "9f34c5da9b09fba99df6f6b1bde183a9aeb45111b8218a747c71590c2c9f60f2", - "edge_type": "dataflow_slice", - "src_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "src_qname": "TraceService.__init__", - "dst_symbol_id": "c44bfbc66cf747283f30088da3e011a10395031d41e77b74e523c24997f641ca", - "dst_ref": "TraceService.step", - "resolution": "resolved", - "slice_id": "9f34c5da9b09fba99df6f6b1bde183a9aeb45111b8218a747c71590c2c9f60f2", - "root_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "path_symbols": [ - "TraceService.__init__", - "TraceService.store", - "TraceService.step" - ], - "path_symbol_ids": [ - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "c44bfbc66cf747283f30088da3e011a10395031d41e77b74e523c24997f641ca" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "validation": { - "passed": false, - "action": "repair", - "reasons": [ - "missing_concrete_methods" - ] - }, - "steps": [ - { - "step": "router", - "status": "completed", - "timings_ms": { - "router": 1 - }, - "output": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - } - }, - { - "step": "retrieval", - "status": "completed", - "timings_ms": { - "retrieval": 158 - }, - "output": { - "rag_count": 33, - "answer_path_rag_count": 33, - "resolved_symbol_status": "resolved", - "resolved_symbol": "TraceService", - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "diagnostics": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "vector", - "C0_SOURCE_CHUNKS": "vector", - "C4_SEMANTIC_ROLES": "vector", - "C2_DEPENDENCY_GRAPH": "vector", - "C3_ENTRYPOINTS": "vector" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 8, - "C4_SEMANTIC_ROLES": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C3_ENTRYPOINTS": 6 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [] - }, - "C4_SEMANTIC_ROLES": { - "path_scope": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [] - } - }, - "fallback": { - "used": false, - "reason": null - }, - "retrieval_by_layer_ms": { - "C1_SYMBOL_CATALOG": 49, - "C0_SOURCE_CHUNKS": 22, - "C4_SEMANTIC_ROLES": 21, - "C2_DEPENDENCY_GRAPH": 49, - "C3_ENTRYPOINTS": 15 - } - } - }, - { - "step": "pre_evidence_gate", - "status": "passed", - "timings_ms": { - "pre_evidence_gate": 1 - }, - "input": { - "resolved_target": "TraceService", - "sub_intent": "EXPLAIN", - "target_type": "symbol", - "evidence_count": 33, - "code_chunk_count": 33, - "entrypoint_count": 3, - "relation_count": 6, - "test_evidence_count": 0, - "symbol_resolution_status": "resolved", - "path_scope": [] - }, - "output": { - "passed": true, - "failure_reasons": [], - "degraded_message": "", - "evidence_count": 33 - } - }, - { - "step": "llm", - "status": "completed", - "timings_ms": { - "llm": 4974 - }, - "output": { - "prompt_name": "code_qa_explain_answer", - "answer_preview": "Класс `TraceService` находится в файле `src/app_runtime/tracing/service.py`. Он наследует от `TraceContextFactory` и используется для управления трассировкой приложений.\n\nОсновные компоненты:\n- **Конструктор**: принимает опциональные аргументы `transport` и `store`. Если они не указаны, используются", - "resolved_target": "TraceService", - "answer_policy_branch": "normal_answer", - "decision_reason": "evidence_sufficient" - } - }, - { - "step": "post_evidence_gate", - "status": "failed", - "timings_ms": { - "post_evidence_gate": 3, - "post_evidence_gate_recheck": 2, - "repair": 4719 - }, - "input": { - "answer_mode": "normal", - "degraded_message": "", - "resolved_target": "TraceService", - "draft_answer_preview": "Класс `TraceService` находится в файле `src/app_runtime/tracing/service.py`. Он наследует от `TraceContextFactory` и используется для управления трассировкой приложений.\n\nОсновные компоненты:\n- **Конструктор**: принимает опциональные аргументы `transport` и `store`. Если они не указаны, используются", - "repair_candidate": true - }, - "output": { - "passed": false, - "action": "repair", - "reasons": [ - "missing_concrete_methods" - ], - "repair_used": true, - "final_answer_preview": "Недостаточно подтверждённых данных для уверенного ответа по TraceService." - } - } - ] - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/plba_full_chain_subintents_v3/20260312_192715/full_chain_plba_code_subintents_v2_plba-v2-explain-trace-service.md b/tests/pipeline_setup_v3/test_results/plba_full_chain_subintents_v3/20260312_192715/full_chain_plba_code_subintents_v2_plba-v2-explain-trace-service.md deleted file mode 100644 index c5d90a9..0000000 --- a/tests/pipeline_setup_v3/test_results/plba_full_chain_subintents_v3/20260312_192715/full_chain_plba_code_subintents_v2_plba-v2-explain-trace-service.md +++ /dev/null @@ -1,311 +0,0 @@ -# plba-v2-explain-trace-service - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_02_pipeline/full_chain_plba_code_subintents_v2.yaml -- runner: agent_runtime -- mode: full_chain -- passed: True - -## Query -Объясни как работает класс TraceService - -## Actual -{ - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 33, - "llm_answer": "Недостаточно подтверждённых данных для уверенного ответа по TraceService.", - "answer_mode": "degraded", - "path_scope": [], - "symbol_candidates": [ - "TraceService" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] -} - -## Steps -[ - { - "step": "router", - "status": "completed", - "timings_ms": { - "router": 1 - }, - "output": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - } - }, - { - "step": "retrieval", - "status": "completed", - "timings_ms": { - "retrieval": 158 - }, - "output": { - "rag_count": 33, - "answer_path_rag_count": 33, - "resolved_symbol_status": "resolved", - "resolved_symbol": "TraceService", - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "diagnostics": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "vector", - "C0_SOURCE_CHUNKS": "vector", - "C4_SEMANTIC_ROLES": "vector", - "C2_DEPENDENCY_GRAPH": "vector", - "C3_ENTRYPOINTS": "vector" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 8, - "C4_SEMANTIC_ROLES": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C3_ENTRYPOINTS": 6 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [] - }, - "C4_SEMANTIC_ROLES": { - "path_scope": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [] - } - }, - "fallback": { - "used": false, - "reason": null - }, - "retrieval_by_layer_ms": { - "C1_SYMBOL_CATALOG": 49, - "C0_SOURCE_CHUNKS": 22, - "C4_SEMANTIC_ROLES": 21, - "C2_DEPENDENCY_GRAPH": 49, - "C3_ENTRYPOINTS": 15 - } - } - }, - { - "step": "pre_evidence_gate", - "status": "passed", - "timings_ms": { - "pre_evidence_gate": 1 - }, - "input": { - "resolved_target": "TraceService", - "sub_intent": "EXPLAIN", - "target_type": "symbol", - "evidence_count": 33, - "code_chunk_count": 33, - "entrypoint_count": 3, - "relation_count": 6, - "test_evidence_count": 0, - "symbol_resolution_status": "resolved", - "path_scope": [] - }, - "output": { - "passed": true, - "failure_reasons": [], - "degraded_message": "", - "evidence_count": 33 - } - }, - { - "step": "llm", - "status": "completed", - "timings_ms": { - "llm": 4974 - }, - "output": { - "prompt_name": "code_qa_explain_answer", - "answer_preview": "Класс `TraceService` находится в файле `src/app_runtime/tracing/service.py`. Он наследует от `TraceContextFactory` и используется для управления трассировкой приложений.\n\nОсновные компоненты:\n- **Конструктор**: принимает опциональные аргументы `transport` и `store`. Если они не указаны, используются", - "resolved_target": "TraceService", - "answer_policy_branch": "normal_answer", - "decision_reason": "evidence_sufficient" - } - }, - { - "step": "post_evidence_gate", - "status": "failed", - "timings_ms": { - "post_evidence_gate": 3, - "post_evidence_gate_recheck": 2, - "repair": 4719 - }, - "input": { - "answer_mode": "normal", - "degraded_message": "", - "resolved_target": "TraceService", - "draft_answer_preview": "Класс `TraceService` находится в файле `src/app_runtime/tracing/service.py`. Он наследует от `TraceContextFactory` и используется для управления трассировкой приложений.\n\nОсновные компоненты:\n- **Конструктор**: принимает опциональные аргументы `transport` и `store`. Если они не указаны, используются", - "repair_candidate": true - }, - "output": { - "passed": false, - "action": "repair", - "reasons": [ - "missing_concrete_methods" - ], - "repair_used": true, - "final_answer_preview": "Недостаточно подтверждённых данных для уверенного ответа по TraceService." - } - } -] - -## Diagnostics -{ - "intent_correct": null, - "target_found": true, - "layers_used": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_sufficient": true, - "answer_mode": "degraded", - "resolved_target": "TraceService", - "answer_policy_branch": "normal_answer", - "decision_reason": "evidence_sufficient", - "router_result": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "retrieval_profile": "code", - "sub_intent": "EXPLAIN", - "path_scope": [], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "symbol_resolution_status": "resolved" - }, - "retrieval_request": { - "rag_session_id": "7d11da21-faa0-4cea-aede-aeabe069164c", - "query": "Объясни как работает класс TraceService", - "sub_intent": "EXPLAIN", - "path_scope": [], - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "per_layer_outcome": [ - { - "layer_id": "C1_SYMBOL_CATALOG", - "hit_count": 8, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C0_SOURCE_CHUNKS", - "hit_count": 8, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C4_SEMANTIC_ROLES", - "hit_count": 8, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C2_DEPENDENCY_GRAPH", - "hit_count": 6, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C3_ENTRYPOINTS", - "hit_count": 3, - "empty": false, - "fallback_used": false - } - ], - "empty_layers": [], - "evidence_gate_decision": { - "sufficient": true, - "failure_reasons": [], - "evidence_count": 33 - }, - "evidence_gate_input": { - "resolved_target": "TraceService", - "sub_intent": "EXPLAIN", - "target_type": "symbol", - "evidence_count": 33, - "code_chunk_count": 33, - "entrypoint_count": 3, - "relation_count": 6, - "test_evidence_count": 0, - "symbol_resolution_status": "resolved", - "path_scope": [] - }, - "post_evidence_gate": { - "input": { - "answer_mode": "normal", - "degraded_message": "", - "resolved_target": "TraceService", - "draft_answer_preview": "Класс `TraceService` находится в файле `src/app_runtime/tracing/service.py`. Он наследует от `TraceContextFactory` и используется для управления трассировкой приложений.\n\nОсновные компоненты:\n- **Конструктор**: принимает опциональные аргументы `transport` и `store`. Если они не указаны, используются", - "repair_candidate": true - }, - "output": { - "passed": false, - "action": "repair", - "reasons": [ - "missing_concrete_methods" - ], - "repair_used": true, - "final_answer_preview": "Недостаточно подтверждённых данных для уверенного ответа по TraceService." - } - }, - "failure_reasons": [], - "timings_ms": { - "router": 1, - "retrieval": 158, - "pre_evidence_gate": 1, - "llm": 4974, - "post_evidence_gate": 3, - "repair": 4719, - "post_evidence_gate_recheck": 2 - } -} - -## Mismatches -- none \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/plba_full_chain_subintents_v3/20260312_192715/full_chain_plba_code_subintents_v2_plba-v2-find-entrypoints-control-plane.json b/tests/pipeline_setup_v3/test_results/plba_full_chain_subintents_v3/20260312_192715/full_chain_plba_code_subintents_v2_plba-v2-find-entrypoints-control-plane.json deleted file mode 100644 index 504529c..0000000 --- a/tests/pipeline_setup_v3/test_results/plba_full_chain_subintents_v3/20260312_192715/full_chain_plba_code_subintents_v2_plba-v2-find-entrypoints-control-plane.json +++ /dev/null @@ -1,1500 +0,0 @@ -{ - "case_id": "plba-v2-find-entrypoints-control-plane", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_02_pipeline/full_chain_plba_code_subintents_v2.yaml", - "runner": "agent_runtime", - "mode": "full_chain", - "query": "Найди точки входа HTTP control plane", - "actual": { - "intent": "CODE_QA", - "sub_intent": "FIND_ENTRYPOINTS", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 9, - "llm_answer": "Подтверждённые HTTP routes:\n\n1. GET /health — обработчик `health`, объявлен в `src/app_runtime/control/http_app.py`:31-34.\n2. GET /actions/{action} — обработчик `action`, объявлен в `src/app_runtime/control/http_app.py`:38-42.\n3. POST /actions/{action} — обработчик `action`, объявлен в `src/app_runtime/control/http_app.py`:38-42.\n\nКандидаты на входные точки отсутствуют.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "HTTP", - "control", - "plane" - ], - "layers": [ - "C3_ENTRYPOINTS", - "C0_SOURCE_CHUNKS" - ] - }, - "passed": true, - "mismatches": [], - "details": { - "query": "Найди точки входа HTTP control plane", - "router_result": { - "schema_version": "1.1", - "intent": "CODE_QA", - "retrieval_profile": "code", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query_plan": { - "raw": "Найди точки входа HTTP control plane", - "normalized": "Найди точки входа HTTP control plane", - "sub_intent": "FIND_ENTRYPOINTS", - "negations": [], - "expansions": [ - "HTTP", - "control", - "plane" - ], - "keyword_hints": [ - "HTTP", - "control", - "plane" - ], - "path_hints": [], - "doc_scope_hints": [], - "symbol_candidates": [ - "HTTP", - "control", - "plane" - ], - "symbol_kind_hint": "class", - "anchors": [ - { - "type": "SYMBOL", - "value": "HTTP", - "source": "user_text", - "subtype": null, - "span": { - "start": 18, - "end": 22 - }, - "confidence": 0.88 - }, - { - "type": "SYMBOL", - "value": "control", - "source": "user_text", - "subtype": null, - "span": { - "start": 23, - "end": 30 - }, - "confidence": 0.88 - }, - { - "type": "SYMBOL", - "value": "plane", - "source": "user_text", - "subtype": null, - "span": { - "start": 31, - "end": 36 - }, - "confidence": 0.88 - } - ] - }, - "retrieval_spec": { - "domains": [ - "CODE" - ], - "layer_queries": [ - { - "layer_id": "C3_ENTRYPOINTS", - "top_k": 12 - }, - { - "layer_id": "C0_SOURCE_CHUNKS", - "top_k": 6 - } - ], - "filters": { - "test_policy": "EXCLUDE", - "path_scope": [], - "language": [ - "python" - ] - }, - "rerank_profile": "code" - }, - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - }, - "symbol_resolution": { - "status": "not_found", - "resolved_symbol": null, - "alternatives": [], - "confidence": 0.0 - }, - "evidence_policy": { - "require_def": true, - "require_flow": true, - "require_spec": false, - "allow_answer_without_evidence": false - } - }, - "retrieval_request": { - "rag_session_id": "7d11da21-faa0-4cea-aede-aeabe069164c", - "query": "Найди точки входа HTTP control plane", - "sub_intent": "FIND_ENTRYPOINTS", - "path_scope": [], - "keyword_hints": [ - "HTTP", - "control", - "plane" - ], - "symbol_candidates": [ - "HTTP", - "control", - "plane" - ], - "requested_layers": [ - "C3_ENTRYPOINTS", - "C0_SOURCE_CHUNKS" - ], - "retrieval_spec": { - "domains": [ - "CODE" - ], - "layer_queries": [ - { - "layer_id": "C3_ENTRYPOINTS", - "top_k": 12 - }, - { - "layer_id": "C0_SOURCE_CHUNKS", - "top_k": 6 - } - ], - "filters": { - "test_policy": "EXCLUDE", - "path_scope": [], - "language": [ - "python" - ] - }, - "rerank_profile": "code" - }, - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - }, - "query_plan": { - "raw": "Найди точки входа HTTP control plane", - "normalized": "Найди точки входа HTTP control plane", - "sub_intent": "FIND_ENTRYPOINTS", - "negations": [], - "expansions": [ - "HTTP", - "control", - "plane" - ], - "keyword_hints": [ - "HTTP", - "control", - "plane" - ], - "path_hints": [], - "doc_scope_hints": [], - "symbol_candidates": [ - "HTTP", - "control", - "plane" - ], - "symbol_kind_hint": "class", - "anchors": [ - { - "type": "SYMBOL", - "value": "HTTP", - "source": "user_text", - "subtype": null, - "span": { - "start": 18, - "end": 22 - }, - "confidence": 0.88 - }, - { - "type": "SYMBOL", - "value": "control", - "source": "user_text", - "subtype": null, - "span": { - "start": 23, - "end": 30 - }, - "confidence": 0.88 - }, - { - "type": "SYMBOL", - "value": "plane", - "source": "user_text", - "subtype": null, - "span": { - "start": 31, - "end": 36 - }, - "confidence": 0.88 - } - ] - } - }, - "retrieval_result": { - "target_symbol_candidates": [], - "resolved_symbol": null, - "symbol_resolution_status": "not_found", - "file_candidates": [ - "src/app_runtime/control/http_app.py", - "src/app_runtime/control/http_channel.py", - "src/app_runtime/control/base.py", - "src/app_runtime/control/__init__.py", - "src/app_runtime/control/http_runner.py" - ], - "code_chunks": [ - { - "layer": "C3_ENTRYPOINTS", - "path": "src/app_runtime/control/http_app.py", - "title": "app.post", - "content": "fastapi http app.post", - "start_line": 38, - "end_line": 42, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C3_ENTRYPOINTS", - "path": "src/app_runtime/control/http_app.py", - "title": "app.get", - "content": "fastapi http app.get", - "start_line": 31, - "end_line": 34, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C3_ENTRYPOINTS", - "path": "src/app_runtime/control/http_app.py", - "title": "app.get", - "content": "fastapi http app.get", - "start_line": 38, - "end_line": 42, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C0_SOURCE_CHUNKS", - "path": "src/app_runtime/control/http_channel.py", - "title": "src/app_runtime/control/http_channel.py:HttpControlChannel", - "content": "class HttpControlChannel(ControlChannel):\n def __init__(self, host: str, port: int, timeout: int) -> None:\n self._timeout = timeout\n self._runner = UvicornThreadRunner(host, port, timeout)\n self._factory = HttpControlAppFactory()\n self._actions: ControlActionSet | None = None\n\n async def start(self, actions: ControlActionSet) -> None:\n self._actions = actions\n app = self._factory.create(self._health_response, self._action_response)\n await self._runner.start(app)\n\n async def stop(self) -> None:\n await self._runner.stop()\n\n @property\n def port(self) -> int:\n return self._runner.port\n\n async def _health_response(self) -> dict[str, object]:\n if self._actions is None:\n return {\"status\": \"unhealthy\", \"detail\": \"control actions are not configured\"}\n return await asyncio.wait_for(self._actions.health(), timeout=float(self._timeout))\n\n async def _action_response(self, action: str, _client_source: str = \"unknown\") -> JSONResponse:\n if self._actions is None:\n return JSONResponse(content={\"status\": \"error\", \"detail\": f\"{action} handler is not configured\"}, status_code=404)\n callbacks = {\n \"start\": self._actions.start,\n \"stop\": self._actions.stop,\n \"status\": self._actions.status,\n }\n callback = callbacks.get(action)\n if callback is None:\n return JSONResponse(content={\"status\": \"error\", \"detail\": f\"unsupported action: {action}\"}, status_code=404)\n action_timeout = max(float(self._timeout), 10.0) if action in {\"start\", \"stop\"} else float(self._timeout)\n try:\n detail = await asyncio.wait_for(callback(), timeout=action_timeout)\n except asyncio.TimeoutError:\n return JSONResponse(\n content={\"status\": \"accepted\", \"detail\": f\"{action} operation is still in progress\"},\n status_code=202,\n )\n except Exception as exc:\n return JSONResponse(content={\"status\": \"error\", \"detail\": str(exc)}, status_code=500)\n return JSONResponse(content={\"status\": \"ok\", \"detail\": detail or f\"{action} action accepted\"}, status_code=200)", - "start_line": 12, - "end_line": 57, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.http_channel", - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C0_SOURCE_CHUNKS", - "path": "src/app_runtime/control/http_app.py", - "title": "src/app_runtime/control/http_app.py:HttpControlAppFactory", - "content": "class HttpControlAppFactory:\n def create(\n self,\n health_provider: Callable[[], Awaitable[HealthPayload]],\n action_provider: Callable[[str, str], Awaitable[JSONResponse]],\n ) -> FastAPI:\n app = FastAPI(title=\"PLBA Control API\")\n\n @app.middleware(\"http\")\n async def log_api_call(request: Request, call_next): # type: ignore[no-untyped-def]\n started = time.monotonic()\n response = await call_next(request)\n response.headers[\"X-Response-Time-Ms\"] = str(int((time.monotonic() - started) * 1000))\n return response\n\n @app.get(\"/health\")\n async def health() -> JSONResponse:\n payload = await health_provider()\n status_code = 200 if payload.get(\"status\") == \"ok\" else 503\n return JSONResponse(content=payload, status_code=status_code)\n\n @app.get(\"/actions/{action}\")\n @app.post(\"/actions/{action}\")\n async def action(action: str, request: Request) -> JSONResponse:\n client_source = self._client_source(request)\n if action in {\"start\", \"stop\"}:\n LOGGER.warning(\"Control action requested: /actions/%s client=%s\", action, client_source)\n return await action_provider(action, client_source)\n\n return app\n\n def _client_source(self, request: Request) -> str:\n explicit_header = request.headers.get(\"X-Client-Source\", \"\").strip()\n if explicit_header:\n return explicit_header\n user_agent = request.headers.get(\"User-Agent\", \"\").strip()\n if user_agent:\n return f\"user-agent:{user_agent}\"\n return \"unknown\"", - "start_line": 15, - "end_line": 53, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.http_app", - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C0_SOURCE_CHUNKS", - "path": "src/app_runtime/control/base.py", - "title": "src/app_runtime/control/base.py:ControlActionSet", - "content": "class ControlActionSet:\n health: HealthHandler\n start: ActionHandler\n stop: ActionHandler\n status: ActionHandler", - "start_line": 14, - "end_line": 18, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.base", - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C0_SOURCE_CHUNKS", - "path": "src/app_runtime/control/__init__.py", - "title": "src/app_runtime/control/__init__.py:1-5", - "content": "from app_runtime.control.base import ControlActionSet, ControlChannel\nfrom app_runtime.control.http_channel import HttpControlChannel\nfrom app_runtime.control.service import ControlPlaneService\n\n__all__ = [\"ControlActionSet\", \"ControlChannel\", \"ControlPlaneService\", \"HttpControlChannel\"]", - "start_line": 1, - "end_line": 5, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.app_runtime.control.__init__", - "is_test": false, - "blob_sha": "bf3c37e3369a84cc618adc0fd71c232e5eb4b871eaff743069a17e661e498316", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C0_SOURCE_CHUNKS", - "path": "src/app_runtime/control/base.py", - "title": "src/app_runtime/control/base.py:ControlChannel", - "content": "class ControlChannel(ABC):\n @abstractmethod\n async def start(self, actions: ControlActionSet) -> None:\n \"\"\"Start the control channel and bind handlers.\"\"\"\n\n @abstractmethod\n async def stop(self) -> None:\n \"\"\"Stop the control channel and release resources.\"\"\"", - "start_line": 21, - "end_line": 28, - "metadata": { - "chunk_index": 1, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.base", - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C0_SOURCE_CHUNKS", - "path": "src/app_runtime/control/http_runner.py", - "title": "src/app_runtime/control/http_runner.py:UvicornThreadRunner", - "content": "class UvicornThreadRunner:\n def __init__(self, host: str, port: int, timeout: int) -> None:\n self._host = host\n self._port = port\n self._timeout = timeout\n self._server: Server | None = None\n self._thread: Thread | None = None\n self._error: BaseException | None = None\n\n async def start(self, app: FastAPI) -> None:\n if self._thread is not None and self._thread.is_alive():\n return\n self._error = None\n config = Config(app=app, host=self._host, port=self._port, log_level=\"warning\")\n self._server = Server(config)\n self._thread = Thread(target=self._serve, name=\"plba-http-control\", daemon=True)\n self._thread.start()\n await self._wait_until_started()\n\n async def stop(self) -> None:\n if self._server is None or self._thread is None:\n return\n self._server.should_exit = True\n await asyncio.to_thread(self._thread.join, self._timeout)\n self._server = None\n self._thread = None\n\n @property\n def port(self) -> int:\n if self._server is None or not getattr(self._server, \"servers\", None):\n return self._port\n socket = self._server.servers[0].sockets[0]\n return int(socket.getsockname()[1])\n\n async def _wait_until_started(self) -> None:\n if self._server is None:\n raise RuntimeError(\"Server is not initialized\")\n deadline = asyncio.get_running_loop().time() + max(float(self._timeout), 1.0)\n while not self._server.started:\n if self._error is not None:\n raise RuntimeError(\"HTTP control server failed to start\") from self._error\n if asyncio.get_running_loop().time() >= deadline:\n raise TimeoutError(\"HTTP control server startup timed out\")\n await asyncio.sleep(0.05)\n\n def _serve(self) -> None:\n if self._server is None:\n return\n try:\n asyncio.run(self._server.serve())\n except BaseException as exc: # noqa: BLE001\n self._error = exc", - "start_line": 10, - "end_line": 61, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.http_runner", - "is_test": false, - "blob_sha": "3779fdd2878b770e789a35bb2a89c9d79f13b61c26d7db1b3b683f9bb9e1623f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "relations": [], - "semantic_hints": [], - "entrypoints": [ - { - "path": "src/app_runtime/control/http_app.py", - "title": "app.get", - "start_line": 31, - "end_line": 34, - "http_method": "GET", - "route_path": "/health", - "handler_symbol": "health", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "route_or_command": "app.get", - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "title": "app.get", - "start_line": 38, - "end_line": 42, - "http_method": "GET", - "route_path": "/actions/{action}", - "handler_symbol": "action", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "route_or_command": "app.get", - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "title": "app.post", - "start_line": 38, - "end_line": 42, - "http_method": "POST", - "route_path": "/actions/{action}", - "handler_symbol": "action", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "route_or_command": "app.post", - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "test_candidates": [], - "layer_outcomes": [ - { - "layer_id": "C3_ENTRYPOINTS", - "hit_count": 3, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C0_SOURCE_CHUNKS", - "hit_count": 6, - "empty": false, - "fallback_used": false - } - ], - "missing_layers": [], - "raw_rows": [ - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": null, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": null, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": null, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "class HttpControlChannel(ControlChannel):\n def __init__(self, host: str, port: int, timeout: int) -> None:\n self._timeout = timeout\n self._runner = UvicornThreadRunner(host, port, timeout)\n self._factory = HttpControlAppFactory()\n self._actions: ControlActionSet | None = None\n\n async def start(self, actions: ControlActionSet) -> None:\n self._actions = actions\n app = self._factory.create(self._health_response, self._action_response)\n await self._runner.start(app)\n\n async def stop(self) -> None:\n await self._runner.stop()\n\n @property\n def port(self) -> int:\n return self._runner.port\n\n async def _health_response(self) -> dict[str, object]:\n if self._actions is None:\n return {\"status\": \"unhealthy\", \"detail\": \"control actions are not configured\"}\n return await asyncio.wait_for(self._actions.health(), timeout=float(self._timeout))\n\n async def _action_response(self, action: str, _client_source: str = \"unknown\") -> JSONResponse:\n if self._actions is None:\n return JSONResponse(content={\"status\": \"error\", \"detail\": f\"{action} handler is not configured\"}, status_code=404)\n callbacks = {\n \"start\": self._actions.start,\n \"stop\": self._actions.stop,\n \"status\": self._actions.status,\n }\n callback = callbacks.get(action)\n if callback is None:\n return JSONResponse(content={\"status\": \"error\", \"detail\": f\"unsupported action: {action}\"}, status_code=404)\n action_timeout = max(float(self._timeout), 10.0) if action in {\"start\", \"stop\"} else float(self._timeout)\n try:\n detail = await asyncio.wait_for(callback(), timeout=action_timeout)\n except asyncio.TimeoutError:\n return JSONResponse(\n content={\"status\": \"accepted\", \"detail\": f\"{action} operation is still in progress\"},\n status_code=202,\n )\n except Exception as exc:\n return JSONResponse(content={\"status\": \"error\", \"detail\": str(exc)}, status_code=500)\n return JSONResponse(content={\"status\": \"ok\", \"detail\": detail or f\"{action} action accepted\"}, status_code=200)", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/http_channel.py:HttpControlChannel", - "span_start": 12, - "span_end": 57, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": null, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.http_channel", - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "class HttpControlAppFactory:\n def create(\n self,\n health_provider: Callable[[], Awaitable[HealthPayload]],\n action_provider: Callable[[str, str], Awaitable[JSONResponse]],\n ) -> FastAPI:\n app = FastAPI(title=\"PLBA Control API\")\n\n @app.middleware(\"http\")\n async def log_api_call(request: Request, call_next): # type: ignore[no-untyped-def]\n started = time.monotonic()\n response = await call_next(request)\n response.headers[\"X-Response-Time-Ms\"] = str(int((time.monotonic() - started) * 1000))\n return response\n\n @app.get(\"/health\")\n async def health() -> JSONResponse:\n payload = await health_provider()\n status_code = 200 if payload.get(\"status\") == \"ok\" else 503\n return JSONResponse(content=payload, status_code=status_code)\n\n @app.get(\"/actions/{action}\")\n @app.post(\"/actions/{action}\")\n async def action(action: str, request: Request) -> JSONResponse:\n client_source = self._client_source(request)\n if action in {\"start\", \"stop\"}:\n LOGGER.warning(\"Control action requested: /actions/%s client=%s\", action, client_source)\n return await action_provider(action, client_source)\n\n return app\n\n def _client_source(self, request: Request) -> str:\n explicit_header = request.headers.get(\"X-Client-Source\", \"\").strip()\n if explicit_header:\n return explicit_header\n user_agent = request.headers.get(\"User-Agent\", \"\").strip()\n if user_agent:\n return f\"user-agent:{user_agent}\"\n return \"unknown\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/http_app.py:HttpControlAppFactory", - "span_start": 15, - "span_end": 53, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": null, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.http_app", - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "class ControlActionSet:\n health: HealthHandler\n start: ActionHandler\n stop: ActionHandler\n status: ActionHandler", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/base.py:ControlActionSet", - "span_start": 14, - "span_end": 18, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": null, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.base", - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/__init__.py", - "content": "from app_runtime.control.base import ControlActionSet, ControlChannel\nfrom app_runtime.control.http_channel import HttpControlChannel\nfrom app_runtime.control.service import ControlPlaneService\n\n__all__ = [\"ControlActionSet\", \"ControlChannel\", \"ControlPlaneService\", \"HttpControlChannel\"]", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/__init__.py:1-5", - "span_start": 1, - "span_end": 5, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": null, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.app_runtime.control.__init__", - "is_test": false, - "blob_sha": "bf3c37e3369a84cc618adc0fd71c232e5eb4b871eaff743069a17e661e498316", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "class ControlChannel(ABC):\n @abstractmethod\n async def start(self, actions: ControlActionSet) -> None:\n \"\"\"Start the control channel and bind handlers.\"\"\"\n\n @abstractmethod\n async def stop(self) -> None:\n \"\"\"Stop the control channel and release resources.\"\"\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/base.py:ControlChannel", - "span_start": 21, - "span_end": 28, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": null, - "metadata": { - "chunk_index": 1, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.base", - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_runner.py", - "content": "class UvicornThreadRunner:\n def __init__(self, host: str, port: int, timeout: int) -> None:\n self._host = host\n self._port = port\n self._timeout = timeout\n self._server: Server | None = None\n self._thread: Thread | None = None\n self._error: BaseException | None = None\n\n async def start(self, app: FastAPI) -> None:\n if self._thread is not None and self._thread.is_alive():\n return\n self._error = None\n config = Config(app=app, host=self._host, port=self._port, log_level=\"warning\")\n self._server = Server(config)\n self._thread = Thread(target=self._serve, name=\"plba-http-control\", daemon=True)\n self._thread.start()\n await self._wait_until_started()\n\n async def stop(self) -> None:\n if self._server is None or self._thread is None:\n return\n self._server.should_exit = True\n await asyncio.to_thread(self._thread.join, self._timeout)\n self._server = None\n self._thread = None\n\n @property\n def port(self) -> int:\n if self._server is None or not getattr(self._server, \"servers\", None):\n return self._port\n socket = self._server.servers[0].sockets[0]\n return int(socket.getsockname()[1])\n\n async def _wait_until_started(self) -> None:\n if self._server is None:\n raise RuntimeError(\"Server is not initialized\")\n deadline = asyncio.get_running_loop().time() + max(float(self._timeout), 1.0)\n while not self._server.started:\n if self._error is not None:\n raise RuntimeError(\"HTTP control server failed to start\") from self._error\n if asyncio.get_running_loop().time() >= deadline:\n raise TimeoutError(\"HTTP control server startup timed out\")\n await asyncio.sleep(0.05)\n\n def _serve(self) -> None:\n if self._server is None:\n return\n try:\n asyncio.run(self._server.serve())\n except BaseException as exc: # noqa: BLE001\n self._error = exc", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/http_runner.py:UvicornThreadRunner", - "span_start": 10, - "span_end": 61, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": null, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.http_runner", - "is_test": false, - "blob_sha": "3779fdd2878b770e789a35bb2a89c9d79f13b61c26d7db1b3b683f9bb9e1623f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "retrieval_report": { - "executed_layers": [ - "C3_ENTRYPOINTS", - "C0_SOURCE_CHUNKS" - ], - "retrieval_mode_by_layer": { - "C3_ENTRYPOINTS": "vector", - "C0_SOURCE_CHUNKS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C3_ENTRYPOINTS": 12, - "C0_SOURCE_CHUNKS": 24 - }, - "filters_by_layer": { - "C3_ENTRYPOINTS": { - "path_scope": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src/app_runtime/control/http_app.py" - ] - } - }, - "fallback": { - "used": false, - "reason": null - }, - "retrieval_by_layer_ms": { - "C3_ENTRYPOINTS": 14, - "C0_SOURCE_CHUNKS": 11 - }, - "supplemental_requests": [ - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Найди точки входа HTTP control plane", - "ranking_profile": "entrypoint_source_hydration" - } - ] - } - }, - "diagnostics": { - "intent_correct": null, - "target_found": true, - "layers_used": [ - "C3_ENTRYPOINTS", - "C0_SOURCE_CHUNKS" - ], - "retrieval_sufficient": true, - "answer_mode": "normal", - "resolved_target": "src/app_runtime/control/http_app.py", - "answer_policy_branch": "normal_answer", - "decision_reason": "evidence_sufficient", - "router_result": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "retrieval_profile": "code", - "sub_intent": "FIND_ENTRYPOINTS", - "path_scope": [], - "layers": [ - "C3_ENTRYPOINTS", - "C0_SOURCE_CHUNKS" - ], - "symbol_resolution_status": "not_found" - }, - "retrieval_request": { - "rag_session_id": "7d11da21-faa0-4cea-aede-aeabe069164c", - "query": "Найди точки входа HTTP control plane", - "sub_intent": "FIND_ENTRYPOINTS", - "path_scope": [], - "requested_layers": [ - "C3_ENTRYPOINTS", - "C0_SOURCE_CHUNKS" - ] - }, - "per_layer_outcome": [ - { - "layer_id": "C3_ENTRYPOINTS", - "hit_count": 3, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C0_SOURCE_CHUNKS", - "hit_count": 6, - "empty": false, - "fallback_used": false - } - ], - "empty_layers": [], - "evidence_gate_decision": { - "sufficient": true, - "failure_reasons": [], - "evidence_count": 9 - }, - "evidence_gate_input": { - "resolved_target": "src/app_runtime/control/http_app.py", - "sub_intent": "FIND_ENTRYPOINTS", - "target_type": "file", - "evidence_count": 9, - "code_chunk_count": 9, - "entrypoint_count": 3, - "relation_count": 0, - "test_evidence_count": 0, - "symbol_resolution_status": "not_found", - "path_scope": [] - }, - "post_evidence_gate": { - "input": { - "answer_mode": "normal", - "degraded_message": "", - "resolved_target": "src/app_runtime/control/http_app.py", - "draft_answer_preview": "Подтверждённые HTTP routes:\n\n1. GET /health — обработчик `health`, объявлен в `src/app_runtime/control/http_app.py`:31-34.\n2. GET /actions/{action} — обработчик `action`, объявлен в `src/app_runtime/control/http_app.py`:38-42.\n3. POST /actions/{action} — обработчик `action`, объявлен в `src/app_runt", - "repair_candidate": true - }, - "output": { - "passed": true, - "action": "return", - "reasons": [], - "repair_used": false, - "final_answer_preview": "Подтверждённые HTTP routes:\n\n1. GET /health — обработчик `health`, объявлен в `src/app_runtime/control/http_app.py`:31-34.\n2. GET /actions/{action} — обработчик `action`, объявлен в `src/app_runtime/control/http_app.py`:38-42.\n3. POST /actions/{action} — обработчик `action`, объявлен в `src/app_runt" - } - }, - "failure_reasons": [], - "timings_ms": { - "router": 1, - "retrieval": 35, - "pre_evidence_gate": 1, - "llm": 3053, - "post_evidence_gate": 1 - } - }, - "rag_rows": [ - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "class HttpControlChannel(ControlChannel):\n def __init__(self, host: str, port: int, timeout: int) -> None:\n self._timeout = timeout\n self._runner = UvicornThreadRunner(host, port, timeout)\n self._factory = HttpControlAppFactory()\n self._actions: ControlActionSet | None = None\n\n async def start(self, actions: ControlActionSet) -> None:\n self._actions = actions\n app = self._factory.create(self._health_response, self._action_response)\n await self._runner.start(app)\n\n async def stop(self) -> None:\n await self._runner.stop()\n\n @property\n def port(self) -> int:\n return self._runner.port\n\n async def _health_response(self) -> dict[str, object]:\n if self._actions is None:\n return {\"status\": \"unhealthy\", \"detail\": \"control actions are not configured\"}\n return await asyncio.wait_for(self._actions.health(), timeout=float(self._timeout))\n\n async def _action_response(self, action: str, _client_source: str = \"unknown\") -> JSONResponse:\n if self._actions is None:\n return JSONResponse(content={\"status\": \"error\", \"detail\": f\"{action} handler is not configured\"}, status_code=404)\n callbacks = {\n \"start\": self._actions.start,\n \"stop\": self._actions.stop,\n \"status\": self._actions.status,\n }\n callback = callbacks.get(action)\n if callback is None:\n return JSONResponse(content={\"status\": \"error\", \"detail\": f\"unsupported action: {action}\"}, status_code=404)\n action_timeout = max(float(self._timeout), 10.0) if action in {\"start\", \"stop\"} else float(self._timeout)\n try:\n detail = await asyncio.wait_for(callback(), timeout=action_timeout)\n except asyncio.TimeoutError:\n return JSONResponse(\n content={\"status\": \"accepted\", \"detail\": f\"{action} operation is still in progress\"},\n status_code=202,\n )\n except Exception as exc:\n return JSONResponse(content={\"status\": \"error\", \"detail\": str(exc)}, status_code=500)\n return JSONResponse(content={\"status\": \"ok\", \"detail\": detail or f\"{action} action accepted\"}, status_code=200)", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/http_channel.py:HttpControlChannel", - "span_start": 12, - "span_end": 57, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.http_channel", - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "class HttpControlAppFactory:\n def create(\n self,\n health_provider: Callable[[], Awaitable[HealthPayload]],\n action_provider: Callable[[str, str], Awaitable[JSONResponse]],\n ) -> FastAPI:\n app = FastAPI(title=\"PLBA Control API\")\n\n @app.middleware(\"http\")\n async def log_api_call(request: Request, call_next): # type: ignore[no-untyped-def]\n started = time.monotonic()\n response = await call_next(request)\n response.headers[\"X-Response-Time-Ms\"] = str(int((time.monotonic() - started) * 1000))\n return response\n\n @app.get(\"/health\")\n async def health() -> JSONResponse:\n payload = await health_provider()\n status_code = 200 if payload.get(\"status\") == \"ok\" else 503\n return JSONResponse(content=payload, status_code=status_code)\n\n @app.get(\"/actions/{action}\")\n @app.post(\"/actions/{action}\")\n async def action(action: str, request: Request) -> JSONResponse:\n client_source = self._client_source(request)\n if action in {\"start\", \"stop\"}:\n LOGGER.warning(\"Control action requested: /actions/%s client=%s\", action, client_source)\n return await action_provider(action, client_source)\n\n return app\n\n def _client_source(self, request: Request) -> str:\n explicit_header = request.headers.get(\"X-Client-Source\", \"\").strip()\n if explicit_header:\n return explicit_header\n user_agent = request.headers.get(\"User-Agent\", \"\").strip()\n if user_agent:\n return f\"user-agent:{user_agent}\"\n return \"unknown\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/http_app.py:HttpControlAppFactory", - "span_start": 15, - "span_end": 53, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.http_app", - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "class ControlActionSet:\n health: HealthHandler\n start: ActionHandler\n stop: ActionHandler\n status: ActionHandler", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/base.py:ControlActionSet", - "span_start": 14, - "span_end": 18, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.base", - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/__init__.py", - "content": "from app_runtime.control.base import ControlActionSet, ControlChannel\nfrom app_runtime.control.http_channel import HttpControlChannel\nfrom app_runtime.control.service import ControlPlaneService\n\n__all__ = [\"ControlActionSet\", \"ControlChannel\", \"ControlPlaneService\", \"HttpControlChannel\"]", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/__init__.py:1-5", - "span_start": 1, - "span_end": 5, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.app_runtime.control.__init__", - "is_test": false, - "blob_sha": "bf3c37e3369a84cc618adc0fd71c232e5eb4b871eaff743069a17e661e498316", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "class ControlChannel(ABC):\n @abstractmethod\n async def start(self, actions: ControlActionSet) -> None:\n \"\"\"Start the control channel and bind handlers.\"\"\"\n\n @abstractmethod\n async def stop(self) -> None:\n \"\"\"Stop the control channel and release resources.\"\"\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/base.py:ControlChannel", - "span_start": 21, - "span_end": 28, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 1, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.base", - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_runner.py", - "content": "class UvicornThreadRunner:\n def __init__(self, host: str, port: int, timeout: int) -> None:\n self._host = host\n self._port = port\n self._timeout = timeout\n self._server: Server | None = None\n self._thread: Thread | None = None\n self._error: BaseException | None = None\n\n async def start(self, app: FastAPI) -> None:\n if self._thread is not None and self._thread.is_alive():\n return\n self._error = None\n config = Config(app=app, host=self._host, port=self._port, log_level=\"warning\")\n self._server = Server(config)\n self._thread = Thread(target=self._serve, name=\"plba-http-control\", daemon=True)\n self._thread.start()\n await self._wait_until_started()\n\n async def stop(self) -> None:\n if self._server is None or self._thread is None:\n return\n self._server.should_exit = True\n await asyncio.to_thread(self._thread.join, self._timeout)\n self._server = None\n self._thread = None\n\n @property\n def port(self) -> int:\n if self._server is None or not getattr(self._server, \"servers\", None):\n return self._port\n socket = self._server.servers[0].sockets[0]\n return int(socket.getsockname()[1])\n\n async def _wait_until_started(self) -> None:\n if self._server is None:\n raise RuntimeError(\"Server is not initialized\")\n deadline = asyncio.get_running_loop().time() + max(float(self._timeout), 1.0)\n while not self._server.started:\n if self._error is not None:\n raise RuntimeError(\"HTTP control server failed to start\") from self._error\n if asyncio.get_running_loop().time() >= deadline:\n raise TimeoutError(\"HTTP control server startup timed out\")\n await asyncio.sleep(0.05)\n\n def _serve(self) -> None:\n if self._server is None:\n return\n try:\n asyncio.run(self._server.serve())\n except BaseException as exc: # noqa: BLE001\n self._error = exc", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/http_runner.py:UvicornThreadRunner", - "span_start": 10, - "span_end": 61, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.http_runner", - "is_test": false, - "blob_sha": "3779fdd2878b770e789a35bb2a89c9d79f13b61c26d7db1b3b683f9bb9e1623f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "validation": { - "passed": true, - "action": "return", - "reasons": [] - }, - "steps": [ - { - "step": "router", - "status": "completed", - "timings_ms": { - "router": 1 - }, - "output": { - "intent": "CODE_QA", - "sub_intent": "FIND_ENTRYPOINTS", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - } - }, - { - "step": "retrieval", - "status": "completed", - "timings_ms": { - "retrieval": 35 - }, - "output": { - "rag_count": 9, - "answer_path_rag_count": 9, - "resolved_symbol_status": "not_found", - "resolved_symbol": null, - "requested_layers": [ - "C3_ENTRYPOINTS", - "C0_SOURCE_CHUNKS" - ] - }, - "diagnostics": { - "executed_layers": [ - "C3_ENTRYPOINTS", - "C0_SOURCE_CHUNKS" - ], - "retrieval_mode_by_layer": { - "C3_ENTRYPOINTS": "vector", - "C0_SOURCE_CHUNKS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C3_ENTRYPOINTS": 12, - "C0_SOURCE_CHUNKS": 24 - }, - "filters_by_layer": { - "C3_ENTRYPOINTS": { - "path_scope": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src/app_runtime/control/http_app.py" - ] - } - }, - "fallback": { - "used": false, - "reason": null - }, - "retrieval_by_layer_ms": { - "C3_ENTRYPOINTS": 14, - "C0_SOURCE_CHUNKS": 11 - }, - "supplemental_requests": [ - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Найди точки входа HTTP control plane", - "ranking_profile": "entrypoint_source_hydration" - } - ] - } - }, - { - "step": "pre_evidence_gate", - "status": "passed", - "timings_ms": { - "pre_evidence_gate": 1 - }, - "input": { - "resolved_target": "src/app_runtime/control/http_app.py", - "sub_intent": "FIND_ENTRYPOINTS", - "target_type": "file", - "evidence_count": 9, - "code_chunk_count": 9, - "entrypoint_count": 3, - "relation_count": 0, - "test_evidence_count": 0, - "symbol_resolution_status": "not_found", - "path_scope": [] - }, - "output": { - "passed": true, - "failure_reasons": [], - "degraded_message": "", - "evidence_count": 9 - } - }, - { - "step": "llm", - "status": "completed", - "timings_ms": { - "llm": 3053 - }, - "output": { - "prompt_name": "code_qa_find_entrypoints_answer", - "answer_preview": "Подтверждённые HTTP routes:\n\n1. GET /health — обработчик `health`, объявлен в `src/app_runtime/control/http_app.py`:31-34.\n2. GET /actions/{action} — обработчик `action`, объявлен в `src/app_runtime/control/http_app.py`:38-42.\n3. POST /actions/{action} — обработчик `action`, объявлен в `src/app_runt", - "resolved_target": "src/app_runtime/control/http_app.py", - "answer_policy_branch": "normal_answer", - "decision_reason": "evidence_sufficient" - } - }, - { - "step": "post_evidence_gate", - "status": "passed", - "timings_ms": { - "post_evidence_gate": 1, - "post_evidence_gate_recheck": 0, - "repair": 0 - }, - "input": { - "answer_mode": "normal", - "degraded_message": "", - "resolved_target": "src/app_runtime/control/http_app.py", - "draft_answer_preview": "Подтверждённые HTTP routes:\n\n1. GET /health — обработчик `health`, объявлен в `src/app_runtime/control/http_app.py`:31-34.\n2. GET /actions/{action} — обработчик `action`, объявлен в `src/app_runtime/control/http_app.py`:38-42.\n3. POST /actions/{action} — обработчик `action`, объявлен в `src/app_runt", - "repair_candidate": true - }, - "output": { - "passed": true, - "action": "return", - "reasons": [], - "repair_used": false, - "final_answer_preview": "Подтверждённые HTTP routes:\n\n1. GET /health — обработчик `health`, объявлен в `src/app_runtime/control/http_app.py`:31-34.\n2. GET /actions/{action} — обработчик `action`, объявлен в `src/app_runtime/control/http_app.py`:38-42.\n3. POST /actions/{action} — обработчик `action`, объявлен в `src/app_runt" - } - } - ] - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/plba_full_chain_subintents_v3/20260312_192715/full_chain_plba_code_subintents_v2_plba-v2-find-entrypoints-control-plane.md b/tests/pipeline_setup_v3/test_results/plba_full_chain_subintents_v3/20260312_192715/full_chain_plba_code_subintents_v2_plba-v2-find-entrypoints-control-plane.md deleted file mode 100644 index 25fe93d..0000000 --- a/tests/pipeline_setup_v3/test_results/plba_full_chain_subintents_v3/20260312_192715/full_chain_plba_code_subintents_v2_plba-v2-find-entrypoints-control-plane.md +++ /dev/null @@ -1,262 +0,0 @@ -# plba-v2-find-entrypoints-control-plane - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_02_pipeline/full_chain_plba_code_subintents_v2.yaml -- runner: agent_runtime -- mode: full_chain -- passed: True - -## Query -Найди точки входа HTTP control plane - -## Actual -{ - "intent": "CODE_QA", - "sub_intent": "FIND_ENTRYPOINTS", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 9, - "llm_answer": "Подтверждённые HTTP routes:\n\n1. GET /health — обработчик `health`, объявлен в `src/app_runtime/control/http_app.py`:31-34.\n2. GET /actions/{action} — обработчик `action`, объявлен в `src/app_runtime/control/http_app.py`:38-42.\n3. POST /actions/{action} — обработчик `action`, объявлен в `src/app_runtime/control/http_app.py`:38-42.\n\nКандидаты на входные точки отсутствуют.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "HTTP", - "control", - "plane" - ], - "layers": [ - "C3_ENTRYPOINTS", - "C0_SOURCE_CHUNKS" - ] -} - -## Steps -[ - { - "step": "router", - "status": "completed", - "timings_ms": { - "router": 1 - }, - "output": { - "intent": "CODE_QA", - "sub_intent": "FIND_ENTRYPOINTS", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - } - }, - { - "step": "retrieval", - "status": "completed", - "timings_ms": { - "retrieval": 35 - }, - "output": { - "rag_count": 9, - "answer_path_rag_count": 9, - "resolved_symbol_status": "not_found", - "resolved_symbol": null, - "requested_layers": [ - "C3_ENTRYPOINTS", - "C0_SOURCE_CHUNKS" - ] - }, - "diagnostics": { - "executed_layers": [ - "C3_ENTRYPOINTS", - "C0_SOURCE_CHUNKS" - ], - "retrieval_mode_by_layer": { - "C3_ENTRYPOINTS": "vector", - "C0_SOURCE_CHUNKS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C3_ENTRYPOINTS": 12, - "C0_SOURCE_CHUNKS": 24 - }, - "filters_by_layer": { - "C3_ENTRYPOINTS": { - "path_scope": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src/app_runtime/control/http_app.py" - ] - } - }, - "fallback": { - "used": false, - "reason": null - }, - "retrieval_by_layer_ms": { - "C3_ENTRYPOINTS": 14, - "C0_SOURCE_CHUNKS": 11 - }, - "supplemental_requests": [ - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Найди точки входа HTTP control plane", - "ranking_profile": "entrypoint_source_hydration" - } - ] - } - }, - { - "step": "pre_evidence_gate", - "status": "passed", - "timings_ms": { - "pre_evidence_gate": 1 - }, - "input": { - "resolved_target": "src/app_runtime/control/http_app.py", - "sub_intent": "FIND_ENTRYPOINTS", - "target_type": "file", - "evidence_count": 9, - "code_chunk_count": 9, - "entrypoint_count": 3, - "relation_count": 0, - "test_evidence_count": 0, - "symbol_resolution_status": "not_found", - "path_scope": [] - }, - "output": { - "passed": true, - "failure_reasons": [], - "degraded_message": "", - "evidence_count": 9 - } - }, - { - "step": "llm", - "status": "completed", - "timings_ms": { - "llm": 3053 - }, - "output": { - "prompt_name": "code_qa_find_entrypoints_answer", - "answer_preview": "Подтверждённые HTTP routes:\n\n1. GET /health — обработчик `health`, объявлен в `src/app_runtime/control/http_app.py`:31-34.\n2. GET /actions/{action} — обработчик `action`, объявлен в `src/app_runtime/control/http_app.py`:38-42.\n3. POST /actions/{action} — обработчик `action`, объявлен в `src/app_runt", - "resolved_target": "src/app_runtime/control/http_app.py", - "answer_policy_branch": "normal_answer", - "decision_reason": "evidence_sufficient" - } - }, - { - "step": "post_evidence_gate", - "status": "passed", - "timings_ms": { - "post_evidence_gate": 1, - "post_evidence_gate_recheck": 0, - "repair": 0 - }, - "input": { - "answer_mode": "normal", - "degraded_message": "", - "resolved_target": "src/app_runtime/control/http_app.py", - "draft_answer_preview": "Подтверждённые HTTP routes:\n\n1. GET /health — обработчик `health`, объявлен в `src/app_runtime/control/http_app.py`:31-34.\n2. GET /actions/{action} — обработчик `action`, объявлен в `src/app_runtime/control/http_app.py`:38-42.\n3. POST /actions/{action} — обработчик `action`, объявлен в `src/app_runt", - "repair_candidate": true - }, - "output": { - "passed": true, - "action": "return", - "reasons": [], - "repair_used": false, - "final_answer_preview": "Подтверждённые HTTP routes:\n\n1. GET /health — обработчик `health`, объявлен в `src/app_runtime/control/http_app.py`:31-34.\n2. GET /actions/{action} — обработчик `action`, объявлен в `src/app_runtime/control/http_app.py`:38-42.\n3. POST /actions/{action} — обработчик `action`, объявлен в `src/app_runt" - } - } -] - -## Diagnostics -{ - "intent_correct": null, - "target_found": true, - "layers_used": [ - "C3_ENTRYPOINTS", - "C0_SOURCE_CHUNKS" - ], - "retrieval_sufficient": true, - "answer_mode": "normal", - "resolved_target": "src/app_runtime/control/http_app.py", - "answer_policy_branch": "normal_answer", - "decision_reason": "evidence_sufficient", - "router_result": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "retrieval_profile": "code", - "sub_intent": "FIND_ENTRYPOINTS", - "path_scope": [], - "layers": [ - "C3_ENTRYPOINTS", - "C0_SOURCE_CHUNKS" - ], - "symbol_resolution_status": "not_found" - }, - "retrieval_request": { - "rag_session_id": "7d11da21-faa0-4cea-aede-aeabe069164c", - "query": "Найди точки входа HTTP control plane", - "sub_intent": "FIND_ENTRYPOINTS", - "path_scope": [], - "requested_layers": [ - "C3_ENTRYPOINTS", - "C0_SOURCE_CHUNKS" - ] - }, - "per_layer_outcome": [ - { - "layer_id": "C3_ENTRYPOINTS", - "hit_count": 3, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C0_SOURCE_CHUNKS", - "hit_count": 6, - "empty": false, - "fallback_used": false - } - ], - "empty_layers": [], - "evidence_gate_decision": { - "sufficient": true, - "failure_reasons": [], - "evidence_count": 9 - }, - "evidence_gate_input": { - "resolved_target": "src/app_runtime/control/http_app.py", - "sub_intent": "FIND_ENTRYPOINTS", - "target_type": "file", - "evidence_count": 9, - "code_chunk_count": 9, - "entrypoint_count": 3, - "relation_count": 0, - "test_evidence_count": 0, - "symbol_resolution_status": "not_found", - "path_scope": [] - }, - "post_evidence_gate": { - "input": { - "answer_mode": "normal", - "degraded_message": "", - "resolved_target": "src/app_runtime/control/http_app.py", - "draft_answer_preview": "Подтверждённые HTTP routes:\n\n1. GET /health — обработчик `health`, объявлен в `src/app_runtime/control/http_app.py`:31-34.\n2. GET /actions/{action} — обработчик `action`, объявлен в `src/app_runtime/control/http_app.py`:38-42.\n3. POST /actions/{action} — обработчик `action`, объявлен в `src/app_runt", - "repair_candidate": true - }, - "output": { - "passed": true, - "action": "return", - "reasons": [], - "repair_used": false, - "final_answer_preview": "Подтверждённые HTTP routes:\n\n1. GET /health — обработчик `health`, объявлен в `src/app_runtime/control/http_app.py`:31-34.\n2. GET /actions/{action} — обработчик `action`, объявлен в `src/app_runtime/control/http_app.py`:38-42.\n3. POST /actions/{action} — обработчик `action`, объявлен в `src/app_runt" - } - }, - "failure_reasons": [], - "timings_ms": { - "router": 1, - "retrieval": 35, - "pre_evidence_gate": 1, - "llm": 3053, - "post_evidence_gate": 1 - } -} - -## Mismatches -- none \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/plba_full_chain_subintents_v3/20260312_192715/full_chain_plba_code_subintents_v2_plba-v2-find-entrypoints-health-endpoint.json b/tests/pipeline_setup_v3/test_results/plba_full_chain_subintents_v3/20260312_192715/full_chain_plba_code_subintents_v2_plba-v2-find-entrypoints-health-endpoint.json deleted file mode 100644 index 599a802..0000000 --- a/tests/pipeline_setup_v3/test_results/plba_full_chain_subintents_v3/20260312_192715/full_chain_plba_code_subintents_v2_plba-v2-find-entrypoints-health-endpoint.json +++ /dev/null @@ -1,1554 +0,0 @@ -{ - "case_id": "plba-v2-find-entrypoints-health-endpoint", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_02_pipeline/full_chain_plba_code_subintents_v2.yaml", - "runner": "agent_runtime", - "mode": "full_chain", - "query": "Где health endpoint?", - "actual": { - "intent": "CODE_QA", - "sub_intent": "FIND_ENTRYPOINTS", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 10, - "llm_answer": "Подтверждённая точка входа для health endpoint:\nGET /health, declared in src/app_runtime/control/http_app.py, lines 31-34, handler function named 'health'.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "health", - "endpoint" - ], - "layers": [ - "C3_ENTRYPOINTS", - "C0_SOURCE_CHUNKS" - ] - }, - "passed": true, - "mismatches": [], - "details": { - "query": "Где health endpoint?", - "router_result": { - "schema_version": "1.1", - "intent": "CODE_QA", - "retrieval_profile": "code", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query_plan": { - "raw": "Где health endpoint?", - "normalized": "Где health endpoint?", - "sub_intent": "FIND_ENTRYPOINTS", - "negations": [], - "expansions": [ - "health", - "endpoint" - ], - "keyword_hints": [ - "health", - "endpoint" - ], - "path_hints": [], - "doc_scope_hints": [], - "symbol_candidates": [ - "health", - "endpoint" - ], - "symbol_kind_hint": "unknown", - "anchors": [ - { - "type": "SYMBOL", - "value": "health", - "source": "user_text", - "subtype": null, - "span": { - "start": 4, - "end": 10 - }, - "confidence": 0.88 - }, - { - "type": "SYMBOL", - "value": "endpoint", - "source": "user_text", - "subtype": null, - "span": { - "start": 11, - "end": 19 - }, - "confidence": 0.88 - } - ] - }, - "retrieval_spec": { - "domains": [ - "CODE" - ], - "layer_queries": [ - { - "layer_id": "C3_ENTRYPOINTS", - "top_k": 12 - }, - { - "layer_id": "C0_SOURCE_CHUNKS", - "top_k": 6 - } - ], - "filters": { - "test_policy": "EXCLUDE", - "path_scope": [], - "language": [ - "python" - ] - }, - "rerank_profile": "code" - }, - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - }, - "symbol_resolution": { - "status": "not_found", - "resolved_symbol": null, - "alternatives": [], - "confidence": 0.0 - }, - "evidence_policy": { - "require_def": true, - "require_flow": true, - "require_spec": false, - "allow_answer_without_evidence": false - } - }, - "retrieval_request": { - "rag_session_id": "7d11da21-faa0-4cea-aede-aeabe069164c", - "query": "Где health endpoint?", - "sub_intent": "FIND_ENTRYPOINTS", - "path_scope": [], - "keyword_hints": [ - "health", - "endpoint" - ], - "symbol_candidates": [ - "health", - "endpoint" - ], - "requested_layers": [ - "C3_ENTRYPOINTS", - "C0_SOURCE_CHUNKS" - ], - "retrieval_spec": { - "domains": [ - "CODE" - ], - "layer_queries": [ - { - "layer_id": "C3_ENTRYPOINTS", - "top_k": 12 - }, - { - "layer_id": "C0_SOURCE_CHUNKS", - "top_k": 6 - } - ], - "filters": { - "test_policy": "EXCLUDE", - "path_scope": [], - "language": [ - "python" - ] - }, - "rerank_profile": "code" - }, - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - }, - "query_plan": { - "raw": "Где health endpoint?", - "normalized": "Где health endpoint?", - "sub_intent": "FIND_ENTRYPOINTS", - "negations": [], - "expansions": [ - "health", - "endpoint" - ], - "keyword_hints": [ - "health", - "endpoint" - ], - "path_hints": [], - "doc_scope_hints": [], - "symbol_candidates": [ - "health", - "endpoint" - ], - "symbol_kind_hint": "unknown", - "anchors": [ - { - "type": "SYMBOL", - "value": "health", - "source": "user_text", - "subtype": null, - "span": { - "start": 4, - "end": 10 - }, - "confidence": 0.88 - }, - { - "type": "SYMBOL", - "value": "endpoint", - "source": "user_text", - "subtype": null, - "span": { - "start": 11, - "end": 19 - }, - "confidence": 0.88 - } - ] - } - }, - "retrieval_result": { - "target_symbol_candidates": [], - "resolved_symbol": null, - "symbol_resolution_status": "not_found", - "file_candidates": [ - "src/app_runtime/control/http_app.py", - "src/app_runtime/health/registry.py", - "src/plba/health.py", - "src/app_runtime/contracts/health.py", - "src/app_runtime/health/__init__.py", - "src/app_runtime/contracts/worker.py" - ], - "code_chunks": [ - { - "layer": "C3_ENTRYPOINTS", - "path": "src/app_runtime/control/http_app.py", - "title": "app.post", - "content": "fastapi http app.post", - "start_line": 38, - "end_line": 42, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C3_ENTRYPOINTS", - "path": "src/app_runtime/control/http_app.py", - "title": "app.get", - "content": "fastapi http app.get", - "start_line": 31, - "end_line": 34, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C3_ENTRYPOINTS", - "path": "src/app_runtime/control/http_app.py", - "title": "app.get", - "content": "fastapi http app.get", - "start_line": 38, - "end_line": 42, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C0_SOURCE_CHUNKS", - "path": "src/app_runtime/health/registry.py", - "title": "src/app_runtime/health/registry.py:HealthRegistry", - "content": "class HealthRegistry:\n def __init__(self) -> None:\n self._contributors: list[HealthContributor] = []\n\n def register(self, contributor: HealthContributor) -> None:\n self._contributors.append(contributor)\n\n def contributor_healths(self) -> list[WorkerHealth]:\n return [contributor.health() for contributor in self._contributors]\n\n def snapshot(self, worker_healths: list[WorkerHealth]) -> dict[str, object]:\n component_healths = worker_healths + self.contributor_healths()\n return {\n \"status\": self._aggregate_status(component_healths),\n \"components\": [self._health_dict(item) for item in component_healths],\n }\n\n def payload(self, state: LifecycleState, worker_healths: list[WorkerHealth]) -> HealthPayload:\n component_healths = worker_healths + self.contributor_healths()\n if state == LifecycleState.STOPPED:\n return {\"status\": \"unhealthy\", \"detail\": \"state=stopped\", \"state\": state.value}\n if state in {LifecycleState.STARTING, LifecycleState.STOPPING}:\n return {\n \"status\": \"degraded\",\n \"detail\": f\"state={state.value}\",\n \"state\": state.value,\n \"components\": [self._health_dict(item) for item in component_healths],\n }\n return {\n \"status\": self._aggregate_status(component_healths),\n \"state\": state.value,\n \"components\": [self._health_dict(item) for item in component_healths],\n }\n\n def _aggregate_status(self, component_healths: list[WorkerHealth]) -> str:\n if any(item.status == \"unhealthy\" and item.critical for item in component_healths):\n return \"unhealthy\"\n if any(item.status in {\"degraded\", \"unhealthy\"} for item in component_healths):\n return \"degraded\"\n return \"ok\"\n\n def _health_dict(self, health: WorkerHealth) -> dict[str, object]:\n return {\n \"name\": health.name,\n \"status\": health.status,\n \"critical\": health.critical,\n \"detail\": health.detail,\n \"meta\": health.meta,\n }", - "start_line": 8, - "end_line": 56, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.health.registry", - "is_test": false, - "blob_sha": "26e6a24daa43407ba5340b74497c20153020e79f8d7828ae502aaec378dfcf75", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C0_SOURCE_CHUNKS", - "path": "src/plba/health.py", - "title": "src/app_runtime/health/__init__.py:1-3", - "content": "from app_runtime.health.registry import HealthRegistry\n\n__all__ = [\"HealthRegistry\"]", - "start_line": 1, - "end_line": 3, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.app_runtime.health.__init__", - "is_test": false, - "blob_sha": "f7b15eed8b1f1cca8dfd467909a2612d8cb4e66e46b972ad89a0c9459ce283a0", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C0_SOURCE_CHUNKS", - "path": "src/app_runtime/contracts/health.py", - "title": "src/app_runtime/contracts/health.py:HealthContributor", - "content": "class HealthContributor(ABC):\n @abstractmethod\n def health(self) -> WorkerHealth:\n \"\"\"Return contributor health state.\"\"\"", - "start_line": 7, - "end_line": 10, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.contracts.health", - "is_test": false, - "blob_sha": "6bd92611def7131e32d4dd34a8ed85e6cf3c67722ad27797032a632cb30dc097", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C0_SOURCE_CHUNKS", - "path": "src/app_runtime/health/__init__.py", - "title": "src/app_runtime/health/__init__.py:1-3", - "content": "from app_runtime.health.registry import HealthRegistry\n\n__all__ = [\"HealthRegistry\"]", - "start_line": 1, - "end_line": 3, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.app_runtime.health.__init__", - "is_test": false, - "blob_sha": "f7b15eed8b1f1cca8dfd467909a2612d8cb4e66e46b972ad89a0c9459ce283a0", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C0_SOURCE_CHUNKS", - "path": "src/app_runtime/contracts/worker.py", - "title": "src/app_runtime/contracts/worker.py:WorkerHealth", - "content": "class WorkerHealth:\n name: str\n status: HealthState\n critical: bool\n detail: str | None = None\n meta: dict[str, Any] = field(default_factory=dict)", - "start_line": 13, - "end_line": 18, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.contracts.worker", - "is_test": false, - "blob_sha": "e4827d32220f322d8adc3e42769da3ca0cc680db6a5eab7a11f4d8773a75304e", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C0_SOURCE_CHUNKS", - "path": "src/app_runtime/contracts/worker.py", - "title": "src/app_runtime/contracts/worker.py:Worker", - "content": "class Worker(ABC):\n @property\n @abstractmethod\n def name(self) -> str:\n \"\"\"Stable worker name for diagnostics.\"\"\"\n\n @property\n @abstractmethod\n def critical(self) -> bool:\n \"\"\"Whether this worker is required for healthy app operation.\"\"\"\n\n @abstractmethod\n def start(self) -> None:\n \"\"\"Start worker execution.\"\"\"\n\n @abstractmethod\n def stop(self, force: bool = False) -> None:\n \"\"\"Request graceful or immediate stop.\"\"\"\n\n @abstractmethod\n def health(self) -> WorkerHealth:\n \"\"\"Return current health state.\"\"\"\n\n @abstractmethod\n def status(self) -> WorkerStatus:\n \"\"\"Return current runtime status.\"\"\"", - "start_line": 30, - "end_line": 55, - "metadata": { - "chunk_index": 2, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.contracts.worker", - "is_test": false, - "blob_sha": "e4827d32220f322d8adc3e42769da3ca0cc680db6a5eab7a11f4d8773a75304e", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C0_SOURCE_CHUNKS", - "path": "src/app_runtime/control/http_app.py", - "title": "src/app_runtime/control/http_app.py:HttpControlAppFactory", - "content": "class HttpControlAppFactory:\n def create(\n self,\n health_provider: Callable[[], Awaitable[HealthPayload]],\n action_provider: Callable[[str, str], Awaitable[JSONResponse]],\n ) -> FastAPI:\n app = FastAPI(title=\"PLBA Control API\")\n\n @app.middleware(\"http\")\n async def log_api_call(request: Request, call_next): # type: ignore[no-untyped-def]\n started = time.monotonic()\n response = await call_next(request)\n response.headers[\"X-Response-Time-Ms\"] = str(int((time.monotonic() - started) * 1000))\n return response\n\n @app.get(\"/health\")\n async def health() -> JSONResponse:\n payload = await health_provider()\n status_code = 200 if payload.get(\"status\") == \"ok\" else 503\n return JSONResponse(content=payload, status_code=status_code)\n\n @app.get(\"/actions/{action}\")\n @app.post(\"/actions/{action}\")\n async def action(action: str, request: Request) -> JSONResponse:\n client_source = self._client_source(request)\n if action in {\"start\", \"stop\"}:\n LOGGER.warning(\"Control action requested: /actions/%s client=%s\", action, client_source)\n return await action_provider(action, client_source)\n\n return app\n\n def _client_source(self, request: Request) -> str:\n explicit_header = request.headers.get(\"X-Client-Source\", \"\").strip()\n if explicit_header:\n return explicit_header\n user_agent = request.headers.get(\"User-Agent\", \"\").strip()\n if user_agent:\n return f\"user-agent:{user_agent}\"\n return \"unknown\"", - "start_line": 15, - "end_line": 53, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.http_app", - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "relations": [], - "semantic_hints": [], - "entrypoints": [ - { - "path": "src/app_runtime/control/http_app.py", - "title": "app.get", - "start_line": 31, - "end_line": 34, - "http_method": "GET", - "route_path": "/health", - "handler_symbol": "health", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "route_or_command": "app.get", - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "title": "app.get", - "start_line": 38, - "end_line": 42, - "http_method": "GET", - "route_path": "/actions/{action}", - "handler_symbol": "action", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "route_or_command": "app.get", - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "title": "app.post", - "start_line": 38, - "end_line": 42, - "http_method": "POST", - "route_path": "/actions/{action}", - "handler_symbol": "action", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "route_or_command": "app.post", - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "test_candidates": [], - "layer_outcomes": [ - { - "layer_id": "C3_ENTRYPOINTS", - "hit_count": 3, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C0_SOURCE_CHUNKS", - "hit_count": 7, - "empty": false, - "fallback_used": false - } - ], - "missing_layers": [], - "raw_rows": [ - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": null, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": null, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": null, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/health/registry.py", - "content": "class HealthRegistry:\n def __init__(self) -> None:\n self._contributors: list[HealthContributor] = []\n\n def register(self, contributor: HealthContributor) -> None:\n self._contributors.append(contributor)\n\n def contributor_healths(self) -> list[WorkerHealth]:\n return [contributor.health() for contributor in self._contributors]\n\n def snapshot(self, worker_healths: list[WorkerHealth]) -> dict[str, object]:\n component_healths = worker_healths + self.contributor_healths()\n return {\n \"status\": self._aggregate_status(component_healths),\n \"components\": [self._health_dict(item) for item in component_healths],\n }\n\n def payload(self, state: LifecycleState, worker_healths: list[WorkerHealth]) -> HealthPayload:\n component_healths = worker_healths + self.contributor_healths()\n if state == LifecycleState.STOPPED:\n return {\"status\": \"unhealthy\", \"detail\": \"state=stopped\", \"state\": state.value}\n if state in {LifecycleState.STARTING, LifecycleState.STOPPING}:\n return {\n \"status\": \"degraded\",\n \"detail\": f\"state={state.value}\",\n \"state\": state.value,\n \"components\": [self._health_dict(item) for item in component_healths],\n }\n return {\n \"status\": self._aggregate_status(component_healths),\n \"state\": state.value,\n \"components\": [self._health_dict(item) for item in component_healths],\n }\n\n def _aggregate_status(self, component_healths: list[WorkerHealth]) -> str:\n if any(item.status == \"unhealthy\" and item.critical for item in component_healths):\n return \"unhealthy\"\n if any(item.status in {\"degraded\", \"unhealthy\"} for item in component_healths):\n return \"degraded\"\n return \"ok\"\n\n def _health_dict(self, health: WorkerHealth) -> dict[str, object]:\n return {\n \"name\": health.name,\n \"status\": health.status,\n \"critical\": health.critical,\n \"detail\": health.detail,\n \"meta\": health.meta,\n }", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/health/registry.py:HealthRegistry", - "span_start": 8, - "span_end": 56, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": null, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.health.registry", - "is_test": false, - "blob_sha": "26e6a24daa43407ba5340b74497c20153020e79f8d7828ae502aaec378dfcf75", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/health.py", - "content": "from app_runtime.health.registry import HealthRegistry\n\n__all__ = [\"HealthRegistry\"]", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/health/__init__.py:1-3", - "span_start": 1, - "span_end": 3, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": null, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.app_runtime.health.__init__", - "is_test": false, - "blob_sha": "f7b15eed8b1f1cca8dfd467909a2612d8cb4e66e46b972ad89a0c9459ce283a0", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/contracts/health.py", - "content": "class HealthContributor(ABC):\n @abstractmethod\n def health(self) -> WorkerHealth:\n \"\"\"Return contributor health state.\"\"\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/contracts/health.py:HealthContributor", - "span_start": 7, - "span_end": 10, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": null, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.contracts.health", - "is_test": false, - "blob_sha": "6bd92611def7131e32d4dd34a8ed85e6cf3c67722ad27797032a632cb30dc097", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/health/__init__.py", - "content": "from app_runtime.health.registry import HealthRegistry\n\n__all__ = [\"HealthRegistry\"]", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/health/__init__.py:1-3", - "span_start": 1, - "span_end": 3, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": null, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.app_runtime.health.__init__", - "is_test": false, - "blob_sha": "f7b15eed8b1f1cca8dfd467909a2612d8cb4e66e46b972ad89a0c9459ce283a0", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/contracts/worker.py", - "content": "class WorkerHealth:\n name: str\n status: HealthState\n critical: bool\n detail: str | None = None\n meta: dict[str, Any] = field(default_factory=dict)", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/contracts/worker.py:WorkerHealth", - "span_start": 13, - "span_end": 18, - "lexical_rank": 6, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": null, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.contracts.worker", - "is_test": false, - "blob_sha": "e4827d32220f322d8adc3e42769da3ca0cc680db6a5eab7a11f4d8773a75304e", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/contracts/worker.py", - "content": "class Worker(ABC):\n @property\n @abstractmethod\n def name(self) -> str:\n \"\"\"Stable worker name for diagnostics.\"\"\"\n\n @property\n @abstractmethod\n def critical(self) -> bool:\n \"\"\"Whether this worker is required for healthy app operation.\"\"\"\n\n @abstractmethod\n def start(self) -> None:\n \"\"\"Start worker execution.\"\"\"\n\n @abstractmethod\n def stop(self, force: bool = False) -> None:\n \"\"\"Request graceful or immediate stop.\"\"\"\n\n @abstractmethod\n def health(self) -> WorkerHealth:\n \"\"\"Return current health state.\"\"\"\n\n @abstractmethod\n def status(self) -> WorkerStatus:\n \"\"\"Return current runtime status.\"\"\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/contracts/worker.py:Worker", - "span_start": 30, - "span_end": 55, - "lexical_rank": 6, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": null, - "metadata": { - "chunk_index": 2, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.contracts.worker", - "is_test": false, - "blob_sha": "e4827d32220f322d8adc3e42769da3ca0cc680db6a5eab7a11f4d8773a75304e", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "class HttpControlAppFactory:\n def create(\n self,\n health_provider: Callable[[], Awaitable[HealthPayload]],\n action_provider: Callable[[str, str], Awaitable[JSONResponse]],\n ) -> FastAPI:\n app = FastAPI(title=\"PLBA Control API\")\n\n @app.middleware(\"http\")\n async def log_api_call(request: Request, call_next): # type: ignore[no-untyped-def]\n started = time.monotonic()\n response = await call_next(request)\n response.headers[\"X-Response-Time-Ms\"] = str(int((time.monotonic() - started) * 1000))\n return response\n\n @app.get(\"/health\")\n async def health() -> JSONResponse:\n payload = await health_provider()\n status_code = 200 if payload.get(\"status\") == \"ok\" else 503\n return JSONResponse(content=payload, status_code=status_code)\n\n @app.get(\"/actions/{action}\")\n @app.post(\"/actions/{action}\")\n async def action(action: str, request: Request) -> JSONResponse:\n client_source = self._client_source(request)\n if action in {\"start\", \"stop\"}:\n LOGGER.warning(\"Control action requested: /actions/%s client=%s\", action, client_source)\n return await action_provider(action, client_source)\n\n return app\n\n def _client_source(self, request: Request) -> str:\n explicit_header = request.headers.get(\"X-Client-Source\", \"\").strip()\n if explicit_header:\n return explicit_header\n user_agent = request.headers.get(\"User-Agent\", \"\").strip()\n if user_agent:\n return f\"user-agent:{user_agent}\"\n return \"unknown\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/http_app.py:HttpControlAppFactory", - "span_start": 15, - "span_end": 53, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.http_app", - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "retrieval_report": { - "executed_layers": [ - "C3_ENTRYPOINTS", - "C0_SOURCE_CHUNKS" - ], - "retrieval_mode_by_layer": { - "C3_ENTRYPOINTS": "vector", - "C0_SOURCE_CHUNKS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C3_ENTRYPOINTS": 12, - "C0_SOURCE_CHUNKS": 24 - }, - "filters_by_layer": { - "C3_ENTRYPOINTS": { - "path_scope": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src/app_runtime/control/http_app.py" - ] - } - }, - "fallback": { - "used": false, - "reason": null - }, - "retrieval_by_layer_ms": { - "C3_ENTRYPOINTS": 64, - "C0_SOURCE_CHUNKS": 17 - }, - "supplemental_requests": [ - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Где health endpoint?", - "ranking_profile": "entrypoint_source_hydration" - } - ] - } - }, - "diagnostics": { - "intent_correct": null, - "target_found": true, - "layers_used": [ - "C3_ENTRYPOINTS", - "C0_SOURCE_CHUNKS" - ], - "retrieval_sufficient": true, - "answer_mode": "normal", - "resolved_target": "src/app_runtime/control/http_app.py", - "answer_policy_branch": "normal_answer", - "decision_reason": "evidence_sufficient", - "router_result": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "retrieval_profile": "code", - "sub_intent": "FIND_ENTRYPOINTS", - "path_scope": [], - "layers": [ - "C3_ENTRYPOINTS", - "C0_SOURCE_CHUNKS" - ], - "symbol_resolution_status": "not_found" - }, - "retrieval_request": { - "rag_session_id": "7d11da21-faa0-4cea-aede-aeabe069164c", - "query": "Где health endpoint?", - "sub_intent": "FIND_ENTRYPOINTS", - "path_scope": [], - "requested_layers": [ - "C3_ENTRYPOINTS", - "C0_SOURCE_CHUNKS" - ] - }, - "per_layer_outcome": [ - { - "layer_id": "C3_ENTRYPOINTS", - "hit_count": 3, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C0_SOURCE_CHUNKS", - "hit_count": 7, - "empty": false, - "fallback_used": false - } - ], - "empty_layers": [], - "evidence_gate_decision": { - "sufficient": true, - "failure_reasons": [], - "evidence_count": 10 - }, - "evidence_gate_input": { - "resolved_target": "src/app_runtime/control/http_app.py", - "sub_intent": "FIND_ENTRYPOINTS", - "target_type": "file", - "evidence_count": 10, - "code_chunk_count": 10, - "entrypoint_count": 3, - "relation_count": 0, - "test_evidence_count": 0, - "symbol_resolution_status": "not_found", - "path_scope": [] - }, - "post_evidence_gate": { - "input": { - "answer_mode": "normal", - "degraded_message": "", - "resolved_target": "src/app_runtime/control/http_app.py", - "draft_answer_preview": "Подтверждённая точка входа для health endpoint:\nGET /health, declared in src/app_runtime/control/http_app.py, lines 31-34, handler function named 'health'.", - "repair_candidate": true - }, - "output": { - "passed": true, - "action": "return", - "reasons": [], - "repair_used": false, - "final_answer_preview": "Подтверждённая точка входа для health endpoint:\nGET /health, declared in src/app_runtime/control/http_app.py, lines 31-34, handler function named 'health'." - } - }, - "failure_reasons": [], - "timings_ms": { - "router": 1, - "retrieval": 96, - "pre_evidence_gate": 1, - "llm": 1485, - "post_evidence_gate": 1 - } - }, - "rag_rows": [ - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/health/registry.py", - "content": "class HealthRegistry:\n def __init__(self) -> None:\n self._contributors: list[HealthContributor] = []\n\n def register(self, contributor: HealthContributor) -> None:\n self._contributors.append(contributor)\n\n def contributor_healths(self) -> list[WorkerHealth]:\n return [contributor.health() for contributor in self._contributors]\n\n def snapshot(self, worker_healths: list[WorkerHealth]) -> dict[str, object]:\n component_healths = worker_healths + self.contributor_healths()\n return {\n \"status\": self._aggregate_status(component_healths),\n \"components\": [self._health_dict(item) for item in component_healths],\n }\n\n def payload(self, state: LifecycleState, worker_healths: list[WorkerHealth]) -> HealthPayload:\n component_healths = worker_healths + self.contributor_healths()\n if state == LifecycleState.STOPPED:\n return {\"status\": \"unhealthy\", \"detail\": \"state=stopped\", \"state\": state.value}\n if state in {LifecycleState.STARTING, LifecycleState.STOPPING}:\n return {\n \"status\": \"degraded\",\n \"detail\": f\"state={state.value}\",\n \"state\": state.value,\n \"components\": [self._health_dict(item) for item in component_healths],\n }\n return {\n \"status\": self._aggregate_status(component_healths),\n \"state\": state.value,\n \"components\": [self._health_dict(item) for item in component_healths],\n }\n\n def _aggregate_status(self, component_healths: list[WorkerHealth]) -> str:\n if any(item.status == \"unhealthy\" and item.critical for item in component_healths):\n return \"unhealthy\"\n if any(item.status in {\"degraded\", \"unhealthy\"} for item in component_healths):\n return \"degraded\"\n return \"ok\"\n\n def _health_dict(self, health: WorkerHealth) -> dict[str, object]:\n return {\n \"name\": health.name,\n \"status\": health.status,\n \"critical\": health.critical,\n \"detail\": health.detail,\n \"meta\": health.meta,\n }", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/health/registry.py:HealthRegistry", - "span_start": 8, - "span_end": 56, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.health.registry", - "is_test": false, - "blob_sha": "26e6a24daa43407ba5340b74497c20153020e79f8d7828ae502aaec378dfcf75", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/health.py", - "content": "from app_runtime.health.registry import HealthRegistry\n\n__all__ = [\"HealthRegistry\"]", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/health/__init__.py:1-3", - "span_start": 1, - "span_end": 3, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.app_runtime.health.__init__", - "is_test": false, - "blob_sha": "f7b15eed8b1f1cca8dfd467909a2612d8cb4e66e46b972ad89a0c9459ce283a0", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/contracts/health.py", - "content": "class HealthContributor(ABC):\n @abstractmethod\n def health(self) -> WorkerHealth:\n \"\"\"Return contributor health state.\"\"\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/contracts/health.py:HealthContributor", - "span_start": 7, - "span_end": 10, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.contracts.health", - "is_test": false, - "blob_sha": "6bd92611def7131e32d4dd34a8ed85e6cf3c67722ad27797032a632cb30dc097", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/health/__init__.py", - "content": "from app_runtime.health.registry import HealthRegistry\n\n__all__ = [\"HealthRegistry\"]", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/health/__init__.py:1-3", - "span_start": 1, - "span_end": 3, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.app_runtime.health.__init__", - "is_test": false, - "blob_sha": "f7b15eed8b1f1cca8dfd467909a2612d8cb4e66e46b972ad89a0c9459ce283a0", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/contracts/worker.py", - "content": "class WorkerHealth:\n name: str\n status: HealthState\n critical: bool\n detail: str | None = None\n meta: dict[str, Any] = field(default_factory=dict)", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/contracts/worker.py:WorkerHealth", - "span_start": 13, - "span_end": 18, - "lexical_rank": 6, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.contracts.worker", - "is_test": false, - "blob_sha": "e4827d32220f322d8adc3e42769da3ca0cc680db6a5eab7a11f4d8773a75304e", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/contracts/worker.py", - "content": "class Worker(ABC):\n @property\n @abstractmethod\n def name(self) -> str:\n \"\"\"Stable worker name for diagnostics.\"\"\"\n\n @property\n @abstractmethod\n def critical(self) -> bool:\n \"\"\"Whether this worker is required for healthy app operation.\"\"\"\n\n @abstractmethod\n def start(self) -> None:\n \"\"\"Start worker execution.\"\"\"\n\n @abstractmethod\n def stop(self, force: bool = False) -> None:\n \"\"\"Request graceful or immediate stop.\"\"\"\n\n @abstractmethod\n def health(self) -> WorkerHealth:\n \"\"\"Return current health state.\"\"\"\n\n @abstractmethod\n def status(self) -> WorkerStatus:\n \"\"\"Return current runtime status.\"\"\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/contracts/worker.py:Worker", - "span_start": 30, - "span_end": 55, - "lexical_rank": 6, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 2, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.contracts.worker", - "is_test": false, - "blob_sha": "e4827d32220f322d8adc3e42769da3ca0cc680db6a5eab7a11f4d8773a75304e", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "class HttpControlAppFactory:\n def create(\n self,\n health_provider: Callable[[], Awaitable[HealthPayload]],\n action_provider: Callable[[str, str], Awaitable[JSONResponse]],\n ) -> FastAPI:\n app = FastAPI(title=\"PLBA Control API\")\n\n @app.middleware(\"http\")\n async def log_api_call(request: Request, call_next): # type: ignore[no-untyped-def]\n started = time.monotonic()\n response = await call_next(request)\n response.headers[\"X-Response-Time-Ms\"] = str(int((time.monotonic() - started) * 1000))\n return response\n\n @app.get(\"/health\")\n async def health() -> JSONResponse:\n payload = await health_provider()\n status_code = 200 if payload.get(\"status\") == \"ok\" else 503\n return JSONResponse(content=payload, status_code=status_code)\n\n @app.get(\"/actions/{action}\")\n @app.post(\"/actions/{action}\")\n async def action(action: str, request: Request) -> JSONResponse:\n client_source = self._client_source(request)\n if action in {\"start\", \"stop\"}:\n LOGGER.warning(\"Control action requested: /actions/%s client=%s\", action, client_source)\n return await action_provider(action, client_source)\n\n return app\n\n def _client_source(self, request: Request) -> str:\n explicit_header = request.headers.get(\"X-Client-Source\", \"\").strip()\n if explicit_header:\n return explicit_header\n user_agent = request.headers.get(\"User-Agent\", \"\").strip()\n if user_agent:\n return f\"user-agent:{user_agent}\"\n return \"unknown\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/http_app.py:HttpControlAppFactory", - "span_start": 15, - "span_end": 53, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.http_app", - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "validation": { - "passed": true, - "action": "return", - "reasons": [] - }, - "steps": [ - { - "step": "router", - "status": "completed", - "timings_ms": { - "router": 1 - }, - "output": { - "intent": "CODE_QA", - "sub_intent": "FIND_ENTRYPOINTS", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - } - }, - { - "step": "retrieval", - "status": "completed", - "timings_ms": { - "retrieval": 96 - }, - "output": { - "rag_count": 10, - "answer_path_rag_count": 10, - "resolved_symbol_status": "not_found", - "resolved_symbol": null, - "requested_layers": [ - "C3_ENTRYPOINTS", - "C0_SOURCE_CHUNKS" - ] - }, - "diagnostics": { - "executed_layers": [ - "C3_ENTRYPOINTS", - "C0_SOURCE_CHUNKS" - ], - "retrieval_mode_by_layer": { - "C3_ENTRYPOINTS": "vector", - "C0_SOURCE_CHUNKS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C3_ENTRYPOINTS": 12, - "C0_SOURCE_CHUNKS": 24 - }, - "filters_by_layer": { - "C3_ENTRYPOINTS": { - "path_scope": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src/app_runtime/control/http_app.py" - ] - } - }, - "fallback": { - "used": false, - "reason": null - }, - "retrieval_by_layer_ms": { - "C3_ENTRYPOINTS": 64, - "C0_SOURCE_CHUNKS": 17 - }, - "supplemental_requests": [ - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Где health endpoint?", - "ranking_profile": "entrypoint_source_hydration" - } - ] - } - }, - { - "step": "pre_evidence_gate", - "status": "passed", - "timings_ms": { - "pre_evidence_gate": 1 - }, - "input": { - "resolved_target": "src/app_runtime/control/http_app.py", - "sub_intent": "FIND_ENTRYPOINTS", - "target_type": "file", - "evidence_count": 10, - "code_chunk_count": 10, - "entrypoint_count": 3, - "relation_count": 0, - "test_evidence_count": 0, - "symbol_resolution_status": "not_found", - "path_scope": [] - }, - "output": { - "passed": true, - "failure_reasons": [], - "degraded_message": "", - "evidence_count": 10 - } - }, - { - "step": "llm", - "status": "completed", - "timings_ms": { - "llm": 1485 - }, - "output": { - "prompt_name": "code_qa_find_entrypoints_answer", - "answer_preview": "Подтверждённая точка входа для health endpoint:\nGET /health, declared in src/app_runtime/control/http_app.py, lines 31-34, handler function named 'health'.", - "resolved_target": "src/app_runtime/control/http_app.py", - "answer_policy_branch": "normal_answer", - "decision_reason": "evidence_sufficient" - } - }, - { - "step": "post_evidence_gate", - "status": "passed", - "timings_ms": { - "post_evidence_gate": 1, - "post_evidence_gate_recheck": 0, - "repair": 0 - }, - "input": { - "answer_mode": "normal", - "degraded_message": "", - "resolved_target": "src/app_runtime/control/http_app.py", - "draft_answer_preview": "Подтверждённая точка входа для health endpoint:\nGET /health, declared in src/app_runtime/control/http_app.py, lines 31-34, handler function named 'health'.", - "repair_candidate": true - }, - "output": { - "passed": true, - "action": "return", - "reasons": [], - "repair_used": false, - "final_answer_preview": "Подтверждённая точка входа для health endpoint:\nGET /health, declared in src/app_runtime/control/http_app.py, lines 31-34, handler function named 'health'." - } - } - ] - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/plba_full_chain_subintents_v3/20260312_192715/full_chain_plba_code_subintents_v2_plba-v2-find-entrypoints-health-endpoint.md b/tests/pipeline_setup_v3/test_results/plba_full_chain_subintents_v3/20260312_192715/full_chain_plba_code_subintents_v2_plba-v2-find-entrypoints-health-endpoint.md deleted file mode 100644 index bde801c..0000000 --- a/tests/pipeline_setup_v3/test_results/plba_full_chain_subintents_v3/20260312_192715/full_chain_plba_code_subintents_v2_plba-v2-find-entrypoints-health-endpoint.md +++ /dev/null @@ -1,261 +0,0 @@ -# plba-v2-find-entrypoints-health-endpoint - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_02_pipeline/full_chain_plba_code_subintents_v2.yaml -- runner: agent_runtime -- mode: full_chain -- passed: True - -## Query -Где health endpoint? - -## Actual -{ - "intent": "CODE_QA", - "sub_intent": "FIND_ENTRYPOINTS", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 10, - "llm_answer": "Подтверждённая точка входа для health endpoint:\nGET /health, declared in src/app_runtime/control/http_app.py, lines 31-34, handler function named 'health'.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "health", - "endpoint" - ], - "layers": [ - "C3_ENTRYPOINTS", - "C0_SOURCE_CHUNKS" - ] -} - -## Steps -[ - { - "step": "router", - "status": "completed", - "timings_ms": { - "router": 1 - }, - "output": { - "intent": "CODE_QA", - "sub_intent": "FIND_ENTRYPOINTS", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - } - }, - { - "step": "retrieval", - "status": "completed", - "timings_ms": { - "retrieval": 96 - }, - "output": { - "rag_count": 10, - "answer_path_rag_count": 10, - "resolved_symbol_status": "not_found", - "resolved_symbol": null, - "requested_layers": [ - "C3_ENTRYPOINTS", - "C0_SOURCE_CHUNKS" - ] - }, - "diagnostics": { - "executed_layers": [ - "C3_ENTRYPOINTS", - "C0_SOURCE_CHUNKS" - ], - "retrieval_mode_by_layer": { - "C3_ENTRYPOINTS": "vector", - "C0_SOURCE_CHUNKS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C3_ENTRYPOINTS": 12, - "C0_SOURCE_CHUNKS": 24 - }, - "filters_by_layer": { - "C3_ENTRYPOINTS": { - "path_scope": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src/app_runtime/control/http_app.py" - ] - } - }, - "fallback": { - "used": false, - "reason": null - }, - "retrieval_by_layer_ms": { - "C3_ENTRYPOINTS": 64, - "C0_SOURCE_CHUNKS": 17 - }, - "supplemental_requests": [ - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Где health endpoint?", - "ranking_profile": "entrypoint_source_hydration" - } - ] - } - }, - { - "step": "pre_evidence_gate", - "status": "passed", - "timings_ms": { - "pre_evidence_gate": 1 - }, - "input": { - "resolved_target": "src/app_runtime/control/http_app.py", - "sub_intent": "FIND_ENTRYPOINTS", - "target_type": "file", - "evidence_count": 10, - "code_chunk_count": 10, - "entrypoint_count": 3, - "relation_count": 0, - "test_evidence_count": 0, - "symbol_resolution_status": "not_found", - "path_scope": [] - }, - "output": { - "passed": true, - "failure_reasons": [], - "degraded_message": "", - "evidence_count": 10 - } - }, - { - "step": "llm", - "status": "completed", - "timings_ms": { - "llm": 1485 - }, - "output": { - "prompt_name": "code_qa_find_entrypoints_answer", - "answer_preview": "Подтверждённая точка входа для health endpoint:\nGET /health, declared in src/app_runtime/control/http_app.py, lines 31-34, handler function named 'health'.", - "resolved_target": "src/app_runtime/control/http_app.py", - "answer_policy_branch": "normal_answer", - "decision_reason": "evidence_sufficient" - } - }, - { - "step": "post_evidence_gate", - "status": "passed", - "timings_ms": { - "post_evidence_gate": 1, - "post_evidence_gate_recheck": 0, - "repair": 0 - }, - "input": { - "answer_mode": "normal", - "degraded_message": "", - "resolved_target": "src/app_runtime/control/http_app.py", - "draft_answer_preview": "Подтверждённая точка входа для health endpoint:\nGET /health, declared in src/app_runtime/control/http_app.py, lines 31-34, handler function named 'health'.", - "repair_candidate": true - }, - "output": { - "passed": true, - "action": "return", - "reasons": [], - "repair_used": false, - "final_answer_preview": "Подтверждённая точка входа для health endpoint:\nGET /health, declared in src/app_runtime/control/http_app.py, lines 31-34, handler function named 'health'." - } - } -] - -## Diagnostics -{ - "intent_correct": null, - "target_found": true, - "layers_used": [ - "C3_ENTRYPOINTS", - "C0_SOURCE_CHUNKS" - ], - "retrieval_sufficient": true, - "answer_mode": "normal", - "resolved_target": "src/app_runtime/control/http_app.py", - "answer_policy_branch": "normal_answer", - "decision_reason": "evidence_sufficient", - "router_result": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "retrieval_profile": "code", - "sub_intent": "FIND_ENTRYPOINTS", - "path_scope": [], - "layers": [ - "C3_ENTRYPOINTS", - "C0_SOURCE_CHUNKS" - ], - "symbol_resolution_status": "not_found" - }, - "retrieval_request": { - "rag_session_id": "7d11da21-faa0-4cea-aede-aeabe069164c", - "query": "Где health endpoint?", - "sub_intent": "FIND_ENTRYPOINTS", - "path_scope": [], - "requested_layers": [ - "C3_ENTRYPOINTS", - "C0_SOURCE_CHUNKS" - ] - }, - "per_layer_outcome": [ - { - "layer_id": "C3_ENTRYPOINTS", - "hit_count": 3, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C0_SOURCE_CHUNKS", - "hit_count": 7, - "empty": false, - "fallback_used": false - } - ], - "empty_layers": [], - "evidence_gate_decision": { - "sufficient": true, - "failure_reasons": [], - "evidence_count": 10 - }, - "evidence_gate_input": { - "resolved_target": "src/app_runtime/control/http_app.py", - "sub_intent": "FIND_ENTRYPOINTS", - "target_type": "file", - "evidence_count": 10, - "code_chunk_count": 10, - "entrypoint_count": 3, - "relation_count": 0, - "test_evidence_count": 0, - "symbol_resolution_status": "not_found", - "path_scope": [] - }, - "post_evidence_gate": { - "input": { - "answer_mode": "normal", - "degraded_message": "", - "resolved_target": "src/app_runtime/control/http_app.py", - "draft_answer_preview": "Подтверждённая точка входа для health endpoint:\nGET /health, declared in src/app_runtime/control/http_app.py, lines 31-34, handler function named 'health'.", - "repair_candidate": true - }, - "output": { - "passed": true, - "action": "return", - "reasons": [], - "repair_used": false, - "final_answer_preview": "Подтверждённая точка входа для health endpoint:\nGET /health, declared in src/app_runtime/control/http_app.py, lines 31-34, handler function named 'health'." - } - }, - "failure_reasons": [], - "timings_ms": { - "router": 1, - "retrieval": 96, - "pre_evidence_gate": 1, - "llm": 1485, - "post_evidence_gate": 1 - } -} - -## Mismatches -- none \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/plba_full_chain_subintents_v3/20260312_192715/full_chain_plba_code_subintents_v2_plba-v2-find-tests-create-runtime.json b/tests/pipeline_setup_v3/test_results/plba_full_chain_subintents_v3/20260312_192715/full_chain_plba_code_subintents_v2_plba-v2-find-tests-create-runtime.json deleted file mode 100644 index 14ed8eb..0000000 --- a/tests/pipeline_setup_v3/test_results/plba_full_chain_subintents_v3/20260312_192715/full_chain_plba_code_subintents_v2_plba-v2-find-tests-create-runtime.json +++ /dev/null @@ -1,2950 +0,0 @@ -{ - "case_id": "plba-v2-find-tests-create-runtime", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_02_pipeline/full_chain_plba_code_subintents_v2.yaml", - "runner": "agent_runtime", - "mode": "full_chain", - "query": "Где тесты для create_runtime?", - "actual": { - "intent": "CODE_QA", - "sub_intent": "FIND_TESTS", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 24, - "llm_answer": "Прямые тесты для `create_runtime` не найдены.\n\nБлижайший косвенный тест:\n- `tests/test_runtime.py::test_public_plba_package_exports_runtime_builder_and_worker_contract`\n - Проверяет экспорт пакета plba и доступность создания runtime, включая worker контракты.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "create_runtime" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ] - }, - "passed": true, - "mismatches": [], - "details": { - "query": "Где тесты для create_runtime?", - "router_result": { - "schema_version": "1.1", - "intent": "CODE_QA", - "retrieval_profile": "code", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query_plan": { - "raw": "Где тесты для create_runtime?", - "normalized": "Где тесты для create_runtime?", - "sub_intent": "FIND_TESTS", - "negations": [], - "expansions": [ - "test", - "unit test", - "create_runtime" - ], - "keyword_hints": [ - "create_runtime" - ], - "path_hints": [], - "doc_scope_hints": [], - "symbol_candidates": [ - "create_runtime" - ], - "symbol_kind_hint": "function", - "anchors": [ - { - "type": "SYMBOL", - "value": "create_runtime", - "source": "user_text", - "subtype": null, - "span": { - "start": 14, - "end": 28 - }, - "confidence": 0.88 - }, - { - "type": "KEY_TERM", - "value": "тест", - "source": "user_text", - "subtype": null, - "span": { - "start": 4, - "end": 9 - }, - "confidence": 0.9 - } - ] - }, - "retrieval_spec": { - "domains": [ - "CODE" - ], - "layer_queries": [ - { - "layer_id": "C1_SYMBOL_CATALOG", - "top_k": 8 - }, - { - "layer_id": "C2_DEPENDENCY_GRAPH", - "top_k": 6 - }, - { - "layer_id": "C0_SOURCE_CHUNKS", - "top_k": 10 - } - ], - "filters": { - "test_policy": "INCLUDE", - "path_scope": [], - "language": [ - "python" - ] - }, - "rerank_profile": "code" - }, - "retrieval_constraints": { - "include_globs": [ - "src/**", - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "test_file_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "test_symbol_patterns": [ - "test_create_runtime", - "Testcreate_runtime", - "create_runtime" - ], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - }, - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "create_runtime", - "alternatives": [ - "create_runtime", - "create_runtime", - "FileConfigProvider", - "hashlib", - "json" - ], - "confidence": 0.99 - }, - "evidence_policy": { - "require_def": true, - "require_flow": true, - "require_spec": false, - "allow_answer_without_evidence": false - } - }, - "retrieval_request": { - "rag_session_id": "7d11da21-faa0-4cea-aede-aeabe069164c", - "query": "Где тесты для create_runtime?", - "sub_intent": "FIND_TESTS", - "path_scope": [], - "keyword_hints": [ - "create_runtime" - ], - "symbol_candidates": [ - "create_runtime" - ], - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ], - "retrieval_spec": { - "domains": [ - "CODE" - ], - "layer_queries": [ - { - "layer_id": "C1_SYMBOL_CATALOG", - "top_k": 8 - }, - { - "layer_id": "C2_DEPENDENCY_GRAPH", - "top_k": 6 - }, - { - "layer_id": "C0_SOURCE_CHUNKS", - "top_k": 10 - } - ], - "filters": { - "test_policy": "INCLUDE", - "path_scope": [], - "language": [ - "python" - ] - }, - "rerank_profile": "code" - }, - "retrieval_constraints": { - "include_globs": [ - "src/**", - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "test_file_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "test_symbol_patterns": [ - "test_create_runtime", - "Testcreate_runtime", - "create_runtime" - ], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - }, - "query_plan": { - "raw": "Где тесты для create_runtime?", - "normalized": "Где тесты для create_runtime?", - "sub_intent": "FIND_TESTS", - "negations": [], - "expansions": [ - "test", - "unit test", - "create_runtime" - ], - "keyword_hints": [ - "create_runtime" - ], - "path_hints": [], - "doc_scope_hints": [], - "symbol_candidates": [ - "create_runtime" - ], - "symbol_kind_hint": "function", - "anchors": [ - { - "type": "SYMBOL", - "value": "create_runtime", - "source": "user_text", - "subtype": null, - "span": { - "start": 14, - "end": 28 - }, - "confidence": 0.88 - }, - { - "type": "KEY_TERM", - "value": "тест", - "source": "user_text", - "subtype": null, - "span": { - "start": 4, - "end": 9 - }, - "confidence": 0.9 - } - ] - } - }, - "retrieval_result": { - "target_symbol_candidates": [ - "create_runtime", - "FileConfigProvider", - "hashlib", - "json", - "Path", - "Any", - "annotations" - ], - "resolved_symbol": "create_runtime", - "symbol_resolution_status": "resolved", - "file_candidates": [ - "src/plba/__init__.py", - "src/plba/bootstrap.py", - "src/app_runtime/config/__init__.py", - "src/app_runtime/config/file_loader.py", - "tests/test_runtime.py", - "src/app_runtime/config/providers.py", - "src/app_runtime/contracts/__init__.py", - "src/app_runtime/contracts/config.py", - "src/app_runtime/contracts/health.py", - "src/app_runtime/contracts/application.py" - ], - "code_chunks": [ - { - "layer": "C1_SYMBOL_CATALOG", - "path": "src/plba/__init__.py", - "title": "create_runtime", - "content": "const create_runtime\ncreate_runtime = plba.bootstrap.create_runtime", - "start_line": 1, - "end_line": 1, - "metadata": { - "symbol_id": "fa1e84f16c8c659bcd5448637386af4d15d431064e07714e34689ee64233cb51", - "qname": "create_runtime", - "kind": "const", - "signature": "create_runtime = plba.bootstrap.create_runtime", - "parent_symbol_id": null, - "package_or_module": "src.plba.__init__", - "is_test": false, - "blob_sha": "24e755ec8c249d14fb0e675b5dbf2b71ab91afb9c849897eebfa9feb2499e19d", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C1_SYMBOL_CATALOG", - "path": "src/plba/bootstrap.py", - "title": "create_runtime", - "content": "function create_runtime\ncreate_runtime(module)", - "start_line": 8, - "end_line": 29, - "metadata": { - "symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "qname": "create_runtime", - "kind": "function", - "signature": "create_runtime(module)", - "parent_symbol_id": null, - "package_or_module": "src.plba.bootstrap", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C1_SYMBOL_CATALOG", - "path": "src/app_runtime/config/__init__.py", - "title": "FileConfigProvider", - "content": "const FileConfigProvider\nFileConfigProvider = app_runtime.config.providers.FileConfigProvider", - "start_line": 2, - "end_line": 2, - "metadata": { - "symbol_id": "e449b19e5881889adeb6e056eafe1da30acbae864f06984ea2edc7c15f7cb6d6", - "qname": "FileConfigProvider", - "kind": "const", - "signature": "FileConfigProvider = app_runtime.config.providers.FileConfigProvider", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.config.__init__", - "is_test": false, - "blob_sha": "612918029820a2a983330ec92256142b55b9de4bdf3399ece18e2a02dbad9729", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C1_SYMBOL_CATALOG", - "path": "src/app_runtime/config/file_loader.py", - "title": "hashlib", - "content": "const hashlib\nimport hashlib", - "start_line": 3, - "end_line": 3, - "metadata": { - "symbol_id": "e7375824bd473da3d73d316d22e3cb6428930e2db1ffbd900ce5a8b88427bf05", - "qname": "hashlib", - "kind": "const", - "signature": "import hashlib", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.config.file_loader", - "is_test": false, - "blob_sha": "1f19ffebde5e38e4be5a5d5a678059a0f36dedb8fb8b3e00ab395c67106a87ea", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C1_SYMBOL_CATALOG", - "path": "src/app_runtime/config/file_loader.py", - "title": "json", - "content": "const json\nimport json", - "start_line": 4, - "end_line": 4, - "metadata": { - "symbol_id": "bb9e2eaf992bfd050f7072d72eed87c55b1a4b001daa034a0f7c630a61bb1d78", - "qname": "json", - "kind": "const", - "signature": "import json", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.config.file_loader", - "is_test": false, - "blob_sha": "1f19ffebde5e38e4be5a5d5a678059a0f36dedb8fb8b3e00ab395c67106a87ea", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C1_SYMBOL_CATALOG", - "path": "src/app_runtime/config/file_loader.py", - "title": "Path", - "content": "const Path\nPath = pathlib.Path", - "start_line": 5, - "end_line": 5, - "metadata": { - "symbol_id": "b785967ed1fb83aa62d5724c6d6e9c6d2b1505523db39bd941cc39b48db48306", - "qname": "Path", - "kind": "const", - "signature": "Path = pathlib.Path", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.config.file_loader", - "is_test": false, - "blob_sha": "1f19ffebde5e38e4be5a5d5a678059a0f36dedb8fb8b3e00ab395c67106a87ea", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C1_SYMBOL_CATALOG", - "path": "src/app_runtime/config/file_loader.py", - "title": "Any", - "content": "const Any\nAny = typing.Any", - "start_line": 6, - "end_line": 6, - "metadata": { - "symbol_id": "8e330833b8073585db1c4b4315947c400683a23e4c3d2e2ccbcb260f347541b6", - "qname": "Any", - "kind": "const", - "signature": "Any = typing.Any", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.config.file_loader", - "is_test": false, - "blob_sha": "1f19ffebde5e38e4be5a5d5a678059a0f36dedb8fb8b3e00ab395c67106a87ea", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C1_SYMBOL_CATALOG", - "path": "src/app_runtime/config/file_loader.py", - "title": "annotations", - "content": "const annotations\nannotations = __future__.annotations", - "start_line": 1, - "end_line": 1, - "metadata": { - "symbol_id": "5ed640ccec43a78659d50ec24f3717bf1144a182c22588f37456649ac6a4a815", - "qname": "annotations", - "kind": "const", - "signature": "annotations = __future__.annotations", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.config.file_loader", - "is_test": false, - "blob_sha": "1f19ffebde5e38e4be5a5d5a678059a0f36dedb8fb8b3e00ab395c67106a87ea", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "path": "src/plba/bootstrap.py", - "title": "create_runtime:calls", - "content": "create_runtime calls runtime.add_config_file", - "start_line": 19, - "end_line": 19, - "metadata": { - "edge_id": "4eaeec4ac55a59d5f66fd01c4754955f8fedaf4bc3df13fa769b352c7bfaacbb", - "edge_type": "calls", - "src_symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "src_qname": "create_runtime", - "dst_symbol_id": null, - "dst_ref": "runtime.add_config_file", - "resolution": "partial", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "path": "src/plba/bootstrap.py", - "title": "create_runtime:reads_attr", - "content": "create_runtime reads_attr runtime.register_module", - "start_line": 28, - "end_line": 28, - "metadata": { - "edge_id": "45516c79ff358dbf9b650a081668df0f66d2fe989300f985a1a78be6be166f8f", - "edge_type": "reads_attr", - "src_symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "src_qname": "create_runtime", - "dst_symbol_id": null, - "dst_ref": "runtime.register_module", - "resolution": "partial", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "path": "src/plba/bootstrap.py", - "title": "create_runtime:instantiates", - "content": "create_runtime instantiates RuntimeManager", - "start_line": 17, - "end_line": 17, - "metadata": { - "edge_id": "0adba17984f850ea1608c9e734d2dd5c325cfde3a8133123aa239e44935ad18e", - "edge_type": "instantiates", - "src_symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "src_qname": "create_runtime", - "dst_symbol_id": "27158ca220022eeb5083c6addf8a50775d45f7161284fd60aac48410105f4b98", - "dst_ref": "RuntimeManager", - "resolution": "resolved", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "path": "src/plba/bootstrap.py", - "title": "create_runtime:calls", - "content": "create_runtime calls runtime.register_module", - "start_line": 28, - "end_line": 28, - "metadata": { - "edge_id": "ab6003c3441addc1ba1b81edeca009165559f652f6b2cf424e5ae61b1f617de8", - "edge_type": "calls", - "src_symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "src_qname": "create_runtime", - "dst_symbol_id": null, - "dst_ref": "runtime.register_module", - "resolution": "partial", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "path": "src/plba/bootstrap.py", - "title": "create_runtime:calls", - "content": "create_runtime calls runtime.control_plane.register_channel", - "start_line": 21, - "end_line": 27, - "metadata": { - "edge_id": "2678250030b9ce47a3b3b55fac7897ac530367edc8374ac9d5e6ecafb1e483f0", - "edge_type": "calls", - "src_symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "src_qname": "create_runtime", - "dst_symbol_id": null, - "dst_ref": "runtime.control_plane.register_channel", - "resolution": "partial", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "path": "src/plba/bootstrap.py", - "title": "create_runtime:reads_attr", - "content": "create_runtime reads_attr runtime.add_config_file", - "start_line": 19, - "end_line": 19, - "metadata": { - "edge_id": "30d4e8aae984ab84d523e80d02f1caeda52d547fa3d2aa47be8845931cabbca2", - "edge_type": "reads_attr", - "src_symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "src_qname": "create_runtime", - "dst_symbol_id": null, - "dst_ref": "runtime.add_config_file", - "resolution": "partial", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C0_SOURCE_CHUNKS", - "path": "src/plba/__init__.py", - "title": "src/plba/__init__.py:1-69", - "content": "from plba.bootstrap import create_runtime\nfrom plba.config import ConfigFileLoader, FileConfigProvider\nfrom plba.control import ControlActionSet, ControlChannel, ControlPlaneService, HttpControlChannel\nfrom plba.contracts import (\n ApplicationModule,\n ConfigProvider,\n HealthContributor,\n TraceContext,\n TraceContextRecord,\n TraceLogMessage,\n TraceTransport,\n Worker,\n WorkerHealth,\n WorkerStatus,\n)\nfrom plba.core import ConfigurationManager, RuntimeManager, ServiceContainer\nfrom plba.health import HealthRegistry\nfrom plba.logging import LogManager\nfrom plba.queue import InMemoryTaskQueue\nfrom plba.tracing import MySqlTraceTransport, NoOpTraceTransport, TraceService\nfrom plba.workflow import (\n StepResult,\n WorkflowContext,\n WorkflowDefinition,\n WorkflowEngine,\n WorkflowEngineHooks,\n WorkflowNode,\n WorkflowRuntimeFactory,\n WorkflowStep,\n)\nfrom plba.workers import WorkerSupervisor\n\n__all__ = [\n \"ApplicationModule\",\n \"ConfigFileLoader\",\n \"ConfigProvider\",\n \"ConfigurationManager\",\n \"ControlActionSet\",\n \"ControlChannel\",\n \"ControlPlaneService\",\n \"create_runtime\",\n \"FileConfigProvider\",\n \"HealthContributor\",\n \"HealthRegistry\",\n \"HttpControlChannel\",\n \"InMemoryTaskQueue\",\n \"LogManager\",\n \"MySqlTraceTransport\",\n \"NoOpTraceTransport\",\n \"RuntimeManager\",\n \"ServiceContainer\",\n \"TraceContext\",\n \"TraceContextRecord\",\n \"TraceLogMessage\",\n \"TraceService\",\n \"TraceTransport\",\n \"StepResult\",\n \"Worker\",\n \"WorkerHealth\",\n \"WorkerStatus\",\n \"WorkflowContext\",\n \"WorkflowDefinition\",\n \"WorkflowEngine\",\n \"WorkflowEngineHooks\",\n \"WorkflowNode\",\n \"WorkflowRuntimeFactory\",\n \"WorkflowStep\",\n \"WorkerSupervisor\",\n]", - "start_line": 1, - "end_line": 69, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.plba.__init__", - "is_test": false, - "blob_sha": "24e755ec8c249d14fb0e675b5dbf2b71ab91afb9c849897eebfa9feb2499e19d", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C0_SOURCE_CHUNKS", - "path": "src/plba/bootstrap.py", - "title": "src/plba/bootstrap.py:create_runtime", - "content": "def create_runtime(\n module: ApplicationModule,\n *,\n config_path: str | None = None,\n enable_http_control: bool = False,\n control_host: str = \"127.0.0.1\",\n control_port: int = 8080,\n control_timeout: int = 5,\n) -> RuntimeManager:\n runtime = RuntimeManager()\n if config_path is not None:\n runtime.add_config_file(config_path)\n if enable_http_control:\n runtime.control_plane.register_channel(\n HttpControlChannel(\n host=control_host,\n port=control_port,\n timeout=control_timeout,\n )\n )\n runtime.register_module(module)\n return runtime", - "start_line": 8, - "end_line": 29, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.plba.bootstrap", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C0_SOURCE_CHUNKS", - "path": "tests/test_runtime.py", - "title": "tests/test_runtime.py:test_public_plba_package_exports_runtime_builder_and_worker_contract", - "content": "def test_public_plba_package_exports_runtime_builder_and_worker_contract(tmp_path) -> None:\n import plba\n from plba import ApplicationModule as PublicApplicationModule\n from plba import InMemoryTaskQueue\n from plba import Worker as PublicWorker\n from plba import WorkerHealth as PublicWorkerHealth\n from plba import WorkerStatus as PublicWorkerStatus\n from plba import create_runtime\n\n config_path = tmp_path / \"config.yml\"\n config_path.write_text(\"platform: {}\\n\", encoding=\"utf-8\")\n\n queue = InMemoryTaskQueue[int]()\n queue.put(2)\n assert queue.get(timeout=0.01) == 2\n queue.task_done()\n\n class PublicRoutine:\n def __init__(self) -> None:\n self.runs = 0\n\n def run(self) -> None:\n if self.runs == 0:\n self.runs += 1\n\n class PublicWorkerImpl(PublicWorker):\n def __init__(self, routine: PublicRoutine) -> None:\n self._inner = RoutineWorker(\"public-worker\", routine)\n\n @property\n def name(self) -> str:\n return self._inner.name\n\n @property\n def critical(self) -> bool:\n return self._inner.critical\n\n def start(self) -> None:\n self._inner.start()\n\n def stop(self, force: bool = False) -> None:\n self._inner.stop(force=force)\n\n def health(self) -> PublicWorkerHealth:\n return self._inner.health()\n\n def status(self) -> PublicWorkerStatus:\n return self._inner.status()\n\n class PublicExampleModule(PublicApplicationModule):\n @property\n def name(self) -> str:\n return \"public-example\"\n\n def register(self, registry: ModuleRegistry) -> None:\n registry.add_worker(PublicWorkerImpl(PublicRoutine()))\n\n runtime = create_runtime(PublicExampleModule(), config_path=str(config_path))\n runtime.start()\n sleep(0.2)\n assert runtime.configuration.get() == {\"platform\": {}}\n assert runtime.status()[\"workers\"][\"registered\"] == 1\n assert hasattr(plba, \"QueueWorker\") is False\n runtime.stop()", - "start_line": 342, - "end_line": 405, - "metadata": { - "chunk_index": 13, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_runtime", - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C0_SOURCE_CHUNKS", - "path": "src/app_runtime/config/__init__.py", - "title": "src/app_runtime/config/__init__.py:1-4", - "content": "from app_runtime.config.file_loader import ConfigFileLoader\nfrom app_runtime.config.providers import FileConfigProvider\n\n__all__ = [\"ConfigFileLoader\", \"FileConfigProvider\"]", - "start_line": 1, - "end_line": 4, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.app_runtime.config.__init__", - "is_test": false, - "blob_sha": "612918029820a2a983330ec92256142b55b9de4bdf3399ece18e2a02dbad9729", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C0_SOURCE_CHUNKS", - "path": "src/app_runtime/config/providers.py", - "title": "src/app_runtime/config/providers.py:FileConfigProvider", - "content": "class FileConfigProvider(ConfigProvider):\n def __init__(self, path: str | Path) -> None:\n self._loader = ConfigFileLoader(path)\n\n @property\n def loader(self) -> ConfigFileLoader:\n return self._loader\n\n def load(self) -> dict[str, Any]:\n config = self._loader.load_sync()\n if not isinstance(config, dict):\n raise TypeError(\"Config root must be a mapping\")\n return dict(config)", - "start_line": 10, - "end_line": 22, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.config.providers", - "is_test": false, - "blob_sha": "8c53ca0122d6df6c5763bca15e99434bb4daebd5a618b8fc927e9ae90b022e64", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C0_SOURCE_CHUNKS", - "path": "src/app_runtime/contracts/__init__.py", - "title": "src/app_runtime/__init__.py:1-1", - "content": "__all__: list[str] = []", - "start_line": 1, - "end_line": 1, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.app_runtime.__init__", - "is_test": false, - "blob_sha": "8eea9df4f6d7b38ca0e39ccc27b04700e3d08dbeec8046d613d22706d19985fa", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C0_SOURCE_CHUNKS", - "path": "src/app_runtime/config/file_loader.py", - "title": "src/app_runtime/config/file_loader.py:ConfigFileLoader", - "content": "class ConfigFileLoader:\n def __init__(self, path: str | Path) -> None:\n self.path = Path(path)\n self.config: Any = None\n self.last_valid_config: Any = None\n self._last_seen_hash: str | None = None\n\n def read_text(self) -> str:\n return self.path.read_text(encoding=\"utf-8\")\n\n def parse(self, data: str) -> Any:\n suffix = self.path.suffix.lower()\n if suffix in {\".yml\", \".yaml\"}:\n return yaml.safe_load(data)\n return json.loads(data)\n\n def load_sync(self) -> Any:\n data = self.read_text()\n parsed = self.parse(data)\n self.config = parsed\n self.last_valid_config = parsed\n self._last_seen_hash = self._calculate_hash(data)\n return parsed\n\n def load_if_changed(self) -> tuple[bool, Any]:\n data = self.read_text()\n current_hash = self._calculate_hash(data)\n if current_hash == self._last_seen_hash:\n return False, self.config\n parsed = self.parse(data)\n self.config = parsed\n self.last_valid_config = parsed\n self._last_seen_hash = current_hash\n return True, parsed\n\n @staticmethod\n def _calculate_hash(data: str) -> str:\n return hashlib.sha256(data.encode(\"utf-8\")).hexdigest()", - "start_line": 11, - "end_line": 48, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.config.file_loader", - "is_test": false, - "blob_sha": "1f19ffebde5e38e4be5a5d5a678059a0f36dedb8fb8b3e00ab395c67106a87ea", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C0_SOURCE_CHUNKS", - "path": "src/app_runtime/contracts/config.py", - "title": "src/app_runtime/contracts/config.py:ConfigProvider", - "content": "class ConfigProvider(ABC):\n @abstractmethod\n def load(self) -> dict[str, Any]:\n \"\"\"Return a config fragment.\"\"\"", - "start_line": 7, - "end_line": 10, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.contracts.config", - "is_test": false, - "blob_sha": "5e773880267743ee94954ea2db120c2d88c54d4312893293d1b89df405283ed4", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C0_SOURCE_CHUNKS", - "path": "src/app_runtime/contracts/health.py", - "title": "src/app_runtime/contracts/health.py:HealthContributor", - "content": "class HealthContributor(ABC):\n @abstractmethod\n def health(self) -> WorkerHealth:\n \"\"\"Return contributor health state.\"\"\"", - "start_line": 7, - "end_line": 10, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.contracts.health", - "is_test": false, - "blob_sha": "6bd92611def7131e32d4dd34a8ed85e6cf3c67722ad27797032a632cb30dc097", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C0_SOURCE_CHUNKS", - "path": "src/app_runtime/contracts/application.py", - "title": "src/app_runtime/contracts/application.py:ApplicationModule", - "content": "class ApplicationModule(ABC):\n @property\n @abstractmethod\n def name(self) -> str:\n \"\"\"Module name used for runtime status and diagnostics.\"\"\"\n\n @abstractmethod\n def register(self, registry: ModuleRegistry) -> None:\n \"\"\"Register workers, services, and health contributors.\"\"\"", - "start_line": 8, - "end_line": 16, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.contracts.application", - "is_test": false, - "blob_sha": "197c35634dca49c352ce3f230295a485fbffb672ce7bb8c08e752bfdf61e7fa4", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "relations": [ - { - "path": "src/plba/bootstrap.py", - "start_line": 19, - "end_line": 19, - "edge_type": "calls", - "source": "create_runtime", - "target": "runtime.add_config_file", - "metadata": { - "edge_id": "4eaeec4ac55a59d5f66fd01c4754955f8fedaf4bc3df13fa769b352c7bfaacbb", - "edge_type": "calls", - "src_symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "src_qname": "create_runtime", - "dst_symbol_id": null, - "dst_ref": "runtime.add_config_file", - "resolution": "partial", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - }, - "content": "create_runtime calls runtime.add_config_file" - }, - { - "path": "src/plba/bootstrap.py", - "start_line": 28, - "end_line": 28, - "edge_type": "reads_attr", - "source": "create_runtime", - "target": "runtime.register_module", - "metadata": { - "edge_id": "45516c79ff358dbf9b650a081668df0f66d2fe989300f985a1a78be6be166f8f", - "edge_type": "reads_attr", - "src_symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "src_qname": "create_runtime", - "dst_symbol_id": null, - "dst_ref": "runtime.register_module", - "resolution": "partial", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - }, - "content": "create_runtime reads_attr runtime.register_module" - }, - { - "path": "src/plba/bootstrap.py", - "start_line": 17, - "end_line": 17, - "edge_type": "instantiates", - "source": "create_runtime", - "target": "RuntimeManager", - "metadata": { - "edge_id": "0adba17984f850ea1608c9e734d2dd5c325cfde3a8133123aa239e44935ad18e", - "edge_type": "instantiates", - "src_symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "src_qname": "create_runtime", - "dst_symbol_id": "27158ca220022eeb5083c6addf8a50775d45f7161284fd60aac48410105f4b98", - "dst_ref": "RuntimeManager", - "resolution": "resolved", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - }, - "content": "create_runtime instantiates RuntimeManager" - }, - { - "path": "src/plba/bootstrap.py", - "start_line": 28, - "end_line": 28, - "edge_type": "calls", - "source": "create_runtime", - "target": "runtime.register_module", - "metadata": { - "edge_id": "ab6003c3441addc1ba1b81edeca009165559f652f6b2cf424e5ae61b1f617de8", - "edge_type": "calls", - "src_symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "src_qname": "create_runtime", - "dst_symbol_id": null, - "dst_ref": "runtime.register_module", - "resolution": "partial", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - }, - "content": "create_runtime calls runtime.register_module" - }, - { - "path": "src/plba/bootstrap.py", - "start_line": 21, - "end_line": 27, - "edge_type": "calls", - "source": "create_runtime", - "target": "runtime.control_plane.register_channel", - "metadata": { - "edge_id": "2678250030b9ce47a3b3b55fac7897ac530367edc8374ac9d5e6ecafb1e483f0", - "edge_type": "calls", - "src_symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "src_qname": "create_runtime", - "dst_symbol_id": null, - "dst_ref": "runtime.control_plane.register_channel", - "resolution": "partial", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - }, - "content": "create_runtime calls runtime.control_plane.register_channel" - }, - { - "path": "src/plba/bootstrap.py", - "start_line": 19, - "end_line": 19, - "edge_type": "reads_attr", - "source": "create_runtime", - "target": "runtime.add_config_file", - "metadata": { - "edge_id": "30d4e8aae984ab84d523e80d02f1caeda52d547fa3d2aa47be8845931cabbca2", - "edge_type": "reads_attr", - "src_symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "src_qname": "create_runtime", - "dst_symbol_id": null, - "dst_ref": "runtime.add_config_file", - "resolution": "partial", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - }, - "content": "create_runtime reads_attr runtime.add_config_file" - } - ], - "semantic_hints": [], - "entrypoints": [], - "test_candidates": [ - { - "path": "tests/test_runtime.py", - "title": "tests/test_runtime.py:test_public_plba_package_exports_runtime_builder_and_worker_contract", - "content": "def test_public_plba_package_exports_runtime_builder_and_worker_contract(tmp_path) -> None:\n import plba\n from plba import ApplicationModule as PublicApplicationModule\n from plba import InMemoryTaskQueue\n from plba import Worker as PublicWorker\n from plba import WorkerHealth as Public" - } - ], - "layer_outcomes": [ - { - "layer_id": "C1_SYMBOL_CATALOG", - "hit_count": 8, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C2_DEPENDENCY_GRAPH", - "hit_count": 6, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C0_SOURCE_CHUNKS", - "hit_count": 10, - "empty": false, - "fallback_used": false - } - ], - "missing_layers": [], - "raw_rows": [ - { - "path": "src/plba/__init__.py", - "content": "const create_runtime\ncreate_runtime = plba.bootstrap.create_runtime", - "layer": "C1_SYMBOL_CATALOG", - "title": "create_runtime", - "span_start": 1, - "span_end": 1, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": null, - "metadata": { - "symbol_id": "fa1e84f16c8c659bcd5448637386af4d15d431064e07714e34689ee64233cb51", - "qname": "create_runtime", - "kind": "const", - "signature": "create_runtime = plba.bootstrap.create_runtime", - "parent_symbol_id": null, - "package_or_module": "src.plba.__init__", - "is_test": false, - "blob_sha": "24e755ec8c249d14fb0e675b5dbf2b71ab91afb9c849897eebfa9feb2499e19d", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/bootstrap.py", - "content": "function create_runtime\ncreate_runtime(module)", - "layer": "C1_SYMBOL_CATALOG", - "title": "create_runtime", - "span_start": 8, - "span_end": 29, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": null, - "metadata": { - "symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "qname": "create_runtime", - "kind": "function", - "signature": "create_runtime(module)", - "parent_symbol_id": null, - "package_or_module": "src.plba.bootstrap", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/config/__init__.py", - "content": "const FileConfigProvider\nFileConfigProvider = app_runtime.config.providers.FileConfigProvider", - "layer": "C1_SYMBOL_CATALOG", - "title": "FileConfigProvider", - "span_start": 2, - "span_end": 2, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": null, - "metadata": { - "symbol_id": "e449b19e5881889adeb6e056eafe1da30acbae864f06984ea2edc7c15f7cb6d6", - "qname": "FileConfigProvider", - "kind": "const", - "signature": "FileConfigProvider = app_runtime.config.providers.FileConfigProvider", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.config.__init__", - "is_test": false, - "blob_sha": "612918029820a2a983330ec92256142b55b9de4bdf3399ece18e2a02dbad9729", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/config/file_loader.py", - "content": "const hashlib\nimport hashlib", - "layer": "C1_SYMBOL_CATALOG", - "title": "hashlib", - "span_start": 3, - "span_end": 3, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": null, - "metadata": { - "symbol_id": "e7375824bd473da3d73d316d22e3cb6428930e2db1ffbd900ce5a8b88427bf05", - "qname": "hashlib", - "kind": "const", - "signature": "import hashlib", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.config.file_loader", - "is_test": false, - "blob_sha": "1f19ffebde5e38e4be5a5d5a678059a0f36dedb8fb8b3e00ab395c67106a87ea", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/config/file_loader.py", - "content": "const json\nimport json", - "layer": "C1_SYMBOL_CATALOG", - "title": "json", - "span_start": 4, - "span_end": 4, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": null, - "metadata": { - "symbol_id": "bb9e2eaf992bfd050f7072d72eed87c55b1a4b001daa034a0f7c630a61bb1d78", - "qname": "json", - "kind": "const", - "signature": "import json", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.config.file_loader", - "is_test": false, - "blob_sha": "1f19ffebde5e38e4be5a5d5a678059a0f36dedb8fb8b3e00ab395c67106a87ea", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/config/file_loader.py", - "content": "const Path\nPath = pathlib.Path", - "layer": "C1_SYMBOL_CATALOG", - "title": "Path", - "span_start": 5, - "span_end": 5, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": null, - "metadata": { - "symbol_id": "b785967ed1fb83aa62d5724c6d6e9c6d2b1505523db39bd941cc39b48db48306", - "qname": "Path", - "kind": "const", - "signature": "Path = pathlib.Path", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.config.file_loader", - "is_test": false, - "blob_sha": "1f19ffebde5e38e4be5a5d5a678059a0f36dedb8fb8b3e00ab395c67106a87ea", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/config/file_loader.py", - "content": "const Any\nAny = typing.Any", - "layer": "C1_SYMBOL_CATALOG", - "title": "Any", - "span_start": 6, - "span_end": 6, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": null, - "metadata": { - "symbol_id": "8e330833b8073585db1c4b4315947c400683a23e4c3d2e2ccbcb260f347541b6", - "qname": "Any", - "kind": "const", - "signature": "Any = typing.Any", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.config.file_loader", - "is_test": false, - "blob_sha": "1f19ffebde5e38e4be5a5d5a678059a0f36dedb8fb8b3e00ab395c67106a87ea", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/config/file_loader.py", - "content": "const annotations\nannotations = __future__.annotations", - "layer": "C1_SYMBOL_CATALOG", - "title": "annotations", - "span_start": 1, - "span_end": 1, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": null, - "metadata": { - "symbol_id": "5ed640ccec43a78659d50ec24f3717bf1144a182c22588f37456649ac6a4a815", - "qname": "annotations", - "kind": "const", - "signature": "annotations = __future__.annotations", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.config.file_loader", - "is_test": false, - "blob_sha": "1f19ffebde5e38e4be5a5d5a678059a0f36dedb8fb8b3e00ab395c67106a87ea", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/bootstrap.py", - "content": "create_runtime calls runtime.add_config_file", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "create_runtime:calls", - "span_start": 19, - "span_end": 19, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": null, - "metadata": { - "edge_id": "4eaeec4ac55a59d5f66fd01c4754955f8fedaf4bc3df13fa769b352c7bfaacbb", - "edge_type": "calls", - "src_symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "src_qname": "create_runtime", - "dst_symbol_id": null, - "dst_ref": "runtime.add_config_file", - "resolution": "partial", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/bootstrap.py", - "content": "create_runtime reads_attr runtime.register_module", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "create_runtime:reads_attr", - "span_start": 28, - "span_end": 28, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": null, - "metadata": { - "edge_id": "45516c79ff358dbf9b650a081668df0f66d2fe989300f985a1a78be6be166f8f", - "edge_type": "reads_attr", - "src_symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "src_qname": "create_runtime", - "dst_symbol_id": null, - "dst_ref": "runtime.register_module", - "resolution": "partial", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/bootstrap.py", - "content": "create_runtime instantiates RuntimeManager", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "create_runtime:instantiates", - "span_start": 17, - "span_end": 17, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": null, - "metadata": { - "edge_id": "0adba17984f850ea1608c9e734d2dd5c325cfde3a8133123aa239e44935ad18e", - "edge_type": "instantiates", - "src_symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "src_qname": "create_runtime", - "dst_symbol_id": "27158ca220022eeb5083c6addf8a50775d45f7161284fd60aac48410105f4b98", - "dst_ref": "RuntimeManager", - "resolution": "resolved", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/bootstrap.py", - "content": "create_runtime calls runtime.register_module", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "create_runtime:calls", - "span_start": 28, - "span_end": 28, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": null, - "metadata": { - "edge_id": "ab6003c3441addc1ba1b81edeca009165559f652f6b2cf424e5ae61b1f617de8", - "edge_type": "calls", - "src_symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "src_qname": "create_runtime", - "dst_symbol_id": null, - "dst_ref": "runtime.register_module", - "resolution": "partial", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/bootstrap.py", - "content": "create_runtime calls runtime.control_plane.register_channel", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "create_runtime:calls", - "span_start": 21, - "span_end": 27, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": null, - "metadata": { - "edge_id": "2678250030b9ce47a3b3b55fac7897ac530367edc8374ac9d5e6ecafb1e483f0", - "edge_type": "calls", - "src_symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "src_qname": "create_runtime", - "dst_symbol_id": null, - "dst_ref": "runtime.control_plane.register_channel", - "resolution": "partial", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/bootstrap.py", - "content": "create_runtime reads_attr runtime.add_config_file", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "create_runtime:reads_attr", - "span_start": 19, - "span_end": 19, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": null, - "metadata": { - "edge_id": "30d4e8aae984ab84d523e80d02f1caeda52d547fa3d2aa47be8845931cabbca2", - "edge_type": "reads_attr", - "src_symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "src_qname": "create_runtime", - "dst_symbol_id": null, - "dst_ref": "runtime.add_config_file", - "resolution": "partial", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/__init__.py", - "content": "from plba.bootstrap import create_runtime\nfrom plba.config import ConfigFileLoader, FileConfigProvider\nfrom plba.control import ControlActionSet, ControlChannel, ControlPlaneService, HttpControlChannel\nfrom plba.contracts import (\n ApplicationModule,\n ConfigProvider,\n HealthContributor,\n TraceContext,\n TraceContextRecord,\n TraceLogMessage,\n TraceTransport,\n Worker,\n WorkerHealth,\n WorkerStatus,\n)\nfrom plba.core import ConfigurationManager, RuntimeManager, ServiceContainer\nfrom plba.health import HealthRegistry\nfrom plba.logging import LogManager\nfrom plba.queue import InMemoryTaskQueue\nfrom plba.tracing import MySqlTraceTransport, NoOpTraceTransport, TraceService\nfrom plba.workflow import (\n StepResult,\n WorkflowContext,\n WorkflowDefinition,\n WorkflowEngine,\n WorkflowEngineHooks,\n WorkflowNode,\n WorkflowRuntimeFactory,\n WorkflowStep,\n)\nfrom plba.workers import WorkerSupervisor\n\n__all__ = [\n \"ApplicationModule\",\n \"ConfigFileLoader\",\n \"ConfigProvider\",\n \"ConfigurationManager\",\n \"ControlActionSet\",\n \"ControlChannel\",\n \"ControlPlaneService\",\n \"create_runtime\",\n \"FileConfigProvider\",\n \"HealthContributor\",\n \"HealthRegistry\",\n \"HttpControlChannel\",\n \"InMemoryTaskQueue\",\n \"LogManager\",\n \"MySqlTraceTransport\",\n \"NoOpTraceTransport\",\n \"RuntimeManager\",\n \"ServiceContainer\",\n \"TraceContext\",\n \"TraceContextRecord\",\n \"TraceLogMessage\",\n \"TraceService\",\n \"TraceTransport\",\n \"StepResult\",\n \"Worker\",\n \"WorkerHealth\",\n \"WorkerStatus\",\n \"WorkflowContext\",\n \"WorkflowDefinition\",\n \"WorkflowEngine\",\n \"WorkflowEngineHooks\",\n \"WorkflowNode\",\n \"WorkflowRuntimeFactory\",\n \"WorkflowStep\",\n \"WorkerSupervisor\",\n]", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/plba/__init__.py:1-69", - "span_start": 1, - "span_end": 69, - "lexical_rank": 6, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": null, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.plba.__init__", - "is_test": false, - "blob_sha": "24e755ec8c249d14fb0e675b5dbf2b71ab91afb9c849897eebfa9feb2499e19d", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/bootstrap.py", - "content": "def create_runtime(\n module: ApplicationModule,\n *,\n config_path: str | None = None,\n enable_http_control: bool = False,\n control_host: str = \"127.0.0.1\",\n control_port: int = 8080,\n control_timeout: int = 5,\n) -> RuntimeManager:\n runtime = RuntimeManager()\n if config_path is not None:\n runtime.add_config_file(config_path)\n if enable_http_control:\n runtime.control_plane.register_channel(\n HttpControlChannel(\n host=control_host,\n port=control_port,\n timeout=control_timeout,\n )\n )\n runtime.register_module(module)\n return runtime", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/plba/bootstrap.py:create_runtime", - "span_start": 8, - "span_end": 29, - "lexical_rank": 6, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": null, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.plba.bootstrap", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_runtime.py", - "content": "def test_public_plba_package_exports_runtime_builder_and_worker_contract(tmp_path) -> None:\n import plba\n from plba import ApplicationModule as PublicApplicationModule\n from plba import InMemoryTaskQueue\n from plba import Worker as PublicWorker\n from plba import WorkerHealth as PublicWorkerHealth\n from plba import WorkerStatus as PublicWorkerStatus\n from plba import create_runtime\n\n config_path = tmp_path / \"config.yml\"\n config_path.write_text(\"platform: {}\\n\", encoding=\"utf-8\")\n\n queue = InMemoryTaskQueue[int]()\n queue.put(2)\n assert queue.get(timeout=0.01) == 2\n queue.task_done()\n\n class PublicRoutine:\n def __init__(self) -> None:\n self.runs = 0\n\n def run(self) -> None:\n if self.runs == 0:\n self.runs += 1\n\n class PublicWorkerImpl(PublicWorker):\n def __init__(self, routine: PublicRoutine) -> None:\n self._inner = RoutineWorker(\"public-worker\", routine)\n\n @property\n def name(self) -> str:\n return self._inner.name\n\n @property\n def critical(self) -> bool:\n return self._inner.critical\n\n def start(self) -> None:\n self._inner.start()\n\n def stop(self, force: bool = False) -> None:\n self._inner.stop(force=force)\n\n def health(self) -> PublicWorkerHealth:\n return self._inner.health()\n\n def status(self) -> PublicWorkerStatus:\n return self._inner.status()\n\n class PublicExampleModule(PublicApplicationModule):\n @property\n def name(self) -> str:\n return \"public-example\"\n\n def register(self, registry: ModuleRegistry) -> None:\n registry.add_worker(PublicWorkerImpl(PublicRoutine()))\n\n runtime = create_runtime(PublicExampleModule(), config_path=str(config_path))\n runtime.start()\n sleep(0.2)\n assert runtime.configuration.get() == {\"platform\": {}}\n assert runtime.status()[\"workers\"][\"registered\"] == 1\n assert hasattr(plba, \"QueueWorker\") is False\n runtime.stop()", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_runtime.py:test_public_plba_package_exports_runtime_builder_and_worker_contract", - "span_start": 342, - "span_end": 405, - "lexical_rank": 6, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": null, - "metadata": { - "chunk_index": 13, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_runtime", - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/config/__init__.py", - "content": "from app_runtime.config.file_loader import ConfigFileLoader\nfrom app_runtime.config.providers import FileConfigProvider\n\n__all__ = [\"ConfigFileLoader\", \"FileConfigProvider\"]", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/config/__init__.py:1-4", - "span_start": 1, - "span_end": 4, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": null, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.app_runtime.config.__init__", - "is_test": false, - "blob_sha": "612918029820a2a983330ec92256142b55b9de4bdf3399ece18e2a02dbad9729", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/config/providers.py", - "content": "class FileConfigProvider(ConfigProvider):\n def __init__(self, path: str | Path) -> None:\n self._loader = ConfigFileLoader(path)\n\n @property\n def loader(self) -> ConfigFileLoader:\n return self._loader\n\n def load(self) -> dict[str, Any]:\n config = self._loader.load_sync()\n if not isinstance(config, dict):\n raise TypeError(\"Config root must be a mapping\")\n return dict(config)", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/config/providers.py:FileConfigProvider", - "span_start": 10, - "span_end": 22, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": null, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.config.providers", - "is_test": false, - "blob_sha": "8c53ca0122d6df6c5763bca15e99434bb4daebd5a618b8fc927e9ae90b022e64", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/contracts/__init__.py", - "content": "__all__: list[str] = []", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/__init__.py:1-1", - "span_start": 1, - "span_end": 1, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": null, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.app_runtime.__init__", - "is_test": false, - "blob_sha": "8eea9df4f6d7b38ca0e39ccc27b04700e3d08dbeec8046d613d22706d19985fa", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/config/file_loader.py", - "content": "class ConfigFileLoader:\n def __init__(self, path: str | Path) -> None:\n self.path = Path(path)\n self.config: Any = None\n self.last_valid_config: Any = None\n self._last_seen_hash: str | None = None\n\n def read_text(self) -> str:\n return self.path.read_text(encoding=\"utf-8\")\n\n def parse(self, data: str) -> Any:\n suffix = self.path.suffix.lower()\n if suffix in {\".yml\", \".yaml\"}:\n return yaml.safe_load(data)\n return json.loads(data)\n\n def load_sync(self) -> Any:\n data = self.read_text()\n parsed = self.parse(data)\n self.config = parsed\n self.last_valid_config = parsed\n self._last_seen_hash = self._calculate_hash(data)\n return parsed\n\n def load_if_changed(self) -> tuple[bool, Any]:\n data = self.read_text()\n current_hash = self._calculate_hash(data)\n if current_hash == self._last_seen_hash:\n return False, self.config\n parsed = self.parse(data)\n self.config = parsed\n self.last_valid_config = parsed\n self._last_seen_hash = current_hash\n return True, parsed\n\n @staticmethod\n def _calculate_hash(data: str) -> str:\n return hashlib.sha256(data.encode(\"utf-8\")).hexdigest()", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/config/file_loader.py:ConfigFileLoader", - "span_start": 11, - "span_end": 48, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": null, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.config.file_loader", - "is_test": false, - "blob_sha": "1f19ffebde5e38e4be5a5d5a678059a0f36dedb8fb8b3e00ab395c67106a87ea", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/contracts/config.py", - "content": "class ConfigProvider(ABC):\n @abstractmethod\n def load(self) -> dict[str, Any]:\n \"\"\"Return a config fragment.\"\"\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/contracts/config.py:ConfigProvider", - "span_start": 7, - "span_end": 10, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": null, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.contracts.config", - "is_test": false, - "blob_sha": "5e773880267743ee94954ea2db120c2d88c54d4312893293d1b89df405283ed4", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/contracts/health.py", - "content": "class HealthContributor(ABC):\n @abstractmethod\n def health(self) -> WorkerHealth:\n \"\"\"Return contributor health state.\"\"\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/contracts/health.py:HealthContributor", - "span_start": 7, - "span_end": 10, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": null, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.contracts.health", - "is_test": false, - "blob_sha": "6bd92611def7131e32d4dd34a8ed85e6cf3c67722ad27797032a632cb30dc097", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/contracts/application.py", - "content": "class ApplicationModule(ABC):\n @property\n @abstractmethod\n def name(self) -> str:\n \"\"\"Module name used for runtime status and diagnostics.\"\"\"\n\n @abstractmethod\n def register(self, registry: ModuleRegistry) -> None:\n \"\"\"Register workers, services, and health contributors.\"\"\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/contracts/application.py:ApplicationModule", - "span_start": 8, - "span_end": 16, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": null, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.contracts.application", - "is_test": false, - "blob_sha": "197c35634dca49c352ce3f230295a485fbffb672ce7bb8c08e752bfdf61e7fa4", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "retrieval_report": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "vector", - "C2_DEPENDENCY_GRAPH": "vector", - "C0_SOURCE_CHUNKS": "vector" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C0_SOURCE_CHUNKS": 10 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [] - } - }, - "fallback": { - "used": false, - "reason": null - }, - "retrieval_by_layer_ms": { - "C1_SYMBOL_CATALOG": 28, - "C2_DEPENDENCY_GRAPH": 34, - "C0_SOURCE_CHUNKS": 14 - } - } - }, - "diagnostics": { - "intent_correct": null, - "target_found": true, - "layers_used": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ], - "retrieval_sufficient": true, - "answer_mode": "normal", - "resolved_target": "create_runtime", - "answer_policy_branch": "normal_answer", - "decision_reason": "evidence_sufficient", - "router_result": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "retrieval_profile": "code", - "sub_intent": "FIND_TESTS", - "path_scope": [], - "layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ], - "symbol_resolution_status": "resolved" - }, - "retrieval_request": { - "rag_session_id": "7d11da21-faa0-4cea-aede-aeabe069164c", - "query": "Где тесты для create_runtime?", - "sub_intent": "FIND_TESTS", - "path_scope": [], - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ] - }, - "per_layer_outcome": [ - { - "layer_id": "C1_SYMBOL_CATALOG", - "hit_count": 8, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C2_DEPENDENCY_GRAPH", - "hit_count": 6, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C0_SOURCE_CHUNKS", - "hit_count": 10, - "empty": false, - "fallback_used": false - } - ], - "empty_layers": [], - "evidence_gate_decision": { - "sufficient": true, - "failure_reasons": [], - "evidence_count": 24 - }, - "evidence_gate_input": { - "resolved_target": "create_runtime", - "sub_intent": "FIND_TESTS", - "target_type": "symbol", - "evidence_count": 24, - "code_chunk_count": 24, - "entrypoint_count": 0, - "relation_count": 6, - "test_evidence_count": 1, - "symbol_resolution_status": "resolved", - "path_scope": [] - }, - "post_evidence_gate": { - "input": { - "answer_mode": "normal", - "degraded_message": "", - "resolved_target": "create_runtime", - "draft_answer_preview": "Прямые тесты для `create_runtime` не найдены.\n\nБлижайший косвенный тест:\n- `tests/test_runtime.py::test_public_plba_package_exports_runtime_builder_and_worker_contract`\n - Проверяет экспорт пакета plba и доступность создания runtime, включая worker контракты.", - "repair_candidate": true - }, - "output": { - "passed": true, - "action": "return", - "reasons": [], - "repair_used": false, - "final_answer_preview": "Прямые тесты для `create_runtime` не найдены.\n\nБлижайший косвенный тест:\n- `tests/test_runtime.py::test_public_plba_package_exports_runtime_builder_and_worker_contract`\n - Проверяет экспорт пакета plba и доступность создания runtime, включая worker контракты." - } - }, - "failure_reasons": [], - "timings_ms": { - "router": 1, - "retrieval": 77, - "pre_evidence_gate": 1, - "llm": 1934, - "post_evidence_gate": 1 - } - }, - "rag_rows": [ - { - "path": "src/plba/__init__.py", - "content": "const create_runtime\ncreate_runtime = plba.bootstrap.create_runtime", - "layer": "C1_SYMBOL_CATALOG", - "title": "create_runtime", - "span_start": 1, - "span_end": 1, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "fa1e84f16c8c659bcd5448637386af4d15d431064e07714e34689ee64233cb51", - "qname": "create_runtime", - "kind": "const", - "signature": "create_runtime = plba.bootstrap.create_runtime", - "parent_symbol_id": null, - "package_or_module": "src.plba.__init__", - "is_test": false, - "blob_sha": "24e755ec8c249d14fb0e675b5dbf2b71ab91afb9c849897eebfa9feb2499e19d", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/bootstrap.py", - "content": "function create_runtime\ncreate_runtime(module)", - "layer": "C1_SYMBOL_CATALOG", - "title": "create_runtime", - "span_start": 8, - "span_end": 29, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "qname": "create_runtime", - "kind": "function", - "signature": "create_runtime(module)", - "parent_symbol_id": null, - "package_or_module": "src.plba.bootstrap", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/config/__init__.py", - "content": "const FileConfigProvider\nFileConfigProvider = app_runtime.config.providers.FileConfigProvider", - "layer": "C1_SYMBOL_CATALOG", - "title": "FileConfigProvider", - "span_start": 2, - "span_end": 2, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "e449b19e5881889adeb6e056eafe1da30acbae864f06984ea2edc7c15f7cb6d6", - "qname": "FileConfigProvider", - "kind": "const", - "signature": "FileConfigProvider = app_runtime.config.providers.FileConfigProvider", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.config.__init__", - "is_test": false, - "blob_sha": "612918029820a2a983330ec92256142b55b9de4bdf3399ece18e2a02dbad9729", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/config/file_loader.py", - "content": "const hashlib\nimport hashlib", - "layer": "C1_SYMBOL_CATALOG", - "title": "hashlib", - "span_start": 3, - "span_end": 3, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "e7375824bd473da3d73d316d22e3cb6428930e2db1ffbd900ce5a8b88427bf05", - "qname": "hashlib", - "kind": "const", - "signature": "import hashlib", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.config.file_loader", - "is_test": false, - "blob_sha": "1f19ffebde5e38e4be5a5d5a678059a0f36dedb8fb8b3e00ab395c67106a87ea", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/config/file_loader.py", - "content": "const json\nimport json", - "layer": "C1_SYMBOL_CATALOG", - "title": "json", - "span_start": 4, - "span_end": 4, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "bb9e2eaf992bfd050f7072d72eed87c55b1a4b001daa034a0f7c630a61bb1d78", - "qname": "json", - "kind": "const", - "signature": "import json", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.config.file_loader", - "is_test": false, - "blob_sha": "1f19ffebde5e38e4be5a5d5a678059a0f36dedb8fb8b3e00ab395c67106a87ea", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/config/file_loader.py", - "content": "const Path\nPath = pathlib.Path", - "layer": "C1_SYMBOL_CATALOG", - "title": "Path", - "span_start": 5, - "span_end": 5, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "b785967ed1fb83aa62d5724c6d6e9c6d2b1505523db39bd941cc39b48db48306", - "qname": "Path", - "kind": "const", - "signature": "Path = pathlib.Path", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.config.file_loader", - "is_test": false, - "blob_sha": "1f19ffebde5e38e4be5a5d5a678059a0f36dedb8fb8b3e00ab395c67106a87ea", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/config/file_loader.py", - "content": "const Any\nAny = typing.Any", - "layer": "C1_SYMBOL_CATALOG", - "title": "Any", - "span_start": 6, - "span_end": 6, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "8e330833b8073585db1c4b4315947c400683a23e4c3d2e2ccbcb260f347541b6", - "qname": "Any", - "kind": "const", - "signature": "Any = typing.Any", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.config.file_loader", - "is_test": false, - "blob_sha": "1f19ffebde5e38e4be5a5d5a678059a0f36dedb8fb8b3e00ab395c67106a87ea", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/config/file_loader.py", - "content": "const annotations\nannotations = __future__.annotations", - "layer": "C1_SYMBOL_CATALOG", - "title": "annotations", - "span_start": 1, - "span_end": 1, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "5ed640ccec43a78659d50ec24f3717bf1144a182c22588f37456649ac6a4a815", - "qname": "annotations", - "kind": "const", - "signature": "annotations = __future__.annotations", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.config.file_loader", - "is_test": false, - "blob_sha": "1f19ffebde5e38e4be5a5d5a678059a0f36dedb8fb8b3e00ab395c67106a87ea", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/bootstrap.py", - "content": "create_runtime calls runtime.add_config_file", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "create_runtime:calls", - "span_start": 19, - "span_end": 19, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "4eaeec4ac55a59d5f66fd01c4754955f8fedaf4bc3df13fa769b352c7bfaacbb", - "edge_type": "calls", - "src_symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "src_qname": "create_runtime", - "dst_symbol_id": null, - "dst_ref": "runtime.add_config_file", - "resolution": "partial", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/bootstrap.py", - "content": "create_runtime reads_attr runtime.register_module", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "create_runtime:reads_attr", - "span_start": 28, - "span_end": 28, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "45516c79ff358dbf9b650a081668df0f66d2fe989300f985a1a78be6be166f8f", - "edge_type": "reads_attr", - "src_symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "src_qname": "create_runtime", - "dst_symbol_id": null, - "dst_ref": "runtime.register_module", - "resolution": "partial", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/bootstrap.py", - "content": "create_runtime instantiates RuntimeManager", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "create_runtime:instantiates", - "span_start": 17, - "span_end": 17, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "0adba17984f850ea1608c9e734d2dd5c325cfde3a8133123aa239e44935ad18e", - "edge_type": "instantiates", - "src_symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "src_qname": "create_runtime", - "dst_symbol_id": "27158ca220022eeb5083c6addf8a50775d45f7161284fd60aac48410105f4b98", - "dst_ref": "RuntimeManager", - "resolution": "resolved", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/bootstrap.py", - "content": "create_runtime calls runtime.register_module", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "create_runtime:calls", - "span_start": 28, - "span_end": 28, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "ab6003c3441addc1ba1b81edeca009165559f652f6b2cf424e5ae61b1f617de8", - "edge_type": "calls", - "src_symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "src_qname": "create_runtime", - "dst_symbol_id": null, - "dst_ref": "runtime.register_module", - "resolution": "partial", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/bootstrap.py", - "content": "create_runtime calls runtime.control_plane.register_channel", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "create_runtime:calls", - "span_start": 21, - "span_end": 27, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "2678250030b9ce47a3b3b55fac7897ac530367edc8374ac9d5e6ecafb1e483f0", - "edge_type": "calls", - "src_symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "src_qname": "create_runtime", - "dst_symbol_id": null, - "dst_ref": "runtime.control_plane.register_channel", - "resolution": "partial", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/bootstrap.py", - "content": "create_runtime reads_attr runtime.add_config_file", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "create_runtime:reads_attr", - "span_start": 19, - "span_end": 19, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "30d4e8aae984ab84d523e80d02f1caeda52d547fa3d2aa47be8845931cabbca2", - "edge_type": "reads_attr", - "src_symbol_id": "bf07296d9990db302024370ae28446c5a392411cc7188f4607c37a888f125dc3", - "src_qname": "create_runtime", - "dst_symbol_id": null, - "dst_ref": "runtime.add_config_file", - "resolution": "partial", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/__init__.py", - "content": "from plba.bootstrap import create_runtime\nfrom plba.config import ConfigFileLoader, FileConfigProvider\nfrom plba.control import ControlActionSet, ControlChannel, ControlPlaneService, HttpControlChannel\nfrom plba.contracts import (\n ApplicationModule,\n ConfigProvider,\n HealthContributor,\n TraceContext,\n TraceContextRecord,\n TraceLogMessage,\n TraceTransport,\n Worker,\n WorkerHealth,\n WorkerStatus,\n)\nfrom plba.core import ConfigurationManager, RuntimeManager, ServiceContainer\nfrom plba.health import HealthRegistry\nfrom plba.logging import LogManager\nfrom plba.queue import InMemoryTaskQueue\nfrom plba.tracing import MySqlTraceTransport, NoOpTraceTransport, TraceService\nfrom plba.workflow import (\n StepResult,\n WorkflowContext,\n WorkflowDefinition,\n WorkflowEngine,\n WorkflowEngineHooks,\n WorkflowNode,\n WorkflowRuntimeFactory,\n WorkflowStep,\n)\nfrom plba.workers import WorkerSupervisor\n\n__all__ = [\n \"ApplicationModule\",\n \"ConfigFileLoader\",\n \"ConfigProvider\",\n \"ConfigurationManager\",\n \"ControlActionSet\",\n \"ControlChannel\",\n \"ControlPlaneService\",\n \"create_runtime\",\n \"FileConfigProvider\",\n \"HealthContributor\",\n \"HealthRegistry\",\n \"HttpControlChannel\",\n \"InMemoryTaskQueue\",\n \"LogManager\",\n \"MySqlTraceTransport\",\n \"NoOpTraceTransport\",\n \"RuntimeManager\",\n \"ServiceContainer\",\n \"TraceContext\",\n \"TraceContextRecord\",\n \"TraceLogMessage\",\n \"TraceService\",\n \"TraceTransport\",\n \"StepResult\",\n \"Worker\",\n \"WorkerHealth\",\n \"WorkerStatus\",\n \"WorkflowContext\",\n \"WorkflowDefinition\",\n \"WorkflowEngine\",\n \"WorkflowEngineHooks\",\n \"WorkflowNode\",\n \"WorkflowRuntimeFactory\",\n \"WorkflowStep\",\n \"WorkerSupervisor\",\n]", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/plba/__init__.py:1-69", - "span_start": 1, - "span_end": 69, - "lexical_rank": 6, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.plba.__init__", - "is_test": false, - "blob_sha": "24e755ec8c249d14fb0e675b5dbf2b71ab91afb9c849897eebfa9feb2499e19d", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/bootstrap.py", - "content": "def create_runtime(\n module: ApplicationModule,\n *,\n config_path: str | None = None,\n enable_http_control: bool = False,\n control_host: str = \"127.0.0.1\",\n control_port: int = 8080,\n control_timeout: int = 5,\n) -> RuntimeManager:\n runtime = RuntimeManager()\n if config_path is not None:\n runtime.add_config_file(config_path)\n if enable_http_control:\n runtime.control_plane.register_channel(\n HttpControlChannel(\n host=control_host,\n port=control_port,\n timeout=control_timeout,\n )\n )\n runtime.register_module(module)\n return runtime", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/plba/bootstrap.py:create_runtime", - "span_start": 8, - "span_end": 29, - "lexical_rank": 6, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.plba.bootstrap", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_runtime.py", - "content": "def test_public_plba_package_exports_runtime_builder_and_worker_contract(tmp_path) -> None:\n import plba\n from plba import ApplicationModule as PublicApplicationModule\n from plba import InMemoryTaskQueue\n from plba import Worker as PublicWorker\n from plba import WorkerHealth as PublicWorkerHealth\n from plba import WorkerStatus as PublicWorkerStatus\n from plba import create_runtime\n\n config_path = tmp_path / \"config.yml\"\n config_path.write_text(\"platform: {}\\n\", encoding=\"utf-8\")\n\n queue = InMemoryTaskQueue[int]()\n queue.put(2)\n assert queue.get(timeout=0.01) == 2\n queue.task_done()\n\n class PublicRoutine:\n def __init__(self) -> None:\n self.runs = 0\n\n def run(self) -> None:\n if self.runs == 0:\n self.runs += 1\n\n class PublicWorkerImpl(PublicWorker):\n def __init__(self, routine: PublicRoutine) -> None:\n self._inner = RoutineWorker(\"public-worker\", routine)\n\n @property\n def name(self) -> str:\n return self._inner.name\n\n @property\n def critical(self) -> bool:\n return self._inner.critical\n\n def start(self) -> None:\n self._inner.start()\n\n def stop(self, force: bool = False) -> None:\n self._inner.stop(force=force)\n\n def health(self) -> PublicWorkerHealth:\n return self._inner.health()\n\n def status(self) -> PublicWorkerStatus:\n return self._inner.status()\n\n class PublicExampleModule(PublicApplicationModule):\n @property\n def name(self) -> str:\n return \"public-example\"\n\n def register(self, registry: ModuleRegistry) -> None:\n registry.add_worker(PublicWorkerImpl(PublicRoutine()))\n\n runtime = create_runtime(PublicExampleModule(), config_path=str(config_path))\n runtime.start()\n sleep(0.2)\n assert runtime.configuration.get() == {\"platform\": {}}\n assert runtime.status()[\"workers\"][\"registered\"] == 1\n assert hasattr(plba, \"QueueWorker\") is False\n runtime.stop()", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_runtime.py:test_public_plba_package_exports_runtime_builder_and_worker_contract", - "span_start": 342, - "span_end": 405, - "lexical_rank": 6, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 13, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_runtime", - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/config/__init__.py", - "content": "from app_runtime.config.file_loader import ConfigFileLoader\nfrom app_runtime.config.providers import FileConfigProvider\n\n__all__ = [\"ConfigFileLoader\", \"FileConfigProvider\"]", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/config/__init__.py:1-4", - "span_start": 1, - "span_end": 4, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.app_runtime.config.__init__", - "is_test": false, - "blob_sha": "612918029820a2a983330ec92256142b55b9de4bdf3399ece18e2a02dbad9729", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/config/providers.py", - "content": "class FileConfigProvider(ConfigProvider):\n def __init__(self, path: str | Path) -> None:\n self._loader = ConfigFileLoader(path)\n\n @property\n def loader(self) -> ConfigFileLoader:\n return self._loader\n\n def load(self) -> dict[str, Any]:\n config = self._loader.load_sync()\n if not isinstance(config, dict):\n raise TypeError(\"Config root must be a mapping\")\n return dict(config)", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/config/providers.py:FileConfigProvider", - "span_start": 10, - "span_end": 22, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.config.providers", - "is_test": false, - "blob_sha": "8c53ca0122d6df6c5763bca15e99434bb4daebd5a618b8fc927e9ae90b022e64", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/contracts/__init__.py", - "content": "__all__: list[str] = []", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/__init__.py:1-1", - "span_start": 1, - "span_end": 1, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.app_runtime.__init__", - "is_test": false, - "blob_sha": "8eea9df4f6d7b38ca0e39ccc27b04700e3d08dbeec8046d613d22706d19985fa", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/config/file_loader.py", - "content": "class ConfigFileLoader:\n def __init__(self, path: str | Path) -> None:\n self.path = Path(path)\n self.config: Any = None\n self.last_valid_config: Any = None\n self._last_seen_hash: str | None = None\n\n def read_text(self) -> str:\n return self.path.read_text(encoding=\"utf-8\")\n\n def parse(self, data: str) -> Any:\n suffix = self.path.suffix.lower()\n if suffix in {\".yml\", \".yaml\"}:\n return yaml.safe_load(data)\n return json.loads(data)\n\n def load_sync(self) -> Any:\n data = self.read_text()\n parsed = self.parse(data)\n self.config = parsed\n self.last_valid_config = parsed\n self._last_seen_hash = self._calculate_hash(data)\n return parsed\n\n def load_if_changed(self) -> tuple[bool, Any]:\n data = self.read_text()\n current_hash = self._calculate_hash(data)\n if current_hash == self._last_seen_hash:\n return False, self.config\n parsed = self.parse(data)\n self.config = parsed\n self.last_valid_config = parsed\n self._last_seen_hash = current_hash\n return True, parsed\n\n @staticmethod\n def _calculate_hash(data: str) -> str:\n return hashlib.sha256(data.encode(\"utf-8\")).hexdigest()", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/config/file_loader.py:ConfigFileLoader", - "span_start": 11, - "span_end": 48, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.config.file_loader", - "is_test": false, - "blob_sha": "1f19ffebde5e38e4be5a5d5a678059a0f36dedb8fb8b3e00ab395c67106a87ea", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/contracts/config.py", - "content": "class ConfigProvider(ABC):\n @abstractmethod\n def load(self) -> dict[str, Any]:\n \"\"\"Return a config fragment.\"\"\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/contracts/config.py:ConfigProvider", - "span_start": 7, - "span_end": 10, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.contracts.config", - "is_test": false, - "blob_sha": "5e773880267743ee94954ea2db120c2d88c54d4312893293d1b89df405283ed4", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/contracts/health.py", - "content": "class HealthContributor(ABC):\n @abstractmethod\n def health(self) -> WorkerHealth:\n \"\"\"Return contributor health state.\"\"\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/contracts/health.py:HealthContributor", - "span_start": 7, - "span_end": 10, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.contracts.health", - "is_test": false, - "blob_sha": "6bd92611def7131e32d4dd34a8ed85e6cf3c67722ad27797032a632cb30dc097", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/contracts/application.py", - "content": "class ApplicationModule(ABC):\n @property\n @abstractmethod\n def name(self) -> str:\n \"\"\"Module name used for runtime status and diagnostics.\"\"\"\n\n @abstractmethod\n def register(self, registry: ModuleRegistry) -> None:\n \"\"\"Register workers, services, and health contributors.\"\"\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/contracts/application.py:ApplicationModule", - "span_start": 8, - "span_end": 16, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.contracts.application", - "is_test": false, - "blob_sha": "197c35634dca49c352ce3f230295a485fbffb672ce7bb8c08e752bfdf61e7fa4", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "validation": { - "passed": true, - "action": "return", - "reasons": [] - }, - "steps": [ - { - "step": "router", - "status": "completed", - "timings_ms": { - "router": 1 - }, - "output": { - "intent": "CODE_QA", - "sub_intent": "FIND_TESTS", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - } - }, - { - "step": "retrieval", - "status": "completed", - "timings_ms": { - "retrieval": 77 - }, - "output": { - "rag_count": 24, - "answer_path_rag_count": 24, - "resolved_symbol_status": "resolved", - "resolved_symbol": "create_runtime", - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ] - }, - "diagnostics": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "vector", - "C2_DEPENDENCY_GRAPH": "vector", - "C0_SOURCE_CHUNKS": "vector" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C0_SOURCE_CHUNKS": 10 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [] - } - }, - "fallback": { - "used": false, - "reason": null - }, - "retrieval_by_layer_ms": { - "C1_SYMBOL_CATALOG": 28, - "C2_DEPENDENCY_GRAPH": 34, - "C0_SOURCE_CHUNKS": 14 - } - } - }, - { - "step": "pre_evidence_gate", - "status": "passed", - "timings_ms": { - "pre_evidence_gate": 1 - }, - "input": { - "resolved_target": "create_runtime", - "sub_intent": "FIND_TESTS", - "target_type": "symbol", - "evidence_count": 24, - "code_chunk_count": 24, - "entrypoint_count": 0, - "relation_count": 6, - "test_evidence_count": 1, - "symbol_resolution_status": "resolved", - "path_scope": [] - }, - "output": { - "passed": true, - "failure_reasons": [], - "degraded_message": "", - "evidence_count": 24 - } - }, - { - "step": "llm", - "status": "completed", - "timings_ms": { - "llm": 1934 - }, - "output": { - "prompt_name": "code_qa_find_tests_answer", - "answer_preview": "Прямые тесты для `create_runtime` не найдены.\n\nБлижайший косвенный тест:\n- `tests/test_runtime.py::test_public_plba_package_exports_runtime_builder_and_worker_contract`\n - Проверяет экспорт пакета plba и доступность создания runtime, включая worker контракты.", - "resolved_target": "create_runtime", - "answer_policy_branch": "normal_answer", - "decision_reason": "evidence_sufficient" - } - }, - { - "step": "post_evidence_gate", - "status": "passed", - "timings_ms": { - "post_evidence_gate": 1, - "post_evidence_gate_recheck": 0, - "repair": 0 - }, - "input": { - "answer_mode": "normal", - "degraded_message": "", - "resolved_target": "create_runtime", - "draft_answer_preview": "Прямые тесты для `create_runtime` не найдены.\n\nБлижайший косвенный тест:\n- `tests/test_runtime.py::test_public_plba_package_exports_runtime_builder_and_worker_contract`\n - Проверяет экспорт пакета plba и доступность создания runtime, включая worker контракты.", - "repair_candidate": true - }, - "output": { - "passed": true, - "action": "return", - "reasons": [], - "repair_used": false, - "final_answer_preview": "Прямые тесты для `create_runtime` не найдены.\n\nБлижайший косвенный тест:\n- `tests/test_runtime.py::test_public_plba_package_exports_runtime_builder_and_worker_contract`\n - Проверяет экспорт пакета plba и доступность создания runtime, включая worker контракты." - } - } - ] - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/plba_full_chain_subintents_v3/20260312_192715/full_chain_plba_code_subintents_v2_plba-v2-find-tests-create-runtime.md b/tests/pipeline_setup_v3/test_results/plba_full_chain_subintents_v3/20260312_192715/full_chain_plba_code_subintents_v2_plba-v2-find-tests-create-runtime.md deleted file mode 100644 index 88c61e4..0000000 --- a/tests/pipeline_setup_v3/test_results/plba_full_chain_subintents_v3/20260312_192715/full_chain_plba_code_subintents_v2_plba-v2-find-tests-create-runtime.md +++ /dev/null @@ -1,269 +0,0 @@ -# plba-v2-find-tests-create-runtime - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_02_pipeline/full_chain_plba_code_subintents_v2.yaml -- runner: agent_runtime -- mode: full_chain -- passed: True - -## Query -Где тесты для create_runtime? - -## Actual -{ - "intent": "CODE_QA", - "sub_intent": "FIND_TESTS", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 24, - "llm_answer": "Прямые тесты для `create_runtime` не найдены.\n\nБлижайший косвенный тест:\n- `tests/test_runtime.py::test_public_plba_package_exports_runtime_builder_and_worker_contract`\n - Проверяет экспорт пакета plba и доступность создания runtime, включая worker контракты.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "create_runtime" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ] -} - -## Steps -[ - { - "step": "router", - "status": "completed", - "timings_ms": { - "router": 1 - }, - "output": { - "intent": "CODE_QA", - "sub_intent": "FIND_TESTS", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - } - }, - { - "step": "retrieval", - "status": "completed", - "timings_ms": { - "retrieval": 77 - }, - "output": { - "rag_count": 24, - "answer_path_rag_count": 24, - "resolved_symbol_status": "resolved", - "resolved_symbol": "create_runtime", - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ] - }, - "diagnostics": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "vector", - "C2_DEPENDENCY_GRAPH": "vector", - "C0_SOURCE_CHUNKS": "vector" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C0_SOURCE_CHUNKS": 10 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [] - } - }, - "fallback": { - "used": false, - "reason": null - }, - "retrieval_by_layer_ms": { - "C1_SYMBOL_CATALOG": 28, - "C2_DEPENDENCY_GRAPH": 34, - "C0_SOURCE_CHUNKS": 14 - } - } - }, - { - "step": "pre_evidence_gate", - "status": "passed", - "timings_ms": { - "pre_evidence_gate": 1 - }, - "input": { - "resolved_target": "create_runtime", - "sub_intent": "FIND_TESTS", - "target_type": "symbol", - "evidence_count": 24, - "code_chunk_count": 24, - "entrypoint_count": 0, - "relation_count": 6, - "test_evidence_count": 1, - "symbol_resolution_status": "resolved", - "path_scope": [] - }, - "output": { - "passed": true, - "failure_reasons": [], - "degraded_message": "", - "evidence_count": 24 - } - }, - { - "step": "llm", - "status": "completed", - "timings_ms": { - "llm": 1934 - }, - "output": { - "prompt_name": "code_qa_find_tests_answer", - "answer_preview": "Прямые тесты для `create_runtime` не найдены.\n\nБлижайший косвенный тест:\n- `tests/test_runtime.py::test_public_plba_package_exports_runtime_builder_and_worker_contract`\n - Проверяет экспорт пакета plba и доступность создания runtime, включая worker контракты.", - "resolved_target": "create_runtime", - "answer_policy_branch": "normal_answer", - "decision_reason": "evidence_sufficient" - } - }, - { - "step": "post_evidence_gate", - "status": "passed", - "timings_ms": { - "post_evidence_gate": 1, - "post_evidence_gate_recheck": 0, - "repair": 0 - }, - "input": { - "answer_mode": "normal", - "degraded_message": "", - "resolved_target": "create_runtime", - "draft_answer_preview": "Прямые тесты для `create_runtime` не найдены.\n\nБлижайший косвенный тест:\n- `tests/test_runtime.py::test_public_plba_package_exports_runtime_builder_and_worker_contract`\n - Проверяет экспорт пакета plba и доступность создания runtime, включая worker контракты.", - "repair_candidate": true - }, - "output": { - "passed": true, - "action": "return", - "reasons": [], - "repair_used": false, - "final_answer_preview": "Прямые тесты для `create_runtime` не найдены.\n\nБлижайший косвенный тест:\n- `tests/test_runtime.py::test_public_plba_package_exports_runtime_builder_and_worker_contract`\n - Проверяет экспорт пакета plba и доступность создания runtime, включая worker контракты." - } - } -] - -## Diagnostics -{ - "intent_correct": null, - "target_found": true, - "layers_used": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ], - "retrieval_sufficient": true, - "answer_mode": "normal", - "resolved_target": "create_runtime", - "answer_policy_branch": "normal_answer", - "decision_reason": "evidence_sufficient", - "router_result": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "retrieval_profile": "code", - "sub_intent": "FIND_TESTS", - "path_scope": [], - "layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ], - "symbol_resolution_status": "resolved" - }, - "retrieval_request": { - "rag_session_id": "7d11da21-faa0-4cea-aede-aeabe069164c", - "query": "Где тесты для create_runtime?", - "sub_intent": "FIND_TESTS", - "path_scope": [], - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ] - }, - "per_layer_outcome": [ - { - "layer_id": "C1_SYMBOL_CATALOG", - "hit_count": 8, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C2_DEPENDENCY_GRAPH", - "hit_count": 6, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C0_SOURCE_CHUNKS", - "hit_count": 10, - "empty": false, - "fallback_used": false - } - ], - "empty_layers": [], - "evidence_gate_decision": { - "sufficient": true, - "failure_reasons": [], - "evidence_count": 24 - }, - "evidence_gate_input": { - "resolved_target": "create_runtime", - "sub_intent": "FIND_TESTS", - "target_type": "symbol", - "evidence_count": 24, - "code_chunk_count": 24, - "entrypoint_count": 0, - "relation_count": 6, - "test_evidence_count": 1, - "symbol_resolution_status": "resolved", - "path_scope": [] - }, - "post_evidence_gate": { - "input": { - "answer_mode": "normal", - "degraded_message": "", - "resolved_target": "create_runtime", - "draft_answer_preview": "Прямые тесты для `create_runtime` не найдены.\n\nБлижайший косвенный тест:\n- `tests/test_runtime.py::test_public_plba_package_exports_runtime_builder_and_worker_contract`\n - Проверяет экспорт пакета plba и доступность создания runtime, включая worker контракты.", - "repair_candidate": true - }, - "output": { - "passed": true, - "action": "return", - "reasons": [], - "repair_used": false, - "final_answer_preview": "Прямые тесты для `create_runtime` не найдены.\n\nБлижайший косвенный тест:\n- `tests/test_runtime.py::test_public_plba_package_exports_runtime_builder_and_worker_contract`\n - Проверяет экспорт пакета plba и доступность создания runtime, включая worker контракты." - } - }, - "failure_reasons": [], - "timings_ms": { - "router": 1, - "retrieval": 77, - "pre_evidence_gate": 1, - "llm": 1934, - "post_evidence_gate": 1 - } -} - -## Mismatches -- none \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/plba_full_chain_subintents_v3/20260312_192715/full_chain_plba_code_subintents_v2_plba-v2-find-tests-runtime-manager.json b/tests/pipeline_setup_v3/test_results/plba_full_chain_subintents_v3/20260312_192715/full_chain_plba_code_subintents_v2_plba-v2-find-tests-runtime-manager.json deleted file mode 100644 index 2ba332b..0000000 --- a/tests/pipeline_setup_v3/test_results/plba_full_chain_subintents_v3/20260312_192715/full_chain_plba_code_subintents_v2_plba-v2-find-tests-runtime-manager.json +++ /dev/null @@ -1,3337 +0,0 @@ -{ - "case_id": "plba-v2-find-tests-runtime-manager", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_02_pipeline/full_chain_plba_code_subintents_v2.yaml", - "runner": "agent_runtime", - "mode": "full_chain", - "query": "Где тесты для RuntimeManager?", - "actual": { - "intent": "CODE_QA", - "sub_intent": "FIND_TESTS", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 24, - "llm_answer": "Прямые тесты для `RuntimeManager` находятся в файле `tests/test_runtime.py`.\n\nКосвенные тесты:\n- В файле `tests/test_business_control_actions.py` есть тесты, использующие компоненты контроля, которые взаимодействуют с `RuntimeManager`.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "RuntimeManager" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ] - }, - "passed": true, - "mismatches": [], - "details": { - "query": "Где тесты для RuntimeManager?", - "router_result": { - "schema_version": "1.1", - "intent": "CODE_QA", - "retrieval_profile": "code", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query_plan": { - "raw": "Где тесты для RuntimeManager?", - "normalized": "Где тесты для RuntimeManager?", - "sub_intent": "FIND_TESTS", - "negations": [], - "expansions": [ - "test", - "unit test", - "RuntimeManager" - ], - "keyword_hints": [ - "RuntimeManager" - ], - "path_hints": [], - "doc_scope_hints": [], - "symbol_candidates": [ - "RuntimeManager" - ], - "symbol_kind_hint": "class", - "anchors": [ - { - "type": "SYMBOL", - "value": "RuntimeManager", - "source": "user_text", - "subtype": null, - "span": { - "start": 14, - "end": 28 - }, - "confidence": 0.88 - }, - { - "type": "KEY_TERM", - "value": "тест", - "source": "user_text", - "subtype": null, - "span": { - "start": 4, - "end": 9 - }, - "confidence": 0.9 - } - ] - }, - "retrieval_spec": { - "domains": [ - "CODE" - ], - "layer_queries": [ - { - "layer_id": "C1_SYMBOL_CATALOG", - "top_k": 8 - }, - { - "layer_id": "C2_DEPENDENCY_GRAPH", - "top_k": 6 - }, - { - "layer_id": "C0_SOURCE_CHUNKS", - "top_k": 10 - } - ], - "filters": { - "test_policy": "INCLUDE", - "path_scope": [], - "language": [ - "python" - ] - }, - "rerank_profile": "code" - }, - "retrieval_constraints": { - "include_globs": [ - "src/**", - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "test_file_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "test_symbol_patterns": [ - "test_runtime_manager", - "TestRuntimeManager", - "RuntimeManager" - ], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - }, - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "RuntimeManager", - "alternatives": [ - "RuntimeManager", - "RuntimeManager", - "RuntimeManager", - "RuntimeManager", - "RuntimeManager" - ], - "confidence": 0.99 - }, - "evidence_policy": { - "require_def": true, - "require_flow": true, - "require_spec": false, - "allow_answer_without_evidence": false - } - }, - "retrieval_request": { - "rag_session_id": "7d11da21-faa0-4cea-aede-aeabe069164c", - "query": "Где тесты для RuntimeManager?", - "sub_intent": "FIND_TESTS", - "path_scope": [], - "keyword_hints": [ - "RuntimeManager" - ], - "symbol_candidates": [ - "RuntimeManager" - ], - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ], - "retrieval_spec": { - "domains": [ - "CODE" - ], - "layer_queries": [ - { - "layer_id": "C1_SYMBOL_CATALOG", - "top_k": 8 - }, - { - "layer_id": "C2_DEPENDENCY_GRAPH", - "top_k": 6 - }, - { - "layer_id": "C0_SOURCE_CHUNKS", - "top_k": 10 - } - ], - "filters": { - "test_policy": "INCLUDE", - "path_scope": [], - "language": [ - "python" - ] - }, - "rerank_profile": "code" - }, - "retrieval_constraints": { - "include_globs": [ - "src/**", - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "test_file_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "test_symbol_patterns": [ - "test_runtime_manager", - "TestRuntimeManager", - "RuntimeManager" - ], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - }, - "query_plan": { - "raw": "Где тесты для RuntimeManager?", - "normalized": "Где тесты для RuntimeManager?", - "sub_intent": "FIND_TESTS", - "negations": [], - "expansions": [ - "test", - "unit test", - "RuntimeManager" - ], - "keyword_hints": [ - "RuntimeManager" - ], - "path_hints": [], - "doc_scope_hints": [], - "symbol_candidates": [ - "RuntimeManager" - ], - "symbol_kind_hint": "class", - "anchors": [ - { - "type": "SYMBOL", - "value": "RuntimeManager", - "source": "user_text", - "subtype": null, - "span": { - "start": 14, - "end": 28 - }, - "confidence": 0.88 - }, - { - "type": "KEY_TERM", - "value": "тест", - "source": "user_text", - "subtype": null, - "span": { - "start": 4, - "end": 9 - }, - "confidence": 0.9 - } - ] - } - }, - "retrieval_result": { - "target_symbol_candidates": [ - "RuntimeManager", - "ControlPlaneService" - ], - "resolved_symbol": "RuntimeManager", - "symbol_resolution_status": "resolved", - "file_candidates": [ - "src/plba/bootstrap.py", - "tests/test_runtime.py", - "src/app_runtime/core/runtime.py", - "src/plba/__init__.py", - "src/plba/core.py", - "tests/test_business_control_actions.py", - "src/app_runtime/control/service.py", - "src/app_runtime/control/__init__.py", - "src/plba/control.py", - "src/app_runtime/control/http_channel.py", - "src/app_runtime/control/http_app.py", - "src/app_runtime/control/http_runner.py", - "src/app_runtime/control/base.py" - ], - "code_chunks": [ - { - "layer": "C1_SYMBOL_CATALOG", - "path": "src/plba/bootstrap.py", - "title": "RuntimeManager", - "content": "const RuntimeManager\nRuntimeManager = app_runtime.core.runtime.RuntimeManager", - "start_line": 4, - "end_line": 4, - "metadata": { - "symbol_id": "27158ca220022eeb5083c6addf8a50775d45f7161284fd60aac48410105f4b98", - "qname": "RuntimeManager", - "kind": "const", - "signature": "RuntimeManager = app_runtime.core.runtime.RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "src.plba.bootstrap", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C1_SYMBOL_CATALOG", - "path": "tests/test_runtime.py", - "title": "RuntimeManager", - "content": "const RuntimeManager\nRuntimeManager = app_runtime.core.runtime.RuntimeManager", - "start_line": 12, - "end_line": 12, - "metadata": { - "symbol_id": "aeadc039653807b0da1ca6e3cc1078ee61cfc510b28e7f9c2ec04c59da43cc8d", - "qname": "RuntimeManager", - "kind": "const", - "signature": "RuntimeManager = app_runtime.core.runtime.RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "tests.test_runtime", - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C1_SYMBOL_CATALOG", - "path": "src/app_runtime/core/runtime.py", - "title": "RuntimeManager", - "content": "class RuntimeManager\nRuntimeManager", - "start_line": 18, - "end_line": 179, - "metadata": { - "symbol_id": "7e4a9381328c5803bbc6179458612fc4e947d928aa7bf8b4b2bebb2c8592f758", - "qname": "RuntimeManager", - "kind": "class", - "signature": "RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.core.runtime", - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C1_SYMBOL_CATALOG", - "path": "src/plba/__init__.py", - "title": "RuntimeManager", - "content": "const RuntimeManager\nRuntimeManager = plba.core.RuntimeManager", - "start_line": 16, - "end_line": 16, - "metadata": { - "symbol_id": "7eacec84f9b8d6c4201374591faecdac7493091c263681495c338973f2971ad9", - "qname": "RuntimeManager", - "kind": "const", - "signature": "RuntimeManager = plba.core.RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "src.plba.__init__", - "is_test": false, - "blob_sha": "24e755ec8c249d14fb0e675b5dbf2b71ab91afb9c849897eebfa9feb2499e19d", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C1_SYMBOL_CATALOG", - "path": "src/plba/core.py", - "title": "RuntimeManager", - "content": "const RuntimeManager\nRuntimeManager = app_runtime.core.runtime.RuntimeManager", - "start_line": 2, - "end_line": 2, - "metadata": { - "symbol_id": "e1684562d978b7af7fe9b27dc5869d770348a87b5dc19a50360f58544668578b", - "qname": "RuntimeManager", - "kind": "const", - "signature": "RuntimeManager = app_runtime.core.runtime.RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "src.plba.core", - "is_test": false, - "blob_sha": "c0ae25110d20e665216616e26b68adfe035b624ba45d31d1272fb21f906f9ca8", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C1_SYMBOL_CATALOG", - "path": "tests/test_business_control_actions.py", - "title": "RuntimeManager", - "content": "const RuntimeManager\nRuntimeManager = app_runtime.core.runtime.RuntimeManager", - "start_line": 14, - "end_line": 14, - "metadata": { - "symbol_id": "a1572ea8183dc0cd6ddbc74342bbde8c28cecfde37ad40b62feff09f8d103d11", - "qname": "RuntimeManager", - "kind": "const", - "signature": "RuntimeManager = app_runtime.core.runtime.RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C1_SYMBOL_CATALOG", - "path": "src/app_runtime/control/service.py", - "title": "RuntimeManager", - "content": "const RuntimeManager\nRuntimeManager = app_runtime.core.runtime.RuntimeManager", - "start_line": 9, - "end_line": 9, - "metadata": { - "symbol_id": "62a9575c77aad894120d18b4f2a08cf2ba42f77e9be4a8a432b767d157701afe", - "qname": "RuntimeManager", - "kind": "const", - "signature": "RuntimeManager = app_runtime.core.runtime.RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.control.service", - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C1_SYMBOL_CATALOG", - "path": "src/app_runtime/control/__init__.py", - "title": "ControlPlaneService", - "content": "const ControlPlaneService\nControlPlaneService = app_runtime.control.service.ControlPlaneService", - "start_line": 3, - "end_line": 3, - "metadata": { - "symbol_id": "217e8f044d1c01644bf7b81e5046af9e84469210c692a2fb0c476a19bb069ae1", - "qname": "ControlPlaneService", - "kind": "const", - "signature": "ControlPlaneService = app_runtime.control.service.ControlPlaneService", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.control.__init__", - "is_test": false, - "blob_sha": "bf3c37e3369a84cc618adc0fd71c232e5eb4b871eaff743069a17e661e498316", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "path": "src/app_runtime/control/service.py", - "title": "ControlPlaneService.__init__:dataflow_slice", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.stop", - "start_line": 14, - "end_line": 25, - "metadata": { - "edge_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d", - "dst_ref": "ControlPlaneService.stop", - "resolution": "resolved", - "slice_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.stop" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "path": "src/app_runtime/control/service.py", - "title": "ControlPlaneService.__init__:dataflow_slice", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._stop_async", - "start_line": 14, - "end_line": 51, - "metadata": { - "edge_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a", - "dst_ref": "ControlPlaneService._stop_async", - "resolution": "resolved", - "slice_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._stop_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "path": "src/app_runtime/control/service.py", - "title": "ControlPlaneService.__init__:dataflow_slice", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.register_channel", - "start_line": 14, - "end_line": 17, - "metadata": { - "edge_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957", - "dst_ref": "ControlPlaneService.register_channel", - "resolution": "resolved", - "slice_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.register_channel" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "path": "src/app_runtime/control/service.py", - "title": "ControlPlaneService.__init__:dataflow_slice", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.start", - "start_line": 14, - "end_line": 20, - "metadata": { - "edge_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154", - "dst_ref": "ControlPlaneService.start", - "resolution": "resolved", - "slice_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.start" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "path": "src/app_runtime/control/service.py", - "title": "ControlPlaneService.__init__:dataflow_slice", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._start_async", - "start_line": 14, - "end_line": 47, - "metadata": { - "edge_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517", - "dst_ref": "ControlPlaneService._start_async", - "resolution": "resolved", - "slice_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._start_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "path": "src/app_runtime/core/runtime.py", - "title": "RuntimeManager.__init__:dataflow_slice", - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager.add_config_file", - "start_line": 32, - "end_line": 52, - "metadata": { - "edge_id": "a23b8a11ebdb12708b60c96ea12a69f7f042082f1adfddd572444e246d81d167", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "57ffbd4f0d9fdf3507c2b8624312ce211f3d02fdf86a57a8ec90778d8a7b498d", - "dst_ref": "RuntimeManager.add_config_file", - "resolution": "resolved", - "slice_id": "a23b8a11ebdb12708b60c96ea12a69f7f042082f1adfddd572444e246d81d167", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager.add_config_file" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "57ffbd4f0d9fdf3507c2b8624312ce211f3d02fdf86a57a8ec90778d8a7b498d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C0_SOURCE_CHUNKS", - "path": "src/plba/control.py", - "title": "src/plba/control.py:1-10", - "content": "from app_runtime.control.base import ControlActionSet, ControlChannel\nfrom app_runtime.control.http_channel import HttpControlChannel\nfrom app_runtime.control.service import ControlPlaneService\n\n__all__ = [\n \"ControlActionSet\",\n \"ControlChannel\",\n \"ControlPlaneService\",\n \"HttpControlChannel\",\n]", - "start_line": 1, - "end_line": 10, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.plba.control", - "is_test": false, - "blob_sha": "31bd5c4481bfa7fbca8fae56d4860a67e3953ca74474ac8439e1f39b685d7bc8", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C0_SOURCE_CHUNKS", - "path": "tests/test_business_control_actions.py", - "title": "tests/test_business_control_actions.py:IntervalRoutine", - "content": "class IntervalRoutine:\n calls: list[float] = field(default_factory=list)\n _lock: Lock = field(default_factory=Lock)\n\n def run(self) -> None:\n with self._lock:\n self.calls.append(monotonic())\n\n def wait_runs(self, count: int, timeout: float) -> bool:\n deadline = monotonic() + timeout\n while monotonic() < deadline:\n with self._lock:\n if len(self.calls) >= count:\n return True\n sleep(0.01)\n return False\n\n def deltas(self) -> list[float]:\n with self._lock:\n return [self.calls[index + 1] - self.calls[index] for index in range(len(self.calls) - 1)]", - "start_line": 18, - "end_line": 37, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C0_SOURCE_CHUNKS", - "path": "src/app_runtime/control/http_channel.py", - "title": "src/app_runtime/control/http_channel.py:HttpControlChannel", - "content": "class HttpControlChannel(ControlChannel):\n def __init__(self, host: str, port: int, timeout: int) -> None:\n self._timeout = timeout\n self._runner = UvicornThreadRunner(host, port, timeout)\n self._factory = HttpControlAppFactory()\n self._actions: ControlActionSet | None = None\n\n async def start(self, actions: ControlActionSet) -> None:\n self._actions = actions\n app = self._factory.create(self._health_response, self._action_response)\n await self._runner.start(app)\n\n async def stop(self) -> None:\n await self._runner.stop()\n\n @property\n def port(self) -> int:\n return self._runner.port\n\n async def _health_response(self) -> dict[str, object]:\n if self._actions is None:\n return {\"status\": \"unhealthy\", \"detail\": \"control actions are not configured\"}\n return await asyncio.wait_for(self._actions.health(), timeout=float(self._timeout))\n\n async def _action_response(self, action: str, _client_source: str = \"unknown\") -> JSONResponse:\n if self._actions is None:\n return JSONResponse(content={\"status\": \"error\", \"detail\": f\"{action} handler is not configured\"}, status_code=404)\n callbacks = {\n \"start\": self._actions.start,\n \"stop\": self._actions.stop,\n \"status\": self._actions.status,\n }\n callback = callbacks.get(action)\n if callback is None:\n return JSONResponse(content={\"status\": \"error\", \"detail\": f\"unsupported action: {action}\"}, status_code=404)\n action_timeout = max(float(self._timeout), 10.0) if action in {\"start\", \"stop\"} else float(self._timeout)\n try:\n detail = await asyncio.wait_for(callback(), timeout=action_timeout)\n except asyncio.TimeoutError:\n return JSONResponse(\n content={\"status\": \"accepted\", \"detail\": f\"{action} operation is still in progress\"},\n status_code=202,\n )\n except Exception as exc:\n return JSONResponse(content={\"status\": \"error\", \"detail\": str(exc)}, status_code=500)\n return JSONResponse(content={\"status\": \"ok\", \"detail\": detail or f\"{action} action accepted\"}, status_code=200)", - "start_line": 12, - "end_line": 57, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.http_channel", - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C0_SOURCE_CHUNKS", - "path": "src/app_runtime/control/http_app.py", - "title": "src/app_runtime/control/http_app.py:HttpControlAppFactory", - "content": "class HttpControlAppFactory:\n def create(\n self,\n health_provider: Callable[[], Awaitable[HealthPayload]],\n action_provider: Callable[[str, str], Awaitable[JSONResponse]],\n ) -> FastAPI:\n app = FastAPI(title=\"PLBA Control API\")\n\n @app.middleware(\"http\")\n async def log_api_call(request: Request, call_next): # type: ignore[no-untyped-def]\n started = time.monotonic()\n response = await call_next(request)\n response.headers[\"X-Response-Time-Ms\"] = str(int((time.monotonic() - started) * 1000))\n return response\n\n @app.get(\"/health\")\n async def health() -> JSONResponse:\n payload = await health_provider()\n status_code = 200 if payload.get(\"status\") == \"ok\" else 503\n return JSONResponse(content=payload, status_code=status_code)\n\n @app.get(\"/actions/{action}\")\n @app.post(\"/actions/{action}\")\n async def action(action: str, request: Request) -> JSONResponse:\n client_source = self._client_source(request)\n if action in {\"start\", \"stop\"}:\n LOGGER.warning(\"Control action requested: /actions/%s client=%s\", action, client_source)\n return await action_provider(action, client_source)\n\n return app\n\n def _client_source(self, request: Request) -> str:\n explicit_header = request.headers.get(\"X-Client-Source\", \"\").strip()\n if explicit_header:\n return explicit_header\n user_agent = request.headers.get(\"User-Agent\", \"\").strip()\n if user_agent:\n return f\"user-agent:{user_agent}\"\n return \"unknown\"", - "start_line": 15, - "end_line": 53, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.http_app", - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C0_SOURCE_CHUNKS", - "path": "src/app_runtime/control/http_runner.py", - "title": "src/app_runtime/control/http_runner.py:UvicornThreadRunner", - "content": "class UvicornThreadRunner:\n def __init__(self, host: str, port: int, timeout: int) -> None:\n self._host = host\n self._port = port\n self._timeout = timeout\n self._server: Server | None = None\n self._thread: Thread | None = None\n self._error: BaseException | None = None\n\n async def start(self, app: FastAPI) -> None:\n if self._thread is not None and self._thread.is_alive():\n return\n self._error = None\n config = Config(app=app, host=self._host, port=self._port, log_level=\"warning\")\n self._server = Server(config)\n self._thread = Thread(target=self._serve, name=\"plba-http-control\", daemon=True)\n self._thread.start()\n await self._wait_until_started()\n\n async def stop(self) -> None:\n if self._server is None or self._thread is None:\n return\n self._server.should_exit = True\n await asyncio.to_thread(self._thread.join, self._timeout)\n self._server = None\n self._thread = None\n\n @property\n def port(self) -> int:\n if self._server is None or not getattr(self._server, \"servers\", None):\n return self._port\n socket = self._server.servers[0].sockets[0]\n return int(socket.getsockname()[1])\n\n async def _wait_until_started(self) -> None:\n if self._server is None:\n raise RuntimeError(\"Server is not initialized\")\n deadline = asyncio.get_running_loop().time() + max(float(self._timeout), 1.0)\n while not self._server.started:\n if self._error is not None:\n raise RuntimeError(\"HTTP control server failed to start\") from self._error\n if asyncio.get_running_loop().time() >= deadline:\n raise TimeoutError(\"HTTP control server startup timed out\")\n await asyncio.sleep(0.05)\n\n def _serve(self) -> None:\n if self._server is None:\n return\n try:\n asyncio.run(self._server.serve())\n except BaseException as exc: # noqa: BLE001\n self._error = exc", - "start_line": 10, - "end_line": 61, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.http_runner", - "is_test": false, - "blob_sha": "3779fdd2878b770e789a35bb2a89c9d79f13b61c26d7db1b3b683f9bb9e1623f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C0_SOURCE_CHUNKS", - "path": "src/app_runtime/control/service.py", - "title": "src/app_runtime/control/service.py:ControlPlaneService", - "content": "class ControlPlaneService:\n def __init__(self) -> None:\n self._channels: list[ControlChannel] = []\n\n def register_channel(self, channel: ControlChannel) -> None:\n self._channels.append(channel)\n\n def start(self, runtime: RuntimeManager) -> None:\n if not self._channels:\n return\n asyncio.run(self._start_async(runtime))\n\n def stop(self) -> None:\n if not self._channels:\n return\n asyncio.run(self._stop_async())\n\n def snapshot(self, runtime: RuntimeManager) -> dict[str, object]:\n health = runtime.current_health()\n return {\n \"runtime\": {\"state\": runtime._state.value},\n \"modules\": list(runtime.registry.modules),\n \"services\": runtime.services.snapshot(),\n \"workers\": runtime.workers.snapshot(),\n \"health\": runtime.health.snapshot(runtime.workers.healths()) | {\"status\": health[\"status\"]},\n \"config\": runtime.configuration.get(),\n }\n\n async def _start_async(self, runtime: RuntimeManager) -> None:\n actions = ControlActionSet(\n health=runtime.health_status,\n start=runtime.start_runtime,\n stop=runtime.stop_runtime,\n status=runtime.runtime_status,\n )\n for channel in self._channels:\n await channel.start(actions)\n\n async def _stop_async(self) -> None:\n for channel in reversed(self._channels):\n await channel.stop()", - "start_line": 12, - "end_line": 52, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.service", - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C0_SOURCE_CHUNKS", - "path": "src/app_runtime/control/base.py", - "title": "src/app_runtime/control/base.py:ControlActionSet", - "content": "class ControlActionSet:\n health: HealthHandler\n start: ActionHandler\n stop: ActionHandler\n status: ActionHandler", - "start_line": 14, - "end_line": 18, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.base", - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C0_SOURCE_CHUNKS", - "path": "src/app_runtime/control/__init__.py", - "title": "src/app_runtime/control/__init__.py:1-5", - "content": "from app_runtime.control.base import ControlActionSet, ControlChannel\nfrom app_runtime.control.http_channel import HttpControlChannel\nfrom app_runtime.control.service import ControlPlaneService\n\n__all__ = [\"ControlActionSet\", \"ControlChannel\", \"ControlPlaneService\", \"HttpControlChannel\"]", - "start_line": 1, - "end_line": 5, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.app_runtime.control.__init__", - "is_test": false, - "blob_sha": "bf3c37e3369a84cc618adc0fd71c232e5eb4b871eaff743069a17e661e498316", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C0_SOURCE_CHUNKS", - "path": "src/app_runtime/control/base.py", - "title": "src/app_runtime/control/base.py:ControlChannel", - "content": "class ControlChannel(ABC):\n @abstractmethod\n async def start(self, actions: ControlActionSet) -> None:\n \"\"\"Start the control channel and bind handlers.\"\"\"\n\n @abstractmethod\n async def stop(self) -> None:\n \"\"\"Stop the control channel and release resources.\"\"\"", - "start_line": 21, - "end_line": 28, - "metadata": { - "chunk_index": 1, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.base", - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C0_SOURCE_CHUNKS", - "path": "tests/test_business_control_actions.py", - "title": "tests/test_business_control_actions.py:BlockingRoutine", - "content": "class BlockingRoutine:\n def __init__(self, started: Event, release: Event) -> None:\n self._started = started\n self._release = release\n\n def run(self) -> None:\n self._started.set()\n self._release.wait(timeout=5.0)", - "start_line": 40, - "end_line": 47, - "metadata": { - "chunk_index": 1, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "relations": [ - { - "path": "src/app_runtime/control/service.py", - "start_line": 14, - "end_line": 25, - "edge_type": "dataflow_slice", - "source": "ControlPlaneService.__init__", - "target": "ControlPlaneService.stop", - "metadata": { - "edge_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d", - "dst_ref": "ControlPlaneService.stop", - "resolution": "resolved", - "slice_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.stop" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - }, - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.stop" - }, - { - "path": "src/app_runtime/control/service.py", - "start_line": 14, - "end_line": 51, - "edge_type": "dataflow_slice", - "source": "ControlPlaneService.__init__", - "target": "ControlPlaneService._stop_async", - "metadata": { - "edge_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a", - "dst_ref": "ControlPlaneService._stop_async", - "resolution": "resolved", - "slice_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._stop_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - }, - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._stop_async" - }, - { - "path": "src/app_runtime/control/service.py", - "start_line": 14, - "end_line": 17, - "edge_type": "dataflow_slice", - "source": "ControlPlaneService.__init__", - "target": "ControlPlaneService.register_channel", - "metadata": { - "edge_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957", - "dst_ref": "ControlPlaneService.register_channel", - "resolution": "resolved", - "slice_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.register_channel" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - }, - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.register_channel" - }, - { - "path": "src/app_runtime/control/service.py", - "start_line": 14, - "end_line": 20, - "edge_type": "dataflow_slice", - "source": "ControlPlaneService.__init__", - "target": "ControlPlaneService.start", - "metadata": { - "edge_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154", - "dst_ref": "ControlPlaneService.start", - "resolution": "resolved", - "slice_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.start" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - }, - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.start" - }, - { - "path": "src/app_runtime/control/service.py", - "start_line": 14, - "end_line": 47, - "edge_type": "dataflow_slice", - "source": "ControlPlaneService.__init__", - "target": "ControlPlaneService._start_async", - "metadata": { - "edge_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517", - "dst_ref": "ControlPlaneService._start_async", - "resolution": "resolved", - "slice_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._start_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - }, - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._start_async" - }, - { - "path": "src/app_runtime/core/runtime.py", - "start_line": 32, - "end_line": 52, - "edge_type": "dataflow_slice", - "source": "RuntimeManager.__init__", - "target": "RuntimeManager.add_config_file", - "metadata": { - "edge_id": "a23b8a11ebdb12708b60c96ea12a69f7f042082f1adfddd572444e246d81d167", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "57ffbd4f0d9fdf3507c2b8624312ce211f3d02fdf86a57a8ec90778d8a7b498d", - "dst_ref": "RuntimeManager.add_config_file", - "resolution": "resolved", - "slice_id": "a23b8a11ebdb12708b60c96ea12a69f7f042082f1adfddd572444e246d81d167", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager.add_config_file" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "57ffbd4f0d9fdf3507c2b8624312ce211f3d02fdf86a57a8ec90778d8a7b498d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - }, - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager.add_config_file" - } - ], - "semantic_hints": [], - "entrypoints": [], - "test_candidates": [ - { - "path": "tests/test_business_control_actions.py", - "title": "tests/test_business_control_actions.py:IntervalRoutine", - "content": "class IntervalRoutine:\n calls: list[float] = field(default_factory=list)\n _lock: Lock = field(default_factory=Lock)\n\n def run(self) -> None:\n with self._lock:\n self.calls.append(monotonic())\n\n def wait_runs(self, count: int, timeout: float) -> bool:\n deadline = m" - }, - { - "path": "tests/test_business_control_actions.py", - "title": "tests/test_business_control_actions.py:BlockingRoutine", - "content": "class BlockingRoutine:\n def __init__(self, started: Event, release: Event) -> None:\n self._started = started\n self._release = release\n\n def run(self) -> None:\n self._started.set()\n self._release.wait(timeout=5.0)" - } - ], - "layer_outcomes": [ - { - "layer_id": "C1_SYMBOL_CATALOG", - "hit_count": 8, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C2_DEPENDENCY_GRAPH", - "hit_count": 6, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C0_SOURCE_CHUNKS", - "hit_count": 10, - "empty": false, - "fallback_used": false - } - ], - "missing_layers": [], - "raw_rows": [ - { - "path": "src/plba/bootstrap.py", - "content": "const RuntimeManager\nRuntimeManager = app_runtime.core.runtime.RuntimeManager", - "layer": "C1_SYMBOL_CATALOG", - "title": "RuntimeManager", - "span_start": 4, - "span_end": 4, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": null, - "metadata": { - "symbol_id": "27158ca220022eeb5083c6addf8a50775d45f7161284fd60aac48410105f4b98", - "qname": "RuntimeManager", - "kind": "const", - "signature": "RuntimeManager = app_runtime.core.runtime.RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "src.plba.bootstrap", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_runtime.py", - "content": "const RuntimeManager\nRuntimeManager = app_runtime.core.runtime.RuntimeManager", - "layer": "C1_SYMBOL_CATALOG", - "title": "RuntimeManager", - "span_start": 12, - "span_end": 12, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": null, - "metadata": { - "symbol_id": "aeadc039653807b0da1ca6e3cc1078ee61cfc510b28e7f9c2ec04c59da43cc8d", - "qname": "RuntimeManager", - "kind": "const", - "signature": "RuntimeManager = app_runtime.core.runtime.RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "tests.test_runtime", - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "class RuntimeManager\nRuntimeManager", - "layer": "C1_SYMBOL_CATALOG", - "title": "RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": null, - "metadata": { - "symbol_id": "7e4a9381328c5803bbc6179458612fc4e947d928aa7bf8b4b2bebb2c8592f758", - "qname": "RuntimeManager", - "kind": "class", - "signature": "RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.core.runtime", - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/__init__.py", - "content": "const RuntimeManager\nRuntimeManager = plba.core.RuntimeManager", - "layer": "C1_SYMBOL_CATALOG", - "title": "RuntimeManager", - "span_start": 16, - "span_end": 16, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": null, - "metadata": { - "symbol_id": "7eacec84f9b8d6c4201374591faecdac7493091c263681495c338973f2971ad9", - "qname": "RuntimeManager", - "kind": "const", - "signature": "RuntimeManager = plba.core.RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "src.plba.__init__", - "is_test": false, - "blob_sha": "24e755ec8c249d14fb0e675b5dbf2b71ab91afb9c849897eebfa9feb2499e19d", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/core.py", - "content": "const RuntimeManager\nRuntimeManager = app_runtime.core.runtime.RuntimeManager", - "layer": "C1_SYMBOL_CATALOG", - "title": "RuntimeManager", - "span_start": 2, - "span_end": 2, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": null, - "metadata": { - "symbol_id": "e1684562d978b7af7fe9b27dc5869d770348a87b5dc19a50360f58544668578b", - "qname": "RuntimeManager", - "kind": "const", - "signature": "RuntimeManager = app_runtime.core.runtime.RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "src.plba.core", - "is_test": false, - "blob_sha": "c0ae25110d20e665216616e26b68adfe035b624ba45d31d1272fb21f906f9ca8", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "const RuntimeManager\nRuntimeManager = app_runtime.core.runtime.RuntimeManager", - "layer": "C1_SYMBOL_CATALOG", - "title": "RuntimeManager", - "span_start": 14, - "span_end": 14, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": null, - "metadata": { - "symbol_id": "a1572ea8183dc0cd6ddbc74342bbde8c28cecfde37ad40b62feff09f8d103d11", - "qname": "RuntimeManager", - "kind": "const", - "signature": "RuntimeManager = app_runtime.core.runtime.RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "const RuntimeManager\nRuntimeManager = app_runtime.core.runtime.RuntimeManager", - "layer": "C1_SYMBOL_CATALOG", - "title": "RuntimeManager", - "span_start": 9, - "span_end": 9, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": null, - "metadata": { - "symbol_id": "62a9575c77aad894120d18b4f2a08cf2ba42f77e9be4a8a432b767d157701afe", - "qname": "RuntimeManager", - "kind": "const", - "signature": "RuntimeManager = app_runtime.core.runtime.RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.control.service", - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/__init__.py", - "content": "const ControlPlaneService\nControlPlaneService = app_runtime.control.service.ControlPlaneService", - "layer": "C1_SYMBOL_CATALOG", - "title": "ControlPlaneService", - "span_start": 3, - "span_end": 3, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": null, - "metadata": { - "symbol_id": "217e8f044d1c01644bf7b81e5046af9e84469210c692a2fb0c476a19bb069ae1", - "qname": "ControlPlaneService", - "kind": "const", - "signature": "ControlPlaneService = app_runtime.control.service.ControlPlaneService", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.control.__init__", - "is_test": false, - "blob_sha": "bf3c37e3369a84cc618adc0fd71c232e5eb4b871eaff743069a17e661e498316", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.stop", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 25, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": null, - "metadata": { - "edge_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d", - "dst_ref": "ControlPlaneService.stop", - "resolution": "resolved", - "slice_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.stop" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._stop_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 51, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": null, - "metadata": { - "edge_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a", - "dst_ref": "ControlPlaneService._stop_async", - "resolution": "resolved", - "slice_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._stop_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.register_channel", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 17, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": null, - "metadata": { - "edge_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957", - "dst_ref": "ControlPlaneService.register_channel", - "resolution": "resolved", - "slice_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.register_channel" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.start", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 20, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": null, - "metadata": { - "edge_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154", - "dst_ref": "ControlPlaneService.start", - "resolution": "resolved", - "slice_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.start" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._start_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 47, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": null, - "metadata": { - "edge_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517", - "dst_ref": "ControlPlaneService._start_async", - "resolution": "resolved", - "slice_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._start_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager.add_config_file", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 32, - "span_end": 52, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": null, - "metadata": { - "edge_id": "a23b8a11ebdb12708b60c96ea12a69f7f042082f1adfddd572444e246d81d167", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "57ffbd4f0d9fdf3507c2b8624312ce211f3d02fdf86a57a8ec90778d8a7b498d", - "dst_ref": "RuntimeManager.add_config_file", - "resolution": "resolved", - "slice_id": "a23b8a11ebdb12708b60c96ea12a69f7f042082f1adfddd572444e246d81d167", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager.add_config_file" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "57ffbd4f0d9fdf3507c2b8624312ce211f3d02fdf86a57a8ec90778d8a7b498d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/control.py", - "content": "from app_runtime.control.base import ControlActionSet, ControlChannel\nfrom app_runtime.control.http_channel import HttpControlChannel\nfrom app_runtime.control.service import ControlPlaneService\n\n__all__ = [\n \"ControlActionSet\",\n \"ControlChannel\",\n \"ControlPlaneService\",\n \"HttpControlChannel\",\n]", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/plba/control.py:1-10", - "span_start": 1, - "span_end": 10, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": null, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.plba.control", - "is_test": false, - "blob_sha": "31bd5c4481bfa7fbca8fae56d4860a67e3953ca74474ac8439e1f39b685d7bc8", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "class IntervalRoutine:\n calls: list[float] = field(default_factory=list)\n _lock: Lock = field(default_factory=Lock)\n\n def run(self) -> None:\n with self._lock:\n self.calls.append(monotonic())\n\n def wait_runs(self, count: int, timeout: float) -> bool:\n deadline = monotonic() + timeout\n while monotonic() < deadline:\n with self._lock:\n if len(self.calls) >= count:\n return True\n sleep(0.01)\n return False\n\n def deltas(self) -> list[float]:\n with self._lock:\n return [self.calls[index + 1] - self.calls[index] for index in range(len(self.calls) - 1)]", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:IntervalRoutine", - "span_start": 18, - "span_end": 37, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": null, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "class HttpControlChannel(ControlChannel):\n def __init__(self, host: str, port: int, timeout: int) -> None:\n self._timeout = timeout\n self._runner = UvicornThreadRunner(host, port, timeout)\n self._factory = HttpControlAppFactory()\n self._actions: ControlActionSet | None = None\n\n async def start(self, actions: ControlActionSet) -> None:\n self._actions = actions\n app = self._factory.create(self._health_response, self._action_response)\n await self._runner.start(app)\n\n async def stop(self) -> None:\n await self._runner.stop()\n\n @property\n def port(self) -> int:\n return self._runner.port\n\n async def _health_response(self) -> dict[str, object]:\n if self._actions is None:\n return {\"status\": \"unhealthy\", \"detail\": \"control actions are not configured\"}\n return await asyncio.wait_for(self._actions.health(), timeout=float(self._timeout))\n\n async def _action_response(self, action: str, _client_source: str = \"unknown\") -> JSONResponse:\n if self._actions is None:\n return JSONResponse(content={\"status\": \"error\", \"detail\": f\"{action} handler is not configured\"}, status_code=404)\n callbacks = {\n \"start\": self._actions.start,\n \"stop\": self._actions.stop,\n \"status\": self._actions.status,\n }\n callback = callbacks.get(action)\n if callback is None:\n return JSONResponse(content={\"status\": \"error\", \"detail\": f\"unsupported action: {action}\"}, status_code=404)\n action_timeout = max(float(self._timeout), 10.0) if action in {\"start\", \"stop\"} else float(self._timeout)\n try:\n detail = await asyncio.wait_for(callback(), timeout=action_timeout)\n except asyncio.TimeoutError:\n return JSONResponse(\n content={\"status\": \"accepted\", \"detail\": f\"{action} operation is still in progress\"},\n status_code=202,\n )\n except Exception as exc:\n return JSONResponse(content={\"status\": \"error\", \"detail\": str(exc)}, status_code=500)\n return JSONResponse(content={\"status\": \"ok\", \"detail\": detail or f\"{action} action accepted\"}, status_code=200)", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/http_channel.py:HttpControlChannel", - "span_start": 12, - "span_end": 57, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": null, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.http_channel", - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "class HttpControlAppFactory:\n def create(\n self,\n health_provider: Callable[[], Awaitable[HealthPayload]],\n action_provider: Callable[[str, str], Awaitable[JSONResponse]],\n ) -> FastAPI:\n app = FastAPI(title=\"PLBA Control API\")\n\n @app.middleware(\"http\")\n async def log_api_call(request: Request, call_next): # type: ignore[no-untyped-def]\n started = time.monotonic()\n response = await call_next(request)\n response.headers[\"X-Response-Time-Ms\"] = str(int((time.monotonic() - started) * 1000))\n return response\n\n @app.get(\"/health\")\n async def health() -> JSONResponse:\n payload = await health_provider()\n status_code = 200 if payload.get(\"status\") == \"ok\" else 503\n return JSONResponse(content=payload, status_code=status_code)\n\n @app.get(\"/actions/{action}\")\n @app.post(\"/actions/{action}\")\n async def action(action: str, request: Request) -> JSONResponse:\n client_source = self._client_source(request)\n if action in {\"start\", \"stop\"}:\n LOGGER.warning(\"Control action requested: /actions/%s client=%s\", action, client_source)\n return await action_provider(action, client_source)\n\n return app\n\n def _client_source(self, request: Request) -> str:\n explicit_header = request.headers.get(\"X-Client-Source\", \"\").strip()\n if explicit_header:\n return explicit_header\n user_agent = request.headers.get(\"User-Agent\", \"\").strip()\n if user_agent:\n return f\"user-agent:{user_agent}\"\n return \"unknown\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/http_app.py:HttpControlAppFactory", - "span_start": 15, - "span_end": 53, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": null, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.http_app", - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_runner.py", - "content": "class UvicornThreadRunner:\n def __init__(self, host: str, port: int, timeout: int) -> None:\n self._host = host\n self._port = port\n self._timeout = timeout\n self._server: Server | None = None\n self._thread: Thread | None = None\n self._error: BaseException | None = None\n\n async def start(self, app: FastAPI) -> None:\n if self._thread is not None and self._thread.is_alive():\n return\n self._error = None\n config = Config(app=app, host=self._host, port=self._port, log_level=\"warning\")\n self._server = Server(config)\n self._thread = Thread(target=self._serve, name=\"plba-http-control\", daemon=True)\n self._thread.start()\n await self._wait_until_started()\n\n async def stop(self) -> None:\n if self._server is None or self._thread is None:\n return\n self._server.should_exit = True\n await asyncio.to_thread(self._thread.join, self._timeout)\n self._server = None\n self._thread = None\n\n @property\n def port(self) -> int:\n if self._server is None or not getattr(self._server, \"servers\", None):\n return self._port\n socket = self._server.servers[0].sockets[0]\n return int(socket.getsockname()[1])\n\n async def _wait_until_started(self) -> None:\n if self._server is None:\n raise RuntimeError(\"Server is not initialized\")\n deadline = asyncio.get_running_loop().time() + max(float(self._timeout), 1.0)\n while not self._server.started:\n if self._error is not None:\n raise RuntimeError(\"HTTP control server failed to start\") from self._error\n if asyncio.get_running_loop().time() >= deadline:\n raise TimeoutError(\"HTTP control server startup timed out\")\n await asyncio.sleep(0.05)\n\n def _serve(self) -> None:\n if self._server is None:\n return\n try:\n asyncio.run(self._server.serve())\n except BaseException as exc: # noqa: BLE001\n self._error = exc", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/http_runner.py:UvicornThreadRunner", - "span_start": 10, - "span_end": 61, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": null, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.http_runner", - "is_test": false, - "blob_sha": "3779fdd2878b770e789a35bb2a89c9d79f13b61c26d7db1b3b683f9bb9e1623f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "class ControlPlaneService:\n def __init__(self) -> None:\n self._channels: list[ControlChannel] = []\n\n def register_channel(self, channel: ControlChannel) -> None:\n self._channels.append(channel)\n\n def start(self, runtime: RuntimeManager) -> None:\n if not self._channels:\n return\n asyncio.run(self._start_async(runtime))\n\n def stop(self) -> None:\n if not self._channels:\n return\n asyncio.run(self._stop_async())\n\n def snapshot(self, runtime: RuntimeManager) -> dict[str, object]:\n health = runtime.current_health()\n return {\n \"runtime\": {\"state\": runtime._state.value},\n \"modules\": list(runtime.registry.modules),\n \"services\": runtime.services.snapshot(),\n \"workers\": runtime.workers.snapshot(),\n \"health\": runtime.health.snapshot(runtime.workers.healths()) | {\"status\": health[\"status\"]},\n \"config\": runtime.configuration.get(),\n }\n\n async def _start_async(self, runtime: RuntimeManager) -> None:\n actions = ControlActionSet(\n health=runtime.health_status,\n start=runtime.start_runtime,\n stop=runtime.stop_runtime,\n status=runtime.runtime_status,\n )\n for channel in self._channels:\n await channel.start(actions)\n\n async def _stop_async(self) -> None:\n for channel in reversed(self._channels):\n await channel.stop()", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/service.py:ControlPlaneService", - "span_start": 12, - "span_end": 52, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": null, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.service", - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "class ControlActionSet:\n health: HealthHandler\n start: ActionHandler\n stop: ActionHandler\n status: ActionHandler", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/base.py:ControlActionSet", - "span_start": 14, - "span_end": 18, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": null, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.base", - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/__init__.py", - "content": "from app_runtime.control.base import ControlActionSet, ControlChannel\nfrom app_runtime.control.http_channel import HttpControlChannel\nfrom app_runtime.control.service import ControlPlaneService\n\n__all__ = [\"ControlActionSet\", \"ControlChannel\", \"ControlPlaneService\", \"HttpControlChannel\"]", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/__init__.py:1-5", - "span_start": 1, - "span_end": 5, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": null, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.app_runtime.control.__init__", - "is_test": false, - "blob_sha": "bf3c37e3369a84cc618adc0fd71c232e5eb4b871eaff743069a17e661e498316", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "class ControlChannel(ABC):\n @abstractmethod\n async def start(self, actions: ControlActionSet) -> None:\n \"\"\"Start the control channel and bind handlers.\"\"\"\n\n @abstractmethod\n async def stop(self) -> None:\n \"\"\"Stop the control channel and release resources.\"\"\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/base.py:ControlChannel", - "span_start": 21, - "span_end": 28, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": null, - "metadata": { - "chunk_index": 1, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.base", - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "class BlockingRoutine:\n def __init__(self, started: Event, release: Event) -> None:\n self._started = started\n self._release = release\n\n def run(self) -> None:\n self._started.set()\n self._release.wait(timeout=5.0)", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:BlockingRoutine", - "span_start": 40, - "span_end": 47, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": null, - "metadata": { - "chunk_index": 1, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "retrieval_report": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "vector", - "C2_DEPENDENCY_GRAPH": "vector", - "C0_SOURCE_CHUNKS": "vector" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C0_SOURCE_CHUNKS": 10 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [] - } - }, - "fallback": { - "used": false, - "reason": null - }, - "retrieval_by_layer_ms": { - "C1_SYMBOL_CATALOG": 48, - "C2_DEPENDENCY_GRAPH": 60, - "C0_SOURCE_CHUNKS": 21 - } - } - }, - "diagnostics": { - "intent_correct": null, - "target_found": true, - "layers_used": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ], - "retrieval_sufficient": true, - "answer_mode": "normal", - "resolved_target": "RuntimeManager", - "answer_policy_branch": "normal_answer", - "decision_reason": "evidence_sufficient", - "router_result": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "retrieval_profile": "code", - "sub_intent": "FIND_TESTS", - "path_scope": [], - "layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ], - "symbol_resolution_status": "resolved" - }, - "retrieval_request": { - "rag_session_id": "7d11da21-faa0-4cea-aede-aeabe069164c", - "query": "Где тесты для RuntimeManager?", - "sub_intent": "FIND_TESTS", - "path_scope": [], - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ] - }, - "per_layer_outcome": [ - { - "layer_id": "C1_SYMBOL_CATALOG", - "hit_count": 8, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C2_DEPENDENCY_GRAPH", - "hit_count": 6, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C0_SOURCE_CHUNKS", - "hit_count": 10, - "empty": false, - "fallback_used": false - } - ], - "empty_layers": [], - "evidence_gate_decision": { - "sufficient": true, - "failure_reasons": [], - "evidence_count": 24 - }, - "evidence_gate_input": { - "resolved_target": "RuntimeManager", - "sub_intent": "FIND_TESTS", - "target_type": "symbol", - "evidence_count": 24, - "code_chunk_count": 24, - "entrypoint_count": 0, - "relation_count": 6, - "test_evidence_count": 2, - "symbol_resolution_status": "resolved", - "path_scope": [] - }, - "post_evidence_gate": { - "input": { - "answer_mode": "normal", - "degraded_message": "", - "resolved_target": "RuntimeManager", - "draft_answer_preview": "Прямые тесты для `RuntimeManager` находятся в файле `tests/test_runtime.py`.\n\nКосвенные тесты:\n- В файле `tests/test_business_control_actions.py` есть тесты, использующие компоненты контроля, которые взаимодействуют с `RuntimeManager`.", - "repair_candidate": true - }, - "output": { - "passed": true, - "action": "return", - "reasons": [], - "repair_used": false, - "final_answer_preview": "Прямые тесты для `RuntimeManager` находятся в файле `tests/test_runtime.py`.\n\nКосвенные тесты:\n- В файле `tests/test_business_control_actions.py` есть тесты, использующие компоненты контроля, которые взаимодействуют с `RuntimeManager`." - } - }, - "failure_reasons": [], - "timings_ms": { - "router": 2, - "retrieval": 130, - "pre_evidence_gate": 1, - "llm": 1947, - "post_evidence_gate": 1 - } - }, - "rag_rows": [ - { - "path": "src/plba/bootstrap.py", - "content": "const RuntimeManager\nRuntimeManager = app_runtime.core.runtime.RuntimeManager", - "layer": "C1_SYMBOL_CATALOG", - "title": "RuntimeManager", - "span_start": 4, - "span_end": 4, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "27158ca220022eeb5083c6addf8a50775d45f7161284fd60aac48410105f4b98", - "qname": "RuntimeManager", - "kind": "const", - "signature": "RuntimeManager = app_runtime.core.runtime.RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "src.plba.bootstrap", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_runtime.py", - "content": "const RuntimeManager\nRuntimeManager = app_runtime.core.runtime.RuntimeManager", - "layer": "C1_SYMBOL_CATALOG", - "title": "RuntimeManager", - "span_start": 12, - "span_end": 12, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "aeadc039653807b0da1ca6e3cc1078ee61cfc510b28e7f9c2ec04c59da43cc8d", - "qname": "RuntimeManager", - "kind": "const", - "signature": "RuntimeManager = app_runtime.core.runtime.RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "tests.test_runtime", - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "class RuntimeManager\nRuntimeManager", - "layer": "C1_SYMBOL_CATALOG", - "title": "RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "7e4a9381328c5803bbc6179458612fc4e947d928aa7bf8b4b2bebb2c8592f758", - "qname": "RuntimeManager", - "kind": "class", - "signature": "RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.core.runtime", - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/__init__.py", - "content": "const RuntimeManager\nRuntimeManager = plba.core.RuntimeManager", - "layer": "C1_SYMBOL_CATALOG", - "title": "RuntimeManager", - "span_start": 16, - "span_end": 16, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "7eacec84f9b8d6c4201374591faecdac7493091c263681495c338973f2971ad9", - "qname": "RuntimeManager", - "kind": "const", - "signature": "RuntimeManager = plba.core.RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "src.plba.__init__", - "is_test": false, - "blob_sha": "24e755ec8c249d14fb0e675b5dbf2b71ab91afb9c849897eebfa9feb2499e19d", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/core.py", - "content": "const RuntimeManager\nRuntimeManager = app_runtime.core.runtime.RuntimeManager", - "layer": "C1_SYMBOL_CATALOG", - "title": "RuntimeManager", - "span_start": 2, - "span_end": 2, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "e1684562d978b7af7fe9b27dc5869d770348a87b5dc19a50360f58544668578b", - "qname": "RuntimeManager", - "kind": "const", - "signature": "RuntimeManager = app_runtime.core.runtime.RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "src.plba.core", - "is_test": false, - "blob_sha": "c0ae25110d20e665216616e26b68adfe035b624ba45d31d1272fb21f906f9ca8", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "const RuntimeManager\nRuntimeManager = app_runtime.core.runtime.RuntimeManager", - "layer": "C1_SYMBOL_CATALOG", - "title": "RuntimeManager", - "span_start": 14, - "span_end": 14, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "a1572ea8183dc0cd6ddbc74342bbde8c28cecfde37ad40b62feff09f8d103d11", - "qname": "RuntimeManager", - "kind": "const", - "signature": "RuntimeManager = app_runtime.core.runtime.RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "const RuntimeManager\nRuntimeManager = app_runtime.core.runtime.RuntimeManager", - "layer": "C1_SYMBOL_CATALOG", - "title": "RuntimeManager", - "span_start": 9, - "span_end": 9, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "62a9575c77aad894120d18b4f2a08cf2ba42f77e9be4a8a432b767d157701afe", - "qname": "RuntimeManager", - "kind": "const", - "signature": "RuntimeManager = app_runtime.core.runtime.RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.control.service", - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/__init__.py", - "content": "const ControlPlaneService\nControlPlaneService = app_runtime.control.service.ControlPlaneService", - "layer": "C1_SYMBOL_CATALOG", - "title": "ControlPlaneService", - "span_start": 3, - "span_end": 3, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "217e8f044d1c01644bf7b81e5046af9e84469210c692a2fb0c476a19bb069ae1", - "qname": "ControlPlaneService", - "kind": "const", - "signature": "ControlPlaneService = app_runtime.control.service.ControlPlaneService", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.control.__init__", - "is_test": false, - "blob_sha": "bf3c37e3369a84cc618adc0fd71c232e5eb4b871eaff743069a17e661e498316", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.stop", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 25, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d", - "dst_ref": "ControlPlaneService.stop", - "resolution": "resolved", - "slice_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.stop" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._stop_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 51, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a", - "dst_ref": "ControlPlaneService._stop_async", - "resolution": "resolved", - "slice_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._stop_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.register_channel", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 17, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957", - "dst_ref": "ControlPlaneService.register_channel", - "resolution": "resolved", - "slice_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.register_channel" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.start", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 20, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154", - "dst_ref": "ControlPlaneService.start", - "resolution": "resolved", - "slice_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.start" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._start_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 47, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517", - "dst_ref": "ControlPlaneService._start_async", - "resolution": "resolved", - "slice_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._start_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager.add_config_file", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 32, - "span_end": 52, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "a23b8a11ebdb12708b60c96ea12a69f7f042082f1adfddd572444e246d81d167", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "57ffbd4f0d9fdf3507c2b8624312ce211f3d02fdf86a57a8ec90778d8a7b498d", - "dst_ref": "RuntimeManager.add_config_file", - "resolution": "resolved", - "slice_id": "a23b8a11ebdb12708b60c96ea12a69f7f042082f1adfddd572444e246d81d167", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager.add_config_file" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "57ffbd4f0d9fdf3507c2b8624312ce211f3d02fdf86a57a8ec90778d8a7b498d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/control.py", - "content": "from app_runtime.control.base import ControlActionSet, ControlChannel\nfrom app_runtime.control.http_channel import HttpControlChannel\nfrom app_runtime.control.service import ControlPlaneService\n\n__all__ = [\n \"ControlActionSet\",\n \"ControlChannel\",\n \"ControlPlaneService\",\n \"HttpControlChannel\",\n]", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/plba/control.py:1-10", - "span_start": 1, - "span_end": 10, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.plba.control", - "is_test": false, - "blob_sha": "31bd5c4481bfa7fbca8fae56d4860a67e3953ca74474ac8439e1f39b685d7bc8", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "class IntervalRoutine:\n calls: list[float] = field(default_factory=list)\n _lock: Lock = field(default_factory=Lock)\n\n def run(self) -> None:\n with self._lock:\n self.calls.append(monotonic())\n\n def wait_runs(self, count: int, timeout: float) -> bool:\n deadline = monotonic() + timeout\n while monotonic() < deadline:\n with self._lock:\n if len(self.calls) >= count:\n return True\n sleep(0.01)\n return False\n\n def deltas(self) -> list[float]:\n with self._lock:\n return [self.calls[index + 1] - self.calls[index] for index in range(len(self.calls) - 1)]", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:IntervalRoutine", - "span_start": 18, - "span_end": 37, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "class HttpControlChannel(ControlChannel):\n def __init__(self, host: str, port: int, timeout: int) -> None:\n self._timeout = timeout\n self._runner = UvicornThreadRunner(host, port, timeout)\n self._factory = HttpControlAppFactory()\n self._actions: ControlActionSet | None = None\n\n async def start(self, actions: ControlActionSet) -> None:\n self._actions = actions\n app = self._factory.create(self._health_response, self._action_response)\n await self._runner.start(app)\n\n async def stop(self) -> None:\n await self._runner.stop()\n\n @property\n def port(self) -> int:\n return self._runner.port\n\n async def _health_response(self) -> dict[str, object]:\n if self._actions is None:\n return {\"status\": \"unhealthy\", \"detail\": \"control actions are not configured\"}\n return await asyncio.wait_for(self._actions.health(), timeout=float(self._timeout))\n\n async def _action_response(self, action: str, _client_source: str = \"unknown\") -> JSONResponse:\n if self._actions is None:\n return JSONResponse(content={\"status\": \"error\", \"detail\": f\"{action} handler is not configured\"}, status_code=404)\n callbacks = {\n \"start\": self._actions.start,\n \"stop\": self._actions.stop,\n \"status\": self._actions.status,\n }\n callback = callbacks.get(action)\n if callback is None:\n return JSONResponse(content={\"status\": \"error\", \"detail\": f\"unsupported action: {action}\"}, status_code=404)\n action_timeout = max(float(self._timeout), 10.0) if action in {\"start\", \"stop\"} else float(self._timeout)\n try:\n detail = await asyncio.wait_for(callback(), timeout=action_timeout)\n except asyncio.TimeoutError:\n return JSONResponse(\n content={\"status\": \"accepted\", \"detail\": f\"{action} operation is still in progress\"},\n status_code=202,\n )\n except Exception as exc:\n return JSONResponse(content={\"status\": \"error\", \"detail\": str(exc)}, status_code=500)\n return JSONResponse(content={\"status\": \"ok\", \"detail\": detail or f\"{action} action accepted\"}, status_code=200)", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/http_channel.py:HttpControlChannel", - "span_start": 12, - "span_end": 57, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.http_channel", - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "class HttpControlAppFactory:\n def create(\n self,\n health_provider: Callable[[], Awaitable[HealthPayload]],\n action_provider: Callable[[str, str], Awaitable[JSONResponse]],\n ) -> FastAPI:\n app = FastAPI(title=\"PLBA Control API\")\n\n @app.middleware(\"http\")\n async def log_api_call(request: Request, call_next): # type: ignore[no-untyped-def]\n started = time.monotonic()\n response = await call_next(request)\n response.headers[\"X-Response-Time-Ms\"] = str(int((time.monotonic() - started) * 1000))\n return response\n\n @app.get(\"/health\")\n async def health() -> JSONResponse:\n payload = await health_provider()\n status_code = 200 if payload.get(\"status\") == \"ok\" else 503\n return JSONResponse(content=payload, status_code=status_code)\n\n @app.get(\"/actions/{action}\")\n @app.post(\"/actions/{action}\")\n async def action(action: str, request: Request) -> JSONResponse:\n client_source = self._client_source(request)\n if action in {\"start\", \"stop\"}:\n LOGGER.warning(\"Control action requested: /actions/%s client=%s\", action, client_source)\n return await action_provider(action, client_source)\n\n return app\n\n def _client_source(self, request: Request) -> str:\n explicit_header = request.headers.get(\"X-Client-Source\", \"\").strip()\n if explicit_header:\n return explicit_header\n user_agent = request.headers.get(\"User-Agent\", \"\").strip()\n if user_agent:\n return f\"user-agent:{user_agent}\"\n return \"unknown\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/http_app.py:HttpControlAppFactory", - "span_start": 15, - "span_end": 53, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.http_app", - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_runner.py", - "content": "class UvicornThreadRunner:\n def __init__(self, host: str, port: int, timeout: int) -> None:\n self._host = host\n self._port = port\n self._timeout = timeout\n self._server: Server | None = None\n self._thread: Thread | None = None\n self._error: BaseException | None = None\n\n async def start(self, app: FastAPI) -> None:\n if self._thread is not None and self._thread.is_alive():\n return\n self._error = None\n config = Config(app=app, host=self._host, port=self._port, log_level=\"warning\")\n self._server = Server(config)\n self._thread = Thread(target=self._serve, name=\"plba-http-control\", daemon=True)\n self._thread.start()\n await self._wait_until_started()\n\n async def stop(self) -> None:\n if self._server is None or self._thread is None:\n return\n self._server.should_exit = True\n await asyncio.to_thread(self._thread.join, self._timeout)\n self._server = None\n self._thread = None\n\n @property\n def port(self) -> int:\n if self._server is None or not getattr(self._server, \"servers\", None):\n return self._port\n socket = self._server.servers[0].sockets[0]\n return int(socket.getsockname()[1])\n\n async def _wait_until_started(self) -> None:\n if self._server is None:\n raise RuntimeError(\"Server is not initialized\")\n deadline = asyncio.get_running_loop().time() + max(float(self._timeout), 1.0)\n while not self._server.started:\n if self._error is not None:\n raise RuntimeError(\"HTTP control server failed to start\") from self._error\n if asyncio.get_running_loop().time() >= deadline:\n raise TimeoutError(\"HTTP control server startup timed out\")\n await asyncio.sleep(0.05)\n\n def _serve(self) -> None:\n if self._server is None:\n return\n try:\n asyncio.run(self._server.serve())\n except BaseException as exc: # noqa: BLE001\n self._error = exc", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/http_runner.py:UvicornThreadRunner", - "span_start": 10, - "span_end": 61, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.http_runner", - "is_test": false, - "blob_sha": "3779fdd2878b770e789a35bb2a89c9d79f13b61c26d7db1b3b683f9bb9e1623f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "class ControlPlaneService:\n def __init__(self) -> None:\n self._channels: list[ControlChannel] = []\n\n def register_channel(self, channel: ControlChannel) -> None:\n self._channels.append(channel)\n\n def start(self, runtime: RuntimeManager) -> None:\n if not self._channels:\n return\n asyncio.run(self._start_async(runtime))\n\n def stop(self) -> None:\n if not self._channels:\n return\n asyncio.run(self._stop_async())\n\n def snapshot(self, runtime: RuntimeManager) -> dict[str, object]:\n health = runtime.current_health()\n return {\n \"runtime\": {\"state\": runtime._state.value},\n \"modules\": list(runtime.registry.modules),\n \"services\": runtime.services.snapshot(),\n \"workers\": runtime.workers.snapshot(),\n \"health\": runtime.health.snapshot(runtime.workers.healths()) | {\"status\": health[\"status\"]},\n \"config\": runtime.configuration.get(),\n }\n\n async def _start_async(self, runtime: RuntimeManager) -> None:\n actions = ControlActionSet(\n health=runtime.health_status,\n start=runtime.start_runtime,\n stop=runtime.stop_runtime,\n status=runtime.runtime_status,\n )\n for channel in self._channels:\n await channel.start(actions)\n\n async def _stop_async(self) -> None:\n for channel in reversed(self._channels):\n await channel.stop()", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/service.py:ControlPlaneService", - "span_start": 12, - "span_end": 52, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.service", - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "class ControlActionSet:\n health: HealthHandler\n start: ActionHandler\n stop: ActionHandler\n status: ActionHandler", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/base.py:ControlActionSet", - "span_start": 14, - "span_end": 18, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.base", - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/__init__.py", - "content": "from app_runtime.control.base import ControlActionSet, ControlChannel\nfrom app_runtime.control.http_channel import HttpControlChannel\nfrom app_runtime.control.service import ControlPlaneService\n\n__all__ = [\"ControlActionSet\", \"ControlChannel\", \"ControlPlaneService\", \"HttpControlChannel\"]", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/__init__.py:1-5", - "span_start": 1, - "span_end": 5, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.app_runtime.control.__init__", - "is_test": false, - "blob_sha": "bf3c37e3369a84cc618adc0fd71c232e5eb4b871eaff743069a17e661e498316", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "class ControlChannel(ABC):\n @abstractmethod\n async def start(self, actions: ControlActionSet) -> None:\n \"\"\"Start the control channel and bind handlers.\"\"\"\n\n @abstractmethod\n async def stop(self) -> None:\n \"\"\"Stop the control channel and release resources.\"\"\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/base.py:ControlChannel", - "span_start": 21, - "span_end": 28, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 1, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.base", - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_business_control_actions.py", - "content": "class BlockingRoutine:\n def __init__(self, started: Event, release: Event) -> None:\n self._started = started\n self._release = release\n\n def run(self) -> None:\n self._started.set()\n self._release.wait(timeout=5.0)", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_business_control_actions.py:BlockingRoutine", - "span_start": 40, - "span_end": 47, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 1, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_business_control_actions", - "is_test": true, - "blob_sha": "4c599657dbef51b9d5cd4ec0cc4170ac79c5b1d6b9a5e80782a770274cc39e9f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "validation": { - "passed": true, - "action": "return", - "reasons": [] - }, - "steps": [ - { - "step": "router", - "status": "completed", - "timings_ms": { - "router": 2 - }, - "output": { - "intent": "CODE_QA", - "sub_intent": "FIND_TESTS", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - } - }, - { - "step": "retrieval", - "status": "completed", - "timings_ms": { - "retrieval": 130 - }, - "output": { - "rag_count": 24, - "answer_path_rag_count": 24, - "resolved_symbol_status": "resolved", - "resolved_symbol": "RuntimeManager", - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ] - }, - "diagnostics": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "vector", - "C2_DEPENDENCY_GRAPH": "vector", - "C0_SOURCE_CHUNKS": "vector" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C0_SOURCE_CHUNKS": 10 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [] - } - }, - "fallback": { - "used": false, - "reason": null - }, - "retrieval_by_layer_ms": { - "C1_SYMBOL_CATALOG": 48, - "C2_DEPENDENCY_GRAPH": 60, - "C0_SOURCE_CHUNKS": 21 - } - } - }, - { - "step": "pre_evidence_gate", - "status": "passed", - "timings_ms": { - "pre_evidence_gate": 1 - }, - "input": { - "resolved_target": "RuntimeManager", - "sub_intent": "FIND_TESTS", - "target_type": "symbol", - "evidence_count": 24, - "code_chunk_count": 24, - "entrypoint_count": 0, - "relation_count": 6, - "test_evidence_count": 2, - "symbol_resolution_status": "resolved", - "path_scope": [] - }, - "output": { - "passed": true, - "failure_reasons": [], - "degraded_message": "", - "evidence_count": 24 - } - }, - { - "step": "llm", - "status": "completed", - "timings_ms": { - "llm": 1947 - }, - "output": { - "prompt_name": "code_qa_find_tests_answer", - "answer_preview": "Прямые тесты для `RuntimeManager` находятся в файле `tests/test_runtime.py`.\n\nКосвенные тесты:\n- В файле `tests/test_business_control_actions.py` есть тесты, использующие компоненты контроля, которые взаимодействуют с `RuntimeManager`.", - "resolved_target": "RuntimeManager", - "answer_policy_branch": "normal_answer", - "decision_reason": "evidence_sufficient" - } - }, - { - "step": "post_evidence_gate", - "status": "passed", - "timings_ms": { - "post_evidence_gate": 1, - "post_evidence_gate_recheck": 0, - "repair": 0 - }, - "input": { - "answer_mode": "normal", - "degraded_message": "", - "resolved_target": "RuntimeManager", - "draft_answer_preview": "Прямые тесты для `RuntimeManager` находятся в файле `tests/test_runtime.py`.\n\nКосвенные тесты:\n- В файле `tests/test_business_control_actions.py` есть тесты, использующие компоненты контроля, которые взаимодействуют с `RuntimeManager`.", - "repair_candidate": true - }, - "output": { - "passed": true, - "action": "return", - "reasons": [], - "repair_used": false, - "final_answer_preview": "Прямые тесты для `RuntimeManager` находятся в файле `tests/test_runtime.py`.\n\nКосвенные тесты:\n- В файле `tests/test_business_control_actions.py` есть тесты, использующие компоненты контроля, которые взаимодействуют с `RuntimeManager`." - } - } - ] - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/plba_full_chain_subintents_v3/20260312_192715/full_chain_plba_code_subintents_v2_plba-v2-find-tests-runtime-manager.md b/tests/pipeline_setup_v3/test_results/plba_full_chain_subintents_v3/20260312_192715/full_chain_plba_code_subintents_v2_plba-v2-find-tests-runtime-manager.md deleted file mode 100644 index 3cd0b95..0000000 --- a/tests/pipeline_setup_v3/test_results/plba_full_chain_subintents_v3/20260312_192715/full_chain_plba_code_subintents_v2_plba-v2-find-tests-runtime-manager.md +++ /dev/null @@ -1,269 +0,0 @@ -# plba-v2-find-tests-runtime-manager - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_02_pipeline/full_chain_plba_code_subintents_v2.yaml -- runner: agent_runtime -- mode: full_chain -- passed: True - -## Query -Где тесты для RuntimeManager? - -## Actual -{ - "intent": "CODE_QA", - "sub_intent": "FIND_TESTS", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 24, - "llm_answer": "Прямые тесты для `RuntimeManager` находятся в файле `tests/test_runtime.py`.\n\nКосвенные тесты:\n- В файле `tests/test_business_control_actions.py` есть тесты, использующие компоненты контроля, которые взаимодействуют с `RuntimeManager`.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "RuntimeManager" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ] -} - -## Steps -[ - { - "step": "router", - "status": "completed", - "timings_ms": { - "router": 2 - }, - "output": { - "intent": "CODE_QA", - "sub_intent": "FIND_TESTS", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - } - }, - { - "step": "retrieval", - "status": "completed", - "timings_ms": { - "retrieval": 130 - }, - "output": { - "rag_count": 24, - "answer_path_rag_count": 24, - "resolved_symbol_status": "resolved", - "resolved_symbol": "RuntimeManager", - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ] - }, - "diagnostics": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "vector", - "C2_DEPENDENCY_GRAPH": "vector", - "C0_SOURCE_CHUNKS": "vector" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C0_SOURCE_CHUNKS": 10 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [] - } - }, - "fallback": { - "used": false, - "reason": null - }, - "retrieval_by_layer_ms": { - "C1_SYMBOL_CATALOG": 48, - "C2_DEPENDENCY_GRAPH": 60, - "C0_SOURCE_CHUNKS": 21 - } - } - }, - { - "step": "pre_evidence_gate", - "status": "passed", - "timings_ms": { - "pre_evidence_gate": 1 - }, - "input": { - "resolved_target": "RuntimeManager", - "sub_intent": "FIND_TESTS", - "target_type": "symbol", - "evidence_count": 24, - "code_chunk_count": 24, - "entrypoint_count": 0, - "relation_count": 6, - "test_evidence_count": 2, - "symbol_resolution_status": "resolved", - "path_scope": [] - }, - "output": { - "passed": true, - "failure_reasons": [], - "degraded_message": "", - "evidence_count": 24 - } - }, - { - "step": "llm", - "status": "completed", - "timings_ms": { - "llm": 1947 - }, - "output": { - "prompt_name": "code_qa_find_tests_answer", - "answer_preview": "Прямые тесты для `RuntimeManager` находятся в файле `tests/test_runtime.py`.\n\nКосвенные тесты:\n- В файле `tests/test_business_control_actions.py` есть тесты, использующие компоненты контроля, которые взаимодействуют с `RuntimeManager`.", - "resolved_target": "RuntimeManager", - "answer_policy_branch": "normal_answer", - "decision_reason": "evidence_sufficient" - } - }, - { - "step": "post_evidence_gate", - "status": "passed", - "timings_ms": { - "post_evidence_gate": 1, - "post_evidence_gate_recheck": 0, - "repair": 0 - }, - "input": { - "answer_mode": "normal", - "degraded_message": "", - "resolved_target": "RuntimeManager", - "draft_answer_preview": "Прямые тесты для `RuntimeManager` находятся в файле `tests/test_runtime.py`.\n\nКосвенные тесты:\n- В файле `tests/test_business_control_actions.py` есть тесты, использующие компоненты контроля, которые взаимодействуют с `RuntimeManager`.", - "repair_candidate": true - }, - "output": { - "passed": true, - "action": "return", - "reasons": [], - "repair_used": false, - "final_answer_preview": "Прямые тесты для `RuntimeManager` находятся в файле `tests/test_runtime.py`.\n\nКосвенные тесты:\n- В файле `tests/test_business_control_actions.py` есть тесты, использующие компоненты контроля, которые взаимодействуют с `RuntimeManager`." - } - } -] - -## Diagnostics -{ - "intent_correct": null, - "target_found": true, - "layers_used": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ], - "retrieval_sufficient": true, - "answer_mode": "normal", - "resolved_target": "RuntimeManager", - "answer_policy_branch": "normal_answer", - "decision_reason": "evidence_sufficient", - "router_result": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "retrieval_profile": "code", - "sub_intent": "FIND_TESTS", - "path_scope": [], - "layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ], - "symbol_resolution_status": "resolved" - }, - "retrieval_request": { - "rag_session_id": "7d11da21-faa0-4cea-aede-aeabe069164c", - "query": "Где тесты для RuntimeManager?", - "sub_intent": "FIND_TESTS", - "path_scope": [], - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ] - }, - "per_layer_outcome": [ - { - "layer_id": "C1_SYMBOL_CATALOG", - "hit_count": 8, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C2_DEPENDENCY_GRAPH", - "hit_count": 6, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C0_SOURCE_CHUNKS", - "hit_count": 10, - "empty": false, - "fallback_used": false - } - ], - "empty_layers": [], - "evidence_gate_decision": { - "sufficient": true, - "failure_reasons": [], - "evidence_count": 24 - }, - "evidence_gate_input": { - "resolved_target": "RuntimeManager", - "sub_intent": "FIND_TESTS", - "target_type": "symbol", - "evidence_count": 24, - "code_chunk_count": 24, - "entrypoint_count": 0, - "relation_count": 6, - "test_evidence_count": 2, - "symbol_resolution_status": "resolved", - "path_scope": [] - }, - "post_evidence_gate": { - "input": { - "answer_mode": "normal", - "degraded_message": "", - "resolved_target": "RuntimeManager", - "draft_answer_preview": "Прямые тесты для `RuntimeManager` находятся в файле `tests/test_runtime.py`.\n\nКосвенные тесты:\n- В файле `tests/test_business_control_actions.py` есть тесты, использующие компоненты контроля, которые взаимодействуют с `RuntimeManager`.", - "repair_candidate": true - }, - "output": { - "passed": true, - "action": "return", - "reasons": [], - "repair_used": false, - "final_answer_preview": "Прямые тесты для `RuntimeManager` находятся в файле `tests/test_runtime.py`.\n\nКосвенные тесты:\n- В файле `tests/test_business_control_actions.py` есть тесты, использующие компоненты контроля, которые взаимодействуют с `RuntimeManager`." - } - }, - "failure_reasons": [], - "timings_ms": { - "router": 2, - "retrieval": 130, - "pre_evidence_gate": 1, - "llm": 1947, - "post_evidence_gate": 1 - } -} - -## Mismatches -- none \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/plba_full_chain_subintents_v3/20260312_192715/full_chain_plba_code_subintents_v2_plba-v2-find-tests-trace-service.json b/tests/pipeline_setup_v3/test_results/plba_full_chain_subintents_v3/20260312_192715/full_chain_plba_code_subintents_v2_plba-v2-find-tests-trace-service.json deleted file mode 100644 index e4d2029..0000000 --- a/tests/pipeline_setup_v3/test_results/plba_full_chain_subintents_v3/20260312_192715/full_chain_plba_code_subintents_v2_plba-v2-find-tests-trace-service.json +++ /dev/null @@ -1,3338 +0,0 @@ -{ - "case_id": "plba-v2-find-tests-trace-service", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_02_pipeline/full_chain_plba_code_subintents_v2.yaml", - "runner": "agent_runtime", - "mode": "full_chain", - "query": "Где тесты для TraceService?", - "actual": { - "intent": "CODE_QA", - "sub_intent": "FIND_TESTS", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 24, - "llm_answer": "Прямые тесты для TraceService находятся в файле `tests/test_runtime.py`:\n\n- `test_trace_service_allows_messages_without_status`: проверяет возможность отправки сообщений без статуса.\n- `test_trace_service_writes_contexts_and_messages`: проверяет запись контекстов и сообщений.\n- `test_trace_service_supports_debug_warning_and_error_levels`: проверяет поддержку уровней debug, warning и error.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "TraceService" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ] - }, - "passed": true, - "mismatches": [], - "details": { - "query": "Где тесты для TraceService?", - "router_result": { - "schema_version": "1.1", - "intent": "CODE_QA", - "retrieval_profile": "code", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query_plan": { - "raw": "Где тесты для TraceService?", - "normalized": "Где тесты для TraceService?", - "sub_intent": "FIND_TESTS", - "negations": [], - "expansions": [ - "test", - "unit test", - "TraceService" - ], - "keyword_hints": [ - "TraceService" - ], - "path_hints": [], - "doc_scope_hints": [], - "symbol_candidates": [ - "TraceService" - ], - "symbol_kind_hint": "class", - "anchors": [ - { - "type": "SYMBOL", - "value": "TraceService", - "source": "user_text", - "subtype": null, - "span": { - "start": 14, - "end": 26 - }, - "confidence": 0.88 - }, - { - "type": "KEY_TERM", - "value": "тест", - "source": "user_text", - "subtype": null, - "span": { - "start": 4, - "end": 9 - }, - "confidence": 0.9 - } - ] - }, - "retrieval_spec": { - "domains": [ - "CODE" - ], - "layer_queries": [ - { - "layer_id": "C1_SYMBOL_CATALOG", - "top_k": 8 - }, - { - "layer_id": "C2_DEPENDENCY_GRAPH", - "top_k": 6 - }, - { - "layer_id": "C0_SOURCE_CHUNKS", - "top_k": 10 - } - ], - "filters": { - "test_policy": "INCLUDE", - "path_scope": [], - "language": [ - "python" - ] - }, - "rerank_profile": "code" - }, - "retrieval_constraints": { - "include_globs": [ - "src/**", - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "test_file_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "test_symbol_patterns": [ - "test_trace_service", - "TestTraceService", - "TraceService" - ], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - }, - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "TraceService", - "alternatives": [ - "TraceService", - "TraceService", - "TraceService", - "TraceService", - "TraceService" - ], - "confidence": 0.99 - }, - "evidence_policy": { - "require_def": true, - "require_flow": true, - "require_spec": false, - "allow_answer_without_evidence": false - } - }, - "retrieval_request": { - "rag_session_id": "7d11da21-faa0-4cea-aede-aeabe069164c", - "query": "Где тесты для TraceService?", - "sub_intent": "FIND_TESTS", - "path_scope": [], - "keyword_hints": [ - "TraceService" - ], - "symbol_candidates": [ - "TraceService" - ], - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ], - "retrieval_spec": { - "domains": [ - "CODE" - ], - "layer_queries": [ - { - "layer_id": "C1_SYMBOL_CATALOG", - "top_k": 8 - }, - { - "layer_id": "C2_DEPENDENCY_GRAPH", - "top_k": 6 - }, - { - "layer_id": "C0_SOURCE_CHUNKS", - "top_k": 10 - } - ], - "filters": { - "test_policy": "INCLUDE", - "path_scope": [], - "language": [ - "python" - ] - }, - "rerank_profile": "code" - }, - "retrieval_constraints": { - "include_globs": [ - "src/**", - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "test_file_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "test_symbol_patterns": [ - "test_trace_service", - "TestTraceService", - "TraceService" - ], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - }, - "query_plan": { - "raw": "Где тесты для TraceService?", - "normalized": "Где тесты для TraceService?", - "sub_intent": "FIND_TESTS", - "negations": [], - "expansions": [ - "test", - "unit test", - "TraceService" - ], - "keyword_hints": [ - "TraceService" - ], - "path_hints": [], - "doc_scope_hints": [], - "symbol_candidates": [ - "TraceService" - ], - "symbol_kind_hint": "class", - "anchors": [ - { - "type": "SYMBOL", - "value": "TraceService", - "source": "user_text", - "subtype": null, - "span": { - "start": 14, - "end": 26 - }, - "confidence": 0.88 - }, - { - "type": "KEY_TERM", - "value": "тест", - "source": "user_text", - "subtype": null, - "span": { - "start": 4, - "end": 9 - }, - "confidence": 0.9 - } - ] - } - }, - "retrieval_result": { - "target_symbol_candidates": [ - "TraceService", - "TraceService.open_context", - "TraceService.create_context", - "TraceService.current_trace_id" - ], - "resolved_symbol": "TraceService", - "symbol_resolution_status": "resolved", - "file_candidates": [ - "src/plba/__init__.py", - "src/app_runtime/core/runtime.py", - "src/app_runtime/tracing/__init__.py", - "src/app_runtime/tracing/service.py", - "src/plba/tracing.py", - "tests/test_runtime.py", - "src/app_runtime/contracts/__init__.py" - ], - "code_chunks": [ - { - "layer": "C1_SYMBOL_CATALOG", - "path": "src/plba/__init__.py", - "title": "TraceService", - "content": "const TraceService\nTraceService = plba.tracing.TraceService", - "start_line": 20, - "end_line": 20, - "metadata": { - "symbol_id": "259ec03b77b9387ea53f69c77af32791dd29adf6de617ba72dd3f839197342a1", - "qname": "TraceService", - "kind": "const", - "signature": "TraceService = plba.tracing.TraceService", - "parent_symbol_id": null, - "package_or_module": "src.plba.__init__", - "is_test": false, - "blob_sha": "24e755ec8c249d14fb0e675b5dbf2b71ab91afb9c849897eebfa9feb2499e19d", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C1_SYMBOL_CATALOG", - "path": "src/app_runtime/core/runtime.py", - "title": "TraceService", - "content": "const TraceService\nTraceService = app_runtime.tracing.service.TraceService", - "start_line": 14, - "end_line": 14, - "metadata": { - "symbol_id": "3ccf6212fd7d9730f9df933e2ee7671b65bdae0520577e1a49c6432262842db6", - "qname": "TraceService", - "kind": "const", - "signature": "TraceService = app_runtime.tracing.service.TraceService", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.core.runtime", - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C1_SYMBOL_CATALOG", - "path": "src/app_runtime/tracing/__init__.py", - "title": "TraceService", - "content": "const TraceService\nTraceService = app_runtime.tracing.service.TraceService", - "start_line": 2, - "end_line": 2, - "metadata": { - "symbol_id": "ecd2fab7fa9744b2adca84d3d213f7aadcb7e1da84b9c2764a4ab39c65282b11", - "qname": "TraceService", - "kind": "const", - "signature": "TraceService = app_runtime.tracing.service.TraceService", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.tracing.__init__", - "is_test": false, - "blob_sha": "a01dea5f773515aeaae8e6d3431fcb93531a8b577dfa26c2e5db16cd6ae6e4d9", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C1_SYMBOL_CATALOG", - "path": "src/app_runtime/tracing/service.py", - "title": "TraceService", - "content": "class TraceService\nTraceService(TraceContextFactory)", - "start_line": 39, - "end_line": 166, - "metadata": { - "symbol_id": "c2b2b976d99f2c600000b753731b26e0a69adcb4359398b93073590c5d5d04f4", - "qname": "TraceService", - "kind": "class", - "signature": "TraceService(TraceContextFactory)", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.tracing.service", - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C1_SYMBOL_CATALOG", - "path": "src/plba/tracing.py", - "title": "TraceService", - "content": "const TraceService\nTraceService = app_runtime.tracing.service.TraceService", - "start_line": 1, - "end_line": 1, - "metadata": { - "symbol_id": "a4556fb3f83c50ea68b94a679786ce802cab7ffd9d7138aad3d6009b2661f425", - "qname": "TraceService", - "kind": "const", - "signature": "TraceService = app_runtime.tracing.service.TraceService", - "parent_symbol_id": null, - "package_or_module": "src.plba.tracing", - "is_test": false, - "blob_sha": "a27e11c716c93c3fcefe6f11b4cc420a6b743e7606606071d7f1aeeccc4e7d45", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C1_SYMBOL_CATALOG", - "path": "src/app_runtime/tracing/service.py", - "title": "TraceService.open_context", - "content": "method TraceService.open_context\nopen_context(self)", - "start_line": 66, - "end_line": 78, - "metadata": { - "symbol_id": "2da3d5b20a947bf63e14c103be4689b72fd837e0a82abd6c497846375d4c7426", - "qname": "TraceService.open_context", - "kind": "method", - "signature": "open_context(self)", - "parent_symbol_id": "TraceService", - "package_or_module": "src.app_runtime.tracing.service", - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C1_SYMBOL_CATALOG", - "path": "src/app_runtime/tracing/service.py", - "title": "TraceService.create_context", - "content": "method TraceService.create_context\ncreate_context(self)", - "start_line": 45, - "end_line": 63, - "metadata": { - "symbol_id": "ff44881104b65ef50ee6fe16d367d4a81b6e7eb5c44c0963cf4543faec785d4a", - "qname": "TraceService.create_context", - "kind": "method", - "signature": "create_context(self)", - "parent_symbol_id": "TraceService", - "package_or_module": "src.app_runtime.tracing.service", - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C1_SYMBOL_CATALOG", - "path": "src/app_runtime/tracing/service.py", - "title": "TraceService.current_trace_id", - "content": "method TraceService.current_trace_id\ncurrent_trace_id(self)", - "start_line": 80, - "end_line": 81, - "metadata": { - "symbol_id": "41135180f7b3b9ab20e097e0747474e219c37dd2366ef08a7b43c1f3edb10b4c", - "qname": "TraceService.current_trace_id", - "kind": "method", - "signature": "current_trace_id(self)", - "parent_symbol_id": "TraceService", - "package_or_module": "src.app_runtime.tracing.service", - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "path": "src/app_runtime/tracing/service.py", - "title": "TraceService.__init__:dataflow_slice", - "content": "TraceService.__init__\n -> TraceService.store\n -> TraceService.create_context", - "start_line": 42, - "end_line": 61, - "metadata": { - "edge_id": "3b052062067a78aef3302ee1d996897e02a67d1b340397bea4f59fe147c0492a", - "edge_type": "dataflow_slice", - "src_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "src_qname": "TraceService.__init__", - "dst_symbol_id": "ff44881104b65ef50ee6fe16d367d4a81b6e7eb5c44c0963cf4543faec785d4a", - "dst_ref": "TraceService.create_context", - "resolution": "resolved", - "slice_id": "3b052062067a78aef3302ee1d996897e02a67d1b340397bea4f59fe147c0492a", - "root_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "path_symbols": [ - "TraceService.__init__", - "TraceService.store", - "TraceService.create_context" - ], - "path_symbol_ids": [ - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "ff44881104b65ef50ee6fe16d367d4a81b6e7eb5c44c0963cf4543faec785d4a" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "path": "src/app_runtime/tracing/service.py", - "title": "TraceService.__init__:dataflow_slice", - "content": "TraceService.__init__\n -> TraceService.store\n -> TraceService.close_context", - "start_line": 42, - "end_line": 84, - "metadata": { - "edge_id": "7a9353ef57c9ae5d19b3a0c6ac50fad05e6d21d31bbe1cd1cd07af6332ba6505", - "edge_type": "dataflow_slice", - "src_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "src_qname": "TraceService.__init__", - "dst_symbol_id": "01e14158dcced7e52d0c8ac84ac7b9a75225c261b6aca6a1d7da802d0994721c", - "dst_ref": "TraceService.close_context", - "resolution": "resolved", - "slice_id": "7a9353ef57c9ae5d19b3a0c6ac50fad05e6d21d31bbe1cd1cd07af6332ba6505", - "root_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "path_symbols": [ - "TraceService.__init__", - "TraceService.store", - "TraceService.close_context" - ], - "path_symbol_ids": [ - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "01e14158dcced7e52d0c8ac84ac7b9a75225c261b6aca6a1d7da802d0994721c" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "path": "src/app_runtime/tracing/service.py", - "title": "TraceService.__init__:dataflow_slice", - "content": "TraceService.__init__\n -> TraceService.store\n -> TraceService.open_context", - "start_line": 42, - "end_line": 78, - "metadata": { - "edge_id": "a6e13b9ebc4fed84586afd53ed92a4d14757e440873f572b2337d5622ee96031", - "edge_type": "dataflow_slice", - "src_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "src_qname": "TraceService.__init__", - "dst_symbol_id": "2da3d5b20a947bf63e14c103be4689b72fd837e0a82abd6c497846375d4c7426", - "dst_ref": "TraceService.open_context", - "resolution": "resolved", - "slice_id": "a6e13b9ebc4fed84586afd53ed92a4d14757e440873f572b2337d5622ee96031", - "root_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "path_symbols": [ - "TraceService.__init__", - "TraceService.store", - "TraceService.open_context" - ], - "path_symbol_ids": [ - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "2da3d5b20a947bf63e14c103be4689b72fd837e0a82abd6c497846375d4c7426" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "path": "src/app_runtime/tracing/service.py", - "title": "TraceService.__init__:dataflow_slice", - "content": "TraceService.__init__\n -> TraceService.transport\n -> TraceService.__init__", - "start_line": 41, - "end_line": 43, - "metadata": { - "edge_id": "1e923a93faa05c3c43ca9b19bd047007a8589ccce57d3cc1798ae7f9f200af98", - "edge_type": "dataflow_slice", - "src_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "src_qname": "TraceService.__init__", - "dst_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "dst_ref": "TraceService.__init__", - "resolution": "resolved", - "slice_id": "1e923a93faa05c3c43ca9b19bd047007a8589ccce57d3cc1798ae7f9f200af98", - "root_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "path_symbols": [ - "TraceService.__init__", - "TraceService.transport", - "TraceService.__init__" - ], - "path_symbol_ids": [ - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "path": "src/app_runtime/tracing/service.py", - "title": "TraceService.__init__:dataflow_slice", - "content": "TraceService.__init__\n -> TraceService.store\n -> TraceService.current_trace_id", - "start_line": 42, - "end_line": 81, - "metadata": { - "edge_id": "3ea17138634b1190bded77ddb84aa1595124f6519b246f24fc4b02bd62b5cac1", - "edge_type": "dataflow_slice", - "src_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "src_qname": "TraceService.__init__", - "dst_symbol_id": "41135180f7b3b9ab20e097e0747474e219c37dd2366ef08a7b43c1f3edb10b4c", - "dst_ref": "TraceService.current_trace_id", - "resolution": "resolved", - "slice_id": "3ea17138634b1190bded77ddb84aa1595124f6519b246f24fc4b02bd62b5cac1", - "root_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "path_symbols": [ - "TraceService.__init__", - "TraceService.store", - "TraceService.current_trace_id" - ], - "path_symbol_ids": [ - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "41135180f7b3b9ab20e097e0747474e219c37dd2366ef08a7b43c1f3edb10b4c" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "path": "src/app_runtime/tracing/service.py", - "title": "TraceService.__init__:dataflow_slice", - "content": "TraceService.__init__\n -> TraceService.store\n -> TraceService.step", - "start_line": 42, - "end_line": 88, - "metadata": { - "edge_id": "9f34c5da9b09fba99df6f6b1bde183a9aeb45111b8218a747c71590c2c9f60f2", - "edge_type": "dataflow_slice", - "src_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "src_qname": "TraceService.__init__", - "dst_symbol_id": "c44bfbc66cf747283f30088da3e011a10395031d41e77b74e523c24997f641ca", - "dst_ref": "TraceService.step", - "resolution": "resolved", - "slice_id": "9f34c5da9b09fba99df6f6b1bde183a9aeb45111b8218a747c71590c2c9f60f2", - "root_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "path_symbols": [ - "TraceService.__init__", - "TraceService.store", - "TraceService.step" - ], - "path_symbol_ids": [ - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "c44bfbc66cf747283f30088da3e011a10395031d41e77b74e523c24997f641ca" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C0_SOURCE_CHUNKS", - "path": "src/plba/tracing.py", - "title": "src/plba/tracing.py:1-4", - "content": "from app_runtime.tracing.service import TraceService\nfrom app_runtime.tracing.transport import MySqlTraceTransport, NoOpTraceTransport\n\n__all__ = [\"MySqlTraceTransport\", \"NoOpTraceTransport\", \"TraceService\"]", - "start_line": 1, - "end_line": 4, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.plba.tracing", - "is_test": false, - "blob_sha": "a27e11c716c93c3fcefe6f11b4cc420a6b743e7606606071d7f1aeeccc4e7d45", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C0_SOURCE_CHUNKS", - "path": "tests/test_runtime.py", - "title": "tests/test_runtime.py:test_trace_service_allows_messages_without_status", - "content": "def test_trace_service_allows_messages_without_status() -> None:\n from app_runtime.tracing.service import TraceService\n\n transport = RecordingTransport()\n manager = TraceService(transport=transport)\n\n with manager.open_context(alias=\"worker\", kind=\"worker\"):\n manager.step(\"optional-status\")\n manager.debug(\"debug without status\")\n manager.info(\"info without status\")\n manager.warning(\"warning without status\")\n manager.error(\"error without status\")\n\n assert [message.status for message in transport.messages] == [\"\", \"\", \"\", \"\"]\n assert all(message.trace_id == transport.contexts[0].trace_id for message in transport.messages)", - "start_line": 279, - "end_line": 293, - "metadata": { - "chunk_index": 11, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_runtime", - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C0_SOURCE_CHUNKS", - "path": "src/app_runtime/tracing/__init__.py", - "title": "src/app_runtime/tracing/__init__.py:1-17", - "content": "from app_runtime.contracts.trace import TraceContext, TraceContextRecord, TraceLogMessage, TraceTransport\nfrom app_runtime.tracing.service import TraceManager, TraceService\nfrom app_runtime.tracing.store import ActiveTraceContext, TraceContextStore\nfrom app_runtime.tracing.transport import MySqlTraceTransport, NoOpTraceTransport\n\n__all__ = [\n \"ActiveTraceContext\",\n \"MySqlTraceTransport\",\n \"NoOpTraceTransport\",\n \"TraceContext\",\n \"TraceContextRecord\",\n \"TraceContextStore\",\n \"TraceLogMessage\",\n \"TraceManager\",\n \"TraceService\",\n \"TraceTransport\",\n]", - "start_line": 1, - "end_line": 17, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.app_runtime.tracing.__init__", - "is_test": false, - "blob_sha": "a01dea5f773515aeaae8e6d3431fcb93531a8b577dfa26c2e5db16cd6ae6e4d9", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C0_SOURCE_CHUNKS", - "path": "src/plba/__init__.py", - "title": "src/plba/__init__.py:1-69", - "content": "from plba.bootstrap import create_runtime\nfrom plba.config import ConfigFileLoader, FileConfigProvider\nfrom plba.control import ControlActionSet, ControlChannel, ControlPlaneService, HttpControlChannel\nfrom plba.contracts import (\n ApplicationModule,\n ConfigProvider,\n HealthContributor,\n TraceContext,\n TraceContextRecord,\n TraceLogMessage,\n TraceTransport,\n Worker,\n WorkerHealth,\n WorkerStatus,\n)\nfrom plba.core import ConfigurationManager, RuntimeManager, ServiceContainer\nfrom plba.health import HealthRegistry\nfrom plba.logging import LogManager\nfrom plba.queue import InMemoryTaskQueue\nfrom plba.tracing import MySqlTraceTransport, NoOpTraceTransport, TraceService\nfrom plba.workflow import (\n StepResult,\n WorkflowContext,\n WorkflowDefinition,\n WorkflowEngine,\n WorkflowEngineHooks,\n WorkflowNode,\n WorkflowRuntimeFactory,\n WorkflowStep,\n)\nfrom plba.workers import WorkerSupervisor\n\n__all__ = [\n \"ApplicationModule\",\n \"ConfigFileLoader\",\n \"ConfigProvider\",\n \"ConfigurationManager\",\n \"ControlActionSet\",\n \"ControlChannel\",\n \"ControlPlaneService\",\n \"create_runtime\",\n \"FileConfigProvider\",\n \"HealthContributor\",\n \"HealthRegistry\",\n \"HttpControlChannel\",\n \"InMemoryTaskQueue\",\n \"LogManager\",\n \"MySqlTraceTransport\",\n \"NoOpTraceTransport\",\n \"RuntimeManager\",\n \"ServiceContainer\",\n \"TraceContext\",\n \"TraceContextRecord\",\n \"TraceLogMessage\",\n \"TraceService\",\n \"TraceTransport\",\n \"StepResult\",\n \"Worker\",\n \"WorkerHealth\",\n \"WorkerStatus\",\n \"WorkflowContext\",\n \"WorkflowDefinition\",\n \"WorkflowEngine\",\n \"WorkflowEngineHooks\",\n \"WorkflowNode\",\n \"WorkflowRuntimeFactory\",\n \"WorkflowStep\",\n \"WorkerSupervisor\",\n]", - "start_line": 1, - "end_line": 69, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.plba.__init__", - "is_test": false, - "blob_sha": "24e755ec8c249d14fb0e675b5dbf2b71ab91afb9c849897eebfa9feb2499e19d", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C0_SOURCE_CHUNKS", - "path": "tests/test_runtime.py", - "title": "tests/test_runtime.py:test_trace_service_writes_contexts_and_messages", - "content": "def test_trace_service_writes_contexts_and_messages() -> None:\n from app_runtime.tracing.service import TraceService\n\n transport = RecordingTransport()\n manager = TraceService(transport=transport)\n\n with manager.open_context(alias=\"worker\", kind=\"worker\", attrs={\"routine\": \"incoming\"}):\n manager.step(\"parse\")\n manager.info(\"started\", status=\"ok\", attrs={\"attempt\": 1})\n\n assert len(transport.contexts) == 1\n assert len(transport.messages) == 1\n assert transport.contexts[0].alias == \"worker\"\n assert transport.messages[0].step == \"parse\"", - "start_line": 246, - "end_line": 259, - "metadata": { - "chunk_index": 9, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_runtime", - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C0_SOURCE_CHUNKS", - "path": "tests/test_runtime.py", - "title": "tests/test_runtime.py:test_trace_service_supports_debug_warning_and_error_levels", - "content": "def test_trace_service_supports_debug_warning_and_error_levels() -> None:\n from app_runtime.tracing.service import TraceService\n\n transport = RecordingTransport()\n manager = TraceService(transport=transport)\n\n with manager.open_context(alias=\"worker\", kind=\"worker\", attrs={\"routine\": \"incoming\"}):\n manager.step(\"validate\")\n manager.debug(\"validation details\", attrs={\"rule\": \"basic\"})\n manager.warning(\"validation warning\", status=\"degraded\", attrs={\"attempt\": 1})\n manager.error(\"integration failed\", status=\"failed\", attrs={\"integration\": \"crm\"})\n manager.exception(\"caught exception\", attrs={\"exception_type\": \"RuntimeError\"})\n\n levels = [message.level for message in transport.messages]\n assert levels == [\"DEBUG\", \"WARNING\", \"ERROR\", \"ERROR\"]", - "start_line": 262, - "end_line": 276, - "metadata": { - "chunk_index": 10, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_runtime", - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C0_SOURCE_CHUNKS", - "path": "src/app_runtime/tracing/service.py", - "title": "src/app_runtime/tracing/service.py:TraceManager", - "content": "class TraceManager(TraceService):\n \"\"\"Compatibility alias during the transition from ConfigManager-shaped naming.\"\"\"", - "start_line": 169, - "end_line": 170, - "metadata": { - "chunk_index": 2, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.tracing.service", - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C0_SOURCE_CHUNKS", - "path": "src/app_runtime/core/runtime.py", - "title": "src/app_runtime/core/runtime.py:RuntimeManager", - "content": "class RuntimeManager:\n ACTION_TIMEOUT_SECONDS = 10.0\n ACTION_POLL_INTERVAL_SECONDS = 0.05\n\n def __init__(\n self,\n configuration: ConfigurationManager | None = None,\n services: ServiceContainer | None = None,\n traces: TraceService | None = None,\n health: HealthRegistry | None = None,\n logs: LogManager | None = None,\n workers: WorkerSupervisor | None = None,\n control_plane: ControlPlaneService | None = None,\n ) -> None:\n self.configuration = configuration or ConfigurationManager()\n self.services = services or ServiceContainer()\n self.traces = traces or TraceService()\n self.health = health or HealthRegistry()\n self.logs = logs or LogManager()\n self.workers = workers or WorkerSupervisor()\n self.control_plane = control_plane or ControlPlaneService()\n self.registry = ModuleRegistry(self.services)\n self._started = False\n self._state = LifecycleState.IDLE\n self._core_registered = False\n self._workers_registered = False\n self._register_core_services()\n\n def register_module(self, module: ApplicationModule) -> None:\n self.registry.register_module(module.name)\n module.register(self.registry)\n\n def add_config_file(self, path: str) -> FileConfigProvider:\n provider = FileConfigProvider(path)\n self.configuration.add_provider(provider)\n return provider\n\n def start(self, *, start_control_plane: bool = True) -> None:\n if self._started:\n return\n self._state = LifecycleState.STARTING\n config = self.configuration.load()\n self.logs.apply_config(config)\n self._register_health_contributors()\n self._register_workers()\n self.workers.start()\n if start_control_plane:\n self.control_plane.start(self)\n self._started = True\n self._refresh_state()\n\n def stop(self, timeout: float = 30.0, force: bool = False, stop_control_plane: bool = True) -> None:\n if not self._started:\n return\n self._state = LifecycleState.STOPPING\n self.workers.stop(timeout=timeout, force=force)\n if stop_control_plane:\n self.control_plane.stop()\n self._started = False\n self._state = LifecycleState.STOPPED\n\n def status(self) -> dict[str, object]:\n self._refresh_state()\n return self.control_plane.snapshot(self)\n\n def current_health(self) -> HealthPayload:\n self._refresh_state()\n return self.health.payload(self._state, self.workers.healths())\n\n async def health_status(self) -> HealthPayload:\n return self.current_health()\n\n async def start_runtime(self) -> dict[str, object] | str:\n self._refresh_state()\n if self._started:\n return \"runtime already running\"\n if self._state == LifecycleState.STOPPING:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n\n self.start(start_control_plane=False)\n started = self._wait_for_state({LifecycleState.IDLE, LifecycleState.BUSY}, timeout=self.ACTION_TIMEOUT_SECONDS)\n if started:\n return self._action_detail(\"runtime started\", timed_out=False)\n return self._action_detail(\"runtime start is still in progress\", timed_out=True)\n\n async def stop_runtime(self) -> dict[str, object] | str:\n self._refresh_state()\n if not self._started:\n if self._state == LifecycleState.STOPPING:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n return \"runtime already stopped\"\n\n self._state = LifecycleState.STOPPING\n try:\n self.workers.stop(timeout=self.ACTION_TIMEOUT_SECONDS, force=False)\n except TimeoutError:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n\n self._started = False\n self._state = LifecycleState.STOPPED\n return self._action_detail(\"runtime stopped\", timed_out=False)\n\n async def runtime_status(self) -> str:\n self._refresh_state()\n return self._state.value\n\n def _register_core_services(self) -> None:\n if self._core_registered:\n return\n self.services.register(\"configuration\", self.configuration)\n self.services.register(\"traces\", self.traces)\n self.services.register(\"health\", self.health)\n self.services.register(\"logs\", self.logs)\n self.services.register(\"workers\", self.workers)\n self.services.register(\"control_plane\", self.control_plane)\n self._core_registered = True\n\n def _register_health_contributors(self) -> None:\n for contributor in self.registry.health_contributors:\n self.health.register(contributor)\n\n def _register_workers(self) -> None:\n if self._workers_registered:\n return\n for worker in self.registry.workers:\n self.workers.register(worker)\n self._workers_registered = True\n\n def _refresh_state(self) -> None:\n lifecycle = self.workers.lifecycle_state()\n\n if self._state == LifecycleState.STOPPING:\n if lifecycle == LifecycleState.STOPPED:\n self._started = False\n self._state = LifecycleState.STOPPED\n return\n\n if not self._started:\n if lifecycle == LifecycleState.STOPPED:\n self._state = LifecycleState.STOPPED\n return\n\n self._state = lifecycle\n\n def _wait_for_state(self, target_states: set[LifecycleState], *, timeout: float) -> bool:\n deadline = monotonic() + timeout\n while monotonic() < deadline:\n self._refresh_state()\n if self._state in target_states:\n return True\n sleep(self.ACTION_POLL_INTERVAL_SECONDS)\n self._refresh_state()\n return self._state in target_states\n\n def _action_detail(self, message: str, *, timed_out: bool) -> dict[str, object]:\n self._refresh_state()\n return {\n \"message\": message,\n \"state\": self._state.value,\n \"timed_out\": timed_out,\n \"workers\": self.workers.snapshot(),\n }", - "start_line": 18, - "end_line": 179, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.core.runtime", - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C0_SOURCE_CHUNKS", - "path": "src/app_runtime/tracing/service.py", - "title": "src/app_runtime/tracing/service.py:TraceService", - "content": "class TraceService(TraceContextFactory):\n def __init__(self, transport: TraceTransport | None = None, store: TraceContextStore | None = None) -> None:\n self.transport = transport or NoOpTraceTransport()\n self.store = store or TraceContextStore()\n self._writer = TraceRecordWriter(self.transport)\n\n def create_context(\n self,\n *,\n alias: str,\n parent_id: str | None = None,\n kind: str | None = None,\n attrs: dict[str, Any] | None = None,\n ) -> str:\n record = TraceContextRecord(\n trace_id=uuid4().hex,\n alias=str(alias or \"\"),\n parent_id=parent_id,\n type=kind,\n event_time=utc_now(),\n attrs=dict(attrs or {}),\n )\n self.store.push(record)\n self._writer.write_context(record)\n return record.trace_id\n\n @contextmanager\n def open_context(\n self,\n *,\n alias: str,\n parent_id: str | None = None,\n kind: str | None = None,\n attrs: dict[str, Any] | None = None,\n ) -> Iterator[str]:\n trace_id = self.create_context(alias=alias, parent_id=parent_id, kind=kind, attrs=attrs)\n try:\n yield trace_id\n finally:\n self.store.pop()\n\n def current_trace_id(self) -> str | None:\n return self.store.current_trace_id()\n\n def close_context(self) -> str | None:\n previous = self.store.pop()\n return previous.record.trace_id if previous else None\n\n def step(self, name: str) -> None:\n self.store.set_step(str(name or \"\"))\n\n def info(self, message: str, *, status: str | None = None, attrs: dict[str, Any] | None = None) -> None:\n self._write_message(\"INFO\", message, status, attrs)\n\n def debug(self, message: str, *, status: str | None = None, attrs: dict[str, Any] | None = None) -> None:\n self._write_message(\"DEBUG\", message, status, attrs)\n\n def warning(self, message: str, *, status: str | None = None, attrs: dict[str, Any] | None = None) -> None:\n self._write_message(\"WARNING\", message, status, attrs)\n\n def error(self, message: str, *, status: str | None = None, attrs: dict[str, Any] | None = None) -> None:\n self._write_message(\"ERROR\", message, status, attrs)\n\n def exception(self, message: str, *, status: str = \"failed\", attrs: dict[str, Any] | None = None) -> None:\n self._write_message(\"ERROR\", message, status, attrs)\n\n def new_root(self, operation: str) -> TraceContext:\n trace_id = self.create_context(alias=operation, kind=\"operation\", attrs={\"operation\": operation})\n return TraceContext(trace_id=trace_id, span_id=trace_id, attributes={\"operation\": operation})\n\n def child_of(self, parent: TraceContext, operation: str) -> TraceContext:\n trace_id = self.create_context(\n alias=operation,\n parent_id=parent.trace_id,\n kind=\"worker\",\n attrs={\"operation\": operation},\n )\n return TraceContext(\n trace_id=trace_id,\n span_id=trace_id,\n parent_span_id=parent.span_id,\n attributes={\"operation\": operation},\n )\n\n def attach(self, metadata: dict[str, object], context: TraceContext) -> dict[str, object]:\n updated = dict(metadata)\n updated[\"trace_id\"] = context.trace_id\n updated[\"span_id\"] = context.span_id\n updated[\"parent_span_id\"] = context.parent_span_id\n return updated\n\n def resume(self, metadata: dict[str, object], operation: str) -> TraceContext:\n trace_id = str(metadata.get(\"trace_id\") or uuid4().hex)\n span_id = str(metadata.get(\"span_id\") or trace_id)\n parent_id = metadata.get(\"parent_span_id\")\n self.create_context(\n alias=operation,\n parent_id=str(parent_id) if parent_id else None,\n kind=\"worker\",\n attrs=dict(metadata),\n )\n return TraceContext(\n trace_id=trace_id,\n span_id=span_id,\n parent_span_id=str(parent_id) if parent_id else None,\n attributes={\"operation\": operation},\n )\n\n def _write_message(\n self,\n level: TraceLevel,\n message: str,\n status: str | None,\n attrs: dict[str, Any] | None,\n ) -> None:\n active = self.store.current()\n if active is None:\n raise RuntimeError(\"Trace context is not bound. Call create_context() first.\")\n record = TraceLogMessage(\n trace_id=active.record.trace_id,\n step=active.step,\n status=str(status or \"\"),\n message=str(message or \"\"),\n level=level,\n event_time=utc_now(),\n attrs=dict(attrs or {}),\n )\n self._writer.write_message(record)", - "start_line": 39, - "end_line": 166, - "metadata": { - "chunk_index": 1, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.tracing.service", - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C0_SOURCE_CHUNKS", - "path": "src/app_runtime/contracts/__init__.py", - "title": "src/app_runtime/__init__.py:1-1", - "content": "__all__: list[str] = []", - "start_line": 1, - "end_line": 1, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.app_runtime.__init__", - "is_test": false, - "blob_sha": "8eea9df4f6d7b38ca0e39ccc27b04700e3d08dbeec8046d613d22706d19985fa", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "relations": [ - { - "path": "src/app_runtime/tracing/service.py", - "start_line": 42, - "end_line": 61, - "edge_type": "dataflow_slice", - "source": "TraceService.__init__", - "target": "TraceService.create_context", - "metadata": { - "edge_id": "3b052062067a78aef3302ee1d996897e02a67d1b340397bea4f59fe147c0492a", - "edge_type": "dataflow_slice", - "src_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "src_qname": "TraceService.__init__", - "dst_symbol_id": "ff44881104b65ef50ee6fe16d367d4a81b6e7eb5c44c0963cf4543faec785d4a", - "dst_ref": "TraceService.create_context", - "resolution": "resolved", - "slice_id": "3b052062067a78aef3302ee1d996897e02a67d1b340397bea4f59fe147c0492a", - "root_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "path_symbols": [ - "TraceService.__init__", - "TraceService.store", - "TraceService.create_context" - ], - "path_symbol_ids": [ - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "ff44881104b65ef50ee6fe16d367d4a81b6e7eb5c44c0963cf4543faec785d4a" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - }, - "content": "TraceService.__init__\n -> TraceService.store\n -> TraceService.create_context" - }, - { - "path": "src/app_runtime/tracing/service.py", - "start_line": 42, - "end_line": 84, - "edge_type": "dataflow_slice", - "source": "TraceService.__init__", - "target": "TraceService.close_context", - "metadata": { - "edge_id": "7a9353ef57c9ae5d19b3a0c6ac50fad05e6d21d31bbe1cd1cd07af6332ba6505", - "edge_type": "dataflow_slice", - "src_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "src_qname": "TraceService.__init__", - "dst_symbol_id": "01e14158dcced7e52d0c8ac84ac7b9a75225c261b6aca6a1d7da802d0994721c", - "dst_ref": "TraceService.close_context", - "resolution": "resolved", - "slice_id": "7a9353ef57c9ae5d19b3a0c6ac50fad05e6d21d31bbe1cd1cd07af6332ba6505", - "root_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "path_symbols": [ - "TraceService.__init__", - "TraceService.store", - "TraceService.close_context" - ], - "path_symbol_ids": [ - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "01e14158dcced7e52d0c8ac84ac7b9a75225c261b6aca6a1d7da802d0994721c" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - }, - "content": "TraceService.__init__\n -> TraceService.store\n -> TraceService.close_context" - }, - { - "path": "src/app_runtime/tracing/service.py", - "start_line": 42, - "end_line": 78, - "edge_type": "dataflow_slice", - "source": "TraceService.__init__", - "target": "TraceService.open_context", - "metadata": { - "edge_id": "a6e13b9ebc4fed84586afd53ed92a4d14757e440873f572b2337d5622ee96031", - "edge_type": "dataflow_slice", - "src_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "src_qname": "TraceService.__init__", - "dst_symbol_id": "2da3d5b20a947bf63e14c103be4689b72fd837e0a82abd6c497846375d4c7426", - "dst_ref": "TraceService.open_context", - "resolution": "resolved", - "slice_id": "a6e13b9ebc4fed84586afd53ed92a4d14757e440873f572b2337d5622ee96031", - "root_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "path_symbols": [ - "TraceService.__init__", - "TraceService.store", - "TraceService.open_context" - ], - "path_symbol_ids": [ - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "2da3d5b20a947bf63e14c103be4689b72fd837e0a82abd6c497846375d4c7426" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - }, - "content": "TraceService.__init__\n -> TraceService.store\n -> TraceService.open_context" - }, - { - "path": "src/app_runtime/tracing/service.py", - "start_line": 41, - "end_line": 43, - "edge_type": "dataflow_slice", - "source": "TraceService.__init__", - "target": "TraceService.__init__", - "metadata": { - "edge_id": "1e923a93faa05c3c43ca9b19bd047007a8589ccce57d3cc1798ae7f9f200af98", - "edge_type": "dataflow_slice", - "src_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "src_qname": "TraceService.__init__", - "dst_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "dst_ref": "TraceService.__init__", - "resolution": "resolved", - "slice_id": "1e923a93faa05c3c43ca9b19bd047007a8589ccce57d3cc1798ae7f9f200af98", - "root_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "path_symbols": [ - "TraceService.__init__", - "TraceService.transport", - "TraceService.__init__" - ], - "path_symbol_ids": [ - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - }, - "content": "TraceService.__init__\n -> TraceService.transport\n -> TraceService.__init__" - }, - { - "path": "src/app_runtime/tracing/service.py", - "start_line": 42, - "end_line": 81, - "edge_type": "dataflow_slice", - "source": "TraceService.__init__", - "target": "TraceService.current_trace_id", - "metadata": { - "edge_id": "3ea17138634b1190bded77ddb84aa1595124f6519b246f24fc4b02bd62b5cac1", - "edge_type": "dataflow_slice", - "src_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "src_qname": "TraceService.__init__", - "dst_symbol_id": "41135180f7b3b9ab20e097e0747474e219c37dd2366ef08a7b43c1f3edb10b4c", - "dst_ref": "TraceService.current_trace_id", - "resolution": "resolved", - "slice_id": "3ea17138634b1190bded77ddb84aa1595124f6519b246f24fc4b02bd62b5cac1", - "root_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "path_symbols": [ - "TraceService.__init__", - "TraceService.store", - "TraceService.current_trace_id" - ], - "path_symbol_ids": [ - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "41135180f7b3b9ab20e097e0747474e219c37dd2366ef08a7b43c1f3edb10b4c" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - }, - "content": "TraceService.__init__\n -> TraceService.store\n -> TraceService.current_trace_id" - }, - { - "path": "src/app_runtime/tracing/service.py", - "start_line": 42, - "end_line": 88, - "edge_type": "dataflow_slice", - "source": "TraceService.__init__", - "target": "TraceService.step", - "metadata": { - "edge_id": "9f34c5da9b09fba99df6f6b1bde183a9aeb45111b8218a747c71590c2c9f60f2", - "edge_type": "dataflow_slice", - "src_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "src_qname": "TraceService.__init__", - "dst_symbol_id": "c44bfbc66cf747283f30088da3e011a10395031d41e77b74e523c24997f641ca", - "dst_ref": "TraceService.step", - "resolution": "resolved", - "slice_id": "9f34c5da9b09fba99df6f6b1bde183a9aeb45111b8218a747c71590c2c9f60f2", - "root_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "path_symbols": [ - "TraceService.__init__", - "TraceService.store", - "TraceService.step" - ], - "path_symbol_ids": [ - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "c44bfbc66cf747283f30088da3e011a10395031d41e77b74e523c24997f641ca" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - }, - "content": "TraceService.__init__\n -> TraceService.store\n -> TraceService.step" - } - ], - "semantic_hints": [], - "entrypoints": [], - "test_candidates": [ - { - "path": "tests/test_runtime.py", - "title": "tests/test_runtime.py:test_trace_service_allows_messages_without_status", - "content": "def test_trace_service_allows_messages_without_status() -> None:\n from app_runtime.tracing.service import TraceService\n\n transport = RecordingTransport()\n manager = TraceService(transport=transport)\n\n with manager.open_context(alias=\"worker\", kind=\"worker\"):\n manager.step(\"optiona" - }, - { - "path": "tests/test_runtime.py", - "title": "tests/test_runtime.py:test_trace_service_writes_contexts_and_messages", - "content": "def test_trace_service_writes_contexts_and_messages() -> None:\n from app_runtime.tracing.service import TraceService\n\n transport = RecordingTransport()\n manager = TraceService(transport=transport)\n\n with manager.open_context(alias=\"worker\", kind=\"worker\", attrs={\"routine\": \"incoming\"}):\n" - }, - { - "path": "tests/test_runtime.py", - "title": "tests/test_runtime.py:test_trace_service_supports_debug_warning_and_error_levels", - "content": "def test_trace_service_supports_debug_warning_and_error_levels() -> None:\n from app_runtime.tracing.service import TraceService\n\n transport = RecordingTransport()\n manager = TraceService(transport=transport)\n\n with manager.open_context(alias=\"worker\", kind=\"worker\", attrs={\"routine\": \"in" - } - ], - "layer_outcomes": [ - { - "layer_id": "C1_SYMBOL_CATALOG", - "hit_count": 8, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C2_DEPENDENCY_GRAPH", - "hit_count": 6, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C0_SOURCE_CHUNKS", - "hit_count": 10, - "empty": false, - "fallback_used": false - } - ], - "missing_layers": [], - "raw_rows": [ - { - "path": "src/plba/__init__.py", - "content": "const TraceService\nTraceService = plba.tracing.TraceService", - "layer": "C1_SYMBOL_CATALOG", - "title": "TraceService", - "span_start": 20, - "span_end": 20, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": null, - "metadata": { - "symbol_id": "259ec03b77b9387ea53f69c77af32791dd29adf6de617ba72dd3f839197342a1", - "qname": "TraceService", - "kind": "const", - "signature": "TraceService = plba.tracing.TraceService", - "parent_symbol_id": null, - "package_or_module": "src.plba.__init__", - "is_test": false, - "blob_sha": "24e755ec8c249d14fb0e675b5dbf2b71ab91afb9c849897eebfa9feb2499e19d", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "const TraceService\nTraceService = app_runtime.tracing.service.TraceService", - "layer": "C1_SYMBOL_CATALOG", - "title": "TraceService", - "span_start": 14, - "span_end": 14, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": null, - "metadata": { - "symbol_id": "3ccf6212fd7d9730f9df933e2ee7671b65bdae0520577e1a49c6432262842db6", - "qname": "TraceService", - "kind": "const", - "signature": "TraceService = app_runtime.tracing.service.TraceService", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.core.runtime", - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/__init__.py", - "content": "const TraceService\nTraceService = app_runtime.tracing.service.TraceService", - "layer": "C1_SYMBOL_CATALOG", - "title": "TraceService", - "span_start": 2, - "span_end": 2, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": null, - "metadata": { - "symbol_id": "ecd2fab7fa9744b2adca84d3d213f7aadcb7e1da84b9c2764a4ab39c65282b11", - "qname": "TraceService", - "kind": "const", - "signature": "TraceService = app_runtime.tracing.service.TraceService", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.tracing.__init__", - "is_test": false, - "blob_sha": "a01dea5f773515aeaae8e6d3431fcb93531a8b577dfa26c2e5db16cd6ae6e4d9", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "class TraceService\nTraceService(TraceContextFactory)", - "layer": "C1_SYMBOL_CATALOG", - "title": "TraceService", - "span_start": 39, - "span_end": 166, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": null, - "metadata": { - "symbol_id": "c2b2b976d99f2c600000b753731b26e0a69adcb4359398b93073590c5d5d04f4", - "qname": "TraceService", - "kind": "class", - "signature": "TraceService(TraceContextFactory)", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.tracing.service", - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/tracing.py", - "content": "const TraceService\nTraceService = app_runtime.tracing.service.TraceService", - "layer": "C1_SYMBOL_CATALOG", - "title": "TraceService", - "span_start": 1, - "span_end": 1, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": null, - "metadata": { - "symbol_id": "a4556fb3f83c50ea68b94a679786ce802cab7ffd9d7138aad3d6009b2661f425", - "qname": "TraceService", - "kind": "const", - "signature": "TraceService = app_runtime.tracing.service.TraceService", - "parent_symbol_id": null, - "package_or_module": "src.plba.tracing", - "is_test": false, - "blob_sha": "a27e11c716c93c3fcefe6f11b4cc420a6b743e7606606071d7f1aeeccc4e7d45", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "method TraceService.open_context\nopen_context(self)", - "layer": "C1_SYMBOL_CATALOG", - "title": "TraceService.open_context", - "span_start": 66, - "span_end": 78, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": null, - "metadata": { - "symbol_id": "2da3d5b20a947bf63e14c103be4689b72fd837e0a82abd6c497846375d4c7426", - "qname": "TraceService.open_context", - "kind": "method", - "signature": "open_context(self)", - "parent_symbol_id": "TraceService", - "package_or_module": "src.app_runtime.tracing.service", - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "method TraceService.create_context\ncreate_context(self)", - "layer": "C1_SYMBOL_CATALOG", - "title": "TraceService.create_context", - "span_start": 45, - "span_end": 63, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": null, - "metadata": { - "symbol_id": "ff44881104b65ef50ee6fe16d367d4a81b6e7eb5c44c0963cf4543faec785d4a", - "qname": "TraceService.create_context", - "kind": "method", - "signature": "create_context(self)", - "parent_symbol_id": "TraceService", - "package_or_module": "src.app_runtime.tracing.service", - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "method TraceService.current_trace_id\ncurrent_trace_id(self)", - "layer": "C1_SYMBOL_CATALOG", - "title": "TraceService.current_trace_id", - "span_start": 80, - "span_end": 81, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": null, - "metadata": { - "symbol_id": "41135180f7b3b9ab20e097e0747474e219c37dd2366ef08a7b43c1f3edb10b4c", - "qname": "TraceService.current_trace_id", - "kind": "method", - "signature": "current_trace_id(self)", - "parent_symbol_id": "TraceService", - "package_or_module": "src.app_runtime.tracing.service", - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "TraceService.__init__\n -> TraceService.store\n -> TraceService.create_context", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "TraceService.__init__:dataflow_slice", - "span_start": 42, - "span_end": 61, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": null, - "metadata": { - "edge_id": "3b052062067a78aef3302ee1d996897e02a67d1b340397bea4f59fe147c0492a", - "edge_type": "dataflow_slice", - "src_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "src_qname": "TraceService.__init__", - "dst_symbol_id": "ff44881104b65ef50ee6fe16d367d4a81b6e7eb5c44c0963cf4543faec785d4a", - "dst_ref": "TraceService.create_context", - "resolution": "resolved", - "slice_id": "3b052062067a78aef3302ee1d996897e02a67d1b340397bea4f59fe147c0492a", - "root_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "path_symbols": [ - "TraceService.__init__", - "TraceService.store", - "TraceService.create_context" - ], - "path_symbol_ids": [ - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "ff44881104b65ef50ee6fe16d367d4a81b6e7eb5c44c0963cf4543faec785d4a" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "TraceService.__init__\n -> TraceService.store\n -> TraceService.close_context", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "TraceService.__init__:dataflow_slice", - "span_start": 42, - "span_end": 84, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": null, - "metadata": { - "edge_id": "7a9353ef57c9ae5d19b3a0c6ac50fad05e6d21d31bbe1cd1cd07af6332ba6505", - "edge_type": "dataflow_slice", - "src_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "src_qname": "TraceService.__init__", - "dst_symbol_id": "01e14158dcced7e52d0c8ac84ac7b9a75225c261b6aca6a1d7da802d0994721c", - "dst_ref": "TraceService.close_context", - "resolution": "resolved", - "slice_id": "7a9353ef57c9ae5d19b3a0c6ac50fad05e6d21d31bbe1cd1cd07af6332ba6505", - "root_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "path_symbols": [ - "TraceService.__init__", - "TraceService.store", - "TraceService.close_context" - ], - "path_symbol_ids": [ - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "01e14158dcced7e52d0c8ac84ac7b9a75225c261b6aca6a1d7da802d0994721c" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "TraceService.__init__\n -> TraceService.store\n -> TraceService.open_context", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "TraceService.__init__:dataflow_slice", - "span_start": 42, - "span_end": 78, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": null, - "metadata": { - "edge_id": "a6e13b9ebc4fed84586afd53ed92a4d14757e440873f572b2337d5622ee96031", - "edge_type": "dataflow_slice", - "src_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "src_qname": "TraceService.__init__", - "dst_symbol_id": "2da3d5b20a947bf63e14c103be4689b72fd837e0a82abd6c497846375d4c7426", - "dst_ref": "TraceService.open_context", - "resolution": "resolved", - "slice_id": "a6e13b9ebc4fed84586afd53ed92a4d14757e440873f572b2337d5622ee96031", - "root_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "path_symbols": [ - "TraceService.__init__", - "TraceService.store", - "TraceService.open_context" - ], - "path_symbol_ids": [ - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "2da3d5b20a947bf63e14c103be4689b72fd837e0a82abd6c497846375d4c7426" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "TraceService.__init__\n -> TraceService.transport\n -> TraceService.__init__", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "TraceService.__init__:dataflow_slice", - "span_start": 41, - "span_end": 43, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": null, - "metadata": { - "edge_id": "1e923a93faa05c3c43ca9b19bd047007a8589ccce57d3cc1798ae7f9f200af98", - "edge_type": "dataflow_slice", - "src_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "src_qname": "TraceService.__init__", - "dst_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "dst_ref": "TraceService.__init__", - "resolution": "resolved", - "slice_id": "1e923a93faa05c3c43ca9b19bd047007a8589ccce57d3cc1798ae7f9f200af98", - "root_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "path_symbols": [ - "TraceService.__init__", - "TraceService.transport", - "TraceService.__init__" - ], - "path_symbol_ids": [ - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "TraceService.__init__\n -> TraceService.store\n -> TraceService.current_trace_id", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "TraceService.__init__:dataflow_slice", - "span_start": 42, - "span_end": 81, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": null, - "metadata": { - "edge_id": "3ea17138634b1190bded77ddb84aa1595124f6519b246f24fc4b02bd62b5cac1", - "edge_type": "dataflow_slice", - "src_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "src_qname": "TraceService.__init__", - "dst_symbol_id": "41135180f7b3b9ab20e097e0747474e219c37dd2366ef08a7b43c1f3edb10b4c", - "dst_ref": "TraceService.current_trace_id", - "resolution": "resolved", - "slice_id": "3ea17138634b1190bded77ddb84aa1595124f6519b246f24fc4b02bd62b5cac1", - "root_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "path_symbols": [ - "TraceService.__init__", - "TraceService.store", - "TraceService.current_trace_id" - ], - "path_symbol_ids": [ - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "41135180f7b3b9ab20e097e0747474e219c37dd2366ef08a7b43c1f3edb10b4c" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "TraceService.__init__\n -> TraceService.store\n -> TraceService.step", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "TraceService.__init__:dataflow_slice", - "span_start": 42, - "span_end": 88, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": null, - "metadata": { - "edge_id": "9f34c5da9b09fba99df6f6b1bde183a9aeb45111b8218a747c71590c2c9f60f2", - "edge_type": "dataflow_slice", - "src_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "src_qname": "TraceService.__init__", - "dst_symbol_id": "c44bfbc66cf747283f30088da3e011a10395031d41e77b74e523c24997f641ca", - "dst_ref": "TraceService.step", - "resolution": "resolved", - "slice_id": "9f34c5da9b09fba99df6f6b1bde183a9aeb45111b8218a747c71590c2c9f60f2", - "root_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "path_symbols": [ - "TraceService.__init__", - "TraceService.store", - "TraceService.step" - ], - "path_symbol_ids": [ - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "c44bfbc66cf747283f30088da3e011a10395031d41e77b74e523c24997f641ca" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/tracing.py", - "content": "from app_runtime.tracing.service import TraceService\nfrom app_runtime.tracing.transport import MySqlTraceTransport, NoOpTraceTransport\n\n__all__ = [\"MySqlTraceTransport\", \"NoOpTraceTransport\", \"TraceService\"]", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/plba/tracing.py:1-4", - "span_start": 1, - "span_end": 4, - "lexical_rank": 6, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": null, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.plba.tracing", - "is_test": false, - "blob_sha": "a27e11c716c93c3fcefe6f11b4cc420a6b743e7606606071d7f1aeeccc4e7d45", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_runtime.py", - "content": "def test_trace_service_allows_messages_without_status() -> None:\n from app_runtime.tracing.service import TraceService\n\n transport = RecordingTransport()\n manager = TraceService(transport=transport)\n\n with manager.open_context(alias=\"worker\", kind=\"worker\"):\n manager.step(\"optional-status\")\n manager.debug(\"debug without status\")\n manager.info(\"info without status\")\n manager.warning(\"warning without status\")\n manager.error(\"error without status\")\n\n assert [message.status for message in transport.messages] == [\"\", \"\", \"\", \"\"]\n assert all(message.trace_id == transport.contexts[0].trace_id for message in transport.messages)", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_runtime.py:test_trace_service_allows_messages_without_status", - "span_start": 279, - "span_end": 293, - "lexical_rank": 6, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": null, - "metadata": { - "chunk_index": 11, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_runtime", - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/__init__.py", - "content": "from app_runtime.contracts.trace import TraceContext, TraceContextRecord, TraceLogMessage, TraceTransport\nfrom app_runtime.tracing.service import TraceManager, TraceService\nfrom app_runtime.tracing.store import ActiveTraceContext, TraceContextStore\nfrom app_runtime.tracing.transport import MySqlTraceTransport, NoOpTraceTransport\n\n__all__ = [\n \"ActiveTraceContext\",\n \"MySqlTraceTransport\",\n \"NoOpTraceTransport\",\n \"TraceContext\",\n \"TraceContextRecord\",\n \"TraceContextStore\",\n \"TraceLogMessage\",\n \"TraceManager\",\n \"TraceService\",\n \"TraceTransport\",\n]", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/tracing/__init__.py:1-17", - "span_start": 1, - "span_end": 17, - "lexical_rank": 6, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": null, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.app_runtime.tracing.__init__", - "is_test": false, - "blob_sha": "a01dea5f773515aeaae8e6d3431fcb93531a8b577dfa26c2e5db16cd6ae6e4d9", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/__init__.py", - "content": "from plba.bootstrap import create_runtime\nfrom plba.config import ConfigFileLoader, FileConfigProvider\nfrom plba.control import ControlActionSet, ControlChannel, ControlPlaneService, HttpControlChannel\nfrom plba.contracts import (\n ApplicationModule,\n ConfigProvider,\n HealthContributor,\n TraceContext,\n TraceContextRecord,\n TraceLogMessage,\n TraceTransport,\n Worker,\n WorkerHealth,\n WorkerStatus,\n)\nfrom plba.core import ConfigurationManager, RuntimeManager, ServiceContainer\nfrom plba.health import HealthRegistry\nfrom plba.logging import LogManager\nfrom plba.queue import InMemoryTaskQueue\nfrom plba.tracing import MySqlTraceTransport, NoOpTraceTransport, TraceService\nfrom plba.workflow import (\n StepResult,\n WorkflowContext,\n WorkflowDefinition,\n WorkflowEngine,\n WorkflowEngineHooks,\n WorkflowNode,\n WorkflowRuntimeFactory,\n WorkflowStep,\n)\nfrom plba.workers import WorkerSupervisor\n\n__all__ = [\n \"ApplicationModule\",\n \"ConfigFileLoader\",\n \"ConfigProvider\",\n \"ConfigurationManager\",\n \"ControlActionSet\",\n \"ControlChannel\",\n \"ControlPlaneService\",\n \"create_runtime\",\n \"FileConfigProvider\",\n \"HealthContributor\",\n \"HealthRegistry\",\n \"HttpControlChannel\",\n \"InMemoryTaskQueue\",\n \"LogManager\",\n \"MySqlTraceTransport\",\n \"NoOpTraceTransport\",\n \"RuntimeManager\",\n \"ServiceContainer\",\n \"TraceContext\",\n \"TraceContextRecord\",\n \"TraceLogMessage\",\n \"TraceService\",\n \"TraceTransport\",\n \"StepResult\",\n \"Worker\",\n \"WorkerHealth\",\n \"WorkerStatus\",\n \"WorkflowContext\",\n \"WorkflowDefinition\",\n \"WorkflowEngine\",\n \"WorkflowEngineHooks\",\n \"WorkflowNode\",\n \"WorkflowRuntimeFactory\",\n \"WorkflowStep\",\n \"WorkerSupervisor\",\n]", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/plba/__init__.py:1-69", - "span_start": 1, - "span_end": 69, - "lexical_rank": 6, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": null, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.plba.__init__", - "is_test": false, - "blob_sha": "24e755ec8c249d14fb0e675b5dbf2b71ab91afb9c849897eebfa9feb2499e19d", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_runtime.py", - "content": "def test_trace_service_writes_contexts_and_messages() -> None:\n from app_runtime.tracing.service import TraceService\n\n transport = RecordingTransport()\n manager = TraceService(transport=transport)\n\n with manager.open_context(alias=\"worker\", kind=\"worker\", attrs={\"routine\": \"incoming\"}):\n manager.step(\"parse\")\n manager.info(\"started\", status=\"ok\", attrs={\"attempt\": 1})\n\n assert len(transport.contexts) == 1\n assert len(transport.messages) == 1\n assert transport.contexts[0].alias == \"worker\"\n assert transport.messages[0].step == \"parse\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_runtime.py:test_trace_service_writes_contexts_and_messages", - "span_start": 246, - "span_end": 259, - "lexical_rank": 6, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": null, - "metadata": { - "chunk_index": 9, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_runtime", - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_runtime.py", - "content": "def test_trace_service_supports_debug_warning_and_error_levels() -> None:\n from app_runtime.tracing.service import TraceService\n\n transport = RecordingTransport()\n manager = TraceService(transport=transport)\n\n with manager.open_context(alias=\"worker\", kind=\"worker\", attrs={\"routine\": \"incoming\"}):\n manager.step(\"validate\")\n manager.debug(\"validation details\", attrs={\"rule\": \"basic\"})\n manager.warning(\"validation warning\", status=\"degraded\", attrs={\"attempt\": 1})\n manager.error(\"integration failed\", status=\"failed\", attrs={\"integration\": \"crm\"})\n manager.exception(\"caught exception\", attrs={\"exception_type\": \"RuntimeError\"})\n\n levels = [message.level for message in transport.messages]\n assert levels == [\"DEBUG\", \"WARNING\", \"ERROR\", \"ERROR\"]", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_runtime.py:test_trace_service_supports_debug_warning_and_error_levels", - "span_start": 262, - "span_end": 276, - "lexical_rank": 6, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": null, - "metadata": { - "chunk_index": 10, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_runtime", - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "class TraceManager(TraceService):\n \"\"\"Compatibility alias during the transition from ConfigManager-shaped naming.\"\"\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/tracing/service.py:TraceManager", - "span_start": 169, - "span_end": 170, - "lexical_rank": 6, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": null, - "metadata": { - "chunk_index": 2, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.tracing.service", - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "class RuntimeManager:\n ACTION_TIMEOUT_SECONDS = 10.0\n ACTION_POLL_INTERVAL_SECONDS = 0.05\n\n def __init__(\n self,\n configuration: ConfigurationManager | None = None,\n services: ServiceContainer | None = None,\n traces: TraceService | None = None,\n health: HealthRegistry | None = None,\n logs: LogManager | None = None,\n workers: WorkerSupervisor | None = None,\n control_plane: ControlPlaneService | None = None,\n ) -> None:\n self.configuration = configuration or ConfigurationManager()\n self.services = services or ServiceContainer()\n self.traces = traces or TraceService()\n self.health = health or HealthRegistry()\n self.logs = logs or LogManager()\n self.workers = workers or WorkerSupervisor()\n self.control_plane = control_plane or ControlPlaneService()\n self.registry = ModuleRegistry(self.services)\n self._started = False\n self._state = LifecycleState.IDLE\n self._core_registered = False\n self._workers_registered = False\n self._register_core_services()\n\n def register_module(self, module: ApplicationModule) -> None:\n self.registry.register_module(module.name)\n module.register(self.registry)\n\n def add_config_file(self, path: str) -> FileConfigProvider:\n provider = FileConfigProvider(path)\n self.configuration.add_provider(provider)\n return provider\n\n def start(self, *, start_control_plane: bool = True) -> None:\n if self._started:\n return\n self._state = LifecycleState.STARTING\n config = self.configuration.load()\n self.logs.apply_config(config)\n self._register_health_contributors()\n self._register_workers()\n self.workers.start()\n if start_control_plane:\n self.control_plane.start(self)\n self._started = True\n self._refresh_state()\n\n def stop(self, timeout: float = 30.0, force: bool = False, stop_control_plane: bool = True) -> None:\n if not self._started:\n return\n self._state = LifecycleState.STOPPING\n self.workers.stop(timeout=timeout, force=force)\n if stop_control_plane:\n self.control_plane.stop()\n self._started = False\n self._state = LifecycleState.STOPPED\n\n def status(self) -> dict[str, object]:\n self._refresh_state()\n return self.control_plane.snapshot(self)\n\n def current_health(self) -> HealthPayload:\n self._refresh_state()\n return self.health.payload(self._state, self.workers.healths())\n\n async def health_status(self) -> HealthPayload:\n return self.current_health()\n\n async def start_runtime(self) -> dict[str, object] | str:\n self._refresh_state()\n if self._started:\n return \"runtime already running\"\n if self._state == LifecycleState.STOPPING:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n\n self.start(start_control_plane=False)\n started = self._wait_for_state({LifecycleState.IDLE, LifecycleState.BUSY}, timeout=self.ACTION_TIMEOUT_SECONDS)\n if started:\n return self._action_detail(\"runtime started\", timed_out=False)\n return self._action_detail(\"runtime start is still in progress\", timed_out=True)\n\n async def stop_runtime(self) -> dict[str, object] | str:\n self._refresh_state()\n if not self._started:\n if self._state == LifecycleState.STOPPING:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n return \"runtime already stopped\"\n\n self._state = LifecycleState.STOPPING\n try:\n self.workers.stop(timeout=self.ACTION_TIMEOUT_SECONDS, force=False)\n except TimeoutError:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n\n self._started = False\n self._state = LifecycleState.STOPPED\n return self._action_detail(\"runtime stopped\", timed_out=False)\n\n async def runtime_status(self) -> str:\n self._refresh_state()\n return self._state.value\n\n def _register_core_services(self) -> None:\n if self._core_registered:\n return\n self.services.register(\"configuration\", self.configuration)\n self.services.register(\"traces\", self.traces)\n self.services.register(\"health\", self.health)\n self.services.register(\"logs\", self.logs)\n self.services.register(\"workers\", self.workers)\n self.services.register(\"control_plane\", self.control_plane)\n self._core_registered = True\n\n def _register_health_contributors(self) -> None:\n for contributor in self.registry.health_contributors:\n self.health.register(contributor)\n\n def _register_workers(self) -> None:\n if self._workers_registered:\n return\n for worker in self.registry.workers:\n self.workers.register(worker)\n self._workers_registered = True\n\n def _refresh_state(self) -> None:\n lifecycle = self.workers.lifecycle_state()\n\n if self._state == LifecycleState.STOPPING:\n if lifecycle == LifecycleState.STOPPED:\n self._started = False\n self._state = LifecycleState.STOPPED\n return\n\n if not self._started:\n if lifecycle == LifecycleState.STOPPED:\n self._state = LifecycleState.STOPPED\n return\n\n self._state = lifecycle\n\n def _wait_for_state(self, target_states: set[LifecycleState], *, timeout: float) -> bool:\n deadline = monotonic() + timeout\n while monotonic() < deadline:\n self._refresh_state()\n if self._state in target_states:\n return True\n sleep(self.ACTION_POLL_INTERVAL_SECONDS)\n self._refresh_state()\n return self._state in target_states\n\n def _action_detail(self, message: str, *, timed_out: bool) -> dict[str, object]:\n self._refresh_state()\n return {\n \"message\": message,\n \"state\": self._state.value,\n \"timed_out\": timed_out,\n \"workers\": self.workers.snapshot(),\n }", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/core/runtime.py:RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 6, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": null, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.core.runtime", - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "class TraceService(TraceContextFactory):\n def __init__(self, transport: TraceTransport | None = None, store: TraceContextStore | None = None) -> None:\n self.transport = transport or NoOpTraceTransport()\n self.store = store or TraceContextStore()\n self._writer = TraceRecordWriter(self.transport)\n\n def create_context(\n self,\n *,\n alias: str,\n parent_id: str | None = None,\n kind: str | None = None,\n attrs: dict[str, Any] | None = None,\n ) -> str:\n record = TraceContextRecord(\n trace_id=uuid4().hex,\n alias=str(alias or \"\"),\n parent_id=parent_id,\n type=kind,\n event_time=utc_now(),\n attrs=dict(attrs or {}),\n )\n self.store.push(record)\n self._writer.write_context(record)\n return record.trace_id\n\n @contextmanager\n def open_context(\n self,\n *,\n alias: str,\n parent_id: str | None = None,\n kind: str | None = None,\n attrs: dict[str, Any] | None = None,\n ) -> Iterator[str]:\n trace_id = self.create_context(alias=alias, parent_id=parent_id, kind=kind, attrs=attrs)\n try:\n yield trace_id\n finally:\n self.store.pop()\n\n def current_trace_id(self) -> str | None:\n return self.store.current_trace_id()\n\n def close_context(self) -> str | None:\n previous = self.store.pop()\n return previous.record.trace_id if previous else None\n\n def step(self, name: str) -> None:\n self.store.set_step(str(name or \"\"))\n\n def info(self, message: str, *, status: str | None = None, attrs: dict[str, Any] | None = None) -> None:\n self._write_message(\"INFO\", message, status, attrs)\n\n def debug(self, message: str, *, status: str | None = None, attrs: dict[str, Any] | None = None) -> None:\n self._write_message(\"DEBUG\", message, status, attrs)\n\n def warning(self, message: str, *, status: str | None = None, attrs: dict[str, Any] | None = None) -> None:\n self._write_message(\"WARNING\", message, status, attrs)\n\n def error(self, message: str, *, status: str | None = None, attrs: dict[str, Any] | None = None) -> None:\n self._write_message(\"ERROR\", message, status, attrs)\n\n def exception(self, message: str, *, status: str = \"failed\", attrs: dict[str, Any] | None = None) -> None:\n self._write_message(\"ERROR\", message, status, attrs)\n\n def new_root(self, operation: str) -> TraceContext:\n trace_id = self.create_context(alias=operation, kind=\"operation\", attrs={\"operation\": operation})\n return TraceContext(trace_id=trace_id, span_id=trace_id, attributes={\"operation\": operation})\n\n def child_of(self, parent: TraceContext, operation: str) -> TraceContext:\n trace_id = self.create_context(\n alias=operation,\n parent_id=parent.trace_id,\n kind=\"worker\",\n attrs={\"operation\": operation},\n )\n return TraceContext(\n trace_id=trace_id,\n span_id=trace_id,\n parent_span_id=parent.span_id,\n attributes={\"operation\": operation},\n )\n\n def attach(self, metadata: dict[str, object], context: TraceContext) -> dict[str, object]:\n updated = dict(metadata)\n updated[\"trace_id\"] = context.trace_id\n updated[\"span_id\"] = context.span_id\n updated[\"parent_span_id\"] = context.parent_span_id\n return updated\n\n def resume(self, metadata: dict[str, object], operation: str) -> TraceContext:\n trace_id = str(metadata.get(\"trace_id\") or uuid4().hex)\n span_id = str(metadata.get(\"span_id\") or trace_id)\n parent_id = metadata.get(\"parent_span_id\")\n self.create_context(\n alias=operation,\n parent_id=str(parent_id) if parent_id else None,\n kind=\"worker\",\n attrs=dict(metadata),\n )\n return TraceContext(\n trace_id=trace_id,\n span_id=span_id,\n parent_span_id=str(parent_id) if parent_id else None,\n attributes={\"operation\": operation},\n )\n\n def _write_message(\n self,\n level: TraceLevel,\n message: str,\n status: str | None,\n attrs: dict[str, Any] | None,\n ) -> None:\n active = self.store.current()\n if active is None:\n raise RuntimeError(\"Trace context is not bound. Call create_context() first.\")\n record = TraceLogMessage(\n trace_id=active.record.trace_id,\n step=active.step,\n status=str(status or \"\"),\n message=str(message or \"\"),\n level=level,\n event_time=utc_now(),\n attrs=dict(attrs or {}),\n )\n self._writer.write_message(record)", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/tracing/service.py:TraceService", - "span_start": 39, - "span_end": 166, - "lexical_rank": 6, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": null, - "metadata": { - "chunk_index": 1, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.tracing.service", - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/contracts/__init__.py", - "content": "__all__: list[str] = []", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/__init__.py:1-1", - "span_start": 1, - "span_end": 1, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": null, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.app_runtime.__init__", - "is_test": false, - "blob_sha": "8eea9df4f6d7b38ca0e39ccc27b04700e3d08dbeec8046d613d22706d19985fa", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "retrieval_report": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "vector", - "C2_DEPENDENCY_GRAPH": "vector", - "C0_SOURCE_CHUNKS": "vector" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C0_SOURCE_CHUNKS": 10 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [] - } - }, - "fallback": { - "used": false, - "reason": null - }, - "retrieval_by_layer_ms": { - "C1_SYMBOL_CATALOG": 34, - "C2_DEPENDENCY_GRAPH": 38, - "C0_SOURCE_CHUNKS": 16 - } - } - }, - "diagnostics": { - "intent_correct": null, - "target_found": true, - "layers_used": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ], - "retrieval_sufficient": true, - "answer_mode": "normal", - "resolved_target": "TraceService", - "answer_policy_branch": "normal_answer", - "decision_reason": "evidence_sufficient", - "router_result": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "retrieval_profile": "code", - "sub_intent": "FIND_TESTS", - "path_scope": [], - "layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ], - "symbol_resolution_status": "resolved" - }, - "retrieval_request": { - "rag_session_id": "7d11da21-faa0-4cea-aede-aeabe069164c", - "query": "Где тесты для TraceService?", - "sub_intent": "FIND_TESTS", - "path_scope": [], - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ] - }, - "per_layer_outcome": [ - { - "layer_id": "C1_SYMBOL_CATALOG", - "hit_count": 8, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C2_DEPENDENCY_GRAPH", - "hit_count": 6, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C0_SOURCE_CHUNKS", - "hit_count": 10, - "empty": false, - "fallback_used": false - } - ], - "empty_layers": [], - "evidence_gate_decision": { - "sufficient": true, - "failure_reasons": [], - "evidence_count": 24 - }, - "evidence_gate_input": { - "resolved_target": "TraceService", - "sub_intent": "FIND_TESTS", - "target_type": "symbol", - "evidence_count": 24, - "code_chunk_count": 24, - "entrypoint_count": 0, - "relation_count": 6, - "test_evidence_count": 3, - "symbol_resolution_status": "resolved", - "path_scope": [] - }, - "post_evidence_gate": { - "input": { - "answer_mode": "normal", - "degraded_message": "", - "resolved_target": "TraceService", - "draft_answer_preview": "Прямые тесты для TraceService находятся в файле `tests/test_runtime.py`:\n\n- `test_trace_service_allows_messages_without_status`: проверяет возможность отправки сообщений без статуса.\n- `test_trace_service_writes_contexts_and_messages`: проверяет запись контекстов и сообщений.\n- `test_trace_service_s", - "repair_candidate": true - }, - "output": { - "passed": true, - "action": "return", - "reasons": [], - "repair_used": false, - "final_answer_preview": "Прямые тесты для TraceService находятся в файле `tests/test_runtime.py`:\n\n- `test_trace_service_allows_messages_without_status`: проверяет возможность отправки сообщений без статуса.\n- `test_trace_service_writes_contexts_and_messages`: проверяет запись контекстов и сообщений.\n- `test_trace_service_s" - } - }, - "failure_reasons": [], - "timings_ms": { - "router": 1, - "retrieval": 90, - "pre_evidence_gate": 1, - "llm": 2378, - "post_evidence_gate": 1 - } - }, - "rag_rows": [ - { - "path": "src/plba/__init__.py", - "content": "const TraceService\nTraceService = plba.tracing.TraceService", - "layer": "C1_SYMBOL_CATALOG", - "title": "TraceService", - "span_start": 20, - "span_end": 20, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "259ec03b77b9387ea53f69c77af32791dd29adf6de617ba72dd3f839197342a1", - "qname": "TraceService", - "kind": "const", - "signature": "TraceService = plba.tracing.TraceService", - "parent_symbol_id": null, - "package_or_module": "src.plba.__init__", - "is_test": false, - "blob_sha": "24e755ec8c249d14fb0e675b5dbf2b71ab91afb9c849897eebfa9feb2499e19d", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "const TraceService\nTraceService = app_runtime.tracing.service.TraceService", - "layer": "C1_SYMBOL_CATALOG", - "title": "TraceService", - "span_start": 14, - "span_end": 14, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "3ccf6212fd7d9730f9df933e2ee7671b65bdae0520577e1a49c6432262842db6", - "qname": "TraceService", - "kind": "const", - "signature": "TraceService = app_runtime.tracing.service.TraceService", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.core.runtime", - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/__init__.py", - "content": "const TraceService\nTraceService = app_runtime.tracing.service.TraceService", - "layer": "C1_SYMBOL_CATALOG", - "title": "TraceService", - "span_start": 2, - "span_end": 2, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "ecd2fab7fa9744b2adca84d3d213f7aadcb7e1da84b9c2764a4ab39c65282b11", - "qname": "TraceService", - "kind": "const", - "signature": "TraceService = app_runtime.tracing.service.TraceService", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.tracing.__init__", - "is_test": false, - "blob_sha": "a01dea5f773515aeaae8e6d3431fcb93531a8b577dfa26c2e5db16cd6ae6e4d9", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "class TraceService\nTraceService(TraceContextFactory)", - "layer": "C1_SYMBOL_CATALOG", - "title": "TraceService", - "span_start": 39, - "span_end": 166, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "c2b2b976d99f2c600000b753731b26e0a69adcb4359398b93073590c5d5d04f4", - "qname": "TraceService", - "kind": "class", - "signature": "TraceService(TraceContextFactory)", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.tracing.service", - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/tracing.py", - "content": "const TraceService\nTraceService = app_runtime.tracing.service.TraceService", - "layer": "C1_SYMBOL_CATALOG", - "title": "TraceService", - "span_start": 1, - "span_end": 1, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "a4556fb3f83c50ea68b94a679786ce802cab7ffd9d7138aad3d6009b2661f425", - "qname": "TraceService", - "kind": "const", - "signature": "TraceService = app_runtime.tracing.service.TraceService", - "parent_symbol_id": null, - "package_or_module": "src.plba.tracing", - "is_test": false, - "blob_sha": "a27e11c716c93c3fcefe6f11b4cc420a6b743e7606606071d7f1aeeccc4e7d45", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "method TraceService.open_context\nopen_context(self)", - "layer": "C1_SYMBOL_CATALOG", - "title": "TraceService.open_context", - "span_start": 66, - "span_end": 78, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "2da3d5b20a947bf63e14c103be4689b72fd837e0a82abd6c497846375d4c7426", - "qname": "TraceService.open_context", - "kind": "method", - "signature": "open_context(self)", - "parent_symbol_id": "TraceService", - "package_or_module": "src.app_runtime.tracing.service", - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "method TraceService.create_context\ncreate_context(self)", - "layer": "C1_SYMBOL_CATALOG", - "title": "TraceService.create_context", - "span_start": 45, - "span_end": 63, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "ff44881104b65ef50ee6fe16d367d4a81b6e7eb5c44c0963cf4543faec785d4a", - "qname": "TraceService.create_context", - "kind": "method", - "signature": "create_context(self)", - "parent_symbol_id": "TraceService", - "package_or_module": "src.app_runtime.tracing.service", - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "method TraceService.current_trace_id\ncurrent_trace_id(self)", - "layer": "C1_SYMBOL_CATALOG", - "title": "TraceService.current_trace_id", - "span_start": 80, - "span_end": 81, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "41135180f7b3b9ab20e097e0747474e219c37dd2366ef08a7b43c1f3edb10b4c", - "qname": "TraceService.current_trace_id", - "kind": "method", - "signature": "current_trace_id(self)", - "parent_symbol_id": "TraceService", - "package_or_module": "src.app_runtime.tracing.service", - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "TraceService.__init__\n -> TraceService.store\n -> TraceService.create_context", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "TraceService.__init__:dataflow_slice", - "span_start": 42, - "span_end": 61, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "3b052062067a78aef3302ee1d996897e02a67d1b340397bea4f59fe147c0492a", - "edge_type": "dataflow_slice", - "src_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "src_qname": "TraceService.__init__", - "dst_symbol_id": "ff44881104b65ef50ee6fe16d367d4a81b6e7eb5c44c0963cf4543faec785d4a", - "dst_ref": "TraceService.create_context", - "resolution": "resolved", - "slice_id": "3b052062067a78aef3302ee1d996897e02a67d1b340397bea4f59fe147c0492a", - "root_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "path_symbols": [ - "TraceService.__init__", - "TraceService.store", - "TraceService.create_context" - ], - "path_symbol_ids": [ - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "ff44881104b65ef50ee6fe16d367d4a81b6e7eb5c44c0963cf4543faec785d4a" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "TraceService.__init__\n -> TraceService.store\n -> TraceService.close_context", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "TraceService.__init__:dataflow_slice", - "span_start": 42, - "span_end": 84, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "7a9353ef57c9ae5d19b3a0c6ac50fad05e6d21d31bbe1cd1cd07af6332ba6505", - "edge_type": "dataflow_slice", - "src_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "src_qname": "TraceService.__init__", - "dst_symbol_id": "01e14158dcced7e52d0c8ac84ac7b9a75225c261b6aca6a1d7da802d0994721c", - "dst_ref": "TraceService.close_context", - "resolution": "resolved", - "slice_id": "7a9353ef57c9ae5d19b3a0c6ac50fad05e6d21d31bbe1cd1cd07af6332ba6505", - "root_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "path_symbols": [ - "TraceService.__init__", - "TraceService.store", - "TraceService.close_context" - ], - "path_symbol_ids": [ - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "01e14158dcced7e52d0c8ac84ac7b9a75225c261b6aca6a1d7da802d0994721c" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "TraceService.__init__\n -> TraceService.store\n -> TraceService.open_context", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "TraceService.__init__:dataflow_slice", - "span_start": 42, - "span_end": 78, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "a6e13b9ebc4fed84586afd53ed92a4d14757e440873f572b2337d5622ee96031", - "edge_type": "dataflow_slice", - "src_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "src_qname": "TraceService.__init__", - "dst_symbol_id": "2da3d5b20a947bf63e14c103be4689b72fd837e0a82abd6c497846375d4c7426", - "dst_ref": "TraceService.open_context", - "resolution": "resolved", - "slice_id": "a6e13b9ebc4fed84586afd53ed92a4d14757e440873f572b2337d5622ee96031", - "root_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "path_symbols": [ - "TraceService.__init__", - "TraceService.store", - "TraceService.open_context" - ], - "path_symbol_ids": [ - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "2da3d5b20a947bf63e14c103be4689b72fd837e0a82abd6c497846375d4c7426" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "TraceService.__init__\n -> TraceService.transport\n -> TraceService.__init__", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "TraceService.__init__:dataflow_slice", - "span_start": 41, - "span_end": 43, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "1e923a93faa05c3c43ca9b19bd047007a8589ccce57d3cc1798ae7f9f200af98", - "edge_type": "dataflow_slice", - "src_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "src_qname": "TraceService.__init__", - "dst_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "dst_ref": "TraceService.__init__", - "resolution": "resolved", - "slice_id": "1e923a93faa05c3c43ca9b19bd047007a8589ccce57d3cc1798ae7f9f200af98", - "root_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "path_symbols": [ - "TraceService.__init__", - "TraceService.transport", - "TraceService.__init__" - ], - "path_symbol_ids": [ - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "TraceService.__init__\n -> TraceService.store\n -> TraceService.current_trace_id", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "TraceService.__init__:dataflow_slice", - "span_start": 42, - "span_end": 81, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "3ea17138634b1190bded77ddb84aa1595124f6519b246f24fc4b02bd62b5cac1", - "edge_type": "dataflow_slice", - "src_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "src_qname": "TraceService.__init__", - "dst_symbol_id": "41135180f7b3b9ab20e097e0747474e219c37dd2366ef08a7b43c1f3edb10b4c", - "dst_ref": "TraceService.current_trace_id", - "resolution": "resolved", - "slice_id": "3ea17138634b1190bded77ddb84aa1595124f6519b246f24fc4b02bd62b5cac1", - "root_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "path_symbols": [ - "TraceService.__init__", - "TraceService.store", - "TraceService.current_trace_id" - ], - "path_symbol_ids": [ - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "41135180f7b3b9ab20e097e0747474e219c37dd2366ef08a7b43c1f3edb10b4c" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "TraceService.__init__\n -> TraceService.store\n -> TraceService.step", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "TraceService.__init__:dataflow_slice", - "span_start": 42, - "span_end": 88, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "9f34c5da9b09fba99df6f6b1bde183a9aeb45111b8218a747c71590c2c9f60f2", - "edge_type": "dataflow_slice", - "src_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "src_qname": "TraceService.__init__", - "dst_symbol_id": "c44bfbc66cf747283f30088da3e011a10395031d41e77b74e523c24997f641ca", - "dst_ref": "TraceService.step", - "resolution": "resolved", - "slice_id": "9f34c5da9b09fba99df6f6b1bde183a9aeb45111b8218a747c71590c2c9f60f2", - "root_symbol_id": "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "path_symbols": [ - "TraceService.__init__", - "TraceService.store", - "TraceService.step" - ], - "path_symbol_ids": [ - "0e7c96d23b32da14ba3b30b3d0380c4832de8ed9986706d56d03e5111280ccfd", - "c44bfbc66cf747283f30088da3e011a10395031d41e77b74e523c24997f641ca" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/tracing.py", - "content": "from app_runtime.tracing.service import TraceService\nfrom app_runtime.tracing.transport import MySqlTraceTransport, NoOpTraceTransport\n\n__all__ = [\"MySqlTraceTransport\", \"NoOpTraceTransport\", \"TraceService\"]", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/plba/tracing.py:1-4", - "span_start": 1, - "span_end": 4, - "lexical_rank": 6, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.plba.tracing", - "is_test": false, - "blob_sha": "a27e11c716c93c3fcefe6f11b4cc420a6b743e7606606071d7f1aeeccc4e7d45", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_runtime.py", - "content": "def test_trace_service_allows_messages_without_status() -> None:\n from app_runtime.tracing.service import TraceService\n\n transport = RecordingTransport()\n manager = TraceService(transport=transport)\n\n with manager.open_context(alias=\"worker\", kind=\"worker\"):\n manager.step(\"optional-status\")\n manager.debug(\"debug without status\")\n manager.info(\"info without status\")\n manager.warning(\"warning without status\")\n manager.error(\"error without status\")\n\n assert [message.status for message in transport.messages] == [\"\", \"\", \"\", \"\"]\n assert all(message.trace_id == transport.contexts[0].trace_id for message in transport.messages)", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_runtime.py:test_trace_service_allows_messages_without_status", - "span_start": 279, - "span_end": 293, - "lexical_rank": 6, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 11, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_runtime", - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/__init__.py", - "content": "from app_runtime.contracts.trace import TraceContext, TraceContextRecord, TraceLogMessage, TraceTransport\nfrom app_runtime.tracing.service import TraceManager, TraceService\nfrom app_runtime.tracing.store import ActiveTraceContext, TraceContextStore\nfrom app_runtime.tracing.transport import MySqlTraceTransport, NoOpTraceTransport\n\n__all__ = [\n \"ActiveTraceContext\",\n \"MySqlTraceTransport\",\n \"NoOpTraceTransport\",\n \"TraceContext\",\n \"TraceContextRecord\",\n \"TraceContextStore\",\n \"TraceLogMessage\",\n \"TraceManager\",\n \"TraceService\",\n \"TraceTransport\",\n]", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/tracing/__init__.py:1-17", - "span_start": 1, - "span_end": 17, - "lexical_rank": 6, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.app_runtime.tracing.__init__", - "is_test": false, - "blob_sha": "a01dea5f773515aeaae8e6d3431fcb93531a8b577dfa26c2e5db16cd6ae6e4d9", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/__init__.py", - "content": "from plba.bootstrap import create_runtime\nfrom plba.config import ConfigFileLoader, FileConfigProvider\nfrom plba.control import ControlActionSet, ControlChannel, ControlPlaneService, HttpControlChannel\nfrom plba.contracts import (\n ApplicationModule,\n ConfigProvider,\n HealthContributor,\n TraceContext,\n TraceContextRecord,\n TraceLogMessage,\n TraceTransport,\n Worker,\n WorkerHealth,\n WorkerStatus,\n)\nfrom plba.core import ConfigurationManager, RuntimeManager, ServiceContainer\nfrom plba.health import HealthRegistry\nfrom plba.logging import LogManager\nfrom plba.queue import InMemoryTaskQueue\nfrom plba.tracing import MySqlTraceTransport, NoOpTraceTransport, TraceService\nfrom plba.workflow import (\n StepResult,\n WorkflowContext,\n WorkflowDefinition,\n WorkflowEngine,\n WorkflowEngineHooks,\n WorkflowNode,\n WorkflowRuntimeFactory,\n WorkflowStep,\n)\nfrom plba.workers import WorkerSupervisor\n\n__all__ = [\n \"ApplicationModule\",\n \"ConfigFileLoader\",\n \"ConfigProvider\",\n \"ConfigurationManager\",\n \"ControlActionSet\",\n \"ControlChannel\",\n \"ControlPlaneService\",\n \"create_runtime\",\n \"FileConfigProvider\",\n \"HealthContributor\",\n \"HealthRegistry\",\n \"HttpControlChannel\",\n \"InMemoryTaskQueue\",\n \"LogManager\",\n \"MySqlTraceTransport\",\n \"NoOpTraceTransport\",\n \"RuntimeManager\",\n \"ServiceContainer\",\n \"TraceContext\",\n \"TraceContextRecord\",\n \"TraceLogMessage\",\n \"TraceService\",\n \"TraceTransport\",\n \"StepResult\",\n \"Worker\",\n \"WorkerHealth\",\n \"WorkerStatus\",\n \"WorkflowContext\",\n \"WorkflowDefinition\",\n \"WorkflowEngine\",\n \"WorkflowEngineHooks\",\n \"WorkflowNode\",\n \"WorkflowRuntimeFactory\",\n \"WorkflowStep\",\n \"WorkerSupervisor\",\n]", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/plba/__init__.py:1-69", - "span_start": 1, - "span_end": 69, - "lexical_rank": 6, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.plba.__init__", - "is_test": false, - "blob_sha": "24e755ec8c249d14fb0e675b5dbf2b71ab91afb9c849897eebfa9feb2499e19d", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_runtime.py", - "content": "def test_trace_service_writes_contexts_and_messages() -> None:\n from app_runtime.tracing.service import TraceService\n\n transport = RecordingTransport()\n manager = TraceService(transport=transport)\n\n with manager.open_context(alias=\"worker\", kind=\"worker\", attrs={\"routine\": \"incoming\"}):\n manager.step(\"parse\")\n manager.info(\"started\", status=\"ok\", attrs={\"attempt\": 1})\n\n assert len(transport.contexts) == 1\n assert len(transport.messages) == 1\n assert transport.contexts[0].alias == \"worker\"\n assert transport.messages[0].step == \"parse\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_runtime.py:test_trace_service_writes_contexts_and_messages", - "span_start": 246, - "span_end": 259, - "lexical_rank": 6, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 9, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_runtime", - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "tests/test_runtime.py", - "content": "def test_trace_service_supports_debug_warning_and_error_levels() -> None:\n from app_runtime.tracing.service import TraceService\n\n transport = RecordingTransport()\n manager = TraceService(transport=transport)\n\n with manager.open_context(alias=\"worker\", kind=\"worker\", attrs={\"routine\": \"incoming\"}):\n manager.step(\"validate\")\n manager.debug(\"validation details\", attrs={\"rule\": \"basic\"})\n manager.warning(\"validation warning\", status=\"degraded\", attrs={\"attempt\": 1})\n manager.error(\"integration failed\", status=\"failed\", attrs={\"integration\": \"crm\"})\n manager.exception(\"caught exception\", attrs={\"exception_type\": \"RuntimeError\"})\n\n levels = [message.level for message in transport.messages]\n assert levels == [\"DEBUG\", \"WARNING\", \"ERROR\", \"ERROR\"]", - "layer": "C0_SOURCE_CHUNKS", - "title": "tests/test_runtime.py:test_trace_service_supports_debug_warning_and_error_levels", - "span_start": 262, - "span_end": 276, - "lexical_rank": 6, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 10, - "chunk_type": "symbol_block", - "module_or_unit": "tests.test_runtime", - "is_test": true, - "blob_sha": "336335976a7892e997ef1549c1e59db9d44b8eb61c914ef98e2869941306407b", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "class TraceManager(TraceService):\n \"\"\"Compatibility alias during the transition from ConfigManager-shaped naming.\"\"\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/tracing/service.py:TraceManager", - "span_start": 169, - "span_end": 170, - "lexical_rank": 6, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 2, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.tracing.service", - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "class RuntimeManager:\n ACTION_TIMEOUT_SECONDS = 10.0\n ACTION_POLL_INTERVAL_SECONDS = 0.05\n\n def __init__(\n self,\n configuration: ConfigurationManager | None = None,\n services: ServiceContainer | None = None,\n traces: TraceService | None = None,\n health: HealthRegistry | None = None,\n logs: LogManager | None = None,\n workers: WorkerSupervisor | None = None,\n control_plane: ControlPlaneService | None = None,\n ) -> None:\n self.configuration = configuration or ConfigurationManager()\n self.services = services or ServiceContainer()\n self.traces = traces or TraceService()\n self.health = health or HealthRegistry()\n self.logs = logs or LogManager()\n self.workers = workers or WorkerSupervisor()\n self.control_plane = control_plane or ControlPlaneService()\n self.registry = ModuleRegistry(self.services)\n self._started = False\n self._state = LifecycleState.IDLE\n self._core_registered = False\n self._workers_registered = False\n self._register_core_services()\n\n def register_module(self, module: ApplicationModule) -> None:\n self.registry.register_module(module.name)\n module.register(self.registry)\n\n def add_config_file(self, path: str) -> FileConfigProvider:\n provider = FileConfigProvider(path)\n self.configuration.add_provider(provider)\n return provider\n\n def start(self, *, start_control_plane: bool = True) -> None:\n if self._started:\n return\n self._state = LifecycleState.STARTING\n config = self.configuration.load()\n self.logs.apply_config(config)\n self._register_health_contributors()\n self._register_workers()\n self.workers.start()\n if start_control_plane:\n self.control_plane.start(self)\n self._started = True\n self._refresh_state()\n\n def stop(self, timeout: float = 30.0, force: bool = False, stop_control_plane: bool = True) -> None:\n if not self._started:\n return\n self._state = LifecycleState.STOPPING\n self.workers.stop(timeout=timeout, force=force)\n if stop_control_plane:\n self.control_plane.stop()\n self._started = False\n self._state = LifecycleState.STOPPED\n\n def status(self) -> dict[str, object]:\n self._refresh_state()\n return self.control_plane.snapshot(self)\n\n def current_health(self) -> HealthPayload:\n self._refresh_state()\n return self.health.payload(self._state, self.workers.healths())\n\n async def health_status(self) -> HealthPayload:\n return self.current_health()\n\n async def start_runtime(self) -> dict[str, object] | str:\n self._refresh_state()\n if self._started:\n return \"runtime already running\"\n if self._state == LifecycleState.STOPPING:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n\n self.start(start_control_plane=False)\n started = self._wait_for_state({LifecycleState.IDLE, LifecycleState.BUSY}, timeout=self.ACTION_TIMEOUT_SECONDS)\n if started:\n return self._action_detail(\"runtime started\", timed_out=False)\n return self._action_detail(\"runtime start is still in progress\", timed_out=True)\n\n async def stop_runtime(self) -> dict[str, object] | str:\n self._refresh_state()\n if not self._started:\n if self._state == LifecycleState.STOPPING:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n return \"runtime already stopped\"\n\n self._state = LifecycleState.STOPPING\n try:\n self.workers.stop(timeout=self.ACTION_TIMEOUT_SECONDS, force=False)\n except TimeoutError:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n\n self._started = False\n self._state = LifecycleState.STOPPED\n return self._action_detail(\"runtime stopped\", timed_out=False)\n\n async def runtime_status(self) -> str:\n self._refresh_state()\n return self._state.value\n\n def _register_core_services(self) -> None:\n if self._core_registered:\n return\n self.services.register(\"configuration\", self.configuration)\n self.services.register(\"traces\", self.traces)\n self.services.register(\"health\", self.health)\n self.services.register(\"logs\", self.logs)\n self.services.register(\"workers\", self.workers)\n self.services.register(\"control_plane\", self.control_plane)\n self._core_registered = True\n\n def _register_health_contributors(self) -> None:\n for contributor in self.registry.health_contributors:\n self.health.register(contributor)\n\n def _register_workers(self) -> None:\n if self._workers_registered:\n return\n for worker in self.registry.workers:\n self.workers.register(worker)\n self._workers_registered = True\n\n def _refresh_state(self) -> None:\n lifecycle = self.workers.lifecycle_state()\n\n if self._state == LifecycleState.STOPPING:\n if lifecycle == LifecycleState.STOPPED:\n self._started = False\n self._state = LifecycleState.STOPPED\n return\n\n if not self._started:\n if lifecycle == LifecycleState.STOPPED:\n self._state = LifecycleState.STOPPED\n return\n\n self._state = lifecycle\n\n def _wait_for_state(self, target_states: set[LifecycleState], *, timeout: float) -> bool:\n deadline = monotonic() + timeout\n while monotonic() < deadline:\n self._refresh_state()\n if self._state in target_states:\n return True\n sleep(self.ACTION_POLL_INTERVAL_SECONDS)\n self._refresh_state()\n return self._state in target_states\n\n def _action_detail(self, message: str, *, timed_out: bool) -> dict[str, object]:\n self._refresh_state()\n return {\n \"message\": message,\n \"state\": self._state.value,\n \"timed_out\": timed_out,\n \"workers\": self.workers.snapshot(),\n }", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/core/runtime.py:RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 6, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.core.runtime", - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/tracing/service.py", - "content": "class TraceService(TraceContextFactory):\n def __init__(self, transport: TraceTransport | None = None, store: TraceContextStore | None = None) -> None:\n self.transport = transport or NoOpTraceTransport()\n self.store = store or TraceContextStore()\n self._writer = TraceRecordWriter(self.transport)\n\n def create_context(\n self,\n *,\n alias: str,\n parent_id: str | None = None,\n kind: str | None = None,\n attrs: dict[str, Any] | None = None,\n ) -> str:\n record = TraceContextRecord(\n trace_id=uuid4().hex,\n alias=str(alias or \"\"),\n parent_id=parent_id,\n type=kind,\n event_time=utc_now(),\n attrs=dict(attrs or {}),\n )\n self.store.push(record)\n self._writer.write_context(record)\n return record.trace_id\n\n @contextmanager\n def open_context(\n self,\n *,\n alias: str,\n parent_id: str | None = None,\n kind: str | None = None,\n attrs: dict[str, Any] | None = None,\n ) -> Iterator[str]:\n trace_id = self.create_context(alias=alias, parent_id=parent_id, kind=kind, attrs=attrs)\n try:\n yield trace_id\n finally:\n self.store.pop()\n\n def current_trace_id(self) -> str | None:\n return self.store.current_trace_id()\n\n def close_context(self) -> str | None:\n previous = self.store.pop()\n return previous.record.trace_id if previous else None\n\n def step(self, name: str) -> None:\n self.store.set_step(str(name or \"\"))\n\n def info(self, message: str, *, status: str | None = None, attrs: dict[str, Any] | None = None) -> None:\n self._write_message(\"INFO\", message, status, attrs)\n\n def debug(self, message: str, *, status: str | None = None, attrs: dict[str, Any] | None = None) -> None:\n self._write_message(\"DEBUG\", message, status, attrs)\n\n def warning(self, message: str, *, status: str | None = None, attrs: dict[str, Any] | None = None) -> None:\n self._write_message(\"WARNING\", message, status, attrs)\n\n def error(self, message: str, *, status: str | None = None, attrs: dict[str, Any] | None = None) -> None:\n self._write_message(\"ERROR\", message, status, attrs)\n\n def exception(self, message: str, *, status: str = \"failed\", attrs: dict[str, Any] | None = None) -> None:\n self._write_message(\"ERROR\", message, status, attrs)\n\n def new_root(self, operation: str) -> TraceContext:\n trace_id = self.create_context(alias=operation, kind=\"operation\", attrs={\"operation\": operation})\n return TraceContext(trace_id=trace_id, span_id=trace_id, attributes={\"operation\": operation})\n\n def child_of(self, parent: TraceContext, operation: str) -> TraceContext:\n trace_id = self.create_context(\n alias=operation,\n parent_id=parent.trace_id,\n kind=\"worker\",\n attrs={\"operation\": operation},\n )\n return TraceContext(\n trace_id=trace_id,\n span_id=trace_id,\n parent_span_id=parent.span_id,\n attributes={\"operation\": operation},\n )\n\n def attach(self, metadata: dict[str, object], context: TraceContext) -> dict[str, object]:\n updated = dict(metadata)\n updated[\"trace_id\"] = context.trace_id\n updated[\"span_id\"] = context.span_id\n updated[\"parent_span_id\"] = context.parent_span_id\n return updated\n\n def resume(self, metadata: dict[str, object], operation: str) -> TraceContext:\n trace_id = str(metadata.get(\"trace_id\") or uuid4().hex)\n span_id = str(metadata.get(\"span_id\") or trace_id)\n parent_id = metadata.get(\"parent_span_id\")\n self.create_context(\n alias=operation,\n parent_id=str(parent_id) if parent_id else None,\n kind=\"worker\",\n attrs=dict(metadata),\n )\n return TraceContext(\n trace_id=trace_id,\n span_id=span_id,\n parent_span_id=str(parent_id) if parent_id else None,\n attributes={\"operation\": operation},\n )\n\n def _write_message(\n self,\n level: TraceLevel,\n message: str,\n status: str | None,\n attrs: dict[str, Any] | None,\n ) -> None:\n active = self.store.current()\n if active is None:\n raise RuntimeError(\"Trace context is not bound. Call create_context() first.\")\n record = TraceLogMessage(\n trace_id=active.record.trace_id,\n step=active.step,\n status=str(status or \"\"),\n message=str(message or \"\"),\n level=level,\n event_time=utc_now(),\n attrs=dict(attrs or {}),\n )\n self._writer.write_message(record)", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/tracing/service.py:TraceService", - "span_start": 39, - "span_end": 166, - "lexical_rank": 6, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 1, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.tracing.service", - "is_test": false, - "blob_sha": "87b875567583967acfa38996526d6e7592bffeb778de094fa4855aff8f8436d7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/contracts/__init__.py", - "content": "__all__: list[str] = []", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/__init__.py:1-1", - "span_start": 1, - "span_end": 1, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.app_runtime.__init__", - "is_test": false, - "blob_sha": "8eea9df4f6d7b38ca0e39ccc27b04700e3d08dbeec8046d613d22706d19985fa", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "validation": { - "passed": true, - "action": "return", - "reasons": [] - }, - "steps": [ - { - "step": "router", - "status": "completed", - "timings_ms": { - "router": 1 - }, - "output": { - "intent": "CODE_QA", - "sub_intent": "FIND_TESTS", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - } - }, - { - "step": "retrieval", - "status": "completed", - "timings_ms": { - "retrieval": 90 - }, - "output": { - "rag_count": 24, - "answer_path_rag_count": 24, - "resolved_symbol_status": "resolved", - "resolved_symbol": "TraceService", - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ] - }, - "diagnostics": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "vector", - "C2_DEPENDENCY_GRAPH": "vector", - "C0_SOURCE_CHUNKS": "vector" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C0_SOURCE_CHUNKS": 10 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [] - } - }, - "fallback": { - "used": false, - "reason": null - }, - "retrieval_by_layer_ms": { - "C1_SYMBOL_CATALOG": 34, - "C2_DEPENDENCY_GRAPH": 38, - "C0_SOURCE_CHUNKS": 16 - } - } - }, - { - "step": "pre_evidence_gate", - "status": "passed", - "timings_ms": { - "pre_evidence_gate": 1 - }, - "input": { - "resolved_target": "TraceService", - "sub_intent": "FIND_TESTS", - "target_type": "symbol", - "evidence_count": 24, - "code_chunk_count": 24, - "entrypoint_count": 0, - "relation_count": 6, - "test_evidence_count": 3, - "symbol_resolution_status": "resolved", - "path_scope": [] - }, - "output": { - "passed": true, - "failure_reasons": [], - "degraded_message": "", - "evidence_count": 24 - } - }, - { - "step": "llm", - "status": "completed", - "timings_ms": { - "llm": 2378 - }, - "output": { - "prompt_name": "code_qa_find_tests_answer", - "answer_preview": "Прямые тесты для TraceService находятся в файле `tests/test_runtime.py`:\n\n- `test_trace_service_allows_messages_without_status`: проверяет возможность отправки сообщений без статуса.\n- `test_trace_service_writes_contexts_and_messages`: проверяет запись контекстов и сообщений.\n- `test_trace_service_s", - "resolved_target": "TraceService", - "answer_policy_branch": "normal_answer", - "decision_reason": "evidence_sufficient" - } - }, - { - "step": "post_evidence_gate", - "status": "passed", - "timings_ms": { - "post_evidence_gate": 1, - "post_evidence_gate_recheck": 0, - "repair": 0 - }, - "input": { - "answer_mode": "normal", - "degraded_message": "", - "resolved_target": "TraceService", - "draft_answer_preview": "Прямые тесты для TraceService находятся в файле `tests/test_runtime.py`:\n\n- `test_trace_service_allows_messages_without_status`: проверяет возможность отправки сообщений без статуса.\n- `test_trace_service_writes_contexts_and_messages`: проверяет запись контекстов и сообщений.\n- `test_trace_service_s", - "repair_candidate": true - }, - "output": { - "passed": true, - "action": "return", - "reasons": [], - "repair_used": false, - "final_answer_preview": "Прямые тесты для TraceService находятся в файле `tests/test_runtime.py`:\n\n- `test_trace_service_allows_messages_without_status`: проверяет возможность отправки сообщений без статуса.\n- `test_trace_service_writes_contexts_and_messages`: проверяет запись контекстов и сообщений.\n- `test_trace_service_s" - } - } - ] - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/plba_full_chain_subintents_v3/20260312_192715/full_chain_plba_code_subintents_v2_plba-v2-find-tests-trace-service.md b/tests/pipeline_setup_v3/test_results/plba_full_chain_subintents_v3/20260312_192715/full_chain_plba_code_subintents_v2_plba-v2-find-tests-trace-service.md deleted file mode 100644 index efd65ba..0000000 --- a/tests/pipeline_setup_v3/test_results/plba_full_chain_subintents_v3/20260312_192715/full_chain_plba_code_subintents_v2_plba-v2-find-tests-trace-service.md +++ /dev/null @@ -1,269 +0,0 @@ -# plba-v2-find-tests-trace-service - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_02_pipeline/full_chain_plba_code_subintents_v2.yaml -- runner: agent_runtime -- mode: full_chain -- passed: True - -## Query -Где тесты для TraceService? - -## Actual -{ - "intent": "CODE_QA", - "sub_intent": "FIND_TESTS", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 24, - "llm_answer": "Прямые тесты для TraceService находятся в файле `tests/test_runtime.py`:\n\n- `test_trace_service_allows_messages_without_status`: проверяет возможность отправки сообщений без статуса.\n- `test_trace_service_writes_contexts_and_messages`: проверяет запись контекстов и сообщений.\n- `test_trace_service_supports_debug_warning_and_error_levels`: проверяет поддержку уровней debug, warning и error.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "TraceService" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ] -} - -## Steps -[ - { - "step": "router", - "status": "completed", - "timings_ms": { - "router": 1 - }, - "output": { - "intent": "CODE_QA", - "sub_intent": "FIND_TESTS", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - } - }, - { - "step": "retrieval", - "status": "completed", - "timings_ms": { - "retrieval": 90 - }, - "output": { - "rag_count": 24, - "answer_path_rag_count": 24, - "resolved_symbol_status": "resolved", - "resolved_symbol": "TraceService", - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ] - }, - "diagnostics": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "vector", - "C2_DEPENDENCY_GRAPH": "vector", - "C0_SOURCE_CHUNKS": "vector" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C0_SOURCE_CHUNKS": 10 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [] - } - }, - "fallback": { - "used": false, - "reason": null - }, - "retrieval_by_layer_ms": { - "C1_SYMBOL_CATALOG": 34, - "C2_DEPENDENCY_GRAPH": 38, - "C0_SOURCE_CHUNKS": 16 - } - } - }, - { - "step": "pre_evidence_gate", - "status": "passed", - "timings_ms": { - "pre_evidence_gate": 1 - }, - "input": { - "resolved_target": "TraceService", - "sub_intent": "FIND_TESTS", - "target_type": "symbol", - "evidence_count": 24, - "code_chunk_count": 24, - "entrypoint_count": 0, - "relation_count": 6, - "test_evidence_count": 3, - "symbol_resolution_status": "resolved", - "path_scope": [] - }, - "output": { - "passed": true, - "failure_reasons": [], - "degraded_message": "", - "evidence_count": 24 - } - }, - { - "step": "llm", - "status": "completed", - "timings_ms": { - "llm": 2378 - }, - "output": { - "prompt_name": "code_qa_find_tests_answer", - "answer_preview": "Прямые тесты для TraceService находятся в файле `tests/test_runtime.py`:\n\n- `test_trace_service_allows_messages_without_status`: проверяет возможность отправки сообщений без статуса.\n- `test_trace_service_writes_contexts_and_messages`: проверяет запись контекстов и сообщений.\n- `test_trace_service_s", - "resolved_target": "TraceService", - "answer_policy_branch": "normal_answer", - "decision_reason": "evidence_sufficient" - } - }, - { - "step": "post_evidence_gate", - "status": "passed", - "timings_ms": { - "post_evidence_gate": 1, - "post_evidence_gate_recheck": 0, - "repair": 0 - }, - "input": { - "answer_mode": "normal", - "degraded_message": "", - "resolved_target": "TraceService", - "draft_answer_preview": "Прямые тесты для TraceService находятся в файле `tests/test_runtime.py`:\n\n- `test_trace_service_allows_messages_without_status`: проверяет возможность отправки сообщений без статуса.\n- `test_trace_service_writes_contexts_and_messages`: проверяет запись контекстов и сообщений.\n- `test_trace_service_s", - "repair_candidate": true - }, - "output": { - "passed": true, - "action": "return", - "reasons": [], - "repair_used": false, - "final_answer_preview": "Прямые тесты для TraceService находятся в файле `tests/test_runtime.py`:\n\n- `test_trace_service_allows_messages_without_status`: проверяет возможность отправки сообщений без статуса.\n- `test_trace_service_writes_contexts_and_messages`: проверяет запись контекстов и сообщений.\n- `test_trace_service_s" - } - } -] - -## Diagnostics -{ - "intent_correct": null, - "target_found": true, - "layers_used": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ], - "retrieval_sufficient": true, - "answer_mode": "normal", - "resolved_target": "TraceService", - "answer_policy_branch": "normal_answer", - "decision_reason": "evidence_sufficient", - "router_result": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "retrieval_profile": "code", - "sub_intent": "FIND_TESTS", - "path_scope": [], - "layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ], - "symbol_resolution_status": "resolved" - }, - "retrieval_request": { - "rag_session_id": "7d11da21-faa0-4cea-aede-aeabe069164c", - "query": "Где тесты для TraceService?", - "sub_intent": "FIND_TESTS", - "path_scope": [], - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ] - }, - "per_layer_outcome": [ - { - "layer_id": "C1_SYMBOL_CATALOG", - "hit_count": 8, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C2_DEPENDENCY_GRAPH", - "hit_count": 6, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C0_SOURCE_CHUNKS", - "hit_count": 10, - "empty": false, - "fallback_used": false - } - ], - "empty_layers": [], - "evidence_gate_decision": { - "sufficient": true, - "failure_reasons": [], - "evidence_count": 24 - }, - "evidence_gate_input": { - "resolved_target": "TraceService", - "sub_intent": "FIND_TESTS", - "target_type": "symbol", - "evidence_count": 24, - "code_chunk_count": 24, - "entrypoint_count": 0, - "relation_count": 6, - "test_evidence_count": 3, - "symbol_resolution_status": "resolved", - "path_scope": [] - }, - "post_evidence_gate": { - "input": { - "answer_mode": "normal", - "degraded_message": "", - "resolved_target": "TraceService", - "draft_answer_preview": "Прямые тесты для TraceService находятся в файле `tests/test_runtime.py`:\n\n- `test_trace_service_allows_messages_without_status`: проверяет возможность отправки сообщений без статуса.\n- `test_trace_service_writes_contexts_and_messages`: проверяет запись контекстов и сообщений.\n- `test_trace_service_s", - "repair_candidate": true - }, - "output": { - "passed": true, - "action": "return", - "reasons": [], - "repair_used": false, - "final_answer_preview": "Прямые тесты для TraceService находятся в файле `tests/test_runtime.py`:\n\n- `test_trace_service_allows_messages_without_status`: проверяет возможность отправки сообщений без статуса.\n- `test_trace_service_writes_contexts_and_messages`: проверяет запись контекстов и сообщений.\n- `test_trace_service_s" - } - }, - "failure_reasons": [], - "timings_ms": { - "router": 1, - "retrieval": 90, - "pre_evidence_gate": 1, - "llm": 2378, - "post_evidence_gate": 1 - } -} - -## Mismatches -- none \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/plba_full_chain_subintents_v3/20260312_192715/full_chain_plba_code_subintents_v2_plba-v2-find-tests-workflow-runtime-factory-negative.json b/tests/pipeline_setup_v3/test_results/plba_full_chain_subintents_v3/20260312_192715/full_chain_plba_code_subintents_v2_plba-v2-find-tests-workflow-runtime-factory-negative.json deleted file mode 100644 index 6ad444f..0000000 --- a/tests/pipeline_setup_v3/test_results/plba_full_chain_subintents_v3/20260312_192715/full_chain_plba_code_subintents_v2_plba-v2-find-tests-workflow-runtime-factory-negative.json +++ /dev/null @@ -1,3191 +0,0 @@ -{ - "case_id": "plba-v2-find-tests-workflow-runtime-factory-negative", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_02_pipeline/full_chain_plba_code_subintents_v2.yaml", - "runner": "agent_runtime", - "mode": "full_chain", - "query": "Где тесты для WorkflowRuntimeFactory?", - "actual": { - "intent": "CODE_QA", - "sub_intent": "FIND_TESTS", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 24, - "llm_answer": "Insufficient evidence for a confident answer. No test candidates found.", - "answer_mode": "degraded", - "path_scope": [], - "symbol_candidates": [ - "WorkflowRuntimeFactory" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ] - }, - "passed": true, - "mismatches": [], - "details": { - "query": "Где тесты для WorkflowRuntimeFactory?", - "router_result": { - "schema_version": "1.1", - "intent": "CODE_QA", - "retrieval_profile": "code", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query_plan": { - "raw": "Где тесты для WorkflowRuntimeFactory?", - "normalized": "Где тесты для WorkflowRuntimeFactory?", - "sub_intent": "FIND_TESTS", - "negations": [], - "expansions": [ - "test", - "unit test", - "WorkflowRuntimeFactory" - ], - "keyword_hints": [ - "WorkflowRuntimeFactory" - ], - "path_hints": [], - "doc_scope_hints": [], - "symbol_candidates": [ - "WorkflowRuntimeFactory" - ], - "symbol_kind_hint": "class", - "anchors": [ - { - "type": "SYMBOL", - "value": "WorkflowRuntimeFactory", - "source": "user_text", - "subtype": null, - "span": { - "start": 14, - "end": 36 - }, - "confidence": 0.88 - }, - { - "type": "KEY_TERM", - "value": "тест", - "source": "user_text", - "subtype": null, - "span": { - "start": 4, - "end": 9 - }, - "confidence": 0.9 - } - ] - }, - "retrieval_spec": { - "domains": [ - "CODE" - ], - "layer_queries": [ - { - "layer_id": "C1_SYMBOL_CATALOG", - "top_k": 8 - }, - { - "layer_id": "C2_DEPENDENCY_GRAPH", - "top_k": 6 - }, - { - "layer_id": "C0_SOURCE_CHUNKS", - "top_k": 10 - } - ], - "filters": { - "test_policy": "INCLUDE", - "path_scope": [], - "language": [ - "python" - ] - }, - "rerank_profile": "code" - }, - "retrieval_constraints": { - "include_globs": [ - "src/**", - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "test_file_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "test_symbol_patterns": [ - "test_workflow_runtime_factory", - "TestWorkflowRuntimeFactory", - "WorkflowRuntimeFactory" - ], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - }, - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "WorkflowRuntimeFactory", - "alternatives": [ - "WorkflowRuntimeFactory", - "WorkflowRuntimeFactory", - "WorkflowRuntimeFactory", - "WorkflowRuntimeFactory.__init__", - "WorkflowRuntimeFactory.create_engine" - ], - "confidence": 0.99 - }, - "evidence_policy": { - "require_def": true, - "require_flow": true, - "require_spec": false, - "allow_answer_without_evidence": false - } - }, - "retrieval_request": { - "rag_session_id": "7d11da21-faa0-4cea-aede-aeabe069164c", - "query": "Где тесты для WorkflowRuntimeFactory?", - "sub_intent": "FIND_TESTS", - "path_scope": [], - "keyword_hints": [ - "WorkflowRuntimeFactory" - ], - "symbol_candidates": [ - "WorkflowRuntimeFactory" - ], - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ], - "retrieval_spec": { - "domains": [ - "CODE" - ], - "layer_queries": [ - { - "layer_id": "C1_SYMBOL_CATALOG", - "top_k": 8 - }, - { - "layer_id": "C2_DEPENDENCY_GRAPH", - "top_k": 6 - }, - { - "layer_id": "C0_SOURCE_CHUNKS", - "top_k": 10 - } - ], - "filters": { - "test_policy": "INCLUDE", - "path_scope": [], - "language": [ - "python" - ] - }, - "rerank_profile": "code" - }, - "retrieval_constraints": { - "include_globs": [ - "src/**", - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "exclude_globs": [], - "prefer_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "test_file_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py", - "**/conftest.py" - ], - "test_symbol_patterns": [ - "test_workflow_runtime_factory", - "TestWorkflowRuntimeFactory", - "WorkflowRuntimeFactory" - ], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - }, - "query_plan": { - "raw": "Где тесты для WorkflowRuntimeFactory?", - "normalized": "Где тесты для WorkflowRuntimeFactory?", - "sub_intent": "FIND_TESTS", - "negations": [], - "expansions": [ - "test", - "unit test", - "WorkflowRuntimeFactory" - ], - "keyword_hints": [ - "WorkflowRuntimeFactory" - ], - "path_hints": [], - "doc_scope_hints": [], - "symbol_candidates": [ - "WorkflowRuntimeFactory" - ], - "symbol_kind_hint": "class", - "anchors": [ - { - "type": "SYMBOL", - "value": "WorkflowRuntimeFactory", - "source": "user_text", - "subtype": null, - "span": { - "start": 14, - "end": 36 - }, - "confidence": 0.88 - }, - { - "type": "KEY_TERM", - "value": "тест", - "source": "user_text", - "subtype": null, - "span": { - "start": 4, - "end": 9 - }, - "confidence": 0.9 - } - ] - } - }, - "retrieval_result": { - "target_symbol_candidates": [ - "WorkflowRuntimeFactory", - "WorkflowRuntimeFactory.__init__", - "WorkflowRuntimeFactory.create_engine", - "WorkflowPersistence", - "annotations", - "WorkflowEngine" - ], - "resolved_symbol": "WorkflowRuntimeFactory", - "symbol_resolution_status": "resolved", - "file_candidates": [ - "src/plba/__init__.py", - "src/app_runtime/workflow/runtime_factory.py", - "src/plba/workflow.py", - "src/app_runtime/config/__init__.py", - "src/app_runtime/config/providers.py", - "src/app_runtime/contracts/__init__.py", - "src/app_runtime/config/file_loader.py", - "src/app_runtime/contracts/config.py", - "src/app_runtime/contracts/health.py", - "src/app_runtime/contracts/application.py" - ], - "code_chunks": [ - { - "layer": "C1_SYMBOL_CATALOG", - "path": "src/plba/__init__.py", - "title": "WorkflowRuntimeFactory", - "content": "const WorkflowRuntimeFactory\nWorkflowRuntimeFactory = plba.workflow.WorkflowRuntimeFactory", - "start_line": 21, - "end_line": 30, - "metadata": { - "symbol_id": "cb7c73db05c2622aac89114bed1cddd1d567de21cfac5c53037c62b1074b25c9", - "qname": "WorkflowRuntimeFactory", - "kind": "const", - "signature": "WorkflowRuntimeFactory = plba.workflow.WorkflowRuntimeFactory", - "parent_symbol_id": null, - "package_or_module": "src.plba.__init__", - "is_test": false, - "blob_sha": "24e755ec8c249d14fb0e675b5dbf2b71ab91afb9c849897eebfa9feb2499e19d", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C1_SYMBOL_CATALOG", - "path": "src/app_runtime/workflow/runtime_factory.py", - "title": "WorkflowRuntimeFactory", - "content": "class WorkflowRuntimeFactory\nWorkflowRuntimeFactory", - "start_line": 7, - "end_line": 19, - "metadata": { - "symbol_id": "9da827270329de64ebb426fadaaa5e35145e6666b92c6da186e08bf4b071f458", - "qname": "WorkflowRuntimeFactory", - "kind": "class", - "signature": "WorkflowRuntimeFactory", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.workflow.runtime_factory", - "is_test": false, - "blob_sha": "4d03c095f3082eb3ea8d558d65a785eb747fffd9c1383946e6c433bcedb7259a", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C1_SYMBOL_CATALOG", - "path": "src/plba/workflow.py", - "title": "WorkflowRuntimeFactory", - "content": "const WorkflowRuntimeFactory\nWorkflowRuntimeFactory = app_runtime.workflow.runtime_factory.WorkflowRuntimeFactory", - "start_line": 7, - "end_line": 7, - "metadata": { - "symbol_id": "80865947d1ca709971efe9d68a9ee1f348c1c43d351bf4e1b4a5884d72985b6b", - "qname": "WorkflowRuntimeFactory", - "kind": "const", - "signature": "WorkflowRuntimeFactory = app_runtime.workflow.runtime_factory.WorkflowRuntimeFactory", - "parent_symbol_id": null, - "package_or_module": "src.plba.workflow", - "is_test": false, - "blob_sha": "f227797606042273d1f1798f76846952892eeb9e4e9e6a38fb8a631d7231ff39", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C1_SYMBOL_CATALOG", - "path": "src/app_runtime/workflow/runtime_factory.py", - "title": "WorkflowRuntimeFactory.__init__", - "content": "method WorkflowRuntimeFactory.__init__\n__init__(self, connection_factory)", - "start_line": 8, - "end_line": 12, - "metadata": { - "symbol_id": "d82a367758b2f7bcce3d351e576f25768b0afe8b915d01ace1c7d6380f14f52f", - "qname": "WorkflowRuntimeFactory.__init__", - "kind": "method", - "signature": "__init__(self, connection_factory)", - "parent_symbol_id": "WorkflowRuntimeFactory", - "package_or_module": "src.app_runtime.workflow.runtime_factory", - "is_test": false, - "blob_sha": "4d03c095f3082eb3ea8d558d65a785eb747fffd9c1383946e6c433bcedb7259a", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C1_SYMBOL_CATALOG", - "path": "src/app_runtime/workflow/runtime_factory.py", - "title": "WorkflowRuntimeFactory.create_engine", - "content": "method WorkflowRuntimeFactory.create_engine\ncreate_engine(self, workflow)", - "start_line": 14, - "end_line": 19, - "metadata": { - "symbol_id": "86f3a0bf3332952bf469e564748f16f1f7814ab51d5a963e5eb33de5e171b333", - "qname": "WorkflowRuntimeFactory.create_engine", - "kind": "method", - "signature": "create_engine(self, workflow)", - "parent_symbol_id": "WorkflowRuntimeFactory", - "package_or_module": "src.app_runtime.workflow.runtime_factory", - "is_test": false, - "blob_sha": "4d03c095f3082eb3ea8d558d65a785eb747fffd9c1383946e6c433bcedb7259a", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C1_SYMBOL_CATALOG", - "path": "src/app_runtime/workflow/runtime_factory.py", - "title": "WorkflowPersistence", - "content": "const WorkflowPersistence\nWorkflowPersistence = app_runtime.workflow.persistence.WorkflowPersistence", - "start_line": 4, - "end_line": 4, - "metadata": { - "symbol_id": "35693d37698e35079400b6a021d46209966ce469d9f77763d1c82d82ef4600b2", - "qname": "WorkflowPersistence", - "kind": "const", - "signature": "WorkflowPersistence = app_runtime.workflow.persistence.WorkflowPersistence", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.workflow.runtime_factory", - "is_test": false, - "blob_sha": "4d03c095f3082eb3ea8d558d65a785eb747fffd9c1383946e6c433bcedb7259a", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C1_SYMBOL_CATALOG", - "path": "src/app_runtime/workflow/runtime_factory.py", - "title": "annotations", - "content": "const annotations\nannotations = __future__.annotations", - "start_line": 1, - "end_line": 1, - "metadata": { - "symbol_id": "e016ec68f9d15d52fe0505774229fafc705c1bf3dfda78845a3db9b032a4441d", - "qname": "annotations", - "kind": "const", - "signature": "annotations = __future__.annotations", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.workflow.runtime_factory", - "is_test": false, - "blob_sha": "4d03c095f3082eb3ea8d558d65a785eb747fffd9c1383946e6c433bcedb7259a", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C1_SYMBOL_CATALOG", - "path": "src/app_runtime/workflow/runtime_factory.py", - "title": "WorkflowEngine", - "content": "const WorkflowEngine\nWorkflowEngine = app_runtime.workflow.engine.workflow_engine.WorkflowEngine", - "start_line": 3, - "end_line": 3, - "metadata": { - "symbol_id": "da4aee8bc7d248177fbc4f892732c6eb08baa6d268c32921a217747143a99fe0", - "qname": "WorkflowEngine", - "kind": "const", - "signature": "WorkflowEngine = app_runtime.workflow.engine.workflow_engine.WorkflowEngine", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.workflow.runtime_factory", - "is_test": false, - "blob_sha": "4d03c095f3082eb3ea8d558d65a785eb747fffd9c1383946e6c433bcedb7259a", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "path": "src/app_runtime/workflow/runtime_factory.py", - "title": "WorkflowRuntimeFactory.__init__:dataflow_slice", - "content": "WorkflowRuntimeFactory.__init__\n -> WorkflowRuntimeFactory._hooks\n -> WorkflowRuntimeFactory.create_engine", - "start_line": 11, - "end_line": 19, - "metadata": { - "edge_id": "db6124c75b447e4a0a9ba267bd6d6cdf267b41a733b2843d724dd42ec6f4945d", - "edge_type": "dataflow_slice", - "src_symbol_id": "d82a367758b2f7bcce3d351e576f25768b0afe8b915d01ace1c7d6380f14f52f", - "src_qname": "WorkflowRuntimeFactory.__init__", - "dst_symbol_id": "86f3a0bf3332952bf469e564748f16f1f7814ab51d5a963e5eb33de5e171b333", - "dst_ref": "WorkflowRuntimeFactory.create_engine", - "resolution": "resolved", - "slice_id": "db6124c75b447e4a0a9ba267bd6d6cdf267b41a733b2843d724dd42ec6f4945d", - "root_symbol_id": "d82a367758b2f7bcce3d351e576f25768b0afe8b915d01ace1c7d6380f14f52f", - "path_symbols": [ - "WorkflowRuntimeFactory.__init__", - "WorkflowRuntimeFactory._hooks", - "WorkflowRuntimeFactory.create_engine" - ], - "path_symbol_ids": [ - "d82a367758b2f7bcce3d351e576f25768b0afe8b915d01ace1c7d6380f14f52f", - "86f3a0bf3332952bf469e564748f16f1f7814ab51d5a963e5eb33de5e171b333" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "4d03c095f3082eb3ea8d558d65a785eb747fffd9c1383946e6c433bcedb7259a", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "path": "src/app_runtime/workflow/runtime_factory.py", - "title": "WorkflowRuntimeFactory.__init__:dataflow_slice", - "content": "WorkflowRuntimeFactory.__init__\n -> WorkflowRuntimeFactory._snapshot_sanitizer\n -> WorkflowRuntimeFactory.create_engine", - "start_line": 12, - "end_line": 17, - "metadata": { - "edge_id": "f46f5a871a3800b517b0f94ed2551392629e1d7920bc3e3b5a21e0d8f012b741", - "edge_type": "dataflow_slice", - "src_symbol_id": "d82a367758b2f7bcce3d351e576f25768b0afe8b915d01ace1c7d6380f14f52f", - "src_qname": "WorkflowRuntimeFactory.__init__", - "dst_symbol_id": "86f3a0bf3332952bf469e564748f16f1f7814ab51d5a963e5eb33de5e171b333", - "dst_ref": "WorkflowRuntimeFactory.create_engine", - "resolution": "resolved", - "slice_id": "f46f5a871a3800b517b0f94ed2551392629e1d7920bc3e3b5a21e0d8f012b741", - "root_symbol_id": "d82a367758b2f7bcce3d351e576f25768b0afe8b915d01ace1c7d6380f14f52f", - "path_symbols": [ - "WorkflowRuntimeFactory.__init__", - "WorkflowRuntimeFactory._snapshot_sanitizer", - "WorkflowRuntimeFactory.create_engine" - ], - "path_symbol_ids": [ - "d82a367758b2f7bcce3d351e576f25768b0afe8b915d01ace1c7d6380f14f52f", - "86f3a0bf3332952bf469e564748f16f1f7814ab51d5a963e5eb33de5e171b333" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "4d03c095f3082eb3ea8d558d65a785eb747fffd9c1383946e6c433bcedb7259a", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "path": "src/app_runtime/workflow/runtime_factory.py", - "title": "WorkflowRuntimeFactory.__init__:dataflow_slice", - "content": "WorkflowRuntimeFactory.__init__\n -> WorkflowRuntimeFactory._connection_factory\n -> WorkflowRuntimeFactory.create_engine", - "start_line": 9, - "end_line": 16, - "metadata": { - "edge_id": "543624853400c556d1939007017145281d76b00a694c7d5c4fbb0414ded3434e", - "edge_type": "dataflow_slice", - "src_symbol_id": "d82a367758b2f7bcce3d351e576f25768b0afe8b915d01ace1c7d6380f14f52f", - "src_qname": "WorkflowRuntimeFactory.__init__", - "dst_symbol_id": "86f3a0bf3332952bf469e564748f16f1f7814ab51d5a963e5eb33de5e171b333", - "dst_ref": "WorkflowRuntimeFactory.create_engine", - "resolution": "resolved", - "slice_id": "543624853400c556d1939007017145281d76b00a694c7d5c4fbb0414ded3434e", - "root_symbol_id": "d82a367758b2f7bcce3d351e576f25768b0afe8b915d01ace1c7d6380f14f52f", - "path_symbols": [ - "WorkflowRuntimeFactory.__init__", - "WorkflowRuntimeFactory._connection_factory", - "WorkflowRuntimeFactory.create_engine" - ], - "path_symbol_ids": [ - "d82a367758b2f7bcce3d351e576f25768b0afe8b915d01ace1c7d6380f14f52f", - "86f3a0bf3332952bf469e564748f16f1f7814ab51d5a963e5eb33de5e171b333" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "4d03c095f3082eb3ea8d558d65a785eb747fffd9c1383946e6c433bcedb7259a", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "path": "src/app_runtime/workflow/runtime_factory.py", - "title": "WorkflowRuntimeFactory.__init__:dataflow_slice", - "content": "WorkflowRuntimeFactory.__init__\n -> WorkflowRuntimeFactory._traces\n -> WorkflowRuntimeFactory.create_engine", - "start_line": 10, - "end_line": 19, - "metadata": { - "edge_id": "346cf5ddb4308b8403d27c5b54da8cba298bb0af7dc04c2fe30312ef574103c6", - "edge_type": "dataflow_slice", - "src_symbol_id": "d82a367758b2f7bcce3d351e576f25768b0afe8b915d01ace1c7d6380f14f52f", - "src_qname": "WorkflowRuntimeFactory.__init__", - "dst_symbol_id": "86f3a0bf3332952bf469e564748f16f1f7814ab51d5a963e5eb33de5e171b333", - "dst_ref": "WorkflowRuntimeFactory.create_engine", - "resolution": "resolved", - "slice_id": "346cf5ddb4308b8403d27c5b54da8cba298bb0af7dc04c2fe30312ef574103c6", - "root_symbol_id": "d82a367758b2f7bcce3d351e576f25768b0afe8b915d01ace1c7d6380f14f52f", - "path_symbols": [ - "WorkflowRuntimeFactory.__init__", - "WorkflowRuntimeFactory._traces", - "WorkflowRuntimeFactory.create_engine" - ], - "path_symbol_ids": [ - "d82a367758b2f7bcce3d351e576f25768b0afe8b915d01ace1c7d6380f14f52f", - "86f3a0bf3332952bf469e564748f16f1f7814ab51d5a963e5eb33de5e171b333" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "4d03c095f3082eb3ea8d558d65a785eb747fffd9c1383946e6c433bcedb7259a", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "path": "src/app_runtime/workflow/runtime_factory.py", - "title": "WorkflowRuntimeFactory.__init__:writes_attr", - "content": "WorkflowRuntimeFactory.__init__ writes_attr WorkflowRuntimeFactory._snapshot_sanitizer", - "start_line": 12, - "end_line": 12, - "metadata": { - "edge_id": "de0cb1913ba41f673cfb601cab23cfb2e1044ed3dd8c061aff486075aeb8af20", - "edge_type": "writes_attr", - "src_symbol_id": "d82a367758b2f7bcce3d351e576f25768b0afe8b915d01ace1c7d6380f14f52f", - "src_qname": "WorkflowRuntimeFactory.__init__", - "dst_symbol_id": null, - "dst_ref": "WorkflowRuntimeFactory._snapshot_sanitizer", - "resolution": "partial", - "is_test": false, - "blob_sha": "4d03c095f3082eb3ea8d558d65a785eb747fffd9c1383946e6c433bcedb7259a", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "path": "src/app_runtime/workflow/runtime_factory.py", - "title": "WorkflowRuntimeFactory.create_engine:calls", - "content": "WorkflowRuntimeFactory.create_engine calls WorkflowPersistence.create_default", - "start_line": 15, - "end_line": 18, - "metadata": { - "edge_id": "fa86efb6871092fc88df68295c0d92dbe46253e1afa3246ca62b6da11d4d5569", - "edge_type": "calls", - "src_symbol_id": "86f3a0bf3332952bf469e564748f16f1f7814ab51d5a963e5eb33de5e171b333", - "src_qname": "WorkflowRuntimeFactory.create_engine", - "dst_symbol_id": null, - "dst_ref": "WorkflowPersistence.create_default", - "resolution": "partial", - "is_test": false, - "blob_sha": "4d03c095f3082eb3ea8d558d65a785eb747fffd9c1383946e6c433bcedb7259a", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C0_SOURCE_CHUNKS", - "path": "src/app_runtime/workflow/runtime_factory.py", - "title": "src/app_runtime/workflow/runtime_factory.py:WorkflowRuntimeFactory", - "content": "class WorkflowRuntimeFactory:\n def __init__(self, connection_factory=None, *, traces, hooks=None, snapshot_sanitizer=None) -> None:\n self._connection_factory = connection_factory\n self._traces = traces\n self._hooks = hooks\n self._snapshot_sanitizer = snapshot_sanitizer\n\n def create_engine(self, workflow) -> WorkflowEngine:\n persistence = WorkflowPersistence.create_default(\n self._connection_factory,\n snapshot_sanitizer=self._snapshot_sanitizer,\n )\n return WorkflowEngine(workflow, persistence, traces=self._traces, hooks=self._hooks)", - "start_line": 7, - "end_line": 19, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.workflow.runtime_factory", - "is_test": false, - "blob_sha": "4d03c095f3082eb3ea8d558d65a785eb747fffd9c1383946e6c433bcedb7259a", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C0_SOURCE_CHUNKS", - "path": "src/plba/__init__.py", - "title": "src/plba/__init__.py:1-69", - "content": "from plba.bootstrap import create_runtime\nfrom plba.config import ConfigFileLoader, FileConfigProvider\nfrom plba.control import ControlActionSet, ControlChannel, ControlPlaneService, HttpControlChannel\nfrom plba.contracts import (\n ApplicationModule,\n ConfigProvider,\n HealthContributor,\n TraceContext,\n TraceContextRecord,\n TraceLogMessage,\n TraceTransport,\n Worker,\n WorkerHealth,\n WorkerStatus,\n)\nfrom plba.core import ConfigurationManager, RuntimeManager, ServiceContainer\nfrom plba.health import HealthRegistry\nfrom plba.logging import LogManager\nfrom plba.queue import InMemoryTaskQueue\nfrom plba.tracing import MySqlTraceTransport, NoOpTraceTransport, TraceService\nfrom plba.workflow import (\n StepResult,\n WorkflowContext,\n WorkflowDefinition,\n WorkflowEngine,\n WorkflowEngineHooks,\n WorkflowNode,\n WorkflowRuntimeFactory,\n WorkflowStep,\n)\nfrom plba.workers import WorkerSupervisor\n\n__all__ = [\n \"ApplicationModule\",\n \"ConfigFileLoader\",\n \"ConfigProvider\",\n \"ConfigurationManager\",\n \"ControlActionSet\",\n \"ControlChannel\",\n \"ControlPlaneService\",\n \"create_runtime\",\n \"FileConfigProvider\",\n \"HealthContributor\",\n \"HealthRegistry\",\n \"HttpControlChannel\",\n \"InMemoryTaskQueue\",\n \"LogManager\",\n \"MySqlTraceTransport\",\n \"NoOpTraceTransport\",\n \"RuntimeManager\",\n \"ServiceContainer\",\n \"TraceContext\",\n \"TraceContextRecord\",\n \"TraceLogMessage\",\n \"TraceService\",\n \"TraceTransport\",\n \"StepResult\",\n \"Worker\",\n \"WorkerHealth\",\n \"WorkerStatus\",\n \"WorkflowContext\",\n \"WorkflowDefinition\",\n \"WorkflowEngine\",\n \"WorkflowEngineHooks\",\n \"WorkflowNode\",\n \"WorkflowRuntimeFactory\",\n \"WorkflowStep\",\n \"WorkerSupervisor\",\n]", - "start_line": 1, - "end_line": 69, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.plba.__init__", - "is_test": false, - "blob_sha": "24e755ec8c249d14fb0e675b5dbf2b71ab91afb9c849897eebfa9feb2499e19d", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C0_SOURCE_CHUNKS", - "path": "src/plba/workflow.py", - "title": "src/plba/workflow.py:1-18", - "content": "from app_runtime.workflow.contracts.context import WorkflowContext\nfrom app_runtime.workflow.contracts.result import StepResult\nfrom app_runtime.workflow.contracts.step import WorkflowStep\nfrom app_runtime.workflow.contracts.workflow import WorkflowDefinition, WorkflowNode\nfrom app_runtime.workflow.engine.hooks import WorkflowEngineHooks\nfrom app_runtime.workflow.engine.workflow_engine import WorkflowEngine\nfrom app_runtime.workflow.runtime_factory import WorkflowRuntimeFactory\n\n__all__ = [\n \"StepResult\",\n \"WorkflowContext\",\n \"WorkflowDefinition\",\n \"WorkflowEngine\",\n \"WorkflowEngineHooks\",\n \"WorkflowNode\",\n \"WorkflowRuntimeFactory\",\n \"WorkflowStep\",\n]", - "start_line": 1, - "end_line": 18, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.plba.workflow", - "is_test": false, - "blob_sha": "f227797606042273d1f1798f76846952892eeb9e4e9e6a38fb8a631d7231ff39", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C0_SOURCE_CHUNKS", - "path": "src/app_runtime/config/__init__.py", - "title": "src/app_runtime/config/__init__.py:1-4", - "content": "from app_runtime.config.file_loader import ConfigFileLoader\nfrom app_runtime.config.providers import FileConfigProvider\n\n__all__ = [\"ConfigFileLoader\", \"FileConfigProvider\"]", - "start_line": 1, - "end_line": 4, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.app_runtime.config.__init__", - "is_test": false, - "blob_sha": "612918029820a2a983330ec92256142b55b9de4bdf3399ece18e2a02dbad9729", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C0_SOURCE_CHUNKS", - "path": "src/app_runtime/config/providers.py", - "title": "src/app_runtime/config/providers.py:FileConfigProvider", - "content": "class FileConfigProvider(ConfigProvider):\n def __init__(self, path: str | Path) -> None:\n self._loader = ConfigFileLoader(path)\n\n @property\n def loader(self) -> ConfigFileLoader:\n return self._loader\n\n def load(self) -> dict[str, Any]:\n config = self._loader.load_sync()\n if not isinstance(config, dict):\n raise TypeError(\"Config root must be a mapping\")\n return dict(config)", - "start_line": 10, - "end_line": 22, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.config.providers", - "is_test": false, - "blob_sha": "8c53ca0122d6df6c5763bca15e99434bb4daebd5a618b8fc927e9ae90b022e64", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C0_SOURCE_CHUNKS", - "path": "src/app_runtime/contracts/__init__.py", - "title": "src/app_runtime/__init__.py:1-1", - "content": "__all__: list[str] = []", - "start_line": 1, - "end_line": 1, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.app_runtime.__init__", - "is_test": false, - "blob_sha": "8eea9df4f6d7b38ca0e39ccc27b04700e3d08dbeec8046d613d22706d19985fa", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C0_SOURCE_CHUNKS", - "path": "src/app_runtime/config/file_loader.py", - "title": "src/app_runtime/config/file_loader.py:ConfigFileLoader", - "content": "class ConfigFileLoader:\n def __init__(self, path: str | Path) -> None:\n self.path = Path(path)\n self.config: Any = None\n self.last_valid_config: Any = None\n self._last_seen_hash: str | None = None\n\n def read_text(self) -> str:\n return self.path.read_text(encoding=\"utf-8\")\n\n def parse(self, data: str) -> Any:\n suffix = self.path.suffix.lower()\n if suffix in {\".yml\", \".yaml\"}:\n return yaml.safe_load(data)\n return json.loads(data)\n\n def load_sync(self) -> Any:\n data = self.read_text()\n parsed = self.parse(data)\n self.config = parsed\n self.last_valid_config = parsed\n self._last_seen_hash = self._calculate_hash(data)\n return parsed\n\n def load_if_changed(self) -> tuple[bool, Any]:\n data = self.read_text()\n current_hash = self._calculate_hash(data)\n if current_hash == self._last_seen_hash:\n return False, self.config\n parsed = self.parse(data)\n self.config = parsed\n self.last_valid_config = parsed\n self._last_seen_hash = current_hash\n return True, parsed\n\n @staticmethod\n def _calculate_hash(data: str) -> str:\n return hashlib.sha256(data.encode(\"utf-8\")).hexdigest()", - "start_line": 11, - "end_line": 48, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.config.file_loader", - "is_test": false, - "blob_sha": "1f19ffebde5e38e4be5a5d5a678059a0f36dedb8fb8b3e00ab395c67106a87ea", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C0_SOURCE_CHUNKS", - "path": "src/app_runtime/contracts/config.py", - "title": "src/app_runtime/contracts/config.py:ConfigProvider", - "content": "class ConfigProvider(ABC):\n @abstractmethod\n def load(self) -> dict[str, Any]:\n \"\"\"Return a config fragment.\"\"\"", - "start_line": 7, - "end_line": 10, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.contracts.config", - "is_test": false, - "blob_sha": "5e773880267743ee94954ea2db120c2d88c54d4312893293d1b89df405283ed4", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C0_SOURCE_CHUNKS", - "path": "src/app_runtime/contracts/health.py", - "title": "src/app_runtime/contracts/health.py:HealthContributor", - "content": "class HealthContributor(ABC):\n @abstractmethod\n def health(self) -> WorkerHealth:\n \"\"\"Return contributor health state.\"\"\"", - "start_line": 7, - "end_line": 10, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.contracts.health", - "is_test": false, - "blob_sha": "6bd92611def7131e32d4dd34a8ed85e6cf3c67722ad27797032a632cb30dc097", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C0_SOURCE_CHUNKS", - "path": "src/app_runtime/contracts/application.py", - "title": "src/app_runtime/contracts/application.py:ApplicationModule", - "content": "class ApplicationModule(ABC):\n @property\n @abstractmethod\n def name(self) -> str:\n \"\"\"Module name used for runtime status and diagnostics.\"\"\"\n\n @abstractmethod\n def register(self, registry: ModuleRegistry) -> None:\n \"\"\"Register workers, services, and health contributors.\"\"\"", - "start_line": 8, - "end_line": 16, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.contracts.application", - "is_test": false, - "blob_sha": "197c35634dca49c352ce3f230295a485fbffb672ce7bb8c08e752bfdf61e7fa4", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "relations": [ - { - "path": "src/app_runtime/workflow/runtime_factory.py", - "start_line": 11, - "end_line": 19, - "edge_type": "dataflow_slice", - "source": "WorkflowRuntimeFactory.__init__", - "target": "WorkflowRuntimeFactory.create_engine", - "metadata": { - "edge_id": "db6124c75b447e4a0a9ba267bd6d6cdf267b41a733b2843d724dd42ec6f4945d", - "edge_type": "dataflow_slice", - "src_symbol_id": "d82a367758b2f7bcce3d351e576f25768b0afe8b915d01ace1c7d6380f14f52f", - "src_qname": "WorkflowRuntimeFactory.__init__", - "dst_symbol_id": "86f3a0bf3332952bf469e564748f16f1f7814ab51d5a963e5eb33de5e171b333", - "dst_ref": "WorkflowRuntimeFactory.create_engine", - "resolution": "resolved", - "slice_id": "db6124c75b447e4a0a9ba267bd6d6cdf267b41a733b2843d724dd42ec6f4945d", - "root_symbol_id": "d82a367758b2f7bcce3d351e576f25768b0afe8b915d01ace1c7d6380f14f52f", - "path_symbols": [ - "WorkflowRuntimeFactory.__init__", - "WorkflowRuntimeFactory._hooks", - "WorkflowRuntimeFactory.create_engine" - ], - "path_symbol_ids": [ - "d82a367758b2f7bcce3d351e576f25768b0afe8b915d01ace1c7d6380f14f52f", - "86f3a0bf3332952bf469e564748f16f1f7814ab51d5a963e5eb33de5e171b333" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "4d03c095f3082eb3ea8d558d65a785eb747fffd9c1383946e6c433bcedb7259a", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - }, - "content": "WorkflowRuntimeFactory.__init__\n -> WorkflowRuntimeFactory._hooks\n -> WorkflowRuntimeFactory.create_engine" - }, - { - "path": "src/app_runtime/workflow/runtime_factory.py", - "start_line": 12, - "end_line": 17, - "edge_type": "dataflow_slice", - "source": "WorkflowRuntimeFactory.__init__", - "target": "WorkflowRuntimeFactory.create_engine", - "metadata": { - "edge_id": "f46f5a871a3800b517b0f94ed2551392629e1d7920bc3e3b5a21e0d8f012b741", - "edge_type": "dataflow_slice", - "src_symbol_id": "d82a367758b2f7bcce3d351e576f25768b0afe8b915d01ace1c7d6380f14f52f", - "src_qname": "WorkflowRuntimeFactory.__init__", - "dst_symbol_id": "86f3a0bf3332952bf469e564748f16f1f7814ab51d5a963e5eb33de5e171b333", - "dst_ref": "WorkflowRuntimeFactory.create_engine", - "resolution": "resolved", - "slice_id": "f46f5a871a3800b517b0f94ed2551392629e1d7920bc3e3b5a21e0d8f012b741", - "root_symbol_id": "d82a367758b2f7bcce3d351e576f25768b0afe8b915d01ace1c7d6380f14f52f", - "path_symbols": [ - "WorkflowRuntimeFactory.__init__", - "WorkflowRuntimeFactory._snapshot_sanitizer", - "WorkflowRuntimeFactory.create_engine" - ], - "path_symbol_ids": [ - "d82a367758b2f7bcce3d351e576f25768b0afe8b915d01ace1c7d6380f14f52f", - "86f3a0bf3332952bf469e564748f16f1f7814ab51d5a963e5eb33de5e171b333" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "4d03c095f3082eb3ea8d558d65a785eb747fffd9c1383946e6c433bcedb7259a", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - }, - "content": "WorkflowRuntimeFactory.__init__\n -> WorkflowRuntimeFactory._snapshot_sanitizer\n -> WorkflowRuntimeFactory.create_engine" - }, - { - "path": "src/app_runtime/workflow/runtime_factory.py", - "start_line": 9, - "end_line": 16, - "edge_type": "dataflow_slice", - "source": "WorkflowRuntimeFactory.__init__", - "target": "WorkflowRuntimeFactory.create_engine", - "metadata": { - "edge_id": "543624853400c556d1939007017145281d76b00a694c7d5c4fbb0414ded3434e", - "edge_type": "dataflow_slice", - "src_symbol_id": "d82a367758b2f7bcce3d351e576f25768b0afe8b915d01ace1c7d6380f14f52f", - "src_qname": "WorkflowRuntimeFactory.__init__", - "dst_symbol_id": "86f3a0bf3332952bf469e564748f16f1f7814ab51d5a963e5eb33de5e171b333", - "dst_ref": "WorkflowRuntimeFactory.create_engine", - "resolution": "resolved", - "slice_id": "543624853400c556d1939007017145281d76b00a694c7d5c4fbb0414ded3434e", - "root_symbol_id": "d82a367758b2f7bcce3d351e576f25768b0afe8b915d01ace1c7d6380f14f52f", - "path_symbols": [ - "WorkflowRuntimeFactory.__init__", - "WorkflowRuntimeFactory._connection_factory", - "WorkflowRuntimeFactory.create_engine" - ], - "path_symbol_ids": [ - "d82a367758b2f7bcce3d351e576f25768b0afe8b915d01ace1c7d6380f14f52f", - "86f3a0bf3332952bf469e564748f16f1f7814ab51d5a963e5eb33de5e171b333" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "4d03c095f3082eb3ea8d558d65a785eb747fffd9c1383946e6c433bcedb7259a", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - }, - "content": "WorkflowRuntimeFactory.__init__\n -> WorkflowRuntimeFactory._connection_factory\n -> WorkflowRuntimeFactory.create_engine" - }, - { - "path": "src/app_runtime/workflow/runtime_factory.py", - "start_line": 10, - "end_line": 19, - "edge_type": "dataflow_slice", - "source": "WorkflowRuntimeFactory.__init__", - "target": "WorkflowRuntimeFactory.create_engine", - "metadata": { - "edge_id": "346cf5ddb4308b8403d27c5b54da8cba298bb0af7dc04c2fe30312ef574103c6", - "edge_type": "dataflow_slice", - "src_symbol_id": "d82a367758b2f7bcce3d351e576f25768b0afe8b915d01ace1c7d6380f14f52f", - "src_qname": "WorkflowRuntimeFactory.__init__", - "dst_symbol_id": "86f3a0bf3332952bf469e564748f16f1f7814ab51d5a963e5eb33de5e171b333", - "dst_ref": "WorkflowRuntimeFactory.create_engine", - "resolution": "resolved", - "slice_id": "346cf5ddb4308b8403d27c5b54da8cba298bb0af7dc04c2fe30312ef574103c6", - "root_symbol_id": "d82a367758b2f7bcce3d351e576f25768b0afe8b915d01ace1c7d6380f14f52f", - "path_symbols": [ - "WorkflowRuntimeFactory.__init__", - "WorkflowRuntimeFactory._traces", - "WorkflowRuntimeFactory.create_engine" - ], - "path_symbol_ids": [ - "d82a367758b2f7bcce3d351e576f25768b0afe8b915d01ace1c7d6380f14f52f", - "86f3a0bf3332952bf469e564748f16f1f7814ab51d5a963e5eb33de5e171b333" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "4d03c095f3082eb3ea8d558d65a785eb747fffd9c1383946e6c433bcedb7259a", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - }, - "content": "WorkflowRuntimeFactory.__init__\n -> WorkflowRuntimeFactory._traces\n -> WorkflowRuntimeFactory.create_engine" - }, - { - "path": "src/app_runtime/workflow/runtime_factory.py", - "start_line": 12, - "end_line": 12, - "edge_type": "writes_attr", - "source": "WorkflowRuntimeFactory.__init__", - "target": "WorkflowRuntimeFactory._snapshot_sanitizer", - "metadata": { - "edge_id": "de0cb1913ba41f673cfb601cab23cfb2e1044ed3dd8c061aff486075aeb8af20", - "edge_type": "writes_attr", - "src_symbol_id": "d82a367758b2f7bcce3d351e576f25768b0afe8b915d01ace1c7d6380f14f52f", - "src_qname": "WorkflowRuntimeFactory.__init__", - "dst_symbol_id": null, - "dst_ref": "WorkflowRuntimeFactory._snapshot_sanitizer", - "resolution": "partial", - "is_test": false, - "blob_sha": "4d03c095f3082eb3ea8d558d65a785eb747fffd9c1383946e6c433bcedb7259a", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - }, - "content": "WorkflowRuntimeFactory.__init__ writes_attr WorkflowRuntimeFactory._snapshot_sanitizer" - }, - { - "path": "src/app_runtime/workflow/runtime_factory.py", - "start_line": 15, - "end_line": 18, - "edge_type": "calls", - "source": "WorkflowRuntimeFactory.create_engine", - "target": "WorkflowPersistence.create_default", - "metadata": { - "edge_id": "fa86efb6871092fc88df68295c0d92dbe46253e1afa3246ca62b6da11d4d5569", - "edge_type": "calls", - "src_symbol_id": "86f3a0bf3332952bf469e564748f16f1f7814ab51d5a963e5eb33de5e171b333", - "src_qname": "WorkflowRuntimeFactory.create_engine", - "dst_symbol_id": null, - "dst_ref": "WorkflowPersistence.create_default", - "resolution": "partial", - "is_test": false, - "blob_sha": "4d03c095f3082eb3ea8d558d65a785eb747fffd9c1383946e6c433bcedb7259a", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - }, - "content": "WorkflowRuntimeFactory.create_engine calls WorkflowPersistence.create_default" - } - ], - "semantic_hints": [], - "entrypoints": [], - "test_candidates": [], - "layer_outcomes": [ - { - "layer_id": "C1_SYMBOL_CATALOG", - "hit_count": 8, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C2_DEPENDENCY_GRAPH", - "hit_count": 6, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C0_SOURCE_CHUNKS", - "hit_count": 10, - "empty": false, - "fallback_used": false - } - ], - "missing_layers": [], - "raw_rows": [ - { - "path": "src/plba/__init__.py", - "content": "const WorkflowRuntimeFactory\nWorkflowRuntimeFactory = plba.workflow.WorkflowRuntimeFactory", - "layer": "C1_SYMBOL_CATALOG", - "title": "WorkflowRuntimeFactory", - "span_start": 21, - "span_end": 30, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": null, - "metadata": { - "symbol_id": "cb7c73db05c2622aac89114bed1cddd1d567de21cfac5c53037c62b1074b25c9", - "qname": "WorkflowRuntimeFactory", - "kind": "const", - "signature": "WorkflowRuntimeFactory = plba.workflow.WorkflowRuntimeFactory", - "parent_symbol_id": null, - "package_or_module": "src.plba.__init__", - "is_test": false, - "blob_sha": "24e755ec8c249d14fb0e675b5dbf2b71ab91afb9c849897eebfa9feb2499e19d", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/runtime_factory.py", - "content": "class WorkflowRuntimeFactory\nWorkflowRuntimeFactory", - "layer": "C1_SYMBOL_CATALOG", - "title": "WorkflowRuntimeFactory", - "span_start": 7, - "span_end": 19, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": null, - "metadata": { - "symbol_id": "9da827270329de64ebb426fadaaa5e35145e6666b92c6da186e08bf4b071f458", - "qname": "WorkflowRuntimeFactory", - "kind": "class", - "signature": "WorkflowRuntimeFactory", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.workflow.runtime_factory", - "is_test": false, - "blob_sha": "4d03c095f3082eb3ea8d558d65a785eb747fffd9c1383946e6c433bcedb7259a", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/workflow.py", - "content": "const WorkflowRuntimeFactory\nWorkflowRuntimeFactory = app_runtime.workflow.runtime_factory.WorkflowRuntimeFactory", - "layer": "C1_SYMBOL_CATALOG", - "title": "WorkflowRuntimeFactory", - "span_start": 7, - "span_end": 7, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": null, - "metadata": { - "symbol_id": "80865947d1ca709971efe9d68a9ee1f348c1c43d351bf4e1b4a5884d72985b6b", - "qname": "WorkflowRuntimeFactory", - "kind": "const", - "signature": "WorkflowRuntimeFactory = app_runtime.workflow.runtime_factory.WorkflowRuntimeFactory", - "parent_symbol_id": null, - "package_or_module": "src.plba.workflow", - "is_test": false, - "blob_sha": "f227797606042273d1f1798f76846952892eeb9e4e9e6a38fb8a631d7231ff39", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/runtime_factory.py", - "content": "method WorkflowRuntimeFactory.__init__\n__init__(self, connection_factory)", - "layer": "C1_SYMBOL_CATALOG", - "title": "WorkflowRuntimeFactory.__init__", - "span_start": 8, - "span_end": 12, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": null, - "metadata": { - "symbol_id": "d82a367758b2f7bcce3d351e576f25768b0afe8b915d01ace1c7d6380f14f52f", - "qname": "WorkflowRuntimeFactory.__init__", - "kind": "method", - "signature": "__init__(self, connection_factory)", - "parent_symbol_id": "WorkflowRuntimeFactory", - "package_or_module": "src.app_runtime.workflow.runtime_factory", - "is_test": false, - "blob_sha": "4d03c095f3082eb3ea8d558d65a785eb747fffd9c1383946e6c433bcedb7259a", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/runtime_factory.py", - "content": "method WorkflowRuntimeFactory.create_engine\ncreate_engine(self, workflow)", - "layer": "C1_SYMBOL_CATALOG", - "title": "WorkflowRuntimeFactory.create_engine", - "span_start": 14, - "span_end": 19, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": null, - "metadata": { - "symbol_id": "86f3a0bf3332952bf469e564748f16f1f7814ab51d5a963e5eb33de5e171b333", - "qname": "WorkflowRuntimeFactory.create_engine", - "kind": "method", - "signature": "create_engine(self, workflow)", - "parent_symbol_id": "WorkflowRuntimeFactory", - "package_or_module": "src.app_runtime.workflow.runtime_factory", - "is_test": false, - "blob_sha": "4d03c095f3082eb3ea8d558d65a785eb747fffd9c1383946e6c433bcedb7259a", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/runtime_factory.py", - "content": "const WorkflowPersistence\nWorkflowPersistence = app_runtime.workflow.persistence.WorkflowPersistence", - "layer": "C1_SYMBOL_CATALOG", - "title": "WorkflowPersistence", - "span_start": 4, - "span_end": 4, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": null, - "metadata": { - "symbol_id": "35693d37698e35079400b6a021d46209966ce469d9f77763d1c82d82ef4600b2", - "qname": "WorkflowPersistence", - "kind": "const", - "signature": "WorkflowPersistence = app_runtime.workflow.persistence.WorkflowPersistence", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.workflow.runtime_factory", - "is_test": false, - "blob_sha": "4d03c095f3082eb3ea8d558d65a785eb747fffd9c1383946e6c433bcedb7259a", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/runtime_factory.py", - "content": "const annotations\nannotations = __future__.annotations", - "layer": "C1_SYMBOL_CATALOG", - "title": "annotations", - "span_start": 1, - "span_end": 1, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": null, - "metadata": { - "symbol_id": "e016ec68f9d15d52fe0505774229fafc705c1bf3dfda78845a3db9b032a4441d", - "qname": "annotations", - "kind": "const", - "signature": "annotations = __future__.annotations", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.workflow.runtime_factory", - "is_test": false, - "blob_sha": "4d03c095f3082eb3ea8d558d65a785eb747fffd9c1383946e6c433bcedb7259a", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/runtime_factory.py", - "content": "const WorkflowEngine\nWorkflowEngine = app_runtime.workflow.engine.workflow_engine.WorkflowEngine", - "layer": "C1_SYMBOL_CATALOG", - "title": "WorkflowEngine", - "span_start": 3, - "span_end": 3, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": null, - "metadata": { - "symbol_id": "da4aee8bc7d248177fbc4f892732c6eb08baa6d268c32921a217747143a99fe0", - "qname": "WorkflowEngine", - "kind": "const", - "signature": "WorkflowEngine = app_runtime.workflow.engine.workflow_engine.WorkflowEngine", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.workflow.runtime_factory", - "is_test": false, - "blob_sha": "4d03c095f3082eb3ea8d558d65a785eb747fffd9c1383946e6c433bcedb7259a", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/runtime_factory.py", - "content": "WorkflowRuntimeFactory.__init__\n -> WorkflowRuntimeFactory._hooks\n -> WorkflowRuntimeFactory.create_engine", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "WorkflowRuntimeFactory.__init__:dataflow_slice", - "span_start": 11, - "span_end": 19, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": null, - "metadata": { - "edge_id": "db6124c75b447e4a0a9ba267bd6d6cdf267b41a733b2843d724dd42ec6f4945d", - "edge_type": "dataflow_slice", - "src_symbol_id": "d82a367758b2f7bcce3d351e576f25768b0afe8b915d01ace1c7d6380f14f52f", - "src_qname": "WorkflowRuntimeFactory.__init__", - "dst_symbol_id": "86f3a0bf3332952bf469e564748f16f1f7814ab51d5a963e5eb33de5e171b333", - "dst_ref": "WorkflowRuntimeFactory.create_engine", - "resolution": "resolved", - "slice_id": "db6124c75b447e4a0a9ba267bd6d6cdf267b41a733b2843d724dd42ec6f4945d", - "root_symbol_id": "d82a367758b2f7bcce3d351e576f25768b0afe8b915d01ace1c7d6380f14f52f", - "path_symbols": [ - "WorkflowRuntimeFactory.__init__", - "WorkflowRuntimeFactory._hooks", - "WorkflowRuntimeFactory.create_engine" - ], - "path_symbol_ids": [ - "d82a367758b2f7bcce3d351e576f25768b0afe8b915d01ace1c7d6380f14f52f", - "86f3a0bf3332952bf469e564748f16f1f7814ab51d5a963e5eb33de5e171b333" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "4d03c095f3082eb3ea8d558d65a785eb747fffd9c1383946e6c433bcedb7259a", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/runtime_factory.py", - "content": "WorkflowRuntimeFactory.__init__\n -> WorkflowRuntimeFactory._snapshot_sanitizer\n -> WorkflowRuntimeFactory.create_engine", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "WorkflowRuntimeFactory.__init__:dataflow_slice", - "span_start": 12, - "span_end": 17, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": null, - "metadata": { - "edge_id": "f46f5a871a3800b517b0f94ed2551392629e1d7920bc3e3b5a21e0d8f012b741", - "edge_type": "dataflow_slice", - "src_symbol_id": "d82a367758b2f7bcce3d351e576f25768b0afe8b915d01ace1c7d6380f14f52f", - "src_qname": "WorkflowRuntimeFactory.__init__", - "dst_symbol_id": "86f3a0bf3332952bf469e564748f16f1f7814ab51d5a963e5eb33de5e171b333", - "dst_ref": "WorkflowRuntimeFactory.create_engine", - "resolution": "resolved", - "slice_id": "f46f5a871a3800b517b0f94ed2551392629e1d7920bc3e3b5a21e0d8f012b741", - "root_symbol_id": "d82a367758b2f7bcce3d351e576f25768b0afe8b915d01ace1c7d6380f14f52f", - "path_symbols": [ - "WorkflowRuntimeFactory.__init__", - "WorkflowRuntimeFactory._snapshot_sanitizer", - "WorkflowRuntimeFactory.create_engine" - ], - "path_symbol_ids": [ - "d82a367758b2f7bcce3d351e576f25768b0afe8b915d01ace1c7d6380f14f52f", - "86f3a0bf3332952bf469e564748f16f1f7814ab51d5a963e5eb33de5e171b333" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "4d03c095f3082eb3ea8d558d65a785eb747fffd9c1383946e6c433bcedb7259a", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/runtime_factory.py", - "content": "WorkflowRuntimeFactory.__init__\n -> WorkflowRuntimeFactory._connection_factory\n -> WorkflowRuntimeFactory.create_engine", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "WorkflowRuntimeFactory.__init__:dataflow_slice", - "span_start": 9, - "span_end": 16, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": null, - "metadata": { - "edge_id": "543624853400c556d1939007017145281d76b00a694c7d5c4fbb0414ded3434e", - "edge_type": "dataflow_slice", - "src_symbol_id": "d82a367758b2f7bcce3d351e576f25768b0afe8b915d01ace1c7d6380f14f52f", - "src_qname": "WorkflowRuntimeFactory.__init__", - "dst_symbol_id": "86f3a0bf3332952bf469e564748f16f1f7814ab51d5a963e5eb33de5e171b333", - "dst_ref": "WorkflowRuntimeFactory.create_engine", - "resolution": "resolved", - "slice_id": "543624853400c556d1939007017145281d76b00a694c7d5c4fbb0414ded3434e", - "root_symbol_id": "d82a367758b2f7bcce3d351e576f25768b0afe8b915d01ace1c7d6380f14f52f", - "path_symbols": [ - "WorkflowRuntimeFactory.__init__", - "WorkflowRuntimeFactory._connection_factory", - "WorkflowRuntimeFactory.create_engine" - ], - "path_symbol_ids": [ - "d82a367758b2f7bcce3d351e576f25768b0afe8b915d01ace1c7d6380f14f52f", - "86f3a0bf3332952bf469e564748f16f1f7814ab51d5a963e5eb33de5e171b333" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "4d03c095f3082eb3ea8d558d65a785eb747fffd9c1383946e6c433bcedb7259a", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/runtime_factory.py", - "content": "WorkflowRuntimeFactory.__init__\n -> WorkflowRuntimeFactory._traces\n -> WorkflowRuntimeFactory.create_engine", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "WorkflowRuntimeFactory.__init__:dataflow_slice", - "span_start": 10, - "span_end": 19, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": null, - "metadata": { - "edge_id": "346cf5ddb4308b8403d27c5b54da8cba298bb0af7dc04c2fe30312ef574103c6", - "edge_type": "dataflow_slice", - "src_symbol_id": "d82a367758b2f7bcce3d351e576f25768b0afe8b915d01ace1c7d6380f14f52f", - "src_qname": "WorkflowRuntimeFactory.__init__", - "dst_symbol_id": "86f3a0bf3332952bf469e564748f16f1f7814ab51d5a963e5eb33de5e171b333", - "dst_ref": "WorkflowRuntimeFactory.create_engine", - "resolution": "resolved", - "slice_id": "346cf5ddb4308b8403d27c5b54da8cba298bb0af7dc04c2fe30312ef574103c6", - "root_symbol_id": "d82a367758b2f7bcce3d351e576f25768b0afe8b915d01ace1c7d6380f14f52f", - "path_symbols": [ - "WorkflowRuntimeFactory.__init__", - "WorkflowRuntimeFactory._traces", - "WorkflowRuntimeFactory.create_engine" - ], - "path_symbol_ids": [ - "d82a367758b2f7bcce3d351e576f25768b0afe8b915d01ace1c7d6380f14f52f", - "86f3a0bf3332952bf469e564748f16f1f7814ab51d5a963e5eb33de5e171b333" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "4d03c095f3082eb3ea8d558d65a785eb747fffd9c1383946e6c433bcedb7259a", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/runtime_factory.py", - "content": "WorkflowRuntimeFactory.__init__ writes_attr WorkflowRuntimeFactory._snapshot_sanitizer", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "WorkflowRuntimeFactory.__init__:writes_attr", - "span_start": 12, - "span_end": 12, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": null, - "metadata": { - "edge_id": "de0cb1913ba41f673cfb601cab23cfb2e1044ed3dd8c061aff486075aeb8af20", - "edge_type": "writes_attr", - "src_symbol_id": "d82a367758b2f7bcce3d351e576f25768b0afe8b915d01ace1c7d6380f14f52f", - "src_qname": "WorkflowRuntimeFactory.__init__", - "dst_symbol_id": null, - "dst_ref": "WorkflowRuntimeFactory._snapshot_sanitizer", - "resolution": "partial", - "is_test": false, - "blob_sha": "4d03c095f3082eb3ea8d558d65a785eb747fffd9c1383946e6c433bcedb7259a", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/runtime_factory.py", - "content": "WorkflowRuntimeFactory.create_engine calls WorkflowPersistence.create_default", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "WorkflowRuntimeFactory.create_engine:calls", - "span_start": 15, - "span_end": 18, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": null, - "metadata": { - "edge_id": "fa86efb6871092fc88df68295c0d92dbe46253e1afa3246ca62b6da11d4d5569", - "edge_type": "calls", - "src_symbol_id": "86f3a0bf3332952bf469e564748f16f1f7814ab51d5a963e5eb33de5e171b333", - "src_qname": "WorkflowRuntimeFactory.create_engine", - "dst_symbol_id": null, - "dst_ref": "WorkflowPersistence.create_default", - "resolution": "partial", - "is_test": false, - "blob_sha": "4d03c095f3082eb3ea8d558d65a785eb747fffd9c1383946e6c433bcedb7259a", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/runtime_factory.py", - "content": "class WorkflowRuntimeFactory:\n def __init__(self, connection_factory=None, *, traces, hooks=None, snapshot_sanitizer=None) -> None:\n self._connection_factory = connection_factory\n self._traces = traces\n self._hooks = hooks\n self._snapshot_sanitizer = snapshot_sanitizer\n\n def create_engine(self, workflow) -> WorkflowEngine:\n persistence = WorkflowPersistence.create_default(\n self._connection_factory,\n snapshot_sanitizer=self._snapshot_sanitizer,\n )\n return WorkflowEngine(workflow, persistence, traces=self._traces, hooks=self._hooks)", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/workflow/runtime_factory.py:WorkflowRuntimeFactory", - "span_start": 7, - "span_end": 19, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": null, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.workflow.runtime_factory", - "is_test": false, - "blob_sha": "4d03c095f3082eb3ea8d558d65a785eb747fffd9c1383946e6c433bcedb7259a", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/__init__.py", - "content": "from plba.bootstrap import create_runtime\nfrom plba.config import ConfigFileLoader, FileConfigProvider\nfrom plba.control import ControlActionSet, ControlChannel, ControlPlaneService, HttpControlChannel\nfrom plba.contracts import (\n ApplicationModule,\n ConfigProvider,\n HealthContributor,\n TraceContext,\n TraceContextRecord,\n TraceLogMessage,\n TraceTransport,\n Worker,\n WorkerHealth,\n WorkerStatus,\n)\nfrom plba.core import ConfigurationManager, RuntimeManager, ServiceContainer\nfrom plba.health import HealthRegistry\nfrom plba.logging import LogManager\nfrom plba.queue import InMemoryTaskQueue\nfrom plba.tracing import MySqlTraceTransport, NoOpTraceTransport, TraceService\nfrom plba.workflow import (\n StepResult,\n WorkflowContext,\n WorkflowDefinition,\n WorkflowEngine,\n WorkflowEngineHooks,\n WorkflowNode,\n WorkflowRuntimeFactory,\n WorkflowStep,\n)\nfrom plba.workers import WorkerSupervisor\n\n__all__ = [\n \"ApplicationModule\",\n \"ConfigFileLoader\",\n \"ConfigProvider\",\n \"ConfigurationManager\",\n \"ControlActionSet\",\n \"ControlChannel\",\n \"ControlPlaneService\",\n \"create_runtime\",\n \"FileConfigProvider\",\n \"HealthContributor\",\n \"HealthRegistry\",\n \"HttpControlChannel\",\n \"InMemoryTaskQueue\",\n \"LogManager\",\n \"MySqlTraceTransport\",\n \"NoOpTraceTransport\",\n \"RuntimeManager\",\n \"ServiceContainer\",\n \"TraceContext\",\n \"TraceContextRecord\",\n \"TraceLogMessage\",\n \"TraceService\",\n \"TraceTransport\",\n \"StepResult\",\n \"Worker\",\n \"WorkerHealth\",\n \"WorkerStatus\",\n \"WorkflowContext\",\n \"WorkflowDefinition\",\n \"WorkflowEngine\",\n \"WorkflowEngineHooks\",\n \"WorkflowNode\",\n \"WorkflowRuntimeFactory\",\n \"WorkflowStep\",\n \"WorkerSupervisor\",\n]", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/plba/__init__.py:1-69", - "span_start": 1, - "span_end": 69, - "lexical_rank": 6, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": null, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.plba.__init__", - "is_test": false, - "blob_sha": "24e755ec8c249d14fb0e675b5dbf2b71ab91afb9c849897eebfa9feb2499e19d", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/workflow.py", - "content": "from app_runtime.workflow.contracts.context import WorkflowContext\nfrom app_runtime.workflow.contracts.result import StepResult\nfrom app_runtime.workflow.contracts.step import WorkflowStep\nfrom app_runtime.workflow.contracts.workflow import WorkflowDefinition, WorkflowNode\nfrom app_runtime.workflow.engine.hooks import WorkflowEngineHooks\nfrom app_runtime.workflow.engine.workflow_engine import WorkflowEngine\nfrom app_runtime.workflow.runtime_factory import WorkflowRuntimeFactory\n\n__all__ = [\n \"StepResult\",\n \"WorkflowContext\",\n \"WorkflowDefinition\",\n \"WorkflowEngine\",\n \"WorkflowEngineHooks\",\n \"WorkflowNode\",\n \"WorkflowRuntimeFactory\",\n \"WorkflowStep\",\n]", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/plba/workflow.py:1-18", - "span_start": 1, - "span_end": 18, - "lexical_rank": 6, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": null, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.plba.workflow", - "is_test": false, - "blob_sha": "f227797606042273d1f1798f76846952892eeb9e4e9e6a38fb8a631d7231ff39", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/config/__init__.py", - "content": "from app_runtime.config.file_loader import ConfigFileLoader\nfrom app_runtime.config.providers import FileConfigProvider\n\n__all__ = [\"ConfigFileLoader\", \"FileConfigProvider\"]", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/config/__init__.py:1-4", - "span_start": 1, - "span_end": 4, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": null, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.app_runtime.config.__init__", - "is_test": false, - "blob_sha": "612918029820a2a983330ec92256142b55b9de4bdf3399ece18e2a02dbad9729", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/config/providers.py", - "content": "class FileConfigProvider(ConfigProvider):\n def __init__(self, path: str | Path) -> None:\n self._loader = ConfigFileLoader(path)\n\n @property\n def loader(self) -> ConfigFileLoader:\n return self._loader\n\n def load(self) -> dict[str, Any]:\n config = self._loader.load_sync()\n if not isinstance(config, dict):\n raise TypeError(\"Config root must be a mapping\")\n return dict(config)", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/config/providers.py:FileConfigProvider", - "span_start": 10, - "span_end": 22, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": null, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.config.providers", - "is_test": false, - "blob_sha": "8c53ca0122d6df6c5763bca15e99434bb4daebd5a618b8fc927e9ae90b022e64", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/contracts/__init__.py", - "content": "__all__: list[str] = []", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/__init__.py:1-1", - "span_start": 1, - "span_end": 1, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": null, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.app_runtime.__init__", - "is_test": false, - "blob_sha": "8eea9df4f6d7b38ca0e39ccc27b04700e3d08dbeec8046d613d22706d19985fa", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/config/file_loader.py", - "content": "class ConfigFileLoader:\n def __init__(self, path: str | Path) -> None:\n self.path = Path(path)\n self.config: Any = None\n self.last_valid_config: Any = None\n self._last_seen_hash: str | None = None\n\n def read_text(self) -> str:\n return self.path.read_text(encoding=\"utf-8\")\n\n def parse(self, data: str) -> Any:\n suffix = self.path.suffix.lower()\n if suffix in {\".yml\", \".yaml\"}:\n return yaml.safe_load(data)\n return json.loads(data)\n\n def load_sync(self) -> Any:\n data = self.read_text()\n parsed = self.parse(data)\n self.config = parsed\n self.last_valid_config = parsed\n self._last_seen_hash = self._calculate_hash(data)\n return parsed\n\n def load_if_changed(self) -> tuple[bool, Any]:\n data = self.read_text()\n current_hash = self._calculate_hash(data)\n if current_hash == self._last_seen_hash:\n return False, self.config\n parsed = self.parse(data)\n self.config = parsed\n self.last_valid_config = parsed\n self._last_seen_hash = current_hash\n return True, parsed\n\n @staticmethod\n def _calculate_hash(data: str) -> str:\n return hashlib.sha256(data.encode(\"utf-8\")).hexdigest()", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/config/file_loader.py:ConfigFileLoader", - "span_start": 11, - "span_end": 48, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": null, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.config.file_loader", - "is_test": false, - "blob_sha": "1f19ffebde5e38e4be5a5d5a678059a0f36dedb8fb8b3e00ab395c67106a87ea", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/contracts/config.py", - "content": "class ConfigProvider(ABC):\n @abstractmethod\n def load(self) -> dict[str, Any]:\n \"\"\"Return a config fragment.\"\"\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/contracts/config.py:ConfigProvider", - "span_start": 7, - "span_end": 10, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": null, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.contracts.config", - "is_test": false, - "blob_sha": "5e773880267743ee94954ea2db120c2d88c54d4312893293d1b89df405283ed4", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/contracts/health.py", - "content": "class HealthContributor(ABC):\n @abstractmethod\n def health(self) -> WorkerHealth:\n \"\"\"Return contributor health state.\"\"\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/contracts/health.py:HealthContributor", - "span_start": 7, - "span_end": 10, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": null, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.contracts.health", - "is_test": false, - "blob_sha": "6bd92611def7131e32d4dd34a8ed85e6cf3c67722ad27797032a632cb30dc097", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/contracts/application.py", - "content": "class ApplicationModule(ABC):\n @property\n @abstractmethod\n def name(self) -> str:\n \"\"\"Module name used for runtime status and diagnostics.\"\"\"\n\n @abstractmethod\n def register(self, registry: ModuleRegistry) -> None:\n \"\"\"Register workers, services, and health contributors.\"\"\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/contracts/application.py:ApplicationModule", - "span_start": 8, - "span_end": 16, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": null, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.contracts.application", - "is_test": false, - "blob_sha": "197c35634dca49c352ce3f230295a485fbffb672ce7bb8c08e752bfdf61e7fa4", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "retrieval_report": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "vector", - "C2_DEPENDENCY_GRAPH": "vector", - "C0_SOURCE_CHUNKS": "vector" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C0_SOURCE_CHUNKS": 10 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [] - } - }, - "fallback": { - "used": false, - "reason": null - }, - "retrieval_by_layer_ms": { - "C1_SYMBOL_CATALOG": 31, - "C2_DEPENDENCY_GRAPH": 43, - "C0_SOURCE_CHUNKS": 16 - } - } - }, - "diagnostics": { - "intent_correct": null, - "target_found": true, - "layers_used": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ], - "retrieval_sufficient": false, - "answer_mode": "degraded", - "resolved_target": "WorkflowRuntimeFactory", - "answer_policy_branch": "evidence_gate_short_circuit", - "decision_reason": "tests_not_found", - "router_result": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "retrieval_profile": "code", - "sub_intent": "FIND_TESTS", - "path_scope": [], - "layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ], - "symbol_resolution_status": "resolved" - }, - "retrieval_request": { - "rag_session_id": "7d11da21-faa0-4cea-aede-aeabe069164c", - "query": "Где тесты для WorkflowRuntimeFactory?", - "sub_intent": "FIND_TESTS", - "path_scope": [], - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ] - }, - "per_layer_outcome": [ - { - "layer_id": "C1_SYMBOL_CATALOG", - "hit_count": 8, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C2_DEPENDENCY_GRAPH", - "hit_count": 6, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C0_SOURCE_CHUNKS", - "hit_count": 10, - "empty": false, - "fallback_used": false - } - ], - "empty_layers": [], - "evidence_gate_decision": { - "sufficient": false, - "failure_reasons": [ - "tests_not_found" - ], - "evidence_count": 24 - }, - "evidence_gate_input": { - "resolved_target": "WorkflowRuntimeFactory", - "sub_intent": "FIND_TESTS", - "target_type": "symbol", - "evidence_count": 24, - "code_chunk_count": 24, - "entrypoint_count": 0, - "relation_count": 6, - "test_evidence_count": 0, - "symbol_resolution_status": "resolved", - "path_scope": [] - }, - "post_evidence_gate": { - "input": { - "answer_mode": "degraded", - "draft_present": false, - "resolved_target": "WorkflowRuntimeFactory" - }, - "output": { - "reason": "no_draft_answer" - } - }, - "failure_reasons": [ - "tests_not_found" - ], - "timings_ms": { - "router": 1, - "retrieval": 91, - "pre_evidence_gate": 1, - "post_evidence_gate": 1 - } - }, - "rag_rows": [ - { - "path": "src/plba/__init__.py", - "content": "const WorkflowRuntimeFactory\nWorkflowRuntimeFactory = plba.workflow.WorkflowRuntimeFactory", - "layer": "C1_SYMBOL_CATALOG", - "title": "WorkflowRuntimeFactory", - "span_start": 21, - "span_end": 30, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "cb7c73db05c2622aac89114bed1cddd1d567de21cfac5c53037c62b1074b25c9", - "qname": "WorkflowRuntimeFactory", - "kind": "const", - "signature": "WorkflowRuntimeFactory = plba.workflow.WorkflowRuntimeFactory", - "parent_symbol_id": null, - "package_or_module": "src.plba.__init__", - "is_test": false, - "blob_sha": "24e755ec8c249d14fb0e675b5dbf2b71ab91afb9c849897eebfa9feb2499e19d", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/runtime_factory.py", - "content": "class WorkflowRuntimeFactory\nWorkflowRuntimeFactory", - "layer": "C1_SYMBOL_CATALOG", - "title": "WorkflowRuntimeFactory", - "span_start": 7, - "span_end": 19, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "9da827270329de64ebb426fadaaa5e35145e6666b92c6da186e08bf4b071f458", - "qname": "WorkflowRuntimeFactory", - "kind": "class", - "signature": "WorkflowRuntimeFactory", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.workflow.runtime_factory", - "is_test": false, - "blob_sha": "4d03c095f3082eb3ea8d558d65a785eb747fffd9c1383946e6c433bcedb7259a", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/workflow.py", - "content": "const WorkflowRuntimeFactory\nWorkflowRuntimeFactory = app_runtime.workflow.runtime_factory.WorkflowRuntimeFactory", - "layer": "C1_SYMBOL_CATALOG", - "title": "WorkflowRuntimeFactory", - "span_start": 7, - "span_end": 7, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "80865947d1ca709971efe9d68a9ee1f348c1c43d351bf4e1b4a5884d72985b6b", - "qname": "WorkflowRuntimeFactory", - "kind": "const", - "signature": "WorkflowRuntimeFactory = app_runtime.workflow.runtime_factory.WorkflowRuntimeFactory", - "parent_symbol_id": null, - "package_or_module": "src.plba.workflow", - "is_test": false, - "blob_sha": "f227797606042273d1f1798f76846952892eeb9e4e9e6a38fb8a631d7231ff39", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/runtime_factory.py", - "content": "method WorkflowRuntimeFactory.__init__\n__init__(self, connection_factory)", - "layer": "C1_SYMBOL_CATALOG", - "title": "WorkflowRuntimeFactory.__init__", - "span_start": 8, - "span_end": 12, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "d82a367758b2f7bcce3d351e576f25768b0afe8b915d01ace1c7d6380f14f52f", - "qname": "WorkflowRuntimeFactory.__init__", - "kind": "method", - "signature": "__init__(self, connection_factory)", - "parent_symbol_id": "WorkflowRuntimeFactory", - "package_or_module": "src.app_runtime.workflow.runtime_factory", - "is_test": false, - "blob_sha": "4d03c095f3082eb3ea8d558d65a785eb747fffd9c1383946e6c433bcedb7259a", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/runtime_factory.py", - "content": "method WorkflowRuntimeFactory.create_engine\ncreate_engine(self, workflow)", - "layer": "C1_SYMBOL_CATALOG", - "title": "WorkflowRuntimeFactory.create_engine", - "span_start": 14, - "span_end": 19, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "86f3a0bf3332952bf469e564748f16f1f7814ab51d5a963e5eb33de5e171b333", - "qname": "WorkflowRuntimeFactory.create_engine", - "kind": "method", - "signature": "create_engine(self, workflow)", - "parent_symbol_id": "WorkflowRuntimeFactory", - "package_or_module": "src.app_runtime.workflow.runtime_factory", - "is_test": false, - "blob_sha": "4d03c095f3082eb3ea8d558d65a785eb747fffd9c1383946e6c433bcedb7259a", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/runtime_factory.py", - "content": "const WorkflowPersistence\nWorkflowPersistence = app_runtime.workflow.persistence.WorkflowPersistence", - "layer": "C1_SYMBOL_CATALOG", - "title": "WorkflowPersistence", - "span_start": 4, - "span_end": 4, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "35693d37698e35079400b6a021d46209966ce469d9f77763d1c82d82ef4600b2", - "qname": "WorkflowPersistence", - "kind": "const", - "signature": "WorkflowPersistence = app_runtime.workflow.persistence.WorkflowPersistence", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.workflow.runtime_factory", - "is_test": false, - "blob_sha": "4d03c095f3082eb3ea8d558d65a785eb747fffd9c1383946e6c433bcedb7259a", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/runtime_factory.py", - "content": "const annotations\nannotations = __future__.annotations", - "layer": "C1_SYMBOL_CATALOG", - "title": "annotations", - "span_start": 1, - "span_end": 1, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "e016ec68f9d15d52fe0505774229fafc705c1bf3dfda78845a3db9b032a4441d", - "qname": "annotations", - "kind": "const", - "signature": "annotations = __future__.annotations", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.workflow.runtime_factory", - "is_test": false, - "blob_sha": "4d03c095f3082eb3ea8d558d65a785eb747fffd9c1383946e6c433bcedb7259a", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/runtime_factory.py", - "content": "const WorkflowEngine\nWorkflowEngine = app_runtime.workflow.engine.workflow_engine.WorkflowEngine", - "layer": "C1_SYMBOL_CATALOG", - "title": "WorkflowEngine", - "span_start": 3, - "span_end": 3, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "da4aee8bc7d248177fbc4f892732c6eb08baa6d268c32921a217747143a99fe0", - "qname": "WorkflowEngine", - "kind": "const", - "signature": "WorkflowEngine = app_runtime.workflow.engine.workflow_engine.WorkflowEngine", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.workflow.runtime_factory", - "is_test": false, - "blob_sha": "4d03c095f3082eb3ea8d558d65a785eb747fffd9c1383946e6c433bcedb7259a", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/runtime_factory.py", - "content": "WorkflowRuntimeFactory.__init__\n -> WorkflowRuntimeFactory._hooks\n -> WorkflowRuntimeFactory.create_engine", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "WorkflowRuntimeFactory.__init__:dataflow_slice", - "span_start": 11, - "span_end": 19, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "db6124c75b447e4a0a9ba267bd6d6cdf267b41a733b2843d724dd42ec6f4945d", - "edge_type": "dataflow_slice", - "src_symbol_id": "d82a367758b2f7bcce3d351e576f25768b0afe8b915d01ace1c7d6380f14f52f", - "src_qname": "WorkflowRuntimeFactory.__init__", - "dst_symbol_id": "86f3a0bf3332952bf469e564748f16f1f7814ab51d5a963e5eb33de5e171b333", - "dst_ref": "WorkflowRuntimeFactory.create_engine", - "resolution": "resolved", - "slice_id": "db6124c75b447e4a0a9ba267bd6d6cdf267b41a733b2843d724dd42ec6f4945d", - "root_symbol_id": "d82a367758b2f7bcce3d351e576f25768b0afe8b915d01ace1c7d6380f14f52f", - "path_symbols": [ - "WorkflowRuntimeFactory.__init__", - "WorkflowRuntimeFactory._hooks", - "WorkflowRuntimeFactory.create_engine" - ], - "path_symbol_ids": [ - "d82a367758b2f7bcce3d351e576f25768b0afe8b915d01ace1c7d6380f14f52f", - "86f3a0bf3332952bf469e564748f16f1f7814ab51d5a963e5eb33de5e171b333" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "4d03c095f3082eb3ea8d558d65a785eb747fffd9c1383946e6c433bcedb7259a", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/runtime_factory.py", - "content": "WorkflowRuntimeFactory.__init__\n -> WorkflowRuntimeFactory._snapshot_sanitizer\n -> WorkflowRuntimeFactory.create_engine", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "WorkflowRuntimeFactory.__init__:dataflow_slice", - "span_start": 12, - "span_end": 17, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "f46f5a871a3800b517b0f94ed2551392629e1d7920bc3e3b5a21e0d8f012b741", - "edge_type": "dataflow_slice", - "src_symbol_id": "d82a367758b2f7bcce3d351e576f25768b0afe8b915d01ace1c7d6380f14f52f", - "src_qname": "WorkflowRuntimeFactory.__init__", - "dst_symbol_id": "86f3a0bf3332952bf469e564748f16f1f7814ab51d5a963e5eb33de5e171b333", - "dst_ref": "WorkflowRuntimeFactory.create_engine", - "resolution": "resolved", - "slice_id": "f46f5a871a3800b517b0f94ed2551392629e1d7920bc3e3b5a21e0d8f012b741", - "root_symbol_id": "d82a367758b2f7bcce3d351e576f25768b0afe8b915d01ace1c7d6380f14f52f", - "path_symbols": [ - "WorkflowRuntimeFactory.__init__", - "WorkflowRuntimeFactory._snapshot_sanitizer", - "WorkflowRuntimeFactory.create_engine" - ], - "path_symbol_ids": [ - "d82a367758b2f7bcce3d351e576f25768b0afe8b915d01ace1c7d6380f14f52f", - "86f3a0bf3332952bf469e564748f16f1f7814ab51d5a963e5eb33de5e171b333" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "4d03c095f3082eb3ea8d558d65a785eb747fffd9c1383946e6c433bcedb7259a", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/runtime_factory.py", - "content": "WorkflowRuntimeFactory.__init__\n -> WorkflowRuntimeFactory._connection_factory\n -> WorkflowRuntimeFactory.create_engine", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "WorkflowRuntimeFactory.__init__:dataflow_slice", - "span_start": 9, - "span_end": 16, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "543624853400c556d1939007017145281d76b00a694c7d5c4fbb0414ded3434e", - "edge_type": "dataflow_slice", - "src_symbol_id": "d82a367758b2f7bcce3d351e576f25768b0afe8b915d01ace1c7d6380f14f52f", - "src_qname": "WorkflowRuntimeFactory.__init__", - "dst_symbol_id": "86f3a0bf3332952bf469e564748f16f1f7814ab51d5a963e5eb33de5e171b333", - "dst_ref": "WorkflowRuntimeFactory.create_engine", - "resolution": "resolved", - "slice_id": "543624853400c556d1939007017145281d76b00a694c7d5c4fbb0414ded3434e", - "root_symbol_id": "d82a367758b2f7bcce3d351e576f25768b0afe8b915d01ace1c7d6380f14f52f", - "path_symbols": [ - "WorkflowRuntimeFactory.__init__", - "WorkflowRuntimeFactory._connection_factory", - "WorkflowRuntimeFactory.create_engine" - ], - "path_symbol_ids": [ - "d82a367758b2f7bcce3d351e576f25768b0afe8b915d01ace1c7d6380f14f52f", - "86f3a0bf3332952bf469e564748f16f1f7814ab51d5a963e5eb33de5e171b333" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "4d03c095f3082eb3ea8d558d65a785eb747fffd9c1383946e6c433bcedb7259a", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/runtime_factory.py", - "content": "WorkflowRuntimeFactory.__init__\n -> WorkflowRuntimeFactory._traces\n -> WorkflowRuntimeFactory.create_engine", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "WorkflowRuntimeFactory.__init__:dataflow_slice", - "span_start": 10, - "span_end": 19, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "346cf5ddb4308b8403d27c5b54da8cba298bb0af7dc04c2fe30312ef574103c6", - "edge_type": "dataflow_slice", - "src_symbol_id": "d82a367758b2f7bcce3d351e576f25768b0afe8b915d01ace1c7d6380f14f52f", - "src_qname": "WorkflowRuntimeFactory.__init__", - "dst_symbol_id": "86f3a0bf3332952bf469e564748f16f1f7814ab51d5a963e5eb33de5e171b333", - "dst_ref": "WorkflowRuntimeFactory.create_engine", - "resolution": "resolved", - "slice_id": "346cf5ddb4308b8403d27c5b54da8cba298bb0af7dc04c2fe30312ef574103c6", - "root_symbol_id": "d82a367758b2f7bcce3d351e576f25768b0afe8b915d01ace1c7d6380f14f52f", - "path_symbols": [ - "WorkflowRuntimeFactory.__init__", - "WorkflowRuntimeFactory._traces", - "WorkflowRuntimeFactory.create_engine" - ], - "path_symbol_ids": [ - "d82a367758b2f7bcce3d351e576f25768b0afe8b915d01ace1c7d6380f14f52f", - "86f3a0bf3332952bf469e564748f16f1f7814ab51d5a963e5eb33de5e171b333" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "4d03c095f3082eb3ea8d558d65a785eb747fffd9c1383946e6c433bcedb7259a", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/runtime_factory.py", - "content": "WorkflowRuntimeFactory.__init__ writes_attr WorkflowRuntimeFactory._snapshot_sanitizer", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "WorkflowRuntimeFactory.__init__:writes_attr", - "span_start": 12, - "span_end": 12, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "de0cb1913ba41f673cfb601cab23cfb2e1044ed3dd8c061aff486075aeb8af20", - "edge_type": "writes_attr", - "src_symbol_id": "d82a367758b2f7bcce3d351e576f25768b0afe8b915d01ace1c7d6380f14f52f", - "src_qname": "WorkflowRuntimeFactory.__init__", - "dst_symbol_id": null, - "dst_ref": "WorkflowRuntimeFactory._snapshot_sanitizer", - "resolution": "partial", - "is_test": false, - "blob_sha": "4d03c095f3082eb3ea8d558d65a785eb747fffd9c1383946e6c433bcedb7259a", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/runtime_factory.py", - "content": "WorkflowRuntimeFactory.create_engine calls WorkflowPersistence.create_default", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "WorkflowRuntimeFactory.create_engine:calls", - "span_start": 15, - "span_end": 18, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "fa86efb6871092fc88df68295c0d92dbe46253e1afa3246ca62b6da11d4d5569", - "edge_type": "calls", - "src_symbol_id": "86f3a0bf3332952bf469e564748f16f1f7814ab51d5a963e5eb33de5e171b333", - "src_qname": "WorkflowRuntimeFactory.create_engine", - "dst_symbol_id": null, - "dst_ref": "WorkflowPersistence.create_default", - "resolution": "partial", - "is_test": false, - "blob_sha": "4d03c095f3082eb3ea8d558d65a785eb747fffd9c1383946e6c433bcedb7259a", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/runtime_factory.py", - "content": "class WorkflowRuntimeFactory:\n def __init__(self, connection_factory=None, *, traces, hooks=None, snapshot_sanitizer=None) -> None:\n self._connection_factory = connection_factory\n self._traces = traces\n self._hooks = hooks\n self._snapshot_sanitizer = snapshot_sanitizer\n\n def create_engine(self, workflow) -> WorkflowEngine:\n persistence = WorkflowPersistence.create_default(\n self._connection_factory,\n snapshot_sanitizer=self._snapshot_sanitizer,\n )\n return WorkflowEngine(workflow, persistence, traces=self._traces, hooks=self._hooks)", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/workflow/runtime_factory.py:WorkflowRuntimeFactory", - "span_start": 7, - "span_end": 19, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.workflow.runtime_factory", - "is_test": false, - "blob_sha": "4d03c095f3082eb3ea8d558d65a785eb747fffd9c1383946e6c433bcedb7259a", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/__init__.py", - "content": "from plba.bootstrap import create_runtime\nfrom plba.config import ConfigFileLoader, FileConfigProvider\nfrom plba.control import ControlActionSet, ControlChannel, ControlPlaneService, HttpControlChannel\nfrom plba.contracts import (\n ApplicationModule,\n ConfigProvider,\n HealthContributor,\n TraceContext,\n TraceContextRecord,\n TraceLogMessage,\n TraceTransport,\n Worker,\n WorkerHealth,\n WorkerStatus,\n)\nfrom plba.core import ConfigurationManager, RuntimeManager, ServiceContainer\nfrom plba.health import HealthRegistry\nfrom plba.logging import LogManager\nfrom plba.queue import InMemoryTaskQueue\nfrom plba.tracing import MySqlTraceTransport, NoOpTraceTransport, TraceService\nfrom plba.workflow import (\n StepResult,\n WorkflowContext,\n WorkflowDefinition,\n WorkflowEngine,\n WorkflowEngineHooks,\n WorkflowNode,\n WorkflowRuntimeFactory,\n WorkflowStep,\n)\nfrom plba.workers import WorkerSupervisor\n\n__all__ = [\n \"ApplicationModule\",\n \"ConfigFileLoader\",\n \"ConfigProvider\",\n \"ConfigurationManager\",\n \"ControlActionSet\",\n \"ControlChannel\",\n \"ControlPlaneService\",\n \"create_runtime\",\n \"FileConfigProvider\",\n \"HealthContributor\",\n \"HealthRegistry\",\n \"HttpControlChannel\",\n \"InMemoryTaskQueue\",\n \"LogManager\",\n \"MySqlTraceTransport\",\n \"NoOpTraceTransport\",\n \"RuntimeManager\",\n \"ServiceContainer\",\n \"TraceContext\",\n \"TraceContextRecord\",\n \"TraceLogMessage\",\n \"TraceService\",\n \"TraceTransport\",\n \"StepResult\",\n \"Worker\",\n \"WorkerHealth\",\n \"WorkerStatus\",\n \"WorkflowContext\",\n \"WorkflowDefinition\",\n \"WorkflowEngine\",\n \"WorkflowEngineHooks\",\n \"WorkflowNode\",\n \"WorkflowRuntimeFactory\",\n \"WorkflowStep\",\n \"WorkerSupervisor\",\n]", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/plba/__init__.py:1-69", - "span_start": 1, - "span_end": 69, - "lexical_rank": 6, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.plba.__init__", - "is_test": false, - "blob_sha": "24e755ec8c249d14fb0e675b5dbf2b71ab91afb9c849897eebfa9feb2499e19d", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/workflow.py", - "content": "from app_runtime.workflow.contracts.context import WorkflowContext\nfrom app_runtime.workflow.contracts.result import StepResult\nfrom app_runtime.workflow.contracts.step import WorkflowStep\nfrom app_runtime.workflow.contracts.workflow import WorkflowDefinition, WorkflowNode\nfrom app_runtime.workflow.engine.hooks import WorkflowEngineHooks\nfrom app_runtime.workflow.engine.workflow_engine import WorkflowEngine\nfrom app_runtime.workflow.runtime_factory import WorkflowRuntimeFactory\n\n__all__ = [\n \"StepResult\",\n \"WorkflowContext\",\n \"WorkflowDefinition\",\n \"WorkflowEngine\",\n \"WorkflowEngineHooks\",\n \"WorkflowNode\",\n \"WorkflowRuntimeFactory\",\n \"WorkflowStep\",\n]", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/plba/workflow.py:1-18", - "span_start": 1, - "span_end": 18, - "lexical_rank": 6, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.plba.workflow", - "is_test": false, - "blob_sha": "f227797606042273d1f1798f76846952892eeb9e4e9e6a38fb8a631d7231ff39", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/config/__init__.py", - "content": "from app_runtime.config.file_loader import ConfigFileLoader\nfrom app_runtime.config.providers import FileConfigProvider\n\n__all__ = [\"ConfigFileLoader\", \"FileConfigProvider\"]", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/config/__init__.py:1-4", - "span_start": 1, - "span_end": 4, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.app_runtime.config.__init__", - "is_test": false, - "blob_sha": "612918029820a2a983330ec92256142b55b9de4bdf3399ece18e2a02dbad9729", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/config/providers.py", - "content": "class FileConfigProvider(ConfigProvider):\n def __init__(self, path: str | Path) -> None:\n self._loader = ConfigFileLoader(path)\n\n @property\n def loader(self) -> ConfigFileLoader:\n return self._loader\n\n def load(self) -> dict[str, Any]:\n config = self._loader.load_sync()\n if not isinstance(config, dict):\n raise TypeError(\"Config root must be a mapping\")\n return dict(config)", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/config/providers.py:FileConfigProvider", - "span_start": 10, - "span_end": 22, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.config.providers", - "is_test": false, - "blob_sha": "8c53ca0122d6df6c5763bca15e99434bb4daebd5a618b8fc927e9ae90b022e64", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/contracts/__init__.py", - "content": "__all__: list[str] = []", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/__init__.py:1-1", - "span_start": 1, - "span_end": 1, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.app_runtime.__init__", - "is_test": false, - "blob_sha": "8eea9df4f6d7b38ca0e39ccc27b04700e3d08dbeec8046d613d22706d19985fa", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/config/file_loader.py", - "content": "class ConfigFileLoader:\n def __init__(self, path: str | Path) -> None:\n self.path = Path(path)\n self.config: Any = None\n self.last_valid_config: Any = None\n self._last_seen_hash: str | None = None\n\n def read_text(self) -> str:\n return self.path.read_text(encoding=\"utf-8\")\n\n def parse(self, data: str) -> Any:\n suffix = self.path.suffix.lower()\n if suffix in {\".yml\", \".yaml\"}:\n return yaml.safe_load(data)\n return json.loads(data)\n\n def load_sync(self) -> Any:\n data = self.read_text()\n parsed = self.parse(data)\n self.config = parsed\n self.last_valid_config = parsed\n self._last_seen_hash = self._calculate_hash(data)\n return parsed\n\n def load_if_changed(self) -> tuple[bool, Any]:\n data = self.read_text()\n current_hash = self._calculate_hash(data)\n if current_hash == self._last_seen_hash:\n return False, self.config\n parsed = self.parse(data)\n self.config = parsed\n self.last_valid_config = parsed\n self._last_seen_hash = current_hash\n return True, parsed\n\n @staticmethod\n def _calculate_hash(data: str) -> str:\n return hashlib.sha256(data.encode(\"utf-8\")).hexdigest()", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/config/file_loader.py:ConfigFileLoader", - "span_start": 11, - "span_end": 48, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.config.file_loader", - "is_test": false, - "blob_sha": "1f19ffebde5e38e4be5a5d5a678059a0f36dedb8fb8b3e00ab395c67106a87ea", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/contracts/config.py", - "content": "class ConfigProvider(ABC):\n @abstractmethod\n def load(self) -> dict[str, Any]:\n \"\"\"Return a config fragment.\"\"\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/contracts/config.py:ConfigProvider", - "span_start": 7, - "span_end": 10, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.contracts.config", - "is_test": false, - "blob_sha": "5e773880267743ee94954ea2db120c2d88c54d4312893293d1b89df405283ed4", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/contracts/health.py", - "content": "class HealthContributor(ABC):\n @abstractmethod\n def health(self) -> WorkerHealth:\n \"\"\"Return contributor health state.\"\"\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/contracts/health.py:HealthContributor", - "span_start": 7, - "span_end": 10, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.contracts.health", - "is_test": false, - "blob_sha": "6bd92611def7131e32d4dd34a8ed85e6cf3c67722ad27797032a632cb30dc097", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/contracts/application.py", - "content": "class ApplicationModule(ABC):\n @property\n @abstractmethod\n def name(self) -> str:\n \"\"\"Module name used for runtime status and diagnostics.\"\"\"\n\n @abstractmethod\n def register(self, registry: ModuleRegistry) -> None:\n \"\"\"Register workers, services, and health contributors.\"\"\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/contracts/application.py:ApplicationModule", - "span_start": 8, - "span_end": 16, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.contracts.application", - "is_test": false, - "blob_sha": "197c35634dca49c352ce3f230295a485fbffb672ce7bb8c08e752bfdf61e7fa4", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "validation": { - "passed": false, - "action": "repair", - "reasons": [ - "degraded_answer_missing_guardrail" - ] - }, - "steps": [ - { - "step": "router", - "status": "completed", - "timings_ms": { - "router": 1 - }, - "output": { - "intent": "CODE_QA", - "sub_intent": "FIND_TESTS", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - } - }, - { - "step": "retrieval", - "status": "completed", - "timings_ms": { - "retrieval": 91 - }, - "output": { - "rag_count": 24, - "answer_path_rag_count": 24, - "resolved_symbol_status": "resolved", - "resolved_symbol": "WorkflowRuntimeFactory", - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ] - }, - "diagnostics": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "vector", - "C2_DEPENDENCY_GRAPH": "vector", - "C0_SOURCE_CHUNKS": "vector" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C0_SOURCE_CHUNKS": 10 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [] - } - }, - "fallback": { - "used": false, - "reason": null - }, - "retrieval_by_layer_ms": { - "C1_SYMBOL_CATALOG": 31, - "C2_DEPENDENCY_GRAPH": 43, - "C0_SOURCE_CHUNKS": 16 - } - } - }, - { - "step": "pre_evidence_gate", - "status": "blocked", - "timings_ms": { - "pre_evidence_gate": 1 - }, - "input": { - "resolved_target": "WorkflowRuntimeFactory", - "sub_intent": "FIND_TESTS", - "target_type": "symbol", - "evidence_count": 24, - "code_chunk_count": 24, - "entrypoint_count": 0, - "relation_count": 6, - "test_evidence_count": 0, - "symbol_resolution_status": "resolved", - "path_scope": [] - }, - "output": { - "passed": false, - "failure_reasons": [ - "tests_not_found" - ], - "degraded_message": "Insufficient evidence for a confident answer. No test candidates found.", - "evidence_count": 24 - } - }, - { - "step": "llm", - "status": "skipped", - "timings_ms": { - "llm": 1 - }, - "output": { - "reason": "policy_short_circuit", - "answer_mode": "degraded", - "decision_reason": "tests_not_found", - "answer_policy_branch": "evidence_gate_short_circuit" - } - }, - { - "step": "post_evidence_gate", - "status": "skipped", - "timings_ms": { - "post_evidence_gate": 1 - }, - "input": { - "answer_mode": "degraded", - "draft_present": false, - "resolved_target": "WorkflowRuntimeFactory" - }, - "output": { - "reason": "no_draft_answer" - } - } - ] - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/plba_full_chain_subintents_v3/20260312_192715/full_chain_plba_code_subintents_v2_plba-v2-find-tests-workflow-runtime-factory-negative.md b/tests/pipeline_setup_v3/test_results/plba_full_chain_subintents_v3/20260312_192715/full_chain_plba_code_subintents_v2_plba-v2-find-tests-workflow-runtime-factory-negative.md deleted file mode 100644 index aa1031c..0000000 --- a/tests/pipeline_setup_v3/test_results/plba_full_chain_subintents_v3/20260312_192715/full_chain_plba_code_subintents_v2_plba-v2-find-tests-workflow-runtime-factory-negative.md +++ /dev/null @@ -1,259 +0,0 @@ -# plba-v2-find-tests-workflow-runtime-factory-negative - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_02_pipeline/full_chain_plba_code_subintents_v2.yaml -- runner: agent_runtime -- mode: full_chain -- passed: True - -## Query -Где тесты для WorkflowRuntimeFactory? - -## Actual -{ - "intent": "CODE_QA", - "sub_intent": "FIND_TESTS", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 24, - "llm_answer": "Insufficient evidence for a confident answer. No test candidates found.", - "answer_mode": "degraded", - "path_scope": [], - "symbol_candidates": [ - "WorkflowRuntimeFactory" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ] -} - -## Steps -[ - { - "step": "router", - "status": "completed", - "timings_ms": { - "router": 1 - }, - "output": { - "intent": "CODE_QA", - "sub_intent": "FIND_TESTS", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - } - }, - { - "step": "retrieval", - "status": "completed", - "timings_ms": { - "retrieval": 91 - }, - "output": { - "rag_count": 24, - "answer_path_rag_count": 24, - "resolved_symbol_status": "resolved", - "resolved_symbol": "WorkflowRuntimeFactory", - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ] - }, - "diagnostics": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "vector", - "C2_DEPENDENCY_GRAPH": "vector", - "C0_SOURCE_CHUNKS": "vector" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C0_SOURCE_CHUNKS": 10 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [] - } - }, - "fallback": { - "used": false, - "reason": null - }, - "retrieval_by_layer_ms": { - "C1_SYMBOL_CATALOG": 31, - "C2_DEPENDENCY_GRAPH": 43, - "C0_SOURCE_CHUNKS": 16 - } - } - }, - { - "step": "pre_evidence_gate", - "status": "blocked", - "timings_ms": { - "pre_evidence_gate": 1 - }, - "input": { - "resolved_target": "WorkflowRuntimeFactory", - "sub_intent": "FIND_TESTS", - "target_type": "symbol", - "evidence_count": 24, - "code_chunk_count": 24, - "entrypoint_count": 0, - "relation_count": 6, - "test_evidence_count": 0, - "symbol_resolution_status": "resolved", - "path_scope": [] - }, - "output": { - "passed": false, - "failure_reasons": [ - "tests_not_found" - ], - "degraded_message": "Insufficient evidence for a confident answer. No test candidates found.", - "evidence_count": 24 - } - }, - { - "step": "llm", - "status": "skipped", - "timings_ms": { - "llm": 1 - }, - "output": { - "reason": "policy_short_circuit", - "answer_mode": "degraded", - "decision_reason": "tests_not_found", - "answer_policy_branch": "evidence_gate_short_circuit" - } - }, - { - "step": "post_evidence_gate", - "status": "skipped", - "timings_ms": { - "post_evidence_gate": 1 - }, - "input": { - "answer_mode": "degraded", - "draft_present": false, - "resolved_target": "WorkflowRuntimeFactory" - }, - "output": { - "reason": "no_draft_answer" - } - } -] - -## Diagnostics -{ - "intent_correct": null, - "target_found": true, - "layers_used": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ], - "retrieval_sufficient": false, - "answer_mode": "degraded", - "resolved_target": "WorkflowRuntimeFactory", - "answer_policy_branch": "evidence_gate_short_circuit", - "decision_reason": "tests_not_found", - "router_result": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "retrieval_profile": "code", - "sub_intent": "FIND_TESTS", - "path_scope": [], - "layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ], - "symbol_resolution_status": "resolved" - }, - "retrieval_request": { - "rag_session_id": "7d11da21-faa0-4cea-aede-aeabe069164c", - "query": "Где тесты для WorkflowRuntimeFactory?", - "sub_intent": "FIND_TESTS", - "path_scope": [], - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C2_DEPENDENCY_GRAPH", - "C0_SOURCE_CHUNKS" - ] - }, - "per_layer_outcome": [ - { - "layer_id": "C1_SYMBOL_CATALOG", - "hit_count": 8, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C2_DEPENDENCY_GRAPH", - "hit_count": 6, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C0_SOURCE_CHUNKS", - "hit_count": 10, - "empty": false, - "fallback_used": false - } - ], - "empty_layers": [], - "evidence_gate_decision": { - "sufficient": false, - "failure_reasons": [ - "tests_not_found" - ], - "evidence_count": 24 - }, - "evidence_gate_input": { - "resolved_target": "WorkflowRuntimeFactory", - "sub_intent": "FIND_TESTS", - "target_type": "symbol", - "evidence_count": 24, - "code_chunk_count": 24, - "entrypoint_count": 0, - "relation_count": 6, - "test_evidence_count": 0, - "symbol_resolution_status": "resolved", - "path_scope": [] - }, - "post_evidence_gate": { - "input": { - "answer_mode": "degraded", - "draft_present": false, - "resolved_target": "WorkflowRuntimeFactory" - }, - "output": { - "reason": "no_draft_answer" - } - }, - "failure_reasons": [ - "tests_not_found" - ], - "timings_ms": { - "router": 1, - "retrieval": 91, - "pre_evidence_gate": 1, - "post_evidence_gate": 1 - } -} - -## Mismatches -- none \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/plba_full_chain_subintents_v3/20260312_192715/full_chain_plba_code_subintents_v2_plba-v2-open-file-nonexistent.json b/tests/pipeline_setup_v3/test_results/plba_full_chain_subintents_v3/20260312_192715/full_chain_plba_code_subintents_v2_plba-v2-open-file-nonexistent.json deleted file mode 100644 index e84eb84..0000000 --- a/tests/pipeline_setup_v3/test_results/plba_full_chain_subintents_v3/20260312_192715/full_chain_plba_code_subintents_v2_plba-v2-open-file-nonexistent.json +++ /dev/null @@ -1,492 +0,0 @@ -{ - "case_id": "plba-v2-open-file-nonexistent", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_02_pipeline/full_chain_plba_code_subintents_v2.yaml", - "runner": "agent_runtime", - "mode": "full_chain", - "query": "Открой файл src/app_runtime/core/missing_runtime.py", - "actual": { - "intent": "CODE_QA", - "sub_intent": "OPEN_FILE", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 0, - "llm_answer": "Файл src/app_runtime/core/missing_runtime.py не найден.", - "answer_mode": "not_found", - "path_scope": [ - "src/app_runtime/core/missing_runtime.py" - ], - "symbol_candidates": [], - "layers": [ - "C0_SOURCE_CHUNKS" - ] - }, - "passed": true, - "mismatches": [], - "details": { - "query": "Открой файл src/app_runtime/core/missing_runtime.py", - "router_result": { - "schema_version": "1.1", - "intent": "CODE_QA", - "retrieval_profile": "code", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query_plan": { - "raw": "Открой файл src/app_runtime/core/missing_runtime.py", - "normalized": "Открой файл src/app_runtime/core/missing_runtime.py", - "sub_intent": "OPEN_FILE", - "negations": [], - "expansions": [ - "file" - ], - "keyword_hints": [], - "path_hints": [ - "src/app_runtime/core/missing_runtime.py" - ], - "doc_scope_hints": [], - "symbol_candidates": [], - "symbol_kind_hint": "unknown", - "anchors": [ - { - "type": "FILE_PATH", - "value": "src/app_runtime/core/missing_runtime.py", - "source": "user_text", - "subtype": null, - "span": { - "start": 12, - "end": 51 - }, - "confidence": 0.95 - }, - { - "type": "KEY_TERM", - "value": "файл", - "source": "user_text", - "subtype": null, - "span": { - "start": 7, - "end": 11 - }, - "confidence": 0.9 - } - ] - }, - "retrieval_spec": { - "domains": [ - "CODE" - ], - "layer_queries": [ - { - "layer_id": "C0_SOURCE_CHUNKS", - "top_k": 12 - } - ], - "filters": { - "test_policy": "EXCLUDE", - "path_scope": [ - "src/app_runtime/core/missing_runtime.py" - ], - "language": [ - "python" - ] - }, - "rerank_profile": "code" - }, - "retrieval_constraints": { - "include_globs": [ - "src/app_runtime/core/missing_runtime.py" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": false, - "max_distance": 2, - "top_k": 5 - } - }, - "symbol_resolution": { - "status": "not_requested", - "resolved_symbol": null, - "alternatives": [], - "confidence": 0.0 - }, - "evidence_policy": { - "require_def": false, - "require_flow": false, - "require_spec": false, - "allow_answer_without_evidence": false - } - }, - "retrieval_request": { - "rag_session_id": "7d11da21-faa0-4cea-aede-aeabe069164c", - "query": "Открой файл src/app_runtime/core/missing_runtime.py", - "sub_intent": "OPEN_FILE", - "path_scope": [ - "src/app_runtime/core/missing_runtime.py" - ], - "keyword_hints": [], - "symbol_candidates": [], - "requested_layers": [ - "C0_SOURCE_CHUNKS" - ], - "retrieval_spec": { - "domains": [ - "CODE" - ], - "layer_queries": [ - { - "layer_id": "C0_SOURCE_CHUNKS", - "top_k": 12 - } - ], - "filters": { - "test_policy": "EXCLUDE", - "path_scope": [ - "src/app_runtime/core/missing_runtime.py" - ], - "language": [ - "python" - ] - }, - "rerank_profile": "code" - }, - "retrieval_constraints": { - "include_globs": [ - "src/app_runtime/core/missing_runtime.py" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": false, - "max_distance": 2, - "top_k": 5 - } - }, - "query_plan": { - "raw": "Открой файл src/app_runtime/core/missing_runtime.py", - "normalized": "Открой файл src/app_runtime/core/missing_runtime.py", - "sub_intent": "OPEN_FILE", - "negations": [], - "expansions": [ - "file" - ], - "keyword_hints": [], - "path_hints": [ - "src/app_runtime/core/missing_runtime.py" - ], - "doc_scope_hints": [], - "symbol_candidates": [], - "symbol_kind_hint": "unknown", - "anchors": [ - { - "type": "FILE_PATH", - "value": "src/app_runtime/core/missing_runtime.py", - "source": "user_text", - "subtype": null, - "span": { - "start": 12, - "end": 51 - }, - "confidence": 0.95 - }, - { - "type": "KEY_TERM", - "value": "файл", - "source": "user_text", - "subtype": null, - "span": { - "start": 7, - "end": 11 - }, - "confidence": 0.9 - } - ] - } - }, - "retrieval_result": { - "target_symbol_candidates": [], - "resolved_symbol": null, - "symbol_resolution_status": "not_requested", - "file_candidates": [], - "code_chunks": [], - "relations": [], - "semantic_hints": [], - "entrypoints": [], - "test_candidates": [], - "layer_outcomes": [ - { - "layer_id": "C0_SOURCE_CHUNKS", - "hit_count": 0, - "empty": true, - "fallback_used": false - } - ], - "missing_layers": [ - "C0_SOURCE_CHUNKS" - ], - "raw_rows": [], - "retrieval_report": { - "executed_layers": [ - "C0_SOURCE_CHUNKS" - ], - "retrieval_mode_by_layer": { - "C0_SOURCE_CHUNKS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C0_SOURCE_CHUNKS": 200 - }, - "filters_by_layer": { - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src/app_runtime/core/missing_runtime.py" - ] - } - }, - "requests": [ - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Открой файл src/app_runtime/core/missing_runtime.py", - "ranking_profile": "code" - } - ], - "fallback": { - "used": false, - "reason": null - }, - "retrieval_by_layer_ms": { - "C0_SOURCE_CHUNKS": 14 - } - } - }, - "diagnostics": { - "intent_correct": null, - "target_found": false, - "layers_used": [ - "C0_SOURCE_CHUNKS" - ], - "retrieval_sufficient": false, - "answer_mode": "insufficient", - "resolved_target": "src/app_runtime/core/missing_runtime.py", - "answer_policy_branch": "open_file_not_found", - "decision_reason": "path_scope_empty", - "router_result": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "retrieval_profile": "code", - "sub_intent": "OPEN_FILE", - "path_scope": [ - "src/app_runtime/core/missing_runtime.py" - ], - "layers": [ - "C0_SOURCE_CHUNKS" - ], - "symbol_resolution_status": "not_requested" - }, - "retrieval_request": { - "rag_session_id": "7d11da21-faa0-4cea-aede-aeabe069164c", - "query": "Открой файл src/app_runtime/core/missing_runtime.py", - "sub_intent": "OPEN_FILE", - "path_scope": [ - "src/app_runtime/core/missing_runtime.py" - ], - "requested_layers": [ - "C0_SOURCE_CHUNKS" - ] - }, - "per_layer_outcome": [ - { - "layer_id": "C0_SOURCE_CHUNKS", - "hit_count": 0, - "empty": true, - "fallback_used": false - } - ], - "empty_layers": [ - "C0_SOURCE_CHUNKS" - ], - "evidence_gate_decision": { - "sufficient": false, - "failure_reasons": [ - "path_scope_empty", - "layer_c0_empty" - ], - "evidence_count": 0 - }, - "evidence_gate_input": { - "resolved_target": "src/app_runtime/core/missing_runtime.py", - "sub_intent": "OPEN_FILE", - "target_type": "none", - "evidence_count": 0, - "code_chunk_count": 0, - "entrypoint_count": 0, - "relation_count": 0, - "test_evidence_count": 0, - "symbol_resolution_status": "not_requested", - "path_scope": [ - "src/app_runtime/core/missing_runtime.py" - ] - }, - "post_evidence_gate": { - "input": { - "answer_mode": "not_found", - "draft_present": false, - "resolved_target": "src/app_runtime/core/missing_runtime.py" - }, - "output": { - "reason": "no_draft_answer" - } - }, - "failure_reasons": [ - "path_scope_empty", - "layer_c0_empty" - ], - "timings_ms": { - "router": 1, - "retrieval": 15, - "pre_evidence_gate": 1, - "post_evidence_gate": 1 - } - }, - "rag_rows": [], - "validation": { - "passed": true, - "action": "return", - "reasons": [] - }, - "steps": [ - { - "step": "router", - "status": "completed", - "timings_ms": { - "router": 1 - }, - "output": { - "intent": "CODE_QA", - "sub_intent": "OPEN_FILE", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - } - }, - { - "step": "retrieval", - "status": "completed", - "timings_ms": { - "retrieval": 15 - }, - "output": { - "rag_count": 0, - "answer_path_rag_count": 0, - "resolved_symbol_status": "not_requested", - "resolved_symbol": null, - "requested_layers": [ - "C0_SOURCE_CHUNKS" - ] - }, - "diagnostics": { - "executed_layers": [ - "C0_SOURCE_CHUNKS" - ], - "retrieval_mode_by_layer": { - "C0_SOURCE_CHUNKS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C0_SOURCE_CHUNKS": 200 - }, - "filters_by_layer": { - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src/app_runtime/core/missing_runtime.py" - ] - } - }, - "requests": [ - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Открой файл src/app_runtime/core/missing_runtime.py", - "ranking_profile": "code" - } - ], - "fallback": { - "used": false, - "reason": null - }, - "retrieval_by_layer_ms": { - "C0_SOURCE_CHUNKS": 14 - } - } - }, - { - "step": "pre_evidence_gate", - "status": "blocked", - "timings_ms": { - "pre_evidence_gate": 1 - }, - "input": { - "resolved_target": "src/app_runtime/core/missing_runtime.py", - "sub_intent": "OPEN_FILE", - "target_type": "none", - "evidence_count": 0, - "code_chunk_count": 0, - "entrypoint_count": 0, - "relation_count": 0, - "test_evidence_count": 0, - "symbol_resolution_status": "not_requested", - "path_scope": [ - "src/app_runtime/core/missing_runtime.py" - ] - }, - "output": { - "passed": false, - "failure_reasons": [ - "path_scope_empty", - "layer_c0_empty" - ], - "degraded_message": "Insufficient evidence for a confident answer. No matching path or file found. No code chunks retrieved.", - "evidence_count": 0 - } - }, - { - "step": "llm", - "status": "skipped", - "timings_ms": { - "llm": 1 - }, - "output": { - "reason": "policy_short_circuit", - "answer_mode": "not_found", - "decision_reason": "path_scope_empty", - "answer_policy_branch": "open_file_not_found" - } - }, - { - "step": "post_evidence_gate", - "status": "skipped", - "timings_ms": { - "post_evidence_gate": 1 - }, - "input": { - "answer_mode": "not_found", - "draft_present": false, - "resolved_target": "src/app_runtime/core/missing_runtime.py" - }, - "output": { - "reason": "no_draft_answer" - } - } - ] - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/plba_full_chain_subintents_v3/20260312_192715/full_chain_plba_code_subintents_v2_plba-v2-open-file-nonexistent.md b/tests/pipeline_setup_v3/test_results/plba_full_chain_subintents_v3/20260312_192715/full_chain_plba_code_subintents_v2_plba-v2-open-file-nonexistent.md deleted file mode 100644 index 8f60590..0000000 --- a/tests/pipeline_setup_v3/test_results/plba_full_chain_subintents_v3/20260312_192715/full_chain_plba_code_subintents_v2_plba-v2-open-file-nonexistent.md +++ /dev/null @@ -1,245 +0,0 @@ -# plba-v2-open-file-nonexistent - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_02_pipeline/full_chain_plba_code_subintents_v2.yaml -- runner: agent_runtime -- mode: full_chain -- passed: True - -## Query -Открой файл src/app_runtime/core/missing_runtime.py - -## Actual -{ - "intent": "CODE_QA", - "sub_intent": "OPEN_FILE", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 0, - "llm_answer": "Файл src/app_runtime/core/missing_runtime.py не найден.", - "answer_mode": "not_found", - "path_scope": [ - "src/app_runtime/core/missing_runtime.py" - ], - "symbol_candidates": [], - "layers": [ - "C0_SOURCE_CHUNKS" - ] -} - -## Steps -[ - { - "step": "router", - "status": "completed", - "timings_ms": { - "router": 1 - }, - "output": { - "intent": "CODE_QA", - "sub_intent": "OPEN_FILE", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - } - }, - { - "step": "retrieval", - "status": "completed", - "timings_ms": { - "retrieval": 15 - }, - "output": { - "rag_count": 0, - "answer_path_rag_count": 0, - "resolved_symbol_status": "not_requested", - "resolved_symbol": null, - "requested_layers": [ - "C0_SOURCE_CHUNKS" - ] - }, - "diagnostics": { - "executed_layers": [ - "C0_SOURCE_CHUNKS" - ], - "retrieval_mode_by_layer": { - "C0_SOURCE_CHUNKS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C0_SOURCE_CHUNKS": 200 - }, - "filters_by_layer": { - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src/app_runtime/core/missing_runtime.py" - ] - } - }, - "requests": [ - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Открой файл src/app_runtime/core/missing_runtime.py", - "ranking_profile": "code" - } - ], - "fallback": { - "used": false, - "reason": null - }, - "retrieval_by_layer_ms": { - "C0_SOURCE_CHUNKS": 14 - } - } - }, - { - "step": "pre_evidence_gate", - "status": "blocked", - "timings_ms": { - "pre_evidence_gate": 1 - }, - "input": { - "resolved_target": "src/app_runtime/core/missing_runtime.py", - "sub_intent": "OPEN_FILE", - "target_type": "none", - "evidence_count": 0, - "code_chunk_count": 0, - "entrypoint_count": 0, - "relation_count": 0, - "test_evidence_count": 0, - "symbol_resolution_status": "not_requested", - "path_scope": [ - "src/app_runtime/core/missing_runtime.py" - ] - }, - "output": { - "passed": false, - "failure_reasons": [ - "path_scope_empty", - "layer_c0_empty" - ], - "degraded_message": "Insufficient evidence for a confident answer. No matching path or file found. No code chunks retrieved.", - "evidence_count": 0 - } - }, - { - "step": "llm", - "status": "skipped", - "timings_ms": { - "llm": 1 - }, - "output": { - "reason": "policy_short_circuit", - "answer_mode": "not_found", - "decision_reason": "path_scope_empty", - "answer_policy_branch": "open_file_not_found" - } - }, - { - "step": "post_evidence_gate", - "status": "skipped", - "timings_ms": { - "post_evidence_gate": 1 - }, - "input": { - "answer_mode": "not_found", - "draft_present": false, - "resolved_target": "src/app_runtime/core/missing_runtime.py" - }, - "output": { - "reason": "no_draft_answer" - } - } -] - -## Diagnostics -{ - "intent_correct": null, - "target_found": false, - "layers_used": [ - "C0_SOURCE_CHUNKS" - ], - "retrieval_sufficient": false, - "answer_mode": "insufficient", - "resolved_target": "src/app_runtime/core/missing_runtime.py", - "answer_policy_branch": "open_file_not_found", - "decision_reason": "path_scope_empty", - "router_result": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "retrieval_profile": "code", - "sub_intent": "OPEN_FILE", - "path_scope": [ - "src/app_runtime/core/missing_runtime.py" - ], - "layers": [ - "C0_SOURCE_CHUNKS" - ], - "symbol_resolution_status": "not_requested" - }, - "retrieval_request": { - "rag_session_id": "7d11da21-faa0-4cea-aede-aeabe069164c", - "query": "Открой файл src/app_runtime/core/missing_runtime.py", - "sub_intent": "OPEN_FILE", - "path_scope": [ - "src/app_runtime/core/missing_runtime.py" - ], - "requested_layers": [ - "C0_SOURCE_CHUNKS" - ] - }, - "per_layer_outcome": [ - { - "layer_id": "C0_SOURCE_CHUNKS", - "hit_count": 0, - "empty": true, - "fallback_used": false - } - ], - "empty_layers": [ - "C0_SOURCE_CHUNKS" - ], - "evidence_gate_decision": { - "sufficient": false, - "failure_reasons": [ - "path_scope_empty", - "layer_c0_empty" - ], - "evidence_count": 0 - }, - "evidence_gate_input": { - "resolved_target": "src/app_runtime/core/missing_runtime.py", - "sub_intent": "OPEN_FILE", - "target_type": "none", - "evidence_count": 0, - "code_chunk_count": 0, - "entrypoint_count": 0, - "relation_count": 0, - "test_evidence_count": 0, - "symbol_resolution_status": "not_requested", - "path_scope": [ - "src/app_runtime/core/missing_runtime.py" - ] - }, - "post_evidence_gate": { - "input": { - "answer_mode": "not_found", - "draft_present": false, - "resolved_target": "src/app_runtime/core/missing_runtime.py" - }, - "output": { - "reason": "no_draft_answer" - } - }, - "failure_reasons": [ - "path_scope_empty", - "layer_c0_empty" - ], - "timings_ms": { - "router": 1, - "retrieval": 15, - "pre_evidence_gate": 1, - "post_evidence_gate": 1 - } -} - -## Mismatches -- none \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/plba_full_chain_subintents_v3/20260312_192715/full_chain_plba_code_subintents_v2_plba-v2-open-file-public-api.json b/tests/pipeline_setup_v3/test_results/plba_full_chain_subintents_v3/20260312_192715/full_chain_plba_code_subintents_v2_plba-v2-open-file-public-api.json deleted file mode 100644 index d0e1590..0000000 --- a/tests/pipeline_setup_v3/test_results/plba_full_chain_subintents_v3/20260312_192715/full_chain_plba_code_subintents_v2_plba-v2-open-file-public-api.json +++ /dev/null @@ -1,584 +0,0 @@ -{ - "case_id": "plba-v2-open-file-public-api", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_02_pipeline/full_chain_plba_code_subintents_v2.yaml", - "runner": "agent_runtime", - "mode": "full_chain", - "query": "Открой файл src/plba/__init__.py", - "actual": { - "intent": "CODE_QA", - "sub_intent": "OPEN_FILE", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 1, - "llm_answer": "Файл `src/plba/__init__.py` импортирует следующие основные компоненты:\n\n- Из `plba.bootstrap`: `create_runtime`\n- Из `plba.config`: `ConfigFileLoader`, `FileConfigProvider`\n- Из `plba.control`: `ControlActionSet`, `ControlChannel`, `ControlPlaneService`, `HttpControlChannel`\n- Из `plba.contracts`: `ApplicationModule`, `ConfigProvider`, `HealthContributor`, `TraceContext`, `TraceContextRecord`, `TraceLogMessage`, `TraceTransport`, `Worker`, `WorkerHealth`, `WorkerStatus`\n- Из `plba.core`: `ConfigurationManager`, `RuntimeManager`, `ServiceContainer`\n- Из `plba.health`: `HealthRegistry`\n- Из `plba.logging`: `LogManager`\n- Из `plba.queue`: `InMemoryTaskQueue`\n- Из `plba.tracing`: `MySqlTraceTransport`, `NoOpTraceTransport`, `TraceService`\n- Из `plba.workflow`: `StepResult`, `WorkflowContext`, `WorkflowDefinition`, `WorkflowEngine` (упомянут частично)", - "answer_mode": "answered", - "path_scope": [ - "src/plba/__init__.py" - ], - "symbol_candidates": [], - "layers": [ - "C0_SOURCE_CHUNKS" - ] - }, - "passed": true, - "mismatches": [], - "details": { - "query": "Открой файл src/plba/__init__.py", - "router_result": { - "schema_version": "1.1", - "intent": "CODE_QA", - "retrieval_profile": "code", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query_plan": { - "raw": "Открой файл src/plba/__init__.py", - "normalized": "Открой файл src/plba/__init__.py", - "sub_intent": "OPEN_FILE", - "negations": [], - "expansions": [ - "file" - ], - "keyword_hints": [], - "path_hints": [ - "src/plba/__init__.py" - ], - "doc_scope_hints": [], - "symbol_candidates": [], - "symbol_kind_hint": "unknown", - "anchors": [ - { - "type": "FILE_PATH", - "value": "src/plba/__init__.py", - "source": "user_text", - "subtype": null, - "span": { - "start": 12, - "end": 32 - }, - "confidence": 0.95 - }, - { - "type": "KEY_TERM", - "value": "файл", - "source": "user_text", - "subtype": null, - "span": { - "start": 7, - "end": 11 - }, - "confidence": 0.9 - } - ] - }, - "retrieval_spec": { - "domains": [ - "CODE" - ], - "layer_queries": [ - { - "layer_id": "C0_SOURCE_CHUNKS", - "top_k": 12 - } - ], - "filters": { - "test_policy": "EXCLUDE", - "path_scope": [ - "src/plba/__init__.py" - ], - "language": [ - "python" - ] - }, - "rerank_profile": "code" - }, - "retrieval_constraints": { - "include_globs": [ - "src/plba/__init__.py" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": false, - "max_distance": 2, - "top_k": 5 - } - }, - "symbol_resolution": { - "status": "not_requested", - "resolved_symbol": null, - "alternatives": [], - "confidence": 0.0 - }, - "evidence_policy": { - "require_def": false, - "require_flow": false, - "require_spec": false, - "allow_answer_without_evidence": false - } - }, - "retrieval_request": { - "rag_session_id": "7d11da21-faa0-4cea-aede-aeabe069164c", - "query": "Открой файл src/plba/__init__.py", - "sub_intent": "OPEN_FILE", - "path_scope": [ - "src/plba/__init__.py" - ], - "keyword_hints": [], - "symbol_candidates": [], - "requested_layers": [ - "C0_SOURCE_CHUNKS" - ], - "retrieval_spec": { - "domains": [ - "CODE" - ], - "layer_queries": [ - { - "layer_id": "C0_SOURCE_CHUNKS", - "top_k": 12 - } - ], - "filters": { - "test_policy": "EXCLUDE", - "path_scope": [ - "src/plba/__init__.py" - ], - "language": [ - "python" - ] - }, - "rerank_profile": "code" - }, - "retrieval_constraints": { - "include_globs": [ - "src/plba/__init__.py" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": false, - "max_distance": 2, - "top_k": 5 - } - }, - "query_plan": { - "raw": "Открой файл src/plba/__init__.py", - "normalized": "Открой файл src/plba/__init__.py", - "sub_intent": "OPEN_FILE", - "negations": [], - "expansions": [ - "file" - ], - "keyword_hints": [], - "path_hints": [ - "src/plba/__init__.py" - ], - "doc_scope_hints": [], - "symbol_candidates": [], - "symbol_kind_hint": "unknown", - "anchors": [ - { - "type": "FILE_PATH", - "value": "src/plba/__init__.py", - "source": "user_text", - "subtype": null, - "span": { - "start": 12, - "end": 32 - }, - "confidence": 0.95 - }, - { - "type": "KEY_TERM", - "value": "файл", - "source": "user_text", - "subtype": null, - "span": { - "start": 7, - "end": 11 - }, - "confidence": 0.9 - } - ] - } - }, - "retrieval_result": { - "target_symbol_candidates": [], - "resolved_symbol": null, - "symbol_resolution_status": "not_requested", - "file_candidates": [ - "src/plba/__init__.py" - ], - "code_chunks": [ - { - "layer": "C0_SOURCE_CHUNKS", - "path": "src/plba/__init__.py", - "title": "src/plba/__init__.py:1-69", - "content": "from plba.bootstrap import create_runtime\nfrom plba.config import ConfigFileLoader, FileConfigProvider\nfrom plba.control import ControlActionSet, ControlChannel, ControlPlaneService, HttpControlChannel\nfrom plba.contracts import (\n ApplicationModule,\n ConfigProvider,\n HealthContributor,\n TraceContext,\n TraceContextRecord,\n TraceLogMessage,\n TraceTransport,\n Worker,\n WorkerHealth,\n WorkerStatus,\n)\nfrom plba.core import ConfigurationManager, RuntimeManager, ServiceContainer\nfrom plba.health import HealthRegistry\nfrom plba.logging import LogManager\nfrom plba.queue import InMemoryTaskQueue\nfrom plba.tracing import MySqlTraceTransport, NoOpTraceTransport, TraceService\nfrom plba.workflow import (\n StepResult,\n WorkflowContext,\n WorkflowDefinition,\n WorkflowEngine,\n WorkflowEngineHooks,\n WorkflowNode,\n WorkflowRuntimeFactory,\n WorkflowStep,\n)\nfrom plba.workers import WorkerSupervisor\n\n__all__ = [\n \"ApplicationModule\",\n \"ConfigFileLoader\",\n \"ConfigProvider\",\n \"ConfigurationManager\",\n \"ControlActionSet\",\n \"ControlChannel\",\n \"ControlPlaneService\",\n \"create_runtime\",\n \"FileConfigProvider\",\n \"HealthContributor\",\n \"HealthRegistry\",\n \"HttpControlChannel\",\n \"InMemoryTaskQueue\",\n \"LogManager\",\n \"MySqlTraceTransport\",\n \"NoOpTraceTransport\",\n \"RuntimeManager\",\n \"ServiceContainer\",\n \"TraceContext\",\n \"TraceContextRecord\",\n \"TraceLogMessage\",\n \"TraceService\",\n \"TraceTransport\",\n \"StepResult\",\n \"Worker\",\n \"WorkerHealth\",\n \"WorkerStatus\",\n \"WorkflowContext\",\n \"WorkflowDefinition\",\n \"WorkflowEngine\",\n \"WorkflowEngineHooks\",\n \"WorkflowNode\",\n \"WorkflowRuntimeFactory\",\n \"WorkflowStep\",\n \"WorkerSupervisor\",\n]", - "start_line": 1, - "end_line": 69, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.plba.__init__", - "is_test": false, - "blob_sha": "24e755ec8c249d14fb0e675b5dbf2b71ab91afb9c849897eebfa9feb2499e19d", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "relations": [], - "semantic_hints": [], - "entrypoints": [], - "test_candidates": [], - "layer_outcomes": [ - { - "layer_id": "C0_SOURCE_CHUNKS", - "hit_count": 1, - "empty": false, - "fallback_used": false - } - ], - "missing_layers": [], - "raw_rows": [ - { - "path": "src/plba/__init__.py", - "content": "from plba.bootstrap import create_runtime\nfrom plba.config import ConfigFileLoader, FileConfigProvider\nfrom plba.control import ControlActionSet, ControlChannel, ControlPlaneService, HttpControlChannel\nfrom plba.contracts import (\n ApplicationModule,\n ConfigProvider,\n HealthContributor,\n TraceContext,\n TraceContextRecord,\n TraceLogMessage,\n TraceTransport,\n Worker,\n WorkerHealth,\n WorkerStatus,\n)\nfrom plba.core import ConfigurationManager, RuntimeManager, ServiceContainer\nfrom plba.health import HealthRegistry\nfrom plba.logging import LogManager\nfrom plba.queue import InMemoryTaskQueue\nfrom plba.tracing import MySqlTraceTransport, NoOpTraceTransport, TraceService\nfrom plba.workflow import (\n StepResult,\n WorkflowContext,\n WorkflowDefinition,\n WorkflowEngine,\n WorkflowEngineHooks,\n WorkflowNode,\n WorkflowRuntimeFactory,\n WorkflowStep,\n)\nfrom plba.workers import WorkerSupervisor\n\n__all__ = [\n \"ApplicationModule\",\n \"ConfigFileLoader\",\n \"ConfigProvider\",\n \"ConfigurationManager\",\n \"ControlActionSet\",\n \"ControlChannel\",\n \"ControlPlaneService\",\n \"create_runtime\",\n \"FileConfigProvider\",\n \"HealthContributor\",\n \"HealthRegistry\",\n \"HttpControlChannel\",\n \"InMemoryTaskQueue\",\n \"LogManager\",\n \"MySqlTraceTransport\",\n \"NoOpTraceTransport\",\n \"RuntimeManager\",\n \"ServiceContainer\",\n \"TraceContext\",\n \"TraceContextRecord\",\n \"TraceLogMessage\",\n \"TraceService\",\n \"TraceTransport\",\n \"StepResult\",\n \"Worker\",\n \"WorkerHealth\",\n \"WorkerStatus\",\n \"WorkflowContext\",\n \"WorkflowDefinition\",\n \"WorkflowEngine\",\n \"WorkflowEngineHooks\",\n \"WorkflowNode\",\n \"WorkflowRuntimeFactory\",\n \"WorkflowStep\",\n \"WorkerSupervisor\",\n]", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/plba/__init__.py:1-69", - "span_start": 1, - "span_end": 69, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.plba.__init__", - "is_test": false, - "blob_sha": "24e755ec8c249d14fb0e675b5dbf2b71ab91afb9c849897eebfa9feb2499e19d", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "retrieval_report": { - "executed_layers": [ - "C0_SOURCE_CHUNKS" - ], - "retrieval_mode_by_layer": { - "C0_SOURCE_CHUNKS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C0_SOURCE_CHUNKS": 200 - }, - "filters_by_layer": { - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src/plba/__init__.py" - ] - } - }, - "requests": [ - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Открой файл src/plba/__init__.py", - "ranking_profile": "code" - } - ], - "fallback": { - "used": false, - "reason": null - }, - "retrieval_by_layer_ms": { - "C0_SOURCE_CHUNKS": 36 - } - } - }, - "diagnostics": { - "intent_correct": null, - "target_found": true, - "layers_used": [ - "C0_SOURCE_CHUNKS" - ], - "retrieval_sufficient": true, - "answer_mode": "normal", - "resolved_target": "src/plba/__init__.py", - "answer_policy_branch": "normal_answer", - "decision_reason": "evidence_sufficient", - "router_result": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "retrieval_profile": "code", - "sub_intent": "OPEN_FILE", - "path_scope": [ - "src/plba/__init__.py" - ], - "layers": [ - "C0_SOURCE_CHUNKS" - ], - "symbol_resolution_status": "not_requested" - }, - "retrieval_request": { - "rag_session_id": "7d11da21-faa0-4cea-aede-aeabe069164c", - "query": "Открой файл src/plba/__init__.py", - "sub_intent": "OPEN_FILE", - "path_scope": [ - "src/plba/__init__.py" - ], - "requested_layers": [ - "C0_SOURCE_CHUNKS" - ] - }, - "per_layer_outcome": [ - { - "layer_id": "C0_SOURCE_CHUNKS", - "hit_count": 1, - "empty": false, - "fallback_used": false - } - ], - "empty_layers": [], - "evidence_gate_decision": { - "sufficient": true, - "failure_reasons": [], - "evidence_count": 1 - }, - "evidence_gate_input": { - "resolved_target": "src/plba/__init__.py", - "sub_intent": "OPEN_FILE", - "target_type": "file", - "evidence_count": 1, - "code_chunk_count": 1, - "entrypoint_count": 0, - "relation_count": 0, - "test_evidence_count": 0, - "symbol_resolution_status": "not_requested", - "path_scope": [ - "src/plba/__init__.py" - ] - }, - "post_evidence_gate": { - "input": { - "answer_mode": "normal", - "degraded_message": "", - "resolved_target": "src/plba/__init__.py", - "draft_answer_preview": "Файл `src/plba/__init__.py` импортирует следующие основные компоненты:\n\n- Из `plba.bootstrap`: `create_runtime`\n- Из `plba.config`: `ConfigFileLoader`, `FileConfigProvider`\n- Из `plba.control`: `ControlActionSet`, `ControlChannel`, `ControlPlaneService`, `HttpControlChannel`\n- Из `plba.contracts`: `", - "repair_candidate": true - }, - "output": { - "passed": true, - "action": "return", - "reasons": [], - "repair_used": false, - "final_answer_preview": "Файл `src/plba/__init__.py` импортирует следующие основные компоненты:\n\n- Из `plba.bootstrap`: `create_runtime`\n- Из `plba.config`: `ConfigFileLoader`, `FileConfigProvider`\n- Из `plba.control`: `ControlActionSet`, `ControlChannel`, `ControlPlaneService`, `HttpControlChannel`\n- Из `plba.contracts`: `" - } - }, - "failure_reasons": [], - "timings_ms": { - "router": 1, - "retrieval": 36, - "pre_evidence_gate": 1, - "llm": 5422, - "post_evidence_gate": 1 - } - }, - "rag_rows": [ - { - "path": "src/plba/__init__.py", - "content": "from plba.bootstrap import create_runtime\nfrom plba.config import ConfigFileLoader, FileConfigProvider\nfrom plba.control import ControlActionSet, ControlChannel, ControlPlaneService, HttpControlChannel\nfrom plba.contracts import (\n ApplicationModule,\n ConfigProvider,\n HealthContributor,\n TraceContext,\n TraceContextRecord,\n TraceLogMessage,\n TraceTransport,\n Worker,\n WorkerHealth,\n WorkerStatus,\n)\nfrom plba.core import ConfigurationManager, RuntimeManager, ServiceContainer\nfrom plba.health import HealthRegistry\nfrom plba.logging import LogManager\nfrom plba.queue import InMemoryTaskQueue\nfrom plba.tracing import MySqlTraceTransport, NoOpTraceTransport, TraceService\nfrom plba.workflow import (\n StepResult,\n WorkflowContext,\n WorkflowDefinition,\n WorkflowEngine,\n WorkflowEngineHooks,\n WorkflowNode,\n WorkflowRuntimeFactory,\n WorkflowStep,\n)\nfrom plba.workers import WorkerSupervisor\n\n__all__ = [\n \"ApplicationModule\",\n \"ConfigFileLoader\",\n \"ConfigProvider\",\n \"ConfigurationManager\",\n \"ControlActionSet\",\n \"ControlChannel\",\n \"ControlPlaneService\",\n \"create_runtime\",\n \"FileConfigProvider\",\n \"HealthContributor\",\n \"HealthRegistry\",\n \"HttpControlChannel\",\n \"InMemoryTaskQueue\",\n \"LogManager\",\n \"MySqlTraceTransport\",\n \"NoOpTraceTransport\",\n \"RuntimeManager\",\n \"ServiceContainer\",\n \"TraceContext\",\n \"TraceContextRecord\",\n \"TraceLogMessage\",\n \"TraceService\",\n \"TraceTransport\",\n \"StepResult\",\n \"Worker\",\n \"WorkerHealth\",\n \"WorkerStatus\",\n \"WorkflowContext\",\n \"WorkflowDefinition\",\n \"WorkflowEngine\",\n \"WorkflowEngineHooks\",\n \"WorkflowNode\",\n \"WorkflowRuntimeFactory\",\n \"WorkflowStep\",\n \"WorkerSupervisor\",\n]", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/plba/__init__.py:1-69", - "span_start": 1, - "span_end": 69, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.plba.__init__", - "is_test": false, - "blob_sha": "24e755ec8c249d14fb0e675b5dbf2b71ab91afb9c849897eebfa9feb2499e19d", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "validation": { - "passed": true, - "action": "return", - "reasons": [] - }, - "steps": [ - { - "step": "router", - "status": "completed", - "timings_ms": { - "router": 1 - }, - "output": { - "intent": "CODE_QA", - "sub_intent": "OPEN_FILE", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - } - }, - { - "step": "retrieval", - "status": "completed", - "timings_ms": { - "retrieval": 36 - }, - "output": { - "rag_count": 1, - "answer_path_rag_count": 1, - "resolved_symbol_status": "not_requested", - "resolved_symbol": null, - "requested_layers": [ - "C0_SOURCE_CHUNKS" - ] - }, - "diagnostics": { - "executed_layers": [ - "C0_SOURCE_CHUNKS" - ], - "retrieval_mode_by_layer": { - "C0_SOURCE_CHUNKS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C0_SOURCE_CHUNKS": 200 - }, - "filters_by_layer": { - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src/plba/__init__.py" - ] - } - }, - "requests": [ - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Открой файл src/plba/__init__.py", - "ranking_profile": "code" - } - ], - "fallback": { - "used": false, - "reason": null - }, - "retrieval_by_layer_ms": { - "C0_SOURCE_CHUNKS": 36 - } - } - }, - { - "step": "pre_evidence_gate", - "status": "passed", - "timings_ms": { - "pre_evidence_gate": 1 - }, - "input": { - "resolved_target": "src/plba/__init__.py", - "sub_intent": "OPEN_FILE", - "target_type": "file", - "evidence_count": 1, - "code_chunk_count": 1, - "entrypoint_count": 0, - "relation_count": 0, - "test_evidence_count": 0, - "symbol_resolution_status": "not_requested", - "path_scope": [ - "src/plba/__init__.py" - ] - }, - "output": { - "passed": true, - "failure_reasons": [], - "degraded_message": "", - "evidence_count": 1 - } - }, - { - "step": "llm", - "status": "completed", - "timings_ms": { - "llm": 5422 - }, - "output": { - "prompt_name": "code_qa_open_file_answer", - "answer_preview": "Файл `src/plba/__init__.py` импортирует следующие основные компоненты:\n\n- Из `plba.bootstrap`: `create_runtime`\n- Из `plba.config`: `ConfigFileLoader`, `FileConfigProvider`\n- Из `plba.control`: `ControlActionSet`, `ControlChannel`, `ControlPlaneService`, `HttpControlChannel`\n- Из `plba.contracts`: `", - "resolved_target": "src/plba/__init__.py", - "answer_policy_branch": "normal_answer", - "decision_reason": "evidence_sufficient" - } - }, - { - "step": "post_evidence_gate", - "status": "passed", - "timings_ms": { - "post_evidence_gate": 1, - "post_evidence_gate_recheck": 0, - "repair": 0 - }, - "input": { - "answer_mode": "normal", - "degraded_message": "", - "resolved_target": "src/plba/__init__.py", - "draft_answer_preview": "Файл `src/plba/__init__.py` импортирует следующие основные компоненты:\n\n- Из `plba.bootstrap`: `create_runtime`\n- Из `plba.config`: `ConfigFileLoader`, `FileConfigProvider`\n- Из `plba.control`: `ControlActionSet`, `ControlChannel`, `ControlPlaneService`, `HttpControlChannel`\n- Из `plba.contracts`: `", - "repair_candidate": true - }, - "output": { - "passed": true, - "action": "return", - "reasons": [], - "repair_used": false, - "final_answer_preview": "Файл `src/plba/__init__.py` импортирует следующие основные компоненты:\n\n- Из `plba.bootstrap`: `create_runtime`\n- Из `plba.config`: `ConfigFileLoader`, `FileConfigProvider`\n- Из `plba.control`: `ControlActionSet`, `ControlChannel`, `ControlPlaneService`, `HttpControlChannel`\n- Из `plba.contracts`: `" - } - } - ] - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/plba_full_chain_subintents_v3/20260312_192715/full_chain_plba_code_subintents_v2_plba-v2-open-file-public-api.md b/tests/pipeline_setup_v3/test_results/plba_full_chain_subintents_v3/20260312_192715/full_chain_plba_code_subintents_v2_plba-v2-open-file-public-api.md deleted file mode 100644 index afa6048..0000000 --- a/tests/pipeline_setup_v3/test_results/plba_full_chain_subintents_v3/20260312_192715/full_chain_plba_code_subintents_v2_plba-v2-open-file-public-api.md +++ /dev/null @@ -1,250 +0,0 @@ -# plba-v2-open-file-public-api - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_02_pipeline/full_chain_plba_code_subintents_v2.yaml -- runner: agent_runtime -- mode: full_chain -- passed: True - -## Query -Открой файл src/plba/__init__.py - -## Actual -{ - "intent": "CODE_QA", - "sub_intent": "OPEN_FILE", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 1, - "llm_answer": "Файл `src/plba/__init__.py` импортирует следующие основные компоненты:\n\n- Из `plba.bootstrap`: `create_runtime`\n- Из `plba.config`: `ConfigFileLoader`, `FileConfigProvider`\n- Из `plba.control`: `ControlActionSet`, `ControlChannel`, `ControlPlaneService`, `HttpControlChannel`\n- Из `plba.contracts`: `ApplicationModule`, `ConfigProvider`, `HealthContributor`, `TraceContext`, `TraceContextRecord`, `TraceLogMessage`, `TraceTransport`, `Worker`, `WorkerHealth`, `WorkerStatus`\n- Из `plba.core`: `ConfigurationManager`, `RuntimeManager`, `ServiceContainer`\n- Из `plba.health`: `HealthRegistry`\n- Из `plba.logging`: `LogManager`\n- Из `plba.queue`: `InMemoryTaskQueue`\n- Из `plba.tracing`: `MySqlTraceTransport`, `NoOpTraceTransport`, `TraceService`\n- Из `plba.workflow`: `StepResult`, `WorkflowContext`, `WorkflowDefinition`, `WorkflowEngine` (упомянут частично)", - "answer_mode": "answered", - "path_scope": [ - "src/plba/__init__.py" - ], - "symbol_candidates": [], - "layers": [ - "C0_SOURCE_CHUNKS" - ] -} - -## Steps -[ - { - "step": "router", - "status": "completed", - "timings_ms": { - "router": 1 - }, - "output": { - "intent": "CODE_QA", - "sub_intent": "OPEN_FILE", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - } - }, - { - "step": "retrieval", - "status": "completed", - "timings_ms": { - "retrieval": 36 - }, - "output": { - "rag_count": 1, - "answer_path_rag_count": 1, - "resolved_symbol_status": "not_requested", - "resolved_symbol": null, - "requested_layers": [ - "C0_SOURCE_CHUNKS" - ] - }, - "diagnostics": { - "executed_layers": [ - "C0_SOURCE_CHUNKS" - ], - "retrieval_mode_by_layer": { - "C0_SOURCE_CHUNKS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C0_SOURCE_CHUNKS": 200 - }, - "filters_by_layer": { - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src/plba/__init__.py" - ] - } - }, - "requests": [ - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Открой файл src/plba/__init__.py", - "ranking_profile": "code" - } - ], - "fallback": { - "used": false, - "reason": null - }, - "retrieval_by_layer_ms": { - "C0_SOURCE_CHUNKS": 36 - } - } - }, - { - "step": "pre_evidence_gate", - "status": "passed", - "timings_ms": { - "pre_evidence_gate": 1 - }, - "input": { - "resolved_target": "src/plba/__init__.py", - "sub_intent": "OPEN_FILE", - "target_type": "file", - "evidence_count": 1, - "code_chunk_count": 1, - "entrypoint_count": 0, - "relation_count": 0, - "test_evidence_count": 0, - "symbol_resolution_status": "not_requested", - "path_scope": [ - "src/plba/__init__.py" - ] - }, - "output": { - "passed": true, - "failure_reasons": [], - "degraded_message": "", - "evidence_count": 1 - } - }, - { - "step": "llm", - "status": "completed", - "timings_ms": { - "llm": 5422 - }, - "output": { - "prompt_name": "code_qa_open_file_answer", - "answer_preview": "Файл `src/plba/__init__.py` импортирует следующие основные компоненты:\n\n- Из `plba.bootstrap`: `create_runtime`\n- Из `plba.config`: `ConfigFileLoader`, `FileConfigProvider`\n- Из `plba.control`: `ControlActionSet`, `ControlChannel`, `ControlPlaneService`, `HttpControlChannel`\n- Из `plba.contracts`: `", - "resolved_target": "src/plba/__init__.py", - "answer_policy_branch": "normal_answer", - "decision_reason": "evidence_sufficient" - } - }, - { - "step": "post_evidence_gate", - "status": "passed", - "timings_ms": { - "post_evidence_gate": 1, - "post_evidence_gate_recheck": 0, - "repair": 0 - }, - "input": { - "answer_mode": "normal", - "degraded_message": "", - "resolved_target": "src/plba/__init__.py", - "draft_answer_preview": "Файл `src/plba/__init__.py` импортирует следующие основные компоненты:\n\n- Из `plba.bootstrap`: `create_runtime`\n- Из `plba.config`: `ConfigFileLoader`, `FileConfigProvider`\n- Из `plba.control`: `ControlActionSet`, `ControlChannel`, `ControlPlaneService`, `HttpControlChannel`\n- Из `plba.contracts`: `", - "repair_candidate": true - }, - "output": { - "passed": true, - "action": "return", - "reasons": [], - "repair_used": false, - "final_answer_preview": "Файл `src/plba/__init__.py` импортирует следующие основные компоненты:\n\n- Из `plba.bootstrap`: `create_runtime`\n- Из `plba.config`: `ConfigFileLoader`, `FileConfigProvider`\n- Из `plba.control`: `ControlActionSet`, `ControlChannel`, `ControlPlaneService`, `HttpControlChannel`\n- Из `plba.contracts`: `" - } - } -] - -## Diagnostics -{ - "intent_correct": null, - "target_found": true, - "layers_used": [ - "C0_SOURCE_CHUNKS" - ], - "retrieval_sufficient": true, - "answer_mode": "normal", - "resolved_target": "src/plba/__init__.py", - "answer_policy_branch": "normal_answer", - "decision_reason": "evidence_sufficient", - "router_result": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "retrieval_profile": "code", - "sub_intent": "OPEN_FILE", - "path_scope": [ - "src/plba/__init__.py" - ], - "layers": [ - "C0_SOURCE_CHUNKS" - ], - "symbol_resolution_status": "not_requested" - }, - "retrieval_request": { - "rag_session_id": "7d11da21-faa0-4cea-aede-aeabe069164c", - "query": "Открой файл src/plba/__init__.py", - "sub_intent": "OPEN_FILE", - "path_scope": [ - "src/plba/__init__.py" - ], - "requested_layers": [ - "C0_SOURCE_CHUNKS" - ] - }, - "per_layer_outcome": [ - { - "layer_id": "C0_SOURCE_CHUNKS", - "hit_count": 1, - "empty": false, - "fallback_used": false - } - ], - "empty_layers": [], - "evidence_gate_decision": { - "sufficient": true, - "failure_reasons": [], - "evidence_count": 1 - }, - "evidence_gate_input": { - "resolved_target": "src/plba/__init__.py", - "sub_intent": "OPEN_FILE", - "target_type": "file", - "evidence_count": 1, - "code_chunk_count": 1, - "entrypoint_count": 0, - "relation_count": 0, - "test_evidence_count": 0, - "symbol_resolution_status": "not_requested", - "path_scope": [ - "src/plba/__init__.py" - ] - }, - "post_evidence_gate": { - "input": { - "answer_mode": "normal", - "degraded_message": "", - "resolved_target": "src/plba/__init__.py", - "draft_answer_preview": "Файл `src/plba/__init__.py` импортирует следующие основные компоненты:\n\n- Из `plba.bootstrap`: `create_runtime`\n- Из `plba.config`: `ConfigFileLoader`, `FileConfigProvider`\n- Из `plba.control`: `ControlActionSet`, `ControlChannel`, `ControlPlaneService`, `HttpControlChannel`\n- Из `plba.contracts`: `", - "repair_candidate": true - }, - "output": { - "passed": true, - "action": "return", - "reasons": [], - "repair_used": false, - "final_answer_preview": "Файл `src/plba/__init__.py` импортирует следующие основные компоненты:\n\n- Из `plba.bootstrap`: `create_runtime`\n- Из `plba.config`: `ConfigFileLoader`, `FileConfigProvider`\n- Из `plba.control`: `ControlActionSet`, `ControlChannel`, `ControlPlaneService`, `HttpControlChannel`\n- Из `plba.contracts`: `" - } - }, - "failure_reasons": [], - "timings_ms": { - "router": 1, - "retrieval": 36, - "pre_evidence_gate": 1, - "llm": 5422, - "post_evidence_gate": 1 - } -} - -## Mismatches -- none \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/plba_full_chain_subintents_v3/20260312_192715/full_chain_plba_code_subintents_v2_plba-v2-open-file-runtime.json b/tests/pipeline_setup_v3/test_results/plba_full_chain_subintents_v3/20260312_192715/full_chain_plba_code_subintents_v2_plba-v2-open-file-runtime.json deleted file mode 100644 index 4016ab4..0000000 --- a/tests/pipeline_setup_v3/test_results/plba_full_chain_subintents_v3/20260312_192715/full_chain_plba_code_subintents_v2_plba-v2-open-file-runtime.json +++ /dev/null @@ -1,584 +0,0 @@ -{ - "case_id": "plba-v2-open-file-runtime", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_02_pipeline/full_chain_plba_code_subintents_v2.yaml", - "runner": "agent_runtime", - "mode": "full_chain", - "query": "Открой файл src/app_runtime/core/runtime.py", - "actual": { - "intent": "CODE_QA", - "sub_intent": "OPEN_FILE", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 1, - "llm_answer": "В файле `src/app_runtime/core/runtime.py` определён класс `RuntimeManager`.\nУ него есть несколько атрибутов класса:\n- `ACTION_TIMEOUT_SECONDS = 10.0`\n- `ACTION_POLL_INTERVAL_SECONDS = 0.05`\n\nКонструктор принимает следующие параметры (все опциональны):\n- `configuration: ConfigurationManager | None`\n- `services: ServiceContainer | None`\n- `traces: TraceService | None`\n- `health: HealthRegistry | None`\n- `logs: LogManager | None`\n- `workers: WorkerSupervisor | None`\n- `control_plane: ControlPlaneService | None`\n\nЕсли аргумент не передан, используется значение по умолчанию – новый экземпляр соответствующего менеджера или сервиса.", - "answer_mode": "answered", - "path_scope": [ - "src/app_runtime/core/runtime.py" - ], - "symbol_candidates": [], - "layers": [ - "C0_SOURCE_CHUNKS" - ] - }, - "passed": true, - "mismatches": [], - "details": { - "query": "Открой файл src/app_runtime/core/runtime.py", - "router_result": { - "schema_version": "1.1", - "intent": "CODE_QA", - "retrieval_profile": "code", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query_plan": { - "raw": "Открой файл src/app_runtime/core/runtime.py", - "normalized": "Открой файл src/app_runtime/core/runtime.py", - "sub_intent": "OPEN_FILE", - "negations": [], - "expansions": [ - "file" - ], - "keyword_hints": [], - "path_hints": [ - "src/app_runtime/core/runtime.py" - ], - "doc_scope_hints": [], - "symbol_candidates": [], - "symbol_kind_hint": "unknown", - "anchors": [ - { - "type": "FILE_PATH", - "value": "src/app_runtime/core/runtime.py", - "source": "user_text", - "subtype": null, - "span": { - "start": 12, - "end": 43 - }, - "confidence": 0.95 - }, - { - "type": "KEY_TERM", - "value": "файл", - "source": "user_text", - "subtype": null, - "span": { - "start": 7, - "end": 11 - }, - "confidence": 0.9 - } - ] - }, - "retrieval_spec": { - "domains": [ - "CODE" - ], - "layer_queries": [ - { - "layer_id": "C0_SOURCE_CHUNKS", - "top_k": 12 - } - ], - "filters": { - "test_policy": "EXCLUDE", - "path_scope": [ - "src/app_runtime/core/runtime.py" - ], - "language": [ - "python" - ] - }, - "rerank_profile": "code" - }, - "retrieval_constraints": { - "include_globs": [ - "src/app_runtime/core/runtime.py" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": false, - "max_distance": 2, - "top_k": 5 - } - }, - "symbol_resolution": { - "status": "not_requested", - "resolved_symbol": null, - "alternatives": [], - "confidence": 0.0 - }, - "evidence_policy": { - "require_def": false, - "require_flow": false, - "require_spec": false, - "allow_answer_without_evidence": false - } - }, - "retrieval_request": { - "rag_session_id": "7d11da21-faa0-4cea-aede-aeabe069164c", - "query": "Открой файл src/app_runtime/core/runtime.py", - "sub_intent": "OPEN_FILE", - "path_scope": [ - "src/app_runtime/core/runtime.py" - ], - "keyword_hints": [], - "symbol_candidates": [], - "requested_layers": [ - "C0_SOURCE_CHUNKS" - ], - "retrieval_spec": { - "domains": [ - "CODE" - ], - "layer_queries": [ - { - "layer_id": "C0_SOURCE_CHUNKS", - "top_k": 12 - } - ], - "filters": { - "test_policy": "EXCLUDE", - "path_scope": [ - "src/app_runtime/core/runtime.py" - ], - "language": [ - "python" - ] - }, - "rerank_profile": "code" - }, - "retrieval_constraints": { - "include_globs": [ - "src/app_runtime/core/runtime.py" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": false, - "max_distance": 2, - "top_k": 5 - } - }, - "query_plan": { - "raw": "Открой файл src/app_runtime/core/runtime.py", - "normalized": "Открой файл src/app_runtime/core/runtime.py", - "sub_intent": "OPEN_FILE", - "negations": [], - "expansions": [ - "file" - ], - "keyword_hints": [], - "path_hints": [ - "src/app_runtime/core/runtime.py" - ], - "doc_scope_hints": [], - "symbol_candidates": [], - "symbol_kind_hint": "unknown", - "anchors": [ - { - "type": "FILE_PATH", - "value": "src/app_runtime/core/runtime.py", - "source": "user_text", - "subtype": null, - "span": { - "start": 12, - "end": 43 - }, - "confidence": 0.95 - }, - { - "type": "KEY_TERM", - "value": "файл", - "source": "user_text", - "subtype": null, - "span": { - "start": 7, - "end": 11 - }, - "confidence": 0.9 - } - ] - } - }, - "retrieval_result": { - "target_symbol_candidates": [], - "resolved_symbol": null, - "symbol_resolution_status": "not_requested", - "file_candidates": [ - "src/app_runtime/core/runtime.py" - ], - "code_chunks": [ - { - "layer": "C0_SOURCE_CHUNKS", - "path": "src/app_runtime/core/runtime.py", - "title": "src/app_runtime/core/runtime.py:RuntimeManager", - "content": "class RuntimeManager:\n ACTION_TIMEOUT_SECONDS = 10.0\n ACTION_POLL_INTERVAL_SECONDS = 0.05\n\n def __init__(\n self,\n configuration: ConfigurationManager | None = None,\n services: ServiceContainer | None = None,\n traces: TraceService | None = None,\n health: HealthRegistry | None = None,\n logs: LogManager | None = None,\n workers: WorkerSupervisor | None = None,\n control_plane: ControlPlaneService | None = None,\n ) -> None:\n self.configuration = configuration or ConfigurationManager()\n self.services = services or ServiceContainer()\n self.traces = traces or TraceService()\n self.health = health or HealthRegistry()\n self.logs = logs or LogManager()\n self.workers = workers or WorkerSupervisor()\n self.control_plane = control_plane or ControlPlaneService()\n self.registry = ModuleRegistry(self.services)\n self._started = False\n self._state = LifecycleState.IDLE\n self._core_registered = False\n self._workers_registered = False\n self._register_core_services()\n\n def register_module(self, module: ApplicationModule) -> None:\n self.registry.register_module(module.name)\n module.register(self.registry)\n\n def add_config_file(self, path: str) -> FileConfigProvider:\n provider = FileConfigProvider(path)\n self.configuration.add_provider(provider)\n return provider\n\n def start(self, *, start_control_plane: bool = True) -> None:\n if self._started:\n return\n self._state = LifecycleState.STARTING\n config = self.configuration.load()\n self.logs.apply_config(config)\n self._register_health_contributors()\n self._register_workers()\n self.workers.start()\n if start_control_plane:\n self.control_plane.start(self)\n self._started = True\n self._refresh_state()\n\n def stop(self, timeout: float = 30.0, force: bool = False, stop_control_plane: bool = True) -> None:\n if not self._started:\n return\n self._state = LifecycleState.STOPPING\n self.workers.stop(timeout=timeout, force=force)\n if stop_control_plane:\n self.control_plane.stop()\n self._started = False\n self._state = LifecycleState.STOPPED\n\n def status(self) -> dict[str, object]:\n self._refresh_state()\n return self.control_plane.snapshot(self)\n\n def current_health(self) -> HealthPayload:\n self._refresh_state()\n return self.health.payload(self._state, self.workers.healths())\n\n async def health_status(self) -> HealthPayload:\n return self.current_health()\n\n async def start_runtime(self) -> dict[str, object] | str:\n self._refresh_state()\n if self._started:\n return \"runtime already running\"\n if self._state == LifecycleState.STOPPING:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n\n self.start(start_control_plane=False)\n started = self._wait_for_state({LifecycleState.IDLE, LifecycleState.BUSY}, timeout=self.ACTION_TIMEOUT_SECONDS)\n if started:\n return self._action_detail(\"runtime started\", timed_out=False)\n return self._action_detail(\"runtime start is still in progress\", timed_out=True)\n\n async def stop_runtime(self) -> dict[str, object] | str:\n self._refresh_state()\n if not self._started:\n if self._state == LifecycleState.STOPPING:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n return \"runtime already stopped\"\n\n self._state = LifecycleState.STOPPING\n try:\n self.workers.stop(timeout=self.ACTION_TIMEOUT_SECONDS, force=False)\n except TimeoutError:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n\n self._started = False\n self._state = LifecycleState.STOPPED\n return self._action_detail(\"runtime stopped\", timed_out=False)\n\n async def runtime_status(self) -> str:\n self._refresh_state()\n return self._state.value\n\n def _register_core_services(self) -> None:\n if self._core_registered:\n return\n self.services.register(\"configuration\", self.configuration)\n self.services.register(\"traces\", self.traces)\n self.services.register(\"health\", self.health)\n self.services.register(\"logs\", self.logs)\n self.services.register(\"workers\", self.workers)\n self.services.register(\"control_plane\", self.control_plane)\n self._core_registered = True\n\n def _register_health_contributors(self) -> None:\n for contributor in self.registry.health_contributors:\n self.health.register(contributor)\n\n def _register_workers(self) -> None:\n if self._workers_registered:\n return\n for worker in self.registry.workers:\n self.workers.register(worker)\n self._workers_registered = True\n\n def _refresh_state(self) -> None:\n lifecycle = self.workers.lifecycle_state()\n\n if self._state == LifecycleState.STOPPING:\n if lifecycle == LifecycleState.STOPPED:\n self._started = False\n self._state = LifecycleState.STOPPED\n return\n\n if not self._started:\n if lifecycle == LifecycleState.STOPPED:\n self._state = LifecycleState.STOPPED\n return\n\n self._state = lifecycle\n\n def _wait_for_state(self, target_states: set[LifecycleState], *, timeout: float) -> bool:\n deadline = monotonic() + timeout\n while monotonic() < deadline:\n self._refresh_state()\n if self._state in target_states:\n return True\n sleep(self.ACTION_POLL_INTERVAL_SECONDS)\n self._refresh_state()\n return self._state in target_states\n\n def _action_detail(self, message: str, *, timed_out: bool) -> dict[str, object]:\n self._refresh_state()\n return {\n \"message\": message,\n \"state\": self._state.value,\n \"timed_out\": timed_out,\n \"workers\": self.workers.snapshot(),\n }", - "start_line": 18, - "end_line": 179, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.core.runtime", - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "relations": [], - "semantic_hints": [], - "entrypoints": [], - "test_candidates": [], - "layer_outcomes": [ - { - "layer_id": "C0_SOURCE_CHUNKS", - "hit_count": 1, - "empty": false, - "fallback_used": false - } - ], - "missing_layers": [], - "raw_rows": [ - { - "path": "src/app_runtime/core/runtime.py", - "content": "class RuntimeManager:\n ACTION_TIMEOUT_SECONDS = 10.0\n ACTION_POLL_INTERVAL_SECONDS = 0.05\n\n def __init__(\n self,\n configuration: ConfigurationManager | None = None,\n services: ServiceContainer | None = None,\n traces: TraceService | None = None,\n health: HealthRegistry | None = None,\n logs: LogManager | None = None,\n workers: WorkerSupervisor | None = None,\n control_plane: ControlPlaneService | None = None,\n ) -> None:\n self.configuration = configuration or ConfigurationManager()\n self.services = services or ServiceContainer()\n self.traces = traces or TraceService()\n self.health = health or HealthRegistry()\n self.logs = logs or LogManager()\n self.workers = workers or WorkerSupervisor()\n self.control_plane = control_plane or ControlPlaneService()\n self.registry = ModuleRegistry(self.services)\n self._started = False\n self._state = LifecycleState.IDLE\n self._core_registered = False\n self._workers_registered = False\n self._register_core_services()\n\n def register_module(self, module: ApplicationModule) -> None:\n self.registry.register_module(module.name)\n module.register(self.registry)\n\n def add_config_file(self, path: str) -> FileConfigProvider:\n provider = FileConfigProvider(path)\n self.configuration.add_provider(provider)\n return provider\n\n def start(self, *, start_control_plane: bool = True) -> None:\n if self._started:\n return\n self._state = LifecycleState.STARTING\n config = self.configuration.load()\n self.logs.apply_config(config)\n self._register_health_contributors()\n self._register_workers()\n self.workers.start()\n if start_control_plane:\n self.control_plane.start(self)\n self._started = True\n self._refresh_state()\n\n def stop(self, timeout: float = 30.0, force: bool = False, stop_control_plane: bool = True) -> None:\n if not self._started:\n return\n self._state = LifecycleState.STOPPING\n self.workers.stop(timeout=timeout, force=force)\n if stop_control_plane:\n self.control_plane.stop()\n self._started = False\n self._state = LifecycleState.STOPPED\n\n def status(self) -> dict[str, object]:\n self._refresh_state()\n return self.control_plane.snapshot(self)\n\n def current_health(self) -> HealthPayload:\n self._refresh_state()\n return self.health.payload(self._state, self.workers.healths())\n\n async def health_status(self) -> HealthPayload:\n return self.current_health()\n\n async def start_runtime(self) -> dict[str, object] | str:\n self._refresh_state()\n if self._started:\n return \"runtime already running\"\n if self._state == LifecycleState.STOPPING:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n\n self.start(start_control_plane=False)\n started = self._wait_for_state({LifecycleState.IDLE, LifecycleState.BUSY}, timeout=self.ACTION_TIMEOUT_SECONDS)\n if started:\n return self._action_detail(\"runtime started\", timed_out=False)\n return self._action_detail(\"runtime start is still in progress\", timed_out=True)\n\n async def stop_runtime(self) -> dict[str, object] | str:\n self._refresh_state()\n if not self._started:\n if self._state == LifecycleState.STOPPING:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n return \"runtime already stopped\"\n\n self._state = LifecycleState.STOPPING\n try:\n self.workers.stop(timeout=self.ACTION_TIMEOUT_SECONDS, force=False)\n except TimeoutError:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n\n self._started = False\n self._state = LifecycleState.STOPPED\n return self._action_detail(\"runtime stopped\", timed_out=False)\n\n async def runtime_status(self) -> str:\n self._refresh_state()\n return self._state.value\n\n def _register_core_services(self) -> None:\n if self._core_registered:\n return\n self.services.register(\"configuration\", self.configuration)\n self.services.register(\"traces\", self.traces)\n self.services.register(\"health\", self.health)\n self.services.register(\"logs\", self.logs)\n self.services.register(\"workers\", self.workers)\n self.services.register(\"control_plane\", self.control_plane)\n self._core_registered = True\n\n def _register_health_contributors(self) -> None:\n for contributor in self.registry.health_contributors:\n self.health.register(contributor)\n\n def _register_workers(self) -> None:\n if self._workers_registered:\n return\n for worker in self.registry.workers:\n self.workers.register(worker)\n self._workers_registered = True\n\n def _refresh_state(self) -> None:\n lifecycle = self.workers.lifecycle_state()\n\n if self._state == LifecycleState.STOPPING:\n if lifecycle == LifecycleState.STOPPED:\n self._started = False\n self._state = LifecycleState.STOPPED\n return\n\n if not self._started:\n if lifecycle == LifecycleState.STOPPED:\n self._state = LifecycleState.STOPPED\n return\n\n self._state = lifecycle\n\n def _wait_for_state(self, target_states: set[LifecycleState], *, timeout: float) -> bool:\n deadline = monotonic() + timeout\n while monotonic() < deadline:\n self._refresh_state()\n if self._state in target_states:\n return True\n sleep(self.ACTION_POLL_INTERVAL_SECONDS)\n self._refresh_state()\n return self._state in target_states\n\n def _action_detail(self, message: str, *, timed_out: bool) -> dict[str, object]:\n self._refresh_state()\n return {\n \"message\": message,\n \"state\": self._state.value,\n \"timed_out\": timed_out,\n \"workers\": self.workers.snapshot(),\n }", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/core/runtime.py:RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.core.runtime", - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "retrieval_report": { - "executed_layers": [ - "C0_SOURCE_CHUNKS" - ], - "retrieval_mode_by_layer": { - "C0_SOURCE_CHUNKS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C0_SOURCE_CHUNKS": 200 - }, - "filters_by_layer": { - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src/app_runtime/core/runtime.py" - ] - } - }, - "requests": [ - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Открой файл src/app_runtime/core/runtime.py", - "ranking_profile": "code" - } - ], - "fallback": { - "used": false, - "reason": null - }, - "retrieval_by_layer_ms": { - "C0_SOURCE_CHUNKS": 295 - } - } - }, - "diagnostics": { - "intent_correct": null, - "target_found": true, - "layers_used": [ - "C0_SOURCE_CHUNKS" - ], - "retrieval_sufficient": true, - "answer_mode": "normal", - "resolved_target": "src/app_runtime/core/runtime.py", - "answer_policy_branch": "normal_answer", - "decision_reason": "evidence_sufficient", - "router_result": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "retrieval_profile": "code", - "sub_intent": "OPEN_FILE", - "path_scope": [ - "src/app_runtime/core/runtime.py" - ], - "layers": [ - "C0_SOURCE_CHUNKS" - ], - "symbol_resolution_status": "not_requested" - }, - "retrieval_request": { - "rag_session_id": "7d11da21-faa0-4cea-aede-aeabe069164c", - "query": "Открой файл src/app_runtime/core/runtime.py", - "sub_intent": "OPEN_FILE", - "path_scope": [ - "src/app_runtime/core/runtime.py" - ], - "requested_layers": [ - "C0_SOURCE_CHUNKS" - ] - }, - "per_layer_outcome": [ - { - "layer_id": "C0_SOURCE_CHUNKS", - "hit_count": 1, - "empty": false, - "fallback_used": false - } - ], - "empty_layers": [], - "evidence_gate_decision": { - "sufficient": true, - "failure_reasons": [], - "evidence_count": 1 - }, - "evidence_gate_input": { - "resolved_target": "src/app_runtime/core/runtime.py", - "sub_intent": "OPEN_FILE", - "target_type": "file", - "evidence_count": 1, - "code_chunk_count": 1, - "entrypoint_count": 0, - "relation_count": 0, - "test_evidence_count": 0, - "symbol_resolution_status": "not_requested", - "path_scope": [ - "src/app_runtime/core/runtime.py" - ] - }, - "post_evidence_gate": { - "input": { - "answer_mode": "normal", - "degraded_message": "", - "resolved_target": "src/app_runtime/core/runtime.py", - "draft_answer_preview": "В файле `src/app_runtime/core/runtime.py` определён класс `RuntimeManager`.\nУ него есть несколько атрибутов класса:\n- `ACTION_TIMEOUT_SECONDS = 10.0`\n- `ACTION_POLL_INTERVAL_SECONDS = 0.05`\n\nКонструктор принимает следующие параметры (все опциональны):\n- `configuration: ConfigurationManager | None`\n-", - "repair_candidate": true - }, - "output": { - "passed": true, - "action": "return", - "reasons": [], - "repair_used": false, - "final_answer_preview": "В файле `src/app_runtime/core/runtime.py` определён класс `RuntimeManager`.\nУ него есть несколько атрибутов класса:\n- `ACTION_TIMEOUT_SECONDS = 10.0`\n- `ACTION_POLL_INTERVAL_SECONDS = 0.05`\n\nКонструктор принимает следующие параметры (все опциональны):\n- `configuration: ConfigurationManager | None`\n-" - } - }, - "failure_reasons": [], - "timings_ms": { - "router": 1, - "retrieval": 295, - "pre_evidence_gate": 1, - "llm": 4019, - "post_evidence_gate": 1 - } - }, - "rag_rows": [ - { - "path": "src/app_runtime/core/runtime.py", - "content": "class RuntimeManager:\n ACTION_TIMEOUT_SECONDS = 10.0\n ACTION_POLL_INTERVAL_SECONDS = 0.05\n\n def __init__(\n self,\n configuration: ConfigurationManager | None = None,\n services: ServiceContainer | None = None,\n traces: TraceService | None = None,\n health: HealthRegistry | None = None,\n logs: LogManager | None = None,\n workers: WorkerSupervisor | None = None,\n control_plane: ControlPlaneService | None = None,\n ) -> None:\n self.configuration = configuration or ConfigurationManager()\n self.services = services or ServiceContainer()\n self.traces = traces or TraceService()\n self.health = health or HealthRegistry()\n self.logs = logs or LogManager()\n self.workers = workers or WorkerSupervisor()\n self.control_plane = control_plane or ControlPlaneService()\n self.registry = ModuleRegistry(self.services)\n self._started = False\n self._state = LifecycleState.IDLE\n self._core_registered = False\n self._workers_registered = False\n self._register_core_services()\n\n def register_module(self, module: ApplicationModule) -> None:\n self.registry.register_module(module.name)\n module.register(self.registry)\n\n def add_config_file(self, path: str) -> FileConfigProvider:\n provider = FileConfigProvider(path)\n self.configuration.add_provider(provider)\n return provider\n\n def start(self, *, start_control_plane: bool = True) -> None:\n if self._started:\n return\n self._state = LifecycleState.STARTING\n config = self.configuration.load()\n self.logs.apply_config(config)\n self._register_health_contributors()\n self._register_workers()\n self.workers.start()\n if start_control_plane:\n self.control_plane.start(self)\n self._started = True\n self._refresh_state()\n\n def stop(self, timeout: float = 30.0, force: bool = False, stop_control_plane: bool = True) -> None:\n if not self._started:\n return\n self._state = LifecycleState.STOPPING\n self.workers.stop(timeout=timeout, force=force)\n if stop_control_plane:\n self.control_plane.stop()\n self._started = False\n self._state = LifecycleState.STOPPED\n\n def status(self) -> dict[str, object]:\n self._refresh_state()\n return self.control_plane.snapshot(self)\n\n def current_health(self) -> HealthPayload:\n self._refresh_state()\n return self.health.payload(self._state, self.workers.healths())\n\n async def health_status(self) -> HealthPayload:\n return self.current_health()\n\n async def start_runtime(self) -> dict[str, object] | str:\n self._refresh_state()\n if self._started:\n return \"runtime already running\"\n if self._state == LifecycleState.STOPPING:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n\n self.start(start_control_plane=False)\n started = self._wait_for_state({LifecycleState.IDLE, LifecycleState.BUSY}, timeout=self.ACTION_TIMEOUT_SECONDS)\n if started:\n return self._action_detail(\"runtime started\", timed_out=False)\n return self._action_detail(\"runtime start is still in progress\", timed_out=True)\n\n async def stop_runtime(self) -> dict[str, object] | str:\n self._refresh_state()\n if not self._started:\n if self._state == LifecycleState.STOPPING:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n return \"runtime already stopped\"\n\n self._state = LifecycleState.STOPPING\n try:\n self.workers.stop(timeout=self.ACTION_TIMEOUT_SECONDS, force=False)\n except TimeoutError:\n return self._action_detail(\"runtime stop is still in progress\", timed_out=True)\n\n self._started = False\n self._state = LifecycleState.STOPPED\n return self._action_detail(\"runtime stopped\", timed_out=False)\n\n async def runtime_status(self) -> str:\n self._refresh_state()\n return self._state.value\n\n def _register_core_services(self) -> None:\n if self._core_registered:\n return\n self.services.register(\"configuration\", self.configuration)\n self.services.register(\"traces\", self.traces)\n self.services.register(\"health\", self.health)\n self.services.register(\"logs\", self.logs)\n self.services.register(\"workers\", self.workers)\n self.services.register(\"control_plane\", self.control_plane)\n self._core_registered = True\n\n def _register_health_contributors(self) -> None:\n for contributor in self.registry.health_contributors:\n self.health.register(contributor)\n\n def _register_workers(self) -> None:\n if self._workers_registered:\n return\n for worker in self.registry.workers:\n self.workers.register(worker)\n self._workers_registered = True\n\n def _refresh_state(self) -> None:\n lifecycle = self.workers.lifecycle_state()\n\n if self._state == LifecycleState.STOPPING:\n if lifecycle == LifecycleState.STOPPED:\n self._started = False\n self._state = LifecycleState.STOPPED\n return\n\n if not self._started:\n if lifecycle == LifecycleState.STOPPED:\n self._state = LifecycleState.STOPPED\n return\n\n self._state = lifecycle\n\n def _wait_for_state(self, target_states: set[LifecycleState], *, timeout: float) -> bool:\n deadline = monotonic() + timeout\n while monotonic() < deadline:\n self._refresh_state()\n if self._state in target_states:\n return True\n sleep(self.ACTION_POLL_INTERVAL_SECONDS)\n self._refresh_state()\n return self._state in target_states\n\n def _action_detail(self, message: str, *, timed_out: bool) -> dict[str, object]:\n self._refresh_state()\n return {\n \"message\": message,\n \"state\": self._state.value,\n \"timed_out\": timed_out,\n \"workers\": self.workers.snapshot(),\n }", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/core/runtime.py:RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.core.runtime", - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "validation": { - "passed": true, - "action": "return", - "reasons": [] - }, - "steps": [ - { - "step": "router", - "status": "completed", - "timings_ms": { - "router": 1 - }, - "output": { - "intent": "CODE_QA", - "sub_intent": "OPEN_FILE", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - } - }, - { - "step": "retrieval", - "status": "completed", - "timings_ms": { - "retrieval": 295 - }, - "output": { - "rag_count": 1, - "answer_path_rag_count": 1, - "resolved_symbol_status": "not_requested", - "resolved_symbol": null, - "requested_layers": [ - "C0_SOURCE_CHUNKS" - ] - }, - "diagnostics": { - "executed_layers": [ - "C0_SOURCE_CHUNKS" - ], - "retrieval_mode_by_layer": { - "C0_SOURCE_CHUNKS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C0_SOURCE_CHUNKS": 200 - }, - "filters_by_layer": { - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src/app_runtime/core/runtime.py" - ] - } - }, - "requests": [ - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Открой файл src/app_runtime/core/runtime.py", - "ranking_profile": "code" - } - ], - "fallback": { - "used": false, - "reason": null - }, - "retrieval_by_layer_ms": { - "C0_SOURCE_CHUNKS": 295 - } - } - }, - { - "step": "pre_evidence_gate", - "status": "passed", - "timings_ms": { - "pre_evidence_gate": 1 - }, - "input": { - "resolved_target": "src/app_runtime/core/runtime.py", - "sub_intent": "OPEN_FILE", - "target_type": "file", - "evidence_count": 1, - "code_chunk_count": 1, - "entrypoint_count": 0, - "relation_count": 0, - "test_evidence_count": 0, - "symbol_resolution_status": "not_requested", - "path_scope": [ - "src/app_runtime/core/runtime.py" - ] - }, - "output": { - "passed": true, - "failure_reasons": [], - "degraded_message": "", - "evidence_count": 1 - } - }, - { - "step": "llm", - "status": "completed", - "timings_ms": { - "llm": 4019 - }, - "output": { - "prompt_name": "code_qa_open_file_answer", - "answer_preview": "В файле `src/app_runtime/core/runtime.py` определён класс `RuntimeManager`.\nУ него есть несколько атрибутов класса:\n- `ACTION_TIMEOUT_SECONDS = 10.0`\n- `ACTION_POLL_INTERVAL_SECONDS = 0.05`\n\nКонструктор принимает следующие параметры (все опциональны):\n- `configuration: ConfigurationManager | None`\n-", - "resolved_target": "src/app_runtime/core/runtime.py", - "answer_policy_branch": "normal_answer", - "decision_reason": "evidence_sufficient" - } - }, - { - "step": "post_evidence_gate", - "status": "passed", - "timings_ms": { - "post_evidence_gate": 1, - "post_evidence_gate_recheck": 0, - "repair": 0 - }, - "input": { - "answer_mode": "normal", - "degraded_message": "", - "resolved_target": "src/app_runtime/core/runtime.py", - "draft_answer_preview": "В файле `src/app_runtime/core/runtime.py` определён класс `RuntimeManager`.\nУ него есть несколько атрибутов класса:\n- `ACTION_TIMEOUT_SECONDS = 10.0`\n- `ACTION_POLL_INTERVAL_SECONDS = 0.05`\n\nКонструктор принимает следующие параметры (все опциональны):\n- `configuration: ConfigurationManager | None`\n-", - "repair_candidate": true - }, - "output": { - "passed": true, - "action": "return", - "reasons": [], - "repair_used": false, - "final_answer_preview": "В файле `src/app_runtime/core/runtime.py` определён класс `RuntimeManager`.\nУ него есть несколько атрибутов класса:\n- `ACTION_TIMEOUT_SECONDS = 10.0`\n- `ACTION_POLL_INTERVAL_SECONDS = 0.05`\n\nКонструктор принимает следующие параметры (все опциональны):\n- `configuration: ConfigurationManager | None`\n-" - } - } - ] - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/plba_full_chain_subintents_v3/20260312_192715/full_chain_plba_code_subintents_v2_plba-v2-open-file-runtime.md b/tests/pipeline_setup_v3/test_results/plba_full_chain_subintents_v3/20260312_192715/full_chain_plba_code_subintents_v2_plba-v2-open-file-runtime.md deleted file mode 100644 index 7666de1..0000000 --- a/tests/pipeline_setup_v3/test_results/plba_full_chain_subintents_v3/20260312_192715/full_chain_plba_code_subintents_v2_plba-v2-open-file-runtime.md +++ /dev/null @@ -1,250 +0,0 @@ -# plba-v2-open-file-runtime - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_02_pipeline/full_chain_plba_code_subintents_v2.yaml -- runner: agent_runtime -- mode: full_chain -- passed: True - -## Query -Открой файл src/app_runtime/core/runtime.py - -## Actual -{ - "intent": "CODE_QA", - "sub_intent": "OPEN_FILE", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 1, - "llm_answer": "В файле `src/app_runtime/core/runtime.py` определён класс `RuntimeManager`.\nУ него есть несколько атрибутов класса:\n- `ACTION_TIMEOUT_SECONDS = 10.0`\n- `ACTION_POLL_INTERVAL_SECONDS = 0.05`\n\nКонструктор принимает следующие параметры (все опциональны):\n- `configuration: ConfigurationManager | None`\n- `services: ServiceContainer | None`\n- `traces: TraceService | None`\n- `health: HealthRegistry | None`\n- `logs: LogManager | None`\n- `workers: WorkerSupervisor | None`\n- `control_plane: ControlPlaneService | None`\n\nЕсли аргумент не передан, используется значение по умолчанию – новый экземпляр соответствующего менеджера или сервиса.", - "answer_mode": "answered", - "path_scope": [ - "src/app_runtime/core/runtime.py" - ], - "symbol_candidates": [], - "layers": [ - "C0_SOURCE_CHUNKS" - ] -} - -## Steps -[ - { - "step": "router", - "status": "completed", - "timings_ms": { - "router": 1 - }, - "output": { - "intent": "CODE_QA", - "sub_intent": "OPEN_FILE", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - } - }, - { - "step": "retrieval", - "status": "completed", - "timings_ms": { - "retrieval": 295 - }, - "output": { - "rag_count": 1, - "answer_path_rag_count": 1, - "resolved_symbol_status": "not_requested", - "resolved_symbol": null, - "requested_layers": [ - "C0_SOURCE_CHUNKS" - ] - }, - "diagnostics": { - "executed_layers": [ - "C0_SOURCE_CHUNKS" - ], - "retrieval_mode_by_layer": { - "C0_SOURCE_CHUNKS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C0_SOURCE_CHUNKS": 200 - }, - "filters_by_layer": { - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src/app_runtime/core/runtime.py" - ] - } - }, - "requests": [ - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Открой файл src/app_runtime/core/runtime.py", - "ranking_profile": "code" - } - ], - "fallback": { - "used": false, - "reason": null - }, - "retrieval_by_layer_ms": { - "C0_SOURCE_CHUNKS": 295 - } - } - }, - { - "step": "pre_evidence_gate", - "status": "passed", - "timings_ms": { - "pre_evidence_gate": 1 - }, - "input": { - "resolved_target": "src/app_runtime/core/runtime.py", - "sub_intent": "OPEN_FILE", - "target_type": "file", - "evidence_count": 1, - "code_chunk_count": 1, - "entrypoint_count": 0, - "relation_count": 0, - "test_evidence_count": 0, - "symbol_resolution_status": "not_requested", - "path_scope": [ - "src/app_runtime/core/runtime.py" - ] - }, - "output": { - "passed": true, - "failure_reasons": [], - "degraded_message": "", - "evidence_count": 1 - } - }, - { - "step": "llm", - "status": "completed", - "timings_ms": { - "llm": 4019 - }, - "output": { - "prompt_name": "code_qa_open_file_answer", - "answer_preview": "В файле `src/app_runtime/core/runtime.py` определён класс `RuntimeManager`.\nУ него есть несколько атрибутов класса:\n- `ACTION_TIMEOUT_SECONDS = 10.0`\n- `ACTION_POLL_INTERVAL_SECONDS = 0.05`\n\nКонструктор принимает следующие параметры (все опциональны):\n- `configuration: ConfigurationManager | None`\n-", - "resolved_target": "src/app_runtime/core/runtime.py", - "answer_policy_branch": "normal_answer", - "decision_reason": "evidence_sufficient" - } - }, - { - "step": "post_evidence_gate", - "status": "passed", - "timings_ms": { - "post_evidence_gate": 1, - "post_evidence_gate_recheck": 0, - "repair": 0 - }, - "input": { - "answer_mode": "normal", - "degraded_message": "", - "resolved_target": "src/app_runtime/core/runtime.py", - "draft_answer_preview": "В файле `src/app_runtime/core/runtime.py` определён класс `RuntimeManager`.\nУ него есть несколько атрибутов класса:\n- `ACTION_TIMEOUT_SECONDS = 10.0`\n- `ACTION_POLL_INTERVAL_SECONDS = 0.05`\n\nКонструктор принимает следующие параметры (все опциональны):\n- `configuration: ConfigurationManager | None`\n-", - "repair_candidate": true - }, - "output": { - "passed": true, - "action": "return", - "reasons": [], - "repair_used": false, - "final_answer_preview": "В файле `src/app_runtime/core/runtime.py` определён класс `RuntimeManager`.\nУ него есть несколько атрибутов класса:\n- `ACTION_TIMEOUT_SECONDS = 10.0`\n- `ACTION_POLL_INTERVAL_SECONDS = 0.05`\n\nКонструктор принимает следующие параметры (все опциональны):\n- `configuration: ConfigurationManager | None`\n-" - } - } -] - -## Diagnostics -{ - "intent_correct": null, - "target_found": true, - "layers_used": [ - "C0_SOURCE_CHUNKS" - ], - "retrieval_sufficient": true, - "answer_mode": "normal", - "resolved_target": "src/app_runtime/core/runtime.py", - "answer_policy_branch": "normal_answer", - "decision_reason": "evidence_sufficient", - "router_result": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "retrieval_profile": "code", - "sub_intent": "OPEN_FILE", - "path_scope": [ - "src/app_runtime/core/runtime.py" - ], - "layers": [ - "C0_SOURCE_CHUNKS" - ], - "symbol_resolution_status": "not_requested" - }, - "retrieval_request": { - "rag_session_id": "7d11da21-faa0-4cea-aede-aeabe069164c", - "query": "Открой файл src/app_runtime/core/runtime.py", - "sub_intent": "OPEN_FILE", - "path_scope": [ - "src/app_runtime/core/runtime.py" - ], - "requested_layers": [ - "C0_SOURCE_CHUNKS" - ] - }, - "per_layer_outcome": [ - { - "layer_id": "C0_SOURCE_CHUNKS", - "hit_count": 1, - "empty": false, - "fallback_used": false - } - ], - "empty_layers": [], - "evidence_gate_decision": { - "sufficient": true, - "failure_reasons": [], - "evidence_count": 1 - }, - "evidence_gate_input": { - "resolved_target": "src/app_runtime/core/runtime.py", - "sub_intent": "OPEN_FILE", - "target_type": "file", - "evidence_count": 1, - "code_chunk_count": 1, - "entrypoint_count": 0, - "relation_count": 0, - "test_evidence_count": 0, - "symbol_resolution_status": "not_requested", - "path_scope": [ - "src/app_runtime/core/runtime.py" - ] - }, - "post_evidence_gate": { - "input": { - "answer_mode": "normal", - "degraded_message": "", - "resolved_target": "src/app_runtime/core/runtime.py", - "draft_answer_preview": "В файле `src/app_runtime/core/runtime.py` определён класс `RuntimeManager`.\nУ него есть несколько атрибутов класса:\n- `ACTION_TIMEOUT_SECONDS = 10.0`\n- `ACTION_POLL_INTERVAL_SECONDS = 0.05`\n\nКонструктор принимает следующие параметры (все опциональны):\n- `configuration: ConfigurationManager | None`\n-", - "repair_candidate": true - }, - "output": { - "passed": true, - "action": "return", - "reasons": [], - "repair_used": false, - "final_answer_preview": "В файле `src/app_runtime/core/runtime.py` определён класс `RuntimeManager`.\nУ него есть несколько атрибутов класса:\n- `ACTION_TIMEOUT_SECONDS = 10.0`\n- `ACTION_POLL_INTERVAL_SECONDS = 0.05`\n\nКонструктор принимает следующие параметры (все опциональны):\n- `configuration: ConfigurationManager | None`\n-" - } - }, - "failure_reasons": [], - "timings_ms": { - "router": 1, - "retrieval": 295, - "pre_evidence_gate": 1, - "llm": 4019, - "post_evidence_gate": 1 - } -} - -## Mismatches -- none \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/plba_full_chain_subintents_v3/20260312_192715/full_chain_plba_code_subintents_v2_plba-v2-trace-flow-health-endpoint.json b/tests/pipeline_setup_v3/test_results/plba_full_chain_subintents_v3/20260312_192715/full_chain_plba_code_subintents_v2_plba-v2-trace-flow-health-endpoint.json deleted file mode 100644 index 3decbe7..0000000 --- a/tests/pipeline_setup_v3/test_results/plba_full_chain_subintents_v3/20260312_192715/full_chain_plba_code_subintents_v2_plba-v2-trace-flow-health-endpoint.json +++ /dev/null @@ -1,5032 +0,0 @@ -{ - "case_id": "plba-v2-trace-flow-health-endpoint", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_02_pipeline/full_chain_plba_code_subintents_v2.yaml", - "runner": "agent_runtime", - "mode": "full_chain", - "query": "Покажи как проходит запрос /health в HttpControlAppFactory", - "actual": { - "intent": "CODE_QA", - "sub_intent": "TRACE_FLOW", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 37, - "llm_answer": "Запрос `/health` обрабатывается следующим образом:\n\n1. В `HttpControlAppFactory` создаётся маршрут `@app.get(\"/health\")`, который вызывает функцию `health`.\n - Путь: `src/app_runtime/control/http_app.py`\n - Строки: 31–34\n\n2. Функция `health` асинхронно ожидает данные от провайдера здоровья (`health_provider`), переданного в фабрику приложений.\n - Путь: `src/app_runtime/control/http_app.py`\n - Строки: 31–34\n\n3. Провайдер здоровья реализуется методом `_health_response` в классе `HttpControlChannel`. Он проверяет наличие действий (`_actions`) и возвращает статус здоровья.\n - Путь: `src/app_runtime/control/http_channel.py`\n - Строки: 44–50\n\nТаким образом, запрос `/health` проходит через эти компоненты для получения ответа о состоянии системы.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "health", - "HttpControlAppFactory" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "passed": true, - "mismatches": [], - "details": { - "query": "Покажи как проходит запрос /health в HttpControlAppFactory", - "router_result": { - "schema_version": "1.1", - "intent": "CODE_QA", - "retrieval_profile": "code", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query_plan": { - "raw": "Покажи как проходит запрос /health в HttpControlAppFactory", - "normalized": "Покажи как проходит запрос /health в HttpControlAppFactory", - "sub_intent": "TRACE_FLOW", - "negations": [], - "expansions": [ - "health", - "HttpControlAppFactory" - ], - "keyword_hints": [ - "health", - "HttpControlAppFactory" - ], - "path_hints": [], - "doc_scope_hints": [], - "symbol_candidates": [ - "health", - "HttpControlAppFactory" - ], - "symbol_kind_hint": "unknown", - "anchors": [ - { - "type": "SYMBOL", - "value": "health", - "source": "user_text", - "subtype": null, - "span": { - "start": 28, - "end": 34 - }, - "confidence": 0.88 - }, - { - "type": "SYMBOL", - "value": "HttpControlAppFactory", - "source": "user_text", - "subtype": null, - "span": { - "start": 37, - "end": 58 - }, - "confidence": 0.88 - } - ] - }, - "retrieval_spec": { - "domains": [ - "CODE" - ], - "layer_queries": [ - { - "layer_id": "C1_SYMBOL_CATALOG", - "top_k": 8 - }, - { - "layer_id": "C0_SOURCE_CHUNKS", - "top_k": 8 - }, - { - "layer_id": "C4_SEMANTIC_ROLES", - "top_k": 8 - }, - { - "layer_id": "C2_DEPENDENCY_GRAPH", - "top_k": 10 - }, - { - "layer_id": "C3_ENTRYPOINTS", - "top_k": 10 - } - ], - "filters": { - "test_policy": "EXCLUDE", - "path_scope": [], - "language": [ - "python" - ] - }, - "rerank_profile": "code" - }, - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - }, - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "HttpControlAppFactory", - "alternatives": [ - "HttpControlAppFactory", - "HttpControlAppFactory", - "ControlActionSet", - "ControlPlaneService", - "HealthContributor.health" - ], - "confidence": 0.99 - }, - "evidence_policy": { - "require_def": true, - "require_flow": true, - "require_spec": false, - "allow_answer_without_evidence": false - } - }, - "retrieval_request": { - "rag_session_id": "7d11da21-faa0-4cea-aede-aeabe069164c", - "query": "Покажи как проходит запрос /health в HttpControlAppFactory", - "sub_intent": "TRACE_FLOW", - "path_scope": [], - "keyword_hints": [ - "health", - "HttpControlAppFactory" - ], - "symbol_candidates": [ - "health", - "HttpControlAppFactory" - ], - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_spec": { - "domains": [ - "CODE" - ], - "layer_queries": [ - { - "layer_id": "C1_SYMBOL_CATALOG", - "top_k": 8 - }, - { - "layer_id": "C0_SOURCE_CHUNKS", - "top_k": 8 - }, - { - "layer_id": "C4_SEMANTIC_ROLES", - "top_k": 8 - }, - { - "layer_id": "C2_DEPENDENCY_GRAPH", - "top_k": 10 - }, - { - "layer_id": "C3_ENTRYPOINTS", - "top_k": 10 - } - ], - "filters": { - "test_policy": "EXCLUDE", - "path_scope": [], - "language": [ - "python" - ] - }, - "rerank_profile": "code" - }, - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - }, - "query_plan": { - "raw": "Покажи как проходит запрос /health в HttpControlAppFactory", - "normalized": "Покажи как проходит запрос /health в HttpControlAppFactory", - "sub_intent": "TRACE_FLOW", - "negations": [], - "expansions": [ - "health", - "HttpControlAppFactory" - ], - "keyword_hints": [ - "health", - "HttpControlAppFactory" - ], - "path_hints": [], - "doc_scope_hints": [], - "symbol_candidates": [ - "health", - "HttpControlAppFactory" - ], - "symbol_kind_hint": "unknown", - "anchors": [ - { - "type": "SYMBOL", - "value": "health", - "source": "user_text", - "subtype": null, - "span": { - "start": 28, - "end": 34 - }, - "confidence": 0.88 - }, - { - "type": "SYMBOL", - "value": "HttpControlAppFactory", - "source": "user_text", - "subtype": null, - "span": { - "start": 37, - "end": 58 - }, - "confidence": 0.88 - } - ] - } - }, - "retrieval_result": { - "target_symbol_candidates": [ - "HttpControlAppFactory", - "ControlActionSet", - "ControlPlaneService", - "HealthContributor.health", - "HealthContributor", - "ControlChannel" - ], - "resolved_symbol": "HttpControlAppFactory", - "symbol_resolution_status": "resolved", - "file_candidates": [ - "src/app_runtime/control/http_app.py", - "src/app_runtime/control/http_channel.py", - "src/app_runtime/control/base.py", - "src/app_runtime/control/__init__.py", - "src/app_runtime/contracts/health.py", - "src/app_runtime/control/http_runner.py", - "src/app_runtime/control/service.py", - "src/app_runtime/health/registry.py", - "src/app_runtime/core/types.py" - ], - "code_chunks": [ - { - "layer": "C1_SYMBOL_CATALOG", - "path": "src/app_runtime/control/http_app.py", - "title": "HttpControlAppFactory", - "content": "class HttpControlAppFactory\nHttpControlAppFactory", - "start_line": 15, - "end_line": 53, - "metadata": { - "symbol_id": "9b3502a5fb408b273223db13264349cf500de24915b6c649d9ea8970d0dfd8e0", - "qname": "HttpControlAppFactory", - "kind": "class", - "signature": "HttpControlAppFactory", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.control.http_app", - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C1_SYMBOL_CATALOG", - "path": "src/app_runtime/control/http_channel.py", - "title": "HttpControlAppFactory", - "content": "const HttpControlAppFactory\nHttpControlAppFactory = app_runtime.control.http_app.HttpControlAppFactory", - "start_line": 8, - "end_line": 8, - "metadata": { - "symbol_id": "9ee00379ee797cd2386e88a6e37dc69e3e31de9144fc4b95f0206cd1430e8983", - "qname": "HttpControlAppFactory", - "kind": "const", - "signature": "HttpControlAppFactory = app_runtime.control.http_app.HttpControlAppFactory", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.control.http_channel", - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C1_SYMBOL_CATALOG", - "path": "src/app_runtime/control/base.py", - "title": "ControlActionSet", - "content": "class ControlActionSet\nControlActionSet", - "start_line": 14, - "end_line": 18, - "metadata": { - "symbol_id": "46eb026cb3313415ec47b82dd22f84f4d112c9d987e8b1716dcb0baa1cce8988", - "qname": "ControlActionSet", - "kind": "class", - "signature": "ControlActionSet", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.control.base", - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C1_SYMBOL_CATALOG", - "path": "src/app_runtime/control/__init__.py", - "title": "ControlPlaneService", - "content": "const ControlPlaneService\nControlPlaneService = app_runtime.control.service.ControlPlaneService", - "start_line": 3, - "end_line": 3, - "metadata": { - "symbol_id": "217e8f044d1c01644bf7b81e5046af9e84469210c692a2fb0c476a19bb069ae1", - "qname": "ControlPlaneService", - "kind": "const", - "signature": "ControlPlaneService = app_runtime.control.service.ControlPlaneService", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.control.__init__", - "is_test": false, - "blob_sha": "bf3c37e3369a84cc618adc0fd71c232e5eb4b871eaff743069a17e661e498316", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C1_SYMBOL_CATALOG", - "path": "src/app_runtime/contracts/health.py", - "title": "HealthContributor.health", - "content": "method HealthContributor.health\nhealth(self)\nReturn contributor health state.", - "start_line": 9, - "end_line": 10, - "metadata": { - "symbol_id": "728cff18958d8a25e2661a0f08c83d68c3bbbfa8cef212b85dc0da2b11b3dc90", - "qname": "HealthContributor.health", - "kind": "method", - "signature": "health(self)", - "parent_symbol_id": "HealthContributor", - "package_or_module": "src.app_runtime.contracts.health", - "is_test": false, - "blob_sha": "6bd92611def7131e32d4dd34a8ed85e6cf3c67722ad27797032a632cb30dc097", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C1_SYMBOL_CATALOG", - "path": "src/app_runtime/contracts/health.py", - "title": "HealthContributor", - "content": "class HealthContributor\nHealthContributor(ABC)", - "start_line": 7, - "end_line": 10, - "metadata": { - "symbol_id": "db91ae387b89a2e9d83829754f27fa18a4055b3e72d7f31789a0b8e0bf5bba0b", - "qname": "HealthContributor", - "kind": "class", - "signature": "HealthContributor(ABC)", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.contracts.health", - "is_test": false, - "blob_sha": "6bd92611def7131e32d4dd34a8ed85e6cf3c67722ad27797032a632cb30dc097", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C1_SYMBOL_CATALOG", - "path": "src/app_runtime/control/__init__.py", - "title": "ControlActionSet", - "content": "const ControlActionSet\nControlActionSet = app_runtime.control.base.ControlActionSet", - "start_line": 1, - "end_line": 1, - "metadata": { - "symbol_id": "767e4ac0d4224aeccb0783a38359d3c03899a876736eb83d99887c16ea07cc6c", - "qname": "ControlActionSet", - "kind": "const", - "signature": "ControlActionSet = app_runtime.control.base.ControlActionSet", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.control.__init__", - "is_test": false, - "blob_sha": "bf3c37e3369a84cc618adc0fd71c232e5eb4b871eaff743069a17e661e498316", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C1_SYMBOL_CATALOG", - "path": "src/app_runtime/control/__init__.py", - "title": "ControlChannel", - "content": "const ControlChannel\nControlChannel = app_runtime.control.base.ControlChannel", - "start_line": 1, - "end_line": 1, - "metadata": { - "symbol_id": "268420f7aa4ed74082b9276cae0cded4f00bac090ffd58fa020a65be0fe19c27", - "qname": "ControlChannel", - "kind": "const", - "signature": "ControlChannel = app_runtime.control.base.ControlChannel", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.control.__init__", - "is_test": false, - "blob_sha": "bf3c37e3369a84cc618adc0fd71c232e5eb4b871eaff743069a17e661e498316", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C0_SOURCE_CHUNKS", - "path": "src/app_runtime/control/http_channel.py", - "title": "src/app_runtime/control/http_channel.py:HttpControlChannel", - "content": "class HttpControlChannel(ControlChannel):\n def __init__(self, host: str, port: int, timeout: int) -> None:\n self._timeout = timeout\n self._runner = UvicornThreadRunner(host, port, timeout)\n self._factory = HttpControlAppFactory()\n self._actions: ControlActionSet | None = None\n\n async def start(self, actions: ControlActionSet) -> None:\n self._actions = actions\n app = self._factory.create(self._health_response, self._action_response)\n await self._runner.start(app)\n\n async def stop(self) -> None:\n await self._runner.stop()\n\n @property\n def port(self) -> int:\n return self._runner.port\n\n async def _health_response(self) -> dict[str, object]:\n if self._actions is None:\n return {\"status\": \"unhealthy\", \"detail\": \"control actions are not configured\"}\n return await asyncio.wait_for(self._actions.health(), timeout=float(self._timeout))\n\n async def _action_response(self, action: str, _client_source: str = \"unknown\") -> JSONResponse:\n if self._actions is None:\n return JSONResponse(content={\"status\": \"error\", \"detail\": f\"{action} handler is not configured\"}, status_code=404)\n callbacks = {\n \"start\": self._actions.start,\n \"stop\": self._actions.stop,\n \"status\": self._actions.status,\n }\n callback = callbacks.get(action)\n if callback is None:\n return JSONResponse(content={\"status\": \"error\", \"detail\": f\"unsupported action: {action}\"}, status_code=404)\n action_timeout = max(float(self._timeout), 10.0) if action in {\"start\", \"stop\"} else float(self._timeout)\n try:\n detail = await asyncio.wait_for(callback(), timeout=action_timeout)\n except asyncio.TimeoutError:\n return JSONResponse(\n content={\"status\": \"accepted\", \"detail\": f\"{action} operation is still in progress\"},\n status_code=202,\n )\n except Exception as exc:\n return JSONResponse(content={\"status\": \"error\", \"detail\": str(exc)}, status_code=500)\n return JSONResponse(content={\"status\": \"ok\", \"detail\": detail or f\"{action} action accepted\"}, status_code=200)", - "start_line": 12, - "end_line": 57, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.http_channel", - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C0_SOURCE_CHUNKS", - "path": "src/app_runtime/control/http_runner.py", - "title": "src/app_runtime/control/http_runner.py:UvicornThreadRunner", - "content": "class UvicornThreadRunner:\n def __init__(self, host: str, port: int, timeout: int) -> None:\n self._host = host\n self._port = port\n self._timeout = timeout\n self._server: Server | None = None\n self._thread: Thread | None = None\n self._error: BaseException | None = None\n\n async def start(self, app: FastAPI) -> None:\n if self._thread is not None and self._thread.is_alive():\n return\n self._error = None\n config = Config(app=app, host=self._host, port=self._port, log_level=\"warning\")\n self._server = Server(config)\n self._thread = Thread(target=self._serve, name=\"plba-http-control\", daemon=True)\n self._thread.start()\n await self._wait_until_started()\n\n async def stop(self) -> None:\n if self._server is None or self._thread is None:\n return\n self._server.should_exit = True\n await asyncio.to_thread(self._thread.join, self._timeout)\n self._server = None\n self._thread = None\n\n @property\n def port(self) -> int:\n if self._server is None or not getattr(self._server, \"servers\", None):\n return self._port\n socket = self._server.servers[0].sockets[0]\n return int(socket.getsockname()[1])\n\n async def _wait_until_started(self) -> None:\n if self._server is None:\n raise RuntimeError(\"Server is not initialized\")\n deadline = asyncio.get_running_loop().time() + max(float(self._timeout), 1.0)\n while not self._server.started:\n if self._error is not None:\n raise RuntimeError(\"HTTP control server failed to start\") from self._error\n if asyncio.get_running_loop().time() >= deadline:\n raise TimeoutError(\"HTTP control server startup timed out\")\n await asyncio.sleep(0.05)\n\n def _serve(self) -> None:\n if self._server is None:\n return\n try:\n asyncio.run(self._server.serve())\n except BaseException as exc: # noqa: BLE001\n self._error = exc", - "start_line": 10, - "end_line": 61, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.http_runner", - "is_test": false, - "blob_sha": "3779fdd2878b770e789a35bb2a89c9d79f13b61c26d7db1b3b683f9bb9e1623f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C0_SOURCE_CHUNKS", - "path": "src/app_runtime/control/http_app.py", - "title": "src/app_runtime/control/http_app.py:HttpControlAppFactory", - "content": "class HttpControlAppFactory:\n def create(\n self,\n health_provider: Callable[[], Awaitable[HealthPayload]],\n action_provider: Callable[[str, str], Awaitable[JSONResponse]],\n ) -> FastAPI:\n app = FastAPI(title=\"PLBA Control API\")\n\n @app.middleware(\"http\")\n async def log_api_call(request: Request, call_next): # type: ignore[no-untyped-def]\n started = time.monotonic()\n response = await call_next(request)\n response.headers[\"X-Response-Time-Ms\"] = str(int((time.monotonic() - started) * 1000))\n return response\n\n @app.get(\"/health\")\n async def health() -> JSONResponse:\n payload = await health_provider()\n status_code = 200 if payload.get(\"status\") == \"ok\" else 503\n return JSONResponse(content=payload, status_code=status_code)\n\n @app.get(\"/actions/{action}\")\n @app.post(\"/actions/{action}\")\n async def action(action: str, request: Request) -> JSONResponse:\n client_source = self._client_source(request)\n if action in {\"start\", \"stop\"}:\n LOGGER.warning(\"Control action requested: /actions/%s client=%s\", action, client_source)\n return await action_provider(action, client_source)\n\n return app\n\n def _client_source(self, request: Request) -> str:\n explicit_header = request.headers.get(\"X-Client-Source\", \"\").strip()\n if explicit_header:\n return explicit_header\n user_agent = request.headers.get(\"User-Agent\", \"\").strip()\n if user_agent:\n return f\"user-agent:{user_agent}\"\n return \"unknown\"", - "start_line": 15, - "end_line": 53, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.http_app", - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C0_SOURCE_CHUNKS", - "path": "src/app_runtime/contracts/health.py", - "title": "src/app_runtime/contracts/health.py:HealthContributor", - "content": "class HealthContributor(ABC):\n @abstractmethod\n def health(self) -> WorkerHealth:\n \"\"\"Return contributor health state.\"\"\"", - "start_line": 7, - "end_line": 10, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.contracts.health", - "is_test": false, - "blob_sha": "6bd92611def7131e32d4dd34a8ed85e6cf3c67722ad27797032a632cb30dc097", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C0_SOURCE_CHUNKS", - "path": "src/app_runtime/control/base.py", - "title": "src/app_runtime/control/base.py:ControlChannel", - "content": "class ControlChannel(ABC):\n @abstractmethod\n async def start(self, actions: ControlActionSet) -> None:\n \"\"\"Start the control channel and bind handlers.\"\"\"\n\n @abstractmethod\n async def stop(self) -> None:\n \"\"\"Stop the control channel and release resources.\"\"\"", - "start_line": 21, - "end_line": 28, - "metadata": { - "chunk_index": 1, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.base", - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C0_SOURCE_CHUNKS", - "path": "src/app_runtime/control/__init__.py", - "title": "src/app_runtime/control/__init__.py:1-5", - "content": "from app_runtime.control.base import ControlActionSet, ControlChannel\nfrom app_runtime.control.http_channel import HttpControlChannel\nfrom app_runtime.control.service import ControlPlaneService\n\n__all__ = [\"ControlActionSet\", \"ControlChannel\", \"ControlPlaneService\", \"HttpControlChannel\"]", - "start_line": 1, - "end_line": 5, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.app_runtime.control.__init__", - "is_test": false, - "blob_sha": "bf3c37e3369a84cc618adc0fd71c232e5eb4b871eaff743069a17e661e498316", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C0_SOURCE_CHUNKS", - "path": "src/app_runtime/control/base.py", - "title": "src/app_runtime/control/base.py:ControlActionSet", - "content": "class ControlActionSet:\n health: HealthHandler\n start: ActionHandler\n stop: ActionHandler\n status: ActionHandler", - "start_line": 14, - "end_line": 18, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.base", - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C0_SOURCE_CHUNKS", - "path": "src/app_runtime/control/service.py", - "title": "src/app_runtime/control/service.py:ControlPlaneService", - "content": "class ControlPlaneService:\n def __init__(self) -> None:\n self._channels: list[ControlChannel] = []\n\n def register_channel(self, channel: ControlChannel) -> None:\n self._channels.append(channel)\n\n def start(self, runtime: RuntimeManager) -> None:\n if not self._channels:\n return\n asyncio.run(self._start_async(runtime))\n\n def stop(self) -> None:\n if not self._channels:\n return\n asyncio.run(self._stop_async())\n\n def snapshot(self, runtime: RuntimeManager) -> dict[str, object]:\n health = runtime.current_health()\n return {\n \"runtime\": {\"state\": runtime._state.value},\n \"modules\": list(runtime.registry.modules),\n \"services\": runtime.services.snapshot(),\n \"workers\": runtime.workers.snapshot(),\n \"health\": runtime.health.snapshot(runtime.workers.healths()) | {\"status\": health[\"status\"]},\n \"config\": runtime.configuration.get(),\n }\n\n async def _start_async(self, runtime: RuntimeManager) -> None:\n actions = ControlActionSet(\n health=runtime.health_status,\n start=runtime.start_runtime,\n stop=runtime.stop_runtime,\n status=runtime.runtime_status,\n )\n for channel in self._channels:\n await channel.start(actions)\n\n async def _stop_async(self) -> None:\n for channel in reversed(self._channels):\n await channel.stop()", - "start_line": 12, - "end_line": 52, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.service", - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C4_SEMANTIC_ROLES", - "path": "src/app_runtime/control/http_app.py", - "title": "HttpControlAppFactory", - "content": "HttpControlAppFactory\nrole: factory\n\nResponsibilities:\n- name suffix suggests factory", - "start_line": 15, - "end_line": 53, - "metadata": { - "symbol_id": "9b3502a5fb408b273223db13264349cf500de24915b6c649d9ea8970d0dfd8e0", - "symbol_name": "HttpControlAppFactory", - "qname": "HttpControlAppFactory", - "role": "factory", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C4_SEMANTIC_ROLES", - "path": "src/app_runtime/health/registry.py", - "title": "HealthRegistry", - "content": "HealthRegistry\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (2)", - "start_line": 8, - "end_line": 56, - "metadata": { - "symbol_id": "fd3390eb0ba29c9979466b9c2117238e0da3bb829eeb4d505cb34c9c3df7a8e8", - "symbol_name": "HealthRegistry", - "qname": "HealthRegistry", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 2, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "26e6a24daa43407ba5340b74497c20153020e79f8d7828ae502aaec378dfcf75", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C4_SEMANTIC_ROLES", - "path": "src/app_runtime/core/types.py", - "title": "HealthPayload", - "content": "HealthPayload\nrole: model\n\nResponsibilities:\n- default model role", - "start_line": 7, - "end_line": 11, - "metadata": { - "symbol_id": "392235d63ddf752d6e419cb8528c93fe070d1bc02d3c87ba6a897baac810cf5d", - "symbol_name": "HealthPayload", - "qname": "HealthPayload", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "448a02e4a432b5ab65b246b2bd24a32a6f127b9d2091ea73b53ee3c0a2f53bb3", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C4_SEMANTIC_ROLES", - "path": "src/app_runtime/contracts/health.py", - "title": "HealthContributor", - "content": "HealthContributor\nrole: model\n\nResponsibilities:\n- default model role", - "start_line": 7, - "end_line": 10, - "metadata": { - "symbol_id": "db91ae387b89a2e9d83829754f27fa18a4055b3e72d7f31789a0b8e0bf5bba0b", - "symbol_name": "HealthContributor", - "qname": "HealthContributor", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "6bd92611def7131e32d4dd34a8ed85e6cf3c67722ad27797032a632cb30dc097", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C4_SEMANTIC_ROLES", - "path": "src/app_runtime/control/base.py", - "title": "ControlActionSet", - "content": "ControlActionSet\nrole: model\n\nResponsibilities:\n- default model role", - "start_line": 14, - "end_line": 18, - "metadata": { - "symbol_id": "46eb026cb3313415ec47b82dd22f84f4d112c9d987e8b1716dcb0baa1cce8988", - "symbol_name": "ControlActionSet", - "qname": "ControlActionSet", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C4_SEMANTIC_ROLES", - "path": "src/app_runtime/control/base.py", - "title": "ControlChannel", - "content": "ControlChannel\nrole: model\n\nResponsibilities:\n- default model role", - "start_line": 21, - "end_line": 28, - "metadata": { - "symbol_id": "cfcfe9a311d3a2dbdaf32ac4ccd73c0eb9a117f830591a1c0867ee97d46204ff", - "symbol_name": "ControlChannel", - "qname": "ControlChannel", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C4_SEMANTIC_ROLES", - "path": "src/app_runtime/control/service.py", - "title": "ControlPlaneService", - "content": "ControlPlaneService\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests service\n- reads and writes state attributes\n- participates in dataflow slices (5)", - "start_line": 12, - "end_line": 52, - "metadata": { - "symbol_id": "b13471e5916986dccffb53fab613812842965705e6b3a89ae549d30c9e91e9aa", - "symbol_name": "ControlPlaneService", - "qname": "ControlPlaneService", - "role": "pipeline_stage", - "confidence": 0.57, - "dataflow_participation": 5, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C4_SEMANTIC_ROLES", - "path": "src/app_runtime/control/http_runner.py", - "title": "UvicornThreadRunner", - "content": "UvicornThreadRunner\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (24)", - "start_line": 10, - "end_line": 61, - "metadata": { - "symbol_id": "fd55630045a02100df8877ac27d951ee08617d4598764394d48cb51fe067476a", - "symbol_name": "UvicornThreadRunner", - "qname": "UvicornThreadRunner", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 24, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "3779fdd2878b770e789a35bb2a89c9d79f13b61c26d7db1b3b683f9bb9e1623f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "path": "src/app_runtime/health/registry.py", - "title": "HealthRegistry.__init__:dataflow_slice", - "content": "HealthRegistry.__init__\n -> HealthRegistry._contributors\n -> HealthRegistry.register", - "start_line": 10, - "end_line": 13, - "metadata": { - "edge_id": "2381dfb339d541367c3251d2a610cac9d8b3f6bd6a352e119d00a93c5ccc2b7d", - "edge_type": "dataflow_slice", - "src_symbol_id": "e8ffd58441c231de43d9e86c31eb12303d4e2bf045b2acf13d1dfe78da01f8dc", - "src_qname": "HealthRegistry.__init__", - "dst_symbol_id": "a9e1f290c346c8bb1d67af0cafeebb5bcaf29c3ed7027e33c794532743df38f2", - "dst_ref": "HealthRegistry.register", - "resolution": "resolved", - "slice_id": "2381dfb339d541367c3251d2a610cac9d8b3f6bd6a352e119d00a93c5ccc2b7d", - "root_symbol_id": "e8ffd58441c231de43d9e86c31eb12303d4e2bf045b2acf13d1dfe78da01f8dc", - "path_symbols": [ - "HealthRegistry.__init__", - "HealthRegistry._contributors", - "HealthRegistry.register" - ], - "path_symbol_ids": [ - "e8ffd58441c231de43d9e86c31eb12303d4e2bf045b2acf13d1dfe78da01f8dc", - "a9e1f290c346c8bb1d67af0cafeebb5bcaf29c3ed7027e33c794532743df38f2" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "26e6a24daa43407ba5340b74497c20153020e79f8d7828ae502aaec378dfcf75", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "path": "src/app_runtime/control/service.py", - "title": "ControlPlaneService.__init__:dataflow_slice", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.start", - "start_line": 14, - "end_line": 20, - "metadata": { - "edge_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154", - "dst_ref": "ControlPlaneService.start", - "resolution": "resolved", - "slice_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.start" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "path": "src/app_runtime/control/service.py", - "title": "ControlPlaneService.__init__:dataflow_slice", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.stop", - "start_line": 14, - "end_line": 25, - "metadata": { - "edge_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d", - "dst_ref": "ControlPlaneService.stop", - "resolution": "resolved", - "slice_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.stop" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "path": "src/app_runtime/control/service.py", - "title": "ControlPlaneService.__init__:dataflow_slice", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._stop_async", - "start_line": 14, - "end_line": 51, - "metadata": { - "edge_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a", - "dst_ref": "ControlPlaneService._stop_async", - "resolution": "resolved", - "slice_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._stop_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "path": "src/app_runtime/health/registry.py", - "title": "HealthRegistry.__init__:dataflow_slice", - "content": "HealthRegistry.__init__\n -> HealthRegistry._contributors\n -> HealthRegistry.contributor_healths", - "start_line": 10, - "end_line": 16, - "metadata": { - "edge_id": "d3a88a7abf16359e903e809ffc24473658fdd8198f60641fe1584fc4ac663c31", - "edge_type": "dataflow_slice", - "src_symbol_id": "e8ffd58441c231de43d9e86c31eb12303d4e2bf045b2acf13d1dfe78da01f8dc", - "src_qname": "HealthRegistry.__init__", - "dst_symbol_id": "fa7bbd8f4b64a55a5088640c30f52e84075d65f531bd7e1f6c1d7bb8d24fcbf2", - "dst_ref": "HealthRegistry.contributor_healths", - "resolution": "resolved", - "slice_id": "d3a88a7abf16359e903e809ffc24473658fdd8198f60641fe1584fc4ac663c31", - "root_symbol_id": "e8ffd58441c231de43d9e86c31eb12303d4e2bf045b2acf13d1dfe78da01f8dc", - "path_symbols": [ - "HealthRegistry.__init__", - "HealthRegistry._contributors", - "HealthRegistry.contributor_healths" - ], - "path_symbol_ids": [ - "e8ffd58441c231de43d9e86c31eb12303d4e2bf045b2acf13d1dfe78da01f8dc", - "fa7bbd8f4b64a55a5088640c30f52e84075d65f531bd7e1f6c1d7bb8d24fcbf2" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "26e6a24daa43407ba5340b74497c20153020e79f8d7828ae502aaec378dfcf75", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "path": "src/app_runtime/control/service.py", - "title": "ControlPlaneService.__init__:dataflow_slice", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._start_async", - "start_line": 14, - "end_line": 47, - "metadata": { - "edge_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517", - "dst_ref": "ControlPlaneService._start_async", - "resolution": "resolved", - "slice_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._start_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "path": "src/app_runtime/control/service.py", - "title": "ControlPlaneService.__init__:dataflow_slice", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.register_channel", - "start_line": 14, - "end_line": 17, - "metadata": { - "edge_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957", - "dst_ref": "ControlPlaneService.register_channel", - "resolution": "resolved", - "slice_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.register_channel" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "path": "src/app_runtime/control/http_app.py", - "title": "HttpControlAppFactory.create:calls", - "content": "HttpControlAppFactory.create calls time.monotonic", - "start_line": 25, - "end_line": 25, - "metadata": { - "edge_id": "3fdd0a88d10225ee74f3b84ab57e13f09f5ccc72f00e31af9ae4655411c289c0", - "edge_type": "calls", - "src_symbol_id": "4af42c2a9275d652e710a98ec48b8247236b4453a093629f8958704ff6d3cb58", - "src_qname": "HttpControlAppFactory.create", - "dst_symbol_id": null, - "dst_ref": "time.monotonic", - "resolution": "partial", - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "path": "src/app_runtime/control/http_app.py", - "title": "HttpControlAppFactory.create:calls", - "content": "HttpControlAppFactory.create calls app.post", - "start_line": 37, - "end_line": 37, - "metadata": { - "edge_id": "0e545d4b5187db7bec5ceac03071d2ad68177550c42af748fee364639e533c90", - "edge_type": "calls", - "src_symbol_id": "4af42c2a9275d652e710a98ec48b8247236b4453a093629f8958704ff6d3cb58", - "src_qname": "HttpControlAppFactory.create", - "dst_symbol_id": null, - "dst_ref": "app.post", - "resolution": "partial", - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "path": "src/app_runtime/control/http_app.py", - "title": "HttpControlAppFactory.create:calls", - "content": "HttpControlAppFactory.create calls str", - "start_line": 27, - "end_line": 27, - "metadata": { - "edge_id": "2a87c51461e31cd556508cc37fdff37b4d24c26f7f1604db30af5e8f1bda96cb", - "edge_type": "calls", - "src_symbol_id": "4af42c2a9275d652e710a98ec48b8247236b4453a093629f8958704ff6d3cb58", - "src_qname": "HttpControlAppFactory.create", - "dst_symbol_id": null, - "dst_ref": "str", - "resolution": "partial", - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C3_ENTRYPOINTS", - "path": "src/app_runtime/control/http_app.py", - "title": "app.post", - "content": "fastapi http app.post", - "start_line": 38, - "end_line": 42, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C3_ENTRYPOINTS", - "path": "src/app_runtime/control/http_app.py", - "title": "app.get", - "content": "fastapi http app.get", - "start_line": 31, - "end_line": 34, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C3_ENTRYPOINTS", - "path": "src/app_runtime/control/http_app.py", - "title": "app.get", - "content": "fastapi http app.get", - "start_line": 38, - "end_line": 42, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "relations": [ - { - "path": "src/app_runtime/health/registry.py", - "start_line": 10, - "end_line": 13, - "edge_type": "dataflow_slice", - "source": "HealthRegistry.__init__", - "target": "HealthRegistry.register", - "metadata": { - "edge_id": "2381dfb339d541367c3251d2a610cac9d8b3f6bd6a352e119d00a93c5ccc2b7d", - "edge_type": "dataflow_slice", - "src_symbol_id": "e8ffd58441c231de43d9e86c31eb12303d4e2bf045b2acf13d1dfe78da01f8dc", - "src_qname": "HealthRegistry.__init__", - "dst_symbol_id": "a9e1f290c346c8bb1d67af0cafeebb5bcaf29c3ed7027e33c794532743df38f2", - "dst_ref": "HealthRegistry.register", - "resolution": "resolved", - "slice_id": "2381dfb339d541367c3251d2a610cac9d8b3f6bd6a352e119d00a93c5ccc2b7d", - "root_symbol_id": "e8ffd58441c231de43d9e86c31eb12303d4e2bf045b2acf13d1dfe78da01f8dc", - "path_symbols": [ - "HealthRegistry.__init__", - "HealthRegistry._contributors", - "HealthRegistry.register" - ], - "path_symbol_ids": [ - "e8ffd58441c231de43d9e86c31eb12303d4e2bf045b2acf13d1dfe78da01f8dc", - "a9e1f290c346c8bb1d67af0cafeebb5bcaf29c3ed7027e33c794532743df38f2" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "26e6a24daa43407ba5340b74497c20153020e79f8d7828ae502aaec378dfcf75", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - }, - "content": "HealthRegistry.__init__\n -> HealthRegistry._contributors\n -> HealthRegistry.register" - }, - { - "path": "src/app_runtime/control/service.py", - "start_line": 14, - "end_line": 20, - "edge_type": "dataflow_slice", - "source": "ControlPlaneService.__init__", - "target": "ControlPlaneService.start", - "metadata": { - "edge_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154", - "dst_ref": "ControlPlaneService.start", - "resolution": "resolved", - "slice_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.start" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - }, - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.start" - }, - { - "path": "src/app_runtime/control/service.py", - "start_line": 14, - "end_line": 25, - "edge_type": "dataflow_slice", - "source": "ControlPlaneService.__init__", - "target": "ControlPlaneService.stop", - "metadata": { - "edge_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d", - "dst_ref": "ControlPlaneService.stop", - "resolution": "resolved", - "slice_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.stop" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - }, - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.stop" - }, - { - "path": "src/app_runtime/control/service.py", - "start_line": 14, - "end_line": 51, - "edge_type": "dataflow_slice", - "source": "ControlPlaneService.__init__", - "target": "ControlPlaneService._stop_async", - "metadata": { - "edge_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a", - "dst_ref": "ControlPlaneService._stop_async", - "resolution": "resolved", - "slice_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._stop_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - }, - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._stop_async" - }, - { - "path": "src/app_runtime/health/registry.py", - "start_line": 10, - "end_line": 16, - "edge_type": "dataflow_slice", - "source": "HealthRegistry.__init__", - "target": "HealthRegistry.contributor_healths", - "metadata": { - "edge_id": "d3a88a7abf16359e903e809ffc24473658fdd8198f60641fe1584fc4ac663c31", - "edge_type": "dataflow_slice", - "src_symbol_id": "e8ffd58441c231de43d9e86c31eb12303d4e2bf045b2acf13d1dfe78da01f8dc", - "src_qname": "HealthRegistry.__init__", - "dst_symbol_id": "fa7bbd8f4b64a55a5088640c30f52e84075d65f531bd7e1f6c1d7bb8d24fcbf2", - "dst_ref": "HealthRegistry.contributor_healths", - "resolution": "resolved", - "slice_id": "d3a88a7abf16359e903e809ffc24473658fdd8198f60641fe1584fc4ac663c31", - "root_symbol_id": "e8ffd58441c231de43d9e86c31eb12303d4e2bf045b2acf13d1dfe78da01f8dc", - "path_symbols": [ - "HealthRegistry.__init__", - "HealthRegistry._contributors", - "HealthRegistry.contributor_healths" - ], - "path_symbol_ids": [ - "e8ffd58441c231de43d9e86c31eb12303d4e2bf045b2acf13d1dfe78da01f8dc", - "fa7bbd8f4b64a55a5088640c30f52e84075d65f531bd7e1f6c1d7bb8d24fcbf2" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "26e6a24daa43407ba5340b74497c20153020e79f8d7828ae502aaec378dfcf75", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - }, - "content": "HealthRegistry.__init__\n -> HealthRegistry._contributors\n -> HealthRegistry.contributor_healths" - }, - { - "path": "src/app_runtime/control/service.py", - "start_line": 14, - "end_line": 47, - "edge_type": "dataflow_slice", - "source": "ControlPlaneService.__init__", - "target": "ControlPlaneService._start_async", - "metadata": { - "edge_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517", - "dst_ref": "ControlPlaneService._start_async", - "resolution": "resolved", - "slice_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._start_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - }, - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._start_async" - }, - { - "path": "src/app_runtime/control/service.py", - "start_line": 14, - "end_line": 17, - "edge_type": "dataflow_slice", - "source": "ControlPlaneService.__init__", - "target": "ControlPlaneService.register_channel", - "metadata": { - "edge_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957", - "dst_ref": "ControlPlaneService.register_channel", - "resolution": "resolved", - "slice_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.register_channel" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - }, - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.register_channel" - }, - { - "path": "src/app_runtime/control/http_app.py", - "start_line": 25, - "end_line": 25, - "edge_type": "calls", - "source": "HttpControlAppFactory.create", - "target": "time.monotonic", - "metadata": { - "edge_id": "3fdd0a88d10225ee74f3b84ab57e13f09f5ccc72f00e31af9ae4655411c289c0", - "edge_type": "calls", - "src_symbol_id": "4af42c2a9275d652e710a98ec48b8247236b4453a093629f8958704ff6d3cb58", - "src_qname": "HttpControlAppFactory.create", - "dst_symbol_id": null, - "dst_ref": "time.monotonic", - "resolution": "partial", - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - }, - "content": "HttpControlAppFactory.create calls time.monotonic" - }, - { - "path": "src/app_runtime/control/http_app.py", - "start_line": 37, - "end_line": 37, - "edge_type": "calls", - "source": "HttpControlAppFactory.create", - "target": "app.post", - "metadata": { - "edge_id": "0e545d4b5187db7bec5ceac03071d2ad68177550c42af748fee364639e533c90", - "edge_type": "calls", - "src_symbol_id": "4af42c2a9275d652e710a98ec48b8247236b4453a093629f8958704ff6d3cb58", - "src_qname": "HttpControlAppFactory.create", - "dst_symbol_id": null, - "dst_ref": "app.post", - "resolution": "partial", - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - }, - "content": "HttpControlAppFactory.create calls app.post" - }, - { - "path": "src/app_runtime/control/http_app.py", - "start_line": 27, - "end_line": 27, - "edge_type": "calls", - "source": "HttpControlAppFactory.create", - "target": "str", - "metadata": { - "edge_id": "2a87c51461e31cd556508cc37fdff37b4d24c26f7f1604db30af5e8f1bda96cb", - "edge_type": "calls", - "src_symbol_id": "4af42c2a9275d652e710a98ec48b8247236b4453a093629f8958704ff6d3cb58", - "src_qname": "HttpControlAppFactory.create", - "dst_symbol_id": null, - "dst_ref": "str", - "resolution": "partial", - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - }, - "content": "HttpControlAppFactory.create calls str" - } - ], - "semantic_hints": [ - { - "path": "src/app_runtime/control/http_app.py", - "title": "HttpControlAppFactory", - "symbol": "HttpControlAppFactory", - "role": "factory", - "confidence": 0.99, - "content": "HttpControlAppFactory\nrole: factory\n\nResponsibilities:\n- name suffix suggests factory" - }, - { - "path": "src/app_runtime/health/registry.py", - "title": "HealthRegistry", - "symbol": "HealthRegistry", - "role": "pipeline_stage", - "confidence": 0.99, - "content": "HealthRegistry\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (2)" - }, - { - "path": "src/app_runtime/core/types.py", - "title": "HealthPayload", - "symbol": "HealthPayload", - "role": "model", - "confidence": 0.99, - "content": "HealthPayload\nrole: model\n\nResponsibilities:\n- default model role" - }, - { - "path": "src/app_runtime/contracts/health.py", - "title": "HealthContributor", - "symbol": "HealthContributor", - "role": "model", - "confidence": 0.99, - "content": "HealthContributor\nrole: model\n\nResponsibilities:\n- default model role" - }, - { - "path": "src/app_runtime/control/base.py", - "title": "ControlActionSet", - "symbol": "ControlActionSet", - "role": "model", - "confidence": 0.99, - "content": "ControlActionSet\nrole: model\n\nResponsibilities:\n- default model role" - }, - { - "path": "src/app_runtime/control/base.py", - "title": "ControlChannel", - "symbol": "ControlChannel", - "role": "model", - "confidence": 0.99, - "content": "ControlChannel\nrole: model\n\nResponsibilities:\n- default model role" - }, - { - "path": "src/app_runtime/control/service.py", - "title": "ControlPlaneService", - "symbol": "ControlPlaneService", - "role": "pipeline_stage", - "confidence": 0.57, - "content": "ControlPlaneService\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests service\n- reads and writes state attributes\n- participates in dataflow slices (5)" - }, - { - "path": "src/app_runtime/control/http_runner.py", - "title": "UvicornThreadRunner", - "symbol": "UvicornThreadRunner", - "role": "pipeline_stage", - "confidence": 0.99, - "content": "UvicornThreadRunner\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (24)" - } - ], - "entrypoints": [ - { - "path": "src/app_runtime/control/http_app.py", - "title": "app.get", - "start_line": 31, - "end_line": 34, - "http_method": "GET", - "route_path": "/health", - "handler_symbol": "health", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "route_or_command": "app.get", - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "title": "app.get", - "start_line": 38, - "end_line": 42, - "http_method": "GET", - "route_path": "/actions/{action}", - "handler_symbol": "action", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "route_or_command": "app.get", - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "title": "app.post", - "start_line": 38, - "end_line": 42, - "http_method": "POST", - "route_path": "/actions/{action}", - "handler_symbol": "action", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "route_or_command": "app.post", - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "test_candidates": [], - "layer_outcomes": [ - { - "layer_id": "C1_SYMBOL_CATALOG", - "hit_count": 8, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C0_SOURCE_CHUNKS", - "hit_count": 8, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C4_SEMANTIC_ROLES", - "hit_count": 8, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C2_DEPENDENCY_GRAPH", - "hit_count": 10, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C3_ENTRYPOINTS", - "hit_count": 3, - "empty": false, - "fallback_used": false - } - ], - "missing_layers": [], - "raw_rows": [ - { - "path": "src/app_runtime/control/http_app.py", - "content": "class HttpControlAppFactory\nHttpControlAppFactory", - "layer": "C1_SYMBOL_CATALOG", - "title": "HttpControlAppFactory", - "span_start": 15, - "span_end": 53, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": null, - "metadata": { - "symbol_id": "9b3502a5fb408b273223db13264349cf500de24915b6c649d9ea8970d0dfd8e0", - "qname": "HttpControlAppFactory", - "kind": "class", - "signature": "HttpControlAppFactory", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.control.http_app", - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "const HttpControlAppFactory\nHttpControlAppFactory = app_runtime.control.http_app.HttpControlAppFactory", - "layer": "C1_SYMBOL_CATALOG", - "title": "HttpControlAppFactory", - "span_start": 8, - "span_end": 8, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": null, - "metadata": { - "symbol_id": "9ee00379ee797cd2386e88a6e37dc69e3e31de9144fc4b95f0206cd1430e8983", - "qname": "HttpControlAppFactory", - "kind": "const", - "signature": "HttpControlAppFactory = app_runtime.control.http_app.HttpControlAppFactory", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.control.http_channel", - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "class ControlActionSet\nControlActionSet", - "layer": "C1_SYMBOL_CATALOG", - "title": "ControlActionSet", - "span_start": 14, - "span_end": 18, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": null, - "metadata": { - "symbol_id": "46eb026cb3313415ec47b82dd22f84f4d112c9d987e8b1716dcb0baa1cce8988", - "qname": "ControlActionSet", - "kind": "class", - "signature": "ControlActionSet", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.control.base", - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/__init__.py", - "content": "const ControlPlaneService\nControlPlaneService = app_runtime.control.service.ControlPlaneService", - "layer": "C1_SYMBOL_CATALOG", - "title": "ControlPlaneService", - "span_start": 3, - "span_end": 3, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": null, - "metadata": { - "symbol_id": "217e8f044d1c01644bf7b81e5046af9e84469210c692a2fb0c476a19bb069ae1", - "qname": "ControlPlaneService", - "kind": "const", - "signature": "ControlPlaneService = app_runtime.control.service.ControlPlaneService", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.control.__init__", - "is_test": false, - "blob_sha": "bf3c37e3369a84cc618adc0fd71c232e5eb4b871eaff743069a17e661e498316", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/contracts/health.py", - "content": "method HealthContributor.health\nhealth(self)\nReturn contributor health state.", - "layer": "C1_SYMBOL_CATALOG", - "title": "HealthContributor.health", - "span_start": 9, - "span_end": 10, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": null, - "metadata": { - "symbol_id": "728cff18958d8a25e2661a0f08c83d68c3bbbfa8cef212b85dc0da2b11b3dc90", - "qname": "HealthContributor.health", - "kind": "method", - "signature": "health(self)", - "parent_symbol_id": "HealthContributor", - "package_or_module": "src.app_runtime.contracts.health", - "is_test": false, - "blob_sha": "6bd92611def7131e32d4dd34a8ed85e6cf3c67722ad27797032a632cb30dc097", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/contracts/health.py", - "content": "class HealthContributor\nHealthContributor(ABC)", - "layer": "C1_SYMBOL_CATALOG", - "title": "HealthContributor", - "span_start": 7, - "span_end": 10, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": null, - "metadata": { - "symbol_id": "db91ae387b89a2e9d83829754f27fa18a4055b3e72d7f31789a0b8e0bf5bba0b", - "qname": "HealthContributor", - "kind": "class", - "signature": "HealthContributor(ABC)", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.contracts.health", - "is_test": false, - "blob_sha": "6bd92611def7131e32d4dd34a8ed85e6cf3c67722ad27797032a632cb30dc097", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/__init__.py", - "content": "const ControlActionSet\nControlActionSet = app_runtime.control.base.ControlActionSet", - "layer": "C1_SYMBOL_CATALOG", - "title": "ControlActionSet", - "span_start": 1, - "span_end": 1, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": null, - "metadata": { - "symbol_id": "767e4ac0d4224aeccb0783a38359d3c03899a876736eb83d99887c16ea07cc6c", - "qname": "ControlActionSet", - "kind": "const", - "signature": "ControlActionSet = app_runtime.control.base.ControlActionSet", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.control.__init__", - "is_test": false, - "blob_sha": "bf3c37e3369a84cc618adc0fd71c232e5eb4b871eaff743069a17e661e498316", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/__init__.py", - "content": "const ControlChannel\nControlChannel = app_runtime.control.base.ControlChannel", - "layer": "C1_SYMBOL_CATALOG", - "title": "ControlChannel", - "span_start": 1, - "span_end": 1, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": null, - "metadata": { - "symbol_id": "268420f7aa4ed74082b9276cae0cded4f00bac090ffd58fa020a65be0fe19c27", - "qname": "ControlChannel", - "kind": "const", - "signature": "ControlChannel = app_runtime.control.base.ControlChannel", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.control.__init__", - "is_test": false, - "blob_sha": "bf3c37e3369a84cc618adc0fd71c232e5eb4b871eaff743069a17e661e498316", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "class HttpControlChannel(ControlChannel):\n def __init__(self, host: str, port: int, timeout: int) -> None:\n self._timeout = timeout\n self._runner = UvicornThreadRunner(host, port, timeout)\n self._factory = HttpControlAppFactory()\n self._actions: ControlActionSet | None = None\n\n async def start(self, actions: ControlActionSet) -> None:\n self._actions = actions\n app = self._factory.create(self._health_response, self._action_response)\n await self._runner.start(app)\n\n async def stop(self) -> None:\n await self._runner.stop()\n\n @property\n def port(self) -> int:\n return self._runner.port\n\n async def _health_response(self) -> dict[str, object]:\n if self._actions is None:\n return {\"status\": \"unhealthy\", \"detail\": \"control actions are not configured\"}\n return await asyncio.wait_for(self._actions.health(), timeout=float(self._timeout))\n\n async def _action_response(self, action: str, _client_source: str = \"unknown\") -> JSONResponse:\n if self._actions is None:\n return JSONResponse(content={\"status\": \"error\", \"detail\": f\"{action} handler is not configured\"}, status_code=404)\n callbacks = {\n \"start\": self._actions.start,\n \"stop\": self._actions.stop,\n \"status\": self._actions.status,\n }\n callback = callbacks.get(action)\n if callback is None:\n return JSONResponse(content={\"status\": \"error\", \"detail\": f\"unsupported action: {action}\"}, status_code=404)\n action_timeout = max(float(self._timeout), 10.0) if action in {\"start\", \"stop\"} else float(self._timeout)\n try:\n detail = await asyncio.wait_for(callback(), timeout=action_timeout)\n except asyncio.TimeoutError:\n return JSONResponse(\n content={\"status\": \"accepted\", \"detail\": f\"{action} operation is still in progress\"},\n status_code=202,\n )\n except Exception as exc:\n return JSONResponse(content={\"status\": \"error\", \"detail\": str(exc)}, status_code=500)\n return JSONResponse(content={\"status\": \"ok\", \"detail\": detail or f\"{action} action accepted\"}, status_code=200)", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/http_channel.py:HttpControlChannel", - "span_start": 12, - "span_end": 57, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": null, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.http_channel", - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_runner.py", - "content": "class UvicornThreadRunner:\n def __init__(self, host: str, port: int, timeout: int) -> None:\n self._host = host\n self._port = port\n self._timeout = timeout\n self._server: Server | None = None\n self._thread: Thread | None = None\n self._error: BaseException | None = None\n\n async def start(self, app: FastAPI) -> None:\n if self._thread is not None and self._thread.is_alive():\n return\n self._error = None\n config = Config(app=app, host=self._host, port=self._port, log_level=\"warning\")\n self._server = Server(config)\n self._thread = Thread(target=self._serve, name=\"plba-http-control\", daemon=True)\n self._thread.start()\n await self._wait_until_started()\n\n async def stop(self) -> None:\n if self._server is None or self._thread is None:\n return\n self._server.should_exit = True\n await asyncio.to_thread(self._thread.join, self._timeout)\n self._server = None\n self._thread = None\n\n @property\n def port(self) -> int:\n if self._server is None or not getattr(self._server, \"servers\", None):\n return self._port\n socket = self._server.servers[0].sockets[0]\n return int(socket.getsockname()[1])\n\n async def _wait_until_started(self) -> None:\n if self._server is None:\n raise RuntimeError(\"Server is not initialized\")\n deadline = asyncio.get_running_loop().time() + max(float(self._timeout), 1.0)\n while not self._server.started:\n if self._error is not None:\n raise RuntimeError(\"HTTP control server failed to start\") from self._error\n if asyncio.get_running_loop().time() >= deadline:\n raise TimeoutError(\"HTTP control server startup timed out\")\n await asyncio.sleep(0.05)\n\n def _serve(self) -> None:\n if self._server is None:\n return\n try:\n asyncio.run(self._server.serve())\n except BaseException as exc: # noqa: BLE001\n self._error = exc", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/http_runner.py:UvicornThreadRunner", - "span_start": 10, - "span_end": 61, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": null, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.http_runner", - "is_test": false, - "blob_sha": "3779fdd2878b770e789a35bb2a89c9d79f13b61c26d7db1b3b683f9bb9e1623f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "class HttpControlAppFactory:\n def create(\n self,\n health_provider: Callable[[], Awaitable[HealthPayload]],\n action_provider: Callable[[str, str], Awaitable[JSONResponse]],\n ) -> FastAPI:\n app = FastAPI(title=\"PLBA Control API\")\n\n @app.middleware(\"http\")\n async def log_api_call(request: Request, call_next): # type: ignore[no-untyped-def]\n started = time.monotonic()\n response = await call_next(request)\n response.headers[\"X-Response-Time-Ms\"] = str(int((time.monotonic() - started) * 1000))\n return response\n\n @app.get(\"/health\")\n async def health() -> JSONResponse:\n payload = await health_provider()\n status_code = 200 if payload.get(\"status\") == \"ok\" else 503\n return JSONResponse(content=payload, status_code=status_code)\n\n @app.get(\"/actions/{action}\")\n @app.post(\"/actions/{action}\")\n async def action(action: str, request: Request) -> JSONResponse:\n client_source = self._client_source(request)\n if action in {\"start\", \"stop\"}:\n LOGGER.warning(\"Control action requested: /actions/%s client=%s\", action, client_source)\n return await action_provider(action, client_source)\n\n return app\n\n def _client_source(self, request: Request) -> str:\n explicit_header = request.headers.get(\"X-Client-Source\", \"\").strip()\n if explicit_header:\n return explicit_header\n user_agent = request.headers.get(\"User-Agent\", \"\").strip()\n if user_agent:\n return f\"user-agent:{user_agent}\"\n return \"unknown\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/http_app.py:HttpControlAppFactory", - "span_start": 15, - "span_end": 53, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": null, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.http_app", - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/contracts/health.py", - "content": "class HealthContributor(ABC):\n @abstractmethod\n def health(self) -> WorkerHealth:\n \"\"\"Return contributor health state.\"\"\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/contracts/health.py:HealthContributor", - "span_start": 7, - "span_end": 10, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": null, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.contracts.health", - "is_test": false, - "blob_sha": "6bd92611def7131e32d4dd34a8ed85e6cf3c67722ad27797032a632cb30dc097", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "class ControlChannel(ABC):\n @abstractmethod\n async def start(self, actions: ControlActionSet) -> None:\n \"\"\"Start the control channel and bind handlers.\"\"\"\n\n @abstractmethod\n async def stop(self) -> None:\n \"\"\"Stop the control channel and release resources.\"\"\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/base.py:ControlChannel", - "span_start": 21, - "span_end": 28, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": null, - "metadata": { - "chunk_index": 1, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.base", - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/__init__.py", - "content": "from app_runtime.control.base import ControlActionSet, ControlChannel\nfrom app_runtime.control.http_channel import HttpControlChannel\nfrom app_runtime.control.service import ControlPlaneService\n\n__all__ = [\"ControlActionSet\", \"ControlChannel\", \"ControlPlaneService\", \"HttpControlChannel\"]", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/__init__.py:1-5", - "span_start": 1, - "span_end": 5, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": null, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.app_runtime.control.__init__", - "is_test": false, - "blob_sha": "bf3c37e3369a84cc618adc0fd71c232e5eb4b871eaff743069a17e661e498316", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "class ControlActionSet:\n health: HealthHandler\n start: ActionHandler\n stop: ActionHandler\n status: ActionHandler", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/base.py:ControlActionSet", - "span_start": 14, - "span_end": 18, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": null, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.base", - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "class ControlPlaneService:\n def __init__(self) -> None:\n self._channels: list[ControlChannel] = []\n\n def register_channel(self, channel: ControlChannel) -> None:\n self._channels.append(channel)\n\n def start(self, runtime: RuntimeManager) -> None:\n if not self._channels:\n return\n asyncio.run(self._start_async(runtime))\n\n def stop(self) -> None:\n if not self._channels:\n return\n asyncio.run(self._stop_async())\n\n def snapshot(self, runtime: RuntimeManager) -> dict[str, object]:\n health = runtime.current_health()\n return {\n \"runtime\": {\"state\": runtime._state.value},\n \"modules\": list(runtime.registry.modules),\n \"services\": runtime.services.snapshot(),\n \"workers\": runtime.workers.snapshot(),\n \"health\": runtime.health.snapshot(runtime.workers.healths()) | {\"status\": health[\"status\"]},\n \"config\": runtime.configuration.get(),\n }\n\n async def _start_async(self, runtime: RuntimeManager) -> None:\n actions = ControlActionSet(\n health=runtime.health_status,\n start=runtime.start_runtime,\n stop=runtime.stop_runtime,\n status=runtime.runtime_status,\n )\n for channel in self._channels:\n await channel.start(actions)\n\n async def _stop_async(self) -> None:\n for channel in reversed(self._channels):\n await channel.stop()", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/service.py:ControlPlaneService", - "span_start": 12, - "span_end": 52, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": null, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.service", - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "HttpControlAppFactory\nrole: factory\n\nResponsibilities:\n- name suffix suggests factory", - "layer": "C4_SEMANTIC_ROLES", - "title": "HttpControlAppFactory", - "span_start": 15, - "span_end": 53, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 39, - "layer_rank": 2, - "distance": null, - "metadata": { - "symbol_id": "9b3502a5fb408b273223db13264349cf500de24915b6c649d9ea8970d0dfd8e0", - "symbol_name": "HttpControlAppFactory", - "qname": "HttpControlAppFactory", - "role": "factory", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/health/registry.py", - "content": "HealthRegistry\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (2)", - "layer": "C4_SEMANTIC_ROLES", - "title": "HealthRegistry", - "span_start": 8, - "span_end": 56, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 29, - "layer_rank": 2, - "distance": null, - "metadata": { - "symbol_id": "fd3390eb0ba29c9979466b9c2117238e0da3bb829eeb4d505cb34c9c3df7a8e8", - "symbol_name": "HealthRegistry", - "qname": "HealthRegistry", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 2, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "26e6a24daa43407ba5340b74497c20153020e79f8d7828ae502aaec378dfcf75", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/types.py", - "content": "HealthPayload\nrole: model\n\nResponsibilities:\n- default model role", - "layer": "C4_SEMANTIC_ROLES", - "title": "HealthPayload", - "span_start": 7, - "span_end": 11, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 40, - "layer_rank": 2, - "distance": null, - "metadata": { - "symbol_id": "392235d63ddf752d6e419cb8528c93fe070d1bc02d3c87ba6a897baac810cf5d", - "symbol_name": "HealthPayload", - "qname": "HealthPayload", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "448a02e4a432b5ab65b246b2bd24a32a6f127b9d2091ea73b53ee3c0a2f53bb3", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/contracts/health.py", - "content": "HealthContributor\nrole: model\n\nResponsibilities:\n- default model role", - "layer": "C4_SEMANTIC_ROLES", - "title": "HealthContributor", - "span_start": 7, - "span_end": 10, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 40, - "layer_rank": 2, - "distance": null, - "metadata": { - "symbol_id": "db91ae387b89a2e9d83829754f27fa18a4055b3e72d7f31789a0b8e0bf5bba0b", - "symbol_name": "HealthContributor", - "qname": "HealthContributor", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "6bd92611def7131e32d4dd34a8ed85e6cf3c67722ad27797032a632cb30dc097", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "ControlActionSet\nrole: model\n\nResponsibilities:\n- default model role", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlActionSet", - "span_start": 14, - "span_end": 18, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 40, - "layer_rank": 2, - "distance": null, - "metadata": { - "symbol_id": "46eb026cb3313415ec47b82dd22f84f4d112c9d987e8b1716dcb0baa1cce8988", - "symbol_name": "ControlActionSet", - "qname": "ControlActionSet", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "ControlChannel\nrole: model\n\nResponsibilities:\n- default model role", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlChannel", - "span_start": 21, - "span_end": 28, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 40, - "layer_rank": 2, - "distance": null, - "metadata": { - "symbol_id": "cfcfe9a311d3a2dbdaf32ac4ccd73c0eb9a117f830591a1c0867ee97d46204ff", - "symbol_name": "ControlChannel", - "qname": "ControlChannel", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests service\n- reads and writes state attributes\n- participates in dataflow slices (5)", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlPlaneService", - "span_start": 12, - "span_end": 52, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 68, - "layer_rank": 2, - "distance": null, - "metadata": { - "symbol_id": "b13471e5916986dccffb53fab613812842965705e6b3a89ae549d30c9e91e9aa", - "symbol_name": "ControlPlaneService", - "qname": "ControlPlaneService", - "role": "pipeline_stage", - "confidence": 0.57, - "dataflow_participation": 5, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_runner.py", - "content": "UvicornThreadRunner\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (24)", - "layer": "C4_SEMANTIC_ROLES", - "title": "UvicornThreadRunner", - "span_start": 10, - "span_end": 61, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 11, - "layer_rank": 2, - "distance": null, - "metadata": { - "symbol_id": "fd55630045a02100df8877ac27d951ee08617d4598764394d48cb51fe067476a", - "symbol_name": "UvicornThreadRunner", - "qname": "UvicornThreadRunner", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 24, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "3779fdd2878b770e789a35bb2a89c9d79f13b61c26d7db1b3b683f9bb9e1623f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/health/registry.py", - "content": "HealthRegistry.__init__\n -> HealthRegistry._contributors\n -> HealthRegistry.register", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "HealthRegistry.__init__:dataflow_slice", - "span_start": 10, - "span_end": 13, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": null, - "metadata": { - "edge_id": "2381dfb339d541367c3251d2a610cac9d8b3f6bd6a352e119d00a93c5ccc2b7d", - "edge_type": "dataflow_slice", - "src_symbol_id": "e8ffd58441c231de43d9e86c31eb12303d4e2bf045b2acf13d1dfe78da01f8dc", - "src_qname": "HealthRegistry.__init__", - "dst_symbol_id": "a9e1f290c346c8bb1d67af0cafeebb5bcaf29c3ed7027e33c794532743df38f2", - "dst_ref": "HealthRegistry.register", - "resolution": "resolved", - "slice_id": "2381dfb339d541367c3251d2a610cac9d8b3f6bd6a352e119d00a93c5ccc2b7d", - "root_symbol_id": "e8ffd58441c231de43d9e86c31eb12303d4e2bf045b2acf13d1dfe78da01f8dc", - "path_symbols": [ - "HealthRegistry.__init__", - "HealthRegistry._contributors", - "HealthRegistry.register" - ], - "path_symbol_ids": [ - "e8ffd58441c231de43d9e86c31eb12303d4e2bf045b2acf13d1dfe78da01f8dc", - "a9e1f290c346c8bb1d67af0cafeebb5bcaf29c3ed7027e33c794532743df38f2" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "26e6a24daa43407ba5340b74497c20153020e79f8d7828ae502aaec378dfcf75", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.start", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 20, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": null, - "metadata": { - "edge_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154", - "dst_ref": "ControlPlaneService.start", - "resolution": "resolved", - "slice_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.start" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.stop", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 25, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": null, - "metadata": { - "edge_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d", - "dst_ref": "ControlPlaneService.stop", - "resolution": "resolved", - "slice_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.stop" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._stop_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 51, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": null, - "metadata": { - "edge_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a", - "dst_ref": "ControlPlaneService._stop_async", - "resolution": "resolved", - "slice_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._stop_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/health/registry.py", - "content": "HealthRegistry.__init__\n -> HealthRegistry._contributors\n -> HealthRegistry.contributor_healths", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "HealthRegistry.__init__:dataflow_slice", - "span_start": 10, - "span_end": 16, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": null, - "metadata": { - "edge_id": "d3a88a7abf16359e903e809ffc24473658fdd8198f60641fe1584fc4ac663c31", - "edge_type": "dataflow_slice", - "src_symbol_id": "e8ffd58441c231de43d9e86c31eb12303d4e2bf045b2acf13d1dfe78da01f8dc", - "src_qname": "HealthRegistry.__init__", - "dst_symbol_id": "fa7bbd8f4b64a55a5088640c30f52e84075d65f531bd7e1f6c1d7bb8d24fcbf2", - "dst_ref": "HealthRegistry.contributor_healths", - "resolution": "resolved", - "slice_id": "d3a88a7abf16359e903e809ffc24473658fdd8198f60641fe1584fc4ac663c31", - "root_symbol_id": "e8ffd58441c231de43d9e86c31eb12303d4e2bf045b2acf13d1dfe78da01f8dc", - "path_symbols": [ - "HealthRegistry.__init__", - "HealthRegistry._contributors", - "HealthRegistry.contributor_healths" - ], - "path_symbol_ids": [ - "e8ffd58441c231de43d9e86c31eb12303d4e2bf045b2acf13d1dfe78da01f8dc", - "fa7bbd8f4b64a55a5088640c30f52e84075d65f531bd7e1f6c1d7bb8d24fcbf2" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "26e6a24daa43407ba5340b74497c20153020e79f8d7828ae502aaec378dfcf75", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._start_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 47, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": null, - "metadata": { - "edge_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517", - "dst_ref": "ControlPlaneService._start_async", - "resolution": "resolved", - "slice_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._start_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.register_channel", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 17, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": null, - "metadata": { - "edge_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957", - "dst_ref": "ControlPlaneService.register_channel", - "resolution": "resolved", - "slice_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.register_channel" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "HttpControlAppFactory.create calls time.monotonic", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "HttpControlAppFactory.create:calls", - "span_start": 25, - "span_end": 25, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": null, - "metadata": { - "edge_id": "3fdd0a88d10225ee74f3b84ab57e13f09f5ccc72f00e31af9ae4655411c289c0", - "edge_type": "calls", - "src_symbol_id": "4af42c2a9275d652e710a98ec48b8247236b4453a093629f8958704ff6d3cb58", - "src_qname": "HttpControlAppFactory.create", - "dst_symbol_id": null, - "dst_ref": "time.monotonic", - "resolution": "partial", - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "HttpControlAppFactory.create calls app.post", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "HttpControlAppFactory.create:calls", - "span_start": 37, - "span_end": 37, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": null, - "metadata": { - "edge_id": "0e545d4b5187db7bec5ceac03071d2ad68177550c42af748fee364639e533c90", - "edge_type": "calls", - "src_symbol_id": "4af42c2a9275d652e710a98ec48b8247236b4453a093629f8958704ff6d3cb58", - "src_qname": "HttpControlAppFactory.create", - "dst_symbol_id": null, - "dst_ref": "app.post", - "resolution": "partial", - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "HttpControlAppFactory.create calls str", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "HttpControlAppFactory.create:calls", - "span_start": 27, - "span_end": 27, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": null, - "metadata": { - "edge_id": "2a87c51461e31cd556508cc37fdff37b4d24c26f7f1604db30af5e8f1bda96cb", - "edge_type": "calls", - "src_symbol_id": "4af42c2a9275d652e710a98ec48b8247236b4453a093629f8958704ff6d3cb58", - "src_qname": "HttpControlAppFactory.create", - "dst_symbol_id": null, - "dst_ref": "str", - "resolution": "partial", - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": null, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": null, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": null, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "retrieval_report": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "vector", - "C0_SOURCE_CHUNKS": "vector", - "C4_SEMANTIC_ROLES": "vector", - "C2_DEPENDENCY_GRAPH": "vector", - "C3_ENTRYPOINTS": "vector" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 8, - "C4_SEMANTIC_ROLES": 8, - "C2_DEPENDENCY_GRAPH": 10, - "C3_ENTRYPOINTS": 10 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [] - }, - "C4_SEMANTIC_ROLES": { - "path_scope": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [] - } - }, - "fallback": { - "used": false, - "reason": null - }, - "retrieval_by_layer_ms": { - "C1_SYMBOL_CATALOG": 58, - "C0_SOURCE_CHUNKS": 21, - "C4_SEMANTIC_ROLES": 19, - "C2_DEPENDENCY_GRAPH": 54, - "C3_ENTRYPOINTS": 11 - } - } - }, - "diagnostics": { - "intent_correct": null, - "target_found": true, - "layers_used": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_sufficient": true, - "answer_mode": "normal", - "resolved_target": "HttpControlAppFactory", - "answer_policy_branch": "normal_answer", - "decision_reason": "evidence_sufficient", - "router_result": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "retrieval_profile": "code", - "sub_intent": "TRACE_FLOW", - "path_scope": [], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "symbol_resolution_status": "resolved" - }, - "retrieval_request": { - "rag_session_id": "7d11da21-faa0-4cea-aede-aeabe069164c", - "query": "Покажи как проходит запрос /health в HttpControlAppFactory", - "sub_intent": "TRACE_FLOW", - "path_scope": [], - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "per_layer_outcome": [ - { - "layer_id": "C1_SYMBOL_CATALOG", - "hit_count": 8, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C0_SOURCE_CHUNKS", - "hit_count": 8, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C4_SEMANTIC_ROLES", - "hit_count": 8, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C2_DEPENDENCY_GRAPH", - "hit_count": 10, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C3_ENTRYPOINTS", - "hit_count": 3, - "empty": false, - "fallback_used": false - } - ], - "empty_layers": [], - "evidence_gate_decision": { - "sufficient": true, - "failure_reasons": [], - "evidence_count": 37 - }, - "evidence_gate_input": { - "resolved_target": "HttpControlAppFactory", - "sub_intent": "TRACE_FLOW", - "target_type": "symbol", - "evidence_count": 37, - "code_chunk_count": 37, - "entrypoint_count": 3, - "relation_count": 10, - "test_evidence_count": 0, - "symbol_resolution_status": "resolved", - "path_scope": [] - }, - "post_evidence_gate": { - "input": { - "answer_mode": "normal", - "degraded_message": "", - "resolved_target": "HttpControlAppFactory", - "draft_answer_preview": "Запрос `/health` обрабатывается следующим образом:\n\n1. В `HttpControlAppFactory` создаётся маршрут `@app.get(\"/health\")`, который вызывает функцию `health`.\n - Путь: `src/app_runtime/control/http_app.py`\n - Строки: 31–34\n\n2. Функция `health` асинхронно ожидает данные от провайдера здоровья (`hea", - "repair_candidate": true - }, - "output": { - "passed": true, - "action": "return", - "reasons": [], - "repair_used": false, - "final_answer_preview": "Запрос `/health` обрабатывается следующим образом:\n\n1. В `HttpControlAppFactory` создаётся маршрут `@app.get(\"/health\")`, который вызывает функцию `health`.\n - Путь: `src/app_runtime/control/http_app.py`\n - Строки: 31–34\n\n2. Функция `health` асинхронно ожидает данные от провайдера здоровья (`hea" - } - }, - "failure_reasons": [], - "timings_ms": { - "router": 1, - "retrieval": 165, - "pre_evidence_gate": 1, - "llm": 4961, - "post_evidence_gate": 1 - } - }, - "rag_rows": [ - { - "path": "src/app_runtime/control/http_app.py", - "content": "class HttpControlAppFactory\nHttpControlAppFactory", - "layer": "C1_SYMBOL_CATALOG", - "title": "HttpControlAppFactory", - "span_start": 15, - "span_end": 53, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "9b3502a5fb408b273223db13264349cf500de24915b6c649d9ea8970d0dfd8e0", - "qname": "HttpControlAppFactory", - "kind": "class", - "signature": "HttpControlAppFactory", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.control.http_app", - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "const HttpControlAppFactory\nHttpControlAppFactory = app_runtime.control.http_app.HttpControlAppFactory", - "layer": "C1_SYMBOL_CATALOG", - "title": "HttpControlAppFactory", - "span_start": 8, - "span_end": 8, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "9ee00379ee797cd2386e88a6e37dc69e3e31de9144fc4b95f0206cd1430e8983", - "qname": "HttpControlAppFactory", - "kind": "const", - "signature": "HttpControlAppFactory = app_runtime.control.http_app.HttpControlAppFactory", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.control.http_channel", - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "class ControlActionSet\nControlActionSet", - "layer": "C1_SYMBOL_CATALOG", - "title": "ControlActionSet", - "span_start": 14, - "span_end": 18, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "46eb026cb3313415ec47b82dd22f84f4d112c9d987e8b1716dcb0baa1cce8988", - "qname": "ControlActionSet", - "kind": "class", - "signature": "ControlActionSet", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.control.base", - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/__init__.py", - "content": "const ControlPlaneService\nControlPlaneService = app_runtime.control.service.ControlPlaneService", - "layer": "C1_SYMBOL_CATALOG", - "title": "ControlPlaneService", - "span_start": 3, - "span_end": 3, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "217e8f044d1c01644bf7b81e5046af9e84469210c692a2fb0c476a19bb069ae1", - "qname": "ControlPlaneService", - "kind": "const", - "signature": "ControlPlaneService = app_runtime.control.service.ControlPlaneService", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.control.__init__", - "is_test": false, - "blob_sha": "bf3c37e3369a84cc618adc0fd71c232e5eb4b871eaff743069a17e661e498316", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/contracts/health.py", - "content": "method HealthContributor.health\nhealth(self)\nReturn contributor health state.", - "layer": "C1_SYMBOL_CATALOG", - "title": "HealthContributor.health", - "span_start": 9, - "span_end": 10, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "728cff18958d8a25e2661a0f08c83d68c3bbbfa8cef212b85dc0da2b11b3dc90", - "qname": "HealthContributor.health", - "kind": "method", - "signature": "health(self)", - "parent_symbol_id": "HealthContributor", - "package_or_module": "src.app_runtime.contracts.health", - "is_test": false, - "blob_sha": "6bd92611def7131e32d4dd34a8ed85e6cf3c67722ad27797032a632cb30dc097", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/contracts/health.py", - "content": "class HealthContributor\nHealthContributor(ABC)", - "layer": "C1_SYMBOL_CATALOG", - "title": "HealthContributor", - "span_start": 7, - "span_end": 10, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "db91ae387b89a2e9d83829754f27fa18a4055b3e72d7f31789a0b8e0bf5bba0b", - "qname": "HealthContributor", - "kind": "class", - "signature": "HealthContributor(ABC)", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.contracts.health", - "is_test": false, - "blob_sha": "6bd92611def7131e32d4dd34a8ed85e6cf3c67722ad27797032a632cb30dc097", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/__init__.py", - "content": "const ControlActionSet\nControlActionSet = app_runtime.control.base.ControlActionSet", - "layer": "C1_SYMBOL_CATALOG", - "title": "ControlActionSet", - "span_start": 1, - "span_end": 1, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "767e4ac0d4224aeccb0783a38359d3c03899a876736eb83d99887c16ea07cc6c", - "qname": "ControlActionSet", - "kind": "const", - "signature": "ControlActionSet = app_runtime.control.base.ControlActionSet", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.control.__init__", - "is_test": false, - "blob_sha": "bf3c37e3369a84cc618adc0fd71c232e5eb4b871eaff743069a17e661e498316", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/__init__.py", - "content": "const ControlChannel\nControlChannel = app_runtime.control.base.ControlChannel", - "layer": "C1_SYMBOL_CATALOG", - "title": "ControlChannel", - "span_start": 1, - "span_end": 1, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "268420f7aa4ed74082b9276cae0cded4f00bac090ffd58fa020a65be0fe19c27", - "qname": "ControlChannel", - "kind": "const", - "signature": "ControlChannel = app_runtime.control.base.ControlChannel", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.control.__init__", - "is_test": false, - "blob_sha": "bf3c37e3369a84cc618adc0fd71c232e5eb4b871eaff743069a17e661e498316", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "class HttpControlChannel(ControlChannel):\n def __init__(self, host: str, port: int, timeout: int) -> None:\n self._timeout = timeout\n self._runner = UvicornThreadRunner(host, port, timeout)\n self._factory = HttpControlAppFactory()\n self._actions: ControlActionSet | None = None\n\n async def start(self, actions: ControlActionSet) -> None:\n self._actions = actions\n app = self._factory.create(self._health_response, self._action_response)\n await self._runner.start(app)\n\n async def stop(self) -> None:\n await self._runner.stop()\n\n @property\n def port(self) -> int:\n return self._runner.port\n\n async def _health_response(self) -> dict[str, object]:\n if self._actions is None:\n return {\"status\": \"unhealthy\", \"detail\": \"control actions are not configured\"}\n return await asyncio.wait_for(self._actions.health(), timeout=float(self._timeout))\n\n async def _action_response(self, action: str, _client_source: str = \"unknown\") -> JSONResponse:\n if self._actions is None:\n return JSONResponse(content={\"status\": \"error\", \"detail\": f\"{action} handler is not configured\"}, status_code=404)\n callbacks = {\n \"start\": self._actions.start,\n \"stop\": self._actions.stop,\n \"status\": self._actions.status,\n }\n callback = callbacks.get(action)\n if callback is None:\n return JSONResponse(content={\"status\": \"error\", \"detail\": f\"unsupported action: {action}\"}, status_code=404)\n action_timeout = max(float(self._timeout), 10.0) if action in {\"start\", \"stop\"} else float(self._timeout)\n try:\n detail = await asyncio.wait_for(callback(), timeout=action_timeout)\n except asyncio.TimeoutError:\n return JSONResponse(\n content={\"status\": \"accepted\", \"detail\": f\"{action} operation is still in progress\"},\n status_code=202,\n )\n except Exception as exc:\n return JSONResponse(content={\"status\": \"error\", \"detail\": str(exc)}, status_code=500)\n return JSONResponse(content={\"status\": \"ok\", \"detail\": detail or f\"{action} action accepted\"}, status_code=200)", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/http_channel.py:HttpControlChannel", - "span_start": 12, - "span_end": 57, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.http_channel", - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_runner.py", - "content": "class UvicornThreadRunner:\n def __init__(self, host: str, port: int, timeout: int) -> None:\n self._host = host\n self._port = port\n self._timeout = timeout\n self._server: Server | None = None\n self._thread: Thread | None = None\n self._error: BaseException | None = None\n\n async def start(self, app: FastAPI) -> None:\n if self._thread is not None and self._thread.is_alive():\n return\n self._error = None\n config = Config(app=app, host=self._host, port=self._port, log_level=\"warning\")\n self._server = Server(config)\n self._thread = Thread(target=self._serve, name=\"plba-http-control\", daemon=True)\n self._thread.start()\n await self._wait_until_started()\n\n async def stop(self) -> None:\n if self._server is None or self._thread is None:\n return\n self._server.should_exit = True\n await asyncio.to_thread(self._thread.join, self._timeout)\n self._server = None\n self._thread = None\n\n @property\n def port(self) -> int:\n if self._server is None or not getattr(self._server, \"servers\", None):\n return self._port\n socket = self._server.servers[0].sockets[0]\n return int(socket.getsockname()[1])\n\n async def _wait_until_started(self) -> None:\n if self._server is None:\n raise RuntimeError(\"Server is not initialized\")\n deadline = asyncio.get_running_loop().time() + max(float(self._timeout), 1.0)\n while not self._server.started:\n if self._error is not None:\n raise RuntimeError(\"HTTP control server failed to start\") from self._error\n if asyncio.get_running_loop().time() >= deadline:\n raise TimeoutError(\"HTTP control server startup timed out\")\n await asyncio.sleep(0.05)\n\n def _serve(self) -> None:\n if self._server is None:\n return\n try:\n asyncio.run(self._server.serve())\n except BaseException as exc: # noqa: BLE001\n self._error = exc", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/http_runner.py:UvicornThreadRunner", - "span_start": 10, - "span_end": 61, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.http_runner", - "is_test": false, - "blob_sha": "3779fdd2878b770e789a35bb2a89c9d79f13b61c26d7db1b3b683f9bb9e1623f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "class HttpControlAppFactory:\n def create(\n self,\n health_provider: Callable[[], Awaitable[HealthPayload]],\n action_provider: Callable[[str, str], Awaitable[JSONResponse]],\n ) -> FastAPI:\n app = FastAPI(title=\"PLBA Control API\")\n\n @app.middleware(\"http\")\n async def log_api_call(request: Request, call_next): # type: ignore[no-untyped-def]\n started = time.monotonic()\n response = await call_next(request)\n response.headers[\"X-Response-Time-Ms\"] = str(int((time.monotonic() - started) * 1000))\n return response\n\n @app.get(\"/health\")\n async def health() -> JSONResponse:\n payload = await health_provider()\n status_code = 200 if payload.get(\"status\") == \"ok\" else 503\n return JSONResponse(content=payload, status_code=status_code)\n\n @app.get(\"/actions/{action}\")\n @app.post(\"/actions/{action}\")\n async def action(action: str, request: Request) -> JSONResponse:\n client_source = self._client_source(request)\n if action in {\"start\", \"stop\"}:\n LOGGER.warning(\"Control action requested: /actions/%s client=%s\", action, client_source)\n return await action_provider(action, client_source)\n\n return app\n\n def _client_source(self, request: Request) -> str:\n explicit_header = request.headers.get(\"X-Client-Source\", \"\").strip()\n if explicit_header:\n return explicit_header\n user_agent = request.headers.get(\"User-Agent\", \"\").strip()\n if user_agent:\n return f\"user-agent:{user_agent}\"\n return \"unknown\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/http_app.py:HttpControlAppFactory", - "span_start": 15, - "span_end": 53, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.http_app", - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/contracts/health.py", - "content": "class HealthContributor(ABC):\n @abstractmethod\n def health(self) -> WorkerHealth:\n \"\"\"Return contributor health state.\"\"\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/contracts/health.py:HealthContributor", - "span_start": 7, - "span_end": 10, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.contracts.health", - "is_test": false, - "blob_sha": "6bd92611def7131e32d4dd34a8ed85e6cf3c67722ad27797032a632cb30dc097", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "class ControlChannel(ABC):\n @abstractmethod\n async def start(self, actions: ControlActionSet) -> None:\n \"\"\"Start the control channel and bind handlers.\"\"\"\n\n @abstractmethod\n async def stop(self) -> None:\n \"\"\"Stop the control channel and release resources.\"\"\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/base.py:ControlChannel", - "span_start": 21, - "span_end": 28, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 1, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.base", - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/__init__.py", - "content": "from app_runtime.control.base import ControlActionSet, ControlChannel\nfrom app_runtime.control.http_channel import HttpControlChannel\nfrom app_runtime.control.service import ControlPlaneService\n\n__all__ = [\"ControlActionSet\", \"ControlChannel\", \"ControlPlaneService\", \"HttpControlChannel\"]", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/__init__.py:1-5", - "span_start": 1, - "span_end": 5, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.app_runtime.control.__init__", - "is_test": false, - "blob_sha": "bf3c37e3369a84cc618adc0fd71c232e5eb4b871eaff743069a17e661e498316", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "class ControlActionSet:\n health: HealthHandler\n start: ActionHandler\n stop: ActionHandler\n status: ActionHandler", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/base.py:ControlActionSet", - "span_start": 14, - "span_end": 18, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.base", - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "class ControlPlaneService:\n def __init__(self) -> None:\n self._channels: list[ControlChannel] = []\n\n def register_channel(self, channel: ControlChannel) -> None:\n self._channels.append(channel)\n\n def start(self, runtime: RuntimeManager) -> None:\n if not self._channels:\n return\n asyncio.run(self._start_async(runtime))\n\n def stop(self) -> None:\n if not self._channels:\n return\n asyncio.run(self._stop_async())\n\n def snapshot(self, runtime: RuntimeManager) -> dict[str, object]:\n health = runtime.current_health()\n return {\n \"runtime\": {\"state\": runtime._state.value},\n \"modules\": list(runtime.registry.modules),\n \"services\": runtime.services.snapshot(),\n \"workers\": runtime.workers.snapshot(),\n \"health\": runtime.health.snapshot(runtime.workers.healths()) | {\"status\": health[\"status\"]},\n \"config\": runtime.configuration.get(),\n }\n\n async def _start_async(self, runtime: RuntimeManager) -> None:\n actions = ControlActionSet(\n health=runtime.health_status,\n start=runtime.start_runtime,\n stop=runtime.stop_runtime,\n status=runtime.runtime_status,\n )\n for channel in self._channels:\n await channel.start(actions)\n\n async def _stop_async(self) -> None:\n for channel in reversed(self._channels):\n await channel.stop()", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/service.py:ControlPlaneService", - "span_start": 12, - "span_end": 52, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.service", - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "HttpControlAppFactory\nrole: factory\n\nResponsibilities:\n- name suffix suggests factory", - "layer": "C4_SEMANTIC_ROLES", - "title": "HttpControlAppFactory", - "span_start": 15, - "span_end": 53, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 39, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "9b3502a5fb408b273223db13264349cf500de24915b6c649d9ea8970d0dfd8e0", - "symbol_name": "HttpControlAppFactory", - "qname": "HttpControlAppFactory", - "role": "factory", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/health/registry.py", - "content": "HealthRegistry\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (2)", - "layer": "C4_SEMANTIC_ROLES", - "title": "HealthRegistry", - "span_start": 8, - "span_end": 56, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 29, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "fd3390eb0ba29c9979466b9c2117238e0da3bb829eeb4d505cb34c9c3df7a8e8", - "symbol_name": "HealthRegistry", - "qname": "HealthRegistry", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 2, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "26e6a24daa43407ba5340b74497c20153020e79f8d7828ae502aaec378dfcf75", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/types.py", - "content": "HealthPayload\nrole: model\n\nResponsibilities:\n- default model role", - "layer": "C4_SEMANTIC_ROLES", - "title": "HealthPayload", - "span_start": 7, - "span_end": 11, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 40, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "392235d63ddf752d6e419cb8528c93fe070d1bc02d3c87ba6a897baac810cf5d", - "symbol_name": "HealthPayload", - "qname": "HealthPayload", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "448a02e4a432b5ab65b246b2bd24a32a6f127b9d2091ea73b53ee3c0a2f53bb3", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/contracts/health.py", - "content": "HealthContributor\nrole: model\n\nResponsibilities:\n- default model role", - "layer": "C4_SEMANTIC_ROLES", - "title": "HealthContributor", - "span_start": 7, - "span_end": 10, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 40, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "db91ae387b89a2e9d83829754f27fa18a4055b3e72d7f31789a0b8e0bf5bba0b", - "symbol_name": "HealthContributor", - "qname": "HealthContributor", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "6bd92611def7131e32d4dd34a8ed85e6cf3c67722ad27797032a632cb30dc097", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "ControlActionSet\nrole: model\n\nResponsibilities:\n- default model role", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlActionSet", - "span_start": 14, - "span_end": 18, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 40, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "46eb026cb3313415ec47b82dd22f84f4d112c9d987e8b1716dcb0baa1cce8988", - "symbol_name": "ControlActionSet", - "qname": "ControlActionSet", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "ControlChannel\nrole: model\n\nResponsibilities:\n- default model role", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlChannel", - "span_start": 21, - "span_end": 28, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 40, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "cfcfe9a311d3a2dbdaf32ac4ccd73c0eb9a117f830591a1c0867ee97d46204ff", - "symbol_name": "ControlChannel", - "qname": "ControlChannel", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests service\n- reads and writes state attributes\n- participates in dataflow slices (5)", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlPlaneService", - "span_start": 12, - "span_end": 52, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 68, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "b13471e5916986dccffb53fab613812842965705e6b3a89ae549d30c9e91e9aa", - "symbol_name": "ControlPlaneService", - "qname": "ControlPlaneService", - "role": "pipeline_stage", - "confidence": 0.57, - "dataflow_participation": 5, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_runner.py", - "content": "UvicornThreadRunner\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (24)", - "layer": "C4_SEMANTIC_ROLES", - "title": "UvicornThreadRunner", - "span_start": 10, - "span_end": 61, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 11, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "fd55630045a02100df8877ac27d951ee08617d4598764394d48cb51fe067476a", - "symbol_name": "UvicornThreadRunner", - "qname": "UvicornThreadRunner", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 24, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "3779fdd2878b770e789a35bb2a89c9d79f13b61c26d7db1b3b683f9bb9e1623f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/health/registry.py", - "content": "HealthRegistry.__init__\n -> HealthRegistry._contributors\n -> HealthRegistry.register", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "HealthRegistry.__init__:dataflow_slice", - "span_start": 10, - "span_end": 13, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "2381dfb339d541367c3251d2a610cac9d8b3f6bd6a352e119d00a93c5ccc2b7d", - "edge_type": "dataflow_slice", - "src_symbol_id": "e8ffd58441c231de43d9e86c31eb12303d4e2bf045b2acf13d1dfe78da01f8dc", - "src_qname": "HealthRegistry.__init__", - "dst_symbol_id": "a9e1f290c346c8bb1d67af0cafeebb5bcaf29c3ed7027e33c794532743df38f2", - "dst_ref": "HealthRegistry.register", - "resolution": "resolved", - "slice_id": "2381dfb339d541367c3251d2a610cac9d8b3f6bd6a352e119d00a93c5ccc2b7d", - "root_symbol_id": "e8ffd58441c231de43d9e86c31eb12303d4e2bf045b2acf13d1dfe78da01f8dc", - "path_symbols": [ - "HealthRegistry.__init__", - "HealthRegistry._contributors", - "HealthRegistry.register" - ], - "path_symbol_ids": [ - "e8ffd58441c231de43d9e86c31eb12303d4e2bf045b2acf13d1dfe78da01f8dc", - "a9e1f290c346c8bb1d67af0cafeebb5bcaf29c3ed7027e33c794532743df38f2" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "26e6a24daa43407ba5340b74497c20153020e79f8d7828ae502aaec378dfcf75", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.start", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 20, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154", - "dst_ref": "ControlPlaneService.start", - "resolution": "resolved", - "slice_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.start" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.stop", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 25, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d", - "dst_ref": "ControlPlaneService.stop", - "resolution": "resolved", - "slice_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.stop" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._stop_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 51, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a", - "dst_ref": "ControlPlaneService._stop_async", - "resolution": "resolved", - "slice_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._stop_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/health/registry.py", - "content": "HealthRegistry.__init__\n -> HealthRegistry._contributors\n -> HealthRegistry.contributor_healths", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "HealthRegistry.__init__:dataflow_slice", - "span_start": 10, - "span_end": 16, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "d3a88a7abf16359e903e809ffc24473658fdd8198f60641fe1584fc4ac663c31", - "edge_type": "dataflow_slice", - "src_symbol_id": "e8ffd58441c231de43d9e86c31eb12303d4e2bf045b2acf13d1dfe78da01f8dc", - "src_qname": "HealthRegistry.__init__", - "dst_symbol_id": "fa7bbd8f4b64a55a5088640c30f52e84075d65f531bd7e1f6c1d7bb8d24fcbf2", - "dst_ref": "HealthRegistry.contributor_healths", - "resolution": "resolved", - "slice_id": "d3a88a7abf16359e903e809ffc24473658fdd8198f60641fe1584fc4ac663c31", - "root_symbol_id": "e8ffd58441c231de43d9e86c31eb12303d4e2bf045b2acf13d1dfe78da01f8dc", - "path_symbols": [ - "HealthRegistry.__init__", - "HealthRegistry._contributors", - "HealthRegistry.contributor_healths" - ], - "path_symbol_ids": [ - "e8ffd58441c231de43d9e86c31eb12303d4e2bf045b2acf13d1dfe78da01f8dc", - "fa7bbd8f4b64a55a5088640c30f52e84075d65f531bd7e1f6c1d7bb8d24fcbf2" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "26e6a24daa43407ba5340b74497c20153020e79f8d7828ae502aaec378dfcf75", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._start_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 47, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517", - "dst_ref": "ControlPlaneService._start_async", - "resolution": "resolved", - "slice_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._start_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.register_channel", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 17, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957", - "dst_ref": "ControlPlaneService.register_channel", - "resolution": "resolved", - "slice_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.register_channel" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "HttpControlAppFactory.create calls time.monotonic", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "HttpControlAppFactory.create:calls", - "span_start": 25, - "span_end": 25, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "3fdd0a88d10225ee74f3b84ab57e13f09f5ccc72f00e31af9ae4655411c289c0", - "edge_type": "calls", - "src_symbol_id": "4af42c2a9275d652e710a98ec48b8247236b4453a093629f8958704ff6d3cb58", - "src_qname": "HttpControlAppFactory.create", - "dst_symbol_id": null, - "dst_ref": "time.monotonic", - "resolution": "partial", - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "HttpControlAppFactory.create calls app.post", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "HttpControlAppFactory.create:calls", - "span_start": 37, - "span_end": 37, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "0e545d4b5187db7bec5ceac03071d2ad68177550c42af748fee364639e533c90", - "edge_type": "calls", - "src_symbol_id": "4af42c2a9275d652e710a98ec48b8247236b4453a093629f8958704ff6d3cb58", - "src_qname": "HttpControlAppFactory.create", - "dst_symbol_id": null, - "dst_ref": "app.post", - "resolution": "partial", - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "HttpControlAppFactory.create calls str", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "HttpControlAppFactory.create:calls", - "span_start": 27, - "span_end": 27, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "2a87c51461e31cd556508cc37fdff37b4d24c26f7f1604db30af5e8f1bda96cb", - "edge_type": "calls", - "src_symbol_id": "4af42c2a9275d652e710a98ec48b8247236b4453a093629f8958704ff6d3cb58", - "src_qname": "HttpControlAppFactory.create", - "dst_symbol_id": null, - "dst_ref": "str", - "resolution": "partial", - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "validation": { - "passed": true, - "action": "return", - "reasons": [] - }, - "steps": [ - { - "step": "router", - "status": "completed", - "timings_ms": { - "router": 1 - }, - "output": { - "intent": "CODE_QA", - "sub_intent": "TRACE_FLOW", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - } - }, - { - "step": "retrieval", - "status": "completed", - "timings_ms": { - "retrieval": 165 - }, - "output": { - "rag_count": 37, - "answer_path_rag_count": 37, - "resolved_symbol_status": "resolved", - "resolved_symbol": "HttpControlAppFactory", - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "diagnostics": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "vector", - "C0_SOURCE_CHUNKS": "vector", - "C4_SEMANTIC_ROLES": "vector", - "C2_DEPENDENCY_GRAPH": "vector", - "C3_ENTRYPOINTS": "vector" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 8, - "C4_SEMANTIC_ROLES": 8, - "C2_DEPENDENCY_GRAPH": 10, - "C3_ENTRYPOINTS": 10 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [] - }, - "C4_SEMANTIC_ROLES": { - "path_scope": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [] - } - }, - "fallback": { - "used": false, - "reason": null - }, - "retrieval_by_layer_ms": { - "C1_SYMBOL_CATALOG": 58, - "C0_SOURCE_CHUNKS": 21, - "C4_SEMANTIC_ROLES": 19, - "C2_DEPENDENCY_GRAPH": 54, - "C3_ENTRYPOINTS": 11 - } - } - }, - { - "step": "pre_evidence_gate", - "status": "passed", - "timings_ms": { - "pre_evidence_gate": 1 - }, - "input": { - "resolved_target": "HttpControlAppFactory", - "sub_intent": "TRACE_FLOW", - "target_type": "symbol", - "evidence_count": 37, - "code_chunk_count": 37, - "entrypoint_count": 3, - "relation_count": 10, - "test_evidence_count": 0, - "symbol_resolution_status": "resolved", - "path_scope": [] - }, - "output": { - "passed": true, - "failure_reasons": [], - "degraded_message": "", - "evidence_count": 37 - } - }, - { - "step": "llm", - "status": "completed", - "timings_ms": { - "llm": 4961 - }, - "output": { - "prompt_name": "code_qa_trace_flow_answer", - "answer_preview": "Запрос `/health` обрабатывается следующим образом:\n\n1. В `HttpControlAppFactory` создаётся маршрут `@app.get(\"/health\")`, который вызывает функцию `health`.\n - Путь: `src/app_runtime/control/http_app.py`\n - Строки: 31–34\n\n2. Функция `health` асинхронно ожидает данные от провайдера здоровья (`hea", - "resolved_target": "HttpControlAppFactory", - "answer_policy_branch": "normal_answer", - "decision_reason": "evidence_sufficient" - } - }, - { - "step": "post_evidence_gate", - "status": "passed", - "timings_ms": { - "post_evidence_gate": 1, - "post_evidence_gate_recheck": 0, - "repair": 0 - }, - "input": { - "answer_mode": "normal", - "degraded_message": "", - "resolved_target": "HttpControlAppFactory", - "draft_answer_preview": "Запрос `/health` обрабатывается следующим образом:\n\n1. В `HttpControlAppFactory` создаётся маршрут `@app.get(\"/health\")`, который вызывает функцию `health`.\n - Путь: `src/app_runtime/control/http_app.py`\n - Строки: 31–34\n\n2. Функция `health` асинхронно ожидает данные от провайдера здоровья (`hea", - "repair_candidate": true - }, - "output": { - "passed": true, - "action": "return", - "reasons": [], - "repair_used": false, - "final_answer_preview": "Запрос `/health` обрабатывается следующим образом:\n\n1. В `HttpControlAppFactory` создаётся маршрут `@app.get(\"/health\")`, который вызывает функцию `health`.\n - Путь: `src/app_runtime/control/http_app.py`\n - Строки: 31–34\n\n2. Функция `health` асинхронно ожидает данные от провайдера здоровья (`hea" - } - } - ] - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/plba_full_chain_subintents_v3/20260312_192715/full_chain_plba_code_subintents_v2_plba-v2-trace-flow-health-endpoint.md b/tests/pipeline_setup_v3/test_results/plba_full_chain_subintents_v3/20260312_192715/full_chain_plba_code_subintents_v2_plba-v2-trace-flow-health-endpoint.md deleted file mode 100644 index 532c500..0000000 --- a/tests/pipeline_setup_v3/test_results/plba_full_chain_subintents_v3/20260312_192715/full_chain_plba_code_subintents_v2_plba-v2-trace-flow-health-endpoint.md +++ /dev/null @@ -1,306 +0,0 @@ -# plba-v2-trace-flow-health-endpoint - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_02_pipeline/full_chain_plba_code_subintents_v2.yaml -- runner: agent_runtime -- mode: full_chain -- passed: True - -## Query -Покажи как проходит запрос /health в HttpControlAppFactory - -## Actual -{ - "intent": "CODE_QA", - "sub_intent": "TRACE_FLOW", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 37, - "llm_answer": "Запрос `/health` обрабатывается следующим образом:\n\n1. В `HttpControlAppFactory` создаётся маршрут `@app.get(\"/health\")`, который вызывает функцию `health`.\n - Путь: `src/app_runtime/control/http_app.py`\n - Строки: 31–34\n\n2. Функция `health` асинхронно ожидает данные от провайдера здоровья (`health_provider`), переданного в фабрику приложений.\n - Путь: `src/app_runtime/control/http_app.py`\n - Строки: 31–34\n\n3. Провайдер здоровья реализуется методом `_health_response` в классе `HttpControlChannel`. Он проверяет наличие действий (`_actions`) и возвращает статус здоровья.\n - Путь: `src/app_runtime/control/http_channel.py`\n - Строки: 44–50\n\nТаким образом, запрос `/health` проходит через эти компоненты для получения ответа о состоянии системы.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "health", - "HttpControlAppFactory" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] -} - -## Steps -[ - { - "step": "router", - "status": "completed", - "timings_ms": { - "router": 1 - }, - "output": { - "intent": "CODE_QA", - "sub_intent": "TRACE_FLOW", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - } - }, - { - "step": "retrieval", - "status": "completed", - "timings_ms": { - "retrieval": 165 - }, - "output": { - "rag_count": 37, - "answer_path_rag_count": 37, - "resolved_symbol_status": "resolved", - "resolved_symbol": "HttpControlAppFactory", - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "diagnostics": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "vector", - "C0_SOURCE_CHUNKS": "vector", - "C4_SEMANTIC_ROLES": "vector", - "C2_DEPENDENCY_GRAPH": "vector", - "C3_ENTRYPOINTS": "vector" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 8, - "C4_SEMANTIC_ROLES": 8, - "C2_DEPENDENCY_GRAPH": 10, - "C3_ENTRYPOINTS": 10 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [] - }, - "C4_SEMANTIC_ROLES": { - "path_scope": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [] - } - }, - "fallback": { - "used": false, - "reason": null - }, - "retrieval_by_layer_ms": { - "C1_SYMBOL_CATALOG": 58, - "C0_SOURCE_CHUNKS": 21, - "C4_SEMANTIC_ROLES": 19, - "C2_DEPENDENCY_GRAPH": 54, - "C3_ENTRYPOINTS": 11 - } - } - }, - { - "step": "pre_evidence_gate", - "status": "passed", - "timings_ms": { - "pre_evidence_gate": 1 - }, - "input": { - "resolved_target": "HttpControlAppFactory", - "sub_intent": "TRACE_FLOW", - "target_type": "symbol", - "evidence_count": 37, - "code_chunk_count": 37, - "entrypoint_count": 3, - "relation_count": 10, - "test_evidence_count": 0, - "symbol_resolution_status": "resolved", - "path_scope": [] - }, - "output": { - "passed": true, - "failure_reasons": [], - "degraded_message": "", - "evidence_count": 37 - } - }, - { - "step": "llm", - "status": "completed", - "timings_ms": { - "llm": 4961 - }, - "output": { - "prompt_name": "code_qa_trace_flow_answer", - "answer_preview": "Запрос `/health` обрабатывается следующим образом:\n\n1. В `HttpControlAppFactory` создаётся маршрут `@app.get(\"/health\")`, который вызывает функцию `health`.\n - Путь: `src/app_runtime/control/http_app.py`\n - Строки: 31–34\n\n2. Функция `health` асинхронно ожидает данные от провайдера здоровья (`hea", - "resolved_target": "HttpControlAppFactory", - "answer_policy_branch": "normal_answer", - "decision_reason": "evidence_sufficient" - } - }, - { - "step": "post_evidence_gate", - "status": "passed", - "timings_ms": { - "post_evidence_gate": 1, - "post_evidence_gate_recheck": 0, - "repair": 0 - }, - "input": { - "answer_mode": "normal", - "degraded_message": "", - "resolved_target": "HttpControlAppFactory", - "draft_answer_preview": "Запрос `/health` обрабатывается следующим образом:\n\n1. В `HttpControlAppFactory` создаётся маршрут `@app.get(\"/health\")`, который вызывает функцию `health`.\n - Путь: `src/app_runtime/control/http_app.py`\n - Строки: 31–34\n\n2. Функция `health` асинхронно ожидает данные от провайдера здоровья (`hea", - "repair_candidate": true - }, - "output": { - "passed": true, - "action": "return", - "reasons": [], - "repair_used": false, - "final_answer_preview": "Запрос `/health` обрабатывается следующим образом:\n\n1. В `HttpControlAppFactory` создаётся маршрут `@app.get(\"/health\")`, который вызывает функцию `health`.\n - Путь: `src/app_runtime/control/http_app.py`\n - Строки: 31–34\n\n2. Функция `health` асинхронно ожидает данные от провайдера здоровья (`hea" - } - } -] - -## Diagnostics -{ - "intent_correct": null, - "target_found": true, - "layers_used": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_sufficient": true, - "answer_mode": "normal", - "resolved_target": "HttpControlAppFactory", - "answer_policy_branch": "normal_answer", - "decision_reason": "evidence_sufficient", - "router_result": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "retrieval_profile": "code", - "sub_intent": "TRACE_FLOW", - "path_scope": [], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "symbol_resolution_status": "resolved" - }, - "retrieval_request": { - "rag_session_id": "7d11da21-faa0-4cea-aede-aeabe069164c", - "query": "Покажи как проходит запрос /health в HttpControlAppFactory", - "sub_intent": "TRACE_FLOW", - "path_scope": [], - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "per_layer_outcome": [ - { - "layer_id": "C1_SYMBOL_CATALOG", - "hit_count": 8, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C0_SOURCE_CHUNKS", - "hit_count": 8, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C4_SEMANTIC_ROLES", - "hit_count": 8, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C2_DEPENDENCY_GRAPH", - "hit_count": 10, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C3_ENTRYPOINTS", - "hit_count": 3, - "empty": false, - "fallback_used": false - } - ], - "empty_layers": [], - "evidence_gate_decision": { - "sufficient": true, - "failure_reasons": [], - "evidence_count": 37 - }, - "evidence_gate_input": { - "resolved_target": "HttpControlAppFactory", - "sub_intent": "TRACE_FLOW", - "target_type": "symbol", - "evidence_count": 37, - "code_chunk_count": 37, - "entrypoint_count": 3, - "relation_count": 10, - "test_evidence_count": 0, - "symbol_resolution_status": "resolved", - "path_scope": [] - }, - "post_evidence_gate": { - "input": { - "answer_mode": "normal", - "degraded_message": "", - "resolved_target": "HttpControlAppFactory", - "draft_answer_preview": "Запрос `/health` обрабатывается следующим образом:\n\n1. В `HttpControlAppFactory` создаётся маршрут `@app.get(\"/health\")`, который вызывает функцию `health`.\n - Путь: `src/app_runtime/control/http_app.py`\n - Строки: 31–34\n\n2. Функция `health` асинхронно ожидает данные от провайдера здоровья (`hea", - "repair_candidate": true - }, - "output": { - "passed": true, - "action": "return", - "reasons": [], - "repair_used": false, - "final_answer_preview": "Запрос `/health` обрабатывается следующим образом:\n\n1. В `HttpControlAppFactory` создаётся маршрут `@app.get(\"/health\")`, который вызывает функцию `health`.\n - Путь: `src/app_runtime/control/http_app.py`\n - Строки: 31–34\n\n2. Функция `health` асинхронно ожидает данные от провайдера здоровья (`hea" - } - }, - "failure_reasons": [], - "timings_ms": { - "router": 1, - "retrieval": 165, - "pre_evidence_gate": 1, - "llm": 4961, - "post_evidence_gate": 1 - } -} - -## Mismatches -- none \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/plba_full_chain_subintents_v3/20260312_192715/full_chain_plba_code_subintents_v2_plba-v2-trace-flow-runtime-start.json b/tests/pipeline_setup_v3/test_results/plba_full_chain_subintents_v3/20260312_192715/full_chain_plba_code_subintents_v2_plba-v2-trace-flow-runtime-start.json deleted file mode 100644 index 6ada923..0000000 --- a/tests/pipeline_setup_v3/test_results/plba_full_chain_subintents_v3/20260312_192715/full_chain_plba_code_subintents_v2_plba-v2-trace-flow-runtime-start.json +++ /dev/null @@ -1,5194 +0,0 @@ -{ - "case_id": "plba-v2-trace-flow-runtime-start", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_02_pipeline/full_chain_plba_code_subintents_v2.yaml", - "runner": "agent_runtime", - "mode": "full_chain", - "query": "Покажи поток выполнения при запуске RuntimeManager", - "actual": { - "intent": "CODE_QA", - "sub_intent": "TRACE_FLOW", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 37, - "llm_answer": "При запуске `RuntimeManager` выполняются следующие шаги:\n\n1. Инициализация конфигурации через поле `configuration`.\n2. Добавление конфигурационных файлов методом `add_config_file`.\n3. Инициализация сервисов методом `__init__` внутри конструктора.\n4. Регистрация основных служб методом `_register_core_services`.\n5. Старт менеджера методом `start`.\n\nЭти шаги соответствуют обнаруженному коду в файле `src/app_runtime/core/runtime.py`. \n\nДальнейший поток выполнения внутри методов (`_register_core_services`, `start`) восстановить полностью не представляется возможным, поскольку вызываемый код отсутствует в текущем контексте.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "RuntimeManager" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "passed": true, - "mismatches": [], - "details": { - "query": "Покажи поток выполнения при запуске RuntimeManager", - "router_result": { - "schema_version": "1.1", - "intent": "CODE_QA", - "retrieval_profile": "code", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query_plan": { - "raw": "Покажи поток выполнения при запуске RuntimeManager", - "normalized": "Покажи поток выполнения при запуске RuntimeManager", - "sub_intent": "TRACE_FLOW", - "negations": [], - "expansions": [ - "RuntimeManager" - ], - "keyword_hints": [ - "RuntimeManager" - ], - "path_hints": [], - "doc_scope_hints": [], - "symbol_candidates": [ - "RuntimeManager" - ], - "symbol_kind_hint": "class", - "anchors": [ - { - "type": "SYMBOL", - "value": "RuntimeManager", - "source": "user_text", - "subtype": null, - "span": { - "start": 36, - "end": 50 - }, - "confidence": 0.88 - } - ] - }, - "retrieval_spec": { - "domains": [ - "CODE" - ], - "layer_queries": [ - { - "layer_id": "C1_SYMBOL_CATALOG", - "top_k": 8 - }, - { - "layer_id": "C0_SOURCE_CHUNKS", - "top_k": 8 - }, - { - "layer_id": "C4_SEMANTIC_ROLES", - "top_k": 8 - }, - { - "layer_id": "C2_DEPENDENCY_GRAPH", - "top_k": 10 - }, - { - "layer_id": "C3_ENTRYPOINTS", - "top_k": 10 - } - ], - "filters": { - "test_policy": "EXCLUDE", - "path_scope": [], - "language": [ - "python" - ] - }, - "rerank_profile": "code" - }, - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - }, - "symbol_resolution": { - "status": "resolved", - "resolved_symbol": "RuntimeManager", - "alternatives": [ - "RuntimeManager", - "RuntimeManager", - "RuntimeManager", - "RuntimeManager", - "RuntimeManager" - ], - "confidence": 0.99 - }, - "evidence_policy": { - "require_def": true, - "require_flow": true, - "require_spec": false, - "allow_answer_without_evidence": false - } - }, - "retrieval_request": { - "rag_session_id": "7d11da21-faa0-4cea-aede-aeabe069164c", - "query": "Покажи поток выполнения при запуске RuntimeManager", - "sub_intent": "TRACE_FLOW", - "path_scope": [], - "keyword_hints": [ - "RuntimeManager" - ], - "symbol_candidates": [ - "RuntimeManager" - ], - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_spec": { - "domains": [ - "CODE" - ], - "layer_queries": [ - { - "layer_id": "C1_SYMBOL_CATALOG", - "top_k": 8 - }, - { - "layer_id": "C0_SOURCE_CHUNKS", - "top_k": 8 - }, - { - "layer_id": "C4_SEMANTIC_ROLES", - "top_k": 8 - }, - { - "layer_id": "C2_DEPENDENCY_GRAPH", - "top_k": 10 - }, - { - "layer_id": "C3_ENTRYPOINTS", - "top_k": 10 - } - ], - "filters": { - "test_policy": "EXCLUDE", - "path_scope": [], - "language": [ - "python" - ] - }, - "rerank_profile": "code" - }, - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - }, - "query_plan": { - "raw": "Покажи поток выполнения при запуске RuntimeManager", - "normalized": "Покажи поток выполнения при запуске RuntimeManager", - "sub_intent": "TRACE_FLOW", - "negations": [], - "expansions": [ - "RuntimeManager" - ], - "keyword_hints": [ - "RuntimeManager" - ], - "path_hints": [], - "doc_scope_hints": [], - "symbol_candidates": [ - "RuntimeManager" - ], - "symbol_kind_hint": "class", - "anchors": [ - { - "type": "SYMBOL", - "value": "RuntimeManager", - "source": "user_text", - "subtype": null, - "span": { - "start": 36, - "end": 50 - }, - "confidence": 0.88 - } - ] - } - }, - "retrieval_result": { - "target_symbol_candidates": [ - "RuntimeManager", - "ControlPlaneService", - "ControlChannel.start", - "ControlChannel.stop" - ], - "resolved_symbol": "RuntimeManager", - "symbol_resolution_status": "resolved", - "file_candidates": [ - "src/plba/bootstrap.py", - "src/app_runtime/control/service.py", - "src/app_runtime/core/runtime.py", - "src/plba/__init__.py", - "src/plba/core.py", - "src/app_runtime/control/__init__.py", - "src/app_runtime/control/base.py", - "src/app_runtime/control/http_runner.py", - "src/app_runtime/control/http_app.py", - "src/app_runtime/control/http_channel.py", - "src/plba/control.py", - "src/app_runtime/workflow/persistence/workflow_persistence.py" - ], - "code_chunks": [ - { - "layer": "C1_SYMBOL_CATALOG", - "path": "src/plba/bootstrap.py", - "title": "RuntimeManager", - "content": "const RuntimeManager\nRuntimeManager = app_runtime.core.runtime.RuntimeManager", - "start_line": 4, - "end_line": 4, - "metadata": { - "symbol_id": "27158ca220022eeb5083c6addf8a50775d45f7161284fd60aac48410105f4b98", - "qname": "RuntimeManager", - "kind": "const", - "signature": "RuntimeManager = app_runtime.core.runtime.RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "src.plba.bootstrap", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C1_SYMBOL_CATALOG", - "path": "src/app_runtime/control/service.py", - "title": "RuntimeManager", - "content": "const RuntimeManager\nRuntimeManager = app_runtime.core.runtime.RuntimeManager", - "start_line": 9, - "end_line": 9, - "metadata": { - "symbol_id": "62a9575c77aad894120d18b4f2a08cf2ba42f77e9be4a8a432b767d157701afe", - "qname": "RuntimeManager", - "kind": "const", - "signature": "RuntimeManager = app_runtime.core.runtime.RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.control.service", - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C1_SYMBOL_CATALOG", - "path": "src/app_runtime/core/runtime.py", - "title": "RuntimeManager", - "content": "class RuntimeManager\nRuntimeManager", - "start_line": 18, - "end_line": 179, - "metadata": { - "symbol_id": "7e4a9381328c5803bbc6179458612fc4e947d928aa7bf8b4b2bebb2c8592f758", - "qname": "RuntimeManager", - "kind": "class", - "signature": "RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.core.runtime", - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C1_SYMBOL_CATALOG", - "path": "src/plba/__init__.py", - "title": "RuntimeManager", - "content": "const RuntimeManager\nRuntimeManager = plba.core.RuntimeManager", - "start_line": 16, - "end_line": 16, - "metadata": { - "symbol_id": "7eacec84f9b8d6c4201374591faecdac7493091c263681495c338973f2971ad9", - "qname": "RuntimeManager", - "kind": "const", - "signature": "RuntimeManager = plba.core.RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "src.plba.__init__", - "is_test": false, - "blob_sha": "24e755ec8c249d14fb0e675b5dbf2b71ab91afb9c849897eebfa9feb2499e19d", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C1_SYMBOL_CATALOG", - "path": "src/plba/core.py", - "title": "RuntimeManager", - "content": "const RuntimeManager\nRuntimeManager = app_runtime.core.runtime.RuntimeManager", - "start_line": 2, - "end_line": 2, - "metadata": { - "symbol_id": "e1684562d978b7af7fe9b27dc5869d770348a87b5dc19a50360f58544668578b", - "qname": "RuntimeManager", - "kind": "const", - "signature": "RuntimeManager = app_runtime.core.runtime.RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "src.plba.core", - "is_test": false, - "blob_sha": "c0ae25110d20e665216616e26b68adfe035b624ba45d31d1272fb21f906f9ca8", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C1_SYMBOL_CATALOG", - "path": "src/app_runtime/control/__init__.py", - "title": "ControlPlaneService", - "content": "const ControlPlaneService\nControlPlaneService = app_runtime.control.service.ControlPlaneService", - "start_line": 3, - "end_line": 3, - "metadata": { - "symbol_id": "217e8f044d1c01644bf7b81e5046af9e84469210c692a2fb0c476a19bb069ae1", - "qname": "ControlPlaneService", - "kind": "const", - "signature": "ControlPlaneService = app_runtime.control.service.ControlPlaneService", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.control.__init__", - "is_test": false, - "blob_sha": "bf3c37e3369a84cc618adc0fd71c232e5eb4b871eaff743069a17e661e498316", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C1_SYMBOL_CATALOG", - "path": "src/app_runtime/control/base.py", - "title": "ControlChannel.start", - "content": "method ControlChannel.start\nstart(self, actions)\nStart the control channel and bind handlers.", - "start_line": 23, - "end_line": 24, - "metadata": { - "symbol_id": "e01e0d50d0f48d0c84c119c989b7a7c57ceea263811ce2605c684ae24d1a03b1", - "qname": "ControlChannel.start", - "kind": "method", - "signature": "start(self, actions)", - "parent_symbol_id": "ControlChannel", - "package_or_module": "src.app_runtime.control.base", - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C1_SYMBOL_CATALOG", - "path": "src/app_runtime/control/base.py", - "title": "ControlChannel.stop", - "content": "method ControlChannel.stop\nstop(self)\nStop the control channel and release resources.", - "start_line": 27, - "end_line": 28, - "metadata": { - "symbol_id": "54b5adf9866c526836221dc721b474ba23fbec83e1b1d3b8bc4da67ae3c1541d", - "qname": "ControlChannel.stop", - "kind": "method", - "signature": "stop(self)", - "parent_symbol_id": "ControlChannel", - "package_or_module": "src.app_runtime.control.base", - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C0_SOURCE_CHUNKS", - "path": "src/app_runtime/control/service.py", - "title": "src/app_runtime/control/service.py:ControlPlaneService", - "content": "class ControlPlaneService:\n def __init__(self) -> None:\n self._channels: list[ControlChannel] = []\n\n def register_channel(self, channel: ControlChannel) -> None:\n self._channels.append(channel)\n\n def start(self, runtime: RuntimeManager) -> None:\n if not self._channels:\n return\n asyncio.run(self._start_async(runtime))\n\n def stop(self) -> None:\n if not self._channels:\n return\n asyncio.run(self._stop_async())\n\n def snapshot(self, runtime: RuntimeManager) -> dict[str, object]:\n health = runtime.current_health()\n return {\n \"runtime\": {\"state\": runtime._state.value},\n \"modules\": list(runtime.registry.modules),\n \"services\": runtime.services.snapshot(),\n \"workers\": runtime.workers.snapshot(),\n \"health\": runtime.health.snapshot(runtime.workers.healths()) | {\"status\": health[\"status\"]},\n \"config\": runtime.configuration.get(),\n }\n\n async def _start_async(self, runtime: RuntimeManager) -> None:\n actions = ControlActionSet(\n health=runtime.health_status,\n start=runtime.start_runtime,\n stop=runtime.stop_runtime,\n status=runtime.runtime_status,\n )\n for channel in self._channels:\n await channel.start(actions)\n\n async def _stop_async(self) -> None:\n for channel in reversed(self._channels):\n await channel.stop()", - "start_line": 12, - "end_line": 52, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.service", - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C0_SOURCE_CHUNKS", - "path": "src/app_runtime/control/http_runner.py", - "title": "src/app_runtime/control/http_runner.py:UvicornThreadRunner", - "content": "class UvicornThreadRunner:\n def __init__(self, host: str, port: int, timeout: int) -> None:\n self._host = host\n self._port = port\n self._timeout = timeout\n self._server: Server | None = None\n self._thread: Thread | None = None\n self._error: BaseException | None = None\n\n async def start(self, app: FastAPI) -> None:\n if self._thread is not None and self._thread.is_alive():\n return\n self._error = None\n config = Config(app=app, host=self._host, port=self._port, log_level=\"warning\")\n self._server = Server(config)\n self._thread = Thread(target=self._serve, name=\"plba-http-control\", daemon=True)\n self._thread.start()\n await self._wait_until_started()\n\n async def stop(self) -> None:\n if self._server is None or self._thread is None:\n return\n self._server.should_exit = True\n await asyncio.to_thread(self._thread.join, self._timeout)\n self._server = None\n self._thread = None\n\n @property\n def port(self) -> int:\n if self._server is None or not getattr(self._server, \"servers\", None):\n return self._port\n socket = self._server.servers[0].sockets[0]\n return int(socket.getsockname()[1])\n\n async def _wait_until_started(self) -> None:\n if self._server is None:\n raise RuntimeError(\"Server is not initialized\")\n deadline = asyncio.get_running_loop().time() + max(float(self._timeout), 1.0)\n while not self._server.started:\n if self._error is not None:\n raise RuntimeError(\"HTTP control server failed to start\") from self._error\n if asyncio.get_running_loop().time() >= deadline:\n raise TimeoutError(\"HTTP control server startup timed out\")\n await asyncio.sleep(0.05)\n\n def _serve(self) -> None:\n if self._server is None:\n return\n try:\n asyncio.run(self._server.serve())\n except BaseException as exc: # noqa: BLE001\n self._error = exc", - "start_line": 10, - "end_line": 61, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.http_runner", - "is_test": false, - "blob_sha": "3779fdd2878b770e789a35bb2a89c9d79f13b61c26d7db1b3b683f9bb9e1623f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C0_SOURCE_CHUNKS", - "path": "src/app_runtime/control/base.py", - "title": "src/app_runtime/control/base.py:ControlChannel", - "content": "class ControlChannel(ABC):\n @abstractmethod\n async def start(self, actions: ControlActionSet) -> None:\n \"\"\"Start the control channel and bind handlers.\"\"\"\n\n @abstractmethod\n async def stop(self) -> None:\n \"\"\"Stop the control channel and release resources.\"\"\"", - "start_line": 21, - "end_line": 28, - "metadata": { - "chunk_index": 1, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.base", - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C0_SOURCE_CHUNKS", - "path": "src/app_runtime/control/__init__.py", - "title": "src/app_runtime/control/__init__.py:1-5", - "content": "from app_runtime.control.base import ControlActionSet, ControlChannel\nfrom app_runtime.control.http_channel import HttpControlChannel\nfrom app_runtime.control.service import ControlPlaneService\n\n__all__ = [\"ControlActionSet\", \"ControlChannel\", \"ControlPlaneService\", \"HttpControlChannel\"]", - "start_line": 1, - "end_line": 5, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.app_runtime.control.__init__", - "is_test": false, - "blob_sha": "bf3c37e3369a84cc618adc0fd71c232e5eb4b871eaff743069a17e661e498316", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C0_SOURCE_CHUNKS", - "path": "src/app_runtime/control/http_app.py", - "title": "src/app_runtime/control/http_app.py:HttpControlAppFactory", - "content": "class HttpControlAppFactory:\n def create(\n self,\n health_provider: Callable[[], Awaitable[HealthPayload]],\n action_provider: Callable[[str, str], Awaitable[JSONResponse]],\n ) -> FastAPI:\n app = FastAPI(title=\"PLBA Control API\")\n\n @app.middleware(\"http\")\n async def log_api_call(request: Request, call_next): # type: ignore[no-untyped-def]\n started = time.monotonic()\n response = await call_next(request)\n response.headers[\"X-Response-Time-Ms\"] = str(int((time.monotonic() - started) * 1000))\n return response\n\n @app.get(\"/health\")\n async def health() -> JSONResponse:\n payload = await health_provider()\n status_code = 200 if payload.get(\"status\") == \"ok\" else 503\n return JSONResponse(content=payload, status_code=status_code)\n\n @app.get(\"/actions/{action}\")\n @app.post(\"/actions/{action}\")\n async def action(action: str, request: Request) -> JSONResponse:\n client_source = self._client_source(request)\n if action in {\"start\", \"stop\"}:\n LOGGER.warning(\"Control action requested: /actions/%s client=%s\", action, client_source)\n return await action_provider(action, client_source)\n\n return app\n\n def _client_source(self, request: Request) -> str:\n explicit_header = request.headers.get(\"X-Client-Source\", \"\").strip()\n if explicit_header:\n return explicit_header\n user_agent = request.headers.get(\"User-Agent\", \"\").strip()\n if user_agent:\n return f\"user-agent:{user_agent}\"\n return \"unknown\"", - "start_line": 15, - "end_line": 53, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.http_app", - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C0_SOURCE_CHUNKS", - "path": "src/app_runtime/control/http_channel.py", - "title": "src/app_runtime/control/http_channel.py:HttpControlChannel", - "content": "class HttpControlChannel(ControlChannel):\n def __init__(self, host: str, port: int, timeout: int) -> None:\n self._timeout = timeout\n self._runner = UvicornThreadRunner(host, port, timeout)\n self._factory = HttpControlAppFactory()\n self._actions: ControlActionSet | None = None\n\n async def start(self, actions: ControlActionSet) -> None:\n self._actions = actions\n app = self._factory.create(self._health_response, self._action_response)\n await self._runner.start(app)\n\n async def stop(self) -> None:\n await self._runner.stop()\n\n @property\n def port(self) -> int:\n return self._runner.port\n\n async def _health_response(self) -> dict[str, object]:\n if self._actions is None:\n return {\"status\": \"unhealthy\", \"detail\": \"control actions are not configured\"}\n return await asyncio.wait_for(self._actions.health(), timeout=float(self._timeout))\n\n async def _action_response(self, action: str, _client_source: str = \"unknown\") -> JSONResponse:\n if self._actions is None:\n return JSONResponse(content={\"status\": \"error\", \"detail\": f\"{action} handler is not configured\"}, status_code=404)\n callbacks = {\n \"start\": self._actions.start,\n \"stop\": self._actions.stop,\n \"status\": self._actions.status,\n }\n callback = callbacks.get(action)\n if callback is None:\n return JSONResponse(content={\"status\": \"error\", \"detail\": f\"unsupported action: {action}\"}, status_code=404)\n action_timeout = max(float(self._timeout), 10.0) if action in {\"start\", \"stop\"} else float(self._timeout)\n try:\n detail = await asyncio.wait_for(callback(), timeout=action_timeout)\n except asyncio.TimeoutError:\n return JSONResponse(\n content={\"status\": \"accepted\", \"detail\": f\"{action} operation is still in progress\"},\n status_code=202,\n )\n except Exception as exc:\n return JSONResponse(content={\"status\": \"error\", \"detail\": str(exc)}, status_code=500)\n return JSONResponse(content={\"status\": \"ok\", \"detail\": detail or f\"{action} action accepted\"}, status_code=200)", - "start_line": 12, - "end_line": 57, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.http_channel", - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C0_SOURCE_CHUNKS", - "path": "src/app_runtime/control/base.py", - "title": "src/app_runtime/control/base.py:ControlActionSet", - "content": "class ControlActionSet:\n health: HealthHandler\n start: ActionHandler\n stop: ActionHandler\n status: ActionHandler", - "start_line": 14, - "end_line": 18, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.base", - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C0_SOURCE_CHUNKS", - "path": "src/plba/control.py", - "title": "src/plba/control.py:1-10", - "content": "from app_runtime.control.base import ControlActionSet, ControlChannel\nfrom app_runtime.control.http_channel import HttpControlChannel\nfrom app_runtime.control.service import ControlPlaneService\n\n__all__ = [\n \"ControlActionSet\",\n \"ControlChannel\",\n \"ControlPlaneService\",\n \"HttpControlChannel\",\n]", - "start_line": 1, - "end_line": 10, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.plba.control", - "is_test": false, - "blob_sha": "31bd5c4481bfa7fbca8fae56d4860a67e3953ca74474ac8439e1f39b685d7bc8", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C4_SEMANTIC_ROLES", - "path": "src/app_runtime/core/runtime.py", - "title": "RuntimeManager", - "content": "RuntimeManager\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests manager\n- orchestrates role-like calls (4)\n- reads and writes state attributes\n- participates in dataflow slices (50)", - "start_line": 18, - "end_line": 179, - "metadata": { - "symbol_id": "7e4a9381328c5803bbc6179458612fc4e947d928aa7bf8b4b2bebb2c8592f758", - "symbol_name": "RuntimeManager", - "qname": "RuntimeManager", - "role": "pipeline_stage", - "confidence": 0.67, - "dataflow_participation": 50, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C4_SEMANTIC_ROLES", - "path": "src/app_runtime/control/base.py", - "title": "ControlChannel", - "content": "ControlChannel\nrole: model\n\nResponsibilities:\n- default model role", - "start_line": 21, - "end_line": 28, - "metadata": { - "symbol_id": "cfcfe9a311d3a2dbdaf32ac4ccd73c0eb9a117f830591a1c0867ee97d46204ff", - "symbol_name": "ControlChannel", - "qname": "ControlChannel", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C4_SEMANTIC_ROLES", - "path": "src/app_runtime/control/base.py", - "title": "ControlActionSet", - "content": "ControlActionSet\nrole: model\n\nResponsibilities:\n- default model role", - "start_line": 14, - "end_line": 18, - "metadata": { - "symbol_id": "46eb026cb3313415ec47b82dd22f84f4d112c9d987e8b1716dcb0baa1cce8988", - "symbol_name": "ControlActionSet", - "qname": "ControlActionSet", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C4_SEMANTIC_ROLES", - "path": "src/app_runtime/control/service.py", - "title": "ControlPlaneService", - "content": "ControlPlaneService\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests service\n- reads and writes state attributes\n- participates in dataflow slices (5)", - "start_line": 12, - "end_line": 52, - "metadata": { - "symbol_id": "b13471e5916986dccffb53fab613812842965705e6b3a89ae549d30c9e91e9aa", - "symbol_name": "ControlPlaneService", - "qname": "ControlPlaneService", - "role": "pipeline_stage", - "confidence": 0.57, - "dataflow_participation": 5, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C4_SEMANTIC_ROLES", - "path": "src/app_runtime/control/http_runner.py", - "title": "UvicornThreadRunner", - "content": "UvicornThreadRunner\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (24)", - "start_line": 10, - "end_line": 61, - "metadata": { - "symbol_id": "fd55630045a02100df8877ac27d951ee08617d4598764394d48cb51fe067476a", - "symbol_name": "UvicornThreadRunner", - "qname": "UvicornThreadRunner", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 24, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "3779fdd2878b770e789a35bb2a89c9d79f13b61c26d7db1b3b683f9bb9e1623f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C4_SEMANTIC_ROLES", - "path": "src/app_runtime/control/http_channel.py", - "title": "HttpControlChannel", - "content": "HttpControlChannel\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (10)", - "start_line": 12, - "end_line": 57, - "metadata": { - "symbol_id": "1c9fbdc24819e5604c26ea55428a74310f03a03e1af197ed84846af61e42fdb0", - "symbol_name": "HttpControlChannel", - "qname": "HttpControlChannel", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 10, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C4_SEMANTIC_ROLES", - "path": "src/app_runtime/control/http_app.py", - "title": "HttpControlAppFactory", - "content": "HttpControlAppFactory\nrole: factory\n\nResponsibilities:\n- name suffix suggests factory", - "start_line": 15, - "end_line": 53, - "metadata": { - "symbol_id": "9b3502a5fb408b273223db13264349cf500de24915b6c649d9ea8970d0dfd8e0", - "symbol_name": "HttpControlAppFactory", - "qname": "HttpControlAppFactory", - "role": "factory", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C4_SEMANTIC_ROLES", - "path": "src/app_runtime/workflow/persistence/workflow_persistence.py", - "title": "WorkflowPersistence", - "content": "WorkflowPersistence\nrole: pipeline_stage\n\nResponsibilities:\n- orchestrates role-like calls (2)\n- reads and writes state attributes\n- participates in dataflow slices (16)", - "start_line": 8, - "end_line": 54, - "metadata": { - "symbol_id": "7bd01ee45cf31f2d5c2e3e51656254860ac785d10cef9e0852cd4fba90857bae", - "symbol_name": "WorkflowPersistence", - "qname": "WorkflowPersistence", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 16, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "80e9410ddc639789b4353c2a1a757ba8d0d5b5bb6075b0b263b61551f04ae1f0", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "path": "src/app_runtime/core/runtime.py", - "title": "RuntimeManager.__init__:dataflow_slice", - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager.add_config_file", - "start_line": 32, - "end_line": 52, - "metadata": { - "edge_id": "a23b8a11ebdb12708b60c96ea12a69f7f042082f1adfddd572444e246d81d167", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "57ffbd4f0d9fdf3507c2b8624312ce211f3d02fdf86a57a8ec90778d8a7b498d", - "dst_ref": "RuntimeManager.add_config_file", - "resolution": "resolved", - "slice_id": "a23b8a11ebdb12708b60c96ea12a69f7f042082f1adfddd572444e246d81d167", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager.add_config_file" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "57ffbd4f0d9fdf3507c2b8624312ce211f3d02fdf86a57a8ec90778d8a7b498d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "path": "src/app_runtime/core/runtime.py", - "title": "RuntimeManager.__init__:dataflow_slice", - "content": "RuntimeManager.__init__\n -> RuntimeManager.services\n -> RuntimeManager.__init__", - "start_line": 33, - "end_line": 39, - "metadata": { - "edge_id": "d43af85989222ee6d788ce418cdcb217c7ff044cfb915e3bdbd184417dc7bd61", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "dst_ref": "RuntimeManager.__init__", - "resolution": "resolved", - "slice_id": "d43af85989222ee6d788ce418cdcb217c7ff044cfb915e3bdbd184417dc7bd61", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.services", - "RuntimeManager.__init__" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "path": "src/app_runtime/control/service.py", - "title": "ControlPlaneService.__init__:dataflow_slice", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.stop", - "start_line": 14, - "end_line": 25, - "metadata": { - "edge_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d", - "dst_ref": "ControlPlaneService.stop", - "resolution": "resolved", - "slice_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.stop" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "path": "src/app_runtime/control/service.py", - "title": "ControlPlaneService.__init__:dataflow_slice", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._stop_async", - "start_line": 14, - "end_line": 51, - "metadata": { - "edge_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a", - "dst_ref": "ControlPlaneService._stop_async", - "resolution": "resolved", - "slice_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._stop_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "path": "src/app_runtime/core/runtime.py", - "title": "RuntimeManager.__init__:dataflow_slice", - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager.start", - "start_line": 32, - "end_line": 59, - "metadata": { - "edge_id": "98312ace7fc62b1c7194c5aa1732b6ef736eae1668a3a120dd1ecd5ab1d64f7a", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "77a7b260193018845e4e204df094ab89cfd7c82ee4e822b3a83ad4cd945f9cb1", - "dst_ref": "RuntimeManager.start", - "resolution": "resolved", - "slice_id": "98312ace7fc62b1c7194c5aa1732b6ef736eae1668a3a120dd1ecd5ab1d64f7a", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager.start" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "77a7b260193018845e4e204df094ab89cfd7c82ee4e822b3a83ad4cd945f9cb1" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "path": "src/app_runtime/core/runtime.py", - "title": "RuntimeManager.__init__:dataflow_slice", - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager._register_core_services", - "start_line": 32, - "end_line": 127, - "metadata": { - "edge_id": "3e5811f3b511fa0cabe363f5d01f2ac5fa039bc8b93f7ee108323e1f5f45a293", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "972d6057a6caac9cf31ebc1e29c6f39f71b10d4cc170dec57cf875ba458549c6", - "dst_ref": "RuntimeManager._register_core_services", - "resolution": "resolved", - "slice_id": "3e5811f3b511fa0cabe363f5d01f2ac5fa039bc8b93f7ee108323e1f5f45a293", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager._register_core_services" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "972d6057a6caac9cf31ebc1e29c6f39f71b10d4cc170dec57cf875ba458549c6" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "path": "src/app_runtime/control/service.py", - "title": "ControlPlaneService.__init__:dataflow_slice", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.register_channel", - "start_line": 14, - "end_line": 17, - "metadata": { - "edge_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957", - "dst_ref": "ControlPlaneService.register_channel", - "resolution": "resolved", - "slice_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.register_channel" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "path": "src/app_runtime/control/service.py", - "title": "ControlPlaneService.__init__:dataflow_slice", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.start", - "start_line": 14, - "end_line": 20, - "metadata": { - "edge_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154", - "dst_ref": "ControlPlaneService.start", - "resolution": "resolved", - "slice_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.start" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "path": "src/app_runtime/control/service.py", - "title": "ControlPlaneService.__init__:dataflow_slice", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._start_async", - "start_line": 14, - "end_line": 47, - "metadata": { - "edge_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517", - "dst_ref": "ControlPlaneService._start_async", - "resolution": "resolved", - "slice_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._start_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C2_DEPENDENCY_GRAPH", - "path": "src/app_runtime/core/runtime.py", - "title": "RuntimeManager.__init__:dataflow_slice", - "content": "RuntimeManager.__init__\n -> RuntimeManager.services\n -> RuntimeManager._register_core_services", - "start_line": 33, - "end_line": 127, - "metadata": { - "edge_id": "aac6f9dda73963b977083a892bee39a48eca4fbd7404787e022ecf4ebedec65d", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "972d6057a6caac9cf31ebc1e29c6f39f71b10d4cc170dec57cf875ba458549c6", - "dst_ref": "RuntimeManager._register_core_services", - "resolution": "resolved", - "slice_id": "aac6f9dda73963b977083a892bee39a48eca4fbd7404787e022ecf4ebedec65d", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.services", - "RuntimeManager._register_core_services" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "972d6057a6caac9cf31ebc1e29c6f39f71b10d4cc170dec57cf875ba458549c6" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C3_ENTRYPOINTS", - "path": "src/app_runtime/control/http_app.py", - "title": "app.post", - "content": "fastapi http app.post", - "start_line": 38, - "end_line": 42, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C3_ENTRYPOINTS", - "path": "src/app_runtime/control/http_app.py", - "title": "app.get", - "content": "fastapi http app.get", - "start_line": 31, - "end_line": 34, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C3_ENTRYPOINTS", - "path": "src/app_runtime/control/http_app.py", - "title": "app.get", - "content": "fastapi http app.get", - "start_line": 38, - "end_line": 42, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "relations": [ - { - "path": "src/app_runtime/core/runtime.py", - "start_line": 32, - "end_line": 52, - "edge_type": "dataflow_slice", - "source": "RuntimeManager.__init__", - "target": "RuntimeManager.add_config_file", - "metadata": { - "edge_id": "a23b8a11ebdb12708b60c96ea12a69f7f042082f1adfddd572444e246d81d167", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "57ffbd4f0d9fdf3507c2b8624312ce211f3d02fdf86a57a8ec90778d8a7b498d", - "dst_ref": "RuntimeManager.add_config_file", - "resolution": "resolved", - "slice_id": "a23b8a11ebdb12708b60c96ea12a69f7f042082f1adfddd572444e246d81d167", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager.add_config_file" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "57ffbd4f0d9fdf3507c2b8624312ce211f3d02fdf86a57a8ec90778d8a7b498d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - }, - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager.add_config_file" - }, - { - "path": "src/app_runtime/core/runtime.py", - "start_line": 33, - "end_line": 39, - "edge_type": "dataflow_slice", - "source": "RuntimeManager.__init__", - "target": "RuntimeManager.__init__", - "metadata": { - "edge_id": "d43af85989222ee6d788ce418cdcb217c7ff044cfb915e3bdbd184417dc7bd61", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "dst_ref": "RuntimeManager.__init__", - "resolution": "resolved", - "slice_id": "d43af85989222ee6d788ce418cdcb217c7ff044cfb915e3bdbd184417dc7bd61", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.services", - "RuntimeManager.__init__" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - }, - "content": "RuntimeManager.__init__\n -> RuntimeManager.services\n -> RuntimeManager.__init__" - }, - { - "path": "src/app_runtime/control/service.py", - "start_line": 14, - "end_line": 25, - "edge_type": "dataflow_slice", - "source": "ControlPlaneService.__init__", - "target": "ControlPlaneService.stop", - "metadata": { - "edge_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d", - "dst_ref": "ControlPlaneService.stop", - "resolution": "resolved", - "slice_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.stop" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - }, - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.stop" - }, - { - "path": "src/app_runtime/control/service.py", - "start_line": 14, - "end_line": 51, - "edge_type": "dataflow_slice", - "source": "ControlPlaneService.__init__", - "target": "ControlPlaneService._stop_async", - "metadata": { - "edge_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a", - "dst_ref": "ControlPlaneService._stop_async", - "resolution": "resolved", - "slice_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._stop_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - }, - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._stop_async" - }, - { - "path": "src/app_runtime/core/runtime.py", - "start_line": 32, - "end_line": 59, - "edge_type": "dataflow_slice", - "source": "RuntimeManager.__init__", - "target": "RuntimeManager.start", - "metadata": { - "edge_id": "98312ace7fc62b1c7194c5aa1732b6ef736eae1668a3a120dd1ecd5ab1d64f7a", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "77a7b260193018845e4e204df094ab89cfd7c82ee4e822b3a83ad4cd945f9cb1", - "dst_ref": "RuntimeManager.start", - "resolution": "resolved", - "slice_id": "98312ace7fc62b1c7194c5aa1732b6ef736eae1668a3a120dd1ecd5ab1d64f7a", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager.start" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "77a7b260193018845e4e204df094ab89cfd7c82ee4e822b3a83ad4cd945f9cb1" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - }, - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager.start" - }, - { - "path": "src/app_runtime/core/runtime.py", - "start_line": 32, - "end_line": 127, - "edge_type": "dataflow_slice", - "source": "RuntimeManager.__init__", - "target": "RuntimeManager._register_core_services", - "metadata": { - "edge_id": "3e5811f3b511fa0cabe363f5d01f2ac5fa039bc8b93f7ee108323e1f5f45a293", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "972d6057a6caac9cf31ebc1e29c6f39f71b10d4cc170dec57cf875ba458549c6", - "dst_ref": "RuntimeManager._register_core_services", - "resolution": "resolved", - "slice_id": "3e5811f3b511fa0cabe363f5d01f2ac5fa039bc8b93f7ee108323e1f5f45a293", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager._register_core_services" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "972d6057a6caac9cf31ebc1e29c6f39f71b10d4cc170dec57cf875ba458549c6" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - }, - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager._register_core_services" - }, - { - "path": "src/app_runtime/control/service.py", - "start_line": 14, - "end_line": 17, - "edge_type": "dataflow_slice", - "source": "ControlPlaneService.__init__", - "target": "ControlPlaneService.register_channel", - "metadata": { - "edge_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957", - "dst_ref": "ControlPlaneService.register_channel", - "resolution": "resolved", - "slice_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.register_channel" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - }, - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.register_channel" - }, - { - "path": "src/app_runtime/control/service.py", - "start_line": 14, - "end_line": 20, - "edge_type": "dataflow_slice", - "source": "ControlPlaneService.__init__", - "target": "ControlPlaneService.start", - "metadata": { - "edge_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154", - "dst_ref": "ControlPlaneService.start", - "resolution": "resolved", - "slice_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.start" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - }, - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.start" - }, - { - "path": "src/app_runtime/control/service.py", - "start_line": 14, - "end_line": 47, - "edge_type": "dataflow_slice", - "source": "ControlPlaneService.__init__", - "target": "ControlPlaneService._start_async", - "metadata": { - "edge_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517", - "dst_ref": "ControlPlaneService._start_async", - "resolution": "resolved", - "slice_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._start_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - }, - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._start_async" - }, - { - "path": "src/app_runtime/core/runtime.py", - "start_line": 33, - "end_line": 127, - "edge_type": "dataflow_slice", - "source": "RuntimeManager.__init__", - "target": "RuntimeManager._register_core_services", - "metadata": { - "edge_id": "aac6f9dda73963b977083a892bee39a48eca4fbd7404787e022ecf4ebedec65d", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "972d6057a6caac9cf31ebc1e29c6f39f71b10d4cc170dec57cf875ba458549c6", - "dst_ref": "RuntimeManager._register_core_services", - "resolution": "resolved", - "slice_id": "aac6f9dda73963b977083a892bee39a48eca4fbd7404787e022ecf4ebedec65d", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.services", - "RuntimeManager._register_core_services" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "972d6057a6caac9cf31ebc1e29c6f39f71b10d4cc170dec57cf875ba458549c6" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - }, - "content": "RuntimeManager.__init__\n -> RuntimeManager.services\n -> RuntimeManager._register_core_services" - } - ], - "semantic_hints": [ - { - "path": "src/app_runtime/core/runtime.py", - "title": "RuntimeManager", - "symbol": "RuntimeManager", - "role": "pipeline_stage", - "confidence": 0.67, - "content": "RuntimeManager\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests manager\n- orchestrates role-like calls (4)\n- reads and writes state attributes\n- participates in dataflow slices (50)" - }, - { - "path": "src/app_runtime/control/base.py", - "title": "ControlChannel", - "symbol": "ControlChannel", - "role": "model", - "confidence": 0.99, - "content": "ControlChannel\nrole: model\n\nResponsibilities:\n- default model role" - }, - { - "path": "src/app_runtime/control/base.py", - "title": "ControlActionSet", - "symbol": "ControlActionSet", - "role": "model", - "confidence": 0.99, - "content": "ControlActionSet\nrole: model\n\nResponsibilities:\n- default model role" - }, - { - "path": "src/app_runtime/control/service.py", - "title": "ControlPlaneService", - "symbol": "ControlPlaneService", - "role": "pipeline_stage", - "confidence": 0.57, - "content": "ControlPlaneService\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests service\n- reads and writes state attributes\n- participates in dataflow slices (5)" - }, - { - "path": "src/app_runtime/control/http_runner.py", - "title": "UvicornThreadRunner", - "symbol": "UvicornThreadRunner", - "role": "pipeline_stage", - "confidence": 0.99, - "content": "UvicornThreadRunner\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (24)" - }, - { - "path": "src/app_runtime/control/http_channel.py", - "title": "HttpControlChannel", - "symbol": "HttpControlChannel", - "role": "pipeline_stage", - "confidence": 0.99, - "content": "HttpControlChannel\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (10)" - }, - { - "path": "src/app_runtime/control/http_app.py", - "title": "HttpControlAppFactory", - "symbol": "HttpControlAppFactory", - "role": "factory", - "confidence": 0.99, - "content": "HttpControlAppFactory\nrole: factory\n\nResponsibilities:\n- name suffix suggests factory" - }, - { - "path": "src/app_runtime/workflow/persistence/workflow_persistence.py", - "title": "WorkflowPersistence", - "symbol": "WorkflowPersistence", - "role": "pipeline_stage", - "confidence": 0.99, - "content": "WorkflowPersistence\nrole: pipeline_stage\n\nResponsibilities:\n- orchestrates role-like calls (2)\n- reads and writes state attributes\n- participates in dataflow slices (16)" - } - ], - "entrypoints": [ - { - "path": "src/app_runtime/control/http_app.py", - "title": "app.get", - "start_line": 31, - "end_line": 34, - "http_method": "GET", - "route_path": "/health", - "handler_symbol": "health", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "route_or_command": "app.get", - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "title": "app.get", - "start_line": 38, - "end_line": 42, - "http_method": "GET", - "route_path": "/actions/{action}", - "handler_symbol": "action", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "route_or_command": "app.get", - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "title": "app.post", - "start_line": 38, - "end_line": 42, - "http_method": "POST", - "route_path": "/actions/{action}", - "handler_symbol": "action", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "route_or_command": "app.post", - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "test_candidates": [], - "layer_outcomes": [ - { - "layer_id": "C1_SYMBOL_CATALOG", - "hit_count": 8, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C0_SOURCE_CHUNKS", - "hit_count": 8, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C4_SEMANTIC_ROLES", - "hit_count": 8, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C2_DEPENDENCY_GRAPH", - "hit_count": 10, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C3_ENTRYPOINTS", - "hit_count": 3, - "empty": false, - "fallback_used": false - } - ], - "missing_layers": [], - "raw_rows": [ - { - "path": "src/plba/bootstrap.py", - "content": "const RuntimeManager\nRuntimeManager = app_runtime.core.runtime.RuntimeManager", - "layer": "C1_SYMBOL_CATALOG", - "title": "RuntimeManager", - "span_start": 4, - "span_end": 4, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": null, - "metadata": { - "symbol_id": "27158ca220022eeb5083c6addf8a50775d45f7161284fd60aac48410105f4b98", - "qname": "RuntimeManager", - "kind": "const", - "signature": "RuntimeManager = app_runtime.core.runtime.RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "src.plba.bootstrap", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "const RuntimeManager\nRuntimeManager = app_runtime.core.runtime.RuntimeManager", - "layer": "C1_SYMBOL_CATALOG", - "title": "RuntimeManager", - "span_start": 9, - "span_end": 9, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": null, - "metadata": { - "symbol_id": "62a9575c77aad894120d18b4f2a08cf2ba42f77e9be4a8a432b767d157701afe", - "qname": "RuntimeManager", - "kind": "const", - "signature": "RuntimeManager = app_runtime.core.runtime.RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.control.service", - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "class RuntimeManager\nRuntimeManager", - "layer": "C1_SYMBOL_CATALOG", - "title": "RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": null, - "metadata": { - "symbol_id": "7e4a9381328c5803bbc6179458612fc4e947d928aa7bf8b4b2bebb2c8592f758", - "qname": "RuntimeManager", - "kind": "class", - "signature": "RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.core.runtime", - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/__init__.py", - "content": "const RuntimeManager\nRuntimeManager = plba.core.RuntimeManager", - "layer": "C1_SYMBOL_CATALOG", - "title": "RuntimeManager", - "span_start": 16, - "span_end": 16, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": null, - "metadata": { - "symbol_id": "7eacec84f9b8d6c4201374591faecdac7493091c263681495c338973f2971ad9", - "qname": "RuntimeManager", - "kind": "const", - "signature": "RuntimeManager = plba.core.RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "src.plba.__init__", - "is_test": false, - "blob_sha": "24e755ec8c249d14fb0e675b5dbf2b71ab91afb9c849897eebfa9feb2499e19d", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/core.py", - "content": "const RuntimeManager\nRuntimeManager = app_runtime.core.runtime.RuntimeManager", - "layer": "C1_SYMBOL_CATALOG", - "title": "RuntimeManager", - "span_start": 2, - "span_end": 2, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": null, - "metadata": { - "symbol_id": "e1684562d978b7af7fe9b27dc5869d770348a87b5dc19a50360f58544668578b", - "qname": "RuntimeManager", - "kind": "const", - "signature": "RuntimeManager = app_runtime.core.runtime.RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "src.plba.core", - "is_test": false, - "blob_sha": "c0ae25110d20e665216616e26b68adfe035b624ba45d31d1272fb21f906f9ca8", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/__init__.py", - "content": "const ControlPlaneService\nControlPlaneService = app_runtime.control.service.ControlPlaneService", - "layer": "C1_SYMBOL_CATALOG", - "title": "ControlPlaneService", - "span_start": 3, - "span_end": 3, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": null, - "metadata": { - "symbol_id": "217e8f044d1c01644bf7b81e5046af9e84469210c692a2fb0c476a19bb069ae1", - "qname": "ControlPlaneService", - "kind": "const", - "signature": "ControlPlaneService = app_runtime.control.service.ControlPlaneService", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.control.__init__", - "is_test": false, - "blob_sha": "bf3c37e3369a84cc618adc0fd71c232e5eb4b871eaff743069a17e661e498316", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "method ControlChannel.start\nstart(self, actions)\nStart the control channel and bind handlers.", - "layer": "C1_SYMBOL_CATALOG", - "title": "ControlChannel.start", - "span_start": 23, - "span_end": 24, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": null, - "metadata": { - "symbol_id": "e01e0d50d0f48d0c84c119c989b7a7c57ceea263811ce2605c684ae24d1a03b1", - "qname": "ControlChannel.start", - "kind": "method", - "signature": "start(self, actions)", - "parent_symbol_id": "ControlChannel", - "package_or_module": "src.app_runtime.control.base", - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "method ControlChannel.stop\nstop(self)\nStop the control channel and release resources.", - "layer": "C1_SYMBOL_CATALOG", - "title": "ControlChannel.stop", - "span_start": 27, - "span_end": 28, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": null, - "metadata": { - "symbol_id": "54b5adf9866c526836221dc721b474ba23fbec83e1b1d3b8bc4da67ae3c1541d", - "qname": "ControlChannel.stop", - "kind": "method", - "signature": "stop(self)", - "parent_symbol_id": "ControlChannel", - "package_or_module": "src.app_runtime.control.base", - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "class ControlPlaneService:\n def __init__(self) -> None:\n self._channels: list[ControlChannel] = []\n\n def register_channel(self, channel: ControlChannel) -> None:\n self._channels.append(channel)\n\n def start(self, runtime: RuntimeManager) -> None:\n if not self._channels:\n return\n asyncio.run(self._start_async(runtime))\n\n def stop(self) -> None:\n if not self._channels:\n return\n asyncio.run(self._stop_async())\n\n def snapshot(self, runtime: RuntimeManager) -> dict[str, object]:\n health = runtime.current_health()\n return {\n \"runtime\": {\"state\": runtime._state.value},\n \"modules\": list(runtime.registry.modules),\n \"services\": runtime.services.snapshot(),\n \"workers\": runtime.workers.snapshot(),\n \"health\": runtime.health.snapshot(runtime.workers.healths()) | {\"status\": health[\"status\"]},\n \"config\": runtime.configuration.get(),\n }\n\n async def _start_async(self, runtime: RuntimeManager) -> None:\n actions = ControlActionSet(\n health=runtime.health_status,\n start=runtime.start_runtime,\n stop=runtime.stop_runtime,\n status=runtime.runtime_status,\n )\n for channel in self._channels:\n await channel.start(actions)\n\n async def _stop_async(self) -> None:\n for channel in reversed(self._channels):\n await channel.stop()", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/service.py:ControlPlaneService", - "span_start": 12, - "span_end": 52, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": null, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.service", - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_runner.py", - "content": "class UvicornThreadRunner:\n def __init__(self, host: str, port: int, timeout: int) -> None:\n self._host = host\n self._port = port\n self._timeout = timeout\n self._server: Server | None = None\n self._thread: Thread | None = None\n self._error: BaseException | None = None\n\n async def start(self, app: FastAPI) -> None:\n if self._thread is not None and self._thread.is_alive():\n return\n self._error = None\n config = Config(app=app, host=self._host, port=self._port, log_level=\"warning\")\n self._server = Server(config)\n self._thread = Thread(target=self._serve, name=\"plba-http-control\", daemon=True)\n self._thread.start()\n await self._wait_until_started()\n\n async def stop(self) -> None:\n if self._server is None or self._thread is None:\n return\n self._server.should_exit = True\n await asyncio.to_thread(self._thread.join, self._timeout)\n self._server = None\n self._thread = None\n\n @property\n def port(self) -> int:\n if self._server is None or not getattr(self._server, \"servers\", None):\n return self._port\n socket = self._server.servers[0].sockets[0]\n return int(socket.getsockname()[1])\n\n async def _wait_until_started(self) -> None:\n if self._server is None:\n raise RuntimeError(\"Server is not initialized\")\n deadline = asyncio.get_running_loop().time() + max(float(self._timeout), 1.0)\n while not self._server.started:\n if self._error is not None:\n raise RuntimeError(\"HTTP control server failed to start\") from self._error\n if asyncio.get_running_loop().time() >= deadline:\n raise TimeoutError(\"HTTP control server startup timed out\")\n await asyncio.sleep(0.05)\n\n def _serve(self) -> None:\n if self._server is None:\n return\n try:\n asyncio.run(self._server.serve())\n except BaseException as exc: # noqa: BLE001\n self._error = exc", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/http_runner.py:UvicornThreadRunner", - "span_start": 10, - "span_end": 61, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": null, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.http_runner", - "is_test": false, - "blob_sha": "3779fdd2878b770e789a35bb2a89c9d79f13b61c26d7db1b3b683f9bb9e1623f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "class ControlChannel(ABC):\n @abstractmethod\n async def start(self, actions: ControlActionSet) -> None:\n \"\"\"Start the control channel and bind handlers.\"\"\"\n\n @abstractmethod\n async def stop(self) -> None:\n \"\"\"Stop the control channel and release resources.\"\"\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/base.py:ControlChannel", - "span_start": 21, - "span_end": 28, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": null, - "metadata": { - "chunk_index": 1, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.base", - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/__init__.py", - "content": "from app_runtime.control.base import ControlActionSet, ControlChannel\nfrom app_runtime.control.http_channel import HttpControlChannel\nfrom app_runtime.control.service import ControlPlaneService\n\n__all__ = [\"ControlActionSet\", \"ControlChannel\", \"ControlPlaneService\", \"HttpControlChannel\"]", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/__init__.py:1-5", - "span_start": 1, - "span_end": 5, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": null, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.app_runtime.control.__init__", - "is_test": false, - "blob_sha": "bf3c37e3369a84cc618adc0fd71c232e5eb4b871eaff743069a17e661e498316", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "class HttpControlAppFactory:\n def create(\n self,\n health_provider: Callable[[], Awaitable[HealthPayload]],\n action_provider: Callable[[str, str], Awaitable[JSONResponse]],\n ) -> FastAPI:\n app = FastAPI(title=\"PLBA Control API\")\n\n @app.middleware(\"http\")\n async def log_api_call(request: Request, call_next): # type: ignore[no-untyped-def]\n started = time.monotonic()\n response = await call_next(request)\n response.headers[\"X-Response-Time-Ms\"] = str(int((time.monotonic() - started) * 1000))\n return response\n\n @app.get(\"/health\")\n async def health() -> JSONResponse:\n payload = await health_provider()\n status_code = 200 if payload.get(\"status\") == \"ok\" else 503\n return JSONResponse(content=payload, status_code=status_code)\n\n @app.get(\"/actions/{action}\")\n @app.post(\"/actions/{action}\")\n async def action(action: str, request: Request) -> JSONResponse:\n client_source = self._client_source(request)\n if action in {\"start\", \"stop\"}:\n LOGGER.warning(\"Control action requested: /actions/%s client=%s\", action, client_source)\n return await action_provider(action, client_source)\n\n return app\n\n def _client_source(self, request: Request) -> str:\n explicit_header = request.headers.get(\"X-Client-Source\", \"\").strip()\n if explicit_header:\n return explicit_header\n user_agent = request.headers.get(\"User-Agent\", \"\").strip()\n if user_agent:\n return f\"user-agent:{user_agent}\"\n return \"unknown\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/http_app.py:HttpControlAppFactory", - "span_start": 15, - "span_end": 53, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": null, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.http_app", - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "class HttpControlChannel(ControlChannel):\n def __init__(self, host: str, port: int, timeout: int) -> None:\n self._timeout = timeout\n self._runner = UvicornThreadRunner(host, port, timeout)\n self._factory = HttpControlAppFactory()\n self._actions: ControlActionSet | None = None\n\n async def start(self, actions: ControlActionSet) -> None:\n self._actions = actions\n app = self._factory.create(self._health_response, self._action_response)\n await self._runner.start(app)\n\n async def stop(self) -> None:\n await self._runner.stop()\n\n @property\n def port(self) -> int:\n return self._runner.port\n\n async def _health_response(self) -> dict[str, object]:\n if self._actions is None:\n return {\"status\": \"unhealthy\", \"detail\": \"control actions are not configured\"}\n return await asyncio.wait_for(self._actions.health(), timeout=float(self._timeout))\n\n async def _action_response(self, action: str, _client_source: str = \"unknown\") -> JSONResponse:\n if self._actions is None:\n return JSONResponse(content={\"status\": \"error\", \"detail\": f\"{action} handler is not configured\"}, status_code=404)\n callbacks = {\n \"start\": self._actions.start,\n \"stop\": self._actions.stop,\n \"status\": self._actions.status,\n }\n callback = callbacks.get(action)\n if callback is None:\n return JSONResponse(content={\"status\": \"error\", \"detail\": f\"unsupported action: {action}\"}, status_code=404)\n action_timeout = max(float(self._timeout), 10.0) if action in {\"start\", \"stop\"} else float(self._timeout)\n try:\n detail = await asyncio.wait_for(callback(), timeout=action_timeout)\n except asyncio.TimeoutError:\n return JSONResponse(\n content={\"status\": \"accepted\", \"detail\": f\"{action} operation is still in progress\"},\n status_code=202,\n )\n except Exception as exc:\n return JSONResponse(content={\"status\": \"error\", \"detail\": str(exc)}, status_code=500)\n return JSONResponse(content={\"status\": \"ok\", \"detail\": detail or f\"{action} action accepted\"}, status_code=200)", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/http_channel.py:HttpControlChannel", - "span_start": 12, - "span_end": 57, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": null, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.http_channel", - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "class ControlActionSet:\n health: HealthHandler\n start: ActionHandler\n stop: ActionHandler\n status: ActionHandler", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/base.py:ControlActionSet", - "span_start": 14, - "span_end": 18, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": null, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.base", - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/control.py", - "content": "from app_runtime.control.base import ControlActionSet, ControlChannel\nfrom app_runtime.control.http_channel import HttpControlChannel\nfrom app_runtime.control.service import ControlPlaneService\n\n__all__ = [\n \"ControlActionSet\",\n \"ControlChannel\",\n \"ControlPlaneService\",\n \"HttpControlChannel\",\n]", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/plba/control.py:1-10", - "span_start": 1, - "span_end": 10, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": null, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.plba.control", - "is_test": false, - "blob_sha": "31bd5c4481bfa7fbca8fae56d4860a67e3953ca74474ac8439e1f39b685d7bc8", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests manager\n- orchestrates role-like calls (4)\n- reads and writes state attributes\n- participates in dataflow slices (50)", - "layer": "C4_SEMANTIC_ROLES", - "title": "RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 43, - "layer_rank": 2, - "distance": null, - "metadata": { - "symbol_id": "7e4a9381328c5803bbc6179458612fc4e947d928aa7bf8b4b2bebb2c8592f758", - "symbol_name": "RuntimeManager", - "qname": "RuntimeManager", - "role": "pipeline_stage", - "confidence": 0.67, - "dataflow_participation": 50, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "ControlChannel\nrole: model\n\nResponsibilities:\n- default model role", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlChannel", - "span_start": 21, - "span_end": 28, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 40, - "layer_rank": 2, - "distance": null, - "metadata": { - "symbol_id": "cfcfe9a311d3a2dbdaf32ac4ccd73c0eb9a117f830591a1c0867ee97d46204ff", - "symbol_name": "ControlChannel", - "qname": "ControlChannel", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "ControlActionSet\nrole: model\n\nResponsibilities:\n- default model role", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlActionSet", - "span_start": 14, - "span_end": 18, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 40, - "layer_rank": 2, - "distance": null, - "metadata": { - "symbol_id": "46eb026cb3313415ec47b82dd22f84f4d112c9d987e8b1716dcb0baa1cce8988", - "symbol_name": "ControlActionSet", - "qname": "ControlActionSet", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests service\n- reads and writes state attributes\n- participates in dataflow slices (5)", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlPlaneService", - "span_start": 12, - "span_end": 52, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 68, - "layer_rank": 2, - "distance": null, - "metadata": { - "symbol_id": "b13471e5916986dccffb53fab613812842965705e6b3a89ae549d30c9e91e9aa", - "symbol_name": "ControlPlaneService", - "qname": "ControlPlaneService", - "role": "pipeline_stage", - "confidence": 0.57, - "dataflow_participation": 5, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_runner.py", - "content": "UvicornThreadRunner\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (24)", - "layer": "C4_SEMANTIC_ROLES", - "title": "UvicornThreadRunner", - "span_start": 10, - "span_end": 61, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 11, - "layer_rank": 2, - "distance": null, - "metadata": { - "symbol_id": "fd55630045a02100df8877ac27d951ee08617d4598764394d48cb51fe067476a", - "symbol_name": "UvicornThreadRunner", - "qname": "UvicornThreadRunner", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 24, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "3779fdd2878b770e789a35bb2a89c9d79f13b61c26d7db1b3b683f9bb9e1623f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (10)", - "layer": "C4_SEMANTIC_ROLES", - "title": "HttpControlChannel", - "span_start": 12, - "span_end": 57, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 21, - "layer_rank": 2, - "distance": null, - "metadata": { - "symbol_id": "1c9fbdc24819e5604c26ea55428a74310f03a03e1af197ed84846af61e42fdb0", - "symbol_name": "HttpControlChannel", - "qname": "HttpControlChannel", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 10, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "HttpControlAppFactory\nrole: factory\n\nResponsibilities:\n- name suffix suggests factory", - "layer": "C4_SEMANTIC_ROLES", - "title": "HttpControlAppFactory", - "span_start": 15, - "span_end": 53, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 39, - "layer_rank": 2, - "distance": null, - "metadata": { - "symbol_id": "9b3502a5fb408b273223db13264349cf500de24915b6c649d9ea8970d0dfd8e0", - "symbol_name": "HttpControlAppFactory", - "qname": "HttpControlAppFactory", - "role": "factory", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/persistence/workflow_persistence.py", - "content": "WorkflowPersistence\nrole: pipeline_stage\n\nResponsibilities:\n- orchestrates role-like calls (2)\n- reads and writes state attributes\n- participates in dataflow slices (16)", - "layer": "C4_SEMANTIC_ROLES", - "title": "WorkflowPersistence", - "span_start": 8, - "span_end": 54, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 15, - "layer_rank": 2, - "distance": null, - "metadata": { - "symbol_id": "7bd01ee45cf31f2d5c2e3e51656254860ac785d10cef9e0852cd4fba90857bae", - "symbol_name": "WorkflowPersistence", - "qname": "WorkflowPersistence", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 16, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "80e9410ddc639789b4353c2a1a757ba8d0d5b5bb6075b0b263b61551f04ae1f0", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager.add_config_file", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 32, - "span_end": 52, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": null, - "metadata": { - "edge_id": "a23b8a11ebdb12708b60c96ea12a69f7f042082f1adfddd572444e246d81d167", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "57ffbd4f0d9fdf3507c2b8624312ce211f3d02fdf86a57a8ec90778d8a7b498d", - "dst_ref": "RuntimeManager.add_config_file", - "resolution": "resolved", - "slice_id": "a23b8a11ebdb12708b60c96ea12a69f7f042082f1adfddd572444e246d81d167", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager.add_config_file" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "57ffbd4f0d9fdf3507c2b8624312ce211f3d02fdf86a57a8ec90778d8a7b498d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.services\n -> RuntimeManager.__init__", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 33, - "span_end": 39, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": null, - "metadata": { - "edge_id": "d43af85989222ee6d788ce418cdcb217c7ff044cfb915e3bdbd184417dc7bd61", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "dst_ref": "RuntimeManager.__init__", - "resolution": "resolved", - "slice_id": "d43af85989222ee6d788ce418cdcb217c7ff044cfb915e3bdbd184417dc7bd61", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.services", - "RuntimeManager.__init__" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.stop", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 25, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": null, - "metadata": { - "edge_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d", - "dst_ref": "ControlPlaneService.stop", - "resolution": "resolved", - "slice_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.stop" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._stop_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 51, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": null, - "metadata": { - "edge_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a", - "dst_ref": "ControlPlaneService._stop_async", - "resolution": "resolved", - "slice_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._stop_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager.start", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 32, - "span_end": 59, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": null, - "metadata": { - "edge_id": "98312ace7fc62b1c7194c5aa1732b6ef736eae1668a3a120dd1ecd5ab1d64f7a", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "77a7b260193018845e4e204df094ab89cfd7c82ee4e822b3a83ad4cd945f9cb1", - "dst_ref": "RuntimeManager.start", - "resolution": "resolved", - "slice_id": "98312ace7fc62b1c7194c5aa1732b6ef736eae1668a3a120dd1ecd5ab1d64f7a", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager.start" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "77a7b260193018845e4e204df094ab89cfd7c82ee4e822b3a83ad4cd945f9cb1" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager._register_core_services", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 32, - "span_end": 127, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": null, - "metadata": { - "edge_id": "3e5811f3b511fa0cabe363f5d01f2ac5fa039bc8b93f7ee108323e1f5f45a293", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "972d6057a6caac9cf31ebc1e29c6f39f71b10d4cc170dec57cf875ba458549c6", - "dst_ref": "RuntimeManager._register_core_services", - "resolution": "resolved", - "slice_id": "3e5811f3b511fa0cabe363f5d01f2ac5fa039bc8b93f7ee108323e1f5f45a293", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager._register_core_services" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "972d6057a6caac9cf31ebc1e29c6f39f71b10d4cc170dec57cf875ba458549c6" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.register_channel", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 17, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": null, - "metadata": { - "edge_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957", - "dst_ref": "ControlPlaneService.register_channel", - "resolution": "resolved", - "slice_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.register_channel" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.start", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 20, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": null, - "metadata": { - "edge_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154", - "dst_ref": "ControlPlaneService.start", - "resolution": "resolved", - "slice_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.start" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._start_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 47, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": null, - "metadata": { - "edge_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517", - "dst_ref": "ControlPlaneService._start_async", - "resolution": "resolved", - "slice_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._start_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.services\n -> RuntimeManager._register_core_services", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 33, - "span_end": 127, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": null, - "metadata": { - "edge_id": "aac6f9dda73963b977083a892bee39a48eca4fbd7404787e022ecf4ebedec65d", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "972d6057a6caac9cf31ebc1e29c6f39f71b10d4cc170dec57cf875ba458549c6", - "dst_ref": "RuntimeManager._register_core_services", - "resolution": "resolved", - "slice_id": "aac6f9dda73963b977083a892bee39a48eca4fbd7404787e022ecf4ebedec65d", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.services", - "RuntimeManager._register_core_services" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "972d6057a6caac9cf31ebc1e29c6f39f71b10d4cc170dec57cf875ba458549c6" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": null, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": null, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": null, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "retrieval_report": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "vector", - "C0_SOURCE_CHUNKS": "vector", - "C4_SEMANTIC_ROLES": "vector", - "C2_DEPENDENCY_GRAPH": "vector", - "C3_ENTRYPOINTS": "vector" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 8, - "C4_SEMANTIC_ROLES": 8, - "C2_DEPENDENCY_GRAPH": 10, - "C3_ENTRYPOINTS": 10 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [] - }, - "C4_SEMANTIC_ROLES": { - "path_scope": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [] - } - }, - "fallback": { - "used": false, - "reason": null - }, - "retrieval_by_layer_ms": { - "C1_SYMBOL_CATALOG": 43, - "C0_SOURCE_CHUNKS": 20, - "C4_SEMANTIC_ROLES": 16, - "C2_DEPENDENCY_GRAPH": 61, - "C3_ENTRYPOINTS": 12 - } - } - }, - "diagnostics": { - "intent_correct": null, - "target_found": true, - "layers_used": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_sufficient": true, - "answer_mode": "normal", - "resolved_target": "RuntimeManager", - "answer_policy_branch": "normal_answer", - "decision_reason": "evidence_sufficient", - "router_result": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "retrieval_profile": "code", - "sub_intent": "TRACE_FLOW", - "path_scope": [], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "symbol_resolution_status": "resolved" - }, - "retrieval_request": { - "rag_session_id": "7d11da21-faa0-4cea-aede-aeabe069164c", - "query": "Покажи поток выполнения при запуске RuntimeManager", - "sub_intent": "TRACE_FLOW", - "path_scope": [], - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "per_layer_outcome": [ - { - "layer_id": "C1_SYMBOL_CATALOG", - "hit_count": 8, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C0_SOURCE_CHUNKS", - "hit_count": 8, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C4_SEMANTIC_ROLES", - "hit_count": 8, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C2_DEPENDENCY_GRAPH", - "hit_count": 10, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C3_ENTRYPOINTS", - "hit_count": 3, - "empty": false, - "fallback_used": false - } - ], - "empty_layers": [], - "evidence_gate_decision": { - "sufficient": true, - "failure_reasons": [], - "evidence_count": 37 - }, - "evidence_gate_input": { - "resolved_target": "RuntimeManager", - "sub_intent": "TRACE_FLOW", - "target_type": "symbol", - "evidence_count": 37, - "code_chunk_count": 37, - "entrypoint_count": 3, - "relation_count": 10, - "test_evidence_count": 0, - "symbol_resolution_status": "resolved", - "path_scope": [] - }, - "post_evidence_gate": { - "input": { - "answer_mode": "normal", - "degraded_message": "", - "resolved_target": "RuntimeManager", - "draft_answer_preview": "При запуске `RuntimeManager` выполняются следующие шаги:\n\n1. Инициализация конфигурации через поле `configuration`.\n2. Добавление конфигурационных файлов методом `add_config_file`.\n3. Инициализация сервисов методом `__init__` внутри конструктора.\n4. Регистрация основных служб методом `_register_core", - "repair_candidate": true - }, - "output": { - "passed": true, - "action": "return", - "reasons": [], - "repair_used": false, - "final_answer_preview": "При запуске `RuntimeManager` выполняются следующие шаги:\n\n1. Инициализация конфигурации через поле `configuration`.\n2. Добавление конфигурационных файлов методом `add_config_file`.\n3. Инициализация сервисов методом `__init__` внутри конструктора.\n4. Регистрация основных служб методом `_register_core" - } - }, - "failure_reasons": [], - "timings_ms": { - "router": 1, - "retrieval": 154, - "pre_evidence_gate": 1, - "llm": 3180, - "post_evidence_gate": 1 - } - }, - "rag_rows": [ - { - "path": "src/plba/bootstrap.py", - "content": "const RuntimeManager\nRuntimeManager = app_runtime.core.runtime.RuntimeManager", - "layer": "C1_SYMBOL_CATALOG", - "title": "RuntimeManager", - "span_start": 4, - "span_end": 4, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "27158ca220022eeb5083c6addf8a50775d45f7161284fd60aac48410105f4b98", - "qname": "RuntimeManager", - "kind": "const", - "signature": "RuntimeManager = app_runtime.core.runtime.RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "src.plba.bootstrap", - "is_test": false, - "blob_sha": "ce2dc59c27bacd29e0d219729b307c6851ab3aab1a115c2e0054a869affdcbbd", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "const RuntimeManager\nRuntimeManager = app_runtime.core.runtime.RuntimeManager", - "layer": "C1_SYMBOL_CATALOG", - "title": "RuntimeManager", - "span_start": 9, - "span_end": 9, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "62a9575c77aad894120d18b4f2a08cf2ba42f77e9be4a8a432b767d157701afe", - "qname": "RuntimeManager", - "kind": "const", - "signature": "RuntimeManager = app_runtime.core.runtime.RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.control.service", - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "class RuntimeManager\nRuntimeManager", - "layer": "C1_SYMBOL_CATALOG", - "title": "RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "7e4a9381328c5803bbc6179458612fc4e947d928aa7bf8b4b2bebb2c8592f758", - "qname": "RuntimeManager", - "kind": "class", - "signature": "RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.core.runtime", - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/__init__.py", - "content": "const RuntimeManager\nRuntimeManager = plba.core.RuntimeManager", - "layer": "C1_SYMBOL_CATALOG", - "title": "RuntimeManager", - "span_start": 16, - "span_end": 16, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "7eacec84f9b8d6c4201374591faecdac7493091c263681495c338973f2971ad9", - "qname": "RuntimeManager", - "kind": "const", - "signature": "RuntimeManager = plba.core.RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "src.plba.__init__", - "is_test": false, - "blob_sha": "24e755ec8c249d14fb0e675b5dbf2b71ab91afb9c849897eebfa9feb2499e19d", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/core.py", - "content": "const RuntimeManager\nRuntimeManager = app_runtime.core.runtime.RuntimeManager", - "layer": "C1_SYMBOL_CATALOG", - "title": "RuntimeManager", - "span_start": 2, - "span_end": 2, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "e1684562d978b7af7fe9b27dc5869d770348a87b5dc19a50360f58544668578b", - "qname": "RuntimeManager", - "kind": "const", - "signature": "RuntimeManager = app_runtime.core.runtime.RuntimeManager", - "parent_symbol_id": null, - "package_or_module": "src.plba.core", - "is_test": false, - "blob_sha": "c0ae25110d20e665216616e26b68adfe035b624ba45d31d1272fb21f906f9ca8", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/__init__.py", - "content": "const ControlPlaneService\nControlPlaneService = app_runtime.control.service.ControlPlaneService", - "layer": "C1_SYMBOL_CATALOG", - "title": "ControlPlaneService", - "span_start": 3, - "span_end": 3, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "217e8f044d1c01644bf7b81e5046af9e84469210c692a2fb0c476a19bb069ae1", - "qname": "ControlPlaneService", - "kind": "const", - "signature": "ControlPlaneService = app_runtime.control.service.ControlPlaneService", - "parent_symbol_id": null, - "package_or_module": "src.app_runtime.control.__init__", - "is_test": false, - "blob_sha": "bf3c37e3369a84cc618adc0fd71c232e5eb4b871eaff743069a17e661e498316", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "method ControlChannel.start\nstart(self, actions)\nStart the control channel and bind handlers.", - "layer": "C1_SYMBOL_CATALOG", - "title": "ControlChannel.start", - "span_start": 23, - "span_end": 24, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "e01e0d50d0f48d0c84c119c989b7a7c57ceea263811ce2605c684ae24d1a03b1", - "qname": "ControlChannel.start", - "kind": "method", - "signature": "start(self, actions)", - "parent_symbol_id": "ControlChannel", - "package_or_module": "src.app_runtime.control.base", - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "method ControlChannel.stop\nstop(self)\nStop the control channel and release resources.", - "layer": "C1_SYMBOL_CATALOG", - "title": "ControlChannel.stop", - "span_start": 27, - "span_end": 28, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 1, - "distance": NaN, - "metadata": { - "symbol_id": "54b5adf9866c526836221dc721b474ba23fbec83e1b1d3b8bc4da67ae3c1541d", - "qname": "ControlChannel.stop", - "kind": "method", - "signature": "stop(self)", - "parent_symbol_id": "ControlChannel", - "package_or_module": "src.app_runtime.control.base", - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "class ControlPlaneService:\n def __init__(self) -> None:\n self._channels: list[ControlChannel] = []\n\n def register_channel(self, channel: ControlChannel) -> None:\n self._channels.append(channel)\n\n def start(self, runtime: RuntimeManager) -> None:\n if not self._channels:\n return\n asyncio.run(self._start_async(runtime))\n\n def stop(self) -> None:\n if not self._channels:\n return\n asyncio.run(self._stop_async())\n\n def snapshot(self, runtime: RuntimeManager) -> dict[str, object]:\n health = runtime.current_health()\n return {\n \"runtime\": {\"state\": runtime._state.value},\n \"modules\": list(runtime.registry.modules),\n \"services\": runtime.services.snapshot(),\n \"workers\": runtime.workers.snapshot(),\n \"health\": runtime.health.snapshot(runtime.workers.healths()) | {\"status\": health[\"status\"]},\n \"config\": runtime.configuration.get(),\n }\n\n async def _start_async(self, runtime: RuntimeManager) -> None:\n actions = ControlActionSet(\n health=runtime.health_status,\n start=runtime.start_runtime,\n stop=runtime.stop_runtime,\n status=runtime.runtime_status,\n )\n for channel in self._channels:\n await channel.start(actions)\n\n async def _stop_async(self) -> None:\n for channel in reversed(self._channels):\n await channel.stop()", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/service.py:ControlPlaneService", - "span_start": 12, - "span_end": 52, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.service", - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_runner.py", - "content": "class UvicornThreadRunner:\n def __init__(self, host: str, port: int, timeout: int) -> None:\n self._host = host\n self._port = port\n self._timeout = timeout\n self._server: Server | None = None\n self._thread: Thread | None = None\n self._error: BaseException | None = None\n\n async def start(self, app: FastAPI) -> None:\n if self._thread is not None and self._thread.is_alive():\n return\n self._error = None\n config = Config(app=app, host=self._host, port=self._port, log_level=\"warning\")\n self._server = Server(config)\n self._thread = Thread(target=self._serve, name=\"plba-http-control\", daemon=True)\n self._thread.start()\n await self._wait_until_started()\n\n async def stop(self) -> None:\n if self._server is None or self._thread is None:\n return\n self._server.should_exit = True\n await asyncio.to_thread(self._thread.join, self._timeout)\n self._server = None\n self._thread = None\n\n @property\n def port(self) -> int:\n if self._server is None or not getattr(self._server, \"servers\", None):\n return self._port\n socket = self._server.servers[0].sockets[0]\n return int(socket.getsockname()[1])\n\n async def _wait_until_started(self) -> None:\n if self._server is None:\n raise RuntimeError(\"Server is not initialized\")\n deadline = asyncio.get_running_loop().time() + max(float(self._timeout), 1.0)\n while not self._server.started:\n if self._error is not None:\n raise RuntimeError(\"HTTP control server failed to start\") from self._error\n if asyncio.get_running_loop().time() >= deadline:\n raise TimeoutError(\"HTTP control server startup timed out\")\n await asyncio.sleep(0.05)\n\n def _serve(self) -> None:\n if self._server is None:\n return\n try:\n asyncio.run(self._server.serve())\n except BaseException as exc: # noqa: BLE001\n self._error = exc", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/http_runner.py:UvicornThreadRunner", - "span_start": 10, - "span_end": 61, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.http_runner", - "is_test": false, - "blob_sha": "3779fdd2878b770e789a35bb2a89c9d79f13b61c26d7db1b3b683f9bb9e1623f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "class ControlChannel(ABC):\n @abstractmethod\n async def start(self, actions: ControlActionSet) -> None:\n \"\"\"Start the control channel and bind handlers.\"\"\"\n\n @abstractmethod\n async def stop(self) -> None:\n \"\"\"Stop the control channel and release resources.\"\"\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/base.py:ControlChannel", - "span_start": 21, - "span_end": 28, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 1, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.base", - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/__init__.py", - "content": "from app_runtime.control.base import ControlActionSet, ControlChannel\nfrom app_runtime.control.http_channel import HttpControlChannel\nfrom app_runtime.control.service import ControlPlaneService\n\n__all__ = [\"ControlActionSet\", \"ControlChannel\", \"ControlPlaneService\", \"HttpControlChannel\"]", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/__init__.py:1-5", - "span_start": 1, - "span_end": 5, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.app_runtime.control.__init__", - "is_test": false, - "blob_sha": "bf3c37e3369a84cc618adc0fd71c232e5eb4b871eaff743069a17e661e498316", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "class HttpControlAppFactory:\n def create(\n self,\n health_provider: Callable[[], Awaitable[HealthPayload]],\n action_provider: Callable[[str, str], Awaitable[JSONResponse]],\n ) -> FastAPI:\n app = FastAPI(title=\"PLBA Control API\")\n\n @app.middleware(\"http\")\n async def log_api_call(request: Request, call_next): # type: ignore[no-untyped-def]\n started = time.monotonic()\n response = await call_next(request)\n response.headers[\"X-Response-Time-Ms\"] = str(int((time.monotonic() - started) * 1000))\n return response\n\n @app.get(\"/health\")\n async def health() -> JSONResponse:\n payload = await health_provider()\n status_code = 200 if payload.get(\"status\") == \"ok\" else 503\n return JSONResponse(content=payload, status_code=status_code)\n\n @app.get(\"/actions/{action}\")\n @app.post(\"/actions/{action}\")\n async def action(action: str, request: Request) -> JSONResponse:\n client_source = self._client_source(request)\n if action in {\"start\", \"stop\"}:\n LOGGER.warning(\"Control action requested: /actions/%s client=%s\", action, client_source)\n return await action_provider(action, client_source)\n\n return app\n\n def _client_source(self, request: Request) -> str:\n explicit_header = request.headers.get(\"X-Client-Source\", \"\").strip()\n if explicit_header:\n return explicit_header\n user_agent = request.headers.get(\"User-Agent\", \"\").strip()\n if user_agent:\n return f\"user-agent:{user_agent}\"\n return \"unknown\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/http_app.py:HttpControlAppFactory", - "span_start": 15, - "span_end": 53, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.http_app", - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "class HttpControlChannel(ControlChannel):\n def __init__(self, host: str, port: int, timeout: int) -> None:\n self._timeout = timeout\n self._runner = UvicornThreadRunner(host, port, timeout)\n self._factory = HttpControlAppFactory()\n self._actions: ControlActionSet | None = None\n\n async def start(self, actions: ControlActionSet) -> None:\n self._actions = actions\n app = self._factory.create(self._health_response, self._action_response)\n await self._runner.start(app)\n\n async def stop(self) -> None:\n await self._runner.stop()\n\n @property\n def port(self) -> int:\n return self._runner.port\n\n async def _health_response(self) -> dict[str, object]:\n if self._actions is None:\n return {\"status\": \"unhealthy\", \"detail\": \"control actions are not configured\"}\n return await asyncio.wait_for(self._actions.health(), timeout=float(self._timeout))\n\n async def _action_response(self, action: str, _client_source: str = \"unknown\") -> JSONResponse:\n if self._actions is None:\n return JSONResponse(content={\"status\": \"error\", \"detail\": f\"{action} handler is not configured\"}, status_code=404)\n callbacks = {\n \"start\": self._actions.start,\n \"stop\": self._actions.stop,\n \"status\": self._actions.status,\n }\n callback = callbacks.get(action)\n if callback is None:\n return JSONResponse(content={\"status\": \"error\", \"detail\": f\"unsupported action: {action}\"}, status_code=404)\n action_timeout = max(float(self._timeout), 10.0) if action in {\"start\", \"stop\"} else float(self._timeout)\n try:\n detail = await asyncio.wait_for(callback(), timeout=action_timeout)\n except asyncio.TimeoutError:\n return JSONResponse(\n content={\"status\": \"accepted\", \"detail\": f\"{action} operation is still in progress\"},\n status_code=202,\n )\n except Exception as exc:\n return JSONResponse(content={\"status\": \"error\", \"detail\": str(exc)}, status_code=500)\n return JSONResponse(content={\"status\": \"ok\", \"detail\": detail or f\"{action} action accepted\"}, status_code=200)", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/http_channel.py:HttpControlChannel", - "span_start": 12, - "span_end": 57, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.http_channel", - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "class ControlActionSet:\n health: HealthHandler\n start: ActionHandler\n stop: ActionHandler\n status: ActionHandler", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/base.py:ControlActionSet", - "span_start": 14, - "span_end": 18, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.base", - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/control.py", - "content": "from app_runtime.control.base import ControlActionSet, ControlChannel\nfrom app_runtime.control.http_channel import HttpControlChannel\nfrom app_runtime.control.service import ControlPlaneService\n\n__all__ = [\n \"ControlActionSet\",\n \"ControlChannel\",\n \"ControlPlaneService\",\n \"HttpControlChannel\",\n]", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/plba/control.py:1-10", - "span_start": 1, - "span_end": 10, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.plba.control", - "is_test": false, - "blob_sha": "31bd5c4481bfa7fbca8fae56d4860a67e3953ca74474ac8439e1f39b685d7bc8", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests manager\n- orchestrates role-like calls (4)\n- reads and writes state attributes\n- participates in dataflow slices (50)", - "layer": "C4_SEMANTIC_ROLES", - "title": "RuntimeManager", - "span_start": 18, - "span_end": 179, - "lexical_rank": 0, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 43, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "7e4a9381328c5803bbc6179458612fc4e947d928aa7bf8b4b2bebb2c8592f758", - "symbol_name": "RuntimeManager", - "qname": "RuntimeManager", - "role": "pipeline_stage", - "confidence": 0.67, - "dataflow_participation": 50, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "ControlChannel\nrole: model\n\nResponsibilities:\n- default model role", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlChannel", - "span_start": 21, - "span_end": 28, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 40, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "cfcfe9a311d3a2dbdaf32ac4ccd73c0eb9a117f830591a1c0867ee97d46204ff", - "symbol_name": "ControlChannel", - "qname": "ControlChannel", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/base.py", - "content": "ControlActionSet\nrole: model\n\nResponsibilities:\n- default model role", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlActionSet", - "span_start": 14, - "span_end": 18, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 40, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "46eb026cb3313415ec47b82dd22f84f4d112c9d987e8b1716dcb0baa1cce8988", - "symbol_name": "ControlActionSet", - "qname": "ControlActionSet", - "role": "model", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "84754bc651a3d90eed09f74a53d7df9a02fa15657e4773a6cc840bd3bed134b7", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService\nrole: pipeline_stage\n\nResponsibilities:\n- name suffix suggests service\n- reads and writes state attributes\n- participates in dataflow slices (5)", - "layer": "C4_SEMANTIC_ROLES", - "title": "ControlPlaneService", - "span_start": 12, - "span_end": 52, - "lexical_rank": 3, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 68, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "b13471e5916986dccffb53fab613812842965705e6b3a89ae549d30c9e91e9aa", - "symbol_name": "ControlPlaneService", - "qname": "ControlPlaneService", - "role": "pipeline_stage", - "confidence": 0.57, - "dataflow_participation": 5, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_runner.py", - "content": "UvicornThreadRunner\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (24)", - "layer": "C4_SEMANTIC_ROLES", - "title": "UvicornThreadRunner", - "span_start": 10, - "span_end": 61, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 11, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "fd55630045a02100df8877ac27d951ee08617d4598764394d48cb51fe067476a", - "symbol_name": "UvicornThreadRunner", - "qname": "UvicornThreadRunner", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 24, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "3779fdd2878b770e789a35bb2a89c9d79f13b61c26d7db1b3b683f9bb9e1623f", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_channel.py", - "content": "HttpControlChannel\nrole: pipeline_stage\n\nResponsibilities:\n- reads and writes state attributes\n- participates in dataflow slices (10)", - "layer": "C4_SEMANTIC_ROLES", - "title": "HttpControlChannel", - "span_start": 12, - "span_end": 57, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 21, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "1c9fbdc24819e5604c26ea55428a74310f03a03e1af197ed84846af61e42fdb0", - "symbol_name": "HttpControlChannel", - "qname": "HttpControlChannel", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 10, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "286e9615e209bc395ce9db0cd70f2236012e3e86b0257dc87e215e01f7f89ada", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "HttpControlAppFactory\nrole: factory\n\nResponsibilities:\n- name suffix suggests factory", - "layer": "C4_SEMANTIC_ROLES", - "title": "HttpControlAppFactory", - "span_start": 15, - "span_end": 53, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 39, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "9b3502a5fb408b273223db13264349cf500de24915b6c649d9ea8970d0dfd8e0", - "symbol_name": "HttpControlAppFactory", - "qname": "HttpControlAppFactory", - "role": "factory", - "confidence": 0.99, - "dataflow_participation": 0, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/workflow/persistence/workflow_persistence.py", - "content": "WorkflowPersistence\nrole: pipeline_stage\n\nResponsibilities:\n- orchestrates role-like calls (2)\n- reads and writes state attributes\n- participates in dataflow slices (16)", - "layer": "C4_SEMANTIC_ROLES", - "title": "WorkflowPersistence", - "span_start": 8, - "span_end": 54, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 15, - "layer_rank": 2, - "distance": NaN, - "metadata": { - "symbol_id": "7bd01ee45cf31f2d5c2e3e51656254860ac785d10cef9e0852cd4fba90857bae", - "symbol_name": "WorkflowPersistence", - "qname": "WorkflowPersistence", - "role": "pipeline_stage", - "confidence": 0.99, - "dataflow_participation": 16, - "execution_trace_proximity": 0, - "is_test": false, - "blob_sha": "80e9410ddc639789b4353c2a1a757ba8d0d5b5bb6075b0b263b61551f04ae1f0", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager.add_config_file", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 32, - "span_end": 52, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "a23b8a11ebdb12708b60c96ea12a69f7f042082f1adfddd572444e246d81d167", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "57ffbd4f0d9fdf3507c2b8624312ce211f3d02fdf86a57a8ec90778d8a7b498d", - "dst_ref": "RuntimeManager.add_config_file", - "resolution": "resolved", - "slice_id": "a23b8a11ebdb12708b60c96ea12a69f7f042082f1adfddd572444e246d81d167", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager.add_config_file" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "57ffbd4f0d9fdf3507c2b8624312ce211f3d02fdf86a57a8ec90778d8a7b498d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.services\n -> RuntimeManager.__init__", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 33, - "span_end": 39, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "d43af85989222ee6d788ce418cdcb217c7ff044cfb915e3bdbd184417dc7bd61", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "dst_ref": "RuntimeManager.__init__", - "resolution": "resolved", - "slice_id": "d43af85989222ee6d788ce418cdcb217c7ff044cfb915e3bdbd184417dc7bd61", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.services", - "RuntimeManager.__init__" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.stop", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 25, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d", - "dst_ref": "ControlPlaneService.stop", - "resolution": "resolved", - "slice_id": "d5433e2950fb6f913453de2694d697f2c5c5b0e759501aa31c37125d4d29c118", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.stop" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "bd50ae61353169acb2967a7085411ff58dfaa2e125e79ff1a42697add7380d0d" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._stop_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 51, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a", - "dst_ref": "ControlPlaneService._stop_async", - "resolution": "resolved", - "slice_id": "991ae894d11340626f4d9361e176c5009c2f33d95ce1a8864740bc85306accc3", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._stop_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "f3b9abaed413133f25c01074948db3fc551540fd2f8b7ba7bfdb1c59bd0a748a" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager.start", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 32, - "span_end": 59, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "98312ace7fc62b1c7194c5aa1732b6ef736eae1668a3a120dd1ecd5ab1d64f7a", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "77a7b260193018845e4e204df094ab89cfd7c82ee4e822b3a83ad4cd945f9cb1", - "dst_ref": "RuntimeManager.start", - "resolution": "resolved", - "slice_id": "98312ace7fc62b1c7194c5aa1732b6ef736eae1668a3a120dd1ecd5ab1d64f7a", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager.start" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "77a7b260193018845e4e204df094ab89cfd7c82ee4e822b3a83ad4cd945f9cb1" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.configuration\n -> RuntimeManager._register_core_services", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 32, - "span_end": 127, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "3e5811f3b511fa0cabe363f5d01f2ac5fa039bc8b93f7ee108323e1f5f45a293", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "972d6057a6caac9cf31ebc1e29c6f39f71b10d4cc170dec57cf875ba458549c6", - "dst_ref": "RuntimeManager._register_core_services", - "resolution": "resolved", - "slice_id": "3e5811f3b511fa0cabe363f5d01f2ac5fa039bc8b93f7ee108323e1f5f45a293", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.configuration", - "RuntimeManager._register_core_services" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "972d6057a6caac9cf31ebc1e29c6f39f71b10d4cc170dec57cf875ba458549c6" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.register_channel", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 17, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957", - "dst_ref": "ControlPlaneService.register_channel", - "resolution": "resolved", - "slice_id": "e21fe35e6cd37bb929561a316c9b5156bd379de768b11d96c989a75a4a9330f2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.register_channel" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b0313a9161dec8d8ad803adcde0cb082c57806e0a3edcd3dd40f8ed1a09b0957" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService.start", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 20, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154", - "dst_ref": "ControlPlaneService.start", - "resolution": "resolved", - "slice_id": "dc85f1ea8fe46c5223a32b4623a249512af7ea30f3af0d890c2fbe842c74d3c2", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService.start" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "8f9aa720eb89aaf78c914c2a96e1b07bc0699eb666b51e332fc5f467f6f44154" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/service.py", - "content": "ControlPlaneService.__init__\n -> ControlPlaneService._channels\n -> ControlPlaneService._start_async", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "ControlPlaneService.__init__:dataflow_slice", - "span_start": 14, - "span_end": 47, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "edge_type": "dataflow_slice", - "src_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "src_qname": "ControlPlaneService.__init__", - "dst_symbol_id": "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517", - "dst_ref": "ControlPlaneService._start_async", - "resolution": "resolved", - "slice_id": "e8e2ddef7499bed745cce7a83d5130d145e9787ca9ddc73f5898372a8da2be06", - "root_symbol_id": "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "path_symbols": [ - "ControlPlaneService.__init__", - "ControlPlaneService._channels", - "ControlPlaneService._start_async" - ], - "path_symbol_ids": [ - "d8008ee40e320f4551179bed7a3665a5e7d65850412051bcdf86007fa25f717a", - "b1a6eb93235bdad207d2bac24162aa65d662725b833b73e145b7f7fc3ecf9517" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "f53bb9e39148f37ecabad38b290219ae5bc562b9eb07fcd9965f5770fa3d6594", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/core/runtime.py", - "content": "RuntimeManager.__init__\n -> RuntimeManager.services\n -> RuntimeManager._register_core_services", - "layer": "C2_DEPENDENCY_GRAPH", - "title": "RuntimeManager.__init__:dataflow_slice", - "span_start": 33, - "span_end": 127, - "lexical_rank": 4, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 3, - "layer_rank": 3, - "distance": NaN, - "metadata": { - "edge_id": "aac6f9dda73963b977083a892bee39a48eca4fbd7404787e022ecf4ebedec65d", - "edge_type": "dataflow_slice", - "src_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "src_qname": "RuntimeManager.__init__", - "dst_symbol_id": "972d6057a6caac9cf31ebc1e29c6f39f71b10d4cc170dec57cf875ba458549c6", - "dst_ref": "RuntimeManager._register_core_services", - "resolution": "resolved", - "slice_id": "aac6f9dda73963b977083a892bee39a48eca4fbd7404787e022ecf4ebedec65d", - "root_symbol_id": "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "path_symbols": [ - "RuntimeManager.__init__", - "RuntimeManager.services", - "RuntimeManager._register_core_services" - ], - "path_symbol_ids": [ - "0bd33af01139de711a34193394772f481224acf06d96055f935e259d9bcc4a05", - "972d6057a6caac9cf31ebc1e29c6f39f71b10d4cc170dec57cf875ba458549c6" - ], - "path_edge_types": [ - "writes_attr", - "reads_attr" - ], - "path_length": 3, - "is_test": false, - "blob_sha": "e16bb7231eb419d6d069a62767cfe7ac7a2acfc4cd1e34e65907f3456623aa68", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "validation": { - "passed": true, - "action": "return", - "reasons": [] - }, - "steps": [ - { - "step": "router", - "status": "completed", - "timings_ms": { - "router": 1 - }, - "output": { - "intent": "CODE_QA", - "sub_intent": "TRACE_FLOW", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - } - }, - { - "step": "retrieval", - "status": "completed", - "timings_ms": { - "retrieval": 154 - }, - "output": { - "rag_count": 37, - "answer_path_rag_count": 37, - "resolved_symbol_status": "resolved", - "resolved_symbol": "RuntimeManager", - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "diagnostics": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "vector", - "C0_SOURCE_CHUNKS": "vector", - "C4_SEMANTIC_ROLES": "vector", - "C2_DEPENDENCY_GRAPH": "vector", - "C3_ENTRYPOINTS": "vector" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 8, - "C4_SEMANTIC_ROLES": 8, - "C2_DEPENDENCY_GRAPH": 10, - "C3_ENTRYPOINTS": 10 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [] - }, - "C4_SEMANTIC_ROLES": { - "path_scope": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [] - } - }, - "fallback": { - "used": false, - "reason": null - }, - "retrieval_by_layer_ms": { - "C1_SYMBOL_CATALOG": 43, - "C0_SOURCE_CHUNKS": 20, - "C4_SEMANTIC_ROLES": 16, - "C2_DEPENDENCY_GRAPH": 61, - "C3_ENTRYPOINTS": 12 - } - } - }, - { - "step": "pre_evidence_gate", - "status": "passed", - "timings_ms": { - "pre_evidence_gate": 1 - }, - "input": { - "resolved_target": "RuntimeManager", - "sub_intent": "TRACE_FLOW", - "target_type": "symbol", - "evidence_count": 37, - "code_chunk_count": 37, - "entrypoint_count": 3, - "relation_count": 10, - "test_evidence_count": 0, - "symbol_resolution_status": "resolved", - "path_scope": [] - }, - "output": { - "passed": true, - "failure_reasons": [], - "degraded_message": "", - "evidence_count": 37 - } - }, - { - "step": "llm", - "status": "completed", - "timings_ms": { - "llm": 3180 - }, - "output": { - "prompt_name": "code_qa_trace_flow_answer", - "answer_preview": "При запуске `RuntimeManager` выполняются следующие шаги:\n\n1. Инициализация конфигурации через поле `configuration`.\n2. Добавление конфигурационных файлов методом `add_config_file`.\n3. Инициализация сервисов методом `__init__` внутри конструктора.\n4. Регистрация основных служб методом `_register_core", - "resolved_target": "RuntimeManager", - "answer_policy_branch": "normal_answer", - "decision_reason": "evidence_sufficient" - } - }, - { - "step": "post_evidence_gate", - "status": "passed", - "timings_ms": { - "post_evidence_gate": 1, - "post_evidence_gate_recheck": 0, - "repair": 0 - }, - "input": { - "answer_mode": "normal", - "degraded_message": "", - "resolved_target": "RuntimeManager", - "draft_answer_preview": "При запуске `RuntimeManager` выполняются следующие шаги:\n\n1. Инициализация конфигурации через поле `configuration`.\n2. Добавление конфигурационных файлов методом `add_config_file`.\n3. Инициализация сервисов методом `__init__` внутри конструктора.\n4. Регистрация основных служб методом `_register_core", - "repair_candidate": true - }, - "output": { - "passed": true, - "action": "return", - "reasons": [], - "repair_used": false, - "final_answer_preview": "При запуске `RuntimeManager` выполняются следующие шаги:\n\n1. Инициализация конфигурации через поле `configuration`.\n2. Добавление конфигурационных файлов методом `add_config_file`.\n3. Инициализация сервисов методом `__init__` внутри конструктора.\n4. Регистрация основных служб методом `_register_core" - } - } - ] - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/plba_full_chain_subintents_v3/20260312_192715/full_chain_plba_code_subintents_v2_plba-v2-trace-flow-runtime-start.md b/tests/pipeline_setup_v3/test_results/plba_full_chain_subintents_v3/20260312_192715/full_chain_plba_code_subintents_v2_plba-v2-trace-flow-runtime-start.md deleted file mode 100644 index 3e43f45..0000000 --- a/tests/pipeline_setup_v3/test_results/plba_full_chain_subintents_v3/20260312_192715/full_chain_plba_code_subintents_v2_plba-v2-trace-flow-runtime-start.md +++ /dev/null @@ -1,305 +0,0 @@ -# plba-v2-trace-flow-runtime-start - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/cases/suite_02_pipeline/full_chain_plba_code_subintents_v2.yaml -- runner: agent_runtime -- mode: full_chain -- passed: True - -## Query -Покажи поток выполнения при запуске RuntimeManager - -## Actual -{ - "intent": "CODE_QA", - "sub_intent": "TRACE_FLOW", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 37, - "llm_answer": "При запуске `RuntimeManager` выполняются следующие шаги:\n\n1. Инициализация конфигурации через поле `configuration`.\n2. Добавление конфигурационных файлов методом `add_config_file`.\n3. Инициализация сервисов методом `__init__` внутри конструктора.\n4. Регистрация основных служб методом `_register_core_services`.\n5. Старт менеджера методом `start`.\n\nЭти шаги соответствуют обнаруженному коду в файле `src/app_runtime/core/runtime.py`. \n\nДальнейший поток выполнения внутри методов (`_register_core_services`, `start`) восстановить полностью не представляется возможным, поскольку вызываемый код отсутствует в текущем контексте.", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "RuntimeManager" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] -} - -## Steps -[ - { - "step": "router", - "status": "completed", - "timings_ms": { - "router": 1 - }, - "output": { - "intent": "CODE_QA", - "sub_intent": "TRACE_FLOW", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - } - }, - { - "step": "retrieval", - "status": "completed", - "timings_ms": { - "retrieval": 154 - }, - "output": { - "rag_count": 37, - "answer_path_rag_count": 37, - "resolved_symbol_status": "resolved", - "resolved_symbol": "RuntimeManager", - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "diagnostics": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "vector", - "C0_SOURCE_CHUNKS": "vector", - "C4_SEMANTIC_ROLES": "vector", - "C2_DEPENDENCY_GRAPH": "vector", - "C3_ENTRYPOINTS": "vector" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 8, - "C4_SEMANTIC_ROLES": 8, - "C2_DEPENDENCY_GRAPH": 10, - "C3_ENTRYPOINTS": 10 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [] - }, - "C4_SEMANTIC_ROLES": { - "path_scope": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [] - } - }, - "fallback": { - "used": false, - "reason": null - }, - "retrieval_by_layer_ms": { - "C1_SYMBOL_CATALOG": 43, - "C0_SOURCE_CHUNKS": 20, - "C4_SEMANTIC_ROLES": 16, - "C2_DEPENDENCY_GRAPH": 61, - "C3_ENTRYPOINTS": 12 - } - } - }, - { - "step": "pre_evidence_gate", - "status": "passed", - "timings_ms": { - "pre_evidence_gate": 1 - }, - "input": { - "resolved_target": "RuntimeManager", - "sub_intent": "TRACE_FLOW", - "target_type": "symbol", - "evidence_count": 37, - "code_chunk_count": 37, - "entrypoint_count": 3, - "relation_count": 10, - "test_evidence_count": 0, - "symbol_resolution_status": "resolved", - "path_scope": [] - }, - "output": { - "passed": true, - "failure_reasons": [], - "degraded_message": "", - "evidence_count": 37 - } - }, - { - "step": "llm", - "status": "completed", - "timings_ms": { - "llm": 3180 - }, - "output": { - "prompt_name": "code_qa_trace_flow_answer", - "answer_preview": "При запуске `RuntimeManager` выполняются следующие шаги:\n\n1. Инициализация конфигурации через поле `configuration`.\n2. Добавление конфигурационных файлов методом `add_config_file`.\n3. Инициализация сервисов методом `__init__` внутри конструктора.\n4. Регистрация основных служб методом `_register_core", - "resolved_target": "RuntimeManager", - "answer_policy_branch": "normal_answer", - "decision_reason": "evidence_sufficient" - } - }, - { - "step": "post_evidence_gate", - "status": "passed", - "timings_ms": { - "post_evidence_gate": 1, - "post_evidence_gate_recheck": 0, - "repair": 0 - }, - "input": { - "answer_mode": "normal", - "degraded_message": "", - "resolved_target": "RuntimeManager", - "draft_answer_preview": "При запуске `RuntimeManager` выполняются следующие шаги:\n\n1. Инициализация конфигурации через поле `configuration`.\n2. Добавление конфигурационных файлов методом `add_config_file`.\n3. Инициализация сервисов методом `__init__` внутри конструктора.\n4. Регистрация основных служб методом `_register_core", - "repair_candidate": true - }, - "output": { - "passed": true, - "action": "return", - "reasons": [], - "repair_used": false, - "final_answer_preview": "При запуске `RuntimeManager` выполняются следующие шаги:\n\n1. Инициализация конфигурации через поле `configuration`.\n2. Добавление конфигурационных файлов методом `add_config_file`.\n3. Инициализация сервисов методом `__init__` внутри конструктора.\n4. Регистрация основных служб методом `_register_core" - } - } -] - -## Diagnostics -{ - "intent_correct": null, - "target_found": true, - "layers_used": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_sufficient": true, - "answer_mode": "normal", - "resolved_target": "RuntimeManager", - "answer_policy_branch": "normal_answer", - "decision_reason": "evidence_sufficient", - "router_result": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "retrieval_profile": "code", - "sub_intent": "TRACE_FLOW", - "path_scope": [], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "symbol_resolution_status": "resolved" - }, - "retrieval_request": { - "rag_session_id": "7d11da21-faa0-4cea-aede-aeabe069164c", - "query": "Покажи поток выполнения при запуске RuntimeManager", - "sub_intent": "TRACE_FLOW", - "path_scope": [], - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "per_layer_outcome": [ - { - "layer_id": "C1_SYMBOL_CATALOG", - "hit_count": 8, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C0_SOURCE_CHUNKS", - "hit_count": 8, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C4_SEMANTIC_ROLES", - "hit_count": 8, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C2_DEPENDENCY_GRAPH", - "hit_count": 10, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C3_ENTRYPOINTS", - "hit_count": 3, - "empty": false, - "fallback_used": false - } - ], - "empty_layers": [], - "evidence_gate_decision": { - "sufficient": true, - "failure_reasons": [], - "evidence_count": 37 - }, - "evidence_gate_input": { - "resolved_target": "RuntimeManager", - "sub_intent": "TRACE_FLOW", - "target_type": "symbol", - "evidence_count": 37, - "code_chunk_count": 37, - "entrypoint_count": 3, - "relation_count": 10, - "test_evidence_count": 0, - "symbol_resolution_status": "resolved", - "path_scope": [] - }, - "post_evidence_gate": { - "input": { - "answer_mode": "normal", - "degraded_message": "", - "resolved_target": "RuntimeManager", - "draft_answer_preview": "При запуске `RuntimeManager` выполняются следующие шаги:\n\n1. Инициализация конфигурации через поле `configuration`.\n2. Добавление конфигурационных файлов методом `add_config_file`.\n3. Инициализация сервисов методом `__init__` внутри конструктора.\n4. Регистрация основных служб методом `_register_core", - "repair_candidate": true - }, - "output": { - "passed": true, - "action": "return", - "reasons": [], - "repair_used": false, - "final_answer_preview": "При запуске `RuntimeManager` выполняются следующие шаги:\n\n1. Инициализация конфигурации через поле `configuration`.\n2. Добавление конфигурационных файлов методом `add_config_file`.\n3. Инициализация сервисов методом `__init__` внутри конструктора.\n4. Регистрация основных служб методом `_register_core" - } - }, - "failure_reasons": [], - "timings_ms": { - "router": 1, - "retrieval": 154, - "pre_evidence_gate": 1, - "llm": 3180, - "post_evidence_gate": 1 - } -} - -## Mismatches -- none \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/plba_full_chain_subintents_v3/20260312_192715/summary.md b/tests/pipeline_setup_v3/test_results/plba_full_chain_subintents_v3/20260312_192715/summary.md deleted file mode 100644 index bba7737..0000000 --- a/tests/pipeline_setup_v3/test_results/plba_full_chain_subintents_v3/20260312_192715/summary.md +++ /dev/null @@ -1,80 +0,0 @@ -# pipeline_setup_v3 summary - -Passed: 18/18 - -| File | Case | Mode | Query | Actual sub-intent | RAG layers | Pass | -|------|------|------|-------|-------------------|------------|------| -| full_chain_plba_code_subintents_v2.yaml | plba-v2-open-file-runtime | full_chain | Открой файл src/app_runtime/core/runtime.py | OPEN_FILE | C0_SOURCE_CHUNKS:1 | ✓ | -| full_chain_plba_code_subintents_v2.yaml | plba-v2-open-file-public-api | full_chain | Открой файл src/plba/__init__.py | OPEN_FILE | C0_SOURCE_CHUNKS:1 | ✓ | -| full_chain_plba_code_subintents_v2.yaml | plba-v2-explain-runtime-manager | full_chain | Объясни как работает класс RuntimeManager | EXPLAIN | C0_SOURCE_CHUNKS:8, C1_SYMBOL_CATALOG:8, C2_DEPENDENCY_GRAPH:6, C3_ENTRYPOINTS:3, C4_SEMANTIC_ROLES:8 | ✓ | -| full_chain_plba_code_subintents_v2.yaml | plba-v2-explain-trace-service | full_chain | Объясни как работает класс TraceService | EXPLAIN | C0_SOURCE_CHUNKS:8, C1_SYMBOL_CATALOG:8, C2_DEPENDENCY_GRAPH:6, C3_ENTRYPOINTS:3, C4_SEMANTIC_ROLES:8 | ✓ | -| full_chain_plba_code_subintents_v2.yaml | plba-v2-explain-create-runtime | full_chain | Что делает функция create_runtime? | EXPLAIN | C0_SOURCE_CHUNKS:8, C1_SYMBOL_CATALOG:8, C2_DEPENDENCY_GRAPH:6, C3_ENTRYPOINTS:3, C4_SEMANTIC_ROLES:8 | ✓ | -| full_chain_plba_code_subintents_v2.yaml | plba-v2-explain-local-http-channel | full_chain | Почему в файле src/app_runtime/control/http_channel.py класс HttpControlChannel устроен так? | EXPLAIN_LOCAL | C0_SOURCE_CHUNKS:1, C1_SYMBOL_CATALOG:8, C2_DEPENDENCY_GRAPH:4 | ✓ | -| full_chain_plba_code_subintents_v2.yaml | plba-v2-find-tests-runtime-manager | full_chain | Где тесты для RuntimeManager? | FIND_TESTS | C0_SOURCE_CHUNKS:10, C1_SYMBOL_CATALOG:8, C2_DEPENDENCY_GRAPH:6 | ✓ | -| full_chain_plba_code_subintents_v2.yaml | plba-v2-find-tests-trace-service | full_chain | Где тесты для TraceService? | FIND_TESTS | C0_SOURCE_CHUNKS:10, C1_SYMBOL_CATALOG:8, C2_DEPENDENCY_GRAPH:6 | ✓ | -| full_chain_plba_code_subintents_v2.yaml | plba-v2-find-tests-create-runtime | full_chain | Где тесты для create_runtime? | FIND_TESTS | C0_SOURCE_CHUNKS:10, C1_SYMBOL_CATALOG:8, C2_DEPENDENCY_GRAPH:6 | ✓ | -| full_chain_plba_code_subintents_v2.yaml | plba-v2-find-tests-workflow-runtime-factory-negative | full_chain | Где тесты для WorkflowRuntimeFactory? | FIND_TESTS | C0_SOURCE_CHUNKS:10, C1_SYMBOL_CATALOG:8, C2_DEPENDENCY_GRAPH:6 | ✓ | -| full_chain_plba_code_subintents_v2.yaml | plba-v2-find-entrypoints-control-plane | full_chain | Найди точки входа HTTP control plane | FIND_ENTRYPOINTS | C0_SOURCE_CHUNKS:6, C3_ENTRYPOINTS:3 | ✓ | -| full_chain_plba_code_subintents_v2.yaml | plba-v2-find-entrypoints-health-endpoint | full_chain | Где health endpoint? | FIND_ENTRYPOINTS | C0_SOURCE_CHUNKS:7, C3_ENTRYPOINTS:3 | ✓ | -| full_chain_plba_code_subintents_v2.yaml | plba-v2-trace-flow-runtime-start | full_chain | Покажи поток выполнения при запуске RuntimeManager | TRACE_FLOW | C0_SOURCE_CHUNKS:8, C1_SYMBOL_CATALOG:8, C2_DEPENDENCY_GRAPH:10, C3_ENTRYPOINTS:3, C4_SEMANTIC_ROLES:8 | ✓ | -| full_chain_plba_code_subintents_v2.yaml | plba-v2-trace-flow-health-endpoint | full_chain | Покажи как проходит запрос /health в HttpControlAppFactory | TRACE_FLOW | C0_SOURCE_CHUNKS:8, C1_SYMBOL_CATALOG:8, C2_DEPENDENCY_GRAPH:10, C3_ENTRYPOINTS:3, C4_SEMANTIC_ROLES:8 | ✓ | -| full_chain_plba_code_subintents_v2.yaml | plba-v2-architecture-runtime-manager | full_chain | Какие компоненты участвуют в RuntimeManager? | ARCHITECTURE | C0_SOURCE_CHUNKS:4, C1_SYMBOL_CATALOG:6, C2_DEPENDENCY_GRAPH:8, C3_ENTRYPOINTS:3, C4_SEMANTIC_ROLES:12 | ✓ | -| full_chain_plba_code_subintents_v2.yaml | plba-v2-architecture-control-plane | full_chain | Какие компоненты участвуют в ControlPlaneService? | ARCHITECTURE | C0_SOURCE_CHUNKS:4, C1_SYMBOL_CATALOG:6, C2_DEPENDENCY_GRAPH:8, C3_ENTRYPOINTS:3, C4_SEMANTIC_ROLES:12 | ✓ | -| full_chain_plba_code_subintents_v2.yaml | plba-v2-explain-nonexistent-symbol | full_chain | Объясни класс RuntimeFactoryManager | EXPLAIN | — | ✓ | -| full_chain_plba_code_subintents_v2.yaml | plba-v2-open-file-nonexistent | full_chain | Открой файл src/app_runtime/core/missing_runtime.py | OPEN_FILE | — | ✓ | - -## LLM Answers -- **plba-v2-open-file-runtime** - Query: Открой файл src/app_runtime/core/runtime.py - > В файле \`src/app\_runtime/core/runtime.py\` определён класс \`RuntimeManager\`. У него есть несколько атрибутов класса: \- \`ACTION\_TIMEOUT\_SECONDS = 10.0\` \- \`ACTION\_POLL\_INTERVAL\_SECONDS = 0.05\` Конструктор принимает следующие параметры \(все опциональны\): \- \`configuration: ConfigurationManager \| None\` \- \`services: ServiceContainer \| None\` \- \`traces: TraceService \| None\` \- \`health: HealthRegistry \| None\` \- \`logs: LogManager \| None\` \- \`workers: WorkerSupervisor \| None\` \- \`control\_plane: ControlPlaneService \| None\` Если аргумент не передан, используется значение по умолчанию – новый экземпляр соответствующего менеджера или сервиса. -- **plba-v2-open-file-public-api** - Query: Открой файл src/plba/__init__.py - > Файл \`src/plba/\_\_init\_\_.py\` импортирует следующие основные компоненты: \- Из \`plba.bootstrap\`: \`create\_runtime\` \- Из \`plba.config\`: \`ConfigFileLoader\`, \`FileConfigProvider\` \- Из \`plba.control\`: \`ControlActionSet\`, \`ControlChannel\`, \`ControlPlaneService\`, \`HttpControlChannel\` \- Из \`plba.contracts\`: \`ApplicationModule\`, \`ConfigProvider\`, \`HealthContributor\`, \`TraceContext\`, \`TraceContextRecord\`, \`TraceLogMessage\`, \`TraceTransport\`, \`Worker\`, \`WorkerHealth\`, \`WorkerStatus\` \- Из \`plba.core\`: \`ConfigurationManager\`, \`RuntimeManager\`, \`ServiceContainer\` \- Из \`plba.health\`: \`HealthRegistry\` \- Из \`plba.logging\`: \`LogManager\` \- Из \`plba.queue\`: \`InMemoryTaskQueue\` \- Из \`plba.tracing\`: \`MySqlTraceTransport\`, \`NoOpTraceTransport\`, \`TraceService\` \- Из \`plba.workflow\`: \`StepResult\`, \`WorkflowContext\`, \`WorkflowDefinition\`, \`WorkflowEngine\` \(упомянут частично\) -- **plba-v2-explain-runtime-manager** - Query: Объясни как работает класс RuntimeManager - > Недостаточно подтверждённых данных для уверенного ответа по RuntimeManager. -- **plba-v2-explain-trace-service** - Query: Объясни как работает класс TraceService - > Недостаточно подтверждённых данных для уверенного ответа по TraceService. -- **plba-v2-explain-create-runtime** - Query: Что делает функция create_runtime? - > Функция \`create\_runtime\` определена в файле \`src/plba/bootstrap.py\`. Она создаёт и конфигурирует экземпляр \`RuntimeManager\`, регистрируя модуль приложения и опционально добавляя файл конфигурации и HTTP\-канал управления. Основные действия функции: \- Создаёт экземпляр \`RuntimeManager\`. \- Если передан путь к конфигурационному файлу, вызывает \`runtime.add\_config\_file\(config\_path\)\` для добавления конфигурации. \- Если включён HTTP\-контроль, регистрирует HTTP\-канал управления через \`runtime.control\_plane.register\_channel\(HttpControlChannel\(host=control\_host, port=control\_port, timeout=control\_timeout\)\)\`. \- Регистрирует модуль приложения методом \`runtime.register\_module\(module\)\`. Возвращает сконфигурированный объект типа \`RuntimeManager\`. -- **plba-v2-explain-local-http-channel** - Query: Почему в файле src/app_runtime/control/http_channel.py класс HttpControlChannel устроен так? - > Класс HttpControlChannel наследует ControlChannel и управляет HTTP\-каналом контроля. Инициализация задает хост, порт, таймаут, создаёт экземпляр UvicornThreadRunner для запуска сервера и HttpControlAppFactory для создания FastAPI\-приложения. Метод start запускает сервер с приложением, используя фабрики и передавая коллбэки здоровья и действий. Методы \_health\_response и \_action\_response \(не полностью показаны\) вероятно отвечают за обработчики API\-эндпоинтов здоровья и выполнения действий. Остальные детали, такие как полный контекст методов или их реализации, отсутствуют в данном фрагменте. -- **plba-v2-find-tests-runtime-manager** - Query: Где тесты для RuntimeManager? - > Прямые тесты для \`RuntimeManager\` находятся в файле \`tests/test\_runtime.py\`. Косвенные тесты: \- В файле \`tests/test\_business\_control\_actions.py\` есть тесты, использующие компоненты контроля, которые взаимодействуют с \`RuntimeManager\`. -- **plba-v2-find-tests-trace-service** - Query: Где тесты для TraceService? - > Прямые тесты для TraceService находятся в файле \`tests/test\_runtime.py\`: \- \`test\_trace\_service\_allows\_messages\_without\_status\`: проверяет возможность отправки сообщений без статуса. \- \`test\_trace\_service\_writes\_contexts\_and\_messages\`: проверяет запись контекстов и сообщений. \- \`test\_trace\_service\_supports\_debug\_warning\_and\_error\_levels\`: проверяет поддержку уровней debug, warning и error. -- **plba-v2-find-tests-create-runtime** - Query: Где тесты для create_runtime? - > Прямые тесты для \`create\_runtime\` не найдены. Ближайший косвенный тест: \- \`tests/test\_runtime.py::test\_public\_plba\_package\_exports\_runtime\_builder\_and\_worker\_contract\` \- Проверяет экспорт пакета plba и доступность создания runtime, включая worker контракты. -- **plba-v2-find-tests-workflow-runtime-factory-negative** - Query: Где тесты для WorkflowRuntimeFactory? - > Insufficient evidence for a confident answer. No test candidates found. -- **plba-v2-find-entrypoints-control-plane** - Query: Найди точки входа HTTP control plane - > Подтверждённые HTTP routes: 1. GET /health — обработчик \`health\`, объявлен в \`src/app\_runtime/control/http\_app.py\`:31\-34. 2. GET /actions/\{action\} — обработчик \`action\`, объявлен в \`src/app\_runtime/control/http\_app.py\`:38\-42. 3. POST /actions/\{action\} — обработчик \`action\`, объявлен в \`src/app\_runtime/control/http\_app.py\`:38\-42. Кандидаты на входные точки отсутствуют. -- **plba-v2-find-entrypoints-health-endpoint** - Query: Где health endpoint? - > Подтверждённая точка входа для health endpoint: GET /health, declared in src/app\_runtime/control/http\_app.py, lines 31\-34, handler function named 'health'. -- **plba-v2-trace-flow-runtime-start** - Query: Покажи поток выполнения при запуске RuntimeManager - > При запуске \`RuntimeManager\` выполняются следующие шаги: 1. Инициализация конфигурации через поле \`configuration\`. 2. Добавление конфигурационных файлов методом \`add\_config\_file\`. 3. Инициализация сервисов методом \`\_\_init\_\_\` внутри конструктора. 4. Регистрация основных служб методом \`\_register\_core\_services\`. 5. Старт менеджера методом \`start\`. Эти шаги соответствуют обнаруженному коду в файле \`src/app\_runtime/core/runtime.py\`. Дальнейший поток выполнения внутри методов \(\`\_register\_core\_services\`, \`start\`\) восстановить полностью не представляется возможным, поскольку вызываемый код отсутствует в текущем контексте. -- **plba-v2-trace-flow-health-endpoint** - Query: Покажи как проходит запрос /health в HttpControlAppFactory - > Запрос \`/health\` обрабатывается следующим образом: 1. В \`HttpControlAppFactory\` создаётся маршрут \`@app.get\("/health"\)\`, который вызывает функцию \`health\`. \- Путь: \`src/app\_runtime/control/http\_app.py\` \- Строки: 31–34 2. Функция \`health\` асинхронно ожидает данные от провайдера здоровья \(\`health\_provider\`\), переданного в фабрику приложений. \- Путь: \`src/app\_runtime/control/http\_app.py\` \- Строки: 31–34 3. Провайдер здоровья реализуется методом \`\_health\_response\` в классе \`HttpControlChannel\`. Он проверяет наличие действий \(\`\_actions\`\) и возвращает статус здоровья. \- Путь: \`src/app\_runtime/control/http\_channel.py\` \- Строки: 44–50 Таким образом, запрос \`/health\` проходит через эти компоненты для получения ответа о состоянии системы. -- **plba-v2-architecture-runtime-manager** - Query: Какие компоненты участвуют в RuntimeManager? - > Недостаточно подтверждённых данных для уверенного ответа по RuntimeManager. -- **plba-v2-architecture-control-plane** - Query: Какие компоненты участвуют в ControlPlaneService? - > \*\*ControlPlaneService\*\* является главным компонентом, управляющим жизненным циклом контролируемых каналов. Компоненты: \- \*\*ControlPlaneService\*\* \- \*\*ControlPlaneService.\_\_init\_\_\*\*: инициализирует сервис, регистрирует каналы и запускает асинхронные операции. \- \*\*ControlPlaneService.start\*\*: начинает работу сервиса, вызывая asyncio.run и читая атрибут \_channels. \- \*\*ControlPlaneService.register\_channel\*\*: регистрирует канал, читая атрибут \_channels. \- \*\*ControlPlaneService.stop\*\*, \*\*ControlPlaneService.\_stop\_async\*\*: останавливают сервисы. \- \*\*ControlPlaneService.\_start\_async\*\*: отвечает за асинхронный старт. \- \*\*ControlChannel\*\*: абстрактный базовый класс всех каналов контроля с методами start и stop. Связи между компонентами: \- Инициализация \(ControlPlaneService.\_\_init\_\_\) выполняет dataflow\_slice для методов регистрации и старта. \- Метод старта \(ControlPlaneService.s… -- **plba-v2-explain-nonexistent-symbol** - Query: Объясни класс RuntimeFactoryManager - > Сущность RuntimeFactoryManager не найдена в доступном коде. -- **plba-v2-open-file-nonexistent** - Query: Открой файл src/app_runtime/core/missing_runtime.py - > Файл src/app\_runtime/core/missing\_runtime.py не найден. \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/plba_last_case_v3/20260312_165845/full_chain_plba_last_case_plba-v2-open-file-nonexistent.json b/tests/pipeline_setup_v3/test_results/plba_last_case_v3/20260312_165845/full_chain_plba_last_case_plba-v2-open-file-nonexistent.json deleted file mode 100644 index 8e5606b..0000000 --- a/tests/pipeline_setup_v3/test_results/plba_last_case_v3/20260312_165845/full_chain_plba_last_case_plba-v2-open-file-nonexistent.json +++ /dev/null @@ -1,491 +0,0 @@ -{ - "case_id": "plba-v2-open-file-nonexistent", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/tmp/full_chain_plba_last_case.yaml", - "runner": "agent_runtime", - "mode": "full_chain", - "query": "Открой файл src/app_runtime/core/missing_runtime.py", - "actual": { - "intent": "CODE_QA", - "sub_intent": "OPEN_FILE", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 0, - "llm_answer": "Файл src/app_runtime/core/missing_runtime.py не найден.", - "answer_mode": "not_found", - "path_scope": [ - "src/app_runtime/core/missing_runtime.py" - ], - "symbol_candidates": [], - "layers": [ - "C0_SOURCE_CHUNKS" - ] - }, - "passed": true, - "mismatches": [], - "details": { - "query": "Открой файл src/app_runtime/core/missing_runtime.py", - "router_result": { - "schema_version": "1.1", - "intent": "CODE_QA", - "retrieval_profile": "code", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query_plan": { - "raw": "Открой файл src/app_runtime/core/missing_runtime.py", - "normalized": "Открой файл src/app_runtime/core/missing_runtime.py", - "sub_intent": "OPEN_FILE", - "negations": [], - "expansions": [ - "file" - ], - "keyword_hints": [], - "path_hints": [ - "src/app_runtime/core/missing_runtime.py" - ], - "doc_scope_hints": [], - "symbol_candidates": [], - "symbol_kind_hint": "unknown", - "anchors": [ - { - "type": "FILE_PATH", - "value": "src/app_runtime/core/missing_runtime.py", - "source": "user_text", - "subtype": null, - "span": { - "start": 12, - "end": 51 - }, - "confidence": 0.95 - }, - { - "type": "KEY_TERM", - "value": "файл", - "source": "user_text", - "subtype": null, - "span": { - "start": 7, - "end": 11 - }, - "confidence": 0.9 - } - ] - }, - "retrieval_spec": { - "domains": [ - "CODE" - ], - "layer_queries": [ - { - "layer_id": "C0_SOURCE_CHUNKS", - "top_k": 12 - } - ], - "filters": { - "test_policy": "EXCLUDE", - "path_scope": [ - "src/app_runtime/core/missing_runtime.py" - ], - "language": [ - "python" - ] - }, - "rerank_profile": "code" - }, - "retrieval_constraints": { - "include_globs": [ - "src/app_runtime/core/missing_runtime.py" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": false, - "max_distance": 2, - "top_k": 5 - } - }, - "symbol_resolution": { - "status": "not_requested", - "resolved_symbol": null, - "alternatives": [], - "confidence": 0.0 - }, - "evidence_policy": { - "require_def": false, - "require_flow": false, - "require_spec": false, - "allow_answer_without_evidence": false - } - }, - "retrieval_request": { - "rag_session_id": "7d11da21-faa0-4cea-aede-aeabe069164c", - "query": "Открой файл src/app_runtime/core/missing_runtime.py", - "sub_intent": "OPEN_FILE", - "path_scope": [ - "src/app_runtime/core/missing_runtime.py" - ], - "keyword_hints": [], - "symbol_candidates": [], - "requested_layers": [ - "C0_SOURCE_CHUNKS" - ], - "retrieval_spec": { - "domains": [ - "CODE" - ], - "layer_queries": [ - { - "layer_id": "C0_SOURCE_CHUNKS", - "top_k": 12 - } - ], - "filters": { - "test_policy": "EXCLUDE", - "path_scope": [ - "src/app_runtime/core/missing_runtime.py" - ], - "language": [ - "python" - ] - }, - "rerank_profile": "code" - }, - "retrieval_constraints": { - "include_globs": [ - "src/app_runtime/core/missing_runtime.py" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": false, - "max_distance": 2, - "top_k": 5 - } - }, - "query_plan": { - "raw": "Открой файл src/app_runtime/core/missing_runtime.py", - "normalized": "Открой файл src/app_runtime/core/missing_runtime.py", - "sub_intent": "OPEN_FILE", - "negations": [], - "expansions": [ - "file" - ], - "keyword_hints": [], - "path_hints": [ - "src/app_runtime/core/missing_runtime.py" - ], - "doc_scope_hints": [], - "symbol_candidates": [], - "symbol_kind_hint": "unknown", - "anchors": [ - { - "type": "FILE_PATH", - "value": "src/app_runtime/core/missing_runtime.py", - "source": "user_text", - "subtype": null, - "span": { - "start": 12, - "end": 51 - }, - "confidence": 0.95 - }, - { - "type": "KEY_TERM", - "value": "файл", - "source": "user_text", - "subtype": null, - "span": { - "start": 7, - "end": 11 - }, - "confidence": 0.9 - } - ] - } - }, - "retrieval_result": { - "target_symbol_candidates": [], - "resolved_symbol": null, - "symbol_resolution_status": "not_requested", - "file_candidates": [], - "code_chunks": [], - "relations": [], - "entrypoints": [], - "test_candidates": [], - "layer_outcomes": [ - { - "layer_id": "C0_SOURCE_CHUNKS", - "hit_count": 0, - "empty": true, - "fallback_used": false - } - ], - "missing_layers": [ - "C0_SOURCE_CHUNKS" - ], - "raw_rows": [], - "retrieval_report": { - "executed_layers": [ - "C0_SOURCE_CHUNKS" - ], - "retrieval_mode_by_layer": { - "C0_SOURCE_CHUNKS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C0_SOURCE_CHUNKS": 200 - }, - "filters_by_layer": { - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src/app_runtime/core/missing_runtime.py" - ] - } - }, - "requests": [ - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Открой файл src/app_runtime/core/missing_runtime.py", - "ranking_profile": "code" - } - ], - "fallback": { - "used": false, - "reason": null - }, - "retrieval_by_layer_ms": { - "C0_SOURCE_CHUNKS": 147 - } - } - }, - "diagnostics": { - "intent_correct": null, - "target_found": false, - "layers_used": [ - "C0_SOURCE_CHUNKS" - ], - "retrieval_sufficient": false, - "answer_mode": "insufficient", - "resolved_target": "src/app_runtime/core/missing_runtime.py", - "answer_policy_branch": "open_file_not_found", - "decision_reason": "path_scope_empty", - "router_result": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "retrieval_profile": "code", - "sub_intent": "OPEN_FILE", - "path_scope": [ - "src/app_runtime/core/missing_runtime.py" - ], - "layers": [ - "C0_SOURCE_CHUNKS" - ], - "symbol_resolution_status": "not_requested" - }, - "retrieval_request": { - "rag_session_id": "7d11da21-faa0-4cea-aede-aeabe069164c", - "query": "Открой файл src/app_runtime/core/missing_runtime.py", - "sub_intent": "OPEN_FILE", - "path_scope": [ - "src/app_runtime/core/missing_runtime.py" - ], - "requested_layers": [ - "C0_SOURCE_CHUNKS" - ] - }, - "per_layer_outcome": [ - { - "layer_id": "C0_SOURCE_CHUNKS", - "hit_count": 0, - "empty": true, - "fallback_used": false - } - ], - "empty_layers": [ - "C0_SOURCE_CHUNKS" - ], - "evidence_gate_decision": { - "sufficient": false, - "failure_reasons": [ - "path_scope_empty", - "layer_c0_empty" - ], - "evidence_count": 0 - }, - "evidence_gate_input": { - "resolved_target": "src/app_runtime/core/missing_runtime.py", - "sub_intent": "OPEN_FILE", - "target_type": "none", - "evidence_count": 0, - "code_chunk_count": 0, - "entrypoint_count": 0, - "relation_count": 0, - "test_evidence_count": 0, - "symbol_resolution_status": "not_requested", - "path_scope": [ - "src/app_runtime/core/missing_runtime.py" - ] - }, - "post_evidence_gate": { - "input": { - "answer_mode": "not_found", - "draft_present": false, - "resolved_target": "src/app_runtime/core/missing_runtime.py" - }, - "output": { - "reason": "no_draft_answer" - } - }, - "failure_reasons": [ - "path_scope_empty", - "layer_c0_empty" - ], - "timings_ms": { - "router": 1, - "retrieval": 148, - "pre_evidence_gate": 1, - "post_evidence_gate": 1 - } - }, - "rag_rows": [], - "validation": { - "passed": true, - "action": "return", - "reasons": [] - }, - "steps": [ - { - "step": "router", - "status": "completed", - "timings_ms": { - "router": 1 - }, - "output": { - "intent": "CODE_QA", - "sub_intent": "OPEN_FILE", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - } - }, - { - "step": "retrieval", - "status": "completed", - "timings_ms": { - "retrieval": 148 - }, - "output": { - "rag_count": 0, - "answer_path_rag_count": 0, - "resolved_symbol_status": "not_requested", - "resolved_symbol": null, - "requested_layers": [ - "C0_SOURCE_CHUNKS" - ] - }, - "diagnostics": { - "executed_layers": [ - "C0_SOURCE_CHUNKS" - ], - "retrieval_mode_by_layer": { - "C0_SOURCE_CHUNKS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C0_SOURCE_CHUNKS": 200 - }, - "filters_by_layer": { - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src/app_runtime/core/missing_runtime.py" - ] - } - }, - "requests": [ - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Открой файл src/app_runtime/core/missing_runtime.py", - "ranking_profile": "code" - } - ], - "fallback": { - "used": false, - "reason": null - }, - "retrieval_by_layer_ms": { - "C0_SOURCE_CHUNKS": 147 - } - } - }, - { - "step": "pre_evidence_gate", - "status": "blocked", - "timings_ms": { - "pre_evidence_gate": 1 - }, - "input": { - "resolved_target": "src/app_runtime/core/missing_runtime.py", - "sub_intent": "OPEN_FILE", - "target_type": "none", - "evidence_count": 0, - "code_chunk_count": 0, - "entrypoint_count": 0, - "relation_count": 0, - "test_evidence_count": 0, - "symbol_resolution_status": "not_requested", - "path_scope": [ - "src/app_runtime/core/missing_runtime.py" - ] - }, - "output": { - "passed": false, - "failure_reasons": [ - "path_scope_empty", - "layer_c0_empty" - ], - "degraded_message": "Insufficient evidence for a confident answer. No matching path or file found. No code chunks retrieved.", - "evidence_count": 0 - } - }, - { - "step": "llm", - "status": "skipped", - "timings_ms": { - "llm": 1 - }, - "output": { - "reason": "policy_short_circuit", - "answer_mode": "not_found", - "decision_reason": "path_scope_empty", - "answer_policy_branch": "open_file_not_found" - } - }, - { - "step": "post_evidence_gate", - "status": "skipped", - "timings_ms": { - "post_evidence_gate": 1 - }, - "input": { - "answer_mode": "not_found", - "draft_present": false, - "resolved_target": "src/app_runtime/core/missing_runtime.py" - }, - "output": { - "reason": "no_draft_answer" - } - } - ] - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/plba_last_case_v3/20260312_165845/full_chain_plba_last_case_plba-v2-open-file-nonexistent.md b/tests/pipeline_setup_v3/test_results/plba_last_case_v3/20260312_165845/full_chain_plba_last_case_plba-v2-open-file-nonexistent.md deleted file mode 100644 index 8ba35f3..0000000 --- a/tests/pipeline_setup_v3/test_results/plba_last_case_v3/20260312_165845/full_chain_plba_last_case_plba-v2-open-file-nonexistent.md +++ /dev/null @@ -1,245 +0,0 @@ -# plba-v2-open-file-nonexistent - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/tmp/full_chain_plba_last_case.yaml -- runner: agent_runtime -- mode: full_chain -- passed: True - -## Query -Открой файл src/app_runtime/core/missing_runtime.py - -## Actual -{ - "intent": "CODE_QA", - "sub_intent": "OPEN_FILE", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 0, - "llm_answer": "Файл src/app_runtime/core/missing_runtime.py не найден.", - "answer_mode": "not_found", - "path_scope": [ - "src/app_runtime/core/missing_runtime.py" - ], - "symbol_candidates": [], - "layers": [ - "C0_SOURCE_CHUNKS" - ] -} - -## Steps -[ - { - "step": "router", - "status": "completed", - "timings_ms": { - "router": 1 - }, - "output": { - "intent": "CODE_QA", - "sub_intent": "OPEN_FILE", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - } - }, - { - "step": "retrieval", - "status": "completed", - "timings_ms": { - "retrieval": 148 - }, - "output": { - "rag_count": 0, - "answer_path_rag_count": 0, - "resolved_symbol_status": "not_requested", - "resolved_symbol": null, - "requested_layers": [ - "C0_SOURCE_CHUNKS" - ] - }, - "diagnostics": { - "executed_layers": [ - "C0_SOURCE_CHUNKS" - ], - "retrieval_mode_by_layer": { - "C0_SOURCE_CHUNKS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C0_SOURCE_CHUNKS": 200 - }, - "filters_by_layer": { - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src/app_runtime/core/missing_runtime.py" - ] - } - }, - "requests": [ - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Открой файл src/app_runtime/core/missing_runtime.py", - "ranking_profile": "code" - } - ], - "fallback": { - "used": false, - "reason": null - }, - "retrieval_by_layer_ms": { - "C0_SOURCE_CHUNKS": 147 - } - } - }, - { - "step": "pre_evidence_gate", - "status": "blocked", - "timings_ms": { - "pre_evidence_gate": 1 - }, - "input": { - "resolved_target": "src/app_runtime/core/missing_runtime.py", - "sub_intent": "OPEN_FILE", - "target_type": "none", - "evidence_count": 0, - "code_chunk_count": 0, - "entrypoint_count": 0, - "relation_count": 0, - "test_evidence_count": 0, - "symbol_resolution_status": "not_requested", - "path_scope": [ - "src/app_runtime/core/missing_runtime.py" - ] - }, - "output": { - "passed": false, - "failure_reasons": [ - "path_scope_empty", - "layer_c0_empty" - ], - "degraded_message": "Insufficient evidence for a confident answer. No matching path or file found. No code chunks retrieved.", - "evidence_count": 0 - } - }, - { - "step": "llm", - "status": "skipped", - "timings_ms": { - "llm": 1 - }, - "output": { - "reason": "policy_short_circuit", - "answer_mode": "not_found", - "decision_reason": "path_scope_empty", - "answer_policy_branch": "open_file_not_found" - } - }, - { - "step": "post_evidence_gate", - "status": "skipped", - "timings_ms": { - "post_evidence_gate": 1 - }, - "input": { - "answer_mode": "not_found", - "draft_present": false, - "resolved_target": "src/app_runtime/core/missing_runtime.py" - }, - "output": { - "reason": "no_draft_answer" - } - } -] - -## Diagnostics -{ - "intent_correct": null, - "target_found": false, - "layers_used": [ - "C0_SOURCE_CHUNKS" - ], - "retrieval_sufficient": false, - "answer_mode": "insufficient", - "resolved_target": "src/app_runtime/core/missing_runtime.py", - "answer_policy_branch": "open_file_not_found", - "decision_reason": "path_scope_empty", - "router_result": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "retrieval_profile": "code", - "sub_intent": "OPEN_FILE", - "path_scope": [ - "src/app_runtime/core/missing_runtime.py" - ], - "layers": [ - "C0_SOURCE_CHUNKS" - ], - "symbol_resolution_status": "not_requested" - }, - "retrieval_request": { - "rag_session_id": "7d11da21-faa0-4cea-aede-aeabe069164c", - "query": "Открой файл src/app_runtime/core/missing_runtime.py", - "sub_intent": "OPEN_FILE", - "path_scope": [ - "src/app_runtime/core/missing_runtime.py" - ], - "requested_layers": [ - "C0_SOURCE_CHUNKS" - ] - }, - "per_layer_outcome": [ - { - "layer_id": "C0_SOURCE_CHUNKS", - "hit_count": 0, - "empty": true, - "fallback_used": false - } - ], - "empty_layers": [ - "C0_SOURCE_CHUNKS" - ], - "evidence_gate_decision": { - "sufficient": false, - "failure_reasons": [ - "path_scope_empty", - "layer_c0_empty" - ], - "evidence_count": 0 - }, - "evidence_gate_input": { - "resolved_target": "src/app_runtime/core/missing_runtime.py", - "sub_intent": "OPEN_FILE", - "target_type": "none", - "evidence_count": 0, - "code_chunk_count": 0, - "entrypoint_count": 0, - "relation_count": 0, - "test_evidence_count": 0, - "symbol_resolution_status": "not_requested", - "path_scope": [ - "src/app_runtime/core/missing_runtime.py" - ] - }, - "post_evidence_gate": { - "input": { - "answer_mode": "not_found", - "draft_present": false, - "resolved_target": "src/app_runtime/core/missing_runtime.py" - }, - "output": { - "reason": "no_draft_answer" - } - }, - "failure_reasons": [ - "path_scope_empty", - "layer_c0_empty" - ], - "timings_ms": { - "router": 1, - "retrieval": 148, - "pre_evidence_gate": 1, - "post_evidence_gate": 1 - } -} - -## Mismatches -- none \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/plba_last_case_v3/20260312_165845/summary.md b/tests/pipeline_setup_v3/test_results/plba_last_case_v3/20260312_165845/summary.md deleted file mode 100644 index 255e59d..0000000 --- a/tests/pipeline_setup_v3/test_results/plba_last_case_v3/20260312_165845/summary.md +++ /dev/null @@ -1,12 +0,0 @@ -# pipeline_setup_v3 summary - -Passed: 1/1 - -| File | Case | Mode | Query | Actual sub-intent | RAG layers | Pass | -|------|------|------|-------|-------------------|------------|------| -| full_chain_plba_last_case.yaml | plba-v2-open-file-nonexistent | full_chain | Открой файл src/app_runtime/core/missing_runtime.py | OPEN_FILE | — | ✓ | - -## LLM Answers -- **plba-v2-open-file-nonexistent** - Query: Открой файл src/app_runtime/core/missing_runtime.py - > Файл src/app\_runtime/core/missing\_runtime.py не найден. \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/plba_quality_focus_v3/20260312_173122/full_chain_plba_quality_focus_plba-v2-explain-nonexistent-symbol.json b/tests/pipeline_setup_v3/test_results/plba_quality_focus_v3/20260312_173122/full_chain_plba_quality_focus_plba-v2-explain-nonexistent-symbol.json deleted file mode 100644 index fd8447b..0000000 --- a/tests/pipeline_setup_v3/test_results/plba_quality_focus_v3/20260312_173122/full_chain_plba_quality_focus_plba-v2-explain-nonexistent-symbol.json +++ /dev/null @@ -1,632 +0,0 @@ -{ - "case_id": "plba-v2-explain-nonexistent-symbol", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/tmp/full_chain_plba_quality_focus.yaml", - "runner": "agent_runtime", - "mode": "full_chain", - "query": "Объясни класс RuntimeFactoryManager", - "actual": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 0, - "llm_answer": "Сущность RuntimeFactoryManager не найдена в доступном коде.", - "answer_mode": "not_found", - "path_scope": [], - "symbol_candidates": [ - "RuntimeFactoryManager" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "passed": true, - "mismatches": [], - "details": { - "query": "Объясни класс RuntimeFactoryManager", - "router_result": { - "schema_version": "1.1", - "intent": "CODE_QA", - "retrieval_profile": "code", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query_plan": { - "raw": "Объясни класс RuntimeFactoryManager", - "normalized": "Объясни класс RuntimeFactoryManager", - "sub_intent": "EXPLAIN", - "negations": [], - "expansions": [ - "RuntimeFactoryManager" - ], - "keyword_hints": [ - "RuntimeFactoryManager" - ], - "path_hints": [], - "doc_scope_hints": [], - "symbol_candidates": [ - "RuntimeFactoryManager" - ], - "symbol_kind_hint": "class", - "anchors": [ - { - "type": "SYMBOL", - "value": "RuntimeFactoryManager", - "source": "user_text", - "subtype": null, - "span": { - "start": 14, - "end": 35 - }, - "confidence": 0.88 - }, - { - "type": "KEY_TERM", - "value": "класс", - "source": "user_text", - "subtype": null, - "span": { - "start": 8, - "end": 13 - }, - "confidence": 0.9 - } - ] - }, - "retrieval_spec": { - "domains": [ - "CODE" - ], - "layer_queries": [ - { - "layer_id": "C1_SYMBOL_CATALOG", - "top_k": 8 - }, - { - "layer_id": "C0_SOURCE_CHUNKS", - "top_k": 8 - }, - { - "layer_id": "C4_SEMANTIC_ROLES", - "top_k": 8 - }, - { - "layer_id": "C2_DEPENDENCY_GRAPH", - "top_k": 6 - }, - { - "layer_id": "C3_ENTRYPOINTS", - "top_k": 6 - } - ], - "filters": { - "test_policy": "EXCLUDE", - "path_scope": [], - "language": [ - "python" - ] - }, - "rerank_profile": "code" - }, - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - }, - "symbol_resolution": { - "status": "not_found", - "resolved_symbol": null, - "alternatives": [], - "confidence": 0.0 - }, - "evidence_policy": { - "require_def": true, - "require_flow": true, - "require_spec": false, - "allow_answer_without_evidence": false - } - }, - "retrieval_request": { - "rag_session_id": "7d11da21-faa0-4cea-aede-aeabe069164c", - "query": "Объясни класс RuntimeFactoryManager", - "sub_intent": "EXPLAIN", - "path_scope": [], - "keyword_hints": [ - "RuntimeFactoryManager" - ], - "symbol_candidates": [ - "RuntimeFactoryManager" - ], - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_spec": { - "domains": [ - "CODE" - ], - "layer_queries": [ - { - "layer_id": "C1_SYMBOL_CATALOG", - "top_k": 8 - }, - { - "layer_id": "C0_SOURCE_CHUNKS", - "top_k": 8 - }, - { - "layer_id": "C4_SEMANTIC_ROLES", - "top_k": 8 - }, - { - "layer_id": "C2_DEPENDENCY_GRAPH", - "top_k": 6 - }, - { - "layer_id": "C3_ENTRYPOINTS", - "top_k": 6 - } - ], - "filters": { - "test_policy": "EXCLUDE", - "path_scope": [], - "language": [ - "python" - ] - }, - "rerank_profile": "code" - }, - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - }, - "query_plan": { - "raw": "Объясни класс RuntimeFactoryManager", - "normalized": "Объясни класс RuntimeFactoryManager", - "sub_intent": "EXPLAIN", - "negations": [], - "expansions": [ - "RuntimeFactoryManager" - ], - "keyword_hints": [ - "RuntimeFactoryManager" - ], - "path_hints": [], - "doc_scope_hints": [], - "symbol_candidates": [ - "RuntimeFactoryManager" - ], - "symbol_kind_hint": "class", - "anchors": [ - { - "type": "SYMBOL", - "value": "RuntimeFactoryManager", - "source": "user_text", - "subtype": null, - "span": { - "start": 14, - "end": 35 - }, - "confidence": 0.88 - }, - { - "type": "KEY_TERM", - "value": "класс", - "source": "user_text", - "subtype": null, - "span": { - "start": 8, - "end": 13 - }, - "confidence": 0.9 - } - ] - } - }, - "retrieval_result": { - "target_symbol_candidates": [], - "resolved_symbol": null, - "symbol_resolution_status": "not_found", - "file_candidates": [], - "code_chunks": [], - "relations": [], - "entrypoints": [], - "test_candidates": [], - "layer_outcomes": [ - { - "layer_id": "C1_SYMBOL_CATALOG", - "hit_count": 0, - "empty": true, - "fallback_used": false - }, - { - "layer_id": "C0_SOURCE_CHUNKS", - "hit_count": 0, - "empty": true, - "fallback_used": false - }, - { - "layer_id": "C4_SEMANTIC_ROLES", - "hit_count": 0, - "empty": true, - "fallback_used": false - }, - { - "layer_id": "C2_DEPENDENCY_GRAPH", - "hit_count": 0, - "empty": true, - "fallback_used": false - }, - { - "layer_id": "C3_ENTRYPOINTS", - "hit_count": 0, - "empty": true, - "fallback_used": false - } - ], - "missing_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "raw_rows": [], - "retrieval_report": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "vector", - "C0_SOURCE_CHUNKS": "vector", - "C4_SEMANTIC_ROLES": "vector", - "C2_DEPENDENCY_GRAPH": "vector", - "C3_ENTRYPOINTS": "vector" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 8, - "C4_SEMANTIC_ROLES": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C3_ENTRYPOINTS": 6 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [] - }, - "C4_SEMANTIC_ROLES": { - "path_scope": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [] - } - }, - "fallback": { - "used": false, - "reason": null - }, - "retrieval_by_layer_ms": { - "C1_SYMBOL_CATALOG": 32, - "C0_SOURCE_CHUNKS": 22, - "C4_SEMANTIC_ROLES": 18, - "C2_DEPENDENCY_GRAPH": 58, - "C3_ENTRYPOINTS": 13 - } - } - }, - "diagnostics": { - "intent_correct": null, - "target_found": false, - "layers_used": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_sufficient": false, - "answer_mode": "insufficient", - "resolved_target": null, - "answer_policy_branch": "explain_not_found", - "decision_reason": "symbol_resolution_not_found", - "router_result": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "retrieval_profile": "code", - "sub_intent": "EXPLAIN", - "path_scope": [], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "symbol_resolution_status": "not_found" - }, - "retrieval_request": { - "rag_session_id": "7d11da21-faa0-4cea-aede-aeabe069164c", - "query": "Объясни класс RuntimeFactoryManager", - "sub_intent": "EXPLAIN", - "path_scope": [], - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "per_layer_outcome": [ - { - "layer_id": "C1_SYMBOL_CATALOG", - "hit_count": 0, - "empty": true, - "fallback_used": false - }, - { - "layer_id": "C0_SOURCE_CHUNKS", - "hit_count": 0, - "empty": true, - "fallback_used": false - }, - { - "layer_id": "C4_SEMANTIC_ROLES", - "hit_count": 0, - "empty": true, - "fallback_used": false - }, - { - "layer_id": "C2_DEPENDENCY_GRAPH", - "hit_count": 0, - "empty": true, - "fallback_used": false - }, - { - "layer_id": "C3_ENTRYPOINTS", - "hit_count": 0, - "empty": true, - "fallback_used": false - } - ], - "empty_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "evidence_gate_decision": { - "sufficient": false, - "failure_reasons": [ - "insufficient_evidence" - ], - "evidence_count": 0 - }, - "evidence_gate_input": { - "resolved_target": null, - "sub_intent": "EXPLAIN", - "target_type": "none", - "evidence_count": 0, - "code_chunk_count": 0, - "entrypoint_count": 0, - "relation_count": 0, - "test_evidence_count": 0, - "symbol_resolution_status": "not_found", - "path_scope": [] - }, - "post_evidence_gate": { - "input": { - "answer_mode": "not_found", - "draft_present": false, - "resolved_target": null - }, - "output": { - "reason": "no_draft_answer" - } - }, - "failure_reasons": [ - "insufficient_evidence" - ], - "timings_ms": { - "router": 2, - "retrieval": 145, - "pre_evidence_gate": 1, - "post_evidence_gate": 1 - } - }, - "rag_rows": [], - "validation": { - "passed": true, - "action": "return", - "reasons": [] - }, - "steps": [ - { - "step": "router", - "status": "completed", - "timings_ms": { - "router": 2 - }, - "output": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - } - }, - { - "step": "retrieval", - "status": "completed", - "timings_ms": { - "retrieval": 145 - }, - "output": { - "rag_count": 33, - "answer_path_rag_count": 0, - "resolved_symbol_status": "not_found", - "resolved_symbol": null, - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "diagnostics": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "vector", - "C0_SOURCE_CHUNKS": "vector", - "C4_SEMANTIC_ROLES": "vector", - "C2_DEPENDENCY_GRAPH": "vector", - "C3_ENTRYPOINTS": "vector" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 8, - "C4_SEMANTIC_ROLES": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C3_ENTRYPOINTS": 6 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [] - }, - "C4_SEMANTIC_ROLES": { - "path_scope": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [] - } - }, - "fallback": { - "used": false, - "reason": null - }, - "retrieval_by_layer_ms": { - "C1_SYMBOL_CATALOG": 32, - "C0_SOURCE_CHUNKS": 22, - "C4_SEMANTIC_ROLES": 18, - "C2_DEPENDENCY_GRAPH": 58, - "C3_ENTRYPOINTS": 13 - } - } - }, - { - "step": "pre_evidence_gate", - "status": "blocked", - "timings_ms": { - "pre_evidence_gate": 1 - }, - "input": { - "resolved_target": null, - "sub_intent": "EXPLAIN", - "target_type": "none", - "evidence_count": 0, - "code_chunk_count": 0, - "entrypoint_count": 0, - "relation_count": 0, - "test_evidence_count": 0, - "symbol_resolution_status": "not_found", - "path_scope": [] - }, - "output": { - "passed": false, - "failure_reasons": [ - "insufficient_evidence" - ], - "degraded_message": "Insufficient evidence for a confident answer. Evidence count: 0 (minimum required not met).", - "evidence_count": 0 - } - }, - { - "step": "llm", - "status": "skipped", - "timings_ms": { - "llm": 1 - }, - "output": { - "reason": "policy_short_circuit", - "answer_mode": "not_found", - "decision_reason": "symbol_resolution_not_found", - "answer_policy_branch": "explain_not_found" - } - }, - { - "step": "post_evidence_gate", - "status": "skipped", - "timings_ms": { - "post_evidence_gate": 1 - }, - "input": { - "answer_mode": "not_found", - "draft_present": false, - "resolved_target": null - }, - "output": { - "reason": "no_draft_answer" - } - } - ] - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/plba_quality_focus_v3/20260312_173122/full_chain_plba_quality_focus_plba-v2-explain-nonexistent-symbol.md b/tests/pipeline_setup_v3/test_results/plba_quality_focus_v3/20260312_173122/full_chain_plba_quality_focus_plba-v2-explain-nonexistent-symbol.md deleted file mode 100644 index 8b724d9..0000000 --- a/tests/pipeline_setup_v3/test_results/plba_quality_focus_v3/20260312_173122/full_chain_plba_quality_focus_plba-v2-explain-nonexistent-symbol.md +++ /dev/null @@ -1,301 +0,0 @@ -# plba-v2-explain-nonexistent-symbol - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/tmp/full_chain_plba_quality_focus.yaml -- runner: agent_runtime -- mode: full_chain -- passed: True - -## Query -Объясни класс RuntimeFactoryManager - -## Actual -{ - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 0, - "llm_answer": "Сущность RuntimeFactoryManager не найдена в доступном коде.", - "answer_mode": "not_found", - "path_scope": [], - "symbol_candidates": [ - "RuntimeFactoryManager" - ], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] -} - -## Steps -[ - { - "step": "router", - "status": "completed", - "timings_ms": { - "router": 2 - }, - "output": { - "intent": "CODE_QA", - "sub_intent": "EXPLAIN", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - } - }, - { - "step": "retrieval", - "status": "completed", - "timings_ms": { - "retrieval": 145 - }, - "output": { - "rag_count": 33, - "answer_path_rag_count": 0, - "resolved_symbol_status": "not_found", - "resolved_symbol": null, - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "diagnostics": { - "executed_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_mode_by_layer": { - "C1_SYMBOL_CATALOG": "vector", - "C0_SOURCE_CHUNKS": "vector", - "C4_SEMANTIC_ROLES": "vector", - "C2_DEPENDENCY_GRAPH": "vector", - "C3_ENTRYPOINTS": "vector" - }, - "top_k_by_layer": { - "C1_SYMBOL_CATALOG": 8, - "C0_SOURCE_CHUNKS": 8, - "C4_SEMANTIC_ROLES": 8, - "C2_DEPENDENCY_GRAPH": 6, - "C3_ENTRYPOINTS": 6 - }, - "filters_by_layer": { - "C1_SYMBOL_CATALOG": { - "path_scope": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [] - }, - "C4_SEMANTIC_ROLES": { - "path_scope": [] - }, - "C2_DEPENDENCY_GRAPH": { - "path_scope": [] - }, - "C3_ENTRYPOINTS": { - "path_scope": [] - } - }, - "fallback": { - "used": false, - "reason": null - }, - "retrieval_by_layer_ms": { - "C1_SYMBOL_CATALOG": 32, - "C0_SOURCE_CHUNKS": 22, - "C4_SEMANTIC_ROLES": 18, - "C2_DEPENDENCY_GRAPH": 58, - "C3_ENTRYPOINTS": 13 - } - } - }, - { - "step": "pre_evidence_gate", - "status": "blocked", - "timings_ms": { - "pre_evidence_gate": 1 - }, - "input": { - "resolved_target": null, - "sub_intent": "EXPLAIN", - "target_type": "none", - "evidence_count": 0, - "code_chunk_count": 0, - "entrypoint_count": 0, - "relation_count": 0, - "test_evidence_count": 0, - "symbol_resolution_status": "not_found", - "path_scope": [] - }, - "output": { - "passed": false, - "failure_reasons": [ - "insufficient_evidence" - ], - "degraded_message": "Insufficient evidence for a confident answer. Evidence count: 0 (minimum required not met).", - "evidence_count": 0 - } - }, - { - "step": "llm", - "status": "skipped", - "timings_ms": { - "llm": 1 - }, - "output": { - "reason": "policy_short_circuit", - "answer_mode": "not_found", - "decision_reason": "symbol_resolution_not_found", - "answer_policy_branch": "explain_not_found" - } - }, - { - "step": "post_evidence_gate", - "status": "skipped", - "timings_ms": { - "post_evidence_gate": 1 - }, - "input": { - "answer_mode": "not_found", - "draft_present": false, - "resolved_target": null - }, - "output": { - "reason": "no_draft_answer" - } - } -] - -## Diagnostics -{ - "intent_correct": null, - "target_found": false, - "layers_used": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "retrieval_sufficient": false, - "answer_mode": "insufficient", - "resolved_target": null, - "answer_policy_branch": "explain_not_found", - "decision_reason": "symbol_resolution_not_found", - "router_result": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "retrieval_profile": "code", - "sub_intent": "EXPLAIN", - "path_scope": [], - "layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "symbol_resolution_status": "not_found" - }, - "retrieval_request": { - "rag_session_id": "7d11da21-faa0-4cea-aede-aeabe069164c", - "query": "Объясни класс RuntimeFactoryManager", - "sub_intent": "EXPLAIN", - "path_scope": [], - "requested_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ] - }, - "per_layer_outcome": [ - { - "layer_id": "C1_SYMBOL_CATALOG", - "hit_count": 0, - "empty": true, - "fallback_used": false - }, - { - "layer_id": "C0_SOURCE_CHUNKS", - "hit_count": 0, - "empty": true, - "fallback_used": false - }, - { - "layer_id": "C4_SEMANTIC_ROLES", - "hit_count": 0, - "empty": true, - "fallback_used": false - }, - { - "layer_id": "C2_DEPENDENCY_GRAPH", - "hit_count": 0, - "empty": true, - "fallback_used": false - }, - { - "layer_id": "C3_ENTRYPOINTS", - "hit_count": 0, - "empty": true, - "fallback_used": false - } - ], - "empty_layers": [ - "C1_SYMBOL_CATALOG", - "C0_SOURCE_CHUNKS", - "C4_SEMANTIC_ROLES", - "C2_DEPENDENCY_GRAPH", - "C3_ENTRYPOINTS" - ], - "evidence_gate_decision": { - "sufficient": false, - "failure_reasons": [ - "insufficient_evidence" - ], - "evidence_count": 0 - }, - "evidence_gate_input": { - "resolved_target": null, - "sub_intent": "EXPLAIN", - "target_type": "none", - "evidence_count": 0, - "code_chunk_count": 0, - "entrypoint_count": 0, - "relation_count": 0, - "test_evidence_count": 0, - "symbol_resolution_status": "not_found", - "path_scope": [] - }, - "post_evidence_gate": { - "input": { - "answer_mode": "not_found", - "draft_present": false, - "resolved_target": null - }, - "output": { - "reason": "no_draft_answer" - } - }, - "failure_reasons": [ - "insufficient_evidence" - ], - "timings_ms": { - "router": 2, - "retrieval": 145, - "pre_evidence_gate": 1, - "post_evidence_gate": 1 - } -} - -## Mismatches -- none \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/plba_quality_focus_v3/20260312_173122/full_chain_plba_quality_focus_plba-v2-find-entrypoints-health-endpoint.json b/tests/pipeline_setup_v3/test_results/plba_quality_focus_v3/20260312_173122/full_chain_plba_quality_focus_plba-v2-find-entrypoints-health-endpoint.json deleted file mode 100644 index 830f94b..0000000 --- a/tests/pipeline_setup_v3/test_results/plba_quality_focus_v3/20260312_173122/full_chain_plba_quality_focus_plba-v2-find-entrypoints-health-endpoint.json +++ /dev/null @@ -1,1553 +0,0 @@ -{ - "case_id": "plba-v2-find-entrypoints-health-endpoint", - "source_file": "/Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/tmp/full_chain_plba_quality_focus.yaml", - "runner": "agent_runtime", - "mode": "full_chain", - "query": "Где health endpoint?", - "actual": { - "intent": "CODE_QA", - "sub_intent": "FIND_ENTRYPOINTS", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 10, - "llm_answer": "Конкретная точка health endpoint подтверждена:\n\n- GET /health (объявлен в src/app_runtime/control/http_app.py:31-34)\n\nДругие endpoints найдены, но не являются точками health:\n\n- POST /actions/{action}\n- GET /actions/{action} (эти маршруты объявлены там же, но не отмечены как health check)", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "health", - "endpoint" - ], - "layers": [ - "C3_ENTRYPOINTS", - "C0_SOURCE_CHUNKS" - ] - }, - "passed": true, - "mismatches": [], - "details": { - "query": "Где health endpoint?", - "router_result": { - "schema_version": "1.1", - "intent": "CODE_QA", - "retrieval_profile": "code", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "query_plan": { - "raw": "Где health endpoint?", - "normalized": "Где health endpoint?", - "sub_intent": "FIND_ENTRYPOINTS", - "negations": [], - "expansions": [ - "health", - "endpoint" - ], - "keyword_hints": [ - "health", - "endpoint" - ], - "path_hints": [], - "doc_scope_hints": [], - "symbol_candidates": [ - "health", - "endpoint" - ], - "symbol_kind_hint": "unknown", - "anchors": [ - { - "type": "SYMBOL", - "value": "health", - "source": "user_text", - "subtype": null, - "span": { - "start": 4, - "end": 10 - }, - "confidence": 0.88 - }, - { - "type": "SYMBOL", - "value": "endpoint", - "source": "user_text", - "subtype": null, - "span": { - "start": 11, - "end": 19 - }, - "confidence": 0.88 - } - ] - }, - "retrieval_spec": { - "domains": [ - "CODE" - ], - "layer_queries": [ - { - "layer_id": "C3_ENTRYPOINTS", - "top_k": 12 - }, - { - "layer_id": "C0_SOURCE_CHUNKS", - "top_k": 6 - } - ], - "filters": { - "test_policy": "EXCLUDE", - "path_scope": [], - "language": [ - "python" - ] - }, - "rerank_profile": "code" - }, - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - }, - "symbol_resolution": { - "status": "not_found", - "resolved_symbol": null, - "alternatives": [], - "confidence": 0.0 - }, - "evidence_policy": { - "require_def": true, - "require_flow": true, - "require_spec": false, - "allow_answer_without_evidence": false - } - }, - "retrieval_request": { - "rag_session_id": "7d11da21-faa0-4cea-aede-aeabe069164c", - "query": "Где health endpoint?", - "sub_intent": "FIND_ENTRYPOINTS", - "path_scope": [], - "keyword_hints": [ - "health", - "endpoint" - ], - "symbol_candidates": [ - "health", - "endpoint" - ], - "requested_layers": [ - "C3_ENTRYPOINTS", - "C0_SOURCE_CHUNKS" - ], - "retrieval_spec": { - "domains": [ - "CODE" - ], - "layer_queries": [ - { - "layer_id": "C3_ENTRYPOINTS", - "top_k": 12 - }, - { - "layer_id": "C0_SOURCE_CHUNKS", - "top_k": 6 - } - ], - "filters": { - "test_policy": "EXCLUDE", - "path_scope": [], - "language": [ - "python" - ] - }, - "rerank_profile": "code" - }, - "retrieval_constraints": { - "include_globs": [ - "src/**" - ], - "exclude_globs": [ - "tests/**", - "**/test_*.py", - "**/*_test.py" - ], - "prefer_globs": [], - "test_file_globs": [], - "test_symbol_patterns": [], - "max_candidates": 20, - "fuzzy_symbol_search": { - "enabled": true, - "max_distance": 2, - "top_k": 5 - } - }, - "query_plan": { - "raw": "Где health endpoint?", - "normalized": "Где health endpoint?", - "sub_intent": "FIND_ENTRYPOINTS", - "negations": [], - "expansions": [ - "health", - "endpoint" - ], - "keyword_hints": [ - "health", - "endpoint" - ], - "path_hints": [], - "doc_scope_hints": [], - "symbol_candidates": [ - "health", - "endpoint" - ], - "symbol_kind_hint": "unknown", - "anchors": [ - { - "type": "SYMBOL", - "value": "health", - "source": "user_text", - "subtype": null, - "span": { - "start": 4, - "end": 10 - }, - "confidence": 0.88 - }, - { - "type": "SYMBOL", - "value": "endpoint", - "source": "user_text", - "subtype": null, - "span": { - "start": 11, - "end": 19 - }, - "confidence": 0.88 - } - ] - } - }, - "retrieval_result": { - "target_symbol_candidates": [], - "resolved_symbol": null, - "symbol_resolution_status": "not_found", - "file_candidates": [ - "src/app_runtime/control/http_app.py", - "src/app_runtime/health/registry.py", - "src/plba/health.py", - "src/app_runtime/contracts/health.py", - "src/app_runtime/health/__init__.py", - "src/app_runtime/contracts/worker.py" - ], - "code_chunks": [ - { - "layer": "C3_ENTRYPOINTS", - "path": "src/app_runtime/control/http_app.py", - "title": "app.post", - "content": "fastapi http app.post", - "start_line": 38, - "end_line": 42, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C3_ENTRYPOINTS", - "path": "src/app_runtime/control/http_app.py", - "title": "app.get", - "content": "fastapi http app.get", - "start_line": 31, - "end_line": 34, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C3_ENTRYPOINTS", - "path": "src/app_runtime/control/http_app.py", - "title": "app.get", - "content": "fastapi http app.get", - "start_line": 38, - "end_line": 42, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C0_SOURCE_CHUNKS", - "path": "src/app_runtime/health/registry.py", - "title": "src/app_runtime/health/registry.py:HealthRegistry", - "content": "class HealthRegistry:\n def __init__(self) -> None:\n self._contributors: list[HealthContributor] = []\n\n def register(self, contributor: HealthContributor) -> None:\n self._contributors.append(contributor)\n\n def contributor_healths(self) -> list[WorkerHealth]:\n return [contributor.health() for contributor in self._contributors]\n\n def snapshot(self, worker_healths: list[WorkerHealth]) -> dict[str, object]:\n component_healths = worker_healths + self.contributor_healths()\n return {\n \"status\": self._aggregate_status(component_healths),\n \"components\": [self._health_dict(item) for item in component_healths],\n }\n\n def payload(self, state: LifecycleState, worker_healths: list[WorkerHealth]) -> HealthPayload:\n component_healths = worker_healths + self.contributor_healths()\n if state == LifecycleState.STOPPED:\n return {\"status\": \"unhealthy\", \"detail\": \"state=stopped\", \"state\": state.value}\n if state in {LifecycleState.STARTING, LifecycleState.STOPPING}:\n return {\n \"status\": \"degraded\",\n \"detail\": f\"state={state.value}\",\n \"state\": state.value,\n \"components\": [self._health_dict(item) for item in component_healths],\n }\n return {\n \"status\": self._aggregate_status(component_healths),\n \"state\": state.value,\n \"components\": [self._health_dict(item) for item in component_healths],\n }\n\n def _aggregate_status(self, component_healths: list[WorkerHealth]) -> str:\n if any(item.status == \"unhealthy\" and item.critical for item in component_healths):\n return \"unhealthy\"\n if any(item.status in {\"degraded\", \"unhealthy\"} for item in component_healths):\n return \"degraded\"\n return \"ok\"\n\n def _health_dict(self, health: WorkerHealth) -> dict[str, object]:\n return {\n \"name\": health.name,\n \"status\": health.status,\n \"critical\": health.critical,\n \"detail\": health.detail,\n \"meta\": health.meta,\n }", - "start_line": 8, - "end_line": 56, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.health.registry", - "is_test": false, - "blob_sha": "26e6a24daa43407ba5340b74497c20153020e79f8d7828ae502aaec378dfcf75", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C0_SOURCE_CHUNKS", - "path": "src/plba/health.py", - "title": "src/app_runtime/health/__init__.py:1-3", - "content": "from app_runtime.health.registry import HealthRegistry\n\n__all__ = [\"HealthRegistry\"]", - "start_line": 1, - "end_line": 3, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.app_runtime.health.__init__", - "is_test": false, - "blob_sha": "f7b15eed8b1f1cca8dfd467909a2612d8cb4e66e46b972ad89a0c9459ce283a0", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C0_SOURCE_CHUNKS", - "path": "src/app_runtime/contracts/health.py", - "title": "src/app_runtime/contracts/health.py:HealthContributor", - "content": "class HealthContributor(ABC):\n @abstractmethod\n def health(self) -> WorkerHealth:\n \"\"\"Return contributor health state.\"\"\"", - "start_line": 7, - "end_line": 10, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.contracts.health", - "is_test": false, - "blob_sha": "6bd92611def7131e32d4dd34a8ed85e6cf3c67722ad27797032a632cb30dc097", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C0_SOURCE_CHUNKS", - "path": "src/app_runtime/health/__init__.py", - "title": "src/app_runtime/health/__init__.py:1-3", - "content": "from app_runtime.health.registry import HealthRegistry\n\n__all__ = [\"HealthRegistry\"]", - "start_line": 1, - "end_line": 3, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.app_runtime.health.__init__", - "is_test": false, - "blob_sha": "f7b15eed8b1f1cca8dfd467909a2612d8cb4e66e46b972ad89a0c9459ce283a0", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C0_SOURCE_CHUNKS", - "path": "src/app_runtime/contracts/worker.py", - "title": "src/app_runtime/contracts/worker.py:WorkerHealth", - "content": "class WorkerHealth:\n name: str\n status: HealthState\n critical: bool\n detail: str | None = None\n meta: dict[str, Any] = field(default_factory=dict)", - "start_line": 13, - "end_line": 18, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.contracts.worker", - "is_test": false, - "blob_sha": "e4827d32220f322d8adc3e42769da3ca0cc680db6a5eab7a11f4d8773a75304e", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C0_SOURCE_CHUNKS", - "path": "src/app_runtime/contracts/worker.py", - "title": "src/app_runtime/contracts/worker.py:Worker", - "content": "class Worker(ABC):\n @property\n @abstractmethod\n def name(self) -> str:\n \"\"\"Stable worker name for diagnostics.\"\"\"\n\n @property\n @abstractmethod\n def critical(self) -> bool:\n \"\"\"Whether this worker is required for healthy app operation.\"\"\"\n\n @abstractmethod\n def start(self) -> None:\n \"\"\"Start worker execution.\"\"\"\n\n @abstractmethod\n def stop(self, force: bool = False) -> None:\n \"\"\"Request graceful or immediate stop.\"\"\"\n\n @abstractmethod\n def health(self) -> WorkerHealth:\n \"\"\"Return current health state.\"\"\"\n\n @abstractmethod\n def status(self) -> WorkerStatus:\n \"\"\"Return current runtime status.\"\"\"", - "start_line": 30, - "end_line": 55, - "metadata": { - "chunk_index": 2, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.contracts.worker", - "is_test": false, - "blob_sha": "e4827d32220f322d8adc3e42769da3ca0cc680db6a5eab7a11f4d8773a75304e", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "layer": "C0_SOURCE_CHUNKS", - "path": "src/app_runtime/control/http_app.py", - "title": "src/app_runtime/control/http_app.py:HttpControlAppFactory", - "content": "class HttpControlAppFactory:\n def create(\n self,\n health_provider: Callable[[], Awaitable[HealthPayload]],\n action_provider: Callable[[str, str], Awaitable[JSONResponse]],\n ) -> FastAPI:\n app = FastAPI(title=\"PLBA Control API\")\n\n @app.middleware(\"http\")\n async def log_api_call(request: Request, call_next): # type: ignore[no-untyped-def]\n started = time.monotonic()\n response = await call_next(request)\n response.headers[\"X-Response-Time-Ms\"] = str(int((time.monotonic() - started) * 1000))\n return response\n\n @app.get(\"/health\")\n async def health() -> JSONResponse:\n payload = await health_provider()\n status_code = 200 if payload.get(\"status\") == \"ok\" else 503\n return JSONResponse(content=payload, status_code=status_code)\n\n @app.get(\"/actions/{action}\")\n @app.post(\"/actions/{action}\")\n async def action(action: str, request: Request) -> JSONResponse:\n client_source = self._client_source(request)\n if action in {\"start\", \"stop\"}:\n LOGGER.warning(\"Control action requested: /actions/%s client=%s\", action, client_source)\n return await action_provider(action, client_source)\n\n return app\n\n def _client_source(self, request: Request) -> str:\n explicit_header = request.headers.get(\"X-Client-Source\", \"\").strip()\n if explicit_header:\n return explicit_header\n user_agent = request.headers.get(\"User-Agent\", \"\").strip()\n if user_agent:\n return f\"user-agent:{user_agent}\"\n return \"unknown\"", - "start_line": 15, - "end_line": 53, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.http_app", - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "relations": [], - "entrypoints": [ - { - "path": "src/app_runtime/control/http_app.py", - "title": "app.get", - "start_line": 31, - "end_line": 34, - "http_method": "GET", - "route_path": "/health", - "handler_symbol": "health", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "route_or_command": "app.get", - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "title": "app.get", - "start_line": 38, - "end_line": 42, - "http_method": "GET", - "route_path": "/actions/{action}", - "handler_symbol": "action", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "route_or_command": "app.get", - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "title": "app.post", - "start_line": 38, - "end_line": 42, - "http_method": "POST", - "route_path": "/actions/{action}", - "handler_symbol": "action", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "route_or_command": "app.post", - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "test_candidates": [], - "layer_outcomes": [ - { - "layer_id": "C3_ENTRYPOINTS", - "hit_count": 3, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C0_SOURCE_CHUNKS", - "hit_count": 7, - "empty": false, - "fallback_used": false - } - ], - "missing_layers": [], - "raw_rows": [ - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": null, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": null, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": null, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/health/registry.py", - "content": "class HealthRegistry:\n def __init__(self) -> None:\n self._contributors: list[HealthContributor] = []\n\n def register(self, contributor: HealthContributor) -> None:\n self._contributors.append(contributor)\n\n def contributor_healths(self) -> list[WorkerHealth]:\n return [contributor.health() for contributor in self._contributors]\n\n def snapshot(self, worker_healths: list[WorkerHealth]) -> dict[str, object]:\n component_healths = worker_healths + self.contributor_healths()\n return {\n \"status\": self._aggregate_status(component_healths),\n \"components\": [self._health_dict(item) for item in component_healths],\n }\n\n def payload(self, state: LifecycleState, worker_healths: list[WorkerHealth]) -> HealthPayload:\n component_healths = worker_healths + self.contributor_healths()\n if state == LifecycleState.STOPPED:\n return {\"status\": \"unhealthy\", \"detail\": \"state=stopped\", \"state\": state.value}\n if state in {LifecycleState.STARTING, LifecycleState.STOPPING}:\n return {\n \"status\": \"degraded\",\n \"detail\": f\"state={state.value}\",\n \"state\": state.value,\n \"components\": [self._health_dict(item) for item in component_healths],\n }\n return {\n \"status\": self._aggregate_status(component_healths),\n \"state\": state.value,\n \"components\": [self._health_dict(item) for item in component_healths],\n }\n\n def _aggregate_status(self, component_healths: list[WorkerHealth]) -> str:\n if any(item.status == \"unhealthy\" and item.critical for item in component_healths):\n return \"unhealthy\"\n if any(item.status in {\"degraded\", \"unhealthy\"} for item in component_healths):\n return \"degraded\"\n return \"ok\"\n\n def _health_dict(self, health: WorkerHealth) -> dict[str, object]:\n return {\n \"name\": health.name,\n \"status\": health.status,\n \"critical\": health.critical,\n \"detail\": health.detail,\n \"meta\": health.meta,\n }", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/health/registry.py:HealthRegistry", - "span_start": 8, - "span_end": 56, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": null, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.health.registry", - "is_test": false, - "blob_sha": "26e6a24daa43407ba5340b74497c20153020e79f8d7828ae502aaec378dfcf75", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/health.py", - "content": "from app_runtime.health.registry import HealthRegistry\n\n__all__ = [\"HealthRegistry\"]", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/health/__init__.py:1-3", - "span_start": 1, - "span_end": 3, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": null, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.app_runtime.health.__init__", - "is_test": false, - "blob_sha": "f7b15eed8b1f1cca8dfd467909a2612d8cb4e66e46b972ad89a0c9459ce283a0", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/contracts/health.py", - "content": "class HealthContributor(ABC):\n @abstractmethod\n def health(self) -> WorkerHealth:\n \"\"\"Return contributor health state.\"\"\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/contracts/health.py:HealthContributor", - "span_start": 7, - "span_end": 10, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": null, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.contracts.health", - "is_test": false, - "blob_sha": "6bd92611def7131e32d4dd34a8ed85e6cf3c67722ad27797032a632cb30dc097", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/health/__init__.py", - "content": "from app_runtime.health.registry import HealthRegistry\n\n__all__ = [\"HealthRegistry\"]", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/health/__init__.py:1-3", - "span_start": 1, - "span_end": 3, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": null, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.app_runtime.health.__init__", - "is_test": false, - "blob_sha": "f7b15eed8b1f1cca8dfd467909a2612d8cb4e66e46b972ad89a0c9459ce283a0", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/contracts/worker.py", - "content": "class WorkerHealth:\n name: str\n status: HealthState\n critical: bool\n detail: str | None = None\n meta: dict[str, Any] = field(default_factory=dict)", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/contracts/worker.py:WorkerHealth", - "span_start": 13, - "span_end": 18, - "lexical_rank": 6, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": null, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.contracts.worker", - "is_test": false, - "blob_sha": "e4827d32220f322d8adc3e42769da3ca0cc680db6a5eab7a11f4d8773a75304e", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/contracts/worker.py", - "content": "class Worker(ABC):\n @property\n @abstractmethod\n def name(self) -> str:\n \"\"\"Stable worker name for diagnostics.\"\"\"\n\n @property\n @abstractmethod\n def critical(self) -> bool:\n \"\"\"Whether this worker is required for healthy app operation.\"\"\"\n\n @abstractmethod\n def start(self) -> None:\n \"\"\"Start worker execution.\"\"\"\n\n @abstractmethod\n def stop(self, force: bool = False) -> None:\n \"\"\"Request graceful or immediate stop.\"\"\"\n\n @abstractmethod\n def health(self) -> WorkerHealth:\n \"\"\"Return current health state.\"\"\"\n\n @abstractmethod\n def status(self) -> WorkerStatus:\n \"\"\"Return current runtime status.\"\"\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/contracts/worker.py:Worker", - "span_start": 30, - "span_end": 55, - "lexical_rank": 6, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": null, - "metadata": { - "chunk_index": 2, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.contracts.worker", - "is_test": false, - "blob_sha": "e4827d32220f322d8adc3e42769da3ca0cc680db6a5eab7a11f4d8773a75304e", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "class HttpControlAppFactory:\n def create(\n self,\n health_provider: Callable[[], Awaitable[HealthPayload]],\n action_provider: Callable[[str, str], Awaitable[JSONResponse]],\n ) -> FastAPI:\n app = FastAPI(title=\"PLBA Control API\")\n\n @app.middleware(\"http\")\n async def log_api_call(request: Request, call_next): # type: ignore[no-untyped-def]\n started = time.monotonic()\n response = await call_next(request)\n response.headers[\"X-Response-Time-Ms\"] = str(int((time.monotonic() - started) * 1000))\n return response\n\n @app.get(\"/health\")\n async def health() -> JSONResponse:\n payload = await health_provider()\n status_code = 200 if payload.get(\"status\") == \"ok\" else 503\n return JSONResponse(content=payload, status_code=status_code)\n\n @app.get(\"/actions/{action}\")\n @app.post(\"/actions/{action}\")\n async def action(action: str, request: Request) -> JSONResponse:\n client_source = self._client_source(request)\n if action in {\"start\", \"stop\"}:\n LOGGER.warning(\"Control action requested: /actions/%s client=%s\", action, client_source)\n return await action_provider(action, client_source)\n\n return app\n\n def _client_source(self, request: Request) -> str:\n explicit_header = request.headers.get(\"X-Client-Source\", \"\").strip()\n if explicit_header:\n return explicit_header\n user_agent = request.headers.get(\"User-Agent\", \"\").strip()\n if user_agent:\n return f\"user-agent:{user_agent}\"\n return \"unknown\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/http_app.py:HttpControlAppFactory", - "span_start": 15, - "span_end": 53, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.http_app", - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "retrieval_report": { - "executed_layers": [ - "C3_ENTRYPOINTS", - "C0_SOURCE_CHUNKS" - ], - "retrieval_mode_by_layer": { - "C3_ENTRYPOINTS": "vector", - "C0_SOURCE_CHUNKS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C3_ENTRYPOINTS": 12, - "C0_SOURCE_CHUNKS": 24 - }, - "filters_by_layer": { - "C3_ENTRYPOINTS": { - "path_scope": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src/app_runtime/control/http_app.py" - ] - } - }, - "fallback": { - "used": false, - "reason": null - }, - "retrieval_by_layer_ms": { - "C3_ENTRYPOINTS": 240, - "C0_SOURCE_CHUNKS": 9 - }, - "supplemental_requests": [ - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Где health endpoint?", - "ranking_profile": "entrypoint_source_hydration" - } - ] - } - }, - "diagnostics": { - "intent_correct": null, - "target_found": true, - "layers_used": [ - "C3_ENTRYPOINTS", - "C0_SOURCE_CHUNKS" - ], - "retrieval_sufficient": true, - "answer_mode": "normal", - "resolved_target": "src/app_runtime/control/http_app.py", - "answer_policy_branch": "normal_answer", - "decision_reason": "evidence_sufficient", - "router_result": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "retrieval_profile": "code", - "sub_intent": "FIND_ENTRYPOINTS", - "path_scope": [], - "layers": [ - "C3_ENTRYPOINTS", - "C0_SOURCE_CHUNKS" - ], - "symbol_resolution_status": "not_found" - }, - "retrieval_request": { - "rag_session_id": "7d11da21-faa0-4cea-aede-aeabe069164c", - "query": "Где health endpoint?", - "sub_intent": "FIND_ENTRYPOINTS", - "path_scope": [], - "requested_layers": [ - "C3_ENTRYPOINTS", - "C0_SOURCE_CHUNKS" - ] - }, - "per_layer_outcome": [ - { - "layer_id": "C3_ENTRYPOINTS", - "hit_count": 3, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C0_SOURCE_CHUNKS", - "hit_count": 7, - "empty": false, - "fallback_used": false - } - ], - "empty_layers": [], - "evidence_gate_decision": { - "sufficient": true, - "failure_reasons": [], - "evidence_count": 10 - }, - "evidence_gate_input": { - "resolved_target": "src/app_runtime/control/http_app.py", - "sub_intent": "FIND_ENTRYPOINTS", - "target_type": "file", - "evidence_count": 10, - "code_chunk_count": 10, - "entrypoint_count": 3, - "relation_count": 0, - "test_evidence_count": 0, - "symbol_resolution_status": "not_found", - "path_scope": [] - }, - "post_evidence_gate": { - "input": { - "answer_mode": "normal", - "degraded_message": "", - "resolved_target": "src/app_runtime/control/http_app.py", - "draft_answer_preview": "Конкретная точка health endpoint подтверждена:\n\n- GET /health (объявлен в src/app_runtime/control/http_app.py:31-34)\n\nДругие endpoints найдены, но не являются точками health:\n\n- POST /actions/{action}\n- GET /actions/{action} (эти маршруты объявлены там же, но не отмечены как health check)", - "repair_candidate": true - }, - "output": { - "passed": true, - "action": "return", - "reasons": [], - "repair_used": false, - "final_answer_preview": "Конкретная точка health endpoint подтверждена:\n\n- GET /health (объявлен в src/app_runtime/control/http_app.py:31-34)\n\nДругие endpoints найдены, но не являются точками health:\n\n- POST /actions/{action}\n- GET /actions/{action} (эти маршруты объявлены там же, но не отмечены как health check)" - } - }, - "failure_reasons": [], - "timings_ms": { - "router": 1, - "retrieval": 254, - "pre_evidence_gate": 1, - "llm": 3666, - "post_evidence_gate": 1 - } - }, - "rag_rows": [ - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.post", - "layer": "C3_ENTRYPOINTS", - "title": "app.post", - "span_start": 38, - "span_end": 42, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "56ed4b3229229e985cbf949d567b742b156412c7280eba9b5b54668f61bf0305", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.post", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "POST" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 31, - "span_end": 34, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "5377b9336800b5d63cc3b67a58730d18a409b245650dd9449325d87c64e24f62", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "ab49f8d604dfed17bd83972a4158047a7c773c20ff58fbabc7963f4a1ec96834", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "fastapi http app.get", - "layer": "C3_ENTRYPOINTS", - "title": "app.get", - "span_start": 38, - "span_end": 42, - "lexical_rank": 100, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 0, - "distance": NaN, - "metadata": { - "entry_id": "06e2f03cced7c1146b2d29f81951f2a2839140484eae22b2d6a63075d903ca4a", - "entry_type": "http", - "framework": "fastapi", - "route_or_command": "app.get", - "handler_symbol_id": "4da634384f08efb2d4cc12ac58ce1e667a780481392b4e715ae963e8e8a37fab", - "is_test": false, - "lang_payload": { - "methods": [ - "GET" - ] - }, - "artifact_type": null, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/health/registry.py", - "content": "class HealthRegistry:\n def __init__(self) -> None:\n self._contributors: list[HealthContributor] = []\n\n def register(self, contributor: HealthContributor) -> None:\n self._contributors.append(contributor)\n\n def contributor_healths(self) -> list[WorkerHealth]:\n return [contributor.health() for contributor in self._contributors]\n\n def snapshot(self, worker_healths: list[WorkerHealth]) -> dict[str, object]:\n component_healths = worker_healths + self.contributor_healths()\n return {\n \"status\": self._aggregate_status(component_healths),\n \"components\": [self._health_dict(item) for item in component_healths],\n }\n\n def payload(self, state: LifecycleState, worker_healths: list[WorkerHealth]) -> HealthPayload:\n component_healths = worker_healths + self.contributor_healths()\n if state == LifecycleState.STOPPED:\n return {\"status\": \"unhealthy\", \"detail\": \"state=stopped\", \"state\": state.value}\n if state in {LifecycleState.STARTING, LifecycleState.STOPPING}:\n return {\n \"status\": \"degraded\",\n \"detail\": f\"state={state.value}\",\n \"state\": state.value,\n \"components\": [self._health_dict(item) for item in component_healths],\n }\n return {\n \"status\": self._aggregate_status(component_healths),\n \"state\": state.value,\n \"components\": [self._health_dict(item) for item in component_healths],\n }\n\n def _aggregate_status(self, component_healths: list[WorkerHealth]) -> str:\n if any(item.status == \"unhealthy\" and item.critical for item in component_healths):\n return \"unhealthy\"\n if any(item.status in {\"degraded\", \"unhealthy\"} for item in component_healths):\n return \"degraded\"\n return \"ok\"\n\n def _health_dict(self, health: WorkerHealth) -> dict[str, object]:\n return {\n \"name\": health.name,\n \"status\": health.status,\n \"critical\": health.critical,\n \"detail\": health.detail,\n \"meta\": health.meta,\n }", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/health/registry.py:HealthRegistry", - "span_start": 8, - "span_end": 56, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.health.registry", - "is_test": false, - "blob_sha": "26e6a24daa43407ba5340b74497c20153020e79f8d7828ae502aaec378dfcf75", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/plba/health.py", - "content": "from app_runtime.health.registry import HealthRegistry\n\n__all__ = [\"HealthRegistry\"]", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/health/__init__.py:1-3", - "span_start": 1, - "span_end": 3, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.app_runtime.health.__init__", - "is_test": false, - "blob_sha": "f7b15eed8b1f1cca8dfd467909a2612d8cb4e66e46b972ad89a0c9459ce283a0", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/contracts/health.py", - "content": "class HealthContributor(ABC):\n @abstractmethod\n def health(self) -> WorkerHealth:\n \"\"\"Return contributor health state.\"\"\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/contracts/health.py:HealthContributor", - "span_start": 7, - "span_end": 10, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.contracts.health", - "is_test": false, - "blob_sha": "6bd92611def7131e32d4dd34a8ed85e6cf3c67722ad27797032a632cb30dc097", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/health/__init__.py", - "content": "from app_runtime.health.registry import HealthRegistry\n\n__all__ = [\"HealthRegistry\"]", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/health/__init__.py:1-3", - "span_start": 1, - "span_end": 3, - "lexical_rank": 5, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "window", - "module_or_unit": "src.app_runtime.health.__init__", - "is_test": false, - "blob_sha": "f7b15eed8b1f1cca8dfd467909a2612d8cb4e66e46b972ad89a0c9459ce283a0", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/contracts/worker.py", - "content": "class WorkerHealth:\n name: str\n status: HealthState\n critical: bool\n detail: str | None = None\n meta: dict[str, Any] = field(default_factory=dict)", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/contracts/worker.py:WorkerHealth", - "span_start": 13, - "span_end": 18, - "lexical_rank": 6, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.contracts.worker", - "is_test": false, - "blob_sha": "e4827d32220f322d8adc3e42769da3ca0cc680db6a5eab7a11f4d8773a75304e", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/contracts/worker.py", - "content": "class Worker(ABC):\n @property\n @abstractmethod\n def name(self) -> str:\n \"\"\"Stable worker name for diagnostics.\"\"\"\n\n @property\n @abstractmethod\n def critical(self) -> bool:\n \"\"\"Whether this worker is required for healthy app operation.\"\"\"\n\n @abstractmethod\n def start(self) -> None:\n \"\"\"Start worker execution.\"\"\"\n\n @abstractmethod\n def stop(self, force: bool = False) -> None:\n \"\"\"Request graceful or immediate stop.\"\"\"\n\n @abstractmethod\n def health(self) -> WorkerHealth:\n \"\"\"Return current health state.\"\"\"\n\n @abstractmethod\n def status(self) -> WorkerStatus:\n \"\"\"Return current runtime status.\"\"\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/contracts/worker.py:Worker", - "span_start": 30, - "span_end": 55, - "lexical_rank": 6, - "prefer_bonus": 1, - "test_penalty": 0, - "structural_rank": 99, - "layer_rank": 4, - "distance": NaN, - "metadata": { - "chunk_index": 2, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.contracts.worker", - "is_test": false, - "blob_sha": "e4827d32220f322d8adc3e42769da3ca0cc680db6a5eab7a11f4d8773a75304e", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - }, - { - "path": "src/app_runtime/control/http_app.py", - "content": "class HttpControlAppFactory:\n def create(\n self,\n health_provider: Callable[[], Awaitable[HealthPayload]],\n action_provider: Callable[[str, str], Awaitable[JSONResponse]],\n ) -> FastAPI:\n app = FastAPI(title=\"PLBA Control API\")\n\n @app.middleware(\"http\")\n async def log_api_call(request: Request, call_next): # type: ignore[no-untyped-def]\n started = time.monotonic()\n response = await call_next(request)\n response.headers[\"X-Response-Time-Ms\"] = str(int((time.monotonic() - started) * 1000))\n return response\n\n @app.get(\"/health\")\n async def health() -> JSONResponse:\n payload = await health_provider()\n status_code = 200 if payload.get(\"status\") == \"ok\" else 503\n return JSONResponse(content=payload, status_code=status_code)\n\n @app.get(\"/actions/{action}\")\n @app.post(\"/actions/{action}\")\n async def action(action: str, request: Request) -> JSONResponse:\n client_source = self._client_source(request)\n if action in {\"start\", \"stop\"}:\n LOGGER.warning(\"Control action requested: /actions/%s client=%s\", action, client_source)\n return await action_provider(action, client_source)\n\n return app\n\n def _client_source(self, request: Request) -> str:\n explicit_header = request.headers.get(\"X-Client-Source\", \"\").strip()\n if explicit_header:\n return explicit_header\n user_agent = request.headers.get(\"User-Agent\", \"\").strip()\n if user_agent:\n return f\"user-agent:{user_agent}\"\n return \"unknown\"", - "layer": "C0_SOURCE_CHUNKS", - "title": "src/app_runtime/control/http_app.py:HttpControlAppFactory", - "span_start": 15, - "span_end": 53, - "lexical_rank": 0, - "prefer_bonus": 0, - "test_penalty": 0, - "structural_rank": 0, - "layer_rank": 0, - "distance": 0, - "metadata": { - "chunk_index": 0, - "chunk_type": "symbol_block", - "module_or_unit": "src.app_runtime.control.http_app", - "is_test": false, - "blob_sha": "1cebc374b1999638635b2f2c2ccf1dcf11c465914c22dd9490b1531278846919", - "repo_id": "plba", - "artifact_type": null, - "section": null, - "doc_id": null, - "doc_version": null, - "owner": null, - "system_component": null, - "last_modified": null, - "staleness_score": null - } - } - ], - "validation": { - "passed": true, - "action": "return", - "reasons": [] - }, - "steps": [ - { - "step": "router", - "status": "completed", - "timings_ms": { - "router": 1 - }, - "output": { - "intent": "CODE_QA", - "sub_intent": "FIND_ENTRYPOINTS", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - } - }, - { - "step": "retrieval", - "status": "completed", - "timings_ms": { - "retrieval": 254 - }, - "output": { - "rag_count": 10, - "answer_path_rag_count": 10, - "resolved_symbol_status": "not_found", - "resolved_symbol": null, - "requested_layers": [ - "C3_ENTRYPOINTS", - "C0_SOURCE_CHUNKS" - ] - }, - "diagnostics": { - "executed_layers": [ - "C3_ENTRYPOINTS", - "C0_SOURCE_CHUNKS" - ], - "retrieval_mode_by_layer": { - "C3_ENTRYPOINTS": "vector", - "C0_SOURCE_CHUNKS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C3_ENTRYPOINTS": 12, - "C0_SOURCE_CHUNKS": 24 - }, - "filters_by_layer": { - "C3_ENTRYPOINTS": { - "path_scope": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src/app_runtime/control/http_app.py" - ] - } - }, - "fallback": { - "used": false, - "reason": null - }, - "retrieval_by_layer_ms": { - "C3_ENTRYPOINTS": 240, - "C0_SOURCE_CHUNKS": 9 - }, - "supplemental_requests": [ - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Где health endpoint?", - "ranking_profile": "entrypoint_source_hydration" - } - ] - } - }, - { - "step": "pre_evidence_gate", - "status": "passed", - "timings_ms": { - "pre_evidence_gate": 1 - }, - "input": { - "resolved_target": "src/app_runtime/control/http_app.py", - "sub_intent": "FIND_ENTRYPOINTS", - "target_type": "file", - "evidence_count": 10, - "code_chunk_count": 10, - "entrypoint_count": 3, - "relation_count": 0, - "test_evidence_count": 0, - "symbol_resolution_status": "not_found", - "path_scope": [] - }, - "output": { - "passed": true, - "failure_reasons": [], - "degraded_message": "", - "evidence_count": 10 - } - }, - { - "step": "llm", - "status": "completed", - "timings_ms": { - "llm": 3666 - }, - "output": { - "prompt_name": "code_qa_find_entrypoints_answer", - "answer_preview": "Конкретная точка health endpoint подтверждена:\n\n- GET /health (объявлен в src/app_runtime/control/http_app.py:31-34)\n\nДругие endpoints найдены, но не являются точками health:\n\n- POST /actions/{action}\n- GET /actions/{action} (эти маршруты объявлены там же, но не отмечены как health check)", - "resolved_target": "src/app_runtime/control/http_app.py", - "answer_policy_branch": "normal_answer", - "decision_reason": "evidence_sufficient" - } - }, - { - "step": "post_evidence_gate", - "status": "passed", - "timings_ms": { - "post_evidence_gate": 1, - "post_evidence_gate_recheck": 0, - "repair": 0 - }, - "input": { - "answer_mode": "normal", - "degraded_message": "", - "resolved_target": "src/app_runtime/control/http_app.py", - "draft_answer_preview": "Конкретная точка health endpoint подтверждена:\n\n- GET /health (объявлен в src/app_runtime/control/http_app.py:31-34)\n\nДругие endpoints найдены, но не являются точками health:\n\n- POST /actions/{action}\n- GET /actions/{action} (эти маршруты объявлены там же, но не отмечены как health check)", - "repair_candidate": true - }, - "output": { - "passed": true, - "action": "return", - "reasons": [], - "repair_used": false, - "final_answer_preview": "Конкретная точка health endpoint подтверждена:\n\n- GET /health (объявлен в src/app_runtime/control/http_app.py:31-34)\n\nДругие endpoints найдены, но не являются точками health:\n\n- POST /actions/{action}\n- GET /actions/{action} (эти маршруты объявлены там же, но не отмечены как health check)" - } - } - ] - } -} \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/plba_quality_focus_v3/20260312_173122/full_chain_plba_quality_focus_plba-v2-find-entrypoints-health-endpoint.md b/tests/pipeline_setup_v3/test_results/plba_quality_focus_v3/20260312_173122/full_chain_plba_quality_focus_plba-v2-find-entrypoints-health-endpoint.md deleted file mode 100644 index 252b167..0000000 --- a/tests/pipeline_setup_v3/test_results/plba_quality_focus_v3/20260312_173122/full_chain_plba_quality_focus_plba-v2-find-entrypoints-health-endpoint.md +++ /dev/null @@ -1,261 +0,0 @@ -# plba-v2-find-entrypoints-health-endpoint - -- source_file: /Users/alex/Dev_projects_v2/ai driven app process/v2/agent/tests/pipeline_setup_v3/tmp/full_chain_plba_quality_focus.yaml -- runner: agent_runtime -- mode: full_chain -- passed: True - -## Query -Где health endpoint? - -## Actual -{ - "intent": "CODE_QA", - "sub_intent": "FIND_ENTRYPOINTS", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "rag_count": 10, - "llm_answer": "Конкретная точка health endpoint подтверждена:\n\n- GET /health (объявлен в src/app_runtime/control/http_app.py:31-34)\n\nДругие endpoints найдены, но не являются точками health:\n\n- POST /actions/{action}\n- GET /actions/{action} (эти маршруты объявлены там же, но не отмечены как health check)", - "answer_mode": "answered", - "path_scope": [], - "symbol_candidates": [ - "health", - "endpoint" - ], - "layers": [ - "C3_ENTRYPOINTS", - "C0_SOURCE_CHUNKS" - ] -} - -## Steps -[ - { - "step": "router", - "status": "completed", - "timings_ms": { - "router": 1 - }, - "output": { - "intent": "CODE_QA", - "sub_intent": "FIND_ENTRYPOINTS", - "graph_id": "CodeQAGraph", - "conversation_mode": "START" - } - }, - { - "step": "retrieval", - "status": "completed", - "timings_ms": { - "retrieval": 254 - }, - "output": { - "rag_count": 10, - "answer_path_rag_count": 10, - "resolved_symbol_status": "not_found", - "resolved_symbol": null, - "requested_layers": [ - "C3_ENTRYPOINTS", - "C0_SOURCE_CHUNKS" - ] - }, - "diagnostics": { - "executed_layers": [ - "C3_ENTRYPOINTS", - "C0_SOURCE_CHUNKS" - ], - "retrieval_mode_by_layer": { - "C3_ENTRYPOINTS": "vector", - "C0_SOURCE_CHUNKS": "exact_path_fetch" - }, - "top_k_by_layer": { - "C3_ENTRYPOINTS": 12, - "C0_SOURCE_CHUNKS": 24 - }, - "filters_by_layer": { - "C3_ENTRYPOINTS": { - "path_scope": [] - }, - "C0_SOURCE_CHUNKS": { - "path_scope": [ - "src/app_runtime/control/http_app.py" - ] - } - }, - "fallback": { - "used": false, - "reason": null - }, - "retrieval_by_layer_ms": { - "C3_ENTRYPOINTS": 240, - "C0_SOURCE_CHUNKS": 9 - }, - "supplemental_requests": [ - { - "layer": "C0_SOURCE_CHUNKS", - "query": "Где health endpoint?", - "ranking_profile": "entrypoint_source_hydration" - } - ] - } - }, - { - "step": "pre_evidence_gate", - "status": "passed", - "timings_ms": { - "pre_evidence_gate": 1 - }, - "input": { - "resolved_target": "src/app_runtime/control/http_app.py", - "sub_intent": "FIND_ENTRYPOINTS", - "target_type": "file", - "evidence_count": 10, - "code_chunk_count": 10, - "entrypoint_count": 3, - "relation_count": 0, - "test_evidence_count": 0, - "symbol_resolution_status": "not_found", - "path_scope": [] - }, - "output": { - "passed": true, - "failure_reasons": [], - "degraded_message": "", - "evidence_count": 10 - } - }, - { - "step": "llm", - "status": "completed", - "timings_ms": { - "llm": 3666 - }, - "output": { - "prompt_name": "code_qa_find_entrypoints_answer", - "answer_preview": "Конкретная точка health endpoint подтверждена:\n\n- GET /health (объявлен в src/app_runtime/control/http_app.py:31-34)\n\nДругие endpoints найдены, но не являются точками health:\n\n- POST /actions/{action}\n- GET /actions/{action} (эти маршруты объявлены там же, но не отмечены как health check)", - "resolved_target": "src/app_runtime/control/http_app.py", - "answer_policy_branch": "normal_answer", - "decision_reason": "evidence_sufficient" - } - }, - { - "step": "post_evidence_gate", - "status": "passed", - "timings_ms": { - "post_evidence_gate": 1, - "post_evidence_gate_recheck": 0, - "repair": 0 - }, - "input": { - "answer_mode": "normal", - "degraded_message": "", - "resolved_target": "src/app_runtime/control/http_app.py", - "draft_answer_preview": "Конкретная точка health endpoint подтверждена:\n\n- GET /health (объявлен в src/app_runtime/control/http_app.py:31-34)\n\nДругие endpoints найдены, но не являются точками health:\n\n- POST /actions/{action}\n- GET /actions/{action} (эти маршруты объявлены там же, но не отмечены как health check)", - "repair_candidate": true - }, - "output": { - "passed": true, - "action": "return", - "reasons": [], - "repair_used": false, - "final_answer_preview": "Конкретная точка health endpoint подтверждена:\n\n- GET /health (объявлен в src/app_runtime/control/http_app.py:31-34)\n\nДругие endpoints найдены, но не являются точками health:\n\n- POST /actions/{action}\n- GET /actions/{action} (эти маршруты объявлены там же, но не отмечены как health check)" - } - } -] - -## Diagnostics -{ - "intent_correct": null, - "target_found": true, - "layers_used": [ - "C3_ENTRYPOINTS", - "C0_SOURCE_CHUNKS" - ], - "retrieval_sufficient": true, - "answer_mode": "normal", - "resolved_target": "src/app_runtime/control/http_app.py", - "answer_policy_branch": "normal_answer", - "decision_reason": "evidence_sufficient", - "router_result": { - "intent": "CODE_QA", - "graph_id": "CodeQAGraph", - "conversation_mode": "START", - "retrieval_profile": "code", - "sub_intent": "FIND_ENTRYPOINTS", - "path_scope": [], - "layers": [ - "C3_ENTRYPOINTS", - "C0_SOURCE_CHUNKS" - ], - "symbol_resolution_status": "not_found" - }, - "retrieval_request": { - "rag_session_id": "7d11da21-faa0-4cea-aede-aeabe069164c", - "query": "Где health endpoint?", - "sub_intent": "FIND_ENTRYPOINTS", - "path_scope": [], - "requested_layers": [ - "C3_ENTRYPOINTS", - "C0_SOURCE_CHUNKS" - ] - }, - "per_layer_outcome": [ - { - "layer_id": "C3_ENTRYPOINTS", - "hit_count": 3, - "empty": false, - "fallback_used": false - }, - { - "layer_id": "C0_SOURCE_CHUNKS", - "hit_count": 7, - "empty": false, - "fallback_used": false - } - ], - "empty_layers": [], - "evidence_gate_decision": { - "sufficient": true, - "failure_reasons": [], - "evidence_count": 10 - }, - "evidence_gate_input": { - "resolved_target": "src/app_runtime/control/http_app.py", - "sub_intent": "FIND_ENTRYPOINTS", - "target_type": "file", - "evidence_count": 10, - "code_chunk_count": 10, - "entrypoint_count": 3, - "relation_count": 0, - "test_evidence_count": 0, - "symbol_resolution_status": "not_found", - "path_scope": [] - }, - "post_evidence_gate": { - "input": { - "answer_mode": "normal", - "degraded_message": "", - "resolved_target": "src/app_runtime/control/http_app.py", - "draft_answer_preview": "Конкретная точка health endpoint подтверждена:\n\n- GET /health (объявлен в src/app_runtime/control/http_app.py:31-34)\n\nДругие endpoints найдены, но не являются точками health:\n\n- POST /actions/{action}\n- GET /actions/{action} (эти маршруты объявлены там же, но не отмечены как health check)", - "repair_candidate": true - }, - "output": { - "passed": true, - "action": "return", - "reasons": [], - "repair_used": false, - "final_answer_preview": "Конкретная точка health endpoint подтверждена:\n\n- GET /health (объявлен в src/app_runtime/control/http_app.py:31-34)\n\nДругие endpoints найдены, но не являются точками health:\n\n- POST /actions/{action}\n- GET /actions/{action} (эти маршруты объявлены там же, но не отмечены как health check)" - } - }, - "failure_reasons": [], - "timings_ms": { - "router": 1, - "retrieval": 254, - "pre_evidence_gate": 1, - "llm": 3666, - "post_evidence_gate": 1 - } -} - -## Mismatches -- none \ No newline at end of file diff --git a/tests/pipeline_setup_v3/test_results/plba_quality_focus_v3/20260312_173122/summary.md b/tests/pipeline_setup_v3/test_results/plba_quality_focus_v3/20260312_173122/summary.md deleted file mode 100644 index b4a62cb..0000000 --- a/tests/pipeline_setup_v3/test_results/plba_quality_focus_v3/20260312_173122/summary.md +++ /dev/null @@ -1,16 +0,0 @@ -# pipeline_setup_v3 summary - -Passed: 2/2 - -| File | Case | Mode | Query | Actual sub-intent | RAG layers | Pass | -|------|------|------|-------|-------------------|------------|------| -| full_chain_plba_quality_focus.yaml | plba-v2-find-entrypoints-health-endpoint | full_chain | Где health endpoint? | FIND_ENTRYPOINTS | C0_SOURCE_CHUNKS:7, C3_ENTRYPOINTS:3 | ✓ | -| full_chain_plba_quality_focus.yaml | plba-v2-explain-nonexistent-symbol | full_chain | Объясни класс RuntimeFactoryManager | EXPLAIN | — | ✓ | - -## LLM Answers -- **plba-v2-find-entrypoints-health-endpoint** - Query: Где health endpoint? - > Конкретная точка health endpoint подтверждена: \- GET /health \(объявлен в src/app\_runtime/control/http\_app.py:31\-34\) Другие endpoints найдены, но не являются точками health: \- POST /actions/\{action\} \- GET /actions/\{action\} \(эти маршруты объявлены там же, но не отмечены как health check\) -- **plba-v2-explain-nonexistent-symbol** - Query: Объясни класс RuntimeFactoryManager - > Сущность RuntimeFactoryManager не найдена в доступном коде. \ No newline at end of file diff --git a/tests/unit_tests/rag/intent_router_testkit.py b/tests/unit_tests/rag/intent_router_testkit.py index 1fb4da9..52cbb51 100644 --- a/tests/unit_tests/rag/intent_router_testkit.py +++ b/tests/unit_tests/rag/intent_router_testkit.py @@ -16,10 +16,12 @@ def repo_context() -> RepoContext: RagLayer.CODE_DEPENDENCY_GRAPH, RagLayer.CODE_SEMANTIC_ROLES, RagLayer.CODE_SOURCE_CHUNKS, - RagLayer.DOCS_MODULE_CATALOG, + RagLayer.DOCS_DOC_CHUNKS, + RagLayer.DOCS_DOCUMENT_CATALOG, RagLayer.DOCS_FACT_INDEX, - RagLayer.DOCS_SECTION_INDEX, - RagLayer.DOCS_POLICY_INDEX, + RagLayer.DOCS_ENTITY_CATALOG, + RagLayer.DOCS_WORKFLOW_INDEX, + RagLayer.DOCS_RELATION_GRAPH, ], ) diff --git a/tests/unit_tests/rag/test_docs_indexing_pipeline.py b/tests/unit_tests/rag/test_docs_indexing_pipeline.py index 675d3aa..98f3bcb 100644 --- a/tests/unit_tests/rag/test_docs_indexing_pipeline.py +++ b/tests/unit_tests/rag/test_docs_indexing_pipeline.py @@ -2,40 +2,78 @@ from app.modules.rag.contracts.enums import RagLayer from app.modules.rag.indexing.docs.pipeline import DocsIndexingPipeline -def test_docs_pipeline_builds_catalog_facts_sections_and_policy() -> None: +def test_docs_pipeline_builds_new_d0_to_d5_layers() -> None: pipeline = DocsIndexingPipeline() content = """--- id: api.billing.create_invoice -type: policy -domain: billing +type: api_method +name: create_invoice +title: Create Invoice API +module: billing +layer: application +status: draft +updated_at: 2026-03-23 +tags: [billing, api] +entities: [Invoice] +parent: billing_api +children: [] links: - calls_api: - - api.billing.validate_invoice -tags: [billing] -status: active + - type: related_api + target: api.billing.validate_invoice --- -# Create Invoice - -## Spec Summary +# Summary Creates an invoice in billing. -## Request Contract +# Details + +## Описание + +Создает счет на оплату. + +## Сценарий + +**Название:** +Create invoice + +**Предусловия:** +- billing service is available + +**Триггер:** +- client sends create invoice request + +**Основной сценарий:** +1. Validate payload. +2. Create invoice. + +**Альтернативный сценарий:** +1. Reject invalid payload. + +**Обработка ошибок:** +1. Return validation error. + +**Постусловие:** +- Invoice is created. + +## Контракт + +### Входные параметры | field | type | required | validation | | --- | --- | --- | --- | | amount | decimal | yes | > 0 | -## Error Matrix +### Выходные параметры + +| field | type | required | +| --- | --- | --- | +| invoice_id | string | yes | + +## Ошибки | status | error | client action | | --- | --- | --- | | 400 | invalid_amount | fix request | - -## Rules - -- metric: billing.invoice.created -- rule: amount must be positive """ docs = pipeline.index_file( repo_id="acme/proj", @@ -45,19 +83,31 @@ Creates an invoice in billing. ) layers = {doc.layer for doc in docs} - assert RagLayer.DOCS_MODULE_CATALOG in layers + assert RagLayer.DOCS_DOC_CHUNKS in layers + assert RagLayer.DOCS_DOCUMENT_CATALOG in layers assert RagLayer.DOCS_FACT_INDEX in layers - assert RagLayer.DOCS_SECTION_INDEX in layers - assert RagLayer.DOCS_POLICY_INDEX in layers + assert RagLayer.DOCS_ENTITY_CATALOG in layers + assert RagLayer.DOCS_WORKFLOW_INDEX in layers + assert RagLayer.DOCS_RELATION_GRAPH in layers - module_doc = next(doc for doc in docs if doc.layer == RagLayer.DOCS_MODULE_CATALOG) - assert module_doc.metadata["module_id"] == "api.billing.create_invoice" - assert module_doc.metadata["type"] == "policy" + catalog_doc = next(doc for doc in docs if doc.layer == RagLayer.DOCS_DOCUMENT_CATALOG) + assert catalog_doc.metadata["document_id"] == "api.billing.create_invoice" + assert catalog_doc.metadata["module"] == "billing" fact_texts = [doc.text for doc in docs if doc.layer == RagLayer.DOCS_FACT_INDEX] - assert any("calls_api" in text for text in fact_texts) - assert any("has_field" in text for text in fact_texts) - assert any("returns_error" in text for text in fact_texts) + assert any("has_field amount" in text for text in fact_texts) + assert any("field_required amount:yes" in text for text in fact_texts) + assert any("returns_error invalid_amount" in text for text in fact_texts) - section_doc = next(doc for doc in docs if doc.layer == RagLayer.DOCS_SECTION_INDEX) - assert section_doc.metadata["section_path"] + entity_doc = next(doc for doc in docs if doc.layer == RagLayer.DOCS_ENTITY_CATALOG) + assert entity_doc.metadata["entity_name"] == "Invoice" + + workflow_doc = next(doc for doc in docs if doc.layer == RagLayer.DOCS_WORKFLOW_INDEX) + assert workflow_doc.metadata["workflow_name"] == "Create invoice" + + relation_targets = [doc.metadata["target_id"] for doc in docs if doc.layer == RagLayer.DOCS_RELATION_GRAPH] + assert "billing_api" in relation_targets + assert "api.billing.validate_invoice" in relation_targets + + chunk_doc = next(doc for doc in docs if doc.layer == RagLayer.DOCS_DOC_CHUNKS) + assert chunk_doc.metadata["section_path"] diff --git a/tests/unit_tests/rag/test_docs_prompt_layer.py b/tests/unit_tests/rag/test_docs_prompt_layer.py new file mode 100644 index 0000000..370bd9b --- /dev/null +++ b/tests/unit_tests/rag/test_docs_prompt_layer.py @@ -0,0 +1,146 @@ +from __future__ import annotations + +from app.modules.agent.intent_router_v2 import IntentRouterV2 +from app.modules.agent.llm.prompt_loader import PromptLoader +from app.modules.agent.runtime.docs_qa_pipeline import DocsQAPipelineRunner +from app.modules.agent.runtime.docs_qa_pipeline.openapi_postprocessor import OpenAPIPostprocessor +from app.modules.agent.runtime.docs_qa_pipeline.prompt_payload_builder import DocsPromptPayloadBuilder +from app.modules.agent.runtime.steps.generation import RuntimePromptSelector +from tests.docs_qa_eval.fixture_adapter import InMemoryDocsRetrievalAdapter +from tests.unit_tests.rag.intent_router_testkit import repo_context + + +class FakeLlm: + def __init__(self, response: str) -> None: + self.response = response + self.calls: list[tuple[str, str]] = [] + + def generate(self, prompt_name: str, user_input: str, *, log_context: str | None = None) -> str: + self.calls.append((prompt_name, user_input)) + return self.response + + +def test_docs_prompt_registry_contains_new_prompts() -> None: + loader = PromptLoader() + + for name in ( + "docs_explain_answer", + "docs_general_answer", + "docs_openapi_answer", + "docs_openapi_fragment_answer", + ): + assert loader.load(name) + + +def test_prompt_selector_uses_docs_prompts_only() -> None: + selector = RuntimePromptSelector() + + assert selector.select(intent="DOCUMENTATION_EXPLAIN", sub_intent="COMPONENT_EXPLAIN", answer_mode="normal") == "docs_explain_answer" + assert selector.select(intent="GENERAL_QA", sub_intent="GENERIC_QA", answer_mode="degraded") == "docs_general_answer" + assert selector.select(intent="OPENAPI_GENERATION", sub_intent="OPENAPI_METHOD_GENERATE", answer_mode="normal") == "docs_openapi_answer" + assert selector.select(intent="OPENAPI_GENERATION", sub_intent="OPENAPI_FRAGMENT_GENERATE", answer_mode="normal") == "docs_openapi_fragment_answer" + + +def test_docs_prompt_payload_contains_required_contract() -> None: + builder = DocsPromptPayloadBuilder() + from app.modules.agent.runtime.docs_qa_pipeline.models import DocsEvidenceBundle, OpenAPIResult + + payload = builder.build( + question="Объясни billing", + intent="DOCUMENTATION_EXPLAIN", + sub_intent="COMPONENT_EXPLAIN", + evidence_bundle=DocsEvidenceBundle( + intent="DOCUMENTATION_EXPLAIN", + sub_intent="COMPONENT_EXPLAIN", + documents=[{"title": "Billing"}], + facts=[{"content": "Handles payments"}], + relations=[{"title": "Billing -> Orders"}], + ), + api_contract=OpenAPIResult(path="/orders", method="post"), + ) + + assert '"question": "Объясни billing"' in payload + assert '"intent": "DOCUMENTATION_EXPLAIN"' in payload + assert '"sub_intent": "COMPONENT_EXPLAIN"' in payload + assert '"documents"' in payload + assert '"facts"' in payload + assert '"relations"' in payload + assert '"api_contract"' in payload + + +def test_openapi_postprocessor_requires_paths_for_full_spec() -> None: + validator = OpenAPIPostprocessor() + + assert validator.validate("paths:\n /orders:\n post:\n responses: {}", require_paths=True)[0] is True + assert validator.validate("type: object\nproperties:\n id: {}", require_paths=True)[0] is False + assert validator.validate("type: object\nproperties:\n id: {}", require_paths=False)[0] is True + + +def test_docs_pipeline_uses_llm_prompt_and_validates_openapi() -> None: + rows = [ + { + "layer": "D2_FACT_INDEX", + "path": "docs/api/orders-create.md", + "title": "POST /orders", + "content": "Create order", + "metadata": { + "endpoint": "/orders", + "http_method": "post", + "request_schema": {"type": "object", "properties": {"customer_id": {}}}, + "response_schema": {"type": "object", "properties": {"order_id": {}}}, + }, + } + ] + llm = FakeLlm("not yaml") + runner = DocsQAPipelineRunner( + IntentRouterV2(), + InMemoryDocsRetrievalAdapter(rows), + repo_context=repo_context(), + llm=llm, + ) + + result = runner.run("Сгенерируй openapi spec для создания заказа", "docs-session") + + assert llm.calls + assert llm.calls[0][0] == "docs_openapi_answer" + assert result.prompt_name == "docs_openapi_answer" + assert result.output_valid is False + assert "paths:" in result.answer + assert result.diagnostics.prompt_used == "docs_openapi_answer" + assert result.diagnostics.llm_mode == "yaml" + + +def test_pre_llm_mode_skips_llm_calls() -> None: + rows = [ + { + "layer": "D2_FACT_INDEX", + "path": "docs/api/orders-create.md", + "title": "POST /orders", + "content": "Create order", + "metadata": { + "endpoint": "/orders", + "http_method": "post", + "request_schema": {"type": "object", "properties": {"customer_id": {}}}, + }, + } + ] + llm = FakeLlm("unused") + runner = DocsQAPipelineRunner( + IntentRouterV2(), + InMemoryDocsRetrievalAdapter(rows), + repo_context=repo_context(), + llm=llm, + ) + + result = runner.run("Сгенерируй openapi для /orders", "docs-session", mode="pre_llm_only") + + assert llm.calls == [] + assert result.answer + assert result.mode == "pre_llm_only" + assert result.diagnostics.gate_decision == "partial" + assert result.answer_mode == "ready_partial" + assert "paths:" in result.answer + assert result.llm_request["prompt_name"] == "docs_openapi_answer" + assert "user_prompt" in result.llm_request + assert "system_prompt" in result.llm_request + assert result.diagnostics.prompt["prompt_name"] == "docs_openapi_answer" diff --git a/tests/unit_tests/rag/test_docs_qa_pipeline.py b/tests/unit_tests/rag/test_docs_qa_pipeline.py new file mode 100644 index 0000000..82c96ac --- /dev/null +++ b/tests/unit_tests/rag/test_docs_qa_pipeline.py @@ -0,0 +1,439 @@ +from __future__ import annotations + +from app.modules.agent.intent_router_v2 import IntentRouterV2 +from app.modules.agent.runtime.docs_qa_pipeline import DocsQAPipelineRunner +from tests.docs_qa_eval.fixture_adapter import InMemoryDocsRetrievalAdapter +from tests.unit_tests.rag.intent_router_testkit import repo_context + + +def test_docs_pipeline_uses_synthesizer_for_explain() -> None: + rows = [ + { + "layer": "D2_FACT_INDEX", + "path": "docs/components/billing.md", + "title": "Billing facts", + "content": "Billing обновляет статус заказа после оплаты.", + } + ] + runner = DocsQAPipelineRunner(IntentRouterV2(), InMemoryDocsRetrievalAdapter(rows), repo_context=repo_context()) + + result = runner.run("Объясни модуль billing в документации", "docs-session") + + assert result.router_result.intent == "DOCUMENTATION_EXPLAIN" + assert "Billing" in result.answer + assert result.openapi_result is None + assert result.diagnostics.facts_found == 1 + + +def test_docs_pipeline_uses_openapi_branch() -> None: + rows = [ + { + "layer": "D2_FACT_INDEX", + "path": "docs/api/orders-create.md", + "title": "POST /orders", + "content": "Create order", + "metadata": { + "endpoint": "/orders", + "http_method": "post", + "request_schema": {"type": "object", "properties": {"customer_id": {}}}, + "response_schema": {"type": "object", "properties": {"order_id": {}}}, + }, + } + ] + runner = DocsQAPipelineRunner(IntentRouterV2(), InMemoryDocsRetrievalAdapter(rows), repo_context=repo_context()) + + result = runner.run("Сгенерируй openapi spec для создания заказа", "docs-session") + + assert result.router_result.intent == "OPENAPI_GENERATION" + assert result.openapi_result is not None + assert result.openapi_result.path == "/orders" + assert result.openapi_result.method == "post" + assert result.answer_mode != "degraded" + assert result.diagnostics.gate_decision != "reject" + assert "paths:" in result.answer + assert "/orders" in result.answer + + +def test_docs_pipeline_keeps_query_candidates_for_not_found_entity() -> None: + runner = DocsQAPipelineRunner(IntentRouterV2(), InMemoryDocsRetrievalAdapter([]), repo_context=repo_context()) + + result = runner.run("Что такое сущность PaymentTransaction?", "docs-session") + + assert result.answer_mode == "degraded" + assert "PaymentTransaction" in result.diagnostics.query_entity_candidates + assert result.diagnostics.resolved_entity_candidates == [] + assert result.diagnostics.degraded_reason == "not_found_exact_anchor" + + +def test_docs_pipeline_reports_canonical_doc_ids_and_layers() -> None: + rows = [ + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/api/health.md", + "title": "Health relations", + "content": "Health -> runtime health", + "metadata": {"doc_id": "api.health_endpoint", "target_doc_id": "domain.runtime_health", "endpoint": "/health"}, + }, + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/domain/runtime-health.md", + "title": "Runtime health", + "content": "Runtime health overview", + "metadata": {"doc_id": "domain.runtime_health"}, + }, + ] + runner = DocsQAPipelineRunner(IntentRouterV2(), InMemoryDocsRetrievalAdapter(rows), repo_context=repo_context()) + + result = runner.run("Какие документы связаны с endpoint /health?", "docs-session") + + assert result.diagnostics.doc_ids[:2] == ["api.health_endpoint", "domain.runtime_health"] + assert result.diagnostics.planned_layers == ["D5_RELATION_GRAPH", "D1_DOCUMENT_CATALOG", "D0_DOC_CHUNKS"] + assert result.diagnostics.executed_layers == ["D5_RELATION_GRAPH", "D1_DOCUMENT_CATALOG", "D0_DOC_CHUNKS"] + assert result.diagnostics.non_empty_layers == ["D5_RELATION_GRAPH"] + assert result.diagnostics.relation_hits_count == 1 + assert result.diagnostics.relation_targets == ["domain.runtime_health"] + assert result.diagnostics.answer_mode == "answered" + assert result.diagnostics.layer_diagnostics["D5_RELATION_GRAPH"]["hits"] == 1 + assert result.diagnostics.gate_decision == "allow" + + +def test_related_docs_uses_relation_graph_as_primary_layer() -> None: + runner = DocsQAPipelineRunner(IntentRouterV2(), InMemoryDocsRetrievalAdapter([]), repo_context=repo_context()) + + result = runner.run("Что еще посмотреть по теме billing?", "docs-session") + + assert result.router_result.query_plan.sub_intent == "RELATED_DOCS_EXPLAIN" + assert result.diagnostics.planned_layers[0] == "D5_RELATION_GRAPH" + assert result.diagnostics.executed_layers[0] == "D5_RELATION_GRAPH" + + +def test_openapi_partial_contract_returns_partial_mode() -> None: + rows = [ + { + "layer": "D2_FACT_INDEX", + "path": "docs/api/orders-create.md", + "title": "POST /orders", + "content": "Create order", + "metadata": { + "endpoint": "/orders", + "http_method": "post", + "request_schema": {"type": "object", "properties": {"customer_id": {}}}, + "doc_id": "api.orders_create", + }, + } + ] + runner = DocsQAPipelineRunner(IntentRouterV2(), InMemoryDocsRetrievalAdapter(rows), repo_context=repo_context()) + + result = runner.run("Сгенерируй openapi для /orders", "docs-session") + + assert result.answer_mode == "structured_spec_partial" + assert result.degraded_reason == "answered_with_gaps" + assert result.openapi_result is not None + assert result.openapi_result.path == "/orders" + assert result.diagnostics.gate_decision == "partial" + assert "paths:" in result.answer + assert "/orders" in result.answer + + +def test_pre_llm_mode_returns_diagnostic_only_without_answer_generation() -> None: + rows = [ + { + "layer": "D2_FACT_INDEX", + "path": "docs/components/runtime-manager.md", + "title": "RuntimeManager", + "content": "Coordinates runtime orchestration.", + "metadata": {"doc_id": "architecture.runtime_manager", "component": "RuntimeManager"}, + } + ] + runner = DocsQAPipelineRunner(IntentRouterV2(), InMemoryDocsRetrievalAdapter(rows), repo_context=repo_context()) + + result = runner.run("Какую роль в системе играет RuntimeManager?", "docs-session", mode="pre_llm_only") + + assert result.mode == "pre_llm_only" + assert result.answer == "" + assert result.diagnostics.gate_decision == "allow" + assert "RuntimeManager" in result.diagnostics.query_entity_candidates + assert "RuntimeManager" in result.diagnostics.resolved_entity_candidates + + +def test_pre_llm_mode_detects_path_anchor_candidates() -> None: + rows = [ + { + "layer": "D2_FACT_INDEX", + "path": "docs/api/health.md", + "title": "GET /health", + "content": "Health endpoint", + "metadata": {"doc_id": "api.health_endpoint", "endpoint": "/health", "http_method": "get"}, + } + ] + runner = DocsQAPipelineRunner(IntentRouterV2(), InMemoryDocsRetrievalAdapter(rows), repo_context=repo_context()) + + result = runner.run("Объясни API метод /health", "docs-session", mode="pre_llm_only") + + assert "/health" in result.diagnostics.query_anchor_candidates + assert "/health" in result.diagnostics.resolved_anchor_candidates + assert result.diagnostics.planned_layers == ["D2_FACT_INDEX", "D4_WORKFLOW_INDEX", "D1_DOCUMENT_CATALOG", "D0_DOC_CHUNKS"] + assert set(result.diagnostics.executed_layers) == {"D1_DOCUMENT_CATALOG", "D2_FACT_INDEX", "D4_WORKFLOW_INDEX", "D0_DOC_CHUNKS"} + + +def test_pre_llm_openapi_gate_reports_missing_signals() -> None: + rows = [ + { + "layer": "D2_FACT_INDEX", + "path": "docs/api/orders.md", + "title": "POST /orders", + "content": "Create order", + "metadata": {"doc_id": "api.orders_create", "endpoint": "/orders", "http_method": "post"}, + } + ] + runner = DocsQAPipelineRunner(IntentRouterV2(), InMemoryDocsRetrievalAdapter(rows), repo_context=repo_context()) + + result = runner.run("Сгенерируй openapi для /orders", "docs-session", mode="pre_llm_only") + + assert result.diagnostics.gate_decision == "partial" + assert result.diagnostics.gate_decision_reason == "answered_with_gaps" + assert result.answer_mode == "ready_partial" + assert result.answer + assert "paths:" in result.answer + assert "path_found" in result.diagnostics.gate_satisfied_requirements + assert "http_method_found" in result.diagnostics.gate_satisfied_requirements + assert "contract_fields_found" in result.diagnostics.gate_missing_requirements + assert result.diagnostics.evidence_summary["openapi_signals"]["path_found"] is True + assert result.diagnostics.openapi_evidence["path_found"] is True + assert result.diagnostics.layer_diagnostics["D2_FACT_INDEX"]["hits"] == 1 + + +def test_related_docs_keeps_relation_hits_when_exact_anchor_is_missing() -> None: + rows = [ + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/relations/health-links.md", + "title": "Health relations", + "content": "Runtime health and service overview", + "metadata": { + "document_id": "api.health_endpoint", + "target_document_id": "domain.runtime_health", + }, + } + ] + runner = DocsQAPipelineRunner(IntentRouterV2(), InMemoryDocsRetrievalAdapter(rows), repo_context=repo_context()) + + result = runner.run("Какие документы связаны с endpoint /health?", "docs-session", mode="pre_llm_only") + + assert result.router_result.query_plan.sub_intent == "RELATED_DOCS_EXPLAIN" + assert result.diagnostics.doc_ids[:2] == ["api.health_endpoint", "domain.runtime_health"] + assert result.diagnostics.relation_hits_count == 1 + assert result.diagnostics.exact_anchor_match is False + assert result.diagnostics.gate_decision == "allow" + assert result.diagnostics.gate_decision_reason == "relation_evidence_available" + + +def test_related_docs_exact_path_outranks_neighboring_api_doc() -> None: + rows = [ + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/api/control-actions-endpoint.md", + "title": "HTTP API /actions/{action}", + "content": "Nearby API relation", + "metadata": { + "document_id": "api.control_actions_endpoint", + "target_document_id": "architecture.telegram_notify_app", + }, + }, + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/documentation/api/health-endpoint.md", + "title": "HTTP API /health", + "content": "Health relation", + "metadata": { + "document_id": "api.health_endpoint", + "target_document_id": "domain.runtime_health", + "endpoint": "/health", + }, + }, + ] + runner = DocsQAPipelineRunner(IntentRouterV2(), InMemoryDocsRetrievalAdapter(rows), repo_context=repo_context()) + + result = runner.run("Какие документы связаны с endpoint /health?", "docs-session", mode="pre_llm_only") + + assert result.diagnostics.anchor_candidates[0] == "api.health_endpoint" + assert result.diagnostics.selected_anchor == "api.health_endpoint" + assert result.diagnostics.anchor_match_type == "exact_path" + assert result.diagnostics.anchor_selection_reason == "metadata.endpoint exact match" + assert result.diagnostics.doc_ids[0] == "api.health_endpoint" + + +def test_pre_llm_targeted_chunk_fallback_enriches_api_method_layers() -> None: + rows = [ + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/api/health.md", + "title": "GET /health", + "content": "Health endpoint", + "metadata": {"doc_id": "api.health_endpoint"}, + }, + { + "layer": "D0_DOC_CHUNKS", + "path": "docs/api/health.md", + "title": "api.health_endpoint:Scenario", + "content": "request -> check runtime -> return status", + "metadata": {"doc_id": "api.health_endpoint"}, + }, + ] + runner = DocsQAPipelineRunner(IntentRouterV2(), InMemoryDocsRetrievalAdapter(rows), repo_context=repo_context()) + + result = runner.run("Объясни API метод /health", "docs-session", mode="pre_llm_only") + + assert "D0_DOC_CHUNKS" in result.diagnostics.executed_layers + assert "D0_DOC_CHUNKS" in result.diagnostics.non_empty_layers + assert result.diagnostics.layer_diagnostics["D0_DOC_CHUNKS"]["hits"] == 1 + assert result.diagnostics.selected_chunk_ids == ["api.health_endpoint"] + + +def test_openapi_request_fragment_uses_fragment_aware_gate() -> None: + rows = [ + { + "layer": "D2_FACT_INDEX", + "path": "docs/api/send.md", + "title": "POST /send", + "content": "Request payload contains message and chat_id fields.", + "metadata": { + "document_id": "api.send_message_endpoint", + "endpoint": "/send", + "http_method": "post", + }, + } + ] + runner = DocsQAPipelineRunner(IntentRouterV2(), InMemoryDocsRetrievalAdapter(rows), repo_context=repo_context()) + + result = runner.run("Сгенерируй request schema для endpoint /send", "docs-session", mode="pre_llm_only") + + assert result.router_result.query_plan.sub_intent == "OPENAPI_FRAGMENT_GENERATE" + assert result.diagnostics.requested_fragment_type == "request_schema" + assert "path" in result.diagnostics.fragment_evidence_found + assert "payload_description" in result.diagnostics.fragment_evidence_found + assert result.diagnostics.gate_decision in {"allow", "partial"} + assert result.diagnostics.gate_decision_reason in {"evidence_sufficient", "fragment_payload_only"} + assert result.diagnostics.fragment_missing_requirements == [] + assert result.answer_mode in {"ready", "ready_partial"} + assert result.answer + assert "type: object" in result.answer + assert "message:" in result.answer + assert "chat_id:" in result.answer + + +def test_openapi_method_with_only_path_is_rejected() -> None: + rows = [ + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/api/health.md", + "title": "/health", + "content": "", + "metadata": {"endpoint": "/health", "doc_id": "api.health_endpoint"}, + } + ] + runner = DocsQAPipelineRunner(IntentRouterV2(), InMemoryDocsRetrievalAdapter(rows), repo_context=repo_context()) + + result = runner.run("Сгенерируй OpenAPI для endpoint /health", "docs-session", mode="pre_llm_only") + + assert result.diagnostics.gate_decision == "reject" + assert result.answer_mode == "degraded" + + +def test_openapi_response_fragment_does_not_require_request_payload() -> None: + rows = [ + { + "layer": "D2_FACT_INDEX", + "path": "docs/api/health.md", + "title": "GET /health", + "content": "Returns 200 with status and uptime fields.", + "metadata": { + "endpoint": "/health", + "http_method": "get", + "response_schema": {"type": "object", "properties": {"status": {}, "uptime": {}}}, + }, + } + ] + runner = DocsQAPipelineRunner(IntentRouterV2(), InMemoryDocsRetrievalAdapter(rows), repo_context=repo_context()) + + result = runner.run("Сгенерируй response schema для endpoint /health", "docs-session", mode="pre_llm_only") + + assert result.diagnostics.requested_fragment_type == "response_schema" + assert result.diagnostics.gate_decision != "reject" + assert result.answer_mode != "degraded" + assert "properties:" in result.answer + + +def test_system_flow_evidence_prefers_workflows_and_relations() -> None: + rows = [ + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/workflows/checkout.md", + "title": "Checkout overview", + "content": "Overview doc", + "metadata": {"doc_id": "workflow.checkout"}, + }, + { + "layer": "D4_WORKFLOW_INDEX", + "path": "docs/workflows/checkout.md", + "title": "Checkout steps", + "content": "cart -> payment -> confirm", + "metadata": {"workflow_id": "workflow.checkout"}, + }, + { + "layer": "D5_RELATION_GRAPH", + "path": "docs/workflows/checkout.md", + "title": "Checkout relations", + "content": "Related to payment entity", + "metadata": {"doc_id": "workflow.checkout", "target_doc_id": "domain.payment"}, + }, + { + "layer": "D0_DOC_CHUNKS", + "path": "docs/workflows/checkout.md", + "title": "workflow.checkout:chunk", + "content": "payment step persists order", + "metadata": {"chunk_id": "chunk.checkout.1", "doc_id": "workflow.checkout"}, + }, + ] + runner = DocsQAPipelineRunner(IntentRouterV2(), InMemoryDocsRetrievalAdapter(rows), repo_context=repo_context()) + + result = runner.run("Объясни как работает checkout workflow", "docs-session", mode="pre_llm_only") + + assert result.diagnostics.planned_layers == ["D4_WORKFLOW_INDEX", "D5_RELATION_GRAPH", "D1_DOCUMENT_CATALOG", "D0_DOC_CHUNKS"] + assert result.diagnostics.selected_workflow_ids == ["workflow.checkout"] + assert result.diagnostics.selected_relation_ids == ["domain.payment"] + assert result.diagnostics.selected_chunk_ids == ["chunk.checkout.1"] + + +def test_component_evidence_prefers_facts_and_targeted_chunks() -> None: + rows = [ + { + "layer": "D1_DOCUMENT_CATALOG", + "path": "docs/components/runtime-manager.md", + "title": "Runtime manager", + "content": "Overview", + "metadata": {"doc_id": "architecture.runtime_manager"}, + }, + { + "layer": "D2_FACT_INDEX", + "path": "docs/components/runtime-manager.md", + "title": "Runtime facts", + "content": "Coordinates runtime orchestration", + "metadata": {"fact_id": "fact.runtime_manager.role", "doc_id": "architecture.runtime_manager"}, + }, + { + "layer": "D0_DOC_CHUNKS", + "path": "docs/components/runtime-manager.md", + "title": "RuntimeManager chunk", + "content": "Starts worker loops and supervises control channels", + "metadata": {"chunk_id": "chunk.runtime_manager.1", "doc_id": "architecture.runtime_manager"}, + }, + ] + runner = DocsQAPipelineRunner(IntentRouterV2(), InMemoryDocsRetrievalAdapter(rows), repo_context=repo_context()) + + result = runner.run("Какую роль в системе играет RuntimeManager?", "docs-session", mode="pre_llm_only") + + assert result.diagnostics.planned_layers == ["D2_FACT_INDEX", "D5_RELATION_GRAPH", "D1_DOCUMENT_CATALOG", "D0_DOC_CHUNKS"] + assert result.diagnostics.selected_fact_ids == ["fact.runtime_manager.role"] + assert result.diagnostics.selected_doc_ids == ["architecture.runtime_manager"] + assert result.diagnostics.selected_chunk_ids == ["chunk.runtime_manager.1"] diff --git a/tests/unit_tests/rag/test_intent_router_e2e_flows.py b/tests/unit_tests/rag/test_intent_router_e2e_flows.py index 75f1c9f..803e824 100644 --- a/tests/unit_tests/rag/test_intent_router_e2e_flows.py +++ b/tests/unit_tests/rag/test_intent_router_e2e_flows.py @@ -53,7 +53,7 @@ def test_e2e_docs_switch_from_code_topic() -> None: ) assert_intent(first, "CODE_QA") - assert_intent(second, "DOCS_QA") + assert_intent(second, "DOCUMENTATION_EXPLAIN") assert second.conversation_mode == "SWITCH" assert_domains(second, ["DOCS"]) carried = [ diff --git a/tests/unit_tests/rag/test_intent_router_invariants.py b/tests/unit_tests/rag/test_intent_router_invariants.py index 9e26110..d4ff287 100644 --- a/tests/unit_tests/rag/test_intent_router_invariants.py +++ b/tests/unit_tests/rag/test_intent_router_invariants.py @@ -56,8 +56,8 @@ def test_invariant_inline_code_span_routes_to_code_and_extracts_symbol() -> None def test_invariant_docs_cyrillic_path_with_quotes() -> None: result = run_sequence(["Что сказано в «docs/архитектура.md»?"])[0] - assert_intent(result, "DOCS_QA") - assert_sub_intent(result, "EXPLAIN") + assert_intent(result, "DOCUMENTATION_EXPLAIN") + assert_sub_intent(result, "COMPONENT_EXPLAIN") assert_domains(result, ["DOCS"]) assert "docs/архитектура.md" in result.query_plan.normalized assert_has_file_path(result, "docs/архитектура.md") @@ -113,8 +113,92 @@ def test_invariant_open_file_sub_intent_uses_narrow_retrieval_profile() -> None: def test_invariant_docs_question_routes_to_docs() -> None: result = run_sequence(["Что сказано в документации?"])[0] - assert_intent(result, "DOCS_QA") + assert_intent(result, "DOCUMENTATION_EXPLAIN") assert_domains(result, ["DOCS"]) assert_domain_layer_prefixes(result) assert result.query_plan.keyword_hints assert any(item in result.query_plan.expansions for item in result.query_plan.keyword_hints) + + +def test_invariant_docs_flow_sub_intent_uses_workflow_layers() -> None: + result = run_sequence(["Как работает процесс создания заказа по документации?"])[0] + + assert_intent(result, "DOCUMENTATION_EXPLAIN") + assert_sub_intent(result, "SYSTEM_FLOW_EXPLAIN") + layer_ids = [item.layer_id for item in result.retrieval_spec.layer_queries] + assert layer_ids == ["D4_WORKFLOW_INDEX", "D5_RELATION_GRAPH", "D1_DOCUMENT_CATALOG", "D0_DOC_CHUNKS"] + + +def test_invariant_docs_entity_sub_intent_uses_entity_layers() -> None: + result = run_sequence(["Что такое сущность Order в документации?"])[0] + + assert_intent(result, "DOCUMENTATION_EXPLAIN") + assert_sub_intent(result, "ENTITY_EXPLAIN") + layer_ids = [item.layer_id for item in result.retrieval_spec.layer_queries] + assert layer_ids == ["D3_ENTITY_CATALOG", "D5_RELATION_GRAPH", "D1_DOCUMENT_CATALOG", "D0_DOC_CHUNKS"] + + +def test_invariant_entity_like_camel_case_prefers_entity_explain() -> None: + result = run_sequence(["Что такое WorkerHealth?"])[0] + + assert_intent(result, "DOCUMENTATION_EXPLAIN") + assert_sub_intent(result, "ENTITY_EXPLAIN") + + +def test_invariant_related_docs_routes_to_docs_explain() -> None: + result = run_sequence(["Найди документацию по billing"])[0] + + assert_intent(result, "DOCUMENTATION_EXPLAIN") + assert_sub_intent(result, "RELATED_DOCS_EXPLAIN") + layer_ids = [item.layer_id for item in result.retrieval_spec.layer_queries] + assert layer_ids == ["D5_RELATION_GRAPH", "D1_DOCUMENT_CATALOG", "D0_DOC_CHUNKS"] + + +def test_invariant_docs_navigation_uses_related_docs_explain() -> None: + result = run_sequence(["Что связано с checkout документацией?"])[0] + + assert_intent(result, "DOCUMENTATION_EXPLAIN") + assert_sub_intent(result, "RELATED_DOCS_EXPLAIN") + layer_ids = [item.layer_id for item in result.retrieval_spec.layer_queries] + assert layer_ids == ["D5_RELATION_GRAPH", "D1_DOCUMENT_CATALOG", "D0_DOC_CHUNKS"] + + +def test_invariant_openapi_routes_to_docs_layers_with_api_filter() -> None: + result = run_sequence(["Сгенерируй openapi yaml для создания заказа"])[0] + + assert_intent(result, "OPENAPI_GENERATION") + assert_sub_intent(result, "OPENAPI_METHOD_GENERATE") + layer_ids = [item.layer_id for item in result.retrieval_spec.layer_queries] + assert layer_ids == ["D1_DOCUMENT_CATALOG", "D2_FACT_INDEX", "D0_DOC_CHUNKS"] + assert result.retrieval_spec.filters.doc_type == "api_method" + + +def test_invariant_general_qa_routes_to_generic_docs_layers() -> None: + result = run_sequence(["Помоги разобраться"])[0] + + assert_intent(result, "GENERAL_QA") + assert_sub_intent(result, "GENERIC_QA") + assert_domains(result, ["DOCS"]) + layer_ids = [item.layer_id for item in result.retrieval_spec.layer_queries] + assert layer_ids == ["D1_DOCUMENT_CATALOG", "D0_DOC_CHUNKS"] + + +def test_invariant_component_like_manager_routes_to_component_explain() -> None: + result = run_sequence(["Какую роль в системе играет RuntimeManager?"])[0] + + assert_intent(result, "DOCUMENTATION_EXPLAIN") + assert_sub_intent(result, "COMPONENT_EXPLAIN") + + +def test_invariant_cycle_query_routes_to_system_flow_explain() -> None: + result = run_sequence(["Объясни как работает цикл отправки уведомлений"])[0] + + assert_intent(result, "DOCUMENTATION_EXPLAIN") + assert_sub_intent(result, "SYSTEM_FLOW_EXPLAIN") + + +def test_invariant_overview_question_routes_to_general_qa() -> None: + result = run_sequence(["Что вообще описано в документации по этому сервису?"])[0] + + assert_intent(result, "GENERAL_QA") + assert_sub_intent(result, "GENERIC_QA") diff --git a/tests/unit_tests/rag/test_intent_router_llm_disambiguation.py b/tests/unit_tests/rag/test_intent_router_llm_disambiguation.py new file mode 100644 index 0000000..d3b9dfa --- /dev/null +++ b/tests/unit_tests/rag/test_intent_router_llm_disambiguation.py @@ -0,0 +1,95 @@ +from __future__ import annotations + +import json + +from app.modules.agent.intent_router_v2 import ConversationState, IntentRouterV2 +from app.modules.agent.intent_router_v2.intent.classifier import IntentClassifierV2 +from app.modules.agent.intent_router_v2.intent.llm_disambiguator import DocsLlmDisambiguator +from tests.unit_tests.rag.intent_router_testkit import repo_context + + +class FakeLlm: + def __init__(self, response: str, *, fail: bool = False) -> None: + self.response = response + self.fail = fail + self.calls: list[tuple[str, str]] = [] + + def generate(self, prompt_name: str, user_input: str, *, log_context: str | None = None) -> str: + self.calls.append((prompt_name, user_input)) + if self.fail: + raise RuntimeError("llm unavailable") + return self.response + + +def test_technical_query_keeps_deterministic_routing_without_llm_call() -> None: + llm = FakeLlm('{"sub_intent":"GENERIC_QA","reason":"unused","confidence":"low"}') + router = IntentRouterV2( + classifier=IntentClassifierV2(), + llm_disambiguator=DocsLlmDisambiguator(llm), + enable_llm_disambiguation=True, + ) + + result = router.route("Объясни endpoint /health", ConversationState(), repo_context()) + + assert result.query_plan.sub_intent == "API_METHOD_EXPLAIN" + assert result.is_ambiguous is False + assert result.routing_mode == "deterministic" + assert result.llm_router_used is False + assert llm.calls == [] + + +def test_ambiguous_query_can_be_resolved_by_llm() -> None: + llm = FakeLlm('{"sub_intent":"ENTITY_EXPLAIN","reason":"runtime health is a concept/entity here","confidence":"medium"}') + router = IntentRouterV2( + classifier=IntentClassifierV2(), + llm_disambiguator=DocsLlmDisambiguator(llm), + enable_llm_disambiguation=True, + ) + + result = router.route("Объясни runtime health", ConversationState(), repo_context()) + + assert result.is_ambiguous is True + assert result.routing_mode == "llm_disambiguation" + assert result.llm_router_used is True + assert result.deterministic_selected_sub_intent + assert result.llm_router_selected_sub_intent == "ENTITY_EXPLAIN" + assert result.query_plan.sub_intent == "ENTITY_EXPLAIN" + + +def test_ambiguous_query_falls_back_to_deterministic_when_llm_fails() -> None: + llm = FakeLlm("{}", fail=True) + router = IntentRouterV2( + classifier=IntentClassifierV2(), + llm_disambiguator=DocsLlmDisambiguator(llm), + enable_llm_disambiguation=True, + ) + + result = router.route("Как работает health check runtime?", ConversationState(), repo_context()) + + assert result.is_ambiguous is True + assert result.routing_mode == "deterministic_fallback" + assert result.llm_router_used is False + assert result.llm_router_error == "llm unavailable" + assert result.query_plan.sub_intent == result.deterministic_selected_sub_intent + + +def test_overview_query_stays_in_generic_qa() -> None: + llm = FakeLlm('{"sub_intent":"GENERIC_QA","reason":"overview query","confidence":"high"}') + router = IntentRouterV2( + classifier=IntentClassifierV2(), + llm_disambiguator=DocsLlmDisambiguator(llm), + enable_llm_disambiguation=True, + ) + + result = router.route("Какая структура документации?", ConversationState(), repo_context()) + + assert result.is_ambiguous is False or result.query_plan.sub_intent == "GENERIC_QA" + assert result.intent == "GENERAL_QA" + assert result.query_plan.sub_intent == "GENERIC_QA" + + +def test_llm_disambiguator_rejects_unknown_labels() -> None: + llm = FakeLlm(json.dumps({"sub_intent": "MADE_UP", "reason": "bad", "confidence": "high"})) + disambiguator = DocsLlmDisambiguator(llm) + + assert disambiguator.choose({"query": "test"}) is None